diff --git a/.gitignore b/.gitignore index 665ef1db..949d7c05 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ v8.log RexBench/FlightPlanner/waypoints.js SeaMonster/inspector-json-payload.js wasm/argon2/build/argon2.wasm +# Only check-in compressed non-minified dev files. +*/dist/*.dev.js \ No newline at end of file diff --git a/JetStreamDriver.js b/JetStreamDriver.js index ee50fe3e..05ba2b63 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -3171,11 +3171,11 @@ for (const [name, enabled] of Object.entries(WTB_TESTS)) { BENCHMARKS.push(new AsyncBenchmark({ name: `${name}-wtb`, files: [ - `./web-tooling-benchmark/dist/${name}.bundle.js`, + `./web-tooling-benchmark/dist/${name}.bundle.min.js`, "./web-tooling-benchmark/benchmark.js", ], preload: { - BUNDLE: `./web-tooling-benchmark/dist/${name}.bundle.js`, + BUNDLE: `./web-tooling-benchmark/dist/${name}.bundle.min.js`, ...WPT_FILES, }, iterations: 15, diff --git a/web-tooling-benchmark/dist/acorn.LICENSE.txt b/web-tooling-benchmark/dist/acorn.LICENSE.txt deleted file mode 100644 index bcad4a4a..00000000 --- a/web-tooling-benchmark/dist/acorn.LICENSE.txt +++ /dev/null @@ -1,48 +0,0 @@ -acorn -MIT -MIT License - -Copyright (C) 2012-2022 by various contributors (see AUTHORS) - -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. - - -acorn-walk -MIT -MIT License - -Copyright (C) 2012-2020 by various contributors (see AUTHORS) - -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. diff --git a/web-tooling-benchmark/dist/acorn.bundle.dev.js.z b/web-tooling-benchmark/dist/acorn.bundle.dev.js.z new file mode 100644 index 00000000..b46db308 Binary files /dev/null and b/web-tooling-benchmark/dist/acorn.bundle.dev.js.z differ diff --git a/web-tooling-benchmark/dist/acorn.bundle.js b/web-tooling-benchmark/dist/acorn.bundle.js deleted file mode 100644 index 31dfde5b..00000000 --- a/web-tooling-benchmark/dist/acorn.bundle.js +++ /dev/null @@ -1,6872 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/acorn-walk/dist/walk.mjs": -/*!***********************************************!*\ - !*** ./node_modules/acorn-walk/dist/walk.mjs ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ancestor: () => (/* binding */ ancestor), -/* harmony export */ base: () => (/* binding */ base), -/* harmony export */ findNodeAfter: () => (/* binding */ findNodeAfter), -/* harmony export */ findNodeAround: () => (/* binding */ findNodeAround), -/* harmony export */ findNodeAt: () => (/* binding */ findNodeAt), -/* harmony export */ findNodeBefore: () => (/* binding */ findNodeBefore), -/* harmony export */ full: () => (/* binding */ full), -/* harmony export */ fullAncestor: () => (/* binding */ fullAncestor), -/* harmony export */ make: () => (/* binding */ make), -/* harmony export */ recursive: () => (/* binding */ recursive), -/* harmony export */ simple: () => (/* binding */ simple) -/* harmony export */ }); -// AST walker module for ESTree compatible trees - -// A simple walk is one where you simply specify callbacks to be -// called on specific nodes. The last two arguments are optional. A -// simple use would be -// -// walk.simple(myTree, { -// Expression: function(node) { ... } -// }); -// -// to do something with all expressions. All ESTree node types -// can be used to identify node types, as well as Expression and -// Statement, which denote categories of nodes. -// -// The base argument can be used to pass a custom (recursive) -// walker, and state can be used to give this walked an initial -// state. - -function simple(node, visitors, baseVisitor, state, override) { - if (!baseVisitor) { baseVisitor = base - ; }(function c(node, st, override) { - var type = override || node.type; - baseVisitor[type](node, st, c); - if (visitors[type]) { visitors[type](node, st); } - })(node, state, override); -} - -// An ancestor walk keeps an array of ancestor nodes (including the -// current node) and passes them to the callback as third parameter -// (and also as state parameter when no other state is present). -function ancestor(node, visitors, baseVisitor, state, override) { - var ancestors = []; - if (!baseVisitor) { baseVisitor = base - ; }(function c(node, st, override) { - var type = override || node.type; - var isNew = node !== ancestors[ancestors.length - 1]; - if (isNew) { ancestors.push(node); } - baseVisitor[type](node, st, c); - if (visitors[type]) { visitors[type](node, st || ancestors, ancestors); } - if (isNew) { ancestors.pop(); } - })(node, state, override); -} - -// A recursive walk is one where your functions override the default -// walkers. They can modify and replace the state parameter that's -// threaded through the walk, and can opt how and whether to walk -// their child nodes (by calling their third argument on these -// nodes). -function recursive(node, state, funcs, baseVisitor, override) { - var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor - ;(function c(node, st, override) { - visitor[override || node.type](node, st, c); - })(node, state, override); -} - -function makeTest(test) { - if (typeof test === "string") - { return function (type) { return type === test; } } - else if (!test) - { return function () { return true; } } - else - { return test } -} - -var Found = function Found(node, state) { this.node = node; this.state = state; }; - -// A full walk triggers the callback on each node -function full(node, callback, baseVisitor, state, override) { - if (!baseVisitor) { baseVisitor = base; } - var last - ;(function c(node, st, override) { - var type = override || node.type; - baseVisitor[type](node, st, c); - if (last !== node) { - callback(node, st, type); - last = node; - } - })(node, state, override); -} - -// An fullAncestor walk is like an ancestor walk, but triggers -// the callback on each node -function fullAncestor(node, callback, baseVisitor, state) { - if (!baseVisitor) { baseVisitor = base; } - var ancestors = [], last - ;(function c(node, st, override) { - var type = override || node.type; - var isNew = node !== ancestors[ancestors.length - 1]; - if (isNew) { ancestors.push(node); } - baseVisitor[type](node, st, c); - if (last !== node) { - callback(node, st || ancestors, ancestors, type); - last = node; - } - if (isNew) { ancestors.pop(); } - })(node, state); -} - -// Find a node with a given start, end, and type (all are optional, -// null can be used as wildcard). Returns a {node, state} object, or -// undefined when it doesn't find a matching node. -function findNodeAt(node, start, end, test, baseVisitor, state) { - if (!baseVisitor) { baseVisitor = base; } - test = makeTest(test); - try { - (function c(node, st, override) { - var type = override || node.type; - if ((start == null || node.start <= start) && - (end == null || node.end >= end)) - { baseVisitor[type](node, st, c); } - if ((start == null || node.start === start) && - (end == null || node.end === end) && - test(type, node)) - { throw new Found(node, st) } - })(node, state); - } catch (e) { - if (e instanceof Found) { return e } - throw e - } -} - -// Find the innermost node of a given type that contains the given -// position. Interface similar to findNodeAt. -function findNodeAround(node, pos, test, baseVisitor, state) { - test = makeTest(test); - if (!baseVisitor) { baseVisitor = base; } - try { - (function c(node, st, override) { - var type = override || node.type; - if (node.start > pos || node.end < pos) { return } - baseVisitor[type](node, st, c); - if (test(type, node)) { throw new Found(node, st) } - })(node, state); - } catch (e) { - if (e instanceof Found) { return e } - throw e - } -} - -// Find the outermost matching node after a given position. -function findNodeAfter(node, pos, test, baseVisitor, state) { - test = makeTest(test); - if (!baseVisitor) { baseVisitor = base; } - try { - (function c(node, st, override) { - if (node.end < pos) { return } - var type = override || node.type; - if (node.start >= pos && test(type, node)) { throw new Found(node, st) } - baseVisitor[type](node, st, c); - })(node, state); - } catch (e) { - if (e instanceof Found) { return e } - throw e - } -} - -// Find the outermost matching node before a given position. -function findNodeBefore(node, pos, test, baseVisitor, state) { - test = makeTest(test); - if (!baseVisitor) { baseVisitor = base; } - var max - ;(function c(node, st, override) { - if (node.start > pos) { return } - var type = override || node.type; - if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node)) - { max = new Found(node, st); } - baseVisitor[type](node, st, c); - })(node, state); - return max -} - -// Used to create a custom walker. Will fill in all missing node -// type properties with the defaults. -function make(funcs, baseVisitor) { - var visitor = Object.create(baseVisitor || base); - for (var type in funcs) { visitor[type] = funcs[type]; } - return visitor -} - -function skipThrough(node, st, c) { c(node, st); } -function ignore(_node, _st, _c) {} - -// Node walkers. - -var base = {}; - -base.Program = base.BlockStatement = base.StaticBlock = function (node, st, c) { - for (var i = 0, list = node.body; i < list.length; i += 1) - { - var stmt = list[i]; - - c(stmt, st, "Statement"); - } -}; -base.Statement = skipThrough; -base.EmptyStatement = ignore; -base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression = - function (node, st, c) { return c(node.expression, st, "Expression"); }; -base.IfStatement = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Statement"); - if (node.alternate) { c(node.alternate, st, "Statement"); } -}; -base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); }; -base.BreakStatement = base.ContinueStatement = ignore; -base.WithStatement = function (node, st, c) { - c(node.object, st, "Expression"); - c(node.body, st, "Statement"); -}; -base.SwitchStatement = function (node, st, c) { - c(node.discriminant, st, "Expression"); - for (var i = 0, list = node.cases; i < list.length; i += 1) { - var cs = list[i]; - - c(cs, st); - } -}; -base.SwitchCase = function (node, st, c) { - if (node.test) { c(node.test, st, "Expression"); } - for (var i = 0, list = node.consequent; i < list.length; i += 1) - { - var cons = list[i]; - - c(cons, st, "Statement"); - } -}; -base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) { - if (node.argument) { c(node.argument, st, "Expression"); } -}; -base.ThrowStatement = base.SpreadElement = - function (node, st, c) { return c(node.argument, st, "Expression"); }; -base.TryStatement = function (node, st, c) { - c(node.block, st, "Statement"); - if (node.handler) { c(node.handler, st); } - if (node.finalizer) { c(node.finalizer, st, "Statement"); } -}; -base.CatchClause = function (node, st, c) { - if (node.param) { c(node.param, st, "Pattern"); } - c(node.body, st, "Statement"); -}; -base.WhileStatement = base.DoWhileStatement = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.body, st, "Statement"); -}; -base.ForStatement = function (node, st, c) { - if (node.init) { c(node.init, st, "ForInit"); } - if (node.test) { c(node.test, st, "Expression"); } - if (node.update) { c(node.update, st, "Expression"); } - c(node.body, st, "Statement"); -}; -base.ForInStatement = base.ForOfStatement = function (node, st, c) { - c(node.left, st, "ForInit"); - c(node.right, st, "Expression"); - c(node.body, st, "Statement"); -}; -base.ForInit = function (node, st, c) { - if (node.type === "VariableDeclaration") { c(node, st); } - else { c(node, st, "Expression"); } -}; -base.DebuggerStatement = ignore; - -base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); }; -base.VariableDeclaration = function (node, st, c) { - for (var i = 0, list = node.declarations; i < list.length; i += 1) - { - var decl = list[i]; - - c(decl, st); - } -}; -base.VariableDeclarator = function (node, st, c) { - c(node.id, st, "Pattern"); - if (node.init) { c(node.init, st, "Expression"); } -}; - -base.Function = function (node, st, c) { - if (node.id) { c(node.id, st, "Pattern"); } - for (var i = 0, list = node.params; i < list.length; i += 1) - { - var param = list[i]; - - c(param, st, "Pattern"); - } - c(node.body, st, node.expression ? "Expression" : "Statement"); -}; - -base.Pattern = function (node, st, c) { - if (node.type === "Identifier") - { c(node, st, "VariablePattern"); } - else if (node.type === "MemberExpression") - { c(node, st, "MemberPattern"); } - else - { c(node, st); } -}; -base.VariablePattern = ignore; -base.MemberPattern = skipThrough; -base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); }; -base.ArrayPattern = function (node, st, c) { - for (var i = 0, list = node.elements; i < list.length; i += 1) { - var elt = list[i]; - - if (elt) { c(elt, st, "Pattern"); } - } -}; -base.ObjectPattern = function (node, st, c) { - for (var i = 0, list = node.properties; i < list.length; i += 1) { - var prop = list[i]; - - if (prop.type === "Property") { - if (prop.computed) { c(prop.key, st, "Expression"); } - c(prop.value, st, "Pattern"); - } else if (prop.type === "RestElement") { - c(prop.argument, st, "Pattern"); - } - } -}; - -base.Expression = skipThrough; -base.ThisExpression = base.Super = base.MetaProperty = ignore; -base.ArrayExpression = function (node, st, c) { - for (var i = 0, list = node.elements; i < list.length; i += 1) { - var elt = list[i]; - - if (elt) { c(elt, st, "Expression"); } - } -}; -base.ObjectExpression = function (node, st, c) { - for (var i = 0, list = node.properties; i < list.length; i += 1) - { - var prop = list[i]; - - c(prop, st); - } -}; -base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration; -base.SequenceExpression = function (node, st, c) { - for (var i = 0, list = node.expressions; i < list.length; i += 1) - { - var expr = list[i]; - - c(expr, st, "Expression"); - } -}; -base.TemplateLiteral = function (node, st, c) { - for (var i = 0, list = node.quasis; i < list.length; i += 1) - { - var quasi = list[i]; - - c(quasi, st); - } - - for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) - { - var expr = list$1[i$1]; - - c(expr, st, "Expression"); - } -}; -base.TemplateElement = ignore; -base.UnaryExpression = base.UpdateExpression = function (node, st, c) { - c(node.argument, st, "Expression"); -}; -base.BinaryExpression = base.LogicalExpression = function (node, st, c) { - c(node.left, st, "Expression"); - c(node.right, st, "Expression"); -}; -base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) { - c(node.left, st, "Pattern"); - c(node.right, st, "Expression"); -}; -base.ConditionalExpression = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Expression"); - c(node.alternate, st, "Expression"); -}; -base.NewExpression = base.CallExpression = function (node, st, c) { - c(node.callee, st, "Expression"); - if (node.arguments) - { for (var i = 0, list = node.arguments; i < list.length; i += 1) - { - var arg = list[i]; - - c(arg, st, "Expression"); - } } -}; -base.MemberExpression = function (node, st, c) { - c(node.object, st, "Expression"); - if (node.computed) { c(node.property, st, "Expression"); } -}; -base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) { - if (node.declaration) - { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); } - if (node.source) { c(node.source, st, "Expression"); } -}; -base.ExportAllDeclaration = function (node, st, c) { - if (node.exported) - { c(node.exported, st); } - c(node.source, st, "Expression"); -}; -base.ImportDeclaration = function (node, st, c) { - for (var i = 0, list = node.specifiers; i < list.length; i += 1) - { - var spec = list[i]; - - c(spec, st); - } - c(node.source, st, "Expression"); -}; -base.ImportExpression = function (node, st, c) { - c(node.source, st, "Expression"); -}; -base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore; - -base.TaggedTemplateExpression = function (node, st, c) { - c(node.tag, st, "Expression"); - c(node.quasi, st, "Expression"); -}; -base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); }; -base.Class = function (node, st, c) { - if (node.id) { c(node.id, st, "Pattern"); } - if (node.superClass) { c(node.superClass, st, "Expression"); } - c(node.body, st); -}; -base.ClassBody = function (node, st, c) { - for (var i = 0, list = node.body; i < list.length; i += 1) - { - var elt = list[i]; - - c(elt, st); - } -}; -base.MethodDefinition = base.PropertyDefinition = base.Property = function (node, st, c) { - if (node.computed) { c(node.key, st, "Expression"); } - if (node.value) { c(node.value, st, "Expression"); } -}; - - - - -/***/ }), - -/***/ "./node_modules/acorn/dist/acorn.mjs": -/*!*******************************************!*\ - !*** ./node_modules/acorn/dist/acorn.mjs ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Node: () => (/* binding */ Node), -/* harmony export */ Parser: () => (/* binding */ Parser), -/* harmony export */ Position: () => (/* binding */ Position), -/* harmony export */ SourceLocation: () => (/* binding */ SourceLocation), -/* harmony export */ TokContext: () => (/* binding */ TokContext), -/* harmony export */ Token: () => (/* binding */ Token), -/* harmony export */ TokenType: () => (/* binding */ TokenType), -/* harmony export */ defaultOptions: () => (/* binding */ defaultOptions), -/* harmony export */ getLineInfo: () => (/* binding */ getLineInfo), -/* harmony export */ isIdentifierChar: () => (/* binding */ isIdentifierChar), -/* harmony export */ isIdentifierStart: () => (/* binding */ isIdentifierStart), -/* harmony export */ isNewLine: () => (/* binding */ isNewLine), -/* harmony export */ keywordTypes: () => (/* binding */ keywords), -/* harmony export */ lineBreak: () => (/* binding */ lineBreak), -/* harmony export */ lineBreakG: () => (/* binding */ lineBreakG), -/* harmony export */ nonASCIIwhitespace: () => (/* binding */ nonASCIIwhitespace), -/* harmony export */ parse: () => (/* binding */ parse), -/* harmony export */ parseExpressionAt: () => (/* binding */ parseExpressionAt), -/* harmony export */ tokContexts: () => (/* binding */ types), -/* harmony export */ tokTypes: () => (/* binding */ types$1), -/* harmony export */ tokenizer: () => (/* binding */ tokenizer), -/* harmony export */ version: () => (/* binding */ version) -/* harmony export */ }); -// This file was generated. Do not modify manually! -var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 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, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 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, 343, 9, 54, 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, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 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, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -// This file was generated. Do not modify manually! -var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 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, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 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, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 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, 200, 32, 32, 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, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 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, 229, 29, 3, 0, 496, 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]; - -// This file was generated. Do not modify manually! -var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\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"; - -// This file was generated. Do not modify manually! -var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\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-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\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"; - -// These are a run-length and offset encoded representation of the -// >0xffff code points that are a valid part of identifiers. The -// offset starts at 0x10000, and each pair of numbers represents an -// offset to the next range, and then a size of the range. - -// Reserved word lists for various dialects of the language - -var reservedWords = { - 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", - 5: "class enum extends super const export import", - 6: "enum", - strict: "implements interface let package private protected public static yield", - strictBind: "eval arguments" -}; - -// And the keywords - -var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; - -var keywords$1 = { - 5: ecma5AndLessKeywords, - "5module": ecma5AndLessKeywords + " export import", - 6: ecma5AndLessKeywords + " const class extends export import super" -}; - -var keywordRelationalOperator = /^in(stanceof)?$/; - -// ## Character categories - -var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - -// This has a complexity linear to the value of the code. The -// assumption is that looking up astral identifier characters is -// rare. -function isInAstralSet(code, set) { - var pos = 0x10000; - for (var i = 0; i < set.length; i += 2) { - pos += set[i]; - if (pos > code) { return false } - pos += set[i + 1]; - if (pos >= code) { return true } - } - return false -} - -// Test whether a given character code starts an identifier. - -function isIdentifierStart(code, astral) { - if (code < 65) { return code === 36 } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) -} - -// Test whether a given character is part of an identifier. - -function isIdentifierChar(code, astral) { - if (code < 48) { return code === 36 } - if (code < 58) { return true } - if (code < 65) { return false } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) -} - -// ## Token types - -// The assignment of fine-grained, information-carrying type objects -// allows the tokenizer to store the information it has about a -// token in a way that is very cheap for the parser to look up. - -// All token type variables start with an underscore, to make them -// easy to recognize. - -// The `beforeExpr` property is used to disambiguate between regular -// expressions and divisions. It is set on all token types that can -// be followed by an expression (thus, a slash after them would be a -// regular expression). -// -// The `startsExpr` property is used to check if the token ends a -// `yield` expression. It is set on all token types that either can -// directly start an expression (like a quotation mark) or can -// continue an expression (like the body of a string). -// -// `isLoop` marks a keyword as starting a loop, which is important -// to know when parsing a label, in order to allow or disallow -// continue jumps to that label. - -var TokenType = function TokenType(label, conf) { - if ( conf === void 0 ) conf = {}; - - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop || null; - this.updateContext = null; -}; - -function binop(name, prec) { - return new TokenType(name, {beforeExpr: true, binop: prec}) -} -var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; - -// Map keyword names to token types. - -var keywords = {}; - -// Succinct definitions of keyword token types -function kw(name, options) { - if ( options === void 0 ) options = {}; - - options.keyword = name; - return keywords[name] = new TokenType(name, options) -} - -var types$1 = { - num: new TokenType("num", startsExpr), - regexp: new TokenType("regexp", startsExpr), - string: new TokenType("string", startsExpr), - name: new TokenType("name", startsExpr), - privateId: new TokenType("privateId", startsExpr), - eof: new TokenType("eof"), - - // Punctuation token types. - bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), - bracketR: new TokenType("]"), - braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), - braceR: new TokenType("}"), - parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), - parenR: new TokenType(")"), - comma: new TokenType(",", beforeExpr), - semi: new TokenType(";", beforeExpr), - colon: new TokenType(":", beforeExpr), - dot: new TokenType("."), - question: new TokenType("?", beforeExpr), - questionDot: new TokenType("?."), - arrow: new TokenType("=>", beforeExpr), - template: new TokenType("template"), - invalidTemplate: new TokenType("invalidTemplate"), - ellipsis: new TokenType("...", beforeExpr), - backQuote: new TokenType("`", startsExpr), - dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), - - // Operators. These carry several kinds of properties to help the - // parser use them properly (the presence of these properties is - // what categorizes them as operators). - // - // `binop`, when present, specifies that this operator is a binary - // operator, and will refer to its precedence. - // - // `prefix` and `postfix` mark the operator as a prefix or postfix - // unary operator. - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. - - eq: new TokenType("=", {beforeExpr: true, isAssign: true}), - assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), - incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), - prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), - logicalOR: binop("||", 1), - logicalAND: binop("&&", 2), - bitwiseOR: binop("|", 3), - bitwiseXOR: binop("^", 4), - bitwiseAND: binop("&", 5), - equality: binop("==/!=/===/!==", 6), - relational: binop("/<=/>=", 7), - bitShift: binop("<>/>>>", 8), - plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), - modulo: binop("%", 10), - star: binop("*", 10), - slash: binop("/", 10), - starstar: new TokenType("**", {beforeExpr: true}), - coalesce: binop("??", 1), - - // Keyword token types. - _break: kw("break"), - _case: kw("case", beforeExpr), - _catch: kw("catch"), - _continue: kw("continue"), - _debugger: kw("debugger"), - _default: kw("default", beforeExpr), - _do: kw("do", {isLoop: true, beforeExpr: true}), - _else: kw("else", beforeExpr), - _finally: kw("finally"), - _for: kw("for", {isLoop: true}), - _function: kw("function", startsExpr), - _if: kw("if"), - _return: kw("return", beforeExpr), - _switch: kw("switch"), - _throw: kw("throw", beforeExpr), - _try: kw("try"), - _var: kw("var"), - _const: kw("const"), - _while: kw("while", {isLoop: true}), - _with: kw("with"), - _new: kw("new", {beforeExpr: true, startsExpr: true}), - _this: kw("this", startsExpr), - _super: kw("super", startsExpr), - _class: kw("class", startsExpr), - _extends: kw("extends", beforeExpr), - _export: kw("export"), - _import: kw("import", startsExpr), - _null: kw("null", startsExpr), - _true: kw("true", startsExpr), - _false: kw("false", startsExpr), - _in: kw("in", {beforeExpr: true, binop: 7}), - _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), - _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), - _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), - _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) -}; - -// Matches a whole line break (where CRLF is considered a single -// line break). Used to count lines. - -var lineBreak = /\r\n?|\n|\u2028|\u2029/; -var lineBreakG = new RegExp(lineBreak.source, "g"); - -function isNewLine(code) { - return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 -} - -function nextLineBreak(code, from, end) { - if ( end === void 0 ) end = code.length; - - for (var i = from; i < end; i++) { - var next = code.charCodeAt(i); - if (isNewLine(next)) - { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 } - } - return -1 -} - -var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; - -var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; - -var ref = Object.prototype; -var hasOwnProperty = ref.hasOwnProperty; -var toString = ref.toString; - -var hasOwn = Object.hasOwn || (function (obj, propName) { return ( - hasOwnProperty.call(obj, propName) -); }); - -var isArray = Array.isArray || (function (obj) { return ( - toString.call(obj) === "[object Array]" -); }); - -var regexpCache = Object.create(null); - -function wordsRegexp(words) { - return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")) -} - -function codePointToString(code) { - // UTF-16 Decoding - if (code <= 0xFFFF) { return String.fromCharCode(code) } - code -= 0x10000; - return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) -} - -var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; - -// These are used when `options.locations` is on, for the -// `startLoc` and `endLoc` properties. - -var Position = function Position(line, col) { - this.line = line; - this.column = col; -}; - -Position.prototype.offset = function offset (n) { - return new Position(this.line, this.column + n) -}; - -var SourceLocation = function SourceLocation(p, start, end) { - this.start = start; - this.end = end; - if (p.sourceFile !== null) { this.source = p.sourceFile; } -}; - -// The `getLineInfo` function is mostly useful when the -// `locations` option is off (for performance reasons) and you -// want to find the line/column position for a given character -// offset. `input` should be the code string that the offset refers -// into. - -function getLineInfo(input, offset) { - for (var line = 1, cur = 0;;) { - var nextBreak = nextLineBreak(input, cur, offset); - if (nextBreak < 0) { return new Position(line, offset - cur) } - ++line; - cur = nextBreak; - } -} - -// A second argument must be given to configure the parser process. -// These options are recognized (only `ecmaVersion` is required): - -var defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must be - // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 - // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` - // (the latest version the library supports). This influences - // support for strict mode, the set of reserved words, and support - // for new syntax features. - ecmaVersion: null, - // `sourceType` indicates the mode the code should be parsed in. - // Can be either `"script"` or `"module"`. This influences global - // strict mode and parsing of `import` and `export` declarations. - sourceType: "script", - // `onInsertedSemicolon` can be a callback that will be called when - // a semicolon is automatically inserted. It will be passed the - // position of the inserted semicolon as an offset, and if - // `locations` is enabled, it is given the location as a `{line, - // column}` object as second argument. - onInsertedSemicolon: null, - // `onTrailingComma` is similar to `onInsertedSemicolon`, but for - // trailing commas. - onTrailingComma: null, - // By default, reserved words are only enforced if ecmaVersion >= 5. - // Set `allowReserved` to a boolean value to explicitly turn this on - // an off. When this option has the value "never", reserved words - // and keywords can also not be used as property names. - allowReserved: null, - // When enabled, a return at the top level is not considered an - // error. - allowReturnOutsideFunction: false, - // When enabled, import/export statements are not constrained to - // appearing at the top of the program, and an import.meta expression - // in a script isn't considered an error. - allowImportExportEverywhere: false, - // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. - // When enabled, await identifiers are allowed to appear at the top-level scope, - // but they are still not allowed in non-async functions. - allowAwaitOutsideFunction: null, - // When enabled, super identifiers are not constrained to - // appearing in methods and do not raise an error when they appear elsewhere. - allowSuperOutsideMethod: null, - // When enabled, hashbang directive in the beginning of file is - // allowed and treated as a line comment. Enabled by default when - // `ecmaVersion` >= 2023. - allowHashBang: false, - // By default, the parser will verify that private properties are - // only used in places where they are valid and have been declared. - // Set this to false to turn such checks off. - checkPrivateFields: true, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // A function can be passed as `onToken` option, which will - // cause Acorn to call that function with object in the same - // format as tokens returned from `tokenizer().getToken()`. Note - // that you are not allowed to call the parser from the - // callback—that will corrupt its internal state. - onToken: null, - // A function can be passed as `onComment` option, which will - // cause Acorn to call that function with `(block, text, start, - // end)` parameters whenever a comment is skipped. `block` is a - // boolean indicating whether this is a block (`/* */`) comment, - // `text` is the content of the comment, and `start` and `end` are - // character offsets that denote the start and end of the comment. - // When the `locations` option is on, two more parameters are - // passed, the full `{line, column}` locations of the start and - // end of the comments. Note that you are not allowed to call the - // parser from the callback—that will corrupt its internal state. - // When this option has an array as value, objects representing the - // comments are pushed to it. - onComment: null, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `locations` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null, - // This value, if given, is stored in every node, whether - // `locations` is on or off. - directSourceFile: null, - // When enabled, parenthesized expressions are represented by - // (non-standard) ParenthesizedExpression nodes - preserveParens: false -}; - -// Interpret and default an options object - -var warnedAboutEcmaVersion = false; - -function getOptions(opts) { - var options = {}; - - for (var opt in defaultOptions) - { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } - - if (options.ecmaVersion === "latest") { - options.ecmaVersion = 1e8; - } else if (options.ecmaVersion == null) { - if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { - warnedAboutEcmaVersion = true; - console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); - } - options.ecmaVersion = 11; - } else if (options.ecmaVersion >= 2015) { - options.ecmaVersion -= 2009; - } - - if (options.allowReserved == null) - { options.allowReserved = options.ecmaVersion < 5; } - - if (!opts || opts.allowHashBang == null) - { options.allowHashBang = options.ecmaVersion >= 14; } - - if (isArray(options.onToken)) { - var tokens = options.onToken; - options.onToken = function (token) { return tokens.push(token); }; - } - if (isArray(options.onComment)) - { options.onComment = pushComment(options, options.onComment); } - - return options -} - -function pushComment(options, array) { - return function(block, text, start, end, startLoc, endLoc) { - var comment = { - type: block ? "Block" : "Line", - value: text, - start: start, - end: end - }; - if (options.locations) - { comment.loc = new SourceLocation(this, startLoc, endLoc); } - if (options.ranges) - { comment.range = [start, end]; } - array.push(comment); - } -} - -// Each scope gets a bitset that may contain these flags -var - SCOPE_TOP = 1, - SCOPE_FUNCTION = 2, - SCOPE_ASYNC = 4, - SCOPE_GENERATOR = 8, - SCOPE_ARROW = 16, - SCOPE_SIMPLE_CATCH = 32, - SCOPE_SUPER = 64, - SCOPE_DIRECT_SUPER = 128, - SCOPE_CLASS_STATIC_BLOCK = 256, - SCOPE_CLASS_FIELD_INIT = 512, - SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; - -function functionFlags(async, generator) { - return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) -} - -// Used in checkLVal* and declareName to determine the type of a binding -var - BIND_NONE = 0, // Not a binding - BIND_VAR = 1, // Var-style binding - BIND_LEXICAL = 2, // Let- or const-style binding - BIND_FUNCTION = 3, // Function declaration - BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding - BIND_OUTSIDE = 5; // Special case for function names as bound inside the function - -var Parser = function Parser(options, input, startPos) { - this.options = options = getOptions(options); - this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); - var reserved = ""; - if (options.allowReserved !== true) { - reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; - if (options.sourceType === "module") { reserved += " await"; } - } - this.reservedWords = wordsRegexp(reserved); - var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; - this.reservedWordsStrict = wordsRegexp(reservedStrict); - this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); - this.input = String(input); - - // Used to signal to callers of `readWord1` whether the word - // contained any escape sequences. This is needed because words with - // escape sequences must not be interpreted as keywords. - this.containsEsc = false; - - // Set up token state - - // The current position of the tokenizer in the input. - if (startPos) { - this.pos = startPos; - this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; - this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; - } - - // Properties of the current token: - // Its type - this.type = types$1.eof; - // For tokens that include more information than their type, the value - this.value = null; - // Its start and end offset - this.start = this.end = this.pos; - // And, if locations are used, the {line, column} object - // corresponding to those offsets - this.startLoc = this.endLoc = this.curPosition(); - - // Position information for the previous token - this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; - - // The context stack is used to superficially track syntactic - // context to predict whether a regular expression is allowed in a - // given position. - this.context = this.initialContext(); - this.exprAllowed = true; - - // Figure out if it's a module code. - this.inModule = options.sourceType === "module"; - this.strict = this.inModule || this.strictDirective(this.pos); - - // Used to signify the start of a potential arrow function - this.potentialArrowAt = -1; - this.potentialArrowInForAwait = false; - - // Positions to delayed-check that yield/await does not exist in default parameters. - this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; - // Labels in scope. - this.labels = []; - // Thus-far undefined exports. - this.undefinedExports = Object.create(null); - - // If enabled, skip leading hashbang line. - if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") - { this.skipLineComment(2); } - - // Scope tracking for duplicate variable names (see scope.js) - this.scopeStack = []; - this.enterScope(SCOPE_TOP); - - // For RegExp validation - this.regexpState = null; - - // The stack of private names. - // Each element has two properties: 'declared' and 'used'. - // When it exited from the outermost class definition, all used private names must be declared. - this.privateNameStack = []; -}; - -var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } }; - -Parser.prototype.parse = function parse () { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node) -}; - -prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; - -prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; - -prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; - -prototypeAccessors.canAwait.get = function () { - for (var i = this.scopeStack.length - 1; i >= 0; i--) { - var ref = this.scopeStack[i]; - var flags = ref.flags; - if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false } - if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 } - } - return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction -}; - -prototypeAccessors.allowSuper.get = function () { - var ref = this.currentThisScope(); - var flags = ref.flags; - return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod -}; - -prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; - -prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; - -prototypeAccessors.allowNewDotTarget.get = function () { - for (var i = this.scopeStack.length - 1; i >= 0; i--) { - var ref = this.scopeStack[i]; - var flags = ref.flags; - if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) || - ((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true } - } - return false -}; - -prototypeAccessors.inClassStaticBlock.get = function () { - return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 -}; - -Parser.extend = function extend () { - var plugins = [], len = arguments.length; - while ( len-- ) plugins[ len ] = arguments[ len ]; - - var cls = this; - for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } - return cls -}; - -Parser.parse = function parse (input, options) { - return new this(options, input).parse() -}; - -Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { - var parser = new this(options, input, pos); - parser.nextToken(); - return parser.parseExpression() -}; - -Parser.tokenizer = function tokenizer (input, options) { - return new this(options, input) -}; - -Object.defineProperties( Parser.prototype, prototypeAccessors ); - -var pp$9 = Parser.prototype; - -// ## Parser utilities - -var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/; -pp$9.strictDirective = function(start) { - if (this.options.ecmaVersion < 5) { return false } - for (;;) { - // Try to find string literal. - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - var match = literal.exec(this.input.slice(start)); - if (!match) { return false } - if ((match[1] || match[2]) === "use strict") { - skipWhiteSpace.lastIndex = start + match[0].length; - var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; - var next = this.input.charAt(end); - return next === ";" || next === "}" || - (lineBreak.test(spaceAfter[0]) && - !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=")) - } - start += match[0].length; - - // Skip semicolon, if any. - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - if (this.input[start] === ";") - { start++; } - } -}; - -// Predicate that tests whether the next token is of the given -// type, and if yes, consumes it as a side effect. - -pp$9.eat = function(type) { - if (this.type === type) { - this.next(); - return true - } else { - return false - } -}; - -// Tests whether parsed token is a contextual keyword. - -pp$9.isContextual = function(name) { - return this.type === types$1.name && this.value === name && !this.containsEsc -}; - -// Consumes contextual keyword if possible. - -pp$9.eatContextual = function(name) { - if (!this.isContextual(name)) { return false } - this.next(); - return true -}; - -// Asserts that following token is given contextual keyword. - -pp$9.expectContextual = function(name) { - if (!this.eatContextual(name)) { this.unexpected(); } -}; - -// Test whether a semicolon can be inserted at the current position. - -pp$9.canInsertSemicolon = function() { - return this.type === types$1.eof || - this.type === types$1.braceR || - lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) -}; - -pp$9.insertSemicolon = function() { - if (this.canInsertSemicolon()) { - if (this.options.onInsertedSemicolon) - { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } - return true - } -}; - -// Consume a semicolon, or, failing that, see if we are allowed to -// pretend that there is a semicolon at this position. - -pp$9.semicolon = function() { - if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } -}; - -pp$9.afterTrailingComma = function(tokType, notNext) { - if (this.type === tokType) { - if (this.options.onTrailingComma) - { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } - if (!notNext) - { this.next(); } - return true - } -}; - -// Expect a token of a given type. If found, consume it, otherwise, -// raise an unexpected token error. - -pp$9.expect = function(type) { - this.eat(type) || this.unexpected(); -}; - -// Raise an unexpected token error. - -pp$9.unexpected = function(pos) { - this.raise(pos != null ? pos : this.start, "Unexpected token"); -}; - -var DestructuringErrors = function DestructuringErrors() { - this.shorthandAssign = - this.trailingComma = - this.parenthesizedAssign = - this.parenthesizedBind = - this.doubleProto = - -1; -}; - -pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { - if (!refDestructuringErrors) { return } - if (refDestructuringErrors.trailingComma > -1) - { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } - var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); } -}; - -pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { - if (!refDestructuringErrors) { return false } - var shorthandAssign = refDestructuringErrors.shorthandAssign; - var doubleProto = refDestructuringErrors.doubleProto; - if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } - if (shorthandAssign >= 0) - { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } - if (doubleProto >= 0) - { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } -}; - -pp$9.checkYieldAwaitInDefaultParams = function() { - if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) - { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } - if (this.awaitPos) - { this.raise(this.awaitPos, "Await expression cannot be a default value"); } -}; - -pp$9.isSimpleAssignTarget = function(expr) { - if (expr.type === "ParenthesizedExpression") - { return this.isSimpleAssignTarget(expr.expression) } - return expr.type === "Identifier" || expr.type === "MemberExpression" -}; - -var pp$8 = Parser.prototype; - -// ### Statement parsing - -// Parse a program. Initializes the parser, reads any number of -// statements, and wraps them in a Program node. Optionally takes a -// `program` argument. If present, the statements will be appended -// to its body instead of creating a new node. - -pp$8.parseTopLevel = function(node) { - var exports = Object.create(null); - if (!node.body) { node.body = []; } - while (this.type !== types$1.eof) { - var stmt = this.parseStatement(null, true, exports); - node.body.push(stmt); - } - if (this.inModule) - { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) - { - var name = list[i]; - - this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); - } } - this.adaptDirectivePrologue(node.body); - this.next(); - node.sourceType = this.options.sourceType; - return this.finishNode(node, "Program") -}; - -var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - -pp$8.isLet = function(context) { - if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - // For ambiguous cases, determine if a LexicalDeclaration (or only a - // Statement) is allowed here. If context is not empty then only a Statement - // is allowed. However, `let [` is an explicit negative lookahead for - // ExpressionStatement, so special-case it first. - if (nextCh === 91 || nextCh === 92) { return true } // '[', '\' - if (context) { return false } - - if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral - if (isIdentifierStart(nextCh, true)) { - var pos = next + 1; - while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } - if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } - var ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) { return true } - } - return false -}; - -// check 'async [no LineTerminator here] function' -// - 'async /*foo*/ function' is OK. -// - 'async /*\n*/ function' is invalid. -pp$8.isAsyncFunction = function() { - if (this.options.ecmaVersion < 8 || !this.isContextual("async")) - { return false } - - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, after; - return !lineBreak.test(this.input.slice(this.pos, next)) && - this.input.slice(next, next + 8) === "function" && - (next + 8 === this.input.length || - !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00)) -}; - -pp$8.isUsingKeyword = function(isAwaitUsing, isFor) { - if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) - { return false } - - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length; - - if (lineBreak.test(this.input.slice(this.pos, next))) { return false } - - if (isAwaitUsing) { - var awaitEndPos = next + 5 /* await */, after; - if (this.input.slice(next, awaitEndPos) !== "using" || - awaitEndPos === this.input.length || - isIdentifierChar(after = this.input.charCodeAt(awaitEndPos)) || - (after > 0xd7ff && after < 0xdc00) - ) { return false } - - skipWhiteSpace.lastIndex = awaitEndPos; - var skipAfterUsing = skipWhiteSpace.exec(this.input); - if (skipAfterUsing && lineBreak.test(this.input.slice(awaitEndPos, awaitEndPos + skipAfterUsing[0].length))) { return false } - } - - if (isFor) { - var ofEndPos = next + 2 /* of */, after$1; - if (this.input.slice(next, ofEndPos) === "of") { - if (ofEndPos === this.input.length || - (!isIdentifierChar(after$1 = this.input.charCodeAt(ofEndPos)) && !(after$1 > 0xd7ff && after$1 < 0xdc00))) { return false } - } - } - - var ch = this.input.charCodeAt(next); - return isIdentifierStart(ch, true) || ch === 92 // '\' -}; - -pp$8.isAwaitUsing = function(isFor) { - return this.isUsingKeyword(true, isFor) -}; - -pp$8.isUsing = function(isFor) { - return this.isUsingKeyword(false, isFor) -}; - -// Parse a single statement. -// -// If expecting a statement and finding a slash operator, parse a -// regular expression literal. This is to handle cases like -// `if (foo) /blah/.exec(foo)`, where looking at the previous token -// does not help. - -pp$8.parseStatement = function(context, topLevel, exports) { - var starttype = this.type, node = this.startNode(), kind; - - if (this.isLet(context)) { - starttype = types$1._var; - kind = "let"; - } - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case types$1._debugger: return this.parseDebuggerStatement(node) - case types$1._do: return this.parseDoStatement(node) - case types$1._for: return this.parseForStatement(node) - case types$1._function: - // Function as sole body of either an if statement or a labeled statement - // works, but not when it is part of a labeled statement that is the sole - // body of an if statement. - if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } - return this.parseFunctionStatement(node, false, !context) - case types$1._class: - if (context) { this.unexpected(); } - return this.parseClass(node, true) - case types$1._if: return this.parseIfStatement(node) - case types$1._return: return this.parseReturnStatement(node) - case types$1._switch: return this.parseSwitchStatement(node) - case types$1._throw: return this.parseThrowStatement(node) - case types$1._try: return this.parseTryStatement(node) - case types$1._const: case types$1._var: - kind = kind || this.value; - if (context && kind !== "var") { this.unexpected(); } - return this.parseVarStatement(node, kind) - case types$1._while: return this.parseWhileStatement(node) - case types$1._with: return this.parseWithStatement(node) - case types$1.braceL: return this.parseBlock(true, node) - case types$1.semi: return this.parseEmptyStatement(node) - case types$1._export: - case types$1._import: - if (this.options.ecmaVersion > 10 && starttype === types$1._import) { - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - if (nextCh === 40 || nextCh === 46) // '(' or '.' - { return this.parseExpressionStatement(node, this.parseExpression()) } - } - - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) - { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } - if (!this.inModule) - { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } - } - return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - default: - if (this.isAsyncFunction()) { - if (context) { this.unexpected(); } - this.next(); - return this.parseFunctionStatement(node, true, !context) - } - - var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null; - if (usingKind) { - if (topLevel && this.options.sourceType === "script") { - this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`"); - } - if (usingKind === "await using") { - if (!this.canAwait) { - this.raise(this.start, "Await using cannot appear outside of async function"); - } - this.next(); - } - this.next(); - this.parseVar(node, false, usingKind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration") - } - - var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) - { return this.parseLabeledStatement(node, maybeName, expr, context) } - else { return this.parseExpressionStatement(node, expr) } - } -}; - -pp$8.parseBreakContinueStatement = function(node, keyword) { - var isBreak = keyword === "break"; - this.next(); - if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } - else if (this.type !== types$1.name) { this.unexpected(); } - else { - node.label = this.parseIdent(); - this.semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - var i = 0; - for (; i < this.labels.length; ++i) { - var lab = this.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } - if (node.label && isBreak) { break } - } - } - if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") -}; - -pp$8.parseDebuggerStatement = function(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement") -}; - -pp$8.parseDoStatement = function(node) { - this.next(); - this.labels.push(loopLabel); - node.body = this.parseStatement("do"); - this.labels.pop(); - this.expect(types$1._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) - { this.eat(types$1.semi); } - else - { this.semicolon(); } - return this.finishNode(node, "DoWhileStatement") -}; - -// Disambiguating between a `for` and a `for`/`in` or `for`/`of` -// loop is non-trivial. Basically, we have to parse the init `var` -// statement or expression, disallowing the `in` operator (see -// the second parameter to `parseExpression`), and then check -// whether the next token is `in` or `of`. When there is no init -// part (semicolon immediately after the opening parenthesis), it -// is a regular `for` loop. - -pp$8.parseForStatement = function(node) { - this.next(); - var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; - this.labels.push(loopLabel); - this.enterScope(0); - this.expect(types$1.parenL); - if (this.type === types$1.semi) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, null) - } - var isLet = this.isLet(); - if (this.type === types$1._var || this.type === types$1._const || isLet) { - var init$1 = this.startNode(), kind = isLet ? "let" : this.value; - this.next(); - this.parseVar(init$1, true, kind); - this.finishNode(init$1, "VariableDeclaration"); - return this.parseForAfterInit(node, init$1, awaitAt) - } - var startsWithLet = this.isContextual("let"), isForOf = false; - - var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null; - if (usingKind) { - var init$2 = this.startNode(); - this.next(); - if (usingKind === "await using") { this.next(); } - this.parseVar(init$2, true, usingKind); - this.finishNode(init$2, "VariableDeclaration"); - return this.parseForAfterInit(node, init$2, awaitAt) - } - var containsEsc = this.containsEsc; - var refDestructuringErrors = new DestructuringErrors; - var initPos = this.start; - var init = awaitAt > -1 - ? this.parseExprSubscripts(refDestructuringErrors, "await") - : this.parseExpression(true, refDestructuringErrors); - if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt) - if (this.type === types$1._in) { this.unexpected(awaitAt); } - node.await = true; - } else if (isForOf && this.options.ecmaVersion >= 8) { - if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); } - else if (this.options.ecmaVersion >= 9) { node.await = false; } - } - if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); } - this.toAssignable(init, false, refDestructuringErrors); - this.checkLValPattern(init); - return this.parseForIn(node, init) - } else { - this.checkExpressionErrors(refDestructuringErrors, true); - } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init) -}; - -// Helper method to parse for loop after variable initialization -pp$8.parseForAfterInit = function(node, init, awaitAt) { - if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$1._in) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - } else { node.await = awaitAt > -1; } - } - return this.parseForIn(node, init) - } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init) -}; - -pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) -}; - -pp$8.parseIfStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - // allow function declarations in branches, but only in non-strict mode - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement") -}; - -pp$8.parseReturnStatement = function(node) { - if (!this.inFunction && !this.options.allowReturnOutsideFunction) - { this.raise(this.start, "'return' outside of function"); } - this.next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } - else { node.argument = this.parseExpression(); this.semicolon(); } - return this.finishNode(node, "ReturnStatement") -}; - -pp$8.parseSwitchStatement = function(node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(types$1.braceL); - this.labels.push(switchLabel); - this.enterScope(0); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - var cur; - for (var sawDefault = false; this.type !== types$1.braceR;) { - if (this.type === types$1._case || this.type === types$1._default) { - var isCase = this.type === types$1._case; - if (cur) { this.finishNode(cur, "SwitchCase"); } - node.cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } - sawDefault = true; - cur.test = null; - } - this.expect(types$1.colon); - } else { - if (!cur) { this.unexpected(); } - cur.consequent.push(this.parseStatement(null)); - } - } - this.exitScope(); - if (cur) { this.finishNode(cur, "SwitchCase"); } - this.next(); // Closing brace - this.labels.pop(); - return this.finishNode(node, "SwitchStatement") -}; - -pp$8.parseThrowStatement = function(node) { - this.next(); - if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) - { this.raise(this.lastTokEnd, "Illegal newline after throw"); } - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement") -}; - -// Reused empty array added for node fields that are always empty. - -var empty$1 = []; - -pp$8.parseCatchClauseParam = function() { - var param = this.parseBindingAtom(); - var simple = param.type === "Identifier"; - this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types$1.parenR); - - return param -}; - -pp$8.parseTryStatement = function(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === types$1._catch) { - var clause = this.startNode(); - this.next(); - if (this.eat(types$1.parenL)) { - clause.param = this.parseCatchClauseParam(); - } else { - if (this.options.ecmaVersion < 10) { this.unexpected(); } - clause.param = null; - this.enterScope(0); - } - clause.body = this.parseBlock(false); - this.exitScope(); - node.handler = this.finishNode(clause, "CatchClause"); - } - node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) - { this.raise(node.start, "Missing catch or finally clause"); } - return this.finishNode(node, "TryStatement") -}; - -pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) { - this.next(); - this.parseVar(node, false, kind, allowMissingInitializer); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration") -}; - -pp$8.parseWhileStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel); - node.body = this.parseStatement("while"); - this.labels.pop(); - return this.finishNode(node, "WhileStatement") -}; - -pp$8.parseWithStatement = function(node) { - if (this.strict) { this.raise(this.start, "'with' in strict mode"); } - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement("with"); - return this.finishNode(node, "WithStatement") -}; - -pp$8.parseEmptyStatement = function(node) { - this.next(); - return this.finishNode(node, "EmptyStatement") -}; - -pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { - for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) - { - var label = list[i$1]; - - if (label.name === maybeName) - { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - } } - var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; - for (var i = this.labels.length - 1; i >= 0; i--) { - var label$1 = this.labels[i]; - if (label$1.statementStart === node.start) { - // Update information about previous labels on this node - label$1.statementStart = this.start; - label$1.kind = kind; - } else { break } - } - this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement") -}; - -pp$8.parseExpressionStatement = function(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement") -}; - -// Parse a semicolon-enclosed block of statements, handling `"use -// strict"` declarations when `allowStrict` is true (used for -// function bodies). - -pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { - if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; - if ( node === void 0 ) node = this.startNode(); - - node.body = []; - this.expect(types$1.braceL); - if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - if (exitStrict) { this.strict = false; } - this.next(); - if (createNewLexicalScope) { this.exitScope(); } - return this.finishNode(node, "BlockStatement") -}; - -// Parse a regular `for` loop. The disambiguation code in -// `parseStatement` will already have parsed the init statement or -// expression. - -pp$8.parseFor = function(node, init) { - node.init = init; - this.expect(types$1.semi); - node.test = this.type === types$1.semi ? null : this.parseExpression(); - this.expect(types$1.semi); - node.update = this.type === types$1.parenR ? null : this.parseExpression(); - this.expect(types$1.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, "ForStatement") -}; - -// Parse a `for`/`in` and `for`/`of` loop, which are almost -// same from parser's perspective. - -pp$8.parseForIn = function(node, init) { - var isForIn = this.type === types$1._in; - this.next(); - - if ( - init.type === "VariableDeclaration" && - init.declarations[0].init != null && - ( - !isForIn || - this.options.ecmaVersion < 8 || - this.strict || - init.kind !== "var" || - init.declarations[0].id.type !== "Identifier" - ) - ) { - this.raise( - init.start, - ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") - ); - } - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types$1.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") -}; - -// Parse a list of variable declarations. - -pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) { - node.declarations = []; - node.kind = kind; - for (;;) { - var decl = this.startNode(); - this.parseVarId(decl, kind); - if (this.eat(types$1.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { - this.unexpected(); - } else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) { - this.raise(this.lastTokEnd, ("Missing initializer in " + kind + " declaration")); - } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { - this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types$1.comma)) { break } - } - return node -}; - -pp$8.parseVarId = function(decl, kind) { - decl.id = kind === "using" || kind === "await using" - ? this.parseIdent() - : this.parseBindingAtom(); - - this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); -}; - -var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; - -// Parse a function declaration or literal (depending on the -// `statement & FUNC_STATEMENT`). - -// Remove `allowExpressionBody` for 7.0.0, as it is only called with false -pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { - this.initFunction(node); - if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) - { this.unexpected(); } - node.generator = this.eat(types$1.star); - } - if (this.options.ecmaVersion >= 8) - { node.async = !!isAsync; } - - if (statement & FUNC_STATEMENT) { - node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); - if (node.id && !(statement & FUNC_HANGING_STATEMENT)) - // If it is a regular function declaration in sloppy mode, then it is - // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding - // mode depends on properties of the current scope (see - // treatFunctionsAsVar). - { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } - } - - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(node.async, node.generator)); - - if (!(statement & FUNC_STATEMENT)) - { node.id = this.type === types$1.name ? this.parseIdent() : null; } - - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false, forInit); - - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") -}; - -pp$8.parseFunctionParams = function(node) { - this.expect(types$1.parenL); - node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); -}; - -// Parse a class declaration or literal (depending on the -// `isStatement` parameter). - -pp$8.parseClass = function(node, isStatement) { - this.next(); - - // ecma-262 14.6 Class Definitions - // A class definition is always strict mode code. - var oldStrict = this.strict; - this.strict = true; - - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var privateNameMap = this.enterClassBody(); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(types$1.braceL); - while (this.type !== types$1.braceR) { - var element = this.parseClassElement(node.superClass !== null); - if (element) { - classBody.body.push(element); - if (element.type === "MethodDefinition" && element.kind === "constructor") { - if (hadConstructor) { this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); } - hadConstructor = true; - } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { - this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared")); - } - } - } - this.strict = oldStrict; - this.next(); - node.body = this.finishNode(classBody, "ClassBody"); - this.exitClassBody(); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") -}; - -pp$8.parseClassElement = function(constructorAllowsSuper) { - if (this.eat(types$1.semi)) { return null } - - var ecmaVersion = this.options.ecmaVersion; - var node = this.startNode(); - var keyName = ""; - var isGenerator = false; - var isAsync = false; - var kind = "method"; - var isStatic = false; - - if (this.eatContextual("static")) { - // Parse static init block - if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { - this.parseClassStaticBlock(node); - return node - } - if (this.isClassElementNameStart() || this.type === types$1.star) { - isStatic = true; - } else { - keyName = "static"; - } - } - node.static = isStatic; - if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { - if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { - isAsync = true; - } else { - keyName = "async"; - } - } - if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { - isGenerator = true; - } - if (!keyName && !isAsync && !isGenerator) { - var lastValue = this.value; - if (this.eatContextual("get") || this.eatContextual("set")) { - if (this.isClassElementNameStart()) { - kind = lastValue; - } else { - keyName = lastValue; - } - } - } - - // Parse element name - if (keyName) { - // 'async', 'get', 'set', or 'static' were not a keyword contextually. - // The last token is any of those. Make it the element name. - node.computed = false; - node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); - node.key.name = keyName; - this.finishNode(node.key, "Identifier"); - } else { - this.parseClassElementName(node); - } - - // Parse element value - if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { - var isConstructor = !node.static && checkKeyName(node, "constructor"); - var allowsDirectSuper = isConstructor && constructorAllowsSuper; - // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. - if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); } - node.kind = isConstructor ? "constructor" : kind; - this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); - } else { - this.parseClassField(node); - } - - return node -}; - -pp$8.isClassElementNameStart = function() { - return ( - this.type === types$1.name || - this.type === types$1.privateId || - this.type === types$1.num || - this.type === types$1.string || - this.type === types$1.bracketL || - this.type.keyword - ) -}; - -pp$8.parseClassElementName = function(element) { - if (this.type === types$1.privateId) { - if (this.value === "constructor") { - this.raise(this.start, "Classes can't have an element named '#constructor'"); - } - element.computed = false; - element.key = this.parsePrivateIdent(); - } else { - this.parsePropertyName(element); - } -}; - -pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { - // Check key and flags - var key = method.key; - if (method.kind === "constructor") { - if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } - if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } - } else if (method.static && checkKeyName(method, "prototype")) { - this.raise(key.start, "Classes may not have a static property named prototype"); - } - - // Parse value - var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); - - // Check value - if (method.kind === "get" && value.params.length !== 0) - { this.raiseRecoverable(value.start, "getter should have no params"); } - if (method.kind === "set" && value.params.length !== 1) - { this.raiseRecoverable(value.start, "setter should have exactly one param"); } - if (method.kind === "set" && value.params[0].type === "RestElement") - { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); } - - return this.finishNode(method, "MethodDefinition") -}; - -pp$8.parseClassField = function(field) { - if (checkKeyName(field, "constructor")) { - this.raise(field.key.start, "Classes can't have a field named 'constructor'"); - } else if (field.static && checkKeyName(field, "prototype")) { - this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); - } - - if (this.eat(types$1.eq)) { - // To raise SyntaxError if 'arguments' exists in the initializer. - this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER); - field.value = this.parseMaybeAssign(); - this.exitScope(); - } else { - field.value = null; - } - this.semicolon(); - - return this.finishNode(field, "PropertyDefinition") -}; - -pp$8.parseClassStaticBlock = function(node) { - node.body = []; - - var oldLabels = this.labels; - this.labels = []; - this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - this.next(); - this.exitScope(); - this.labels = oldLabels; - - return this.finishNode(node, "StaticBlock") -}; - -pp$8.parseClassId = function(node, isStatement) { - if (this.type === types$1.name) { - node.id = this.parseIdent(); - if (isStatement) - { this.checkLValSimple(node.id, BIND_LEXICAL, false); } - } else { - if (isStatement === true) - { this.unexpected(); } - node.id = null; - } -}; - -pp$8.parseClassSuper = function(node) { - node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; -}; - -pp$8.enterClassBody = function() { - var element = {declared: Object.create(null), used: []}; - this.privateNameStack.push(element); - return element.declared -}; - -pp$8.exitClassBody = function() { - var ref = this.privateNameStack.pop(); - var declared = ref.declared; - var used = ref.used; - if (!this.options.checkPrivateFields) { return } - var len = this.privateNameStack.length; - var parent = len === 0 ? null : this.privateNameStack[len - 1]; - for (var i = 0; i < used.length; ++i) { - var id = used[i]; - if (!hasOwn(declared, id.name)) { - if (parent) { - parent.used.push(id); - } else { - this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class")); - } - } - } -}; - -function isPrivateNameConflicted(privateNameMap, element) { - var name = element.key.name; - var curr = privateNameMap[name]; - - var next = "true"; - if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { - next = (element.static ? "s" : "i") + element.kind; - } - - // `class { get #a(){}; static set #a(_){} }` is also conflict. - if ( - curr === "iget" && next === "iset" || - curr === "iset" && next === "iget" || - curr === "sget" && next === "sset" || - curr === "sset" && next === "sget" - ) { - privateNameMap[name] = "true"; - return false - } else if (!curr) { - privateNameMap[name] = next; - return false - } else { - return true - } -} - -function checkKeyName(node, name) { - var computed = node.computed; - var key = node.key; - return !computed && ( - key.type === "Identifier" && key.name === name || - key.type === "Literal" && key.value === name - ) -} - -// Parses module export declaration. - -pp$8.parseExportAllDeclaration = function(node, exports) { - if (this.options.ecmaVersion >= 11) { - if (this.eatContextual("as")) { - node.exported = this.parseModuleExportName(); - this.checkExport(exports, node.exported, this.lastTokStart); - } else { - node.exported = null; - } - } - this.expectContextual("from"); - if (this.type !== types$1.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - if (this.options.ecmaVersion >= 16) - { node.attributes = this.parseWithClause(); } - this.semicolon(); - return this.finishNode(node, "ExportAllDeclaration") -}; - -pp$8.parseExport = function(node, exports) { - this.next(); - // export * from '...' - if (this.eat(types$1.star)) { - return this.parseExportAllDeclaration(node, exports) - } - if (this.eat(types$1._default)) { // export default ... - this.checkExport(exports, "default", this.lastTokStart); - node.declaration = this.parseExportDefaultDeclaration(); - return this.finishNode(node, "ExportDefaultDeclaration") - } - // export var|const|let|function|class ... - if (this.shouldParseExportStatement()) { - node.declaration = this.parseExportDeclaration(node); - if (node.declaration.type === "VariableDeclaration") - { this.checkVariableExport(exports, node.declaration.declarations); } - else - { this.checkExport(exports, node.declaration.id, node.declaration.id.start); } - node.specifiers = []; - node.source = null; - if (this.options.ecmaVersion >= 16) - { node.attributes = []; } - } else { // export { x, y as z } [from '...'] - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual("from")) { - if (this.type !== types$1.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - if (this.options.ecmaVersion >= 16) - { node.attributes = this.parseWithClause(); } - } else { - for (var i = 0, list = node.specifiers; i < list.length; i += 1) { - // check for keywords used as local names - var spec = list[i]; - - this.checkUnreserved(spec.local); - // check if export is defined - this.checkLocalExport(spec.local); - - if (spec.local.type === "Literal") { - this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); - } - } - - node.source = null; - if (this.options.ecmaVersion >= 16) - { node.attributes = []; } - } - this.semicolon(); - } - return this.finishNode(node, "ExportNamedDeclaration") -}; - -pp$8.parseExportDeclaration = function(node) { - return this.parseStatement(null) -}; - -pp$8.parseExportDefaultDeclaration = function() { - var isAsync; - if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { - var fNode = this.startNode(); - this.next(); - if (isAsync) { this.next(); } - return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync) - } else if (this.type === types$1._class) { - var cNode = this.startNode(); - return this.parseClass(cNode, "nullableID") - } else { - var declaration = this.parseMaybeAssign(); - this.semicolon(); - return declaration - } -}; - -pp$8.checkExport = function(exports, name, pos) { - if (!exports) { return } - if (typeof name !== "string") - { name = name.type === "Identifier" ? name.name : name.value; } - if (hasOwn(exports, name)) - { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } - exports[name] = true; -}; - -pp$8.checkPatternExport = function(exports, pat) { - var type = pat.type; - if (type === "Identifier") - { this.checkExport(exports, pat, pat.start); } - else if (type === "ObjectPattern") - { for (var i = 0, list = pat.properties; i < list.length; i += 1) - { - var prop = list[i]; - - this.checkPatternExport(exports, prop); - } } - else if (type === "ArrayPattern") - { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { - var elt = list$1[i$1]; - - if (elt) { this.checkPatternExport(exports, elt); } - } } - else if (type === "Property") - { this.checkPatternExport(exports, pat.value); } - else if (type === "AssignmentPattern") - { this.checkPatternExport(exports, pat.left); } - else if (type === "RestElement") - { this.checkPatternExport(exports, pat.argument); } -}; - -pp$8.checkVariableExport = function(exports, decls) { - if (!exports) { return } - for (var i = 0, list = decls; i < list.length; i += 1) - { - var decl = list[i]; - - this.checkPatternExport(exports, decl.id); - } -}; - -pp$8.shouldParseExportStatement = function() { - return this.type.keyword === "var" || - this.type.keyword === "const" || - this.type.keyword === "class" || - this.type.keyword === "function" || - this.isLet() || - this.isAsyncFunction() -}; - -// Parses a comma-separated list of module exports. - -pp$8.parseExportSpecifier = function(exports) { - var node = this.startNode(); - node.local = this.parseModuleExportName(); - - node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; - this.checkExport( - exports, - node.exported, - node.exported.start - ); - - return this.finishNode(node, "ExportSpecifier") -}; - -pp$8.parseExportSpecifiers = function(exports) { - var nodes = [], first = true; - // export { x, y as z } [from '...'] - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { break } - } else { first = false; } - - nodes.push(this.parseExportSpecifier(exports)); - } - return nodes -}; - -// Parses import declaration. - -pp$8.parseImport = function(node) { - this.next(); - - // import '...' - if (this.type === types$1.string) { - node.specifiers = empty$1; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual("from"); - node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); - } - if (this.options.ecmaVersion >= 16) - { node.attributes = this.parseWithClause(); } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration") -}; - -// Parses a comma-separated list of module imports. - -pp$8.parseImportSpecifier = function() { - var node = this.startNode(); - node.imported = this.parseModuleExportName(); - - if (this.eatContextual("as")) { - node.local = this.parseIdent(); - } else { - this.checkUnreserved(node.imported); - node.local = node.imported; - } - this.checkLValSimple(node.local, BIND_LEXICAL); - - return this.finishNode(node, "ImportSpecifier") -}; - -pp$8.parseImportDefaultSpecifier = function() { - // import defaultObj, { x, y as z } from '...' - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLValSimple(node.local, BIND_LEXICAL); - return this.finishNode(node, "ImportDefaultSpecifier") -}; - -pp$8.parseImportNamespaceSpecifier = function() { - var node = this.startNode(); - this.next(); - this.expectContextual("as"); - node.local = this.parseIdent(); - this.checkLValSimple(node.local, BIND_LEXICAL); - return this.finishNode(node, "ImportNamespaceSpecifier") -}; - -pp$8.parseImportSpecifiers = function() { - var nodes = [], first = true; - if (this.type === types$1.name) { - nodes.push(this.parseImportDefaultSpecifier()); - if (!this.eat(types$1.comma)) { return nodes } - } - if (this.type === types$1.star) { - nodes.push(this.parseImportNamespaceSpecifier()); - return nodes - } - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { break } - } else { first = false; } - - nodes.push(this.parseImportSpecifier()); - } - return nodes -}; - -pp$8.parseWithClause = function() { - var nodes = []; - if (!this.eat(types$1._with)) { - return nodes - } - this.expect(types$1.braceL); - var attributeKeys = {}; - var first = true; - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { break } - } else { first = false; } - - var attr = this.parseImportAttribute(); - var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value; - if (hasOwn(attributeKeys, keyName)) - { this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); } - attributeKeys[keyName] = true; - nodes.push(attr); - } - return nodes -}; - -pp$8.parseImportAttribute = function() { - var node = this.startNode(); - node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); - this.expect(types$1.colon); - if (this.type !== types$1.string) { - this.unexpected(); - } - node.value = this.parseExprAtom(); - return this.finishNode(node, "ImportAttribute") -}; - -pp$8.parseModuleExportName = function() { - if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { - var stringLiteral = this.parseLiteral(this.value); - if (loneSurrogate.test(stringLiteral.value)) { - this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); - } - return stringLiteral - } - return this.parseIdent(true) -}; - -// Set `ExpressionStatement#directive` property for directive prologues. -pp$8.adaptDirectivePrologue = function(statements) { - for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { - statements[i].directive = statements[i].expression.raw.slice(1, -1); - } -}; -pp$8.isDirectiveCandidate = function(statement) { - return ( - this.options.ecmaVersion >= 5 && - statement.type === "ExpressionStatement" && - statement.expression.type === "Literal" && - typeof statement.expression.value === "string" && - // Reject parenthesized strings. - (this.input[statement.start] === "\"" || this.input[statement.start] === "'") - ) -}; - -var pp$7 = Parser.prototype; - -// Convert existing expression atom to assignable pattern -// if possible. - -pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case "Identifier": - if (this.inAsync && node.name === "await") - { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } - break - - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - break - - case "ObjectExpression": - node.type = "ObjectPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - for (var i = 0, list = node.properties; i < list.length; i += 1) { - var prop = list[i]; - - this.toAssignable(prop, isBinding); - // Early error: - // AssignmentRestProperty[Yield, Await] : - // `...` DestructuringAssignmentTarget[Yield, Await] - // - // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. - if ( - prop.type === "RestElement" && - (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") - ) { - this.raise(prop.argument.start, "Unexpected token"); - } - } - break - - case "Property": - // AssignmentProperty has type === "Property" - if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } - this.toAssignable(node.value, isBinding); - break - - case "ArrayExpression": - node.type = "ArrayPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - this.toAssignableList(node.elements, isBinding); - break - - case "SpreadElement": - node.type = "RestElement"; - this.toAssignable(node.argument, isBinding); - if (node.argument.type === "AssignmentPattern") - { this.raise(node.argument.start, "Rest elements cannot have a default value"); } - break - - case "AssignmentExpression": - if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isBinding); - break - - case "ParenthesizedExpression": - this.toAssignable(node.expression, isBinding, refDestructuringErrors); - break - - case "ChainExpression": - this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); - break - - case "MemberExpression": - if (!isBinding) { break } - - default: - this.raise(node.start, "Assigning to rvalue"); - } - } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - return node -}; - -// Convert list of expression atoms to binding list. - -pp$7.toAssignableList = function(exprList, isBinding) { - var end = exprList.length; - for (var i = 0; i < end; i++) { - var elt = exprList[i]; - if (elt) { this.toAssignable(elt, isBinding); } - } - if (end) { - var last = exprList[end - 1]; - if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") - { this.unexpected(last.argument.start); } - } - return exprList -}; - -// Parses spread element. - -pp$7.parseSpread = function(refDestructuringErrors) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refDestructuringErrors); - return this.finishNode(node, "SpreadElement") -}; - -pp$7.parseRestBinding = function() { - var node = this.startNode(); - this.next(); - - // RestElement inside of a function parameter must be an identifier - if (this.options.ecmaVersion === 6 && this.type !== types$1.name) - { this.unexpected(); } - - node.argument = this.parseBindingAtom(); - - return this.finishNode(node, "RestElement") -}; - -// Parses lvalue (assignable) atom. - -pp$7.parseBindingAtom = function() { - if (this.options.ecmaVersion >= 6) { - switch (this.type) { - case types$1.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(types$1.bracketR, true, true); - return this.finishNode(node, "ArrayPattern") - - case types$1.braceL: - return this.parseObj(true) - } - } - return this.parseIdent() -}; - -pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) { - var elts = [], first = true; - while (!this.eat(close)) { - if (first) { first = false; } - else { this.expect(types$1.comma); } - if (allowEmpty && this.type === types$1.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break - } else if (this.type === types$1.ellipsis) { - var rest = this.parseRestBinding(); - this.parseBindingListItem(rest); - elts.push(rest); - if (this.type === types$1.comma) { this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); } - this.expect(close); - break - } else { - elts.push(this.parseAssignableListItem(allowModifiers)); - } - } - return elts -}; - -pp$7.parseAssignableListItem = function(allowModifiers) { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - return elem -}; - -pp$7.parseBindingListItem = function(param) { - return param -}; - -// Parses assignment pattern around given atom if possible. - -pp$7.parseMaybeDefault = function(startPos, startLoc, left) { - left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern") -}; - -// The following three functions all verify that a node is an lvalue — -// something that can be bound, or assigned to. In order to do so, they perform -// a variety of checks: -// -// - Check that none of the bound/assigned-to identifiers are reserved words. -// - Record name declarations for bindings in the appropriate scope. -// - Check duplicate argument names, if checkClashes is set. -// -// If a complex binding pattern is encountered (e.g., object and array -// destructuring), the entire pattern is recursively checked. -// -// There are three versions of checkLVal*() appropriate for different -// circumstances: -// -// - checkLValSimple() shall be used if the syntactic construct supports -// nothing other than identifiers and member expressions. Parenthesized -// expressions are also correctly handled. This is generally appropriate for -// constructs for which the spec says -// -// > It is a Syntax Error if AssignmentTargetType of [the production] is not -// > simple. -// -// It is also appropriate for checking if an identifier is valid and not -// defined elsewhere, like import declarations or function/class identifiers. -// -// Examples where this is used include: -// a += …; -// import a from '…'; -// where a is the node to be checked. -// -// - checkLValPattern() shall be used if the syntactic construct supports -// anything checkLValSimple() supports, as well as object and array -// destructuring patterns. This is generally appropriate for constructs for -// which the spec says -// -// > It is a Syntax Error if [the production] is neither an ObjectLiteral nor -// > an ArrayLiteral and AssignmentTargetType of [the production] is not -// > simple. -// -// Examples where this is used include: -// (a = …); -// const a = …; -// try { … } catch (a) { … } -// where a is the node to be checked. -// -// - checkLValInnerPattern() shall be used if the syntactic construct supports -// anything checkLValPattern() supports, as well as default assignment -// patterns, rest elements, and other constructs that may appear within an -// object or array destructuring pattern. -// -// As a special case, function parameters also use checkLValInnerPattern(), -// as they also support defaults and rest constructs. -// -// These functions deliberately support both assignment and binding constructs, -// as the logic for both is exceedingly similar. If the node is the target of -// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it -// should be set to the appropriate BIND_* constant, like BIND_VAR or -// BIND_LEXICAL. -// -// If the function is called with a non-BIND_NONE bindingType, then -// additionally a checkClashes object may be specified to allow checking for -// duplicate argument names. checkClashes is ignored if the provided construct -// is an assignment (i.e., bindingType is BIND_NONE). - -pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; - - var isBind = bindingType !== BIND_NONE; - - switch (expr.type) { - case "Identifier": - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) - { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } - if (isBind) { - if (bindingType === BIND_LEXICAL && expr.name === "let") - { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } - if (checkClashes) { - if (hasOwn(checkClashes, expr.name)) - { this.raiseRecoverable(expr.start, "Argument name clash"); } - checkClashes[expr.name] = true; - } - if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } - } - break - - case "ChainExpression": - this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); - break - - case "MemberExpression": - if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); } - break - - case "ParenthesizedExpression": - if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); } - return this.checkLValSimple(expr.expression, bindingType, checkClashes) - - default: - this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); - } -}; - -pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; - - switch (expr.type) { - case "ObjectPattern": - for (var i = 0, list = expr.properties; i < list.length; i += 1) { - var prop = list[i]; - - this.checkLValInnerPattern(prop, bindingType, checkClashes); - } - break - - case "ArrayPattern": - for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { - var elem = list$1[i$1]; - - if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); } - } - break - - default: - this.checkLValSimple(expr, bindingType, checkClashes); - } -}; - -pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; - - switch (expr.type) { - case "Property": - // AssignmentProperty has type === "Property" - this.checkLValInnerPattern(expr.value, bindingType, checkClashes); - break - - case "AssignmentPattern": - this.checkLValPattern(expr.left, bindingType, checkClashes); - break - - case "RestElement": - this.checkLValPattern(expr.argument, bindingType, checkClashes); - break - - default: - this.checkLValPattern(expr, bindingType, checkClashes); - } -}; - -// The algorithm used to determine whether a regexp can appear at a -// given point in the program is loosely based on sweet.js' approach. -// See https://github.com/mozilla/sweet.js/wiki/design - - -var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; -}; - -var types = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", false), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), - f_stat: new TokContext("function", false), - f_expr: new TokContext("function", true), - f_expr_gen: new TokContext("function", true, false, null, true), - f_gen: new TokContext("function", false, false, null, true) -}; - -var pp$6 = Parser.prototype; - -pp$6.initialContext = function() { - return [types.b_stat] -}; - -pp$6.curContext = function() { - return this.context[this.context.length - 1] -}; - -pp$6.braceIsBlock = function(prevType) { - var parent = this.curContext(); - if (parent === types.f_expr || parent === types.f_stat) - { return true } - if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) - { return !parent.isExpr } - - // The check for `tt.name && exprAllowed` detects whether we are - // after a `yield` or `of` construct. See the `updateContext` for - // `tt.name`. - if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) - { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } - if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) - { return true } - if (prevType === types$1.braceL) - { return parent === types.b_stat } - if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) - { return false } - return !this.exprAllowed -}; - -pp$6.inGeneratorContext = function() { - for (var i = this.context.length - 1; i >= 1; i--) { - var context = this.context[i]; - if (context.token === "function") - { return context.generator } - } - return false -}; - -pp$6.updateContext = function(prevType) { - var update, type = this.type; - if (type.keyword && prevType === types$1.dot) - { this.exprAllowed = false; } - else if (update = type.updateContext) - { update.call(this, prevType); } - else - { this.exprAllowed = type.beforeExpr; } -}; - -// Used to handle edge cases when token context could not be inferred correctly during tokenization phase - -pp$6.overrideContext = function(tokenCtx) { - if (this.curContext() !== tokenCtx) { - this.context[this.context.length - 1] = tokenCtx; - } -}; - -// Token-specific context update code - -types$1.parenR.updateContext = types$1.braceR.updateContext = function() { - if (this.context.length === 1) { - this.exprAllowed = true; - return - } - var out = this.context.pop(); - if (out === types.b_stat && this.curContext().token === "function") { - out = this.context.pop(); - } - this.exprAllowed = !out.isExpr; -}; - -types$1.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); - this.exprAllowed = true; -}; - -types$1.dollarBraceL.updateContext = function() { - this.context.push(types.b_tmpl); - this.exprAllowed = true; -}; - -types$1.parenL.updateContext = function(prevType) { - var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; - this.context.push(statementParens ? types.p_stat : types.p_expr); - this.exprAllowed = true; -}; - -types$1.incDec.updateContext = function() { - // tokExprAllowed stays unchanged -}; - -types$1._function.updateContext = types$1._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types$1._else && - !(prevType === types$1.semi && this.curContext() !== types.p_stat) && - !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && - !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) - { this.context.push(types.f_expr); } - else - { this.context.push(types.f_stat); } - this.exprAllowed = false; -}; - -types$1.colon.updateContext = function() { - if (this.curContext().token === "function") { this.context.pop(); } - this.exprAllowed = true; -}; - -types$1.backQuote.updateContext = function() { - if (this.curContext() === types.q_tmpl) - { this.context.pop(); } - else - { this.context.push(types.q_tmpl); } - this.exprAllowed = false; -}; - -types$1.star.updateContext = function(prevType) { - if (prevType === types$1._function) { - var index = this.context.length - 1; - if (this.context[index] === types.f_expr) - { this.context[index] = types.f_expr_gen; } - else - { this.context[index] = types.f_gen; } - } - this.exprAllowed = true; -}; - -types$1.name.updateContext = function(prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { - if (this.value === "of" && !this.exprAllowed || - this.value === "yield" && this.inGeneratorContext()) - { allowed = true; } - } - this.exprAllowed = allowed; -}; - -// A recursive descent parser operates by defining functions for all -// syntactic elements, and recursively calling those, each function -// advancing the input stream and returning an AST node. Precedence -// of constructs (for example, the fact that `!x[1]` means `!(x[1])` -// instead of `(!x)[1]` is handled by the fact that the parser -// function that parses unary prefix operators is called first, and -// in turn calls the function that parses `[]` subscripts — that -// way, it'll receive the node for `x[1]` already parsed, and wraps -// *that* in the unary operator node. -// -// Acorn uses an [operator precedence parser][opp] to handle binary -// operator precedence, because it is much more compact than using -// the technique outlined above, which uses different, nesting -// functions to specify precedence, for all of the ten binary -// precedence levels that JavaScript defines. -// -// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser - - -var pp$5 = Parser.prototype; - -// Check if property name clashes with already added. -// Object/class getters and setters are not allowed to clash — -// either with each other or with an init property — and in -// strict mode, init properties are also not allowed to be repeated. - -pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { - if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") - { return } - if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) - { return } - var key = prop.key; - var name; - switch (key.type) { - case "Identifier": name = key.name; break - case "Literal": name = String(key.value); break - default: return - } - var kind = prop.kind; - if (this.options.ecmaVersion >= 6) { - if (name === "__proto__" && kind === "init") { - if (propHash.proto) { - if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) { - refDestructuringErrors.doubleProto = key.start; - } - } else { - this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); - } - } - propHash.proto = true; - } - return - } - name = "$" + name; - var other = propHash[name]; - if (other) { - var redefinition; - if (kind === "init") { - redefinition = this.strict && other.init || other.get || other.set; - } else { - redefinition = other.init || other[kind]; - } - if (redefinition) - { this.raiseRecoverable(key.start, "Redefinition of property"); } - } else { - other = propHash[name] = { - init: false, - get: false, - set: false - }; - } - other[kind] = true; -}; - -// ### Expression parsing - -// These nest, from the most general expression type at the top to -// 'atomic', nondivisible expression types at the bottom. Most of -// the functions will simply let the function(s) below them parse, -// and, *if* the syntactic construct they handle is present, wrap -// the AST node that the inner parser gave them in another node. - -// Parse a full expression. The optional arguments are used to -// forbid the `in` operator (in for loops initalization expressions) -// and provide reference for storing '=' operator inside shorthand -// property assignment in contexts where both object expression -// and object pattern might appear (so it's possible to raise -// delayed syntax error at correct position). - -pp$5.parseExpression = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types$1.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } - return this.finishNode(node, "SequenceExpression") - } - return expr -}; - -// Parse an assignment expression. This includes applications of -// operators like `+=`. - -pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { - if (this.isContextual("yield")) { - if (this.inGenerator) { return this.parseYield(forInit) } - // The tokenizer will assume an expression is allowed after - // `yield`, but this isn't that kind of yield - else { this.exprAllowed = false; } - } - - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; - if (refDestructuringErrors) { - oldParenAssign = refDestructuringErrors.parenthesizedAssign; - oldTrailingComma = refDestructuringErrors.trailingComma; - oldDoubleProto = refDestructuringErrors.doubleProto; - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; - } else { - refDestructuringErrors = new DestructuringErrors; - ownDestructuringErrors = true; - } - - var startPos = this.start, startLoc = this.startLoc; - if (this.type === types$1.parenL || this.type === types$1.name) { - this.potentialArrowAt = this.start; - this.potentialArrowInForAwait = forInit === "await"; - } - var left = this.parseMaybeConditional(forInit, refDestructuringErrors); - if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } - if (this.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - if (this.type === types$1.eq) - { left = this.toAssignable(left, false, refDestructuringErrors); } - if (!ownDestructuringErrors) { - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; - } - if (refDestructuringErrors.shorthandAssign >= left.start) - { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - if (this.type === types$1.eq) - { this.checkLValPattern(left); } - else - { this.checkLValSimple(left); } - node.left = left; - this.next(); - node.right = this.parseMaybeAssign(forInit); - if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } - return this.finishNode(node, "AssignmentExpression") - } else { - if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } - } - if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } - if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } - return left -}; - -// Parse a ternary conditional (`?:`) operator. - -pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprOps(forInit, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - if (this.eat(types$1.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(types$1.colon); - node.alternate = this.parseMaybeAssign(forInit); - return this.finishNode(node, "ConditionalExpression") - } - return expr -}; - -// Start the precedence parser. - -pp$5.parseExprOps = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit) -}; - -// Parse binary operators with the operator precedence parsing -// algorithm. `left` is the left-hand side of the operator. -// `minPrec` provides context that allows the function to stop and -// defer further parser to one of its callers when it encounters an -// operator that has a lower precedence than the set it is parsing. - -pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { - var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types$1._in)) { - if (prec > minPrec) { - var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; - var coalesce = this.type === types$1.coalesce; - if (coalesce) { - // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. - // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. - prec = types$1.logicalAND.binop; - } - var op = this.value; - this.next(); - var startPos = this.start, startLoc = this.startLoc; - var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); - var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { - this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); - } - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) - } - } - return left -}; - -pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { - if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.operator = op; - node.right = right; - return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") -}; - -// Parse unary operators, both prefix and postfix. - -pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { - var startPos = this.start, startLoc = this.startLoc, expr; - if (this.isContextual("await") && this.canAwait) { - expr = this.parseAwait(forInit); - sawUnary = true; - } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types$1.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(null, true, update, forInit); - this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { this.checkLValSimple(node.argument); } - else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument)) - { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } - else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) - { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } - else { sawUnary = true; } - expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } else if (!sawUnary && this.type === types$1.privateId) { - if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); } - expr = this.parsePrivateIdent(); - // only could be private fields in 'in', such as #x in obj - if (this.type !== types$1._in) { this.unexpected(); } - } else { - expr = this.parseExprSubscripts(refDestructuringErrors, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - while (this.type.postfix && !this.canInsertSemicolon()) { - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.operator = this.value; - node$1.prefix = false; - node$1.argument = expr; - this.checkLValSimple(expr); - this.next(); - expr = this.finishNode(node$1, "UpdateExpression"); - } - } - - if (!incDec && this.eat(types$1.starstar)) { - if (sawUnary) - { this.unexpected(this.lastTokStart); } - else - { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) } - } else { - return expr - } -}; - -function isLocalVariableAccess(node) { - return ( - node.type === "Identifier" || - node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression) - ) -} - -function isPrivateFieldAccess(node) { - return ( - node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || - node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) || - node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression) - ) -} - -// Parse call, dot, and `[]`-subscript expressions. - -pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors, forInit); - if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") - { return expr } - var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); - if (refDestructuringErrors && result.type === "MemberExpression") { - if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } - if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } - if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; } - } - return result -}; - -pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { - var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && - this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && - this.potentialArrowAt === base.start; - var optionalChained = false; - - while (true) { - var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); - - if (element.optional) { optionalChained = true; } - if (element === base || element.type === "ArrowFunctionExpression") { - if (optionalChained) { - var chainNode = this.startNodeAt(startPos, startLoc); - chainNode.expression = element; - element = this.finishNode(chainNode, "ChainExpression"); - } - return element - } - - base = element; - } -}; - -pp$5.shouldParseAsyncArrow = function() { - return !this.canInsertSemicolon() && this.eat(types$1.arrow) -}; - -pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit) -}; - -pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { - var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types$1.questionDot); - if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } - - var computed = this.eat(types$1.bracketL); - if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - if (computed) { - node.property = this.parseExpression(); - this.expect(types$1.bracketR); - } else if (this.type === types$1.privateId && base.type !== "Super") { - node.property = this.parsePrivateIdent(); - } else { - node.property = this.parseIdent(this.options.allowReserved !== "never"); - } - node.computed = !!computed; - if (optionalSupported) { - node.optional = optional; - } - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types$1.parenL)) { - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) - { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit) - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.callee = base; - node$1.arguments = exprList; - if (optionalSupported) { - node$1.optional = optional; - } - base = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types$1.backQuote) { - if (optional || optionalChained) { - this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); - } - var node$2 = this.startNodeAt(startPos, startLoc); - node$2.tag = base; - node$2.quasi = this.parseTemplate({isTagged: true}); - base = this.finishNode(node$2, "TaggedTemplateExpression"); - } - return base -}; - -// Parse an atomic expression — either a single token that is an -// expression, an expression started by a keyword like `function` or -// `new`, or an expression wrapped in punctuation like `()`, `[]`, -// or `{}`. - -pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) { - // If a division operator appears in an expression position, the - // tokenizer got confused, and we force it to read a regexp instead. - if (this.type === types$1.slash) { this.readRegexp(); } - - var node, canBeArrow = this.potentialArrowAt === this.start; - switch (this.type) { - case types$1._super: - if (!this.allowSuper) - { this.raise(this.start, "'super' keyword outside a method"); } - node = this.startNode(); - this.next(); - if (this.type === types$1.parenL && !this.allowDirectSuper) - { this.raise(node.start, "super() call outside constructor of a subclass"); } - // The `super` keyword can appear at below: - // SuperProperty: - // super [ Expression ] - // super . IdentifierName - // SuperCall: - // super ( Arguments ) - if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) - { this.unexpected(); } - return this.finishNode(node, "Super") - - case types$1._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression") - - case types$1.name: - var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; - var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { - this.overrideContext(types.f_expr); - return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) - } - if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types$1.arrow)) - { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && - (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { - id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) - { this.unexpected(); } - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) - } - } - return id - - case types$1.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = {pattern: value.pattern, flags: value.flags}; - return node - - case types$1.num: case types$1.string: - return this.parseLiteral(this.value) - - case types$1._null: case types$1._true: case types$1._false: - node = this.startNode(); - node.value = this.type === types$1._null ? null : this.type === types$1._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, "Literal") - - case types$1.parenL: - var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); - if (refDestructuringErrors) { - if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) - { refDestructuringErrors.parenthesizedAssign = start; } - if (refDestructuringErrors.parenthesizedBind < 0) - { refDestructuringErrors.parenthesizedBind = start; } - } - return expr - - case types$1.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); - return this.finishNode(node, "ArrayExpression") - - case types$1.braceL: - this.overrideContext(types.b_expr); - return this.parseObj(false, refDestructuringErrors) - - case types$1._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, 0) - - case types$1._class: - return this.parseClass(this.startNode(), false) - - case types$1._new: - return this.parseNew() - - case types$1.backQuote: - return this.parseTemplate() - - case types$1._import: - if (this.options.ecmaVersion >= 11) { - return this.parseExprImport(forNew) - } else { - return this.unexpected() - } - - default: - return this.parseExprAtomDefault() - } -}; - -pp$5.parseExprAtomDefault = function() { - this.unexpected(); -}; - -pp$5.parseExprImport = function(forNew) { - var node = this.startNode(); - - // Consume `import` as an identifier for `import.meta`. - // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. - if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } - this.next(); - - if (this.type === types$1.parenL && !forNew) { - return this.parseDynamicImport(node) - } else if (this.type === types$1.dot) { - var meta = this.startNodeAt(node.start, node.loc && node.loc.start); - meta.name = "import"; - node.meta = this.finishNode(meta, "Identifier"); - return this.parseImportMeta(node) - } else { - this.unexpected(); - } -}; - -pp$5.parseDynamicImport = function(node) { - this.next(); // skip `(` - - // Parse node.source. - node.source = this.parseMaybeAssign(); - - if (this.options.ecmaVersion >= 16) { - if (!this.eat(types$1.parenR)) { - this.expect(types$1.comma); - if (!this.afterTrailingComma(types$1.parenR)) { - node.options = this.parseMaybeAssign(); - if (!this.eat(types$1.parenR)) { - this.expect(types$1.comma); - if (!this.afterTrailingComma(types$1.parenR)) { - this.unexpected(); - } - } - } else { - node.options = null; - } - } else { - node.options = null; - } - } else { - // Verify ending. - if (!this.eat(types$1.parenR)) { - var errorPos = this.start; - if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { - this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); - } else { - this.unexpected(errorPos); - } - } - } - - return this.finishNode(node, "ImportExpression") -}; - -pp$5.parseImportMeta = function(node) { - this.next(); // skip `.` - - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - - if (node.property.name !== "meta") - { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } - if (containsEsc) - { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } - if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) - { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } - - return this.finishNode(node, "MetaProperty") -}; - -pp$5.parseLiteral = function(value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) - { node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, ""); } - this.next(); - return this.finishNode(node, "Literal") -}; - -pp$5.parseParenExpression = function() { - this.expect(types$1.parenL); - var val = this.parseExpression(); - this.expect(types$1.parenR); - return val -}; - -pp$5.shouldParseArrow = function(exprList) { - return !this.canInsertSemicolon() -}; - -pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { - var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; - if (this.options.ecmaVersion >= 6) { - this.next(); - - var innerStartPos = this.start, innerStartLoc = this.startLoc; - var exprList = [], first = true, lastIsComma = false; - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; - this.yieldPos = 0; - this.awaitPos = 0; - // Do not save awaitIdentPos to allow checking awaits nested in parameters - while (this.type !== types$1.parenR) { - first ? first = false : this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { - lastIsComma = true; - break - } else if (this.type === types$1.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types$1.comma) { - this.raiseRecoverable( - this.start, - "Comma is not permitted after the rest element" - ); - } - break - } else { - exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); - } - } - var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; - this.expect(types$1.parenR); - - if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList, forInit) - } - - if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } - if (spreadStart) { this.unexpected(spreadStart); } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } - - if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, "ParenthesizedExpression") - } else { - return val - } -}; - -pp$5.parseParenItem = function(item) { - return item -}; - -pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) -}; - -// New's precedence is slightly tricky. It must allow its argument to -// be a `[]` or dot subscript expression, but not a call — at least, -// not without wrapping it in parentheses. Thus, it uses the noCalls -// argument to parseSubscripts to prevent it from consuming the -// argument list. - -var empty = []; - -pp$5.parseNew = function() { - if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } - var node = this.startNode(); - this.next(); - if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) { - var meta = this.startNodeAt(node.start, node.loc && node.loc.start); - meta.name = "new"; - node.meta = this.finishNode(meta, "Identifier"); - this.next(); - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== "target") - { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } - if (containsEsc) - { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } - if (!this.allowNewDotTarget) - { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } - return this.finishNode(node, "MetaProperty") - } - var startPos = this.start, startLoc = this.startLoc; - node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false); - if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } - else { node.arguments = empty; } - return this.finishNode(node, "NewExpression") -}; - -// Parse template expression. - -pp$5.parseTemplateElement = function(ref) { - var isTagged = ref.isTagged; - - var elem = this.startNode(); - if (this.type === types$1.invalidTemplate) { - if (!isTagged) { - this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); - } - elem.value = { - raw: this.value.replace(/\r\n?/g, "\n"), - cooked: null - }; - } else { - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), - cooked: this.value - }; - } - this.next(); - elem.tail = this.type === types$1.backQuote; - return this.finishNode(elem, "TemplateElement") -}; - -pp$5.parseTemplate = function(ref) { - if ( ref === void 0 ) ref = {}; - var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; - - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement({isTagged: isTagged}); - node.quasis = [curElt]; - while (!curElt.tail) { - if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types$1.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(types$1.braceR); - node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); - } - this.next(); - return this.finishNode(node, "TemplateLiteral") -}; - -pp$5.isAsyncProp = function(prop) { - return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && - (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && - !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) -}; - -// Parse an object literal or binding pattern. - -pp$5.parseObj = function(isPattern, refDestructuringErrors) { - var node = this.startNode(), first = true, propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } - } else { first = false; } - - var prop = this.parseProperty(isPattern, refDestructuringErrors); - if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } - node.properties.push(prop); - } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") -}; - -pp$5.parseProperty = function(isPattern, refDestructuringErrors) { - var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { - if (isPattern) { - prop.argument = this.parseIdent(false); - if (this.type === types$1.comma) { - this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); - } - return this.finishNode(prop, "RestElement") - } - // Parse argument. - prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); - // To disallow trailing comma via `this.toAssignable()`. - if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { - refDestructuringErrors.trailingComma = this.start; - } - // Finish - return this.finishNode(prop, "SpreadElement") - } - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - if (isPattern || refDestructuringErrors) { - startPos = this.start; - startLoc = this.startLoc; - } - if (!isPattern) - { isGenerator = this.eat(types$1.star); } - } - var containsEsc = this.containsEsc; - this.parsePropertyName(prop); - if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); - this.parsePropertyName(prop); - } else { - isAsync = false; - } - this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); - return this.finishNode(prop, "Property") -}; - -pp$5.parseGetterSetter = function(prop) { - var kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - prop.kind = kind; - var paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { - var start = prop.value.start; - if (prop.kind === "get") - { this.raiseRecoverable(start, "getter should have no params"); } - else - { this.raiseRecoverable(start, "setter should have exactly one param"); } - } else { - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") - { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } - } -}; - -pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types$1.colon) - { this.unexpected(); } - - if (this.eat(types$1.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); - prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { - if (isPattern) { this.unexpected(); } - prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - prop.kind = "init"; - } else if (!isPattern && !containsEsc && - this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set") && - (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { - if (isGenerator || isAsync) { this.unexpected(); } - this.parseGetterSetter(prop); - } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { - if (isGenerator || isAsync) { this.unexpected(); } - this.checkUnreserved(prop.key); - if (prop.key.name === "await" && !this.awaitIdentPos) - { this.awaitIdentPos = startPos; } - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else if (this.type === types$1.eq && refDestructuringErrors) { - if (refDestructuringErrors.shorthandAssign < 0) - { refDestructuringErrors.shorthandAssign = this.start; } - prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else { - prop.value = this.copyNode(prop.key); - } - prop.kind = "init"; - prop.shorthand = true; - } else { this.unexpected(); } -}; - -pp$5.parsePropertyName = function(prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(types$1.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(types$1.bracketR); - return prop.key - } else { - prop.computed = false; - } - } - return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") -}; - -// Initialize empty function node. - -pp$5.initFunction = function(node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } - if (this.options.ecmaVersion >= 8) { node.async = false; } -}; - -// Parse object or class method. - -pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { - var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - - this.initFunction(node); - if (this.options.ecmaVersion >= 6) - { node.generator = isGenerator; } - if (this.options.ecmaVersion >= 8) - { node.async = !!isAsync; } - - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - - this.expect(types$1.parenL); - node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true, false); - - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "FunctionExpression") -}; - -// Parse arrow function expression with given parameters. - -pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - - this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); - this.initFunction(node); - if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false, forInit); - - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "ArrowFunctionExpression") -}; - -// Parse function body and check parameters. - -pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { - var isExpression = isArrowFunction && this.type !== types$1.braceL; - var oldStrict = this.strict, useStrict = false; - - if (isExpression) { - node.body = this.parseMaybeAssign(forInit); - node.expression = true; - this.checkParams(node, false); - } else { - var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.end); - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (useStrict && nonSimple) - { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } - } - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldLabels = this.labels; - this.labels = []; - if (useStrict) { this.strict = true; } - - // Add the params to varDeclaredNames to ensure that an error is thrown - // if a let/const declaration in the function clashes with one of the params. - this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); - // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' - if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } - node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); - node.expression = false; - this.adaptDirectivePrologue(node.body.body); - this.labels = oldLabels; - } - this.exitScope(); -}; - -pp$5.isSimpleParamList = function(params) { - for (var i = 0, list = params; i < list.length; i += 1) - { - var param = list[i]; - - if (param.type !== "Identifier") { return false - } } - return true -}; - -// Checks function params for various disallowed patterns such as using "eval" -// or "arguments" and duplicate parameters. - -pp$5.checkParams = function(node, allowDuplicates) { - var nameHash = Object.create(null); - for (var i = 0, list = node.params; i < list.length; i += 1) - { - var param = list[i]; - - this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); - } -}; - -// Parses a comma-separated list of expressions, and returns them as -// an array. `close` is the token type that ends the list, and -// `allowEmpty` can be turned on to allow subsequent commas with -// nothing in between them to be parsed as `null` (which is needed -// for array literals). - -pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { - var elts = [], first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) { break } - } else { first = false; } - - var elt = (void 0); - if (allowEmpty && this.type === types$1.comma) - { elt = null; } - else if (this.type === types$1.ellipsis) { - elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) - { refDestructuringErrors.trailingComma = this.start; } - } else { - elt = this.parseMaybeAssign(false, refDestructuringErrors); - } - elts.push(elt); - } - return elts -}; - -pp$5.checkUnreserved = function(ref) { - var start = ref.start; - var end = ref.end; - var name = ref.name; - - if (this.inGenerator && name === "yield") - { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } - if (this.inAsync && name === "await") - { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } - if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments") - { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); } - if (this.inClassStaticBlock && (name === "arguments" || name === "await")) - { this.raise(start, ("Cannot use " + name + " in class static initialization block")); } - if (this.keywords.test(name)) - { this.raise(start, ("Unexpected keyword '" + name + "'")); } - if (this.options.ecmaVersion < 6 && - this.input.slice(start, end).indexOf("\\") !== -1) { return } - var re = this.strict ? this.reservedWordsStrict : this.reservedWords; - if (re.test(name)) { - if (!this.inAsync && name === "await") - { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } - this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); - } -}; - -// Parse the next token as an identifier. If `liberal` is true (used -// when parsing properties), it will also convert keywords into -// identifiers. - -pp$5.parseIdent = function(liberal) { - var node = this.parseIdentNode(); - this.next(!!liberal); - this.finishNode(node, "Identifier"); - if (!liberal) { - this.checkUnreserved(node); - if (node.name === "await" && !this.awaitIdentPos) - { this.awaitIdentPos = node.start; } - } - return node -}; - -pp$5.parseIdentNode = function() { - var node = this.startNode(); - if (this.type === types$1.name) { - node.name = this.value; - } else if (this.type.keyword) { - node.name = this.type.keyword; - - // To fix https://github.com/acornjs/acorn/issues/575 - // `class` and `function` keywords push new context into this.context. - // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. - // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword - if ((node.name === "class" || node.name === "function") && - (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { - this.context.pop(); - } - this.type = types$1.name; - } else { - this.unexpected(); - } - return node -}; - -pp$5.parsePrivateIdent = function() { - var node = this.startNode(); - if (this.type === types$1.privateId) { - node.name = this.value; - } else { - this.unexpected(); - } - this.next(); - this.finishNode(node, "PrivateIdentifier"); - - // For validating existence - if (this.options.checkPrivateFields) { - if (this.privateNameStack.length === 0) { - this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class")); - } else { - this.privateNameStack[this.privateNameStack.length - 1].used.push(node); - } - } - - return node -}; - -// Parses yield expression inside generator. - -pp$5.parseYield = function(forInit) { - if (!this.yieldPos) { this.yieldPos = this.start; } - - var node = this.startNode(); - this.next(); - if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types$1.star); - node.argument = this.parseMaybeAssign(forInit); - } - return this.finishNode(node, "YieldExpression") -}; - -pp$5.parseAwait = function(forInit) { - if (!this.awaitPos) { this.awaitPos = this.start; } - - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeUnary(null, true, false, forInit); - return this.finishNode(node, "AwaitExpression") -}; - -var pp$4 = Parser.prototype; - -// This function is used to raise exceptions on parse errors. It -// takes an offset integer (into the current `input`) to indicate -// the location of the error, attaches the position to the end -// of the error message, and then raises a `SyntaxError` with that -// message. - -pp$4.raise = function(pos, message) { - var loc = getLineInfo(this.input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - if (this.sourceFile) { - message += " in " + this.sourceFile; - } - var err = new SyntaxError(message); - err.pos = pos; err.loc = loc; err.raisedAt = this.pos; - throw err -}; - -pp$4.raiseRecoverable = pp$4.raise; - -pp$4.curPosition = function() { - if (this.options.locations) { - return new Position(this.curLine, this.pos - this.lineStart) - } -}; - -var pp$3 = Parser.prototype; - -var Scope = function Scope(flags) { - this.flags = flags; - // A list of var-declared names in the current lexical scope - this.var = []; - // A list of lexically-declared names in the current lexical scope - this.lexical = []; - // A list of lexically-declared FunctionDeclaration names in the current lexical scope - this.functions = []; -}; - -// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. - -pp$3.enterScope = function(flags) { - this.scopeStack.push(new Scope(flags)); -}; - -pp$3.exitScope = function() { - this.scopeStack.pop(); -}; - -// The spec says: -// > At the top level of a function, or script, function declarations are -// > treated like var declarations rather than like lexical declarations. -pp$3.treatFunctionsAsVarInScope = function(scope) { - return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) -}; - -pp$3.declareName = function(name, bindingType, pos) { - var redeclared = false; - if (bindingType === BIND_LEXICAL) { - var scope = this.currentScope(); - redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; - scope.lexical.push(name); - if (this.inModule && (scope.flags & SCOPE_TOP)) - { delete this.undefinedExports[name]; } - } else if (bindingType === BIND_SIMPLE_CATCH) { - var scope$1 = this.currentScope(); - scope$1.lexical.push(name); - } else if (bindingType === BIND_FUNCTION) { - var scope$2 = this.currentScope(); - if (this.treatFunctionsAsVar) - { redeclared = scope$2.lexical.indexOf(name) > -1; } - else - { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } - scope$2.functions.push(name); - } else { - for (var i = this.scopeStack.length - 1; i >= 0; --i) { - var scope$3 = this.scopeStack[i]; - if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || - !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { - redeclared = true; - break - } - scope$3.var.push(name); - if (this.inModule && (scope$3.flags & SCOPE_TOP)) - { delete this.undefinedExports[name]; } - if (scope$3.flags & SCOPE_VAR) { break } - } - } - if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } -}; - -pp$3.checkLocalExport = function(id) { - // scope.functions must be empty as Module code is always strict. - if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && - this.scopeStack[0].var.indexOf(id.name) === -1) { - this.undefinedExports[id.name] = id; - } -}; - -pp$3.currentScope = function() { - return this.scopeStack[this.scopeStack.length - 1] -}; - -pp$3.currentVarScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope } - } -}; - -// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. -pp$3.currentThisScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) && - !(scope.flags & SCOPE_ARROW)) { return scope } - } -}; - -var Node = function Node(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - if (parser.options.locations) - { this.loc = new SourceLocation(parser, loc); } - if (parser.options.directSourceFile) - { this.sourceFile = parser.options.directSourceFile; } - if (parser.options.ranges) - { this.range = [pos, 0]; } -}; - -// Start an AST node, attaching a start offset. - -var pp$2 = Parser.prototype; - -pp$2.startNode = function() { - return new Node(this, this.start, this.startLoc) -}; - -pp$2.startNodeAt = function(pos, loc) { - return new Node(this, pos, loc) -}; - -// Finish an AST node, adding `type` and `end` properties. - -function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - if (this.options.locations) - { node.loc.end = loc; } - if (this.options.ranges) - { node.range[1] = pos; } - return node -} - -pp$2.finishNode = function(node, type) { - return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) -}; - -// Finish node at given position - -pp$2.finishNodeAt = function(node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc) -}; - -pp$2.copyNode = function(node) { - var newNode = new Node(this, node.start, this.startLoc); - for (var prop in node) { newNode[prop] = node[prop]; } - return newNode -}; - -// This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually! -var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz"; - -// This file contains Unicode properties extracted from the ECMAScript specification. -// The lists are extracted like so: -// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) - -// #table-binary-unicode-properties -var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; -var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; -var ecma11BinaryProperties = ecma10BinaryProperties; -var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; -var ecma13BinaryProperties = ecma12BinaryProperties; -var ecma14BinaryProperties = ecma13BinaryProperties; - -var unicodeBinaryProperties = { - 9: ecma9BinaryProperties, - 10: ecma10BinaryProperties, - 11: ecma11BinaryProperties, - 12: ecma12BinaryProperties, - 13: ecma13BinaryProperties, - 14: ecma14BinaryProperties -}; - -// #table-binary-unicode-properties-of-strings -var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"; - -var unicodeBinaryPropertiesOfStrings = { - 9: "", - 10: "", - 11: "", - 12: "", - 13: "", - 14: ecma14BinaryPropertiesOfStrings -}; - -// #table-unicode-general-category-values -var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; - -// #table-unicode-script-values -var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; -var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; -var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; -var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; -var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; -var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode; - -var unicodeScriptValues = { - 9: ecma9ScriptValues, - 10: ecma10ScriptValues, - 11: ecma11ScriptValues, - 12: ecma12ScriptValues, - 13: ecma13ScriptValues, - 14: ecma14ScriptValues -}; - -var data = {}; -function buildUnicodeData(ecmaVersion) { - var d = data[ecmaVersion] = { - binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), - binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]), - nonBinary: { - General_Category: wordsRegexp(unicodeGeneralCategoryValues), - Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) - } - }; - d.nonBinary.Script_Extensions = d.nonBinary.Script; - - d.nonBinary.gc = d.nonBinary.General_Category; - d.nonBinary.sc = d.nonBinary.Script; - d.nonBinary.scx = d.nonBinary.Script_Extensions; -} - -for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) { - var ecmaVersion = list[i]; - - buildUnicodeData(ecmaVersion); -} - -var pp$1 = Parser.prototype; - -// Track disjunction structure to determine whether a duplicate -// capture group name is allowed because it is in a separate branch. -var BranchID = function BranchID(parent, base) { - // Parent disjunction branch - this.parent = parent; - // Identifies this set of sibling branches - this.base = base || this; -}; - -BranchID.prototype.separatedFrom = function separatedFrom (alt) { - // A branch is separate from another branch if they or any of - // their parents are siblings in a given disjunction - for (var self = this; self; self = self.parent) { - for (var other = alt; other; other = other.parent) { - if (self.base === other.base && self !== other) { return true } - } - } - return false -}; - -BranchID.prototype.sibling = function sibling () { - return new BranchID(this.parent, this.base) -}; - -var RegExpValidationState = function RegExpValidationState(parser) { - this.parser = parser; - this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; - this.source = ""; - this.flags = ""; - this.start = 0; - this.switchU = false; - this.switchV = false; - this.switchN = false; - this.pos = 0; - this.lastIntValue = 0; - this.lastStringValue = ""; - this.lastAssertionIsQuantifiable = false; - this.numCapturingParens = 0; - this.maxBackReference = 0; - this.groupNames = Object.create(null); - this.backReferenceNames = []; - this.branchID = null; -}; - -RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { - var unicodeSets = flags.indexOf("v") !== -1; - var unicode = flags.indexOf("u") !== -1; - this.start = start | 0; - this.source = pattern + ""; - this.flags = flags; - if (unicodeSets && this.parser.options.ecmaVersion >= 15) { - this.switchU = true; - this.switchV = true; - this.switchN = true; - } else { - this.switchU = unicode && this.parser.options.ecmaVersion >= 6; - this.switchV = false; - this.switchN = unicode && this.parser.options.ecmaVersion >= 9; - } -}; - -RegExpValidationState.prototype.raise = function raise (message) { - this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); -}; - -// If u flag is given, this returns the code point at the index (it combines a surrogate pair). -// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). -RegExpValidationState.prototype.at = function at (i, forceU) { - if ( forceU === void 0 ) forceU = false; - - var s = this.source; - var l = s.length; - if (i >= l) { - return -1 - } - var c = s.charCodeAt(i); - if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { - return c - } - var next = s.charCodeAt(i + 1); - return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c -}; - -RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { - if ( forceU === void 0 ) forceU = false; - - var s = this.source; - var l = s.length; - if (i >= l) { - return l - } - var c = s.charCodeAt(i), next; - if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || - (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { - return i + 1 - } - return i + 2 -}; - -RegExpValidationState.prototype.current = function current (forceU) { - if ( forceU === void 0 ) forceU = false; - - return this.at(this.pos, forceU) -}; - -RegExpValidationState.prototype.lookahead = function lookahead (forceU) { - if ( forceU === void 0 ) forceU = false; - - return this.at(this.nextIndex(this.pos, forceU), forceU) -}; - -RegExpValidationState.prototype.advance = function advance (forceU) { - if ( forceU === void 0 ) forceU = false; - - this.pos = this.nextIndex(this.pos, forceU); -}; - -RegExpValidationState.prototype.eat = function eat (ch, forceU) { - if ( forceU === void 0 ) forceU = false; - - if (this.current(forceU) === ch) { - this.advance(forceU); - return true - } - return false -}; - -RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) { - if ( forceU === void 0 ) forceU = false; - - var pos = this.pos; - for (var i = 0, list = chs; i < list.length; i += 1) { - var ch = list[i]; - - var current = this.at(pos, forceU); - if (current === -1 || current !== ch) { - return false - } - pos = this.nextIndex(pos, forceU); - } - this.pos = pos; - return true -}; - -/** - * Validate the flags part of a given RegExpLiteral. - * - * @param {RegExpValidationState} state The state to validate RegExp. - * @returns {void} - */ -pp$1.validateRegExpFlags = function(state) { - var validFlags = state.validFlags; - var flags = state.flags; - - var u = false; - var v = false; - - for (var i = 0; i < flags.length; i++) { - var flag = flags.charAt(i); - if (validFlags.indexOf(flag) === -1) { - this.raise(state.start, "Invalid regular expression flag"); - } - if (flags.indexOf(flag, i + 1) > -1) { - this.raise(state.start, "Duplicate regular expression flag"); - } - if (flag === "u") { u = true; } - if (flag === "v") { v = true; } - } - if (this.options.ecmaVersion >= 15 && u && v) { - this.raise(state.start, "Invalid regular expression flag"); - } -}; - -function hasProp(obj) { - for (var _ in obj) { return true } - return false -} - -/** - * Validate the pattern part of a given RegExpLiteral. - * - * @param {RegExpValidationState} state The state to validate RegExp. - * @returns {void} - */ -pp$1.validateRegExpPattern = function(state) { - this.regexp_pattern(state); - - // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of - // parsing contains a |GroupName|, reparse with the goal symbol - // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* - // exception if _P_ did not conform to the grammar, if any elements of _P_ - // were not matched by the parse, or if any Early Error conditions exist. - if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) { - state.switchN = true; - this.regexp_pattern(state); - } -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern -pp$1.regexp_pattern = function(state) { - state.pos = 0; - state.lastIntValue = 0; - state.lastStringValue = ""; - state.lastAssertionIsQuantifiable = false; - state.numCapturingParens = 0; - state.maxBackReference = 0; - state.groupNames = Object.create(null); - state.backReferenceNames.length = 0; - state.branchID = null; - - this.regexp_disjunction(state); - - if (state.pos !== state.source.length) { - // Make the same messages as V8. - if (state.eat(0x29 /* ) */)) { - state.raise("Unmatched ')'"); - } - if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { - state.raise("Lone quantifier brackets"); - } - } - if (state.maxBackReference > state.numCapturingParens) { - state.raise("Invalid escape"); - } - for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { - var name = list[i]; - - if (!state.groupNames[name]) { - state.raise("Invalid named capture referenced"); - } - } -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction -pp$1.regexp_disjunction = function(state) { - var trackDisjunction = this.options.ecmaVersion >= 16; - if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); } - this.regexp_alternative(state); - while (state.eat(0x7C /* | */)) { - if (trackDisjunction) { state.branchID = state.branchID.sibling(); } - this.regexp_alternative(state); - } - if (trackDisjunction) { state.branchID = state.branchID.parent; } - - // Make the same message as V8. - if (this.regexp_eatQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } - if (state.eat(0x7B /* { */)) { - state.raise("Lone quantifier brackets"); - } -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative -pp$1.regexp_alternative = function(state) { - while (state.pos < state.source.length && this.regexp_eatTerm(state)) {} -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term -pp$1.regexp_eatTerm = function(state) { - if (this.regexp_eatAssertion(state)) { - // Handle `QuantifiableAssertion Quantifier` alternative. - // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion - // is a QuantifiableAssertion. - if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { - // Make the same message as V8. - if (state.switchU) { - state.raise("Invalid quantifier"); - } - } - return true - } - - if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { - this.regexp_eatQuantifier(state); - return true - } - - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion -pp$1.regexp_eatAssertion = function(state) { - var start = state.pos; - state.lastAssertionIsQuantifiable = false; - - // ^, $ - if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { - return true - } - - // \b \B - if (state.eat(0x5C /* \ */)) { - if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { - return true - } - state.pos = start; - } - - // Lookahead / Lookbehind - if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { - var lookbehind = false; - if (this.options.ecmaVersion >= 9) { - lookbehind = state.eat(0x3C /* < */); - } - if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { - this.regexp_disjunction(state); - if (!state.eat(0x29 /* ) */)) { - state.raise("Unterminated group"); - } - state.lastAssertionIsQuantifiable = !lookbehind; - return true - } - } - - state.pos = start; - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier -pp$1.regexp_eatQuantifier = function(state, noError) { - if ( noError === void 0 ) noError = false; - - if (this.regexp_eatQuantifierPrefix(state, noError)) { - state.eat(0x3F /* ? */); - return true - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix -pp$1.regexp_eatQuantifierPrefix = function(state, noError) { - return ( - state.eat(0x2A /* * */) || - state.eat(0x2B /* + */) || - state.eat(0x3F /* ? */) || - this.regexp_eatBracedQuantifier(state, noError) - ) -}; -pp$1.regexp_eatBracedQuantifier = function(state, noError) { - var start = state.pos; - if (state.eat(0x7B /* { */)) { - var min = 0, max = -1; - if (this.regexp_eatDecimalDigits(state)) { - min = state.lastIntValue; - if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { - max = state.lastIntValue; - } - if (state.eat(0x7D /* } */)) { - // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term - if (max !== -1 && max < min && !noError) { - state.raise("numbers out of order in {} quantifier"); - } - return true - } - } - if (state.switchU && !noError) { - state.raise("Incomplete quantifier"); - } - state.pos = start; - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom -pp$1.regexp_eatAtom = function(state) { - return ( - this.regexp_eatPatternCharacters(state) || - state.eat(0x2E /* . */) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) - ) -}; -pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { - var start = state.pos; - if (state.eat(0x5C /* \ */)) { - if (this.regexp_eatAtomEscape(state)) { - return true - } - state.pos = start; - } - return false -}; -pp$1.regexp_eatUncapturingGroup = function(state) { - var start = state.pos; - if (state.eat(0x28 /* ( */)) { - if (state.eat(0x3F /* ? */)) { - if (this.options.ecmaVersion >= 16) { - var addModifiers = this.regexp_eatModifiers(state); - var hasHyphen = state.eat(0x2D /* - */); - if (addModifiers || hasHyphen) { - for (var i = 0; i < addModifiers.length; i++) { - var modifier = addModifiers.charAt(i); - if (addModifiers.indexOf(modifier, i + 1) > -1) { - state.raise("Duplicate regular expression modifiers"); - } - } - if (hasHyphen) { - var removeModifiers = this.regexp_eatModifiers(state); - if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) { - state.raise("Invalid regular expression modifiers"); - } - for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) { - var modifier$1 = removeModifiers.charAt(i$1); - if ( - removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 || - addModifiers.indexOf(modifier$1) > -1 - ) { - state.raise("Duplicate regular expression modifiers"); - } - } - } - } - } - if (state.eat(0x3A /* : */)) { - this.regexp_disjunction(state); - if (state.eat(0x29 /* ) */)) { - return true - } - state.raise("Unterminated group"); - } - } - state.pos = start; - } - return false -}; -pp$1.regexp_eatCapturingGroup = function(state) { - if (state.eat(0x28 /* ( */)) { - if (this.options.ecmaVersion >= 9) { - this.regexp_groupSpecifier(state); - } else if (state.current() === 0x3F /* ? */) { - state.raise("Invalid group"); - } - this.regexp_disjunction(state); - if (state.eat(0x29 /* ) */)) { - state.numCapturingParens += 1; - return true - } - state.raise("Unterminated group"); - } - return false -}; -// RegularExpressionModifiers :: -// [empty] -// RegularExpressionModifiers RegularExpressionModifier -pp$1.regexp_eatModifiers = function(state) { - var modifiers = ""; - var ch = 0; - while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) { - modifiers += codePointToString(ch); - state.advance(); - } - return modifiers -}; -// RegularExpressionModifier :: one of -// `i` `m` `s` -function isRegularExpressionModifier(ch) { - return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */ -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom -pp$1.regexp_eatExtendedAtom = function(state) { - return ( - state.eat(0x2E /* . */) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) || - this.regexp_eatInvalidBracedQuantifier(state) || - this.regexp_eatExtendedPatternCharacter(state) - ) -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier -pp$1.regexp_eatInvalidBracedQuantifier = function(state) { - if (this.regexp_eatBracedQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter -pp$1.regexp_eatSyntaxCharacter = function(state) { - var ch = state.current(); - if (isSyntaxCharacter(ch)) { - state.lastIntValue = ch; - state.advance(); - return true - } - return false -}; -function isSyntaxCharacter(ch) { - return ( - ch === 0x24 /* $ */ || - ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || - ch === 0x2E /* . */ || - ch === 0x3F /* ? */ || - ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || - ch >= 0x7B /* { */ && ch <= 0x7D /* } */ - ) -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter -// But eat eager. -pp$1.regexp_eatPatternCharacters = function(state) { - var start = state.pos; - var ch = 0; - while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { - state.advance(); - } - return state.pos !== start -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter -pp$1.regexp_eatExtendedPatternCharacter = function(state) { - var ch = state.current(); - if ( - ch !== -1 && - ch !== 0x24 /* $ */ && - !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && - ch !== 0x2E /* . */ && - ch !== 0x3F /* ? */ && - ch !== 0x5B /* [ */ && - ch !== 0x5E /* ^ */ && - ch !== 0x7C /* | */ - ) { - state.advance(); - return true - } - return false -}; - -// GroupSpecifier :: -// [empty] -// `?` GroupName -pp$1.regexp_groupSpecifier = function(state) { - if (state.eat(0x3F /* ? */)) { - if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); } - var trackDisjunction = this.options.ecmaVersion >= 16; - var known = state.groupNames[state.lastStringValue]; - if (known) { - if (trackDisjunction) { - for (var i = 0, list = known; i < list.length; i += 1) { - var altID = list[i]; - - if (!altID.separatedFrom(state.branchID)) - { state.raise("Duplicate capture group name"); } - } - } else { - state.raise("Duplicate capture group name"); - } - } - if (trackDisjunction) { - (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID); - } else { - state.groupNames[state.lastStringValue] = true; - } - } -}; - -// GroupName :: -// `<` RegExpIdentifierName `>` -// Note: this updates `state.lastStringValue` property with the eaten name. -pp$1.regexp_eatGroupName = function(state) { - state.lastStringValue = ""; - if (state.eat(0x3C /* < */)) { - if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { - return true - } - state.raise("Invalid capture group name"); - } - return false -}; - -// RegExpIdentifierName :: -// RegExpIdentifierStart -// RegExpIdentifierName RegExpIdentifierPart -// Note: this updates `state.lastStringValue` property with the eaten name. -pp$1.regexp_eatRegExpIdentifierName = function(state) { - state.lastStringValue = ""; - if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - } - return true - } - return false -}; - -// RegExpIdentifierStart :: -// UnicodeIDStart -// `$` -// `_` -// `\` RegExpUnicodeEscapeSequence[+U] -pp$1.regexp_eatRegExpIdentifierStart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - - if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierStart(ch)) { - state.lastIntValue = ch; - return true - } - - state.pos = start; - return false -}; -function isRegExpIdentifierStart(ch) { - return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ -} - -// RegExpIdentifierPart :: -// UnicodeIDContinue -// `$` -// `_` -// `\` RegExpUnicodeEscapeSequence[+U] -// -// -pp$1.regexp_eatRegExpIdentifierPart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - - if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierPart(ch)) { - state.lastIntValue = ch; - return true - } - - state.pos = start; - return false -}; -function isRegExpIdentifierPart(ch) { - return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape -pp$1.regexp_eatAtomEscape = function(state) { - if ( - this.regexp_eatBackReference(state) || - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) || - (state.switchN && this.regexp_eatKGroupName(state)) - ) { - return true - } - if (state.switchU) { - // Make the same message as V8. - if (state.current() === 0x63 /* c */) { - state.raise("Invalid unicode escape"); - } - state.raise("Invalid escape"); - } - return false -}; -pp$1.regexp_eatBackReference = function(state) { - var start = state.pos; - if (this.regexp_eatDecimalEscape(state)) { - var n = state.lastIntValue; - if (state.switchU) { - // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape - if (n > state.maxBackReference) { - state.maxBackReference = n; - } - return true - } - if (n <= state.numCapturingParens) { - return true - } - state.pos = start; - } - return false -}; -pp$1.regexp_eatKGroupName = function(state) { - if (state.eat(0x6B /* k */)) { - if (this.regexp_eatGroupName(state)) { - state.backReferenceNames.push(state.lastStringValue); - return true - } - state.raise("Invalid named reference"); - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape -pp$1.regexp_eatCharacterEscape = function(state) { - return ( - this.regexp_eatControlEscape(state) || - this.regexp_eatCControlLetter(state) || - this.regexp_eatZero(state) || - this.regexp_eatHexEscapeSequence(state) || - this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || - (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || - this.regexp_eatIdentityEscape(state) - ) -}; -pp$1.regexp_eatCControlLetter = function(state) { - var start = state.pos; - if (state.eat(0x63 /* c */)) { - if (this.regexp_eatControlLetter(state)) { - return true - } - state.pos = start; - } - return false -}; -pp$1.regexp_eatZero = function(state) { - if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { - state.lastIntValue = 0; - state.advance(); - return true - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape -pp$1.regexp_eatControlEscape = function(state) { - var ch = state.current(); - if (ch === 0x74 /* t */) { - state.lastIntValue = 0x09; /* \t */ - state.advance(); - return true - } - if (ch === 0x6E /* n */) { - state.lastIntValue = 0x0A; /* \n */ - state.advance(); - return true - } - if (ch === 0x76 /* v */) { - state.lastIntValue = 0x0B; /* \v */ - state.advance(); - return true - } - if (ch === 0x66 /* f */) { - state.lastIntValue = 0x0C; /* \f */ - state.advance(); - return true - } - if (ch === 0x72 /* r */) { - state.lastIntValue = 0x0D; /* \r */ - state.advance(); - return true - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter -pp$1.regexp_eatControlLetter = function(state) { - var ch = state.current(); - if (isControlLetter(ch)) { - state.lastIntValue = ch % 0x20; - state.advance(); - return true - } - return false -}; -function isControlLetter(ch) { - return ( - (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || - (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) - ) -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence -pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { - if ( forceU === void 0 ) forceU = false; - - var start = state.pos; - var switchU = forceU || state.switchU; - - if (state.eat(0x75 /* u */)) { - if (this.regexp_eatFixedHexDigits(state, 4)) { - var lead = state.lastIntValue; - if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { - var leadSurrogateEnd = state.pos; - if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { - var trail = state.lastIntValue; - if (trail >= 0xDC00 && trail <= 0xDFFF) { - state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; - return true - } - } - state.pos = leadSurrogateEnd; - state.lastIntValue = lead; - } - return true - } - if ( - switchU && - state.eat(0x7B /* { */) && - this.regexp_eatHexDigits(state) && - state.eat(0x7D /* } */) && - isValidUnicode(state.lastIntValue) - ) { - return true - } - if (switchU) { - state.raise("Invalid unicode escape"); - } - state.pos = start; - } - - return false -}; -function isValidUnicode(ch) { - return ch >= 0 && ch <= 0x10FFFF -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape -pp$1.regexp_eatIdentityEscape = function(state) { - if (state.switchU) { - if (this.regexp_eatSyntaxCharacter(state)) { - return true - } - if (state.eat(0x2F /* / */)) { - state.lastIntValue = 0x2F; /* / */ - return true - } - return false - } - - var ch = state.current(); - if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { - state.lastIntValue = ch; - state.advance(); - return true - } - - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape -pp$1.regexp_eatDecimalEscape = function(state) { - state.lastIntValue = 0; - var ch = state.current(); - if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { - do { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); - state.advance(); - } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) - return true - } - return false -}; - -// Return values used by character set parsing methods, needed to -// forbid negation of sets that can match strings. -var CharSetNone = 0; // Nothing parsed -var CharSetOk = 1; // Construct parsed, cannot contain strings -var CharSetString = 2; // Construct parsed, can contain strings - -// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape -pp$1.regexp_eatCharacterClassEscape = function(state) { - var ch = state.current(); - - if (isCharacterClassEscape(ch)) { - state.lastIntValue = -1; - state.advance(); - return CharSetOk - } - - var negate = false; - if ( - state.switchU && - this.options.ecmaVersion >= 9 && - ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */) - ) { - state.lastIntValue = -1; - state.advance(); - var result; - if ( - state.eat(0x7B /* { */) && - (result = this.regexp_eatUnicodePropertyValueExpression(state)) && - state.eat(0x7D /* } */) - ) { - if (negate && result === CharSetString) { state.raise("Invalid property name"); } - return result - } - state.raise("Invalid property name"); - } - - return CharSetNone -}; - -function isCharacterClassEscape(ch) { - return ( - ch === 0x64 /* d */ || - ch === 0x44 /* D */ || - ch === 0x73 /* s */ || - ch === 0x53 /* S */ || - ch === 0x77 /* w */ || - ch === 0x57 /* W */ - ) -} - -// UnicodePropertyValueExpression :: -// UnicodePropertyName `=` UnicodePropertyValue -// LoneUnicodePropertyNameOrValue -pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { - var start = state.pos; - - // UnicodePropertyName `=` UnicodePropertyValue - if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { - var name = state.lastStringValue; - if (this.regexp_eatUnicodePropertyValue(state)) { - var value = state.lastStringValue; - this.regexp_validateUnicodePropertyNameAndValue(state, name, value); - return CharSetOk - } - } - state.pos = start; - - // LoneUnicodePropertyNameOrValue - if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { - var nameOrValue = state.lastStringValue; - return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue) - } - return CharSetNone -}; - -pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!hasOwn(state.unicodeProperties.nonBinary, name)) - { state.raise("Invalid property name"); } - if (!state.unicodeProperties.nonBinary[name].test(value)) - { state.raise("Invalid property value"); } -}; - -pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { - if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk } - if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString } - state.raise("Invalid property name"); -}; - -// UnicodePropertyName :: -// UnicodePropertyNameCharacters -pp$1.regexp_eatUnicodePropertyName = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyNameCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== "" -}; - -function isUnicodePropertyNameCharacter(ch) { - return isControlLetter(ch) || ch === 0x5F /* _ */ -} - -// UnicodePropertyValue :: -// UnicodePropertyValueCharacters -pp$1.regexp_eatUnicodePropertyValue = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyValueCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== "" -}; -function isUnicodePropertyValueCharacter(ch) { - return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) -} - -// LoneUnicodePropertyNameOrValue :: -// UnicodePropertyValueCharacters -pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { - return this.regexp_eatUnicodePropertyValue(state) -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass -pp$1.regexp_eatCharacterClass = function(state) { - if (state.eat(0x5B /* [ */)) { - var negate = state.eat(0x5E /* ^ */); - var result = this.regexp_classContents(state); - if (!state.eat(0x5D /* ] */)) - { state.raise("Unterminated character class"); } - if (negate && result === CharSetString) - { state.raise("Negated character class may contain strings"); } - return true - } - return false -}; - -// https://tc39.es/ecma262/#prod-ClassContents -// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges -pp$1.regexp_classContents = function(state) { - if (state.current() === 0x5D /* ] */) { return CharSetOk } - if (state.switchV) { return this.regexp_classSetExpression(state) } - this.regexp_nonEmptyClassRanges(state); - return CharSetOk -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges -// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash -pp$1.regexp_nonEmptyClassRanges = function(state) { - while (this.regexp_eatClassAtom(state)) { - var left = state.lastIntValue; - if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { - var right = state.lastIntValue; - if (state.switchU && (left === -1 || right === -1)) { - state.raise("Invalid character class"); - } - if (left !== -1 && right !== -1 && left > right) { - state.raise("Range out of order in character class"); - } - } - } -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom -// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash -pp$1.regexp_eatClassAtom = function(state) { - var start = state.pos; - - if (state.eat(0x5C /* \ */)) { - if (this.regexp_eatClassEscape(state)) { - return true - } - if (state.switchU) { - // Make the same message as V8. - var ch$1 = state.current(); - if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { - state.raise("Invalid class escape"); - } - state.raise("Invalid escape"); - } - state.pos = start; - } - - var ch = state.current(); - if (ch !== 0x5D /* ] */) { - state.lastIntValue = ch; - state.advance(); - return true - } - - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape -pp$1.regexp_eatClassEscape = function(state) { - var start = state.pos; - - if (state.eat(0x62 /* b */)) { - state.lastIntValue = 0x08; /* */ - return true - } - - if (state.switchU && state.eat(0x2D /* - */)) { - state.lastIntValue = 0x2D; /* - */ - return true - } - - if (!state.switchU && state.eat(0x63 /* c */)) { - if (this.regexp_eatClassControlLetter(state)) { - return true - } - state.pos = start; - } - - return ( - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) - ) -}; - -// https://tc39.es/ecma262/#prod-ClassSetExpression -// https://tc39.es/ecma262/#prod-ClassUnion -// https://tc39.es/ecma262/#prod-ClassIntersection -// https://tc39.es/ecma262/#prod-ClassSubtraction -pp$1.regexp_classSetExpression = function(state) { - var result = CharSetOk, subResult; - if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) { - if (subResult === CharSetString) { result = CharSetString; } - // https://tc39.es/ecma262/#prod-ClassIntersection - var start = state.pos; - while (state.eatChars([0x26, 0x26] /* && */)) { - if ( - state.current() !== 0x26 /* & */ && - (subResult = this.regexp_eatClassSetOperand(state)) - ) { - if (subResult !== CharSetString) { result = CharSetOk; } - continue - } - state.raise("Invalid character in character class"); - } - if (start !== state.pos) { return result } - // https://tc39.es/ecma262/#prod-ClassSubtraction - while (state.eatChars([0x2D, 0x2D] /* -- */)) { - if (this.regexp_eatClassSetOperand(state)) { continue } - state.raise("Invalid character in character class"); - } - if (start !== state.pos) { return result } - } else { - state.raise("Invalid character in character class"); - } - // https://tc39.es/ecma262/#prod-ClassUnion - for (;;) { - if (this.regexp_eatClassSetRange(state)) { continue } - subResult = this.regexp_eatClassSetOperand(state); - if (!subResult) { return result } - if (subResult === CharSetString) { result = CharSetString; } - } -}; - -// https://tc39.es/ecma262/#prod-ClassSetRange -pp$1.regexp_eatClassSetRange = function(state) { - var start = state.pos; - if (this.regexp_eatClassSetCharacter(state)) { - var left = state.lastIntValue; - if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) { - var right = state.lastIntValue; - if (left !== -1 && right !== -1 && left > right) { - state.raise("Range out of order in character class"); - } - return true - } - state.pos = start; - } - return false -}; - -// https://tc39.es/ecma262/#prod-ClassSetOperand -pp$1.regexp_eatClassSetOperand = function(state) { - if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk } - return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state) -}; - -// https://tc39.es/ecma262/#prod-NestedClass -pp$1.regexp_eatNestedClass = function(state) { - var start = state.pos; - if (state.eat(0x5B /* [ */)) { - var negate = state.eat(0x5E /* ^ */); - var result = this.regexp_classContents(state); - if (state.eat(0x5D /* ] */)) { - if (negate && result === CharSetString) { - state.raise("Negated character class may contain strings"); - } - return result - } - state.pos = start; - } - if (state.eat(0x5C /* \ */)) { - var result$1 = this.regexp_eatCharacterClassEscape(state); - if (result$1) { - return result$1 - } - state.pos = start; - } - return null -}; - -// https://tc39.es/ecma262/#prod-ClassStringDisjunction -pp$1.regexp_eatClassStringDisjunction = function(state) { - var start = state.pos; - if (state.eatChars([0x5C, 0x71] /* \q */)) { - if (state.eat(0x7B /* { */)) { - var result = this.regexp_classStringDisjunctionContents(state); - if (state.eat(0x7D /* } */)) { - return result - } - } else { - // Make the same message as V8. - state.raise("Invalid escape"); - } - state.pos = start; - } - return null -}; - -// https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents -pp$1.regexp_classStringDisjunctionContents = function(state) { - var result = this.regexp_classString(state); - while (state.eat(0x7C /* | */)) { - if (this.regexp_classString(state) === CharSetString) { result = CharSetString; } - } - return result -}; - -// https://tc39.es/ecma262/#prod-ClassString -// https://tc39.es/ecma262/#prod-NonEmptyClassString -pp$1.regexp_classString = function(state) { - var count = 0; - while (this.regexp_eatClassSetCharacter(state)) { count++; } - return count === 1 ? CharSetOk : CharSetString -}; - -// https://tc39.es/ecma262/#prod-ClassSetCharacter -pp$1.regexp_eatClassSetCharacter = function(state) { - var start = state.pos; - if (state.eat(0x5C /* \ */)) { - if ( - this.regexp_eatCharacterEscape(state) || - this.regexp_eatClassSetReservedPunctuator(state) - ) { - return true - } - if (state.eat(0x62 /* b */)) { - state.lastIntValue = 0x08; /* */ - return true - } - state.pos = start; - return false - } - var ch = state.current(); - if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false } - if (isClassSetSyntaxCharacter(ch)) { return false } - state.advance(); - state.lastIntValue = ch; - return true -}; - -// https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator -function isClassSetReservedDoublePunctuatorCharacter(ch) { - return ( - ch === 0x21 /* ! */ || - ch >= 0x23 /* # */ && ch <= 0x26 /* & */ || - ch >= 0x2A /* * */ && ch <= 0x2C /* , */ || - ch === 0x2E /* . */ || - ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ || - ch === 0x5E /* ^ */ || - ch === 0x60 /* ` */ || - ch === 0x7E /* ~ */ - ) -} - -// https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter -function isClassSetSyntaxCharacter(ch) { - return ( - ch === 0x28 /* ( */ || - ch === 0x29 /* ) */ || - ch === 0x2D /* - */ || - ch === 0x2F /* / */ || - ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ || - ch >= 0x7B /* { */ && ch <= 0x7D /* } */ - ) -} - -// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator -pp$1.regexp_eatClassSetReservedPunctuator = function(state) { - var ch = state.current(); - if (isClassSetReservedPunctuator(ch)) { - state.lastIntValue = ch; - state.advance(); - return true - } - return false -}; - -// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator -function isClassSetReservedPunctuator(ch) { - return ( - ch === 0x21 /* ! */ || - ch === 0x23 /* # */ || - ch === 0x25 /* % */ || - ch === 0x26 /* & */ || - ch === 0x2C /* , */ || - ch === 0x2D /* - */ || - ch >= 0x3A /* : */ && ch <= 0x3E /* > */ || - ch === 0x40 /* @ */ || - ch === 0x60 /* ` */ || - ch === 0x7E /* ~ */ - ) -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter -pp$1.regexp_eatClassControlLetter = function(state) { - var ch = state.current(); - if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { - state.lastIntValue = ch % 0x20; - state.advance(); - return true - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence -pp$1.regexp_eatHexEscapeSequence = function(state) { - var start = state.pos; - if (state.eat(0x78 /* x */)) { - if (this.regexp_eatFixedHexDigits(state, 2)) { - return true - } - if (state.switchU) { - state.raise("Invalid escape"); - } - state.pos = start; - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits -pp$1.regexp_eatDecimalDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isDecimalDigit(ch = state.current())) { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); - state.advance(); - } - return state.pos !== start -}; -function isDecimalDigit(ch) { - return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits -pp$1.regexp_eatHexDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isHexDigit(ch = state.current())) { - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return state.pos !== start -}; -function isHexDigit(ch) { - return ( - (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || - (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || - (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) - ) -} -function hexToInt(ch) { - if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { - return 10 + (ch - 0x41 /* A */) - } - if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { - return 10 + (ch - 0x61 /* a */) - } - return ch - 0x30 /* 0 */ -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence -// Allows only 0-377(octal) i.e. 0-255(decimal). -pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { - if (this.regexp_eatOctalDigit(state)) { - var n1 = state.lastIntValue; - if (this.regexp_eatOctalDigit(state)) { - var n2 = state.lastIntValue; - if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { - state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; - } else { - state.lastIntValue = n1 * 8 + n2; - } - } else { - state.lastIntValue = n1; - } - return true - } - return false -}; - -// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit -pp$1.regexp_eatOctalDigit = function(state) { - var ch = state.current(); - if (isOctalDigit(ch)) { - state.lastIntValue = ch - 0x30; /* 0 */ - state.advance(); - return true - } - state.lastIntValue = 0; - return false -}; -function isOctalDigit(ch) { - return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ -} - -// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits -// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit -// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence -pp$1.regexp_eatFixedHexDigits = function(state, length) { - var start = state.pos; - state.lastIntValue = 0; - for (var i = 0; i < length; ++i) { - var ch = state.current(); - if (!isHexDigit(ch)) { - state.pos = start; - return false - } - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return true -}; - -// Object type used to represent tokens. Note that normally, tokens -// simply exist as properties on the parser object. This is only -// used for the onToken callback and the external tokenizer. - -var Token = function Token(p) { - this.type = p.type; - this.value = p.value; - this.start = p.start; - this.end = p.end; - if (p.options.locations) - { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } - if (p.options.ranges) - { this.range = [p.start, p.end]; } -}; - -// ## Tokenizer - -var pp = Parser.prototype; - -// Move to the next token - -pp.next = function(ignoreEscapeSequenceInKeyword) { - if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) - { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } - if (this.options.onToken) - { this.options.onToken(new Token(this)); } - - this.lastTokEnd = this.end; - this.lastTokStart = this.start; - this.lastTokEndLoc = this.endLoc; - this.lastTokStartLoc = this.startLoc; - this.nextToken(); -}; - -pp.getToken = function() { - this.next(); - return new Token(this) -}; - -// If we're in an ES6 environment, make parsers iterable -if (typeof Symbol !== "undefined") - { pp[Symbol.iterator] = function() { - var this$1$1 = this; - - return { - next: function () { - var token = this$1$1.getToken(); - return { - done: token.type === types$1.eof, - value: token - } - } - } - }; } - -// Toggle strict mode. Re-reads the next number or string to please -// pedantic tests (`"use strict"; 010;` should fail). - -// Read a single token, updating the parser object's token-related -// properties. - -pp.nextToken = function() { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } - - this.start = this.pos; - if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } - - if (curContext.override) { return curContext.override(this) } - else { this.readToken(this.fullCharCodeAtPos()); } -}; - -pp.readToken = function(code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) - { return this.readWord() } - - return this.getTokenFromCode(code) -}; - -pp.fullCharCodeAtPos = function() { - var code = this.input.charCodeAt(this.pos); - if (code <= 0xd7ff || code >= 0xdc00) { return code } - var next = this.input.charCodeAt(this.pos + 1); - return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 -}; - -pp.skipBlockComment = function() { - var startLoc = this.options.onComment && this.curPosition(); - var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); - if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } - this.pos = end + 2; - if (this.options.locations) { - for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { - ++this.curLine; - pos = this.lineStart = nextBreak; - } - } - if (this.options.onComment) - { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, - startLoc, this.curPosition()); } -}; - -pp.skipLineComment = function(startSkip) { - var start = this.pos; - var startLoc = this.options.onComment && this.curPosition(); - var ch = this.input.charCodeAt(this.pos += startSkip); - while (this.pos < this.input.length && !isNewLine(ch)) { - ch = this.input.charCodeAt(++this.pos); - } - if (this.options.onComment) - { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, - startLoc, this.curPosition()); } -}; - -// Called at the start of the parse and after every token. Skips -// whitespace and comments, and. - -pp.skipSpace = function() { - loop: while (this.pos < this.input.length) { - var ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 32: case 160: // ' ' - ++this.pos; - break - case 13: - if (this.input.charCodeAt(this.pos + 1) === 10) { - ++this.pos; - } - case 10: case 8232: case 8233: - ++this.pos; - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - break - case 47: // '/' - switch (this.input.charCodeAt(this.pos + 1)) { - case 42: // '*' - this.skipBlockComment(); - break - case 47: - this.skipLineComment(2); - break - default: - break loop - } - break - default: - if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this.pos; - } else { - break loop - } - } - } -}; - -// Called at the end of every token. Sets `end`, `val`, and -// maintains `context` and `exprAllowed`, and skips the space after -// the token, so that the next one's `start` will point at the -// right position. - -pp.finishToken = function(type, val) { - this.end = this.pos; - if (this.options.locations) { this.endLoc = this.curPosition(); } - var prevType = this.type; - this.type = type; - this.value = val; - - this.updateContext(prevType); -}; - -// ### Token reading - -// This is the function that is called to fetch the next token. It -// is somewhat obscure, because it works in character codes rather -// than characters, and because operator parsing has been inlined -// into it. -// -// All in the name of speed. -// -pp.readToken_dot = function() { - var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) { return this.readNumber(true) } - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' - this.pos += 3; - return this.finishToken(types$1.ellipsis) - } else { - ++this.pos; - return this.finishToken(types$1.dot) - } -}; - -pp.readToken_slash = function() { // '/' - var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { ++this.pos; return this.readRegexp() } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.slash, 1) -}; - -pp.readToken_mult_modulo_exp = function(code) { // '%*' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - var tokentype = code === 42 ? types$1.star : types$1.modulo; - - // exponentiation operator ** and **= - if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { - ++size; - tokentype = types$1.starstar; - next = this.input.charCodeAt(this.pos + 2); - } - - if (next === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(tokentype, size) -}; - -pp.readToken_pipe_amp = function(code) { // '|&' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (this.options.ecmaVersion >= 12) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { return this.finishOp(types$1.assign, 3) } - } - return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) - } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) -}; - -pp.readToken_caret = function() { // '^' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.bitwiseXOR, 1) -}; - -pp.readToken_plus_min = function(code) { // '+-' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && - (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { - // A `-->` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types$1.incDec, 2) - } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.plusMin, 1) -}; - -pp.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(types$1.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // ` a || b(); - // This could change the return result of the expression so we only do it - // on things where the result is ignored. - LogicalExpression: { - enter: [function (path) { - const node = path.node; - const left = path.get("left"); - const right = path.get("right"); // issues - 171, 174, 176 - // we assume that it is returned/assigned/part of a bigger expression - // or utilized somehow - // we check if we shouldBail only when evaluating - // the rightside of the expression; - // if the left side is evaluated to be deterministic, - // we can safely replace the entire expression - - const shouldBail = !path.parentPath.isExpressionStatement(); - - if (node.operator === "&&") { - const leftTruthy = evaluateTruthy(left); - - if (leftTruthy === false) { - // Short-circuit - path.replaceWith(node.left); - } else if (leftTruthy === true && left.isPure()) { - path.replaceWith(node.right); - } else if (evaluateTruthy(right) === false && right.isPure() && !shouldBail) { - path.replaceWith(node.left); - } - } else if (node.operator === "||") { - const leftTruthy = evaluateTruthy(left); - - if (leftTruthy === false && left.isPure()) { - path.replaceWith(node.right); - } else if (leftTruthy === true) { - // Short-circuit - path.replaceWith(node.left); - } else if (evaluateTruthy(right) === false && right.isPure() && !shouldBail) { - path.replaceWith(node.left); - } - } - }, function (path) { - const node = path.node; - - if (flipExpressions.hasSeen(node)) { - return; - } - - if (!path.parentPath.isExpressionStatement() && !(path.parentPath.isSequenceExpression() && path.parentPath.parentPath.isExpressionStatement())) { - return; - } // Start counting savings from one since we can ignore the last - // expression. - - - if (flipExpressions.shouldFlip(node, 1)) { - const newNode = flipExpressions.flip(node, true); - path.replaceWith(newNode); - } - }] - } - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-infinity/lib/index.js": -/*!****************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-infinity/lib/index.js ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function ({ - types: t -}) { - const INFINITY = t.binaryExpression("/", t.numericLiteral(1), t.numericLiteral(0)); - return { - name: "minify-infinity", - visitor: { - // Infinity -> 1 / 0 - Identifier(path) { - if (path.node.name !== "Infinity") { - return; - } // It's a referenced identifier - - - if (path.scope.getBinding("Infinity")) { - return; - } - - if (path.parentPath.isObjectProperty({ - key: path.node - })) { - return; - } - - if (path.parentPath.isMemberExpression()) { - return; - } - - const bindingIds = path.parentPath.getBindingIdentifierPaths(); - - if (bindingIds["Infinity"] === path && // ObjectProperty is common for ObjectExpression and ObjectPattern and only - // one of them is a Binding, the other is simply a reference - !path.parentPath.parentPath.isObjectExpression()) { - return; - } - - path.replaceWith(INFINITY); - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js": -/*!***************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js ***! - \***************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - -module.exports = function bfsTraverseCreator({ - types: t, - traverse -}) { - function getFields(path) { - return t.VISITOR_KEYS[path.type]; - } - - return function bfsTraverse(path, _visitor) { - if (!path.node) { - throw new Error("Not a valid path"); - } - - const visitor = traverse.explode(_visitor); - const queue = [path]; - let current; - - while (queue.length > 0) { - current = queue.shift(); // call - - if (visitor && visitor[current.type] && Array.isArray(visitor[current.type].enter)) { - const fns = visitor[current.type].enter; - - var _iterator = _createForOfIteratorHelper(fns), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - const fn = _step.value; - if (typeof fn === "function") fn(current); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - - const fields = getFields(current); - - var _iterator2 = _createForOfIteratorHelper(fields), - _step2; - - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - const field = _step2.value; - const child = current.get(field); - - if (Array.isArray(child)) { - // visit container left to right - var _iterator3 = _createForOfIteratorHelper(child), - _step3; - - try { - for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { - const c = _step3.value; - if (c.node) queue.push(c); - } - } catch (err) { - _iterator3.e(err); - } finally { - _iterator3.f(); - } - } else { - if (child.node) queue.push(child); - } - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-mangle-names/lib/charset.js": -/*!**********************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-mangle-names/lib/charset.js ***! - \**********************************************************************/ -/***/ ((module) => { - -"use strict"; - - -const CHARSET = ("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ$_").split(""); -module.exports = class Charset { - constructor(shouldConsider) { - this.shouldConsider = shouldConsider; - this.chars = CHARSET.slice(); - this.frequency = {}; - this.chars.forEach(c => { - this.frequency[c] = 0; - }); - this.finalized = false; - } - - consider(str) { - if (!this.shouldConsider) { - return; - } - - str.split("").forEach(c => { - if (this.frequency[c] != null) { - this.frequency[c]++; - } - }); - } - - sort() { - if (this.shouldConsider) { - this.chars = this.chars.sort((a, b) => this.frequency[b] - this.frequency[a]); - } - - this.finalized = true; - } - - getIdentifier(num) { - if (!this.finalized) { - throw new Error("Should sort first"); - } - - let ret = ""; - num++; - - do { - num--; - ret += this.chars[num % this.chars.length]; - num = Math.floor(num / this.chars.length); - } while (num > 0); - - return ret; - } - -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-mangle-names/lib/counted-set.js": -/*!**************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-mangle-names/lib/counted-set.js ***! - \**************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -// Set that counts -module.exports = class CountedSet { - constructor() { - // because you can't simply extend Builtins yet - this.map = new Map(); - } - - keys() { - return [...this.map.keys()]; - } - - has(value) { - return this.map.has(value); - } - - add(value) { - if (!this.has(value)) { - this.map.set(value, 0); - } - - this.map.set(value, this.map.get(value) + 1); - } - - delete(value) { - if (!this.has(value)) return; - const count = this.map.get(value); - - if (count <= 1) { - this.map.delete(value); - } else { - this.map.set(value, count - 1); - } - } - -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-mangle-names/lib/fixup-var-scoping.js": -/*!********************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-mangle-names/lib/fixup-var-scoping.js ***! - \********************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -// this fixes a bug where converting let to var -// doesn't change the binding's scope to function scope -// https://github.com/babel/babel/issues/4818 -module.exports = function (mangler) { - mangler.program.traverse({ - VariableDeclaration(path) { - if (path.node.kind !== "var") { - return; - } - - const fnScope = path.scope.getFunctionParent() || path.scope.getProgramParent(); - const bindingIds = path.getOuterBindingIdentifierPaths(); - - for (const name in bindingIds) { - const binding = path.scope.getBinding(name); // var isn't hoisted to fnScope - - if (binding.scope !== fnScope) { - const existingBinding = fnScope.bindings[name]; // make sure we are clear that the fnScope doesn't already have - // an existing binding - - if (!existingBinding) { - // move binding to the function scope - // update our scopeTracker first before - // we mutate the scope - mangler.scopeTracker.moveBinding(binding, fnScope); - fnScope.bindings[name] = binding; - binding.scope = fnScope; - delete binding.scope.bindings[name]; - } else { - // we need a new binding that's valid in both the scopes - // binding.scope and fnScope - const newName = fnScope.generateUid(binding.scope.generateUid(name)); // rename binding in the original scope - - mangler.rename(binding.scope, binding, name, newName); // move binding to fnScope as newName - // update our scopeTracker first before - // we mutate the scope - - mangler.scopeTracker.moveBinding(binding, fnScope); - fnScope.bindings[newName] = binding; - binding.scope = fnScope; - delete binding.scope.bindings[newName]; - } - } - } - } - - }); -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-mangle-names/lib/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-mangle-names/lib/index.js ***! - \********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - -const Charset = __webpack_require__(/*! ./charset */ "./node_modules/babel-plugin-minify-mangle-names/lib/charset.js"); - -const ScopeTracker = __webpack_require__(/*! ./scope-tracker */ "./node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js"); - -const isLabelIdentifier = __webpack_require__(/*! ./is-label-identifier */ "./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js"); - -const bfsTraverseCreator = __webpack_require__(/*! ./bfs-traverse */ "./node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js"); - -const fixupVarScoping = __webpack_require__(/*! ./fixup-var-scoping */ "./node_modules/babel-plugin-minify-mangle-names/lib/fixup-var-scoping.js"); - -const _require = __webpack_require__(/*! babel-helper-mark-eval-scopes */ "./node_modules/babel-helper-mark-eval-scopes/lib/index.js"), - markEvalScopes = _require.markEvalScopes, - isEvalScopesMarked = _require.isMarked, - hasEval = _require.hasEval; - -const newIssueUrl = "https://github.com/babel/minify/issues/new"; - -module.exports = babel => { - const t = babel.types, - traverse = babel.traverse; - const bfsTraverse = bfsTraverseCreator(babel); - const hop = Object.prototype.hasOwnProperty; - - class Mangler { - constructor(charset, program, { - exclude = {}, - keepFnName = false, - keepClassName = false, - eval: _eval = false, - topLevel = false - } = {}) { - this.charset = charset; - this.program = program; // user passed options - - this.exclude = toObject(exclude); - this.keepFnName = keepFnName; - this.keepClassName = keepClassName; - this.topLevel = topLevel; - this.eval = _eval; // tracking - - this.visitedScopes = new Set(); - this.scopeTracker = new ScopeTracker(); - this.renamedNodes = new Set(); - } - /** - * Run the mangler - */ - - - run() { - this.crawlScope(); - this.collect(); - this.fixup(); - this.charset.sort(); - this.mangle(); - } - /** - * Tells if a variable name is excluded - * @param {String} name - */ - - - isExcluded(name) { - return hop.call(this.exclude, name) && this.exclude[name]; - } - /** - * Clears traverse cache and recrawls the AST - * - * to recompute the bindings, references, other scope information - * and paths because the other transformations in the same pipeline - * (other plugins and presets) changes the AST and does NOT update - * the scope objects - */ - - - crawlScope() { - (traverse.clearCache || traverse.cache.clear)(); - this.program.scope.crawl(); - } - /** - * Re-crawling comes with a side-effect that let->var conversion - * reverts the update of the binding information (block to fn scope). - * This function takes care of it by updating it again. - * - * TODO: This is unnecessary work and needs to be fixed in babel. - * https://github.com/babel/babel/issues/4818 - * - * When this is removed, remember to remove fixup's dependency in - * ScopeTracker - */ - - - fixup() { - fixupVarScoping(this); - } - /** - * A single pass through the AST to collect info for - * - * 1. Scope Tracker - * 2. Unsafe Scopes (direct eval scopes) - * 3. Charset considerations for better gzip compression - * - * Traversed in the same fashion(BFS) the mangling is done - */ - - - collect() { - const mangler = this; - const scopeTracker = mangler.scopeTracker; - scopeTracker.addScope(this.program.scope); - /** - * Same usage as in DCE, whichever runs first - */ - - if (!isEvalScopesMarked(mangler.program)) { - markEvalScopes(mangler.program); - } - /** - * The visitors to be used in traversal. - * - * Note: BFS traversal supports only the `enter` handlers, `exit` - * handlers are simply dropped without Errors - * - * Collects items defined in the ScopeTracker - */ - - - const collectVisitor = { - Scopable({ - scope - }) { - scopeTracker.addScope(scope); // Collect bindings defined in the scope - - Object.keys(scope.bindings).forEach(name => { - scopeTracker.addBinding(scope.bindings[name]); // add all constant violations as references - - scope.bindings[name].constantViolations.forEach(() => { - scopeTracker.addReference(scope, scope.bindings[name], name); - }); - }); - }, - - /** - * This is required because after function name transformation - * plugin (part of es2015), the function name is NOT added to the - * scope's bindings. So to fix this issue, we simply add a hack to - * handle that case - fix it to the scope tree. - * - * Related: - * - https://github.com/babel/minify/issues/829 - */ - BindingIdentifier(path) { - if ( // the parent has this id as the name - (path.parentPath.isFunctionExpression({ - id: path.node - }) || path.parentPath.isClassExpression({ - id: path.node - })) && // and the id isn't yet added to the scope - !hop.call(path.parentPath.scope.bindings, path.node.name)) { - path.parentPath.scope.registerBinding("local", path.parentPath); - } - }, - - /** - * This is necessary because, in Babel, the scope.references - * does NOT contain the references in that scope. Only the program - * scope (top most level) contains all the references. - * - * We collect the references in a fashion where all the scopes between - * and including the referenced scope and scope where it is declared - * is considered as scope referencing that identifier - */ - ReferencedIdentifier(path) { - if (isLabelIdentifier(path)) { - return; - } - - const scope = path.scope, - name = path.node.name; - const binding = scope.getBinding(name); - - if (!binding) { - // Do not collect globals as they are already available via - // babel's API - if (scope.hasGlobal(name)) { - return; - } // This should NOT happen ultimately. Panic if this code block is - // reached - - - throw new Error(`Binding not found for ReferencedIdentifier "${name}" ` + `present in "${path.parentPath.type}". ` + `Please report this at ${newIssueUrl}`); - } else { - // Add it to our scope tracker if everything is fine - scopeTracker.addReference(scope, binding, name); - } - } - - }; - /** - * These visitors are for collecting the Characters used in the program - * to measure the frequency and generate variable names for mangling so - * as to improve the gzip compression - as gzip likes repetition - */ - - if (this.charset.shouldConsider) { - collectVisitor.Identifier = function Identifer(path) { - const node = path.node; // We don't mangle properties, so we collect them as they contribute - // to the frequency of characters - - if (path.parentPath.isMemberExpression({ - property: node - }) || path.parentPath.isObjectProperty({ - key: node - })) { - mangler.charset.consider(node.name); - } - }; - - collectVisitor.Literal = function Literal({ - node - }) { - mangler.charset.consider(String(node.value)); - }; - } // Traverse the AST - - - bfsTraverse(mangler.program, collectVisitor); - } - /** - * Tells if a binding is exported as a NamedExport - so as to NOT mangle - * - * Babel treats NamedExports as a binding referenced by this NamedExport decl - * @param {Binding} binding - */ - - - isExportedWithName(binding) { - // short circuit - if (!this.topLevel) { - return false; - } - - const refs = binding.referencePaths; - - var _iterator = _createForOfIteratorHelper(refs), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - const ref = _step.value; - - if (ref.isExportNamedDeclaration()) { - return true; - } - } // default - - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - - return false; - } - /** - * Tells if the name can be mangled in the current observed scope with - * the input binding - * - * @param {string} oldName the old name that needs to be mangled - * @param {Binding} binding Binding of the name - * @param {Scope} scope The current scope the mangler is run - */ - - - canMangle(oldName, binding, scope) { - const cannotMangle = // arguments - for non-strict mode - oldName === "arguments" || // labels - binding.path.isLabeledStatement() || // ClassDeclaration has binding in two scopes - // 1. The scope in which it is declared - // 2. The class's own scope - binding.path.isClassDeclaration() && binding.path === scope.path || // excluded - this.isExcluded(oldName) || ( // function names - this.keepFnName ? isFunction(binding.path) : false) || ( // class names - this.keepClassName ? isClass(binding.path) : false) || // named export - this.isExportedWithName(binding); - return !cannotMangle; - } - /** - * Tells if the newName can be used as a valid name for the input binding - * in the input scope - * - * @param {string} newName the old name that needs to be mangled - * @param {Binding} binding Binding of the name that this new name will replace - * @param {Scope} scope The current scope the mangler is run - */ - - - isValidName(newName, binding, scope) { - return t.isValidIdentifier(newName) && !this.scopeTracker.hasBinding(scope, newName) && !scope.hasGlobal(newName) && !this.scopeTracker.hasReference(scope, newName) && this.scopeTracker.canUseInReferencedScopes(binding, newName); - } - /** - * Mangle the scope - * @param {Scope} scope - */ - - - mangleScope(scope) { - const mangler = this; - const scopeTracker = mangler.scopeTracker; // Unsafe Scope - - if (!mangler.eval && hasEval(scope)) { - return; - } // Already visited - // This is because for a function, in Babel, the function and - // the function body's BlockStatement has the same scope, and will - // be visited twice by the Scopable handler, and we want to mangle - // it only once - - - if (mangler.visitedScopes.has(scope)) { - return; - } - - mangler.visitedScopes.add(scope); - const bindings = scopeTracker.bindings.get(scope); - const names = [...bindings.keys()]; // A counter to generate names and reset - // so we can reuse removed names - - let counter = 0; - /** - * 1. Iterate through the list of BindingIdentifiers - * 2. Rename each of them in-place - * 3. Update the scope tree. - * - * We cannot use a for..of loop over bindings.keys() - * because (2) we rename in place and update the bindings - * as we traverse through the keys - */ - - for (var _i = 0, _names = names; _i < _names.length; _i++) { - const oldName = _names[_i]; - const binding = bindings.get(oldName); - - if (mangler.canMangle(oldName, binding, scope)) { - let next; - - do { - next = mangler.charset.getIdentifier(counter++); - } while (!mangler.isValidName(next, binding, scope)); // Reset so variables which are removed can be reused - // - // the following is an assumtion (for perf) - // the length 3 is an assumption that if the oldName isn't - // 1 or 2 characters, then probably we are not going to find - // a name - because for almost all usecases we have 1 or 2 - // character new names only. And for the edge cases where - // one scope has lots and lots of variables, it's okay to - // name something with 3 characters instead of 1 - - - if (oldName.length < 3) { - counter = 0; - } // Once we detected a valid `next` Identifier which could be used, - // call the renamer - - - mangler.rename(scope, binding, oldName, next); - } - } - } - /** - * The mangle function that traverses through all the Scopes in a BFS - * fashion - calls mangleScope - */ - - - mangle() { - const mangler = this; - bfsTraverse(this.program, { - Scopable(path) { - if (!path.isProgram() || mangler.topLevel) mangler.mangleScope(path.scope); - } - - }); - } - /** - * Given a NodePath, collects all the Identifiers which are BindingIdentifiers - * and replaces them with the new name - * - * For example, - * var a = 1, { b } = c; // a and b are BindingIdentifiers - * - * @param {NodePath} path - * @param {String} oldName - * @param {String} newName - * @param {Function} predicate - */ - - - renameBindingIds(path, oldName, newName, predicate = () => true) { - const bindingIds = path.getBindingIdentifierPaths(true, false); - - for (const name in bindingIds) { - if (name !== oldName) continue; - - var _iterator2 = _createForOfIteratorHelper(bindingIds[name]), - _step2; - - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - const idPath = _step2.value; - - if (predicate(idPath)) { - idPath.node.name = newName; // babel-7 don't requeue - // idPath.replaceWith(t.identifier(newName)); - - this.renamedNodes.add(idPath.node); - } - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - } - /** - * The Renamer: - * Renames the following for one Binding in a Scope - * - * 1. Binding in that Scope - * 2. All the Binding's constant violations - * 3. All its References - * 4. Updates mangler.scopeTracker - * 5. Updates Babel's Scope tracking - * - * @param {Scope} scope - * @param {Binding} binding - * @param {String} oldName - * @param {String} newName - */ - - - rename(scope, binding, oldName, newName) { - const mangler = this; - const scopeTracker = mangler.scopeTracker; // rename at the declaration level - - this.renameBindingIds(binding.path, oldName, newName, idPath => idPath.node === binding.identifier); // update mangler's ScopeTracker - - scopeTracker.renameBinding(scope, oldName, newName); // update all constant violations - - const violations = binding.constantViolations; - - for (let i = 0; i < violations.length; i++) { - if (violations[i].isLabeledStatement()) continue; - this.renameBindingIds(violations[i], oldName, newName); - scopeTracker.updateReference(violations[i].scope, binding, oldName, newName); - } // update all referenced places - - - const refs = binding.referencePaths; - - for (let i = 0; i < refs.length; i++) { - const path = refs[i]; - const node = path.node; - - if (!path.isIdentifier()) { - // Ideally, this should not happen - // it happens in these places now - - // case 1: Export Statements - // This is a bug in babel - // https://github.com/babel/babel/pull/3629 - // case 2: Replacements in other plugins - // eg: https://github.com/babel/minify/issues/122 - // replacement in dce from `x` to `!x` gives referencePath as `!x` - path.traverse({ - ReferencedIdentifier(refPath) { - if (refPath.node.name !== oldName) { - return; - } - - const actualBinding = refPath.scope.getBinding(oldName); - - if (actualBinding !== binding) { - return; - } - - refPath.node.name = newName; // babel-7 don't requeue - // refPath.replaceWith(t.identifier(newName)); - - mangler.renamedNodes.add(refPath.node); - scopeTracker.updateReference(refPath.scope, binding, oldName, newName); - } - - }); - } else if (!isLabelIdentifier(path)) { - if (path.node.name === oldName) { - path.node.name = newName; // babel-7 don't requeue - // path.replaceWith(t.identifier(newName)); - - mangler.renamedNodes.add(path.node); - scopeTracker.updateReference(path.scope, binding, oldName, newName); - } else if (mangler.renamedNodes.has(path.node)) { - // already renamed, - // just update the references - scopeTracker.updateReference(path.scope, binding, oldName, newName); - } else { - throw new Error(`Unexpected Rename Error: ` + `Trying to replace "${node.name}": from "${oldName}" to "${newName}". ` + `Please report it at ${newIssueUrl}`); - } - } // else label identifier - silently ignore - - } // update babel's internal tracking - - - binding.identifier.name = newName; // update babel's internal scope tracking - - const bindings = scope.bindings; - bindings[newName] = binding; - delete bindings[oldName]; - } - - } - - return { - name: "minify-mangle-names", - visitor: { - /** - * Mangler is run as a single pass. It's the same pattern as used in DCE - */ - Program: { - exit(path) { - // If the source code is small then we're going to assume that the user - // is running on this on single files before bundling. Therefore we - // need to achieve as much determinisim and we will not do any frequency - // sorting on the character set. Currently the number is pretty arbitrary. - const shouldConsiderSource = path.getSource().length > 70000; - const charset = new Charset(shouldConsiderSource); - const mangler = new Mangler(charset, path, this.opts); - mangler.run(); - } - - } - } - }; -}; // convert value to object - - -function toObject(value) { - if (!Array.isArray(value)) { - return value; - } - - const map = {}; - - for (let i = 0; i < value.length; i++) { - map[value[i]] = true; - } - - return map; -} // for keepFnName - - -function isFunction(path) { - return path.isFunctionExpression() || path.isFunctionDeclaration(); -} // for keepClassName - - -function isClass(path) { - return path.isClassExpression() || path.isClassDeclaration(); -} - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js ***! - \**********************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = isLabelIdentifier; - -function isLabelIdentifier(path) { - const node = path.node; - return path.parentPath.isLabeledStatement({ - label: node - }) || path.parentPath.isBreakStatement({ - label: node - }) || path.parentPath.isContinueStatement({ - label: node - }); -} - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js": -/*!****************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js ***! - \****************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const CountedSet = __webpack_require__(/*! ./counted-set */ "./node_modules/babel-plugin-minify-mangle-names/lib/counted-set.js"); - -const isLabelIdentifier = __webpack_require__(/*! ./is-label-identifier */ "./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js"); - -const newIssueUrl = "https://github.com/babel/minify/issues/new"; -/** - * ScopeTracker - * references: Map > - * bindings: Map > - */ - -module.exports = class ScopeTracker { - constructor() { - this.references = new Map(); - this.bindings = new Map(); - } - /** - * Register a new Scope and initiliaze it with empty sets - * @param {Scope} scope - */ - - - addScope(scope) { - if (!this.references.has(scope)) { - this.references.set(scope, new CountedSet()); - } - - if (!this.bindings.has(scope)) { - this.bindings.set(scope, new Map()); - } - } - /** - * Add reference to all Scopes between and including the ReferencedScope - * and Binding's Scope - * @param {Scope} scope - * @param {Binding} binding - * @param {String} name - */ - - - addReference(scope, binding, name) { - let parent = scope; - - do { - this.references.get(parent).add(name); - - if (!binding) { - throw new Error(`Binding Not Found for ${name} during scopeTracker.addRefernce. ` + `Please report at ${newIssueUrl}`); - } - - if (binding.scope === parent) break; - } while (parent = parent.parent); - } - /** - * has a Reference in the given {Scope} or a child Scope - * - * Refer {addReference} to know why the following call will be valid - * for detecting references in child Scopes - * - * @param {Scope} scope - * @param {String} name - */ - - - hasReference(scope, name) { - return this.references.get(scope).has(name); - } - /** - * Update reference count in all scopes between and including the - * Referenced Scope and the Binding's Scope - * - * @param {Scope} scope - * @param {Binding} binding - * @param {String} oldName - * @param {String} newName - */ - - - updateReference(scope, binding, oldName, newName) { - let parent = scope; - - do { - const ref = this.references.get(parent); - ref.delete(oldName); - ref.add(newName); - - if (!binding) { - // Something went wrong - panic - throw new Error("Binding Not Found during scopeTracker.updateRefernce " + `while updating "${oldName}" to "${newName}". ` + `Please report at ${newIssueUrl}`); - } - - if (binding.scope === parent) break; - } while (parent = parent.parent); - } - /** - * has either a Binding or a Reference - * @param {Scope} scope - * @param {Binding} binding - * @param {String} name - */ - - - hasBindingOrReference(scope, binding, name) { - return this.hasReference(scope, name) || this.hasBinding(scope, name); - } - /** - * For a Binding visit all places where the Binding is used and detect - * if the newName {next} can be used in all these places - * - * 1. binding's own scope - * 2. constant violations' scopes - * 3. referencePaths' scopes - * - * @param {Binding} binding - * @param {String} next - */ - - - canUseInReferencedScopes(binding, next) { - const tracker = this; - - if (tracker.hasBindingOrReference(binding.scope, binding, next)) { - return false; - } // Safari raises a syntax error for a `let` or `const` declaration in a - // `for` loop initialization that shadows a parent function's parameter. - // https://github.com/babel/minify/issues/559 - // https://bugs.webkit.org/show_bug.cgi?id=171041 - // https://trac.webkit.org/changeset/217200/webkit/trunk/Source - - - const maybeDecl = binding.path.parentPath; - const isBlockScoped = maybeDecl.isVariableDeclaration({ - kind: "let" - }) || maybeDecl.isVariableDeclaration({ - kind: "const" - }); - - if (isBlockScoped) { - const maybeFor = maybeDecl.parentPath; - const isForLoopBinding = maybeFor.isForStatement({ - init: maybeDecl.node - }) || maybeFor.isForXStatement({ - left: maybeDecl.node - }); - - if (isForLoopBinding) { - const fnParent = getFunctionParent(maybeFor); - - if (fnParent.isFunction({ - body: maybeFor.parent - })) { - const parentFunctionBinding = this.bindings.get(fnParent.scope).get(next); - - if (parentFunctionBinding) { - const parentFunctionHasParamBinding = parentFunctionBinding.kind === "param"; - - if (parentFunctionHasParamBinding) { - return false; - } - } - } - } - } - - for (let i = 0; i < binding.constantViolations.length; i++) { - const violation = binding.constantViolations[i]; - - if (tracker.hasBindingOrReference(violation.scope, binding, next)) { - return false; - } - } - - for (let i = 0; i < binding.referencePaths.length; i++) { - const ref = binding.referencePaths[i]; - - if (!ref.isIdentifier()) { - let canUse = true; - ref.traverse({ - ReferencedIdentifier(path) { - if (path.node.name !== next) return; - - if (tracker.hasBindingOrReference(path.scope, binding, next)) { - canUse = false; - } - } - - }); - - if (!canUse) { - return canUse; - } - } else if (!isLabelIdentifier(ref)) { - if (tracker.hasBindingOrReference(ref.scope, binding, next)) { - return false; - } - } - } - - return true; - } - /** - * Add a binding to Tracker in binding's own Scope - * @param {Binding} binding - */ - - - addBinding(binding) { - if (!binding) { - return; - } - - const bindings = this.bindings.get(binding.scope); - const existingBinding = bindings.get(binding.identifier.name); - - if (existingBinding && existingBinding !== binding) { - throw new Error(`scopeTracker.addBinding: ` + `Binding "${existingBinding.identifier.name}" already exists. ` + `Trying to add "${binding.identifier.name}" again.`); - } - - bindings.set(binding.identifier.name, binding); - } - /** - * Moves Binding from it's own Scope to {@param toScope} - * - * required for fixup-var-scope - * - * @param {Binding} binding - * @param {Scope} toScope - */ - - - moveBinding(binding, toScope) { - this.bindings.get(binding.scope).delete(binding.identifier.name); - this.bindings.get(toScope).set(binding.identifier.name, binding); - } - /** - * has a Binding in the current {Scope} - * @param {Scope} scope - * @param {String} name - */ - - - hasBinding(scope, name) { - return this.bindings.get(scope).has(name); - } - /** - * Update the ScopeTracker on rename - * @param {Scope} scope - * @param {String} oldName - * @param {String} newName - */ - - - renameBinding(scope, oldName, newName) { - const bindings = this.bindings.get(scope); - bindings.set(newName, bindings.get(oldName)); - bindings.delete(oldName); - } - -}; -/** - * Babel-7 returns null if there is no function parent - * and uses getProgramParent to get Program - */ - -function getFunctionParent(path) { - return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path; -} - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-numeric-literals/lib/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-numeric-literals/lib/index.js ***! - \************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function () { - return { - name: "minify-numeric-literals", - visitor: { - NumericLiteral(path) { - if (!path.node.extra) return; - const normal = path.node.value.toString().replace(/^0\./, "."); - let exponential = path.node.value.toExponential().replace(/\+/g, ""); - - if (exponential.indexOf(".") >= 0 && exponential.indexOf("e") >= 0) { - const lastChar = exponential.substr(exponential.lastIndexOf("e") + 1); - const dotIndex = exponential.lastIndexOf(".") + 1; - const subLength = exponential.substr(dotIndex, exponential.lastIndexOf("e") - dotIndex).length; - exponential = (exponential.substr(0, exponential.lastIndexOf("e") + 1) + (lastChar - subLength)).replace(".", "").replace(/e0/, ""); - } - - const replacement = normal.length > exponential.length ? exponential : normal; - - if (path.node.extra.raw.length > replacement.length) { - path.node.extra.raw = replacement; - } - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-replace/lib/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-replace/lib/index.js ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = ({ - types: t -}) => { - const NO_MEMBER = Symbol("no member"); - const replaceVisitor = { - ReferencedIdentifier(path) { - const _path = path, - node = _path.node; - const optionsMap = this.replacements[node.name]; - - if (!optionsMap) { - return; - } - - let options; - - if (path.parentPath.isMemberExpression({ - object: node - })) { - const property = path.parent.property; - const key = t.isIdentifier(property) && property.name; - - if (typeof key === "string") { - options = optionsMap[key]; - path = path.parentPath; - } - } - - if (!options) { - options = optionsMap[NO_MEMBER]; - } - - if (!options) { - return; - } - - path.replaceWith(options.node); - } - - }; - return { - name: "minify-replace", - visitor: { - Program(path) { - /** - Replacements is an array of objects like this: - { - identifierName: 'console', - member: 'log', // optional - replacement: { - type: 'identifier', - value: '', - }, - } - **/ - if (!this.opts.replacements) { - // No replacements. Bail. - return; - } - - const map = Object.create(null); - this.opts.replacements.forEach(({ - identifierName, - replacement, - member - }) => { - if (path.scope.globals[identifierName]) { - // Convert to a node, we only allow identifiers and literals as replacements - if (!replacement.type.match(/literal|identifier/i)) { - throw new Error("Only literals and identifier are supported as replacements"); - } - - const node = t[replacement.type](replacement.value); - const options = { - identifierName, - node, - member - }; - - if (!map[identifierName]) { - map[identifierName] = {}; - } - - if (member && map[identifierName][member]) { - throw new Error(`Replacement collision ${identifierName}.${member}`); - } - - map[identifierName][member || NO_MEMBER] = options; - } - }); - path.traverse(replaceVisitor, { - replacements: map - }); - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-simplify/lib/assignment-expression.js": -/*!********************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-simplify/lib/assignment-expression.js ***! - \********************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -const operators = new Set(["+", "-", "*", "%", "<<", ">>", ">>>", "&", "|", "^", "/", "**"]); -const updateOperators = new Set(["+", "-"]); - -module.exports = t => { - function simplify(path) { - const rightExpr = path.get("right"); - const leftExpr = path.get("left"); - - if (path.node.operator !== "=") { - return; - } - - const canBeUpdateExpression = rightExpr.get("right").isNumericLiteral() && rightExpr.get("right").node.value === 1 && updateOperators.has(rightExpr.node.operator); - - if (leftExpr.isMemberExpression()) { - const leftPropNames = getPropNames(leftExpr); - const rightPropNames = getPropNames(rightExpr.get("left")); - - if (!leftPropNames || leftPropNames.indexOf(undefined) > -1 || !rightPropNames || rightPropNames.indexOf(undefined) > -1 || !operators.has(rightExpr.node.operator) || !areArraysEqual(leftPropNames, rightPropNames)) { - return; - } - } else { - if (!rightExpr.isBinaryExpression() || !operators.has(rightExpr.node.operator) || leftExpr.node.name !== rightExpr.node.left.name) { - return; - } - } - - let newExpression; // special case x=x+1 --> ++x - - if (canBeUpdateExpression) { - newExpression = t.updateExpression(rightExpr.node.operator + rightExpr.node.operator, t.clone(leftExpr.node), true - /* prefix */ - ); - } else { - newExpression = t.assignmentExpression(rightExpr.node.operator + "=", t.clone(leftExpr.node), t.clone(rightExpr.node.right)); - } - - path.replaceWith(newExpression); - } - - return { - simplify - }; -}; - -function areArraysEqual(arr1, arr2) { - return arr1.every((value, index) => { - return String(value) === String(arr2[index]); - }); -} - -function getPropNames(path) { - if (!path.isMemberExpression()) { - return; - } - - let obj = path.get("object"); - const prop = path.get("property"); - const propNames = [getName(prop.node)]; - - while (obj.type === "MemberExpression") { - const node = obj.get("property").node; - - if (node) { - propNames.push(getName(node)); - } - - obj = obj.get("object"); - } - - propNames.push(getName(obj.node)); - return propNames; -} - -function getName(node) { - if (node.type === "ThisExpression") { - return "this"; - } - - if (node.type === "Super") { - return "super"; - } - - if (node.type === "NullLiteral") { - return "null"; - } // augment identifiers so that they don't match - // string/number literals - // but still match against each other - - - return node.name ? node.name + "_" : node.value - /* Literal */ - ; -} - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-simplify/lib/conditional-expression.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-simplify/lib/conditional-expression.js ***! - \*********************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const h = __webpack_require__(/*! ./helpers */ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js"); - -const PatternMatch = __webpack_require__(/*! ./pattern-match */ "./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js"); - -module.exports = t => { - // small abstractions - const not = node => t.unaryExpression("!", node); - - const notnot = node => not(not(node)); - - const or = (a, b) => t.logicalExpression("||", a, b); - - const and = (a, b) => t.logicalExpression("&&", a, b); - - function simplifyPatterns(path) { - const test = path.get("test"); - const consequent = path.get("consequent"); - const alternate = path.get("alternate"); - - const _h$typeSymbols = h.typeSymbols(t), - EX = _h$typeSymbols.Expression; // Convention: - // =============== - // for each pattern [test, consequent, alternate, handler(expr, cons, alt)] - - - const matcher = new PatternMatch([[EX, true, false, e => notnot(e)], [EX, false, true, e => not(e)], [EX, true, EX, (e, c, a) => or(notnot(e), a)], [EX, false, EX, (e, c, a) => and(not(e), a)], [EX, EX, true, (e, c) => or(not(e), c)], [EX, EX, false, (e, c) => and(notnot(e), c)]]); - const result = matcher.match([test, consequent, alternate], h.isPatternMatchesPath(t)); - - if (result.match) { - path.replaceWith(result.value(test.node, consequent.node, alternate.node)); - } - } - - return { - simplifyPatterns - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js": -/*!******************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-simplify/lib/helpers.js ***! - \******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const VOID_0 = t => t.unaryExpression("void", t.numericLiteral(0), true); - -const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); // Types as Symbols - for comparing types - - -const types = {}; // This is a test key which is used to avoid Object.keys check -// Object.keys() check is really expensive -// https://gist.github.com/vigneshshanmugam/c766550ecd02292dcdfbf0bf013b9d3d - -const testKey = "Expression"; - -const typeSymbols = t => { - // don't recompute - if (types[testKey] !== undefined) { - return types; - } - - t.TYPES.forEach(type => { - types[type] = Symbol.for(type); - }); - return types; -}; - -const isNodeOfType = (t, node, typeSymbol) => typeof typeSymbol !== "symbol" ? false : t["is" + Symbol.keyFor(typeSymbol)](node); - -const isPatternMatchesPath = t => function _isPatternMatchesPath(patternValue, inputPath) { - if (Array.isArray(patternValue)) { - for (let i = 0; i < patternValue.length; i++) { - if (_isPatternMatchesPath(patternValue[i], inputPath)) { - return true; - } - } - - return false; - } - - if (typeof patternValue === "function") { - return patternValue(inputPath); - } - - if (isNodeOfType(t, inputPath.node, patternValue)) return true; - const evalResult = evaluate(inputPath); - if (!evalResult.confident || !inputPath.isPure()) return false; - return evalResult.value === patternValue; -}; - -module.exports = { - VOID_0, - // Types as Symbols - typeSymbols, - // This is required for resolving type aliases - isNodeOfType, - isPatternMatchesPath -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-simplify/lib/if-statement.js": -/*!***********************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-simplify/lib/if-statement.js ***! - \***********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const REPLACED = Symbol("replaced"); - -const h = __webpack_require__(/*! ./helpers */ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js"); - -module.exports = t => { - function mergeNestedIfs(path) { - const consequent = path.get("consequent"); - const alternate = path.get("alternate"); // not nested if - - if (!consequent.isIfStatement()) return; // there are no alternate nodes in both the if statements (nested) - - if (alternate.node || consequent.get("alternate").node) return; - const test = path.get("test"); - test.replaceWith(t.logicalExpression("&&", test.node, consequent.get("test").node)); - consequent.replaceWith(t.clone(consequent.get("consequent").node)); - } // No alternate, make into a guarded expression - - - function toGuardedExpression(path) { - const node = path.node; - - if (node.consequent && !node.alternate && node.consequent.type === "ExpressionStatement") { - let op = "&&"; - - if (t.isUnaryExpression(node.test, { - operator: "!" - })) { - node.test = node.test.argument; - op = "||"; - } - - path.replaceWith(t.expressionStatement(t.logicalExpression(op, node.test, node.consequent.expression))); - return REPLACED; - } - } // both consequent and alternate are expressions, turn into ternary - - - function toTernary(path) { - const node = path.node; - - if (t.isExpressionStatement(node.consequent) && t.isExpressionStatement(node.alternate)) { - path.replaceWith(t.conditionalExpression(node.test, node.consequent.expression, node.alternate.expression)); - return REPLACED; - } - } // consequent and alternate are return -- conditional. - - - function toConditional(path) { - const node = path.node; - - if (t.isReturnStatement(node.consequent) && t.isReturnStatement(node.alternate)) { - if (!node.consequent.argument && !node.alternate.argument) { - path.replaceWith(t.expressionStatement(node.test)); - return REPLACED; - } - - path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), node.alternate.argument || h.VOID_0(t)))); - return REPLACED; - } - } // There is nothing after this If block. And one or both - // of the consequent and alternate are either expression statment - // or return statements. - - - function toReturn(path) { - const node = path.node; - - if (!path.getSibling(path.key + 1).node && path.parentPath && path.parentPath.parentPath && path.parentPath.parentPath.isFunction()) { - // Only the consequent is a return, void the alternate. - if (t.isReturnStatement(node.consequent) && t.isExpressionStatement(node.alternate)) { - if (!node.consequent.argument) { - path.replaceWith(t.expressionStatement(t.logicalExpression("||", node.test, node.alternate.expression))); - return REPLACED; - } - - path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), t.unaryExpression("void", node.alternate.expression, true)))); - return REPLACED; - } // Only the alternate is a return, void the consequent. - - - if (t.isReturnStatement(node.alternate) && t.isExpressionStatement(node.consequent)) { - if (!node.alternate.argument) { - path.replaceWith(t.expressionStatement(t.logicalExpression("&&", node.test, node.consequent.expression))); - return REPLACED; - } - - path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, t.unaryExpression("void", node.consequent.expression, true), node.alternate.argument || h.VOID_0(t)))); - return REPLACED; - } - - if (t.isReturnStatement(node.consequent) && !node.alternate) { - if (!node.consequent.argument) { - path.replaceWith(t.expressionStatement(node.test)); - return REPLACED; - } // This would only be worth it if the previous statement was an if - // because then we may merge to create a conditional. - - - if (path.getSibling(path.key - 1).isIfStatement()) { - path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), h.VOID_0(t)))); - return REPLACED; - } - } - - if (t.isReturnStatement(node.alternate) && !node.consequent) { - if (!node.alternate.argument) { - path.replaceWith(t.expressionStatement(node.test)); - return REPLACED; - } // Same as above. - - - if (path.getSibling(path.key - 1).isIfStatement()) { - path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.alternate.argument || h.VOID_0(t), h.VOID_0(t)))); - return REPLACED; - } - } - } - - let next = path.getSibling(path.key + 1); // If the next satatement(s) is an if statement and we can simplify that - // to potentailly be an expression (or a return) then this will make it - // easier merge. - - if (next.isIfStatement()) { - next.pushContext(path.context); - next.visit(); - next.popContext(); - next = path.getSibling(path.key + 1); - } // Some other visitor might have deleted our node. OUR NODE ;_; - - - if (!path.node) { - return; - } // No alternate but the next statement is a return - // also turn into a return conditional - - - if (t.isReturnStatement(node.consequent) && !node.alternate && next.isReturnStatement()) { - const nextArg = next.node.argument || h.VOID_0(t); - next.remove(); - path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), nextArg))); - return REPLACED; - } // Next is the last expression, turn into a return while void'ing the exprs - - - if (path.parentPath && path.parentPath.parentPath && path.parentPath.parentPath.isFunction() && !path.getSibling(path.key + 2).node && t.isReturnStatement(node.consequent) && !node.alternate && next.isExpressionStatement()) { - const nextExpr = next.node.expression; - next.remove(); - - if (node.consequent.argument) { - path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument, t.unaryExpression("void", nextExpr, true)))); - return REPLACED; - } - - path.replaceWith(t.logicalExpression("||", node.test, nextExpr)); - return REPLACED; - } - } // Remove else for if-return - - - function removeUnnecessaryElse(path) { - const node = path.node; - const consequent = path.get("consequent"); - const alternate = path.get("alternate"); - - if (consequent.node && alternate.node && (consequent.isReturnStatement() || consequent.isBlockStatement() && t.isReturnStatement(consequent.node.body[consequent.node.body.length - 1])) && ( // don't hoist declarations - // TODO: validate declarations after fixing scope issues - alternate.isBlockStatement() ? !alternate.get("body").some(stmt => stmt.isVariableDeclaration({ - kind: "let" - }) || stmt.isVariableDeclaration({ - kind: "const" - })) : true)) { - path.insertAfter(alternate.isBlockStatement() ? alternate.node.body.map(el => t.clone(el)) : t.clone(alternate.node)); - node.alternate = null; - return REPLACED; - } - } - - function runTransforms(path) { - // ordered - const transforms = [toGuardedExpression, toTernary, toConditional, toReturn, removeUnnecessaryElse]; // run each of the replacement till we replace something - // which is identified by the Symbol(REPLACED) that each of the - // functions return when they replace something - - for (var _i = 0; _i < transforms.length; _i++) { - const transform = transforms[_i]; - - if (transform(path) === REPLACED) { - break; - } - } - } // If the consequent is if and the altenrate is not then - // switch them out. That way we know we don't have to print - // a block.x - - - function switchConsequent(path) { - const node = path.node; - - if (!node.alternate) { - return; - } - - if (!t.isIfStatement(node.consequent)) { - return; - } - - if (t.isIfStatement(node.alternate)) { - return; - } - - node.test = t.unaryExpression("!", node.test, true); - var _ref = [node.consequent, node.alternate]; - node.alternate = _ref[0]; - node.consequent = _ref[1]; - } // Make if statements with conditional returns in the body into - // an if statement that guards the rest of the block. - - - function conditionalReturnToGuards(path) { - const node = path.node; - - if (!path.inList || !path.get("consequent").isBlockStatement() || node.alternate) { - return; - } - - let ret; - let test; - const exprs = []; - const statements = node.consequent.body; - - for (let i = 0, statement; statement = statements[i]; i++) { - if (t.isExpressionStatement(statement)) { - exprs.push(statement.expression); - } else if (t.isIfStatement(statement)) { - if (i < statements.length - 1) { - // This isn't the last statement. Bail. - return; - } - - if (statement.alternate) { - return; - } - - if (!t.isReturnStatement(statement.consequent)) { - return; - } - - ret = statement.consequent; - test = statement.test; - } else { - return; - } - } - - if (!test || !ret) { - return; - } - - exprs.push(test); - const expr = exprs.length === 1 ? exprs[0] : t.sequenceExpression(exprs); - const replacement = t.logicalExpression("&&", node.test, expr); - path.replaceWith(t.ifStatement(replacement, ret, null)); - } - - return { - mergeNestedIfs, - simplify: runTransforms, - switchConsequent, - conditionalReturnToGuards - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-simplify/lib/index.js": -/*!****************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-simplify/lib/index.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - -function _iterableToArrayLimit(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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -module.exports = ({ - types: t -}) => { - const flipExpressions = __webpack_require__(/*! babel-helper-flip-expressions */ "./node_modules/babel-helper-flip-expressions/lib/index.js")(t); - - const toMultipleSequenceExpressions = __webpack_require__(/*! babel-helper-to-multiple-sequence-expressions */ "./node_modules/babel-helper-to-multiple-sequence-expressions/lib/index.js")(t); - - const ifStatement = __webpack_require__(/*! ./if-statement */ "./node_modules/babel-plugin-minify-simplify/lib/if-statement.js")(t); - - const conditionalExpression = __webpack_require__(/*! ./conditional-expression */ "./node_modules/babel-plugin-minify-simplify/lib/conditional-expression.js")(t); - - const logicalExpression = __webpack_require__(/*! ./logical-expression */ "./node_modules/babel-plugin-minify-simplify/lib/logical-expression.js")(t); - - const assignmentExpression = __webpack_require__(/*! ./assignment-expression */ "./node_modules/babel-plugin-minify-simplify/lib/assignment-expression.js")(t); - - const VOID_0 = t.unaryExpression("void", t.numericLiteral(0), true); - const condExprSeen = Symbol("condExprSeen"); - const seqExprSeen = Symbol("seqExprSeen"); - const shouldRevisit = Symbol("shouldRevisit"); - return { - name: "minify-simplify", - visitor: { - Statement: { - exit(path) { - if (path.node[shouldRevisit]) { - delete path.node[shouldRevisit]; - path.visit(); - } - } - - }, - // CallExpression(path) { - // const { node } = path; - - /* (function() {})() -> !function() {}() - There is a bug in babel in printing this. Disabling for now. - if (t.isFunctionExpression(node.callee) && - (t.isExpressionStatement(parent) || - (t.isSequenceExpression(parent) && parent.expressions[0] === node)) - ) { - path.replaceWith( - t.callExpression( - t.unaryExpression("!", node.callee, true), - node.arguments - ) - ); - return; - }*/ - // }, - UnaryExpression: { - enter: [// Demorgans. - function (path) { - const node = path.node; - - if (node.operator !== "!" || flipExpressions.hasSeen(node)) { - return; - } - - const expr = node.argument; // We need to make sure that the return type will always be boolean. - - if (!(t.isLogicalExpression(expr) || t.isConditionalExpression(expr) || t.isBinaryExpression(expr))) { - return; - } - - if (t.isBinaryExpression(expr) && t.COMPARISON_BINARY_OPERATORS.indexOf(expr.operator) === -1) { - return; - } - - if (flipExpressions.shouldFlip(expr, 1)) { - const newNode = flipExpressions.flip(expr); - path.replaceWith(newNode); - } - }, // !(a, b, c) -> a, b, !c - function (path) { - const node = path.node; - - if (node.operator !== "!") { - return; - } - - if (!t.isSequenceExpression(node.argument)) { - return; - } - - const seq = node.argument.expressions; - const expr = seq[seq.length - 1]; - seq[seq.length - 1] = t.unaryExpression("!", expr, true); - path.replaceWith(node.argument); - }, // !(a ? b : c) -> a ? !b : !c - function (path) { - const node = path.node; - - if (node.operator !== "!") { - return; - } - - if (!t.isConditional(node.argument)) { - return; - } - - const cond = node.argument; - cond.alternate = t.unaryExpression("!", cond.alternate, true); - cond.consequent = t.unaryExpression("!", cond.consequent, true); - path.replaceWith(node.argument); - }] - }, - - BinaryExpression(path) { - if (["!=", "=="].indexOf(path.node.operator) !== -1) { - undefinedToNull(path.get("left")); - undefinedToNull(path.get("right")); - } - }, - - LogicalExpression: { - exit: logicalExpression.simplifyPatterns - }, - AssignmentExpression: assignmentExpression.simplify, - ConditionalExpression: { - enter: [// !foo ? 'foo' : 'bar' -> foo ? 'bar' : 'foo' - // foo !== 'lol' ? 'foo' : 'bar' -> foo === 'lol' ? 'bar' : 'foo' - function flipIfOrConditional(path) { - const node = path.node; - - if (!path.get("test").isLogicalExpression()) { - flipNegation(node); - return; - } - - if (flipExpressions.shouldFlip(node.test)) { - node.test = flipExpressions.flip(node.test); - var _ref = [node.consequent, node.alternate]; - node.alternate = _ref[0]; - node.consequent = _ref[1]; - } - }, conditionalExpression.simplifyPatterns], - exit: [// a ? x = foo : b ? x = bar : x = baz; - // x = a ? foo : b ? bar : baz; - function (topPath) { - if (!topPath.parentPath.isExpressionStatement() && !topPath.parentPath.isSequenceExpression()) { - return; - } - - const mutations = []; - let firstLeft = null; - let operator = null; - - function visit(path) { - if (path.isConditionalExpression()) { - let bail = visit(path.get("consequent")); - - if (bail) { - return true; - } - - bail = visit(path.get("alternate")); - return bail; - } - - if (operator == null) { - operator = path.node.operator; - } else if (path.node.operator !== operator) { - return true; - } - - if (!path.isAssignmentExpression() || !(path.get("left").isIdentifier() || path.get("left").isMemberExpression())) { - return true; - } - - const left = path.get("left").node; - - if (firstLeft == null) { - firstLeft = left; - } else if (!t.isNodesEquivalent(left, firstLeft)) { - return true; - } - - mutations.push(() => path.replaceWith(path.get("right").node)); - } - - const bail = visit(topPath); - - if (bail) { - return; - } - - mutations.forEach(f => f()); - topPath.replaceWith(t.assignmentExpression(operator, firstLeft, topPath.node)); - }, // bar ? void 0 : void 0 - // (bar, void 0) - // TODO: turn this into general equiv check - function (path) { - const node = path.node; - - if (isVoid0(node.consequent) && isVoid0(node.alternate)) { - path.replaceWith(t.sequenceExpression([path.node.test, VOID_0])); - } - }, // bar ? void 0 : foo ? void 0 : - // bar || foo : void 0 - // TODO: turn this into general equiv check - function (path) { - const node = path.node; - - if (node[condExprSeen] || !isVoid0(node.consequent)) { - return; - } - - node[condExprSeen] = true; - const tests = [node.test]; - const mutations = []; - let alt; - - for (let next = path.get("alternate"); next.isConditionalExpression(); next = next.get("alternate")) { - next.node[condExprSeen] = true; - alt = next.node.alternate; - - if (isVoid0(next.node.consequent)) { - tests.push(next.node.test); - mutations.push(() => next.remove()); - } else { - alt = next.node; - break; - } - } - - if (tests.length === 1) { - return; - } - - const test = tests.reduce((expr, curTest) => t.logicalExpression("||", expr, curTest)); - path.replaceWith(t.conditionalExpression(test, VOID_0, alt)); - }] - }, - // concat - VariableDeclaration: { - enter: [// Put vars with no init at the top. - function (path) { - const node = path.node; - - if (node.declarations.length < 2) { - return; - } - - const inits = []; - const empty = []; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = node.declarations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - const decl = _step.value; - - if (!decl.init) { - empty.push(decl); - } else { - inits.push(decl); - } - } // This is based on exprimintation but there is a significant - // imrpovement when we place empty vars at the top in smaller - // files. Whereas it hurts in larger files. - - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - if (this.fitsInSlidingWindow) { - node.declarations = empty.concat(inits); - } else { - node.declarations = inits.concat(empty); - } - }] - }, - Function: { - exit(path) { - earlyReturnTransform(path); - - if (!path.node[shouldRevisit]) { - return; - } - - delete path.node[shouldRevisit]; - path.visit(); - } - - }, - For: { - enter: earlyContinueTransform, - exit: earlyContinueTransform - }, - ForStatement: { - // Merge previous expressions in the init part of the for. - enter(path) { - const node = path.node; - - if (!path.inList || node.init && !t.isExpression(node.init)) { - return; - } - - const prev = path.getSibling(path.key - 1); - let consumed = false; - - if (prev.isVariableDeclaration()) { - let referencedOutsideLoop = false; // we don't care if vars are referenced outside the loop as they are fn scope - - if (prev.node.kind === "let" || prev.node.kind === "const") { - const ids = Object.keys(prev.getBindingIdentifiers()); - - idloop: for (let i = 0; i < ids.length; i++) { - const binding = prev.scope.bindings[ids[i]]; // TODO - // Temporary Fix - // if there is no binding, we assume it is referenced outside - // and deopt to avoid bugs - - if (!binding) { - referencedOutsideLoop = true; - break idloop; - } - - const refs = binding.referencePaths; - - for (let j = 0; j < refs.length; j++) { - if (!isAncestor(path, refs[j])) { - referencedOutsideLoop = true; - break idloop; - } - } - } - } - - if (!node.init && !referencedOutsideLoop) { - node.init = prev.node; - consumed = true; - } - } else if (prev.isExpressionStatement()) { - const expr = prev.node.expression; - - if (node.init) { - if (t.isSequenceExpression(expr)) { - expr.expressions.push(node.init); - node.init = expr; - } else { - node.init = t.sequenceExpression([expr, node.init]); - } - } else { - node.init = expr; - } - - consumed = true; - } - - if (consumed) { - prev.remove(); - } - }, - - exit(path) { - const node = path.node; - - if (!node.test) { - return; - } - - if (!path.get("body").isBlockStatement()) { - const bodyNode = path.get("body").node; - - if (!t.isIfStatement(bodyNode)) { - return; - } - - if (t.isBreakStatement(bodyNode.consequent, { - label: null - })) { - node.test = t.logicalExpression("&&", node.test, t.unaryExpression("!", bodyNode.test, true)); - node.body = bodyNode.alternate || t.emptyStatement(); - return; - } - - if (t.isBreakStatement(bodyNode.alternate, { - label: null - })) { - node.test = t.logicalExpression("&&", node.test, bodyNode.test); - node.body = bodyNode.consequent || t.emptyStatement(); - return; - } - - return; - } - - const statements = node.body.body; - const exprs = []; - let ifStatement = null; - let breakAt = null; - let i = 0; - - for (let statement; statement = statements[i]; i++) { - if (t.isIfStatement(statement)) { - if (t.isBreakStatement(statement.consequent, { - label: null - })) { - ifStatement = statement; - breakAt = "consequent"; - } else if (t.isBreakStatement(statement.alternate, { - label: null - })) { - ifStatement = statement; - breakAt = "alternate"; - } - - break; - } // A statement appears before the break statement then bail. - - - if (!t.isExpressionStatement(statement)) { - return; - } - - exprs.push(statement.expression); - } - - if (!ifStatement) { - return; - } - - const rest = []; - - if (breakAt === "consequent") { - if (t.isBlockStatement(ifStatement.alternate)) { - rest.push(...ifStatement.alternate.body); - } else if (ifStatement.alternate) { - rest.push(ifStatement.alternate); - } - } else { - if (t.isBlockStatement(ifStatement.consequent)) { - rest.push(...ifStatement.consequent.body); - } else if (ifStatement.consequent) { - rest.push(ifStatement.consequent); - } - } - - rest.push(...statements.slice(i + 1)); - const test = breakAt === "consequent" ? t.unaryExpression("!", ifStatement.test, true) : ifStatement.test; - let expr; - - if (exprs.length === 1) { - expr = t.sequenceExpression([exprs[0], test]); - } else if (exprs.length) { - exprs.push(test); - expr = t.sequenceExpression(exprs); - } else { - expr = test; - } - - node.test = t.logicalExpression("&&", node.test, expr); - - if (rest.length === 1) { - node.body = rest[0]; - } else if (rest.length) { - node.body = t.blockStatement(rest); - } else { - node.body = t.emptyStatement(); - } - } - - }, - - Program(path) { - // An approximation of the resultant gzipped code after minification - this.fitsInSlidingWindow = path.getSource().length / 10 < 33000; - const node = path.node; - const statements = toMultipleSequenceExpressions(node.body); - - if (!statements.length) { - return; - } - - node.body = statements; - }, - - BlockStatement: { - enter(path) { - const node = path.node, - parent = path.parent; - const top = []; - const bottom = []; - - for (let i = 0; i < node.body.length; i++) { - const bodyNode = node.body[i]; - - if (t.isFunctionDeclaration(bodyNode)) { - top.push(bodyNode); - } else { - bottom.push(bodyNode); - } - } - - const statements = top.concat(toMultipleSequenceExpressions(bottom)); - - if (!statements.length) { - return; - } - - if (statements.length > 1 || needsBlock(node, parent) || node.directives) { - node.body = statements; - return; - } - - if (statements.length) { - path.replaceWith(statements[0]); - return; - } - }, - - exit(path) { - const node = path.node, - parent = path.parent; - - if (t.isArrowFunctionExpression(parent) && node.body.length === 1 && t.isReturnStatement(node.body[0]) && node.body[0].argument !== null) { - path.replaceWith(node.body[0].argument); - return; - } - - if (needsBlock(node, parent)) { - return; - } - - if (node.body.length === 1) { - path.get("body")[0].inList = false; - path.replaceWith(node.body[0]); - return; - } - - if (node.body.length === 0) { - path.replaceWith(t.emptyStatement()); - return; - } // Check if oppurtinties to merge statements are available. - - - const statements = node.body; - - if (!statements.length) { - return; - } - - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = statements[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - const statement = _step2.value; - - if (!t.isExpressionStatement(statement)) { - return; - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - path.visit(); - } - - }, - ThrowStatement: createPrevExpressionEater("throw"), - // Try to merge previous statements into a sequence - ReturnStatement: { - enter: [createPrevExpressionEater("return"), // Remove return if last statement with no argument. - // Replace return with `void` argument with argument. - function (path) { - const node = path.node; - - if (!path.parentPath.parentPath.isFunction() || path.getSibling(path.key + 1).node) { - return; - } - - if (!node.argument) { - path.remove(); - return; - } - - if (t.isUnaryExpression(node.argument, { - operator: "void" - })) { - path.replaceWith(node.argument.argument); - } - }] - }, - // turn blocked ifs into single statements - IfStatement: { - exit: [ifStatement.mergeNestedIfs, ifStatement.simplify, ifStatement.switchConsequent, ifStatement.conditionalReturnToGuards, createPrevExpressionEater("if")] - }, - - WhileStatement(path) { - const node = path.node; - path.replaceWith(t.forStatement(null, node.test, null, node.body)); - }, - - ForInStatement: createPrevExpressionEater("for-in"), - // Flatten sequence expressions. - SequenceExpression: { - exit(path) { - if (path.node[seqExprSeen]) { - return; - } - - function flatten(node) { - node[seqExprSeen] = true; - const ret = []; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = node.expressions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - const n = _step3.value; - - if (t.isSequenceExpression(n)) { - ret.push(...flatten(n)); - } else { - ret.push(n); - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - return ret; - } - - path.node.expressions = flatten(path.node); - } - - }, - - SwitchCase(path) { - const node = path.node; - - if (!node.consequent.length) { - return; - } - - node.consequent = toMultipleSequenceExpressions(node.consequent); - }, - - SwitchStatement: { - exit: [// Convert switch statements with all returns in their cases - // to return conditional. - function (path) { - const node = path.node; // Need to be careful of side-effects. - - if (!t.isIdentifier(node.discriminant)) { - return; - } - - if (!node.cases.length) { - return; - } - - const consTestPairs = []; - let fallThru = []; - let defaultRet; - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - - try { - for (var _iterator4 = node.cases[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - const switchCase = _step4.value; - - if (switchCase.consequent.length > 1) { - return; - } - - const cons = switchCase.consequent[0]; // default case - - if (!switchCase.test) { - if (!t.isReturnStatement(cons)) { - return; - } - - defaultRet = cons; - continue; - } - - if (!switchCase.consequent.length) { - fallThru.push(switchCase.test); - continue; - } // TODO: can we void it? - - - if (!t.isReturnStatement(cons)) { - return; - } - - let test = t.binaryExpression("===", node.discriminant, switchCase.test); - - if (fallThru.length && !defaultRet) { - test = fallThru.reduceRight((right, test) => t.logicalExpression("||", t.binaryExpression("===", node.discriminant, test), right), test); - } - - fallThru = []; - consTestPairs.push([test, cons.argument || VOID_0]); - } // Bail if we have any remaining fallthrough - - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return != null) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - - if (fallThru.length) { - return; - } // We need the default to be there to make sure there is an oppurtinity - // not to return. - - - if (!defaultRet) { - if (path.inList) { - const nextPath = path.getSibling(path.key + 1); - - if (nextPath.isReturnStatement()) { - defaultRet = nextPath.node; - nextPath.remove(); - } else if (!nextPath.node && path.parentPath.parentPath.isFunction()) { - // If this is the last statement in a function we just fake a void return. - defaultRet = t.returnStatement(VOID_0); - } else { - return; - } - } else { - return; - } - } - - const cond = consTestPairs.reduceRight((alt, [test, cons]) => t.conditionalExpression(test, cons, alt), defaultRet.argument || VOID_0); - path.replaceWith(t.returnStatement(cond)); // Maybe now we can merge with some previous switch statement. - - if (path.inList) { - const prev = path.getSibling(path.key - 1); - - if (prev.isSwitchStatement()) { - prev.visit(); - } - } - }, // Convert switches into conditionals. - function (path) { - const node = path.node; // Need to be careful of side-effects. - - if (!t.isIdentifier(node.discriminant)) { - return; - } - - if (!node.cases.length) { - return; - } - - const exprTestPairs = []; - let fallThru = []; - let defaultExpr; - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - - try { - for (var _iterator5 = node.cases[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - const switchCase = _step5.value; - - if (!switchCase.test) { - if (switchCase.consequent.length !== 1) { - return; - } - - if (!t.isExpressionStatement(switchCase.consequent[0])) { - return; - } - - defaultExpr = switchCase.consequent[0].expression; - continue; - } - - if (!switchCase.consequent.length) { - fallThru.push(switchCase.test); - continue; - } - - const _switchCase$consequen = _slicedToArray(switchCase.consequent, 2), - cons = _switchCase$consequen[0], - breakStatement = _switchCase$consequen[1]; - - if (switchCase === node.cases[node.cases.length - 1]) { - if (breakStatement && !t.isBreakStatement(breakStatement)) { - return; - } - } else if (!t.isBreakStatement(breakStatement)) { - return; - } - - if (!t.isExpressionStatement(cons) || switchCase.consequent.length > 2) { - return; - } - - let test = t.binaryExpression("===", node.discriminant, switchCase.test); - - if (fallThru.length && !defaultExpr) { - test = fallThru.reduceRight((right, test) => t.logicalExpression("||", t.binaryExpression("===", node.discriminant, test), right), test); - } - - fallThru = []; - exprTestPairs.push([test, cons.expression]); - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return != null) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - - if (fallThru.length) { - return; - } - - const cond = exprTestPairs.reduceRight((alt, [test, cons]) => t.conditionalExpression(test, cons, alt), defaultExpr || VOID_0); - path.replaceWith(cond); - }, function (path) { - const node = path.node; - - if (!node.cases.length) { - return; - } - - const lastCase = path.get("cases")[node.cases.length - 1]; - - if (!lastCase.node.consequent.length) { - return; - } - - const potentialBreak = lastCase.get("consequent")[lastCase.node.consequent.length - 1]; - - if (t.isBreakStatement(potentialBreak) && potentialBreak.node.label === null) { - potentialBreak.remove(); - } - }, createPrevExpressionEater("switch")] - } - } - }; - - function flipNegation(node) { - if (!node.consequent || !node.alternate) { - return; - } - - const test = node.test; - let flip = false; - - if (t.isBinaryExpression(test)) { - if (test.operator === "!==") { - test.operator = "==="; - flip = true; - } - - if (test.operator === "!=") { - test.operator = "=="; - flip = true; - } - } - - if (t.isUnaryExpression(test, { - operator: "!" - })) { - node.test = test.argument; - flip = true; - } - - if (flip) { - const consequent = node.consequent; - node.consequent = node.alternate; - node.alternate = consequent; - } - } - - function needsBlock(node, parent) { - return t.isFunction(parent) && node === parent.body || t.isTryStatement(parent) || t.isCatchClause(parent) || t.isSwitchStatement(parent) || isSingleBlockScopeDeclaration(node) && (t.isIfStatement(parent) || t.isLoop(parent)); - } - - function isSingleBlockScopeDeclaration(block) { - return t.isBlockStatement(block) && block.body.length === 1 && (t.isVariableDeclaration(block.body[0], { - kind: "let" - }) || t.isVariableDeclaration(block.body[0], { - kind: "const" - }) || t.isFunctionDeclaration(block.body[0])); - } - - function isVoid0(expr) { - return expr === VOID_0 || t.isUnaryExpression(expr, { - operator: "void" - }) && t.isNumericLiteral(expr.argument, { - value: 0 - }); - } - - function earlyReturnTransform(path) { - const block = path.get("body"); - - if (!block.isBlockStatement()) { - return; - } - - const body = block.get("body"); - - for (let i = body.length - 1; i >= 0; i--) { - const statement = body[i]; - - if (t.isIfStatement(statement.node) && !statement.node.alternate && t.isReturnStatement(statement.node.consequent) && !statement.node.consequent.argument) { - genericEarlyExitTransform(statement); - } - } - } - - function earlyContinueTransform(path) { - const block = path.get("body"); - - if (!block.isBlockStatement()) { - return; - } - - let body = block.get("body"); - - for (let i = body.length - 1; i >= 0; i--) { - const statement = body[i]; - - if (t.isIfStatement(statement.node) && !statement.node.alternate && t.isContinueStatement(statement.node.consequent) && !statement.node.consequent.label) { - genericEarlyExitTransform(statement); - } - } // because we might have folded or removed statements - - - body = block.get("body"); // We may have reduced the body to a single statement. - - if (body.length === 1 && !needsBlock(block.node, path.node)) { - block.replaceWith(body[0].node); - } - } - - function genericEarlyExitTransform(path) { - const node = path.node; - const statements = path.parentPath.get(path.listKey).slice(path.key + 1).filter(stmt => !stmt.isFunctionDeclaration()); // deopt for any block scoped bindings - // issue#399 - - const deopt = !statements.every(stmt => { - if (!(stmt.isVariableDeclaration({ - kind: "let" - }) || stmt.isVariableDeclaration({ - kind: "const" - }))) { - return true; - } - - const ids = Object.keys(stmt.getBindingIdentifiers()); - - for (var _i2 = 0; _i2 < ids.length; _i2++) { - const id = ids[_i2]; - const binding = path.scope.getBinding(id); // TODO - // Temporary Fix - // if there is no binding, we assume it is referenced outside - // and deopt to avoid bugs - - if (!binding) { - return false; - } - - const refs = [...binding.referencePaths, ...binding.constantViolations]; - - for (var _i3 = 0; _i3 < refs.length; _i3++) { - const ref = refs[_i3]; - if (!ref.isIdentifier()) return false; - const fnParent = ref.getFunctionParent(); // TODO - // Usage of scopes and bindings in simplify plugin results in - // undefined bindings because scope changes are not updated in the - // scope tree. So, we deopt whenever we encounter one such issue - // and not perform the transformation - - if (!fnParent) { - return false; - } - - if (fnParent.scope !== path.scope) return false; - } - } - - return true; - }); - - if (deopt) { - path.visit(); - return false; - } - - if (!statements.length) { - path.replaceWith(t.expressionStatement(node.test)); - return; - } - - const test = node.test; - - if (t.isBinaryExpression(test) && test.operator === "!==") { - test.operator = "==="; - } else if (t.isBinaryExpression(test) && test.operator === "!=") { - test.operator = "=="; - } else if (t.isUnaryExpression(test, { - operator: "!" - })) { - node.test = test.argument; - } else { - node.test = t.unaryExpression("!", node.test, true); - } - - path.get("consequent").replaceWith(t.blockStatement(statements.map(stmt => t.clone(stmt.node)))); - let l = statements.length; - - while (l-- > 0) { - if (!statements[l].isFunctionDeclaration()) { - path.getSibling(path.key + 1).remove(); - } - } // this should take care of removing the block - - - path.visit(); - } - - function createPrevExpressionEater(keyword) { - let key; - - switch (keyword) { - case "switch": - key = "discriminant"; - break; - - case "throw": - case "return": - key = "argument"; - break; - - case "if": - key = "test"; - break; - - case "for-in": - key = "right"; - break; - } - - return function (path) { - if (!path.inList) { - return; - } - - const node = path.node; - const prev = path.getSibling(path.key - 1); - - if (!prev.isExpressionStatement()) { - return; - } - - let seq = prev.node.expression; - - if (node[key]) { - if (t.isSequenceExpression(seq)) { - seq.expressions.push(node[key]); - } else { - seq = t.sequenceExpression([seq, node[key]]); - } - } else { - if (t.isSequenceExpression(seq)) { - const lastExpr = seq.expressions[seq.expressions.length - 1]; - seq.expressions[seq.expressions.length - 1] = t.unaryExpression("void", lastExpr, true); - } else { - seq = t.unaryExpression("void", seq, true); - } - } - - if (seq) { - node[key] = seq; - prev.remove(); // Since we were able to merge some stuff it's possible that this has opened - // oppurtinties for other transforms to happen. - // TODO: Look into changing the traversal order from bottom to up to avoid - // having to revisit things. - - if (path.parentPath.parent) { - path.parentPath.parent[shouldRevisit] = true; - } - } - }; - } // path1 -> path2 - // is path1 an ancestor of path2 - - - function isAncestor(path1, path2) { - return !!path2.findParent(parent => parent === path1); - } - - function isPureVoid(path) { - return path.isUnaryExpression({ - operator: "void" - }) && path.isPure(); - } - - function isGlobalUndefined(path) { - return path.isIdentifier({ - name: "undefined" - }) && !path.scope.getBinding("undefined"); - } - - function undefinedToNull(path) { - if (isGlobalUndefined(path) || isPureVoid(path)) { - path.replaceWith(t.nullLiteral()); - } - } -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-simplify/lib/logical-expression.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-simplify/lib/logical-expression.js ***! - \*****************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const h = __webpack_require__(/*! ./helpers */ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js"); - -const PatternMatch = __webpack_require__(/*! ./pattern-match */ "./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js"); - -const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); - -module.exports = t => { - const OP_AND = input => input === "&&"; - - const OP_OR = input => input === "||"; - - function simplifyPatterns(path) { - // cache of evaluate(path) - const evaluateMemo = new Map(); - - const TRUTHY = input => { - // !NaN and !undefined are truthy - // separate check here as they are considered impure by babel - if (input.isUnaryExpression() && input.get("argument").isIdentifier()) { - if (input.node.argument.name === "NaN" || input.node.argument.name === "undefined") { - return true; - } - } - - const evalResult = evaluate(input); - evaluateMemo.set(input, evalResult); - return evalResult.confident && input.isPure() && evalResult.value; - }; - - const FALSY = input => { - // NaN and undefined are falsy - // separate check here as they are considered impure by babel - if (input.isIdentifier()) { - if (input.node.name === "NaN" || input.node.name === "undefined") { - return true; - } - } - - const evalResult = evaluate(input); - evaluateMemo.set(input, evalResult); - return evalResult.confident && input.isPure() && !evalResult.value; - }; - - const _h$typeSymbols = h.typeSymbols(t), - EX = _h$typeSymbols.Expression; // Convention: - // [left, operator, right, handler(leftNode, rightNode)] - - - const matcher = new PatternMatch([[TRUTHY, OP_AND, EX, (l, r) => r], [FALSY, OP_AND, EX, l => l], [TRUTHY, OP_OR, EX, l => l], [FALSY, OP_OR, EX, (l, r) => r]]); - const left = path.get("left"); - const right = path.get("right"); - const operator = path.node.operator; - const result = matcher.match([left, operator, right], h.isPatternMatchesPath(t)); - - if (result.match) { - // here we are sure that left.evaluate is always confident becuase - // it satisfied one of TRUTHY/FALSY paths - let value; - - if (evaluateMemo.has(left)) { - value = evaluateMemo.get(left).value; - } else { - value = evaluate(left).value; - } - - path.replaceWith(result.value(t.valueToNode(value), right.node)); - } - } - - return { - simplifyPatterns - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js": -/*!************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js ***! - \************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -const LEAF_NODE = Symbol("LEAF_NODE"); -module.exports = class PatternMatch { - constructor(patterns) { - this.decisionTree = this.makeDecisionTree(patterns); - } - - handle(input, isMatch) { - const result = this.match(input, isMatch); - - if (!result.match) { - throw new Error("No Match Found for " + input.toString()); - } - - if (typeof result.value !== "function") { - throw new Error("Expecting a function. Instead got - " + result.value.toString()); - } - - result.value.call(null, input, result.keys); - } - - match(input, isMatch = (a, b) => a === b) { - let current = this.decisionTree; - const result = { - match: false, - value: void 0, - keys: [] - }; // to handle falsy keys - - const NO_MATCH = Symbol("NO_MATCH"); - - for (let i = 0; i < input.length; i++) { - let matchedKey = NO_MATCH; // because map doesn't support custom key equal function - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = current.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - const key = _step.value; - - if (isMatch(key, input[i])) { - matchedKey = key; - result.keys.push(matchedKey); - break; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - if (matchedKey !== NO_MATCH) { - current = current.get(matchedKey); - - if (i === input.length - 1) { - if (current.has(LEAF_NODE)) { - result.match = true; - result.value = current.get(LEAF_NODE); - } - - break; - } - } else { - break; - } - } - - return result; - } - - makeDecisionTree(patterns) { - // order of keys in a Map is the order of insertion - const root = new Map(); - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = patterns[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - const pattern = _step2.value; - make(root, pattern); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - return root; - - function make(parent, pattern) { - if (pattern.length < 2) { - throw new Error("at least 2 elements required in a pattern"); - } - - if (pattern.length === 2) { - if (parent.has(pattern[0])) { - const pattern0 = parent.get(pattern[0]); - - if (!pattern0.has(LEAF_NODE)) { - pattern0.set(LEAF_NODE, pattern[1]); - } // here we don't handle duplicates - // this pattern would have already been matched - - } else { - parent.set(pattern[0], new Map([[LEAF_NODE, pattern[1]]])); - } - - return parent; - } - - const _pattern = _toArray(pattern), - current = _pattern[0], - rest = _pattern.slice(1); - - if (parent.has(current)) { - make(parent.get(current), rest); - } else { - parent.set(current, make(new Map(), rest)); - } - - return parent; - } - } - -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-minify-type-constructors/lib/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/babel-plugin-minify-type-constructors/lib/index.js ***! - \*************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -function replaceArray(t, path) { - const node = path.node; // arguments is taken :( - - const constructorArgs = path.get("arguments"); - - if (t.isIdentifier(node.callee, { - name: "Array" - }) && !path.scope.getBinding("Array")) { - if (constructorArgs.length === 0) { - // Array() -> [] - path.replaceWith(t.arrayExpression([])); - } else if (constructorArgs.length === 1) { - const arg = constructorArgs[0]; - const result = arg.evaluate(); - - if (result.confident) { - if (typeof result.value === "number") { - if (result.value >= 0 && result.value <= 6 && result.value % 1 === 0) { - // "Array(7)" is shorter than "[,,,,,,,]" - path.replaceWith(t.arrayExpression(Array(result.value).fill(null))); - } else { - dropNewIfPresent(); - } - } else { - // Array("Asdf"), Array(true), Array(false) - path.replaceWith(t.arrayExpression([t.valueToNode(result.value)])); - } - } else { - const transformables = ["ArrayExpression", "ObjectExpression", "FunctionExpression", "ArrowFunctionExpression", "ClassExpression"]; - - if (transformables.indexOf(arg.node.type) !== -1) { - // Array([]), Array({}) - // Array(()=>{}), Array(class{}), Array(function(){}) - path.replaceWith(t.arrayExpression([arg.node])); - } else { - // Array(x); Array(a.b); - dropNewIfPresent(); - } - } - } else { - // Array(2,3), Array(a,b) => [2,3], [a,b] - path.replaceWith(t.arrayExpression(node.arguments)); - } - - return true; - } - - function dropNewIfPresent() { - if (path.isNewExpression()) { - path.replaceWith(t.callExpression(node.callee, node.arguments)); - } - } -} - -function replaceObject(t, path) { - const node = path.node; - - if (t.isIdentifier(node.callee, { - name: "Object" - }) && !path.scope.getBinding("Object")) { - const isVoid0 = __webpack_require__(/*! babel-helper-is-void-0 */ "./node_modules/babel-helper-is-void-0/lib/index.js")(t); - - const arg = node.arguments[0]; - const binding = arg && t.isIdentifier(arg) && path.scope.getBinding(arg.name); // Object() -> {} - - if (node.arguments.length === 0) { - path.replaceWith(t.objectExpression([])); // Object([]) -> [] - } else if (arg.type === "ArrayExpression" || t.isFunctionExpression(arg)) { - path.replaceWith(arg); // Object(null) -> {} - } else if (isVoid0(arg) || arg.name === "undefined" || arg.type === "NullLiteral" || arg.type === "ObjectExpression" && arg.properties.length === 0) { - path.replaceWith(t.objectExpression([])); // Object(localFn) -> localFn - } else if (binding && binding.path.isFunction()) { - path.replaceWith(arg); // Object({a:b}) -> {a:b} - } else if (arg.type === "ObjectExpression") { - path.replaceWith(arg); // new Object(a) -> Object(a) - } else if (node.type === "NewExpression") { - path.replaceWith(t.callExpression(node.callee, node.arguments)); - } - - return true; - } -} - -function defaults({ - boolean = true, - number = true, - string = true, - array = true, - object = true -} = {}) { - return { - boolean, - number, - string, - array, - object - }; -} - -module.exports = function ({ - types: t -}) { - return { - name: "minify-type-constructors", - visitor: { - CallExpression(path) { - const node = path.node; - const opts = defaults(this.opts); // Boolean(foo) -> !!foo - - if (opts.boolean && t.isIdentifier(node.callee, { - name: "Boolean" - }) && node.arguments.length === 1 && !path.scope.getBinding("Boolean")) { - path.replaceWith(t.unaryExpression("!", t.unaryExpression("!", node.arguments[0], true), true)); - return; - } // Number(foo) -> +foo - - - if (opts.number && t.isIdentifier(node.callee, { - name: "Number" - }) && node.arguments.length === 1 && !path.scope.getBinding("Number")) { - path.replaceWith(t.unaryExpression("+", node.arguments[0], true)); - return; - } // String(foo) -> foo + '' - - - if (opts.string && t.isIdentifier(node.callee, { - name: "String" - }) && node.arguments.length === 1 && !path.scope.getBinding("String")) { - path.replaceWith(t.binaryExpression("+", node.arguments[0], t.stringLiteral(""))); - return; - } // Array() -> [] - - - if (opts.array && replaceArray(t, path)) { - return; - } // Object() -> {} - - - if (opts.object && replaceObject(t, path)) { - return; - } - }, - - NewExpression(path) { - const opts = defaults(this.opts); // new Array() -> [] - - if (opts.array && replaceArray(t, path)) { - return; - } // new Object() -> {} - - - if (opts.object && replaceObject(t, path)) { - return; - } - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-collapser.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-collapser.js ***! - \********************************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); - -class ArrayCollapser extends Collapser { - isInitTypeValid(init) { - return init.isArrayExpression(); - } - - isExpressionTypeValid(expr) { - return expr.isCallExpression(); - } - - getExpressionChecker(objName, checkReference) { - return expr => { - // checks expr is of form: - // foo.push(rval1, ...nrvals) - const callee = expr.get("callee"); - - if (!callee.isMemberExpression()) { - return false; - } - - const obj = callee.get("object"), - prop = callee.get("property"); - - if (!obj.isIdentifier() || obj.node.name !== objName || !prop.isIdentifier() || prop.node.name !== "push") { - return false; - } - - const args = expr.get("arguments"); - - if (args.some(checkReference)) { - return false; - } - - return true; - }; - } - - extractAssignment(expr) { - return expr.node.arguments; - } - - addSuccessfully(t, args, init) { - args.map(a => init.elements.push(a)); - return true; - } - -} - -module.exports = ArrayCollapser; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-property-collapser.js": -/*!*****************************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-property-collapser.js ***! - \*****************************************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); - -class ArrayPropertyCollapser extends Collapser { - isInitTypeValid(init) { - return init.isArrayExpression(); - } - - isExpressionTypeValid(expr) { - return expr.isAssignmentExpression(); - } - - getExpressionChecker(objName, checkReference) { - return expr => { - // checks expr is of form: - // foo[num] = rval - const left = expr.get("left"); - - if (!left.isMemberExpression()) { - return false; - } - - const obj = left.get("object"), - prop = left.get("property"); - - if (!obj.isIdentifier() || obj.node.name !== objName) { - return false; - } - - const checkIndex = num => Number.isInteger(num) && num >= 0; - - if (!(prop.isNumericLiteral() || prop.isStringLiteral()) || !checkIndex(Number(prop.node.value))) { - return false; - } - - const right = expr.get("right"); - - if (checkReference(right)) { - return false; - } - - return true; - }; - } - - extractAssignment(expr) { - return [expr.node.left.property.value, expr.get("right")]; - } - - addSuccessfully(t, [index, rval], init) { - const elements = init.elements; - - for (let i = elements.length; i <= index; i++) { - elements.push(null); - } - - if (elements[index] !== null) { - return false; - } - - elements[index] = rval.node; - return true; - } - - isSizeSmaller({ - newInit, - oldInit, - varDecl, - assignments, - statements - }) { - const anyUndefined = args => args.some(a => a === undefined); // We make an inexact calculation of how much space we save. - // It's inexact because we don't know how whitespaces will get minimized, - // and other factors. - - - if (anyUndefined([statements[statements.length - 1].node.end, varDecl.node.end])) { - return false; - } - - const statementsLength = statements[statements.length - 1].node.end - varDecl.node.end; // Approx. formula of the change in `init`'s length = - // (# commas added) + (size of all the new rvals added), where - // # commas added = (difference between the lengths of the old and new arrays) - - const numCommaAdded = newInit.elements.length - oldInit.elements.length; - - if (anyUndefined(assignments.map(([, rval]) => rval.node.end)) || anyUndefined(assignments.map(([, rval]) => rval.node.start))) { - return false; - } - - const sizeOfRvals = assignments.map(([, rval]) => rval.node.end - rval.node.start + 1).reduce((a, b) => a + b, 0); // add 1 for space in front // sum - - return numCommaAdded + sizeOfRvals < statementsLength; - } - -} - -module.exports = ArrayPropertyCollapser; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js ***! - \**************************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -const NotImplementedError = Error("NotImplementedError"); - -class Collapser { - isInitTypeValid() { - throw NotImplementedError; - } - - isExpressionTypeValid() { - throw NotImplementedError; - } - - getExpressionChecker() { - throw NotImplementedError; - } - - extractAssignment() { - throw NotImplementedError; - } - - addSuccessfully() { - throw NotImplementedError; - } - - isSizeSmaller() { - return true; - } - -} - -module.exports = Collapser; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/index.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/index.js ***! - \**********************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - -function _iterableToArrayLimit(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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -const COLLAPSERS = [__webpack_require__(/*! ./object-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/object-collapser.js"), __webpack_require__(/*! ./array-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-collapser.js"), __webpack_require__(/*! ./array-property-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-property-collapser.js"), __webpack_require__(/*! ./set-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/set-collapser.js")].map(Collapser => { - return new Collapser(); -}); - -function getFunctionParent(path, scopeParent) { - const parent = path.findParent(p => p.isFunction()); // don"t traverse higher than the function the var is defined in. - - return parent === scopeParent ? null : parent; -} - -function getFunctionReferences(path, scopeParent, references = new Set()) { - for (let func = getFunctionParent(path, scopeParent); func; func = getFunctionParent(func, scopeParent)) { - const id = func.node.id; - const binding = id && func.scope.getBinding(id.name); - - if (!binding) { - continue; - } - - binding.referencePaths.forEach(path => { - if (!references.has(path)) { - references.add(path); - getFunctionReferences(path, scopeParent, references); - } - }); - } - - return references; -} - -function getIdAndFunctionReferences(name, parent) { - // Returns false if there's an error. Otherwise returns a list of references. - const binding = parent.scope.getBinding(name); - - if (!binding) { - return false; - } - - const references = binding.referencePaths.reduce((references, ref) => { - references.add(ref); - getFunctionReferences(ref, parent, references); - return references; - }, new Set()); - return Array.from(references); -} - -function validateTopLevel(path) { - // Ensures the structure is of the form (roughly): - // { - // ... - // var foo = expr; - // ... - // } - // returns null if not of this form - // otherwise returns [foo as string, ?rval, index of the variable declaration] - const declarations = path.get("declarations"); - - if (declarations.length !== 1) { - return; - } - - const declaration = declarations[0]; - const id = declaration.get("id"), - init = declaration.get("init"); - - if (!id.isIdentifier()) { - return; - } - - const parent = path.parentPath; - - if (!parent.isBlockParent() || !parent.isScopable()) { - return; - } - - const body = parent.get("body"); - - if (!Array.isArray(body)) { - return; - } - - const startIndex = body.indexOf(path); - - if (startIndex === -1) { - return; - } - - return [id.node.name, init, startIndex]; -} - -function collectExpressions(path, isExprTypeValid) { - // input: ExprStatement => 'a | SequenceExpression - // SequenceExpression => 'a list - // Validates 'a is of the right type - // returns null if found inconsistency, else returns Array<"a> - if (path.isExpressionStatement()) { - const exprs = collectExpressions(path.get("expression"), isExprTypeValid); - return exprs !== null ? exprs : null; - } - - if (path.isSequenceExpression()) { - const exprs = path.get("expressions").map(p => collectExpressions(p, isExprTypeValid)); - - if (exprs.some(e => e === null)) { - return null; - } else { - return exprs.reduce((s, n) => s.concat(n), []); // === Array.flatten - } - } - - if (isExprTypeValid(path)) { - return [path]; - } - - return null; -} - -function getContiguousStatementsAndExpressions(body, start, end, isExprTypeValid, checkExpr) { - const statements = []; - let allExprs = []; - - for (let i = start; i < end; i++) { - const exprs = collectExpressions(body[i], isExprTypeValid); - - if (exprs === null || !exprs.every(e => checkExpr(e))) { - break; - } - - statements.push(body[i]); - allExprs = allExprs.concat(exprs); - } - - return [statements, allExprs]; -} - -function getReferenceChecker(references) { - // returns a function s.t. given an expr, returns true iff expr is an ancestor of a reference - return expr => references.some(r => r === expr || r.isDescendant(expr)); -} - -function tryUseCollapser(t, collapser, varDecl, topLevel, checkReference) { - // Returns true iff successfully used the collapser. Otherwise returns undefined. - const _topLevel = _slicedToArray(topLevel, 3), - name = _topLevel[0], - init = _topLevel[1], - startIndex = _topLevel[2]; - - if (!collapser.isInitTypeValid(init)) { - return; - } - - const body = varDecl.parentPath.get("body"); - - const _getContiguousStateme = getContiguousStatementsAndExpressions(body, startIndex + 1, body.length, collapser.isExpressionTypeValid, collapser.getExpressionChecker(name, checkReference)), - _getContiguousStateme2 = _slicedToArray(_getContiguousStateme, 2), - statements = _getContiguousStateme2[0], - exprs = _getContiguousStateme2[1]; - - if (statements.length === 0) { - return; - } - - const assignments = exprs.map(e => collapser.extractAssignment(e)); - const oldInit = init.node; - const newInit = t.cloneDeep(oldInit); - - if (!assignments.every(assignment => collapser.addSuccessfully(t, assignment, newInit))) { - return; - } // some collapses may increase the size - - - if (!collapser.isSizeSmaller({ - newInit, - oldInit, - varDecl, - assignments, - statements - })) { - return; - } - - init.replaceWith(newInit); - statements.forEach(s => s.remove()); - return true; -} - -module.exports = function ({ - types: t -}) { - return { - name: "transform-inline-consecutive-adds", - visitor: { - VariableDeclaration(varDecl) { - const topLevel = validateTopLevel(varDecl); - - if (!topLevel) { - return; - } - - const _topLevel2 = _slicedToArray(topLevel, 1), - name = _topLevel2[0]; - - const references = getIdAndFunctionReferences(name, varDecl.parentPath); - - if (references === false) { - return; - } - - const checkReference = getReferenceChecker(references); - - if (COLLAPSERS.some(c => tryUseCollapser(t, c, varDecl, topLevel, checkReference))) { - return; - } - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/object-collapser.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/object-collapser.js ***! - \*********************************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); - -class ObjectCollapser extends Collapser { - isInitTypeValid(init) { - return init.isObjectExpression(); - } - - isExpressionTypeValid(expr) { - return expr.isAssignmentExpression(); - } - - getExpressionChecker(objName, checkReference) { - return expr => { - // checks expr is of form: - // foo.a = rval | foo[a] = rval - const left = expr.get("left"); - - if (!left.isMemberExpression()) { - return false; - } - - const obj = left.get("object"), - prop = left.get("property"); - - if (!obj.isIdentifier() || obj.node.name !== objName) { - return false; - } - - if (!prop.isIdentifier() && checkReference(prop)) { - return false; - } - - if (left.node.computed && !(prop.isStringLiteral() || prop.isNumericLiteral())) { - return false; - } - - const right = expr.get("right"); - - if (checkReference(right)) { - return false; - } - - return true; - }; - } - - extractAssignment(expr) { - return [expr.node.left.property, expr.node.right]; - } - - addSuccessfully(t, [left, right], init) { - init.properties.push(t.objectProperty(left, right)); - return true; - } - -} - -module.exports = ObjectCollapser; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/set-collapser.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/set-collapser.js ***! - \******************************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); - -class SetCollapser extends Collapser { - isInitTypeValid(init) { - return init.isNewExpression() && init.get("callee").isIdentifier() && init.node.callee.name === "Set" && ( // other iterables might not be append-able - init.node.arguments.length === 0 || init.node.arguments.length === 1 && init.get("arguments")[0].isArrayExpression()); - } - - isExpressionTypeValid(expr) { - return expr.isCallExpression(); - } - - getExpressionChecker(objName, checkReference) { - return expr => { - // checks expr is of form: - // foo.add(rval) - const callee = expr.get("callee"); - - if (!callee.isMemberExpression()) { - return false; - } - - const obj = callee.get("object"), - prop = callee.get("property"); - - if (!obj.isIdentifier() || obj.node.name !== objName || !prop.isIdentifier() || prop.node.name !== "add") { - return false; - } - - const args = expr.get("arguments"); - - if (args.length !== 1) { - return false; - } - - if (checkReference(args[0])) { - return false; - } - - return true; - }; - } - - extractAssignment(expr) { - return expr.node.arguments[0]; - } - - addSuccessfully(t, arg, init) { - if (init.arguments.length === 0) { - init.arguments.push(t.arrayExpression()); - } - - init.arguments[0].elements.push(arg); - return true; - } - -} - -module.exports = SetCollapser; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-member-expression-literals/lib/index.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-member-expression-literals/lib/index.js ***! - \*************************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function ({ - types: t -}) { - return { - name: "transform-member-expression-literals", - visitor: { - // foo['bar'] -> foo.bar - MemberExpression: { - exit({ - node - }) { - const prop = node.property; - - if (!node.computed || !t.isStringLiteral(prop)) { - return; - } - - if (prop.value.match(/^\d+$/)) { - const newProp = parseInt(prop.value, 10); - - if (newProp.toString() === prop.value) { - node.property = t.numericLiteral(newProp); - node.computed = false; - } - } else if (t.isValidIdentifier(prop.value)) { - node.property = t.identifier(prop.value); - node.computed = false; - } - } - - } - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-merge-sibling-variables/lib/index.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-merge-sibling-variables/lib/index.js ***! - \**********************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function ({ - types: t -}) { - function liftDeclaration(path, body, kind) { - if (body[0] && body[0].isVariableDeclaration({ - kind: kind - })) { - if (body[0].node.declarations.length > 1) { - return; - } - - if (body[1] && body[1].isVariableDeclaration({ - kind: kind - })) { - return; - } - - const firstNode = body[0].node.declarations[0]; - - if (!t.isIdentifier(firstNode.id) || !firstNode.init) { - return; - } - - const init = path.get("init"); - - if (!init.isVariableDeclaration({ - kind: kind - })) { - return; - } - - init.pushContainer("declarations", t.variableDeclarator(firstNode.id)); - body[0].replaceWith(t.assignmentExpression("=", t.clone(firstNode.id), t.clone(firstNode.init))); - } - } - - return { - name: "transform-merge-sibling-variables", - visitor: { - ForStatement(path) { - // Lift declarations to the loop initializer - let body = path.get("body"); - body = body.isBlockStatement() ? body.get("body") : [body]; - liftDeclaration(path, body, "var"); - liftDeclaration(path, body, "let"); - }, - - VariableDeclaration: { - enter: [// concat variables of the same kind with their siblings - function (path) { - if (!path.inList) { - return; - } - - const node = path.node; - let sibling = path.getSibling(path.key + 1); - let declarations = []; - - while (sibling.isVariableDeclaration({ - kind: node.kind - })) { - declarations = declarations.concat(sibling.node.declarations); - sibling.remove(); - sibling = path.getSibling(path.key + 1); - } - - if (declarations.length > 0) { - path.replaceWith(t.variableDeclaration(node.kind, [...node.declarations, ...declarations])); - } - }, // concat `var` declarations next to for loops with it's initialisers. - // block-scoped `let` and `const` are not moved because the for loop - // is a different block scope. - function (path) { - if (!path.inList) { - return; - } - - const node = path.node; - - if (node.kind !== "var") { - return; - } - - const next = path.getSibling(path.key + 1); - - if (!next.isForStatement()) { - return; - } - - const init = next.get("init"); - - if (!init.isVariableDeclaration({ - kind: node.kind - })) { - return; - } - - const declarations = node.declarations.concat(init.node.declarations); // temporary workaround to forces babel recalculate scope, - // references and binding until babel/babel#4818 resolved - - path.remove(); - init.replaceWith(t.variableDeclaration("var", declarations)); - }] - } - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-minify-booleans/lib/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-minify-booleans/lib/index.js ***! - \**************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function ({ - types: t -}) { - const TRUE = t.unaryExpression("!", t.numericLiteral(0), true); - const FALSE = t.unaryExpression("!", t.numericLiteral(1), true); - return { - name: "transform-minify-booleans", - visitor: { - // shorten booleans to a negation - // true -> !0 - // false -> !1 - BooleanLiteral(path) { - path.replaceWith(path.node.value ? TRUE : FALSE); - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-property-literals/lib/escape-string-literal.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-property-literals/lib/escape-string-literal.js ***! - \********************************************************************************************/ -/***/ ((module) => { - -"use strict"; - -/** - * Original Source: - * https://github.com/shapesecurity/shift-codegen-js/blob/0d09bd8a/src/coderep.js#L122 - * - * The following function is an exact copy of the original implementation - * - * LICENSE - -Copyright 2014 Shape Security, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - */ - -module.exports = function escapeStringLiteral(stringValue) { - let result = ""; - let nSingle = 0, - nDouble = 0; - - for (let i = 0, l = stringValue.length; i < l; ++i) { - let ch = stringValue[i]; - - if (ch === '"') { - ++nDouble; - } else if (ch === "'") { - ++nSingle; - } - } - - let delim = nDouble > nSingle ? "'" : '"'; - result += delim; - - for (let i = 0; i < stringValue.length; i++) { - let ch = stringValue.charAt(i); - - switch (ch) { - case delim: - result += "\\" + delim; - break; - - case "\n": - result += "\\n"; - break; - - case "\r": - result += "\\r"; - break; - - case "\\": - result += "\\\\"; - break; - - case "\u2028": - result += "\\u2028"; - break; - - case "\u2029": - result += "\\u2029"; - break; - - default: - result += ch; - break; - } - } - - result += delim; - return result; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-property-literals/lib/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-property-literals/lib/index.js ***! - \****************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const _require = __webpack_require__(/*! ./property-name */ "./node_modules/babel-plugin-transform-property-literals/lib/property-name.js"), - reduceStaticPropertyNameES5 = _require.reduceStaticPropertyNameES5; - -module.exports = function ({ - types: t -}) { - return { - name: "transform-property-literals", - visitor: { - // { 'foo': 'bar' } -> { foo: 'bar' } - ObjectProperty: { - exit(path) { - const key = path.get("key"); - - if (!key.isStringLiteral()) { - return; - } - - const newNode = t.clone(path.node); - newNode.key = reduceStaticPropertyNameES5(t, key.node); - newNode.computed = false; - path.replaceWith(newNode); - } - - } - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-property-literals/lib/property-name.js": -/*!************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-property-literals/lib/property-name.js ***! - \************************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const _require = __webpack_require__(/*! esutils */ "./node_modules/esutils/lib/utils.js"), - keyword = _require.keyword; - -const escapeStringLiteral = __webpack_require__(/*! ./escape-string-literal */ "./node_modules/babel-plugin-transform-property-literals/lib/escape-string-literal.js"); - -module.exports = { - reduceStaticPropertyNameES5 -}; -/** - * - * Original Source: - * https://github.com/shapesecurity/shift-codegen-js/blob/0d09bd8a/src/minimal-codegen.js#L635 - * - * This implementation modifies the original source in the following ways - * + Check for ES5 Identifier name instead of ES6 Identifier name - * + Use Babel-Types & Babel's AST instead of ShiftAST - * - * LICENSE - -Copyright 2014 Shape Security, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - */ - -function reduceStaticPropertyNameES5(t, node) { - if (keyword.isIdentifierNameES5(node.value)) { - return t.Identifier(node.value); - } - - let n = parseFloat(node.value); - - if (n >= 0 && n.toString() === node.value) { - return t.NumericLiteral(n); - } - - return t.Identifier(escapeStringLiteral(node.value)); -} - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-regexp-constructors/lib/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-regexp-constructors/lib/index.js ***! - \******************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -function createRegExpLiteral(args, prettify, t) { - const evaluatedArgs = args.map(a => a.evaluate()); - - if (!evaluatedArgs.every(a => a.confident && typeof a.value === "string")) { - return; - } - - let pattern = evaluatedArgs.length >= 1 && evaluatedArgs[0].value !== "" ? evaluatedArgs[0].value : "(?:)"; - const flags = evaluatedArgs.length >= 2 ? evaluatedArgs[1].value : ""; - pattern = new RegExp(pattern).source; - - if (prettify) { - pattern = pattern.replace(/\n/g, "\\n").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/[\b]/g, "[\\b]").replace(/\v/g, "\\v").replace(/\f/g, "\\f").replace(/\r/g, "\\r"); - } - - pattern = pattern.replace(/\0/g, "\\0"); - return t.regExpLiteral(pattern, flags); -} - -function maybeReplaceWithRegExpLiteral(path, t) { - if (!t.isIdentifier(path.node.callee, { - name: "RegExp" - })) { - return; - } - - const regExpLiteral = createRegExpLiteral(path.get("arguments"), true, t); - - if (regExpLiteral) { - path.replaceWith(regExpLiteral); - } -} - -module.exports = function ({ - types: t -}) { - return { - name: "transform-regexp-constructors", - visitor: { - NewExpression(path) { - maybeReplaceWithRegExpLiteral(path, t); - }, - - CallExpression(path) { - // equivalent to `new RegExp()` according to §21.2.3 - maybeReplaceWithRegExpLiteral(path, t); - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-remove-console/lib/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-remove-console/lib/index.js ***! - \*************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function ({ - types: t -}) { - return { - name: "transform-remove-console", - visitor: { - CallExpression(path, state) { - const callee = path.get("callee"); - if (!callee.isMemberExpression()) return; - - if (isIncludedConsole(callee, state.opts.exclude)) { - // console.log() - if (path.parentPath.isExpressionStatement()) { - path.remove(); - } else { - path.replaceWith(createVoid0()); - } - } else if (isIncludedConsoleBind(callee, state.opts.exclude)) { - // console.log.bind() - path.replaceWith(createNoop()); - } - }, - - MemberExpression: { - exit(path, state) { - if (isIncludedConsole(path, state.opts.exclude) && !path.parentPath.isMemberExpression()) { - if (path.parentPath.isAssignmentExpression() && path.parentKey === "left") { - path.parentPath.get("right").replaceWith(createNoop()); - } else { - path.replaceWith(createNoop()); - } - } - } - - } - } - }; - - function isGlobalConsoleId(id) { - const name = "console"; - return id.isIdentifier({ - name - }) && !id.scope.getBinding(name) && id.scope.hasGlobal(name); - } - - function isExcluded(property, excludeArray) { - return excludeArray && excludeArray.some(name => property.isIdentifier({ - name - })); - } - - function isIncludedConsole(memberExpr, excludeArray) { - const object = memberExpr.get("object"); - const property = memberExpr.get("property"); - if (isExcluded(property, excludeArray)) return false; - if (isGlobalConsoleId(object)) return true; - return isGlobalConsoleId(object.get("object")) && (property.isIdentifier({ - name: "call" - }) || property.isIdentifier({ - name: "apply" - })); - } - - function isIncludedConsoleBind(memberExpr, excludeArray) { - const object = memberExpr.get("object"); - if (!object.isMemberExpression()) return false; - if (isExcluded(object.get("property"), excludeArray)) return false; - return isGlobalConsoleId(object.get("object")) && memberExpr.get("property").isIdentifier({ - name: "bind" - }); - } - - function createNoop() { - return t.functionExpression(null, [], t.blockStatement([])); - } - - function createVoid0() { - return t.unaryExpression("void", t.numericLiteral(0)); - } -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-remove-debugger/lib/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-remove-debugger/lib/index.js ***! - \**************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function () { - return { - name: "transform-remove-debugger", - visitor: { - DebuggerStatement(path) { - path.remove(); - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-remove-undefined/lib/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-remove-undefined/lib/index.js ***! - \***************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); - -function isPureAndUndefined(rval, { - tdz, - scope = { - hasBinding: () => false - } -} = {}) { - if (rval.isIdentifier() && rval.node.name === "undefined") { - // deopt right away if undefined is a local binding - if (scope.hasBinding(rval.node.name, true - /* no globals */ - )) { - return false; - } - - return true; - } - - if (!rval.isPure()) { - return false; - } - - const evaluation = evaluate(rval, { - tdz - }); - return evaluation.confident === true && evaluation.value === undefined; -} - -function getLoopParent(path, scopeParent) { - const parent = path.findParent(p => p.isLoop() || p === scopeParent); // don't traverse higher than the function the var is defined in. - - return parent === scopeParent ? null : parent; -} - -function getFunctionParent(path, scopeParent) { - const parent = path.findParent(p => p.isFunction()); // don't traverse higher than the function the var is defined in. - - return parent === scopeParent ? null : parent; -} - -function getFunctionReferences(path, scopeParent, references = new Set()) { - for (let func = getFunctionParent(path, scopeParent); func; func = getFunctionParent(func, scopeParent)) { - const id = func.node.id; - const binding = id && func.scope.getBinding(id.name); - - if (!binding) { - continue; - } - - binding.referencePaths.forEach(path => { - if (!references.has(path)) { - references.add(path); - getFunctionReferences(path, scopeParent, references); - } - }); - } - - return references; -} - -function hasViolation(declarator, scope, start) { - const binding = scope.getBinding(declarator.node.id.name); - - if (!binding) { - return true; - } - - const scopeParent = declarator.getFunctionParent(); - const violation = binding.constantViolations.some(v => { - // https://github.com/babel/minify/issues/630 - if (!v.node) { - return false; - } // return 'true' if we cannot guarantee the violation references - // the initialized identifier after - - - const violationStart = v.node.start; - - if (violationStart === undefined || violationStart < start) { - return true; - } - - const references = getFunctionReferences(v, scopeParent); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = references[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - const ref = _step.value; - - if (ref.node.start === undefined || ref.node.start < start) { - return true; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - for (let loop = getLoopParent(declarator, scopeParent); loop; loop = getLoopParent(loop, scopeParent)) { - if (loop.node.end === undefined || loop.node.end > violationStart) { - return true; - } - } - }); - return violation; -} - -module.exports = function () { - return { - name: "transform-remove-undefined", - visitor: { - SequenceExpression(path, { - opts: { - tdz - } = {} - }) { - const expressions = path.get("expressions"); - - for (let i = 0; i < expressions.length; i++) { - const expr = expressions[i]; - if (!isPureAndUndefined(expr, { - tdz, - scope: path.scope - })) continue; // last value - - if (i === expressions.length - 1) { - if (path.parentPath.isExpressionStatement()) { - expr.remove(); - } - } else { - expr.remove(); - } - } - }, - - ReturnStatement(path, { - opts: { - tdz - } = {} - }) { - if (path.node.argument !== null) { - if (isPureAndUndefined(path.get("argument"), { - tdz, - scope: path.scope - })) { - path.node.argument = null; - } - } - }, - - VariableDeclaration(path, { - opts: { - tdz - } = {} - }) { - switch (path.node.kind) { - case "const": - break; - - case "let": - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = path.get("declarations")[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - const declarator = _step2.value; - - if (isPureAndUndefined(declarator.get("init"), { - tdz - })) { - declarator.node.init = null; - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - break; - - case "var": - const start = path.node.start; - - if (start === undefined) { - // This is common for plugin-generated nodes - break; - } - - const scope = path.scope; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = path.get("declarations")[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - const declarator = _step3.value; - - if (isPureAndUndefined(declarator.get("init")) && !hasViolation(declarator, scope, start)) { - declarator.node.init = null; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - break; - } - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-simplify-comparison-operators/lib/index.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-simplify-comparison-operators/lib/index.js ***! - \****************************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function ({ - types: t -}) { - // custom implementation of getTypeAnnotation that fixes - // the type information that is lost during sequence expression transformation - // https://github.com/babel/minify/issues/323 - function customTypeAnnotation(path) { - if (path.typeAnnotation) { - return path.typeAnnotation; - } // We are not handling the case of literals and other base types - // since they are already handled via getTypeAnnotation - - - const node = path.node; - const binding = path.parentPath.scope.getBinding(node.name); - const types = []; - - if (binding && binding.constantViolations) { - if (binding.identifier.typeAnnotation) { - return binding.identifier.typeAnnotation; - } - - if (binding.constantViolations) { - const violations = binding.constantViolations; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = violations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - let violation = _step.value; - types.push(violation.getTypeAnnotation()); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - } - - if (types.length > 0) { - return t.createUnionTypeAnnotation(types); - } - - return types; - } // Based on the type inference in Babel - - - function baseTypeStrictlyMatches(left, right) { - let leftTypes, rightTypes; - - if (t.isIdentifier(left)) { - leftTypes = customTypeAnnotation(left); - } else if (t.isIdentifier(right)) { - rightTypes = customTypeAnnotation(right); - } // Early exit - - - if (t.isAnyTypeAnnotation(leftTypes) || t.isAnyTypeAnnotation(rightTypes)) { - return false; - } - - leftTypes = [].concat(leftTypes, left.getTypeAnnotation()); - rightTypes = [].concat(rightTypes, right.getTypeAnnotation()); - leftTypes = t.createUnionTypeAnnotation(leftTypes); - rightTypes = t.createUnionTypeAnnotation(rightTypes); - - if (!t.isAnyTypeAnnotation(leftTypes) && t.isFlowBaseAnnotation(leftTypes)) { - return leftTypes.type === rightTypes.type; - } - } - - return { - name: "transform-simplify-comparison-operators", - visitor: { - // simplify comparison operations if we're 100% certain - // that each value will always be of the same type - BinaryExpression(path) { - const node = path.node; - const op = node.operator; - - if (op !== "===" && op !== "!==") { - return; - } - - const left = path.get("left"); - const right = path.get("right"); - const strictMatch = baseTypeStrictlyMatches(left, right); - - if (strictMatch) { - node.operator = node.operator.slice(0, -1); - } - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-plugin-transform-undefined-to-void/lib/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/babel-plugin-transform-undefined-to-void/lib/index.js ***! - \****************************************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function ({ - types: t -}) { - const VOID_0 = t.unaryExpression("void", t.numericLiteral(0), true); - return { - name: "transform-undefined-to-void", - visitor: { - ReferencedIdentifier(path) { - if (path.node.name === "undefined") { - path.replaceWith(VOID_0); - } - } - - } - }; -}; - -/***/ }), - -/***/ "./node_modules/babel-preset-minify/lib/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/babel-preset-minify/lib/index.js ***! - \*******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - -const isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js"); // the flat plugin map -// This is to prevent dynamic requires - require('babel-plugin-' + name); -// as it suffers during bundling of this code with webpack/browserify -// sorted by option name -// prettier-ignore - - -const PLUGINS = [// [optionname, plugin, default], -["booleans", __webpack_require__(/*! babel-plugin-transform-minify-booleans */ "./node_modules/babel-plugin-transform-minify-booleans/lib/index.js"), true], ["builtIns", __webpack_require__(/*! babel-plugin-minify-builtins */ "./node_modules/babel-plugin-minify-builtins/lib/index.js"), true], ["consecutiveAdds", __webpack_require__(/*! babel-plugin-transform-inline-consecutive-adds */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/index.js"), true], ["deadcode", __webpack_require__(/*! babel-plugin-minify-dead-code-elimination */ "./node_modules/babel-plugin-minify-dead-code-elimination/lib/index.js"), true], ["evaluate", __webpack_require__(/*! babel-plugin-minify-constant-folding */ "./node_modules/babel-plugin-minify-constant-folding/lib/index.js"), true], ["flipComparisons", __webpack_require__(/*! babel-plugin-minify-flip-comparisons */ "./node_modules/babel-plugin-minify-flip-comparisons/lib/index.js"), true], ["guards", __webpack_require__(/*! babel-plugin-minify-guarded-expressions */ "./node_modules/babel-plugin-minify-guarded-expressions/lib/index.js"), true], ["infinity", __webpack_require__(/*! babel-plugin-minify-infinity */ "./node_modules/babel-plugin-minify-infinity/lib/index.js"), true], ["mangle", __webpack_require__(/*! babel-plugin-minify-mangle-names */ "./node_modules/babel-plugin-minify-mangle-names/lib/index.js"), true], ["memberExpressions", __webpack_require__(/*! babel-plugin-transform-member-expression-literals */ "./node_modules/babel-plugin-transform-member-expression-literals/lib/index.js"), true], ["mergeVars", __webpack_require__(/*! babel-plugin-transform-merge-sibling-variables */ "./node_modules/babel-plugin-transform-merge-sibling-variables/lib/index.js"), true], ["numericLiterals", __webpack_require__(/*! babel-plugin-minify-numeric-literals */ "./node_modules/babel-plugin-minify-numeric-literals/lib/index.js"), true], ["propertyLiterals", __webpack_require__(/*! babel-plugin-transform-property-literals */ "./node_modules/babel-plugin-transform-property-literals/lib/index.js"), true], ["regexpConstructors", __webpack_require__(/*! babel-plugin-transform-regexp-constructors */ "./node_modules/babel-plugin-transform-regexp-constructors/lib/index.js"), true], ["removeConsole", __webpack_require__(/*! babel-plugin-transform-remove-console */ "./node_modules/babel-plugin-transform-remove-console/lib/index.js"), false], ["removeDebugger", __webpack_require__(/*! babel-plugin-transform-remove-debugger */ "./node_modules/babel-plugin-transform-remove-debugger/lib/index.js"), false], ["removeUndefined", __webpack_require__(/*! babel-plugin-transform-remove-undefined */ "./node_modules/babel-plugin-transform-remove-undefined/lib/index.js"), true], ["replace", __webpack_require__(/*! babel-plugin-minify-replace */ "./node_modules/babel-plugin-minify-replace/lib/index.js"), true], ["simplify", __webpack_require__(/*! babel-plugin-minify-simplify */ "./node_modules/babel-plugin-minify-simplify/lib/index.js"), true], ["simplifyComparisons", __webpack_require__(/*! babel-plugin-transform-simplify-comparison-operators */ "./node_modules/babel-plugin-transform-simplify-comparison-operators/lib/index.js"), true], ["typeConstructors", __webpack_require__(/*! babel-plugin-minify-type-constructors */ "./node_modules/babel-plugin-minify-type-constructors/lib/index.js"), true], ["undefinedToVoid", __webpack_require__(/*! babel-plugin-transform-undefined-to-void */ "./node_modules/babel-plugin-transform-undefined-to-void/lib/index.js"), true]]; -const PROXIES = { - keepFnName: ["mangle", "deadcode"], - keepClassName: ["mangle", "deadcode"], - tdz: ["builtIns", "evaluate", "deadcode", "removeUndefined"] -}; -module.exports = preset; - -function preset(context, _opts = {}) { - const opts = isPlainObject(_opts) ? _opts : {}; // validate options - - const validOptions = [...PLUGINS.map(p => p[0]), ...Object.keys(PROXIES)]; - - for (let name in opts) { - if (validOptions.indexOf(name) < 0) { - throw new Error(`Invalid option "${name}"`); - } - } // build a plugins map from the plugin table above - - - const pluginsMap = PLUGINS.reduce((acc, [name, plugin, defaultValue]) => Object.assign(acc, { - [name]: { - plugin, - options: null, - enabled: defaultValue - } - }), {}); // handle plugins and their options - - var _iterator = _createForOfIteratorHelper(PLUGINS), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - const _step$value = _slicedToArray(_step.value, 1), - name = _step$value[0]; - - if (isPlainObject(opts[name])) { - // for plugins disabled by default - pluginsMap[name].enabled = true; - pluginsMap[name].options = opts[name]; - } else if (opts[name] !== void 0) { - pluginsMap[name].enabled = !!opts[name]; - } - } // handle proxies - - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - - for (let proxyname in PROXIES) { - if (opts[proxyname] !== void 0) { - var _iterator2 = _createForOfIteratorHelper(PROXIES[proxyname]), - _step2; - - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - const to = _step2.value; - - if (!pluginsMap[to].options) { - pluginsMap[to].options = {}; - } - - if (!hop(pluginsMap[to].options, proxyname)) { - pluginsMap[to].options[proxyname] = opts[proxyname]; - } - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - } // get the array of plugins - - - const plugins = Object.keys(pluginsMap).map(name => pluginsMap[name]).filter(plugin => plugin.enabled).map(plugin => plugin.options ? [plugin.plugin, plugin.options] : plugin.plugin); - return { - minified: true, - presets: [{ - plugins - }], - passPerPreset: true - }; -} - -function hop(o, key) { - return Object.prototype.hasOwnProperty.call(o, key); -} - -/***/ }), - -/***/ "./node_modules/browserslist/browser.js": -/*!**********************************************!*\ - !*** ./node_modules/browserslist/browser.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var BrowserslistError = __webpack_require__(/*! ./error */ "./node_modules/browserslist/error.js") - -function noop() {} - -module.exports = { - loadQueries: function loadQueries() { - throw new BrowserslistError( - 'Sharable configs are not supported in client-side build of Browserslist' - ) - }, - - getStat: function getStat(opts) { - return opts.stats - }, - - loadConfig: function loadConfig(opts) { - if (opts.config) { - throw new BrowserslistError( - 'Browserslist config are not supported in client-side build' - ) - } - }, - - loadCountry: function loadCountry() { - throw new BrowserslistError( - 'Country statistics are not supported ' + - 'in client-side build of Browserslist' - ) - }, - - loadFeature: function loadFeature() { - throw new BrowserslistError( - 'Supports queries are not available in client-side build of Browserslist' - ) - }, - - currentNode: function currentNode(resolve, context) { - return resolve(['maintained node versions'], context)[0] - }, - - parseConfig: noop, - - readConfig: noop, - - findConfig: noop, - - findConfigFile: noop, - - clearCaches: noop, - - oldDataWarning: noop, - - env: {} -} - - -/***/ }), - -/***/ "./node_modules/browserslist/error.js": -/*!********************************************!*\ - !*** ./node_modules/browserslist/error.js ***! - \********************************************/ -/***/ ((module) => { - -function BrowserslistError(message) { - this.name = 'BrowserslistError' - this.message = message - this.browserslist = true - if (Error.captureStackTrace) { - Error.captureStackTrace(this, BrowserslistError) - } -} - -BrowserslistError.prototype = Error.prototype - -module.exports = BrowserslistError - - -/***/ }), - -/***/ "./node_modules/browserslist/index.js": -/*!********************************************!*\ - !*** ./node_modules/browserslist/index.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var jsReleases = __webpack_require__(/*! node-releases/data/processed/envs.json */ "./node_modules/node-releases/data/processed/envs.json") -var agents = (__webpack_require__(/*! caniuse-lite/dist/unpacker/agents */ "./node_modules/caniuse-lite/dist/unpacker/agents.js").agents) -var e2c = __webpack_require__(/*! electron-to-chromium/versions */ "./node_modules/electron-to-chromium/versions.js") -var jsEOL = __webpack_require__(/*! node-releases/data/release-schedule/release-schedule.json */ "./node_modules/node-releases/data/release-schedule/release-schedule.json") -var path = __webpack_require__(/*! path */ "?3465") - -var BrowserslistError = __webpack_require__(/*! ./error */ "./node_modules/browserslist/error.js") -var env = __webpack_require__(/*! ./node */ "./node_modules/browserslist/browser.js") -var parseWithoutCache = __webpack_require__(/*! ./parse */ "./node_modules/browserslist/parse.js") // Will load browser.js in webpack - -var YEAR = 365.259641 * 24 * 60 * 60 * 1000 -var ANDROID_EVERGREEN_FIRST = '37' -var OP_MOB_BLINK_FIRST = 14 - -// Helpers - -function isVersionsMatch(versionA, versionB) { - return (versionA + '.').indexOf(versionB + '.') === 0 -} - -function isEolReleased(name) { - var version = name.slice(1) - return browserslist.nodeVersions.some(function (i) { - return isVersionsMatch(i, version) - }) -} - -function normalize(versions) { - return versions.filter(function (version) { - return typeof version === 'string' - }) -} - -function normalizeElectron(version) { - var versionToUse = version - if (version.split('.').length === 3) { - versionToUse = version.split('.').slice(0, -1).join('.') - } - return versionToUse -} - -function nameMapper(name) { - return function mapName(version) { - return name + ' ' + version - } -} - -function getMajor(version) { - return parseInt(version.split('.')[0]) -} - -function getMajorVersions(released, number) { - if (released.length === 0) return [] - var majorVersions = uniq(released.map(getMajor)) - var minimum = majorVersions[majorVersions.length - number] - if (!minimum) { - return released - } - var selected = [] - for (var i = released.length - 1; i >= 0; i--) { - if (minimum > getMajor(released[i])) break - selected.unshift(released[i]) - } - return selected -} - -function uniq(array) { - var filtered = [] - for (var i = 0; i < array.length; i++) { - if (filtered.indexOf(array[i]) === -1) filtered.push(array[i]) - } - return filtered -} - -function fillUsage(result, name, data) { - for (var i in data) { - result[name + ' ' + i] = data[i] - } -} - -function generateFilter(sign, version) { - version = parseFloat(version) - if (sign === '>') { - return function (v) { - return parseLatestFloat(v) > version - } - } else if (sign === '>=') { - return function (v) { - return parseLatestFloat(v) >= version - } - } else if (sign === '<') { - return function (v) { - return parseFloat(v) < version - } - } else { - return function (v) { - return parseFloat(v) <= version - } - } - - function parseLatestFloat(v) { - return parseFloat(v.split('-')[1] || v) - } -} - -function generateSemverFilter(sign, version) { - version = version.split('.').map(parseSimpleInt) - version[1] = version[1] || 0 - version[2] = version[2] || 0 - if (sign === '>') { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(v, version) > 0 - } - } else if (sign === '>=') { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(v, version) >= 0 - } - } else if (sign === '<') { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(version, v) > 0 - } - } else { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(version, v) >= 0 - } - } -} - -function parseSimpleInt(x) { - return parseInt(x) -} - -function compare(a, b) { - if (a < b) return -1 - if (a > b) return +1 - return 0 -} - -function compareSemver(a, b) { - return ( - compare(parseInt(a[0]), parseInt(b[0])) || - compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) || - compare(parseInt(a[2] || '0'), parseInt(b[2] || '0')) - ) -} - -// this follows the npm-like semver behavior -function semverFilterLoose(operator, range) { - range = range.split('.').map(parseSimpleInt) - if (typeof range[1] === 'undefined') { - range[1] = 'x' - } - // ignore any patch version because we only return minor versions - // range[2] = 'x' - switch (operator) { - case '<=': - return function (version) { - version = version.split('.').map(parseSimpleInt) - return compareSemverLoose(version, range) <= 0 - } - case '>=': - default: - return function (version) { - version = version.split('.').map(parseSimpleInt) - return compareSemverLoose(version, range) >= 0 - } - } -} - -// this follows the npm-like semver behavior -function compareSemverLoose(version, range) { - if (version[0] !== range[0]) { - return version[0] < range[0] ? -1 : +1 - } - if (range[1] === 'x') { - return 0 - } - if (version[1] !== range[1]) { - return version[1] < range[1] ? -1 : +1 - } - return 0 -} - -function resolveVersion(data, version) { - if (data.versions.indexOf(version) !== -1) { - return version - } else if (browserslist.versionAliases[data.name][version]) { - return browserslist.versionAliases[data.name][version] - } else { - return false - } -} - -function normalizeVersion(data, version) { - var resolved = resolveVersion(data, version) - if (resolved) { - return resolved - } else if (data.versions.length === 1) { - return data.versions[0] - } else { - return false - } -} - -function filterByYear(since, context) { - since = since / 1000 - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var versions = Object.keys(data.releaseDate).filter(function (v) { - var date = data.releaseDate[v] - return date !== null && date >= since - }) - return selected.concat(versions.map(nameMapper(data.name))) - }, []) -} - -function cloneData(data) { - return { - name: data.name, - versions: data.versions, - released: data.released, - releaseDate: data.releaseDate - } -} - -function byName(name, context) { - name = name.toLowerCase() - name = browserslist.aliases[name] || name - if (context.mobileToDesktop && browserslist.desktopNames[name]) { - var desktop = browserslist.data[browserslist.desktopNames[name]] - if (name === 'android') { - return normalizeAndroidData(cloneData(browserslist.data[name]), desktop) - } else { - var cloned = cloneData(desktop) - cloned.name = name - return cloned - } - } - return browserslist.data[name] -} - -function normalizeAndroidVersions(androidVersions, chromeVersions) { - var iFirstEvergreen = chromeVersions.indexOf(ANDROID_EVERGREEN_FIRST) - return androidVersions - .filter(function (version) { - return /^(?:[2-4]\.|[34]$)/.test(version) - }) - .concat(chromeVersions.slice(iFirstEvergreen)) -} - -function copyObject(obj) { - var copy = {} - for (var key in obj) { - copy[key] = obj[key] - } - return copy -} - -function normalizeAndroidData(android, chrome) { - android.released = normalizeAndroidVersions(android.released, chrome.released) - android.versions = normalizeAndroidVersions(android.versions, chrome.versions) - android.releaseDate = copyObject(android.releaseDate) - android.released.forEach(function (v) { - if (android.releaseDate[v] === undefined) { - android.releaseDate[v] = chrome.releaseDate[v] - } - }) - return android -} - -function checkName(name, context) { - var data = byName(name, context) - if (!data) throw new BrowserslistError('Unknown browser ' + name) - return data -} - -function unknownQuery(query) { - return new BrowserslistError( - 'Unknown browser query `' + - query + - '`. ' + - 'Maybe you are using old Browserslist or made typo in query.' - ) -} - -// Adjusts last X versions queries for some mobile browsers, -// where caniuse data jumps from a legacy version to the latest -function filterJumps(list, name, nVersions, context) { - var jump = 1 - switch (name) { - case 'android': - if (context.mobileToDesktop) return list - var released = browserslist.data.chrome.released - jump = released.length - released.indexOf(ANDROID_EVERGREEN_FIRST) - break - case 'op_mob': - var latest = browserslist.data.op_mob.released.slice(-1)[0] - jump = getMajor(latest) - OP_MOB_BLINK_FIRST + 1 - break - default: - return list - } - if (nVersions <= jump) { - return list.slice(-1) - } - return list.slice(jump - 1 - nVersions) -} - -function isSupported(flags, withPartial) { - return ( - typeof flags === 'string' && - (flags.indexOf('y') >= 0 || (withPartial && flags.indexOf('a') >= 0)) - ) -} - -function resolve(queries, context) { - return parseQueries(queries).reduce(function (result, node, index) { - if (node.not && index === 0) { - throw new BrowserslistError( - 'Write any browsers query (for instance, `defaults`) ' + - 'before `' + - node.query + - '`' - ) - } - var type = QUERIES[node.type] - var array = type.select.call(browserslist, context, node).map(function (j) { - var parts = j.split(' ') - if (parts[1] === '0') { - return parts[0] + ' ' + byName(parts[0], context).versions[0] - } else { - return j - } - }) - - if (node.compose === 'and') { - if (node.not) { - return result.filter(function (j) { - return array.indexOf(j) === -1 - }) - } else { - return result.filter(function (j) { - return array.indexOf(j) !== -1 - }) - } - } else { - if (node.not) { - var filter = {} - array.forEach(function (j) { - filter[j] = true - }) - return result.filter(function (j) { - return !filter[j] - }) - } - return result.concat(array) - } - }, []) -} - -function prepareOpts(opts) { - if (typeof opts === 'undefined') opts = {} - - if (typeof opts.path === 'undefined') { - opts.path = path.resolve ? path.resolve('.') : '.' - } - - return opts -} - -function prepareQueries(queries, opts) { - if (typeof queries === 'undefined' || queries === null) { - var config = browserslist.loadConfig(opts) - if (config) { - queries = config - } else { - queries = browserslist.defaults - } - } - - return queries -} - -function checkQueries(queries) { - if (!(typeof queries === 'string' || Array.isArray(queries))) { - throw new BrowserslistError( - 'Browser queries must be an array or string. Got ' + typeof queries + '.' - ) - } -} - -var cache = {} -var parseCache = {} - -function browserslist(queries, opts) { - opts = prepareOpts(opts) - queries = prepareQueries(queries, opts) - checkQueries(queries) - - var needsPath = parseQueries(queries).some(function (node) { - return QUERIES[node.type].needsPath - }) - var context = { - ignoreUnknownVersions: opts.ignoreUnknownVersions, - dangerousExtend: opts.dangerousExtend, - mobileToDesktop: opts.mobileToDesktop, - env: opts.env - } - // Removing to avoid using context.path without marking query as needsPath - if (needsPath) { - context.path = opts.path - } - - env.oldDataWarning(browserslist.data) - var stats = env.getStat(opts, browserslist.data) - if (stats) { - context.customUsage = {} - for (var browser in stats) { - fillUsage(context.customUsage, browser, stats[browser]) - } - } - - var cacheKey = JSON.stringify([queries, context]) - if (cache[cacheKey]) return cache[cacheKey] - - var result = uniq(resolve(queries, context)).sort(function (name1, name2) { - name1 = name1.split(' ') - name2 = name2.split(' ') - if (name1[0] === name2[0]) { - // assumptions on caniuse data - // 1) version ranges never overlaps - // 2) if version is not a range, it never contains `-` - var version1 = name1[1].split('-')[0] - var version2 = name2[1].split('-')[0] - return compareSemver(version2.split('.'), version1.split('.')) - } else { - return compare(name1[0], name2[0]) - } - }) - if (!env.env.BROWSERSLIST_DISABLE_CACHE) { - cache[cacheKey] = result - } - return result -} - -function parseQueries(queries) { - var cacheKey = JSON.stringify(queries) - if (cacheKey in parseCache) return parseCache[cacheKey] - var result = parseWithoutCache(QUERIES, queries) - if (!env.env.BROWSERSLIST_DISABLE_CACHE) { - parseCache[cacheKey] = result - } - return result -} - -function loadCustomUsage(context, config) { - var stats = env.loadStat(context, config, browserslist.data) - if (stats) { - context.customUsage = {} - for (var browser in stats) { - fillUsage(context.customUsage, browser, stats[browser]) - } - } - if (!context.customUsage) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - return context.customUsage -} - -browserslist.parse = function (queries, opts) { - opts = prepareOpts(opts) - queries = prepareQueries(queries, opts) - checkQueries(queries) - return parseQueries(queries) -} - -// Will be filled by Can I Use data below -browserslist.cache = {} -browserslist.data = {} -browserslist.usage = { - global: {}, - custom: null -} - -// Default browsers query -browserslist.defaults = ['> 0.5%', 'last 2 versions', 'Firefox ESR', 'not dead'] - -// Browser names aliases -browserslist.aliases = { - fx: 'firefox', - ff: 'firefox', - ios: 'ios_saf', - explorer: 'ie', - blackberry: 'bb', - explorermobile: 'ie_mob', - operamini: 'op_mini', - operamobile: 'op_mob', - chromeandroid: 'and_chr', - firefoxandroid: 'and_ff', - ucandroid: 'and_uc', - qqandroid: 'and_qq' -} - -// Can I Use only provides a few versions for some browsers (e.g. and_chr). -// Fallback to a similar browser for unknown versions -// Note op_mob is not included as its chromium versions are not in sync with Opera desktop -browserslist.desktopNames = { - and_chr: 'chrome', - and_ff: 'firefox', - ie_mob: 'ie', - android: 'chrome' // has extra processing logic -} - -// Aliases to work with joined versions like `ios_saf 7.0-7.1` -browserslist.versionAliases = {} - -browserslist.clearCaches = env.clearCaches -browserslist.parseConfig = env.parseConfig -browserslist.readConfig = env.readConfig -browserslist.findConfigFile = env.findConfigFile -browserslist.findConfig = env.findConfig -browserslist.loadConfig = env.loadConfig - -browserslist.coverage = function (browsers, stats) { - var data - if (typeof stats === 'undefined') { - data = browserslist.usage.global - } else if (stats === 'my stats') { - var opts = {} - opts.path = path.resolve ? path.resolve('.') : '.' - var customStats = env.getStat(opts) - if (!customStats) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - data = {} - for (var browser in customStats) { - fillUsage(data, browser, customStats[browser]) - } - } else if (typeof stats === 'string') { - if (stats.length > 2) { - stats = stats.toLowerCase() - } else { - stats = stats.toUpperCase() - } - env.loadCountry(browserslist.usage, stats, browserslist.data) - data = browserslist.usage[stats] - } else { - if ('dataByBrowser' in stats) { - stats = stats.dataByBrowser - } - data = {} - for (var name in stats) { - for (var version in stats[name]) { - data[name + ' ' + version] = stats[name][version] - } - } - } - - return browsers.reduce(function (all, i) { - var usage = data[i] - if (usage === undefined) { - usage = data[i.replace(/ \S+$/, ' 0')] - } - return all + (usage || 0) - }, 0) -} - -function nodeQuery(context, node) { - var matched = browserslist.nodeVersions.filter(function (i) { - return isVersionsMatch(i, node.version) - }) - if (matched.length === 0) { - if (context.ignoreUnknownVersions) { - return [] - } else { - throw new BrowserslistError( - 'Unknown version ' + node.version + ' of Node.js' - ) - } - } - return ['node ' + matched[matched.length - 1]] -} - -function sinceQuery(context, node) { - var year = parseInt(node.year) - var month = parseInt(node.month || '01') - 1 - var day = parseInt(node.day || '01') - return filterByYear(Date.UTC(year, month, day, 0, 0, 0), context) -} - -function coverQuery(context, node) { - var coverage = parseFloat(node.coverage) - var usage = browserslist.usage.global - if (node.place) { - if (node.place.match(/^my\s+stats$/i)) { - if (!context.customUsage) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - usage = context.customUsage - } else { - var place - if (node.place.length === 2) { - place = node.place.toUpperCase() - } else { - place = node.place.toLowerCase() - } - env.loadCountry(browserslist.usage, place, browserslist.data) - usage = browserslist.usage[place] - } - } else if (node.config) { - usage = loadCustomUsage(context, node.config) - } - var versions = Object.keys(usage).sort(function (a, b) { - return usage[b] - usage[a] - }) - var covered = 0 - var result = [] - var version - for (var i = 0; i < versions.length; i++) { - version = versions[i] - if (usage[version] === 0) break - covered += usage[version] - result.push(version) - if (covered >= coverage) break - } - return result -} - -var QUERIES = { - last_major_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+major\s+versions?$/i, - select: function (context, node) { - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var list = getMajorVersions(data.released, node.versions) - list = list.map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return selected.concat(list) - }, []) - } - }, - last_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+versions?$/i, - select: function (context, node) { - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var list = data.released.slice(-node.versions) - list = list.map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return selected.concat(list) - }, []) - } - }, - last_electron_major_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+electron\s+major\s+versions?$/i, - select: function (context, node) { - var validVersions = getMajorVersions(Object.keys(e2c), node.versions) - return validVersions.map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - last_node_major_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+node\s+major\s+versions?$/i, - select: function (context, node) { - return getMajorVersions(browserslist.nodeVersions, node.versions).map( - function (version) { - return 'node ' + version - } - ) - } - }, - last_browser_major_versions: { - matches: ['versions', 'browser'], - regexp: /^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - var validVersions = getMajorVersions(data.released, node.versions) - var list = validVersions.map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return list - } - }, - last_electron_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+electron\s+versions?$/i, - select: function (context, node) { - return Object.keys(e2c) - .slice(-node.versions) - .map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - last_node_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+node\s+versions?$/i, - select: function (context, node) { - return browserslist.nodeVersions - .slice(-node.versions) - .map(function (version) { - return 'node ' + version - }) - } - }, - last_browser_versions: { - matches: ['versions', 'browser'], - regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - var list = data.released.slice(-node.versions).map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return list - } - }, - unreleased_versions: { - matches: [], - regexp: /^unreleased\s+versions$/i, - select: function (context) { - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var list = data.versions.filter(function (v) { - return data.released.indexOf(v) === -1 - }) - list = list.map(nameMapper(data.name)) - return selected.concat(list) - }, []) - } - }, - unreleased_electron_versions: { - matches: [], - regexp: /^unreleased\s+electron\s+versions?$/i, - select: function () { - return [] - } - }, - unreleased_browser_versions: { - matches: ['browser'], - regexp: /^unreleased\s+(\w+)\s+versions?$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - return data.versions - .filter(function (v) { - return data.released.indexOf(v) === -1 - }) - .map(nameMapper(data.name)) - } - }, - last_years: { - matches: ['years'], - regexp: /^last\s+((\d+\.)?\d+)\s+years?$/i, - select: function (context, node) { - return filterByYear(Date.now() - YEAR * node.years, context) - } - }, - since_y: { - matches: ['year'], - regexp: /^since (\d+)$/i, - select: sinceQuery - }, - since_y_m: { - matches: ['year', 'month'], - regexp: /^since (\d+)-(\d+)$/i, - select: sinceQuery - }, - since_y_m_d: { - matches: ['year', 'month', 'day'], - regexp: /^since (\d+)-(\d+)-(\d+)$/i, - select: sinceQuery - }, - popularity: { - matches: ['sign', 'popularity'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - var usage = browserslist.usage.global - return Object.keys(usage).reduce(function (result, version) { - if (node.sign === '>') { - if (usage[version] > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (usage[version] < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (usage[version] <= popularity) { - result.push(version) - } - } else if (usage[version] >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - popularity_in_my_stats: { - matches: ['sign', 'popularity'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+my\s+stats$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - if (!context.customUsage) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - var usage = context.customUsage - return Object.keys(usage).reduce(function (result, version) { - var percentage = usage[version] - if (percentage == null) { - return result - } - - if (node.sign === '>') { - if (percentage > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (percentage < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (percentage <= popularity) { - result.push(version) - } - } else if (percentage >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - popularity_in_config_stats: { - matches: ['sign', 'popularity', 'config'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - var usage = loadCustomUsage(context, node.config) - return Object.keys(usage).reduce(function (result, version) { - var percentage = usage[version] - if (percentage == null) { - return result - } - - if (node.sign === '>') { - if (percentage > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (percentage < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (percentage <= popularity) { - result.push(version) - } - } else if (percentage >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - popularity_in_place: { - matches: ['sign', 'popularity', 'place'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+((alt-)?\w\w)$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - var place = node.place - if (place.length === 2) { - place = place.toUpperCase() - } else { - place = place.toLowerCase() - } - env.loadCountry(browserslist.usage, place, browserslist.data) - var usage = browserslist.usage[place] - return Object.keys(usage).reduce(function (result, version) { - var percentage = usage[version] - if (percentage == null) { - return result - } - - if (node.sign === '>') { - if (percentage > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (percentage < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (percentage <= popularity) { - result.push(version) - } - } else if (percentage >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - cover: { - matches: ['coverage'], - regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%$/i, - select: coverQuery - }, - cover_in: { - matches: ['coverage', 'place'], - regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(my\s+stats|(alt-)?\w\w)$/i, - select: coverQuery - }, - cover_config: { - matches: ['coverage', 'config'], - regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/i, - select: coverQuery - }, - supports: { - matches: ['supportType', 'feature'], - regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/, - select: function (context, node) { - env.loadFeature(browserslist.cache, node.feature) - var withPartial = node.supportType !== 'fully' - var features = browserslist.cache[node.feature] - var result = [] - for (var name in features) { - var data = byName(name, context) - // Only check desktop when latest released mobile has support - var iMax = data.released.length - 1 - while (iMax >= 0) { - if (data.released[iMax] in features[name]) break - iMax-- - } - var checkDesktop = - context.mobileToDesktop && - name in browserslist.desktopNames && - isSupported(features[name][data.released[iMax]], withPartial) - data.versions.forEach(function (version) { - var flags = features[name][version] - if (flags === undefined && checkDesktop) { - flags = features[browserslist.desktopNames[name]][version] - } - if (isSupported(flags, withPartial)) { - result.push(name + ' ' + version) - } - }) - } - return result - } - }, - electron_range: { - matches: ['from', 'to'], - regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i, - select: function (context, node) { - var fromToUse = normalizeElectron(node.from) - var toToUse = normalizeElectron(node.to) - var from = parseFloat(node.from) - var to = parseFloat(node.to) - if (!e2c[fromToUse]) { - throw new BrowserslistError('Unknown version ' + from + ' of electron') - } - if (!e2c[toToUse]) { - throw new BrowserslistError('Unknown version ' + to + ' of electron') - } - return Object.keys(e2c) - .filter(function (i) { - var parsed = parseFloat(i) - return parsed >= from && parsed <= to - }) - .map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - node_range: { - matches: ['from', 'to'], - regexp: /^node\s+([\d.]+)\s*-\s*([\d.]+)$/i, - select: function (context, node) { - return browserslist.nodeVersions - .filter(semverFilterLoose('>=', node.from)) - .filter(semverFilterLoose('<=', node.to)) - .map(function (v) { - return 'node ' + v - }) - } - }, - browser_range: { - matches: ['browser', 'from', 'to'], - regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - var from = parseFloat(normalizeVersion(data, node.from) || node.from) - var to = parseFloat(normalizeVersion(data, node.to) || node.to) - function filter(v) { - var parsed = parseFloat(v) - return parsed >= from && parsed <= to - } - return data.released.filter(filter).map(nameMapper(data.name)) - } - }, - electron_ray: { - matches: ['sign', 'version'], - regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i, - select: function (context, node) { - var versionToUse = normalizeElectron(node.version) - return Object.keys(e2c) - .filter(generateFilter(node.sign, versionToUse)) - .map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - node_ray: { - matches: ['sign', 'version'], - regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i, - select: function (context, node) { - return browserslist.nodeVersions - .filter(generateSemverFilter(node.sign, node.version)) - .map(function (v) { - return 'node ' + v - }) - } - }, - browser_ray: { - matches: ['browser', 'sign', 'version'], - regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/, - select: function (context, node) { - var version = node.version - var data = checkName(node.browser, context) - var alias = browserslist.versionAliases[data.name][version] - if (alias) version = alias - return data.released - .filter(generateFilter(node.sign, version)) - .map(function (v) { - return data.name + ' ' + v - }) - } - }, - firefox_esr: { - matches: [], - regexp: /^(firefox|ff|fx)\s+esr$/i, - select: function () { - return ['firefox 128', 'firefox 140'] - } - }, - opera_mini_all: { - matches: [], - regexp: /(operamini|op_mini)\s+all/i, - select: function () { - return ['op_mini all'] - } - }, - electron_version: { - matches: ['version'], - regexp: /^electron\s+([\d.]+)$/i, - select: function (context, node) { - var versionToUse = normalizeElectron(node.version) - var chrome = e2c[versionToUse] - if (!chrome) { - throw new BrowserslistError( - 'Unknown version ' + node.version + ' of electron' - ) - } - return ['chrome ' + chrome] - } - }, - node_major_version: { - matches: ['version'], - regexp: /^node\s+(\d+)$/i, - select: nodeQuery - }, - node_minor_version: { - matches: ['version'], - regexp: /^node\s+(\d+\.\d+)$/i, - select: nodeQuery - }, - node_patch_version: { - matches: ['version'], - regexp: /^node\s+(\d+\.\d+\.\d+)$/i, - select: nodeQuery - }, - current_node: { - matches: [], - regexp: /^current\s+node$/i, - select: function (context) { - return [env.currentNode(resolve, context)] - } - }, - maintained_node: { - matches: [], - regexp: /^maintained\s+node\s+versions$/i, - select: function (context) { - var now = Date.now() - var queries = Object.keys(jsEOL) - .filter(function (key) { - return ( - now < Date.parse(jsEOL[key].end) && - now > Date.parse(jsEOL[key].start) && - isEolReleased(key) - ) - }) - .map(function (key) { - return 'node ' + key.slice(1) - }) - return resolve(queries, context) - } - }, - phantomjs_1_9: { - matches: [], - regexp: /^phantomjs\s+1.9$/i, - select: function () { - return ['safari 5'] - } - }, - phantomjs_2_1: { - matches: [], - regexp: /^phantomjs\s+2.1$/i, - select: function () { - return ['safari 6'] - } - }, - browser_version: { - matches: ['browser', 'version'], - regexp: /^(\w+)\s+(tp|[\d.]+)$/i, - select: function (context, node) { - var version = node.version - if (/^tp$/i.test(version)) version = 'TP' - var data = checkName(node.browser, context) - var alias = normalizeVersion(data, version) - if (alias) { - version = alias - } else { - if (version.indexOf('.') === -1) { - alias = version + '.0' - } else { - alias = version.replace(/\.0$/, '') - } - alias = normalizeVersion(data, alias) - if (alias) { - version = alias - } else if (context.ignoreUnknownVersions) { - return [] - } else { - throw new BrowserslistError( - 'Unknown version ' + version + ' of ' + node.browser - ) - } - } - return [data.name + ' ' + version] - } - }, - browserslist_config: { - matches: [], - regexp: /^browserslist config$/i, - needsPath: true, - select: function (context) { - return browserslist(undefined, context) - } - }, - extends: { - matches: ['config'], - regexp: /^extends (.+)$/i, - needsPath: true, - select: function (context, node) { - return resolve(env.loadQueries(context, node.config), context) - } - }, - defaults: { - matches: [], - regexp: /^defaults$/i, - select: function (context) { - return resolve(browserslist.defaults, context) - } - }, - dead: { - matches: [], - regexp: /^dead$/i, - select: function (context) { - var dead = [ - 'Baidu >= 0', - 'ie <= 11', - 'ie_mob <= 11', - 'bb <= 10', - 'op_mob <= 12.1', - 'samsung 4' - ] - return resolve(dead, context) - } - }, - unknown: { - matches: [], - regexp: /^(\w+)$/i, - select: function (context, node) { - if (byName(node.query, context)) { - throw new BrowserslistError( - 'Specify versions in Browserslist query for browser ' + node.query - ) - } else { - throw unknownQuery(node.query) - } - } - } -} - -// Get and convert Can I Use data - -;(function () { - for (var name in agents) { - var browser = agents[name] - browserslist.data[name] = { - name: name, - versions: normalize(agents[name].versions), - released: normalize(agents[name].versions.slice(0, -3)), - releaseDate: agents[name].release_date - } - fillUsage(browserslist.usage.global, name, browser.usage_global) - - browserslist.versionAliases[name] = {} - for (var i = 0; i < browser.versions.length; i++) { - var full = browser.versions[i] - if (!full) continue - - if (full.indexOf('-') !== -1) { - var interval = full.split('-') - for (var j = 0; j < interval.length; j++) { - browserslist.versionAliases[name][interval[j]] = full - } - } - } - } - - browserslist.nodeVersions = jsReleases.map(function (release) { - return release.version - }) -})() - -module.exports = browserslist - - -/***/ }), - -/***/ "./node_modules/browserslist/parse.js": -/*!********************************************!*\ - !*** ./node_modules/browserslist/parse.js ***! - \********************************************/ -/***/ ((module) => { - -var AND_REGEXP = /^\s+and\s+(.*)/i -var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i - -function flatten(array) { - if (!Array.isArray(array)) return [array] - return array.reduce(function (a, b) { - return a.concat(flatten(b)) - }, []) -} - -function find(string, predicate) { - for (var max = string.length, n = 1; n <= max; n++) { - var parsed = string.substr(-n, n) - if (predicate(parsed, n, max)) { - return string.slice(0, -n) - } - } - return '' -} - -function matchQuery(all, query) { - var node = { query: query } - if (query.indexOf('not ') === 0) { - node.not = true - query = query.slice(4) - } - - for (var name in all) { - var type = all[name] - var match = query.match(type.regexp) - if (match) { - node.type = name - for (var i = 0; i < type.matches.length; i++) { - node[type.matches[i]] = match[i + 1] - } - return node - } - } - - node.type = 'unknown' - return node -} - -function matchBlock(all, string, qs) { - var node - return find(string, function (parsed, n, max) { - if (AND_REGEXP.test(parsed)) { - node = matchQuery(all, parsed.match(AND_REGEXP)[1]) - node.compose = 'and' - qs.unshift(node) - return true - } else if (OR_REGEXP.test(parsed)) { - node = matchQuery(all, parsed.match(OR_REGEXP)[1]) - node.compose = 'or' - qs.unshift(node) - return true - } else if (n === max) { - node = matchQuery(all, parsed.trim()) - node.compose = 'or' - qs.unshift(node) - return true - } - return false - }) -} - -module.exports = function parse(all, queries) { - if (!Array.isArray(queries)) queries = [queries] - return flatten( - queries.map(function (block) { - var qs = [] - do { - block = matchBlock(all, block, qs) - } while (block) - return qs - }) - ) -} - - -/***/ }), - -/***/ "./node_modules/call-bind-apply-helpers/actualApply.js": -/*!*************************************************************!*\ - !*** ./node_modules/call-bind-apply-helpers/actualApply.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); - -var $apply = __webpack_require__(/*! ./functionApply */ "./node_modules/call-bind-apply-helpers/functionApply.js"); -var $call = __webpack_require__(/*! ./functionCall */ "./node_modules/call-bind-apply-helpers/functionCall.js"); -var $reflectApply = __webpack_require__(/*! ./reflectApply */ "./node_modules/call-bind-apply-helpers/reflectApply.js"); - -/** @type {import('./actualApply')} */ -module.exports = $reflectApply || bind.call($call, $apply); - - -/***/ }), - -/***/ "./node_modules/call-bind-apply-helpers/applyBind.js": -/*!***********************************************************!*\ - !*** ./node_modules/call-bind-apply-helpers/applyBind.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); -var $apply = __webpack_require__(/*! ./functionApply */ "./node_modules/call-bind-apply-helpers/functionApply.js"); -var actualApply = __webpack_require__(/*! ./actualApply */ "./node_modules/call-bind-apply-helpers/actualApply.js"); - -/** @type {import('./applyBind')} */ -module.exports = function applyBind() { - return actualApply(bind, $apply, arguments); -}; - - -/***/ }), - -/***/ "./node_modules/call-bind-apply-helpers/functionApply.js": -/*!***************************************************************!*\ - !*** ./node_modules/call-bind-apply-helpers/functionApply.js ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./functionApply')} */ -module.exports = Function.prototype.apply; - - -/***/ }), - -/***/ "./node_modules/call-bind-apply-helpers/functionCall.js": -/*!**************************************************************!*\ - !*** ./node_modules/call-bind-apply-helpers/functionCall.js ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./functionCall')} */ -module.exports = Function.prototype.call; - - -/***/ }), - -/***/ "./node_modules/call-bind-apply-helpers/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/call-bind-apply-helpers/index.js ***! - \*******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); -var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); - -var $call = __webpack_require__(/*! ./functionCall */ "./node_modules/call-bind-apply-helpers/functionCall.js"); -var $actualApply = __webpack_require__(/*! ./actualApply */ "./node_modules/call-bind-apply-helpers/actualApply.js"); - -/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ -module.exports = function callBindBasic(args) { - if (args.length < 1 || typeof args[0] !== 'function') { - throw new $TypeError('a function is required'); - } - return $actualApply(bind, $call, args); -}; - - -/***/ }), - -/***/ "./node_modules/call-bind-apply-helpers/reflectApply.js": -/*!**************************************************************!*\ - !*** ./node_modules/call-bind-apply-helpers/reflectApply.js ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./reflectApply')} */ -module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; - - -/***/ }), - -/***/ "./node_modules/call-bind/callBound.js": -/*!*********************************************!*\ - !*** ./node_modules/call-bind/callBound.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); - -var callBind = __webpack_require__(/*! ./ */ "./node_modules/call-bind/index.js"); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; - - -/***/ }), - -/***/ "./node_modules/call-bind/index.js": -/*!*****************************************!*\ - !*** ./node_modules/call-bind/index.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var setFunctionLength = __webpack_require__(/*! set-function-length */ "./node_modules/set-function-length/index.js"); - -var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); - -var callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ "./node_modules/call-bind-apply-helpers/index.js"); -var applyBind = __webpack_require__(/*! call-bind-apply-helpers/applyBind */ "./node_modules/call-bind-apply-helpers/applyBind.js"); - -module.exports = function callBind(originalFunction) { - var func = callBindBasic(arguments); - var adjustedLength = originalFunction.length - (arguments.length - 1); - return setFunctionLength( - func, - 1 + (adjustedLength > 0 ? adjustedLength : 0), - true - ); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} - - -/***/ }), - -/***/ "./node_modules/call-bound/index.js": -/*!******************************************!*\ - !*** ./node_modules/call-bound/index.js ***! - \******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); - -var callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ "./node_modules/call-bind-apply-helpers/index.js"); - -/** @type {(thisArg: string, searchString: string, position?: number) => number} */ -var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); - -/** @type {import('.')} */ -module.exports = function callBoundIntrinsic(name, allowMissing) { - /* eslint no-extra-parens: 0 */ - - var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBindBasic(/** @type {const} */ ([intrinsic])); - } - return intrinsic; -}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/agents.js": -/*!**************************************************!*\ - !*** ./node_modules/caniuse-lite/data/agents.js ***! - \**************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{K:0,D:0,E:0.0331526,F:0.0248644,A:0.00828815,B:0.605035,sC:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","sC","K","D","E","F","A","B","","",""],E:"IE",F:{sC:962323200,K:998870400,D:1161129600,E:1237420800,F:1300060800,A:1346716800,B:1381968000}},B:{A:{"0":0,C:0,L:0,M:0,G:0,N:0,O:0,P:0.04422,Q:0,H:0,R:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0.01206,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0.00402,n:0,o:0,p:0,q:0,r:0,s:0.0402,t:0,u:0,v:0,w:0.00804,x:0.01206,y:0.00402,z:0,AB:0,BB:0,CB:0.02814,DB:0.00804,EB:0.01206,FB:0.00402,GB:0.00402,HB:0.00402,IB:0.01206,JB:0.01206,KB:0.00804,LB:0.0201,MB:0.01206,NB:0.02814,OB:0.01608,PB:0.01608,QB:0.04824,RB:0.02814,SB:0.04824,TB:0.21306,I:4.0602},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","L","M","G","N","O","P","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","","",""],E:"Edge",F:{"0":1694649600,C:1438128000,L:1447286400,M:1470096000,G:1491868800,N:1508198400,O:1525046400,P:1542067200,Q:1579046400,H:1581033600,R:1586736000,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:1611360000,Y:1614816000,Z:1618358400,a:1622073600,b:1626912000,c:1630627200,d:1632441600,e:1634774400,f:1637539200,g:1641427200,h:1643932800,i:1646265600,j:1649635200,k:1651190400,l:1653955200,m:1655942400,n:1659657600,o:1661990400,p:1664755200,q:1666915200,r:1670198400,s:1673481600,t:1675900800,u:1678665600,v:1680825600,w:1683158400,x:1685664000,y:1689897600,z:1692576000,AB:1697155200,BB:1698969600,CB:1701993600,DB:1706227200,EB:1708732800,FB:1711152000,GB:1713398400,HB:1715990400,IB:1718841600,JB:1721865600,KB:1724371200,LB:1726704000,MB:1729123200,NB:1731542400,OB:1737417600,PB:1740614400,QB:1741219200,RB:1743984000,SB:1746316800,TB:1748476800,I:1750896000},D:{C:"ms",L:"ms",M:"ms",G:"ms",N:"ms",O:"ms",P:"ms"}},C:{A:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,tC:0,PC:0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0.04824,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:0,iB:0,jB:0,kB:0.00804,lB:0,mB:0.00402,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0.03216,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,QC:0.00804,"0B":0,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0.01206,AC:0,BC:0.01608,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0.01206,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0.00402,t:0,u:0,v:0,w:0.00402,x:0,y:0.17286,z:0,AB:0.11658,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:0.01206,IB:0.01206,JB:0.00402,KB:0.1005,LB:0.00804,MB:0,NB:0,OB:0,PB:0.01206,QB:0.00804,RB:0.00804,SB:0.01608,TB:0.01206,I:0.01608,TC:0.09648,IC:1.01304,UC:0.31356,VC:0,uC:0,vC:0,wC:0,xC:0},B:"moz",C:["tC","PC","wC","xC","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC","uC","vC"],E:"Firefox",F:{"0":1693267200,"1":1361232000,"2":1364860800,"3":1368489600,"4":1372118400,"5":1375747200,"6":1379376000,"7":1386633600,"8":1391472000,"9":1395100800,tC:1161648000,PC:1213660800,wC:1246320000,xC:1264032000,J:1300752000,UB:1308614400,K:1313452800,D:1317081600,E:1317081600,F:1320710400,A:1324339200,B:1327968000,C:1331596800,L:1335225600,M:1338854400,G:1342483200,N:1346112000,O:1349740800,P:1353628800,VB:1357603200,WB:1398729600,XB:1402358400,YB:1405987200,ZB:1409616000,aB:1413244800,bB:1417392000,cB:1421107200,dB:1424736000,eB:1428278400,fB:1431475200,gB:1435881600,hB:1439251200,iB:1442880000,jB:1446508800,kB:1450137600,lB:1453852800,mB:1457395200,nB:1461628800,oB:1465257600,pB:1470096000,qB:1474329600,rB:1479168000,sB:1485216000,tB:1488844800,uB:1492560000,vB:1497312000,wB:1502150400,xB:1506556800,yB:1510617600,zB:1516665600,QC:1520985600,"0B":1525824000,RC:1529971200,"1B":1536105600,"2B":1540252800,"3B":1544486400,"4B":1548720000,"5B":1552953600,"6B":1558396800,"7B":1562630400,"8B":1567468800,"9B":1571788800,AC:1575331200,BC:1578355200,CC:1581379200,DC:1583798400,EC:1586304000,FC:1588636800,GC:1591056000,HC:1593475200,Q:1595894400,H:1598313600,R:1600732800,SC:1603152000,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392000,d:1635811200,e:1638835200,f:1641859200,g:1644364800,h:1646697600,i:1649116800,j:1651536000,k:1653955200,l:1656374400,m:1658793600,n:1661212800,o:1663632000,p:1666051200,q:1668470400,r:1670889600,s:1673913600,t:1676332800,u:1678752000,v:1681171200,w:1683590400,x:1686009600,y:1688428800,z:1690848000,AB:1695686400,BB:1698105600,CB:1700524800,DB:1702944000,EB:1705968000,FB:1708387200,GB:1710806400,HB:1713225600,IB:1715644800,JB:1718064000,KB:1720483200,LB:1722902400,MB:1725321600,NB:1727740800,OB:1730160000,PB:1732579200,QB:1736208000,RB:1738627200,SB:1741046400,TB:1743465600,I:1745884800,TC:1748304000,IC:1750723200,UC:1753142400,VC:null,uC:null,vC:null}},D:{A:{"0":0.09648,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0.00804,hB:0.00804,iB:0.00804,jB:0.00804,kB:0.00804,lB:0.00804,mB:0.01206,nB:0.00804,oB:0.00804,pB:0.0201,qB:0.01608,rB:0.00804,sB:0.00804,tB:0.01206,uB:0.00804,vB:0.00804,wB:0.00804,xB:0.0201,yB:0.00804,zB:0.00804,QC:0.00804,"0B":0.00804,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0.02412,"6B":0,"7B":0.00402,"8B":0.01206,"9B":0.01608,AC:0,BC:0,CC:0.00402,DC:0.00804,EC:0.00402,FC:0.00402,GC:0,HC:0.00804,Q:0.07236,H:0.01206,R:0.02412,S:0.04824,T:0,U:0.00804,V:0.01206,W:0.03618,X:0.00804,Y:0.00402,Z:0.00804,a:0.02814,b:0.00804,c:0.00804,d:0.00804,e:0.00402,f:0.00804,g:0.0201,h:0.04422,i:0.01608,j:0.00804,k:0.02412,l:0.0201,m:0.0804,n:0.03618,o:0.03216,p:0.01206,q:0.01608,r:0.03216,s:0.7638,t:0.01608,u:0.02814,v:4.78782,w:0.05226,x:0.04824,y:0.0201,z:0.06834,AB:0.05226,BB:0.04422,CB:0.06834,DB:0.06834,EB:0.07236,FB:0.07236,GB:0.0603,HB:0.41808,IB:0.0603,JB:0.03216,KB:0.08442,LB:0.06834,MB:0.10854,NB:0.49446,OB:0.1407,PB:0.13668,QB:0.1206,RB:0.21306,SB:0.30552,TB:3.23208,I:11.855,TC:0.0201,IC:0.01608,UC:0,VC:0},B:"webkit",C:["","","","","","","","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC"],E:"Chrome",F:{"0":1694476800,"1":1337040000,"2":1340668800,"3":1343692800,"4":1348531200,"5":1352246400,"6":1357862400,"7":1361404800,"8":1364428800,"9":1369094400,J:1264377600,UB:1274745600,K:1283385600,D:1287619200,E:1291248000,F:1296777600,A:1299542400,B:1303862400,C:1307404800,L:1312243200,M:1316131200,G:1316131200,N:1319500800,O:1323734400,P:1328659200,VB:1332892800,WB:1374105600,XB:1376956800,YB:1384214400,ZB:1389657600,aB:1392940800,bB:1397001600,cB:1400544000,dB:1405468800,eB:1409011200,fB:1412640000,gB:1416268800,hB:1421798400,iB:1425513600,jB:1429401600,kB:1432080000,lB:1437523200,mB:1441152000,nB:1444780800,oB:1449014400,pB:1453248000,qB:1456963200,rB:1460592000,sB:1464134400,tB:1469059200,uB:1472601600,vB:1476230400,wB:1480550400,xB:1485302400,yB:1489017600,zB:1492560000,QC:1496707200,"0B":1500940800,RC:1504569600,"1B":1508198400,"2B":1512518400,"3B":1516752000,"4B":1520294400,"5B":1523923200,"6B":1527552000,"7B":1532390400,"8B":1536019200,"9B":1539648000,AC:1543968000,BC:1548720000,CC:1552348800,DC:1555977600,EC:1559606400,FC:1564444800,GC:1568073600,HC:1571702400,Q:1575936000,H:1580860800,R:1586304000,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272000,a:1621987200,b:1626739200,c:1630368000,d:1632268800,e:1634601600,f:1637020800,g:1641340800,h:1643673600,i:1646092800,j:1648512000,k:1650931200,l:1653350400,m:1655769600,n:1659398400,o:1661817600,p:1664236800,q:1666656000,r:1669680000,s:1673308800,t:1675728000,u:1678147200,v:1680566400,w:1682985600,x:1685404800,y:1689724800,z:1692057600,AB:1696896000,BB:1698710400,CB:1701993600,DB:1705968000,EB:1708387200,FB:1710806400,GB:1713225600,HB:1715644800,IB:1718064000,JB:1721174400,KB:1724112000,LB:1726531200,MB:1728950400,NB:1731369600,OB:1736812800,PB:1738627200,QB:1741046400,RB:1743465600,SB:1745884800,TB:1748304000,I:1750723200,TC:1754352000,IC:null,UC:null,VC:null}},E:{A:{J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0.00402,C:0,L:0.00804,M:0.01206,G:0,yC:0,WC:0,zC:0,"0C":0,"1C":0,"2C":0,XC:0,JC:0.00402,KC:0.00402,"3C":0.02814,"4C":0.03216,"5C":0.03216,YC:0,ZC:0.00804,LC:0.00804,"6C":0.11658,MC:0.02412,aC:0.01608,bC:0.01206,cC:0.02814,dC:0.01206,eC:0.01608,"7C":0.16482,NC:0.00804,fC:0.11256,gC:0.01206,hC:0.01608,iC:0.02814,jC:0.04422,"8C":0.1608,OC:0.0201,kC:0.03618,lC:0.01608,mC:0.0804,nC:0.0603,oC:1.37484,pC:0.01206,"9C":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","yC","WC","J","UB","zC","K","0C","D","1C","E","F","2C","A","XC","B","JC","C","KC","L","3C","M","4C","G","5C","YC","ZC","LC","6C","MC","aC","bC","cC","dC","eC","7C","NC","fC","gC","hC","iC","jC","8C","OC","kC","lC","mC","nC","oC","pC","9C",""],E:"Safari",F:{yC:1205798400,WC:1226534400,J:1244419200,UB:1275868800,zC:1311120000,K:1343174400,"0C":1382400000,D:1382400000,"1C":1410998400,E:1413417600,F:1443657600,"2C":1458518400,A:1474329600,XC:1490572800,B:1505779200,JC:1522281600,C:1537142400,KC:1553472000,L:1568851200,"3C":1585008000,M:1600214400,"4C":1619395200,G:1632096000,"5C":1635292800,YC:1639353600,ZC:1647216000,LC:1652745600,"6C":1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432000,dC:1679875200,eC:1684368000,"7C":1690156800,NC:1695686400,fC:1698192000,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,"8C":1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936000,nC:1743379200,oC:1747008000,pC:null,"9C":null}},F:{A:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,F:0,B:0,C:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:0.00402,iB:0,jB:0,kB:0,lB:0,mB:0,nB:0.00804,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,"0B":0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0,AC:0,BC:0,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0.00402,Z:0.05226,a:0,b:0,c:0,d:0,e:0.02814,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0,u:0,v:0,w:0.00402,x:0,y:0,z:0,AD:0,BD:0,CD:0,DD:0,JC:0,qC:0,ED:0,KC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","F","AD","BD","CD","DD","B","JC","qC","ED","C","KC","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","0B","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","","",""],E:"Opera",F:{"0":1739404800,"1":1393891200,"2":1399334400,"3":1401753600,"4":1405987200,"5":1409616000,"6":1413331200,"7":1417132800,"8":1422316800,"9":1425945600,F:1150761600,AD:1223424000,BD:1251763200,CD:1267488000,DD:1277942400,B:1292457600,JC:1302566400,qC:1309219200,ED:1323129600,C:1323129600,KC:1352073600,G:1372723200,N:1377561600,O:1381104000,P:1386288000,VB:1390867200,WB:1430179200,XB:1433808000,YB:1438646400,ZB:1442448000,aB:1445904000,bB:1449100800,cB:1454371200,dB:1457308800,eB:1462320000,fB:1465344000,gB:1470096000,hB:1474329600,iB:1477267200,jB:1481587200,kB:1486425600,lB:1490054400,mB:1494374400,nB:1498003200,oB:1502236800,pB:1506470400,qB:1510099200,rB:1515024000,sB:1517961600,tB:1521676800,uB:1525910400,vB:1530144000,wB:1534982400,xB:1537833600,yB:1543363200,zB:1548201600,"0B":1554768000,"1B":1561593600,"2B":1566259200,"3B":1570406400,"4B":1573689600,"5B":1578441600,"6B":1583971200,"7B":1587513600,"8B":1592956800,"9B":1595894400,AC:1600128000,BC:1603238400,CC:1613520000,DC:1612224000,EC:1616544000,FC:1619568000,GC:1623715200,HC:1627948800,Q:1631577600,H:1633392000,R:1635984000,SC:1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152000,Z:1660780800,a:1663113600,b:1668816000,c:1668643200,d:1671062400,e:1675209600,f:1677024000,g:1679529600,h:1681948800,i:1684195200,j:1687219200,k:1690329600,l:1692748800,m:1696204800,n:1699920000,o:1699920000,p:1702944000,q:1707264000,r:1710115200,s:1711497600,t:1716336000,u:1719273600,v:1721088000,w:1724284800,x:1727222400,y:1732665600,z:1736294400},D:{F:"o",B:"o",C:"o",AD:"o",BD:"o",CD:"o",DD:"o",JC:"o",qC:"o",ED:"o",KC:"o"}},G:{A:{E:0,WC:0,FD:0,rC:0.0013461,GD:0,HD:0.00673049,ID:0.00403829,JD:0,KD:0.0026922,LD:0.0148071,MD:0.0013461,ND:0.0228837,OD:0.200569,PD:0.00942269,QD:0.0026922,RD:0.082112,SD:0,TD:0.0026922,UD:0.0026922,VD:0.013461,WD:0.0578822,XD:0.0309603,YD:0.026922,YC:0.0215376,ZC:0.0242298,LC:0.0282681,ZD:0.371523,MC:0.0498056,aC:0.095573,bC:0.0498056,cC:0.0942269,dC:0.0201915,eC:0.0376907,aD:0.477865,NC:0.0242298,fC:0.0457673,gC:0.0336525,hC:0.0498056,iC:0.095573,jC:0.173647,bD:0.442866,OC:0.111726,kC:0.234221,lC:0.126533,mC:0.46575,nC:0.301526,oC:9.39442,pC:0.0215376},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","WC","FD","rC","GD","HD","ID","E","JD","KD","LD","MD","ND","OD","PD","QD","RD","SD","TD","UD","VD","WD","XD","YD","YC","ZC","LC","ZD","MC","aC","bC","cC","dC","eC","aD","NC","fC","gC","hC","iC","jC","bD","OC","kC","lC","mC","nC","oC","pC","",""],E:"Safari on iOS",F:{WC:1270252800,FD:1283904000,rC:1299628800,GD:1331078400,HD:1359331200,ID:1394409600,E:1410912000,JD:1413763200,KD:1442361600,LD:1458518400,MD:1473724800,ND:1490572800,OD:1505779200,PD:1522281600,QD:1537142400,RD:1553472000,SD:1568851200,TD:1572220800,UD:1580169600,VD:1585008000,WD:1600214400,XD:1619395200,YD:1632096000,YC:1639353600,ZC:1647216000,LC:1652659200,ZD:1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432000,dC:1679875200,eC:1684368000,aD:1690156800,NC:1694995200,fC:1698192000,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,bD:1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936000,nC:1743379200,oC:1747008000,pC:null}},H:{A:{cD:0.04},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","cD","","",""],E:"Opera Mini",F:{cD:1426464000}},I:{A:{PC:0,J:0,I:0.794067,dD:0,eD:0,fD:0,gD:0.000159068,rC:0.000159068,hD:0,iD:0.000636272},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","dD","eD","fD","PC","J","gD","rC","hD","iD","I","","",""],E:"Android Browser",F:{dD:1256515200,eD:1274313600,fD:1291593600,PC:1298332800,J:1318896000,gD:1341792000,rC:1374624000,hD:1386547200,iD:1401667200,I:1750723200}},J:{A:{D:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","A","","",""],E:"Blackberry Browser",F:{D:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,H:0.95866,JC:0,qC:0,KC:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","JC","qC","C","KC","H","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,JC:1314835200,qC:1318291200,C:1330300800,KC:1349740800,H:1709769600},D:{H:"webkit"}},L:{A:{I:43.5564},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","","",""],E:"Chrome for Android",F:{I:1750723200}},M:{A:{IC:0.3289},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","IC","","",""],E:"Firefox for Android",F:{IC:1750723200}},N:{A:{A:0,B:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{LC:0.81328},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","LC","","",""],E:"UC Browser for Android",F:{LC:1710115200},D:{LC:"webkit"}},P:{A:{"1":0,"2":0.0218021,"3":0.0218021,"4":0.0218021,"5":0.0327031,"6":0.0327031,"7":0.0545052,"8":0.0872083,"9":1.80957,J:0,jD:0,kD:0,lD:0.010901,mD:0,nD:0,XC:0,oD:0,pD:0,qD:0,rD:0,sD:0,MC:0,NC:0,OC:0,tD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","J","jD","kD","lD","mD","nD","XC","oD","pD","qD","rD","sD","MC","NC","OC","tD","1","2","3","4","5","6","7","8","9","","",""],E:"Samsung Internet",F:{"1":1677369600,"2":1684454400,"3":1689292800,"4":1697587200,"5":1711497600,"6":1715126400,"7":1717718400,"8":1725667200,"9":1746057600,J:1461024000,jD:1481846400,kD:1509408000,lD:1528329600,mD:1546128000,nD:1554163200,XC:1567900800,oD:1582588800,pD:1593475200,qD:1605657600,rD:1618531200,sD:1629072000,MC:1640736000,NC:1651708800,OC:1659657600,tD:1667260800}},Q:{A:{uD:0.18538},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uD","","",""],E:"QQ Browser",F:{uD:1710288000}},R:{A:{vD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","vD","","",""],E:"Baidu Browser",F:{vD:1710201600}},S:{A:{wD:0.01196,xD:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","wD","xD","","",""],E:"KaiOS Browser",F:{wD:1527811200,xD:1631664000}}}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/browserVersions.js": -/*!***********************************************************!*\ - !*** ./node_modules/caniuse-lite/data/browserVersions.js ***! - \***********************************************************/ -/***/ ((module) => { - -module.exports={"0":"117","1":"20","2":"21","3":"22","4":"23","5":"24","6":"25","7":"26","8":"27","9":"28",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"80",I:"138",J:"4",K:"6",L:"13",M:"14",N:"16",O:"17",P:"18",Q:"79",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"96",g:"97",h:"98",i:"99",j:"100",k:"101",l:"102",m:"103",n:"104",o:"105",p:"106",q:"107",r:"108",s:"109",t:"110",u:"111",v:"112",w:"113",x:"114",y:"115",z:"116",AB:"118",BB:"119",CB:"120",DB:"121",EB:"122",FB:"123",GB:"124",HB:"125",IB:"126",JB:"127",KB:"128",LB:"129",MB:"130",NB:"131",OB:"132",PB:"133",QB:"134",RB:"135",SB:"136",TB:"137",UB:"5",VB:"19",WB:"29",XB:"30",YB:"31",ZB:"32",aB:"33",bB:"34",cB:"35",dB:"36",eB:"37",fB:"38",gB:"39",hB:"40",iB:"41",jB:"42",kB:"43",lB:"44",mB:"45",nB:"46",oB:"47",pB:"48",qB:"49",rB:"50",sB:"51",tB:"52",uB:"53",vB:"54",wB:"55",xB:"56",yB:"57",zB:"58","0B":"60","1B":"62","2B":"63","3B":"64","4B":"65","5B":"66","6B":"67","7B":"68","8B":"69","9B":"70",AC:"71",BC:"72",CC:"73",DC:"74",EC:"75",FC:"76",GC:"77",HC:"78",IC:"140",JC:"11.1",KC:"12.1",LC:"15.5",MC:"16.0",NC:"17.0",OC:"18.0",PC:"3",QC:"59",RC:"61",SC:"82",TC:"139",UC:"141",VC:"142",WC:"3.2",XC:"10.1",YC:"15.2-15.3",ZC:"15.4",aC:"16.1",bC:"16.2",cC:"16.3",dC:"16.4",eC:"16.5",fC:"17.1",gC:"17.2",hC:"17.3",iC:"17.4",jC:"17.5",kC:"18.1",lC:"18.2",mC:"18.3",nC:"18.4",oC:"18.5-18.6",pC:"26.0",qC:"11.5",rC:"4.2-4.3",sC:"5.5",tC:"2",uC:"143",vC:"144",wC:"3.5",xC:"3.6",yC:"3.1",zC:"5.1","0C":"6.1","1C":"7.1","2C":"9.1","3C":"13.1","4C":"14.1","5C":"15.1","6C":"15.6","7C":"16.6","8C":"17.6","9C":"TP",AD:"9.5-9.6",BD:"10.0-10.1",CD:"10.5",DD:"10.6",ED:"11.6",FD:"4.0-4.1",GD:"5.0-5.1",HD:"6.0-6.1",ID:"7.0-7.1",JD:"8.1-8.4",KD:"9.0-9.2",LD:"9.3",MD:"10.0-10.2",ND:"10.3",OD:"11.0-11.2",PD:"11.3-11.4",QD:"12.0-12.1",RD:"12.2-12.5",SD:"13.0-13.1",TD:"13.2",UD:"13.3",VD:"13.4-13.7",WD:"14.0-14.4",XD:"14.5-14.8",YD:"15.0-15.1",ZD:"15.6-15.8",aD:"16.6-16.7",bD:"17.6-17.7",cD:"all",dD:"2.1",eD:"2.2",fD:"2.3",gD:"4.1",hD:"4.4",iD:"4.4.3-4.4.4",jD:"5.0-5.4",kD:"6.2-6.4",lD:"7.2-7.4",mD:"8.2",nD:"9.2",oD:"11.1-11.2",pD:"12.0",qD:"13.0",rD:"14.0",sD:"15.0",tD:"19.0",uD:"14.9",vD:"13.52",wD:"2.5",xD:"3.0-3.1"}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/browsers.js": -/*!****************************************************!*\ - !*** ./node_modules/caniuse-lite/data/browsers.js ***! - \****************************************************/ -/***/ ((module) => { - -module.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"ios_saf",H:"op_mini",I:"android",J:"bb",K:"op_mob",L:"and_chr",M:"and_ff",N:"ie_mob",O:"and_uc",P:"samsung",Q:"and_qq",R:"baidu",S:"kaios"}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/unpacker/agents.js": -/*!***********************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/unpacker/agents.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const browsers = (__webpack_require__(/*! ./browsers */ "./node_modules/caniuse-lite/dist/unpacker/browsers.js").browsers) -const versions = (__webpack_require__(/*! ./browserVersions */ "./node_modules/caniuse-lite/dist/unpacker/browserVersions.js").browserVersions) -const agentsData = __webpack_require__(/*! ../../data/agents */ "./node_modules/caniuse-lite/data/agents.js") - -function unpackBrowserVersions(versionsData) { - return Object.keys(versionsData).reduce((usage, version) => { - usage[versions[version]] = versionsData[version] - return usage - }, {}) -} - -module.exports.agents = Object.keys(agentsData).reduce((map, key) => { - let versionsData = agentsData[key] - map[browsers[key]] = Object.keys(versionsData).reduce((data, entry) => { - if (entry === 'A') { - data.usage_global = unpackBrowserVersions(versionsData[entry]) - } else if (entry === 'C') { - data.versions = versionsData[entry].reduce((list, version) => { - if (version === '') { - list.push(null) - } else { - list.push(versions[version]) - } - return list - }, []) - } else if (entry === 'D') { - data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]) - } else if (entry === 'E') { - data.browser = versionsData[entry] - } else if (entry === 'F') { - data.release_date = Object.keys(versionsData[entry]).reduce( - (map2, key2) => { - map2[versions[key2]] = versionsData[entry][key2] - return map2 - }, - {} - ) - } else { - // entry is B - data.prefix = versionsData[entry] - } - return data - }, {}) - return map -}, {}) - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/unpacker/browserVersions.js": -/*!********************************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/unpacker/browserVersions.js ***! - \********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports.browserVersions = __webpack_require__(/*! ../../data/browserVersions */ "./node_modules/caniuse-lite/data/browserVersions.js") - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/unpacker/browsers.js": -/*!*************************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/unpacker/browsers.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports.browsers = __webpack_require__(/*! ../../data/browsers */ "./node_modules/caniuse-lite/data/browsers.js") - - -/***/ }), - -/***/ "./node_modules/convert-source-map/index.js": -/*!**************************************************!*\ - !*** ./node_modules/convert-source-map/index.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "commentRegex", ({ - get: function getCommentRegex () { - // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. - return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg; - } -})); - - -Object.defineProperty(exports, "mapFileCommentRegex", ({ - get: function getMapFileCommentRegex () { - // Matches sourceMappingURL in either // or /* comment styles. - return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg; - } -})); - -var decodeBase64; -if (typeof Buffer !== 'undefined') { - if (typeof Buffer.from === 'function') { - decodeBase64 = decodeBase64WithBufferFrom; - } else { - decodeBase64 = decodeBase64WithNewBuffer; - } -} else { - decodeBase64 = decodeBase64WithAtob; -} - -function decodeBase64WithBufferFrom(base64) { - return Buffer.from(base64, 'base64').toString(); -} - -function decodeBase64WithNewBuffer(base64) { - if (typeof value === 'number') { - throw new TypeError('The value to decode must not be of type number.'); - } - return new Buffer(base64, 'base64').toString(); -} - -function decodeBase64WithAtob(base64) { - return decodeURIComponent(escape(atob(base64))); -} - -function stripComment(sm) { - return sm.split(',').pop(); -} - -function readFromFileMap(sm, read) { - var r = exports.mapFileCommentRegex.exec(sm); - // for some odd reason //# .. captures in 1 and /* .. */ in 2 - var filename = r[1] || r[2]; - - try { - var sm = read(filename); - if (sm != null && typeof sm.catch === 'function') { - return sm.catch(throwError); - } else { - return sm; - } - } catch (e) { - throwError(e); - } - - function throwError(e) { - throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack); - } -} - -function Converter (sm, opts) { - opts = opts || {}; - - if (opts.hasComment) { - sm = stripComment(sm); - } - - if (opts.encoding === 'base64') { - sm = decodeBase64(sm); - } else if (opts.encoding === 'uri') { - sm = decodeURIComponent(sm); - } - - if (opts.isJSON || opts.encoding) { - sm = JSON.parse(sm); - } - - this.sourcemap = sm; -} - -Converter.prototype.toJSON = function (space) { - return JSON.stringify(this.sourcemap, null, space); -}; - -if (typeof Buffer !== 'undefined') { - if (typeof Buffer.from === 'function') { - Converter.prototype.toBase64 = encodeBase64WithBufferFrom; - } else { - Converter.prototype.toBase64 = encodeBase64WithNewBuffer; - } -} else { - Converter.prototype.toBase64 = encodeBase64WithBtoa; -} - -function encodeBase64WithBufferFrom() { - var json = this.toJSON(); - return Buffer.from(json, 'utf8').toString('base64'); -} - -function encodeBase64WithNewBuffer() { - var json = this.toJSON(); - if (typeof json === 'number') { - throw new TypeError('The json to encode must not be of type number.'); - } - return new Buffer(json, 'utf8').toString('base64'); -} - -function encodeBase64WithBtoa() { - var json = this.toJSON(); - return btoa(unescape(encodeURIComponent(json))); -} - -Converter.prototype.toURI = function () { - var json = this.toJSON(); - return encodeURIComponent(json); -}; - -Converter.prototype.toComment = function (options) { - var encoding, content, data; - if (options != null && options.encoding === 'uri') { - encoding = ''; - content = this.toURI(); - } else { - encoding = ';base64'; - content = this.toBase64(); - } - data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content; - return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; -}; - -// returns copy instead of original -Converter.prototype.toObject = function () { - return JSON.parse(this.toJSON()); -}; - -Converter.prototype.addProperty = function (key, value) { - if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); - return this.setProperty(key, value); -}; - -Converter.prototype.setProperty = function (key, value) { - this.sourcemap[key] = value; - return this; -}; - -Converter.prototype.getProperty = function (key) { - return this.sourcemap[key]; -}; - -exports.fromObject = function (obj) { - return new Converter(obj); -}; - -exports.fromJSON = function (json) { - return new Converter(json, { isJSON: true }); -}; - -exports.fromURI = function (uri) { - return new Converter(uri, { encoding: 'uri' }); -}; - -exports.fromBase64 = function (base64) { - return new Converter(base64, { encoding: 'base64' }); -}; - -exports.fromComment = function (comment) { - var m, encoding; - comment = comment - .replace(/^\/\*/g, '//') - .replace(/\*\/$/g, ''); - m = exports.commentRegex.exec(comment); - encoding = m && m[4] || 'uri'; - return new Converter(comment, { encoding: encoding, hasComment: true }); -}; - -function makeConverter(sm) { - return new Converter(sm, { isJSON: true }); -} - -exports.fromMapFileComment = function (comment, read) { - if (typeof read === 'string') { - throw new Error( - 'String directory paths are no longer supported with `fromMapFileComment`\n' + - 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' - ) - } - - var sm = readFromFileMap(comment, read); - if (sm != null && typeof sm.then === 'function') { - return sm.then(makeConverter); - } else { - return makeConverter(sm); - } -}; - -// Finds last sourcemap comment in file or returns null if none was found -exports.fromSource = function (content) { - var m = content.match(exports.commentRegex); - return m ? exports.fromComment(m.pop()) : null; -}; - -// Finds last sourcemap comment in file or returns null if none was found -exports.fromMapFileSource = function (content, read) { - if (typeof read === 'string') { - throw new Error( - 'String directory paths are no longer supported with `fromMapFileSource`\n' + - 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' - ) - } - var m = content.match(exports.mapFileCommentRegex); - return m ? exports.fromMapFileComment(m.pop(), read) : null; -}; - -exports.removeComments = function (src) { - return src.replace(exports.commentRegex, ''); -}; - -exports.removeMapFileComments = function (src) { - return src.replace(exports.mapFileCommentRegex, ''); -}; - -exports.generateMapFileComment = function (file, options) { - var data = 'sourceMappingURL=' + file; - return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; -}; - - -/***/ }), - -/***/ "./node_modules/debug/src/browser.js": -/*!*******************************************!*\ - !*** ./node_modules/debug/src/browser.js ***! - \*******************************************/ -/***/ ((module, exports, __webpack_require__) => { - -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - let m; - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - // eslint-disable-next-line no-return-assign - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = __webpack_require__(/*! ./common */ "./node_modules/debug/src/common.js")(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; - - -/***/ }), - -/***/ "./node_modules/debug/src/common.js": -/*!******************************************!*\ - !*** ./node_modules/debug/src/common.js ***! - \******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js"); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - const split = (typeof namespaces === 'string' ? namespaces : '') - .trim() - .replace(/\s+/g, ',') - .split(',') - .filter(Boolean); - - for (const ns of split) { - if (ns[0] === '-') { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - - /** - * Checks if the given string matches a namespace template, honoring - * asterisks as wildcards. - * - * @param {String} search - * @param {String} template - * @return {Boolean} - */ - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { - // Match character or proceed with wildcard - if (template[templateIndex] === '*') { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; // Skip the '*' - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition - // Backtrack to the last '*' and try to match more characters - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; // No match - } - } - - // Handle trailing '*' in template - while (templateIndex < template.length && template[templateIndex] === '*') { - templateIndex++; - } - - return templateIndex === template.length; - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - - return false; - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; - - -/***/ }), - -/***/ "./node_modules/define-data-property/index.js": -/*!****************************************************!*\ - !*** ./node_modules/define-data-property/index.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); - -var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ "./node_modules/es-errors/syntax.js"); -var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); - -var gopd = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); - -/** @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.'); - } -}; - - -/***/ }), - -/***/ "./node_modules/define-properties/index.js": -/*!*************************************************!*\ - !*** ./node_modules/define-properties/index.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var keys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js"); -var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; - -var toStr = Object.prototype.toString; -var concat = Array.prototype.concat; -var defineDataProperty = __webpack_require__(/*! define-data-property */ "./node_modules/define-data-property/index.js"); - -var isFunction = function (fn) { - return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; -}; - -var supportsDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")(); - -var defineProperty = function (object, name, value, predicate) { - if (name in object) { - if (predicate === true) { - if (object[name] === value) { - return; - } - } else if (!isFunction(predicate) || !predicate()) { - return; - } - } - - if (supportsDescriptors) { - defineDataProperty(object, name, value, true); - } else { - defineDataProperty(object, name, value); - } -}; - -var defineProperties = function (object, map) { - var predicates = arguments.length > 2 ? arguments[2] : {}; - var props = keys(map); - if (hasSymbols) { - props = concat.call(props, Object.getOwnPropertySymbols(map)); - } - for (var i = 0; i < props.length; i += 1) { - defineProperty(object, props[i], map[props[i]], predicates[props[i]]); - } -}; - -defineProperties.supportsDescriptors = !!supportsDescriptors; - -module.exports = defineProperties; - - -/***/ }), - -/***/ "./node_modules/dunder-proto/get.js": -/*!******************************************!*\ - !*** ./node_modules/dunder-proto/get.js ***! - \******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var callBind = __webpack_require__(/*! call-bind-apply-helpers */ "./node_modules/call-bind-apply-helpers/index.js"); -var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); - -var hasProtoAccessor; -try { - // eslint-disable-next-line no-extra-parens, no-proto - hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; -} catch (e) { - if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { - throw e; - } -} - -// eslint-disable-next-line no-extra-parens -var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); - -var $Object = Object; -var $getPrototypeOf = $Object.getPrototypeOf; - -/** @type {import('./get')} */ -module.exports = desc && typeof desc.get === 'function' - ? callBind([desc.get]) - : typeof $getPrototypeOf === 'function' - ? /** @type {import('./get')} */ function getDunder(value) { - // eslint-disable-next-line eqeqeq - return $getPrototypeOf(value == null ? value : $Object(value)); - } - : false; - - -/***/ }), - -/***/ "./node_modules/electron-to-chromium/versions.js": -/*!*******************************************************!*\ - !*** ./node_modules/electron-to-chromium/versions.js ***! - \*******************************************************/ -/***/ ((module) => { - -module.exports = { - "0.20": "39", - "0.21": "41", - "0.22": "41", - "0.23": "41", - "0.24": "41", - "0.25": "42", - "0.26": "42", - "0.27": "43", - "0.28": "43", - "0.29": "43", - "0.30": "44", - "0.31": "45", - "0.32": "45", - "0.33": "45", - "0.34": "45", - "0.35": "45", - "0.36": "47", - "0.37": "49", - "1.0": "49", - "1.1": "50", - "1.2": "51", - "1.3": "52", - "1.4": "53", - "1.5": "54", - "1.6": "56", - "1.7": "58", - "1.8": "59", - "2.0": "61", - "2.1": "61", - "3.0": "66", - "3.1": "66", - "4.0": "69", - "4.1": "69", - "4.2": "69", - "5.0": "73", - "6.0": "76", - "6.1": "76", - "7.0": "78", - "7.1": "78", - "7.2": "78", - "7.3": "78", - "8.0": "80", - "8.1": "80", - "8.2": "80", - "8.3": "80", - "8.4": "80", - "8.5": "80", - "9.0": "83", - "9.1": "83", - "9.2": "83", - "9.3": "83", - "9.4": "83", - "10.0": "85", - "10.1": "85", - "10.2": "85", - "10.3": "85", - "10.4": "85", - "11.0": "87", - "11.1": "87", - "11.2": "87", - "11.3": "87", - "11.4": "87", - "11.5": "87", - "12.0": "89", - "12.1": "89", - "12.2": "89", - "13.0": "91", - "13.1": "91", - "13.2": "91", - "13.3": "91", - "13.4": "91", - "13.5": "91", - "13.6": "91", - "14.0": "93", - "14.1": "93", - "14.2": "93", - "15.0": "94", - "15.1": "94", - "15.2": "94", - "15.3": "94", - "15.4": "94", - "15.5": "94", - "16.0": "96", - "16.1": "96", - "16.2": "96", - "17.0": "98", - "17.1": "98", - "17.2": "98", - "17.3": "98", - "17.4": "98", - "18.0": "100", - "18.1": "100", - "18.2": "100", - "18.3": "100", - "19.0": "102", - "19.1": "102", - "20.0": "104", - "20.1": "104", - "20.2": "104", - "20.3": "104", - "21.0": "106", - "21.1": "106", - "21.2": "106", - "21.3": "106", - "21.4": "106", - "22.0": "108", - "22.1": "108", - "22.2": "108", - "22.3": "108", - "23.0": "110", - "23.1": "110", - "23.2": "110", - "23.3": "110", - "24.0": "112", - "24.1": "112", - "24.2": "112", - "24.3": "112", - "24.4": "112", - "24.5": "112", - "24.6": "112", - "24.7": "112", - "24.8": "112", - "25.0": "114", - "25.1": "114", - "25.2": "114", - "25.3": "114", - "25.4": "114", - "25.5": "114", - "25.6": "114", - "25.7": "114", - "25.8": "114", - "25.9": "114", - "26.0": "116", - "26.1": "116", - "26.2": "116", - "26.3": "116", - "26.4": "116", - "26.5": "116", - "26.6": "116", - "27.0": "118", - "27.1": "118", - "27.2": "118", - "27.3": "118", - "28.0": "120", - "28.1": "120", - "28.2": "120", - "28.3": "120", - "29.0": "122", - "29.1": "122", - "29.2": "122", - "29.3": "122", - "29.4": "122", - "30.0": "124", - "30.1": "124", - "30.2": "124", - "30.3": "124", - "30.4": "124", - "30.5": "124", - "31.0": "126", - "31.1": "126", - "31.2": "126", - "31.3": "126", - "31.4": "126", - "31.5": "126", - "31.6": "126", - "31.7": "126", - "32.0": "128", - "32.1": "128", - "32.2": "128", - "32.3": "128", - "33.0": "130", - "33.1": "130", - "33.2": "130", - "33.3": "130", - "33.4": "130", - "34.0": "132", - "34.1": "132", - "34.2": "132", - "34.3": "132", - "34.4": "132", - "34.5": "132", - "35.0": "134", - "35.1": "134", - "35.2": "134", - "35.3": "134", - "35.4": "134", - "35.5": "134", - "35.6": "134", - "35.7": "134", - "36.0": "136", - "36.1": "136", - "36.2": "136", - "36.3": "136", - "36.4": "136", - "36.5": "136", - "36.6": "136", - "36.7": "136", - "36.8": "136", - "37.0": "138", - "37.1": "138", - "37.2": "138", - "37.3": "138", - "38.0": "140" -}; - -/***/ }), - -/***/ "./node_modules/es-define-property/index.js": -/*!**************************************************!*\ - !*** ./node_modules/es-define-property/index.js ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('.')} */ -var $defineProperty = Object.defineProperty || false; -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = false; - } -} - -module.exports = $defineProperty; - - -/***/ }), - -/***/ "./node_modules/es-errors/eval.js": -/*!****************************************!*\ - !*** ./node_modules/es-errors/eval.js ***! - \****************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./eval')} */ -module.exports = EvalError; - - -/***/ }), - -/***/ "./node_modules/es-errors/index.js": -/*!*****************************************!*\ - !*** ./node_modules/es-errors/index.js ***! - \*****************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('.')} */ -module.exports = Error; - - -/***/ }), - -/***/ "./node_modules/es-errors/range.js": -/*!*****************************************!*\ - !*** ./node_modules/es-errors/range.js ***! - \*****************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./range')} */ -module.exports = RangeError; - - -/***/ }), - -/***/ "./node_modules/es-errors/ref.js": -/*!***************************************!*\ - !*** ./node_modules/es-errors/ref.js ***! - \***************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./ref')} */ -module.exports = ReferenceError; - - -/***/ }), - -/***/ "./node_modules/es-errors/syntax.js": -/*!******************************************!*\ - !*** ./node_modules/es-errors/syntax.js ***! - \******************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./syntax')} */ -module.exports = SyntaxError; - - -/***/ }), - -/***/ "./node_modules/es-errors/type.js": -/*!****************************************!*\ - !*** ./node_modules/es-errors/type.js ***! - \****************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./type')} */ -module.exports = TypeError; - - -/***/ }), - -/***/ "./node_modules/es-errors/uri.js": -/*!***************************************!*\ - !*** ./node_modules/es-errors/uri.js ***! - \***************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./uri')} */ -module.exports = URIError; - - -/***/ }), - -/***/ "./node_modules/es-object-atoms/index.js": -/*!***********************************************!*\ - !*** ./node_modules/es-object-atoms/index.js ***! - \***********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('.')} */ -module.exports = Object; - - -/***/ }), - -/***/ "./node_modules/esutils/lib/ast.js": -/*!*****************************************!*\ - !*** ./node_modules/esutils/lib/ast.js ***! - \*****************************************/ -/***/ ((module) => { - -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - function isExpression(node) { - if (node == null) { return false; } - switch (node.type) { - case 'ArrayExpression': - case 'AssignmentExpression': - case 'BinaryExpression': - case 'CallExpression': - case 'ConditionalExpression': - case 'FunctionExpression': - case 'Identifier': - case 'Literal': - case 'LogicalExpression': - case 'MemberExpression': - case 'NewExpression': - case 'ObjectExpression': - case 'SequenceExpression': - case 'ThisExpression': - case 'UnaryExpression': - case 'UpdateExpression': - return true; - } - return false; - } - - function isIterationStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'DoWhileStatement': - case 'ForInStatement': - case 'ForStatement': - case 'WhileStatement': - return true; - } - return false; - } - - function isStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'BlockStatement': - case 'BreakStatement': - case 'ContinueStatement': - case 'DebuggerStatement': - case 'DoWhileStatement': - case 'EmptyStatement': - case 'ExpressionStatement': - case 'ForInStatement': - case 'ForStatement': - case 'IfStatement': - case 'LabeledStatement': - case 'ReturnStatement': - case 'SwitchStatement': - case 'ThrowStatement': - case 'TryStatement': - case 'VariableDeclaration': - case 'WhileStatement': - case 'WithStatement': - return true; - } - return false; - } - - function isSourceElement(node) { - return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; - } - - function trailingStatement(node) { - switch (node.type) { - case 'IfStatement': - if (node.alternate != null) { - return node.alternate; - } - return node.consequent; - - case 'LabeledStatement': - case 'ForStatement': - case 'ForInStatement': - case 'WhileStatement': - case 'WithStatement': - return node.body; - } - return null; - } - - function isProblematicIfStatement(node) { - var current; - - if (node.type !== 'IfStatement') { - return false; - } - if (node.alternate == null) { - return false; - } - current = node.consequent; - do { - if (current.type === 'IfStatement') { - if (current.alternate == null) { - return true; - } - } - current = trailingStatement(current); - } while (current); - - return false; - } - - module.exports = { - isExpression: isExpression, - isStatement: isStatement, - isIterationStatement: isIterationStatement, - isSourceElement: isSourceElement, - isProblematicIfStatement: isProblematicIfStatement, - - trailingStatement: trailingStatement - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ "./node_modules/esutils/lib/code.js": -/*!******************************************!*\ - !*** ./node_modules/esutils/lib/code.js ***! - \******************************************/ -/***/ ((module) => { - -/* - Copyright (C) 2013-2014 Yusuke Suzuki - Copyright (C) 2014 Ivan Nikulin - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; - - // See `tools/generate-identifier-regex.js`. - ES5Regex = { - // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]/, - // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ - }; - - ES6Regex = { - // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - - function isDecimalDigit(ch) { - return 0x30 <= ch && ch <= 0x39; // 0..9 - } - - function isHexDigit(ch) { - return 0x30 <= ch && ch <= 0x39 || // 0..9 - 0x61 <= ch && ch <= 0x66 || // a..f - 0x41 <= ch && ch <= 0x46; // A..F - } - - function isOctalDigit(ch) { - return ch >= 0x30 && ch <= 0x37; // 0..7 - } - - // 7.2 White Space - - NON_ASCII_WHITESPACES = [ - 0x1680, - 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, - 0x202F, 0x205F, - 0x3000, - 0xFEFF - ]; - - function isWhiteSpace(ch) { - return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || - ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; - } - - // 7.3 Line Terminators - - function isLineTerminator(ch) { - return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; - } - - // 7.6 Identifier Names and Identifiers - - function fromCodePoint(cp) { - if (cp <= 0xFFFF) { return String.fromCharCode(cp); } - var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); - var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); - return cu1 + cu2; - } - - IDENTIFIER_START = new Array(0x80); - for(ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_START[ch] = - ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z - ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) - } - - IDENTIFIER_PART = new Array(0x80); - for(ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_PART[ch] = - ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z - ch >= 0x30 && ch <= 0x39 || // 0..9 - ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) - } - - function isIdentifierStartES5(ch) { - return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); - } - - function isIdentifierPartES5(ch) { - return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); - } - - function isIdentifierStartES6(ch) { - return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); - } - - function isIdentifierPartES6(ch) { - return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); - } - - module.exports = { - isDecimalDigit: isDecimalDigit, - isHexDigit: isHexDigit, - isOctalDigit: isOctalDigit, - isWhiteSpace: isWhiteSpace, - isLineTerminator: isLineTerminator, - isIdentifierStartES5: isIdentifierStartES5, - isIdentifierPartES5: isIdentifierPartES5, - isIdentifierStartES6: isIdentifierStartES6, - isIdentifierPartES6: isIdentifierPartES6 - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ "./node_modules/esutils/lib/keyword.js": -/*!*********************************************!*\ - !*** ./node_modules/esutils/lib/keyword.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - var code = __webpack_require__(/*! ./code */ "./node_modules/esutils/lib/code.js"); - - function isStrictModeReservedWordES6(id) { - switch (id) { - case 'implements': - case 'interface': - case 'package': - case 'private': - case 'protected': - case 'public': - case 'static': - case 'let': - return true; - default: - return false; - } - } - - function isKeywordES5(id, strict) { - // yield should not be treated as keyword under non-strict mode. - if (!strict && id === 'yield') { - return false; - } - return isKeywordES6(id, strict); - } - - function isKeywordES6(id, strict) { - if (strict && isStrictModeReservedWordES6(id)) { - return true; - } - - switch (id.length) { - case 2: - return (id === 'if') || (id === 'in') || (id === 'do'); - case 3: - return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - case 4: - return (id === 'this') || (id === 'else') || (id === 'case') || - (id === 'void') || (id === 'with') || (id === 'enum'); - case 5: - return (id === 'while') || (id === 'break') || (id === 'catch') || - (id === 'throw') || (id === 'const') || (id === 'yield') || - (id === 'class') || (id === 'super'); - case 6: - return (id === 'return') || (id === 'typeof') || (id === 'delete') || - (id === 'switch') || (id === 'export') || (id === 'import'); - case 7: - return (id === 'default') || (id === 'finally') || (id === 'extends'); - case 8: - return (id === 'function') || (id === 'continue') || (id === 'debugger'); - case 10: - return (id === 'instanceof'); - default: - return false; - } - } - - function isReservedWordES5(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); - } - - function isReservedWordES6(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); - } - - function isRestrictedWord(id) { - return id === 'eval' || id === 'arguments'; - } - - function isIdentifierNameES5(id) { - var i, iz, ch; - - if (id.length === 0) { return false; } - - ch = id.charCodeAt(0); - if (!code.isIdentifierStartES5(ch)) { - return false; - } - - for (i = 1, iz = id.length; i < iz; ++i) { - ch = id.charCodeAt(i); - if (!code.isIdentifierPartES5(ch)) { - return false; - } - } - return true; - } - - function decodeUtf16(lead, trail) { - return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; - } - - function isIdentifierNameES6(id) { - var i, iz, ch, lowCh, check; - - if (id.length === 0) { return false; } - - check = code.isIdentifierStartES6; - for (i = 0, iz = id.length; i < iz; ++i) { - ch = id.charCodeAt(i); - if (0xD800 <= ch && ch <= 0xDBFF) { - ++i; - if (i >= iz) { return false; } - lowCh = id.charCodeAt(i); - if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { - return false; - } - ch = decodeUtf16(ch, lowCh); - } - if (!check(ch)) { - return false; - } - check = code.isIdentifierPartES6; - } - return true; - } - - function isIdentifierES5(id, strict) { - return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); - } - - function isIdentifierES6(id, strict) { - return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); - } - - module.exports = { - isKeywordES5: isKeywordES5, - isKeywordES6: isKeywordES6, - isReservedWordES5: isReservedWordES5, - isReservedWordES6: isReservedWordES6, - isRestrictedWord: isRestrictedWord, - isIdentifierNameES5: isIdentifierNameES5, - isIdentifierNameES6: isIdentifierNameES6, - isIdentifierES5: isIdentifierES5, - isIdentifierES6: isIdentifierES6 - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ "./node_modules/esutils/lib/utils.js": -/*!*******************************************!*\ - !*** ./node_modules/esutils/lib/utils.js ***! - \*******************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -(function () { - 'use strict'; - - exports.ast = __webpack_require__(/*! ./ast */ "./node_modules/esutils/lib/ast.js"); - exports.code = __webpack_require__(/*! ./code */ "./node_modules/esutils/lib/code.js"); - exports.keyword = __webpack_require__(/*! ./keyword */ "./node_modules/esutils/lib/keyword.js"); -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ "./node_modules/for-each/index.js": -/*!****************************************!*\ - !*** ./node_modules/for-each/index.js ***! - \****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js"); - -var toStr = Object.prototype.toString; -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** @type {(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */ -var forEachArray = function forEachArray(array, iterator, receiver) { - for (var i = 0, len = array.length; i < len; i++) { - if (hasOwnProperty.call(array, i)) { - if (receiver == null) { - iterator(array[i], i, array); - } else { - iterator.call(receiver, array[i], i, array); - } - } - } -}; - -/** @type {(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */ -var forEachString = function forEachString(string, iterator, receiver) { - for (var i = 0, len = string.length; i < len; i++) { - // no such thing as a sparse string. - if (receiver == null) { - iterator(string.charAt(i), i, string); - } else { - iterator.call(receiver, string.charAt(i), i, string); - } - } -}; - -/** @type {(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */ -var forEachObject = function forEachObject(object, iterator, receiver) { - for (var k in object) { - if (hasOwnProperty.call(object, k)) { - if (receiver == null) { - iterator(object[k], k, object); - } else { - iterator.call(receiver, object[k], k, object); - } - } - } -}; - -/** @type {(x: unknown) => x is readonly unknown[]} */ -function isArray(x) { - return toStr.call(x) === '[object Array]'; -} - -/** @type {import('.')._internal} */ -module.exports = function forEach(list, iterator, thisArg) { - if (!isCallable(iterator)) { - throw new TypeError('iterator must be a function'); - } - - var receiver; - if (arguments.length >= 3) { - receiver = thisArg; - } - - if (isArray(list)) { - forEachArray(list, iterator, receiver); - } else if (typeof list === 'string') { - forEachString(list, iterator, receiver); - } else { - forEachObject(list, iterator, receiver); - } -}; - - -/***/ }), - -/***/ "./node_modules/function-bind/implementation.js": -/*!******************************************************!*\ - !*** ./node_modules/function-bind/implementation.js ***! - \******************************************************/ -/***/ ((module) => { - -"use strict"; - - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -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.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) - ); - - }; - - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = '$' + i; - } - - bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; - - -/***/ }), - -/***/ "./node_modules/function-bind/index.js": -/*!*********************************************!*\ - !*** ./node_modules/function-bind/index.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function-bind/implementation.js"); - -module.exports = Function.prototype.bind || implementation; - - -/***/ }), - -/***/ "./node_modules/gensync/index.js": -/*!***************************************!*\ - !*** ./node_modules/gensync/index.js ***! - \***************************************/ -/***/ ((module) => { - -"use strict"; - - -// These use the global symbol registry so that multiple copies of this -// library can work together in case they are not deduped. -const GENSYNC_START = Symbol.for("gensync:v1:start"); -const GENSYNC_SUSPEND = Symbol.for("gensync:v1:suspend"); - -const GENSYNC_EXPECTED_START = "GENSYNC_EXPECTED_START"; -const GENSYNC_EXPECTED_SUSPEND = "GENSYNC_EXPECTED_SUSPEND"; -const GENSYNC_OPTIONS_ERROR = "GENSYNC_OPTIONS_ERROR"; -const GENSYNC_RACE_NONEMPTY = "GENSYNC_RACE_NONEMPTY"; -const GENSYNC_ERRBACK_NO_CALLBACK = "GENSYNC_ERRBACK_NO_CALLBACK"; - -module.exports = Object.assign( - function gensync(optsOrFn) { - let genFn = optsOrFn; - if (typeof optsOrFn !== "function") { - genFn = newGenerator(optsOrFn); - } else { - genFn = wrapGenerator(optsOrFn); - } - - return Object.assign(genFn, makeFunctionAPI(genFn)); - }, - { - all: buildOperation({ - name: "all", - arity: 1, - sync: function(args) { - const items = Array.from(args[0]); - return items.map(item => evaluateSync(item)); - }, - async: function(args, resolve, reject) { - const items = Array.from(args[0]); - - if (items.length === 0) { - Promise.resolve().then(() => resolve([])); - return; - } - - let count = 0; - const results = items.map(() => undefined); - items.forEach((item, i) => { - evaluateAsync( - item, - val => { - results[i] = val; - count += 1; - - if (count === results.length) resolve(results); - }, - reject - ); - }); - }, - }), - race: buildOperation({ - name: "race", - arity: 1, - sync: function(args) { - const items = Array.from(args[0]); - if (items.length === 0) { - throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY); - } - - return evaluateSync(items[0]); - }, - async: function(args, resolve, reject) { - const items = Array.from(args[0]); - if (items.length === 0) { - throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY); - } - - for (const item of items) { - evaluateAsync(item, resolve, reject); - } - }, - }), - } -); - -/** - * Given a generator function, return the standard API object that executes - * the generator and calls the callbacks. - */ -function makeFunctionAPI(genFn) { - const fns = { - sync: function(...args) { - return evaluateSync(genFn.apply(this, args)); - }, - async: function(...args) { - return new Promise((resolve, reject) => { - evaluateAsync(genFn.apply(this, args), resolve, reject); - }); - }, - errback: function(...args) { - const cb = args.pop(); - if (typeof cb !== "function") { - throw makeError( - "Asynchronous function called without callback", - GENSYNC_ERRBACK_NO_CALLBACK - ); - } - - let gen; - try { - gen = genFn.apply(this, args); - } catch (err) { - cb(err); - return; - } - - evaluateAsync(gen, val => cb(undefined, val), err => cb(err)); - }, - }; - return fns; -} - -function assertTypeof(type, name, value, allowUndefined) { - if ( - typeof value === type || - (allowUndefined && typeof value === "undefined") - ) { - return; - } - - let msg; - if (allowUndefined) { - msg = `Expected opts.${name} to be either a ${type}, or undefined.`; - } else { - msg = `Expected opts.${name} to be a ${type}.`; - } - - throw makeError(msg, GENSYNC_OPTIONS_ERROR); -} -function makeError(msg, code) { - return Object.assign(new Error(msg), { code }); -} - -/** - * Given an options object, return a new generator that dispatches the - * correct handler based on sync or async execution. - */ -function newGenerator({ name, arity, sync, async, errback }) { - assertTypeof("string", "name", name, true /* allowUndefined */); - assertTypeof("number", "arity", arity, true /* allowUndefined */); - assertTypeof("function", "sync", sync); - assertTypeof("function", "async", async, true /* allowUndefined */); - assertTypeof("function", "errback", errback, true /* allowUndefined */); - if (async && errback) { - throw makeError( - "Expected one of either opts.async or opts.errback, but got _both_.", - GENSYNC_OPTIONS_ERROR - ); - } - - if (typeof name !== "string") { - let fnName; - if (errback && errback.name && errback.name !== "errback") { - fnName = errback.name; - } - if (async && async.name && async.name !== "async") { - fnName = async.name.replace(/Async$/, ""); - } - if (sync && sync.name && sync.name !== "sync") { - fnName = sync.name.replace(/Sync$/, ""); - } - - if (typeof fnName === "string") { - name = fnName; - } - } - - if (typeof arity !== "number") { - arity = sync.length; - } - - return buildOperation({ - name, - arity, - sync: function(args) { - return sync.apply(this, args); - }, - async: function(args, resolve, reject) { - if (async) { - async.apply(this, args).then(resolve, reject); - } else if (errback) { - errback.call(this, ...args, (err, value) => { - if (err == null) resolve(value); - else reject(err); - }); - } else { - resolve(sync.apply(this, args)); - } - }, - }); -} - -function wrapGenerator(genFn) { - return setFunctionMetadata(genFn.name, genFn.length, function(...args) { - return genFn.apply(this, args); - }); -} - -function buildOperation({ name, arity, sync, async }) { - return setFunctionMetadata(name, arity, function*(...args) { - const resume = yield GENSYNC_START; - if (!resume) { - // Break the tail call to avoid a bug in V8 v6.X with --harmony enabled. - const res = sync.call(this, args); - return res; - } - - let result; - try { - async.call( - this, - args, - value => { - if (result) return; - - result = { value }; - resume(); - }, - err => { - if (result) return; - - result = { err }; - resume(); - } - ); - } catch (err) { - result = { err }; - resume(); - } - - // Suspend until the callbacks run. Will resume synchronously if the - // callback was already called. - yield GENSYNC_SUSPEND; - - if (result.hasOwnProperty("err")) { - throw result.err; - } - - return result.value; - }); -} - -function evaluateSync(gen) { - let value; - while (!({ value } = gen.next()).done) { - assertStart(value, gen); - } - return value; -} - -function evaluateAsync(gen, resolve, reject) { - (function step() { - try { - let value; - while (!({ value } = gen.next()).done) { - assertStart(value, gen); - - // If this throws, it is considered to have broken the contract - // established for async handlers. If these handlers are called - // synchronously, it is also considered bad behavior. - let sync = true; - let didSyncResume = false; - const out = gen.next(() => { - if (sync) { - didSyncResume = true; - } else { - step(); - } - }); - sync = false; - - assertSuspend(out, gen); - - if (!didSyncResume) { - // Callback wasn't called synchronously, so break out of the loop - // and let it call 'step' later. - return; - } - } - - return resolve(value); - } catch (err) { - return reject(err); - } - })(); -} - -function assertStart(value, gen) { - if (value === GENSYNC_START) return; - - throwError( - gen, - makeError( - `Got unexpected yielded value in gensync generator: ${JSON.stringify( - value - )}. Did you perhaps mean to use 'yield*' instead of 'yield'?`, - GENSYNC_EXPECTED_START - ) - ); -} -function assertSuspend({ value, done }, gen) { - if (!done && value === GENSYNC_SUSPEND) return; - - throwError( - gen, - makeError( - done - ? "Unexpected generator completion. If you get this, it is probably a gensync bug." - : `Expected GENSYNC_SUSPEND, got ${JSON.stringify( - value - )}. If you get this, it is probably a gensync bug.`, - GENSYNC_EXPECTED_SUSPEND - ) - ); -} - -function throwError(gen, err) { - // Call `.throw` so that users can step in a debugger to easily see which - // 'yield' passed an unexpected value. If the `.throw` call didn't throw - // back to the generator, we explicitly do it to stop the error - // from being swallowed by user code try/catches. - if (gen.throw) gen.throw(err); - throw err; -} - -function isIterable(value) { - return ( - !!value && - (typeof value === "object" || typeof value === "function") && - !value[Symbol.iterator] - ); -} - -function setFunctionMetadata(name, arity, fn) { - if (typeof name === "string") { - // This should always work on the supported Node versions, but for the - // sake of users that are compiling to older versions, we check for - // configurability so we don't throw. - const nameDesc = Object.getOwnPropertyDescriptor(fn, "name"); - if (!nameDesc || nameDesc.configurable) { - Object.defineProperty( - fn, - "name", - Object.assign(nameDesc || {}, { - configurable: true, - value: name, - }) - ); - } - } - - if (typeof arity === "number") { - const lengthDesc = Object.getOwnPropertyDescriptor(fn, "length"); - if (!lengthDesc || lengthDesc.configurable) { - Object.defineProperty( - fn, - "length", - Object.assign(lengthDesc || {}, { - configurable: true, - value: arity, - }) - ); - } - } - - return fn; -} - - -/***/ }), - -/***/ "./node_modules/get-intrinsic/index.js": -/*!*********************************************!*\ - !*** ./node_modules/get-intrinsic/index.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var undefined; - -var $Object = __webpack_require__(/*! es-object-atoms */ "./node_modules/es-object-atoms/index.js"); - -var $Error = __webpack_require__(/*! es-errors */ "./node_modules/es-errors/index.js"); -var $EvalError = __webpack_require__(/*! es-errors/eval */ "./node_modules/es-errors/eval.js"); -var $RangeError = __webpack_require__(/*! es-errors/range */ "./node_modules/es-errors/range.js"); -var $ReferenceError = __webpack_require__(/*! es-errors/ref */ "./node_modules/es-errors/ref.js"); -var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ "./node_modules/es-errors/syntax.js"); -var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); -var $URIError = __webpack_require__(/*! es-errors/uri */ "./node_modules/es-errors/uri.js"); - -var abs = __webpack_require__(/*! math-intrinsics/abs */ "./node_modules/math-intrinsics/abs.js"); -var floor = __webpack_require__(/*! math-intrinsics/floor */ "./node_modules/math-intrinsics/floor.js"); -var max = __webpack_require__(/*! math-intrinsics/max */ "./node_modules/math-intrinsics/max.js"); -var min = __webpack_require__(/*! math-intrinsics/min */ "./node_modules/math-intrinsics/min.js"); -var pow = __webpack_require__(/*! math-intrinsics/pow */ "./node_modules/math-intrinsics/pow.js"); -var round = __webpack_require__(/*! math-intrinsics/round */ "./node_modules/math-intrinsics/round.js"); -var sign = __webpack_require__(/*! math-intrinsics/sign */ "./node_modules/math-intrinsics/sign.js"); - -var $Function = Function; - -// eslint-disable-next-line consistent-return -var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); - } catch (e) {} -}; - -var $gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); -var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); - -var throwTypeError = function () { - throw new $TypeError(); -}; -var ThrowTypeError = $gOPD - ? (function () { - try { - // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties - arguments.callee; // IE 8 does not throw here - return throwTypeError; - } catch (calleeThrows) { - try { - // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') - return $gOPD(arguments, 'callee').get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }()) - : throwTypeError; - -var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")(); - -var getProto = __webpack_require__(/*! get-proto */ "./node_modules/get-proto/index.js"); -var $ObjectGPO = __webpack_require__(/*! get-proto/Object.getPrototypeOf */ "./node_modules/get-proto/Object.getPrototypeOf.js"); -var $ReflectGPO = __webpack_require__(/*! get-proto/Reflect.getPrototypeOf */ "./node_modules/get-proto/Reflect.getPrototypeOf.js"); - -var $apply = __webpack_require__(/*! call-bind-apply-helpers/functionApply */ "./node_modules/call-bind-apply-helpers/functionApply.js"); -var $call = __webpack_require__(/*! call-bind-apply-helpers/functionCall */ "./node_modules/call-bind-apply-helpers/functionCall.js"); - -var needsEval = {}; - -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 ? getProto([][Symbol.iterator]()) : undefined, - '%AsyncFromSyncIteratorPrototype%': undefined, - '%AsyncFunction%': needsEval, - '%AsyncGenerator%': needsEval, - '%AsyncGeneratorFunction%': needsEval, - '%AsyncIteratorPrototype%': needsEval, - '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, - '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, - '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, - '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, - '%Boolean%': Boolean, - '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, - '%Date%': Date, - '%decodeURI%': decodeURI, - '%decodeURIComponent%': decodeURIComponent, - '%encodeURI%': encodeURI, - '%encodeURIComponent%': encodeURIComponent, - '%Error%': $Error, - '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': $EvalError, - '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, - '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, - '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, - '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, - '%Function%': $Function, - '%GeneratorFunction%': needsEval, - '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, - '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, - '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, - '%isFinite%': isFinite, - '%isNaN%': isNaN, - '%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 || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), - '%Math%': Math, - '%Number%': Number, - '%Object%': $Object, - '%Object.getOwnPropertyDescriptor%': $gOPD, - '%parseFloat%': parseFloat, - '%parseInt%': parseInt, - '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, - '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': $RangeError, - '%ReferenceError%': $ReferenceError, - '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, - '%RegExp%': RegExp, - '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), - '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, - '%String%': String, - '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, - '%Symbol%': hasSymbols ? Symbol : undefined, - '%SyntaxError%': $SyntaxError, - '%ThrowTypeError%': ThrowTypeError, - '%TypedArray%': TypedArray, - '%TypeError%': $TypeError, - '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, - '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, - '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, - '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': $URIError, - '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, - '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, - - '%Function.prototype.call%': $call, - '%Function.prototype.apply%': $apply, - '%Object.defineProperty%': $defineProperty, - '%Object.getPrototypeOf%': $ObjectGPO, - '%Math.abs%': abs, - '%Math.floor%': floor, - '%Math.max%': max, - '%Math.min%': min, - '%Math.pow%': pow, - '%Math.round%': round, - '%Math.sign%': sign, - '%Reflect.getPrototypeOf%': $ReflectGPO -}; - -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) { - var value; - if (name === '%AsyncFunction%') { - value = getEvalledConstructor('async function () {}'); - } else if (name === '%GeneratorFunction%') { - value = getEvalledConstructor('function* () {}'); - } else if (name === '%AsyncGeneratorFunction%') { - value = getEvalledConstructor('async function* () {}'); - } else if (name === '%AsyncGenerator%') { - var fn = doEval('%AsyncGeneratorFunction%'); - if (fn) { - value = fn.prototype; - } - } else if (name === '%AsyncIteratorPrototype%') { - var gen = doEval('%AsyncGenerator%'); - if (gen && getProto) { - value = getProto(gen.prototype); - } - } - - INTRINSICS[name] = value; - - return value; -}; - -var LEGACY_ALIASES = { - __proto__: null, - '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], - '%ArrayPrototype%': ['Array', 'prototype'], - '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], - '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], - '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], - '%ArrayProto_values%': ['Array', 'prototype', 'values'], - '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], - '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], - '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], - '%BooleanPrototype%': ['Boolean', 'prototype'], - '%DataViewPrototype%': ['DataView', 'prototype'], - '%DatePrototype%': ['Date', 'prototype'], - '%ErrorPrototype%': ['Error', 'prototype'], - '%EvalErrorPrototype%': ['EvalError', 'prototype'], - '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], - '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], - '%FunctionPrototype%': ['Function', 'prototype'], - '%Generator%': ['GeneratorFunction', 'prototype'], - '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], - '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], - '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], - '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], - '%JSONParse%': ['JSON', 'parse'], - '%JSONStringify%': ['JSON', 'stringify'], - '%MapPrototype%': ['Map', 'prototype'], - '%NumberPrototype%': ['Number', 'prototype'], - '%ObjectPrototype%': ['Object', 'prototype'], - '%ObjProto_toString%': ['Object', 'prototype', 'toString'], - '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], - '%PromisePrototype%': ['Promise', 'prototype'], - '%PromiseProto_then%': ['Promise', 'prototype', 'then'], - '%Promise_all%': ['Promise', 'all'], - '%Promise_reject%': ['Promise', 'reject'], - '%Promise_resolve%': ['Promise', 'resolve'], - '%RangeErrorPrototype%': ['RangeError', 'prototype'], - '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], - '%RegExpPrototype%': ['RegExp', 'prototype'], - '%SetPrototype%': ['Set', 'prototype'], - '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], - '%StringPrototype%': ['String', 'prototype'], - '%SymbolPrototype%': ['Symbol', 'prototype'], - '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], - '%TypedArrayPrototype%': ['TypedArray', 'prototype'], - '%TypeErrorPrototype%': ['TypeError', 'prototype'], - '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], - '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], - '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], - '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], - '%URIErrorPrototype%': ['URIError', 'prototype'], - '%WeakMapPrototype%': ['WeakMap', 'prototype'], - '%WeakSetPrototype%': ['WeakSet', 'prototype'] -}; - -var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); -var hasOwn = __webpack_require__(/*! hasown */ "./node_modules/hasown/index.js"); -var $concat = bind.call($call, Array.prototype.concat); -var $spliceApply = bind.call($apply, Array.prototype.splice); -var $replace = bind.call($call, String.prototype.replace); -var $strSlice = bind.call($call, String.prototype.slice); -var $exec = bind.call($call, RegExp.prototype.exec); - -/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ -var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; -var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ -var stringToPath = function stringToPath(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === '%' && last !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); - } else if (last === '%' && first !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; - }); - return result; -}; -/* end adaptation */ - -var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = '%' + alias[0] + '%'; - } - - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === 'undefined' && !allowMissing) { - throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); - } - - return { - alias: alias, - name: intrinsicName, - value: value - }; - } - - throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); -}; - -module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== 'string' || name.length === 0) { - throw new $TypeError('intrinsic name must be a non-empty string'); - } - if (arguments.length > 1 && typeof allowMissing !== 'boolean') { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; - - var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - ( - (first === '"' || first === "'" || first === '`') - || (last === '"' || last === "'" || last === '`') - ) - && first !== last - ) { - throw new $SyntaxError('property names with quotes must have matching quotes'); - } - if (part === 'constructor' || !isOwn) { - skipFurtherCaching = true; - } - - intrinsicBaseName += '.' + part; - intrinsicRealName = '%' + intrinsicBaseName + '%'; - - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); - } - return void undefined; - } - if ($gOPD && (i + 1) >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - - // By convention, when a data property is converted to an accessor - // property to emulate a data property that does not suffer from - // the override mistake, that accessor's getter is marked with - // an `originalValue` property. Here, when we detect this, we - // uphold the illusion by pretending to see that original data - // property, i.e., returning the value rather than the getter - // itself. - if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; -}; - - -/***/ }), - -/***/ "./node_modules/get-proto/Object.getPrototypeOf.js": -/*!*********************************************************!*\ - !*** ./node_modules/get-proto/Object.getPrototypeOf.js ***! - \*********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var $Object = __webpack_require__(/*! es-object-atoms */ "./node_modules/es-object-atoms/index.js"); - -/** @type {import('./Object.getPrototypeOf')} */ -module.exports = $Object.getPrototypeOf || null; - - -/***/ }), - -/***/ "./node_modules/get-proto/Reflect.getPrototypeOf.js": -/*!**********************************************************!*\ - !*** ./node_modules/get-proto/Reflect.getPrototypeOf.js ***! - \**********************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./Reflect.getPrototypeOf')} */ -module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; - - -/***/ }), - -/***/ "./node_modules/get-proto/index.js": -/*!*****************************************!*\ - !*** ./node_modules/get-proto/index.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var reflectGetProto = __webpack_require__(/*! ./Reflect.getPrototypeOf */ "./node_modules/get-proto/Reflect.getPrototypeOf.js"); -var originalGetProto = __webpack_require__(/*! ./Object.getPrototypeOf */ "./node_modules/get-proto/Object.getPrototypeOf.js"); - -var getDunderProto = __webpack_require__(/*! dunder-proto/get */ "./node_modules/dunder-proto/get.js"); - -/** @type {import('.')} */ -module.exports = reflectGetProto - ? function getProto(O) { - // @ts-expect-error TS can't narrow inside a closure, for some reason - return reflectGetProto(O); - } - : originalGetProto - ? function getProto(O) { - if (!O || (typeof O !== 'object' && typeof O !== 'function')) { - throw new TypeError('getProto: not an object'); - } - // @ts-expect-error TS can't narrow inside a closure, for some reason - return originalGetProto(O); - } - : getDunderProto - ? function getProto(O) { - // @ts-expect-error TS can't narrow inside a closure, for some reason - return getDunderProto(O); - } - : null; - - -/***/ }), - -/***/ "./node_modules/gopd/gOPD.js": -/*!***********************************!*\ - !*** ./node_modules/gopd/gOPD.js ***! - \***********************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./gOPD')} */ -module.exports = Object.getOwnPropertyDescriptor; - - -/***/ }), - -/***/ "./node_modules/gopd/index.js": -/*!************************************!*\ - !*** ./node_modules/gopd/index.js ***! - \************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -/** @type {import('.')} */ -var $gOPD = __webpack_require__(/*! ./gOPD */ "./node_modules/gopd/gOPD.js"); - -if ($gOPD) { - try { - $gOPD([], 'length'); - } catch (e) { - // IE 8 has a broken gOPD - $gOPD = null; - } -} - -module.exports = $gOPD; - - -/***/ }), - -/***/ "./node_modules/has-property-descriptors/index.js": -/*!********************************************************!*\ - !*** ./node_modules/has-property-descriptors/index.js ***! - \********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); - -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; - - -/***/ }), - -/***/ "./node_modules/has-symbols/index.js": -/*!*******************************************!*\ - !*** ./node_modules/has-symbols/index.js ***! - \*******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var origSymbol = typeof Symbol !== 'undefined' && Symbol; -var hasSymbolSham = __webpack_require__(/*! ./shams */ "./node_modules/has-symbols/shams.js"); - -/** @type {import('.')} */ -module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== 'function') { return false; } - if (typeof Symbol !== 'function') { return false; } - if (typeof origSymbol('foo') !== 'symbol') { return false; } - if (typeof Symbol('bar') !== 'symbol') { return false; } - - return hasSymbolSham(); -}; - - -/***/ }), - -/***/ "./node_modules/has-symbols/shams.js": -/*!*******************************************!*\ - !*** ./node_modules/has-symbols/shams.js ***! - \*******************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./shams')} */ -/* eslint complexity: [2, 18], max-statements: [2, 33] */ -module.exports = function hasSymbols() { - if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } - if (typeof Symbol.iterator === 'symbol') { return true; } - - /** @type {{ [k in symbol]?: unknown }} */ - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - if (typeof sym === 'string') { return false; } - - if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } - if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } - - // temp disabled per https://github.com/ljharb/object.assign/issues/17 - // if (sym instanceof Symbol) { return false; } - // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 - // if (!(symObj instanceof Symbol)) { return false; } - - // if (typeof Symbol.prototype.toString !== 'function') { return false; } - // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } - - var symVal = 42; - obj[sym] = symVal; - for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop - if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } - - if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { return false; } - - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } - - if (typeof Object.getOwnPropertyDescriptor === 'function') { - // eslint-disable-next-line no-extra-parens - var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } - } - - return true; -}; - - -/***/ }), - -/***/ "./node_modules/has-tostringtag/shams.js": -/*!***********************************************!*\ - !*** ./node_modules/has-tostringtag/shams.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var hasSymbols = __webpack_require__(/*! has-symbols/shams */ "./node_modules/has-symbols/shams.js"); - -/** @type {import('.')} */ -module.exports = function hasToStringTagShams() { - return hasSymbols() && !!Symbol.toStringTag; -}; - - -/***/ }), - -/***/ "./node_modules/hasown/index.js": -/*!**************************************!*\ - !*** ./node_modules/hasown/index.js ***! - \**************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var call = Function.prototype.call; -var $hasOwn = Object.prototype.hasOwnProperty; -var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); - -/** @type {import('.')} */ -module.exports = bind.call(call, $hasOwn); - - -/***/ }), - -/***/ "./node_modules/inherits/inherits_browser.js": -/*!***************************************************!*\ - !*** ./node_modules/inherits/inherits_browser.js ***! - \***************************************************/ -/***/ ((module) => { - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} - - -/***/ }), - -/***/ "./node_modules/is-arguments/index.js": -/*!********************************************!*\ - !*** ./node_modules/is-arguments/index.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); -var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); - -var $toString = callBound('Object.prototype.toString'); - -/** @type {import('.')} */ -var isStandardArguments = function isArguments(value) { - if ( - hasToStringTag - && value - && typeof value === 'object' - && Symbol.toStringTag in value - ) { - return false; - } - return $toString(value) === '[object Arguments]'; -}; - -/** @type {import('.')} */ -var isLegacyArguments = function isArguments(value) { - if (isStandardArguments(value)) { - return true; - } - return value !== null - && typeof value === 'object' - && 'length' in value - && typeof value.length === 'number' - && value.length >= 0 - && $toString(value) !== '[object Array]' - && 'callee' in value - && $toString(value.callee) === '[object Function]'; -}; - -var supportsStandardArguments = (function () { - return isStandardArguments(arguments); -}()); - -// @ts-expect-error TODO make this not error -isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests - -/** @type {import('.')} */ -module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; - - -/***/ }), - -/***/ "./node_modules/is-callable/index.js": -/*!*******************************************!*\ - !*** ./node_modules/is-callable/index.js ***! - \*******************************************/ -/***/ ((module) => { - -"use strict"; - - -var fnToStr = Function.prototype.toString; -var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; -var badArrayLike; -var isCallableMarker; -if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { - try { - badArrayLike = Object.defineProperty({}, 'length', { - get: function () { - throw isCallableMarker; - } - }); - isCallableMarker = {}; - // eslint-disable-next-line no-throw-literal - reflectApply(function () { throw 42; }, null, badArrayLike); - } catch (_) { - if (_ !== isCallableMarker) { - reflectApply = null; - } - } -} else { - reflectApply = null; -} - -var constructorRegex = /^\s*class\b/; -var isES6ClassFn = function isES6ClassFunction(value) { - try { - var fnStr = fnToStr.call(value); - return constructorRegex.test(fnStr); - } catch (e) { - return false; // not a function - } -}; - -var tryFunctionObject = function tryFunctionToStr(value) { - try { - if (isES6ClassFn(value)) { return false; } - fnToStr.call(value); - return true; - } catch (e) { - return false; - } -}; -var toStr = Object.prototype.toString; -var objectClass = '[object Object]'; -var fnClass = '[object Function]'; -var genClass = '[object GeneratorFunction]'; -var ddaClass = '[object HTMLAllCollection]'; // IE 11 -var ddaClass2 = '[object HTML document.all class]'; -var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 -var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` - -var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing - -var isDDA = function isDocumentDotAll() { return false; }; -if (typeof document === 'object') { - // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly - var all = document.all; - if (toStr.call(all) === toStr.call(document.all)) { - isDDA = function isDocumentDotAll(value) { - /* globals document: false */ - // in IE 6-8, typeof document.all is "object" and it's truthy - if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { - try { - var str = toStr.call(value); - return ( - str === ddaClass - || str === ddaClass2 - || str === ddaClass3 // opera 12.16 - || str === objectClass // IE 6-8 - ) && value('') == null; // eslint-disable-line eqeqeq - } catch (e) { /**/ } - } - return false; - }; - } -} - -module.exports = reflectApply - ? function isCallable(value) { - if (isDDA(value)) { return true; } - if (!value) { return false; } - if (typeof value !== 'function' && typeof value !== 'object') { return false; } - try { - reflectApply(value, null, badArrayLike); - } catch (e) { - if (e !== isCallableMarker) { return false; } - } - return !isES6ClassFn(value) && tryFunctionObject(value); - } - : function isCallable(value) { - if (isDDA(value)) { return true; } - if (!value) { return false; } - if (typeof value !== 'function' && typeof value !== 'object') { return false; } - if (hasToStringTag) { return tryFunctionObject(value); } - if (isES6ClassFn(value)) { return false; } - var strClass = toStr.call(value); - if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; } - return tryFunctionObject(value); - }; - - -/***/ }), - -/***/ "./node_modules/is-generator-function/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/is-generator-function/index.js ***! - \*****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); -var safeRegexTest = __webpack_require__(/*! safe-regex-test */ "./node_modules/safe-regex-test/index.js"); -var isFnRegex = safeRegexTest(/^\s*(?:function)?\*/); -var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); -var getProto = __webpack_require__(/*! get-proto */ "./node_modules/get-proto/index.js"); - -var toStr = callBound('Object.prototype.toString'); -var fnToStr = callBound('Function.prototype.toString'); - -var getGeneratorFunc = function () { // eslint-disable-line consistent-return - if (!hasToStringTag) { - return false; - } - try { - return Function('return function*() {}')(); - } catch (e) { - } -}; -/** @type {undefined | false | null | GeneratorFunctionConstructor} */ -var GeneratorFunction; - -/** @type {import('.')} */ -module.exports = function isGeneratorFunction(fn) { - if (typeof fn !== 'function') { - return false; - } - if (isFnRegex(fnToStr(fn))) { - return true; - } - if (!hasToStringTag) { - var str = toStr(fn); - return str === '[object GeneratorFunction]'; - } - if (!getProto) { - return false; - } - if (typeof GeneratorFunction === 'undefined') { - var generatorFunc = getGeneratorFunc(); - GeneratorFunction = generatorFunc - // eslint-disable-next-line no-extra-parens - ? /** @type {GeneratorFunctionConstructor} */ (getProto(generatorFunc)) - : false; - } - return getProto(fn) === GeneratorFunction; -}; - - -/***/ }), - -/***/ "./node_modules/is-nan/implementation.js": -/*!***********************************************!*\ - !*** ./node_modules/is-nan/implementation.js ***! - \***********************************************/ -/***/ ((module) => { - -"use strict"; - - -/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ - -module.exports = function isNaN(value) { - return value !== value; -}; - - -/***/ }), - -/***/ "./node_modules/is-nan/index.js": -/*!**************************************!*\ - !*** ./node_modules/is-nan/index.js ***! - \**************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); -var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); - -var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/is-nan/implementation.js"); -var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/is-nan/polyfill.js"); -var shim = __webpack_require__(/*! ./shim */ "./node_modules/is-nan/shim.js"); - -var polyfill = callBind(getPolyfill(), Number); - -/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ - -define(polyfill, { - getPolyfill: getPolyfill, - implementation: implementation, - shim: shim -}); - -module.exports = polyfill; - - -/***/ }), - -/***/ "./node_modules/is-nan/polyfill.js": -/*!*****************************************!*\ - !*** ./node_modules/is-nan/polyfill.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/is-nan/implementation.js"); - -module.exports = function getPolyfill() { - if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) { - return Number.isNaN; - } - return implementation; -}; - - -/***/ }), - -/***/ "./node_modules/is-nan/shim.js": -/*!*************************************!*\ - !*** ./node_modules/is-nan/shim.js ***! - \*************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); -var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/is-nan/polyfill.js"); - -/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ - -module.exports = function shimNumberIsNaN() { - var polyfill = getPolyfill(); - define(Number, { isNaN: polyfill }, { - isNaN: function testIsNaN() { - return Number.isNaN !== polyfill; - } - }); - return polyfill; -}; - - -/***/ }), - -/***/ "./node_modules/is-regex/index.js": -/*!****************************************!*\ - !*** ./node_modules/is-regex/index.js ***! - \****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); -var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); -var hasOwn = __webpack_require__(/*! hasown */ "./node_modules/hasown/index.js"); -var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); - -/** @type {import('.')} */ -var fn; - -if (hasToStringTag) { - /** @type {(receiver: ThisParameterType, ...args: Parameters) => ReturnType} */ - var $exec = callBound('RegExp.prototype.exec'); - /** @type {object} */ - var isRegexMarker = {}; - - var throwRegexMarker = function () { - throw isRegexMarker; - }; - /** @type {{ toString(): never, valueOf(): never, [Symbol.toPrimitive]?(): never }} */ - var badStringifier = { - toString: throwRegexMarker, - valueOf: throwRegexMarker - }; - - if (typeof Symbol.toPrimitive === 'symbol') { - badStringifier[Symbol.toPrimitive] = throwRegexMarker; - } - - /** @type {import('.')} */ - // @ts-expect-error TS can't figure out that the $exec call always throws - // eslint-disable-next-line consistent-return - fn = function isRegex(value) { - if (!value || typeof value !== 'object') { - return false; - } - - // eslint-disable-next-line no-extra-parens - var descriptor = /** @type {NonNullable} */ (gOPD)(/** @type {{ lastIndex?: unknown }} */ (value), 'lastIndex'); - var hasLastIndexDataProperty = descriptor && hasOwn(descriptor, 'value'); - if (!hasLastIndexDataProperty) { - return false; - } - - try { - // eslint-disable-next-line no-extra-parens - $exec(value, /** @type {string} */ (/** @type {unknown} */ (badStringifier))); - } catch (e) { - return e === isRegexMarker; - } - }; -} else { - /** @type {(receiver: ThisParameterType, ...args: Parameters) => ReturnType} */ - var $toString = callBound('Object.prototype.toString'); - /** @const @type {'[object RegExp]'} */ - var regexClass = '[object RegExp]'; - - /** @type {import('.')} */ - fn = function isRegex(value) { - // In older browsers, typeof regex incorrectly returns 'function' - if (!value || (typeof value !== 'object' && typeof value !== 'function')) { - return false; - } - - return $toString(value) === regexClass; - }; -} - -module.exports = fn; - - -/***/ }), - -/***/ "./node_modules/is-typed-array/index.js": -/*!**********************************************!*\ - !*** ./node_modules/is-typed-array/index.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); - -/** @type {import('.')} */ -module.exports = function isTypedArray(value) { - return !!whichTypedArray(value); -}; - - -/***/ }), - -/***/ "./node_modules/js-tokens/index.js": -/*!*****************************************!*\ - !*** ./node_modules/js-tokens/index.js ***! - \*****************************************/ -/***/ ((__unused_webpack_module, exports) => { - -// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell -// License: MIT. (See LICENSE.) - -Object.defineProperty(exports, "__esModule", ({ - value: true -})) - -// This regex comes from regex.coffee, and is inserted here by generate-index.js -// (run `npm run build`). -exports["default"] = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g - -exports.matchToToken = function(match) { - var token = {type: "invalid", value: match[0], closed: undefined} - if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) - else if (match[ 5]) token.type = "comment" - else if (match[ 6]) token.type = "comment", token.closed = !!match[7] - else if (match[ 8]) token.type = "regex" - else if (match[ 9]) token.type = "number" - else if (match[10]) token.type = "name" - else if (match[11]) token.type = "punctuator" - else if (match[12]) token.type = "whitespace" - return token -} - - -/***/ }), - -/***/ "./node_modules/jsesc/jsesc.js": -/*!*************************************!*\ - !*** ./node_modules/jsesc/jsesc.js ***! - \*************************************/ -/***/ ((module) => { - -"use strict"; - - -const object = {}; -const hasOwnProperty = object.hasOwnProperty; -const forOwn = (object, callback) => { - for (const key in object) { - if (hasOwnProperty.call(object, key)) { - callback(key, object[key]); - } - } -}; - -const extend = (destination, source) => { - if (!source) { - return destination; - } - forOwn(source, (key, value) => { - destination[key] = value; - }); - return destination; -}; - -const forEach = (array, callback) => { - const length = array.length; - let index = -1; - while (++index < length) { - callback(array[index]); - } -}; - -const fourHexEscape = (hex) => { - return '\\u' + ('0000' + hex).slice(-4); -} - -const hexadecimal = (code, lowercase) => { - let hexadecimal = code.toString(16); - if (lowercase) return hexadecimal; - return hexadecimal.toUpperCase(); -}; - -const toString = object.toString; -const isArray = Array.isArray; -const isBuffer = (value) => { - return typeof Buffer === 'function' && Buffer.isBuffer(value); -}; -const isObject = (value) => { - // This is a very simple check, but it’s good enough for what we need. - return toString.call(value) == '[object Object]'; -}; -const isString = (value) => { - return typeof value == 'string' || - toString.call(value) == '[object String]'; -}; -const isNumber = (value) => { - return typeof value == 'number' || - toString.call(value) == '[object Number]'; -}; -const isBigInt = (value) => { - return typeof value == 'bigint'; -}; -const isFunction = (value) => { - return typeof value == 'function'; -}; -const isMap = (value) => { - return toString.call(value) == '[object Map]'; -}; -const isSet = (value) => { - return toString.call(value) == '[object Set]'; -}; - -/*--------------------------------------------------------------------------*/ - -// https://mathiasbynens.be/notes/javascript-escapes#single -const singleEscapes = { - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t' - // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. - // '\v': '\\x0B' -}; -const regexSingleEscape = /[\\\b\f\n\r\t]/; - -const regexDigit = /[0-9]/; -const regexWhitespace = /[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; - -const escapeEverythingRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g; -const escapeNonAsciiRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g; - -const jsesc = (argument, options) => { - const increaseIndentation = () => { - oldIndent = indent; - ++options.indentLevel; - indent = options.indent.repeat(options.indentLevel) - }; - // Handle options - const defaults = { - 'escapeEverything': false, - 'minimal': false, - 'isScriptContext': false, - 'quotes': 'single', - 'wrap': false, - 'es6': false, - 'json': false, - 'compact': true, - 'lowercaseHex': false, - 'numbers': 'decimal', - 'indent': '\t', - 'indentLevel': 0, - '__inline1__': false, - '__inline2__': false - }; - const json = options && options.json; - if (json) { - defaults.quotes = 'double'; - defaults.wrap = true; - } - options = extend(defaults, options); - if ( - options.quotes != 'single' && - options.quotes != 'double' && - options.quotes != 'backtick' - ) { - options.quotes = 'single'; - } - const quote = options.quotes == 'double' ? - '"' : - (options.quotes == 'backtick' ? - '`' : - '\'' - ); - const compact = options.compact; - const lowercaseHex = options.lowercaseHex; - let indent = options.indent.repeat(options.indentLevel); - let oldIndent = ''; - const inline1 = options.__inline1__; - const inline2 = options.__inline2__; - const newLine = compact ? '' : '\n'; - let result; - let isEmpty = true; - const useBinNumbers = options.numbers == 'binary'; - const useOctNumbers = options.numbers == 'octal'; - const useDecNumbers = options.numbers == 'decimal'; - const useHexNumbers = options.numbers == 'hexadecimal'; - - if (json && argument && isFunction(argument.toJSON)) { - argument = argument.toJSON(); - } - - if (!isString(argument)) { - if (isMap(argument)) { - if (argument.size == 0) { - return 'new Map()'; - } - if (!compact) { - options.__inline1__ = true; - options.__inline2__ = false; - } - return 'new Map(' + jsesc(Array.from(argument), options) + ')'; - } - if (isSet(argument)) { - if (argument.size == 0) { - return 'new Set()'; - } - return 'new Set(' + jsesc(Array.from(argument), options) + ')'; - } - if (isBuffer(argument)) { - if (argument.length == 0) { - return 'Buffer.from([])'; - } - return 'Buffer.from(' + jsesc(Array.from(argument), options) + ')'; - } - if (isArray(argument)) { - result = []; - options.wrap = true; - if (inline1) { - options.__inline1__ = false; - options.__inline2__ = true; - } - if (!inline2) { - increaseIndentation(); - } - forEach(argument, (value) => { - isEmpty = false; - if (inline2) { - options.__inline2__ = false; - } - result.push( - (compact || inline2 ? '' : indent) + - jsesc(value, options) - ); - }); - if (isEmpty) { - return '[]'; - } - if (inline2) { - return '[' + result.join(', ') + ']'; - } - return '[' + newLine + result.join(',' + newLine) + newLine + - (compact ? '' : oldIndent) + ']'; - } else if (isNumber(argument) || isBigInt(argument)) { - if (json) { - // Some number values (e.g. `Infinity`) cannot be represented in JSON. - // `BigInt` values less than `-Number.MAX_VALUE` or greater than - // `Number.MAX_VALUE` cannot be represented in JSON so they will become - // `-Infinity` or `Infinity`, respectively, and then become `null` when - // stringified. - return JSON.stringify(Number(argument)); - } - - let result; - if (useDecNumbers) { - result = String(argument); - } else if (useHexNumbers) { - let hexadecimal = argument.toString(16); - if (!lowercaseHex) { - hexadecimal = hexadecimal.toUpperCase(); - } - result = '0x' + hexadecimal; - } else if (useBinNumbers) { - result = '0b' + argument.toString(2); - } else if (useOctNumbers) { - result = '0o' + argument.toString(8); - } - - if (isBigInt(argument)) { - return result + 'n'; - } - return result; - } else if (isBigInt(argument)) { - if (json) { - // `BigInt` values less than `-Number.MAX_VALUE` or greater than - // `Number.MAX_VALUE` will become `-Infinity` or `Infinity`, - // respectively, and cannot be represented in JSON. - return JSON.stringify(Number(argument)); - } - return argument + 'n'; - } else if (!isObject(argument)) { - if (json) { - // For some values (e.g. `undefined`, `function` objects), - // `JSON.stringify(value)` returns `undefined` (which isn’t valid - // JSON) instead of `'null'`. - return JSON.stringify(argument) || 'null'; - } - return String(argument); - } else { // it’s an object - result = []; - options.wrap = true; - increaseIndentation(); - forOwn(argument, (key, value) => { - isEmpty = false; - result.push( - (compact ? '' : indent) + - jsesc(key, options) + ':' + - (compact ? '' : ' ') + - jsesc(value, options) - ); - }); - if (isEmpty) { - return '{}'; - } - return '{' + newLine + result.join(',' + newLine) + newLine + - (compact ? '' : oldIndent) + '}'; - } - } - - const regex = options.escapeEverything ? escapeEverythingRegex : escapeNonAsciiRegex; - result = argument.replace(regex, (char, pair, lone, quoteChar, index, string) => { - if (pair) { - if (options.minimal) return pair; - const first = pair.charCodeAt(0); - const second = pair.charCodeAt(1); - if (options.es6) { - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - const codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; - const hex = hexadecimal(codePoint, lowercaseHex); - return '\\u{' + hex + '}'; - } - return fourHexEscape(hexadecimal(first, lowercaseHex)) + fourHexEscape(hexadecimal(second, lowercaseHex)); - } - - if (lone) { - return fourHexEscape(hexadecimal(lone.charCodeAt(0), lowercaseHex)); - } - - if ( - char == '\0' && - !json && - !regexDigit.test(string.charAt(index + 1)) - ) { - return '\\0'; - } - - if (quoteChar) { - if (quoteChar == quote || options.escapeEverything) { - return '\\' + quoteChar; - } - return quoteChar; - } - - if (regexSingleEscape.test(char)) { - // no need for a `hasOwnProperty` check here - return singleEscapes[char]; - } - - if (options.minimal && !regexWhitespace.test(char)) { - return char; - } - - const hex = hexadecimal(char.charCodeAt(0), lowercaseHex); - if (json || hex.length > 2) { - return fourHexEscape(hex); - } - - return '\\x' + ('00' + hex).slice(-2); - }); - - if (quote == '`') { - result = result.replace(/\$\{/g, '\\${'); - } - if (options.isScriptContext) { - // https://mathiasbynens.be/notes/etago - result = result - .replace(/<\/(script|style)/gi, '<\\/$1') - .replace(/ * (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(' ') -} - -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 - - 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' - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (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(' ') -} - -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 - - 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' - } - } - - debug('caret return', ret) - return ret - }) -} - -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 - } - - 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 - } - - 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 - } - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false -} - -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 - } - - 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 - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} - -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} - -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 -} - -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 -} - -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) - - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - 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) - } - }) - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} - -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) -} - -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) - - 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 - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - var high = null - var low = null - - 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 - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} - -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} - -exports.coerce = coerce -function coerce (version, options) { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - 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 - } - - if (match === null) { - return null - } - - return parse(match[2] + - '.' + (match[3] || '0') + - '.' + (match[4] || '0'), options) -} - - -/***/ }), - -/***/ "./node_modules/set-function-length/index.js": -/*!***************************************************!*\ - !*** ./node_modules/set-function-length/index.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); -var define = __webpack_require__(/*! define-data-property */ "./node_modules/define-data-property/index.js"); -var hasDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")(); -var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); - -var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); -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; -}; - - -/***/ }), - -/***/ "./node_modules/text-encoder/index.js": -/*!********************************************!*\ - !*** ./node_modules/text-encoder/index.js ***! - \********************************************/ -/***/ ((module) => { - -var utf8Encodings = [ - 'utf8', - 'utf-8', - 'unicode-1-1-utf-8' -]; - -function TextEncoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } else { - this.encoding = 'utf-8'; - this.encode = function(str) { - if (typeof str !== 'string') { - throw new TypeError('passed argument must be of tye string'); - } - var binstr = unescape(encodeURIComponent(str)), - arr = new Uint8Array(binstr.length); - const split = binstr.split(''); - for (let i = 0; i < split.length; i++) { - arr[i] = split[i].charCodeAt(0); - } - return arr; - }; - } -} - -function TextDecoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } - else { - this.encoding = 'utf-8'; - this.decode = function (view, options) { - if (typeof view === 'undefined') { - return ''; - } - - var stream = (typeof options !== 'undefined' && stream in options) ? options.stream : false; - if (typeof stream !== 'boolean') { - throw new TypeError('stream option must be boolean'); - } - - if (!ArrayBuffer.isView(view)) { - throw new TypeError('passed argument must be an array buffer view'); - } else { - var arr = new Uint8Array(view.buffer, view.byteOffset, view.byteLength), - charArr = new Array(arr.length); - for (let i = 0; i < arr.length; i++) { - charArr[i] = String.fromCharCode(arr[i]); - } - return decodeURIComponent(escape(charArr.join(''))); - } - } - } -} - -module.exports = { - TextEncoder, - TextDecoder, -}; - - -/***/ }), - -/***/ "./node_modules/util/support/isBufferBrowser.js": -/*!******************************************************!*\ - !*** ./node_modules/util/support/isBufferBrowser.js ***! - \******************************************************/ -/***/ ((module) => { - -module.exports = function isBuffer(arg) { - return arg && typeof arg === 'object' - && typeof arg.copy === 'function' - && typeof arg.fill === 'function' - && typeof arg.readUInt8 === 'function'; -} - -/***/ }), - -/***/ "./node_modules/util/support/types.js": -/*!********************************************!*\ - !*** ./node_modules/util/support/types.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -// Currently in sync with Node.js lib/internal/util/types.js -// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 - - - -var isArgumentsObject = __webpack_require__(/*! is-arguments */ "./node_modules/is-arguments/index.js"); -var isGeneratorFunction = __webpack_require__(/*! is-generator-function */ "./node_modules/is-generator-function/index.js"); -var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); -var isTypedArray = __webpack_require__(/*! is-typed-array */ "./node_modules/is-typed-array/index.js"); - -function uncurryThis(f) { - return f.call.bind(f); -} - -var BigIntSupported = typeof BigInt !== 'undefined'; -var SymbolSupported = typeof Symbol !== 'undefined'; - -var ObjectToString = uncurryThis(Object.prototype.toString); - -var numberValue = uncurryThis(Number.prototype.valueOf); -var stringValue = uncurryThis(String.prototype.valueOf); -var booleanValue = uncurryThis(Boolean.prototype.valueOf); - -if (BigIntSupported) { - var bigIntValue = uncurryThis(BigInt.prototype.valueOf); -} - -if (SymbolSupported) { - var symbolValue = uncurryThis(Symbol.prototype.valueOf); -} - -function checkBoxedPrimitive(value, prototypeValueOf) { - if (typeof value !== 'object') { - return false; - } - try { - prototypeValueOf(value); - return true; - } catch(e) { - return false; - } -} - -exports.isArgumentsObject = isArgumentsObject; -exports.isGeneratorFunction = isGeneratorFunction; -exports.isTypedArray = isTypedArray; - -// Taken from here and modified for better browser support -// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js -function isPromise(input) { - return ( - ( - typeof Promise !== 'undefined' && - input instanceof Promise - ) || - ( - input !== null && - typeof input === 'object' && - typeof input.then === 'function' && - typeof input.catch === 'function' - ) - ); -} -exports.isPromise = isPromise; - -function isArrayBufferView(value) { - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - return ArrayBuffer.isView(value); - } - - return ( - isTypedArray(value) || - isDataView(value) - ); -} -exports.isArrayBufferView = isArrayBufferView; - - -function isUint8Array(value) { - return whichTypedArray(value) === 'Uint8Array'; -} -exports.isUint8Array = isUint8Array; - -function isUint8ClampedArray(value) { - return whichTypedArray(value) === 'Uint8ClampedArray'; -} -exports.isUint8ClampedArray = isUint8ClampedArray; - -function isUint16Array(value) { - return whichTypedArray(value) === 'Uint16Array'; -} -exports.isUint16Array = isUint16Array; - -function isUint32Array(value) { - return whichTypedArray(value) === 'Uint32Array'; -} -exports.isUint32Array = isUint32Array; - -function isInt8Array(value) { - return whichTypedArray(value) === 'Int8Array'; -} -exports.isInt8Array = isInt8Array; - -function isInt16Array(value) { - return whichTypedArray(value) === 'Int16Array'; -} -exports.isInt16Array = isInt16Array; - -function isInt32Array(value) { - return whichTypedArray(value) === 'Int32Array'; -} -exports.isInt32Array = isInt32Array; - -function isFloat32Array(value) { - return whichTypedArray(value) === 'Float32Array'; -} -exports.isFloat32Array = isFloat32Array; - -function isFloat64Array(value) { - return whichTypedArray(value) === 'Float64Array'; -} -exports.isFloat64Array = isFloat64Array; - -function isBigInt64Array(value) { - return whichTypedArray(value) === 'BigInt64Array'; -} -exports.isBigInt64Array = isBigInt64Array; - -function isBigUint64Array(value) { - return whichTypedArray(value) === 'BigUint64Array'; -} -exports.isBigUint64Array = isBigUint64Array; - -function isMapToString(value) { - return ObjectToString(value) === '[object Map]'; -} -isMapToString.working = ( - typeof Map !== 'undefined' && - isMapToString(new Map()) -); - -function isMap(value) { - if (typeof Map === 'undefined') { - return false; - } - - return isMapToString.working - ? isMapToString(value) - : value instanceof Map; -} -exports.isMap = isMap; - -function isSetToString(value) { - return ObjectToString(value) === '[object Set]'; -} -isSetToString.working = ( - typeof Set !== 'undefined' && - isSetToString(new Set()) -); -function isSet(value) { - if (typeof Set === 'undefined') { - return false; - } - - return isSetToString.working - ? isSetToString(value) - : value instanceof Set; -} -exports.isSet = isSet; - -function isWeakMapToString(value) { - return ObjectToString(value) === '[object WeakMap]'; -} -isWeakMapToString.working = ( - typeof WeakMap !== 'undefined' && - isWeakMapToString(new WeakMap()) -); -function isWeakMap(value) { - if (typeof WeakMap === 'undefined') { - return false; - } - - return isWeakMapToString.working - ? isWeakMapToString(value) - : value instanceof WeakMap; -} -exports.isWeakMap = isWeakMap; - -function isWeakSetToString(value) { - return ObjectToString(value) === '[object WeakSet]'; -} -isWeakSetToString.working = ( - typeof WeakSet !== 'undefined' && - isWeakSetToString(new WeakSet()) -); -function isWeakSet(value) { - return isWeakSetToString(value); -} -exports.isWeakSet = isWeakSet; - -function isArrayBufferToString(value) { - return ObjectToString(value) === '[object ArrayBuffer]'; -} -isArrayBufferToString.working = ( - typeof ArrayBuffer !== 'undefined' && - isArrayBufferToString(new ArrayBuffer()) -); -function isArrayBuffer(value) { - if (typeof ArrayBuffer === 'undefined') { - return false; - } - - return isArrayBufferToString.working - ? isArrayBufferToString(value) - : value instanceof ArrayBuffer; -} -exports.isArrayBuffer = isArrayBuffer; - -function isDataViewToString(value) { - return ObjectToString(value) === '[object DataView]'; -} -isDataViewToString.working = ( - typeof ArrayBuffer !== 'undefined' && - typeof DataView !== 'undefined' && - isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)) -); -function isDataView(value) { - if (typeof DataView === 'undefined') { - return false; - } - - return isDataViewToString.working - ? isDataViewToString(value) - : value instanceof DataView; -} -exports.isDataView = isDataView; - -// Store a copy of SharedArrayBuffer in case it's deleted elsewhere -var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; -function isSharedArrayBufferToString(value) { - return ObjectToString(value) === '[object SharedArrayBuffer]'; -} -function isSharedArrayBuffer(value) { - if (typeof SharedArrayBufferCopy === 'undefined') { - return false; - } - - if (typeof isSharedArrayBufferToString.working === 'undefined') { - isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); - } - - return isSharedArrayBufferToString.working - ? isSharedArrayBufferToString(value) - : value instanceof SharedArrayBufferCopy; -} -exports.isSharedArrayBuffer = isSharedArrayBuffer; - -function isAsyncFunction(value) { - return ObjectToString(value) === '[object AsyncFunction]'; -} -exports.isAsyncFunction = isAsyncFunction; - -function isMapIterator(value) { - return ObjectToString(value) === '[object Map Iterator]'; -} -exports.isMapIterator = isMapIterator; - -function isSetIterator(value) { - return ObjectToString(value) === '[object Set Iterator]'; -} -exports.isSetIterator = isSetIterator; - -function isGeneratorObject(value) { - return ObjectToString(value) === '[object Generator]'; -} -exports.isGeneratorObject = isGeneratorObject; - -function isWebAssemblyCompiledModule(value) { - return ObjectToString(value) === '[object WebAssembly.Module]'; -} -exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; - -function isNumberObject(value) { - return checkBoxedPrimitive(value, numberValue); -} -exports.isNumberObject = isNumberObject; - -function isStringObject(value) { - return checkBoxedPrimitive(value, stringValue); -} -exports.isStringObject = isStringObject; - -function isBooleanObject(value) { - return checkBoxedPrimitive(value, booleanValue); -} -exports.isBooleanObject = isBooleanObject; - -function isBigIntObject(value) { - return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); -} -exports.isBigIntObject = isBigIntObject; - -function isSymbolObject(value) { - return SymbolSupported && checkBoxedPrimitive(value, symbolValue); -} -exports.isSymbolObject = isSymbolObject; - -function isBoxedPrimitive(value) { - return ( - isNumberObject(value) || - isStringObject(value) || - isBooleanObject(value) || - isBigIntObject(value) || - isSymbolObject(value) - ); -} -exports.isBoxedPrimitive = isBoxedPrimitive; - -function isAnyArrayBuffer(value) { - return typeof Uint8Array !== 'undefined' && ( - isArrayBuffer(value) || - isSharedArrayBuffer(value) - ); -} -exports.isAnyArrayBuffer = isAnyArrayBuffer; - -['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) { - Object.defineProperty(exports, method, { - enumerable: false, - value: function() { - throw new Error(method + ' is not supported in userland'); - } - }); -}); - - -/***/ }), - -/***/ "./node_modules/util/util.js": -/*!***********************************!*\ - !*** ./node_modules/util/util.js ***! - \***********************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); -// 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 getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || - function getOwnPropertyDescriptors(obj) { - var keys = Object.keys(obj); - var descriptors = {}; - for (var i = 0; i < keys.length; i++) { - descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); - } - return descriptors; - }; - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - if (typeof process !== 'undefined' && process.noDeprecation === true) { - return fn; - } - - // Allow for deprecating things in the process of starting up. - if (typeof process === 'undefined') { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -var debugs = {}; -var debugEnvRegex = /^$/; - -if (process.env.NODE_DEBUG) { - var debugEnv = process.env.NODE_DEBUG; - debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') - .replace(/\*/g, '.*') - .replace(/,/g, '$|^') - .toUpperCase(); - debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i'); -} -exports.debuglog = function(set) { - set = set.toUpperCase(); - if (!debugs[set]) { - if (debugEnvRegex.test(set)) { - var pid = process.pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -} - - -function stylizeNoColor(str, styleType) { - return str; -} - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -} - - -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').slice(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.slice(1, -1); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -exports.types = __webpack_require__(/*! ./support/types */ "./node_modules/util/support/types.js"); - -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; -exports.types.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; -exports.types.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; -exports.types.isNativeError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ "./node_modules/util/support/isBufferBrowser.js"); - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; - -exports.promisify = function promisify(original) { - if (typeof original !== 'function') - throw new TypeError('The "original" argument must be of type Function'); - - if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { - var fn = original[kCustomPromisifiedSymbol]; - if (typeof fn !== 'function') { - throw new TypeError('The "util.promisify.custom" argument must be of type Function'); - } - Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return fn; - } - - function fn() { - var promiseResolve, promiseReject; - var promise = new Promise(function (resolve, reject) { - promiseResolve = resolve; - promiseReject = reject; - }); - - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - args.push(function (err, value) { - if (err) { - promiseReject(err); - } else { - promiseResolve(value); - } - }); - - try { - original.apply(this, args); - } catch (err) { - promiseReject(err); - } - - return promise; - } - - Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); - - if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return Object.defineProperties( - fn, - getOwnPropertyDescriptors(original) - ); -} - -exports.promisify.custom = kCustomPromisifiedSymbol - -function callbackifyOnRejected(reason, cb) { - // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). - // Because `null` is a special error value in callbacks which means "no error - // occurred", we error-wrap so the callback consumer can distinguish between - // "the promise rejected with null" or "the promise fulfilled with undefined". - if (!reason) { - var newReason = new Error('Promise was rejected with a falsy value'); - newReason.reason = reason; - reason = newReason; - } - return cb(reason); -} - -function callbackify(original) { - if (typeof original !== 'function') { - throw new TypeError('The "original" argument must be of type Function'); - } - - // We DO NOT return the promise as it gives the user a false sense that - // the promise is actually somehow related to the callback's execution - // and that the callback throwing will reject the promise. - function callbackified() { - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - - var maybeCb = args.pop(); - if (typeof maybeCb !== 'function') { - throw new TypeError('The last argument must be of type Function'); - } - var self = this; - var cb = function() { - return maybeCb.apply(self, arguments); - }; - // In true node style we process the callback on `nextTick` with all the - // implications (stack, `uncaughtException`, `async_hooks`) - original.apply(this, args) - .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) }, - function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) }); - } - - Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); - Object.defineProperties(callbackified, - getOwnPropertyDescriptors(original)); - return callbackified; -} -exports.callbackify = callbackify; - - -/***/ }), - -/***/ "./node_modules/which-typed-array/index.js": -/*!*************************************************!*\ - !*** ./node_modules/which-typed-array/index.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var forEach = __webpack_require__(/*! for-each */ "./node_modules/for-each/index.js"); -var availableTypedArrays = __webpack_require__(/*! available-typed-arrays */ "./node_modules/available-typed-arrays/index.js"); -var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); -var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); -var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); -var getProto = __webpack_require__(/*! get-proto */ "./node_modules/get-proto/index.js"); - -var $toString = callBound('Object.prototype.toString'); -var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); - -var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; -var typedArrays = availableTypedArrays(); - -var $slice = callBound('String.prototype.slice'); - -/** @type {(array: readonly T[], value: unknown) => number} */ -var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { - for (var i = 0; i < array.length; i += 1) { - if (array[i] === value) { - return i; - } - } - return -1; -}; - -/** @typedef {import('./types').Getter} Getter */ -/** @type {import('./types').Cache} */ -var cache = { __proto__: null }; -if (hasToStringTag && gOPD && getProto) { - forEach(typedArrays, function (typedArray) { - var arr = new g[typedArray](); - if (Symbol.toStringTag in arr && getProto) { - var proto = getProto(arr); - // @ts-expect-error TS won't narrow inside a closure - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor && proto) { - var superProto = getProto(proto); - // @ts-expect-error TS won't narrow inside a closure - descriptor = gOPD(superProto, Symbol.toStringTag); - } - // @ts-expect-error TODO: fix - cache['$' + typedArray] = callBind(descriptor.get); - } - }); -} else { - forEach(typedArrays, function (typedArray) { - var arr = new g[typedArray](); - var fn = arr.slice || arr.set; - if (fn) { - cache[ - /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray) - ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ ( - // @ts-expect-error TODO FIXME - callBind(fn) - ); - } - }); -} - -/** @type {(value: object) => false | import('.').TypedArrayName} */ -var tryTypedArrays = function tryAllTypedArrays(value) { - /** @type {ReturnType} */ var found = false; - forEach( - /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ (cache), - /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ - function (getter, typedArray) { - if (!found) { - try { - // @ts-expect-error a throw is fine here - if ('$' + getter(value) === typedArray) { - found = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1)); - } - } catch (e) { /**/ } - } - } - ); - return found; -}; - -/** @type {(value: object) => false | import('.').TypedArrayName} */ -var trySlices = function tryAllSlices(value) { - /** @type {ReturnType} */ var found = false; - forEach( - /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */(cache), - /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) { - if (!found) { - try { - // @ts-expect-error a throw is fine here - getter(value); - found = /** @type {import('.').TypedArrayName} */ ($slice(name, 1)); - } catch (e) { /**/ } - } - } - ); - return found; -}; - -/** @type {import('.')} */ -module.exports = function whichTypedArray(value) { - if (!value || typeof value !== 'object') { return false; } - if (!hasToStringTag) { - /** @type {string} */ - var tag = $slice($toString(value), 8, -1); - if ($indexOf(typedArrays, tag) > -1) { - return tag; - } - if (tag !== 'Object') { - return false; - } - // node < 0.6 hits here on real Typed Arrays - return trySlices(value); - } - if (!gOPD) { return null; } // unknown engine - return tryTypedArrays(value); -}; - - -/***/ }), - -/***/ "./node_modules/yallist/iterator.js": -/*!******************************************!*\ - !*** ./node_modules/yallist/iterator.js ***! - \******************************************/ -/***/ ((module) => { - -"use strict"; - -module.exports = function (Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value - } - } -} - - -/***/ }), - -/***/ "./node_modules/yallist/yallist.js": -/*!*****************************************!*\ - !*** ./node_modules/yallist/yallist.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length-- - node.next = null - node.prev = null - node.list = null - - return next -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined - } - - var res = this.tail.value - this.tail = this.tail.prev - if (this.tail) { - this.tail.next = null - } else { - this.head = null - } - this.length-- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined - } - - var res = this.head.value - this.head = this.head.next - if (this.head) { - this.head.prev = null - } else { - this.tail = null - } - this.length-- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.splice = function (start, deleteCount /*, ...nodes */) { - if (start > this.length) { - start = this.length - 1 - } - if (start < 0) { - start = this.length + start; - } - - for (var i = 0, walker = this.head; walker !== null && i < start; i++) { - walker = walker.next - } - - var ret = [] - for (var i = 0; walker && i < deleteCount; i++) { - ret.push(walker.value) - walker = this.removeNode(walker) - } - if (walker === null) { - walker = this.tail - } - - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev - } - - for (var i = 2; i < arguments.length; i++) { - walker = insert(this, walker, arguments[i]) - } - return ret; -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function insert (self, node, value) { - var inserted = node === self.head ? - new Node(value, null, node, self) : - new Node(value, node, node.next, self) - - if (inserted.next === null) { - self.tail = inserted - } - if (inserted.prev === null) { - self.head = inserted - } - - self.length++ - - return inserted -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} - -try { - // add if support for Symbol.iterator is present - __webpack_require__(/*! ./iterator.js */ "./node_modules/yallist/iterator.js")(Yallist) -} catch (er) {} - - -/***/ }), - -/***/ "?3465": -/*!**********************!*\ - !*** path (ignored) ***! - \**********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?748e": -/*!********************!*\ - !*** fs (ignored) ***! - \********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ id: moduleId, -/******/ loaded: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/node module decorator */ -/******/ (() => { -/******/ __webpack_require__.nmd = (module) => { -/******/ module.paths = []; -/******/ if (!module.children) module.children = []; -/******/ return module; -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. -(() => { -"use strict"; -/*!******************************!*\ - !*** ./src/babel-minify.mjs ***! - \******************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ runTest: () => (/* binding */ runTest) -/* harmony export */ }); -/* harmony import */ var babel_minify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-minify */ "./node_modules/babel-minify/lib/index.js"); -// Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - -const payloads = [ - { - name: "speedometer-es2015-test-2.0.js", - options: {}, - }, -]; - -function runTest(fileData) { - const testData = payloads.map(({ name, options }) => ({ - payload: fileData[name], - options, - })); - - return testData.map(({ payload, options }) => babel_minify__WEBPACK_IMPORTED_MODULE_0__(payload, options)); -} - -})(); - -self.WTBenchmark = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/web-tooling-benchmark/dist/babel-minify.bundle.min.js b/web-tooling-benchmark/dist/babel-minify.bundle.min.js new file mode 100644 index 00000000..72c16433 --- /dev/null +++ b/web-tooling-benchmark/dist/babel-minify.bundle.min.js @@ -0,0 +1,58 @@ +(()=>{var e={130:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"OptionValidator",{enumerable:!0,get:function(){return r.OptionValidator}}),Object.defineProperty(t,"findSuggestion",{enumerable:!0,get:function(){return i.findSuggestion}});var r=n(23380),i=n(48500)},324:(e,t,n)=>{"use strict";var r=n(65606);Object.defineProperty(t,"__esModule",{value:!0}),t.getEnv=function(e="development"){return r.env.BABEL_ENV||"production"}},659:(e,t,n)=>{var r=n(51873),i=Object.prototype,s=i.hasOwnProperty,o=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=o.call(e);return r&&(t?e[a]=n:delete e[a]),i}},1093:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},1189:(e,t,n)=>{"use strict";var r=Array.prototype.slice,i=n(1093),s=Object.keys,o=s?function(e){return s(e)}:n(28875),a=Object.keys;o.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(r.call(e)):a(e)})}else Object.keys=o;return Object.keys||o},e.exports=o},1343:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[].concat(e),n=Object.create(null);for(;t.length;){const e=t.pop();if(e)switch(e.type){case"ArrayPattern":t.push(...e.elements);break;case"AssignmentExpression":case"AssignmentPattern":case"ForInStatement":case"ForOfStatement":t.push(e.left);break;case"ObjectPattern":t.push(...e.properties);break;case"ObjectProperty":t.push(e.value);break;case"RestElement":case"UpdateExpression":t.push(e.argument);break;case"UnaryExpression":"delete"===e.operator&&t.push(e.argument);break;case"Identifier":n[e.name]=e}}return n}},1602:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(29709),i=n(2352),s=n(79578);const{VISITOR_KEYS:o}=i;t.default=class{constructor(e,t,n,r){this.queue=null,this.priorityQueue=null,this.parentPath=r,this.scope=e,this.state=n,this.opts=t}shouldVisit(e){const t=this.opts;if(t.enter||t.exit)return!0;if(t[e.type])return!0;const n=o[e.type];if(null==n||!n.length)return!1;for(const t of n)if(e[t])return!0;return!1}create(e,t,n,i){return r.default.get({parentPath:this.parentPath,parent:e,container:t,key:n,listKey:i})}maybeQueue(e,t){this.queue&&(t?this.queue.push(e):this.priorityQueue.push(e))}visitMultiple(e,t,n){if(0===e.length)return!1;const r=[];for(let i=0;i{"use strict";e.exports=function(e){return function(t){const n=[];let r;do{const s=i(t);r=s.bailed;const o=s.seq,a=s.bailedAtIndex;o&&n.push(e.expressionStatement(o)),r&&t[a]&&n.push(t[a]),r&&((t=t.slice(a+1)).length||(r=!1))}while(r);return n;function i(t){const n=[],r=[];for(let s=0;s{let t;return 1===n.length?t=n[0]:n.length&&(t=e.sequenceExpression(n)),{seq:t,bailed:!0,bailedAtIndex:s}},a=t[s];if(e.isExpression(a))n.push(a);else if(e.isExpressionStatement(a))a.leadingComments&&r.push(...a.leadingComments),a.expression&&n.push(a.expression);else if(e.isIfStatement(a)){let t,r;if(a.consequent){const e=i([a.consequent]);if(e.bailed)return o();t=e.seq}if(a.alternate){const e=i([a.alternate]);if(e.bailed)return o();r=e.seq}r||t?r?t?n.push(e.conditionalExpression(a.test,t,r)):n.push(e.logicalExpression("||",a.test,r)):n.push(e.logicalExpression("&&",a.test,t)):n.push(a.test)}else{if(!e.isBlockStatement(a))return o();{const e=i(a.body);if(e.bailed)return o();e.seq&&n.push(e.seq)}}}let s;return 1===n.length?s=n[0]:n.length&&(s=e.sequenceExpression(n)),s&&(s.leadingComments=r),{seq:s}}}}},1882:(e,t,n)=>{var r=n(72552),i=n(23805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},2107:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.default)(e,!1)};var r=n(85279)},2120:(e,t,n)=>{"use strict";function r(){const e=n(25913);return r=function(){return e},e}function i(){const e=n(78992);return i=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{opts:n,ast:o,code:a,inputMap:l}=t,{generatorOpts:u}=n;u.inputSourceMap=null==l?void 0:l.toObject();const c=[];for(const t of e)for(const e of t){const{generatorOverride:t}=e;if(t){const e=t(o,u,a,i().default);void 0!==e&&c.push(e)}}let p;if(0===c.length)p=(0,i().default)(o,u,a);else{if(1!==c.length)throw new Error("More than one plugin attempted to override codegen.");if(p=c[0],"function"==typeof p.then)throw new Error("You appear to be using an async codegen plugin, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.")}let{code:d,decodedMap:f=p.map}=p;p.__mergedMap?f=Object.assign({},p.map):f&&(f=l?(0,s.default)(l.toObject(),f,u.sourceFileName):p.map);"inline"!==n.sourceMaps&&"both"!==n.sourceMaps||(d+="\n"+r().fromObject(f).toComment());"inline"===n.sourceMaps&&(f=null);return{outputCode:d,outputMap:f}};var s=n(76884)},2352:(e,t,n)=>{"use strict";var r=n(65606);Object.defineProperty(t,"__esModule",{value:!0});var i={react:!0,assertNode:!0,createTypeAnnotationBasedOnTypeof:!0,createUnionTypeAnnotation:!0,createFlowUnionType:!0,createTSUnionType:!0,cloneNode:!0,clone:!0,cloneDeep:!0,cloneDeepWithoutLoc:!0,cloneWithoutLoc:!0,addComment:!0,addComments:!0,inheritInnerComments:!0,inheritLeadingComments:!0,inheritsComments:!0,inheritTrailingComments:!0,removeComments:!0,ensureBlock:!0,toBindingIdentifierName:!0,toBlock:!0,toComputedKey:!0,toExpression:!0,toIdentifier:!0,toKeyAlias:!0,toStatement:!0,valueToNode:!0,appendToMemberExpression:!0,inherits:!0,prependToMemberExpression:!0,removeProperties:!0,removePropertiesDeep:!0,removeTypeDuplicates:!0,getAssignmentIdentifiers:!0,getBindingIdentifiers:!0,getOuterBindingIdentifiers:!0,getFunctionName:!0,traverse:!0,traverseFast:!0,shallowEqual:!0,is:!0,isBinding:!0,isBlockScoped:!0,isImmutable:!0,isLet:!0,isNode:!0,isNodesEquivalent:!0,isPlaceholderType:!0,isReferenced:!0,isScope:!0,isSpecifierDefault:!0,isType:!0,isValidES3Identifier:!0,isValidIdentifier:!0,isVar:!0,matchesPattern:!0,validate:!0,buildMatchMemberExpression:!0,__internal__deprecationWarning:!0};Object.defineProperty(t,"__internal__deprecationWarning",{enumerable:!0,get:function(){return ge.default}}),Object.defineProperty(t,"addComment",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"addComments",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"appendToMemberExpression",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"assertNode",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"buildMatchMemberExpression",{enumerable:!0,get:function(){return ye.default}}),Object.defineProperty(t,"clone",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"cloneDeep",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"cloneDeepWithoutLoc",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"cloneNode",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"cloneWithoutLoc",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"createFlowUnionType",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"createTSUnionType",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"ensureBlock",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"getAssignmentIdentifiers",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(t,"getBindingIdentifiers",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(t,"getFunctionName",{enumerable:!0,get:function(){return J.default}}),Object.defineProperty(t,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(t,"inheritInnerComments",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"inheritLeadingComments",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"inheritTrailingComments",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"inherits",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(t,"inheritsComments",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"is",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(t,"isBinding",{enumerable:!0,get:function(){return Z.default}}),Object.defineProperty(t,"isBlockScoped",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(t,"isImmutable",{enumerable:!0,get:function(){return te.default}}),Object.defineProperty(t,"isLet",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(t,"isNode",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(t,"isNodesEquivalent",{enumerable:!0,get:function(){return ie.default}}),Object.defineProperty(t,"isPlaceholderType",{enumerable:!0,get:function(){return se.default}}),Object.defineProperty(t,"isReferenced",{enumerable:!0,get:function(){return oe.default}}),Object.defineProperty(t,"isScope",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(t,"isSpecifierDefault",{enumerable:!0,get:function(){return le.default}}),Object.defineProperty(t,"isType",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(t,"isValidES3Identifier",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(t,"isValidIdentifier",{enumerable:!0,get:function(){return pe.default}}),Object.defineProperty(t,"isVar",{enumerable:!0,get:function(){return de.default}}),Object.defineProperty(t,"matchesPattern",{enumerable:!0,get:function(){return fe.default}}),Object.defineProperty(t,"prependToMemberExpression",{enumerable:!0,get:function(){return V.default}}),t.react=void 0,Object.defineProperty(t,"removeComments",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"removeProperties",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(t,"removePropertiesDeep",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(t,"removeTypeDuplicates",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(t,"shallowEqual",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(t,"toBindingIdentifierName",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"toBlock",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"toComputedKey",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"toExpression",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"toIdentifier",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"toKeyAlias",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"toStatement",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"traverse",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(t,"traverseFast",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return he.default}}),Object.defineProperty(t,"valueToNode",{enumerable:!0,get:function(){return L.default}});var s=n(45682),o=n(85004),a=n(49018),l=n(34568),u=n(72246);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))});var c=n(95958),p=n(31009),d=n(46049),f=n(10985);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===f[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return f[e]}}))});var h=n(48079);Object.keys(h).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===h[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return h[e]}}))});var y=n(85279),m=n(2107),g=n(10245),b=n(35299),v=n(62425),x=n(76211),E=n(52598),T=n(7932),S=n(55766),A=n(18125),P=n(15586),C=n(93437),w=n(67980);Object.keys(w).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===w[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return w[e]}}))});var D=n(93422);Object.keys(D).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===D[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return D[e]}}))});var I=n(57931),O=n(82234),B=n(25010),k=n(33017),F=n(26133),N=n(36744),_=n(72402),j=n(99198),L=n(44544),M=n(39793);Object.keys(M).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===M[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return M[e]}}))});var R=n(74001),U=n(89564),V=n(96219),q=n(85333),W=n(87639),$=n(95237),K=n(1343),z=n(70329),Y=n(49420),J=n(5109),H=n(53357);Object.keys(H).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===H[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return H[e]}}))});var G=n(58943),X=n(96616),Q=n(93828),Z=n(2687),ee=n(29127),te=n(19722),ne=n(63847),re=n(73908),ie=n(7003),se=n(53571),oe=n(37591),ae=n(89246),le=n(22457),ue=n(94460),ce=n(91384),pe=n(60983),de=n(70499),fe=n(94965),he=n(57446),ye=n(3937),me=n(98960);Object.keys(me).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===me[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return me[e]}}))});var ge=n(63762),be=n(90640);t.react={isReactComponent:s.default,isCompatTag:o.default,buildChildren:a.default};t.toSequenceExpression=be.default,r.env.BABEL_TYPES_8_BREAKING&&console.warn("BABEL_TYPES_8_BREAKING is not supported anymore. Use the latest Babel 8.0.0 pre-release instead!")},2687:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(n&&"Identifier"===e.type&&"ObjectProperty"===t.type&&"ObjectExpression"===n.type)return!1;const i=r.default.keys[t.type];if(i)for(let n=0;n{"use strict";function t(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,s=function(){};return{s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;){if(a=o.shift(),s&&s[a.type]&&Array.isArray(s[a.type].enter)){var l,u=t(s[a.type].enter);try{for(u.s();!(l=u.n()).done;){const e=l.value;"function"==typeof e&&e(a)}}catch(e){u.e(e)}finally{u.f()}}var c,p=t(r(a));try{for(p.s();!(c=p.n()).done;){const e=c.value,n=a.get(e);if(Array.isArray(n)){var d,f=t(n);try{for(f.s();!(d=f.n()).done;){const e=d.value;e.node&&o.push(e)}}catch(e){f.e(e)}finally{f.f()}}else n.node&&o.push(n)}}catch(e){p.e(e)}finally{p.f()}}}}},2861:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowFunctionExpression=function(e,t){e.async&&(this.word("async",!0),this.space());this._shouldPrintArrowParamsParens(e)?this._params(e,void 0,t):this.print(e.params[0],!0);this._predicate(e,!0),this.space(),this.printInnerComments(),this.token("=>"),this.space(),this.tokenContext|=i.TokenContext.arrowBody,this.print(e.body)},t.FunctionDeclaration=t.FunctionExpression=function(e,t){this._functionHead(e,t),this.space(),this.print(e.body)},t._functionHead=function(e,t){e.async&&(this.word("async"),this.format.preserveFormat||(this._endsWithInnerRaw=!1),this.space());this.word("function"),e.generator&&(this.format.preserveFormat||(this._endsWithInnerRaw=!1),this.tokenChar(42));this.space(),e.id&&this.print(e.id);this._params(e,e.id,t),"TSDeclareFunction"!==e.type&&this._predicate(e)},t._methodHead=function(e){const t=e.kind,n=e.key;"get"!==t&&"set"!==t||(this.word(t),this.space());e.async&&(this.word("async",!0),this.space());"method"!==t&&"init"!==t||e.generator&&this.tokenChar(42);e.computed?(this.tokenChar(91),this.print(n),this.tokenChar(93)):this.print(n);e.optional&&this.tokenChar(63);this._params(e,e.computed&&"StringLiteral"!==e.key.type?void 0:e.key,void 0)},t._param=function(e){this.printJoin(e.decorators),this.print(e),e.optional&&this.tokenChar(63);this.print(e.typeAnnotation)},t._parameters=function(e,t){const n=this.enterDelimited(),r=this.shouldPrintTrailingComma(t),i=e.length;for(let t=0;t");return null==(null==t?void 0:t.loc)||t.loc.start.line!==e.loc.start.line}return!!this.format.retainLines};var r=n(2352),i=n(31373);const{isIdentifier:s}=r;function o(e,t){let n,r=e;if(!r&&t){const e=t.type;"VariableDeclarator"===e?r=t.id:"AssignmentExpression"===e||"AssignmentPattern"===e?r=t.left:"ObjectProperty"===e||"ClassProperty"===e?t.computed&&"StringLiteral"!==t.key.type||(r=t.key):"ClassPrivateProperty"!==e&&"ClassAccessorProperty"!==e||(r=t.key)}if(r){var i,s;if("Identifier"===r.type)n={pos:null==(i=r.loc)?void 0:i.start,name:(null==(s=r.loc)?void 0:s.identifierName)||r.name};else if("PrivateName"===r.type){var o;n={pos:null==(o=r.loc)?void 0:o.start,name:"#"+r.id.name}}else if("StringLiteral"===r.type){var a;n={pos:null==(a=r.loc)?void 0:a.start,name:r.value}}return n}}},2949:(e,t,n)=>{"use strict";const r=n(55810),i=n(47240).FALLBACK_HANDLER;function s(e,t,n,...r){const s=function(e){if(!e.computed)return e.property.name;switch(e.property.type){case"StringLiteral":case"NumericLiteral":return e.property.value;case"TemplateLiteral":return}}(t.node);if(void 0===s)return!1;let o;if(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(n,s)&&"function"==typeof n[s])o=n[s];else{if("function"!=typeof n[i])return!1;o=n[i].bind(t.get("object"),s)}const a=o.apply(t.get("object"),r);return!!a&&(e.replaceWith(a),!0)}e.exports=e=>{const t=n(47240)(e),i=Symbol("seen"),o=e.types;return{name:"minify-constant-folding",visitor:{BinaryExpression(e){if(!e.isBinaryExpression({operator:"+"}))return;let t,n;const r=e.get("left"),i=e.get("right");if(i.isStringLiteral()){if(t=i,!r.isBinaryExpression({operator:"+"}))return;n=r}else{if(!r.isStringLiteral())return;if(t=r,!i.isBinaryExpression({operator:"+"}))return;n=i}const s=function e(t,n){if(t.isStringLiteral())return t;if(t.isBinaryExpression({operator:"+"}))return e(t.get(n),n)}(n,t.key);if(!s)return;const a="right"===t.key?s.node.value+t.node.value:t.node.value+s.node.value;s.replaceWith(o.stringLiteral(a)),e.replaceWith(n.node)},Expression(e,{opts:{tdz:t=!1}={}}){const n=e.node,s=e.parent;if(n[i])return;if(e.isLiteral())return;if(!e.isPure())return;if(o.isExportSpecifier(s))return;if(o.isUnaryExpression(n,{operator:"-"})&&o.isNumericLiteral(n.argument))return;if(o.isUnaryExpression(n,{operator:"!"})&&o.isNumericLiteral(n.argument)&&(0===n.argument.value||1===n.argument.value))return;if(o.isUnaryExpression(n,{operator:"void"})&&o.isNumericLiteral(n.argument,{value:0}))return;const a=r(e,{tdz:t});if(a.confident){if("number"==typeof a.value&&!Number.isInteger(a.value))return;if("number"==typeof a.value&&0===a.value&&1/a.value==-1/0){const t=o.unaryExpression("-",o.numericLiteral(0),!0);return t[i]=!0,void e.replaceWith(t)}if("object"==typeof a.value)return;const t=o.valueToNode(a.value);t[i]=!0,e.replaceWith(t)}},CallExpression(e){const n=e.node,r=e.get("callee");if(o.isMemberExpression(r)){const i=t[r.node.object.type];if(!i||!i.calls)return;if("function"==typeof i.canReplace&&!i.canReplace.call(r.get("object")))return;s(e,r,i.calls,...n.arguments)}},MemberExpression(e){const n=e.node,r=t[n.object.type];r&&r.members&&s(e,e,r.members)}}}}},3141:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnionType=function(e){if(e.every(e=>a(e)))return i?i(e):o(e);if(e.every(e=>l(e))&&s)return s(e)};var r=n(2352);const{createFlowUnionType:i,createTSUnionType:s,createUnionTypeAnnotation:o,isFlowType:a,isTSType:l}=r},3347:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,i,s,o){const l=new Set,u={compatData:e,includes:t,excludes:n};for(const t in e)if(a(t,r,u))l.add(t);else if(o){const e=o.get(t);e&&l.add(e)}return null==i||i.forEach(e=>!n.has(e)&&l.add(e)),null==s||s.forEach(e=>!t.has(e)&&l.delete(e)),l},t.isRequired=a,t.targetsSupported=o;var r=n(15345),i=n(16299);const s=n(75196);function o(e,t){const n=Object.keys(e);if(0===n.length)return!1;return 0===n.filter(n=>{const s=(0,i.getLowestImplementedVersion)(t,n);if(!s)return!0;const o=e[n];if((0,i.isUnreleasedVersion)(o,n))return!1;if((0,i.isUnreleasedVersion)(s,n))return!0;if(!r.valid(o.toString()))throw new Error(`Invalid version passed for target "${n}": "${o}". Versions must be in semver format (major.minor.patch)`);return r.gt((0,i.semverify)(s),o.toString())}).length}function a(e,t,{compatData:n=s,includes:r,excludes:i}={}){return(null==i||!i.has(e))&&(!(null==r||!r.has(e))||!o(t,n[e]))}},3611:(e,t,n)=>{"use strict";function r(){const e=n(63878);return r=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigPrinter=t.ChainFormatter=void 0;const i=t.ChainFormatter={Programmatic:0,Config:1},s={title(e,t,n){let r="";return e===i.Programmatic?(r="programmatic options",t&&(r+=" from "+t)):r="config "+n,r},loc(e,t){let n="";return null!=e&&(n+=`.overrides[${e}]`),null!=t&&(n+=`.env["${t}"]`),n},*optionsAndDescriptors(e){const t=Object.assign({},e.options);delete t.overrides,delete t.env;const n=[...yield*e.plugins()];n.length&&(t.plugins=n.map(e=>o(e)));const r=[...yield*e.presets()];return r.length&&(t.presets=[...r].map(e=>o(e))),JSON.stringify(t,void 0,2)}};function o(e){var t;let n=null==(t=e.file)?void 0:t.request;return null==n&&("object"==typeof e.value?n=e.value:"function"==typeof e.value&&(n=`[Function: ${e.value.toString().slice(0,50)} ... ]`)),null==n&&(n="[Unknown]"),void 0===e.options?n:null==e.name?[n,e.options]:[n,e.options,e.name]}class a{constructor(){this._stack=[]}configure(e,t,{callerName:n,filepath:r}){return e?(e,i,s)=>{this._stack.push({type:t,callerName:n,filepath:r,content:e,index:i,envName:s})}:()=>{}}static*format(e){let t=s.title(e.type,e.callerName,e.filepath);const n=s.loc(e.index,e.envName);n&&(t+=` ${n}`);return`${t}\n${yield*s.optionsAndDescriptors(e.content)}`}*output(){if(0===this._stack.length)return"";return(yield*r().all(this._stack.map(e=>a.format(e)))).join("\n\n")}}t.ConfigPrinter=a},3650:(e,t,n)=>{var r=n(74335)(Object.keys,Object);e.exports=r},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(89935),s=t&&!t.nodeType&&t,o=s&&e&&!e.nodeType&&e,a=o&&o.exports===s?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},3918:(e,t,n)=>{"use strict";var r=n(65606);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;te.length)&&(n=e.length),e.substring(n-t.length,n)===t}var x="",E="",T="",S="",A={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function P(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,"message",{value:e.message}),n}function C(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function w(e,t,n){var i="",s="",o=0,a="",l=!1,u=C(e),c=u.split("\n"),p=C(t).split("\n"),d=0,f="";if("strictEqual"===n&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(n="strictEqualObject"),1===c.length&&1===p.length&&c[0]!==p[0]){var h=c[0].length+p[0].length;if(h<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(A[n],"\n\n")+"".concat(c[0]," !== ").concat(p[0],"\n")}else if("strictEqualObject"!==n){if(h<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;c[0][d]===p[0][d];)d++;d>2&&(f="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,n-e.length)}(" ",d),"^"),d=0)}}}for(var y=c[c.length-1],g=p[p.length-1];y===g&&(d++<2?a="\n ".concat(y).concat(a):i=y,c.pop(),p.pop(),0!==c.length&&0!==p.length);)y=c[c.length-1],g=p[p.length-1];var b=Math.max(c.length,p.length);if(0===b){var P=u.split("\n");if(P.length>30)for(P[26]="".concat(x,"...").concat(S);P.length>27;)P.pop();return"".concat(A.notIdentical,"\n\n").concat(P.join("\n"),"\n")}d>3&&(a="\n".concat(x,"...").concat(S).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var w=0,D=A[n]+"\n".concat(E,"+ actual").concat(S," ").concat(T,"- expected").concat(S),I=" ".concat(x,"...").concat(S," Lines skipped");for(d=0;d1&&d>2&&(O>4?(s+="\n".concat(x,"...").concat(S),l=!0):O>3&&(s+="\n ".concat(p[d-2]),w++),s+="\n ".concat(p[d-1]),w++),o=d,i+="\n".concat(T,"-").concat(S," ").concat(p[d]),w++;else if(p.length1&&d>2&&(O>4?(s+="\n".concat(x,"...").concat(S),l=!0):O>3&&(s+="\n ".concat(c[d-2]),w++),s+="\n ".concat(c[d-1]),w++),o=d,s+="\n".concat(E,"+").concat(S," ").concat(c[d]),w++;else{var B=p[d],k=c[d],F=k!==B&&(!v(k,",")||k.slice(0,-1)!==B);F&&v(B,",")&&B.slice(0,-1)===k&&(F=!1,k+=","),F?(O>1&&d>2&&(O>4?(s+="\n".concat(x,"...").concat(S),l=!0):O>3&&(s+="\n ".concat(c[d-2]),w++),s+="\n ".concat(c[d-1]),w++),o=d,s+="\n".concat(E,"+").concat(S," ").concat(k),i+="\n".concat(T,"-").concat(S," ").concat(B),w+=2):(s+=i,i="",1!==O&&0!==d||(s+="\n ".concat(k),w++))}if(w>20&&d30)for(f[26]="".concat(x,"...").concat(S);f.length>27;)f.pop();t=1===f.length?d.call(this,"".concat(p," ").concat(f[0])):d.call(this,"".concat(p,"\n\n").concat(f.join("\n"),"\n"))}else{var h=C(o),y="",g=A[i];"notDeepEqual"===i||"notEqual"===i?(h="".concat(A[i],"\n\n").concat(h)).length>1024&&(h="".concat(h.slice(0,1021),"...")):(y="".concat(C(a)),h.length>512&&(h="".concat(h.slice(0,509),"...")),y.length>512&&(y="".concat(y.slice(0,509),"...")),"deepEqual"===i||"equal"===i?h="".concat(g,"\n\n").concat(h,"\n\nshould equal\n\n"):y=" ".concat(i," ").concat(y)),t=d.call(this,"".concat(h).concat(y))}return Error.stackTraceLimit=l,t.generatedMessage=!n,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=o,t.expected=a,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(t),s),t.stack,t.name="AssertionError",u(t)}return o=v,(l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,s(s({},t),{},{customInspect:!1,depth:0}))}}])&&a(o.prototype,l),p&&a(o,p),Object.defineProperty(o,"prototype",{writable:!1}),v}(p(Error),g.custom);e.exports=D},3937:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=e.split(".");return e=>(0,r.default)(e,n,t)};var r=n(94965)},4424:function(e){e.exports=function(){"use strict";const e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith("//")}function s(e){return e.startsWith("/")}function o(e){return e.startsWith("file:")}function a(e){return/^[.?#]/.test(e)}function l(e){const n=t.exec(e);return c(n[1],n[2]||"",n[3],n[4]||"",n[5]||"/",n[6]||"",n[7]||"")}function u(e){const t=n.exec(e),r=t[2];return c("file:","",t[1]||"","",s(r)?r:"/"+r,t[3]||"",t[4]||"")}function c(e,t,n,r,i,s,o){return{scheme:e,user:t,host:n,port:r,path:i,query:s,hash:o,type:7}}function p(e){if(i(e)){const t=l("http:"+e);return t.scheme="",t.type=6,t}if(s(e)){const t=l("http://foo.com"+e);return t.scheme="",t.host="",t.type=5,t}if(o(e))return u(e);if(r(e))return l(e);const t=l("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}function d(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}function f(e,t){h(t,t.type),"/"===e.path?e.path=t.path:e.path=d(t.path)+e.path}function h(e,t){const n=t<=4,r=e.path.split("/");let i=1,s=0,o=!1;for(let e=1;er&&(r=i)}h(n,r);const i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{const r=n.path.slice(1);return r?a(t||e)&&!a(r)?"./"+r+i:r+i:i||"."}case 5:return n.path+i;default:return n.scheme+"//"+n.user+n.host+n.port+n.path+i}}return y}()},4509:(e,t,n)=>{var r=n(12651);e.exports=function(e){return r(this,e).has(e)}},4664:(e,t,n)=>{var r=n(79770),i=n(63345),s=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(e){return null==e?[]:(e=Object(e),r(o(e),function(t){return s.call(e,t)}))}:i;e.exports=a},4777:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;{const e=n;t.default=n=function(t,n){var r,i,s,o;return e(t,{moduleId:null!=(r=n.moduleId)?r:t.moduleId,moduleIds:null!=(i=n.moduleIds)?i:t.moduleIds,getModuleId:null!=(s=n.getModuleId)?s:t.getModuleId,moduleRoot:null!=(o=n.moduleRoot)?o:t.moduleRoot})}}function n(e,t){const{filename:n,filenameRelative:r=n,sourceRoot:i=t.moduleRoot}=e,{moduleId:s,moduleIds:o=!!s,getModuleId:a,moduleRoot:l=i}=t;if(!o)return null;if(null!=s&&!a)return s;let u=null!=l?l+"/":"";if(r){const e=null!=i?new RegExp("^"+i+"/?"):"";u+=r.replace(e,"").replace(/\.\w*$/,"")}return u=u.replace(/\\/g,"/"),a&&a(u)||u}},4901:(e,t,n)=>{var r=n(72552),i=n(30294),s=n(40346),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return s(e)&&i(e.length)&&!!o[r(e)]}},5040:(e,t,n)=>{e.exports.browserVersions=n(56438)},5109:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("id"in e&&e.id)return{name:e.id.name,originalNode:e.id};let n,s="";(0,r.isObjectProperty)(t,{value:e})?n=i(t):(0,r.isObjectMethod)(e)||(0,r.isClassMethod)(e)?(n=i(e),"get"===e.kind?s="get ":"set"===e.kind&&(s="set ")):(0,r.isVariableDeclarator)(t,{init:e})?n=t.id:(0,r.isAssignmentExpression)(t,{operator:"=",right:e})&&(n=t.left);if(!n)return null;const o=(0,r.isLiteral)(n)?function(e){if((0,r.isNullLiteral)(e))return"null";if((0,r.isRegExpLiteral)(e))return`/${e.pattern}/${e.flags}`;if((0,r.isTemplateLiteral)(e))return e.quasis.map(e=>e.value.raw).join("");if(void 0!==e.value)return String(e.value);return null}(n):(0,r.isIdentifier)(n)?n.name:(0,r.isPrivateName)(n)?n.id.name:null;return null==o?null:{name:s+o,originalNode:n}};var r=n(98960);function i(e){if(!e.computed||(0,r.isLiteral)(e.key))return e.key}},5158:(e,t,n)=>{"use strict";var r=n(65606);Object.defineProperty(t,"__esModule",{value:!0}),t.patternLikeCommon=t.importAttributes=t.functionTypeAnnotationCommon=t.functionDeclarationCommon=t.functionCommon=t.classMethodOrPropertyCommon=t.classMethodOrDeclareMethodCommon=void 0;var i=n(93828),s=n(60983),o=n(61e3),a=n(53973),l=n(93422),u=n(77596);const c=(0,u.defineAliasedType)("Standardized");c("ArrayExpression",{fields:{elements:{validate:(0,u.arrayOf)((0,u.assertNodeOrValueType)("null","Expression","SpreadElement")),default:r.env.BABEL_TYPES_8_BREAKING?void 0:[]}},visitor:["elements"],aliases:["Expression"]}),c("AssignmentExpression",{fields:{operator:{validate:r.env.BABEL_TYPES_8_BREAKING?Object.assign(function(){const e=(0,u.assertOneOf)(...l.ASSIGNMENT_OPERATORS),t=(0,u.assertOneOf)("=");return function(n,r,s){((0,i.default)("Pattern",n.left)?t:e)(n,r,s)}}(),{oneOf:l.ASSIGNMENT_OPERATORS}):(0,u.assertValueType)("string")},left:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.assertNodeType)("Identifier","MemberExpression","OptionalMemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,u.assertNodeType)("LVal","OptionalMemberExpression")},right:{validate:(0,u.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]}),c("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:(0,u.assertOneOf)(...l.BINARY_OPERATORS)},left:{validate:function(){const e=(0,u.assertNodeType)("Expression"),t=(0,u.assertNodeType)("Expression","PrivateName");return Object.assign(function(n,r,i){("in"===n.operator?t:e)(n,r,i)},{oneOfNodeTypes:["Expression","PrivateName"]})}()},right:{validate:(0,u.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]}),c("InterpreterDirective",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}}}),c("Directive",{visitor:["value"],fields:{value:{validate:(0,u.assertNodeType)("DirectiveLiteral")}}}),c("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}}}),c("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,u.arrayOfType)("Directive"),default:[]},body:(0,u.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","Block","Statement"]}),c("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,u.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),c("CallExpression",{visitor:["callee","typeParameters","typeArguments","arguments"],builder:["callee","arguments"],aliases:["Expression"],fields:Object.assign({callee:{validate:(0,u.assertNodeType)("Expression","Super","V8IntrinsicIdentifier")},arguments:(0,u.validateArrayOfType)("Expression","SpreadElement","ArgumentPlaceholder"),typeArguments:{validate:(0,u.assertNodeType)("TypeParameterInstantiation"),optional:!0}},r.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0,u.assertValueType)("boolean"),optional:!0},typeParameters:{validate:(0,u.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})}),c("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,u.assertNodeType)("Identifier","ArrayPattern","ObjectPattern"),optional:!0},body:{validate:(0,u.assertNodeType)("BlockStatement")}},aliases:["Scopable","BlockParent"]}),c("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},consequent:{validate:(0,u.assertNodeType)("Expression")},alternate:{validate:(0,u.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]}),c("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,u.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),c("DebuggerStatement",{aliases:["Statement"]}),c("DoWhileStatement",{builder:["test","body"],visitor:["body","test"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]}),c("EmptyStatement",{aliases:["Statement"]}),c("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,u.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]}),c("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,u.assertNodeType)("Program")},comments:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.assertEach)((0,u.assertNodeType)("CommentBlock","CommentLine")):Object.assign(()=>{},{each:{oneOfNodeTypes:["CommentBlock","CommentLine"]}}),optional:!0},tokens:{validate:(0,u.assertEach)(Object.assign(()=>{},{type:"any"})),optional:!0}}}),c("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.assertNodeType)("VariableDeclaration","Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,u.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}}}),c("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,u.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,u.assertNodeType)("Expression"),optional:!0},update:{validate:(0,u.assertNodeType)("Expression"),optional:!0},body:{validate:(0,u.assertNodeType)("Statement")}}});const p=()=>({params:(0,u.validateArrayOfType)("FunctionParameter"),generator:{default:!1},async:{default:!1}});t.functionCommon=p;const d=()=>({returnType:{validate:(0,u.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0,u.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0}});t.functionTypeAnnotationCommon=d;const f=()=>Object.assign({},p(),{declare:{validate:(0,u.assertValueType)("boolean"),optional:!0},id:{validate:(0,u.assertNodeType)("Identifier"),optional:!0}});t.functionDeclarationCommon=f,c("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","typeParameters","params","predicate","returnType","body"],fields:Object.assign({},f(),d(),{body:{validate:(0,u.assertNodeType)("BlockStatement")},predicate:{validate:(0,u.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}}),aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"],validate:r.env.BABEL_TYPES_8_BREAKING?function(){const e=(0,u.assertNodeType)("Identifier");return function(t,n,r){(0,i.default)("ExportDefaultDeclaration",t)||e(r,"id",r.id)}}():void 0}),c("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},p(),d(),{id:{validate:(0,u.assertNodeType)("Identifier"),optional:!0},body:{validate:(0,u.assertNodeType)("BlockStatement")},predicate:{validate:(0,u.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})});const h=()=>({typeAnnotation:{validate:(0,u.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},optional:{validate:(0,u.assertValueType)("boolean"),optional:!0},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0}});t.patternLikeCommon=h,c("Identifier",{builder:["name"],visitor:["typeAnnotation","decorators"],aliases:["Expression","FunctionParameter","PatternLike","LVal","TSEntityName"],fields:Object.assign({},h(),{name:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertValueType)("string"),Object.assign(function(e,t,n){if(!(0,s.default)(n,!1))throw new TypeError(`"${n}" is not a valid identifier name`)},{type:"string"})):(0,u.assertValueType)("string")}}),validate:r.env.BABEL_TYPES_8_BREAKING?function(e,t,n){const r=/\.(\w+)$/.exec(t.toString());if(!r)return;const[,s]=r,a={computed:!1};if("property"===s){if((0,i.default)("MemberExpression",e,a))return;if((0,i.default)("OptionalMemberExpression",e,a))return}else if("key"===s){if((0,i.default)("Property",e,a))return;if((0,i.default)("Method",e,a))return}else if("exported"===s){if((0,i.default)("ExportSpecifier",e))return}else if("imported"===s){if((0,i.default)("ImportSpecifier",e,{imported:n}))return}else if("meta"===s&&(0,i.default)("MetaProperty",e,{meta:n}))return;if(((0,o.isKeyword)(n.name)||(0,o.isReservedWord)(n.name,!1))&&"this"!==n.name)throw new TypeError(`"${n.name}" is not a valid identifier`)}:void 0}),c("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},consequent:{validate:(0,u.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,u.assertNodeType)("Statement")}}}),c("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,u.assertNodeType)("Identifier")},body:{validate:(0,u.assertNodeType)("Statement")}}}),c("StringLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),c("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,u.chain)((0,u.assertValueType)("number"),Object.assign(function(e,t,n){if(1/n<0||!Number.isFinite(n)){new Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${n}) instead.`)}},{type:"number"}))}},aliases:["Expression","Pureish","Literal","Immutable"]}),c("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]}),c("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]}),c("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Pureish","Literal"],fields:{pattern:{validate:(0,u.assertValueType)("string")},flags:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertValueType)("string"),Object.assign(function(e,t,n){const r=/[^gimsuy]/.exec(n);if(r)throw new TypeError(`"${r[0]}" is not a valid RegExp flag`)},{type:"string"})):(0,u.assertValueType)("string"),default:""}}}),c("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:(0,u.assertOneOf)(...l.LOGICAL_OPERATORS)},left:{validate:(0,u.assertNodeType)("Expression")},right:{validate:(0,u.assertNodeType)("Expression")}}}),c("MemberExpression",{builder:["object","property","computed",...r.env.BABEL_TYPES_8_BREAKING?[]:["optional"]],visitor:["object","property"],aliases:["Expression","LVal","PatternLike"],fields:Object.assign({object:{validate:(0,u.assertNodeType)("Expression","Super")},property:{validate:function(){const e=(0,u.assertNodeType)("Identifier","PrivateName"),t=(0,u.assertNodeType)("Expression"),n=function(n,r,i){(n.computed?t:e)(n,r,i)};return n.oneOfNodeTypes=["Expression","Identifier","PrivateName"],n}()},computed:{default:!1}},r.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0,u.assertValueType)("boolean"),optional:!0}})}),c("NewExpression",{inherits:"CallExpression"}),c("Program",{visitor:["directives","body"],builder:["body","directives","sourceType","interpreter"],fields:{sourceType:{validate:(0,u.assertOneOf)("script","module"),default:"script"},interpreter:{validate:(0,u.assertNodeType)("InterpreterDirective"),default:null,optional:!0},directives:{validate:(0,u.arrayOfType)("Directive"),default:[]},body:(0,u.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","Block"]}),c("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:(0,u.validateArrayOfType)("ObjectMethod","ObjectProperty","SpreadElement")}}),c("ObjectMethod",{builder:["kind","key","params","body","computed","generator","async"],visitor:["decorators","key","typeParameters","params","returnType","body"],fields:Object.assign({},p(),d(),{kind:Object.assign({validate:(0,u.assertOneOf)("method","get","set")},r.env.BABEL_TYPES_8_BREAKING?{}:{default:"method"}),computed:{default:!1},key:{validate:function(){const e=(0,u.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),t=(0,u.assertNodeType)("Expression"),n=function(n,r,i){(n.computed?t:e)(n,r,i)};return n.oneOfNodeTypes=["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral"],n}()},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0},body:{validate:(0,u.assertNodeType)("BlockStatement")}}),aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]}),c("ObjectProperty",{builder:["key","value","computed","shorthand",...r.env.BABEL_TYPES_8_BREAKING?[]:["decorators"]],fields:{computed:{default:!1},key:{validate:function(){const e=(0,u.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"),t=(0,u.assertNodeType)("Expression");return Object.assign(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"]})}()},value:{validate:(0,u.assertNodeType)("Expression","PatternLike")},shorthand:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertValueType)("boolean"),Object.assign(function(e,t,n){if(n){if(e.computed)throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");if(!(0,i.default)("Identifier",e.key))throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier")}},{type:"boolean"})):(0,u.assertValueType)("boolean"),default:!1},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0}},visitor:["decorators","key","value"],aliases:["UserWhitespacable","Property","ObjectMember"],validate:r.env.BABEL_TYPES_8_BREAKING?function(){const e=(0,u.assertNodeType)("Identifier","Pattern","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"),t=(0,u.assertNodeType)("Expression");return function(n,r,s){((0,i.default)("ObjectPattern",n)?e:t)(s,"value",s.value)}}():void 0}),c("RestElement",{visitor:["argument","typeAnnotation"],builder:["argument"],aliases:["FunctionParameter","PatternLike","LVal"],deprecatedAlias:"RestProperty",fields:Object.assign({},h(),{argument:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,u.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression","RestElement","AssignmentPattern")}}),validate:r.env.BABEL_TYPES_8_BREAKING?function(e,t){const n=/(\w+)\[(\d+)\]/.exec(t.toString());if(!n)throw new Error("Internal Babel error: malformed key.");const[,r,i]=n;if(e[r].length>+i+1)throw new TypeError(`RestElement must be last element of ${r}`)}:void 0}),c("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,u.assertNodeType)("Expression"),optional:!0}}}),c("SequenceExpression",{visitor:["expressions"],fields:{expressions:(0,u.validateArrayOfType)("Expression")},aliases:["Expression"]}),c("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,u.assertNodeType)("Expression")}}}),c("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,u.assertNodeType)("Expression"),optional:!0},consequent:(0,u.validateArrayOfType)("Statement")}}),c("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,u.assertNodeType)("Expression")},cases:(0,u.validateArrayOfType)("SwitchCase")}}),c("ThisExpression",{aliases:["Expression"]}),c("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,u.assertNodeType)("Expression")}}}),c("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{block:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertNodeType)("BlockStatement"),Object.assign(function(e){if(!e.handler&&!e.finalizer)throw new TypeError("TryStatement expects either a handler or finalizer, or both")},{oneOfNodeTypes:["BlockStatement"]})):(0,u.assertNodeType)("BlockStatement")},handler:{optional:!0,validate:(0,u.assertNodeType)("CatchClause")},finalizer:{optional:!0,validate:(0,u.assertNodeType)("BlockStatement")}}}),c("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,u.assertNodeType)("Expression")},operator:{validate:(0,u.assertOneOf)(...l.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),c("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.assertNodeType)("Identifier","MemberExpression"):(0,u.assertNodeType)("Expression")},operator:{validate:(0,u.assertOneOf)(...l.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]}),c("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{declare:{validate:(0,u.assertValueType)("boolean"),optional:!0},kind:{validate:(0,u.assertOneOf)("var","let","const","using","await using")},declarations:(0,u.validateArrayOfType)("VariableDeclarator")},validate:r.env.BABEL_TYPES_8_BREAKING?(()=>{const e=(0,u.assertNodeType)("Identifier","Placeholder"),t=(0,u.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","Placeholder"),n=(0,u.assertNodeType)("Identifier","VoidPattern","Placeholder");return function(r,s,o){const{kind:a,declarations:l}=o,u=(0,i.default)("ForXStatement",r,{left:o});if(u&&1!==l.length)throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${r.type}`);for(const r of l)"const"===a||"let"===a||"var"===a?u||r.init?t(r,"id",r.id):e(r,"id",r.id):n(r,"id",r.id)}})():void 0}),c("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","VoidPattern"):(0,u.assertNodeType)("LVal","VoidPattern")},definite:{optional:!0,validate:(0,u.assertValueType)("boolean")},init:{optional:!0,validate:(0,u.assertNodeType)("Expression")}}}),c("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}}}),c("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}}}),c("AssignmentPattern",{visitor:["left","right","decorators"],builder:["left","right"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},h(),{left:{validate:(0,u.assertNodeType)("Identifier","ObjectPattern","ArrayPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression")},right:{validate:(0,u.assertNodeType)("Expression")},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0}})}),c("ArrayPattern",{visitor:["elements","typeAnnotation"],builder:["elements"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},h(),{elements:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeOrValueType)("null","PatternLike")))}})}),c("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["typeParameters","params","predicate","returnType","body"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},p(),d(),{expression:{validate:(0,u.assertValueType)("boolean")},body:{validate:(0,u.assertNodeType)("BlockStatement","Expression")},predicate:{validate:(0,u.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})}),c("ClassBody",{visitor:["body"],fields:{body:(0,u.validateArrayOfType)("ClassMethod","ClassPrivateMethod","ClassProperty","ClassPrivateProperty","ClassAccessorProperty","TSDeclareMethod","TSIndexSignature","StaticBlock")}}),c("ClassExpression",{builder:["id","superClass","body","decorators"],visitor:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body"],aliases:["Scopable","Class","Expression"],fields:{id:{validate:(0,u.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0,u.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0,u.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,u.assertNodeType)("Expression")},superTypeParameters:{validate:(0,u.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0,u.arrayOfType)("TSExpressionWithTypeArguments","ClassImplements"),optional:!0},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0},mixins:{validate:(0,u.assertNodeType)("InterfaceExtends"),optional:!0}}}),c("ClassDeclaration",{inherits:"ClassExpression",aliases:["Scopable","Class","Statement","Declaration"],fields:{id:{validate:(0,u.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0,u.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0,u.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,u.assertNodeType)("Expression")},superTypeParameters:{validate:(0,u.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0,u.arrayOfType)("TSExpressionWithTypeArguments","ClassImplements"),optional:!0},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0},mixins:{validate:(0,u.assertNodeType)("InterfaceExtends"),optional:!0},declare:{validate:(0,u.assertValueType)("boolean"),optional:!0},abstract:{validate:(0,u.assertValueType)("boolean"),optional:!0}},validate:r.env.BABEL_TYPES_8_BREAKING?function(){const e=(0,u.assertNodeType)("Identifier");return function(t,n,r){(0,i.default)("ExportDefaultDeclaration",t)||e(r,"id",r.id)}}():void 0});const y=t.importAttributes={attributes:{optional:!0,validate:(0,u.arrayOfType)("ImportAttribute")},assertions:{deprecated:!0,optional:!0,validate:(0,u.arrayOfType)("ImportAttribute")}};c("ExportAllDeclaration",{builder:["source"],visitor:["source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:Object.assign({source:{validate:(0,u.assertNodeType)("StringLiteral")},exportKind:(0,u.validateOptional)((0,u.assertOneOf)("type","value"))},y)}),c("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{declaration:(0,u.validateType)("TSDeclareFunction","FunctionDeclaration","ClassDeclaration","Expression"),exportKind:(0,u.validateOptional)((0,u.assertOneOf)("value"))}}),c("ExportNamedDeclaration",{builder:["declaration","specifiers","source"],visitor:["declaration","specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:Object.assign({declaration:{optional:!0,validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertNodeType)("Declaration"),Object.assign(function(e,t,n){if(n&&e.specifiers.length)throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");if(n&&e.source)throw new TypeError("Cannot export a declaration from a source")},{oneOfNodeTypes:["Declaration"]})):(0,u.assertNodeType)("Declaration")}},y,{specifiers:{default:[],validate:(0,u.arrayOf)(function(){const e=(0,u.assertNodeType)("ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"),t=(0,u.assertNodeType)("ExportSpecifier");return r.env.BABEL_TYPES_8_BREAKING?Object.assign(function(n,r,i){(n.source?e:t)(n,r,i)},{oneOfNodeTypes:["ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"]}):e}())},source:{validate:(0,u.assertNodeType)("StringLiteral"),optional:!0},exportKind:(0,u.validateOptional)((0,u.assertOneOf)("type","value"))})}),c("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,u.assertNodeType)("Identifier")},exported:{validate:(0,u.assertNodeType)("Identifier","StringLiteral")},exportKind:{validate:(0,u.assertOneOf)("type","value"),optional:!0}}}),c("ForOfStatement",{visitor:["left","right","body"],builder:["left","right","body","await"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:function(){if(!r.env.BABEL_TYPES_8_BREAKING)return(0,u.assertNodeType)("VariableDeclaration","LVal");const e=(0,u.assertNodeType)("VariableDeclaration"),t=(0,u.assertNodeType)("Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression");return Object.assign(function(n,r,s){(0,i.default)("VariableDeclaration",s)?e(n,r,s):t(n,r,s)},{oneOfNodeTypes:["VariableDeclaration","Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]})}()},right:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")},await:{default:!1}}}),c("ImportDeclaration",{builder:["specifiers","source"],visitor:["specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration"],fields:Object.assign({},y,{module:{optional:!0,validate:(0,u.assertValueType)("boolean")},phase:{default:null,validate:(0,u.assertOneOf)("source","defer")},specifiers:(0,u.validateArrayOfType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier"),source:{validate:(0,u.assertNodeType)("StringLiteral")},importKind:{validate:(0,u.assertOneOf)("type","typeof","value"),optional:!0}})}),c("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,u.assertNodeType)("Identifier")}}}),c("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,u.assertNodeType)("Identifier")}}}),c("ImportSpecifier",{visitor:["imported","local"],builder:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,u.assertNodeType)("Identifier")},imported:{validate:(0,u.assertNodeType)("Identifier","StringLiteral")},importKind:{validate:(0,u.assertOneOf)("type","typeof","value"),optional:!0}}}),c("ImportExpression",{visitor:["source","options"],aliases:["Expression"],fields:{phase:{default:null,validate:(0,u.assertOneOf)("source","defer")},source:{validate:(0,u.assertNodeType)("Expression")},options:{validate:(0,u.assertNodeType)("Expression"),optional:!0}}}),c("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertNodeType)("Identifier"),Object.assign(function(e,t,n){let r;switch(n.name){case"function":r="sent";break;case"new":r="target";break;case"import":r="meta"}if(!(0,i.default)("Identifier",e.property,{name:r}))throw new TypeError("Unrecognised MetaProperty")},{oneOfNodeTypes:["Identifier"]})):(0,u.assertNodeType)("Identifier")},property:{validate:(0,u.assertNodeType)("Identifier")}}});const m=()=>({abstract:{validate:(0,u.assertValueType)("boolean"),optional:!0},accessibility:{validate:(0,u.assertOneOf)("public","private","protected"),optional:!0},static:{default:!1},override:{default:!1},computed:{default:!1},optional:{validate:(0,u.assertValueType)("boolean"),optional:!0},key:{validate:(0,u.chain)(function(){const e=(0,u.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),t=(0,u.assertNodeType)("Expression");return function(n,r,i){(n.computed?t:e)(n,r,i)}}(),(0,u.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression"))}});t.classMethodOrPropertyCommon=m;const g=()=>Object.assign({},p(),m(),{params:(0,u.validateArrayOfType)("FunctionParameter","TSParameterProperty"),kind:{validate:(0,u.assertOneOf)("get","set","method","constructor"),default:"method"},access:{validate:(0,u.chain)((0,u.assertValueType)("string"),(0,u.assertOneOf)("public","private","protected")),optional:!0},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0}});t.classMethodOrDeclareMethodCommon=g,c("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static","generator","async"],visitor:["decorators","key","typeParameters","params","returnType","body"],fields:Object.assign({},g(),d(),{body:{validate:(0,u.assertNodeType)("BlockStatement")}})}),c("ObjectPattern",{visitor:["decorators","properties","typeAnnotation"],builder:["properties"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},h(),{properties:(0,u.validateArrayOfType)("RestElement","ObjectProperty")})}),c("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],deprecatedAlias:"SpreadProperty",fields:{argument:{validate:(0,u.assertNodeType)("Expression")}}}),c("Super",{aliases:["Expression"]}),c("TaggedTemplateExpression",{visitor:["tag","typeParameters","quasi"],builder:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,u.assertNodeType)("Expression")},quasi:{validate:(0,u.assertNodeType)("TemplateLiteral")},typeParameters:{validate:(0,u.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}}),c("TemplateElement",{builder:["value","tail"],fields:{value:{validate:(0,u.chain)((0,u.assertShape)({raw:{validate:(0,u.assertValueType)("string")},cooked:{validate:(0,u.assertValueType)("string"),optional:!0}}),function(e){const t=e.value.raw;let n=!1;const r=()=>{throw new Error("Internal @babel/types error.")},{str:i,firstInvalidLoc:s}=(0,a.readStringContents)("template",t,0,0,0,{unterminated(){n=!0},strictNumericEscape:r,invalidEscapeSequence:r,numericSeparatorInEscapeSequence:r,unexpectedNumericSeparator:r,invalidDigit:r,invalidCodePoint:r});if(!n)throw new Error("Invalid raw");e.value.cooked=s?null:i})},tail:{default:!1}}}),c("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:(0,u.validateArrayOfType)("TemplateElement"),expressions:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Expression","TSType")),function(e,t,n){if(e.quasis.length!==n.length+1)throw new TypeError(`Number of ${e.type} quasis should be exactly one more than the number of expressions.\nExpected ${n.length+1} quasis but got ${e.quasis.length}`)})}}}),c("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertValueType)("boolean"),Object.assign(function(e,t,n){if(n&&!e.argument)throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument")},{type:"boolean"})):(0,u.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,u.assertNodeType)("Expression")}}}),c("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,u.assertNodeType)("Expression")}}}),c("Import",{aliases:["Expression"]}),c("BigIntLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),c("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,u.assertNodeType)("Identifier")}}}),c("OptionalMemberExpression",{builder:["object","property","computed","optional"],visitor:["object","property"],aliases:["Expression"],fields:{object:{validate:(0,u.assertNodeType)("Expression")},property:{validate:function(){const e=(0,u.assertNodeType)("Identifier"),t=(0,u.assertNodeType)("Expression");return Object.assign(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:["Expression","Identifier"]})}()},computed:{default:!1},optional:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertValueType)("boolean"),(0,u.assertOptionalChainStart)()):(0,u.assertValueType)("boolean")}}}),c("OptionalCallExpression",{visitor:["callee","typeParameters","typeArguments","arguments"],builder:["callee","arguments","optional"],aliases:["Expression"],fields:Object.assign({callee:{validate:(0,u.assertNodeType)("Expression")},arguments:(0,u.validateArrayOfType)("Expression","SpreadElement","ArgumentPlaceholder"),optional:{validate:r.env.BABEL_TYPES_8_BREAKING?(0,u.chain)((0,u.assertValueType)("boolean"),(0,u.assertOptionalChainStart)()):(0,u.assertValueType)("boolean")},typeArguments:{validate:(0,u.assertNodeType)("TypeParameterInstantiation"),optional:!0}},{typeParameters:{validate:(0,u.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})}),c("ClassProperty",{visitor:["decorators","variance","key","typeAnnotation","value"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property"],fields:Object.assign({},m(),{value:{validate:(0,u.assertNodeType)("Expression"),optional:!0},definite:{validate:(0,u.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0,u.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0},readonly:{validate:(0,u.assertValueType)("boolean"),optional:!0},declare:{validate:(0,u.assertValueType)("boolean"),optional:!0},variance:{validate:(0,u.assertNodeType)("Variance"),optional:!0}})}),c("ClassAccessorProperty",{visitor:["decorators","key","typeAnnotation","value"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property","Accessor"],fields:Object.assign({},m(),{key:{validate:(0,u.chain)(function(){const e=(0,u.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","PrivateName"),t=(0,u.assertNodeType)("Expression");return function(n,r,i){(n.computed?t:e)(n,r,i)}}(),(0,u.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression","PrivateName"))},value:{validate:(0,u.assertNodeType)("Expression"),optional:!0},definite:{validate:(0,u.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0,u.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0},readonly:{validate:(0,u.assertValueType)("boolean"),optional:!0},declare:{validate:(0,u.assertValueType)("boolean"),optional:!0},variance:{validate:(0,u.assertNodeType)("Variance"),optional:!0}})}),c("ClassPrivateProperty",{visitor:["decorators","variance","key","typeAnnotation","value"],builder:["key","value","decorators","static"],aliases:["Property","Private"],fields:{key:{validate:(0,u.assertNodeType)("PrivateName")},value:{validate:(0,u.assertNodeType)("Expression"),optional:!0},typeAnnotation:{validate:(0,u.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,u.arrayOfType)("Decorator"),optional:!0},static:{validate:(0,u.assertValueType)("boolean"),default:!1},readonly:{validate:(0,u.assertValueType)("boolean"),optional:!0},optional:{validate:(0,u.assertValueType)("boolean"),optional:!0},definite:{validate:(0,u.assertValueType)("boolean"),optional:!0},variance:{validate:(0,u.assertNodeType)("Variance"),optional:!0}}}),c("ClassPrivateMethod",{builder:["kind","key","params","body","static"],visitor:["decorators","key","typeParameters","params","returnType","body"],aliases:["Function","Scopable","BlockParent","FunctionParent","Method","Private"],fields:Object.assign({},g(),d(),{kind:{validate:(0,u.assertOneOf)("get","set","method"),default:"method"},key:{validate:(0,u.assertNodeType)("PrivateName")},body:{validate:(0,u.assertNodeType)("BlockStatement")}})}),c("PrivateName",{visitor:["id"],aliases:["Private"],fields:{id:{validate:(0,u.assertNodeType)("Identifier")}}}),c("StaticBlock",{visitor:["body"],fields:{body:(0,u.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","FunctionParent"]}),c("ImportAttribute",{visitor:["key","value"],fields:{key:{validate:(0,u.assertNodeType)("Identifier","StringLiteral")},value:{validate:(0,u.assertNodeType)("StringLiteral")}}})},5861:(e,t,n)=>{var r=n(55580),i=n(68223),s=n(32804),o=n(76545),a=n(28303),l=n(72552),u=n(47473),c="[object Map]",p="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",y=u(r),m=u(i),g=u(s),b=u(o),v=u(a),x=l;(r&&x(new r(new ArrayBuffer(1)))!=h||i&&x(new i)!=c||s&&x(s.resolve())!=p||o&&x(new o)!=d||a&&x(new a)!=f)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case y:return h;case m:return c;case g:return p;case b:return d;case v:return f}return t}),e.exports=x},6188:e=>{"use strict";e.exports=Math.max},6319:e=>{var t=/^\s+and\s+(.*)/i,n=/^(?:,\s*|\s+or\s+)(.*)/i;function r(e){return Array.isArray(e)?e.reduce(function(e,t){return e.concat(r(t))},[]):[e]}function i(e,t){var n={query:t};for(var r in 0===t.indexOf("not ")&&(n.not=!0,t=t.slice(4)),e){var i=e[r],s=t.match(i.regexp);if(s){n.type=r;for(var o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EXTENSIONS=void 0,Object.defineProperty(t,"File",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"buildExternalHelpers",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"createConfigItem",{enumerable:!0,get:function(){return p.createConfigItem}}),Object.defineProperty(t,"createConfigItemAsync",{enumerable:!0,get:function(){return p.createConfigItemAsync}}),Object.defineProperty(t,"createConfigItemSync",{enumerable:!0,get:function(){return p.createConfigItemSync}}),Object.defineProperty(t,"getEnv",{enumerable:!0,get:function(){return o.getEnv}}),Object.defineProperty(t,"loadOptions",{enumerable:!0,get:function(){return p.loadOptions}}),Object.defineProperty(t,"loadOptionsAsync",{enumerable:!0,get:function(){return p.loadOptionsAsync}}),Object.defineProperty(t,"loadOptionsSync",{enumerable:!0,get:function(){return p.loadOptionsSync}}),Object.defineProperty(t,"loadPartialConfig",{enumerable:!0,get:function(){return p.loadPartialConfig}}),Object.defineProperty(t,"loadPartialConfigAsync",{enumerable:!0,get:function(){return p.loadPartialConfigAsync}}),Object.defineProperty(t,"loadPartialConfigSync",{enumerable:!0,get:function(){return p.loadPartialConfigSync}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return y.parse}}),Object.defineProperty(t,"parseAsync",{enumerable:!0,get:function(){return y.parseAsync}}),Object.defineProperty(t,"parseSync",{enumerable:!0,get:function(){return y.parseSync}}),t.resolvePreset=t.resolvePlugin=void 0,Object.defineProperty(t,"template",{enumerable:!0,get:function(){return c().default}}),Object.defineProperty(t,"tokTypes",{enumerable:!0,get:function(){return l().tokTypes}}),Object.defineProperty(t,"transform",{enumerable:!0,get:function(){return d.transform}}),Object.defineProperty(t,"transformAsync",{enumerable:!0,get:function(){return d.transformAsync}}),Object.defineProperty(t,"transformFile",{enumerable:!0,get:function(){return f.transformFile}}),Object.defineProperty(t,"transformFileAsync",{enumerable:!0,get:function(){return f.transformFileAsync}}),Object.defineProperty(t,"transformFileSync",{enumerable:!0,get:function(){return f.transformFileSync}}),Object.defineProperty(t,"transformFromAst",{enumerable:!0,get:function(){return h.transformFromAst}}),Object.defineProperty(t,"transformFromAstAsync",{enumerable:!0,get:function(){return h.transformFromAstAsync}}),Object.defineProperty(t,"transformFromAstSync",{enumerable:!0,get:function(){return h.transformFromAstSync}}),Object.defineProperty(t,"transformSync",{enumerable:!0,get:function(){return d.transformSync}}),Object.defineProperty(t,"traverse",{enumerable:!0,get:function(){return u().default}}),t.version=t.types=void 0;var r=n(94797),i=n(70322),s=n(20682),o=n(324);function a(){const e=n(2352);return a=function(){return e},e}function l(){const e=n(22172);return l=function(){return e},e}function u(){const e=n(25781);return u=function(){return e},e}function c(){const e=n(32485);return c=function(){return e},e}Object.defineProperty(t,"types",{enumerable:!0,get:function(){return a()}});var p=n(66955),d=n(55104),f=n(40786),h=n(98441),y=n(95283);t.version="7.28.3";t.resolvePlugin=(e,t)=>s.resolvePlugin(e,t,!1).filepath;t.resolvePreset=(e,t)=>s.resolvePreset(e,t,!1).filepath;t.DEFAULT_EXTENSIONS=Object.freeze([".js",".jsx",".es6",".es",".mjs",".cjs"]);t.OptionManager=class{init(e){return(0,p.loadOptionsSync)(e)}},t.Plugin=function(e){throw new Error(`The (${e}) Babel 5 plugin is being run with an unsupported Babel version.`)}},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6585:e=>{var t=1e3,n=60*t,r=60*n,i=24*r,s=7*i,o=365.25*i;function a(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,l){l=l||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var l=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*o;case"weeks":case"week":case"w":return l*s;case"days":case"day":case"d":return l*i;case"hours":case"hour":case"hrs":case"hr":case"h":return l*r;case"minutes":case"minute":case"mins":case"min":case"m":return l*n;case"seconds":case"second":case"secs":case"sec":case"s":return l*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(e);if("number"===u&&isFinite(e))return l.long?function(e){var s=Math.abs(e);if(s>=i)return a(e,s,i,"day");if(s>=r)return a(e,s,r,"hour");if(s>=n)return a(e,s,n,"minute");if(s>=t)return a(e,s,t,"second");return e+" ms"}(e):function(e){var s=Math.abs(e);if(s>=i)return Math.round(e/i)+"d";if(s>=r)return Math.round(e/r)+"h";if(s>=n)return Math.round(e/n)+"m";if(s>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},7003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){if("object"!=typeof t||"object"!=typeof n||null==t||null==n)return t===n;if(t.type!==n.type)return!1;const i=Object.keys(r.NODE_FIELDS[t.type]||t.type),s=r.VISITOR_KEYS[t.type];for(const r of i){const i=t[r],o=n[r];if(typeof i!=typeof o)return!1;if(null!=i||null!=o){if(null==i||null==o)return!1;if(Array.isArray(i)){if(!Array.isArray(o))return!1;if(i.length!==o.length)return!1;for(let t=0;t{"use strict";var r,i=n(73126),s=n(75795);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!r&&s&&s(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},7932:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)("innerComments",e,t)};var r=n(73205)},7942:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentPlaceholder=function(){this.tokenChar(63)},t.ArrayPattern=t.ArrayExpression=function(e){const t=e.elements,n=t.length;this.tokenChar(91);const r=this.enterDelimited();for(let e=0;e0&&this.space(),this.print(r),(eJSON.stringify(e));throw new Error(`The "topicToken" generator option must be one of ${n.join(", ")} (${t} received instead).`)}this.token(e)},t.TupleExpression=function(e){const t=e.elements,n=t.length;let r,i;if("bar"===this.format.recordAndTupleSyntaxType)r="[|",i="|]";else{if("hash"!==this.format.recordAndTupleSyntaxType)throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);r="#[",i="]"}this.token(r);for(let e=0;e0&&this.space(),this.print(r),(ee.value===t);if(n)return l=this._originalCode.slice(n.start,n.end),l;return l=e.name};var r=n(2352),i=n(17159);const{isAssignmentPattern:s,isIdentifier:o}=r;let a=null,l="";const u=new Set(["^^","@@","^","%","#"])},9276:(e,t)=>{"use strict";function n(e,t){e.tokenMap&&t.start&&t.end?e.tokenMap.endMatches(t,",")?e.token(","):e.tokenMap.endMatches(t,";")&&e.semicolon():e.semicolon()}function r(e,t,n){var r;let i=0;null!=(r=e.tokenMap)&&r.startMatches(t,n)&&(i=1,e.token(n)),e.printJoin(t.types,void 0,void 0,function(e){this.space(),this.token(n,null,e+i),this.space()})}function i(e,t){!0!==t&&e.token(t)}function s(e){o(this,e,()=>{var t;return this.printList(e.members,null==(t=this.shouldPrintTrailingComma("}"))||t,!0,!0)})}function o(e,t,n){e.token("{");const r=e.enterDelimited();n(),r(),e.rightBrace(t)}function a(e,t,n){var r;const i=new Set;for(const e of n)e&&i.add(e);null==(r=e.tokenMap)||r.find(t,t=>{if(i.has(t.value))return e.token(t.value),e.space(),i.delete(t.value),0===i.size});for(const t of i)e.word(t),e.space()}Object.defineProperty(t,"__esModule",{value:!0}),t.TSAnyKeyword=function(){this.word("any")},t.TSArrayType=function(e){this.print(e.elementType,!0),this.tokenChar(91),this.tokenChar(93)},t.TSSatisfiesExpression=t.TSAsExpression=function(e){const{type:t,expression:n,typeAnnotation:r}=e;this.print(n,!0),this.space(),this.word("TSAsExpression"===t?"as":"satisfies"),this.space(),this.print(r)},t.TSBigIntKeyword=function(){this.word("bigint")},t.TSBooleanKeyword=function(){this.word("boolean")},t.TSCallSignatureDeclaration=function(e){this.tsPrintSignatureDeclarationBase(e),n(this,e)},t.TSInterfaceHeritage=t.TSClassImplements=function(e){this.print(e.expression),this.print(e.typeArguments)},t.TSConditionalType=function(e){this.print(e.checkType),this.space(),this.word("extends"),this.space(),this.print(e.extendsType),this.space(),this.tokenChar(63),this.space(),this.print(e.trueType),this.space(),this.tokenChar(58),this.space(),this.print(e.falseType)},t.TSConstructSignatureDeclaration=function(e){this.word("new"),this.space(),this.tsPrintSignatureDeclarationBase(e),n(this,e)},t.TSConstructorType=function(e){e.abstract&&(this.word("abstract"),this.space());this.word("new"),this.space(),this.tsPrintFunctionOrConstructorType(e)},t.TSDeclareFunction=function(e,t){e.declare&&(this.word("declare"),this.space());this._functionHead(e,t),this.semicolon()},t.TSDeclareMethod=function(e){this._classMethodHead(e),this.semicolon()},t.TSEnumBody=s,t.TSEnumDeclaration=function(e){const{declare:t,const:n,id:r}=e;t&&(this.word("declare"),this.space());n&&(this.word("const"),this.space());this.word("enum"),this.space(),this.print(r),this.space(),s.call(this,e)},t.TSEnumMember=function(e){const{id:t,initializer:n}=e;this.print(t),n&&(this.space(),this.tokenChar(61),this.space(),this.print(n))},t.TSExportAssignment=function(e){this.word("export"),this.space(),this.tokenChar(61),this.space(),this.print(e.expression),this.semicolon()},t.TSExternalModuleReference=function(e){this.token("require("),this.print(e.expression),this.tokenChar(41)},t.TSFunctionType=function(e){this.tsPrintFunctionOrConstructorType(e)},t.TSImportEqualsDeclaration=function(e){const{id:t,moduleReference:n}=e;e.isExport&&(this.word("export"),this.space());this.word("import"),this.space(),this.print(t),this.space(),this.tokenChar(61),this.space(),this.print(n),this.semicolon()},t.TSImportType=function(e){const{argument:t,qualifier:n,options:r}=e;this.word("import"),this.tokenChar(40),this.print(t),r&&(this.tokenChar(44),this.print(r));this.tokenChar(41),n&&(this.tokenChar(46),this.print(n));const i=e.typeParameters;i&&this.print(i)},t.TSIndexSignature=function(e){const{readonly:t,static:r}=e;r&&(this.word("static"),this.space());t&&(this.word("readonly"),this.space());this.tokenChar(91),this._parameters(e.parameters,"]"),this.print(e.typeAnnotation),n(this,e)},t.TSIndexedAccessType=function(e){this.print(e.objectType,!0),this.tokenChar(91),this.print(e.indexType),this.tokenChar(93)},t.TSInferType=function(e){this.word("infer"),this.print(e.typeParameter)},t.TSInstantiationExpression=function(e){this.print(e.expression),this.print(e.typeParameters)},t.TSInterfaceBody=function(e){o(this,e,()=>this.printJoin(e.body,!0,!0))},t.TSInterfaceDeclaration=function(e){const{declare:t,id:n,typeParameters:r,extends:i,body:s}=e;t&&(this.word("declare"),this.space());this.word("interface"),this.space(),this.print(n),this.print(r),null!=i&&i.length&&(this.space(),this.word("extends"),this.space(),this.printList(i));this.space(),this.print(s)},t.TSIntersectionType=function(e){r(this,e,"&")},t.TSIntrinsicKeyword=function(){this.word("intrinsic")},t.TSLiteralType=function(e){this.print(e.literal)},t.TSMappedType=function(e){const{nameType:t,optional:n,readonly:r,typeAnnotation:s}=e;this.tokenChar(123);const o=this.enterDelimited();this.space(),r&&(i(this,r),this.word("readonly"),this.space());this.tokenChar(91),this.word(e.typeParameter.name),this.space(),this.word("in"),this.space(),this.print(e.typeParameter.constraint),t&&(this.space(),this.word("as"),this.space(),this.print(t));this.tokenChar(93),n&&(i(this,n),this.tokenChar(63));s&&(this.tokenChar(58),this.space(),this.print(s));this.space(),o(),this.tokenChar(125)},t.TSMethodSignature=function(e){const{kind:t}=e;"set"!==t&&"get"!==t||(this.word(t),this.space());this.tsPrintPropertyOrMethodName(e),this.tsPrintSignatureDeclarationBase(e),n(this,e)},t.TSModuleBlock=function(e){o(this,e,()=>this.printSequence(e.body,!0))},t.TSModuleDeclaration=function(e){const{declare:t,id:n,kind:r}=e;t&&(this.word("declare"),this.space());{if(e.global||(this.word(null!=r?r:"Identifier"===n.type?"namespace":"module"),this.space()),this.print(n),!e.body)return void this.semicolon();let t=e.body;for(;"TSModuleDeclaration"===t.type;)this.tokenChar(46),this.print(t.id),t=t.body;this.space(),this.print(t)}},t.TSNamedTupleMember=function(e){this.print(e.label),e.optional&&this.tokenChar(63);this.tokenChar(58),this.space(),this.print(e.elementType)},t.TSNamespaceExportDeclaration=function(e){this.word("export"),this.space(),this.word("as"),this.space(),this.word("namespace"),this.space(),this.print(e.id),this.semicolon()},t.TSNeverKeyword=function(){this.word("never")},t.TSNonNullExpression=function(e){this.print(e.expression),this.tokenChar(33)},t.TSNullKeyword=function(){this.word("null")},t.TSNumberKeyword=function(){this.word("number")},t.TSObjectKeyword=function(){this.word("object")},t.TSOptionalType=function(e){this.print(e.typeAnnotation),this.tokenChar(63)},t.TSParameterProperty=function(e){e.accessibility&&(this.word(e.accessibility),this.space());e.readonly&&(this.word("readonly"),this.space());this._param(e.parameter)},t.TSParenthesizedType=function(e){this.tokenChar(40),this.print(e.typeAnnotation),this.tokenChar(41)},t.TSPropertySignature=function(e){const{readonly:t}=e;t&&(this.word("readonly"),this.space());this.tsPrintPropertyOrMethodName(e),this.print(e.typeAnnotation),n(this,e)},t.TSQualifiedName=function(e){this.print(e.left),this.tokenChar(46),this.print(e.right)},t.TSRestType=function(e){this.token("..."),this.print(e.typeAnnotation)},t.TSStringKeyword=function(){this.word("string")},t.TSSymbolKeyword=function(){this.word("symbol")},t.TSTemplateLiteralType=function(e){this._printTemplate(e,e.types)},t.TSThisType=function(){this.word("this")},t.TSTupleType=function(e){this.tokenChar(91),this.printList(e.elementTypes,this.shouldPrintTrailingComma("]")),this.tokenChar(93)},t.TSTypeAliasDeclaration=function(e){const{declare:t,id:n,typeParameters:r,typeAnnotation:i}=e;t&&(this.word("declare"),this.space());this.word("type"),this.space(),this.print(n),this.print(r),this.space(),this.tokenChar(61),this.space(),this.print(i),this.semicolon()},t.TSTypeAnnotation=function(e,t){this.token("TSFunctionType"!==t.type&&"TSConstructorType"!==t.type||t.typeAnnotation!==e?":":"=>"),this.space(),e.optional&&this.tokenChar(63);this.print(e.typeAnnotation)},t.TSTypeAssertion=function(e){const{typeAnnotation:t,expression:n}=e;this.tokenChar(60),this.print(t),this.tokenChar(62),this.space(),this.print(n)},t.TSTypeLiteral=function(e){o(this,e,()=>this.printJoin(e.members,!0,!0))},t.TSTypeOperator=function(e){this.word(e.operator),this.space(),this.print(e.typeAnnotation)},t.TSTypeParameter=function(e){e.const&&(this.word("const"),this.space());e.in&&(this.word("in"),this.space());e.out&&(this.word("out"),this.space());this.word(e.name),e.constraint&&(this.space(),this.word("extends"),this.space(),this.print(e.constraint));e.default&&(this.space(),this.tokenChar(61),this.space(),this.print(e.default))},t.TSTypeParameterDeclaration=t.TSTypeParameterInstantiation=function(e,t){this.tokenChar(60);let n="ArrowFunctionExpression"===t.type&&1===e.params.length;this.tokenMap&&null!=e.start&&null!=e.end&&(n&&(n=!!this.tokenMap.find(e,e=>this.tokenMap.matchesOriginal(e,","))),n||(n=this.shouldPrintTrailingComma(">")));this.printList(e.params,n),this.tokenChar(62)},t.TSTypePredicate=function(e){e.asserts&&(this.word("asserts"),this.space());this.print(e.parameterName),e.typeAnnotation&&(this.space(),this.word("is"),this.space(),this.print(e.typeAnnotation.typeAnnotation))},t.TSTypeQuery=function(e){this.word("typeof"),this.space(),this.print(e.exprName);const t=e.typeParameters;t&&this.print(t)},t.TSTypeReference=function(e){const t=e.typeParameters;this.print(e.typeName,!!t),this.print(t)},t.TSUndefinedKeyword=function(){this.word("undefined")},t.TSUnionType=function(e){r(this,e,"|")},t.TSUnknownKeyword=function(){this.word("unknown")},t.TSVoidKeyword=function(){this.word("void")},t.tsPrintClassMemberModifiers=function(e){const t="ClassPrivateProperty"===e.type,n="ClassAccessorProperty"===e.type||"ClassProperty"===e.type;a(this,e,[n&&e.declare&&"declare",!t&&e.accessibility]),e.static&&(this.word("static"),this.space());a(this,e,[!t&&e.abstract&&"abstract",!t&&e.override&&"override",(n||t)&&e.readonly&&"readonly"])},t.tsPrintFunctionOrConstructorType=function(e){const{typeParameters:t}=e,n=e.parameters;this.print(t),this.tokenChar(40),this._parameters(n,")"),this.space();const r=e.typeAnnotation;this.print(r)},t.tsPrintPropertyOrMethodName=function(e){e.computed&&this.tokenChar(91);this.print(e.key),e.computed&&this.tokenChar(93);e.optional&&this.tokenChar(63)},t.tsPrintSignatureDeclarationBase=function(e){const{typeParameters:t}=e,n=e.parameters;this.print(t),this.tokenChar(40),this._parameters(n,")");const r=e.typeAnnotation;this.print(r)}},9325:(e,t,n)=>{var r=n(34840),i="object"==typeof self&&self&&self.Object===Object&&self,s=r||i||Function("return this")();e.exports=s},9394:(e,t,n)=>{"use strict";var r=n(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:r}},9957:(e,t,n)=>{"use strict";var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,s=n(66743);e.exports=s.call(r,i)},10076:e=>{"use strict";e.exports=Function.prototype.call},10245:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.default)(e)};var r=n(85279)},10299:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluate=function(){const e={confident:!0,deoptPath:null,seen:new Map};let t=u(this,e);e.confident||(t=void 0);return{confident:e.confident,deopt:e.deoptPath,value:t}},t.evaluateTruthy=function(){const e=this.evaluate();if(e.confident)return!!e.value};const r=["Number","String","Math"],i=["isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent",null,null],s=["random"];function o(e){return r.includes(e)}function a(e,t){t.confident&&(t.deoptPath=e,t.confident=!1)}const l=new Map([["undefined",void 0],["Infinity",1/0],["NaN",NaN]]);function u(e,t){const{node:r}=e,{seen:p}=t;if(p.has(r)){const n=p.get(r);return n.resolved?n.value:void a(e,t)}{const d={resolved:!1};p.set(r,d);const f=function(e,t){if(!t.confident)return;if(e.isSequenceExpression()){const n=e.get("expressions");return u(n[n.length-1],t)}if(e.isStringLiteral()||e.isNumericLiteral()||e.isBooleanLiteral())return e.node.value;if(e.isNullLiteral())return null;if(e.isTemplateLiteral())return c(e,e.node.quasis,t);if(e.isTaggedTemplateExpression()&&e.get("tag").isMemberExpression()){const n=e.get("tag.object"),{node:{name:r}}=n,i=e.get("tag.property");if(n.isIdentifier()&&"String"===r&&!e.scope.getBinding(r)&&i.isIdentifier()&&"raw"===i.node.name)return c(e,e.node.quasi.quasis,t,!0)}if(e.isConditionalExpression()){const n=u(e.get("test"),t);if(!t.confident)return;return u(n?e.get("consequent"):e.get("alternate"),t)}if(e.isExpressionWrapper())return u(e.get("expression"),t);if(e.isMemberExpression()&&!e.parentPath.isCallExpression({callee:e.node})){const n=e.get("property"),r=e.get("object");if(r.isLiteral()){const i=r.node.value,s=typeof i;let o=null;if(e.node.computed){if(o=u(n,t),!t.confident)return}else n.isIdentifier()&&(o=n.node.name);if(!("number"!==s&&"string"!==s||null==o||"number"!=typeof o&&"string"!=typeof o))return i[o]}}if(e.isReferencedIdentifier()){const n=e.scope.getBinding(e.node.name);if(n){if(n.constantViolations.length>0||e.node.start1?void a(s,t):o}if(e.isUnaryExpression({prefix:!0})){if("void"===e.node.operator)return;const n=e.get("argument");if("typeof"===e.node.operator&&(n.isFunction()||n.isClass()))return"function";const r=u(n,t);if(!t.confident)return;switch(e.node.operator){case"!":return!r;case"+":return+r;case"-":return-r;case"~":return~r;case"typeof":return typeof r}}if(e.isArrayExpression()){const n=[],r=e.get("elements");for(const e of r){const r=e.evaluate();if(!r.confident)return void a(r.deopt,t);n.push(r.value)}return n}if(e.isObjectExpression()){const n={},r=e.get("properties");for(const e of r){if(e.isObjectMethod()||e.isSpreadElement())return void a(e,t);const r=e.get("key");let i;if(e.node.computed){if(i=r.evaluate(),!i.confident)return void a(i.deopt,t);i=i.value}else i=r.isIdentifier()?r.node.name:r.node.value;let s=e.get("value").evaluate();if(!s.confident)return void a(s.deopt,t);s=s.value,n[i]=s}return n}if(e.isLogicalExpression()){const n=t.confident,r=u(e.get("left"),t),i=t.confident;t.confident=n;const s=u(e.get("right"),t),o=t.confident;switch(e.node.operator){case"||":if(t.confident=i&&(!!r||o),!t.confident)return;return r||s;case"&&":if(t.confident=i&&(!r||o),!t.confident)return;return r&&s;case"??":if(t.confident=i&&(null!=r||o),!t.confident)return;return null!=r?r:s}}if(e.isBinaryExpression()){const n=u(e.get("left"),t);if(!t.confident)return;const r=u(e.get("right"),t);if(!t.confident)return;switch(e.node.operator){case"-":return n-r;case"+":return n+r;case"/":return n/r;case"*":return n*r;case"%":return n%r;case"**":return Math.pow(n,r);case"<":return n":return n>r;case"<=":return n<=r;case">=":return n>=r;case"==":return n==r;case"!=":return n!=r;case"===":return n===r;case"!==":return n!==r;case"|":return n|r;case"&":return n&r;case"^":return n^r;case"<<":return n<>":return n>>r;case">>>":return n>>>r}}if(e.isCallExpression()){const r=e.get("callee");let a,l;if(r.isIdentifier()&&!e.scope.getBinding(r.node.name)&&(o(r.node.name)||function(e){return i.includes(e)}(r.node.name))&&(l=n.g[r.node.name]),r.isMemberExpression()){const e=r.get("object"),t=r.get("property");if(e.isIdentifier()&&t.isIdentifier()&&o(e.node.name)&&!function(e){return s.includes(e)}(t.node.name)){a=n.g[e.node.name];const r=t.node.name;hasOwnProperty.call(a,r)&&(l=a[r])}if(e.isLiteral()&&t.isIdentifier()){const n=typeof e.node.value;"string"!==n&&"number"!==n||(a=e.node.value,l=a[t.node.name])}}if(l){const n=e.get("arguments").map(e=>u(e,t));if(!t.confident)return;return l.apply(a,n)}}a(e,t)}(e,t);return t.confident&&(d.resolved=!0,d.value=f),f}}function c(e,t,n,r=!1){let i="",s=0;const o=e.isTemplateLiteral()?e.get("expressions"):e.get("quasi.expressions");for(const e of t){if(!n.confident)break;i+=r?e.value.raw:e.value.cooked;const t=o[s++];t&&(i+=String(u(t,n)))}if(n.confident)return i}},10392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},10439:e=>{"use strict";e.exports=JSON.parse('{"transform-explicit-resource-management":{"chrome":"134","edge":"134","node":"24","electron":"35.0"},"transform-duplicate-named-capturing-groups-regex":{"chrome":"126","opera":"112","edge":"126","firefox":"129","safari":"17.4","node":"23","ios":"17.4","electron":"31.0"},"transform-regexp-modifiers":{"chrome":"125","opera":"111","edge":"125","firefox":"132","node":"23","samsung":"27","electron":"31.0"},"transform-unicode-sets-regex":{"chrome":"112","opera":"98","edge":"112","firefox":"116","safari":"17","node":"20","deno":"1.32","ios":"17","samsung":"23","opera_mobile":"75","electron":"24.0"},"bugfix/transform-v8-static-class-fields-redefine-readonly":{"chrome":"98","opera":"84","edge":"98","firefox":"75","safari":"15","node":"12","deno":"1.18","ios":"15","samsung":"11","opera_mobile":"52","electron":"17.0"},"bugfix/transform-firefox-class-in-computed-class-key":{"chrome":"74","opera":"62","edge":"79","firefox":"126","safari":"16","node":"12","deno":"1","ios":"16","samsung":"11","opera_mobile":"53","electron":"6.0"},"bugfix/transform-safari-class-field-initializer-scope":{"chrome":"74","opera":"62","edge":"79","firefox":"69","safari":"16","node":"12","deno":"1","ios":"16","samsung":"11","opera_mobile":"53","electron":"6.0"},"transform-class-static-block":{"chrome":"94","opera":"80","edge":"94","firefox":"93","safari":"16.4","node":"16.11","deno":"1.14","ios":"16.4","samsung":"17","opera_mobile":"66","electron":"15.0"},"proposal-class-static-block":{"chrome":"94","opera":"80","edge":"94","firefox":"93","safari":"16.4","node":"16.11","deno":"1.14","ios":"16.4","samsung":"17","opera_mobile":"66","electron":"15.0"},"transform-private-property-in-object":{"chrome":"91","opera":"77","edge":"91","firefox":"90","safari":"15","node":"16.9","deno":"1.9","ios":"15","samsung":"16","opera_mobile":"64","electron":"13.0"},"proposal-private-property-in-object":{"chrome":"91","opera":"77","edge":"91","firefox":"90","safari":"15","node":"16.9","deno":"1.9","ios":"15","samsung":"16","opera_mobile":"64","electron":"13.0"},"transform-class-properties":{"chrome":"74","opera":"62","edge":"79","firefox":"90","safari":"14.1","node":"12","deno":"1","ios":"14.5","samsung":"11","opera_mobile":"53","electron":"6.0"},"proposal-class-properties":{"chrome":"74","opera":"62","edge":"79","firefox":"90","safari":"14.1","node":"12","deno":"1","ios":"14.5","samsung":"11","opera_mobile":"53","electron":"6.0"},"transform-private-methods":{"chrome":"84","opera":"70","edge":"84","firefox":"90","safari":"15","node":"14.6","deno":"1","ios":"15","samsung":"14","opera_mobile":"60","electron":"10.0"},"proposal-private-methods":{"chrome":"84","opera":"70","edge":"84","firefox":"90","safari":"15","node":"14.6","deno":"1","ios":"15","samsung":"14","opera_mobile":"60","electron":"10.0"},"transform-numeric-separator":{"chrome":"75","opera":"62","edge":"79","firefox":"70","safari":"13","node":"12.5","deno":"1","ios":"13","samsung":"11","rhino":"1.7.14","opera_mobile":"54","electron":"6.0"},"proposal-numeric-separator":{"chrome":"75","opera":"62","edge":"79","firefox":"70","safari":"13","node":"12.5","deno":"1","ios":"13","samsung":"11","rhino":"1.7.14","opera_mobile":"54","electron":"6.0"},"transform-logical-assignment-operators":{"chrome":"85","opera":"71","edge":"85","firefox":"79","safari":"14","node":"15","deno":"1.2","ios":"14","samsung":"14","opera_mobile":"60","electron":"10.0"},"proposal-logical-assignment-operators":{"chrome":"85","opera":"71","edge":"85","firefox":"79","safari":"14","node":"15","deno":"1.2","ios":"14","samsung":"14","opera_mobile":"60","electron":"10.0"},"transform-nullish-coalescing-operator":{"chrome":"80","opera":"67","edge":"80","firefox":"72","safari":"13.1","node":"14","deno":"1","ios":"13.4","samsung":"13","rhino":"1.8","opera_mobile":"57","electron":"8.0"},"proposal-nullish-coalescing-operator":{"chrome":"80","opera":"67","edge":"80","firefox":"72","safari":"13.1","node":"14","deno":"1","ios":"13.4","samsung":"13","rhino":"1.8","opera_mobile":"57","electron":"8.0"},"transform-optional-chaining":{"chrome":"91","opera":"77","edge":"91","firefox":"74","safari":"13.1","node":"16.9","deno":"1.9","ios":"13.4","samsung":"16","opera_mobile":"64","electron":"13.0"},"proposal-optional-chaining":{"chrome":"91","opera":"77","edge":"91","firefox":"74","safari":"13.1","node":"16.9","deno":"1.9","ios":"13.4","samsung":"16","opera_mobile":"64","electron":"13.0"},"transform-json-strings":{"chrome":"66","opera":"53","edge":"79","firefox":"62","safari":"12","node":"10","deno":"1","ios":"12","samsung":"9","rhino":"1.7.14","opera_mobile":"47","electron":"3.0"},"proposal-json-strings":{"chrome":"66","opera":"53","edge":"79","firefox":"62","safari":"12","node":"10","deno":"1","ios":"12","samsung":"9","rhino":"1.7.14","opera_mobile":"47","electron":"3.0"},"transform-optional-catch-binding":{"chrome":"66","opera":"53","edge":"79","firefox":"58","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"proposal-optional-catch-binding":{"chrome":"66","opera":"53","edge":"79","firefox":"58","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"transform-parameters":{"chrome":"49","opera":"36","edge":"18","firefox":"52","safari":"16.3","node":"6","deno":"1","ios":"16.3","samsung":"5","opera_mobile":"36","electron":"0.37"},"transform-async-generator-functions":{"chrome":"63","opera":"50","edge":"79","firefox":"57","safari":"12","node":"10","deno":"1","ios":"12","samsung":"8","opera_mobile":"46","electron":"3.0"},"proposal-async-generator-functions":{"chrome":"63","opera":"50","edge":"79","firefox":"57","safari":"12","node":"10","deno":"1","ios":"12","samsung":"8","opera_mobile":"46","electron":"3.0"},"transform-object-rest-spread":{"chrome":"60","opera":"47","edge":"79","firefox":"55","safari":"11.1","node":"8.3","deno":"1","ios":"11.3","samsung":"8","opera_mobile":"44","electron":"2.0"},"proposal-object-rest-spread":{"chrome":"60","opera":"47","edge":"79","firefox":"55","safari":"11.1","node":"8.3","deno":"1","ios":"11.3","samsung":"8","opera_mobile":"44","electron":"2.0"},"transform-dotall-regex":{"chrome":"62","opera":"49","edge":"79","firefox":"78","safari":"11.1","node":"8.10","deno":"1","ios":"11.3","samsung":"8","rhino":"1.7.15","opera_mobile":"46","electron":"3.0"},"transform-unicode-property-regex":{"chrome":"64","opera":"51","edge":"79","firefox":"78","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"proposal-unicode-property-regex":{"chrome":"64","opera":"51","edge":"79","firefox":"78","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"transform-named-capturing-groups-regex":{"chrome":"64","opera":"51","edge":"79","firefox":"78","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"transform-async-to-generator":{"chrome":"55","opera":"42","edge":"15","firefox":"52","safari":"11","node":"7.6","deno":"1","ios":"11","samsung":"6","opera_mobile":"42","electron":"1.6"},"transform-exponentiation-operator":{"chrome":"52","opera":"39","edge":"14","firefox":"52","safari":"10.1","node":"7","deno":"1","ios":"10.3","samsung":"6","rhino":"1.7.14","opera_mobile":"41","electron":"1.3"},"transform-template-literals":{"chrome":"41","opera":"28","edge":"13","firefox":"34","safari":"13","node":"4","deno":"1","ios":"13","samsung":"3.4","opera_mobile":"28","electron":"0.21"},"transform-literals":{"chrome":"44","opera":"31","edge":"12","firefox":"53","safari":"9","node":"4","deno":"1","ios":"9","samsung":"4","rhino":"1.7.15","opera_mobile":"32","electron":"0.30"},"transform-function-name":{"chrome":"51","opera":"38","edge":"79","firefox":"53","safari":"10","node":"6.5","deno":"1","ios":"10","samsung":"5","opera_mobile":"41","electron":"1.2"},"transform-arrow-functions":{"chrome":"47","opera":"34","edge":"13","firefox":"43","safari":"10","node":"6","deno":"1","ios":"10","samsung":"5","rhino":"1.7.13","opera_mobile":"34","electron":"0.36"},"transform-block-scoped-functions":{"chrome":"41","opera":"28","edge":"12","firefox":"46","safari":"10","node":"4","deno":"1","ie":"11","ios":"10","samsung":"3.4","opera_mobile":"28","electron":"0.21"},"transform-classes":{"chrome":"46","opera":"33","edge":"13","firefox":"45","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-object-super":{"chrome":"46","opera":"33","edge":"13","firefox":"45","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-shorthand-properties":{"chrome":"43","opera":"30","edge":"12","firefox":"33","safari":"9","node":"4","deno":"1","ios":"9","samsung":"4","rhino":"1.7.14","opera_mobile":"30","electron":"0.27"},"transform-duplicate-keys":{"chrome":"42","opera":"29","edge":"12","firefox":"34","safari":"9","node":"4","deno":"1","ios":"9","samsung":"3.4","opera_mobile":"29","electron":"0.25"},"transform-computed-properties":{"chrome":"44","opera":"31","edge":"12","firefox":"34","safari":"7.1","node":"4","deno":"1","ios":"8","samsung":"4","rhino":"1.8","opera_mobile":"32","electron":"0.30"},"transform-for-of":{"chrome":"51","opera":"38","edge":"15","firefox":"53","safari":"10","node":"6.5","deno":"1","ios":"10","samsung":"5","opera_mobile":"41","electron":"1.2"},"transform-sticky-regex":{"chrome":"49","opera":"36","edge":"13","firefox":"3","safari":"10","node":"6","deno":"1","ios":"10","samsung":"5","rhino":"1.7.15","opera_mobile":"36","electron":"0.37"},"transform-unicode-escapes":{"chrome":"44","opera":"31","edge":"12","firefox":"53","safari":"9","node":"4","deno":"1","ios":"9","samsung":"4","rhino":"1.7.15","opera_mobile":"32","electron":"0.30"},"transform-unicode-regex":{"chrome":"50","opera":"37","edge":"13","firefox":"46","safari":"12","node":"6","deno":"1","ios":"12","samsung":"5","opera_mobile":"37","electron":"1.1"},"transform-spread":{"chrome":"46","opera":"33","edge":"13","firefox":"45","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-destructuring":{"chrome":"51","opera":"38","edge":"15","firefox":"53","safari":"10","node":"6.5","deno":"1","ios":"10","samsung":"5","opera_mobile":"41","electron":"1.2"},"transform-block-scoping":{"chrome":"50","opera":"37","edge":"14","firefox":"53","safari":"11","node":"6","deno":"1","ios":"11","samsung":"5","opera_mobile":"37","electron":"1.1"},"transform-typeof-symbol":{"chrome":"48","opera":"35","edge":"12","firefox":"36","safari":"9","node":"6","deno":"1","ios":"9","samsung":"5","rhino":"1.8","opera_mobile":"35","electron":"0.37"},"transform-new-target":{"chrome":"46","opera":"33","edge":"14","firefox":"41","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-regenerator":{"chrome":"50","opera":"37","edge":"13","firefox":"53","safari":"10","node":"6","deno":"1","ios":"10","samsung":"5","opera_mobile":"37","electron":"1.1"},"transform-member-expression-literals":{"chrome":"7","opera":"12","edge":"12","firefox":"2","safari":"5.1","node":"0.4","deno":"1","ie":"9","android":"4","ios":"6","phantom":"1.9","samsung":"1","rhino":"1.7.13","opera_mobile":"12","electron":"0.20"},"transform-property-literals":{"chrome":"7","opera":"12","edge":"12","firefox":"2","safari":"5.1","node":"0.4","deno":"1","ie":"9","android":"4","ios":"6","phantom":"1.9","samsung":"1","rhino":"1.7.13","opera_mobile":"12","electron":"0.20"},"transform-reserved-words":{"chrome":"13","opera":"10.50","edge":"12","firefox":"2","safari":"3.1","node":"0.6","deno":"1","ie":"9","android":"4.4","ios":"6","phantom":"1.9","samsung":"1","rhino":"1.7.13","opera_mobile":"10.1","electron":"0.20"},"transform-export-namespace-from":{"chrome":"72","deno":"1.0","edge":"79","firefox":"80","node":"13.2.0","opera":"60","opera_mobile":"51","safari":"14.1","ios":"14.5","samsung":"11.0","android":"72","electron":"5.0"},"proposal-export-namespace-from":{"chrome":"72","deno":"1.0","edge":"79","firefox":"80","node":"13.2.0","opera":"60","opera_mobile":"51","safari":"14.1","ios":"14.5","samsung":"11.0","android":"72","electron":"5.0"}}')},10487:(e,t,n)=>{"use strict";var r=n(96897),i=n(30655),s=n(73126),o=n(12205);e.exports=function(e){var t=s(arguments),n=e.length-(arguments.length-1);return r(t,1+(n>0?n:0),!0)},i?i(e.exports,"apply",{value:o}):e.exports.apply=o},10776:(e,t,n)=>{var r=n(30756),i=n(95950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,r(o)]}return t}},10947:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=function(e){return Object.freeze(e)},t.flattenToSet=function(e){const t=new Set,n=[e];for(;n.length>0;)for(const e of n.pop())Array.isArray(e)?n.push(e):t.add(e);return t}},10985:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildUndefinedNode=function(){return(0,r.unaryExpression)("void",(0,r.numericLiteral)(0),!0)};var r=n(48079)},11002:e=>{"use strict";e.exports=Function.prototype.apply},11060:e=>{"use strict";function t(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const n=Symbol("LEAF_NODE");e.exports=class{constructor(e){this.decisionTree=this.makeDecisionTree(e)}handle(e,t){const n=this.match(e,t);if(!n.match)throw new Error("No Match Found for "+e.toString());if("function"!=typeof n.value)throw new Error("Expecting a function. Instead got - "+n.value.toString());n.value.call(null,e,n.keys)}match(e,t=(e,t)=>e===t){let r=this.decisionTree;const i={match:!1,value:void 0,keys:[]},s=Symbol("NO_MATCH");for(let p=0;p{var r=n(72552),i=n(28879),s=n(40346),o=Function.prototype,a=Object.prototype,l=o.toString,u=a.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!s(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},11514:(e,t,n)=>{"use strict";var r=n(38403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssignmentExpression=function(e,t,n){return!(!x(n)||!p(e.left))||S(e,t)},t.Binary=E,t.BinaryExpression=function(e,t,n){return"in"===e.operator&&Boolean(n&i.TokenContext.forInOrInitHeadAccumulate)},t.ClassExpression=function(e,t,n){return Boolean(n&(i.TokenContext.expressionStatement|i.TokenContext.exportDefault))},t.ArrowFunctionExpression=t.ConditionalExpression=S,t.DoExpression=function(e,t,n){return!e.async&&Boolean(n&i.TokenContext.expressionStatement)},t.FunctionExpression=function(e,t,n){return Boolean(n&(i.TokenContext.expressionStatement|i.TokenContext.exportDefault))},t.FunctionTypeAnnotation=function(e,t,n){const r=t.type;return"UnionTypeAnnotation"===r||"IntersectionTypeAnnotation"===r||"ArrayTypeAnnotation"===r||Boolean(n&i.TokenContext.arrowFlowReturnType)},t.Identifier=function(e,t,n,r){var s;const o=t.type;if(null!=(s=e.extra)&&s.parenthesized&&"AssignmentExpression"===o&&t.left===e){const e=t.right.type;if(("FunctionExpression"===e||"ClassExpression"===e)&&null==t.right.id)return!0}if(r&&r(e)!==e.name)return!1;if("let"===e.name){return!!((c(t,{object:e,computed:!0})||d(t,{object:e,computed:!0,optional:!1}))&&n&(i.TokenContext.expressionStatement|i.TokenContext.forInitHead|i.TokenContext.forInHead))||Boolean(n&i.TokenContext.forOfHead)}return"async"===e.name&&l(t,{left:e,await:!1})},t.LogicalExpression=function(e,t){const n=t.type;if(g(n))return!0;if("LogicalExpression"!==n)return!1;switch(e.operator){case"||":return"??"===t.operator||"&&"===t.operator;case"&&":return"??"===t.operator;case"??":return"??"!==t.operator}},t.NullableTypeAnnotation=function(e,t){return s(t)},t.ObjectExpression=function(e,t,n){return x(n)},t.OptionalIndexedAccessType=function(e,t){return u(t)&&t.objectType===e},t.OptionalCallExpression=t.OptionalMemberExpression=function(e,t){return a(t)&&t.callee===e||c(t)&&t.object===e},t.SequenceExpression=function(e,t){const n=t.type;if("SequenceExpression"===n||"ParenthesizedExpression"===n||"MemberExpression"===n&&t.property===e||"OptionalMemberExpression"===n&&t.property===e||"TemplateLiteral"===n)return!1;if("ClassDeclaration"===n)return!0;if("ForOfStatement"===n)return t.right===e;if("ExportDefaultDeclaration"===n)return!0;return!h(t)},t.TSSatisfiesExpression=t.TSAsExpression=function(e,t){if(("AssignmentExpression"===t.type||"AssignmentPattern"===t.type)&&t.left===e)return!0;if("BinaryExpression"===t.type&&("|"===t.operator||"&"===t.operator)&&e===t.left)return!0;return E(e,t)},t.TSConditionalType=function(e,t){const n=t.type;if("TSArrayType"===n||"TSIndexedAccessType"===n&&t.objectType===e||"TSOptionalType"===n||"TSTypeOperator"===n||"TSTypeParameter"===n)return!0;if(("TSIntersectionType"===n||"TSUnionType"===n)&&t.types[0]===e)return!0;if("TSConditionalType"===n&&(t.checkType===e||t.extendsType===e))return!0;return!1},t.TSConstructorType=t.TSFunctionType=function(e,t){const n=t.type;return"TSIntersectionType"===n||"TSUnionType"===n||"TSTypeOperator"===n||"TSOptionalType"===n||"TSArrayType"===n||"TSIndexedAccessType"===n&&t.objectType===e||"TSConditionalType"===n&&(t.checkType===e||t.extendsType===e)},t.TSInferType=function(e,t){const n=t.type;if("TSArrayType"===n||"TSIndexedAccessType"===n&&t.objectType===e||"TSOptionalType"===n)return!0;if(e.typeParameter.constraint&&("TSIntersectionType"===n||"TSUnionType"===n)&&t.types[0]===e)return!0;return!1},t.TSInstantiationExpression=function(e,t){const n=t.type;return("CallExpression"===n||"OptionalCallExpression"===n||"NewExpression"===n||"TSInstantiationExpression"===n)&&!!t.typeParameters},t.TSIntersectionType=function(e,t){const n=t.type;return"TSTypeOperator"===n||"TSArrayType"===n||"TSIndexedAccessType"===n&&t.objectType===e||"TSOptionalType"===n},t.UnaryLike=t.TSTypeAssertion=T,t.TSTypeOperator=function(e,t){const n=t.type;return"TSArrayType"===n||"TSIndexedAccessType"===n&&t.objectType===e||"TSOptionalType"===n},t.TSUnionType=function(e,t){const n=t.type;return"TSIntersectionType"===n||"TSTypeOperator"===n||"TSArrayType"===n||"TSIndexedAccessType"===n&&t.objectType===e||"TSOptionalType"===n},t.IntersectionTypeAnnotation=t.UnionTypeAnnotation=function(e,t){const n=t.type;return"ArrayTypeAnnotation"===n||"NullableTypeAnnotation"===n||"IntersectionTypeAnnotation"===n||"UnionTypeAnnotation"===n},t.UpdateExpression=function(e,t){return v(e,t)||b(e,t)},t.AwaitExpression=t.YieldExpression=function(e,t){const n=t.type;return"BinaryExpression"===n||"LogicalExpression"===n||"UnaryExpression"===n||"SpreadElement"===n||v(e,t)||"AwaitExpression"===n&&f(e)||"ConditionalExpression"===n&&e===t.test||b(e,t)||g(n)};var r=n(2352),i=n(31373);const{isArrayTypeAnnotation:s,isBinaryExpression:o,isCallExpression:a,isForOfStatement:l,isIndexedAccessType:u,isMemberExpression:c,isObjectPattern:p,isOptionalMemberExpression:d,isYieldExpression:f,isStatement:h}=r,y=new Map([["||",0],["??",0],["|>",0],["&&",1],["|",2],["^",3],["&",4],["==",5],["===",5],["!=",5],["!==",5],["<",6],[">",6],["<=",6],[">=",6],["in",6],["instanceof",6],[">>",7],["<<",7],[">>>",7],["+",8],["-",8],["*",9],["/",9],["%",9],["**",10]]);function m(e,t){return"BinaryExpression"===t||"LogicalExpression"===t?y.get(e.operator):"TSAsExpression"===t||"TSSatisfiesExpression"===t?y.get("in"):void 0}function g(e){return"TSAsExpression"===e||"TSSatisfiesExpression"===e||"TSTypeAssertion"===e}const b=(e,t)=>{const n=t.type;return("ClassDeclaration"===n||"ClassExpression"===n)&&t.superClass===e},v=(e,t)=>{const n=t.type;return("MemberExpression"===n||"OptionalMemberExpression"===n)&&t.object===e||("CallExpression"===n||"OptionalCallExpression"===n||"NewExpression"===n)&&t.callee===e||"TaggedTemplateExpression"===n&&t.tag===e||"TSNonNullExpression"===n};function x(e){return Boolean(e&(i.TokenContext.expressionStatement|i.TokenContext.arrowBody))}function E(e,t){const n=t.type;if("BinaryExpression"===e.type&&"**"===e.operator&&"BinaryExpression"===n&&"**"===t.operator)return t.left===e;if(b(e,t))return!0;if(v(e,t)||"UnaryExpression"===n||"SpreadElement"===n||"AwaitExpression"===n)return!0;const r=m(t,n);if(null!=r){const i=m(e,e.type);if(r===i&&"BinaryExpression"===n&&t.right===e||r>i)return!0}}function T(e,t){return v(e,t)||o(t)&&"**"===t.operator&&t.left===e||b(e,t)}function S(e,t){const n=t.type;return!!("UnaryExpression"===n||"SpreadElement"===n||"BinaryExpression"===n||"LogicalExpression"===n||"ConditionalExpression"===n&&t.test===e||"AwaitExpression"===n||g(n))||T(e,t)}},11786:e=>{"use strict";e.exports=function({types:e}){const t=e.unaryExpression("void",e.numericLiteral(0),!0);return{name:"transform-undefined-to-void",visitor:{ReferencedIdentifier(e){"undefined"===e.node.name&&e.replaceWith(t)}}}}},12205:(e,t,n)=>{"use strict";var r=n(66743),i=n(11002),s=n(13144);e.exports=function(){return s(r,i,arguments)}},12226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaggedTemplateExpression=function(e){this.print(e.tag),this.print(e.typeParameters),this.print(e.quasi)},t.TemplateElement=function(){throw new Error("TemplateElement printing is handled in TemplateLiteral")},t.TemplateLiteral=function(e){this._printTemplate(e,e.expressions)},t._printTemplate=function(e,t){const n=e.quasis;let r="`";for(let i=0;i{var r=n(74218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},12749:(e,t,n)=>{var r=n(81042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},13003:e=>{"use strict";e.exports=function(e){return e!=e}},13144:(e,t,n)=>{"use strict";var r=n(66743),i=n(11002),s=n(10076),o=n(47119);e.exports=o||r.call(s,i)},13222:(e,t,n)=>{var r=n(77556);e.exports=function(e){return null==e?"":r(e)}},14035:(e,t,n)=>{"use strict";var r,i=n(36556),s=n(49092)(),o=n(9957),a=n(75795);if(s){var l=i("RegExp.prototype.exec"),u={},c=function(){throw u},p={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(p[Symbol.toPrimitive]=c),r=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!(t&&o(t,"value")))return!1;try{l(e,p)}catch(e){return e===u}}}else{var d=i("Object.prototype.toString");r=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===d(e)}}e.exports=r},14071:e=>{"use strict";e.exports=function(e){if(!e.isBlockStatement())throw new Error(`Received ${e.type}. Expected BlockStatement. Please report at ${t}`);const n=r(e);if(n.length<1)return;if(n.length>1)for(let e=1;ee.isBlockStatement()&&function(e){return r(e).length>0}(e))&&n[0].remove();var i};const t="https://github.com/babel/minify/issues/new",n="use strict";function r(e){var t=e.get("directives");return Array.isArray(t)?t.filter(function(e){return e.node.value.value===n}):[]}},14089:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){const l=[];let u=!0;for(const c of t)if((0,i.isEmptyStatement)(c)||(u=!1),(0,i.isExpression)(c))l.push(c);else if((0,i.isExpressionStatement)(c))l.push(c.expression);else if((0,i.isVariableDeclaration)(c)){if("var"!==c.kind)return;for(const e of c.declarations){const t=(0,r.default)(e);for(const e of Object.keys(t))n.push({kind:c.kind,id:(0,a.default)(t[e])});e.init&&l.push((0,s.assignmentExpression)("=",e.id,e.init))}u=!0}else if((0,i.isIfStatement)(c)){const t=c.consequent?e([c.consequent],n):(0,o.buildUndefinedNode)(),r=c.alternate?e([c.alternate],n):(0,o.buildUndefinedNode)();if(!t||!r)return;l.push((0,s.conditionalExpression)(c.test,t,r))}else if((0,i.isBlockStatement)(c)){const t=e(c.body,n);if(!t)return;l.push(t)}else{if(!(0,i.isEmptyStatement)(c))return;0===t.indexOf(c)&&(u=!0)}u&&l.push((0,o.buildUndefinedNode)());return 1===l.length?l[0]:(0,s.sequenceExpression)(l)};var r=n(70329),i=n(98960),s=n(48079),o=n(10985),a=n(85279)},14248:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{"use strict";const r=n(55810);function i(e,{tdz:t,scope:n={hasBinding:()=>!1}}={}){if(e.isIdentifier()&&"undefined"===e.node.name)return!n.hasBinding(e.node.name,!0);if(!e.isPure())return!1;const i=r(e,{tdz:t});return!0===i.confident&&void 0===i.value}function s(e,t){const n=e.findParent(e=>e.isLoop()||e===t);return n===t?null:n}function o(e,t){const n=e.findParent(e=>e.isFunction());return n===t?null:n}function a(e,t,n=new Set){for(let r=o(e,t);r;r=o(r,t)){const e=r.node.id,i=e&&r.scope.getBinding(e.name);i&&i.referencePaths.forEach(e=>{n.has(e)||(n.add(e),a(e,t,n))})}return n}function l(e,t,n){const r=t.getBinding(e.node.id.name);if(!r)return!0;const i=e.getFunctionParent();return r.constantViolations.some(t=>{if(!t.node)return!1;const r=t.node.start;if(void 0===r||rr)return!0})}e.exports=function(){return{name:"transform-remove-undefined",visitor:{SequenceExpression(e,{opts:{tdz:t}={}}){const n=e.get("expressions");for(let r=0;r{var r,i=n(65606);t=e.exports=v,r="object"==typeof i&&i.env&&i.env.NODE_DEBUG&&/\bsemver\b/i.test(i.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var s=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=s-6,l=t.re=[],u=t.safeRe=[],c=t.src=[],p=t.tokens={},d=0;function f(e){p[e]=d++}var h="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",s],[h,a]];function m(e){for(var t=0;t)?=?)",f("XRANGEIDENTIFIERLOOSE"),c[p.XRANGEIDENTIFIERLOOSE]=c[p.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",f("XRANGEIDENTIFIER"),c[p.XRANGEIDENTIFIER]=c[p.NUMERICIDENTIFIER]+"|x|X|\\*",f("XRANGEPLAIN"),c[p.XRANGEPLAIN]="[v=\\s]*("+c[p.XRANGEIDENTIFIER]+")(?:\\.("+c[p.XRANGEIDENTIFIER]+")(?:\\.("+c[p.XRANGEIDENTIFIER]+")(?:"+c[p.PRERELEASE]+")?"+c[p.BUILD]+"?)?)?",f("XRANGEPLAINLOOSE"),c[p.XRANGEPLAINLOOSE]="[v=\\s]*("+c[p.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[p.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[p.XRANGEIDENTIFIERLOOSE]+")(?:"+c[p.PRERELEASELOOSE]+")?"+c[p.BUILD]+"?)?)?",f("XRANGE"),c[p.XRANGE]="^"+c[p.GTLT]+"\\s*"+c[p.XRANGEPLAIN]+"$",f("XRANGELOOSE"),c[p.XRANGELOOSE]="^"+c[p.GTLT]+"\\s*"+c[p.XRANGEPLAINLOOSE]+"$",f("COERCE"),c[p.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",f("COERCERTL"),l[p.COERCERTL]=new RegExp(c[p.COERCE],"g"),u[p.COERCERTL]=new RegExp(m(c[p.COERCE]),"g"),f("LONETILDE"),c[p.LONETILDE]="(?:~>?)",f("TILDETRIM"),c[p.TILDETRIM]="(\\s*)"+c[p.LONETILDE]+"\\s+",l[p.TILDETRIM]=new RegExp(c[p.TILDETRIM],"g"),u[p.TILDETRIM]=new RegExp(m(c[p.TILDETRIM]),"g");f("TILDE"),c[p.TILDE]="^"+c[p.LONETILDE]+c[p.XRANGEPLAIN]+"$",f("TILDELOOSE"),c[p.TILDELOOSE]="^"+c[p.LONETILDE]+c[p.XRANGEPLAINLOOSE]+"$",f("LONECARET"),c[p.LONECARET]="(?:\\^)",f("CARETTRIM"),c[p.CARETTRIM]="(\\s*)"+c[p.LONECARET]+"\\s+",l[p.CARETTRIM]=new RegExp(c[p.CARETTRIM],"g"),u[p.CARETTRIM]=new RegExp(m(c[p.CARETTRIM]),"g");f("CARET"),c[p.CARET]="^"+c[p.LONECARET]+c[p.XRANGEPLAIN]+"$",f("CARETLOOSE"),c[p.CARETLOOSE]="^"+c[p.LONECARET]+c[p.XRANGEPLAINLOOSE]+"$",f("COMPARATORLOOSE"),c[p.COMPARATORLOOSE]="^"+c[p.GTLT]+"\\s*("+c[p.LOOSEPLAIN]+")$|^$",f("COMPARATOR"),c[p.COMPARATOR]="^"+c[p.GTLT]+"\\s*("+c[p.FULLPLAIN]+")$|^$",f("COMPARATORTRIM"),c[p.COMPARATORTRIM]="(\\s*)"+c[p.GTLT]+"\\s*("+c[p.LOOSEPLAIN]+"|"+c[p.XRANGEPLAIN]+")",l[p.COMPARATORTRIM]=new RegExp(c[p.COMPARATORTRIM],"g"),u[p.COMPARATORTRIM]=new RegExp(m(c[p.COMPARATORTRIM]),"g");f("HYPHENRANGE"),c[p.HYPHENRANGE]="^\\s*("+c[p.XRANGEPLAIN]+")\\s+-\\s+("+c[p.XRANGEPLAIN]+")\\s*$",f("HYPHENRANGELOOSE"),c[p.HYPHENRANGELOOSE]="^\\s*("+c[p.XRANGEPLAINLOOSE]+")\\s+-\\s+("+c[p.XRANGEPLAINLOOSE]+")\\s*$",f("STAR"),c[p.STAR]="(<|>)?=?\\s*\\*";for(var g=0;gs)return null;if(!(t.loose?u[p.LOOSE]:u[p.FULL]).test(e))return null;try{return new v(e,t)}catch(e){return null}}function v(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof v){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>s)throw new TypeError("version is longer than "+s+" characters");if(!(this instanceof v))return new v(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var n=e.trim().match(t.loose?u[p.LOOSE]:u[p.FULL]);if(!n)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new v(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(P(e,t))return null;var n=b(e),r=b(t),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var s="prerelease"}for(var o in n)if(("major"===o||"minor"===o||"patch"===o)&&n[o]!==r[o])return i+o;return s},t.compareIdentifiers=E;var x=/^[0-9]+$/;function E(e,t){var n=x.test(e),r=x.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function A(e,t,n){return T(e,t,n)<0}function P(e,t,n){return 0===T(e,t,n)}function C(e,t,n){return 0!==T(e,t,n)}function w(e,t,n){return T(e,t,n)>=0}function D(e,t,n){return T(e,t,n)<=0}function I(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return P(e,n,r);case"!=":return C(e,n,r);case">":return S(e,n,r);case">=":return w(e,n,r);case"<":return A(e,n,r);case"<=":return D(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function O(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof O){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof O))return new O(e,t);e=e.trim().split(/\s+/).join(" "),r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===B?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return E(t,e)},t.major=function(e,t){return new v(e,t).major},t.minor=function(e,t){return new v(e,t).minor},t.patch=function(e,t){return new v(e,t).patch},t.compare=T,t.compareLoose=function(e,t){return T(e,t,!0)},t.compareBuild=function(e,t,n){var r=new v(e,n),i=new v(t,n);return r.compare(i)||r.compareBuild(i)},t.rcompare=function(e,t,n){return T(t,e,n)},t.sort=function(e,n){return e.sort(function(e,r){return t.compareBuild(e,r,n)})},t.rsort=function(e,n){return e.sort(function(e,r){return t.compareBuild(r,e,n)})},t.gt=S,t.lt=A,t.eq=P,t.neq=C,t.gte=w,t.lte=D,t.cmp=I,t.Comparator=O;var B={};function k(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof k)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new k(e.raw,t);if(e instanceof O)return new k(e.value,t);if(!(this instanceof k))return new k(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function F(e,t){for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every(function(e){return i.intersects(e,t)}),i=r.pop();return n}function N(e){return!e||"x"===e.toLowerCase()||"*"===e}function _(e,t,n,r,i,s,o,a,l,u,c,p,d){return((t=N(n)?"":N(r)?">="+n+".0.0":N(i)?">="+n+"."+r+".0":">="+t)+" "+(a=N(l)?"":N(u)?"<"+(+l+1)+".0.0":N(c)?"<"+l+"."+(+u+1)+".0":p?"<="+l+"."+u+"."+c+"-"+p:"<="+a)).trim()}function j(e,t,n){for(var i=0;i0){var s=e[i].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}function L(e,t,n){try{t=new k(t,n)}catch(e){return!1}return t.test(e)}function M(e,t,n,r){var i,s,o,a,l;switch(e=new v(e,r),t=new k(t,r),n){case">":i=S,s=D,o=A,a=">",l=">=";break;case"<":i=A,s=w,o=S,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(L(e,t,r))return!1;for(var u=0;u=0.0.0")),p=p||e,d=d||e,i(e.semver,p.semver,r)?p=e:o(e.semver,d.semver,r)&&(d=e)}),p.operator===a||p.operator===l)return!1;if((!d.operator||d.operator===a)&&s(e,d.semver))return!1;if(d.operator===l&&o(e,d.semver))return!1}return!0}O.prototype.parse=function(e){var t=this.options.loose?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new v(n[2],this.options.loose):this.semver=B},O.prototype.toString=function(){return this.value},O.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===B||e===B)return!0;if("string"==typeof e)try{e=new v(e,this.options)}catch(e){return!1}return I(e,this.operator,this.semver,this.options)},O.prototype.intersects=function(e,t){if(!(e instanceof O))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new k(e.value,t),L(this.value,n,t));if(""===e.operator)return""===e.value||(n=new k(this.value,t),L(e.semver,n,t));var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=I(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),l=I(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&o||a||l},t.Range=k,k.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},k.prototype.toString=function(){return this.range},k.prototype.parseRange=function(e){var t=this.options.loose,n=t?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(n,_),r("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,u[p.COMPARATORTRIM]),e=(e=(e=e.replace(u[p.TILDETRIM],"$1~")).replace(u[p.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],s=e.split(" ").map(function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){r("caret",e,t);var n=t.loose?u[p.CARETLOOSE]:u[p.CARET];return e.replace(n,function(t,n,i,s,o){var a;return r("caret",e,t,n,i,s,o),N(n)?a="":N(i)?a=">="+n+".0.0 <"+(+n+1)+".0.0":N(s)?a="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":o?(r("replaceCaret pr",o),a="0"===n?"0"===i?">="+n+"."+i+"."+s+"-"+o+" <"+n+"."+i+"."+(+s+1):">="+n+"."+i+"."+s+"-"+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+s+"-"+o+" <"+(+n+1)+".0.0"):(r("no pr"),a="0"===n?"0"===i?">="+n+"."+i+"."+s+" <"+n+"."+i+"."+(+s+1):">="+n+"."+i+"."+s+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+s+" <"+(+n+1)+".0.0"),r("caret return",a),a})}(e,t)}).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){var n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,function(t,n,i,s,o){var a;return r("tilde",e,t,n,i,s,o),N(n)?a="":N(i)?a=">="+n+".0.0 <"+(+n+1)+".0.0":N(s)?a=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":o?(r("replaceTilde pr",o),a=">="+n+"."+i+"."+s+"-"+o+" <"+n+"."+(+i+1)+".0"):a=">="+n+"."+i+"."+s+" <"+n+"."+(+i+1)+".0",r("tilde return",a),a})}(e,t)}).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return function(e,t){e=e.trim();var n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,function(n,i,s,o,a,l){r("xRange",e,n,i,s,o,a,l);var u=N(s),c=u||N(o),p=c||N(a),d=p;return"="===i&&d&&(i=""),l=t.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(c&&(o=0),a=0,">"===i?(i=">=",c?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):"<="===i&&(i="<",c?s=+s+1:o=+o+1),n=i+s+"."+o+"."+a+l):c?n=">="+s+".0.0"+l+" <"+(+s+1)+".0.0"+l:p&&(n=">="+s+"."+o+".0"+l+" <"+s+"."+(+o+1)+".0"+l),r("xRange return",n),n})}(e,t)}).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(u[p.STAR],"")}(e,t),r("stars",e),e}(e,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter(function(e){return!!e.match(i)})),s=s.map(function(e){return new O(e,this.options)},this)},k.prototype.intersects=function(e,t){if(!(e instanceof k))throw new TypeError("a Range is required");return this.set.some(function(n){return F(n,t)&&e.set.some(function(e){return F(e,t)&&n.every(function(n){return e.every(function(e){return n.intersects(e,t)})})})})},t.toComparators=function(e,t){return new k(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},k.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new v(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!S(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})}if(n&&e.test(n))return n;return null},t.validRange=function(e,t){try{return new k(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return M(e,t,"<",n)},t.gtr=function(e,t,n){return M(e,t,">",n)},t.outside=M,t.prerelease=function(e,t){var n=b(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new k(e,n),t=new k(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof v)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var r;(r=u[p.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),u[p.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;u[p.COERCERTL].lastIndex=-1}else n=e.match(u[p.COERCE]);if(null===n)return null;return b(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}},15389:(e,t,n)=>{var r=n(93663),i=n(87978),s=n(83488),o=n(56449),a=n(50583);e.exports=function(e){return"function"==typeof e?e:null==e?s:"object"==typeof e?o(e)?i(e[0],e[1]):r(e):a(e)}},15586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)("trailingComments",e,t)};var r=n(73205)},15677:(e,t,n)=>{"use strict";const r=n(38826).reduceStaticPropertyNameES5;e.exports=function({types:e}){return{name:"transform-property-literals",visitor:{ObjectProperty:{exit(t){const n=t.get("key");if(!n.isStringLiteral())return;const i=e.clone(t.node);i.key=r(e,n.node),i.computed=!1,t.replaceWith(i)}}}}}},16109:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getKey=g,t._getPattern=b,t.get=function(e,t=!0){!0===t&&(t=this.context);const n=e.split(".");return 1===n.length?g.call(this,e,t):b.call(this,n,t)},t.getAllNextSiblings=function(){let e=this.key,t=this.getSibling(++e);const n=[];for(;t.node;)n.push(t),t=this.getSibling(++e);return n},t.getAllPrevSiblings=function(){let e=this.key,t=this.getSibling(--e);const n=[];for(;t.node;)n.push(t),t=this.getSibling(--e);return n},t.getAssignmentIdentifiers=function(){return s(this.node)},t.getBindingIdentifierPaths=function(e=!1,t=!1){const n=[this],r=Object.create(null);for(;n.length;){const i=n.shift();if(!i)continue;if(!i.node)continue;const s=o.keys[i.node.type];if(i.isIdentifier())if(e){(r[i.node.name]=r[i.node.name]||[]).push(i)}else r[i.node.name]=i;else{if(i.isExportDeclaration()){const e=i.get("declaration");e.isDeclaration()&&n.push(e);continue}if(t){if(i.isFunctionDeclaration()){n.push(i.get("id"));continue}if(i.isFunctionExpression())continue}if(s)for(let e=0;ee.path)},t.getNextSibling=function(){return this.getSibling(this.key+1)},t.getOpposite=function(){if("left"===this.key)return this.getSibling("right");if("right"===this.key)return this.getSibling("left");return null},t.getOuterBindingIdentifierPaths=function(e=!1){return this.getBindingIdentifierPaths(e,!0)},t.getOuterBindingIdentifiers=function(e){return a(this.node,e)},t.getPrevSibling=function(){return this.getSibling(this.key-1)},t.getSibling=function(e){return r.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e}).setContext(this.context)};var r=n(29709),i=n(2352);const{getAssignmentIdentifiers:s,getBindingIdentifiers:o,getOuterBindingIdentifiers:a,numericLiteral:l,unaryExpression:u}=i,c=0,p=1;function d(e,t,n){return e&&t.push(...m(e,n)),t}function f(e){e.forEach(e=>{e.type=p})}function h(e,t){e.forEach(e=>{e.path.isBreakStatement({label:null})&&(t?e.path.replaceWith(u("void",l(0))):e.path.remove())})}function y(e,t){const n=[];if(t.canHaveBreak){let r=[];for(let i=0;i0&&a.every(e=>e.type===p)){r.length>0&&a.every(e=>e.path.isBreakStatement({label:null}))?(f(r),n.push(...r),r.some(e=>e.path.isDeclaration())&&(n.push(...a),t.shouldPreserveBreak||h(a,!0)),t.shouldPreserveBreak||h(a,!1)):(n.push(...a),t.shouldPopulateBreak||t.shouldPreserveBreak||h(a,!0));break}if(i===e.length-1)n.push(...a);else{r=[];for(let e=0;e=0;r--){const i=m(e[r],t);if(i.length>1||1===i.length&&!i[0].path.isVariableDeclaration()&&!i[0].path.isEmptyStatement()){n.push(...i);break}}return n}function m(e,t){let n=[];if(e.isIfStatement())n=d(e.get("consequent"),n,t),n=d(e.get("alternate"),n,t);else{if(e.isDoExpression()||e.isFor()||e.isWhile()||e.isLabeledStatement())return d(e.get("body"),n,t);if(e.isProgram()||e.isBlockStatement())return y(e.get("body"),t);if(e.isFunction())return m(e.get("body"),t);if(e.isTryStatement())n=d(e.get("block"),n,t),n=d(e.get("handler"),n,t);else{if(e.isCatchClause())return d(e.get("body"),n,t);if(e.isSwitchStatement())return function(e,t,n){let r=[];for(let i=0;ir.default.get({listKey:e,parentPath:this,parent:n,container:i,key:o}).setContext(t)):r.default.get({parentPath:this,parent:n,container:n,key:e}).setContext(t)}function b(e,t){let n=this;for(const r of e)n="."===r?n.parentPath:Array.isArray(n)?n[r]:n.get(r,t);return n}},16299:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHighestUnreleased=function(e,t,n){return u(e,t,n)===e?t:e},t.getLowestImplementedVersion=function(e,t){const n=e[t];if(!n&&"android"===t)return e.chrome;return n},t.getLowestUnreleased=u,t.isUnreleasedVersion=function(e,t){const n=s.unreleasedLabels[t];return!!n&&n===e.toString().toLowerCase()},t.semverMin=l,t.semverify=function(e){if("string"==typeof e&&r.valid(e))return e;a.invariant("number"==typeof e||"string"==typeof e&&o.test(e),`'${e}' is not a valid version`),e=e.toString();let t=0,n=0;for(;(t=e.indexOf(".",t+1))>0;)n++;return e+".0".repeat(2-n)};var r=n(15345),i=n(130),s=n(61884);const o=/^(?:\d+|\d(?:\d?[^\d\n\r\u2028\u2029]\d+|\d{2,}(?:[^\d\n\r\u2028\u2029]\d+)?))$/,a=new i.OptionValidator("@babel/helper-compilation-targets");function l(e,t){return e&&r.lt(e,t)?e:t}function u(e,t,n){const r=s.unreleasedLabels[n];return e===r?t:t===r?e:l(e,t)}},16818:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"module"===e.node.sourceType}},16871:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDynamicImport=function(e,t,n,i){const s=r.types.isCallExpression(e)?e.arguments[0]:e.source;if(r.types.isStringLiteral(s)||r.types.isTemplateLiteral(s)&&0===s.quasis.length)return t?r.template.expression.ast` + Promise.resolve().then(() => ${i(s)}) + `:i(s);const o=r.types.isTemplateLiteral(s)?r.types.identifier("specifier"):r.types.templateLiteral([r.types.templateElement({raw:""}),r.types.templateElement({raw:""})],[r.types.identifier("specifier")]);return t?r.template.expression.ast` + (specifier => + new Promise(r => r(${o})) + .then(s => ${i(r.types.identifier("s"))}) + )(${s}) + `:n?r.template.expression.ast` + (specifier => + new Promise(r => r(${i(o)})) + )(${s}) + `:r.template.expression.ast` + (specifier => ${i(o)})(${s}) + `};var r=n(6416);t.getDynamicImportSource=function(e){const[t]=e.arguments;return r.types.isStringLiteral(t)||r.types.isTemplateLiteral(t)?t:r.template.expression.ast`\`\${${t}}\``}},17159:e=>{"use strict";const t={},n=t.hasOwnProperty,r=(e,t)=>{for(const r in e)n.call(e,r)&&t(r,e[r])},i=e=>"\\u"+("0000"+e).slice(-4),s=(e,t)=>{let n=e.toString(16);return t?n:n.toUpperCase()},o=t.toString,a=Array.isArray,l=e=>"bigint"==typeof e,u={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},c=/[\\\b\f\n\r\t]/,p=/[0-9]/,d=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,f=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,h=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,y=(e,t)=>{const n=()=>{A=S,++t.indentLevel,S=t.indent.repeat(t.indentLevel)},m={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",indentLevel:0,__inline1__:!1,__inline2__:!1},g=t&&t.json;var b,v;g&&(m.quotes="double",m.wrap=!0),b=m,"single"!=(t=(v=t)?(r(v,(e,t)=>{b[e]=t}),b):b).quotes&&"double"!=t.quotes&&"backtick"!=t.quotes&&(t.quotes="single");const x="double"==t.quotes?'"':"backtick"==t.quotes?"`":"'",E=t.compact,T=t.lowercaseHex;let S=t.indent.repeat(t.indentLevel),A="";const P=t.__inline1__,C=t.__inline2__,w=E?"":"\n";let D,I=!0;const O="binary"==t.numbers,B="octal"==t.numbers,k="decimal"==t.numbers,F="hexadecimal"==t.numbers;if(g&&e&&(e=>"function"==typeof e)(e.toJSON)&&(e=e.toJSON()),!(e=>"string"==typeof e||"[object String]"==o.call(e))(e)){if((e=>"[object Map]"==o.call(e))(e))return 0==e.size?"new Map()":(E||(t.__inline1__=!0,t.__inline2__=!1),"new Map("+y(Array.from(e),t)+")");if((e=>"[object Set]"==o.call(e))(e))return 0==e.size?"new Set()":"new Set("+y(Array.from(e),t)+")";if((e=>"function"==typeof Buffer&&Buffer.isBuffer(e))(e))return 0==e.length?"Buffer.from([])":"Buffer.from("+y(Array.from(e),t)+")";if(a(e))return D=[],t.wrap=!0,P&&(t.__inline1__=!1,t.__inline2__=!0),C||n(),((e,t)=>{const n=e.length;let r=-1;for(;++r{I=!1,C&&(t.__inline2__=!1),D.push((E||C?"":S)+y(e,t))}),I?"[]":C?"["+D.join(", ")+"]":"["+w+D.join(","+w)+w+(E?"":A)+"]";if((e=>"number"==typeof e||"[object Number]"==o.call(e))(e)||l(e)){if(g)return JSON.stringify(Number(e));let t;if(k)t=String(e);else if(F){let n=e.toString(16);T||(n=n.toUpperCase()),t="0x"+n}else O?t="0b"+e.toString(2):B&&(t="0o"+e.toString(8));return l(e)?t+"n":t}return l(e)?g?JSON.stringify(Number(e)):e+"n":(e=>"[object Object]"==o.call(e))(e)?(D=[],t.wrap=!0,n(),r(e,(e,n)=>{I=!1,D.push((E?"":S)+y(e,t)+":"+(E?"":" ")+y(n,t))}),I?"{}":"{"+w+D.join(","+w)+w+(E?"":A)+"}"):g?JSON.stringify(e)||"null":String(e)}const N=t.escapeEverything?f:h;return D=e.replace(N,(e,n,r,o,a,l)=>{if(n){if(t.minimal)return n;const e=n.charCodeAt(0),r=n.charCodeAt(1);if(t.es6){return"\\u{"+s(1024*(e-55296)+r-56320+65536,T)+"}"}return i(s(e,T))+i(s(r,T))}if(r)return i(s(r.charCodeAt(0),T));if("\0"==e&&!g&&!p.test(l.charAt(a+1)))return"\\0";if(o)return o==x||t.escapeEverything?"\\"+o:o;if(c.test(e))return u[e];if(t.minimal&&!d.test(e))return e;const f=s(e.charCodeAt(0),T);return g||f.length>2?i(f):"\\x"+("00"+f).slice(-2)}),"`"==x&&(D=D.replace(/\$\{/g,"\\${")),t.isScriptContext&&(D=D.replace(/<\/(script|style)/gi,"<\\/$1").replace(/` line comment - this.skipLineComment(3); - this.skipSpace(); - this.nextToken(); - return; - } - - this.finishOp(types.incDec, 2); - return; - } - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.plusMin, 1); - } - }; - - _proto.readToken_lt_gt = function readToken_lt_gt(code) { - // '<>' - var next = this.input.charCodeAt(this.state.pos + 1); - var size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - - if (this.input.charCodeAt(this.state.pos + size) === 61) { - this.finishOp(types.assign, size + 1); - return; - } - - this.finishOp(types.bitShift, size); - return; - } - - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { - // `` line comment - this.skipLineComment(3); - this.skipSpace(); - this.nextToken(); - return; - } - - this.finishOp(types.incDec, 2); - return; - } - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.plusMin, 1); - } - }; - - _proto.readToken_lt_gt = function readToken_lt_gt(code) { - // '<>' - var next = this.input.charCodeAt(this.state.pos + 1); - var size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - - if (this.input.charCodeAt(this.state.pos + size) === 61) { - this.finishOp(types.assign, size + 1); - return; - } - - this.finishOp(types.bitShift, size); - return; - } - - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { - // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types$1.incDec, 2) - } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.plusMin, 1) - }; - - pp.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(types$1.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types$1.incDec, 2) - } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.plusMin, 1) -}; - -pp.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(types$1.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types$1.incDec, 2) - } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.plusMin, 1) - }; - - pp.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(types$1.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `' is a single-line comment - this.index += 3; - var comment = this.skipSingleLineComment(3); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (ch === 0x3C && !this.isModule) { - if (this.source.slice(this.index + 1, this.index + 4) === '!--') { - this.index += 4; // ` args - argumentsVar.references.forEach(function (ref) { - ref.identifier.name = 'args'; - }); - // Change function() --> function(...args) - node.params = [createRestElement()]; - } - } - } - })); -} -function isES5Function(node) { - return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression'; -} -function hasArgs(scope) { - if (!scope) { - return false; - } - if (scope.variables.some(function (v) { - return v.name === 'args'; - })) { - return true; - } - return hasArgs(scope.upper); -} -function createRestElement() { - return { - type: 'RestElement', - argument: { - type: 'Identifier', - name: 'args' - } - }; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/argSpread.js": -/*!*******************************************************!*\ - !*** ./node_modules/lebab/lib/transform/argSpread.js ***! - \*******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - var _matchFunctionApplyCa = matchFunctionApplyCall(node), - func = _matchFunctionApplyCa.func, - array = _matchFunctionApplyCa.array; - if (func) { - return createCallWithSpread(func, array); - } - var _matchObjectApplyCall = matchObjectApplyCall(node), - memberExpr = _matchObjectApplyCall.memberExpr, - thisParam = _matchObjectApplyCall.thisParam, - arrayParam = _matchObjectApplyCall.arrayParam; - if (memberExpr && (0, _fp.isEqual)(omitLoc(memberExpr.object), omitLoc(thisParam))) { - return createCallWithSpread(memberExpr, arrayParam); - } - } - }); -} -function createCallWithSpread(func, array) { - return { - type: 'CallExpression', - callee: func, - arguments: [{ - type: 'SpreadElement', - argument: array - }] - }; -} - -// Recursively strips `loc`, `start` and `end` fields from given object and its nested objects, -// removing the location information that we don't care about when comparing -// AST nodes. -function omitLoc(obj) { - if ((0, _fp.isArray)(obj)) { - return obj.map(omitLoc); - } else if ((0, _fp.isObjectLike)(obj)) { - return (0, _fp.flow)((0, _fp.omit)(['loc', 'start', 'end']), (0, _fp.mapValues)(omitLoc))(obj); - } else { - return obj; - } -} -var isUndefined = (0, _fMatches.matches)({ - type: 'Identifier', - name: 'undefined' -}); -var isNull = (0, _fMatches.matches)({ - type: 'Literal', - value: null, - // eslint-disable-line no-null/no-null - raw: 'null' -}); -function matchFunctionApplyCall(node) { - return (0, _fMatches.matches)({ - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: (0, _fMatches.extract)('func', { - type: 'Identifier' - }), - property: { - type: 'Identifier', - name: 'apply' - } - }, - arguments: [function (arg) { - return isUndefined(arg) || isNull(arg); - }, (0, _fMatches.extractAny)('array')] - }, node); -} -function matchObjectApplyCall(node) { - return (0, _fMatches.matches)({ - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: (0, _fMatches.extract)('memberExpr', { - type: 'MemberExpression' - }), - property: { - type: 'Identifier', - name: 'apply' - } - }, - arguments: [(0, _fMatches.extractAny)('thisParam'), (0, _fMatches.extractAny)('arrayParam')] - }, node); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/arrow.js": -/*!***************************************************!*\ - !*** ./node_modules/lebab/lib/transform/arrow.js ***! - \***************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _ArrowFunctionExpression = _interopRequireDefault(__webpack_require__(/*! ../syntax/ArrowFunctionExpression */ "./node_modules/lebab/lib/syntax/ArrowFunctionExpression.js")); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _copyComments = _interopRequireDefault(__webpack_require__(/*! ../utils/copyComments */ "./node_modules/lebab/lib/utils/copyComments.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast, logger) { - _traverser["default"].replace(ast, { - enter: function enter(node, parent) { - if (isFunctionConvertableToArrow(node, parent)) { - if (hasArguments(node.body)) { - logger.warn(node, 'Can not use arguments in arrow function', 'arrow'); - return; - } - return functionToArrow(node, parent); - } - var _matchBoundFunction = matchBoundFunction(node), - func = _matchBoundFunction.func; - if (func) { - return functionToArrow(func, parent); - } - } - }); -} -function isFunctionConvertableToArrow(node, parent) { - return node.type === 'FunctionExpression' && parent.type !== 'Property' && parent.type !== 'MethodDefinition' && !node.id && !node.generator && !hasThis(node.body); -} - -// Matches: function(){}.bind(this) -function matchBoundFunction(node) { - return (0, _fMatches.matches)({ - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: (0, _fMatches.extract)('func', { - type: 'FunctionExpression', - id: null, - // eslint-disable-line no-null/no-null - body: function body(_body) { - return !hasArguments(_body); - }, - generator: false - }), - property: { - type: 'Identifier', - name: 'bind' - } - }, - arguments: (0, _fMatches.matchesLength)([{ - type: 'ThisExpression' - }]) - }, node); -} -function hasThis(ast) { - return hasInFunctionBody(ast, { - type: 'ThisExpression' - }); -} -function hasArguments(ast) { - return hasInFunctionBody(ast, { - type: 'Identifier', - name: 'arguments' - }); -} - -// Returns true when pattern matches any node in given function body, -// excluding any nested functions -function hasInFunctionBody(ast, pattern) { - return _traverser["default"].find(ast, (0, _fp.matches)(pattern), { - skipTypes: ['FunctionExpression', 'FunctionDeclaration'] - }); -} -function functionToArrow(func, parent) { - var arrow = new _ArrowFunctionExpression["default"]({ - body: func.body, - params: func.params, - defaults: func.defaults, - rest: func.rest, - async: func.async - }); - (0, _copyComments["default"])({ - from: func, - to: arrow - }); - - // Get rid of extra parentheses around IIFE - // by forcing Recast to reformat the CallExpression - if (isIIFE(func, parent)) { - parent.original = null; // eslint-disable-line no-null/no-null - } - return arrow; -} - -// Is it immediately invoked function expression? -function isIIFE(func, parent) { - return parent.type === 'CallExpression' && parent.callee === func; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/arrowReturn.js": -/*!*********************************************************!*\ - !*** ./node_modules/lebab/lib/transform/arrowReturn.js ***! - \*********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _copyComments = _interopRequireDefault(__webpack_require__(/*! ../utils/copyComments */ "./node_modules/lebab/lib/utils/copyComments.js")); -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - if (isShortenableArrowFunction(node)) { - return shortenReturn(node); - } - } - }); -} -function shortenReturn(node) { - node.body = extractArrowBody(node.body); - return node; -} -var matchesReturnBlock = (0, _fMatches.matches)({ - type: 'BlockStatement', - body: (0, _fMatches.matchesLength)([(0, _fMatches.extract)('returnStatement', { - type: 'ReturnStatement', - argument: (0, _fMatches.extract)('returnVal', (0, _fp.negate)(_fp.isNull)) - })]) -}); -function isShortenableArrowFunction(node) { - return node.type === 'ArrowFunctionExpression' && matchesReturnBlock(node.body); -} -function extractArrowBody(block) { - var _matchesReturnBlock = matchesReturnBlock(block), - returnStatement = _matchesReturnBlock.returnStatement, - returnVal = _matchesReturnBlock.returnVal; - // preserve return statement comments - (0, _copyComments["default"])({ - from: returnStatement, - to: returnVal - }); - return returnVal; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/PotentialClass.js": -/*!******************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/PotentialClass.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _extractComments = _interopRequireDefault(__webpack_require__(/*! ./extractComments */ "./node_modules/lebab/lib/transform/class/extractComments.js")); -var _multiReplaceStatement = _interopRequireDefault(__webpack_require__(/*! ./../../utils/multiReplaceStatement */ "./node_modules/lebab/lib/utils/multiReplaceStatement.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Represents a potential class to be created. - */ -var PotentialClass = /*#__PURE__*/function () { - /** - * @param {Object} cfg - * @param {String} cfg.name Class name - * @param {Object} cfg.fullNode Node to remove after converting to class - * @param {Object[]} cfg.commentNodes Nodes to extract comments from - * @param {Object} cfg.parent - */ - function PotentialClass(_ref) { - var name = _ref.name, - fullNode = _ref.fullNode, - commentNodes = _ref.commentNodes, - parent = _ref.parent; - _classCallCheck(this, PotentialClass); - this.name = name; - this.constructor = undefined; - this.fullNode = fullNode; - this.superClass = undefined; - this.commentNodes = commentNodes; - this.parent = parent; - this.methods = []; - this.replacements = []; - } - - /** - * Returns the name of the class. - * @return {String} - */ - _createClass(PotentialClass, [{ - key: "getName", - value: function getName() { - return this.name; - } - - /** - * Returns the AST node for the original function - * @return {Object} - */ - }, { - key: "getFullNode", - value: function getFullNode() { - return this.fullNode; - } - - /** - * Set the constructor. - * @param {PotentialMethod} method. - */ - }, { - key: "setConstructor", - value: function setConstructor(method) { - this.constructor = method; - } - - /** - * Set the superClass and set up the related assignment expressions to be - * removed during transformation. - * @param {Node} superClass The super class node. - * @param {Node[]} relatedExpressions The related expressions to be removed - * during transformation. - */ - }, { - key: "setSuperClass", - value: function setSuperClass(superClass, relatedExpressions) { - this.superClass = superClass; - var _iterator = _createForOfIteratorHelper(relatedExpressions), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var _step$value = _step.value, - parent = _step$value.parent, - node = _step$value.node; - this.replacements.push({ - parent: parent, - node: node, - replacements: [] - }); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - this.constructor.setSuperClass(superClass); - } - - /** - * Adds method to class. - * @param {PotentialMethod} method - */ - }, { - key: "addMethod", - value: function addMethod(method) { - this.methods.push(method); - } - - /** - * True when class has at least one method (besides constructor). - * @return {Boolean} - */ - }, { - key: "isTransformable", - value: function isTransformable() { - return this.methods.length > 0 || this.superClass !== undefined; - } - - /** - * Replaces original constructor function and manual prototype assignments - * with ClassDeclaration. - */ - }, { - key: "transform", - value: function transform() { - (0, _multiReplaceStatement["default"])({ - parent: this.parent, - node: this.fullNode, - replacements: [this.toClassDeclaration()] - }); - this.replacements.forEach(_multiReplaceStatement["default"]); - this.methods.forEach(function (method) { - return method.remove(); - }); - } - }, { - key: "toClassDeclaration", - value: function toClassDeclaration() { - return { - type: 'ClassDeclaration', - superClass: this.superClass, - id: { - type: 'Identifier', - name: this.name - }, - body: { - type: 'ClassBody', - body: this.createMethods() - }, - comments: (0, _extractComments["default"])(this.commentNodes) - }; - } - }, { - key: "createMethods", - value: function createMethods() { - var _this = this; - return (0, _fp.compact)([this.createConstructor()].concat(_toConsumableArray(this.methods.map(function (method) { - method.setSuperClass(_this.superClass); - return method.toMethodDefinition(); - })))); - } - }, { - key: "createConstructor", - value: function createConstructor() { - return this.constructor.isEmpty() ? undefined : this.constructor.toMethodDefinition(); - } - }]); - return PotentialClass; -}(); -exports["default"] = PotentialClass; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/PotentialConstructor.js": -/*!************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/PotentialConstructor.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _isEqualAst = _interopRequireDefault(__webpack_require__(/*! ./../../utils/isEqualAst */ "./node_modules/lebab/lib/utils/isEqualAst.js")); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _PotentialMethod2 = _interopRequireDefault(__webpack_require__(/*! ./PotentialMethod */ "./node_modules/lebab/lib/transform/class/PotentialMethod.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -/** - * Represents a potential constructor method to be created. - */ -var PotentialConstructor = /*#__PURE__*/function (_PotentialMethod) { - _inherits(PotentialConstructor, _PotentialMethod); - var _super = _createSuper(PotentialConstructor); - function PotentialConstructor(cfg) { - _classCallCheck(this, PotentialConstructor); - cfg.name = 'constructor'; - return _super.call(this, cfg); - } - - // Override superclass method - _createClass(PotentialConstructor, [{ - key: "getBody", - value: function getBody() { - if (this.superClass) { - return this.transformSuperCalls(this.getBodyBlock()); - } else { - return this.getBodyBlock(); - } - } - - // Transforms constructor body by replacing - // SuperClass.call(this, ...args) --> super(...args) - }, { - key: "transformSuperCalls", - value: function transformSuperCalls(body) { - var _this = this; - return _traverser["default"].replace(body, { - enter: function enter(node) { - if (_this.isSuperConstructorCall(node)) { - node.expression.callee = { - type: 'Super' - }; - node.expression.arguments = node.expression.arguments.slice(1); - } - } - }); - } - }, { - key: "isSuperConstructorCall", - value: function isSuperConstructorCall(node) { - var _this2 = this; - return (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - object: function object(obj) { - return (0, _isEqualAst["default"])(obj, _this2.superClass); - }, - property: { - type: 'Identifier', - name: 'call' - } - }, - arguments: [{ - type: 'ThisExpression' - }] - } - }, node); - } - }]); - return PotentialConstructor; -}(_PotentialMethod2["default"]); -exports["default"] = PotentialConstructor; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/PotentialMethod.js": -/*!*******************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/PotentialMethod.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _isEqualAst = _interopRequireDefault(__webpack_require__(/*! ./../../utils/isEqualAst */ "./node_modules/lebab/lib/utils/isEqualAst.js")); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _extractComments = _interopRequireDefault(__webpack_require__(/*! ./extractComments */ "./node_modules/lebab/lib/transform/class/extractComments.js")); -var _multiReplaceStatement = _interopRequireDefault(__webpack_require__(/*! ./../../utils/multiReplaceStatement */ "./node_modules/lebab/lib/utils/multiReplaceStatement.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Represents a potential class method to be created. - */ -var PotentialMethod = /*#__PURE__*/function () { - /** - * @param {Object} cfg - * @param {String} cfg.name Method name - * @param {Object} cfg.methodNode - * @param {Object} cfg.fullNode Node to remove after converting to class - * @param {Object[]} cfg.commentNodes Nodes to extract comments from - * @param {Object} cfg.parent - * @param {String} [cfg.kind] Either 'get' or 'set' (optional) - * @param {Boolean} [cfg.static] True to make static method (optional) - */ - function PotentialMethod(cfg) { - _classCallCheck(this, PotentialMethod); - this.name = cfg.name; - this.methodNode = cfg.methodNode; - this.fullNode = cfg.fullNode; - this.commentNodes = cfg.commentNodes || []; - this.parent = cfg.parent; - this.kind = cfg.kind || 'method'; - this["static"] = cfg["static"] || false; - } - - /** - * Sets the superClass node. - * @param {Node} superClass - */ - _createClass(PotentialMethod, [{ - key: "setSuperClass", - value: function setSuperClass(superClass) { - this.superClass = superClass; - } - - /** - * True when method body is empty. - * @return {Boolean} - */ - }, { - key: "isEmpty", - value: function isEmpty() { - return this.getBodyBlock().body.length === 0; - } - - /** - * Transforms the potential method to actual MethodDefinition node. - * @return {MethodDefinition} - */ - }, { - key: "toMethodDefinition", - value: function toMethodDefinition() { - return { - type: 'MethodDefinition', - key: { - type: 'Identifier', - name: this.name - }, - computed: false, - value: { - type: 'FunctionExpression', - async: this.methodNode.async, - params: this.methodNode.params, - defaults: this.methodNode.defaults, - body: this.getBody(), - generator: false, - expression: false - }, - kind: this.kind, - "static": this["static"], - comments: (0, _extractComments["default"])(this.commentNodes) - }; - } - - /** - * Removes original prototype assignment node from AST. - */ - }, { - key: "remove", - value: function remove() { - (0, _multiReplaceStatement["default"])({ - parent: this.parent, - node: this.fullNode, - replacements: [] - }); - } - - // To be overridden in subclasses - }, { - key: "getBody", - value: function getBody() { - if (this.superClass) { - return this.transformSuperCalls(this.getBodyBlock()); - } else { - return this.getBodyBlock(); - } - } - }, { - key: "getBodyBlock", - value: function getBodyBlock() { - if (this.methodNode.body.type === 'BlockStatement') { - return this.methodNode.body; - } else { - return { - type: 'BlockStatement', - body: [{ - type: 'ReturnStatement', - argument: this.methodNode.body - }] - }; - } - } - - // Transforms method body by replacing - // SuperClass.prototype.foo.call(this, ...args) --> super.foo(...args) - }, { - key: "transformSuperCalls", - value: function transformSuperCalls(body) { - var _this = this; - return _traverser["default"].replace(body, { - enter: function enter(node) { - var m = _this.matchSuperCall(node); - if (m) { - node.expression.callee = { - type: 'MemberExpression', - computed: false, - object: { - type: 'Super' - }, - property: m.method - }; - node.expression.arguments = node.expression.arguments.slice(1); - } - } - }); - } - }, { - key: "matchSuperCall", - value: function matchSuperCall(node) { - var _this2 = this; - return (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: function object(obj) { - return (0, _isEqualAst["default"])(obj, _this2.superClass); - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, - property: (0, _fMatches.extract)('method', { - type: 'Identifier' - }) - }, - property: { - type: 'Identifier', - name: 'call' - } - }, - arguments: [{ - type: 'ThisExpression' - }] - } - }, node); - } - }]); - return PotentialMethod; -}(); -exports["default"] = PotentialMethod; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/extractComments.js": -/*!*******************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/extractComments.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = extractComments; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -/** - * Extracts comments from an array of nodes. - * @param {Object[]} nodes - * @param {Object[]} extracted comments - */ -function extractComments(nodes) { - return (0, _fp.flatMap)(function (n) { - return n.comments || []; - }, nodes); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/index.js ***! - \*********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _PotentialClass = _interopRequireDefault(__webpack_require__(/*! ./PotentialClass */ "./node_modules/lebab/lib/transform/class/PotentialClass.js")); -var _PotentialMethod = _interopRequireDefault(__webpack_require__(/*! ./PotentialMethod */ "./node_modules/lebab/lib/transform/class/PotentialMethod.js")); -var _PotentialConstructor = _interopRequireDefault(__webpack_require__(/*! ./PotentialConstructor */ "./node_modules/lebab/lib/transform/class/PotentialConstructor.js")); -var _matchFunctionDeclaration = _interopRequireDefault(__webpack_require__(/*! ./matchFunctionDeclaration */ "./node_modules/lebab/lib/transform/class/matchFunctionDeclaration.js")); -var _matchFunctionVar = _interopRequireDefault(__webpack_require__(/*! ./matchFunctionVar */ "./node_modules/lebab/lib/transform/class/matchFunctionVar.js")); -var _matchFunctionAssignment = _interopRequireDefault(__webpack_require__(/*! ./matchFunctionAssignment */ "./node_modules/lebab/lib/transform/class/matchFunctionAssignment.js")); -var _matchPrototypeFunctionAssignment = _interopRequireDefault(__webpack_require__(/*! ./matchPrototypeFunctionAssignment */ "./node_modules/lebab/lib/transform/class/matchPrototypeFunctionAssignment.js")); -var _matchPrototypeObjectAssignment = _interopRequireDefault(__webpack_require__(/*! ./matchPrototypeObjectAssignment */ "./node_modules/lebab/lib/transform/class/matchPrototypeObjectAssignment.js")); -var _matchObjectDefinePropertyCall = _interopRequireWildcard(__webpack_require__(/*! ./matchObjectDefinePropertyCall */ "./node_modules/lebab/lib/transform/class/matchObjectDefinePropertyCall.js")); -var _Inheritance = _interopRequireDefault(__webpack_require__(/*! ./inheritance/Inheritance */ "./node_modules/lebab/lib/transform/class/inheritance/Inheritance.js")); -var _matchObjectDefinePropertiesCall = _interopRequireWildcard(__webpack_require__(/*! ./matchObjectDefinePropertiesCall.js */ "./node_modules/lebab/lib/transform/class/matchObjectDefinePropertiesCall.js")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast, logger) { - var potentialClasses = {}; - var inheritance = new _Inheritance["default"](); - _traverser["default"].traverse(ast, { - enter: function enter(node, parent) { - var m; - if (m = (0, _matchFunctionDeclaration["default"])(node) || (0, _matchFunctionVar["default"])(node)) { - potentialClasses[m.className] = new _PotentialClass["default"]({ - name: m.className, - fullNode: node, - commentNodes: [node], - parent: parent - }); - potentialClasses[m.className].setConstructor(new _PotentialConstructor["default"]({ - methodNode: m.constructorNode, - potentialClass: potentialClasses[m.className] - })); - } else if (m = (0, _matchFunctionAssignment["default"])(node)) { - if (potentialClasses[m.className]) { - potentialClasses[m.className].addMethod(new _PotentialMethod["default"]({ - name: m.methodName, - methodNode: m.methodNode, - fullNode: node, - commentNodes: [node], - parent: parent, - "static": true - })); - } - } else if (m = (0, _matchPrototypeFunctionAssignment["default"])(node)) { - if (potentialClasses[m.className]) { - potentialClasses[m.className].addMethod(new _PotentialMethod["default"]({ - name: m.methodName, - methodNode: m.methodNode, - fullNode: node, - commentNodes: [node], - parent: parent - })); - } - } else if (m = (0, _matchPrototypeObjectAssignment["default"])(node)) { - if (potentialClasses[m.className]) { - m.methods.forEach(function (method, i) { - var assignmentComments = i === 0 ? [node] : []; - potentialClasses[m.className].addMethod(new _PotentialMethod["default"]({ - name: method.methodName, - methodNode: method.methodNode, - fullNode: node, - commentNodes: assignmentComments.concat([method.propertyNode]), - parent: parent, - kind: classMethodKind(method.kind) - })); - }); - } - } else if (m = (0, _matchObjectDefinePropertyCall["default"])(node)) { - if (potentialClasses[m.className]) { - m.descriptors.forEach(function (desc, i) { - var parentComments = i === 0 ? [node] : []; - potentialClasses[m.className].addMethod(new _PotentialMethod["default"]({ - name: m.methodName, - methodNode: desc.methodNode, - fullNode: node, - commentNodes: parentComments.concat([desc.propertyNode]), - parent: parent, - kind: desc.kind, - "static": m["static"] - })); - }); - } - } else if (m = (0, _matchObjectDefinePropertiesCall["default"])(node)) { - // defineProperties allows mixing method definitions we CAN transform - // with ones we CANT. This check looks for whether every property is - // one we CAN transform and if they are it removes the whole call - // to defineProperties - var removeWholeNode = false; - if (node.expression.arguments[1].properties.every(function (propertyNode) { - var _matchDefinedProperti = (0, _matchObjectDefinePropertiesCall.matchDefinedProperties)(propertyNode), - properties = _matchDefinedProperti.properties; - return properties.some(_matchObjectDefinePropertyCall.isAccessorDescriptor); - })) { - removeWholeNode = true; - } - m.forEach(function (method, i) { - if (potentialClasses[method.className]) { - method.descriptors.forEach(function (desc, j) { - var parentComments = j === 0 ? [method.methodNode] : []; - - // by default remove only the single method property of the object passed to defineProperties - // otherwise if they should all be remove AND this is the last descriptor set it up - // to remove the whole node that's calling defineProperties - var lastDescriptor = i === m.length - 1 && j === method.descriptors.length - 1; - var fullNode = lastDescriptor && removeWholeNode ? node : method.methodNode; - var parentNode = lastDescriptor && removeWholeNode ? parent : node.expression.arguments[1]; - potentialClasses[method.className].addMethod(new _PotentialMethod["default"]({ - name: method.methodName, - methodNode: desc.methodNode, - fullNode: fullNode, - commentNodes: parentComments.concat([desc.propertyNode]), - parent: parentNode, - kind: desc.kind, - "static": method["static"] - })); - }); - } - }); - } else if (m = inheritance.process(node, parent)) { - if (potentialClasses[m.className]) { - potentialClasses[m.className].setSuperClass(m.superClass, m.relatedExpressions); - } - } - }, - leave: function leave(node) { - if (node.type === 'Program') { - (0, _fp.values)(potentialClasses).filter(function (cls) { - return cls.isTransformable() ? true : logWarning(cls); - }).forEach(function (cls) { - return cls.transform(); - }); - } - } - }); - - // Ordinary methods inside class use kind=method, - // unlike methods inside object literal, which use kind=init. - function classMethodKind(kind) { - return kind === 'init' ? 'method' : kind; - } - function logWarning(cls) { - if (/^[A-Z]/.test(cls.getName())) { - logger.warn(cls.getFullNode(), "Function ".concat(cls.getName(), " looks like class, but has no prototype"), 'class'); - } - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/inheritance/ImportUtilDetector.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/inheritance/ImportUtilDetector.js ***! - \**********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Detects variable name imported from: import from "util" - */ -var ImportUtilDetector = /*#__PURE__*/function () { - function ImportUtilDetector() { - _classCallCheck(this, ImportUtilDetector); - } - _createClass(ImportUtilDetector, [{ - key: "detect", - value: - /** - * Detects: import from "util" - * - * @param {Object} node - * @return {Object} MemberExpression of .inherits - */ - function detect(node) { - var m = this.matchImportUtil(node); - if (m) { - return { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: m.name - }, - property: { - type: 'Identifier', - name: 'inherits' - } - }; - } - } - - // Matches: import from "util" - }, { - key: "matchImportUtil", - value: function matchImportUtil(node) { - return (0, _fMatches.matches)({ - type: 'ImportDeclaration', - specifiers: (0, _fMatches.matchesLength)([{ - type: 'ImportDefaultSpecifier', - local: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name') - } - }]), - source: { - type: 'Literal', - value: 'util' - } - }, node); - } - }]); - return ImportUtilDetector; -}(); -exports["default"] = ImportUtilDetector; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/inheritance/Inheritance.js": -/*!***************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/inheritance/Inheritance.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _UtilInherits = _interopRequireDefault(__webpack_require__(/*! ./UtilInherits */ "./node_modules/lebab/lib/transform/class/inheritance/UtilInherits.js")); -var _Prototypal = _interopRequireDefault(__webpack_require__(/*! ./Prototypal */ "./node_modules/lebab/lib/transform/class/inheritance/Prototypal.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Processes nodes to detect super classes and return information for later - * transformation. - */ -var Inheritance = /*#__PURE__*/function () { - /** - * @param {Object} cfg - * @param {PotentialClass[]} cfg.potentialClasses Class name - */ - function Inheritance() { - _classCallCheck(this, Inheritance); - this.utilInherits = new _UtilInherits["default"](); - this.prototypal = new _Prototypal["default"](); - } - - /** - * Process a node and return inheritance details if found. - * @param {Object} node - * @param {Object} parent - * @returns {Object} - * {String} className - * {Node} superClass - * {Object[]} relatedExpressions - */ - _createClass(Inheritance, [{ - key: "process", - value: function process(node, parent) { - return this.utilInherits.process(node, parent) || this.prototypal.process(node, parent); - } - }]); - return Inheritance; -}(); -exports["default"] = Inheritance; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/inheritance/Prototypal.js": -/*!**************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/inheritance/Prototypal.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Processes nodes to detect super classes and return information for later - * transformation. - * - * Detects: - * - * Class1.prototype = Object.create(Class2.prototype); - * - * or: - * - * Class1.prototype = new Class2(); - * - * optionally followed by: - * - * Class1.prototype.constructor = Class1; - */ -var Prototypal = /*#__PURE__*/function () { - function Prototypal() { - _classCallCheck(this, Prototypal); - this.foundSuperclasses = {}; - } - - /** - * Process a node and return inheritance details if found. - * @param {Object} node - * @param {Object} parent - * @returns {Object/undefined} m - * {String} m.className - * {Node} m.superClass - * {Object[]} m.relatedExpressions - */ - _createClass(Prototypal, [{ - key: "process", - value: function process(node, parent) { - var m; - if (m = this.matchNewAssignment(node) || this.matchObjectCreateAssignment(node)) { - this.foundSuperclasses[m.className] = m.superClass; - return { - className: m.className, - superClass: m.superClass, - relatedExpressions: [{ - node: node, - parent: parent - }] - }; - } else if (m = this.matchConstructorAssignment(node)) { - var superClass = this.foundSuperclasses[m.className]; - if (superClass && m.className === m.constructorClassName) { - return { - className: m.className, - superClass: superClass, - relatedExpressions: [{ - node: node, - parent: parent - }] - }; - } - } - } - - // Matches: .prototype = new (); - }, { - key: "matchNewAssignment", - value: function matchNewAssignment(node) { - return (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'MemberExpression', - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, - right: { - type: 'NewExpression', - callee: (0, _fMatches.extractAny)('superClass') - } - } - }, node); - } - - // Matches: .prototype = Object.create(); - }, { - key: "matchObjectCreateAssignment", - value: function matchObjectCreateAssignment(node) { - return (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'MemberExpression', - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, - right: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - object: { - type: 'Identifier', - name: 'Object' - }, - property: { - type: 'Identifier', - name: 'create' - } - }, - arguments: (0, _fMatches.matchesLength)([{ - type: 'MemberExpression', - object: (0, _fMatches.extractAny)('superClass'), - property: { - type: 'Identifier', - name: 'prototype' - } - }]) - } - } - }, node); - } - - // Matches: .prototype.constructor = ; - }, { - key: "matchConstructorAssignment", - value: function matchConstructorAssignment(node) { - return (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'MemberExpression', - object: { - type: 'MemberExpression', - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, - property: { - type: 'Identifier', - name: 'constructor' - } - }, - right: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('constructorClassName') - } - } - }, node); - } - }]); - return Prototypal; -}(); -exports["default"] = Prototypal; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/inheritance/RequireUtilDetector.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/inheritance/RequireUtilDetector.js ***! - \***********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Detects variable name imported from require("util") - */ -var RequireUtilDetector = /*#__PURE__*/function () { - function RequireUtilDetector() { - _classCallCheck(this, RequireUtilDetector); - } - _createClass(RequireUtilDetector, [{ - key: "detect", - value: - /** - * Detects: var = require("util") - * - * @param {Object} node - * @return {Object} MemberExpression of .inherits - */ - function detect(node) { - var _this = this; - if (node.type !== 'VariableDeclaration') { - return; - } - var declaration = (0, _fp.find)(function (dec) { - return _this.isRequireUtil(dec); - }, node.declarations); - if (declaration) { - return { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: declaration.id.name - }, - property: { - type: 'Identifier', - name: 'inherits' - } - }; - } - } - - // Matches: = require("util") - }, { - key: "isRequireUtil", - value: function isRequireUtil(dec) { - return (0, _fMatches.matches)({ - type: 'VariableDeclarator', - id: { - type: 'Identifier' - }, - init: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'require' - }, - arguments: (0, _fMatches.matchesLength)([{ - type: 'Literal', - value: 'util' - }]) - } - }, dec); - } - }]); - return RequireUtilDetector; -}(); -exports["default"] = RequireUtilDetector; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/inheritance/RequireUtilInheritsDetector.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/inheritance/RequireUtilInheritsDetector.js ***! - \*******************************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Detects variable name imported from require("util").inherits - */ -var RequireUtilInheritsDetector = /*#__PURE__*/function () { - function RequireUtilInheritsDetector() { - _classCallCheck(this, RequireUtilInheritsDetector); - } - _createClass(RequireUtilInheritsDetector, [{ - key: "detect", - value: - /** - * Detects: var = require("util").inherits - * - * @param {Object} node - * @return {Object} Identifier - */ - function detect(node) { - var _this = this; - if (node.type !== 'VariableDeclaration') { - return; - } - var declaration = (0, _fp.find)(function (dec) { - return _this.isRequireUtilInherits(dec); - }, node.declarations); - if (declaration) { - return { - type: 'Identifier', - name: declaration.id.name - }; - } - } - - // Matches: = require("util").inherits - }, { - key: "isRequireUtilInherits", - value: function isRequireUtilInherits(dec) { - return (0, _fMatches.matches)({ - type: 'VariableDeclarator', - id: { - type: 'Identifier' - }, - init: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'require' - }, - arguments: (0, _fMatches.matchesLength)([{ - type: 'Literal', - value: 'util' - }]) - }, - property: { - type: 'Identifier', - name: 'inherits' - } - } - }, dec); - } - }]); - return RequireUtilInheritsDetector; -}(); -exports["default"] = RequireUtilInheritsDetector; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/inheritance/UtilInherits.js": -/*!****************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/inheritance/UtilInherits.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _RequireUtilDetector = _interopRequireDefault(__webpack_require__(/*! ./RequireUtilDetector */ "./node_modules/lebab/lib/transform/class/inheritance/RequireUtilDetector.js")); -var _RequireUtilInheritsDetector = _interopRequireDefault(__webpack_require__(/*! ./RequireUtilInheritsDetector */ "./node_modules/lebab/lib/transform/class/inheritance/RequireUtilInheritsDetector.js")); -var _ImportUtilDetector = _interopRequireDefault(__webpack_require__(/*! ./ImportUtilDetector */ "./node_modules/lebab/lib/transform/class/inheritance/ImportUtilDetector.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Processes nodes to detect super classes and return information for later - * transformation. - * - * Detects: - * - * var util = require('util'); - * ... - * util.inherits(Class1, Class2); - */ -var UtilInherits = /*#__PURE__*/function () { - function UtilInherits() { - _classCallCheck(this, UtilInherits); - this.inheritsNode = undefined; - this.detectors = [new _RequireUtilDetector["default"](), new _RequireUtilInheritsDetector["default"](), new _ImportUtilDetector["default"]()]; - } - - /** - * Process a node and return inheritance details if found. - * @param {Object} node - * @param {Object} parent - * @returns {Object/undefined} m - * {String} m.className - * {Node} m.superClass - * {Object[]} m.relatedExpressions - */ - _createClass(UtilInherits, [{ - key: "process", - value: function process(node, parent) { - var m; - if (parent && parent.type === 'Program' && (m = this.detectInheritsNode(node))) { - this.inheritsNode = m; - } else if (this.inheritsNode && (m = this.matchUtilInherits(node))) { - return { - className: m.className, - superClass: m.superClass, - relatedExpressions: [{ - node: node, - parent: parent - }] - }; - } - } - }, { - key: "detectInheritsNode", - value: function detectInheritsNode(node) { - var _iterator = _createForOfIteratorHelper(this.detectors), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var detector = _step.value; - var inheritsNode = void 0; - if (inheritsNode = detector.detect(node)) { - return inheritsNode; - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - - // Discover usage of this.inheritsNode - // - // Matches: (, ); - }, { - key: "matchUtilInherits", - value: function matchUtilInherits(node) { - return (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: this.inheritsNode, - arguments: [{ - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, (0, _fMatches.extractAny)('superClass')] - } - }, node); - } - }]); - return UtilInherits; -}(); -exports["default"] = UtilInherits; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/isFunctionProperty.js": -/*!**********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/isFunctionProperty.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _isTransformableToMethod = _interopRequireDefault(__webpack_require__(/*! ./isTransformableToMethod */ "./node_modules/lebab/lib/transform/class/isTransformableToMethod.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/** - * Matches: : function() { ... } - * - * @param {Object} node - * @return {Boolean} - */ -var _default = (0, _fMatches.matches)({ - type: 'Property', - key: { - type: 'Identifier' - // name: - }, - computed: false, - value: _isTransformableToMethod["default"] -}); -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/isTransformableToMethod.js": -/*!***************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/isTransformableToMethod.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = isTransformableToMethod; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/** - * Detects if function can be transformed to class method - * @param {Object} node - * @return {Boolean} - */ -function isTransformableToMethod(node) { - if (node.type === 'FunctionExpression') { - return true; - } - if (node.type === 'ArrowFunctionExpression' && !usesThis(node)) { - return true; - } -} -function usesThis(ast) { - return _traverser["default"].find(ast, 'ThisExpression', { - skipTypes: ['FunctionExpression', 'FunctionDeclaration'] - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/matchFunctionAssignment.js": -/*!***************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/matchFunctionAssignment.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -/** - * Matches: . = function () { ... } - * - * When node matches returns the extracted fields: - * - * - className - * - methodName - * - methodNode - * - * @param {Object} node - * @return {Object} - */ -var _default = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('methodName') - } - }, - operator: '=', - right: (0, _fMatches.extract)('methodNode', { - type: 'FunctionExpression' - }) - } -}); -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/matchFunctionDeclaration.js": -/*!****************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/matchFunctionDeclaration.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -/** - * Matches: function () { ... } - * - * When node matches returns the extracted fields: - * - * - className - * - constructorNode - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - if (node.type === 'FunctionDeclaration' && node.id) { - return { - className: node.id.name, - constructorNode: node - }; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/matchFunctionVar.js": -/*!********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/matchFunctionVar.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var isFunctionExpression = (0, _fMatches.matches)({ - type: 'FunctionExpression' -}); -var isFunctionVariableDeclaration = (0, _fMatches.matches)({ - type: 'VariableDeclaration', - declarations: function declarations(decs) { - return decs.length === 1 && isFunctionExpression(decs[0].init); - } -}); - -/** - * Matches: var = function () { ... } - * - * When node matches returns the extracted fields: - * - * - className - * - constructorNode - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - if (isFunctionVariableDeclaration(node)) { - var _node$declarations = _slicedToArray(node.declarations, 1), - _node$declarations$ = _node$declarations[0], - className = _node$declarations$.id.name, - constructorNode = _node$declarations$.init; - return { - className: className, - constructorNode: constructorNode - }; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/matchObjectDefinePropertiesCall.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/matchObjectDefinePropertiesCall.js ***! - \***********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -exports.matchDefinedProperties = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _matchObjectDefinePropertyCall = __webpack_require__(/*! ./matchObjectDefinePropertyCall.js */ "./node_modules/lebab/lib/transform/class/matchObjectDefinePropertyCall.js"); -var matchObjectDefinePropertiesCallOnPrototype = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'Object' - }, - property: { - type: 'Identifier', - name: 'defineProperties' - } - }, - arguments: [{ - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, { - type: 'ObjectExpression', - properties: (0, _fMatches.extractAny)('methods') - }] - } -}); -var matchObjectDefinePropertiesCall = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'Object' - }, - property: { - type: 'Identifier', - name: 'defineProperties' - } - }, - arguments: [{ - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, { - type: 'ObjectExpression', - properties: (0, _fMatches.extractAny)('methods') - }] - } -}); -var matchDefinedProperties = (0, _fMatches.matches)({ - type: 'Property', - key: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('methodName') - }, - computed: false, - value: { - type: 'ObjectExpression', - properties: (0, _fMatches.extractAny)('properties') - } -}); - -/** - * Matches: Object.defineProperties(.prototype, { - * : { - * : , - * } - * ... - * }) - * - * When node matches returns an array of objects with the extracted fields for each method: - * - * [{ - * - className - * - methodName - * - descriptors: - * - propertyNode - * - methodNode - * - kind - * }] - * - * @param {Object} node - * @return {Object[] | undefined} - */ -exports.matchDefinedProperties = matchDefinedProperties; -function _default(node) { - var _matchObjectDefinePro = matchObjectDefinePropertiesCallOnPrototype(node), - className = _matchObjectDefinePro.className, - methods = _matchObjectDefinePro.methods; - var isStatic = false; - if (!className) { - var _matchObjectDefinePro2 = matchObjectDefinePropertiesCall(node); - className = _matchObjectDefinePro2.className; - methods = _matchObjectDefinePro2.methods; - isStatic = true; - } - if (className) { - return methods.map(function (methodNode) { - var _matchDefinedProperti = matchDefinedProperties(methodNode), - methodName = _matchDefinedProperti.methodName, - properties = _matchDefinedProperti.properties; - return { - className: className, - methodName: methodName, - methodNode: methodNode, - descriptors: properties.filter(_matchObjectDefinePropertyCall.isAccessorDescriptor).map(function (prop) { - return { - propertyNode: prop, - methodNode: prop.value, - kind: prop.key.name - }; - }), - "static": isStatic - }; - }); - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/matchObjectDefinePropertyCall.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/matchObjectDefinePropertyCall.js ***! - \*********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -exports.isAccessorDescriptor = isAccessorDescriptor; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _isFunctionProperty = _interopRequireDefault(__webpack_require__(/*! ./isFunctionProperty */ "./node_modules/lebab/lib/transform/class/isFunctionProperty.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var matchObjectDefinePropertyCallOnPrototype = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'Object' - }, - property: { - type: 'Identifier', - name: 'defineProperty' - } - }, - arguments: [{ - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, { - type: 'Literal', - value: (0, _fMatches.extractAny)('methodName') - }, { - type: 'ObjectExpression', - properties: (0, _fMatches.extractAny)('properties') - }] - } -}); -var matchObjectDefinePropertyCall = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'Object' - }, - property: { - type: 'Identifier', - name: 'defineProperty' - } - }, - arguments: [{ - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, { - type: 'Literal', - value: (0, _fMatches.extractAny)('methodName') - }, { - type: 'ObjectExpression', - properties: (0, _fMatches.extractAny)('properties') - }] - } -}); -function isAccessorDescriptor(node) { - return (0, _isFunctionProperty["default"])(node) && (node.key.name === 'get' || node.key.name === 'set'); -} - -/** - * Matches: Object.defineProperty(.prototype, "", { - * : , - * ... - * }) - * - * When node matches returns the extracted fields: - * - * - className - * - methodName - * - descriptors: - * - propertyNode - * - methodNode - * - kind - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - var _matchObjectDefinePro = matchObjectDefinePropertyCallOnPrototype(node), - className = _matchObjectDefinePro.className, - methodName = _matchObjectDefinePro.methodName, - properties = _matchObjectDefinePro.properties; - var isStatic = false; - if (!className) { - var _matchObjectDefinePro2 = matchObjectDefinePropertyCall(node); - className = _matchObjectDefinePro2.className; - methodName = _matchObjectDefinePro2.methodName; - properties = _matchObjectDefinePro2.properties; - isStatic = true; - } - if (className) { - return { - className: className, - methodName: methodName, - descriptors: properties.filter(isAccessorDescriptor).map(function (prop) { - return { - propertyNode: prop, - methodNode: prop.value, - kind: prop.key.name - }; - }), - "static": isStatic - }; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/matchPrototypeFunctionAssignment.js": -/*!************************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/matchPrototypeFunctionAssignment.js ***! - \************************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _isTransformableToMethod = _interopRequireDefault(__webpack_require__(/*! ./isTransformableToMethod */ "./node_modules/lebab/lib/transform/class/isTransformableToMethod.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/** - * Matches: .prototype. = function () { ... } - * - * When node matches returns the extracted fields: - * - * - className - * - methodName - * - methodNode - * - * @param {Object} node - * @return {Object} - */ -var _default = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, - property: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('methodName') - } - }, - operator: '=', - right: (0, _fMatches.extract)('methodNode', _isTransformableToMethod["default"]) - } -}); -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/class/matchPrototypeObjectAssignment.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/class/matchPrototypeObjectAssignment.js ***! - \**********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _isFunctionProperty = _interopRequireDefault(__webpack_require__(/*! ./isFunctionProperty */ "./node_modules/lebab/lib/transform/class/isFunctionProperty.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var matchPrototypeObjectAssignment = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('className') - }, - property: { - type: 'Identifier', - name: 'prototype' - } - }, - operator: '=', - right: { - type: 'ObjectExpression', - properties: (0, _fMatches.extract)('properties', function (props) { - return props.every(_isFunctionProperty["default"]); - }) - } - } -}); - -/** - * Matches: .prototype = { - * : , - * ... - * }; - * - * When node matches returns the extracted fields: - * - * - className - * - methods - * - propertyNode - * - methodName - * - methodNode - * - kind - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - var _matchPrototypeObject = matchPrototypeObjectAssignment(node), - className = _matchPrototypeObject.className, - properties = _matchPrototypeObject.properties; - if (className) { - return { - className: className, - methods: properties.map(function (prop) { - return { - propertyNode: prop, - methodName: prop.key.name, - methodNode: prop.value, - kind: prop.kind - }; - }) - }; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/exportCommonjs.js": -/*!*********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/exportCommonjs.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _matchDefaultExport = _interopRequireDefault(__webpack_require__(/*! ./matchDefaultExport */ "./node_modules/lebab/lib/transform/commonjs/matchDefaultExport.js")); -var _matchNamedExport = _interopRequireDefault(__webpack_require__(/*! ./matchNamedExport */ "./node_modules/lebab/lib/transform/commonjs/matchNamedExport.js")); -var _functionType = __webpack_require__(/*! ../../utils/functionType */ "./node_modules/lebab/lib/utils/functionType.js"); -var _ExportNamedDeclaration = _interopRequireDefault(__webpack_require__(/*! ../../syntax/ExportNamedDeclaration */ "./node_modules/lebab/lib/syntax/ExportNamedDeclaration.js")); -var _VariableDeclaration = _interopRequireDefault(__webpack_require__(/*! ../../syntax/VariableDeclaration */ "./node_modules/lebab/lib/syntax/VariableDeclaration.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast, logger) { - _traverser["default"].replace(ast, { - enter: function enter(node, parent) { - var m; - if (m = (0, _matchDefaultExport["default"])(node)) { - if (parent.type !== 'Program') { - logger.warn(node, 'export can only be at root level', 'commonjs'); - return; - } - return exportDefault(m, node.comments); - } else if (m = (0, _matchNamedExport["default"])(node)) { - if (parent.type !== 'Program') { - logger.warn(node, 'export can only be at root level', 'commonjs'); - return; - } - return exportNamed(m, node.comments); - } - } - }); -} -function exportDefault(_ref, comments) { - var value = _ref.value; - return { - type: 'ExportDefaultDeclaration', - declaration: value, - comments: comments - }; -} -function exportNamed(_ref2, comments) { - var id = _ref2.id, - value = _ref2.value; - if ((0, _functionType.isFunctionExpression)(value)) { - // Exclude functions with different name than the assigned property name - if (compatibleIdentifiers(id, value.id)) { - return new _ExportNamedDeclaration["default"]({ - declaration: functionExpressionToDeclaration(value, id), - comments: comments - }); - } - } else if (value.type === 'ClassExpression') { - // Exclude classes with different name than the assigned property name - if (compatibleIdentifiers(id, value.id)) { - return new _ExportNamedDeclaration["default"]({ - declaration: classExpressionToDeclaration(value, id), - comments: comments - }); - } - } else if (value.type === 'Identifier') { - return new _ExportNamedDeclaration["default"]({ - specifiers: [{ - type: 'ExportSpecifier', - exported: id, - local: value - }], - comments: comments - }); - } else { - return new _ExportNamedDeclaration["default"]({ - declaration: new _VariableDeclaration["default"]('var', [{ - type: 'VariableDeclarator', - id: id, - init: value - }]), - comments: comments - }); - } -} - -// True when one of the identifiers is null or their names are equal. -function compatibleIdentifiers(id1, id2) { - return !id1 || !id2 || id1.name === id2.name; -} -function functionExpressionToDeclaration(func, id) { - func.type = 'FunctionDeclaration'; - func.id = id; - - // Transform to { return ; } - if (func.body.type !== 'BlockStatement') { - func.body = { - type: 'BlockStatement', - body: [{ - type: 'ReturnStatement', - argument: func.body - }] - }; - } - return func; -} -function classExpressionToDeclaration(cls, id) { - cls.type = 'ClassDeclaration'; - cls.id = id; - return cls; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/importCommonjs.js": -/*!*********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/importCommonjs.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _isVarWithRequireCalls = _interopRequireDefault(__webpack_require__(/*! ./isVarWithRequireCalls */ "./node_modules/lebab/lib/transform/commonjs/isVarWithRequireCalls.js")); -var _matchRequire = __webpack_require__(/*! ./matchRequire */ "./node_modules/lebab/lib/transform/commonjs/matchRequire.js"); -var _multiReplaceStatement = _interopRequireDefault(__webpack_require__(/*! ../../utils/multiReplaceStatement */ "./node_modules/lebab/lib/utils/multiReplaceStatement.js")); -var _ImportDeclaration = _interopRequireDefault(__webpack_require__(/*! ../../syntax/ImportDeclaration */ "./node_modules/lebab/lib/syntax/ImportDeclaration.js")); -var _ImportSpecifier = _interopRequireDefault(__webpack_require__(/*! ../../syntax/ImportSpecifier */ "./node_modules/lebab/lib/syntax/ImportSpecifier.js")); -var _ImportDefaultSpecifier = _interopRequireDefault(__webpack_require__(/*! ../../syntax/ImportDefaultSpecifier */ "./node_modules/lebab/lib/syntax/ImportDefaultSpecifier.js")); -var _VariableDeclaration = _interopRequireDefault(__webpack_require__(/*! ../../syntax/VariableDeclaration */ "./node_modules/lebab/lib/syntax/VariableDeclaration.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast, logger) { - _traverser["default"].replace(ast, { - enter: function enter(node, parent) { - if ((0, _isVarWithRequireCalls["default"])(node)) { - if (parent.type !== 'Program') { - logger.warn(node, 'import can only be at root level', 'commonjs'); - return; - } - (0, _multiReplaceStatement["default"])({ - parent: parent, - node: node, - replacements: node.declarations.map(function (dec) { - return varToImport(dec, node.kind); - }), - preserveComments: true - }); - } - } - }); -} - -// Converts VariableDeclarator to ImportDeclaration when we recognize it -// as such, otherwise converts it to full VariableDeclaration (of original kind). -function varToImport(dec, kind) { - var m; - if (m = (0, _matchRequire.matchRequire)(dec)) { - if (m.id.type === 'ObjectPattern') { - return patternToNamedImport(m); - } else if (m.id.type === 'Identifier') { - return identifierToDefaultImport(m); - } - } else if (m = (0, _matchRequire.matchRequireWithProperty)(dec)) { - if (m.property.name === 'default') { - return identifierToDefaultImport(m); - } - return propertyToNamedImport(m); - } else { - return new _VariableDeclaration["default"](kind, [dec]); - } -} -function patternToNamedImport(_ref) { - var id = _ref.id, - sources = _ref.sources; - return new _ImportDeclaration["default"]({ - specifiers: id.properties.map(function (_ref2) { - var key = _ref2.key, - value = _ref2.value; - return createImportSpecifier({ - local: value, - imported: key - }); - }), - source: sources[0] - }); -} -function identifierToDefaultImport(_ref3) { - var id = _ref3.id, - sources = _ref3.sources; - return new _ImportDeclaration["default"]({ - specifiers: [new _ImportDefaultSpecifier["default"](id)], - source: sources[0] - }); -} -function propertyToNamedImport(_ref4) { - var id = _ref4.id, - property = _ref4.property, - sources = _ref4.sources; - return new _ImportDeclaration["default"]({ - specifiers: [createImportSpecifier({ - local: id, - imported: property - })], - source: sources[0] - }); -} -function createImportSpecifier(_ref5) { - var local = _ref5.local, - imported = _ref5.imported; - if (imported.name === 'default') { - return new _ImportDefaultSpecifier["default"](local); - } - return new _ImportSpecifier["default"]({ - local: local, - imported: imported - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/index.js": -/*!************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/index.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _importCommonjs = _interopRequireDefault(__webpack_require__(/*! ./importCommonjs */ "./node_modules/lebab/lib/transform/commonjs/importCommonjs.js")); -var _exportCommonjs = _interopRequireDefault(__webpack_require__(/*! ./exportCommonjs */ "./node_modules/lebab/lib/transform/commonjs/exportCommonjs.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast, logger) { - (0, _importCommonjs["default"])(ast, logger); - (0, _exportCommonjs["default"])(ast, logger); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/isExports.js": -/*!****************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/isExports.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -/** - * Matches just identifier `exports` - * @param {Object} node - * @return {Boolean} - */ -var _default = (0, _fMatches.matches)({ - type: 'Identifier', - name: 'exports' -}); -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/isModuleExports.js": -/*!**********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/isModuleExports.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _isExports = _interopRequireDefault(__webpack_require__(/*! ./isExports */ "./node_modules/lebab/lib/transform/commonjs/isExports.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/** - * Matches: module.exports - * @param {Object} node - * @return {Boolean} - */ -var _default = (0, _fMatches.matches)({ - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'module' - }, - property: _isExports["default"] -}); -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/isVarWithRequireCalls.js": -/*!****************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/isVarWithRequireCalls.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = isVarWithRequireCalls; -var _matchRequire = __webpack_require__(/*! ./matchRequire */ "./node_modules/lebab/lib/transform/commonjs/matchRequire.js"); -/** - * Matches: var = require(); - * var = require().; - */ -function isVarWithRequireCalls(node) { - return node.type === 'VariableDeclaration' && node.declarations.some(function (dec) { - return (0, _matchRequire.matchRequire)(dec) || (0, _matchRequire.matchRequireWithProperty)(dec); - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/matchDefaultExport.js": -/*!*************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/matchDefaultExport.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _isModuleExports = _interopRequireDefault(__webpack_require__(/*! ./isModuleExports */ "./node_modules/lebab/lib/transform/commonjs/isModuleExports.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/** - * Matches: module.exports = - * - * When match found, return object with: - * - * - value - * - * @param {Object} node - * @return {Object|Boolean} - */ -var _default = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: _isModuleExports["default"], - right: (0, _fMatches.extractAny)('value') - } -}); -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/matchNamedExport.js": -/*!***********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/matchNamedExport.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _isExports = _interopRequireDefault(__webpack_require__(/*! ./isExports */ "./node_modules/lebab/lib/transform/commonjs/isExports.js")); -var _isModuleExports = _interopRequireDefault(__webpack_require__(/*! ./isModuleExports */ "./node_modules/lebab/lib/transform/commonjs/isModuleExports.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/** - * Matches: exports. = - * Matches: module.exports. = - * - * When match found, returns object with: - * - * - id - * - value - * - * @param {[type]} node [description] - * @return {[type]} [description] - */ -var _default = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'MemberExpression', - computed: false, - object: function object(ast) { - return (0, _isExports["default"])(ast) || (0, _isModuleExports["default"])(ast); - }, - property: (0, _fMatches.extract)('id', { - type: 'Identifier' - }) - }, - right: (0, _fMatches.extractAny)('value') - } -}); -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/commonjs/matchRequire.js": -/*!*******************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/commonjs/matchRequire.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.matchRequireWithProperty = exports.matchRequire = void 0; -var _isString = _interopRequireDefault(__webpack_require__(/*! ../../utils/isString */ "./node_modules/lebab/lib/utils/isString.js")); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var isIdentifier = (0, _fMatches.matches)({ - type: 'Identifier' -}); - -// matches Property with Identifier key and value (possibly shorthand) -var isSimpleProperty = (0, _fMatches.matches)({ - type: 'Property', - key: isIdentifier, - computed: false, - value: isIdentifier -}); - -// matches: {a, b: myB, c, ...} -var isObjectPattern = (0, _fMatches.matches)({ - type: 'ObjectPattern', - properties: function properties(props) { - return props.every(isSimpleProperty); - } -}); - -// matches: require() -var matchRequireCall = (0, _fMatches.matches)({ - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'require' - }, - arguments: (0, _fMatches.extract)('sources', function (args) { - return args.length === 1 && (0, _isString["default"])(args[0]); - }) -}); - -/** - * Matches: = require(); - */ -var matchRequire = (0, _fMatches.matches)({ - type: 'VariableDeclarator', - id: (0, _fMatches.extract)('id', function (id) { - return isIdentifier(id) || isObjectPattern(id); - }), - init: matchRequireCall -}); - -/** - * Matches: = require().; - */ -exports.matchRequire = matchRequire; -var matchRequireWithProperty = (0, _fMatches.matches)({ - type: 'VariableDeclarator', - id: (0, _fMatches.extract)('id', isIdentifier), - init: { - type: 'MemberExpression', - computed: false, - object: matchRequireCall, - property: (0, _fMatches.extract)('property', { - type: 'Identifier' - }) - } -}); -exports.matchRequireWithProperty = matchRequireWithProperty; - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/defaultParam/index.js": -/*!****************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/defaultParam/index.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _destructuring = __webpack_require__(/*! ../../utils/destructuring */ "./node_modules/lebab/lib/utils/destructuring.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _multiReplaceStatement = _interopRequireDefault(__webpack_require__(/*! ../../utils/multiReplaceStatement */ "./node_modules/lebab/lib/utils/multiReplaceStatement.js")); -var _functionType = __webpack_require__(/*! ../../utils/functionType */ "./node_modules/lebab/lib/utils/functionType.js"); -var _matchOrAssignment = _interopRequireDefault(__webpack_require__(/*! ./matchOrAssignment */ "./node_modules/lebab/lib/transform/defaultParam/matchOrAssignment.js")); -var _matchTernaryAssignment = _interopRequireDefault(__webpack_require__(/*! ./matchTernaryAssignment */ "./node_modules/lebab/lib/transform/defaultParam/matchTernaryAssignment.js")); -var _matchIfUndefinedAssignment = _interopRequireDefault(__webpack_require__(/*! ./matchIfUndefinedAssignment */ "./node_modules/lebab/lib/transform/defaultParam/matchIfUndefinedAssignment.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _default(ast) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - if ((0, _functionType.isFunction)(node) && node.body.type === 'BlockStatement') { - transformDefaultParams(node); - } - } - }); -} -function transformDefaultParams(fn) { - var detectedDefaults = findDefaults(fn.body.body); - fn.params = fn.params.map(function (param, i) { - // Ignore params that use destructuring or already have a default - if (param.type !== 'Identifier') { - return param; - } - var detected = detectedDefaults[param.name]; - // Transform when default value detected - // and default does not contain this or any of the remaining parameters - if (detected && !containsParams(detected.value, remainingParams(fn, i))) { - (0, _multiReplaceStatement["default"])({ - parent: fn.body, - node: detected.node, - replacements: [] - }); - return withDefault(param, detected.value); - } - return param; - }); -} -function withDefault(param, value) { - return { - type: 'AssignmentPattern', - left: param, - right: value - }; -} -function remainingParams(fn, i) { - return fn.params.slice(i); -} -function containsParams(defaultValue, params) { - return (0, _fp.flow)((0, _fp.flatMap)(_destructuring.extractVariables), (0, _fp.some)(function (param) { - return _traverser["default"].find(defaultValue, (0, _fMatches.matches)({ - type: 'Identifier', - name: param.name - })); - }))(params); -} - -// Looks default value assignments at the beginning of a function -// -// Returns a map of variable-name:{name, value, node} -function findDefaults(fnBody) { - var defaults = {}; - var _iterator = _createForOfIteratorHelper(fnBody), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var node = _step.value; - var def = matchDefaultAssignment(node); - if (!def) { - break; - } - defaults[def.name] = def; - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - return defaults; -} -function matchDefaultAssignment(node) { - return (0, _matchOrAssignment["default"])(node) || (0, _matchTernaryAssignment["default"])(node) || (0, _matchIfUndefinedAssignment["default"])(node); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/defaultParam/matchIfUndefinedAssignment.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/defaultParam/matchIfUndefinedAssignment.js ***! - \*************************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var matchEqualsUndefined = (0, _fMatches.matches)({ - type: 'BinaryExpression', - left: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name2') - }, - operator: (0, _fMatches.extractAny)('operator'), - right: { - type: 'Identifier', - name: 'undefined' - } -}); -var matchTypeofUndefined = (0, _fMatches.matches)({ - type: 'BinaryExpression', - left: { - type: 'UnaryExpression', - operator: 'typeof', - prefix: true, - argument: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name2') - } - }, - operator: (0, _fMatches.extractAny)('operator'), - right: { - type: 'Literal', - value: 'undefined' - } -}); -var matchIfUndefinedAssignment = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name') - }, - operator: '=', - right: { - type: 'ConditionalExpression', - test: function test(ast) { - return matchEqualsUndefined(ast) || matchTypeofUndefined(ast); - }, - consequent: (0, _fMatches.extractAny)('consequent'), - alternate: (0, _fMatches.extractAny)('alternate') - } - } -}); -function isEquals(operator) { - return operator === '===' || operator === '=='; -} -function isNotEquals(operator) { - return operator === '!==' || operator === '!='; -} -function isIdent(node, name) { - return node.type === 'Identifier' && node.name === name; -} - -/** - * Matches: = === undefined ? : ; - * Matches: = typeof === 'undefined' ? : ; - * - * When node matches returns the extracted fields: - * - * - name - * - value - * - node (the entire node) - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - var _ref = matchIfUndefinedAssignment(node) || {}, - name = _ref.name, - name2 = _ref.name2, - operator = _ref.operator, - consequent = _ref.consequent, - alternate = _ref.alternate; - if (name && name === name2) { - if (isEquals(operator) && isIdent(alternate, name)) { - return { - name: name, - value: consequent, - node: node - }; - } - if (isNotEquals(operator) && isIdent(consequent, name)) { - return { - name: name, - value: alternate, - node: node - }; - } - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/defaultParam/matchOrAssignment.js": -/*!****************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/defaultParam/matchOrAssignment.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var matchOrAssignment = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name') - }, - operator: '=', - right: { - type: 'LogicalExpression', - left: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name2') - }, - operator: '||', - right: (0, _fMatches.extractAny)('value') - } - } -}); - -/** - * Matches: = || ; - * - * When node matches returns the extracted fields: - * - * - name - * - value - * - node (the entire node) - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - var _ref = matchOrAssignment(node) || {}, - name = _ref.name, - name2 = _ref.name2, - value = _ref.value; - if (name && name === name2) { - return { - name: name, - value: value, - node: node - }; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/defaultParam/matchTernaryAssignment.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/defaultParam/matchTernaryAssignment.js ***! - \*********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var matchTernaryAssignment = (0, _fMatches.matches)({ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - left: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name') - }, - operator: '=', - right: { - type: 'ConditionalExpression', - test: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name2') - }, - consequent: { - type: 'Identifier', - name: (0, _fMatches.extractAny)('name3') - }, - alternate: (0, _fMatches.extractAny)('value') - } - } -}); - -/** - * Matches: = ? : ; - * - * When node matches returns the extracted fields: - * - * - name - * - value - * - node (the entire node) - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - var _ref = matchTernaryAssignment(node) || {}, - name = _ref.name, - name2 = _ref.name2, - name3 = _ref.name3, - value = _ref.value; - if (name && name === name2 && name === name3) { - return { - name: name, - value: value, - node: node - }; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/destructParam.js": -/*!***********************************************************!*\ - !*** ./node_modules/lebab/lib/transform/destructParam.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _recast = __webpack_require__(/*! recast */ "./node_modules/recast/main.js"); -var _Parser = _interopRequireDefault(__webpack_require__(/*! ../Parser */ "./node_modules/lebab/lib/Parser.js")); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _withScope = _interopRequireDefault(__webpack_require__(/*! ../withScope */ "./node_modules/lebab/lib/withScope.js")); -var functionType = _interopRequireWildcard(__webpack_require__(/*! ../utils/functionType */ "./node_modules/lebab/lib/utils/functionType.js")); -var _Hierarchy = _interopRequireDefault(__webpack_require__(/*! ../utils/Hierarchy */ "./node_modules/lebab/lib/utils/Hierarchy.js")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -var MAX_PROPS = 4; -function _default(ast, logger) { - var hierarchy = new _Hierarchy["default"](ast); - _traverser["default"].traverse(ast, (0, _withScope["default"])(ast, { - enter: function enter(fnNode, parent, scope) { - if (functionType.isFunction(fnNode)) { - scope.variables.filter(isParameter).map(function (v) { - return { - variable: v, - exs: getMemberExpressions(v, hierarchy) - }; - }).filter(function (_ref) { - var exs = _ref.exs; - return exs.length > 0; - }).forEach(function (_ref2) { - var variable = _ref2.variable, - exs = _ref2.exs; - // Replace parameter with destruct-pattern - var index = fnNode.params.findIndex(function (param) { - return param === variable.defs[0].name; - }); - if (index === -1) { - return; - } - if (uniqPropNames(exs).length > MAX_PROPS) { - logger.warn(fnNode, "".concat(uniqPropNames(exs).length, " different props found, will not transform more than ").concat(MAX_PROPS), 'destruct-param'); - return; - } - fnNode.params[index] = createDestructPattern(exs); - - // Replace references of obj.foo with simply foo - exs.forEach(function (ex) { - ex.type = ex.property.type; - ex.name = ex.property.name; - }); - }); - } - } - })); -} -function isParameter(variable) { - return variable.defs.length === 1 && variable.defs[0].type === 'Parameter'; -} -function getMemberExpressions(variable, hierarchy) { - var memberExpressions = []; - var _iterator = _createForOfIteratorHelper(variable.references), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var ref = _step.value; - var memEx = hierarchy.getParent(ref.identifier); - if (!isMemberExpressionObject(memEx, ref.identifier)) { - return []; - } - var ex = hierarchy.getParent(memEx); - if (isAssignment(ex, memEx) || isUpdate(ex, memEx) || isMethodCall(ex, memEx)) { - return []; - } - if (isKeyword(memEx.property.name) || variableExists(memEx.property.name, ref.from)) { - return []; - } - memberExpressions.push(memEx); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - return memberExpressions; -} -function isMemberExpressionObject(memEx, object) { - return memEx.type === 'MemberExpression' && memEx.object === object && memEx.computed === false; -} -function isAssignment(ex, node) { - return ex.type === 'AssignmentExpression' && ex.left === node; -} -function isUpdate(ex, node) { - return ex.type === 'UpdateExpression' && ex.argument === node; -} -function isMethodCall(ex, node) { - return ex.type === 'CallExpression' && ex.callee === node; -} -function variableExists(variableName, scope) { - while (scope) { - if (scope.through.some(function (ref) { - return ref.identifier.name === variableName; - })) { - return true; - } - if (scope.set.get(variableName)) { - return true; - } - scope = scope.upper; - } - return false; -} -function isKeyword(name) { - return _Parser["default"].tokenize(name)[0].type === 'Keyword'; -} -function uniqPropNames(exs) { - return (0, _fp.uniq)(exs.map(function (_ref3) { - var property = _ref3.property; - return property.name; - })); -} - -// By default recast indents the ObjectPattern AST node -// See: https://github.com/benjamn/recast/issues/240 -// -// To work around this, we're building the desired string by ourselves, -// and parsing it with Recast and extracting the ObjectPatter node. -// Feeding this back to Recast will preserve the formatting. -function createDestructPattern(exs) { - var props = uniqPropNames(exs).join(', '); - var js = "function foo({".concat(props, "}) {};"); - var ast = (0, _recast.parse)(js, { - parser: _Parser["default"] - }); - return ast.program.body[0].params[0]; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/exponent.js": -/*!******************************************************!*\ - !*** ./node_modules/lebab/lib/transform/exponent.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var isMathPow = (0, _fMatches.matches)({ - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'Math' - }, - property: { - type: 'Identifier', - name: 'pow' - } - }, - arguments: function _arguments(args) { - return args.length === 2; - } -}); -function _default(ast) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - if (isMathPow(node)) { - return { - type: 'BinaryExpression', - operator: '**', - left: node.arguments[0], - right: node.arguments[1] - }; - } - } - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/forEach/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/lebab/lib/transform/forEach/index.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _isEqualAst = _interopRequireDefault(__webpack_require__(/*! ../../utils/isEqualAst */ "./node_modules/lebab/lib/utils/isEqualAst.js")); -var _variableType = __webpack_require__(/*! ../../utils/variableType */ "./node_modules/lebab/lib/utils/variableType.js"); -var _copyComments = _interopRequireDefault(__webpack_require__(/*! ../../utils/copyComments */ "./node_modules/lebab/lib/utils/copyComments.js")); -var _matchAliasedForLoop = _interopRequireDefault(__webpack_require__(/*! ../../utils/matchAliasedForLoop */ "./node_modules/lebab/lib/utils/matchAliasedForLoop.js")); -var _validateForLoop = _interopRequireDefault(__webpack_require__(/*! ./validateForLoop */ "./node_modules/lebab/lib/transform/forEach/validateForLoop.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _default(ast, logger) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - var matches = (0, _matchAliasedForLoop["default"])(node); - if (matches) { - var warning = (0, _validateForLoop["default"])(node, matches); - if (warning) { - logger.warn.apply(logger, _toConsumableArray(warning).concat(['for-each'])); - return; - } - return withComments(node, createForEach(matches)); - } - if (node.type === 'ForStatement') { - logger.warn(node, 'Unable to transform for loop', 'for-each'); - } - } - }); -} -function withComments(node, forEach) { - (0, _copyComments["default"])({ - from: node, - to: forEach - }); - (0, _copyComments["default"])({ - from: node.body.body[0], - to: forEach - }); - return forEach; -} -function createForEach(_ref) { - var body = _ref.body, - item = _ref.item, - index = _ref.index, - array = _ref.array; - var newBody = removeFirstBodyElement(body); - var params = createForEachParams(newBody, item, index); - return { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - object: array, - property: { - type: 'Identifier', - name: 'forEach' - } - }, - arguments: [{ - type: 'ArrowFunctionExpression', - params: params, - body: newBody - }] - } - }; -} -function removeFirstBodyElement(body) { - return _objectSpread(_objectSpread({}, body), {}, { - body: (0, _fp.tail)(body.body) - }); -} -function createForEachParams(newBody, item, index) { - if (indexUsedInBody(newBody, index)) { - return [item, index]; - } - return [item]; -} -function indexUsedInBody(newBody, index) { - return _traverser["default"].find(newBody, function (node, parent) { - return (0, _isEqualAst["default"])(node, index) && (0, _variableType.isReference)(node, parent); - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/forEach/validateForLoop.js": -/*!*********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/forEach/validateForLoop.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = validateForLoop; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/** - * Checks that for-loop can be transformed to Array.forEach() - * - * Returns a warning message in case we can't transform. - * - * @param {Object} node The ForStatement - * @param {Object} body BlockStatement that's body of ForStatement - * @param {String} indexKind - * @param {String} itemKind - * @return {Array} Array of node and warnings message or undefined on success. - */ -function validateForLoop(node, _ref) { - var body = _ref.body, - indexKind = _ref.indexKind, - itemKind = _ref.itemKind; - var statement; - if (statement = returnUsed(body)) { - return [statement, 'Return statement used in for-loop body']; - } else if (statement = breakWithLabelUsed(body)) { - return [statement, 'Break statement with label used in for-loop body']; - } else if (statement = continueWithLabelUsed(body)) { - return [statement, 'Continue statement with label used in for-loop body']; - } else if (statement = breakUsed(body)) { - return [statement, 'Break statement used in for-loop body']; - } else if (statement = continueUsed(body)) { - return [statement, 'Continue statement used in for-loop body']; - } else if (indexKind !== 'let') { - return [node, 'Only for-loops with indexes declared as let can be transformed (use let transform first)']; - } else if (itemKind !== 'const') { - return [node, 'Only for-loops with const array items can be transformed (use let transform first)']; - } -} -var loopStatements = ['ForStatement', 'ForInStatement', 'ForOfStatement', 'DoWhileStatement', 'WhileStatement']; -function returnUsed(body) { - return _traverser["default"].find(body, 'ReturnStatement'); -} -function breakWithLabelUsed(body) { - return _traverser["default"].find(body, function (_ref2) { - var type = _ref2.type, - label = _ref2.label; - return type === 'BreakStatement' && label; - }); -} -function continueWithLabelUsed(body) { - return _traverser["default"].find(body, function (_ref3) { - var type = _ref3.type, - label = _ref3.label; - return type === 'ContinueStatement' && label; - }); -} -function breakUsed(body) { - return _traverser["default"].find(body, 'BreakStatement', { - skipTypes: [].concat(loopStatements, ['SwitchStatement']) - }); -} -function continueUsed(body) { - return _traverser["default"].find(body, 'ContinueStatement', { - skipTypes: loopStatements - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/forOf.js": -/*!***************************************************!*\ - !*** ./node_modules/lebab/lib/transform/forOf.js ***! - \***************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _isEqualAst = _interopRequireDefault(__webpack_require__(/*! ../utils/isEqualAst */ "./node_modules/lebab/lib/utils/isEqualAst.js")); -var _variableType = __webpack_require__(/*! ../utils/variableType */ "./node_modules/lebab/lib/utils/variableType.js"); -var _copyComments = _interopRequireDefault(__webpack_require__(/*! ../utils/copyComments */ "./node_modules/lebab/lib/utils/copyComments.js")); -var _matchAliasedForLoop = _interopRequireDefault(__webpack_require__(/*! ../utils/matchAliasedForLoop */ "./node_modules/lebab/lib/utils/matchAliasedForLoop.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _default(ast, logger) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - var matches = (0, _matchAliasedForLoop["default"])(node); - if (matches) { - if (indexUsedInBody(matches)) { - logger.warn(node, 'Index variable used in for-loop body', 'for-of'); - return; - } - if (matches.itemKind === 'var' || matches.indexKind === 'var') { - logger.warn(node, 'Only for-loops with let/const can be transformed (use let transform first)', 'for-of'); - return; - } - return withComments(node, createForOf(matches)); - } - if (node.type === 'ForStatement') { - logger.warn(node, 'Unable to transform for loop', 'for-of'); - } - } - }); -} -function indexUsedInBody(_ref) { - var body = _ref.body, - index = _ref.index; - return _traverser["default"].find(removeFirstBodyElement(body), function (node, parent) { - return (0, _isEqualAst["default"])(node, index) && (0, _variableType.isReference)(node, parent); - }); -} -function withComments(node, forOf) { - (0, _copyComments["default"])({ - from: node, - to: forOf - }); - (0, _copyComments["default"])({ - from: node.body.body[0], - to: forOf - }); - return forOf; -} -function createForOf(_ref2) { - var item = _ref2.item, - itemKind = _ref2.itemKind, - array = _ref2.array, - body = _ref2.body; - return { - type: 'ForOfStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: item, - init: null // eslint-disable-line no-null/no-null - }], - kind: itemKind - }, - right: array, - body: removeFirstBodyElement(body) - }; -} -function removeFirstBodyElement(body) { - return _objectSpread(_objectSpread({}, body), {}, { - body: (0, _fp.tail)(body.body) - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/includes/comparison.js": -/*!*****************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/includes/comparison.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isIncludesComparison = isIncludesComparison; -exports.isNotIncludesComparison = isNotIncludesComparison; -var _matchesIndexOf = __webpack_require__(/*! ./matchesIndexOf */ "./node_modules/lebab/lib/transform/includes/matchesIndexOf.js"); -/** - * True when indexOf() comparison can be translated to includes() - * @param {Object} matches - * @return {Boolean} - */ -function isIncludesComparison(_ref) { - var operator = _ref.operator, - index = _ref.index; - switch (operator) { - case '!==': - case '!=': - case '>': - return (0, _matchesIndexOf.isMinusOne)(index); - case '>=': - return (0, _matchesIndexOf.isZero)(index); - default: - return false; - } -} - -/** - * True when indexOf() comparison can be translated to !includes() - * @param {Object} matches - * @return {Boolean} - */ -function isNotIncludesComparison(_ref2) { - var operator = _ref2.operator, - index = _ref2.index; - switch (operator) { - case '===': - case '==': - return (0, _matchesIndexOf.isMinusOne)(index); - case '<': - return (0, _matchesIndexOf.isZero)(index); - default: - return false; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/includes/index.js": -/*!************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/includes/index.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _matchesIndexOf = _interopRequireDefault(__webpack_require__(/*! ./matchesIndexOf */ "./node_modules/lebab/lib/transform/includes/matchesIndexOf.js")); -var _comparison = __webpack_require__(/*! ./comparison */ "./node_modules/lebab/lib/transform/includes/comparison.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - var matches = (0, _matchesIndexOf["default"])(node); - if (matches && (0, _comparison.isIncludesComparison)(matches)) { - return createIncludes(matches); - } - if (matches && (0, _comparison.isNotIncludesComparison)(matches)) { - return createNot(createIncludes(matches)); - } - } - }); -} -function createNot(argument) { - return { - type: 'UnaryExpression', - operator: '!', - prefix: true, - argument: argument - }; -} -function createIncludes(_ref) { - var object = _ref.object, - searchElement = _ref.searchElement; - return { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: object, - property: { - type: 'Identifier', - name: 'includes' - } - }, - arguments: [searchElement] - }; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/includes/matchesIndexOf.js": -/*!*********************************************************************!*\ - !*** ./node_modules/lebab/lib/transform/includes/matchesIndexOf.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -exports.isZero = exports.isMinusOne = void 0; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Matches: -1 - */ -var isMinusOne = (0, _fMatches.matches)({ - type: 'UnaryExpression', - operator: '-', - argument: { - type: 'Literal', - value: 1 - }, - prefix: true -}); - -/** - * Matches: 0 - */ -exports.isMinusOne = isMinusOne; -var isZero = (0, _fMatches.matches)({ - type: 'Literal', - value: 0 -}); - -// Matches: object.indexOf(searchElement) -exports.isZero = isZero; -var matchesCallIndexOf = (0, _fMatches.matches)({ - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: (0, _fMatches.extractAny)('object'), - property: { - type: 'Identifier', - name: 'indexOf' - } - }, - arguments: (0, _fMatches.matchesLength)([(0, _fMatches.extractAny)('searchElement')]) -}); - -// Matches: -1 or 0 -var matchesIndex = (0, _fMatches.extract)('index', function (v) { - return isMinusOne(v) || isZero(v); -}); - -// Matches: object.indexOf(searchElement) index -var matchesIndexOfNormal = (0, _fMatches.matches)({ - type: 'BinaryExpression', - operator: (0, _fMatches.extractAny)('operator'), - left: matchesCallIndexOf, - right: matchesIndex -}); - -// Matches: index object.indexOf(searchElement) -var matchesIndexOfReversed = (0, _fMatches.matches)({ - type: 'BinaryExpression', - operator: (0, _fMatches.extractAny)('operator'), - left: matchesIndex, - right: matchesCallIndexOf -}); - -// Reverses the direction of comparison operator -function reverseOperator(operator) { - return operator.replace(/[><]/, function (op) { - return op === '>' ? '<' : '>'; - }); -} -function reverseOperatorField(match) { - if (!match) { - return false; - } - return _objectSpread(_objectSpread({}, match), {}, { - operator: reverseOperator(match.operator) - }); -} - -/** - * Matches: - * - * object.indexOf(searchElement) index - * - * or - * - * index object.indexOf(searchElement) - * - * On success returns object with keys: - * - * - object - * - searchElement - * - operator - * - index - * - * @param {Object} node - * @return {Object} - */ -function _default(node) { - return matchesIndexOfNormal(node) || reverseOperatorField(matchesIndexOfReversed(node)); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/let.js": -/*!*************************************************!*\ - !*** ./node_modules/lebab/lib/transform/let.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var functionType = _interopRequireWildcard(__webpack_require__(/*! ../utils/functionType */ "./node_modules/lebab/lib/utils/functionType.js")); -var variableType = _interopRequireWildcard(__webpack_require__(/*! ../utils/variableType */ "./node_modules/lebab/lib/utils/variableType.js")); -var destructuring = _interopRequireWildcard(__webpack_require__(/*! ../utils/destructuring.js */ "./node_modules/lebab/lib/utils/destructuring.js")); -var _multiReplaceStatement = _interopRequireDefault(__webpack_require__(/*! ../utils/multiReplaceStatement */ "./node_modules/lebab/lib/utils/multiReplaceStatement.js")); -var _ScopeManager = _interopRequireDefault(__webpack_require__(/*! ../scope/ScopeManager */ "./node_modules/lebab/lib/scope/ScopeManager.js")); -var _VariableMarker = _interopRequireDefault(__webpack_require__(/*! ../scope/VariableMarker */ "./node_modules/lebab/lib/scope/VariableMarker.js")); -var _FunctionHoister = _interopRequireDefault(__webpack_require__(/*! ../scope/FunctionHoister */ "./node_modules/lebab/lib/scope/FunctionHoister.js")); -var _VariableDeclaration = _interopRequireDefault(__webpack_require__(/*! ../syntax/VariableDeclaration */ "./node_modules/lebab/lib/syntax/VariableDeclaration.js")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var logger; -var scopeManager; -function _default(ast, loggerInstance) { - logger = loggerInstance; - scopeManager = new _ScopeManager["default"](); - var variableMarker = new _VariableMarker["default"](scopeManager); - _traverser["default"].traverse(ast, { - enter: function enter(node, parent) { - if (node.type === 'Program') { - enterProgram(node); - } else if (functionType.isFunctionDeclaration(node)) { - enterFunctionDeclaration(node); - } else if (functionType.isFunctionExpression(node)) { - enterFunctionExpression(node); - } else if (isBlockScopedStatement(node)) { - scopeManager.enterBlock(); - } else if (node.type === 'VariableDeclaration') { - node.declarations.forEach(function (decl) { - variableMarker.markDeclared(destructuring.extractVariableNames(decl.id)); - - // Uninitialized variables can never be const. - // But variables in for-in/of loop heads are actually initialized (although init === null). - var inForLoopHead = isAnyForStatement(parent) && parent.left === node; - if (decl.init === null && !inForLoopHead) { - // eslint-disable-line no-null/no-null - variableMarker.markModified(decl.id.name); - } - }); - } else if (node.type === 'AssignmentExpression') { - destructuring.extractVariableNames(node.left).forEach(function (name) { - variableMarker.markModified(name); - }); - } else if (variableType.isUpdate(node)) { - variableMarker.markModified(node.argument.name); - } else if (variableType.isReference(node, parent)) { - variableMarker.markReferenced(node.name); - } - }, - leave: function leave(node) { - if (node.type === 'Program') { - leaveProgram(); - } else if (functionType.isFunction(node)) { - leaveFunction(); - } else if (isBlockScopedStatement(node)) { - scopeManager.leaveScope(); - } - } - }); -} - -// Block scope is usually delimited by { ... } -// But for-loop heads also constitute a block scope. -function isBlockScopedStatement(node) { - return node.type === 'BlockStatement' || isAnyForStatement(node); -} - -// True when dealing with any kind of for-loop -function isAnyForStatement(node) { - return node.type === 'ForStatement' || node.type === 'ForInStatement' || node.type === 'ForOfStatement'; -} - -// True when dealing with any kind of while-loop -function isAnyWhileStatement(node) { - return node.type === 'WhileStatement' || node.type === 'DoWhileStatement'; -} - -// Program node works almost like a function: -// it hoists all variables which can be transformed to block-scoped let/const. -// It just doesn't have name and parameters. -// So we create an implied FunctionScope and BlockScope. -function enterProgram(node) { - scopeManager.enterFunction(); - hoistFunction({ - body: node - }); - scopeManager.enterBlock(); -} - -// FunctionDeclaration has it's name visible outside the function, -// so we first register it in surrounding block-scope and -// after that enter new FunctionScope. -function enterFunctionDeclaration(func) { - if (func.id) { - getScope().register(func.id.name, getScope().findFunctionScoped(func.id.name)); - } - scopeManager.enterFunction(); - hoistFunction({ - params: func.params, - body: func.body - }); -} - -// FunctionExpression has it's name visible only inside the function, -// so we first enter new FunctionScope and -// hoist function name and params variables inside it. -function enterFunctionExpression(func) { - scopeManager.enterFunction(); - hoistFunction({ - id: func.id, - params: func.params, - body: func.body - }); -} -function hoistFunction(cfg) { - new _FunctionHoister["default"](getScope()).hoist(cfg); -} - -// Exits the implied BlockScope and FunctionScope of Program node -function leaveProgram() { - scopeManager.leaveScope(); - leaveFunction(); -} - -// Exits FunctionScope but first transforms all variables inside it -function leaveFunction() { - transformVarsToLetOrConst(); - scopeManager.leaveScope(); -} - -// This is where the actual transform happens -function transformVarsToLetOrConst() { - getFunctionVariableGroups().forEach(function (group) { - // Do not modify existing let & const - if (group.getNode().kind !== 'var') { - return; - } - if (isLexicalVariableProhibited(group)) { - logWarningForVarKind(group.getNode()); - return; - } - var commonKind = group.getCommonKind(); - if (commonKind) { - // When all variables in group are of the same kind, - // just set appropriate `kind` value for the existing - // VariableDeclaration node. - group.getNode().kind = commonKind; - logWarningForVarKind(group.getNode()); - } else if (hasMultiStatementBody(group.getParentNode())) { - // When some variables are of a different kind, - // create separate VariableDeclaration nodes for each - // VariableDeclarator and set their `kind` value appropriately. - var varNodes = group.getVariables().map(function (v) { - return new _VariableDeclaration["default"](v.getKind(), [v.getNode()]); - }); - (0, _multiReplaceStatement["default"])({ - parent: group.getParentNode(), - node: group.getNode(), - replacements: varNodes, - preserveComments: true - }); - logWarningForVarKind(group.getNode()); - } else { - // When parent node restricts breaking VariableDeclaration to multiple ones - // just change the kind of the declaration to the most restrictive possible - group.getNode().kind = group.getMostRestrictiveKind(); - logWarningForVarKind(group.getNode()); - } - }); -} - -// let and const declarations aren't allowed in all the same places where -// var declarations are allowed. Notably, only var-declaration can occur -// directlt in if-statement (and other similar statements) body: -// -// if (true) var x = 10; -// -// let or const can only be used when the variable is declared in inside -// a block-statement: -// -// if (true) { const x = 10; } -// -function isLexicalVariableProhibited(group) { - var node = group.getNode(); - var parentNode = group.getParentNode(); - if (parentNode.type === 'IfStatement') { - return parentNode.consequent === node || parentNode.alternate === node; - } - if (isAnyForStatement(parentNode) || isAnyWhileStatement(parentNode)) { - return parentNode.body === node; - } - return false; -} -function logWarningForVarKind(node) { - if (node.kind === 'var') { - logger.warn(node, 'Unable to transform var', 'let'); - } -} - -// Does a node have body that can contain an array of statements -function hasMultiStatementBody(node) { - return node.type === 'BlockStatement' || node.type === 'Program' || node.type === 'SwitchCase'; -} - -// Returns all VariableGroups of variables in current function scope, -// including from all the nested block-scopes (but not the nested -// functions). -function getFunctionVariableGroups() { - return (0, _fp.flow)((0, _fp.map)(function (v) { - return v.getGroup(); - }), _fp.uniq, _fp.compact)(getScope().getVariables()); -} -function getScope() { - return scopeManager.getScope(); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/multiVar.js": -/*!******************************************************!*\ - !*** ./node_modules/lebab/lib/transform/multiVar.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _multiReplaceStatement = _interopRequireDefault(__webpack_require__(/*! ../utils/multiReplaceStatement */ "./node_modules/lebab/lib/utils/multiReplaceStatement.js")); -var _VariableDeclaration = _interopRequireDefault(__webpack_require__(/*! ../syntax/VariableDeclaration */ "./node_modules/lebab/lib/syntax/VariableDeclaration.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast, logger) { - _traverser["default"].traverse(ast, { - enter: function enter(node, parent) { - if (node.type === 'VariableDeclaration' && node.declarations.length > 1) { - splitDeclaration(node, parent, logger); - return _traverser["default"].VisitorOption.Skip; - } - } - }); -} -function splitDeclaration(node, parent, logger) { - var declNodes = node.declarations.map(function (declarator) { - return new _VariableDeclaration["default"](node.kind, [declarator]); - }); - try { - (0, _multiReplaceStatement["default"])({ - parent: parent, - node: node, - replacements: declNodes, - preserveComments: true - }); - } catch (e) { - logger.warn(parent, "Unable to split var statement in a ".concat(parent.type), 'multi-var'); - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/noStrict.js": -/*!******************************************************!*\ - !*** ./node_modules/lebab/lib/transform/noStrict.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _isString = _interopRequireDefault(__webpack_require__(/*! ../utils/isString */ "./node_modules/lebab/lib/utils/isString.js")); -var _copyComments = _interopRequireDefault(__webpack_require__(/*! ../utils/copyComments */ "./node_modules/lebab/lib/utils/copyComments.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast) { - _traverser["default"].replace(ast, { - enter: function enter(node, parent) { - if (node.type === 'ExpressionStatement' && isUseStrictString(node.expression)) { - (0, _copyComments["default"])({ - from: node, - to: parent - }); - this.remove(); - } - } - }); -} -function isUseStrictString(node) { - return (0, _isString["default"])(node) && node.value === 'use strict'; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/objMethod.js": -/*!*******************************************************!*\ - !*** ./node_modules/lebab/lib/transform/objMethod.js ***! - \*******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var matchTransformableProperty = (0, _fMatches.matches)({ - type: 'Property', - key: { - type: 'Identifier' - }, - value: { - type: 'FunctionExpression', - id: (0, _fMatches.extractAny)('functionName') - }, - method: false, - computed: false, - shorthand: false -}); -function _default(ast, logger) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - var match = matchTransformableProperty(node); - if (match) { - // Do not transform functions with name, - // as the name might be recursively referenced from inside. - if (match.functionName) { - logger.warn(node, 'Unable to transform named function', 'obj-method'); - return; - } - node.method = true; - } - } - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/objShorthand.js": -/*!**********************************************************!*\ - !*** ./node_modules/lebab/lib/transform/objShorthand.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast) { - _traverser["default"].replace(ast, { - enter: propertyToShorthand - }); -} -function propertyToShorthand(node) { - if (node.type === 'Property' && equalIdentifiers(node.key, node.value)) { - node.shorthand = true; - } -} -function equalIdentifiers(a, b) { - return a.type === 'Identifier' && b.type === 'Identifier' && a.name === b.name; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/transform/template.js": -/*!******************************************************!*\ - !*** ./node_modules/lebab/lib/transform/template.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -var _TemplateLiteral = _interopRequireDefault(__webpack_require__(/*! ./../syntax/TemplateLiteral */ "./node_modules/lebab/lib/syntax/TemplateLiteral.js")); -var _TemplateElement = _interopRequireDefault(__webpack_require__(/*! ./../syntax/TemplateElement */ "./node_modules/lebab/lib/syntax/TemplateElement.js")); -var _isString = _interopRequireDefault(__webpack_require__(/*! ./../utils/isString */ "./node_modules/lebab/lib/utils/isString.js")); -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _default(ast) { - _traverser["default"].replace(ast, { - enter: function enter(node) { - if (isPlusExpression(node)) { - var plusExpr = flattenPlusExpression(node); - if (plusExpr.isString && !plusExpr.operands.every(_isString["default"])) { - var literal = new _TemplateLiteral["default"](splitQuasisAndExpressions(plusExpr.operands)); - // Ensure correct order of comments by sorting them by their position in source - literal.comments = (0, _fp.sortBy)('start', plusExpr.comments); - return literal; - } - } - } - }); -} - -// Returns object of three fields: -// - operands: flat array of all the plus operation sub-expressions -// - comments: array of comments -// - isString: true when the result of the whole plus operation is a string -function flattenPlusExpression(node) { - if (isPlusExpression(node)) { - var left = flattenPlusExpression(node.left); - var right = flattenPlusExpression(node.right); - if (left.isString || right.isString) { - return { - operands: (0, _fp.flatten)([left.operands, right.operands]), - comments: (0, _fp.flatten)([node.comments || [], left.comments, right.comments]), - isString: true - }; - } else { - return { - operands: [node], - comments: node.comments || [], - isString: false - }; - } - } else { - return { - operands: [node], - comments: node.comments || [], - isString: (0, _isString["default"])(node) - }; - } -} -function isPlusExpression(node) { - return node.type === 'BinaryExpression' && node.operator === '+'; -} -function splitQuasisAndExpressions(operands) { - var quasis = []; - var expressions = []; - for (var i = 0; i < operands.length; i++) { - var curr = operands[i]; - if ((0, _isString["default"])(curr)) { - var currVal = curr.value; - var currRaw = escapeForTemplate(curr.raw); - while ((0, _isString["default"])(operands[i + 1] || {})) { - i++; - currVal += operands[i].value; - currRaw += escapeForTemplate(operands[i].raw); - } - quasis.push(new _TemplateElement["default"]({ - raw: currRaw, - cooked: currVal - })); - } else { - if (i === 0) { - quasis.push(new _TemplateElement["default"]({})); - } - if (!(0, _isString["default"])(operands[i + 1] || {})) { - quasis.push(new _TemplateElement["default"]({ - tail: operands[i + 1] === undefined - })); - } - expressions.push(curr); - } - } - return { - quasis: quasis, - expressions: expressions - }; -} - -// Strip surrounding quotes, escape backticks and unescape escaped quotes -function escapeForTemplate(raw) { - return raw.replace(/^['"]|['"]$/g, '').replace(/`/g, '\\`').replace(/\\(['"])/g, '$1'); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/traverser.js": -/*!*********************************************!*\ - !*** ./node_modules/lebab/lib/traverser.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var _estraverse = _interopRequireDefault(__webpack_require__(/*! estraverse */ "./node_modules/estraverse/estraverse.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -// JSX AST types, as documented in: -// https://github.com/facebook/jsx/blob/master/AST.md -var jsxExtensionKeys = { - keys: { - JSXIdentifier: [], - JSXMemberExpression: ['object', 'property'], - JSXNamespacedName: ['namespace', 'name'], - JSXEmptyExpression: [], - JSXExpressionContainer: ['expression'], - JSXOpeningElement: ['name', 'attributes'], - JSXClosingElement: ['name'], - JSXOpeningFragment: [], - JSXClosingFragment: [], - JSXAttribute: ['name', 'value'], - JSXSpreadAttribute: ['argument'], - JSXElement: ['openingElement', 'closingElement', 'children'], - JSXFragment: ['openingFragment', 'closingFragment', 'children'], - JSXText: [] - } -}; - -/** - * Proxy for ESTraverse. - * Providing a single place to easily extend its functionality. - * - * Exposes the traverse() and replace() methods just like ESTraverse, - * plus some custom helpers. - */ -var _default = { - /** - * Traverses AST like ESTraverse.traverse() - * @param {Object} tree - * @param {Object} cfg Object with optional enter() and leave() methods. - * @return {Object} The transformed tree - */ - traverse: function traverse(tree, cfg) { - return _estraverse["default"].traverse(tree, Object.assign(cfg, jsxExtensionKeys)); - }, - /** - * Traverses AST like ESTraverse.replace() - * @param {Object} tree - * @param {Object} cfg Object with optional enter() and leave() methods. - * @return {Object} The transformed tree - */ - replace: function replace(tree, cfg) { - return _estraverse["default"].replace(tree, Object.assign(cfg, jsxExtensionKeys)); - }, - /** - * Constants to return from enter()/leave() to control traversal: - * - * - Skip - skips walking child nodes - * - Break - ends it all - * - Remove - removes the current node (only with replace()) - */ - VisitorOption: _estraverse["default"].VisitorOption, - /** - * Searches in AST tree for node which satisfies the predicate. - * @param {Object} tree - * @param {Function|String} query Search function called with `node` and `parent` - * Alternatively it can be string: the node type to search for. - * @param {String[]} opts.skipTypes List of node types to skip (not traversing into these nodes) - * @return {Object} The found node or undefined when not found - */ - find: function find(tree, query) { - var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - _ref$skipTypes = _ref.skipTypes, - skipTypes = _ref$skipTypes === void 0 ? [] : _ref$skipTypes; - var predicate = this.createFindPredicate(query); - var found; - this.traverse(tree, { - enter: function enter(node, parent) { - if ((0, _fp.includes)(node.type, skipTypes)) { - return _estraverse["default"].VisitorOption.Skip; - } - if (predicate(node, parent)) { - found = node; - return _estraverse["default"].VisitorOption.Break; - } - } - }); - return found; - }, - createFindPredicate: function createFindPredicate(query) { - if ((0, _fp.isString)(query)) { - return function (node) { - return node.type === query; - }; - } else { - return query; - } - } -}; -exports["default"] = _default; - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/Hierarchy.js": -/*!***************************************************!*\ - !*** ./node_modules/lebab/lib/utils/Hierarchy.js ***! - \***************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _traverser = _interopRequireDefault(__webpack_require__(/*! ../traverser */ "./node_modules/lebab/lib/traverser.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Provides a way to look up parent nodes. - */ -var Hierarchy = /*#__PURE__*/function () { - /** - * @param {Object} ast Root node - */ - function Hierarchy(ast) { - var _this = this; - _classCallCheck(this, Hierarchy); - this.parents = new Map(); - _traverser["default"].traverse(ast, { - enter: function enter(node, parent) { - _this.parents.set(node, parent); - } - }); - } - - /** - * Returns parent node of given AST node. - * @param {Object} node - * @return {Object} - */ - _createClass(Hierarchy, [{ - key: "getParent", - value: function getParent(node) { - return this.parents.get(node); - } - }]); - return Hierarchy; -}(); -exports["default"] = Hierarchy; - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/copyComments.js": -/*!******************************************************!*\ - !*** ./node_modules/lebab/lib/utils/copyComments.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = copyComments; -/** - * Appends comments of one node to comments of another. - * - * - Modifies `to` node with added comments. - * - Does nothing when there are no comments to copy - * (ensuring we don't modify the `to` node when not needed). - * - * @param {Object} from Node to copy comments from - * @param {Object} to Node to copy comments to - */ -function copyComments(_ref) { - var from = _ref.from, - to = _ref.to; - if (from.comments && from.comments.length > 0) { - to.comments = (to.comments || []).concat(from.comments || []); - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/destructuring.js": -/*!*******************************************************!*\ - !*** ./node_modules/lebab/lib/utils/destructuring.js ***! - \*******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.extractVariableNames = extractVariableNames; -exports.extractVariables = extractVariables; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -/** - * Extracts all variables from from destructuring - * operation in assignment or variable declaration. - * - * Also works for a single identifier (so it generalizes - * for all assignments / variable declarations). - * - * @param {Object} node - * @return {Object[]} Identifiers - */ -function extractVariables(node) { - if (node.type === 'Identifier') { - return [node]; - } - if (node.type === 'ArrayPattern') { - // Use compact() to ignore missing elements in ArrayPattern - return (0, _fp.flatMap)(extractVariables, (0, _fp.compact)(node.elements)); - } - if (node.type === 'ObjectPattern') { - return (0, _fp.flatMap)(extractVariables, node.properties); - } - if (node.type === 'Property') { - return extractVariables(node.value); - } - if (node.type === 'AssignmentPattern') { - return extractVariables(node.left); - } - - // Ignore stuff like MemberExpressions, - // we only care about variables. - return []; -} - -/** - * Like extractVariables(), but returns the names of variables - * instead of Identifier objects. - * - * @param {Object} node - * @return {String[]} variable names - */ -function extractVariableNames(node) { - return extractVariables(node).map(function (v) { - return v.name; - }); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/functionType.js": -/*!******************************************************!*\ - !*** ./node_modules/lebab/lib/utils/functionType.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isFunction = isFunction; -exports.isFunctionDeclaration = isFunctionDeclaration; -exports.isFunctionExpression = isFunctionExpression; -/** - * True when node is any kind of function. - */ -function isFunction(node) { - return isFunctionDeclaration(node) || isFunctionExpression(node); -} - -/** - * True when node is (arrow) function expression. - */ -function isFunctionExpression(node) { - return node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'; -} - -/** - * True when node is function declaration. - */ -function isFunctionDeclaration(node) { - return node.type === 'FunctionDeclaration'; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/isEqualAst.js": -/*!****************************************************!*\ - !*** ./node_modules/lebab/lib/utils/isEqualAst.js ***! - \****************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = isEqualAst; -var _fp = __webpack_require__(/*! lodash/fp */ "./node_modules/lodash/fp.js"); -var metaDataFields = { - comments: true, - loc: true, - start: true, - end: true -}; - -/** - * True when two AST nodes are structurally equal. - * When comparing objects it ignores the meta-data fields for - * comments and source-code position. - * @param {Object} a - * @param {Object} b - * @return {Boolean} - */ -function isEqualAst(a, b) { - return (0, _fp.isEqualWith)(function (aValue, bValue, key) { - return metaDataFields[key]; - }, a, b); -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/isString.js": -/*!**************************************************!*\ - !*** ./node_modules/lebab/lib/utils/isString.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = isString; -/** - * True when the given node is string literal. - * @param {Object} node - * @return {Boolean} - */ -function isString(node) { - return node.type === 'Literal' && typeof node.value === 'string'; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/matchAliasedForLoop.js": -/*!*************************************************************!*\ - !*** ./node_modules/lebab/lib/utils/matchAliasedForLoop.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -var _isEqualAst = _interopRequireDefault(__webpack_require__(/*! ./isEqualAst */ "./node_modules/lebab/lib/utils/isEqualAst.js")); -var _fMatches = __webpack_require__(/*! f-matches */ "./node_modules/f-matches/index.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -// Matches ++ or ++ -var matchPlusPlus = (0, _fMatches.matches)({ - type: 'UpdateExpression', - operator: '++', - argument: (0, _fMatches.extract)('indexIncrement', { - type: 'Identifier' - }) -}); - -// Matches +=1 -var matchPlusOne = (0, _fMatches.matches)({ - type: 'AssignmentExpression', - operator: '+=', - left: (0, _fMatches.extract)('indexIncrement', { - type: 'Identifier' - }), - right: { - type: 'Literal', - value: 1 - } -}); - -// Matches the first element in array pattern -// The default matches() tries to match against any array element. -var matchesFirst = function matchesFirst(patterns) { - return function (array) { - return (0, _fMatches.matches)(patterns[0], array[0]); - }; -}; - -// Matches for-loop -// without checking the consistency of index and array variables: -// -// for (let index = 0; indexComparison < array.length; indexIncrement++) { -// let item = arrayReference[indexReference]; -// ... -// } -var matchLooseForLoop = (0, _fMatches.matches)({ - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: (0, _fMatches.matchesLength)([{ - type: 'VariableDeclarator', - id: (0, _fMatches.extract)('index', { - type: 'Identifier' - }), - init: { - type: 'Literal', - value: 0 - } - }]), - kind: (0, _fMatches.extractAny)('indexKind') - }, - test: { - type: 'BinaryExpression', - operator: '<', - left: (0, _fMatches.extract)('indexComparison', { - type: 'Identifier' - }), - right: { - type: 'MemberExpression', - computed: false, - object: (0, _fMatches.extractAny)('array'), - property: { - type: 'Identifier', - name: 'length' - } - } - }, - update: function update(node) { - return matchPlusPlus(node) || matchPlusOne(node); - }, - body: (0, _fMatches.extract)('body', { - type: 'BlockStatement', - body: matchesFirst([{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: (0, _fMatches.extract)('item', { - type: 'Identifier' - }), - init: { - type: 'MemberExpression', - computed: true, - object: (0, _fMatches.extractAny)('arrayReference'), - property: (0, _fMatches.extract)('indexReference', { - type: 'Identifier' - }) - } - }], - kind: (0, _fMatches.extractAny)('itemKind') - }]) - }) -}); -function isConsistentIndexVar(_ref) { - var index = _ref.index, - indexComparison = _ref.indexComparison, - indexIncrement = _ref.indexIncrement, - indexReference = _ref.indexReference; - return (0, _isEqualAst["default"])(index, indexComparison) && (0, _isEqualAst["default"])(index, indexIncrement) && (0, _isEqualAst["default"])(index, indexReference); -} -function isConsistentArrayVar(_ref2) { - var array = _ref2.array, - arrayReference = _ref2.arrayReference; - return (0, _isEqualAst["default"])(array, arrayReference); -} - -/** - * Matches for-loop that aliases current array element - * in the first line of the loop body: - * - * for (let index = 0; index < array.length; index++) { - * let item = array[index]; - * ... - * } - * - * Extracts the following fields: - * - * - index - loop index identifier - * - indexKind - the kind of - * - array - array identifier or expression - * - item - identifier used to alias current array element - * - itemKind - the kind of - * - body - the whole BlockStatement of for-loop body - * - * @param {Object} node - * @return {Object} - */ -function _default(ast) { - var match = matchLooseForLoop(ast); - if (match && isConsistentIndexVar(match) && isConsistentArrayVar(match)) { - return match; - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/multiReplaceStatement.js": -/*!***************************************************************!*\ - !*** ./node_modules/lebab/lib/utils/multiReplaceStatement.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = multiReplaceStatement; -var _copyComments = _interopRequireDefault(__webpack_require__(/*! ./copyComments */ "./node_modules/lebab/lib/utils/copyComments.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -/** - * Replaces `node` inside `parent` with any number of `replacements`. - * - * ESTraverse only allows replacing one node with a single other node. - * This function overcomes this limitation, allowing to replace it with multiple nodes. - * - * NOTE: Only works for nodes that allow multiple elements in their body. - * When node doesn't exist inside parent, does nothing. - * - * @param {Object} cfg - * @param {Object} cfg.parent Parent node of the node to replace - * @param {Object} cfg.node The node to replace - * @param {Object[]} cfg.replacements Replacement nodes (can be empty array) - * @param {Boolean} [cfg.preserveComments] True to copy over comments from - * node to first replacement node - */ -function multiReplaceStatement(_ref) { - var parent = _ref.parent, - node = _ref.node, - replacements = _ref.replacements, - preserveComments = _ref.preserveComments; - var body = getBody(parent); - var index = body.indexOf(node); - if (preserveComments && replacements[0]) { - (0, _copyComments["default"])({ - from: node, - to: replacements[0] - }); - } - if (index !== -1) { - body.splice.apply(body, [index, 1].concat(_toConsumableArray(replacements))); - } -} -function getBody(node) { - switch (node.type) { - case 'BlockStatement': - case 'Program': - return node.body; - case 'SwitchCase': - return node.consequent; - case 'ObjectExpression': - return node.properties; - default: - throw "Unsupported node type '".concat(node.type, "' in multiReplaceStatement()"); - } -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/utils/variableType.js": -/*!******************************************************!*\ - !*** ./node_modules/lebab/lib/utils/variableType.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isReference = isReference; -exports.isUpdate = isUpdate; -var _functionType = __webpack_require__(/*! ./functionType */ "./node_modules/lebab/lib/utils/functionType.js"); -/** - * True when node is variable update expression (like x++). - * - * @param {Object} node - * @return {Boolean} - */ -function isUpdate(node) { - return node.type === 'UpdateExpression' && node.argument.type === 'Identifier'; -} - -/** - * True when node is reference to a variable. - * - * That is it's an identifier, that's not used: - * - * - as function name in function declaration/expression, - * - as parameter name in function declaration/expression, - * - as declared variable name in variable declaration, - * - as object property name in member expression. - * - as object property name in object literal. - * - * @param {Object} node - * @param {Object} parent Immediate parent node (to determine context) - * @return {Boolean} - */ -function isReference(node, parent) { - return node.type === 'Identifier' && !isFunctionName(node, parent) && !isFunctionParameter(node, parent) && !isDeclaredVariable(node, parent) && !isPropertyInMemberExpression(node, parent) && !isPropertyInObjectLiteral(node, parent); -} -function isFunctionName(node, parent) { - return (0, _functionType.isFunction)(parent) && parent.id === node; -} -function isFunctionParameter(node, parent) { - return (0, _functionType.isFunction)(parent) && parent.params.some(function (p) { - return p === node; - }); -} -function isDeclaredVariable(node, parent) { - return parent.type === 'VariableDeclarator' && parent.id === node; -} -function isPropertyInMemberExpression(node, parent) { - return parent.type === 'MemberExpression' && parent.property === node && !parent.computed; -} -function isPropertyInObjectLiteral(node, parent) { - return parent.type === 'Property' && parent.key === node; -} - -/***/ }), - -/***/ "./node_modules/lebab/lib/withScope.js": -/*!*********************************************!*\ - !*** ./node_modules/lebab/lib/withScope.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = withScope; -var _escope = __webpack_require__(/*! escope */ "./node_modules/escope/lib/index.js"); -var _functionType = __webpack_require__(/*! ./utils/functionType */ "./node_modules/lebab/lib/utils/functionType.js"); -var emptyFn = function emptyFn() {}; // eslint-disable-line no-empty-function - -/** - * A helper for traversing with scope info from escope. - * - * Usage: - * - * traverser.traverse(ast, withScope(ast, { - * enter(node, parent, scope) { - * // do something with node and scope - * } - * })) - * - * @param {Object} ast The AST root node also passed to traverser. - * @param {Object} cfg Object with enter function as expected by traverser. - * @return {Object} Object with enter function to be passed to traverser. - */ -function withScope(ast, _ref) { - var _ref$enter = _ref.enter, - _enter = _ref$enter === void 0 ? emptyFn : _ref$enter; - var scopeManager = (0, _escope.analyze)(ast, { - ecmaVersion: 2022, - sourceType: 'module' - }); - var currentScope = scopeManager.acquire(ast); - return { - enter: function enter(node, parent) { - if ((0, _functionType.isFunction)(node)) { - currentScope = scopeManager.acquire(node); - } - return _enter.call(this, node, parent, currentScope); - } // NOTE: leave() is currently not implemented. - // See escope docs for supporting it if need arises: https://github.com/estools/escope - }; -} - -/***/ }), - -/***/ "./node_modules/lebab/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs": -/*!******************************************************************************************!*\ - !*** ./node_modules/lebab/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs ***! - \******************************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys - */ - -/** - * @type {VisitorKeys} - */ -const KEYS = { - ArrayExpression: [ - "elements" - ], - ArrayPattern: [ - "elements" - ], - ArrowFunctionExpression: [ - "params", - "body" - ], - AssignmentExpression: [ - "left", - "right" - ], - AssignmentPattern: [ - "left", - "right" - ], - AwaitExpression: [ - "argument" - ], - BinaryExpression: [ - "left", - "right" - ], - BlockStatement: [ - "body" - ], - BreakStatement: [ - "label" - ], - CallExpression: [ - "callee", - "arguments" - ], - CatchClause: [ - "param", - "body" - ], - ChainExpression: [ - "expression" - ], - ClassBody: [ - "body" - ], - ClassDeclaration: [ - "id", - "superClass", - "body" - ], - ClassExpression: [ - "id", - "superClass", - "body" - ], - ConditionalExpression: [ - "test", - "consequent", - "alternate" - ], - ContinueStatement: [ - "label" - ], - DebuggerStatement: [], - DoWhileStatement: [ - "body", - "test" - ], - EmptyStatement: [], - ExperimentalRestProperty: [ - "argument" - ], - ExperimentalSpreadProperty: [ - "argument" - ], - ExportAllDeclaration: [ - "exported", - "source" - ], - ExportDefaultDeclaration: [ - "declaration" - ], - ExportNamedDeclaration: [ - "declaration", - "specifiers", - "source" - ], - ExportSpecifier: [ - "exported", - "local" - ], - ExpressionStatement: [ - "expression" - ], - ForInStatement: [ - "left", - "right", - "body" - ], - ForOfStatement: [ - "left", - "right", - "body" - ], - ForStatement: [ - "init", - "test", - "update", - "body" - ], - FunctionDeclaration: [ - "id", - "params", - "body" - ], - FunctionExpression: [ - "id", - "params", - "body" - ], - Identifier: [], - IfStatement: [ - "test", - "consequent", - "alternate" - ], - ImportDeclaration: [ - "specifiers", - "source" - ], - ImportDefaultSpecifier: [ - "local" - ], - ImportExpression: [ - "source" - ], - ImportNamespaceSpecifier: [ - "local" - ], - ImportSpecifier: [ - "imported", - "local" - ], - JSXAttribute: [ - "name", - "value" - ], - JSXClosingElement: [ - "name" - ], - JSXClosingFragment: [], - JSXElement: [ - "openingElement", - "children", - "closingElement" - ], - JSXEmptyExpression: [], - JSXExpressionContainer: [ - "expression" - ], - JSXFragment: [ - "openingFragment", - "children", - "closingFragment" - ], - JSXIdentifier: [], - JSXMemberExpression: [ - "object", - "property" - ], - JSXNamespacedName: [ - "namespace", - "name" - ], - JSXOpeningElement: [ - "name", - "attributes" - ], - JSXOpeningFragment: [], - JSXSpreadAttribute: [ - "argument" - ], - JSXSpreadChild: [ - "expression" - ], - JSXText: [], - LabeledStatement: [ - "label", - "body" - ], - Literal: [], - LogicalExpression: [ - "left", - "right" - ], - MemberExpression: [ - "object", - "property" - ], - MetaProperty: [ - "meta", - "property" - ], - MethodDefinition: [ - "key", - "value" - ], - NewExpression: [ - "callee", - "arguments" - ], - ObjectExpression: [ - "properties" - ], - ObjectPattern: [ - "properties" - ], - PrivateIdentifier: [], - Program: [ - "body" - ], - Property: [ - "key", - "value" - ], - PropertyDefinition: [ - "key", - "value" - ], - RestElement: [ - "argument" - ], - ReturnStatement: [ - "argument" - ], - SequenceExpression: [ - "expressions" - ], - SpreadElement: [ - "argument" - ], - StaticBlock: [ - "body" - ], - Super: [], - SwitchCase: [ - "test", - "consequent" - ], - SwitchStatement: [ - "discriminant", - "cases" - ], - TaggedTemplateExpression: [ - "tag", - "quasi" - ], - TemplateElement: [], - TemplateLiteral: [ - "quasis", - "expressions" - ], - ThisExpression: [], - ThrowStatement: [ - "argument" - ], - TryStatement: [ - "block", - "handler", - "finalizer" - ], - UnaryExpression: [ - "argument" - ], - UpdateExpression: [ - "argument" - ], - VariableDeclaration: [ - "declarations" - ], - VariableDeclarator: [ - "id", - "init" - ], - WhileStatement: [ - "test", - "body" - ], - WithStatement: [ - "object", - "body" - ], - YieldExpression: [ - "argument" - ] -}; - -// Types. -const NODE_TYPES = Object.keys(KEYS); - -// Freeze the keys. -for (const type of NODE_TYPES) { - Object.freeze(KEYS[type]); -} -Object.freeze(KEYS); - -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ - -/** - * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys - */ - -// List to ignore keys. -const KEY_BLACKLIST = new Set([ - "parent", - "leadingComments", - "trailingComments" -]); - -/** - * Check whether a given key should be used or not. - * @param {string} key The key to check. - * @returns {boolean} `true` if the key should be used. - */ -function filterKey(key) { - return !KEY_BLACKLIST.has(key) && key[0] !== "_"; -} - -/** - * Get visitor keys of a given node. - * @param {object} node The AST node to get keys. - * @returns {readonly string[]} Visitor keys of the node. - */ -function getKeys(node) { - return Object.keys(node).filter(filterKey); -} - -// Disable valid-jsdoc rule because it reports syntax error on the type of @returns. -// eslint-disable-next-line valid-jsdoc -/** - * Make the union set with `KEYS` and given keys. - * @param {VisitorKeys} additionalKeys The additional keys. - * @returns {VisitorKeys} The union set. - */ -function unionWith(additionalKeys) { - const retv = /** @type {{ - [type: string]: ReadonlyArray - }} */ (Object.assign({}, KEYS)); - - for (const type of Object.keys(additionalKeys)) { - if (Object.prototype.hasOwnProperty.call(retv, type)) { - const keys = new Set(additionalKeys[type]); - - for (const key of retv[type]) { - keys.add(key); - } - - retv[type] = Object.freeze(Array.from(keys)); - } else { - retv[type] = Object.freeze(Array.from(additionalKeys[type])); - } - } - - return Object.freeze(retv); -} - -exports.KEYS = KEYS; -exports.getKeys = getKeys; -exports.unionWith = unionWith; - - -/***/ }), - -/***/ "./node_modules/lebab/node_modules/espree/dist/espree.cjs": -/*!****************************************************************!*\ - !*** ./node_modules/lebab/node_modules/espree/dist/espree.cjs ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var acorn = __webpack_require__(/*! acorn */ "./node_modules/acorn/dist/acorn.js"); -var jsx = __webpack_require__(/*! acorn-jsx */ "./node_modules/acorn-jsx/index.js"); -var visitorKeys = __webpack_require__(/*! eslint-visitor-keys */ "./node_modules/lebab/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs"); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} - -var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn); -var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx); -var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys); - -/** - * @fileoverview Translates tokens between Acorn format and Esprima format. - * @author Nicholas C. Zakas - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// none! - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - - -// Esprima Token Types -const Token = { - Boolean: "Boolean", - EOF: "", - Identifier: "Identifier", - PrivateIdentifier: "PrivateIdentifier", - Keyword: "Keyword", - Null: "Null", - Numeric: "Numeric", - Punctuator: "Punctuator", - String: "String", - RegularExpression: "RegularExpression", - Template: "Template", - JSXIdentifier: "JSXIdentifier", - JSXText: "JSXText" -}; - -/** - * Converts part of a template into an Esprima token. - * @param {AcornToken[]} tokens The Acorn tokens representing the template. - * @param {string} code The source code. - * @returns {EsprimaToken} The Esprima equivalent of the template token. - * @private - */ -function convertTemplatePart(tokens, code) { - const firstToken = tokens[0], - lastTemplateToken = tokens[tokens.length - 1]; - - const token = { - type: Token.Template, - value: code.slice(firstToken.start, lastTemplateToken.end) - }; - - if (firstToken.loc) { - token.loc = { - start: firstToken.loc.start, - end: lastTemplateToken.loc.end - }; - } - - if (firstToken.range) { - token.start = firstToken.range[0]; - token.end = lastTemplateToken.range[1]; - token.range = [token.start, token.end]; - } - - return token; -} - -/** - * Contains logic to translate Acorn tokens into Esprima tokens. - * @param {Object} acornTokTypes The Acorn token types. - * @param {string} code The source code Acorn is parsing. This is necessary - * to correct the "value" property of some tokens. - * @constructor - */ -function TokenTranslator(acornTokTypes, code) { - - // token types - this._acornTokTypes = acornTokTypes; - - // token buffer for templates - this._tokens = []; - - // track the last curly brace - this._curlyBrace = null; - - // the source code - this._code = code; - -} - -TokenTranslator.prototype = { - constructor: TokenTranslator, - - /** - * Translates a single Esprima token to a single Acorn token. This may be - * inaccurate due to how templates are handled differently in Esprima and - * Acorn, but should be accurate for all other tokens. - * @param {AcornToken} token The Acorn token to translate. - * @param {Object} extra Espree extra object. - * @returns {EsprimaToken} The Esprima version of the token. - */ - translate(token, extra) { - - const type = token.type, - tt = this._acornTokTypes; - - if (type === tt.name) { - token.type = Token.Identifier; - - // TODO: See if this is an Acorn bug - if (token.value === "static") { - token.type = Token.Keyword; - } - - if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { - token.type = Token.Keyword; - } - - } else if (type === tt.privateId) { - token.type = Token.PrivateIdentifier; - - } else if (type === tt.semi || type === tt.comma || - type === tt.parenL || type === tt.parenR || - type === tt.braceL || type === tt.braceR || - type === tt.dot || type === tt.bracketL || - type === tt.colon || type === tt.question || - type === tt.bracketR || type === tt.ellipsis || - type === tt.arrow || type === tt.jsxTagStart || - type === tt.incDec || type === tt.starstar || - type === tt.jsxTagEnd || type === tt.prefix || - type === tt.questionDot || - (type.binop && !type.keyword) || - type.isAssign) { - - token.type = Token.Punctuator; - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.jsxName) { - token.type = Token.JSXIdentifier; - } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { - token.type = Token.JSXText; - } else if (type.keyword) { - if (type.keyword === "true" || type.keyword === "false") { - token.type = Token.Boolean; - } else if (type.keyword === "null") { - token.type = Token.Null; - } else { - token.type = Token.Keyword; - } - } else if (type === tt.num) { - token.type = Token.Numeric; - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.string) { - - if (extra.jsxAttrValueToken) { - extra.jsxAttrValueToken = false; - token.type = Token.JSXText; - } else { - token.type = Token.String; - } - - token.value = this._code.slice(token.start, token.end); - } else if (type === tt.regexp) { - token.type = Token.RegularExpression; - const value = token.value; - - token.regex = { - flags: value.flags, - pattern: value.pattern - }; - token.value = `/${value.pattern}/${value.flags}`; - } - - return token; - }, - - /** - * Function to call during Acorn's onToken handler. - * @param {AcornToken} token The Acorn token. - * @param {Object} extra The Espree extra object. - * @returns {void} - */ - onToken(token, extra) { - - const tt = this._acornTokTypes, - tokens = extra.tokens, - templateTokens = this._tokens; - - /** - * Flushes the buffered template tokens and resets the template - * tracking. - * @returns {void} - * @private - */ - const translateTemplateTokens = () => { - tokens.push(convertTemplatePart(this._tokens, this._code)); - this._tokens = []; - }; - - if (token.type === tt.eof) { - - // might be one last curlyBrace - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - } - - return; - } - - if (token.type === tt.backQuote) { - - // if there's already a curly, it's not part of the template - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - this._curlyBrace = null; - } - - templateTokens.push(token); - - // it's the end - if (templateTokens.length > 1) { - translateTemplateTokens(); - } - - return; - } - if (token.type === tt.dollarBraceL) { - templateTokens.push(token); - translateTemplateTokens(); - return; - } - if (token.type === tt.braceR) { - - // if there's already a curly, it's not part of the template - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - } - - // store new curly for later - this._curlyBrace = token; - return; - } - if (token.type === tt.template || token.type === tt.invalidTemplate) { - if (this._curlyBrace) { - templateTokens.push(this._curlyBrace); - this._curlyBrace = null; - } - - templateTokens.push(token); - return; - } - - if (this._curlyBrace) { - tokens.push(this.translate(this._curlyBrace, extra)); - this._curlyBrace = null; - } - - tokens.push(this.translate(token, extra)); - } -}; - -/** - * @fileoverview A collection of methods for processing Espree's options. - * @author Kai Cataldo - */ - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -const SUPPORTED_VERSIONS = [ - 3, - 5, - 6, // 2015 - 7, // 2016 - 8, // 2017 - 9, // 2018 - 10, // 2019 - 11, // 2020 - 12, // 2021 - 13, // 2022 - 14, // 2023 - 15 // 2024 -]; - -/** - * Get the latest ECMAScript version supported by Espree. - * @returns {number} The latest ECMAScript version. - */ -function getLatestEcmaVersion() { - return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; -} - -/** - * Get the list of ECMAScript versions supported by Espree. - * @returns {number[]} An array containing the supported ECMAScript versions. - */ -function getSupportedEcmaVersions() { - return [...SUPPORTED_VERSIONS]; -} - -/** - * Normalize ECMAScript version from the initial config - * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config - * @throws {Error} throws an error if the ecmaVersion is invalid. - * @returns {number} normalized ECMAScript version - */ -function normalizeEcmaVersion(ecmaVersion = 5) { - - let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion; - - if (typeof version !== "number") { - throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`); - } - - // Calculate ECMAScript edition number from official year version starting with - // ES2015, which corresponds with ES6 (or a difference of 2009). - if (version >= 2015) { - version -= 2009; - } - - if (!SUPPORTED_VERSIONS.includes(version)) { - throw new Error("Invalid ecmaVersion."); - } - - return version; -} - -/** - * Normalize sourceType from the initial config - * @param {string} sourceType to normalize - * @throws {Error} throw an error if sourceType is invalid - * @returns {string} normalized sourceType - */ -function normalizeSourceType(sourceType = "script") { - if (sourceType === "script" || sourceType === "module") { - return sourceType; - } - - if (sourceType === "commonjs") { - return "script"; - } - - throw new Error("Invalid sourceType."); -} - -/** - * Normalize parserOptions - * @param {Object} options the parser options to normalize - * @throws {Error} throw an error if found invalid option. - * @returns {Object} normalized options - */ -function normalizeOptions(options) { - const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); - const sourceType = normalizeSourceType(options.sourceType); - const ranges = options.range === true; - const locations = options.loc === true; - - if (ecmaVersion !== 3 && options.allowReserved) { - - // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed - throw new Error("`allowReserved` is only supported when ecmaVersion is 3"); - } - if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") { - throw new Error("`allowReserved`, when present, must be `true` or `false`"); - } - const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false; - const ecmaFeatures = options.ecmaFeatures || {}; - const allowReturnOutsideFunction = options.sourceType === "commonjs" || - Boolean(ecmaFeatures.globalReturn); - - if (sourceType === "module" && ecmaVersion < 6) { - throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); - } - - return Object.assign({}, options, { - ecmaVersion, - sourceType, - ranges, - locations, - allowReserved, - allowReturnOutsideFunction - }); -} - -/* eslint no-param-reassign: 0 -- stylistic choice */ - - -const STATE = Symbol("espree's internal state"); -const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); - - -/** - * Converts an Acorn comment to a Esprima comment. - * @param {boolean} block True if it's a block comment, false if not. - * @param {string} text The text of the comment. - * @param {int} start The index at which the comment starts. - * @param {int} end The index at which the comment ends. - * @param {Location} startLoc The location at which the comment starts. - * @param {Location} endLoc The location at which the comment ends. - * @param {string} code The source code being parsed. - * @returns {Object} The comment object. - * @private - */ -function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) { - let type; - - if (block) { - type = "Block"; - } else if (code.slice(start, start + 2) === "#!") { - type = "Hashbang"; - } else { - type = "Line"; - } - - const comment = { - type, - value: text - }; - - if (typeof start === "number") { - comment.start = start; - comment.end = end; - comment.range = [start, end]; - } - - if (typeof startLoc === "object") { - comment.loc = { - start: startLoc, - end: endLoc - }; - } - - return comment; -} - -var espree = () => Parser => { - const tokTypes = Object.assign({}, Parser.acorn.tokTypes); - - if (Parser.acornJsx) { - Object.assign(tokTypes, Parser.acornJsx.tokTypes); - } - - return class Espree extends Parser { - constructor(opts, code) { - if (typeof opts !== "object" || opts === null) { - opts = {}; - } - if (typeof code !== "string" && !(code instanceof String)) { - code = String(code); - } - - // save original source type in case of commonjs - const originalSourceType = opts.sourceType; - const options = normalizeOptions(opts); - const ecmaFeatures = options.ecmaFeatures || {}; - const tokenTranslator = - options.tokens === true - ? new TokenTranslator(tokTypes, code) - : null; - - /* - * Data that is unique to Espree and is not represented internally - * in Acorn. - * - * For ES2023 hashbangs, Espree will call `onComment()` during the - * constructor, so we must define state before having access to - * `this`. - */ - const state = { - originalSourceType: originalSourceType || options.sourceType, - tokens: tokenTranslator ? [] : null, - comments: options.comment === true ? [] : null, - impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5, - ecmaVersion: options.ecmaVersion, - jsxAttrValueToken: false, - lastToken: null, - templateElements: [] - }; - - // Initialize acorn parser. - super({ - - // do not use spread, because we don't want to pass any unknown options to acorn - ecmaVersion: options.ecmaVersion, - sourceType: options.sourceType, - ranges: options.ranges, - locations: options.locations, - allowReserved: options.allowReserved, - - // Truthy value is true for backward compatibility. - allowReturnOutsideFunction: options.allowReturnOutsideFunction, - - // Collect tokens - onToken(token) { - if (tokenTranslator) { - - // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. - tokenTranslator.onToken(token, state); - } - if (token.type !== tokTypes.eof) { - state.lastToken = token; - } - }, - - // Collect comments - onComment(block, text, start, end, startLoc, endLoc) { - if (state.comments) { - const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code); - - state.comments.push(comment); - } - } - }, code); - - /* - * We put all of this data into a symbol property as a way to avoid - * potential naming conflicts with future versions of Acorn. - */ - this[STATE] = state; - } - - tokenize() { - do { - this.next(); - } while (this.type !== tokTypes.eof); - - // Consume the final eof token - this.next(); - - const extra = this[STATE]; - const tokens = extra.tokens; - - if (extra.comments) { - tokens.comments = extra.comments; - } - - return tokens; - } - - finishNode(...args) { - const result = super.finishNode(...args); - - return this[ESPRIMA_FINISH_NODE](result); - } - - finishNodeAt(...args) { - const result = super.finishNodeAt(...args); - - return this[ESPRIMA_FINISH_NODE](result); - } - - parse() { - const extra = this[STATE]; - const program = super.parse(); - - program.sourceType = extra.originalSourceType; - - if (extra.comments) { - program.comments = extra.comments; - } - if (extra.tokens) { - program.tokens = extra.tokens; - } - - /* - * Adjust opening and closing position of program to match Esprima. - * Acorn always starts programs at range 0 whereas Esprima starts at the - * first AST node's start (the only real difference is when there's leading - * whitespace or leading comments). Acorn also counts trailing whitespace - * as part of the program whereas Esprima only counts up to the last token. - */ - if (program.body.length) { - const [firstNode] = program.body; - - if (program.range) { - program.range[0] = firstNode.range[0]; - } - if (program.loc) { - program.loc.start = firstNode.loc.start; - } - program.start = firstNode.start; - } - if (extra.lastToken) { - if (program.range) { - program.range[1] = extra.lastToken.range[1]; - } - if (program.loc) { - program.loc.end = extra.lastToken.loc.end; - } - program.end = extra.lastToken.end; - } - - - /* - * https://github.com/eslint/espree/issues/349 - * Ensure that template elements have correct range information. - * This is one location where Acorn produces a different value - * for its start and end properties vs. the values present in the - * range property. In order to avoid confusion, we set the start - * and end properties to the values that are present in range. - * This is done here, instead of in finishNode(), because Acorn - * uses the values of start and end internally while parsing, making - * it dangerous to change those values while parsing is ongoing. - * By waiting until the end of parsing, we can safely change these - * values without affect any other part of the process. - */ - this[STATE].templateElements.forEach(templateElement => { - const startOffset = -1; - const endOffset = templateElement.tail ? 1 : 2; - - templateElement.start += startOffset; - templateElement.end += endOffset; - - if (templateElement.range) { - templateElement.range[0] += startOffset; - templateElement.range[1] += endOffset; - } - - if (templateElement.loc) { - templateElement.loc.start.column += startOffset; - templateElement.loc.end.column += endOffset; - } - }); - - return program; - } - - parseTopLevel(node) { - if (this[STATE].impliedStrict) { - this.strict = true; - } - return super.parseTopLevel(node); - } - - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raise(pos, message) { - const loc = Parser.acorn.getLineInfo(this.input, pos); - const err = new SyntaxError(message); - - err.index = pos; - err.lineNumber = loc.line; - err.column = loc.column + 1; // acorn uses 0-based columns - throw err; - } - - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raiseRecoverable(pos, message) { - this.raise(pos, message); - } - - /** - * Overwrites the default unexpected method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - unexpected(pos) { - let message = "Unexpected token"; - - if (pos !== null && pos !== void 0) { - this.pos = pos; - - if (this.options.locations) { - while (this.pos < this.lineStart) { - this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; - --this.curLine; - } - } - - this.nextToken(); - } - - if (this.end > this.start) { - message += ` ${this.input.slice(this.start, this.end)}`; - } - - this.raise(this.start, message); - } - - /* - * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX - * uses regular tt.string without any distinction between this and regular JS - * strings. As such, we intercept an attempt to read a JSX string and set a flag - * on extra so that when tokens are converted, the next token will be switched - * to JSXText via onToken. - */ - jsx_readString(quote) { // eslint-disable-line camelcase -- required by API - const result = super.jsx_readString(quote); - - if (this.type === tokTypes.string) { - this[STATE].jsxAttrValueToken = true; - } - return result; - } - - /** - * Performs last-minute Esprima-specific compatibility checks and fixes. - * @param {ASTNode} result The node to check. - * @returns {ASTNode} The finished node. - */ - [ESPRIMA_FINISH_NODE](result) { - - // Acorn doesn't count the opening and closing backticks as part of templates - // so we have to adjust ranges/locations appropriately. - if (result.type === "TemplateElement") { - - // save template element references to fix start/end later - this[STATE].templateElements.push(result); - } - - if (result.type.includes("Function") && !result.generator) { - result.generator = false; - } - - return result; - } - }; -}; - -const version$1 = "9.6.1"; - -/* eslint-disable jsdoc/no-multi-asterisks -- needed to preserve original formatting of licences */ - - -// To initialize lazily. -const parsers = { - _regular: null, - _jsx: null, - - get regular() { - if (this._regular === null) { - this._regular = acorn__namespace.Parser.extend(espree()); - } - return this._regular; - }, - - get jsx() { - if (this._jsx === null) { - this._jsx = acorn__namespace.Parser.extend(jsx__default["default"](), espree()); - } - return this._jsx; - }, - - get(options) { - const useJsx = Boolean( - options && - options.ecmaFeatures && - options.ecmaFeatures.jsx - ); - - return useJsx ? this.jsx : this.regular; - } -}; - -//------------------------------------------------------------------------------ -// Tokenizer -//------------------------------------------------------------------------------ - -/** - * Tokenizes the given code. - * @param {string} code The code to tokenize. - * @param {Object} options Options defining how to tokenize. - * @returns {Token[]} An array of tokens. - * @throws {SyntaxError} If the input code is invalid. - * @private - */ -function tokenize(code, options) { - const Parser = parsers.get(options); - - // Ensure to collect tokens. - if (!options || options.tokens !== true) { - options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice - } - - return new Parser(options, code).tokenize(); -} - -//------------------------------------------------------------------------------ -// Parser -//------------------------------------------------------------------------------ - -/** - * Parses the given code. - * @param {string} code The code to tokenize. - * @param {Object} options Options defining how to tokenize. - * @returns {ASTNode} The "Program" AST node. - * @throws {SyntaxError} If the input code is invalid. - */ -function parse(code, options) { - const Parser = parsers.get(options); - - return new Parser(options, code).parse(); -} - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -const version = version$1; -const name = "espree"; - -/* istanbul ignore next */ -const VisitorKeys = (function() { - return visitorKeys__namespace.KEYS; -}()); - -// Derive node types from VisitorKeys -/* istanbul ignore next */ -const Syntax = (function() { - let key, - types = {}; - - if (typeof Object.create === "function") { - types = Object.create(null); - } - - for (key in VisitorKeys) { - if (Object.hasOwnProperty.call(VisitorKeys, key)) { - types[key] = key; - } - } - - if (typeof Object.freeze === "function") { - Object.freeze(types); - } - - return types; -}()); - -const latestEcmaVersion = getLatestEcmaVersion(); - -const supportedEcmaVersions = getSupportedEcmaVersions(); - -exports.Syntax = Syntax; -exports.VisitorKeys = VisitorKeys; -exports.latestEcmaVersion = latestEcmaVersion; -exports.name = name; -exports.parse = parse; -exports.supportedEcmaVersions = supportedEcmaVersions; -exports.tokenize = tokenize; -exports.version = version; - - -/***/ }), - -/***/ "./node_modules/lodash/fp.js": -/*!***********************************!*\ - !*** ./node_modules/lodash/fp.js ***! - \***********************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var _ = (__webpack_require__(/*! ./lodash.min */ "./node_modules/lodash/lodash.min.js").runInContext)(); -module.exports = __webpack_require__(/*! ./fp/_baseConvert */ "./node_modules/lodash/fp/_baseConvert.js")(_, _); - - -/***/ }), - -/***/ "./node_modules/lodash/fp/_baseConvert.js": -/*!************************************************!*\ - !*** ./node_modules/lodash/fp/_baseConvert.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var mapping = __webpack_require__(/*! ./_mapping */ "./node_modules/lodash/fp/_mapping.js"), - fallbackHolder = __webpack_require__(/*! ./placeholder */ "./node_modules/lodash/fp/placeholder.js"); - -/** Built-in value reference. */ -var push = Array.prototype.push; - -/** - * Creates a function, with an arity of `n`, that invokes `func` with the - * arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} n The arity of the new function. - * @returns {Function} Returns the new function. - */ -function baseArity(func, n) { - return n == 2 - ? function(a, b) { return func.apply(undefined, arguments); } - : function(a) { return func.apply(undefined, arguments); }; -} - -/** - * Creates a function that invokes `func`, with up to `n` arguments, ignoring - * any additional arguments. - * - * @private - * @param {Function} func The function to cap arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ -function baseAry(func, n) { - return n == 2 - ? function(a, b) { return func(a, b); } - : function(a) { return func(a); }; -} - -/** - * Creates a clone of `array`. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the cloned array. - */ -function cloneArray(array) { - var length = array ? array.length : 0, - result = Array(length); - - while (length--) { - result[length] = array[length]; - } - return result; -} - -/** - * Creates a function that clones a given object using the assignment `func`. - * - * @private - * @param {Function} func The assignment function. - * @returns {Function} Returns the new cloner function. - */ -function createCloner(func) { - return function(object) { - return func({}, object); - }; -} - -/** - * A specialized version of `_.spread` which flattens the spread array into - * the arguments of the invoked `func`. - * - * @private - * @param {Function} func The function to spread arguments over. - * @param {number} start The start position of the spread. - * @returns {Function} Returns the new function. - */ -function flatSpread(func, start) { - return function() { - var length = arguments.length, - lastIndex = length - 1, - args = Array(length); - - while (length--) { - args[length] = arguments[length]; - } - var array = args[start], - otherArgs = args.slice(0, start); - - if (array) { - push.apply(otherArgs, array); - } - if (start != lastIndex) { - push.apply(otherArgs, args.slice(start + 1)); - } - return func.apply(this, otherArgs); - }; -} - -/** - * Creates a function that wraps `func` and uses `cloner` to clone the first - * argument it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} cloner The function to clone arguments. - * @returns {Function} Returns the new immutable function. - */ -function wrapImmutable(func, cloner) { - return function() { - var length = arguments.length; - if (!length) { - return; - } - var args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - var result = args[0] = cloner.apply(undefined, args); - func.apply(undefined, args); - return result; - }; -} - -/** - * The base implementation of `convert` which accepts a `util` object of methods - * required to perform conversions. - * - * @param {Object} util The util object. - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @param {Object} [options] The options object. - * @param {boolean} [options.cap=true] Specify capping iteratee arguments. - * @param {boolean} [options.curry=true] Specify currying. - * @param {boolean} [options.fixed=true] Specify fixed arity. - * @param {boolean} [options.immutable=true] Specify immutable operations. - * @param {boolean} [options.rearg=true] Specify rearranging arguments. - * @returns {Function|Object} Returns the converted function or object. - */ -function baseConvert(util, name, func, options) { - var isLib = typeof name == 'function', - isObj = name === Object(name); - - if (isObj) { - options = func; - func = name; - name = undefined; - } - if (func == null) { - throw new TypeError; - } - options || (options = {}); - - var config = { - 'cap': 'cap' in options ? options.cap : true, - 'curry': 'curry' in options ? options.curry : true, - 'fixed': 'fixed' in options ? options.fixed : true, - 'immutable': 'immutable' in options ? options.immutable : true, - 'rearg': 'rearg' in options ? options.rearg : true - }; - - var defaultHolder = isLib ? func : fallbackHolder, - forceCurry = ('curry' in options) && options.curry, - forceFixed = ('fixed' in options) && options.fixed, - forceRearg = ('rearg' in options) && options.rearg, - pristine = isLib ? func.runInContext() : undefined; - - var helpers = isLib ? func : { - 'ary': util.ary, - 'assign': util.assign, - 'clone': util.clone, - 'curry': util.curry, - 'forEach': util.forEach, - 'isArray': util.isArray, - 'isError': util.isError, - 'isFunction': util.isFunction, - 'isWeakMap': util.isWeakMap, - 'iteratee': util.iteratee, - 'keys': util.keys, - 'rearg': util.rearg, - 'toInteger': util.toInteger, - 'toPath': util.toPath - }; - - var ary = helpers.ary, - assign = helpers.assign, - clone = helpers.clone, - curry = helpers.curry, - each = helpers.forEach, - isArray = helpers.isArray, - isError = helpers.isError, - isFunction = helpers.isFunction, - isWeakMap = helpers.isWeakMap, - keys = helpers.keys, - rearg = helpers.rearg, - toInteger = helpers.toInteger, - toPath = helpers.toPath; - - var aryMethodKeys = keys(mapping.aryMethod); - - var wrappers = { - 'castArray': function(castArray) { - return function() { - var value = arguments[0]; - return isArray(value) - ? castArray(cloneArray(value)) - : castArray.apply(undefined, arguments); - }; - }, - 'iteratee': function(iteratee) { - return function() { - var func = arguments[0], - arity = arguments[1], - result = iteratee(func, arity), - length = result.length; - - if (config.cap && typeof arity == 'number') { - arity = arity > 2 ? (arity - 2) : 1; - return (length && length <= arity) ? result : baseAry(result, arity); - } - return result; - }; - }, - 'mixin': function(mixin) { - return function(source) { - var func = this; - if (!isFunction(func)) { - return mixin(func, Object(source)); - } - var pairs = []; - each(keys(source), function(key) { - if (isFunction(source[key])) { - pairs.push([key, func.prototype[key]]); - } - }); - - mixin(func, Object(source)); - - each(pairs, function(pair) { - var value = pair[1]; - if (isFunction(value)) { - func.prototype[pair[0]] = value; - } else { - delete func.prototype[pair[0]]; - } - }); - return func; - }; - }, - 'nthArg': function(nthArg) { - return function(n) { - var arity = n < 0 ? 1 : (toInteger(n) + 1); - return curry(nthArg(n), arity); - }; - }, - 'rearg': function(rearg) { - return function(func, indexes) { - var arity = indexes ? indexes.length : 0; - return curry(rearg(func, indexes), arity); - }; - }, - 'runInContext': function(runInContext) { - return function(context) { - return baseConvert(util, runInContext(context), options); - }; - } - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Casts `func` to a function with an arity capped iteratee if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @returns {Function} Returns the cast function. - */ - function castCap(name, func) { - if (config.cap) { - var indexes = mapping.iterateeRearg[name]; - if (indexes) { - return iterateeRearg(func, indexes); - } - var n = !isLib && mapping.iterateeAry[name]; - if (n) { - return iterateeAry(func, n); - } - } - return func; - } - - /** - * Casts `func` to a curried function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castCurry(name, func, n) { - return (forceCurry || (config.curry && n > 1)) - ? curry(func, n) - : func; - } - - /** - * Casts `func` to a fixed arity function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity cap. - * @returns {Function} Returns the cast function. - */ - function castFixed(name, func, n) { - if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { - var data = mapping.methodSpread[name], - start = data && data.start; - - return start === undefined ? ary(func, n) : flatSpread(func, start); - } - return func; - } - - /** - * Casts `func` to an rearged function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castRearg(name, func, n) { - return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) - ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) - : func; - } - - /** - * Creates a clone of `object` by `path`. - * - * @private - * @param {Object} object The object to clone. - * @param {Array|string} path The path to clone by. - * @returns {Object} Returns the cloned object. - */ - function cloneByPath(object, path) { - path = toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - result = clone(Object(object)), - nested = result; - - while (nested != null && ++index < length) { - var key = path[index], - value = nested[key]; - - if (value != null && - !(isFunction(value) || isError(value) || isWeakMap(value))) { - nested[key] = clone(index == lastIndex ? value : Object(value)); - } - nested = nested[key]; - } - return result; - } - - /** - * Converts `lodash` to an immutable auto-curried iteratee-first data-last - * version with conversion `options` applied. - * - * @param {Object} [options] The options object. See `baseConvert` for more details. - * @returns {Function} Returns the converted `lodash`. - */ - function convertLib(options) { - return _.runInContext.convert(options)(undefined); - } - - /** - * Create a converter function for `func` of `name`. - * - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @returns {Function} Returns the new converter function. - */ - function createConverter(name, func) { - var realName = mapping.aliasToReal[name] || name, - methodName = mapping.remap[realName] || realName, - oldOptions = options; - - return function(options) { - var newUtil = isLib ? pristine : helpers, - newFunc = isLib ? pristine[methodName] : func, - newOptions = assign(assign({}, oldOptions), options); - - return baseConvert(newUtil, realName, newFunc, newOptions); - }; - } - - /** - * Creates a function that wraps `func` to invoke its iteratee, with up to `n` - * arguments, ignoring any additional arguments. - * - * @private - * @param {Function} func The function to cap iteratee arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ - function iterateeAry(func, n) { - return overArg(func, function(func) { - return typeof func == 'function' ? baseAry(func, n) : func; - }); - } - - /** - * Creates a function that wraps `func` to invoke its iteratee with arguments - * arranged according to the specified `indexes` where the argument value at - * the first index is provided as the first argument, the argument value at - * the second index is provided as the second argument, and so on. - * - * @private - * @param {Function} func The function to rearrange iteratee arguments for. - * @param {number[]} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - */ - function iterateeRearg(func, indexes) { - return overArg(func, function(func) { - var n = indexes.length; - return baseArity(rearg(baseAry(func, n), indexes), n); - }); - } - - /** - * Creates a function that invokes `func` with its first argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function() { - var length = arguments.length; - if (!length) { - return func(); - } - var args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - var index = config.rearg ? 0 : (length - 1); - args[index] = transform(args[index]); - return func.apply(undefined, args); - }; - } - - /** - * Creates a function that wraps `func` and applys the conversions - * rules by `name`. - * - * @private - * @param {string} name The name of the function to wrap. - * @param {Function} func The function to wrap. - * @returns {Function} Returns the converted function. - */ - function wrap(name, func, placeholder) { - var result, - realName = mapping.aliasToReal[name] || name, - wrapped = func, - wrapper = wrappers[realName]; - - if (wrapper) { - wrapped = wrapper(func); - } - else if (config.immutable) { - if (mapping.mutate.array[realName]) { - wrapped = wrapImmutable(func, cloneArray); - } - else if (mapping.mutate.object[realName]) { - wrapped = wrapImmutable(func, createCloner(func)); - } - else if (mapping.mutate.set[realName]) { - wrapped = wrapImmutable(func, cloneByPath); - } - } - each(aryMethodKeys, function(aryKey) { - each(mapping.aryMethod[aryKey], function(otherName) { - if (realName == otherName) { - var data = mapping.methodSpread[realName], - afterRearg = data && data.afterRearg; - - result = afterRearg - ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) - : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); - - result = castCap(realName, result); - result = castCurry(realName, result, aryKey); - return false; - } - }); - return !result; - }); - - result || (result = wrapped); - if (result == func) { - result = forceCurry ? curry(result, 1) : function() { - return func.apply(this, arguments); - }; - } - result.convert = createConverter(realName, func); - result.placeholder = func.placeholder = placeholder; - - return result; - } - - /*--------------------------------------------------------------------------*/ - - if (!isObj) { - return wrap(name, func, defaultHolder); - } - var _ = func; - - // Convert methods by ary cap. - var pairs = []; - each(aryMethodKeys, function(aryKey) { - each(mapping.aryMethod[aryKey], function(key) { - var func = _[mapping.remap[key] || key]; - if (func) { - pairs.push([key, wrap(key, func, _)]); - } - }); - }); - - // Convert remaining methods. - each(keys(_), function(key) { - var func = _[key]; - if (typeof func == 'function') { - var length = pairs.length; - while (length--) { - if (pairs[length][0] == key) { - return; - } - } - func.convert = createConverter(key, func); - pairs.push([key, func]); - } - }); - - // Assign to `_` leaving `_.prototype` unchanged to allow chaining. - each(pairs, function(pair) { - _[pair[0]] = pair[1]; - }); - - _.convert = convertLib; - _.placeholder = _; - - // Assign aliases. - each(keys(_), function(key) { - each(mapping.realToAlias[key] || [], function(alias) { - _[alias] = _[key]; - }); - }); - - return _; -} - -module.exports = baseConvert; - - -/***/ }), - -/***/ "./node_modules/lodash/fp/_mapping.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/fp/_mapping.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/** Used to map aliases to their real names. */ -exports.aliasToReal = { - - // Lodash aliases. - 'each': 'forEach', - 'eachRight': 'forEachRight', - 'entries': 'toPairs', - 'entriesIn': 'toPairsIn', - 'extend': 'assignIn', - 'extendAll': 'assignInAll', - 'extendAllWith': 'assignInAllWith', - 'extendWith': 'assignInWith', - 'first': 'head', - - // Methods that are curried variants of others. - 'conforms': 'conformsTo', - 'matches': 'isMatch', - 'property': 'get', - - // Ramda aliases. - '__': 'placeholder', - 'F': 'stubFalse', - 'T': 'stubTrue', - 'all': 'every', - 'allPass': 'overEvery', - 'always': 'constant', - 'any': 'some', - 'anyPass': 'overSome', - 'apply': 'spread', - 'assoc': 'set', - 'assocPath': 'set', - 'complement': 'negate', - 'compose': 'flowRight', - 'contains': 'includes', - 'dissoc': 'unset', - 'dissocPath': 'unset', - 'dropLast': 'dropRight', - 'dropLastWhile': 'dropRightWhile', - 'equals': 'isEqual', - 'identical': 'eq', - 'indexBy': 'keyBy', - 'init': 'initial', - 'invertObj': 'invert', - 'juxt': 'over', - 'omitAll': 'omit', - 'nAry': 'ary', - 'path': 'get', - 'pathEq': 'matchesProperty', - 'pathOr': 'getOr', - 'paths': 'at', - 'pickAll': 'pick', - 'pipe': 'flow', - 'pluck': 'map', - 'prop': 'get', - 'propEq': 'matchesProperty', - 'propOr': 'getOr', - 'props': 'at', - 'symmetricDifference': 'xor', - 'symmetricDifferenceBy': 'xorBy', - 'symmetricDifferenceWith': 'xorWith', - 'takeLast': 'takeRight', - 'takeLastWhile': 'takeRightWhile', - 'unapply': 'rest', - 'unnest': 'flatten', - 'useWith': 'overArgs', - 'where': 'conformsTo', - 'whereEq': 'isMatch', - 'zipObj': 'zipObject' -}; - -/** Used to map ary to method names. */ -exports.aryMethod = { - '1': [ - 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', - 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', - 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', - 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', - 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', - 'uniqueId', 'words', 'zipAll' - ], - '2': [ - 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', - 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', - 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', - 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', - 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', - 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', - 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', - 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', - 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', - 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', - 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', - 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', - 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', - 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', - 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', - 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', - 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', - 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', - 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', - 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', - 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', - 'zipObjectDeep' - ], - '3': [ - 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', - 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', - 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', - 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', - 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', - 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', - 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', - 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', - 'xorWith', 'zipWith' - ], - '4': [ - 'fill', 'setWith', 'updateWith' - ] -}; - -/** Used to map ary to rearg configs. */ -exports.aryRearg = { - '2': [1, 0], - '3': [2, 0, 1], - '4': [3, 2, 0, 1] -}; - -/** Used to map method names to their iteratee ary. */ -exports.iterateeAry = { - 'dropRightWhile': 1, - 'dropWhile': 1, - 'every': 1, - 'filter': 1, - 'find': 1, - 'findFrom': 1, - 'findIndex': 1, - 'findIndexFrom': 1, - 'findKey': 1, - 'findLast': 1, - 'findLastFrom': 1, - 'findLastIndex': 1, - 'findLastIndexFrom': 1, - 'findLastKey': 1, - 'flatMap': 1, - 'flatMapDeep': 1, - 'flatMapDepth': 1, - 'forEach': 1, - 'forEachRight': 1, - 'forIn': 1, - 'forInRight': 1, - 'forOwn': 1, - 'forOwnRight': 1, - 'map': 1, - 'mapKeys': 1, - 'mapValues': 1, - 'partition': 1, - 'reduce': 2, - 'reduceRight': 2, - 'reject': 1, - 'remove': 1, - 'some': 1, - 'takeRightWhile': 1, - 'takeWhile': 1, - 'times': 1, - 'transform': 2 -}; - -/** Used to map method names to iteratee rearg configs. */ -exports.iterateeRearg = { - 'mapKeys': [1], - 'reduceRight': [1, 0] -}; - -/** Used to map method names to rearg configs. */ -exports.methodRearg = { - 'assignInAllWith': [1, 0], - 'assignInWith': [1, 2, 0], - 'assignAllWith': [1, 0], - 'assignWith': [1, 2, 0], - 'differenceBy': [1, 2, 0], - 'differenceWith': [1, 2, 0], - 'getOr': [2, 1, 0], - 'intersectionBy': [1, 2, 0], - 'intersectionWith': [1, 2, 0], - 'isEqualWith': [1, 2, 0], - 'isMatchWith': [2, 1, 0], - 'mergeAllWith': [1, 0], - 'mergeWith': [1, 2, 0], - 'padChars': [2, 1, 0], - 'padCharsEnd': [2, 1, 0], - 'padCharsStart': [2, 1, 0], - 'pullAllBy': [2, 1, 0], - 'pullAllWith': [2, 1, 0], - 'rangeStep': [1, 2, 0], - 'rangeStepRight': [1, 2, 0], - 'setWith': [3, 1, 2, 0], - 'sortedIndexBy': [2, 1, 0], - 'sortedLastIndexBy': [2, 1, 0], - 'unionBy': [1, 2, 0], - 'unionWith': [1, 2, 0], - 'updateWith': [3, 1, 2, 0], - 'xorBy': [1, 2, 0], - 'xorWith': [1, 2, 0], - 'zipWith': [1, 2, 0] -}; - -/** Used to map method names to spread configs. */ -exports.methodSpread = { - 'assignAll': { 'start': 0 }, - 'assignAllWith': { 'start': 0 }, - 'assignInAll': { 'start': 0 }, - 'assignInAllWith': { 'start': 0 }, - 'defaultsAll': { 'start': 0 }, - 'defaultsDeepAll': { 'start': 0 }, - 'invokeArgs': { 'start': 2 }, - 'invokeArgsMap': { 'start': 2 }, - 'mergeAll': { 'start': 0 }, - 'mergeAllWith': { 'start': 0 }, - 'partial': { 'start': 1 }, - 'partialRight': { 'start': 1 }, - 'without': { 'start': 1 }, - 'zipAll': { 'start': 0 } -}; - -/** Used to identify methods which mutate arrays or objects. */ -exports.mutate = { - 'array': { - 'fill': true, - 'pull': true, - 'pullAll': true, - 'pullAllBy': true, - 'pullAllWith': true, - 'pullAt': true, - 'remove': true, - 'reverse': true - }, - 'object': { - 'assign': true, - 'assignAll': true, - 'assignAllWith': true, - 'assignIn': true, - 'assignInAll': true, - 'assignInAllWith': true, - 'assignInWith': true, - 'assignWith': true, - 'defaults': true, - 'defaultsAll': true, - 'defaultsDeep': true, - 'defaultsDeepAll': true, - 'merge': true, - 'mergeAll': true, - 'mergeAllWith': true, - 'mergeWith': true, - }, - 'set': { - 'set': true, - 'setWith': true, - 'unset': true, - 'update': true, - 'updateWith': true - } -}; - -/** Used to map real names to their aliases. */ -exports.realToAlias = (function() { - var hasOwnProperty = Object.prototype.hasOwnProperty, - object = exports.aliasToReal, - result = {}; - - for (var key in object) { - var value = object[key]; - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - return result; -}()); - -/** Used to map method names to other names. */ -exports.remap = { - 'assignAll': 'assign', - 'assignAllWith': 'assignWith', - 'assignInAll': 'assignIn', - 'assignInAllWith': 'assignInWith', - 'curryN': 'curry', - 'curryRightN': 'curryRight', - 'defaultsAll': 'defaults', - 'defaultsDeepAll': 'defaultsDeep', - 'findFrom': 'find', - 'findIndexFrom': 'findIndex', - 'findLastFrom': 'findLast', - 'findLastIndexFrom': 'findLastIndex', - 'getOr': 'get', - 'includesFrom': 'includes', - 'indexOfFrom': 'indexOf', - 'invokeArgs': 'invoke', - 'invokeArgsMap': 'invokeMap', - 'lastIndexOfFrom': 'lastIndexOf', - 'mergeAll': 'merge', - 'mergeAllWith': 'mergeWith', - 'padChars': 'pad', - 'padCharsEnd': 'padEnd', - 'padCharsStart': 'padStart', - 'propertyOf': 'get', - 'rangeStep': 'range', - 'rangeStepRight': 'rangeRight', - 'restFrom': 'rest', - 'spreadFrom': 'spread', - 'trimChars': 'trim', - 'trimCharsEnd': 'trimEnd', - 'trimCharsStart': 'trimStart', - 'zipAll': 'zip' -}; - -/** Used to track methods that skip fixing their arity. */ -exports.skipFixed = { - 'castArray': true, - 'flow': true, - 'flowRight': true, - 'iteratee': true, - 'mixin': true, - 'rearg': true, - 'runInContext': true -}; - -/** Used to track methods that skip rearranging arguments. */ -exports.skipRearg = { - 'add': true, - 'assign': true, - 'assignIn': true, - 'bind': true, - 'bindKey': true, - 'concat': true, - 'difference': true, - 'divide': true, - 'eq': true, - 'gt': true, - 'gte': true, - 'isEqual': true, - 'lt': true, - 'lte': true, - 'matchesProperty': true, - 'merge': true, - 'multiply': true, - 'overArgs': true, - 'partial': true, - 'partialRight': true, - 'propertyOf': true, - 'random': true, - 'range': true, - 'rangeRight': true, - 'subtract': true, - 'zip': true, - 'zipObject': true, - 'zipObjectDeep': true -}; - - -/***/ }), - -/***/ "./node_modules/lodash/fp/placeholder.js": -/*!***********************************************!*\ - !*** ./node_modules/lodash/fp/placeholder.js ***! - \***********************************************/ -/***/ ((module) => { - -/** - * The default argument placeholder value for methods. - * - * @type {Object} - */ -module.exports = {}; - - -/***/ }), - -/***/ "./node_modules/lodash/lodash.min.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/lodash.min.js ***! - \*******************************************/ -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_RESULT__;/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e-1;);return r}function L(n,t){for(var r=n.length;r--&&y(t,n[r],0)>-1;);return r}function C(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e; -return e}function U(n){return"\\"+Yr[n]}function B(n,t){return null==n?X:n[t]}function T(n){return Nr.test(n)}function $(n){return Pr.test(n)}function D(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function M(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function F(n,t){return function(r){return n(t(r))}}function N(n,t){for(var r=-1,e=n.length,u=0,i=[];++r>>1,$n=[["ary",mn],["bind",_n],["bindKey",vn],["curry",yn],["curryRight",dn],["flip",jn],["partial",bn],["partialRight",wn],["rearg",xn]],Dn="[object Arguments]",Mn="[object Array]",Fn="[object AsyncFunction]",Nn="[object Boolean]",Pn="[object Date]",qn="[object DOMException]",Zn="[object Error]",Kn="[object Function]",Vn="[object GeneratorFunction]",Gn="[object Map]",Hn="[object Number]",Jn="[object Null]",Yn="[object Object]",Qn="[object Promise]",Xn="[object Proxy]",nt="[object RegExp]",tt="[object Set]",rt="[object String]",et="[object Symbol]",ut="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",ft="[object ArrayBuffer]",ct="[object DataView]",at="[object Float32Array]",lt="[object Float64Array]",st="[object Int8Array]",ht="[object Int16Array]",pt="[object Int32Array]",_t="[object Uint8Array]",vt="[object Uint8ClampedArray]",gt="[object Uint16Array]",yt="[object Uint32Array]",dt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,jt=RegExp(mt.source),At=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Ot=/<%([\s\S]+?)%>/g,It=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zt=/^\w*$/,Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/[\\^$.*+?()[\]{}|]/g,Wt=RegExp(St.source),Lt=/^\s+/,Ct=/\s/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Tt=/,? & /,$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dt=/[()=,{}\[\]\/\s]/,Mt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Pt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Zt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Vt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ht=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Yt="\\ud800-\\udfff",Qt="\\u0300-\\u036f",Xt="\\ufe20-\\ufe2f",nr="\\u20d0-\\u20ff",tr=Qt+Xt+nr,rr="\\u2700-\\u27bf",er="a-z\\xdf-\\xf6\\xf8-\\xff",ur="\\xac\\xb1\\xd7\\xf7",ir="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",or="\\u2000-\\u206f",fr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",ar="\\ufe0e\\ufe0f",lr=ur+ir+or+fr,sr="['\u2019]",hr="["+Yt+"]",pr="["+lr+"]",_r="["+tr+"]",vr="\\d+",gr="["+rr+"]",yr="["+er+"]",dr="[^"+Yt+lr+vr+rr+er+cr+"]",br="\\ud83c[\\udffb-\\udfff]",wr="(?:"+_r+"|"+br+")",mr="[^"+Yt+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",jr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ar="["+cr+"]",kr="\\u200d",Or="(?:"+yr+"|"+dr+")",Ir="(?:"+Ar+"|"+dr+")",Rr="(?:"+sr+"(?:d|ll|m|re|s|t|ve))?",zr="(?:"+sr+"(?:D|LL|M|RE|S|T|VE))?",Er=wr+"?",Sr="["+ar+"]?",Wr="(?:"+kr+"(?:"+[mr,xr,jr].join("|")+")"+Sr+Er+")*",Lr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ur=Sr+Er+Wr,Br="(?:"+[gr,xr,jr].join("|")+")"+Ur,Tr="(?:"+[mr+_r+"?",_r,xr,jr,hr].join("|")+")",$r=RegExp(sr,"g"),Dr=RegExp(_r,"g"),Mr=RegExp(br+"(?="+br+")|"+Tr+Ur,"g"),Fr=RegExp([Ar+"?"+yr+"+"+Rr+"(?="+[pr,Ar,"$"].join("|")+")",Ir+"+"+zr+"(?="+[pr,Ar+Or,"$"].join("|")+")",Ar+"?"+Or+"+"+Rr,Ar+"+"+zr,Cr,Lr,vr,Br].join("|"),"g"),Nr=RegExp("["+kr+Yt+tr+ar+"]"),Pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zr=-1,Kr={}; -Kr[at]=Kr[lt]=Kr[st]=Kr[ht]=Kr[pt]=Kr[_t]=Kr[vt]=Kr[gt]=Kr[yt]=!0,Kr[Dn]=Kr[Mn]=Kr[ft]=Kr[Nn]=Kr[ct]=Kr[Pn]=Kr[Zn]=Kr[Kn]=Kr[Gn]=Kr[Hn]=Kr[Yn]=Kr[nt]=Kr[tt]=Kr[rt]=Kr[it]=!1;var Vr={};Vr[Dn]=Vr[Mn]=Vr[ft]=Vr[ct]=Vr[Nn]=Vr[Pn]=Vr[at]=Vr[lt]=Vr[st]=Vr[ht]=Vr[pt]=Vr[Gn]=Vr[Hn]=Vr[Yn]=Vr[nt]=Vr[tt]=Vr[rt]=Vr[et]=Vr[_t]=Vr[vt]=Vr[gt]=Vr[yt]=!0,Vr[Zn]=Vr[Kn]=Vr[it]=!1;var Gr={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a", -"\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae", -"\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g", -"\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O", -"\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w", -"\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Hr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qr=parseFloat,Xr=parseInt,ne="object"==typeof __webpack_require__.g&&__webpack_require__.g&&__webpack_require__.g.Object===Object&&__webpack_require__.g,te="object"==typeof self&&self&&self.Object===Object&&self,re=ne||te||Function("return this")(),ee= true&&exports&&!exports.nodeType&&exports,ue=ee&&"object"=="object"&&module&&!module.nodeType&&module,ie=ue&&ue.exports===ee,oe=ie&&ne.process,fe=function(){ -try{var n=ue&&ue.require&&ue.require("util").types;return n?n:oe&&oe.binding&&oe.binding("util")}catch(n){}}(),ce=fe&&fe.isArrayBuffer,ae=fe&&fe.isDate,le=fe&&fe.isMap,se=fe&&fe.isRegExp,he=fe&&fe.isSet,pe=fe&&fe.isTypedArray,_e=m("length"),ve=x(Gr),ge=x(Hr),ye=x(Jr),de=function p(x){function Z(n){if(cc(n)&&!bh(n)&&!(n instanceof Ct)){if(n instanceof Y)return n;if(bl.call(n,"__wrapped__"))return eo(n)}return new Y(n)}function J(){}function Y(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t, -this.__index__=0,this.__values__=X}function Ct(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Un,this.__views__=[]}function $t(){var n=new Ct(this.__wrapped__);return n.__actions__=Tu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Tu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Tu(this.__views__),n}function Yt(){if(this.__filtered__){var n=new Ct(this);n.__dir__=-1, -n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Qt(){var n=this.__wrapped__.value(),t=this.__dir__,r=bh(n),e=t<0,u=r?n.length:0,i=Oi(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Hl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return wu(n,this.__actions__);var _=[];n:for(;c--&&h-1}function lr(n,t){var r=this.__data__,e=Wr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function sr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function Fr(n,t,e,u,i,o){var f,c=t&an,a=t&ln,l=t&sn;if(e&&(f=i?e(n,u,i,o):e(n)),f!==X)return f;if(!fc(n))return n;var s=bh(n);if(s){if(f=zi(n),!c)return Tu(n,f)}else{var h=zs(n),p=h==Kn||h==Vn;if(mh(n))return Iu(n,c);if(h==Yn||h==Dn||p&&!i){if(f=a||p?{}:Ei(n),!c)return a?Mu(n,Ur(f,n)):Du(n,Cr(f,n))}else{if(!Vr[h])return i?n:{};f=Si(n,h,c)}}o||(o=new wr);var _=o.get(n);if(_)return _;o.set(n,f),kh(n)?n.forEach(function(r){f.add(Fr(r,t,e,r,n,o))}):jh(n)&&n.forEach(function(r,u){ -f.set(u,Fr(r,t,e,u,n,o))});var v=l?a?di:yi:a?qc:Pc,g=s?X:v(n);return r(g||n,function(r,u){g&&(u=r,r=n[u]),Sr(f,u,Fr(r,t,e,u,n,o))}),f}function Nr(n){var t=Pc(n);return function(r){return Pr(r,n,t)}}function Pr(n,t,r){var e=r.length;if(null==n)return!e;for(n=ll(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===X&&!(u in n)||!i(o))return!1}return!0}function Gr(n,t,r){if("function"!=typeof n)throw new pl(en);return Ws(function(){n.apply(X,r)},t)}function Hr(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length; -if(!l)return s;r&&(t=c(t,z(r))),e?(i=f,a=!1):t.length>=tn&&(i=S,a=!1,t=new yr(t));n:for(;++uu?0:u+r), -e=e===X||e>u?u:kc(e),e<0&&(e+=u),e=r>e?0:Oc(e);r0&&r(f)?t>1?ee(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ue(n,t){return n&&bs(n,t,Pc)}function oe(n,t){return n&&ws(n,t,Pc)}function fe(n,t){return i(t,function(t){return uc(n[t])})}function _e(n,t){t=ku(t,n);for(var r=0,e=t.length;null!=n&&rt}function xe(n,t){return null!=n&&bl.call(n,t)}function je(n,t){return null!=n&&t in ll(n)}function Ae(n,t,r){return n>=Hl(t,r)&&n=120&&p.length>=120)?new yr(a&&p):X}p=n[0]; -var _=-1,v=l[0];n:for(;++_-1;)f!==n&&Ll.call(f,a,1),Ll.call(n,a,1);return n}function nu(n,t){for(var r=n?t.length:0,e=r-1;r--;){ -var u=t[r];if(r==e||u!==i){var i=u;Ci(u)?Ll.call(n,u,1):yu(n,u)}}return n}function tu(n,t){return n+Nl(Ql()*(t-n+1))}function ru(n,t,r,e){for(var u=-1,i=Gl(Fl((t-n)/(r||1)),0),o=il(i);i--;)o[e?i:++u]=n,n+=r;return o}function eu(n,t){var r="";if(!n||t<1||t>Wn)return r;do t%2&&(r+=n),t=Nl(t/2),t&&(n+=n);while(t);return r}function uu(n,t){return Ls(Vi(n,t,La),n+"")}function iu(n){return Ir(ra(n))}function ou(n,t){var r=ra(n);return Xi(r,Mr(t,0,r.length))}function fu(n,t,r,e){if(!fc(n))return n;t=ku(t,n); -for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++uu?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=il(u);++e>>1,o=n[i];null!==o&&!bc(o)&&(r?o<=t:o=tn){var s=t?null:ks(n);if(s)return P(s);c=!1,u=S,l=new yr}else l=t?[]:a;n:for(;++e=e?n:au(n,t,r)}function Iu(n,t){if(t)return n.slice();var r=n.length,e=zl?zl(r):new n.constructor(r); -return n.copy(e),e}function Ru(n){var t=new n.constructor(n.byteLength);return new Rl(t).set(new Rl(n)),t}function zu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.byteLength)}function Eu(n){var t=new n.constructor(n.source,Nt.exec(n));return t.lastIndex=n.lastIndex,t}function Su(n){return _s?ll(_s.call(n)):{}}function Wu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.length)}function Lu(n,t){if(n!==t){var r=n!==X,e=null===n,u=n===n,i=bc(n),o=t!==X,f=null===t,c=t===t,a=bc(t); -if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n=f)return c;return c*("desc"==r[e]?-1:1)}}return n.index-t.index}function Uu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Gl(i-o,0),l=il(c+a),s=!e;++f1?r[u-1]:X,o=u>2?r[2]:X;for(i=n.length>3&&"function"==typeof i?(u--,i):X,o&&Ui(r[0],r[1],o)&&(i=u<3?X:i,u=1),t=ll(t);++e-1?u[i?t[o]:o]:X}}function Yu(n){return gi(function(t){var r=t.length,e=r,u=Y.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new pl(en);if(u&&!o&&"wrapper"==bi(i))var o=new Y([],!0)}for(e=o?e:r;++e1&&d.reverse(),s&&cf))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=r&pn?new yr:X;for(i.set(n,t),i.set(t,n);++s1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Ut,"{\n/* [wrapped with "+t+"] */\n")}function Li(n){return bh(n)||dh(n)||!!(Cl&&n&&n[Cl])}function Ci(n,t){var r=typeof n; -return t=null==t?Wn:t,!!t&&("number"==r||"symbol"!=r&&Vt.test(n))&&n>-1&&n%1==0&&n0){if(++t>=On)return arguments[0]}else t=0; -return n.apply(X,arguments)}}function Xi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===X?e:t;++r=this.__values__.length;return{done:n,value:n?X:this.__values__[this.__index__++]}}function uf(){return this}function of(n){for(var t,r=this;r instanceof J;){var e=eo(r);e.__index__=0,e.__values__=X,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function ff(){var n=this.__wrapped__;if(n instanceof Ct){var t=n;return this.__actions__.length&&(t=new Ct(this)),t=t.reverse(),t.__actions__.push({func:nf,args:[Eo],thisArg:X}),new Y(t,this.__chain__)}return this.thru(Eo); -}function cf(){return wu(this.__wrapped__,this.__actions__)}function af(n,t,r){var e=bh(n)?u:Jr;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function lf(n,t){return(bh(n)?i:te)(n,mi(t,3))}function sf(n,t){return ee(yf(n,t),1)}function hf(n,t){return ee(yf(n,t),Sn)}function pf(n,t,r){return r=r===X?1:kc(r),ee(yf(n,t),r)}function _f(n,t){return(bh(n)?r:ys)(n,mi(t,3))}function vf(n,t){return(bh(n)?e:ds)(n,mi(t,3))}function gf(n,t,r,e){n=Hf(n)?n:ra(n),r=r&&!e?kc(r):0;var u=n.length;return r<0&&(r=Gl(u+r,0)), -dc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1}function yf(n,t){return(bh(n)?c:Pe)(n,mi(t,3))}function df(n,t,r,e){return null==n?[]:(bh(t)||(t=null==t?[]:[t]),r=e?X:r,bh(r)||(r=null==r?[]:[r]),He(n,t,r))}function bf(n,t,r){var e=bh(n)?l:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ys)}function wf(n,t,r){var e=bh(n)?s:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ds)}function mf(n,t){return(bh(n)?i:te)(n,Uf(mi(t,3)))}function xf(n){return(bh(n)?Ir:iu)(n)}function jf(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t), -(bh(n)?Rr:ou)(n,t)}function Af(n){return(bh(n)?zr:cu)(n)}function kf(n){if(null==n)return 0;if(Hf(n))return dc(n)?V(n):n.length;var t=zs(n);return t==Gn||t==tt?n.size:Me(n).length}function Of(n,t,r){var e=bh(n)?h:lu;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function If(n,t){if("function"!=typeof t)throw new pl(en);return n=kc(n),function(){if(--n<1)return t.apply(this,arguments)}}function Rf(n,t,r){return t=r?X:t,t=n&&null==t?n.length:t,ai(n,mn,X,X,X,X,t)}function zf(n,t){var r;if("function"!=typeof t)throw new pl(en); -return n=kc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=X),r}}function Ef(n,t,r){t=r?X:t;var e=ai(n,yn,X,X,X,X,X,t);return e.placeholder=Ef.placeholder,e}function Sf(n,t,r){t=r?X:t;var e=ai(n,dn,X,X,X,X,X,t);return e.placeholder=Sf.placeholder,e}function Wf(n,t,r){function e(t){var r=h,e=p;return h=p=X,d=t,v=n.apply(e,r)}function u(n){return d=n,g=Ws(f,t),b?e(n):v}function i(n){var r=n-y,e=n-d,u=t-r;return w?Hl(u,_-e):u}function o(n){var r=n-y,e=n-d;return y===X||r>=t||r<0||w&&e>=_; -}function f(){var n=fh();return o(n)?c(n):(g=Ws(f,i(n)),X)}function c(n){return g=X,m&&h?e(n):(h=p=X,v)}function a(){g!==X&&As(g),d=0,h=y=p=g=X}function l(){return g===X?v:c(fh())}function s(){var n=fh(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===X)return u(y);if(w)return As(g),g=Ws(f,t),e(y)}return g===X&&(g=Ws(f,t)),v}var h,p,_,v,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new pl(en);return t=Ic(t)||0,fc(r)&&(b=!!r.leading,w="maxWait"in r,_=w?Gl(Ic(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m), -s.cancel=a,s.flush=l,s}function Lf(n){return ai(n,jn)}function Cf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new pl(en);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Cf.Cache||sr),r}function Uf(n){if("function"!=typeof n)throw new pl(en);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2: -return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Bf(n){return zf(2,n)}function Tf(n,t){if("function"!=typeof n)throw new pl(en);return t=t===X?t:kc(t),uu(n,t)}function $f(t,r){if("function"!=typeof t)throw new pl(en);return r=null==r?0:Gl(kc(r),0),uu(function(e){var u=e[r],i=Ou(e,0,r);return u&&a(i,u),n(t,this,i)})}function Df(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new pl(en);return fc(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u), -Wf(n,t,{leading:e,maxWait:t,trailing:u})}function Mf(n){return Rf(n,1)}function Ff(n,t){return ph(Au(t),n)}function Nf(){if(!arguments.length)return[];var n=arguments[0];return bh(n)?n:[n]}function Pf(n){return Fr(n,sn)}function qf(n,t){return t="function"==typeof t?t:X,Fr(n,sn,t)}function Zf(n){return Fr(n,an|sn)}function Kf(n,t){return t="function"==typeof t?t:X,Fr(n,an|sn,t)}function Vf(n,t){return null==t||Pr(n,t,Pc(t))}function Gf(n,t){return n===t||n!==n&&t!==t}function Hf(n){return null!=n&&oc(n.length)&&!uc(n); -}function Jf(n){return cc(n)&&Hf(n)}function Yf(n){return n===!0||n===!1||cc(n)&&we(n)==Nn}function Qf(n){return cc(n)&&1===n.nodeType&&!gc(n)}function Xf(n){if(null==n)return!0;if(Hf(n)&&(bh(n)||"string"==typeof n||"function"==typeof n.splice||mh(n)||Oh(n)||dh(n)))return!n.length;var t=zs(n);if(t==Gn||t==tt)return!n.size;if(Mi(n))return!Me(n).length;for(var r in n)if(bl.call(n,r))return!1;return!0}function nc(n,t){return Se(n,t)}function tc(n,t,r){r="function"==typeof r?r:X;var e=r?r(n,t):X;return e===X?Se(n,t,X,r):!!e; -}function rc(n){if(!cc(n))return!1;var t=we(n);return t==Zn||t==qn||"string"==typeof n.message&&"string"==typeof n.name&&!gc(n)}function ec(n){return"number"==typeof n&&Zl(n)}function uc(n){if(!fc(n))return!1;var t=we(n);return t==Kn||t==Vn||t==Fn||t==Xn}function ic(n){return"number"==typeof n&&n==kc(n)}function oc(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Wn}function fc(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function cc(n){return null!=n&&"object"==typeof n}function ac(n,t){ -return n===t||Ce(n,t,ji(t))}function lc(n,t,r){return r="function"==typeof r?r:X,Ce(n,t,ji(t),r)}function sc(n){return vc(n)&&n!=+n}function hc(n){if(Es(n))throw new fl(rn);return Ue(n)}function pc(n){return null===n}function _c(n){return null==n}function vc(n){return"number"==typeof n||cc(n)&&we(n)==Hn}function gc(n){if(!cc(n)||we(n)!=Yn)return!1;var t=El(n);if(null===t)return!0;var r=bl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&dl.call(r)==jl}function yc(n){ -return ic(n)&&n>=-Wn&&n<=Wn}function dc(n){return"string"==typeof n||!bh(n)&&cc(n)&&we(n)==rt}function bc(n){return"symbol"==typeof n||cc(n)&&we(n)==et}function wc(n){return n===X}function mc(n){return cc(n)&&zs(n)==it}function xc(n){return cc(n)&&we(n)==ot}function jc(n){if(!n)return[];if(Hf(n))return dc(n)?G(n):Tu(n);if(Ul&&n[Ul])return D(n[Ul]());var t=zs(n);return(t==Gn?M:t==tt?P:ra)(n)}function Ac(n){if(!n)return 0===n?n:0;if(n=Ic(n),n===Sn||n===-Sn){return(n<0?-1:1)*Ln}return n===n?n:0}function kc(n){ -var t=Ac(n),r=t%1;return t===t?r?t-r:t:0}function Oc(n){return n?Mr(kc(n),0,Un):0}function Ic(n){if("number"==typeof n)return n;if(bc(n))return Cn;if(fc(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=fc(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=R(n);var r=qt.test(n);return r||Kt.test(n)?Xr(n.slice(2),r?2:8):Pt.test(n)?Cn:+n}function Rc(n){return $u(n,qc(n))}function zc(n){return n?Mr(kc(n),-Wn,Wn):0===n?n:0}function Ec(n){return null==n?"":vu(n)}function Sc(n,t){var r=gs(n);return null==t?r:Cr(r,t); -}function Wc(n,t){return v(n,mi(t,3),ue)}function Lc(n,t){return v(n,mi(t,3),oe)}function Cc(n,t){return null==n?n:bs(n,mi(t,3),qc)}function Uc(n,t){return null==n?n:ws(n,mi(t,3),qc)}function Bc(n,t){return n&&ue(n,mi(t,3))}function Tc(n,t){return n&&oe(n,mi(t,3))}function $c(n){return null==n?[]:fe(n,Pc(n))}function Dc(n){return null==n?[]:fe(n,qc(n))}function Mc(n,t,r){var e=null==n?X:_e(n,t);return e===X?r:e}function Fc(n,t){return null!=n&&Ri(n,t,xe)}function Nc(n,t){return null!=n&&Ri(n,t,je); -}function Pc(n){return Hf(n)?Or(n):Me(n)}function qc(n){return Hf(n)?Or(n,!0):Fe(n)}function Zc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,t(n,e,u),n)}),r}function Kc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,e,t(n,e,u))}),r}function Vc(n,t){return Gc(n,Uf(mi(t)))}function Gc(n,t){if(null==n)return{};var r=c(di(n),function(n){return[n]});return t=mi(t),Ye(n,r,function(n,r){return t(n,r[0])})}function Hc(n,t,r){t=ku(t,n);var e=-1,u=t.length;for(u||(u=1,n=X);++et){ -var e=n;n=t,t=e}if(r||n%1||t%1){var u=Ql();return Hl(n+u*(t-n+Qr("1e-"+((u+"").length-1))),t)}return tu(n,t)}function fa(n){return Qh(Ec(n).toLowerCase())}function ca(n){return n=Ec(n),n&&n.replace(Gt,ve).replace(Dr,"")}function aa(n,t,r){n=Ec(n),t=vu(t);var e=n.length;r=r===X?e:Mr(kc(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function la(n){return n=Ec(n),n&&At.test(n)?n.replace(xt,ge):n}function sa(n){return n=Ec(n),n&&Wt.test(n)?n.replace(St,"\\$&"):n}function ha(n,t,r){n=Ec(n),t=kc(t); -var e=t?V(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ri(Nl(u),r)+n+ri(Fl(u),r)}function pa(n,t,r){n=Ec(n),t=kc(t);var e=t?V(n):0;return t&&e>>0)?(n=Ec(n),n&&("string"==typeof t||null!=t&&!Ah(t))&&(t=vu(t),!t&&T(n))?Ou(G(n),0,r):n.split(t,r)):[]}function ba(n,t,r){return n=Ec(n),r=null==r?0:Mr(kc(r),0,n.length),t=vu(t),n.slice(r,r+t.length)==t}function wa(n,t,r){var e=Z.templateSettings;r&&Ui(n,t,r)&&(t=X),n=Ec(n),t=Sh({},t,e,li);var u,i,o=Sh({},t.imports,e.imports,li),f=Pc(o),c=E(o,f),a=0,l=t.interpolate||Ht,s="__p += '",h=sl((t.escape||Ht).source+"|"+l.source+"|"+(l===It?Ft:Ht).source+"|"+(t.evaluate||Ht).source+"|$","g"),p="//# sourceURL="+(bl.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zr+"]")+"\n"; -n.replace(h,function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(Jt,U),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t}),s+="';\n";var _=bl.call(t,"variable")&&t.variable;if(_){if(Dt.test(_))throw new fl(un)}else s="with (obj) {\n"+s+"\n}\n";s=(i?s.replace(dt,""):s).replace(bt,"$1").replace(wt,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}"; -var v=Xh(function(){return cl(f,p+"return "+s).apply(X,c)});if(v.source=s,rc(v))throw v;return v}function ma(n){return Ec(n).toLowerCase()}function xa(n){return Ec(n).toUpperCase()}function ja(n,t,r){if(n=Ec(n),n&&(r||t===X))return R(n);if(!n||!(t=vu(t)))return n;var e=G(n),u=G(t);return Ou(e,W(e,u),L(e,u)+1).join("")}function Aa(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.slice(0,H(n)+1);if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,0,L(e,G(t))+1).join("")}function ka(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.replace(Lt,""); -if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,W(e,G(t))).join("")}function Oa(n,t){var r=An,e=kn;if(fc(t)){var u="separator"in t?t.separator:u;r="length"in t?kc(t.length):r,e="omission"in t?vu(t.omission):e}n=Ec(n);var i=n.length;if(T(n)){var o=G(n);i=o.length}if(r>=i)return n;var f=r-V(e);if(f<1)return e;var c=o?Ou(o,0,f).join(""):n.slice(0,f);if(u===X)return c+e;if(o&&(f+=c.length-f),Ah(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=sl(u.source,Ec(Nt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index; -c=c.slice(0,s===X?f:s)}}else if(n.indexOf(vu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e}function Ia(n){return n=Ec(n),n&&jt.test(n)?n.replace(mt,ye):n}function Ra(n,t,r){return n=Ec(n),t=r?X:t,t===X?$(n)?Q(n):_(n):n.match(t)||[]}function za(t){var r=null==t?0:t.length,e=mi();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new pl(en);return[e(n[0]),n[1]]}):[],uu(function(e){for(var u=-1;++uWn)return[];var r=Un,e=Hl(n,Un);t=mi(t),n-=Un;for(var u=O(e,t);++r1?n[t-1]:X;return r="function"==typeof r?(n.pop(), -r):X,Ho(n,r)}),Qs=gi(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Tr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Ct&&Ci(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:nf,args:[u],thisArg:X}),new Y(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(X),n})):this.thru(u)}),Xs=Fu(function(n,t,r){bl.call(n,r)?++n[r]:Br(n,r,1)}),nh=Ju(ho),th=Ju(po),rh=Fu(function(n,t,r){bl.call(n,r)?n[r].push(t):Br(n,r,[t])}),eh=uu(function(t,r,e){var u=-1,i="function"==typeof r,o=Hf(t)?il(t.length):[]; -return ys(t,function(t){o[++u]=i?n(r,t,e):Ie(t,r,e)}),o}),uh=Fu(function(n,t,r){Br(n,r,t)}),ih=Fu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),oh=uu(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ui(n,t[0],t[1])?t=[]:r>2&&Ui(t[0],t[1],t[2])&&(t=[t[0]]),He(n,ee(t,1),[])}),fh=Dl||function(){return re.Date.now()},ch=uu(function(n,t,r){var e=_n;if(r.length){var u=N(r,wi(ch));e|=bn}return ai(n,e,t,r,u)}),ah=uu(function(n,t,r){var e=_n|vn;if(r.length){var u=N(r,wi(ah));e|=bn; -}return ai(t,e,n,r,u)}),lh=uu(function(n,t){return Gr(n,1,t)}),sh=uu(function(n,t,r){return Gr(n,Ic(t)||0,r)});Cf.Cache=sr;var hh=js(function(t,r){r=1==r.length&&bh(r[0])?c(r[0],z(mi())):c(ee(r,1),z(mi()));var e=r.length;return uu(function(u){for(var i=-1,o=Hl(u.length,e);++i=t}),dh=Re(function(){return arguments}())?Re:function(n){return cc(n)&&bl.call(n,"callee")&&!Wl.call(n,"callee")},bh=il.isArray,wh=ce?z(ce):ze,mh=ql||qa,xh=ae?z(ae):Ee,jh=le?z(le):Le,Ah=se?z(se):Be,kh=he?z(he):Te,Oh=pe?z(pe):$e,Ih=ii(Ne),Rh=ii(function(n,t){return n<=t}),zh=Nu(function(n,t){if(Mi(t)||Hf(t))return $u(t,Pc(t),n),X;for(var r in t)bl.call(t,r)&&Sr(n,r,t[r])}),Eh=Nu(function(n,t){$u(t,qc(t),n)}),Sh=Nu(function(n,t,r,e){$u(t,qc(t),n,e)}),Wh=Nu(function(n,t,r,e){$u(t,Pc(t),n,e); -}),Lh=gi(Tr),Ch=uu(function(n,t){n=ll(n);var r=-1,e=t.length,u=e>2?t[2]:X;for(u&&Ui(t[0],t[1],u)&&(e=1);++r1),t}),$u(n,di(n),r),e&&(r=Fr(r,an|ln|sn,hi));for(var u=t.length;u--;)yu(r,t[u]);return r}),Nh=gi(function(n,t){return null==n?{}:Je(n,t)}),Ph=ci(Pc),qh=ci(qc),Zh=Vu(function(n,t,r){return t=t.toLowerCase(),n+(r?fa(t):t)}),Kh=Vu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vh=Vu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Gh=Ku("toLowerCase"),Hh=Vu(function(n,t,r){ -return n+(r?"_":"")+t.toLowerCase()}),Jh=Vu(function(n,t,r){return n+(r?" ":"")+Qh(t)}),Yh=Vu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Qh=Ku("toUpperCase"),Xh=uu(function(t,r){try{return n(t,X,r)}catch(n){return rc(n)?n:new fl(n)}}),np=gi(function(n,t){return r(t,function(t){t=no(t),Br(n,t,ch(n[t],n))}),n}),tp=Yu(),rp=Yu(!0),ep=uu(function(n,t){return function(r){return Ie(r,n,t)}}),up=uu(function(n,t){return function(r){return Ie(n,r,t)}}),ip=ti(c),op=ti(u),fp=ti(h),cp=ui(),ap=ui(!0),lp=ni(function(n,t){ -return n+t},0),sp=fi("ceil"),hp=ni(function(n,t){return n/t},1),pp=fi("floor"),_p=ni(function(n,t){return n*t},1),vp=fi("round"),gp=ni(function(n,t){return n-t},0);return Z.after=If,Z.ary=Rf,Z.assign=zh,Z.assignIn=Eh,Z.assignInWith=Sh,Z.assignWith=Wh,Z.at=Lh,Z.before=zf,Z.bind=ch,Z.bindAll=np,Z.bindKey=ah,Z.castArray=Nf,Z.chain=Qo,Z.chunk=uo,Z.compact=io,Z.concat=oo,Z.cond=za,Z.conforms=Ea,Z.constant=Sa,Z.countBy=Xs,Z.create=Sc,Z.curry=Ef,Z.curryRight=Sf,Z.debounce=Wf,Z.defaults=Ch,Z.defaultsDeep=Uh, -Z.defer=lh,Z.delay=sh,Z.difference=Us,Z.differenceBy=Bs,Z.differenceWith=Ts,Z.drop=fo,Z.dropRight=co,Z.dropRightWhile=ao,Z.dropWhile=lo,Z.fill=so,Z.filter=lf,Z.flatMap=sf,Z.flatMapDeep=hf,Z.flatMapDepth=pf,Z.flatten=_o,Z.flattenDeep=vo,Z.flattenDepth=go,Z.flip=Lf,Z.flow=tp,Z.flowRight=rp,Z.fromPairs=yo,Z.functions=$c,Z.functionsIn=Dc,Z.groupBy=rh,Z.initial=mo,Z.intersection=$s,Z.intersectionBy=Ds,Z.intersectionWith=Ms,Z.invert=Bh,Z.invertBy=Th,Z.invokeMap=eh,Z.iteratee=Ca,Z.keyBy=uh,Z.keys=Pc,Z.keysIn=qc, -Z.map=yf,Z.mapKeys=Zc,Z.mapValues=Kc,Z.matches=Ua,Z.matchesProperty=Ba,Z.memoize=Cf,Z.merge=Dh,Z.mergeWith=Mh,Z.method=ep,Z.methodOf=up,Z.mixin=Ta,Z.negate=Uf,Z.nthArg=Ma,Z.omit=Fh,Z.omitBy=Vc,Z.once=Bf,Z.orderBy=df,Z.over=ip,Z.overArgs=hh,Z.overEvery=op,Z.overSome=fp,Z.partial=ph,Z.partialRight=_h,Z.partition=ih,Z.pick=Nh,Z.pickBy=Gc,Z.property=Fa,Z.propertyOf=Na,Z.pull=Fs,Z.pullAll=Oo,Z.pullAllBy=Io,Z.pullAllWith=Ro,Z.pullAt=Ns,Z.range=cp,Z.rangeRight=ap,Z.rearg=vh,Z.reject=mf,Z.remove=zo,Z.rest=Tf, -Z.reverse=Eo,Z.sampleSize=jf,Z.set=Jc,Z.setWith=Yc,Z.shuffle=Af,Z.slice=So,Z.sortBy=oh,Z.sortedUniq=$o,Z.sortedUniqBy=Do,Z.split=da,Z.spread=$f,Z.tail=Mo,Z.take=Fo,Z.takeRight=No,Z.takeRightWhile=Po,Z.takeWhile=qo,Z.tap=Xo,Z.throttle=Df,Z.thru=nf,Z.toArray=jc,Z.toPairs=Ph,Z.toPairsIn=qh,Z.toPath=Ha,Z.toPlainObject=Rc,Z.transform=Qc,Z.unary=Mf,Z.union=Ps,Z.unionBy=qs,Z.unionWith=Zs,Z.uniq=Zo,Z.uniqBy=Ko,Z.uniqWith=Vo,Z.unset=Xc,Z.unzip=Go,Z.unzipWith=Ho,Z.update=na,Z.updateWith=ta,Z.values=ra,Z.valuesIn=ea, -Z.without=Ks,Z.words=Ra,Z.wrap=Ff,Z.xor=Vs,Z.xorBy=Gs,Z.xorWith=Hs,Z.zip=Js,Z.zipObject=Jo,Z.zipObjectDeep=Yo,Z.zipWith=Ys,Z.entries=Ph,Z.entriesIn=qh,Z.extend=Eh,Z.extendWith=Sh,Ta(Z,Z),Z.add=lp,Z.attempt=Xh,Z.camelCase=Zh,Z.capitalize=fa,Z.ceil=sp,Z.clamp=ua,Z.clone=Pf,Z.cloneDeep=Zf,Z.cloneDeepWith=Kf,Z.cloneWith=qf,Z.conformsTo=Vf,Z.deburr=ca,Z.defaultTo=Wa,Z.divide=hp,Z.endsWith=aa,Z.eq=Gf,Z.escape=la,Z.escapeRegExp=sa,Z.every=af,Z.find=nh,Z.findIndex=ho,Z.findKey=Wc,Z.findLast=th,Z.findLastIndex=po, -Z.findLastKey=Lc,Z.floor=pp,Z.forEach=_f,Z.forEachRight=vf,Z.forIn=Cc,Z.forInRight=Uc,Z.forOwn=Bc,Z.forOwnRight=Tc,Z.get=Mc,Z.gt=gh,Z.gte=yh,Z.has=Fc,Z.hasIn=Nc,Z.head=bo,Z.identity=La,Z.includes=gf,Z.indexOf=wo,Z.inRange=ia,Z.invoke=$h,Z.isArguments=dh,Z.isArray=bh,Z.isArrayBuffer=wh,Z.isArrayLike=Hf,Z.isArrayLikeObject=Jf,Z.isBoolean=Yf,Z.isBuffer=mh,Z.isDate=xh,Z.isElement=Qf,Z.isEmpty=Xf,Z.isEqual=nc,Z.isEqualWith=tc,Z.isError=rc,Z.isFinite=ec,Z.isFunction=uc,Z.isInteger=ic,Z.isLength=oc,Z.isMap=jh, -Z.isMatch=ac,Z.isMatchWith=lc,Z.isNaN=sc,Z.isNative=hc,Z.isNil=_c,Z.isNull=pc,Z.isNumber=vc,Z.isObject=fc,Z.isObjectLike=cc,Z.isPlainObject=gc,Z.isRegExp=Ah,Z.isSafeInteger=yc,Z.isSet=kh,Z.isString=dc,Z.isSymbol=bc,Z.isTypedArray=Oh,Z.isUndefined=wc,Z.isWeakMap=mc,Z.isWeakSet=xc,Z.join=xo,Z.kebabCase=Kh,Z.last=jo,Z.lastIndexOf=Ao,Z.lowerCase=Vh,Z.lowerFirst=Gh,Z.lt=Ih,Z.lte=Rh,Z.max=Ya,Z.maxBy=Qa,Z.mean=Xa,Z.meanBy=nl,Z.min=tl,Z.minBy=rl,Z.stubArray=Pa,Z.stubFalse=qa,Z.stubObject=Za,Z.stubString=Ka, -Z.stubTrue=Va,Z.multiply=_p,Z.nth=ko,Z.noConflict=$a,Z.noop=Da,Z.now=fh,Z.pad=ha,Z.padEnd=pa,Z.padStart=_a,Z.parseInt=va,Z.random=oa,Z.reduce=bf,Z.reduceRight=wf,Z.repeat=ga,Z.replace=ya,Z.result=Hc,Z.round=vp,Z.runInContext=p,Z.sample=xf,Z.size=kf,Z.snakeCase=Hh,Z.some=Of,Z.sortedIndex=Wo,Z.sortedIndexBy=Lo,Z.sortedIndexOf=Co,Z.sortedLastIndex=Uo,Z.sortedLastIndexBy=Bo,Z.sortedLastIndexOf=To,Z.startCase=Jh,Z.startsWith=ba,Z.subtract=gp,Z.sum=el,Z.sumBy=ul,Z.template=wa,Z.times=Ga,Z.toFinite=Ac,Z.toInteger=kc, -Z.toLength=Oc,Z.toLower=ma,Z.toNumber=Ic,Z.toSafeInteger=zc,Z.toString=Ec,Z.toUpper=xa,Z.trim=ja,Z.trimEnd=Aa,Z.trimStart=ka,Z.truncate=Oa,Z.unescape=Ia,Z.uniqueId=Ja,Z.upperCase=Yh,Z.upperFirst=Qh,Z.each=_f,Z.eachRight=vf,Z.first=bo,Ta(Z,function(){var n={};return ue(Z,function(t,r){bl.call(Z.prototype,r)||(n[r]=t)}),n}(),{chain:!1}),Z.VERSION=nn,r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){Z[n].placeholder=Z}),r(["drop","take"],function(n,t){Ct.prototype[n]=function(r){ -r=r===X?1:Gl(kc(r),0);var e=this.__filtered__&&!t?new Ct(this):this.clone();return e.__filtered__?e.__takeCount__=Hl(r,e.__takeCount__):e.__views__.push({size:Hl(r,Un),type:n+(e.__dir__<0?"Right":"")}),e},Ct.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==Rn||r==En;Ct.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:mi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){ -var r="take"+(t?"Right":"");Ct.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Ct.prototype[n]=function(){return this.__filtered__?new Ct(this):this[r](1)}}),Ct.prototype.compact=function(){return this.filter(La)},Ct.prototype.find=function(n){return this.filter(n).head()},Ct.prototype.findLast=function(n){return this.reverse().find(n)},Ct.prototype.invokeMap=uu(function(n,t){return"function"==typeof n?new Ct(this):this.map(function(r){ -return Ie(r,n,t)})}),Ct.prototype.reject=function(n){return this.filter(Uf(mi(n)))},Ct.prototype.slice=function(n,t){n=kc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ct(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==X&&(t=kc(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Ct.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ct.prototype.toArray=function(){return this.take(Un)},ue(Ct.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Z[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t); -u&&(Z.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ct,c=o[0],l=f||bh(t),s=function(n){var t=u.apply(Z,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Ct(this);var g=n.apply(t,o);return g.__actions__.push({func:nf,args:[s],thisArg:X}),new Y(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){ -var t=_l[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Z.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(bh(u)?u:[],n)}return this[r](function(r){return t.apply(bh(r)?r:[],n)})}}),ue(Ct.prototype,function(n,t){var r=Z[t];if(r){var e=r.name+"";bl.call(fs,e)||(fs[e]=[]),fs[e].push({name:t,func:r})}}),fs[Qu(X,vn).name]=[{name:"wrapper",func:X}],Ct.prototype.clone=$t,Ct.prototype.reverse=Yt,Ct.prototype.value=Qt,Z.prototype.at=Qs, -Z.prototype.chain=tf,Z.prototype.commit=rf,Z.prototype.next=ef,Z.prototype.plant=of,Z.prototype.reverse=ff,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=cf,Z.prototype.first=Z.prototype.head,Ul&&(Z.prototype[Ul]=uf),Z},be=de(); true?(re._=be,!(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){return be}).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))):0}).call(this); - -/***/ }), - -/***/ "./node_modules/math-intrinsics/abs.js": -/*!*********************************************!*\ - !*** ./node_modules/math-intrinsics/abs.js ***! - \*********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./abs')} */ -module.exports = Math.abs; - - -/***/ }), - -/***/ "./node_modules/math-intrinsics/floor.js": -/*!***********************************************!*\ - !*** ./node_modules/math-intrinsics/floor.js ***! - \***********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./floor')} */ -module.exports = Math.floor; - - -/***/ }), - -/***/ "./node_modules/math-intrinsics/isNaN.js": -/*!***********************************************!*\ - !*** ./node_modules/math-intrinsics/isNaN.js ***! - \***********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./isNaN')} */ -module.exports = Number.isNaN || function isNaN(a) { - return a !== a; -}; - - -/***/ }), - -/***/ "./node_modules/math-intrinsics/max.js": -/*!*********************************************!*\ - !*** ./node_modules/math-intrinsics/max.js ***! - \*********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./max')} */ -module.exports = Math.max; - - -/***/ }), - -/***/ "./node_modules/math-intrinsics/min.js": -/*!*********************************************!*\ - !*** ./node_modules/math-intrinsics/min.js ***! - \*********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./min')} */ -module.exports = Math.min; - - -/***/ }), - -/***/ "./node_modules/math-intrinsics/pow.js": -/*!*********************************************!*\ - !*** ./node_modules/math-intrinsics/pow.js ***! - \*********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./pow')} */ -module.exports = Math.pow; - - -/***/ }), - -/***/ "./node_modules/math-intrinsics/round.js": -/*!***********************************************!*\ - !*** ./node_modules/math-intrinsics/round.js ***! - \***********************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./round')} */ -module.exports = Math.round; - - -/***/ }), - -/***/ "./node_modules/math-intrinsics/sign.js": -/*!**********************************************!*\ - !*** ./node_modules/math-intrinsics/sign.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var $isNaN = __webpack_require__(/*! ./isNaN */ "./node_modules/math-intrinsics/isNaN.js"); - -/** @type {import('./sign')} */ -module.exports = function sign(number) { - if ($isNaN(number) || number === 0) { - return number; - } - return number < 0 ? -1 : +1; -}; - - -/***/ }), - -/***/ "./node_modules/object-is/implementation.js": -/*!**************************************************!*\ - !*** ./node_modules/object-is/implementation.js ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; - - -var numberIsNaN = function (value) { - return value !== value; -}; - -module.exports = function is(a, b) { - if (a === 0 && b === 0) { - return 1 / a === 1 / b; - } - if (a === b) { - return true; - } - if (numberIsNaN(a) && numberIsNaN(b)) { - return true; - } - return false; -}; - - - -/***/ }), - -/***/ "./node_modules/object-is/index.js": -/*!*****************************************!*\ - !*** ./node_modules/object-is/index.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); -var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); - -var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object-is/implementation.js"); -var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object-is/polyfill.js"); -var shim = __webpack_require__(/*! ./shim */ "./node_modules/object-is/shim.js"); - -var polyfill = callBind(getPolyfill(), Object); - -define(polyfill, { - getPolyfill: getPolyfill, - implementation: implementation, - shim: shim -}); - -module.exports = polyfill; - - -/***/ }), - -/***/ "./node_modules/object-is/polyfill.js": -/*!********************************************!*\ - !*** ./node_modules/object-is/polyfill.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object-is/implementation.js"); - -module.exports = function getPolyfill() { - return typeof Object.is === 'function' ? Object.is : implementation; -}; - - -/***/ }), - -/***/ "./node_modules/object-is/shim.js": -/*!****************************************!*\ - !*** ./node_modules/object-is/shim.js ***! - \****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object-is/polyfill.js"); -var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); - -module.exports = function shimObjectIs() { - var polyfill = getPolyfill(); - define(Object, { is: polyfill }, { - is: function testObjectIs() { - return Object.is !== polyfill; - } - }); - return polyfill; -}; - - -/***/ }), - -/***/ "./node_modules/object-keys/implementation.js": -/*!****************************************************!*\ - !*** ./node_modules/object-keys/implementation.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var keysShim; -if (!Object.keys) { - // modified from https://github.com/es-shims/es5-shim - var has = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; - var isArgs = __webpack_require__(/*! ./isArguments */ "./node_modules/object-keys/isArguments.js"); // eslint-disable-line global-require - var isEnumerable = Object.prototype.propertyIsEnumerable; - var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); - var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); - var dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ]; - var equalsConstructorPrototype = function (o) { - var ctor = o.constructor; - return ctor && ctor.prototype === o; - }; - var excludedKeys = { - $applicationCache: true, - $console: true, - $external: true, - $frame: true, - $frameElement: true, - $frames: true, - $innerHeight: true, - $innerWidth: true, - $onmozfullscreenchange: true, - $onmozfullscreenerror: true, - $outerHeight: true, - $outerWidth: true, - $pageXOffset: true, - $pageYOffset: true, - $parent: true, - $scrollLeft: true, - $scrollTop: true, - $scrollX: true, - $scrollY: true, - $self: true, - $webkitIndexedDB: true, - $webkitStorageInfo: true, - $window: true - }; - var hasAutomationEqualityBug = (function () { - /* global window */ - if (typeof window === 'undefined') { return false; } - for (var k in window) { - try { - if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { - try { - equalsConstructorPrototype(window[k]); - } catch (e) { - return true; - } - } - } catch (e) { - return true; - } - } - return false; - }()); - var equalsConstructorPrototypeIfNotBuggy = function (o) { - /* global window */ - if (typeof window === 'undefined' || !hasAutomationEqualityBug) { - return equalsConstructorPrototype(o); - } - try { - return equalsConstructorPrototype(o); - } catch (e) { - return false; - } - }; - - keysShim = function keys(object) { - var isObject = object !== null && typeof object === 'object'; - var isFunction = toStr.call(object) === '[object Function]'; - var isArguments = isArgs(object); - var isString = isObject && toStr.call(object) === '[object String]'; - var theKeys = []; - - if (!isObject && !isFunction && !isArguments) { - throw new TypeError('Object.keys called on a non-object'); - } - - var skipProto = hasProtoEnumBug && isFunction; - if (isString && object.length > 0 && !has.call(object, 0)) { - for (var i = 0; i < object.length; ++i) { - theKeys.push(String(i)); - } - } - - if (isArguments && object.length > 0) { - for (var j = 0; j < object.length; ++j) { - theKeys.push(String(j)); - } - } else { - for (var name in object) { - if (!(skipProto && name === 'prototype') && has.call(object, name)) { - theKeys.push(String(name)); - } - } - } - - if (hasDontEnumBug) { - var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); - - for (var k = 0; k < dontEnums.length; ++k) { - if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { - theKeys.push(dontEnums[k]); - } - } - } - return theKeys; - }; -} -module.exports = keysShim; - - -/***/ }), - -/***/ "./node_modules/object-keys/index.js": -/*!*******************************************!*\ - !*** ./node_modules/object-keys/index.js ***! - \*******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var slice = Array.prototype.slice; -var isArgs = __webpack_require__(/*! ./isArguments */ "./node_modules/object-keys/isArguments.js"); - -var origKeys = Object.keys; -var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(/*! ./implementation */ "./node_modules/object-keys/implementation.js"); - -var originalKeys = Object.keys; - -keysShim.shim = function shimObjectKeys() { - if (Object.keys) { - var keysWorksWithArguments = (function () { - // Safari 5.0 bug - var args = Object.keys(arguments); - return args && args.length === arguments.length; - }(1, 2)); - if (!keysWorksWithArguments) { - Object.keys = function keys(object) { // eslint-disable-line func-name-matching - if (isArgs(object)) { - return originalKeys(slice.call(object)); - } - return originalKeys(object); - }; - } - } else { - Object.keys = keysShim; - } - return Object.keys || keysShim; -}; - -module.exports = keysShim; - - -/***/ }), - -/***/ "./node_modules/object-keys/isArguments.js": -/*!*************************************************!*\ - !*** ./node_modules/object-keys/isArguments.js ***! - \*************************************************/ -/***/ ((module) => { - -"use strict"; - - -var toStr = Object.prototype.toString; - -module.exports = function isArguments(value) { - var str = toStr.call(value); - var isArgs = str === '[object Arguments]'; - if (!isArgs) { - isArgs = str !== '[object Array]' && - value !== null && - typeof value === 'object' && - typeof value.length === 'number' && - value.length >= 0 && - toStr.call(value.callee) === '[object Function]'; - } - return isArgs; -}; - - -/***/ }), - -/***/ "./node_modules/object.assign/implementation.js": -/*!******************************************************!*\ - !*** ./node_modules/object.assign/implementation.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -// modified from https://github.com/es-shims/es6-shim -var objectKeys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js"); -var hasSymbols = __webpack_require__(/*! has-symbols/shams */ "./node_modules/has-symbols/shams.js")(); -var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); -var $Object = __webpack_require__(/*! es-object-atoms */ "./node_modules/es-object-atoms/index.js"); -var $push = callBound('Array.prototype.push'); -var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); -var originalGetSymbols = hasSymbols ? $Object.getOwnPropertySymbols : null; - -// eslint-disable-next-line no-unused-vars -module.exports = function assign(target, source1) { - if (target == null) { throw new TypeError('target must be an object'); } - var to = $Object(target); // step 1 - if (arguments.length === 1) { - return to; // step 2 - } - for (var s = 1; s < arguments.length; ++s) { - var from = $Object(arguments[s]); // step 3.a.i - - // step 3.a.ii: - var keys = objectKeys(from); - var getSymbols = hasSymbols && ($Object.getOwnPropertySymbols || originalGetSymbols); - if (getSymbols) { - var syms = getSymbols(from); - for (var j = 0; j < syms.length; ++j) { - var key = syms[j]; - if ($propIsEnumerable(from, key)) { - $push(keys, key); - } - } - } - - // step 3.a.iii: - for (var i = 0; i < keys.length; ++i) { - var nextKey = keys[i]; - if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2 - var propValue = from[nextKey]; // step 3.a.iii.2.a - to[nextKey] = propValue; // step 3.a.iii.2.b - } - } - } - - return to; // step 4 -}; - - -/***/ }), - -/***/ "./node_modules/object.assign/polyfill.js": -/*!************************************************!*\ - !*** ./node_modules/object.assign/polyfill.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.assign/implementation.js"); - -var lacksProperEnumerationOrder = function () { - if (!Object.assign) { - return false; - } - /* - * v8, specifically in node 4.x, has a bug with incorrect property enumeration order - * note: this does not detect the bug unless there's 20 characters - */ - var str = 'abcdefghijklmnopqrst'; - var letters = str.split(''); - var map = {}; - for (var i = 0; i < letters.length; ++i) { - map[letters[i]] = letters[i]; - } - var obj = Object.assign({}, map); - var actual = ''; - for (var k in obj) { - actual += k; - } - return str !== actual; -}; - -var assignHasPendingExceptions = function () { - if (!Object.assign || !Object.preventExtensions) { - return false; - } - /* - * Firefox 37 still has "pending exception" logic in its Object.assign implementation, - * which is 72% slower than our shim, and Firefox 40's native implementation. - */ - var thrower = Object.preventExtensions({ 1: 2 }); - try { - Object.assign(thrower, 'xy'); - } catch (e) { - return thrower[1] === 'y'; - } - return false; -}; - -module.exports = function getPolyfill() { - if (!Object.assign) { - return implementation; - } - if (lacksProperEnumerationOrder()) { - return implementation; - } - if (assignHasPendingExceptions()) { - return implementation; - } - return Object.assign; -}; - - -/***/ }), - -/***/ "./node_modules/os-browserify/browser.js": -/*!***********************************************!*\ - !*** ./node_modules/os-browserify/browser.js ***! - \***********************************************/ -/***/ ((__unused_webpack_module, exports) => { - -exports.endianness = function () { return 'LE' }; - -exports.hostname = function () { - if (typeof location !== 'undefined') { - return location.hostname - } - else return ''; -}; - -exports.loadavg = function () { return [] }; - -exports.uptime = function () { return 0 }; - -exports.freemem = function () { - return Number.MAX_VALUE; -}; - -exports.totalmem = function () { - return Number.MAX_VALUE; -}; - -exports.cpus = function () { return [] }; - -exports.type = function () { return 'Browser' }; - -exports.release = function () { - if (typeof navigator !== 'undefined') { - return navigator.appVersion; - } - return ''; -}; - -exports.networkInterfaces -= exports.getNetworkInterfaces -= function () { return {} }; - -exports.arch = function () { return 'javascript' }; - -exports.platform = function () { return 'browser' }; - -exports.tmpdir = exports.tmpDir = function () { - return '/tmp'; -}; - -exports.EOL = '\n'; - -exports.homedir = function () { - return '/' -}; - - -/***/ }), - -/***/ "./node_modules/possible-typed-array-names/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/possible-typed-array-names/index.js ***! - \**********************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** @type {import('.')} */ -module.exports = [ - 'Float16Array', - 'Float32Array', - 'Float64Array', - 'Int8Array', - 'Int16Array', - 'Int32Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'Uint16Array', - 'Uint32Array', - 'BigInt64Array', - 'BigUint64Array' -]; - - -/***/ }), - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/***/ ((module) => { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/recast/lib/comments.js": -/*!*********************************************!*\ - !*** ./node_modules/recast/lib/comments.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.printComments = exports.attach = void 0; -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var types = tslib_1.__importStar(__webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js")); -var n = types.namedTypes; -var isArray = types.builtInTypes.array; -var isObject = types.builtInTypes.object; -var lines_1 = __webpack_require__(/*! ./lines */ "./node_modules/recast/lib/lines.js"); -var util_1 = __webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js"); -var childNodesCache = new WeakMap(); -// TODO Move a non-caching implementation of this function into ast-types, -// and implement a caching wrapper function here. -function getSortedChildNodes(node, lines, resultArray) { - if (!node) { - return resultArray; - } - // The .loc checks below are sensitive to some of the problems that - // are fixed by this utility function. Specifically, if it decides to - // set node.loc to null, indicating that the node's .loc information - // is unreliable, then we don't want to add node to the resultArray. - (0, util_1.fixFaultyLocations)(node, lines); - if (resultArray) { - if (n.Node.check(node) && n.SourceLocation.check(node.loc)) { - // This reverse insertion sort almost always takes constant - // time because we almost always (maybe always?) append the - // nodes in order anyway. - var i = resultArray.length - 1; - for (; i >= 0; --i) { - var child = resultArray[i]; - if (child && - child.loc && - (0, util_1.comparePos)(child.loc.end, node.loc.start) <= 0) { - break; - } - } - resultArray.splice(i + 1, 0, node); - return resultArray; - } - } - else { - var childNodes = childNodesCache.get(node); - if (childNodes) { - return childNodes; - } - } - var names; - if (isArray.check(node)) { - names = Object.keys(node); - } - else if (isObject.check(node)) { - names = types.getFieldNames(node); - } - else { - return resultArray; - } - if (!resultArray) { - childNodesCache.set(node, (resultArray = [])); - } - for (var i = 0, nameCount = names.length; i < nameCount; ++i) { - getSortedChildNodes(node[names[i]], lines, resultArray); - } - return resultArray; -} -// As efficiently as possible, decorate the comment object with -// .precedingNode, .enclosingNode, and/or .followingNode properties, at -// least one of which is guaranteed to be defined. -function decorateComment(node, comment, lines) { - var childNodes = getSortedChildNodes(node, lines); - // Time to dust off the old binary search robes and wizard hat. - var left = 0; - var right = childNodes && childNodes.length; - var precedingNode; - var followingNode; - while (typeof right === "number" && left < right) { - var middle = (left + right) >> 1; - var child = childNodes[middle]; - if ((0, util_1.comparePos)(child.loc.start, comment.loc.start) <= 0 && - (0, util_1.comparePos)(comment.loc.end, child.loc.end) <= 0) { - // The comment is completely contained by this child node. - decorateComment((comment.enclosingNode = child), comment, lines); - return; // Abandon the binary search at this level. - } - if ((0, util_1.comparePos)(child.loc.end, comment.loc.start) <= 0) { - // This child node falls completely before the comment. - // Because we will never consider this node or any nodes - // before it again, this node must be the closest preceding - // node we have encountered so far. - precedingNode = child; - left = middle + 1; - continue; - } - if ((0, util_1.comparePos)(comment.loc.end, child.loc.start) <= 0) { - // This child node falls completely after the comment. - // Because we will never consider this node or any nodes after - // it again, this node must be the closest following node we - // have encountered so far. - followingNode = child; - right = middle; - continue; - } - throw new Error("Comment location overlaps with node location"); - } - if (precedingNode) { - comment.precedingNode = precedingNode; - } - if (followingNode) { - comment.followingNode = followingNode; - } -} -function attach(comments, ast, lines) { - if (!isArray.check(comments)) { - return; - } - var tiesToBreak = []; - comments.forEach(function (comment) { - comment.loc.lines = lines; - decorateComment(ast, comment, lines); - var pn = comment.precedingNode; - var en = comment.enclosingNode; - var fn = comment.followingNode; - if (pn && fn) { - var tieCount = tiesToBreak.length; - if (tieCount > 0) { - var lastTie = tiesToBreak[tieCount - 1]; - (0, tiny_invariant_1.default)((lastTie.precedingNode === comment.precedingNode) === - (lastTie.followingNode === comment.followingNode)); - if (lastTie.followingNode !== comment.followingNode) { - breakTies(tiesToBreak, lines); - } - } - tiesToBreak.push(comment); - } - else if (pn) { - // No contest: we have a trailing comment. - breakTies(tiesToBreak, lines); - addTrailingComment(pn, comment); - } - else if (fn) { - // No contest: we have a leading comment. - breakTies(tiesToBreak, lines); - addLeadingComment(fn, comment); - } - else if (en) { - // The enclosing node has no child nodes at all, so what we - // have here is a dangling comment, e.g. [/* crickets */]. - breakTies(tiesToBreak, lines); - addDanglingComment(en, comment); - } - else { - throw new Error("AST contains no nodes at all?"); - } - }); - breakTies(tiesToBreak, lines); - comments.forEach(function (comment) { - // These node references were useful for breaking ties, but we - // don't need them anymore, and they create cycles in the AST that - // may lead to infinite recursion if we don't delete them here. - delete comment.precedingNode; - delete comment.enclosingNode; - delete comment.followingNode; - }); -} -exports.attach = attach; -function breakTies(tiesToBreak, lines) { - var tieCount = tiesToBreak.length; - if (tieCount === 0) { - return; - } - var pn = tiesToBreak[0].precedingNode; - var fn = tiesToBreak[0].followingNode; - var gapEndPos = fn.loc.start; - // Iterate backwards through tiesToBreak, examining the gaps - // between the tied comments. In order to qualify as leading, a - // comment must be separated from fn by an unbroken series of - // whitespace-only gaps (or other comments). - var indexOfFirstLeadingComment = tieCount; - var comment; - for (; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) { - comment = tiesToBreak[indexOfFirstLeadingComment - 1]; - (0, tiny_invariant_1.default)(comment.precedingNode === pn); - (0, tiny_invariant_1.default)(comment.followingNode === fn); - var gap = lines.sliceString(comment.loc.end, gapEndPos); - if (/\S/.test(gap)) { - // The gap string contained something other than whitespace. - break; - } - gapEndPos = comment.loc.start; - } - while (indexOfFirstLeadingComment <= tieCount && - (comment = tiesToBreak[indexOfFirstLeadingComment]) && - // If the comment is a //-style comment and indented more - // deeply than the node itself, reconsider it as trailing. - (comment.type === "Line" || comment.type === "CommentLine") && - comment.loc.start.column > fn.loc.start.column) { - ++indexOfFirstLeadingComment; - } - if (indexOfFirstLeadingComment) { - var enclosingNode = tiesToBreak[indexOfFirstLeadingComment - 1].enclosingNode; - if ((enclosingNode === null || enclosingNode === void 0 ? void 0 : enclosingNode.type) === "CallExpression") { - --indexOfFirstLeadingComment; - } - } - tiesToBreak.forEach(function (comment, i) { - if (i < indexOfFirstLeadingComment) { - addTrailingComment(pn, comment); - } - else { - addLeadingComment(fn, comment); - } - }); - tiesToBreak.length = 0; -} -function addCommentHelper(node, comment) { - var comments = node.comments || (node.comments = []); - comments.push(comment); -} -function addLeadingComment(node, comment) { - comment.leading = true; - comment.trailing = false; - addCommentHelper(node, comment); -} -function addDanglingComment(node, comment) { - comment.leading = false; - comment.trailing = false; - addCommentHelper(node, comment); -} -function addTrailingComment(node, comment) { - comment.leading = false; - comment.trailing = true; - addCommentHelper(node, comment); -} -function printLeadingComment(commentPath, print) { - var comment = commentPath.getValue(); - n.Comment.assert(comment); - var loc = comment.loc; - var lines = loc && loc.lines; - var parts = [print(commentPath)]; - if (comment.trailing) { - // When we print trailing comments as leading comments, we don't - // want to bring any trailing spaces along. - parts.push("\n"); - } - else if (lines instanceof lines_1.Lines) { - var trailingSpace = lines.slice(loc.end, lines.skipSpaces(loc.end) || lines.lastPos()); - if (trailingSpace.length === 1) { - // If the trailing space contains no newlines, then we want to - // preserve it exactly as we found it. - parts.push(trailingSpace); - } - else { - // If the trailing space contains newlines, then replace it - // with just that many newlines, with all other spaces removed. - parts.push(new Array(trailingSpace.length).join("\n")); - } - } - else { - parts.push("\n"); - } - return (0, lines_1.concat)(parts); -} -function printTrailingComment(commentPath, print) { - var comment = commentPath.getValue(commentPath); - n.Comment.assert(comment); - var loc = comment.loc; - var lines = loc && loc.lines; - var parts = []; - if (lines instanceof lines_1.Lines) { - var fromPos = lines.skipSpaces(loc.start, true) || lines.firstPos(); - var leadingSpace = lines.slice(fromPos, loc.start); - if (leadingSpace.length === 1) { - // If the leading space contains no newlines, then we want to - // preserve it exactly as we found it. - parts.push(leadingSpace); - } - else { - // If the leading space contains newlines, then replace it - // with just that many newlines, sans all other spaces. - parts.push(new Array(leadingSpace.length).join("\n")); - } - } - parts.push(print(commentPath)); - return (0, lines_1.concat)(parts); -} -function printComments(path, print) { - var value = path.getValue(); - var innerLines = print(path); - var comments = n.Node.check(value) && types.getFieldValue(value, "comments"); - if (!comments || comments.length === 0) { - return innerLines; - } - var leadingParts = []; - var trailingParts = [innerLines]; - path.each(function (commentPath) { - var comment = commentPath.getValue(); - var leading = types.getFieldValue(comment, "leading"); - var trailing = types.getFieldValue(comment, "trailing"); - if (leading || - (trailing && - !(n.Statement.check(value) || - comment.type === "Block" || - comment.type === "CommentBlock"))) { - leadingParts.push(printLeadingComment(commentPath, print)); - } - else if (trailing) { - trailingParts.push(printTrailingComment(commentPath, print)); - } - }, "comments"); - leadingParts.push.apply(leadingParts, trailingParts); - return (0, lines_1.concat)(leadingParts); -} -exports.printComments = printComments; - - -/***/ }), - -/***/ "./node_modules/recast/lib/fast-path.js": -/*!**********************************************!*\ - !*** ./node_modules/recast/lib/fast-path.js ***! - \**********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var types = tslib_1.__importStar(__webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js")); -var util = tslib_1.__importStar(__webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js")); -var n = types.namedTypes; -var isArray = types.builtInTypes.array; -var isNumber = types.builtInTypes.number; -var PRECEDENCE = {}; -[ - ["??"], - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"], - ["**"], -].forEach(function (tier, i) { - tier.forEach(function (op) { - PRECEDENCE[op] = i; - }); -}); -var FastPath = function FastPath(value) { - (0, tiny_invariant_1.default)(this instanceof FastPath); - this.stack = [value]; -}; -var FPp = FastPath.prototype; -// Static convenience function for coercing a value to a FastPath. -FastPath.from = function (obj) { - if (obj instanceof FastPath) { - // Return a defensive copy of any existing FastPath instances. - return obj.copy(); - } - if (obj instanceof types.NodePath) { - // For backwards compatibility, unroll NodePath instances into - // lightweight FastPath [..., name, value] stacks. - var copy = Object.create(FastPath.prototype); - var stack = [obj.value]; - for (var pp = void 0; (pp = obj.parentPath); obj = pp) - stack.push(obj.name, pp.value); - copy.stack = stack.reverse(); - return copy; - } - // Otherwise use obj as the value of the new FastPath instance. - return new FastPath(obj); -}; -FPp.copy = function copy() { - var copy = Object.create(FastPath.prototype); - copy.stack = this.stack.slice(0); - return copy; -}; -// The name of the current property is always the penultimate element of -// this.stack, and always a String. -FPp.getName = function getName() { - var s = this.stack; - var len = s.length; - if (len > 1) { - return s[len - 2]; - } - // Since the name is always a string, null is a safe sentinel value to - // return if we do not know the name of the (root) value. - return null; -}; -// The value of the current property is always the final element of -// this.stack. -FPp.getValue = function getValue() { - var s = this.stack; - return s[s.length - 1]; -}; -FPp.valueIsDuplicate = function () { - var s = this.stack; - var valueIndex = s.length - 1; - return s.lastIndexOf(s[valueIndex], valueIndex - 1) >= 0; -}; -function getNodeHelper(path, count) { - var s = path.stack; - for (var i = s.length - 1; i >= 0; i -= 2) { - var value = s[i]; - if (n.Node.check(value) && --count < 0) { - return value; - } - } - return null; -} -FPp.getNode = function getNode(count) { - if (count === void 0) { count = 0; } - return getNodeHelper(this, ~~count); -}; -FPp.getParentNode = function getParentNode(count) { - if (count === void 0) { count = 0; } - return getNodeHelper(this, ~~count + 1); -}; -// The length of the stack can be either even or odd, depending on whether -// or not we have a name for the root value. The difference between the -// index of the root value and the index of the final value is always -// even, though, which allows us to return the root value in constant time -// (i.e. without iterating backwards through the stack). -FPp.getRootValue = function getRootValue() { - var s = this.stack; - if (s.length % 2 === 0) { - return s[1]; - } - return s[0]; -}; -// Temporarily push properties named by string arguments given after the -// callback function onto this.stack, then call the callback with a -// reference to this (modified) FastPath object. Note that the stack will -// be restored to its original state after the callback is finished, so it -// is probably a mistake to retain a reference to the path. -FPp.call = function call(callback /*, name1, name2, ... */) { - var s = this.stack; - var origLen = s.length; - var value = s[origLen - 1]; - var argc = arguments.length; - for (var i = 1; i < argc; ++i) { - var name = arguments[i]; - value = value[name]; - s.push(name, value); - } - var result = callback(this); - s.length = origLen; - return result; -}; -// Similar to FastPath.prototype.call, except that the value obtained by -// accessing this.getValue()[name1][name2]... should be array-like. The -// callback will be called with a reference to this path object for each -// element of the array. -FPp.each = function each(callback /*, name1, name2, ... */) { - var s = this.stack; - var origLen = s.length; - var value = s[origLen - 1]; - var argc = arguments.length; - for (var i = 1; i < argc; ++i) { - var name = arguments[i]; - value = value[name]; - s.push(name, value); - } - for (var i = 0; i < value.length; ++i) { - if (i in value) { - s.push(i, value[i]); - // If the callback needs to know the value of i, call - // path.getName(), assuming path is the parameter name. - callback(this); - s.length -= 2; - } - } - s.length = origLen; -}; -// Similar to FastPath.prototype.each, except that the results of the -// callback function invocations are stored in an array and returned at -// the end of the iteration. -FPp.map = function map(callback /*, name1, name2, ... */) { - var s = this.stack; - var origLen = s.length; - var value = s[origLen - 1]; - var argc = arguments.length; - for (var i = 1; i < argc; ++i) { - var name = arguments[i]; - value = value[name]; - s.push(name, value); - } - var result = new Array(value.length); - for (var i = 0; i < value.length; ++i) { - if (i in value) { - s.push(i, value[i]); - result[i] = callback(this, i); - s.length -= 2; - } - } - s.length = origLen; - return result; -}; -// Returns true if the node at the tip of the path is wrapped with -// parentheses, OR if the only reason the node needed parentheses was that -// it couldn't be the first expression in the enclosing statement (see -// FastPath#canBeFirstInStatement), and it has an opening `(` character. -// For example, the FunctionExpression in `(function(){}())` appears to -// need parentheses only because it's the first expression in the AST, but -// since it happens to be preceded by a `(` (which is not apparent from -// the AST but can be determined using FastPath#getPrevToken), there is no -// ambiguity about how to parse it, so it counts as having parentheses, -// even though it is not immediately followed by a `)`. -FPp.hasParens = function () { - var node = this.getNode(); - var prevToken = this.getPrevToken(node); - if (!prevToken) { - return false; - } - var nextToken = this.getNextToken(node); - if (!nextToken) { - return false; - } - if (prevToken.value === "(") { - if (nextToken.value === ")") { - // If the node preceded by a `(` token and followed by a `)` token, - // then of course it has parentheses. - return true; - } - // If this is one of the few Expression types that can't come first in - // the enclosing statement because of parsing ambiguities (namely, - // FunctionExpression, ObjectExpression, and ClassExpression) and - // this.firstInStatement() returns true, and the node would not need - // parentheses in an expression context because this.needsParens(true) - // returns false, then it just needs an opening parenthesis to resolve - // the parsing ambiguity that made it appear to need parentheses. - var justNeedsOpeningParen = !this.canBeFirstInStatement() && - this.firstInStatement() && - !this.needsParens(true); - if (justNeedsOpeningParen) { - return true; - } - } - return false; -}; -FPp.getPrevToken = function (node) { - node = node || this.getNode(); - var loc = node && node.loc; - var tokens = loc && loc.tokens; - if (tokens && loc.start.token > 0) { - var token = tokens[loc.start.token - 1]; - if (token) { - // Do not return tokens that fall outside the root subtree. - var rootLoc = this.getRootValue().loc; - if (util.comparePos(rootLoc.start, token.loc.start) <= 0) { - return token; - } - } - } - return null; -}; -FPp.getNextToken = function (node) { - node = node || this.getNode(); - var loc = node && node.loc; - var tokens = loc && loc.tokens; - if (tokens && loc.end.token < tokens.length) { - var token = tokens[loc.end.token]; - if (token) { - // Do not return tokens that fall outside the root subtree. - var rootLoc = this.getRootValue().loc; - if (util.comparePos(token.loc.end, rootLoc.end) <= 0) { - return token; - } - } - } - return null; -}; -// Inspired by require("ast-types").NodePath.prototype.needsParens, but -// more efficient because we're iterating backwards through a stack. -FPp.needsParens = function (assumeExpressionContext) { - var node = this.getNode(); - // This needs to come before `if (!parent) { return false }` because - // an object destructuring assignment requires parens for - // correctness even when it's the topmost expression. - if (node.type === "AssignmentExpression" && - node.left.type === "ObjectPattern") { - return true; - } - var parent = this.getParentNode(); - var name = this.getName(); - // If the value of this path is some child of a Node and not a Node - // itself, then it doesn't need parentheses. Only Node objects (in fact, - // only Expression nodes) need parentheses. - if (this.getValue() !== node) { - return false; - } - // Only statements don't need parentheses. - if (n.Statement.check(node)) { - return false; - } - // Identifiers never need parentheses. - if (node.type === "Identifier") { - return false; - } - if (parent && parent.type === "ParenthesizedExpression") { - return false; - } - if (node.extra && node.extra.parenthesized) { - return true; - } - if (!parent) - return false; - // Wrap e.g. `-1` in parentheses inside `(-1) ** 2`. - if (node.type === "UnaryExpression" && - parent.type === "BinaryExpression" && - name === "left" && - parent.left === node && - parent.operator === "**") { - return true; - } - switch (node.type) { - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - return (parent.type === "MemberExpression" && - name === "object" && - parent.object === node); - case "BinaryExpression": - case "LogicalExpression": - switch (parent.type) { - case "CallExpression": - return name === "callee" && parent.callee === node; - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - return true; - case "MemberExpression": - return name === "object" && parent.object === node; - case "BinaryExpression": - case "LogicalExpression": { - var po = parent.operator; - var pp = PRECEDENCE[po]; - var no = node.operator; - var np = PRECEDENCE[no]; - if (pp > np) { - return true; - } - if (pp === np && name === "right") { - (0, tiny_invariant_1.default)(parent.right === node); - return true; - } - break; - } - default: - return false; - } - break; - case "SequenceExpression": - switch (parent.type) { - case "ReturnStatement": - return false; - case "ForStatement": - // Although parentheses wouldn't hurt around sequence expressions in - // the head of for loops, traditional style dictates that e.g. i++, - // j++ should not be wrapped with parentheses. - return false; - case "ExpressionStatement": - return name !== "expression"; - default: - // Otherwise err on the side of overparenthesization, adding - // explicit exceptions above if this proves overzealous. - return true; - } - case "OptionalIndexedAccessType": - return node.optional && parent.type === "IndexedAccessType"; - case "IntersectionTypeAnnotation": - case "UnionTypeAnnotation": - return parent.type === "NullableTypeAnnotation"; - case "Literal": - return (parent.type === "MemberExpression" && - isNumber.check(node.value) && - name === "object" && - parent.object === node); - // Babel 6 Literal split - case "NumericLiteral": - return (parent.type === "MemberExpression" && - name === "object" && - parent.object === node); - case "YieldExpression": - case "AwaitExpression": - case "AssignmentExpression": - case "ConditionalExpression": - switch (parent.type) { - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - case "BinaryExpression": - case "LogicalExpression": - return true; - case "CallExpression": - case "NewExpression": - return name === "callee" && parent.callee === node; - case "ConditionalExpression": - return name === "test" && parent.test === node; - case "MemberExpression": - return name === "object" && parent.object === node; - default: - return false; - } - case "ArrowFunctionExpression": - if (n.CallExpression.check(parent) && - name === "callee" && - parent.callee === node) { - return true; - } - if (n.MemberExpression.check(parent) && - name === "object" && - parent.object === node) { - return true; - } - if (n.TSAsExpression && - n.TSAsExpression.check(parent) && - name === "expression" && - parent.expression === node) { - return true; - } - return isBinary(parent); - case "ObjectExpression": - if (parent.type === "ArrowFunctionExpression" && - name === "body" && - parent.body === node) { - return true; - } - break; - case "TSAsExpression": - if (parent.type === "ArrowFunctionExpression" && - name === "body" && - parent.body === node && - node.expression.type === "ObjectExpression") { - return true; - } - break; - case "CallExpression": - if (name === "declaration" && - n.ExportDefaultDeclaration.check(parent) && - n.FunctionExpression.check(node.callee)) { - return true; - } - } - if (parent.type === "NewExpression" && - name === "callee" && - parent.callee === node) { - return containsCallExpression(node); - } - if (assumeExpressionContext !== true && - !this.canBeFirstInStatement() && - this.firstInStatement()) { - return true; - } - return false; -}; -function isBinary(node) { - return n.BinaryExpression.check(node) || n.LogicalExpression.check(node); -} -// @ts-ignore 'isUnaryLike' is declared but its value is never read. [6133] -function isUnaryLike(node) { - return (n.UnaryExpression.check(node) || - // I considered making SpreadElement and SpreadProperty subtypes of - // UnaryExpression, but they're not really Expression nodes. - (n.SpreadElement && n.SpreadElement.check(node)) || - (n.SpreadProperty && n.SpreadProperty.check(node))); -} -function containsCallExpression(node) { - if (n.CallExpression.check(node)) { - return true; - } - if (isArray.check(node)) { - return node.some(containsCallExpression); - } - if (n.Node.check(node)) { - return types.someField(node, function (_name, child) { - return containsCallExpression(child); - }); - } - return false; -} -FPp.canBeFirstInStatement = function () { - var node = this.getNode(); - if (n.FunctionExpression.check(node)) { - return false; - } - if (n.ObjectExpression.check(node)) { - return false; - } - if (n.ClassExpression.check(node)) { - return false; - } - return true; -}; -FPp.firstInStatement = function () { - var s = this.stack; - var parentName, parent; - var childName, child; - for (var i = s.length - 1; i >= 0; i -= 2) { - if (n.Node.check(s[i])) { - childName = parentName; - child = parent; - parentName = s[i - 1]; - parent = s[i]; - } - if (!parent || !child) { - continue; - } - if (n.BlockStatement.check(parent) && - parentName === "body" && - childName === 0) { - (0, tiny_invariant_1.default)(parent.body[0] === child); - return true; - } - if (n.ExpressionStatement.check(parent) && childName === "expression") { - (0, tiny_invariant_1.default)(parent.expression === child); - return true; - } - if (n.AssignmentExpression.check(parent) && childName === "left") { - (0, tiny_invariant_1.default)(parent.left === child); - return true; - } - if (n.ArrowFunctionExpression.check(parent) && childName === "body") { - (0, tiny_invariant_1.default)(parent.body === child); - return true; - } - // s[i + 1] and s[i + 2] represent the array between the parent - // SequenceExpression node and its child nodes - if (n.SequenceExpression.check(parent) && - s[i + 1] === "expressions" && - childName === 0) { - (0, tiny_invariant_1.default)(parent.expressions[0] === child); - continue; - } - if (n.CallExpression.check(parent) && childName === "callee") { - (0, tiny_invariant_1.default)(parent.callee === child); - continue; - } - if (n.MemberExpression.check(parent) && childName === "object") { - (0, tiny_invariant_1.default)(parent.object === child); - continue; - } - if (n.ConditionalExpression.check(parent) && childName === "test") { - (0, tiny_invariant_1.default)(parent.test === child); - continue; - } - if (isBinary(parent) && childName === "left") { - (0, tiny_invariant_1.default)(parent.left === child); - continue; - } - if (n.UnaryExpression.check(parent) && - !parent.prefix && - childName === "argument") { - (0, tiny_invariant_1.default)(parent.argument === child); - continue; - } - return false; - } - return true; -}; -exports["default"] = FastPath; - - -/***/ }), - -/***/ "./node_modules/recast/lib/lines.js": -/*!******************************************!*\ - !*** ./node_modules/recast/lib/lines.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.concat = exports.fromString = exports.countSpaces = exports.Lines = void 0; -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var source_map_1 = tslib_1.__importDefault(__webpack_require__(/*! source-map */ "./node_modules/recast/node_modules/source-map/source-map.js")); -var options_1 = __webpack_require__(/*! ./options */ "./node_modules/recast/lib/options.js"); -var util_1 = __webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js"); -var mapping_1 = tslib_1.__importDefault(__webpack_require__(/*! ./mapping */ "./node_modules/recast/lib/mapping.js")); -var Lines = /** @class */ (function () { - function Lines(infos, sourceFileName) { - if (sourceFileName === void 0) { sourceFileName = null; } - this.infos = infos; - this.mappings = []; - this.cachedSourceMap = null; - this.cachedTabWidth = void 0; - (0, tiny_invariant_1.default)(infos.length > 0); - this.length = infos.length; - this.name = sourceFileName || null; - if (this.name) { - this.mappings.push(new mapping_1.default(this, { - start: this.firstPos(), - end: this.lastPos(), - })); - } - } - Lines.prototype.toString = function (options) { - return this.sliceString(this.firstPos(), this.lastPos(), options); - }; - Lines.prototype.getSourceMap = function (sourceMapName, sourceRoot) { - if (!sourceMapName) { - // Although we could make up a name or generate an anonymous - // source map, instead we assume that any consumer who does not - // provide a name does not actually want a source map. - return null; - } - var targetLines = this; - function updateJSON(json) { - json = json || {}; - json.file = sourceMapName; - if (sourceRoot) { - json.sourceRoot = sourceRoot; - } - return json; - } - if (targetLines.cachedSourceMap) { - // Since Lines objects are immutable, we can reuse any source map - // that was previously generated. Nevertheless, we return a new - // JSON object here to protect the cached source map from outside - // modification. - return updateJSON(targetLines.cachedSourceMap.toJSON()); - } - var smg = new source_map_1.default.SourceMapGenerator(updateJSON()); - var sourcesToContents = {}; - targetLines.mappings.forEach(function (mapping) { - var sourceCursor = mapping.sourceLines.skipSpaces(mapping.sourceLoc.start) || - mapping.sourceLines.lastPos(); - var targetCursor = targetLines.skipSpaces(mapping.targetLoc.start) || - targetLines.lastPos(); - while ((0, util_1.comparePos)(sourceCursor, mapping.sourceLoc.end) < 0 && - (0, util_1.comparePos)(targetCursor, mapping.targetLoc.end) < 0) { - var sourceChar = mapping.sourceLines.charAt(sourceCursor); - var targetChar = targetLines.charAt(targetCursor); - (0, tiny_invariant_1.default)(sourceChar === targetChar); - var sourceName = mapping.sourceLines.name; - // Add mappings one character at a time for maximum resolution. - smg.addMapping({ - source: sourceName, - original: { line: sourceCursor.line, column: sourceCursor.column }, - generated: { line: targetCursor.line, column: targetCursor.column }, - }); - if (!hasOwn.call(sourcesToContents, sourceName)) { - var sourceContent = mapping.sourceLines.toString(); - smg.setSourceContent(sourceName, sourceContent); - sourcesToContents[sourceName] = sourceContent; - } - targetLines.nextPos(targetCursor, true); - mapping.sourceLines.nextPos(sourceCursor, true); - } - }); - targetLines.cachedSourceMap = smg; - return smg.toJSON(); - }; - Lines.prototype.bootstrapCharAt = function (pos) { - (0, tiny_invariant_1.default)(typeof pos === "object"); - (0, tiny_invariant_1.default)(typeof pos.line === "number"); - (0, tiny_invariant_1.default)(typeof pos.column === "number"); - var line = pos.line, column = pos.column, strings = this.toString().split(lineTerminatorSeqExp), string = strings[line - 1]; - if (typeof string === "undefined") - return ""; - if (column === string.length && line < strings.length) - return "\n"; - if (column >= string.length) - return ""; - return string.charAt(column); - }; - Lines.prototype.charAt = function (pos) { - (0, tiny_invariant_1.default)(typeof pos === "object"); - (0, tiny_invariant_1.default)(typeof pos.line === "number"); - (0, tiny_invariant_1.default)(typeof pos.column === "number"); - var line = pos.line, column = pos.column, secret = this, infos = secret.infos, info = infos[line - 1], c = column; - if (typeof info === "undefined" || c < 0) - return ""; - var indent = this.getIndentAt(line); - if (c < indent) - return " "; - c += info.sliceStart - indent; - if (c === info.sliceEnd && line < this.length) - return "\n"; - if (c >= info.sliceEnd) - return ""; - return info.line.charAt(c); - }; - Lines.prototype.stripMargin = function (width, skipFirstLine) { - if (width === 0) - return this; - (0, tiny_invariant_1.default)(width > 0, "negative margin: " + width); - if (skipFirstLine && this.length === 1) - return this; - var lines = new Lines(this.infos.map(function (info, i) { - if (info.line && (i > 0 || !skipFirstLine)) { - info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: Math.max(0, info.indent - width) }); - } - return info; - })); - if (this.mappings.length > 0) { - var newMappings_1 = lines.mappings; - (0, tiny_invariant_1.default)(newMappings_1.length === 0); - this.mappings.forEach(function (mapping) { - newMappings_1.push(mapping.indent(width, skipFirstLine, true)); - }); - } - return lines; - }; - Lines.prototype.indent = function (by) { - if (by === 0) { - return this; - } - var lines = new Lines(this.infos.map(function (info) { - if (info.line && !info.locked) { - info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by }); - } - return info; - })); - if (this.mappings.length > 0) { - var newMappings_2 = lines.mappings; - (0, tiny_invariant_1.default)(newMappings_2.length === 0); - this.mappings.forEach(function (mapping) { - newMappings_2.push(mapping.indent(by)); - }); - } - return lines; - }; - Lines.prototype.indentTail = function (by) { - if (by === 0) { - return this; - } - if (this.length < 2) { - return this; - } - var lines = new Lines(this.infos.map(function (info, i) { - if (i > 0 && info.line && !info.locked) { - info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by }); - } - return info; - })); - if (this.mappings.length > 0) { - var newMappings_3 = lines.mappings; - (0, tiny_invariant_1.default)(newMappings_3.length === 0); - this.mappings.forEach(function (mapping) { - newMappings_3.push(mapping.indent(by, true)); - }); - } - return lines; - }; - Lines.prototype.lockIndentTail = function () { - if (this.length < 2) { - return this; - } - return new Lines(this.infos.map(function (info, i) { return (tslib_1.__assign(tslib_1.__assign({}, info), { locked: i > 0 })); })); - }; - Lines.prototype.getIndentAt = function (line) { - (0, tiny_invariant_1.default)(line >= 1, "no line " + line + " (line numbers start from 1)"); - return Math.max(this.infos[line - 1].indent, 0); - }; - Lines.prototype.guessTabWidth = function () { - if (typeof this.cachedTabWidth === "number") { - return this.cachedTabWidth; - } - var counts = []; // Sparse array. - var lastIndent = 0; - for (var line = 1, last = this.length; line <= last; ++line) { - var info = this.infos[line - 1]; - var sliced = info.line.slice(info.sliceStart, info.sliceEnd); - // Whitespace-only lines don't tell us much about the likely tab - // width of this code. - if (isOnlyWhitespace(sliced)) { - continue; - } - var diff = Math.abs(info.indent - lastIndent); - counts[diff] = ~~counts[diff] + 1; - lastIndent = info.indent; - } - var maxCount = -1; - var result = 2; - for (var tabWidth = 1; tabWidth < counts.length; tabWidth += 1) { - if (hasOwn.call(counts, tabWidth) && counts[tabWidth] > maxCount) { - maxCount = counts[tabWidth]; - result = tabWidth; - } - } - return (this.cachedTabWidth = result); - }; - // Determine if the list of lines has a first line that starts with a // - // or /* comment. If this is the case, the code may need to be wrapped in - // parens to avoid ASI issues. - Lines.prototype.startsWithComment = function () { - if (this.infos.length === 0) { - return false; - } - var firstLineInfo = this.infos[0], sliceStart = firstLineInfo.sliceStart, sliceEnd = firstLineInfo.sliceEnd, firstLine = firstLineInfo.line.slice(sliceStart, sliceEnd).trim(); - return (firstLine.length === 0 || - firstLine.slice(0, 2) === "//" || - firstLine.slice(0, 2) === "/*"); - }; - Lines.prototype.isOnlyWhitespace = function () { - return isOnlyWhitespace(this.toString()); - }; - Lines.prototype.isPrecededOnlyByWhitespace = function (pos) { - var info = this.infos[pos.line - 1]; - var indent = Math.max(info.indent, 0); - var diff = pos.column - indent; - if (diff <= 0) { - // If pos.column does not exceed the indentation amount, then - // there must be only whitespace before it. - return true; - } - var start = info.sliceStart; - var end = Math.min(start + diff, info.sliceEnd); - var prefix = info.line.slice(start, end); - return isOnlyWhitespace(prefix); - }; - Lines.prototype.getLineLength = function (line) { - var info = this.infos[line - 1]; - return this.getIndentAt(line) + info.sliceEnd - info.sliceStart; - }; - Lines.prototype.nextPos = function (pos, skipSpaces) { - if (skipSpaces === void 0) { skipSpaces = false; } - var l = Math.max(pos.line, 0), c = Math.max(pos.column, 0); - if (c < this.getLineLength(l)) { - pos.column += 1; - return skipSpaces ? !!this.skipSpaces(pos, false, true) : true; - } - if (l < this.length) { - pos.line += 1; - pos.column = 0; - return skipSpaces ? !!this.skipSpaces(pos, false, true) : true; - } - return false; - }; - Lines.prototype.prevPos = function (pos, skipSpaces) { - if (skipSpaces === void 0) { skipSpaces = false; } - var l = pos.line, c = pos.column; - if (c < 1) { - l -= 1; - if (l < 1) - return false; - c = this.getLineLength(l); - } - else { - c = Math.min(c - 1, this.getLineLength(l)); - } - pos.line = l; - pos.column = c; - return skipSpaces ? !!this.skipSpaces(pos, true, true) : true; - }; - Lines.prototype.firstPos = function () { - // Trivial, but provided for completeness. - return { line: 1, column: 0 }; - }; - Lines.prototype.lastPos = function () { - return { - line: this.length, - column: this.getLineLength(this.length), - }; - }; - Lines.prototype.skipSpaces = function (pos, backward, modifyInPlace) { - if (backward === void 0) { backward = false; } - if (modifyInPlace === void 0) { modifyInPlace = false; } - if (pos) { - pos = modifyInPlace - ? pos - : { - line: pos.line, - column: pos.column, - }; - } - else if (backward) { - pos = this.lastPos(); - } - else { - pos = this.firstPos(); - } - if (backward) { - while (this.prevPos(pos)) { - if (!isOnlyWhitespace(this.charAt(pos)) && this.nextPos(pos)) { - return pos; - } - } - return null; - } - else { - while (isOnlyWhitespace(this.charAt(pos))) { - if (!this.nextPos(pos)) { - return null; - } - } - return pos; - } - }; - Lines.prototype.trimLeft = function () { - var pos = this.skipSpaces(this.firstPos(), false, true); - return pos ? this.slice(pos) : emptyLines; - }; - Lines.prototype.trimRight = function () { - var pos = this.skipSpaces(this.lastPos(), true, true); - return pos ? this.slice(this.firstPos(), pos) : emptyLines; - }; - Lines.prototype.trim = function () { - var start = this.skipSpaces(this.firstPos(), false, true); - if (start === null) { - return emptyLines; - } - var end = this.skipSpaces(this.lastPos(), true, true); - if (end === null) { - return emptyLines; - } - return this.slice(start, end); - }; - Lines.prototype.eachPos = function (callback, startPos, skipSpaces) { - if (startPos === void 0) { startPos = this.firstPos(); } - if (skipSpaces === void 0) { skipSpaces = false; } - var pos = this.firstPos(); - if (startPos) { - (pos.line = startPos.line), (pos.column = startPos.column); - } - if (skipSpaces && !this.skipSpaces(pos, false, true)) { - return; // Encountered nothing but spaces. - } - do - callback.call(this, pos); - while (this.nextPos(pos, skipSpaces)); - }; - Lines.prototype.bootstrapSlice = function (start, end) { - var strings = this.toString() - .split(lineTerminatorSeqExp) - .slice(start.line - 1, end.line); - if (strings.length > 0) { - strings.push(strings.pop().slice(0, end.column)); - strings[0] = strings[0].slice(start.column); - } - return fromString(strings.join("\n")); - }; - Lines.prototype.slice = function (start, end) { - if (!end) { - if (!start) { - // The client seems to want a copy of this Lines object, but - // Lines objects are immutable, so it's perfectly adequate to - // return the same object. - return this; - } - // Slice to the end if no end position was provided. - end = this.lastPos(); - } - if (!start) { - throw new Error("cannot slice with end but not start"); - } - var sliced = this.infos.slice(start.line - 1, end.line); - if (start.line === end.line) { - sliced[0] = sliceInfo(sliced[0], start.column, end.column); - } - else { - (0, tiny_invariant_1.default)(start.line < end.line); - sliced[0] = sliceInfo(sliced[0], start.column); - sliced.push(sliceInfo(sliced.pop(), 0, end.column)); - } - var lines = new Lines(sliced); - if (this.mappings.length > 0) { - var newMappings_4 = lines.mappings; - (0, tiny_invariant_1.default)(newMappings_4.length === 0); - this.mappings.forEach(function (mapping) { - var sliced = mapping.slice(this, start, end); - if (sliced) { - newMappings_4.push(sliced); - } - }, this); - } - return lines; - }; - Lines.prototype.bootstrapSliceString = function (start, end, options) { - return this.slice(start, end).toString(options); - }; - Lines.prototype.sliceString = function (start, end, options) { - if (start === void 0) { start = this.firstPos(); } - if (end === void 0) { end = this.lastPos(); } - var _a = (0, options_1.normalize)(options), tabWidth = _a.tabWidth, useTabs = _a.useTabs, reuseWhitespace = _a.reuseWhitespace, lineTerminator = _a.lineTerminator; - var parts = []; - for (var line = start.line; line <= end.line; ++line) { - var info = this.infos[line - 1]; - if (line === start.line) { - if (line === end.line) { - info = sliceInfo(info, start.column, end.column); - } - else { - info = sliceInfo(info, start.column); - } - } - else if (line === end.line) { - info = sliceInfo(info, 0, end.column); - } - var indent = Math.max(info.indent, 0); - var before_1 = info.line.slice(0, info.sliceStart); - if (reuseWhitespace && - isOnlyWhitespace(before_1) && - countSpaces(before_1, tabWidth) === indent) { - // Reuse original spaces if the indentation is correct. - parts.push(info.line.slice(0, info.sliceEnd)); - continue; - } - var tabs = 0; - var spaces = indent; - if (useTabs) { - tabs = Math.floor(indent / tabWidth); - spaces -= tabs * tabWidth; - } - var result = ""; - if (tabs > 0) { - result += new Array(tabs + 1).join("\t"); - } - if (spaces > 0) { - result += new Array(spaces + 1).join(" "); - } - result += info.line.slice(info.sliceStart, info.sliceEnd); - parts.push(result); - } - return parts.join(lineTerminator); - }; - Lines.prototype.isEmpty = function () { - return this.length < 2 && this.getLineLength(1) < 1; - }; - Lines.prototype.join = function (elements) { - var separator = this; - var infos = []; - var mappings = []; - var prevInfo; - function appendLines(linesOrNull) { - if (linesOrNull === null) { - return; - } - if (prevInfo) { - var info = linesOrNull.infos[0]; - var indent = new Array(info.indent + 1).join(" "); - var prevLine_1 = infos.length; - var prevColumn_1 = Math.max(prevInfo.indent, 0) + - prevInfo.sliceEnd - - prevInfo.sliceStart; - prevInfo.line = - prevInfo.line.slice(0, prevInfo.sliceEnd) + - indent + - info.line.slice(info.sliceStart, info.sliceEnd); - // If any part of a line is indentation-locked, the whole line - // will be indentation-locked. - prevInfo.locked = prevInfo.locked || info.locked; - prevInfo.sliceEnd = prevInfo.line.length; - if (linesOrNull.mappings.length > 0) { - linesOrNull.mappings.forEach(function (mapping) { - mappings.push(mapping.add(prevLine_1, prevColumn_1)); - }); - } - } - else if (linesOrNull.mappings.length > 0) { - mappings.push.apply(mappings, linesOrNull.mappings); - } - linesOrNull.infos.forEach(function (info, i) { - if (!prevInfo || i > 0) { - prevInfo = tslib_1.__assign({}, info); - infos.push(prevInfo); - } - }); - } - function appendWithSeparator(linesOrNull, i) { - if (i > 0) - appendLines(separator); - appendLines(linesOrNull); - } - elements - .map(function (elem) { - var lines = fromString(elem); - if (lines.isEmpty()) - return null; - return lines; - }) - .forEach(function (linesOrNull, i) { - if (separator.isEmpty()) { - appendLines(linesOrNull); - } - else { - appendWithSeparator(linesOrNull, i); - } - }); - if (infos.length < 1) - return emptyLines; - var lines = new Lines(infos); - lines.mappings = mappings; - return lines; - }; - Lines.prototype.concat = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var list = [this]; - list.push.apply(list, args); - (0, tiny_invariant_1.default)(list.length === args.length + 1); - return emptyLines.join(list); - }; - return Lines; -}()); -exports.Lines = Lines; -var fromStringCache = {}; -var hasOwn = fromStringCache.hasOwnProperty; -var maxCacheKeyLen = 10; -function countSpaces(spaces, tabWidth) { - var count = 0; - var len = spaces.length; - for (var i = 0; i < len; ++i) { - switch (spaces.charCodeAt(i)) { - case 9: { - // '\t' - (0, tiny_invariant_1.default)(typeof tabWidth === "number"); - (0, tiny_invariant_1.default)(tabWidth > 0); - var next = Math.ceil(count / tabWidth) * tabWidth; - if (next === count) { - count += tabWidth; - } - else { - count = next; - } - break; - } - case 11: // '\v' - case 12: // '\f' - case 13: // '\r' - case 0xfeff: // zero-width non-breaking space - // These characters contribute nothing to indentation. - break; - case 32: // ' ' - default: - // Treat all other whitespace like ' '. - count += 1; - break; - } - } - return count; -} -exports.countSpaces = countSpaces; -var leadingSpaceExp = /^\s*/; -// As specified here: http://www.ecma-international.org/ecma-262/6.0/#sec-line-terminators -var lineTerminatorSeqExp = /\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/; -/** - * @param {Object} options - Options object that configures printing. - */ -function fromString(string, options) { - if (string instanceof Lines) - return string; - string += ""; - var tabWidth = options && options.tabWidth; - var tabless = string.indexOf("\t") < 0; - var cacheable = !options && tabless && string.length <= maxCacheKeyLen; - (0, tiny_invariant_1.default)(tabWidth || tabless, "No tab width specified but encountered tabs in string\n" + string); - if (cacheable && hasOwn.call(fromStringCache, string)) - return fromStringCache[string]; - var lines = new Lines(string.split(lineTerminatorSeqExp).map(function (line) { - // TODO: handle null exec result - var spaces = leadingSpaceExp.exec(line)[0]; - return { - line: line, - indent: countSpaces(spaces, tabWidth), - // Boolean indicating whether this line can be reindented. - locked: false, - sliceStart: spaces.length, - sliceEnd: line.length, - }; - }), (0, options_1.normalize)(options).sourceFileName); - if (cacheable) - fromStringCache[string] = lines; - return lines; -} -exports.fromString = fromString; -function isOnlyWhitespace(string) { - return !/\S/.test(string); -} -function sliceInfo(info, startCol, endCol) { - var sliceStart = info.sliceStart; - var sliceEnd = info.sliceEnd; - var indent = Math.max(info.indent, 0); - var lineLength = indent + sliceEnd - sliceStart; - if (typeof endCol === "undefined") { - endCol = lineLength; - } - startCol = Math.max(startCol, 0); - endCol = Math.min(endCol, lineLength); - endCol = Math.max(endCol, startCol); - if (endCol < indent) { - indent = endCol; - sliceEnd = sliceStart; - } - else { - sliceEnd -= lineLength - endCol; - } - lineLength = endCol; - lineLength -= startCol; - if (startCol < indent) { - indent -= startCol; - } - else { - startCol -= indent; - indent = 0; - sliceStart += startCol; - } - (0, tiny_invariant_1.default)(indent >= 0); - (0, tiny_invariant_1.default)(sliceStart <= sliceEnd); - (0, tiny_invariant_1.default)(lineLength === indent + sliceEnd - sliceStart); - if (info.indent === indent && - info.sliceStart === sliceStart && - info.sliceEnd === sliceEnd) { - return info; - } - return { - line: info.line, - indent: indent, - // A destructive slice always unlocks indentation. - locked: false, - sliceStart: sliceStart, - sliceEnd: sliceEnd, - }; -} -function concat(elements) { - return emptyLines.join(elements); -} -exports.concat = concat; -// The emptyLines object needs to be created all the way down here so that -// Lines.prototype will be fully populated. -var emptyLines = fromString(""); - - -/***/ }), - -/***/ "./node_modules/recast/lib/mapping.js": -/*!********************************************!*\ - !*** ./node_modules/recast/lib/mapping.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var util_1 = __webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js"); -var Mapping = /** @class */ (function () { - function Mapping(sourceLines, sourceLoc, targetLoc) { - if (targetLoc === void 0) { targetLoc = sourceLoc; } - this.sourceLines = sourceLines; - this.sourceLoc = sourceLoc; - this.targetLoc = targetLoc; - } - Mapping.prototype.slice = function (lines, start, end) { - if (end === void 0) { end = lines.lastPos(); } - var sourceLines = this.sourceLines; - var sourceLoc = this.sourceLoc; - var targetLoc = this.targetLoc; - function skip(name) { - var sourceFromPos = sourceLoc[name]; - var targetFromPos = targetLoc[name]; - var targetToPos = start; - if (name === "end") { - targetToPos = end; - } - else { - (0, tiny_invariant_1.default)(name === "start"); - } - return skipChars(sourceLines, sourceFromPos, lines, targetFromPos, targetToPos); - } - if ((0, util_1.comparePos)(start, targetLoc.start) <= 0) { - if ((0, util_1.comparePos)(targetLoc.end, end) <= 0) { - targetLoc = { - start: subtractPos(targetLoc.start, start.line, start.column), - end: subtractPos(targetLoc.end, start.line, start.column), - }; - // The sourceLoc can stay the same because the contents of the - // targetLoc have not changed. - } - else if ((0, util_1.comparePos)(end, targetLoc.start) <= 0) { - return null; - } - else { - sourceLoc = { - start: sourceLoc.start, - end: skip("end"), - }; - targetLoc = { - start: subtractPos(targetLoc.start, start.line, start.column), - end: subtractPos(end, start.line, start.column), - }; - } - } - else { - if ((0, util_1.comparePos)(targetLoc.end, start) <= 0) { - return null; - } - if ((0, util_1.comparePos)(targetLoc.end, end) <= 0) { - sourceLoc = { - start: skip("start"), - end: sourceLoc.end, - }; - targetLoc = { - // Same as subtractPos(start, start.line, start.column): - start: { line: 1, column: 0 }, - end: subtractPos(targetLoc.end, start.line, start.column), - }; - } - else { - sourceLoc = { - start: skip("start"), - end: skip("end"), - }; - targetLoc = { - // Same as subtractPos(start, start.line, start.column): - start: { line: 1, column: 0 }, - end: subtractPos(end, start.line, start.column), - }; - } - } - return new Mapping(this.sourceLines, sourceLoc, targetLoc); - }; - Mapping.prototype.add = function (line, column) { - return new Mapping(this.sourceLines, this.sourceLoc, { - start: addPos(this.targetLoc.start, line, column), - end: addPos(this.targetLoc.end, line, column), - }); - }; - Mapping.prototype.subtract = function (line, column) { - return new Mapping(this.sourceLines, this.sourceLoc, { - start: subtractPos(this.targetLoc.start, line, column), - end: subtractPos(this.targetLoc.end, line, column), - }); - }; - Mapping.prototype.indent = function (by, skipFirstLine, noNegativeColumns) { - if (skipFirstLine === void 0) { skipFirstLine = false; } - if (noNegativeColumns === void 0) { noNegativeColumns = false; } - if (by === 0) { - return this; - } - var targetLoc = this.targetLoc; - var startLine = targetLoc.start.line; - var endLine = targetLoc.end.line; - if (skipFirstLine && startLine === 1 && endLine === 1) { - return this; - } - targetLoc = { - start: targetLoc.start, - end: targetLoc.end, - }; - if (!skipFirstLine || startLine > 1) { - var startColumn = targetLoc.start.column + by; - targetLoc.start = { - line: startLine, - column: noNegativeColumns ? Math.max(0, startColumn) : startColumn, - }; - } - if (!skipFirstLine || endLine > 1) { - var endColumn = targetLoc.end.column + by; - targetLoc.end = { - line: endLine, - column: noNegativeColumns ? Math.max(0, endColumn) : endColumn, - }; - } - return new Mapping(this.sourceLines, this.sourceLoc, targetLoc); - }; - return Mapping; -}()); -exports["default"] = Mapping; -function addPos(toPos, line, column) { - return { - line: toPos.line + line - 1, - column: toPos.line === 1 ? toPos.column + column : toPos.column, - }; -} -function subtractPos(fromPos, line, column) { - return { - line: fromPos.line - line + 1, - column: fromPos.line === line ? fromPos.column - column : fromPos.column, - }; -} -function skipChars(sourceLines, sourceFromPos, targetLines, targetFromPos, targetToPos) { - var targetComparison = (0, util_1.comparePos)(targetFromPos, targetToPos); - if (targetComparison === 0) { - // Trivial case: no characters to skip. - return sourceFromPos; - } - var sourceCursor, targetCursor; - if (targetComparison < 0) { - // Skipping forward. - sourceCursor = - sourceLines.skipSpaces(sourceFromPos) || sourceLines.lastPos(); - targetCursor = - targetLines.skipSpaces(targetFromPos) || targetLines.lastPos(); - var lineDiff = targetToPos.line - targetCursor.line; - sourceCursor.line += lineDiff; - targetCursor.line += lineDiff; - if (lineDiff > 0) { - // If jumping to later lines, reset columns to the beginnings - // of those lines. - sourceCursor.column = 0; - targetCursor.column = 0; - } - else { - (0, tiny_invariant_1.default)(lineDiff === 0); - } - while ((0, util_1.comparePos)(targetCursor, targetToPos) < 0 && - targetLines.nextPos(targetCursor, true)) { - (0, tiny_invariant_1.default)(sourceLines.nextPos(sourceCursor, true)); - (0, tiny_invariant_1.default)(sourceLines.charAt(sourceCursor) === targetLines.charAt(targetCursor)); - } - } - else { - // Skipping backward. - sourceCursor = - sourceLines.skipSpaces(sourceFromPos, true) || sourceLines.firstPos(); - targetCursor = - targetLines.skipSpaces(targetFromPos, true) || targetLines.firstPos(); - var lineDiff = targetToPos.line - targetCursor.line; - sourceCursor.line += lineDiff; - targetCursor.line += lineDiff; - if (lineDiff < 0) { - // If jumping to earlier lines, reset columns to the ends of - // those lines. - sourceCursor.column = sourceLines.getLineLength(sourceCursor.line); - targetCursor.column = targetLines.getLineLength(targetCursor.line); - } - else { - (0, tiny_invariant_1.default)(lineDiff === 0); - } - while ((0, util_1.comparePos)(targetToPos, targetCursor) < 0 && - targetLines.prevPos(targetCursor, true)) { - (0, tiny_invariant_1.default)(sourceLines.prevPos(sourceCursor, true)); - (0, tiny_invariant_1.default)(sourceLines.charAt(sourceCursor) === targetLines.charAt(targetCursor)); - } - } - return sourceCursor; -} - - -/***/ }), - -/***/ "./node_modules/recast/lib/options.js": -/*!********************************************!*\ - !*** ./node_modules/recast/lib/options.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalize = void 0; -var util_1 = __webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js"); -var defaults = { - parser: __webpack_require__(/*! ../parsers/esprima */ "./node_modules/recast/parsers/esprima.js"), - tabWidth: 4, - useTabs: false, - reuseWhitespace: true, - lineTerminator: (0, util_1.getLineTerminator)(), - wrapColumn: 74, - sourceFileName: null, - sourceMapName: null, - sourceRoot: null, - inputSourceMap: null, - range: false, - tolerant: true, - quote: null, - trailingComma: false, - arrayBracketSpacing: false, - objectCurlySpacing: true, - arrowParensAlways: false, - flowObjectCommas: true, - tokens: true, -}; -var hasOwn = defaults.hasOwnProperty; -// Copy options and fill in default values. -function normalize(opts) { - var options = opts || defaults; - function get(key) { - return hasOwn.call(options, key) ? options[key] : defaults[key]; - } - return { - tabWidth: +get("tabWidth"), - useTabs: !!get("useTabs"), - reuseWhitespace: !!get("reuseWhitespace"), - lineTerminator: get("lineTerminator"), - wrapColumn: Math.max(get("wrapColumn"), 0), - sourceFileName: get("sourceFileName"), - sourceMapName: get("sourceMapName"), - sourceRoot: get("sourceRoot"), - inputSourceMap: get("inputSourceMap"), - parser: get("esprima") || get("parser"), - range: get("range"), - tolerant: get("tolerant"), - quote: get("quote"), - trailingComma: get("trailingComma"), - arrayBracketSpacing: get("arrayBracketSpacing"), - objectCurlySpacing: get("objectCurlySpacing"), - arrowParensAlways: get("arrowParensAlways"), - flowObjectCommas: get("flowObjectCommas"), - tokens: !!get("tokens"), - }; -} -exports.normalize = normalize; - - -/***/ }), - -/***/ "./node_modules/recast/lib/parser.js": -/*!*******************************************!*\ - !*** ./node_modules/recast/lib/parser.js ***! - \*******************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parse = void 0; -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var types = tslib_1.__importStar(__webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js")); -var b = types.builders; -var isObject = types.builtInTypes.object; -var isArray = types.builtInTypes.array; -var options_1 = __webpack_require__(/*! ./options */ "./node_modules/recast/lib/options.js"); -var lines_1 = __webpack_require__(/*! ./lines */ "./node_modules/recast/lib/lines.js"); -var comments_1 = __webpack_require__(/*! ./comments */ "./node_modules/recast/lib/comments.js"); -var util = tslib_1.__importStar(__webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js")); -function parse(source, options) { - options = (0, options_1.normalize)(options); - var lines = (0, lines_1.fromString)(source, options); - var sourceWithoutTabs = lines.toString({ - tabWidth: options.tabWidth, - reuseWhitespace: false, - useTabs: false, - }); - var comments = []; - var ast = options.parser.parse(sourceWithoutTabs, { - jsx: true, - loc: true, - locations: true, - range: options.range, - comment: true, - onComment: comments, - tolerant: util.getOption(options, "tolerant", true), - ecmaVersion: 6, - sourceType: util.getOption(options, "sourceType", "module"), - }); - // Use ast.tokens if possible, and otherwise fall back to the Esprima - // tokenizer. All the preconfigured ../parsers/* expose ast.tokens - // automatically, but custom parsers might need additional configuration - // to avoid this fallback. - var tokens = Array.isArray(ast.tokens) - ? ast.tokens - : (__webpack_require__(/*! esprima */ "./node_modules/esprima/dist/esprima.js").tokenize)(sourceWithoutTabs, { - loc: true, - }); - // We will reattach the tokens array to the file object below. - delete ast.tokens; - // Make sure every token has a token.value string. - tokens.forEach(function (token) { - if (typeof token.value !== "string") { - token.value = lines.sliceString(token.loc.start, token.loc.end); - } - }); - if (Array.isArray(ast.comments)) { - comments = ast.comments; - delete ast.comments; - } - if (ast.loc) { - // If the source was empty, some parsers give loc.{start,end}.line - // values of 0, instead of the minimum of 1. - util.fixFaultyLocations(ast, lines); - } - else { - ast.loc = { - start: lines.firstPos(), - end: lines.lastPos(), - }; - } - ast.loc.lines = lines; - ast.loc.indent = 0; - var file; - var program; - if (ast.type === "Program") { - program = ast; - // In order to ensure we reprint leading and trailing program - // comments, wrap the original Program node with a File node. Only - // ESTree parsers (Acorn and Esprima) return a Program as the root AST - // node. Most other (Babylon-like) parsers return a File. - file = b.file(ast, options.sourceFileName || null); - file.loc = { - start: lines.firstPos(), - end: lines.lastPos(), - lines: lines, - indent: 0, - }; - } - else if (ast.type === "File") { - file = ast; - program = file.program; - } - // Expose file.tokens unless the caller passed false for options.tokens. - if (options.tokens) { - file.tokens = tokens; - } - // Expand the Program's .loc to include all comments (not just those - // attached to the Program node, as its children may have comments as - // well), since sometimes program.loc.{start,end} will coincide with the - // .loc.{start,end} of the first and last *statements*, mistakenly - // excluding comments that fall outside that region. - var trueProgramLoc = util.getTrueLoc({ - type: program.type, - loc: program.loc, - body: [], - comments: comments, - }, lines); - program.loc.start = trueProgramLoc.start; - program.loc.end = trueProgramLoc.end; - // Passing file.program here instead of just file means that initial - // comments will be attached to program.body[0] instead of program. - (0, comments_1.attach)(comments, program.body.length ? file.program : file, lines); - // Return a copy of the original AST so that any changes made may be - // compared to the original. - return new TreeCopier(lines, tokens).copy(file); -} -exports.parse = parse; -var TreeCopier = function TreeCopier(lines, tokens) { - (0, tiny_invariant_1.default)(this instanceof TreeCopier); - this.lines = lines; - this.tokens = tokens; - this.startTokenIndex = 0; - this.endTokenIndex = tokens.length; - this.indent = 0; - this.seen = new Map(); -}; -var TCp = TreeCopier.prototype; -TCp.copy = function (node) { - if (this.seen.has(node)) { - return this.seen.get(node); - } - if (isArray.check(node)) { - var copy_1 = new Array(node.length); - this.seen.set(node, copy_1); - node.forEach(function (item, i) { - copy_1[i] = this.copy(item); - }, this); - return copy_1; - } - if (!isObject.check(node)) { - return node; - } - util.fixFaultyLocations(node, this.lines); - var copy = Object.create(Object.getPrototypeOf(node), { - original: { - // Provide a link from the copy to the original. - value: node, - configurable: false, - enumerable: false, - writable: true, - }, - }); - this.seen.set(node, copy); - var loc = node.loc; - var oldIndent = this.indent; - var newIndent = oldIndent; - var oldStartTokenIndex = this.startTokenIndex; - var oldEndTokenIndex = this.endTokenIndex; - if (loc) { - // When node is a comment, we set node.loc.indent to - // node.loc.start.column so that, when/if we print the comment by - // itself, we can strip that much whitespace from the left margin of - // the comment. This only really matters for multiline Block comments, - // but it doesn't hurt for Line comments. - if (node.type === "Block" || - node.type === "Line" || - node.type === "CommentBlock" || - node.type === "CommentLine" || - this.lines.isPrecededOnlyByWhitespace(loc.start)) { - newIndent = this.indent = loc.start.column; - } - // Every node.loc has a reference to the original source lines as well - // as a complete list of source tokens. - loc.lines = this.lines; - loc.tokens = this.tokens; - loc.indent = newIndent; - // Set loc.start.token and loc.end.token such that - // loc.tokens.slice(loc.start.token, loc.end.token) returns a list of - // all the tokens that make up this node. - this.findTokenRange(loc); - } - var keys = Object.keys(node); - var keyCount = keys.length; - for (var i = 0; i < keyCount; ++i) { - var key = keys[i]; - if (key === "loc") { - copy[key] = node[key]; - } - else if (key === "tokens" && node.type === "File") { - // Preserve file.tokens (uncopied) in case client code cares about - // it, even though Recast ignores it when reprinting. - copy[key] = node[key]; - } - else { - copy[key] = this.copy(node[key]); - } - } - this.indent = oldIndent; - this.startTokenIndex = oldStartTokenIndex; - this.endTokenIndex = oldEndTokenIndex; - return copy; -}; -// If we didn't have any idea where in loc.tokens to look for tokens -// contained by this loc, a binary search would be appropriate, but -// because we maintain this.startTokenIndex and this.endTokenIndex as we -// traverse the AST, we only need to make small (linear) adjustments to -// those indexes with each recursive iteration. -TCp.findTokenRange = function (loc) { - // In the unlikely event that loc.tokens[this.startTokenIndex] starts - // *after* loc.start, we need to rewind this.startTokenIndex first. - while (this.startTokenIndex > 0) { - var token = loc.tokens[this.startTokenIndex]; - if (util.comparePos(loc.start, token.loc.start) < 0) { - --this.startTokenIndex; - } - else - break; - } - // In the unlikely event that loc.tokens[this.endTokenIndex - 1] ends - // *before* loc.end, we need to fast-forward this.endTokenIndex first. - while (this.endTokenIndex < loc.tokens.length) { - var token = loc.tokens[this.endTokenIndex]; - if (util.comparePos(token.loc.end, loc.end) < 0) { - ++this.endTokenIndex; - } - else - break; - } - // Increment this.startTokenIndex until we've found the first token - // contained by this node. - while (this.startTokenIndex < this.endTokenIndex) { - var token = loc.tokens[this.startTokenIndex]; - if (util.comparePos(token.loc.start, loc.start) < 0) { - ++this.startTokenIndex; - } - else - break; - } - // Index into loc.tokens of the first token within this node. - loc.start.token = this.startTokenIndex; - // Decrement this.endTokenIndex until we've found the first token after - // this node (not contained by the node). - while (this.endTokenIndex > this.startTokenIndex) { - var token = loc.tokens[this.endTokenIndex - 1]; - if (util.comparePos(loc.end, token.loc.end) < 0) { - --this.endTokenIndex; - } - else - break; - } - // Index into loc.tokens of the first token *after* this node. - // If loc.start.token === loc.end.token, the node contains no tokens, - // and the index is that of the next token following this node. - loc.end.token = this.endTokenIndex; -}; - - -/***/ }), - -/***/ "./node_modules/recast/lib/patcher.js": -/*!********************************************!*\ - !*** ./node_modules/recast/lib/patcher.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getReprinter = exports.Patcher = void 0; -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var linesModule = tslib_1.__importStar(__webpack_require__(/*! ./lines */ "./node_modules/recast/lib/lines.js")); -var types = tslib_1.__importStar(__webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js")); -var Printable = types.namedTypes.Printable; -var Expression = types.namedTypes.Expression; -var ReturnStatement = types.namedTypes.ReturnStatement; -var SourceLocation = types.namedTypes.SourceLocation; -var util_1 = __webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js"); -var fast_path_1 = tslib_1.__importDefault(__webpack_require__(/*! ./fast-path */ "./node_modules/recast/lib/fast-path.js")); -var isObject = types.builtInTypes.object; -var isArray = types.builtInTypes.array; -var isString = types.builtInTypes.string; -var riskyAdjoiningCharExp = /[0-9a-z_$]/i; -var Patcher = function Patcher(lines) { - (0, tiny_invariant_1.default)(this instanceof Patcher); - (0, tiny_invariant_1.default)(lines instanceof linesModule.Lines); - var self = this, replacements = []; - self.replace = function (loc, lines) { - if (isString.check(lines)) - lines = linesModule.fromString(lines); - replacements.push({ - lines: lines, - start: loc.start, - end: loc.end, - }); - }; - self.get = function (loc) { - // If no location is provided, return the complete Lines object. - loc = loc || { - start: { line: 1, column: 0 }, - end: { line: lines.length, column: lines.getLineLength(lines.length) }, - }; - var sliceFrom = loc.start, toConcat = []; - function pushSlice(from, to) { - (0, tiny_invariant_1.default)((0, util_1.comparePos)(from, to) <= 0); - toConcat.push(lines.slice(from, to)); - } - replacements - .sort(function (a, b) { return (0, util_1.comparePos)(a.start, b.start); }) - .forEach(function (rep) { - if ((0, util_1.comparePos)(sliceFrom, rep.start) > 0) { - // Ignore nested replacement ranges. - } - else { - pushSlice(sliceFrom, rep.start); - toConcat.push(rep.lines); - sliceFrom = rep.end; - } - }); - pushSlice(sliceFrom, loc.end); - return linesModule.concat(toConcat); - }; -}; -exports.Patcher = Patcher; -var Pp = Patcher.prototype; -Pp.tryToReprintComments = function (newNode, oldNode, print) { - var patcher = this; - if (!newNode.comments && !oldNode.comments) { - // We were (vacuously) able to reprint all the comments! - return true; - } - var newPath = fast_path_1.default.from(newNode); - var oldPath = fast_path_1.default.from(oldNode); - newPath.stack.push("comments", getSurroundingComments(newNode)); - oldPath.stack.push("comments", getSurroundingComments(oldNode)); - var reprints = []; - var ableToReprintComments = findArrayReprints(newPath, oldPath, reprints); - // No need to pop anything from newPath.stack or oldPath.stack, since - // newPath and oldPath are fresh local variables. - if (ableToReprintComments && reprints.length > 0) { - reprints.forEach(function (reprint) { - var oldComment = reprint.oldPath.getValue(); - (0, tiny_invariant_1.default)(oldComment.leading || oldComment.trailing); - patcher.replace(oldComment.loc, - // Comments can't have .comments, so it doesn't matter whether we - // print with comments or without. - print(reprint.newPath).indentTail(oldComment.loc.indent)); - }); - } - return ableToReprintComments; -}; -// Get all comments that are either leading or trailing, ignoring any -// comments that occur inside node.loc. Returns an empty array for nodes -// with no leading or trailing comments. -function getSurroundingComments(node) { - var result = []; - if (node.comments && node.comments.length > 0) { - node.comments.forEach(function (comment) { - if (comment.leading || comment.trailing) { - result.push(comment); - } - }); - } - return result; -} -Pp.deleteComments = function (node) { - if (!node.comments) { - return; - } - var patcher = this; - node.comments.forEach(function (comment) { - if (comment.leading) { - // Delete leading comments along with any trailing whitespace they - // might have. - patcher.replace({ - start: comment.loc.start, - end: node.loc.lines.skipSpaces(comment.loc.end, false, false), - }, ""); - } - else if (comment.trailing) { - // Delete trailing comments along with any leading whitespace they - // might have. - patcher.replace({ - start: node.loc.lines.skipSpaces(comment.loc.start, true, false), - end: comment.loc.end, - }, ""); - } - }); -}; -function getReprinter(path) { - (0, tiny_invariant_1.default)(path instanceof fast_path_1.default); - // Make sure that this path refers specifically to a Node, rather than - // some non-Node subproperty of a Node. - var node = path.getValue(); - if (!Printable.check(node)) - return; - var orig = node.original; - var origLoc = orig && orig.loc; - var lines = origLoc && origLoc.lines; - var reprints = []; - if (!lines || !findReprints(path, reprints)) - return; - return function (print) { - var patcher = new Patcher(lines); - reprints.forEach(function (reprint) { - var newNode = reprint.newPath.getValue(); - var oldNode = reprint.oldPath.getValue(); - SourceLocation.assert(oldNode.loc, true); - var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print); - if (needToPrintNewPathWithComments) { - // Since we were not able to preserve all leading/trailing - // comments, we delete oldNode's comments, print newPath with - // comments, and then patch the resulting lines where oldNode used - // to be. - patcher.deleteComments(oldNode); - } - var newLines = print(reprint.newPath, { - includeComments: needToPrintNewPathWithComments, - // If the oldNode we're replacing already had parentheses, we may - // not need to print the new node with any extra parentheses, - // because the existing parentheses will suffice. However, if the - // newNode has a different type than the oldNode, let the printer - // decide if reprint.newPath needs parentheses, as usual. - avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens(), - }).indentTail(oldNode.loc.indent); - var nls = needsLeadingSpace(lines, oldNode.loc, newLines); - var nts = needsTrailingSpace(lines, oldNode.loc, newLines); - // If we try to replace the argument of a ReturnStatement like - // return"asdf" with e.g. a literal null expression, we run the risk - // of ending up with returnnull, so we need to add an extra leading - // space in situations where that might happen. Likewise for - // "asdf"in obj. See #170. - if (nls || nts) { - var newParts = []; - nls && newParts.push(" "); - newParts.push(newLines); - nts && newParts.push(" "); - newLines = linesModule.concat(newParts); - } - patcher.replace(oldNode.loc, newLines); - }); - // Recall that origLoc is the .loc of an ancestor node that is - // guaranteed to contain all the reprinted nodes and comments. - var patchedLines = patcher.get(origLoc).indentTail(-orig.loc.indent); - if (path.needsParens()) { - return linesModule.concat(["(", patchedLines, ")"]); - } - return patchedLines; - }; -} -exports.getReprinter = getReprinter; -// If the last character before oldLoc and the first character of newLines -// are both identifier characters, they must be separated by a space, -// otherwise they will most likely get fused together into a single token. -function needsLeadingSpace(oldLines, oldLoc, newLines) { - var posBeforeOldLoc = (0, util_1.copyPos)(oldLoc.start); - // The character just before the location occupied by oldNode. - var charBeforeOldLoc = oldLines.prevPos(posBeforeOldLoc) && oldLines.charAt(posBeforeOldLoc); - // First character of the reprinted node. - var newFirstChar = newLines.charAt(newLines.firstPos()); - return (charBeforeOldLoc && - riskyAdjoiningCharExp.test(charBeforeOldLoc) && - newFirstChar && - riskyAdjoiningCharExp.test(newFirstChar)); -} -// If the last character of newLines and the first character after oldLoc -// are both identifier characters, they must be separated by a space, -// otherwise they will most likely get fused together into a single token. -function needsTrailingSpace(oldLines, oldLoc, newLines) { - // The character just after the location occupied by oldNode. - var charAfterOldLoc = oldLines.charAt(oldLoc.end); - var newLastPos = newLines.lastPos(); - // Last character of the reprinted node. - var newLastChar = newLines.prevPos(newLastPos) && newLines.charAt(newLastPos); - return (newLastChar && - riskyAdjoiningCharExp.test(newLastChar) && - charAfterOldLoc && - riskyAdjoiningCharExp.test(charAfterOldLoc)); -} -function findReprints(newPath, reprints) { - var newNode = newPath.getValue(); - Printable.assert(newNode); - var oldNode = newNode.original; - Printable.assert(oldNode); - (0, tiny_invariant_1.default)(reprints.length === 0); - if (newNode.type !== oldNode.type) { - return false; - } - var oldPath = new fast_path_1.default(oldNode); - var canReprint = findChildReprints(newPath, oldPath, reprints); - if (!canReprint) { - // Make absolutely sure the calling code does not attempt to reprint - // any nodes. - reprints.length = 0; - } - return canReprint; -} -function findAnyReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - var oldNode = oldPath.getValue(); - if (newNode === oldNode) - return true; - if (isArray.check(newNode)) - return findArrayReprints(newPath, oldPath, reprints); - if (isObject.check(newNode)) - return findObjectReprints(newPath, oldPath, reprints); - return false; -} -function findArrayReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - var oldNode = oldPath.getValue(); - if (newNode === oldNode || - newPath.valueIsDuplicate() || - oldPath.valueIsDuplicate()) { - return true; - } - isArray.assert(newNode); - var len = newNode.length; - if (!(isArray.check(oldNode) && oldNode.length === len)) - return false; - for (var i = 0; i < len; ++i) { - newPath.stack.push(i, newNode[i]); - oldPath.stack.push(i, oldNode[i]); - var canReprint = findAnyReprints(newPath, oldPath, reprints); - newPath.stack.length -= 2; - oldPath.stack.length -= 2; - if (!canReprint) { - return false; - } - } - return true; -} -function findObjectReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - isObject.assert(newNode); - if (newNode.original === null) { - // If newNode.original node was set to null, reprint the node. - return false; - } - var oldNode = oldPath.getValue(); - if (!isObject.check(oldNode)) - return false; - if (newNode === oldNode || - newPath.valueIsDuplicate() || - oldPath.valueIsDuplicate()) { - return true; - } - if (Printable.check(newNode)) { - if (!Printable.check(oldNode)) { - return false; - } - var newParentNode = newPath.getParentNode(); - var oldParentNode = oldPath.getParentNode(); - if (oldParentNode !== null && - oldParentNode.type === "FunctionTypeAnnotation" && - newParentNode !== null && - newParentNode.type === "FunctionTypeAnnotation") { - var oldNeedsParens = oldParentNode.params.length !== 1 || !!oldParentNode.params[0].name; - var newNeedParens = newParentNode.params.length !== 1 || !!newParentNode.params[0].name; - if (!oldNeedsParens && newNeedParens) { - return false; - } - } - // Here we need to decide whether the reprinted code for newNode is - // appropriate for patching into the location of oldNode. - if (newNode.type === oldNode.type) { - var childReprints = []; - if (findChildReprints(newPath, oldPath, childReprints)) { - reprints.push.apply(reprints, childReprints); - } - else if (oldNode.loc) { - // If we have no .loc information for oldNode, then we won't be - // able to reprint it. - reprints.push({ - oldPath: oldPath.copy(), - newPath: newPath.copy(), - }); - } - else { - return false; - } - return true; - } - if (Expression.check(newNode) && - Expression.check(oldNode) && - // If we have no .loc information for oldNode, then we won't be - // able to reprint it. - oldNode.loc) { - // If both nodes are subtypes of Expression, then we should be able - // to fill the location occupied by the old node with code printed - // for the new node with no ill consequences. - reprints.push({ - oldPath: oldPath.copy(), - newPath: newPath.copy(), - }); - return true; - } - // The nodes have different types, and at least one of the types is - // not a subtype of the Expression type, so we cannot safely assume - // the nodes are syntactically interchangeable. - return false; - } - return findChildReprints(newPath, oldPath, reprints); -} -function findChildReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - var oldNode = oldPath.getValue(); - isObject.assert(newNode); - isObject.assert(oldNode); - if (newNode.original === null) { - // If newNode.original node was set to null, reprint the node. - return false; - } - // If this node needs parentheses and will not be wrapped with - // parentheses when reprinted, then return false to skip reprinting and - // let it be printed generically. - if (newPath.needsParens() && !oldPath.hasParens()) { - return false; - } - var keys = (0, util_1.getUnionOfKeys)(oldNode, newNode); - if (oldNode.type === "File" || newNode.type === "File") { - // Don't bother traversing file.tokens, an often very large array - // returned by Babylon, and useless for our purposes. - delete keys.tokens; - } - // Don't bother traversing .loc objects looking for reprintable nodes. - delete keys.loc; - var originalReprintCount = reprints.length; - for (var k in keys) { - if (k.charAt(0) === "_") { - // Ignore "private" AST properties added by e.g. Babel plugins and - // parsers like Babylon. - continue; - } - newPath.stack.push(k, types.getFieldValue(newNode, k)); - oldPath.stack.push(k, types.getFieldValue(oldNode, k)); - var canReprint = findAnyReprints(newPath, oldPath, reprints); - newPath.stack.length -= 2; - oldPath.stack.length -= 2; - if (!canReprint) { - return false; - } - } - // Return statements might end up running into ASI issues due to - // comments inserted deep within the tree, so reprint them if anything - // changed within them. - if (ReturnStatement.check(newPath.getNode()) && - reprints.length > originalReprintCount) { - return false; - } - return true; -} - - -/***/ }), - -/***/ "./node_modules/recast/lib/printer.js": -/*!********************************************!*\ - !*** ./node_modules/recast/lib/printer.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Printer = void 0; -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var types = tslib_1.__importStar(__webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js")); -var comments_1 = __webpack_require__(/*! ./comments */ "./node_modules/recast/lib/comments.js"); -var fast_path_1 = tslib_1.__importDefault(__webpack_require__(/*! ./fast-path */ "./node_modules/recast/lib/fast-path.js")); -var lines_1 = __webpack_require__(/*! ./lines */ "./node_modules/recast/lib/lines.js"); -var options_1 = __webpack_require__(/*! ./options */ "./node_modules/recast/lib/options.js"); -var patcher_1 = __webpack_require__(/*! ./patcher */ "./node_modules/recast/lib/patcher.js"); -var util = tslib_1.__importStar(__webpack_require__(/*! ./util */ "./node_modules/recast/lib/util.js")); -var namedTypes = types.namedTypes; -var isString = types.builtInTypes.string; -var isObject = types.builtInTypes.object; -var PrintResult = function PrintResult(code, sourceMap) { - (0, tiny_invariant_1.default)(this instanceof PrintResult); - isString.assert(code); - this.code = code; - if (sourceMap) { - isObject.assert(sourceMap); - this.map = sourceMap; - } -}; -var PRp = PrintResult.prototype; -var warnedAboutToString = false; -PRp.toString = function () { - if (!warnedAboutToString) { - console.warn("Deprecation warning: recast.print now returns an object with " + - "a .code property. You appear to be treating the object as a " + - "string, which might still work but is strongly discouraged."); - warnedAboutToString = true; - } - return this.code; -}; -var emptyPrintResult = new PrintResult(""); -var Printer = function Printer(config) { - (0, tiny_invariant_1.default)(this instanceof Printer); - var explicitTabWidth = config && config.tabWidth; - config = (0, options_1.normalize)(config); - // It's common for client code to pass the same options into both - // recast.parse and recast.print, but the Printer doesn't need (and - // can be confused by) config.sourceFileName, so we null it out. - config.sourceFileName = null; - // Non-destructively modifies options with overrides, and returns a - // new print function that uses the modified options. - function makePrintFunctionWith(options, overrides) { - options = Object.assign({}, options, overrides); - return function (path) { return print(path, options); }; - } - function print(path, options) { - (0, tiny_invariant_1.default)(path instanceof fast_path_1.default); - options = options || {}; - if (options.includeComments) { - return (0, comments_1.printComments)(path, makePrintFunctionWith(options, { - includeComments: false, - })); - } - var oldTabWidth = config.tabWidth; - if (!explicitTabWidth) { - var loc = path.getNode().loc; - if (loc && loc.lines && loc.lines.guessTabWidth) { - config.tabWidth = loc.lines.guessTabWidth(); - } - } - var reprinter = (0, patcher_1.getReprinter)(path); - var lines = reprinter - ? // Since the print function that we pass to the reprinter will - // be used to print "new" nodes, it's tempting to think we - // should pass printRootGenerically instead of print, to avoid - // calling maybeReprint again, but that would be a mistake - // because the new nodes might not be entirely new, but merely - // moved from elsewhere in the AST. The print function is the - // right choice because it gives us the opportunity to reprint - // such nodes using their original source. - reprinter(print) - : genericPrint(path, config, options, makePrintFunctionWith(options, { - includeComments: true, - avoidRootParens: false, - })); - config.tabWidth = oldTabWidth; - return lines; - } - this.print = function (ast) { - if (!ast) { - return emptyPrintResult; - } - var lines = print(fast_path_1.default.from(ast), { - includeComments: true, - avoidRootParens: false, - }); - return new PrintResult(lines.toString(config), util.composeSourceMaps(config.inputSourceMap, lines.getSourceMap(config.sourceMapName, config.sourceRoot))); - }; - this.printGenerically = function (ast) { - if (!ast) { - return emptyPrintResult; - } - // Print the entire AST generically. - function printGenerically(path) { - return (0, comments_1.printComments)(path, function (path) { - return genericPrint(path, config, { - includeComments: true, - avoidRootParens: false, - }, printGenerically); - }); - } - var path = fast_path_1.default.from(ast); - var oldReuseWhitespace = config.reuseWhitespace; - // Do not reuse whitespace (or anything else, for that matter) - // when printing generically. - config.reuseWhitespace = false; - // TODO Allow printing of comments? - var pr = new PrintResult(printGenerically(path).toString(config)); - config.reuseWhitespace = oldReuseWhitespace; - return pr; - }; -}; -exports.Printer = Printer; -function genericPrint(path, config, options, printPath) { - (0, tiny_invariant_1.default)(path instanceof fast_path_1.default); - var node = path.getValue(); - var parts = []; - var linesWithoutParens = genericPrintNoParens(path, config, printPath); - if (!node || linesWithoutParens.isEmpty()) { - return linesWithoutParens; - } - var shouldAddParens = false; - var decoratorsLines = printDecorators(path, printPath); - if (decoratorsLines.isEmpty()) { - // Nodes with decorators can't have parentheses, so we can avoid - // computing path.needsParens() except in this case. - if (!options.avoidRootParens) { - shouldAddParens = path.needsParens(); - } - } - else { - parts.push(decoratorsLines); - } - if (shouldAddParens) { - parts.unshift("("); - } - parts.push(linesWithoutParens); - if (shouldAddParens) { - parts.push(")"); - } - return (0, lines_1.concat)(parts); -} -// Note that the `options` parameter of this function is what other -// functions in this file call the `config` object (that is, the -// configuration object originally passed into the Printer constructor). -// Its properties are documented in lib/options.js. -function genericPrintNoParens(path, options, print) { - var _a, _b, _c; - var n = path.getValue(); - if (!n) { - return (0, lines_1.fromString)(""); - } - if (typeof n === "string") { - return (0, lines_1.fromString)(n, options); - } - namedTypes.Printable.assert(n); - var parts = []; - switch (n.type) { - case "File": - return path.call(print, "program"); - case "Program": - // Babel 6 - if (n.directives) { - path.each(function (childPath) { - parts.push(print(childPath), ";\n"); - }, "directives"); - } - if (n.interpreter) { - parts.push(path.call(print, "interpreter")); - } - parts.push(path.call(function (bodyPath) { return printStatementSequence(bodyPath, options, print); }, "body")); - return (0, lines_1.concat)(parts); - case "Noop": // Babel extension. - case "EmptyStatement": - return (0, lines_1.fromString)(""); - case "ExpressionStatement": - return (0, lines_1.concat)([path.call(print, "expression"), ";"]); - case "ParenthesizedExpression": // Babel extension. - return (0, lines_1.concat)(["(", path.call(print, "expression"), ")"]); - case "BinaryExpression": - case "LogicalExpression": - case "AssignmentExpression": - return (0, lines_1.fromString)(" ").join([ - path.call(print, "left"), - n.operator, - path.call(print, "right"), - ]); - case "AssignmentPattern": - return (0, lines_1.concat)([ - path.call(print, "left"), - " = ", - path.call(print, "right"), - ]); - case "MemberExpression": - case "OptionalMemberExpression": { - parts.push(path.call(print, "object")); - var property = path.call(print, "property"); - // Like n.optional, except with defaults applied, so optional - // defaults to true for OptionalMemberExpression nodes. - var optional = types.getFieldValue(n, "optional"); - if (n.computed) { - parts.push(optional ? "?.[" : "[", property, "]"); - } - else { - parts.push(optional ? "?." : ".", property); - } - return (0, lines_1.concat)(parts); - } - case "ChainExpression": - return path.call(print, "expression"); - case "MetaProperty": - return (0, lines_1.concat)([ - path.call(print, "meta"), - ".", - path.call(print, "property"), - ]); - case "BindExpression": - if (n.object) { - parts.push(path.call(print, "object")); - } - parts.push("::", path.call(print, "callee")); - return (0, lines_1.concat)(parts); - case "Path": - return (0, lines_1.fromString)(".").join(n.body); - case "Identifier": - return (0, lines_1.concat)([ - (0, lines_1.fromString)(n.name, options), - n.optional ? "?" : "", - path.call(print, "typeAnnotation"), - ]); - case "SpreadElement": - case "SpreadElementPattern": - case "RestProperty": // Babel 6 for ObjectPattern - case "SpreadProperty": - case "SpreadPropertyPattern": - case "ObjectTypeSpreadProperty": - case "RestElement": - return (0, lines_1.concat)([ - "...", - path.call(print, "argument"), - path.call(print, "typeAnnotation"), - ]); - case "FunctionDeclaration": - case "FunctionExpression": - case "TSDeclareFunction": - if (n.declare) { - parts.push("declare "); - } - if (n.async) { - parts.push("async "); - } - parts.push("function"); - if (n.generator) - parts.push("*"); - if (n.id) { - parts.push(" ", path.call(print, "id"), path.call(print, "typeParameters")); - } - else { - if (n.typeParameters) { - parts.push(path.call(print, "typeParameters")); - } - } - parts.push("(", printFunctionParams(path, options, print), ")", path.call(print, "returnType")); - if (n.body) { - parts.push(" ", path.call(print, "body")); - } - return (0, lines_1.concat)(parts); - case "ArrowFunctionExpression": - if (n.async) { - parts.push("async "); - } - if (n.typeParameters) { - parts.push(path.call(print, "typeParameters")); - } - if (!options.arrowParensAlways && - n.params.length === 1 && - !n.rest && - n.params[0].type === "Identifier" && - !n.params[0].typeAnnotation && - !n.returnType) { - parts.push(path.call(print, "params", 0)); - } - else { - parts.push("(", printFunctionParams(path, options, print), ")", path.call(print, "returnType")); - } - parts.push(" => ", path.call(print, "body")); - return (0, lines_1.concat)(parts); - case "MethodDefinition": - return printMethod(path, options, print); - case "YieldExpression": - parts.push("yield"); - if (n.delegate) - parts.push("*"); - if (n.argument) - parts.push(" ", path.call(print, "argument")); - return (0, lines_1.concat)(parts); - case "AwaitExpression": - parts.push("await"); - if (n.all) - parts.push("*"); - if (n.argument) - parts.push(" ", path.call(print, "argument")); - return (0, lines_1.concat)(parts); - case "ModuleExpression": - return (0, lines_1.concat)([ - "module {\n", - path.call(print, "body").indent(options.tabWidth), - "\n}", - ]); - case "ModuleDeclaration": - parts.push("module", path.call(print, "id")); - if (n.source) { - (0, tiny_invariant_1.default)(!n.body); - parts.push("from", path.call(print, "source")); - } - else { - parts.push(path.call(print, "body")); - } - return (0, lines_1.fromString)(" ").join(parts); - case "ImportSpecifier": - if (n.importKind && n.importKind !== "value") { - parts.push(n.importKind + " "); - } - if (n.imported) { - parts.push(path.call(print, "imported")); - if (n.local && n.local.name !== n.imported.name) { - parts.push(" as ", path.call(print, "local")); - } - } - else if (n.id) { - parts.push(path.call(print, "id")); - if (n.name) { - parts.push(" as ", path.call(print, "name")); - } - } - return (0, lines_1.concat)(parts); - case "ExportSpecifier": - if (n.exportKind && n.exportKind !== "value") { - parts.push(n.exportKind + " "); - } - if (n.local) { - parts.push(path.call(print, "local")); - if (n.exported && n.exported.name !== n.local.name) { - parts.push(" as ", path.call(print, "exported")); - } - } - else if (n.id) { - parts.push(path.call(print, "id")); - if (n.name) { - parts.push(" as ", path.call(print, "name")); - } - } - return (0, lines_1.concat)(parts); - case "ExportBatchSpecifier": - return (0, lines_1.fromString)("*"); - case "ImportNamespaceSpecifier": - parts.push("* as "); - if (n.local) { - parts.push(path.call(print, "local")); - } - else if (n.id) { - parts.push(path.call(print, "id")); - } - return (0, lines_1.concat)(parts); - case "ImportDefaultSpecifier": - if (n.local) { - return path.call(print, "local"); - } - return path.call(print, "id"); - case "TSExportAssignment": - return (0, lines_1.concat)(["export = ", path.call(print, "expression")]); - case "ExportDeclaration": - case "ExportDefaultDeclaration": - case "ExportNamedDeclaration": - return printExportDeclaration(path, options, print); - case "ExportAllDeclaration": - parts.push("export *"); - if (n.exported) { - parts.push(" as ", path.call(print, "exported")); - } - parts.push(" from ", path.call(print, "source"), ";"); - return (0, lines_1.concat)(parts); - case "TSNamespaceExportDeclaration": - parts.push("export as namespace ", path.call(print, "id")); - return maybeAddSemicolon((0, lines_1.concat)(parts)); - case "ExportNamespaceSpecifier": - return (0, lines_1.concat)(["* as ", path.call(print, "exported")]); - case "ExportDefaultSpecifier": - return path.call(print, "exported"); - case "Import": - return (0, lines_1.fromString)("import", options); - // Recast and ast-types currently support dynamic import(...) using - // either this dedicated ImportExpression type or a CallExpression - // whose callee has type Import. - // https://github.com/benjamn/ast-types/pull/365#issuecomment-605214486 - case "ImportExpression": - return (0, lines_1.concat)(["import(", path.call(print, "source"), ")"]); - case "ImportDeclaration": { - parts.push("import "); - if (n.importKind && n.importKind !== "value") { - parts.push(n.importKind + " "); - } - if (n.specifiers && n.specifiers.length > 0) { - var unbracedSpecifiers_1 = []; - var bracedSpecifiers_1 = []; - path.each(function (specifierPath) { - var spec = specifierPath.getValue(); - if (spec.type === "ImportSpecifier") { - bracedSpecifiers_1.push(print(specifierPath)); - } - else if (spec.type === "ImportDefaultSpecifier" || - spec.type === "ImportNamespaceSpecifier") { - unbracedSpecifiers_1.push(print(specifierPath)); - } - }, "specifiers"); - unbracedSpecifiers_1.forEach(function (lines, i) { - if (i > 0) { - parts.push(", "); - } - parts.push(lines); - }); - if (bracedSpecifiers_1.length > 0) { - var lines = (0, lines_1.fromString)(", ").join(bracedSpecifiers_1); - if (lines.getLineLength(1) > options.wrapColumn) { - lines = (0, lines_1.concat)([ - (0, lines_1.fromString)(",\n").join(bracedSpecifiers_1).indent(options.tabWidth), - ",", - ]); - } - if (unbracedSpecifiers_1.length > 0) { - parts.push(", "); - } - if (lines.length > 1) { - parts.push("{\n", lines, "\n}"); - } - else if (options.objectCurlySpacing) { - parts.push("{ ", lines, " }"); - } - else { - parts.push("{", lines, "}"); - } - } - parts.push(" from "); - } - parts.push(path.call(print, "source"), maybePrintImportAssertions(path, options, print), ";"); - return (0, lines_1.concat)(parts); - } - case "ImportAttribute": - return (0, lines_1.concat)([path.call(print, "key"), ": ", path.call(print, "value")]); - case "StaticBlock": - parts.push("static "); - // Intentionally fall through to BlockStatement below. - case "BlockStatement": { - var naked_1 = path.call(function (bodyPath) { return printStatementSequence(bodyPath, options, print); }, "body"); - if (naked_1.isEmpty()) { - if (!n.directives || n.directives.length === 0) { - parts.push("{}"); - return (0, lines_1.concat)(parts); - } - } - parts.push("{\n"); - // Babel 6 - if (n.directives) { - path.each(function (childPath) { - parts.push(maybeAddSemicolon(print(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : ""); - }, "directives"); - } - parts.push(naked_1.indent(options.tabWidth)); - parts.push("\n}"); - return (0, lines_1.concat)(parts); - } - case "ReturnStatement": { - parts.push("return"); - if (n.argument) { - var argIsJsxElement = ((_a = namedTypes.JSXElement) === null || _a === void 0 ? void 0 : _a.check(n.argument)) || - ((_b = namedTypes.JSXFragment) === null || _b === void 0 ? void 0 : _b.check(n.argument)); - var argLines = path.call(print, "argument"); - if (argLines.startsWithComment() || - (argLines.length > 1 && argIsJsxElement)) { - // Babel: regenerate parenthesized jsxElements so we don't double parentheses - if (argIsJsxElement && ((_c = n.argument.extra) === null || _c === void 0 ? void 0 : _c.parenthesized)) { - n.argument.extra.parenthesized = false; - argLines = path.call(print, "argument"); - n.argument.extra.parenthesized = true; - } - parts.push(" ", (0, lines_1.concat)(["(\n", argLines]).indentTail(options.tabWidth), "\n)"); - } - else { - parts.push(" ", argLines); - } - } - parts.push(";"); - return (0, lines_1.concat)(parts); - } - case "CallExpression": - case "OptionalCallExpression": - parts.push(path.call(print, "callee")); - if (n.typeParameters) { - parts.push(path.call(print, "typeParameters")); - } - if (n.typeArguments) { - parts.push(path.call(print, "typeArguments")); - } - // Like n.optional, but defaults to true for OptionalCallExpression - // nodes that are missing an n.optional property (unusual), - // according to the OptionalCallExpression definition in ast-types. - if (types.getFieldValue(n, "optional")) { - parts.push("?."); - } - parts.push(printArgumentsList(path, options, print)); - return (0, lines_1.concat)(parts); - case "RecordExpression": - parts.push("#"); - // Intentionally fall through to printing the object literal... - case "ObjectExpression": - case "ObjectPattern": - case "ObjectTypeAnnotation": { - var isTypeAnnotation_1 = n.type === "ObjectTypeAnnotation"; - var separator_1 = options.flowObjectCommas - ? "," - : isTypeAnnotation_1 - ? ";" - : ","; - var fields = []; - var allowBreak_1 = false; - if (isTypeAnnotation_1) { - fields.push("indexers", "callProperties"); - if (n.internalSlots != null) { - fields.push("internalSlots"); - } - } - fields.push("properties"); - var len_1 = 0; - fields.forEach(function (field) { - len_1 += n[field].length; - }); - var oneLine_1 = (isTypeAnnotation_1 && len_1 === 1) || len_1 === 0; - var leftBrace = n.exact ? "{|" : "{"; - var rightBrace = n.exact ? "|}" : "}"; - parts.push(oneLine_1 ? leftBrace : leftBrace + "\n"); - var leftBraceIndex = parts.length - 1; - var i_1 = 0; - fields.forEach(function (field) { - path.each(function (childPath) { - var lines = print(childPath); - if (!oneLine_1) { - lines = lines.indent(options.tabWidth); - } - var multiLine = !isTypeAnnotation_1 && lines.length > 1; - if (multiLine && allowBreak_1) { - // Similar to the logic for BlockStatement. - parts.push("\n"); - } - parts.push(lines); - if (i_1 < len_1 - 1) { - // Add an extra line break if the previous object property - // had a multi-line value. - parts.push(separator_1 + (multiLine ? "\n\n" : "\n")); - allowBreak_1 = !multiLine; - } - else if (len_1 !== 1 && isTypeAnnotation_1) { - parts.push(separator_1); - } - else if (!oneLine_1 && - util.isTrailingCommaEnabled(options, "objects") && - childPath.getValue().type !== "RestElement") { - parts.push(separator_1); - } - i_1++; - }, field); - }); - if (n.inexact) { - var line = (0, lines_1.fromString)("...", options); - if (oneLine_1) { - if (len_1 > 0) { - parts.push(separator_1, " "); - } - parts.push(line); - } - else { - // No trailing separator after ... to maintain parity with prettier. - parts.push("\n", line.indent(options.tabWidth)); - } - } - parts.push(oneLine_1 ? rightBrace : "\n" + rightBrace); - if (i_1 !== 0 && oneLine_1 && options.objectCurlySpacing) { - parts[leftBraceIndex] = leftBrace + " "; - parts[parts.length - 1] = " " + rightBrace; - } - if (n.typeAnnotation) { - parts.push(path.call(print, "typeAnnotation")); - } - return (0, lines_1.concat)(parts); - } - case "PropertyPattern": - return (0, lines_1.concat)([ - path.call(print, "key"), - ": ", - path.call(print, "pattern"), - ]); - case "ObjectProperty": // Babel 6 - case "Property": { - // Non-standard AST node type. - if (n.method || n.kind === "get" || n.kind === "set") { - return printMethod(path, options, print); - } - if (n.shorthand && n.value.type === "AssignmentPattern") { - return path.call(print, "value"); - } - var key = path.call(print, "key"); - if (n.computed) { - parts.push("[", key, "]"); - } - else { - parts.push(key); - } - if (!n.shorthand || n.key.name !== n.value.name) { - parts.push(": ", path.call(print, "value")); - } - return (0, lines_1.concat)(parts); - } - case "ClassMethod": // Babel 6 - case "ObjectMethod": // Babel 6 - case "ClassPrivateMethod": - case "TSDeclareMethod": - return printMethod(path, options, print); - case "PrivateName": - return (0, lines_1.concat)(["#", path.call(print, "id")]); - case "Decorator": - return (0, lines_1.concat)(["@", path.call(print, "expression")]); - case "TupleExpression": - parts.push("#"); - // Intentionally fall through to printing the tuple elements... - case "ArrayExpression": - case "ArrayPattern": { - var elems = n.elements; - var len_2 = elems.length; - var printed_1 = path.map(print, "elements"); - var joined = (0, lines_1.fromString)(", ").join(printed_1); - var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn; - if (oneLine_2) { - if (options.arrayBracketSpacing) { - parts.push("[ "); - } - else { - parts.push("["); - } - } - else { - parts.push("[\n"); - } - path.each(function (elemPath) { - var i = elemPath.getName(); - var elem = elemPath.getValue(); - if (!elem) { - // If the array expression ends with a hole, that hole - // will be ignored by the interpreter, but if it ends with - // two (or more) holes, we need to write out two (or more) - // commas so that the resulting code is interpreted with - // both (all) of the holes. - parts.push(","); - } - else { - var lines = printed_1[i]; - if (oneLine_2) { - if (i > 0) - parts.push(" "); - } - else { - lines = lines.indent(options.tabWidth); - } - parts.push(lines); - if (i < len_2 - 1 || - (!oneLine_2 && util.isTrailingCommaEnabled(options, "arrays"))) - parts.push(","); - if (!oneLine_2) - parts.push("\n"); - } - }, "elements"); - if (oneLine_2 && options.arrayBracketSpacing) { - parts.push(" ]"); - } - else { - parts.push("]"); - } - if (n.typeAnnotation) { - parts.push(path.call(print, "typeAnnotation")); - } - return (0, lines_1.concat)(parts); - } - case "SequenceExpression": - return (0, lines_1.fromString)(", ").join(path.map(print, "expressions")); - case "ThisExpression": - return (0, lines_1.fromString)("this"); - case "Super": - return (0, lines_1.fromString)("super"); - case "NullLiteral": // Babel 6 Literal split - return (0, lines_1.fromString)("null"); - case "RegExpLiteral": // Babel 6 Literal split - return (0, lines_1.fromString)(getPossibleRaw(n) || "/".concat(n.pattern, "/").concat(n.flags || ""), options); - case "BigIntLiteral": // Babel 7 Literal split - return (0, lines_1.fromString)(getPossibleRaw(n) || n.value + "n", options); - case "NumericLiteral": // Babel 6 Literal Split - return (0, lines_1.fromString)(getPossibleRaw(n) || n.value, options); - case "DecimalLiteral": - return (0, lines_1.fromString)(getPossibleRaw(n) || n.value + "m", options); - case "StringLiteral": - return (0, lines_1.fromString)(nodeStr(n.value, options)); - case "BooleanLiteral": // Babel 6 Literal split - case "Literal": - return (0, lines_1.fromString)(getPossibleRaw(n) || - (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options); - case "Directive": // Babel 6 - return path.call(print, "value"); - case "DirectiveLiteral": // Babel 6 - return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options); - case "InterpreterDirective": - return (0, lines_1.fromString)("#!".concat(n.value, "\n"), options); - case "ModuleSpecifier": - if (n.local) { - throw new Error("The ESTree ModuleSpecifier type should be abstract"); - } - // The Esprima ModuleSpecifier type is just a string-valued - // Literal identifying the imported-from module. - return (0, lines_1.fromString)(nodeStr(n.value, options), options); - case "UnaryExpression": - parts.push(n.operator); - if (/[a-z]$/.test(n.operator)) - parts.push(" "); - parts.push(path.call(print, "argument")); - return (0, lines_1.concat)(parts); - case "UpdateExpression": - parts.push(path.call(print, "argument"), n.operator); - if (n.prefix) - parts.reverse(); - return (0, lines_1.concat)(parts); - case "ConditionalExpression": - return (0, lines_1.concat)([ - path.call(print, "test"), - " ? ", - path.call(print, "consequent"), - " : ", - path.call(print, "alternate"), - ]); - case "NewExpression": { - parts.push("new ", path.call(print, "callee")); - if (n.typeParameters) { - parts.push(path.call(print, "typeParameters")); - } - if (n.typeArguments) { - parts.push(path.call(print, "typeArguments")); - } - var args = n.arguments; - if (args) { - parts.push(printArgumentsList(path, options, print)); - } - return (0, lines_1.concat)(parts); - } - case "VariableDeclaration": { - if (n.declare) { - parts.push("declare "); - } - parts.push(n.kind, " "); - var maxLen_1 = 0; - var printed = path.map(function (childPath) { - var lines = print(childPath); - maxLen_1 = Math.max(lines.length, maxLen_1); - return lines; - }, "declarations"); - if (maxLen_1 === 1) { - parts.push((0, lines_1.fromString)(", ").join(printed)); - } - else if (printed.length > 1) { - parts.push((0, lines_1.fromString)(",\n") - .join(printed) - .indentTail(n.kind.length + 1)); - } - else { - parts.push(printed[0]); - } - // We generally want to terminate all variable declarations with a - // semicolon, except when they are children of for loops. - var parentNode = path.getParentNode(); - if (!namedTypes.ForStatement.check(parentNode) && - !namedTypes.ForInStatement.check(parentNode) && - !(namedTypes.ForOfStatement && - namedTypes.ForOfStatement.check(parentNode)) && - !(namedTypes.ForAwaitStatement && - namedTypes.ForAwaitStatement.check(parentNode))) { - parts.push(";"); - } - return (0, lines_1.concat)(parts); - } - case "VariableDeclarator": - return n.init - ? (0, lines_1.fromString)(" = ").join([ - path.call(print, "id"), - path.call(print, "init"), - ]) - : path.call(print, "id"); - case "WithStatement": - return (0, lines_1.concat)([ - "with (", - path.call(print, "object"), - ") ", - path.call(print, "body"), - ]); - case "IfStatement": { - var con = adjustClause(path.call(print, "consequent"), options); - parts.push("if (", path.call(print, "test"), ")", con); - if (n.alternate) - parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path.call(print, "alternate"), options)); - return (0, lines_1.concat)(parts); - } - case "ForStatement": { - // TODO Get the for (;;) case right. - var init = path.call(print, "init"); - var sep = init.length > 1 ? ";\n" : "; "; - var forParen = "for ("; - var indented = (0, lines_1.fromString)(sep) - .join([init, path.call(print, "test"), path.call(print, "update")]) - .indentTail(forParen.length); - var head = (0, lines_1.concat)([forParen, indented, ")"]); - var clause = adjustClause(path.call(print, "body"), options); - parts.push(head); - if (head.length > 1) { - parts.push("\n"); - clause = clause.trimLeft(); - } - parts.push(clause); - return (0, lines_1.concat)(parts); - } - case "WhileStatement": - return (0, lines_1.concat)([ - "while (", - path.call(print, "test"), - ")", - adjustClause(path.call(print, "body"), options), - ]); - case "ForInStatement": - // Note: esprima can't actually parse "for each (". - return (0, lines_1.concat)([ - n.each ? "for each (" : "for (", - path.call(print, "left"), - " in ", - path.call(print, "right"), - ")", - adjustClause(path.call(print, "body"), options), - ]); - case "ForOfStatement": - case "ForAwaitStatement": - parts.push("for "); - if (n.await || n.type === "ForAwaitStatement") { - parts.push("await "); - } - parts.push("(", path.call(print, "left"), " of ", path.call(print, "right"), ")", adjustClause(path.call(print, "body"), options)); - return (0, lines_1.concat)(parts); - case "DoWhileStatement": { - var doBody = (0, lines_1.concat)([ - "do", - adjustClause(path.call(print, "body"), options), - ]); - parts.push(doBody); - if (endsWithBrace(doBody)) - parts.push(" while"); - else - parts.push("\nwhile"); - parts.push(" (", path.call(print, "test"), ");"); - return (0, lines_1.concat)(parts); - } - case "DoExpression": { - var statements = path.call(function (bodyPath) { return printStatementSequence(bodyPath, options, print); }, "body"); - return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]); - } - case "BreakStatement": - parts.push("break"); - if (n.label) - parts.push(" ", path.call(print, "label")); - parts.push(";"); - return (0, lines_1.concat)(parts); - case "ContinueStatement": - parts.push("continue"); - if (n.label) - parts.push(" ", path.call(print, "label")); - parts.push(";"); - return (0, lines_1.concat)(parts); - case "LabeledStatement": - return (0, lines_1.concat)([ - path.call(print, "label"), - ":\n", - path.call(print, "body"), - ]); - case "TryStatement": - parts.push("try ", path.call(print, "block")); - if (n.handler) { - parts.push(" ", path.call(print, "handler")); - } - else if (n.handlers) { - path.each(function (handlerPath) { - parts.push(" ", print(handlerPath)); - }, "handlers"); - } - if (n.finalizer) { - parts.push(" finally ", path.call(print, "finalizer")); - } - return (0, lines_1.concat)(parts); - case "CatchClause": - parts.push("catch "); - if (n.param) { - parts.push("(", path.call(print, "param")); - } - if (n.guard) { - // Note: esprima does not recognize conditional catch clauses. - parts.push(" if ", path.call(print, "guard")); - } - if (n.param) { - parts.push(") "); - } - parts.push(path.call(print, "body")); - return (0, lines_1.concat)(parts); - case "ThrowStatement": - return (0, lines_1.concat)(["throw ", path.call(print, "argument"), ";"]); - case "SwitchStatement": - return (0, lines_1.concat)([ - "switch (", - path.call(print, "discriminant"), - ") {\n", - (0, lines_1.fromString)("\n").join(path.map(print, "cases")), - "\n}", - ]); - // Note: ignoring n.lexical because it has no printing consequences. - case "SwitchCase": - if (n.test) - parts.push("case ", path.call(print, "test"), ":"); - else - parts.push("default:"); - if (n.consequent.length > 0) { - parts.push("\n", path - .call(function (consequentPath) { - return printStatementSequence(consequentPath, options, print); - }, "consequent") - .indent(options.tabWidth)); - } - return (0, lines_1.concat)(parts); - case "DebuggerStatement": - return (0, lines_1.fromString)("debugger;"); - // JSX extensions below. - case "JSXAttribute": - parts.push(path.call(print, "name")); - if (n.value) - parts.push("=", path.call(print, "value")); - return (0, lines_1.concat)(parts); - case "JSXIdentifier": - return (0, lines_1.fromString)(n.name, options); - case "JSXNamespacedName": - return (0, lines_1.fromString)(":").join([ - path.call(print, "namespace"), - path.call(print, "name"), - ]); - case "JSXMemberExpression": - return (0, lines_1.fromString)(".").join([ - path.call(print, "object"), - path.call(print, "property"), - ]); - case "JSXSpreadAttribute": - return (0, lines_1.concat)(["{...", path.call(print, "argument"), "}"]); - case "JSXSpreadChild": - return (0, lines_1.concat)(["{...", path.call(print, "expression"), "}"]); - case "JSXExpressionContainer": - return (0, lines_1.concat)(["{", path.call(print, "expression"), "}"]); - case "JSXElement": - case "JSXFragment": { - var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment"); - var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment"); - var openingLines = path.call(print, openingPropName); - if (n[openingPropName].selfClosing) { - (0, tiny_invariant_1.default)(!n[closingPropName], "unexpected " + - closingPropName + - " element in self-closing " + - n.type); - return openingLines; - } - var childLines = (0, lines_1.concat)(path.map(function (childPath) { - var child = childPath.getValue(); - if (namedTypes.Literal.check(child) && - typeof child.value === "string") { - if (/\S/.test(child.value)) { - return child.value.replace(/^\s+/g, ""); - } - else if (/\n/.test(child.value)) { - return "\n"; - } - } - return print(childPath); - }, "children")).indentTail(options.tabWidth); - var closingLines = path.call(print, closingPropName); - return (0, lines_1.concat)([openingLines, childLines, closingLines]); - } - case "JSXOpeningElement": { - parts.push("<", path.call(print, "name")); - var typeDefPart = path.call(print, "typeParameters"); - if (typeDefPart.length) - parts.push(typeDefPart); - var attrParts_1 = []; - path.each(function (attrPath) { - attrParts_1.push(" ", print(attrPath)); - }, "attributes"); - var attrLines = (0, lines_1.concat)(attrParts_1); - var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn; - if (needLineWrap) { - attrParts_1.forEach(function (part, i) { - if (part === " ") { - (0, tiny_invariant_1.default)(i % 2 === 0); - attrParts_1[i] = "\n"; - } - }); - attrLines = (0, lines_1.concat)(attrParts_1).indentTail(options.tabWidth); - } - parts.push(attrLines, n.selfClosing ? " />" : ">"); - return (0, lines_1.concat)(parts); - } - case "JSXClosingElement": - return (0, lines_1.concat)([""]); - case "JSXOpeningFragment": - return (0, lines_1.fromString)("<>"); - case "JSXClosingFragment": - return (0, lines_1.fromString)(""); - case "JSXText": - return (0, lines_1.fromString)(n.value, options); - case "JSXEmptyExpression": - return (0, lines_1.fromString)(""); - case "TypeAnnotatedIdentifier": - return (0, lines_1.concat)([ - path.call(print, "annotation"), - " ", - path.call(print, "identifier"), - ]); - case "ClassBody": - if (n.body.length === 0) { - return (0, lines_1.fromString)("{}"); - } - return (0, lines_1.concat)([ - "{\n", - path - .call(function (bodyPath) { return printStatementSequence(bodyPath, options, print); }, "body") - .indent(options.tabWidth), - "\n}", - ]); - case "ClassPropertyDefinition": - parts.push("static ", path.call(print, "definition")); - if (!namedTypes.MethodDefinition.check(n.definition)) - parts.push(";"); - return (0, lines_1.concat)(parts); - case "ClassProperty": { - if (n.declare) { - parts.push("declare "); - } - var access = n.accessibility || n.access; - if (typeof access === "string") { - parts.push(access, " "); - } - if (n.static) { - parts.push("static "); - } - if (n.abstract) { - parts.push("abstract "); - } - if (n.readonly) { - parts.push("readonly "); - } - var key = path.call(print, "key"); - if (n.computed) { - key = (0, lines_1.concat)(["[", key, "]"]); - } - if (n.variance) { - key = (0, lines_1.concat)([printVariance(path, print), key]); - } - parts.push(key); - if (n.optional) { - parts.push("?"); - } - if (n.definite) { - parts.push("!"); - } - if (n.typeAnnotation) { - parts.push(path.call(print, "typeAnnotation")); - } - if (n.value) { - parts.push(" = ", path.call(print, "value")); - } - parts.push(";"); - return (0, lines_1.concat)(parts); - } - case "ClassPrivateProperty": - if (n.static) { - parts.push("static "); - } - parts.push(path.call(print, "key")); - if (n.typeAnnotation) { - parts.push(path.call(print, "typeAnnotation")); - } - if (n.value) { - parts.push(" = ", path.call(print, "value")); - } - parts.push(";"); - return (0, lines_1.concat)(parts); - case "ClassAccessorProperty": { - parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false)); - if (n.computed) { - parts.push("[", path.call(print, "key"), "]"); - } - else { - parts.push(path.call(print, "key")); - } - if (n.optional) { - parts.push("?"); - } - if (n.definite) { - parts.push("!"); - } - if (n.typeAnnotation) { - parts.push(path.call(print, "typeAnnotation")); - } - if (n.value) { - parts.push(" = ", path.call(print, "value")); - } - parts.push(";"); - return (0, lines_1.concat)(parts); - } - case "ClassDeclaration": - case "ClassExpression": - case "DeclareClass": - if (n.declare) { - parts.push("declare "); - } - if (n.abstract) { - parts.push("abstract "); - } - parts.push("class"); - if (n.id) { - parts.push(" ", path.call(print, "id")); - } - if (n.typeParameters) { - parts.push(path.call(print, "typeParameters")); - } - if (n.superClass) { - // ClassDeclaration and ClassExpression only - parts.push(" extends ", path.call(print, "superClass"), path.call(print, "superTypeParameters")); - } - if (n.extends && n.extends.length > 0) { - // DeclareClass only - parts.push(" extends ", (0, lines_1.fromString)(", ").join(path.map(print, "extends"))); - } - if (n["implements"] && n["implements"].length > 0) { - parts.push(" implements ", (0, lines_1.fromString)(", ").join(path.map(print, "implements"))); - } - parts.push(" ", path.call(print, "body")); - if (n.type === "DeclareClass") { - return printFlowDeclaration(path, parts); - } - else { - return (0, lines_1.concat)(parts); - } - case "TemplateElement": - return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail(); - case "TemplateLiteral": { - var expressions_1 = path.map(print, "expressions"); - parts.push("`"); - path.each(function (childPath) { - var i = childPath.getName(); - parts.push(print(childPath)); - if (i < expressions_1.length) { - parts.push("${", expressions_1[i], "}"); - } - }, "quasis"); - parts.push("`"); - return (0, lines_1.concat)(parts).lockIndentTail(); - } - case "TaggedTemplateExpression": - parts.push(path.call(print, "tag")); - if (n.typeParameters) { - parts.push(path.call(print, "typeParameters")); - } - parts.push(path.call(print, "quasi")); - return (0, lines_1.concat)(parts); - // These types are unprintable because they serve as abstract - // supertypes for other (printable) types. - case "Node": - case "Printable": - case "SourceLocation": - case "Position": - case "Statement": - case "Function": - case "Pattern": - case "Expression": - case "Declaration": - case "Specifier": - case "NamedSpecifier": - case "Comment": // Supertype of Block and Line - case "Flow": // Supertype of all Flow AST node types - case "FlowType": // Supertype of all Flow types - case "FlowPredicate": // Supertype of InferredPredicate and DeclaredPredicate - case "MemberTypeAnnotation": // Flow - case "Type": // Flow - case "TSHasOptionalTypeParameterInstantiation": - case "TSHasOptionalTypeParameters": - case "TSHasOptionalTypeAnnotation": - case "ChainElement": // Supertype of MemberExpression and CallExpression - throw new Error("unprintable type: " + JSON.stringify(n.type)); - case "CommentBlock": // Babel block comment. - case "Block": // Esprima block comment. - return (0, lines_1.concat)(["/*", (0, lines_1.fromString)(n.value, options), "*/"]); - case "CommentLine": // Babel line comment. - case "Line": // Esprima line comment. - return (0, lines_1.concat)(["//", (0, lines_1.fromString)(n.value, options)]); - // Type Annotations for Facebook Flow, typically stripped out or - // transformed away before printing. - case "TypeAnnotation": - if (n.typeAnnotation) { - if (n.typeAnnotation.type !== "FunctionTypeAnnotation") { - parts.push(": "); - } - parts.push(path.call(print, "typeAnnotation")); - return (0, lines_1.concat)(parts); - } - return (0, lines_1.fromString)(""); - case "ExistentialTypeParam": - case "ExistsTypeAnnotation": - return (0, lines_1.fromString)("*", options); - case "EmptyTypeAnnotation": - return (0, lines_1.fromString)("empty", options); - case "AnyTypeAnnotation": - return (0, lines_1.fromString)("any", options); - case "MixedTypeAnnotation": - return (0, lines_1.fromString)("mixed", options); - case "ArrayTypeAnnotation": - return (0, lines_1.concat)([path.call(print, "elementType"), "[]"]); - case "TupleTypeAnnotation": { - var printed_2 = path.map(print, "types"); - var joined = (0, lines_1.fromString)(", ").join(printed_2); - var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn; - if (oneLine_3) { - if (options.arrayBracketSpacing) { - parts.push("[ "); - } - else { - parts.push("["); - } - } - else { - parts.push("[\n"); - } - path.each(function (elemPath) { - var i = elemPath.getName(); - var elem = elemPath.getValue(); - if (!elem) { - // If the array expression ends with a hole, that hole - // will be ignored by the interpreter, but if it ends with - // two (or more) holes, we need to write out two (or more) - // commas so that the resulting code is interpreted with - // both (all) of the holes. - parts.push(","); - } - else { - var lines = printed_2[i]; - if (oneLine_3) { - if (i > 0) - parts.push(" "); - } - else { - lines = lines.indent(options.tabWidth); - } - parts.push(lines); - if (i < n.types.length - 1 || - (!oneLine_3 && util.isTrailingCommaEnabled(options, "arrays"))) - parts.push(","); - if (!oneLine_3) - parts.push("\n"); - } - }, "types"); - if (oneLine_3 && options.arrayBracketSpacing) { - parts.push(" ]"); - } - else { - parts.push("]"); - } - return (0, lines_1.concat)(parts); - } - case "BooleanTypeAnnotation": - return (0, lines_1.fromString)("boolean", options); - case "BooleanLiteralTypeAnnotation": - (0, tiny_invariant_1.default)(typeof n.value === "boolean"); - return (0, lines_1.fromString)("" + n.value, options); - case "InterfaceTypeAnnotation": - parts.push("interface"); - if (n.extends && n.extends.length > 0) { - parts.push(" extends ", (0, lines_1.fromString)(", ").join(path.map(print, "extends"))); - } - parts.push(" ", path.call(print, "body")); - return (0, lines_1.concat)(parts); - case "DeclareFunction": - return printFlowDeclaration(path, [ - "function ", - path.call(print, "id"), - ";", - ]); - case "DeclareModule": - return printFlowDeclaration(path, [ - "module ", - path.call(print, "id"), - " ", - path.call(print, "body"), - ]); - case "DeclareModuleExports": - return printFlowDeclaration(path, [ - "module.exports", - path.call(print, "typeAnnotation"), - ]); - case "DeclareVariable": - return printFlowDeclaration(path, ["var ", path.call(print, "id"), ";"]); - case "DeclareExportDeclaration": - case "DeclareExportAllDeclaration": - return (0, lines_1.concat)(["declare ", printExportDeclaration(path, options, print)]); - case "EnumDeclaration": - return (0, lines_1.concat)([ - "enum ", - path.call(print, "id"), - path.call(print, "body"), - ]); - case "EnumBooleanBody": - case "EnumNumberBody": - case "EnumStringBody": - case "EnumSymbolBody": { - if (n.type === "EnumSymbolBody" || n.explicitType) { - parts.push(" of ", - // EnumBooleanBody => boolean, etc. - n.type.slice(4, -4).toLowerCase()); - } - parts.push(" {\n", (0, lines_1.fromString)("\n") - .join(path.map(print, "members")) - .indent(options.tabWidth), "\n}"); - return (0, lines_1.concat)(parts); - } - case "EnumDefaultedMember": - return (0, lines_1.concat)([path.call(print, "id"), ","]); - case "EnumBooleanMember": - case "EnumNumberMember": - case "EnumStringMember": - return (0, lines_1.concat)([ - path.call(print, "id"), - " = ", - path.call(print, "init"), - ",", - ]); - case "InferredPredicate": - return (0, lines_1.fromString)("%checks", options); - case "DeclaredPredicate": - return (0, lines_1.concat)(["%checks(", path.call(print, "value"), ")"]); - case "FunctionTypeAnnotation": { - // FunctionTypeAnnotation is ambiguous: - // declare function(a: B): void; OR - // const A: (a: B) => void; - var parent = path.getParentNode(0); - var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || - (namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method) || - namedTypes.DeclareFunction.check(path.getParentNode(2))); - var needsColon = isArrowFunctionTypeAnnotation && - !namedTypes.FunctionTypeParam.check(parent) && - !namedTypes.TypeAlias.check(parent); - if (needsColon) { - parts.push(": "); - } - var hasTypeParameters = !!n.typeParameters; - var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name; - parts.push(hasTypeParameters ? path.call(print, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path, options, print), needsParens ? ")" : ""); - // The returnType is not wrapped in a TypeAnnotation, so the colon - // needs to be added separately. - if (n.returnType) { - parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path.call(print, "returnType")); - } - return (0, lines_1.concat)(parts); - } - case "FunctionTypeParam": { - var name = path.call(print, "name"); - parts.push(name); - if (n.optional) { - parts.push("?"); - } - if (name.infos[0].line) { - parts.push(": "); - } - parts.push(path.call(print, "typeAnnotation")); - return (0, lines_1.concat)(parts); - } - case "GenericTypeAnnotation": - return (0, lines_1.concat)([ - path.call(print, "id"), - path.call(print, "typeParameters"), - ]); - case "DeclareInterface": - parts.push("declare "); - // Fall through to InterfaceDeclaration... - case "InterfaceDeclaration": - case "TSInterfaceDeclaration": - if (n.declare) { - parts.push("declare "); - } - parts.push("interface ", path.call(print, "id"), path.call(print, "typeParameters"), " "); - if (n["extends"] && n["extends"].length > 0) { - parts.push("extends ", (0, lines_1.fromString)(", ").join(path.map(print, "extends")), " "); - } - if (n.body) { - parts.push(path.call(print, "body")); - } - return (0, lines_1.concat)(parts); - case "ClassImplements": - case "InterfaceExtends": - return (0, lines_1.concat)([ - path.call(print, "id"), - path.call(print, "typeParameters"), - ]); - case "IntersectionTypeAnnotation": - return (0, lines_1.fromString)(" & ").join(path.map(print, "types")); - case "NullableTypeAnnotation": - return (0, lines_1.concat)(["?", path.call(print, "typeAnnotation")]); - case "NullLiteralTypeAnnotation": - return (0, lines_1.fromString)("null", options); - case "ThisTypeAnnotation": - return (0, lines_1.fromString)("this", options); - case "NumberTypeAnnotation": - return (0, lines_1.fromString)("number", options); - case "ObjectTypeCallProperty": - return path.call(print, "value"); - case "ObjectTypeIndexer": - if (n.static) { - parts.push("static "); - } - parts.push(printVariance(path, print), "["); - if (n.id) { - parts.push(path.call(print, "id"), ": "); - } - parts.push(path.call(print, "key"), "]: ", path.call(print, "value")); - return (0, lines_1.concat)(parts); - case "ObjectTypeProperty": - return (0, lines_1.concat)([ - printVariance(path, print), - path.call(print, "key"), - n.optional ? "?" : "", - ": ", - path.call(print, "value"), - ]); - case "ObjectTypeInternalSlot": - return (0, lines_1.concat)([ - n.static ? "static " : "", - "[[", - path.call(print, "id"), - "]]", - n.optional ? "?" : "", - n.value.type !== "FunctionTypeAnnotation" ? ": " : "", - path.call(print, "value"), - ]); - case "QualifiedTypeIdentifier": - return (0, lines_1.concat)([ - path.call(print, "qualification"), - ".", - path.call(print, "id"), - ]); - case "StringLiteralTypeAnnotation": - return (0, lines_1.fromString)(nodeStr(n.value, options), options); - case "NumberLiteralTypeAnnotation": - case "NumericLiteralTypeAnnotation": - (0, tiny_invariant_1.default)(typeof n.value === "number"); - return (0, lines_1.fromString)(JSON.stringify(n.value), options); - case "BigIntLiteralTypeAnnotation": - return (0, lines_1.fromString)(n.raw, options); - case "StringTypeAnnotation": - return (0, lines_1.fromString)("string", options); - case "DeclareTypeAlias": - parts.push("declare "); - // Fall through to TypeAlias... - case "TypeAlias": - return (0, lines_1.concat)([ - "type ", - path.call(print, "id"), - path.call(print, "typeParameters"), - " = ", - path.call(print, "right"), - ";", - ]); - case "DeclareOpaqueType": - parts.push("declare "); - // Fall through to OpaqueType... - case "OpaqueType": - parts.push("opaque type ", path.call(print, "id"), path.call(print, "typeParameters")); - if (n["supertype"]) { - parts.push(": ", path.call(print, "supertype")); - } - if (n["impltype"]) { - parts.push(" = ", path.call(print, "impltype")); - } - parts.push(";"); - return (0, lines_1.concat)(parts); - case "TypeCastExpression": - return (0, lines_1.concat)([ - "(", - path.call(print, "expression"), - path.call(print, "typeAnnotation"), - ")", - ]); - case "TypeParameterDeclaration": - case "TypeParameterInstantiation": - return (0, lines_1.concat)([ - "<", - (0, lines_1.fromString)(", ").join(path.map(print, "params")), - ">", - ]); - case "Variance": - if (n.kind === "plus") { - return (0, lines_1.fromString)("+"); - } - if (n.kind === "minus") { - return (0, lines_1.fromString)("-"); - } - return (0, lines_1.fromString)(""); - case "TypeParameter": - if (n.variance) { - parts.push(printVariance(path, print)); - } - parts.push(path.call(print, "name")); - if (n.bound) { - parts.push(path.call(print, "bound")); - } - if (n["default"]) { - parts.push("=", path.call(print, "default")); - } - return (0, lines_1.concat)(parts); - case "TypeofTypeAnnotation": - return (0, lines_1.concat)([ - (0, lines_1.fromString)("typeof ", options), - path.call(print, "argument"), - ]); - case "IndexedAccessType": - case "OptionalIndexedAccessType": - return (0, lines_1.concat)([ - path.call(print, "objectType"), - n.optional ? "?." : "", - "[", - path.call(print, "indexType"), - "]", - ]); - case "UnionTypeAnnotation": - return (0, lines_1.fromString)(" | ").join(path.map(print, "types")); - case "VoidTypeAnnotation": - return (0, lines_1.fromString)("void", options); - case "NullTypeAnnotation": - return (0, lines_1.fromString)("null", options); - case "SymbolTypeAnnotation": - return (0, lines_1.fromString)("symbol", options); - case "BigIntTypeAnnotation": - return (0, lines_1.fromString)("bigint", options); - // Type Annotations for TypeScript (when using Babylon as parser) - case "TSType": - throw new Error("unprintable type: " + JSON.stringify(n.type)); - case "TSNumberKeyword": - return (0, lines_1.fromString)("number", options); - case "TSBigIntKeyword": - return (0, lines_1.fromString)("bigint", options); - case "TSObjectKeyword": - return (0, lines_1.fromString)("object", options); - case "TSBooleanKeyword": - return (0, lines_1.fromString)("boolean", options); - case "TSStringKeyword": - return (0, lines_1.fromString)("string", options); - case "TSSymbolKeyword": - return (0, lines_1.fromString)("symbol", options); - case "TSAnyKeyword": - return (0, lines_1.fromString)("any", options); - case "TSVoidKeyword": - return (0, lines_1.fromString)("void", options); - case "TSIntrinsicKeyword": - return (0, lines_1.fromString)("intrinsic", options); - case "TSThisType": - return (0, lines_1.fromString)("this", options); - case "TSNullKeyword": - return (0, lines_1.fromString)("null", options); - case "TSUndefinedKeyword": - return (0, lines_1.fromString)("undefined", options); - case "TSUnknownKeyword": - return (0, lines_1.fromString)("unknown", options); - case "TSNeverKeyword": - return (0, lines_1.fromString)("never", options); - case "TSArrayType": - return (0, lines_1.concat)([path.call(print, "elementType"), "[]"]); - case "TSLiteralType": - return path.call(print, "literal"); - case "TSUnionType": - return (0, lines_1.fromString)(" | ").join(path.map(print, "types")); - case "TSIntersectionType": - return (0, lines_1.fromString)(" & ").join(path.map(print, "types")); - case "TSConditionalType": - parts.push(path.call(print, "checkType"), " extends ", path.call(print, "extendsType"), " ? ", path.call(print, "trueType"), " : ", path.call(print, "falseType")); - return (0, lines_1.concat)(parts); - case "TSInferType": - parts.push("infer ", path.call(print, "typeParameter")); - return (0, lines_1.concat)(parts); - case "TSParenthesizedType": - return (0, lines_1.concat)(["(", path.call(print, "typeAnnotation"), ")"]); - case "TSFunctionType": - return (0, lines_1.concat)([ - path.call(print, "typeParameters"), - "(", - printFunctionParams(path, options, print), - ") => ", - path.call(print, "typeAnnotation", "typeAnnotation"), - ]); - case "TSConstructorType": - return (0, lines_1.concat)([ - "new ", - path.call(print, "typeParameters"), - "(", - printFunctionParams(path, options, print), - ") => ", - path.call(print, "typeAnnotation", "typeAnnotation"), - ]); - case "TSMappedType": { - parts.push(n.readonly ? "readonly " : "", "[", path.call(print, "typeParameter"), "]", n.optional ? "?" : ""); - if (n.typeAnnotation) { - parts.push(": ", path.call(print, "typeAnnotation"), ";"); - } - return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]); - } - case "TSTupleType": - return (0, lines_1.concat)([ - "[", - (0, lines_1.fromString)(", ").join(path.map(print, "elementTypes")), - "]", - ]); - case "TSNamedTupleMember": - parts.push(path.call(print, "label")); - if (n.optional) { - parts.push("?"); - } - parts.push(": ", path.call(print, "elementType")); - return (0, lines_1.concat)(parts); - case "TSRestType": - return (0, lines_1.concat)(["...", path.call(print, "typeAnnotation")]); - case "TSOptionalType": - return (0, lines_1.concat)([path.call(print, "typeAnnotation"), "?"]); - case "TSIndexedAccessType": - return (0, lines_1.concat)([ - path.call(print, "objectType"), - "[", - path.call(print, "indexType"), - "]", - ]); - case "TSTypeOperator": - return (0, lines_1.concat)([ - path.call(print, "operator"), - " ", - path.call(print, "typeAnnotation"), - ]); - case "TSTypeLiteral": { - var members = (0, lines_1.fromString)("\n").join(path.map(print, "members").map(function (member) { - if (lastNonSpaceCharacter(member) !== ";") { - return member.concat(";"); - } - return member; - })); - if (members.isEmpty()) { - return (0, lines_1.fromString)("{}", options); - } - parts.push("{\n", members.indent(options.tabWidth), "\n}"); - return (0, lines_1.concat)(parts); - } - case "TSEnumMember": - parts.push(path.call(print, "id")); - if (n.initializer) { - parts.push(" = ", path.call(print, "initializer")); - } - return (0, lines_1.concat)(parts); - case "TSTypeQuery": - return (0, lines_1.concat)(["typeof ", path.call(print, "exprName")]); - case "TSParameterProperty": - if (n.accessibility) { - parts.push(n.accessibility, " "); - } - if (n.export) { - parts.push("export "); - } - if (n.static) { - parts.push("static "); - } - if (n.readonly) { - parts.push("readonly "); - } - parts.push(path.call(print, "parameter")); - return (0, lines_1.concat)(parts); - case "TSTypeReference": - return (0, lines_1.concat)([ - path.call(print, "typeName"), - path.call(print, "typeParameters"), - ]); - case "TSQualifiedName": - return (0, lines_1.concat)([path.call(print, "left"), ".", path.call(print, "right")]); - case "TSAsExpression": - case "TSSatisfiesExpression": { - var expression = path.call(print, "expression"); - parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path.call(print, "typeAnnotation")); - return (0, lines_1.concat)(parts); - } - case "TSTypeCastExpression": - return (0, lines_1.concat)([ - path.call(print, "expression"), - path.call(print, "typeAnnotation"), - ]); - case "TSNonNullExpression": - return (0, lines_1.concat)([path.call(print, "expression"), "!"]); - case "TSTypeAnnotation": - return (0, lines_1.concat)([": ", path.call(print, "typeAnnotation")]); - case "TSIndexSignature": - return (0, lines_1.concat)([ - n.readonly ? "readonly " : "", - "[", - path.map(print, "parameters"), - "]", - path.call(print, "typeAnnotation"), - ]); - case "TSPropertySignature": - parts.push(printVariance(path, print), n.readonly ? "readonly " : ""); - if (n.computed) { - parts.push("[", path.call(print, "key"), "]"); - } - else { - parts.push(path.call(print, "key")); - } - parts.push(n.optional ? "?" : "", path.call(print, "typeAnnotation")); - return (0, lines_1.concat)(parts); - case "TSMethodSignature": - if (n.kind === "get") { - parts.push("get "); - } - else if (n.kind === "set") { - parts.push("set "); - } - if (n.computed) { - parts.push("[", path.call(print, "key"), "]"); - } - else { - parts.push(path.call(print, "key")); - } - if (n.optional) { - parts.push("?"); - } - parts.push(path.call(print, "typeParameters"), "(", printFunctionParams(path, options, print), ")", path.call(print, "typeAnnotation")); - return (0, lines_1.concat)(parts); - case "TSTypePredicate": - if (n.asserts) { - parts.push("asserts "); - } - parts.push(path.call(print, "parameterName")); - if (n.typeAnnotation) { - parts.push(" is ", path.call(print, "typeAnnotation", "typeAnnotation")); - } - return (0, lines_1.concat)(parts); - case "TSCallSignatureDeclaration": - return (0, lines_1.concat)([ - path.call(print, "typeParameters"), - "(", - printFunctionParams(path, options, print), - ")", - path.call(print, "typeAnnotation"), - ]); - case "TSConstructSignatureDeclaration": - if (n.typeParameters) { - parts.push("new", path.call(print, "typeParameters")); - } - else { - parts.push("new "); - } - parts.push("(", printFunctionParams(path, options, print), ")", path.call(print, "typeAnnotation")); - return (0, lines_1.concat)(parts); - case "TSTypeAliasDeclaration": - return (0, lines_1.concat)([ - n.declare ? "declare " : "", - "type ", - path.call(print, "id"), - path.call(print, "typeParameters"), - " = ", - path.call(print, "typeAnnotation"), - ";", - ]); - case "TSTypeParameter": { - parts.push(path.call(print, "name")); - // ambiguous because of TSMappedType - var parent = path.getParentNode(0); - var isInMappedType = namedTypes.TSMappedType.check(parent); - if (n.constraint) { - parts.push(isInMappedType ? " in " : " extends ", path.call(print, "constraint")); - } - if (n["default"]) { - parts.push(" = ", path.call(print, "default")); - } - return (0, lines_1.concat)(parts); - } - case "TSTypeAssertion": { - parts.push("<", path.call(print, "typeAnnotation"), "> ", path.call(print, "expression")); - return (0, lines_1.concat)(parts); - } - case "TSTypeParameterDeclaration": - case "TSTypeParameterInstantiation": - return (0, lines_1.concat)([ - "<", - (0, lines_1.fromString)(", ").join(path.map(print, "params")), - ">", - ]); - case "TSEnumDeclaration": { - parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path.call(print, "id")); - var memberLines = (0, lines_1.fromString)(",\n").join(path.map(print, "members")); - if (memberLines.isEmpty()) { - parts.push(" {}"); - } - else { - parts.push(" {\n", memberLines.indent(options.tabWidth), "\n}"); - } - return (0, lines_1.concat)(parts); - } - case "TSExpressionWithTypeArguments": - return (0, lines_1.concat)([ - path.call(print, "expression"), - path.call(print, "typeParameters"), - ]); - case "TSInterfaceBody": { - var lines = (0, lines_1.fromString)("\n").join(path.map(print, "body").map(function (element) { - if (lastNonSpaceCharacter(element) !== ";") { - return element.concat(";"); - } - return element; - })); - if (lines.isEmpty()) { - return (0, lines_1.fromString)("{}", options); - } - return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]); - } - case "TSImportType": - parts.push("import(", path.call(print, "argument"), ")"); - if (n.qualifier) { - parts.push(".", path.call(print, "qualifier")); - } - if (n.typeParameters) { - parts.push(path.call(print, "typeParameters")); - } - return (0, lines_1.concat)(parts); - case "TSImportEqualsDeclaration": - if (n.isExport) { - parts.push("export "); - } - parts.push("import ", path.call(print, "id"), " = ", path.call(print, "moduleReference")); - return maybeAddSemicolon((0, lines_1.concat)(parts)); - case "TSExternalModuleReference": - return (0, lines_1.concat)(["require(", path.call(print, "expression"), ")"]); - case "TSModuleDeclaration": { - var parent = path.getParentNode(); - if (parent.type === "TSModuleDeclaration") { - parts.push("."); - } - else { - if (n.declare) { - parts.push("declare "); - } - if (!n.global) { - var isExternal = n.id.type === "StringLiteral" || - (n.id.type === "Literal" && typeof n.id.value === "string"); - if (isExternal) { - parts.push("module "); - } - else if (n.loc && n.loc.lines && n.id.loc) { - var prefix = n.loc.lines.sliceString(n.loc.start, n.id.loc.start); - // These keywords are fundamentally ambiguous in the - // Babylon parser, and not reflected in the AST, so - // the best we can do is to match the original code, - // when possible. - if (prefix.indexOf("module") >= 0) { - parts.push("module "); - } - else { - parts.push("namespace "); - } - } - else { - parts.push("namespace "); - } - } - } - parts.push(path.call(print, "id")); - if (n.body) { - parts.push(" "); - parts.push(path.call(print, "body")); - } - return (0, lines_1.concat)(parts); - } - case "TSModuleBlock": { - var naked = path.call(function (bodyPath) { return printStatementSequence(bodyPath, options, print); }, "body"); - if (naked.isEmpty()) { - parts.push("{}"); - } - else { - parts.push("{\n", naked.indent(options.tabWidth), "\n}"); - } - return (0, lines_1.concat)(parts); - } - case "TSInstantiationExpression": { - parts.push(path.call(print, "expression"), path.call(print, "typeParameters")); - return (0, lines_1.concat)(parts); - } - // https://github.com/babel/babel/pull/10148 - case "V8IntrinsicIdentifier": - return (0, lines_1.concat)(["%", path.call(print, "name")]); - // https://github.com/babel/babel/pull/13191 - case "TopicReference": - return (0, lines_1.fromString)("#"); - // Unhandled types below. If encountered, nodes of these types should - // be either left alone or desugared into AST types that are fully - // supported by the pretty-printer. - case "ClassHeritage": // TODO - case "ComprehensionBlock": // TODO - case "ComprehensionExpression": // TODO - case "Glob": // TODO - case "GeneratorExpression": // TODO - case "LetStatement": // TODO - case "LetExpression": // TODO - case "GraphExpression": // TODO - case "GraphIndexExpression": // TODO - case "XMLDefaultDeclaration": - case "XMLAnyName": - case "XMLQualifiedIdentifier": - case "XMLFunctionQualifiedIdentifier": - case "XMLAttributeSelector": - case "XMLFilterExpression": - case "XML": - case "XMLElement": - case "XMLList": - case "XMLEscape": - case "XMLText": - case "XMLStartTag": - case "XMLEndTag": - case "XMLPointTag": - case "XMLName": - case "XMLAttribute": - case "XMLCdata": - case "XMLComment": - case "XMLProcessingInstruction": - default: - debugger; - throw new Error("unknown type: " + JSON.stringify(n.type)); - } -} -function printDecorators(path, printPath) { - var parts = []; - var node = path.getValue(); - if (node.decorators && - node.decorators.length > 0 && - // If the parent node is an export declaration, it will be - // responsible for printing node.decorators. - !util.getParentExportDeclaration(path)) { - path.each(function (decoratorPath) { - parts.push(printPath(decoratorPath), "\n"); - }, "decorators"); - } - else if (util.isExportDeclaration(node) && - node.declaration && - node.declaration.decorators) { - // Export declarations are responsible for printing any decorators - // that logically apply to node.declaration. - path.each(function (decoratorPath) { - parts.push(printPath(decoratorPath), "\n"); - }, "declaration", "decorators"); - } - return (0, lines_1.concat)(parts); -} -function printStatementSequence(path, options, print) { - var filtered = []; - var sawComment = false; - var sawStatement = false; - path.each(function (stmtPath) { - var stmt = stmtPath.getValue(); - // Just in case the AST has been modified to contain falsy - // "statements," it's safer simply to skip them. - if (!stmt) { - return; - } - // Skip printing EmptyStatement nodes to avoid leaving stray - // semicolons lying around. - if (stmt.type === "EmptyStatement" && - !(stmt.comments && stmt.comments.length > 0)) { - return; - } - if (namedTypes.Comment.check(stmt)) { - // The pretty printer allows a dangling Comment node to act as - // a Statement when the Comment can't be attached to any other - // non-Comment node in the tree. - sawComment = true; - } - else if (namedTypes.Statement.check(stmt)) { - sawStatement = true; - } - else { - // When the pretty printer encounters a string instead of an - // AST node, it just prints the string. This behavior can be - // useful for fine-grained formatting decisions like inserting - // blank lines. - isString.assert(stmt); - } - // We can't hang onto stmtPath outside of this function, because - // it's just a reference to a mutable FastPath object, so we have - // to go ahead and print it here. - filtered.push({ - node: stmt, - printed: print(stmtPath), - }); - }); - if (sawComment) { - (0, tiny_invariant_1.default)(sawStatement === false, "Comments may appear as statements in otherwise empty statement " + - "lists, but may not coexist with non-Comment nodes."); - } - var prevTrailingSpace = null; - var len = filtered.length; - var parts = []; - filtered.forEach(function (info, i) { - var printed = info.printed; - var stmt = info.node; - var multiLine = printed.length > 1; - var notFirst = i > 0; - var notLast = i < len - 1; - var leadingSpace; - var trailingSpace; - var lines = stmt && stmt.loc && stmt.loc.lines; - var trueLoc = lines && options.reuseWhitespace && util.getTrueLoc(stmt, lines); - if (notFirst) { - if (trueLoc) { - var beforeStart = lines.skipSpaces(trueLoc.start, true); - var beforeStartLine = beforeStart ? beforeStart.line : 1; - var leadingGap = trueLoc.start.line - beforeStartLine; - leadingSpace = Array(leadingGap + 1).join("\n"); - } - else { - leadingSpace = multiLine ? "\n\n" : "\n"; - } - } - else { - leadingSpace = ""; - } - if (notLast) { - if (trueLoc) { - var afterEnd = lines.skipSpaces(trueLoc.end); - var afterEndLine = afterEnd ? afterEnd.line : lines.length; - var trailingGap = afterEndLine - trueLoc.end.line; - trailingSpace = Array(trailingGap + 1).join("\n"); - } - else { - trailingSpace = multiLine ? "\n\n" : "\n"; - } - } - else { - trailingSpace = ""; - } - parts.push(maxSpace(prevTrailingSpace, leadingSpace), printed); - if (notLast) { - prevTrailingSpace = trailingSpace; - } - else if (trailingSpace) { - parts.push(trailingSpace); - } - }); - return (0, lines_1.concat)(parts); -} -function maxSpace(s1, s2) { - if (!s1 && !s2) { - return (0, lines_1.fromString)(""); - } - if (!s1) { - return (0, lines_1.fromString)(s2); - } - if (!s2) { - return (0, lines_1.fromString)(s1); - } - var spaceLines1 = (0, lines_1.fromString)(s1); - var spaceLines2 = (0, lines_1.fromString)(s2); - if (spaceLines2.length > spaceLines1.length) { - return spaceLines2; - } - return spaceLines1; -} -function printClassMemberModifiers(node) { - var parts = []; - if (node.declare) { - parts.push("declare "); - } - var access = node.accessibility || node.access; - if (typeof access === "string") { - parts.push(access, " "); - } - if (node.static) { - parts.push("static "); - } - if (node.override) { - parts.push("override "); - } - if (node.abstract) { - parts.push("abstract "); - } - if (node.readonly) { - parts.push("readonly "); - } - return parts; -} -function printMethod(path, options, print) { - var node = path.getNode(); - var kind = node.kind; - var parts = []; - var nodeValue = node.value; - if (!namedTypes.FunctionExpression.check(nodeValue)) { - nodeValue = node; - } - parts.push.apply(parts, printClassMemberModifiers(node)); - if (nodeValue.async) { - parts.push("async "); - } - if (nodeValue.generator) { - parts.push("*"); - } - if (kind === "get" || kind === "set") { - parts.push(kind, " "); - } - var key = path.call(print, "key"); - if (node.computed) { - key = (0, lines_1.concat)(["[", key, "]"]); - } - parts.push(key); - if (node.optional) { - parts.push("?"); - } - if (node === nodeValue) { - parts.push(path.call(print, "typeParameters"), "(", printFunctionParams(path, options, print), ")", path.call(print, "returnType")); - if (node.body) { - parts.push(" ", path.call(print, "body")); - } - else { - parts.push(";"); - } - } - else { - parts.push(path.call(print, "value", "typeParameters"), "(", path.call(function (valuePath) { return printFunctionParams(valuePath, options, print); }, "value"), ")", path.call(print, "value", "returnType")); - if (nodeValue.body) { - parts.push(" ", path.call(print, "value", "body")); - } - else { - parts.push(";"); - } - } - return (0, lines_1.concat)(parts); -} -function printArgumentsList(path, options, print) { - var printed = path.map(print, "arguments"); - var trailingComma = util.isTrailingCommaEnabled(options, "parameters"); - var joined = (0, lines_1.fromString)(", ").join(printed); - if (joined.getLineLength(1) > options.wrapColumn) { - joined = (0, lines_1.fromString)(",\n").join(printed); - return (0, lines_1.concat)([ - "(\n", - joined.indent(options.tabWidth), - trailingComma ? ",\n)" : "\n)", - ]); - } - return (0, lines_1.concat)(["(", joined, ")"]); -} -function printFunctionParams(path, options, print) { - var fun = path.getValue(); - var params; - var printed = []; - if (fun.params) { - params = fun.params; - printed = path.map(print, "params"); - } - else if (fun.parameters) { - params = fun.parameters; - printed = path.map(print, "parameters"); - } - if (fun.defaults) { - path.each(function (defExprPath) { - var i = defExprPath.getName(); - var p = printed[i]; - if (p && defExprPath.getValue()) { - printed[i] = (0, lines_1.concat)([p, " = ", print(defExprPath)]); - } - }, "defaults"); - } - if (fun.rest) { - printed.push((0, lines_1.concat)(["...", path.call(print, "rest")])); - } - var joined = (0, lines_1.fromString)(", ").join(printed); - if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) { - joined = (0, lines_1.fromString)(",\n").join(printed); - if (util.isTrailingCommaEnabled(options, "parameters") && - !fun.rest && - params[params.length - 1].type !== "RestElement") { - joined = (0, lines_1.concat)([joined, ",\n"]); - } - else { - joined = (0, lines_1.concat)([joined, "\n"]); - } - return (0, lines_1.concat)(["\n", joined.indent(options.tabWidth)]); - } - return joined; -} -function maybePrintImportAssertions(path, options, print) { - var n = path.getValue(); - if (n.assertions && n.assertions.length > 0) { - var parts = [" assert {"]; - var printed = path.map(print, "assertions"); - var flat = (0, lines_1.fromString)(", ").join(printed); - if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) { - parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}"); - } - else { - parts.push(" ", flat, " }"); - } - return (0, lines_1.concat)(parts); - } - return (0, lines_1.fromString)(""); -} -function printExportDeclaration(path, options, print) { - var decl = path.getValue(); - var parts = ["export "]; - if (decl.exportKind && decl.exportKind === "type") { - if (!decl.declaration) { - parts.push("type "); - } - } - var shouldPrintSpaces = options.objectCurlySpacing; - namedTypes.Declaration.assert(decl); - if (decl["default"] || decl.type === "ExportDefaultDeclaration") { - parts.push("default "); - } - if (decl.declaration) { - parts.push(path.call(print, "declaration")); - } - else if (decl.specifiers) { - if (decl.specifiers.length === 1 && - decl.specifiers[0].type === "ExportBatchSpecifier") { - parts.push("*"); - } - else if (decl.specifiers.length === 0) { - parts.push("{}"); - } - else if (decl.specifiers[0].type === "ExportDefaultSpecifier" || - decl.specifiers[0].type === "ExportNamespaceSpecifier") { - var unbracedSpecifiers_2 = []; - var bracedSpecifiers_2 = []; - path.each(function (specifierPath) { - var spec = specifierPath.getValue(); - if (spec.type === "ExportDefaultSpecifier" || - spec.type === "ExportNamespaceSpecifier") { - unbracedSpecifiers_2.push(print(specifierPath)); - } - else { - bracedSpecifiers_2.push(print(specifierPath)); - } - }, "specifiers"); - unbracedSpecifiers_2.forEach(function (lines, i) { - if (i > 0) { - parts.push(", "); - } - parts.push(lines); - }); - if (bracedSpecifiers_2.length > 0) { - var lines_2 = (0, lines_1.fromString)(", ").join(bracedSpecifiers_2); - if (lines_2.getLineLength(1) > options.wrapColumn) { - lines_2 = (0, lines_1.concat)([ - (0, lines_1.fromString)(",\n").join(bracedSpecifiers_2).indent(options.tabWidth), - ",", - ]); - } - if (unbracedSpecifiers_2.length > 0) { - parts.push(", "); - } - if (lines_2.length > 1) { - parts.push("{\n", lines_2, "\n}"); - } - else if (options.objectCurlySpacing) { - parts.push("{ ", lines_2, " }"); - } - else { - parts.push("{", lines_2, "}"); - } - } - } - else { - parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path.map(print, "specifiers")), shouldPrintSpaces ? " }" : "}"); - } - if (decl.source) { - parts.push(" from ", path.call(print, "source"), maybePrintImportAssertions(path, options, print)); - } - } - var lines = (0, lines_1.concat)(parts); - if (lastNonSpaceCharacter(lines) !== ";" && - !(decl.declaration && - (decl.declaration.type === "FunctionDeclaration" || - decl.declaration.type === "ClassDeclaration" || - decl.declaration.type === "TSModuleDeclaration" || - decl.declaration.type === "TSInterfaceDeclaration" || - decl.declaration.type === "TSEnumDeclaration"))) { - lines = (0, lines_1.concat)([lines, ";"]); - } - return lines; -} -function printFlowDeclaration(path, parts) { - var parentExportDecl = util.getParentExportDeclaration(path); - if (parentExportDecl) { - (0, tiny_invariant_1.default)(parentExportDecl.type === "DeclareExportDeclaration"); - } - else { - // If the parent node has type DeclareExportDeclaration, then it - // will be responsible for printing the "declare" token. Otherwise - // it needs to be printed with this non-exported declaration node. - parts.unshift("declare "); - } - return (0, lines_1.concat)(parts); -} -function printVariance(path, print) { - return path.call(function (variancePath) { - var value = variancePath.getValue(); - if (value) { - if (value === "plus") { - return (0, lines_1.fromString)("+"); - } - if (value === "minus") { - return (0, lines_1.fromString)("-"); - } - return print(variancePath); - } - return (0, lines_1.fromString)(""); - }, "variance"); -} -function adjustClause(clause, options) { - if (clause.length > 1) - return (0, lines_1.concat)([" ", clause]); - return (0, lines_1.concat)(["\n", maybeAddSemicolon(clause).indent(options.tabWidth)]); -} -function lastNonSpaceCharacter(lines) { - var pos = lines.lastPos(); - do { - var ch = lines.charAt(pos); - if (/\S/.test(ch)) - return ch; - } while (lines.prevPos(pos)); -} -function endsWithBrace(lines) { - return lastNonSpaceCharacter(lines) === "}"; -} -function swapQuotes(str) { - return str.replace(/['"]/g, function (m) { return (m === '"' ? "'" : '"'); }); -} -function getPossibleRaw(node) { - var value = types.getFieldValue(node, "value"); - var extra = types.getFieldValue(node, "extra"); - if (extra && typeof extra.raw === "string" && value == extra.rawValue) { - return extra.raw; - } - if (node.type === "Literal") { - var raw = node.raw; - if (typeof raw === "string" && value == raw) { - return raw; - } - } -} -function jsSafeStringify(str) { - return JSON.stringify(str).replace(/[\u2028\u2029]/g, function (m) { - return "\\u" + m.charCodeAt(0).toString(16); - }); -} -function nodeStr(str, options) { - isString.assert(str); - switch (options.quote) { - case "auto": { - var double = jsSafeStringify(str); - var single = swapQuotes(jsSafeStringify(swapQuotes(str))); - return double.length > single.length ? single : double; - } - case "single": - return swapQuotes(jsSafeStringify(swapQuotes(str))); - case "double": - default: - return jsSafeStringify(str); - } -} -function maybeAddSemicolon(lines) { - var eoc = lastNonSpaceCharacter(lines); - if (!eoc || "\n};".indexOf(eoc) < 0) - return (0, lines_1.concat)([lines, ";"]); - return lines; -} - - -/***/ }), - -/***/ "./node_modules/recast/lib/util.js": -/*!*****************************************!*\ - !*** ./node_modules/recast/lib/util.js ***! - \*****************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTrailingCommaEnabled = exports.getParentExportDeclaration = exports.isExportDeclaration = exports.fixFaultyLocations = exports.getTrueLoc = exports.composeSourceMaps = exports.copyPos = exports.comparePos = exports.getUnionOfKeys = exports.getOption = exports.isBrowser = exports.getLineTerminator = void 0; -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var tiny_invariant_1 = tslib_1.__importDefault(__webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js")); -var types = tslib_1.__importStar(__webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js")); -var n = types.namedTypes; -var source_map_1 = tslib_1.__importDefault(__webpack_require__(/*! source-map */ "./node_modules/recast/node_modules/source-map/source-map.js")); -var SourceMapConsumer = source_map_1.default.SourceMapConsumer; -var SourceMapGenerator = source_map_1.default.SourceMapGenerator; -var hasOwn = Object.prototype.hasOwnProperty; -function getLineTerminator() { - return isBrowser() ? "\n" : (__webpack_require__(/*! os */ "./node_modules/os-browserify/browser.js").EOL) || "\n"; -} -exports.getLineTerminator = getLineTerminator; -function isBrowser() { - return (typeof window !== "undefined" && typeof window.document !== "undefined"); -} -exports.isBrowser = isBrowser; -function getOption(options, key, defaultValue) { - if (options && hasOwn.call(options, key)) { - return options[key]; - } - return defaultValue; -} -exports.getOption = getOption; -function getUnionOfKeys() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var result = {}; - var argc = args.length; - for (var i = 0; i < argc; ++i) { - var keys = Object.keys(args[i]); - var keyCount = keys.length; - for (var j = 0; j < keyCount; ++j) { - result[keys[j]] = true; - } - } - return result; -} -exports.getUnionOfKeys = getUnionOfKeys; -function comparePos(pos1, pos2) { - return pos1.line - pos2.line || pos1.column - pos2.column; -} -exports.comparePos = comparePos; -function copyPos(pos) { - return { - line: pos.line, - column: pos.column, - }; -} -exports.copyPos = copyPos; -function composeSourceMaps(formerMap, latterMap) { - if (formerMap) { - if (!latterMap) { - return formerMap; - } - } - else { - return latterMap || null; - } - var smcFormer = new SourceMapConsumer(formerMap); - var smcLatter = new SourceMapConsumer(latterMap); - var smg = new SourceMapGenerator({ - file: latterMap.file, - sourceRoot: latterMap.sourceRoot, - }); - var sourcesToContents = {}; - smcLatter.eachMapping(function (mapping) { - var origPos = smcFormer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn, - }); - var sourceName = origPos.source; - if (sourceName === null) { - return; - } - smg.addMapping({ - source: sourceName, - original: copyPos(origPos), - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn, - }, - name: mapping.name, - }); - var sourceContent = smcFormer.sourceContentFor(sourceName); - if (sourceContent && !hasOwn.call(sourcesToContents, sourceName)) { - sourcesToContents[sourceName] = sourceContent; - smg.setSourceContent(sourceName, sourceContent); - } - }); - return smg.toJSON(); -} -exports.composeSourceMaps = composeSourceMaps; -function getTrueLoc(node, lines) { - // It's possible that node is newly-created (not parsed by Esprima), - // in which case it probably won't have a .loc property (or an - // .original property for that matter). That's fine; we'll just - // pretty-print it as usual. - if (!node.loc) { - return null; - } - var result = { - start: node.loc.start, - end: node.loc.end, - }; - function include(node) { - expandLoc(result, node.loc); - } - // If the node is an export declaration and its .declaration has any - // decorators, their locations might contribute to the true start/end - // positions of the export declaration node. - if (node.declaration && - node.declaration.decorators && - isExportDeclaration(node)) { - node.declaration.decorators.forEach(include); - } - if (comparePos(result.start, result.end) < 0) { - // Trim leading whitespace. - result.start = copyPos(result.start); - lines.skipSpaces(result.start, false, true); - if (comparePos(result.start, result.end) < 0) { - // Trim trailing whitespace, if the end location is not already the - // same as the start location. - result.end = copyPos(result.end); - lines.skipSpaces(result.end, true, true); - } - } - // If the node has any comments, their locations might contribute to - // the true start/end positions of the node. - if (node.comments) { - node.comments.forEach(include); - } - return result; -} -exports.getTrueLoc = getTrueLoc; -function expandLoc(parentLoc, childLoc) { - if (parentLoc && childLoc) { - if (comparePos(childLoc.start, parentLoc.start) < 0) { - parentLoc.start = childLoc.start; - } - if (comparePos(parentLoc.end, childLoc.end) < 0) { - parentLoc.end = childLoc.end; - } - } -} -function fixFaultyLocations(node, lines) { - var loc = node.loc; - if (loc) { - if (loc.start.line < 1) { - loc.start.line = 1; - } - if (loc.end.line < 1) { - loc.end.line = 1; - } - } - if (node.type === "File") { - // Babylon returns File nodes whose .loc.{start,end} do not include - // leading or trailing whitespace. - loc.start = lines.firstPos(); - loc.end = lines.lastPos(); - } - fixForLoopHead(node, lines); - fixTemplateLiteral(node, lines); - if (loc && node.decorators) { - // Expand the .loc of the node responsible for printing the decorators - // (here, the decorated node) so that it includes node.decorators. - node.decorators.forEach(function (decorator) { - expandLoc(loc, decorator.loc); - }); - } - else if (node.declaration && isExportDeclaration(node)) { - // Nullify .loc information for the child declaration so that we never - // try to reprint it without also reprinting the export declaration. - node.declaration.loc = null; - // Expand the .loc of the node responsible for printing the decorators - // (here, the export declaration) so that it includes node.decorators. - var decorators = node.declaration.decorators; - if (decorators) { - decorators.forEach(function (decorator) { - expandLoc(loc, decorator.loc); - }); - } - } - else if ((n.MethodDefinition && n.MethodDefinition.check(node)) || - (n.Property.check(node) && (node.method || node.shorthand))) { - // If the node is a MethodDefinition or a .method or .shorthand - // Property, then the location information stored in - // node.value.loc is very likely untrustworthy (just the {body} - // part of a method, or nothing in the case of shorthand - // properties), so we null out that information to prevent - // accidental reuse of bogus source code during reprinting. - node.value.loc = null; - if (n.FunctionExpression.check(node.value)) { - // FunctionExpression method values should be anonymous, - // because their .id fields are ignored anyway. - node.value.id = null; - } - } - else if (node.type === "ObjectTypeProperty") { - var loc_1 = node.loc; - var end = loc_1 && loc_1.end; - if (end) { - end = copyPos(end); - if (lines.prevPos(end) && lines.charAt(end) === ",") { - // Some parsers accidentally include trailing commas in the - // .loc.end information for ObjectTypeProperty nodes. - if ((end = lines.skipSpaces(end, true, true))) { - loc_1.end = end; - } - } - } - } -} -exports.fixFaultyLocations = fixFaultyLocations; -function fixForLoopHead(node, lines) { - if (node.type !== "ForStatement") { - return; - } - function fix(child) { - var loc = child && child.loc; - var start = loc && loc.start; - var end = loc && copyPos(loc.end); - while (start && end && comparePos(start, end) < 0) { - lines.prevPos(end); - if (lines.charAt(end) === ";") { - // Update child.loc.end to *exclude* the ';' character. - loc.end.line = end.line; - loc.end.column = end.column; - } - else { - break; - } - } - } - fix(node.init); - fix(node.test); - fix(node.update); -} -function fixTemplateLiteral(node, lines) { - if (node.type !== "TemplateLiteral") { - return; - } - if (node.quasis.length === 0) { - // If there are no quasi elements, then there is nothing to fix. - return; - } - // node.loc is not present when using export default with a template literal - if (node.loc) { - // First we need to exclude the opening ` from the .loc of the first - // quasi element, in case the parser accidentally decided to include it. - var afterLeftBackTickPos = copyPos(node.loc.start); - (0, tiny_invariant_1.default)(lines.charAt(afterLeftBackTickPos) === "`"); - (0, tiny_invariant_1.default)(lines.nextPos(afterLeftBackTickPos)); - var firstQuasi = node.quasis[0]; - if (comparePos(firstQuasi.loc.start, afterLeftBackTickPos) < 0) { - firstQuasi.loc.start = afterLeftBackTickPos; - } - // Next we need to exclude the closing ` from the .loc of the last quasi - // element, in case the parser accidentally decided to include it. - var rightBackTickPos = copyPos(node.loc.end); - (0, tiny_invariant_1.default)(lines.prevPos(rightBackTickPos)); - (0, tiny_invariant_1.default)(lines.charAt(rightBackTickPos) === "`"); - var lastQuasi = node.quasis[node.quasis.length - 1]; - if (comparePos(rightBackTickPos, lastQuasi.loc.end) < 0) { - lastQuasi.loc.end = rightBackTickPos; - } - } - // Now we need to exclude ${ and } characters from the .loc's of all - // quasi elements, since some parsers accidentally include them. - node.expressions.forEach(function (expr, i) { - // Rewind from expr.loc.start over any whitespace and the ${ that - // precedes the expression. The position of the $ should be the same - // as the .loc.end of the preceding quasi element, but some parsers - // accidentally include the ${ in the .loc of the quasi element. - var dollarCurlyPos = lines.skipSpaces(expr.loc.start, true, false); - if (lines.prevPos(dollarCurlyPos) && - lines.charAt(dollarCurlyPos) === "{" && - lines.prevPos(dollarCurlyPos) && - lines.charAt(dollarCurlyPos) === "$") { - var quasiBefore = node.quasis[i]; - if (comparePos(dollarCurlyPos, quasiBefore.loc.end) < 0) { - quasiBefore.loc.end = dollarCurlyPos; - } - } - // Likewise, some parsers accidentally include the } that follows - // the expression in the .loc of the following quasi element. - var rightCurlyPos = lines.skipSpaces(expr.loc.end, false, false); - if (lines.charAt(rightCurlyPos) === "}") { - (0, tiny_invariant_1.default)(lines.nextPos(rightCurlyPos)); - // Now rightCurlyPos is technically the position just after the }. - var quasiAfter = node.quasis[i + 1]; - if (comparePos(quasiAfter.loc.start, rightCurlyPos) < 0) { - quasiAfter.loc.start = rightCurlyPos; - } - } - }); -} -function isExportDeclaration(node) { - if (node) - switch (node.type) { - case "ExportDeclaration": - case "ExportDefaultDeclaration": - case "ExportDefaultSpecifier": - case "DeclareExportDeclaration": - case "ExportNamedDeclaration": - case "ExportAllDeclaration": - return true; - } - return false; -} -exports.isExportDeclaration = isExportDeclaration; -function getParentExportDeclaration(path) { - var parentNode = path.getParentNode(); - if (path.getName() === "declaration" && isExportDeclaration(parentNode)) { - return parentNode; - } - return null; -} -exports.getParentExportDeclaration = getParentExportDeclaration; -function isTrailingCommaEnabled(options, context) { - var trailingComma = options.trailingComma; - if (typeof trailingComma === "object") { - return !!trailingComma[context]; - } - return !!trailingComma; -} -exports.isTrailingCommaEnabled = isTrailingCommaEnabled; - - -/***/ }), - -/***/ "./node_modules/recast/main.js": -/*!*************************************!*\ - !*** ./node_modules/recast/main.js ***! - \*************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0; -var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs"); -var fs_1 = tslib_1.__importDefault(__webpack_require__(/*! fs */ "?5042")); -var types = tslib_1.__importStar(__webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js")); -exports.types = types; -var parser_1 = __webpack_require__(/*! ./lib/parser */ "./node_modules/recast/lib/parser.js"); -Object.defineProperty(exports, "parse", ({ enumerable: true, get: function () { return parser_1.parse; } })); -var printer_1 = __webpack_require__(/*! ./lib/printer */ "./node_modules/recast/lib/printer.js"); -/** - * Traverse and potentially modify an abstract syntax tree using a - * convenient visitor syntax: - * - * recast.visit(ast, { - * names: [], - * visitIdentifier: function(path) { - * var node = path.value; - * this.visitor.names.push(node.name); - * this.traverse(path); - * } - * }); - */ -var ast_types_1 = __webpack_require__(/*! ast-types */ "./node_modules/ast-types/lib/main.js"); -Object.defineProperty(exports, "visit", ({ enumerable: true, get: function () { return ast_types_1.visit; } })); -/** - * Reprint a modified syntax tree using as much of the original source - * code as possible. - */ -function print(node, options) { - return new printer_1.Printer(options).print(node); -} -exports.print = print; -/** - * Print without attempting to reuse any original source code. - */ -function prettyPrint(node, options) { - return new printer_1.Printer(options).printGenerically(node); -} -exports.prettyPrint = prettyPrint; -/** - * Convenient command-line interface (see e.g. example/add-braces). - */ -function run(transformer, options) { - return runFile(process.argv[2], transformer, options); -} -exports.run = run; -function runFile(path, transformer, options) { - fs_1.default.readFile(path, "utf-8", function (err, code) { - if (err) { - console.error(err); - return; - } - runString(code, transformer, options); - }); -} -function defaultWriteback(output) { - process.stdout.write(output); -} -function runString(code, transformer, options) { - var writeback = (options && options.writeback) || defaultWriteback; - transformer((0, parser_1.parse)(code, options), function (node) { - writeback(print(node, options).code); - }); -} - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/array-set.js": -/*!**********************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/array-set.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = __webpack_require__(/*! ./util */ "./node_modules/recast/node_modules/source-map/lib/util.js"); -var has = Object.prototype.hasOwnProperty; -var hasNativeMap = typeof Map !== "undefined"; - -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); -} - -/** - * Static method for creating ArraySet instances from an existing array. - */ -ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; -}; - -/** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ -ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; -}; - -/** - * Add the given string to this set. - * - * @param String aStr - */ -ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } -}; - -/** - * Is the given string a member of this set? - * - * @param String aStr - */ -ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } -}; - -/** - * What is the index of the given string in the array? - * - * @param String aStr - */ -ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); -}; - -/** - * What is the element at the given index? - * - * @param Number aIdx - */ -ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); -}; - -/** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ -ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); -}; - -exports.ArraySet = ArraySet; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/base64-vlq.js": -/*!***********************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/base64-vlq.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var base64 = __webpack_require__(/*! ./base64 */ "./node_modules/recast/node_modules/source-map/lib/base64.js"); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -var VLQ_BASE_SHIFT = 5; - -// binary: 100000 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -var VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -var VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} - -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - -/** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; -}; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/base64.js": -/*!*******************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/base64.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - -/** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ -exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; -}; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/binary-search.js": -/*!**************************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/binary-search.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/mapping-list.js": -/*!*************************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/mapping-list.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = __webpack_require__(/*! ./util */ "./node_modules/recast/node_modules/source-map/lib/util.js"); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ -function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; -} - -/** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ -MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - -/** - * Add the given source mapping. - * - * @param Object aMapping - */ -MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } -}; - -/** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ -MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; -}; - -exports.MappingList = MappingList; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/quick-sort.js": -/*!***********************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/quick-sort.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -// It turns out that some (most?) JavaScript engines don't self-host -// `Array.prototype.sort`. This makes sense because C++ will likely remain -// faster than JS when doing raw CPU-intensive sorting. However, when using a -// custom comparator function, calling back and forth between the VM's C++ and -// JIT'd JS is rather slow *and* loses JIT type information, resulting in -// worse generated code for the comparator function than would be optimal. In -// fact, when sorting with a comparator, these costs outweigh the benefits of -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get -// a ~3500ms mean speed-up in `bench/bench.html`. - -/** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ -function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; -} - -/** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ -function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); -} - -/** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ -function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } -} - -/** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ -exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); -}; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/source-map-consumer.js": -/*!********************************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/source-map-consumer.js ***! - \********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = __webpack_require__(/*! ./util */ "./node_modules/recast/node_modules/source-map/lib/util.js"); -var binarySearch = __webpack_require__(/*! ./binary-search */ "./node_modules/recast/node_modules/source-map/lib/binary-search.js"); -var ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/recast/node_modules/source-map/lib/array-set.js").ArraySet); -var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/recast/node_modules/source-map/lib/base64-vlq.js"); -var quickSort = (__webpack_require__(/*! ./quick-sort */ "./node_modules/recast/node_modules/source-map/lib/quick-sort.js").quickSort); - -function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); -} - -SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; - -// `__generatedMappings` and `__originalMappings` are arrays that hold the -// parsed mapping coordinates from the source map's "mappings" attribute. They -// are lazily instantiated, accessed via the `_generatedMappings` and -// `_originalMappings` getters respectively, and we only parse the mappings -// and create these arrays once queried for a source location. We jump through -// these hoops because there can be many thousands of mappings, and parsing -// them is expensive, so we only want to do it if we must. -// -// Each object in the arrays is of the form: -// -// { -// generatedLine: The line number in the generated code, -// generatedColumn: The column number in the generated code, -// source: The path to the original source file that generated this -// chunk of code, -// originalLine: The line number in the original source that -// corresponds to this chunk of generated code, -// originalColumn: The column number in the original source that -// corresponds to this chunk of generated code, -// name: The name of the original symbol which generated this chunk of -// code. -// } -// -// All properties except for `generatedLine` and `generatedColumn` can be -// `null`. -// -// `_generatedMappings` is ordered by the generated positions. -// -// `_originalMappings` is ordered by the original positions. - -SourceMapConsumer.prototype.__generatedMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } -}); - -SourceMapConsumer.prototype.__originalMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } -}); - -SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -/** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ -SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - -/** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; -} - -BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - -/** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ -BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; -}; - -/** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ -BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - -/** - * The version of the source mapping spec that we are consuming. - */ -BasicSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } -}); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - -/** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ -BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - -/** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ -BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); -} - -IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - -/** - * The version of the source mapping spec that we are consuming. - */ -IndexedSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } -}); - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/source-map-generator.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/source-map-generator.js ***! - \*********************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/recast/node_modules/source-map/lib/base64-vlq.js"); -var util = __webpack_require__(/*! ./util */ "./node_modules/recast/node_modules/source-map/lib/util.js"); -var ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/recast/node_modules/source-map/lib/array-set.js").ArraySet); -var MappingList = (__webpack_require__(/*! ./mapping-list */ "./node_modules/recast/node_modules/source-map/lib/mapping-list.js").MappingList); - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; -} - -SourceMapGenerator.prototype._version = 3; - -/** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ -SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - -/** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ -SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - -/** - * Set the source content for a source file. - */ -SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - -/** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ -SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - -/** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ -SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - -/** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ -SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - -SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - -/** - * Externalize the source map. - */ -SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - -/** - * Render the source map being generated to a string. - */ -SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - -exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/source-node.js": -/*!************************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/source-node.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var SourceMapGenerator = (__webpack_require__(/*! ./source-map-generator */ "./node_modules/recast/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator); -var util = __webpack_require__(/*! ./util */ "./node_modules/recast/node_modules/source-map/lib/util.js"); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -var REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -var NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -var isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); -} - -/** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ -SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - -/** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } -}; - -/** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ -SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; -}; - -/** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ -SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; -}; - -/** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ -SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - -/** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - -/** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ -SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; -}; - -/** - * Returns the string representation of this source node along with a source - * map. - */ -SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; -}; - -exports.SourceNode = SourceNode; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/lib/util.js": -/*!*****************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/lib/util.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } -} -exports.getArg = getArg; - -var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -var dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -} -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); -}()); - -function identity (s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); -} -exports.parseSourceMapInput = parseSourceMapInput; - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); -} -exports.computeSourceURL = computeSourceURL; - - -/***/ }), - -/***/ "./node_modules/recast/node_modules/source-map/source-map.js": -/*!*******************************************************************!*\ - !*** ./node_modules/recast/node_modules/source-map/source-map.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = __webpack_require__(/*! ./lib/source-map-generator */ "./node_modules/recast/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator; -exports.SourceMapConsumer = __webpack_require__(/*! ./lib/source-map-consumer */ "./node_modules/recast/node_modules/source-map/lib/source-map-consumer.js").SourceMapConsumer; -exports.SourceNode = __webpack_require__(/*! ./lib/source-node */ "./node_modules/recast/node_modules/source-map/lib/source-node.js").SourceNode; - - -/***/ }), - -/***/ "./node_modules/recast/parsers/esprima.js": -/*!************************************************!*\ - !*** ./node_modules/recast/parsers/esprima.js ***! - \************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parse = void 0; -// This module is suitable for passing as options.parser when calling -// recast.parse to process ECMAScript code with Esprima: -// -// const ast = recast.parse(source, { -// parser: require("recast/parsers/esprima") -// }); -// -var util_1 = __webpack_require__(/*! ../lib/util */ "./node_modules/recast/lib/util.js"); -function parse(source, options) { - var comments = []; - var ast = (__webpack_require__(/*! esprima */ "./node_modules/esprima/dist/esprima.js").parse)(source, { - loc: true, - locations: true, - comment: true, - onComment: comments, - range: (0, util_1.getOption)(options, "range", false), - tolerant: (0, util_1.getOption)(options, "tolerant", true), - tokens: true, - jsx: (0, util_1.getOption)(options, "jsx", false), - sourceType: (0, util_1.getOption)(options, "sourceType", "module"), - }); - if (!Array.isArray(ast.comments)) { - ast.comments = comments; - } - return ast; -} -exports.parse = parse; - - -/***/ }), - -/***/ "./node_modules/safe-regex-test/index.js": -/*!***********************************************!*\ - !*** ./node_modules/safe-regex-test/index.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); -var isRegex = __webpack_require__(/*! is-regex */ "./node_modules/is-regex/index.js"); - -var $exec = callBound('RegExp.prototype.exec'); -var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); - -/** @type {import('.')} */ -module.exports = function regexTester(regex) { - if (!isRegex(regex)) { - throw new $TypeError('`regex` must be a RegExp'); - } - return function test(s) { - return $exec(regex, s) !== null; - }; -}; - - -/***/ }), - -/***/ "./node_modules/set-function-length/index.js": -/*!***************************************************!*\ - !*** ./node_modules/set-function-length/index.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); -var define = __webpack_require__(/*! define-data-property */ "./node_modules/define-data-property/index.js"); -var hasDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")(); -var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); - -var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); -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; -}; - - -/***/ }), - -/***/ "./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js": -/*!****************************************************************!*\ - !*** ./node_modules/tiny-invariant/dist/tiny-invariant.cjs.js ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; - - -var isProduction = "development" === 'production'; -var prefix = 'Invariant failed'; -function invariant(condition, message) { - if (condition) { - return; - } - if (isProduction) { - throw new Error(prefix); - } - var provided = typeof message === 'function' ? message() : message; - var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix; - throw new Error(value); -} - -module.exports = invariant; - - -/***/ }), - -/***/ "./node_modules/tslib/tslib.es6.mjs": -/*!******************************************!*\ - !*** ./node_modules/tslib/tslib.es6.mjs ***! - \******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ __addDisposableResource: () => (/* binding */ __addDisposableResource), -/* harmony export */ __assign: () => (/* binding */ __assign), -/* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator), -/* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator), -/* harmony export */ __asyncValues: () => (/* binding */ __asyncValues), -/* harmony export */ __await: () => (/* binding */ __await), -/* harmony export */ __awaiter: () => (/* binding */ __awaiter), -/* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet), -/* harmony export */ __classPrivateFieldIn: () => (/* binding */ __classPrivateFieldIn), -/* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet), -/* harmony export */ __createBinding: () => (/* binding */ __createBinding), -/* harmony export */ __decorate: () => (/* binding */ __decorate), -/* harmony export */ __disposeResources: () => (/* binding */ __disposeResources), -/* harmony export */ __esDecorate: () => (/* binding */ __esDecorate), -/* harmony export */ __exportStar: () => (/* binding */ __exportStar), -/* harmony export */ __extends: () => (/* binding */ __extends), -/* harmony export */ __generator: () => (/* binding */ __generator), -/* harmony export */ __importDefault: () => (/* binding */ __importDefault), -/* harmony export */ __importStar: () => (/* binding */ __importStar), -/* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject), -/* harmony export */ __metadata: () => (/* binding */ __metadata), -/* harmony export */ __param: () => (/* binding */ __param), -/* harmony export */ __propKey: () => (/* binding */ __propKey), -/* harmony export */ __read: () => (/* binding */ __read), -/* harmony export */ __rest: () => (/* binding */ __rest), -/* harmony export */ __rewriteRelativeImportExtension: () => (/* binding */ __rewriteRelativeImportExtension), -/* harmony export */ __runInitializers: () => (/* binding */ __runInitializers), -/* harmony export */ __setFunctionName: () => (/* binding */ __setFunctionName), -/* harmony export */ __spread: () => (/* binding */ __spread), -/* harmony export */ __spreadArray: () => (/* binding */ __spreadArray), -/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays), -/* harmony export */ __values: () => (/* binding */ __values), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), 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]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - 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 (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -function __rewriteRelativeImportExtension(path, preserveJsx) { - if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); - }); - } - return path; -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, - __rewriteRelativeImportExtension, -}); - - -/***/ }), - -/***/ "./node_modules/util/support/isBufferBrowser.js": -/*!******************************************************!*\ - !*** ./node_modules/util/support/isBufferBrowser.js ***! - \******************************************************/ -/***/ ((module) => { - -module.exports = function isBuffer(arg) { - return arg && typeof arg === 'object' - && typeof arg.copy === 'function' - && typeof arg.fill === 'function' - && typeof arg.readUInt8 === 'function'; -} - -/***/ }), - -/***/ "./node_modules/util/support/types.js": -/*!********************************************!*\ - !*** ./node_modules/util/support/types.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -// Currently in sync with Node.js lib/internal/util/types.js -// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 - - - -var isArgumentsObject = __webpack_require__(/*! is-arguments */ "./node_modules/is-arguments/index.js"); -var isGeneratorFunction = __webpack_require__(/*! is-generator-function */ "./node_modules/is-generator-function/index.js"); -var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); -var isTypedArray = __webpack_require__(/*! is-typed-array */ "./node_modules/is-typed-array/index.js"); - -function uncurryThis(f) { - return f.call.bind(f); -} - -var BigIntSupported = typeof BigInt !== 'undefined'; -var SymbolSupported = typeof Symbol !== 'undefined'; - -var ObjectToString = uncurryThis(Object.prototype.toString); - -var numberValue = uncurryThis(Number.prototype.valueOf); -var stringValue = uncurryThis(String.prototype.valueOf); -var booleanValue = uncurryThis(Boolean.prototype.valueOf); - -if (BigIntSupported) { - var bigIntValue = uncurryThis(BigInt.prototype.valueOf); -} - -if (SymbolSupported) { - var symbolValue = uncurryThis(Symbol.prototype.valueOf); -} - -function checkBoxedPrimitive(value, prototypeValueOf) { - if (typeof value !== 'object') { - return false; - } - try { - prototypeValueOf(value); - return true; - } catch(e) { - return false; - } -} - -exports.isArgumentsObject = isArgumentsObject; -exports.isGeneratorFunction = isGeneratorFunction; -exports.isTypedArray = isTypedArray; - -// Taken from here and modified for better browser support -// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js -function isPromise(input) { - return ( - ( - typeof Promise !== 'undefined' && - input instanceof Promise - ) || - ( - input !== null && - typeof input === 'object' && - typeof input.then === 'function' && - typeof input.catch === 'function' - ) - ); -} -exports.isPromise = isPromise; - -function isArrayBufferView(value) { - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - return ArrayBuffer.isView(value); - } - - return ( - isTypedArray(value) || - isDataView(value) - ); -} -exports.isArrayBufferView = isArrayBufferView; - - -function isUint8Array(value) { - return whichTypedArray(value) === 'Uint8Array'; -} -exports.isUint8Array = isUint8Array; - -function isUint8ClampedArray(value) { - return whichTypedArray(value) === 'Uint8ClampedArray'; -} -exports.isUint8ClampedArray = isUint8ClampedArray; - -function isUint16Array(value) { - return whichTypedArray(value) === 'Uint16Array'; -} -exports.isUint16Array = isUint16Array; - -function isUint32Array(value) { - return whichTypedArray(value) === 'Uint32Array'; -} -exports.isUint32Array = isUint32Array; - -function isInt8Array(value) { - return whichTypedArray(value) === 'Int8Array'; -} -exports.isInt8Array = isInt8Array; - -function isInt16Array(value) { - return whichTypedArray(value) === 'Int16Array'; -} -exports.isInt16Array = isInt16Array; - -function isInt32Array(value) { - return whichTypedArray(value) === 'Int32Array'; -} -exports.isInt32Array = isInt32Array; - -function isFloat32Array(value) { - return whichTypedArray(value) === 'Float32Array'; -} -exports.isFloat32Array = isFloat32Array; - -function isFloat64Array(value) { - return whichTypedArray(value) === 'Float64Array'; -} -exports.isFloat64Array = isFloat64Array; - -function isBigInt64Array(value) { - return whichTypedArray(value) === 'BigInt64Array'; -} -exports.isBigInt64Array = isBigInt64Array; - -function isBigUint64Array(value) { - return whichTypedArray(value) === 'BigUint64Array'; -} -exports.isBigUint64Array = isBigUint64Array; - -function isMapToString(value) { - return ObjectToString(value) === '[object Map]'; -} -isMapToString.working = ( - typeof Map !== 'undefined' && - isMapToString(new Map()) -); - -function isMap(value) { - if (typeof Map === 'undefined') { - return false; - } - - return isMapToString.working - ? isMapToString(value) - : value instanceof Map; -} -exports.isMap = isMap; - -function isSetToString(value) { - return ObjectToString(value) === '[object Set]'; -} -isSetToString.working = ( - typeof Set !== 'undefined' && - isSetToString(new Set()) -); -function isSet(value) { - if (typeof Set === 'undefined') { - return false; - } - - return isSetToString.working - ? isSetToString(value) - : value instanceof Set; -} -exports.isSet = isSet; - -function isWeakMapToString(value) { - return ObjectToString(value) === '[object WeakMap]'; -} -isWeakMapToString.working = ( - typeof WeakMap !== 'undefined' && - isWeakMapToString(new WeakMap()) -); -function isWeakMap(value) { - if (typeof WeakMap === 'undefined') { - return false; - } - - return isWeakMapToString.working - ? isWeakMapToString(value) - : value instanceof WeakMap; -} -exports.isWeakMap = isWeakMap; - -function isWeakSetToString(value) { - return ObjectToString(value) === '[object WeakSet]'; -} -isWeakSetToString.working = ( - typeof WeakSet !== 'undefined' && - isWeakSetToString(new WeakSet()) -); -function isWeakSet(value) { - return isWeakSetToString(value); -} -exports.isWeakSet = isWeakSet; - -function isArrayBufferToString(value) { - return ObjectToString(value) === '[object ArrayBuffer]'; -} -isArrayBufferToString.working = ( - typeof ArrayBuffer !== 'undefined' && - isArrayBufferToString(new ArrayBuffer()) -); -function isArrayBuffer(value) { - if (typeof ArrayBuffer === 'undefined') { - return false; - } - - return isArrayBufferToString.working - ? isArrayBufferToString(value) - : value instanceof ArrayBuffer; -} -exports.isArrayBuffer = isArrayBuffer; - -function isDataViewToString(value) { - return ObjectToString(value) === '[object DataView]'; -} -isDataViewToString.working = ( - typeof ArrayBuffer !== 'undefined' && - typeof DataView !== 'undefined' && - isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)) -); -function isDataView(value) { - if (typeof DataView === 'undefined') { - return false; - } - - return isDataViewToString.working - ? isDataViewToString(value) - : value instanceof DataView; -} -exports.isDataView = isDataView; - -// Store a copy of SharedArrayBuffer in case it's deleted elsewhere -var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; -function isSharedArrayBufferToString(value) { - return ObjectToString(value) === '[object SharedArrayBuffer]'; -} -function isSharedArrayBuffer(value) { - if (typeof SharedArrayBufferCopy === 'undefined') { - return false; - } - - if (typeof isSharedArrayBufferToString.working === 'undefined') { - isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); - } - - return isSharedArrayBufferToString.working - ? isSharedArrayBufferToString(value) - : value instanceof SharedArrayBufferCopy; -} -exports.isSharedArrayBuffer = isSharedArrayBuffer; - -function isAsyncFunction(value) { - return ObjectToString(value) === '[object AsyncFunction]'; -} -exports.isAsyncFunction = isAsyncFunction; - -function isMapIterator(value) { - return ObjectToString(value) === '[object Map Iterator]'; -} -exports.isMapIterator = isMapIterator; - -function isSetIterator(value) { - return ObjectToString(value) === '[object Set Iterator]'; -} -exports.isSetIterator = isSetIterator; - -function isGeneratorObject(value) { - return ObjectToString(value) === '[object Generator]'; -} -exports.isGeneratorObject = isGeneratorObject; - -function isWebAssemblyCompiledModule(value) { - return ObjectToString(value) === '[object WebAssembly.Module]'; -} -exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; - -function isNumberObject(value) { - return checkBoxedPrimitive(value, numberValue); -} -exports.isNumberObject = isNumberObject; - -function isStringObject(value) { - return checkBoxedPrimitive(value, stringValue); -} -exports.isStringObject = isStringObject; - -function isBooleanObject(value) { - return checkBoxedPrimitive(value, booleanValue); -} -exports.isBooleanObject = isBooleanObject; - -function isBigIntObject(value) { - return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); -} -exports.isBigIntObject = isBigIntObject; - -function isSymbolObject(value) { - return SymbolSupported && checkBoxedPrimitive(value, symbolValue); -} -exports.isSymbolObject = isSymbolObject; - -function isBoxedPrimitive(value) { - return ( - isNumberObject(value) || - isStringObject(value) || - isBooleanObject(value) || - isBigIntObject(value) || - isSymbolObject(value) - ); -} -exports.isBoxedPrimitive = isBoxedPrimitive; - -function isAnyArrayBuffer(value) { - return typeof Uint8Array !== 'undefined' && ( - isArrayBuffer(value) || - isSharedArrayBuffer(value) - ); -} -exports.isAnyArrayBuffer = isAnyArrayBuffer; - -['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) { - Object.defineProperty(exports, method, { - enumerable: false, - value: function() { - throw new Error(method + ' is not supported in userland'); - } - }); -}); - - -/***/ }), - -/***/ "./node_modules/util/util.js": -/*!***********************************!*\ - !*** ./node_modules/util/util.js ***! - \***********************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); -// 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 getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || - function getOwnPropertyDescriptors(obj) { - var keys = Object.keys(obj); - var descriptors = {}; - for (var i = 0; i < keys.length; i++) { - descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); - } - return descriptors; - }; - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - if (typeof process !== 'undefined' && process.noDeprecation === true) { - return fn; - } - - // Allow for deprecating things in the process of starting up. - if (typeof process === 'undefined') { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -var debugs = {}; -var debugEnvRegex = /^$/; - -if (process.env.NODE_DEBUG) { - var debugEnv = process.env.NODE_DEBUG; - debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') - .replace(/\*/g, '.*') - .replace(/,/g, '$|^') - .toUpperCase(); - debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i'); -} -exports.debuglog = function(set) { - set = set.toUpperCase(); - if (!debugs[set]) { - if (debugEnvRegex.test(set)) { - var pid = process.pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -} - - -function stylizeNoColor(str, styleType) { - return str; -} - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -} - - -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').slice(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.slice(1, -1); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -exports.types = __webpack_require__(/*! ./support/types */ "./node_modules/util/support/types.js"); - -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; -exports.types.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; -exports.types.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; -exports.types.isNativeError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ "./node_modules/util/support/isBufferBrowser.js"); - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; - -exports.promisify = function promisify(original) { - if (typeof original !== 'function') - throw new TypeError('The "original" argument must be of type Function'); - - if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { - var fn = original[kCustomPromisifiedSymbol]; - if (typeof fn !== 'function') { - throw new TypeError('The "util.promisify.custom" argument must be of type Function'); - } - Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return fn; - } - - function fn() { - var promiseResolve, promiseReject; - var promise = new Promise(function (resolve, reject) { - promiseResolve = resolve; - promiseReject = reject; - }); - - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - args.push(function (err, value) { - if (err) { - promiseReject(err); - } else { - promiseResolve(value); - } - }); - - try { - original.apply(this, args); - } catch (err) { - promiseReject(err); - } - - return promise; - } - - Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); - - if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return Object.defineProperties( - fn, - getOwnPropertyDescriptors(original) - ); -} - -exports.promisify.custom = kCustomPromisifiedSymbol - -function callbackifyOnRejected(reason, cb) { - // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). - // Because `null` is a special error value in callbacks which means "no error - // occurred", we error-wrap so the callback consumer can distinguish between - // "the promise rejected with null" or "the promise fulfilled with undefined". - if (!reason) { - var newReason = new Error('Promise was rejected with a falsy value'); - newReason.reason = reason; - reason = newReason; - } - return cb(reason); -} - -function callbackify(original) { - if (typeof original !== 'function') { - throw new TypeError('The "original" argument must be of type Function'); - } - - // We DO NOT return the promise as it gives the user a false sense that - // the promise is actually somehow related to the callback's execution - // and that the callback throwing will reject the promise. - function callbackified() { - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - - var maybeCb = args.pop(); - if (typeof maybeCb !== 'function') { - throw new TypeError('The last argument must be of type Function'); - } - var self = this; - var cb = function() { - return maybeCb.apply(self, arguments); - }; - // In true node style we process the callback on `nextTick` with all the - // implications (stack, `uncaughtException`, `async_hooks`) - original.apply(this, args) - .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) }, - function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) }); - } - - Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); - Object.defineProperties(callbackified, - getOwnPropertyDescriptors(original)); - return callbackified; -} -exports.callbackify = callbackify; - - -/***/ }), - -/***/ "./node_modules/which-typed-array/index.js": -/*!*************************************************!*\ - !*** ./node_modules/which-typed-array/index.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var forEach = __webpack_require__(/*! for-each */ "./node_modules/for-each/index.js"); -var availableTypedArrays = __webpack_require__(/*! available-typed-arrays */ "./node_modules/available-typed-arrays/index.js"); -var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); -var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); -var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); -var getProto = __webpack_require__(/*! get-proto */ "./node_modules/get-proto/index.js"); - -var $toString = callBound('Object.prototype.toString'); -var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); - -var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; -var typedArrays = availableTypedArrays(); - -var $slice = callBound('String.prototype.slice'); - -/** @type {(array: readonly T[], value: unknown) => number} */ -var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { - for (var i = 0; i < array.length; i += 1) { - if (array[i] === value) { - return i; - } - } - return -1; -}; - -/** @typedef {import('./types').Getter} Getter */ -/** @type {import('./types').Cache} */ -var cache = { __proto__: null }; -if (hasToStringTag && gOPD && getProto) { - forEach(typedArrays, function (typedArray) { - var arr = new g[typedArray](); - if (Symbol.toStringTag in arr && getProto) { - var proto = getProto(arr); - // @ts-expect-error TS won't narrow inside a closure - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor && proto) { - var superProto = getProto(proto); - // @ts-expect-error TS won't narrow inside a closure - descriptor = gOPD(superProto, Symbol.toStringTag); - } - // @ts-expect-error TODO: fix - cache['$' + typedArray] = callBind(descriptor.get); - } - }); -} else { - forEach(typedArrays, function (typedArray) { - var arr = new g[typedArray](); - var fn = arr.slice || arr.set; - if (fn) { - cache[ - /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray) - ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ ( - // @ts-expect-error TODO FIXME - callBind(fn) - ); - } - }); -} - -/** @type {(value: object) => false | import('.').TypedArrayName} */ -var tryTypedArrays = function tryAllTypedArrays(value) { - /** @type {ReturnType} */ var found = false; - forEach( - /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ (cache), - /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ - function (getter, typedArray) { - if (!found) { - try { - // @ts-expect-error a throw is fine here - if ('$' + getter(value) === typedArray) { - found = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1)); - } - } catch (e) { /**/ } - } - } - ); - return found; -}; - -/** @type {(value: object) => false | import('.').TypedArrayName} */ -var trySlices = function tryAllSlices(value) { - /** @type {ReturnType} */ var found = false; - forEach( - /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */(cache), - /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) { - if (!found) { - try { - // @ts-expect-error a throw is fine here - getter(value); - found = /** @type {import('.').TypedArrayName} */ ($slice(name, 1)); - } catch (e) { /**/ } - } - } - ); - return found; -}; - -/** @type {import('.')} */ -module.exports = function whichTypedArray(value) { - if (!value || typeof value !== 'object') { return false; } - if (!hasToStringTag) { - /** @type {string} */ - var tag = $slice($toString(value), 8, -1); - if ($indexOf(typedArrays, tag) > -1) { - return tag; - } - if (tag !== 'Object') { - return false; - } - // node < 0.6 hits here on real Typed Arrays - return trySlices(value); - } - if (!gOPD) { return null; } // unknown engine - return tryTypedArrays(value); -}; - - -/***/ }), - -/***/ "?5042": -/*!********************!*\ - !*** fs (ignored) ***! - \********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ id: moduleId, -/******/ loaded: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/node module decorator */ -/******/ (() => { -/******/ __webpack_require__.nmd = (module) => { -/******/ module.paths = []; -/******/ if (!module.children) module.children = []; -/******/ return module; -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. -(() => { -"use strict"; -/*!***********************!*\ - !*** ./src/lebab.mjs ***! - \***********************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ runTest: () => (/* binding */ runTest) -/* harmony export */ }); -/* harmony import */ var lebab__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lebab */ "./node_modules/lebab/index.js"); -// Copyright 2017 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - -const payloads = [ - { - name: "preact-8.2.5.js", - options: [ - "arg-rest", - "arg-spread", - "arrow", - "class", - "for-of", - "let", - "template", - "includes", - "obj-method", - "obj-shorthand", - ], - }, -]; - -function runTest(fileData) { - const testData = payloads.map(({ name, options }) => ({ - payload: fileData[name], - options, - })); - - return testData.map(({ payload, options }) => - lebab__WEBPACK_IMPORTED_MODULE_0__.transform(payload, options) - ); -} - -})(); - -self.WTBenchmark = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/web-tooling-benchmark/dist/lebab.bundle.min.js b/web-tooling-benchmark/dist/lebab.bundle.min.js new file mode 100644 index 00000000..cc3a397a --- /dev/null +++ b/web-tooling-benchmark/dist/lebab.bundle.min.js @@ -0,0 +1 @@ +(()=>{var e={58:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"VariableDeclaration"===e.type&&e.declarations.some(function(e){return(0,n.matchRequire)(e)||(0,n.matchRequireWithProperty)(e)})};var n=r(11592)},112:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=r(64522),a=n.__importDefault(r(35302)),o=Object.prototype.hasOwnProperty;t.default=function(e){var t=e.use(a.default),r=t.builtInTypes.array,n=t.builtInTypes.number,i=function e(t,r,n){if(!(this instanceof e))throw new Error("Path constructor cannot be invoked without 'new'");if(r){if(!(r instanceof e))throw new Error("")}else r=null,n=null;this.value=t,this.parentPath=r,this.name=n,this.__childCache=null},s=i.prototype;function u(e){return e.__childCache||(e.__childCache=Object.create(null))}function l(e,t){var r=u(e),n=e.getValueProperty(t),i=r[t];return o.call(r,t)&&i.value===n||(i=r[t]=new e.constructor(n,e,t)),i}function c(){}function p(e,t,i,a){if(r.assert(e.value),0===t)return c;var s=e.value.length;if(s<1)return c;var l=arguments.length;2===l?(i=0,a=s):3===l?(i=Math.max(i,0),a=s):(i=Math.max(i,0),a=Math.min(a,s)),n.assert(i),n.assert(a);for(var p=Object.create(null),f=u(e),h=i;h=0&&(a[e.name=o]=e)}else n[e.name]=e.value,a[e.name]=e;if(n[e.name]!==e.value)throw new Error("");if(e.parentPath.get(e.name)!==e)throw new Error("")}(this),r.check(n)){for(var s=n.length,l=p(this.parentPath,o-1,this.name+1),c=[this.name,1],f=0;f{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},1189:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(1093),a=Object.keys,o=a?function(e){return a(e)}:r(28875),s=Object.keys;o.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)})}else Object.keys=o;return Object.keys||o},e.exports=o},1244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){a.default.replace(e,{enter:function(e){var r=o(e);if(r){if(r.functionName)return void t.warn(e,"Unable to transform named function","obj-method");e.method=!0}}})};var n,i=r(25065),a=(n=r(88543))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"Property",key:{type:"Identifier"},value:{type:"FunctionExpression",id:(0,i.extractAny)("functionName")},method:!1,computed:!1,shorthand:!1})},1280:(e,t,r)=>{var n=r(90597),i=r(58633),a=r(77393).C,o=r(36462),s=r(15263).g;function u(e,t){var r=e;return"string"==typeof e&&(r=n.parseSourceMapInput(e)),null!=r.sections?new p(r,t):new l(r,t)}function l(e,t){var r=e;"string"==typeof e&&(r=n.parseSourceMapInput(e));var i=n.getArg(r,"version"),o=n.getArg(r,"sources"),s=n.getArg(r,"names",[]),u=n.getArg(r,"sourceRoot",null),l=n.getArg(r,"sourcesContent",null),c=n.getArg(r,"mappings"),p=n.getArg(r,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);u&&(u=n.normalize(u)),o=o.map(String).map(n.normalize).map(function(e){return u&&n.isAbsolute(u)&&n.isAbsolute(e)?n.relative(u,e):e}),this._names=a.fromArray(s.map(String),!0),this._sources=a.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return n.computeSourceURL(u,e,t)}),this.sourceRoot=u,this.sourcesContent=l,this._mappings=c,this._sourceMapURL=t,this.file=p}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function p(e,t){var r=e;"string"==typeof e&&(r=n.parseSourceMapInput(e));var i=n.getArg(r,"version"),o=n.getArg(r,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new a,this._names=new a;var s={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=n.getArg(e,"offset"),i=n.getArg(r,"line"),a=n.getArg(r,"column");if(i=0){var s=this._originalMappings[o];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)a.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)a.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o]}return a},t.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.prototype._findSourceIndex=function(e){var t,r=e;if(null!=this.sourceRoot&&(r=n.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);for(t=0;t1&&(r.source=m+a[1],m+=a[1],r.originalLine=h+a[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=d+a[3],d=r.originalColumn,a.length>4&&(r.name=y+a[4],y+=a[4])),E.push(r),"number"==typeof r.originalLine&&S.push(r)}s(E,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,s(S,n.compareByOriginalPositions),this.__originalMappings=S},l.prototype._findMapping=function(e,t,r,n,a,o){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return i.search(e,t,a,o)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var a=n.getArg(i,"source",null);null!==a&&(a=this._sources.at(a),a=n.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var o=n.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:a,line:n.getArg(i,"originalLine",null),column:n.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var i,a=e;if(null!=this.sourceRoot&&(a=n.relative(this.sourceRoot,a)),null!=this.sourceRoot&&(i=n.urlParse(this.sourceRoot))){var o=a.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!i.path||"/"==i.path)&&this._sources.has("/"+a))return this.sourcesContent[this._sources.indexOf("/"+a)]}if(t)return null;throw new Error('"'+a+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var t=n.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var r={source:t,originalLine:n.getArg(e,"line"),originalColumn:n.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(i>=0){var a=this._originalMappings[i];if(a.source===r.source)return{line:n.getArg(a,"generatedLine",null),column:n.getArg(a,"generatedColumn",null),lastColumn:n.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},p.prototype=Object.create(u.prototype),p.prototype.constructor=u,p.prototype._version=3,Object.defineProperty(p.prototype,"sources",{get:function(){for(var e=[],t=0;t{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(93017)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){e.use(i.default);var t=e.use(a.default),r=t.Type.def,n=t.Type.or,s=e.use(o.default).defaults;r("JSXAttribute").bases("Node").build("name","value").field("name",n(r("JSXIdentifier"),r("JSXNamespacedName"))).field("value",n(r("Literal"),r("JSXExpressionContainer"),r("JSXElement"),r("JSXFragment"),null),s.null),r("JSXIdentifier").bases("Identifier").build("name").field("name",String),r("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",r("JSXIdentifier")).field("name",r("JSXIdentifier")),r("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",n(r("JSXIdentifier"),r("JSXMemberExpression"))).field("property",r("JSXIdentifier")).field("computed",Boolean,s.false);var u=n(r("JSXIdentifier"),r("JSXNamespacedName"),r("JSXMemberExpression"));r("JSXSpreadAttribute").bases("Node").build("argument").field("argument",r("Expression"));var l=[n(r("JSXAttribute"),r("JSXSpreadAttribute"))];r("JSXExpressionContainer").bases("Expression").build("expression").field("expression",n(r("Expression"),r("JSXEmptyExpression")));var c=[n(r("JSXText"),r("JSXExpressionContainer"),r("JSXSpreadChild"),r("JSXElement"),r("JSXFragment"),r("Literal"))];r("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",r("JSXOpeningElement")).field("closingElement",n(r("JSXClosingElement"),null),s.null).field("children",c,s.emptyArray).field("name",u,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",l,function(){return this.openingElement.attributes},!0),r("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",u).field("attributes",l,s.emptyArray).field("selfClosing",Boolean,s.false),r("JSXClosingElement").bases("Node").build("name").field("name",u),r("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",r("JSXOpeningFragment")).field("closingFragment",r("JSXClosingFragment")).field("children",c,s.emptyArray),r("JSXOpeningFragment").bases("Node").build(),r("JSXClosingFragment").bases("Node").build(),r("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),r("JSXEmptyExpression").bases("Node").build(),r("JSXSpreadChild").bases("Node").build("expression").field("expression",r("Expression"))},(0,o.maybeSetModuleExports)(function(){return e})},1619:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(44480);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fromString=t.countSpaces=t.Lines=void 0;var n=r(31635),i=n.__importDefault(r(17676)),a=n.__importDefault(r(57035)),o=r(47289),s=r(64147),u=n.__importDefault(r(78369)),l=function(){function e(e,t){void 0===t&&(t=null),this.infos=e,this.mappings=[],this.cachedSourceMap=null,this.cachedTabWidth=void 0,(0,i.default)(e.length>0),this.length=e.length,this.name=t||null,this.name&&this.mappings.push(new u.default(this,{start:this.firstPos(),end:this.lastPos()}))}return e.prototype.toString=function(e){return this.sliceString(this.firstPos(),this.lastPos(),e)},e.prototype.getSourceMap=function(e,t){if(!e)return null;var r=this;function n(r){return(r=r||{}).file=e,t&&(r.sourceRoot=t),r}if(r.cachedSourceMap)return n(r.cachedSourceMap.toJSON());var o=new a.default.SourceMapGenerator(n()),u={};return r.mappings.forEach(function(e){for(var t=e.sourceLines.skipSpaces(e.sourceLoc.start)||e.sourceLines.lastPos(),n=r.skipSpaces(e.targetLoc.start)||r.lastPos();(0,s.comparePos)(t,e.sourceLoc.end)<0&&(0,s.comparePos)(n,e.targetLoc.end)<0;){var a=e.sourceLines.charAt(t),l=r.charAt(n);(0,i.default)(a===l);var c=e.sourceLines.name;if(o.addMapping({source:c,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column}}),!p.call(u,c)){var f=e.sourceLines.toString();o.setSourceContent(c,f),u[c]=f}r.nextPos(n,!0),e.sourceLines.nextPos(t,!0)}}),r.cachedSourceMap=o,o.toJSON()},e.prototype.bootstrapCharAt=function(e){(0,i.default)("object"==typeof e),(0,i.default)("number"==typeof e.line),(0,i.default)("number"==typeof e.column);var t=e.line,r=e.column,n=this.toString().split(m),a=n[t-1];return void 0===a?"":r===a.length&&t=a.length?"":a.charAt(r)},e.prototype.charAt=function(e){(0,i.default)("object"==typeof e),(0,i.default)("number"==typeof e.line),(0,i.default)("number"==typeof e.column);var t=e.line,r=e.column,n=this.infos[t-1],a=r;if(void 0===n||a<0)return"";var o=this.getIndentAt(t);return a=n.sliceEnd?"":n.line.charAt(a)},e.prototype.stripMargin=function(t,r){if(0===t)return this;if((0,i.default)(t>0,"negative margin: "+t),r&&1===this.length)return this;var a=new e(this.infos.map(function(e,i){return e.line&&(i>0||!r)&&(e=n.__assign(n.__assign({},e),{indent:Math.max(0,e.indent-t)})),e}));if(this.mappings.length>0){var o=a.mappings;(0,i.default)(0===o.length),this.mappings.forEach(function(e){o.push(e.indent(t,r,!0))})}return a},e.prototype.indent=function(t){if(0===t)return this;var r=new e(this.infos.map(function(e){return e.line&&!e.locked&&(e=n.__assign(n.__assign({},e),{indent:e.indent+t})),e}));if(this.mappings.length>0){var a=r.mappings;(0,i.default)(0===a.length),this.mappings.forEach(function(e){a.push(e.indent(t))})}return r},e.prototype.indentTail=function(t){if(0===t)return this;if(this.length<2)return this;var r=new e(this.infos.map(function(e,r){return r>0&&e.line&&!e.locked&&(e=n.__assign(n.__assign({},e),{indent:e.indent+t})),e}));if(this.mappings.length>0){var a=r.mappings;(0,i.default)(0===a.length),this.mappings.forEach(function(e){a.push(e.indent(t,!0))})}return r},e.prototype.lockIndentTail=function(){return this.length<2?this:new e(this.infos.map(function(e,t){return n.__assign(n.__assign({},e),{locked:t>0})}))},e.prototype.getIndentAt=function(e){return(0,i.default)(e>=1,"no line "+e+" (line numbers start from 1)"),Math.max(this.infos[e-1].indent,0)},e.prototype.guessTabWidth=function(){if("number"==typeof this.cachedTabWidth)return this.cachedTabWidth;for(var e=[],t=0,r=1,n=this.length;r<=n;++r){var i=this.infos[r-1];if(!g(i.line.slice(i.sliceStart,i.sliceEnd))){var a=Math.abs(i.indent-t);e[a]=1+~~e[a],t=i.indent}}for(var o=-1,s=2,u=1;uo&&(o=e[u],s=u);return this.cachedTabWidth=s},e.prototype.startsWithComment=function(){if(0===this.infos.length)return!1;var e=this.infos[0],t=e.sliceStart,r=e.sliceEnd,n=e.line.slice(t,r).trim();return 0===n.length||"//"===n.slice(0,2)||"/*"===n.slice(0,2)},e.prototype.isOnlyWhitespace=function(){return g(this.toString())},e.prototype.isPrecededOnlyByWhitespace=function(e){var t=this.infos[e.line-1],r=Math.max(t.indent,0),n=e.column-r;if(n<=0)return!0;var i=t.sliceStart,a=Math.min(i+n,t.sliceEnd);return g(t.line.slice(i,a))},e.prototype.getLineLength=function(e){var t=this.infos[e-1];return this.getIndentAt(e)+t.sliceEnd-t.sliceStart},e.prototype.nextPos=function(e,t){void 0===t&&(t=!1);var r=Math.max(e.line,0);return Math.max(e.column,0)0&&(r.push(r.pop().slice(0,t.column)),r[0]=r[0].slice(e.column)),y(r.join("\n"))},e.prototype.slice=function(t,r){if(!r){if(!t)return this;r=this.lastPos()}if(!t)throw new Error("cannot slice with end but not start");var n=this.infos.slice(t.line-1,r.line);t.line===r.line?n[0]=v(n[0],t.column,r.column):((0,i.default)(t.line0){var o=a.mappings;(0,i.default)(0===o.length),this.mappings.forEach(function(e){var n=e.slice(this,t,r);n&&o.push(n)},this)}return a},e.prototype.bootstrapSliceString=function(e,t,r){return this.slice(e,t).toString(r)},e.prototype.sliceString=function(e,t,r){void 0===e&&(e=this.firstPos()),void 0===t&&(t=this.lastPos());for(var n=(0,o.normalize)(r),i=n.tabWidth,a=n.useTabs,s=n.reuseWhitespace,u=n.lineTerminator,l=[],c=e.line;c<=t.line;++c){var p=this.infos[c-1];c===e.line?p=c===t.line?v(p,e.column,t.column):v(p,e.column):c===t.line&&(p=v(p,0,t.column));var f=Math.max(p.indent,0),d=p.line.slice(0,p.sliceStart);if(s&&g(d)&&h(d,i)===f)l.push(p.line.slice(0,p.sliceEnd));else{var m=0,y=f;a&&(y-=(m=Math.floor(f/i))*i);var b="";m>0&&(b+=new Array(m+1).join("\t")),y>0&&(b+=new Array(y+1).join(" ")),b+=p.line.slice(p.sliceStart,p.sliceEnd),l.push(b)}}return l.join(u)},e.prototype.isEmpty=function(){return this.length<2&&this.getLineLength(1)<1},e.prototype.join=function(t){var r,i=this,a=[],o=[];function s(e){if(null!==e){if(r){var t=e.infos[0],i=new Array(t.indent+1).join(" "),s=a.length,u=Math.max(r.indent,0)+r.sliceEnd-r.sliceStart;r.line=r.line.slice(0,r.sliceEnd)+i+t.line.slice(t.sliceStart,t.sliceEnd),r.locked=r.locked||t.locked,r.sliceEnd=r.line.length,e.mappings.length>0&&e.mappings.forEach(function(e){o.push(e.add(s,u))})}else e.mappings.length>0&&o.push.apply(o,e.mappings);e.infos.forEach(function(e,t){(!r||t>0)&&(r=n.__assign({},e),a.push(r))})}}if(t.map(function(e){var t=y(e);return t.isEmpty()?null:t}).forEach(function(e,t){i.isEmpty()?s(e):function(e,t){t>0&&s(i),s(e)}(e,t)}),a.length<1)return b;var u=new e(a);return u.mappings=o,u},e.prototype.concat=function(){for(var e=[],t=0;t0);var o=Math.ceil(r/t)*t;o===r?r+=t:r=o;break;case 11:case 12:case 13:case 65279:break;default:r+=1}return r}t.countSpaces=h;var d=/^\s*/,m=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function y(e,t){if(e instanceof l)return e;e+="";var r=t&&t.tabWidth,n=e.indexOf("\t")<0,a=!t&&n&&e.length<=f;if((0,i.default)(r||n,"No tab width specified but encountered tabs in string\n"+e),a&&p.call(c,e))return c[e];var s=new l(e.split(m).map(function(e){var t=d.exec(e)[0];return{line:e,indent:h(t,r),locked:!1,sliceStart:t.length,sliceEnd:e.length}}),(0,o.normalize)(t).sourceFileName);return a&&(c[e]=s),s}function g(e){return!/\S/.test(e)}function v(e,t,r){var n=e.sliceStart,a=e.sliceEnd,o=Math.max(e.indent,0),s=o+a-n;return void 0===r&&(r=s),t=Math.max(t,0),r=Math.min(r,s),(r=Math.max(r,t))=0),(0,i.default)(n<=a),(0,i.default)(s===o+a-n),e.indent===o&&e.sliceStart===n&&e.sliceEnd===a?e:{line:e.line,indent:o,locked:!1,sliceStart:n,sliceEnd:a}}t.fromString=y,t.concat=function(e){return b.join(e)};var b=y("")},2242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractVariableNames=function(e){return i(e).map(function(e){return e.name})},t.extractVariables=i;var n=r(44480);function i(e){return"Identifier"===e.type?[e]:"ArrayPattern"===e.type?(0,n.flatMap)(i,(0,n.compact)(e.elements)):"ObjectPattern"===e.type?(0,n.flatMap)(i,e.properties):"Property"===e.type?i(e.value):"AssignmentPattern"===e.type?i(e.left):[]}},2874:e=>{e.exports={}},3475:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=new c.default(e);s.default.traverse(e,(0,u.default)(e,{enter:function(e,n,i){l.isFunction(e)&&i.variables.filter(y).map(function(e){return{variable:e,exs:g(e,r)}}).filter(function(e){return e.exs.length>0}).forEach(function(r){var n=r.variable,i=r.exs,s=e.params.findIndex(function(e){return e===n.defs[0].name});-1!==s&&(w(i).length>m?t.warn(e,"".concat(w(i).length," different props found, will not transform more than ").concat(m),"destruct-param"):(e.params[s]=function(e){var t=w(e).join(", "),r="function foo({".concat(t,"}) {};"),n=(0,a.parse)(r,{parser:o.default});return n.program.body[0].params[0]}(i),i.forEach(function(e){e.type=e.property.type,e.name=e.property.name})))})}}))};var i=r(44480),a=r(64230),o=f(r(84120)),s=f(r(88543)),u=f(r(73079)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}i.default=e,r&&r.set(e,i);return i}(r(57249)),c=f(r(22598));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";var n=r(65606);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;te.length)&&(r=e.length),e.substring(r-t.length,r)===t}var x="",S="",E="",_="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function D(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function k(e,t,r){var i="",a="",o=0,s="",u=!1,l=D(e),c=l.split("\n"),p=D(t).split("\n"),f=0,h="";if("strictEqual"===r&&"object"===y(e)&&"object"===y(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===p.length&&c[0]!==p[0]){var d=c[0].length+p[0].length;if(d<=10){if(!("object"===y(e)&&null!==e||"object"===y(t)&&null!==t||0===e&&0===t))return"".concat(w[r],"\n\n")+"".concat(c[0]," !== ").concat(p[0],"\n")}else if("strictEqualObject"!==r){if(d<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][f]===p[0][f];)f++;f>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}}for(var m=c[c.length-1],g=p[p.length-1];m===g&&(f++<2?s="\n ".concat(m).concat(s):i=m,c.pop(),p.pop(),0!==c.length&&0!==p.length);)m=c[c.length-1],g=p[p.length-1];var v=Math.max(c.length,p.length);if(0===v){var A=l.split("\n");if(A.length>30)for(A[26]="".concat(x,"...").concat(_);A.length>27;)A.pop();return"".concat(w.notIdentical,"\n\n").concat(A.join("\n"),"\n")}f>3&&(s="\n".concat(x,"...").concat(_).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var k=0,C=w[r]+"\n".concat(S,"+ actual").concat(_," ").concat(E,"- expected").concat(_),T=" ".concat(x,"...").concat(_," Lines skipped");for(f=0;f1&&f>2&&(P>4?(a+="\n".concat(x,"...").concat(_),u=!0):P>3&&(a+="\n ".concat(p[f-2]),k++),a+="\n ".concat(p[f-1]),k++),o=f,i+="\n".concat(E,"-").concat(_," ").concat(p[f]),k++;else if(p.length1&&f>2&&(P>4?(a+="\n".concat(x,"...").concat(_),u=!0):P>3&&(a+="\n ".concat(c[f-2]),k++),a+="\n ".concat(c[f-1]),k++),o=f,a+="\n".concat(S,"+").concat(_," ").concat(c[f]),k++;else{var O=p[f],j=c[f],F=j!==O&&(!b(j,",")||j.slice(0,-1)!==O);F&&b(O,",")&&O.slice(0,-1)===j&&(F=!1,j+=","),F?(P>1&&f>2&&(P>4?(a+="\n".concat(x,"...").concat(_),u=!0):P>3&&(a+="\n ".concat(c[f-2]),k++),a+="\n ".concat(c[f-1]),k++),o=f,a+="\n".concat(S,"+").concat(_," ").concat(j),i+="\n".concat(E,"-").concat(_," ").concat(O),k+=2):(a+=i,i="",1!==P&&0!==f||(a+="\n ".concat(j),k++))}if(k>20&&f30)for(h[26]="".concat(x,"...").concat(_);h.length>27;)h.pop();t=1===h.length?f.call(this,"".concat(p," ").concat(h[0])):f.call(this,"".concat(p,"\n\n").concat(h.join("\n"),"\n"))}else{var d=D(o),m="",g=w[i];"notDeepEqual"===i||"notEqual"===i?(d="".concat(w[i],"\n\n").concat(d)).length>1024&&(d="".concat(d.slice(0,1021),"...")):(m="".concat(D(s)),d.length>512&&(d="".concat(d.slice(0,509),"...")),m.length>512&&(m="".concat(m.slice(0,509),"...")),"deepEqual"===i||"equal"===i?d="".concat(g,"\n\n").concat(d,"\n\nshould equal\n\n"):m=" ".concat(i," ").concat(m)),t=f.call(this,"".concat(d).concat(m))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=o,t.expected=s,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(t),a),t.stack,t.name="AssertionError",l(t)}return o=b,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,a(a({},t),{},{customInspect:!1,depth:0}))}}])&&s(o.prototype,u),p&&s(o,p),Object.defineProperty(o,"prototype",{writable:!1}),b}(p(Error),g.custom);e.exports=C},4333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(25065);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getReprinter=t.Patcher=void 0;var n=r(31635),i=n.__importDefault(r(17676)),a=n.__importStar(r(1688)),o=n.__importStar(r(41434)),s=o.namedTypes.Printable,u=o.namedTypes.Expression,l=o.namedTypes.ReturnStatement,c=o.namedTypes.SourceLocation,p=r(64147),f=n.__importDefault(r(72325)),h=o.builtInTypes.object,d=o.builtInTypes.array,m=o.builtInTypes.string,y=/[0-9a-z_$]/i,g=function e(t){(0,i.default)(this instanceof e),(0,i.default)(t instanceof a.Lines);var r=[];this.replace=function(e,t){m.check(t)&&(t=a.fromString(t)),r.push({lines:t,start:e.start,end:e.end})},this.get=function(e){var n=(e=e||{start:{line:1,column:0},end:{line:t.length,column:t.getLineLength(t.length)}}).start,o=[];function s(e,r){(0,i.default)((0,p.comparePos)(e,r)<=0),o.push(t.slice(e,r))}return r.sort(function(e,t){return(0,p.comparePos)(e.start,t.start)}).forEach(function(e){(0,p.comparePos)(n,e.start)>0||(s(n,e.start),o.push(e.lines),n=e.end)}),s(n,e.end),a.concat(o)}};t.Patcher=g;var v=g.prototype;function b(e){var t=[];return e.comments&&e.comments.length>0&&e.comments.forEach(function(e){(e.leading||e.trailing)&&t.push(e)}),t}function x(e,t,r){var n=e.getValue();return n===t.getValue()||(d.check(n)?S(e,t,r):!!h.check(n)&&function(e,t,r){var n=e.getValue();if(h.assert(n),null===n.original)return!1;var i=t.getValue();if(!h.check(i))return!1;if(n===i||e.valueIsDuplicate()||t.valueIsDuplicate())return!0;if(s.check(n)){if(!s.check(i))return!1;var a=e.getParentNode(),o=t.getParentNode();if(null!==o&&"FunctionTypeAnnotation"===o.type&&null!==a&&"FunctionTypeAnnotation"===a.type){var l=1!==o.params.length||!!o.params[0].name,c=1!==a.params.length||!!a.params[0].name;if(!l&&c)return!1}if(n.type===i.type){var p=[];if(E(e,t,p))r.push.apply(r,p);else{if(!i.loc)return!1;r.push({oldPath:t.copy(),newPath:e.copy()})}return!0}return!!(u.check(n)&&u.check(i)&&i.loc)&&(r.push({oldPath:t.copy(),newPath:e.copy()}),!0)}return E(e,t,r)}(e,t,r))}function S(e,t,r){var n=e.getValue(),i=t.getValue();if(n===i||e.valueIsDuplicate()||t.valueIsDuplicate())return!0;d.assert(n);var a=n.length;if(!d.check(i)||i.length!==a)return!1;for(var o=0;os)}v.tryToReprintComments=function(e,t,r){var n=this;if(!e.comments&&!t.comments)return!0;var a=f.default.from(e),o=f.default.from(t);a.stack.push("comments",b(e)),o.stack.push("comments",b(t));var s=[],u=S(a,o,s);return u&&s.length>0&&s.forEach(function(e){var t=e.oldPath.getValue();(0,i.default)(t.leading||t.trailing),n.replace(t.loc,r(e.newPath).indentTail(t.loc.indent))}),u},v.deleteComments=function(e){if(e.comments){var t=this;e.comments.forEach(function(r){r.leading?t.replace({start:r.loc.start,end:e.loc.lines.skipSpaces(r.loc.end,!1,!1)},""):r.trailing&&t.replace({start:e.loc.lines.skipSpaces(r.loc.start,!0,!1),end:r.loc.end},"")})}},t.getReprinter=function(e){(0,i.default)(e instanceof f.default);var t=e.getValue();if(s.check(t)){var r=t.original,n=r&&r.loc,o=n&&n.lines,u=[];if(o&&function(e,t){var r=e.getValue();s.assert(r);var n=r.original;if(s.assert(n),(0,i.default)(0===t.length),r.type!==n.type)return!1;var a=new f.default(n),o=E(e,a,t);o||(t.length=0);return o}(e,u))return function(t){var i=new g(o);u.forEach(function(e){var r=e.newPath.getValue(),n=e.oldPath.getValue();c.assert(n.loc,!0);var s=!i.tryToReprintComments(r,n,t);s&&i.deleteComments(n);var u=t(e.newPath,{includeComments:s,avoidRootParens:n.type===r.type&&e.oldPath.hasParens()}).indentTail(n.loc.indent),l=function(e,t,r){var n=(0,p.copyPos)(t.start),i=e.prevPos(n)&&e.charAt(n),a=r.charAt(r.firstPos());return i&&y.test(i)&&a&&y.test(a)}(o,n.loc,u),f=function(e,t,r){var n=e.charAt(t.end),i=r.lastPos(),a=r.prevPos(i)&&r.charAt(i);return a&&y.test(a)&&n&&y.test(n)}(o,n.loc,u);if(l||f){var h=[];l&&h.push(" "),h.push(u),f&&h.push(" "),u=a.concat(h)}i.replace(n.loc,u)});var s=i.get(n).indentTail(-r.loc.indent);return e.needsParens()?a.concat(["(",s,")"]):s}}}},4535:e=>{"use strict";e.exports=JSON.parse('{"name":"escope","description":"ECMAScript scope analyzer","homepage":"http://github.com/estools/escope","main":"lib/index.js","files":["lib"],"version":"4.0.0","engines":{"node":">=4.0"},"maintainers":[{"name":"Yusuke Suzuki","email":"utatane.tea@gmail.com","web":"http://github.com/Constellation"}],"repository":{"type":"git","url":"https://github.com/estools/escope.git"},"dependencies":{"esrecurse":"^4.1.0","estraverse":"^4.1.1"},"devDependencies":{"babel":"^6.3.26","babel-preset-es2015":"^6.3.13","babel-register":"^6.3.13","browserify":"^14.4.0","chai":"^4.0.2","espree":"^3.1.1","esprima":"^3.0.0","gulp":"^3.9.0","gulp-babel":"^6.1.1","gulp-bump":"^2.7.0","gulp-eslint":"^4.0.0","gulp-espower":"^1.0.2","gulp-filter":"^5.0.0","gulp-git":"^2.4.1","gulp-mocha":"^3.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.6.0","gulp-tag-version":"^1.3.0","jsdoc":"^3.4.0","lazypipe":"^1.0.1","vinyl-source-stream":"^1.1.0"},"license":"BSD-2-Clause","scripts":{"test":"gulp travis","unit-test":"gulp test","lint":"gulp lint","jsdoc":"jsdoc src/*.js README.md"}}')},5471:(e,t,r)=>{var n=r(36462),i=r(90597),a=r(77393).C,o=r(45180).P;function s(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new a,this._names=new a,this._mappings=new o,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(e){var t=e.sourceRoot,r=new s({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=i.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)}),e.sources.forEach(function(n){var a=n;null!==t&&(a=i.relative(t,n)),r._sources.has(a)||r._sources.add(a);var o=e.sourceContentFor(n);null!=o&&r.setSourceContent(n,o)}),r},s.prototype.addMapping=function(e){var t=i.getArg(e,"generated"),r=i.getArg(e,"original",null),n=i.getArg(e,"source",null),a=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,a),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=a&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:a})},s.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var o=this._sourceRoot;null!=o&&(n=i.relative(o,n));var s=new a,u=new a;this._mappings.unsortedForEach(function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=i.join(r,t.source)),null!=o&&(t.source=i.relative(o,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||s.has(l)||s.add(l);var c=t.name;null==c||u.has(c)||u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=i.join(r,t)),null!=o&&(t=i.relative(o,t)),this.setSourceContent(t,n))},this)},s.prototype._validateMapping=function(e,t,r,n){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},s.prototype._serializeMappings=function(){for(var e,t,r,a,o=0,s=1,u=0,l=0,c=0,p=0,f="",h=this._mappings.toArray(),d=0,m=h.length;d0){if(!i.compareByGeneratedPositionsInflated(t,h[d-1]))continue;e+=","}e+=n.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(a=this._sources.indexOf(t.source),e+=n.encode(a-p),p=a,e+=n.encode(t.originalLine-1-l),l=t.originalLine-1,e+=n.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=n.encode(r-c),c=r)),f+=e}return f},s.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=i.relative(t,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},s.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s},5812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=o(e),r=t.className,n=t.properties;if(r)return{className:r,methods:n.map(function(e){return{propertyNode:e,methodName:e.key.name,methodNode:e.value,kind:e.kind}})}};var n,i=r(25065),a=(n=r(33354))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",left:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:(0,i.extractAny)("className")},property:{type:"Identifier",name:"prototype"}},operator:"=",right:{type:"ObjectExpression",properties:(0,i.extract)("properties",function(e){return e.every(a.default)})}}})},6013:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";e.exports=Math.max},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},7176:(e,t,r)=>{"use strict";var n,i=r(73126),a=r(75795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!n&&a&&a(Object.prototype,"__proto__"),s=Object,u=s.getPrototypeOf;e.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof u&&function(e){return u(null==e?e:s(e))}},8454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=i(e)||{},r=t.name,n=t.name2,a=t.name3,o=t.value;if(r&&r===n&&r===a)return{name:r,value:o,node:e}};var n=r(25065),i=(0,n.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",left:{type:"Identifier",name:(0,n.extractAny)("name")},operator:"=",right:{type:"ConditionalExpression",test:{type:"Identifier",name:(0,n.extractAny)("name2")},consequent:{type:"Identifier",name:(0,n.extractAny)("name3")},alternate:(0,n.extractAny)("value")}}})},8651:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(93017)),a=n.__importDefault(r(19616)),o=n.__importDefault(r(35302)),s=n.__importStar(r(64522));t.default=function(e){e.use(i.default),e.use(a.default);var t=e.use(o.default),r=t.Type.def,n=t.Type.or,u=e.use(s.default).defaults;r("Flow").bases("Node"),r("FlowType").bases("Flow"),r("AnyTypeAnnotation").bases("FlowType").build(),r("EmptyTypeAnnotation").bases("FlowType").build(),r("MixedTypeAnnotation").bases("FlowType").build(),r("VoidTypeAnnotation").bases("FlowType").build(),r("SymbolTypeAnnotation").bases("FlowType").build(),r("NumberTypeAnnotation").bases("FlowType").build(),r("BigIntTypeAnnotation").bases("FlowType").build(),r("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),r("StringTypeAnnotation").bases("FlowType").build(),r("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),r("BooleanTypeAnnotation").bases("FlowType").build(),r("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),r("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullLiteralTypeAnnotation").bases("FlowType").build(),r("NullTypeAnnotation").bases("FlowType").build(),r("ThisTypeAnnotation").bases("FlowType").build(),r("ExistsTypeAnnotation").bases("FlowType").build(),r("ExistentialTypeParam").bases("FlowType").build(),r("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[r("FunctionTypeParam")]).field("returnType",r("FlowType")).field("rest",n(r("FunctionTypeParam"),null)).field("typeParameters",n(r("TypeParameterDeclaration"),null)),r("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",n(r("Identifier"),null)).field("typeAnnotation",r("FlowType")).field("optional",Boolean),r("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",r("FlowType")),r("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[n(r("ObjectTypeProperty"),r("ObjectTypeSpreadProperty"))]).field("indexers",[r("ObjectTypeIndexer")],u.emptyArray).field("callProperties",[r("ObjectTypeCallProperty")],u.emptyArray).field("inexact",n(Boolean,void 0),u[void 0]).field("exact",Boolean,u.false).field("internalSlots",[r("ObjectTypeInternalSlot")],u.emptyArray),r("Variance").bases("Node").build("kind").field("kind",n("plus","minus"));var l=n(r("Variance"),"plus","minus",null);r("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",n(r("Literal"),r("Identifier"))).field("value",r("FlowType")).field("optional",Boolean).field("variance",l,u.null),r("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",r("Identifier")).field("key",r("FlowType")).field("value",r("FlowType")).field("variance",l,u.null).field("static",Boolean,u.false),r("ObjectTypeCallProperty").bases("Node").build("value").field("value",r("FunctionTypeAnnotation")).field("static",Boolean,u.false),r("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",n(r("Identifier"),r("QualifiedTypeIdentifier"))).field("id",r("Identifier")),r("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",n(r("Identifier"),r("QualifiedTypeIdentifier"))).field("typeParameters",n(r("TypeParameterInstantiation"),null)),r("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",r("Identifier")).field("property",n(r("MemberTypeAnnotation"),r("GenericTypeAnnotation"))),r("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",r("FlowType")).field("indexType",r("FlowType")),r("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",r("FlowType")).field("indexType",r("FlowType")).field("optional",Boolean),r("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",r("FlowType")),r("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",r("FlowType")),r("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",r("Identifier")).field("value",r("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),r("TypeParameterDeclaration").bases("Node").build("params").field("params",[r("TypeParameter")]),r("TypeParameterInstantiation").bases("Node").build("params").field("params",[r("FlowType")]),r("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",l,u.null).field("bound",n(r("TypeAnnotation"),null),u.null).field("default",n(r("FlowType"),null),u.null),r("ClassProperty").field("variance",l,u.null),r("ClassImplements").bases("Node").build("id").field("id",r("Identifier")).field("superClass",n(r("Expression"),null),u.null).field("typeParameters",n(r("TypeParameterInstantiation"),null),u.null),r("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",r("ObjectTypeAnnotation")).field("extends",n([r("InterfaceExtends")],null),u.null),r("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",r("Identifier")).field("typeParameters",n(r("TypeParameterDeclaration"),null),u.null).field("body",r("ObjectTypeAnnotation")).field("extends",[r("InterfaceExtends")]),r("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),r("InterfaceExtends").bases("Node").build("id").field("id",r("Identifier")).field("typeParameters",n(r("TypeParameterInstantiation"),null),u.null),r("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",r("Identifier")).field("typeParameters",n(r("TypeParameterDeclaration"),null)).field("right",r("FlowType")),r("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),r("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",r("Identifier")).field("typeParameters",n(r("TypeParameterDeclaration"),null)).field("impltype",r("FlowType")).field("supertype",n(r("FlowType"),null)),r("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",n(r("FlowType"),null)),r("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",r("Expression")).field("typeAnnotation",r("TypeAnnotation")),r("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("DeclareVariable").bases("Statement").build("id").field("id",r("Identifier")),r("DeclareFunction").bases("Statement").build("id").field("id",r("Identifier")).field("predicate",n(r("FlowPredicate"),null),u.null),r("DeclareClass").bases("InterfaceDeclaration").build("id"),r("DeclareModule").bases("Statement").build("id","body").field("id",n(r("Identifier"),r("Literal"))).field("body",r("BlockStatement")),r("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",r("TypeAnnotation")),r("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(r("DeclareVariable"),r("DeclareFunction"),r("DeclareClass"),r("FlowType"),r("TypeAlias"),r("DeclareOpaqueType"),r("InterfaceDeclaration"),null)).field("specifiers",[n(r("ExportSpecifier"),r("ExportBatchSpecifier"))],u.emptyArray).field("source",n(r("Literal"),null),u.null),r("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",n(r("Literal"),null),u.null),r("ImportDeclaration").field("importKind",n("value","type","typeof"),function(){return"value"}),r("FlowPredicate").bases("Flow"),r("InferredPredicate").bases("FlowPredicate").build(),r("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",r("Expression")),r("Function").field("predicate",n(r("FlowPredicate"),null),u.null),r("CallExpression").field("typeArguments",n(null,r("TypeParameterInstantiation")),u.null),r("NewExpression").field("typeArguments",n(null,r("TypeParameterInstantiation")),u.null),r("EnumDeclaration").bases("Declaration").build("id","body").field("id",r("Identifier")).field("body",n(r("EnumBooleanBody"),r("EnumNumberBody"),r("EnumStringBody"),r("EnumSymbolBody"))),r("EnumBooleanBody").build("members","explicitType").field("members",[r("EnumBooleanMember")]).field("explicitType",Boolean),r("EnumNumberBody").build("members","explicitType").field("members",[r("EnumNumberMember")]).field("explicitType",Boolean),r("EnumStringBody").build("members","explicitType").field("members",n([r("EnumStringMember")],[r("EnumDefaultedMember")])).field("explicitType",Boolean),r("EnumSymbolBody").build("members").field("members",[r("EnumDefaultedMember")]),r("EnumBooleanMember").build("id","init").field("id",r("Identifier")).field("init",n(r("Literal"),Boolean)),r("EnumNumberMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumStringMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumDefaultedMember").build("id").field("id",r("Identifier"))},(0,s.maybeSetModuleExports)(function(){return e})},8772:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=a(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var r,i=n(t);try{for(i.s();!(r=i.n()).done;)r.value.markModified()}catch(e){i.e(e)}finally{i.f()}}else{var a,o=n(this.getScope().findFunctionScoped(e));try{for(o.s();!(a=o.n()).done;){var s=a.value;s.markHoisted(),s.markModified()}}catch(e){o.e(e)}finally{o.f()}}}},{key:"markReferenced",value:function(e){if(!(this.getScope().findBlockScoped(e).length>0)){var t,r=n(this.getScope().findFunctionScoped(e));try{for(r.s();!(t=r.n()).done;)t.value.markHoisted()}catch(e){r.e(e)}finally{r.f()}}}},{key:"getScope",value:function(){return this.scopeManager.getScope()}}])&&s(t.prototype,r),a&&s(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=l},9275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){o.default.replace(e,{enter:function(e){var t,r;(0,u.isFunction)(e)&&"BlockStatement"===e.body.type&&(r=function(e){var t,r={},n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}(e);try{for(n.s();!(t=n.n()).done;){var i=d(t.value);if(!i)break;r[i.name]=i}}catch(e){n.e(e)}finally{n.f()}return r}((t=e).body.body),t.params=t.params.map(function(e,u){if("Identifier"!==e.type)return e;var l,c,p=r[e.name];return p&&(l=p.value,c=function(e,t){return e.params.slice(t)}(t,u),!(0,i.flow)((0,i.flatMap)(a.extractVariables),(0,i.some)(function(e){return o.default.find(l,(0,n.matches)({type:"Identifier",name:e.name}))}))(c))?((0,s.default)({parent:t.body,node:p.node,replacements:[]}),function(e,t){return{type:"AssignmentPattern",left:e,right:t}}(e,p.value)):e}))}})};var n=r(25065),i=r(44480),a=r(2242),o=f(r(88543)),s=f(r(51329)),u=r(57249),l=f(r(58370)),c=f(r(8454)),p=f(r(11008));function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";var n=r(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9773:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printComments=t.attach=void 0;var n=r(31635),i=n.__importDefault(r(17676)),a=n.__importStar(r(41434)),o=a.namedTypes,s=a.builtInTypes.array,u=a.builtInTypes.object,l=r(1688),c=r(64147),p=new WeakMap;function f(e,t,r){if(!e)return r;if((0,c.fixFaultyLocations)(e,t),r){if(o.Node.check(e)&&o.SourceLocation.check(e.loc)){for(var n=r.length-1;n>=0;--n){var i=r[n];if(i&&i.loc&&(0,c.comparePos)(i.loc.end,e.loc.start)<=0)break}return r.splice(n+1,0,e),r}}else{var l=p.get(e);if(l)return l}var h;if(s.check(e))h=Object.keys(e);else{if(!u.check(e))return r;h=a.getFieldNames(e)}r||p.set(e,r=[]);n=0;for(var d=h.length;n>1,l=a[u];if((0,c.comparePos)(l.loc.start,t.loc.start)<=0&&(0,c.comparePos)(t.loc.end,l.loc.end)<=0)return void h(t.enclosingNode=l,t,r);if((0,c.comparePos)(l.loc.end,t.loc.start)<=0)n=l,o=u+1;else{if(!((0,c.comparePos)(t.loc.end,l.loc.start)<=0))throw new Error("Comment location overlaps with node location");i=l,s=u}}n&&(t.precedingNode=n),i&&(t.followingNode=i)}function d(e,t){var r=e.length;if(0!==r){for(var n,a=e[0].precedingNode,o=e[0].followingNode,s=o.loc.start,u=r;u>0;--u){n=e[u-1],(0,i.default)(n.precedingNode===a),(0,i.default)(n.followingNode===o);var l=t.sliceString(n.loc.end,s);if(/\S/.test(l))break;s=n.loc.start}for(;u<=r&&(n=e[u])&&("Line"===n.type||"CommentLine"===n.type)&&n.loc.start.column>o.loc.start.column;)++u;if(u){var c=e[u-1].enclosingNode;"CallExpression"===(null==c?void 0:c.type)&&--u}e.forEach(function(e,t){t0){var l=n[u-1];(0,i.default)(l.precedingNode===e.precedingNode==(l.followingNode===e.followingNode)),l.followingNode!==e.followingNode&&d(n,r)}n.push(e)}else if(a)d(n,r),g(a,e);else if(s)d(n,r),y(s,e);else{if(!o)throw new Error("AST contains no nodes at all?");d(n,r),function(e,t){t.leading=!1,t.trailing=!1,m(e,t)}(o,e)}}),d(n,r),e.forEach(function(e){delete e.precedingNode,delete e.enclosingNode,delete e.followingNode})}},t.printComments=function(e,t){var r=e.getValue(),n=t(e),i=o.Node.check(r)&&a.getFieldValue(r,"comments");if(!i||0===i.length)return n;var s=[],u=[n];return e.each(function(e){var n=e.getValue(),i=a.getFieldValue(n,"leading"),c=a.getFieldValue(n,"trailing");i||c&&!o.Statement.check(r)&&"Block"!==n.type&&"CommentBlock"!==n.type?s.push(function(e,t){var r=e.getValue();o.Comment.assert(r);var n=r.loc,i=n&&n.lines,a=[t(e)];if(r.trailing)a.push("\n");else if(i instanceof l.Lines){var s=i.slice(n.end,i.skipSpaces(n.end)||i.lastPos());1===s.length?a.push(s):a.push(new Array(s.length).join("\n"))}else a.push("\n");return(0,l.concat)(a)}(e,t)):c&&u.push(function(e,t){var r=e.getValue(e);o.Comment.assert(r);var n=r.loc,i=n&&n.lines,a=[];if(i instanceof l.Lines){var s=i.skipSpaces(n.start,!0)||i.firstPos(),u=i.slice(s,n.start);1===u.length?a.push(u):a.push(new Array(u.length).join("\n"))}return a.push(t(e)),(0,l.concat)(a)}(e,t))},"comments"),s.push.apply(s,u),(0,l.concat)(s)}},9796:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(25065);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,a=r(66743);e.exports=a.call(n,i)},10076:e=>{"use strict";e.exports=Function.prototype.call},10487:(e,t,r)=>{"use strict";var n=r(96897),i=r(30655),a=r(73126),o=r(12205);e.exports=function(e){var t=a(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:o}):e.exports.apply=o},11002:e=>{"use strict";e.exports=Function.prototype.apply},11008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=o(e)||{},r=t.name,n=t.name2,i=t.operator,a=t.consequent,u=t.alternate;if(r&&r===n){if(function(e){return"==="===e||"=="===e}(i)&&s(u,r))return{name:r,value:a,node:e};if(function(e){return"!=="===e||"!="===e}(i)&&s(a,r))return{name:r,value:u,node:e}}};var n=r(25065),i=(0,n.matches)({type:"BinaryExpression",left:{type:"Identifier",name:(0,n.extractAny)("name2")},operator:(0,n.extractAny)("operator"),right:{type:"Identifier",name:"undefined"}}),a=(0,n.matches)({type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:!0,argument:{type:"Identifier",name:(0,n.extractAny)("name2")}},operator:(0,n.extractAny)("operator"),right:{type:"Literal",value:"undefined"}}),o=(0,n.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",left:{type:"Identifier",name:(0,n.extractAny)("name")},operator:"=",right:{type:"ConditionalExpression",test:function(e){return i(e)||a(e)},consequent:(0,n.extractAny)("consequent"),alternate:(0,n.extractAny)("alternate")}}});function s(e,t){return"Identifier"===e.type&&e.name===t}},11106:(e,t)=>{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e=0;--i){var a=this.leading[i];t.end.offset>=a.start&&(r.unshift(a.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}r.length&&(e.innerComments=r)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var r=this.trailing.length-1;r>=0;--r){var n=this.trailing[r];n.start>=e.end.offset&&t.unshift(n.comment)}return this.trailing.length=0,t}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var a=i.node.trailingComments[0];a&&a.range[0]>=e.end.offset&&(t=i.node.trailingComments,delete i.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,r=[];this.stack.length>0&&((a=this.stack[this.stack.length-1])&&a.start>=e.start.offset);)t=a.node,this.stack.pop();if(t){for(var n=(t.leadingComments?t.leadingComments.length:0)-1;n>=0;--n){var i=t.leadingComments[n];i.range[1]<=e.start.offset&&(r.unshift(i),t.leadingComments.splice(n,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,r}for(n=this.leading.length-1;n>=0;--n){var a;(a=this.leading[n]).start<=e.start.offset&&(r.unshift(a.comment),this.leading.splice(n,1))}return r},e.prototype.visitNode=function(e,t){if(!(e.type===n.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var r=this.findTrailingComments(t),i=this.findLeadingComments(t);i.length>0&&(e.leadingComments=i),r.length>0&&(e.trailingComments=r),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var r="L"===e.type[0]?"Line":"Block",n={type:r,value:e.value};if(e.range&&(n.range=e.range),e.loc&&(n.loc=e.loc),this.comments.push(n),this.attach){var i={comment:{type:r,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=r,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type||"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),o=r(5),s=r(6),u=r(7),l=r(8),c=r(13),p=r(14);function f(e){var t;switch(e.type){case s.JSXSyntax.JSXIdentifier:t=e.name;break;case s.JSXSyntax.JSXNamespacedName:var r=e;t=f(r.namespace)+":"+f(r.name);break;case s.JSXSyntax.JSXMemberExpression:var n=e;t=f(n.object)+"."+f(n.property)}return t}c.TokenName[100]="JSXIdentifier",c.TokenName[101]="JSXText";var h=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return i(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",r=!0,n=!1,i=!1,o=!1;!this.scanner.eof()&&r&&!n;){var s=this.scanner.source[this.scanner.index];if(s===e)break;if(n=";"===s,t+=s,++this.scanner.index,!n)switch(t.length){case 2:i="#"===s;break;case 3:i&&(r=(o="x"===s)||a.Character.isDecimalDigit(s.charCodeAt(0)),i=i&&!o);break;default:r=(r=r&&!(i&&!a.Character.isDecimalDigit(s.charCodeAt(0))))&&!(o&&!a.Character.isHexDigit(s.charCodeAt(0)))}}if(r&&n&&t.length>2){var u=t.substr(1,t.length-2);i&&u.length>1?t=String.fromCharCode(parseInt(u.substr(1),10)):o&&u.length>2?t=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||o||!p.XHTMLEntities[u]||(t=p.XHTMLEntities[u])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e)return{type:7,value:s=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===e||39===e){for(var t=this.scanner.index,r=this.scanner.source[this.scanner.index++],n="";!this.scanner.eof()&&(u=this.scanner.source[this.scanner.index++])!==r;)n+="&"===u?this.scanXHTMLEntity(r):u;return{type:8,value:n,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(46===e){var i=this.scanner.source.charCodeAt(this.scanner.index+1),o=this.scanner.source.charCodeAt(this.scanner.index+2),s=46===i&&46===o?"...":".";return t=this.scanner.index,this.scanner.index+=s.length,{type:7,value:s,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(a.Character.isIdentifierStart(e)&&92!==e){for(t=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var u=this.scanner.source.charCodeAt(this.scanner.index);if(a.Character.isIdentifierPart(u)&&92!==u)++this.scanner.index;else{if(45!==u)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(t,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var r=this.scanner.source[this.scanner.index];if("{"===r||"<"===r)break;++this.scanner.index,t+=r,a.Character.isLineTerminator(r.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===r&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var n={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(n)),n},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new o.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=t;this.expectJSX(":");var n=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(r,n))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var a=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXMemberExpression(i,a))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),r=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=r;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(n,i))}else e=r;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var r=this.getTokenRaw(t);return this.finalize(e,new u.Literal(t.value,r))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),r=null;return this.matchJSX("=")&&(this.expectJSX("="),r=this.parseJSXAttributeValue()),this.finalize(e,new o.JSXAttribute(t,r))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),r=this.parseJSXAttributes(),n=this.matchJSX("/");return n&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(t,n,r))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new o.JSXClosingElement(t))}var r=this.parseJSXElementName(),n=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(r,i,n))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new o.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e,t=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new o.JSXExpressionContainer(e))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),r=this.nextJSXText();if(r.start0))break;a=this.finalize(e.node,new o.JSXElement(e.opening,e.children,e.closing)),(e=t[t.length-1]).children.push(a),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),r=[],n=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:n,children:r});r=i.children,n=i.closing}return this.finalize(e,new o.JSXElement(t,r,n))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(l.Parser);t.JSXParser=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={NonAsciiIdentifierStart:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&r.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&r.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),i=function(e){this.type=n.JSXSyntax.JSXClosingElement,this.name=e};t.JSXClosingElement=i;var a=function(e,t,r){this.type=n.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=r};t.JSXElement=a;var o=function(){this.type=n.JSXSyntax.JSXEmptyExpression};t.JSXEmptyExpression=o;var s=function(e){this.type=n.JSXSyntax.JSXExpressionContainer,this.expression=e};t.JSXExpressionContainer=s;var u=function(e){this.type=n.JSXSyntax.JSXIdentifier,this.name=e};t.JSXIdentifier=u;var l=function(e,t){this.type=n.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t};t.JSXMemberExpression=l;var c=function(e,t){this.type=n.JSXSyntax.JSXAttribute,this.name=e,this.value=t};t.JSXAttribute=c;var p=function(e,t){this.type=n.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t};t.JSXNamespacedName=p;var f=function(e,t,r){this.type=n.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=r};t.JSXOpeningElement=f;var h=function(e){this.type=n.JSXSyntax.JSXSpreadAttribute,this.argument=e};t.JSXSpreadAttribute=h;var d=function(e,t){this.type=n.JSXSyntax.JSXText,this.value=e,this.raw=t};t.JSXText=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i=function(e){this.type=n.Syntax.ArrayExpression,this.elements=e};t.ArrayExpression=i;var a=function(e){this.type=n.Syntax.ArrayPattern,this.elements=e};t.ArrayPattern=a;var o=function(e,t,r){this.type=n.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=r,this.async=!1};t.ArrowFunctionExpression=o;var s=function(e,t,r){this.type=n.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=r};t.AssignmentExpression=s;var u=function(e,t){this.type=n.Syntax.AssignmentPattern,this.left=e,this.right=t};t.AssignmentPattern=u;var l=function(e,t,r){this.type=n.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=r,this.async=!0};t.AsyncArrowFunctionExpression=l;var c=function(e,t,r){this.type=n.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=r,this.generator=!1,this.expression=!1,this.async=!0};t.AsyncFunctionDeclaration=c;var p=function(e,t,r){this.type=n.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=r,this.generator=!1,this.expression=!1,this.async=!0};t.AsyncFunctionExpression=p;var f=function(e){this.type=n.Syntax.AwaitExpression,this.argument=e};t.AwaitExpression=f;var h=function(e,t,r){var i="||"===e||"&&"===e;this.type=i?n.Syntax.LogicalExpression:n.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=r};t.BinaryExpression=h;var d=function(e){this.type=n.Syntax.BlockStatement,this.body=e};t.BlockStatement=d;var m=function(e){this.type=n.Syntax.BreakStatement,this.label=e};t.BreakStatement=m;var y=function(e,t){this.type=n.Syntax.CallExpression,this.callee=e,this.arguments=t};t.CallExpression=y;var g=function(e,t){this.type=n.Syntax.CatchClause,this.param=e,this.body=t};t.CatchClause=g;var v=function(e){this.type=n.Syntax.ClassBody,this.body=e};t.ClassBody=v;var b=function(e,t,r){this.type=n.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=r};t.ClassDeclaration=b;var x=function(e,t,r){this.type=n.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=r};t.ClassExpression=x;var S=function(e,t){this.type=n.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t};t.ComputedMemberExpression=S;var E=function(e,t,r){this.type=n.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=r};t.ConditionalExpression=E;var _=function(e){this.type=n.Syntax.ContinueStatement,this.label=e};t.ContinueStatement=_;var w=function(){this.type=n.Syntax.DebuggerStatement};t.DebuggerStatement=w;var A=function(e,t){this.type=n.Syntax.ExpressionStatement,this.expression=e,this.directive=t};t.Directive=A;var D=function(e,t){this.type=n.Syntax.DoWhileStatement,this.body=e,this.test=t};t.DoWhileStatement=D;var k=function(){this.type=n.Syntax.EmptyStatement};t.EmptyStatement=k;var C=function(e){this.type=n.Syntax.ExportAllDeclaration,this.source=e};t.ExportAllDeclaration=C;var T=function(e){this.type=n.Syntax.ExportDefaultDeclaration,this.declaration=e};t.ExportDefaultDeclaration=T;var P=function(e,t,r){this.type=n.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=r};t.ExportNamedDeclaration=P;var O=function(e,t){this.type=n.Syntax.ExportSpecifier,this.exported=t,this.local=e};t.ExportSpecifier=O;var j=function(e){this.type=n.Syntax.ExpressionStatement,this.expression=e};t.ExpressionStatement=j;var F=function(e,t,r){this.type=n.Syntax.ForInStatement,this.left=e,this.right=t,this.body=r,this.each=!1};t.ForInStatement=F;var I=function(e,t,r){this.type=n.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=r};t.ForOfStatement=I;var N=function(e,t,r,i){this.type=n.Syntax.ForStatement,this.init=e,this.test=t,this.update=r,this.body=i};t.ForStatement=N;var M=function(e,t,r,i){this.type=n.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=r,this.generator=i,this.expression=!1,this.async=!1};t.FunctionDeclaration=M;var B=function(e,t,r,i){this.type=n.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=r,this.generator=i,this.expression=!1,this.async=!1};t.FunctionExpression=B;var R=function(e){this.type=n.Syntax.Identifier,this.name=e};t.Identifier=R;var L=function(e,t,r){this.type=n.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=r};t.IfStatement=L;var V=function(e,t){this.type=n.Syntax.ImportDeclaration,this.specifiers=e,this.source=t};t.ImportDeclaration=V;var U=function(e){this.type=n.Syntax.ImportDefaultSpecifier,this.local=e};t.ImportDefaultSpecifier=U;var z=function(e){this.type=n.Syntax.ImportNamespaceSpecifier,this.local=e};t.ImportNamespaceSpecifier=z;var W=function(e,t){this.type=n.Syntax.ImportSpecifier,this.local=e,this.imported=t};t.ImportSpecifier=W;var J=function(e,t){this.type=n.Syntax.LabeledStatement,this.label=e,this.body=t};t.LabeledStatement=J;var q=function(e,t){this.type=n.Syntax.Literal,this.value=e,this.raw=t};t.Literal=q;var X=function(e,t){this.type=n.Syntax.MetaProperty,this.meta=e,this.property=t};t.MetaProperty=X;var G=function(e,t,r,i,a){this.type=n.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=r,this.kind=i,this.static=a};t.MethodDefinition=G;var K=function(e){this.type=n.Syntax.Program,this.body=e,this.sourceType="module"};t.Module=K;var H=function(e,t){this.type=n.Syntax.NewExpression,this.callee=e,this.arguments=t};t.NewExpression=H;var $=function(e){this.type=n.Syntax.ObjectExpression,this.properties=e};t.ObjectExpression=$;var Y=function(e){this.type=n.Syntax.ObjectPattern,this.properties=e};t.ObjectPattern=Y;var Z=function(e,t,r,i,a,o){this.type=n.Syntax.Property,this.key=t,this.computed=r,this.value=i,this.kind=e,this.method=a,this.shorthand=o};t.Property=Z;var Q=function(e,t,r,i){this.type=n.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:r,flags:i}};t.RegexLiteral=Q;var ee=function(e){this.type=n.Syntax.RestElement,this.argument=e};t.RestElement=ee;var te=function(e){this.type=n.Syntax.ReturnStatement,this.argument=e};t.ReturnStatement=te;var re=function(e){this.type=n.Syntax.Program,this.body=e,this.sourceType="script"};t.Script=re;var ne=function(e){this.type=n.Syntax.SequenceExpression,this.expressions=e};t.SequenceExpression=ne;var ie=function(e){this.type=n.Syntax.SpreadElement,this.argument=e};t.SpreadElement=ie;var ae=function(e,t){this.type=n.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t};t.StaticMemberExpression=ae;var oe=function(){this.type=n.Syntax.Super};t.Super=oe;var se=function(e,t){this.type=n.Syntax.SwitchCase,this.test=e,this.consequent=t};t.SwitchCase=se;var ue=function(e,t){this.type=n.Syntax.SwitchStatement,this.discriminant=e,this.cases=t};t.SwitchStatement=ue;var le=function(e,t){this.type=n.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t};t.TaggedTemplateExpression=le;var ce=function(e,t){this.type=n.Syntax.TemplateElement,this.value=e,this.tail=t};t.TemplateElement=ce;var pe=function(e,t){this.type=n.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t};t.TemplateLiteral=pe;var fe=function(){this.type=n.Syntax.ThisExpression};t.ThisExpression=fe;var he=function(e){this.type=n.Syntax.ThrowStatement,this.argument=e};t.ThrowStatement=he;var de=function(e,t,r){this.type=n.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=r};t.TryStatement=de;var me=function(e,t){this.type=n.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0};t.UnaryExpression=me;var ye=function(e,t,r){this.type=n.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=r};t.UpdateExpression=ye;var ge=function(e,t){this.type=n.Syntax.VariableDeclaration,this.declarations=e,this.kind=t};t.VariableDeclaration=ge;var ve=function(e,t){this.type=n.Syntax.VariableDeclarator,this.id=e,this.init=t};t.VariableDeclarator=ve;var be=function(e,t){this.type=n.Syntax.WhileStatement,this.test=e,this.body=t};t.WhileStatement=be;var xe=function(e,t){this.type=n.Syntax.WithStatement,this.object=e,this.body=t};t.WithStatement=xe;var Se=function(e,t){this.type=n.Syntax.YieldExpression,this.argument=e,this.delegate=t};t.YieldExpression=Se},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),i=r(10),a=r(11),o=r(7),s=r(12),u=r(2),l=r(13),c="ArrowParameterPlaceHolder",p=function(){function e(e,t,r){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=r,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],r=1;r0&&this.delegate)for(var t=0;t>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,r=this.context.isAssignmentTarget,n=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=r,this.context.firstCoverInitializedNameError=n,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,r=this.context.isAssignmentTarget,n=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&r,this.context.firstCoverInitializedNameError=n||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,r,n=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(n,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,a.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),r=this.getTokenRaw(t),e=this.finalize(n,new o.Literal(t.value,r));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),r=this.getTokenRaw(t),e=this.finalize(n,new o.Literal("true"===t.value,r));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),r=this.getTokenRaw(t),e=this.finalize(n,new o.Literal(null,r));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),r=this.getTokenRaw(t),e=this.finalize(n,new o.RegexLiteral(t.regex,r,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(n,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(n,new o.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new o.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var r=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(r)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new o.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,r=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var n=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=r,n},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var r=this.parseFormalParameters(),n=this.parsePropertyMethod(r);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,r.params,n,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,r=this.context.await;this.context.allowYield=!1,this.context.await=!0;var n=this.parseFormalParameters(),i=this.parsePropertyMethod(n);return this.context.allowYield=t,this.context.await=r,this.finalize(e,new o.AsyncFunctionExpression(null,n.params,i))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),r=this.nextToken();switch(r.type){case 8:case 6:this.context.strict&&r.octal&&this.tolerateUnexpectedToken(r,a.Messages.StrictOctalLiteral);var n=this.getTokenRaw(r);e=this.finalize(t,new o.Literal(r.value,n));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new o.Identifier(r.value));break;case 7:"["===r.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(r);break;default:e=this.throwUnexpectedToken(r)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===u.Syntax.Identifier&&e.name===t||e.type===u.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,r=this.createNode(),n=this.lookahead,i=null,s=null,u=!1,l=!1,c=!1,p=!1;if(3===n.type){var f=n.value;this.nextToken(),u=this.match("["),i=(p=!(this.hasLineTerminator||"async"!==f||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(r,new o.Identifier(f))}else this.match("*")?this.nextToken():(u=this.match("["),i=this.parseObjectPropertyKey());var h=this.qualifiedPropertyName(this.lookahead);if(3===n.type&&!p&&"get"===n.value&&h)t="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod();else if(3===n.type&&!p&&"set"===n.value&&h)t="set",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod();else if(7===n.type&&"*"===n.value&&h)t="init",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),l=!0;else if(i||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!p)!u&&this.isPropertyKey(i,"__proto__")&&(e.value&&this.tolerateError(a.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))s=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),l=!0;else if(3===n.type)if(f=this.finalize(r,new o.Identifier(n.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),c=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);s=this.finalize(r,new o.AssignmentPattern(f,d))}else c=!0,s=f;else this.throwUnexpectedToken(this.nextToken());return this.finalize(r,new o.Property(t,i,u,s,l,c))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],r={value:!1};!this.match("}");)t.push(this.parseObjectProperty(r)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new o.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){n.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),r=t.value,i=t.cooked;return this.finalize(e,new o.TemplateElement({raw:r,cooked:i},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),r=t.value,n=t.cooked;return this.finalize(e,new o.TemplateElement({raw:r,cooked:n},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],r=[],n=this.parseTemplateHead();for(r.push(n);!n.tail;)t.push(this.parseExpression()),n=this.parseTemplateElement(),r.push(n);return this.finalize(e,new o.TemplateLiteral(r,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:e.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case u.Syntax.ArrayExpression:e.type=u.Syntax.ArrayPattern;for(var t=0;t")||this.expect("=>"),e={type:c,params:[],async:!1};else{var t=this.lookahead,r=[];if(this.match("..."))e=this.parseRestElement(r),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:c,params:[e],async:!1};else{var n=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var a=0;a")||this.expect("=>"),this.context.isBindingElement=!1,a=0;a")&&(e.type===u.Syntax.Identifier&&"yield"===e.name&&(n=!0,e={type:c,params:[e],async:!1}),!n)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===u.Syntax.SequenceExpression)for(a=0;a")){for(var u=0;u0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],a=t,s=this.isolateCoverGrammar(this.parseExponentiationExpression),u=[a,r.value,s],l=[n];!((n=this.binaryPrecedence(this.lookahead))<=0);){for(;u.length>2&&n<=l[l.length-1];){s=u.pop();var c=u.pop();l.pop(),a=u.pop(),i.pop();var p=this.startNode(i[i.length-1]);u.push(this.finalize(p,new o.BinaryExpression(c,a,s)))}u.push(this.nextToken().value),l.push(n),i.push(this.lookahead),u.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var f=u.length-1;t=u[f];for(var h=i.pop();f>1;){var d=i.pop(),m=h&&h.lineStart;p=this.startNode(d,m),c=u[f-1],t=this.finalize(p,new o.BinaryExpression(c,u[f-2],t)),f-=2,h=d}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var r=this.context.allowIn;this.context.allowIn=!0;var n=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=r,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.ConditionalExpression(t,n,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case u.Syntax.Identifier:this.validateParam(e,t,t.name);break;case u.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case u.Syntax.ArrayPattern:for(var r=0;r")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=e.async,s=this.reinterpretAsCoverFormalsList(e);if(s){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var l=this.context.strict,p=this.context.allowStrictDirective;this.context.allowStrictDirective=s.simple;var f=this.context.allowYield,h=this.context.await;this.context.allowYield=!0,this.context.await=i;var d=this.startNode(t);this.expect("=>");var m=void 0;if(this.match("{")){var y=this.context.allowIn;this.context.allowIn=!0,m=this.parseFunctionSourceElements(),this.context.allowIn=y}else m=this.isolateCoverGrammar(this.parseAssignmentExpression);var g=m.type!==u.Syntax.BlockStatement;this.context.strict&&s.firstRestricted&&this.throwUnexpectedToken(s.firstRestricted,s.message),this.context.strict&&s.stricted&&this.tolerateUnexpectedToken(s.stricted,s.message),e=i?this.finalize(d,new o.AsyncArrowFunctionExpression(s.params,m,g)):this.finalize(d,new o.ArrowFunctionExpression(s.params,m,g)),this.context.strict=l,this.context.allowStrictDirective=p,this.context.allowYield=f,this.context.await=h}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(a.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===u.Syntax.Identifier){var v=e;this.scanner.isRestrictedWord(v.name)&&this.tolerateUnexpectedToken(r,a.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(v.name)&&this.tolerateUnexpectedToken(r,a.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var b=(r=this.nextToken()).value,x=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.AssignmentExpression(b,e,x)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var r=[];for(r.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),r.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new o.SequenceExpression(r))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,a.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,a.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new o.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var r=this.createNode(),n=this.parsePattern([],e);this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(a.Messages.StrictVarName);var i=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(a.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&n.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),i=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(r,new o.VariableDeclarator(n,i))},e.prototype.parseBindingList=function(e,t){for(var r=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),r.push(this.parseLexicalBinding(e,t));return r},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),r=this.nextToken().value;n.assert("let"===r||"const"===r,"Lexical declaration must be either let or const");var i=this.parseBindingList(r,e);return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(i,r))},e.prototype.parseBindingRestElement=function(e,t){var r=this.createNode();this.expect("...");var n=this.parsePattern(e,t);return this.finalize(r,new o.RestElement(n))},e.prototype.parseArrayPattern=function(e,t){var r=this.createNode();this.expect("[");for(var n=[];!this.match("]");)if(this.match(","))this.nextToken(),n.push(null);else{if(this.match("...")){n.push(this.parseBindingRestElement(e,t));break}n.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(r,new o.ArrayPattern(n))},e.prototype.parsePropertyPattern=function(e,t){var r,n,i=this.createNode(),a=!1,s=!1;if(3===this.lookahead.type){var u=this.lookahead;r=this.parseVariableIdentifier();var l=this.finalize(i,new o.Identifier(u.value));if(this.match("=")){e.push(u),s=!0,this.nextToken();var c=this.parseAssignmentExpression();n=this.finalize(this.startNode(u),new o.AssignmentPattern(l,c))}else this.match(":")?(this.expect(":"),n=this.parsePatternWithDefault(e,t)):(e.push(u),s=!0,n=l)}else a=this.match("["),r=this.parseObjectPropertyKey(),this.expect(":"),n=this.parsePatternWithDefault(e,t);return this.finalize(i,new o.Property("init",r,a,n,!1,s))},e.prototype.parseObjectPattern=function(e,t){var r=this.createNode(),n=[];for(this.expect("{");!this.match("}");)n.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(r,new o.ObjectPattern(n))},e.prototype.parsePattern=function(e,t){var r;return this.match("[")?r=this.parseArrayPattern(e,t):this.match("{")?r=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,a.Messages.LetInLexicalBinding),e.push(this.lookahead),r=this.parseVariableIdentifier(t)),r},e.prototype.parsePatternWithDefault=function(e,t){var r=this.lookahead,n=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var a=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,n=this.finalize(this.startNode(r),new o.AssignmentPattern(n,a))}return n},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),r=this.nextToken();return 4===r.type&&"yield"===r.value?this.context.strict?this.tolerateUnexpectedToken(r,a.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(r):3!==r.type?this.context.strict&&4===r.type&&this.scanner.isStrictModeReservedWord(r.value)?this.tolerateUnexpectedToken(r,a.Messages.StrictReservedWord):(this.context.strict||"let"!==r.value||"var"!==e)&&this.throwUnexpectedToken(r):(this.context.isModule||this.context.await)&&3===r.type&&"await"===r.value&&this.tolerateUnexpectedToken(r),this.finalize(t,new o.Identifier(r.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),r=this.parsePattern([],"var");this.context.strict&&r.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(a.Messages.StrictVarName);var n=null;return this.match("=")?(this.nextToken(),n=this.isolateCoverGrammar(this.parseAssignmentExpression)):r.type===u.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new o.VariableDeclarator(r,n))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},r=[];for(r.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),r.push(this.parseVariableDeclaration(t));return r},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new o.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(a.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),r=null;this.expectKeyword("if"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),r=this.parseIfClause())),this.finalize(t,new o.IfStatement(n,e,r))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var r=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new o.DoWhileStatement(r,n))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var n=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=n}return this.finalize(t,new o.WhileStatement(r,e))},e.prototype.parseForStatement=function(){var e,t,r,n=null,i=null,s=null,l=!0,c=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){n=this.createNode(),this.nextToken();var p=this.context.allowIn;this.context.allowIn=!1;var f=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=p,1===f.length&&this.matchKeyword("in")){var h=f[0];h.init&&(h.id.type===u.Syntax.ArrayPattern||h.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(a.Messages.ForInOfLoopInitializer,"for-in"),n=this.finalize(n,new o.VariableDeclaration(f,"var")),this.nextToken(),e=n,t=this.parseExpression(),n=null}else 1===f.length&&null===f[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new o.VariableDeclaration(f,"var")),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,l=!1):(n=this.finalize(n,new o.VariableDeclaration(f,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){n=this.createNode();var d=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(p=this.context.allowIn,this.context.allowIn=!1,f=this.parseBindingList(d,{inFor:!0}),this.context.allowIn=p,1===f.length&&null===f[0].init&&this.matchKeyword("in")?(n=this.finalize(n,new o.VariableDeclaration(f,d)),this.nextToken(),e=n,t=this.parseExpression(),n=null):1===f.length&&null===f[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new o.VariableDeclaration(f,d)),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,l=!1):(this.consumeSemicolon(),n=this.finalize(n,new o.VariableDeclaration(f,d)))):(n=this.finalize(n,new o.Identifier(d)),this.nextToken(),e=n,t=this.parseExpression(),n=null)}else{var m=this.lookahead;if(p=this.context.allowIn,this.context.allowIn=!1,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=p,this.matchKeyword("in"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(a.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseExpression(),n=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(a.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseAssignmentExpression(),n=null,l=!1;else{if(this.match(",")){for(var y=[n];this.match(",");)this.nextToken(),y.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(m),new o.SequenceExpression(y))}this.expect(";")}}if(void 0===e&&(this.match(";")||(i=this.parseExpression()),this.expect(";"),this.match(")")||(s=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),r=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var g=this.context.inIteration;this.context.inIteration=!0,r=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=g}return void 0===e?this.finalize(c,new o.ForStatement(n,i,s,r)):l?this.finalize(c,new o.ForInStatement(e,t,r)):this.finalize(c,new o.ForOfStatement(e,t,r))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var r=this.parseVariableIdentifier();t=r;var n="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,n)||this.throwError(a.Messages.UnknownLabel,r.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(a.Messages.IllegalContinue),this.finalize(e,new o.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var r=this.parseVariableIdentifier(),n="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,n)||this.throwError(a.Messages.UnknownLabel,r.name),t=r}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(a.Messages.IllegalBreak),this.finalize(e,new o.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(a.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ReturnStatement(t))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(a.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new o.WithStatement(r,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var r=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)r.push(this.parseStatementListItem());return this.finalize(t,new o.SwitchCase(e,r))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var r=this.context.inSwitch;this.context.inSwitch=!0;var n=[],i=!1;for(this.expect("{");!this.match("}");){var s=this.parseSwitchCase();null===s.test&&(i&&this.throwError(a.Messages.MultipleDefaultsInSwitch),i=!0),n.push(s)}return this.expect("}"),this.context.inSwitch=r,this.finalize(e,new o.SwitchStatement(t,n))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),r=this.parseExpression();if(r.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var n=r,i="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(a.Messages.Redeclaration,"Label",n.name),this.context.labelSet[i]=!0;var s=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),s=this.parseClassDeclaration();else if(this.matchKeyword("function")){var l=this.lookahead,c=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(l,a.Messages.StrictFunction):c.generator&&this.tolerateUnexpectedToken(l,a.Messages.GeneratorInLegacyContext),s=c}else s=this.parseStatement();delete this.context.labelSet[i],e=new o.LabeledStatement(n,s)}else this.consumeSemicolon(),e=new o.ExpressionStatement(r);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(a.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],r=this.parsePattern(t),n={},i=0;i0&&this.tolerateError(a.Messages.BadGetterArity);var i=this.parsePropertyMethod(n);return this.context.allowYield=r,this.finalize(e,new o.FunctionExpression(null,n.params,i,t))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=!1,r=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(a.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(a.Messages.BadSetterRestParameter);var i=this.parsePropertyMethod(n);return this.context.allowYield=r,this.finalize(e,new o.FunctionExpression(null,n.params,i,t))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var r=this.parseFormalParameters();this.context.allowYield=!1;var n=this.parsePropertyMethod(r);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,r.params,n,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,r=!1;if(!this.hasLineTerminator){var n=this.context.allowYield;this.context.allowYield=!1,(r=this.match("*"))?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=n}return this.finalize(e,new o.YieldExpression(t,r))},e.prototype.parseClassElement=function(e){var t=this.lookahead,r=this.createNode(),n="",i=null,s=null,u=!1,l=!1,c=!1,p=!1;if(this.match("*"))this.nextToken();else if(u=this.match("["),"static"===(i=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,c=!0,u=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var f=this.lookahead.value;":"!==f&&"("!==f&&"*"!==f&&(p=!0,t=this.lookahead,i=this.parseObjectPropertyKey(),3===t.type&&"constructor"===t.value&&this.tolerateUnexpectedToken(t,a.Messages.ConstructorIsAsync))}var h=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&h?(n="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod()):"set"===t.value&&h&&(n="set",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod()):7===t.type&&"*"===t.value&&h&&(n="init",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),l=!0),!n&&i&&this.match("(")&&(n="init",s=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),l=!0),n||this.throwUnexpectedToken(this.lookahead),"init"===n&&(n="method"),u||(c&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(t,a.Messages.StaticPrototype),!c&&this.isPropertyKey(i,"constructor")&&(("method"!==n||!l||s&&s.generator)&&this.throwUnexpectedToken(t,a.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,a.Messages.DuplicateConstructor):e.value=!0,n="constructor")),this.finalize(r,new o.MethodDefinition(i,u,s,n,c))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new o.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),r=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var a=this.parseClassBody();return this.context.strict=r,this.finalize(t,new o.ClassDeclaration(n,i,a))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=3===this.lookahead.type?this.parseVariableIdentifier():null,n=null;this.matchKeyword("extends")&&(this.nextToken(),n=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=t,this.finalize(e,new o.ClassExpression(r,n,i))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(a.Messages.InvalidModuleSpecifier);var t=this.nextToken(),r=this.getTokenRaw(t);return this.finalize(e,new o.Literal(t.value,r))},e.prototype.parseImportSpecifier=function(){var e,t,r=this.createNode();return 3===this.lookahead.type?(t=e=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(t=e=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(r,new o.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new o.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(a.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new o.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(a.Messages.IllegalImportDeclaration);var e,t=this.createNode();this.expectKeyword("import");var r=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?r=r.concat(this.parseNamedImports()):this.match("*")?r.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(r.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?r.push(this.parseImportNamespaceSpecifier()):this.match("{")?r=r.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var n=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(n,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new o.ImportDeclaration(r,e))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),r=t;return this.matchContextualKeyword("as")&&(this.nextToken(),r=this.parseIdentifierName()),this.finalize(e,new o.ExportSpecifier(t,r))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(a.Messages.IllegalExportDeclaration);var e,t=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var r=this.parseFunctionDeclaration(!0);e=this.finalize(t,new o.ExportDefaultDeclaration(r))}else this.matchKeyword("class")?(r=this.parseClassDeclaration(!0),e=this.finalize(t,new o.ExportDefaultDeclaration(r))):this.matchContextualKeyword("async")?(r=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),e=this.finalize(t,new o.ExportDefaultDeclaration(r))):(this.matchContextualKeyword("from")&&this.throwError(a.Messages.UnexpectedToken,this.lookahead.value),r=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),e=this.finalize(t,new o.ExportDefaultDeclaration(r)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var n=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(n,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new o.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(r=void 0,this.lookahead.value){case"let":case"const":r=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":r=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new o.ExportNamedDeclaration(r,[],null))}else if(this.matchAsyncFunction())r=this.parseFunctionDeclaration(),e=this.finalize(t,new o.ExportNamedDeclaration(r,[],null));else{var s=[],u=null,l=!1;for(this.expect("{");!this.match("}");)l=l||this.matchKeyword("default"),s.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),u=this.parseModuleSpecifier(),this.consumeSemicolon()):l?(n=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause,this.throwError(n,this.lookahead.value)):this.consumeSemicolon(),e=this.finalize(t,new o.ExportNamedDeclaration(null,s,u))}return e},e}();t.Parser=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("ASSERT: "+t)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var r=new Error(e);try{throw r}catch(e){Object.create&&Object.defineProperty&&(r=Object.create(e),Object.defineProperty(r,"column",{value:t}))}return r},e.prototype.createError=function(e,t,r,n){var i="Line "+t+": "+n,a=this.constructError(i,r);return a.index=e,a.lineNumber=t,a.description=n,a},e.prototype.throwError=function(e,t,r,n){throw this.createError(e,t,r,n)},e.prototype.tolerateError=function(e,t,r,n){var i=this.createError(e,t,r,n);if(!this.tolerant)throw i;this.recordError(i)},e}();t.ErrorHandler=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),i=r(4),a=r(11);function o(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function s(e){return"01234567".indexOf(e)}var u=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=a.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=a.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,r,n=[];for(this.trackComment&&(n=[],t=this.index-e,r={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var a=this.source.charCodeAt(this.index);if(++this.index,i.Character.isLineTerminator(a)){if(this.trackComment){r.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:r};n.push(o)}return 13===a&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,n}}return this.trackComment&&(r.end={line:this.lineNumber,column:this.index-this.lineStart},o={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:r},n.push(o)),n},e.prototype.skipMultiLineComment=function(){var e,t,r=[];for(this.trackComment&&(r=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var n=this.source.charCodeAt(this.index);if(i.Character.isLineTerminator(n))13===n&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===n){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var a={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};r.push(a)}return r}++this.index}else++this.index}return this.trackComment&&(t.end={line:this.lineNumber,column:this.index-this.lineStart},a={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t},r.push(a)),this.tolerateUnexpectedToken(),r},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var r=this.source.charCodeAt(this.index);if(i.Character.isWhiteSpace(r))++this.index;else if(i.Character.isLineTerminator(r))++this.index,13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===r)if(47===(r=this.source.charCodeAt(this.index+1))){this.index+=2;var n=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(n)),t=!0}else{if(42!==r)break;this.index+=2,n=this.skipMultiLineComment(),this.trackComment&&(e=e.concat(n))}else if(t&&45===r){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,n=this.skipSingleLineComment(3),this.trackComment&&(e=e.concat(n))}else{if(60!==r||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,n=this.skipSingleLineComment(4),this.trackComment&&(e=e.concat(n))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var r=this.source.charCodeAt(e+1);r>=56320&&r<=57343&&(t=1024*(t-55296)+r-56320+65536)}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,r=0,n=0;n1114111||"}"!==e)&&this.throwUnexpectedToken(),i.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!i.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e,t=this.codePointAt(this.index),r=i.Character.fromCodePoint(t);for(this.index+=r.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken(),r=e);!this.eof()&&(t=this.codePointAt(this.index),i.Character.isIdentifierPart(t));)r+=e=i.Character.fromCodePoint(t),this.index+=e.length,92===t&&(r=r.substr(0,r.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken(),r+=e);return r},e.prototype.octalToDecimal=function(e){var t="0"!==e,r=s(e);return!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,r=8*r+s(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+s(this.source[this.index++]))),{code:r,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,r=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!=(e=1===r.length?3:this.isKeyword(r)?4:"null"===r?5:"true"===r||"false"===r?1:3)&&t+r.length!==this.index){var n=this.index;this.index=t,this.tolerateUnexpectedToken(a.Messages.InvalidEscapedReservedWord),this.index=n}return{type:e,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(t=this.source.substr(this.index,4))?this.index+=4:"==="===(t=t.substr(0,3))||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:"&&"===(t=t.substr(0,2))||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&i.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),i.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,r="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)r+=this.source[this.index++];return 0===r.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(i.Character.isIdentifierStart(t)||i.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(r,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var r="",n=!1;for(i.Character.isOctalDigit(e.charCodeAt(0))?(n=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return n||0!==r.length||this.throwUnexpectedToken(),(i.Character.isIdentifierStart(this.source.charCodeAt(this.index))||i.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(r,8),octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,r){var i=parseInt(t||r,16);return i>1114111&&n.throwUnexpectedToken(a.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(r)}catch(e){this.throwUnexpectedToken(a.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];n.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],r=!1,o=!1;!this.eof();)if(t+=e=this.source[this.index++],"\\"===e)e=this.source[this.index++],i.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),t+=e;else if(i.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(a.Messages.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){o=!0;break}"["===e&&(r=!0)}return o||this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="";!this.eof();){var t=this.source[this.index];if(!i.Character.isIdentifierPart(t.charCodeAt(0)))break;if(++this.index,"\\"!==t||this.eof())e+=t;else if("u"===(t=this.source[this.index])){++this.index;var r=this.index,n=this.scanHexEscape("u");if(null!==n)for(e+=n;r=55296&&e<57343&&i.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=u},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),i=r(12),a=r(13),o=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var r=this.values[this.paren-1];t="if"===r||"while"===r||"for"===r||"with"===r;break;case"}":if(t=!1,"function"===this.values[this.curly-3])t=!!(n=this.values[this.curly-4])&&!this.beforeFunctionExpression(n);else if("function"===this.values[this.curly-4]){var n;t=!(n=this.values[this.curly-5])||!this.beforeFunctionExpression(n)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),s=function(){function e(e,t){this.errorHandler=new n.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new o}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Definition=t.ParameterDefinition=void 0;var n,i=r(17774),a=(n=i)&&n.__esModule?n:{default:n};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function e(t,r,n,i,a,s){o(this,e),this.type=t,this.name=r,this.node=n,this.parent=i,this.index=a,this.kind=s};t.default=s;var u=function(e){function t(e,r,n,i){o(this,t);var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.default.Parameter,e,r,null,n,null));return s.rest=i,s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(s);t.ParameterDefinition=u,t.Definition=s},11514:(e,t,r)=>{"use strict";var n=r(38403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchRequireWithProperty=t.matchRequire=void 0;var n,i=(n=r(50236))&&n.__esModule?n:{default:n},a=r(25065);var o=(0,a.matches)({type:"Identifier"}),s=(0,a.matches)({type:"Property",key:o,computed:!1,value:o}),u=(0,a.matches)({type:"ObjectPattern",properties:function(e){return e.every(s)}}),l=(0,a.matches)({type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:(0,a.extract)("sources",function(e){return 1===e.length&&(0,i.default)(e[0])})}),c=(0,a.matches)({type:"VariableDeclarator",id:(0,a.extract)("id",function(e){return o(e)||u(e)}),init:l});t.matchRequire=c;var p=(0,a.matches)({type:"VariableDeclarator",id:(0,a.extract)("id",o),init:{type:"MemberExpression",computed:!1,object:l,property:(0,a.extract)("property",{type:"Identifier"})}});t.matchRequireWithProperty=p},12205:(e,t,r)=>{"use strict";var n=r(66743),i=r(11002),a=r(13144);e.exports=function(){return a(n,i,arguments)}},12729:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(r(88543)),a=s(r(41025)),o=r(25065);function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(o(e)){var t=(r=e.declarations,n=1,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(r,n)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return{className:t.id.name,constructorNode:t.init}}var r,n};var n=r(25065);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";e.exports=function(e){return e!=e}},13144:(e,t,r)=>{"use strict";var n=r(66743),i=r(11002),a=r(10076),o=r(47119);e.exports=o||n.call(a,i)},13734:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n=Object.keys(r);for(const e of n)Object.freeze(r[e]);Object.freeze(r);const i=new Set(["parent","leadingComments","trailingComments"]);function a(e){return!i.has(e)&&"_"!==e[0]}t.KEYS=r,t.getKeys=function(e){return Object.keys(e).filter(a)},t.unionWith=function(e){const t=Object.assign({},r);for(const r of Object.keys(e))if(Object.prototype.hasOwnProperty.call(t,r)){const n=new Set(e[r]);for(const e of t[r])n.add(e);t[r]=Object.freeze(Array.from(n))}else t[r]=Object.freeze(Array.from(e[r]));return Object.freeze(t)}},14035:(e,t,r)=>{"use strict";var n,i=r(36556),a=r(49092)(),o=r(9957),s=r(75795);if(a){var u=i("RegExp.prototype.exec"),l={},c=function(){throw l},p={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(p[Symbol.toPrimitive]=c),n=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!(t&&o(t,"value")))return!1;try{u(e,p)}catch(e){return e===l}}}else{var f=i("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===f(e)}}e.exports=n},14180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(44480),i=p(r(88543)),a=c(r(57249)),o=c(r(2242)),s=p(r(57670)),u=p(r(1619));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==f(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function p(e){return e&&e.__esModule?e:{default:e}}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function h(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScopeManager=t.Scope=t.Variable=t.Reference=t.version=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.analyze=function(e,t){var r,n;return n=f({optimistic:!1,directive:!1,nodejsScope:!1,impliedStrict:!1,sourceType:"script",ecmaVersion:5,childVisitorKeys:null,fallback:"iteration"},t),r=new a.default(n),new o.default(n,r).visit(e),(0,i.default)(null===r.__currentScope,"currentScope should be null."),r};var i=p(r(94148)),a=p(r(76402)),o=p(r(74231)),s=p(r(97909)),u=p(r(17774)),l=p(r(31352)),c=r(4535);function p(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var r,i;function a(e){return"object"===(void 0===e?"undefined":n(e))&&e instanceof Object&&!(e instanceof Array)&&!(e instanceof RegExp)}for(r in t)t.hasOwnProperty(r)&&(a(i=t[r])?a(e[r])?f(e[r],i):e[r]=f({},i):e[r]=i);return e}t.version=c.version,t.Reference=s.default,t.Variable=u.default,t.Scope=l.default,t.ScopeManager=a.default},15263:(e,t)=>{function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t,i,a){if(i{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=r(64522),a=n.__importDefault(r(69418));t.default=function(e){var t=e.use(a.default);return t.BinaryOperators.indexOf("**")<0&&t.BinaryOperators.push("**"),t.AssignmentOperators.indexOf("**=")<0&&t.AssignmentOperators.push("**="),t},(0,i.maybeSetModuleExports)(function(){return e})},16695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){n.default.replace(e,{enter:function(e){if(function(e){return"ArrowFunctionExpression"===e.type&&u(e.body)}(e))return function(e){return e.body=function(e){var t=u(e),r=t.returnStatement,n=t.returnVal;return(0,a.default)({from:r,to:n}),n}(e.body),e}(e)}})};var n=s(r(88543)),i=r(25065),a=s(r(99650)),o=r(44480);function s(e){return e&&e.__esModule?e:{default:e}}var u=(0,i.matches)({type:"BlockStatement",body:(0,i.matchesLength)([(0,i.extract)("returnStatement",{type:"ReturnStatement",argument:(0,i.extract)("returnVal",(0,o.negate)(o.isNull))})])})},16962:(e,t)=>{t.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},t.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,r=t.aliasToReal,n={};for(var i in r){var a=r[i];e.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),t.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},17433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){i.default.replace(e,{enter:function(e,r){if(function(e,t){return"FunctionExpression"===e.type&&"Property"!==t.type&&"MethodDefinition"!==t.type&&!e.id&&!e.generator&&!function(e){return c(e,{type:"ThisExpression"})}(e.body)}(e,r))return l(e.body)?void t.warn(e,"Can not use arguments in arrow function","arrow"):p(e,r);var n=function(e){return(0,o.matches)({type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:(0,o.extract)("func",{type:"FunctionExpression",id:null,body:function(e){return!l(e)},generator:!1}),property:{type:"Identifier",name:"bind"}},arguments:(0,o.matchesLength)([{type:"ThisExpression"}])},e)}(e),i=n.func;return i?p(i,r):void 0}})};var n=r(44480),i=u(r(88543)),a=u(r(19304)),o=r(25065),s=u(r(99650));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){return c(e,{type:"Identifier",name:"arguments"})}function c(e,t){return i.default.find(e,(0,n.matches)(t),{skipTypes:["FunctionExpression","FunctionDeclaration"]})}function p(e,t){var r=new a.default({body:e.body,params:e.params,defaults:e.defaults,rest:e.rest,async:e.async});return(0,s.default)({from:e,to:r}),function(e,t){return"CallExpression"===t.type&&t.callee===e}(e,t)&&(t.original=null),r}},17676:e=>{"use strict";var t="Invariant failed";e.exports=function(e,r){if(!e)throw new Error(t)}},17774:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.identifiers=[],this.references=[],this.defs=[],this.tainted=!1,this.stack=!0,this.scope=r};t.default=r,r.CatchClause="CatchClause",r.Parameter="Parameter",r.FunctionName="FunctionName",r.ClassName="ClassName",r.Variable="Variable",r.ImportBinding="ImportBinding",r.TDZ="TDZ",r.ImplicitGlobalVariable="ImplicitGlobalVariable"},19016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=u(r(88543)),i=u(r(41025)),a=r(25065),o=u(r(49224)),s=u(r(51329));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t){for(var r=0;r{"use strict";const n=r(67591),i=/^[\da-fA-F]+$/,a=/^\d+$/,o=new WeakMap;function s(e){e=e.Parser.acorn||e;let t=o.get(e);if(!t){const r=e.tokTypes,n=e.TokContext,i=e.TokenType,a=new n("...",!0,!0),l={tc_oTag:a,tc_cTag:s,tc_expr:u},c={jsxName:new i("jsxName"),jsxText:new i("jsxText",{beforeExpr:!0}),jsxTagStart:new i("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new i("jsxTagEnd")};c.jsxTagStart.updateContext=function(){this.context.push(u),this.context.push(a),this.exprAllowed=!1},c.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===a&&e===r.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===u):this.exprAllowed=!0},t={tokContexts:l,tokTypes:c},o.set(e,t)}return t}function u(e){return e?"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?u(e.object)+"."+u(e.property):void 0:e}e.exports=function(e){return e=e||{},function(t){return function(e,t){const o=t.acorn||r(48630),l=s(o),c=o.tokTypes,p=l.tokTypes,f=o.tokContexts,h=l.tokContexts.tc_oTag,d=l.tokContexts.tc_cTag,m=l.tokContexts.tc_expr,y=o.isNewLine,g=o.isIdentifierStart,v=o.isIdentifierChar;return class extends t{static get acornJsx(){return l}jsx_readToken(){let e="",t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let r=this.input.charCodeAt(this.pos);switch(r){case 60:case 123:return this.pos===this.start?60===r&&this.exprAllowed?(++this.pos,this.finishToken(p.jsxTagStart)):this.getTokenFromCode(r):(e+=this.input.slice(t,this.pos),this.finishToken(p.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(62===r?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:y(r)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t,r=this.input.charCodeAt(this.pos);return++this.pos,13===r&&10===this.input.charCodeAt(this.pos)?(++this.pos,t=e?"\n":"\r\n"):t=String.fromCharCode(r),this.options.locations&&(++this.curLine,this.lineStart=this.pos),t}jsx_readString(e){let t="",r=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let n=this.input.charCodeAt(this.pos);if(n===e)break;38===n?(t+=this.input.slice(r,this.pos),t+=this.jsx_readEntity(),r=this.pos):y(n)?(t+=this.input.slice(r,this.pos),t+=this.jsx_readNewLine(!1),r=this.pos):++this.pos}return t+=this.input.slice(r,this.pos++),this.finishToken(c.string,t)}jsx_readEntity(){let e,t="",r=0,o=this.input[this.pos];"&"!==o&&this.raise(this.pos,"Entity must start with an ampersand");let s=++this.pos;for(;this.pos")}let o=i.name?"Element":"Fragment";return r["opening"+o]=i,r["closing"+o]=a,r.children=n,this.type===c.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(r,"JSX"+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type="JSXText",e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===p.jsxText?this.jsx_parseText():this.type===p.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===h||t===d){if(g(e))return this.jsx_readWord();if(62==e)return++this.pos,this.finishToken(p.jsxTagEnd);if((34===e||39===e)&&t==h)return this.jsx_readString(e)}return 60===e&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1)?(++this.pos,this.finishToken(p.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==c.braceL){var t=this.curContext();t==h?this.context.push(f.b_expr):t==m?this.context.push(f.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else{if(this.type!==c.slash||e!==p.jsxTagStart)return super.updateContext(e);this.context.length-=2,this.context.push(d),this.exprAllowed=!1}}}}({allowNamespaces:!1!==e.allowNamespaces,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(e.exports,"tokTypes",{get:function(){return s(r(48630)).tokTypes},configurable:!0,enumerable:!0})},19304:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n=t.body,o=t.indexKind,s=t.itemKind;if(r=function(e){return i.default.find(e,"ReturnStatement")}(n))return[r,"Return statement used in for-loop body"];if(r=function(e){return i.default.find(e,function(e){var t=e.type,r=e.label;return"BreakStatement"===t&&r})}(n))return[r,"Break statement with label used in for-loop body"];if(r=function(e){return i.default.find(e,function(e){var t=e.type,r=e.label;return"ContinueStatement"===t&&r})}(n))return[r,"Continue statement with label used in for-loop body"];if(r=function(e){return i.default.find(e,"BreakStatement",{skipTypes:[].concat(a,["SwitchStatement"])})}(n))return[r,"Break statement used in for-loop body"];if(r=function(e){return i.default.find(e,"ContinueStatement",{skipTypes:a})}(n))return[r,"Continue statement used in for-loop body"];if("let"!==o)return[e,"Only for-loops with indexes declared as let can be transformed (use let transform first)"];if("const"!==s)return[e,"Only for-loops with const array items can be transformed (use let transform first)"]};var n,i=(n=r(88543))&&n.__esModule?n:{default:n};var a=["ForStatement","ForInStatement","ForOfStatement","DoWhileStatement","WhileStatement"]},19616:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(35302)),a=n.__importStar(r(64522));t.default=function(e){var t=e.use(i.default),r=t.Type.def,n=t.Type.or,o=e.use(a.default).defaults,s=n(r("TypeAnnotation"),r("TSTypeAnnotation"),null),u=n(r("TypeParameterDeclaration"),r("TSTypeParameterDeclaration"),null);r("Identifier").field("typeAnnotation",s,o.null),r("ObjectPattern").field("typeAnnotation",s,o.null),r("Function").field("returnType",s,o.null).field("typeParameters",u,o.null),r("ClassProperty").build("key","value","typeAnnotation","static").field("value",n(r("Expression"),null)).field("static",Boolean,o.false).field("typeAnnotation",s,o.null),["ClassDeclaration","ClassExpression"].forEach(function(e){r(e).field("typeParameters",u,o.null).field("superTypeParameters",n(r("TypeParameterInstantiation"),r("TSTypeParameterInstantiation"),null),o.null).field("implements",n([r("ClassImplements")],[r("TSExpressionWithTypeArguments")]),o.emptyArray)})},(0,a.maybeSetModuleExports)(function(){return e})},19727:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(25065),i=o(r(23584)),a=o(r(51720));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,n.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",computed:!1,object:function(e){return(0,i.default)(e)||(0,a.default)(e)},property:(0,n.extract)("id",{type:"Identifier"})},right:(0,n.extractAny)("value")}});t.default=s},21074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){i.default.replace(e,(0,a.default)(e,{enter:function(e,t,r){if(function(e){return"FunctionDeclaration"===e.type||"FunctionExpression"===e.type}(e)&&0===e.params.length){var i=(0,n.find)(function(e){return"arguments"===e.name},r.variables);i&&i.references.length>0&&!i.references.some(function(e){return s(e.from)})&&(i.references.forEach(function(e){e.identifier.name="args"}),e.params=[{type:"RestElement",argument:{type:"Identifier",name:"args"}}])}}}))};var n=r(44480),i=o(r(88543)),a=o(r(73079));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return!!e&&(!!e.variables.some(function(e){return"args"===e.name})||s(e.upper))}},22598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(88543))&&n.__esModule?n:{default:n};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=(0,r(25065).matches)({type:"Identifier",name:"exports"});t.default=n},23647:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(35302)),a=n.__importDefault(r(33843)),o=n.__importDefault(r(8651)),s=r(64522);t.default=function(e){var t=e.use(i.default).Type.def;e.use(a.default),e.use(o.default),t("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),t("TopicReference").bases("Expression").build()},(0,s.maybeSetModuleExports)(function(){return e})},23875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;var n=r(64147);t.parse=function(e,t){var i=[],a=r(11206).parse(e,{loc:!0,locations:!0,comment:!0,onComment:i,range:(0,n.getOption)(t,"range",!1),tolerant:(0,n.getOption)(t,"tolerant",!0),tokens:!0,jsx:(0,n.getOption)(t,"jsx",!1),sourceType:(0,n.getOption)(t,"sourceType","module")});return Array.isArray(a.comments)||(a.comments=i),a}},24133:(e,t,r)=>{"use strict";var n=r(10487),i=r(38452),a=r(13003),o=r(76642),s=r(92464),u=n(o(),Number);i(u,{getPolyfill:o,implementation:a,shim:s}),e.exports=u},25065:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchesLength=t.extractAny=t.extract=t.matches=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(44480);var a=t.matches=(0,i.curry)(function(e,t){var r={};return!!(0,i.isMatchWith)(function(e,t){if("function"==typeof t){var i=t(e);return"object"===(void 0===i?"undefined":n(i))&&Object.assign(r,i),i}},e,t)&&r}),o=t.extract=(0,i.curry)(function(e,t,r){var i=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},e,r);if("object"===(void 0===t?"undefined":n(t))&&(t=a(t)),"function"==typeof t){var o=t(r);if("object"===(void 0===o?"undefined":n(o)))return Object.assign(i,o);if(!o)return!1}return i});t.extractAny=(0,i.curry)(function(e,t){return o(e,void 0,t)}),t.matchesLength=(0,i.curry)(function(e,t){return t.length===e.length&&a(e,t)})},25767:(e,t,r)=>{"use strict";var n=r(82682),i=r(39209),a=r(10487),o=r(36556),s=r(75795),u=r(93628),l=o("Object.prototype.toString"),c=r(49092)(),p="undefined"==typeof globalThis?r.g:globalThis,f=i(),h=o("String.prototype.slice"),d=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1?t:"Object"===t&&function(e){var t=!1;return n(m,function(r,n){if(!t)try{r(e),t=h(n,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return n(m,function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(e){}}),t}(e):null}},26277:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(57968)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){e.use(i.default);var t=e.use(a.default),r=t.Type.def,n=t.Type.or,s=e.use(o.default).defaults;r("Function").field("generator",Boolean,s.false).field("expression",Boolean,s.false).field("defaults",[n(r("Expression"),null)],s.emptyArray).field("rest",n(r("Identifier"),null),s.null),r("RestElement").bases("Pattern").build("argument").field("argument",r("Pattern")).field("typeAnnotation",n(r("TypeAnnotation"),r("TSTypeAnnotation"),null),s.null),r("SpreadElementPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("FunctionDeclaration").build("id","params","body","generator","expression").field("id",n(r("Identifier"),null)),r("FunctionExpression").build("id","params","body","generator","expression"),r("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,s.null).field("body",n(r("BlockStatement"),r("Expression"))).field("generator",!1,s.false),r("ForOfStatement").bases("Statement").build("left","right","body").field("left",n(r("VariableDeclaration"),r("Pattern"))).field("right",r("Expression")).field("body",r("Statement")),r("YieldExpression").bases("Expression").build("argument","delegate").field("argument",n(r("Expression"),null)).field("delegate",Boolean,s.false),r("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",n(r("Expression"),null)),r("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",n(r("Expression"),null)),r("ComprehensionBlock").bases("Node").build("left","right","each").field("left",r("Pattern")).field("right",r("Expression")).field("each",Boolean),r("Property").field("key",n(r("Literal"),r("Identifier"),r("Expression"))).field("value",n(r("Expression"),r("Pattern"))).field("method",Boolean,s.false).field("shorthand",Boolean,s.false).field("computed",Boolean,s.false),r("ObjectProperty").field("shorthand",Boolean,s.false),r("PropertyPattern").bases("Pattern").build("key","pattern").field("key",n(r("Literal"),r("Identifier"),r("Expression"))).field("pattern",r("Pattern")).field("computed",Boolean,s.false),r("ObjectPattern").bases("Pattern").build("properties").field("properties",[n(r("PropertyPattern"),r("Property"))]),r("ArrayPattern").bases("Pattern").build("elements").field("elements",[n(r("Pattern"),null)]),r("SpreadElement").bases("Node").build("argument").field("argument",r("Expression")),r("ArrayExpression").field("elements",[n(r("Expression"),r("SpreadElement"),r("RestElement"),null)]),r("NewExpression").field("arguments",[n(r("Expression"),r("SpreadElement"))]),r("CallExpression").field("arguments",[n(r("Expression"),r("SpreadElement"))]),r("AssignmentPattern").bases("Pattern").build("left","right").field("left",r("Pattern")).field("right",r("Expression")),r("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",n("constructor","method","get","set")).field("key",r("Expression")).field("value",r("Function")).field("computed",Boolean,s.false).field("static",Boolean,s.false);var u=n(r("MethodDefinition"),r("VariableDeclarator"),r("ClassPropertyDefinition"),r("ClassProperty"),r("StaticBlock"));r("ClassProperty").bases("Declaration").build("key").field("key",n(r("Literal"),r("Identifier"),r("Expression"))).field("computed",Boolean,s.false),r("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",u),r("ClassBody").bases("Declaration").build("body").field("body",[u]),r("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",n(r("Identifier"),null)).field("body",r("ClassBody")).field("superClass",n(r("Expression"),null),s.null),r("ClassExpression").bases("Expression").build("id","body","superClass").field("id",n(r("Identifier"),null),s.null).field("body",r("ClassBody")).field("superClass",n(r("Expression"),null),s.null),r("Super").bases("Expression").build(),r("Specifier").bases("Node"),r("ModuleSpecifier").bases("Specifier").field("local",n(r("Identifier"),null),s.null).field("id",n(r("Identifier"),null),s.null).field("name",n(r("Identifier"),null),s.null),r("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",r("Identifier")),r("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),r("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),r("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[n(r("ImportSpecifier"),r("ImportNamespaceSpecifier"),r("ImportDefaultSpecifier"))],s.emptyArray).field("source",r("Literal")).field("importKind",n("value","type"),function(){return"value"}),r("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",n(r("Declaration"),null)).field("specifiers",[r("ExportSpecifier")],s.emptyArray).field("source",n(r("Literal"),null),s.null),r("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",r("Identifier")),r("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",n(r("Declaration"),r("Expression"))),r("ExportAllDeclaration").bases("Declaration").build("source").field("source",r("Literal")),r("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",r("Expression")).field("quasi",r("TemplateLiteral")),r("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[r("TemplateElement")]).field("expressions",[r("Expression")]),r("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),r("MetaProperty").bases("Expression").build("meta","property").field("meta",r("Identifier")).field("property",r("Identifier"))},(0,o.maybeSetModuleExports)(function(){return e})},28143:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(32185)),a=n.__importDefault(r(69823)),o=n.__importDefault(r(35302)),s=n.__importStar(r(64522));t.default=function(e){e.use(i.default),e.use(a.default);var t=e.use(o.default),r=t.Type.def,n=t.Type.or,u=e.use(s.default).defaults;r("ImportExpression").bases("Expression").build("source").field("source",r("Expression")),r("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",r("Literal")).field("exported",n(r("Identifier"),null,void 0),u.null),r("ChainElement").bases("Node").field("optional",Boolean,u.false),r("CallExpression").bases("Expression","ChainElement"),r("MemberExpression").bases("Expression","ChainElement"),r("ChainExpression").bases("Expression").build("expression").field("expression",r("ChainElement")),r("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,u.true),r("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,u.true)},(0,s.maybeSetModuleExports)(function(){return e})},28875:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=r(1093),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===a.call(e),n=o(e),s=t&&"[object String]"===a.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(s&&e.length>0&&!i.call(e,0))for(var m=0;m0)for(var y=0;y{!function e(t){"use strict";var n,i,a,o,s,u;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function c(e,t){this.parent=e,this.key=t}function p(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function h(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function d(e,t){return(e===n.ObjectExpression||e===n.ObjectPattern)&&"properties"===t}function m(e,t){return(new f).traverse(e,t)}function y(e,t){var r;return r=function(e,t){var r,n,i,a;for(n=e.length,i=0;n;)t(e[a=i+(r=n>>>1)])?n=r:(i=a+1,n-=r+1);return i}(t,function(t){return t.range[0]>e.range[0]}),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return n={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},a={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},i={Break:o={},Skip:s={},Remove:u={}},c.prototype.replace=function(e){this.parent[this.key]=e},c.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,i;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(g=a[c=y[f]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(d(u,y[f]))i=new p(g[m],[c,m],"Property",null);else{if(!h(g[m]))continue;i=new p(g[m],[c,m],null,null)}r.push(i)}}else h(g)&&r.push(new p(g,c,null,null))}}else if(i=n.pop(),l=this.__execute(t.leave,i),this.__state===o||l===o)return},f.prototype.replace=function(e,t){var r,n,i,a,l,f,m,y,g,v,b,x,S;function E(e){var t,n,i,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((i=r[t]).ref&&i.ref.parent===a){if(i.ref.key=0;)if(v=i[S=g[m]])if(Array.isArray(v)){for(y=v.length;(y-=1)>=0;)if(v[y]){if(d(a,g[m]))f=new p(v[y],[S,y],"Property",new c(v,y));else{if(!h(v[y]))continue;f=new p(v[y],[S,y],null,new c(v,y))}r.push(f)}}else h(v)&&r.push(new p(v,S,null,new c(i,S)))}}else if(f=n.pop(),void 0!==(l=this.__execute(t.leave,f))&&l!==o&&l!==s&&l!==u&&f.ref.replace(l),this.__state!==u&&l!==u||E(f),this.__state===o||l===o)return x.root;return x.root},t.version=r(40705).rE,t.Syntax=n,t.traverse=m,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var n,a,o,s,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(o=0,a=t.length;oe.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?i.Break:u[s].extendedRange[0]>e.range[1]?i.Skip:void 0}}),s=0,m(e,{leave:function(e){for(var t;se.range[1]?i.Skip:void 0}}),e},t.VisitorKeys=a,t.VisitorOption=i,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)},30041:(e,t,r)=>{"use strict";var n=r(30655),i=r(58068),a=r(69675),o=r(75795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],p=!!o&&o(e,t);if(n)n(e,t,{configurable:null===l&&p?p.configurable:!l,enumerable:null===s&&p?p.enumerable:!s,value:r,writable:null===u&&p?p.writable:!u});else{if(!c&&(s||u||l))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},30592:(e,t,r)=>{"use strict";var n=r(30655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},30655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},31352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClassScope=t.ForScope=t.FunctionScope=t.SwitchScope=t.BlockScope=t.TDZScope=t.WithScope=t.CatchScope=t.FunctionExpressionNameScope=t.ModuleScope=t.GlobalScope=void 0;var n=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},i=function(){function e(e,t){for(var r=0;r0&&r.every(d)}},{key:"__staticCloseRef",value:function(e){this.__resolve(e)||this.__delegateToUpperScope(e)}},{key:"__dynamicCloseRef",value:function(e){var t=this;do{t.through.push(e),t=t.upper}while(t)}},{key:"__globalCloseRef",value:function(e){this.__shouldStaticallyCloseForGlobal(e)?this.__staticCloseRef(e):this.__dynamicCloseRef(e)}},{key:"__close",value:function(e){var t;t=this.__shouldStaticallyClose(e)?this.__staticCloseRef:"global"!==this.type?this.__dynamicCloseRef:this.__globalCloseRef;for(var r=0,n=this.__left.length;r{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(35302)),a=n.__importDefault(r(112)),o=n.__importDefault(r(97399)),s=r(64522);t.default=function(e){var t=e.use(i.default),r=t.namedTypes,n=t.builders,s=t.builtInTypes.number,u=t.builtInTypes.array,l=e.use(a.default),c=e.use(o.default),p=function e(t,r,n){if(!(this instanceof e))throw new Error("NodePath constructor cannot be invoked without 'new'");l.call(this,t,r,n)},f=p.prototype=Object.create(l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}});function h(e){return r.BinaryExpression.check(e)||r.LogicalExpression.check(e)}Object.defineProperties(f,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),f.replace=function(){return delete this.node,delete this.parent,delete this.scope,l.prototype.replace.apply(this,arguments)},f.prune=function(){var e=this.parent;return this.replace(),function(e){if(r.VariableDeclaration.check(e.node)){var t=e.get("declarations").value;if(!t||0===t.length)return e.prune()}else if(r.ExpressionStatement.check(e.node)){if(!e.get("expression").value)return e.prune()}else r.IfStatement.check(e.node)&&function(e){var t=e.get("test").value,i=e.get("alternate").value,a=e.get("consequent").value;if(a||i){if(!a&&i){var o=n.unaryExpression("!",t,!0);r.UnaryExpression.check(t)&&"!"===t.operator&&(o=t.argument),e.get("test").replace(o),e.get("consequent").replace(i),e.get("alternate").replace()}}else{var s=n.expressionStatement(t);e.replace(s)}}(e);return e}(e)},f._computeNode=function(){var e=this.value;if(r.Node.check(e))return e;var t=this.parentPath;return t&&t.node||null},f._computeParent=function(){var e=this.value,t=this.parentPath;if(!r.Node.check(e)){for(;t&&!r.Node.check(t.value);)t=t.parentPath;t&&(t=t.parentPath)}for(;t&&!r.Node.check(t.value);)t=t.parentPath;return t||null},f._computeScope=function(){var e=this.value,t=this.parentPath,n=t&&t.scope;return r.Node.check(e)&&c.isEstablishedBy(e)&&(n=new c(this,n)),n||null},f.getValueProperty=function(e){return t.getFieldValue(this.value,e)},f.needsParens=function(e){var t=this.parentPath;if(!t)return!1;var n=this.value;if(!r.Expression.check(n))return!1;if("Identifier"===n.type)return!1;for(;!r.Node.check(t.value);)if(!(t=t.parentPath))return!1;var i=t.value;switch(n.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return"MemberExpression"===i.type&&"object"===this.name&&i.object===n;case"BinaryExpression":case"LogicalExpression":switch(i.type){case"CallExpression":return"callee"===this.name&&i.callee===n;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return"object"===this.name&&i.object===n;case"BinaryExpression":case"LogicalExpression":var a=n,o=i.operator,u=d[o],l=a.operator,c=d[l];if(u>c)return!0;if(u===c&&"right"===this.name){if(i.right!==a)throw new Error("Nodes must be equal");return!0}default:return!1}case"SequenceExpression":switch(i.type){case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==this.name;default:return!0}case"YieldExpression":switch(i.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return"MemberExpression"===i.type&&s.check(n.value)&&"object"===this.name&&i.object===n;case"AssignmentExpression":case"ConditionalExpression":switch(i.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===this.name&&i.callee===n;case"ConditionalExpression":return"test"===this.name&&i.test===n;case"MemberExpression":return"object"===this.name&&i.object===n;default:return!1}default:if("NewExpression"===i.type&&"callee"===this.name&&i.callee===n)return m(n)}return!(!0===e||this.canBeFirstInStatement()||!this.firstInStatement())};var d={};function m(e){return!!r.CallExpression.check(e)||(u.check(e)?e.some(m):!!r.Node.check(e)&&t.someField(e,function(e,t){return m(t)}))}return[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,t){e.forEach(function(e){d[e]=t})}),f.canBeFirstInStatement=function(){var e=this.node;return!r.FunctionExpression.check(e)&&!r.ObjectExpression.check(e)},f.firstInStatement=function(){return function(e){for(var t,n;e.parent;e=e.parent){if(t=e.node,n=e.parent.node,r.BlockStatement.check(n)&&"body"===e.parent.name&&0===e.name){if(n.body[0]!==t)throw new Error("Nodes must be equal");return!0}if(r.ExpressionStatement.check(n)&&"expression"===e.name){if(n.expression!==t)throw new Error("Nodes must be equal");return!0}if(r.SequenceExpression.check(n)&&"expressions"===e.parent.name&&0===e.name){if(n.expressions[0]!==t)throw new Error("Nodes must be equal")}else if(r.CallExpression.check(n)&&"callee"===e.name){if(n.callee!==t)throw new Error("Nodes must be equal")}else if(r.MemberExpression.check(n)&&"object"===e.name){if(n.object!==t)throw new Error("Nodes must be equal")}else if(r.ConditionalExpression.check(n)&&"test"===e.name){if(n.test!==t)throw new Error("Nodes must be equal")}else if(h(n)&&"left"===e.name){if(n.left!==t)throw new Error("Nodes must be equal")}else{if(!r.UnaryExpression.check(n)||n.prefix||"argument"!==e.name)return!1;if(n.argument!==t)throw new Error("Nodes must be equal")}}return!0}(this)},p},(0,s.maybeSetModuleExports)(function(){return e})},31501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(44480),i=r(25065);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var r=0;r{"use strict";r.r(t),r.d(t,{__addDisposableResource:()=>N,__assign:()=>a,__asyncDelegator:()=>A,__asyncGenerator:()=>w,__asyncValues:()=>D,__await:()=>_,__awaiter:()=>d,__classPrivateFieldGet:()=>j,__classPrivateFieldIn:()=>I,__classPrivateFieldSet:()=>F,__createBinding:()=>y,__decorate:()=>s,__disposeResources:()=>B,__esDecorate:()=>l,__exportStar:()=>g,__extends:()=>i,__generator:()=>m,__importDefault:()=>O,__importStar:()=>P,__makeTemplateObject:()=>k,__metadata:()=>h,__param:()=>u,__propKey:()=>p,__read:()=>b,__rest:()=>o,__rewriteRelativeImportExtension:()=>R,__runInitializers:()=>c,__setFunctionName:()=>f,__spread:()=>x,__spreadArray:()=>E,__spreadArrays:()=>S,__values:()=>v,default:()=>L});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function u(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,i,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=n.kind,l="getter"===u?"get":"setter"===u?"set":"value",c=!t&&e?n.static?e:e.prototype:null,p=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,h=r.length-1;h>=0;h--){var d={};for(var m in n)d[m]="access"===m?{}:n[m];for(var m in n.access)d.access[m]=n.access[m];d.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var y=(0,r[h])("accessor"===u?{get:p.get,set:p.set}:p[l],d);if("accessor"===u){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=o(y.get))&&(p.get=s),(s=o(y.set))&&(p.set=s),(s=o(y.init))&&i.unshift(s)}else(s=o(y))&&("field"===u?i.unshift(s):p[l]=s)}c&&Object.defineProperty(c,n.name,p),f=!0}function c(e,t,r){for(var n=arguments.length>2,i=0;i0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function x(){for(var e=[],t=0;t1||s(e,t)})},t&&(n[e]=t(n[e])))}function s(e,t){try{(r=i[e](t)).value instanceof _?Promise.resolve(r.value.v).then(u,l):c(a[0][2],r)}catch(e){c(a[0][3],e)}var r}function u(e){s("next",e)}function l(e){s("throw",e)}function c(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function A(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:_(e[n](t)),done:!1}:i?i(t):t}:i}}function D(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=v(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){(function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)})(n,i,(t=e[r](t)).done,t.value)})}}}function k(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var C=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},T=function(e){return T=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},T(e)};function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=T(e),n=0;n{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=r(64522),a=n.__importDefault(r(15312));t.default=function(e){var t=e.use(a.default);return t.LogicalOperators.indexOf("??")<0&&t.LogicalOperators.push("??"),t},(0,i.maybeSetModuleExports)(function(){return e})},33340:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(25065),a=(n=r(79783))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"Property",key:{type:"Identifier"},computed:!1,value:a.default});t.default=o},33777:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(93784)),a=n.__importDefault(r(35302)),o=r(64522);t.default=function(e){e.use(i.default);var t=e.use(a.default).Type.def;t("StaticBlock").bases("Declaration").build("body").field("body",[t("Statement")])},(0,o.maybeSetModuleExports)(function(){return e})},33842:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(93017)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){var t,r,n,s,u;e.use(i.default);var l=e.use(a.default),c=e.use(o.default).defaults,p=l.Type.def,f=l.Type.or,h=l.builtInTypes.undefined;function d(e,t){return void 0===e&&(e=String),["extra",{rawValue:e,raw:String},function(){var e=l.getFieldValue(this,"value");return{rawValue:e,raw:t?t(e):String(e)}}]}p("Noop").bases("Statement").build(),p("DoExpression").bases("Expression").build("body").field("body",[p("Statement")]),p("BindExpression").bases("Expression").build("object","callee").field("object",f(p("Expression"),null)).field("callee",p("Expression")),p("ParenthesizedExpression").bases("Expression").build("expression").field("expression",p("Expression")),p("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",p("Identifier")),p("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",p("Identifier")),p("CommentBlock").bases("Comment").build("value","leading","trailing"),p("CommentLine").bases("Comment").build("value","leading","trailing"),p("Directive").bases("Node").build("value").field("value",p("DirectiveLiteral")),p("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,c["use strict"]),p("InterpreterDirective").bases("Node").build("value").field("value",String),p("BlockStatement").bases("Statement").build("body").field("body",[p("Statement")]).field("directives",[p("Directive")],c.emptyArray),p("Program").bases("Node").build("body").field("body",[p("Statement")]).field("directives",[p("Directive")],c.emptyArray).field("interpreter",f(p("InterpreterDirective"),null),c.null),(t=p("StringLiteral").bases("Literal").build("value").field("value",String)).field.apply(t,d(String,function(e){return JSON.stringify(e)})),(r=p("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",f(String,null),c.null)).field.apply(r,d(Number)),(n=p("BigIntLiteral").bases("Literal").build("value").field("value",f(String,Number))).field.apply(n,d(String,function(e){return e+"n"})),(s=p("DecimalLiteral").bases("Literal").build("value").field("value",String)).field.apply(s,d(String,function(e){return e+"m"})),p("NullLiteral").bases("Literal").build().field("value",null,c.null),p("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),(u=p("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)})).field.apply(u,d(f(RegExp,h),function(e){return"/".concat(e.pattern,"/").concat(e.flags||"")})).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var m=f(p("Property"),p("ObjectMethod"),p("ObjectProperty"),p("SpreadProperty"),p("SpreadElement"));p("ObjectExpression").bases("Expression").build("properties").field("properties",[m]),p("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",f("method","get","set")).field("key",f(p("Literal"),p("Identifier"),p("Expression"))).field("params",[p("Pattern")]).field("body",p("BlockStatement")).field("computed",Boolean,c.false).field("generator",Boolean,c.false).field("async",Boolean,c.false).field("accessibility",f(p("Literal"),null),c.null).field("decorators",f([p("Decorator")],null),c.null),p("ObjectProperty").bases("Node").build("key","value").field("key",f(p("Literal"),p("Identifier"),p("Expression"))).field("value",f(p("Expression"),p("Pattern"))).field("accessibility",f(p("Literal"),null),c.null).field("computed",Boolean,c.false);var y=f(p("MethodDefinition"),p("VariableDeclarator"),p("ClassPropertyDefinition"),p("ClassProperty"),p("ClassPrivateProperty"),p("ClassMethod"),p("ClassPrivateMethod"),p("ClassAccessorProperty"),p("StaticBlock"));p("ClassBody").bases("Declaration").build("body").field("body",[y]),p("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",f(p("Literal"),p("Identifier"),p("Expression"))),p("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",p("PrivateName")),p("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",f(p("Literal"),p("Identifier"),p("PrivateName"),p("Expression"))).field("value",f(p("Expression"),null),c.null),["ClassMethod","ClassPrivateMethod"].forEach(function(e){p(e).field("kind",f("get","set","method","constructor"),function(){return"method"}).field("body",p("BlockStatement")).field("access",f("public","private","protected",null),c.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(function(e){p(e).field("computed",Boolean,c.false).field("static",Boolean,c.false).field("abstract",Boolean,c.false).field("accessibility",f("public","private","protected",null),c.null).field("decorators",f([p("Decorator")],null),c.null).field("definite",Boolean,c.false).field("optional",Boolean,c.false).field("override",Boolean,c.false).field("readonly",Boolean,c.false)});var g=f(p("Property"),p("PropertyPattern"),p("SpreadPropertyPattern"),p("SpreadProperty"),p("ObjectProperty"),p("RestProperty"),p("RestElement"));p("ObjectPattern").bases("Pattern").build("properties").field("properties",[g]).field("decorators",f([p("Decorator")],null),c.null),p("SpreadProperty").bases("Node").build("argument").field("argument",p("Expression")),p("RestProperty").bases("Node").build("argument").field("argument",p("Expression")),p("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",f(p("VariableDeclaration"),p("Expression"))).field("right",p("Expression")).field("body",p("Statement")),p("Import").bases("Expression").build()},(0,o.maybeSetModuleExports)(function(){return e})},34564:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIncludesComparison=function(e){var t=e.operator,r=e.index;switch(t){case"!==":case"!=":case">":return(0,n.isMinusOne)(r);case">=":return(0,n.isZero)(r);default:return!1}},t.isNotIncludesComparison=function(e){var t=e.operator,r=e.index;switch(t){case"===":case"==":return(0,n.isMinusOne)(r);case"<":return(0,n.isZero)(r);default:return!1}};var n=r(87372)},35302:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0}),t.Def=void 0;var n=r(31635),i=r(64522),a=Object.prototype,o=a.toString,s=a.hasOwnProperty,u=function(){function e(){}return e.prototype.assert=function(e,t){if(!this.check(e,t)){var r=y(e);throw new Error(r+" does not match type "+this)}return!0},e.prototype.arrayOf=function(){return new l(this)},e}(),l=function(e){function t(t){var r=e.call(this)||this;return r.elemType=t,r.kind="ArrayType",r}return n.__extends(t,e),t.prototype.toString=function(){return"["+this.elemType+"]"},t.prototype.check=function(e,t){var r=this;return Array.isArray(e)&&e.every(function(e){return r.elemType.check(e,t)})},t}(u),c=function(e){function t(t){var r=e.call(this)||this;return r.value=t,r.kind="IdentityType",r}return n.__extends(t,e),t.prototype.toString=function(){return String(this.value)},t.prototype.check=function(e,t){var r=e===this.value;return r||"function"!=typeof t||t(this,e),r},t}(u),p=function(e){function t(t){var r=e.call(this)||this;return r.fields=t,r.kind="ObjectType",r}return n.__extends(t,e),t.prototype.toString=function(){return"{ "+this.fields.join(", ")+" }"},t.prototype.check=function(e,t){return o.call(e)===o.call({})&&this.fields.every(function(r){return r.type.check(e[r.name],t)})},t}(u),f=function(e){function t(t){var r=e.call(this)||this;return r.types=t,r.kind="OrType",r}return n.__extends(t,e),t.prototype.toString=function(){return this.types.join(" | ")},t.prototype.check=function(e,t){return!!this.types.some(function(r){return r.check(e,!!t)})||("function"==typeof t&&t(this,e),!1)},t}(u),h=function(e){function t(t,r){var n=e.call(this)||this;return n.name=t,n.predicate=r,n.kind="PredicateType",n}return n.__extends(t,e),t.prototype.toString=function(){return this.name},t.prototype.check=function(e,t){var r=this.predicate(e,t);return r||"function"!=typeof t||t(this,e),r},t}(u),d=function(){function e(e,t){this.type=e,this.typeName=t,this.baseNames=[],this.ownFields=Object.create(null),this.allSupertypes=Object.create(null),this.supertypeList=[],this.allFields=Object.create(null),this.fieldNames=[],this.finalized=!1,this.buildable=!1,this.buildParams=[]}return e.prototype.isSupertypeOf=function(t){if(t instanceof e){if(!0!==this.finalized||!0!==t.finalized)throw new Error("");return s.call(t.allSupertypes,this.typeName)}throw new Error(t+" is not a Def")},e.prototype.checkAllFields=function(e,t){var r=this.allFields;if(!0!==this.finalized)throw new Error(""+this.typeName);return null!==e&&"object"==typeof e&&Object.keys(r).every(function(n){var i=r[n],a=i.type,o=i.getValue(e);return a.check(o,t)})},e.prototype.bases=function(){for(var e=[],t=0;t=0)return i[a];if("string"!=typeof n)throw new Error("missing name");return new h(n,e)}return new c(e)},def:function(e){return s.call(C,e)?C[e]:C[e]=new P(e)},hasDef:function(e){return s.call(C,e)}},r=[],i=[];function a(e,t){var n=o.call(t),a=new h(e,function(e){return o.call(e)===n});return t&&"function"==typeof t.constructor&&(r.push(t.constructor),i.push(a)),a}var u=a("string","truthy"),g=a("function",function(){}),v=a("array",[]),b=a("object",{}),x=a("RegExp",/./),S=a("Date",new Date),E=a("number",3),_=a("boolean",!0),w=a("null",null),A=a("undefined",void 0),D="function"==typeof BigInt?a("BigInt",BigInt(1234)):new h("BigInt",function(){return!1}),k={string:u,function:g,array:v,object:b,RegExp:x,Date:S,number:E,boolean:_,null:w,undefined:A,BigInt:D},C=Object.create(null);function T(e){if(e&&"object"==typeof e){var t=e.type;if("string"==typeof t&&s.call(C,t)){var r=C[t];if(r.finalized)return r}}return null}var P=function(e){function r(t){var r=e.call(this,new h(t,function(e,t){return r.check(e,t)}),t)||this;return r}return n.__extends(r,e),r.prototype.check=function(e,t){if(!0!==this.finalized)throw new Error("prematurely checking unfinalized type "+this.typeName);if(null===e||"object"!=typeof e)return!1;var r=T(e);return r?t&&r===this?this.checkAllFields(e,t):!!this.isSupertypeOf(r)&&(!t||r.checkAllFields(e,t)&&this.checkAllFields(e,!1)):("SourceLocation"===this.typeName||"Position"===this.typeName)&&this.checkAllFields(e,t)},r.prototype.build=function(){for(var e=this,t=[],r=0;r=0&&function(e){var t=I(e);if(O[t])return;var r=O[F(e)];if(!r)return;var n=function(){for(var e=[],t=0;t{"use strict";e.exports=URIError},35680:(e,t,r)=>{"use strict";var n=r(25767);e.exports=function(e){return!!n(e)}},36462:(e,t,r)=>{var n=r(11106);t.encode=function(e){var t,r="",i=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&i,(i>>>=5)>0&&(t|=32),r+=n.encode(t)}while(i>0);return r},t.decode=function(e,t,r){var i,a,o,s,u=e.length,l=0,c=0;do{if(t>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(a=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&a),l+=(a&=31)<>1,1&~o?s:-s),r.rest=t}},36556:(e,t,r)=>{"use strict";var n=r(70453),i=r(73126),a=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i([r]):r}},36576:(e,t,r)=>{"use strict";var n=r(9394),i=r(38452);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},36581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(44480),i=r(25065);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var r=0;r{"use strict";var n=r(38452),i=r(10487),a=r(89211),o=r(9394),s=r(36576),u=i(o(),Object);n(u,{getPolyfill:o,implementation:a,shim:s}),e.exports=u},38075:(e,t,r)=>{"use strict";var n=r(70453),i=r(10487),a=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i(r):r}},38403:(e,t,r)=>{"use strict";var n=r(1189),i=r(41333)(),a=r(36556),o=r(79612),s=a("Array.prototype.push"),u=a("Object.prototype.propertyIsEnumerable"),l=i?o.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=o(e);if(1===arguments.length)return r;for(var a=1;a{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=r(30041),u=r(30592)(),l=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==a.call(i)||!n())return;var i;u?s(e,t,r,!0):s(e,t,r)},c=function(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";var n=r(76578),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{var n=r(65606),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),f(n,e,n.depth)}function c(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function p(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return b(i)||(i=f(e,i,n)),i}var a=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),w(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(A(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(S(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(w(r))return h(r)}var l,c="",p=!1,E=["{","}"];(m(r)&&(p=!0,E=["[","]"]),A(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return S(r)&&(c=" "+RegExp.prototype.toString.call(r)),_(r)&&(c=" "+Date.prototype.toUTCString.call(r)),w(r)&&(c=" "+h(r)),0!==o.length||p&&0!=r.length?n<0?S(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=p?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,E)):E[0]+c+E[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),T(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),x(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function m(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return"number"==typeof e}function b(e){return"string"==typeof e}function x(e){return void 0===e}function S(e){return E(e)&&"[object RegExp]"===D(e)}function E(e){return"object"==typeof e&&null!==e}function _(e){return E(e)&&"[object Date]"===D(e)}function w(e){return E(e)&&("[object Error]"===D(e)||e instanceof Error)}function A(e){return"function"==typeof e}function D(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(49032),t.isArray=m,t.isBoolean=y,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=S,t.types.isRegExp=S,t.isObject=E,t.isDate=_,t.types.isDate=_,t.isError=w,t.types.isNativeError=w,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(81135);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(56698),t._extend=function(e,t){if(!t||!E(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],a=0;a{"use strict";e.exports={rE:"4.3.0"}},41025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.isEqualWith)(function(e,t,r){return i[r]},e,t)};var n=r(44480),i={comments:!0,loc:!0,start:!0,end:!0}},41064:()=>{},41237:e=>{"use strict";e.exports=EvalError},41333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},41434:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=t.use=t.Type=t.someField=t.PathVisitor=t.Path=t.NodePath=t.namedTypes=t.getSupertypeNames=t.getFieldValue=t.getFieldNames=t.getBuilderName=t.finalize=t.eachField=t.defineMethod=t.builtInTypes=t.builders=t.astNodesAreEquivalent=void 0;var n=r(31635),i=n.__importDefault(r(97055)),a=n.__importDefault(r(93017)),o=n.__importDefault(r(1474)),s=n.__importDefault(r(8651)),u=n.__importDefault(r(75944)),l=n.__importDefault(r(23647)),c=n.__importDefault(r(55844)),p=r(68494);Object.defineProperty(t,"namedTypes",{enumerable:!0,get:function(){return p.namedTypes}});var f=(0,i.default)([a.default,o.default,s.default,u.default,l.default,c.default]),h=f.astNodesAreEquivalent,d=f.builders,m=f.builtInTypes,y=f.defineMethod,g=f.eachField,v=f.finalize,b=f.getBuilderName,x=f.getFieldNames,S=f.getFieldValue,E=f.getSupertypeNames,_=f.namedTypes,w=f.NodePath,A=f.Path,D=f.PathVisitor,k=f.someField,C=f.Type,T=f.use,P=f.visit;t.astNodesAreEquivalent=h,t.builders=d,t.builtInTypes=m,t.defineMethod=y,t.eachField=g,t.finalize=v,t.getBuilderName=b,t.getFieldNames=x,t.getFieldValue=S,t.getSupertypeNames=E,t.NodePath=w,t.Path=A,t.PathVisitor=D,t.someField=k,t.Type=C,t.use=T,t.visit=P,Object.assign(p.namedTypes,_)},42469:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=r(64522),a=n.__importDefault(r(32185));t.default=function(e){var t=e.use(a.default);return t.LogicalOperators.forEach(function(e){var r=e+"=";t.AssignmentOperators.indexOf(r)<0&&t.AssignmentOperators.push(r)}),t},(0,i.maybeSetModuleExports)(function(){return e})},44480:(e,t,r)=>{var n=r(99761).runInContext();e.exports=r(73424)(n,n)},45180:(e,t,r)=>{var n=r(90597);function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){var t,r,i,a,o,s;t=this._last,r=e,i=t.generatedLine,a=r.generatedLine,o=t.generatedColumn,s=r.generatedColumn,a>i||a==i&&s>=o||n.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.P=i},45577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(){function e(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){n.default.replace(e,{enter:function(e,r){if((0,i.default)(e)){if("Program"!==r.type)return void t.warn(e,"import can only be at root level","commonjs");(0,o.default)({parent:r,node:e,replacements:e.declarations.map(function(t){return function(e,t){var r;if(!(r=(0,a.matchRequire)(e)))return(r=(0,a.matchRequireWithProperty)(e))?"default"===r.property.name?f(r):function(e){var t=e.id,r=e.property,n=e.sources;return new s.default({specifiers:[h({local:t,imported:r})],source:n[0]})}(r):new c.default(t,[e]);if("ObjectPattern"===r.id.type)return i=(n=r).id,o=n.sources,new s.default({specifiers:i.properties.map(function(e){var t=e.key;return h({local:e.value,imported:t})}),source:o[0]});if("Identifier"===r.id.type)return f(r);var n,i,o}(t,e.kind)}),preserveComments:!0})}}})};var n=p(r(88543)),i=p(r(58)),a=r(11592),o=p(r(51329)),s=p(r(60136)),u=p(r(33340)),l=p(r(40301)),c=p(r(97587));function p(e){return e&&e.__esModule?e:{default:e}}function f(e){var t=e.id,r=e.sources;return new s.default({specifiers:[new l.default(t)],source:r[0]})}function h(e){var t=e.local,r=e.imported;return"default"===r.name?new l.default(t):new u.default({local:t,imported:r})}},47119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},47244:(e,t,r)=>{"use strict";var n=r(49092)(),i=r(36556)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},47289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=void 0;var n=r(64147),i={parser:r(23875),tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:(0,n.getLineTerminator)(),wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0,tokens:!0},a=i.hasOwnProperty;t.normalize=function(e){var t=e||i;function r(e){return a.call(t,e)?t[e]:i[e]}return{tabWidth:+r("tabWidth"),useTabs:!!r("useTabs"),reuseWhitespace:!!r("reuseWhitespace"),lineTerminator:r("lineTerminator"),wrapColumn:Math.max(r("wrapColumn"),0),sourceFileName:r("sourceFileName"),sourceMapName:r("sourceMapName"),sourceRoot:r("sourceRoot"),inputSourceMap:r("inputSourceMap"),parser:r("esprima")||r("parser"),range:r("range"),tolerant:r("tolerant"),quote:r("quote"),trailingComma:r("trailingComma"),arrayBracketSpacing:r("arrayBracketSpacing"),objectCurlySpacing:r("objectCurlySpacing"),arrowParensAlways:r("arrowParensAlways"),flowObjectCommas:r("flowObjectCommas"),tokens:!!r("tokens")}}},48184:(e,t,r)=>{"use strict";var n,i=r(36556),a=r(99721)(/^\s*(?:function)?\*/),o=r(49092)(),s=r(93628),u=i("Object.prototype.toString"),l=i("Function.prototype.toString");e.exports=function(e){if("function"!=typeof e)return!1;if(a(l(e)))return!0;if(!o)return"[object GeneratorFunction]"===u(e);if(!s)return!1;if(void 0===n){var t=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&s(t)}return s(e)===n}},48193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(44480),i=o(r(49224)),a=o(r(51329));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=i.parent,o=i.node;this.replacements.push({parent:a,node:o,replacements:[]})}}catch(e){n.e(e)}finally{n.f()}this.constructor.setSuperClass(e)}},{key:"addMethod",value:function(e){this.methods.push(e)}},{key:"isTransformable",value:function(){return this.methods.length>0||void 0!==this.superClass}},{key:"transform",value:function(){(0,a.default)({parent:this.parent,node:this.fullNode,replacements:[this.toClassDeclaration()]}),this.replacements.forEach(a.default),this.methods.forEach(function(e){return e.remove()})}},{key:"toClassDeclaration",value:function(){return{type:"ClassDeclaration",superClass:this.superClass,id:{type:"Identifier",name:this.name},body:{type:"ClassBody",body:this.createMethods()},comments:(0,i.default)(this.commentNodes)}}},{key:"createMethods",value:function(){var e=this;return(0,n.compact)([this.createConstructor()].concat(u(this.methods.map(function(t){return t.setSuperClass(e.superClass),t.toMethodDefinition()}))))}},{key:"createConstructor",value:function(){return this.constructor.isEmpty()?void 0:this.constructor.toMethodDefinition()}}])&&p(t.prototype,r),o&&p(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=h},48630:function(e,t){!function(e){"use strict";var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,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,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,343,9,54,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,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],r=[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,4,51,13,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,39,27,10,22,251,41,7,1,17,2,60,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,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,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,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,229,29,3,0,496,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],n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",i="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",a={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},o="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",s={5:o,"5module":o+" export import",6:o+" const class extends export import super"},u=/^in(stanceof)?$/,l=new RegExp("["+i+"]"),c=new RegExp("["+i+n+"]");function p(e,t){for(var r=65536,n=0;ne)return!1;if((r+=t[n+1])>=e)return!0}return!1}function f(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&p(e,r)))}function h(e,n){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&c.test(String.fromCharCode(e)):!1!==n&&(p(e,r)||p(e,t)))))}var d=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function m(e,t){return new d(e,{beforeExpr:!0,binop:t})}var y={beforeExpr:!0},g={startsExpr:!0},v={};function b(e,t){return void 0===t&&(t={}),t.keyword=e,v[e]=new d(e,t)}var x={num:new d("num",g),regexp:new d("regexp",g),string:new d("string",g),name:new d("name",g),privateId:new d("privateId",g),eof:new d("eof"),bracketL:new d("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new d("]"),braceL:new d("{",{beforeExpr:!0,startsExpr:!0}),braceR:new d("}"),parenL:new d("(",{beforeExpr:!0,startsExpr:!0}),parenR:new d(")"),comma:new d(",",y),semi:new d(";",y),colon:new d(":",y),dot:new d("."),question:new d("?",y),questionDot:new d("?."),arrow:new d("=>",y),template:new d("template"),invalidTemplate:new d("invalidTemplate"),ellipsis:new d("...",y),backQuote:new d("`",g),dollarBraceL:new d("${",{beforeExpr:!0,startsExpr:!0}),eq:new d("=",{beforeExpr:!0,isAssign:!0}),assign:new d("_=",{beforeExpr:!0,isAssign:!0}),incDec:new d("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new d("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("/<=/>=",7),bitShift:m("<>/>>>",8),plusMin:new d("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new d("**",{beforeExpr:!0}),coalesce:m("??",1),_break:b("break"),_case:b("case",y),_catch:b("catch"),_continue:b("continue"),_debugger:b("debugger"),_default:b("default",y),_do:b("do",{isLoop:!0,beforeExpr:!0}),_else:b("else",y),_finally:b("finally"),_for:b("for",{isLoop:!0}),_function:b("function",g),_if:b("if"),_return:b("return",y),_switch:b("switch"),_throw:b("throw",y),_try:b("try"),_var:b("var"),_const:b("const"),_while:b("while",{isLoop:!0}),_with:b("with"),_new:b("new",{beforeExpr:!0,startsExpr:!0}),_this:b("this",g),_super:b("super",g),_class:b("class",g),_extends:b("extends",y),_export:b("export"),_import:b("import",g),_null:b("null",g),_true:b("true",g),_false:b("false",g),_in:b("in",{beforeExpr:!0,binop:7}),_instanceof:b("instanceof",{beforeExpr:!0,binop:7}),_typeof:b("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:b("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:b("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},S=/\r\n?|\n|\u2028|\u2029/,E=new RegExp(S.source,"g");function _(e){return 10===e||13===e||8232===e||8233===e}function w(e,t,r){void 0===r&&(r=e.length);for(var n=t;n>10),56320+(1023&e)))}var N=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,M=function(e,t){this.line=e,this.column=t};M.prototype.offset=function(e){return new M(this.line,this.column+e)};var B=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};function R(e,t){for(var r=1,n=0;;){var i=w(e,n,t);if(i<0)return new M(r,t-n);++r,n=i}}var L={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},V=!1;function U(e){var t={};for(var r in L)t[r]=e&&P(e,r)?e[r]:L[r];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!V&&"object"==typeof console&&console.warn&&(V=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),O(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return O(t.onComment)&&(t.onComment=z(t,t.onComment)),t}function z(e,t){return function(r,n,i,a,o,s){var u={type:r?"Block":"Line",value:n,start:i,end:a};e.locations&&(u.loc=new B(this,o,s)),e.ranges&&(u.range=[i,a]),t.push(u)}}var W=1,J=2,q=4,X=8,G=16,K=32,H=64,$=128,Y=256,Z=512,Q=W|J|Y;function ee(e,t){return J|(e?q:0)|(t?X:0)}var te=0,re=1,ne=2,ie=3,ae=4,oe=5,se=function(e,t,r){this.options=e=U(e),this.sourceFile=e.sourceFile,this.keywords=F(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var n="";!0!==e.allowReserved&&(n=a[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(n+=" await")),this.reservedWords=F(n);var i=(n?n+" ":"")+a.strict;this.reservedWordsStrict=F(i),this.reservedWordsStrictBind=F(i+" "+a.strictBind),this.input=String(t),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf("\n",r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=x.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(W),this.regexpState=null,this.privateNameStack=[]},ue={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};se.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},ue.inFunction.get=function(){return(this.currentVarScope().flags&J)>0},ue.inGenerator.get=function(){return(this.currentVarScope().flags&X)>0},ue.inAsync.get=function(){return(this.currentVarScope().flags&q)>0},ue.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(Y|Z))return!1;if(t&J)return(t&q)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},ue.allowSuper.get=function(){return(this.currentThisScope().flags&H)>0||this.options.allowSuperOutsideMethod},ue.allowDirectSuper.get=function(){return(this.currentThisScope().flags&$)>0},ue.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ue.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(Y|Z)||t&J&&!(t&G))return!0}return!1},ue.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Y)>0},se.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,n=0;n=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(n+1))}e+=t[0].length,D.lastIndex=e,e+=D.exec(this.input)[0].length,";"===this.input[e]&&e++}},le.eat=function(e){return this.type===e&&(this.next(),!0)},le.isContextual=function(e){return this.type===x.name&&this.value===e&&!this.containsEsc},le.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},le.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},le.canInsertSemicolon=function(){return this.type===x.eof||this.type===x.braceR||S.test(this.input.slice(this.lastTokEnd,this.start))},le.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},le.semicolon=function(){this.eat(x.semi)||this.insertSemicolon()||this.unexpected()},le.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},le.expect=function(e){this.eat(e)||this.unexpected()},le.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var pe=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};le.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,t?"Assigning to rvalue":"Parenthesized pattern")}},le.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,n=e.doubleProto;if(!t)return r>=0||n>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},le.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(f(n,!0)){for(var i=r+1;h(n=this.input.charCodeAt(i),!0);)++i;if(92===n||n>55295&&n<56320)return!0;var a=this.input.slice(r,i);if(!u.test(a))return!0}return!1},fe.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;D.lastIndex=this.pos;var e,t=D.exec(this.input),r=this.pos+t[0].length;return!(S.test(this.input.slice(this.pos,r))||"function"!==this.input.slice(r,r+8)||r+8!==this.input.length&&(h(e=this.input.charCodeAt(r+8))||e>55295&&e<56320))},fe.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;D.lastIndex=this.pos;var r=D.exec(this.input),n=this.pos+r[0].length;if(S.test(this.input.slice(this.pos,n)))return!1;if(e){var i,a=n+5;if("using"!==this.input.slice(n,a)||a===this.input.length||h(i=this.input.charCodeAt(a))||i>55295&&i<56320)return!1;D.lastIndex=a;var o=D.exec(this.input);if(o&&S.test(this.input.slice(a,a+o[0].length)))return!1}if(t){var s,u=n+2;if(!("of"!==this.input.slice(n,u)||u!==this.input.length&&(h(s=this.input.charCodeAt(u))||s>55295&&s<56320)))return!1}var l=this.input.charCodeAt(n);return f(l,!0)||92===l},fe.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},fe.isUsing=function(e){return this.isUsingKeyword(!1,e)},fe.parseStatement=function(e,t,r){var n,i=this.type,a=this.startNode();switch(this.isLet(e)&&(i=x._var,n="let"),i){case x._break:case x._continue:return this.parseBreakContinueStatement(a,i.keyword);case x._debugger:return this.parseDebuggerStatement(a);case x._do:return this.parseDoStatement(a);case x._for:return this.parseForStatement(a);case x._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case x._class:return e&&this.unexpected(),this.parseClass(a,!0);case x._if:return this.parseIfStatement(a);case x._return:return this.parseReturnStatement(a);case x._switch:return this.parseSwitchStatement(a);case x._throw:return this.parseThrowStatement(a);case x._try:return this.parseTryStatement(a);case x._const:case x._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(a,n);case x._while:return this.parseWhileStatement(a);case x._with:return this.parseWithStatement(a);case x.braceL:return this.parseBlock(!0,a);case x.semi:return this.parseEmptyStatement(a);case x._export:case x._import:if(this.options.ecmaVersion>10&&i===x._import){D.lastIndex=this.pos;var o=D.exec(this.input),s=this.pos+o[0].length,u=this.input.charCodeAt(s);if(40===u||46===u)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===x._import?this.parseImport(a):this.parseExport(a,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var l=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(l)return t&&"script"===this.options.sourceType&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),"await using"===l&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(a,!1,l),this.semicolon(),this.finishNode(a,"VariableDeclaration");var c=this.value,p=this.parseExpression();return i===x.name&&"Identifier"===p.type&&this.eat(x.colon)?this.parseLabeledStatement(a,c,p,e):this.parseExpressionStatement(a,p)}},fe.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.eat(x.semi)||this.insertSemicolon()?e.label=null:this.type!==x.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(x.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},fe.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(he),this.enterScope(0),this.expect(x.parenL),this.type===x.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===x._var||this.type===x._const||r){var n=this.startNode(),i=r?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var a=this.isContextual("let"),o=!1,s=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(s){var u=this.startNode();return this.next(),"await using"===s&&this.next(),this.parseVar(u,!0,s),this.finishNode(u,"VariableDeclaration"),this.parseForAfterInit(e,u,t)}var l=this.containsEsc,c=new pe,p=this.start,f=t>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);return this.type===x._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===x._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start!==p||l||"Identifier"!==f.type||"async"!==f.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),a&&o&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,c),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(c,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},fe.parseForAfterInit=function(e,t,r){return(this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===x._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,t)):(r>-1&&this.unexpected(r),this.parseFor(e,t))},fe.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,ye|(r?0:ge),!1,t)},fe.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(x._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},fe.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(x.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},fe.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(x.braceL),this.labels.push(de),this.enterScope(0);for(var r=!1;this.type!==x.braceR;)if(this.type===x._case||this.type===x._default){var n=this.type===x._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(x.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},fe.parseThrowStatement=function(e){return this.next(),S.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var me=[];fe.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?K:0),this.checkLValPattern(e,t?ae:ne),this.expect(x.parenR),e},fe.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===x._catch){var t=this.startNode();this.next(),this.eat(x.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(x._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},fe.parseVarStatement=function(e,t,r){return this.next(),this.parseVar(e,!1,t,r),this.semicolon(),this.finishNode(e,"VariableDeclaration")},fe.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(he),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},fe.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},fe.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},fe.parseLabeledStatement=function(e,t,r,n){for(var i=0,a=this.labels;i=0;s--){var u=this.labels[s];if(u.statementStart!==e.start)break;u.statementStart=this.start,u.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},fe.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},fe.parseBlock=function(e,t,r){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(x.braceL),e&&this.enterScope(0);this.type!==x.braceR;){var n=this.parseStatement(null);t.body.push(n)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},fe.parseFor=function(e,t){return e.init=t,this.expect(x.semi),e.test=this.type===x.semi?null:this.parseExpression(),this.expect(x.semi),e.update=this.type===x.parenR?null:this.parseExpression(),this.expect(x.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},fe.parseForIn=function(e,t){var r=this.type===x._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!r||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(x.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")},fe.parseVar=function(e,t,r,n){for(e.declarations=[],e.kind=r;;){var i=this.startNode();if(this.parseVarId(i,r),this.eat(x.eq)?i.init=this.parseMaybeAssign(t):n||"const"!==r||this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual("of")?n||"using"!==r&&"await using"!==r||!(this.options.ecmaVersion>=17)||this.type===x._in||this.isContextual("of")?n||"Identifier"===i.id.type||t&&(this.type===x._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+r+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(x.comma))break}return e},fe.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?re:ne,!1)};var ye=1,ge=2,ve=4;function be(e,t){var r=t.key.name,n=e[r],i="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(i=(t.static?"s":"i")+t.kind),"iget"===n&&"iset"===i||"iset"===n&&"iget"===i||"sget"===n&&"sset"===i||"sset"===n&&"sget"===i?(e[r]="true",!1):!!n||(e[r]=i,!1)}function xe(e,t){var r=e.computed,n=e.key;return!r&&("Identifier"===n.type&&n.name===t||"Literal"===n.type&&n.value===t)}fe.parseFunction=function(e,t,r,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===x.star&&t&ge&&this.unexpected(),e.generator=this.eat(x.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&ye&&(e.id=t&ve&&this.type!==x.name?null:this.parseIdent(),!e.id||t&ge||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?re:ne:ie));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ee(e.async,e.generator)),t&ye||(e.id=this.type===x.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&ye?"FunctionDeclaration":"FunctionExpression")},fe.parseFunctionParams=function(e){this.expect(x.parenL),e.params=this.parseBindingList(x.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},fe.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(x.braceL);this.type!==x.braceR;){var o=this.parseClassElement(null!==e.superClass);o&&(i.body.push(o),"MethodDefinition"===o.type&&"constructor"===o.kind?(a&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),a=!0):o.key&&"PrivateIdentifier"===o.key.type&&be(n,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=r,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},fe.parseClassElement=function(e){if(this.eat(x.semi))return null;var t=this.options.ecmaVersion,r=this.startNode(),n="",i=!1,a=!1,o="method",s=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(x.braceL))return this.parseClassStaticBlock(r),r;this.isClassElementNameStart()||this.type===x.star?s=!0:n="static"}if(r.static=s,!n&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==x.star||this.canInsertSemicolon()?n="async":a=!0),!n&&(t>=9||!a)&&this.eat(x.star)&&(i=!0),!n&&!a&&!i){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=u:n=u)}if(n?(r.computed=!1,r.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),r.key.name=n,this.finishNode(r.key,"Identifier")):this.parseClassElementName(r),t<13||this.type===x.parenL||"method"!==o||i||a){var l=!r.static&&xe(r,"constructor"),c=l&&e;l&&"method"!==o&&this.raise(r.key.start,"Constructor can't have get/set modifier"),r.kind=l?"constructor":o,this.parseClassMethod(r,i,a,c)}else this.parseClassField(r);return r},fe.isClassElementNameStart=function(){return this.type===x.name||this.type===x.privateId||this.type===x.num||this.type===x.string||this.type===x.bracketL||this.type.keyword},fe.parseClassElementName=function(e){this.type===x.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},fe.parseClassMethod=function(e,t,r,n){var i=e.key;"constructor"===e.kind?(t&&this.raise(i.start,"Constructor can't be a generator"),r&&this.raise(i.start,"Constructor can't be an async method")):e.static&&xe(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,r,n);return"get"===e.kind&&0!==a.params.length&&this.raiseRecoverable(a.start,"getter should have no params"),"set"===e.kind&&1!==a.params.length&&this.raiseRecoverable(a.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===a.params[0].type&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},fe.parseClassField=function(e){return xe(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&xe(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(x.eq)?(this.enterScope(Z|H),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},fe.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Y|H);this.type!==x.braceR;){var r=this.parseStatement(null);e.body.push(r)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},fe.parseClassId=function(e,t){this.type===x.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ne,!1)):(!0===t&&this.unexpected(),e.id=null)},fe.parseClassSuper=function(e){e.superClass=this.eat(x._extends)?this.parseExprSubscripts(null,!1):null},fe.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},fe.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,r=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=0===n?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},fe.parseExport=function(e,t){if(this.next(),this.eat(x.star))return this.parseExportAllDeclaration(e,t);if(this.eat(x._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var r=0,n=e.specifiers;r=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},fe.parseExportDeclaration=function(e){return this.parseStatement(null)},fe.parseExportDefaultDeclaration=function(){var e;if(this.type===x._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ye|ve,!1,e)}if(this.type===x._class){var r=this.startNode();return this.parseClass(r,"nullableID")}var n=this.parseMaybeAssign();return this.semicolon(),n},fe.checkExport=function(e,t,r){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),P(e,t)&&this.raiseRecoverable(r,"Duplicate export '"+t+"'"),e[t]=!0)},fe.checkPatternExport=function(e,t){var r=t.type;if("Identifier"===r)this.checkExport(e,t,t.start);else if("ObjectPattern"===r)for(var n=0,i=t.properties;n=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},fe.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ne),this.finishNode(e,"ImportSpecifier")},fe.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ne),this.finishNode(e,"ImportDefaultSpecifier")},fe.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ne),this.finishNode(e,"ImportNamespaceSpecifier")},fe.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===x.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(x.comma)))return e;if(this.type===x.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(x.braceL);!this.eat(x.braceR);){if(t)t=!1;else if(this.expect(x.comma),this.afterTrailingComma(x.braceR))break;e.push(this.parseImportSpecifier())}return e},fe.parseWithClause=function(){var e=[];if(!this.eat(x._with))return e;this.expect(x.braceL);for(var t={},r=!0;!this.eat(x.braceR);){if(r)r=!1;else if(this.expect(x.comma),this.afterTrailingComma(x.braceR))break;var n=this.parseImportAttribute(),i="Identifier"===n.key.type?n.key.name:n.key.value;P(t,i)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+i+"'"),t[i]=!0,e.push(n)}return e},fe.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===x.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(x.colon),this.type!==x.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},fe.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===x.string){var e=this.parseLiteral(this.value);return N.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},fe.adaptDirectivePrologue=function(e){for(var t=0;t=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var Se=se.prototype;Se.toAssignable=function(e,t,r){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=e.properties;n=8&&!s&&"async"===u.name&&!this.canInsertSemicolon()&&this.eat(x._function))return this.overrideContext(_e.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(x.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[u],!1,t);if(this.options.ecmaVersion>=8&&"async"===u.name&&this.type===x.name&&!s&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return u=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(x.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[u],!0,t)}return u;case x.regexp:var l=this.value;return(n=this.parseLiteral(l.value)).regex={pattern:l.pattern,flags:l.flags},n;case x.num:case x.string:return this.parseLiteral(this.value);case x._null:case x._true:case x._false:return(n=this.startNode()).value=this.type===x._null?null:this.type===x._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case x.parenL:var c=this.start,p=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),p;case x.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(x.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case x.braceL:return this.overrideContext(_e.b_expr),this.parseObj(!1,e);case x._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case x._class:return this.parseClass(this.startNode(),!1);case x._new:return this.parseNew();case x.backQuote:return this.parseTemplate();case x._import:return this.options.ecmaVersion>=11?this.parseExprImport(r):this.unexpected();default:return this.parseExprAtomDefault()}},Ae.parseExprAtomDefault=function(){this.unexpected()},Ae.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===x.parenL&&!e)return this.parseDynamicImport(t);if(this.type===x.dot){var r=this.startNodeAt(t.start,t.loc&&t.loc.start);return r.name="import",t.meta=this.finishNode(r,"Identifier"),this.parseImportMeta(t)}this.unexpected()},Ae.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(x.parenR)?e.options=null:(this.expect(x.comma),this.afterTrailingComma(x.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(x.parenR)||(this.expect(x.comma),this.afterTrailingComma(x.parenR)||this.unexpected())));else if(!this.eat(x.parenR)){var t=this.start;this.eat(x.comma)&&this.eat(x.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},Ae.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},Ae.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},Ae.parseParenExpression=function(){this.expect(x.parenL);var e=this.parseExpression();return this.expect(x.parenR),e},Ae.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Ae.parseParenAndDistinguishExpression=function(e,t){var r,n=this.start,i=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,s=this.start,u=this.startLoc,l=[],c=!0,p=!1,f=new pe,h=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==x.parenR;){if(c?c=!1:this.expect(x.comma),a&&this.afterTrailingComma(x.parenR,!0)){p=!0;break}if(this.type===x.ellipsis){o=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===x.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}l.push(this.parseMaybeAssign(!1,f,this.parseParenItem))}var m=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(x.parenR),e&&this.shouldParseArrow(l)&&this.eat(x.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=d,this.parseParenArrowList(n,i,l,t);l.length&&!p||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(f,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=d||this.awaitPos,l.length>1?((r=this.startNodeAt(s,u)).expressions=l,this.finishNodeAt(r,"SequenceExpression",m,y)):r=l[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,i);return g.expression=r,this.finishNode(g,"ParenthesizedExpression")}return r},Ae.parseParenItem=function(e){return e},Ae.parseParenArrowList=function(e,t,r,n){return this.parseArrowExpression(this.startNodeAt(e,t),r,!1,n)};var Ce=[];Ae.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===x.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(x.parenL)?e.arguments=this.parseExprList(x.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ce,this.finishNode(e,"NewExpression")},Ae.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===x.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),r.tail=this.type===x.backQuote,this.finishNode(r,"TemplateElement")},Ae.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(r.quasis=[n];!n.tail;)this.type===x.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(x.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(x.braceR),r.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")},Ae.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===x.name||this.type===x.num||this.type===x.string||this.type===x.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===x.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},Ae.parseObj=function(e,t){var r=this.startNode(),n=!0,i={};for(r.properties=[],this.next();!this.eat(x.braceR);){if(n)n=!1;else if(this.expect(x.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(x.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),r.properties.push(a)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},Ae.parseProperty=function(e,t){var r,n,i,a,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(x.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===x.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(o.argument=this.parseMaybeAssign(!1,t),this.type===x.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,a=this.startLoc),e||(r=this.eat(x.star)));var s=this.containsEsc;return this.parsePropertyName(o),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(o)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(x.star),this.parsePropertyName(o)):n=!1,this.parsePropertyValue(o,e,r,n,i,a,t,s),this.finishNode(o,"Property")},Ae.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var r="get"===e.kind?0:1;if(e.value.params.length!==r){var n=e.value.start;"get"===e.kind?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},Ae.parsePropertyValue=function(e,t,r,n,i,a,o,s){(r||n)&&this.type===x.colon&&this.unexpected(),this.eat(x.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===x.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(r,n),e.kind="init"):t||s||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===x.comma||this.type===x.braceR||this.type===x.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((r||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===x.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((r||n)&&this.unexpected(),this.parseGetterSetter(e))},Ae.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(x.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(x.bracketR),e.key;e.computed=!1}return e.key=this.type===x.num||this.type===x.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Ae.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Ae.parseMethod=function(e,t,r){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ee(t,n.generator)|H|(r?$:0)),this.expect(x.parenL),n.params=this.parseBindingList(x.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(n,"FunctionExpression")},Ae.parseArrowExpression=function(e,t,r,n){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(ee(r,!1)|G),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")},Ae.parseFunctionBody=function(e,t,r,n){var i=t&&this.type!==x.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);a&&!s||(o=this.strictDirective(this.end))&&s&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var u=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,oe),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()},Ae.isSimpleParamList=function(e){for(var t=0,r=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&W&&delete this.undefinedExports[e]}else if(t===ae)this.currentScope().lexical.push(e);else if(t===ie){var a=this.currentScope();n=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&K&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){n=!0;break}if(s.var.push(e),this.inModule&&s.flags&W&&delete this.undefinedExports[e],s.flags&Q)break}n&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")},Pe.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},Pe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Pe.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Q|Z|Y))return t}},Pe.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Q|Z|Y)&&!(t.flags&G))return t}};var je=function(e,t,r){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new B(e,r)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Fe=se.prototype;function Ie(e,t,r,n){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=r),e}Fe.startNode=function(){return new je(this,this.start,this.startLoc)},Fe.startNodeAt=function(e,t){return new je(this,e,t)},Fe.finishNode=function(e,t){return Ie.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Fe.finishNodeAt=function(e,t,r,n){return Ie.call(this,e,t,r,n)},Fe.copyNode=function(e){var t=new je(this,e.start,this.startLoc);for(var r in e)t[r]=e[r];return t};var Ne="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Me=Ne+" Extended_Pictographic",Be=Me+" EBase EComp EMod EPres ExtPict",Re={9:Ne,10:Me,11:Me,12:Be,13:Be,14:Be},Le={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Ve="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ue="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ze=Ue+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",We=ze+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Je=We+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",qe=Je+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Xe={9:Ue,10:ze,11:We,12:Je,13:qe,14:qe+" Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz"},Ge={};function Ke(e){var t=Ge[e]={binary:F(Re[e]+" "+Ve),binaryOfStrings:F(Le[e]),nonBinary:{General_Category:F(Ve),Script:F(Xe[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var He=0,$e=[9,10,11,12,13,14];He<$e.length;He+=1)Ke($e[He]);var Ye=se.prototype,Ze=function(e,t){this.parent=e,this.base=t||this};Ze.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var r=e;r;r=r.parent)if(t.base===r.base&&t!==r)return!0;return!1},Ze.prototype.sibling=function(){return new Ze(this.parent,this.base)};var Qe=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ge[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function et(e){for(var t in e)return!0;return!1}function tt(e){return 105===e||109===e||115===e}function rt(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function nt(e){return f(e,!0)||36===e||95===e}function it(e){return h(e,!0)||36===e||95===e||8204===e||8205===e}function at(e){return e>=65&&e<=90||e>=97&&e<=122}function ot(e){return e>=0&&e<=1114111}Qe.prototype.reset=function(e,t,r){var n=-1!==r.indexOf("v"),i=-1!==r.indexOf("u");this.start=0|e,this.source=t+"",this.flags=r,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},Qe.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Qe.prototype.at=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return-1;var i=r.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var a=r.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},Qe.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return n;var i,a=r.charCodeAt(e);return!t&&!this.switchU||a<=55295||a>=57344||e+1>=n||(i=r.charCodeAt(e+1))<56320||i>57343?e+1:e+2},Qe.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Qe.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Qe.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Qe.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Qe.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var r=this.pos,n=0,i=e;n-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===o&&(n=!0),"v"===o&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")},Ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&et(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Ye.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t=16;for(t&&(e.branchID=new Ze(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Ye.regexp_alternative=function(e){for(;e.pos=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1},Ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Ye.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i=16){var r=this.regexp_eatModifiers(e),n=e.eat(45);if(r||n){for(var i=0;i-1&&e.raise("Duplicate regular expression modifiers")}if(n){var o=this.regexp_eatModifiers(e);r||o||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var s=0;s-1||r.indexOf(u)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Ye.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Ye.regexp_eatModifiers=function(e){for(var t="",r=0;-1!==(r=e.current())&&tt(r);)t+=I(r),e.advance();return t},Ye.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!rt(t)&&(e.lastIntValue=t,e.advance(),!0)},Ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;-1!==(r=e.current())&&!rt(r);)e.advance();return e.pos!==t},Ye.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},Ye.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,r=e.groupNames[e.lastStringValue];if(r)if(t)for(var n=0,i=r;n=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),nt(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Ye.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),it(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Ye.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Ye.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},Ye.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Ye.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Ye.regexp_eatZero=function(e){return 48===e.current()&&!yt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Ye.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Ye.regexp_eatControlLetter=function(e){var t=e.current();return!!at(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Ye.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var r=e.pos,n=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(i-55296)+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&ot(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=r}return!1},Ye.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},Ye.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};var st=0,ut=1,lt=2;function ct(e){return 100===e||68===e||115===e||83===e||119===e||87===e}function pt(e){return at(e)||95===e}function ft(e){return pt(e)||yt(e)}function ht(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}function dt(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}function mt(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}function yt(e){return e>=48&&e<=57}function gt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function vt(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function bt(e){return e>=48&&e<=55}Ye.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(ct(t))return e.lastIntValue=-1,e.advance(),ut;var r=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((r=80===t)||112===t)){var n;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return r&&n===lt&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return st},Ye.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),ut}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return st},Ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){P(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},Ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?ut:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?lt:void e.raise("Invalid property name")},Ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";pt(t=e.current());)e.lastStringValue+=I(t),e.advance();return""!==e.lastStringValue},Ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ft(t=e.current());)e.lastStringValue+=I(t),e.advance();return""!==e.lastStringValue},Ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Ye.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),r=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&r===lt&&e.raise("Negated character class may contain strings"),!0}return!1},Ye.regexp_classContents=function(e){return 93===e.current()?ut:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ut)},Ye.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;!e.switchU||-1!==t&&-1!==r||e.raise("Invalid character class"),-1!==t&&-1!==r&&t>r&&e.raise("Range out of order in character class")}}},Ye.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(99===r||bt(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},Ye.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Ye.regexp_classSetExpression=function(e){var t,r=ut;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){t===lt&&(r=lt);for(var n=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?t!==lt&&(r=ut):e.raise("Invalid character in character class");if(n!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return r;t===lt&&(r=lt)}},Ye.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return-1!==r&&-1!==n&&r>n&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Ye.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ut:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Ye.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var r=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return r&&n===lt&&e.raise("Negated character class may contain strings"),n;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Ye.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var r=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return r}else e.raise("Invalid escape");e.pos=t}return null},Ye.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===lt&&(t=lt);return t},Ye.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?ut:lt},Ye.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e)&&(e.eat(98)?(e.lastIntValue=8,0):(e.pos=t,1)));var r=e.current();return!(r<0||r===e.lookahead()&&ht(r)||dt(r)||(e.advance(),e.lastIntValue=r,0))},Ye.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!mt(t)&&(e.lastIntValue=t,e.advance(),!0)},Ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!yt(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},Ye.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Ye.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;yt(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t},Ye.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;gt(r=e.current());)e.lastIntValue=16*e.lastIntValue+vt(r),e.advance();return e.pos!==t},Ye.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*r+e.lastIntValue:e.lastIntValue=8*t+r}else e.lastIntValue=t;return!0}return!1},Ye.regexp_eatOctalDigit=function(e){var t=e.current();return bt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Ye.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var n=0;n=this.input.length?this.finishToken(x.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},St.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},St.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},St.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(var n=void 0,i=t;(n=w(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,r),t,this.pos,e,this.curPosition())},St.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},St.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)},St.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(x.ellipsis)):(++this.pos,this.finishToken(x.dot))},St.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(x.assign,2):this.finishOp(x.slash,1)},St.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,n=42===e?x.star:x.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++r,n=x.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(x.assign,r+1):this.finishOp(n,r)},St.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(x.assign,3):this.finishOp(124===e?x.logicalOR:x.logicalAND,2):61===t?this.finishOp(x.assign,2):this.finishOp(124===e?x.bitwiseOR:x.bitwiseAND,1)},St.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(x.assign,2):this.finishOp(x.bitwiseXOR,1)},St.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(x.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(x.assign,2):this.finishOp(x.plusMin,1)},St.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+r)?this.finishOp(x.assign,r+1):this.finishOp(x.bitShift,r)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(r=2),this.finishOp(x.relational,r)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},St.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(x.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(x.arrow)):this.finishOp(61===e?x.eq:x.prefix,1)},St.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(x.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(x.assign,3):this.finishOp(x.coalesce,2)}return this.finishOp(x.question,1)},St.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,f(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(x.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+I(e)+"'")},St.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(x.parenL);case 41:return++this.pos,this.finishToken(x.parenR);case 59:return++this.pos,this.finishToken(x.semi);case 44:return++this.pos,this.finishToken(x.comma);case 91:return++this.pos,this.finishToken(x.bracketL);case 93:return++this.pos,this.finishToken(x.bracketR);case 123:return++this.pos,this.finishToken(x.braceL);case 125:return++this.pos,this.finishToken(x.braceR);case 58:return++this.pos,this.finishToken(x.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(x.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(x.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+I(e)+"'")},St.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)},St.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(S.test(n)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||(this.regexpState=new Qe(this));s.reset(r,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var u=null;try{u=new RegExp(i,o)}catch(e){}return this.finishToken(x.regexp,{pattern:i,flags:o,value:u})},St.readInt=function(e,t,r){for(var n=this.options.ecmaVersion>=12&&void 0===t,i=r&&48===this.input.charCodeAt(this.pos),a=this.pos,o=0,s=0,u=0,l=null==t?1/0:t;u=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=e)break;s=c,o=o*e+p}}return n&&95===s&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||null!=t&&this.pos-a!==t?null:o},St.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return null==r&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(r=_t(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(x.num,r)},St.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var r=this.pos-t>=2&&48===this.input.charCodeAt(t);r&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&110===n){var i=_t(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(x.num,i)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),46!==n||r||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||r||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=Et(this.input.slice(t,this.pos),r);return this.finishToken(x.num,a)},St.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},St.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):8232===n||8233===n?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(_(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(x.string,t)};var wt={};St.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==wt)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},St.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw wt;this.raise(e,t)},St.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==x.template&&this.type!==x.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(x.template,e)):36===r?(this.pos+=2,this.finishToken(x.dollarBraceL)):(++this.pos,this.finishToken(x.backQuote));if(92===r)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(_(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},St.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return _(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},St.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return null===r&&this.invalidStringToken(t,"Bad character escape sequence"),r},St.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},48912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(44480);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r{"use strict";var n=r(47244),i=r(48184),a=r(25767),o=r(35680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,c=s(Object.prototype.toString),p=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(u)var d=s(BigInt.prototype.valueOf);if(l)var m=s(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===c(e)}function v(e){return"[object Set]"===c(e)}function b(e){return"[object WeakMap]"===c(e)}function x(e){return"[object WeakSet]"===c(e)}function S(e){return"[object ArrayBuffer]"===c(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===c(e)}function w(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=o,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||w(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},x.working="undefined"!=typeof WeakSet&&x(new WeakSet),t.isWeakSet=function(e){return x(e)},S.working="undefined"!=typeof ArrayBuffer&&S(new ArrayBuffer),t.isArrayBuffer=E,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function D(e){return"[object SharedArrayBuffer]"===c(e)}function k(e){return void 0!==A&&(void 0===D.working&&(D.working=D(new A)),D.working?D(e):e instanceof A)}function C(e){return y(e,p)}function T(e){return y(e,f)}function P(e){return y(e,h)}function O(e){return u&&y(e,d)}function j(e){return l&&y(e,m)}t.isSharedArrayBuffer=k,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},t.isGeneratorObject=function(e){return"[object Generator]"===c(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},t.isNumberObject=C,t.isStringObject=T,t.isBooleanObject=P,t.isBigIntObject=O,t.isSymbolObject=j,t.isBoxedPrimitive=function(e){return C(e)||T(e)||P(e)||O(e)||j(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||k(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},49092:(e,t,r)=>{"use strict";var n=r(41333);e.exports=function(){return n()&&!!Symbol.toStringTag}},49224:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.flatMap)(function(e){return e.comments||[]},e)};var n=r(44480)},49583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=a(e),r=t.className,n=t.methods,u=!1;if(!r){var l=o(e);r=l.className,n=l.methods,u=!0}if(r)return n.map(function(e){var t=s(e),n=t.methodName,a=t.properties;return{className:r,methodName:n,methodNode:e,descriptors:a.filter(i.isAccessorDescriptor).map(function(e){return{propertyNode:e,methodNode:e.value,kind:e.key.name}}),static:u}})},t.matchDefinedProperties=void 0;var n=r(25065),i=r(67011),a=(0,n.matches)({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"}},arguments:[{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:(0,n.extractAny)("className")},property:{type:"Identifier",name:"prototype"}},{type:"ObjectExpression",properties:(0,n.extractAny)("methods")}]}}),o=(0,n.matches)({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"}},arguments:[{type:"Identifier",name:(0,n.extractAny)("className")},{type:"ObjectExpression",properties:(0,n.extractAny)("methods")}]}}),s=(0,n.matches)({type:"Property",key:{type:"Identifier",name:(0,n.extractAny)("methodName")},computed:!1,value:{type:"ObjectExpression",properties:(0,n.extractAny)("properties")}});t.matchDefinedProperties=s},50236:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"Literal"===e.type&&"string"==typeof e.value}},51072:(e,t)=>{t.$E="\n"},51329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.parent,r=e.node,n=e.replacements,o=e.preserveComments,s=function(e){switch(e.type){case"BlockStatement":case"Program":return e.body;case"SwitchCase":return e.consequent;case"ObjectExpression":return e.properties;default:throw"Unsupported node type '".concat(e.type,"' in multiReplaceStatement()")}}(t),u=s.indexOf(r);o&&n[0]&&(0,i.default)({from:r,to:n[0]});-1!==u&&s.splice.apply(s,[u,1].concat(function(e){if(Array.isArray(e))return a(e)}(l=n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));var l};var n,i=(n=r(99650))&&n.__esModule?n:{default:n};function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;var n=r(31635),i=n.__importDefault(r(17676)),a=n.__importStar(r(41434)),o=a.builders,s=a.builtInTypes.object,u=a.builtInTypes.array,l=r(47289),c=r(1688),p=r(9773),f=n.__importStar(r(64147));t.parse=function(e,t){t=(0,l.normalize)(t);var n,i,a=(0,c.fromString)(e,t),s=a.toString({tabWidth:t.tabWidth,reuseWhitespace:!1,useTabs:!1}),u=[],d=t.parser.parse(s,{jsx:!0,loc:!0,locations:!0,range:t.range,comment:!0,onComment:u,tolerant:f.getOption(t,"tolerant",!0),ecmaVersion:6,sourceType:f.getOption(t,"sourceType","module")}),m=Array.isArray(d.tokens)?d.tokens:r(11206).tokenize(s,{loc:!0});delete d.tokens,m.forEach(function(e){"string"!=typeof e.value&&(e.value=a.sliceString(e.loc.start,e.loc.end))}),Array.isArray(d.comments)&&(u=d.comments,delete d.comments),d.loc?f.fixFaultyLocations(d,a):d.loc={start:a.firstPos(),end:a.lastPos()},d.loc.lines=a,d.loc.indent=0,"Program"===d.type?(i=d,(n=o.file(d,t.sourceFileName||null)).loc={start:a.firstPos(),end:a.lastPos(),lines:a,indent:0}):"File"===d.type&&(i=(n=d).program),t.tokens&&(n.tokens=m);var y=f.getTrueLoc({type:i.type,loc:i.loc,body:[],comments:u},a);return i.loc.start=y.start,i.loc.end=y.end,(0,p.attach)(u,i.body.length?n.program:n,a),new h(a,m).copy(n)};var h=function e(t,r){(0,i.default)(this instanceof e),this.lines=t,this.tokens=r,this.startTokenIndex=0,this.endTokenIndex=r.length,this.indent=0,this.seen=new Map},d=h.prototype;d.copy=function(e){if(this.seen.has(e))return this.seen.get(e);if(u.check(e)){var t=new Array(e.length);return this.seen.set(e,t),e.forEach(function(e,r){t[r]=this.copy(e)},this),t}if(!s.check(e))return e;f.fixFaultyLocations(e,this.lines);var r=Object.create(Object.getPrototypeOf(e),{original:{value:e,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(e,r);var n=e.loc,i=this.indent,a=i,o=this.startTokenIndex,l=this.endTokenIndex;n&&(("Block"===e.type||"Line"===e.type||"CommentBlock"===e.type||"CommentLine"===e.type||this.lines.isPrecededOnlyByWhitespace(n.start))&&(a=this.indent=n.start.column),n.lines=this.lines,n.tokens=this.tokens,n.indent=a,this.findTokenRange(n));for(var c=Object.keys(e),p=c.length,h=0;h0;){var t=e.tokens[this.startTokenIndex];if(!(f.comparePos(e.start,t.loc.start)<0))break;--this.startTokenIndex}for(;this.endTokenIndexthis.startTokenIndex;){t=e.tokens[this.endTokenIndex-1];if(!(f.comparePos(e.end,t.loc.end)<0))break;--this.endTokenIndex}e.end.token=this.endTokenIndex}},51720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(25065),a=(n=r(23584))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"MemberExpression",computed:!1,object:{type:"Identifier",name:"module"},property:a.default});t.default=o},51775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){n.default.replace(e,{enter:function(e,r){var n,l,h;return(n=(0,i.default)(e))?"Program"!==r.type?void t.warn(e,"export can only be at root level","commonjs"):(l=n,h=e.comments,{type:"ExportDefaultDeclaration",declaration:l.value,comments:h}):(n=(0,a.default)(e))?"Program"!==r.type?void t.warn(e,"export can only be at root level","commonjs"):function(e,t){var r=e.id,n=e.value;if((0,o.isFunctionExpression)(n)){if(c(r,n.id))return new s.default({declaration:p(n,r),comments:t})}else{if("ClassExpression"!==n.type)return"Identifier"===n.type?new s.default({specifiers:[{type:"ExportSpecifier",exported:r,local:n}],comments:t}):new s.default({declaration:new u.default("var",[{type:"VariableDeclarator",id:r,init:n}]),comments:t});if(c(r,n.id))return new s.default({declaration:f(n,r),comments:t})}}(n,e.comments):void 0}})};var n=l(r(88543)),i=l(r(87675)),a=l(r(20227)),o=r(57249),s=l(r(98054)),u=l(r(97587));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){return!e||!t||e.name===t.name}function p(e,t){return e.type="FunctionDeclaration",e.id=t,"BlockStatement"!==e.body.type&&(e.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:e.body}]}),e}function f(e,t){return e.type="ClassDeclaration",e.id=t,e}},51851:(e,t,r)=>{!function(){"use strict";var e=r(63437);function n(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function i(t,r){return(t===e.Syntax.ObjectExpression||t===e.Syntax.ObjectPattern)&&"properties"===r}function a(t,r){r=r||{},this.__visitor=t||this,this.__childVisitorKeys=r.childVisitorKeys?Object.assign({},e.VisitorKeys,r.childVisitorKeys):e.VisitorKeys,"iteration"===r.fallback?this.__fallback=Object.keys:"function"==typeof r.fallback&&(this.__fallback=r.fallback)}a.prototype.visitChildren=function(t){var r,a,o,s,u,l,c;if(null!=t){if(r=t.type||e.Syntax.Property,!(a=this.__childVisitorKeys[r])){if(!this.__fallback)throw new Error("Unknown node type "+r+".");a=this.__fallback(t)}for(o=0,s=a.length;o{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(33843)),a=n.__importDefault(r(19616)),o=n.__importDefault(r(35302)),s=n.__importStar(r(64522));t.default=function(e){e.use(i.default),e.use(a.default);var t=e.use(o.default),r=t.namedTypes,n=t.Type.def,u=t.Type.or,l=e.use(s.default).defaults,c=t.Type.from(function(e,t){return!(!r.StringLiteral||!r.StringLiteral.check(e,t))||!(!r.Literal||!r.Literal.check(e,t)||"string"!=typeof e.value)},"StringLiteral");n("TSType").bases("Node");var p=u(n("Identifier"),n("TSQualifiedName"));n("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",p),n("TSHasOptionalTypeParameterInstantiation").field("typeParameters",u(n("TSTypeParameterInstantiation"),null),l.null),n("TSHasOptionalTypeParameters").field("typeParameters",u(n("TSTypeParameterDeclaration"),null,void 0),l.null),n("TSHasOptionalTypeAnnotation").field("typeAnnotation",u(n("TSTypeAnnotation"),null),l.null),n("TSQualifiedName").bases("Node").build("left","right").field("left",p).field("right",p),n("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")).field("extra",u({parenthesized:Boolean},null),l.null),n("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")),n("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")),n("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",n("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(function(e){n(e).bases("TSType").build()}),n("TSArrayType").bases("TSType").build("elementType").field("elementType",n("TSType")),n("TSLiteralType").bases("TSType").build("literal").field("literal",u(n("NumericLiteral"),n("StringLiteral"),n("BooleanLiteral"),n("TemplateLiteral"),n("UnaryExpression"),n("BigIntLiteral"))),n("TemplateLiteral").field("expressions",u([n("Expression")],[n("TSType")])),["TSUnionType","TSIntersectionType"].forEach(function(e){n(e).bases("TSType").build("types").field("types",[n("TSType")])}),n("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",n("TSType")).field("extendsType",n("TSType")).field("trueType",n("TSType")).field("falseType",n("TSType")),n("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",n("TSTypeParameter")),n("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType"));var f=[u(n("Identifier"),n("RestElement"),n("ArrayPattern"),n("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(function(e){n(e).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",f)}),n("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,l.false).field("async",Boolean,l.false).field("generator",Boolean,l.false).field("id",u(n("Identifier"),null),l.null).field("params",[n("Pattern")]).field("returnType",u(n("TSTypeAnnotation"),n("Noop"),null),l.null),n("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,l.false).field("generator",Boolean,l.false).field("params",[n("Pattern")]).field("abstract",Boolean,l.false).field("accessibility",u("public","private","protected",void 0),l[void 0]).field("static",Boolean,l.false).field("computed",Boolean,l.false).field("optional",Boolean,l.false).field("key",u(n("Identifier"),n("StringLiteral"),n("NumericLiteral"),n("Expression"))).field("kind",u("get","set","method","constructor"),function(){return"method"}).field("access",u("public","private","protected",void 0),l[void 0]).field("decorators",u([n("Decorator")],null),l.null).field("returnType",u(n("TSTypeAnnotation"),n("Noop"),null),l.null),n("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",u(Boolean,"+","-"),l.false).field("typeParameter",n("TSTypeParameter")).field("optional",u(Boolean,"+","-"),l.false).field("typeAnnotation",u(n("TSType"),null),l.null),n("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[u(n("TSType"),n("TSNamedTupleMember"))]),n("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",n("Identifier")).field("optional",Boolean,l.false).field("elementType",n("TSType")),n("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType")),n("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType")),n("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",n("TSType")).field("indexType",n("TSType")),n("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",n("TSType")),n("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",u(n("TSType"),n("TSTypeAnnotation"))),n("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[n("Identifier")]).field("readonly",Boolean,l.false),n("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",n("Expression")).field("computed",Boolean,l.false).field("readonly",Boolean,l.false).field("optional",Boolean,l.false).field("initializer",u(n("Expression"),null),l.null),n("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",n("Expression")).field("computed",Boolean,l.false).field("optional",Boolean,l.false).field("parameters",f),n("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",u(n("Identifier"),n("TSThisType"))).field("typeAnnotation",u(n("TSTypeAnnotation"),null),l.null).field("asserts",Boolean,l.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(function(e){n(e).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",f)}),n("TSEnumMember").bases("Node").build("id","initializer").field("id",u(n("Identifier"),c)).field("initializer",u(n("Expression"),null),l.null),n("TSTypeQuery").bases("TSType").build("exprName").field("exprName",u(p,n("TSImportType")));var h=u(n("TSCallSignatureDeclaration"),n("TSConstructSignatureDeclaration"),n("TSIndexSignature"),n("TSMethodSignature"),n("TSPropertySignature"));n("TSTypeLiteral").bases("TSType").build("members").field("members",[h]),n("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",u(n("Identifier"),String)).field("constraint",u(n("TSType"),void 0),l[void 0]).field("default",u(n("TSType"),void 0),l[void 0]),n("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",n("TSType")).field("expression",n("Expression")).field("extra",u({parenthesized:Boolean},null),l.null),n("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[n("TSTypeParameter")]),n("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",n("Expression")),n("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[n("TSType")]),n("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",n("Identifier")).field("const",Boolean,l.false).field("declare",Boolean,l.false).field("members",[n("TSEnumMember")]).field("initializer",u(n("Expression"),null),l.null),n("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",n("Identifier")).field("declare",Boolean,l.false).field("typeAnnotation",n("TSType")),n("TSModuleBlock").bases("Node").build("body").field("body",[n("Statement")]),n("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",u(c,p)).field("declare",Boolean,l.false).field("global",Boolean,l.false).field("body",u(n("TSModuleBlock"),n("TSModuleDeclaration"),null),l.null),n("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",c).field("qualifier",u(p,void 0),l[void 0]),n("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",n("Identifier")).field("isExport",Boolean,l.false).field("moduleReference",u(p,n("TSExternalModuleReference"))),n("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",c),n("TSExportAssignment").bases("Statement").build("expression").field("expression",n("Expression")),n("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",n("Identifier")),n("TSInterfaceBody").bases("Node").build("body").field("body",[h]),n("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",p),n("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",p).field("declare",Boolean,l.false).field("extends",u([n("TSExpressionWithTypeArguments")],null),l.null).field("body",n("TSInterfaceBody")),n("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",u("public","private","protected",void 0),l[void 0]).field("readonly",Boolean,l.false).field("parameter",u(n("Identifier"),n("AssignmentPattern"))),n("ClassProperty").field("access",u("public","private","protected",void 0),l[void 0]),n("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),n("ClassBody").field("body",[u(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"),n("ClassPrivateProperty"),n("ClassAccessorProperty"),n("ClassMethod"),n("ClassPrivateMethod"),n("StaticBlock"),n("TSDeclareMethod"),h)])},(0,s.maybeSetModuleExports)(function(){return e})},56698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},57035:(e,t,r)=>{t.SourceMapGenerator=r(5471).SourceMapGenerator,t.SourceMapConsumer=r(1280).SourceMapConsumer,t.SourceNode=r(90857).SourceNode},57249:(e,t)=>{"use strict";function r(e){return"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type}function n(e){return"FunctionDeclaration"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return n(e)||r(e)},t.isFunctionDeclaration=n,t.isFunctionExpression=r},57367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(25065),i=(0,n.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",left:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:(0,n.extractAny)("className")},property:{type:"Identifier",name:(0,n.extractAny)("methodName")}},operator:"=",right:(0,n.extract)("methodNode",{type:"FunctionExpression"})}});t.default=i},57480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(48630),i=r(19214),a=r(13734);function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var u=s(n),l=o(i),c=s(a);const p="Boolean",f="Identifier",h="PrivateIdentifier",d="Keyword",m="Null",y="Numeric",g="Punctuator",v="String",b="RegularExpression",x="Template",S="JSXIdentifier",E="JSXText";function _(e,t){this._acornTokTypes=e,this._tokens=[],this._curlyBrace=null,this._code=t}_.prototype={constructor:_,translate(e,t){const r=e.type,n=this._acornTokTypes;if(r===n.name)e.type=f,"static"===e.value&&(e.type=d),t.ecmaVersion>5&&("yield"===e.value||"let"===e.value)&&(e.type=d);else if(r===n.privateId)e.type=h;else if(r===n.semi||r===n.comma||r===n.parenL||r===n.parenR||r===n.braceL||r===n.braceR||r===n.dot||r===n.bracketL||r===n.colon||r===n.question||r===n.bracketR||r===n.ellipsis||r===n.arrow||r===n.jsxTagStart||r===n.incDec||r===n.starstar||r===n.jsxTagEnd||r===n.prefix||r===n.questionDot||r.binop&&!r.keyword||r.isAssign)e.type=g,e.value=this._code.slice(e.start,e.end);else if(r===n.jsxName)e.type=S;else if("jsxText"===r.label||r===n.jsxAttrValueToken)e.type=E;else if(r.keyword)"true"===r.keyword||"false"===r.keyword?e.type=p:"null"===r.keyword?e.type=m:e.type=d;else if(r===n.num)e.type=y,e.value=this._code.slice(e.start,e.end);else if(r===n.string)t.jsxAttrValueToken?(t.jsxAttrValueToken=!1,e.type=E):e.type=v,e.value=this._code.slice(e.start,e.end);else if(r===n.regexp){e.type=b;const t=e.value;e.regex={flags:t.flags,pattern:t.pattern},e.value=`/${t.pattern}/${t.flags}`}return e},onToken(e,t){const r=this._acornTokTypes,n=t.tokens,i=this._tokens,a=()=>{n.push(function(e,t){const r=e[0],n=e[e.length-1],i={type:x,value:t.slice(r.start,n.end)};return r.loc&&(i.loc={start:r.loc.start,end:n.loc.end}),r.range&&(i.start=r.range[0],i.end=n.range[1],i.range=[i.start,i.end]),i}(this._tokens,this._code)),this._tokens=[]};if(e.type!==r.eof){if(e.type===r.backQuote)return this._curlyBrace&&(n.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),i.push(e),void(i.length>1&&a());if(e.type===r.dollarBraceL)return i.push(e),void a();if(e.type===r.braceR)return this._curlyBrace&&n.push(this.translate(this._curlyBrace,t)),void(this._curlyBrace=e);if(e.type===r.template||e.type===r.invalidTemplate)return this._curlyBrace&&(i.push(this._curlyBrace),this._curlyBrace=null),void i.push(e);this._curlyBrace&&(n.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),n.push(this.translate(e,t))}else this._curlyBrace&&n.push(this.translate(this._curlyBrace,t))}};const w=[3,5,6,7,8,9,10,11,12,13,14,15];function A(){return w[w.length-1]}function D(e){const t=function(e=5){let t="latest"===e?A():e;if("number"!=typeof t)throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof e} instead.`);if(t>=2015&&(t-=2009),!w.includes(t))throw new Error("Invalid ecmaVersion.");return t}(e.ecmaVersion),r=function(e="script"){if("script"===e||"module"===e)return e;if("commonjs"===e)return"script";throw new Error("Invalid sourceType.")}(e.sourceType),n=!0===e.range,i=!0===e.loc;if(3!==t&&e.allowReserved)throw new Error("`allowReserved` is only supported when ecmaVersion is 3");if(void 0!==e.allowReserved&&"boolean"!=typeof e.allowReserved)throw new Error("`allowReserved`, when present, must be `true` or `false`");const a=3===t&&(e.allowReserved||"never"),o=e.ecmaFeatures||{},s="commonjs"===e.sourceType||Boolean(o.globalReturn);if("module"===r&&t<6)throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");return Object.assign({},e,{ecmaVersion:t,sourceType:r,ranges:n,locations:i,allowReserved:a,allowReturnOutsideFunction:s})}const k=Symbol("espree's internal state"),C=Symbol("espree's esprimaFinishNode");var T=()=>e=>{const t=Object.assign({},e.acorn.tokTypes);return e.acornJsx&&Object.assign(t,e.acornJsx.tokTypes),class extends e{constructor(e,r){"object"==typeof e&&null!==e||(e={}),"string"==typeof r||r instanceof String||(r=String(r));const n=e.sourceType,i=D(e),a=i.ecmaFeatures||{},o=!0===i.tokens?new _(t,r):null,s={originalSourceType:n||i.sourceType,tokens:o?[]:null,comments:!0===i.comment?[]:null,impliedStrict:!0===a.impliedStrict&&i.ecmaVersion>=5,ecmaVersion:i.ecmaVersion,jsxAttrValueToken:!1,lastToken:null,templateElements:[]};super({ecmaVersion:i.ecmaVersion,sourceType:i.sourceType,ranges:i.ranges,locations:i.locations,allowReserved:i.allowReserved,allowReturnOutsideFunction:i.allowReturnOutsideFunction,onToken(e){o&&o.onToken(e,s),e.type!==t.eof&&(s.lastToken=e)},onComment(e,t,n,i,a,o){if(s.comments){const u=function(e,t,r,n,i,a,o){let s;s=e?"Block":"#!"===o.slice(r,r+2)?"Hashbang":"Line";const u={type:s,value:t};return"number"==typeof r&&(u.start=r,u.end=n,u.range=[r,n]),"object"==typeof i&&(u.loc={start:i,end:a}),u}(e,t,n,i,a,o,r);s.comments.push(u)}}},r),this[k]=s}tokenize(){do{this.next()}while(this.type!==t.eof);this.next();const e=this[k],r=e.tokens;return e.comments&&(r.comments=e.comments),r}finishNode(...e){const t=super.finishNode(...e);return this[C](t)}finishNodeAt(...e){const t=super.finishNodeAt(...e);return this[C](t)}parse(){const e=this[k],t=super.parse();if(t.sourceType=e.originalSourceType,e.comments&&(t.comments=e.comments),e.tokens&&(t.tokens=e.tokens),t.body.length){const[e]=t.body;t.range&&(t.range[0]=e.range[0]),t.loc&&(t.loc.start=e.loc.start),t.start=e.start}return e.lastToken&&(t.range&&(t.range[1]=e.lastToken.range[1]),t.loc&&(t.loc.end=e.lastToken.loc.end),t.end=e.lastToken.end),this[k].templateElements.forEach(e=>{const t=e.tail?1:2;e.start+=-1,e.end+=t,e.range&&(e.range[0]+=-1,e.range[1]+=t),e.loc&&(e.loc.start.column+=-1,e.loc.end.column+=t)}),t}parseTopLevel(e){return this[k].impliedStrict&&(this.strict=!0),super.parseTopLevel(e)}raise(t,r){const n=e.acorn.getLineInfo(this.input,t),i=new SyntaxError(r);throw i.index=t,i.lineNumber=n.line,i.column=n.column+1,i}raiseRecoverable(e,t){this.raise(e,t)}unexpected(e){let t="Unexpected token";if(null!=e){if(this.pos=e,this.options.locations)for(;this.posthis.start&&(t+=` ${this.input.slice(this.start,this.end)}`),this.raise(this.start,t)}jsx_readString(e){const r=super.jsx_readString(e);return this.type===t.string&&(this[k].jsxAttrValueToken=!0),r}[C](e){return"TemplateElement"===e.type&&this[k].templateElements.push(e),e.type.includes("Function")&&!e.generator&&(e.generator=!1),e}}};const P={_regular:null,_jsx:null,get regular(){return null===this._regular&&(this._regular=u.Parser.extend(T())),this._regular},get jsx(){return null===this._jsx&&(this._jsx=u.Parser.extend(l.default(),T())),this._jsx},get(e){return Boolean(e&&e.ecmaFeatures&&e.ecmaFeatures.jsx)?this.jsx:this.regular}};const O=c.KEYS,j=function(){let e,t={};for(e in"function"==typeof Object.create&&(t=Object.create(null)),O)Object.hasOwnProperty.call(O,e)&&(t[e]=e);return"function"==typeof Object.freeze&&Object.freeze(t),t}(),F=A(),I=[...w];t.Syntax=j,t.VisitorKeys=O,t.latestEcmaVersion=F,t.name="espree",t.parse=function(e,t){return new(P.get(t))(t,e).parse()},t.supportedEcmaVersions=I,t.tokenize=function(e,t){const r=P.get(t);return t&&!0===t.tokens||(t=Object.assign({},t,{tokens:!0})),new r(t,e).tokenize()},t.version="9.6.1"},57670:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(69418)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){var t=e.use(a.default).Type,r=t.def,n=t.or,s=e.use(o.default),u=s.defaults,l=s.geq,c=e.use(i.default),p=c.BinaryOperators,f=c.AssignmentOperators,h=c.LogicalOperators;r("Printable").field("loc",n(r("SourceLocation"),null),u.null,!0),r("Node").bases("Printable").field("type",String).field("comments",n([r("Comment")],null),u.null,!0),r("SourceLocation").field("start",r("Position")).field("end",r("Position")).field("source",n(String,null),u.null),r("Position").field("line",l(1)).field("column",l(0)),r("File").bases("Node").build("program","name").field("program",r("Program")).field("name",n(String,null),u.null),r("Program").bases("Node").build("body").field("body",[r("Statement")]),r("Function").bases("Node").field("id",n(r("Identifier"),null),u.null).field("params",[r("Pattern")]).field("body",r("BlockStatement")).field("generator",Boolean,u.false).field("async",Boolean,u.false),r("Statement").bases("Node"),r("EmptyStatement").bases("Statement").build(),r("BlockStatement").bases("Statement").build("body").field("body",[r("Statement")]),r("ExpressionStatement").bases("Statement").build("expression").field("expression",r("Expression")),r("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",r("Expression")).field("consequent",r("Statement")).field("alternate",n(r("Statement"),null),u.null),r("LabeledStatement").bases("Statement").build("label","body").field("label",r("Identifier")).field("body",r("Statement")),r("BreakStatement").bases("Statement").build("label").field("label",n(r("Identifier"),null),u.null),r("ContinueStatement").bases("Statement").build("label").field("label",n(r("Identifier"),null),u.null),r("WithStatement").bases("Statement").build("object","body").field("object",r("Expression")).field("body",r("Statement")),r("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",r("Expression")).field("cases",[r("SwitchCase")]).field("lexical",Boolean,u.false),r("ReturnStatement").bases("Statement").build("argument").field("argument",n(r("Expression"),null)),r("ThrowStatement").bases("Statement").build("argument").field("argument",r("Expression")),r("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",r("BlockStatement")).field("handler",n(r("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[r("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[r("CatchClause")],u.emptyArray).field("finalizer",n(r("BlockStatement"),null),u.null),r("CatchClause").bases("Node").build("param","guard","body").field("param",r("Pattern")).field("guard",n(r("Expression"),null),u.null).field("body",r("BlockStatement")),r("WhileStatement").bases("Statement").build("test","body").field("test",r("Expression")).field("body",r("Statement")),r("DoWhileStatement").bases("Statement").build("body","test").field("body",r("Statement")).field("test",r("Expression")),r("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(r("VariableDeclaration"),r("Expression"),null)).field("test",n(r("Expression"),null)).field("update",n(r("Expression"),null)).field("body",r("Statement")),r("ForInStatement").bases("Statement").build("left","right","body").field("left",n(r("VariableDeclaration"),r("Expression"))).field("right",r("Expression")).field("body",r("Statement")),r("DebuggerStatement").bases("Statement").build(),r("Declaration").bases("Statement"),r("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",r("Identifier")),r("FunctionExpression").bases("Function","Expression").build("id","params","body"),r("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[r("VariableDeclarator")]),r("VariableDeclarator").bases("Node").build("id","init").field("id",r("Pattern")).field("init",n(r("Expression"),null),u.null),r("Expression").bases("Node"),r("ThisExpression").bases("Expression").build(),r("ArrayExpression").bases("Expression").build("elements").field("elements",[n(r("Expression"),null)]),r("ObjectExpression").bases("Expression").build("properties").field("properties",[r("Property")]),r("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(r("Literal"),r("Identifier"))).field("value",r("Expression")),r("SequenceExpression").bases("Expression").build("expressions").field("expressions",[r("Expression")]);var d=n("-","+","!","~","typeof","void","delete");r("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",d).field("argument",r("Expression")).field("prefix",Boolean,u.true);var m=n.apply(void 0,p);r("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",r("Expression")).field("right",r("Expression"));var y=n.apply(void 0,f);r("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",n(r("Pattern"),r("MemberExpression"))).field("right",r("Expression"));var g=n("++","--");r("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",g).field("argument",r("Expression")).field("prefix",Boolean);var v=n.apply(void 0,h);r("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",v).field("left",r("Expression")).field("right",r("Expression")),r("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",r("Expression")).field("consequent",r("Expression")).field("alternate",r("Expression")),r("NewExpression").bases("Expression").build("callee","arguments").field("callee",r("Expression")).field("arguments",[r("Expression")]),r("CallExpression").bases("Expression").build("callee","arguments").field("callee",r("Expression")).field("arguments",[r("Expression")]),r("MemberExpression").bases("Expression").build("object","property","computed").field("object",r("Expression")).field("property",n(r("Identifier"),r("Expression"))).field("computed",Boolean,function(){var e=this.property.type;return"Literal"===e||"MemberExpression"===e||"BinaryExpression"===e}),r("Pattern").bases("Node"),r("SwitchCase").bases("Node").build("test","consequent").field("test",n(r("Expression"),null)).field("consequent",[r("Statement")]),r("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,u.false),r("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),r("Comment").bases("Printable").field("value",String).field("leading",Boolean,u.true).field("trailing",Boolean,u.false)},(0,o.maybeSetModuleExports)(function(){return e})},58068:e=>{"use strict";e.exports=SyntaxError},58370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=i(e)||{},r=t.name,n=t.name2,a=t.value;if(r&&r===n)return{name:r,value:a,node:e}};var n=r(25065),i=(0,n.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",left:{type:"Identifier",name:(0,n.extractAny)("name")},operator:"=",right:{type:"LogicalExpression",left:{type:"Identifier",name:(0,n.extractAny)("name2")},operator:"||",right:(0,n.extractAny)("value")}}})},58504:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(78261)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){e.use(i.default);var t=e.use(a.default),r=t.Type.def,n=t.Type.or,s=e.use(o.default).defaults;r("ForOfStatement").field("await",Boolean,s.false),r("SpreadProperty").bases("Node").build("argument").field("argument",r("Expression")),r("ObjectExpression").field("properties",[n(r("Property"),r("SpreadProperty"),r("SpreadElement"))]),r("TemplateElement").field("value",{cooked:n(String,null),raw:String}),r("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("ObjectPattern").field("properties",[n(r("PropertyPattern"),r("Property"),r("RestElement"),r("SpreadPropertyPattern"))])},(0,o.maybeSetModuleExports)(function(){return e})},58633:(e,t)=>{function r(e,n,i,a,o,s){var u=Math.floor((n-e)/2)+e,l=o(i,a[u],!0);return 0===l?u:l>0?n-u>1?r(u,n,i,a,o,s):s==t.LEAST_UPPER_BOUND?n1?r(e,u,i,a,o,s):s==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,i,a){if(0===n.length)return-1;var o=r(-1,n.length,e,n,i,a||t.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===i(n[o],n[o-1],!0);)--o;return o}},58968:e=>{"use strict";e.exports=Math.floor},60074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(25065),i=s(r(31501)),a=s(r(36581)),o=s(r(4333));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function l(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";e.exports={version:"4.3.0"}},60809:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isReference=function(e,t){return!("Identifier"!==e.type||function(e,t){return(0,n.isFunction)(t)&&t.id===e}(e,t)||function(e,t){return(0,n.isFunction)(t)&&t.params.some(function(t){return t===e})}(e,t)||function(e,t){return"VariableDeclarator"===t.type&&t.id===e}(e,t)||function(e,t){return"MemberExpression"===t.type&&t.property===e&&!t.computed}(e,t)||function(e,t){return"Property"===t.type&&t.key===e}(e,t))},t.isUpdate=function(e){return"UpdateExpression"===e.type&&"Identifier"===e.argument.type};var n=r(57249)},61567:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(35302)),a=n.__importDefault(r(31399)),o=r(64522),s=Object.prototype.hasOwnProperty;t.default=function(e){var t=e.use(i.default),r=e.use(a.default),n=t.builtInTypes.array,o=t.builtInTypes.object,u=t.builtInTypes.function,l=function e(){if(!(this instanceof e))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=function(e){var r=Object.create(null);for(var n in e)/^visit[A-Z]/.test(n)&&(r[n.slice(5)]=!0);for(var i=t.computeSupertypeLookupTable(r),a=Object.create(null),o=Object.keys(i),s=o.length,l=0;l{const n=r(65432).A;t.p=function(e,t){return n(t).run(e)}},63094:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){i.default.replace(e,{enter:a})};var n,i=(n=r(88543))&&n.__esModule?n:{default:n};function a(e){var t,r;"Property"===e.type&&(t=e.key,r=e.value,"Identifier"===t.type&&"Identifier"===r.type&&t.name===r.name)&&(e.shorthand=!0)}},63437:(e,t)=>{!function e(t){"use strict";var r,n,i,a,o,s;function u(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?u(r):r);return n}function l(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function p(){}function f(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function d(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function m(e,t){return(new p).traverse(e,t)}function y(e,t){var r;return r=function(e,t){var r,n,i,a;for(n=e.length,i=0;n;)t(e[a=i+(r=n>>>1)])?n=r:(i=a+1,n-=r+1);return i}(t,function(t){return t.range[0]>e.range[0]}),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},i={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:o={},Remove:s={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,r,n,i;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(v=s[p=g[m]])if(Array.isArray(v)){for(y=v.length;(y-=1)>=0;)if(v[y]&&!d(n,v[y])){if(h(u,g[m]))i=new c(v[y],[p,y],"Property",null);else{if(!f(v[y]))continue;i=new c(v[y],[p,y],null,null)}r.push(i)}}else if(f(v)){if(d(n,v))continue;r.push(new c(v,p,null,null))}}}else if(i=n.pop(),l=this.__execute(t.leave,i),this.__state===a||l===a)return},p.prototype.replace=function(e,t){var r,n,i,u,p,d,m,y,g,v,b,x,S;function E(e){var t,n,i,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((i=r[t]).ref&&i.ref.parent===a){if(i.ref.key=0;)if(v=i[S=g[m]])if(Array.isArray(v)){for(y=v.length;(y-=1)>=0;)if(v[y]){if(h(u,g[m]))d=new c(v[y],[S,y],"Property",new l(v,y));else{if(!f(v[y]))continue;d=new c(v[y],[S,y],null,new l(v,y))}r.push(d)}}else f(v)&&r.push(new c(v,S,null,new l(i,S)))}}else if(d=n.pop(),void 0!==(p=this.__execute(t.leave,d))&&p!==a&&p!==o&&p!==s&&d.ref.replace(p),this.__state!==s&&p!==s||E(d),this.__state===a||p===a)return x.root;return x.root},t.Syntax=r,t.traverse=m,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,r){var i,a,o,s,l=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(o=0,a=t.length;oe.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,m(e,{leave:function(e){for(var t;se.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=i,t.VisitorOption=n,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)},63505:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){a.default.replace(e,{enter:function(e){var r,n,p,f,d,y,g,v,b=(0,l.default)(e);if(b){var x=(0,c.default)(e,b);return x?void t.warn.apply(t,(v=x,function(e){if(Array.isArray(e))return m(e)}(v)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(v)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,t):void 0}}(v)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(["for-each"])):function(e,t){return(0,u.default)({from:e,to:t}),(0,u.default)({from:e.body.body[0],to:t}),t}(e,(n=(r=b).body,p=r.item,f=r.index,d=r.array,y=function(e){return h(h({},e),{},{body:(0,i.tail)(e.body)})}(n),g=function(e,t,r){return function(e,t){return a.default.find(e,function(e,r){return(0,o.default)(e,t)&&(0,s.isReference)(e,r)})}(e,r)?[t,r]:[t]}(y,p,f),{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:d,property:{type:"Identifier",name:"forEach"}},arguments:[{type:"ArrowFunctionExpression",params:g,body:y}]}}))}"ForStatement"===e.type&&t.warn(e,"Unable to transform for loop","for-each")}})};var i=r(44480),a=p(r(88543)),o=p(r(41025)),s=r(60809),u=p(r(99650)),l=p(r(79658)),c=p(r(19458));function p(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function h(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(41333);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},64147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTrailingCommaEnabled=t.getParentExportDeclaration=t.isExportDeclaration=t.fixFaultyLocations=t.getTrueLoc=t.composeSourceMaps=t.copyPos=t.comparePos=t.getUnionOfKeys=t.getOption=t.isBrowser=t.getLineTerminator=void 0;var n=r(31635),i=n.__importDefault(r(17676)),a=n.__importStar(r(41434)).namedTypes,o=n.__importDefault(r(57035)),s=o.default.SourceMapConsumer,u=o.default.SourceMapGenerator,l=Object.prototype.hasOwnProperty;function c(){return"undefined"!=typeof window&&void 0!==window.document}function p(e,t){return e.line-t.line||e.column-t.column}function f(e){return{line:e.line,column:e.column}}function h(e,t){e&&t&&(p(t.start,e.start)<0&&(e.start=t.start),p(e.end,t.end)<0&&(e.end=t.end))}function d(e){if(e)switch(e.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}t.getLineTerminator=function(){return c()?"\n":r(51072).$E||"\n"},t.isBrowser=c,t.getOption=function(e,t,r){return e&&l.call(e,t)?e[t]:r},t.getUnionOfKeys=function(){for(var e=[],t=0;t{"use strict";var n=r(65606);Object.defineProperty(t,"__esModule",{value:!0}),t.run=t.prettyPrint=t.print=t.visit=t.types=t.parse=void 0;var i=r(31635),a=i.__importDefault(r(41064)),o=i.__importStar(r(41434));t.types=o;var s=r(51572);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return s.parse}});var u=r(86587),l=r(41434);function c(e,t){return new u.Printer(t).print(e)}function p(e){n.stdout.write(e)}Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return l.visit}}),t.print=c,t.prettyPrint=function(e,t){return new u.Printer(t).printGenerically(e)},t.run=function(e,t){return function(e,t,r){a.default.readFile(e,"utf-8",function(e,n){e?console.error(e):function(e,t,r){var n=r&&r.writeback||p;t((0,s.parse)(e,r),function(e){n(c(e,r).code)})}(n,t,r)})}(n.argv[2],e,t)}},64522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maybeSetModuleExports=void 0;var n=r(31635).__importDefault(r(35302));t.default=function(e){var t=e.use(n.default),r=t.Type,i=t.builtInTypes,a=i.number,o=r.or(i.string,i.number,i.boolean,i.null,i.undefined);return{geq:function(e){return r.from(function(t){return a.check(t)&&t>=e},a+" >= "+e)},defaults:{null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}},isPrimitive:r.from(function(e){if(null===e)return!0;var t=typeof e;return"object"!==t&&"function"!==t},o.toString())}},t.maybeSetModuleExports=function(e){try{var t=e(),r=t.exports,n=r.default}catch(e){return}n&&n!==r&&"object"==typeof r&&(Object.assign(n,r,{default:n}),r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0}),t.exports=n)}},65123:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r={},n=new m.default;a.default.traverse(e,{enter:function(e,t){var i;if(i=(0,l.default)(e)||(0,c.default)(e))r[i.className]=new o.default({name:i.className,fullNode:e,commentNodes:[e],parent:t}),r[i.className].setConstructor(new u.default({methodNode:i.constructorNode,potentialClass:r[i.className]}));else if(i=(0,p.default)(e))r[i.className]&&r[i.className].addMethod(new s.default({name:i.methodName,methodNode:i.methodNode,fullNode:e,commentNodes:[e],parent:t,static:!0}));else if(i=(0,f.default)(e))r[i.className]&&r[i.className].addMethod(new s.default({name:i.methodName,methodNode:i.methodNode,fullNode:e,commentNodes:[e],parent:t}));else if(i=(0,h.default)(e))r[i.className]&&i.methods.forEach(function(n,a){var o,u=0===a?[e]:[];r[i.className].addMethod(new s.default({name:n.methodName,methodNode:n.methodNode,fullNode:e,commentNodes:u.concat([n.propertyNode]),parent:t,kind:(o=n.kind,"init"===o?"method":o)}))});else if(i=(0,d.default)(e))r[i.className]&&i.descriptors.forEach(function(n,a){var o=0===a?[e]:[];r[i.className].addMethod(new s.default({name:i.methodName,methodNode:n.methodNode,fullNode:e,commentNodes:o.concat([n.propertyNode]),parent:t,kind:n.kind,static:i.static}))});else if(i=(0,y.default)(e)){var a=!1;e.expression.arguments[1].properties.every(function(e){return(0,y.matchDefinedProperties)(e).properties.some(d.isAccessorDescriptor)})&&(a=!0),i.forEach(function(n,o){r[n.className]&&n.descriptors.forEach(function(u,l){var c=0===l?[n.methodNode]:[],p=o===i.length-1&&l===n.descriptors.length-1,f=p&&a?e:n.methodNode,h=p&&a?t:e.expression.arguments[1];r[n.className].addMethod(new s.default({name:n.methodName,methodNode:u.methodNode,fullNode:f,commentNodes:c.concat([u.propertyNode]),parent:h,kind:u.kind,static:n.static}))})})}else(i=n.process(e,t))&&r[i.className]&&r[i.className].setSuperClass(i.superClass,i.relatedExpressions)},leave:function(e){"Program"===e.type&&(0,i.values)(r).filter(function(e){return!!e.isTransformable()||function(e){/^[A-Z]/.test(e.getName())&&t.warn(e.getFullNode(),"Function ".concat(e.getName()," looks like class, but has no prototype"),"class")}(e)}).forEach(function(e){return e.transform()})}})};var i=r(44480),a=b(r(88543)),o=b(r(48193)),s=b(r(19016)),u=b(r(12729)),l=b(r(67544)),c=b(r(12961)),p=b(r(57367)),f=b(r(85907)),h=b(r(5812)),d=v(r(67011)),m=b(r(81028)),y=v(r(49583));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}function b(e){return e&&e.__esModule?e:{default:e}}},65432:(e,t,r)=>{"use strict";t.A=function(e){return function(e){e.forEach(function(e){if(!_[e])throw'Unknown transform "'.concat(e,'".')})}(e),new n.default(e.map(function(e){return _[e]}))};var n=E(r(97316)),i=E(r(65123)),a=E(r(72656)),o=E(r(17433)),s=E(r(16695)),u=E(r(84029)),l=E(r(9275)),c=E(r(3475)),p=E(r(86407)),f=E(r(21074)),h=E(r(1244)),d=E(r(63094)),m=E(r(97648)),y=E(r(91263)),g=E(r(83441)),v=E(r(75652)),b=E(r(85474)),x=E(r(63505)),S=E(r(83108));function E(e){return e&&e.__esModule?e:{default:e}}var _={class:i.default,template:a.default,arrow:o.default,"arrow-return":s.default,let:u.default,"default-param":l.default,"destruct-param":c.default,"arg-spread":p.default,"arg-rest":f.default,"obj-method":h.default,"obj-shorthand":d.default,"no-strict":m.default,commonjs:y.default,exponent:g.default,"multi-var":v.default,"for-of":b.default,"for-each":x.default,includes:S.default}},65606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],l=!1,c=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&f())}function f(){if(!l){var e=o(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++c1)for(var r=1;r{"use strict";var n=r(89353);e.exports=Function.prototype.bind||n},67011:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=o(e),r=t.className,n=t.methodName,i=t.properties,a=!1;if(!r){var l=s(e);r=l.className,n=l.methodName,i=l.properties,a=!0}if(r)return{className:r,methodName:n,descriptors:i.filter(u).map(function(e){return{propertyNode:e,methodNode:e.value,kind:e.key.name}}),static:a}},t.isAccessorDescriptor=u;var n,i=r(25065),a=(n=r(33354))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperty"}},arguments:[{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:(0,i.extractAny)("className")},property:{type:"Identifier",name:"prototype"}},{type:"Literal",value:(0,i.extractAny)("methodName")},{type:"ObjectExpression",properties:(0,i.extractAny)("properties")}]}}),s=(0,i.matches)({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperty"}},arguments:[{type:"Identifier",name:(0,i.extractAny)("className")},{type:"Literal",value:(0,i.extractAny)("methodName")},{type:"ObjectExpression",properties:(0,i.extractAny)("properties")}]}});function u(e){return(0,a.default)(e)&&("get"===e.key.name||"set"===e.key.name)}},67544:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("FunctionDeclaration"===e.type&&e.id)return{className:e.id.name,constructorNode:e}}},67591:e=>{e.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},68002:e=>{"use strict";e.exports=Math.min},68494:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.namedTypes=void 0,t.namedTypes||(t.namedTypes={})},69383:e=>{"use strict";e.exports=Error},69418:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(64522);t.default=function(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}},(0,n.maybeSetModuleExports)(function(){return e})},69597:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",function(e,t,i){var a,o,s,u;if(void 0===l&&(l=r(94148)),l("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(a," ").concat(h(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(c," ").concat(a," ").concat(h(t,"type"))}return u+=". Received type ".concat(n(i))},TypeError),f("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=r(40537));var i=c.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError),f("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=p},69600:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=n.call(e);return a.test(t)}catch(e){return!1}},s=function(e){try{return!o(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),p=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(p=function(e){if((c||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!o(e)&&s(e)}:function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return s(e);if(o(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},69675:e=>{"use strict";e.exports=TypeError},69823:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(58504)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){e.use(i.default);var t=e.use(a.default),r=t.Type.def,n=t.Type.or,s=e.use(o.default).defaults;r("CatchClause").field("param",n(r("Pattern"),null),s.null)},(0,o.maybeSetModuleExports)(function(){return e})},70414:e=>{"use strict";e.exports=Math.round},70453:(e,t,r)=>{"use strict";var n,i=r(79612),a=r(69383),o=r(41237),s=r(79290),u=r(79538),l=r(58068),c=r(69675),p=r(35345),f=r(71514),h=r(58968),d=r(6188),m=r(68002),y=r(75880),g=r(70414),v=r(73093),b=Function,x=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},S=r(75795),E=r(30655),_=function(){throw new c},w=S?function(){try{return _}catch(e){try{return S(arguments,"callee").get}catch(e){return _}}}():_,A=r(64039)(),D=r(93628),k=r(71064),C=r(48648),T=r(11002),P=r(10076),O={},j="undefined"!=typeof Uint8Array&&D?D(Uint8Array):n,F={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":A&&D?D([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":O,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&D?D(D([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&D?D((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&D?D((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&D?D(""[Symbol.iterator]()):n,"%Symbol%":A?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":w,"%TypedArray%":j,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":T,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":k,"%Math.abs%":f,"%Math.floor%":h,"%Math.max%":d,"%Math.min%":m,"%Math.pow%":y,"%Math.round%":g,"%Math.sign%":v,"%Reflect.getPrototypeOf%":C};if(D)try{null.error}catch(e){var I=D(D(e));F["%Error.prototype%"]=I}var N=function e(t){var r;if("%AsyncFunction%"===t)r=x("async function () {}");else if("%GeneratorFunction%"===t)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=x("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&D&&(r=D(i.prototype))}return F[t]=r,r},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},B=r(66743),R=r(9957),L=B.call(P,Array.prototype.concat),V=B.call(T,Array.prototype.splice),U=B.call(P,String.prototype.replace),z=B.call(P,String.prototype.slice),W=B.call(P,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,X=function(e,t){var r,n=e;if(R(M,n)&&(n="%"+(r=M[n])[0]+"%"),R(F,n)){var i=F[n];if(i===O&&(i=N(n)),void 0===i&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===W(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=z(e,0,1),r=z(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return U(e,J,function(e,t,r,i){n[n.length]=r?U(i,q,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=X("%"+n+"%",t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(n=u[0],V(r,L([0,1],u)));for(var p=1,f=!0;p=r.length){var y=S(o,h);o=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[h]}else f=R(o,h),o=o[h];f&&!s&&(F[a]=o)}}return o}},71064:(e,t,r)=>{"use strict";var n=r(79612);e.exports=n.getPrototypeOf||null},71514:e=>{"use strict";e.exports=Math.abs},72325:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(17676)),a=n.__importStar(r(41434)),o=n.__importStar(r(64147)),s=a.namedTypes,u=a.builtInTypes.array,l=a.builtInTypes.number,c={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(e,t){e.forEach(function(e){c[e]=t})});var p=function e(t){(0,i.default)(this instanceof e),this.stack=[t]},f=p.prototype;function h(e,t){for(var r=e.stack,n=r.length-1;n>=0;n-=2){var i=r[n];if(s.Node.check(i)&&--t<0)return i}return null}function d(e){return s.BinaryExpression.check(e)||s.LogicalExpression.check(e)}function m(e){return!!s.CallExpression.check(e)||(u.check(e)?e.some(m):!!s.Node.check(e)&&a.someField(e,function(e,t){return m(t)}))}p.from=function(e){if(e instanceof p)return e.copy();if(e instanceof a.NodePath){for(var t=Object.create(p.prototype),r=[e.value],n=void 0;n=e.parentPath;e=n)r.push(e.name,n.value);return t.stack=r.reverse(),t}return new p(e)},f.copy=function(){var e=Object.create(p.prototype);return e.stack=this.stack.slice(0),e},f.getName=function(){var e=this.stack,t=e.length;return t>1?e[t-2]:null},f.getValue=function(){var e=this.stack;return e[e.length-1]},f.valueIsDuplicate=function(){var e=this.stack,t=e.length-1;return e.lastIndexOf(e[t],t-1)>=0},f.getNode=function(e){return void 0===e&&(e=0),h(this,~~e)},f.getParentNode=function(e){return void 0===e&&(e=0),h(this,1+~~e)},f.getRootValue=function(){var e=this.stack;return e.length%2==0?e[1]:e[0]},f.call=function(e){for(var t=this.stack,r=t.length,n=t[r-1],i=arguments.length,a=1;a0){var n=r[t.start.token-1];if(n){var i=this.getRootValue().loc;if(o.comparePos(i.start,n.loc.start)<=0)return n}}return null},f.getNextToken=function(e){var t=(e=e||this.getNode())&&e.loc,r=t&&t.tokens;if(r&&t.end.tokenp)return!0;if(o===p&&"right"===n)return(0,i.default)(r.right===t),!0;break;default:return!1}break;case"SequenceExpression":switch(r.type){case"ReturnStatement":case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==n;default:return!0}case"OptionalIndexedAccessType":return t.optional&&"IndexedAccessType"===r.type;case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return"NullableTypeAnnotation"===r.type;case"Literal":return"MemberExpression"===r.type&&l.check(t.value)&&"object"===n&&r.object===t;case"NumericLiteral":return"MemberExpression"===r.type&&"object"===n&&r.object===t;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return"callee"===n&&r.callee===t;case"ConditionalExpression":return"test"===n&&r.test===t;case"MemberExpression":return"object"===n&&r.object===t;default:return!1}case"ArrowFunctionExpression":return!(!s.CallExpression.check(r)||"callee"!==n||r.callee!==t)||(!(!s.MemberExpression.check(r)||"object"!==n||r.object!==t)||(!(!s.TSAsExpression||!s.TSAsExpression.check(r)||"expression"!==n||r.expression!==t)||d(r)));case"ObjectExpression":if("ArrowFunctionExpression"===r.type&&"body"===n&&r.body===t)return!0;break;case"TSAsExpression":if("ArrowFunctionExpression"===r.type&&"body"===n&&r.body===t&&"ObjectExpression"===t.expression.type)return!0;break;case"CallExpression":if("declaration"===n&&s.ExportDefaultDeclaration.check(r)&&s.FunctionExpression.check(t.callee))return!0}return"NewExpression"===r.type&&"callee"===n&&r.callee===t?m(t):!(!0===e||this.canBeFirstInStatement()||!this.firstInStatement())},f.canBeFirstInStatement=function(){var e=this.getNode();return!s.FunctionExpression.check(e)&&(!s.ObjectExpression.check(e)&&!s.ClassExpression.check(e))},f.firstInStatement=function(){for(var e,t,r,n,a=this.stack,o=a.length-1;o>=0;o-=2)if(s.Node.check(a[o])&&(r=e,n=t,e=a[o-1],t=a[o]),t&&n){if(s.BlockStatement.check(t)&&"body"===e&&0===r)return(0,i.default)(t.body[0]===n),!0;if(s.ExpressionStatement.check(t)&&"expression"===r)return(0,i.default)(t.expression===n),!0;if(s.AssignmentExpression.check(t)&&"left"===r)return(0,i.default)(t.left===n),!0;if(s.ArrowFunctionExpression.check(t)&&"body"===r)return(0,i.default)(t.body===n),!0;if(s.SequenceExpression.check(t)&&"expressions"===a[o+1]&&0===r)(0,i.default)(t.expressions[0]===n);else if(s.CallExpression.check(t)&&"callee"===r)(0,i.default)(t.callee===n);else if(s.MemberExpression.check(t)&&"object"===r)(0,i.default)(t.object===n);else if(s.ConditionalExpression.check(t)&&"test"===r)(0,i.default)(t.test===n);else if(d(t)&&"left"===r)(0,i.default)(t.left===n);else{if(!s.UnaryExpression.check(t)||t.prefix||"argument"!==r)return!1;(0,i.default)(t.argument===n)}}return!0},t.default=p},72656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){n.default.replace(e,{enter:function(e){if(c(e)){var t=l(e);if(t.isString&&!t.operands.every(o.default)){var r=new i.default(function(e){for(var t=[],r=[],n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=t.enter,o=void 0===r?a:r,s=(0,n.analyze)(e,{ecmaVersion:2022,sourceType:"module"}),u=s.acquire(e);return{enter:function(e,t){return(0,i.isFunction)(e)&&(u=s.acquire(e)),o.call(this,e,t,u)}}};var n=r(14195),i=r(57249),a=function(){}},73093:(e,t,r)=>{"use strict";var n=r(94459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},73113:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";var n=r(66743),i=r(69675),a=r(10076),o=r(13144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return o(n,a,e)}},73424:(e,t,r)=>{var n=r(16962),i=r(2874),a=Array.prototype.push;function o(e,t){return 2==t?function(t,r){return e(t,r)}:function(t){return e(t)}}function s(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r}function u(e,t){return function(){var r=arguments.length;if(r){for(var n=Array(r);r--;)n[r]=arguments[r];var i=n[0]=t.apply(void 0,n);return e.apply(void 0,n),i}}}e.exports=function e(t,r,l,c){var p="function"==typeof r,f=r===Object(r);if(f&&(c=l,l=r,r=void 0),null==l)throw new TypeError;c||(c={});var h=!("cap"in c)||c.cap,d=!("curry"in c)||c.curry,m=!("fixed"in c)||c.fixed,y=!("immutable"in c)||c.immutable,g=!("rearg"in c)||c.rearg,v=p?l:i,b="curry"in c&&c.curry,x="fixed"in c&&c.fixed,S="rearg"in c&&c.rearg,E=p?l.runInContext():void 0,_=p?l:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isError:t.isError,isFunction:t.isFunction,isWeakMap:t.isWeakMap,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,toInteger:t.toInteger,toPath:t.toPath},w=_.ary,A=_.assign,D=_.clone,k=_.curry,C=_.forEach,T=_.isArray,P=_.isError,O=_.isFunction,j=_.isWeakMap,F=_.keys,I=_.rearg,N=_.toInteger,M=_.toPath,B=F(n.aryMethod),R={castArray:function(e){return function(){var t=arguments[0];return T(t)?e(s(t)):e.apply(void 0,arguments)}},iteratee:function(e){return function(){var t=arguments[1],r=e(arguments[0],t),n=r.length;return h&&"number"==typeof t?(t=t>2?t-2:1,n&&n<=t?r:o(r,t)):r}},mixin:function(e){return function(t){var r=this;if(!O(r))return e(r,Object(t));var n=[];return C(F(t),function(e){O(t[e])&&n.push([e,r.prototype[e]])}),e(r,Object(t)),C(n,function(e){var t=e[1];O(t)?r.prototype[e[0]]=t:delete r.prototype[e[0]]}),r}},nthArg:function(e){return function(t){var r=t<0?1:N(t)+1;return k(e(t),r)}},rearg:function(e){return function(t,r){var n=r?r.length:0;return k(e(t,r),n)}},runInContext:function(r){return function(n){return e(t,r(n),c)}}};function L(e,t){if(h){var r=n.iterateeRearg[e];if(r)return function(e,t){return J(e,function(e){var r=t.length;return function(e,t){return 2==t?function(t,r){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}}(I(o(e,r),t),r)})}(t,r);var i=!p&&n.iterateeAry[e];if(i)return function(e,t){return J(e,function(e){return"function"==typeof e?o(e,t):e})}(t,i)}return t}function V(e,t,r){if(m&&(x||!n.skipFixed[e])){var i=n.methodSpread[e],o=i&&i.start;return void 0===o?w(t,r):function(e,t){return function(){for(var r=arguments.length,n=r-1,i=Array(r);r--;)i[r]=arguments[r];var o=i[t],s=i.slice(0,t);return o&&a.apply(s,o),t!=n&&a.apply(s,i.slice(t+1)),e.apply(this,s)}}(t,o)}return t}function U(e,t,r){return g&&r>1&&(S||!n.skipRearg[e])?I(t,n.methodRearg[e]||n.aryRearg[r]):t}function z(e,t){for(var r=-1,n=(t=M(t)).length,i=n-1,a=D(Object(e)),o=a;null!=o&&++r1?k(t,r):t}(0,i=L(a,i),e),!1}}),!i}),i||(i=o),i==t&&(i=b?k(i,1):function(){return t.apply(this,arguments)}),i.convert=W(a,t),i.placeholder=t.placeholder=r,i}if(!f)return q(r,l,v);var X=l,G=[];return C(B,function(e){C(n.aryMethod[e],function(e){var t=X[n.remap[e]||e];t&&G.push([e,q(e,t,X)])})}),C(F(X),function(e){var t=X[e];if("function"==typeof t){for(var r=G.length;r--;)if(G[r][0]==e)return;t.convert=W(e,t),G.push([e,t])}}),C(G,function(e){X[e[0]]=e[1]}),X.convert=function(e){return X.runInContext.convert(e)(void 0)},X.placeholder=X,C(F(X),function(e){C(n.realToAlias[e]||[],function(t){X[t]=X[e]})}),X}},74231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){n.default.traverse(e,{enter:function(e,r){if("VariableDeclaration"===e.type&&e.declarations.length>1)return function(e,t,r){var n=e.declarations.map(function(t){return new a.default(e.kind,[t])});try{(0,i.default)({parent:t,node:e,replacements:n,preserveComments:!0})}catch(e){r.warn(t,"Unable to split var statement in a ".concat(t.type),"multi-var")}}(e,r,t),n.default.VisitorOption.Skip}})};var n=o(r(88543)),i=o(r(51329)),a=o(r(97587));function o(e){return e&&e.__esModule?e:{default:e}}},75795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},75880:e=>{"use strict";e.exports=Math.pow},75944:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(93017)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){e.use(i.default);var t=e.use(a.default),r=e.use(o.default).defaults,n=t.Type.def,s=t.Type.or;n("VariableDeclaration").field("declarations",[s(n("VariableDeclarator"),n("Identifier"))]),n("Property").field("value",s(n("Expression"),n("Pattern"))),n("ArrayPattern").field("elements",[s(n("Pattern"),n("SpreadElement"),null)]),n("ObjectPattern").field("properties",[s(n("Property"),n("PropertyPattern"),n("SpreadPropertyPattern"),n("SpreadProperty"))]),n("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),n("ExportBatchSpecifier").bases("Specifier").build(),n("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",s(n("Declaration"),n("Expression"),null)).field("specifiers",[s(n("ExportSpecifier"),n("ExportBatchSpecifier"))],r.emptyArray).field("source",s(n("Literal"),null),r.null),n("Block").bases("Comment").build("value","leading","trailing"),n("Line").bases("Comment").build("value","leading","trailing")},(0,o.maybeSetModuleExports)(function(){return e})},76402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r=5}},{key:"__get",value:function(e){return this.__nodeToScope.get(e)}},{key:"getDeclaredVariables",value:function(e){return this.__declaredVariables.get(e)||[]}},{key:"acquire",value:function(e,t){var r,n,i,a;function o(e){return("function"!==e.type||!e.functionExpressionScope)&&"TDZ"!==e.type}if(!(r=this.__get(e))||0===r.length)return null;if(1===r.length)return r[0];if(t){for(i=r.length-1;i>=0;--i)if(o(n=r[i]))return n}else for(i=0,a=r.length;i=6}}]),e}();t.default=s},76578:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},76642:(e,t,r)=>{"use strict";var n=r(13003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},77393:(e,t,r)=>{var n=r(90597),i=Object.prototype.hasOwnProperty,a="undefined"!=typeof Map;function o(){this._array=[],this._set=a?new Map:Object.create(null)}o.fromArray=function(e,t){for(var r=new o,n=0,i=e.length;n=0)return t}else{var r=n.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},o.prototype.at=function(e){if(e>=0&&e{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(86198)),a=n.__importDefault(r(35302)),o=n.__importStar(r(64522));t.default=function(e){e.use(i.default);var t=e.use(a.default).Type.def,r=e.use(o.default).defaults;t("Function").field("async",Boolean,r.false),t("AwaitExpression").bases("Expression").build("argument").field("argument",t("Expression"))},(0,o.maybeSetModuleExports)(function(){return e})},78369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635).__importDefault(r(17676)),i=r(64147),a=function(){function e(e,t,r){void 0===r&&(r=t),this.sourceLines=e,this.sourceLoc=t,this.targetLoc=r}return e.prototype.slice=function(t,r,a){void 0===a&&(a=t.lastPos());var o=this.sourceLines,u=this.sourceLoc,l=this.targetLoc;function c(e){var s=u[e],c=l[e],p=r;return"end"===e?p=a:(0,n.default)("start"===e),function(e,t,r,a,o){var s,u,l=(0,i.comparePos)(a,o);if(0===l)return t;if(l<0){s=e.skipSpaces(t)||e.lastPos(),u=r.skipSpaces(a)||r.lastPos();var c=o.line-u.line;for(s.line+=c,u.line+=c,c>0?(s.column=0,u.column=0):(0,n.default)(0===c);(0,i.comparePos)(u,o)<0&&r.nextPos(u,!0);)(0,n.default)(e.nextPos(s,!0)),(0,n.default)(e.charAt(s)===r.charAt(u))}else{s=e.skipSpaces(t,!0)||e.firstPos(),u=r.skipSpaces(a,!0)||r.firstPos();c=o.line-u.line;for(s.line+=c,u.line+=c,c<0?(s.column=e.getLineLength(s.line),u.column=r.getLineLength(u.line)):(0,n.default)(0===c);(0,i.comparePos)(o,u)<0&&r.prevPos(u,!0);)(0,n.default)(e.prevPos(s,!0)),(0,n.default)(e.charAt(s)===r.charAt(u))}return s}(o,s,t,c,p)}if((0,i.comparePos)(r,l.start)<=0)if((0,i.comparePos)(l.end,a)<=0)l={start:s(l.start,r.line,r.column),end:s(l.end,r.line,r.column)};else{if((0,i.comparePos)(a,l.start)<=0)return null;u={start:u.start,end:c("end")},l={start:s(l.start,r.line,r.column),end:s(a,r.line,r.column)}}else{if((0,i.comparePos)(l.end,r)<=0)return null;(0,i.comparePos)(l.end,a)<=0?(u={start:c("start"),end:u.end},l={start:{line:1,column:0},end:s(l.end,r.line,r.column)}):(u={start:c("start"),end:c("end")},l={start:{line:1,column:0},end:s(a,r.line,r.column)})}return new e(this.sourceLines,u,l)},e.prototype.add=function(t,r){return new e(this.sourceLines,this.sourceLoc,{start:o(this.targetLoc.start,t,r),end:o(this.targetLoc.end,t,r)})},e.prototype.subtract=function(t,r){return new e(this.sourceLines,this.sourceLoc,{start:s(this.targetLoc.start,t,r),end:s(this.targetLoc.end,t,r)})},e.prototype.indent=function(t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!1),0===t)return this;var i=this.targetLoc,a=i.start.line,o=i.end.line;if(r&&1===a&&1===o)return this;if(i={start:i.start,end:i.end},!r||a>1){var s=i.start.column+t;i.start={line:a,column:n?Math.max(0,s):s}}if(!r||o>1){var u=i.end.column+t;i.end={line:o,column:n?Math.max(0,u):u}}return new e(this.sourceLines,this.sourceLoc,i)},e}();function o(e,t,r){return{line:e.line+t-1,column:1===e.line?e.column+r:e.column}}function s(e,t,r){return{line:e.line-t+1,column:e.line===t?e.column-r:e.column}}t.default=a},79290:e=>{"use strict";e.exports=RangeError},79538:e=>{"use strict";e.exports=ReferenceError},79612:e=>{"use strict";e.exports=Object},79658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=l(e);if(t&&(o=t,s=o.index,u=o.indexComparison,c=o.indexIncrement,p=o.indexReference,(0,i.default)(s,u)&&(0,i.default)(s,c)&&(0,i.default)(s,p))&&(r=t,n=r.array,a=r.arrayReference,(0,i.default)(n,a)))return t;var r,n,a;var o,s,u,c,p};var n,i=(n=r(41025))&&n.__esModule?n:{default:n},a=r(25065);var o,s=(0,a.matches)({type:"UpdateExpression",operator:"++",argument:(0,a.extract)("indexIncrement",{type:"Identifier"})}),u=(0,a.matches)({type:"AssignmentExpression",operator:"+=",left:(0,a.extract)("indexIncrement",{type:"Identifier"}),right:{type:"Literal",value:1}}),l=(0,a.matches)({type:"ForStatement",init:{type:"VariableDeclaration",declarations:(0,a.matchesLength)([{type:"VariableDeclarator",id:(0,a.extract)("index",{type:"Identifier"}),init:{type:"Literal",value:0}}]),kind:(0,a.extractAny)("indexKind")},test:{type:"BinaryExpression",operator:"<",left:(0,a.extract)("indexComparison",{type:"Identifier"}),right:{type:"MemberExpression",computed:!1,object:(0,a.extractAny)("array"),property:{type:"Identifier",name:"length"}}},update:function(e){return s(e)||u(e)},body:(0,a.extract)("body",{type:"BlockStatement",body:(o=[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:(0,a.extract)("item",{type:"Identifier"}),init:{type:"MemberExpression",computed:!0,object:(0,a.extractAny)("arrayReference"),property:(0,a.extract)("indexReference",{type:"Identifier"})}}],kind:(0,a.extractAny)("itemKind")}],function(e){return(0,a.matches)(o[0],e[0])})})})},79783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("FunctionExpression"===e.type)return!0;if("ArrowFunctionExpression"===e.type&&(t=e,!i.default.find(t,"ThisExpression",{skipTypes:["FunctionExpression","FunctionDeclaration"]})))return!0;var t};var n,i=(n=r(88543))&&n.__esModule?n:{default:n}},81028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(60074)),i=a(r(9796));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var r=0;r{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},81893:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=r(64522),a=n.__importDefault(r(35302));t.default=function(e){var t=e.use(a.default),r=t.getFieldNames,n=t.getFieldValue,i=t.builtInTypes.array,o=t.builtInTypes.object,s=t.builtInTypes.Date,u=t.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function c(e,t,r){return i.check(r)?r.length=0:r=null,f(e,t,r)}function p(e){return/[_$a-z][_$a-z0-9]*/i.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function f(e,t,a){return e===t||(i.check(e)?function(e,t,r){i.assert(e);var n=e.length;if(!i.check(t)||t.length!==n)return r&&r.push("length"),!1;for(var a=0;a{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function F(e){return Object.keys(e).filter(j).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function I(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i{"use strict";var n=r(69600),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o,s;arguments.length>=3&&(o=r),s=e,"[object Array]"===i.call(s)?function(e,t,r){for(var n=0,i=e.length;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){n.default.replace(e,{enter:function(e){var t=(0,i.default)(e);return t&&(0,a.isIncludesComparison)(t)?s(t):t&&(0,a.isNotIncludesComparison)(t)?{type:"UnaryExpression",operator:"!",prefix:!0,argument:s(t)}:void 0}})};var n=o(r(88543)),i=o(r(87372)),a=r(35167);function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return{type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:e.object,property:{type:"Identifier",name:"includes"}},arguments:[e.searchElement]}}},83441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){a.default.replace(e,{enter:function(e){if(o(e))return{type:"BinaryExpression",operator:"**",left:e.arguments[0],right:e.arguments[1]}}})};var n,i=r(25065),a=(n=r(88543))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:"Math"},property:{type:"Identifier",name:"pow"}},arguments:function(e){return 2===e.length}})},84029:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){i=t,a=new f.default;var r=new h.default(a);s.default.traverse(e,{enter:function(e,t){var n;"Program"===e.type?function(e){a.enterFunction(),S({body:e}),a.enterBlock()}(e):u.isFunctionDeclaration(e)?function(e){e.id&&w().register(e.id.name,w().findFunctionScoped(e.id.name));a.enterFunction(),S({params:e.params,body:e.body})}(e):u.isFunctionExpression(e)?(n=e,a.enterFunction(),S({id:n.id,params:n.params,body:n.body})):b(e)?a.enterBlock():"VariableDeclaration"===e.type?e.declarations.forEach(function(n){r.markDeclared(c.extractVariableNames(n.id));var i=x(t)&&t.left===e;null!==n.init||i||r.markModified(n.id.name)}):"AssignmentExpression"===e.type?c.extractVariableNames(e.left).forEach(function(e){r.markModified(e)}):l.isUpdate(e)?r.markModified(e.argument.name):l.isReference(e,t)&&r.markReferenced(e.name)},leave:function(e){"Program"===e.type?(a.leaveScope(),E()):u.isFunction(e)?E():b(e)&&a.leaveScope()}})};var i,a,o=r(44480),s=v(r(88543)),u=g(r(57249)),l=g(r(60809)),c=g(r(2242)),p=v(r(51329)),f=v(r(84549)),h=v(r(8772)),d=v(r(14180)),m=v(r(97587));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}function v(e){return e&&e.__esModule?e:{default:e}}function b(e){return"BlockStatement"===e.type||x(e)}function x(e){return"ForStatement"===e.type||"ForInStatement"===e.type||"ForOfStatement"===e.type}function S(e){new d.default(w()).hoist(e)}function E(){(0,o.flow)((0,o.map)(function(e){return e.getGroup()}),o.uniq,o.compact)(w().getVariables()).forEach(function(e){if("var"===e.getNode().kind)if(function(e){var t=e.getNode(),r=e.getParentNode();return"IfStatement"===r.type?r.consequent===t||r.alternate===t:!(!x(r)&&!function(e){return"WhileStatement"===e.type||"DoWhileStatement"===e.type}(r))&&r.body===t}(e))_(e.getNode());else{var t,r=e.getCommonKind();if(r)e.getNode().kind=r,_(e.getNode());else if("BlockStatement"===(t=e.getParentNode()).type||"Program"===t.type||"SwitchCase"===t.type){var n=e.getVariables().map(function(e){return new m.default(e.getKind(),[e.getNode()])});(0,p.default)({parent:e.getParentNode(),node:e.getNode(),replacements:n,preserveComments:!0}),_(e.getNode())}else e.getNode().kind=e.getMostRestrictiveKind(),_(e.getNode())}}),a.leaveScope()}function _(e){"var"===e.kind&&i.warn(e,"Unable to transform var","let")}function w(){return a.getScope()}},84120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var u=o?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(n,s,u):n[s]=e[s]}n.default=e,r&&r.set(e,n);return n}(r(57480));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(73113)),i=a(r(34564));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){i.default.replace(e,{enter:function(e){var r,n,l,c=(0,u.default)(e);if(c)return n=(r=c).body,l=r.index,i.default.find(d(n),function(e,t){return(0,a.default)(e,l)&&(0,o.isReference)(e,t)})?void t.warn(e,"Index variable used in for-loop body","for-of"):"var"===c.itemKind||"var"===c.indexKind?void t.warn(e,"Only for-loops with let/const can be transformed (use let transform first)","for-of"):function(e,t){return(0,s.default)({from:e,to:t}),(0,s.default)({from:e.body.body[0],to:t}),t}(e,function(e){var t=e.item,r=e.itemKind,n=e.array,i=e.body;return{type:"ForOfStatement",left:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:t,init:null}],kind:r},right:n,body:d(i)}}(c));"ForStatement"===e.type&&t.warn(e,"Unable to transform for loop","for-of")}})};var n=r(44480),i=l(r(88543)),a=l(r(41025)),o=r(60809),s=l(r(99650)),u=l(r(79658));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function f(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(25065),a=(n=r(79783))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",left:{type:"MemberExpression",computed:!1,object:{type:"MemberExpression",computed:!1,object:{type:"Identifier",name:(0,i.extractAny)("className")},property:{type:"Identifier",name:"prototype"}},property:{type:"Identifier",name:(0,i.extractAny)("methodName")}},operator:"=",right:(0,i.extract)("methodNode",a.default)}});t.default=o},86198:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(15312)),a=n.__importDefault(r(26277)),o=r(64522);t.default=function(e){e.use(i.default),e.use(a.default)},(0,o.maybeSetModuleExports)(function(){return e})},86407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){a.default.replace(e,{enter:function(e){var t=function(e){return(0,o.matches)({type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:(0,o.extract)("func",{type:"Identifier"}),property:{type:"Identifier",name:"apply"}},arguments:[function(e){return l(e)||c(e)},(0,o.extractAny)("array")]},e)}(e),r=t.func,n=t.array;if(r)return s(r,n);var a=function(e){return(0,o.matches)({type:"CallExpression",callee:{type:"MemberExpression",computed:!1,object:(0,o.extract)("memberExpr",{type:"MemberExpression"}),property:{type:"Identifier",name:"apply"}},arguments:[(0,o.extractAny)("thisParam"),(0,o.extractAny)("arrayParam")]},e)}(e),p=a.memberExpr,f=a.thisParam,h=a.arrayParam;return p&&(0,i.isEqual)(u(p.object),u(f))?s(p,h):void 0}})};var n,i=r(44480),a=(n=r(88543))&&n.__esModule?n:{default:n},o=r(25065);function s(e,t){return{type:"CallExpression",callee:e,arguments:[{type:"SpreadElement",argument:t}]}}function u(e){return(0,i.isArray)(e)?e.map(u):(0,i.isObjectLike)(e)?(0,i.flow)((0,i.omit)(["loc","start","end"]),(0,i.mapValues)(u))(e):e}var l=(0,o.matches)({type:"Identifier",name:"undefined"}),c=(0,o.matches)({type:"Literal",value:null,raw:"null"})},86587:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Printer=void 0;var n=r(31635),i=n.__importDefault(r(17676)),a=n.__importStar(r(41434)),o=r(9773),s=n.__importDefault(r(72325)),u=r(1688),l=r(47289),c=r(4466),p=n.__importStar(r(64147)),f=a.namedTypes,h=a.builtInTypes.string,d=a.builtInTypes.object,m=function e(t,r){(0,i.default)(this instanceof e),h.assert(t),this.code=t,r&&(d.assert(r),this.map=r)},y=!1;m.prototype.toString=function(){return y||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),y=!0),this.code};var g=new m("");function v(e,t,r,o){(0,i.default)(e instanceof s.default);var l=e.getValue(),c=[],h=function(e,t,r){var o,s,l,c=e.getValue();if(!c)return(0,u.fromString)("");if("string"==typeof c)return(0,u.fromString)(c,t);f.Printable.assert(c);var h=[];switch(c.type){case"File":return e.call(r,"program");case"Program":return c.directives&&e.each(function(e){h.push(r(e),";\n")},"directives"),c.interpreter&&h.push(e.call(r,"interpreter")),h.push(e.call(function(e){return b(e,t,r)},"body")),(0,u.concat)(h);case"Noop":case"EmptyStatement":return(0,u.fromString)("");case"ExpressionStatement":return(0,u.concat)([e.call(r,"expression"),";"]);case"ParenthesizedExpression":return(0,u.concat)(["(",e.call(r,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return(0,u.fromString)(" ").join([e.call(r,"left"),c.operator,e.call(r,"right")]);case"AssignmentPattern":return(0,u.concat)([e.call(r,"left")," = ",e.call(r,"right")]);case"MemberExpression":case"OptionalMemberExpression":h.push(e.call(r,"object"));var d=e.call(r,"property"),m=a.getFieldValue(c,"optional");return c.computed?h.push(m?"?.[":"[",d,"]"):h.push(m?"?.":".",d),(0,u.concat)(h);case"ChainExpression":return e.call(r,"expression");case"MetaProperty":return(0,u.concat)([e.call(r,"meta"),".",e.call(r,"property")]);case"BindExpression":return c.object&&h.push(e.call(r,"object")),h.push("::",e.call(r,"callee")),(0,u.concat)(h);case"Path":return(0,u.fromString)(".").join(c.body);case"Identifier":return(0,u.concat)([(0,u.fromString)(c.name,t),c.optional?"?":"",e.call(r,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return(0,u.concat)(["...",e.call(r,"argument"),e.call(r,"typeAnnotation")]);case"FunctionDeclaration":case"FunctionExpression":case"TSDeclareFunction":return c.declare&&h.push("declare "),c.async&&h.push("async "),h.push("function"),c.generator&&h.push("*"),c.id?h.push(" ",e.call(r,"id"),e.call(r,"typeParameters")):c.typeParameters&&h.push(e.call(r,"typeParameters")),h.push("(",_(e,t,r),")",e.call(r,"returnType")),c.body&&h.push(" ",e.call(r,"body")),(0,u.concat)(h);case"ArrowFunctionExpression":return c.async&&h.push("async "),c.typeParameters&&h.push(e.call(r,"typeParameters")),t.arrowParensAlways||1!==c.params.length||c.rest||"Identifier"!==c.params[0].type||c.params[0].typeAnnotation||c.returnType?h.push("(",_(e,t,r),")",e.call(r,"returnType")):h.push(e.call(r,"params",0)),h.push(" => ",e.call(r,"body")),(0,u.concat)(h);case"MethodDefinition":return S(e,t,r);case"YieldExpression":return h.push("yield"),c.delegate&&h.push("*"),c.argument&&h.push(" ",e.call(r,"argument")),(0,u.concat)(h);case"AwaitExpression":return h.push("await"),c.all&&h.push("*"),c.argument&&h.push(" ",e.call(r,"argument")),(0,u.concat)(h);case"ModuleExpression":return(0,u.concat)(["module {\n",e.call(r,"body").indent(t.tabWidth),"\n}"]);case"ModuleDeclaration":return h.push("module",e.call(r,"id")),c.source?((0,i.default)(!c.body),h.push("from",e.call(r,"source"))):h.push(e.call(r,"body")),(0,u.fromString)(" ").join(h);case"ImportSpecifier":return c.importKind&&"value"!==c.importKind&&h.push(c.importKind+" "),c.imported?(h.push(e.call(r,"imported")),c.local&&c.local.name!==c.imported.name&&h.push(" as ",e.call(r,"local"))):c.id&&(h.push(e.call(r,"id")),c.name&&h.push(" as ",e.call(r,"name"))),(0,u.concat)(h);case"ExportSpecifier":return c.exportKind&&"value"!==c.exportKind&&h.push(c.exportKind+" "),c.local?(h.push(e.call(r,"local")),c.exported&&c.exported.name!==c.local.name&&h.push(" as ",e.call(r,"exported"))):c.id&&(h.push(e.call(r,"id")),c.name&&h.push(" as ",e.call(r,"name"))),(0,u.concat)(h);case"ExportBatchSpecifier":return(0,u.fromString)("*");case"ImportNamespaceSpecifier":return h.push("* as "),c.local?h.push(e.call(r,"local")):c.id&&h.push(e.call(r,"id")),(0,u.concat)(h);case"ImportDefaultSpecifier":return c.local?e.call(r,"local"):e.call(r,"id");case"TSExportAssignment":return(0,u.concat)(["export = ",e.call(r,"expression")]);case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return A(e,t,r);case"ExportAllDeclaration":return h.push("export *"),c.exported&&h.push(" as ",e.call(r,"exported")),h.push(" from ",e.call(r,"source"),";"),(0,u.concat)(h);case"TSNamespaceExportDeclaration":return h.push("export as namespace ",e.call(r,"id")),N((0,u.concat)(h));case"ExportNamespaceSpecifier":return(0,u.concat)(["* as ",e.call(r,"exported")]);case"ExportDefaultSpecifier":return e.call(r,"exported");case"Import":return(0,u.fromString)("import",t);case"ImportExpression":return(0,u.concat)(["import(",e.call(r,"source"),")"]);case"ImportDeclaration":if(h.push("import "),c.importKind&&"value"!==c.importKind&&h.push(c.importKind+" "),c.specifiers&&c.specifiers.length>0){var y=[],g=[];if(e.each(function(e){var t=e.getValue();"ImportSpecifier"===t.type?g.push(r(e)):"ImportDefaultSpecifier"!==t.type&&"ImportNamespaceSpecifier"!==t.type||y.push(r(e))},"specifiers"),y.forEach(function(e,t){t>0&&h.push(", "),h.push(e)}),g.length>0)(Pe=(0,u.fromString)(", ").join(g)).getLineLength(1)>t.wrapColumn&&(Pe=(0,u.concat)([(0,u.fromString)(",\n").join(g).indent(t.tabWidth),","])),y.length>0&&h.push(", "),Pe.length>1?h.push("{\n",Pe,"\n}"):t.objectCurlySpacing?h.push("{ ",Pe," }"):h.push("{",Pe,"}");h.push(" from ")}return h.push(e.call(r,"source"),w(e,t,r),";"),(0,u.concat)(h);case"ImportAttribute":return(0,u.concat)([e.call(r,"key"),": ",e.call(r,"value")]);case"StaticBlock":h.push("static ");case"BlockStatement":var v=e.call(function(e){return b(e,t,r)},"body");return!v.isEmpty()||c.directives&&0!==c.directives.length?(h.push("{\n"),c.directives&&e.each(function(e){h.push(N(r(e).indent(t.tabWidth)),c.directives.length>1||!v.isEmpty()?"\n":"")},"directives"),h.push(v.indent(t.tabWidth)),h.push("\n}"),(0,u.concat)(h)):(h.push("{}"),(0,u.concat)(h));case"ReturnStatement":if(h.push("return"),c.argument){var O=(null===(o=f.JSXElement)||void 0===o?void 0:o.check(c.argument))||(null===(s=f.JSXFragment)||void 0===s?void 0:s.check(c.argument)),F=e.call(r,"argument");F.startsWithComment()||F.length>1&&O?(O&&(null===(l=c.argument.extra)||void 0===l?void 0:l.parenthesized)&&(c.argument.extra.parenthesized=!1,F=e.call(r,"argument"),c.argument.extra.parenthesized=!0),h.push(" ",(0,u.concat)(["(\n",F]).indentTail(t.tabWidth),"\n)")):h.push(" ",F)}return h.push(";"),(0,u.concat)(h);case"CallExpression":case"OptionalCallExpression":return h.push(e.call(r,"callee")),c.typeParameters&&h.push(e.call(r,"typeParameters")),c.typeArguments&&h.push(e.call(r,"typeArguments")),a.getFieldValue(c,"optional")&&h.push("?."),h.push(E(e,t,r)),(0,u.concat)(h);case"RecordExpression":h.push("#");case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":var M="ObjectTypeAnnotation"===c.type,B=t.flowObjectCommas?",":M?";":",",R=[],L=!1;M&&(R.push("indexers","callProperties"),null!=c.internalSlots&&R.push("internalSlots")),R.push("properties");var V=0;R.forEach(function(e){V+=c[e].length});var U=M&&1===V||0===V,z=c.exact?"{|":"{",W=c.exact?"|}":"}";h.push(U?z:z+"\n");var J=h.length-1,q=0;if(R.forEach(function(n){e.each(function(e){var n=r(e);U||(n=n.indent(t.tabWidth));var i=!M&&n.length>1;i&&L&&h.push("\n"),h.push(n),q0&&h.push(B," "),h.push(X)):h.push("\n",X.indent(t.tabWidth))}return h.push(U?W:"\n"+W),0!==q&&U&&t.objectCurlySpacing&&(h[J]=z+" ",h[h.length-1]=" "+W),c.typeAnnotation&&h.push(e.call(r,"typeAnnotation")),(0,u.concat)(h);case"PropertyPattern":return(0,u.concat)([e.call(r,"key"),": ",e.call(r,"pattern")]);case"ObjectProperty":case"Property":if(c.method||"get"===c.kind||"set"===c.kind)return S(e,t,r);if(c.shorthand&&"AssignmentPattern"===c.value.type)return e.call(r,"value");var G=e.call(r,"key");return c.computed?h.push("[",G,"]"):h.push(G),c.shorthand&&c.key.name===c.value.name||h.push(": ",e.call(r,"value")),(0,u.concat)(h);case"ClassMethod":case"ObjectMethod":case"ClassPrivateMethod":case"TSDeclareMethod":return S(e,t,r);case"PrivateName":return(0,u.concat)(["#",e.call(r,"id")]);case"Decorator":return(0,u.concat)(["@",e.call(r,"expression")]);case"TupleExpression":h.push("#");case"ArrayExpression":case"ArrayPattern":var K=c.elements.length,H=e.map(r,"elements"),$=(0,u.fromString)(", ").join(H).getLineLength(1)<=t.wrapColumn;return $?t.arrayBracketSpacing?h.push("[ "):h.push("["):h.push("[\n"),e.each(function(e){var r=e.getName();if(e.getValue()){var n=H[r];$?r>0&&h.push(" "):n=n.indent(t.tabWidth),h.push(n),(r1?h.push((0,u.fromString)(",\n").join(Z).indentTail(c.kind.length+1)):h.push(Z[0]);var Q=e.getParentNode();return f.ForStatement.check(Q)||f.ForInStatement.check(Q)||f.ForOfStatement&&f.ForOfStatement.check(Q)||f.ForAwaitStatement&&f.ForAwaitStatement.check(Q)||h.push(";"),(0,u.concat)(h);case"VariableDeclarator":return c.init?(0,u.fromString)(" = ").join([e.call(r,"id"),e.call(r,"init")]):e.call(r,"id");case"WithStatement":return(0,u.concat)(["with (",e.call(r,"object"),") ",e.call(r,"body")]);case"IfStatement":var ee=C(e.call(r,"consequent"),t);return h.push("if (",e.call(r,"test"),")",ee),c.alternate&&h.push(P(ee)?" else":"\nelse",C(e.call(r,"alternate"),t)),(0,u.concat)(h);case"ForStatement":var te=e.call(r,"init"),re=te.length>1?";\n":"; ",ne="for (",ie=(0,u.fromString)(re).join([te,e.call(r,"test"),e.call(r,"update")]).indentTail(ne.length),ae=(0,u.concat)([ne,ie,")"]),oe=C(e.call(r,"body"),t);return h.push(ae),ae.length>1&&(h.push("\n"),oe=oe.trimLeft()),h.push(oe),(0,u.concat)(h);case"WhileStatement":return(0,u.concat)(["while (",e.call(r,"test"),")",C(e.call(r,"body"),t)]);case"ForInStatement":return(0,u.concat)([c.each?"for each (":"for (",e.call(r,"left")," in ",e.call(r,"right"),")",C(e.call(r,"body"),t)]);case"ForOfStatement":case"ForAwaitStatement":return h.push("for "),(c.await||"ForAwaitStatement"===c.type)&&h.push("await "),h.push("(",e.call(r,"left")," of ",e.call(r,"right"),")",C(e.call(r,"body"),t)),(0,u.concat)(h);case"DoWhileStatement":var se=(0,u.concat)(["do",C(e.call(r,"body"),t)]);return h.push(se),P(se)?h.push(" while"):h.push("\nwhile"),h.push(" (",e.call(r,"test"),");"),(0,u.concat)(h);case"DoExpression":var ue=e.call(function(e){return b(e,t,r)},"body");return(0,u.concat)(["do {\n",ue.indent(t.tabWidth),"\n}"]);case"BreakStatement":return h.push("break"),c.label&&h.push(" ",e.call(r,"label")),h.push(";"),(0,u.concat)(h);case"ContinueStatement":return h.push("continue"),c.label&&h.push(" ",e.call(r,"label")),h.push(";"),(0,u.concat)(h);case"LabeledStatement":return(0,u.concat)([e.call(r,"label"),":\n",e.call(r,"body")]);case"TryStatement":return h.push("try ",e.call(r,"block")),c.handler?h.push(" ",e.call(r,"handler")):c.handlers&&e.each(function(e){h.push(" ",r(e))},"handlers"),c.finalizer&&h.push(" finally ",e.call(r,"finalizer")),(0,u.concat)(h);case"CatchClause":return h.push("catch "),c.param&&h.push("(",e.call(r,"param")),c.guard&&h.push(" if ",e.call(r,"guard")),c.param&&h.push(") "),h.push(e.call(r,"body")),(0,u.concat)(h);case"ThrowStatement":return(0,u.concat)(["throw ",e.call(r,"argument"),";"]);case"SwitchStatement":return(0,u.concat)(["switch (",e.call(r,"discriminant"),") {\n",(0,u.fromString)("\n").join(e.map(r,"cases")),"\n}"]);case"SwitchCase":return c.test?h.push("case ",e.call(r,"test"),":"):h.push("default:"),c.consequent.length>0&&h.push("\n",e.call(function(e){return b(e,t,r)},"consequent").indent(t.tabWidth)),(0,u.concat)(h);case"DebuggerStatement":return(0,u.fromString)("debugger;");case"JSXAttribute":return h.push(e.call(r,"name")),c.value&&h.push("=",e.call(r,"value")),(0,u.concat)(h);case"JSXIdentifier":return(0,u.fromString)(c.name,t);case"JSXNamespacedName":return(0,u.fromString)(":").join([e.call(r,"namespace"),e.call(r,"name")]);case"JSXMemberExpression":return(0,u.fromString)(".").join([e.call(r,"object"),e.call(r,"property")]);case"JSXSpreadAttribute":return(0,u.concat)(["{...",e.call(r,"argument"),"}"]);case"JSXSpreadChild":return(0,u.concat)(["{...",e.call(r,"expression"),"}"]);case"JSXExpressionContainer":return(0,u.concat)(["{",e.call(r,"expression"),"}"]);case"JSXElement":case"JSXFragment":var le="opening"+("JSXElement"===c.type?"Element":"Fragment"),ce="closing"+("JSXElement"===c.type?"Element":"Fragment"),pe=e.call(r,le);if(c[le].selfClosing)return(0,i.default)(!c[ce],"unexpected "+ce+" element in self-closing "+c.type),pe;var fe=(0,u.concat)(e.map(function(e){var t=e.getValue();if(f.Literal.check(t)&&"string"==typeof t.value){if(/\S/.test(t.value))return t.value.replace(/^\s+/g,"");if(/\n/.test(t.value))return"\n"}return r(e)},"children")).indentTail(t.tabWidth),he=e.call(r,ce);return(0,u.concat)([pe,fe,he]);case"JSXOpeningElement":h.push("<",e.call(r,"name"));var de=e.call(r,"typeParameters");de.length&&h.push(de);var me=[];e.each(function(e){me.push(" ",r(e))},"attributes");var ye=(0,u.concat)(me);return(ye.length>1||ye.getLineLength(1)>t.wrapColumn)&&(me.forEach(function(e,t){" "===e&&((0,i.default)(t%2==0),me[t]="\n")}),ye=(0,u.concat)(me).indentTail(t.tabWidth)),h.push(ye,c.selfClosing?" />":">"),(0,u.concat)(h);case"JSXClosingElement":return(0,u.concat)([""]);case"JSXOpeningFragment":return(0,u.fromString)("<>");case"JSXClosingFragment":return(0,u.fromString)("");case"JSXText":return(0,u.fromString)(c.value,t);case"JSXEmptyExpression":return(0,u.fromString)("");case"TypeAnnotatedIdentifier":return(0,u.concat)([e.call(r,"annotation")," ",e.call(r,"identifier")]);case"ClassBody":return 0===c.body.length?(0,u.fromString)("{}"):(0,u.concat)(["{\n",e.call(function(e){return b(e,t,r)},"body").indent(t.tabWidth),"\n}"]);case"ClassPropertyDefinition":return h.push("static ",e.call(r,"definition")),f.MethodDefinition.check(c.definition)||h.push(";"),(0,u.concat)(h);case"ClassProperty":c.declare&&h.push("declare ");var ge=c.accessibility||c.access;"string"==typeof ge&&h.push(ge," "),c.static&&h.push("static "),c.abstract&&h.push("abstract "),c.readonly&&h.push("readonly ");G=e.call(r,"key");return c.computed&&(G=(0,u.concat)(["[",G,"]"])),c.variance&&(G=(0,u.concat)([k(e,r),G])),h.push(G),c.optional&&h.push("?"),c.definite&&h.push("!"),c.typeAnnotation&&h.push(e.call(r,"typeAnnotation")),c.value&&h.push(" = ",e.call(r,"value")),h.push(";"),(0,u.concat)(h);case"ClassPrivateProperty":return c.static&&h.push("static "),h.push(e.call(r,"key")),c.typeAnnotation&&h.push(e.call(r,"typeAnnotation")),c.value&&h.push(" = ",e.call(r,"value")),h.push(";"),(0,u.concat)(h);case"ClassAccessorProperty":return h.push.apply(h,n.__spreadArray(n.__spreadArray([],x(c),!1),["accessor "],!1)),c.computed?h.push("[",e.call(r,"key"),"]"):h.push(e.call(r,"key")),c.optional&&h.push("?"),c.definite&&h.push("!"),c.typeAnnotation&&h.push(e.call(r,"typeAnnotation")),c.value&&h.push(" = ",e.call(r,"value")),h.push(";"),(0,u.concat)(h);case"ClassDeclaration":case"ClassExpression":case"DeclareClass":return c.declare&&h.push("declare "),c.abstract&&h.push("abstract "),h.push("class"),c.id&&h.push(" ",e.call(r,"id")),c.typeParameters&&h.push(e.call(r,"typeParameters")),c.superClass&&h.push(" extends ",e.call(r,"superClass"),e.call(r,"superTypeParameters")),c.extends&&c.extends.length>0&&h.push(" extends ",(0,u.fromString)(", ").join(e.map(r,"extends"))),c.implements&&c.implements.length>0&&h.push(" implements ",(0,u.fromString)(", ").join(e.map(r,"implements"))),h.push(" ",e.call(r,"body")),"DeclareClass"===c.type?D(e,h):(0,u.concat)(h);case"TemplateElement":return(0,u.fromString)(c.value.raw,t).lockIndentTail();case"TemplateLiteral":var ve=e.map(r,"expressions");return h.push("`"),e.each(function(e){var t=e.getName();h.push(r(e)),t0&&h.push(" "):n=n.indent(t.tabWidth),h.push(n),(r0&&h.push(" extends ",(0,u.fromString)(", ").join(e.map(r,"extends"))),h.push(" ",e.call(r,"body")),(0,u.concat)(h);case"DeclareFunction":return D(e,["function ",e.call(r,"id"),";"]);case"DeclareModule":return D(e,["module ",e.call(r,"id")," ",e.call(r,"body")]);case"DeclareModuleExports":return D(e,["module.exports",e.call(r,"typeAnnotation")]);case"DeclareVariable":return D(e,["var ",e.call(r,"id"),";"]);case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return(0,u.concat)(["declare ",A(e,t,r)]);case"EnumDeclaration":return(0,u.concat)(["enum ",e.call(r,"id"),e.call(r,"body")]);case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":return("EnumSymbolBody"===c.type||c.explicitType)&&h.push(" of ",c.type.slice(4,-4).toLowerCase()),h.push(" {\n",(0,u.fromString)("\n").join(e.map(r,"members")).indent(t.tabWidth),"\n}"),(0,u.concat)(h);case"EnumDefaultedMember":return(0,u.concat)([e.call(r,"id"),","]);case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":return(0,u.concat)([e.call(r,"id")," = ",e.call(r,"init"),","]);case"InferredPredicate":return(0,u.fromString)("%checks",t);case"DeclaredPredicate":return(0,u.concat)(["%checks(",e.call(r,"value"),")"]);case"FunctionTypeAnnotation":var Se=e.getParentNode(0),Ee=!(f.ObjectTypeCallProperty.check(Se)||f.ObjectTypeInternalSlot.check(Se)&&Se.method||f.DeclareFunction.check(e.getParentNode(2)));Ee&&!f.FunctionTypeParam.check(Se)&&!f.TypeAlias.check(Se)&&h.push(": ");var _e=!!c.typeParameters,we=_e||1!==c.params.length||c.params[0].name;return h.push(_e?e.call(r,"typeParameters"):"",we?"(":"",_(e,t,r),we?")":""),c.returnType&&h.push(Ee?" => ":": ",e.call(r,"returnType")),(0,u.concat)(h);case"FunctionTypeParam":var Ae=e.call(r,"name");return h.push(Ae),c.optional&&h.push("?"),Ae.infos[0].line&&h.push(": "),h.push(e.call(r,"typeAnnotation")),(0,u.concat)(h);case"GenericTypeAnnotation":return(0,u.concat)([e.call(r,"id"),e.call(r,"typeParameters")]);case"DeclareInterface":h.push("declare ");case"InterfaceDeclaration":case"TSInterfaceDeclaration":return c.declare&&h.push("declare "),h.push("interface ",e.call(r,"id"),e.call(r,"typeParameters")," "),c.extends&&c.extends.length>0&&h.push("extends ",(0,u.fromString)(", ").join(e.map(r,"extends"))," "),c.body&&h.push(e.call(r,"body")),(0,u.concat)(h);case"ClassImplements":case"InterfaceExtends":return(0,u.concat)([e.call(r,"id"),e.call(r,"typeParameters")]);case"IntersectionTypeAnnotation":return(0,u.fromString)(" & ").join(e.map(r,"types"));case"NullableTypeAnnotation":return(0,u.concat)(["?",e.call(r,"typeAnnotation")]);case"NullLiteralTypeAnnotation":return(0,u.fromString)("null",t);case"ThisTypeAnnotation":return(0,u.fromString)("this",t);case"NumberTypeAnnotation":return(0,u.fromString)("number",t);case"ObjectTypeCallProperty":return e.call(r,"value");case"ObjectTypeIndexer":return c.static&&h.push("static "),h.push(k(e,r),"["),c.id&&h.push(e.call(r,"id"),": "),h.push(e.call(r,"key"),"]: ",e.call(r,"value")),(0,u.concat)(h);case"ObjectTypeProperty":return(0,u.concat)([k(e,r),e.call(r,"key"),c.optional?"?":"",": ",e.call(r,"value")]);case"ObjectTypeInternalSlot":return(0,u.concat)([c.static?"static ":"","[[",e.call(r,"id"),"]]",c.optional?"?":"","FunctionTypeAnnotation"!==c.value.type?": ":"",e.call(r,"value")]);case"QualifiedTypeIdentifier":return(0,u.concat)([e.call(r,"qualification"),".",e.call(r,"id")]);case"StringLiteralTypeAnnotation":return(0,u.fromString)(I(c.value,t),t);case"NumberLiteralTypeAnnotation":case"NumericLiteralTypeAnnotation":return(0,i.default)("number"==typeof c.value),(0,u.fromString)(JSON.stringify(c.value),t);case"BigIntLiteralTypeAnnotation":return(0,u.fromString)(c.raw,t);case"StringTypeAnnotation":return(0,u.fromString)("string",t);case"DeclareTypeAlias":h.push("declare ");case"TypeAlias":return(0,u.concat)(["type ",e.call(r,"id"),e.call(r,"typeParameters")," = ",e.call(r,"right"),";"]);case"DeclareOpaqueType":h.push("declare ");case"OpaqueType":return h.push("opaque type ",e.call(r,"id"),e.call(r,"typeParameters")),c.supertype&&h.push(": ",e.call(r,"supertype")),c.impltype&&h.push(" = ",e.call(r,"impltype")),h.push(";"),(0,u.concat)(h);case"TypeCastExpression":return(0,u.concat)(["(",e.call(r,"expression"),e.call(r,"typeAnnotation"),")"]);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return(0,u.concat)(["<",(0,u.fromString)(", ").join(e.map(r,"params")),">"]);case"Variance":return"plus"===c.kind?(0,u.fromString)("+"):"minus"===c.kind?(0,u.fromString)("-"):(0,u.fromString)("");case"TypeParameter":return c.variance&&h.push(k(e,r)),h.push(e.call(r,"name")),c.bound&&h.push(e.call(r,"bound")),c.default&&h.push("=",e.call(r,"default")),(0,u.concat)(h);case"TypeofTypeAnnotation":return(0,u.concat)([(0,u.fromString)("typeof ",t),e.call(r,"argument")]);case"IndexedAccessType":case"OptionalIndexedAccessType":return(0,u.concat)([e.call(r,"objectType"),c.optional?"?.":"","[",e.call(r,"indexType"),"]"]);case"UnionTypeAnnotation":return(0,u.fromString)(" | ").join(e.map(r,"types"));case"VoidTypeAnnotation":return(0,u.fromString)("void",t);case"NullTypeAnnotation":return(0,u.fromString)("null",t);case"SymbolTypeAnnotation":return(0,u.fromString)("symbol",t);case"BigIntTypeAnnotation":return(0,u.fromString)("bigint",t);case"TSType":throw new Error("unprintable type: "+JSON.stringify(c.type));case"TSNumberKeyword":return(0,u.fromString)("number",t);case"TSBigIntKeyword":return(0,u.fromString)("bigint",t);case"TSObjectKeyword":return(0,u.fromString)("object",t);case"TSBooleanKeyword":return(0,u.fromString)("boolean",t);case"TSStringKeyword":return(0,u.fromString)("string",t);case"TSSymbolKeyword":return(0,u.fromString)("symbol",t);case"TSAnyKeyword":return(0,u.fromString)("any",t);case"TSVoidKeyword":return(0,u.fromString)("void",t);case"TSIntrinsicKeyword":return(0,u.fromString)("intrinsic",t);case"TSThisType":return(0,u.fromString)("this",t);case"TSNullKeyword":return(0,u.fromString)("null",t);case"TSUndefinedKeyword":return(0,u.fromString)("undefined",t);case"TSUnknownKeyword":return(0,u.fromString)("unknown",t);case"TSNeverKeyword":return(0,u.fromString)("never",t);case"TSArrayType":return(0,u.concat)([e.call(r,"elementType"),"[]"]);case"TSLiteralType":return e.call(r,"literal");case"TSUnionType":return(0,u.fromString)(" | ").join(e.map(r,"types"));case"TSIntersectionType":return(0,u.fromString)(" & ").join(e.map(r,"types"));case"TSConditionalType":return h.push(e.call(r,"checkType")," extends ",e.call(r,"extendsType")," ? ",e.call(r,"trueType")," : ",e.call(r,"falseType")),(0,u.concat)(h);case"TSInferType":return h.push("infer ",e.call(r,"typeParameter")),(0,u.concat)(h);case"TSParenthesizedType":return(0,u.concat)(["(",e.call(r,"typeAnnotation"),")"]);case"TSFunctionType":return(0,u.concat)([e.call(r,"typeParameters"),"(",_(e,t,r),") => ",e.call(r,"typeAnnotation","typeAnnotation")]);case"TSConstructorType":return(0,u.concat)(["new ",e.call(r,"typeParameters"),"(",_(e,t,r),") => ",e.call(r,"typeAnnotation","typeAnnotation")]);case"TSMappedType":return h.push(c.readonly?"readonly ":"","[",e.call(r,"typeParameter"),"]",c.optional?"?":""),c.typeAnnotation&&h.push(": ",e.call(r,"typeAnnotation"),";"),(0,u.concat)(["{\n",(0,u.concat)(h).indent(t.tabWidth),"\n}"]);case"TSTupleType":return(0,u.concat)(["[",(0,u.fromString)(", ").join(e.map(r,"elementTypes")),"]"]);case"TSNamedTupleMember":return h.push(e.call(r,"label")),c.optional&&h.push("?"),h.push(": ",e.call(r,"elementType")),(0,u.concat)(h);case"TSRestType":return(0,u.concat)(["...",e.call(r,"typeAnnotation")]);case"TSOptionalType":return(0,u.concat)([e.call(r,"typeAnnotation"),"?"]);case"TSIndexedAccessType":return(0,u.concat)([e.call(r,"objectType"),"[",e.call(r,"indexType"),"]"]);case"TSTypeOperator":return(0,u.concat)([e.call(r,"operator")," ",e.call(r,"typeAnnotation")]);case"TSTypeLiteral":var De=(0,u.fromString)("\n").join(e.map(r,"members").map(function(e){return";"!==T(e)?e.concat(";"):e}));return De.isEmpty()?(0,u.fromString)("{}",t):(h.push("{\n",De.indent(t.tabWidth),"\n}"),(0,u.concat)(h));case"TSEnumMember":return h.push(e.call(r,"id")),c.initializer&&h.push(" = ",e.call(r,"initializer")),(0,u.concat)(h);case"TSTypeQuery":return(0,u.concat)(["typeof ",e.call(r,"exprName")]);case"TSParameterProperty":return c.accessibility&&h.push(c.accessibility," "),c.export&&h.push("export "),c.static&&h.push("static "),c.readonly&&h.push("readonly "),h.push(e.call(r,"parameter")),(0,u.concat)(h);case"TSTypeReference":return(0,u.concat)([e.call(r,"typeName"),e.call(r,"typeParameters")]);case"TSQualifiedName":return(0,u.concat)([e.call(r,"left"),".",e.call(r,"right")]);case"TSAsExpression":case"TSSatisfiesExpression":var ke=e.call(r,"expression");return h.push(ke,"TSSatisfiesExpression"===c.type?" satisfies ":" as ",e.call(r,"typeAnnotation")),(0,u.concat)(h);case"TSTypeCastExpression":return(0,u.concat)([e.call(r,"expression"),e.call(r,"typeAnnotation")]);case"TSNonNullExpression":return(0,u.concat)([e.call(r,"expression"),"!"]);case"TSTypeAnnotation":return(0,u.concat)([": ",e.call(r,"typeAnnotation")]);case"TSIndexSignature":return(0,u.concat)([c.readonly?"readonly ":"","[",e.map(r,"parameters"),"]",e.call(r,"typeAnnotation")]);case"TSPropertySignature":return h.push(k(e,r),c.readonly?"readonly ":""),c.computed?h.push("[",e.call(r,"key"),"]"):h.push(e.call(r,"key")),h.push(c.optional?"?":"",e.call(r,"typeAnnotation")),(0,u.concat)(h);case"TSMethodSignature":return"get"===c.kind?h.push("get "):"set"===c.kind&&h.push("set "),c.computed?h.push("[",e.call(r,"key"),"]"):h.push(e.call(r,"key")),c.optional&&h.push("?"),h.push(e.call(r,"typeParameters"),"(",_(e,t,r),")",e.call(r,"typeAnnotation")),(0,u.concat)(h);case"TSTypePredicate":return c.asserts&&h.push("asserts "),h.push(e.call(r,"parameterName")),c.typeAnnotation&&h.push(" is ",e.call(r,"typeAnnotation","typeAnnotation")),(0,u.concat)(h);case"TSCallSignatureDeclaration":return(0,u.concat)([e.call(r,"typeParameters"),"(",_(e,t,r),")",e.call(r,"typeAnnotation")]);case"TSConstructSignatureDeclaration":return c.typeParameters?h.push("new",e.call(r,"typeParameters")):h.push("new "),h.push("(",_(e,t,r),")",e.call(r,"typeAnnotation")),(0,u.concat)(h);case"TSTypeAliasDeclaration":return(0,u.concat)([c.declare?"declare ":"","type ",e.call(r,"id"),e.call(r,"typeParameters")," = ",e.call(r,"typeAnnotation"),";"]);case"TSTypeParameter":h.push(e.call(r,"name"));Se=e.getParentNode(0);var Ce=f.TSMappedType.check(Se);return c.constraint&&h.push(Ce?" in ":" extends ",e.call(r,"constraint")),c.default&&h.push(" = ",e.call(r,"default")),(0,u.concat)(h);case"TSTypeAssertion":return h.push("<",e.call(r,"typeAnnotation"),"> ",e.call(r,"expression")),(0,u.concat)(h);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return(0,u.concat)(["<",(0,u.fromString)(", ").join(e.map(r,"params")),">"]);case"TSEnumDeclaration":h.push(c.declare?"declare ":"",c.const?"const ":"","enum ",e.call(r,"id"));var Te=(0,u.fromString)(",\n").join(e.map(r,"members"));return Te.isEmpty()?h.push(" {}"):h.push(" {\n",Te.indent(t.tabWidth),"\n}"),(0,u.concat)(h);case"TSExpressionWithTypeArguments":return(0,u.concat)([e.call(r,"expression"),e.call(r,"typeParameters")]);case"TSInterfaceBody":var Pe;return(Pe=(0,u.fromString)("\n").join(e.map(r,"body").map(function(e){return";"!==T(e)?e.concat(";"):e}))).isEmpty()?(0,u.fromString)("{}",t):(0,u.concat)(["{\n",Pe.indent(t.tabWidth),"\n}"]);case"TSImportType":return h.push("import(",e.call(r,"argument"),")"),c.qualifier&&h.push(".",e.call(r,"qualifier")),c.typeParameters&&h.push(e.call(r,"typeParameters")),(0,u.concat)(h);case"TSImportEqualsDeclaration":return c.isExport&&h.push("export "),h.push("import ",e.call(r,"id")," = ",e.call(r,"moduleReference")),N((0,u.concat)(h));case"TSExternalModuleReference":return(0,u.concat)(["require(",e.call(r,"expression"),")"]);case"TSModuleDeclaration":if("TSModuleDeclaration"===(Se=e.getParentNode()).type)h.push(".");else if(c.declare&&h.push("declare "),!c.global)if("StringLiteral"===c.id.type||"Literal"===c.id.type&&"string"==typeof c.id.value)h.push("module ");else if(c.loc&&c.loc.lines&&c.id.loc){c.loc.lines.sliceString(c.loc.start,c.id.loc.start).indexOf("module")>=0?h.push("module "):h.push("namespace ")}else h.push("namespace ");return h.push(e.call(r,"id")),c.body&&(h.push(" "),h.push(e.call(r,"body"))),(0,u.concat)(h);case"TSModuleBlock":var Oe=e.call(function(e){return b(e,t,r)},"body");return Oe.isEmpty()?h.push("{}"):h.push("{\n",Oe.indent(t.tabWidth),"\n}"),(0,u.concat)(h);case"TSInstantiationExpression":return h.push(e.call(r,"expression"),e.call(r,"typeParameters")),(0,u.concat)(h);case"V8IntrinsicIdentifier":return(0,u.concat)(["%",e.call(r,"name")]);case"TopicReference":return(0,u.fromString)("#");default:throw new Error("unknown type: "+JSON.stringify(c.type))}}(e,t,o);if(!l||h.isEmpty())return h;var d=!1,m=function(e,t){var r=[],n=e.getValue();n.decorators&&n.decorators.length>0&&!p.getParentExportDeclaration(e)?e.each(function(e){r.push(t(e),"\n")},"decorators"):p.isExportDeclaration(n)&&n.declaration&&n.declaration.decorators&&e.each(function(e){r.push(t(e),"\n")},"declaration","decorators");return(0,u.concat)(r)}(e,o);return m.isEmpty()?r.avoidRootParens||(d=e.needsParens()):c.push(m),d&&c.unshift("("),c.push(h),d&&c.push(")"),(0,u.concat)(c)}function b(e,t,r){var n=[],a=!1,o=!1;e.each(function(e){var t=e.getValue();t&&("EmptyStatement"!==t.type||t.comments&&t.comments.length>0)&&(f.Comment.check(t)?a=!0:f.Statement.check(t)?o=!0:h.assert(t),n.push({node:t,printed:r(e)}))}),a&&(0,i.default)(!1===o,"Comments may appear as statements in otherwise empty statement lists, but may not coexist with non-Comment nodes.");var s=null,l=n.length,c=[];return n.forEach(function(e,r){var n,i,a=e.printed,o=e.node,f=a.length>1,h=r>0,d=rr.length)return n;return r}(s,n),a),d?s=i:i&&c.push(i)}),(0,u.concat)(c)}function x(e){var t=[];e.declare&&t.push("declare ");var r=e.accessibility||e.access;return"string"==typeof r&&t.push(r," "),e.static&&t.push("static "),e.override&&t.push("override "),e.abstract&&t.push("abstract "),e.readonly&&t.push("readonly "),t}function S(e,t,r){var n=e.getNode(),i=n.kind,a=[],o=n.value;f.FunctionExpression.check(o)||(o=n),a.push.apply(a,x(n)),o.async&&a.push("async "),o.generator&&a.push("*"),"get"!==i&&"set"!==i||a.push(i," ");var s=e.call(r,"key");return n.computed&&(s=(0,u.concat)(["[",s,"]"])),a.push(s),n.optional&&a.push("?"),n===o?(a.push(e.call(r,"typeParameters"),"(",_(e,t,r),")",e.call(r,"returnType")),n.body?a.push(" ",e.call(r,"body")):a.push(";")):(a.push(e.call(r,"value","typeParameters"),"(",e.call(function(e){return _(e,t,r)},"value"),")",e.call(r,"value","returnType")),o.body?a.push(" ",e.call(r,"value","body")):a.push(";")),(0,u.concat)(a)}function E(e,t,r){var n=e.map(r,"arguments"),i=p.isTrailingCommaEnabled(t,"parameters"),a=(0,u.fromString)(", ").join(n);return a.getLineLength(1)>t.wrapColumn?(a=(0,u.fromString)(",\n").join(n),(0,u.concat)(["(\n",a.indent(t.tabWidth),i?",\n)":"\n)"])):(0,u.concat)(["(",a,")"])}function _(e,t,r){var n,i=e.getValue(),a=[];i.params?(n=i.params,a=e.map(r,"params")):i.parameters&&(n=i.parameters,a=e.map(r,"parameters")),i.defaults&&e.each(function(e){var t=e.getName(),n=a[t];n&&e.getValue()&&(a[t]=(0,u.concat)([n," = ",r(e)]))},"defaults"),i.rest&&a.push((0,u.concat)(["...",e.call(r,"rest")]));var o=(0,u.fromString)(", ").join(a);return o.length>1||o.getLineLength(1)>t.wrapColumn?(o=(0,u.fromString)(",\n").join(a),o=p.isTrailingCommaEnabled(t,"parameters")&&!i.rest&&"RestElement"!==n[n.length-1].type?(0,u.concat)([o,",\n"]):(0,u.concat)([o,"\n"]),(0,u.concat)(["\n",o.indent(t.tabWidth)])):o}function w(e,t,r){var n=e.getValue();if(n.assertions&&n.assertions.length>0){var i=[" assert {"],a=e.map(r,"assertions"),o=(0,u.fromString)(", ").join(a);return o.length>1||o.getLineLength(1)>t.wrapColumn?i.push("\n",(0,u.fromString)(",\n").join(a).indent(t.tabWidth),"\n}"):i.push(" ",o," }"),(0,u.concat)(i)}return(0,u.fromString)("")}function A(e,t,r){var n=e.getValue(),i=["export "];n.exportKind&&"type"===n.exportKind&&(n.declaration||i.push("type "));var a=t.objectCurlySpacing;if(f.Declaration.assert(n),(n.default||"ExportDefaultDeclaration"===n.type)&&i.push("default "),n.declaration)i.push(e.call(r,"declaration"));else if(n.specifiers){if(1===n.specifiers.length&&"ExportBatchSpecifier"===n.specifiers[0].type)i.push("*");else if(0===n.specifiers.length)i.push("{}");else if("ExportDefaultSpecifier"===n.specifiers[0].type||"ExportNamespaceSpecifier"===n.specifiers[0].type){var o=[],s=[];if(e.each(function(e){var t=e.getValue();"ExportDefaultSpecifier"===t.type||"ExportNamespaceSpecifier"===t.type?o.push(r(e)):s.push(r(e))},"specifiers"),o.forEach(function(e,t){t>0&&i.push(", "),i.push(e)}),s.length>0){var l=(0,u.fromString)(", ").join(s);l.getLineLength(1)>t.wrapColumn&&(l=(0,u.concat)([(0,u.fromString)(",\n").join(s).indent(t.tabWidth),","])),o.length>0&&i.push(", "),l.length>1?i.push("{\n",l,"\n}"):t.objectCurlySpacing?i.push("{ ",l," }"):i.push("{",l,"}")}}else i.push(a?"{ ":"{",(0,u.fromString)(", ").join(e.map(r,"specifiers")),a?" }":"}");n.source&&i.push(" from ",e.call(r,"source"),w(e,t,r))}var c=(0,u.concat)(i);return";"===T(c)||n.declaration&&("FunctionDeclaration"===n.declaration.type||"ClassDeclaration"===n.declaration.type||"TSModuleDeclaration"===n.declaration.type||"TSInterfaceDeclaration"===n.declaration.type||"TSEnumDeclaration"===n.declaration.type)||(c=(0,u.concat)([c,";"])),c}function D(e,t){var r=p.getParentExportDeclaration(e);return r?(0,i.default)("DeclareExportDeclaration"===r.type):t.unshift("declare "),(0,u.concat)(t)}function k(e,t){return e.call(function(e){var r=e.getValue();return r?"plus"===r?(0,u.fromString)("+"):"minus"===r?(0,u.fromString)("-"):t(e):(0,u.fromString)("")},"variance")}function C(e,t){return e.length>1?(0,u.concat)([" ",e]):(0,u.concat)(["\n",N(e).indent(t.tabWidth)])}function T(e){var t=e.lastPos();do{var r=e.charAt(t);if(/\S/.test(r))return r}while(e.prevPos(t))}function P(e){return"}"===T(e)}function O(e){return e.replace(/['"]/g,function(e){return'"'===e?"'":'"'})}function j(e){var t=a.getFieldValue(e,"value"),r=a.getFieldValue(e,"extra");if(r&&"string"==typeof r.raw&&t==r.rawValue)return r.raw;if("Literal"===e.type){var n=e.raw;if("string"==typeof n&&t==n)return n}}function F(e){return JSON.stringify(e).replace(/[\u2028\u2029]/g,function(e){return"\\u"+e.charCodeAt(0).toString(16)})}function I(e,t){switch(h.assert(e),t.quote){case"auto":var r=F(e),n=O(F(O(e)));return r.length>n.length?n:r;case"single":return O(F(O(e)));default:return F(e)}}function N(e){var t=T(e);return!t||"\n};".indexOf(t)<0?(0,u.concat)([e,";"]):e}t.Printer=function e(t){(0,i.default)(this instanceof e);var r=t&&t.tabWidth;function n(e,t){return e=Object.assign({},e,t),function(t){return a(t,e)}}function a(e,u){if((0,i.default)(e instanceof s.default),(u=u||{}).includeComments)return(0,o.printComments)(e,n(u,{includeComments:!1}));var l=t.tabWidth;if(!r){var p=e.getNode().loc;p&&p.lines&&p.lines.guessTabWidth&&(t.tabWidth=p.lines.guessTabWidth())}var f=(0,c.getReprinter)(e),h=f?f(a):v(e,t,u,n(u,{includeComments:!0,avoidRootParens:!1}));return t.tabWidth=l,h}(t=(0,l.normalize)(t)).sourceFileName=null,this.print=function(e){if(!e)return g;var r=a(s.default.from(e),{includeComments:!0,avoidRootParens:!1});return new m(r.toString(t),p.composeSourceMaps(t.inputSourceMap,r.getSourceMap(t.sourceMapName,t.sourceRoot)))},this.printGenerically=function(e){if(!e)return g;var r=s.default.from(e),n=t.reuseWhitespace;t.reuseWhitespace=!1;var i=new m(function e(r){return(0,o.printComments)(r,function(r){return v(r,t,{includeComments:!0,avoidRootParens:!1},e)})}(r).toString(t));return t.reuseWhitespace=n,i}}},87372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return f(e)||function(e){if(!e)return!1;return o(o({},e),{},{operator:d(e.operator)})}(h(e))},t.isZero=t.isMinusOne=void 0;var n=r(25065);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<]/,function(e){return">"===e?"<":">"})}},87675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(25065),a=(n=r(51720))&&n.__esModule?n:{default:n};var o=(0,i.matches)({type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:a.default,right:(0,i.extractAny)("value")}});t.default=o},88543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(44480),a=(n=r(63437))&&n.__esModule?n:{default:n};var o={keys:{JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXOpeningElement:["name","attributes"],JSXClosingElement:["name"],JSXOpeningFragment:[],JSXClosingFragment:[],JSXAttribute:["name","value"],JSXSpreadAttribute:["argument"],JSXElement:["openingElement","closingElement","children"],JSXFragment:["openingFragment","closingFragment","children"],JSXText:[]}},s={traverse:function(e,t){return a.default.traverse(e,Object.assign(t,o))},replace:function(e,t){return a.default.replace(e,Object.assign(t,o))},VisitorOption:a.default.VisitorOption,find:function(e,t){var r,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).skipTypes,o=void 0===n?[]:n,s=this.createFindPredicate(t);return this.traverse(e,{enter:function(e,t){return(0,i.includes)(e.type,o)?a.default.VisitorOption.Skip:s(e,t)?(r=e,a.default.VisitorOption.Break):void 0}}),r},createFindPredicate:function(e){return(0,i.isString)(e)?function(t){return t.type===e}:e}};t.default=s},89211:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},89353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n{t.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function i(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function a(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var r=e,n=i(e);if(n){if(!n.path)return e;r=n.path}for(var o,s=t.isAbsolute(r),u=r.split(/\/+/),l=0,c=u.length-1;c>=0;c--)"."===(o=u[c])?u.splice(c,1):".."===o?l++:l>0&&(""===o?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return""===(r=u.join("/"))&&(r=s?"/":"."),n?(n.path=r,a(n)):r}function s(e,t){""===e&&(e="."),""===t&&(t=".");var r=i(t),s=i(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),a(r);if(r||t.match(n))return t;if(s&&!s.host&&!s.path)return s.host=t,a(s);var u="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=u,a(s)):u}t.urlParse=i,t.urlGenerate=a,t.normalize=o,t.join=s,t.isAbsolute=function(e){return"/"===e.charAt(0)||r.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function l(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=u?l:function(e){return c(e)?"$"+e:e},t.fromSetString=u?l:function(e){return c(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,r){var n=p(e.source,t.source);return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=p(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,r){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),r){var n=i(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var u=n.path.lastIndexOf("/");u>=0&&(n.path=n.path.substring(0,u+1))}t=s(a(n),t)}return o(t)}},90857:(e,t,r)=>{var n=r(5471).SourceMapGenerator,i=r(90597),a=/(\r?\n)/,o="$$$isSourceNode$$$";function s(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[o]=!0,null!=n&&this.add(n)}s.fromStringWithSourceMap=function(e,t,r){var n=new s,o=e.split(a),u=0,l=function(){return e()+(e()||"");function e(){return u=0;t--)this.prepend(e[t]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},s.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r0){for(t=[],r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e,t),(0,i.default)(e,t)};var n=a(r(46516)),i=a(r(51775));function a(e){return e&&e.__esModule?e:{default:e}}},92464:(e,t,r)=>{"use strict";var n=r(38452),i=r(76642);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},93017:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(35302)),a=n.__importStar(r(64522)),o=n.__importDefault(r(33777));t.default=function(e){e.use(o.default);var t=e.use(i.default),r=t.Type,n=t.Type.def,s=r.or,u=e.use(a.default).defaults;n("AwaitExpression").build("argument","all").field("argument",s(n("Expression"),null)).field("all",Boolean,u.false),n("Decorator").bases("Node").build("expression").field("expression",n("Expression")),n("Property").field("decorators",s([n("Decorator")],null),u.null),n("MethodDefinition").field("decorators",s([n("Decorator")],null),u.null),n("PrivateName").bases("Expression","Pattern").build("id").field("id",n("Identifier")),n("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",n("PrivateName")).field("value",s(n("Expression"),null),u.null),n("ImportAttribute").bases("Node").build("key","value").field("key",s(n("Identifier"),n("Literal"))).field("value",n("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(function(e){n(e).field("assertions",[n("ImportAttribute")],u.emptyArray)}),n("RecordExpression").bases("Expression").build("properties").field("properties",[s(n("ObjectProperty"),n("ObjectMethod"),n("SpreadElement"))]),n("TupleExpression").bases("Expression").build("elements").field("elements",[s(n("Expression"),n("SpreadElement"),null)]),n("ModuleExpression").bases("Node").build("body").field("body",n("Program"))},(0,a.maybeSetModuleExports)(function(){return e})},93628:(e,t,r)=>{"use strict";var n=r(48648),i=r(71064),a=r(7176);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:a?function(e){return a(e)}:null},93784:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(42698)),a=n.__importDefault(r(28143)),o=r(64522);t.default=function(e){e.use(i.default),e.use(a.default)},(0,o.maybeSetModuleExports)(function(){return e})},94148:(e,t,r)=>{"use strict";var n=r(65606);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},96897:(e,t,r)=>{"use strict";var n=r(70453),i=r(30041),a=r(30592)(),o=r(75795),s=r(69675),u=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in e&&o){var c=o(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},97055:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=n.__importDefault(r(35302)),a=n.__importDefault(r(61567)),o=n.__importDefault(r(81893)),s=n.__importDefault(r(112)),u=n.__importDefault(r(31399)),l=r(64522);t.default=function(e){var t=function(){var e=[],t=[];function r(r){var i=e.indexOf(r);return-1===i&&(i=e.length,e.push(r),t[i]=r(n)),t[i]}var n={use:r};return n}(),r=t.use(i.default);e.forEach(t.use),r.finalize();var n=t.use(a.default);return{Type:r.Type,builtInTypes:r.builtInTypes,namedTypes:r.namedTypes,builders:r.builders,defineMethod:r.defineMethod,getFieldNames:r.getFieldNames,getFieldValue:r.getFieldValue,eachField:r.eachField,someField:r.someField,getSupertypeNames:r.getSupertypeNames,getBuilderName:r.getBuilderName,astNodesAreEquivalent:t.use(o.default),finalize:r.finalize,Path:t.use(s.default),NodePath:t.use(u.default),PathVisitor:n,use:t.use,visit:n.visit}},(0,l.maybeSetModuleExports)(function(){return e})},97316:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(64230),i=o(r(84120)),a=o(r(19727));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:[];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.transforms=t}var t,r,o;return t=e,(r=[{key:"run",value:function(e){var t=new a.default;return{code:this.applyAllTransforms(e,t),warnings:t.getWarnings()}}},{key:"applyAllTransforms",value:function(e,t){var r=this;return this.ignoringHashBangComment(e,function(a){var o=(0,n.parse)(a,{parser:i.default});return r.transforms.forEach(function(e){e(o.program,t)}),(0,n.print)(o,{lineTerminator:r.detectLineTerminator(e),objectCurlySpacing:!1}).code})}},{key:"ignoringHashBangComment",value:function(e,t){var r=u(e.match(/^(\s*#!.*?\r?\n|)([\s\S]*)$/),3);return r[1]+t(r[2])}},{key:"detectLineTerminator",value:function(e){var t=/\r\n/.test(e),r=/[^\r]\n/.test(e);return t&&!r?"\r\n":"\n"}}])&&c(t.prototype,r),o&&c(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=f},97399:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0});var n=r(31635),i=r(64522),a=n.__importDefault(r(35302)),o=Object.prototype.hasOwnProperty;t.default=function(e){var t=e.use(a.default),r=t.Type,n=t.namedTypes,i=n.Node,s=n.Expression,u=t.builtInTypes.array,l=t.builders,c=function e(t,r){if(!(this instanceof e))throw new Error("Scope constructor cannot be invoked without 'new'");var n;if(f.check(t.value)||p.assert(t.value),r){if(!(r instanceof e))throw new Error("");n=r.depth+1}else r=null,n=0;Object.defineProperties(this,{path:{value:t},node:{value:t.value},isGlobal:{value:!r,enumerable:!0},depth:{value:n},parent:{value:r},bindings:{value:{}},types:{value:{}}})},p=r.or(n.Program,n.Function,n.CatchClause),f=r.or(n.Function,n.ClassDeclaration,n.ClassExpression,n.InterfaceDeclaration,n.TSInterfaceDeclaration,n.TypeAlias,n.TSTypeAliasDeclaration),h=r.or(n.TypeParameter,n.TSTypeParameter);c.isEstablishedBy=function(e){return p.check(e)||f.check(e)};var d=c.prototype;function m(e,r,a){var o=e.value;e.parent&&n.FunctionExpression.check(e.parent.node)&&e.parent.node.id&&g(e.parent.get("id"),r),o&&(u.check(o)?e.each(function(e){y(e,r,a)}):n.Function.check(o)?(e.get("params").each(function(e){g(e,r)}),y(e.get("body"),r,a),m(e.get("typeParameters"),r,a)):n.TypeAlias&&n.TypeAlias.check(o)||n.InterfaceDeclaration&&n.InterfaceDeclaration.check(o)||n.TSTypeAliasDeclaration&&n.TSTypeAliasDeclaration.check(o)||n.TSInterfaceDeclaration&&n.TSInterfaceDeclaration.check(o)?v(e.get("id"),a):n.VariableDeclarator.check(o)?(g(e.get("id"),r),y(e.get("init"),r,a)):"ImportSpecifier"===o.type||"ImportNamespaceSpecifier"===o.type||"ImportDefaultSpecifier"===o.type?g(e.get(o.local?"local":o.name?"name":"id"),r):i.check(o)&&!s.check(o)&&t.eachField(o,function(t,n){var i=e.get(t);if(!function(e,t){if(e.value===t)return!0;if(Array.isArray(e.value)&&0===e.value.length&&Array.isArray(t)&&0===t.length)return!0;return!1}(i,n))throw new Error("");y(i,r,a)}))}function y(e,t,r){var i=e.value;if(!i||s.check(i));else if(n.FunctionDeclaration.check(i)&&null!==i.id)g(e.get("id"),t);else if(n.ClassDeclaration&&n.ClassDeclaration.check(i)&&null!==i.id)g(e.get("id"),t),m(e.get("typeParameters"),t,r);else if(n.InterfaceDeclaration&&n.InterfaceDeclaration.check(i)||n.TSInterfaceDeclaration&&n.TSInterfaceDeclaration.check(i))v(e.get("id"),r);else if(p.check(i)){if(n.CatchClause.check(i)&&n.Identifier.check(i.param)){var a=i.param.name,u=o.call(t,a);m(e.get("body"),t,r),u||delete t[a]}}else m(e,t,r)}function g(e,t){var r=e.value;n.Pattern.assert(r),n.Identifier.check(r)?o.call(t,r.name)?t[r.name].push(e):t[r.name]=[e]:n.AssignmentPattern&&n.AssignmentPattern.check(r)?g(e.get("left"),t):n.ObjectPattern&&n.ObjectPattern.check(r)?e.get("properties").each(function(e){var r=e.value;n.Pattern.check(r)?g(e,t):n.Property.check(r)||n.ObjectProperty&&n.ObjectProperty.check(r)?g(e.get("value"),t):n.SpreadProperty&&n.SpreadProperty.check(r)&&g(e.get("argument"),t)}):n.ArrayPattern&&n.ArrayPattern.check(r)?e.get("elements").each(function(e){var r=e.value;n.Pattern.check(r)?g(e,t):n.SpreadElement&&n.SpreadElement.check(r)&&g(e.get("argument"),t)}):n.PropertyPattern&&n.PropertyPattern.check(r)?g(e.get("pattern"),t):(n.SpreadElementPattern&&n.SpreadElementPattern.check(r)||n.RestElement&&n.RestElement.check(r)||n.SpreadPropertyPattern&&n.SpreadPropertyPattern.check(r))&&g(e.get("argument"),t)}function v(e,t){var r=e.value;n.Pattern.assert(r),n.Identifier.check(r)&&(o.call(t,r.name)?t[r.name].push(e):t[r.name]=[e])}return d.didScan=!1,d.declares=function(e){return this.scan(),o.call(this.bindings,e)},d.declaresType=function(e){return this.scan(),o.call(this.types,e)},d.declareTemporary=function(e){if(e){if(!/^[a-z$_]/i.test(e))throw new Error("")}else e="t$";e+=this.depth.toString(36)+"$",this.scan();for(var r=0;this.declares(e+r);)++r;var n=e+r;return this.bindings[n]=t.builders.identifier(n)},d.injectTemporary=function(e,t){e||(e=this.declareTemporary());var r=this.path.get("body");return n.BlockStatement.check(r.value)&&(r=r.get("body")),r.unshift(l.variableDeclaration("var",[l.variableDeclarator(e,t||null)])),e},d.scan=function(e){if(e||!this.didScan){for(var t in this.bindings)delete this.bindings[t];for(var t in this.types)delete this.types[t];!function(e,t,r){var i=e.value;if(f.check(i)){var a=e.get("typeParameters","params");u.check(a.value)&&a.each(function(e){!function(e,t){var r=e.value;h.assert(r),o.call(t,r.name)?t[r.name].push(e):t[r.name]=[e]}(e,r)})}p.check(i)&&(n.CatchClause.check(i)?g(e.get("param"),t):m(e,t,r))}(this.path,this.bindings,this.types),this.didScan=!0}},d.getBindings=function(){return this.scan(),this.bindings},d.getTypes=function(){return this.scan(),this.types},d.lookup=function(e){for(var t=this;t&&!t.declares(e);t=t.parent);return t},d.lookupType=function(e){for(var t=this;t&&!t.declaresType(e);t=t.parent);return t},d.getGlobalScope=function(){for(var e=this;!e.isGlobal;)e=e.parent;return e},c},(0,i.maybeSetModuleExports)(function(){return e})},97587:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){n.default.replace(e,{enter:function(e,t){"ExpressionStatement"===e.type&&function(e){return(0,i.default)(e)&&"use strict"===e.value}(e.expression)&&((0,a.default)({from:e,to:t}),this.remove())}})};var n=o(r(88543)),i=o(r(50236)),a=o(r(99650));function o(e){return e&&e.__esModule?e:{default:e}}},97909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var r=0;r{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i;function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.from,r=e.to;t.comments&&t.comments.length>0&&(r.comments=(r.comments||[]).concat(t.comments||[]))}},99721:(e,t,r)=>{"use strict";var n=r(36556),i=r(14035),a=n("RegExp.prototype.exec"),o=r(69675);e.exports=function(e){if(!i(e))throw new o("`regex` must be a RegExp");return function(t){return null!==a(e,t)}}},99761:function(e,t,r){var n;e=r.nmd(e),function(){function i(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function a(e,t,r,n){for(var i=-1,a=null==e?0:e.length;++i-1}function p(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function I(e,t){for(var r=e.length;r--&&x(t,e[r],0)>-1;);return r}function N(e){return"\\"+er[e]}function M(e){return Kt.test(e)}function B(e){return Ht.test(e)}function R(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function L(e,t){return function(r){return e(t(r))}}function V(e,t){for(var r=-1,n=e.length,i=0,a=[];++r>>1,se=[["ary",Q],["bind",1],["bindKey",2],["curry",8],["curryRight",$],["flip",512],["partial",Y],["partialRight",Z],["rearg",ee]],ue="[object Arguments]",le="[object Array]",ce="[object Boolean]",pe="[object Date]",fe="[object Error]",he="[object Function]",de="[object GeneratorFunction]",me="[object Map]",ye="[object Number]",ge="[object Object]",ve="[object Promise]",be="[object RegExp]",xe="[object Set]",Se="[object String]",Ee="[object Symbol]",_e="[object WeakMap]",we="[object ArrayBuffer]",Ae="[object DataView]",De="[object Float32Array]",ke="[object Float64Array]",Ce="[object Int8Array]",Te="[object Int16Array]",Pe="[object Int32Array]",Oe="[object Uint8Array]",je="[object Uint8ClampedArray]",Fe="[object Uint16Array]",Ie="[object Uint32Array]",Ne=/\b__p \+= '';/g,Me=/\b(__p \+=) '' \+/g,Be=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Re=/&(?:amp|lt|gt|quot|#39);/g,Le=/[&<>"']/g,Ve=RegExp(Re.source),Ue=RegExp(Le.source),ze=/<%-([\s\S]+?)%>/g,We=/<%([\s\S]+?)%>/g,Je=/<%=([\s\S]+?)%>/g,qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xe=/^\w*$/,Ge=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,He=RegExp(Ke.source),$e=/^\s+/,Ye=/\s/,Ze=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qe=/\{\n\/\* \[wrapped with (.+)\] \*/,et=/,? & /,tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,rt=/[()=,{}\[\]\/\s]/,nt=/\\(\\)?/g,it=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,at=/\w*$/,ot=/^[-+]0x[0-9a-f]+$/i,st=/^0b[01]+$/i,ut=/^\[object .+?Constructor\]$/,lt=/^0o[0-7]+$/i,ct=/^(?:0|[1-9]\d*)$/,pt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ft=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,dt="\\ud800-\\udfff",mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",yt="\\u2700-\\u27bf",gt="a-z\\xdf-\\xf6\\xf8-\\xff",vt="A-Z\\xc0-\\xd6\\xd8-\\xde",bt="\\ufe0e\\ufe0f",xt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",St="['’]",Et="["+dt+"]",_t="["+xt+"]",wt="["+mt+"]",At="\\d+",Dt="["+yt+"]",kt="["+gt+"]",Ct="[^"+dt+xt+At+yt+gt+vt+"]",Tt="\\ud83c[\\udffb-\\udfff]",Pt="[^"+dt+"]",Ot="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+vt+"]",It="\\u200d",Nt="(?:"+kt+"|"+Ct+")",Mt="(?:"+Ft+"|"+Ct+")",Bt="(?:['’](?:d|ll|m|re|s|t|ve))?",Rt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Lt="(?:"+wt+"|"+Tt+")"+"?",Vt="["+bt+"]?",Ut=Vt+Lt+("(?:"+It+"(?:"+[Pt,Ot,jt].join("|")+")"+Vt+Lt+")*"),zt="(?:"+[Dt,Ot,jt].join("|")+")"+Ut,Wt="(?:"+[Pt+wt+"?",wt,Ot,jt,Et].join("|")+")",Jt=RegExp(St,"g"),qt=RegExp(wt,"g"),Xt=RegExp(Tt+"(?="+Tt+")|"+Wt+Ut,"g"),Gt=RegExp([Ft+"?"+kt+"+"+Bt+"(?="+[_t,Ft,"$"].join("|")+")",Mt+"+"+Rt+"(?="+[_t,Ft+Nt,"$"].join("|")+")",Ft+"?"+Nt+"+"+Bt,Ft+"+"+Rt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",At,zt].join("|"),"g"),Kt=RegExp("["+It+dt+mt+bt+"]"),Ht=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yt=-1,Zt={};Zt[De]=Zt[ke]=Zt[Ce]=Zt[Te]=Zt[Pe]=Zt[Oe]=Zt[je]=Zt[Fe]=Zt[Ie]=!0,Zt[ue]=Zt[le]=Zt[we]=Zt[ce]=Zt[Ae]=Zt[pe]=Zt[fe]=Zt[he]=Zt[me]=Zt[ye]=Zt[ge]=Zt[be]=Zt[xe]=Zt[Se]=Zt[_e]=!1;var Qt={};Qt[ue]=Qt[le]=Qt[we]=Qt[Ae]=Qt[ce]=Qt[pe]=Qt[De]=Qt[ke]=Qt[Ce]=Qt[Te]=Qt[Pe]=Qt[me]=Qt[ye]=Qt[ge]=Qt[be]=Qt[xe]=Qt[Se]=Qt[Ee]=Qt[Oe]=Qt[je]=Qt[Fe]=Qt[Ie]=!0,Qt[fe]=Qt[he]=Qt[_e]=!1;var er={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tr=parseFloat,rr=parseInt,nr="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ir="object"==typeof self&&self&&self.Object===Object&&self,ar=nr||ir||Function("return this")(),or=t&&!t.nodeType&&t,sr=or&&e&&!e.nodeType&&e,ur=sr&&sr.exports===or,lr=ur&&nr.process,cr=function(){try{var e=sr&&sr.require&&sr.require("util").types;return e||lr&&lr.binding&&lr.binding("util")}catch(e){}}(),pr=cr&&cr.isArrayBuffer,fr=cr&&cr.isDate,hr=cr&&cr.isMap,dr=cr&&cr.isRegExp,mr=cr&&cr.isSet,yr=cr&&cr.isTypedArray,gr=w("length"),vr=A({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),br=A({"&":"&","<":"<",">":">",'"':""","'":"'"}),xr=A({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Sr=function e(t){function r(e){if(Vi(e)&&!Ps(e)&&!(e instanceof Ye)){if(e instanceof A)return e;if(Ta.call(e,"__wrapped__"))return fi(e)}return new A(e)}function n(){}function A(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=X}function Ye(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function tt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Pt(e,t,r,n,i,a){var s,u=1&t,l=2&t,c=4&t;if(r&&(s=i?r(e,n,i,a):r(e)),s!==X)return s;if(!Li(e))return e;var p=Ps(e);if(p){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Ta.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return cn(e,s)}else{var f=Vo(e),h=f==he||f==de;if(js(e))return nn(e,u);if(f==ge||f==ue||h&&!i){if(s=l||h?{}:Kn(e),!u)return l?function(e,t){return pn(e,Lo(e),t)}(e,function(e,t){return e&&pn(t,ta(t),e)}(s,e)):function(e,t){return pn(e,Ro(e),t)}(e,Dt(s,e))}else{if(!Qt[f])return i?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case we:return an(e);case ce:case pe:return new n(+e);case Ae:return function(e,t){return new e.constructor(t?an(e.buffer):e.buffer,e.byteOffset,e.byteLength)}(e,r);case De:case ke:case Ce:case Te:case Pe:case Oe:case je:case Fe:case Ie:return on(e,r);case me:return new n;case ye:case Se:return new n(e);case be:return function(e){var t=new e.constructor(e.source,at.exec(e));return t.lastIndex=e.lastIndex,t}(e);case xe:return new n;case Ee:return function(e){return Ao?xa(Ao.call(e)):{}}(e)}}(e,f,u)}}a||(a=new gt);var d=a.get(e);if(d)return d;a.set(e,s),Ms(e)?e.forEach(function(n){s.add(Pt(n,t,r,n,e,a))}):Is(e)&&e.forEach(function(n,i){s.set(i,Pt(n,t,r,i,e,a))});var m=p?X:(c?l?Vn:Ln:l?ta:ea)(e);return o(m||e,function(n,i){m&&(n=e[i=n]),_t(s,i,Pt(n,t,r,i,e,a))}),s}function Ot(e,t,r){var n=r.length;if(null==e)return!n;for(e=xa(e);n--;){var i=r[n],a=t[i],o=e[i];if(o===X&&!(i in e)||!a(o))return!1}return!0}function jt(e,t,r){if("function"!=typeof e)throw new _a(G);return Wo(function(){e.apply(X,r)},t)}function Ft(e,t,r,n){var i=-1,a=c,o=!0,s=e.length,u=[],l=t.length;if(!s)return u;r&&(t=f(t,P(r))),n?(a=p,o=!1):t.length>=200&&(a=j,o=!1,t=new yt(t));e:for(;++i0&&r(s)?t>1?Bt(s,t-1,r,n,i):h(i,s):n||(i[i.length]=s)}return i}function Rt(e,t){return e&&Po(e,t,ea)}function Lt(e,t){return e&&Oo(e,t,ea)}function Vt(e,t){return l(t,function(t){return Mi(e[t])})}function Ut(e,t){for(var r=0,n=(t=tn(t,e)).length;null!=e&&rt}function Gt(e,t){return null!=e&&Ta.call(e,t)}function Kt(e,t){return null!=e&&t in xa(e)}function Ht(e,t,r){for(var n=r?p:c,i=e[0].length,a=e.length,o=a,s=ma(a),u=1/0,l=[];o--;){var h=e[o];o&&t&&(h=f(h,P(t))),u=ao(h.length,u),s[o]=!r&&(t||i>=120&&h.length>=120)?new yt(o&&h):X}h=e[0];var d=-1,m=s[0];e:for(;++d=s?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)})}function Tr(e,t,r){for(var n=-1,i=t.length,a={};++n-1;)s!==e&&Wa.call(s,u,1),Wa.call(e,u,1);return e}function Or(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==a){var a=i;$n(i)?Wa.call(e,i,1):Gr(e,i)}}return e}function jr(e,t){return e+Za(uo()*(t-e+1))}function Fr(e,t){var r="";if(!e||t<1||t>re)return r;do{t%2&&(r+=e),(t=Za(t/2))&&(e+=e)}while(t);return r}function Ir(e,t){return Jo(ni(e,t,ua),e+"")}function Nr(e){return bt(na(e))}function Mr(e,t){var r=na(e);return ui(r,Tt(t,0,r.length))}function Br(e,t,r,n){if(!Li(e))return e;for(var i=-1,a=(t=tn(t,e)).length,o=a-1,s=e;null!=s&&++ii?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=ma(i);++n>>1,o=e[a];null!==o&&!Ji(o)&&(r?o<=t:o=200){var l=t?null:Mo(e);if(l)return U(l);o=!1,i=j,u=new yt}else u=t?[]:s;e:for(;++n=n?e:Lr(e,t,r)}function nn(e,t){if(t)return e.slice();var r=e.length,n=La?La(r):new e.constructor(r);return e.copy(n),n}function an(e){var t=new e.constructor(e.byteLength);return new Ra(t).set(new Ra(e)),t}function on(e,t){return new e.constructor(t?an(e.buffer):e.buffer,e.byteOffset,e.length)}function sn(e,t){if(e!==t){var r=e!==X,n=null===e,i=e==e,a=Ji(e),o=t!==X,s=null===t,u=t==t,l=Ji(t);if(!s&&!l&&!a&&e>t||a&&o&&u&&!s&&!l||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!l&&e1?r[i-1]:X,o=i>2?r[2]:X;for(a=e.length>3&&"function"==typeof a?(i--,a):X,o&&Yn(r[0],r[1],o)&&(a=i<3?X:a,i=1),t=xa(t);++n-1?i[a?t[o]:o]:X}}function Sn(e){return Rn(function(t){var r=t.length,n=r,i=A.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new _a(G);if(i&&!o&&"wrapper"==Un(a))var o=new A([],!0)}for(n=o?n:r;++n1&&v.reverse(),c&&us))return!1;var l=a.get(e),c=a.get(t);if(l&&c)return l==t&&c==e;var p=-1,f=!0,h=2&r?new yt:X;for(a.set(e,t),a.set(t,e);++p-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Ze,"{\n/* [wrapped with "+t+"] */\n")}(n,pi(function(e){var t=e.match(Qe);return t?t[1].split(et):[]}(n),r)))}function si(e){var t=0,r=0;return function(){var n=oo(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(X,arguments)}}function ui(e,t){var r=-1,n=e.length,i=n-1;for(t=t===X?n:t;++r0&&(r=t.apply(this,arguments)),e<=1&&(t=X),r}}function Ti(e,t,r){function n(t){var r=u,n=l;return u=l=X,d=t,p=e.apply(n,r)}function i(e){var r=e-h;return h===X||r>=t||r<0||y&&e-d>=c}function a(){var e=vs();return i(e)?o(e):(f=Wo(a,function(e){var r=t-(e-h);return y?ao(r,c-(e-d)):r}(e)),X)}function o(e){return f=X,g&&u?n(e):(u=l=X,p)}function s(){var e=vs(),r=i(e);if(u=arguments,l=this,h=e,r){if(f===X)return function(e){return d=e,f=Wo(a,t),m?n(e):p}(h);if(y)return No(f),f=Wo(a,t),n(h)}return f===X&&(f=Wo(a,t)),p}var u,l,c,p,f,h,d=0,m=!1,y=!1,g=!0;if("function"!=typeof e)throw new _a(G);return t=Hi(t)||0,Li(r)&&(m=!!r.leading,c=(y="maxWait"in r)?io(Hi(r.maxWait)||0,t):c,g="trailing"in r?!!r.trailing:g),s.cancel=function(){f!==X&&No(f),d=0,u=h=l=f=X},s.flush=function(){return f===X?p:o(vs())},s}function Pi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _a(G);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Pi.Cache||mt),r}function Oi(e){if("function"!=typeof e)throw new _a(G);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function ji(e,t){return e===t||e!=e&&t!=t}function Fi(e){return null!=e&&Ri(e.length)&&!Mi(e)}function Ii(e){return Vi(e)&&Fi(e)}function Ni(e){if(!Vi(e))return!1;var t=Wt(e);return t==fe||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!zi(e)}function Mi(e){if(!Li(e))return!1;var t=Wt(e);return t==he||t==de||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Bi(e){return"number"==typeof e&&e==Gi(e)}function Ri(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=re}function Li(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vi(e){return null!=e&&"object"==typeof e}function Ui(e){return"number"==typeof e||Vi(e)&&Wt(e)==ye}function zi(e){if(!Vi(e)||Wt(e)!=ge)return!1;var t=Va(e);if(null===t)return!0;var r=Ta.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ca.call(r)==Fa}function Wi(e){return"string"==typeof e||!Ps(e)&&Vi(e)&&Wt(e)==Se}function Ji(e){return"symbol"==typeof e||Vi(e)&&Wt(e)==Ee}function qi(e){if(!e)return[];if(Fi(e))return Wi(e)?W(e):cn(e);if(qa&&e[qa])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[qa]());var t=Vo(e);return(t==me?R:t==xe?U:na)(e)}function Xi(e){return e?(e=Hi(e))===te||e===-te?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Gi(e){var t=Xi(e),r=t%1;return t==t?r?t-r:t:0}function Ki(e){return e?Tt(Gi(e),0,ie):0}function Hi(e){if("number"==typeof e)return e;if(Ji(e))return ne;if(Li(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Li(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=T(e);var r=st.test(e);return r||lt.test(e)?rr(e.slice(2),r?2:8):ot.test(e)?ne:+e}function $i(e){return pn(e,ta(e))}function Yi(e){return null==e?"":qr(e)}function Zi(e,t,r){var n=null==e?X:Ut(e,t);return n===X?r:n}function Qi(e,t){return null!=e&&Gn(e,t,Kt)}function ea(e){return Fi(e)?vt(e):cr(e)}function ta(e){return Fi(e)?vt(e,!0):gr(e)}function ra(e,t){if(null==e)return{};var r=f(Vn(e),function(e){return[e]});return t=Wn(t),Tr(e,r,function(e,r){return t(e,r[0])})}function na(e){return null==e?[]:O(e,ea(e))}function ia(e){return lu(Yi(e).toLowerCase())}function aa(e){return(e=Yi(e))&&e.replace(pt,vr).replace(qt,"")}function oa(e,t,r){return e=Yi(e),(t=r?X:t)===X?B(e)?q(e):g(e):e.match(t)||[]}function sa(e){return function(){return e}}function ua(e){return e}function la(e){return lr("function"==typeof e?e:Pt(e,1))}function ca(e,t,r){var n=ea(t),i=Vt(t,n);null!=r||Li(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Vt(t,ea(t)));var a=!(Li(r)&&"chain"in r&&!r.chain),s=Mi(e);return o(i,function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__);return(r.__actions__=cn(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,h([this.value()],arguments))})}),e}function pa(){}function fa(e){return Zn(e)?w(li(e)):function(e){return function(t){return Ut(t,e)}}(e)}function ha(){return[]}function da(){return!1}var ma=(t=null==t?ar:Sr.defaults(ar.Object(),t,Sr.pick(ar,$t))).Array,ya=t.Date,ga=t.Error,va=t.Function,ba=t.Math,xa=t.Object,Sa=t.RegExp,Ea=t.String,_a=t.TypeError,wa=ma.prototype,Aa=va.prototype,Da=xa.prototype,ka=t["__core-js_shared__"],Ca=Aa.toString,Ta=Da.hasOwnProperty,Pa=0,Oa=function(){var e=/[^.]+$/.exec(ka&&ka.keys&&ka.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ja=Da.toString,Fa=Ca.call(xa),Ia=ar._,Na=Sa("^"+Ca.call(Ta).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ma=ur?t.Buffer:X,Ba=t.Symbol,Ra=t.Uint8Array,La=Ma?Ma.allocUnsafe:X,Va=L(xa.getPrototypeOf,xa),Ua=xa.create,za=Da.propertyIsEnumerable,Wa=wa.splice,Ja=Ba?Ba.isConcatSpreadable:X,qa=Ba?Ba.iterator:X,Xa=Ba?Ba.toStringTag:X,Ga=function(){try{var e=Xn(xa,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ka=t.clearTimeout!==ar.clearTimeout&&t.clearTimeout,Ha=ya&&ya.now!==ar.Date.now&&ya.now,$a=t.setTimeout!==ar.setTimeout&&t.setTimeout,Ya=ba.ceil,Za=ba.floor,Qa=xa.getOwnPropertySymbols,eo=Ma?Ma.isBuffer:X,to=t.isFinite,ro=wa.join,no=L(xa.keys,xa),io=ba.max,ao=ba.min,oo=ya.now,so=t.parseInt,uo=ba.random,lo=wa.reverse,co=Xn(t,"DataView"),po=Xn(t,"Map"),fo=Xn(t,"Promise"),ho=Xn(t,"Set"),mo=Xn(t,"WeakMap"),yo=Xn(xa,"create"),go=mo&&new mo,vo={},bo=ci(co),xo=ci(po),So=ci(fo),Eo=ci(ho),_o=ci(mo),wo=Ba?Ba.prototype:X,Ao=wo?wo.valueOf:X,Do=wo?wo.toString:X,ko=function(){function e(){}return function(t){if(!Li(t))return{};if(Ua)return Ua(t);e.prototype=t;var r=new e;return e.prototype=X,r}}();r.templateSettings={escape:ze,evaluate:We,interpolate:Je,variable:"",imports:{_:r}},r.prototype=n.prototype,r.prototype.constructor=r,A.prototype=ko(n.prototype),A.prototype.constructor=A,Ye.prototype=ko(n.prototype),Ye.prototype.constructor=Ye,tt.prototype.clear=function(){this.__data__=yo?yo(null):{},this.size=0},tt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},tt.prototype.get=function(e){var t=this.__data__;if(yo){var r=t[e];return r===K?X:r}return Ta.call(t,e)?t[e]:X},tt.prototype.has=function(e){var t=this.__data__;return yo?t[e]!==X:Ta.call(t,e)},tt.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yo&&t===X?K:t,this},dt.prototype.clear=function(){this.__data__=[],this.size=0},dt.prototype.delete=function(e){var t=this.__data__,r=wt(t,e);return!(r<0||(r==t.length-1?t.pop():Wa.call(t,r,1),--this.size,0))},dt.prototype.get=function(e){var t=this.__data__,r=wt(t,e);return r<0?X:t[r][1]},dt.prototype.has=function(e){return wt(this.__data__,e)>-1},dt.prototype.set=function(e,t){var r=this.__data__,n=wt(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},mt.prototype.clear=function(){this.size=0,this.__data__={hash:new tt,map:new(po||dt),string:new tt}},mt.prototype.delete=function(e){var t=Jn(this,e).delete(e);return this.size-=t?1:0,t},mt.prototype.get=function(e){return Jn(this,e).get(e)},mt.prototype.has=function(e){return Jn(this,e).has(e)},mt.prototype.set=function(e,t){var r=Jn(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},yt.prototype.add=yt.prototype.push=function(e){return this.__data__.set(e,K),this},yt.prototype.has=function(e){return this.__data__.has(e)},gt.prototype.clear=function(){this.__data__=new dt,this.size=0},gt.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},gt.prototype.get=function(e){return this.__data__.get(e)},gt.prototype.has=function(e){return this.__data__.has(e)},gt.prototype.set=function(e,t){var r=this.__data__;if(r instanceof dt){var n=r.__data__;if(!po||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new mt(n)}return r.set(e,t),this.size=r.size,this};var Co=dn(Rt),To=dn(Lt,!0),Po=mn(),Oo=mn(!0),jo=go?function(e,t){return go.set(e,t),e}:ua,Fo=Ga?function(e,t){return Ga(e,"toString",{configurable:!0,enumerable:!1,value:sa(t),writable:!0})}:ua,Io=Ir,No=Ka||function(e){return ar.clearTimeout(e)},Mo=ho&&1/U(new ho([,-0]))[1]==te?function(e){return new ho(e)}:pa,Bo=go?function(e){return go.get(e)}:pa,Ro=Qa?function(e){return null==e?[]:(e=xa(e),l(Qa(e),function(t){return za.call(e,t)}))}:ha,Lo=Qa?function(e){for(var t=[];e;)h(t,Ro(e)),e=Va(e);return t}:ha,Vo=Wt;(co&&Vo(new co(new ArrayBuffer(1)))!=Ae||po&&Vo(new po)!=me||fo&&Vo(fo.resolve())!=ve||ho&&Vo(new ho)!=xe||mo&&Vo(new mo)!=_e)&&(Vo=function(e){var t=Wt(e),r=t==ge?e.constructor:X,n=r?ci(r):"";if(n)switch(n){case bo:return Ae;case xo:return me;case So:return ve;case Eo:return xe;case _o:return _e}return t});var Uo=ka?Mi:da,zo=si(jo),Wo=$a||function(e,t){return ar.setTimeout(e,t)},Jo=si(Fo),qo=function(e){var t=Pi(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ge,function(e,r,n,i){t.push(n?i.replace(nt,"$1"):r||e)}),t}),Xo=Ir(function(e,t){return Ii(e)?Ft(e,Bt(t,1,Ii,!0)):[]}),Go=Ir(function(e,t){var r=gi(t);return Ii(r)&&(r=X),Ii(e)?Ft(e,Bt(t,1,Ii,!0),Wn(r,2)):[]}),Ko=Ir(function(e,t){var r=gi(t);return Ii(r)&&(r=X),Ii(e)?Ft(e,Bt(t,1,Ii,!0),X,r):[]}),Ho=Ir(function(e){var t=f(e,Qr);return t.length&&t[0]===e[0]?Ht(t):[]}),$o=Ir(function(e){var t=gi(e),r=f(e,Qr);return t===gi(r)?t=X:r.pop(),r.length&&r[0]===e[0]?Ht(r,Wn(t,2)):[]}),Yo=Ir(function(e){var t=gi(e),r=f(e,Qr);return(t="function"==typeof t?t:X)&&r.pop(),r.length&&r[0]===e[0]?Ht(r,X,t):[]}),Zo=Ir(vi),Qo=Rn(function(e,t){var r=null==e?0:e.length,n=Ct(e,t);return Or(e,f(t,function(e){return $n(e,r)?+e:e}).sort(sn)),n}),es=Ir(function(e){return Xr(Bt(e,1,Ii,!0))}),ts=Ir(function(e){var t=gi(e);return Ii(t)&&(t=X),Xr(Bt(e,1,Ii,!0),Wn(t,2))}),rs=Ir(function(e){var t=gi(e);return t="function"==typeof t?t:X,Xr(Bt(e,1,Ii,!0),X,t)}),ns=Ir(function(e,t){return Ii(e)?Ft(e,t):[]}),is=Ir(function(e){return Yr(l(e,Ii))}),as=Ir(function(e){var t=gi(e);return Ii(t)&&(t=X),Yr(l(e,Ii),Wn(t,2))}),os=Ir(function(e){var t=gi(e);return t="function"==typeof t?t:X,Yr(l(e,Ii),X,t)}),ss=Ir(xi),us=Ir(function(e){var t=e.length,r=t>1?e[t-1]:X;return r="function"==typeof r?(e.pop(),r):X,Si(e,r)}),ls=Rn(function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return Ct(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ye&&$n(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:_i,args:[i],thisArg:X}),new A(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(X),e})):this.thru(i)}),cs=fn(function(e,t,r){Ta.call(e,r)?++e[r]:kt(e,r,1)}),ps=xn(hi),fs=xn(di),hs=fn(function(e,t,r){Ta.call(e,r)?e[r].push(t):kt(e,r,[t])}),ds=Ir(function(e,t,r){var n=-1,a="function"==typeof t,o=Fi(e)?ma(e.length):[];return Co(e,function(e){o[++n]=a?i(t,e,r):er(e,t,r)}),o}),ms=fn(function(e,t,r){kt(e,r,t)}),ys=fn(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),gs=Ir(function(e,t){if(null==e)return[];var r=t.length;return r>1&&Yn(e,t[0],t[1])?t=[]:r>2&&Yn(t[0],t[1],t[2])&&(t=[t[0]]),Cr(e,Bt(t,1),[])}),vs=Ha||function(){return ar.Date.now()},bs=Ir(function(e,t,r){var n=1;if(r.length){var i=V(r,zn(bs));n|=Y}return Fn(e,n,t,r,i)}),xs=Ir(function(e,t,r){var n=3;if(r.length){var i=V(r,zn(xs));n|=Y}return Fn(t,n,e,r,i)}),Ss=Ir(function(e,t){return jt(e,1,t)}),Es=Ir(function(e,t,r){return jt(e,Hi(t)||0,r)});Pi.Cache=mt;var _s=Io(function(e,t){var r=(t=1==t.length&&Ps(t[0])?f(t[0],P(Wn())):f(Bt(t,1),P(Wn()))).length;return Ir(function(n){for(var a=-1,o=ao(n.length,r);++a=t}),Ts=nr(function(){return arguments}())?nr:function(e){return Vi(e)&&Ta.call(e,"callee")&&!za.call(e,"callee")},Ps=ma.isArray,Os=pr?P(pr):function(e){return Vi(e)&&Wt(e)==we},js=eo||da,Fs=fr?P(fr):function(e){return Vi(e)&&Wt(e)==pe},Is=hr?P(hr):function(e){return Vi(e)&&Vo(e)==me},Ns=dr?P(dr):function(e){return Vi(e)&&Wt(e)==be},Ms=mr?P(mr):function(e){return Vi(e)&&Vo(e)==xe},Bs=yr?P(yr):function(e){return Vi(e)&&Ri(e.length)&&!!Zt[Wt(e)]},Rs=Tn(Er),Ls=Tn(function(e,t){return e<=t}),Vs=hn(function(e,t){if(ei(t)||Fi(t))return pn(t,ea(t),e),X;for(var r in t)Ta.call(t,r)&&_t(e,r,t[r])}),Us=hn(function(e,t){pn(t,ta(t),e)}),zs=hn(function(e,t,r,n){pn(t,ta(t),e,n)}),Ws=hn(function(e,t,r,n){pn(t,ea(t),e,n)}),Js=Rn(Ct),qs=Ir(function(e,t){e=xa(e);var r=-1,n=t.length,i=n>2?t[2]:X;for(i&&Yn(t[0],t[1],i)&&(n=1);++r1),t}),pn(e,Vn(e),r),n&&(r=Pt(r,7,Mn));for(var i=t.length;i--;)Gr(r,t[i]);return r}),Qs=Rn(function(e,t){return null==e?{}:function(e,t){return Tr(e,t,function(t,r){return Qi(e,r)})}(e,t)}),eu=jn(ea),tu=jn(ta),ru=gn(function(e,t,r){return t=t.toLowerCase(),e+(r?ia(t):t)}),nu=gn(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),iu=gn(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),au=yn("toLowerCase"),ou=gn(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),su=gn(function(e,t,r){return e+(r?" ":"")+lu(t)}),uu=gn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),lu=yn("toUpperCase"),cu=Ir(function(e,t){try{return i(e,X,t)}catch(e){return Ni(e)?e:new ga(e)}}),pu=Rn(function(e,t){return o(t,function(t){t=li(t),kt(e,t,bs(e[t],e))}),e}),fu=Sn(),hu=Sn(!0),du=Ir(function(e,t){return function(r){return er(r,e,t)}}),mu=Ir(function(e,t){return function(r){return er(e,r,t)}}),yu=An(f),gu=An(u),vu=An(y),bu=Cn(),xu=Cn(!0),Su=wn(function(e,t){return e+t},0),Eu=On("ceil"),_u=wn(function(e,t){return e/t},1),wu=On("floor"),Au=wn(function(e,t){return e*t},1),Du=On("round"),ku=wn(function(e,t){return e-t},0);return r.after=function(e,t){if("function"!=typeof t)throw new _a(G);return e=Gi(e),function(){if(--e<1)return t.apply(this,arguments)}},r.ary=ki,r.assign=Vs,r.assignIn=Us,r.assignInWith=zs,r.assignWith=Ws,r.at=Js,r.before=Ci,r.bind=bs,r.bindAll=pu,r.bindKey=xs,r.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ps(e)?e:[e]},r.chain=Ei,r.chunk=function(e,t,r){t=(r?Yn(e,t,r):t===X)?1:io(Gi(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,a=0,o=ma(Ya(n/t));ii?0:i+r),(n=n===X||n>i?i:Gi(n))<0&&(n+=i),n=r>n?0:Ki(n);r>>0)?(e=Yi(e))&&("string"==typeof t||null!=t&&!Ns(t))&&(!(t=qr(t))&&M(e))?rn(W(e),0,r):e.split(t,r):[]},r.spread=function(e,t){if("function"!=typeof e)throw new _a(G);return t=null==t?0:io(Gi(t),0),Ir(function(r){var n=r[t],a=rn(r,0,t);return n&&h(a,n),i(e,this,a)})},r.tail=function(e){var t=null==e?0:e.length;return t?Lr(e,1,t):[]},r.take=function(e,t,r){return e&&e.length?Lr(e,0,(t=r||t===X?1:Gi(t))<0?0:t):[]},r.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?Lr(e,(t=n-(t=r||t===X?1:Gi(t)))<0?0:t,n):[]},r.takeRightWhile=function(e,t){return e&&e.length?Hr(e,Wn(t,3),!1,!0):[]},r.takeWhile=function(e,t){return e&&e.length?Hr(e,Wn(t,3)):[]},r.tap=function(e,t){return t(e),e},r.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new _a(G);return Li(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ti(e,t,{leading:n,maxWait:t,trailing:i})},r.thru=_i,r.toArray=qi,r.toPairs=eu,r.toPairsIn=tu,r.toPath=function(e){return Ps(e)?f(e,li):Ji(e)?[e]:cn(qo(Yi(e)))},r.toPlainObject=$i,r.transform=function(e,t,r){var n=Ps(e),i=n||js(e)||Bs(e);if(t=Wn(t,4),null==r){var a=e&&e.constructor;r=i?n?new a:[]:Li(e)&&Mi(a)?ko(Va(e)):{}}return(i?o:Rt)(e,function(e,n,i){return t(r,e,n,i)}),r},r.unary=function(e){return ki(e,1)},r.union=es,r.unionBy=ts,r.unionWith=rs,r.uniq=function(e){return e&&e.length?Xr(e):[]},r.uniqBy=function(e,t){return e&&e.length?Xr(e,Wn(t,2)):[]},r.uniqWith=function(e,t){return t="function"==typeof t?t:X,e&&e.length?Xr(e,X,t):[]},r.unset=function(e,t){return null==e||Gr(e,t)},r.unzip=xi,r.unzipWith=Si,r.update=function(e,t,r){return null==e?e:Kr(e,t,en(r))},r.updateWith=function(e,t,r,n){return n="function"==typeof n?n:X,null==e?e:Kr(e,t,en(r),n)},r.values=na,r.valuesIn=function(e){return null==e?[]:O(e,ta(e))},r.without=ns,r.words=oa,r.wrap=function(e,t){return ws(en(t),e)},r.xor=is,r.xorBy=as,r.xorWith=os,r.zip=ss,r.zipObject=function(e,t){return Zr(e||[],t||[],_t)},r.zipObjectDeep=function(e,t){return Zr(e||[],t||[],Br)},r.zipWith=us,r.entries=eu,r.entriesIn=tu,r.extend=Us,r.extendWith=zs,ca(r,r),r.add=Su,r.attempt=cu,r.camelCase=ru,r.capitalize=ia,r.ceil=Eu,r.clamp=function(e,t,r){return r===X&&(r=t,t=X),r!==X&&(r=(r=Hi(r))==r?r:0),t!==X&&(t=(t=Hi(t))==t?t:0),Tt(Hi(e),t,r)},r.clone=function(e){return Pt(e,4)},r.cloneDeep=function(e){return Pt(e,5)},r.cloneDeepWith=function(e,t){return Pt(e,5,t="function"==typeof t?t:X)},r.cloneWith=function(e,t){return Pt(e,4,t="function"==typeof t?t:X)},r.conformsTo=function(e,t){return null==t||Ot(e,t,ea(t))},r.deburr=aa,r.defaultTo=function(e,t){return null==e||e!=e?t:e},r.divide=_u,r.endsWith=function(e,t,r){e=Yi(e),t=qr(t);var n=e.length,i=r=r===X?n:Tt(Gi(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},r.eq=ji,r.escape=function(e){return(e=Yi(e))&&Ue.test(e)?e.replace(Le,br):e},r.escapeRegExp=function(e){return(e=Yi(e))&&He.test(e)?e.replace(Ke,"\\$&"):e},r.every=function(e,t,r){var n=Ps(e)?u:It;return r&&Yn(e,t,r)&&(t=X),n(e,Wn(t,3))},r.find=ps,r.findIndex=hi,r.findKey=function(e,t){return v(e,Wn(t,3),Rt)},r.findLast=fs,r.findLastIndex=di,r.findLastKey=function(e,t){return v(e,Wn(t,3),Lt)},r.floor=wu,r.forEach=wi,r.forEachRight=Ai,r.forIn=function(e,t){return null==e?e:Po(e,Wn(t,3),ta)},r.forInRight=function(e,t){return null==e?e:Oo(e,Wn(t,3),ta)},r.forOwn=function(e,t){return e&&Rt(e,Wn(t,3))},r.forOwnRight=function(e,t){return e&&Lt(e,Wn(t,3))},r.get=Zi,r.gt=ks,r.gte=Cs,r.has=function(e,t){return null!=e&&Gn(e,t,Gt)},r.hasIn=Qi,r.head=yi,r.identity=ua,r.includes=function(e,t,r,n){e=Fi(e)?e:na(e),r=r&&!n?Gi(r):0;var i=e.length;return r<0&&(r=io(i+r,0)),Wi(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&x(e,t,r)>-1},r.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:Gi(r);return i<0&&(i=io(n+i,0)),x(e,t,i)},r.inRange=function(e,t,r){return t=Xi(t),r===X?(r=t,t=0):r=Xi(r),function(e,t,r){return e>=ao(t,r)&&e=-re&&e<=re},r.isSet=Ms,r.isString=Wi,r.isSymbol=Ji,r.isTypedArray=Bs,r.isUndefined=function(e){return e===X},r.isWeakMap=function(e){return Vi(e)&&Vo(e)==_e},r.isWeakSet=function(e){return Vi(e)&&"[object WeakSet]"==Wt(e)},r.join=function(e,t){return null==e?"":ro.call(e,t)},r.kebabCase=nu,r.last=gi,r.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return r!==X&&(i=(i=Gi(r))<0?io(n+i,0):ao(i,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):b(e,E,i,!0)},r.lowerCase=iu,r.lowerFirst=au,r.lt=Rs,r.lte=Ls,r.max=function(e){return e&&e.length?Nt(e,ua,Xt):X},r.maxBy=function(e,t){return e&&e.length?Nt(e,Wn(t,2),Xt):X},r.mean=function(e){return _(e,ua)},r.meanBy=function(e,t){return _(e,Wn(t,2))},r.min=function(e){return e&&e.length?Nt(e,ua,Er):X},r.minBy=function(e,t){return e&&e.length?Nt(e,Wn(t,2),Er):X},r.stubArray=ha,r.stubFalse=da,r.stubObject=function(){return{}},r.stubString=function(){return""},r.stubTrue=function(){return!0},r.multiply=Au,r.nth=function(e,t){return e&&e.length?kr(e,Gi(t)):X},r.noConflict=function(){return ar._===this&&(ar._=Ia),this},r.noop=pa,r.now=vs,r.pad=function(e,t,r){e=Yi(e);var n=(t=Gi(t))?z(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Dn(Za(i),r)+e+Dn(Ya(i),r)},r.padEnd=function(e,t,r){e=Yi(e);var n=(t=Gi(t))?z(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var i=uo();return ao(e+i*(t-e+tr("1e-"+((i+"").length-1))),t)}return jr(e,t)},r.reduce=function(e,t,r){var n=Ps(e)?d:D,i=arguments.length<3;return n(e,Wn(t,4),r,i,Co)},r.reduceRight=function(e,t,r){var n=Ps(e)?m:D,i=arguments.length<3;return n(e,Wn(t,4),r,i,To)},r.repeat=function(e,t,r){return t=(r?Yn(e,t,r):t===X)?1:Gi(t),Fr(Yi(e),t)},r.replace=function(){var e=arguments,t=Yi(e[0]);return e.length<3?t:t.replace(e[1],e[2])},r.result=function(e,t,r){var n=-1,i=(t=tn(t,e)).length;for(i||(i=1,e=X);++nre)return[];var r=ie,n=ao(e,ie);t=Wn(t),e-=ie;for(var i=C(n,t);++r=a)return e;var s=r-z(n);if(s<1)return n;var u=o?rn(o,0,s).join(""):e.slice(0,s);if(i===X)return u+n;if(o&&(s+=u.length-s),Ns(i)){if(e.slice(s).search(i)){var l,c=u;for(i.global||(i=Sa(i.source,Yi(at.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var p=l.index;u=u.slice(0,p===X?s:p)}}else if(e.indexOf(qr(i),s)!=s){var f=u.lastIndexOf(i);f>-1&&(u=u.slice(0,f))}return u+n},r.unescape=function(e){return(e=Yi(e))&&Ve.test(e)?e.replace(Re,xr):e},r.uniqueId=function(e){var t=++Pa;return Yi(e)+t},r.upperCase=uu,r.upperFirst=lu,r.each=wi,r.eachRight=Ai,r.first=yi,ca(r,function(){var e={};return Rt(r,function(t,n){Ta.call(r.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),r.VERSION="4.17.21",o(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){r[e].placeholder=r}),o(["drop","take"],function(e,t){Ye.prototype[e]=function(r){r=r===X?1:io(Gi(r),0);var n=this.__filtered__&&!t?new Ye(this):this.clone();return n.__filtered__?n.__takeCount__=ao(r,n.__takeCount__):n.__views__.push({size:ao(r,ie),type:e+(n.__dir__<0?"Right":"")}),n},Ye.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),o(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Ye.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Wn(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),o(["head","last"],function(e,t){var r="take"+(t?"Right":"");Ye.prototype[e]=function(){return this[r](1).value()[0]}}),o(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Ye.prototype[e]=function(){return this.__filtered__?new Ye(this):this[r](1)}}),Ye.prototype.compact=function(){return this.filter(ua)},Ye.prototype.find=function(e){return this.filter(e).head()},Ye.prototype.findLast=function(e){return this.reverse().find(e)},Ye.prototype.invokeMap=Ir(function(e,t){return"function"==typeof e?new Ye(this):this.map(function(r){return er(r,e,t)})}),Ye.prototype.reject=function(e){return this.filter(Oi(Wn(e)))},Ye.prototype.slice=function(e,t){e=Gi(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Ye(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==X&&(r=(t=Gi(t))<0?r.dropRight(-t):r.take(t-e)),r)},Ye.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ye.prototype.toArray=function(){return this.take(ie)},Rt(Ye.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=r[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);a&&(r.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,u=t instanceof Ye,l=s[0],c=u||Ps(t),p=function(e){var t=a.apply(r,h([e],s));return i&&f?t[0]:t};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,d=!!this.__actions__.length,m=o&&!f,y=u&&!d;if(!o&&c){t=y?t:new Ye(this);var g=e.apply(t,s);return g.__actions__.push({func:_i,args:[p],thisArg:X}),new A(g,f)}return m&&y?e.apply(this,s):(g=this.thru(p),m?i?g.value()[0]:g.value():g)})}),o(["pop","push","shift","sort","splice","unshift"],function(e){var t=wa[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);r.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply(Ps(r)?r:[],e)}return this[n](function(r){return t.apply(Ps(r)?r:[],e)})}}),Rt(Ye.prototype,function(e,t){var n=r[t];if(n){var i=n.name+"";Ta.call(vo,i)||(vo[i]=[]),vo[i].push({name:t,func:n})}}),vo[En(X,2).name]=[{name:"wrapper",func:X}],Ye.prototype.clone=function(){var e=new Ye(this.__wrapped__);return e.__actions__=cn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=cn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=cn(this.__views__),e},Ye.prototype.reverse=function(){if(this.__filtered__){var e=new Ye(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ye.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ps(e),n=t<0,i=r?e.length:0,a=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?X:this.__values__[this.__index__++]}},r.prototype.plant=function(e){for(var t,r=this;r instanceof n;){var i=fi(r);i.__index__=0,i.__values__=X,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t},r.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ye){var t=e;return this.__actions__.length&&(t=new Ye(this)),(t=t.reverse()).__actions__.push({func:_i,args:[bi],thisArg:X}),new A(t,this.__chain__)}return this.thru(bi)},r.prototype.toJSON=r.prototype.valueOf=r.prototype.value=function(){return $r(this.__wrapped__,this.__actions__)},r.prototype.first=r.prototype.head,qa&&(r.prototype[qa]=function(){return this}),r}();ar._=Sr,void 0===(n=function(){return Sr}.call(t,r,t,e))||(e.exports=n)}.call(this)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";r.r(n),r.d(n,{runTest:()=>i});var e=r(61895);const t=[{name:"preact-8.2.5.js",options:["arg-rest","arg-spread","arrow","class","for-of","let","template","includes","obj-method","obj-shorthand"]}];function i(r){return t.map(({name:e,options:t})=>({payload:r[e],options:t})).map(({payload:t,options:r})=>e.p(t,r))}})(),self.WTBenchmark=n})(); \ No newline at end of file diff --git a/web-tooling-benchmark/dist/postcss.bundle.dev.js.z b/web-tooling-benchmark/dist/postcss.bundle.dev.js.z new file mode 100644 index 00000000..b641135b Binary files /dev/null and b/web-tooling-benchmark/dist/postcss.bundle.dev.js.z differ diff --git a/web-tooling-benchmark/dist/postcss.bundle.js b/web-tooling-benchmark/dist/postcss.bundle.js deleted file mode 100644 index f85d4ad9..00000000 --- a/web-tooling-benchmark/dist/postcss.bundle.js +++ /dev/null @@ -1,27028 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/autoprefixer/data/prefixes.js": -/*!****************************************************!*\ - !*** ./node_modules/autoprefixer/data/prefixes.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let unpack = __webpack_require__(/*! caniuse-lite/dist/unpacker/feature */ "./node_modules/caniuse-lite/dist/unpacker/feature.js") - -function browsersSort(a, b) { - a = a.split(' ') - b = b.split(' ') - if (a[0] > b[0]) { - return 1 - } else if (a[0] < b[0]) { - return -1 - } else { - return Math.sign(parseFloat(a[1]) - parseFloat(b[1])) - } -} - -// Convert Can I Use data -function f(data, opts, callback) { - data = unpack(data) - - if (!callback) { - ;[callback, opts] = [opts, {}] - } - - let match = opts.match || /\sx($|\s)/ - let need = [] - - for (let browser in data.stats) { - let versions = data.stats[browser] - for (let version in versions) { - let support = versions[version] - if (support.match(match)) { - need.push(browser + ' ' + version) - } - } - } - - callback(need.sort(browsersSort)) -} - -// Add data for all properties -let result = {} - -function prefix(names, data) { - for (let name of names) { - result[name] = Object.assign({}, data) - } -} - -function add(names, data) { - for (let name of names) { - result[name].browsers = result[name].browsers - .concat(data.browsers) - .sort(browsersSort) - } -} - -module.exports = result - -// Border Radius -let prefixBorderRadius = __webpack_require__(/*! caniuse-lite/data/features/border-radius */ "./node_modules/caniuse-lite/data/features/border-radius.js") - -f(prefixBorderRadius, browsers => - prefix( - [ - 'border-radius', - 'border-top-left-radius', - 'border-top-right-radius', - 'border-bottom-right-radius', - 'border-bottom-left-radius' - ], - { - browsers, - feature: 'border-radius', - mistakes: ['-khtml-', '-ms-', '-o-'] - } - ) -) - -// Box Shadow -let prefixBoxshadow = __webpack_require__(/*! caniuse-lite/data/features/css-boxshadow */ "./node_modules/caniuse-lite/data/features/css-boxshadow.js") - -f(prefixBoxshadow, browsers => - prefix(['box-shadow'], { - browsers, - feature: 'css-boxshadow', - mistakes: ['-khtml-'] - }) -) - -// Animation -let prefixAnimation = __webpack_require__(/*! caniuse-lite/data/features/css-animation */ "./node_modules/caniuse-lite/data/features/css-animation.js") - -f(prefixAnimation, browsers => - prefix( - [ - 'animation', - 'animation-name', - 'animation-duration', - 'animation-delay', - 'animation-direction', - 'animation-fill-mode', - 'animation-iteration-count', - 'animation-play-state', - 'animation-timing-function', - '@keyframes' - ], - { - browsers, - feature: 'css-animation', - mistakes: ['-khtml-', '-ms-'] - } - ) -) - -// Transition -let prefixTransition = __webpack_require__(/*! caniuse-lite/data/features/css-transitions */ "./node_modules/caniuse-lite/data/features/css-transitions.js") - -f(prefixTransition, browsers => - prefix( - [ - 'transition', - 'transition-property', - 'transition-duration', - 'transition-delay', - 'transition-timing-function' - ], - { - browsers, - feature: 'css-transitions', - mistakes: ['-khtml-', '-ms-'] - } - ) -) - -// Transform 2D -let prefixTransform2d = __webpack_require__(/*! caniuse-lite/data/features/transforms2d */ "./node_modules/caniuse-lite/data/features/transforms2d.js") - -f(prefixTransform2d, browsers => - prefix(['transform', 'transform-origin'], { - browsers, - feature: 'transforms2d' - }) -) - -// Transform 3D -let prefixTransforms3d = __webpack_require__(/*! caniuse-lite/data/features/transforms3d */ "./node_modules/caniuse-lite/data/features/transforms3d.js") - -f(prefixTransforms3d, browsers => { - prefix(['perspective', 'perspective-origin'], { - browsers, - feature: 'transforms3d' - }) - return prefix(['transform-style'], { - browsers, - feature: 'transforms3d', - mistakes: ['-ms-', '-o-'] - }) -}) - -f(prefixTransforms3d, { match: /y\sx|y\s#2/ }, browsers => - prefix(['backface-visibility'], { - browsers, - feature: 'transforms3d', - mistakes: ['-ms-', '-o-'] - }) -) - -// Gradients -let prefixGradients = __webpack_require__(/*! caniuse-lite/data/features/css-gradients */ "./node_modules/caniuse-lite/data/features/css-gradients.js") - -f(prefixGradients, { match: /y\sx/ }, browsers => - prefix( - [ - 'linear-gradient', - 'repeating-linear-gradient', - 'radial-gradient', - 'repeating-radial-gradient' - ], - { - browsers, - feature: 'css-gradients', - mistakes: ['-ms-'], - props: [ - 'background', - 'background-image', - 'border-image', - 'mask', - 'list-style', - 'list-style-image', - 'content', - 'mask-image' - ] - } - ) -) - -f(prefixGradients, { match: /a\sx/ }, browsers => { - browsers = browsers.map(i => { - if (/firefox|op/.test(i)) { - return i - } else { - return `${i} old` - } - }) - return add( - [ - 'linear-gradient', - 'repeating-linear-gradient', - 'radial-gradient', - 'repeating-radial-gradient' - ], - { - browsers, - feature: 'css-gradients' - } - ) -}) - -// Box sizing -let prefixBoxsizing = __webpack_require__(/*! caniuse-lite/data/features/css3-boxsizing */ "./node_modules/caniuse-lite/data/features/css3-boxsizing.js") - -f(prefixBoxsizing, browsers => - prefix(['box-sizing'], { - browsers, - feature: 'css3-boxsizing' - }) -) - -// Filter Effects -let prefixFilters = __webpack_require__(/*! caniuse-lite/data/features/css-filters */ "./node_modules/caniuse-lite/data/features/css-filters.js") - -f(prefixFilters, browsers => - prefix(['filter'], { - browsers, - feature: 'css-filters' - }) -) - -// filter() function -let prefixFilterFunction = __webpack_require__(/*! caniuse-lite/data/features/css-filter-function */ "./node_modules/caniuse-lite/data/features/css-filter-function.js") - -f(prefixFilterFunction, browsers => - prefix(['filter-function'], { - browsers, - feature: 'css-filter-function', - props: [ - 'background', - 'background-image', - 'border-image', - 'mask', - 'list-style', - 'list-style-image', - 'content', - 'mask-image' - ] - }) -) - -// Backdrop-filter -let prefixBackdropFilter = __webpack_require__(/*! caniuse-lite/data/features/css-backdrop-filter */ "./node_modules/caniuse-lite/data/features/css-backdrop-filter.js") - -f(prefixBackdropFilter, { match: /y\sx|y\s#2/ }, browsers => - prefix(['backdrop-filter'], { - browsers, - feature: 'css-backdrop-filter' - }) -) - -// element() function -let prefixElementFunction = __webpack_require__(/*! caniuse-lite/data/features/css-element-function */ "./node_modules/caniuse-lite/data/features/css-element-function.js") - -f(prefixElementFunction, browsers => - prefix(['element'], { - browsers, - feature: 'css-element-function', - props: [ - 'background', - 'background-image', - 'border-image', - 'mask', - 'list-style', - 'list-style-image', - 'content', - 'mask-image' - ] - }) -) - -// Multicolumns -let prefixMulticolumns = __webpack_require__(/*! caniuse-lite/data/features/multicolumn */ "./node_modules/caniuse-lite/data/features/multicolumn.js") - -f(prefixMulticolumns, browsers => { - prefix( - [ - 'columns', - 'column-width', - 'column-gap', - 'column-rule', - 'column-rule-color', - 'column-rule-width', - 'column-count', - 'column-rule-style', - 'column-span', - 'column-fill' - ], - { - browsers, - feature: 'multicolumn' - } - ) - - let noff = browsers.filter(i => !/firefox/.test(i)) - prefix(['break-before', 'break-after', 'break-inside'], { - browsers: noff, - feature: 'multicolumn' - }) -}) - -// User select -let prefixUserSelect = __webpack_require__(/*! caniuse-lite/data/features/user-select-none */ "./node_modules/caniuse-lite/data/features/user-select-none.js") - -f(prefixUserSelect, browsers => - prefix(['user-select'], { - browsers, - feature: 'user-select-none', - mistakes: ['-khtml-'] - }) -) - -// Flexible Box Layout -let prefixFlexbox = __webpack_require__(/*! caniuse-lite/data/features/flexbox */ "./node_modules/caniuse-lite/data/features/flexbox.js") - -f(prefixFlexbox, { match: /a\sx/ }, browsers => { - browsers = browsers.map(i => { - if (/ie|firefox/.test(i)) { - return i - } else { - return `${i} 2009` - } - }) - prefix(['display-flex', 'inline-flex'], { - browsers, - feature: 'flexbox', - props: ['display'] - }) - prefix(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { - browsers, - feature: 'flexbox' - }) - prefix( - [ - 'flex-direction', - 'flex-wrap', - 'flex-flow', - 'justify-content', - 'order', - 'align-items', - 'align-self', - 'align-content' - ], - { - browsers, - feature: 'flexbox' - } - ) -}) - -f(prefixFlexbox, { match: /y\sx/ }, browsers => { - add(['display-flex', 'inline-flex'], { - browsers, - feature: 'flexbox' - }) - add(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { - browsers, - feature: 'flexbox' - }) - add( - [ - 'flex-direction', - 'flex-wrap', - 'flex-flow', - 'justify-content', - 'order', - 'align-items', - 'align-self', - 'align-content' - ], - { - browsers, - feature: 'flexbox' - } - ) -}) - -// calc() unit -let prefixCalc = __webpack_require__(/*! caniuse-lite/data/features/calc */ "./node_modules/caniuse-lite/data/features/calc.js") - -f(prefixCalc, browsers => - prefix(['calc'], { - browsers, - feature: 'calc', - props: ['*'] - }) -) - -// Background options -let prefixBackgroundOptions = __webpack_require__(/*! caniuse-lite/data/features/background-img-opts */ "./node_modules/caniuse-lite/data/features/background-img-opts.js") - -f(prefixBackgroundOptions, browsers => - prefix(['background-origin', 'background-size'], { - browsers, - feature: 'background-img-opts' - }) -) - -// background-clip: text -let prefixBackgroundClipText = __webpack_require__(/*! caniuse-lite/data/features/background-clip-text */ "./node_modules/caniuse-lite/data/features/background-clip-text.js") - -f(prefixBackgroundClipText, browsers => - prefix(['background-clip'], { - browsers, - feature: 'background-clip-text' - }) -) - -// Font feature settings -let prefixFontFeature = __webpack_require__(/*! caniuse-lite/data/features/font-feature */ "./node_modules/caniuse-lite/data/features/font-feature.js") - -f(prefixFontFeature, browsers => - prefix( - [ - 'font-feature-settings', - 'font-variant-ligatures', - 'font-language-override' - ], - { - browsers, - feature: 'font-feature' - } - ) -) - -// CSS font-kerning property -let prefixFontKerning = __webpack_require__(/*! caniuse-lite/data/features/font-kerning */ "./node_modules/caniuse-lite/data/features/font-kerning.js") - -f(prefixFontKerning, browsers => - prefix(['font-kerning'], { - browsers, - feature: 'font-kerning' - }) -) - -// Border image -let prefixBorderImage = __webpack_require__(/*! caniuse-lite/data/features/border-image */ "./node_modules/caniuse-lite/data/features/border-image.js") - -f(prefixBorderImage, browsers => - prefix(['border-image'], { - browsers, - feature: 'border-image' - }) -) - -// Selection selector -let prefixSelection = __webpack_require__(/*! caniuse-lite/data/features/css-selection */ "./node_modules/caniuse-lite/data/features/css-selection.js") - -f(prefixSelection, browsers => - prefix(['::selection'], { - browsers, - feature: 'css-selection', - selector: true - }) -) - -// Placeholder selector -let prefixPlaceholder = __webpack_require__(/*! caniuse-lite/data/features/css-placeholder */ "./node_modules/caniuse-lite/data/features/css-placeholder.js") - -f(prefixPlaceholder, browsers => { - prefix(['::placeholder'], { - browsers: browsers.concat(['ie 10 old', 'ie 11 old', 'firefox 18 old']), - feature: 'css-placeholder', - selector: true - }) -}) - -// Placeholder-shown selector -let prefixPlaceholderShown = __webpack_require__(/*! caniuse-lite/data/features/css-placeholder-shown */ "./node_modules/caniuse-lite/data/features/css-placeholder-shown.js") - -f(prefixPlaceholderShown, browsers => { - prefix([':placeholder-shown'], { - browsers, - feature: 'css-placeholder-shown', - selector: true - }) -}) - -// Hyphenation -let prefixHyphens = __webpack_require__(/*! caniuse-lite/data/features/css-hyphens */ "./node_modules/caniuse-lite/data/features/css-hyphens.js") - -f(prefixHyphens, browsers => - prefix(['hyphens'], { - browsers, - feature: 'css-hyphens' - }) -) - -// Fullscreen selector -let prefixFullscreen = __webpack_require__(/*! caniuse-lite/data/features/fullscreen */ "./node_modules/caniuse-lite/data/features/fullscreen.js") - -f(prefixFullscreen, browsers => - prefix([':fullscreen'], { - browsers, - feature: 'fullscreen', - selector: true - }) -) - -// ::backdrop pseudo-element -// https://caniuse.com/mdn-css_selectors_backdrop -let prefixBackdrop = __webpack_require__(/*! caniuse-lite/data/features/mdn-css-backdrop-pseudo-element */ "./node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js") - -f(prefixBackdrop, browsers => - prefix(['::backdrop'], { - browsers, - feature: 'backdrop', - selector: true - }) -) - -// File selector button -let prefixFileSelectorButton = __webpack_require__(/*! caniuse-lite/data/features/css-file-selector-button */ "./node_modules/caniuse-lite/data/features/css-file-selector-button.js") - -f(prefixFileSelectorButton, browsers => - prefix(['::file-selector-button'], { - browsers, - feature: 'file-selector-button', - selector: true - }) -) - -// :autofill -let prefixAutofill = __webpack_require__(/*! caniuse-lite/data/features/css-autofill */ "./node_modules/caniuse-lite/data/features/css-autofill.js") - -f(prefixAutofill, browsers => - prefix([':autofill'], { - browsers, - feature: 'css-autofill', - selector: true - }) -) - -// Tab size -let prefixTabsize = __webpack_require__(/*! caniuse-lite/data/features/css3-tabsize */ "./node_modules/caniuse-lite/data/features/css3-tabsize.js") - -f(prefixTabsize, browsers => - prefix(['tab-size'], { - browsers, - feature: 'css3-tabsize' - }) -) - -// Intrinsic & extrinsic sizing -let prefixIntrinsic = __webpack_require__(/*! caniuse-lite/data/features/intrinsic-width */ "./node_modules/caniuse-lite/data/features/intrinsic-width.js") - -let sizeProps = [ - 'width', - 'min-width', - 'max-width', - 'height', - 'min-height', - 'max-height', - 'inline-size', - 'min-inline-size', - 'max-inline-size', - 'block-size', - 'min-block-size', - 'max-block-size', - 'grid', - 'grid-template', - 'grid-template-rows', - 'grid-template-columns', - 'grid-auto-columns', - 'grid-auto-rows' -] - -f(prefixIntrinsic, browsers => - prefix(['max-content', 'min-content'], { - browsers, - feature: 'intrinsic-width', - props: sizeProps - }) -) - -f(prefixIntrinsic, { match: /x|\s#4/ }, browsers => - prefix(['fill', 'fill-available'], { - browsers, - feature: 'intrinsic-width', - props: sizeProps - }) -) - -f(prefixIntrinsic, { match: /x|\s#5/ }, browsers => { - let ffFix = browsers.filter(i => { - let [name, version] = i.split(' ') - if (name === 'firefox' || name === 'and_ff') { - return parseInt(version) < 94 - } else { - return true - } - }) - return prefix(['fit-content'], { - browsers: ffFix, - feature: 'intrinsic-width', - props: sizeProps - }) -}) - -// Stretch value - -let prefixStretch = __webpack_require__(/*! caniuse-lite/data/features/css-width-stretch */ "./node_modules/caniuse-lite/data/features/css-width-stretch.js") - -f(prefixStretch, browsers => - prefix(['stretch'], { - browsers, - feature: 'css-width-stretch', - props: sizeProps - }) -) - -// Zoom cursors -let prefixCursorsNewer = __webpack_require__(/*! caniuse-lite/data/features/css3-cursors-newer */ "./node_modules/caniuse-lite/data/features/css3-cursors-newer.js") - -f(prefixCursorsNewer, browsers => - prefix(['zoom-in', 'zoom-out'], { - browsers, - feature: 'css3-cursors-newer', - props: ['cursor'] - }) -) - -// Grab cursors -let prefixCursorsGrab = __webpack_require__(/*! caniuse-lite/data/features/css3-cursors-grab */ "./node_modules/caniuse-lite/data/features/css3-cursors-grab.js") - -f(prefixCursorsGrab, browsers => - prefix(['grab', 'grabbing'], { - browsers, - feature: 'css3-cursors-grab', - props: ['cursor'] - }) -) - -// Sticky position -let prefixSticky = __webpack_require__(/*! caniuse-lite/data/features/css-sticky */ "./node_modules/caniuse-lite/data/features/css-sticky.js") - -f(prefixSticky, browsers => - prefix(['sticky'], { - browsers, - feature: 'css-sticky', - props: ['position'] - }) -) - -// Pointer Events -let prefixPointer = __webpack_require__(/*! caniuse-lite/data/features/pointer */ "./node_modules/caniuse-lite/data/features/pointer.js") - -f(prefixPointer, browsers => - prefix(['touch-action'], { - browsers, - feature: 'pointer' - }) -) - -// Text decoration -let prefixDecoration = __webpack_require__(/*! caniuse-lite/data/features/text-decoration */ "./node_modules/caniuse-lite/data/features/text-decoration.js") - -f(prefixDecoration, { match: /x.*#[235]/ }, browsers => - prefix(['text-decoration-skip', 'text-decoration-skip-ink'], { - browsers, - feature: 'text-decoration' - }) -) - -let prefixDecorationShorthand = __webpack_require__(/*! caniuse-lite/data/features/mdn-text-decoration-shorthand */ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js") - -f(prefixDecorationShorthand, browsers => - prefix(['text-decoration'], { - browsers, - feature: 'text-decoration' - }) -) - -let prefixDecorationColor = __webpack_require__(/*! caniuse-lite/data/features/mdn-text-decoration-color */ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js") - -f(prefixDecorationColor, browsers => - prefix(['text-decoration-color'], { - browsers, - feature: 'text-decoration' - }) -) - -let prefixDecorationLine = __webpack_require__(/*! caniuse-lite/data/features/mdn-text-decoration-line */ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js") - -f(prefixDecorationLine, browsers => - prefix(['text-decoration-line'], { - browsers, - feature: 'text-decoration' - }) -) - -let prefixDecorationStyle = __webpack_require__(/*! caniuse-lite/data/features/mdn-text-decoration-style */ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js") - -f(prefixDecorationStyle, browsers => - prefix(['text-decoration-style'], { - browsers, - feature: 'text-decoration' - }) -) - -// Text Size Adjust -let prefixTextSizeAdjust = __webpack_require__(/*! caniuse-lite/data/features/text-size-adjust */ "./node_modules/caniuse-lite/data/features/text-size-adjust.js") - -f(prefixTextSizeAdjust, browsers => - prefix(['text-size-adjust'], { - browsers, - feature: 'text-size-adjust' - }) -) - -// CSS Masks -let prefixCssMasks = __webpack_require__(/*! caniuse-lite/data/features/css-masks */ "./node_modules/caniuse-lite/data/features/css-masks.js") - -f(prefixCssMasks, browsers => { - prefix( - [ - 'mask-clip', - 'mask-composite', - 'mask-image', - 'mask-origin', - 'mask-repeat', - 'mask-border-repeat', - 'mask-border-source' - ], - { - browsers, - feature: 'css-masks' - } - ) - prefix( - [ - 'mask', - 'mask-position', - 'mask-size', - 'mask-border', - 'mask-border-outset', - 'mask-border-width', - 'mask-border-slice' - ], - { - browsers, - feature: 'css-masks' - } - ) -}) - -// CSS clip-path property -let prefixClipPath = __webpack_require__(/*! caniuse-lite/data/features/css-clip-path */ "./node_modules/caniuse-lite/data/features/css-clip-path.js") - -f(prefixClipPath, browsers => - prefix(['clip-path'], { - browsers, - feature: 'css-clip-path' - }) -) - -// Fragmented Borders and Backgrounds -let prefixBoxdecoration = __webpack_require__(/*! caniuse-lite/data/features/css-boxdecorationbreak */ "./node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js") - -f(prefixBoxdecoration, browsers => - prefix(['box-decoration-break'], { - browsers, - feature: 'css-boxdecorationbreak' - }) -) - -// CSS3 object-fit/object-position -let prefixObjectFit = __webpack_require__(/*! caniuse-lite/data/features/object-fit */ "./node_modules/caniuse-lite/data/features/object-fit.js") - -f(prefixObjectFit, browsers => - prefix(['object-fit', 'object-position'], { - browsers, - feature: 'object-fit' - }) -) - -// CSS Shapes -let prefixShapes = __webpack_require__(/*! caniuse-lite/data/features/css-shapes */ "./node_modules/caniuse-lite/data/features/css-shapes.js") - -f(prefixShapes, browsers => - prefix(['shape-margin', 'shape-outside', 'shape-image-threshold'], { - browsers, - feature: 'css-shapes' - }) -) - -// CSS3 text-overflow -let prefixTextOverflow = __webpack_require__(/*! caniuse-lite/data/features/text-overflow */ "./node_modules/caniuse-lite/data/features/text-overflow.js") - -f(prefixTextOverflow, browsers => - prefix(['text-overflow'], { - browsers, - feature: 'text-overflow' - }) -) - -// Viewport at-rule -let prefixDeviceadaptation = __webpack_require__(/*! caniuse-lite/data/features/css-deviceadaptation */ "./node_modules/caniuse-lite/data/features/css-deviceadaptation.js") - -f(prefixDeviceadaptation, browsers => - prefix(['@viewport'], { - browsers, - feature: 'css-deviceadaptation' - }) -) - -// Resolution Media Queries -let prefixResolut = __webpack_require__(/*! caniuse-lite/data/features/css-media-resolution */ "./node_modules/caniuse-lite/data/features/css-media-resolution.js") - -f(prefixResolut, { match: /( x($| )|a #2)/ }, browsers => - prefix(['@resolution'], { - browsers, - feature: 'css-media-resolution' - }) -) - -// CSS text-align-last -let prefixTextAlignLast = __webpack_require__(/*! caniuse-lite/data/features/css-text-align-last */ "./node_modules/caniuse-lite/data/features/css-text-align-last.js") - -f(prefixTextAlignLast, browsers => - prefix(['text-align-last'], { - browsers, - feature: 'css-text-align-last' - }) -) - -// Crisp Edges Image Rendering Algorithm -let prefixCrispedges = __webpack_require__(/*! caniuse-lite/data/features/css-crisp-edges */ "./node_modules/caniuse-lite/data/features/css-crisp-edges.js") - -f(prefixCrispedges, { match: /y x|a x #1/ }, browsers => - prefix(['pixelated'], { - browsers, - feature: 'css-crisp-edges', - props: ['image-rendering'] - }) -) - -f(prefixCrispedges, { match: /a x #2/ }, browsers => - prefix(['image-rendering'], { - browsers, - feature: 'css-crisp-edges' - }) -) - -// Logical Properties -let prefixLogicalProps = __webpack_require__(/*! caniuse-lite/data/features/css-logical-props */ "./node_modules/caniuse-lite/data/features/css-logical-props.js") - -f(prefixLogicalProps, browsers => - prefix( - [ - 'border-inline-start', - 'border-inline-end', - 'margin-inline-start', - 'margin-inline-end', - 'padding-inline-start', - 'padding-inline-end' - ], - { - browsers, - feature: 'css-logical-props' - } - ) -) - -f(prefixLogicalProps, { match: /x\s#2/ }, browsers => - prefix( - [ - 'border-block-start', - 'border-block-end', - 'margin-block-start', - 'margin-block-end', - 'padding-block-start', - 'padding-block-end' - ], - { - browsers, - feature: 'css-logical-props' - } - ) -) - -// CSS appearance -let prefixAppearance = __webpack_require__(/*! caniuse-lite/data/features/css-appearance */ "./node_modules/caniuse-lite/data/features/css-appearance.js") - -f(prefixAppearance, { match: /#2|x/ }, browsers => - prefix(['appearance'], { - browsers, - feature: 'css-appearance' - }) -) - -// CSS Scroll snap points -let prefixSnappoints = __webpack_require__(/*! caniuse-lite/data/features/css-snappoints */ "./node_modules/caniuse-lite/data/features/css-snappoints.js") - -f(prefixSnappoints, browsers => - prefix( - [ - 'scroll-snap-type', - 'scroll-snap-coordinate', - 'scroll-snap-destination', - 'scroll-snap-points-x', - 'scroll-snap-points-y' - ], - { - browsers, - feature: 'css-snappoints' - } - ) -) - -// CSS Regions -let prefixRegions = __webpack_require__(/*! caniuse-lite/data/features/css-regions */ "./node_modules/caniuse-lite/data/features/css-regions.js") - -f(prefixRegions, browsers => - prefix(['flow-into', 'flow-from', 'region-fragment'], { - browsers, - feature: 'css-regions' - }) -) - -// CSS image-set -let prefixImageSet = __webpack_require__(/*! caniuse-lite/data/features/css-image-set */ "./node_modules/caniuse-lite/data/features/css-image-set.js") - -f(prefixImageSet, browsers => - prefix(['image-set'], { - browsers, - feature: 'css-image-set', - props: [ - 'background', - 'background-image', - 'border-image', - 'cursor', - 'mask', - 'mask-image', - 'list-style', - 'list-style-image', - 'content' - ] - }) -) - -// Writing Mode -let prefixWritingMode = __webpack_require__(/*! caniuse-lite/data/features/css-writing-mode */ "./node_modules/caniuse-lite/data/features/css-writing-mode.js") - -f(prefixWritingMode, { match: /a|x/ }, browsers => - prefix(['writing-mode'], { - browsers, - feature: 'css-writing-mode' - }) -) - -// Cross-Fade Function -let prefixCrossFade = __webpack_require__(/*! caniuse-lite/data/features/css-cross-fade */ "./node_modules/caniuse-lite/data/features/css-cross-fade.js") - -f(prefixCrossFade, browsers => - prefix(['cross-fade'], { - browsers, - feature: 'css-cross-fade', - props: [ - 'background', - 'background-image', - 'border-image', - 'mask', - 'list-style', - 'list-style-image', - 'content', - 'mask-image' - ] - }) -) - -// Read Only selector -let prefixReadOnly = __webpack_require__(/*! caniuse-lite/data/features/css-read-only-write */ "./node_modules/caniuse-lite/data/features/css-read-only-write.js") - -f(prefixReadOnly, browsers => - prefix([':read-only', ':read-write'], { - browsers, - feature: 'css-read-only-write', - selector: true - }) -) - -// Text Emphasize -let prefixTextEmphasis = __webpack_require__(/*! caniuse-lite/data/features/text-emphasis */ "./node_modules/caniuse-lite/data/features/text-emphasis.js") - -f(prefixTextEmphasis, browsers => - prefix( - [ - 'text-emphasis', - 'text-emphasis-position', - 'text-emphasis-style', - 'text-emphasis-color' - ], - { - browsers, - feature: 'text-emphasis' - } - ) -) - -// CSS Grid Layout -let prefixGrid = __webpack_require__(/*! caniuse-lite/data/features/css-grid */ "./node_modules/caniuse-lite/data/features/css-grid.js") - -f(prefixGrid, browsers => { - prefix(['display-grid', 'inline-grid'], { - browsers, - feature: 'css-grid', - props: ['display'] - }) - prefix( - [ - 'grid-template-columns', - 'grid-template-rows', - 'grid-row-start', - 'grid-column-start', - 'grid-row-end', - 'grid-column-end', - 'grid-row', - 'grid-column', - 'grid-area', - 'grid-template', - 'grid-template-areas', - 'place-self' - ], - { - browsers, - feature: 'css-grid' - } - ) -}) - -f(prefixGrid, { match: /a x/ }, browsers => - prefix(['grid-column-align', 'grid-row-align'], { - browsers, - feature: 'css-grid' - }) -) - -// CSS text-spacing -let prefixTextSpacing = __webpack_require__(/*! caniuse-lite/data/features/css-text-spacing */ "./node_modules/caniuse-lite/data/features/css-text-spacing.js") - -f(prefixTextSpacing, browsers => - prefix(['text-spacing'], { - browsers, - feature: 'css-text-spacing' - }) -) - -// :any-link selector -let prefixAnyLink = __webpack_require__(/*! caniuse-lite/data/features/css-any-link */ "./node_modules/caniuse-lite/data/features/css-any-link.js") - -f(prefixAnyLink, browsers => - prefix([':any-link'], { - browsers, - feature: 'css-any-link', - selector: true - }) -) - -// unicode-bidi - -let bidiIsolate = __webpack_require__(/*! caniuse-lite/data/features/mdn-css-unicode-bidi-isolate */ "./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js") - -f(bidiIsolate, browsers => - prefix(['isolate'], { - browsers, - feature: 'css-unicode-bidi', - props: ['unicode-bidi'] - }) -) - -let bidiPlaintext = __webpack_require__(/*! caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext */ "./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js") - -f(bidiPlaintext, browsers => - prefix(['plaintext'], { - browsers, - feature: 'css-unicode-bidi', - props: ['unicode-bidi'] - }) -) - -let bidiOverride = __webpack_require__(/*! caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override */ "./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js") - -f(bidiOverride, { match: /y x/ }, browsers => - prefix(['isolate-override'], { - browsers, - feature: 'css-unicode-bidi', - props: ['unicode-bidi'] - }) -) - -// overscroll-behavior selector -let prefixOverscroll = __webpack_require__(/*! caniuse-lite/data/features/css-overscroll-behavior */ "./node_modules/caniuse-lite/data/features/css-overscroll-behavior.js") - -f(prefixOverscroll, { match: /a #1/ }, browsers => - prefix(['overscroll-behavior'], { - browsers, - feature: 'css-overscroll-behavior' - }) -) - -// text-orientation -let prefixTextOrientation = __webpack_require__(/*! caniuse-lite/data/features/css-text-orientation */ "./node_modules/caniuse-lite/data/features/css-text-orientation.js") - -f(prefixTextOrientation, browsers => - prefix(['text-orientation'], { - browsers, - feature: 'css-text-orientation' - }) -) - -// print-color-adjust -let prefixPrintAdjust = __webpack_require__(/*! caniuse-lite/data/features/css-print-color-adjust */ "./node_modules/caniuse-lite/data/features/css-print-color-adjust.js") - -f(prefixPrintAdjust, browsers => - prefix(['print-color-adjust', 'color-adjust'], { - browsers, - feature: 'css-print-color-adjust' - }) -) - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/at-rule.js": -/*!**************************************************!*\ - !*** ./node_modules/autoprefixer/lib/at-rule.js ***! - \**************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Prefixer = __webpack_require__(/*! ./prefixer */ "./node_modules/autoprefixer/lib/prefixer.js") - -class AtRule extends Prefixer { - /** - * Clone and add prefixes for at-rule - */ - add(rule, prefix) { - let prefixed = prefix + rule.name - - let already = rule.parent.some( - i => i.name === prefixed && i.params === rule.params - ) - if (already) { - return undefined - } - - let cloned = this.clone(rule, { name: prefixed }) - return rule.parent.insertBefore(rule, cloned) - } - - /** - * Clone node with prefixes - */ - process(node) { - let parent = this.parentPrefix(node) - - for (let prefix of this.prefixes) { - if (!parent || parent === prefix) { - this.add(node, prefix) - } - } - } -} - -module.exports = AtRule - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/autoprefixer.js": -/*!*******************************************************!*\ - !*** ./node_modules/autoprefixer/lib/autoprefixer.js ***! - \*******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); -let browserslist = __webpack_require__(/*! browserslist */ "./node_modules/browserslist/index.js") -let { agents } = __webpack_require__(/*! caniuse-lite/dist/unpacker/agents */ "./node_modules/caniuse-lite/dist/unpacker/agents.js") -let pico = __webpack_require__(/*! picocolors */ "./node_modules/picocolors/picocolors.browser.js") - -let dataPrefixes = __webpack_require__(/*! ../data/prefixes */ "./node_modules/autoprefixer/data/prefixes.js") -let Browsers = __webpack_require__(/*! ./browsers */ "./node_modules/autoprefixer/lib/browsers.js") -let getInfo = __webpack_require__(/*! ./info */ "./node_modules/autoprefixer/lib/info.js") -let Prefixes = __webpack_require__(/*! ./prefixes */ "./node_modules/autoprefixer/lib/prefixes.js") - -let autoprefixerData = { browsers: agents, prefixes: dataPrefixes } - -const WARNING = - '\n' + - ' Replace Autoprefixer `browsers` option to Browserslist config.\n' + - ' Use `browserslist` key in `package.json` or `.browserslistrc` file.\n' + - '\n' + - ' Using `browsers` option can cause errors. Browserslist config can\n' + - ' be used for Babel, Autoprefixer, postcss-normalize and other tools.\n' + - '\n' + - ' If you really need to use option, rename it to `overrideBrowserslist`.\n' + - '\n' + - ' Learn more at:\n' + - ' https://github.com/browserslist/browserslist#readme\n' + - ' https://twitter.com/browserslist\n' + - '\n' - -function isPlainObject(obj) { - return Object.prototype.toString.apply(obj) === '[object Object]' -} - -let cache = new Map() - -function timeCapsule(result, prefixes) { - if (prefixes.browsers.selected.length === 0) { - return - } - if (prefixes.add.selectors.length > 0) { - return - } - if (Object.keys(prefixes.add).length > 2) { - return - } - /* c8 ignore next 11 */ - result.warn( - 'Autoprefixer target browsers do not need any prefixes.' + - 'You do not need Autoprefixer anymore.\n' + - 'Check your Browserslist config to be sure that your targets ' + - 'are set up correctly.\n' + - '\n' + - ' Learn more at:\n' + - ' https://github.com/postcss/autoprefixer#readme\n' + - ' https://github.com/browserslist/browserslist#readme\n' + - '\n' - ) -} - -module.exports = plugin - -function plugin(...reqs) { - let options - if (reqs.length === 1 && isPlainObject(reqs[0])) { - options = reqs[0] - reqs = undefined - } else if (reqs.length === 0 || (reqs.length === 1 && !reqs[0])) { - reqs = undefined - } else if (reqs.length <= 2 && (Array.isArray(reqs[0]) || !reqs[0])) { - options = reqs[1] - reqs = reqs[0] - } else if (typeof reqs[reqs.length - 1] === 'object') { - options = reqs.pop() - } - - if (!options) { - options = {} - } - - if (options.browser) { - throw new Error( - 'Change `browser` option to `overrideBrowserslist` in Autoprefixer' - ) - } else if (options.browserslist) { - throw new Error( - 'Change `browserslist` option to `overrideBrowserslist` in Autoprefixer' - ) - } - - if (options.overrideBrowserslist) { - reqs = options.overrideBrowserslist - } else if (options.browsers) { - if (typeof console !== 'undefined' && console.warn) { - console.warn( - pico.red(WARNING.replace(/`[^`]+`/g, i => pico.yellow(i.slice(1, -1)))) - ) - } - reqs = options.browsers - } - - let brwlstOpts = { - env: options.env, - ignoreUnknownVersions: options.ignoreUnknownVersions, - stats: options.stats - } - - function loadPrefixes(opts) { - let d = autoprefixerData - let browsers = new Browsers(d.browsers, reqs, opts, brwlstOpts) - let key = browsers.selected.join(', ') + JSON.stringify(options) - - if (!cache.has(key)) { - cache.set(key, new Prefixes(d.prefixes, browsers, options)) - } - - return cache.get(key) - } - - return { - browsers: reqs, - - info(opts) { - opts = opts || {} - opts.from = opts.from || process.cwd() - return getInfo(loadPrefixes(opts)) - }, - - options, - - postcssPlugin: 'autoprefixer', - prepare(result) { - let prefixes = loadPrefixes({ - env: options.env, - from: result.opts.from - }) - - return { - OnceExit(root) { - timeCapsule(result, prefixes) - if (options.remove !== false) { - prefixes.processor.remove(root, result) - } - if (options.add !== false) { - prefixes.processor.add(root, result) - } - } - } - } - } -} - -plugin.postcss = true - -/** - * Autoprefixer data - */ -plugin.data = autoprefixerData - -/** - * Autoprefixer default browsers - */ -plugin.defaults = browserslist.defaults - -/** - * Inspect with default Autoprefixer - */ -plugin.info = () => plugin().info() - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/brackets.js": -/*!***************************************************!*\ - !*** ./node_modules/autoprefixer/lib/brackets.js ***! - \***************************************************/ -/***/ ((module) => { - -function last(array) { - return array[array.length - 1] -} - -let brackets = { - /** - * Parse string to nodes tree - */ - parse(str) { - let current = [''] - let stack = [current] - - for (let sym of str) { - if (sym === '(') { - current = [''] - last(stack).push(current) - stack.push(current) - continue - } - - if (sym === ')') { - stack.pop() - current = last(stack) - current.push('') - continue - } - - current[current.length - 1] += sym - } - - return stack[0] - }, - - /** - * Generate output string by nodes tree - */ - stringify(ast) { - let result = '' - for (let i of ast) { - if (typeof i === 'object') { - result += `(${brackets.stringify(i)})` - continue - } - - result += i - } - return result - } -} - -module.exports = brackets - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/browsers.js": -/*!***************************************************!*\ - !*** ./node_modules/autoprefixer/lib/browsers.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let browserslist = __webpack_require__(/*! browserslist */ "./node_modules/browserslist/index.js") -let { agents } = __webpack_require__(/*! caniuse-lite/dist/unpacker/agents */ "./node_modules/caniuse-lite/dist/unpacker/agents.js") - -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") - -class Browsers { - constructor(data, requirements, options, browserslistOpts) { - this.data = data - this.options = options || {} - this.browserslistOpts = browserslistOpts || {} - this.selected = this.parse(requirements) - } - - /** - * Return all prefixes for default browser data - */ - static prefixes() { - if (this.prefixesCache) { - return this.prefixesCache - } - - this.prefixesCache = [] - for (let name in agents) { - this.prefixesCache.push(`-${agents[name].prefix}-`) - } - - this.prefixesCache = utils - .uniq(this.prefixesCache) - .sort((a, b) => b.length - a.length) - - return this.prefixesCache - } - - /** - * Check is value contain any possible prefix - */ - static withPrefix(value) { - if (!this.prefixesRegexp) { - this.prefixesRegexp = new RegExp(this.prefixes().join('|')) - } - - return this.prefixesRegexp.test(value) - } - - /** - * Is browser is selected by requirements - */ - isSelected(browser) { - return this.selected.includes(browser) - } - - /** - * Return browsers selected by requirements - */ - parse(requirements) { - let opts = {} - for (let i in this.browserslistOpts) { - opts[i] = this.browserslistOpts[i] - } - opts.path = this.options.from - return browserslist(requirements, opts) - } - - /** - * Return prefix for selected browser - */ - prefix(browser) { - let [name, version] = browser.split(' ') - let data = this.data[name] - - let prefix = data.prefix_exceptions && data.prefix_exceptions[version] - if (!prefix) { - prefix = data.prefix - } - return `-${prefix}-` - } -} - -module.exports = Browsers - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/declaration.js": -/*!******************************************************!*\ - !*** ./node_modules/autoprefixer/lib/declaration.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Browsers = __webpack_require__(/*! ./browsers */ "./node_modules/autoprefixer/lib/browsers.js") -let Prefixer = __webpack_require__(/*! ./prefixer */ "./node_modules/autoprefixer/lib/prefixer.js") -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") - -class Declaration extends Prefixer { - /** - * Clone and add prefixes for declaration - */ - add(decl, prefix, prefixes, result) { - let prefixed = this.prefixed(decl.prop, prefix) - if ( - this.isAlready(decl, prefixed) || - this.otherPrefixes(decl.value, prefix) - ) { - return undefined - } - return this.insert(decl, prefix, prefixes, result) - } - - /** - * Calculate indentation to create visual cascade - */ - calcBefore(prefixes, decl, prefix = '') { - let max = this.maxPrefixed(prefixes, decl) - let diff = max - utils.removeNote(prefix).length - - let before = decl.raw('before') - if (diff > 0) { - before += Array(diff).fill(' ').join('') - } - - return before - } - - /** - * Always true, because we already get prefixer by property name - */ - check(/* decl */) { - return true - } - - /** - * Clone and insert new declaration - */ - insert(decl, prefix, prefixes) { - let cloned = this.set(this.clone(decl), prefix) - if (!cloned) return undefined - - let already = decl.parent.some( - i => i.prop === cloned.prop && i.value === cloned.value - ) - if (already) { - return undefined - } - - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - return decl.parent.insertBefore(decl, cloned) - } - - /** - * Did this declaration has this prefix above - */ - isAlready(decl, prefixed) { - let already = this.all.group(decl).up(i => i.prop === prefixed) - if (!already) { - already = this.all.group(decl).down(i => i.prop === prefixed) - } - return already - } - - /** - * Return maximum length of possible prefixed property - */ - maxPrefixed(prefixes, decl) { - if (decl._autoprefixerMax) { - return decl._autoprefixerMax - } - - let max = 0 - for (let prefix of prefixes) { - prefix = utils.removeNote(prefix) - if (prefix.length > max) { - max = prefix.length - } - } - decl._autoprefixerMax = max - - return decl._autoprefixerMax - } - - /** - * Should we use visual cascade for prefixes - */ - needCascade(decl) { - if (!decl._autoprefixerCascade) { - decl._autoprefixerCascade = - this.all.options.cascade !== false && decl.raw('before').includes('\n') - } - return decl._autoprefixerCascade - } - - /** - * Return unprefixed version of property - */ - normalize(prop) { - return prop - } - - /** - * Return list of prefixed properties to clean old prefixes - */ - old(prop, prefix) { - return [this.prefixed(prop, prefix)] - } - - /** - * Check `value`, that it contain other prefixes, rather than `prefix` - */ - otherPrefixes(value, prefix) { - for (let other of Browsers.prefixes()) { - if (other === prefix) { - continue - } - if (value.includes(other)) { - return value.replace(/var\([^)]+\)/, '').includes(other) - } - } - return false - } - - /** - * Return prefixed version of property - */ - prefixed(prop, prefix) { - return prefix + prop - } - - /** - * Add spaces for visual cascade - */ - process(decl, result) { - if (!this.needCascade(decl)) { - super.process(decl, result) - return - } - - let prefixes = super.process(decl, result) - - if (!prefixes || !prefixes.length) { - return - } - - this.restoreBefore(decl) - decl.raws.before = this.calcBefore(prefixes, decl) - } - - /** - * Remove visual cascade - */ - restoreBefore(decl) { - let lines = decl.raw('before').split('\n') - let min = lines[lines.length - 1] - - this.all.group(decl).up(prefixed => { - let array = prefixed.raw('before').split('\n') - let last = array[array.length - 1] - if (last.length < min.length) { - min = last - } - }) - - lines[lines.length - 1] = min - decl.raws.before = lines.join('\n') - } - - /** - * Set prefix to declaration - */ - set(decl, prefix) { - decl.prop = this.prefixed(decl.prop, prefix) - return decl - } -} - -module.exports = Declaration - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/align-content.js": -/*!**************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/align-content.js ***! - \**************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class AlignContent extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'align-content' - } - - /** - * Change property name for 2012 spec - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2012) { - return prefix + 'flex-line-pack' - } - return super.prefixed(prop, prefix) - } - - /** - * Change value for 2012 spec and ignore prefix for 2009 - */ - set(decl, prefix) { - let spec = flexSpec(prefix)[0] - if (spec === 2012) { - decl.value = AlignContent.oldValues[decl.value] || decl.value - return super.set(decl, prefix) - } - if (spec === 'final') { - return super.set(decl, prefix) - } - return undefined - } -} - -AlignContent.names = ['align-content', 'flex-line-pack'] - -AlignContent.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start', - 'space-around': 'distribute', - 'space-between': 'justify' -} - -module.exports = AlignContent - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/align-items.js": -/*!************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/align-items.js ***! - \************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class AlignItems extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'align-items' - } - - /** - * Change property name for 2009 and 2012 specs - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2009) { - return prefix + 'box-align' - } - if (spec === 2012) { - return prefix + 'flex-align' - } - return super.prefixed(prop, prefix) - } - - /** - * Change value for 2009 and 2012 specs - */ - set(decl, prefix) { - let spec = flexSpec(prefix)[0] - if (spec === 2009 || spec === 2012) { - decl.value = AlignItems.oldValues[decl.value] || decl.value - } - return super.set(decl, prefix) - } -} - -AlignItems.names = ['align-items', 'flex-align', 'box-align'] - -AlignItems.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start' -} - -module.exports = AlignItems - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/align-self.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/align-self.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class AlignSelf extends Declaration { - check(decl) { - return ( - decl.parent && - !decl.parent.some(i => { - return i.prop && i.prop.startsWith('grid-') - }) - ) - } - - /** - * Return property name by final spec - */ - normalize() { - return 'align-self' - } - - /** - * Change property name for 2012 specs - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2012) { - return prefix + 'flex-item-align' - } - return super.prefixed(prop, prefix) - } - - /** - * Change value for 2012 spec and ignore prefix for 2009 - */ - set(decl, prefix) { - let spec = flexSpec(prefix)[0] - if (spec === 2012) { - decl.value = AlignSelf.oldValues[decl.value] || decl.value - return super.set(decl, prefix) - } - if (spec === 'final') { - return super.set(decl, prefix) - } - return undefined - } -} - -AlignSelf.names = ['align-self', 'flex-item-align'] - -AlignSelf.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start' -} - -module.exports = AlignSelf - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/animation.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/animation.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class Animation extends Declaration { - /** - * Don’t add prefixes for modern values. - */ - check(decl) { - return !decl.value.split(/\s+/).some(i => { - let lower = i.toLowerCase() - return lower === 'reverse' || lower === 'alternate-reverse' - }) - } -} - -Animation.names = ['animation', 'animation-direction'] - -module.exports = Animation - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/appearance.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/appearance.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let utils = __webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js") - -class Appearance extends Declaration { - constructor(name, prefixes, all) { - super(name, prefixes, all) - - if (this.prefixes) { - this.prefixes = utils.uniq( - this.prefixes.map(i => { - if (i === '-ms-') { - return '-webkit-' - } - return i - }) - ) - } - } -} - -Appearance.names = ['appearance'] - -module.exports = Appearance - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/autofill.js": -/*!*********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/autofill.js ***! - \*********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Selector = __webpack_require__(/*! ../selector */ "./node_modules/autoprefixer/lib/selector.js") -let utils = __webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js") - -class Autofill extends Selector { - constructor(name, prefixes, all) { - super(name, prefixes, all) - - if (this.prefixes) { - this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-')) - } - } - - /** - * Return different selectors depend on prefix - */ - prefixed(prefix) { - if (prefix === '-webkit-') { - return ':-webkit-autofill' - } - return `:${prefix}autofill` - } -} - -Autofill.names = [':autofill'] - -module.exports = Autofill - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/backdrop-filter.js": -/*!****************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/backdrop-filter.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let utils = __webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js") - -class BackdropFilter extends Declaration { - constructor(name, prefixes, all) { - super(name, prefixes, all) - - if (this.prefixes) { - this.prefixes = utils.uniq( - this.prefixes.map(i => { - return i === '-ms-' ? '-webkit-' : i - }) - ) - } - } -} - -BackdropFilter.names = ['backdrop-filter'] - -module.exports = BackdropFilter - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/background-clip.js": -/*!****************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/background-clip.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let utils = __webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js") - -class BackgroundClip extends Declaration { - constructor(name, prefixes, all) { - super(name, prefixes, all) - - if (this.prefixes) { - this.prefixes = utils.uniq( - this.prefixes.map(i => { - return i === '-ms-' ? '-webkit-' : i - }) - ) - } - } - - check(decl) { - return decl.value.toLowerCase() === 'text' - } -} - -BackgroundClip.names = ['background-clip'] - -module.exports = BackgroundClip - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/background-size.js": -/*!****************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/background-size.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class BackgroundSize extends Declaration { - /** - * Duplication parameter for -webkit- browsers - */ - set(decl, prefix) { - let value = decl.value.toLowerCase() - if ( - prefix === '-webkit-' && - !value.includes(' ') && - value !== 'contain' && - value !== 'cover' - ) { - decl.value = decl.value + ' ' + decl.value - } - return super.set(decl, prefix) - } -} - -BackgroundSize.names = ['background-size'] - -module.exports = BackgroundSize - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/block-logical.js": -/*!**************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/block-logical.js ***! - \**************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class BlockLogical extends Declaration { - /** - * Return property name by spec - */ - normalize(prop) { - if (prop.includes('-before')) { - return prop.replace('-before', '-block-start') - } - return prop.replace('-after', '-block-end') - } - - /** - * Use old syntax for -moz- and -webkit- - */ - prefixed(prop, prefix) { - if (prop.includes('-start')) { - return prefix + prop.replace('-block-start', '-before') - } - return prefix + prop.replace('-block-end', '-after') - } -} - -BlockLogical.names = [ - 'border-block-start', - 'border-block-end', - 'margin-block-start', - 'margin-block-end', - 'padding-block-start', - 'padding-block-end', - 'border-before', - 'border-after', - 'margin-before', - 'margin-after', - 'padding-before', - 'padding-after' -] - -module.exports = BlockLogical - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/border-image.js": -/*!*************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/border-image.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class BorderImage extends Declaration { - /** - * Remove fill parameter for prefixed declarations - */ - set(decl, prefix) { - decl.value = decl.value.replace(/\s+fill(\s)/, '$1') - return super.set(decl, prefix) - } -} - -BorderImage.names = ['border-image'] - -module.exports = BorderImage - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/border-radius.js": -/*!**************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/border-radius.js ***! - \**************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class BorderRadius extends Declaration { - /** - * Return unprefixed version of property - */ - normalize(prop) { - return BorderRadius.toNormal[prop] || prop - } - - /** - * Change syntax, when add Mozilla prefix - */ - prefixed(prop, prefix) { - if (prefix === '-moz-') { - return prefix + (BorderRadius.toMozilla[prop] || prop) - } - return super.prefixed(prop, prefix) - } -} - -BorderRadius.names = ['border-radius'] - -BorderRadius.toMozilla = {} -BorderRadius.toNormal = {} - -for (let ver of ['top', 'bottom']) { - for (let hor of ['left', 'right']) { - let normal = `border-${ver}-${hor}-radius` - let mozilla = `border-radius-${ver}${hor}` - - BorderRadius.names.push(normal) - BorderRadius.names.push(mozilla) - - BorderRadius.toMozilla[normal] = mozilla - BorderRadius.toNormal[mozilla] = normal - } -} - -module.exports = BorderRadius - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/break-props.js": -/*!************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/break-props.js ***! - \************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class BreakProps extends Declaration { - /** - * Don’t prefix some values - */ - insert(decl, prefix, prefixes) { - if (decl.prop !== 'break-inside') { - return super.insert(decl, prefix, prefixes) - } - if (/region/i.test(decl.value) || /page/i.test(decl.value)) { - return undefined - } - return super.insert(decl, prefix, prefixes) - } - - /** - * Return property name by final spec - */ - normalize(prop) { - if (prop.includes('inside')) { - return 'break-inside' - } - if (prop.includes('before')) { - return 'break-before' - } - return 'break-after' - } - - /** - * Change name for -webkit- and -moz- prefix - */ - prefixed(prop, prefix) { - return `${prefix}column-${prop}` - } - - /** - * Change prefixed value for avoid-column and avoid-page - */ - set(decl, prefix) { - if ( - (decl.prop === 'break-inside' && decl.value === 'avoid-column') || - decl.value === 'avoid-page' - ) { - decl.value = 'avoid' - } - return super.set(decl, prefix) - } -} - -BreakProps.names = [ - 'break-inside', - 'page-break-inside', - 'column-break-inside', - 'break-before', - 'page-break-before', - 'column-break-before', - 'break-after', - 'page-break-after', - 'column-break-after' -] - -module.exports = BreakProps - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/cross-fade.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/cross-fade.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let list = (__webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js").list) - -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") - -class CrossFade extends Value { - replace(string, prefix) { - return list - .space(string) - .map(value => { - if (value.slice(0, +this.name.length + 1) !== this.name + '(') { - return value - } - - let close = value.lastIndexOf(')') - let after = value.slice(close + 1) - let args = value.slice(this.name.length + 1, close) - - if (prefix === '-webkit-') { - let match = args.match(/\d*.?\d+%?/) - if (match) { - args = args.slice(match[0].length).trim() - args += `, ${match[0]}` - } else { - args += ', 0.5' - } - } - return prefix + this.name + '(' + args + ')' + after - }) - .join(' ') - } -} - -CrossFade.names = ['cross-fade'] - -module.exports = CrossFade - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/display-flex.js": -/*!*************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/display-flex.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let OldValue = __webpack_require__(/*! ../old-value */ "./node_modules/autoprefixer/lib/old-value.js") -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class DisplayFlex extends Value { - constructor(name, prefixes) { - super(name, prefixes) - if (name === 'display-flex') { - this.name = 'flex' - } - } - - /** - * Faster check for flex value - */ - check(decl) { - return decl.prop === 'display' && decl.value === this.name - } - - /** - * Change value for old specs - */ - old(prefix) { - let prefixed = this.prefixed(prefix) - if (!prefixed) return undefined - return new OldValue(this.name, prefixed) - } - - /** - * Return value by spec - */ - prefixed(prefix) { - let spec, value - ;[spec, prefix] = flexSpec(prefix) - - if (spec === 2009) { - if (this.name === 'flex') { - value = 'box' - } else { - value = 'inline-box' - } - } else if (spec === 2012) { - if (this.name === 'flex') { - value = 'flexbox' - } else { - value = 'inline-flexbox' - } - } else if (spec === 'final') { - value = this.name - } - - return prefix + value - } - - /** - * Add prefix to value depend on flebox spec version - */ - replace(string, prefix) { - return this.prefixed(prefix) - } -} - -DisplayFlex.names = ['display-flex', 'inline-flex'] - -module.exports = DisplayFlex - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/display-grid.js": -/*!*************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/display-grid.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") - -class DisplayGrid extends Value { - constructor(name, prefixes) { - super(name, prefixes) - if (name === 'display-grid') { - this.name = 'grid' - } - } - - /** - * Faster check for flex value - */ - check(decl) { - return decl.prop === 'display' && decl.value === this.name - } -} - -DisplayGrid.names = ['display-grid', 'inline-grid'] - -module.exports = DisplayGrid - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/file-selector-button.js": -/*!*********************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/file-selector-button.js ***! - \*********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Selector = __webpack_require__(/*! ../selector */ "./node_modules/autoprefixer/lib/selector.js") -let utils = __webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js") - -class FileSelectorButton extends Selector { - constructor(name, prefixes, all) { - super(name, prefixes, all) - - if (this.prefixes) { - this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-')) - } - } - - /** - * Return different selectors depend on prefix - */ - prefixed(prefix) { - if (prefix === '-webkit-') { - return '::-webkit-file-upload-button' - } - return `::${prefix}file-selector-button` - } -} - -FileSelectorButton.names = ['::file-selector-button'] - -module.exports = FileSelectorButton - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/filter-value.js": -/*!*************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/filter-value.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") - -class FilterValue extends Value { - constructor(name, prefixes) { - super(name, prefixes) - if (name === 'filter-function') { - this.name = 'filter' - } - } -} - -FilterValue.names = ['filter', 'filter-function'] - -module.exports = FilterValue - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/filter.js": -/*!*******************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/filter.js ***! - \*******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class Filter extends Declaration { - /** - * Check is it Internet Explorer filter - */ - check(decl) { - let v = decl.value - return ( - !v.toLowerCase().includes('alpha(') && - !v.includes('DXImageTransform.Microsoft') && - !v.includes('data:image/svg+xml') - ) - } -} - -Filter.names = ['filter'] - -module.exports = Filter - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex-basis.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex-basis.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class FlexBasis extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'flex-basis' - } - - /** - * Return flex property for 2012 spec - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2012) { - return prefix + 'flex-preferred-size' - } - return super.prefixed(prop, prefix) - } - - /** - * Ignore 2009 spec and use flex property for 2012 - */ - set(decl, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2012 || spec === 'final') { - return super.set(decl, prefix) - } - return undefined - } -} - -FlexBasis.names = ['flex-basis', 'flex-preferred-size'] - -module.exports = FlexBasis - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex-direction.js": -/*!***************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex-direction.js ***! - \***************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class FlexDirection extends Declaration { - /** - * Use two properties for 2009 spec - */ - insert(decl, prefix, prefixes) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec !== 2009) { - return super.insert(decl, prefix, prefixes) - } - let already = decl.parent.some( - i => - i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction' - ) - if (already) { - return undefined - } - - let v = decl.value - let dir, orient - if (v === 'inherit' || v === 'initial' || v === 'unset') { - orient = v - dir = v - } else { - orient = v.includes('row') ? 'horizontal' : 'vertical' - dir = v.includes('reverse') ? 'reverse' : 'normal' - } - - let cloned = this.clone(decl) - cloned.prop = prefix + 'box-orient' - cloned.value = orient - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - decl.parent.insertBefore(decl, cloned) - - cloned = this.clone(decl) - cloned.prop = prefix + 'box-direction' - cloned.value = dir - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - return decl.parent.insertBefore(decl, cloned) - } - - /** - * Return property name by final spec - */ - normalize() { - return 'flex-direction' - } - - /** - * Clean two properties for 2009 spec - */ - old(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2009) { - return [prefix + 'box-orient', prefix + 'box-direction'] - } else { - return super.old(prop, prefix) - } - } -} - -FlexDirection.names = ['flex-direction', 'box-direction', 'box-orient'] - -module.exports = FlexDirection - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex-flow.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex-flow.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class FlexFlow extends Declaration { - /** - * Use two properties for 2009 spec - */ - insert(decl, prefix, prefixes) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec !== 2009) { - return super.insert(decl, prefix, prefixes) - } - let values = decl.value - .split(/\s+/) - .filter(i => i !== 'wrap' && i !== 'nowrap' && 'wrap-reverse') - if (values.length === 0) { - return undefined - } - - let already = decl.parent.some( - i => - i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction' - ) - if (already) { - return undefined - } - - let value = values[0] - let orient = value.includes('row') ? 'horizontal' : 'vertical' - let dir = value.includes('reverse') ? 'reverse' : 'normal' - - let cloned = this.clone(decl) - cloned.prop = prefix + 'box-orient' - cloned.value = orient - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - decl.parent.insertBefore(decl, cloned) - - cloned = this.clone(decl) - cloned.prop = prefix + 'box-direction' - cloned.value = dir - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - return decl.parent.insertBefore(decl, cloned) - } -} - -FlexFlow.names = ['flex-flow', 'box-direction', 'box-orient'] - -module.exports = FlexFlow - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex-grow.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex-grow.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class Flex extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'flex' - } - - /** - * Return flex property for 2009 and 2012 specs - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2009) { - return prefix + 'box-flex' - } - if (spec === 2012) { - return prefix + 'flex-positive' - } - return super.prefixed(prop, prefix) - } -} - -Flex.names = ['flex-grow', 'flex-positive'] - -module.exports = Flex - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex-shrink.js": -/*!************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex-shrink.js ***! - \************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class FlexShrink extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'flex-shrink' - } - - /** - * Return flex property for 2012 spec - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2012) { - return prefix + 'flex-negative' - } - return super.prefixed(prop, prefix) - } - - /** - * Ignore 2009 spec and use flex property for 2012 - */ - set(decl, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2012 || spec === 'final') { - return super.set(decl, prefix) - } - return undefined - } -} - -FlexShrink.names = ['flex-shrink', 'flex-negative'] - -module.exports = FlexShrink - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex-spec.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex-spec.js ***! - \**********************************************************/ -/***/ ((module) => { - -/** - * Return flexbox spec versions by prefix - */ -module.exports = function (prefix) { - let spec - if (prefix === '-webkit- 2009' || prefix === '-moz-') { - spec = 2009 - } else if (prefix === '-ms-') { - spec = 2012 - } else if (prefix === '-webkit-') { - spec = 'final' - } - - if (prefix === '-webkit- 2009') { - prefix = '-webkit-' - } - - return [spec, prefix] -} - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex-wrap.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex-wrap.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class FlexWrap extends Declaration { - /** - * Don't add prefix for 2009 spec - */ - set(decl, prefix) { - let spec = flexSpec(prefix)[0] - if (spec !== 2009) { - return super.set(decl, prefix) - } - return undefined - } -} - -FlexWrap.names = ['flex-wrap'] - -module.exports = FlexWrap - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/flex.js": -/*!*****************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/flex.js ***! - \*****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let list = (__webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js").list) - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class Flex extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'flex' - } - - /** - * Change property name for 2009 spec - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2009) { - return prefix + 'box-flex' - } - return super.prefixed(prop, prefix) - } - - /** - * Spec 2009 supports only first argument - * Spec 2012 disallows unitless basis - */ - set(decl, prefix) { - let spec = flexSpec(prefix)[0] - if (spec === 2009) { - decl.value = list.space(decl.value)[0] - decl.value = Flex.oldValues[decl.value] || decl.value - return super.set(decl, prefix) - } - if (spec === 2012) { - let components = list.space(decl.value) - if (components.length === 3 && components[2] === '0') { - decl.value = components.slice(0, 2).concat('0px').join(' ') - } - } - return super.set(decl, prefix) - } -} - -Flex.names = ['flex', 'box-flex'] - -Flex.oldValues = { - auto: '1', - none: '0' -} - -module.exports = Flex - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/fullscreen.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/fullscreen.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Selector = __webpack_require__(/*! ../selector */ "./node_modules/autoprefixer/lib/selector.js") - -class Fullscreen extends Selector { - /** - * Return different selectors depend on prefix - */ - prefixed(prefix) { - if (prefix === '-webkit-') { - return ':-webkit-full-screen' - } - if (prefix === '-moz-') { - return ':-moz-full-screen' - } - return `:${prefix}fullscreen` - } -} - -Fullscreen.names = [':fullscreen'] - -module.exports = Fullscreen - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/gradient.js": -/*!*********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/gradient.js ***! - \*********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let range = __webpack_require__(/*! normalize-range */ "./node_modules/normalize-range/index.js") -let parser = __webpack_require__(/*! postcss-value-parser */ "./node_modules/postcss-value-parser/lib/index.js") - -let OldValue = __webpack_require__(/*! ../old-value */ "./node_modules/autoprefixer/lib/old-value.js") -let utils = __webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js") -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") - -let IS_DIRECTION = /top|left|right|bottom/gi - -class Gradient extends Value { - /** - * Do not add non-webkit prefixes for list-style and object - */ - add(decl, prefix) { - let p = decl.prop - if (p.includes('mask')) { - if (prefix === '-webkit-' || prefix === '-webkit- old') { - return super.add(decl, prefix) - } - } else if ( - p === 'list-style' || - p === 'list-style-image' || - p === 'content' - ) { - if (prefix === '-webkit-' || prefix === '-webkit- old') { - return super.add(decl, prefix) - } - } else { - return super.add(decl, prefix) - } - return undefined - } - - /** - * Get div token from exists parameters - */ - cloneDiv(params) { - for (let i of params) { - if (i.type === 'div' && i.value === ',') { - return i - } - } - return { after: ' ', type: 'div', value: ',' } - } - - /** - * Change colors syntax to old webkit - */ - colorStops(params) { - let result = [] - for (let i = 0; i < params.length; i++) { - let pos - let param = params[i] - let item - if (i === 0) { - continue - } - - let color = parser.stringify(param[0]) - if (param[1] && param[1].type === 'word') { - pos = param[1].value - } else if (param[2] && param[2].type === 'word') { - pos = param[2].value - } - - let stop - if (i === 1 && (!pos || pos === '0%')) { - stop = `from(${color})` - } else if (i === params.length - 1 && (!pos || pos === '100%')) { - stop = `to(${color})` - } else if (pos) { - stop = `color-stop(${pos}, ${color})` - } else { - stop = `color-stop(${color})` - } - - let div = param[param.length - 1] - params[i] = [{ type: 'word', value: stop }] - if (div.type === 'div' && div.value === ',') { - item = params[i].push(div) - } - result.push(item) - } - return result - } - - /** - * Change new direction to old - */ - convertDirection(params) { - if (params.length > 0) { - if (params[0].value === 'to') { - this.fixDirection(params) - } else if (params[0].value.includes('deg')) { - this.fixAngle(params) - } else if (this.isRadial(params)) { - this.fixRadial(params) - } - } - return params - } - - /** - * Add 90 degrees - */ - fixAngle(params) { - let first = params[0].value - first = parseFloat(first) - first = Math.abs(450 - first) % 360 - first = this.roundFloat(first, 3) - params[0].value = `${first}deg` - } - - /** - * Replace `to top left` to `bottom right` - */ - fixDirection(params) { - params.splice(0, 2) - - for (let param of params) { - if (param.type === 'div') { - break - } - if (param.type === 'word') { - param.value = this.revertDirection(param.value) - } - } - } - - /** - * Fix radial direction syntax - */ - fixRadial(params) { - let first = [] - let second = [] - let a, b, c, i, next - - for (i = 0; i < params.length - 2; i++) { - a = params[i] - b = params[i + 1] - c = params[i + 2] - if (a.type === 'space' && b.value === 'at' && c.type === 'space') { - next = i + 3 - break - } else { - first.push(a) - } - } - - let div - for (i = next; i < params.length; i++) { - if (params[i].type === 'div') { - div = params[i] - break - } else { - second.push(params[i]) - } - } - - params.splice(0, i, ...second, div, ...first) - } - - /** - * Look for at word - */ - isRadial(params) { - let state = 'before' - for (let param of params) { - if (state === 'before' && param.type === 'space') { - state = 'at' - } else if (state === 'at' && param.value === 'at') { - state = 'after' - } else if (state === 'after' && param.type === 'space') { - return true - } else if (param.type === 'div') { - break - } else { - state = 'before' - } - } - return false - } - - /** - * Replace old direction to new - */ - newDirection(params) { - if (params[0].value === 'to') { - return params - } - IS_DIRECTION.lastIndex = 0 // reset search index of global regexp - if (!IS_DIRECTION.test(params[0].value)) { - return params - } - - params.unshift( - { - type: 'word', - value: 'to' - }, - { - type: 'space', - value: ' ' - } - ) - - for (let i = 2; i < params.length; i++) { - if (params[i].type === 'div') { - break - } - if (params[i].type === 'word') { - params[i].value = this.revertDirection(params[i].value) - } - } - - return params - } - - /** - * Normalize angle - */ - normalize(nodes, gradientName) { - if (!nodes[0]) return nodes - - if (/-?\d+(.\d+)?grad/.test(nodes[0].value)) { - nodes[0].value = this.normalizeUnit(nodes[0].value, 400) - } else if (/-?\d+(.\d+)?rad/.test(nodes[0].value)) { - nodes[0].value = this.normalizeUnit(nodes[0].value, 2 * Math.PI) - } else if (/-?\d+(.\d+)?turn/.test(nodes[0].value)) { - nodes[0].value = this.normalizeUnit(nodes[0].value, 1) - } else if (nodes[0].value.includes('deg')) { - let num = parseFloat(nodes[0].value) - num = range.wrap(0, 360, num) - nodes[0].value = `${num}deg` - } - - if ( - gradientName === 'linear-gradient' || - gradientName === 'repeating-linear-gradient' - ) { - let direction = nodes[0].value - - // Unitless zero for `` values are allowed in CSS gradients and transforms. - // Spec: https://github.com/w3c/csswg-drafts/commit/602789171429b2231223ab1e5acf8f7f11652eb3 - if (direction === '0deg' || direction === '0') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'top') - } else if (direction === '90deg') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'right') - } else if (direction === '180deg') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom') // default value - } else if (direction === '270deg') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'left') - } - } - - return nodes - } - - /** - * Convert angle unit to deg - */ - normalizeUnit(str, full) { - let num = parseFloat(str) - let deg = (num / full) * 360 - return `${deg}deg` - } - - /** - * Remove old WebKit gradient too - */ - old(prefix) { - if (prefix === '-webkit-') { - let type - if (this.name === 'linear-gradient') { - type = 'linear' - } else if (this.name === 'repeating-linear-gradient') { - type = 'repeating-linear' - } else if (this.name === 'repeating-radial-gradient') { - type = 'repeating-radial' - } else { - type = 'radial' - } - let string = '-gradient' - let regexp = utils.regexp( - `-webkit-(${type}-gradient|gradient\\(\\s*${type})`, - false - ) - - return new OldValue(this.name, prefix + this.name, string, regexp) - } else { - return super.old(prefix) - } - } - - /** - * Change direction syntax to old webkit - */ - oldDirection(params) { - let div = this.cloneDiv(params[0]) - - if (params[0][0].value !== 'to') { - return params.unshift([ - { type: 'word', value: Gradient.oldDirections.bottom }, - div - ]) - } else { - let words = [] - for (let node of params[0].slice(2)) { - if (node.type === 'word') { - words.push(node.value.toLowerCase()) - } - } - - words = words.join(' ') - let old = Gradient.oldDirections[words] || words - - params[0] = [{ type: 'word', value: old }, div] - return params[0] - } - } - - /** - * Convert to old webkit syntax - */ - oldWebkit(node) { - let { nodes } = node - let string = parser.stringify(node.nodes) - - if (this.name !== 'linear-gradient') { - return false - } - if (nodes[0] && nodes[0].value.includes('deg')) { - return false - } - if ( - string.includes('px') || - string.includes('-corner') || - string.includes('-side') - ) { - return false - } - - let params = [[]] - for (let i of nodes) { - params[params.length - 1].push(i) - if (i.type === 'div' && i.value === ',') { - params.push([]) - } - } - - this.oldDirection(params) - this.colorStops(params) - - node.nodes = [] - for (let param of params) { - node.nodes = node.nodes.concat(param) - } - - node.nodes.unshift( - { type: 'word', value: 'linear' }, - this.cloneDiv(node.nodes) - ) - node.value = '-webkit-gradient' - - return true - } - - /** - * Change degrees for webkit prefix - */ - replace(string, prefix) { - let ast = parser(string) - for (let node of ast.nodes) { - let gradientName = this.name // gradient name - if (node.type === 'function' && node.value === gradientName) { - node.nodes = this.newDirection(node.nodes) - node.nodes = this.normalize(node.nodes, gradientName) - if (prefix === '-webkit- old') { - let changes = this.oldWebkit(node) - if (!changes) { - return false - } - } else { - node.nodes = this.convertDirection(node.nodes) - node.value = prefix + node.value - } - } - } - return ast.toString() - } - - /** - * Replace first token - */ - replaceFirst(params, ...words) { - let prefix = words.map(i => { - if (i === ' ') { - return { type: 'space', value: i } - } - return { type: 'word', value: i } - }) - return prefix.concat(params.slice(1)) - } - - revertDirection(word) { - return Gradient.directions[word.toLowerCase()] || word - } - - /** - * Round float and save digits under dot - */ - roundFloat(float, digits) { - return parseFloat(float.toFixed(digits)) - } -} - -Gradient.names = [ - 'linear-gradient', - 'repeating-linear-gradient', - 'radial-gradient', - 'repeating-radial-gradient' -] - -Gradient.directions = { - bottom: 'top', - left: 'right', - right: 'left', - top: 'bottom' // default value -} - -// Direction to replace -Gradient.oldDirections = { - 'bottom': 'left top, left bottom', - 'bottom left': 'right top, left bottom', - 'bottom right': 'left top, right bottom', - 'left': 'right top, left top', - - 'left bottom': 'right top, left bottom', - 'left top': 'right bottom, left top', - 'right': 'left top, right top', - 'right bottom': 'left top, right bottom', - 'right top': 'left bottom, right top', - 'top': 'left bottom, left top', - 'top left': 'right bottom, left top', - 'top right': 'left bottom, right top' -} - -module.exports = Gradient - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-area.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-area.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let utils = __webpack_require__(/*! ./grid-utils */ "./node_modules/autoprefixer/lib/hacks/grid-utils.js") - -class GridArea extends Declaration { - /** - * Translate grid-area to separate -ms- prefixed properties - */ - insert(decl, prefix, prefixes, result) { - if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) - - let values = utils.parse(decl) - - let [rowStart, rowSpan] = utils.translate(values, 0, 2) - let [columnStart, columnSpan] = utils.translate(values, 1, 3) - - ;[ - ['grid-row', rowStart], - ['grid-row-span', rowSpan], - ['grid-column', columnStart], - ['grid-column-span', columnSpan] - ].forEach(([prop, value]) => { - utils.insertDecl(decl, prop, value) - }) - - utils.warnTemplateSelectorNotFound(decl, result) - utils.warnIfGridRowColumnExists(decl, result) - - return undefined - } -} - -GridArea.names = ['grid-area'] - -module.exports = GridArea - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-column-align.js": -/*!******************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-column-align.js ***! - \******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class GridColumnAlign extends Declaration { - /** - * Do not prefix flexbox values - */ - check(decl) { - return !decl.value.includes('flex-') && decl.value !== 'baseline' - } - - /** - * Change IE property back - */ - normalize() { - return 'justify-self' - } - - /** - * Change property name for IE - */ - prefixed(prop, prefix) { - return prefix + 'grid-column-align' - } -} - -GridColumnAlign.names = ['grid-column-align'] - -module.exports = GridColumnAlign - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-end.js": -/*!*********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-end.js ***! - \*********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let { isPureNumber } = __webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js") - -class GridEnd extends Declaration { - /** - * Change repeating syntax for IE - */ - insert(decl, prefix, prefixes, result) { - if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) - - let clonedDecl = this.clone(decl) - - let startProp = decl.prop.replace(/end$/, 'start') - let spanProp = prefix + decl.prop.replace(/end$/, 'span') - - if (decl.parent.some(i => i.prop === spanProp)) { - return undefined - } - - clonedDecl.prop = spanProp - - if (decl.value.includes('span')) { - clonedDecl.value = decl.value.replace(/span\s/i, '') - } else { - let startDecl - decl.parent.walkDecls(startProp, d => { - startDecl = d - }) - if (startDecl) { - if (isPureNumber(startDecl.value)) { - let value = Number(decl.value) - Number(startDecl.value) + '' - clonedDecl.value = value - } else { - return undefined - } - } else { - decl.warn( - result, - `Can not prefix ${decl.prop} (${startProp} is not found)` - ) - } - } - - decl.cloneBefore(clonedDecl) - - return undefined - } -} - -GridEnd.names = ['grid-row-end', 'grid-column-end'] - -module.exports = GridEnd - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-row-align.js": -/*!***************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-row-align.js ***! - \***************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class GridRowAlign extends Declaration { - /** - * Do not prefix flexbox values - */ - check(decl) { - return !decl.value.includes('flex-') && decl.value !== 'baseline' - } - - /** - * Change IE property back - */ - normalize() { - return 'align-self' - } - - /** - * Change property name for IE - */ - prefixed(prop, prefix) { - return prefix + 'grid-row-align' - } -} - -GridRowAlign.names = ['grid-row-align'] - -module.exports = GridRowAlign - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-row-column.js": -/*!****************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-row-column.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let utils = __webpack_require__(/*! ./grid-utils */ "./node_modules/autoprefixer/lib/hacks/grid-utils.js") - -class GridRowColumn extends Declaration { - /** - * Translate grid-row / grid-column to separate -ms- prefixed properties - */ - insert(decl, prefix, prefixes) { - if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) - - let values = utils.parse(decl) - let [start, span] = utils.translate(values, 0, 1) - - let hasStartValueSpan = values[0] && values[0].includes('span') - - if (hasStartValueSpan) { - span = values[0].join('').replace(/\D/g, '') - } - - ;[ - [decl.prop, start], - [`${decl.prop}-span`, span] - ].forEach(([prop, value]) => { - utils.insertDecl(decl, prop, value) - }) - - return undefined - } -} - -GridRowColumn.names = ['grid-row', 'grid-column'] - -module.exports = GridRowColumn - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-rows-columns.js": -/*!******************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-rows-columns.js ***! - \******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let Processor = __webpack_require__(/*! ../processor */ "./node_modules/autoprefixer/lib/processor.js") -let { - autoplaceGridItems, - getGridGap, - inheritGridGap, - prefixTrackProp, - prefixTrackValue -} = __webpack_require__(/*! ./grid-utils */ "./node_modules/autoprefixer/lib/hacks/grid-utils.js") - -class GridRowsColumns extends Declaration { - insert(decl, prefix, prefixes, result) { - if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) - - let { parent, prop, value } = decl - let isRowProp = prop.includes('rows') - let isColumnProp = prop.includes('columns') - - let hasGridTemplate = parent.some( - i => i.prop === 'grid-template' || i.prop === 'grid-template-areas' - ) - - /** - * Not to prefix rows declaration if grid-template(-areas) is present - */ - if (hasGridTemplate && isRowProp) { - return false - } - - let processor = new Processor({ options: {} }) - let status = processor.gridStatus(parent, result) - let gap = getGridGap(decl) - gap = inheritGridGap(decl, gap) || gap - - let gapValue = isRowProp ? gap.row : gap.column - - if ((status === 'no-autoplace' || status === true) && !hasGridTemplate) { - gapValue = null - } - - let prefixValue = prefixTrackValue({ - gap: gapValue, - value - }) - - /** - * Insert prefixes - */ - decl.cloneBefore({ - prop: prefixTrackProp({ prefix, prop }), - value: prefixValue - }) - - let autoflow = parent.nodes.find(i => i.prop === 'grid-auto-flow') - let autoflowValue = 'row' - - if (autoflow && !processor.disabled(autoflow, result)) { - autoflowValue = autoflow.value.trim() - } - if (status === 'autoplace') { - /** - * Show warning if grid-template-rows decl is not found - */ - let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows') - - if (!rowDecl && hasGridTemplate) { - return undefined - } else if (!rowDecl && !hasGridTemplate) { - decl.warn( - result, - 'Autoplacement does not work without grid-template-rows property' - ) - return undefined - } - - /** - * Show warning if grid-template-columns decl is not found - */ - let columnDecl = parent.nodes.find(i => { - return i.prop === 'grid-template-columns' - }) - if (!columnDecl && !hasGridTemplate) { - decl.warn( - result, - 'Autoplacement does not work without grid-template-columns property' - ) - } - - /** - * Autoplace grid items - */ - if (isColumnProp && !hasGridTemplate) { - autoplaceGridItems(decl, result, gap, autoflowValue) - } - } - - return undefined - } - - /** - * Change IE property back - */ - normalize(prop) { - return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1') - } - - /** - * Change property name for IE - */ - prefixed(prop, prefix) { - if (prefix === '-ms-') { - return prefixTrackProp({ prefix, prop }) - } - return super.prefixed(prop, prefix) - } -} - -GridRowsColumns.names = [ - 'grid-template-rows', - 'grid-template-columns', - 'grid-rows', - 'grid-columns' -] - -module.exports = GridRowsColumns - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-start.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-start.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class GridStart extends Declaration { - /** - * Do not add prefix for unsupported value in IE - */ - check(decl) { - let value = decl.value - return !value.includes('/') && !value.includes('span') - } - - /** - * Return a final spec property - */ - normalize(prop) { - return prop.replace('-start', '') - } - - /** - * Change property name for IE - */ - prefixed(prop, prefix) { - let result = super.prefixed(prop, prefix) - if (prefix === '-ms-') { - result = result.replace('-start', '') - } - return result - } -} - -GridStart.names = ['grid-row-start', 'grid-column-start'] - -module.exports = GridStart - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-template-areas.js": -/*!********************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-template-areas.js ***! - \********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let { - getGridGap, - inheritGridGap, - parseGridAreas, - prefixTrackProp, - prefixTrackValue, - warnGridGap, - warnMissedAreas -} = __webpack_require__(/*! ./grid-utils */ "./node_modules/autoprefixer/lib/hacks/grid-utils.js") - -function getGridRows(tpl) { - return tpl - .trim() - .slice(1, -1) - .split(/["']\s*["']?/g) -} - -class GridTemplateAreas extends Declaration { - /** - * Translate grid-template-areas to separate -ms- prefixed properties - */ - insert(decl, prefix, prefixes, result) { - if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) - - let hasColumns = false - let hasRows = false - let parent = decl.parent - let gap = getGridGap(decl) - gap = inheritGridGap(decl, gap) || gap - - // remove already prefixed rows - // to prevent doubling prefixes - parent.walkDecls(/-ms-grid-rows/, i => i.remove()) - - // add empty tracks to rows - parent.walkDecls(/grid-template-(rows|columns)/, trackDecl => { - if (trackDecl.prop === 'grid-template-rows') { - hasRows = true - let { prop, value } = trackDecl - trackDecl.cloneBefore({ - prop: prefixTrackProp({ prefix, prop }), - value: prefixTrackValue({ gap: gap.row, value }) - }) - } else { - hasColumns = true - } - }) - - let gridRows = getGridRows(decl.value) - - if (hasColumns && !hasRows && gap.row && gridRows.length > 1) { - decl.cloneBefore({ - prop: '-ms-grid-rows', - raws: {}, - value: prefixTrackValue({ - gap: gap.row, - value: `repeat(${gridRows.length}, auto)` - }) - }) - } - - // warnings - warnGridGap({ - decl, - gap, - hasColumns, - result - }) - - let areas = parseGridAreas({ - gap, - rows: gridRows - }) - - warnMissedAreas(areas, decl, result) - - return decl - } -} - -GridTemplateAreas.names = ['grid-template-areas'] - -module.exports = GridTemplateAreas - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-template.js": -/*!**************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-template.js ***! - \**************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let { - getGridGap, - inheritGridGap, - parseTemplate, - warnGridGap, - warnMissedAreas -} = __webpack_require__(/*! ./grid-utils */ "./node_modules/autoprefixer/lib/hacks/grid-utils.js") - -class GridTemplate extends Declaration { - /** - * Translate grid-template to separate -ms- prefixed properties - */ - insert(decl, prefix, prefixes, result) { - if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) - - if (decl.parent.some(i => i.prop === '-ms-grid-rows')) { - return undefined - } - - let gap = getGridGap(decl) - - /** - * we must insert inherited gap values in some cases: - * if we are inside media query && if we have no grid-gap value - */ - let inheritedGap = inheritGridGap(decl, gap) - - let { areas, columns, rows } = parseTemplate({ - decl, - gap: inheritedGap || gap - }) - - let hasAreas = Object.keys(areas).length > 0 - let hasRows = Boolean(rows) - let hasColumns = Boolean(columns) - - warnGridGap({ - decl, - gap, - hasColumns, - result - }) - - warnMissedAreas(areas, decl, result) - - if ((hasRows && hasColumns) || hasAreas) { - decl.cloneBefore({ - prop: '-ms-grid-rows', - raws: {}, - value: rows - }) - } - - if (hasColumns) { - decl.cloneBefore({ - prop: '-ms-grid-columns', - raws: {}, - value: columns - }) - } - - return decl - } -} - -GridTemplate.names = ['grid-template'] - -module.exports = GridTemplate - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/grid-utils.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/grid-utils.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -let parser = __webpack_require__(/*! postcss-value-parser */ "./node_modules/postcss-value-parser/lib/index.js") -let list = (__webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js").list) - -let uniq = (__webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js").uniq) -let escapeRegexp = (__webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js").escapeRegexp) -let splitSelector = (__webpack_require__(/*! ../utils */ "./node_modules/autoprefixer/lib/utils.js").splitSelector) - -function convert(value) { - if ( - value && - value.length === 2 && - value[0] === 'span' && - parseInt(value[1], 10) > 0 - ) { - return [false, parseInt(value[1], 10)] - } - - if (value && value.length === 1 && parseInt(value[0], 10) > 0) { - return [parseInt(value[0], 10), false] - } - - return [false, false] -} - -exports.translate = translate - -function translate(values, startIndex, endIndex) { - let startValue = values[startIndex] - let endValue = values[endIndex] - - if (!startValue) { - return [false, false] - } - - let [start, spanStart] = convert(startValue) - let [end, spanEnd] = convert(endValue) - - if (start && !endValue) { - return [start, false] - } - - if (spanStart && end) { - return [end - spanStart, spanStart] - } - - if (start && spanEnd) { - return [start, spanEnd] - } - - if (start && end) { - return [start, end - start] - } - - return [false, false] -} - -exports.parse = parse - -function parse(decl) { - let node = parser(decl.value) - - let values = [] - let current = 0 - values[current] = [] - - for (let i of node.nodes) { - if (i.type === 'div') { - current += 1 - values[current] = [] - } else if (i.type === 'word') { - values[current].push(i.value) - } - } - - return values -} - -exports.insertDecl = insertDecl - -function insertDecl(decl, prop, value) { - if (value && !decl.parent.some(i => i.prop === `-ms-${prop}`)) { - decl.cloneBefore({ - prop: `-ms-${prop}`, - value: value.toString() - }) - } -} - -// Track transforms - -exports.prefixTrackProp = prefixTrackProp - -function prefixTrackProp({ prefix, prop }) { - return prefix + prop.replace('template-', '') -} - -function transformRepeat({ nodes }, { gap }) { - let { count, size } = nodes.reduce( - (result, node) => { - if (node.type === 'div' && node.value === ',') { - result.key = 'size' - } else { - result[result.key].push(parser.stringify(node)) - } - return result - }, - { - count: [], - key: 'count', - size: [] - } - ) - - // insert gap values - if (gap) { - size = size.filter(i => i.trim()) - let val = [] - for (let i = 1; i <= count; i++) { - size.forEach((item, index) => { - if (index > 0 || i > 1) { - val.push(gap) - } - val.push(item) - }) - } - - return val.join(' ') - } - - return `(${size.join('')})[${count.join('')}]` -} - -exports.prefixTrackValue = prefixTrackValue - -function prefixTrackValue({ gap, value }) { - let result = parser(value).nodes.reduce((nodes, node) => { - if (node.type === 'function' && node.value === 'repeat') { - return nodes.concat({ - type: 'word', - value: transformRepeat(node, { gap }) - }) - } - if (gap && node.type === 'space') { - return nodes.concat( - { - type: 'space', - value: ' ' - }, - { - type: 'word', - value: gap - }, - node - ) - } - return nodes.concat(node) - }, []) - - return parser.stringify(result) -} - -// Parse grid-template-areas - -let DOTS = /^\.+$/ - -function track(start, end) { - return { end, span: end - start, start } -} - -function getColumns(line) { - return line.trim().split(/\s+/g) -} - -exports.parseGridAreas = parseGridAreas - -function parseGridAreas({ gap, rows }) { - return rows.reduce((areas, line, rowIndex) => { - if (gap.row) rowIndex *= 2 - - if (line.trim() === '') return areas - - getColumns(line).forEach((area, columnIndex) => { - if (DOTS.test(area)) return - - if (gap.column) columnIndex *= 2 - - if (typeof areas[area] === 'undefined') { - areas[area] = { - column: track(columnIndex + 1, columnIndex + 2), - row: track(rowIndex + 1, rowIndex + 2) - } - } else { - let { column, row } = areas[area] - - column.start = Math.min(column.start, columnIndex + 1) - column.end = Math.max(column.end, columnIndex + 2) - column.span = column.end - column.start - - row.start = Math.min(row.start, rowIndex + 1) - row.end = Math.max(row.end, rowIndex + 2) - row.span = row.end - row.start - } - }) - - return areas - }, {}) -} - -// Parse grid-template - -function testTrack(node) { - return node.type === 'word' && /^\[.+]$/.test(node.value) -} - -function verifyRowSize(result) { - if (result.areas.length > result.rows.length) { - result.rows.push('auto') - } - return result -} - -exports.parseTemplate = parseTemplate - -function parseTemplate({ decl, gap }) { - let gridTemplate = parser(decl.value).nodes.reduce( - (result, node) => { - let { type, value } = node - - if (testTrack(node) || type === 'space') return result - - // area - if (type === 'string') { - result = verifyRowSize(result) - result.areas.push(value) - } - - // values and function - if (type === 'word' || type === 'function') { - result[result.key].push(parser.stringify(node)) - } - - // divider(/) - if (type === 'div' && value === '/') { - result.key = 'columns' - result = verifyRowSize(result) - } - - return result - }, - { - areas: [], - columns: [], - key: 'rows', - rows: [] - } - ) - - return { - areas: parseGridAreas({ - gap, - rows: gridTemplate.areas - }), - columns: prefixTrackValue({ - gap: gap.column, - value: gridTemplate.columns.join(' ') - }), - rows: prefixTrackValue({ - gap: gap.row, - value: gridTemplate.rows.join(' ') - }) - } -} - -// Insert parsed grid areas - -/** - * Get an array of -ms- prefixed props and values - * @param {Object} [area] area object with column and row data - * @param {Boolean} [addRowSpan] should we add grid-column-row value? - * @param {Boolean} [addColumnSpan] should we add grid-column-span value? - * @return {Array} - */ -function getMSDecls(area, addRowSpan = false, addColumnSpan = false) { - let result = [ - { - prop: '-ms-grid-row', - value: String(area.row.start) - } - ] - if (area.row.span > 1 || addRowSpan) { - result.push({ - prop: '-ms-grid-row-span', - value: String(area.row.span) - }) - } - result.push({ - prop: '-ms-grid-column', - value: String(area.column.start) - }) - if (area.column.span > 1 || addColumnSpan) { - result.push({ - prop: '-ms-grid-column-span', - value: String(area.column.span) - }) - } - return result -} - -function getParentMedia(parent) { - if (parent.type === 'atrule' && parent.name === 'media') { - return parent - } - if (!parent.parent) { - return false - } - return getParentMedia(parent.parent) -} - -/** - * change selectors for rules with duplicate grid-areas. - * @param {Array} rules - * @param {Array} templateSelectors - * @return {Array} rules with changed selectors - */ -function changeDuplicateAreaSelectors(ruleSelectors, templateSelectors) { - ruleSelectors = ruleSelectors.map(selector => { - let selectorBySpace = list.space(selector) - let selectorByComma = list.comma(selector) - - if (selectorBySpace.length > selectorByComma.length) { - selector = selectorBySpace.slice(-1).join('') - } - return selector - }) - - return ruleSelectors.map(ruleSelector => { - let newSelector = templateSelectors.map((tplSelector, index) => { - let space = index === 0 ? '' : ' ' - return `${space}${tplSelector} > ${ruleSelector}` - }) - - return newSelector - }) -} - -/** - * check if selector of rules are equal - * @param {Rule} ruleA - * @param {Rule} ruleB - * @return {Boolean} - */ -function selectorsEqual(ruleA, ruleB) { - return ruleA.selectors.some(sel => { - return ruleB.selectors.includes(sel) - }) -} - -/** - * Parse data from all grid-template(-areas) declarations - * @param {Root} css css root - * @return {Object} parsed data - */ -function parseGridTemplatesData(css) { - let parsed = [] - - // we walk through every grid-template(-areas) declaration and store - // data with the same area names inside the item - css.walkDecls(/grid-template(-areas)?$/, d => { - let rule = d.parent - let media = getParentMedia(rule) - let gap = getGridGap(d) - let inheritedGap = inheritGridGap(d, gap) - let { areas } = parseTemplate({ decl: d, gap: inheritedGap || gap }) - let areaNames = Object.keys(areas) - - // skip node if it doesn't have areas - if (areaNames.length === 0) { - return true - } - - // check parsed array for item that include the same area names - // return index of that item - let index = parsed.reduce((acc, { allAreas }, idx) => { - let hasAreas = allAreas && areaNames.some(area => allAreas.includes(area)) - return hasAreas ? idx : acc - }, null) - - if (index !== null) { - // index is found, add the grid-template data to that item - let { allAreas, rules } = parsed[index] - - // check if rule has no duplicate area names - let hasNoDuplicates = rules.some(r => { - return r.hasDuplicates === false && selectorsEqual(r, rule) - }) - - let duplicatesFound = false - - // check need to gather all duplicate area names - let duplicateAreaNames = rules.reduce((acc, r) => { - if (!r.params && selectorsEqual(r, rule)) { - duplicatesFound = true - return r.duplicateAreaNames - } - if (!duplicatesFound) { - areaNames.forEach(name => { - if (r.areas[name]) { - acc.push(name) - } - }) - } - return uniq(acc) - }, []) - - // update grid-row/column-span values for areas with duplicate - // area names. @see #1084 and #1146 - rules.forEach(r => { - areaNames.forEach(name => { - let area = r.areas[name] - if (area && area.row.span !== areas[name].row.span) { - areas[name].row.updateSpan = true - } - - if (area && area.column.span !== areas[name].column.span) { - areas[name].column.updateSpan = true - } - }) - }) - - parsed[index].allAreas = uniq([...allAreas, ...areaNames]) - parsed[index].rules.push({ - areas, - duplicateAreaNames, - hasDuplicates: !hasNoDuplicates, - node: rule, - params: media.params, - selectors: rule.selectors - }) - } else { - // index is NOT found, push the new item to the parsed array - parsed.push({ - allAreas: areaNames, - areasCount: 0, - rules: [ - { - areas, - duplicateAreaNames: [], - duplicateRules: [], - hasDuplicates: false, - node: rule, - params: media.params, - selectors: rule.selectors - } - ] - }) - } - - return undefined - }) - - return parsed -} - -/** - * insert prefixed grid-area declarations - * @param {Root} css css root - * @param {Function} isDisabled check if the rule is disabled - * @return {void} - */ -exports.insertAreas = insertAreas - -function insertAreas(css, isDisabled) { - // parse grid-template declarations - let gridTemplatesData = parseGridTemplatesData(css) - - // return undefined if no declarations found - if (gridTemplatesData.length === 0) { - return undefined - } - - // we need to store the rules that we will insert later - let rulesToInsert = {} - - css.walkDecls('grid-area', gridArea => { - let gridAreaRule = gridArea.parent - let hasPrefixedRow = gridAreaRule.first.prop === '-ms-grid-row' - let gridAreaMedia = getParentMedia(gridAreaRule) - - if (isDisabled(gridArea)) { - return undefined - } - - let gridAreaRuleIndex = css.index(gridAreaMedia || gridAreaRule) - - let value = gridArea.value - // found the data that matches grid-area identifier - let data = gridTemplatesData.filter(d => d.allAreas.includes(value))[0] - - if (!data) { - return true - } - - let lastArea = data.allAreas[data.allAreas.length - 1] - let selectorBySpace = list.space(gridAreaRule.selector) - let selectorByComma = list.comma(gridAreaRule.selector) - let selectorIsComplex = - selectorBySpace.length > 1 && - selectorBySpace.length > selectorByComma.length - - // prevent doubling of prefixes - if (hasPrefixedRow) { - return false - } - - // create the empty object with the key as the last area name - // e.g if we have templates with "a b c" values, "c" will be the last area - if (!rulesToInsert[lastArea]) { - rulesToInsert[lastArea] = {} - } - - let lastRuleIsSet = false - - // walk through every grid-template rule data - for (let rule of data.rules) { - let area = rule.areas[value] - let hasDuplicateName = rule.duplicateAreaNames.includes(value) - - // if we can't find the area name, update lastRule and continue - if (!area) { - let lastRule = rulesToInsert[lastArea].lastRule - let lastRuleIndex - if (lastRule) { - lastRuleIndex = css.index(lastRule) - } else { - /* c8 ignore next 2 */ - lastRuleIndex = -1 - } - - if (gridAreaRuleIndex > lastRuleIndex) { - rulesToInsert[lastArea].lastRule = gridAreaMedia || gridAreaRule - } - continue - } - - // for grid-templates inside media rule we need to create empty - // array to push prefixed grid-area rules later - if (rule.params && !rulesToInsert[lastArea][rule.params]) { - rulesToInsert[lastArea][rule.params] = [] - } - - if ((!rule.hasDuplicates || !hasDuplicateName) && !rule.params) { - // grid-template has no duplicates and not inside media rule - - getMSDecls(area, false, false) - .reverse() - .forEach(i => - gridAreaRule.prepend( - Object.assign(i, { - raws: { - between: gridArea.raws.between - } - }) - ) - ) - - rulesToInsert[lastArea].lastRule = gridAreaRule - lastRuleIsSet = true - } else if (rule.hasDuplicates && !rule.params && !selectorIsComplex) { - // grid-template has duplicates and not inside media rule - let cloned = gridAreaRule.clone() - cloned.removeAll() - - getMSDecls(area, area.row.updateSpan, area.column.updateSpan) - .reverse() - .forEach(i => - cloned.prepend( - Object.assign(i, { - raws: { - between: gridArea.raws.between - } - }) - ) - ) - - cloned.selectors = changeDuplicateAreaSelectors( - cloned.selectors, - rule.selectors - ) - - if (rulesToInsert[lastArea].lastRule) { - rulesToInsert[lastArea].lastRule.after(cloned) - } - rulesToInsert[lastArea].lastRule = cloned - lastRuleIsSet = true - } else if ( - rule.hasDuplicates && - !rule.params && - selectorIsComplex && - gridAreaRule.selector.includes(rule.selectors[0]) - ) { - // grid-template has duplicates and not inside media rule - // and the selector is complex - gridAreaRule.walkDecls(/-ms-grid-(row|column)/, d => d.remove()) - getMSDecls(area, area.row.updateSpan, area.column.updateSpan) - .reverse() - .forEach(i => - gridAreaRule.prepend( - Object.assign(i, { - raws: { - between: gridArea.raws.between - } - }) - ) - ) - } else if (rule.params) { - // grid-template is inside media rule - // if we're inside media rule, we need to store prefixed rules - // inside rulesToInsert object to be able to preserve the order of media - // rules and merge them easily - let cloned = gridAreaRule.clone() - cloned.removeAll() - - getMSDecls(area, area.row.updateSpan, area.column.updateSpan) - .reverse() - .forEach(i => - cloned.prepend( - Object.assign(i, { - raws: { - between: gridArea.raws.between - } - }) - ) - ) - - if (rule.hasDuplicates && hasDuplicateName) { - cloned.selectors = changeDuplicateAreaSelectors( - cloned.selectors, - rule.selectors - ) - } - - cloned.raws = rule.node.raws - - if (css.index(rule.node.parent) > gridAreaRuleIndex) { - // append the prefixed rules right inside media rule - // with grid-template - rule.node.parent.append(cloned) - } else { - // store the rule to insert later - rulesToInsert[lastArea][rule.params].push(cloned) - } - - // set new rule as last rule ONLY if we didn't set lastRule for - // this grid-area before - if (!lastRuleIsSet) { - rulesToInsert[lastArea].lastRule = gridAreaMedia || gridAreaRule - } - } - } - - return undefined - }) - - // append stored rules inside the media rules - Object.keys(rulesToInsert).forEach(area => { - let data = rulesToInsert[area] - let lastRule = data.lastRule - Object.keys(data) - .reverse() - .filter(p => p !== 'lastRule') - .forEach(params => { - if (data[params].length > 0 && lastRule) { - lastRule.after({ name: 'media', params }) - lastRule.next().append(data[params]) - } - }) - }) - - return undefined -} - -/** - * Warn user if grid area identifiers are not found - * @param {Object} areas - * @param {Declaration} decl - * @param {Result} result - * @return {void} - */ -exports.warnMissedAreas = warnMissedAreas - -function warnMissedAreas(areas, decl, result) { - let missed = Object.keys(areas) - - decl.root().walkDecls('grid-area', gridArea => { - missed = missed.filter(e => e !== gridArea.value) - }) - - if (missed.length > 0) { - decl.warn(result, 'Can not find grid areas: ' + missed.join(', ')) - } - - return undefined -} - -/** - * compare selectors with grid-area rule and grid-template rule - * show warning if grid-template selector is not found - * (this function used for grid-area rule) - * @param {Declaration} decl - * @param {Result} result - * @return {void} - */ -exports.warnTemplateSelectorNotFound = warnTemplateSelectorNotFound - -function warnTemplateSelectorNotFound(decl, result) { - let rule = decl.parent - let root = decl.root() - let duplicatesFound = false - - // slice selector array. Remove the last part (for comparison) - let slicedSelectorArr = list - .space(rule.selector) - .filter(str => str !== '>') - .slice(0, -1) - - // we need to compare only if selector is complex. - // e.g '.grid-cell' is simple, but '.parent > .grid-cell' is complex - if (slicedSelectorArr.length > 0) { - let gridTemplateFound = false - let foundAreaSelector = null - - root.walkDecls(/grid-template(-areas)?$/, d => { - let parent = d.parent - let templateSelectors = parent.selectors - - let { areas } = parseTemplate({ decl: d, gap: getGridGap(d) }) - let hasArea = areas[decl.value] - - // find the the matching selectors - for (let tplSelector of templateSelectors) { - if (gridTemplateFound) { - break - } - let tplSelectorArr = list.space(tplSelector).filter(str => str !== '>') - - gridTemplateFound = tplSelectorArr.every( - (item, idx) => item === slicedSelectorArr[idx] - ) - } - - if (gridTemplateFound || !hasArea) { - return true - } - - if (!foundAreaSelector) { - foundAreaSelector = parent.selector - } - - // if we found the duplicate area with different selector - if (foundAreaSelector && foundAreaSelector !== parent.selector) { - duplicatesFound = true - } - - return undefined - }) - - // warn user if we didn't find template - if (!gridTemplateFound && duplicatesFound) { - decl.warn( - result, - 'Autoprefixer cannot find a grid-template ' + - `containing the duplicate grid-area "${decl.value}" ` + - `with full selector matching: ${slicedSelectorArr.join(' ')}` - ) - } - } -} - -/** - * warn user if both grid-area and grid-(row|column) - * declarations are present in the same rule - * @param {Declaration} decl - * @param {Result} result - * @return {void} - */ -exports.warnIfGridRowColumnExists = warnIfGridRowColumnExists - -function warnIfGridRowColumnExists(decl, result) { - let rule = decl.parent - let decls = [] - rule.walkDecls(/^grid-(row|column)/, d => { - if ( - !d.prop.endsWith('-end') && - !d.value.startsWith('span') && - !d.prop.endsWith('-gap') - ) { - decls.push(d) - } - }) - if (decls.length > 0) { - decls.forEach(d => { - d.warn( - result, - 'You already have a grid-area declaration present in the rule. ' + - `You should use either grid-area or ${d.prop}, not both` - ) - }) - } - - return undefined -} - -// Gap utils - -exports.getGridGap = getGridGap - -function getGridGap(decl) { - let gap = {} - - // try to find gap - let testGap = /^(grid-)?((row|column)-)?gap$/ - decl.parent.walkDecls(testGap, ({ prop, value }) => { - if (/^(grid-)?gap$/.test(prop)) { - let [row, , column] = parser(value).nodes - - gap.row = row && parser.stringify(row) - gap.column = column ? parser.stringify(column) : gap.row - } - if (/^(grid-)?row-gap$/.test(prop)) gap.row = value - if (/^(grid-)?column-gap$/.test(prop)) gap.column = value - }) - - return gap -} - -/** - * parse media parameters (for example 'min-width: 500px') - * @param {String} params parameter to parse - * @return {} - */ -function parseMediaParams(params) { - if (!params) { - return [] - } - let parsed = parser(params) - let prop - let value - - parsed.walk(node => { - if (node.type === 'word' && /min|max/g.test(node.value)) { - prop = node.value - } else if (node.value.includes('px')) { - value = parseInt(node.value.replace(/\D/g, '')) - } - }) - - return [prop, value] -} - -/** - * Compare the selectors and decide if we - * need to inherit gap from compared selector or not. - * @type {String} selA - * @type {String} selB - * @return {Boolean} - */ -function shouldInheritGap(selA, selB) { - let result - - // get arrays of selector split in 3-deep array - let splitSelectorArrA = splitSelector(selA) - let splitSelectorArrB = splitSelector(selB) - - if (splitSelectorArrA[0].length < splitSelectorArrB[0].length) { - // abort if selectorA has lower descendant specificity then selectorB - // (e.g '.grid' and '.hello .world .grid') - return false - } else if (splitSelectorArrA[0].length > splitSelectorArrB[0].length) { - // if selectorA has higher descendant specificity then selectorB - // (e.g '.foo .bar .grid' and '.grid') - - let idx = splitSelectorArrA[0].reduce((res, [item], index) => { - let firstSelectorPart = splitSelectorArrB[0][0][0] - if (item === firstSelectorPart) { - return index - } - return false - }, false) - - if (idx) { - result = splitSelectorArrB[0].every((arr, index) => { - return arr.every( - (part, innerIndex) => - // because selectorA has more space elements, we need to slice - // selectorA array by 'idx' number to compare them - splitSelectorArrA[0].slice(idx)[index][innerIndex] === part - ) - }) - } - } else { - // if selectorA has the same descendant specificity as selectorB - // this condition covers cases such as: '.grid.foo.bar' and '.grid' - result = splitSelectorArrB.some(byCommaArr => { - return byCommaArr.every((bySpaceArr, index) => { - return bySpaceArr.every( - (part, innerIndex) => splitSelectorArrA[0][index][innerIndex] === part - ) - }) - }) - } - - return result -} -/** - * inherit grid gap values from the closest rule above - * with the same selector - * @param {Declaration} decl - * @param {Object} gap gap values - * @return {Object | Boolean} return gap values or false (if not found) - */ -exports.inheritGridGap = inheritGridGap - -function inheritGridGap(decl, gap) { - let rule = decl.parent - let mediaRule = getParentMedia(rule) - let root = rule.root() - - // get an array of selector split in 3-deep array - let splitSelectorArr = splitSelector(rule.selector) - - // abort if the rule already has gaps - if (Object.keys(gap).length > 0) { - return false - } - - // e.g ['min-width'] - let [prop] = parseMediaParams(mediaRule.params) - - let lastBySpace = splitSelectorArr[0] - - // get escaped value from the selector - // if we have '.grid-2.foo.bar' selector, will be '\.grid\-2' - let escaped = escapeRegexp(lastBySpace[lastBySpace.length - 1][0]) - - let regexp = new RegExp(`(${escaped}$)|(${escaped}[,.])`) - - // find the closest rule with the same selector - let closestRuleGap - root.walkRules(regexp, r => { - let gridGap - - // abort if are checking the same rule - if (rule.toString() === r.toString()) { - return false - } - - // find grid-gap values - r.walkDecls('grid-gap', d => (gridGap = getGridGap(d))) - - // skip rule without gaps - if (!gridGap || Object.keys(gridGap).length === 0) { - return true - } - - // skip rules that should not be inherited from - if (!shouldInheritGap(rule.selector, r.selector)) { - return true - } - - let media = getParentMedia(r) - if (media) { - // if we are inside media, we need to check that media props match - // e.g ('min-width' === 'min-width') - let propToCompare = parseMediaParams(media.params)[0] - if (propToCompare === prop) { - closestRuleGap = gridGap - return true - } - } else { - closestRuleGap = gridGap - return true - } - - return undefined - }) - - // if we find the closest gap object - if (closestRuleGap && Object.keys(closestRuleGap).length > 0) { - return closestRuleGap - } - return false -} - -exports.warnGridGap = warnGridGap - -function warnGridGap({ decl, gap, hasColumns, result }) { - let hasBothGaps = gap.row && gap.column - if (!hasColumns && (hasBothGaps || (gap.column && !gap.row))) { - delete gap.column - decl.warn( - result, - 'Can not implement grid-gap without grid-template-columns' - ) - } -} - -/** - * normalize the grid-template-rows/columns values - * @param {String} str grid-template-rows/columns value - * @return {Array} normalized array with values - * @example - * let normalized = normalizeRowColumn('1fr repeat(2, 20px 50px) 1fr') - * normalized // <= ['1fr', '20px', '50px', '20px', '50px', '1fr'] - */ -function normalizeRowColumn(str) { - let normalized = parser(str).nodes.reduce((result, node) => { - if (node.type === 'function' && node.value === 'repeat') { - let key = 'count' - - let [count, value] = node.nodes.reduce( - (acc, n) => { - if (n.type === 'word' && key === 'count') { - acc[0] = Math.abs(parseInt(n.value)) - return acc - } - if (n.type === 'div' && n.value === ',') { - key = 'value' - return acc - } - if (key === 'value') { - acc[1] += parser.stringify(n) - } - return acc - }, - [0, ''] - ) - - if (count) { - for (let i = 0; i < count; i++) { - result.push(value) - } - } - - return result - } - if (node.type === 'space') { - return result - } - return result.concat(parser.stringify(node)) - }, []) - - return normalized -} - -exports.autoplaceGridItems = autoplaceGridItems - -/** - * Autoplace grid items - * @param {Declaration} decl - * @param {Result} result - * @param {Object} gap gap values - * @param {String} autoflowValue grid-auto-flow value - * @return {void} - * @see https://github.com/postcss/autoprefixer/issues/1148 - */ -function autoplaceGridItems(decl, result, gap, autoflowValue = 'row') { - let { parent } = decl - - let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows') - let rows = normalizeRowColumn(rowDecl.value) - let columns = normalizeRowColumn(decl.value) - - // Build array of area names with dummy values. If we have 3 columns and - // 2 rows, filledRows will be equal to ['1 2 3', '4 5 6'] - let filledRows = rows.map((_, rowIndex) => { - return Array.from( - { length: columns.length }, - (v, k) => k + rowIndex * columns.length + 1 - ).join(' ') - }) - - let areas = parseGridAreas({ gap, rows: filledRows }) - let keys = Object.keys(areas) - let items = keys.map(i => areas[i]) - - // Change the order of cells if grid-auto-flow value is 'column' - if (autoflowValue.includes('column')) { - items = items.sort((a, b) => a.column.start - b.column.start) - } - - // Insert new rules - items.reverse().forEach((item, index) => { - let { column, row } = item - let nodeSelector = parent.selectors - .map(sel => sel + ` > *:nth-child(${keys.length - index})`) - .join(', ') - - // create new rule - let node = parent.clone().removeAll() - - // change rule selector - node.selector = nodeSelector - - // insert prefixed row/column values - node.append({ prop: '-ms-grid-row', value: row.start }) - node.append({ prop: '-ms-grid-column', value: column.start }) - - // insert rule - parent.after(node) - }) - - return undefined -} - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/image-rendering.js": -/*!****************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/image-rendering.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class ImageRendering extends Declaration { - /** - * Add hack only for crisp-edges - */ - check(decl) { - return decl.value === 'pixelated' - } - - /** - * Return property name by spec - */ - normalize() { - return 'image-rendering' - } - - /** - * Change property name for IE - */ - prefixed(prop, prefix) { - if (prefix === '-ms-') { - return '-ms-interpolation-mode' - } - return super.prefixed(prop, prefix) - } - - /** - * Warn on old value - */ - process(node, result) { - return super.process(node, result) - } - - /** - * Change property and value for IE - */ - set(decl, prefix) { - if (prefix !== '-ms-') return super.set(decl, prefix) - decl.prop = '-ms-interpolation-mode' - decl.value = 'nearest-neighbor' - return decl - } -} - -ImageRendering.names = ['image-rendering', 'interpolation-mode'] - -module.exports = ImageRendering - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/image-set.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/image-set.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") - -class ImageSet extends Value { - /** - * Use non-standard name for WebKit and Firefox - */ - replace(string, prefix) { - let fixed = super.replace(string, prefix) - if (prefix === '-webkit-') { - fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2') - } - return fixed - } -} - -ImageSet.names = ['image-set'] - -module.exports = ImageSet - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/inline-logical.js": -/*!***************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/inline-logical.js ***! - \***************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class InlineLogical extends Declaration { - /** - * Return property name by spec - */ - normalize(prop) { - return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2') - } - - /** - * Use old syntax for -moz- and -webkit- - */ - prefixed(prop, prefix) { - return prefix + prop.replace('-inline', '') - } -} - -InlineLogical.names = [ - 'border-inline-start', - 'border-inline-end', - 'margin-inline-start', - 'margin-inline-end', - 'padding-inline-start', - 'padding-inline-end', - 'border-start', - 'border-end', - 'margin-start', - 'margin-end', - 'padding-start', - 'padding-end' -] - -module.exports = InlineLogical - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/intrinsic.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/intrinsic.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let OldValue = __webpack_require__(/*! ../old-value */ "./node_modules/autoprefixer/lib/old-value.js") -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") - -function regexp(name) { - return new RegExp(`(^|[\\s,(])(${name}($|[\\s),]))`, 'gi') -} - -class Intrinsic extends Value { - add(decl, prefix) { - if (decl.prop.includes('grid') && prefix !== '-webkit-') { - return undefined - } - return super.add(decl, prefix) - } - - isStretch() { - return ( - this.name === 'stretch' || - this.name === 'fill' || - this.name === 'fill-available' - ) - } - - old(prefix) { - let prefixed = prefix + this.name - if (this.isStretch()) { - if (prefix === '-moz-') { - prefixed = '-moz-available' - } else if (prefix === '-webkit-') { - prefixed = '-webkit-fill-available' - } - } - return new OldValue(this.name, prefixed, prefixed, regexp(prefixed)) - } - - regexp() { - if (!this.regexpCache) this.regexpCache = regexp(this.name) - return this.regexpCache - } - - replace(string, prefix) { - if (prefix === '-moz-' && this.isStretch()) { - return string.replace(this.regexp(), '$1-moz-available$3') - } - if (prefix === '-webkit-' && this.isStretch()) { - return string.replace(this.regexp(), '$1-webkit-fill-available$3') - } - return super.replace(string, prefix) - } -} - -Intrinsic.names = [ - 'max-content', - 'min-content', - 'fit-content', - 'fill', - 'fill-available', - 'stretch' -] - -module.exports = Intrinsic - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/justify-content.js": -/*!****************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/justify-content.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class JustifyContent extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'justify-content' - } - - /** - * Change property name for 2009 and 2012 specs - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2009) { - return prefix + 'box-pack' - } - if (spec === 2012) { - return prefix + 'flex-pack' - } - return super.prefixed(prop, prefix) - } - - /** - * Change value for 2009 and 2012 specs - */ - set(decl, prefix) { - let spec = flexSpec(prefix)[0] - if (spec === 2009 || spec === 2012) { - let value = JustifyContent.oldValues[decl.value] || decl.value - decl.value = value - if (spec !== 2009 || value !== 'distribute') { - return super.set(decl, prefix) - } - } else if (spec === 'final') { - return super.set(decl, prefix) - } - return undefined - } -} - -JustifyContent.names = ['justify-content', 'flex-pack', 'box-pack'] - -JustifyContent.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start', - 'space-around': 'distribute', - 'space-between': 'justify' -} - -module.exports = JustifyContent - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/mask-border.js": -/*!************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/mask-border.js ***! - \************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class MaskBorder extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return this.name.replace('box-image', 'border') - } - - /** - * Return flex property for 2012 spec - */ - prefixed(prop, prefix) { - let result = super.prefixed(prop, prefix) - if (prefix === '-webkit-') { - result = result.replace('border', 'box-image') - } - return result - } -} - -MaskBorder.names = [ - 'mask-border', - 'mask-border-source', - 'mask-border-slice', - 'mask-border-width', - 'mask-border-outset', - 'mask-border-repeat', - 'mask-box-image', - 'mask-box-image-source', - 'mask-box-image-slice', - 'mask-box-image-width', - 'mask-box-image-outset', - 'mask-box-image-repeat' -] - -module.exports = MaskBorder - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/mask-composite.js": -/*!***************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/mask-composite.js ***! - \***************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class MaskComposite extends Declaration { - /** - * Prefix mask-composite for webkit - */ - insert(decl, prefix, prefixes) { - let isCompositeProp = decl.prop === 'mask-composite' - - let compositeValues - - if (isCompositeProp) { - compositeValues = decl.value.split(',') - } else { - compositeValues = decl.value.match(MaskComposite.regexp) || [] - } - - compositeValues = compositeValues.map(el => el.trim()).filter(el => el) - let hasCompositeValues = compositeValues.length - - let compositeDecl - - if (hasCompositeValues) { - compositeDecl = this.clone(decl) - compositeDecl.value = compositeValues - .map(value => MaskComposite.oldValues[value] || value) - .join(', ') - - if (compositeValues.includes('intersect')) { - compositeDecl.value += ', xor' - } - - compositeDecl.prop = prefix + 'mask-composite' - } - - if (isCompositeProp) { - if (!hasCompositeValues) { - return undefined - } - - if (this.needCascade(decl)) { - compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix) - } - - return decl.parent.insertBefore(decl, compositeDecl) - } - - let cloned = this.clone(decl) - cloned.prop = prefix + cloned.prop - - if (hasCompositeValues) { - cloned.value = cloned.value.replace(MaskComposite.regexp, '') - } - - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - - decl.parent.insertBefore(decl, cloned) - - if (!hasCompositeValues) { - return decl - } - - if (this.needCascade(decl)) { - compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix) - } - return decl.parent.insertBefore(decl, compositeDecl) - } -} - -MaskComposite.names = ['mask', 'mask-composite'] - -MaskComposite.oldValues = { - add: 'source-over', - exclude: 'xor', - intersect: 'source-in', - subtract: 'source-out' -} - -MaskComposite.regexp = new RegExp( - `\\s+(${Object.keys(MaskComposite.oldValues).join( - '|' - )})\\b(?!\\))\\s*(?=[,])`, - 'ig' -) - -module.exports = MaskComposite - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/order.js": -/*!******************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/order.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let flexSpec = __webpack_require__(/*! ./flex-spec */ "./node_modules/autoprefixer/lib/hacks/flex-spec.js") - -class Order extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'order' - } - - /** - * Change property name for 2009 and 2012 specs - */ - prefixed(prop, prefix) { - let spec - ;[spec, prefix] = flexSpec(prefix) - if (spec === 2009) { - return prefix + 'box-ordinal-group' - } - if (spec === 2012) { - return prefix + 'flex-order' - } - return super.prefixed(prop, prefix) - } - - /** - * Fix value for 2009 spec - */ - set(decl, prefix) { - let spec = flexSpec(prefix)[0] - if (spec === 2009 && /\d/.test(decl.value)) { - decl.value = (parseInt(decl.value) + 1).toString() - return super.set(decl, prefix) - } - return super.set(decl, prefix) - } -} - -Order.names = ['order', 'flex-order', 'box-ordinal-group'] - -module.exports = Order - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/overscroll-behavior.js": -/*!********************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/overscroll-behavior.js ***! - \********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class OverscrollBehavior extends Declaration { - /** - * Return property name by spec - */ - normalize() { - return 'overscroll-behavior' - } - - /** - * Change property name for IE - */ - prefixed(prop, prefix) { - return prefix + 'scroll-chaining' - } - - /** - * Change value for IE - */ - set(decl, prefix) { - if (decl.value === 'auto') { - decl.value = 'chained' - } else if (decl.value === 'none' || decl.value === 'contain') { - decl.value = 'none' - } - return super.set(decl, prefix) - } -} - -OverscrollBehavior.names = ['overscroll-behavior', 'scroll-chaining'] - -module.exports = OverscrollBehavior - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/pixelated.js": -/*!**********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/pixelated.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let OldValue = __webpack_require__(/*! ../old-value */ "./node_modules/autoprefixer/lib/old-value.js") -let Value = __webpack_require__(/*! ../value */ "./node_modules/autoprefixer/lib/value.js") - -class Pixelated extends Value { - /** - * Different name for WebKit and Firefox - */ - old(prefix) { - if (prefix === '-webkit-') { - return new OldValue(this.name, '-webkit-optimize-contrast') - } - if (prefix === '-moz-') { - return new OldValue(this.name, '-moz-crisp-edges') - } - return super.old(prefix) - } - - /** - * Use non-standard name for WebKit and Firefox - */ - replace(string, prefix) { - if (prefix === '-webkit-') { - return string.replace(this.regexp(), '$1-webkit-optimize-contrast') - } - if (prefix === '-moz-') { - return string.replace(this.regexp(), '$1-moz-crisp-edges') - } - return super.replace(string, prefix) - } -} - -Pixelated.names = ['pixelated'] - -module.exports = Pixelated - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/place-self.js": -/*!***********************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/place-self.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let utils = __webpack_require__(/*! ./grid-utils */ "./node_modules/autoprefixer/lib/hacks/grid-utils.js") - -class PlaceSelf extends Declaration { - /** - * Translate place-self to separate -ms- prefixed properties - */ - insert(decl, prefix, prefixes) { - if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) - - // prevent doubling of prefixes - if (decl.parent.some(i => i.prop === '-ms-grid-row-align')) { - return undefined - } - - let [[first, second]] = utils.parse(decl) - - if (second) { - utils.insertDecl(decl, 'grid-row-align', first) - utils.insertDecl(decl, 'grid-column-align', second) - } else { - utils.insertDecl(decl, 'grid-row-align', first) - utils.insertDecl(decl, 'grid-column-align', first) - } - - return undefined - } -} - -PlaceSelf.names = ['place-self'] - -module.exports = PlaceSelf - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/placeholder-shown.js": -/*!******************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/placeholder-shown.js ***! - \******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Selector = __webpack_require__(/*! ../selector */ "./node_modules/autoprefixer/lib/selector.js") - -class PlaceholderShown extends Selector { - /** - * Return different selectors depend on prefix - */ - prefixed(prefix) { - if (prefix === '-moz-') { - return ':-moz-placeholder' - } else if (prefix === '-ms-') { - return ':-ms-input-placeholder' - } - return `:${prefix}placeholder-shown` - } -} - -PlaceholderShown.names = [':placeholder-shown'] - -module.exports = PlaceholderShown - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/placeholder.js": -/*!************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/placeholder.js ***! - \************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Selector = __webpack_require__(/*! ../selector */ "./node_modules/autoprefixer/lib/selector.js") - -class Placeholder extends Selector { - /** - * Add old mozilla to possible prefixes - */ - possible() { - return super.possible().concat(['-moz- old', '-ms- old']) - } - - /** - * Return different selectors depend on prefix - */ - prefixed(prefix) { - if (prefix === '-webkit-') { - return '::-webkit-input-placeholder' - } - if (prefix === '-ms-') { - return '::-ms-input-placeholder' - } - if (prefix === '-ms- old') { - return ':-ms-input-placeholder' - } - if (prefix === '-moz- old') { - return ':-moz-placeholder' - } - return `::${prefix}placeholder` - } -} - -Placeholder.names = ['::placeholder'] - -module.exports = Placeholder - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/print-color-adjust.js": -/*!*******************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/print-color-adjust.js ***! - \*******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class PrintColorAdjust extends Declaration { - /** - * Return property name by spec - */ - normalize() { - return 'print-color-adjust' - } - - /** - * Change property name for WebKit-based browsers - */ - prefixed(prop, prefix) { - if (prefix === '-moz-') { - return 'color-adjust' - } else { - return prefix + 'print-color-adjust' - } - } -} - -PrintColorAdjust.names = ['print-color-adjust', 'color-adjust'] - -module.exports = PrintColorAdjust - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js": -/*!*************************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js ***! - \*************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class TextDecorationSkipInk extends Declaration { - /** - * Change prefix for ink value - */ - set(decl, prefix) { - if (decl.prop === 'text-decoration-skip-ink' && decl.value === 'auto') { - decl.prop = prefix + 'text-decoration-skip' - decl.value = 'ink' - return decl - } else { - return super.set(decl, prefix) - } - } -} - -TextDecorationSkipInk.names = [ - 'text-decoration-skip-ink', - 'text-decoration-skip' -] - -module.exports = TextDecorationSkipInk - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/text-decoration.js": -/*!****************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/text-decoration.js ***! - \****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -const BASIC = [ - 'none', - 'underline', - 'overline', - 'line-through', - 'blink', - 'inherit', - 'initial', - 'unset' -] - -class TextDecoration extends Declaration { - /** - * Do not add prefixes for basic values. - */ - check(decl) { - return decl.value.split(/\s+/).some(i => !BASIC.includes(i)) - } -} - -TextDecoration.names = ['text-decoration'] - -module.exports = TextDecoration - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/text-emphasis-position.js": -/*!***********************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/text-emphasis-position.js ***! - \***********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class TextEmphasisPosition extends Declaration { - set(decl, prefix) { - if (prefix === '-webkit-') { - decl.value = decl.value.replace(/\s*(right|left)\s*/i, '') - } - return super.set(decl, prefix) - } -} - -TextEmphasisPosition.names = ['text-emphasis-position'] - -module.exports = TextEmphasisPosition - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/transform-decl.js": -/*!***************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/transform-decl.js ***! - \***************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class TransformDecl extends Declaration { - /** - * Is transform contain 3D commands - */ - contain3d(decl) { - if (decl.prop === 'transform-origin') { - return false - } - - for (let func of TransformDecl.functions3d) { - if (decl.value.includes(`${func}(`)) { - return true - } - } - - return false - } - - /** - * Don't add prefix for IE in keyframes - */ - insert(decl, prefix, prefixes) { - if (prefix === '-ms-') { - if (!this.contain3d(decl) && !this.keyframeParents(decl)) { - return super.insert(decl, prefix, prefixes) - } - } else if (prefix === '-o-') { - if (!this.contain3d(decl)) { - return super.insert(decl, prefix, prefixes) - } - } else { - return super.insert(decl, prefix, prefixes) - } - return undefined - } - - /** - * Recursively check all parents for @keyframes - */ - keyframeParents(decl) { - let { parent } = decl - while (parent) { - if (parent.type === 'atrule' && parent.name === 'keyframes') { - return true - } - ;({ parent } = parent) - } - return false - } - - /** - * Replace rotateZ to rotate for IE 9 - */ - set(decl, prefix) { - decl = super.set(decl, prefix) - if (prefix === '-ms-') { - decl.value = decl.value.replace(/rotatez/gi, 'rotate') - } - return decl - } -} - -TransformDecl.names = ['transform', 'transform-origin'] - -TransformDecl.functions3d = [ - 'matrix3d', - 'translate3d', - 'translateZ', - 'scale3d', - 'scaleZ', - 'rotate3d', - 'rotateX', - 'rotateY', - 'perspective' -] - -module.exports = TransformDecl - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/user-select.js": -/*!************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/user-select.js ***! - \************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class UserSelect extends Declaration { - /** - * Avoid prefixing all in IE - */ - insert(decl, prefix, prefixes) { - if (decl.value === 'all' && prefix === '-ms-') { - return undefined - } else if ( - decl.value === 'contain' && - (prefix === '-moz-' || prefix === '-webkit-') - ) { - return undefined - } else { - return super.insert(decl, prefix, prefixes) - } - } - - /** - * Change prefixed value for IE - */ - set(decl, prefix) { - if (prefix === '-ms-' && decl.value === 'contain') { - decl.value = 'element' - } - return super.set(decl, prefix) - } -} - -UserSelect.names = ['user-select'] - -module.exports = UserSelect - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/hacks/writing-mode.js": -/*!*************************************************************!*\ - !*** ./node_modules/autoprefixer/lib/hacks/writing-mode.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Declaration = __webpack_require__(/*! ../declaration */ "./node_modules/autoprefixer/lib/declaration.js") - -class WritingMode extends Declaration { - insert(decl, prefix, prefixes) { - if (prefix === '-ms-') { - let cloned = this.set(this.clone(decl), prefix) - - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - let direction = 'ltr' - - decl.parent.nodes.forEach(i => { - if (i.prop === 'direction') { - if (i.value === 'rtl' || i.value === 'ltr') direction = i.value - } - }) - - cloned.value = WritingMode.msValues[direction][decl.value] || decl.value - return decl.parent.insertBefore(decl, cloned) - } - - return super.insert(decl, prefix, prefixes) - } -} - -WritingMode.names = ['writing-mode'] - -WritingMode.msValues = { - ltr: { - 'horizontal-tb': 'lr-tb', - 'vertical-lr': 'tb-lr', - 'vertical-rl': 'tb-rl' - }, - rtl: { - 'horizontal-tb': 'rl-tb', - 'vertical-lr': 'bt-lr', - 'vertical-rl': 'bt-rl' - } -} - -module.exports = WritingMode - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/info.js": -/*!***********************************************!*\ - !*** ./node_modules/autoprefixer/lib/info.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let browserslist = __webpack_require__(/*! browserslist */ "./node_modules/browserslist/index.js") - -function capitalize(str) { - return str.slice(0, 1).toUpperCase() + str.slice(1) -} - -const NAMES = { - and_chr: 'Chrome for Android', - and_ff: 'Firefox for Android', - and_qq: 'QQ Browser', - and_uc: 'UC for Android', - baidu: 'Baidu Browser', - ie: 'IE', - ie_mob: 'IE Mobile', - ios_saf: 'iOS Safari', - kaios: 'KaiOS Browser', - op_mini: 'Opera Mini', - op_mob: 'Opera Mobile', - samsung: 'Samsung Internet' -} - -function prefix(name, prefixes, note) { - let out = ` ${name}` - if (note) out += ' *' - out += ': ' - out += prefixes.map(i => i.replace(/^-(.*)-$/g, '$1')).join(', ') - out += '\n' - return out -} - -module.exports = function (prefixes) { - if (prefixes.browsers.selected.length === 0) { - return 'No browsers selected' - } - - let versions = {} - for (let browser of prefixes.browsers.selected) { - let parts = browser.split(' ') - let name = parts[0] - let version = parts[1] - - name = NAMES[name] || capitalize(name) - if (versions[name]) { - versions[name].push(version) - } else { - versions[name] = [version] - } - } - - let out = 'Browsers:\n' - for (let browser in versions) { - let list = versions[browser] - list = list.sort((a, b) => parseFloat(b) - parseFloat(a)) - out += ` ${browser}: ${list.join(', ')}\n` - } - - let coverage = browserslist.coverage(prefixes.browsers.selected) - let round = Math.round(coverage * 100) / 100.0 - out += `\nThese browsers account for ${round}% of all users globally\n` - - let atrules = [] - for (let name in prefixes.add) { - let data = prefixes.add[name] - if (name[0] === '@' && data.prefixes) { - atrules.push(prefix(name, data.prefixes)) - } - } - if (atrules.length > 0) { - out += `\nAt-Rules:\n${atrules.sort().join('')}` - } - - let selectors = [] - for (let selector of prefixes.add.selectors) { - if (selector.prefixes) { - selectors.push(prefix(selector.name, selector.prefixes)) - } - } - if (selectors.length > 0) { - out += `\nSelectors:\n${selectors.sort().join('')}` - } - - let values = [] - let props = [] - let hadGrid = false - for (let name in prefixes.add) { - let data = prefixes.add[name] - if (name[0] !== '@' && data.prefixes) { - let grid = name.indexOf('grid-') === 0 - if (grid) hadGrid = true - props.push(prefix(name, data.prefixes, grid)) - } - - if (!Array.isArray(data.values)) { - continue - } - for (let value of data.values) { - let grid = value.name.includes('grid') - if (grid) hadGrid = true - let string = prefix(value.name, value.prefixes, grid) - if (!values.includes(string)) { - values.push(string) - } - } - } - - if (props.length > 0) { - out += `\nProperties:\n${props.sort().join('')}` - } - if (values.length > 0) { - out += `\nValues:\n${values.sort().join('')}` - } - if (hadGrid) { - out += '\n* - Prefixes will be added only on grid: true option.\n' - } - - if (!atrules.length && !selectors.length && !props.length && !values.length) { - out += - "\nAwesome! Your browsers don't require any vendor prefixes." + - '\nNow you can remove Autoprefixer from build steps.' - } - - return out -} - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/old-selector.js": -/*!*******************************************************!*\ - !*** ./node_modules/autoprefixer/lib/old-selector.js ***! - \*******************************************************/ -/***/ ((module) => { - -class OldSelector { - constructor(selector, prefix) { - this.prefix = prefix - this.prefixed = selector.prefixed(this.prefix) - this.regexp = selector.regexp(this.prefix) - - this.prefixeds = selector - .possible() - .map(x => [selector.prefixed(x), selector.regexp(x)]) - - this.unprefixed = selector.name - this.nameRegexp = selector.regexp() - } - - /** - * Does rule contain an unnecessary prefixed selector - */ - check(rule) { - if (!rule.selector.includes(this.prefixed)) { - return false - } - if (!rule.selector.match(this.regexp)) { - return false - } - if (this.isHack(rule)) { - return false - } - return true - } - - /** - * Is rule a hack without unprefixed version bottom - */ - isHack(rule) { - let index = rule.parent.index(rule) + 1 - let rules = rule.parent.nodes - - while (index < rules.length) { - let before = rules[index].selector - if (!before) { - return true - } - - if (before.includes(this.unprefixed) && before.match(this.nameRegexp)) { - return false - } - - let some = false - for (let [string, regexp] of this.prefixeds) { - if (before.includes(string) && before.match(regexp)) { - some = true - break - } - } - - if (!some) { - return true - } - - index += 1 - } - - return true - } -} - -module.exports = OldSelector - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/old-value.js": -/*!****************************************************!*\ - !*** ./node_modules/autoprefixer/lib/old-value.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") - -class OldValue { - constructor(unprefixed, prefixed, string, regexp) { - this.unprefixed = unprefixed - this.prefixed = prefixed - this.string = string || prefixed - this.regexp = regexp || utils.regexp(prefixed) - } - - /** - * Check, that value contain old value - */ - check(value) { - if (value.includes(this.string)) { - return !!value.match(this.regexp) - } - return false - } -} - -module.exports = OldValue - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/prefixer.js": -/*!***************************************************!*\ - !*** ./node_modules/autoprefixer/lib/prefixer.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let Browsers = __webpack_require__(/*! ./browsers */ "./node_modules/autoprefixer/lib/browsers.js") -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") -let vendor = __webpack_require__(/*! ./vendor */ "./node_modules/autoprefixer/lib/vendor.js") - -/** - * Recursively clone objects - */ -function clone(obj, parent) { - let cloned = new obj.constructor() - - for (let i of Object.keys(obj || {})) { - let value = obj[i] - if (i === 'parent' && typeof value === 'object') { - if (parent) { - cloned[i] = parent - } - } else if (i === 'source' || i === null) { - cloned[i] = value - } else if (Array.isArray(value)) { - cloned[i] = value.map(x => clone(x, cloned)) - } else if ( - i !== '_autoprefixerPrefix' && - i !== '_autoprefixerValues' && - i !== 'proxyCache' - ) { - if (typeof value === 'object' && value !== null) { - value = clone(value, cloned) - } - cloned[i] = value - } - } - - return cloned -} - -class Prefixer { - constructor(name, prefixes, all) { - this.prefixes = prefixes - this.name = name - this.all = all - } - - /** - * Clone node and clean autprefixer custom caches - */ - static clone(node, overrides) { - let cloned = clone(node) - for (let name in overrides) { - cloned[name] = overrides[name] - } - return cloned - } - - /** - * Add hack to selected names - */ - static hack(klass) { - if (!this.hacks) { - this.hacks = {} - } - return klass.names.map(name => { - this.hacks[name] = klass - return this.hacks[name] - }) - } - - /** - * Load hacks for some names - */ - static load(name, prefixes, all) { - let Klass = this.hacks && this.hacks[name] - if (Klass) { - return new Klass(name, prefixes, all) - } else { - return new this(name, prefixes, all) - } - } - - /** - * Shortcut for Prefixer.clone - */ - clone(node, overrides) { - return Prefixer.clone(node, overrides) - } - - /** - * Find prefix in node parents - */ - parentPrefix(node) { - let prefix - - if (typeof node._autoprefixerPrefix !== 'undefined') { - prefix = node._autoprefixerPrefix - } else if (node.type === 'decl' && node.prop[0] === '-') { - prefix = vendor.prefix(node.prop) - } else if (node.type === 'root') { - prefix = false - } else if ( - node.type === 'rule' && - node.selector.includes(':-') && - /:(-\w+-)/.test(node.selector) - ) { - prefix = node.selector.match(/:(-\w+-)/)[1] - } else if (node.type === 'atrule' && node.name[0] === '-') { - prefix = vendor.prefix(node.name) - } else { - prefix = this.parentPrefix(node.parent) - } - - if (!Browsers.prefixes().includes(prefix)) { - prefix = false - } - - node._autoprefixerPrefix = prefix - - return node._autoprefixerPrefix - } - - /** - * Clone node with prefixes - */ - process(node, result) { - if (!this.check(node)) { - return undefined - } - - let parent = this.parentPrefix(node) - - let prefixes = this.prefixes.filter( - prefix => !parent || parent === utils.removeNote(prefix) - ) - - let added = [] - for (let prefix of prefixes) { - if (this.add(node, prefix, added.concat([prefix]), result)) { - added.push(prefix) - } - } - - return added - } -} - -module.exports = Prefixer - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/prefixes.js": -/*!***************************************************!*\ - !*** ./node_modules/autoprefixer/lib/prefixes.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let AtRule = __webpack_require__(/*! ./at-rule */ "./node_modules/autoprefixer/lib/at-rule.js") -let Browsers = __webpack_require__(/*! ./browsers */ "./node_modules/autoprefixer/lib/browsers.js") -let Declaration = __webpack_require__(/*! ./declaration */ "./node_modules/autoprefixer/lib/declaration.js") -let hackAlignContent = __webpack_require__(/*! ./hacks/align-content */ "./node_modules/autoprefixer/lib/hacks/align-content.js") -let hackAlignItems = __webpack_require__(/*! ./hacks/align-items */ "./node_modules/autoprefixer/lib/hacks/align-items.js") -let hackAlignSelf = __webpack_require__(/*! ./hacks/align-self */ "./node_modules/autoprefixer/lib/hacks/align-self.js") -let hackAnimation = __webpack_require__(/*! ./hacks/animation */ "./node_modules/autoprefixer/lib/hacks/animation.js") -let hackAppearance = __webpack_require__(/*! ./hacks/appearance */ "./node_modules/autoprefixer/lib/hacks/appearance.js") -let hackAutofill = __webpack_require__(/*! ./hacks/autofill */ "./node_modules/autoprefixer/lib/hacks/autofill.js") -let hackBackdropFilter = __webpack_require__(/*! ./hacks/backdrop-filter */ "./node_modules/autoprefixer/lib/hacks/backdrop-filter.js") -let hackBackgroundClip = __webpack_require__(/*! ./hacks/background-clip */ "./node_modules/autoprefixer/lib/hacks/background-clip.js") -let hackBackgroundSize = __webpack_require__(/*! ./hacks/background-size */ "./node_modules/autoprefixer/lib/hacks/background-size.js") -let hackBlockLogical = __webpack_require__(/*! ./hacks/block-logical */ "./node_modules/autoprefixer/lib/hacks/block-logical.js") -let hackBorderImage = __webpack_require__(/*! ./hacks/border-image */ "./node_modules/autoprefixer/lib/hacks/border-image.js") -let hackBorderRadius = __webpack_require__(/*! ./hacks/border-radius */ "./node_modules/autoprefixer/lib/hacks/border-radius.js") -let hackBreakProps = __webpack_require__(/*! ./hacks/break-props */ "./node_modules/autoprefixer/lib/hacks/break-props.js") -let hackCrossFade = __webpack_require__(/*! ./hacks/cross-fade */ "./node_modules/autoprefixer/lib/hacks/cross-fade.js") -let hackDisplayFlex = __webpack_require__(/*! ./hacks/display-flex */ "./node_modules/autoprefixer/lib/hacks/display-flex.js") -let hackDisplayGrid = __webpack_require__(/*! ./hacks/display-grid */ "./node_modules/autoprefixer/lib/hacks/display-grid.js") -let hackFileSelectorButton = __webpack_require__(/*! ./hacks/file-selector-button */ "./node_modules/autoprefixer/lib/hacks/file-selector-button.js") -let hackFilter = __webpack_require__(/*! ./hacks/filter */ "./node_modules/autoprefixer/lib/hacks/filter.js") -let hackFilterValue = __webpack_require__(/*! ./hacks/filter-value */ "./node_modules/autoprefixer/lib/hacks/filter-value.js") -let hackFlex = __webpack_require__(/*! ./hacks/flex */ "./node_modules/autoprefixer/lib/hacks/flex.js") -let hackFlexBasis = __webpack_require__(/*! ./hacks/flex-basis */ "./node_modules/autoprefixer/lib/hacks/flex-basis.js") -let hackFlexDirection = __webpack_require__(/*! ./hacks/flex-direction */ "./node_modules/autoprefixer/lib/hacks/flex-direction.js") -let hackFlexFlow = __webpack_require__(/*! ./hacks/flex-flow */ "./node_modules/autoprefixer/lib/hacks/flex-flow.js") -let hackFlexGrow = __webpack_require__(/*! ./hacks/flex-grow */ "./node_modules/autoprefixer/lib/hacks/flex-grow.js") -let hackFlexShrink = __webpack_require__(/*! ./hacks/flex-shrink */ "./node_modules/autoprefixer/lib/hacks/flex-shrink.js") -let hackFlexWrap = __webpack_require__(/*! ./hacks/flex-wrap */ "./node_modules/autoprefixer/lib/hacks/flex-wrap.js") -let hackFullscreen = __webpack_require__(/*! ./hacks/fullscreen */ "./node_modules/autoprefixer/lib/hacks/fullscreen.js") -let hackGradient = __webpack_require__(/*! ./hacks/gradient */ "./node_modules/autoprefixer/lib/hacks/gradient.js") -let hackGridArea = __webpack_require__(/*! ./hacks/grid-area */ "./node_modules/autoprefixer/lib/hacks/grid-area.js") -let hackGridColumnAlign = __webpack_require__(/*! ./hacks/grid-column-align */ "./node_modules/autoprefixer/lib/hacks/grid-column-align.js") -let hackGridEnd = __webpack_require__(/*! ./hacks/grid-end */ "./node_modules/autoprefixer/lib/hacks/grid-end.js") -let hackGridRowAlign = __webpack_require__(/*! ./hacks/grid-row-align */ "./node_modules/autoprefixer/lib/hacks/grid-row-align.js") -let hackGridRowColumn = __webpack_require__(/*! ./hacks/grid-row-column */ "./node_modules/autoprefixer/lib/hacks/grid-row-column.js") -let hackGridRowsColumns = __webpack_require__(/*! ./hacks/grid-rows-columns */ "./node_modules/autoprefixer/lib/hacks/grid-rows-columns.js") -let hackGridStart = __webpack_require__(/*! ./hacks/grid-start */ "./node_modules/autoprefixer/lib/hacks/grid-start.js") -let hackGridTemplate = __webpack_require__(/*! ./hacks/grid-template */ "./node_modules/autoprefixer/lib/hacks/grid-template.js") -let hackGridTemplateAreas = __webpack_require__(/*! ./hacks/grid-template-areas */ "./node_modules/autoprefixer/lib/hacks/grid-template-areas.js") -let hackImageRendering = __webpack_require__(/*! ./hacks/image-rendering */ "./node_modules/autoprefixer/lib/hacks/image-rendering.js") -let hackImageSet = __webpack_require__(/*! ./hacks/image-set */ "./node_modules/autoprefixer/lib/hacks/image-set.js") -let hackInlineLogical = __webpack_require__(/*! ./hacks/inline-logical */ "./node_modules/autoprefixer/lib/hacks/inline-logical.js") -let hackIntrinsic = __webpack_require__(/*! ./hacks/intrinsic */ "./node_modules/autoprefixer/lib/hacks/intrinsic.js") -let hackJustifyContent = __webpack_require__(/*! ./hacks/justify-content */ "./node_modules/autoprefixer/lib/hacks/justify-content.js") -let hackMaskBorder = __webpack_require__(/*! ./hacks/mask-border */ "./node_modules/autoprefixer/lib/hacks/mask-border.js") -let hackMaskComposite = __webpack_require__(/*! ./hacks/mask-composite */ "./node_modules/autoprefixer/lib/hacks/mask-composite.js") -let hackOrder = __webpack_require__(/*! ./hacks/order */ "./node_modules/autoprefixer/lib/hacks/order.js") -let hackOverscrollBehavior = __webpack_require__(/*! ./hacks/overscroll-behavior */ "./node_modules/autoprefixer/lib/hacks/overscroll-behavior.js") -let hackPixelated = __webpack_require__(/*! ./hacks/pixelated */ "./node_modules/autoprefixer/lib/hacks/pixelated.js") -let hackPlaceSelf = __webpack_require__(/*! ./hacks/place-self */ "./node_modules/autoprefixer/lib/hacks/place-self.js") -let hackPlaceholder = __webpack_require__(/*! ./hacks/placeholder */ "./node_modules/autoprefixer/lib/hacks/placeholder.js") -let hackPlaceholderShown = __webpack_require__(/*! ./hacks/placeholder-shown */ "./node_modules/autoprefixer/lib/hacks/placeholder-shown.js") -let hackPrintColorAdjust = __webpack_require__(/*! ./hacks/print-color-adjust */ "./node_modules/autoprefixer/lib/hacks/print-color-adjust.js") -let hackTextDecoration = __webpack_require__(/*! ./hacks/text-decoration */ "./node_modules/autoprefixer/lib/hacks/text-decoration.js") -let hackTextDecorationSkipInk = __webpack_require__(/*! ./hacks/text-decoration-skip-ink */ "./node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js") -let hackTextEmphasisPosition = __webpack_require__(/*! ./hacks/text-emphasis-position */ "./node_modules/autoprefixer/lib/hacks/text-emphasis-position.js") -let hackTransformDecl = __webpack_require__(/*! ./hacks/transform-decl */ "./node_modules/autoprefixer/lib/hacks/transform-decl.js") -let hackUserSelect = __webpack_require__(/*! ./hacks/user-select */ "./node_modules/autoprefixer/lib/hacks/user-select.js") -let hackWritingMode = __webpack_require__(/*! ./hacks/writing-mode */ "./node_modules/autoprefixer/lib/hacks/writing-mode.js") -let Processor = __webpack_require__(/*! ./processor */ "./node_modules/autoprefixer/lib/processor.js") -let Resolution = __webpack_require__(/*! ./resolution */ "./node_modules/autoprefixer/lib/resolution.js") -let Selector = __webpack_require__(/*! ./selector */ "./node_modules/autoprefixer/lib/selector.js") -let Supports = __webpack_require__(/*! ./supports */ "./node_modules/autoprefixer/lib/supports.js") -let Transition = __webpack_require__(/*! ./transition */ "./node_modules/autoprefixer/lib/transition.js") -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") -let Value = __webpack_require__(/*! ./value */ "./node_modules/autoprefixer/lib/value.js") -let vendor = __webpack_require__(/*! ./vendor */ "./node_modules/autoprefixer/lib/vendor.js") - -Selector.hack(hackAutofill) -Selector.hack(hackFullscreen) -Selector.hack(hackPlaceholder) -Selector.hack(hackPlaceholderShown) -Selector.hack(hackFileSelectorButton) -Declaration.hack(hackFlex) -Declaration.hack(hackOrder) -Declaration.hack(hackFilter) -Declaration.hack(hackGridEnd) -Declaration.hack(hackAnimation) -Declaration.hack(hackFlexFlow) -Declaration.hack(hackFlexGrow) -Declaration.hack(hackFlexWrap) -Declaration.hack(hackGridArea) -Declaration.hack(hackPlaceSelf) -Declaration.hack(hackGridStart) -Declaration.hack(hackAlignSelf) -Declaration.hack(hackAppearance) -Declaration.hack(hackFlexBasis) -Declaration.hack(hackMaskBorder) -Declaration.hack(hackMaskComposite) -Declaration.hack(hackAlignItems) -Declaration.hack(hackUserSelect) -Declaration.hack(hackFlexShrink) -Declaration.hack(hackBreakProps) -Declaration.hack(hackWritingMode) -Declaration.hack(hackBorderImage) -Declaration.hack(hackAlignContent) -Declaration.hack(hackBorderRadius) -Declaration.hack(hackBlockLogical) -Declaration.hack(hackGridTemplate) -Declaration.hack(hackInlineLogical) -Declaration.hack(hackGridRowAlign) -Declaration.hack(hackTransformDecl) -Declaration.hack(hackFlexDirection) -Declaration.hack(hackImageRendering) -Declaration.hack(hackBackdropFilter) -Declaration.hack(hackBackgroundClip) -Declaration.hack(hackTextDecoration) -Declaration.hack(hackJustifyContent) -Declaration.hack(hackBackgroundSize) -Declaration.hack(hackGridRowColumn) -Declaration.hack(hackGridRowsColumns) -Declaration.hack(hackGridColumnAlign) -Declaration.hack(hackOverscrollBehavior) -Declaration.hack(hackGridTemplateAreas) -Declaration.hack(hackPrintColorAdjust) -Declaration.hack(hackTextEmphasisPosition) -Declaration.hack(hackTextDecorationSkipInk) -Value.hack(hackGradient) -Value.hack(hackIntrinsic) -Value.hack(hackPixelated) -Value.hack(hackImageSet) -Value.hack(hackCrossFade) -Value.hack(hackDisplayFlex) -Value.hack(hackDisplayGrid) -Value.hack(hackFilterValue) - -let declsCache = new Map() - -class Prefixes { - constructor(data, browsers, options = {}) { - this.data = data - this.browsers = browsers - this.options = options - ;[this.add, this.remove] = this.preprocess(this.select(this.data)) - this.transition = new Transition(this) - this.processor = new Processor(this) - } - - /** - * Return clone instance to remove all prefixes - */ - cleaner() { - if (this.cleanerCache) { - return this.cleanerCache - } - - if (this.browsers.selected.length) { - let empty = new Browsers(this.browsers.data, []) - this.cleanerCache = new Prefixes(this.data, empty, this.options) - } else { - return this - } - - return this.cleanerCache - } - - /** - * Declaration loader with caching - */ - decl(prop) { - if (!declsCache.has(prop)) { - declsCache.set(prop, Declaration.load(prop)) - } - - return declsCache.get(prop) - } - - /** - * Group declaration by unprefixed property to check them - */ - group(decl) { - let rule = decl.parent - let index = rule.index(decl) - let { length } = rule.nodes - let unprefixed = this.unprefixed(decl.prop) - - let checker = (step, callback) => { - index += step - while (index >= 0 && index < length) { - let other = rule.nodes[index] - if (other.type === 'decl') { - if (step === -1 && other.prop === unprefixed) { - if (!Browsers.withPrefix(other.value)) { - break - } - } - - if (this.unprefixed(other.prop) !== unprefixed) { - break - } else if (callback(other) === true) { - return true - } - - if (step === +1 && other.prop === unprefixed) { - if (!Browsers.withPrefix(other.value)) { - break - } - } - } - - index += step - } - return false - } - - return { - down(callback) { - return checker(+1, callback) - }, - up(callback) { - return checker(-1, callback) - } - } - } - - /** - * Normalize prefix for remover - */ - normalize(prop) { - return this.decl(prop).normalize(prop) - } - - /** - * Return prefixed version of property - */ - prefixed(prop, prefix) { - prop = vendor.unprefixed(prop) - return this.decl(prop).prefixed(prop, prefix) - } - - /** - * Cache prefixes data to fast CSS processing - */ - preprocess(selected) { - let add = { - '@supports': new Supports(Prefixes, this), - 'selectors': [] - } - for (let name in selected.add) { - let prefixes = selected.add[name] - if (name === '@keyframes' || name === '@viewport') { - add[name] = new AtRule(name, prefixes, this) - } else if (name === '@resolution') { - add[name] = new Resolution(name, prefixes, this) - } else if (this.data[name].selector) { - add.selectors.push(Selector.load(name, prefixes, this)) - } else { - let props = this.data[name].props - - if (props) { - let value = Value.load(name, prefixes, this) - for (let prop of props) { - if (!add[prop]) { - add[prop] = { values: [] } - } - add[prop].values.push(value) - } - } else { - let values = (add[name] && add[name].values) || [] - add[name] = Declaration.load(name, prefixes, this) - add[name].values = values - } - } - } - - let remove = { selectors: [] } - for (let name in selected.remove) { - let prefixes = selected.remove[name] - if (this.data[name].selector) { - let selector = Selector.load(name, prefixes) - for (let prefix of prefixes) { - remove.selectors.push(selector.old(prefix)) - } - } else if (name === '@keyframes' || name === '@viewport') { - for (let prefix of prefixes) { - let prefixed = `@${prefix}${name.slice(1)}` - remove[prefixed] = { remove: true } - } - } else if (name === '@resolution') { - remove[name] = new Resolution(name, prefixes, this) - } else { - let props = this.data[name].props - if (props) { - let value = Value.load(name, [], this) - for (let prefix of prefixes) { - let old = value.old(prefix) - if (old) { - for (let prop of props) { - if (!remove[prop]) { - remove[prop] = {} - } - if (!remove[prop].values) { - remove[prop].values = [] - } - remove[prop].values.push(old) - } - } - } - } else { - for (let p of prefixes) { - let olds = this.decl(name).old(name, p) - if (name === 'align-self') { - let a = add[name] && add[name].prefixes - if (a) { - if (p === '-webkit- 2009' && a.includes('-webkit-')) { - continue - } else if (p === '-webkit-' && a.includes('-webkit- 2009')) { - continue - } - } - } - for (let prefixed of olds) { - if (!remove[prefixed]) { - remove[prefixed] = {} - } - remove[prefixed].remove = true - } - } - } - } - } - - return [add, remove] - } - - /** - * Select prefixes from data, which is necessary for selected browsers - */ - select(list) { - let selected = { add: {}, remove: {} } - - for (let name in list) { - let data = list[name] - let add = data.browsers.map(i => { - let params = i.split(' ') - return { - browser: `${params[0]} ${params[1]}`, - note: params[2] - } - }) - - let notes = add - .filter(i => i.note) - .map(i => `${this.browsers.prefix(i.browser)} ${i.note}`) - notes = utils.uniq(notes) - - add = add - .filter(i => this.browsers.isSelected(i.browser)) - .map(i => { - let prefix = this.browsers.prefix(i.browser) - if (i.note) { - return `${prefix} ${i.note}` - } else { - return prefix - } - }) - add = this.sort(utils.uniq(add)) - - if (this.options.flexbox === 'no-2009') { - add = add.filter(i => !i.includes('2009')) - } - - let all = data.browsers.map(i => this.browsers.prefix(i)) - if (data.mistakes) { - all = all.concat(data.mistakes) - } - all = all.concat(notes) - all = utils.uniq(all) - - if (add.length) { - selected.add[name] = add - if (add.length < all.length) { - selected.remove[name] = all.filter(i => !add.includes(i)) - } - } else { - selected.remove[name] = all - } - } - - return selected - } - - /** - * Sort vendor prefixes - */ - sort(prefixes) { - return prefixes.sort((a, b) => { - let aLength = utils.removeNote(a).length - let bLength = utils.removeNote(b).length - - if (aLength === bLength) { - return b.length - a.length - } else { - return bLength - aLength - } - }) - } - - /** - * Return unprefixed version of property - */ - unprefixed(prop) { - let value = this.normalize(vendor.unprefixed(prop)) - if (value === 'flex-direction') { - value = 'flex-flow' - } - return value - } - - /** - * Return values, which must be prefixed in selected property - */ - values(type, prop) { - let data = this[type] - - let global = data['*'] && data['*'].values - let values = data[prop] && data[prop].values - - if (global && values) { - return utils.uniq(global.concat(values)) - } else { - return global || values || [] - } - } -} - -module.exports = Prefixes - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/processor.js": -/*!****************************************************!*\ - !*** ./node_modules/autoprefixer/lib/processor.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); -let parser = __webpack_require__(/*! postcss-value-parser */ "./node_modules/postcss-value-parser/lib/index.js") - -let Value = __webpack_require__(/*! ./value */ "./node_modules/autoprefixer/lib/value.js") -let insertAreas = (__webpack_require__(/*! ./hacks/grid-utils */ "./node_modules/autoprefixer/lib/hacks/grid-utils.js").insertAreas) - -const OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i -const OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i -const IGNORE_NEXT = /(!\s*)?autoprefixer:\s*ignore\s+next/i -const GRID_REGEX = /(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i - -const SIZES = [ - 'width', - 'height', - 'min-width', - 'max-width', - 'min-height', - 'max-height', - 'inline-size', - 'min-inline-size', - 'max-inline-size', - 'block-size', - 'min-block-size', - 'max-block-size' -] - -function hasGridTemplate(decl) { - return decl.parent.some( - i => i.prop === 'grid-template' || i.prop === 'grid-template-areas' - ) -} - -function hasRowsAndColumns(decl) { - let hasRows = decl.parent.some(i => i.prop === 'grid-template-rows') - let hasColumns = decl.parent.some(i => i.prop === 'grid-template-columns') - return hasRows && hasColumns -} - -class Processor { - constructor(prefixes) { - this.prefixes = prefixes - } - - /** - * Add necessary prefixes - */ - add(css, result) { - // At-rules - let resolution = this.prefixes.add['@resolution'] - let keyframes = this.prefixes.add['@keyframes'] - let viewport = this.prefixes.add['@viewport'] - let supports = this.prefixes.add['@supports'] - - css.walkAtRules(rule => { - if (rule.name === 'keyframes') { - if (!this.disabled(rule, result)) { - return keyframes && keyframes.process(rule) - } - } else if (rule.name === 'viewport') { - if (!this.disabled(rule, result)) { - return viewport && viewport.process(rule) - } - } else if (rule.name === 'supports') { - if ( - this.prefixes.options.supports !== false && - !this.disabled(rule, result) - ) { - return supports.process(rule) - } - } else if (rule.name === 'media' && rule.params.includes('-resolution')) { - if (!this.disabled(rule, result)) { - return resolution && resolution.process(rule) - } - } - - return undefined - }) - - // Selectors - css.walkRules(rule => { - if (this.disabled(rule, result)) return undefined - - return this.prefixes.add.selectors.map(selector => { - return selector.process(rule, result) - }) - }) - - function insideGrid(decl) { - return decl.parent.nodes.some(node => { - if (node.type !== 'decl') return false - let displayGrid = - node.prop === 'display' && /(inline-)?grid/.test(node.value) - let gridTemplate = node.prop.startsWith('grid-template') - let gridGap = /^grid-([A-z]+-)?gap/.test(node.prop) - return displayGrid || gridTemplate || gridGap - }) - } - - let gridPrefixes = - this.gridStatus(css, result) && - this.prefixes.add['grid-area'] && - this.prefixes.add['grid-area'].prefixes - - css.walkDecls(decl => { - if (this.disabledDecl(decl, result)) return undefined - - let parent = decl.parent - let prop = decl.prop - let value = decl.value - - if (prop === 'color-adjust') { - if (parent.every(i => i.prop !== 'print-color-adjust')) { - result.warn( - 'Replace color-adjust to print-color-adjust. ' + - 'The color-adjust shorthand is currently deprecated.', - { node: decl } - ) - } - } else if (prop === 'grid-row-span') { - result.warn( - 'grid-row-span is not part of final Grid Layout. Use grid-row.', - { node: decl } - ) - return undefined - } else if (prop === 'grid-column-span') { - result.warn( - 'grid-column-span is not part of final Grid Layout. Use grid-column.', - { node: decl } - ) - return undefined - } else if (prop === 'display' && value === 'box') { - result.warn( - 'You should write display: flex by final spec ' + - 'instead of display: box', - { node: decl } - ) - return undefined - } else if (prop === 'text-emphasis-position') { - if (value === 'under' || value === 'over') { - result.warn( - 'You should use 2 values for text-emphasis-position ' + - 'For example, `under left` instead of just `under`.', - { node: decl } - ) - } - } else if (prop === 'text-decoration-skip' && value === 'ink') { - result.warn( - 'Replace text-decoration-skip: ink to ' + - 'text-decoration-skip-ink: auto, because spec had been changed', - { node: decl } - ) - } else { - if (gridPrefixes && this.gridStatus(decl, result)) { - if (decl.value === 'subgrid') { - result.warn('IE does not support subgrid', { node: decl }) - } - if (/^(align|justify|place)-items$/.test(prop) && insideGrid(decl)) { - let fixed = prop.replace('-items', '-self') - result.warn( - `IE does not support ${prop} on grid containers. ` + - `Try using ${fixed} on child elements instead: ` + - `${decl.parent.selector} > * { ${fixed}: ${decl.value} }`, - { node: decl } - ) - } else if ( - /^(align|justify|place)-content$/.test(prop) && - insideGrid(decl) - ) { - result.warn(`IE does not support ${decl.prop} on grid containers`, { - node: decl - }) - } else if (prop === 'display' && decl.value === 'contents') { - result.warn( - 'Please do not use display: contents; ' + - 'if you have grid setting enabled', - { node: decl } - ) - return undefined - } else if (decl.prop === 'grid-gap') { - let status = this.gridStatus(decl, result) - if ( - status === 'autoplace' && - !hasRowsAndColumns(decl) && - !hasGridTemplate(decl) - ) { - result.warn( - 'grid-gap only works if grid-template(-areas) is being ' + - 'used or both rows and columns have been declared ' + - 'and cells have not been manually ' + - 'placed inside the explicit grid', - { node: decl } - ) - } else if ( - (status === true || status === 'no-autoplace') && - !hasGridTemplate(decl) - ) { - result.warn( - 'grid-gap only works if grid-template(-areas) is being used', - { node: decl } - ) - } - } else if (prop === 'grid-auto-columns') { - result.warn('grid-auto-columns is not supported by IE', { - node: decl - }) - return undefined - } else if (prop === 'grid-auto-rows') { - result.warn('grid-auto-rows is not supported by IE', { node: decl }) - return undefined - } else if (prop === 'grid-auto-flow') { - let hasRows = parent.some(i => i.prop === 'grid-template-rows') - let hasCols = parent.some(i => i.prop === 'grid-template-columns') - - if (hasGridTemplate(decl)) { - result.warn('grid-auto-flow is not supported by IE', { - node: decl - }) - } else if (value.includes('dense')) { - result.warn('grid-auto-flow: dense is not supported by IE', { - node: decl - }) - } else if (!hasRows && !hasCols) { - result.warn( - 'grid-auto-flow works only if grid-template-rows and ' + - 'grid-template-columns are present in the same rule', - { node: decl } - ) - } - return undefined - } else if (value.includes('auto-fit')) { - result.warn('auto-fit value is not supported by IE', { - node: decl, - word: 'auto-fit' - }) - return undefined - } else if (value.includes('auto-fill')) { - result.warn('auto-fill value is not supported by IE', { - node: decl, - word: 'auto-fill' - }) - return undefined - } else if (prop.startsWith('grid-template') && value.includes('[')) { - result.warn( - 'Autoprefixer currently does not support line names. ' + - 'Try using grid-template-areas instead.', - { node: decl, word: '[' } - ) - } - } - if (value.includes('radial-gradient')) { - if (OLD_RADIAL.test(decl.value)) { - result.warn( - 'Gradient has outdated direction syntax. ' + - 'New syntax is like `closest-side at 0 0` ' + - 'instead of `0 0, closest-side`.', - { node: decl } - ) - } else { - let ast = parser(value) - - for (let i of ast.nodes) { - if (i.type === 'function' && i.value === 'radial-gradient') { - for (let word of i.nodes) { - if (word.type === 'word') { - if (word.value === 'cover') { - result.warn( - 'Gradient has outdated direction syntax. ' + - 'Replace `cover` to `farthest-corner`.', - { node: decl } - ) - } else if (word.value === 'contain') { - result.warn( - 'Gradient has outdated direction syntax. ' + - 'Replace `contain` to `closest-side`.', - { node: decl } - ) - } - } - } - } - } - } - } - if (value.includes('linear-gradient')) { - if (OLD_LINEAR.test(value)) { - result.warn( - 'Gradient has outdated direction syntax. ' + - 'New syntax is like `to left` instead of `right`.', - { node: decl } - ) - } - } - } - - if (SIZES.includes(decl.prop)) { - if (!decl.value.includes('-fill-available')) { - if (decl.value.includes('fill-available')) { - result.warn( - 'Replace fill-available to stretch, ' + - 'because spec had been changed', - { node: decl } - ) - } else if (decl.value.includes('fill')) { - let ast = parser(value) - if (ast.nodes.some(i => i.type === 'word' && i.value === 'fill')) { - result.warn( - 'Replace fill to stretch, because spec had been changed', - { node: decl } - ) - } - } - } - } - - let prefixer - - if (decl.prop === 'transition' || decl.prop === 'transition-property') { - // Transition - return this.prefixes.transition.add(decl, result) - } else if (decl.prop === 'align-self') { - // align-self flexbox or grid - let display = this.displayType(decl) - if (display !== 'grid' && this.prefixes.options.flexbox !== false) { - prefixer = this.prefixes.add['align-self'] - if (prefixer && prefixer.prefixes) { - prefixer.process(decl) - } - } - if (this.gridStatus(decl, result) !== false) { - prefixer = this.prefixes.add['grid-row-align'] - if (prefixer && prefixer.prefixes) { - return prefixer.process(decl, result) - } - } - } else if (decl.prop === 'justify-self') { - // justify-self flexbox or grid - if (this.gridStatus(decl, result) !== false) { - prefixer = this.prefixes.add['grid-column-align'] - if (prefixer && prefixer.prefixes) { - return prefixer.process(decl, result) - } - } - } else if (decl.prop === 'place-self') { - prefixer = this.prefixes.add['place-self'] - if ( - prefixer && - prefixer.prefixes && - this.gridStatus(decl, result) !== false - ) { - return prefixer.process(decl, result) - } - } else { - // Properties - prefixer = this.prefixes.add[decl.prop] - if (prefixer && prefixer.prefixes) { - return prefixer.process(decl, result) - } - } - - return undefined - }) - - // Insert grid-area prefixes. We need to be able to store the different - // rules as a data and hack API is not enough for this - if (this.gridStatus(css, result)) { - insertAreas(css, this.disabled) - } - - // Values - return css.walkDecls(decl => { - if (this.disabledValue(decl, result)) return - - let unprefixed = this.prefixes.unprefixed(decl.prop) - let list = this.prefixes.values('add', unprefixed) - if (Array.isArray(list)) { - for (let value of list) { - if (value.process) value.process(decl, result) - } - } - Value.save(this.prefixes, decl) - }) - } - - /** - * Check for control comment and global options - */ - disabled(node, result) { - if (!node) return false - - if (node._autoprefixerDisabled !== undefined) { - return node._autoprefixerDisabled - } - - if (node.parent) { - let p = node.prev() - if (p && p.type === 'comment' && IGNORE_NEXT.test(p.text)) { - node._autoprefixerDisabled = true - node._autoprefixerSelfDisabled = true - return true - } - } - - let value = null - if (node.nodes) { - let status - node.each(i => { - if (i.type !== 'comment') return - if (/(!\s*)?autoprefixer:\s*(off|on)/i.test(i.text)) { - if (typeof status !== 'undefined') { - result.warn( - 'Second Autoprefixer control comment ' + - 'was ignored. Autoprefixer applies control ' + - 'comment to whole block, not to next rules.', - { node: i } - ) - } else { - status = /on/i.test(i.text) - } - } - }) - - if (status !== undefined) { - value = !status - } - } - if (!node.nodes || value === null) { - if (node.parent) { - let isParentDisabled = this.disabled(node.parent, result) - if (node.parent._autoprefixerSelfDisabled === true) { - value = false - } else { - value = isParentDisabled - } - } else { - value = false - } - } - node._autoprefixerDisabled = value - return value - } - - /** - * Check for grid/flexbox options. - */ - disabledDecl(node, result) { - if (node.type === 'decl' && this.gridStatus(node, result) === false) { - if (node.prop.includes('grid') || node.prop === 'justify-items') { - return true - } - } - if (node.type === 'decl' && this.prefixes.options.flexbox === false) { - let other = ['order', 'justify-content', 'align-items', 'align-content'] - if (node.prop.includes('flex') || other.includes(node.prop)) { - return true - } - } - - return this.disabled(node, result) - } - - /** - * Check for grid/flexbox options. - */ - disabledValue(node, result) { - if (this.gridStatus(node, result) === false && node.type === 'decl') { - if (node.prop === 'display' && node.value.includes('grid')) { - return true - } - } - if (this.prefixes.options.flexbox === false && node.type === 'decl') { - if (node.prop === 'display' && node.value.includes('flex')) { - return true - } - } - if (node.type === 'decl' && node.prop === 'content') { - return true - } - - return this.disabled(node, result) - } - - /** - * Is it flebox or grid rule - */ - displayType(decl) { - for (let i of decl.parent.nodes) { - if (i.prop !== 'display') { - continue - } - - if (i.value.includes('flex')) { - return 'flex' - } - - if (i.value.includes('grid')) { - return 'grid' - } - } - - return false - } - - /** - * Set grid option via control comment - */ - gridStatus(node, result) { - if (!node) return false - - if (node._autoprefixerGridStatus !== undefined) { - return node._autoprefixerGridStatus - } - - let value = null - if (node.nodes) { - let status - node.each(i => { - if (i.type !== 'comment') return - if (GRID_REGEX.test(i.text)) { - let hasAutoplace = /:\s*autoplace/i.test(i.text) - let noAutoplace = /no-autoplace/i.test(i.text) - if (typeof status !== 'undefined') { - result.warn( - 'Second Autoprefixer grid control comment was ' + - 'ignored. Autoprefixer applies control comments to the whole ' + - 'block, not to the next rules.', - { node: i } - ) - } else if (hasAutoplace) { - status = 'autoplace' - } else if (noAutoplace) { - status = true - } else { - status = /on/i.test(i.text) - } - } - }) - - if (status !== undefined) { - value = status - } - } - - if (node.type === 'atrule' && node.name === 'supports') { - let params = node.params - if (params.includes('grid') && params.includes('auto')) { - value = false - } - } - - if (!node.nodes || value === null) { - if (node.parent) { - let isParentGrid = this.gridStatus(node.parent, result) - if (node.parent._autoprefixerSelfDisabled === true) { - value = false - } else { - value = isParentGrid - } - } else if (typeof this.prefixes.options.grid !== 'undefined') { - value = this.prefixes.options.grid - } else if (typeof process.env.AUTOPREFIXER_GRID !== 'undefined') { - if (process.env.AUTOPREFIXER_GRID === 'autoplace') { - value = 'autoplace' - } else { - value = true - } - } else { - value = false - } - } - - node._autoprefixerGridStatus = value - return value - } - - /** - * Normalize spaces in cascade declaration group - */ - reduceSpaces(decl) { - let stop = false - this.prefixes.group(decl).up(() => { - stop = true - return true - }) - if (stop) { - return - } - - let parts = decl.raw('before').split('\n') - let prevMin = parts[parts.length - 1].length - let diff = false - - this.prefixes.group(decl).down(other => { - parts = other.raw('before').split('\n') - let last = parts.length - 1 - - if (parts[last].length > prevMin) { - if (diff === false) { - diff = parts[last].length - prevMin - } - - parts[last] = parts[last].slice(0, -diff) - other.raws.before = parts.join('\n') - } - }) - } - - /** - * Remove unnecessary pefixes - */ - remove(css, result) { - // At-rules - let resolution = this.prefixes.remove['@resolution'] - - css.walkAtRules((rule, i) => { - if (this.prefixes.remove[`@${rule.name}`]) { - if (!this.disabled(rule, result)) { - rule.parent.removeChild(i) - } - } else if ( - rule.name === 'media' && - rule.params.includes('-resolution') && - resolution - ) { - resolution.clean(rule) - } - }) - - // Selectors - css.walkRules((rule, i) => { - if (this.disabled(rule, result)) return - - for (let checker of this.prefixes.remove.selectors) { - if (checker.check(rule)) { - rule.parent.removeChild(i) - return - } - } - }) - - return css.walkDecls((decl, i) => { - if (this.disabled(decl, result)) return - - let rule = decl.parent - let unprefixed = this.prefixes.unprefixed(decl.prop) - - // Transition - if (decl.prop === 'transition' || decl.prop === 'transition-property') { - this.prefixes.transition.remove(decl) - } - - // Properties - if ( - this.prefixes.remove[decl.prop] && - this.prefixes.remove[decl.prop].remove - ) { - let notHack = this.prefixes.group(decl).down(other => { - return this.prefixes.normalize(other.prop) === unprefixed - }) - - if (unprefixed === 'flex-flow') { - notHack = true - } - - if (decl.prop === '-webkit-box-orient') { - let hacks = { 'flex-direction': true, 'flex-flow': true } - if (!decl.parent.some(j => hacks[j.prop])) return - } - - if (notHack && !this.withHackValue(decl)) { - if (decl.raw('before').includes('\n')) { - this.reduceSpaces(decl) - } - rule.removeChild(i) - return - } - } - - // Values - for (let checker of this.prefixes.values('remove', unprefixed)) { - if (!checker.check) continue - if (!checker.check(decl.value)) continue - - unprefixed = checker.unprefixed - let notHack = this.prefixes.group(decl).down(other => { - return other.value.includes(unprefixed) - }) - - if (notHack) { - rule.removeChild(i) - return - } - } - }) - } - - /** - * Some rare old values, which is not in standard - */ - withHackValue(decl) { - return ( - (decl.prop === '-webkit-background-clip' && decl.value === 'text') || - // Do not remove -webkit-box-orient when -webkit-line-clamp is present. - // https://github.com/postcss/autoprefixer/issues/1510 - (decl.prop === '-webkit-box-orient' && - decl.parent.some(d => d.prop === '-webkit-line-clamp')) - ) - } -} - -module.exports = Processor - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/resolution.js": -/*!*****************************************************!*\ - !*** ./node_modules/autoprefixer/lib/resolution.js ***! - \*****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let FractionJs = __webpack_require__(/*! fraction.js */ "./node_modules/fraction.js/fraction.cjs") - -let Prefixer = __webpack_require__(/*! ./prefixer */ "./node_modules/autoprefixer/lib/prefixer.js") -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") - -const REGEXP = /(min|max)-resolution\s*:\s*\d*\.?\d+(dppx|dpcm|dpi|x)/gi -const SPLIT = /(min|max)-resolution(\s*:\s*)(\d*\.?\d+)(dppx|dpcm|dpi|x)/i - -class Resolution extends Prefixer { - /** - * Remove prefixed queries - */ - clean(rule) { - if (!this.bad) { - this.bad = [] - for (let prefix of this.prefixes) { - this.bad.push(this.prefixName(prefix, 'min')) - this.bad.push(this.prefixName(prefix, 'max')) - } - } - - rule.params = utils.editList(rule.params, queries => { - return queries.filter(query => this.bad.every(i => !query.includes(i))) - }) - } - - /** - * Return prefixed query name - */ - prefixName(prefix, name) { - if (prefix === '-moz-') { - return name + '--moz-device-pixel-ratio' - } else { - return prefix + name + '-device-pixel-ratio' - } - } - - /** - * Return prefixed query - */ - prefixQuery(prefix, name, colon, value, units) { - value = new FractionJs(value) - - // 1dpcm = 2.54dpi - // 1dppx = 96dpi - if (units === 'dpi') { - value = value.div(96) - } else if (units === 'dpcm') { - value = value.mul(2.54).div(96) - } - value = value.simplify() - - if (prefix === '-o-') { - value = value.n + '/' + value.d - } - return this.prefixName(prefix, name) + colon + value - } - - /** - * Add prefixed queries - */ - process(rule) { - let parent = this.parentPrefix(rule) - let prefixes = parent ? [parent] : this.prefixes - - rule.params = utils.editList(rule.params, (origin, prefixed) => { - for (let query of origin) { - if ( - !query.includes('min-resolution') && - !query.includes('max-resolution') - ) { - prefixed.push(query) - continue - } - - for (let prefix of prefixes) { - let processed = query.replace(REGEXP, str => { - let parts = str.match(SPLIT) - return this.prefixQuery( - prefix, - parts[1], - parts[2], - parts[3], - parts[4] - ) - }) - prefixed.push(processed) - } - prefixed.push(query) - } - - return utils.uniq(prefixed) - }) - } -} - -module.exports = Resolution - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/selector.js": -/*!***************************************************!*\ - !*** ./node_modules/autoprefixer/lib/selector.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let { list } = __webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js") - -let Browsers = __webpack_require__(/*! ./browsers */ "./node_modules/autoprefixer/lib/browsers.js") -let OldSelector = __webpack_require__(/*! ./old-selector */ "./node_modules/autoprefixer/lib/old-selector.js") -let Prefixer = __webpack_require__(/*! ./prefixer */ "./node_modules/autoprefixer/lib/prefixer.js") -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") - -class Selector extends Prefixer { - constructor(name, prefixes, all) { - super(name, prefixes, all) - this.regexpCache = new Map() - } - - /** - * Clone and add prefixes for at-rule - */ - add(rule, prefix) { - let prefixeds = this.prefixeds(rule) - - if (this.already(rule, prefixeds, prefix)) { - return - } - - let cloned = this.clone(rule, { selector: prefixeds[this.name][prefix] }) - rule.parent.insertBefore(rule, cloned) - } - - /** - * Is rule already prefixed before - */ - already(rule, prefixeds, prefix) { - let index = rule.parent.index(rule) - 1 - - while (index >= 0) { - let before = rule.parent.nodes[index] - - if (before.type !== 'rule') { - return false - } - - let some = false - for (let key in prefixeds[this.name]) { - let prefixed = prefixeds[this.name][key] - if (before.selector === prefixed) { - if (prefix === key) { - return true - } else { - some = true - break - } - } - } - if (!some) { - return false - } - - index -= 1 - } - - return false - } - - /** - * Is rule selectors need to be prefixed - */ - check(rule) { - if (rule.selector.includes(this.name)) { - return !!rule.selector.match(this.regexp()) - } - - return false - } - - /** - * Return function to fast find prefixed selector - */ - old(prefix) { - return new OldSelector(this, prefix) - } - - /** - * All possible prefixes - */ - possible() { - return Browsers.prefixes() - } - - /** - * Return prefixed version of selector - */ - prefixed(prefix) { - return this.name.replace(/^(\W*)/, `$1${prefix}`) - } - - /** - * Return all possible selector prefixes - */ - prefixeds(rule) { - if (rule._autoprefixerPrefixeds) { - if (rule._autoprefixerPrefixeds[this.name]) { - return rule._autoprefixerPrefixeds - } - } else { - rule._autoprefixerPrefixeds = {} - } - - let prefixeds = {} - if (rule.selector.includes(',')) { - let ruleParts = list.comma(rule.selector) - let toProcess = ruleParts.filter(el => el.includes(this.name)) - - for (let prefix of this.possible()) { - prefixeds[prefix] = toProcess - .map(el => this.replace(el, prefix)) - .join(', ') - } - } else { - for (let prefix of this.possible()) { - prefixeds[prefix] = this.replace(rule.selector, prefix) - } - } - - rule._autoprefixerPrefixeds[this.name] = prefixeds - return rule._autoprefixerPrefixeds - } - - /** - * Lazy loadRegExp for name - */ - regexp(prefix) { - if (!this.regexpCache.has(prefix)) { - let name = prefix ? this.prefixed(prefix) : this.name - this.regexpCache.set( - prefix, - new RegExp(`(^|[^:"'=])${utils.escapeRegexp(name)}`, 'gi') - ) - } - - return this.regexpCache.get(prefix) - } - - /** - * Replace selectors by prefixed one - */ - replace(selector, prefix) { - return selector.replace(this.regexp(), `$1${this.prefixed(prefix)}`) - } -} - -module.exports = Selector - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/supports.js": -/*!***************************************************!*\ - !*** ./node_modules/autoprefixer/lib/supports.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let featureQueries = __webpack_require__(/*! caniuse-lite/data/features/css-featurequeries.js */ "./node_modules/caniuse-lite/data/features/css-featurequeries.js") -let feature = __webpack_require__(/*! caniuse-lite/dist/unpacker/feature */ "./node_modules/caniuse-lite/dist/unpacker/feature.js") -let { parse } = __webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js") - -let brackets = __webpack_require__(/*! ./brackets */ "./node_modules/autoprefixer/lib/brackets.js") -let Browsers = __webpack_require__(/*! ./browsers */ "./node_modules/autoprefixer/lib/browsers.js") -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") -let Value = __webpack_require__(/*! ./value */ "./node_modules/autoprefixer/lib/value.js") - -let data = feature(featureQueries) - -let supported = [] -for (let browser in data.stats) { - let versions = data.stats[browser] - for (let version in versions) { - let support = versions[version] - if (/y/.test(support)) { - supported.push(browser + ' ' + version) - } - } -} - -class Supports { - constructor(Prefixes, all) { - this.Prefixes = Prefixes - this.all = all - } - - /** - * Add prefixes - */ - add(nodes, all) { - return nodes.map(i => { - if (this.isProp(i)) { - let prefixed = this.prefixed(i[0]) - if (prefixed.length > 1) { - return this.convert(prefixed) - } - - return i - } - - if (typeof i === 'object') { - return this.add(i, all) - } - - return i - }) - } - - /** - * Clean brackets with one child - */ - cleanBrackets(nodes) { - return nodes.map(i => { - if (typeof i !== 'object') { - return i - } - - if (i.length === 1 && typeof i[0] === 'object') { - return this.cleanBrackets(i[0]) - } - - return this.cleanBrackets(i) - }) - } - - /** - * Add " or " between properties and convert it to brackets format - */ - convert(progress) { - let result = [''] - for (let i of progress) { - result.push([`${i.prop}: ${i.value}`]) - result.push(' or ') - } - result[result.length - 1] = '' - return result - } - - /** - * Check global options - */ - disabled(node) { - if (!this.all.options.grid) { - if (node.prop === 'display' && node.value.includes('grid')) { - return true - } - if (node.prop.includes('grid') || node.prop === 'justify-items') { - return true - } - } - - if (this.all.options.flexbox === false) { - if (node.prop === 'display' && node.value.includes('flex')) { - return true - } - let other = ['order', 'justify-content', 'align-items', 'align-content'] - if (node.prop.includes('flex') || other.includes(node.prop)) { - return true - } - } - - return false - } - - /** - * Return true if prefixed property has no unprefixed - */ - isHack(all, unprefixed) { - let check = new RegExp(`(\\(|\\s)${utils.escapeRegexp(unprefixed)}:`) - return !check.test(all) - } - - /** - * Return true if brackets node is "not" word - */ - isNot(node) { - return typeof node === 'string' && /not\s*/i.test(node) - } - - /** - * Return true if brackets node is "or" word - */ - isOr(node) { - return typeof node === 'string' && /\s*or\s*/i.test(node) - } - - /** - * Return true if brackets node is (prop: value) - */ - isProp(node) { - return ( - typeof node === 'object' && - node.length === 1 && - typeof node[0] === 'string' - ) - } - - /** - * Compress value functions into a string nodes - */ - normalize(nodes) { - if (typeof nodes !== 'object') { - return nodes - } - - nodes = nodes.filter(i => i !== '') - - if (typeof nodes[0] === 'string') { - let firstNode = nodes[0].trim() - - if ( - firstNode.includes(':') || - firstNode === 'selector' || - firstNode === 'not selector' - ) { - return [brackets.stringify(nodes)] - } - } - return nodes.map(i => this.normalize(i)) - } - - /** - * Parse string into declaration property and value - */ - parse(str) { - let parts = str.split(':') - let prop = parts[0] - let value = parts[1] - if (!value) value = '' - return [prop.trim(), value.trim()] - } - - /** - * Return array of Declaration with all necessary prefixes - */ - prefixed(str) { - let rule = this.virtual(str) - if (this.disabled(rule.first)) { - return rule.nodes - } - - let result = { warn: () => null } - - let prefixer = this.prefixer().add[rule.first.prop] - prefixer && prefixer.process && prefixer.process(rule.first, result) - - for (let decl of rule.nodes) { - for (let value of this.prefixer().values('add', rule.first.prop)) { - value.process(decl) - } - Value.save(this.all, decl) - } - - return rule.nodes - } - - /** - * Return prefixer only with @supports supported browsers - */ - prefixer() { - if (this.prefixerCache) { - return this.prefixerCache - } - - let filtered = this.all.browsers.selected.filter(i => { - return supported.includes(i) - }) - - let browsers = new Browsers( - this.all.browsers.data, - filtered, - this.all.options - ) - this.prefixerCache = new this.Prefixes( - this.all.data, - browsers, - this.all.options - ) - return this.prefixerCache - } - - /** - * Add prefixed declaration - */ - process(rule) { - let ast = brackets.parse(rule.params) - ast = this.normalize(ast) - ast = this.remove(ast, rule.params) - ast = this.add(ast, rule.params) - ast = this.cleanBrackets(ast) - rule.params = brackets.stringify(ast) - } - - /** - * Remove all unnecessary prefixes - */ - remove(nodes, all) { - let i = 0 - while (i < nodes.length) { - if ( - !this.isNot(nodes[i - 1]) && - this.isProp(nodes[i]) && - this.isOr(nodes[i + 1]) - ) { - if (this.toRemove(nodes[i][0], all)) { - nodes.splice(i, 2) - continue - } - - i += 2 - continue - } - - if (typeof nodes[i] === 'object') { - nodes[i] = this.remove(nodes[i], all) - } - - i += 1 - } - return nodes - } - - /** - * Return true if we need to remove node - */ - toRemove(str, all) { - let [prop, value] = this.parse(str) - let unprefixed = this.all.unprefixed(prop) - - let cleaner = this.all.cleaner() - - if ( - cleaner.remove[prop] && - cleaner.remove[prop].remove && - !this.isHack(all, unprefixed) - ) { - return true - } - - for (let checker of cleaner.values('remove', unprefixed)) { - if (checker.check(value)) { - return true - } - } - - return false - } - - /** - * Create virtual rule to process it by prefixer - */ - virtual(str) { - let [prop, value] = this.parse(str) - let rule = parse('a{}').first - rule.append({ prop, raws: { before: '' }, value }) - return rule - } -} - -module.exports = Supports - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/transition.js": -/*!*****************************************************!*\ - !*** ./node_modules/autoprefixer/lib/transition.js ***! - \*****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let { list } = __webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js") -let parser = __webpack_require__(/*! postcss-value-parser */ "./node_modules/postcss-value-parser/lib/index.js") - -let Browsers = __webpack_require__(/*! ./browsers */ "./node_modules/autoprefixer/lib/browsers.js") -let vendor = __webpack_require__(/*! ./vendor */ "./node_modules/autoprefixer/lib/vendor.js") - -class Transition { - constructor(prefixes) { - this.props = ['transition', 'transition-property'] - this.prefixes = prefixes - } - - /** - * Process transition and add prefixes for all necessary properties - */ - add(decl, result) { - let prefix, prop - let add = this.prefixes.add[decl.prop] - let vendorPrefixes = this.ruleVendorPrefixes(decl) - let declPrefixes = vendorPrefixes || (add && add.prefixes) || [] - - let params = this.parse(decl.value) - let names = params.map(i => this.findProp(i)) - let added = [] - - if (names.some(i => i[0] === '-')) { - return - } - - for (let param of params) { - prop = this.findProp(param) - if (prop[0] === '-') continue - - let prefixer = this.prefixes.add[prop] - if (!prefixer || !prefixer.prefixes) continue - - for (prefix of prefixer.prefixes) { - if (vendorPrefixes && !vendorPrefixes.some(p => prefix.includes(p))) { - continue - } - - let prefixed = this.prefixes.prefixed(prop, prefix) - if (prefixed !== '-ms-transform' && !names.includes(prefixed)) { - if (!this.disabled(prop, prefix)) { - added.push(this.clone(prop, prefixed, param)) - } - } - } - } - - params = params.concat(added) - let value = this.stringify(params) - - let webkitClean = this.stringify( - this.cleanFromUnprefixed(params, '-webkit-') - ) - if (declPrefixes.includes('-webkit-')) { - this.cloneBefore(decl, `-webkit-${decl.prop}`, webkitClean) - } - this.cloneBefore(decl, decl.prop, webkitClean) - if (declPrefixes.includes('-o-')) { - let operaClean = this.stringify(this.cleanFromUnprefixed(params, '-o-')) - this.cloneBefore(decl, `-o-${decl.prop}`, operaClean) - } - - for (prefix of declPrefixes) { - if (prefix !== '-webkit-' && prefix !== '-o-') { - let prefixValue = this.stringify( - this.cleanOtherPrefixes(params, prefix) - ) - this.cloneBefore(decl, prefix + decl.prop, prefixValue) - } - } - - if (value !== decl.value && !this.already(decl, decl.prop, value)) { - this.checkForWarning(result, decl) - decl.cloneBefore() - decl.value = value - } - } - - /** - * Does we already have this declaration - */ - already(decl, prop, value) { - return decl.parent.some(i => i.prop === prop && i.value === value) - } - - /** - * Show transition-property warning - */ - checkForWarning(result, decl) { - if (decl.prop !== 'transition-property') { - return - } - - let isPrefixed = false - let hasAssociatedProp = false - - decl.parent.each(i => { - if (i.type !== 'decl') { - return undefined - } - if (i.prop.indexOf('transition-') !== 0) { - return undefined - } - let values = list.comma(i.value) - // check if current Rule's transition-property comma separated value list needs prefixes - if (i.prop === 'transition-property') { - values.forEach(value => { - let lookup = this.prefixes.add[value] - if (lookup && lookup.prefixes && lookup.prefixes.length > 0) { - isPrefixed = true - } - }) - return undefined - } - // check if another transition-* prop in current Rule has comma separated value list - hasAssociatedProp = hasAssociatedProp || values.length > 1 - return false - }) - - if (isPrefixed && hasAssociatedProp) { - decl.warn( - result, - 'Replace transition-property to transition, ' + - 'because Autoprefixer could not support ' + - 'any cases of transition-property ' + - 'and other transition-*' - ) - } - } - - /** - * Remove all non-webkit prefixes and unprefixed params if we have prefixed - */ - cleanFromUnprefixed(params, prefix) { - let remove = params - .map(i => this.findProp(i)) - .filter(i => i.slice(0, prefix.length) === prefix) - .map(i => this.prefixes.unprefixed(i)) - - let result = [] - for (let param of params) { - let prop = this.findProp(param) - let p = vendor.prefix(prop) - if (!remove.includes(prop) && (p === prefix || p === '')) { - result.push(param) - } - } - return result - } - - cleanOtherPrefixes(params, prefix) { - return params.filter(param => { - let current = vendor.prefix(this.findProp(param)) - return current === '' || current === prefix - }) - } - - /** - * Return new param array with different name - */ - clone(origin, name, param) { - let result = [] - let changed = false - for (let i of param) { - if (!changed && i.type === 'word' && i.value === origin) { - result.push({ type: 'word', value: name }) - changed = true - } else { - result.push(i) - } - } - return result - } - - /** - * Add declaration if it is not exist - */ - cloneBefore(decl, prop, value) { - if (!this.already(decl, prop, value)) { - decl.cloneBefore({ prop, value }) - } - } - - /** - * Check property for disabled by option - */ - disabled(prop, prefix) { - let other = ['order', 'justify-content', 'align-self', 'align-content'] - if (prop.includes('flex') || other.includes(prop)) { - if (this.prefixes.options.flexbox === false) { - return true - } - - if (this.prefixes.options.flexbox === 'no-2009') { - return prefix.includes('2009') - } - } - return undefined - } - - /** - * Find or create separator - */ - div(params) { - for (let param of params) { - for (let node of param) { - if (node.type === 'div' && node.value === ',') { - return node - } - } - } - return { after: ' ', type: 'div', value: ',' } - } - - /** - * Find property name - */ - findProp(param) { - let prop = param[0].value - if (/^\d/.test(prop)) { - for (let [i, token] of param.entries()) { - if (i !== 0 && token.type === 'word') { - return token.value - } - } - } - return prop - } - - /** - * Parse properties list to array - */ - parse(value) { - let ast = parser(value) - let result = [] - let param = [] - for (let node of ast.nodes) { - param.push(node) - if (node.type === 'div' && node.value === ',') { - result.push(param) - param = [] - } - } - result.push(param) - return result.filter(i => i.length > 0) - } - - /** - * Process transition and remove all unnecessary properties - */ - remove(decl) { - let params = this.parse(decl.value) - params = params.filter(i => { - let prop = this.prefixes.remove[this.findProp(i)] - return !prop || !prop.remove - }) - let value = this.stringify(params) - - if (decl.value === value) { - return - } - - if (params.length === 0) { - decl.remove() - return - } - - let double = decl.parent.some(i => { - return i.prop === decl.prop && i.value === value - }) - let smaller = decl.parent.some(i => { - return i !== decl && i.prop === decl.prop && i.value.length > value.length - }) - - if (double || smaller) { - decl.remove() - return - } - - decl.value = value - } - - /** - * Check if transition prop is inside vendor specific rule - */ - ruleVendorPrefixes(decl) { - let { parent } = decl - - if (parent.type !== 'rule') { - return false - } else if (!parent.selector.includes(':-')) { - return false - } - - let selectors = Browsers.prefixes().filter(s => - parent.selector.includes(':' + s) - ) - - return selectors.length > 0 ? selectors : false - } - - /** - * Return properties string from array - */ - stringify(params) { - if (params.length === 0) { - return '' - } - let nodes = [] - for (let param of params) { - if (param[param.length - 1].type !== 'div') { - param.push(this.div(params)) - } - nodes = nodes.concat(param) - } - if (nodes[0].type === 'div') { - nodes = nodes.slice(1) - } - if (nodes[nodes.length - 1].type === 'div') { - nodes = nodes.slice(0, +-2 + 1 || 0) - } - return parser.stringify({ nodes }) - } -} - -module.exports = Transition - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/utils.js": -/*!************************************************!*\ - !*** ./node_modules/autoprefixer/lib/utils.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let { list } = __webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js") - -/** - * Throw special error, to tell beniary, - * that this error is from Autoprefixer. - */ -module.exports.error = function (text) { - let err = new Error(text) - err.autoprefixer = true - throw err -} - -/** - * Return array, that doesn’t contain duplicates. - */ -module.exports.uniq = function (array) { - return [...new Set(array)] -} - -/** - * Return "-webkit-" on "-webkit- old" - */ -module.exports.removeNote = function (string) { - if (!string.includes(' ')) { - return string - } - - return string.split(' ')[0] -} - -/** - * Escape RegExp symbols - */ -module.exports.escapeRegexp = function (string) { - return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&') -} - -/** - * Return regexp to check, that CSS string contain word - */ -module.exports.regexp = function (word, escape = true) { - if (escape) { - word = this.escapeRegexp(word) - } - return new RegExp(`(^|[\\s,(])(${word}($|[\\s(,]))`, 'gi') -} - -/** - * Change comma list - */ -module.exports.editList = function (value, callback) { - let origin = list.comma(value) - let changed = callback(origin, []) - - if (origin === changed) { - return value - } - - let join = value.match(/,\s*/) - join = join ? join[0] : ', ' - return changed.join(join) -} - -/** - * Split the selector into parts. - * It returns 3 level deep array because selectors can be comma - * separated (1), space separated (2), and combined (3) - * @param {String} selector selector string - * @return {Array>} 3 level deep array of split selector - * @see utils.test.js for examples - */ -module.exports.splitSelector = function (selector) { - return list.comma(selector).map(i => { - return list.space(i).map(k => { - return k.split(/(?=\.|#)/g) - }) - }) -} - -/** - * Return true if a given value only contains numbers. - * @param {*} value - * @returns {boolean} - */ -module.exports.isPureNumber = function (value) { - if (typeof value === 'number') { - return true - } - if (typeof value === 'string') { - return /^[0-9]+$/.test(value) - } - return false -} - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/value.js": -/*!************************************************!*\ - !*** ./node_modules/autoprefixer/lib/value.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let OldValue = __webpack_require__(/*! ./old-value */ "./node_modules/autoprefixer/lib/old-value.js") -let Prefixer = __webpack_require__(/*! ./prefixer */ "./node_modules/autoprefixer/lib/prefixer.js") -let utils = __webpack_require__(/*! ./utils */ "./node_modules/autoprefixer/lib/utils.js") -let vendor = __webpack_require__(/*! ./vendor */ "./node_modules/autoprefixer/lib/vendor.js") - -class Value extends Prefixer { - /** - * Clone decl for each prefixed values - */ - static save(prefixes, decl) { - let prop = decl.prop - let result = [] - - for (let prefix in decl._autoprefixerValues) { - let value = decl._autoprefixerValues[prefix] - - if (value === decl.value) { - continue - } - - let item - let propPrefix = vendor.prefix(prop) - - if (propPrefix === '-pie-') { - continue - } - - if (propPrefix === prefix) { - item = decl.value = value - result.push(item) - continue - } - - let prefixed = prefixes.prefixed(prop, prefix) - let rule = decl.parent - - if (!rule.every(i => i.prop !== prefixed)) { - result.push(item) - continue - } - - let trimmed = value.replace(/\s+/, ' ') - let already = rule.some( - i => i.prop === decl.prop && i.value.replace(/\s+/, ' ') === trimmed - ) - - if (already) { - result.push(item) - continue - } - - let cloned = this.clone(decl, { value }) - item = decl.parent.insertBefore(decl, cloned) - - result.push(item) - } - - return result - } - - /** - * Save values with next prefixed token - */ - add(decl, prefix) { - if (!decl._autoprefixerValues) { - decl._autoprefixerValues = {} - } - let value = decl._autoprefixerValues[prefix] || this.value(decl) - - let before - do { - before = value - value = this.replace(value, prefix) - if (value === false) return - } while (value !== before) - - decl._autoprefixerValues[prefix] = value - } - - /** - * Is declaration need to be prefixed - */ - check(decl) { - let value = decl.value - if (!value.includes(this.name)) { - return false - } - - return !!value.match(this.regexp()) - } - - /** - * Return function to fast find prefixed value - */ - old(prefix) { - return new OldValue(this.name, prefix + this.name) - } - - /** - * Lazy regexp loading - */ - regexp() { - return this.regexpCache || (this.regexpCache = utils.regexp(this.name)) - } - - /** - * Add prefix to values in string - */ - replace(string, prefix) { - return string.replace(this.regexp(), `$1${prefix}$2`) - } - - /** - * Get value with comments if it was not changed - */ - value(decl) { - if (decl.raws.value && decl.raws.value.value === decl.value) { - return decl.raws.value.raw - } else { - return decl.value - } - } -} - -module.exports = Value - - -/***/ }), - -/***/ "./node_modules/autoprefixer/lib/vendor.js": -/*!*************************************************!*\ - !*** ./node_modules/autoprefixer/lib/vendor.js ***! - \*************************************************/ -/***/ ((module) => { - -module.exports = { - prefix(prop) { - let match = prop.match(/^(-\w+-)/) - if (match) { - return match[0] - } - - return '' - }, - - unprefixed(prop) { - return prop.replace(/^-\w+-/, '') - } -} - - -/***/ }), - -/***/ "./node_modules/browserslist/browser.js": -/*!**********************************************!*\ - !*** ./node_modules/browserslist/browser.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var BrowserslistError = __webpack_require__(/*! ./error */ "./node_modules/browserslist/error.js") - -function noop() {} - -module.exports = { - loadQueries: function loadQueries() { - throw new BrowserslistError( - 'Sharable configs are not supported in client-side build of Browserslist' - ) - }, - - getStat: function getStat(opts) { - return opts.stats - }, - - loadConfig: function loadConfig(opts) { - if (opts.config) { - throw new BrowserslistError( - 'Browserslist config are not supported in client-side build' - ) - } - }, - - loadCountry: function loadCountry() { - throw new BrowserslistError( - 'Country statistics are not supported ' + - 'in client-side build of Browserslist' - ) - }, - - loadFeature: function loadFeature() { - throw new BrowserslistError( - 'Supports queries are not available in client-side build of Browserslist' - ) - }, - - currentNode: function currentNode(resolve, context) { - return resolve(['maintained node versions'], context)[0] - }, - - parseConfig: noop, - - readConfig: noop, - - findConfig: noop, - - findConfigFile: noop, - - clearCaches: noop, - - oldDataWarning: noop, - - env: {} -} - - -/***/ }), - -/***/ "./node_modules/browserslist/error.js": -/*!********************************************!*\ - !*** ./node_modules/browserslist/error.js ***! - \********************************************/ -/***/ ((module) => { - -function BrowserslistError(message) { - this.name = 'BrowserslistError' - this.message = message - this.browserslist = true - if (Error.captureStackTrace) { - Error.captureStackTrace(this, BrowserslistError) - } -} - -BrowserslistError.prototype = Error.prototype - -module.exports = BrowserslistError - - -/***/ }), - -/***/ "./node_modules/browserslist/index.js": -/*!********************************************!*\ - !*** ./node_modules/browserslist/index.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var jsReleases = __webpack_require__(/*! node-releases/data/processed/envs.json */ "./node_modules/node-releases/data/processed/envs.json") -var agents = (__webpack_require__(/*! caniuse-lite/dist/unpacker/agents */ "./node_modules/caniuse-lite/dist/unpacker/agents.js").agents) -var e2c = __webpack_require__(/*! electron-to-chromium/versions */ "./node_modules/electron-to-chromium/versions.js") -var jsEOL = __webpack_require__(/*! node-releases/data/release-schedule/release-schedule.json */ "./node_modules/node-releases/data/release-schedule/release-schedule.json") -var path = __webpack_require__(/*! path */ "?3465") - -var BrowserslistError = __webpack_require__(/*! ./error */ "./node_modules/browserslist/error.js") -var env = __webpack_require__(/*! ./node */ "./node_modules/browserslist/browser.js") -var parseWithoutCache = __webpack_require__(/*! ./parse */ "./node_modules/browserslist/parse.js") // Will load browser.js in webpack - -var YEAR = 365.259641 * 24 * 60 * 60 * 1000 -var ANDROID_EVERGREEN_FIRST = '37' -var OP_MOB_BLINK_FIRST = 14 - -// Helpers - -function isVersionsMatch(versionA, versionB) { - return (versionA + '.').indexOf(versionB + '.') === 0 -} - -function isEolReleased(name) { - var version = name.slice(1) - return browserslist.nodeVersions.some(function (i) { - return isVersionsMatch(i, version) - }) -} - -function normalize(versions) { - return versions.filter(function (version) { - return typeof version === 'string' - }) -} - -function normalizeElectron(version) { - var versionToUse = version - if (version.split('.').length === 3) { - versionToUse = version.split('.').slice(0, -1).join('.') - } - return versionToUse -} - -function nameMapper(name) { - return function mapName(version) { - return name + ' ' + version - } -} - -function getMajor(version) { - return parseInt(version.split('.')[0]) -} - -function getMajorVersions(released, number) { - if (released.length === 0) return [] - var majorVersions = uniq(released.map(getMajor)) - var minimum = majorVersions[majorVersions.length - number] - if (!minimum) { - return released - } - var selected = [] - for (var i = released.length - 1; i >= 0; i--) { - if (minimum > getMajor(released[i])) break - selected.unshift(released[i]) - } - return selected -} - -function uniq(array) { - var filtered = [] - for (var i = 0; i < array.length; i++) { - if (filtered.indexOf(array[i]) === -1) filtered.push(array[i]) - } - return filtered -} - -function fillUsage(result, name, data) { - for (var i in data) { - result[name + ' ' + i] = data[i] - } -} - -function generateFilter(sign, version) { - version = parseFloat(version) - if (sign === '>') { - return function (v) { - return parseLatestFloat(v) > version - } - } else if (sign === '>=') { - return function (v) { - return parseLatestFloat(v) >= version - } - } else if (sign === '<') { - return function (v) { - return parseFloat(v) < version - } - } else { - return function (v) { - return parseFloat(v) <= version - } - } - - function parseLatestFloat(v) { - return parseFloat(v.split('-')[1] || v) - } -} - -function generateSemverFilter(sign, version) { - version = version.split('.').map(parseSimpleInt) - version[1] = version[1] || 0 - version[2] = version[2] || 0 - if (sign === '>') { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(v, version) > 0 - } - } else if (sign === '>=') { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(v, version) >= 0 - } - } else if (sign === '<') { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(version, v) > 0 - } - } else { - return function (v) { - v = v.split('.').map(parseSimpleInt) - return compareSemver(version, v) >= 0 - } - } -} - -function parseSimpleInt(x) { - return parseInt(x) -} - -function compare(a, b) { - if (a < b) return -1 - if (a > b) return +1 - return 0 -} - -function compareSemver(a, b) { - return ( - compare(parseInt(a[0]), parseInt(b[0])) || - compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) || - compare(parseInt(a[2] || '0'), parseInt(b[2] || '0')) - ) -} - -// this follows the npm-like semver behavior -function semverFilterLoose(operator, range) { - range = range.split('.').map(parseSimpleInt) - if (typeof range[1] === 'undefined') { - range[1] = 'x' - } - // ignore any patch version because we only return minor versions - // range[2] = 'x' - switch (operator) { - case '<=': - return function (version) { - version = version.split('.').map(parseSimpleInt) - return compareSemverLoose(version, range) <= 0 - } - case '>=': - default: - return function (version) { - version = version.split('.').map(parseSimpleInt) - return compareSemverLoose(version, range) >= 0 - } - } -} - -// this follows the npm-like semver behavior -function compareSemverLoose(version, range) { - if (version[0] !== range[0]) { - return version[0] < range[0] ? -1 : +1 - } - if (range[1] === 'x') { - return 0 - } - if (version[1] !== range[1]) { - return version[1] < range[1] ? -1 : +1 - } - return 0 -} - -function resolveVersion(data, version) { - if (data.versions.indexOf(version) !== -1) { - return version - } else if (browserslist.versionAliases[data.name][version]) { - return browserslist.versionAliases[data.name][version] - } else { - return false - } -} - -function normalizeVersion(data, version) { - var resolved = resolveVersion(data, version) - if (resolved) { - return resolved - } else if (data.versions.length === 1) { - return data.versions[0] - } else { - return false - } -} - -function filterByYear(since, context) { - since = since / 1000 - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var versions = Object.keys(data.releaseDate).filter(function (v) { - var date = data.releaseDate[v] - return date !== null && date >= since - }) - return selected.concat(versions.map(nameMapper(data.name))) - }, []) -} - -function cloneData(data) { - return { - name: data.name, - versions: data.versions, - released: data.released, - releaseDate: data.releaseDate - } -} - -function byName(name, context) { - name = name.toLowerCase() - name = browserslist.aliases[name] || name - if (context.mobileToDesktop && browserslist.desktopNames[name]) { - var desktop = browserslist.data[browserslist.desktopNames[name]] - if (name === 'android') { - return normalizeAndroidData(cloneData(browserslist.data[name]), desktop) - } else { - var cloned = cloneData(desktop) - cloned.name = name - return cloned - } - } - return browserslist.data[name] -} - -function normalizeAndroidVersions(androidVersions, chromeVersions) { - var iFirstEvergreen = chromeVersions.indexOf(ANDROID_EVERGREEN_FIRST) - return androidVersions - .filter(function (version) { - return /^(?:[2-4]\.|[34]$)/.test(version) - }) - .concat(chromeVersions.slice(iFirstEvergreen)) -} - -function copyObject(obj) { - var copy = {} - for (var key in obj) { - copy[key] = obj[key] - } - return copy -} - -function normalizeAndroidData(android, chrome) { - android.released = normalizeAndroidVersions(android.released, chrome.released) - android.versions = normalizeAndroidVersions(android.versions, chrome.versions) - android.releaseDate = copyObject(android.releaseDate) - android.released.forEach(function (v) { - if (android.releaseDate[v] === undefined) { - android.releaseDate[v] = chrome.releaseDate[v] - } - }) - return android -} - -function checkName(name, context) { - var data = byName(name, context) - if (!data) throw new BrowserslistError('Unknown browser ' + name) - return data -} - -function unknownQuery(query) { - return new BrowserslistError( - 'Unknown browser query `' + - query + - '`. ' + - 'Maybe you are using old Browserslist or made typo in query.' - ) -} - -// Adjusts last X versions queries for some mobile browsers, -// where caniuse data jumps from a legacy version to the latest -function filterJumps(list, name, nVersions, context) { - var jump = 1 - switch (name) { - case 'android': - if (context.mobileToDesktop) return list - var released = browserslist.data.chrome.released - jump = released.length - released.indexOf(ANDROID_EVERGREEN_FIRST) - break - case 'op_mob': - var latest = browserslist.data.op_mob.released.slice(-1)[0] - jump = getMajor(latest) - OP_MOB_BLINK_FIRST + 1 - break - default: - return list - } - if (nVersions <= jump) { - return list.slice(-1) - } - return list.slice(jump - 1 - nVersions) -} - -function isSupported(flags, withPartial) { - return ( - typeof flags === 'string' && - (flags.indexOf('y') >= 0 || (withPartial && flags.indexOf('a') >= 0)) - ) -} - -function resolve(queries, context) { - return parseQueries(queries).reduce(function (result, node, index) { - if (node.not && index === 0) { - throw new BrowserslistError( - 'Write any browsers query (for instance, `defaults`) ' + - 'before `' + - node.query + - '`' - ) - } - var type = QUERIES[node.type] - var array = type.select.call(browserslist, context, node).map(function (j) { - var parts = j.split(' ') - if (parts[1] === '0') { - return parts[0] + ' ' + byName(parts[0], context).versions[0] - } else { - return j - } - }) - - if (node.compose === 'and') { - if (node.not) { - return result.filter(function (j) { - return array.indexOf(j) === -1 - }) - } else { - return result.filter(function (j) { - return array.indexOf(j) !== -1 - }) - } - } else { - if (node.not) { - var filter = {} - array.forEach(function (j) { - filter[j] = true - }) - return result.filter(function (j) { - return !filter[j] - }) - } - return result.concat(array) - } - }, []) -} - -function prepareOpts(opts) { - if (typeof opts === 'undefined') opts = {} - - if (typeof opts.path === 'undefined') { - opts.path = path.resolve ? path.resolve('.') : '.' - } - - return opts -} - -function prepareQueries(queries, opts) { - if (typeof queries === 'undefined' || queries === null) { - var config = browserslist.loadConfig(opts) - if (config) { - queries = config - } else { - queries = browserslist.defaults - } - } - - return queries -} - -function checkQueries(queries) { - if (!(typeof queries === 'string' || Array.isArray(queries))) { - throw new BrowserslistError( - 'Browser queries must be an array or string. Got ' + typeof queries + '.' - ) - } -} - -var cache = {} -var parseCache = {} - -function browserslist(queries, opts) { - opts = prepareOpts(opts) - queries = prepareQueries(queries, opts) - checkQueries(queries) - - var needsPath = parseQueries(queries).some(function (node) { - return QUERIES[node.type].needsPath - }) - var context = { - ignoreUnknownVersions: opts.ignoreUnknownVersions, - dangerousExtend: opts.dangerousExtend, - mobileToDesktop: opts.mobileToDesktop, - env: opts.env - } - // Removing to avoid using context.path without marking query as needsPath - if (needsPath) { - context.path = opts.path - } - - env.oldDataWarning(browserslist.data) - var stats = env.getStat(opts, browserslist.data) - if (stats) { - context.customUsage = {} - for (var browser in stats) { - fillUsage(context.customUsage, browser, stats[browser]) - } - } - - var cacheKey = JSON.stringify([queries, context]) - if (cache[cacheKey]) return cache[cacheKey] - - var result = uniq(resolve(queries, context)).sort(function (name1, name2) { - name1 = name1.split(' ') - name2 = name2.split(' ') - if (name1[0] === name2[0]) { - // assumptions on caniuse data - // 1) version ranges never overlaps - // 2) if version is not a range, it never contains `-` - var version1 = name1[1].split('-')[0] - var version2 = name2[1].split('-')[0] - return compareSemver(version2.split('.'), version1.split('.')) - } else { - return compare(name1[0], name2[0]) - } - }) - if (!env.env.BROWSERSLIST_DISABLE_CACHE) { - cache[cacheKey] = result - } - return result -} - -function parseQueries(queries) { - var cacheKey = JSON.stringify(queries) - if (cacheKey in parseCache) return parseCache[cacheKey] - var result = parseWithoutCache(QUERIES, queries) - if (!env.env.BROWSERSLIST_DISABLE_CACHE) { - parseCache[cacheKey] = result - } - return result -} - -function loadCustomUsage(context, config) { - var stats = env.loadStat(context, config, browserslist.data) - if (stats) { - context.customUsage = {} - for (var browser in stats) { - fillUsage(context.customUsage, browser, stats[browser]) - } - } - if (!context.customUsage) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - return context.customUsage -} - -browserslist.parse = function (queries, opts) { - opts = prepareOpts(opts) - queries = prepareQueries(queries, opts) - checkQueries(queries) - return parseQueries(queries) -} - -// Will be filled by Can I Use data below -browserslist.cache = {} -browserslist.data = {} -browserslist.usage = { - global: {}, - custom: null -} - -// Default browsers query -browserslist.defaults = ['> 0.5%', 'last 2 versions', 'Firefox ESR', 'not dead'] - -// Browser names aliases -browserslist.aliases = { - fx: 'firefox', - ff: 'firefox', - ios: 'ios_saf', - explorer: 'ie', - blackberry: 'bb', - explorermobile: 'ie_mob', - operamini: 'op_mini', - operamobile: 'op_mob', - chromeandroid: 'and_chr', - firefoxandroid: 'and_ff', - ucandroid: 'and_uc', - qqandroid: 'and_qq' -} - -// Can I Use only provides a few versions for some browsers (e.g. and_chr). -// Fallback to a similar browser for unknown versions -// Note op_mob is not included as its chromium versions are not in sync with Opera desktop -browserslist.desktopNames = { - and_chr: 'chrome', - and_ff: 'firefox', - ie_mob: 'ie', - android: 'chrome' // has extra processing logic -} - -// Aliases to work with joined versions like `ios_saf 7.0-7.1` -browserslist.versionAliases = {} - -browserslist.clearCaches = env.clearCaches -browserslist.parseConfig = env.parseConfig -browserslist.readConfig = env.readConfig -browserslist.findConfigFile = env.findConfigFile -browserslist.findConfig = env.findConfig -browserslist.loadConfig = env.loadConfig - -browserslist.coverage = function (browsers, stats) { - var data - if (typeof stats === 'undefined') { - data = browserslist.usage.global - } else if (stats === 'my stats') { - var opts = {} - opts.path = path.resolve ? path.resolve('.') : '.' - var customStats = env.getStat(opts) - if (!customStats) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - data = {} - for (var browser in customStats) { - fillUsage(data, browser, customStats[browser]) - } - } else if (typeof stats === 'string') { - if (stats.length > 2) { - stats = stats.toLowerCase() - } else { - stats = stats.toUpperCase() - } - env.loadCountry(browserslist.usage, stats, browserslist.data) - data = browserslist.usage[stats] - } else { - if ('dataByBrowser' in stats) { - stats = stats.dataByBrowser - } - data = {} - for (var name in stats) { - for (var version in stats[name]) { - data[name + ' ' + version] = stats[name][version] - } - } - } - - return browsers.reduce(function (all, i) { - var usage = data[i] - if (usage === undefined) { - usage = data[i.replace(/ \S+$/, ' 0')] - } - return all + (usage || 0) - }, 0) -} - -function nodeQuery(context, node) { - var matched = browserslist.nodeVersions.filter(function (i) { - return isVersionsMatch(i, node.version) - }) - if (matched.length === 0) { - if (context.ignoreUnknownVersions) { - return [] - } else { - throw new BrowserslistError( - 'Unknown version ' + node.version + ' of Node.js' - ) - } - } - return ['node ' + matched[matched.length - 1]] -} - -function sinceQuery(context, node) { - var year = parseInt(node.year) - var month = parseInt(node.month || '01') - 1 - var day = parseInt(node.day || '01') - return filterByYear(Date.UTC(year, month, day, 0, 0, 0), context) -} - -function coverQuery(context, node) { - var coverage = parseFloat(node.coverage) - var usage = browserslist.usage.global - if (node.place) { - if (node.place.match(/^my\s+stats$/i)) { - if (!context.customUsage) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - usage = context.customUsage - } else { - var place - if (node.place.length === 2) { - place = node.place.toUpperCase() - } else { - place = node.place.toLowerCase() - } - env.loadCountry(browserslist.usage, place, browserslist.data) - usage = browserslist.usage[place] - } - } else if (node.config) { - usage = loadCustomUsage(context, node.config) - } - var versions = Object.keys(usage).sort(function (a, b) { - return usage[b] - usage[a] - }) - var covered = 0 - var result = [] - var version - for (var i = 0; i < versions.length; i++) { - version = versions[i] - if (usage[version] === 0) break - covered += usage[version] - result.push(version) - if (covered >= coverage) break - } - return result -} - -var QUERIES = { - last_major_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+major\s+versions?$/i, - select: function (context, node) { - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var list = getMajorVersions(data.released, node.versions) - list = list.map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return selected.concat(list) - }, []) - } - }, - last_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+versions?$/i, - select: function (context, node) { - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var list = data.released.slice(-node.versions) - list = list.map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return selected.concat(list) - }, []) - } - }, - last_electron_major_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+electron\s+major\s+versions?$/i, - select: function (context, node) { - var validVersions = getMajorVersions(Object.keys(e2c), node.versions) - return validVersions.map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - last_node_major_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+node\s+major\s+versions?$/i, - select: function (context, node) { - return getMajorVersions(browserslist.nodeVersions, node.versions).map( - function (version) { - return 'node ' + version - } - ) - } - }, - last_browser_major_versions: { - matches: ['versions', 'browser'], - regexp: /^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - var validVersions = getMajorVersions(data.released, node.versions) - var list = validVersions.map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return list - } - }, - last_electron_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+electron\s+versions?$/i, - select: function (context, node) { - return Object.keys(e2c) - .slice(-node.versions) - .map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - last_node_versions: { - matches: ['versions'], - regexp: /^last\s+(\d+)\s+node\s+versions?$/i, - select: function (context, node) { - return browserslist.nodeVersions - .slice(-node.versions) - .map(function (version) { - return 'node ' + version - }) - } - }, - last_browser_versions: { - matches: ['versions', 'browser'], - regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - var list = data.released.slice(-node.versions).map(nameMapper(data.name)) - list = filterJumps(list, data.name, node.versions, context) - return list - } - }, - unreleased_versions: { - matches: [], - regexp: /^unreleased\s+versions$/i, - select: function (context) { - return Object.keys(agents).reduce(function (selected, name) { - var data = byName(name, context) - if (!data) return selected - var list = data.versions.filter(function (v) { - return data.released.indexOf(v) === -1 - }) - list = list.map(nameMapper(data.name)) - return selected.concat(list) - }, []) - } - }, - unreleased_electron_versions: { - matches: [], - regexp: /^unreleased\s+electron\s+versions?$/i, - select: function () { - return [] - } - }, - unreleased_browser_versions: { - matches: ['browser'], - regexp: /^unreleased\s+(\w+)\s+versions?$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - return data.versions - .filter(function (v) { - return data.released.indexOf(v) === -1 - }) - .map(nameMapper(data.name)) - } - }, - last_years: { - matches: ['years'], - regexp: /^last\s+((\d+\.)?\d+)\s+years?$/i, - select: function (context, node) { - return filterByYear(Date.now() - YEAR * node.years, context) - } - }, - since_y: { - matches: ['year'], - regexp: /^since (\d+)$/i, - select: sinceQuery - }, - since_y_m: { - matches: ['year', 'month'], - regexp: /^since (\d+)-(\d+)$/i, - select: sinceQuery - }, - since_y_m_d: { - matches: ['year', 'month', 'day'], - regexp: /^since (\d+)-(\d+)-(\d+)$/i, - select: sinceQuery - }, - popularity: { - matches: ['sign', 'popularity'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - var usage = browserslist.usage.global - return Object.keys(usage).reduce(function (result, version) { - if (node.sign === '>') { - if (usage[version] > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (usage[version] < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (usage[version] <= popularity) { - result.push(version) - } - } else if (usage[version] >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - popularity_in_my_stats: { - matches: ['sign', 'popularity'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+my\s+stats$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - if (!context.customUsage) { - throw new BrowserslistError('Custom usage statistics was not provided') - } - var usage = context.customUsage - return Object.keys(usage).reduce(function (result, version) { - var percentage = usage[version] - if (percentage == null) { - return result - } - - if (node.sign === '>') { - if (percentage > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (percentage < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (percentage <= popularity) { - result.push(version) - } - } else if (percentage >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - popularity_in_config_stats: { - matches: ['sign', 'popularity', 'config'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - var usage = loadCustomUsage(context, node.config) - return Object.keys(usage).reduce(function (result, version) { - var percentage = usage[version] - if (percentage == null) { - return result - } - - if (node.sign === '>') { - if (percentage > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (percentage < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (percentage <= popularity) { - result.push(version) - } - } else if (percentage >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - popularity_in_place: { - matches: ['sign', 'popularity', 'place'], - regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+((alt-)?\w\w)$/, - select: function (context, node) { - var popularity = parseFloat(node.popularity) - var place = node.place - if (place.length === 2) { - place = place.toUpperCase() - } else { - place = place.toLowerCase() - } - env.loadCountry(browserslist.usage, place, browserslist.data) - var usage = browserslist.usage[place] - return Object.keys(usage).reduce(function (result, version) { - var percentage = usage[version] - if (percentage == null) { - return result - } - - if (node.sign === '>') { - if (percentage > popularity) { - result.push(version) - } - } else if (node.sign === '<') { - if (percentage < popularity) { - result.push(version) - } - } else if (node.sign === '<=') { - if (percentage <= popularity) { - result.push(version) - } - } else if (percentage >= popularity) { - result.push(version) - } - return result - }, []) - } - }, - cover: { - matches: ['coverage'], - regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%$/i, - select: coverQuery - }, - cover_in: { - matches: ['coverage', 'place'], - regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(my\s+stats|(alt-)?\w\w)$/i, - select: coverQuery - }, - cover_config: { - matches: ['coverage', 'config'], - regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/i, - select: coverQuery - }, - supports: { - matches: ['supportType', 'feature'], - regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/, - select: function (context, node) { - env.loadFeature(browserslist.cache, node.feature) - var withPartial = node.supportType !== 'fully' - var features = browserslist.cache[node.feature] - var result = [] - for (var name in features) { - var data = byName(name, context) - // Only check desktop when latest released mobile has support - var iMax = data.released.length - 1 - while (iMax >= 0) { - if (data.released[iMax] in features[name]) break - iMax-- - } - var checkDesktop = - context.mobileToDesktop && - name in browserslist.desktopNames && - isSupported(features[name][data.released[iMax]], withPartial) - data.versions.forEach(function (version) { - var flags = features[name][version] - if (flags === undefined && checkDesktop) { - flags = features[browserslist.desktopNames[name]][version] - } - if (isSupported(flags, withPartial)) { - result.push(name + ' ' + version) - } - }) - } - return result - } - }, - electron_range: { - matches: ['from', 'to'], - regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i, - select: function (context, node) { - var fromToUse = normalizeElectron(node.from) - var toToUse = normalizeElectron(node.to) - var from = parseFloat(node.from) - var to = parseFloat(node.to) - if (!e2c[fromToUse]) { - throw new BrowserslistError('Unknown version ' + from + ' of electron') - } - if (!e2c[toToUse]) { - throw new BrowserslistError('Unknown version ' + to + ' of electron') - } - return Object.keys(e2c) - .filter(function (i) { - var parsed = parseFloat(i) - return parsed >= from && parsed <= to - }) - .map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - node_range: { - matches: ['from', 'to'], - regexp: /^node\s+([\d.]+)\s*-\s*([\d.]+)$/i, - select: function (context, node) { - return browserslist.nodeVersions - .filter(semverFilterLoose('>=', node.from)) - .filter(semverFilterLoose('<=', node.to)) - .map(function (v) { - return 'node ' + v - }) - } - }, - browser_range: { - matches: ['browser', 'from', 'to'], - regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i, - select: function (context, node) { - var data = checkName(node.browser, context) - var from = parseFloat(normalizeVersion(data, node.from) || node.from) - var to = parseFloat(normalizeVersion(data, node.to) || node.to) - function filter(v) { - var parsed = parseFloat(v) - return parsed >= from && parsed <= to - } - return data.released.filter(filter).map(nameMapper(data.name)) - } - }, - electron_ray: { - matches: ['sign', 'version'], - regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i, - select: function (context, node) { - var versionToUse = normalizeElectron(node.version) - return Object.keys(e2c) - .filter(generateFilter(node.sign, versionToUse)) - .map(function (i) { - return 'chrome ' + e2c[i] - }) - } - }, - node_ray: { - matches: ['sign', 'version'], - regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i, - select: function (context, node) { - return browserslist.nodeVersions - .filter(generateSemverFilter(node.sign, node.version)) - .map(function (v) { - return 'node ' + v - }) - } - }, - browser_ray: { - matches: ['browser', 'sign', 'version'], - regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/, - select: function (context, node) { - var version = node.version - var data = checkName(node.browser, context) - var alias = browserslist.versionAliases[data.name][version] - if (alias) version = alias - return data.released - .filter(generateFilter(node.sign, version)) - .map(function (v) { - return data.name + ' ' + v - }) - } - }, - firefox_esr: { - matches: [], - regexp: /^(firefox|ff|fx)\s+esr$/i, - select: function () { - return ['firefox 128', 'firefox 140'] - } - }, - opera_mini_all: { - matches: [], - regexp: /(operamini|op_mini)\s+all/i, - select: function () { - return ['op_mini all'] - } - }, - electron_version: { - matches: ['version'], - regexp: /^electron\s+([\d.]+)$/i, - select: function (context, node) { - var versionToUse = normalizeElectron(node.version) - var chrome = e2c[versionToUse] - if (!chrome) { - throw new BrowserslistError( - 'Unknown version ' + node.version + ' of electron' - ) - } - return ['chrome ' + chrome] - } - }, - node_major_version: { - matches: ['version'], - regexp: /^node\s+(\d+)$/i, - select: nodeQuery - }, - node_minor_version: { - matches: ['version'], - regexp: /^node\s+(\d+\.\d+)$/i, - select: nodeQuery - }, - node_patch_version: { - matches: ['version'], - regexp: /^node\s+(\d+\.\d+\.\d+)$/i, - select: nodeQuery - }, - current_node: { - matches: [], - regexp: /^current\s+node$/i, - select: function (context) { - return [env.currentNode(resolve, context)] - } - }, - maintained_node: { - matches: [], - regexp: /^maintained\s+node\s+versions$/i, - select: function (context) { - var now = Date.now() - var queries = Object.keys(jsEOL) - .filter(function (key) { - return ( - now < Date.parse(jsEOL[key].end) && - now > Date.parse(jsEOL[key].start) && - isEolReleased(key) - ) - }) - .map(function (key) { - return 'node ' + key.slice(1) - }) - return resolve(queries, context) - } - }, - phantomjs_1_9: { - matches: [], - regexp: /^phantomjs\s+1.9$/i, - select: function () { - return ['safari 5'] - } - }, - phantomjs_2_1: { - matches: [], - regexp: /^phantomjs\s+2.1$/i, - select: function () { - return ['safari 6'] - } - }, - browser_version: { - matches: ['browser', 'version'], - regexp: /^(\w+)\s+(tp|[\d.]+)$/i, - select: function (context, node) { - var version = node.version - if (/^tp$/i.test(version)) version = 'TP' - var data = checkName(node.browser, context) - var alias = normalizeVersion(data, version) - if (alias) { - version = alias - } else { - if (version.indexOf('.') === -1) { - alias = version + '.0' - } else { - alias = version.replace(/\.0$/, '') - } - alias = normalizeVersion(data, alias) - if (alias) { - version = alias - } else if (context.ignoreUnknownVersions) { - return [] - } else { - throw new BrowserslistError( - 'Unknown version ' + version + ' of ' + node.browser - ) - } - } - return [data.name + ' ' + version] - } - }, - browserslist_config: { - matches: [], - regexp: /^browserslist config$/i, - needsPath: true, - select: function (context) { - return browserslist(undefined, context) - } - }, - extends: { - matches: ['config'], - regexp: /^extends (.+)$/i, - needsPath: true, - select: function (context, node) { - return resolve(env.loadQueries(context, node.config), context) - } - }, - defaults: { - matches: [], - regexp: /^defaults$/i, - select: function (context) { - return resolve(browserslist.defaults, context) - } - }, - dead: { - matches: [], - regexp: /^dead$/i, - select: function (context) { - var dead = [ - 'Baidu >= 0', - 'ie <= 11', - 'ie_mob <= 11', - 'bb <= 10', - 'op_mob <= 12.1', - 'samsung 4' - ] - return resolve(dead, context) - } - }, - unknown: { - matches: [], - regexp: /^(\w+)$/i, - select: function (context, node) { - if (byName(node.query, context)) { - throw new BrowserslistError( - 'Specify versions in Browserslist query for browser ' + node.query - ) - } else { - throw unknownQuery(node.query) - } - } - } -} - -// Get and convert Can I Use data - -;(function () { - for (var name in agents) { - var browser = agents[name] - browserslist.data[name] = { - name: name, - versions: normalize(agents[name].versions), - released: normalize(agents[name].versions.slice(0, -3)), - releaseDate: agents[name].release_date - } - fillUsage(browserslist.usage.global, name, browser.usage_global) - - browserslist.versionAliases[name] = {} - for (var i = 0; i < browser.versions.length; i++) { - var full = browser.versions[i] - if (!full) continue - - if (full.indexOf('-') !== -1) { - var interval = full.split('-') - for (var j = 0; j < interval.length; j++) { - browserslist.versionAliases[name][interval[j]] = full - } - } - } - } - - browserslist.nodeVersions = jsReleases.map(function (release) { - return release.version - }) -})() - -module.exports = browserslist - - -/***/ }), - -/***/ "./node_modules/browserslist/parse.js": -/*!********************************************!*\ - !*** ./node_modules/browserslist/parse.js ***! - \********************************************/ -/***/ ((module) => { - -var AND_REGEXP = /^\s+and\s+(.*)/i -var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i - -function flatten(array) { - if (!Array.isArray(array)) return [array] - return array.reduce(function (a, b) { - return a.concat(flatten(b)) - }, []) -} - -function find(string, predicate) { - for (var max = string.length, n = 1; n <= max; n++) { - var parsed = string.substr(-n, n) - if (predicate(parsed, n, max)) { - return string.slice(0, -n) - } - } - return '' -} - -function matchQuery(all, query) { - var node = { query: query } - if (query.indexOf('not ') === 0) { - node.not = true - query = query.slice(4) - } - - for (var name in all) { - var type = all[name] - var match = query.match(type.regexp) - if (match) { - node.type = name - for (var i = 0; i < type.matches.length; i++) { - node[type.matches[i]] = match[i + 1] - } - return node - } - } - - node.type = 'unknown' - return node -} - -function matchBlock(all, string, qs) { - var node - return find(string, function (parsed, n, max) { - if (AND_REGEXP.test(parsed)) { - node = matchQuery(all, parsed.match(AND_REGEXP)[1]) - node.compose = 'and' - qs.unshift(node) - return true - } else if (OR_REGEXP.test(parsed)) { - node = matchQuery(all, parsed.match(OR_REGEXP)[1]) - node.compose = 'or' - qs.unshift(node) - return true - } else if (n === max) { - node = matchQuery(all, parsed.trim()) - node.compose = 'or' - qs.unshift(node) - return true - } - return false - }) -} - -module.exports = function parse(all, queries) { - if (!Array.isArray(queries)) queries = [queries] - return flatten( - queries.map(function (block) { - var qs = [] - do { - block = matchBlock(all, block, qs) - } while (block) - return qs - }) - ) -} - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/agents.js": -/*!**************************************************!*\ - !*** ./node_modules/caniuse-lite/data/agents.js ***! - \**************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{K:0,D:0,E:0.0331526,F:0.0248644,A:0.00828815,B:0.605035,sC:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","sC","K","D","E","F","A","B","","",""],E:"IE",F:{sC:962323200,K:998870400,D:1161129600,E:1237420800,F:1300060800,A:1346716800,B:1381968000}},B:{A:{"0":0,C:0,L:0,M:0,G:0,N:0,O:0,P:0.04422,Q:0,H:0,R:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0.01206,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0.00402,n:0,o:0,p:0,q:0,r:0,s:0.0402,t:0,u:0,v:0,w:0.00804,x:0.01206,y:0.00402,z:0,AB:0,BB:0,CB:0.02814,DB:0.00804,EB:0.01206,FB:0.00402,GB:0.00402,HB:0.00402,IB:0.01206,JB:0.01206,KB:0.00804,LB:0.0201,MB:0.01206,NB:0.02814,OB:0.01608,PB:0.01608,QB:0.04824,RB:0.02814,SB:0.04824,TB:0.21306,I:4.0602},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","L","M","G","N","O","P","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","","",""],E:"Edge",F:{"0":1694649600,C:1438128000,L:1447286400,M:1470096000,G:1491868800,N:1508198400,O:1525046400,P:1542067200,Q:1579046400,H:1581033600,R:1586736000,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:1611360000,Y:1614816000,Z:1618358400,a:1622073600,b:1626912000,c:1630627200,d:1632441600,e:1634774400,f:1637539200,g:1641427200,h:1643932800,i:1646265600,j:1649635200,k:1651190400,l:1653955200,m:1655942400,n:1659657600,o:1661990400,p:1664755200,q:1666915200,r:1670198400,s:1673481600,t:1675900800,u:1678665600,v:1680825600,w:1683158400,x:1685664000,y:1689897600,z:1692576000,AB:1697155200,BB:1698969600,CB:1701993600,DB:1706227200,EB:1708732800,FB:1711152000,GB:1713398400,HB:1715990400,IB:1718841600,JB:1721865600,KB:1724371200,LB:1726704000,MB:1729123200,NB:1731542400,OB:1737417600,PB:1740614400,QB:1741219200,RB:1743984000,SB:1746316800,TB:1748476800,I:1750896000},D:{C:"ms",L:"ms",M:"ms",G:"ms",N:"ms",O:"ms",P:"ms"}},C:{A:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,tC:0,PC:0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0.04824,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:0,iB:0,jB:0,kB:0.00804,lB:0,mB:0.00402,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0.03216,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,QC:0.00804,"0B":0,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0.01206,AC:0,BC:0.01608,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0.01206,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0.00402,t:0,u:0,v:0,w:0.00402,x:0,y:0.17286,z:0,AB:0.11658,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:0.01206,IB:0.01206,JB:0.00402,KB:0.1005,LB:0.00804,MB:0,NB:0,OB:0,PB:0.01206,QB:0.00804,RB:0.00804,SB:0.01608,TB:0.01206,I:0.01608,TC:0.09648,IC:1.01304,UC:0.31356,VC:0,uC:0,vC:0,wC:0,xC:0},B:"moz",C:["tC","PC","wC","xC","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC","uC","vC"],E:"Firefox",F:{"0":1693267200,"1":1361232000,"2":1364860800,"3":1368489600,"4":1372118400,"5":1375747200,"6":1379376000,"7":1386633600,"8":1391472000,"9":1395100800,tC:1161648000,PC:1213660800,wC:1246320000,xC:1264032000,J:1300752000,UB:1308614400,K:1313452800,D:1317081600,E:1317081600,F:1320710400,A:1324339200,B:1327968000,C:1331596800,L:1335225600,M:1338854400,G:1342483200,N:1346112000,O:1349740800,P:1353628800,VB:1357603200,WB:1398729600,XB:1402358400,YB:1405987200,ZB:1409616000,aB:1413244800,bB:1417392000,cB:1421107200,dB:1424736000,eB:1428278400,fB:1431475200,gB:1435881600,hB:1439251200,iB:1442880000,jB:1446508800,kB:1450137600,lB:1453852800,mB:1457395200,nB:1461628800,oB:1465257600,pB:1470096000,qB:1474329600,rB:1479168000,sB:1485216000,tB:1488844800,uB:1492560000,vB:1497312000,wB:1502150400,xB:1506556800,yB:1510617600,zB:1516665600,QC:1520985600,"0B":1525824000,RC:1529971200,"1B":1536105600,"2B":1540252800,"3B":1544486400,"4B":1548720000,"5B":1552953600,"6B":1558396800,"7B":1562630400,"8B":1567468800,"9B":1571788800,AC:1575331200,BC:1578355200,CC:1581379200,DC:1583798400,EC:1586304000,FC:1588636800,GC:1591056000,HC:1593475200,Q:1595894400,H:1598313600,R:1600732800,SC:1603152000,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392000,d:1635811200,e:1638835200,f:1641859200,g:1644364800,h:1646697600,i:1649116800,j:1651536000,k:1653955200,l:1656374400,m:1658793600,n:1661212800,o:1663632000,p:1666051200,q:1668470400,r:1670889600,s:1673913600,t:1676332800,u:1678752000,v:1681171200,w:1683590400,x:1686009600,y:1688428800,z:1690848000,AB:1695686400,BB:1698105600,CB:1700524800,DB:1702944000,EB:1705968000,FB:1708387200,GB:1710806400,HB:1713225600,IB:1715644800,JB:1718064000,KB:1720483200,LB:1722902400,MB:1725321600,NB:1727740800,OB:1730160000,PB:1732579200,QB:1736208000,RB:1738627200,SB:1741046400,TB:1743465600,I:1745884800,TC:1748304000,IC:1750723200,UC:1753142400,VC:null,uC:null,vC:null}},D:{A:{"0":0.09648,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0.00804,hB:0.00804,iB:0.00804,jB:0.00804,kB:0.00804,lB:0.00804,mB:0.01206,nB:0.00804,oB:0.00804,pB:0.0201,qB:0.01608,rB:0.00804,sB:0.00804,tB:0.01206,uB:0.00804,vB:0.00804,wB:0.00804,xB:0.0201,yB:0.00804,zB:0.00804,QC:0.00804,"0B":0.00804,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0.02412,"6B":0,"7B":0.00402,"8B":0.01206,"9B":0.01608,AC:0,BC:0,CC:0.00402,DC:0.00804,EC:0.00402,FC:0.00402,GC:0,HC:0.00804,Q:0.07236,H:0.01206,R:0.02412,S:0.04824,T:0,U:0.00804,V:0.01206,W:0.03618,X:0.00804,Y:0.00402,Z:0.00804,a:0.02814,b:0.00804,c:0.00804,d:0.00804,e:0.00402,f:0.00804,g:0.0201,h:0.04422,i:0.01608,j:0.00804,k:0.02412,l:0.0201,m:0.0804,n:0.03618,o:0.03216,p:0.01206,q:0.01608,r:0.03216,s:0.7638,t:0.01608,u:0.02814,v:4.78782,w:0.05226,x:0.04824,y:0.0201,z:0.06834,AB:0.05226,BB:0.04422,CB:0.06834,DB:0.06834,EB:0.07236,FB:0.07236,GB:0.0603,HB:0.41808,IB:0.0603,JB:0.03216,KB:0.08442,LB:0.06834,MB:0.10854,NB:0.49446,OB:0.1407,PB:0.13668,QB:0.1206,RB:0.21306,SB:0.30552,TB:3.23208,I:11.855,TC:0.0201,IC:0.01608,UC:0,VC:0},B:"webkit",C:["","","","","","","","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC"],E:"Chrome",F:{"0":1694476800,"1":1337040000,"2":1340668800,"3":1343692800,"4":1348531200,"5":1352246400,"6":1357862400,"7":1361404800,"8":1364428800,"9":1369094400,J:1264377600,UB:1274745600,K:1283385600,D:1287619200,E:1291248000,F:1296777600,A:1299542400,B:1303862400,C:1307404800,L:1312243200,M:1316131200,G:1316131200,N:1319500800,O:1323734400,P:1328659200,VB:1332892800,WB:1374105600,XB:1376956800,YB:1384214400,ZB:1389657600,aB:1392940800,bB:1397001600,cB:1400544000,dB:1405468800,eB:1409011200,fB:1412640000,gB:1416268800,hB:1421798400,iB:1425513600,jB:1429401600,kB:1432080000,lB:1437523200,mB:1441152000,nB:1444780800,oB:1449014400,pB:1453248000,qB:1456963200,rB:1460592000,sB:1464134400,tB:1469059200,uB:1472601600,vB:1476230400,wB:1480550400,xB:1485302400,yB:1489017600,zB:1492560000,QC:1496707200,"0B":1500940800,RC:1504569600,"1B":1508198400,"2B":1512518400,"3B":1516752000,"4B":1520294400,"5B":1523923200,"6B":1527552000,"7B":1532390400,"8B":1536019200,"9B":1539648000,AC:1543968000,BC:1548720000,CC:1552348800,DC:1555977600,EC:1559606400,FC:1564444800,GC:1568073600,HC:1571702400,Q:1575936000,H:1580860800,R:1586304000,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272000,a:1621987200,b:1626739200,c:1630368000,d:1632268800,e:1634601600,f:1637020800,g:1641340800,h:1643673600,i:1646092800,j:1648512000,k:1650931200,l:1653350400,m:1655769600,n:1659398400,o:1661817600,p:1664236800,q:1666656000,r:1669680000,s:1673308800,t:1675728000,u:1678147200,v:1680566400,w:1682985600,x:1685404800,y:1689724800,z:1692057600,AB:1696896000,BB:1698710400,CB:1701993600,DB:1705968000,EB:1708387200,FB:1710806400,GB:1713225600,HB:1715644800,IB:1718064000,JB:1721174400,KB:1724112000,LB:1726531200,MB:1728950400,NB:1731369600,OB:1736812800,PB:1738627200,QB:1741046400,RB:1743465600,SB:1745884800,TB:1748304000,I:1750723200,TC:1754352000,IC:null,UC:null,VC:null}},E:{A:{J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0.00402,C:0,L:0.00804,M:0.01206,G:0,yC:0,WC:0,zC:0,"0C":0,"1C":0,"2C":0,XC:0,JC:0.00402,KC:0.00402,"3C":0.02814,"4C":0.03216,"5C":0.03216,YC:0,ZC:0.00804,LC:0.00804,"6C":0.11658,MC:0.02412,aC:0.01608,bC:0.01206,cC:0.02814,dC:0.01206,eC:0.01608,"7C":0.16482,NC:0.00804,fC:0.11256,gC:0.01206,hC:0.01608,iC:0.02814,jC:0.04422,"8C":0.1608,OC:0.0201,kC:0.03618,lC:0.01608,mC:0.0804,nC:0.0603,oC:1.37484,pC:0.01206,"9C":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","yC","WC","J","UB","zC","K","0C","D","1C","E","F","2C","A","XC","B","JC","C","KC","L","3C","M","4C","G","5C","YC","ZC","LC","6C","MC","aC","bC","cC","dC","eC","7C","NC","fC","gC","hC","iC","jC","8C","OC","kC","lC","mC","nC","oC","pC","9C",""],E:"Safari",F:{yC:1205798400,WC:1226534400,J:1244419200,UB:1275868800,zC:1311120000,K:1343174400,"0C":1382400000,D:1382400000,"1C":1410998400,E:1413417600,F:1443657600,"2C":1458518400,A:1474329600,XC:1490572800,B:1505779200,JC:1522281600,C:1537142400,KC:1553472000,L:1568851200,"3C":1585008000,M:1600214400,"4C":1619395200,G:1632096000,"5C":1635292800,YC:1639353600,ZC:1647216000,LC:1652745600,"6C":1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432000,dC:1679875200,eC:1684368000,"7C":1690156800,NC:1695686400,fC:1698192000,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,"8C":1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936000,nC:1743379200,oC:1747008000,pC:null,"9C":null}},F:{A:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,F:0,B:0,C:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:0.00402,iB:0,jB:0,kB:0,lB:0,mB:0,nB:0.00804,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,"0B":0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0,AC:0,BC:0,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0.00402,Z:0.05226,a:0,b:0,c:0,d:0,e:0.02814,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0,u:0,v:0,w:0.00402,x:0,y:0,z:0,AD:0,BD:0,CD:0,DD:0,JC:0,qC:0,ED:0,KC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","F","AD","BD","CD","DD","B","JC","qC","ED","C","KC","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","0B","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","","",""],E:"Opera",F:{"0":1739404800,"1":1393891200,"2":1399334400,"3":1401753600,"4":1405987200,"5":1409616000,"6":1413331200,"7":1417132800,"8":1422316800,"9":1425945600,F:1150761600,AD:1223424000,BD:1251763200,CD:1267488000,DD:1277942400,B:1292457600,JC:1302566400,qC:1309219200,ED:1323129600,C:1323129600,KC:1352073600,G:1372723200,N:1377561600,O:1381104000,P:1386288000,VB:1390867200,WB:1430179200,XB:1433808000,YB:1438646400,ZB:1442448000,aB:1445904000,bB:1449100800,cB:1454371200,dB:1457308800,eB:1462320000,fB:1465344000,gB:1470096000,hB:1474329600,iB:1477267200,jB:1481587200,kB:1486425600,lB:1490054400,mB:1494374400,nB:1498003200,oB:1502236800,pB:1506470400,qB:1510099200,rB:1515024000,sB:1517961600,tB:1521676800,uB:1525910400,vB:1530144000,wB:1534982400,xB:1537833600,yB:1543363200,zB:1548201600,"0B":1554768000,"1B":1561593600,"2B":1566259200,"3B":1570406400,"4B":1573689600,"5B":1578441600,"6B":1583971200,"7B":1587513600,"8B":1592956800,"9B":1595894400,AC:1600128000,BC:1603238400,CC:1613520000,DC:1612224000,EC:1616544000,FC:1619568000,GC:1623715200,HC:1627948800,Q:1631577600,H:1633392000,R:1635984000,SC:1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152000,Z:1660780800,a:1663113600,b:1668816000,c:1668643200,d:1671062400,e:1675209600,f:1677024000,g:1679529600,h:1681948800,i:1684195200,j:1687219200,k:1690329600,l:1692748800,m:1696204800,n:1699920000,o:1699920000,p:1702944000,q:1707264000,r:1710115200,s:1711497600,t:1716336000,u:1719273600,v:1721088000,w:1724284800,x:1727222400,y:1732665600,z:1736294400},D:{F:"o",B:"o",C:"o",AD:"o",BD:"o",CD:"o",DD:"o",JC:"o",qC:"o",ED:"o",KC:"o"}},G:{A:{E:0,WC:0,FD:0,rC:0.0013461,GD:0,HD:0.00673049,ID:0.00403829,JD:0,KD:0.0026922,LD:0.0148071,MD:0.0013461,ND:0.0228837,OD:0.200569,PD:0.00942269,QD:0.0026922,RD:0.082112,SD:0,TD:0.0026922,UD:0.0026922,VD:0.013461,WD:0.0578822,XD:0.0309603,YD:0.026922,YC:0.0215376,ZC:0.0242298,LC:0.0282681,ZD:0.371523,MC:0.0498056,aC:0.095573,bC:0.0498056,cC:0.0942269,dC:0.0201915,eC:0.0376907,aD:0.477865,NC:0.0242298,fC:0.0457673,gC:0.0336525,hC:0.0498056,iC:0.095573,jC:0.173647,bD:0.442866,OC:0.111726,kC:0.234221,lC:0.126533,mC:0.46575,nC:0.301526,oC:9.39442,pC:0.0215376},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","WC","FD","rC","GD","HD","ID","E","JD","KD","LD","MD","ND","OD","PD","QD","RD","SD","TD","UD","VD","WD","XD","YD","YC","ZC","LC","ZD","MC","aC","bC","cC","dC","eC","aD","NC","fC","gC","hC","iC","jC","bD","OC","kC","lC","mC","nC","oC","pC","",""],E:"Safari on iOS",F:{WC:1270252800,FD:1283904000,rC:1299628800,GD:1331078400,HD:1359331200,ID:1394409600,E:1410912000,JD:1413763200,KD:1442361600,LD:1458518400,MD:1473724800,ND:1490572800,OD:1505779200,PD:1522281600,QD:1537142400,RD:1553472000,SD:1568851200,TD:1572220800,UD:1580169600,VD:1585008000,WD:1600214400,XD:1619395200,YD:1632096000,YC:1639353600,ZC:1647216000,LC:1652659200,ZD:1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432000,dC:1679875200,eC:1684368000,aD:1690156800,NC:1694995200,fC:1698192000,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,bD:1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936000,nC:1743379200,oC:1747008000,pC:null}},H:{A:{cD:0.04},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","cD","","",""],E:"Opera Mini",F:{cD:1426464000}},I:{A:{PC:0,J:0,I:0.794067,dD:0,eD:0,fD:0,gD:0.000159068,rC:0.000159068,hD:0,iD:0.000636272},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","dD","eD","fD","PC","J","gD","rC","hD","iD","I","","",""],E:"Android Browser",F:{dD:1256515200,eD:1274313600,fD:1291593600,PC:1298332800,J:1318896000,gD:1341792000,rC:1374624000,hD:1386547200,iD:1401667200,I:1750723200}},J:{A:{D:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","A","","",""],E:"Blackberry Browser",F:{D:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,H:0.95866,JC:0,qC:0,KC:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","JC","qC","C","KC","H","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,JC:1314835200,qC:1318291200,C:1330300800,KC:1349740800,H:1709769600},D:{H:"webkit"}},L:{A:{I:43.5564},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","","",""],E:"Chrome for Android",F:{I:1750723200}},M:{A:{IC:0.3289},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","IC","","",""],E:"Firefox for Android",F:{IC:1750723200}},N:{A:{A:0,B:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{LC:0.81328},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","LC","","",""],E:"UC Browser for Android",F:{LC:1710115200},D:{LC:"webkit"}},P:{A:{"1":0,"2":0.0218021,"3":0.0218021,"4":0.0218021,"5":0.0327031,"6":0.0327031,"7":0.0545052,"8":0.0872083,"9":1.80957,J:0,jD:0,kD:0,lD:0.010901,mD:0,nD:0,XC:0,oD:0,pD:0,qD:0,rD:0,sD:0,MC:0,NC:0,OC:0,tD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","J","jD","kD","lD","mD","nD","XC","oD","pD","qD","rD","sD","MC","NC","OC","tD","1","2","3","4","5","6","7","8","9","","",""],E:"Samsung Internet",F:{"1":1677369600,"2":1684454400,"3":1689292800,"4":1697587200,"5":1711497600,"6":1715126400,"7":1717718400,"8":1725667200,"9":1746057600,J:1461024000,jD:1481846400,kD:1509408000,lD:1528329600,mD:1546128000,nD:1554163200,XC:1567900800,oD:1582588800,pD:1593475200,qD:1605657600,rD:1618531200,sD:1629072000,MC:1640736000,NC:1651708800,OC:1659657600,tD:1667260800}},Q:{A:{uD:0.18538},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uD","","",""],E:"QQ Browser",F:{uD:1710288000}},R:{A:{vD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","vD","","",""],E:"Baidu Browser",F:{vD:1710201600}},S:{A:{wD:0.01196,xD:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","wD","xD","","",""],E:"KaiOS Browser",F:{wD:1527811200,xD:1631664000}}}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/browserVersions.js": -/*!***********************************************************!*\ - !*** ./node_modules/caniuse-lite/data/browserVersions.js ***! - \***********************************************************/ -/***/ ((module) => { - -module.exports={"0":"117","1":"20","2":"21","3":"22","4":"23","5":"24","6":"25","7":"26","8":"27","9":"28",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"80",I:"138",J:"4",K:"6",L:"13",M:"14",N:"16",O:"17",P:"18",Q:"79",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"96",g:"97",h:"98",i:"99",j:"100",k:"101",l:"102",m:"103",n:"104",o:"105",p:"106",q:"107",r:"108",s:"109",t:"110",u:"111",v:"112",w:"113",x:"114",y:"115",z:"116",AB:"118",BB:"119",CB:"120",DB:"121",EB:"122",FB:"123",GB:"124",HB:"125",IB:"126",JB:"127",KB:"128",LB:"129",MB:"130",NB:"131",OB:"132",PB:"133",QB:"134",RB:"135",SB:"136",TB:"137",UB:"5",VB:"19",WB:"29",XB:"30",YB:"31",ZB:"32",aB:"33",bB:"34",cB:"35",dB:"36",eB:"37",fB:"38",gB:"39",hB:"40",iB:"41",jB:"42",kB:"43",lB:"44",mB:"45",nB:"46",oB:"47",pB:"48",qB:"49",rB:"50",sB:"51",tB:"52",uB:"53",vB:"54",wB:"55",xB:"56",yB:"57",zB:"58","0B":"60","1B":"62","2B":"63","3B":"64","4B":"65","5B":"66","6B":"67","7B":"68","8B":"69","9B":"70",AC:"71",BC:"72",CC:"73",DC:"74",EC:"75",FC:"76",GC:"77",HC:"78",IC:"140",JC:"11.1",KC:"12.1",LC:"15.5",MC:"16.0",NC:"17.0",OC:"18.0",PC:"3",QC:"59",RC:"61",SC:"82",TC:"139",UC:"141",VC:"142",WC:"3.2",XC:"10.1",YC:"15.2-15.3",ZC:"15.4",aC:"16.1",bC:"16.2",cC:"16.3",dC:"16.4",eC:"16.5",fC:"17.1",gC:"17.2",hC:"17.3",iC:"17.4",jC:"17.5",kC:"18.1",lC:"18.2",mC:"18.3",nC:"18.4",oC:"18.5-18.6",pC:"26.0",qC:"11.5",rC:"4.2-4.3",sC:"5.5",tC:"2",uC:"143",vC:"144",wC:"3.5",xC:"3.6",yC:"3.1",zC:"5.1","0C":"6.1","1C":"7.1","2C":"9.1","3C":"13.1","4C":"14.1","5C":"15.1","6C":"15.6","7C":"16.6","8C":"17.6","9C":"TP",AD:"9.5-9.6",BD:"10.0-10.1",CD:"10.5",DD:"10.6",ED:"11.6",FD:"4.0-4.1",GD:"5.0-5.1",HD:"6.0-6.1",ID:"7.0-7.1",JD:"8.1-8.4",KD:"9.0-9.2",LD:"9.3",MD:"10.0-10.2",ND:"10.3",OD:"11.0-11.2",PD:"11.3-11.4",QD:"12.0-12.1",RD:"12.2-12.5",SD:"13.0-13.1",TD:"13.2",UD:"13.3",VD:"13.4-13.7",WD:"14.0-14.4",XD:"14.5-14.8",YD:"15.0-15.1",ZD:"15.6-15.8",aD:"16.6-16.7",bD:"17.6-17.7",cD:"all",dD:"2.1",eD:"2.2",fD:"2.3",gD:"4.1",hD:"4.4",iD:"4.4.3-4.4.4",jD:"5.0-5.4",kD:"6.2-6.4",lD:"7.2-7.4",mD:"8.2",nD:"9.2",oD:"11.1-11.2",pD:"12.0",qD:"13.0",rD:"14.0",sD:"15.0",tD:"19.0",uD:"14.9",vD:"13.52",wD:"2.5",xD:"3.0-3.1"}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/browsers.js": -/*!****************************************************!*\ - !*** ./node_modules/caniuse-lite/data/browsers.js ***! - \****************************************************/ -/***/ ((module) => { - -module.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"ios_saf",H:"op_mini",I:"android",J:"bb",K:"op_mob",L:"and_chr",M:"and_ff",N:"ie_mob",O:"and_uc",P:"samsung",Q:"and_qq",R:"baidu",S:"kaios"}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/background-clip-text.js": -/*!*************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/background-clip-text.js ***! - \*************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"G N O P","33":"C L M","129":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","161":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},C:{"1":"0 qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB wC xC"},D:{"129":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","161":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},E:{"2":"yC","129":"LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","388":"UB K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC","420":"J WC"},F:{"2":"F B C AD BD CD DD JC qC ED KC","129":"0 p q r s t u v w x y z","161":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o"},G:{"129":"LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","388":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC"},H:{"2":"cD"},I:{"16":"PC dD eD fD","129":"I","161":"J gD rC hD iD"},J:{"161":"D A"},K:{"16":"A B C JC qC KC","129":"H"},L:{"129":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"161":"LC"},P:{"1":"6 7 8 9","161":"1 2 3 4 5 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"161":"uD"},R:{"161":"vD"},S:{"1":"wD xD"}},B:7,C:"Background-clip: text",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/background-img-opts.js": -/*!************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/background-img-opts.js ***! - \************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"F A B","2":"K D E sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC","36":"xC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","516":"J UB K D E F A B C L M"},E:{"1":"D E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","772":"J UB K yC WC zC 0C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z CD DD JC qC ED KC","2":"F AD","36":"BD"},G:{"1":"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","4":"WC FD rC HD","516":"GD"},H:{"132":"cD"},I:{"1":"I hD iD","36":"dD","516":"PC J gD rC","548":"eD fD"},J:{"1":"D A"},K:{"1":"A B C H JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS3 Background-image options",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/border-image.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/border-image.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"B","2":"K D E F A sC"},B:{"1":"0 M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","129":"C L"},C:{"1":"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC","260":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB","804":"J UB K D E F A B C L M wC xC"},D:{"1":"0 xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","260":"sB tB uB vB wB","388":"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB","1412":"1 2 3 4 5 6 7 8 9 G N O P VB WB","1956":"J UB K D E F A B C L M"},E:{"1":"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","129":"A B C L M G 2C XC JC KC 3C 4C 5C YC","1412":"K D E F 0C 1C","1956":"J UB yC WC zC"},F:{"1":"0 kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F AD BD","260":"fB gB hB iB jB","388":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB","1796":"CD DD","1828":"B C JC qC ED KC"},G:{"1":"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","129":"LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC","1412":"E HD ID JD KD","1956":"WC FD rC GD"},H:{"1828":"cD"},I:{"1":"I","388":"hD iD","1956":"PC J dD eD fD gD rC"},J:{"1412":"A","1924":"D"},K:{"1":"H","2":"A","1828":"B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"B","2":"A"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD","260":"jD kD","388":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","260":"wD"}},B:4,C:"CSS3 Border images",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/border-radius.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/border-radius.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"F A B","2":"K D E sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","257":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB","289":"PC wC xC","292":"tC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"J"},E:{"1":"UB D E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"J yC WC","129":"K zC 0C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z CD DD JC qC ED KC","2":"F AD BD"},G:{"1":"E FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"WC"},H:{"2":"cD"},I:{"1":"PC J I eD fD gD rC hD iD","33":"dD"},J:{"1":"D A"},K:{"1":"B C H JC qC KC","2":"A"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","257":"wD"}},B:4,C:"CSS3 Border-radius (rounded corners)",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/calc.js": -/*!*********************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/calc.js ***! - \*********************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E sC","260":"F","516":"A B"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC xC","33":"J UB K D E F A B C L M G"},D:{"1":"0 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"J UB K D E F A B C L M G N O P","33":"1 2 3 4 5 6 VB"},E:{"1":"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC zC","33":"K"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC"},G:{"1":"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","33":"HD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC","132":"hD iD"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"calc() as CSS unit value",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-animation.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-animation.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"A B","2":"K D E F sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J wC xC","33":"UB K D E F A B C L M G"},D:{"1":"0 kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"yC WC","33":"K D E zC 0C 1C","292":"J UB"},F:{"1":"0 XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F B AD BD CD DD JC qC ED","33":"1 2 3 4 5 6 7 8 9 C G N O P VB WB"},G:{"1":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"E HD ID JD","164":"WC FD rC GD"},H:{"2":"cD"},I:{"1":"I","33":"J gD rC hD iD","164":"PC dD eD fD"},J:{"33":"D A"},K:{"1":"H KC","2":"A B C JC qC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:5,C:"CSS Animation",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-any-link.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-any-link.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","16":"tC","33":"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB wC xC"},D:{"1":"0 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","16":"J UB K D E F A B C L M","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","16":"J UB K yC WC zC","33":"D E 0C 1C"},F:{"1":"0 tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB"},G:{"1":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","16":"WC FD rC GD","33":"E HD ID JD"},H:{"2":"cD"},I:{"1":"I","16":"PC J dD eD fD gD rC","33":"hD iD"},J:{"16":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 nD XC oD pD qD rD sD MC NC OC tD","16":"J","33":"jD kD lD mD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","33":"wD"}},B:5,C:"CSS :any-link selector",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-appearance.js": -/*!*******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-appearance.js ***! - \*******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","33":"S","164":"Q H R","388":"C L M G N O P"},C:{"1":"0 H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","164":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q","676":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB wC xC"},D:{"1":"0 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"S","164":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R"},E:{"1":"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","164":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC"},F:{"1":"0 CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"9B AC BC","164":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B"},G:{"1":"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","164":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},H:{"2":"cD"},I:{"1":"I","164":"PC J dD eD fD gD rC hD iD"},J:{"164":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A","388":"B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 rD sD MC NC OC tD","164":"J jD kD lD mD nD XC oD pD qD"},Q:{"164":"uD"},R:{"1":"vD"},S:{"1":"xD","164":"wD"}},B:5,C:"CSS Appearance",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-autofill.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-autofill.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s"},L:{"1":"I"},B:{"1":"0 t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P","33":"Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s"},C:{"1":"0 V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U wC xC"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"G 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"9C","33":"J UB K D E F A B C L M yC WC zC 0C 1C 2C XC JC KC 3C 4C"},G:{"1":"YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD"},P:{"1":"2 3 4 5 6 7 8 9","33":"1 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{"1":"I","2":"PC J dD eD fD gD rC","33":"hD iD"}},B:6,C:":autofill CSS pseudo-class",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-backdrop-filter.js": -/*!************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-backdrop-filter.js ***! - \************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N","257":"O P"},C:{"1":"0 m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B wC xC","578":"9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l"},D:{"1":"0 FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","194":"oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC"},E:{"1":"OC kC lC mC nC oC pC 9C","2":"J UB K D E yC WC zC 0C 1C","33":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C"},F:{"1":"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB AD BD CD DD JC qC ED KC","194":"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B"},G:{"1":"OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD","33":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 pD qD rD sD MC NC OC tD","2":"J","194":"jD kD lD mD nD XC oD"},Q:{"2":"uD"},R:{"1":"vD"},S:{"2":"wD xD"}},B:7,C:"CSS Backdrop Filter",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js": -/*!***************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js ***! - \***************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"MB NB OB PB QB RB SB TB I","2":"C L M G N O P","164":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB"},C:{"1":"0 ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB wC xC"},D:{"1":"MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 J UB K D E F A B C L M G N O P VB","164":"0 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"2":"J UB K yC WC zC","164":"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{"1":"0 z","2":"F AD BD CD DD","129":"B C JC qC ED KC","164":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y"},G:{"2":"WC FD rC GD HD","164":"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"132":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC","164":"hD iD"},J:{"2":"D","164":"A"},K:{"2":"A","129":"B C JC qC KC","164":"H"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"164":"LC"},P:{"164":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"164":"uD"},R:{"164":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS box-decoration-break",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-boxshadow.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-boxshadow.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"F A B","2":"K D E sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC","33":"wC xC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"J UB K D E F"},E:{"1":"K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"UB","164":"J yC WC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z CD DD JC qC ED KC","2":"F AD BD"},G:{"1":"E GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"FD rC","164":"WC"},H:{"2":"cD"},I:{"1":"J I gD rC hD iD","164":"PC dD eD fD"},J:{"1":"A","33":"D"},K:{"1":"B C H JC qC KC","2":"A"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS3 Box-shadow",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-clip-path.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-clip-path.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"2":"C L M G N O","260":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","3138":"P"},C:{"1":"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC","132":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB wC xC","644":"oB pB qB rB sB tB uB"},D:{"2":"1 2 3 4 J UB K D E F A B C L M G N O P VB","260":"0 wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","292":"5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},E:{"2":"J UB K yC WC zC 0C","260":"M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","292":"D E F A B C L 1C 2C XC JC KC"},F:{"2":"F B C AD BD CD DD JC qC ED KC","260":"0 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","292":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB"},G:{"2":"WC FD rC GD HD","260":"SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","292":"E ID JD KD LD MD ND OD PD QD RD"},H:{"2":"cD"},I:{"2":"PC J dD eD fD gD rC","260":"I","292":"hD iD"},J:{"2":"D A"},K:{"2":"A B C JC qC KC","260":"H"},L:{"260":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"260":"LC"},P:{"260":"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD","292":"J jD"},Q:{"260":"uD"},R:{"260":"vD"},S:{"1":"xD","644":"wD"}},B:4,C:"CSS clip-path property (for HTML)",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-crisp-edges.js": -/*!********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-crisp-edges.js ***! - \********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K sC","2340":"D E F A B"},B:{"2":"C L M G N O P","1025":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC","513":"4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b","545":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B xC"},D:{"2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB","1025":"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"1":"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC zC","164":"K","4644":"D E F 0C 1C 2C"},F:{"2":"1 2 3 4 5 6 7 8 F B G N O P VB AD BD CD DD JC qC","545":"C ED KC","1025":"0 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"1":"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC","4260":"GD HD","4644":"E ID JD KD LD"},H:{"2":"cD"},I:{"2":"PC J dD eD fD gD rC hD iD","1025":"I"},J:{"2":"D","4260":"A"},K:{"2":"A B JC qC","545":"C KC","1025":"H"},L:{"1025":"I"},M:{"1":"IC"},N:{"2340":"A B"},O:{"1025":"LC"},P:{"1025":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1025":"uD"},R:{"1025":"vD"},S:{"1":"xD","4097":"wD"}},B:4,C:"Crisp edges/pixelated images",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-cross-fade.js": -/*!*******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-cross-fade.js ***! - \*******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"2":"C L M G N O P","33":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{"2":"J UB K D E F A B C L M G N","33":"0 1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"1":"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC","33":"K D E F zC 0C 1C 2C"},F:{"2":"F B C AD BD CD DD JC qC ED KC","33":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"1":"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC","33":"E GD HD ID JD KD LD"},H:{"2":"cD"},I:{"2":"PC J dD eD fD gD rC","33":"I hD iD"},J:{"2":"D A"},K:{"2":"A B C JC qC KC","33":"H"},L:{"33":"I"},M:{"2":"IC"},N:{"2":"A B"},O:{"33":"LC"},P:{"33":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"33":"uD"},R:{"33":"vD"},S:{"2":"wD xD"}},B:4,C:"CSS Cross-Fade Function",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-deviceadaptation.js": -/*!*************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-deviceadaptation.js ***! - \*************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","164":"A B"},B:{"66":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","164":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{"2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB","66":"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"2":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{"2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB AD BD CD DD JC qC ED KC","66":"0 hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"292":"cD"},I:{"2":"PC J I dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"2":"A H","292":"B C JC qC KC"},L:{"2":"I"},M:{"2":"IC"},N:{"164":"A B"},O:{"2":"LC"},P:{"2":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"66":"uD"},R:{"2":"vD"},S:{"2":"wD xD"}},B:5,C:"CSS Device Adaptation",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-element-function.js": -/*!*************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-element-function.js ***! - \*************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"2":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"33":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","164":"tC PC wC xC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"2":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{"2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"2":"PC J I dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"2":"A B C H JC qC KC"},L:{"2":"I"},M:{"33":"IC"},N:{"2":"A B"},O:{"2":"LC"},P:{"2":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"2":"uD"},R:{"2":"vD"},S:{"33":"wD xD"}},B:5,C:"CSS element() function",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-featurequeries.js": -/*!***********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-featurequeries.js ***! - \***********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{"1":"0 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 J UB K D E F A B C L M G N O P VB"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D E yC WC zC 0C 1C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F B C AD BD CD DD JC qC ED"},G:{"1":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD"},H:{"1":"cD"},I:{"1":"I hD iD","2":"PC J dD eD fD gD rC"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS Feature Queries",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-file-selector-button.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-file-selector-button.js ***! - \*****************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X"},L:{"1":"I"},B:{"1":"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","33":"C L M G N O P Q H R S T U V W X"},C:{"1":"0 SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R wC xC"},M:{"1":"IC"},A:{"2":"K D E F sC","33":"A B"},F:{"1":"0 EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"G 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"9C","33":"J UB K D E F A B C L M yC WC zC 0C 1C 2C XC JC KC 3C"},G:{"1":"XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD"},P:{"1":"1 2 3 4 5 6 7 8 9 sD MC NC OC tD","33":"J jD kD lD mD nD XC oD pD qD rD"},I:{"1":"I","2":"PC J dD eD fD gD rC","33":"hD iD"}},B:6,C:"::file-selector-button CSS pseudo-element",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-filter-function.js": -/*!************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-filter-function.js ***! - \************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"2":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"1":"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D E yC WC zC 0C 1C","33":"F"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{"1":"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD","33":"KD LD"},H:{"2":"cD"},I:{"2":"PC J I dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"2":"A B C H JC qC KC"},L:{"2":"I"},M:{"2":"IC"},N:{"2":"A B"},O:{"2":"LC"},P:{"2":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"2":"uD"},R:{"2":"vD"},S:{"2":"wD xD"}},B:5,C:"CSS filter() function",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-filters.js": -/*!****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-filters.js ***! - \****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","1028":"L M G N O P","1346":"C"},C:{"1":"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC","196":"bB","516":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB xC"},D:{"1":"0 uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"J UB K D E F A B C L M G N O","33":"1 2 3 4 5 6 7 8 9 P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},E:{"1":"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC zC","33":"K D E F 0C 1C"},F:{"1":"0 hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB"},G:{"1":"LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","33":"E HD ID JD KD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC","33":"hD iD"},J:{"2":"D","33":"A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD","33":"J jD kD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:5,C:"CSS Filter Effects",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-gradients.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-gradients.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"A B","2":"K D E F sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC","260":"1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB","292":"J UB K D E F A B C L M G xC"},D:{"1":"0 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 A B C L M G N O P VB","548":"J UB K D E F"},E:{"1":"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"yC WC","260":"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC","292":"K zC","804":"J UB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F B AD BD CD DD","33":"C ED","164":"JC qC"},G:{"1":"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","260":"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC","292":"GD HD","804":"WC FD rC"},H:{"2":"cD"},I:{"1":"I hD iD","33":"J gD rC","548":"PC dD eD fD"},J:{"1":"A","548":"D"},K:{"1":"H KC","2":"A B","33":"C","164":"JC qC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS Gradients",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-grid.js": -/*!*************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-grid.js ***! - \*************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E sC","8":"F","292":"A B"},B:{"1":"0 N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","292":"C L M G"},C:{"1":"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB K D E F A B C L M G N O P wC xC","8":"1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB cB dB eB fB gB","584":"hB iB jB kB lB mB nB oB pB qB rB sB","1025":"tB uB"},D:{"1":"0 zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 J UB K D E F A B C L M G N O P VB","8":"6 7 8 9","200":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB","1025":"yB"},E:{"1":"B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC zC","8":"K D E F A 0C 1C 2C"},F:{"1":"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P VB AD BD CD DD JC qC ED KC","200":"9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"1":"ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","8":"E HD ID JD KD LD MD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD","8":"rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"292":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"jD","8":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS Grid Layout (level 1)",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-hyphens.js": -/*!****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-hyphens.js ***! - \****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","33":"A B"},B:{"1":"0 o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","33":"C L M G N O P","132":"Q H R S T U V W","260":"X Y Z a b c d e f g h i j k l m n"},C:{"1":"0 kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB wC xC","33":"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB"},D:{"1":"0 X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB","132":"wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W"},E:{"1":"NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC","33":"K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C"},F:{"1":"0 a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB AD BD CD DD JC qC ED KC","132":"jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z"},G:{"1":"NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD","33":"E rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J","132":"jD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS Hyphenation",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-image-set.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-image-set.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P","164":"Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v","2049":"w"},C:{"1":"0 w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U wC xC","66":"V W","2305":"Y Z a b c d e f g h i j k l m n o p q r s t u v","2820":"X"},D:{"1":"0 x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 J UB K D E F A B C L M G N O P VB","164":"2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v","2049":"w"},E:{"1":"NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC zC","132":"A B C L XC JC KC 3C","164":"K D E F 0C 1C 2C","1540":"M G 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C"},F:{"1":"0 j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","164":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h","2049":"i"},G:{"1":"NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","132":"MD ND OD PD QD RD SD TD UD VD","164":"E HD ID JD KD LD","1540":"WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC","164":"hD iD"},J:{"2":"D","164":"A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"164":"LC"},P:{"1":"4 5 6 7 8 9","164":"1 2 3 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"164":"uD"},R:{"164":"vD"},S:{"2":"wD xD"}},B:5,C:"CSS image-set",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-logical-props.js": -/*!**********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-logical-props.js ***! - \**********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P","1028":"W X","1540":"Q H R S T U V"},C:{"1":"0 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC","164":"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB wC xC","1540":"iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B"},D:{"1":"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","292":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B","1028":"W X","1540":"8B 9B AC BC CC DC EC FC GC HC Q H R S T U V"},E:{"1":"G 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","292":"J UB K D E F A B C yC WC zC 0C 1C 2C XC JC","1540":"L M KC 3C","3076":"4C"},F:{"1":"0 FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","292":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB","1028":"DC EC","1540":"xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC"},G:{"1":"YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","292":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD","1540":"RD SD TD UD VD WD","3076":"XD"},H:{"2":"cD"},I:{"1":"I","292":"PC J dD eD fD gD rC hD iD"},J:{"292":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 sD MC NC OC tD","292":"J jD kD lD mD nD","1540":"XC oD pD qD rD"},Q:{"1540":"uD"},R:{"1":"vD"},S:{"1":"xD","1540":"wD"}},B:5,C:"CSS Logical Properties",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-masks.js": -/*!**************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-masks.js ***! - \**************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N","164":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB","3138":"O","12292":"P"},C:{"1":"0 uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC","260":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB wC xC"},D:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","164":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},E:{"1":"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"yC WC","164":"J UB K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC"},F:{"1":"0 p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","164":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o"},G:{"1":"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","164":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},H:{"2":"cD"},I:{"1":"I","164":"hD iD","676":"PC J dD eD fD gD rC"},J:{"164":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"164":"LC"},P:{"1":"6 7 8 9","164":"1 2 3 4 5 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"164":"uD"},R:{"164":"vD"},S:{"1":"xD","260":"wD"}},B:4,C:"CSS Masks",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-media-resolution.js": -/*!*************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-media-resolution.js ***! - \*************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E sC","132":"F A B"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","1028":"C L M G N O P"},C:{"1":"0 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC","260":"J UB K D E F A B C L M G wC xC","1028":"1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC"},D:{"1":"0 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","548":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB","1028":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B"},E:{"1":"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"yC WC","548":"J UB K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C"},F:{"1":"0 wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F","548":"B C AD BD CD DD JC qC ED","1028":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},G:{"1":"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","16":"WC","548":"E FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD"},H:{"132":"cD"},I:{"1":"I","16":"dD eD","548":"PC J fD gD rC","1028":"hD iD"},J:{"548":"D A"},K:{"1":"H KC","548":"A B C JC qC"},L:{"1":"I"},M:{"1":"IC"},N:{"132":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 XC oD pD qD rD sD MC NC OC tD","1028":"J jD kD lD mD nD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"Media Queries: resolution feature",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-overscroll-behavior.js": -/*!****************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-overscroll-behavior.js ***! - \****************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","132":"A B"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","132":"C L M G N O","516":"P"},C:{"1":"0 QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB wC xC"},D:{"1":"0 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B","260":"2B 3B"},E:{"1":"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D E F A B C L M yC WC zC 0C 1C 2C XC JC KC 3C","1090":"G 4C 5C YC ZC LC 6C"},F:{"1":"0 tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB AD BD CD DD JC qC ED KC","260":"rB sB"},G:{"1":"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD","1090":"XD YD YC ZC LC ZD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"132":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 mD nD XC oD pD qD rD sD MC NC OC tD","2":"J jD kD lD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","2":"wD"}},B:5,C:"CSS overscroll-behavior",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-placeholder-shown.js": -/*!**************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-placeholder-shown.js ***! - \**************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","292":"A B"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC xC","164":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB"},D:{"1":"0 oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D E yC WC zC 0C 1C"},F:{"1":"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB AD BD CD DD JC qC ED KC"},G:{"1":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","164":"wD"}},B:5,C:":placeholder-shown CSS pseudo-class",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-placeholder.js": -/*!********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-placeholder.js ***! - \********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","36":"C L M G N O P"},C:{"1":"0 sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","33":"1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB","130":"tC PC J UB K D E F A B C L M G N O P wC xC"},D:{"1":"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","36":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},E:{"1":"B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J yC WC","36":"UB K D E F A zC 0C 1C 2C"},F:{"1":"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","36":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{"1":"ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD","36":"E rC GD HD ID JD KD LD MD"},H:{"2":"cD"},I:{"1":"I","36":"PC J dD eD fD gD rC hD iD"},J:{"36":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"36":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD","36":"J jD kD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","33":"wD"}},B:5,C:"::placeholder CSS pseudo-element",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-print-color-adjust.js": -/*!***************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-print-color-adjust.js ***! - \***************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"SB TB I TC IC UC VC","2":"J UB K D E F A B C L M G N","33":"0 1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},L:{"1":"I"},B:{"1":"SB TB I","2":"C L M G N O P","33":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},C:{"1":"0 g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB wC xC","33":"pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"2":"F B C AD BD CD DD JC qC ED KC","33":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},K:{"2":"A B C JC qC KC","33":"H"},E:{"1":"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB yC WC zC 9C","33":"K D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC"},G:{"1":"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","33":"E HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},P:{"33":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{"1":"I","2":"PC J dD eD fD gD rC","33":"hD iD"}},B:6,C:"print-color-adjust property",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-read-only-write.js": -/*!************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-read-only-write.js ***! - \************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C"},C:{"1":"0 HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","16":"tC","33":"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC wC xC"},D:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","16":"J UB K D E F A B C L M","132":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","16":"yC WC","132":"J UB K D E zC 0C 1C"},F:{"1":"0 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","16":"F B AD BD CD DD JC","132":"1 2 3 C G N O P VB qC ED KC"},G:{"1":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","16":"WC FD","132":"E rC GD HD ID JD"},H:{"2":"cD"},I:{"1":"I","16":"dD eD","132":"PC J fD gD rC hD iD"},J:{"1":"A","132":"D"},K:{"1":"H","2":"A B JC","132":"C qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","33":"wD"}},B:1,C:"CSS :read-only and :read-write selectors",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-regions.js": -/*!****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-regions.js ***! - \****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","420":"A B"},B:{"2":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","420":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{"2":"0 J UB K D E F A B C L M cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","36":"G N O P","66":"1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB"},E:{"2":"J UB K C L M G yC WC zC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"D E F A B 0C 1C 2C XC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{"2":"WC FD rC GD HD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"E ID JD KD LD MD ND OD"},H:{"2":"cD"},I:{"2":"PC J I dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"2":"A B C H JC qC KC"},L:{"2":"I"},M:{"2":"IC"},N:{"420":"A B"},O:{"2":"LC"},P:{"2":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"2":"uD"},R:{"2":"vD"},S:{"2":"wD xD"}},B:5,C:"CSS Regions",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-selection.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-selection.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"F A B","2":"K D E sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","33":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC wC xC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"1":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC","2":"F"},G:{"2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"1":"I hD iD","2":"PC J dD eD fD gD rC"},J:{"1":"A","2":"D"},K:{"1":"C H qC KC","16":"A B JC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","33":"wD"}},B:5,C:"::selection CSS pseudo-element",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-shapes.js": -/*!***************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-shapes.js ***! - \***************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB wC xC","322":"sB tB uB vB wB xB yB zB QC 0B RC"},D:{"1":"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB","194":"bB cB dB"},E:{"1":"B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D yC WC zC 0C","33":"E F A 1C 2C"},F:{"1":"0 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 F B C G N O P VB AD BD CD DD JC qC ED KC"},G:{"1":"ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD ID","33":"E JD KD LD MD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","2":"wD"}},B:4,C:"CSS Shapes Level 1",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-snappoints.js": -/*!*******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-snappoints.js ***! - \*******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","6308":"A","6436":"B"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","6436":"C L M G N O P"},C:{"1":"0 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB wC xC","2052":"gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B"},D:{"1":"0 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B","8258":"5B 6B 7B"},E:{"1":"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D E yC WC zC 0C 1C","3108":"F A 2C XC"},F:{"1":"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB AD BD CD DD JC qC ED KC","8258":"vB wB xB yB zB 0B 1B 2B"},G:{"1":"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD","3108":"KD LD MD ND"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 XC oD pD qD rD sD MC NC OC tD","2":"J jD kD lD mD nD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","2052":"wD"}},B:4,C:"CSS Scroll Snap",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-sticky.js": -/*!***************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-sticky.js ***! - \***************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G","1028":"Q H R S T U V W X Y Z","4100":"N O P"},C:{"1":"0 QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 tC PC J UB K D E F A B C L M G N O P VB wC xC","194":"7 8 9 WB XB YB","516":"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB"},D:{"1":"0 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 J UB K D E F A B C L M G N O P VB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB","322":"4 5 6 7 8 9 WB XB YB ZB aB bB cB dB tB uB vB wB","1028":"xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z"},E:{"1":"L M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K yC WC zC","33":"E F A B C 1C 2C XC JC KC","2084":"D 0C"},F:{"1":"0 HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB AD BD CD DD JC qC ED KC","322":"gB hB iB","1028":"jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC"},G:{"1":"SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","33":"E JD KD LD MD ND OD PD QD RD","2084":"HD ID"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J jD"},Q:{"1028":"uD"},R:{"1":"vD"},S:{"1":"xD","516":"wD"}},B:5,C:"CSS position:sticky",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-text-align-last.js": -/*!************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-text-align-last.js ***! - \************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"132":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","4":"C L M G N O P"},C:{"1":"0 qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB K D E F A B wC xC","33":"1 2 3 4 5 6 7 8 9 C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB"},D:{"1":"0 oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB","322":"cB dB eB fB gB hB iB jB kB lB mB nB"},E:{"1":"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C"},F:{"1":"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 F B C G N O P VB AD BD CD DD JC qC ED KC","578":"3 4 5 6 7 8 9 WB XB YB ZB aB"},G:{"1":"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"132":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","33":"wD"}},B:4,C:"CSS3 text-align-last",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-text-orientation.js": -/*!*************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-text-orientation.js ***! - \*************************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB wC xC","194":"fB gB hB"},D:{"1":"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},E:{"1":"M G 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D E F yC WC zC 0C 1C 2C","16":"A","33":"B C L XC JC KC 3C"},F:{"1":"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC"},G:{"1":"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD KD LD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:2,C:"CSS text-orientation",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-text-spacing.js": -/*!*********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-text-spacing.js ***! - \*********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D sC","161":"E F A B"},B:{"2":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","161":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"2":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{"2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"2":"PC J I dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"2":"A B C H JC qC KC"},L:{"2":"I"},M:{"2":"IC"},N:{"16":"A B"},O:{"2":"LC"},P:{"2":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"2":"uD"},R:{"2":"vD"},S:{"2":"wD xD"}},B:5,C:"CSS Text 4 text-spacing",D:false}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-transitions.js": -/*!********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-transitions.js ***! - \********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"A B","2":"K D E F sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC xC","33":"UB K D E F A B C L M G","164":"J"},D:{"1":"0 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 J UB K D E F A B C L M G N O P VB"},E:{"1":"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"K zC","164":"J UB yC WC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F AD BD","33":"C","164":"B CD DD JC qC ED"},G:{"1":"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"HD","164":"WC FD rC GD"},H:{"2":"cD"},I:{"1":"I hD iD","33":"PC J dD eD fD gD rC"},J:{"1":"A","33":"D"},K:{"1":"H KC","33":"C","164":"A B JC qC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:5,C:"CSS3 Transitions",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-width-stretch.js": -/*!**********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-width-stretch.js ***! - \**********************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"I TC IC UC VC","2":"1 2 J UB K D E F A B C L M G N O P VB","33":"0 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},L:{"1":"I"},B:{"1":"I","2":"C L M G N O P","33":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},C:{"2":"tC","33":"0 1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},M:{"33":"IC"},A:{"2":"K D E F A B sC"},F:{"2":"F B C AD BD CD DD JC qC ED KC","33":"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},K:{"2":"A B C JC qC KC","33":"H"},E:{"2":"J UB K yC WC zC 0C 9C","33":"D E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC"},G:{"2":"WC FD rC GD HD","33":"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},P:{"2":"J","33":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{"1":"I","2":"PC J dD eD fD gD rC","33":"hD iD"}},B:6,C:"width: stretch property",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css-writing-mode.js": -/*!*********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css-writing-mode.js ***! - \*********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"132":"K D E F A B sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB wC xC","322":"dB eB fB gB hB"},D:{"1":"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"J UB K","16":"D","33":"1 2 3 4 5 6 7 8 9 E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},E:{"1":"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J yC WC","16":"UB","33":"K D E F A zC 0C 1C 2C XC"},F:{"1":"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB"},G:{"1":"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","16":"WC FD rC","33":"E GD HD ID JD KD LD MD ND"},H:{"2":"cD"},I:{"1":"I","2":"dD eD fD","33":"PC J gD rC hD iD"},J:{"33":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"36":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","33":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:2,C:"CSS writing-mode property",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css3-boxsizing.js": -/*!*******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css3-boxsizing.js ***! - \*******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"E F A B","8":"K D sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","33":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"J UB K D E F"},E:{"1":"K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"J UB yC WC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC","2":"F"},G:{"1":"E GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"WC FD rC"},H:{"1":"cD"},I:{"1":"J I gD rC hD iD","33":"PC dD eD fD"},J:{"1":"A","33":"D"},K:{"1":"A B C H JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:5,C:"CSS3 Box-sizing",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css3-cursors-grab.js": -/*!**********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css3-cursors-grab.js ***! - \**********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M"},C:{"1":"0 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","33":"1 2 3 4 5 6 7 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{"1":"0 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B"},E:{"1":"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"J UB K D E F A yC WC zC 0C 1C 2C XC"},F:{"1":"0 C wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ED KC","2":"F B AD BD CD DD JC qC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},G:{"2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"33":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"2":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"2":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"2":"wD xD"}},B:2,C:"CSS grab & grabbing cursors",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css3-cursors-newer.js": -/*!***********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css3-cursors-newer.js ***! - \***********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","33":"1 2 3 4 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{"1":"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"J UB K D E yC WC zC 0C 1C"},F:{"1":"0 5 6 7 8 9 C WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ED KC","2":"F B AD BD CD DD JC qC","33":"1 2 3 4 G N O P VB"},G:{"2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"33":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"2":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"2":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"2":"wD xD"}},B:2,C:"CSS3 Cursors: zoom-in & zoom-out",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/css3-tabsize.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/css3-tabsize.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC xC","33":"uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z","164":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},D:{"1":"0 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 J UB K D E F A B C L M G N O P VB","132":"2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB"},E:{"1":"M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K yC WC zC","132":"D E F A B C L 0C 1C 2C XC JC KC"},F:{"1":"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F AD BD CD","132":"1 2 3 4 5 6 7 8 9 G N O P VB","164":"B C DD JC qC ED KC"},G:{"1":"VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD","132":"E ID JD KD LD MD ND OD PD QD RD SD TD UD"},H:{"164":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC","132":"hD iD"},J:{"132":"D A"},K:{"1":"H","2":"A","164":"B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"164":"wD xD"}},B:4,C:"CSS3 tab-size",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/flexbox.js": -/*!************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/flexbox.js ***! - \************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","1028":"B","1316":"A"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","164":"1 2 tC PC J UB K D E F A B C L M G N O P VB wC xC","516":"3 4 5 6 7 8"},D:{"1":"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"2 3 4 5 6 7 8 9","164":"1 J UB K D E F A B C L M G N O P VB"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"D E 0C 1C","164":"J UB K yC WC zC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F B C AD BD CD DD JC qC ED","33":"G N"},G:{"1":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"E ID JD","164":"WC FD rC GD HD"},H:{"1":"cD"},I:{"1":"I hD iD","164":"PC J dD eD fD gD rC"},J:{"1":"A","164":"D"},K:{"1":"H KC","2":"A B C JC qC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"B","292":"A"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS Flexible Box Layout Module",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/font-feature.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/font-feature.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"A B","2":"K D E F sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC wC xC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB","164":"J UB K D E F A B C L M"},D:{"1":"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"J UB K D E F A B C L M G","33":"2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB","292":"1 N O P VB"},E:{"1":"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"D E F yC WC 0C 1C","4":"J UB K zC"},F:{"1":"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB"},G:{"1":"LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E ID JD KD","4":"WC FD rC GD HD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC","33":"hD iD"},J:{"2":"D","33":"A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","33":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:2,C:"CSS font-feature-settings",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/font-kerning.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/font-kerning.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 tC PC J UB K D E F A B C L M G N O P VB wC xC","194":"5 6 7 8 9 WB XB YB ZB aB"},D:{"1":"0 aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB","33":"WB XB YB ZB"},E:{"1":"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K yC WC zC 0C","33":"D E F 1C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C G AD BD CD DD JC qC ED KC","33":"N O P VB"},G:{"1":"QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD ID","33":"E JD KD LD MD ND OD PD"},H:{"2":"cD"},I:{"1":"I iD","2":"PC J dD eD fD gD rC","33":"hD"},J:{"2":"D","33":"A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS3 font-kerning",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/fullscreen.js": -/*!***************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/fullscreen.js ***! - \***************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A sC","548":"B"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","516":"C L M G N O P"},C:{"1":"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB K D E F wC xC","676":"1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB","1700":"oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B"},D:{"1":"0 AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"J UB K D E F A B C L M","676":"G N O P VB","804":"1 2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B"},E:{"1":"dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB yC WC","548":"ZC LC 6C MC aC bC cC","676":"zC","804":"K D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC"},F:{"1":"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F B C AD BD CD DD JC qC ED","804":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B"},G:{"2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD","2052":"QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"2":"PC J I dD eD fD gD rC hD iD"},J:{"2":"D","292":"A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A","548":"B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 XC oD pD qD rD sD MC NC OC tD","804":"J jD kD lD mD nD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:1,C:"Fullscreen API",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/intrinsic-width.js": -/*!********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/intrinsic-width.js ***! - \********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"2":"C L M G N O P","1025":"0 d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","1537":"Q H R S T U V W X Y Z a b c"},C:{"2":"tC","932":"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B wC xC","2308":"0 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC"},D:{"2":"1 2 J UB K D E F A B C L M G N O P VB","545":"3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB","1025":"0 d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","1537":"nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c"},E:{"1":"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K yC WC zC","516":"B C L M G JC KC 3C 4C 5C YC ZC LC 6C","548":"F A 2C XC","676":"D E 0C 1C"},F:{"2":"F B C AD BD CD DD JC qC ED KC","513":"bB","545":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB","1025":"0 e f g h i j k l m n o p q r s t u v w x y z","1537":"aB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d"},G:{"1":"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD","516":"WD XD YD YC ZC LC ZD","548":"KD LD MD ND OD PD QD RD SD TD UD VD","676":"E ID JD"},H:{"2":"cD"},I:{"2":"PC J dD eD fD gD rC","545":"hD iD","1025":"I"},J:{"2":"D","545":"A"},K:{"2":"A B C JC qC KC","1025":"H"},L:{"1025":"I"},M:{"2308":"IC"},N:{"2":"A B"},O:{"1537":"LC"},P:{"545":"J","1025":"1 2 3 4 5 6 7 8 9 NC OC tD","1537":"jD kD lD mD nD XC oD pD qD rD sD MC"},Q:{"1537":"uD"},R:{"1537":"vD"},S:{"932":"wD","2308":"xD"}},B:5,C:"Intrinsic & Extrinsic Sizing",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js": -/*!************************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js ***! - \************************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB","33":"ZB aB bB cB dB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","33":"C L M G N O P"},C:{"1":"0 oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB wC xC"},M:{"1":"IC"},A:{"2":"K D E F A sC","33":"B"},F:{"1":"0 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C G N O P AD BD CD DD JC qC ED KC","33":"1 2 3 4 VB"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC 9C"},G:{"1":"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{"1":"I","2":"PC J dD eD fD gD rC","33":"hD iD"}},B:6,C:"CSS ::backdrop pseudo-element",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js ***! - \******************************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB K D E F A B C L M G N wC xC","33":"1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB K yC WC zC 0C 9C","33":"D E F A 1C 2C XC"},G:{"1":"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD","33":"E ID JD KD LD MD ND"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"}},B:6,C:"isolate-override from unicode-bidi",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js ***! - \*********************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"J UB K D E F A B C L M G","33":"1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB K D E F wC xC","33":"1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB yC WC zC 9C","33":"K D E F A 0C 1C 2C XC"},G:{"1":"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","33":"E HD ID JD KD LD MD ND"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"}},B:6,C:"isolate from unicode-bidi",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js ***! - \***********************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB K D E F wC xC","33":"1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB yC WC zC 9C","33":"K D E F A 0C 1C 2C XC"},G:{"1":"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD","33":"E HD ID JD KD LD MD ND"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"}},B:6,C:"plaintext from unicode-bidi",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js": -/*!******************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js ***! - \******************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB wC xC","33":"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB K D yC WC zC 0C 1C 9C","33":"E F A B C 2C XC JC"},G:{"1":"RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD ID","33":"E JD KD LD MD ND OD PD QD"},P:{"1":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J jD kD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration-color property",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js ***! - \*****************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB wC xC","33":"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB K D yC WC zC 0C 1C 9C","33":"E F A B C 2C XC JC"},G:{"1":"RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD ID","33":"E JD KD LD MD ND OD PD QD"},P:{"1":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J jD kD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration-line property",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js ***! - \**********************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB wC xC"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{"1":"H","2":"A B C JC qC KC"},E:{"2":"J UB K D yC WC zC 0C 1C 9C","33":"E F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC"},G:{"2":"WC FD rC GD HD ID","33":"E JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},P:{"1":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J jD kD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration shorthand property",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js": -/*!******************************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js ***! - \******************************************************************************/ -/***/ ((module) => { - -module.exports={A:{D:{"1":"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{"1":"I"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P"},C:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB wC xC","33":"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},M:{"1":"IC"},A:{"2":"K D E F A B sC"},F:{"1":"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{"1":"H","2":"A B C JC qC KC"},E:{"1":"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC","2":"J UB K D yC WC zC 0C 1C 9C","33":"E F A B C 2C XC JC"},G:{"1":"RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD ID","33":"E JD KD LD MD ND OD PD QD"},P:{"1":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J jD kD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration-style property",D:undefined}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/multicolumn.js": -/*!****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/multicolumn.js ***! - \****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"A B","2":"K D E F sC"},B:{"1":"C L M G N O P","516":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"132":"tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B","164":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB wC xC","516":"4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a","1028":"0 b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC"},D:{"420":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB","516":"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"1":"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","132":"F 2C","164":"D E 1C","420":"J UB K yC WC zC 0C"},F:{"1":"C JC qC ED KC","2":"F B AD BD CD DD","420":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB","516":"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"1":"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","132":"KD LD","164":"E ID JD","420":"WC FD rC GD HD"},H:{"1":"cD"},I:{"420":"PC J dD eD fD gD rC hD iD","516":"I"},J:{"420":"D A"},K:{"1":"C JC qC KC","2":"A B","516":"H"},L:{"516":"I"},M:{"1028":"IC"},N:{"1":"A B"},O:{"516":"LC"},P:{"420":"J","516":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"516":"uD"},R:{"516":"vD"},S:{"164":"wD xD"}},B:4,C:"CSS3 Multiple column layout",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/object-fit.js": -/*!***************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/object-fit.js ***! - \***************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G","260":"N O P"},C:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB wC xC"},D:{"1":"0 ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB"},E:{"1":"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K D yC WC zC 0C","132":"E F 1C 2C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F G N O P AD BD CD","33":"B C DD JC qC ED KC"},G:{"1":"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD ID","132":"E JD KD LD"},H:{"33":"cD"},I:{"1":"I iD","2":"PC J dD eD fD gD rC hD"},J:{"2":"D A"},K:{"1":"H","2":"A","33":"B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS3 object-fit/object-position",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/pointer.js": -/*!************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/pointer.js ***! - \************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"B","2":"K D E F sC","164":"A"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB wC xC","8":"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB","328":"iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB"},D:{"1":"0 wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 J UB K D E F A B C L M G N O P VB","8":"3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB","584":"tB uB vB"},E:{"1":"L M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K yC WC zC","8":"D E F A B C 0C 1C 2C XC JC","1096":"KC"},F:{"1":"0 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","8":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB","584":"gB hB iB"},G:{"1":"TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","8":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD","6148":"SD"},H:{"2":"cD"},I:{"1":"I","8":"PC J dD eD fD gD rC hD iD"},J:{"8":"D A"},K:{"1":"H","2":"A","8":"B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"B","36":"A"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"jD","8":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","328":"wD"}},B:2,C:"Pointer events",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/text-decoration.js": -/*!********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/text-decoration.js ***! - \********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"2":"C L M G N O P","2052":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"2":"tC PC J UB wC xC","1028":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","1060":"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},D:{"2":"1 2 3 4 5 6 J UB K D E F A B C L M G N O P VB","226":"7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB","2052":"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"2":"J UB K D yC WC zC 0C","772":"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","804":"E F A B C 2C XC JC","1316":"1C"},F:{"2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC","226":"cB dB eB fB gB hB iB jB kB","2052":"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"2":"WC FD rC GD HD ID","292":"E JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"2":"A B C JC qC KC","2052":"H"},L:{"2052":"I"},M:{"1028":"IC"},N:{"2":"A B"},O:{"2052":"LC"},P:{"2":"J jD kD","2052":"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"2052":"uD"},R:{"2052":"vD"},S:{"1028":"wD xD"}},B:4,C:"text-decoration styling",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/text-emphasis.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/text-emphasis.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","2":"C L M G N O P","164":"Q H R S T U V W X Y Z a b c d e f g h"},C:{"1":"0 nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB wC xC","322":"mB"},D:{"1":"0 i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 J UB K D E F A B C L M G N O P VB","164":"6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h"},E:{"1":"E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"J UB K yC WC zC","164":"D 0C"},F:{"1":"0 V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","164":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U"},G:{"1":"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","2":"WC FD rC GD HD"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC","164":"hD iD"},J:{"2":"D","164":"A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"2":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 OC tD","164":"J jD kD lD mD nD XC oD pD qD rD sD MC NC"},Q:{"164":"uD"},R:{"164":"vD"},S:{"1":"wD xD"}},B:4,C:"text-emphasis styling",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/text-overflow.js": -/*!******************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/text-overflow.js ***! - \******************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"1":"K D E F A B","2":"sC"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","8":"tC PC J UB K wC xC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{"1":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JC qC ED KC","33":"F AD BD CD DD"},G:{"1":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"1":"cD"},I:{"1":"PC J I dD eD fD gD rC hD iD"},J:{"1":"D A"},K:{"1":"H KC","33":"A B C JC qC"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:2,C:"CSS3 Text-overflow",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/text-size-adjust.js": -/*!*********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/text-size-adjust.js ***! - \*********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F A B sC"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","33":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{"1":"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"1 2 3 4 5 6 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB","258":"7"},E:{"2":"J UB K D E F A B C L M G yC WC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","258":"zC"},F:{"1":"0 kB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB lB AD BD CD DD JC qC ED KC"},G:{"2":"WC FD rC","33":"E GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"1":"I","2":"PC J dD eD fD gD rC hD iD"},J:{"2":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"33":"IC"},N:{"161":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD","2":"J"},Q:{"1":"uD"},R:{"1":"vD"},S:{"2":"wD xD"}},B:7,C:"CSS text-size-adjust",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/transforms2d.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/transforms2d.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"sC","8":"K D E","129":"A B","161":"F"},B:{"1":"0 O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","129":"C L M G N"},C:{"1":"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC","33":"J UB K D E F A B C L M G wC xC"},D:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},E:{"1":"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","33":"J UB K D E yC WC zC 0C 1C"},F:{"1":"0 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC","2":"F AD BD","33":"1 2 3 B C G N O P VB CD DD JC qC ED"},G:{"1":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"E WC FD rC GD HD ID JD"},H:{"2":"cD"},I:{"1":"I","33":"PC J dD eD fD gD rC hD iD"},J:{"33":"D A"},K:{"1":"B C H JC qC KC","2":"A"},L:{"1":"I"},M:{"1":"IC"},N:{"1":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:4,C:"CSS3 2D Transforms",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/transforms3d.js": -/*!*****************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/transforms3d.js ***! - \*****************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","132":"A B"},B:{"1":"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","2":"tC PC J UB K D E F wC xC","33":"A B C L M G"},D:{"1":"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","2":"J UB K D E F A B","33":"1 2 3 4 5 6 7 8 9 C L M G N O P VB WB XB YB ZB aB bB cB"},E:{"1":"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C","2":"yC WC","33":"J UB K D E zC 0C 1C","257":"F A B C L M G 2C XC JC KC 3C 4C 5C YC"},F:{"1":"0 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 G N O P VB"},G:{"1":"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC","33":"E WC FD rC GD HD ID JD","257":"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},H:{"2":"cD"},I:{"1":"I","2":"dD eD fD","33":"PC J gD rC hD iD"},J:{"33":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"132":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"wD xD"}},B:5,C:"CSS3 3D Transforms",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/data/features/user-select-none.js": -/*!*********************************************************************!*\ - !*** ./node_modules/caniuse-lite/data/features/user-select-none.js ***! - \*********************************************************************/ -/***/ ((module) => { - -module.exports={A:{A:{"2":"K D E F sC","33":"A B"},B:{"1":"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I","33":"C L M G N O P"},C:{"1":"0 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC","33":"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B wC xC"},D:{"1":"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC","33":"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB"},E:{"33":"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{"1":"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C AD BD CD DD JC qC ED KC","33":"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB"},G:{"33":"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{"2":"cD"},I:{"1":"I","33":"PC J dD eD fD gD rC hD iD"},J:{"33":"D A"},K:{"1":"H","2":"A B C JC qC KC"},L:{"1":"I"},M:{"1":"IC"},N:{"33":"A B"},O:{"1":"LC"},P:{"1":"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD","33":"J jD"},Q:{"1":"uD"},R:{"1":"vD"},S:{"1":"xD","33":"wD"}},B:5,C:"CSS user-select: none",D:true}; - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/lib/statuses.js": -/*!********************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/lib/statuses.js ***! - \********************************************************/ -/***/ ((module) => { - -module.exports = { - 1: 'ls', // WHATWG Living Standard - 2: 'rec', // W3C Recommendation - 3: 'pr', // W3C Proposed Recommendation - 4: 'cr', // W3C Candidate Recommendation - 5: 'wd', // W3C Working Draft - 6: 'other', // Non-W3C, but reputable - 7: 'unoff' // Unofficial, Editor's Draft or W3C "Note" -} - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/lib/supported.js": -/*!*********************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/lib/supported.js ***! - \*********************************************************/ -/***/ ((module) => { - -module.exports = { - y: 1 << 0, - n: 1 << 1, - a: 1 << 2, - p: 1 << 3, - u: 1 << 4, - x: 1 << 5, - d: 1 << 6 -} - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/unpacker/agents.js": -/*!***********************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/unpacker/agents.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const browsers = (__webpack_require__(/*! ./browsers */ "./node_modules/caniuse-lite/dist/unpacker/browsers.js").browsers) -const versions = (__webpack_require__(/*! ./browserVersions */ "./node_modules/caniuse-lite/dist/unpacker/browserVersions.js").browserVersions) -const agentsData = __webpack_require__(/*! ../../data/agents */ "./node_modules/caniuse-lite/data/agents.js") - -function unpackBrowserVersions(versionsData) { - return Object.keys(versionsData).reduce((usage, version) => { - usage[versions[version]] = versionsData[version] - return usage - }, {}) -} - -module.exports.agents = Object.keys(agentsData).reduce((map, key) => { - let versionsData = agentsData[key] - map[browsers[key]] = Object.keys(versionsData).reduce((data, entry) => { - if (entry === 'A') { - data.usage_global = unpackBrowserVersions(versionsData[entry]) - } else if (entry === 'C') { - data.versions = versionsData[entry].reduce((list, version) => { - if (version === '') { - list.push(null) - } else { - list.push(versions[version]) - } - return list - }, []) - } else if (entry === 'D') { - data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]) - } else if (entry === 'E') { - data.browser = versionsData[entry] - } else if (entry === 'F') { - data.release_date = Object.keys(versionsData[entry]).reduce( - (map2, key2) => { - map2[versions[key2]] = versionsData[entry][key2] - return map2 - }, - {} - ) - } else { - // entry is B - data.prefix = versionsData[entry] - } - return data - }, {}) - return map -}, {}) - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/unpacker/browserVersions.js": -/*!********************************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/unpacker/browserVersions.js ***! - \********************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports.browserVersions = __webpack_require__(/*! ../../data/browserVersions */ "./node_modules/caniuse-lite/data/browserVersions.js") - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/unpacker/browsers.js": -/*!*************************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/unpacker/browsers.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports.browsers = __webpack_require__(/*! ../../data/browsers */ "./node_modules/caniuse-lite/data/browsers.js") - - -/***/ }), - -/***/ "./node_modules/caniuse-lite/dist/unpacker/feature.js": -/*!************************************************************!*\ - !*** ./node_modules/caniuse-lite/dist/unpacker/feature.js ***! - \************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const statuses = __webpack_require__(/*! ../lib/statuses */ "./node_modules/caniuse-lite/dist/lib/statuses.js") -const supported = __webpack_require__(/*! ../lib/supported */ "./node_modules/caniuse-lite/dist/lib/supported.js") -const browsers = (__webpack_require__(/*! ./browsers */ "./node_modules/caniuse-lite/dist/unpacker/browsers.js").browsers) -const versions = (__webpack_require__(/*! ./browserVersions */ "./node_modules/caniuse-lite/dist/unpacker/browserVersions.js").browserVersions) - -const MATH2LOG = Math.log(2) - -function unpackSupport(cipher) { - // bit flags - let stats = Object.keys(supported).reduce((list, support) => { - if (cipher & supported[support]) list.push(support) - return list - }, []) - - // notes - let notes = cipher >> 7 - let notesArray = [] - while (notes) { - let note = Math.floor(Math.log(notes) / MATH2LOG) + 1 - notesArray.unshift(`#${note}`) - notes -= Math.pow(2, note - 1) - } - - return stats.concat(notesArray).join(' ') -} - -function unpackFeature(packed) { - let unpacked = { - status: statuses[packed.B], - title: packed.C, - shown: packed.D - } - unpacked.stats = Object.keys(packed.A).reduce((browserStats, key) => { - let browser = packed.A[key] - browserStats[browsers[key]] = Object.keys(browser).reduce( - (stats, support) => { - let packedVersions = browser[support].split(' ') - let unpacked2 = unpackSupport(support) - packedVersions.forEach(v => (stats[versions[v]] = unpacked2)) - return stats - }, - {} - ) - return browserStats - }, {}) - return unpacked -} - -module.exports = unpackFeature -module.exports["default"] = unpackFeature - - -/***/ }), - -/***/ "./node_modules/cssesc/cssesc.js": -/*!***************************************!*\ - !*** ./node_modules/cssesc/cssesc.js ***! - \***************************************/ -/***/ ((module) => { - -"use strict"; -/*! https://mths.be/cssesc v3.0.0 by @mathias */ - - -var object = {}; -var hasOwnProperty = object.hasOwnProperty; -var merge = function merge(options, defaults) { - if (!options) { - return defaults; - } - var result = {}; - for (var key in defaults) { - // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since - // only recognized option names are used. - result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; - } - return result; -}; - -var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; -var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; -var regexAlwaysEscape = /['"\\]/; -var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; - -// https://mathiasbynens.be/notes/css-escapes#css -var cssesc = function cssesc(string, options) { - options = merge(options, cssesc.options); - if (options.quotes != 'single' && options.quotes != 'double') { - options.quotes = 'single'; - } - var quote = options.quotes == 'double' ? '"' : '\''; - var isIdentifier = options.isIdentifier; - - var firstChar = string.charAt(0); - var output = ''; - var counter = 0; - var length = string.length; - while (counter < length) { - var character = string.charAt(counter++); - var codePoint = character.charCodeAt(); - var value = void 0; - // If it’s not a printable ASCII character… - if (codePoint < 0x20 || codePoint > 0x7E) { - if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { - // It’s a high surrogate, and there is a next character. - var extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { - // next character is low surrogate - codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; - } else { - // It’s an unmatched surrogate; only append this code unit, in case - // the next code unit is the high surrogate of a surrogate pair. - counter--; - } - } - value = '\\' + codePoint.toString(16).toUpperCase() + ' '; - } else { - if (options.escapeEverything) { - if (regexAnySingleEscape.test(character)) { - value = '\\' + character; - } else { - value = '\\' + codePoint.toString(16).toUpperCase() + ' '; - } - } else if (/[\t\n\f\r\x0B]/.test(character)) { - value = '\\' + codePoint.toString(16).toUpperCase() + ' '; - } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { - value = '\\' + character; - } else { - value = character; - } - } - output += value; - } - - if (isIdentifier) { - if (/^-[-\d]/.test(output)) { - output = '\\-' + output.slice(1); - } else if (/\d/.test(firstChar)) { - output = '\\3' + firstChar + ' ' + output.slice(1); - } - } - - // Remove spaces after `\HEX` escapes that are not followed by a hex digit, - // since they’re redundant. Note that this is only possible if the escape - // sequence isn’t preceded by an odd number of backslashes. - output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { - if ($1 && $1.length % 2) { - // It’s not safe to remove the space, so don’t. - return $0; - } - // Strip the space. - return ($1 || '') + $2; - }); - - if (!isIdentifier && options.wrap) { - return quote + output + quote; - } - return output; -}; - -// Expose default options (so they can be overridden globally). -cssesc.options = { - 'escapeEverything': false, - 'isIdentifier': false, - 'quotes': 'single', - 'wrap': false -}; - -cssesc.version = '3.0.0'; - -module.exports = cssesc; - - -/***/ }), - -/***/ "./node_modules/electron-to-chromium/versions.js": -/*!*******************************************************!*\ - !*** ./node_modules/electron-to-chromium/versions.js ***! - \*******************************************************/ -/***/ ((module) => { - -module.exports = { - "0.20": "39", - "0.21": "41", - "0.22": "41", - "0.23": "41", - "0.24": "41", - "0.25": "42", - "0.26": "42", - "0.27": "43", - "0.28": "43", - "0.29": "43", - "0.30": "44", - "0.31": "45", - "0.32": "45", - "0.33": "45", - "0.34": "45", - "0.35": "45", - "0.36": "47", - "0.37": "49", - "1.0": "49", - "1.1": "50", - "1.2": "51", - "1.3": "52", - "1.4": "53", - "1.5": "54", - "1.6": "56", - "1.7": "58", - "1.8": "59", - "2.0": "61", - "2.1": "61", - "3.0": "66", - "3.1": "66", - "4.0": "69", - "4.1": "69", - "4.2": "69", - "5.0": "73", - "6.0": "76", - "6.1": "76", - "7.0": "78", - "7.1": "78", - "7.2": "78", - "7.3": "78", - "8.0": "80", - "8.1": "80", - "8.2": "80", - "8.3": "80", - "8.4": "80", - "8.5": "80", - "9.0": "83", - "9.1": "83", - "9.2": "83", - "9.3": "83", - "9.4": "83", - "10.0": "85", - "10.1": "85", - "10.2": "85", - "10.3": "85", - "10.4": "85", - "11.0": "87", - "11.1": "87", - "11.2": "87", - "11.3": "87", - "11.4": "87", - "11.5": "87", - "12.0": "89", - "12.1": "89", - "12.2": "89", - "13.0": "91", - "13.1": "91", - "13.2": "91", - "13.3": "91", - "13.4": "91", - "13.5": "91", - "13.6": "91", - "14.0": "93", - "14.1": "93", - "14.2": "93", - "15.0": "94", - "15.1": "94", - "15.2": "94", - "15.3": "94", - "15.4": "94", - "15.5": "94", - "16.0": "96", - "16.1": "96", - "16.2": "96", - "17.0": "98", - "17.1": "98", - "17.2": "98", - "17.3": "98", - "17.4": "98", - "18.0": "100", - "18.1": "100", - "18.2": "100", - "18.3": "100", - "19.0": "102", - "19.1": "102", - "20.0": "104", - "20.1": "104", - "20.2": "104", - "20.3": "104", - "21.0": "106", - "21.1": "106", - "21.2": "106", - "21.3": "106", - "21.4": "106", - "22.0": "108", - "22.1": "108", - "22.2": "108", - "22.3": "108", - "23.0": "110", - "23.1": "110", - "23.2": "110", - "23.3": "110", - "24.0": "112", - "24.1": "112", - "24.2": "112", - "24.3": "112", - "24.4": "112", - "24.5": "112", - "24.6": "112", - "24.7": "112", - "24.8": "112", - "25.0": "114", - "25.1": "114", - "25.2": "114", - "25.3": "114", - "25.4": "114", - "25.5": "114", - "25.6": "114", - "25.7": "114", - "25.8": "114", - "25.9": "114", - "26.0": "116", - "26.1": "116", - "26.2": "116", - "26.3": "116", - "26.4": "116", - "26.5": "116", - "26.6": "116", - "27.0": "118", - "27.1": "118", - "27.2": "118", - "27.3": "118", - "28.0": "120", - "28.1": "120", - "28.2": "120", - "28.3": "120", - "29.0": "122", - "29.1": "122", - "29.2": "122", - "29.3": "122", - "29.4": "122", - "30.0": "124", - "30.1": "124", - "30.2": "124", - "30.3": "124", - "30.4": "124", - "30.5": "124", - "31.0": "126", - "31.1": "126", - "31.2": "126", - "31.3": "126", - "31.4": "126", - "31.5": "126", - "31.6": "126", - "31.7": "126", - "32.0": "128", - "32.1": "128", - "32.2": "128", - "32.3": "128", - "33.0": "130", - "33.1": "130", - "33.2": "130", - "33.3": "130", - "33.4": "130", - "34.0": "132", - "34.1": "132", - "34.2": "132", - "34.3": "132", - "34.4": "132", - "34.5": "132", - "35.0": "134", - "35.1": "134", - "35.2": "134", - "35.3": "134", - "35.4": "134", - "35.5": "134", - "35.6": "134", - "35.7": "134", - "36.0": "136", - "36.1": "136", - "36.2": "136", - "36.3": "136", - "36.4": "136", - "36.5": "136", - "36.6": "136", - "36.7": "136", - "36.8": "136", - "37.0": "138", - "37.1": "138", - "37.2": "138", - "37.3": "138", - "38.0": "140" -}; - -/***/ }), - -/***/ "./node_modules/fraction.js/fraction.cjs": -/*!***********************************************!*\ - !*** ./node_modules/fraction.js/fraction.cjs ***! - \***********************************************/ -/***/ (function(module, exports) { - -/** - * @license Fraction.js v4.3.7 31/08/2023 - * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ - * - * Copyright (c) 2023, Robert Eisele (robert@raw.org) - * Dual licensed under the MIT or GPL Version 2 licenses. - **/ - - -/** - * - * This class offers the possibility to calculate fractions. - * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. - * - * Array/Object form - * [ 0 => , 1 => ] - * [ n => , d => ] - * - * Integer form - * - Single integer value - * - * Double form - * - Single double value - * - * String form - * 123.456 - a simple double - * 123/456 - a string fraction - * 123.'456' - a double with repeating decimal places - * 123.(456) - synonym - * 123.45'6' - a double with repeating last place - * 123.45(6) - synonym - * - * Example: - * - * var f = new Fraction("9.4'31'"); - * f.mul([-4, 3]).div(4.9); - * - */ - -(function(root) { - - "use strict"; - - // Maximum search depth for cyclic rational numbers. 2000 should be more than enough. - // Example: 1/7 = 0.(142857) has 6 repeating decimal places. - // If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits - var MAX_CYCLE_LEN = 2000; - - // Parsed data to avoid calling "new" all the time - var P = { - "s": 1, - "n": 0, - "d": 1 - }; - - function assign(n, s) { - - if (isNaN(n = parseInt(n, 10))) { - throw InvalidParameter(); - } - return n * s; - } - - // Creates a new Fraction internally without the need of the bulky constructor - function newFraction(n, d) { - - if (d === 0) { - throw DivisionByZero(); - } - - var f = Object.create(Fraction.prototype); - f["s"] = n < 0 ? -1 : 1; - - n = n < 0 ? -n : n; - - var a = gcd(n, d); - - f["n"] = n / a; - f["d"] = d / a; - return f; - } - - function factorize(num) { - - var factors = {}; - - var n = num; - var i = 2; - var s = 4; - - while (s <= n) { - - while (n % i === 0) { - n/= i; - factors[i] = (factors[i] || 0) + 1; - } - s+= 1 + 2 * i++; - } - - if (n !== num) { - if (n > 1) - factors[n] = (factors[n] || 0) + 1; - } else { - factors[num] = (factors[num] || 0) + 1; - } - return factors; - } - - var parse = function(p1, p2) { - - var n = 0, d = 1, s = 1; - var v = 0, w = 0, x = 0, y = 1, z = 1; - - var A = 0, B = 1; - var C = 1, D = 1; - - var N = 10000000; - var M; - - if (p1 === undefined || p1 === null) { - /* void */ - } else if (p2 !== undefined) { - n = p1; - d = p2; - s = n * d; - - if (n % 1 !== 0 || d % 1 !== 0) { - throw NonIntegerParameter(); - } - - } else - switch (typeof p1) { - - case "object": - { - if ("d" in p1 && "n" in p1) { - n = p1["n"]; - d = p1["d"]; - if ("s" in p1) - n*= p1["s"]; - } else if (0 in p1) { - n = p1[0]; - if (1 in p1) - d = p1[1]; - } else { - throw InvalidParameter(); - } - s = n * d; - break; - } - case "number": - { - if (p1 < 0) { - s = p1; - p1 = -p1; - } - - if (p1 % 1 === 0) { - n = p1; - } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow - - if (p1 >= 1) { - z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); - p1/= z; - } - - // Using Farey Sequences - // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/ - - while (B <= N && D <= N) { - M = (A + C) / (B + D); - - if (p1 === M) { - if (B + D <= N) { - n = A + C; - d = B + D; - } else if (D > B) { - n = C; - d = D; - } else { - n = A; - d = B; - } - break; - - } else { - - if (p1 > M) { - A+= C; - B+= D; - } else { - C+= A; - D+= B; - } - - if (B > N) { - n = C; - d = D; - } else { - n = A; - d = B; - } - } - } - n*= z; - } else if (isNaN(p1) || isNaN(p2)) { - d = n = NaN; - } - break; - } - case "string": - { - B = p1.match(/\d+|./g); - - if (B === null) - throw InvalidParameter(); - - if (B[A] === '-') {// Check for minus sign at the beginning - s = -1; - A++; - } else if (B[A] === '+') {// Check for plus sign at the beginning - A++; - } - - if (B.length === A + 1) { // Check if it's just a simple number "1234" - w = assign(B[A++], s); - } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number - - if (B[A] !== '.') { // Handle 0.5 and .5 - v = assign(B[A++], s); - } - A++; - - // Check for decimal places - if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === "'" && B[A + 3] === "'") { - w = assign(B[A], s); - y = Math.pow(10, B[A].length); - A++; - } - - // Check for repeating places - if (B[A] === '(' && B[A + 2] === ')' || B[A] === "'" && B[A + 2] === "'") { - x = assign(B[A + 1], s); - z = Math.pow(10, B[A + 1].length) - 1; - A+= 3; - } - - } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" - w = assign(B[A], s); - y = assign(B[A + 2], 1); - A+= 3; - } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction "123 1/2" - v = assign(B[A], s); - w = assign(B[A + 2], s); - y = assign(B[A + 4], 1); - A+= 5; - } - - if (B.length <= A) { // Check for more tokens on the stack - d = y * z; - s = /* void */ - n = x + d * v + z * w; - break; - } - - /* Fall through on error */ - } - default: - throw InvalidParameter(); - } - - if (d === 0) { - throw DivisionByZero(); - } - - P["s"] = s < 0 ? -1 : 1; - P["n"] = Math.abs(n); - P["d"] = Math.abs(d); - }; - - function modpow(b, e, m) { - - var r = 1; - for (; e > 0; b = (b * b) % m, e >>= 1) { - - if (e & 1) { - r = (r * b) % m; - } - } - return r; - } - - - function cycleLen(n, d) { - - for (; d % 2 === 0; - d/= 2) { - } - - for (; d % 5 === 0; - d/= 5) { - } - - if (d === 1) // Catch non-cyclic numbers - return 0; - - // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: - // 10^(d-1) % d == 1 - // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, - // as we want to translate the numbers to strings. - - var rem = 10 % d; - var t = 1; - - for (; rem !== 1; t++) { - rem = rem * 10 % d; - - if (t > MAX_CYCLE_LEN) - return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` - } - return t; - } - - - function cycleStart(n, d, len) { - - var rem1 = 1; - var rem2 = modpow(10, len, d); - - for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) - // Solve 10^s == 10^(s+t) (mod d) - - if (rem1 === rem2) - return t; - - rem1 = rem1 * 10 % d; - rem2 = rem2 * 10 % d; - } - return 0; - } - - function gcd(a, b) { - - if (!a) - return b; - if (!b) - return a; - - while (1) { - a%= b; - if (!a) - return b; - b%= a; - if (!b) - return a; - } - }; - - /** - * Module constructor - * - * @constructor - * @param {number|Fraction=} a - * @param {number=} b - */ - function Fraction(a, b) { - - parse(a, b); - - if (this instanceof Fraction) { - a = gcd(P["d"], P["n"]); // Abuse variable a - this["s"] = P["s"]; - this["n"] = P["n"] / a; - this["d"] = P["d"] / a; - } else { - return newFraction(P['s'] * P['n'], P['d']); - } - } - - var DivisionByZero = function() { return new Error("Division by Zero"); }; - var InvalidParameter = function() { return new Error("Invalid argument"); }; - var NonIntegerParameter = function() { return new Error("Parameters must be integer"); }; - - Fraction.prototype = { - - "s": 1, - "n": 0, - "d": 1, - - /** - * Calculates the absolute value - * - * Ex: new Fraction(-4).abs() => 4 - **/ - "abs": function() { - - return newFraction(this["n"], this["d"]); - }, - - /** - * Inverts the sign of the current fraction - * - * Ex: new Fraction(-4).neg() => 4 - **/ - "neg": function() { - - return newFraction(-this["s"] * this["n"], this["d"]); - }, - - /** - * Adds two rational numbers - * - * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 - **/ - "add": function(a, b) { - - parse(a, b); - return newFraction( - this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], - this["d"] * P["d"] - ); - }, - - /** - * Subtracts two rational numbers - * - * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 - **/ - "sub": function(a, b) { - - parse(a, b); - return newFraction( - this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], - this["d"] * P["d"] - ); - }, - - /** - * Multiplies two rational numbers - * - * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 - **/ - "mul": function(a, b) { - - parse(a, b); - return newFraction( - this["s"] * P["s"] * this["n"] * P["n"], - this["d"] * P["d"] - ); - }, - - /** - * Divides two rational numbers - * - * Ex: new Fraction("-17.(345)").inverse().div(3) - **/ - "div": function(a, b) { - - parse(a, b); - return newFraction( - this["s"] * P["s"] * this["n"] * P["d"], - this["d"] * P["n"] - ); - }, - - /** - * Clones the actual object - * - * Ex: new Fraction("-17.(345)").clone() - **/ - "clone": function() { - return newFraction(this['s'] * this['n'], this['d']); - }, - - /** - * Calculates the modulo of two rational numbers - a more precise fmod - * - * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) - **/ - "mod": function(a, b) { - - if (isNaN(this['n']) || isNaN(this['d'])) { - return new Fraction(NaN); - } - - if (a === undefined) { - return newFraction(this["s"] * this["n"] % this["d"], 1); - } - - parse(a, b); - if (0 === P["n"] && 0 === this["d"]) { - throw DivisionByZero(); - } - - /* - * First silly attempt, kinda slow - * - return that["sub"]({ - "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), - "d": num["d"], - "s": this["s"] - });*/ - - /* - * New attempt: a1 / b1 = a2 / b2 * q + r - * => b2 * a1 = a2 * b1 * q + b1 * b2 * r - * => (b2 * a1 % a2 * b1) / (b1 * b2) - */ - return newFraction( - this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), - P["d"] * this["d"] - ); - }, - - /** - * Calculates the fractional gcd of two rational numbers - * - * Ex: new Fraction(5,8).gcd(3,7) => 1/56 - */ - "gcd": function(a, b) { - - parse(a, b); - - // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) - - return newFraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); - }, - - /** - * Calculates the fractional lcm of two rational numbers - * - * Ex: new Fraction(5,8).lcm(3,7) => 15 - */ - "lcm": function(a, b) { - - parse(a, b); - - // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) - - if (P["n"] === 0 && this["n"] === 0) { - return newFraction(0, 1); - } - return newFraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); - }, - - /** - * Calculates the ceil of a rational number - * - * Ex: new Fraction('4.(3)').ceil() => (5 / 1) - **/ - "ceil": function(places) { - - places = Math.pow(10, places || 0); - - if (isNaN(this["n"]) || isNaN(this["d"])) { - return new Fraction(NaN); - } - return newFraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); - }, - - /** - * Calculates the floor of a rational number - * - * Ex: new Fraction('4.(3)').floor() => (4 / 1) - **/ - "floor": function(places) { - - places = Math.pow(10, places || 0); - - if (isNaN(this["n"]) || isNaN(this["d"])) { - return new Fraction(NaN); - } - return newFraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); - }, - - /** - * Rounds a rational numbers - * - * Ex: new Fraction('4.(3)').round() => (4 / 1) - **/ - "round": function(places) { - - places = Math.pow(10, places || 0); - - if (isNaN(this["n"]) || isNaN(this["d"])) { - return new Fraction(NaN); - } - return newFraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); - }, - - /** - * Rounds a rational number to a multiple of another rational number - * - * Ex: new Fraction('0.9').roundTo("1/8") => 7 / 8 - **/ - "roundTo": function(a, b) { - - /* - k * x/y ≤ a/b < (k+1) * x/y - ⇔ k ≤ a/b / (x/y) < (k+1) - ⇔ k = floor(a/b * y/x) - */ - - parse(a, b); - - return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']); - }, - - /** - * Gets the inverse of the fraction, means numerator and denominator are exchanged - * - * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 - **/ - "inverse": function() { - - return newFraction(this["s"] * this["d"], this["n"]); - }, - - /** - * Calculates the fraction to some rational exponent, if possible - * - * Ex: new Fraction(-1,2).pow(-3) => -8 - */ - "pow": function(a, b) { - - parse(a, b); - - // Trivial case when exp is an integer - - if (P['d'] === 1) { - - if (P['s'] < 0) { - return newFraction(Math.pow(this['s'] * this["d"], P['n']), Math.pow(this["n"], P['n'])); - } else { - return newFraction(Math.pow(this['s'] * this["n"], P['n']), Math.pow(this["d"], P['n'])); - } - } - - // Negative roots become complex - // (-a/b)^(c/d) = x - // <=> (-1)^(c/d) * (a/b)^(c/d) = x - // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180° - // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index ) - // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case. - if (this['s'] < 0) return null; - - // Now prime factor n and d - var N = factorize(this['n']); - var D = factorize(this['d']); - - // Exponentiate and take root for n and d individually - var n = 1; - var d = 1; - for (var k in N) { - if (k === '1') continue; - if (k === '0') { - n = 0; - break; - } - N[k]*= P['n']; - - if (N[k] % P['d'] === 0) { - N[k]/= P['d']; - } else return null; - n*= Math.pow(k, N[k]); - } - - for (var k in D) { - if (k === '1') continue; - D[k]*= P['n']; - - if (D[k] % P['d'] === 0) { - D[k]/= P['d']; - } else return null; - d*= Math.pow(k, D[k]); - } - - if (P['s'] < 0) { - return newFraction(d, n); - } - return newFraction(n, d); - }, - - /** - * Check if two rational numbers are the same - * - * Ex: new Fraction(19.6).equals([98, 5]); - **/ - "equals": function(a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 - }, - - /** - * Check if two rational numbers are the same - * - * Ex: new Fraction(19.6).equals([98, 5]); - **/ - "compare": function(a, b) { - - parse(a, b); - var t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); - return (0 < t) - (t < 0); - }, - - "simplify": function(eps) { - - if (isNaN(this['n']) || isNaN(this['d'])) { - return this; - } - - eps = eps || 0.001; - - var thisABS = this['abs'](); - var cont = thisABS['toContinued'](); - - for (var i = 1; i < cont.length; i++) { - - var s = newFraction(cont[i - 1], 1); - for (var k = i - 2; k >= 0; k--) { - s = s['inverse']()['add'](cont[k]); - } - - if (Math.abs(s['sub'](thisABS).valueOf()) < eps) { - return s['mul'](this['s']); - } - } - return this; - }, - - /** - * Check if two rational numbers are divisible - * - * Ex: new Fraction(19.6).divisible(1.5); - */ - "divisible": function(a, b) { - - parse(a, b); - return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); - }, - - /** - * Returns a decimal representation of the fraction - * - * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 - **/ - 'valueOf': function() { - - return this["s"] * this["n"] / this["d"]; - }, - - /** - * Returns a string-fraction representation of a Fraction object - * - * Ex: new Fraction("1.'3'").toFraction(true) => "4 1/3" - **/ - 'toFraction': function(excludeWhole) { - - var whole, str = ""; - var n = this["n"]; - var d = this["d"]; - if (this["s"] < 0) { - str+= '-'; - } - - if (d === 1) { - str+= n; - } else { - - if (excludeWhole && (whole = Math.floor(n / d)) > 0) { - str+= whole; - str+= " "; - n%= d; - } - - str+= n; - str+= '/'; - str+= d; - } - return str; - }, - - /** - * Returns a latex representation of a Fraction object - * - * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" - **/ - 'toLatex': function(excludeWhole) { - - var whole, str = ""; - var n = this["n"]; - var d = this["d"]; - if (this["s"] < 0) { - str+= '-'; - } - - if (d === 1) { - str+= n; - } else { - - if (excludeWhole && (whole = Math.floor(n / d)) > 0) { - str+= whole; - n%= d; - } - - str+= "\\frac{"; - str+= n; - str+= '}{'; - str+= d; - str+= '}'; - } - return str; - }, - - /** - * Returns an array of continued fraction elements - * - * Ex: new Fraction("7/8").toContinued() => [0,1,7] - */ - 'toContinued': function() { - - var t; - var a = this['n']; - var b = this['d']; - var res = []; - - if (isNaN(a) || isNaN(b)) { - return res; - } - - do { - res.push(Math.floor(a / b)); - t = a % b; - a = b; - b = t; - } while (a !== 1); - - return res; - }, - - /** - * Creates a string representation of a fraction with all digits - * - * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" - **/ - 'toString': function(dec) { - - var N = this["n"]; - var D = this["d"]; - - if (isNaN(N) || isNaN(D)) { - return "NaN"; - } - - dec = dec || 15; // 15 = decimal places when no repetation - - var cycLen = cycleLen(N, D); // Cycle length - var cycOff = cycleStart(N, D, cycLen); // Cycle start - - var str = this['s'] < 0 ? "-" : ""; - - str+= N / D | 0; - - N%= D; - N*= 10; - - if (N) - str+= "."; - - if (cycLen) { - - for (var i = cycOff; i--;) { - str+= N / D | 0; - N%= D; - N*= 10; - } - str+= "("; - for (var i = cycLen; i--;) { - str+= N / D | 0; - N%= D; - N*= 10; - } - str+= ")"; - } else { - for (var i = dec; N && i--;) { - str+= N / D | 0; - N%= D; - N*= 10; - } - } - return str; - } - }; - - if (true) { - Object.defineProperty(exports, "__esModule", ({ 'value': true })); - exports["default"] = Fraction; - module['exports'] = Fraction; - } else // removed by dead control flow -{} - -})(this); - - -/***/ }), - -/***/ "./node_modules/nanoid/non-secure/index.cjs": -/*!**************************************************!*\ - !*** ./node_modules/nanoid/non-secure/index.cjs ***! - \**************************************************/ -/***/ ((module) => { - -// This alphabet uses `A-Za-z0-9_-` symbols. -// The order of characters is optimized for better gzip and brotli compression. -// References to the same file (works both for gzip and brotli): -// `'use`, `andom`, and `rict'` -// References to the brotli default dictionary: -// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf` -let urlAlphabet = - 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' - -let customAlphabet = (alphabet, defaultSize = 21) => { - return (size = defaultSize) => { - let id = '' - // A compact alternative for `for (var i = 0; i < step; i++)`. - let i = size | 0 - while (i--) { - // `| 0` is more compact and faster than `Math.floor()`. - id += alphabet[(Math.random() * alphabet.length) | 0] - } - return id - } -} - -let nanoid = (size = 21) => { - let id = '' - // A compact alternative for `for (var i = 0; i < step; i++)`. - let i = size | 0 - while (i--) { - // `| 0` is more compact and faster than `Math.floor()`. - id += urlAlphabet[(Math.random() * 64) | 0] - } - return id -} - -module.exports = { nanoid, customAlphabet } - - -/***/ }), - -/***/ "./node_modules/node-releases/data/processed/envs.json": -/*!*************************************************************!*\ - !*** ./node_modules/node-releases/data/processed/envs.json ***! - \*************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = /*#__PURE__*/JSON.parse('[{"name":"nodejs","version":"0.2.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.3.8.0"},{"name":"nodejs","version":"0.3.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.5.1.0"},{"name":"nodejs","version":"0.4.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.2.0"},{"name":"nodejs","version":"0.5.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.8.25"},{"name":"nodejs","version":"0.6.0","date":"2011-11-04","lts":false,"security":false,"v8":"3.6.6.6"},{"name":"nodejs","version":"0.7.0","date":"2012-01-17","lts":false,"security":false,"v8":"3.8.6.0"},{"name":"nodejs","version":"0.8.0","date":"2012-06-22","lts":false,"security":false,"v8":"3.11.10.10"},{"name":"nodejs","version":"0.9.0","date":"2012-07-20","lts":false,"security":false,"v8":"3.11.10.15"},{"name":"nodejs","version":"0.10.0","date":"2013-03-11","lts":false,"security":false,"v8":"3.14.5.8"},{"name":"nodejs","version":"0.11.0","date":"2013-03-28","lts":false,"security":false,"v8":"3.17.13.0"},{"name":"nodejs","version":"0.12.0","date":"2015-02-06","lts":false,"security":false,"v8":"3.28.73.0"},{"name":"nodejs","version":"4.0.0","date":"2015-09-08","lts":false,"security":false,"v8":"4.5.103.30"},{"name":"nodejs","version":"4.1.0","date":"2015-09-17","lts":false,"security":false,"v8":"4.5.103.33"},{"name":"nodejs","version":"4.2.0","date":"2015-10-12","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.3.0","date":"2016-02-09","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.4.0","date":"2016-03-08","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.5.0","date":"2016-08-16","lts":"Argon","security":false,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.6.0","date":"2016-09-27","lts":"Argon","security":true,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.7.0","date":"2016-12-06","lts":"Argon","security":false,"v8":"4.5.103.43"},{"name":"nodejs","version":"4.8.0","date":"2017-02-21","lts":"Argon","security":false,"v8":"4.5.103.45"},{"name":"nodejs","version":"4.9.0","date":"2018-03-28","lts":"Argon","security":true,"v8":"4.5.103.53"},{"name":"nodejs","version":"5.0.0","date":"2015-10-29","lts":false,"security":false,"v8":"4.6.85.28"},{"name":"nodejs","version":"5.1.0","date":"2015-11-17","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.2.0","date":"2015-12-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.3.0","date":"2015-12-15","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.4.0","date":"2016-01-06","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.5.0","date":"2016-01-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.6.0","date":"2016-02-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.7.0","date":"2016-02-23","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.8.0","date":"2016-03-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.9.0","date":"2016-03-16","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.10.0","date":"2016-04-01","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.11.0","date":"2016-04-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.12.0","date":"2016-06-23","lts":false,"security":false,"v8":"4.6.85.32"},{"name":"nodejs","version":"6.0.0","date":"2016-04-26","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.1.0","date":"2016-05-05","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.2.0","date":"2016-05-17","lts":false,"security":false,"v8":"5.0.71.47"},{"name":"nodejs","version":"6.3.0","date":"2016-07-06","lts":false,"security":false,"v8":"5.0.71.52"},{"name":"nodejs","version":"6.4.0","date":"2016-08-12","lts":false,"security":false,"v8":"5.0.71.60"},{"name":"nodejs","version":"6.5.0","date":"2016-08-26","lts":false,"security":false,"v8":"5.1.281.81"},{"name":"nodejs","version":"6.6.0","date":"2016-09-14","lts":false,"security":false,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.7.0","date":"2016-09-27","lts":false,"security":true,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.8.0","date":"2016-10-12","lts":false,"security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.9.0","date":"2016-10-18","lts":"Boron","security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.10.0","date":"2017-02-21","lts":"Boron","security":false,"v8":"5.1.281.93"},{"name":"nodejs","version":"6.11.0","date":"2017-06-06","lts":"Boron","security":false,"v8":"5.1.281.102"},{"name":"nodejs","version":"6.12.0","date":"2017-11-06","lts":"Boron","security":false,"v8":"5.1.281.108"},{"name":"nodejs","version":"6.13.0","date":"2018-02-10","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.14.0","date":"2018-03-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.15.0","date":"2018-11-27","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.16.0","date":"2018-12-26","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.17.0","date":"2019-02-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"7.0.0","date":"2016-10-25","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.1.0","date":"2016-11-08","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.2.0","date":"2016-11-22","lts":false,"security":false,"v8":"5.4.500.43"},{"name":"nodejs","version":"7.3.0","date":"2016-12-20","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.4.0","date":"2017-01-04","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.5.0","date":"2017-01-31","lts":false,"security":false,"v8":"5.4.500.48"},{"name":"nodejs","version":"7.6.0","date":"2017-02-21","lts":false,"security":false,"v8":"5.5.372.40"},{"name":"nodejs","version":"7.7.0","date":"2017-02-28","lts":false,"security":false,"v8":"5.5.372.41"},{"name":"nodejs","version":"7.8.0","date":"2017-03-29","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.9.0","date":"2017-04-11","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.10.0","date":"2017-05-02","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"8.0.0","date":"2017-05-30","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.1.0","date":"2017-06-08","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.2.0","date":"2017-07-19","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.3.0","date":"2017-08-08","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.4.0","date":"2017-08-15","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.5.0","date":"2017-09-12","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.6.0","date":"2017-09-26","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.7.0","date":"2017-10-11","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.8.0","date":"2017-10-24","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.9.0","date":"2017-10-31","lts":"Carbon","security":false,"v8":"6.1.534.46"},{"name":"nodejs","version":"8.10.0","date":"2018-03-06","lts":"Carbon","security":false,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.11.0","date":"2018-03-28","lts":"Carbon","security":true,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.12.0","date":"2018-09-10","lts":"Carbon","security":false,"v8":"6.2.414.66"},{"name":"nodejs","version":"8.13.0","date":"2018-11-20","lts":"Carbon","security":false,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.14.0","date":"2018-11-27","lts":"Carbon","security":true,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.15.0","date":"2018-12-26","lts":"Carbon","security":false,"v8":"6.2.414.75"},{"name":"nodejs","version":"8.16.0","date":"2019-04-16","lts":"Carbon","security":false,"v8":"6.2.414.77"},{"name":"nodejs","version":"8.17.0","date":"2019-12-17","lts":"Carbon","security":true,"v8":"6.2.414.78"},{"name":"nodejs","version":"9.0.0","date":"2017-10-31","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.1.0","date":"2017-11-07","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.2.0","date":"2017-11-14","lts":false,"security":false,"v8":"6.2.414.44"},{"name":"nodejs","version":"9.3.0","date":"2017-12-12","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.4.0","date":"2018-01-10","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.5.0","date":"2018-01-31","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.6.0","date":"2018-02-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.7.0","date":"2018-03-01","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.8.0","date":"2018-03-07","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.9.0","date":"2018-03-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.10.0","date":"2018-03-28","lts":false,"security":true,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.11.0","date":"2018-04-04","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"10.0.0","date":"2018-04-24","lts":false,"security":false,"v8":"6.6.346.24"},{"name":"nodejs","version":"10.1.0","date":"2018-05-08","lts":false,"security":false,"v8":"6.6.346.27"},{"name":"nodejs","version":"10.2.0","date":"2018-05-23","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.3.0","date":"2018-05-29","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.4.0","date":"2018-06-06","lts":false,"security":false,"v8":"6.7.288.43"},{"name":"nodejs","version":"10.5.0","date":"2018-06-20","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.6.0","date":"2018-07-04","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.7.0","date":"2018-07-18","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.8.0","date":"2018-08-01","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.9.0","date":"2018-08-15","lts":false,"security":false,"v8":"6.8.275.24"},{"name":"nodejs","version":"10.10.0","date":"2018-09-06","lts":false,"security":false,"v8":"6.8.275.30"},{"name":"nodejs","version":"10.11.0","date":"2018-09-19","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.12.0","date":"2018-10-10","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.13.0","date":"2018-10-30","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.14.0","date":"2018-11-27","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.15.0","date":"2018-12-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.16.0","date":"2019-05-28","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.17.0","date":"2019-10-22","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.18.0","date":"2019-12-17","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.19.0","date":"2020-02-05","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.20.0","date":"2020-03-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.21.0","date":"2020-06-02","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.22.0","date":"2020-07-21","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.23.0","date":"2020-10-27","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.24.0","date":"2021-02-23","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"11.0.0","date":"2018-10-23","lts":false,"security":false,"v8":"7.0.276.28"},{"name":"nodejs","version":"11.1.0","date":"2018-10-30","lts":false,"security":false,"v8":"7.0.276.32"},{"name":"nodejs","version":"11.2.0","date":"2018-11-15","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.3.0","date":"2018-11-27","lts":false,"security":true,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.4.0","date":"2018-12-07","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.5.0","date":"2018-12-18","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.6.0","date":"2018-12-26","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.7.0","date":"2019-01-17","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.8.0","date":"2019-01-24","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.9.0","date":"2019-01-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.10.0","date":"2019-02-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.11.0","date":"2019-03-05","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.12.0","date":"2019-03-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.13.0","date":"2019-03-28","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.14.0","date":"2019-04-10","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.15.0","date":"2019-04-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"12.0.0","date":"2019-04-23","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.1.0","date":"2019-04-29","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.2.0","date":"2019-05-07","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.3.0","date":"2019-05-21","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.4.0","date":"2019-06-04","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.5.0","date":"2019-06-26","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.6.0","date":"2019-07-03","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.7.0","date":"2019-07-23","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.8.0","date":"2019-08-06","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.9.0","date":"2019-08-20","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.10.0","date":"2019-09-04","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.11.0","date":"2019-09-25","lts":false,"security":false,"v8":"7.7.299.11"},{"name":"nodejs","version":"12.12.0","date":"2019-10-11","lts":false,"security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.13.0","date":"2019-10-21","lts":"Erbium","security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.14.0","date":"2019-12-17","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.15.0","date":"2020-02-05","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.16.0","date":"2020-02-11","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.17.0","date":"2020-05-26","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.18.0","date":"2020-06-02","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.19.0","date":"2020-10-06","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.20.0","date":"2020-11-24","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.21.0","date":"2021-02-23","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.22.0","date":"2021-03-30","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"13.0.0","date":"2019-10-22","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.1.0","date":"2019-11-05","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.2.0","date":"2019-11-21","lts":false,"security":false,"v8":"7.9.317.23"},{"name":"nodejs","version":"13.3.0","date":"2019-12-03","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.4.0","date":"2019-12-17","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.5.0","date":"2019-12-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.6.0","date":"2020-01-07","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.7.0","date":"2020-01-21","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.8.0","date":"2020-02-05","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.9.0","date":"2020-02-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.10.0","date":"2020-03-04","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.11.0","date":"2020-03-12","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.12.0","date":"2020-03-26","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.13.0","date":"2020-04-14","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.14.0","date":"2020-04-29","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"14.0.0","date":"2020-04-21","lts":false,"security":false,"v8":"8.1.307.30"},{"name":"nodejs","version":"14.1.0","date":"2020-04-29","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.2.0","date":"2020-05-05","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.3.0","date":"2020-05-19","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.4.0","date":"2020-06-02","lts":false,"security":true,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.5.0","date":"2020-06-30","lts":false,"security":false,"v8":"8.3.110.9"},{"name":"nodejs","version":"14.6.0","date":"2020-07-20","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.7.0","date":"2020-07-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.8.0","date":"2020-08-11","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.9.0","date":"2020-08-27","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.10.0","date":"2020-09-08","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.11.0","date":"2020-09-15","lts":false,"security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.12.0","date":"2020-09-22","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.13.0","date":"2020-09-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.14.0","date":"2020-10-15","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.15.0","date":"2020-10-27","lts":"Fermium","security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.16.0","date":"2021-02-23","lts":"Fermium","security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.17.0","date":"2021-05-11","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.18.0","date":"2021-09-28","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.19.0","date":"2022-02-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.20.0","date":"2022-07-07","lts":"Fermium","security":true,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.21.0","date":"2022-11-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"15.0.0","date":"2020-10-20","lts":false,"security":false,"v8":"8.6.395.16"},{"name":"nodejs","version":"15.1.0","date":"2020-11-04","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.2.0","date":"2020-11-10","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.3.0","date":"2020-11-24","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.4.0","date":"2020-12-09","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.5.0","date":"2020-12-22","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.6.0","date":"2021-01-14","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.7.0","date":"2021-01-25","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.8.0","date":"2021-02-02","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.9.0","date":"2021-02-18","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.10.0","date":"2021-02-23","lts":false,"security":true,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.11.0","date":"2021-03-03","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.12.0","date":"2021-03-17","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.13.0","date":"2021-03-31","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.14.0","date":"2021-04-06","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"16.0.0","date":"2021-04-20","lts":false,"security":false,"v8":"9.0.257.17"},{"name":"nodejs","version":"16.1.0","date":"2021-05-04","lts":false,"security":false,"v8":"9.0.257.24"},{"name":"nodejs","version":"16.2.0","date":"2021-05-19","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.3.0","date":"2021-06-03","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.4.0","date":"2021-06-23","lts":false,"security":false,"v8":"9.1.269.36"},{"name":"nodejs","version":"16.5.0","date":"2021-07-14","lts":false,"security":false,"v8":"9.1.269.38"},{"name":"nodejs","version":"16.6.0","date":"2021-07-29","lts":false,"security":true,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.7.0","date":"2021-08-18","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.8.0","date":"2021-08-25","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.9.0","date":"2021-09-07","lts":false,"security":false,"v8":"9.3.345.16"},{"name":"nodejs","version":"16.10.0","date":"2021-09-22","lts":false,"security":false,"v8":"9.3.345.19"},{"name":"nodejs","version":"16.11.0","date":"2021-10-08","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.12.0","date":"2021-10-20","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.13.0","date":"2021-10-26","lts":"Gallium","security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.14.0","date":"2022-02-08","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.15.0","date":"2022-04-26","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.16.0","date":"2022-07-07","lts":"Gallium","security":true,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.17.0","date":"2022-08-16","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.18.0","date":"2022-10-12","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.19.0","date":"2022-12-13","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.20.0","date":"2023-03-28","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"17.0.0","date":"2021-10-19","lts":false,"security":false,"v8":"9.5.172.21"},{"name":"nodejs","version":"17.1.0","date":"2021-11-09","lts":false,"security":false,"v8":"9.5.172.25"},{"name":"nodejs","version":"17.2.0","date":"2021-11-30","lts":false,"security":false,"v8":"9.6.180.14"},{"name":"nodejs","version":"17.3.0","date":"2021-12-17","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.4.0","date":"2022-01-18","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.5.0","date":"2022-02-10","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.6.0","date":"2022-02-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.7.0","date":"2022-03-09","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.8.0","date":"2022-03-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.9.0","date":"2022-04-07","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"18.0.0","date":"2022-04-18","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.1.0","date":"2022-05-03","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.2.0","date":"2022-05-17","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.3.0","date":"2022-06-02","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.4.0","date":"2022-06-16","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.5.0","date":"2022-07-06","lts":false,"security":true,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.6.0","date":"2022-07-13","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.7.0","date":"2022-07-26","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.8.0","date":"2022-08-24","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.9.0","date":"2022-09-07","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.10.0","date":"2022-09-28","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.11.0","date":"2022-10-13","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.12.0","date":"2022-10-25","lts":"Hydrogen","security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.13.0","date":"2023-01-05","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.14.0","date":"2023-02-01","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.15.0","date":"2023-03-05","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.16.0","date":"2023-04-12","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.17.0","date":"2023-07-18","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.18.0","date":"2023-09-18","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.19.0","date":"2023-11-29","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.20.0","date":"2024-03-26","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"19.0.0","date":"2022-10-17","lts":false,"security":false,"v8":"10.7.193.13"},{"name":"nodejs","version":"19.1.0","date":"2022-11-14","lts":false,"security":false,"v8":"10.7.193.20"},{"name":"nodejs","version":"19.2.0","date":"2022-11-29","lts":false,"security":false,"v8":"10.8.168.20"},{"name":"nodejs","version":"19.3.0","date":"2022-12-14","lts":false,"security":false,"v8":"10.8.168.21"},{"name":"nodejs","version":"19.4.0","date":"2023-01-05","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.5.0","date":"2023-01-24","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.6.0","date":"2023-02-01","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.7.0","date":"2023-02-21","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.8.0","date":"2023-03-14","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.9.0","date":"2023-04-10","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"20.0.0","date":"2023-04-17","lts":false,"security":false,"v8":"11.3.244.4"},{"name":"nodejs","version":"20.1.0","date":"2023-05-03","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.2.0","date":"2023-05-16","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.3.0","date":"2023-06-08","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.4.0","date":"2023-07-04","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.5.0","date":"2023-07-19","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.6.0","date":"2023-08-23","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.7.0","date":"2023-09-18","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.8.0","date":"2023-09-28","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.9.0","date":"2023-10-24","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.10.0","date":"2023-11-22","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.11.0","date":"2024-01-09","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.12.0","date":"2024-03-26","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.13.0","date":"2024-05-07","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.14.0","date":"2024-05-28","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.15.0","date":"2024-06-20","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.16.0","date":"2024-07-24","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.17.0","date":"2024-08-21","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.18.0","date":"2024-10-03","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"21.0.0","date":"2023-10-17","lts":false,"security":false,"v8":"11.8.172.13"},{"name":"nodejs","version":"21.1.0","date":"2023-10-24","lts":false,"security":false,"v8":"11.8.172.15"},{"name":"nodejs","version":"21.2.0","date":"2023-11-14","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.3.0","date":"2023-11-30","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.4.0","date":"2023-12-05","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.5.0","date":"2023-12-19","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.6.0","date":"2024-01-14","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.7.0","date":"2024-03-06","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"22.0.0","date":"2024-04-24","lts":false,"security":false,"v8":"12.4.254.14"},{"name":"nodejs","version":"22.1.0","date":"2024-05-02","lts":false,"security":false,"v8":"12.4.254.14"},{"name":"nodejs","version":"22.2.0","date":"2024-05-15","lts":false,"security":false,"v8":"12.4.254.14"},{"name":"nodejs","version":"22.3.0","date":"2024-06-11","lts":false,"security":false,"v8":"12.4.254.20"},{"name":"nodejs","version":"22.4.0","date":"2024-07-02","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.5.0","date":"2024-07-17","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.6.0","date":"2024-08-06","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.7.0","date":"2024-08-21","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.8.0","date":"2024-09-03","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.9.0","date":"2024-09-17","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.10.0","date":"2024-10-16","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.11.0","date":"2024-10-29","lts":"Jod","security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.12.0","date":"2024-12-02","lts":"Jod","security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"23.0.0","date":"2024-10-16","lts":false,"security":false,"v8":"12.9.202.26"},{"name":"nodejs","version":"23.1.0","date":"2024-10-24","lts":false,"security":false,"v8":"12.9.202.28"},{"name":"nodejs","version":"23.2.0","date":"2024-11-11","lts":false,"security":false,"v8":"12.9.202.28"},{"name":"nodejs","version":"23.3.0","date":"2024-11-20","lts":false,"security":false,"v8":"12.9.202.28"}]'); - -/***/ }), - -/***/ "./node_modules/node-releases/data/release-schedule/release-schedule.json": -/*!********************************************************************************!*\ - !*** ./node_modules/node-releases/data/release-schedule/release-schedule.json ***! - \********************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = /*#__PURE__*/JSON.parse('{"v0.8":{"start":"2012-06-25","end":"2014-07-31"},"v0.10":{"start":"2013-03-11","end":"2016-10-31"},"v0.12":{"start":"2015-02-06","end":"2016-12-31"},"v4":{"start":"2015-09-08","lts":"2015-10-12","maintenance":"2017-04-01","end":"2018-04-30","codename":"Argon"},"v5":{"start":"2015-10-29","maintenance":"2016-04-30","end":"2016-06-30"},"v6":{"start":"2016-04-26","lts":"2016-10-18","maintenance":"2018-04-30","end":"2019-04-30","codename":"Boron"},"v7":{"start":"2016-10-25","maintenance":"2017-04-30","end":"2017-06-30"},"v8":{"start":"2017-05-30","lts":"2017-10-31","maintenance":"2019-01-01","end":"2019-12-31","codename":"Carbon"},"v9":{"start":"2017-10-01","maintenance":"2018-04-01","end":"2018-06-30"},"v10":{"start":"2018-04-24","lts":"2018-10-30","maintenance":"2020-05-19","end":"2021-04-30","codename":"Dubnium"},"v11":{"start":"2018-10-23","maintenance":"2019-04-22","end":"2019-06-01"},"v12":{"start":"2019-04-23","lts":"2019-10-21","maintenance":"2020-11-30","end":"2022-04-30","codename":"Erbium"},"v13":{"start":"2019-10-22","maintenance":"2020-04-01","end":"2020-06-01"},"v14":{"start":"2020-04-21","lts":"2020-10-27","maintenance":"2021-10-19","end":"2023-04-30","codename":"Fermium"},"v15":{"start":"2020-10-20","maintenance":"2021-04-01","end":"2021-06-01"},"v16":{"start":"2021-04-20","lts":"2021-10-26","maintenance":"2022-10-18","end":"2023-09-11","codename":"Gallium"},"v17":{"start":"2021-10-19","maintenance":"2022-04-01","end":"2022-06-01"},"v18":{"start":"2022-04-19","lts":"2022-10-25","maintenance":"2023-10-18","end":"2025-04-30","codename":"Hydrogen"},"v19":{"start":"2022-10-18","maintenance":"2023-04-01","end":"2023-06-01"},"v20":{"start":"2023-04-18","lts":"2023-10-24","maintenance":"2024-10-22","end":"2026-04-30","codename":"Iron"},"v21":{"start":"2023-10-17","maintenance":"2024-04-01","end":"2024-06-01"},"v22":{"start":"2024-04-24","lts":"2024-10-29","maintenance":"2025-10-21","end":"2027-04-30","codename":"Jod"},"v23":{"start":"2024-10-16","maintenance":"2025-04-01","end":"2025-06-01"},"v24":{"start":"2025-04-22","lts":"2025-10-28","maintenance":"2026-10-20","end":"2028-04-30","codename":""}}'); - -/***/ }), - -/***/ "./node_modules/normalize-range/index.js": -/*!***********************************************!*\ - !*** ./node_modules/normalize-range/index.js ***! - \***********************************************/ -/***/ ((module) => { - -"use strict"; - -module.exports = { - wrap: wrapRange, - limit: limitRange, - validate: validateRange, - test: testRange, - curry: curry, - name: name -}; - -function wrapRange(min, max, value) { - var maxLessMin = max - min; - return ((value - min) % maxLessMin + maxLessMin) % maxLessMin + min; -} - -function limitRange(min, max, value) { - return Math.max(min, Math.min(max, value)); -} - -function validateRange(min, max, value, minExclusive, maxExclusive) { - if (!testRange(min, max, value, minExclusive, maxExclusive)) { - throw new Error(value + ' is outside of range [' + min + ',' + max + ')'); - } - return value; -} - -function testRange(min, max, value, minExclusive, maxExclusive) { - return !( - value < min || - value > max || - (maxExclusive && (value === max)) || - (minExclusive && (value === min)) - ); -} - -function name(min, max, minExcl, maxExcl) { - return (minExcl ? '(' : '[') + min + ',' + max + (maxExcl ? ')' : ']'); -} - -function curry(min, max, minExclusive, maxExclusive) { - var boundNameFn = name.bind(null, min, max, minExclusive, maxExclusive); - return { - wrap: wrapRange.bind(null, min, max), - limit: limitRange.bind(null, min, max), - validate: function(value) { - return validateRange(min, max, value, minExclusive, maxExclusive); - }, - test: function(value) { - return testRange(min, max, value, minExclusive, maxExclusive); - }, - toString: boundNameFn, - name: boundNameFn - }; -} - - -/***/ }), - -/***/ "./node_modules/picocolors/picocolors.browser.js": -/*!*******************************************************!*\ - !*** ./node_modules/picocolors/picocolors.browser.js ***! - \*******************************************************/ -/***/ ((module) => { - -var x=String; -var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}}; -module.exports=create(); -module.exports.createColors = create; - - -/***/ }), - -/***/ "./node_modules/postcss-nested/index.js": -/*!**********************************************!*\ - !*** ./node_modules/postcss-nested/index.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const { AtRule, Rule } = __webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.js") -let parser = __webpack_require__(/*! postcss-selector-parser */ "./node_modules/postcss-selector-parser/dist/index.js") - -/** - * Run a selector string through postcss-selector-parser - */ -function parse(rawSelector, rule) { - let nodes - try { - parser(parsed => { - nodes = parsed - }).processSync(rawSelector) - } catch (e) { - if (rawSelector.includes(':')) { - throw rule ? rule.error('Missed semicolon') : e - } else { - throw rule ? rule.error(e.message) : e - } - } - return nodes.at(0) -} - -/** - * Replaces the "&" token in a node's selector with the parent selector - * similar to what SCSS does. - * - * Mutates the nodes list - */ -function interpolateAmpInSelector(nodes, parent) { - let replaced = false - nodes.each(node => { - if (node.type === 'nesting') { - let clonedParent = parent.clone({}) - if (node.value !== '&') { - node.replaceWith( - parse(node.value.replace('&', clonedParent.toString())) - ) - } else { - node.replaceWith(clonedParent) - } - replaced = true - } else if ('nodes' in node && node.nodes) { - if (interpolateAmpInSelector(node, parent)) { - replaced = true - } - } - }) - return replaced -} - -/** - * Combines parent and child selectors, in a SCSS-like way - */ -function mergeSelectors(parent, child) { - let merged = [] - for (let sel of parent.selectors) { - let parentNode = parse(sel, parent) - - for (let selector of child.selectors) { - if (!selector) { - continue - } - let node = parse(selector, child) - let replaced = interpolateAmpInSelector(node, parentNode) - if (!replaced) { - node.prepend(parser.combinator({ value: ' ' })) - node.prepend(parentNode.clone({})) - } - merged.push(node.toString()) - } - } - return merged -} - -/** - * Move a child and its preceding comment(s) to after "after" - */ -function breakOut(child, currentNode) { - if (child.prev()?.type !== 'comment') { - currentNode.after(child) - return child - } - - let prevNode = child.prev() - - /* Checking that the comment "describes" the rule following. Like this: - /* comment about the rule below *\ - .rule {} - */ - let regexp = /[*]\/ *\n.*{/ - - if (child.parent.toString().match(regexp)) { - currentNode.after(child).after(prevNode) - } - else { - currentNode.after(child) - } - - return child -} - -function createFnAtruleChilds(bubble) { - return function atruleChilds(rule, atrule, bubbling, mergeSels = bubbling) { - let children = [] - atrule.each(child => { - if (child.type === 'rule' && bubbling) { - if (mergeSels) { - child.selectors = mergeSelectors(rule, child) - } - } else if (child.type === 'atrule' && child.nodes) { - if (bubble[child.name]) { - atruleChilds(rule, child, mergeSels) - } else if (atrule[rootRuleMergeSel] !== false) { - children.push(child) - } - } else { - children.push(child) - } - }) - if (bubbling && children.length) { - let clone = rule.clone({ nodes: [] }) - for (let child of children) { - clone.append(child) - } - atrule.prepend(clone) - } - } -} - -function pickDeclarations(selector, declarations, after) { - let parent = new Rule({ - nodes: [], - selector - }) - parent.append(declarations) - after.after(parent) - return parent -} -function pickAndClearDeclarations(ruleSelector, declarations, after, clear = true) { - if (!declarations.length) return [after, declarations] - - after = pickDeclarations(ruleSelector, declarations, after) - - if (clear) { - declarations = [] - } - - return [after, declarations] -} - -function atruleNames(defaults, custom = '') { - let names = defaults.concat(custom) - let list = {} - for (let name of names) { - list[name.replace(/^@/, '')] = true - } - return list -} - -function parseRootRuleParams(params) { - params = params.trim() - let braceBlock = params.match(/^\((.*)\)$/) - if (!braceBlock) { - return { selector: params, type: 'basic' } - } - let bits = braceBlock[1].match(/^(with(?:out)?):(.+)$/) - if (bits) { - let allowlist = bits[1] === 'with' - let rules = Object.fromEntries( - bits[2] - .trim() - .split(/\s+/) - .map(name => [name, true]) - ) - if (allowlist && rules.all) { - return { type: 'noop' } - } - let escapes = rule => !!rules[rule] - if (rules.all) { - escapes = () => true - } else if (allowlist) { - escapes = rule => (rule === 'all' ? false : !rules[rule]) - } - - return { - escapes, - type: 'withrules' - } - } - // Unrecognized brace block - return { type: 'unknown' } -} - -function getAncestorRules(leaf) { - let lineage = [] - let parent = leaf.parent - - while (parent && parent instanceof AtRule) { - lineage.push(parent) - parent = parent.parent - } - return lineage -} - -function unwrapRootRule(rule) { - let escapes = rule[rootRuleEscapes] - - if (!escapes) { - rule.after(rule.nodes) - } else { - let nodes = rule.nodes - - let topEscaped - let topEscapedIdx = -1 - let breakoutLeaf - let breakoutRoot - let clone - - let lineage = getAncestorRules(rule) - lineage.forEach((parent, i) => { - if (escapes(parent.name)) { - topEscaped = parent - topEscapedIdx = i - breakoutRoot = clone - } else { - let oldClone = clone - clone = parent.clone({ nodes: [] }) - oldClone && clone.append(oldClone) - breakoutLeaf = breakoutLeaf || clone - } - }) - - if (!topEscaped) { - rule.after(nodes) - } else if (!breakoutRoot) { - topEscaped.after(nodes) - } else { - let leaf = breakoutLeaf - leaf.append(nodes) - topEscaped.after(breakoutRoot) - } - - if (rule.next() && topEscaped) { - let restRoot - lineage.slice(0, topEscapedIdx + 1).forEach((parent, i, arr) => { - let oldRoot = restRoot - restRoot = parent.clone({ nodes: [] }) - oldRoot && restRoot.append(oldRoot) - - let nextSibs = [] - let _child = arr[i - 1] || rule - let next = _child.next() - while (next) { - nextSibs.push(next) - next = next.next() - } - restRoot.append(nextSibs) - }) - restRoot && (breakoutRoot || nodes[nodes.length - 1]).after(restRoot) - } - } - - rule.remove() -} - -const rootRuleMergeSel = Symbol('rootRuleMergeSel') -const rootRuleEscapes = Symbol('rootRuleEscapes') - -function normalizeRootRule(rule) { - let { params } = rule - let { escapes, selector, type } = parseRootRuleParams(params) - if (type === 'unknown') { - throw rule.error( - `Unknown @${rule.name} parameter ${JSON.stringify(params)}` - ) - } - if (type === 'basic' && selector) { - let selectorBlock = new Rule({ nodes: rule.nodes, selector }) - rule.removeAll() - rule.append(selectorBlock) - } - rule[rootRuleEscapes] = escapes - rule[rootRuleMergeSel] = escapes ? !escapes('all') : type === 'noop' -} - -const hasRootRule = Symbol('hasRootRule') - -module.exports = (opts = {}) => { - let bubble = atruleNames( - ['media', 'supports', 'layer', 'container', 'starting-style'], - opts.bubble - ) - let atruleChilds = createFnAtruleChilds(bubble) - let unwrap = atruleNames( - [ - 'document', - 'font-face', - 'keyframes', - '-webkit-keyframes', - '-moz-keyframes' - ], - opts.unwrap - ) - let rootRuleName = (opts.rootRuleName || 'at-root').replace(/^@/, '') - let preserveEmpty = opts.preserveEmpty - - return { - Once(root) { - root.walkAtRules(rootRuleName, node => { - normalizeRootRule(node) - root[hasRootRule] = true - }) - }, - - postcssPlugin: 'postcss-nested', - - RootExit(root) { - if (!root[hasRootRule]) return - - root.walkAtRules(rootRuleName, unwrapRootRule) - root[hasRootRule] = false - }, - - Rule(rule) { - let unwrapped = false - let after = rule - let copyDeclarations = false - let declarations = [] - - rule.each(child => { - switch (child.type) { - case 'atrule': - [after, declarations] = pickAndClearDeclarations(rule.selector, declarations, after) - - if (child.name === rootRuleName) { - unwrapped = true - atruleChilds(rule, child, true, child[rootRuleMergeSel]) - after = breakOut(child, after) - } else if (bubble[child.name]) { - copyDeclarations = true - unwrapped = true - atruleChilds(rule, child, true) - after = breakOut(child, after) - } else if (unwrap[child.name]) { - copyDeclarations = true - unwrapped = true - atruleChilds(rule, child, false) - after = breakOut(child, after) - } else if (copyDeclarations) { - declarations.push(child) - } - - break - case 'decl': - if (copyDeclarations) { - declarations.push(child) - } - - break - case 'rule': - [after, declarations] = pickAndClearDeclarations(rule.selector, declarations, after) - - copyDeclarations = true - unwrapped = true - child.selectors = mergeSelectors(rule, child) - after = breakOut(child, after) - - break - } - }) - - pickAndClearDeclarations(rule.selector, declarations, after, false) - - if (unwrapped && preserveEmpty !== true) { - rule.raws.semicolon = true - if (rule.nodes.length === 0) rule.remove() - } - } - } -} -module.exports.postcss = true - - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/index.js": -/*!************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/index.js ***! - \************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _processor = _interopRequireDefault(__webpack_require__(/*! ./processor */ "./node_modules/postcss-selector-parser/dist/processor.js")); -var selectors = _interopRequireWildcard(__webpack_require__(/*! ./selectors */ "./node_modules/postcss-selector-parser/dist/selectors/index.js")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var parser = function parser(processor) { - return new _processor["default"](processor); -}; -Object.assign(parser, selectors); -delete parser.__esModule; -var _default = parser; -exports["default"] = _default; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/parser.js": -/*!*************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/parser.js ***! - \*************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _root = _interopRequireDefault(__webpack_require__(/*! ./selectors/root */ "./node_modules/postcss-selector-parser/dist/selectors/root.js")); -var _selector = _interopRequireDefault(__webpack_require__(/*! ./selectors/selector */ "./node_modules/postcss-selector-parser/dist/selectors/selector.js")); -var _className = _interopRequireDefault(__webpack_require__(/*! ./selectors/className */ "./node_modules/postcss-selector-parser/dist/selectors/className.js")); -var _comment = _interopRequireDefault(__webpack_require__(/*! ./selectors/comment */ "./node_modules/postcss-selector-parser/dist/selectors/comment.js")); -var _id = _interopRequireDefault(__webpack_require__(/*! ./selectors/id */ "./node_modules/postcss-selector-parser/dist/selectors/id.js")); -var _tag = _interopRequireDefault(__webpack_require__(/*! ./selectors/tag */ "./node_modules/postcss-selector-parser/dist/selectors/tag.js")); -var _string = _interopRequireDefault(__webpack_require__(/*! ./selectors/string */ "./node_modules/postcss-selector-parser/dist/selectors/string.js")); -var _pseudo = _interopRequireDefault(__webpack_require__(/*! ./selectors/pseudo */ "./node_modules/postcss-selector-parser/dist/selectors/pseudo.js")); -var _attribute = _interopRequireWildcard(__webpack_require__(/*! ./selectors/attribute */ "./node_modules/postcss-selector-parser/dist/selectors/attribute.js")); -var _universal = _interopRequireDefault(__webpack_require__(/*! ./selectors/universal */ "./node_modules/postcss-selector-parser/dist/selectors/universal.js")); -var _combinator = _interopRequireDefault(__webpack_require__(/*! ./selectors/combinator */ "./node_modules/postcss-selector-parser/dist/selectors/combinator.js")); -var _nesting = _interopRequireDefault(__webpack_require__(/*! ./selectors/nesting */ "./node_modules/postcss-selector-parser/dist/selectors/nesting.js")); -var _sortAscending = _interopRequireDefault(__webpack_require__(/*! ./sortAscending */ "./node_modules/postcss-selector-parser/dist/sortAscending.js")); -var _tokenize = _interopRequireWildcard(__webpack_require__(/*! ./tokenize */ "./node_modules/postcss-selector-parser/dist/tokenize.js")); -var tokens = _interopRequireWildcard(__webpack_require__(/*! ./tokenTypes */ "./node_modules/postcss-selector-parser/dist/tokenTypes.js")); -var types = _interopRequireWildcard(__webpack_require__(/*! ./selectors/types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js")); -var _util = __webpack_require__(/*! ./util */ "./node_modules/postcss-selector-parser/dist/util/index.js"); -var _WHITESPACE_TOKENS, _Object$assign; -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); -var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); -function tokenStart(token) { - return { - line: token[_tokenize.FIELDS.START_LINE], - column: token[_tokenize.FIELDS.START_COL] - }; -} -function tokenEnd(token) { - return { - line: token[_tokenize.FIELDS.END_LINE], - column: token[_tokenize.FIELDS.END_COL] - }; -} -function getSource(startLine, startColumn, endLine, endColumn) { - return { - start: { - line: startLine, - column: startColumn - }, - end: { - line: endLine, - column: endColumn - } - }; -} -function getTokenSource(token) { - return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); -} -function getTokenSourceSpan(startToken, endToken) { - if (!startToken) { - return undefined; - } - return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); -} -function unescapeProp(node, prop) { - var value = node[prop]; - if (typeof value !== "string") { - return; - } - if (value.indexOf("\\") !== -1) { - (0, _util.ensureObject)(node, 'raws'); - node[prop] = (0, _util.unesc)(value); - if (node.raws[prop] === undefined) { - node.raws[prop] = value; - } - } - return node; -} -function indexesOf(array, item) { - var i = -1; - var indexes = []; - while ((i = array.indexOf(item, i + 1)) !== -1) { - indexes.push(i); - } - return indexes; -} -function uniqs() { - var list = Array.prototype.concat.apply([], arguments); - return list.filter(function (item, i) { - return i === list.indexOf(item); - }); -} -var Parser = /*#__PURE__*/function () { - function Parser(rule, options) { - if (options === void 0) { - options = {}; - } - this.rule = rule; - this.options = Object.assign({ - lossy: false, - safe: false - }, options); - this.position = 0; - this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; - this.tokens = (0, _tokenize["default"])({ - css: this.css, - error: this._errorGenerator(), - safe: this.options.safe - }); - var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); - this.root = new _root["default"]({ - source: rootSource - }); - this.root.errorGenerator = this._errorGenerator(); - var selector = new _selector["default"]({ - source: { - start: { - line: 1, - column: 1 - } - }, - sourceIndex: 0 - }); - this.root.append(selector); - this.current = selector; - this.loop(); - } - var _proto = Parser.prototype; - _proto._errorGenerator = function _errorGenerator() { - var _this = this; - return function (message, errorOptions) { - if (typeof _this.rule === 'string') { - return new Error(message); - } - return _this.rule.error(message, errorOptions); - }; - }; - _proto.attribute = function attribute() { - var attr = []; - var startingToken = this.currToken; - this.position++; - while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { - attr.push(this.currToken); - this.position++; - } - if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { - return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); - } - var len = attr.length; - var node = { - source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), - sourceIndex: startingToken[_tokenize.FIELDS.START_POS] - }; - if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { - return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); - } - var pos = 0; - var spaceBefore = ''; - var commentBefore = ''; - var lastAdded = null; - var spaceAfterMeaningfulToken = false; - while (pos < len) { - var token = attr[pos]; - var content = this.content(token); - var next = attr[pos + 1]; - switch (token[_tokenize.FIELDS.TYPE]) { - case tokens.space: - // if ( - // len === 1 || - // pos === 0 && this.content(next) === '|' - // ) { - // return this.expected('attribute', token[TOKEN.START_POS], content); - // } - spaceAfterMeaningfulToken = true; - if (this.options.lossy) { - break; - } - if (lastAdded) { - (0, _util.ensureObject)(node, 'spaces', lastAdded); - var prevContent = node.spaces[lastAdded].after || ''; - node.spaces[lastAdded].after = prevContent + content; - var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; - if (existingComment) { - node.raws.spaces[lastAdded].after = existingComment + content; - } - } else { - spaceBefore = spaceBefore + content; - commentBefore = commentBefore + content; - } - break; - case tokens.asterisk: - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { - if (spaceBefore) { - (0, _util.ensureObject)(node, 'spaces', 'attribute'); - node.spaces.attribute.before = spaceBefore; - spaceBefore = ''; - } - if (commentBefore) { - (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); - node.raws.spaces.attribute.before = spaceBefore; - commentBefore = ''; - } - node.namespace = (node.namespace || "") + content; - var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; - if (rawValue) { - node.raws.namespace += content; - } - lastAdded = 'namespace'; - } - spaceAfterMeaningfulToken = false; - break; - case tokens.dollar: - if (lastAdded === "value") { - var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); - node.value += "$"; - if (oldRawValue) { - node.raws.value = oldRawValue + "$"; - } - break; - } - // Falls through - case tokens.caret: - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } - spaceAfterMeaningfulToken = false; - break; - case tokens.combinator: - if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } - if (content !== '|') { - spaceAfterMeaningfulToken = false; - break; - } - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } else if (!node.namespace && !node.attribute) { - node.namespace = true; - } - spaceAfterMeaningfulToken = false; - break; - case tokens.word: - if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && - // this look-ahead probably fails with comment nodes involved. - !node.operator && !node.namespace) { - node.namespace = content; - lastAdded = 'namespace'; - } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { - if (spaceBefore) { - (0, _util.ensureObject)(node, 'spaces', 'attribute'); - node.spaces.attribute.before = spaceBefore; - spaceBefore = ''; - } - if (commentBefore) { - (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); - node.raws.spaces.attribute.before = commentBefore; - commentBefore = ''; - } - node.attribute = (node.attribute || "") + content; - var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; - if (_rawValue) { - node.raws.attribute += content; - } - lastAdded = 'attribute'; - } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { - var _unescaped = (0, _util.unesc)(content); - var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; - var oldValue = node.value || ''; - node.value = oldValue + _unescaped; - node.quoteMark = null; - if (_unescaped !== content || _oldRawValue) { - (0, _util.ensureObject)(node, 'raws'); - node.raws.value = (_oldRawValue || oldValue) + content; - } - lastAdded = 'value'; - } else { - var insensitive = content === 'i' || content === "I"; - if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { - node.insensitive = insensitive; - if (!insensitive || content === "I") { - (0, _util.ensureObject)(node, 'raws'); - node.raws.insensitiveFlag = content; - } - lastAdded = 'insensitive'; - if (spaceBefore) { - (0, _util.ensureObject)(node, 'spaces', 'insensitive'); - node.spaces.insensitive.before = spaceBefore; - spaceBefore = ''; - } - if (commentBefore) { - (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); - node.raws.spaces.insensitive.before = commentBefore; - commentBefore = ''; - } - } else if (node.value || node.value === '') { - lastAdded = 'value'; - node.value += content; - if (node.raws.value) { - node.raws.value += content; - } - } - } - spaceAfterMeaningfulToken = false; - break; - case tokens.str: - if (!node.attribute || !node.operator) { - return this.error("Expected an attribute followed by an operator preceding the string.", { - index: token[_tokenize.FIELDS.START_POS] - }); - } - var _unescapeValue = (0, _attribute.unescapeValue)(content), - unescaped = _unescapeValue.unescaped, - quoteMark = _unescapeValue.quoteMark; - node.value = unescaped; - node.quoteMark = quoteMark; - lastAdded = 'value'; - (0, _util.ensureObject)(node, 'raws'); - node.raws.value = content; - spaceAfterMeaningfulToken = false; - break; - case tokens.equals: - if (!node.attribute) { - return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); - } - if (node.value) { - return this.error('Unexpected "=" found; an operator was already defined.', { - index: token[_tokenize.FIELDS.START_POS] - }); - } - node.operator = node.operator ? node.operator + content : content; - lastAdded = 'operator'; - spaceAfterMeaningfulToken = false; - break; - case tokens.comment: - if (lastAdded) { - if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { - var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; - var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; - (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); - node.raws.spaces[lastAdded].after = rawLastComment + content; - } else { - var lastValue = node[lastAdded] || ''; - var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; - (0, _util.ensureObject)(node, 'raws'); - node.raws[lastAdded] = rawLastValue + content; - } - } else { - commentBefore = commentBefore + content; - } - break; - default: - return this.error("Unexpected \"" + content + "\" found.", { - index: token[_tokenize.FIELDS.START_POS] - }); - } - pos++; - } - unescapeProp(node, "attribute"); - unescapeProp(node, "namespace"); - this.newNode(new _attribute["default"](node)); - this.position++; - } - - /** - * return a node containing meaningless garbage up to (but not including) the specified token position. - * if the token position is negative, all remaining tokens are consumed. - * - * This returns an array containing a single string node if all whitespace, - * otherwise an array of comment nodes with space before and after. - * - * These tokens are not added to the current selector, the caller can add them or use them to amend - * a previous node's space metadata. - * - * In lossy mode, this returns only comments. - */; - _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { - if (stopPosition < 0) { - stopPosition = this.tokens.length; - } - var startPosition = this.position; - var nodes = []; - var space = ""; - var lastComment = undefined; - do { - if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { - if (!this.options.lossy) { - space += this.content(); - } - } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { - var spaces = {}; - if (space) { - spaces.before = space; - space = ""; - } - lastComment = new _comment["default"]({ - value: this.content(), - source: getTokenSource(this.currToken), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], - spaces: spaces - }); - nodes.push(lastComment); - } - } while (++this.position < stopPosition); - if (space) { - if (lastComment) { - lastComment.spaces.after = space; - } else if (!this.options.lossy) { - var firstToken = this.tokens[startPosition]; - var lastToken = this.tokens[this.position - 1]; - nodes.push(new _string["default"]({ - value: '', - source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), - sourceIndex: firstToken[_tokenize.FIELDS.START_POS], - spaces: { - before: space, - after: '' - } - })); - } - } - return nodes; - } - - /** - * - * @param {*} nodes - */; - _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { - var _this2 = this; - if (requiredSpace === void 0) { - requiredSpace = false; - } - var space = ""; - var rawSpace = ""; - nodes.forEach(function (n) { - var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); - var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); - space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); - rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); - }); - if (rawSpace === space) { - rawSpace = undefined; - } - var result = { - space: space, - rawSpace: rawSpace - }; - return result; - }; - _proto.isNamedCombinator = function isNamedCombinator(position) { - if (position === void 0) { - position = this.position; - } - return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; - }; - _proto.namedCombinator = function namedCombinator() { - if (this.isNamedCombinator()) { - var nameRaw = this.content(this.tokens[this.position + 1]); - var name = (0, _util.unesc)(nameRaw).toLowerCase(); - var raws = {}; - if (name !== nameRaw) { - raws.value = "/" + nameRaw + "/"; - } - var node = new _combinator["default"]({ - value: "/" + name + "/", - source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], - raws: raws - }); - this.position = this.position + 3; - return node; - } else { - this.unexpected(); - } - }; - _proto.combinator = function combinator() { - var _this3 = this; - if (this.content() === '|') { - return this.namespace(); - } - // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. - var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); - if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); - if (nodes.length > 0) { - var last = this.current.last; - if (last) { - var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), - space = _this$convertWhitespa.space, - rawSpace = _this$convertWhitespa.rawSpace; - if (rawSpace !== undefined) { - last.rawSpaceAfter += rawSpace; - } - last.spaces.after += space; - } else { - nodes.forEach(function (n) { - return _this3.newNode(n); - }); - } - } - return; - } - var firstToken = this.currToken; - var spaceOrDescendantSelectorNodes = undefined; - if (nextSigTokenPos > this.position) { - spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); - } - var node; - if (this.isNamedCombinator()) { - node = this.namedCombinator(); - } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { - node = new _combinator["default"]({ - value: this.content(), - source: getTokenSource(this.currToken), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] - }); - this.position++; - } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { - // pass - } else if (!spaceOrDescendantSelectorNodes) { - this.unexpected(); - } - if (node) { - if (spaceOrDescendantSelectorNodes) { - var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), - _space = _this$convertWhitespa2.space, - _rawSpace = _this$convertWhitespa2.rawSpace; - node.spaces.before = _space; - node.rawSpaceBefore = _rawSpace; - } - } else { - // descendant combinator - var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), - _space2 = _this$convertWhitespa3.space, - _rawSpace2 = _this$convertWhitespa3.rawSpace; - if (!_rawSpace2) { - _rawSpace2 = _space2; - } - var spaces = {}; - var raws = { - spaces: {} - }; - if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { - spaces.before = _space2.slice(0, _space2.length - 1); - raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); - } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { - spaces.after = _space2.slice(1); - raws.spaces.after = _rawSpace2.slice(1); - } else { - raws.value = _rawSpace2; - } - node = new _combinator["default"]({ - value: ' ', - source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), - sourceIndex: firstToken[_tokenize.FIELDS.START_POS], - spaces: spaces, - raws: raws - }); - } - if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { - node.spaces.after = this.optionalSpace(this.content()); - this.position++; - } - return this.newNode(node); - }; - _proto.comma = function comma() { - if (this.position === this.tokens.length - 1) { - this.root.trailingComma = true; - this.position++; - return; - } - this.current._inferEndPosition(); - var selector = new _selector["default"]({ - source: { - start: tokenStart(this.tokens[this.position + 1]) - }, - sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS] - }); - this.current.parent.append(selector); - this.current = selector; - this.position++; - }; - _proto.comment = function comment() { - var current = this.currToken; - this.newNode(new _comment["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - _proto.error = function error(message, opts) { - throw this.root.error(message, opts); - }; - _proto.missingBackslash = function missingBackslash() { - return this.error('Expected a backslash preceding the semicolon.', { - index: this.currToken[_tokenize.FIELDS.START_POS] - }); - }; - _proto.missingParenthesis = function missingParenthesis() { - return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.missingSquareBracket = function missingSquareBracket() { - return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.unexpected = function unexpected() { - return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.unexpectedPipe = function unexpectedPipe() { - return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.namespace = function namespace() { - var before = this.prevToken && this.content(this.prevToken) || true; - if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { - this.position++; - return this.word(before); - } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { - this.position++; - return this.universal(before); - } - this.unexpectedPipe(); - }; - _proto.nesting = function nesting() { - if (this.nextToken) { - var nextContent = this.content(this.nextToken); - if (nextContent === "|") { - this.position++; - return; - } - } - var current = this.currToken; - this.newNode(new _nesting["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - _proto.parentheses = function parentheses() { - var last = this.current.last; - var unbalanced = 1; - this.position++; - if (last && last.type === types.PSEUDO) { - var selector = new _selector["default"]({ - source: { - start: tokenStart(this.tokens[this.position]) - }, - sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS] - }); - var cache = this.current; - last.append(selector); - this.current = selector; - while (this.position < this.tokens.length && unbalanced) { - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - unbalanced++; - } - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - unbalanced--; - } - if (unbalanced) { - this.parse(); - } else { - this.current.source.end = tokenEnd(this.currToken); - this.current.parent.source.end = tokenEnd(this.currToken); - this.position++; - } - } - this.current = cache; - } else { - // I think this case should be an error. It's used to implement a basic parse of media queries - // but I don't think it's a good idea. - var parenStart = this.currToken; - var parenValue = "("; - var parenEnd; - while (this.position < this.tokens.length && unbalanced) { - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - unbalanced++; - } - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - unbalanced--; - } - parenEnd = this.currToken; - parenValue += this.parseParenthesisToken(this.currToken); - this.position++; - } - if (last) { - last.appendToPropertyAndEscape("value", parenValue, parenValue); - } else { - this.newNode(new _string["default"]({ - value: parenValue, - source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), - sourceIndex: parenStart[_tokenize.FIELDS.START_POS] - })); - } - } - if (unbalanced) { - return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); - } - }; - _proto.pseudo = function pseudo() { - var _this4 = this; - var pseudoStr = ''; - var startingToken = this.currToken; - while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { - pseudoStr += this.content(); - this.position++; - } - if (!this.currToken) { - return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); - } - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { - this.splitWord(false, function (first, length) { - pseudoStr += first; - _this4.newNode(new _pseudo["default"]({ - value: pseudoStr, - source: getTokenSourceSpan(startingToken, _this4.currToken), - sourceIndex: startingToken[_tokenize.FIELDS.START_POS] - })); - if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - _this4.error('Misplaced parenthesis.', { - index: _this4.nextToken[_tokenize.FIELDS.START_POS] - }); - } - }); - } else { - return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); - } - }; - _proto.space = function space() { - var content = this.content(); - // Handle space before and after the selector - if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { - return node.type === 'comment'; - })) { - this.spaces = this.optionalSpace(content); - this.position++; - } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - this.current.last.spaces.after = this.optionalSpace(content); - this.position++; - } else { - this.combinator(); - } - }; - _proto.string = function string() { - var current = this.currToken; - this.newNode(new _string["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - _proto.universal = function universal(namespace) { - var nextToken = this.nextToken; - if (nextToken && this.content(nextToken) === '|') { - this.position++; - return this.namespace(); - } - var current = this.currToken; - this.newNode(new _universal["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - }), namespace); - this.position++; - }; - _proto.splitWord = function splitWord(namespace, firstCallback) { - var _this5 = this; - var nextToken = this.nextToken; - var word = this.content(); - while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { - this.position++; - var current = this.content(); - word += current; - if (current.lastIndexOf('\\') === current.length - 1) { - var next = this.nextToken; - if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { - word += this.requiredSpace(this.content(next)); - this.position++; - } - } - nextToken = this.nextToken; - } - var hasClass = indexesOf(word, '.').filter(function (i) { - // Allow escaped dot within class name - var escapedDot = word[i - 1] === '\\'; - // Allow decimal numbers percent in @keyframes - var isKeyframesPercent = /^\d+\.\d+%$/.test(word); - return !escapedDot && !isKeyframesPercent; - }); - var hasId = indexesOf(word, '#').filter(function (i) { - return word[i - 1] !== '\\'; - }); - // Eliminate Sass interpolations from the list of id indexes - var interpolations = indexesOf(word, '#{'); - if (interpolations.length) { - hasId = hasId.filter(function (hashIndex) { - return !~interpolations.indexOf(hashIndex); - }); - } - var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); - indices.forEach(function (ind, i) { - var index = indices[i + 1] || word.length; - var value = word.slice(ind, index); - if (i === 0 && firstCallback) { - return firstCallback.call(_this5, value, indices.length); - } - var node; - var current = _this5.currToken; - var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; - var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); - if (~hasClass.indexOf(ind)) { - var classNameOpts = { - value: value.slice(1), - source: source, - sourceIndex: sourceIndex - }; - node = new _className["default"](unescapeProp(classNameOpts, "value")); - } else if (~hasId.indexOf(ind)) { - var idOpts = { - value: value.slice(1), - source: source, - sourceIndex: sourceIndex - }; - node = new _id["default"](unescapeProp(idOpts, "value")); - } else { - var tagOpts = { - value: value, - source: source, - sourceIndex: sourceIndex - }; - unescapeProp(tagOpts, "value"); - node = new _tag["default"](tagOpts); - } - _this5.newNode(node, namespace); - // Ensure that the namespace is used only once - namespace = null; - }); - this.position++; - }; - _proto.word = function word(namespace) { - var nextToken = this.nextToken; - if (nextToken && this.content(nextToken) === '|') { - this.position++; - return this.namespace(); - } - return this.splitWord(namespace); - }; - _proto.loop = function loop() { - while (this.position < this.tokens.length) { - this.parse(true); - } - this.current._inferEndPosition(); - return this.root; - }; - _proto.parse = function parse(throwOnParenthesis) { - switch (this.currToken[_tokenize.FIELDS.TYPE]) { - case tokens.space: - this.space(); - break; - case tokens.comment: - this.comment(); - break; - case tokens.openParenthesis: - this.parentheses(); - break; - case tokens.closeParenthesis: - if (throwOnParenthesis) { - this.missingParenthesis(); - } - break; - case tokens.openSquare: - this.attribute(); - break; - case tokens.dollar: - case tokens.caret: - case tokens.equals: - case tokens.word: - this.word(); - break; - case tokens.colon: - this.pseudo(); - break; - case tokens.comma: - this.comma(); - break; - case tokens.asterisk: - this.universal(); - break; - case tokens.ampersand: - this.nesting(); - break; - case tokens.slash: - case tokens.combinator: - this.combinator(); - break; - case tokens.str: - this.string(); - break; - // These cases throw; no break needed. - case tokens.closeSquare: - this.missingSquareBracket(); - case tokens.semicolon: - this.missingBackslash(); - default: - this.unexpected(); - } - } - - /** - * Helpers - */; - _proto.expected = function expected(description, index, found) { - if (Array.isArray(description)) { - var last = description.pop(); - description = description.join(', ') + " or " + last; - } - var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; - if (!found) { - return this.error("Expected " + an + " " + description + ".", { - index: index - }); - } - return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { - index: index - }); - }; - _proto.requiredSpace = function requiredSpace(space) { - return this.options.lossy ? ' ' : space; - }; - _proto.optionalSpace = function optionalSpace(space) { - return this.options.lossy ? '' : space; - }; - _proto.lossySpace = function lossySpace(space, required) { - if (this.options.lossy) { - return required ? ' ' : ''; - } else { - return space; - } - }; - _proto.parseParenthesisToken = function parseParenthesisToken(token) { - var content = this.content(token); - if (token[_tokenize.FIELDS.TYPE] === tokens.space) { - return this.requiredSpace(content); - } else { - return content; - } - }; - _proto.newNode = function newNode(node, namespace) { - if (namespace) { - if (/^ +$/.test(namespace)) { - if (!this.options.lossy) { - this.spaces = (this.spaces || '') + namespace; - } - namespace = true; - } - node.namespace = namespace; - unescapeProp(node, "namespace"); - } - if (this.spaces) { - node.spaces.before = this.spaces; - this.spaces = ''; - } - return this.current.append(node); - }; - _proto.content = function content(token) { - if (token === void 0) { - token = this.currToken; - } - return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); - }; - /** - * returns the index of the next non-whitespace, non-comment token. - * returns -1 if no meaningful token is found. - */ - _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { - if (startPosition === void 0) { - startPosition = this.position + 1; - } - var searchPosition = startPosition; - while (searchPosition < this.tokens.length) { - if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { - searchPosition++; - continue; - } else { - return searchPosition; - } - } - return -1; - }; - _createClass(Parser, [{ - key: "currToken", - get: function get() { - return this.tokens[this.position]; - } - }, { - key: "nextToken", - get: function get() { - return this.tokens[this.position + 1]; - } - }, { - key: "prevToken", - get: function get() { - return this.tokens[this.position - 1]; - } - }]); - return Parser; -}(); -exports["default"] = Parser; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/processor.js": -/*!****************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/processor.js ***! - \****************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _parser = _interopRequireDefault(__webpack_require__(/*! ./parser */ "./node_modules/postcss-selector-parser/dist/parser.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var Processor = /*#__PURE__*/function () { - function Processor(func, options) { - this.func = func || function noop() {}; - this.funcRes = null; - this.options = options; - } - var _proto = Processor.prototype; - _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { - if (options === void 0) { - options = {}; - } - var merged = Object.assign({}, this.options, options); - if (merged.updateSelector === false) { - return false; - } else { - return typeof rule !== "string"; - } - }; - _proto._isLossy = function _isLossy(options) { - if (options === void 0) { - options = {}; - } - var merged = Object.assign({}, this.options, options); - if (merged.lossless === false) { - return true; - } else { - return false; - } - }; - _proto._root = function _root(rule, options) { - if (options === void 0) { - options = {}; - } - var parser = new _parser["default"](rule, this._parseOptions(options)); - return parser.root; - }; - _proto._parseOptions = function _parseOptions(options) { - return { - lossy: this._isLossy(options) - }; - }; - _proto._run = function _run(rule, options) { - var _this = this; - if (options === void 0) { - options = {}; - } - return new Promise(function (resolve, reject) { - try { - var root = _this._root(rule, options); - Promise.resolve(_this.func(root)).then(function (transform) { - var string = undefined; - if (_this._shouldUpdateSelector(rule, options)) { - string = root.toString(); - rule.selector = string; - } - return { - transform: transform, - root: root, - string: string - }; - }).then(resolve, reject); - } catch (e) { - reject(e); - return; - } - }); - }; - _proto._runSync = function _runSync(rule, options) { - if (options === void 0) { - options = {}; - } - var root = this._root(rule, options); - var transform = this.func(root); - if (transform && typeof transform.then === "function") { - throw new Error("Selector processor returned a promise to a synchronous call."); - } - var string = undefined; - if (options.updateSelector && typeof rule !== "string") { - string = root.toString(); - rule.selector = string; - } - return { - transform: transform, - root: root, - string: string - }; - } - - /** - * Process rule into a selector AST. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {Promise} The AST of the selector after processing it. - */; - _proto.ast = function ast(rule, options) { - return this._run(rule, options).then(function (result) { - return result.root; - }); - } - - /** - * Process rule into a selector AST synchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {parser.Root} The AST of the selector after processing it. - */; - _proto.astSync = function astSync(rule, options) { - return this._runSync(rule, options).root; - } - - /** - * Process a selector into a transformed value asynchronously - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {Promise} The value returned by the processor. - */; - _proto.transform = function transform(rule, options) { - return this._run(rule, options).then(function (result) { - return result.transform; - }); - } - - /** - * Process a selector into a transformed value synchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {any} The value returned by the processor. - */; - _proto.transformSync = function transformSync(rule, options) { - return this._runSync(rule, options).transform; - } - - /** - * Process a selector into a new selector string asynchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {string} the selector after processing. - */; - _proto.process = function process(rule, options) { - return this._run(rule, options).then(function (result) { - return result.string || result.root.toString(); - }); - } - - /** - * Process a selector into a new selector string synchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {string} the selector after processing. - */; - _proto.processSync = function processSync(rule, options) { - var result = this._runSync(rule, options); - return result.string || result.root.toString(); - }; - return Processor; -}(); -exports["default"] = Processor; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/attribute.js": -/*!**************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/attribute.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -exports.unescapeValue = unescapeValue; -var _cssesc = _interopRequireDefault(__webpack_require__(/*! cssesc */ "./node_modules/cssesc/cssesc.js")); -var _unesc = _interopRequireDefault(__webpack_require__(/*! ../util/unesc */ "./node_modules/postcss-selector-parser/dist/util/unesc.js")); -var _namespace = _interopRequireDefault(__webpack_require__(/*! ./namespace */ "./node_modules/postcss-selector-parser/dist/selectors/namespace.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -var _CSSESC_QUOTE_OPTIONS; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var deprecate = __webpack_require__(/*! util-deprecate */ "./node_modules/util-deprecate/browser.js"); -var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; -var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); -var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); -var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); -function unescapeValue(value) { - var deprecatedUsage = false; - var quoteMark = null; - var unescaped = value; - var m = unescaped.match(WRAPPED_IN_QUOTES); - if (m) { - quoteMark = m[1]; - unescaped = m[2]; - } - unescaped = (0, _unesc["default"])(unescaped); - if (unescaped !== value) { - deprecatedUsage = true; - } - return { - deprecatedUsage: deprecatedUsage, - unescaped: unescaped, - quoteMark: quoteMark - }; -} -function handleDeprecatedContructorOpts(opts) { - if (opts.quoteMark !== undefined) { - return opts; - } - if (opts.value === undefined) { - return opts; - } - warnOfDeprecatedConstructor(); - var _unescapeValue = unescapeValue(opts.value), - quoteMark = _unescapeValue.quoteMark, - unescaped = _unescapeValue.unescaped; - if (!opts.raws) { - opts.raws = {}; - } - if (opts.raws.value === undefined) { - opts.raws.value = opts.value; - } - opts.value = unescaped; - opts.quoteMark = quoteMark; - return opts; -} -var Attribute = /*#__PURE__*/function (_Namespace) { - _inheritsLoose(Attribute, _Namespace); - function Attribute(opts) { - var _this; - if (opts === void 0) { - opts = {}; - } - _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; - _this.type = _types.ATTRIBUTE; - _this.raws = _this.raws || {}; - Object.defineProperty(_this.raws, 'unquoted', { - get: deprecate(function () { - return _this.value; - }, "attr.raws.unquoted is deprecated. Call attr.value instead."), - set: deprecate(function () { - return _this.value; - }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") - }); - _this._constructed = true; - return _this; - } - - /** - * Returns the Attribute's value quoted such that it would be legal to use - * in the value of a css file. The original value's quotation setting - * used for stringification is left unchanged. See `setValue(value, options)` - * if you want to control the quote settings of a new value for the attribute. - * - * You can also change the quotation used for the current value by setting quoteMark. - * - * Options: - * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this - * option is not set, the original value for quoteMark will be used. If - * indeterminate, a double quote is used. The legal values are: - * * `null` - the value will be unquoted and characters will be escaped as necessary. - * * `'` - the value will be quoted with a single quote and single quotes are escaped. - * * `"` - the value will be quoted with a double quote and double quotes are escaped. - * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark - * over the quoteMark option value. - * * smart {boolean} - if true, will select a quote mark based on the value - * and the other options specified here. See the `smartQuoteMark()` - * method. - **/ - var _proto = Attribute.prototype; - _proto.getQuotedValue = function getQuotedValue(options) { - if (options === void 0) { - options = {}; - } - var quoteMark = this._determineQuoteMark(options); - var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; - var escaped = (0, _cssesc["default"])(this._value, cssescopts); - return escaped; - }; - _proto._determineQuoteMark = function _determineQuoteMark(options) { - return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); - } - - /** - * Set the unescaped value with the specified quotation options. The value - * provided must not include any wrapping quote marks -- those quotes will - * be interpreted as part of the value and escaped accordingly. - */; - _proto.setValue = function setValue(value, options) { - if (options === void 0) { - options = {}; - } - this._value = value; - this._quoteMark = this._determineQuoteMark(options); - this._syncRawValue(); - } - - /** - * Intelligently select a quoteMark value based on the value's contents. If - * the value is a legal CSS ident, it will not be quoted. Otherwise a quote - * mark will be picked that minimizes the number of escapes. - * - * If there's no clear winner, the quote mark from these options is used, - * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is - * true). If the quoteMark is unspecified, a double quote is used. - * - * @param options This takes the quoteMark and preferCurrentQuoteMark options - * from the quoteValue method. - */; - _proto.smartQuoteMark = function smartQuoteMark(options) { - var v = this.value; - var numSingleQuotes = v.replace(/[^']/g, '').length; - var numDoubleQuotes = v.replace(/[^"]/g, '').length; - if (numSingleQuotes + numDoubleQuotes === 0) { - var escaped = (0, _cssesc["default"])(v, { - isIdentifier: true - }); - if (escaped === v) { - return Attribute.NO_QUOTE; - } else { - var pref = this.preferredQuoteMark(options); - if (pref === Attribute.NO_QUOTE) { - // pick a quote mark that isn't none and see if it's smaller - var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; - var opts = CSSESC_QUOTE_OPTIONS[quote]; - var quoteValue = (0, _cssesc["default"])(v, opts); - if (quoteValue.length < escaped.length) { - return quote; - } - } - return pref; - } - } else if (numDoubleQuotes === numSingleQuotes) { - return this.preferredQuoteMark(options); - } else if (numDoubleQuotes < numSingleQuotes) { - return Attribute.DOUBLE_QUOTE; - } else { - return Attribute.SINGLE_QUOTE; - } - } - - /** - * Selects the preferred quote mark based on the options and the current quote mark value. - * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` - * instead. - */; - _proto.preferredQuoteMark = function preferredQuoteMark(options) { - var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; - if (quoteMark === undefined) { - quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; - } - if (quoteMark === undefined) { - quoteMark = Attribute.DOUBLE_QUOTE; - } - return quoteMark; - }; - _proto._syncRawValue = function _syncRawValue() { - var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); - if (rawValue === this._value) { - if (this.raws) { - delete this.raws.value; - } - } else { - this.raws.value = rawValue; - } - }; - _proto._handleEscapes = function _handleEscapes(prop, value) { - if (this._constructed) { - var escaped = (0, _cssesc["default"])(value, { - isIdentifier: true - }); - if (escaped !== value) { - this.raws[prop] = escaped; - } else { - delete this.raws[prop]; - } - } - }; - _proto._spacesFor = function _spacesFor(name) { - var attrSpaces = { - before: '', - after: '' - }; - var spaces = this.spaces[name] || {}; - var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; - return Object.assign(attrSpaces, spaces, rawSpaces); - }; - _proto._stringFor = function _stringFor(name, spaceName, concat) { - if (spaceName === void 0) { - spaceName = name; - } - if (concat === void 0) { - concat = defaultAttrConcat; - } - var attrSpaces = this._spacesFor(spaceName); - return concat(this.stringifyProperty(name), attrSpaces); - } - - /** - * returns the offset of the attribute part specified relative to the - * start of the node of the output string. - * - * * "ns" - alias for "namespace" - * * "namespace" - the namespace if it exists. - * * "attribute" - the attribute name - * * "attributeNS" - the start of the attribute or its namespace - * * "operator" - the match operator of the attribute - * * "value" - The value (string or identifier) - * * "insensitive" - the case insensitivity flag; - * @param part One of the possible values inside an attribute. - * @returns -1 if the name is invalid or the value doesn't exist in this attribute. - */; - _proto.offsetOf = function offsetOf(name) { - var count = 1; - var attributeSpaces = this._spacesFor("attribute"); - count += attributeSpaces.before.length; - if (name === "namespace" || name === "ns") { - return this.namespace ? count : -1; - } - if (name === "attributeNS") { - return count; - } - count += this.namespaceString.length; - if (this.namespace) { - count += 1; - } - if (name === "attribute") { - return count; - } - count += this.stringifyProperty("attribute").length; - count += attributeSpaces.after.length; - var operatorSpaces = this._spacesFor("operator"); - count += operatorSpaces.before.length; - var operator = this.stringifyProperty("operator"); - if (name === "operator") { - return operator ? count : -1; - } - count += operator.length; - count += operatorSpaces.after.length; - var valueSpaces = this._spacesFor("value"); - count += valueSpaces.before.length; - var value = this.stringifyProperty("value"); - if (name === "value") { - return value ? count : -1; - } - count += value.length; - count += valueSpaces.after.length; - var insensitiveSpaces = this._spacesFor("insensitive"); - count += insensitiveSpaces.before.length; - if (name === "insensitive") { - return this.insensitive ? count : -1; - } - return -1; - }; - _proto.toString = function toString() { - var _this2 = this; - var selector = [this.rawSpaceBefore, '[']; - selector.push(this._stringFor('qualifiedAttribute', 'attribute')); - if (this.operator && (this.value || this.value === '')) { - selector.push(this._stringFor('operator')); - selector.push(this._stringFor('value')); - selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { - if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { - attrSpaces.before = " "; - } - return defaultAttrConcat(attrValue, attrSpaces); - })); - } - selector.push(']'); - selector.push(this.rawSpaceAfter); - return selector.join(''); - }; - _createClass(Attribute, [{ - key: "quoted", - get: function get() { - var qm = this.quoteMark; - return qm === "'" || qm === '"'; - }, - set: function set(value) { - warnOfDeprecatedQuotedAssignment(); - } - - /** - * returns a single (`'`) or double (`"`) quote character if the value is quoted. - * returns `null` if the value is not quoted. - * returns `undefined` if the quotation state is unknown (this can happen when - * the attribute is constructed without specifying a quote mark.) - */ - }, { - key: "quoteMark", - get: function get() { - return this._quoteMark; - } - - /** - * Set the quote mark to be used by this attribute's value. - * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute - * value is updated accordingly. - * - * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. - */, - set: function set(quoteMark) { - if (!this._constructed) { - this._quoteMark = quoteMark; - return; - } - if (this._quoteMark !== quoteMark) { - this._quoteMark = quoteMark; - this._syncRawValue(); - } - } - }, { - key: "qualifiedAttribute", - get: function get() { - return this.qualifiedName(this.raws.attribute || this.attribute); - } - }, { - key: "insensitiveFlag", - get: function get() { - return this.insensitive ? 'i' : ''; - } - }, { - key: "value", - get: function get() { - return this._value; - }, - set: - /** - * Before 3.0, the value had to be set to an escaped value including any wrapped - * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value - * is unescaped during parsing and any quote marks are removed. - * - * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, - * a deprecation warning is raised when the new value contains any characters that would - * require escaping (including if it contains wrapped quotes). - * - * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe - * how the new value is quoted. - */ - function set(v) { - if (this._constructed) { - var _unescapeValue2 = unescapeValue(v), - deprecatedUsage = _unescapeValue2.deprecatedUsage, - unescaped = _unescapeValue2.unescaped, - quoteMark = _unescapeValue2.quoteMark; - if (deprecatedUsage) { - warnOfDeprecatedValueAssignment(); - } - if (unescaped === this._value && quoteMark === this._quoteMark) { - return; - } - this._value = unescaped; - this._quoteMark = quoteMark; - this._syncRawValue(); - } else { - this._value = v; - } - } - }, { - key: "insensitive", - get: function get() { - return this._insensitive; - } - - /** - * Set the case insensitive flag. - * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag` - * of the attribute is updated accordingly. - * - * @param {true | false} insensitive true if the attribute should match case-insensitively. - */, - set: function set(insensitive) { - if (!insensitive) { - this._insensitive = false; - - // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation. - // When setting `attr.insensitive = false` both should be erased to ensure correct serialization. - if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) { - this.raws.insensitiveFlag = undefined; - } - } - this._insensitive = insensitive; - } - }, { - key: "attribute", - get: function get() { - return this._attribute; - }, - set: function set(name) { - this._handleEscapes("attribute", name); - this._attribute = name; - } - }]); - return Attribute; -}(_namespace["default"]); -exports["default"] = Attribute; -Attribute.NO_QUOTE = null; -Attribute.SINGLE_QUOTE = "'"; -Attribute.DOUBLE_QUOTE = '"'; -var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { - "'": { - quotes: 'single', - wrap: true - }, - '"': { - quotes: 'double', - wrap: true - } -}, _CSSESC_QUOTE_OPTIONS[null] = { - isIdentifier: true -}, _CSSESC_QUOTE_OPTIONS); -function defaultAttrConcat(attrValue, attrSpaces) { - return "" + attrSpaces.before + attrValue + attrSpaces.after; -} - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/className.js": -/*!**************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/className.js ***! - \**************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _cssesc = _interopRequireDefault(__webpack_require__(/*! cssesc */ "./node_modules/cssesc/cssesc.js")); -var _util = __webpack_require__(/*! ../util */ "./node_modules/postcss-selector-parser/dist/util/index.js"); -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var ClassName = /*#__PURE__*/function (_Node) { - _inheritsLoose(ClassName, _Node); - function ClassName(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.CLASS; - _this._constructed = true; - return _this; - } - var _proto = ClassName.prototype; - _proto.valueToString = function valueToString() { - return '.' + _Node.prototype.valueToString.call(this); - }; - _createClass(ClassName, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(v) { - if (this._constructed) { - var escaped = (0, _cssesc["default"])(v, { - isIdentifier: true - }); - if (escaped !== v) { - (0, _util.ensureObject)(this, "raws"); - this.raws.value = escaped; - } else if (this.raws) { - delete this.raws.value; - } - } - this._value = v; - } - }]); - return ClassName; -}(_node["default"]); -exports["default"] = ClassName; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/combinator.js": -/*!***************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/combinator.js ***! - \***************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Combinator = /*#__PURE__*/function (_Node) { - _inheritsLoose(Combinator, _Node); - function Combinator(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.COMBINATOR; - return _this; - } - return Combinator; -}(_node["default"]); -exports["default"] = Combinator; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/comment.js": -/*!************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/comment.js ***! - \************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Comment = /*#__PURE__*/function (_Node) { - _inheritsLoose(Comment, _Node); - function Comment(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.COMMENT; - return _this; - } - return Comment; -}(_node["default"]); -exports["default"] = Comment; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/constructors.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/constructors.js ***! - \*****************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0; -var _attribute = _interopRequireDefault(__webpack_require__(/*! ./attribute */ "./node_modules/postcss-selector-parser/dist/selectors/attribute.js")); -var _className = _interopRequireDefault(__webpack_require__(/*! ./className */ "./node_modules/postcss-selector-parser/dist/selectors/className.js")); -var _combinator = _interopRequireDefault(__webpack_require__(/*! ./combinator */ "./node_modules/postcss-selector-parser/dist/selectors/combinator.js")); -var _comment = _interopRequireDefault(__webpack_require__(/*! ./comment */ "./node_modules/postcss-selector-parser/dist/selectors/comment.js")); -var _id = _interopRequireDefault(__webpack_require__(/*! ./id */ "./node_modules/postcss-selector-parser/dist/selectors/id.js")); -var _nesting = _interopRequireDefault(__webpack_require__(/*! ./nesting */ "./node_modules/postcss-selector-parser/dist/selectors/nesting.js")); -var _pseudo = _interopRequireDefault(__webpack_require__(/*! ./pseudo */ "./node_modules/postcss-selector-parser/dist/selectors/pseudo.js")); -var _root = _interopRequireDefault(__webpack_require__(/*! ./root */ "./node_modules/postcss-selector-parser/dist/selectors/root.js")); -var _selector = _interopRequireDefault(__webpack_require__(/*! ./selector */ "./node_modules/postcss-selector-parser/dist/selectors/selector.js")); -var _string = _interopRequireDefault(__webpack_require__(/*! ./string */ "./node_modules/postcss-selector-parser/dist/selectors/string.js")); -var _tag = _interopRequireDefault(__webpack_require__(/*! ./tag */ "./node_modules/postcss-selector-parser/dist/selectors/tag.js")); -var _universal = _interopRequireDefault(__webpack_require__(/*! ./universal */ "./node_modules/postcss-selector-parser/dist/selectors/universal.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var attribute = function attribute(opts) { - return new _attribute["default"](opts); -}; -exports.attribute = attribute; -var className = function className(opts) { - return new _className["default"](opts); -}; -exports.className = className; -var combinator = function combinator(opts) { - return new _combinator["default"](opts); -}; -exports.combinator = combinator; -var comment = function comment(opts) { - return new _comment["default"](opts); -}; -exports.comment = comment; -var id = function id(opts) { - return new _id["default"](opts); -}; -exports.id = id; -var nesting = function nesting(opts) { - return new _nesting["default"](opts); -}; -exports.nesting = nesting; -var pseudo = function pseudo(opts) { - return new _pseudo["default"](opts); -}; -exports.pseudo = pseudo; -var root = function root(opts) { - return new _root["default"](opts); -}; -exports.root = root; -var selector = function selector(opts) { - return new _selector["default"](opts); -}; -exports.selector = selector; -var string = function string(opts) { - return new _string["default"](opts); -}; -exports.string = string; -var tag = function tag(opts) { - return new _tag["default"](opts); -}; -exports.tag = tag; -var universal = function universal(opts) { - return new _universal["default"](opts); -}; -exports.universal = universal; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/container.js": -/*!**************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/container.js ***! - \**************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -var types = _interopRequireWildcard(__webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Container = /*#__PURE__*/function (_Node) { - _inheritsLoose(Container, _Node); - function Container(opts) { - var _this; - _this = _Node.call(this, opts) || this; - if (!_this.nodes) { - _this.nodes = []; - } - return _this; - } - var _proto = Container.prototype; - _proto.append = function append(selector) { - selector.parent = this; - this.nodes.push(selector); - return this; - }; - _proto.prepend = function prepend(selector) { - selector.parent = this; - this.nodes.unshift(selector); - for (var id in this.indexes) { - this.indexes[id]++; - } - return this; - }; - _proto.at = function at(index) { - return this.nodes[index]; - }; - _proto.index = function index(child) { - if (typeof child === 'number') { - return child; - } - return this.nodes.indexOf(child); - }; - _proto.removeChild = function removeChild(child) { - child = this.index(child); - this.at(child).parent = undefined; - this.nodes.splice(child, 1); - var index; - for (var id in this.indexes) { - index = this.indexes[id]; - if (index >= child) { - this.indexes[id] = index - 1; - } - } - return this; - }; - _proto.removeAll = function removeAll() { - for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { - var node = _step.value; - node.parent = undefined; - } - this.nodes = []; - return this; - }; - _proto.empty = function empty() { - return this.removeAll(); - }; - _proto.insertAfter = function insertAfter(oldNode, newNode) { - var _this$nodes; - newNode.parent = this; - var oldIndex = this.index(oldNode); - var resetNode = []; - for (var i = 2; i < arguments.length; i++) { - resetNode.push(arguments[i]); - } - (_this$nodes = this.nodes).splice.apply(_this$nodes, [oldIndex + 1, 0, newNode].concat(resetNode)); - newNode.parent = this; - var index; - for (var id in this.indexes) { - index = this.indexes[id]; - if (oldIndex < index) { - this.indexes[id] = index + arguments.length - 1; - } - } - return this; - }; - _proto.insertBefore = function insertBefore(oldNode, newNode) { - var _this$nodes2; - newNode.parent = this; - var oldIndex = this.index(oldNode); - var resetNode = []; - for (var i = 2; i < arguments.length; i++) { - resetNode.push(arguments[i]); - } - (_this$nodes2 = this.nodes).splice.apply(_this$nodes2, [oldIndex, 0, newNode].concat(resetNode)); - newNode.parent = this; - var index; - for (var id in this.indexes) { - index = this.indexes[id]; - if (index >= oldIndex) { - this.indexes[id] = index + arguments.length - 1; - } - } - return this; - }; - _proto._findChildAtPosition = function _findChildAtPosition(line, col) { - var found = undefined; - this.each(function (node) { - if (node.atPosition) { - var foundChild = node.atPosition(line, col); - if (foundChild) { - found = foundChild; - return false; - } - } else if (node.isAtPosition(line, col)) { - found = node; - return false; - } - }); - return found; - } - - /** - * Return the most specific node at the line and column number given. - * The source location is based on the original parsed location, locations aren't - * updated as selector nodes are mutated. - * - * Note that this location is relative to the location of the first character - * of the selector, and not the location of the selector in the overall document - * when used in conjunction with postcss. - * - * If not found, returns undefined. - * @param {number} line The line number of the node to find. (1-based index) - * @param {number} col The column number of the node to find. (1-based index) - */; - _proto.atPosition = function atPosition(line, col) { - if (this.isAtPosition(line, col)) { - return this._findChildAtPosition(line, col) || this; - } else { - return undefined; - } - }; - _proto._inferEndPosition = function _inferEndPosition() { - if (this.last && this.last.source && this.last.source.end) { - this.source = this.source || {}; - this.source.end = this.source.end || {}; - Object.assign(this.source.end, this.last.source.end); - } - }; - _proto.each = function each(callback) { - if (!this.lastEach) { - this.lastEach = 0; - } - if (!this.indexes) { - this.indexes = {}; - } - this.lastEach++; - var id = this.lastEach; - this.indexes[id] = 0; - if (!this.length) { - return undefined; - } - var index, result; - while (this.indexes[id] < this.length) { - index = this.indexes[id]; - result = callback(this.at(index), index); - if (result === false) { - break; - } - this.indexes[id] += 1; - } - delete this.indexes[id]; - if (result === false) { - return false; - } - }; - _proto.walk = function walk(callback) { - return this.each(function (node, i) { - var result = callback(node, i); - if (result !== false && node.length) { - result = node.walk(callback); - } - if (result === false) { - return false; - } - }); - }; - _proto.walkAttributes = function walkAttributes(callback) { - var _this2 = this; - return this.walk(function (selector) { - if (selector.type === types.ATTRIBUTE) { - return callback.call(_this2, selector); - } - }); - }; - _proto.walkClasses = function walkClasses(callback) { - var _this3 = this; - return this.walk(function (selector) { - if (selector.type === types.CLASS) { - return callback.call(_this3, selector); - } - }); - }; - _proto.walkCombinators = function walkCombinators(callback) { - var _this4 = this; - return this.walk(function (selector) { - if (selector.type === types.COMBINATOR) { - return callback.call(_this4, selector); - } - }); - }; - _proto.walkComments = function walkComments(callback) { - var _this5 = this; - return this.walk(function (selector) { - if (selector.type === types.COMMENT) { - return callback.call(_this5, selector); - } - }); - }; - _proto.walkIds = function walkIds(callback) { - var _this6 = this; - return this.walk(function (selector) { - if (selector.type === types.ID) { - return callback.call(_this6, selector); - } - }); - }; - _proto.walkNesting = function walkNesting(callback) { - var _this7 = this; - return this.walk(function (selector) { - if (selector.type === types.NESTING) { - return callback.call(_this7, selector); - } - }); - }; - _proto.walkPseudos = function walkPseudos(callback) { - var _this8 = this; - return this.walk(function (selector) { - if (selector.type === types.PSEUDO) { - return callback.call(_this8, selector); - } - }); - }; - _proto.walkTags = function walkTags(callback) { - var _this9 = this; - return this.walk(function (selector) { - if (selector.type === types.TAG) { - return callback.call(_this9, selector); - } - }); - }; - _proto.walkUniversals = function walkUniversals(callback) { - var _this10 = this; - return this.walk(function (selector) { - if (selector.type === types.UNIVERSAL) { - return callback.call(_this10, selector); - } - }); - }; - _proto.split = function split(callback) { - var _this11 = this; - var current = []; - return this.reduce(function (memo, node, index) { - var split = callback.call(_this11, node); - current.push(node); - if (split) { - memo.push(current); - current = []; - } else if (index === _this11.length - 1) { - memo.push(current); - } - return memo; - }, []); - }; - _proto.map = function map(callback) { - return this.nodes.map(callback); - }; - _proto.reduce = function reduce(callback, memo) { - return this.nodes.reduce(callback, memo); - }; - _proto.every = function every(callback) { - return this.nodes.every(callback); - }; - _proto.some = function some(callback) { - return this.nodes.some(callback); - }; - _proto.filter = function filter(callback) { - return this.nodes.filter(callback); - }; - _proto.sort = function sort(callback) { - return this.nodes.sort(callback); - }; - _proto.toString = function toString() { - return this.map(String).join(''); - }; - _createClass(Container, [{ - key: "first", - get: function get() { - return this.at(0); - } - }, { - key: "last", - get: function get() { - return this.at(this.length - 1); - } - }, { - key: "length", - get: function get() { - return this.nodes.length; - } - }]); - return Container; -}(_node["default"]); -exports["default"] = Container; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/guards.js": -/*!***********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/guards.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0; -exports.isContainer = isContainer; -exports.isIdentifier = void 0; -exports.isNamespace = isNamespace; -exports.isNesting = void 0; -exports.isNode = isNode; -exports.isPseudo = void 0; -exports.isPseudoClass = isPseudoClass; -exports.isPseudoElement = isPseudoElement; -exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = void 0; -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -var _IS_TYPE; -var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); -function isNode(node) { - return typeof node === "object" && IS_TYPE[node.type]; -} -function isNodeType(type, node) { - return isNode(node) && node.type === type; -} -var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); -exports.isAttribute = isAttribute; -var isClassName = isNodeType.bind(null, _types.CLASS); -exports.isClassName = isClassName; -var isCombinator = isNodeType.bind(null, _types.COMBINATOR); -exports.isCombinator = isCombinator; -var isComment = isNodeType.bind(null, _types.COMMENT); -exports.isComment = isComment; -var isIdentifier = isNodeType.bind(null, _types.ID); -exports.isIdentifier = isIdentifier; -var isNesting = isNodeType.bind(null, _types.NESTING); -exports.isNesting = isNesting; -var isPseudo = isNodeType.bind(null, _types.PSEUDO); -exports.isPseudo = isPseudo; -var isRoot = isNodeType.bind(null, _types.ROOT); -exports.isRoot = isRoot; -var isSelector = isNodeType.bind(null, _types.SELECTOR); -exports.isSelector = isSelector; -var isString = isNodeType.bind(null, _types.STRING); -exports.isString = isString; -var isTag = isNodeType.bind(null, _types.TAG); -exports.isTag = isTag; -var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); -exports.isUniversal = isUniversal; -function isPseudoElement(node) { - return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); -} -function isPseudoClass(node) { - return isPseudo(node) && !isPseudoElement(node); -} -function isContainer(node) { - return !!(isNode(node) && node.walk); -} -function isNamespace(node) { - return isAttribute(node) || isTag(node); -} - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/id.js": -/*!*******************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/id.js ***! - \*******************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var ID = /*#__PURE__*/function (_Node) { - _inheritsLoose(ID, _Node); - function ID(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.ID; - return _this; - } - var _proto = ID.prototype; - _proto.valueToString = function valueToString() { - return '#' + _Node.prototype.valueToString.call(this); - }; - return ID; -}(_node["default"]); -exports["default"] = ID; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/index.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -Object.keys(_types).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _types[key]) return; - exports[key] = _types[key]; -}); -var _constructors = __webpack_require__(/*! ./constructors */ "./node_modules/postcss-selector-parser/dist/selectors/constructors.js"); -Object.keys(_constructors).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _constructors[key]) return; - exports[key] = _constructors[key]; -}); -var _guards = __webpack_require__(/*! ./guards */ "./node_modules/postcss-selector-parser/dist/selectors/guards.js"); -Object.keys(_guards).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _guards[key]) return; - exports[key] = _guards[key]; -}); - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/namespace.js": -/*!**************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/namespace.js ***! - \**************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _cssesc = _interopRequireDefault(__webpack_require__(/*! cssesc */ "./node_modules/cssesc/cssesc.js")); -var _util = __webpack_require__(/*! ../util */ "./node_modules/postcss-selector-parser/dist/util/index.js"); -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Namespace = /*#__PURE__*/function (_Node) { - _inheritsLoose(Namespace, _Node); - function Namespace() { - return _Node.apply(this, arguments) || this; - } - var _proto = Namespace.prototype; - _proto.qualifiedName = function qualifiedName(value) { - if (this.namespace) { - return this.namespaceString + "|" + value; - } else { - return value; - } - }; - _proto.valueToString = function valueToString() { - return this.qualifiedName(_Node.prototype.valueToString.call(this)); - }; - _createClass(Namespace, [{ - key: "namespace", - get: function get() { - return this._namespace; - }, - set: function set(namespace) { - if (namespace === true || namespace === "*" || namespace === "&") { - this._namespace = namespace; - if (this.raws) { - delete this.raws.namespace; - } - return; - } - var escaped = (0, _cssesc["default"])(namespace, { - isIdentifier: true - }); - this._namespace = namespace; - if (escaped !== namespace) { - (0, _util.ensureObject)(this, "raws"); - this.raws.namespace = escaped; - } else if (this.raws) { - delete this.raws.namespace; - } - } - }, { - key: "ns", - get: function get() { - return this._namespace; - }, - set: function set(namespace) { - this.namespace = namespace; - } - }, { - key: "namespaceString", - get: function get() { - if (this.namespace) { - var ns = this.stringifyProperty("namespace"); - if (ns === true) { - return ''; - } else { - return ns; - } - } else { - return ''; - } - } - }]); - return Namespace; -}(_node["default"]); -exports["default"] = Namespace; -; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/nesting.js": -/*!************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/nesting.js ***! - \************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Nesting = /*#__PURE__*/function (_Node) { - _inheritsLoose(Nesting, _Node); - function Nesting(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.NESTING; - _this.value = '&'; - return _this; - } - return Nesting; -}(_node["default"]); -exports["default"] = Nesting; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/node.js": -/*!*********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/node.js ***! - \*********************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _util = __webpack_require__(/*! ../util */ "./node_modules/postcss-selector-parser/dist/util/index.js"); -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -var cloneNode = function cloneNode(obj, parent) { - if (typeof obj !== 'object' || obj === null) { - return obj; - } - var cloned = new obj.constructor(); - for (var i in obj) { - if (!obj.hasOwnProperty(i)) { - continue; - } - var value = obj[i]; - var type = typeof value; - if (i === 'parent' && type === 'object') { - if (parent) { - cloned[i] = parent; - } - } else if (value instanceof Array) { - cloned[i] = value.map(function (j) { - return cloneNode(j, cloned); - }); - } else { - cloned[i] = cloneNode(value, cloned); - } - } - return cloned; -}; -var Node = /*#__PURE__*/function () { - function Node(opts) { - if (opts === void 0) { - opts = {}; - } - Object.assign(this, opts); - this.spaces = this.spaces || {}; - this.spaces.before = this.spaces.before || ''; - this.spaces.after = this.spaces.after || ''; - } - var _proto = Node.prototype; - _proto.remove = function remove() { - if (this.parent) { - this.parent.removeChild(this); - } - this.parent = undefined; - return this; - }; - _proto.replaceWith = function replaceWith() { - if (this.parent) { - for (var index in arguments) { - this.parent.insertBefore(this, arguments[index]); - } - this.remove(); - } - return this; - }; - _proto.next = function next() { - return this.parent.at(this.parent.index(this) + 1); - }; - _proto.prev = function prev() { - return this.parent.at(this.parent.index(this) - 1); - }; - _proto.clone = function clone(overrides) { - if (overrides === void 0) { - overrides = {}; - } - var cloned = cloneNode(this); - for (var name in overrides) { - cloned[name] = overrides[name]; - } - return cloned; - } - - /** - * Some non-standard syntax doesn't follow normal escaping rules for css. - * This allows non standard syntax to be appended to an existing property - * by specifying the escaped value. By specifying the escaped value, - * illegal characters are allowed to be directly inserted into css output. - * @param {string} name the property to set - * @param {any} value the unescaped value of the property - * @param {string} valueEscaped optional. the escaped value of the property. - */; - _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { - if (!this.raws) { - this.raws = {}; - } - var originalValue = this[name]; - var originalEscaped = this.raws[name]; - this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. - if (originalEscaped || valueEscaped !== value) { - this.raws[name] = (originalEscaped || originalValue) + valueEscaped; - } else { - delete this.raws[name]; // delete any escaped value that was created by the setter. - } - } - - /** - * Some non-standard syntax doesn't follow normal escaping rules for css. - * This allows the escaped value to be specified directly, allowing illegal - * characters to be directly inserted into css output. - * @param {string} name the property to set - * @param {any} value the unescaped value of the property - * @param {string} valueEscaped the escaped value of the property. - */; - _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { - if (!this.raws) { - this.raws = {}; - } - this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. - this.raws[name] = valueEscaped; - } - - /** - * When you want a value to passed through to CSS directly. This method - * deletes the corresponding raw value causing the stringifier to fallback - * to the unescaped value. - * @param {string} name the property to set. - * @param {any} value The value that is both escaped and unescaped. - */; - _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { - this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. - if (this.raws) { - delete this.raws[name]; - } - } - - /** - * - * @param {number} line The number (starting with 1) - * @param {number} column The column number (starting with 1) - */; - _proto.isAtPosition = function isAtPosition(line, column) { - if (this.source && this.source.start && this.source.end) { - if (this.source.start.line > line) { - return false; - } - if (this.source.end.line < line) { - return false; - } - if (this.source.start.line === line && this.source.start.column > column) { - return false; - } - if (this.source.end.line === line && this.source.end.column < column) { - return false; - } - return true; - } - return undefined; - }; - _proto.stringifyProperty = function stringifyProperty(name) { - return this.raws && this.raws[name] || this[name]; - }; - _proto.valueToString = function valueToString() { - return String(this.stringifyProperty("value")); - }; - _proto.toString = function toString() { - return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); - }; - _createClass(Node, [{ - key: "rawSpaceBefore", - get: function get() { - var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; - if (rawSpace === undefined) { - rawSpace = this.spaces && this.spaces.before; - } - return rawSpace || ""; - }, - set: function set(raw) { - (0, _util.ensureObject)(this, "raws", "spaces"); - this.raws.spaces.before = raw; - } - }, { - key: "rawSpaceAfter", - get: function get() { - var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; - if (rawSpace === undefined) { - rawSpace = this.spaces.after; - } - return rawSpace || ""; - }, - set: function set(raw) { - (0, _util.ensureObject)(this, "raws", "spaces"); - this.raws.spaces.after = raw; - } - }]); - return Node; -}(); -exports["default"] = Node; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/pseudo.js": -/*!***********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/pseudo.js ***! - \***********************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _container = _interopRequireDefault(__webpack_require__(/*! ./container */ "./node_modules/postcss-selector-parser/dist/selectors/container.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Pseudo = /*#__PURE__*/function (_Container) { - _inheritsLoose(Pseudo, _Container); - function Pseudo(opts) { - var _this; - _this = _Container.call(this, opts) || this; - _this.type = _types.PSEUDO; - return _this; - } - var _proto = Pseudo.prototype; - _proto.toString = function toString() { - var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; - return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); - }; - return Pseudo; -}(_container["default"]); -exports["default"] = Pseudo; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/root.js": -/*!*********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/root.js ***! - \*********************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _container = _interopRequireDefault(__webpack_require__(/*! ./container */ "./node_modules/postcss-selector-parser/dist/selectors/container.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Root = /*#__PURE__*/function (_Container) { - _inheritsLoose(Root, _Container); - function Root(opts) { - var _this; - _this = _Container.call(this, opts) || this; - _this.type = _types.ROOT; - return _this; - } - var _proto = Root.prototype; - _proto.toString = function toString() { - var str = this.reduce(function (memo, selector) { - memo.push(String(selector)); - return memo; - }, []).join(','); - return this.trailingComma ? str + ',' : str; - }; - _proto.error = function error(message, options) { - if (this._error) { - return this._error(message, options); - } else { - return new Error(message); - } - }; - _createClass(Root, [{ - key: "errorGenerator", - set: function set(handler) { - this._error = handler; - } - }]); - return Root; -}(_container["default"]); -exports["default"] = Root; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/selector.js": -/*!*************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/selector.js ***! - \*************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _container = _interopRequireDefault(__webpack_require__(/*! ./container */ "./node_modules/postcss-selector-parser/dist/selectors/container.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Selector = /*#__PURE__*/function (_Container) { - _inheritsLoose(Selector, _Container); - function Selector(opts) { - var _this; - _this = _Container.call(this, opts) || this; - _this.type = _types.SELECTOR; - return _this; - } - return Selector; -}(_container["default"]); -exports["default"] = Selector; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/string.js": -/*!***********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/string.js ***! - \***********************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _node = _interopRequireDefault(__webpack_require__(/*! ./node */ "./node_modules/postcss-selector-parser/dist/selectors/node.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var String = /*#__PURE__*/function (_Node) { - _inheritsLoose(String, _Node); - function String(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.STRING; - return _this; - } - return String; -}(_node["default"]); -exports["default"] = String; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/tag.js": -/*!********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/tag.js ***! - \********************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _namespace = _interopRequireDefault(__webpack_require__(/*! ./namespace */ "./node_modules/postcss-selector-parser/dist/selectors/namespace.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Tag = /*#__PURE__*/function (_Namespace) { - _inheritsLoose(Tag, _Namespace); - function Tag(opts) { - var _this; - _this = _Namespace.call(this, opts) || this; - _this.type = _types.TAG; - return _this; - } - return Tag; -}(_namespace["default"]); -exports["default"] = Tag; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/types.js": -/*!**********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/types.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -exports.__esModule = true; -exports.UNIVERSAL = exports.TAG = exports.STRING = exports.SELECTOR = exports.ROOT = exports.PSEUDO = exports.NESTING = exports.ID = exports.COMMENT = exports.COMBINATOR = exports.CLASS = exports.ATTRIBUTE = void 0; -var TAG = 'tag'; -exports.TAG = TAG; -var STRING = 'string'; -exports.STRING = STRING; -var SELECTOR = 'selector'; -exports.SELECTOR = SELECTOR; -var ROOT = 'root'; -exports.ROOT = ROOT; -var PSEUDO = 'pseudo'; -exports.PSEUDO = PSEUDO; -var NESTING = 'nesting'; -exports.NESTING = NESTING; -var ID = 'id'; -exports.ID = ID; -var COMMENT = 'comment'; -exports.COMMENT = COMMENT; -var COMBINATOR = 'combinator'; -exports.COMBINATOR = COMBINATOR; -var CLASS = 'class'; -exports.CLASS = CLASS; -var ATTRIBUTE = 'attribute'; -exports.ATTRIBUTE = ATTRIBUTE; -var UNIVERSAL = 'universal'; -exports.UNIVERSAL = UNIVERSAL; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/selectors/universal.js": -/*!**************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/selectors/universal.js ***! - \**************************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = void 0; -var _namespace = _interopRequireDefault(__webpack_require__(/*! ./namespace */ "./node_modules/postcss-selector-parser/dist/selectors/namespace.js")); -var _types = __webpack_require__(/*! ./types */ "./node_modules/postcss-selector-parser/dist/selectors/types.js"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var Universal = /*#__PURE__*/function (_Namespace) { - _inheritsLoose(Universal, _Namespace); - function Universal(opts) { - var _this; - _this = _Namespace.call(this, opts) || this; - _this.type = _types.UNIVERSAL; - _this.value = '*'; - return _this; - } - return Universal; -}(_namespace["default"]); -exports["default"] = Universal; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/sortAscending.js": -/*!********************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/sortAscending.js ***! - \********************************************************************/ -/***/ ((module, exports) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = sortAscending; -function sortAscending(list) { - return list.sort(function (a, b) { - return a - b; - }); -} -; -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/tokenTypes.js": -/*!*****************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/tokenTypes.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -exports.__esModule = true; -exports.word = exports.tilde = exports.tab = exports.str = exports.space = exports.slash = exports.singleQuote = exports.semicolon = exports.plus = exports.pipe = exports.openSquare = exports.openParenthesis = exports.newline = exports.greaterThan = exports.feed = exports.equals = exports.doubleQuote = exports.dollar = exports.cr = exports.comment = exports.comma = exports.combinator = exports.colon = exports.closeSquare = exports.closeParenthesis = exports.caret = exports.bang = exports.backslash = exports.at = exports.asterisk = exports.ampersand = void 0; -var ampersand = 38; // `&`.charCodeAt(0); -exports.ampersand = ampersand; -var asterisk = 42; // `*`.charCodeAt(0); -exports.asterisk = asterisk; -var at = 64; // `@`.charCodeAt(0); -exports.at = at; -var comma = 44; // `,`.charCodeAt(0); -exports.comma = comma; -var colon = 58; // `:`.charCodeAt(0); -exports.colon = colon; -var semicolon = 59; // `;`.charCodeAt(0); -exports.semicolon = semicolon; -var openParenthesis = 40; // `(`.charCodeAt(0); -exports.openParenthesis = openParenthesis; -var closeParenthesis = 41; // `)`.charCodeAt(0); -exports.closeParenthesis = closeParenthesis; -var openSquare = 91; // `[`.charCodeAt(0); -exports.openSquare = openSquare; -var closeSquare = 93; // `]`.charCodeAt(0); -exports.closeSquare = closeSquare; -var dollar = 36; // `$`.charCodeAt(0); -exports.dollar = dollar; -var tilde = 126; // `~`.charCodeAt(0); -exports.tilde = tilde; -var caret = 94; // `^`.charCodeAt(0); -exports.caret = caret; -var plus = 43; // `+`.charCodeAt(0); -exports.plus = plus; -var equals = 61; // `=`.charCodeAt(0); -exports.equals = equals; -var pipe = 124; // `|`.charCodeAt(0); -exports.pipe = pipe; -var greaterThan = 62; // `>`.charCodeAt(0); -exports.greaterThan = greaterThan; -var space = 32; // ` `.charCodeAt(0); -exports.space = space; -var singleQuote = 39; // `'`.charCodeAt(0); -exports.singleQuote = singleQuote; -var doubleQuote = 34; // `"`.charCodeAt(0); -exports.doubleQuote = doubleQuote; -var slash = 47; // `/`.charCodeAt(0); -exports.slash = slash; -var bang = 33; // `!`.charCodeAt(0); -exports.bang = bang; -var backslash = 92; // '\\'.charCodeAt(0); -exports.backslash = backslash; -var cr = 13; // '\r'.charCodeAt(0); -exports.cr = cr; -var feed = 12; // '\f'.charCodeAt(0); -exports.feed = feed; -var newline = 10; // '\n'.charCodeAt(0); -exports.newline = newline; -var tab = 9; // '\t'.charCodeAt(0); - -// Expose aliases primarily for readability. -exports.tab = tab; -var str = singleQuote; - -// No good single character representation! -exports.str = str; -var comment = -1; -exports.comment = comment; -var word = -2; -exports.word = word; -var combinator = -3; -exports.combinator = combinator; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/tokenize.js": -/*!***************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/tokenize.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports.FIELDS = void 0; -exports["default"] = tokenize; -var t = _interopRequireWildcard(__webpack_require__(/*! ./tokenTypes */ "./node_modules/postcss-selector-parser/dist/tokenTypes.js")); -var _unescapable, _wordDelimiters; -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); -var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); -var hex = {}; -var hexChars = "0123456789abcdefABCDEF"; -for (var i = 0; i < hexChars.length; i++) { - hex[hexChars.charCodeAt(i)] = true; -} - -/** - * Returns the last index of the bar css word - * @param {string} css The string in which the word begins - * @param {number} start The index into the string where word's first letter occurs - */ -function consumeWord(css, start) { - var next = start; - var code; - do { - code = css.charCodeAt(next); - if (wordDelimiters[code]) { - return next - 1; - } else if (code === t.backslash) { - next = consumeEscape(css, next) + 1; - } else { - // All other characters are part of the word - next++; - } - } while (next < css.length); - return next - 1; -} - -/** - * Returns the last index of the escape sequence - * @param {string} css The string in which the sequence begins - * @param {number} start The index into the string where escape character (`\`) occurs. - */ -function consumeEscape(css, start) { - var next = start; - var code = css.charCodeAt(next + 1); - if (unescapable[code]) { - // just consume the escape char - } else if (hex[code]) { - var hexDigits = 0; - // consume up to 6 hex chars - do { - next++; - hexDigits++; - code = css.charCodeAt(next + 1); - } while (hex[code] && hexDigits < 6); - // if fewer than 6 hex chars, a trailing space ends the escape - if (hexDigits < 6 && code === t.space) { - next++; - } - } else { - // the next char is part of the current word - next++; - } - return next; -} -var FIELDS = { - TYPE: 0, - START_LINE: 1, - START_COL: 2, - END_LINE: 3, - END_COL: 4, - START_POS: 5, - END_POS: 6 -}; -exports.FIELDS = FIELDS; -function tokenize(input) { - var tokens = []; - var css = input.css.valueOf(); - var _css = css, - length = _css.length; - var offset = -1; - var line = 1; - var start = 0; - var end = 0; - var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; - function unclosed(what, fix) { - if (input.safe) { - // fyi: this is never set to true. - css += fix; - next = css.length - 1; - } else { - throw input.error('Unclosed ' + what, line, start - offset, start); - } - } - while (start < length) { - code = css.charCodeAt(start); - if (code === t.newline) { - offset = start; - line += 1; - } - switch (code) { - case t.space: - case t.tab: - case t.newline: - case t.cr: - case t.feed: - next = start; - do { - next += 1; - code = css.charCodeAt(next); - if (code === t.newline) { - offset = next; - line += 1; - } - } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); - tokenType = t.space; - endLine = line; - endColumn = next - offset - 1; - end = next; - break; - case t.plus: - case t.greaterThan: - case t.tilde: - case t.pipe: - next = start; - do { - next += 1; - code = css.charCodeAt(next); - } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); - tokenType = t.combinator; - endLine = line; - endColumn = start - offset; - end = next; - break; - - // Consume these characters as single tokens. - case t.asterisk: - case t.ampersand: - case t.bang: - case t.comma: - case t.equals: - case t.dollar: - case t.caret: - case t.openSquare: - case t.closeSquare: - case t.colon: - case t.semicolon: - case t.openParenthesis: - case t.closeParenthesis: - next = start; - tokenType = code; - endLine = line; - endColumn = start - offset; - end = next + 1; - break; - case t.singleQuote: - case t.doubleQuote: - quote = code === t.singleQuote ? "'" : '"'; - next = start; - do { - escaped = false; - next = css.indexOf(quote, next + 1); - if (next === -1) { - unclosed('quote', quote); - } - escapePos = next; - while (css.charCodeAt(escapePos - 1) === t.backslash) { - escapePos -= 1; - escaped = !escaped; - } - } while (escaped); - tokenType = t.str; - endLine = line; - endColumn = start - offset; - end = next + 1; - break; - default: - if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { - next = css.indexOf('*/', start + 2) + 1; - if (next === 0) { - unclosed('comment', '*/'); - } - content = css.slice(start, next + 1); - lines = content.split('\n'); - last = lines.length - 1; - if (last > 0) { - nextLine = line + last; - nextOffset = next - lines[last].length; - } else { - nextLine = line; - nextOffset = offset; - } - tokenType = t.comment; - line = nextLine; - endLine = nextLine; - endColumn = next - nextOffset; - } else if (code === t.slash) { - next = start; - tokenType = code; - endLine = line; - endColumn = start - offset; - end = next + 1; - } else { - next = consumeWord(css, start); - tokenType = t.word; - endLine = line; - endColumn = next - offset; - } - end = next + 1; - break; - } - - // Ensure that the token structure remains consistent - tokens.push([tokenType, - // [0] Token type - line, - // [1] Starting line - start - offset, - // [2] Starting column - endLine, - // [3] Ending line - endColumn, - // [4] Ending column - start, - // [5] Start position / Source index - end // [6] End position - ]); - - // Reset offset for the next token - if (nextOffset) { - offset = nextOffset; - nextOffset = null; - } - start = end; - } - return tokens; -} - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/util/ensureObject.js": -/*!************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/util/ensureObject.js ***! - \************************************************************************/ -/***/ ((module, exports) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = ensureObject; -function ensureObject(obj) { - for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - props[_key - 1] = arguments[_key]; - } - while (props.length > 0) { - var prop = props.shift(); - if (!obj[prop]) { - obj[prop] = {}; - } - obj = obj[prop]; - } -} -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/util/getProp.js": -/*!*******************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/util/getProp.js ***! - \*******************************************************************/ -/***/ ((module, exports) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = getProp; -function getProp(obj) { - for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - props[_key - 1] = arguments[_key]; - } - while (props.length > 0) { - var prop = props.shift(); - if (!obj[prop]) { - return undefined; - } - obj = obj[prop]; - } - return obj; -} -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/util/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/util/index.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -exports.__esModule = true; -exports.unesc = exports.stripComments = exports.getProp = exports.ensureObject = void 0; -var _unesc = _interopRequireDefault(__webpack_require__(/*! ./unesc */ "./node_modules/postcss-selector-parser/dist/util/unesc.js")); -exports.unesc = _unesc["default"]; -var _getProp = _interopRequireDefault(__webpack_require__(/*! ./getProp */ "./node_modules/postcss-selector-parser/dist/util/getProp.js")); -exports.getProp = _getProp["default"]; -var _ensureObject = _interopRequireDefault(__webpack_require__(/*! ./ensureObject */ "./node_modules/postcss-selector-parser/dist/util/ensureObject.js")); -exports.ensureObject = _ensureObject["default"]; -var _stripComments = _interopRequireDefault(__webpack_require__(/*! ./stripComments */ "./node_modules/postcss-selector-parser/dist/util/stripComments.js")); -exports.stripComments = _stripComments["default"]; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/util/stripComments.js": -/*!*************************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/util/stripComments.js ***! - \*************************************************************************/ -/***/ ((module, exports) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = stripComments; -function stripComments(str) { - var s = ""; - var commentStart = str.indexOf("/*"); - var lastEnd = 0; - while (commentStart >= 0) { - s = s + str.slice(lastEnd, commentStart); - var commentEnd = str.indexOf("*/", commentStart + 2); - if (commentEnd < 0) { - return s; - } - lastEnd = commentEnd + 2; - commentStart = str.indexOf("/*", lastEnd); - } - s = s + str.slice(lastEnd); - return s; -} -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-selector-parser/dist/util/unesc.js": -/*!*****************************************************************!*\ - !*** ./node_modules/postcss-selector-parser/dist/util/unesc.js ***! - \*****************************************************************/ -/***/ ((module, exports) => { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = unesc; -// Many thanks for this post which made this migration much easier. -// https://mathiasbynens.be/notes/css-escapes - -/** - * - * @param {string} str - * @returns {[string, number]|undefined} - */ -function gobbleHex(str) { - var lower = str.toLowerCase(); - var hex = ''; - var spaceTerminated = false; - for (var i = 0; i < 6 && lower[i] !== undefined; i++) { - var code = lower.charCodeAt(i); - // check to see if we are dealing with a valid hex char [a-f|0-9] - var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; - // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point - spaceTerminated = code === 32; - if (!valid) { - break; - } - hex += lower[i]; - } - if (hex.length === 0) { - return undefined; - } - var codePoint = parseInt(hex, 16); - var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; - // Add special case for - // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" - // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point - if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { - return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; - } - return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; -} -var CONTAINS_ESCAPE = /\\/; -function unesc(str) { - var needToProcess = CONTAINS_ESCAPE.test(str); - if (!needToProcess) { - return str; - } - var ret = ""; - for (var i = 0; i < str.length; i++) { - if (str[i] === "\\") { - var gobbled = gobbleHex(str.slice(i + 1, i + 7)); - if (gobbled !== undefined) { - ret += gobbled[0]; - i += gobbled[1]; - continue; - } - - // Retain a pair of \\ if double escaped `\\\\` - // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e - if (str[i + 1] === "\\") { - ret += "\\"; - i++; - continue; - } - - // if \\ is at the end of the string retain it - // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb - if (str.length === i + 1) { - ret += str[i]; - } - continue; - } - ret += str[i]; - } - return ret; -} -module.exports = exports.default; - -/***/ }), - -/***/ "./node_modules/postcss-value-parser/lib/index.js": -/*!********************************************************!*\ - !*** ./node_modules/postcss-value-parser/lib/index.js ***! - \********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var parse = __webpack_require__(/*! ./parse */ "./node_modules/postcss-value-parser/lib/parse.js"); -var walk = __webpack_require__(/*! ./walk */ "./node_modules/postcss-value-parser/lib/walk.js"); -var stringify = __webpack_require__(/*! ./stringify */ "./node_modules/postcss-value-parser/lib/stringify.js"); - -function ValueParser(value) { - if (this instanceof ValueParser) { - this.nodes = parse(value); - return this; - } - return new ValueParser(value); -} - -ValueParser.prototype.toString = function() { - return Array.isArray(this.nodes) ? stringify(this.nodes) : ""; -}; - -ValueParser.prototype.walk = function(cb, bubble) { - walk(this.nodes, cb, bubble); - return this; -}; - -ValueParser.unit = __webpack_require__(/*! ./unit */ "./node_modules/postcss-value-parser/lib/unit.js"); - -ValueParser.walk = walk; - -ValueParser.stringify = stringify; - -module.exports = ValueParser; - - -/***/ }), - -/***/ "./node_modules/postcss-value-parser/lib/parse.js": -/*!********************************************************!*\ - !*** ./node_modules/postcss-value-parser/lib/parse.js ***! - \********************************************************/ -/***/ ((module) => { - -var openParentheses = "(".charCodeAt(0); -var closeParentheses = ")".charCodeAt(0); -var singleQuote = "'".charCodeAt(0); -var doubleQuote = '"'.charCodeAt(0); -var backslash = "\\".charCodeAt(0); -var slash = "/".charCodeAt(0); -var comma = ",".charCodeAt(0); -var colon = ":".charCodeAt(0); -var star = "*".charCodeAt(0); -var uLower = "u".charCodeAt(0); -var uUpper = "U".charCodeAt(0); -var plus = "+".charCodeAt(0); -var isUnicodeRange = /^[a-f0-9?-]+$/i; - -module.exports = function(input) { - var tokens = []; - var value = input; - - var next, - quote, - prev, - token, - escape, - escapePos, - whitespacePos, - parenthesesOpenPos; - var pos = 0; - var code = value.charCodeAt(pos); - var max = value.length; - var stack = [{ nodes: tokens }]; - var balanced = 0; - var parent; - - var name = ""; - var before = ""; - var after = ""; - - while (pos < max) { - // Whitespaces - if (code <= 32) { - next = pos; - do { - next += 1; - code = value.charCodeAt(next); - } while (code <= 32); - token = value.slice(pos, next); - - prev = tokens[tokens.length - 1]; - if (code === closeParentheses && balanced) { - after = token; - } else if (prev && prev.type === "div") { - prev.after = token; - prev.sourceEndIndex += token.length; - } else if ( - code === comma || - code === colon || - (code === slash && - value.charCodeAt(next + 1) !== star && - (!parent || - (parent && parent.type === "function" && parent.value !== "calc"))) - ) { - before = token; - } else { - tokens.push({ - type: "space", - sourceIndex: pos, - sourceEndIndex: next, - value: token - }); - } - - pos = next; - - // Quotes - } else if (code === singleQuote || code === doubleQuote) { - next = pos; - quote = code === singleQuote ? "'" : '"'; - token = { - type: "string", - sourceIndex: pos, - quote: quote - }; - do { - escape = false; - next = value.indexOf(quote, next + 1); - if (~next) { - escapePos = next; - while (value.charCodeAt(escapePos - 1) === backslash) { - escapePos -= 1; - escape = !escape; - } - } else { - value += quote; - next = value.length - 1; - token.unclosed = true; - } - } while (escape); - token.value = value.slice(pos + 1, next); - token.sourceEndIndex = token.unclosed ? next : next + 1; - tokens.push(token); - pos = next + 1; - code = value.charCodeAt(pos); - - // Comments - } else if (code === slash && value.charCodeAt(pos + 1) === star) { - next = value.indexOf("*/", pos); - - token = { - type: "comment", - sourceIndex: pos, - sourceEndIndex: next + 2 - }; - - if (next === -1) { - token.unclosed = true; - next = value.length; - token.sourceEndIndex = next; - } - - token.value = value.slice(pos + 2, next); - tokens.push(token); - - pos = next + 2; - code = value.charCodeAt(pos); - - // Operation within calc - } else if ( - (code === slash || code === star) && - parent && - parent.type === "function" && - parent.value === "calc" - ) { - token = value[pos]; - tokens.push({ - type: "word", - sourceIndex: pos - before.length, - sourceEndIndex: pos + token.length, - value: token - }); - pos += 1; - code = value.charCodeAt(pos); - - // Dividers - } else if (code === slash || code === comma || code === colon) { - token = value[pos]; - - tokens.push({ - type: "div", - sourceIndex: pos - before.length, - sourceEndIndex: pos + token.length, - value: token, - before: before, - after: "" - }); - before = ""; - - pos += 1; - code = value.charCodeAt(pos); - - // Open parentheses - } else if (openParentheses === code) { - // Whitespaces after open parentheses - next = pos; - do { - next += 1; - code = value.charCodeAt(next); - } while (code <= 32); - parenthesesOpenPos = pos; - token = { - type: "function", - sourceIndex: pos - name.length, - value: name, - before: value.slice(parenthesesOpenPos + 1, next) - }; - pos = next; - - if (name === "url" && code !== singleQuote && code !== doubleQuote) { - next -= 1; - do { - escape = false; - next = value.indexOf(")", next + 1); - if (~next) { - escapePos = next; - while (value.charCodeAt(escapePos - 1) === backslash) { - escapePos -= 1; - escape = !escape; - } - } else { - value += ")"; - next = value.length - 1; - token.unclosed = true; - } - } while (escape); - // Whitespaces before closed - whitespacePos = next; - do { - whitespacePos -= 1; - code = value.charCodeAt(whitespacePos); - } while (code <= 32); - if (parenthesesOpenPos < whitespacePos) { - if (pos !== whitespacePos + 1) { - token.nodes = [ - { - type: "word", - sourceIndex: pos, - sourceEndIndex: whitespacePos + 1, - value: value.slice(pos, whitespacePos + 1) - } - ]; - } else { - token.nodes = []; - } - if (token.unclosed && whitespacePos + 1 !== next) { - token.after = ""; - token.nodes.push({ - type: "space", - sourceIndex: whitespacePos + 1, - sourceEndIndex: next, - value: value.slice(whitespacePos + 1, next) - }); - } else { - token.after = value.slice(whitespacePos + 1, next); - token.sourceEndIndex = next; - } - } else { - token.after = ""; - token.nodes = []; - } - pos = next + 1; - token.sourceEndIndex = token.unclosed ? next : pos; - code = value.charCodeAt(pos); - tokens.push(token); - } else { - balanced += 1; - token.after = ""; - token.sourceEndIndex = pos + 1; - tokens.push(token); - stack.push(token); - tokens = token.nodes = []; - parent = token; - } - name = ""; - - // Close parentheses - } else if (closeParentheses === code && balanced) { - pos += 1; - code = value.charCodeAt(pos); - - parent.after = after; - parent.sourceEndIndex += after.length; - after = ""; - balanced -= 1; - stack[stack.length - 1].sourceEndIndex = pos; - stack.pop(); - parent = stack[balanced]; - tokens = parent.nodes; - - // Words - } else { - next = pos; - do { - if (code === backslash) { - next += 1; - } - next += 1; - code = value.charCodeAt(next); - } while ( - next < max && - !( - code <= 32 || - code === singleQuote || - code === doubleQuote || - code === comma || - code === colon || - code === slash || - code === openParentheses || - (code === star && - parent && - parent.type === "function" && - parent.value === "calc") || - (code === slash && - parent.type === "function" && - parent.value === "calc") || - (code === closeParentheses && balanced) - ) - ); - token = value.slice(pos, next); - - if (openParentheses === code) { - name = token; - } else if ( - (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && - plus === token.charCodeAt(1) && - isUnicodeRange.test(token.slice(2)) - ) { - tokens.push({ - type: "unicode-range", - sourceIndex: pos, - sourceEndIndex: next, - value: token - }); - } else { - tokens.push({ - type: "word", - sourceIndex: pos, - sourceEndIndex: next, - value: token - }); - } - - pos = next; - } - } - - for (pos = stack.length - 1; pos; pos -= 1) { - stack[pos].unclosed = true; - stack[pos].sourceEndIndex = value.length; - } - - return stack[0].nodes; -}; - - -/***/ }), - -/***/ "./node_modules/postcss-value-parser/lib/stringify.js": -/*!************************************************************!*\ - !*** ./node_modules/postcss-value-parser/lib/stringify.js ***! - \************************************************************/ -/***/ ((module) => { - -function stringifyNode(node, custom) { - var type = node.type; - var value = node.value; - var buf; - var customResult; - - if (custom && (customResult = custom(node)) !== undefined) { - return customResult; - } else if (type === "word" || type === "space") { - return value; - } else if (type === "string") { - buf = node.quote || ""; - return buf + value + (node.unclosed ? "" : buf); - } else if (type === "comment") { - return "/*" + value + (node.unclosed ? "" : "*/"); - } else if (type === "div") { - return (node.before || "") + value + (node.after || ""); - } else if (Array.isArray(node.nodes)) { - buf = stringify(node.nodes, custom); - if (type !== "function") { - return buf; - } - return ( - value + - "(" + - (node.before || "") + - buf + - (node.after || "") + - (node.unclosed ? "" : ")") - ); - } - return value; -} - -function stringify(nodes, custom) { - var result, i; - - if (Array.isArray(nodes)) { - result = ""; - for (i = nodes.length - 1; ~i; i -= 1) { - result = stringifyNode(nodes[i], custom) + result; - } - return result; - } - return stringifyNode(nodes, custom); -} - -module.exports = stringify; - - -/***/ }), - -/***/ "./node_modules/postcss-value-parser/lib/unit.js": -/*!*******************************************************!*\ - !*** ./node_modules/postcss-value-parser/lib/unit.js ***! - \*******************************************************/ -/***/ ((module) => { - -var minus = "-".charCodeAt(0); -var plus = "+".charCodeAt(0); -var dot = ".".charCodeAt(0); -var exp = "e".charCodeAt(0); -var EXP = "E".charCodeAt(0); - -// Check if three code points would start a number -// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number -function likeNumber(value) { - var code = value.charCodeAt(0); - var nextCode; - - if (code === plus || code === minus) { - nextCode = value.charCodeAt(1); - - if (nextCode >= 48 && nextCode <= 57) { - return true; - } - - var nextNextCode = value.charCodeAt(2); - - if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { - return true; - } - - return false; - } - - if (code === dot) { - nextCode = value.charCodeAt(1); - - if (nextCode >= 48 && nextCode <= 57) { - return true; - } - - return false; - } - - if (code >= 48 && code <= 57) { - return true; - } - - return false; -} - -// Consume a number -// https://www.w3.org/TR/css-syntax-3/#consume-number -module.exports = function(value) { - var pos = 0; - var length = value.length; - var code; - var nextCode; - var nextNextCode; - - if (length === 0 || !likeNumber(value)) { - return false; - } - - code = value.charCodeAt(pos); - - if (code === plus || code === minus) { - pos++; - } - - while (pos < length) { - code = value.charCodeAt(pos); - - if (code < 48 || code > 57) { - break; - } - - pos += 1; - } - - code = value.charCodeAt(pos); - nextCode = value.charCodeAt(pos + 1); - - if (code === dot && nextCode >= 48 && nextCode <= 57) { - pos += 2; - - while (pos < length) { - code = value.charCodeAt(pos); - - if (code < 48 || code > 57) { - break; - } - - pos += 1; - } - } - - code = value.charCodeAt(pos); - nextCode = value.charCodeAt(pos + 1); - nextNextCode = value.charCodeAt(pos + 2); - - if ( - (code === exp || code === EXP) && - ((nextCode >= 48 && nextCode <= 57) || - ((nextCode === plus || nextCode === minus) && - nextNextCode >= 48 && - nextNextCode <= 57)) - ) { - pos += nextCode === plus || nextCode === minus ? 3 : 2; - - while (pos < length) { - code = value.charCodeAt(pos); - - if (code < 48 || code > 57) { - break; - } - - pos += 1; - } - } - - return { - number: value.slice(0, pos), - unit: value.slice(pos) - }; -}; - - -/***/ }), - -/***/ "./node_modules/postcss-value-parser/lib/walk.js": -/*!*******************************************************!*\ - !*** ./node_modules/postcss-value-parser/lib/walk.js ***! - \*******************************************************/ -/***/ ((module) => { - -module.exports = function walk(nodes, cb, bubble) { - var i, max, node, result; - - for (i = 0, max = nodes.length; i < max; i += 1) { - node = nodes[i]; - if (!bubble) { - result = cb(node, i, nodes); - } - - if ( - result !== false && - node.type === "function" && - Array.isArray(node.nodes) - ) { - walk(node.nodes, cb, bubble); - } - - if (bubble) { - cb(node, i, nodes); - } - } -}; - - -/***/ }), - -/***/ "./node_modules/postcss/lib/at-rule.js": -/*!*********************************************!*\ - !*** ./node_modules/postcss/lib/at-rule.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Container = __webpack_require__(/*! ./container */ "./node_modules/postcss/lib/container.js") - -class AtRule extends Container { - constructor(defaults) { - super(defaults) - this.type = 'atrule' - } - - append(...children) { - if (!this.proxyOf.nodes) this.nodes = [] - return super.append(...children) - } - - prepend(...children) { - if (!this.proxyOf.nodes) this.nodes = [] - return super.prepend(...children) - } -} - -module.exports = AtRule -AtRule.default = AtRule - -Container.registerAtRule(AtRule) - - -/***/ }), - -/***/ "./node_modules/postcss/lib/comment.js": -/*!*********************************************!*\ - !*** ./node_modules/postcss/lib/comment.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Node = __webpack_require__(/*! ./node */ "./node_modules/postcss/lib/node.js") - -class Comment extends Node { - constructor(defaults) { - super(defaults) - this.type = 'comment' - } -} - -module.exports = Comment -Comment.default = Comment - - -/***/ }), - -/***/ "./node_modules/postcss/lib/container.js": -/*!***********************************************!*\ - !*** ./node_modules/postcss/lib/container.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Comment = __webpack_require__(/*! ./comment */ "./node_modules/postcss/lib/comment.js") -let Declaration = __webpack_require__(/*! ./declaration */ "./node_modules/postcss/lib/declaration.js") -let Node = __webpack_require__(/*! ./node */ "./node_modules/postcss/lib/node.js") -let { isClean, my } = __webpack_require__(/*! ./symbols */ "./node_modules/postcss/lib/symbols.js") - -let AtRule, parse, Root, Rule - -function cleanSource(nodes) { - return nodes.map(i => { - if (i.nodes) i.nodes = cleanSource(i.nodes) - delete i.source - return i - }) -} - -function markTreeDirty(node) { - node[isClean] = false - if (node.proxyOf.nodes) { - for (let i of node.proxyOf.nodes) { - markTreeDirty(i) - } - } -} - -class Container extends Node { - get first() { - if (!this.proxyOf.nodes) return undefined - return this.proxyOf.nodes[0] - } - - get last() { - if (!this.proxyOf.nodes) return undefined - return this.proxyOf.nodes[this.proxyOf.nodes.length - 1] - } - - append(...children) { - for (let child of children) { - let nodes = this.normalize(child, this.last) - for (let node of nodes) this.proxyOf.nodes.push(node) - } - - this.markDirty() - - return this - } - - cleanRaws(keepBetween) { - super.cleanRaws(keepBetween) - if (this.nodes) { - for (let node of this.nodes) node.cleanRaws(keepBetween) - } - } - - each(callback) { - if (!this.proxyOf.nodes) return undefined - let iterator = this.getIterator() - - let index, result - while (this.indexes[iterator] < this.proxyOf.nodes.length) { - index = this.indexes[iterator] - result = callback(this.proxyOf.nodes[index], index) - if (result === false) break - - this.indexes[iterator] += 1 - } - - delete this.indexes[iterator] - return result - } - - every(condition) { - return this.nodes.every(condition) - } - - getIterator() { - if (!this.lastEach) this.lastEach = 0 - if (!this.indexes) this.indexes = {} - - this.lastEach += 1 - let iterator = this.lastEach - this.indexes[iterator] = 0 - - return iterator - } - - getProxyProcessor() { - return { - get(node, prop) { - if (prop === 'proxyOf') { - return node - } else if (!node[prop]) { - return node[prop] - } else if ( - prop === 'each' || - (typeof prop === 'string' && prop.startsWith('walk')) - ) { - return (...args) => { - return node[prop]( - ...args.map(i => { - if (typeof i === 'function') { - return (child, index) => i(child.toProxy(), index) - } else { - return i - } - }) - ) - } - } else if (prop === 'every' || prop === 'some') { - return cb => { - return node[prop]((child, ...other) => - cb(child.toProxy(), ...other) - ) - } - } else if (prop === 'root') { - return () => node.root().toProxy() - } else if (prop === 'nodes') { - return node.nodes.map(i => i.toProxy()) - } else if (prop === 'first' || prop === 'last') { - return node[prop].toProxy() - } else { - return node[prop] - } - }, - - set(node, prop, value) { - if (node[prop] === value) return true - node[prop] = value - if (prop === 'name' || prop === 'params' || prop === 'selector') { - node.markDirty() - } - return true - } - } - } - - index(child) { - if (typeof child === 'number') return child - if (child.proxyOf) child = child.proxyOf - return this.proxyOf.nodes.indexOf(child) - } - - insertAfter(exist, add) { - let existIndex = this.index(exist) - let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse() - existIndex = this.index(exist) - for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node) - - let index - for (let id in this.indexes) { - index = this.indexes[id] - if (existIndex < index) { - this.indexes[id] = index + nodes.length - } - } - - this.markDirty() - - return this - } - - insertBefore(exist, add) { - let existIndex = this.index(exist) - let type = existIndex === 0 ? 'prepend' : false - let nodes = this.normalize( - add, - this.proxyOf.nodes[existIndex], - type - ).reverse() - existIndex = this.index(exist) - for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node) - - let index - for (let id in this.indexes) { - index = this.indexes[id] - if (existIndex <= index) { - this.indexes[id] = index + nodes.length - } - } - - this.markDirty() - - return this - } - - normalize(nodes, sample) { - if (typeof nodes === 'string') { - nodes = cleanSource(parse(nodes).nodes) - } else if (typeof nodes === 'undefined') { - nodes = [] - } else if (Array.isArray(nodes)) { - nodes = nodes.slice(0) - for (let i of nodes) { - if (i.parent) i.parent.removeChild(i, 'ignore') - } - } else if (nodes.type === 'root' && this.type !== 'document') { - nodes = nodes.nodes.slice(0) - for (let i of nodes) { - if (i.parent) i.parent.removeChild(i, 'ignore') - } - } else if (nodes.type) { - nodes = [nodes] - } else if (nodes.prop) { - if (typeof nodes.value === 'undefined') { - throw new Error('Value field is missed in node creation') - } else if (typeof nodes.value !== 'string') { - nodes.value = String(nodes.value) - } - nodes = [new Declaration(nodes)] - } else if (nodes.selector || nodes.selectors) { - nodes = [new Rule(nodes)] - } else if (nodes.name) { - nodes = [new AtRule(nodes)] - } else if (nodes.text) { - nodes = [new Comment(nodes)] - } else { - throw new Error('Unknown node type in node creation') - } - - let processed = nodes.map(i => { - /* c8 ignore next */ - if (!i[my]) Container.rebuild(i) - i = i.proxyOf - if (i.parent) i.parent.removeChild(i) - if (i[isClean]) markTreeDirty(i) - - if (!i.raws) i.raws = {} - if (typeof i.raws.before === 'undefined') { - if (sample && typeof sample.raws.before !== 'undefined') { - i.raws.before = sample.raws.before.replace(/\S/g, '') - } - } - i.parent = this.proxyOf - return i - }) - - return processed - } - - prepend(...children) { - children = children.reverse() - for (let child of children) { - let nodes = this.normalize(child, this.first, 'prepend').reverse() - for (let node of nodes) this.proxyOf.nodes.unshift(node) - for (let id in this.indexes) { - this.indexes[id] = this.indexes[id] + nodes.length - } - } - - this.markDirty() - - return this - } - - push(child) { - child.parent = this - this.proxyOf.nodes.push(child) - return this - } - - removeAll() { - for (let node of this.proxyOf.nodes) node.parent = undefined - this.proxyOf.nodes = [] - - this.markDirty() - - return this - } - - removeChild(child) { - child = this.index(child) - this.proxyOf.nodes[child].parent = undefined - this.proxyOf.nodes.splice(child, 1) - - let index - for (let id in this.indexes) { - index = this.indexes[id] - if (index >= child) { - this.indexes[id] = index - 1 - } - } - - this.markDirty() - - return this - } - - replaceValues(pattern, opts, callback) { - if (!callback) { - callback = opts - opts = {} - } - - this.walkDecls(decl => { - if (opts.props && !opts.props.includes(decl.prop)) return - if (opts.fast && !decl.value.includes(opts.fast)) return - - decl.value = decl.value.replace(pattern, callback) - }) - - this.markDirty() - - return this - } - - some(condition) { - return this.nodes.some(condition) - } - - walk(callback) { - return this.each((child, i) => { - let result - try { - result = callback(child, i) - } catch (e) { - throw child.addToError(e) - } - if (result !== false && child.walk) { - result = child.walk(callback) - } - - return result - }) - } - - walkAtRules(name, callback) { - if (!callback) { - callback = name - return this.walk((child, i) => { - if (child.type === 'atrule') { - return callback(child, i) - } - }) - } - if (name instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === 'atrule' && name.test(child.name)) { - return callback(child, i) - } - }) - } - return this.walk((child, i) => { - if (child.type === 'atrule' && child.name === name) { - return callback(child, i) - } - }) - } - - walkComments(callback) { - return this.walk((child, i) => { - if (child.type === 'comment') { - return callback(child, i) - } - }) - } - - walkDecls(prop, callback) { - if (!callback) { - callback = prop - return this.walk((child, i) => { - if (child.type === 'decl') { - return callback(child, i) - } - }) - } - if (prop instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === 'decl' && prop.test(child.prop)) { - return callback(child, i) - } - }) - } - return this.walk((child, i) => { - if (child.type === 'decl' && child.prop === prop) { - return callback(child, i) - } - }) - } - - walkRules(selector, callback) { - if (!callback) { - callback = selector - - return this.walk((child, i) => { - if (child.type === 'rule') { - return callback(child, i) - } - }) - } - if (selector instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === 'rule' && selector.test(child.selector)) { - return callback(child, i) - } - }) - } - return this.walk((child, i) => { - if (child.type === 'rule' && child.selector === selector) { - return callback(child, i) - } - }) - } -} - -Container.registerParse = dependant => { - parse = dependant -} - -Container.registerRule = dependant => { - Rule = dependant -} - -Container.registerAtRule = dependant => { - AtRule = dependant -} - -Container.registerRoot = dependant => { - Root = dependant -} - -module.exports = Container -Container.default = Container - -/* c8 ignore start */ -Container.rebuild = node => { - if (node.type === 'atrule') { - Object.setPrototypeOf(node, AtRule.prototype) - } else if (node.type === 'rule') { - Object.setPrototypeOf(node, Rule.prototype) - } else if (node.type === 'decl') { - Object.setPrototypeOf(node, Declaration.prototype) - } else if (node.type === 'comment') { - Object.setPrototypeOf(node, Comment.prototype) - } else if (node.type === 'root') { - Object.setPrototypeOf(node, Root.prototype) - } - - node[my] = true - - if (node.nodes) { - node.nodes.forEach(child => { - Container.rebuild(child) - }) - } -} -/* c8 ignore stop */ - - -/***/ }), - -/***/ "./node_modules/postcss/lib/css-syntax-error.js": -/*!******************************************************!*\ - !*** ./node_modules/postcss/lib/css-syntax-error.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let pico = __webpack_require__(/*! picocolors */ "./node_modules/picocolors/picocolors.browser.js") - -let terminalHighlight = __webpack_require__(/*! ./terminal-highlight */ "?5580") - -class CssSyntaxError extends Error { - constructor(message, line, column, source, file, plugin) { - super(message) - this.name = 'CssSyntaxError' - this.reason = message - - if (file) { - this.file = file - } - if (source) { - this.source = source - } - if (plugin) { - this.plugin = plugin - } - if (typeof line !== 'undefined' && typeof column !== 'undefined') { - if (typeof line === 'number') { - this.line = line - this.column = column - } else { - this.line = line.line - this.column = line.column - this.endLine = column.line - this.endColumn = column.column - } - } - - this.setMessage() - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, CssSyntaxError) - } - } - - setMessage() { - this.message = this.plugin ? this.plugin + ': ' : '' - this.message += this.file ? this.file : '' - if (typeof this.line !== 'undefined') { - this.message += ':' + this.line + ':' + this.column - } - this.message += ': ' + this.reason - } - - showSourceCode(color) { - if (!this.source) return '' - - let css = this.source - if (color == null) color = pico.isColorSupported - - let aside = text => text - let mark = text => text - let highlight = text => text - if (color) { - let { bold, gray, red } = pico.createColors(true) - mark = text => bold(red(text)) - aside = text => gray(text) - if (terminalHighlight) { - highlight = text => terminalHighlight(text) - } - } - - let lines = css.split(/\r?\n/) - let start = Math.max(this.line - 3, 0) - let end = Math.min(this.line + 2, lines.length) - let maxWidth = String(end).length - - return lines - .slice(start, end) - .map((line, index) => { - let number = start + 1 + index - let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ' - if (number === this.line) { - if (line.length > 160) { - let padding = 20 - let subLineStart = Math.max(0, this.column - padding) - let subLineEnd = Math.max( - this.column + padding, - this.endColumn + padding - ) - let subLine = line.slice(subLineStart, subLineEnd) - - let spacing = - aside(gutter.replace(/\d/g, ' ')) + - line - .slice(0, Math.min(this.column - 1, padding - 1)) - .replace(/[^\t]/g, ' ') - - return ( - mark('>') + - aside(gutter) + - highlight(subLine) + - '\n ' + - spacing + - mark('^') - ) - } - - let spacing = - aside(gutter.replace(/\d/g, ' ')) + - line.slice(0, this.column - 1).replace(/[^\t]/g, ' ') - - return ( - mark('>') + - aside(gutter) + - highlight(line) + - '\n ' + - spacing + - mark('^') - ) - } - - return ' ' + aside(gutter) + highlight(line) - }) - .join('\n') - } - - toString() { - let code = this.showSourceCode() - if (code) { - code = '\n\n' + code + '\n' - } - return this.name + ': ' + this.message + code - } -} - -module.exports = CssSyntaxError -CssSyntaxError.default = CssSyntaxError - - -/***/ }), - -/***/ "./node_modules/postcss/lib/declaration.js": -/*!*************************************************!*\ - !*** ./node_modules/postcss/lib/declaration.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Node = __webpack_require__(/*! ./node */ "./node_modules/postcss/lib/node.js") - -class Declaration extends Node { - get variable() { - return this.prop.startsWith('--') || this.prop[0] === '$' - } - - constructor(defaults) { - if ( - defaults && - typeof defaults.value !== 'undefined' && - typeof defaults.value !== 'string' - ) { - defaults = { ...defaults, value: String(defaults.value) } - } - super(defaults) - this.type = 'decl' - } -} - -module.exports = Declaration -Declaration.default = Declaration - - -/***/ }), - -/***/ "./node_modules/postcss/lib/document.js": -/*!**********************************************!*\ - !*** ./node_modules/postcss/lib/document.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Container = __webpack_require__(/*! ./container */ "./node_modules/postcss/lib/container.js") - -let LazyResult, Processor - -class Document extends Container { - constructor(defaults) { - // type needs to be passed to super, otherwise child roots won't be normalized correctly - super({ type: 'document', ...defaults }) - - if (!this.nodes) { - this.nodes = [] - } - } - - toResult(opts = {}) { - let lazy = new LazyResult(new Processor(), this, opts) - - return lazy.stringify() - } -} - -Document.registerLazyResult = dependant => { - LazyResult = dependant -} - -Document.registerProcessor = dependant => { - Processor = dependant -} - -module.exports = Document -Document.default = Document - - -/***/ }), - -/***/ "./node_modules/postcss/lib/fromJSON.js": -/*!**********************************************!*\ - !*** ./node_modules/postcss/lib/fromJSON.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let AtRule = __webpack_require__(/*! ./at-rule */ "./node_modules/postcss/lib/at-rule.js") -let Comment = __webpack_require__(/*! ./comment */ "./node_modules/postcss/lib/comment.js") -let Declaration = __webpack_require__(/*! ./declaration */ "./node_modules/postcss/lib/declaration.js") -let Input = __webpack_require__(/*! ./input */ "./node_modules/postcss/lib/input.js") -let PreviousMap = __webpack_require__(/*! ./previous-map */ "./node_modules/postcss/lib/previous-map.js") -let Root = __webpack_require__(/*! ./root */ "./node_modules/postcss/lib/root.js") -let Rule = __webpack_require__(/*! ./rule */ "./node_modules/postcss/lib/rule.js") - -function fromJSON(json, inputs) { - if (Array.isArray(json)) return json.map(n => fromJSON(n)) - - let { inputs: ownInputs, ...defaults } = json - if (ownInputs) { - inputs = [] - for (let input of ownInputs) { - let inputHydrated = { ...input, __proto__: Input.prototype } - if (inputHydrated.map) { - inputHydrated.map = { - ...inputHydrated.map, - __proto__: PreviousMap.prototype - } - } - inputs.push(inputHydrated) - } - } - if (defaults.nodes) { - defaults.nodes = json.nodes.map(n => fromJSON(n, inputs)) - } - if (defaults.source) { - let { inputId, ...source } = defaults.source - defaults.source = source - if (inputId != null) { - defaults.source.input = inputs[inputId] - } - } - if (defaults.type === 'root') { - return new Root(defaults) - } else if (defaults.type === 'decl') { - return new Declaration(defaults) - } else if (defaults.type === 'rule') { - return new Rule(defaults) - } else if (defaults.type === 'comment') { - return new Comment(defaults) - } else if (defaults.type === 'atrule') { - return new AtRule(defaults) - } else { - throw new Error('Unknown node type: ' + json.type) - } -} - -module.exports = fromJSON -fromJSON.default = fromJSON - - -/***/ }), - -/***/ "./node_modules/postcss/lib/input.js": -/*!*******************************************!*\ - !*** ./node_modules/postcss/lib/input.js ***! - \*******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let { nanoid } = __webpack_require__(/*! nanoid/non-secure */ "./node_modules/nanoid/non-secure/index.cjs") -let { isAbsolute, resolve } = __webpack_require__(/*! path */ "?6197") -let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(/*! source-map-js */ "?b8cb") -let { fileURLToPath, pathToFileURL } = __webpack_require__(/*! url */ "./node_modules/whatwg-url/index.js") - -let CssSyntaxError = __webpack_require__(/*! ./css-syntax-error */ "./node_modules/postcss/lib/css-syntax-error.js") -let PreviousMap = __webpack_require__(/*! ./previous-map */ "./node_modules/postcss/lib/previous-map.js") -let terminalHighlight = __webpack_require__(/*! ./terminal-highlight */ "?5580") - -let lineToIndexCache = Symbol('lineToIndexCache') - -let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) -let pathAvailable = Boolean(resolve && isAbsolute) - -function getLineToIndex(input) { - if (input[lineToIndexCache]) return input[lineToIndexCache] - let lines = input.css.split('\n') - let lineToIndex = new Array(lines.length) - let prevIndex = 0 - - for (let i = 0, l = lines.length; i < l; i++) { - lineToIndex[i] = prevIndex - prevIndex += lines[i].length + 1 - } - - input[lineToIndexCache] = lineToIndex - return lineToIndex -} - -class Input { - get from() { - return this.file || this.id - } - - constructor(css, opts = {}) { - if ( - css === null || - typeof css === 'undefined' || - (typeof css === 'object' && !css.toString) - ) { - throw new Error(`PostCSS received ${css} instead of CSS string`) - } - - this.css = css.toString() - - if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { - this.hasBOM = true - this.css = this.css.slice(1) - } else { - this.hasBOM = false - } - - this.document = this.css - if (opts.document) this.document = opts.document.toString() - - if (opts.from) { - if ( - !pathAvailable || - /^\w+:\/\//.test(opts.from) || - isAbsolute(opts.from) - ) { - this.file = opts.from - } else { - this.file = resolve(opts.from) - } - } - - if (pathAvailable && sourceMapAvailable) { - let map = new PreviousMap(this.css, opts) - if (map.text) { - this.map = map - let file = map.consumer().file - if (!this.file && file) this.file = this.mapResolve(file) - } - } - - if (!this.file) { - this.id = '' - } - if (this.map) this.map.file = this.from - } - - error(message, line, column, opts = {}) { - let endColumn, endLine, endOffset, offset, result - - if (line && typeof line === 'object') { - let start = line - let end = column - if (typeof start.offset === 'number') { - offset = start.offset - let pos = this.fromOffset(offset) - line = pos.line - column = pos.col - } else { - line = start.line - column = start.column - offset = this.fromLineAndColumn(line, column) - } - if (typeof end.offset === 'number') { - endOffset = end.offset - let pos = this.fromOffset(endOffset) - endLine = pos.line - endColumn = pos.col - } else { - endLine = end.line - endColumn = end.column - endOffset = this.fromLineAndColumn(end.line, end.column) - } - } else if (!column) { - offset = line - let pos = this.fromOffset(offset) - line = pos.line - column = pos.col - } else { - offset = this.fromLineAndColumn(line, column) - } - - let origin = this.origin(line, column, endLine, endColumn) - if (origin) { - result = new CssSyntaxError( - message, - origin.endLine === undefined - ? origin.line - : { column: origin.column, line: origin.line }, - origin.endLine === undefined - ? origin.column - : { column: origin.endColumn, line: origin.endLine }, - origin.source, - origin.file, - opts.plugin - ) - } else { - result = new CssSyntaxError( - message, - endLine === undefined ? line : { column, line }, - endLine === undefined ? column : { column: endColumn, line: endLine }, - this.css, - this.file, - opts.plugin - ) - } - - result.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css } - if (this.file) { - if (pathToFileURL) { - result.input.url = pathToFileURL(this.file).toString() - } - result.input.file = this.file - } - - return result - } - - fromLineAndColumn(line, column) { - let lineToIndex = getLineToIndex(this) - let index = lineToIndex[line - 1] - return index + column - 1 - } - - fromOffset(offset) { - let lineToIndex = getLineToIndex(this) - let lastLine = lineToIndex[lineToIndex.length - 1] - - let min = 0 - if (offset >= lastLine) { - min = lineToIndex.length - 1 - } else { - let max = lineToIndex.length - 2 - let mid - while (min < max) { - mid = min + ((max - min) >> 1) - if (offset < lineToIndex[mid]) { - max = mid - 1 - } else if (offset >= lineToIndex[mid + 1]) { - min = mid + 1 - } else { - min = mid - break - } - } - } - return { - col: offset - lineToIndex[min] + 1, - line: min + 1 - } - } - - mapResolve(file) { - if (/^\w+:\/\//.test(file)) { - return file - } - return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) - } - - origin(line, column, endLine, endColumn) { - if (!this.map) return false - let consumer = this.map.consumer() - - let from = consumer.originalPositionFor({ column, line }) - if (!from.source) return false - - let to - if (typeof endLine === 'number') { - to = consumer.originalPositionFor({ column: endColumn, line: endLine }) - } - - let fromUrl - - if (isAbsolute(from.source)) { - fromUrl = pathToFileURL(from.source) - } else { - fromUrl = new URL( - from.source, - this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) - ) - } - - let result = { - column: from.column, - endColumn: to && to.column, - endLine: to && to.line, - line: from.line, - url: fromUrl.toString() - } - - if (fromUrl.protocol === 'file:') { - if (fileURLToPath) { - result.file = fileURLToPath(fromUrl) - } else { - /* c8 ignore next 2 */ - throw new Error(`file: protocol is not available in this PostCSS build`) - } - } - - let source = consumer.sourceContentFor(from.source) - if (source) result.source = source - - return result - } - - toJSON() { - let json = {} - for (let name of ['hasBOM', 'css', 'file', 'id']) { - if (this[name] != null) { - json[name] = this[name] - } - } - if (this.map) { - json.map = { ...this.map } - if (json.map.consumerCache) { - json.map.consumerCache = undefined - } - } - return json - } -} - -module.exports = Input -Input.default = Input - -if (terminalHighlight && terminalHighlight.registerInput) { - terminalHighlight.registerInput(Input) -} - - -/***/ }), - -/***/ "./node_modules/postcss/lib/lazy-result.js": -/*!*************************************************!*\ - !*** ./node_modules/postcss/lib/lazy-result.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Container = __webpack_require__(/*! ./container */ "./node_modules/postcss/lib/container.js") -let Document = __webpack_require__(/*! ./document */ "./node_modules/postcss/lib/document.js") -let MapGenerator = __webpack_require__(/*! ./map-generator */ "./node_modules/postcss/lib/map-generator.js") -let parse = __webpack_require__(/*! ./parse */ "./node_modules/postcss/lib/parse.js") -let Result = __webpack_require__(/*! ./result */ "./node_modules/postcss/lib/result.js") -let Root = __webpack_require__(/*! ./root */ "./node_modules/postcss/lib/root.js") -let stringify = __webpack_require__(/*! ./stringify */ "./node_modules/postcss/lib/stringify.js") -let { isClean, my } = __webpack_require__(/*! ./symbols */ "./node_modules/postcss/lib/symbols.js") -let warnOnce = __webpack_require__(/*! ./warn-once */ "./node_modules/postcss/lib/warn-once.js") - -const TYPE_TO_CLASS_NAME = { - atrule: 'AtRule', - comment: 'Comment', - decl: 'Declaration', - document: 'Document', - root: 'Root', - rule: 'Rule' -} - -const PLUGIN_PROPS = { - AtRule: true, - AtRuleExit: true, - Comment: true, - CommentExit: true, - Declaration: true, - DeclarationExit: true, - Document: true, - DocumentExit: true, - Once: true, - OnceExit: true, - postcssPlugin: true, - prepare: true, - Root: true, - RootExit: true, - Rule: true, - RuleExit: true -} - -const NOT_VISITORS = { - Once: true, - postcssPlugin: true, - prepare: true -} - -const CHILDREN = 0 - -function isPromise(obj) { - return typeof obj === 'object' && typeof obj.then === 'function' -} - -function getEvents(node) { - let key = false - let type = TYPE_TO_CLASS_NAME[node.type] - if (node.type === 'decl') { - key = node.prop.toLowerCase() - } else if (node.type === 'atrule') { - key = node.name.toLowerCase() - } - - if (key && node.append) { - return [ - type, - type + '-' + key, - CHILDREN, - type + 'Exit', - type + 'Exit-' + key - ] - } else if (key) { - return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] - } else if (node.append) { - return [type, CHILDREN, type + 'Exit'] - } else { - return [type, type + 'Exit'] - } -} - -function toStack(node) { - let events - if (node.type === 'document') { - events = ['Document', CHILDREN, 'DocumentExit'] - } else if (node.type === 'root') { - events = ['Root', CHILDREN, 'RootExit'] - } else { - events = getEvents(node) - } - - return { - eventIndex: 0, - events, - iterator: 0, - node, - visitorIndex: 0, - visitors: [] - } -} - -function cleanMarks(node) { - node[isClean] = false - if (node.nodes) node.nodes.forEach(i => cleanMarks(i)) - return node -} - -let postcss = {} - -class LazyResult { - get content() { - return this.stringify().content - } - - get css() { - return this.stringify().css - } - - get map() { - return this.stringify().map - } - - get messages() { - return this.sync().messages - } - - get opts() { - return this.result.opts - } - - get processor() { - return this.result.processor - } - - get root() { - return this.sync().root - } - - get [Symbol.toStringTag]() { - return 'LazyResult' - } - - constructor(processor, css, opts) { - this.stringified = false - this.processed = false - - let root - if ( - typeof css === 'object' && - css !== null && - (css.type === 'root' || css.type === 'document') - ) { - root = cleanMarks(css) - } else if (css instanceof LazyResult || css instanceof Result) { - root = cleanMarks(css.root) - if (css.map) { - if (typeof opts.map === 'undefined') opts.map = {} - if (!opts.map.inline) opts.map.inline = false - opts.map.prev = css.map - } - } else { - let parser = parse - if (opts.syntax) parser = opts.syntax.parse - if (opts.parser) parser = opts.parser - if (parser.parse) parser = parser.parse - - try { - root = parser(css, opts) - } catch (error) { - this.processed = true - this.error = error - } - - if (root && !root[my]) { - /* c8 ignore next 2 */ - Container.rebuild(root) - } - } - - this.result = new Result(processor, root, opts) - this.helpers = { ...postcss, postcss, result: this.result } - this.plugins = this.processor.plugins.map(plugin => { - if (typeof plugin === 'object' && plugin.prepare) { - return { ...plugin, ...plugin.prepare(this.result) } - } else { - return plugin - } - }) - } - - async() { - if (this.error) return Promise.reject(this.error) - if (this.processed) return Promise.resolve(this.result) - if (!this.processing) { - this.processing = this.runAsync() - } - return this.processing - } - - catch(onRejected) { - return this.async().catch(onRejected) - } - - finally(onFinally) { - return this.async().then(onFinally, onFinally) - } - - getAsyncError() { - throw new Error('Use process(css).then(cb) to work with async plugins') - } - - handleError(error, node) { - let plugin = this.result.lastPlugin - try { - if (node) node.addToError(error) - this.error = error - if (error.name === 'CssSyntaxError' && !error.plugin) { - error.plugin = plugin.postcssPlugin - error.setMessage() - } else if (plugin.postcssVersion) { - if (true) { - let pluginName = plugin.postcssPlugin - let pluginVer = plugin.postcssVersion - let runtimeVer = this.result.processor.version - let a = pluginVer.split('.') - let b = runtimeVer.split('.') - - if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { - // eslint-disable-next-line no-console - console.error( - 'Unknown error from PostCSS plugin. Your current PostCSS ' + - 'version is ' + - runtimeVer + - ', but ' + - pluginName + - ' uses ' + - pluginVer + - '. Perhaps this is the source of the error below.' - ) - } - } - } - } catch (err) { - /* c8 ignore next 3 */ - // eslint-disable-next-line no-console - if (console && console.error) console.error(err) - } - return error - } - - prepareVisitors() { - this.listeners = {} - let add = (plugin, type, cb) => { - if (!this.listeners[type]) this.listeners[type] = [] - this.listeners[type].push([plugin, cb]) - } - for (let plugin of this.plugins) { - if (typeof plugin === 'object') { - for (let event in plugin) { - if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { - throw new Error( - `Unknown event ${event} in ${plugin.postcssPlugin}. ` + - `Try to update PostCSS (${this.processor.version} now).` - ) - } - if (!NOT_VISITORS[event]) { - if (typeof plugin[event] === 'object') { - for (let filter in plugin[event]) { - if (filter === '*') { - add(plugin, event, plugin[event][filter]) - } else { - add( - plugin, - event + '-' + filter.toLowerCase(), - plugin[event][filter] - ) - } - } - } else if (typeof plugin[event] === 'function') { - add(plugin, event, plugin[event]) - } - } - } - } - } - this.hasListener = Object.keys(this.listeners).length > 0 - } - - async runAsync() { - this.plugin = 0 - for (let i = 0; i < this.plugins.length; i++) { - let plugin = this.plugins[i] - let promise = this.runOnRoot(plugin) - if (isPromise(promise)) { - try { - await promise - } catch (error) { - throw this.handleError(error) - } - } - } - - this.prepareVisitors() - if (this.hasListener) { - let root = this.result.root - while (!root[isClean]) { - root[isClean] = true - let stack = [toStack(root)] - while (stack.length > 0) { - let promise = this.visitTick(stack) - if (isPromise(promise)) { - try { - await promise - } catch (e) { - let node = stack[stack.length - 1].node - throw this.handleError(e, node) - } - } - } - } - - if (this.listeners.OnceExit) { - for (let [plugin, visitor] of this.listeners.OnceExit) { - this.result.lastPlugin = plugin - try { - if (root.type === 'document') { - let roots = root.nodes.map(subRoot => - visitor(subRoot, this.helpers) - ) - - await Promise.all(roots) - } else { - await visitor(root, this.helpers) - } - } catch (e) { - throw this.handleError(e) - } - } - } - } - - this.processed = true - return this.stringify() - } - - runOnRoot(plugin) { - this.result.lastPlugin = plugin - try { - if (typeof plugin === 'object' && plugin.Once) { - if (this.result.root.type === 'document') { - let roots = this.result.root.nodes.map(root => - plugin.Once(root, this.helpers) - ) - - if (isPromise(roots[0])) { - return Promise.all(roots) - } - - return roots - } - - return plugin.Once(this.result.root, this.helpers) - } else if (typeof plugin === 'function') { - return plugin(this.result.root, this.result) - } - } catch (error) { - throw this.handleError(error) - } - } - - stringify() { - if (this.error) throw this.error - if (this.stringified) return this.result - this.stringified = true - - this.sync() - - let opts = this.result.opts - let str = stringify - if (opts.syntax) str = opts.syntax.stringify - if (opts.stringifier) str = opts.stringifier - if (str.stringify) str = str.stringify - - let map = new MapGenerator(str, this.result.root, this.result.opts) - let data = map.generate() - this.result.css = data[0] - this.result.map = data[1] - - return this.result - } - - sync() { - if (this.error) throw this.error - if (this.processed) return this.result - this.processed = true - - if (this.processing) { - throw this.getAsyncError() - } - - for (let plugin of this.plugins) { - let promise = this.runOnRoot(plugin) - if (isPromise(promise)) { - throw this.getAsyncError() - } - } - - this.prepareVisitors() - if (this.hasListener) { - let root = this.result.root - while (!root[isClean]) { - root[isClean] = true - this.walkSync(root) - } - if (this.listeners.OnceExit) { - if (root.type === 'document') { - for (let subRoot of root.nodes) { - this.visitSync(this.listeners.OnceExit, subRoot) - } - } else { - this.visitSync(this.listeners.OnceExit, root) - } - } - } - - return this.result - } - - then(onFulfilled, onRejected) { - if (true) { - if (!('from' in this.opts)) { - warnOnce( - 'Without `from` option PostCSS could generate wrong source map ' + - 'and will not find Browserslist config. Set it to CSS file path ' + - 'or to `undefined` to prevent this warning.' - ) - } - } - return this.async().then(onFulfilled, onRejected) - } - - toString() { - return this.css - } - - visitSync(visitors, node) { - for (let [plugin, visitor] of visitors) { - this.result.lastPlugin = plugin - let promise - try { - promise = visitor(node, this.helpers) - } catch (e) { - throw this.handleError(e, node.proxyOf) - } - if (node.type !== 'root' && node.type !== 'document' && !node.parent) { - return true - } - if (isPromise(promise)) { - throw this.getAsyncError() - } - } - } - - visitTick(stack) { - let visit = stack[stack.length - 1] - let { node, visitors } = visit - - if (node.type !== 'root' && node.type !== 'document' && !node.parent) { - stack.pop() - return - } - - if (visitors.length > 0 && visit.visitorIndex < visitors.length) { - let [plugin, visitor] = visitors[visit.visitorIndex] - visit.visitorIndex += 1 - if (visit.visitorIndex === visitors.length) { - visit.visitors = [] - visit.visitorIndex = 0 - } - this.result.lastPlugin = plugin - try { - return visitor(node.toProxy(), this.helpers) - } catch (e) { - throw this.handleError(e, node) - } - } - - if (visit.iterator !== 0) { - let iterator = visit.iterator - let child - while ((child = node.nodes[node.indexes[iterator]])) { - node.indexes[iterator] += 1 - if (!child[isClean]) { - child[isClean] = true - stack.push(toStack(child)) - return - } - } - visit.iterator = 0 - delete node.indexes[iterator] - } - - let events = visit.events - while (visit.eventIndex < events.length) { - let event = events[visit.eventIndex] - visit.eventIndex += 1 - if (event === CHILDREN) { - if (node.nodes && node.nodes.length) { - node[isClean] = true - visit.iterator = node.getIterator() - } - return - } else if (this.listeners[event]) { - visit.visitors = this.listeners[event] - return - } - } - stack.pop() - } - - walkSync(node) { - node[isClean] = true - let events = getEvents(node) - for (let event of events) { - if (event === CHILDREN) { - if (node.nodes) { - node.each(child => { - if (!child[isClean]) this.walkSync(child) - }) - } - } else { - let visitors = this.listeners[event] - if (visitors) { - if (this.visitSync(visitors, node.toProxy())) return - } - } - } - } - - warnings() { - return this.sync().warnings() - } -} - -LazyResult.registerPostcss = dependant => { - postcss = dependant -} - -module.exports = LazyResult -LazyResult.default = LazyResult - -Root.registerLazyResult(LazyResult) -Document.registerLazyResult(LazyResult) - - -/***/ }), - -/***/ "./node_modules/postcss/lib/list.js": -/*!******************************************!*\ - !*** ./node_modules/postcss/lib/list.js ***! - \******************************************/ -/***/ ((module) => { - -"use strict"; - - -let list = { - comma(string) { - return list.split(string, [','], true) - }, - - space(string) { - let spaces = [' ', '\n', '\t'] - return list.split(string, spaces) - }, - - split(string, separators, last) { - let array = [] - let current = '' - let split = false - - let func = 0 - let inQuote = false - let prevQuote = '' - let escape = false - - for (let letter of string) { - if (escape) { - escape = false - } else if (letter === '\\') { - escape = true - } else if (inQuote) { - if (letter === prevQuote) { - inQuote = false - } - } else if (letter === '"' || letter === "'") { - inQuote = true - prevQuote = letter - } else if (letter === '(') { - func += 1 - } else if (letter === ')') { - if (func > 0) func -= 1 - } else if (func === 0) { - if (separators.includes(letter)) split = true - } - - if (split) { - if (current !== '') array.push(current.trim()) - current = '' - split = false - } else { - current += letter - } - } - - if (last || current !== '') array.push(current.trim()) - return array - } -} - -module.exports = list -list.default = list - - -/***/ }), - -/***/ "./node_modules/postcss/lib/map-generator.js": -/*!***************************************************!*\ - !*** ./node_modules/postcss/lib/map-generator.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let { dirname, relative, resolve, sep } = __webpack_require__(/*! path */ "?6197") -let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(/*! source-map-js */ "?b8cb") -let { pathToFileURL } = __webpack_require__(/*! url */ "./node_modules/whatwg-url/index.js") - -let Input = __webpack_require__(/*! ./input */ "./node_modules/postcss/lib/input.js") - -let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) -let pathAvailable = Boolean(dirname && resolve && relative && sep) - -class MapGenerator { - constructor(stringify, root, opts, cssString) { - this.stringify = stringify - this.mapOpts = opts.map || {} - this.root = root - this.opts = opts - this.css = cssString - this.originalCSS = cssString - this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute - - this.memoizedFileURLs = new Map() - this.memoizedPaths = new Map() - this.memoizedURLs = new Map() - } - - addAnnotation() { - let content - - if (this.isInline()) { - content = - 'data:application/json;base64,' + this.toBase64(this.map.toString()) - } else if (typeof this.mapOpts.annotation === 'string') { - content = this.mapOpts.annotation - } else if (typeof this.mapOpts.annotation === 'function') { - content = this.mapOpts.annotation(this.opts.to, this.root) - } else { - content = this.outputFile() + '.map' - } - let eol = '\n' - if (this.css.includes('\r\n')) eol = '\r\n' - - this.css += eol + '/*# sourceMappingURL=' + content + ' */' - } - - applyPrevMaps() { - for (let prev of this.previous()) { - let from = this.toUrl(this.path(prev.file)) - let root = prev.root || dirname(prev.file) - let map - - if (this.mapOpts.sourcesContent === false) { - map = new SourceMapConsumer(prev.text) - if (map.sourcesContent) { - map.sourcesContent = null - } - } else { - map = prev.consumer() - } - - this.map.applySourceMap(map, from, this.toUrl(this.path(root))) - } - } - - clearAnnotation() { - if (this.mapOpts.annotation === false) return - - if (this.root) { - let node - for (let i = this.root.nodes.length - 1; i >= 0; i--) { - node = this.root.nodes[i] - if (node.type !== 'comment') continue - if (node.text.startsWith('# sourceMappingURL=')) { - this.root.removeChild(i) - } - } - } else if (this.css) { - this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '') - } - } - - generate() { - this.clearAnnotation() - if (pathAvailable && sourceMapAvailable && this.isMap()) { - return this.generateMap() - } else { - let result = '' - this.stringify(this.root, i => { - result += i - }) - return [result] - } - } - - generateMap() { - if (this.root) { - this.generateString() - } else if (this.previous().length === 1) { - let prev = this.previous()[0].consumer() - prev.file = this.outputFile() - this.map = SourceMapGenerator.fromSourceMap(prev, { - ignoreInvalidMapping: true - }) - } else { - this.map = new SourceMapGenerator({ - file: this.outputFile(), - ignoreInvalidMapping: true - }) - this.map.addMapping({ - generated: { column: 0, line: 1 }, - original: { column: 0, line: 1 }, - source: this.opts.from - ? this.toUrl(this.path(this.opts.from)) - : '' - }) - } - - if (this.isSourcesContent()) this.setSourcesContent() - if (this.root && this.previous().length > 0) this.applyPrevMaps() - if (this.isAnnotation()) this.addAnnotation() - - if (this.isInline()) { - return [this.css] - } else { - return [this.css, this.map] - } - } - - generateString() { - this.css = '' - this.map = new SourceMapGenerator({ - file: this.outputFile(), - ignoreInvalidMapping: true - }) - - let line = 1 - let column = 1 - - let noSource = '' - let mapping = { - generated: { column: 0, line: 0 }, - original: { column: 0, line: 0 }, - source: '' - } - - let last, lines - this.stringify(this.root, (str, node, type) => { - this.css += str - - if (node && type !== 'end') { - mapping.generated.line = line - mapping.generated.column = column - 1 - if (node.source && node.source.start) { - mapping.source = this.sourcePath(node) - mapping.original.line = node.source.start.line - mapping.original.column = node.source.start.column - 1 - this.map.addMapping(mapping) - } else { - mapping.source = noSource - mapping.original.line = 1 - mapping.original.column = 0 - this.map.addMapping(mapping) - } - } - - lines = str.match(/\n/g) - if (lines) { - line += lines.length - last = str.lastIndexOf('\n') - column = str.length - last - } else { - column += str.length - } - - if (node && type !== 'start') { - let p = node.parent || { raws: {} } - let childless = - node.type === 'decl' || (node.type === 'atrule' && !node.nodes) - if (!childless || node !== p.last || p.raws.semicolon) { - if (node.source && node.source.end) { - mapping.source = this.sourcePath(node) - mapping.original.line = node.source.end.line - mapping.original.column = node.source.end.column - 1 - mapping.generated.line = line - mapping.generated.column = column - 2 - this.map.addMapping(mapping) - } else { - mapping.source = noSource - mapping.original.line = 1 - mapping.original.column = 0 - mapping.generated.line = line - mapping.generated.column = column - 1 - this.map.addMapping(mapping) - } - } - } - }) - } - - isAnnotation() { - if (this.isInline()) { - return true - } - if (typeof this.mapOpts.annotation !== 'undefined') { - return this.mapOpts.annotation - } - if (this.previous().length) { - return this.previous().some(i => i.annotation) - } - return true - } - - isInline() { - if (typeof this.mapOpts.inline !== 'undefined') { - return this.mapOpts.inline - } - - let annotation = this.mapOpts.annotation - if (typeof annotation !== 'undefined' && annotation !== true) { - return false - } - - if (this.previous().length) { - return this.previous().some(i => i.inline) - } - return true - } - - isMap() { - if (typeof this.opts.map !== 'undefined') { - return !!this.opts.map - } - return this.previous().length > 0 - } - - isSourcesContent() { - if (typeof this.mapOpts.sourcesContent !== 'undefined') { - return this.mapOpts.sourcesContent - } - if (this.previous().length) { - return this.previous().some(i => i.withContent()) - } - return true - } - - outputFile() { - if (this.opts.to) { - return this.path(this.opts.to) - } else if (this.opts.from) { - return this.path(this.opts.from) - } else { - return 'to.css' - } - } - - path(file) { - if (this.mapOpts.absolute) return file - if (file.charCodeAt(0) === 60 /* `<` */) return file - if (/^\w+:\/\//.test(file)) return file - let cached = this.memoizedPaths.get(file) - if (cached) return cached - - let from = this.opts.to ? dirname(this.opts.to) : '.' - - if (typeof this.mapOpts.annotation === 'string') { - from = dirname(resolve(from, this.mapOpts.annotation)) - } - - let path = relative(from, file) - this.memoizedPaths.set(file, path) - - return path - } - - previous() { - if (!this.previousMaps) { - this.previousMaps = [] - if (this.root) { - this.root.walk(node => { - if (node.source && node.source.input.map) { - let map = node.source.input.map - if (!this.previousMaps.includes(map)) { - this.previousMaps.push(map) - } - } - }) - } else { - let input = new Input(this.originalCSS, this.opts) - if (input.map) this.previousMaps.push(input.map) - } - } - - return this.previousMaps - } - - setSourcesContent() { - let already = {} - if (this.root) { - this.root.walk(node => { - if (node.source) { - let from = node.source.input.from - if (from && !already[from]) { - already[from] = true - let fromUrl = this.usesFileUrls - ? this.toFileUrl(from) - : this.toUrl(this.path(from)) - this.map.setSourceContent(fromUrl, node.source.input.css) - } - } - }) - } else if (this.css) { - let from = this.opts.from - ? this.toUrl(this.path(this.opts.from)) - : '' - this.map.setSourceContent(from, this.css) - } - } - - sourcePath(node) { - if (this.mapOpts.from) { - return this.toUrl(this.mapOpts.from) - } else if (this.usesFileUrls) { - return this.toFileUrl(node.source.input.from) - } else { - return this.toUrl(this.path(node.source.input.from)) - } - } - - toBase64(str) { - if (Buffer) { - return Buffer.from(str).toString('base64') - } else { - return window.btoa(unescape(encodeURIComponent(str))) - } - } - - toFileUrl(path) { - let cached = this.memoizedFileURLs.get(path) - if (cached) return cached - - if (pathToFileURL) { - let fileURL = pathToFileURL(path).toString() - this.memoizedFileURLs.set(path, fileURL) - - return fileURL - } else { - throw new Error( - '`map.absolute` option is not available in this PostCSS build' - ) - } - } - - toUrl(path) { - let cached = this.memoizedURLs.get(path) - if (cached) return cached - - if (sep === '\\') { - path = path.replace(/\\/g, '/') - } - - let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent) - this.memoizedURLs.set(path, url) - - return url - } -} - -module.exports = MapGenerator - - -/***/ }), - -/***/ "./node_modules/postcss/lib/no-work-result.js": -/*!****************************************************!*\ - !*** ./node_modules/postcss/lib/no-work-result.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let MapGenerator = __webpack_require__(/*! ./map-generator */ "./node_modules/postcss/lib/map-generator.js") -let parse = __webpack_require__(/*! ./parse */ "./node_modules/postcss/lib/parse.js") -const Result = __webpack_require__(/*! ./result */ "./node_modules/postcss/lib/result.js") -let stringify = __webpack_require__(/*! ./stringify */ "./node_modules/postcss/lib/stringify.js") -let warnOnce = __webpack_require__(/*! ./warn-once */ "./node_modules/postcss/lib/warn-once.js") - -class NoWorkResult { - get content() { - return this.result.css - } - - get css() { - return this.result.css - } - - get map() { - return this.result.map - } - - get messages() { - return [] - } - - get opts() { - return this.result.opts - } - - get processor() { - return this.result.processor - } - - get root() { - if (this._root) { - return this._root - } - - let root - let parser = parse - - try { - root = parser(this._css, this._opts) - } catch (error) { - this.error = error - } - - if (this.error) { - throw this.error - } else { - this._root = root - return root - } - } - - get [Symbol.toStringTag]() { - return 'NoWorkResult' - } - - constructor(processor, css, opts) { - css = css.toString() - this.stringified = false - - this._processor = processor - this._css = css - this._opts = opts - this._map = undefined - let root - - let str = stringify - this.result = new Result(this._processor, root, this._opts) - this.result.css = css - - let self = this - Object.defineProperty(this.result, 'root', { - get() { - return self.root - } - }) - - let map = new MapGenerator(str, root, this._opts, css) - if (map.isMap()) { - let [generatedCSS, generatedMap] = map.generate() - if (generatedCSS) { - this.result.css = generatedCSS - } - if (generatedMap) { - this.result.map = generatedMap - } - } else { - map.clearAnnotation() - this.result.css = map.css - } - } - - async() { - if (this.error) return Promise.reject(this.error) - return Promise.resolve(this.result) - } - - catch(onRejected) { - return this.async().catch(onRejected) - } - - finally(onFinally) { - return this.async().then(onFinally, onFinally) - } - - sync() { - if (this.error) throw this.error - return this.result - } - - then(onFulfilled, onRejected) { - if (true) { - if (!('from' in this._opts)) { - warnOnce( - 'Without `from` option PostCSS could generate wrong source map ' + - 'and will not find Browserslist config. Set it to CSS file path ' + - 'or to `undefined` to prevent this warning.' - ) - } - } - - return this.async().then(onFulfilled, onRejected) - } - - toString() { - return this._css - } - - warnings() { - return [] - } -} - -module.exports = NoWorkResult -NoWorkResult.default = NoWorkResult - - -/***/ }), - -/***/ "./node_modules/postcss/lib/node.js": -/*!******************************************!*\ - !*** ./node_modules/postcss/lib/node.js ***! - \******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let CssSyntaxError = __webpack_require__(/*! ./css-syntax-error */ "./node_modules/postcss/lib/css-syntax-error.js") -let Stringifier = __webpack_require__(/*! ./stringifier */ "./node_modules/postcss/lib/stringifier.js") -let stringify = __webpack_require__(/*! ./stringify */ "./node_modules/postcss/lib/stringify.js") -let { isClean, my } = __webpack_require__(/*! ./symbols */ "./node_modules/postcss/lib/symbols.js") - -function cloneNode(obj, parent) { - let cloned = new obj.constructor() - - for (let i in obj) { - if (!Object.prototype.hasOwnProperty.call(obj, i)) { - /* c8 ignore next 2 */ - continue - } - if (i === 'proxyCache') continue - let value = obj[i] - let type = typeof value - - if (i === 'parent' && type === 'object') { - if (parent) cloned[i] = parent - } else if (i === 'source') { - cloned[i] = value - } else if (Array.isArray(value)) { - cloned[i] = value.map(j => cloneNode(j, cloned)) - } else { - if (type === 'object' && value !== null) value = cloneNode(value) - cloned[i] = value - } - } - - return cloned -} - -function sourceOffset(inputCSS, position) { - // Not all custom syntaxes support `offset` in `source.start` and `source.end` - if (position && typeof position.offset !== 'undefined') { - return position.offset - } - - let column = 1 - let line = 1 - let offset = 0 - - for (let i = 0; i < inputCSS.length; i++) { - if (line === position.line && column === position.column) { - offset = i - break - } - - if (inputCSS[i] === '\n') { - column = 1 - line += 1 - } else { - column += 1 - } - } - - return offset -} - -class Node { - get proxyOf() { - return this - } - - constructor(defaults = {}) { - this.raws = {} - this[isClean] = false - this[my] = true - - for (let name in defaults) { - if (name === 'nodes') { - this.nodes = [] - for (let node of defaults[name]) { - if (typeof node.clone === 'function') { - this.append(node.clone()) - } else { - this.append(node) - } - } - } else { - this[name] = defaults[name] - } - } - } - - addToError(error) { - error.postcssNode = this - if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { - let s = this.source - error.stack = error.stack.replace( - /\n\s{4}at /, - `$&${s.input.from}:${s.start.line}:${s.start.column}$&` - ) - } - return error - } - - after(add) { - this.parent.insertAfter(this, add) - return this - } - - assign(overrides = {}) { - for (let name in overrides) { - this[name] = overrides[name] - } - return this - } - - before(add) { - this.parent.insertBefore(this, add) - return this - } - - cleanRaws(keepBetween) { - delete this.raws.before - delete this.raws.after - if (!keepBetween) delete this.raws.between - } - - clone(overrides = {}) { - let cloned = cloneNode(this) - for (let name in overrides) { - cloned[name] = overrides[name] - } - return cloned - } - - cloneAfter(overrides = {}) { - let cloned = this.clone(overrides) - this.parent.insertAfter(this, cloned) - return cloned - } - - cloneBefore(overrides = {}) { - let cloned = this.clone(overrides) - this.parent.insertBefore(this, cloned) - return cloned - } - - error(message, opts = {}) { - if (this.source) { - let { end, start } = this.rangeBy(opts) - return this.source.input.error( - message, - { column: start.column, line: start.line }, - { column: end.column, line: end.line }, - opts - ) - } - return new CssSyntaxError(message) - } - - getProxyProcessor() { - return { - get(node, prop) { - if (prop === 'proxyOf') { - return node - } else if (prop === 'root') { - return () => node.root().toProxy() - } else { - return node[prop] - } - }, - - set(node, prop, value) { - if (node[prop] === value) return true - node[prop] = value - if ( - prop === 'prop' || - prop === 'value' || - prop === 'name' || - prop === 'params' || - prop === 'important' || - /* c8 ignore next */ - prop === 'text' - ) { - node.markDirty() - } - return true - } - } - } - - /* c8 ignore next 3 */ - markClean() { - this[isClean] = true - } - - markDirty() { - if (this[isClean]) { - this[isClean] = false - let next = this - while ((next = next.parent)) { - next[isClean] = false - } - } - } - - next() { - if (!this.parent) return undefined - let index = this.parent.index(this) - return this.parent.nodes[index + 1] - } - - positionBy(opts = {}) { - let pos = this.source.start - if (opts.index) { - pos = this.positionInside(opts.index) - } else if (opts.word) { - let inputString = - 'document' in this.source.input - ? this.source.input.document - : this.source.input.css - let stringRepresentation = inputString.slice( - sourceOffset(inputString, this.source.start), - sourceOffset(inputString, this.source.end) - ) - let index = stringRepresentation.indexOf(opts.word) - if (index !== -1) pos = this.positionInside(index) - } - return pos - } - - positionInside(index) { - let column = this.source.start.column - let line = this.source.start.line - let inputString = - 'document' in this.source.input - ? this.source.input.document - : this.source.input.css - let offset = sourceOffset(inputString, this.source.start) - let end = offset + index - - for (let i = offset; i < end; i++) { - if (inputString[i] === '\n') { - column = 1 - line += 1 - } else { - column += 1 - } - } - - return { column, line, offset: end } - } - - prev() { - if (!this.parent) return undefined - let index = this.parent.index(this) - return this.parent.nodes[index - 1] - } - - rangeBy(opts = {}) { - let inputString = - 'document' in this.source.input - ? this.source.input.document - : this.source.input.css - let start = { - column: this.source.start.column, - line: this.source.start.line, - offset: sourceOffset(inputString, this.source.start) - } - let end = this.source.end - ? { - column: this.source.end.column + 1, - line: this.source.end.line, - offset: - typeof this.source.end.offset === 'number' - ? // `source.end.offset` is exclusive, so we don't need to add 1 - this.source.end.offset - : // Since line/column in this.source.end is inclusive, - // the `sourceOffset(... , this.source.end)` returns an inclusive offset. - // So, we add 1 to convert it to exclusive. - sourceOffset(inputString, this.source.end) + 1 - } - : { - column: start.column + 1, - line: start.line, - offset: start.offset + 1 - } - - if (opts.word) { - let stringRepresentation = inputString.slice( - sourceOffset(inputString, this.source.start), - sourceOffset(inputString, this.source.end) - ) - let index = stringRepresentation.indexOf(opts.word) - if (index !== -1) { - start = this.positionInside(index) - end = this.positionInside(index + opts.word.length) - } - } else { - if (opts.start) { - start = { - column: opts.start.column, - line: opts.start.line, - offset: sourceOffset(inputString, opts.start) - } - } else if (opts.index) { - start = this.positionInside(opts.index) - } - - if (opts.end) { - end = { - column: opts.end.column, - line: opts.end.line, - offset: sourceOffset(inputString, opts.end) - } - } else if (typeof opts.endIndex === 'number') { - end = this.positionInside(opts.endIndex) - } else if (opts.index) { - end = this.positionInside(opts.index + 1) - } - } - - if ( - end.line < start.line || - (end.line === start.line && end.column <= start.column) - ) { - end = { - column: start.column + 1, - line: start.line, - offset: start.offset + 1 - } - } - - return { end, start } - } - - raw(prop, defaultType) { - let str = new Stringifier() - return str.raw(this, prop, defaultType) - } - - remove() { - if (this.parent) { - this.parent.removeChild(this) - } - this.parent = undefined - return this - } - - replaceWith(...nodes) { - if (this.parent) { - let bookmark = this - let foundSelf = false - for (let node of nodes) { - if (node === this) { - foundSelf = true - } else if (foundSelf) { - this.parent.insertAfter(bookmark, node) - bookmark = node - } else { - this.parent.insertBefore(bookmark, node) - } - } - - if (!foundSelf) { - this.remove() - } - } - - return this - } - - root() { - let result = this - while (result.parent && result.parent.type !== 'document') { - result = result.parent - } - return result - } - - toJSON(_, inputs) { - let fixed = {} - let emitInputs = inputs == null - inputs = inputs || new Map() - let inputsNextIndex = 0 - - for (let name in this) { - if (!Object.prototype.hasOwnProperty.call(this, name)) { - /* c8 ignore next 2 */ - continue - } - if (name === 'parent' || name === 'proxyCache') continue - let value = this[name] - - if (Array.isArray(value)) { - fixed[name] = value.map(i => { - if (typeof i === 'object' && i.toJSON) { - return i.toJSON(null, inputs) - } else { - return i - } - }) - } else if (typeof value === 'object' && value.toJSON) { - fixed[name] = value.toJSON(null, inputs) - } else if (name === 'source') { - if (value == null) continue - let inputId = inputs.get(value.input) - if (inputId == null) { - inputId = inputsNextIndex - inputs.set(value.input, inputsNextIndex) - inputsNextIndex++ - } - fixed[name] = { - end: value.end, - inputId, - start: value.start - } - } else { - fixed[name] = value - } - } - - if (emitInputs) { - fixed.inputs = [...inputs.keys()].map(input => input.toJSON()) - } - - return fixed - } - - toProxy() { - if (!this.proxyCache) { - this.proxyCache = new Proxy(this, this.getProxyProcessor()) - } - return this.proxyCache - } - - toString(stringifier = stringify) { - if (stringifier.stringify) stringifier = stringifier.stringify - let result = '' - stringifier(this, i => { - result += i - }) - return result - } - - warn(result, text, opts = {}) { - let data = { node: this } - for (let i in opts) data[i] = opts[i] - return result.warn(text, data) - } -} - -module.exports = Node -Node.default = Node - - -/***/ }), - -/***/ "./node_modules/postcss/lib/parse.js": -/*!*******************************************!*\ - !*** ./node_modules/postcss/lib/parse.js ***! - \*******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Container = __webpack_require__(/*! ./container */ "./node_modules/postcss/lib/container.js") -let Input = __webpack_require__(/*! ./input */ "./node_modules/postcss/lib/input.js") -let Parser = __webpack_require__(/*! ./parser */ "./node_modules/postcss/lib/parser.js") - -function parse(css, opts) { - let input = new Input(css, opts) - let parser = new Parser(input) - try { - parser.parse() - } catch (e) { - if (true) { - if (e.name === 'CssSyntaxError' && opts && opts.from) { - if (/\.scss$/i.test(opts.from)) { - e.message += - '\nYou tried to parse SCSS with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-scss parser' - } else if (/\.sass/i.test(opts.from)) { - e.message += - '\nYou tried to parse Sass with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-sass parser' - } else if (/\.less$/i.test(opts.from)) { - e.message += - '\nYou tried to parse Less with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-less parser' - } - } - } - throw e - } - - return parser.root -} - -module.exports = parse -parse.default = parse - -Container.registerParse(parse) - - -/***/ }), - -/***/ "./node_modules/postcss/lib/parser.js": -/*!********************************************!*\ - !*** ./node_modules/postcss/lib/parser.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let AtRule = __webpack_require__(/*! ./at-rule */ "./node_modules/postcss/lib/at-rule.js") -let Comment = __webpack_require__(/*! ./comment */ "./node_modules/postcss/lib/comment.js") -let Declaration = __webpack_require__(/*! ./declaration */ "./node_modules/postcss/lib/declaration.js") -let Root = __webpack_require__(/*! ./root */ "./node_modules/postcss/lib/root.js") -let Rule = __webpack_require__(/*! ./rule */ "./node_modules/postcss/lib/rule.js") -let tokenizer = __webpack_require__(/*! ./tokenize */ "./node_modules/postcss/lib/tokenize.js") - -const SAFE_COMMENT_NEIGHBOR = { - empty: true, - space: true -} - -function findLastWithPosition(tokens) { - for (let i = tokens.length - 1; i >= 0; i--) { - let token = tokens[i] - let pos = token[3] || token[2] - if (pos) return pos - } -} - -class Parser { - constructor(input) { - this.input = input - - this.root = new Root() - this.current = this.root - this.spaces = '' - this.semicolon = false - - this.createTokenizer() - this.root.source = { input, start: { column: 1, line: 1, offset: 0 } } - } - - atrule(token) { - let node = new AtRule() - node.name = token[1].slice(1) - if (node.name === '') { - this.unnamedAtrule(node, token) - } - this.init(node, token[2]) - - let type - let prev - let shift - let last = false - let open = false - let params = [] - let brackets = [] - - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken() - type = token[0] - - if (type === '(' || type === '[') { - brackets.push(type === '(' ? ')' : ']') - } else if (type === '{' && brackets.length > 0) { - brackets.push('}') - } else if (type === brackets[brackets.length - 1]) { - brackets.pop() - } - - if (brackets.length === 0) { - if (type === ';') { - node.source.end = this.getPosition(token[2]) - node.source.end.offset++ - this.semicolon = true - break - } else if (type === '{') { - open = true - break - } else if (type === '}') { - if (params.length > 0) { - shift = params.length - 1 - prev = params[shift] - while (prev && prev[0] === 'space') { - prev = params[--shift] - } - if (prev) { - node.source.end = this.getPosition(prev[3] || prev[2]) - node.source.end.offset++ - } - } - this.end(token) - break - } else { - params.push(token) - } - } else { - params.push(token) - } - - if (this.tokenizer.endOfFile()) { - last = true - break - } - } - - node.raws.between = this.spacesAndCommentsFromEnd(params) - if (params.length) { - node.raws.afterName = this.spacesAndCommentsFromStart(params) - this.raw(node, 'params', params) - if (last) { - token = params[params.length - 1] - node.source.end = this.getPosition(token[3] || token[2]) - node.source.end.offset++ - this.spaces = node.raws.between - node.raws.between = '' - } - } else { - node.raws.afterName = '' - node.params = '' - } - - if (open) { - node.nodes = [] - this.current = node - } - } - - checkMissedSemicolon(tokens) { - let colon = this.colon(tokens) - if (colon === false) return - - let founded = 0 - let token - for (let j = colon - 1; j >= 0; j--) { - token = tokens[j] - if (token[0] !== 'space') { - founded += 1 - if (founded === 2) break - } - } - // If the token is a word, e.g. `!important`, `red` or any other valid property's value. - // Then we need to return the colon after that word token. [3] is the "end" colon of that word. - // And because we need it after that one we do +1 to get the next one. - throw this.input.error( - 'Missed semicolon', - token[0] === 'word' ? token[3] + 1 : token[2] - ) - } - - colon(tokens) { - let brackets = 0 - let prev, token, type - for (let [i, element] of tokens.entries()) { - token = element - type = token[0] - - if (type === '(') { - brackets += 1 - } - if (type === ')') { - brackets -= 1 - } - if (brackets === 0 && type === ':') { - if (!prev) { - this.doubleColon(token) - } else if (prev[0] === 'word' && prev[1] === 'progid') { - continue - } else { - return i - } - } - - prev = token - } - return false - } - - comment(token) { - let node = new Comment() - this.init(node, token[2]) - node.source.end = this.getPosition(token[3] || token[2]) - node.source.end.offset++ - - let text = token[1].slice(2, -2) - if (/^\s*$/.test(text)) { - node.text = '' - node.raws.left = text - node.raws.right = '' - } else { - let match = text.match(/^(\s*)([^]*\S)(\s*)$/) - node.text = match[2] - node.raws.left = match[1] - node.raws.right = match[3] - } - } - - createTokenizer() { - this.tokenizer = tokenizer(this.input) - } - - decl(tokens, customProperty) { - let node = new Declaration() - this.init(node, tokens[0][2]) - - let last = tokens[tokens.length - 1] - if (last[0] === ';') { - this.semicolon = true - tokens.pop() - } - - node.source.end = this.getPosition( - last[3] || last[2] || findLastWithPosition(tokens) - ) - node.source.end.offset++ - - while (tokens[0][0] !== 'word') { - if (tokens.length === 1) this.unknownWord(tokens) - node.raws.before += tokens.shift()[1] - } - node.source.start = this.getPosition(tokens[0][2]) - - node.prop = '' - while (tokens.length) { - let type = tokens[0][0] - if (type === ':' || type === 'space' || type === 'comment') { - break - } - node.prop += tokens.shift()[1] - } - - node.raws.between = '' - - let token - while (tokens.length) { - token = tokens.shift() - - if (token[0] === ':') { - node.raws.between += token[1] - break - } else { - if (token[0] === 'word' && /\w/.test(token[1])) { - this.unknownWord([token]) - } - node.raws.between += token[1] - } - } - - if (node.prop[0] === '_' || node.prop[0] === '*') { - node.raws.before += node.prop[0] - node.prop = node.prop.slice(1) - } - - let firstSpaces = [] - let next - while (tokens.length) { - next = tokens[0][0] - if (next !== 'space' && next !== 'comment') break - firstSpaces.push(tokens.shift()) - } - - this.precheckMissedSemicolon(tokens) - - for (let i = tokens.length - 1; i >= 0; i--) { - token = tokens[i] - if (token[1].toLowerCase() === '!important') { - node.important = true - let string = this.stringFrom(tokens, i) - string = this.spacesFromEnd(tokens) + string - if (string !== ' !important') node.raws.important = string - break - } else if (token[1].toLowerCase() === 'important') { - let cache = tokens.slice(0) - let str = '' - for (let j = i; j > 0; j--) { - let type = cache[j][0] - if (str.trim().startsWith('!') && type !== 'space') { - break - } - str = cache.pop()[1] + str - } - if (str.trim().startsWith('!')) { - node.important = true - node.raws.important = str - tokens = cache - } - } - - if (token[0] !== 'space' && token[0] !== 'comment') { - break - } - } - - let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment') - - if (hasWord) { - node.raws.between += firstSpaces.map(i => i[1]).join('') - firstSpaces = [] - } - this.raw(node, 'value', firstSpaces.concat(tokens), customProperty) - - if (node.value.includes(':') && !customProperty) { - this.checkMissedSemicolon(tokens) - } - } - - doubleColon(token) { - throw this.input.error( - 'Double colon', - { offset: token[2] }, - { offset: token[2] + token[1].length } - ) - } - - emptyRule(token) { - let node = new Rule() - this.init(node, token[2]) - node.selector = '' - node.raws.between = '' - this.current = node - } - - end(token) { - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon - } - this.semicolon = false - - this.current.raws.after = (this.current.raws.after || '') + this.spaces - this.spaces = '' - - if (this.current.parent) { - this.current.source.end = this.getPosition(token[2]) - this.current.source.end.offset++ - this.current = this.current.parent - } else { - this.unexpectedClose(token) - } - } - - endFile() { - if (this.current.parent) this.unclosedBlock() - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon - } - this.current.raws.after = (this.current.raws.after || '') + this.spaces - this.root.source.end = this.getPosition(this.tokenizer.position()) - } - - freeSemicolon(token) { - this.spaces += token[1] - if (this.current.nodes) { - let prev = this.current.nodes[this.current.nodes.length - 1] - if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { - prev.raws.ownSemicolon = this.spaces - this.spaces = '' - prev.source.end = this.getPosition(token[2]) - prev.source.end.offset += prev.raws.ownSemicolon.length - } - } - } - - // Helpers - - getPosition(offset) { - let pos = this.input.fromOffset(offset) - return { - column: pos.col, - line: pos.line, - offset - } - } - - init(node, offset) { - this.current.push(node) - node.source = { - input: this.input, - start: this.getPosition(offset) - } - node.raws.before = this.spaces - this.spaces = '' - if (node.type !== 'comment') this.semicolon = false - } - - other(start) { - let end = false - let type = null - let colon = false - let bracket = null - let brackets = [] - let customProperty = start[1].startsWith('--') - - let tokens = [] - let token = start - while (token) { - type = token[0] - tokens.push(token) - - if (type === '(' || type === '[') { - if (!bracket) bracket = token - brackets.push(type === '(' ? ')' : ']') - } else if (customProperty && colon && type === '{') { - if (!bracket) bracket = token - brackets.push('}') - } else if (brackets.length === 0) { - if (type === ';') { - if (colon) { - this.decl(tokens, customProperty) - return - } else { - break - } - } else if (type === '{') { - this.rule(tokens) - return - } else if (type === '}') { - this.tokenizer.back(tokens.pop()) - end = true - break - } else if (type === ':') { - colon = true - } - } else if (type === brackets[brackets.length - 1]) { - brackets.pop() - if (brackets.length === 0) bracket = null - } - - token = this.tokenizer.nextToken() - } - - if (this.tokenizer.endOfFile()) end = true - if (brackets.length > 0) this.unclosedBracket(bracket) - - if (end && colon) { - if (!customProperty) { - while (tokens.length) { - token = tokens[tokens.length - 1][0] - if (token !== 'space' && token !== 'comment') break - this.tokenizer.back(tokens.pop()) - } - } - this.decl(tokens, customProperty) - } else { - this.unknownWord(tokens) - } - } - - parse() { - let token - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken() - - switch (token[0]) { - case 'space': - this.spaces += token[1] - break - - case ';': - this.freeSemicolon(token) - break - - case '}': - this.end(token) - break - - case 'comment': - this.comment(token) - break - - case 'at-word': - this.atrule(token) - break - - case '{': - this.emptyRule(token) - break - - default: - this.other(token) - break - } - } - this.endFile() - } - - precheckMissedSemicolon(/* tokens */) { - // Hook for Safe Parser - } - - raw(node, prop, tokens, customProperty) { - let token, type - let length = tokens.length - let value = '' - let clean = true - let next, prev - - for (let i = 0; i < length; i += 1) { - token = tokens[i] - type = token[0] - if (type === 'space' && i === length - 1 && !customProperty) { - clean = false - } else if (type === 'comment') { - prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty' - next = tokens[i + 1] ? tokens[i + 1][0] : 'empty' - if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { - if (value.slice(-1) === ',') { - clean = false - } else { - value += token[1] - } - } else { - clean = false - } - } else { - value += token[1] - } - } - if (!clean) { - let raw = tokens.reduce((all, i) => all + i[1], '') - node.raws[prop] = { raw, value } - } - node[prop] = value - } - - rule(tokens) { - tokens.pop() - - let node = new Rule() - this.init(node, tokens[0][2]) - - node.raws.between = this.spacesAndCommentsFromEnd(tokens) - this.raw(node, 'selector', tokens) - this.current = node - } - - spacesAndCommentsFromEnd(tokens) { - let lastTokenType - let spaces = '' - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0] - if (lastTokenType !== 'space' && lastTokenType !== 'comment') break - spaces = tokens.pop()[1] + spaces - } - return spaces - } - - // Errors - - spacesAndCommentsFromStart(tokens) { - let next - let spaces = '' - while (tokens.length) { - next = tokens[0][0] - if (next !== 'space' && next !== 'comment') break - spaces += tokens.shift()[1] - } - return spaces - } - - spacesFromEnd(tokens) { - let lastTokenType - let spaces = '' - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0] - if (lastTokenType !== 'space') break - spaces = tokens.pop()[1] + spaces - } - return spaces - } - - stringFrom(tokens, from) { - let result = '' - for (let i = from; i < tokens.length; i++) { - result += tokens[i][1] - } - tokens.splice(from, tokens.length - from) - return result - } - - unclosedBlock() { - let pos = this.current.source.start - throw this.input.error('Unclosed block', pos.line, pos.column) - } - - unclosedBracket(bracket) { - throw this.input.error( - 'Unclosed bracket', - { offset: bracket[2] }, - { offset: bracket[2] + 1 } - ) - } - - unexpectedClose(token) { - throw this.input.error( - 'Unexpected }', - { offset: token[2] }, - { offset: token[2] + 1 } - ) - } - - unknownWord(tokens) { - throw this.input.error( - 'Unknown word ' + tokens[0][1], - { offset: tokens[0][2] }, - { offset: tokens[0][2] + tokens[0][1].length } - ) - } - - unnamedAtrule(node, token) { - throw this.input.error( - 'At-rule without name', - { offset: token[2] }, - { offset: token[2] + token[1].length } - ) - } -} - -module.exports = Parser - - -/***/ }), - -/***/ "./node_modules/postcss/lib/postcss.js": -/*!*********************************************!*\ - !*** ./node_modules/postcss/lib/postcss.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); - - -let AtRule = __webpack_require__(/*! ./at-rule */ "./node_modules/postcss/lib/at-rule.js") -let Comment = __webpack_require__(/*! ./comment */ "./node_modules/postcss/lib/comment.js") -let Container = __webpack_require__(/*! ./container */ "./node_modules/postcss/lib/container.js") -let CssSyntaxError = __webpack_require__(/*! ./css-syntax-error */ "./node_modules/postcss/lib/css-syntax-error.js") -let Declaration = __webpack_require__(/*! ./declaration */ "./node_modules/postcss/lib/declaration.js") -let Document = __webpack_require__(/*! ./document */ "./node_modules/postcss/lib/document.js") -let fromJSON = __webpack_require__(/*! ./fromJSON */ "./node_modules/postcss/lib/fromJSON.js") -let Input = __webpack_require__(/*! ./input */ "./node_modules/postcss/lib/input.js") -let LazyResult = __webpack_require__(/*! ./lazy-result */ "./node_modules/postcss/lib/lazy-result.js") -let list = __webpack_require__(/*! ./list */ "./node_modules/postcss/lib/list.js") -let Node = __webpack_require__(/*! ./node */ "./node_modules/postcss/lib/node.js") -let parse = __webpack_require__(/*! ./parse */ "./node_modules/postcss/lib/parse.js") -let Processor = __webpack_require__(/*! ./processor */ "./node_modules/postcss/lib/processor.js") -let Result = __webpack_require__(/*! ./result.js */ "./node_modules/postcss/lib/result.js") -let Root = __webpack_require__(/*! ./root */ "./node_modules/postcss/lib/root.js") -let Rule = __webpack_require__(/*! ./rule */ "./node_modules/postcss/lib/rule.js") -let stringify = __webpack_require__(/*! ./stringify */ "./node_modules/postcss/lib/stringify.js") -let Warning = __webpack_require__(/*! ./warning */ "./node_modules/postcss/lib/warning.js") - -function postcss(...plugins) { - if (plugins.length === 1 && Array.isArray(plugins[0])) { - plugins = plugins[0] - } - return new Processor(plugins) -} - -postcss.plugin = function plugin(name, initializer) { - let warningPrinted = false - function creator(...args) { - // eslint-disable-next-line no-console - if (console && console.warn && !warningPrinted) { - warningPrinted = true - // eslint-disable-next-line no-console - console.warn( - name + - ': postcss.plugin was deprecated. Migration guide:\n' + - 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' - ) - if (process.env.LANG && process.env.LANG.startsWith('cn')) { - /* c8 ignore next 7 */ - // eslint-disable-next-line no-console - console.warn( - name + - ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + - 'https://www.w3ctech.com/topic/2226' - ) - } - } - let transformer = initializer(...args) - transformer.postcssPlugin = name - transformer.postcssVersion = new Processor().version - return transformer - } - - let cache - Object.defineProperty(creator, 'postcss', { - get() { - if (!cache) cache = creator() - return cache - } - }) - - creator.process = function (css, processOpts, pluginOpts) { - return postcss([creator(pluginOpts)]).process(css, processOpts) - } - - return creator -} - -postcss.stringify = stringify -postcss.parse = parse -postcss.fromJSON = fromJSON -postcss.list = list - -postcss.comment = defaults => new Comment(defaults) -postcss.atRule = defaults => new AtRule(defaults) -postcss.decl = defaults => new Declaration(defaults) -postcss.rule = defaults => new Rule(defaults) -postcss.root = defaults => new Root(defaults) -postcss.document = defaults => new Document(defaults) - -postcss.CssSyntaxError = CssSyntaxError -postcss.Declaration = Declaration -postcss.Container = Container -postcss.Processor = Processor -postcss.Document = Document -postcss.Comment = Comment -postcss.Warning = Warning -postcss.AtRule = AtRule -postcss.Result = Result -postcss.Input = Input -postcss.Rule = Rule -postcss.Root = Root -postcss.Node = Node - -LazyResult.registerPostcss(postcss) - -module.exports = postcss -postcss.default = postcss - - -/***/ }), - -/***/ "./node_modules/postcss/lib/postcss.mjs": -/*!**********************************************!*\ - !*** ./node_modules/postcss/lib/postcss.mjs ***! - \**********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AtRule: () => (/* binding */ AtRule), -/* harmony export */ Comment: () => (/* binding */ Comment), -/* harmony export */ Container: () => (/* binding */ Container), -/* harmony export */ CssSyntaxError: () => (/* binding */ CssSyntaxError), -/* harmony export */ Declaration: () => (/* binding */ Declaration), -/* harmony export */ Document: () => (/* binding */ Document), -/* harmony export */ Input: () => (/* binding */ Input), -/* harmony export */ Node: () => (/* binding */ Node), -/* harmony export */ Processor: () => (/* binding */ Processor), -/* harmony export */ Result: () => (/* binding */ Result), -/* harmony export */ Root: () => (/* binding */ Root), -/* harmony export */ Rule: () => (/* binding */ Rule), -/* harmony export */ Warning: () => (/* binding */ Warning), -/* harmony export */ atRule: () => (/* binding */ atRule), -/* harmony export */ comment: () => (/* binding */ comment), -/* harmony export */ decl: () => (/* binding */ decl), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ document: () => (/* binding */ document), -/* harmony export */ fromJSON: () => (/* binding */ fromJSON), -/* harmony export */ list: () => (/* binding */ list), -/* harmony export */ parse: () => (/* binding */ parse), -/* harmony export */ plugin: () => (/* binding */ plugin), -/* harmony export */ root: () => (/* binding */ root), -/* harmony export */ rule: () => (/* binding */ rule), -/* harmony export */ stringify: () => (/* binding */ stringify) -/* harmony export */ }); -/* harmony import */ var _postcss_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./postcss.js */ "./node_modules/postcss/lib/postcss.js"); - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_postcss_js__WEBPACK_IMPORTED_MODULE_0__); - -const stringify = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.stringify -const fromJSON = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.fromJSON -const plugin = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.plugin -const parse = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.parse -const list = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.list - -const document = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.document -const comment = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.comment -const atRule = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.atRule -const rule = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.rule -const decl = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.decl -const root = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.root - -const CssSyntaxError = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.CssSyntaxError -const Declaration = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Declaration -const Container = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Container -const Processor = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Processor -const Document = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Document -const Comment = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Comment -const Warning = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Warning -const AtRule = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.AtRule -const Result = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Result -const Input = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Input -const Rule = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Rule -const Root = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Root -const Node = _postcss_js__WEBPACK_IMPORTED_MODULE_0__.Node - - -/***/ }), - -/***/ "./node_modules/postcss/lib/previous-map.js": -/*!**************************************************!*\ - !*** ./node_modules/postcss/lib/previous-map.js ***! - \**************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let { existsSync, readFileSync } = __webpack_require__(/*! fs */ "?03fb") -let { dirname, join } = __webpack_require__(/*! path */ "?6197") -let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(/*! source-map-js */ "?b8cb") - -function fromBase64(str) { - if (Buffer) { - return Buffer.from(str, 'base64').toString() - } else { - /* c8 ignore next 2 */ - return window.atob(str) - } -} - -class PreviousMap { - constructor(css, opts) { - if (opts.map === false) return - this.loadAnnotation(css) - this.inline = this.startWith(this.annotation, 'data:') - - let prev = opts.map ? opts.map.prev : undefined - let text = this.loadMap(opts.from, prev) - if (!this.mapFile && opts.from) { - this.mapFile = opts.from - } - if (this.mapFile) this.root = dirname(this.mapFile) - if (text) this.text = text - } - - consumer() { - if (!this.consumerCache) { - this.consumerCache = new SourceMapConsumer(this.text) - } - return this.consumerCache - } - - decodeInline(text) { - let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/ - let baseUri = /^data:application\/json;base64,/ - let charsetUri = /^data:application\/json;charset=utf-?8,/ - let uri = /^data:application\/json,/ - - let uriMatch = text.match(charsetUri) || text.match(uri) - if (uriMatch) { - return decodeURIComponent(text.substr(uriMatch[0].length)) - } - - let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri) - if (baseUriMatch) { - return fromBase64(text.substr(baseUriMatch[0].length)) - } - - let encoding = text.match(/data:application\/json;([^,]+),/)[1] - throw new Error('Unsupported source map encoding ' + encoding) - } - - getAnnotationURL(sourceMapString) { - return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() - } - - isMap(map) { - if (typeof map !== 'object') return false - return ( - typeof map.mappings === 'string' || - typeof map._mappings === 'string' || - Array.isArray(map.sections) - ) - } - - loadAnnotation(css) { - let comments = css.match(/\/\*\s*# sourceMappingURL=/g) - if (!comments) return - - // sourceMappingURLs from comments, strings, etc. - let start = css.lastIndexOf(comments.pop()) - let end = css.indexOf('*/', start) - - if (start > -1 && end > -1) { - // Locate the last sourceMappingURL to avoid pickin - this.annotation = this.getAnnotationURL(css.substring(start, end)) - } - } - - loadFile(path) { - this.root = dirname(path) - if (existsSync(path)) { - this.mapFile = path - return readFileSync(path, 'utf-8').toString().trim() - } - } - - loadMap(file, prev) { - if (prev === false) return false - - if (prev) { - if (typeof prev === 'string') { - return prev - } else if (typeof prev === 'function') { - let prevPath = prev(file) - if (prevPath) { - let map = this.loadFile(prevPath) - if (!map) { - throw new Error( - 'Unable to load previous source map: ' + prevPath.toString() - ) - } - return map - } - } else if (prev instanceof SourceMapConsumer) { - return SourceMapGenerator.fromSourceMap(prev).toString() - } else if (prev instanceof SourceMapGenerator) { - return prev.toString() - } else if (this.isMap(prev)) { - return JSON.stringify(prev) - } else { - throw new Error( - 'Unsupported previous source map format: ' + prev.toString() - ) - } - } else if (this.inline) { - return this.decodeInline(this.annotation) - } else if (this.annotation) { - let map = this.annotation - if (file) map = join(dirname(file), map) - return this.loadFile(map) - } - } - - startWith(string, start) { - if (!string) return false - return string.substr(0, start.length) === start - } - - withContent() { - return !!( - this.consumer().sourcesContent && - this.consumer().sourcesContent.length > 0 - ) - } -} - -module.exports = PreviousMap -PreviousMap.default = PreviousMap - - -/***/ }), - -/***/ "./node_modules/postcss/lib/processor.js": -/*!***********************************************!*\ - !*** ./node_modules/postcss/lib/processor.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Document = __webpack_require__(/*! ./document */ "./node_modules/postcss/lib/document.js") -let LazyResult = __webpack_require__(/*! ./lazy-result */ "./node_modules/postcss/lib/lazy-result.js") -let NoWorkResult = __webpack_require__(/*! ./no-work-result */ "./node_modules/postcss/lib/no-work-result.js") -let Root = __webpack_require__(/*! ./root */ "./node_modules/postcss/lib/root.js") - -class Processor { - constructor(plugins = []) { - this.version = '8.5.6' - this.plugins = this.normalize(plugins) - } - - normalize(plugins) { - let normalized = [] - for (let i of plugins) { - if (i.postcss === true) { - i = i() - } else if (i.postcss) { - i = i.postcss - } - - if (typeof i === 'object' && Array.isArray(i.plugins)) { - normalized = normalized.concat(i.plugins) - } else if (typeof i === 'object' && i.postcssPlugin) { - normalized.push(i) - } else if (typeof i === 'function') { - normalized.push(i) - } else if (typeof i === 'object' && (i.parse || i.stringify)) { - if (true) { - throw new Error( - 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' + - 'one of the syntax/parser/stringifier options as outlined ' + - 'in your PostCSS runner documentation.' - ) - } - } else { - throw new Error(i + ' is not a PostCSS plugin') - } - } - return normalized - } - - process(css, opts = {}) { - if ( - !this.plugins.length && - !opts.parser && - !opts.stringifier && - !opts.syntax - ) { - return new NoWorkResult(this, css, opts) - } else { - return new LazyResult(this, css, opts) - } - } - - use(plugin) { - this.plugins = this.plugins.concat(this.normalize([plugin])) - return this - } -} - -module.exports = Processor -Processor.default = Processor - -Root.registerProcessor(Processor) -Document.registerProcessor(Processor) - - -/***/ }), - -/***/ "./node_modules/postcss/lib/result.js": -/*!********************************************!*\ - !*** ./node_modules/postcss/lib/result.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Warning = __webpack_require__(/*! ./warning */ "./node_modules/postcss/lib/warning.js") - -class Result { - get content() { - return this.css - } - - constructor(processor, root, opts) { - this.processor = processor - this.messages = [] - this.root = root - this.opts = opts - this.css = '' - this.map = undefined - } - - toString() { - return this.css - } - - warn(text, opts = {}) { - if (!opts.plugin) { - if (this.lastPlugin && this.lastPlugin.postcssPlugin) { - opts.plugin = this.lastPlugin.postcssPlugin - } - } - - let warning = new Warning(text, opts) - this.messages.push(warning) - - return warning - } - - warnings() { - return this.messages.filter(i => i.type === 'warning') - } -} - -module.exports = Result -Result.default = Result - - -/***/ }), - -/***/ "./node_modules/postcss/lib/root.js": -/*!******************************************!*\ - !*** ./node_modules/postcss/lib/root.js ***! - \******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Container = __webpack_require__(/*! ./container */ "./node_modules/postcss/lib/container.js") - -let LazyResult, Processor - -class Root extends Container { - constructor(defaults) { - super(defaults) - this.type = 'root' - if (!this.nodes) this.nodes = [] - } - - normalize(child, sample, type) { - let nodes = super.normalize(child) - - if (sample) { - if (type === 'prepend') { - if (this.nodes.length > 1) { - sample.raws.before = this.nodes[1].raws.before - } else { - delete sample.raws.before - } - } else if (this.first !== sample) { - for (let node of nodes) { - node.raws.before = sample.raws.before - } - } - } - - return nodes - } - - removeChild(child, ignore) { - let index = this.index(child) - - if (!ignore && index === 0 && this.nodes.length > 1) { - this.nodes[1].raws.before = this.nodes[index].raws.before - } - - return super.removeChild(child) - } - - toResult(opts = {}) { - let lazy = new LazyResult(new Processor(), this, opts) - return lazy.stringify() - } -} - -Root.registerLazyResult = dependant => { - LazyResult = dependant -} - -Root.registerProcessor = dependant => { - Processor = dependant -} - -module.exports = Root -Root.default = Root - -Container.registerRoot(Root) - - -/***/ }), - -/***/ "./node_modules/postcss/lib/rule.js": -/*!******************************************!*\ - !*** ./node_modules/postcss/lib/rule.js ***! - \******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Container = __webpack_require__(/*! ./container */ "./node_modules/postcss/lib/container.js") -let list = __webpack_require__(/*! ./list */ "./node_modules/postcss/lib/list.js") - -class Rule extends Container { - get selectors() { - return list.comma(this.selector) - } - - set selectors(values) { - let match = this.selector ? this.selector.match(/,\s*/) : null - let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen') - this.selector = values.join(sep) - } - - constructor(defaults) { - super(defaults) - this.type = 'rule' - if (!this.nodes) this.nodes = [] - } -} - -module.exports = Rule -Rule.default = Rule - -Container.registerRule(Rule) - - -/***/ }), - -/***/ "./node_modules/postcss/lib/stringifier.js": -/*!*************************************************!*\ - !*** ./node_modules/postcss/lib/stringifier.js ***! - \*************************************************/ -/***/ ((module) => { - -"use strict"; - - -const DEFAULT_RAW = { - after: '\n', - beforeClose: '\n', - beforeComment: '\n', - beforeDecl: '\n', - beforeOpen: ' ', - beforeRule: '\n', - colon: ': ', - commentLeft: ' ', - commentRight: ' ', - emptyBody: '', - indent: ' ', - semicolon: false -} - -function capitalize(str) { - return str[0].toUpperCase() + str.slice(1) -} - -class Stringifier { - constructor(builder) { - this.builder = builder - } - - atrule(node, semicolon) { - let name = '@' + node.name - let params = node.params ? this.rawValue(node, 'params') : '' - - if (typeof node.raws.afterName !== 'undefined') { - name += node.raws.afterName - } else if (params) { - name += ' ' - } - - if (node.nodes) { - this.block(node, name + params) - } else { - let end = (node.raws.between || '') + (semicolon ? ';' : '') - this.builder(name + params + end, node) - } - } - - beforeAfter(node, detect) { - let value - if (node.type === 'decl') { - value = this.raw(node, null, 'beforeDecl') - } else if (node.type === 'comment') { - value = this.raw(node, null, 'beforeComment') - } else if (detect === 'before') { - value = this.raw(node, null, 'beforeRule') - } else { - value = this.raw(node, null, 'beforeClose') - } - - let buf = node.parent - let depth = 0 - while (buf && buf.type !== 'root') { - depth += 1 - buf = buf.parent - } - - if (value.includes('\n')) { - let indent = this.raw(node, null, 'indent') - if (indent.length) { - for (let step = 0; step < depth; step++) value += indent - } - } - - return value - } - - block(node, start) { - let between = this.raw(node, 'between', 'beforeOpen') - this.builder(start + between + '{', node, 'start') - - let after - if (node.nodes && node.nodes.length) { - this.body(node) - after = this.raw(node, 'after') - } else { - after = this.raw(node, 'after', 'emptyBody') - } - - if (after) this.builder(after) - this.builder('}', node, 'end') - } - - body(node) { - let last = node.nodes.length - 1 - while (last > 0) { - if (node.nodes[last].type !== 'comment') break - last -= 1 - } - - let semicolon = this.raw(node, 'semicolon') - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i] - let before = this.raw(child, 'before') - if (before) this.builder(before) - this.stringify(child, last !== i || semicolon) - } - } - - comment(node) { - let left = this.raw(node, 'left', 'commentLeft') - let right = this.raw(node, 'right', 'commentRight') - this.builder('/*' + left + node.text + right + '*/', node) - } - - decl(node, semicolon) { - let between = this.raw(node, 'between', 'colon') - let string = node.prop + between + this.rawValue(node, 'value') - - if (node.important) { - string += node.raws.important || ' !important' - } - - if (semicolon) string += ';' - this.builder(string, node) - } - - document(node) { - this.body(node) - } - - raw(node, own, detect) { - let value - if (!detect) detect = own - - // Already had - if (own) { - value = node.raws[own] - if (typeof value !== 'undefined') return value - } - - let parent = node.parent - - if (detect === 'before') { - // Hack for first rule in CSS - if (!parent || (parent.type === 'root' && parent.first === node)) { - return '' - } - - // `root` nodes in `document` should use only their own raws - if (parent && parent.type === 'document') { - return '' - } - } - - // Floating child without parent - if (!parent) return DEFAULT_RAW[detect] - - // Detect style by other nodes - let root = node.root() - if (!root.rawCache) root.rawCache = {} - if (typeof root.rawCache[detect] !== 'undefined') { - return root.rawCache[detect] - } - - if (detect === 'before' || detect === 'after') { - return this.beforeAfter(node, detect) - } else { - let method = 'raw' + capitalize(detect) - if (this[method]) { - value = this[method](root, node) - } else { - root.walk(i => { - value = i.raws[own] - if (typeof value !== 'undefined') return false - }) - } - } - - if (typeof value === 'undefined') value = DEFAULT_RAW[detect] - - root.rawCache[detect] = value - return value - } - - rawBeforeClose(root) { - let value - root.walk(i => { - if (i.nodes && i.nodes.length > 0) { - if (typeof i.raws.after !== 'undefined') { - value = i.raws.after - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - } - }) - if (value) value = value.replace(/\S/g, '') - return value - } - - rawBeforeComment(root, node) { - let value - root.walkComments(i => { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - }) - if (typeof value === 'undefined') { - value = this.raw(node, null, 'beforeDecl') - } else if (value) { - value = value.replace(/\S/g, '') - } - return value - } - - rawBeforeDecl(root, node) { - let value - root.walkDecls(i => { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - }) - if (typeof value === 'undefined') { - value = this.raw(node, null, 'beforeRule') - } else if (value) { - value = value.replace(/\S/g, '') - } - return value - } - - rawBeforeOpen(root) { - let value - root.walk(i => { - if (i.type !== 'decl') { - value = i.raws.between - if (typeof value !== 'undefined') return false - } - }) - return value - } - - rawBeforeRule(root) { - let value - root.walk(i => { - if (i.nodes && (i.parent !== root || root.first !== i)) { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - } - }) - if (value) value = value.replace(/\S/g, '') - return value - } - - rawColon(root) { - let value - root.walkDecls(i => { - if (typeof i.raws.between !== 'undefined') { - value = i.raws.between.replace(/[^\s:]/g, '') - return false - } - }) - return value - } - - rawEmptyBody(root) { - let value - root.walk(i => { - if (i.nodes && i.nodes.length === 0) { - value = i.raws.after - if (typeof value !== 'undefined') return false - } - }) - return value - } - - rawIndent(root) { - if (root.raws.indent) return root.raws.indent - let value - root.walk(i => { - let p = i.parent - if (p && p !== root && p.parent && p.parent === root) { - if (typeof i.raws.before !== 'undefined') { - let parts = i.raws.before.split('\n') - value = parts[parts.length - 1] - value = value.replace(/\S/g, '') - return false - } - } - }) - return value - } - - rawSemicolon(root) { - let value - root.walk(i => { - if (i.nodes && i.nodes.length && i.last.type === 'decl') { - value = i.raws.semicolon - if (typeof value !== 'undefined') return false - } - }) - return value - } - - rawValue(node, prop) { - let value = node[prop] - let raw = node.raws[prop] - if (raw && raw.value === value) { - return raw.raw - } - - return value - } - - root(node) { - this.body(node) - if (node.raws.after) this.builder(node.raws.after) - } - - rule(node) { - this.block(node, this.rawValue(node, 'selector')) - if (node.raws.ownSemicolon) { - this.builder(node.raws.ownSemicolon, node, 'end') - } - } - - stringify(node, semicolon) { - /* c8 ignore start */ - if (!this[node.type]) { - throw new Error( - 'Unknown AST node type ' + - node.type + - '. ' + - 'Maybe you need to change PostCSS stringifier.' - ) - } - /* c8 ignore stop */ - this[node.type](node, semicolon) - } -} - -module.exports = Stringifier -Stringifier.default = Stringifier - - -/***/ }), - -/***/ "./node_modules/postcss/lib/stringify.js": -/*!***********************************************!*\ - !*** ./node_modules/postcss/lib/stringify.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -let Stringifier = __webpack_require__(/*! ./stringifier */ "./node_modules/postcss/lib/stringifier.js") - -function stringify(node, builder) { - let str = new Stringifier(builder) - str.stringify(node) -} - -module.exports = stringify -stringify.default = stringify - - -/***/ }), - -/***/ "./node_modules/postcss/lib/symbols.js": -/*!*********************************************!*\ - !*** ./node_modules/postcss/lib/symbols.js ***! - \*********************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports.isClean = Symbol('isClean') - -module.exports.my = Symbol('my') - - -/***/ }), - -/***/ "./node_modules/postcss/lib/tokenize.js": -/*!**********************************************!*\ - !*** ./node_modules/postcss/lib/tokenize.js ***! - \**********************************************/ -/***/ ((module) => { - -"use strict"; - - -const SINGLE_QUOTE = "'".charCodeAt(0) -const DOUBLE_QUOTE = '"'.charCodeAt(0) -const BACKSLASH = '\\'.charCodeAt(0) -const SLASH = '/'.charCodeAt(0) -const NEWLINE = '\n'.charCodeAt(0) -const SPACE = ' '.charCodeAt(0) -const FEED = '\f'.charCodeAt(0) -const TAB = '\t'.charCodeAt(0) -const CR = '\r'.charCodeAt(0) -const OPEN_SQUARE = '['.charCodeAt(0) -const CLOSE_SQUARE = ']'.charCodeAt(0) -const OPEN_PARENTHESES = '('.charCodeAt(0) -const CLOSE_PARENTHESES = ')'.charCodeAt(0) -const OPEN_CURLY = '{'.charCodeAt(0) -const CLOSE_CURLY = '}'.charCodeAt(0) -const SEMICOLON = ';'.charCodeAt(0) -const ASTERISK = '*'.charCodeAt(0) -const COLON = ':'.charCodeAt(0) -const AT = '@'.charCodeAt(0) - -const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g -const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g -const RE_BAD_BRACKET = /.[\r\n"'(/\\]/ -const RE_HEX_ESCAPE = /[\da-f]/i - -module.exports = function tokenizer(input, options = {}) { - let css = input.css.valueOf() - let ignore = options.ignoreErrors - - let code, content, escape, next, quote - let currentToken, escaped, escapePos, n, prev - - let length = css.length - let pos = 0 - let buffer = [] - let returned = [] - - function position() { - return pos - } - - function unclosed(what) { - throw input.error('Unclosed ' + what, pos) - } - - function endOfFile() { - return returned.length === 0 && pos >= length - } - - function nextToken(opts) { - if (returned.length) return returned.pop() - if (pos >= length) return - - let ignoreUnclosed = opts ? opts.ignoreUnclosed : false - - code = css.charCodeAt(pos) - - switch (code) { - case NEWLINE: - case SPACE: - case TAB: - case CR: - case FEED: { - next = pos - do { - next += 1 - code = css.charCodeAt(next) - } while ( - code === SPACE || - code === NEWLINE || - code === TAB || - code === CR || - code === FEED - ) - - currentToken = ['space', css.slice(pos, next)] - pos = next - 1 - break - } - - case OPEN_SQUARE: - case CLOSE_SQUARE: - case OPEN_CURLY: - case CLOSE_CURLY: - case COLON: - case SEMICOLON: - case CLOSE_PARENTHESES: { - let controlChar = String.fromCharCode(code) - currentToken = [controlChar, controlChar, pos] - break - } - - case OPEN_PARENTHESES: { - prev = buffer.length ? buffer.pop()[1] : '' - n = css.charCodeAt(pos + 1) - if ( - prev === 'url' && - n !== SINGLE_QUOTE && - n !== DOUBLE_QUOTE && - n !== SPACE && - n !== NEWLINE && - n !== TAB && - n !== FEED && - n !== CR - ) { - next = pos - do { - escaped = false - next = css.indexOf(')', next + 1) - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos - break - } else { - unclosed('bracket') - } - } - escapePos = next - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1 - escaped = !escaped - } - } while (escaped) - - currentToken = ['brackets', css.slice(pos, next + 1), pos, next] - - pos = next - } else { - next = css.indexOf(')', pos + 1) - content = css.slice(pos, next + 1) - - if (next === -1 || RE_BAD_BRACKET.test(content)) { - currentToken = ['(', '(', pos] - } else { - currentToken = ['brackets', content, pos, next] - pos = next - } - } - - break - } - - case SINGLE_QUOTE: - case DOUBLE_QUOTE: { - quote = code === SINGLE_QUOTE ? "'" : '"' - next = pos - do { - escaped = false - next = css.indexOf(quote, next + 1) - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos + 1 - break - } else { - unclosed('string') - } - } - escapePos = next - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1 - escaped = !escaped - } - } while (escaped) - - currentToken = ['string', css.slice(pos, next + 1), pos, next] - pos = next - break - } - - case AT: { - RE_AT_END.lastIndex = pos + 1 - RE_AT_END.test(css) - if (RE_AT_END.lastIndex === 0) { - next = css.length - 1 - } else { - next = RE_AT_END.lastIndex - 2 - } - - currentToken = ['at-word', css.slice(pos, next + 1), pos, next] - - pos = next - break - } - - case BACKSLASH: { - next = pos - escape = true - while (css.charCodeAt(next + 1) === BACKSLASH) { - next += 1 - escape = !escape - } - code = css.charCodeAt(next + 1) - if ( - escape && - code !== SLASH && - code !== SPACE && - code !== NEWLINE && - code !== TAB && - code !== CR && - code !== FEED - ) { - next += 1 - if (RE_HEX_ESCAPE.test(css.charAt(next))) { - while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { - next += 1 - } - if (css.charCodeAt(next + 1) === SPACE) { - next += 1 - } - } - } - - currentToken = ['word', css.slice(pos, next + 1), pos, next] - - pos = next - break - } - - default: { - if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { - next = css.indexOf('*/', pos + 2) + 1 - if (next === 0) { - if (ignore || ignoreUnclosed) { - next = css.length - } else { - unclosed('comment') - } - } - - currentToken = ['comment', css.slice(pos, next + 1), pos, next] - pos = next - } else { - RE_WORD_END.lastIndex = pos + 1 - RE_WORD_END.test(css) - if (RE_WORD_END.lastIndex === 0) { - next = css.length - 1 - } else { - next = RE_WORD_END.lastIndex - 2 - } - - currentToken = ['word', css.slice(pos, next + 1), pos, next] - buffer.push(currentToken) - pos = next - } - - break - } - } - - pos++ - return currentToken - } - - function back(token) { - returned.push(token) - } - - return { - back, - endOfFile, - nextToken, - position - } -} - - -/***/ }), - -/***/ "./node_modules/postcss/lib/warn-once.js": -/*!***********************************************!*\ - !*** ./node_modules/postcss/lib/warn-once.js ***! - \***********************************************/ -/***/ ((module) => { - -"use strict"; -/* eslint-disable no-console */ - - -let printed = {} - -module.exports = function warnOnce(message) { - if (printed[message]) return - printed[message] = true - - if (typeof console !== 'undefined' && console.warn) { - console.warn(message) - } -} - - -/***/ }), - -/***/ "./node_modules/postcss/lib/warning.js": -/*!*********************************************!*\ - !*** ./node_modules/postcss/lib/warning.js ***! - \*********************************************/ -/***/ ((module) => { - -"use strict"; - - -class Warning { - constructor(text, opts = {}) { - this.type = 'warning' - this.text = text - - if (opts.node && opts.node.source) { - let range = opts.node.rangeBy(opts) - this.line = range.start.line - this.column = range.start.column - this.endLine = range.end.line - this.endColumn = range.end.column - } - - for (let opt in opts) this[opt] = opts[opt] - } - - toString() { - if (this.node) { - return this.node.error(this.text, { - index: this.index, - plugin: this.plugin, - word: this.word - }).message - } - - if (this.plugin) { - return this.plugin + ': ' + this.text - } - - return this.text - } -} - -module.exports = Warning -Warning.default = Warning - - -/***/ }), - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/***/ ((module) => { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/punycode/punycode.es6.js": -/*!***********************************************!*\ - !*** ./node_modules/punycode/punycode.es6.js ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ decode: () => (/* binding */ decode), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ encode: () => (/* binding */ encode), -/* harmony export */ toASCII: () => (/* binding */ toASCII), -/* harmony export */ toUnicode: () => (/* binding */ toUnicode), -/* harmony export */ ucs2decode: () => (/* binding */ ucs2decode), -/* harmony export */ ucs2encode: () => (/* binding */ ucs2encode) -/* harmony export */ }); - - -/** Highest positive signed 32-bit float value */ -const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -const base = 36; -const tMin = 1; -const tMax = 26; -const skew = 38; -const damp = 700; -const initialBias = 72; -const initialN = 128; // 0x80 -const delimiter = '-'; // '\x2D' - -/** Regular expressions */ -const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. -const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -const errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -const baseMinusTMin = base - tMin; -const floor = Math.floor; -const stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, callback) { - const result = []; - let length = array.length; - while (length--) { - result[length] = callback(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {String} A new string of characters returned by the callback - * function. - */ -function mapDomain(domain, callback) { - const parts = domain.split('@'); - let result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - domain = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - domain = domain.replace(regexSeparators, '\x2E'); - const labels = domain.split('.'); - const encoded = map(labels, callback).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - const extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -const ucs2encode = codePoints => String.fromCodePoint(...codePoints); - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -const basicToDigit = function(codePoint) { - if (codePoint >= 0x30 && codePoint < 0x3A) { - return 26 + (codePoint - 0x30); - } - if (codePoint >= 0x41 && codePoint < 0x5B) { - return codePoint - 0x41; - } - if (codePoint >= 0x61 && codePoint < 0x7B) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -const digitToBasic = function(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -const adapt = function(delta, numPoints, firstTime) { - let k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -const decode = function(input) { - // Don't use UCS-2. - const output = []; - const inputLength = input.length; - let i = 0; - let n = initialN; - let bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (let j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - const oldi = i; - for (let w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - const digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base) { - error('invalid-input'); - } - if (digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - const baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - - } - - return String.fromCodePoint(...output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -const encode = function(input) { - const output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - const inputLength = input.length; - - // Initialize the state. - let n = initialN; - let delta = 0; - let bias = initialBias; - - // Handle the basic code points. - for (const currentValue of input) { - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - const basicLength = output.length; - let handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - let m = maxInt; - for (const currentValue of input) { - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - const handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (const currentValue of input) { - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - if (currentValue === n) { - // Represent delta as a generalized variable-length integer. - let q = delta; - for (let k = base; /* no condition */; k += base) { - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - const qMinusT = q - t; - const baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -const toUnicode = function(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -const toASCII = function(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -const punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.3.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (punycode); - - -/***/ }), - -/***/ "./node_modules/text-encoder/index.js": -/*!********************************************!*\ - !*** ./node_modules/text-encoder/index.js ***! - \********************************************/ -/***/ ((module) => { - -var utf8Encodings = [ - 'utf8', - 'utf-8', - 'unicode-1-1-utf-8' -]; - -function TextEncoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } else { - this.encoding = 'utf-8'; - this.encode = function(str) { - if (typeof str !== 'string') { - throw new TypeError('passed argument must be of tye string'); - } - var binstr = unescape(encodeURIComponent(str)), - arr = new Uint8Array(binstr.length); - const split = binstr.split(''); - for (let i = 0; i < split.length; i++) { - arr[i] = split[i].charCodeAt(0); - } - return arr; - }; - } -} - -function TextDecoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } - else { - this.encoding = 'utf-8'; - this.decode = function (view, options) { - if (typeof view === 'undefined') { - return ''; - } - - var stream = (typeof options !== 'undefined' && stream in options) ? options.stream : false; - if (typeof stream !== 'boolean') { - throw new TypeError('stream option must be boolean'); - } - - if (!ArrayBuffer.isView(view)) { - throw new TypeError('passed argument must be an array buffer view'); - } else { - var arr = new Uint8Array(view.buffer, view.byteOffset, view.byteLength), - charArr = new Array(arr.length); - for (let i = 0; i < arr.length; i++) { - charArr[i] = String.fromCharCode(arr[i]); - } - return decodeURIComponent(escape(charArr.join(''))); - } - } - } -} - -module.exports = { - TextEncoder, - TextDecoder, -}; - - -/***/ }), - -/***/ "./node_modules/tr46/index.js": -/*!************************************!*\ - !*** ./node_modules/tr46/index.js ***! - \************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const punycode = __webpack_require__(/*! punycode/ */ "./node_modules/punycode/punycode.es6.js"); -const regexes = __webpack_require__(/*! ./lib/regexes.js */ "./node_modules/tr46/lib/regexes.js"); -const mappingTable = __webpack_require__(/*! ./lib/mappingTable.json */ "./node_modules/tr46/lib/mappingTable.json"); -const { STATUS_MAPPING } = __webpack_require__(/*! ./lib/statusMapping.js */ "./node_modules/tr46/lib/statusMapping.js"); - -function containsNonASCII(str) { - return /[^\x00-\x7F]/u.test(str); -} - -function findStatus(val) { - let start = 0; - let end = mappingTable.length - 1; - - while (start <= end) { - const mid = Math.floor((start + end) / 2); - - const target = mappingTable[mid]; - const min = Array.isArray(target[0]) ? target[0][0] : target[0]; - const max = Array.isArray(target[0]) ? target[0][1] : target[0]; - - if (min <= val && max >= val) { - return target.slice(1); - } else if (min > val) { - end = mid - 1; - } else { - start = mid + 1; - } - } - - return null; -} - -function mapChars(domainName, { transitionalProcessing }) { - let processed = ""; - - for (const ch of domainName) { - const [status, mapping] = findStatus(ch.codePointAt(0)); - - switch (status) { - case STATUS_MAPPING.disallowed: - processed += ch; - break; - case STATUS_MAPPING.ignored: - break; - case STATUS_MAPPING.mapped: - if (transitionalProcessing && ch === "ẞ") { - processed += "ss"; - } else { - processed += mapping; - } - break; - case STATUS_MAPPING.deviation: - if (transitionalProcessing) { - processed += mapping; - } else { - processed += ch; - } - break; - case STATUS_MAPPING.valid: - processed += ch; - break; - } - } - - return processed; -} - -function validateLabel(label, { - checkHyphens, - checkBidi, - checkJoiners, - transitionalProcessing, - useSTD3ASCIIRules, - isBidi -}) { - // "must be satisfied for a non-empty label" - if (label.length === 0) { - return true; - } - - // "1. The label must be in Unicode Normalization Form NFC." - if (label.normalize("NFC") !== label) { - return false; - } - - const codePoints = Array.from(label); - - // "2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character in both the - // third and fourth positions." - // - // "3. If CheckHyphens, the label must neither begin nor end with a U+002D HYPHEN-MINUS character." - if (checkHyphens) { - if ((codePoints[2] === "-" && codePoints[3] === "-") || - (label.startsWith("-") || label.endsWith("-"))) { - return false; - } - } - - // "4. If not CheckHyphens, the label must not begin with “xn--”." - if (!checkHyphens) { - if (label.startsWith("xn--")) { - return false; - } - } - - // "5. The label must not contain a U+002E ( . ) FULL STOP." - if (label.includes(".")) { - return false; - } - - // "6. The label must not begin with a combining mark, that is: General_Category=Mark." - if (regexes.combiningMarks.test(codePoints[0])) { - return false; - } - - // "7. Each code point in the label must only have certain Status values according to Section 5" - for (const ch of codePoints) { - const codePoint = ch.codePointAt(0); - const [status] = findStatus(codePoint); - if (transitionalProcessing) { - // "For Transitional Processing (deprecated), each value must be valid." - if (status !== STATUS_MAPPING.valid) { - return false; - } - } else if (status !== STATUS_MAPPING.valid && status !== STATUS_MAPPING.deviation) { - // "For Nontransitional Processing, each value must be either valid or deviation." - return false; - } - // "In addition, if UseSTD3ASCIIRules=true and the code point is an ASCII code point (U+0000..U+007F), then it must - // be a lowercase letter (a-z), a digit (0-9), or a hyphen-minus (U+002D). (Note: This excludes uppercase ASCII - // A-Z which are mapped in UTS #46 and disallowed in IDNA2008.)" - if (useSTD3ASCIIRules && codePoint <= 0x7F) { - if (!/^(?:[a-z]|[0-9]|-)$/u.test(ch)) { - return false; - } - } - } - - // "8. If CheckJoiners, the label must satisify the ContextJ rules" - // https://tools.ietf.org/html/rfc5892#appendix-A - if (checkJoiners) { - let last = 0; - for (const [i, ch] of codePoints.entries()) { - if (ch === "\u200C" || ch === "\u200D") { - if (i > 0) { - if (regexes.combiningClassVirama.test(codePoints[i - 1])) { - continue; - } - if (ch === "\u200C") { - // TODO: make this more efficient - const next = codePoints.indexOf("\u200C", i + 1); - const test = next < 0 ? codePoints.slice(last) : codePoints.slice(last, next); - if (regexes.validZWNJ.test(test.join(""))) { - last = i + 1; - continue; - } - } - } - return false; - } - } - } - - // "9. If CheckBidi, and if the domain name is a Bidi domain name, then the label must satisfy..." - // https://tools.ietf.org/html/rfc5893#section-2 - if (checkBidi && isBidi) { - let rtl; - - // 1 - if (regexes.bidiS1LTR.test(codePoints[0])) { - rtl = false; - } else if (regexes.bidiS1RTL.test(codePoints[0])) { - rtl = true; - } else { - return false; - } - - if (rtl) { - // 2-4 - if (!regexes.bidiS2.test(label) || - !regexes.bidiS3.test(label) || - (regexes.bidiS4EN.test(label) && regexes.bidiS4AN.test(label))) { - return false; - } - } else if (!regexes.bidiS5.test(label) || - !regexes.bidiS6.test(label)) { // 5-6 - return false; - } - } - - return true; -} - -function isBidiDomain(labels) { - const domain = labels.map(label => { - if (label.startsWith("xn--")) { - try { - return punycode.decode(label.substring(4)); - } catch { - return ""; - } - } - return label; - }).join("."); - return regexes.bidiDomain.test(domain); -} - -function processing(domainName, options) { - // 1. Map. - let string = mapChars(domainName, options); - - // 2. Normalize. - string = string.normalize("NFC"); - - // 3. Break. - const labels = string.split("."); - const isBidi = isBidiDomain(labels); - - // 4. Convert/Validate. - let error = false; - for (const [i, origLabel] of labels.entries()) { - let label = origLabel; - let transitionalProcessingForThisLabel = options.transitionalProcessing; - if (label.startsWith("xn--")) { - if (containsNonASCII(label)) { - error = true; - continue; - } - - try { - label = punycode.decode(label.substring(4)); - } catch { - if (!options.ignoreInvalidPunycode) { - error = true; - continue; - } - } - labels[i] = label; - - if (label === "" || !containsNonASCII(label)) { - error = true; - } - - transitionalProcessingForThisLabel = false; - } - - // No need to validate if we already know there is an error. - if (error) { - continue; - } - const validation = validateLabel(label, { - ...options, - transitionalProcessing: transitionalProcessingForThisLabel, - isBidi - }); - if (!validation) { - error = true; - } - } - - return { - string: labels.join("."), - error - }; -} - -function toASCII(domainName, { - checkHyphens = false, - checkBidi = false, - checkJoiners = false, - useSTD3ASCIIRules = false, - verifyDNSLength = false, - transitionalProcessing = false, - ignoreInvalidPunycode = false -} = {}) { - const result = processing(domainName, { - checkHyphens, - checkBidi, - checkJoiners, - useSTD3ASCIIRules, - transitionalProcessing, - ignoreInvalidPunycode - }); - let labels = result.string.split("."); - labels = labels.map(l => { - if (containsNonASCII(l)) { - try { - return `xn--${punycode.encode(l)}`; - } catch { - result.error = true; - } - } - return l; - }); - - if (verifyDNSLength) { - const total = labels.join(".").length; - if (total > 253 || total === 0) { - result.error = true; - } - - for (let i = 0; i < labels.length; ++i) { - if (labels[i].length > 63 || labels[i].length === 0) { - result.error = true; - break; - } - } - } - - if (result.error) { - return null; - } - return labels.join("."); -} - -function toUnicode(domainName, { - checkHyphens = false, - checkBidi = false, - checkJoiners = false, - useSTD3ASCIIRules = false, - transitionalProcessing = false, - ignoreInvalidPunycode = false -} = {}) { - const result = processing(domainName, { - checkHyphens, - checkBidi, - checkJoiners, - useSTD3ASCIIRules, - transitionalProcessing, - ignoreInvalidPunycode - }); - - return { - domain: result.string, - error: result.error - }; -} - -module.exports = { - toASCII, - toUnicode -}; - - -/***/ }), - -/***/ "./node_modules/tr46/lib/mappingTable.json": -/*!*************************************************!*\ - !*** ./node_modules/tr46/lib/mappingTable.json ***! - \*************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = /*#__PURE__*/JSON.parse('[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"−"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"Ꭸ"],[43897,1,"Ꭹ"],[43898,1,"Ꭺ"],[43899,1,"Ꭻ"],[43900,1,"Ꭼ"],[43901,1,"Ꭽ"],[43902,1,"Ꭾ"],[43903,1,"Ꭿ"],[43904,1,"Ꮀ"],[43905,1,"Ꮁ"],[43906,1,"Ꮂ"],[43907,1,"Ꮃ"],[43908,1,"Ꮄ"],[43909,1,"Ꮅ"],[43910,1,"Ꮆ"],[43911,1,"Ꮇ"],[43912,1,"Ꮈ"],[43913,1,"Ꮉ"],[43914,1,"Ꮊ"],[43915,1,"Ꮋ"],[43916,1,"Ꮌ"],[43917,1,"Ꮍ"],[43918,1,"Ꮎ"],[43919,1,"Ꮏ"],[43920,1,"Ꮐ"],[43921,1,"Ꮑ"],[43922,1,"Ꮒ"],[43923,1,"Ꮓ"],[43924,1,"Ꮔ"],[43925,1,"Ꮕ"],[43926,1,"Ꮖ"],[43927,1,"Ꮗ"],[43928,1,"Ꮘ"],[43929,1,"Ꮙ"],[43930,1,"Ꮚ"],[43931,1,"Ꮛ"],[43932,1,"Ꮜ"],[43933,1,"Ꮝ"],[43934,1,"Ꮞ"],[43935,1,"Ꮟ"],[43936,1,"Ꮠ"],[43937,1,"Ꮡ"],[43938,1,"Ꮢ"],[43939,1,"Ꮣ"],[43940,1,"Ꮤ"],[43941,1,"Ꮥ"],[43942,1,"Ꮦ"],[43943,1,"Ꮧ"],[43944,1,"Ꮨ"],[43945,1,"Ꮩ"],[43946,1,"Ꮪ"],[43947,1,"Ꮫ"],[43948,1,"Ꮬ"],[43949,1,"Ꮭ"],[43950,1,"Ꮮ"],[43951,1,"Ꮯ"],[43952,1,"Ꮰ"],[43953,1,"Ꮱ"],[43954,1,"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,"\\""],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"\'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69371],3],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118015],3],[[118016,118451],2],[[118452,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[[129674,129678],3],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[[129735,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[[129770,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]'); - -/***/ }), - -/***/ "./node_modules/tr46/lib/regexes.js": -/*!******************************************!*\ - !*** ./node_modules/tr46/lib/regexes.js ***! - \******************************************/ -/***/ ((module) => { - -"use strict"; - - -const combiningMarks = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u; -const combiningClassVirama = /[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u; -const validZWNJ = /[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u; -const bidiDomain = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; -const bidiS1LTR = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u; -const bidiS1RTL = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; -const bidiS2 = /^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u; -const bidiS3 = /[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; -const bidiS4EN = /[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u; -const bidiS4AN = /[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u; -const bidiS5 = /^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\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\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u; -const bidiS6 = /[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; - -module.exports = { - combiningMarks, - combiningClassVirama, - validZWNJ, - bidiDomain, - bidiS1LTR, - bidiS1RTL, - bidiS2, - bidiS3, - bidiS4EN, - bidiS4AN, - bidiS5, - bidiS6 - }; - - -/***/ }), - -/***/ "./node_modules/tr46/lib/statusMapping.js": -/*!************************************************!*\ - !*** ./node_modules/tr46/lib/statusMapping.js ***! - \************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports.STATUS_MAPPING = { - mapped: 1, - valid: 2, - disallowed: 3, - deviation: 6, - ignored: 7 -}; - - -/***/ }), - -/***/ "./node_modules/util-deprecate/browser.js": -/*!************************************************!*\ - !*** ./node_modules/util-deprecate/browser.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!__webpack_require__.g.localStorage) return false; - } catch (_) { - return false; - } - var val = __webpack_require__.g.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} - - -/***/ }), - -/***/ "./node_modules/webidl-conversions/lib/index.js": -/*!******************************************************!*\ - !*** ./node_modules/webidl-conversions/lib/index.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -function makeException(ErrorType, message, options) { - if (options.globals) { - ErrorType = options.globals[ErrorType.name]; - } - return new ErrorType(`${options.context ? options.context : "Value"} ${message}.`); -} - -function toNumber(value, options) { - if (typeof value === "bigint") { - throw makeException(TypeError, "is a BigInt which cannot be converted to a number", options); - } - if (!options.globals) { - return Number(value); - } - return options.globals.Number(value); -} - -// Round x to the nearest integer, choosing the even integer if it lies halfway between two. -function evenRound(x) { - // There are four cases for numbers with fractional part being .5: - // - // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example - // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0 - // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2 - // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0 - // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2 - // (where n is a non-negative integer) - // - // Branch here for cases 1 and 4 - if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) || - (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) { - return censorNegativeZero(Math.floor(x)); - } - - return censorNegativeZero(Math.round(x)); -} - -function integerPart(n) { - return censorNegativeZero(Math.trunc(n)); -} - -function sign(x) { - return x < 0 ? -1 : 1; -} - -function modulo(x, y) { - // https://tc39.github.io/ecma262/#eqn-modulo - // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos - const signMightNotMatch = x % y; - if (sign(y) !== sign(signMightNotMatch)) { - return signMightNotMatch + y; - } - return signMightNotMatch; -} - -function censorNegativeZero(x) { - return x === 0 ? 0 : x; -} - -function createIntegerConversion(bitLength, { unsigned }) { - let lowerBound, upperBound; - if (unsigned) { - lowerBound = 0; - upperBound = 2 ** bitLength - 1; - } else { - lowerBound = -(2 ** (bitLength - 1)); - upperBound = 2 ** (bitLength - 1) - 1; - } - - const twoToTheBitLength = 2 ** bitLength; - const twoToOneLessThanTheBitLength = 2 ** (bitLength - 1); - - return (value, options = {}) => { - let x = toNumber(value, options); - x = censorNegativeZero(x); - - if (options.enforceRange) { - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite number", options); - } - - x = integerPart(x); - - if (x < lowerBound || x > upperBound) { - throw makeException( - TypeError, - `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, - options - ); - } - - return x; - } - - if (!Number.isNaN(x) && options.clamp) { - x = Math.min(Math.max(x, lowerBound), upperBound); - x = evenRound(x); - return x; - } - - if (!Number.isFinite(x) || x === 0) { - return 0; - } - x = integerPart(x); - - // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if - // possible. Hopefully it's an optimization for the non-64-bitLength cases too. - if (x >= lowerBound && x <= upperBound) { - return x; - } - - // These will not work great for bitLength of 64, but oh well. See the README for more details. - x = modulo(x, twoToTheBitLength); - if (!unsigned && x >= twoToOneLessThanTheBitLength) { - return x - twoToTheBitLength; - } - return x; - }; -} - -function createLongLongConversion(bitLength, { unsigned }) { - const upperBound = Number.MAX_SAFE_INTEGER; - const lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; - const asBigIntN = unsigned ? BigInt.asUintN : BigInt.asIntN; - - return (value, options = {}) => { - let x = toNumber(value, options); - x = censorNegativeZero(x); - - if (options.enforceRange) { - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite number", options); - } - - x = integerPart(x); - - if (x < lowerBound || x > upperBound) { - throw makeException( - TypeError, - `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, - options - ); - } - - return x; - } - - if (!Number.isNaN(x) && options.clamp) { - x = Math.min(Math.max(x, lowerBound), upperBound); - x = evenRound(x); - return x; - } - - if (!Number.isFinite(x) || x === 0) { - return 0; - } - - let xBigInt = BigInt(integerPart(x)); - xBigInt = asBigIntN(bitLength, xBigInt); - return Number(xBigInt); - }; -} - -exports.any = value => { - return value; -}; - -exports.undefined = () => { - return undefined; -}; - -exports.boolean = value => { - return Boolean(value); -}; - -exports.byte = createIntegerConversion(8, { unsigned: false }); -exports.octet = createIntegerConversion(8, { unsigned: true }); - -exports.short = createIntegerConversion(16, { unsigned: false }); -exports["unsigned short"] = createIntegerConversion(16, { unsigned: true }); - -exports.long = createIntegerConversion(32, { unsigned: false }); -exports["unsigned long"] = createIntegerConversion(32, { unsigned: true }); - -exports["long long"] = createLongLongConversion(64, { unsigned: false }); -exports["unsigned long long"] = createLongLongConversion(64, { unsigned: true }); - -exports.double = (value, options = {}) => { - const x = toNumber(value, options); - - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite floating-point value", options); - } - - return x; -}; - -exports["unrestricted double"] = (value, options = {}) => { - const x = toNumber(value, options); - - return x; -}; - -exports.float = (value, options = {}) => { - const x = toNumber(value, options); - - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite floating-point value", options); - } - - if (Object.is(x, -0)) { - return x; - } - - const y = Math.fround(x); - - if (!Number.isFinite(y)) { - throw makeException(TypeError, "is outside the range of a single-precision floating-point value", options); - } - - return y; -}; - -exports["unrestricted float"] = (value, options = {}) => { - const x = toNumber(value, options); - - if (isNaN(x)) { - return x; - } - - if (Object.is(x, -0)) { - return x; - } - - return Math.fround(x); -}; - -exports.DOMString = (value, options = {}) => { - if (options.treatNullAsEmptyString && value === null) { - return ""; - } - - if (typeof value === "symbol") { - throw makeException(TypeError, "is a symbol, which cannot be converted to a string", options); - } - - const StringCtor = options.globals ? options.globals.String : String; - return StringCtor(value); -}; - -exports.ByteString = (value, options = {}) => { - const x = exports.DOMString(value, options); - let c; - for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { - if (c > 255) { - throw makeException(TypeError, "is not a valid ByteString", options); - } - } - - return x; -}; - -exports.USVString = (value, options = {}) => { - const S = exports.DOMString(value, options); - const n = S.length; - const U = []; - for (let i = 0; i < n; ++i) { - const c = S.charCodeAt(i); - if (c < 0xD800 || c > 0xDFFF) { - U.push(String.fromCodePoint(c)); - } else if (0xDC00 <= c && c <= 0xDFFF) { - U.push(String.fromCodePoint(0xFFFD)); - } else if (i === n - 1) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - const d = S.charCodeAt(i + 1); - if (0xDC00 <= d && d <= 0xDFFF) { - const a = c & 0x3FF; - const b = d & 0x3FF; - U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b)); - ++i; - } else { - U.push(String.fromCodePoint(0xFFFD)); - } - } - } - - return U.join(""); -}; - -exports.object = (value, options = {}) => { - if (value === null || (typeof value !== "object" && typeof value !== "function")) { - throw makeException(TypeError, "is not an object", options); - } - - return value; -}; - -const abByteLengthGetter = - Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; -const sabByteLengthGetter = - typeof SharedArrayBuffer === "function" ? - Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get : - null; - -function isNonSharedArrayBuffer(value) { - try { - // This will throw on SharedArrayBuffers, but not detached ArrayBuffers. - // (The spec says it should throw, but the spec conflicts with implementations: https://github.com/tc39/ecma262/issues/678) - abByteLengthGetter.call(value); - - return true; - } catch { - return false; - } -} - -function isSharedArrayBuffer(value) { - try { - sabByteLengthGetter.call(value); - return true; - } catch { - return false; - } -} - -function isArrayBufferDetached(value) { - try { - // eslint-disable-next-line no-new - new Uint8Array(value); - return false; - } catch { - return true; - } -} - -exports.ArrayBuffer = (value, options = {}) => { - if (!isNonSharedArrayBuffer(value)) { - if (options.allowShared && !isSharedArrayBuffer(value)) { - throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options); - } - throw makeException(TypeError, "is not an ArrayBuffer", options); - } - if (isArrayBufferDetached(value)) { - throw makeException(TypeError, "is a detached ArrayBuffer", options); - } - - return value; -}; - -const dvByteLengthGetter = - Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; -exports.DataView = (value, options = {}) => { - try { - dvByteLengthGetter.call(value); - } catch (e) { - throw makeException(TypeError, "is not a DataView", options); - } - - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is backed by a SharedArrayBuffer, which is not allowed", options); - } - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is backed by a detached ArrayBuffer", options); - } - - return value; -}; - -// Returns the unforgeable `TypedArray` constructor name or `undefined`, -// if the `this` value isn't a valid `TypedArray` object. -// -// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag -const typedArrayNameGetter = Object.getOwnPropertyDescriptor( - Object.getPrototypeOf(Uint8Array).prototype, - Symbol.toStringTag -).get; -[ - Int8Array, - Int16Array, - Int32Array, - Uint8Array, - Uint16Array, - Uint32Array, - Uint8ClampedArray, - Float32Array, - Float64Array -].forEach(func => { - const { name } = func; - const article = /^[AEIOU]/u.test(name) ? "an" : "a"; - exports[name] = (value, options = {}) => { - if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) { - throw makeException(TypeError, `is not ${article} ${name} object`, options); - } - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); - } - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); - } - - return value; - }; -}); - -// Common definitions - -exports.ArrayBufferView = (value, options = {}) => { - if (!ArrayBuffer.isView(value)) { - throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options); - } - - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); - } - - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); - } - return value; -}; - -exports.BufferSource = (value, options = {}) => { - if (ArrayBuffer.isView(value)) { - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); - } - - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); - } - return value; - } - - if (!options.allowShared && !isNonSharedArrayBuffer(value)) { - throw makeException(TypeError, "is not an ArrayBuffer or a view on one", options); - } - if (options.allowShared && !isSharedArrayBuffer(value) && !isNonSharedArrayBuffer(value)) { - throw makeException(TypeError, "is not an ArrayBuffer, SharedArrayBuffer, or a view on one", options); - } - if (isArrayBufferDetached(value)) { - throw makeException(TypeError, "is a detached ArrayBuffer", options); - } - - return value; -}; - -exports.DOMTimeStamp = exports["unsigned long long"]; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/index.js": -/*!******************************************!*\ - !*** ./node_modules/whatwg-url/index.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const { URL, URLSearchParams } = __webpack_require__(/*! ./webidl2js-wrapper */ "./node_modules/whatwg-url/webidl2js-wrapper.js"); -const urlStateMachine = __webpack_require__(/*! ./lib/url-state-machine */ "./node_modules/whatwg-url/lib/url-state-machine.js"); -const percentEncoding = __webpack_require__(/*! ./lib/percent-encoding */ "./node_modules/whatwg-url/lib/percent-encoding.js"); - -const sharedGlobalObject = { Array, Object, Promise, String, TypeError }; -URL.install(sharedGlobalObject, ["Window"]); -URLSearchParams.install(sharedGlobalObject, ["Window"]); - -exports.URL = sharedGlobalObject.URL; -exports.URLSearchParams = sharedGlobalObject.URLSearchParams; - -exports.parseURL = urlStateMachine.parseURL; -exports.basicURLParse = urlStateMachine.basicURLParse; -exports.serializeURL = urlStateMachine.serializeURL; -exports.serializePath = urlStateMachine.serializePath; -exports.serializeHost = urlStateMachine.serializeHost; -exports.serializeInteger = urlStateMachine.serializeInteger; -exports.serializeURLOrigin = urlStateMachine.serializeURLOrigin; -exports.setTheUsername = urlStateMachine.setTheUsername; -exports.setThePassword = urlStateMachine.setThePassword; -exports.cannotHaveAUsernamePasswordPort = urlStateMachine.cannotHaveAUsernamePasswordPort; -exports.hasAnOpaquePath = urlStateMachine.hasAnOpaquePath; - -exports.percentDecodeString = percentEncoding.percentDecodeString; -exports.percentDecodeBytes = percentEncoding.percentDecodeBytes; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/Function.js": -/*!*************************************************!*\ - !*** ./node_modules/whatwg-url/lib/Function.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const conversions = __webpack_require__(/*! webidl-conversions */ "./node_modules/webidl-conversions/lib/index.js"); -const utils = __webpack_require__(/*! ./utils.js */ "./node_modules/whatwg-url/lib/utils.js"); - -exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { - if (typeof value !== "function") { - throw new globalObject.TypeError(context + " is not a function"); - } - - function invokeTheCallbackFunction(...args) { - const thisArg = utils.tryWrapperForImpl(this); - let callResult; - - for (let i = 0; i < args.length; i++) { - args[i] = utils.tryWrapperForImpl(args[i]); - } - - callResult = Reflect.apply(value, thisArg, args); - - callResult = conversions["any"](callResult, { context: context, globals: globalObject }); - - return callResult; - } - - invokeTheCallbackFunction.construct = (...args) => { - for (let i = 0; i < args.length; i++) { - args[i] = utils.tryWrapperForImpl(args[i]); - } - - let callResult = Reflect.construct(value, args); - - callResult = conversions["any"](callResult, { context: context, globals: globalObject }); - - return callResult; - }; - - invokeTheCallbackFunction[utils.wrapperSymbol] = value; - invokeTheCallbackFunction.objectReference = value; - - return invokeTheCallbackFunction; -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URL-impl.js": -/*!*************************************************!*\ - !*** ./node_modules/whatwg-url/lib/URL-impl.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -const usm = __webpack_require__(/*! ./url-state-machine */ "./node_modules/whatwg-url/lib/url-state-machine.js"); -const urlencoded = __webpack_require__(/*! ./urlencoded */ "./node_modules/whatwg-url/lib/urlencoded.js"); -const URLSearchParams = __webpack_require__(/*! ./URLSearchParams */ "./node_modules/whatwg-url/lib/URLSearchParams.js"); - -exports.implementation = class URLImpl { - // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error - // messages in the constructor that distinguish between the different causes of failure. - constructor(globalObject, [url, base]) { - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === null) { - throw new TypeError(`Invalid base URL: ${base}`); - } - } - - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === null) { - throw new TypeError(`Invalid URL: ${url}`); - } - - const query = parsedURL.query !== null ? parsedURL.query : ""; - - this._url = parsedURL; - - // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips - // question mark by default. Therefore the doNotStripQMark hack is used. - this._query = URLSearchParams.createImpl(globalObject, [query], { doNotStripQMark: true }); - this._query._url = this; - } - - static parse(globalObject, input, base) { - try { - return new URLImpl(globalObject, [input, base]); - } catch { - return null; - } - } - - static canParse(url, base) { - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === null) { - return false; - } - } - - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === null) { - return false; - } - - return true; - } - - get href() { - return usm.serializeURL(this._url); - } - - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === null) { - throw new TypeError(`Invalid URL: ${v}`); - } - - this._url = parsedURL; - - this._query._list.splice(0); - const { query } = parsedURL; - if (query !== null) { - this._query._list = urlencoded.parseUrlencodedString(query); - } - } - - get origin() { - return usm.serializeURLOrigin(this._url); - } - - get protocol() { - return `${this._url.scheme}:`; - } - - set protocol(v) { - usm.basicURLParse(`${v}:`, { url: this._url, stateOverride: "scheme start" }); - } - - get username() { - return this._url.username; - } - - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setTheUsername(this._url, v); - } - - get password() { - return this._url.password; - } - - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setThePassword(this._url, v); - } - - get host() { - const url = this._url; - - if (url.host === null) { - return ""; - } - - if (url.port === null) { - return usm.serializeHost(url.host); - } - - return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`; - } - - set host(v) { - if (usm.hasAnOpaquePath(this._url)) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } - - get hostname() { - if (this._url.host === null) { - return ""; - } - - return usm.serializeHost(this._url.host); - } - - set hostname(v) { - if (usm.hasAnOpaquePath(this._url)) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } - - get port() { - if (this._url.port === null) { - return ""; - } - - return usm.serializeInteger(this._url.port); - } - - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } - - get pathname() { - return usm.serializePath(this._url); - } - - set pathname(v) { - if (usm.hasAnOpaquePath(this._url)) { - return; - } - - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } - - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } - - return `?${this._url.query}`; - } - - set search(v) { - const url = this._url; - - if (v === "") { - url.query = null; - this._query._list = []; - return; - } - - const input = v[0] === "?" ? v.substring(1) : v; - url.query = ""; - usm.basicURLParse(input, { url, stateOverride: "query" }); - this._query._list = urlencoded.parseUrlencodedString(input); - } - - get searchParams() { - return this._query; - } - - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } - - return `#${this._url.fragment}`; - } - - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; - } - - const input = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); - } - - toJSON() { - return this.href; - } -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URL.js": -/*!********************************************!*\ - !*** ./node_modules/whatwg-url/lib/URL.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const conversions = __webpack_require__(/*! webidl-conversions */ "./node_modules/webidl-conversions/lib/index.js"); -const utils = __webpack_require__(/*! ./utils.js */ "./node_modules/whatwg-url/lib/utils.js"); - -const implSymbol = utils.implSymbol; -const ctorRegistrySymbol = utils.ctorRegistrySymbol; - -const interfaceName = "URL"; - -exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; -}; -exports.isImpl = value => { - return utils.isObject(value) && value instanceof Impl.implementation; -}; -exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { - if (exports.is(value)) { - return utils.implForWrapper(value); - } - throw new globalObject.TypeError(`${context} is not of type 'URL'.`); -}; - -function makeWrapper(globalObject, newTarget) { - let proto; - if (newTarget !== undefined) { - proto = newTarget.prototype; - } - - if (!utils.isObject(proto)) { - proto = globalObject[ctorRegistrySymbol]["URL"].prototype; - } - - return Object.create(proto); -} - -exports.create = (globalObject, constructorArgs, privateData) => { - const wrapper = makeWrapper(globalObject); - return exports.setup(wrapper, globalObject, constructorArgs, privateData); -}; - -exports.createImpl = (globalObject, constructorArgs, privateData) => { - const wrapper = exports.create(globalObject, constructorArgs, privateData); - return utils.implForWrapper(wrapper); -}; - -exports._internalSetup = (wrapper, globalObject) => {}; - -exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { - privateData.wrapper = wrapper; - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: new Impl.implementation(globalObject, constructorArgs, privateData), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper; -}; - -exports["new"] = (globalObject, newTarget) => { - const wrapper = makeWrapper(globalObject, newTarget); - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: Object.create(Impl.implementation.prototype), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper[implSymbol]; -}; - -const exposed = new Set(["Window", "Worker"]); - -exports.install = (globalObject, globalNames) => { - if (!globalNames.some(globalName => exposed.has(globalName))) { - return; - } - - const ctorRegistry = utils.initCtorRegistry(globalObject); - class URL { - constructor(url) { - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to construct 'URL': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to construct 'URL': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return exports.setup(Object.create(new.target.prototype), globalObject, args); - } - - toJSON() { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol].toJSON(); - } - - get href() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["href"]; - } - - set href(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'href' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["href"] = V; - } - - toString() { - const esValue = this; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["href"]; - } - - get origin() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["origin"]; - } - - get protocol() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["protocol"]; - } - - set protocol(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'protocol' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["protocol"] = V; - } - - get username() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["username"]; - } - - set username(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'username' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["username"] = V; - } - - get password() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["password"]; - } - - set password(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'password' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["password"] = V; - } - - get host() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["host"]; - } - - set host(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'host' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["host"] = V; - } - - get hostname() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["hostname"]; - } - - set hostname(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'hostname' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["hostname"] = V; - } - - get port() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["port"]; - } - - set port(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'port' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["port"] = V; - } - - get pathname() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["pathname"]; - } - - set pathname(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'pathname' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["pathname"] = V; - } - - get search() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["search"]; - } - - set search(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'search' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["search"] = V; - } - - get searchParams() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL."); - } - - return utils.getSameObject(this, "searchParams", () => { - return utils.tryWrapperForImpl(esValue[implSymbol]["searchParams"]); - }); - } - - get hash() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["hash"]; - } - - set hash(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'hash' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["hash"] = V; - } - - static parse(url) { - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'parse' on 'URL': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'parse' on 'URL': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args)); - } - - static canParse(url) { - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'canParse' on 'URL': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'canParse' on 'URL': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return Impl.implementation.canParse(...args); - } - } - Object.defineProperties(URL.prototype, { - toJSON: { enumerable: true }, - href: { enumerable: true }, - toString: { enumerable: true }, - origin: { enumerable: true }, - protocol: { enumerable: true }, - username: { enumerable: true }, - password: { enumerable: true }, - host: { enumerable: true }, - hostname: { enumerable: true }, - port: { enumerable: true }, - pathname: { enumerable: true }, - search: { enumerable: true }, - searchParams: { enumerable: true }, - hash: { enumerable: true }, - [Symbol.toStringTag]: { value: "URL", configurable: true } - }); - Object.defineProperties(URL, { parse: { enumerable: true }, canParse: { enumerable: true } }); - ctorRegistry[interfaceName] = URL; - - Object.defineProperty(globalObject, interfaceName, { - configurable: true, - writable: true, - value: URL - }); - - if (globalNames.includes("Window")) { - Object.defineProperty(globalObject, "webkitURL", { - configurable: true, - writable: true, - value: URL - }); - } -}; - -const Impl = __webpack_require__(/*! ./URL-impl.js */ "./node_modules/whatwg-url/lib/URL-impl.js"); - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URLSearchParams-impl.js": -/*!*************************************************************!*\ - !*** ./node_modules/whatwg-url/lib/URLSearchParams-impl.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -const urlencoded = __webpack_require__(/*! ./urlencoded */ "./node_modules/whatwg-url/lib/urlencoded.js"); - -exports.implementation = class URLSearchParamsImpl { - constructor(globalObject, constructorArgs, { doNotStripQMark = false }) { - let init = constructorArgs[0]; - this._list = []; - this._url = null; - - if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { - init = init.slice(1); - } - - if (Array.isArray(init)) { - for (const pair of init) { - if (pair.length !== 2) { - throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " + - "contain exactly two elements."); - } - this._list.push([pair[0], pair[1]]); - } - } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { - for (const name of Object.keys(init)) { - const value = init[name]; - this._list.push([name, value]); - } - } else { - this._list = urlencoded.parseUrlencodedString(init); - } - } - - _updateSteps() { - if (this._url !== null) { - let serializedQuery = urlencoded.serializeUrlencoded(this._list); - if (serializedQuery === "") { - serializedQuery = null; - } - - this._url._url.query = serializedQuery; - } - } - - get size() { - return this._list.length; - } - - append(name, value) { - this._list.push([name, value]); - this._updateSteps(); - } - - delete(name, value) { - let i = 0; - while (i < this._list.length) { - if (this._list[i][0] === name && (value === undefined || this._list[i][1] === value)) { - this._list.splice(i, 1); - } else { - i++; - } - } - this._updateSteps(); - } - - get(name) { - for (const tuple of this._list) { - if (tuple[0] === name) { - return tuple[1]; - } - } - return null; - } - - getAll(name) { - const output = []; - for (const tuple of this._list) { - if (tuple[0] === name) { - output.push(tuple[1]); - } - } - return output; - } - - has(name, value) { - for (const tuple of this._list) { - if (tuple[0] === name && (value === undefined || tuple[1] === value)) { - return true; - } - } - return false; - } - - set(name, value) { - let found = false; - let i = 0; - while (i < this._list.length) { - if (this._list[i][0] === name) { - if (found) { - this._list.splice(i, 1); - } else { - found = true; - this._list[i][1] = value; - i++; - } - } else { - i++; - } - } - if (!found) { - this._list.push([name, value]); - } - this._updateSteps(); - } - - sort() { - this._list.sort((a, b) => { - if (a[0] < b[0]) { - return -1; - } - if (a[0] > b[0]) { - return 1; - } - return 0; - }); - - this._updateSteps(); - } - - [Symbol.iterator]() { - return this._list[Symbol.iterator](); - } - - toString() { - return urlencoded.serializeUrlencoded(this._list); - } -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URLSearchParams.js": -/*!********************************************************!*\ - !*** ./node_modules/whatwg-url/lib/URLSearchParams.js ***! - \********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const conversions = __webpack_require__(/*! webidl-conversions */ "./node_modules/webidl-conversions/lib/index.js"); -const utils = __webpack_require__(/*! ./utils.js */ "./node_modules/whatwg-url/lib/utils.js"); - -const Function = __webpack_require__(/*! ./Function.js */ "./node_modules/whatwg-url/lib/Function.js"); -const newObjectInRealm = utils.newObjectInRealm; -const implSymbol = utils.implSymbol; -const ctorRegistrySymbol = utils.ctorRegistrySymbol; - -const interfaceName = "URLSearchParams"; - -exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; -}; -exports.isImpl = value => { - return utils.isObject(value) && value instanceof Impl.implementation; -}; -exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { - if (exports.is(value)) { - return utils.implForWrapper(value); - } - throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`); -}; - -exports.createDefaultIterator = (globalObject, target, kind) => { - const ctorRegistry = globalObject[ctorRegistrySymbol]; - const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"]; - const iterator = Object.create(iteratorPrototype); - Object.defineProperty(iterator, utils.iterInternalSymbol, { - value: { target, kind, index: 0 }, - configurable: true - }); - return iterator; -}; - -function makeWrapper(globalObject, newTarget) { - let proto; - if (newTarget !== undefined) { - proto = newTarget.prototype; - } - - if (!utils.isObject(proto)) { - proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype; - } - - return Object.create(proto); -} - -exports.create = (globalObject, constructorArgs, privateData) => { - const wrapper = makeWrapper(globalObject); - return exports.setup(wrapper, globalObject, constructorArgs, privateData); -}; - -exports.createImpl = (globalObject, constructorArgs, privateData) => { - const wrapper = exports.create(globalObject, constructorArgs, privateData); - return utils.implForWrapper(wrapper); -}; - -exports._internalSetup = (wrapper, globalObject) => {}; - -exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { - privateData.wrapper = wrapper; - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: new Impl.implementation(globalObject, constructorArgs, privateData), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper; -}; - -exports["new"] = (globalObject, newTarget) => { - const wrapper = makeWrapper(globalObject, newTarget); - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: Object.create(Impl.implementation.prototype), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper[implSymbol]; -}; - -const exposed = new Set(["Window", "Worker"]); - -exports.install = (globalObject, globalNames) => { - if (!globalNames.some(globalName => exposed.has(globalName))) { - return; - } - - const ctorRegistry = utils.initCtorRegistry(globalObject); - class URLSearchParams { - constructor() { - const args = []; - { - let curArg = arguments[0]; - if (curArg !== undefined) { - if (utils.isObject(curArg)) { - if (curArg[Symbol.iterator] !== undefined) { - if (!utils.isObject(curArg)) { - throw new globalObject.TypeError( - "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object." - ); - } else { - const V = []; - const tmp = curArg; - for (let nextItem of tmp) { - if (!utils.isObject(nextItem)) { - throw new globalObject.TypeError( - "Failed to construct 'URLSearchParams': parameter 1" + - " sequence" + - "'s element" + - " is not an iterable object." - ); - } else { - const V = []; - const tmp = nextItem; - for (let nextItem of tmp) { - nextItem = conversions["USVString"](nextItem, { - context: - "Failed to construct 'URLSearchParams': parameter 1" + - " sequence" + - "'s element" + - "'s element", - globals: globalObject - }); - - V.push(nextItem); - } - nextItem = V; - } - - V.push(nextItem); - } - curArg = V; - } - } else { - if (!utils.isObject(curArg)) { - throw new globalObject.TypeError( - "Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object." - ); - } else { - const result = Object.create(null); - for (const key of Reflect.ownKeys(curArg)) { - const desc = Object.getOwnPropertyDescriptor(curArg, key); - if (desc && desc.enumerable) { - let typedKey = key; - - typedKey = conversions["USVString"](typedKey, { - context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key", - globals: globalObject - }); - - let typedValue = curArg[key]; - - typedValue = conversions["USVString"](typedValue, { - context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value", - globals: globalObject - }); - - result[typedKey] = typedValue; - } - } - curArg = result; - } - } - } else { - curArg = conversions["USVString"](curArg, { - context: "Failed to construct 'URLSearchParams': parameter 1", - globals: globalObject - }); - } - } else { - curArg = ""; - } - args.push(curArg); - } - return exports.setup(Object.create(new.target.prototype), globalObject, args); - } - - append(name, value) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'append' called on an object that is not a valid instance of URLSearchParams." - ); - } - - if (arguments.length < 2) { - throw new globalObject.TypeError( - `Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'append' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'append' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].append(...args)); - } - - delete(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'delete' called on an object that is not a valid instance of URLSearchParams." - ); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'delete' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args)); - } - - get(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams."); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'get' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - return esValue[implSymbol].get(...args); - } - - getAll(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'getAll' called on an object that is not a valid instance of URLSearchParams." - ); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args)); - } - - has(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams."); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'has' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'has' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return esValue[implSymbol].has(...args); - } - - set(name, value) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams."); - } - - if (arguments.length < 2) { - throw new globalObject.TypeError( - `Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'set' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'set' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].set(...args)); - } - - sort() { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams."); - } - - return utils.tryWrapperForImpl(esValue[implSymbol].sort()); - } - - toString() { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'toString' called on an object that is not a valid instance of URLSearchParams." - ); - } - - return esValue[implSymbol].toString(); - } - - keys() { - if (!exports.is(this)) { - throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams."); - } - return exports.createDefaultIterator(globalObject, this, "key"); - } - - values() { - if (!exports.is(this)) { - throw new globalObject.TypeError( - "'values' called on an object that is not a valid instance of URLSearchParams." - ); - } - return exports.createDefaultIterator(globalObject, this, "value"); - } - - entries() { - if (!exports.is(this)) { - throw new globalObject.TypeError( - "'entries' called on an object that is not a valid instance of URLSearchParams." - ); - } - return exports.createDefaultIterator(globalObject, this, "key+value"); - } - - forEach(callback) { - if (!exports.is(this)) { - throw new globalObject.TypeError( - "'forEach' called on an object that is not a valid instance of URLSearchParams." - ); - } - if (arguments.length < 1) { - throw new globalObject.TypeError( - "Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present." - ); - } - callback = Function.convert(globalObject, callback, { - context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1" - }); - const thisArg = arguments[1]; - let pairs = Array.from(this[implSymbol]); - let i = 0; - while (i < pairs.length) { - const [key, value] = pairs[i].map(utils.tryWrapperForImpl); - callback.call(thisArg, value, key, this); - pairs = Array.from(this[implSymbol]); - i++; - } - } - - get size() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'get size' called on an object that is not a valid instance of URLSearchParams." - ); - } - - return esValue[implSymbol]["size"]; - } - } - Object.defineProperties(URLSearchParams.prototype, { - append: { enumerable: true }, - delete: { enumerable: true }, - get: { enumerable: true }, - getAll: { enumerable: true }, - has: { enumerable: true }, - set: { enumerable: true }, - sort: { enumerable: true }, - toString: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true }, - forEach: { enumerable: true }, - size: { enumerable: true }, - [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, - [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } - }); - ctorRegistry[interfaceName] = URLSearchParams; - - ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], { - [Symbol.toStringTag]: { - configurable: true, - value: "URLSearchParams Iterator" - } - }); - utils.define(ctorRegistry["URLSearchParams Iterator"], { - next() { - const internal = this && this[utils.iterInternalSymbol]; - if (!internal) { - throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object"); - } - - const { target, kind, index } = internal; - const values = Array.from(target[implSymbol]); - const len = values.length; - if (index >= len) { - return newObjectInRealm(globalObject, { value: undefined, done: true }); - } - - const pair = values[index]; - internal.index = index + 1; - return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind)); - } - }); - - Object.defineProperty(globalObject, interfaceName, { - configurable: true, - writable: true, - value: URLSearchParams - }); -}; - -const Impl = __webpack_require__(/*! ./URLSearchParams-impl.js */ "./node_modules/whatwg-url/lib/URLSearchParams-impl.js"); - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/encoding.js": -/*!*************************************************!*\ - !*** ./node_modules/whatwg-url/lib/encoding.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/* provided dependency */ var TextEncoder = __webpack_require__(/*! text-encoder */ "./node_modules/text-encoder/index.js")["TextEncoder"]; -/* provided dependency */ var TextDecoder = __webpack_require__(/*! text-encoder */ "./node_modules/text-encoder/index.js")["TextDecoder"]; - -const utf8Encoder = new TextEncoder(); -const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); - -function utf8Encode(string) { - return utf8Encoder.encode(string); -} - -function utf8DecodeWithoutBOM(bytes) { - return utf8Decoder.decode(bytes); -} - -module.exports = { - utf8Encode, - utf8DecodeWithoutBOM -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/infra.js": -/*!**********************************************!*\ - !*** ./node_modules/whatwg-url/lib/infra.js ***! - \**********************************************/ -/***/ ((module) => { - -"use strict"; - - -// Note that we take code points as JS numbers, not JS strings. - -function isASCIIDigit(c) { - return c >= 0x30 && c <= 0x39; -} - -function isASCIIAlpha(c) { - return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); -} - -function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); -} - -function isASCIIHex(c) { - return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); -} - -module.exports = { - isASCIIDigit, - isASCIIAlpha, - isASCIIAlphanumeric, - isASCIIHex -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/percent-encoding.js": -/*!*********************************************************!*\ - !*** ./node_modules/whatwg-url/lib/percent-encoding.js ***! - \*********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const { isASCIIHex } = __webpack_require__(/*! ./infra */ "./node_modules/whatwg-url/lib/infra.js"); -const { utf8Encode } = __webpack_require__(/*! ./encoding */ "./node_modules/whatwg-url/lib/encoding.js"); - -function p(char) { - return char.codePointAt(0); -} - -// https://url.spec.whatwg.org/#percent-encode -function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = `0${hex}`; - } - - return `%${hex}`; -} - -// https://url.spec.whatwg.org/#percent-decode -function percentDecodeBytes(input) { - const output = new Uint8Array(input.byteLength); - let outputIndex = 0; - for (let i = 0; i < input.byteLength; ++i) { - const byte = input[i]; - if (byte !== 0x25) { - output[outputIndex++] = byte; - } else if (byte === 0x25 && (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) { - output[outputIndex++] = byte; - } else { - const bytePoint = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16); - output[outputIndex++] = bytePoint; - i += 2; - } - } - - return output.slice(0, outputIndex); -} - -// https://url.spec.whatwg.org/#string-percent-decode -function percentDecodeString(input) { - const bytes = utf8Encode(input); - return percentDecodeBytes(bytes); -} - -// https://url.spec.whatwg.org/#c0-control-percent-encode-set -function isC0ControlPercentEncode(c) { - return c <= 0x1F || c > 0x7E; -} - -// https://url.spec.whatwg.org/#fragment-percent-encode-set -const extraFragmentPercentEncodeSet = new Set([p(" "), p("\""), p("<"), p(">"), p("`")]); -function isFragmentPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#query-percent-encode-set -const extraQueryPercentEncodeSet = new Set([p(" "), p("\""), p("#"), p("<"), p(">")]); -function isQueryPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraQueryPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#special-query-percent-encode-set -function isSpecialQueryPercentEncode(c) { - return isQueryPercentEncode(c) || c === p("'"); -} - -// https://url.spec.whatwg.org/#path-percent-encode-set -const extraPathPercentEncodeSet = new Set([p("?"), p("`"), p("{"), p("}"), p("^")]); -function isPathPercentEncode(c) { - return isQueryPercentEncode(c) || extraPathPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#userinfo-percent-encode-set -const extraUserinfoPercentEncodeSet = - new Set([p("/"), p(":"), p(";"), p("="), p("@"), p("["), p("\\"), p("]"), p("|")]); -function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#component-percent-encode-set -const extraComponentPercentEncodeSet = new Set([p("$"), p("%"), p("&"), p("+"), p(",")]); -function isComponentPercentEncode(c) { - return isUserinfoPercentEncode(c) || extraComponentPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set -const extraURLEncodedPercentEncodeSet = new Set([p("!"), p("'"), p("("), p(")"), p("~")]); -function isURLEncodedPercentEncode(c) { - return isComponentPercentEncode(c) || extraURLEncodedPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#code-point-percent-encode-after-encoding -// https://url.spec.whatwg.org/#utf-8-percent-encode -// Assuming encoding is always utf-8 allows us to trim one of the logic branches. TODO: support encoding. -// The "-Internal" variant here has code points as JS strings. The external version used by other files has code points -// as JS numbers, like the rest of the codebase. -function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) { - const bytes = utf8Encode(codePoint); - let output = ""; - for (const byte of bytes) { - // Our percentEncodePredicate operates on bytes, not code points, so this is slightly different from the spec. - if (!percentEncodePredicate(byte)) { - output += String.fromCharCode(byte); - } else { - output += percentEncode(byte); - } - } - - return output; -} - -function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) { - return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate); -} - -// https://url.spec.whatwg.org/#string-percent-encode-after-encoding -// https://url.spec.whatwg.org/#string-utf-8-percent-encode -function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) { - let output = ""; - for (const codePoint of input) { - if (spaceAsPlus && codePoint === " ") { - output += "+"; - } else { - output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate); - } - } - return output; -} - -module.exports = { - isC0ControlPercentEncode, - isFragmentPercentEncode, - isQueryPercentEncode, - isSpecialQueryPercentEncode, - isPathPercentEncode, - isUserinfoPercentEncode, - isURLEncodedPercentEncode, - percentDecodeString, - percentDecodeBytes, - utf8PercentEncodeString, - utf8PercentEncodeCodePoint -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/url-state-machine.js": -/*!**********************************************************!*\ - !*** ./node_modules/whatwg-url/lib/url-state-machine.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const tr46 = __webpack_require__(/*! tr46 */ "./node_modules/tr46/index.js"); - -const infra = __webpack_require__(/*! ./infra */ "./node_modules/whatwg-url/lib/infra.js"); -const { utf8DecodeWithoutBOM } = __webpack_require__(/*! ./encoding */ "./node_modules/whatwg-url/lib/encoding.js"); -const { percentDecodeString, utf8PercentEncodeCodePoint, utf8PercentEncodeString, isC0ControlPercentEncode, - isFragmentPercentEncode, isQueryPercentEncode, isSpecialQueryPercentEncode, isPathPercentEncode, - isUserinfoPercentEncode } = __webpack_require__(/*! ./percent-encoding */ "./node_modules/whatwg-url/lib/percent-encoding.js"); - -function p(char) { - return char.codePointAt(0); -} - -const specialSchemes = { - ftp: 21, - file: null, - http: 80, - https: 443, - ws: 80, - wss: 443 -}; - -const failure = Symbol("failure"); - -function countSymbols(str) { - return [...str].length; -} - -function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? undefined : String.fromCodePoint(c); -} - -function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; -} - -function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; -} - -function isWindowsDriveLetterCodePoints(cp1, cp2) { - return infra.isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|")); -} - -function isWindowsDriveLetterString(string) { - return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); -} - -function isNormalizedWindowsDriveLetterString(string) { - return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; -} - -function containsForbiddenHostCodePoint(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; -} - -function containsForbiddenDomainCodePoint(string) { - return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1; -} - -function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; -} - -function isSpecial(url) { - return isSpecialScheme(url.scheme); -} - -function isNotSpecial(url) { - return !isSpecialScheme(url.scheme); -} - -function defaultPort(scheme) { - return specialSchemes[scheme]; -} - -function parseIPv4Number(input) { - if (input === "") { - return failure; - } - - let R = 10; - - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; - } - - if (input === "") { - return 0; - } - - let regex = /[^0-7]/u; - if (R === 10) { - regex = /[^0-9]/u; - } - if (R === 16) { - regex = /[^0-9A-Fa-f]/u; - } - - if (regex.test(input)) { - return failure; - } - - return parseInt(input, R); -} - -function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } - - if (parts.length > 4) { - return failure; - } - - const numbers = []; - for (const part of parts) { - const n = parseIPv4Number(part); - if (n === failure) { - return failure; - } - - numbers.push(n); - } - - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; - } - } - if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) { - return failure; - } - - let ipv4 = numbers.pop(); - let counter = 0; - - for (const n of numbers) { - ipv4 += n * 256 ** (3 - counter); - ++counter; - } - - return ipv4; -} - -function serializeIPv4(address) { - let output = ""; - let n = address; - - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = `.${output}`; - } - n = Math.floor(n / 256); - } - - return output; -} - -function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - - input = Array.from(input, c => c.codePointAt(0)); - - if (input[pointer] === p(":")) { - if (input[pointer + 1] !== p(":")) { - return failure; - } - - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } - - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; - } - - if (input[pointer] === p(":")) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - - let value = 0; - let length = 0; - - while (length < 4 && infra.isASCIIHex(input[pointer])) { - value = value * 0x10 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; - } - - if (input[pointer] === p(".")) { - if (length === 0) { - return failure; - } - - pointer -= length; - - if (pieceIndex > 6) { - return failure; - } - - let numbersSeen = 0; - - while (input[pointer] !== undefined) { - let ipv4Piece = null; - - if (numbersSeen > 0) { - if (input[pointer] === p(".") && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - - if (!infra.isASCIIDigit(input[pointer])) { - return failure; - } - - while (infra.isASCIIDigit(input[pointer])) { - const number = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - - address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; - - ++numbersSeen; - - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - - if (numbersSeen !== 4) { - return failure; - } - - break; - } else if (input[pointer] === p(":")) { - ++pointer; - if (input[pointer] === undefined) { - return failure; - } - } else if (input[pointer] !== undefined) { - return failure; - } - - address[pieceIndex] = value; - ++pieceIndex; - } - - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } - - return address; -} - -function serializeIPv6(address) { - let output = ""; - const compress = findTheIPv6AddressCompressedPieceIndex(address); - let ignore0 = false; - - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - - output += address[pieceIndex].toString(16); - - if (pieceIndex !== 7) { - output += ":"; - } - } - - return output; -} - -function parseHost(input, isOpaque = false) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; - } - - return parseIPv6(input.substring(1, input.length - 1)); - } - - if (isOpaque) { - return parseOpaqueHost(input); - } - - const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); - const asciiDomain = domainToASCII(domain); - if (asciiDomain === failure) { - return failure; - } - - if (endsInANumber(asciiDomain)) { - return parseIPv4(asciiDomain); - } - - return asciiDomain; -} - -function endsInANumber(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length === 1) { - return false; - } - parts.pop(); - } - - const last = parts[parts.length - 1]; - if (parseIPv4Number(last) !== failure) { - return true; - } - - if (/^[0-9]+$/u.test(last)) { - return true; - } - - return false; -} - -function parseOpaqueHost(input) { - if (containsForbiddenHostCodePoint(input)) { - return failure; - } - - return utf8PercentEncodeString(input, isC0ControlPercentEncode); -} - -function findTheIPv6AddressCompressedPieceIndex(address) { - let longestIndex = null; - let longestSize = 1; // only find elements > 1 - let foundIndex = null; - let foundSize = 0; - - for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) { - if (address[pieceIndex] !== 0) { - if (foundSize > longestSize) { - longestIndex = foundIndex; - longestSize = foundSize; - } - - foundIndex = null; - foundSize = 0; - } else { - if (foundIndex === null) { - foundIndex = pieceIndex; - } - ++foundSize; - } - } - - if (foundSize > longestSize) { - return foundIndex; - } - - return longestIndex; -} - -function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } - - // IPv6 serializer - if (host instanceof Array) { - return `[${serializeIPv6(host)}]`; - } - - return host; -} - -function domainToASCII(domain, beStrict = false) { - const result = tr46.toASCII(domain, { - checkHyphens: beStrict, - checkBidi: true, - checkJoiners: true, - useSTD3ASCIIRules: beStrict, - transitionalProcessing: false, - verifyDNSLength: beStrict, - ignoreInvalidPunycode: false - }); - if (result === null) { - return failure; - } - - if (!beStrict) { - if (result === "") { - return failure; - } - if (containsForbiddenDomainCodePoint(result)) { - return failure; - } - } - return result; -} - -function trimControlChars(string) { - // Avoid using regexp because of this V8 bug: https://issues.chromium.org/issues/42204424 - - let start = 0; - let end = string.length; - for (; start < end; ++start) { - if (string.charCodeAt(start) > 0x20) { - break; - } - } - for (; end > start; --end) { - if (string.charCodeAt(end - 1) > 0x20) { - break; - } - } - return string.substring(start, end); -} - -function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/ug, ""); -} - -function shortenPath(url) { - const { path } = url; - if (path.length === 0) { - return; - } - if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { - return; - } - - path.pop(); -} - -function includesCredentials(url) { - return url.username !== "" || url.password !== ""; -} - -function cannotHaveAUsernamePasswordPort(url) { - return url.host === null || url.host === "" || url.scheme === "file"; -} - -function hasAnOpaquePath(url) { - return typeof url.path === "string"; -} - -function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/u.test(string); -} - -function URLStateMachine(input, base, encodingOverride, url, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; - - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null - }; - - const res = trimControlChars(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - } - - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - - this.state = stateOverride || "scheme start"; - - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - - this.input = Array.from(this.input, c => c.codePointAt(0)); - - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); - - // exec state machine - const ret = this[`parse ${this.state}`](c, cStr); - if (!ret) { - break; // terminate algorithm - } else if (ret === failure) { - this.failure = true; - break; - } - } -} - -URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { - if (infra.isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (infra.isASCIIAlphanumeric(c) || c === p("+") || c === p("-") || c === p(".")) { - this.buffer += cStr.toLowerCase(); - } else if (c === p(":")) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } - - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } - - if (this.url.scheme === "file" && this.url.host === "") { - return false; - } - } - this.url.scheme = this.buffer; - if (this.stateOverride) { - if (this.url.port === defaultPort(this.url.scheme)) { - this.url.port = null; - } - return false; - } - this.buffer = ""; - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== p("/") || this.input[this.pointer + 2] !== p("/")) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === p("/")) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.path = ""; - this.state = "opaque path"; - } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || (hasAnOpaquePath(this.base) && c !== p("#"))) { - return failure; - } else if (hasAnOpaquePath(this.base) && c === p("#")) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path; - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { - if (c === p("/") && this.input[this.pointer + 1] === p("/")) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { - if (c === p("/")) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (c === p("/")) { - this.state = "relative slash"; - } else if (isSpecial(this.url) && c === p("\\")) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (!isNaN(c)) { - this.url.query = null; - this.url.path.pop(); - this.state = "path"; - --this.pointer; - } - } - - return true; -}; - -URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === p("/") || c === p("\\"))) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === p("/")) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { - if (c === p("/") && this.input[this.pointer + 1] === p("/")) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== p("/") && c !== p("\\")) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - - return true; -}; - -URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { - if (c === p("@")) { - this.parseError = true; - if (this.atFlag) { - this.buffer = `%40${this.buffer}`; - } - this.atFlag = true; - - // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); - - if (codePoint === p(":") && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || - (isSpecial(this.url) && c === p("\\"))) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse hostname"] = -URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === p(":") && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } - - if (this.stateOverride === "hostname") { - return false; - } - - const host = parseHost(this.buffer, isNotSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "port"; - } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || - (isSpecial(this.url) && c === p("\\"))) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && - (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } - - const host = parseHost(this.buffer, isNotSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === p("[")) { - this.arrFlag = true; - } else if (c === p("]")) { - this.arrFlag = false; - } - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (infra.isASCIIDigit(c)) { - this.buffer += cStr; - } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || - (isSpecial(this.url) && c === p("\\")) || - this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > 2 ** 16 - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -const fileOtherwiseCodePoints = new Set([p("/"), p("\\"), p("?"), p("#")]); - -function startsWithWindowsDriveLetter(input, pointer) { - const length = input.length - pointer; - return length >= 2 && - isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && - (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); -} - -URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; - this.url.host = ""; - - if (c === p("/") || c === p("\\")) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (!isNaN(c)) { - this.url.query = null; - if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { - shortenPath(this.url); - } else { - this.parseError = true; - this.url.path = []; - } - - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === p("/") || c === p("\\")) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (!startsWithWindowsDriveLetter(this.input, this.pointer) && - isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } - this.url.host = this.base.host; - } - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { - if (isNaN(c) || c === p("/") || c === p("\\") || c === p("?") || c === p("#")) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isNotSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - - if (this.stateOverride) { - return false; - } - - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "path"; - - if (c !== p("/") && c !== p("\\")) { - --this.pointer; - } - } else if (!this.stateOverride && c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== undefined) { - this.state = "path"; - if (c !== p("/")) { - --this.pointer; - } - } else if (this.stateOverride && this.url.host === null) { - this.url.path.push(""); - } - - return true; -}; - -URLStateMachine.prototype["parse path"] = function parsePath(c) { - if (isNaN(c) || c === p("/") || (isSpecial(this.url) && c === p("\\")) || - (!this.stateOverride && (c === p("?") || c === p("#")))) { - if (isSpecial(this.url) && c === p("\\")) { - this.parseError = true; - } - - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c !== p("/") && - !(isSpecial(this.url) && c === p("\\"))) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - this.buffer = `${this.buffer[0]}:`; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } - if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += utf8PercentEncodeCodePoint(c, isPathPercentEncode); - } - - return true; -}; - -URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) { - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c === p(" ")) { - const remaining = this.input[this.pointer + 1]; - if (remaining === p("?") || remaining === p("#")) { - this.url.path += "%20"; - } else { - this.url.path += " "; - } - } else { - // TODO: Add: not a URL code point - if (!isNaN(c) && c !== p("%")) { - this.parseError = true; - } - - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - if (!isNaN(c)) { - this.url.path += utf8PercentEncodeCodePoint(c, isC0ControlPercentEncode); - } - } - - return true; -}; - -URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - - if ((!this.stateOverride && c === p("#")) || isNaN(c)) { - const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode; - this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate); - - this.buffer = ""; - - if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else if (!isNaN(c)) { - // TODO: If c is not a URL code point and not "%", parse error. - - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (!isNaN(c)) { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode); - } - - return true; -}; - -function serializeURL(url, excludeFragment) { - let output = `${url.scheme}:`; - if (url.host !== null) { - output += "//"; - - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += `:${url.password}`; - } - output += "@"; - } - - output += serializeHost(url.host); - - if (url.port !== null) { - output += `:${url.port}`; - } - } - - if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") { - output += "/."; - } - output += serializePath(url); - - if (url.query !== null) { - output += `?${url.query}`; - } - - if (!excludeFragment && url.fragment !== null) { - output += `#${url.fragment}`; - } - - return output; -} - -function serializeOrigin(tuple) { - let result = `${tuple.scheme}://`; - result += serializeHost(tuple.host); - - if (tuple.port !== null) { - result += `:${tuple.port}`; - } - - return result; -} - -function serializePath(url) { - if (hasAnOpaquePath(url)) { - return url.path; - } - - let output = ""; - for (const segment of url.path) { - output += `/${segment}`; - } - return output; -} - -module.exports.serializeURL = serializeURL; - -module.exports.serializePath = serializePath; - -module.exports.serializeURLOrigin = function (url) { - // https://url.spec.whatwg.org/#concept-url-origin - switch (url.scheme) { - case "blob": { - const pathURL = module.exports.parseURL(serializePath(url)); - if (pathURL === null) { - return "null"; - } - if (pathURL.scheme !== "http" && pathURL.scheme !== "https") { - return "null"; - } - return module.exports.serializeURLOrigin(pathURL); - } - case "ftp": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port - }); - case "file": - // The spec says: - // > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin. - // Browsers tested so far: - // - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g. - // https://bugs.chromium.org/p/chromium/issues/detail?id=37586 - // - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see - // https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs - return "null"; - default: - // serializing an opaque origin returns "null" - return "null"; - } -}; - -module.exports.basicURLParse = function (input, options) { - if (options === undefined) { - options = {}; - } - - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return null; - } - - return usm.url; -}; - -module.exports.setTheUsername = function (url, username) { - url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode); -}; - -module.exports.setThePassword = function (url, password) { - url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode); -}; - -module.exports.serializeHost = serializeHost; - -module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - -module.exports.hasAnOpaquePath = hasAnOpaquePath; - -module.exports.serializeInteger = function (integer) { - return String(integer); -}; - -module.exports.parseURL = function (input, options) { - if (options === undefined) { - options = {}; - } - - // We don't handle blobs, so this just delegates: - return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/urlencoded.js": -/*!***************************************************!*\ - !*** ./node_modules/whatwg-url/lib/urlencoded.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const { utf8Encode, utf8DecodeWithoutBOM } = __webpack_require__(/*! ./encoding */ "./node_modules/whatwg-url/lib/encoding.js"); -const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = __webpack_require__(/*! ./percent-encoding */ "./node_modules/whatwg-url/lib/percent-encoding.js"); - -function p(char) { - return char.codePointAt(0); -} - -// https://url.spec.whatwg.org/#concept-urlencoded-parser -function parseUrlencoded(input) { - const sequences = strictlySplitByteSequence(input, p("&")); - const output = []; - for (const bytes of sequences) { - if (bytes.length === 0) { - continue; - } - - let name, value; - const indexOfEqual = bytes.indexOf(p("=")); - - if (indexOfEqual >= 0) { - name = bytes.slice(0, indexOfEqual); - value = bytes.slice(indexOfEqual + 1); - } else { - name = bytes; - value = new Uint8Array(0); - } - - name = replaceByteInByteSequence(name, 0x2B, 0x20); - value = replaceByteInByteSequence(value, 0x2B, 0x20); - - const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name)); - const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value)); - - output.push([nameString, valueString]); - } - return output; -} - -// https://url.spec.whatwg.org/#concept-urlencoded-string-parser -function parseUrlencodedString(input) { - return parseUrlencoded(utf8Encode(input)); -} - -// https://url.spec.whatwg.org/#concept-urlencoded-serializer -function serializeUrlencoded(tuples) { - // TODO: accept and use encoding argument - - let output = ""; - for (const [i, tuple] of tuples.entries()) { - const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true); - const value = utf8PercentEncodeString(tuple[1], isURLEncodedPercentEncode, true); - - if (i !== 0) { - output += "&"; - } - output += `${name}=${value}`; - } - return output; -} - -function strictlySplitByteSequence(buf, cp) { - const list = []; - let last = 0; - let i = buf.indexOf(cp); - while (i >= 0) { - list.push(buf.slice(last, i)); - last = i + 1; - i = buf.indexOf(cp, last); - } - if (last !== buf.length) { - list.push(buf.slice(last)); - } - return list; -} - -function replaceByteInByteSequence(buf, from, to) { - let i = buf.indexOf(from); - while (i >= 0) { - buf[i] = to; - i = buf.indexOf(from, i + 1); - } - return buf; -} - -module.exports = { - parseUrlencodedString, - serializeUrlencoded -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/utils.js": -/*!**********************************************!*\ - !*** ./node_modules/whatwg-url/lib/utils.js ***! - \**********************************************/ -/***/ ((module, exports) => { - -"use strict"; - - -// Returns "Type(value) is Object" in ES terminology. -function isObject(value) { - return (typeof value === "object" && value !== null) || typeof value === "function"; -} - -const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); - -// Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]` -// instead of `[[Get]]` and `[[Set]]` and only allowing objects -function define(target, source) { - for (const key of Reflect.ownKeys(source)) { - const descriptor = Reflect.getOwnPropertyDescriptor(source, key); - if (descriptor && !Reflect.defineProperty(target, key, descriptor)) { - throw new TypeError(`Cannot redefine property: ${String(key)}`); - } - } -} - -function newObjectInRealm(globalObject, object) { - const ctorRegistry = initCtorRegistry(globalObject); - return Object.defineProperties( - Object.create(ctorRegistry["%Object.prototype%"]), - Object.getOwnPropertyDescriptors(object) - ); -} - -const wrapperSymbol = Symbol("wrapper"); -const implSymbol = Symbol("impl"); -const sameObjectCaches = Symbol("SameObject caches"); -const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); - -const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype); - -function initCtorRegistry(globalObject) { - if (hasOwn(globalObject, ctorRegistrySymbol)) { - return globalObject[ctorRegistrySymbol]; - } - - const ctorRegistry = Object.create(null); - - // In addition to registering all the WebIDL2JS-generated types in the constructor registry, - // we also register a few intrinsics that we make use of in generated code, since they are not - // easy to grab from the globalObject variable. - ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype; - ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf( - Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()) - ); - - try { - ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf( - Object.getPrototypeOf( - globalObject.eval("(async function* () {})").prototype - ) - ); - } catch { - ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype; - } - - globalObject[ctorRegistrySymbol] = ctorRegistry; - return ctorRegistry; -} - -function getSameObject(wrapper, prop, creator) { - if (!wrapper[sameObjectCaches]) { - wrapper[sameObjectCaches] = Object.create(null); - } - - if (prop in wrapper[sameObjectCaches]) { - return wrapper[sameObjectCaches][prop]; - } - - wrapper[sameObjectCaches][prop] = creator(); - return wrapper[sameObjectCaches][prop]; -} - -function wrapperForImpl(impl) { - return impl ? impl[wrapperSymbol] : null; -} - -function implForWrapper(wrapper) { - return wrapper ? wrapper[implSymbol] : null; -} - -function tryWrapperForImpl(impl) { - const wrapper = wrapperForImpl(impl); - return wrapper ? wrapper : impl; -} - -function tryImplForWrapper(wrapper) { - const impl = implForWrapper(wrapper); - return impl ? impl : wrapper; -} - -const iterInternalSymbol = Symbol("internal"); - -function isArrayIndexPropName(P) { - if (typeof P !== "string") { - return false; - } - const i = P >>> 0; - if (i === 2 ** 32 - 1) { - return false; - } - const s = `${i}`; - if (P !== s) { - return false; - } - return true; -} - -const byteLengthGetter = - Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; -function isArrayBuffer(value) { - try { - byteLengthGetter.call(value); - return true; - } catch (e) { - return false; - } -} - -function iteratorResult([key, value], kind) { - let result; - switch (kind) { - case "key": - result = key; - break; - case "value": - result = value; - break; - case "key+value": - result = [key, value]; - break; - } - return { value: result, done: false }; -} - -const supportsPropertyIndex = Symbol("supports property index"); -const supportedPropertyIndices = Symbol("supported property indices"); -const supportsPropertyName = Symbol("supports property name"); -const supportedPropertyNames = Symbol("supported property names"); -const indexedGet = Symbol("indexed property get"); -const indexedSetNew = Symbol("indexed property set new"); -const indexedSetExisting = Symbol("indexed property set existing"); -const namedGet = Symbol("named property get"); -const namedSetNew = Symbol("named property set new"); -const namedSetExisting = Symbol("named property set existing"); -const namedDelete = Symbol("named property delete"); - -const asyncIteratorNext = Symbol("async iterator get the next iteration result"); -const asyncIteratorReturn = Symbol("async iterator return steps"); -const asyncIteratorInit = Symbol("async iterator initialization steps"); -const asyncIteratorEOI = Symbol("async iterator end of iteration"); - -module.exports = exports = { - isObject, - hasOwn, - define, - newObjectInRealm, - wrapperSymbol, - implSymbol, - getSameObject, - ctorRegistrySymbol, - initCtorRegistry, - wrapperForImpl, - implForWrapper, - tryWrapperForImpl, - tryImplForWrapper, - iterInternalSymbol, - isArrayBuffer, - isArrayIndexPropName, - supportsPropertyIndex, - supportedPropertyIndices, - supportsPropertyName, - supportedPropertyNames, - indexedGet, - indexedSetNew, - indexedSetExisting, - namedGet, - namedSetNew, - namedSetExisting, - namedDelete, - asyncIteratorNext, - asyncIteratorReturn, - asyncIteratorInit, - asyncIteratorEOI, - iteratorResult -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/webidl2js-wrapper.js": -/*!******************************************************!*\ - !*** ./node_modules/whatwg-url/webidl2js-wrapper.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const URL = __webpack_require__(/*! ./lib/URL */ "./node_modules/whatwg-url/lib/URL.js"); -const URLSearchParams = __webpack_require__(/*! ./lib/URLSearchParams */ "./node_modules/whatwg-url/lib/URLSearchParams.js"); - -exports.URL = URL; -exports.URLSearchParams = URLSearchParams; - - -/***/ }), - -/***/ "?03fb": -/*!********************!*\ - !*** fs (ignored) ***! - \********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?3465": -/*!**********************!*\ - !*** path (ignored) ***! - \**********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?5580": -/*!**************************************!*\ - !*** ./terminal-highlight (ignored) ***! - \**************************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?6197": -/*!**********************!*\ - !*** path (ignored) ***! - \**********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?b8cb": -/*!*******************************!*\ - !*** source-map-js (ignored) ***! - \*******************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. -(() => { -"use strict"; -/*!*************************!*\ - !*** ./src/postcss.mjs ***! - \*************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ runTest: () => (/* binding */ runTest) -/* harmony export */ }); -/* harmony import */ var postcss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! postcss */ "./node_modules/postcss/lib/postcss.mjs"); -/* harmony import */ var postcss_nested__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! postcss-nested */ "./node_modules/postcss-nested/index.js"); -/* harmony import */ var autoprefixer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! autoprefixer */ "./node_modules/autoprefixer/lib/autoprefixer.js"); -// Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - - - -const nestedRules = ` -.phone { - &_title { - width: 500px; - @media (max-width: 500px) { - width: auto; - } - body.is_dark & { - color: white; - } - } - img { - display: block; - } -}`; - -const payloads = [ - { - name: "bootstrap-5.3.7.css", - options: { from: `third_party/bootstrap-5.3.7.css`, map: false }, - }, - { - name: "foundation-6.9.0.css", - options: { from: `third_party/foundation-6.9.0.css`, map: false }, - }, - { - name: "angular-material-20.1.6.css", - options: { from: `third_party/angular-material-20.1.6.css`, map: false }, - }, -]; - -function runTest(fileData) { - const cleaner = (0,postcss__WEBPACK_IMPORTED_MODULE_0__["default"])([ - autoprefixer__WEBPACK_IMPORTED_MODULE_2__({ add: false, overrideBrowserslist: [] }), - ]); - const processor = (0,postcss__WEBPACK_IMPORTED_MODULE_0__["default"])([autoprefixer__WEBPACK_IMPORTED_MODULE_2__, postcss_nested__WEBPACK_IMPORTED_MODULE_1__]); - - const testData = payloads.map(({ name, options }) => { - // Clean prefixes. - const source = fileData[name]; - // Add some nested rules. - const css = cleaner.process(source).css + nestedRules; - - return { - payload: css, - options, - }; - }); - - return testData.map( - ({ payload, options }) => processor.process(payload, options).css - ); -} - -})(); - -self.WTBenchmark = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/web-tooling-benchmark/dist/postcss.bundle.min.js b/web-tooling-benchmark/dist/postcss.bundle.min.js new file mode 100644 index 00000000..1dc4561d --- /dev/null +++ b/web-tooling-benchmark/dist/postcss.bundle.min.js @@ -0,0 +1 @@ +(()=>{var e={197:()=>{},1933:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P",164:"Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v",2049:"w"},C:{1:"0 w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U wC xC",66:"V W",2305:"Y Z a b c d e f g h i j k l m n o p q r s t u v",2820:"X"},D:{1:"0 x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 J UB K D E F A B C L M G N O P VB",164:"2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v",2049:"w"},E:{1:"NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC zC",132:"A B C L XC JC KC 3C",164:"K D E F 0C 1C 2C",1540:"M G 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C"},F:{1:"0 j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",164:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h",2049:"i"},G:{1:"NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",132:"MD ND OD PD QD RD SD TD UD VD",164:"E HD ID JD KD LD",1540:"WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC",164:"hD iD"},J:{2:"D",164:"A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{164:"LC"},P:{1:"4 5 6 7 8 9",164:"1 2 3 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{164:"uD"},R:{164:"vD"},S:{2:"wD xD"}},B:5,C:"CSS image-set",D:!0}},2327:(e,t,B)=>{let u=B(57441);class r extends u{check(e){return!e.value.includes("flex-")&&"baseline"!==e.value}normalize(){return"align-self"}prefixed(e,t){return t+"grid-row-align"}}r.names=["grid-row-align"],e.exports=r},2637:e=>{e.exports={1:"ls",2:"rec",3:"pr",4:"cr",5:"wd",6:"other",7:"unoff"}},2890:e=>{e.exports={A:{D:{1:"SB TB I TC IC UC VC",2:"J UB K D E F A B C L M G N",33:"0 1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},L:{1:"I"},B:{1:"SB TB I",2:"C L M G N O P",33:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},C:{1:"0 g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB wC xC",33:"pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{2:"F B C AD BD CD DD JC qC ED KC",33:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},K:{2:"A B C JC qC KC",33:"H"},E:{1:"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB yC WC zC 9C",33:"K D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC"},G:{1:"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",33:"E HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},P:{33:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{1:"I",2:"PC J dD eD fD gD rC",33:"hD iD"}},B:6,C:"print-color-adjust property",D:void 0}},3181:(e,t,B)=>{"use strict";const u=B(76648),r=B(52682);t.URL=u,t.URLSearchParams=r},3276:(e,t,B)=>{let u=B(57441);class r extends u{set(e,t){return e.value=e.value.replace(/\s+fill(\s)/,"$1"),super.set(e,t)}}r.names=["border-image"],e.exports=r},3402:(e,t,B)=>{let u=B(57441),r=B(59902);class s extends u{insert(e,t,B,u){if("-ms-"!==t)return super.insert(e,t,B);let s=r.parse(e),[n,C]=r.translate(s,0,2),[i,o]=r.translate(s,1,3);[["grid-row",n],["grid-row-span",C],["grid-column",i],["grid-column-span",o]].forEach(([t,B])=>{r.insertDecl(e,t,B)}),r.warnTemplateSelectorNotFound(e,u),r.warnIfGridRowColumnExists(e,u)}}s.names=["grid-area"],e.exports=s},3426:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{set(e,t){if(2009!==r(t)[0])return super.set(e,t)}}s.names=["flex-wrap"],e.exports=s},3751:(e,t,B)=>{let u=B(57441);class r extends u{normalize(e){return e.includes("-before")?e.replace("-before","-block-start"):e.replace("-after","-block-end")}prefixed(e,t){return e.includes("-start")?t+e.replace("-block-start","-before"):t+e.replace("-block-end","-after")}}r.names=["border-block-start","border-block-end","margin-block-start","margin-block-end","padding-block-start","padding-block-end","border-before","border-after","margin-before","margin-after","padding-before","padding-after"],e.exports=r},5040:(e,t,B)=>{e.exports.browserVersions=B(56438)},5180:(e,t,B)=>{let u=B(40624),r=B(76134),s=B(87880),n=B(77187);e.exports=class extends r{static save(e,t){let B=t.prop,u=[];for(let r in t._autoprefixerValues){let s,C=t._autoprefixerValues[r];if(C===t.value)continue;let i=n.prefix(B);if("-pie-"===i)continue;if(i===r){s=t.value=C,u.push(s);continue}let o=e.prefixed(B,r),a=t.parent;if(!a.every(e=>e.prop!==o)){u.push(s);continue}let l=C.replace(/\s+/," ");if(a.some(e=>e.prop===t.prop&&e.value.replace(/\s+/," ")===l)){u.push(s);continue}let D=this.clone(t,{value:C});s=t.parent.insertBefore(t,D),u.push(s)}return u}add(e,t){e._autoprefixerValues||(e._autoprefixerValues={});let B,u=e._autoprefixerValues[t]||this.value(e);do{if(B=u,u=this.replace(u,t),!1===u)return}while(u!==B);e._autoprefixerValues[t]=u}check(e){let t=e.value;return!!t.includes(this.name)&&!!t.match(this.regexp())}old(e){return new u(this.name,e+this.name)}regexp(){return this.regexpCache||(this.regexpCache=s.regexp(this.name))}replace(e,t){return e.replace(this.regexp(),`$1${t}$2`)}value(e){return e.raws.value&&e.raws.value.value===e.value?e.raws.value.raw:e.value}}},6156:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},6319:e=>{var t=/^\s+and\s+(.*)/i,B=/^(?:,\s*|\s+or\s+)(.*)/i;function u(e){return Array.isArray(e)?e.reduce(function(e,t){return e.concat(u(t))},[]):[e]}function r(e,t){var B={query:t};for(var u in 0===t.indexOf("not ")&&(B.not=!0,t=t.slice(4)),e){var r=e[u],s=t.match(r.regexp);if(s){B.type=u;for(var n=0;n{let u=B(57441),r=B(59902);class s extends u{insert(e,t,B){if("-ms-"!==t)return super.insert(e,t,B);if(e.parent.some(e=>"-ms-grid-row-align"===e.prop))return;let[[u,s]]=r.parse(e);s?(r.insertDecl(e,"grid-row-align",u),r.insertDecl(e,"grid-column-align",s)):(r.insertDecl(e,"grid-row-align",u),r.insertDecl(e,"grid-column-align",u))}}s.names=["place-self"],e.exports=s},7316:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{2:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{2:"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{2:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{1:"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D E yC WC zC 0C 1C",33:"F"},F:{2:"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{1:"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD",33:"KD LD"},H:{2:"cD"},I:{2:"PC J I dD eD fD gD rC hD iD"},J:{2:"D A"},K:{2:"A B C H JC qC KC"},L:{2:"I"},M:{2:"IC"},N:{2:"A B"},O:{2:"LC"},P:{2:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{2:"uD"},R:{2:"vD"},S:{2:"wD xD"}},B:5,C:"CSS filter() function",D:!0}},8594:(e,t,B)=>{let u=B(57441);class r extends u{set(e,t){return"-webkit-"===t&&(e.value=e.value.replace(/\s*(right|left)\s*/i,"")),super.set(e,t)}}r.names=["text-emphasis-position"],e.exports=r},9544:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M"},C:{1:"0 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",33:"1 2 3 4 5 6 7 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{1:"0 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B"},E:{1:"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"J UB K D E F A yC WC zC 0C 1C 2C XC"},F:{1:"0 C wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ED KC",2:"F B AD BD CD DD JC qC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},G:{2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{33:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{2:"IC"},N:{2:"A B"},O:{1:"LC"},P:{2:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{2:"wD xD"}},B:2,C:"CSS grab & grabbing cursors",D:!0}},9981:(e,t,B)=>{var u=B(65606);let r=B(25482),s=B(5180),n=B(59902).insertAreas;const C=/(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i,i=/(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i,o=/(!\s*)?autoprefixer:\s*ignore\s+next/i,a=/(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i,l=["width","height","min-width","max-width","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size"];function D(e){return e.parent.some(e=>"grid-template"===e.prop||"grid-template-areas"===e.prop)}e.exports=class{constructor(e){this.prefixes=e}add(e,t){let B=this.prefixes.add["@resolution"],u=this.prefixes.add["@keyframes"],o=this.prefixes.add["@viewport"],a=this.prefixes.add["@supports"];function c(e){return e.parent.nodes.some(e=>{if("decl"!==e.type)return!1;let t="display"===e.prop&&/(inline-)?grid/.test(e.value),B=e.prop.startsWith("grid-template"),u=/^grid-([A-z]+-)?gap/.test(e.prop);return t||B||u})}e.walkAtRules(e=>{if("keyframes"===e.name){if(!this.disabled(e,t))return u&&u.process(e)}else if("viewport"===e.name){if(!this.disabled(e,t))return o&&o.process(e)}else if("supports"===e.name){if(!1!==this.prefixes.options.supports&&!this.disabled(e,t))return a.process(e)}else if("media"===e.name&&e.params.includes("-resolution")&&!this.disabled(e,t))return B&&B.process(e)}),e.walkRules(e=>{if(!this.disabled(e,t))return this.prefixes.add.selectors.map(B=>B.process(e,t))});let p=this.gridStatus(e,t)&&this.prefixes.add["grid-area"]&&this.prefixes.add["grid-area"].prefixes;return e.walkDecls(e=>{if(this.disabledDecl(e,t))return;let B,u=e.parent,s=e.prop,n=e.value;if("color-adjust"===s)u.every(e=>"print-color-adjust"!==e.prop)&&t.warn("Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.",{node:e});else{if("grid-row-span"===s)return void t.warn("grid-row-span is not part of final Grid Layout. Use grid-row.",{node:e});if("grid-column-span"===s)return void t.warn("grid-column-span is not part of final Grid Layout. Use grid-column.",{node:e});if("display"===s&&"box"===n)return void t.warn("You should write display: flex by final spec instead of display: box",{node:e});if("text-emphasis-position"===s)"under"!==n&&"over"!==n||t.warn("You should use 2 values for text-emphasis-position For example, `under left` instead of just `under`.",{node:e});else if("text-decoration-skip"===s&&"ink"===n)t.warn("Replace text-decoration-skip: ink to text-decoration-skip-ink: auto, because spec had been changed",{node:e});else{if(p&&this.gridStatus(e,t))if("subgrid"===e.value&&t.warn("IE does not support subgrid",{node:e}),/^(align|justify|place)-items$/.test(s)&&c(e)){let B=s.replace("-items","-self");t.warn(`IE does not support ${s} on grid containers. Try using ${B} on child elements instead: ${e.parent.selector} > * { ${B}: ${e.value} }`,{node:e})}else if(/^(align|justify|place)-content$/.test(s)&&c(e))t.warn(`IE does not support ${e.prop} on grid containers`,{node:e});else{if("display"===s&&"contents"===e.value)return void t.warn("Please do not use display: contents; if you have grid setting enabled",{node:e});if("grid-gap"===e.prop){let B=this.gridStatus(e,t);"autoplace"!==B||function(e){let t=e.parent.some(e=>"grid-template-rows"===e.prop),B=e.parent.some(e=>"grid-template-columns"===e.prop);return t&&B}(e)||D(e)?!0!==B&&"no-autoplace"!==B||D(e)||t.warn("grid-gap only works if grid-template(-areas) is being used",{node:e}):t.warn("grid-gap only works if grid-template(-areas) is being used or both rows and columns have been declared and cells have not been manually placed inside the explicit grid",{node:e})}else{if("grid-auto-columns"===s)return void t.warn("grid-auto-columns is not supported by IE",{node:e});if("grid-auto-rows"===s)return void t.warn("grid-auto-rows is not supported by IE",{node:e});if("grid-auto-flow"===s){let B=u.some(e=>"grid-template-rows"===e.prop),r=u.some(e=>"grid-template-columns"===e.prop);return void(D(e)?t.warn("grid-auto-flow is not supported by IE",{node:e}):n.includes("dense")?t.warn("grid-auto-flow: dense is not supported by IE",{node:e}):B||r||t.warn("grid-auto-flow works only if grid-template-rows and grid-template-columns are present in the same rule",{node:e}))}if(n.includes("auto-fit"))return void t.warn("auto-fit value is not supported by IE",{node:e,word:"auto-fit"});if(n.includes("auto-fill"))return void t.warn("auto-fill value is not supported by IE",{node:e,word:"auto-fill"});s.startsWith("grid-template")&&n.includes("[")&&t.warn("Autoprefixer currently does not support line names. Try using grid-template-areas instead.",{node:e,word:"["})}}if(n.includes("radial-gradient"))if(i.test(e.value))t.warn("Gradient has outdated direction syntax. New syntax is like `closest-side at 0 0` instead of `0 0, closest-side`.",{node:e});else{let B=r(n);for(let u of B.nodes)if("function"===u.type&&"radial-gradient"===u.value)for(let B of u.nodes)"word"===B.type&&("cover"===B.value?t.warn("Gradient has outdated direction syntax. Replace `cover` to `farthest-corner`.",{node:e}):"contain"===B.value&&t.warn("Gradient has outdated direction syntax. Replace `contain` to `closest-side`.",{node:e}))}n.includes("linear-gradient")&&C.test(n)&&t.warn("Gradient has outdated direction syntax. New syntax is like `to left` instead of `right`.",{node:e})}}if(l.includes(e.prop)&&!e.value.includes("-fill-available"))if(e.value.includes("fill-available"))t.warn("Replace fill-available to stretch, because spec had been changed",{node:e});else if(e.value.includes("fill")){r(n).nodes.some(e=>"word"===e.type&&"fill"===e.value)&&t.warn("Replace fill to stretch, because spec had been changed",{node:e})}if("transition"===e.prop||"transition-property"===e.prop)return this.prefixes.transition.add(e,t);if("align-self"===e.prop){if("grid"!==this.displayType(e)&&!1!==this.prefixes.options.flexbox&&(B=this.prefixes.add["align-self"],B&&B.prefixes&&B.process(e)),!1!==this.gridStatus(e,t)&&(B=this.prefixes.add["grid-row-align"],B&&B.prefixes))return B.process(e,t)}else if("justify-self"===e.prop){if(!1!==this.gridStatus(e,t)&&(B=this.prefixes.add["grid-column-align"],B&&B.prefixes))return B.process(e,t)}else if("place-self"===e.prop){if(B=this.prefixes.add["place-self"],B&&B.prefixes&&!1!==this.gridStatus(e,t))return B.process(e,t)}else if(B=this.prefixes.add[e.prop],B&&B.prefixes)return B.process(e,t)}),this.gridStatus(e,t)&&n(e,this.disabled),e.walkDecls(e=>{if(this.disabledValue(e,t))return;let B=this.prefixes.unprefixed(e.prop),u=this.prefixes.values("add",B);if(Array.isArray(u))for(let B of u)B.process&&B.process(e,t);s.save(this.prefixes,e)})}disabled(e,t){if(!e)return!1;if(void 0!==e._autoprefixerDisabled)return e._autoprefixerDisabled;if(e.parent){let t=e.prev();if(t&&"comment"===t.type&&o.test(t.text))return e._autoprefixerDisabled=!0,e._autoprefixerSelfDisabled=!0,!0}let B=null;if(e.nodes){let u;e.each(e=>{"comment"===e.type&&/(!\s*)?autoprefixer:\s*(off|on)/i.test(e.text)&&(void 0!==u?t.warn("Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules.",{node:e}):u=/on/i.test(e.text))}),void 0!==u&&(B=!u)}if(!e.nodes||null===B)if(e.parent){let u=this.disabled(e.parent,t);B=!0!==e.parent._autoprefixerSelfDisabled&&u}else B=!1;return e._autoprefixerDisabled=B,B}disabledDecl(e,t){if("decl"===e.type&&!1===this.gridStatus(e,t)&&(e.prop.includes("grid")||"justify-items"===e.prop))return!0;if("decl"===e.type&&!1===this.prefixes.options.flexbox){let t=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||t.includes(e.prop))return!0}return this.disabled(e,t)}disabledValue(e,t){return!(!1!==this.gridStatus(e,t)||"decl"!==e.type||"display"!==e.prop||!e.value.includes("grid"))||(!(!1!==this.prefixes.options.flexbox||"decl"!==e.type||"display"!==e.prop||!e.value.includes("flex"))||("decl"===e.type&&"content"===e.prop||this.disabled(e,t)))}displayType(e){for(let t of e.parent.nodes)if("display"===t.prop){if(t.value.includes("flex"))return"flex";if(t.value.includes("grid"))return"grid"}return!1}gridStatus(e,t){if(!e)return!1;if(void 0!==e._autoprefixerGridStatus)return e._autoprefixerGridStatus;let B=null;if(e.nodes){let u;e.each(e=>{if("comment"===e.type&&a.test(e.text)){let B=/:\s*autoplace/i.test(e.text),r=/no-autoplace/i.test(e.text);void 0!==u?t.warn("Second Autoprefixer grid control comment was ignored. Autoprefixer applies control comments to the whole block, not to the next rules.",{node:e}):u=B?"autoplace":!!r||/on/i.test(e.text)}}),void 0!==u&&(B=u)}if("atrule"===e.type&&"supports"===e.name){let t=e.params;t.includes("grid")&&t.includes("auto")&&(B=!1)}if(!e.nodes||null===B)if(e.parent){let u=this.gridStatus(e.parent,t);B=!0!==e.parent._autoprefixerSelfDisabled&&u}else B=void 0!==this.prefixes.options.grid?this.prefixes.options.grid:void 0!==u.env.AUTOPREFIXER_GRID&&("autoplace"!==u.env.AUTOPREFIXER_GRID||"autoplace");return e._autoprefixerGridStatus=B,B}reduceSpaces(e){let t=!1;if(this.prefixes.group(e).up(()=>(t=!0,!0)),t)return;let B=e.raw("before").split("\n"),u=B[B.length-1].length,r=!1;this.prefixes.group(e).down(e=>{B=e.raw("before").split("\n");let t=B.length-1;B[t].length>u&&(!1===r&&(r=B[t].length-u),B[t]=B[t].slice(0,-r),e.raws.before=B.join("\n"))})}remove(e,t){let B=this.prefixes.remove["@resolution"];return e.walkAtRules((e,u)=>{this.prefixes.remove[`@${e.name}`]?this.disabled(e,t)||e.parent.removeChild(u):"media"===e.name&&e.params.includes("-resolution")&&B&&B.clean(e)}),e.walkRules((e,B)=>{if(!this.disabled(e,t))for(let t of this.prefixes.remove.selectors)if(t.check(e))return void e.parent.removeChild(B)}),e.walkDecls((e,B)=>{if(this.disabled(e,t))return;let u=e.parent,r=this.prefixes.unprefixed(e.prop);if("transition"!==e.prop&&"transition-property"!==e.prop||this.prefixes.transition.remove(e),this.prefixes.remove[e.prop]&&this.prefixes.remove[e.prop].remove){let t=this.prefixes.group(e).down(e=>this.prefixes.normalize(e.prop)===r);if("flex-flow"===r&&(t=!0),"-webkit-box-orient"===e.prop){let t={"flex-direction":!0,"flex-flow":!0};if(!e.parent.some(e=>t[e.prop]))return}if(t&&!this.withHackValue(e))return e.raw("before").includes("\n")&&this.reduceSpaces(e),void u.removeChild(B)}for(let t of this.prefixes.values("remove",r)){if(!t.check)continue;if(!t.check(e.value))continue;if(r=t.unprefixed,this.prefixes.group(e).down(e=>e.value.includes(r)))return void u.removeChild(B)}})}withHackValue(e){return"-webkit-background-clip"===e.prop&&"text"===e.value||"-webkit-box-orient"===e.prop&&e.parent.some(e=>"-webkit-line-clamp"===e.prop)}}},11414:e=>{e.exports={A:{A:{2:"K D E F sC",6308:"A",6436:"B"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",6436:"C L M G N O P"},C:{1:"0 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB wC xC",2052:"gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B"},D:{1:"0 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B",8258:"5B 6B 7B"},E:{1:"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D E yC WC zC 0C 1C",3108:"F A 2C XC"},F:{1:"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB AD BD CD DD JC qC ED KC",8258:"vB wB xB yB zB 0B 1B 2B"},G:{1:"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD",3108:"KD LD MD ND"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 XC oD pD qD rD sD MC NC OC tD",2:"J jD kD lD mD nD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",2052:"wD"}},B:4,C:"CSS Scroll Snap",D:!0}},11432:(e,t,B)=>{let u=B(57441),r=B(9981),{autoplaceGridItems:s,getGridGap:n,inheritGridGap:C,prefixTrackProp:i,prefixTrackValue:o}=B(59902);class a extends u{insert(e,t,B,u){if("-ms-"!==t)return super.insert(e,t,B);let{parent:a,prop:l,value:D}=e,c=l.includes("rows"),p=l.includes("columns"),f=a.some(e=>"grid-template"===e.prop||"grid-template-areas"===e.prop);if(f&&c)return!1;let d=new r({options:{}}),h=d.gridStatus(a,u),A=n(e);A=C(e,A)||A;let m=c?A.row:A.column;"no-autoplace"!==h&&!0!==h||f||(m=null);let E=o({gap:m,value:D});e.cloneBefore({prop:i({prefix:t,prop:l}),value:E});let F=a.nodes.find(e=>"grid-auto-flow"===e.prop),v="row";if(F&&!d.disabled(F,u)&&(v=F.value.trim()),"autoplace"===h){let t=a.nodes.find(e=>"grid-template-rows"===e.prop);if(!t&&f)return;if(!t&&!f)return void e.warn(u,"Autoplacement does not work without grid-template-rows property");a.nodes.find(e=>"grid-template-columns"===e.prop)||f||e.warn(u,"Autoplacement does not work without grid-template-columns property"),p&&!f&&s(e,u,A,v)}}normalize(e){return e.replace(/^grid-(rows|columns)/,"grid-template-$1")}prefixed(e,t){return"-ms-"===t?i({prefix:t,prop:e}):super.prefixed(e,t)}}a.names=["grid-template-rows","grid-template-columns","grid-rows","grid-columns"],e.exports=a},11581:(e,t)=>{"use strict";t.__esModule=!0,t.UNIVERSAL=t.TAG=t.STRING=t.SELECTOR=t.ROOT=t.PSEUDO=t.NESTING=t.ID=t.COMMENT=t.COMBINATOR=t.CLASS=t.ATTRIBUTE=void 0;t.TAG="tag";t.STRING="string";t.SELECTOR="selector";t.ROOT="root";t.PSEUDO="pseudo";t.NESTING="nesting";t.ID="id";t.COMMENT="comment";t.COMBINATOR="combinator";t.CLASS="class";t.ATTRIBUTE="attribute";t.UNIVERSAL="universal"},12045:e=>{e.exports={A:{A:{2:"K D E F sC",132:"A B"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",132:"C L M G N O",516:"P"},C:{1:"0 QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB wC xC"},D:{1:"0 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B",260:"2B 3B"},E:{1:"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D E F A B C L M yC WC zC 0C 1C 2C XC JC KC 3C",1090:"G 4C 5C YC ZC LC 6C"},F:{1:"0 tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB AD BD CD DD JC qC ED KC",260:"rB sB"},G:{1:"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD",1090:"XD YD YC ZC LC ZD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{132:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 mD nD XC oD pD qD rD sD MC NC OC tD",2:"J jD kD lD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",2:"wD"}},B:5,C:"CSS overscroll-behavior",D:!0}},12492:e=>{e.exports={A:{A:{2:"K D E F sC",33:"A B"},B:{1:"0 o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",33:"C L M G N O P",132:"Q H R S T U V W",260:"X Y Z a b c d e f g h i j k l m n"},C:{1:"0 kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB wC xC",33:"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB"},D:{1:"0 X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB",132:"wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W"},E:{1:"NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC",33:"K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C"},F:{1:"0 a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB AD BD CD DD JC qC ED KC",132:"jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z"},G:{1:"NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD",33:"E rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J",132:"jD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS Hyphenation",D:!0}},12831:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"MB NB OB PB QB RB SB TB I",2:"C L M G N O P",164:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB"},C:{1:"0 ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB wC xC"},D:{1:"MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 J UB K D E F A B C L M G N O P VB",164:"0 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB"},E:{2:"J UB K yC WC zC",164:"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{1:"0 z",2:"F AD BD CD DD",129:"B C JC qC ED KC",164:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y"},G:{2:"WC FD rC GD HD",164:"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{132:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC",164:"hD iD"},J:{2:"D",164:"A"},K:{2:"A",129:"B C JC qC KC",164:"H"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{164:"LC"},P:{164:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{164:"uD"},R:{164:"vD"},S:{1:"wD xD"}},B:4,C:"CSS box-decoration-break",D:!0}},12895:(e,t,B)=>{"use strict";var u=B(65606);let r=B(40396),s=B(49371),n=B(77793),C=B(53614),i=B(35238),o=B(40145),a=B(33438),l=B(61106),D=B(96966),c=B(81752),p=B(63152),f=B(69577),d=B(96846),h=B(33717),A=B(25644),m=B(61534),E=B(83303),F=B(60038);function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}v.plugin=function(e,t){let B,r=!1;function s(...B){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),u.env.LANG&&u.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...B);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(B||(B=s()),B)}),s.process=function(e,t,B){return v([s(B)]).process(e,t)},s},v.stringify=E,v.parse=f,v.fromJSON=a,v.list=c,v.comment=e=>new s(e),v.atRule=e=>new r(e),v.decl=e=>new i(e),v.rule=e=>new m(e),v.root=e=>new A(e),v.document=e=>new o(e),v.CssSyntaxError=C,v.Declaration=i,v.Container=n,v.Processor=d,v.Document=o,v.Comment=s,v.Warning=F,v.AtRule=r,v.Result=h,v.Input=l,v.Rule=m,v.Root=A,v.Node=p,D.registerPostcss(v),e.exports=v,v.default=v},13295:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u=s(B(68937)),r=B(39606);function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){for(var B=0;B{"use strict";let{dirname:u,relative:r,resolve:s,sep:n}=B(197),{SourceMapConsumer:C,SourceMapGenerator:i}=B(21866),{pathToFileURL:o}=B(75833),a=B(61106),l=Boolean(C&&i),D=Boolean(u&&s&&r&&n);e.exports=class{constructor(e,t,B,u){this.stringify=e,this.mapOpts=B.map||{},this.root=t,this.opts=B,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,B=this.toUrl(this.path(e.file)),r=e.root||u(e.file);!1===this.mapOpts.sourcesContent?(t=new C(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,B,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),D&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,B=1,u=1,r="",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(n,C,i)=>{if(this.css+=n,C&&"end"!==i&&(s.generated.line=B,s.generated.column=u-1,C.source&&C.source.start?(s.source=this.sourcePath(C),s.original.line=C.source.start.line,s.original.column=C.source.start.column-1,this.map.addMapping(s)):(s.source=r,s.original.line=1,s.original.column=0,this.map.addMapping(s))),t=n.match(/\n/g),t?(B+=t.length,e=n.lastIndexOf("\n"),u=n.length-e):u+=n.length,C&&"start"!==i){let e=C.parent||{raws:{}};("decl"===C.type||"atrule"===C.type&&!C.nodes)&&C===e.last&&!e.raws.semicolon||(C.source&&C.source.end?(s.source=this.sourcePath(C),s.original.line=C.source.end.line,s.original.column=C.source.end.column-1,s.generated.line=B,s.generated.column=u-2,this.map.addMapping(s)):(s.source=r,s.original.line=1,s.original.column=0,s.generated.line=B,s.generated.column=u-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let B=this.opts.to?u(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(B=u(s(B,this.mapOpts.annotation)));let n=r(B,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let B=t.source.input.from;if(B&&!e[B]){e[B]=!0;let u=this.usesFileUrls?this.toFileUrl(B):this.toUrl(this.path(B));this.map.setSourceContent(u,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===n&&(e=e.replace(/\\/g,"/"));let B=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,B),B}}},14108:(e,t,B)=>{let u=B(57441);class r extends u{check(e){return"pixelated"===e.value}normalize(){return"image-rendering"}prefixed(e,t){return"-ms-"===t?"-ms-interpolation-mode":super.prefixed(e,t)}process(e,t){return super.process(e,t)}set(e,t){return"-ms-"!==t?super.set(e,t):(e.prop="-ms-interpolation-mode",e.value="nearest-neighbor",e)}}r.names=["image-rendering","interpolation-mode"],e.exports=r},15386:(e,t,B)=>{let u=B(25768),r=B(25482),s=B(40624),n=B(87880),C=B(5180),i=/top|left|right|bottom/gi;class o extends C{add(e,t){let B=e.prop;if(B.includes("mask")){if("-webkit-"===t||"-webkit- old"===t)return super.add(e,t)}else{if("list-style"!==B&&"list-style-image"!==B&&"content"!==B)return super.add(e,t);if("-webkit-"===t||"-webkit- old"===t)return super.add(e,t)}}cloneDiv(e){for(let t of e)if("div"===t.type&&","===t.value)return t;return{after:" ",type:"div",value:","}}colorStops(e){let t=[];for(let B=0;B0&&("to"===e[0].value?this.fixDirection(e):e[0].value.includes("deg")?this.fixAngle(e):this.isRadial(e)&&this.fixRadial(e)),e}fixAngle(e){let t=e[0].value;t=parseFloat(t),t=Math.abs(450-t)%360,t=this.roundFloat(t,3),e[0].value=`${t}deg`}fixDirection(e){e.splice(0,2);for(let t of e){if("div"===t.type)break;"word"===t.type&&(t.value=this.revertDirection(t.value))}}fixRadial(e){let t,B,u,r,s,n,C=[],i=[];for(r=0;r" "===e?{type:"space",value:e}:{type:"word",value:e}).concat(e.slice(1))}revertDirection(e){return o.directions[e.toLowerCase()]||e}roundFloat(e,t){return parseFloat(e.toFixed(t))}}o.names=["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient"],o.directions={bottom:"top",left:"right",right:"left",top:"bottom"},o.oldDirections={bottom:"left top, left bottom","bottom left":"right top, left bottom","bottom right":"left top, right bottom",left:"right top, left top","left bottom":"right top, left bottom","left top":"right bottom, left top",right:"left top, right top","right bottom":"left top, right bottom","right top":"left bottom, right top",top:"left bottom, left top","top left":"right bottom, left top","top right":"left bottom, right top"},e.exports=o},15654:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G",260:"N O P"},C:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB wC xC"},D:{1:"0 ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB"},E:{1:"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D yC WC zC 0C",132:"E F 1C 2C"},F:{1:"0 1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F G N O P AD BD CD",33:"B C DD JC qC ED KC"},G:{1:"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD ID",132:"E JD KD LD"},H:{33:"cD"},I:{1:"I iD",2:"PC J dD eD fD gD rC hD"},J:{2:"D A"},K:{1:"H",2:"A",33:"B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS3 object-fit/object-position",D:!0}},15884:(e,t,B)=>{let u=B(57441);class r extends u{insert(e,t,B){return"break-inside"!==e.prop?super.insert(e,t,B):/region/i.test(e.value)||/page/i.test(e.value)?void 0:super.insert(e,t,B)}normalize(e){return e.includes("inside")?"break-inside":e.includes("before")?"break-before":"break-after"}prefixed(e,t){return`${t}column-${e}`}set(e,t){return("break-inside"===e.prop&&"avoid-column"===e.value||"avoid-page"===e.value)&&(e.value="avoid"),super.set(e,t)}}r.names=["break-inside","page-break-inside","column-break-inside","break-before","page-break-before","column-break-before","break-after","page-break-after","column-break-after"],e.exports=r},17324:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(33631))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.PSEUDO,B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u.prototype.toString=function(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")},u}(r.default);t.default=C,e.exports=t.default},18411:()=>{},18445:e=>{"use strict";e.exports.STATUS_MAPPING={mapped:1,valid:2,disallowed:3,deviation:6,ignored:7}},18742:(e,t,B)=>{let u=B(57441),{getGridGap:r,inheritGridGap:s,parseGridAreas:n,prefixTrackProp:C,prefixTrackValue:i,warnGridGap:o,warnMissedAreas:a}=B(59902);class l extends u{insert(e,t,B,u){if("-ms-"!==t)return super.insert(e,t,B);let l=!1,D=!1,c=e.parent,p=r(e);p=s(e,p)||p,c.walkDecls(/-ms-grid-rows/,e=>e.remove()),c.walkDecls(/grid-template-(rows|columns)/,e=>{if("grid-template-rows"===e.prop){D=!0;let{prop:B,value:u}=e;e.cloneBefore({prop:C({prefix:t,prop:B}),value:i({gap:p.row,value:u})})}else l=!0});let f=e.value.trim().slice(1,-1).split(/["']\s*["']?/g);l&&!D&&p.row&&f.length>1&&e.cloneBefore({prop:"-ms-grid-rows",raws:{},value:i({gap:p.row,value:`repeat(${f.length}, auto)`})}),o({decl:e,gap:p,hasColumns:l,result:u});let d=n({gap:p,rows:f});return a(d,e,u),e}}l.names=["grid-template-areas"],e.exports=l},18763:e=>{e.exports={A:{D:{1:"0 t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s"},L:{1:"I"},B:{1:"0 t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P",33:"Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s"},C:{1:"0 V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U wC xC"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"G 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"9C",33:"J UB K D E F A B C L M yC WC zC 0C 1C 2C XC JC KC 3C 4C"},G:{1:"YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD"},P:{1:"2 3 4 5 6 7 8 9",33:"1 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{1:"I",2:"PC J dD eD fD gD rC",33:"hD iD"}},B:6,C:":autofill CSS pseudo-class",D:void 0}},19063:e=>{function t(e,t){var u,r,s=e.type,n=e.value;return t&&void 0!==(r=t(e))?r:"word"===s||"space"===s?n:"string"===s?(u=e.quote||"")+n+(e.unclosed?"":u):"comment"===s?"/*"+n+(e.unclosed?"":"*/"):"div"===s?(e.before||"")+n+(e.after||""):Array.isArray(e.nodes)?(u=B(e.nodes,t),"function"!==s?u:n+"("+(e.before||"")+u+(e.after||"")+(e.unclosed?"":")")):n}function B(e,B){var u,r;if(Array.isArray(e)){for(u="",r=e.length-1;~r;r-=1)u=t(e[r],B)+u;return u}return t(e,B)}e.exports=B},19445:e=>{e.exports={A:{D:{1:"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"J UB K D E F A B C L M G",33:"1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB K D E F wC xC",33:"1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB yC WC zC 9C",33:"K D E F A 0C 1C 2C XC"},G:{1:"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",33:"E HD ID JD KD LD MD ND"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"}},B:6,C:"isolate from unicode-bidi",D:void 0}},19760:e=>{e.exports={A:{A:{2:"K D E sC",132:"F A B"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",1028:"C L M G N O P"},C:{1:"0 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC",260:"J UB K D E F A B C L M G wC xC",1028:"1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC"},D:{1:"0 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",548:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB",1028:"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B"},E:{1:"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"yC WC",548:"J UB K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C"},F:{1:"0 wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F",548:"B C AD BD CD DD JC qC ED",1028:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},G:{1:"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",16:"WC",548:"E FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD"},H:{132:"cD"},I:{1:"I",16:"dD eD",548:"PC J fD gD rC",1028:"hD iD"},J:{548:"D A"},K:{1:"H KC",548:"A B C JC qC"},L:{1:"I"},M:{1:"IC"},N:{132:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 XC oD pD qD rD sD MC NC OC tD",1028:"J jD kD lD mD nD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"Media Queries: resolution feature",D:!0}},19977:()=>{},20248:e=>{e.exports={A:{A:{1:"A B",2:"K D E F sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC",260:"1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB",292:"J UB K D E F A B C L M G xC"},D:{1:"0 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 A B C L M G N O P VB",548:"J UB K D E F"},E:{1:"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"yC WC",260:"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC",292:"K zC",804:"J UB"},F:{1:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F B AD BD CD DD",33:"C ED",164:"JC qC"},G:{1:"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",260:"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC",292:"GD HD",804:"WC FD rC"},H:{2:"cD"},I:{1:"I hD iD",33:"J gD rC",548:"PC dD eD fD"},J:{1:"A",548:"D"},K:{1:"H KC",2:"A B",33:"C",164:"JC qC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS Gradients",D:!0}},20263:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){return e.sort(function(e,t){return e-t})},e.exports=t.default},20375:(e,t,B)=>{let u=B(57441);class r extends u{normalize(e){return r.toNormal[e]||e}prefixed(e,t){return"-moz-"===t?t+(r.toMozilla[e]||e):super.prefixed(e,t)}}r.names=["border-radius"],r.toMozilla={},r.toNormal={};for(let e of["top","bottom"])for(let t of["left","right"]){let B=`border-${e}-${t}-radius`,u=`border-radius-${e}${t}`;r.names.push(B),r.names.push(u),r.toMozilla[B]=u,r.toNormal[u]=B}e.exports=r},21659:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 tC PC J UB K D E F A B C L M G N O P VB wC xC",194:"5 6 7 8 9 WB XB YB ZB aB"},D:{1:"0 aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB",33:"WB XB YB ZB"},E:{1:"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K yC WC zC 0C",33:"D E F 1C"},F:{1:"0 1 2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C G AD BD CD DD JC qC ED KC",33:"N O P VB"},G:{1:"QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD ID",33:"E JD KD LD MD ND OD PD"},H:{2:"cD"},I:{1:"I iD",2:"PC J dD eD fD gD rC",33:"hD"},J:{2:"D",33:"A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS3 font-kerning",D:!0}},21866:()=>{},21993:(e,t,B)=>{var u=B(65606);let r=B(94364),{agents:s}=B(76019),n=B(48633),C=B(78308),i=B(84328),o=B(48729),a=B(43877),l={browsers:s,prefixes:C};const D="\n Replace Autoprefixer `browsers` option to Browserslist config.\n Use `browserslist` key in `package.json` or `.browserslistrc` file.\n\n Using `browsers` option can cause errors. Browserslist config can\n be used for Babel, Autoprefixer, postcss-normalize and other tools.\n\n If you really need to use option, rename it to `overrideBrowserslist`.\n\n Learn more at:\n https://github.com/browserslist/browserslist#readme\n https://twitter.com/browserslist\n\n";let c=new Map;function p(...e){let t;var B;if(1===e.length&&(B=e[0],"[object Object]"===Object.prototype.toString.apply(B))?(t=e[0],e=void 0):0===e.length||1===e.length&&!e[0]?e=void 0:e.length<=2&&(Array.isArray(e[0])||!e[0])?(t=e[1],e=e[0]):"object"==typeof e[e.length-1]&&(t=e.pop()),t||(t={}),t.browser)throw new Error("Change `browser` option to `overrideBrowserslist` in Autoprefixer");if(t.browserslist)throw new Error("Change `browserslist` option to `overrideBrowserslist` in Autoprefixer");t.overrideBrowserslist?e=t.overrideBrowserslist:t.browsers&&("undefined"!=typeof console&&console.warn&&console.warn(n.red(D.replace(/`[^`]+`/g,e=>n.yellow(e.slice(1,-1))))),e=t.browsers);let r={env:t.env,ignoreUnknownVersions:t.ignoreUnknownVersions,stats:t.stats};function s(B){let u=l,s=new i(u.browsers,e,B,r),n=s.selected.join(", ")+JSON.stringify(t);return c.has(n)||c.set(n,new a(u.prefixes,s,t)),c.get(n)}return{browsers:e,info:e=>((e=e||{}).from=e.from||u.cwd(),o(s(e))),options:t,postcssPlugin:"autoprefixer",prepare(e){let B=s({env:t.env,from:e.opts.from});return{OnceExit(u){!function(e,t){0!==t.browsers.selected.length&&(t.add.selectors.length>0||Object.keys(t.add).length>2||e.warn("Autoprefixer target browsers do not need any prefixes.You do not need Autoprefixer anymore.\nCheck your Browserslist config to be sure that your targets are set up correctly.\n\n Learn more at:\n https://github.com/postcss/autoprefixer#readme\n https://github.com/browserslist/browserslist#readme\n\n"))}(e,B),!1!==t.remove&&B.processor.remove(u,e),!1!==t.add&&B.processor.add(u,e)}}}}}e.exports=p,p.postcss=!0,p.data=l,p.defaults=r.defaults,p.info=()=>p().info()},22110:(e,t,B)=>{const{AtRule:u,Rule:r}=B(12895);let s=B(97149);function n(e,t){let B;try{s(e=>{B=e}).processSync(e)}catch(B){throw e.includes(":")?t?t.error("Missed semicolon"):B:t?t.error(B.message):B}return B.at(0)}function C(e,t){let B=!1;return e.each(e=>{if("nesting"===e.type){let u=t.clone({});"&"!==e.value?e.replaceWith(n(e.value.replace("&",u.toString()))):e.replaceWith(u),B=!0}else"nodes"in e&&e.nodes&&C(e,t)&&(B=!0)}),B}function i(e,t){let B=[];for(let u of e.selectors){let r=n(u,e);for(let e of t.selectors){if(!e)continue;let u=n(e,t);C(u,r)||(u.prepend(s.combinator({value:" "})),u.prepend(r.clone({}))),B.push(u.toString())}}return B}function o(e,t){if("comment"!==e.prev()?.type)return t.after(e),e;let B=e.prev();return e.parent.toString().match(/[*]\/ *\n.*{/)?t.after(e).after(B):t.after(e),e}function a(e,t,B,u=!0){return t.length?(B=function(e,t,B){let u=new r({nodes:[],selector:e});return u.append(t),B.after(u),u}(e,t,B),u&&(t=[]),[B,t]):[B,t]}function l(e,t=""){let B=e.concat(t),u={};for(let e of B)u[e.replace(/^@/,"")]=!0;return u}function D(e){let t=e[p];if(t){let B,r,s,n,C=e.nodes,i=-1,o=function(e){let t=[],B=e.parent;for(;B&&B instanceof u;)t.push(B),B=B.parent;return t}(e);if(o.forEach((e,u)=>{if(t(e.name))B=e,i=u,s=n;else{let t=n;n=e.clone({nodes:[]}),t&&n.append(t),r=r||n}}),B)if(s){r.append(C),B.after(s)}else B.after(C);else e.after(C);if(e.next()&&B){let t;o.slice(0,i+1).forEach((B,u,r)=>{let s=t;t=B.clone({nodes:[]}),s&&t.append(s);let n=[],C=(r[u-1]||e).next();for(;C;)n.push(C),C=C.next();t.append(n)}),t&&(s||C[C.length-1]).after(t)}}else e.after(e.nodes);e.remove()}const c=Symbol("rootRuleMergeSel"),p=Symbol("rootRuleEscapes");function f(e){let{params:t}=e,{escapes:B,selector:u,type:s}=function(e){let t=(e=e.trim()).match(/^\((.*)\)$/);if(!t)return{selector:e,type:"basic"};let B=t[1].match(/^(with(?:out)?):(.+)$/);if(B){let e="with"===B[1],t=Object.fromEntries(B[2].trim().split(/\s+/).map(e=>[e,!0]));if(e&&t.all)return{type:"noop"};let u=e=>!!t[e];return t.all?u=()=>!0:e&&(u=e=>"all"!==e&&!t[e]),{escapes:u,type:"withrules"}}return{type:"unknown"}}(t);if("unknown"===s)throw e.error(`Unknown @${e.name} parameter ${JSON.stringify(t)}`);if("basic"===s&&u){let t=new r({nodes:e.nodes,selector:u});e.removeAll(),e.append(t)}e[p]=B,e[c]=B?!B("all"):"noop"===s}const d=Symbol("hasRootRule");e.exports=(e={})=>{let t=l(["media","supports","layer","container","starting-style"],e.bubble),B=function(e){return function t(B,u,r,s=r){let n=[];if(u.each(C=>{"rule"===C.type&&r?s&&(C.selectors=i(B,C)):"atrule"===C.type&&C.nodes?e[C.name]?t(B,C,s):!1!==u[c]&&n.push(C):n.push(C)}),r&&n.length){let e=B.clone({nodes:[]});for(let t of n)e.append(t);u.prepend(e)}}}(t),u=l(["document","font-face","keyframes","-webkit-keyframes","-moz-keyframes"],e.unwrap),r=(e.rootRuleName||"at-root").replace(/^@/,""),s=e.preserveEmpty;return{Once(e){e.walkAtRules(r,t=>{f(t),e[d]=!0})},postcssPlugin:"postcss-nested",RootExit(e){e[d]&&(e.walkAtRules(r,D),e[d]=!1)},Rule(e){let n=!1,C=e,l=!1,D=[];e.each(s=>{switch(s.type){case"atrule":[C,D]=a(e.selector,D,C),s.name===r?(n=!0,B(e,s,!0,s[c]),C=o(s,C)):t[s.name]?(l=!0,n=!0,B(e,s,!0),C=o(s,C)):u[s.name]?(l=!0,n=!0,B(e,s,!1),C=o(s,C)):l&&D.push(s);break;case"decl":l&&D.push(s);break;case"rule":[C,D]=a(e.selector,D,C),l=!0,n=!0,s.selectors=i(e,s),C=o(s,C)}}),a(e.selector,D,C,!1),n&&!0!==s&&(e.raws.semicolon=!0,0===e.nodes.length&&e.remove())}}},e.exports.postcss=!0},22489:e=>{e.exports={A:{A:{2:"K D E sC",8:"F",292:"A B"},B:{1:"0 N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",292:"C L M G"},C:{1:"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB K D E F A B C L M G N O P wC xC",8:"1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB cB dB eB fB gB",584:"hB iB jB kB lB mB nB oB pB qB rB sB",1025:"tB uB"},D:{1:"0 zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 J UB K D E F A B C L M G N O P VB",8:"6 7 8 9",200:"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB",1025:"yB"},E:{1:"B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC zC",8:"K D E F A 0C 1C 2C"},F:{1:"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 F B C G N O P VB AD BD CD DD JC qC ED KC",200:"9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{1:"ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",8:"E HD ID JD KD LD MD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD",8:"rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{292:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"jD",8:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS Grid Layout (level 1)",D:!0}},22526:e=>{e.exports={A:{D:{1:"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB wC xC",33:"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB K D yC WC zC 0C 1C 9C",33:"E F A B C 2C XC JC"},G:{1:"RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD ID",33:"E JD KD LD MD ND OD PD QD"},P:{1:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J jD kD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration-line property",D:void 0}},23089:(e,t,B)=>{let u=B(57441);class r extends u{contain3d(e){if("transform-origin"===e.prop)return!1;for(let t of r.functions3d)if(e.value.includes(`${t}(`))return!0;return!1}insert(e,t,B){if("-ms-"===t){if(!this.contain3d(e)&&!this.keyframeParents(e))return super.insert(e,t,B)}else{if("-o-"!==t)return super.insert(e,t,B);if(!this.contain3d(e))return super.insert(e,t,B)}}keyframeParents(e){let{parent:t}=e;for(;t;){if("atrule"===t.type&&"keyframes"===t.name)return!0;({parent:t}=t)}return!1}set(e,t){return e=super.set(e,t),"-ms-"===t&&(e.value=e.value.replace(/rotatez/gi,"rotate")),e}}r.names=["transform","transform-origin"],r.functions3d=["matrix3d","translate3d","translateZ","scale3d","scaleZ","rotate3d","rotateX","rotateY","perspective"],e.exports=r},23619:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",33:"S",164:"Q H R",388:"C L M G N O P"},C:{1:"0 H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",164:"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q",676:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB wC xC"},D:{1:"0 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"S",164:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R"},E:{1:"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",164:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC"},F:{1:"0 CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"9B AC BC",164:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B"},G:{1:"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",164:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},H:{2:"cD"},I:{1:"I",164:"PC J dD eD fD gD rC hD iD"},J:{164:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A",388:"B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 rD sD MC NC OC tD",164:"J jD kD lD mD nD XC oD pD qD"},Q:{164:"uD"},R:{1:"vD"},S:{1:"xD",164:"wD"}},B:5,C:"CSS Appearance",D:!0}},24528:function(e,t){!function(){"use strict";var B={s:1,n:0,d:1};function u(e,t){if(isNaN(e=parseInt(e,10)))throw a();return e*t}function r(e,t){if(0===t)throw o();var B=Object.create(i.prototype);B.s=e<0?-1:1;var u=C(e=e<0?-e:e,t);return B.n=e/u,B.d=t/u,B}function s(e){for(var t={},B=e,u=2,r=4;r<=B;){for(;B%u===0;)B/=u,t[u]=(t[u]||0)+1;r+=1+2*u++}return B!==e?B>1&&(t[B]=(t[B]||0)+1):t[e]=(t[e]||0)+1,t}var n=function(e,t){var r,s=0,n=1,C=1,i=0,D=0,c=0,p=1,f=1,d=0,h=1,A=1,m=1,E=1e7;if(null==e);else if(void 0!==t){if(C=(s=e)*(n=t),s%1!=0||n%1!=0)throw l()}else switch(typeof e){case"object":if("d"in e&&"n"in e)s=e.n,n=e.d,"s"in e&&(s*=e.s);else{if(!(0 in e))throw a();s=e[0],1 in e&&(n=e[1])}C=s*n;break;case"number":if(e<0&&(C=e,e=-e),e%1==0)s=e;else if(e>0){for(e>=1&&(e/=f=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));h<=E&&m<=E;){if(e===(r=(d+A)/(h+m))){h+m<=E?(s=d+A,n=h+m):m>h?(s=A,n=m):(s=d,n=h);break}e>r?(d+=A,h+=m):(A+=d,m+=h),h>E?(s=A,n=m):(s=d,n=h)}s*=f}else(isNaN(e)||isNaN(t))&&(n=s=NaN);break;case"string":if(null===(h=e.match(/\d+|./g)))throw a();if("-"===h[d]?(C=-1,d++):"+"===h[d]&&d++,h.length===d+1?D=u(h[d++],C):"."===h[d+1]||"."===h[d]?("."!==h[d]&&(i=u(h[d++],C)),(++d+1===h.length||"("===h[d+1]&&")"===h[d+3]||"'"===h[d+1]&&"'"===h[d+3])&&(D=u(h[d],C),p=Math.pow(10,h[d].length),d++),("("===h[d]&&")"===h[d+2]||"'"===h[d]&&"'"===h[d+2])&&(c=u(h[d+1],C),f=Math.pow(10,h[d+1].length)-1,d+=3)):"/"===h[d+1]||":"===h[d+1]?(D=u(h[d],C),p=u(h[d+2],1),d+=3):"/"===h[d+3]&&" "===h[d+1]&&(i=u(h[d],C),D=u(h[d+2],C),p=u(h[d+4],1),d+=5),h.length<=d){C=s=c+(n=p*f)*i+f*D;break}default:throw a()}if(0===n)throw o();B.s=C<0?-1:1,B.n=Math.abs(s),B.d=Math.abs(n)};function C(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function i(e,t){if(n(e,t),!(this instanceof i))return r(B.s*B.n,B.d);e=C(B.d,B.n),this.s=B.s,this.n=B.n/e,this.d=B.d/e}var o=function(){return new Error("Division by Zero")},a=function(){return new Error("Invalid argument")},l=function(){return new Error("Parameters must be integer")};i.prototype={s:1,n:0,d:1,abs:function(){return r(this.n,this.d)},neg:function(){return r(-this.s*this.n,this.d)},add:function(e,t){return n(e,t),r(this.s*this.n*B.d+B.s*this.d*B.n,this.d*B.d)},sub:function(e,t){return n(e,t),r(this.s*this.n*B.d-B.s*this.d*B.n,this.d*B.d)},mul:function(e,t){return n(e,t),r(this.s*B.s*this.n*B.n,this.d*B.d)},div:function(e,t){return n(e,t),r(this.s*B.s*this.n*B.d,this.d*B.n)},clone:function(){return r(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new i(NaN);if(void 0===e)return r(this.s*this.n%this.d,1);if(n(e,t),0===B.n&&0===this.d)throw o();return r(this.s*(B.d*this.n)%(B.n*this.d),B.d*this.d)},gcd:function(e,t){return n(e,t),r(C(B.n,this.n)*C(B.d,this.d),B.d*this.d)},lcm:function(e,t){return n(e,t),0===B.n&&0===this.n?r(0,1):r(B.n*this.n,C(B.n,this.n)*C(B.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new i(NaN):r(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new i(NaN):r(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new i(NaN):r(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return n(e,t),r(this.s*Math.round(this.n*B.d/(this.d*B.n))*B.n,B.d)},inverse:function(){return r(this.s*this.d,this.n)},pow:function(e,t){if(n(e,t),1===B.d)return B.s<0?r(Math.pow(this.s*this.d,B.n),Math.pow(this.n,B.n)):r(Math.pow(this.s*this.n,B.n),Math.pow(this.d,B.n));if(this.s<0)return null;var u=s(this.n),C=s(this.d),i=1,o=1;for(var a in u)if("1"!==a){if("0"===a){i=0;break}if(u[a]*=B.n,u[a]%B.d!==0)return null;u[a]/=B.d,i*=Math.pow(a,u[a])}for(var a in C)if("1"!==a){if(C[a]*=B.n,C[a]%B.d!==0)return null;C[a]/=B.d,o*=Math.pow(a,C[a])}return B.s<0?r(o,i):r(i,o)},equals:function(e,t){return n(e,t),this.s*this.n*B.d===B.s*B.n*this.d},compare:function(e,t){n(e,t);var u=this.s*this.n*B.d-B.s*B.n*this.d;return(0=0;n--)s=s.inverse().add(B[n]);if(Math.abs(s.sub(t).valueOf())0&&(B+=t,B+=" ",u%=r),B+=u,B+="/",B+=r),B},toLatex:function(e){var t,B="",u=this.n,r=this.d;return this.s<0&&(B+="-"),1===r?B+=u:(e&&(t=Math.floor(u/r))>0&&(B+=t,u%=r),B+="\\frac{",B+=u,B+="}{",B+=r,B+="}"),B},toContinued:function(){var e,t=this.n,B=this.d,u=[];if(isNaN(t)||isNaN(B))return u;do{u.push(Math.floor(t/B)),e=t%B,t=B,B=e}while(1!==t);return u},toString:function(e){var t=this.n,B=this.d;if(isNaN(t)||isNaN(B))return"NaN";e=e||15;var u=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var B=10%t,u=1;1!==B;u++)if(B=10*B%t,u>2e3)return 0;return u}(0,B),r=function(e,t,B){for(var u=1,r=function(e,t,B){for(var u=1;t>0;e=e*e%B,t>>=1)1&t&&(u=u*e%B);return u}(10,B,t),s=0;s<300;s++){if(u===r)return s;u=10*u%t,r=10*r%t}return 0}(0,B,u),s=this.s<0?"-":"";if(s+=t/B|0,t%=B,(t*=10)&&(s+="."),u){for(var n=r;n--;)s+=t/B|0,t%=B,t*=10;s+="(";for(n=u;n--;)s+=t/B|0,t%=B,t*=10;s+=")"}else for(n=e;t&&n--;)s+=t/B|0,t%=B,t*=10;return s}},Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=i}()},24912:e=>{e.exports={A:{A:{2:"K D E F sC",420:"A B"},B:{2:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",420:"C L M G N O P"},C:{2:"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{2:"0 J UB K D E F A B C L M cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",36:"G N O P",66:"1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB"},E:{2:"J UB K C L M G yC WC zC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"D E F A B 0C 1C 2C XC"},F:{2:"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{2:"WC FD rC GD HD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"E ID JD KD LD MD ND OD"},H:{2:"cD"},I:{2:"PC J I dD eD fD gD rC hD iD"},J:{2:"D A"},K:{2:"A B C H JC qC KC"},L:{2:"I"},M:{2:"IC"},N:{420:"A B"},O:{2:"LC"},P:{2:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{2:"uD"},R:{2:"vD"},S:{2:"wD xD"}},B:5,C:"CSS Regions",D:!0}},25053:(e,t,B)=>{let u=B(72583),r=B(94059),{parse:s}=B(12895),n=B(47772),C=B(84328),i=B(87880),o=B(5180),a=r(u),l=[];for(let e in a.stats){let t=a.stats[e];for(let B in t){let u=t[B];/y/.test(u)&&l.push(e+" "+B)}}e.exports=class{constructor(e,t){this.Prefixes=e,this.all=t}add(e,t){return e.map(e=>{if(this.isProp(e)){let t=this.prefixed(e[0]);return t.length>1?this.convert(t):e}return"object"==typeof e?this.add(e,t):e})}cleanBrackets(e){return e.map(e=>"object"!=typeof e?e:1===e.length&&"object"==typeof e[0]?this.cleanBrackets(e[0]):this.cleanBrackets(e))}convert(e){let t=[""];for(let B of e)t.push([`${B.prop}: ${B.value}`]),t.push(" or ");return t[t.length-1]="",t}disabled(e){if(!this.all.options.grid){if("display"===e.prop&&e.value.includes("grid"))return!0;if(e.prop.includes("grid")||"justify-items"===e.prop)return!0}if(!1===this.all.options.flexbox){if("display"===e.prop&&e.value.includes("flex"))return!0;let t=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||t.includes(e.prop))return!0}return!1}isHack(e,t){return!new RegExp(`(\\(|\\s)${i.escapeRegexp(t)}:`).test(e)}isNot(e){return"string"==typeof e&&/not\s*/i.test(e)}isOr(e){return"string"==typeof e&&/\s*or\s*/i.test(e)}isProp(e){return"object"==typeof e&&1===e.length&&"string"==typeof e[0]}normalize(e){if("object"!=typeof e)return e;if("string"==typeof(e=e.filter(e=>""!==e))[0]){let t=e[0].trim();if(t.includes(":")||"selector"===t||"not selector"===t)return[n.stringify(e)]}return e.map(e=>this.normalize(e))}parse(e){let t=e.split(":"),B=t[0],u=t[1];return u||(u=""),[B.trim(),u.trim()]}prefixed(e){let t=this.virtual(e);if(this.disabled(t.first))return t.nodes;let B=this.prefixer().add[t.first.prop];B&&B.process&&B.process(t.first,{warn:()=>null});for(let e of t.nodes){for(let B of this.prefixer().values("add",t.first.prop))B.process(e);o.save(this.all,e)}return t.nodes}prefixer(){if(this.prefixerCache)return this.prefixerCache;let e=this.all.browsers.selected.filter(e=>l.includes(e)),t=new C(this.all.browsers.data,e,this.all.options);return this.prefixerCache=new this.Prefixes(this.all.data,t,this.all.options),this.prefixerCache}process(e){let t=n.parse(e.params);t=this.normalize(t),t=this.remove(t,e.params),t=this.add(t,e.params),t=this.cleanBrackets(t),e.params=n.stringify(t)}remove(e,t){let B=0;for(;B{var u=B(58809),r=B(88449),s=B(19063);function n(e){return this instanceof n?(this.nodes=u(e),this):new n(e)}n.prototype.toString=function(){return Array.isArray(this.nodes)?s(this.nodes):""},n.prototype.walk=function(e,t){return r(this.nodes,e,t),this},n.unit=B(82882),n.walk=r,n.stringify=s,e.exports=n},25642:(e,t,B)=>{let u=B(57441);class r extends u{insert(e,t,B){return"all"===e.value&&"-ms-"===t?void 0:"contain"!==e.value||"-moz-"!==t&&"-webkit-"!==t?super.insert(e,t,B):void 0}set(e,t){return"-ms-"===t&&"contain"===e.value&&(e.value="element"),super.set(e,t)}}r.names=["user-select"],e.exports=r},25644:(e,t,B)=>{"use strict";let u,r,s=B(77793);class n extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,B){let u=super.normalize(e);if(t)if("prepend"===B)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of u)e.raws.before=t.raws.before;return u}removeChild(e,t){let B=this.index(e);return!t&&0===B&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[B].raws.before),super.removeChild(e)}toResult(e={}){return new u(new r,this,e).stringify()}}n.registerLazyResult=e=>{u=e},n.registerProcessor=e=>{r=e},e.exports=n,n.default=n,s.registerRoot(n)},25768:e=>{"use strict";function t(e,t,B){var u=t-e;return((B-e)%u+u)%u+e}function B(e,t,B){return Math.max(e,Math.min(t,B))}function u(e,t,B,u,s){if(!r(e,t,B,u,s))throw new Error(B+" is outside of range ["+e+","+t+")");return B}function r(e,t,B,u,r){return!(Bt||r&&B===t||u&&B===e)}function s(e,t,B,u){return(B?"(":"[")+e+","+t+(u?")":"]")}e.exports={wrap:t,limit:B,validate:u,test:r,curry:function(e,n,C,i){var o=s.bind(null,e,n,C,i);return{wrap:t.bind(null,e,n),limit:B.bind(null,e,n),validate:function(t){return u(e,n,t,C,i)},test:function(t){return r(e,n,t,C,i)},toString:o,name:o}},name:s}},26161:(e,t,B)=>{let u=B(57441);class r extends u{check(e){return!e.value.includes("flex-")&&"baseline"!==e.value}normalize(){return"justify-self"}prefixed(e,t){return t+"grid-column-align"}}r.names=["grid-column-align"],e.exports=r},27068:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{normalize(){return"align-items"}prefixed(e,t){let B;return[B,t]=r(t),2009===B?t+"box-align":2012===B?t+"flex-align":super.prefixed(e,t)}set(e,t){let B=r(t)[0];return 2009!==B&&2012!==B||(e.value=s.oldValues[e.value]||e.value),super.set(e,t)}}s.names=["align-items","flex-align","box-align"],s.oldValues={"flex-end":"end","flex-start":"start"},e.exports=s},27475:e=>{e.exports={A:{A:{1:"K D E F A B",2:"sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1 2 3 4 5 6 7 8 9 D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",8:"tC PC J UB K wC xC"},D:{1:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{1:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JC qC ED KC",33:"F AD BD CD DD"},G:{1:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{1:"cD"},I:{1:"PC J I dD eD fD gD rC hD iD"},J:{1:"D A"},K:{1:"H KC",33:"A B C JC qC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:2,C:"CSS3 Text-overflow",D:!0}},27808:e=>{e.exports={A:{A:{1:"F A B",2:"K D E sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC",33:"wC xC"},D:{1:"0 1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"J UB K D E F"},E:{1:"K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"UB",164:"J yC WC"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z CD DD JC qC ED KC",2:"F AD BD"},G:{1:"E GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"FD rC",164:"WC"},H:{2:"cD"},I:{1:"J I gD rC hD iD",164:"PC dD eD fD"},J:{1:"A",33:"D"},K:{1:"B C H JC qC KC",2:"A"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS3 Box-shadow",D:!0}},27863:e=>{e.exports={A:{D:{1:"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB wC xC",33:"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB K D yC WC zC 0C 1C 9C",33:"E F A B C 2C XC JC"},G:{1:"RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD ID",33:"E JD KD LD MD ND OD PD QD"},P:{1:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J jD kD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration-style property",D:void 0}},27894:e=>{e.exports={A:{D:{1:"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X"},L:{1:"I"},B:{1:"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",33:"C L M G N O P Q H R S T U V W X"},C:{1:"0 SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R wC xC"},M:{1:"IC"},A:{2:"K D E F sC",33:"A B"},F:{1:"0 EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"G 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"9C",33:"J UB K D E F A B C L M yC WC zC 0C 1C 2C XC JC KC 3C"},G:{1:"XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD"},P:{1:"1 2 3 4 5 6 7 8 9 sD MC NC OC tD",33:"J jD kD lD mD nD XC oD pD qD rD"},I:{1:"I",2:"PC J dD eD fD gD rC",33:"hD iD"}},B:6,C:"::file-selector-button CSS pseudo-element",D:void 0}},28769:e=>{e.exports={A:{A:{1:"B",2:"K D E F A sC"},B:{1:"0 M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",129:"C L"},C:{1:"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC",260:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB",804:"J UB K D E F A B C L M wC xC"},D:{1:"0 xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",260:"sB tB uB vB wB",388:"XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB",1412:"1 2 3 4 5 6 7 8 9 G N O P VB WB",1956:"J UB K D E F A B C L M"},E:{1:"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",129:"A B C L M G 2C XC JC KC 3C 4C 5C YC",1412:"K D E F 0C 1C",1956:"J UB yC WC zC"},F:{1:"0 kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F AD BD",260:"fB gB hB iB jB",388:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB",1796:"CD DD",1828:"B C JC qC ED KC"},G:{1:"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",129:"LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC",1412:"E HD ID JD KD",1956:"WC FD rC GD"},H:{1828:"cD"},I:{1:"I",388:"hD iD",1956:"PC J dD eD fD gD rC"},J:{1412:"A",1924:"D"},K:{1:"H",2:"A",1828:"B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{1:"B",2:"A"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD",260:"jD kD",388:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",260:"wD"}},B:4,C:"CSS3 Border images",D:!0}},29605:e=>{e.exports={A:{D:{1:"I TC IC UC VC",2:"1 2 J UB K D E F A B C L M G N O P VB",33:"0 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},L:{1:"I"},B:{1:"I",2:"C L M G N O P",33:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},C:{2:"tC",33:"0 1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},M:{33:"IC"},A:{2:"K D E F A B sC"},F:{2:"F B C AD BD CD DD JC qC ED KC",33:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},K:{2:"A B C JC qC KC",33:"H"},E:{2:"J UB K yC WC zC 0C 9C",33:"D E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC"},G:{2:"WC FD rC GD HD",33:"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},P:{2:"J",33:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{1:"I",2:"PC J dD eD fD gD rC",33:"hD iD"}},B:6,C:"width: stretch property",D:void 0}},29825:(e,t,B)=>{let u=B(57441);class r extends u{normalize(){return"print-color-adjust"}prefixed(e,t){return"-moz-"===t?"color-adjust":t+"print-color-adjust"}}r.names=["print-color-adjust","color-adjust"],e.exports=r},30339:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(33631))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.SELECTOR,B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u}(r.default);t.default=C,e.exports=t.default},31132:(e,t,B)=>{let u=B(40624),r=B(5180);class s extends r{old(e){return"-webkit-"===e?new u(this.name,"-webkit-optimize-contrast"):"-moz-"===e?new u(this.name,"-moz-crisp-edges"):super.old(e)}replace(e,t){return"-webkit-"===t?e.replace(this.regexp(),"$1-webkit-optimize-contrast"):"-moz-"===t?e.replace(this.regexp(),"$1-moz-crisp-edges"):super.replace(e,t)}}s.names=["pixelated"],e.exports=s},31932:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"G N O P",33:"C L M",129:"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",161:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},C:{1:"0 qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB wC xC"},D:{129:"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",161:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},E:{2:"yC",129:"LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",388:"UB K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC",420:"J WC"},F:{2:"F B C AD BD CD DD JC qC ED KC",129:"0 p q r s t u v w x y z",161:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o"},G:{129:"LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",388:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC"},H:{2:"cD"},I:{16:"PC dD eD fD",129:"I",161:"J gD rC hD iD"},J:{161:"D A"},K:{16:"A B C JC qC KC",129:"H"},L:{129:"I"},M:{1:"IC"},N:{2:"A B"},O:{161:"LC"},P:{1:"6 7 8 9",161:"1 2 3 4 5 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{161:"uD"},R:{161:"vD"},S:{1:"wD xD"}},B:7,C:"Background-clip: text",D:!0}},32992:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC xC",33:"uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z",164:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},D:{1:"0 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 J UB K D E F A B C L M G N O P VB",132:"2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB"},E:{1:"M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K yC WC zC",132:"D E F A B C L 0C 1C 2C XC JC KC"},F:{1:"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F AD BD CD",132:"1 2 3 4 5 6 7 8 9 G N O P VB",164:"B C DD JC qC ED KC"},G:{1:"VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD",132:"E ID JD KD LD MD ND OD PD QD RD SD TD UD"},H:{164:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC",132:"hD iD"},J:{132:"D A"},K:{1:"H",2:"A",164:"B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{164:"wD xD"}},B:4,C:"CSS3 tab-size",D:!0}},33438:(e,t,B)=>{"use strict";let u=B(40396),r=B(49371),s=B(35238),n=B(61106),C=B(93878),i=B(25644),o=B(61534);function a(e,t){if(Array.isArray(e))return e.map(e=>a(e));let{inputs:B,...l}=e;if(B){t=[];for(let e of B){let B={...e,__proto__:n.prototype};B.map&&(B.map={...B.map,__proto__:C.prototype}),t.push(B)}}if(l.nodes&&(l.nodes=e.nodes.map(e=>a(e,t))),l.source){let{inputId:e,...B}=l.source;l.source=B,null!=e&&(l.source.input=t[e])}if("root"===l.type)return new i(l);if("decl"===l.type)return new s(l);if("rule"===l.type)return new o(l);if("comment"===l.type)return new r(l);if("atrule"===l.type)return new u(l);throw new Error("Unknown node type: "+e.type)}e.exports=a,a.default=a},33631:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(44646))&&u.__esModule?u:{default:u},s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var B=n(t);if(B&&B.has(e))return B.get(e);var u={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var C=r?Object.getOwnPropertyDescriptor(e,s):null;C&&(C.get||C.set)?Object.defineProperty(u,s,C):u[s]=e[s]}u.default=e,B&&B.set(e,u);return u}(B(11581));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,B=new WeakMap;return(n=function(e){return e?B:t})(e)}function C(e,t){var B="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(B)return(B=B.call(e)).next.bind(B);if(Array.isArray(e)||(B=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var B=Object.prototype.toString.call(e).slice(8,-1);"Object"===B&&e.constructor&&(B=e.constructor.name);if("Map"===B||"Set"===B)return Array.from(e);if("Arguments"===B||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){B&&(e=B);var u=0;return function(){return u>=e.length?{done:!0}:{done:!1,value:e[u++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var B=0,u=new Array(t);B=e&&(this.indexes[B]=t-1);return this},l.removeAll=function(){for(var e,t=C(this.nodes);!(e=t()).done;){e.value.parent=void 0}return this.nodes=[],this},l.empty=function(){return this.removeAll()},l.insertAfter=function(e,t){var B;t.parent=this;for(var u,r=this.index(e),s=[],n=2;n=r&&(this.indexes[C]=u+arguments.length-1);return this},l._findChildAtPosition=function(e,t){var B=void 0;return this.each(function(u){if(u.atPosition){var r=u.atPosition(e,t);if(r)return B=r,!1}else if(u.isAtPosition(e,t))return B=u,!1}),B},l.atPosition=function(e,t){return this.isAtPosition(e,t)?this._findChildAtPosition(e,t)||this:void 0},l._inferEndPosition=function(){this.last&&this.last.source&&this.last.source.end&&(this.source=this.source||{},this.source.end=this.source.end||{},Object.assign(this.source.end,this.last.source.end))},l.each=function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var t=this.lastEach;if(this.indexes[t]=0,this.length){for(var B,u;this.indexes[t]{"use strict";let u=B(60038);class r{get content(){return this.css}constructor(e,t,B){this.processor=e,this.messages=[],this.root=t,this.opts=B,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let B=new u(e,t);return this.messages.push(B),B}warnings(){return this.messages.filter(e=>"warning"===e.type)}}e.exports=r,r.default=r},35238:(e,t,B)=>{"use strict";let u=B(63152);class r extends u{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=r,r.default=r},35286:(e,t)=>{"use strict";function B(e){for(var t=e.toLowerCase(),B="",u=!1,r=0;r<6&&void 0!==t[r];r++){var s=t.charCodeAt(r);if(u=32===s,!(s>=97&&s<=102||s>=48&&s<=57))break;B+=t[r]}if(0!==B.length){var n=parseInt(B,16);return n>=55296&&n<=57343||0===n||n>1114111?["�",B.length+(u?1:0)]:[String.fromCodePoint(n),B.length+(u?1:0)]}}t.__esModule=!0,t.default=function(e){if(!u.test(e))return e;for(var t="",r=0;r{e.exports={A:{A:{1:"A B",2:"K D E F sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC xC",33:"UB K D E F A B C L M G",164:"J"},D:{1:"0 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 J UB K D E F A B C L M G N O P VB"},E:{1:"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"K zC",164:"J UB yC WC"},F:{1:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F AD BD",33:"C",164:"B CD DD JC qC ED"},G:{1:"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"HD",164:"WC FD rC GD"},H:{2:"cD"},I:{1:"I hD iD",33:"PC J dD eD fD gD rC"},J:{1:"A",33:"D"},K:{1:"H KC",33:"C",164:"A B JC qC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:5,C:"CSS3 Transitions",D:!0}},35767:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{2:"C L M G N O P",2052:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{2:"tC PC J UB wC xC",1028:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",1060:"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},D:{2:"1 2 3 4 5 6 J UB K D E F A B C L M G N O P VB",226:"7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB",2052:"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{2:"J UB K D yC WC zC 0C",772:"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",804:"E F A B C 2C XC JC",1316:"1C"},F:{2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC",226:"cB dB eB fB gB hB iB jB kB",2052:"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{2:"WC FD rC GD HD ID",292:"E JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{2:"A B C JC qC KC",2052:"H"},L:{2052:"I"},M:{1028:"IC"},N:{2:"A B"},O:{2052:"LC"},P:{2:"J jD kD",2052:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{2052:"uD"},R:{2052:"vD"},S:{1028:"wD xD"}},B:4,C:"text-decoration styling",D:!0}},36291:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){for(var t=arguments.length,B=new Array(t>1?t-1:0),u=1;u0;){var r=B.shift();if(!e[r])return;e=e[r]}return e},e.exports=t.default},36673:(e,t,B)=>{"use strict";const u=B(48379),r=B(80378),s=B(92472),{STATUS_MAPPING:n}=B(18445);function C(e){return/[^\x00-\x7F]/u.test(e)}function i(e){let t=0,B=s.length-1;for(;t<=B;){const u=Math.floor((t+B)/2),r=s[u],n=Array.isArray(r[0])?r[0][0]:r[0],C=Array.isArray(r[0])?r[0][1]:r[0];if(n<=e&&C>=e)return r.slice(1);n>e?B=u-1:t=u+1}return null}function o(e,{checkHyphens:t,checkBidi:B,checkJoiners:u,transitionalProcessing:s,useSTD3ASCIIRules:C,isBidi:o}){if(0===e.length)return!0;if(e.normalize("NFC")!==e)return!1;const a=Array.from(e);if(t&&("-"===a[2]&&"-"===a[3]||e.startsWith("-")||e.endsWith("-")))return!1;if(!t&&e.startsWith("xn--"))return!1;if(e.includes("."))return!1;if(r.combiningMarks.test(a[0]))return!1;for(const e of a){const t=e.codePointAt(0),[B]=i(t);if(s){if(B!==n.valid)return!1}else if(B!==n.valid&&B!==n.deviation)return!1;if(C&&t<=127&&!/^(?:[a-z]|[0-9]|-)$/u.test(e))return!1}if(u){let e=0;for(const[t,B]of a.entries())if("‌"===B||"‍"===B){if(t>0){if(r.combiningClassVirama.test(a[t-1]))continue;if("‌"===B){const B=a.indexOf("‌",t+1),u=B<0?a.slice(e):a.slice(e,B);if(r.validZWNJ.test(u.join(""))){e=t+1;continue}}}return!1}}if(B&&o){let t;if(r.bidiS1LTR.test(a[0]))t=!1;else{if(!r.bidiS1RTL.test(a[0]))return!1;t=!0}if(t){if(!r.bidiS2.test(e)||!r.bidiS3.test(e)||r.bidiS4EN.test(e)&&r.bidiS4AN.test(e))return!1}else if(!r.bidiS5.test(e)||!r.bidiS6.test(e))return!1}return!0}function a(e,t){let B=function(e,{transitionalProcessing:t}){let B="";for(const u of e){const[e,r]=i(u.codePointAt(0));switch(e){case n.disallowed:B+=u;break;case n.ignored:break;case n.mapped:B+=t&&"ẞ"===u?"ss":r;break;case n.deviation:B+=t?r:u;break;case n.valid:B+=u}}return B}(e,t);B=B.normalize("NFC");const s=B.split("."),a=function(e){const t=e.map(e=>{if(e.startsWith("xn--"))try{return u.decode(e.substring(4))}catch{return""}return e}).join(".");return r.bidiDomain.test(t)}(s);let l=!1;for(const[e,B]of s.entries()){let r=B,n=t.transitionalProcessing;if(r.startsWith("xn--")){if(C(r)){l=!0;continue}try{r=u.decode(r.substring(4))}catch{if(!t.ignoreInvalidPunycode){l=!0;continue}}s[e]=r,""!==r&&C(r)||(l=!0),n=!1}if(l)continue;o(r,{...t,transitionalProcessing:n,isBidi:a})||(l=!0)}return{string:s.join("."),error:l}}e.exports={toASCII:function(e,{checkHyphens:t=!1,checkBidi:B=!1,checkJoiners:r=!1,useSTD3ASCIIRules:s=!1,verifyDNSLength:n=!1,transitionalProcessing:i=!1,ignoreInvalidPunycode:o=!1}={}){const l=a(e,{checkHyphens:t,checkBidi:B,checkJoiners:r,useSTD3ASCIIRules:s,transitionalProcessing:i,ignoreInvalidPunycode:o});let D=l.string.split(".");if(D=D.map(e=>{if(C(e))try{return`xn--${u.encode(e)}`}catch{l.error=!0}return e}),n){const e=D.join(".").length;(e>253||0===e)&&(l.error=!0);for(let e=0;e63||0===D[e].length){l.error=!0;break}}return l.error?null:D.join(".")},toUnicode:function(e,{checkHyphens:t=!1,checkBidi:B=!1,checkJoiners:u=!1,useSTD3ASCIIRules:r=!1,transitionalProcessing:s=!1,ignoreInvalidPunycode:n=!1}={}){const C=a(e,{checkHyphens:t,checkBidi:B,checkJoiners:u,useSTD3ASCIIRules:r,transitionalProcessing:s,ignoreInvalidPunycode:n});return{domain:C.string,error:C.error}}}},38680:(e,t,B)=>{let u=B(99552);class r extends u{prefixed(e){return"-webkit-"===e?":-webkit-full-screen":"-moz-"===e?":-moz-full-screen":`:${e}fullscreen`}}r.names=[":fullscreen"],e.exports=r},39333:(e,t,B)=>{let u=B(57441),r=B(87880);class s extends u{constructor(e,t,B){super(e,t,B),this.prefixes&&(this.prefixes=r.uniq(this.prefixes.map(e=>"-ms-"===e?"-webkit-":e)))}check(e){return"text"===e.value.toLowerCase()}}s.names=["background-clip"],e.exports=s},39606:(e,t,B)=>{"use strict";t.__esModule=!0,t.unesc=t.stripComments=t.getProp=t.ensureObject=void 0;var u=C(B(35286));t.unesc=u.default;var r=C(B(36291));t.getProp=r.default;var s=C(B(81557));t.ensureObject=s.default;var n=C(B(58354));function C(e){return e&&e.__esModule?e:{default:e}}t.stripComments=n.default},40145:(e,t,B)=>{"use strict";let u,r,s=B(77793);class n extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new u(new r,this,e).stringify()}}n.registerLazyResult=e=>{u=e},n.registerProcessor=e=>{r=e},e.exports=n,n.default=n},40396:(e,t,B)=>{"use strict";let u=B(77793);class r extends u{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=r,r.default=r,u.registerAtRule(r)},40624:(e,t,B)=>{let u=B(87880);e.exports=class{constructor(e,t,B,r){this.unprefixed=e,this.prefixed=t,this.string=B||t,this.regexp=r||u.regexp(t)}check(e){return!!e.includes(this.string)&&!!e.match(this.regexp)}}},40859:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{normalize(){return"flex-shrink"}prefixed(e,t){let B;return[B,t]=r(t),2012===B?t+"flex-negative":super.prefixed(e,t)}set(e,t){let B;if([B,t]=r(t),2012===B||"final"===B)return super.set(e,t)}}s.names=["flex-shrink","flex-negative"],e.exports=s},41011:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P",164:"Q H R S T U V W X Y Z a b c d e f g h"},C:{1:"0 nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB wC xC",322:"mB"},D:{1:"0 i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 J UB K D E F A B C L M G N O P VB",164:"6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h"},E:{1:"E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K yC WC zC",164:"D 0C"},F:{1:"0 V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",164:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U"},G:{1:"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC",164:"hD iD"},J:{2:"D",164:"A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 OC tD",164:"J jD kD lD mD nD XC oD pD qD rD sD MC NC"},Q:{164:"uD"},R:{164:"vD"},S:{1:"wD xD"}},B:4,C:"text-emphasis styling",D:!0}},41416:(e,t,B)=>{let u=B(40624),r=B(5180),s=B(59941);class n extends r{constructor(e,t){super(e,t),"display-flex"===e&&(this.name="flex")}check(e){return"display"===e.prop&&e.value===this.name}old(e){let t=this.prefixed(e);if(t)return new u(this.name,t)}prefixed(e){let t,B;return[t,e]=s(e),2009===t?B="flex"===this.name?"box":"inline-box":2012===t?B="flex"===this.name?"flexbox":"inline-flexbox":"final"===t&&(B=this.name),e+B}replace(e,t){return this.prefixed(t)}}n.names=["display-flex","inline-flex"],e.exports=n},41475:(e,t,B)=>{let u=B(40624),r=B(5180);function s(e){return new RegExp(`(^|[\\s,(])(${e}($|[\\s),]))`,"gi")}class n extends r{add(e,t){if(!e.prop.includes("grid")||"-webkit-"===t)return super.add(e,t)}isStretch(){return"stretch"===this.name||"fill"===this.name||"fill-available"===this.name}old(e){let t=e+this.name;return this.isStretch()&&("-moz-"===e?t="-moz-available":"-webkit-"===e&&(t="-webkit-fill-available")),new u(this.name,t,t,s(t))}regexp(){return this.regexpCache||(this.regexpCache=s(this.name)),this.regexpCache}replace(e,t){return"-moz-"===t&&this.isStretch()?e.replace(this.regexp(),"$1-moz-available$3"):"-webkit-"===t&&this.isStretch()?e.replace(this.regexp(),"$1-webkit-fill-available$3"):super.replace(e,t)}}n.names=["max-content","min-content","fit-content","fill","fill-available","stretch"],e.exports=n},41656:(e,t,B)=>{"use strict";const{isASCIIHex:u}=B(47167),{utf8Encode:r}=B(58408);function s(e){return e.codePointAt(0)}function n(e){let t=e.toString(16).toUpperCase();return 1===t.length&&(t=`0${t}`),`%${t}`}function C(e){const t=new Uint8Array(e.byteLength);let B=0;for(let r=0;r126}const o=new Set([s(" "),s('"'),s("<"),s(">"),s("`")]);const a=new Set([s(" "),s('"'),s("#"),s("<"),s(">")]);function l(e){return i(e)||a.has(e)}const D=new Set([s("?"),s("`"),s("{"),s("}"),s("^")]);function c(e){return l(e)||D.has(e)}const p=new Set([s("/"),s(":"),s(";"),s("="),s("@"),s("["),s("\\"),s("]"),s("|")]);function f(e){return c(e)||p.has(e)}const d=new Set([s("$"),s("%"),s("&"),s("+"),s(",")]);const h=new Set([s("!"),s("'"),s("("),s(")"),s("~")]);function A(e,t){const B=r(e);let u="";for(const e of B)t(e)?u+=n(e):u+=String.fromCharCode(e);return u}e.exports={isC0ControlPercentEncode:i,isFragmentPercentEncode:function(e){return i(e)||o.has(e)},isQueryPercentEncode:l,isSpecialQueryPercentEncode:function(e){return l(e)||e===s("'")},isPathPercentEncode:c,isUserinfoPercentEncode:f,isURLEncodedPercentEncode:function(e){return function(e){return f(e)||d.has(e)}(e)||h.has(e)},percentDecodeString:function(e){return C(r(e))},percentDecodeBytes:C,utf8PercentEncodeString:function(e,t,B=!1){let u="";for(const r of e)u+=B&&" "===r?"+":A(r,t);return u},utf8PercentEncodeCodePoint:function(e,t){return A(String.fromCodePoint(e),t)}}},42612:e=>{e.exports={A:{A:{1:"A B",2:"K D E F sC"},B:{1:"C L M G N O P",516:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{132:"tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B",164:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB wC xC",516:"4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a",1028:"0 b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC"},D:{420:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB",516:"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{1:"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",132:"F 2C",164:"D E 1C",420:"J UB K yC WC zC 0C"},F:{1:"C JC qC ED KC",2:"F B AD BD CD DD",420:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB",516:"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{1:"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",132:"KD LD",164:"E ID JD",420:"WC FD rC GD HD"},H:{1:"cD"},I:{420:"PC J dD eD fD gD rC hD iD",516:"I"},J:{420:"D A"},K:{1:"C JC qC KC",2:"A B",516:"H"},L:{516:"I"},M:{1028:"IC"},N:{1:"A B"},O:{516:"LC"},P:{420:"J",516:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{516:"uD"},R:{516:"vD"},S:{164:"wD xD"}},B:4,C:"CSS3 Multiple column layout",D:!0}},43877:(e,t,B)=>{let u=B(92099),r=B(84328),s=B(57441),n=B(97773),C=B(27068),i=B(57452),o=B(44930),a=B(68384),l=B(85316),D=B(91563),c=B(39333),p=B(50526),f=B(3751),d=B(3276),h=B(20375),A=B(15884),m=B(55103),E=B(41416),F=B(81883),v=B(79749),g=B(79656),b=B(90336),y=B(68777),w=B(70250),x=B(85705),S=B(58514),k=B(46425),j=B(40859),O=B(3426),I=B(38680),P=B(15386),L=B(3402),T=B(26161),R=B(45894),M=B(2327),N=B(73274),U=B(11432),G=B(75643),H=B(99469),J=B(18742),q=B(14108),K=B(63452),V=B(75193),Q=B(41475),W=B(52952),z=B(91465),Y=B(94048),Z=B(46728),X=B(68908),_=B(31132),$=B(6610),ee=B(92417),te=B(63381),Be=B(29825),ue=B(58312),re=B(76079),se=B(8594),ne=B(23089),Ce=B(25642),ie=B(98114),oe=B(9981),ae=B(93475),le=B(99552),De=B(25053),ce=B(46726),pe=B(87880),fe=B(5180),de=B(77187);le.hack(l),le.hack(I),le.hack(ee),le.hack(te),le.hack(v),s.hack(y),s.hack(Z),s.hack(g),s.hack(R),s.hack(o),s.hack(S),s.hack(k),s.hack(O),s.hack(L),s.hack($),s.hack(G),s.hack(i),s.hack(a),s.hack(w),s.hack(z),s.hack(Y),s.hack(C),s.hack(Ce),s.hack(j),s.hack(A),s.hack(ie),s.hack(d),s.hack(n),s.hack(h),s.hack(f),s.hack(H),s.hack(V),s.hack(M),s.hack(ne),s.hack(x),s.hack(q),s.hack(D),s.hack(c),s.hack(ue),s.hack(W),s.hack(p),s.hack(N),s.hack(U),s.hack(T),s.hack(X),s.hack(J),s.hack(Be),s.hack(se),s.hack(re),fe.hack(P),fe.hack(Q),fe.hack(_),fe.hack(K),fe.hack(m),fe.hack(E),fe.hack(F),fe.hack(b);let he=new Map;class Ae{constructor(e,t,B={}){this.data=e,this.browsers=t,this.options=B,[this.add,this.remove]=this.preprocess(this.select(this.data)),this.transition=new ce(this),this.processor=new oe(this)}cleaner(){if(this.cleanerCache)return this.cleanerCache;if(!this.browsers.selected.length)return this;{let e=new r(this.browsers.data,[]);this.cleanerCache=new Ae(this.data,e,this.options)}return this.cleanerCache}decl(e){return he.has(e)||he.set(e,s.load(e)),he.get(e)}group(e){let t=e.parent,B=t.index(e),{length:u}=t.nodes,s=this.unprefixed(e.prop),n=(e,n)=>{for(B+=e;B>=0&&Bn(1,e),up:e=>n(-1,e)}}normalize(e){return this.decl(e).normalize(e)}prefixed(e,t){return e=de.unprefixed(e),this.decl(e).prefixed(e,t)}preprocess(e){let t={"@supports":new De(Ae,this),selectors:[]};for(let B in e.add){let r=e.add[B];if("@keyframes"===B||"@viewport"===B)t[B]=new u(B,r,this);else if("@resolution"===B)t[B]=new ae(B,r,this);else if(this.data[B].selector)t.selectors.push(le.load(B,r,this));else{let e=this.data[B].props;if(e){let u=fe.load(B,r,this);for(let B of e)t[B]||(t[B]={values:[]}),t[B].values.push(u)}else{let e=t[B]&&t[B].values||[];t[B]=s.load(B,r,this),t[B].values=e}}}let B={selectors:[]};for(let u in e.remove){let r=e.remove[u];if(this.data[u].selector){let e=le.load(u,r);for(let t of r)B.selectors.push(e.old(t))}else if("@keyframes"===u||"@viewport"===u)for(let e of r){B[`@${e}${u.slice(1)}`]={remove:!0}}else if("@resolution"===u)B[u]=new ae(u,r,this);else{let e=this.data[u].props;if(e){let t=fe.load(u,[],this);for(let u of r){let r=t.old(u);if(r)for(let t of e)B[t]||(B[t]={}),B[t].values||(B[t].values=[]),B[t].values.push(r)}}else for(let e of r){let r=this.decl(u).old(u,e);if("align-self"===u){let B=t[u]&&t[u].prefixes;if(B){if("-webkit- 2009"===e&&B.includes("-webkit-"))continue;if("-webkit-"===e&&B.includes("-webkit- 2009"))continue}}for(let e of r)B[e]||(B[e]={}),B[e].remove=!0}}}return[t,B]}select(e){let t={add:{},remove:{}};for(let B in e){let u=e[B],r=u.browsers.map(e=>{let t=e.split(" ");return{browser:`${t[0]} ${t[1]}`,note:t[2]}}),s=r.filter(e=>e.note).map(e=>`${this.browsers.prefix(e.browser)} ${e.note}`);s=pe.uniq(s),r=r.filter(e=>this.browsers.isSelected(e.browser)).map(e=>{let t=this.browsers.prefix(e.browser);return e.note?`${t} ${e.note}`:t}),r=this.sort(pe.uniq(r)),"no-2009"===this.options.flexbox&&(r=r.filter(e=>!e.includes("2009")));let n=u.browsers.map(e=>this.browsers.prefix(e));u.mistakes&&(n=n.concat(u.mistakes)),n=n.concat(s),n=pe.uniq(n),r.length?(t.add[B]=r,r.length!r.includes(e)))):t.remove[B]=n}return t}sort(e){return e.sort((e,t)=>{let B=pe.removeNote(e).length,u=pe.removeNote(t).length;return B===u?t.length-e.length:u-B})}unprefixed(e){let t=this.normalize(de.unprefixed(e));return"flex-direction"===t&&(t="flex-flow"),t}values(e,t){let B=this[e],u=B["*"]&&B["*"].values,r=B[t]&&B[t].values;return u&&r?pe.uniq(u.concat(r)):u||r||[]}}e.exports=Ae},44313:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",33:"1 2 3 4 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{1:"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"J UB K D E yC WC zC 0C 1C"},F:{1:"0 5 6 7 8 9 C WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ED KC",2:"F B AD BD CD DD JC qC",33:"1 2 3 4 G N O P VB"},G:{2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{33:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{2:"IC"},N:{2:"A B"},O:{1:"LC"},P:{2:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{2:"wD xD"}},B:2,C:"CSS3 Cursors: zoom-in & zoom-out",D:!0}},44418:e=>{e.exports={A:{A:{2:"K D E F A sC",548:"B"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",516:"C L M G N O P"},C:{1:"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB K D E F wC xC",676:"1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB",1700:"oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B"},D:{1:"0 AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"J UB K D E F A B C L M",676:"G N O P VB",804:"1 2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B"},E:{1:"dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC",548:"ZC LC 6C MC aC bC cC",676:"zC",804:"K D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC"},F:{1:"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F B C AD BD CD DD JC qC ED",804:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B"},G:{2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD",2052:"QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{2:"PC J I dD eD fD gD rC hD iD"},J:{2:"D",292:"A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A",548:"B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 XC oD pD qD rD sD MC NC OC tD",804:"J jD kD lD mD nD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:1,C:"Fullscreen API",D:!0}},44646:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u=B(39606);function r(e,t){for(var B=0;Be)&&(!(this.source.end.linet)&&!(this.source.end.line===e&&this.source.end.column{"use strict";const u=B(85616),r=B(46892);t.convert=(e,t,{context:B="The provided value"}={})=>{if("function"!=typeof t)throw new e.TypeError(B+" is not a function");function s(...s){const n=r.tryWrapperForImpl(this);let C;for(let e=0;e{for(let e=0;e{let u=B(57441);class r extends u{check(e){return!e.value.split(/\s+/).some(e=>{let t=e.toLowerCase();return"reverse"===t||"alternate-reverse"===t})}}r.names=["animation","animation-direction"],e.exports=r},45781:e=>{"use strict";const t="'".charCodeAt(0),B='"'.charCodeAt(0),u="\\".charCodeAt(0),r="/".charCodeAt(0),s="\n".charCodeAt(0),n=" ".charCodeAt(0),C="\f".charCodeAt(0),i="\t".charCodeAt(0),o="\r".charCodeAt(0),a="[".charCodeAt(0),l="]".charCodeAt(0),D="(".charCodeAt(0),c=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),d=";".charCodeAt(0),h="*".charCodeAt(0),A=":".charCodeAt(0),m="@".charCodeAt(0),E=/[\t\n\f\r "#'()/;[\\\]{}]/g,F=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,v=/.[\r\n"'(/\\]/,g=/[\da-f]/i;e.exports=function(e,b={}){let y,w,x,S,k,j,O,I,P,L,T=e.css.valueOf(),R=b.ignoreErrors,M=T.length,N=0,U=[],G=[];function H(t){throw e.error("Unclosed "+t,N)}return{back:function(e){G.push(e)},endOfFile:function(){return 0===G.length&&N>=M},nextToken:function(e){if(G.length)return G.pop();if(N>=M)return;let b=!!e&&e.ignoreUnclosed;switch(y=T.charCodeAt(N),y){case s:case n:case i:case o:case C:S=N;do{S+=1,y=T.charCodeAt(S)}while(y===n||y===s||y===i||y===o||y===C);j=["space",T.slice(N,S)],N=S-1;break;case a:case l:case p:case f:case A:case d:case c:{let e=String.fromCharCode(y);j=[e,e,N];break}case D:if(L=U.length?U.pop()[1]:"",P=T.charCodeAt(N+1),"url"===L&&P!==t&&P!==B&&P!==n&&P!==s&&P!==i&&P!==C&&P!==o){S=N;do{if(O=!1,S=T.indexOf(")",S+1),-1===S){if(R||b){S=N;break}H("bracket")}for(I=S;T.charCodeAt(I-1)===u;)I-=1,O=!O}while(O);j=["brackets",T.slice(N,S+1),N,S],N=S}else S=T.indexOf(")",N+1),w=T.slice(N,S+1),-1===S||v.test(w)?j=["(","(",N]:(j=["brackets",w,N,S],N=S);break;case t:case B:k=y===t?"'":'"',S=N;do{if(O=!1,S=T.indexOf(k,S+1),-1===S){if(R||b){S=N+1;break}H("string")}for(I=S;T.charCodeAt(I-1)===u;)I-=1,O=!O}while(O);j=["string",T.slice(N,S+1),N,S],N=S;break;case m:E.lastIndex=N+1,E.test(T),S=0===E.lastIndex?T.length-1:E.lastIndex-2,j=["at-word",T.slice(N,S+1),N,S],N=S;break;case u:for(S=N,x=!0;T.charCodeAt(S+1)===u;)S+=1,x=!x;if(y=T.charCodeAt(S+1),x&&y!==r&&y!==n&&y!==s&&y!==i&&y!==o&&y!==C&&(S+=1,g.test(T.charAt(S)))){for(;g.test(T.charAt(S+1));)S+=1;T.charCodeAt(S+1)===n&&(S+=1)}j=["word",T.slice(N,S+1),N,S],N=S;break;default:y===r&&T.charCodeAt(N+1)===h?(S=T.indexOf("*/",N+2)+1,0===S&&(R||b?S=T.length:H("comment")),j=["comment",T.slice(N,S+1),N,S],N=S):(F.lastIndex=N+1,F.test(T),S=0===F.lastIndex?T.length-1:F.lastIndex-2,j=["word",T.slice(N,S+1),N,S],U.push(j),N=S)}return N++,j},position:function(){return N}}}},45894:(e,t,B)=>{let u=B(57441),{isPureNumber:r}=B(87880);class s extends u{insert(e,t,B,u){if("-ms-"!==t)return super.insert(e,t,B);let s=this.clone(e),n=e.prop.replace(/end$/,"start"),C=t+e.prop.replace(/end$/,"span");if(!e.parent.some(e=>e.prop===C)){if(s.prop=C,e.value.includes("span"))s.value=e.value.replace(/span\s/i,"");else{let t;if(e.parent.walkDecls(n,e=>{t=e}),t){if(!r(t.value))return;{let B=Number(e.value)-Number(t.value)+"";s.value=B}}else e.warn(u,`Can not prefix ${e.prop} (${n} is not found)`)}e.cloneBefore(s)}}}s.names=["grid-row-end","grid-column-end"],e.exports=s},46425:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{normalize(){return"flex"}prefixed(e,t){let B;return[B,t]=r(t),2009===B?t+"box-flex":2012===B?t+"flex-positive":super.prefixed(e,t)}}s.names=["flex-grow","flex-positive"],e.exports=s},46726:(e,t,B)=>{let{list:u}=B(12895),r=B(25482),s=B(84328),n=B(77187);e.exports=class{constructor(e){this.props=["transition","transition-property"],this.prefixes=e}add(e,t){let B,u,r=this.prefixes.add[e.prop],s=this.ruleVendorPrefixes(e),n=s||r&&r.prefixes||[],C=this.parse(e.value),i=C.map(e=>this.findProp(e)),o=[];if(i.some(e=>"-"===e[0]))return;for(let e of C){if(u=this.findProp(e),"-"===u[0])continue;let t=this.prefixes.add[u];if(t&&t.prefixes)for(B of t.prefixes){if(s&&!s.some(e=>B.includes(e)))continue;let t=this.prefixes.prefixed(u,B);"-ms-transform"===t||i.includes(t)||this.disabled(u,B)||o.push(this.clone(u,t,e))}}C=C.concat(o);let a=this.stringify(C),l=this.stringify(this.cleanFromUnprefixed(C,"-webkit-"));if(n.includes("-webkit-")&&this.cloneBefore(e,`-webkit-${e.prop}`,l),this.cloneBefore(e,e.prop,l),n.includes("-o-")){let t=this.stringify(this.cleanFromUnprefixed(C,"-o-"));this.cloneBefore(e,`-o-${e.prop}`,t)}for(B of n)if("-webkit-"!==B&&"-o-"!==B){let t=this.stringify(this.cleanOtherPrefixes(C,B));this.cloneBefore(e,B+e.prop,t)}a===e.value||this.already(e,e.prop,a)||(this.checkForWarning(t,e),e.cloneBefore(),e.value=a)}already(e,t,B){return e.parent.some(e=>e.prop===t&&e.value===B)}checkForWarning(e,t){if("transition-property"!==t.prop)return;let B=!1,r=!1;t.parent.each(e=>{if("decl"!==e.type)return;if(0!==e.prop.indexOf("transition-"))return;let t=u.comma(e.value);if("transition-property"!==e.prop)return r=r||t.length>1,!1;t.forEach(e=>{let t=this.prefixes.add[e];t&&t.prefixes&&t.prefixes.length>0&&(B=!0)})}),B&&r&&t.warn(e,"Replace transition-property to transition, because Autoprefixer could not support any cases of transition-property and other transition-*")}cleanFromUnprefixed(e,t){let B=e.map(e=>this.findProp(e)).filter(e=>e.slice(0,t.length)===t).map(e=>this.prefixes.unprefixed(e)),u=[];for(let r of e){let e=this.findProp(r),s=n.prefix(e);B.includes(e)||s!==t&&""!==s||u.push(r)}return u}cleanOtherPrefixes(e,t){return e.filter(e=>{let B=n.prefix(this.findProp(e));return""===B||B===t})}clone(e,t,B){let u=[],r=!1;for(let s of B)r||"word"!==s.type||s.value!==e?u.push(s):(u.push({type:"word",value:t}),r=!0);return u}cloneBefore(e,t,B){this.already(e,t,B)||e.cloneBefore({prop:t,value:B})}disabled(e,t){if(e.includes("flex")||["order","justify-content","align-self","align-content"].includes(e)){if(!1===this.prefixes.options.flexbox)return!0;if("no-2009"===this.prefixes.options.flexbox)return t.includes("2009")}}div(e){for(let t of e)for(let e of t)if("div"===e.type&&","===e.value)return e;return{after:" ",type:"div",value:","}}findProp(e){let t=e[0].value;if(/^\d/.test(t))for(let[t,B]of e.entries())if(0!==t&&"word"===B.type)return B.value;return t}parse(e){let t=r(e),B=[],u=[];for(let e of t.nodes)u.push(e),"div"===e.type&&","===e.value&&(B.push(u),u=[]);return B.push(u),B.filter(e=>e.length>0)}remove(e){let t=this.parse(e.value);t=t.filter(e=>{let t=this.prefixes.remove[this.findProp(e)];return!t||!t.remove});let B=this.stringify(t);if(e.value===B)return;if(0===t.length)return void e.remove();let u=e.parent.some(t=>t.prop===e.prop&&t.value===B),r=e.parent.some(t=>t!==e&&t.prop===e.prop&&t.value.length>B.length);u||r?e.remove():e.value=B}ruleVendorPrefixes(e){let{parent:t}=e;if("rule"!==t.type)return!1;if(!t.selector.includes(":-"))return!1;let B=s.prefixes().filter(e=>t.selector.includes(":"+e));return B.length>0&&B}stringify(e){if(0===e.length)return"";let t=[];for(let B of e)"div"!==B[B.length-1].type&&B.push(this.div(e)),t=t.concat(B);return"div"===t[0].type&&(t=t.slice(1)),"div"===t[t.length-1].type&&(t=t.slice(0,-1)),r.stringify({nodes:t})}}},46728:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{normalize(){return"order"}prefixed(e,t){let B;return[B,t]=r(t),2009===B?t+"box-ordinal-group":2012===B?t+"flex-order":super.prefixed(e,t)}set(e,t){return 2009===r(t)[0]&&/\d/.test(e.value)?(e.value=(parseInt(e.value)+1).toString(),super.set(e,t)):super.set(e,t)}}s.names=["order","flex-order","box-ordinal-group"],e.exports=s},46892:(e,t)=>{"use strict";const B=Function.prototype.call.bind(Object.prototype.hasOwnProperty);const u=Symbol("wrapper"),r=Symbol("impl"),s=Symbol("SameObject caches"),n=Symbol.for("[webidl2js] constructor registry"),C=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function i(e){if(B(e,n))return e[n];const t=Object.create(null);t["%Object.prototype%"]=e.Object.prototype,t["%IteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf((new e.Array)[Symbol.iterator]()));try{t["%AsyncIteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(e.eval("(async function* () {})").prototype))}catch{t["%AsyncIteratorPrototype%"]=C}return e[n]=t,t}function o(e){return e?e[u]:null}function a(e){return e?e[r]:null}const l=Symbol("internal");const D=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;const c=Symbol("supports property index"),p=Symbol("supported property indices"),f=Symbol("supports property name"),d=Symbol("supported property names"),h=Symbol("indexed property get"),A=Symbol("indexed property set new"),m=Symbol("indexed property set existing"),E=Symbol("named property get"),F=Symbol("named property set new"),v=Symbol("named property set existing"),g=Symbol("named property delete"),b=Symbol("async iterator get the next iteration result"),y=Symbol("async iterator return steps"),w=Symbol("async iterator initialization steps"),x=Symbol("async iterator end of iteration");e.exports={isObject:function(e){return"object"==typeof e&&null!==e||"function"==typeof e},hasOwn:B,define:function(e,t){for(const B of Reflect.ownKeys(t)){const u=Reflect.getOwnPropertyDescriptor(t,B);if(u&&!Reflect.defineProperty(e,B,u))throw new TypeError(`Cannot redefine property: ${String(B)}`)}},newObjectInRealm:function(e,t){const B=i(e);return Object.defineProperties(Object.create(B["%Object.prototype%"]),Object.getOwnPropertyDescriptors(t))},wrapperSymbol:u,implSymbol:r,getSameObject:function(e,t,B){return e[s]||(e[s]=Object.create(null)),t in e[s]||(e[s][t]=B()),e[s][t]},ctorRegistrySymbol:n,initCtorRegistry:i,wrapperForImpl:o,implForWrapper:a,tryWrapperForImpl:function(e){const t=o(e);return t||e},tryImplForWrapper:function(e){const t=a(e);return t||e},iterInternalSymbol:l,isArrayBuffer:function(e){try{return D.call(e),!0}catch(e){return!1}},isArrayIndexPropName:function(e){if("string"!=typeof e)return!1;const t=e>>>0;return t!==2**32-1&&e===`${t}`},supportsPropertyIndex:c,supportedPropertyIndices:p,supportsPropertyName:f,supportedPropertyNames:d,indexedGet:h,indexedSetNew:A,indexedSetExisting:m,namedGet:E,namedSetNew:F,namedSetExisting:v,namedDelete:g,asyncIteratorNext:b,asyncIteratorReturn:y,asyncIteratorInit:w,asyncIteratorEOI:x,iteratorResult:function([e,t],B){let u;switch(B){case"key":u=e;break;case"value":u=t;break;case"key+value":u=[e,t]}return{value:u,done:!1}}}},47035:e=>{e.exports={A:{A:{1:"A B",2:"K D E F sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J wC xC",33:"UB K D E F A B C L M G"},D:{1:"0 kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"yC WC",33:"K D E zC 0C 1C",292:"J UB"},F:{1:"0 XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F B AD BD CD DD JC qC ED",33:"1 2 3 4 5 6 7 8 9 C G N O P VB WB"},G:{1:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"E HD ID JD",164:"WC FD rC GD"},H:{2:"cD"},I:{1:"I",33:"J gD rC hD iD",164:"PC dD eD fD"},J:{33:"D A"},K:{1:"H KC",2:"A B C JC qC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:5,C:"CSS Animation",D:!0}},47167:e=>{"use strict";function t(e){return e>=48&&e<=57}function B(e){return e>=65&&e<=90||e>=97&&e<=122}e.exports={isASCIIDigit:t,isASCIIAlpha:B,isASCIIAlphanumeric:function(e){return B(e)||t(e)},isASCIIHex:function(e){return t(e)||e>=65&&e<=70||e>=97&&e<=102}}},47668:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class B{constructor(e){this.builder=e}atrule(e,t){let B="@"+e.name,u=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?B+=e.raws.afterName:u&&(B+=" "),e.nodes)this.block(e,B+u);else{let r=(e.raws.between||"")+(t?";":"");this.builder(B+u+r,e)}}beforeAfter(e,t){let B;B="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let u=e.parent,r=0;for(;u&&"root"!==u.type;)r+=1,u=u.parent;if(B.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e0&&"comment"===e.nodes[t].type;)t-=1;let B=this.raw(e,"semicolon");for(let u=0;u{if(r=e.raws[B],void 0!==r)return!1})}var C;return void 0===r&&(r=t[u]),n.rawCache[u]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let B;return e.walkComments(e=>{if(void 0!==e.raws.before)return B=e.raws.before,B.includes("\n")&&(B=B.replace(/[^\n]+$/,"")),!1}),void 0===B?B=this.raw(t,null,"beforeDecl"):B&&(B=B.replace(/\S/g,"")),B}rawBeforeDecl(e,t){let B;return e.walkDecls(e=>{if(void 0!==e.raws.before)return B=e.raws.before,B.includes("\n")&&(B=B.replace(/[^\n]+$/,"")),!1}),void 0===B?B=this.raw(t,null,"beforeRule"):B&&(B=B.replace(/\S/g,"")),B}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(B=>{if(B.nodes&&(B.parent!==e||e.first!==B)&&void 0!==B.raws.before)return t=B.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(B=>{let u=B.parent;if(u&&u!==e&&u.parent&&u.parent===e&&void 0!==B.raws.before){let e=B.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let B=e[t],u=e.raws[t];return u&&u.value===B?u.raw:B}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=B,B.default=B},47772:e=>{function t(e){return e[e.length-1]}let B={parse(e){let B=[""],u=[B];for(let r of e)"("!==r?")"!==r?B[B.length-1]+=r:(u.pop(),B=t(u),B.push("")):(B=[""],t(u).push(B),u.push(B));return u[0]},stringify(e){let t="";for(let u of e)t+="object"!=typeof u?u:`(${B.stringify(u)})`;return t}};e.exports=B},48111:e=>{e.exports={A:{A:{132:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",4:"C L M G N O P"},C:{1:"0 qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB K D E F A B wC xC",33:"1 2 3 4 5 6 7 8 9 C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB"},D:{1:"0 oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB",322:"cB dB eB fB gB hB iB jB kB lB mB nB"},E:{1:"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C"},F:{1:"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 F B C G N O P VB AD BD CD DD JC qC ED KC",578:"3 4 5 6 7 8 9 WB XB YB ZB aB"},G:{1:"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{132:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",33:"wD"}},B:4,C:"CSS3 text-align-last",D:!0}},48349:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(65170))&&u.__esModule?u:{default:u};var s=function(){function e(e,t){this.func=e||function(){},this.funcRes=null,this.options=t}var t=e.prototype;return t._shouldUpdateSelector=function(e,t){return void 0===t&&(t={}),!1!==Object.assign({},this.options,t).updateSelector&&"string"!=typeof e},t._isLossy=function(e){return void 0===e&&(e={}),!1===Object.assign({},this.options,e).lossless},t._root=function(e,t){return void 0===t&&(t={}),new r.default(e,this._parseOptions(t)).root},t._parseOptions=function(e){return{lossy:this._isLossy(e)}},t._run=function(e,t){var B=this;return void 0===t&&(t={}),new Promise(function(u,r){try{var s=B._root(e,t);Promise.resolve(B.func(s)).then(function(u){var r=void 0;return B._shouldUpdateSelector(e,t)&&(r=s.toString(),e.selector=r),{transform:u,root:s,string:r}}).then(u,r)}catch(e){return void r(e)}})},t._runSync=function(e,t){void 0===t&&(t={});var B=this._root(e,t),u=this.func(B);if(u&&"function"==typeof u.then)throw new Error("Selector processor returned a promise to a synchronous call.");var r=void 0;return t.updateSelector&&"string"!=typeof e&&(r=B.toString(),e.selector=r),{transform:u,root:B,string:r}},t.ast=function(e,t){return this._run(e,t).then(function(e){return e.root})},t.astSync=function(e,t){return this._runSync(e,t).root},t.transform=function(e,t){return this._run(e,t).then(function(e){return e.transform})},t.transformSync=function(e,t){return this._runSync(e,t).transform},t.process=function(e,t){return this._run(e,t).then(function(e){return e.string||e.root.toString()})},t.processSync=function(e,t){var B=this._runSync(e,t);return B.string||B.root.toString()},e}();t.default=s,e.exports=t.default},48379:(e,t,B)=>{"use strict";B.r(t),B.d(t,{decode:()=>A,default:()=>v,encode:()=>m,toASCII:()=>F,toUnicode:()=>E,ucs2decode:()=>c,ucs2encode:()=>p});const u=2147483647,r=36,s=/^xn--/,n=/[^\0-\x7F]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,i={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},o=Math.floor,a=String.fromCharCode;function l(e){throw new RangeError(i[e])}function D(e,t){const B=e.split("@");let u="";B.length>1&&(u=B[0]+"@",e=B[1]);const r=function(e,t){const B=[];let u=e.length;for(;u--;)B[u]=t(e[u]);return B}((e=e.replace(C,".")).split("."),t).join(".");return u+r}function c(e){const t=[];let B=0;const u=e.length;for(;B=55296&&r<=56319&&BString.fromCodePoint(...e),f=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:r},d=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},h=function(e,t,B){let u=0;for(e=B?o(e/700):e>>1,e+=o(e/t);e>455;u+=r)e=o(e/35);return o(u+36*e/(e+38))},A=function(e){const t=[],B=e.length;let s=0,n=128,C=72,i=e.lastIndexOf("-");i<0&&(i=0);for(let B=0;B=128&&l("not-basic"),t.push(e.charCodeAt(B));for(let a=i>0?i+1:0;a=B&&l("invalid-input");const i=f(e.charCodeAt(a++));i>=r&&l("invalid-input"),i>o((u-s)/t)&&l("overflow"),s+=i*t;const D=n<=C?1:n>=C+26?26:n-C;if(io(u/c)&&l("overflow"),t*=c}const D=t.length+1;C=h(s-i,D,0==i),o(s/D)>u-n&&l("overflow"),n+=o(s/D),s%=D,t.splice(s++,0,n)}return String.fromCodePoint(...t)},m=function(e){const t=[],B=(e=c(e)).length;let s=128,n=0,C=72;for(const B of e)B<128&&t.push(a(B));const i=t.length;let D=i;for(i&&t.push("-");D=s&&to((u-n)/c)&&l("overflow"),n+=(B-s)*c,s=B;for(const B of e)if(Bu&&l("overflow"),B===s){let e=n;for(let B=r;;B+=r){const u=B<=C?1:B>=C+26?26:B-C;if(e{var t=String,B=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=B(),e.exports.createColors=B},48729:(e,t,B)=>{let u=B(94364);function r(e){return e.slice(0,1).toUpperCase()+e.slice(1)}const s={and_chr:"Chrome for Android",and_ff:"Firefox for Android",and_qq:"QQ Browser",and_uc:"UC for Android",baidu:"Baidu Browser",ie:"IE",ie_mob:"IE Mobile",ios_saf:"iOS Safari",kaios:"KaiOS Browser",op_mini:"Opera Mini",op_mob:"Opera Mobile",samsung:"Samsung Internet"};function n(e,t,B){let u=` ${e}`;return B&&(u+=" *"),u+=": ",u+=t.map(e=>e.replace(/^-(.*)-$/g,"$1")).join(", "),u+="\n",u}e.exports=function(e){if(0===e.browsers.selected.length)return"No browsers selected";let t={};for(let B of e.browsers.selected){let e=B.split(" "),u=e[0],n=e[1];u=s[u]||r(u),t[u]?t[u].push(n):t[u]=[n]}let B="Browsers:\n";for(let e in t){let u=t[e];u=u.sort((e,t)=>parseFloat(t)-parseFloat(e)),B+=` ${e}: ${u.join(", ")}\n`}let C=u.coverage(e.browsers.selected);B+=`\nThese browsers account for ${Math.round(100*C)/100}% of all users globally\n`;let i=[];for(let t in e.add){let B=e.add[t];"@"===t[0]&&B.prefixes&&i.push(n(t,B.prefixes))}i.length>0&&(B+=`\nAt-Rules:\n${i.sort().join("")}`);let o=[];for(let t of e.add.selectors)t.prefixes&&o.push(n(t.name,t.prefixes));o.length>0&&(B+=`\nSelectors:\n${o.sort().join("")}`);let a=[],l=[],D=!1;for(let t in e.add){let B=e.add[t];if("@"!==t[0]&&B.prefixes){let e=0===t.indexOf("grid-");e&&(D=!0),l.push(n(t,B.prefixes,e))}if(Array.isArray(B.values))for(let e of B.values){let t=e.name.includes("grid");t&&(D=!0);let B=n(e.name,e.prefixes,t);a.includes(B)||a.push(B)}}return l.length>0&&(B+=`\nProperties:\n${l.sort().join("")}`),a.length>0&&(B+=`\nValues:\n${a.sort().join("")}`),D&&(B+="\n* - Prefixes will be added only on grid: true option.\n"),i.length||o.length||l.length||a.length||(B+="\nAwesome! Your browsers don't require any vendor prefixes.\nNow you can remove Autoprefixer from build steps."),B}},48909:e=>{e.exports={A:{A:{2:"K D E F sC",132:"A B"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB K D E F wC xC",33:"A B C L M G"},D:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"J UB K D E F A B",33:"1 2 3 4 5 6 7 8 9 C L M G N O P VB WB XB YB ZB aB bB cB"},E:{1:"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"yC WC",33:"J UB K D E zC 0C 1C",257:"F A B C L M G 2C XC JC KC 3C 4C 5C YC"},F:{1:"0 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 G N O P VB"},G:{1:"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"E WC FD rC GD HD ID JD",257:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},H:{2:"cD"},I:{1:"I",2:"dD eD fD",33:"PC J gD rC hD iD"},J:{33:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{132:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:5,C:"CSS3 3D Transforms",D:!0}},49371:(e,t,B)=>{"use strict";let u=B(63152);class r extends u{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},49746:()=>{},49793:e=>{e.exports={A:{D:{1:"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB wC xC",33:"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"L M G KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB K D yC WC zC 0C 1C 9C",33:"E F A B C 2C XC JC"},G:{1:"RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD ID",33:"E JD KD LD MD ND OD PD QD"},P:{1:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J jD kD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration-color property",D:void 0}},49943:e=>{e.exports={A:{A:{1:"F A B",2:"K D E sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",33:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC wC xC"},D:{1:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{1:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC",2:"F"},G:{2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{1:"I hD iD",2:"PC J dD eD fD gD rC"},J:{1:"A",2:"D"},K:{1:"C H qC KC",16:"A B JC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",33:"wD"}},B:5,C:"::selection CSS pseudo-element",D:!0}},50526:(e,t,B)=>{let u=B(57441);class r extends u{set(e,t){let B=e.value.toLowerCase();return"-webkit-"!==t||B.includes(" ")||"contain"===B||"cover"===B||(e.value=e.value+" "+e.value),super.set(e,t)}}r.names=["background-size"],e.exports=r},50680:(e,t,B)=>{"use strict";t.__esModule=!0;var u=B(11581);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===u[e]||(t[e]=u[e]))});var r=B(74451);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||(t[e]=r[e]))});var s=B(58500);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||(t[e]=s[e]))})},50933:e=>{e.exports={A:{A:{132:"K D E F A B sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB wC xC",322:"dB eB fB gB hB"},D:{1:"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"J UB K",16:"D",33:"1 2 3 4 5 6 7 8 9 E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},E:{1:"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J yC WC",16:"UB",33:"K D E F A zC 0C 1C 2C XC"},F:{1:"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB"},G:{1:"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",16:"WC FD rC",33:"E GD HD ID JD KD LD MD ND"},H:{2:"cD"},I:{1:"I",2:"dD eD fD",33:"PC J gD rC hD iD"},J:{33:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{36:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",33:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:2,C:"CSS writing-mode property",D:!0}},52636:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{2:"C L M G N O P",33:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{2:"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{2:"J UB K D E F A B C L M G N",33:"0 1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{1:"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC",33:"K D E F zC 0C 1C 2C"},F:{2:"F B C AD BD CD DD JC qC ED KC",33:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{1:"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC",33:"E GD HD ID JD KD LD"},H:{2:"cD"},I:{2:"PC J dD eD fD gD rC",33:"I hD iD"},J:{2:"D A"},K:{2:"A B C JC qC KC",33:"H"},L:{33:"I"},M:{2:"IC"},N:{2:"A B"},O:{33:"LC"},P:{33:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{33:"uD"},R:{33:"vD"},S:{2:"wD xD"}},B:4,C:"CSS Cross-Fade Function",D:!0}},52682:(e,t,B)=>{"use strict";const u=B(85616),r=B(46892),s=B(44817),n=r.newObjectInRealm,C=r.implSymbol,i=r.ctorRegistrySymbol,o="URLSearchParams";function a(e,t){let B;return void 0!==t&&(B=t.prototype),r.isObject(B)||(B=e[i].URLSearchParams.prototype),Object.create(B)}t.is=e=>r.isObject(e)&&r.hasOwn(e,C)&&e[C]instanceof D.implementation,t.isImpl=e=>r.isObject(e)&&e instanceof D.implementation,t.convert=(e,B,{context:u="The provided value"}={})=>{if(t.is(B))return r.implForWrapper(B);throw new e.TypeError(`${u} is not of type 'URLSearchParams'.`)},t.createDefaultIterator=(e,t,B)=>{const u=e[i]["URLSearchParams Iterator"],s=Object.create(u);return Object.defineProperty(s,r.iterInternalSymbol,{value:{target:t,kind:B,index:0},configurable:!0}),s},t.create=(e,B,u)=>{const r=a(e);return t.setup(r,e,B,u)},t.createImpl=(e,B,u)=>{const s=t.create(e,B,u);return r.implForWrapper(s)},t._internalSetup=(e,t)=>{},t.setup=(e,B,u=[],s={})=>(s.wrapper=e,t._internalSetup(e,B),Object.defineProperty(e,C,{value:new D.implementation(B,u,s),configurable:!0}),e[C][r.wrapperSymbol]=e,D.init&&D.init(e[C]),e),t.new=(e,B)=>{const u=a(e,B);return t._internalSetup(u,e),Object.defineProperty(u,C,{value:Object.create(D.implementation.prototype),configurable:!0}),u[C][r.wrapperSymbol]=u,D.init&&D.init(u[C]),u[C]};const l=new Set(["Window","Worker"]);t.install=(e,B)=>{if(!B.some(e=>l.has(e)))return;const i=r.initCtorRegistry(e);class a{constructor(){const B=[];{let t=arguments[0];if(void 0!==t)if(r.isObject(t))if(void 0!==t[Symbol.iterator]){if(!r.isObject(t))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");{const B=[],s=t;for(let t of s){if(!r.isObject(t))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");{const B=[],r=t;for(let t of r)t=u.USVString(t,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:e}),B.push(t);t=B}B.push(t)}t=B}}else{if(!r.isObject(t))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");{const B=Object.create(null);for(const r of Reflect.ownKeys(t)){const s=Object.getOwnPropertyDescriptor(t,r);if(s&&s.enumerable){let s=r;s=u.USVString(s,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:e});let n=t[r];n=u.USVString(n,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:e}),B[s]=n}}t=B}}else t=u.USVString(t,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:e});else t="";B.push(t)}return t.setup(Object.create(new.target.prototype),e,B)}append(B,s){const n=null!=this?this:e;if(!t.is(n))throw new e.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new e.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);const i=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:e}),i.push(t)}{let t=arguments[1];t=u.USVString(t,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:e}),i.push(t)}return r.tryWrapperForImpl(n[C].append(...i))}delete(B){const s=null!=this?this:e;if(!t.is(s))throw new e.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const n=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:e}),n.push(t)}{let t=arguments[1];void 0!==t&&(t=u.USVString(t,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:e})),n.push(t)}return r.tryWrapperForImpl(s[C].delete(...n))}get(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const s=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:e}),s.push(t)}return r[C].get(...s)}getAll(B){const s=null!=this?this:e;if(!t.is(s))throw new e.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const n=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:e}),n.push(t)}return r.tryWrapperForImpl(s[C].getAll(...n))}has(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const s=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:e}),s.push(t)}{let t=arguments[1];void 0!==t&&(t=u.USVString(t,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:e})),s.push(t)}return r[C].has(...s)}set(B,s){const n=null!=this?this:e;if(!t.is(n))throw new e.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new e.TypeError(`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);const i=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:e}),i.push(t)}{let t=arguments[1];t=u.USVString(t,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:e}),i.push(t)}return r.tryWrapperForImpl(n[C].set(...i))}sort(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return r.tryWrapperForImpl(B[C].sort())}toString(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return B[C].toString()}keys(){if(!t.is(this))throw new e.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return t.createDefaultIterator(e,this,"key")}values(){if(!t.is(this))throw new e.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return t.createDefaultIterator(e,this,"value")}entries(){if(!t.is(this))throw new e.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return t.createDefaultIterator(e,this,"key+value")}forEach(B){if(!t.is(this))throw new e.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");B=s.convert(e,B,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});const u=arguments[1];let n=Array.from(this[C]),i=0;for(;i=i.length)return n(e,{value:void 0,done:!0});const o=i[s];return t.index=s+1,n(e,r.iteratorResult(o.map(r.tryWrapperForImpl),u))}}),Object.defineProperty(e,o,{configurable:!0,writable:!0,value:a})};const D=B(68549)},52762:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",1028:"L M G N O P",1346:"C"},C:{1:"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC",196:"bB",516:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB xC"},D:{1:"0 uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"J UB K D E F A B C L M G N O",33:"1 2 3 4 5 6 7 8 9 P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},E:{1:"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC zC",33:"K D E F 0C 1C"},F:{1:"0 hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB"},G:{1:"LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",33:"E HD ID JD KD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC",33:"hD iD"},J:{2:"D",33:"A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD",33:"J jD kD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:5,C:"CSS Filter Effects",D:!0}},52952:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{normalize(){return"justify-content"}prefixed(e,t){let B;return[B,t]=r(t),2009===B?t+"box-pack":2012===B?t+"flex-pack":super.prefixed(e,t)}set(e,t){let B=r(t)[0];if(2009===B||2012===B){let u=s.oldValues[e.value]||e.value;if(e.value=u,2009!==B||"distribute"!==u)return super.set(e,t)}else if("final"===B)return super.set(e,t)}}s.names=["justify-content","flex-pack","box-pack"],s.oldValues={"flex-end":"end","flex-start":"start","space-around":"distribute","space-between":"justify"},e.exports=s},53614:(e,t,B)=>{"use strict";let u=B(48633),r=B(49746);class s extends Error{constructor(e,t,B,u,r,n){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),u&&(this.source=u),n&&(this.plugin=n),void 0!==t&&void 0!==B&&("number"==typeof t?(this.line=t,this.column=B):(this.line=t.line,this.column=t.column,this.endLine=B.line,this.endColumn=B.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=u.isColorSupported);let B=e=>e,s=e=>e,n=e=>e;if(e){let{bold:e,gray:t,red:C}=u.createColors(!0);s=t=>e(C(t)),B=e=>t(e),r&&(n=e=>r(e))}let C=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,C.length),a=String(o).length;return C.slice(i,o).map((e,t)=>{let u=i+1+t,r=" "+(" "+u).slice(-a)+" | ";if(u===this.line){if(e.length>160){let t=20,u=Math.max(0,this.column-t),C=Math.max(this.column+t,this.endColumn+t),i=e.slice(u,C),o=B(r.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return s(">")+B(r)+n(i)+"\n "+o+s("^")}let t=B(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+B(r)+n(e)+"\n "+t+s("^")}return" "+B(r)+n(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=s,s.default=s},55103:(e,t,B)=>{let u=B(12895).list,r=B(5180);class s extends r{replace(e,t){return u.space(e).map(e=>{if(e.slice(0,+this.name.length+1)!==this.name+"(")return e;let B=e.lastIndexOf(")"),u=e.slice(B+1),r=e.slice(this.name.length+1,B);if("-webkit-"===t){let e=r.match(/\d*.?\d+%?/);e?(r=r.slice(e[0].length).trim(),r+=`, ${e[0]}`):r+=", 0.5"}return t+this.name+"("+r+")"+u}).join(" ")}}s.names=["cross-fade"],e.exports=s},55661:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB wC xC",194:"fB gB hB"},D:{1:"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},E:{1:"M G 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D E F yC WC zC 0C 1C 2C",16:"A",33:"B C L XC JC KC 3C"},F:{1:"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC"},G:{1:"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD KD LD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:2,C:"CSS text-orientation",D:!0}},56080:e=>{e.exports={A:{A:{2:"K D E F sC",292:"A B"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC xC",164:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB"},D:{1:"0 oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D E yC WC zC 0C 1C"},F:{1:"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB AD BD CD DD JC qC ED KC"},G:{1:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",164:"wD"}},B:5,C:":placeholder-shown CSS pseudo-class",D:!0}},56438:e=>{e.exports={0:"117",1:"20",2:"21",3:"22",4:"23",5:"24",6:"25",7:"26",8:"27",9:"28",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"80",I:"138",J:"4",K:"6",L:"13",M:"14",N:"16",O:"17",P:"18",Q:"79",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"96",g:"97",h:"98",i:"99",j:"100",k:"101",l:"102",m:"103",n:"104",o:"105",p:"106",q:"107",r:"108",s:"109",t:"110",u:"111",v:"112",w:"113",x:"114",y:"115",z:"116",AB:"118",BB:"119",CB:"120",DB:"121",EB:"122",FB:"123",GB:"124",HB:"125",IB:"126",JB:"127",KB:"128",LB:"129",MB:"130",NB:"131",OB:"132",PB:"133",QB:"134",RB:"135",SB:"136",TB:"137",UB:"5",VB:"19",WB:"29",XB:"30",YB:"31",ZB:"32",aB:"33",bB:"34",cB:"35",dB:"36",eB:"37",fB:"38",gB:"39",hB:"40",iB:"41",jB:"42",kB:"43",lB:"44",mB:"45",nB:"46",oB:"47",pB:"48",qB:"49",rB:"50",sB:"51",tB:"52",uB:"53",vB:"54",wB:"55",xB:"56",yB:"57",zB:"58","0B":"60","1B":"62","2B":"63","3B":"64","4B":"65","5B":"66","6B":"67","7B":"68","8B":"69","9B":"70",AC:"71",BC:"72",CC:"73",DC:"74",EC:"75",FC:"76",GC:"77",HC:"78",IC:"140",JC:"11.1",KC:"12.1",LC:"15.5",MC:"16.0",NC:"17.0",OC:"18.0",PC:"3",QC:"59",RC:"61",SC:"82",TC:"139",UC:"141",VC:"142",WC:"3.2",XC:"10.1",YC:"15.2-15.3",ZC:"15.4",aC:"16.1",bC:"16.2",cC:"16.3",dC:"16.4",eC:"16.5",fC:"17.1",gC:"17.2",hC:"17.3",iC:"17.4",jC:"17.5",kC:"18.1",lC:"18.2",mC:"18.3",nC:"18.4",oC:"18.5-18.6",pC:"26.0",qC:"11.5",rC:"4.2-4.3",sC:"5.5",tC:"2",uC:"143",vC:"144",wC:"3.5",xC:"3.6",yC:"3.1",zC:"5.1","0C":"6.1","1C":"7.1","2C":"9.1","3C":"13.1","4C":"14.1","5C":"15.1","6C":"15.6","7C":"16.6","8C":"17.6","9C":"TP",AD:"9.5-9.6",BD:"10.0-10.1",CD:"10.5",DD:"10.6",ED:"11.6",FD:"4.0-4.1",GD:"5.0-5.1",HD:"6.0-6.1",ID:"7.0-7.1",JD:"8.1-8.4",KD:"9.0-9.2",LD:"9.3",MD:"10.0-10.2",ND:"10.3",OD:"11.0-11.2",PD:"11.3-11.4",QD:"12.0-12.1",RD:"12.2-12.5",SD:"13.0-13.1",TD:"13.2",UD:"13.3",VD:"13.4-13.7",WD:"14.0-14.4",XD:"14.5-14.8",YD:"15.0-15.1",ZD:"15.6-15.8",aD:"16.6-16.7",bD:"17.6-17.7",cD:"all",dD:"2.1",eD:"2.2",fD:"2.3",gD:"4.1",hD:"4.4",iD:"4.4.3-4.4.4",jD:"5.0-5.4",kD:"6.2-6.4",lD:"7.2-7.4",mD:"8.2",nD:"9.2",oD:"11.1-11.2",pD:"12.0",qD:"13.0",rD:"14.0",sD:"15.0",tD:"19.0",uD:"14.9",vD:"13.52",wD:"2.5",xD:"3.0-3.1"}},57441:(e,t,B)=>{let u=B(84328),r=B(76134),s=B(87880);e.exports=class extends r{add(e,t,B,u){let r=this.prefixed(e.prop,t);if(!this.isAlready(e,r)&&!this.otherPrefixes(e.value,t))return this.insert(e,t,B,u)}calcBefore(e,t,B=""){let u=this.maxPrefixed(e,t)-s.removeNote(B).length,r=t.raw("before");return u>0&&(r+=Array(u).fill(" ").join("")),r}check(){return!0}insert(e,t,B){let u=this.set(this.clone(e),t);if(u)return e.parent.some(e=>e.prop===u.prop&&e.value===u.value)?void 0:(this.needCascade(e)&&(u.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,u))}isAlready(e,t){let B=this.all.group(e).up(e=>e.prop===t);return B||(B=this.all.group(e).down(e=>e.prop===t)),B}maxPrefixed(e,t){if(t._autoprefixerMax)return t._autoprefixerMax;let B=0;for(let t of e)t=s.removeNote(t),t.length>B&&(B=t.length);return t._autoprefixerMax=B,t._autoprefixerMax}needCascade(e){return e._autoprefixerCascade||(e._autoprefixerCascade=!1!==this.all.options.cascade&&e.raw("before").includes("\n")),e._autoprefixerCascade}normalize(e){return e}old(e,t){return[this.prefixed(e,t)]}otherPrefixes(e,t){for(let B of u.prefixes())if(B!==t&&e.includes(B))return e.replace(/var\([^)]+\)/,"").includes(B);return!1}prefixed(e,t){return t+e}process(e,t){if(!this.needCascade(e))return void super.process(e,t);let B=super.process(e,t);B&&B.length&&(this.restoreBefore(e),e.raws.before=this.calcBefore(B,e))}restoreBefore(e){let t=e.raw("before").split("\n"),B=t[t.length-1];this.all.group(e).up(e=>{let t=e.raw("before").split("\n"),u=t[t.length-1];u.length{let u=B(57441),r=B(59941);class s extends u{check(e){return e.parent&&!e.parent.some(e=>e.prop&&e.prop.startsWith("grid-"))}normalize(){return"align-self"}prefixed(e,t){let B;return[B,t]=r(t),2012===B?t+"flex-item-align":super.prefixed(e,t)}set(e,t){let B=r(t)[0];return 2012===B?(e.value=s.oldValues[e.value]||e.value,super.set(e,t)):"final"===B?super.set(e,t):void 0}}s.names=["align-self","flex-item-align"],s.oldValues={"flex-end":"end","flex-start":"start"},e.exports=s},58312:(e,t,B)=>{let u=B(57441);const r=["none","underline","overline","line-through","blink","inherit","initial","unset"];class s extends u{check(e){return e.value.split(/\s+/).some(e=>!r.includes(e))}}s.names=["text-decoration"],e.exports=s},58354:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){var t="",B=e.indexOf("/*"),u=0;for(;B>=0;){t+=e.slice(u,B);var r=e.indexOf("*/",B+2);if(r<0)return t;u=r+2,B=e.indexOf("/*",u)}return t+=e.slice(u)},e.exports=t.default},58408:(e,t,B)=>{"use strict";var u=B(93775).TextEncoder,r=B(93775).TextDecoder;const s=new u,n=new r("utf-8",{ignoreBOM:!0});e.exports={utf8Encode:function(e){return s.encode(e)},utf8DecodeWithoutBOM:function(e){return n.decode(e)}}},58500:(e,t,B)=>{"use strict";t.__esModule=!0,t.isComment=t.isCombinator=t.isClassName=t.isAttribute=void 0,t.isContainer=function(e){return!(!n(e)||!e.walk)},t.isIdentifier=void 0,t.isNamespace=function(e){return i(e)||A(e)},t.isNesting=void 0,t.isNode=n,t.isPseudo=void 0,t.isPseudoClass=function(e){return p(e)&&!E(e)},t.isPseudoElement=E,t.isUniversal=t.isTag=t.isString=t.isSelector=t.isRoot=void 0;var u,r=B(11581),s=((u={})[r.ATTRIBUTE]=!0,u[r.CLASS]=!0,u[r.COMBINATOR]=!0,u[r.COMMENT]=!0,u[r.ID]=!0,u[r.NESTING]=!0,u[r.PSEUDO]=!0,u[r.ROOT]=!0,u[r.SELECTOR]=!0,u[r.STRING]=!0,u[r.TAG]=!0,u[r.UNIVERSAL]=!0,u);function n(e){return"object"==typeof e&&s[e.type]}function C(e,t){return n(t)&&t.type===e}var i=C.bind(null,r.ATTRIBUTE);t.isAttribute=i;var o=C.bind(null,r.CLASS);t.isClassName=o;var a=C.bind(null,r.COMBINATOR);t.isCombinator=a;var l=C.bind(null,r.COMMENT);t.isComment=l;var D=C.bind(null,r.ID);t.isIdentifier=D;var c=C.bind(null,r.NESTING);t.isNesting=c;var p=C.bind(null,r.PSEUDO);t.isPseudo=p;var f=C.bind(null,r.ROOT);t.isRoot=f;var d=C.bind(null,r.SELECTOR);t.isSelector=d;var h=C.bind(null,r.STRING);t.isString=h;var A=C.bind(null,r.TAG);t.isTag=A;var m=C.bind(null,r.UNIVERSAL);function E(e){return p(e)&&e.value&&(e.value.startsWith("::")||":before"===e.value.toLowerCase()||":after"===e.value.toLowerCase()||":first-letter"===e.value.toLowerCase()||":first-line"===e.value.toLowerCase())}t.isUniversal=m},58514:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{insert(e,t,B){let u;if([u,t]=r(t),2009!==u)return super.insert(e,t,B);let s=e.value.split(/\s+/).filter(e=>"wrap"!==e&&"nowrap"!==e&&"wrap-reverse");if(0===s.length)return;if(e.parent.some(e=>e.prop===t+"box-orient"||e.prop===t+"box-direction"))return;let n=s[0],C=n.includes("row")?"horizontal":"vertical",i=n.includes("reverse")?"reverse":"normal",o=this.clone(e);return o.prop=t+"box-orient",o.value=C,this.needCascade(e)&&(o.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,o),o=this.clone(e),o.prop=t+"box-direction",o.value=i,this.needCascade(e)&&(o.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,o)}}s.names=["flex-flow","box-direction","box-orient"],e.exports=s},58809:e=>{var t="(".charCodeAt(0),B=")".charCodeAt(0),u="'".charCodeAt(0),r='"'.charCodeAt(0),s="\\".charCodeAt(0),n="/".charCodeAt(0),C=",".charCodeAt(0),i=":".charCodeAt(0),o="*".charCodeAt(0),a="u".charCodeAt(0),l="U".charCodeAt(0),D="+".charCodeAt(0),c=/^[a-f0-9?-]+$/i;e.exports=function(e){for(var p,f,d,h,A,m,E,F,v,g=[],b=e,y=0,w=b.charCodeAt(y),x=b.length,S=[{nodes:g}],k=0,j="",O="",I="";y{e.exports={A:{A:{1:"E F A B",8:"K D sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",33:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{1:"0 1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"J UB K D E F"},E:{1:"K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"J UB yC WC"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC",2:"F"},G:{1:"E GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"WC FD rC"},H:{1:"cD"},I:{1:"J I gD rC hD iD",33:"PC dD eD fD"},J:{1:"A",33:"D"},K:{1:"A B C H JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:5,C:"CSS3 Box-sizing",D:!0}},59902:(e,t,B)=>{let u=B(25482),r=B(12895).list,s=B(87880).uniq,n=B(87880).escapeRegexp,C=B(87880).splitSelector;function i(e){return e&&2===e.length&&"span"===e[0]&&parseInt(e[1],10)>0?[!1,parseInt(e[1],10)]:e&&1===e.length&&parseInt(e[0],10)>0?[parseInt(e[0],10),!1]:[!1,!1]}function o({nodes:e},{gap:t}){let{count:B,size:r}=e.reduce((e,t)=>("div"===t.type&&","===t.value?e.key="size":e[e.key].push(u.stringify(t)),e),{count:[],key:"count",size:[]});if(t){r=r.filter(e=>e.trim());let e=[];for(let u=1;u<=B;u++)r.forEach((B,r)=>{(r>0||u>1)&&e.push(t),e.push(B)});return e.join(" ")}return`(${r.join("")})[${B.join("")}]`}function a({gap:e,value:t}){let B=u(t).nodes.reduce((t,B)=>"function"===B.type&&"repeat"===B.value?t.concat({type:"word",value:o(B,{gap:e})}):e&&"space"===B.type?t.concat({type:"space",value:" "},{type:"word",value:e},B):t.concat(B),[]);return u.stringify(B)}t.translate=function(e,t,B){let u=e[t],r=e[B];if(!u)return[!1,!1];let[s,n]=i(u),[C,o]=i(r);if(s&&!r)return[s,!1];if(n&&C)return[C-n,n];if(s&&o)return[s,o];if(s&&C)return[s,C-s];return[!1,!1]},t.parse=function(e){let t=u(e.value),B=[],r=0;B[r]=[];for(let e of t.nodes)"div"===e.type?(r+=1,B[r]=[]):"word"===e.type&&B[r].push(e.value);return B},t.insertDecl=function(e,t,B){B&&!e.parent.some(e=>e.prop===`-ms-${t}`)&&e.cloneBefore({prop:`-ms-${t}`,value:B.toString()})},t.prefixTrackProp=function({prefix:e,prop:t}){return e+t.replace("template-","")},t.prefixTrackValue=a;let l=/^\.+$/;function D(e,t){return{end:t,span:t-e,start:e}}function c({gap:e,rows:t}){return t.reduce((t,B,u)=>(e.row&&(u*=2),""===B.trim()||function(e){return e.trim().split(/\s+/g)}(B).forEach((B,r)=>{if(!l.test(B))if(e.column&&(r*=2),void 0===t[B])t[B]={column:D(r+1,r+2),row:D(u+1,u+2)};else{let{column:e,row:s}=t[B];e.start=Math.min(e.start,r+1),e.end=Math.max(e.end,r+2),e.span=e.end-e.start,s.start=Math.min(s.start,u+1),s.end=Math.max(s.end,u+2),s.span=s.end-s.start}}),t),{})}function p(e){return e.areas.length>e.rows.length&&e.rows.push("auto"),e}function f({decl:e,gap:t}){let B=u(e.value).nodes.reduce((e,t)=>{let{type:B,value:r}=t;return function(e){return"word"===e.type&&/^\[.+]$/.test(e.value)}(t)||"space"===B||("string"===B&&(e=p(e)).areas.push(r),"word"!==B&&"function"!==B||e[e.key].push(u.stringify(t)),"div"===B&&"/"===r&&(e.key="columns",e=p(e))),e},{areas:[],columns:[],key:"rows",rows:[]});return{areas:c({gap:t,rows:B.areas}),columns:a({gap:t.column,value:B.columns.join(" ")}),rows:a({gap:t.row,value:B.rows.join(" ")})}}function d(e,t=!1,B=!1){let u=[{prop:"-ms-grid-row",value:String(e.row.start)}];return(e.row.span>1||t)&&u.push({prop:"-ms-grid-row-span",value:String(e.row.span)}),u.push({prop:"-ms-grid-column",value:String(e.column.start)}),(e.column.span>1||B)&&u.push({prop:"-ms-grid-column-span",value:String(e.column.span)}),u}function h(e){return"atrule"===e.type&&"media"===e.name?e:!!e.parent&&h(e.parent)}function A(e,t){return(e=e.map(e=>{let t=r.space(e),B=r.comma(e);return t.length>B.length&&(e=t.slice(-1).join("")),e})).map(e=>t.map((t,B)=>`${0===B?"":" "}${t} > ${e}`))}function m(e,t){return e.selectors.some(e=>t.selectors.includes(e))}function E(e){let t={};return e.parent.walkDecls(/^(grid-)?((row|column)-)?gap$/,({prop:e,value:B})=>{if(/^(grid-)?gap$/.test(e)){let[e,,r]=u(B).nodes;t.row=e&&u.stringify(e),t.column=r?u.stringify(r):t.row}/^(grid-)?row-gap$/.test(e)&&(t.row=B),/^(grid-)?column-gap$/.test(e)&&(t.column=B)}),t}function F(e){if(!e)return[];let t,B;return u(e).walk(e=>{"word"===e.type&&/min|max/g.test(e.value)?t=e.value:e.value.includes("px")&&(B=parseInt(e.value.replace(/\D/g,"")))}),[t,B]}function v(e,t){let B=e.parent,u=h(B),r=B.root(),s=C(B.selector);if(Object.keys(t).length>0)return!1;let i,[o]=F(u.params),a=s[0],l=n(a[a.length-1][0]),D=new RegExp(`(${l}$)|(${l}[,.])`);return r.walkRules(D,e=>{let t;if(B.toString()===e.toString())return!1;if(e.walkDecls("grid-gap",e=>t=E(e)),!t||0===Object.keys(t).length)return!0;if(!function(e,t){let B,u=C(e),r=C(t);if(u[0].lengthr[0].length){let e=u[0].reduce((e,[t],B)=>t===r[0][0][0]&&B,!1);e&&(B=r[0].every((t,B)=>t.every((t,r)=>u[0].slice(e)[B][r]===t)))}else B=r.some(e=>e.every((e,t)=>e.every((e,B)=>u[0][t][B]===e)));return B}(B.selector,e.selector))return!0;let u=h(e);if(!u)return i=t,!0;if(F(u.params)[0]===o)return i=t,!0}),!!(i&&Object.keys(i).length>0)&&i}function g(e){return u(e).nodes.reduce((e,t)=>{if("function"===t.type&&"repeat"===t.value){let B="count",[r,s]=t.nodes.reduce((e,t)=>"word"===t.type&&"count"===B?(e[0]=Math.abs(parseInt(t.value)),e):"div"===t.type&&","===t.value?(B="value",e):("value"===B&&(e[1]+=u.stringify(t)),e),[0,""]);if(r)for(let t=0;t{let B=e.parent,u=h(B),r=E(e),n=v(e,r),{areas:C}=f({decl:e,gap:n||r}),i=Object.keys(C);if(0===i.length)return!0;let o=t.reduce((e,{allAreas:t},B)=>t&&i.some(e=>t.includes(e))?B:e,null);if(null!==o){let{allAreas:e,rules:r}=t[o],n=r.some(e=>!1===e.hasDuplicates&&m(e,B)),a=!1,l=r.reduce((e,t)=>!t.params&&m(t,B)?(a=!0,t.duplicateAreaNames):(a||i.forEach(B=>{t.areas[B]&&e.push(B)}),s(e)),[]);r.forEach(e=>{i.forEach(t=>{let B=e.areas[t];B&&B.row.span!==C[t].row.span&&(C[t].row.updateSpan=!0),B&&B.column.span!==C[t].column.span&&(C[t].column.updateSpan=!0)})}),t[o].allAreas=s([...e,...i]),t[o].rules.push({areas:C,duplicateAreaNames:l,hasDuplicates:!n,node:B,params:u.params,selectors:B.selectors})}else t.push({allAreas:i,areasCount:0,rules:[{areas:C,duplicateAreaNames:[],duplicateRules:[],hasDuplicates:!1,node:B,params:u.params,selectors:B.selectors}]})}),t}(e);if(0===B.length)return;let u={};return e.walkDecls("grid-area",s=>{let n=s.parent,C="-ms-grid-row"===n.first.prop,i=h(n);if(t(s))return;let o=e.index(i||n),a=s.value,l=B.filter(e=>e.allAreas.includes(a))[0];if(!l)return!0;let D=l.allAreas[l.allAreas.length-1],c=r.space(n.selector),p=r.comma(n.selector),f=c.length>1&&c.length>p.length;if(C)return!1;u[D]||(u[D]={});let m=!1;for(let t of l.rules){let B=t.areas[a],r=t.duplicateAreaNames.includes(a);if(!B){let t,B=u[D].lastRule;t=B?e.index(B):-1,o>t&&(u[D].lastRule=i||n);continue}if(t.params&&!u[D][t.params]&&(u[D][t.params]=[]),t.hasDuplicates&&r||t.params)if(!t.hasDuplicates||t.params||f){if(t.hasDuplicates&&!t.params&&f&&n.selector.includes(t.selectors[0]))n.walkDecls(/-ms-grid-(row|column)/,e=>e.remove()),d(B,B.row.updateSpan,B.column.updateSpan).reverse().forEach(e=>n.prepend(Object.assign(e,{raws:{between:s.raws.between}})));else if(t.params){let C=n.clone();C.removeAll(),d(B,B.row.updateSpan,B.column.updateSpan).reverse().forEach(e=>C.prepend(Object.assign(e,{raws:{between:s.raws.between}}))),t.hasDuplicates&&r&&(C.selectors=A(C.selectors,t.selectors)),C.raws=t.node.raws,e.index(t.node.parent)>o?t.node.parent.append(C):u[D][t.params].push(C),m||(u[D].lastRule=i||n)}}else{let e=n.clone();e.removeAll(),d(B,B.row.updateSpan,B.column.updateSpan).reverse().forEach(t=>e.prepend(Object.assign(t,{raws:{between:s.raws.between}}))),e.selectors=A(e.selectors,t.selectors),u[D].lastRule&&u[D].lastRule.after(e),u[D].lastRule=e,m=!0}else d(B,!1,!1).reverse().forEach(e=>n.prepend(Object.assign(e,{raws:{between:s.raws.between}}))),u[D].lastRule=n,m=!0}}),void Object.keys(u).forEach(e=>{let t=u[e],B=t.lastRule;Object.keys(t).reverse().filter(e=>"lastRule"!==e).forEach(e=>{t[e].length>0&&B&&(B.after({name:"media",params:e}),B.next().append(t[e]))})})},t.warnMissedAreas=function(e,t,B){let u=Object.keys(e);t.root().walkDecls("grid-area",e=>{u=u.filter(t=>t!==e.value)}),u.length>0&&t.warn(B,"Can not find grid areas: "+u.join(", "));return},t.warnTemplateSelectorNotFound=function(e,t){let B=e.parent,u=e.root(),s=!1,n=r.space(B.selector).filter(e=>">"!==e).slice(0,-1);if(n.length>0){let B=!1,C=null;u.walkDecls(/grid-template(-areas)?$/,t=>{let u=t.parent,i=u.selectors,{areas:o}=f({decl:t,gap:E(t)}),a=o[e.value];for(let e of i){if(B)break;let t=r.space(e).filter(e=>">"!==e);B=t.every((e,t)=>e===n[t])}if(B||!a)return!0;C||(C=u.selector),C&&C!==u.selector&&(s=!0)}),!B&&s&&e.warn(t,`Autoprefixer cannot find a grid-template containing the duplicate grid-area "${e.value}" with full selector matching: ${n.join(" ")}`)}},t.warnIfGridRowColumnExists=function(e,t){let B=e.parent,u=[];B.walkDecls(/^grid-(row|column)/,e=>{e.prop.endsWith("-end")||e.value.startsWith("span")||e.prop.endsWith("-gap")||u.push(e)}),u.length>0&&u.forEach(e=>{e.warn(t,`You already have a grid-area declaration present in the rule. You should use either grid-area or ${e.prop}, not both`)});return},t.getGridGap=E,t.inheritGridGap=v,t.warnGridGap=function({decl:e,gap:t,hasColumns:B,result:u}){let r=t.row&&t.column;!B&&(r||t.column&&!t.row)&&(delete t.column,e.warn(u,"Can not implement grid-gap without grid-template-columns"))},t.autoplaceGridItems=function(e,t,B,u="row"){let{parent:r}=e,s=g(r.nodes.find(e=>"grid-template-rows"===e.prop).value),n=g(e.value),C=s.map((e,t)=>Array.from({length:n.length},(e,B)=>B+t*n.length+1).join(" ")),i=c({gap:B,rows:C}),o=Object.keys(i),a=o.map(e=>i[e]);u.includes("column")&&(a=a.sort((e,t)=>e.column.start-t.column.start));return void a.reverse().forEach((e,t)=>{let{column:B,row:u}=e,s=r.selectors.map(e=>e+` > *:nth-child(${o.length-t})`).join(", "),n=r.clone().removeAll();n.selector=s,n.append({prop:"-ms-grid-row",value:u.start}),n.append({prop:"-ms-grid-column",value:B.start}),r.after(n)})}},59911:e=>{e.exports={A:{D:{1:"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB K D E F wC xC",33:"1 2 3 4 5 6 7 8 9 A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB yC WC zC 9C",33:"K D E F A 0C 1C 2C XC"},G:{1:"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",33:"E HD ID JD KD LD MD ND"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"}},B:6,C:"plaintext from unicode-bidi",D:void 0}},59941:e=>{e.exports=function(e){let t;return"-webkit- 2009"===e||"-moz-"===e?t=2009:"-ms-"===e?t=2012:"-webkit-"===e&&(t="final"),"-webkit- 2009"===e&&(e="-webkit-"),[t,e]}},60038:e=>{"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},61106:(e,t,B)=>{"use strict";let{nanoid:u}=B(95042),{isAbsolute:r,resolve:s}=B(197),{SourceMapConsumer:n,SourceMapGenerator:C}=B(21866),{fileURLToPath:i,pathToFileURL:o}=B(75833),a=B(53614),l=B(93878),D=B(49746),c=Symbol("lineToIndexCache"),p=Boolean(n&&C),f=Boolean(s&&r);function d(e){if(e[c])return e[c];let t=e.css.split("\n"),B=new Array(t.length),u=0;for(let e=0,r=t.length;e"),this.map&&(this.map.file=this.from)}error(e,t,B,u={}){let r,s,n,C,i;if(t&&"object"==typeof t){let e=t,u=B;if("number"==typeof e.offset){C=e.offset;let u=this.fromOffset(C);t=u.line,B=u.col}else t=e.line,B=e.column,C=this.fromLineAndColumn(t,B);if("number"==typeof u.offset){n=u.offset;let e=this.fromOffset(n);s=e.line,r=e.col}else s=u.line,r=u.column,n=this.fromLineAndColumn(u.line,u.column)}else if(B)C=this.fromLineAndColumn(t,B);else{C=t;let e=this.fromOffset(C);t=e.line,B=e.col}let l=this.origin(t,B,s,r);return i=l?new a(e,void 0===l.endLine?l.line:{column:l.column,line:l.line},void 0===l.endLine?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,u.plugin):new a(e,void 0===s?t:{column:B,line:t},void 0===s?B:{column:r,line:s},this.css,this.file,u.plugin),i.input={column:B,endColumn:r,endLine:s,endOffset:n,line:t,offset:C,source:this.css},this.file&&(o&&(i.input.url=o(this.file).toString()),i.input.file=this.file),i}fromLineAndColumn(e,t){return d(this)[e-1]+t-1}fromOffset(e){let t=d(this),B=0;if(e>=t[t.length-1])B=t.length-1;else{let u,r=t.length-2;for(;B>1),e=t[u+1])){B=u;break}B=u+1}}return{col:e-t[B]+1,line:B+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,B,u){if(!this.map)return!1;let s,n,C=this.map.consumer(),a=C.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof B&&(s=C.originalPositionFor({column:u,line:B})),n=r(a.source)?o(a.source):new URL(a.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:n.toString()};if("file:"===n.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");l.file=i(n)}let D=C.sourceContentFor(a.source);return D&&(l.source=D),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}e.exports=h,h.default=h,D&&D.registerInput&&D.registerInput(h)},61534:(e,t,B)=>{"use strict";let u=B(77793),r=B(81752);class s extends u{get selectors(){return r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,B=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(B)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=s,s.default=s,u.registerRule(s)},62660:(e,t,B)=>{e.exports.browsers=B(90562)},62761:e=>{e.exports={A:{D:{1:"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB wC xC"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB AD BD CD DD JC qC ED KC"},K:{1:"H",2:"A B C JC qC KC"},E:{2:"J UB K D yC WC zC 0C 1C 9C",33:"E F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC"},G:{2:"WC FD rC GD HD ID",33:"E JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},P:{1:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J jD kD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"}},B:6,C:"text-decoration shorthand property",D:void 0}},62918:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(44646))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.NESTING,B.value="&",B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u}(r.default);t.default=C,e.exports=t.default},63152:(e,t,B)=>{"use strict";let u=B(53614),r=B(47668),s=B(83303),{isClean:n,my:C}=B(84151);function i(e,t){let B=new e.constructor;for(let u in e){if(!Object.prototype.hasOwnProperty.call(e,u))continue;if("proxyCache"===u)continue;let r=e[u],s=typeof r;"parent"===u&&"object"===s?t&&(B[u]=t):"source"===u?B[u]=r:Array.isArray(r)?B[u]=r.map(e=>i(e,B)):("object"===s&&null!==r&&(r=i(r)),B[u]=r)}return B}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let B=1,u=1,r=0;for(let s=0;s"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,B)=>(e[t]===B||(e[t]=B,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let B="document"in this.source.input?this.source.input.document:this.source.input.css,u=B.slice(o(B,this.source.start),o(B,this.source.end)).indexOf(e.word);-1!==u&&(t=this.positionInside(u))}return t}positionInside(e){let t=this.source.start.column,B=this.source.start.line,u="document"in this.source.input?this.source.input.document:this.source.input.css,r=o(u,this.source.start),s=r+e;for(let e=r;e"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof u&&u.toJSON)B[e]=u.toJSON(null,t);else if("source"===e){if(null==u)continue;let s=t.get(u.input);null==s&&(s=r,t.set(u.input,r),r++),B[e]={end:u.end,inputId:s,start:u.start}}else B[e]=u}return u&&(B.inputs=[...t.keys()].map(e=>e.toJSON())),B}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,B={}){let u={node:this};for(let e in B)u[e]=B[e];return e.warn(t,u)}}e.exports=a,a.default=a},63381:(e,t,B)=>{let u=B(99552);class r extends u{prefixed(e){return"-moz-"===e?":-moz-placeholder":"-ms-"===e?":-ms-input-placeholder":`:${e}placeholder-shown`}}r.names=[":placeholder-shown"],e.exports=r},63452:(e,t,B)=>{let u=B(5180);class r extends u{replace(e,t){let B=super.replace(e,t);return"-webkit-"===t&&(B=B.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi,"url($1)$2")),B}}r.names=["image-set"],e.exports=r},64195:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u=C(B(68937)),r=B(39606),s=C(B(44646)),n=B(11581);function C(e){return e&&e.__esModule?e:{default:e}}function i(e,t){for(var B=0;B{"use strict";t.__esModule=!0,t.default=void 0;var u,r,s=b(B(80518)),n=b(B(30339)),C=b(B(64195)),i=b(B(70425)),o=b(B(77071)),a=b(B(79720)),l=b(B(85799)),D=b(B(17324)),c=g(B(85588)),p=b(B(81669)),f=b(B(91704)),d=b(B(62918)),h=b(B(20263)),A=g(B(82648)),m=g(B(70071)),E=g(B(11581)),F=B(39606);function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,B=new WeakMap;return(v=function(e){return e?B:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var B=v(t);if(B&&B.has(e))return B.get(e);var u={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var n=r?Object.getOwnPropertyDescriptor(e,s):null;n&&(n.get||n.set)?Object.defineProperty(u,s,n):u[s]=e[s]}return u.default=e,B&&B.set(e,u),u}function b(e){return e&&e.__esModule?e:{default:e}}function y(e,t){for(var B=0;Bthis.position&&(r=this.parseWhitespaceEquivalentTokens(t)),this.isNamedCombinator()?B=this.namedCombinator():this.currToken[A.FIELDS.TYPE]===m.combinator?(B=new f.default({value:this.content(),source:O(this.currToken),sourceIndex:this.currToken[A.FIELDS.START_POS]}),this.position++):w[this.currToken[A.FIELDS.TYPE]]||r||this.unexpected(),B){if(r){var s=this.convertWhitespaceNodesToSpace(r),n=s.space,C=s.rawSpace;B.spaces.before=n,B.rawSpaceBefore=C}}else{var i=this.convertWhitespaceNodesToSpace(r,!0),o=i.space,a=i.rawSpace;a||(a=o);var l={},D={spaces:{}};o.endsWith(" ")&&a.endsWith(" ")?(l.before=o.slice(0,o.length-1),D.spaces.before=a.slice(0,a.length-1)):o.startsWith(" ")&&a.startsWith(" ")?(l.after=o.slice(1),D.spaces.after=a.slice(1)):D.value=a,B=new f.default({value:" ",source:I(u,this.tokens[this.position-1]),sourceIndex:u[A.FIELDS.START_POS],spaces:l,raws:D})}return this.currToken&&this.currToken[A.FIELDS.TYPE]===m.space&&(B.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(B)}var c=this.parseWhitespaceEquivalentTokens(t);if(c.length>0){var p=this.current.last;if(p){var d=this.convertWhitespaceNodesToSpace(c),h=d.space,E=d.rawSpace;void 0!==E&&(p.rawSpaceAfter+=E),p.spaces.after+=h}else c.forEach(function(t){return e.newNode(t)})}},r.comma=function(){if(this.position===this.tokens.length-1)return this.root.trailingComma=!0,void this.position++;this.current._inferEndPosition();var e=new n.default({source:{start:S(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][A.FIELDS.START_POS]});this.current.parent.append(e),this.current=e,this.position++},r.comment=function(){var e=this.currToken;this.newNode(new i.default({value:this.content(),source:O(e),sourceIndex:e[A.FIELDS.START_POS]})),this.position++},r.error=function(e,t){throw this.root.error(e,t)},r.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[A.FIELDS.START_POS]})},r.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[A.FIELDS.START_POS])},r.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[A.FIELDS.START_POS])},r.unexpected=function(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[A.FIELDS.START_POS])},r.unexpectedPipe=function(){return this.error("Unexpected '|'.",this.currToken[A.FIELDS.START_POS])},r.namespace=function(){var e=this.prevToken&&this.content(this.prevToken)||!0;return this.nextToken[A.FIELDS.TYPE]===m.word?(this.position++,this.word(e)):this.nextToken[A.FIELDS.TYPE]===m.asterisk?(this.position++,this.universal(e)):void this.unexpectedPipe()},r.nesting=function(){if(this.nextToken&&"|"===this.content(this.nextToken))return void this.position++;var e=this.currToken;this.newNode(new d.default({value:this.content(),source:O(e),sourceIndex:e[A.FIELDS.START_POS]})),this.position++},r.parentheses=function(){var e=this.current.last,t=1;if(this.position++,e&&e.type===E.PSEUDO){var B=new n.default({source:{start:S(this.tokens[this.position])},sourceIndex:this.tokens[this.position][A.FIELDS.START_POS]}),u=this.current;for(e.append(B),this.current=B;this.position1&&e.nextToken&&e.nextToken[A.FIELDS.TYPE]===m.openParenthesis&&e.error("Misplaced parenthesis.",{index:e.nextToken[A.FIELDS.START_POS]})}):this.expected(["pseudo-class","pseudo-element"],this.position-1)},r.space=function(){var e=this.content();0===this.position||this.prevToken[A.FIELDS.TYPE]===m.comma||this.prevToken[A.FIELDS.TYPE]===m.openParenthesis||this.current.nodes.every(function(e){return"comment"===e.type})?(this.spaces=this.optionalSpace(e),this.position++):this.position===this.tokens.length-1||this.nextToken[A.FIELDS.TYPE]===m.comma||this.nextToken[A.FIELDS.TYPE]===m.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(e),this.position++):this.combinator()},r.string=function(){var e=this.currToken;this.newNode(new l.default({value:this.content(),source:O(e),sourceIndex:e[A.FIELDS.START_POS]})),this.position++},r.universal=function(e){var t=this.nextToken;if(t&&"|"===this.content(t))return this.position++,this.namespace();var B=this.currToken;this.newNode(new p.default({value:this.content(),source:O(B),sourceIndex:B[A.FIELDS.START_POS]}),e),this.position++},r.splitWord=function(e,t){for(var B=this,u=this.nextToken,r=this.content();u&&~[m.dollar,m.caret,m.equals,m.word].indexOf(u[A.FIELDS.TYPE]);){this.position++;var s=this.content();if(r+=s,s.lastIndexOf("\\")===s.length-1){var n=this.nextToken;n&&n[A.FIELDS.TYPE]===m.space&&(r+=this.requiredSpace(this.content(n)),this.position++)}u=this.nextToken}var i=L(r,".").filter(function(e){var t="\\"===r[e-1],B=/^\d+\.\d+%$/.test(r);return!t&&!B}),l=L(r,"#").filter(function(e){return"\\"!==r[e-1]}),D=L(r,"#{");D.length&&(l=l.filter(function(e){return!~D.indexOf(e)}));var c=(0,h.default)(function(){var e=Array.prototype.concat.apply([],arguments);return e.filter(function(t,B){return B===e.indexOf(t)})}([0].concat(i,l)));c.forEach(function(u,s){var n,D=c[s+1]||r.length,p=r.slice(u,D);if(0===s&&t)return t.call(B,p,c.length);var f=B.currToken,d=f[A.FIELDS.START_POS]+c[s],h=j(f[1],f[2]+u,f[3],f[2]+(D-1));if(~i.indexOf(u)){var m={value:p.slice(1),source:h,sourceIndex:d};n=new C.default(P(m,"value"))}else if(~l.indexOf(u)){var E={value:p.slice(1),source:h,sourceIndex:d};n=new o.default(P(E,"value"))}else{var F={value:p,source:h,sourceIndex:d};P(F,"value"),n=new a.default(F)}B.newNode(n,e),e=null}),this.position++},r.word=function(e){var t=this.nextToken;return t&&"|"===this.content(t)?(this.position++,this.namespace()):this.splitWord(e)},r.loop=function(){for(;this.position{var t,B,u=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function n(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(B){try{return t.call(null,e,0)}catch(B){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{B="function"==typeof clearTimeout?clearTimeout:s}catch(e){B=s}}();var C,i=[],o=!1,a=-1;function l(){o&&C&&(o=!1,C.length?i=C.concat(i):a=-1,i.length&&D())}function D(){if(!o){var e=n(l);o=!0;for(var t=i.length;t;){for(C=i,i=[];++a1)for(var B=1;B{"use strict";const u=B(95484),r=B(85252),s=B(52682);t.implementation=class e{constructor(e,[t,B]){let r=null;if(void 0!==B&&(r=u.basicURLParse(B),null===r))throw new TypeError(`Invalid base URL: ${B}`);const n=u.basicURLParse(t,{baseURL:r});if(null===n)throw new TypeError(`Invalid URL: ${t}`);const C=null!==n.query?n.query:"";this._url=n,this._query=s.createImpl(e,[C],{doNotStripQMark:!0}),this._query._url=this}static parse(t,B,u){try{return new e(t,[B,u])}catch{return null}}static canParse(e,t){let B=null;if(void 0!==t&&(B=u.basicURLParse(t),null===B))return!1;return null!==u.basicURLParse(e,{baseURL:B})}get href(){return u.serializeURL(this._url)}set href(e){const t=u.basicURLParse(e);if(null===t)throw new TypeError(`Invalid URL: ${e}`);this._url=t,this._query._list.splice(0);const{query:B}=t;null!==B&&(this._query._list=r.parseUrlencodedString(B))}get origin(){return u.serializeURLOrigin(this._url)}get protocol(){return`${this._url.scheme}:`}set protocol(e){u.basicURLParse(`${e}:`,{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(e){u.cannotHaveAUsernamePasswordPort(this._url)||u.setTheUsername(this._url,e)}get password(){return this._url.password}set password(e){u.cannotHaveAUsernamePasswordPort(this._url)||u.setThePassword(this._url,e)}get host(){const e=this._url;return null===e.host?"":null===e.port?u.serializeHost(e.host):`${u.serializeHost(e.host)}:${u.serializeInteger(e.port)}`}set host(e){u.hasAnOpaquePath(this._url)||u.basicURLParse(e,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":u.serializeHost(this._url.host)}set hostname(e){u.hasAnOpaquePath(this._url)||u.basicURLParse(e,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":u.serializeInteger(this._url.port)}set port(e){u.cannotHaveAUsernamePasswordPort(this._url)||(""===e?this._url.port=null:u.basicURLParse(e,{url:this._url,stateOverride:"port"}))}get pathname(){return u.serializePath(this._url)}set pathname(e){u.hasAnOpaquePath(this._url)||(this._url.path=[],u.basicURLParse(e,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":`?${this._url.query}`}set search(e){const t=this._url;if(""===e)return t.query=null,void(this._query._list=[]);const B="?"===e[0]?e.substring(1):e;t.query="",u.basicURLParse(B,{url:t,stateOverride:"query"}),this._query._list=r.parseUrlencodedString(B)}get searchParams(){return this._query}get hash(){return null===this._url.fragment||""===this._url.fragment?"":`#${this._url.fragment}`}set hash(e){if(""===e)return void(this._url.fragment=null);const t="#"===e[0]?e.substring(1):e;this._url.fragment="",u.basicURLParse(t,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},67160:e=>{e.exports={A:{A:{1:"F A B",2:"K D E sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC",36:"xC"},D:{1:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",516:"J UB K D E F A B C L M"},E:{1:"D E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",772:"J UB K yC WC zC 0C"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z CD DD JC qC ED KC",2:"F AD",36:"BD"},G:{1:"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",4:"WC FD rC HD",516:"GD"},H:{132:"cD"},I:{1:"I hD iD",36:"dD",516:"PC J gD rC",548:"eD fD"},J:{1:"D A"},K:{1:"A B C H JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS3 Background-image options",D:!0}},68093:e=>{e.exports={"0.20":"39",.21:"41",.22:"41",.23:"41",.24:"41",.25:"42",.26:"42",.27:"43",.28:"43",.29:"43","0.30":"44",.31:"45",.32:"45",.33:"45",.34:"45",.35:"45",.36:"47",.37:"49","1.0":"49",1.1:"50",1.2:"51",1.3:"52",1.4:"53",1.5:"54",1.6:"56",1.7:"58",1.8:"59","2.0":"61",2.1:"61","3.0":"66",3.1:"66","4.0":"69",4.1:"69",4.2:"69","5.0":"73","6.0":"76",6.1:"76","7.0":"78",7.1:"78",7.2:"78",7.3:"78","8.0":"80",8.1:"80",8.2:"80",8.3:"80",8.4:"80",8.5:"80","9.0":"83",9.1:"83",9.2:"83",9.3:"83",9.4:"83","10.0":"85",10.1:"85",10.2:"85",10.3:"85",10.4:"85","11.0":"87",11.1:"87",11.2:"87",11.3:"87",11.4:"87",11.5:"87","12.0":"89",12.1:"89",12.2:"89","13.0":"91",13.1:"91",13.2:"91",13.3:"91",13.4:"91",13.5:"91",13.6:"91","14.0":"93",14.1:"93",14.2:"93","15.0":"94",15.1:"94",15.2:"94",15.3:"94",15.4:"94",15.5:"94","16.0":"96",16.1:"96",16.2:"96","17.0":"98",17.1:"98",17.2:"98",17.3:"98",17.4:"98","18.0":"100",18.1:"100",18.2:"100",18.3:"100","19.0":"102",19.1:"102","20.0":"104",20.1:"104",20.2:"104",20.3:"104","21.0":"106",21.1:"106",21.2:"106",21.3:"106",21.4:"106","22.0":"108",22.1:"108",22.2:"108",22.3:"108","23.0":"110",23.1:"110",23.2:"110",23.3:"110","24.0":"112",24.1:"112",24.2:"112",24.3:"112",24.4:"112",24.5:"112",24.6:"112",24.7:"112",24.8:"112","25.0":"114",25.1:"114",25.2:"114",25.3:"114",25.4:"114",25.5:"114",25.6:"114",25.7:"114",25.8:"114",25.9:"114","26.0":"116",26.1:"116",26.2:"116",26.3:"116",26.4:"116",26.5:"116",26.6:"116","27.0":"118",27.1:"118",27.2:"118",27.3:"118","28.0":"120",28.1:"120",28.2:"120",28.3:"120","29.0":"122",29.1:"122",29.2:"122",29.3:"122",29.4:"122","30.0":"124",30.1:"124",30.2:"124",30.3:"124",30.4:"124",30.5:"124","31.0":"126",31.1:"126",31.2:"126",31.3:"126",31.4:"126",31.5:"126",31.6:"126",31.7:"126","32.0":"128",32.1:"128",32.2:"128",32.3:"128","33.0":"130",33.1:"130",33.2:"130",33.3:"130",33.4:"130","34.0":"132",34.1:"132",34.2:"132",34.3:"132",34.4:"132",34.5:"132","35.0":"134",35.1:"134",35.2:"134",35.3:"134",35.4:"134",35.5:"134",35.6:"134",35.7:"134","36.0":"136",36.1:"136",36.2:"136",36.3:"136",36.4:"136",36.5:"136",36.6:"136",36.7:"136",36.8:"136","37.0":"138",37.1:"138",37.2:"138",37.3:"138","38.0":"140"}},68339:(e,t,B)=>{"use strict";let u=B(40396),r=B(49371),s=B(35238),n=B(25644),C=B(61534),i=B(45781);const o={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,B,r,s=new u;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let n=!1,C=!1,i=[],o=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?o.push("("===t?")":"]"):"{"===t&&o.length>0?o.push("}"):t===o[o.length-1]&&o.pop(),0===o.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){C=!0;break}if("}"===t){if(i.length>0){for(r=i.length-1,B=i[r];B&&"space"===B[0];)B=i[--r];B&&(s.source.end=this.getPosition(B[3]||B[2]),s.source.end.offset++)}this.end(e);break}i.push(e)}else i.push(e);if(this.tokenizer.endOfFile()){n=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(i),i.length?(s.raws.afterName=this.spacesAndCommentsFromStart(i),this.raw(s,"params",i),n&&(e=i[i.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),C&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let B,u=0;for(let r=t-1;r>=0&&(B=e[r],"space"===B[0]||(u+=1,2!==u));r--);throw this.input.error("Missed semicolon","word"===B[0]?B[3]+1:B[2])}colon(e){let t,B,u,r=0;for(let[s,n]of e.entries()){if(B=n,u=B[0],"("===u&&(r+=1),")"===u&&(r-=1),0===r&&":"===u){if(t){if("word"===t[0]&&"progid"===t[1])continue;return s}this.doubleColon(B)}t=B}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let B=e[1].slice(2,-2);if(/^\s*$/.test(B))t.text="",t.raws.left=B,t.raws.right="";else{let e=B.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let B=new s;this.init(B,e[0][2]);let u,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),B.source.end=this.getPosition(r[3]||r[2]||function(e){for(let t=e.length-1;t>=0;t--){let B=e[t],u=B[3]||B[2];if(u)return u}}(e)),B.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),B.raws.before+=e.shift()[1];for(B.source.start=this.getPosition(e[0][2]),B.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;B.prop+=e.shift()[1]}for(B.raws.between="";e.length;){if(u=e.shift(),":"===u[0]){B.raws.between+=u[1];break}"word"===u[0]&&/\w/.test(u[1])&&this.unknownWord([u]),B.raws.between+=u[1]}"_"!==B.prop[0]&&"*"!==B.prop[0]||(B.raws.before+=B.prop[0],B.prop=B.prop.slice(1));let n,C=[];for(;e.length&&(n=e[0][0],"space"===n||"comment"===n);)C.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(u=e[t],"!important"===u[1].toLowerCase()){B.important=!0;let u=this.stringFrom(e,t);u=this.spacesFromEnd(e)+u," !important"!==u&&(B.raws.important=u);break}if("important"===u[1].toLowerCase()){let u=e.slice(0),r="";for(let e=t;e>0;e--){let t=u[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=u.pop()[1]+r}r.trim().startsWith("!")&&(B.important=!0,B.raws.important=r,e=u)}if("space"!==u[0]&&"comment"!==u[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(B.raws.between+=C.map(e=>e[1]).join(""),C=[]),this.raw(B,"value",C.concat(e),t),B.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new C;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,B=null,u=!1,r=null,s=[],n=e[1].startsWith("--"),C=[],i=e;for(;i;){if(B=i[0],C.push(i),"("===B||"["===B)r||(r=i),s.push("("===B?")":"]");else if(n&&u&&"{"===B)r||(r=i),s.push("}");else if(0===s.length){if(";"===B){if(u)return void this.decl(C,n);break}if("{"===B)return void this.rule(C);if("}"===B){this.tokenizer.back(C.pop()),t=!0;break}":"===B&&(u=!0)}else B===s[s.length-1]&&(s.pop(),0===s.length&&(r=null));i=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(r),t&&u){if(!n)for(;C.length&&(i=C[C.length-1][0],"space"===i||"comment"===i);)this.tokenizer.back(C.pop());this.decl(C,n)}else this.unknownWord(C)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,B,u){let r,s,n,C,i=B.length,a="",l=!0;for(let e=0;ee+t[1],"");e.raws[t]={raw:u,value:a}}e[t]=a}rule(e){e.pop();let t=new C;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,B="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)B=e.pop()[1]+B;return B}spacesAndCommentsFromStart(e){let t,B="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)B+=e.shift()[1];return B}spacesFromEnd(e){let t,B="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)B=e.pop()[1]+B;return B}stringFrom(e,t){let B="";for(let u=t;u{let u=B(57441),r=B(87880);class s extends u{constructor(e,t,B){super(e,t,B),this.prefixes&&(this.prefixes=r.uniq(this.prefixes.map(e=>"-ms-"===e?"-webkit-":e)))}}s.names=["appearance"],e.exports=s},68549:(e,t,B)=>{"use strict";const u=B(85252);t.implementation=class{constructor(e,t,{doNotStripQMark:B=!1}){let r=t[0];if(this._list=[],this._url=null,B||"string"!=typeof r||"?"!==r[0]||(r=r.slice(1)),Array.isArray(r))for(const e of r){if(2!==e.length)throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");this._list.push([e[0],e[1]])}else if("object"==typeof r&&null===Object.getPrototypeOf(r))for(const e of Object.keys(r)){const t=r[e];this._list.push([e,t])}else this._list=u.parseUrlencodedString(r)}_updateSteps(){if(null!==this._url){let e=u.serializeUrlencoded(this._list);""===e&&(e=null),this._url._url.query=e}}get size(){return this._list.length}append(e,t){this._list.push([e,t]),this._updateSteps()}delete(e,t){let B=0;for(;Be[0]t[0]?1:0),this._updateSteps()}[Symbol.iterator](){return this._list[Symbol.iterator]()}toString(){return u.serializeUrlencoded(this._list)}}},68777:(e,t,B)=>{let u=B(12895).list,r=B(57441),s=B(59941);class n extends r{normalize(){return"flex"}prefixed(e,t){let B;return[B,t]=s(t),2009===B?t+"box-flex":super.prefixed(e,t)}set(e,t){let B=s(t)[0];if(2009===B)return e.value=u.space(e.value)[0],e.value=n.oldValues[e.value]||e.value,super.set(e,t);if(2012===B){let t=u.space(e.value);3===t.length&&"0"===t[2]&&(e.value=t.slice(0,2).concat("0px").join(" "))}return super.set(e,t)}}n.names=["flex","box-flex"],n.oldValues={auto:"1",none:"0"},e.exports=n},68908:(e,t,B)=>{let u=B(57441);class r extends u{normalize(){return"overscroll-behavior"}prefixed(e,t){return t+"scroll-chaining"}set(e,t){return"auto"===e.value?e.value="chained":"none"!==e.value&&"contain"!==e.value||(e.value="none"),super.set(e,t)}}r.names=["overscroll-behavior","scroll-chaining"],e.exports=r},68937:e=>{"use strict";var t={}.hasOwnProperty,B=/[ -,\.\/:-@\[-\^`\{-~]/,u=/[ -,\.\/:-@\[\]\^`\{-~]/,r=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,s=function e(s,n){"single"!=(n=function(e,B){if(!e)return B;var u={};for(var r in B)u[r]=t.call(e,r)?e[r]:B[r];return u}(n,e.options)).quotes&&"double"!=n.quotes&&(n.quotes="single");for(var C="double"==n.quotes?'"':"'",i=n.isIdentifier,o=s.charAt(0),a="",l=0,D=s.length;l126){if(p>=55296&&p<=56319&&l{e.exports={A:{A:{2:"K D sC",161:"E F A B"},B:{2:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",161:"C L M G N O P"},C:{2:"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{2:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{2:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{2:"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{2:"PC J I dD eD fD gD rC hD iD"},J:{2:"D A"},K:{2:"A B C H JC qC KC"},L:{2:"I"},M:{2:"IC"},N:{16:"A B"},O:{2:"LC"},P:{2:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{2:"uD"},R:{2:"vD"},S:{2:"wD xD"}},B:5,C:"CSS Text 4 text-spacing",D:!1}},69577:(e,t,B)=>{"use strict";let u=B(77793),r=B(61106),s=B(68339);function n(e,t){let B=new r(e,t),u=new s(B);try{u.parse()}catch(e){throw e}return u.root}e.exports=n,n.default=n,u.registerParse(n)},70071:(e,t)=>{"use strict";t.__esModule=!0,t.word=t.tilde=t.tab=t.str=t.space=t.slash=t.singleQuote=t.semicolon=t.plus=t.pipe=t.openSquare=t.openParenthesis=t.newline=t.greaterThan=t.feed=t.equals=t.doubleQuote=t.dollar=t.cr=t.comment=t.comma=t.combinator=t.colon=t.closeSquare=t.closeParenthesis=t.caret=t.bang=t.backslash=t.at=t.asterisk=t.ampersand=void 0;t.ampersand=38;t.asterisk=42;t.at=64;t.comma=44;t.colon=58;t.semicolon=59;t.openParenthesis=40;t.closeParenthesis=41;t.openSquare=91;t.closeSquare=93;t.dollar=36;t.tilde=126;t.caret=94;t.plus=43;t.equals=61;t.pipe=124;t.greaterThan=62;t.space=32;t.singleQuote=39;t.doubleQuote=34;t.slash=47;t.bang=33;t.backslash=92;t.cr=13;t.feed=12;t.newline=10;t.tab=9;t.str=39;t.comment=-1;t.word=-2;t.combinator=-3},70250:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{normalize(){return"flex-basis"}prefixed(e,t){let B;return[B,t]=r(t),2012===B?t+"flex-preferred-size":super.prefixed(e,t)}set(e,t){let B;if([B,t]=r(t),2012===B||"final"===B)return super.set(e,t)}}s.names=["flex-basis","flex-preferred-size"],e.exports=s},70425:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(44646))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.COMMENT,B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u}(r.default);t.default=C,e.exports=t.default},70693:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{2:"C L M G N O P",1025:"0 d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",1537:"Q H R S T U V W X Y Z a b c"},C:{2:"tC",932:"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B wC xC",2308:"0 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC"},D:{2:"1 2 J UB K D E F A B C L M G N O P VB",545:"3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB",1025:"0 d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",1537:"nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c"},E:{1:"MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K yC WC zC",516:"B C L M G JC KC 3C 4C 5C YC ZC LC 6C",548:"F A 2C XC",676:"D E 0C 1C"},F:{2:"F B C AD BD CD DD JC qC ED KC",513:"bB",545:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB",1025:"0 e f g h i j k l m n o p q r s t u v w x y z",1537:"aB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d"},G:{1:"MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD",516:"WD XD YD YC ZC LC ZD",548:"KD LD MD ND OD PD QD RD SD TD UD VD",676:"E ID JD"},H:{2:"cD"},I:{2:"PC J dD eD fD gD rC",545:"hD iD",1025:"I"},J:{2:"D",545:"A"},K:{2:"A B C JC qC KC",1025:"H"},L:{1025:"I"},M:{2308:"IC"},N:{2:"A B"},O:{1537:"LC"},P:{545:"J",1025:"1 2 3 4 5 6 7 8 9 NC OC tD",1537:"jD kD lD mD nD XC oD pD qD rD sD MC"},Q:{1537:"uD"},R:{1537:"vD"},S:{932:"wD",2308:"xD"}},B:5,C:"Intrinsic & Extrinsic Sizing",D:!0}},71373:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P",1028:"W X",1540:"Q H R S T U V"},C:{1:"0 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC",164:"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB wC xC",1540:"iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B"},D:{1:"0 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",292:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B",1028:"W X",1540:"8B 9B AC BC CC DC EC FC GC HC Q H R S T U V"},E:{1:"G 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",292:"J UB K D E F A B C yC WC zC 0C 1C 2C XC JC",1540:"L M KC 3C",3076:"4C"},F:{1:"0 FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",292:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB",1028:"DC EC",1540:"xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC"},G:{1:"YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",292:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD",1540:"RD SD TD UD VD WD",3076:"XD"},H:{2:"cD"},I:{1:"I",292:"PC J dD eD fD gD rC hD iD"},J:{292:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 sD MC NC OC tD",292:"J jD kD lD mD nD",1540:"XC oD pD qD rD"},Q:{1540:"uD"},R:{1:"vD"},S:{1:"xD",1540:"wD"}},B:5,C:"CSS Logical Properties",D:!0}},72583:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 tC PC J UB K D E F A B C L M G N O P VB wC xC"},D:{1:"0 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 J UB K D E F A B C L M G N O P VB"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D E yC WC zC 0C 1C"},F:{1:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F B C AD BD CD DD JC qC ED"},G:{1:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD"},H:{1:"cD"},I:{1:"I hD iD",2:"PC J dD eD fD gD rC"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS Feature Queries",D:!0}},73228:e=>{e.exports={A:{A:{1:"F A B",2:"K D E sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",257:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB",289:"PC wC xC",292:"tC"},D:{1:"0 1 2 3 4 5 6 7 8 9 UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"J"},E:{1:"UB D E F A B C L M G 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"J yC WC",129:"K zC 0C"},F:{1:"0 1 2 3 4 5 6 7 8 9 B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z CD DD JC qC ED KC",2:"F AD BD"},G:{1:"E FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"WC"},H:{2:"cD"},I:{1:"PC J I eD fD gD rC hD iD",33:"dD"},J:{1:"D A"},K:{1:"B C H JC qC KC",2:"A"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",257:"wD"}},B:4,C:"CSS3 Border-radius (rounded corners)",D:!0}},73274:(e,t,B)=>{let u=B(57441),r=B(59902);class s extends u{insert(e,t,B){if("-ms-"!==t)return super.insert(e,t,B);let u=r.parse(e),[s,n]=r.translate(u,0,1);u[0]&&u[0].includes("span")&&(n=u[0].join("").replace(/\D/g,"")),[[e.prop,s],[`${e.prop}-span`,n]].forEach(([t,B])=>{r.insertDecl(e,t,B)})}}s.names=["grid-row","grid-column"],e.exports=s},73909:e=>{"use strict";e.exports=JSON.parse('[{"name":"nodejs","version":"0.2.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.3.8.0"},{"name":"nodejs","version":"0.3.0","date":"2011-08-26","lts":false,"security":false,"v8":"2.5.1.0"},{"name":"nodejs","version":"0.4.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.2.0"},{"name":"nodejs","version":"0.5.0","date":"2011-08-26","lts":false,"security":false,"v8":"3.1.8.25"},{"name":"nodejs","version":"0.6.0","date":"2011-11-04","lts":false,"security":false,"v8":"3.6.6.6"},{"name":"nodejs","version":"0.7.0","date":"2012-01-17","lts":false,"security":false,"v8":"3.8.6.0"},{"name":"nodejs","version":"0.8.0","date":"2012-06-22","lts":false,"security":false,"v8":"3.11.10.10"},{"name":"nodejs","version":"0.9.0","date":"2012-07-20","lts":false,"security":false,"v8":"3.11.10.15"},{"name":"nodejs","version":"0.10.0","date":"2013-03-11","lts":false,"security":false,"v8":"3.14.5.8"},{"name":"nodejs","version":"0.11.0","date":"2013-03-28","lts":false,"security":false,"v8":"3.17.13.0"},{"name":"nodejs","version":"0.12.0","date":"2015-02-06","lts":false,"security":false,"v8":"3.28.73.0"},{"name":"nodejs","version":"4.0.0","date":"2015-09-08","lts":false,"security":false,"v8":"4.5.103.30"},{"name":"nodejs","version":"4.1.0","date":"2015-09-17","lts":false,"security":false,"v8":"4.5.103.33"},{"name":"nodejs","version":"4.2.0","date":"2015-10-12","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.3.0","date":"2016-02-09","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.4.0","date":"2016-03-08","lts":"Argon","security":false,"v8":"4.5.103.35"},{"name":"nodejs","version":"4.5.0","date":"2016-08-16","lts":"Argon","security":false,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.6.0","date":"2016-09-27","lts":"Argon","security":true,"v8":"4.5.103.37"},{"name":"nodejs","version":"4.7.0","date":"2016-12-06","lts":"Argon","security":false,"v8":"4.5.103.43"},{"name":"nodejs","version":"4.8.0","date":"2017-02-21","lts":"Argon","security":false,"v8":"4.5.103.45"},{"name":"nodejs","version":"4.9.0","date":"2018-03-28","lts":"Argon","security":true,"v8":"4.5.103.53"},{"name":"nodejs","version":"5.0.0","date":"2015-10-29","lts":false,"security":false,"v8":"4.6.85.28"},{"name":"nodejs","version":"5.1.0","date":"2015-11-17","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.2.0","date":"2015-12-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.3.0","date":"2015-12-15","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.4.0","date":"2016-01-06","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.5.0","date":"2016-01-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.6.0","date":"2016-02-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.7.0","date":"2016-02-23","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.8.0","date":"2016-03-09","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.9.0","date":"2016-03-16","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.10.0","date":"2016-04-01","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.11.0","date":"2016-04-21","lts":false,"security":false,"v8":"4.6.85.31"},{"name":"nodejs","version":"5.12.0","date":"2016-06-23","lts":false,"security":false,"v8":"4.6.85.32"},{"name":"nodejs","version":"6.0.0","date":"2016-04-26","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.1.0","date":"2016-05-05","lts":false,"security":false,"v8":"5.0.71.35"},{"name":"nodejs","version":"6.2.0","date":"2016-05-17","lts":false,"security":false,"v8":"5.0.71.47"},{"name":"nodejs","version":"6.3.0","date":"2016-07-06","lts":false,"security":false,"v8":"5.0.71.52"},{"name":"nodejs","version":"6.4.0","date":"2016-08-12","lts":false,"security":false,"v8":"5.0.71.60"},{"name":"nodejs","version":"6.5.0","date":"2016-08-26","lts":false,"security":false,"v8":"5.1.281.81"},{"name":"nodejs","version":"6.6.0","date":"2016-09-14","lts":false,"security":false,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.7.0","date":"2016-09-27","lts":false,"security":true,"v8":"5.1.281.83"},{"name":"nodejs","version":"6.8.0","date":"2016-10-12","lts":false,"security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.9.0","date":"2016-10-18","lts":"Boron","security":false,"v8":"5.1.281.84"},{"name":"nodejs","version":"6.10.0","date":"2017-02-21","lts":"Boron","security":false,"v8":"5.1.281.93"},{"name":"nodejs","version":"6.11.0","date":"2017-06-06","lts":"Boron","security":false,"v8":"5.1.281.102"},{"name":"nodejs","version":"6.12.0","date":"2017-11-06","lts":"Boron","security":false,"v8":"5.1.281.108"},{"name":"nodejs","version":"6.13.0","date":"2018-02-10","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.14.0","date":"2018-03-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.15.0","date":"2018-11-27","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.16.0","date":"2018-12-26","lts":"Boron","security":false,"v8":"5.1.281.111"},{"name":"nodejs","version":"6.17.0","date":"2019-02-28","lts":"Boron","security":true,"v8":"5.1.281.111"},{"name":"nodejs","version":"7.0.0","date":"2016-10-25","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.1.0","date":"2016-11-08","lts":false,"security":false,"v8":"5.4.500.36"},{"name":"nodejs","version":"7.2.0","date":"2016-11-22","lts":false,"security":false,"v8":"5.4.500.43"},{"name":"nodejs","version":"7.3.0","date":"2016-12-20","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.4.0","date":"2017-01-04","lts":false,"security":false,"v8":"5.4.500.45"},{"name":"nodejs","version":"7.5.0","date":"2017-01-31","lts":false,"security":false,"v8":"5.4.500.48"},{"name":"nodejs","version":"7.6.0","date":"2017-02-21","lts":false,"security":false,"v8":"5.5.372.40"},{"name":"nodejs","version":"7.7.0","date":"2017-02-28","lts":false,"security":false,"v8":"5.5.372.41"},{"name":"nodejs","version":"7.8.0","date":"2017-03-29","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.9.0","date":"2017-04-11","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"7.10.0","date":"2017-05-02","lts":false,"security":false,"v8":"5.5.372.43"},{"name":"nodejs","version":"8.0.0","date":"2017-05-30","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.1.0","date":"2017-06-08","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.2.0","date":"2017-07-19","lts":false,"security":false,"v8":"5.8.283.41"},{"name":"nodejs","version":"8.3.0","date":"2017-08-08","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.4.0","date":"2017-08-15","lts":false,"security":false,"v8":"6.0.286.52"},{"name":"nodejs","version":"8.5.0","date":"2017-09-12","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.6.0","date":"2017-09-26","lts":false,"security":false,"v8":"6.0.287.53"},{"name":"nodejs","version":"8.7.0","date":"2017-10-11","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.8.0","date":"2017-10-24","lts":false,"security":false,"v8":"6.1.534.42"},{"name":"nodejs","version":"8.9.0","date":"2017-10-31","lts":"Carbon","security":false,"v8":"6.1.534.46"},{"name":"nodejs","version":"8.10.0","date":"2018-03-06","lts":"Carbon","security":false,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.11.0","date":"2018-03-28","lts":"Carbon","security":true,"v8":"6.2.414.50"},{"name":"nodejs","version":"8.12.0","date":"2018-09-10","lts":"Carbon","security":false,"v8":"6.2.414.66"},{"name":"nodejs","version":"8.13.0","date":"2018-11-20","lts":"Carbon","security":false,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.14.0","date":"2018-11-27","lts":"Carbon","security":true,"v8":"6.2.414.72"},{"name":"nodejs","version":"8.15.0","date":"2018-12-26","lts":"Carbon","security":false,"v8":"6.2.414.75"},{"name":"nodejs","version":"8.16.0","date":"2019-04-16","lts":"Carbon","security":false,"v8":"6.2.414.77"},{"name":"nodejs","version":"8.17.0","date":"2019-12-17","lts":"Carbon","security":true,"v8":"6.2.414.78"},{"name":"nodejs","version":"9.0.0","date":"2017-10-31","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.1.0","date":"2017-11-07","lts":false,"security":false,"v8":"6.2.414.32"},{"name":"nodejs","version":"9.2.0","date":"2017-11-14","lts":false,"security":false,"v8":"6.2.414.44"},{"name":"nodejs","version":"9.3.0","date":"2017-12-12","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.4.0","date":"2018-01-10","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.5.0","date":"2018-01-31","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.6.0","date":"2018-02-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.7.0","date":"2018-03-01","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.8.0","date":"2018-03-07","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.9.0","date":"2018-03-21","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.10.0","date":"2018-03-28","lts":false,"security":true,"v8":"6.2.414.46"},{"name":"nodejs","version":"9.11.0","date":"2018-04-04","lts":false,"security":false,"v8":"6.2.414.46"},{"name":"nodejs","version":"10.0.0","date":"2018-04-24","lts":false,"security":false,"v8":"6.6.346.24"},{"name":"nodejs","version":"10.1.0","date":"2018-05-08","lts":false,"security":false,"v8":"6.6.346.27"},{"name":"nodejs","version":"10.2.0","date":"2018-05-23","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.3.0","date":"2018-05-29","lts":false,"security":false,"v8":"6.6.346.32"},{"name":"nodejs","version":"10.4.0","date":"2018-06-06","lts":false,"security":false,"v8":"6.7.288.43"},{"name":"nodejs","version":"10.5.0","date":"2018-06-20","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.6.0","date":"2018-07-04","lts":false,"security":false,"v8":"6.7.288.46"},{"name":"nodejs","version":"10.7.0","date":"2018-07-18","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.8.0","date":"2018-08-01","lts":false,"security":false,"v8":"6.7.288.49"},{"name":"nodejs","version":"10.9.0","date":"2018-08-15","lts":false,"security":false,"v8":"6.8.275.24"},{"name":"nodejs","version":"10.10.0","date":"2018-09-06","lts":false,"security":false,"v8":"6.8.275.30"},{"name":"nodejs","version":"10.11.0","date":"2018-09-19","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.12.0","date":"2018-10-10","lts":false,"security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.13.0","date":"2018-10-30","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.14.0","date":"2018-11-27","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.15.0","date":"2018-12-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.16.0","date":"2019-05-28","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.17.0","date":"2019-10-22","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.18.0","date":"2019-12-17","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.19.0","date":"2020-02-05","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.20.0","date":"2020-03-26","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.21.0","date":"2020-06-02","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.22.0","date":"2020-07-21","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.23.0","date":"2020-10-27","lts":"Dubnium","security":false,"v8":"6.8.275.32"},{"name":"nodejs","version":"10.24.0","date":"2021-02-23","lts":"Dubnium","security":true,"v8":"6.8.275.32"},{"name":"nodejs","version":"11.0.0","date":"2018-10-23","lts":false,"security":false,"v8":"7.0.276.28"},{"name":"nodejs","version":"11.1.0","date":"2018-10-30","lts":false,"security":false,"v8":"7.0.276.32"},{"name":"nodejs","version":"11.2.0","date":"2018-11-15","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.3.0","date":"2018-11-27","lts":false,"security":true,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.4.0","date":"2018-12-07","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.5.0","date":"2018-12-18","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.6.0","date":"2018-12-26","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.7.0","date":"2019-01-17","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.8.0","date":"2019-01-24","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.9.0","date":"2019-01-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.10.0","date":"2019-02-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.11.0","date":"2019-03-05","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.12.0","date":"2019-03-14","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.13.0","date":"2019-03-28","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.14.0","date":"2019-04-10","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"11.15.0","date":"2019-04-30","lts":false,"security":false,"v8":"7.0.276.38"},{"name":"nodejs","version":"12.0.0","date":"2019-04-23","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.1.0","date":"2019-04-29","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.2.0","date":"2019-05-07","lts":false,"security":false,"v8":"7.4.288.21"},{"name":"nodejs","version":"12.3.0","date":"2019-05-21","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.4.0","date":"2019-06-04","lts":false,"security":false,"v8":"7.4.288.27"},{"name":"nodejs","version":"12.5.0","date":"2019-06-26","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.6.0","date":"2019-07-03","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.7.0","date":"2019-07-23","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.8.0","date":"2019-08-06","lts":false,"security":false,"v8":"7.5.288.22"},{"name":"nodejs","version":"12.9.0","date":"2019-08-20","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.10.0","date":"2019-09-04","lts":false,"security":false,"v8":"7.6.303.29"},{"name":"nodejs","version":"12.11.0","date":"2019-09-25","lts":false,"security":false,"v8":"7.7.299.11"},{"name":"nodejs","version":"12.12.0","date":"2019-10-11","lts":false,"security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.13.0","date":"2019-10-21","lts":"Erbium","security":false,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.14.0","date":"2019-12-17","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.15.0","date":"2020-02-05","lts":"Erbium","security":true,"v8":"7.7.299.13"},{"name":"nodejs","version":"12.16.0","date":"2020-02-11","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.17.0","date":"2020-05-26","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.18.0","date":"2020-06-02","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.19.0","date":"2020-10-06","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.20.0","date":"2020-11-24","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.21.0","date":"2021-02-23","lts":"Erbium","security":true,"v8":"7.8.279.23"},{"name":"nodejs","version":"12.22.0","date":"2021-03-30","lts":"Erbium","security":false,"v8":"7.8.279.23"},{"name":"nodejs","version":"13.0.0","date":"2019-10-22","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.1.0","date":"2019-11-05","lts":false,"security":false,"v8":"7.8.279.17"},{"name":"nodejs","version":"13.2.0","date":"2019-11-21","lts":false,"security":false,"v8":"7.9.317.23"},{"name":"nodejs","version":"13.3.0","date":"2019-12-03","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.4.0","date":"2019-12-17","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.5.0","date":"2019-12-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.6.0","date":"2020-01-07","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.7.0","date":"2020-01-21","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.8.0","date":"2020-02-05","lts":false,"security":true,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.9.0","date":"2020-02-18","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.10.0","date":"2020-03-04","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.11.0","date":"2020-03-12","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.12.0","date":"2020-03-26","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.13.0","date":"2020-04-14","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"13.14.0","date":"2020-04-29","lts":false,"security":false,"v8":"7.9.317.25"},{"name":"nodejs","version":"14.0.0","date":"2020-04-21","lts":false,"security":false,"v8":"8.1.307.30"},{"name":"nodejs","version":"14.1.0","date":"2020-04-29","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.2.0","date":"2020-05-05","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.3.0","date":"2020-05-19","lts":false,"security":false,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.4.0","date":"2020-06-02","lts":false,"security":true,"v8":"8.1.307.31"},{"name":"nodejs","version":"14.5.0","date":"2020-06-30","lts":false,"security":false,"v8":"8.3.110.9"},{"name":"nodejs","version":"14.6.0","date":"2020-07-20","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.7.0","date":"2020-07-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.8.0","date":"2020-08-11","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.9.0","date":"2020-08-27","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.10.0","date":"2020-09-08","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.11.0","date":"2020-09-15","lts":false,"security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.12.0","date":"2020-09-22","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.13.0","date":"2020-09-29","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.14.0","date":"2020-10-15","lts":false,"security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.15.0","date":"2020-10-27","lts":"Fermium","security":false,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.16.0","date":"2021-02-23","lts":"Fermium","security":true,"v8":"8.4.371.19"},{"name":"nodejs","version":"14.17.0","date":"2021-05-11","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.18.0","date":"2021-09-28","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.19.0","date":"2022-02-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.20.0","date":"2022-07-07","lts":"Fermium","security":true,"v8":"8.4.371.23"},{"name":"nodejs","version":"14.21.0","date":"2022-11-01","lts":"Fermium","security":false,"v8":"8.4.371.23"},{"name":"nodejs","version":"15.0.0","date":"2020-10-20","lts":false,"security":false,"v8":"8.6.395.16"},{"name":"nodejs","version":"15.1.0","date":"2020-11-04","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.2.0","date":"2020-11-10","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.3.0","date":"2020-11-24","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.4.0","date":"2020-12-09","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.5.0","date":"2020-12-22","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.6.0","date":"2021-01-14","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.7.0","date":"2021-01-25","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.8.0","date":"2021-02-02","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.9.0","date":"2021-02-18","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.10.0","date":"2021-02-23","lts":false,"security":true,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.11.0","date":"2021-03-03","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.12.0","date":"2021-03-17","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.13.0","date":"2021-03-31","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"15.14.0","date":"2021-04-06","lts":false,"security":false,"v8":"8.6.395.17"},{"name":"nodejs","version":"16.0.0","date":"2021-04-20","lts":false,"security":false,"v8":"9.0.257.17"},{"name":"nodejs","version":"16.1.0","date":"2021-05-04","lts":false,"security":false,"v8":"9.0.257.24"},{"name":"nodejs","version":"16.2.0","date":"2021-05-19","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.3.0","date":"2021-06-03","lts":false,"security":false,"v8":"9.0.257.25"},{"name":"nodejs","version":"16.4.0","date":"2021-06-23","lts":false,"security":false,"v8":"9.1.269.36"},{"name":"nodejs","version":"16.5.0","date":"2021-07-14","lts":false,"security":false,"v8":"9.1.269.38"},{"name":"nodejs","version":"16.6.0","date":"2021-07-29","lts":false,"security":true,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.7.0","date":"2021-08-18","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.8.0","date":"2021-08-25","lts":false,"security":false,"v8":"9.2.230.21"},{"name":"nodejs","version":"16.9.0","date":"2021-09-07","lts":false,"security":false,"v8":"9.3.345.16"},{"name":"nodejs","version":"16.10.0","date":"2021-09-22","lts":false,"security":false,"v8":"9.3.345.19"},{"name":"nodejs","version":"16.11.0","date":"2021-10-08","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.12.0","date":"2021-10-20","lts":false,"security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.13.0","date":"2021-10-26","lts":"Gallium","security":false,"v8":"9.4.146.19"},{"name":"nodejs","version":"16.14.0","date":"2022-02-08","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.15.0","date":"2022-04-26","lts":"Gallium","security":false,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.16.0","date":"2022-07-07","lts":"Gallium","security":true,"v8":"9.4.146.24"},{"name":"nodejs","version":"16.17.0","date":"2022-08-16","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.18.0","date":"2022-10-12","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.19.0","date":"2022-12-13","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"16.20.0","date":"2023-03-28","lts":"Gallium","security":false,"v8":"9.4.146.26"},{"name":"nodejs","version":"17.0.0","date":"2021-10-19","lts":false,"security":false,"v8":"9.5.172.21"},{"name":"nodejs","version":"17.1.0","date":"2021-11-09","lts":false,"security":false,"v8":"9.5.172.25"},{"name":"nodejs","version":"17.2.0","date":"2021-11-30","lts":false,"security":false,"v8":"9.6.180.14"},{"name":"nodejs","version":"17.3.0","date":"2021-12-17","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.4.0","date":"2022-01-18","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.5.0","date":"2022-02-10","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.6.0","date":"2022-02-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.7.0","date":"2022-03-09","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.8.0","date":"2022-03-22","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"17.9.0","date":"2022-04-07","lts":false,"security":false,"v8":"9.6.180.15"},{"name":"nodejs","version":"18.0.0","date":"2022-04-18","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.1.0","date":"2022-05-03","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.2.0","date":"2022-05-17","lts":false,"security":false,"v8":"10.1.124.8"},{"name":"nodejs","version":"18.3.0","date":"2022-06-02","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.4.0","date":"2022-06-16","lts":false,"security":false,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.5.0","date":"2022-07-06","lts":false,"security":true,"v8":"10.2.154.4"},{"name":"nodejs","version":"18.6.0","date":"2022-07-13","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.7.0","date":"2022-07-26","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.8.0","date":"2022-08-24","lts":false,"security":false,"v8":"10.2.154.13"},{"name":"nodejs","version":"18.9.0","date":"2022-09-07","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.10.0","date":"2022-09-28","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.11.0","date":"2022-10-13","lts":false,"security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.12.0","date":"2022-10-25","lts":"Hydrogen","security":false,"v8":"10.2.154.15"},{"name":"nodejs","version":"18.13.0","date":"2023-01-05","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.14.0","date":"2023-02-01","lts":"Hydrogen","security":false,"v8":"10.2.154.23"},{"name":"nodejs","version":"18.15.0","date":"2023-03-05","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.16.0","date":"2023-04-12","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.17.0","date":"2023-07-18","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.18.0","date":"2023-09-18","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.19.0","date":"2023-11-29","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"18.20.0","date":"2024-03-26","lts":"Hydrogen","security":false,"v8":"10.2.154.26"},{"name":"nodejs","version":"19.0.0","date":"2022-10-17","lts":false,"security":false,"v8":"10.7.193.13"},{"name":"nodejs","version":"19.1.0","date":"2022-11-14","lts":false,"security":false,"v8":"10.7.193.20"},{"name":"nodejs","version":"19.2.0","date":"2022-11-29","lts":false,"security":false,"v8":"10.8.168.20"},{"name":"nodejs","version":"19.3.0","date":"2022-12-14","lts":false,"security":false,"v8":"10.8.168.21"},{"name":"nodejs","version":"19.4.0","date":"2023-01-05","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.5.0","date":"2023-01-24","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.6.0","date":"2023-02-01","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.7.0","date":"2023-02-21","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.8.0","date":"2023-03-14","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"19.9.0","date":"2023-04-10","lts":false,"security":false,"v8":"10.8.168.25"},{"name":"nodejs","version":"20.0.0","date":"2023-04-17","lts":false,"security":false,"v8":"11.3.244.4"},{"name":"nodejs","version":"20.1.0","date":"2023-05-03","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.2.0","date":"2023-05-16","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.3.0","date":"2023-06-08","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.4.0","date":"2023-07-04","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.5.0","date":"2023-07-19","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.6.0","date":"2023-08-23","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.7.0","date":"2023-09-18","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.8.0","date":"2023-09-28","lts":false,"security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.9.0","date":"2023-10-24","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.10.0","date":"2023-11-22","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.11.0","date":"2024-01-09","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.12.0","date":"2024-03-26","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.13.0","date":"2024-05-07","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.14.0","date":"2024-05-28","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.15.0","date":"2024-06-20","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.16.0","date":"2024-07-24","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.17.0","date":"2024-08-21","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"20.18.0","date":"2024-10-03","lts":"Iron","security":false,"v8":"11.3.244.8"},{"name":"nodejs","version":"21.0.0","date":"2023-10-17","lts":false,"security":false,"v8":"11.8.172.13"},{"name":"nodejs","version":"21.1.0","date":"2023-10-24","lts":false,"security":false,"v8":"11.8.172.15"},{"name":"nodejs","version":"21.2.0","date":"2023-11-14","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.3.0","date":"2023-11-30","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.4.0","date":"2023-12-05","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.5.0","date":"2023-12-19","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.6.0","date":"2024-01-14","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"21.7.0","date":"2024-03-06","lts":false,"security":false,"v8":"11.8.172.17"},{"name":"nodejs","version":"22.0.0","date":"2024-04-24","lts":false,"security":false,"v8":"12.4.254.14"},{"name":"nodejs","version":"22.1.0","date":"2024-05-02","lts":false,"security":false,"v8":"12.4.254.14"},{"name":"nodejs","version":"22.2.0","date":"2024-05-15","lts":false,"security":false,"v8":"12.4.254.14"},{"name":"nodejs","version":"22.3.0","date":"2024-06-11","lts":false,"security":false,"v8":"12.4.254.20"},{"name":"nodejs","version":"22.4.0","date":"2024-07-02","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.5.0","date":"2024-07-17","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.6.0","date":"2024-08-06","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.7.0","date":"2024-08-21","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.8.0","date":"2024-09-03","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.9.0","date":"2024-09-17","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.10.0","date":"2024-10-16","lts":false,"security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.11.0","date":"2024-10-29","lts":"Jod","security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"22.12.0","date":"2024-12-02","lts":"Jod","security":false,"v8":"12.4.254.21"},{"name":"nodejs","version":"23.0.0","date":"2024-10-16","lts":false,"security":false,"v8":"12.9.202.26"},{"name":"nodejs","version":"23.1.0","date":"2024-10-24","lts":false,"security":false,"v8":"12.9.202.28"},{"name":"nodejs","version":"23.2.0","date":"2024-11-11","lts":false,"security":false,"v8":"12.9.202.28"},{"name":"nodejs","version":"23.3.0","date":"2024-11-20","lts":false,"security":false,"v8":"12.9.202.28"}]')},74150:e=>{function t(e){this.name="BrowserslistError",this.message=e,this.browserslist=!0,Error.captureStackTrace&&Error.captureStackTrace(this,t)}t.prototype=Error.prototype,e.exports=t},74451:(e,t,B)=>{"use strict";t.__esModule=!0,t.universal=t.tag=t.string=t.selector=t.root=t.pseudo=t.nesting=t.id=t.comment=t.combinator=t.className=t.attribute=void 0;var u=f(B(85588)),r=f(B(64195)),s=f(B(91704)),n=f(B(70425)),C=f(B(77071)),i=f(B(62918)),o=f(B(17324)),a=f(B(80518)),l=f(B(30339)),D=f(B(85799)),c=f(B(79720)),p=f(B(81669));function f(e){return e&&e.__esModule?e:{default:e}}t.attribute=function(e){return new u.default(e)};t.className=function(e){return new r.default(e)};t.combinator=function(e){return new s.default(e)};t.comment=function(e){return new n.default(e)};t.id=function(e){return new C.default(e)};t.nesting=function(e){return new i.default(e)};t.pseudo=function(e){return new o.default(e)};t.root=function(e){return new a.default(e)};t.selector=function(e){return new l.default(e)};t.string=function(e){return new D.default(e)};t.tag=function(e){return new c.default(e)};t.universal=function(e){return new p.default(e)}},75193:(e,t,B)=>{let u=B(57441);class r extends u{normalize(e){return e.replace(/(margin|padding|border)-(start|end)/,"$1-inline-$2")}prefixed(e,t){return t+e.replace("-inline","")}}r.names=["border-inline-start","border-inline-end","margin-inline-start","margin-inline-end","padding-inline-start","padding-inline-end","border-start","border-end","margin-start","margin-end","padding-start","padding-end"],e.exports=r},75643:(e,t,B)=>{let u=B(57441);class r extends u{check(e){let t=e.value;return!t.includes("/")&&!t.includes("span")}normalize(e){return e.replace("-start","")}prefixed(e,t){let B=super.prefixed(e,t);return"-ms-"===t&&(B=B.replace("-start","")),B}}r.names=["grid-row-start","grid-column-start"],e.exports=r},75833:(e,t,B)=>{"use strict";const{URL:u,URLSearchParams:r}=B(3181),s=B(95484),n=B(41656),C={Array,Object,Promise,String,TypeError};u.install(C,["Window"]),r.install(C,["Window"]),t.URL=C.URL,t.URLSearchParams=C.URLSearchParams,t.parseURL=s.parseURL,t.basicURLParse=s.basicURLParse,t.serializeURL=s.serializeURL,t.serializePath=s.serializePath,t.serializeHost=s.serializeHost,t.serializeInteger=s.serializeInteger,t.serializeURLOrigin=s.serializeURLOrigin,t.setTheUsername=s.setTheUsername,t.setThePassword=s.setThePassword,t.cannotHaveAUsernamePasswordPort=s.cannotHaveAUsernamePasswordPort,t.hasAnOpaquePath=s.hasAnOpaquePath,t.percentDecodeString=n.percentDecodeString,t.percentDecodeBytes=n.percentDecodeBytes},76019:(e,t,B)=>{"use strict";const u=B(62660).browsers,r=B(5040).browserVersions,s=B(96481);function n(e){return Object.keys(e).reduce((t,B)=>(t[r[B]]=e[B],t),{})}e.exports.agents=Object.keys(s).reduce((e,t)=>{let B=s[t];return e[u[t]]=Object.keys(B).reduce((e,t)=>("A"===t?e.usage_global=n(B[t]):"C"===t?e.versions=B[t].reduce((e,t)=>(""===t?e.push(null):e.push(r[t]),e),[]):"D"===t?e.prefix_exceptions=n(B[t]):"E"===t?e.browser=B[t]:"F"===t?e.release_date=Object.keys(B[t]).reduce((e,u)=>(e[r[u]]=B[t][u],e),{}):e.prefix=B[t],e),{}),e},{})},76079:(e,t,B)=>{let u=B(57441);class r extends u{set(e,t){return"text-decoration-skip-ink"===e.prop&&"auto"===e.value?(e.prop=t+"text-decoration-skip",e.value="ink",e):super.set(e,t)}}r.names=["text-decoration-skip-ink","text-decoration-skip"],e.exports=r},76134:(e,t,B)=>{let u=B(84328),r=B(87880),s=B(77187);function n(e,t){let B=new e.constructor;for(let u of Object.keys(e||{})){let r=e[u];"parent"===u&&"object"==typeof r?t&&(B[u]=t):"source"===u||null===u?B[u]=r:Array.isArray(r)?B[u]=r.map(e=>n(e,B)):"_autoprefixerPrefix"!==u&&"_autoprefixerValues"!==u&&"proxyCache"!==u&&("object"==typeof r&&null!==r&&(r=n(r,B)),B[u]=r)}return B}class C{constructor(e,t,B){this.prefixes=t,this.name=e,this.all=B}static clone(e,t){let B=n(e);for(let e in t)B[e]=t[e];return B}static hack(e){return this.hacks||(this.hacks={}),e.names.map(t=>(this.hacks[t]=e,this.hacks[t]))}static load(e,t,B){let u=this.hacks&&this.hacks[e];return u?new u(e,t,B):new this(e,t,B)}clone(e,t){return C.clone(e,t)}parentPrefix(e){let t;return t=void 0!==e._autoprefixerPrefix?e._autoprefixerPrefix:"decl"===e.type&&"-"===e.prop[0]?s.prefix(e.prop):"root"!==e.type&&("rule"===e.type&&e.selector.includes(":-")&&/:(-\w+-)/.test(e.selector)?e.selector.match(/:(-\w+-)/)[1]:"atrule"===e.type&&"-"===e.name[0]?s.prefix(e.name):this.parentPrefix(e.parent)),u.prefixes().includes(t)||(t=!1),e._autoprefixerPrefix=t,e._autoprefixerPrefix}process(e,t){if(!this.check(e))return;let B=this.parentPrefix(e),u=this.prefixes.filter(e=>!B||B===r.removeNote(e)),s=[];for(let B of u)this.add(e,B,s.concat([B]),t)&&s.push(B);return s}}e.exports=C},76526:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{2:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{33:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",164:"tC PC wC xC"},D:{2:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{2:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{2:"0 1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AD BD CD DD JC qC ED KC"},G:{2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{2:"PC J I dD eD fD gD rC hD iD"},J:{2:"D A"},K:{2:"A B C H JC qC KC"},L:{2:"I"},M:{33:"IC"},N:{2:"A B"},O:{2:"LC"},P:{2:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{2:"uD"},R:{2:"vD"},S:{33:"wD xD"}},B:5,C:"CSS element() function",D:!0}},76648:(e,t,B)=>{"use strict";const u=B(85616),r=B(46892),s=r.implSymbol,n=r.ctorRegistrySymbol;function C(e,t){let B;return void 0!==t&&(B=t.prototype),r.isObject(B)||(B=e[n].URL.prototype),Object.create(B)}t.is=e=>r.isObject(e)&&r.hasOwn(e,s)&&e[s]instanceof o.implementation,t.isImpl=e=>r.isObject(e)&&e instanceof o.implementation,t.convert=(e,B,{context:u="The provided value"}={})=>{if(t.is(B))return r.implForWrapper(B);throw new e.TypeError(`${u} is not of type 'URL'.`)},t.create=(e,B,u)=>{const r=C(e);return t.setup(r,e,B,u)},t.createImpl=(e,B,u)=>{const s=t.create(e,B,u);return r.implForWrapper(s)},t._internalSetup=(e,t)=>{},t.setup=(e,B,u=[],n={})=>(n.wrapper=e,t._internalSetup(e,B),Object.defineProperty(e,s,{value:new o.implementation(B,u,n),configurable:!0}),e[s][r.wrapperSymbol]=e,o.init&&o.init(e[s]),e),t.new=(e,B)=>{const u=C(e,B);return t._internalSetup(u,e),Object.defineProperty(u,s,{value:Object.create(o.implementation.prototype),configurable:!0}),u[s][r.wrapperSymbol]=u,o.init&&o.init(u[s]),u[s]};const i=new Set(["Window","Worker"]);t.install=(e,B)=>{if(!B.some(e=>i.has(e)))return;const n=r.initCtorRegistry(e);class C{constructor(B){if(arguments.length<1)throw new e.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);const r=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to construct 'URL': parameter 1",globals:e}),r.push(t)}{let t=arguments[1];void 0!==t&&(t=u.USVString(t,{context:"Failed to construct 'URL': parameter 2",globals:e})),r.push(t)}return t.setup(Object.create(new.target.prototype),e,r)}toJSON(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return B[s].toJSON()}get href(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get href' called on an object that is not a valid instance of URL.");return B[s].href}set href(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set href' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:e}),r[s].href=B}toString(){if(!t.is(this))throw new e.TypeError("'toString' called on an object that is not a valid instance of URL.");return this[s].href}get origin(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get origin' called on an object that is not a valid instance of URL.");return B[s].origin}get protocol(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return B[s].protocol}set protocol(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set protocol' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:e}),r[s].protocol=B}get username(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get username' called on an object that is not a valid instance of URL.");return B[s].username}set username(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set username' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:e}),r[s].username=B}get password(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get password' called on an object that is not a valid instance of URL.");return B[s].password}set password(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set password' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:e}),r[s].password=B}get host(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get host' called on an object that is not a valid instance of URL.");return B[s].host}set host(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set host' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:e}),r[s].host=B}get hostname(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return B[s].hostname}set hostname(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set hostname' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:e}),r[s].hostname=B}get port(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get port' called on an object that is not a valid instance of URL.");return B[s].port}set port(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set port' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:e}),r[s].port=B}get pathname(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return B[s].pathname}set pathname(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set pathname' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:e}),r[s].pathname=B}get search(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get search' called on an object that is not a valid instance of URL.");return B[s].search}set search(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set search' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:e}),r[s].search=B}get searchParams(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return r.getSameObject(this,"searchParams",()=>r.tryWrapperForImpl(B[s].searchParams))}get hash(){const B=null!=this?this:e;if(!t.is(B))throw new e.TypeError("'get hash' called on an object that is not a valid instance of URL.");return B[s].hash}set hash(B){const r=null!=this?this:e;if(!t.is(r))throw new e.TypeError("'set hash' called on an object that is not a valid instance of URL.");B=u.USVString(B,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:e}),r[s].hash=B}static parse(t){if(arguments.length<1)throw new e.TypeError(`Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.`);const B=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'parse' on 'URL': parameter 1",globals:e}),B.push(t)}{let t=arguments[1];void 0!==t&&(t=u.USVString(t,{context:"Failed to execute 'parse' on 'URL': parameter 2",globals:e})),B.push(t)}return r.tryWrapperForImpl(o.implementation.parse(e,...B))}static canParse(t){if(arguments.length<1)throw new e.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);const B=[];{let t=arguments[0];t=u.USVString(t,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:e}),B.push(t)}{let t=arguments[1];void 0!==t&&(t=u.USVString(t,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:e})),B.push(t)}return o.implementation.canParse(...B)}}Object.defineProperties(C.prototype,{toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0},[Symbol.toStringTag]:{value:"URL",configurable:!0}}),Object.defineProperties(C,{parse:{enumerable:!0},canParse:{enumerable:!0}}),n.URL=C,Object.defineProperty(e,"URL",{configurable:!0,writable:!0,value:C}),B.includes("Window")&&Object.defineProperty(e,"webkitURL",{configurable:!0,writable:!0,value:C})};const o=B(67079)},77071:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(44646))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.ID,B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u.prototype.valueToString=function(){return"#"+e.prototype.valueToString.call(this)},u}(r.default);t.default=C,e.exports=t.default},77187:e=>{e.exports={prefix(e){let t=e.match(/^(-\w+-)/);return t?t[0]:""},unprefixed:e=>e.replace(/^-\w+-/,"")}},77793:(e,t,B)=>{"use strict";let u,r,s,n,C=B(49371),i=B(35238),o=B(63152),{isClean:a,my:l}=B(84151);function D(e){return e.map(e=>(e.nodes&&(e.nodes=D(e.nodes)),delete e.source,e))}function c(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class p extends o{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,B,u=this.getIterator();for(;this.indexes[u]"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...B)=>e[t](...B.map(e=>"function"==typeof e?(t,B)=>e(t.toProxy(),B):e)):"every"===t||"some"===t?B=>e[t]((e,...t)=>B(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,B)=>(e[t]===B||(e[t]=B,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let B,u=this.index(e),r=this.normalize(t,this.proxyOf.nodes[u]).reverse();u=this.index(e);for(let e of r)this.proxyOf.nodes.splice(u+1,0,e);for(let e in this.indexes)B=this.indexes[e],u(e[l]||p.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&c(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let B in this.indexes)t=this.indexes[B],t>=e&&(this.indexes[B]=t-1);return this.markDirty(),this}replaceValues(e,t,B){return B||(B=t,t={}),this.walkDecls(u=>{t.props&&!t.props.includes(u.prop)||t.fast&&!u.value.includes(t.fast)||(u.value=u.value.replace(e,B))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,B)=>{let u;try{u=e(t,B)}catch(e){throw t.addToError(e)}return!1!==u&&t.walk&&(u=t.walk(e)),u})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((B,u)=>{if("atrule"===B.type&&e.test(B.name))return t(B,u)}):this.walk((B,u)=>{if("atrule"===B.type&&B.name===e)return t(B,u)}):(t=e,this.walk((e,B)=>{if("atrule"===e.type)return t(e,B)}))}walkComments(e){return this.walk((t,B)=>{if("comment"===t.type)return e(t,B)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((B,u)=>{if("decl"===B.type&&e.test(B.prop))return t(B,u)}):this.walk((B,u)=>{if("decl"===B.type&&B.prop===e)return t(B,u)}):(t=e,this.walk((e,B)=>{if("decl"===e.type)return t(e,B)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((B,u)=>{if("rule"===B.type&&e.test(B.selector))return t(B,u)}):this.walk((B,u)=>{if("rule"===B.type&&B.selector===e)return t(B,u)}):(t=e,this.walk((e,B)=>{if("rule"===e.type)return t(e,B)}))}}p.registerParse=e=>{r=e},p.registerRule=e=>{n=e},p.registerAtRule=e=>{u=e},p.registerRoot=e=>{s=e},e.exports=p,p.default=p,p.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,u.prototype):"rule"===e.type?Object.setPrototypeOf(e,n.prototype):"decl"===e.type?Object.setPrototypeOf(e,i.prototype):"comment"===e.type?Object.setPrototypeOf(e,C.prototype):"root"===e.type&&Object.setPrototypeOf(e,s.prototype),e[l]=!0,e.nodes&&e.nodes.forEach(e=>{p.rebuild(e)})}},77970:e=>{e.exports={A:{A:{1:"B",2:"K D E F sC",164:"A"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB wC xC",8:"1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB",328:"iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB"},D:{1:"0 wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 J UB K D E F A B C L M G N O P VB",8:"3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB",584:"tB uB vB"},E:{1:"L M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K yC WC zC",8:"D E F A B C 0C 1C 2C XC JC",1096:"KC"},F:{1:"0 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",8:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB",584:"gB hB iB"},G:{1:"TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",8:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD",6148:"SD"},H:{2:"cD"},I:{1:"I",8:"PC J dD eD fD gD rC hD iD"},J:{8:"D A"},K:{1:"H",2:"A",8:"B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{1:"B",36:"A"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"jD",8:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",328:"wD"}},B:2,C:"Pointer events",D:!0}},78308:(e,t,B)=>{let u=B(94059);function r(e,t){return e=e.split(" "),t=t.split(" "),e[0]>t[0]?1:e[0]C(["border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],{browsers:e,feature:"border-radius",mistakes:["-khtml-","-ms-","-o-"]})),s(B(27808),e=>C(["box-shadow"],{browsers:e,feature:"css-boxshadow",mistakes:["-khtml-"]})),s(B(47035),e=>C(["animation","animation-name","animation-duration","animation-delay","animation-direction","animation-fill-mode","animation-iteration-count","animation-play-state","animation-timing-function","@keyframes"],{browsers:e,feature:"css-animation",mistakes:["-khtml-","-ms-"]})),s(B(35661),e=>C(["transition","transition-property","transition-duration","transition-delay","transition-timing-function"],{browsers:e,feature:"css-transitions",mistakes:["-khtml-","-ms-"]})),s(B(95360),e=>C(["transform","transform-origin"],{browsers:e,feature:"transforms2d"}));let o=B(48909);s(o,e=>(C(["perspective","perspective-origin"],{browsers:e,feature:"transforms3d"}),C(["transform-style"],{browsers:e,feature:"transforms3d",mistakes:["-ms-","-o-"]}))),s(o,{match:/y\sx|y\s#2/},e=>C(["backface-visibility"],{browsers:e,feature:"transforms3d",mistakes:["-ms-","-o-"]}));let a=B(20248);s(a,{match:/y\sx/},e=>C(["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient"],{browsers:e,feature:"css-gradients",mistakes:["-ms-"],props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"]})),s(a,{match:/a\sx/},e=>i(["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient"],{browsers:e=e.map(e=>/firefox|op/.test(e)?e:`${e} old`),feature:"css-gradients"})),s(B(59633),e=>C(["box-sizing"],{browsers:e,feature:"css3-boxsizing"})),s(B(52762),e=>C(["filter"],{browsers:e,feature:"css-filters"})),s(B(7316),e=>C(["filter-function"],{browsers:e,feature:"css-filter-function",props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"]})),s(B(92270),{match:/y\sx|y\s#2/},e=>C(["backdrop-filter"],{browsers:e,feature:"css-backdrop-filter"})),s(B(76526),e=>C(["element"],{browsers:e,feature:"css-element-function",props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"]})),s(B(42612),e=>{C(["columns","column-width","column-gap","column-rule","column-rule-color","column-rule-width","column-count","column-rule-style","column-span","column-fill"],{browsers:e,feature:"multicolumn"}),C(["break-before","break-after","break-inside"],{browsers:e.filter(e=>!/firefox/.test(e)),feature:"multicolumn"})}),s(B(97960),e=>C(["user-select"],{browsers:e,feature:"user-select-none",mistakes:["-khtml-"]}));let l=B(97287);s(l,{match:/a\sx/},e=>{C(["display-flex","inline-flex"],{browsers:e=e.map(e=>/ie|firefox/.test(e)?e:`${e} 2009`),feature:"flexbox",props:["display"]}),C(["flex","flex-grow","flex-shrink","flex-basis"],{browsers:e,feature:"flexbox"}),C(["flex-direction","flex-wrap","flex-flow","justify-content","order","align-items","align-self","align-content"],{browsers:e,feature:"flexbox"})}),s(l,{match:/y\sx/},e=>{i(["display-flex","inline-flex"],{browsers:e,feature:"flexbox"}),i(["flex","flex-grow","flex-shrink","flex-basis"],{browsers:e,feature:"flexbox"}),i(["flex-direction","flex-wrap","flex-flow","justify-content","order","align-items","align-self","align-content"],{browsers:e,feature:"flexbox"})}),s(B(89510),e=>C(["calc"],{browsers:e,feature:"calc",props:["*"]})),s(B(67160),e=>C(["background-origin","background-size"],{browsers:e,feature:"background-img-opts"})),s(B(31932),e=>C(["background-clip"],{browsers:e,feature:"background-clip-text"})),s(B(88233),e=>C(["font-feature-settings","font-variant-ligatures","font-language-override"],{browsers:e,feature:"font-feature"})),s(B(21659),e=>C(["font-kerning"],{browsers:e,feature:"font-kerning"})),s(B(28769),e=>C(["border-image"],{browsers:e,feature:"border-image"})),s(B(49943),e=>C(["::selection"],{browsers:e,feature:"css-selection",selector:!0})),s(B(88640),e=>{C(["::placeholder"],{browsers:e.concat(["ie 10 old","ie 11 old","firefox 18 old"]),feature:"css-placeholder",selector:!0})}),s(B(56080),e=>{C([":placeholder-shown"],{browsers:e,feature:"css-placeholder-shown",selector:!0})}),s(B(12492),e=>C(["hyphens"],{browsers:e,feature:"css-hyphens"})),s(B(44418),e=>C([":fullscreen"],{browsers:e,feature:"fullscreen",selector:!0})),s(B(85671),e=>C(["::backdrop"],{browsers:e,feature:"backdrop",selector:!0})),s(B(27894),e=>C(["::file-selector-button"],{browsers:e,feature:"file-selector-button",selector:!0})),s(B(18763),e=>C([":autofill"],{browsers:e,feature:"css-autofill",selector:!0})),s(B(32992),e=>C(["tab-size"],{browsers:e,feature:"css3-tabsize"}));let D=B(70693),c=["width","min-width","max-width","height","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size","grid","grid-template","grid-template-rows","grid-template-columns","grid-auto-columns","grid-auto-rows"];s(D,e=>C(["max-content","min-content"],{browsers:e,feature:"intrinsic-width",props:c})),s(D,{match:/x|\s#4/},e=>C(["fill","fill-available"],{browsers:e,feature:"intrinsic-width",props:c})),s(D,{match:/x|\s#5/},e=>C(["fit-content"],{browsers:e.filter(e=>{let[t,B]=e.split(" ");return"firefox"!==t&&"and_ff"!==t||parseInt(B)<94}),feature:"intrinsic-width",props:c})),s(B(29605),e=>C(["stretch"],{browsers:e,feature:"css-width-stretch",props:c})),s(B(44313),e=>C(["zoom-in","zoom-out"],{browsers:e,feature:"css3-cursors-newer",props:["cursor"]})),s(B(9544),e=>C(["grab","grabbing"],{browsers:e,feature:"css3-cursors-grab",props:["cursor"]})),s(B(92558),e=>C(["sticky"],{browsers:e,feature:"css-sticky",props:["position"]})),s(B(77970),e=>C(["touch-action"],{browsers:e,feature:"pointer"})),s(B(35767),{match:/x.*#[235]/},e=>C(["text-decoration-skip","text-decoration-skip-ink"],{browsers:e,feature:"text-decoration"})),s(B(62761),e=>C(["text-decoration"],{browsers:e,feature:"text-decoration"})),s(B(49793),e=>C(["text-decoration-color"],{browsers:e,feature:"text-decoration"})),s(B(22526),e=>C(["text-decoration-line"],{browsers:e,feature:"text-decoration"})),s(B(27863),e=>C(["text-decoration-style"],{browsers:e,feature:"text-decoration"})),s(B(85238),e=>C(["text-size-adjust"],{browsers:e,feature:"text-size-adjust"})),s(B(88844),e=>{C(["mask-clip","mask-composite","mask-image","mask-origin","mask-repeat","mask-border-repeat","mask-border-source"],{browsers:e,feature:"css-masks"}),C(["mask","mask-position","mask-size","mask-border","mask-border-outset","mask-border-width","mask-border-slice"],{browsers:e,feature:"css-masks"})}),s(B(98351),e=>C(["clip-path"],{browsers:e,feature:"css-clip-path"})),s(B(12831),e=>C(["box-decoration-break"],{browsers:e,feature:"css-boxdecorationbreak"})),s(B(15654),e=>C(["object-fit","object-position"],{browsers:e,feature:"object-fit"})),s(B(92263),e=>C(["shape-margin","shape-outside","shape-image-threshold"],{browsers:e,feature:"css-shapes"})),s(B(27475),e=>C(["text-overflow"],{browsers:e,feature:"text-overflow"})),s(B(80878),e=>C(["@viewport"],{browsers:e,feature:"css-deviceadaptation"})),s(B(19760),{match:/( x($| )|a #2)/},e=>C(["@resolution"],{browsers:e,feature:"css-media-resolution"})),s(B(48111),e=>C(["text-align-last"],{browsers:e,feature:"css-text-align-last"}));let p=B(97065);s(p,{match:/y x|a x #1/},e=>C(["pixelated"],{browsers:e,feature:"css-crisp-edges",props:["image-rendering"]})),s(p,{match:/a x #2/},e=>C(["image-rendering"],{browsers:e,feature:"css-crisp-edges"}));let f=B(71373);s(f,e=>C(["border-inline-start","border-inline-end","margin-inline-start","margin-inline-end","padding-inline-start","padding-inline-end"],{browsers:e,feature:"css-logical-props"})),s(f,{match:/x\s#2/},e=>C(["border-block-start","border-block-end","margin-block-start","margin-block-end","padding-block-start","padding-block-end"],{browsers:e,feature:"css-logical-props"})),s(B(23619),{match:/#2|x/},e=>C(["appearance"],{browsers:e,feature:"css-appearance"})),s(B(11414),e=>C(["scroll-snap-type","scroll-snap-coordinate","scroll-snap-destination","scroll-snap-points-x","scroll-snap-points-y"],{browsers:e,feature:"css-snappoints"})),s(B(24912),e=>C(["flow-into","flow-from","region-fragment"],{browsers:e,feature:"css-regions"})),s(B(1933),e=>C(["image-set"],{browsers:e,feature:"css-image-set",props:["background","background-image","border-image","cursor","mask","mask-image","list-style","list-style-image","content"]})),s(B(50933),{match:/a|x/},e=>C(["writing-mode"],{browsers:e,feature:"css-writing-mode"})),s(B(52636),e=>C(["cross-fade"],{browsers:e,feature:"css-cross-fade",props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"]})),s(B(92510),e=>C([":read-only",":read-write"],{browsers:e,feature:"css-read-only-write",selector:!0})),s(B(41011),e=>C(["text-emphasis","text-emphasis-position","text-emphasis-style","text-emphasis-color"],{browsers:e,feature:"text-emphasis"}));let d=B(22489);s(d,e=>{C(["display-grid","inline-grid"],{browsers:e,feature:"css-grid",props:["display"]}),C(["grid-template-columns","grid-template-rows","grid-row-start","grid-column-start","grid-row-end","grid-column-end","grid-row","grid-column","grid-area","grid-template","grid-template-areas","place-self"],{browsers:e,feature:"css-grid"})}),s(d,{match:/a x/},e=>C(["grid-column-align","grid-row-align"],{browsers:e,feature:"css-grid"})),s(B(68946),e=>C(["text-spacing"],{browsers:e,feature:"css-text-spacing"})),s(B(97896),e=>C([":any-link"],{browsers:e,feature:"css-any-link",selector:!0})),s(B(19445),e=>C(["isolate"],{browsers:e,feature:"css-unicode-bidi",props:["unicode-bidi"]})),s(B(59911),e=>C(["plaintext"],{browsers:e,feature:"css-unicode-bidi",props:["unicode-bidi"]})),s(B(86078),{match:/y x/},e=>C(["isolate-override"],{browsers:e,feature:"css-unicode-bidi",props:["unicode-bidi"]})),s(B(12045),{match:/a #1/},e=>C(["overscroll-behavior"],{browsers:e,feature:"css-overscroll-behavior"})),s(B(55661),e=>C(["text-orientation"],{browsers:e,feature:"css-text-orientation"})),s(B(2890),e=>C(["print-color-adjust","color-adjust"],{browsers:e,feature:"css-print-color-adjust"}))},79656:(e,t,B)=>{let u=B(57441);class r extends u{check(e){let t=e.value;return!t.toLowerCase().includes("alpha(")&&!t.includes("DXImageTransform.Microsoft")&&!t.includes("data:image/svg+xml")}}r.names=["filter"],e.exports=r},79720:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(13295))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.TAG,B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u}(r.default);t.default=C,e.exports=t.default},79749:(e,t,B)=>{let u=B(99552),r=B(87880);class s extends u{constructor(e,t,B){super(e,t,B),this.prefixes&&(this.prefixes=r.uniq(this.prefixes.map(()=>"-webkit-")))}prefixed(e){return"-webkit-"===e?"::-webkit-file-upload-button":`::${e}file-selector-button`}}s.names=["::file-selector-button"],e.exports=s},80378:e=>{"use strict";e.exports={combiningMarks:/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u,combiningClassVirama:/[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u,validZWNJ:/[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u,bidiDomain:/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,bidiS1LTR:/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u,bidiS1RTL:/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,bidiS2:/^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u,bidiS3:/[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u,bidiS4EN:/[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u,bidiS4AN:/[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u,bidiS5:/^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\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\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u,bidiS6:/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u}},80518:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(33631))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){for(var B=0;B{e.exports={A:{A:{2:"K D E F sC",164:"A B"},B:{66:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",164:"C L M G N O P"},C:{2:"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB",66:"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{2:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB AD BD CD DD JC qC ED KC",66:"0 hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{292:"cD"},I:{2:"PC J I dD eD fD gD rC hD iD"},J:{2:"D A"},K:{2:"A H",292:"B C JC qC KC"},L:{2:"I"},M:{2:"IC"},N:{164:"A B"},O:{2:"LC"},P:{2:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{66:"uD"},R:{2:"vD"},S:{2:"wD xD"}},B:5,C:"CSS Device Adaptation",D:!0}},81557:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){for(var t=arguments.length,B=new Array(t>1?t-1:0),u=1;u0;){var r=B.shift();e[r]||(e[r]={}),e=e[r]}},e.exports=t.default},81669:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(13295))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.UNIVERSAL,B.value="*",B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u}(r.default);t.default=C,e.exports=t.default},81752:e=>{"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,B){let u=[],r="",s=!1,n=0,C=!1,i="",o=!1;for(let B of e)o?o=!1:"\\"===B?o=!0:C?B===i&&(C=!1):'"'===B||"'"===B?(C=!0,i=B):"("===B?n+=1:")"===B?n>0&&(n-=1):0===n&&t.includes(B)&&(s=!0),s?(""!==r&&u.push(r.trim()),r="",s=!1):r+=B;return(B||""!==r)&&u.push(r.trim()),u}};e.exports=t,t.default=t},81883:(e,t,B)=>{let u=B(5180);class r extends u{constructor(e,t){super(e,t),"display-grid"===e&&(this.name="grid")}check(e){return"display"===e.prop&&e.value===this.name}}r.names=["display-grid","inline-grid"],e.exports=r},82648:(e,t,B)=>{"use strict";t.__esModule=!0,t.FIELDS=void 0,t.default=function(e){var t,B,u,r,n,C,i,o,a,l,c,p,f=[],d=e.css.valueOf(),h=d.length,A=-1,m=1,E=0,F=0;function v(t,B){if(!e.safe)throw e.error("Unclosed "+t,m,E-A,E);o=(d+=B).length-1}for(;E0?(a=m+C,l=o-i[C].length):(a=m,l=A),p=s.comment,m=a,u=a,B=o-l):t===s.slash?(p=t,u=m,B=E-A,F=(o=E)+1):(o=D(d,E),p=s.word,u=m,B=o-A),F=o+1}f.push([p,m,E-A,u,B,E,F]),l&&(A=l,l=null),E=F}return f};var u,r,s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var B=n(t);if(B&&B.has(e))return B.get(e);var u={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var C=r?Object.getOwnPropertyDescriptor(e,s):null;C&&(C.get||C.set)?Object.defineProperty(u,s,C):u[s]=e[s]}u.default=e,B&&B.set(e,u);return u}(B(70071));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,B=new WeakMap;return(n=function(e){return e?B:t})(e)}for(var C=((u={})[s.tab]=!0,u[s.newline]=!0,u[s.cr]=!0,u[s.feed]=!0,u),i=((r={})[s.space]=!0,r[s.tab]=!0,r[s.newline]=!0,r[s.cr]=!0,r[s.feed]=!0,r[s.ampersand]=!0,r[s.asterisk]=!0,r[s.bang]=!0,r[s.comma]=!0,r[s.colon]=!0,r[s.semicolon]=!0,r[s.openParenthesis]=!0,r[s.closeParenthesis]=!0,r[s.openSquare]=!0,r[s.closeSquare]=!0,r[s.singleQuote]=!0,r[s.doubleQuote]=!0,r[s.plus]=!0,r[s.pipe]=!0,r[s.tilde]=!0,r[s.greaterThan]=!0,r[s.equals]=!0,r[s.dollar]=!0,r[s.caret]=!0,r[s.slash]=!0,r),o={},a="0123456789abcdefABCDEF",l=0;l<22;l++)o[a.charCodeAt(l)]=!0;function D(e,t){var B,u=t;do{if(B=e.charCodeAt(u),i[B])return u-1;B===s.backslash?u=c(e,u)+1:u++}while(u{var t="-".charCodeAt(0),B="+".charCodeAt(0),u=".".charCodeAt(0),r="e".charCodeAt(0),s="E".charCodeAt(0);e.exports=function(e){var n,C,i,o=0,a=e.length;if(0===a||!function(e){var r,s=e.charCodeAt(0);if(s===B||s===t){if((r=e.charCodeAt(1))>=48&&r<=57)return!0;var n=e.charCodeAt(2);return r===u&&n>=48&&n<=57}return s===u?(r=e.charCodeAt(1))>=48&&r<=57:s>=48&&s<=57}(e))return!1;for((n=e.charCodeAt(o))!==B&&n!==t||o++;o57);)o+=1;if(n=e.charCodeAt(o),C=e.charCodeAt(o+1),n===u&&C>=48&&C<=57)for(o+=2;o57);)o+=1;if(n=e.charCodeAt(o),C=e.charCodeAt(o+1),i=e.charCodeAt(o+2),(n===r||n===s)&&(C>=48&&C<=57||(C===B||C===t)&&i>=48&&i<=57))for(o+=C===B||C===t?3:2;o57);)o+=1;return{number:e.slice(0,o),unit:e.slice(o)}}},83303:(e,t,B)=>{"use strict";let u=B(47668);function r(e,t){new u(t).stringify(e)}e.exports=r,r.default=r},84151:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},84211:(e,t,B)=>{"use strict";let u=B(13604),r=B(69577);const s=B(33717);let n=B(83303);B(6156);class C{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,B){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=B,this._map=void 0;let C=n;this.result=new s(this._processor,r,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new u(C,r,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}e.exports=C,C.default=C},84328:(e,t,B)=>{let u=B(94364),{agents:r}=B(76019),s=B(87880);e.exports=class{constructor(e,t,B,u){this.data=e,this.options=B||{},this.browserslistOpts=u||{},this.selected=this.parse(t)}static prefixes(){if(this.prefixesCache)return this.prefixesCache;this.prefixesCache=[];for(let e in r)this.prefixesCache.push(`-${r[e].prefix}-`);return this.prefixesCache=s.uniq(this.prefixesCache).sort((e,t)=>t.length-e.length),this.prefixesCache}static withPrefix(e){return this.prefixesRegexp||(this.prefixesRegexp=new RegExp(this.prefixes().join("|"))),this.prefixesRegexp.test(e)}isSelected(e){return this.selected.includes(e)}parse(e){let t={};for(let e in this.browserslistOpts)t[e]=this.browserslistOpts[e];return t.path=this.options.from,u(e,t)}prefix(e){let[t,B]=e.split(" "),u=this.data[t],r=u.prefix_exceptions&&u.prefix_exceptions[B];return r||(r=u.prefix),`-${r}-`}}},85238:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",33:"C L M G N O P"},C:{2:"0 1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC wC xC"},D:{1:"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB",258:"7"},E:{2:"J UB K D E F A B C L M G yC WC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",258:"zC"},F:{1:"0 kB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB lB AD BD CD DD JC qC ED KC"},G:{2:"WC FD rC",33:"E GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{33:"IC"},N:{161:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J"},Q:{1:"uD"},R:{1:"vD"},S:{2:"wD xD"}},B:7,C:"CSS text-size-adjust",D:!0}},85252:(e,t,B)=>{"use strict";const{utf8Encode:u,utf8DecodeWithoutBOM:r}=B(58408),{percentDecodeBytes:s,utf8PercentEncodeString:n,isURLEncodedPercentEncode:C}=B(41656);function i(e){return e.codePointAt(0)}function o(e,t,B){let u=e.indexOf(t);for(;u>=0;)e[u]=B,u=e.indexOf(t,u+1);return e}e.exports={parseUrlencodedString:function(e){return function(e){const t=function(e,t){const B=[];let u=0,r=e.indexOf(t);for(;r>=0;)B.push(e.slice(u,r)),u=r+1,r=e.indexOf(t,u);return u!==e.length&&B.push(e.slice(u)),B}(e,i("&")),B=[];for(const e of t){if(0===e.length)continue;let t,u;const n=e.indexOf(i("="));n>=0?(t=e.slice(0,n),u=e.slice(n+1)):(t=e,u=new Uint8Array(0)),t=o(t,43,32),u=o(u,43,32);const C=r(s(t)),a=r(s(u));B.push([C,a])}return B}(u(e))},serializeUrlencoded:function(e){let t="";for(const[B,u]of e.entries()){0!==B&&(t+="&"),t+=`${n(u[0],C,!0)}=${n(u[1],C,!0)}`}return t}}},85316:(e,t,B)=>{let u=B(99552),r=B(87880);class s extends u{constructor(e,t,B){super(e,t,B),this.prefixes&&(this.prefixes=r.uniq(this.prefixes.map(()=>"-webkit-")))}prefixed(e){return"-webkit-"===e?":-webkit-autofill":`:${e}autofill`}}s.names=[":autofill"],e.exports=s},85588:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0,t.unescapeValue=d;var u,r=i(B(68937)),s=i(B(35286)),n=i(B(13295)),C=B(11581);function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var B=0;B0)||e.quoted||0!==B.before.length||e.spaces.value&&e.spaces.value.after||(B.before=" "),m(t,B)}))),t.push("]"),t.push(this.rawSpaceAfter),t.join("")},s=u,(n=[{key:"quoted",get:function(){var e=this.quoteMark;return"'"===e||'"'===e},set:function(e){p()}},{key:"quoteMark",get:function(){return this._quoteMark},set:function(e){this._constructed?this._quoteMark!==e&&(this._quoteMark=e,this._syncRawValue()):this._quoteMark=e}},{key:"qualifiedAttribute",get:function(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function(){return this.insensitive?"i":""}},{key:"value",get:function(){return this._value},set:function(e){if(this._constructed){var t=d(e),B=t.deprecatedUsage,u=t.unescaped,r=t.quoteMark;if(B&&c(),u===this._value&&r===this._quoteMark)return;this._value=u,this._quoteMark=r,this._syncRawValue()}else this._value=e}},{key:"insensitive",get:function(){return this._insensitive},set:function(e){e||(this._insensitive=!1,!this.raws||"I"!==this.raws.insensitiveFlag&&"i"!==this.raws.insensitiveFlag||(this.raws.insensitiveFlag=void 0)),this._insensitive=e}},{key:"attribute",get:function(){return this._attribute},set:function(e){this._handleEscapes("attribute",e),this._attribute=e}}])&&o(s.prototype,n),i&&o(s,i),Object.defineProperty(s,"prototype",{writable:!1}),u}(n.default);t.default=h,h.NO_QUOTE=null,h.SINGLE_QUOTE="'",h.DOUBLE_QUOTE='"';var A=((u={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}}).null={isIdentifier:!0},u);function m(e,t){return""+t.before+e+t.after}},85616:(e,t)=>{"use strict";function B(e,t,B){return B.globals&&(e=B.globals[e.name]),new e(`${B.context?B.context:"Value"} ${t}.`)}function u(e,t){if("bigint"==typeof e)throw B(TypeError,"is a BigInt which cannot be converted to a number",t);return t.globals?t.globals.Number(e):Number(e)}function r(e){return C(e>0&&e%1==.5&&!(1&e)||e<0&&e%1==-.5&&!(1&~e)?Math.floor(e):Math.round(e))}function s(e){return C(Math.trunc(e))}function n(e){return e<0?-1:1}function C(e){return 0===e?0:e}function i(e,{unsigned:t}){let i,o;t?(i=0,o=2**e-1):(i=-(2**(e-1)),o=2**(e-1)-1);const a=2**e,l=2**(e-1);return(e,D={})=>{let c=u(e,D);if(c=C(c),D.enforceRange){if(!Number.isFinite(c))throw B(TypeError,"is not a finite number",D);if(c=s(c),co)throw B(TypeError,`is outside the accepted range of ${i} to ${o}, inclusive`,D);return c}return!Number.isNaN(c)&&D.clamp?(c=Math.min(Math.max(c,i),o),c=r(c),c):Number.isFinite(c)&&0!==c?(c=s(c),c>=i&&c<=o?c:(c=function(e,t){const B=e%t;return n(t)!==n(B)?B+t:B}(c,a),!t&&c>=l?c-a:c)):0}}function o(e,{unsigned:t}){const n=Number.MAX_SAFE_INTEGER,i=t?0:Number.MIN_SAFE_INTEGER,o=t?BigInt.asUintN:BigInt.asIntN;return(t,a={})=>{let l=u(t,a);if(l=C(l),a.enforceRange){if(!Number.isFinite(l))throw B(TypeError,"is not a finite number",a);if(l=s(l),ln)throw B(TypeError,`is outside the accepted range of ${i} to ${n}, inclusive`,a);return l}if(!Number.isNaN(l)&&a.clamp)return l=Math.min(Math.max(l,i),n),l=r(l),l;if(!Number.isFinite(l)||0===l)return 0;let D=BigInt(s(l));return D=o(e,D),Number(D)}}t.any=e=>e,t.undefined=()=>{},t.boolean=e=>Boolean(e),t.byte=i(8,{unsigned:!1}),t.octet=i(8,{unsigned:!0}),t.short=i(16,{unsigned:!1}),t["unsigned short"]=i(16,{unsigned:!0}),t.long=i(32,{unsigned:!1}),t["unsigned long"]=i(32,{unsigned:!0}),t["long long"]=o(64,{unsigned:!1}),t["unsigned long long"]=o(64,{unsigned:!0}),t.double=(e,t={})=>{const r=u(e,t);if(!Number.isFinite(r))throw B(TypeError,"is not a finite floating-point value",t);return r},t["unrestricted double"]=(e,t={})=>u(e,t),t.float=(e,t={})=>{const r=u(e,t);if(!Number.isFinite(r))throw B(TypeError,"is not a finite floating-point value",t);if(Object.is(r,-0))return r;const s=Math.fround(r);if(!Number.isFinite(s))throw B(TypeError,"is outside the range of a single-precision floating-point value",t);return s},t["unrestricted float"]=(e,t={})=>{const B=u(e,t);return isNaN(B)||Object.is(B,-0)?B:Math.fround(B)},t.DOMString=(e,t={})=>{if(t.treatNullAsEmptyString&&null===e)return"";if("symbol"==typeof e)throw B(TypeError,"is a symbol, which cannot be converted to a string",t);return(t.globals?t.globals.String:String)(e)},t.ByteString=(e,u={})=>{const r=t.DOMString(e,u);let s;for(let e=0;void 0!==(s=r.codePointAt(e));++e)if(s>255)throw B(TypeError,"is not a valid ByteString",u);return r},t.USVString=(e,B={})=>{const u=t.DOMString(e,B),r=u.length,s=[];for(let e=0;e57343)s.push(String.fromCodePoint(t));else if(56320<=t&&t<=57343)s.push(String.fromCodePoint(65533));else if(e===r-1)s.push(String.fromCodePoint(65533));else{const B=u.charCodeAt(e+1);if(56320<=B&&B<=57343){const u=1023&t,r=1023&B;s.push(String.fromCodePoint(65536+1024*u+r)),++e}else s.push(String.fromCodePoint(65533))}}return s.join("")},t.object=(e,t={})=>{if(null===e||"object"!=typeof e&&"function"!=typeof e)throw B(TypeError,"is not an object",t);return e};const a=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,l="function"==typeof SharedArrayBuffer?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get:null;function D(e){try{return a.call(e),!0}catch{return!1}}function c(e){try{return l.call(e),!0}catch{return!1}}function p(e){try{return new Uint8Array(e),!1}catch{return!0}}t.ArrayBuffer=(e,t={})=>{if(!D(e)){if(t.allowShared&&!c(e))throw B(TypeError,"is not an ArrayBuffer or SharedArrayBuffer",t);throw B(TypeError,"is not an ArrayBuffer",t)}if(p(e))throw B(TypeError,"is a detached ArrayBuffer",t);return e};const f=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;t.DataView=(e,t={})=>{try{f.call(e)}catch(e){throw B(TypeError,"is not a DataView",t)}if(!t.allowShared&&c(e.buffer))throw B(TypeError,"is backed by a SharedArrayBuffer, which is not allowed",t);if(p(e.buffer))throw B(TypeError,"is backed by a detached ArrayBuffer",t);return e};const d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach(e=>{const{name:u}=e,r=/^[AEIOU]/u.test(u)?"an":"a";t[u]=(e,t={})=>{if(!ArrayBuffer.isView(e)||d.call(e)!==u)throw B(TypeError,`is not ${r} ${u} object`,t);if(!t.allowShared&&c(e.buffer))throw B(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(p(e.buffer))throw B(TypeError,"is a view on a detached ArrayBuffer",t);return e}}),t.ArrayBufferView=(e,t={})=>{if(!ArrayBuffer.isView(e))throw B(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",t);if(!t.allowShared&&c(e.buffer))throw B(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(p(e.buffer))throw B(TypeError,"is a view on a detached ArrayBuffer",t);return e},t.BufferSource=(e,t={})=>{if(ArrayBuffer.isView(e)){if(!t.allowShared&&c(e.buffer))throw B(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(p(e.buffer))throw B(TypeError,"is a view on a detached ArrayBuffer",t);return e}if(!t.allowShared&&!D(e))throw B(TypeError,"is not an ArrayBuffer or a view on one",t);if(t.allowShared&&!c(e)&&!D(e))throw B(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",t);if(p(e))throw B(TypeError,"is a detached ArrayBuffer",t);return e},t.DOMTimeStamp=t["unsigned long long"]},85671:e=>{e.exports={A:{D:{1:"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB",33:"ZB aB bB cB dB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",33:"C L M G N O P"},C:{1:"0 oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB wC xC"},M:{1:"IC"},A:{2:"K D E F A sC",33:"B"},F:{1:"0 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C G N O P AD BD CD DD JC qC ED KC",33:"1 2 3 4 VB"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC 9C"},G:{1:"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},I:{1:"I",2:"PC J dD eD fD gD rC",33:"hD iD"}},B:6,C:"CSS ::backdrop pseudo-element",D:void 0}},85705:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{insert(e,t,B){let u;if([u,t]=r(t),2009!==u)return super.insert(e,t,B);if(e.parent.some(e=>e.prop===t+"box-orient"||e.prop===t+"box-direction"))return;let s,n,C=e.value;"inherit"===C||"initial"===C||"unset"===C?(n=C,s=C):(n=C.includes("row")?"horizontal":"vertical",s=C.includes("reverse")?"reverse":"normal");let i=this.clone(e);return i.prop=t+"box-orient",i.value=n,this.needCascade(e)&&(i.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,i),i=this.clone(e),i.prop=t+"box-direction",i.value=s,this.needCascade(e)&&(i.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,i)}normalize(){return"flex-direction"}old(e,t){let B;return[B,t]=r(t),2009===B?[t+"box-orient",t+"box-direction"]:super.old(e,t)}}s.names=["flex-direction","box-direction","box-orient"],e.exports=s},85799:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(44646))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.STRING,B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u}(r.default);t.default=C,e.exports=t.default},86078:e=>{e.exports={A:{D:{1:"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB"},L:{1:"I"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC J UB K D E F A B C L M G N wC xC",33:"1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB"},M:{1:"IC"},A:{2:"K D E F A B sC"},F:{1:"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB AD BD CD DD JC qC ED KC"},K:{1:"H",2:"A B C JC qC KC"},E:{1:"B C L M G JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC",2:"J UB K yC WC zC 0C 9C",33:"D E F A 1C 2C XC"},G:{1:"OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD",33:"E ID JD KD LD MD ND"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"}},B:6,C:"isolate-override from unicode-bidi",D:void 0}},87880:(e,t,B)=>{let{list:u}=B(12895);e.exports.error=function(e){let t=new Error(e);throw t.autoprefixer=!0,t},e.exports.uniq=function(e){return[...new Set(e)]},e.exports.removeNote=function(e){return e.includes(" ")?e.split(" ")[0]:e},e.exports.escapeRegexp=function(e){return e.replace(/[$()*+-.?[\\\]^{|}]/g,"\\$&")},e.exports.regexp=function(e,t=!0){return t&&(e=this.escapeRegexp(e)),new RegExp(`(^|[\\s,(])(${e}($|[\\s(,]))`,"gi")},e.exports.editList=function(e,t){let B=u.comma(e),r=t(B,[]);if(B===r)return e;let s=e.match(/,\s*/);return s=s?s[0]:", ",r.join(s)},e.exports.splitSelector=function(e){return u.comma(e).map(e=>u.space(e).map(e=>e.split(/(?=\.|#)/g)))},e.exports.isPureNumber=function(e){return"number"==typeof e||"string"==typeof e&&/^[0-9]+$/.test(e)}},88233:e=>{e.exports={A:{A:{1:"A B",2:"K D E F sC"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC xC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB",164:"J UB K D E F A B C L M"},D:{1:"0 pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"J UB K D E F A B C L M G",33:"2 3 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB",292:"1 N O P VB"},E:{1:"A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"D E F yC WC 0C 1C",4:"J UB K zC"},F:{1:"0 cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB"},G:{1:"LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"E ID JD KD",4:"WC FD rC GD HD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC",33:"hD iD"},J:{2:"D",33:"A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD",33:"J"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:2,C:"CSS font-feature-settings",D:!0}},88449:e=>{e.exports=function e(t,B,u){var r,s,n,C;for(r=0,s=t.length;r{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",36:"C L M G N O P"},C:{1:"0 sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",33:"1 2 3 4 5 6 7 8 9 VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB",130:"tC PC J UB K D E F A B C L M G N O P wC xC"},D:{1:"0 yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",36:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB"},E:{1:"B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J yC WC",36:"UB K D E F A zC 0C 1C 2C"},F:{1:"0 lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",36:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB"},G:{1:"ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD",36:"E rC GD HD ID JD KD LD MD"},H:{2:"cD"},I:{1:"I",36:"PC J dD eD fD gD rC hD iD"},J:{36:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{36:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 lD mD nD XC oD pD qD rD sD MC NC OC tD",36:"J jD kD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",33:"wD"}},B:5,C:"::placeholder CSS pseudo-element",D:!0}},88844:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N",164:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB",3138:"O",12292:"P"},C:{1:"0 uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC",260:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB wC xC"},D:{1:"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",164:"0 1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB"},E:{1:"ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"yC WC",164:"J UB K D E F A B C L M G zC 0C 1C 2C XC JC KC 3C 4C 5C YC"},F:{1:"0 p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",164:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o"},G:{1:"ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",164:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC"},H:{2:"cD"},I:{1:"I",164:"hD iD",676:"PC J dD eD fD gD rC"},J:{164:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{164:"LC"},P:{1:"6 7 8 9",164:"1 2 3 4 5 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{164:"uD"},R:{164:"vD"},S:{1:"xD",260:"wD"}},B:4,C:"CSS Masks",D:!0}},89510:e=>{e.exports={A:{A:{2:"K D E sC",260:"F",516:"A B"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC xC",33:"J UB K D E F A B C L M G"},D:{1:"0 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"J UB K D E F A B C L M G N O P",33:"1 2 3 4 5 6 VB"},E:{1:"D E F A B C L M G 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC zC",33:"K"},F:{1:"0 1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC"},G:{1:"E ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",33:"HD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC",132:"hD iD"},J:{1:"A",2:"D"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"calc() as CSS unit value",D:!0}},90336:(e,t,B)=>{let u=B(5180);class r extends u{constructor(e,t){super(e,t),"filter-function"===e&&(this.name="filter")}}r.names=["filter","filter-function"],e.exports=r},90562:e=>{e.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"ios_saf",H:"op_mini",I:"android",J:"bb",K:"op_mob",L:"and_chr",M:"and_ff",N:"ie_mob",O:"and_uc",P:"samsung",Q:"and_qq",R:"baidu",S:"kaios"}},91396:e=>{e.exports=class{constructor(e,t){this.prefix=t,this.prefixed=e.prefixed(this.prefix),this.regexp=e.regexp(this.prefix),this.prefixeds=e.possible().map(t=>[e.prefixed(t),e.regexp(t)]),this.unprefixed=e.name,this.nameRegexp=e.regexp()}check(e){return!!e.selector.includes(this.prefixed)&&(!!e.selector.match(this.regexp)&&!this.isHack(e))}isHack(e){let t=e.parent.index(e)+1,B=e.parent.nodes;for(;t{let u=B(57441);class r extends u{normalize(){return this.name.replace("box-image","border")}prefixed(e,t){let B=super.prefixed(e,t);return"-webkit-"===t&&(B=B.replace("border","box-image")),B}}r.names=["mask-border","mask-border-source","mask-border-slice","mask-border-width","mask-border-outset","mask-border-repeat","mask-box-image","mask-box-image-source","mask-box-image-slice","mask-box-image-width","mask-box-image-outset","mask-box-image-repeat"],e.exports=r},91563:(e,t,B)=>{let u=B(57441),r=B(87880);class s extends u{constructor(e,t,B){super(e,t,B),this.prefixes&&(this.prefixes=r.uniq(this.prefixes.map(e=>"-ms-"===e?"-webkit-":e)))}}s.names=["backdrop-filter"],e.exports=s},91704:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(44646))&&u.__esModule?u:{default:u},s=B(11581);function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}var C=function(e){var t,B;function u(t){var B;return(B=e.call(this,t)||this).type=s.COMBINATOR,B}return B=e,(t=u).prototype=Object.create(B.prototype),t.prototype.constructor=t,n(t,B),u}(r.default);t.default=C,e.exports=t.default},92099:(e,t,B)=>{let u=B(76134);e.exports=class extends u{add(e,t){let B=t+e.name;if(e.parent.some(t=>t.name===B&&t.params===e.params))return;let u=this.clone(e,{name:B});return e.parent.insertBefore(e,u)}process(e){let t=this.parentPrefix(e);for(let B of this.prefixes)t&&t!==B||this.add(e,B)}}},92263:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB wC xC",322:"sB tB uB vB wB xB yB zB QC 0B RC"},D:{1:"0 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB",194:"bB cB dB"},E:{1:"B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K D yC WC zC 0C",33:"E F A 1C 2C"},F:{1:"0 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 F B C G N O P VB AD BD CD DD JC qC ED KC"},G:{1:"ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD HD ID",33:"E JD KD LD MD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",2:"wD"}},B:4,C:"CSS Shapes Level 1",D:!0}},92270:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N",257:"O P"},C:{1:"0 m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B wC xC",578:"9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l"},D:{1:"0 FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB",194:"oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC"},E:{1:"OC kC lC mC nC oC pC 9C",2:"J UB K D E yC WC zC 0C 1C",33:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C"},F:{1:"0 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB AD BD CD DD JC qC ED KC",194:"bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B"},G:{1:"OC kC lC mC nC oC pC",2:"E WC FD rC GD HD ID JD",33:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 pD qD rD sD MC NC OC tD",2:"J",194:"jD kD lD mD nD XC oD"},Q:{2:"uD"},R:{1:"vD"},S:{2:"wD xD"}},B:7,C:"CSS Backdrop Filter",D:!0}},92417:(e,t,B)=>{let u=B(99552);class r extends u{possible(){return super.possible().concat(["-moz- old","-ms- old"])}prefixed(e){return"-webkit-"===e?"::-webkit-input-placeholder":"-ms-"===e?"::-ms-input-placeholder":"-ms- old"===e?":-ms-input-placeholder":"-moz- old"===e?":-moz-placeholder":`::${e}placeholder`}}r.names=["::placeholder"],e.exports=r},92472:e=>{"use strict";e.exports=JSON.parse('[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"−"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"Ꭸ"],[43897,1,"Ꭹ"],[43898,1,"Ꭺ"],[43899,1,"Ꭻ"],[43900,1,"Ꭼ"],[43901,1,"Ꭽ"],[43902,1,"Ꭾ"],[43903,1,"Ꭿ"],[43904,1,"Ꮀ"],[43905,1,"Ꮁ"],[43906,1,"Ꮂ"],[43907,1,"Ꮃ"],[43908,1,"Ꮄ"],[43909,1,"Ꮅ"],[43910,1,"Ꮆ"],[43911,1,"Ꮇ"],[43912,1,"Ꮈ"],[43913,1,"Ꮉ"],[43914,1,"Ꮊ"],[43915,1,"Ꮋ"],[43916,1,"Ꮌ"],[43917,1,"Ꮍ"],[43918,1,"Ꮎ"],[43919,1,"Ꮏ"],[43920,1,"Ꮐ"],[43921,1,"Ꮑ"],[43922,1,"Ꮒ"],[43923,1,"Ꮓ"],[43924,1,"Ꮔ"],[43925,1,"Ꮕ"],[43926,1,"Ꮖ"],[43927,1,"Ꮗ"],[43928,1,"Ꮘ"],[43929,1,"Ꮙ"],[43930,1,"Ꮚ"],[43931,1,"Ꮛ"],[43932,1,"Ꮜ"],[43933,1,"Ꮝ"],[43934,1,"Ꮞ"],[43935,1,"Ꮟ"],[43936,1,"Ꮠ"],[43937,1,"Ꮡ"],[43938,1,"Ꮢ"],[43939,1,"Ꮣ"],[43940,1,"Ꮤ"],[43941,1,"Ꮥ"],[43942,1,"Ꮦ"],[43943,1,"Ꮧ"],[43944,1,"Ꮨ"],[43945,1,"Ꮩ"],[43946,1,"Ꮪ"],[43947,1,"Ꮫ"],[43948,1,"Ꮬ"],[43949,1,"Ꮭ"],[43950,1,"Ꮮ"],[43951,1,"Ꮯ"],[43952,1,"Ꮰ"],[43953,1,"Ꮱ"],[43954,1,"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,"\\""],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"\'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69371],3],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118015],3],[[118016,118451],2],[[118452,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[[129674,129678],3],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[[129735,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[[129770,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]')},92510:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C"},C:{1:"0 HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",16:"tC",33:"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC wC xC"},D:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",16:"J UB K D E F A B C L M",132:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",16:"yC WC",132:"J UB K D E zC 0C 1C"},F:{1:"0 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",16:"F B AD BD CD DD JC",132:"1 2 3 C G N O P VB qC ED KC"},G:{1:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",16:"WC FD",132:"E rC GD HD ID JD"},H:{2:"cD"},I:{1:"I",16:"dD eD",132:"PC J fD gD rC hD iD"},J:{1:"A",132:"D"},K:{1:"H",2:"A B JC",132:"C qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",33:"wD"}},B:1,C:"CSS :read-only and :read-write selectors",D:!0}},92558:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G",1028:"Q H R S T U V W X Y Z",4100:"N O P"},C:{1:"0 QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"1 2 3 4 5 6 tC PC J UB K D E F A B C L M G N O P VB wC xC",194:"7 8 9 WB XB YB",516:"ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB"},D:{1:"0 a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",2:"1 2 3 J UB K D E F A B C L M G N O P VB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB",322:"4 5 6 7 8 9 WB XB YB ZB aB bB cB dB tB uB vB wB",1028:"xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z"},E:{1:"L M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB K yC WC zC",33:"E F A B C 1C 2C XC JC KC",2084:"D 0C"},F:{1:"0 HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"1 2 3 4 5 6 7 8 9 F B C G N O P VB WB XB YB ZB aB bB cB dB eB fB AD BD CD DD JC qC ED KC",322:"gB hB iB",1028:"jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC"},G:{1:"SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC GD",33:"E JD KD LD MD ND OD PD QD RD",2084:"HD ID"},H:{2:"cD"},I:{1:"I",2:"PC J dD eD fD gD rC hD iD"},J:{2:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD",2:"J jD"},Q:{1028:"uD"},R:{1:"vD"},S:{1:"xD",516:"wD"}},B:5,C:"CSS position:sticky",D:!0}},93147:e=>{"use strict";e.exports=JSON.parse('{"v0.8":{"start":"2012-06-25","end":"2014-07-31"},"v0.10":{"start":"2013-03-11","end":"2016-10-31"},"v0.12":{"start":"2015-02-06","end":"2016-12-31"},"v4":{"start":"2015-09-08","lts":"2015-10-12","maintenance":"2017-04-01","end":"2018-04-30","codename":"Argon"},"v5":{"start":"2015-10-29","maintenance":"2016-04-30","end":"2016-06-30"},"v6":{"start":"2016-04-26","lts":"2016-10-18","maintenance":"2018-04-30","end":"2019-04-30","codename":"Boron"},"v7":{"start":"2016-10-25","maintenance":"2017-04-30","end":"2017-06-30"},"v8":{"start":"2017-05-30","lts":"2017-10-31","maintenance":"2019-01-01","end":"2019-12-31","codename":"Carbon"},"v9":{"start":"2017-10-01","maintenance":"2018-04-01","end":"2018-06-30"},"v10":{"start":"2018-04-24","lts":"2018-10-30","maintenance":"2020-05-19","end":"2021-04-30","codename":"Dubnium"},"v11":{"start":"2018-10-23","maintenance":"2019-04-22","end":"2019-06-01"},"v12":{"start":"2019-04-23","lts":"2019-10-21","maintenance":"2020-11-30","end":"2022-04-30","codename":"Erbium"},"v13":{"start":"2019-10-22","maintenance":"2020-04-01","end":"2020-06-01"},"v14":{"start":"2020-04-21","lts":"2020-10-27","maintenance":"2021-10-19","end":"2023-04-30","codename":"Fermium"},"v15":{"start":"2020-10-20","maintenance":"2021-04-01","end":"2021-06-01"},"v16":{"start":"2021-04-20","lts":"2021-10-26","maintenance":"2022-10-18","end":"2023-09-11","codename":"Gallium"},"v17":{"start":"2021-10-19","maintenance":"2022-04-01","end":"2022-06-01"},"v18":{"start":"2022-04-19","lts":"2022-10-25","maintenance":"2023-10-18","end":"2025-04-30","codename":"Hydrogen"},"v19":{"start":"2022-10-18","maintenance":"2023-04-01","end":"2023-06-01"},"v20":{"start":"2023-04-18","lts":"2023-10-24","maintenance":"2024-10-22","end":"2026-04-30","codename":"Iron"},"v21":{"start":"2023-10-17","maintenance":"2024-04-01","end":"2024-06-01"},"v22":{"start":"2024-04-24","lts":"2024-10-29","maintenance":"2025-10-21","end":"2027-04-30","codename":"Jod"},"v23":{"start":"2024-10-16","maintenance":"2025-04-01","end":"2025-06-01"},"v24":{"start":"2025-04-22","lts":"2025-10-28","maintenance":"2026-10-20","end":"2028-04-30","codename":""}}')},93475:(e,t,B)=>{let u=B(24528),r=B(76134),s=B(87880);const n=/(min|max)-resolution\s*:\s*\d*\.?\d+(dppx|dpcm|dpi|x)/gi,C=/(min|max)-resolution(\s*:\s*)(\d*\.?\d+)(dppx|dpcm|dpi|x)/i;e.exports=class extends r{clean(e){if(!this.bad){this.bad=[];for(let e of this.prefixes)this.bad.push(this.prefixName(e,"min")),this.bad.push(this.prefixName(e,"max"))}e.params=s.editList(e.params,e=>e.filter(e=>this.bad.every(t=>!e.includes(t))))}prefixName(e,t){return"-moz-"===e?t+"--moz-device-pixel-ratio":e+t+"-device-pixel-ratio"}prefixQuery(e,t,B,r,s){return r=new u(r),"dpi"===s?r=r.div(96):"dpcm"===s&&(r=r.mul(2.54).div(96)),r=r.simplify(),"-o-"===e&&(r=r.n+"/"+r.d),this.prefixName(e,t)+B+r}process(e){let t=this.parentPrefix(e),B=t?[t]:this.prefixes;e.params=s.editList(e.params,(e,t)=>{for(let u of e)if(u.includes("min-resolution")||u.includes("max-resolution")){for(let e of B){let B=u.replace(n,t=>{let B=t.match(C);return this.prefixQuery(e,B[1],B[2],B[3],B[4])});t.push(B)}t.push(u)}else t.push(u);return s.uniq(t)})}}},93775:e=>{var t=["utf8","utf-8","unicode-1-1-utf-8"];e.exports={TextEncoder:function(e){if(t.indexOf(e)<0&&void 0!==e&&null!=e)throw new RangeError("Invalid encoding type. Only utf-8 is supported");this.encoding="utf-8",this.encode=function(e){if("string"!=typeof e)throw new TypeError("passed argument must be of tye string");var t=unescape(encodeURIComponent(e)),B=new Uint8Array(t.length);const u=t.split("");for(let e=0;e{"use strict";let{existsSync:u,readFileSync:r}=B(19977),{dirname:s,join:n}=B(197),{SourceMapConsumer:C,SourceMapGenerator:i}=B(21866);class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let B=t.map?t.map.prev:void 0,u=this.loadMap(t.from,B);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),u&&(this.text=u)}consumer(){return this.consumerCache||(this.consumerCache=new C(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let B=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(B)return u=e.substr(B[0].length),Buffer?Buffer.from(u,"base64").toString():window.atob(u);var u;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let B=e.lastIndexOf(t.pop()),u=e.indexOf("*/",B);B>-1&&u>-1&&(this.annotation=this.getAnnotationURL(e.substring(B,u)))}loadFile(e){if(this.root=s(e),u(e))return this.mapFile=e,r(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof C)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let B=t(e);if(B){let e=this.loadFile(B);if(!e)throw new Error("Unable to load previous source map: "+B.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(s(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=o,o.default=o},93928:(e,t,B)=>{var u=B(74150);function r(){}e.exports={loadQueries:function(){throw new u("Sharable configs are not supported in client-side build of Browserslist")},getStat:function(e){return e.stats},loadConfig:function(e){if(e.config)throw new u("Browserslist config are not supported in client-side build")},loadCountry:function(){throw new u("Country statistics are not supported in client-side build of Browserslist")},loadFeature:function(){throw new u("Supports queries are not available in client-side build of Browserslist")},currentNode:function(e,t){return e(["maintained node versions"],t)[0]},parseConfig:r,readConfig:r,findConfig:r,findConfigFile:r,clearCaches:r,oldDataWarning:r,env:{}}},94048:(e,t,B)=>{let u=B(57441);class r extends u{insert(e,t,B){let u,s="mask-composite"===e.prop;u=s?e.value.split(","):e.value.match(r.regexp)||[],u=u.map(e=>e.trim()).filter(e=>e);let n,C=u.length;if(C&&(n=this.clone(e),n.value=u.map(e=>r.oldValues[e]||e).join(", "),u.includes("intersect")&&(n.value+=", xor"),n.prop=t+"mask-composite"),s){if(!C)return;return this.needCascade(e)&&(n.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,n)}let i=this.clone(e);return i.prop=t+i.prop,C&&(i.value=i.value.replace(r.regexp,"")),this.needCascade(e)&&(i.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,i),C?(this.needCascade(e)&&(n.raws.before=this.calcBefore(B,e,t)),e.parent.insertBefore(e,n)):e}}r.names=["mask","mask-composite"],r.oldValues={add:"source-over",exclude:"xor",intersect:"source-in",subtract:"source-out"},r.regexp=new RegExp(`\\s+(${Object.keys(r.oldValues).join("|")})\\b(?!\\))\\s*(?=[,])`,"ig"),e.exports=r},94059:(e,t,B)=>{"use strict";const u=B(2637),r=B(97161),s=B(62660).browsers,n=B(5040).browserVersions,C=Math.log(2);function i(e){let t={status:u[e.B],title:e.C,shown:e.D};return t.stats=Object.keys(e.A).reduce((t,B)=>{let u=e.A[B];return t[s[B]]=Object.keys(u).reduce((e,t)=>{let B=u[t].split(" "),s=function(e){let t=Object.keys(r).reduce((t,B)=>(e&r[B]&&t.push(B),t),[]),B=e>>7,u=[];for(;B;){let e=Math.floor(Math.log(B)/C)+1;u.unshift(`#${e}`),B-=Math.pow(2,e-1)}return t.concat(u).join(" ")}(t);return B.forEach(t=>e[n[t]]=s),e},{}),t},{}),t}e.exports=i,e.exports.default=i},94364:(e,t,B)=>{var u=B(73909),r=B(76019).agents,s=B(68093),n=B(93147),C=B(18411),i=B(74150),o=B(93928),a=B(6319);function l(e,t){return 0===(e+".").indexOf(t+".")}function D(e){return e.filter(function(e){return"string"==typeof e})}function c(e){var t=e;return 3===e.split(".").length&&(t=e.split(".").slice(0,-1).join(".")),t}function p(e){return function(t){return e+" "+t}}function f(e){return parseInt(e.split(".")[0])}function d(e,t){if(0===e.length)return[];var B=h(e.map(f)),u=B[B.length-t];if(!u)return e;for(var r=[],s=e.length-1;s>=0&&!(u>f(e[s]));s--)r.unshift(e[s]);return r}function h(e){for(var t=[],B=0;B"===e?function(e){return B(e)>t}:">="===e?function(e){return B(e)>=t}:"<"===e?function(e){return parseFloat(e)t?1:0}function v(e,t){return F(parseInt(e[0]),parseInt(t[0]))||F(parseInt(e[1]||"0"),parseInt(t[1]||"0"))||F(parseInt(e[2]||"0"),parseInt(t[2]||"0"))}function g(e,t){return void 0===(t=t.split(".").map(E))[1]&&(t[1]="x"),"<="===e?function(e){return b(e=e.split(".").map(E),t)<=0}:function(e){return b(e=e.split(".").map(E),t)>=0}}function b(e,t){return e[0]!==t[0]?e[0]=e});return B.concat(s.map(p(r.name)))},[])}function x(e){return{name:e.name,versions:e.versions,released:e.released,releaseDate:e.releaseDate}}function S(e,t){if(e=e.toLowerCase(),e=U.aliases[e]||e,t.mobileToDesktop&&U.desktopNames[e]){var B=U.data[U.desktopNames[e]];if("android"===e)return r=x(U.data[e]),s=B,r.released=k(r.released,s.released),r.versions=k(r.versions,s.versions),r.releaseDate=function(e){var t={};for(var B in e)t[B]=e[B];return t}(r.releaseDate),r.released.forEach(function(e){void 0===r.releaseDate[e]&&(r.releaseDate[e]=s.releaseDate[e])}),r;var u=x(B);return u.name=e,u}var r,s;return U.data[e]}function k(e,t){var B=t.indexOf("37");return e.filter(function(e){return/^(?:[2-4]\.|[34]$)/.test(e)}).concat(t.slice(B))}function j(e,t){var B=S(e,t);if(!B)throw new i("Unknown browser "+e);return B}function O(e,t,B,u){var r=1;switch(t){case"android":if(u.mobileToDesktop)return e;var s=U.data.chrome.released;r=s.length-s.indexOf("37");break;case"op_mob":r=f(U.data.op_mob.released.slice(-1)[0])-14+1;break;default:return e}return B<=r?e.slice(-1):e.slice(r-1-B)}function I(e,t){return"string"==typeof e&&(e.indexOf("y")>=0||t&&e.indexOf("a")>=0)}function P(e,t){return G(e).reduce(function(e,B,u){if(B.not&&0===u)throw new i("Write any browsers query (for instance, `defaults`) before `"+B.query+"`");var r=V[B.type].select.call(U,t,B).map(function(e){var B=e.split(" ");return"0"===B[1]?B[0]+" "+S(B[0],t).versions[0]:e});if("and"===B.compose)return B.not?e.filter(function(e){return-1===r.indexOf(e)}):e.filter(function(e){return-1!==r.indexOf(e)});if(B.not){var s={};return r.forEach(function(e){s[e]=!0}),e.filter(function(e){return!s[e]})}return e.concat(r)},[])}function L(e){return void 0===e&&(e={}),void 0===e.path&&(e.path=C.resolve?C.resolve("."):"."),e}function T(e,t){if(null==e){var B=U.loadConfig(t);e=B||U.defaults}return e}function R(e){if("string"!=typeof e&&!Array.isArray(e))throw new i("Browser queries must be an array or string. Got "+typeof e+".")}var M={},N={};function U(e,t){R(e=T(e,t=L(t)));var B=G(e).some(function(e){return V[e.type].needsPath}),u={ignoreUnknownVersions:t.ignoreUnknownVersions,dangerousExtend:t.dangerousExtend,mobileToDesktop:t.mobileToDesktop,env:t.env};B&&(u.path=t.path),o.oldDataWarning(U.data);var r=o.getStat(t,U.data);if(r)for(var s in u.customUsage={},r)A(u.customUsage,s,r[s]);var n=JSON.stringify([e,u]);if(M[n])return M[n];var C=h(P(e,u)).sort(function(e,t){if(e=e.split(" "),t=t.split(" "),e[0]===t[0]){var B=e[1].split("-")[0];return v(t[1].split("-")[0].split("."),B.split("."))}return F(e[0],t[0])});return o.env.BROWSERSLIST_DISABLE_CACHE||(M[n]=C),C}function G(e){var t=JSON.stringify(e);if(t in N)return N[t];var B=a(V,e);return o.env.BROWSERSLIST_DISABLE_CACHE||(N[t]=B),B}function H(e,t){var B=o.loadStat(e,t,U.data);if(B)for(var u in e.customUsage={},B)A(e.customUsage,u,B[u]);if(!e.customUsage)throw new i("Custom usage statistics was not provided");return e.customUsage}function J(e,t){var B=U.nodeVersions.filter(function(e){return l(e,t.version)});if(0===B.length){if(e.ignoreUnknownVersions)return[];throw new i("Unknown version "+t.version+" of Node.js")}return["node "+B[B.length-1]]}function q(e,t){var B=parseInt(t.year),u=parseInt(t.month||"01")-1,r=parseInt(t.day||"01");return w(Date.UTC(B,u,r,0,0,0),e)}function K(e,t){var B=parseFloat(t.coverage),u=U.usage.global;if(t.place)if(t.place.match(/^my\s+stats$/i)){if(!e.customUsage)throw new i("Custom usage statistics was not provided");u=e.customUsage}else{var r;r=2===t.place.length?t.place.toUpperCase():t.place.toLowerCase(),o.loadCountry(U.usage,r,U.data),u=U.usage[r]}else t.config&&(u=H(e,t.config));for(var s,n=Object.keys(u).sort(function(e,t){return u[t]-u[e]}),C=0,a=[],l=0;l=B));l++);return a}U.parse=function(e,t){return R(e=T(e,t=L(t))),G(e)},U.cache={},U.data={},U.usage={global:{},custom:null},U.defaults=["> 0.5%","last 2 versions","Firefox ESR","not dead"],U.aliases={fx:"firefox",ff:"firefox",ios:"ios_saf",explorer:"ie",blackberry:"bb",explorermobile:"ie_mob",operamini:"op_mini",operamobile:"op_mob",chromeandroid:"and_chr",firefoxandroid:"and_ff",ucandroid:"and_uc",qqandroid:"and_qq"},U.desktopNames={and_chr:"chrome",and_ff:"firefox",ie_mob:"ie",android:"chrome"},U.versionAliases={},U.clearCaches=o.clearCaches,U.parseConfig=o.parseConfig,U.readConfig=o.readConfig,U.findConfigFile=o.findConfigFile,U.findConfig=o.findConfig,U.loadConfig=o.loadConfig,U.coverage=function(e,t){var B;if(void 0===t)B=U.usage.global;else if("my stats"===t){var u={};u.path=C.resolve?C.resolve("."):".";var r=o.getStat(u);if(!r)throw new i("Custom usage statistics was not provided");for(var s in B={},r)A(B,s,r[s])}else if("string"==typeof t)t=t.length>2?t.toLowerCase():t.toUpperCase(),o.loadCountry(U.usage,t,U.data),B=U.usage[t];else for(var n in"dataByBrowser"in t&&(t=t.dataByBrowser),B={},t)for(var a in t[n])B[n+" "+a]=t[n][a];return e.reduce(function(e,t){var u=B[t];return void 0===u&&(u=B[t.replace(/ \S+$/," 0")]),e+(u||0)},0)};var V={last_major_versions:{matches:["versions"],regexp:/^last\s+(\d+)\s+major\s+versions?$/i,select:function(e,t){return Object.keys(r).reduce(function(B,u){var r=S(u,e);if(!r)return B;var s=d(r.released,t.versions);return s=O(s=s.map(p(r.name)),r.name,t.versions,e),B.concat(s)},[])}},last_versions:{matches:["versions"],regexp:/^last\s+(\d+)\s+versions?$/i,select:function(e,t){return Object.keys(r).reduce(function(B,u){var r=S(u,e);if(!r)return B;var s=r.released.slice(-t.versions);return s=O(s=s.map(p(r.name)),r.name,t.versions,e),B.concat(s)},[])}},last_electron_major_versions:{matches:["versions"],regexp:/^last\s+(\d+)\s+electron\s+major\s+versions?$/i,select:function(e,t){return d(Object.keys(s),t.versions).map(function(e){return"chrome "+s[e]})}},last_node_major_versions:{matches:["versions"],regexp:/^last\s+(\d+)\s+node\s+major\s+versions?$/i,select:function(e,t){return d(U.nodeVersions,t.versions).map(function(e){return"node "+e})}},last_browser_major_versions:{matches:["versions","browser"],regexp:/^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i,select:function(e,t){var B=j(t.browser,e),u=d(B.released,t.versions).map(p(B.name));return u=O(u,B.name,t.versions,e)}},last_electron_versions:{matches:["versions"],regexp:/^last\s+(\d+)\s+electron\s+versions?$/i,select:function(e,t){return Object.keys(s).slice(-t.versions).map(function(e){return"chrome "+s[e]})}},last_node_versions:{matches:["versions"],regexp:/^last\s+(\d+)\s+node\s+versions?$/i,select:function(e,t){return U.nodeVersions.slice(-t.versions).map(function(e){return"node "+e})}},last_browser_versions:{matches:["versions","browser"],regexp:/^last\s+(\d+)\s+(\w+)\s+versions?$/i,select:function(e,t){var B=j(t.browser,e),u=B.released.slice(-t.versions).map(p(B.name));return u=O(u,B.name,t.versions,e)}},unreleased_versions:{matches:[],regexp:/^unreleased\s+versions$/i,select:function(e){return Object.keys(r).reduce(function(t,B){var u=S(B,e);if(!u)return t;var r=u.versions.filter(function(e){return-1===u.released.indexOf(e)});return r=r.map(p(u.name)),t.concat(r)},[])}},unreleased_electron_versions:{matches:[],regexp:/^unreleased\s+electron\s+versions?$/i,select:function(){return[]}},unreleased_browser_versions:{matches:["browser"],regexp:/^unreleased\s+(\w+)\s+versions?$/i,select:function(e,t){var B=j(t.browser,e);return B.versions.filter(function(e){return-1===B.released.indexOf(e)}).map(p(B.name))}},last_years:{matches:["years"],regexp:/^last\s+((\d+\.)?\d+)\s+years?$/i,select:function(e,t){return w(Date.now()-31558432982.4*t.years,e)}},since_y:{matches:["year"],regexp:/^since (\d+)$/i,select:q},since_y_m:{matches:["year","month"],regexp:/^since (\d+)-(\d+)$/i,select:q},since_y_m_d:{matches:["year","month","day"],regexp:/^since (\d+)-(\d+)-(\d+)$/i,select:q},popularity:{matches:["sign","popularity"],regexp:/^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%$/,select:function(e,t){var B=parseFloat(t.popularity),u=U.usage.global;return Object.keys(u).reduce(function(e,r){return">"===t.sign?u[r]>B&&e.push(r):"<"===t.sign?u[r]=B&&e.push(r),e},[])}},popularity_in_my_stats:{matches:["sign","popularity"],regexp:/^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+my\s+stats$/,select:function(e,t){var B=parseFloat(t.popularity);if(!e.customUsage)throw new i("Custom usage statistics was not provided");var u=e.customUsage;return Object.keys(u).reduce(function(e,r){var s=u[r];return null==s||(">"===t.sign?s>B&&e.push(r):"<"===t.sign?s=B&&e.push(r)),e},[])}},popularity_in_config_stats:{matches:["sign","popularity","config"],regexp:/^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/,select:function(e,t){var B=parseFloat(t.popularity),u=H(e,t.config);return Object.keys(u).reduce(function(e,r){var s=u[r];return null==s||(">"===t.sign?s>B&&e.push(r):"<"===t.sign?s=B&&e.push(r)),e},[])}},popularity_in_place:{matches:["sign","popularity","place"],regexp:/^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+((alt-)?\w\w)$/,select:function(e,t){var B=parseFloat(t.popularity),u=t.place;u=2===u.length?u.toUpperCase():u.toLowerCase(),o.loadCountry(U.usage,u,U.data);var r=U.usage[u];return Object.keys(r).reduce(function(e,u){var s=r[u];return null==s||(">"===t.sign?s>B&&e.push(u):"<"===t.sign?s=B&&e.push(u)),e},[])}},cover:{matches:["coverage"],regexp:/^cover\s+(\d+|\d+\.\d+|\.\d+)%$/i,select:K},cover_in:{matches:["coverage","place"],regexp:/^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(my\s+stats|(alt-)?\w\w)$/i,select:K},cover_config:{matches:["coverage","config"],regexp:/^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/i,select:K},supports:{matches:["supportType","feature"],regexp:/^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/,select:function(e,t){o.loadFeature(U.cache,t.feature);var B="fully"!==t.supportType,u=U.cache[t.feature],r=[];for(var s in u){for(var n=S(s,e),C=n.released.length-1;C>=0&&!(n.released[C]in u[s]);)C--;var i=e.mobileToDesktop&&s in U.desktopNames&&I(u[s][n.released[C]],B);n.versions.forEach(function(e){var t=u[s][e];void 0===t&&i&&(t=u[U.desktopNames[s]][e]),I(t,B)&&r.push(s+" "+e)})}return r}},electron_range:{matches:["from","to"],regexp:/^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i,select:function(e,t){var B=c(t.from),u=c(t.to),r=parseFloat(t.from),n=parseFloat(t.to);if(!s[B])throw new i("Unknown version "+r+" of electron");if(!s[u])throw new i("Unknown version "+n+" of electron");return Object.keys(s).filter(function(e){var t=parseFloat(e);return t>=r&&t<=n}).map(function(e){return"chrome "+s[e]})}},node_range:{matches:["from","to"],regexp:/^node\s+([\d.]+)\s*-\s*([\d.]+)$/i,select:function(e,t){return U.nodeVersions.filter(g(">=",t.from)).filter(g("<=",t.to)).map(function(e){return"node "+e})}},browser_range:{matches:["browser","from","to"],regexp:/^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i,select:function(e,t){var B=j(t.browser,e),u=parseFloat(y(B,t.from)||t.from),r=parseFloat(y(B,t.to)||t.to);return B.released.filter(function(e){var t=parseFloat(e);return t>=u&&t<=r}).map(p(B.name))}},electron_ray:{matches:["sign","version"],regexp:/^electron\s*(>=?|<=?)\s*([\d.]+)$/i,select:function(e,t){var B=c(t.version);return Object.keys(s).filter(m(t.sign,B)).map(function(e){return"chrome "+s[e]})}},node_ray:{matches:["sign","version"],regexp:/^node\s*(>=?|<=?)\s*([\d.]+)$/i,select:function(e,t){return U.nodeVersions.filter((B=t.sign,u=t.version,(u=u.split(".").map(E))[1]=u[1]||0,u[2]=u[2]||0,">"===B?function(e){return v(e=e.split(".").map(E),u)>0}:">="===B?function(e){return v(e=e.split(".").map(E),u)>=0}:"<"===B?function(e){return e=e.split(".").map(E),v(u,e)>0}:function(e){return e=e.split(".").map(E),v(u,e)>=0})).map(function(e){return"node "+e});var B,u}},browser_ray:{matches:["browser","sign","version"],regexp:/^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/,select:function(e,t){var B=t.version,u=j(t.browser,e),r=U.versionAliases[u.name][B];return r&&(B=r),u.released.filter(m(t.sign,B)).map(function(e){return u.name+" "+e})}},firefox_esr:{matches:[],regexp:/^(firefox|ff|fx)\s+esr$/i,select:function(){return["firefox 128","firefox 140"]}},opera_mini_all:{matches:[],regexp:/(operamini|op_mini)\s+all/i,select:function(){return["op_mini all"]}},electron_version:{matches:["version"],regexp:/^electron\s+([\d.]+)$/i,select:function(e,t){var B=c(t.version),u=s[B];if(!u)throw new i("Unknown version "+t.version+" of electron");return["chrome "+u]}},node_major_version:{matches:["version"],regexp:/^node\s+(\d+)$/i,select:J},node_minor_version:{matches:["version"],regexp:/^node\s+(\d+\.\d+)$/i,select:J},node_patch_version:{matches:["version"],regexp:/^node\s+(\d+\.\d+\.\d+)$/i,select:J},current_node:{matches:[],regexp:/^current\s+node$/i,select:function(e){return[o.currentNode(P,e)]}},maintained_node:{matches:[],regexp:/^maintained\s+node\s+versions$/i,select:function(e){var t=Date.now();return P(Object.keys(n).filter(function(e){return tDate.parse(n[e].start)&&(B=e.slice(1),U.nodeVersions.some(function(e){return l(e,B)}));var B}).map(function(e){return"node "+e.slice(1)}),e)}},phantomjs_1_9:{matches:[],regexp:/^phantomjs\s+1.9$/i,select:function(){return["safari 5"]}},phantomjs_2_1:{matches:[],regexp:/^phantomjs\s+2.1$/i,select:function(){return["safari 6"]}},browser_version:{matches:["browser","version"],regexp:/^(\w+)\s+(tp|[\d.]+)$/i,select:function(e,t){var B=t.version;/^tp$/i.test(B)&&(B="TP");var u=j(t.browser,e),r=y(u,B);if(r)B=r;else{if(!(r=y(u,r=-1===B.indexOf(".")?B+".0":B.replace(/\.0$/,"")))){if(e.ignoreUnknownVersions)return[];throw new i("Unknown version "+B+" of "+t.browser)}B=r}return[u.name+" "+B]}},browserslist_config:{matches:[],regexp:/^browserslist config$/i,needsPath:!0,select:function(e){return U(void 0,e)}},extends:{matches:["config"],regexp:/^extends (.+)$/i,needsPath:!0,select:function(e,t){return P(o.loadQueries(e,t.config),e)}},defaults:{matches:[],regexp:/^defaults$/i,select:function(e){return P(U.defaults,e)}},dead:{matches:[],regexp:/^dead$/i,select:function(e){return P(["Baidu >= 0","ie <= 11","ie_mob <= 11","bb <= 10","op_mob <= 12.1","samsung 4"],e)}},unknown:{matches:[],regexp:/^(\w+)$/i,select:function(e,t){throw S(t.query,e)?new i("Specify versions in Browserslist query for browser "+t.query):(B=t.query,new i("Unknown browser query `"+B+"`. Maybe you are using old Browserslist or made typo in query."));var B}}};!function(){for(var e in r){var t=r[e];U.data[e]={name:e,versions:D(r[e].versions),released:D(r[e].versions.slice(0,-3)),releaseDate:r[e].release_date},A(U.usage.global,e,t.usage_global),U.versionAliases[e]={};for(var B=0;B{function u(e){try{if(!B.g.localStorage)return!1}catch(e){return!1}var t=B.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(u("noDeprecation"))return e;var B=!1;return function(){if(!B){if(u("throwDeprecation"))throw new Error(t);u("traceDeprecation")?console.trace(t):console.warn(t),B=!0}return e.apply(this,arguments)}}},95042:e=>{e.exports={nanoid:(e=21)=>{let t="",B=0|e;for(;B--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(B=t)=>{let u="",r=0|B;for(;r--;)u+=e[Math.random()*e.length|0];return u}}},95360:e=>{e.exports={A:{A:{2:"sC",8:"K D E",129:"A B",161:"F"},B:{1:"0 O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",129:"C L M G N"},C:{1:"0 1 2 3 4 5 6 7 8 9 N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC",33:"J UB K D E F A B C L M G wC xC"},D:{1:"0 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"J UB K D E yC WC zC 0C 1C"},F:{1:"0 4 5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F AD BD",33:"1 2 3 B C G N O P VB CD DD JC qC ED"},G:{1:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"E WC FD rC GD HD ID JD"},H:{2:"cD"},I:{1:"I",33:"PC J dD eD fD gD rC hD iD"},J:{33:"D A"},K:{1:"B C H JC qC KC",2:"A"},L:{1:"I"},M:{1:"IC"},N:{1:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS3 2D Transforms",D:!0}},95484:(e,t,B)=>{"use strict";const u=B(36673),r=B(47167),{utf8DecodeWithoutBOM:s}=B(58408),{percentDecodeString:n,utf8PercentEncodeCodePoint:C,utf8PercentEncodeString:i,isC0ControlPercentEncode:o,isFragmentPercentEncode:a,isQueryPercentEncode:l,isSpecialQueryPercentEncode:D,isPathPercentEncode:c,isUserinfoPercentEncode:p}=B(41656);function f(e){return e.codePointAt(0)}const d={ftp:21,file:null,http:80,https:443,ws:80,wss:443},h=Symbol("failure");function A(e){return[...e].length}function m(e,t){const B=e[t];return isNaN(B)?void 0:String.fromCodePoint(B)}function E(e){return"."===e||"%2e"===e.toLowerCase()}function F(e){return 2===e.length&&r.isASCIIAlpha(e.codePointAt(0))&&(":"===e[1]||"|"===e[1])}function v(e){return-1!==e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)}function g(e){return void 0!==d[e]}function b(e){return g(e.scheme)}function y(e){return!g(e.scheme)}function w(e){return d[e]}function x(e){if(""===e)return h;let t=10;if(e.length>=2&&"0"===e.charAt(0)&&"x"===e.charAt(1).toLowerCase()?(e=e.substring(2),t=16):e.length>=2&&"0"===e.charAt(0)&&(e=e.substring(1),t=8),""===e)return 0;let B=/[^0-7]/u;return 10===t&&(B=/[^0-9]/u),16===t&&(B=/[^0-9A-Fa-f]/u),B.test(e)?h:parseInt(e,t)}function S(e,t=!1){if("["===e[0])return"]"!==e[e.length-1]?h:function(e){const t=[0,0,0,0,0,0,0,0];let B=0,u=null,s=0;if((e=Array.from(e,e=>e.codePointAt(0)))[s]===f(":")){if(e[s+1]!==f(":"))return h;s+=2,++B,u=B}for(;s6)return h;let u=0;for(;void 0!==e[s];){let n=null;if(u>0){if(!(e[s]===f(".")&&u<4))return h;++s}if(!r.isASCIIDigit(e[s]))return h;for(;r.isASCIIDigit(e[s]);){const t=parseInt(m(e,s));if(null===n)n=t;else{if(0===n)return h;n=10*n+t}if(n>255)return h;++s}t[B]=256*t[B]+n,++u,2!==u&&4!==u||++B}if(4!==u)return h;break}if(e[s]===f(":")){if(++s,void 0===e[s])return h}else if(void 0!==e[s])return h;t[B]=n,++B}if(null!==u){let e=B-u;for(B=7;0!==B&&e>0;){const r=t[u+e-1];t[u+e-1]=t[B],t[B]=r,--B,--e}}else if(null===u&&8!==B)return h;return t}(e.substring(1,e.length-1));if(t)return function(e){if(v(e))return h;return i(e,o)}(e);const B=function(e,t=!1){const B=u.toASCII(e,{checkHyphens:t,checkBidi:!0,checkJoiners:!0,useSTD3ASCIIRules:t,transitionalProcessing:!1,verifyDNSLength:t,ignoreInvalidPunycode:!1});if(null===B)return h;if(!t){if(""===B)return h;if(v(r=B)||-1!==r.search(/[\u0000-\u001F]|%|\u007F/u))return h}var r;return B}(s(n(e)));return B===h?h:function(e){const t=e.split(".");if(""===t[t.length-1]){if(1===t.length)return!1;t.pop()}const B=t[t.length-1];if(x(B)!==h)return!0;if(/^[0-9]+$/u.test(B))return!0;return!1}(B)?function(e){const t=e.split(".");if(""===t[t.length-1]&&t.length>1&&t.pop(),t.length>4)return h;const B=[];for(const e of t){const t=x(e);if(t===h)return h;B.push(t)}for(let e=0;e255)return h;if(B[B.length-1]>=256**(5-B.length))return h;let u=B.pop(),r=0;for(const e of B)u+=e*256**(3-r),++r;return u}(B):B}function k(e){return"number"==typeof e?function(e){let t="",B=e;for(let e=1;e<=4;++e)t=String(B%256)+t,4!==e&&(t=`.${t}`),B=Math.floor(B/256);return t}(e):e instanceof Array?`[${function(e){let t="";const B=function(e){let t=null,B=1,u=null,r=0;for(let s=0;sB&&(t=u,B=r),u=null,r=0):(null===u&&(u=s),++r);return r>B?u:t}(e);let u=!1;for(let r=0;r<=7;++r)if(!u||0!==e[r]){if(u&&(u=!1),B===r){t+=0===r?"::":":",u=!0;continue}t+=e[r].toString(16),7!==r&&(t+=":")}return t}(e)}]`:e}function j(e){const{path:t}=e;var B;0!==t.length&&("file"===e.scheme&&1===t.length&&(B=t[0],/^[A-Za-z]:$/u.test(B))||t.pop())}function O(e){return""!==e.username||""!==e.password}function I(e){return"string"==typeof e.path}function P(e,t,B,u,r){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=B||"utf-8",this.stateOverride=r,this.url=u,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};const e=function(e){let t=0,B=e.length;for(;t32);++t);for(;B>t&&!(e.charCodeAt(B-1)>32);--B);return e.substring(t,B)}(this.input);e!==this.input&&(this.parseError=!0),this.input=e}const s=function(e){return e.replace(/\u0009|\u000A|\u000D/gu,"")}(this.input);for(s!==this.input&&(this.parseError=!0),this.input=s,this.state=r||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=Array.from(this.input,e=>e.codePointAt(0));this.pointer<=this.input.length;++this.pointer){const e=this.input[this.pointer],t=isNaN(e)?void 0:String.fromCodePoint(e),B=this[`parse ${this.state}`](e,t);if(!B)break;if(B===h){this.failure=!0;break}}}P.prototype["parse scheme start"]=function(e,t){if(r.isASCIIAlpha(e))this.buffer+=t.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,h;this.state="no scheme",--this.pointer}return!0},P.prototype["parse scheme"]=function(e,t){if(r.isASCIIAlphanumeric(e)||e===f("+")||e===f("-")||e===f("."))this.buffer+=t.toLowerCase();else if(e===f(":")){if(this.stateOverride){if(b(this.url)&&!g(this.buffer))return!1;if(!b(this.url)&&g(this.buffer))return!1;if((O(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&""===this.url.host)return!1}if(this.url.scheme=this.buffer,this.stateOverride)return this.url.port===w(this.url.scheme)&&(this.url.port=null),!1;this.buffer="","file"===this.url.scheme?(this.input[this.pointer+1]===f("/")&&this.input[this.pointer+2]===f("/")||(this.parseError=!0),this.state="file"):b(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":b(this.url)?this.state="special authority slashes":this.input[this.pointer+1]===f("/")?(this.state="path or authority",++this.pointer):(this.url.path="",this.state="opaque path")}else{if(this.stateOverride)return this.parseError=!0,h;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},P.prototype["parse no scheme"]=function(e){return null===this.base||I(this.base)&&e!==f("#")?h:(I(this.base)&&e===f("#")?(this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},P.prototype["parse special relative or authority"]=function(e){return e===f("/")&&this.input[this.pointer+1]===f("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},P.prototype["parse path or authority"]=function(e){return e===f("/")?this.state="authority":(this.state="path",--this.pointer),!0},P.prototype["parse relative"]=function(e){return this.url.scheme=this.base.scheme,e===f("/")?this.state="relative slash":b(this.url)&&e===f("\\")?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,e===f("?")?(this.url.query="",this.state="query"):e===f("#")?(this.url.fragment="",this.state="fragment"):isNaN(e)||(this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer)),!0},P.prototype["parse relative slash"]=function(e){return!b(this.url)||e!==f("/")&&e!==f("\\")?e===f("/")?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(e===f("\\")&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},P.prototype["parse special authority slashes"]=function(e){return e===f("/")&&this.input[this.pointer+1]===f("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},P.prototype["parse special authority ignore slashes"]=function(e){return e!==f("/")&&e!==f("\\")?(this.state="authority",--this.pointer):this.parseError=!0,!0},P.prototype["parse authority"]=function(e,t){if(e===f("@")){this.parseError=!0,this.atFlag&&(this.buffer=`%40${this.buffer}`),this.atFlag=!0;const e=A(this.buffer);for(let t=0;t65535)return this.parseError=!0,h;this.url.port=e===w(this.url.scheme)?null:e,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}return!0};const L=new Set([f("/"),f("\\"),f("?"),f("#")]);function T(e,t){const B=e.length-t;return B>=2&&(u=e[t],s=e[t+1],r.isASCIIAlpha(u)&&(s===f(":")||s===f("|")))&&(2===B||L.has(e[t+2]));var u,s}function R(e){if(I(e))return e.path;let t="";for(const B of e.path)t+=`/${B}`;return t}P.prototype["parse file"]=function(e){return this.url.scheme="file",this.url.host="",e===f("/")||e===f("\\")?(e===f("\\")&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,e===f("?")?(this.url.query="",this.state="query"):e===f("#")?(this.url.fragment="",this.state="fragment"):isNaN(e)||(this.url.query=null,T(this.input,this.pointer)?(this.parseError=!0,this.url.path=[]):j(this.url),this.state="path",--this.pointer)):(this.state="path",--this.pointer),!0},P.prototype["parse file slash"]=function(e){var t;return e===f("/")||e===f("\\")?(e===f("\\")&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(!T(this.input,this.pointer)&&(2===(t=this.base.path[0]).length&&r.isASCIIAlpha(t.codePointAt(0))&&":"===t[1])&&this.url.path.push(this.base.path[0]),this.url.host=this.base.host),this.state="path",--this.pointer),!0},P.prototype["parse file host"]=function(e,t){if(isNaN(e)||e===f("/")||e===f("\\")||e===f("?")||e===f("#"))if(--this.pointer,!this.stateOverride&&F(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let e=S(this.buffer,y(this.url));if(e===h)return h;if("localhost"===e&&(e=""),this.url.host=e,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=t;return!0},P.prototype["parse path start"]=function(e){return b(this.url)?(e===f("\\")&&(this.parseError=!0),this.state="path",e!==f("/")&&e!==f("\\")&&--this.pointer):this.stateOverride||e!==f("?")?this.stateOverride||e!==f("#")?void 0!==e?(this.state="path",e!==f("/")&&--this.pointer):this.stateOverride&&null===this.url.host&&this.url.path.push(""):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},P.prototype["parse path"]=function(e){var t;return isNaN(e)||e===f("/")||b(this.url)&&e===f("\\")||!this.stateOverride&&(e===f("?")||e===f("#"))?(b(this.url)&&e===f("\\")&&(this.parseError=!0),".."===(t=(t=this.buffer).toLowerCase())||"%2e."===t||".%2e"===t||"%2e%2e"===t?(j(this.url),e===f("/")||b(this.url)&&e===f("\\")||this.url.path.push("")):!E(this.buffer)||e===f("/")||b(this.url)&&e===f("\\")?E(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&F(this.buffer)&&(this.buffer=`${this.buffer[0]}:`),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="",e===f("?")&&(this.url.query="",this.state="query"),e===f("#")&&(this.url.fragment="",this.state="fragment")):(e!==f("%")||r.isASCIIHex(this.input[this.pointer+1])&&r.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=C(e,c)),!0},P.prototype["parse opaque path"]=function(e){if(e===f("?"))this.url.query="",this.state="query";else if(e===f("#"))this.url.fragment="",this.state="fragment";else if(e===f(" ")){const e=this.input[this.pointer+1];e===f("?")||e===f("#")?this.url.path+="%20":this.url.path+=" "}else isNaN(e)||e===f("%")||(this.parseError=!0),e!==f("%")||r.isASCIIHex(this.input[this.pointer+1])&&r.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),isNaN(e)||(this.url.path+=C(e,o));return!0},P.prototype["parse query"]=function(e,t){if(b(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8"),!this.stateOverride&&e===f("#")||isNaN(e)){const t=b(this.url)?D:l;this.url.query+=i(this.buffer,t),this.buffer="",e===f("#")&&(this.url.fragment="",this.state="fragment")}else isNaN(e)||(e!==f("%")||r.isASCIIHex(this.input[this.pointer+1])&&r.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=t);return!0},P.prototype["parse fragment"]=function(e){return isNaN(e)||(e!==f("%")||r.isASCIIHex(this.input[this.pointer+1])&&r.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=C(e,a)),!0},e.exports.serializeURL=function(e,t){let B=`${e.scheme}:`;return null!==e.host&&(B+="//",""===e.username&&""===e.password||(B+=e.username,""!==e.password&&(B+=`:${e.password}`),B+="@"),B+=k(e.host),null!==e.port&&(B+=`:${e.port}`)),null===e.host&&!I(e)&&e.path.length>1&&""===e.path[0]&&(B+="/."),B+=R(e),null!==e.query&&(B+=`?${e.query}`),t||null===e.fragment||(B+=`#${e.fragment}`),B},e.exports.serializePath=R,e.exports.serializeURLOrigin=function(t){switch(t.scheme){case"blob":{const B=e.exports.parseURL(R(t));return null===B||"http"!==B.scheme&&"https"!==B.scheme?"null":e.exports.serializeURLOrigin(B)}case"ftp":case"http":case"https":case"ws":case"wss":return function(e){let t=`${e.scheme}://`;return t+=k(e.host),null!==e.port&&(t+=`:${e.port}`),t}({scheme:t.scheme,host:t.host,port:t.port});default:return"null"}},e.exports.basicURLParse=function(e,t){void 0===t&&(t={});const B=new P(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);return B.failure?null:B.url},e.exports.setTheUsername=function(e,t){e.username=i(t,p)},e.exports.setThePassword=function(e,t){e.password=i(t,p)},e.exports.serializeHost=k,e.exports.cannotHaveAUsernamePasswordPort=function(e){return null===e.host||""===e.host||"file"===e.scheme},e.exports.hasAnOpaquePath=I,e.exports.serializeInteger=function(e){return String(e)},e.exports.parseURL=function(t,B){return void 0===B&&(B={}),e.exports.basicURLParse(t,{baseURL:B.baseURL,encodingOverride:B.encodingOverride})}},96481:e=>{e.exports={A:{A:{K:0,D:0,E:.0331526,F:.0248644,A:.00828815,B:.605035,sC:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","sC","K","D","E","F","A","B","","",""],E:"IE",F:{sC:962323200,K:998870400,D:1161129600,E:1237420800,F:1300060800,A:1346716800,B:1381968e3}},B:{A:{0:0,C:0,L:0,M:0,G:0,N:0,O:0,P:.04422,Q:0,H:0,R:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:.01206,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:.00402,n:0,o:0,p:0,q:0,r:0,s:.0402,t:0,u:0,v:0,w:.00804,x:.01206,y:.00402,z:0,AB:0,BB:0,CB:.02814,DB:.00804,EB:.01206,FB:.00402,GB:.00402,HB:.00402,IB:.01206,JB:.01206,KB:.00804,LB:.0201,MB:.01206,NB:.02814,OB:.01608,PB:.01608,QB:.04824,RB:.02814,SB:.04824,TB:.21306,I:4.0602},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","L","M","G","N","O","P","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","","",""],E:"Edge",F:{0:1694649600,C:1438128e3,L:1447286400,M:1470096e3,G:1491868800,N:1508198400,O:1525046400,P:1542067200,Q:1579046400,H:1581033600,R:1586736e3,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:161136e4,Y:1614816e3,Z:1618358400,a:1622073600,b:1626912e3,c:1630627200,d:1632441600,e:1634774400,f:1637539200,g:1641427200,h:1643932800,i:1646265600,j:1649635200,k:1651190400,l:1653955200,m:1655942400,n:1659657600,o:1661990400,p:1664755200,q:1666915200,r:1670198400,s:1673481600,t:1675900800,u:1678665600,v:1680825600,w:1683158400,x:1685664e3,y:1689897600,z:1692576e3,AB:1697155200,BB:1698969600,CB:1701993600,DB:1706227200,EB:1708732800,FB:1711152e3,GB:1713398400,HB:1715990400,IB:1718841600,JB:1721865600,KB:1724371200,LB:1726704e3,MB:1729123200,NB:1731542400,OB:1737417600,PB:1740614400,QB:1741219200,RB:1743984e3,SB:1746316800,TB:1748476800,I:1750896e3},D:{C:"ms",L:"ms",M:"ms",G:"ms",N:"ms",O:"ms",P:"ms"}},C:{A:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,tC:0,PC:0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:.04824,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:0,iB:0,jB:0,kB:.00804,lB:0,mB:.00402,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:.03216,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,QC:.00804,"0B":0,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":.01206,AC:0,BC:.01608,CC:0,DC:0,EC:0,FC:0,GC:0,HC:.01206,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:.00402,t:0,u:0,v:0,w:.00402,x:0,y:.17286,z:0,AB:.11658,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:.01206,IB:.01206,JB:.00402,KB:.1005,LB:.00804,MB:0,NB:0,OB:0,PB:.01206,QB:.00804,RB:.00804,SB:.01608,TB:.01206,I:.01608,TC:.09648,IC:1.01304,UC:.31356,VC:0,uC:0,vC:0,wC:0,xC:0},B:"moz",C:["tC","PC","wC","xC","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC","uC","vC"],E:"Firefox",F:{0:1693267200,1:1361232e3,2:1364860800,3:1368489600,4:1372118400,5:1375747200,6:1379376e3,7:1386633600,8:1391472e3,9:1395100800,tC:1161648e3,PC:1213660800,wC:124632e4,xC:1264032e3,J:1300752e3,UB:1308614400,K:1313452800,D:1317081600,E:1317081600,F:1320710400,A:1324339200,B:1327968e3,C:1331596800,L:1335225600,M:1338854400,G:1342483200,N:1346112e3,O:1349740800,P:1353628800,VB:1357603200,WB:1398729600,XB:1402358400,YB:1405987200,ZB:1409616e3,aB:1413244800,bB:1417392e3,cB:1421107200,dB:1424736e3,eB:1428278400,fB:1431475200,gB:1435881600,hB:1439251200,iB:144288e4,jB:1446508800,kB:1450137600,lB:1453852800,mB:1457395200,nB:1461628800,oB:1465257600,pB:1470096e3,qB:1474329600,rB:1479168e3,sB:1485216e3,tB:1488844800,uB:149256e4,vB:1497312e3,wB:1502150400,xB:1506556800,yB:1510617600,zB:1516665600,QC:1520985600,"0B":1525824e3,RC:1529971200,"1B":1536105600,"2B":1540252800,"3B":1544486400,"4B":154872e4,"5B":1552953600,"6B":1558396800,"7B":1562630400,"8B":1567468800,"9B":1571788800,AC:1575331200,BC:1578355200,CC:1581379200,DC:1583798400,EC:1586304e3,FC:1588636800,GC:1591056e3,HC:1593475200,Q:1595894400,H:1598313600,R:1600732800,SC:1603152e3,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392e3,d:1635811200,e:1638835200,f:1641859200,g:1644364800,h:1646697600,i:1649116800,j:1651536e3,k:1653955200,l:1656374400,m:1658793600,n:1661212800,o:1663632e3,p:1666051200,q:1668470400,r:1670889600,s:1673913600,t:1676332800,u:1678752e3,v:1681171200,w:1683590400,x:1686009600,y:1688428800,z:1690848e3,AB:1695686400,BB:1698105600,CB:1700524800,DB:1702944e3,EB:1705968e3,FB:1708387200,GB:1710806400,HB:1713225600,IB:1715644800,JB:1718064e3,KB:1720483200,LB:1722902400,MB:1725321600,NB:1727740800,OB:173016e4,PB:1732579200,QB:1736208e3,RB:1738627200,SB:1741046400,TB:1743465600,I:1745884800,TC:1748304e3,IC:1750723200,UC:1753142400,VC:null,uC:null,vC:null}},D:{A:{0:.09648,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:.00804,hB:.00804,iB:.00804,jB:.00804,kB:.00804,lB:.00804,mB:.01206,nB:.00804,oB:.00804,pB:.0201,qB:.01608,rB:.00804,sB:.00804,tB:.01206,uB:.00804,vB:.00804,wB:.00804,xB:.0201,yB:.00804,zB:.00804,QC:.00804,"0B":.00804,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":.02412,"6B":0,"7B":.00402,"8B":.01206,"9B":.01608,AC:0,BC:0,CC:.00402,DC:.00804,EC:.00402,FC:.00402,GC:0,HC:.00804,Q:.07236,H:.01206,R:.02412,S:.04824,T:0,U:.00804,V:.01206,W:.03618,X:.00804,Y:.00402,Z:.00804,a:.02814,b:.00804,c:.00804,d:.00804,e:.00402,f:.00804,g:.0201,h:.04422,i:.01608,j:.00804,k:.02412,l:.0201,m:.0804,n:.03618,o:.03216,p:.01206,q:.01608,r:.03216,s:.7638,t:.01608,u:.02814,v:4.78782,w:.05226,x:.04824,y:.0201,z:.06834,AB:.05226,BB:.04422,CB:.06834,DB:.06834,EB:.07236,FB:.07236,GB:.0603,HB:.41808,IB:.0603,JB:.03216,KB:.08442,LB:.06834,MB:.10854,NB:.49446,OB:.1407,PB:.13668,QB:.1206,RB:.21306,SB:.30552,TB:3.23208,I:11.855,TC:.0201,IC:.01608,UC:0,VC:0},B:"webkit",C:["","","","","","","","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC"],E:"Chrome",F:{0:1694476800,1:133704e4,2:1340668800,3:1343692800,4:1348531200,5:1352246400,6:1357862400,7:1361404800,8:1364428800,9:1369094400,J:1264377600,UB:1274745600,K:1283385600,D:1287619200,E:1291248e3,F:1296777600,A:1299542400,B:1303862400,C:1307404800,L:1312243200,M:1316131200,G:1316131200,N:1319500800,O:1323734400,P:1328659200,VB:1332892800,WB:1374105600,XB:1376956800,YB:1384214400,ZB:1389657600,aB:1392940800,bB:1397001600,cB:1400544e3,dB:1405468800,eB:1409011200,fB:141264e4,gB:1416268800,hB:1421798400,iB:1425513600,jB:1429401600,kB:143208e4,lB:1437523200,mB:1441152e3,nB:1444780800,oB:1449014400,pB:1453248e3,qB:1456963200,rB:1460592e3,sB:1464134400,tB:1469059200,uB:1472601600,vB:1476230400,wB:1480550400,xB:1485302400,yB:1489017600,zB:149256e4,QC:1496707200,"0B":1500940800,RC:1504569600,"1B":1508198400,"2B":1512518400,"3B":1516752e3,"4B":1520294400,"5B":1523923200,"6B":1527552e3,"7B":1532390400,"8B":1536019200,"9B":1539648e3,AC:1543968e3,BC:154872e4,CC:1552348800,DC:1555977600,EC:1559606400,FC:1564444800,GC:1568073600,HC:1571702400,Q:1575936e3,H:1580860800,R:1586304e3,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272e3,a:1621987200,b:1626739200,c:1630368e3,d:1632268800,e:1634601600,f:1637020800,g:1641340800,h:1643673600,i:1646092800,j:1648512e3,k:1650931200,l:1653350400,m:1655769600,n:1659398400,o:1661817600,p:1664236800,q:1666656e3,r:166968e4,s:1673308800,t:1675728e3,u:1678147200,v:1680566400,w:1682985600,x:1685404800,y:1689724800,z:1692057600,AB:1696896e3,BB:1698710400,CB:1701993600,DB:1705968e3,EB:1708387200,FB:1710806400,GB:1713225600,HB:1715644800,IB:1718064e3,JB:1721174400,KB:1724112e3,LB:1726531200,MB:1728950400,NB:1731369600,OB:1736812800,PB:1738627200,QB:1741046400,RB:1743465600,SB:1745884800,TB:1748304e3,I:1750723200,TC:1754352e3,IC:null,UC:null,VC:null}},E:{A:{J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:.00402,C:0,L:.00804,M:.01206,G:0,yC:0,WC:0,zC:0,"0C":0,"1C":0,"2C":0,XC:0,JC:.00402,KC:.00402,"3C":.02814,"4C":.03216,"5C":.03216,YC:0,ZC:.00804,LC:.00804,"6C":.11658,MC:.02412,aC:.01608,bC:.01206,cC:.02814,dC:.01206,eC:.01608,"7C":.16482,NC:.00804,fC:.11256,gC:.01206,hC:.01608,iC:.02814,jC:.04422,"8C":.1608,OC:.0201,kC:.03618,lC:.01608,mC:.0804,nC:.0603,oC:1.37484,pC:.01206,"9C":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","yC","WC","J","UB","zC","K","0C","D","1C","E","F","2C","A","XC","B","JC","C","KC","L","3C","M","4C","G","5C","YC","ZC","LC","6C","MC","aC","bC","cC","dC","eC","7C","NC","fC","gC","hC","iC","jC","8C","OC","kC","lC","mC","nC","oC","pC","9C",""],E:"Safari",F:{yC:1205798400,WC:1226534400,J:1244419200,UB:1275868800,zC:131112e4,K:1343174400,"0C":13824e5,D:13824e5,"1C":1410998400,E:1413417600,F:1443657600,"2C":1458518400,A:1474329600,XC:1490572800,B:1505779200,JC:1522281600,C:1537142400,KC:1553472e3,L:1568851200,"3C":1585008e3,M:1600214400,"4C":1619395200,G:1632096e3,"5C":1635292800,YC:1639353600,ZC:1647216e3,LC:1652745600,"6C":1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432e3,dC:1679875200,eC:1684368e3,"7C":1690156800,NC:1695686400,fC:1698192e3,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,"8C":1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936e3,nC:1743379200,oC:1747008e3,pC:null,"9C":null}},F:{A:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,F:0,B:0,C:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:.00402,iB:0,jB:0,kB:0,lB:0,mB:0,nB:.00804,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,"0B":0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0,AC:0,BC:0,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:.00402,Z:.05226,a:0,b:0,c:0,d:0,e:.02814,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0,u:0,v:0,w:.00402,x:0,y:0,z:0,AD:0,BD:0,CD:0,DD:0,JC:0,qC:0,ED:0,KC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","F","AD","BD","CD","DD","B","JC","qC","ED","C","KC","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","0B","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","","",""],E:"Opera",F:{0:1739404800,1:1393891200,2:1399334400,3:1401753600,4:1405987200,5:1409616e3,6:1413331200,7:1417132800,8:1422316800,9:1425945600,F:1150761600,AD:1223424e3,BD:1251763200,CD:1267488e3,DD:1277942400,B:1292457600,JC:1302566400,qC:1309219200,ED:1323129600,C:1323129600,KC:1352073600,G:1372723200,N:1377561600,O:1381104e3,P:1386288e3,VB:1390867200,WB:1430179200,XB:1433808e3,YB:1438646400,ZB:1442448e3,aB:1445904e3,bB:1449100800,cB:1454371200,dB:1457308800,eB:146232e4,fB:1465344e3,gB:1470096e3,hB:1474329600,iB:1477267200,jB:1481587200,kB:1486425600,lB:1490054400,mB:1494374400,nB:1498003200,oB:1502236800,pB:1506470400,qB:1510099200,rB:1515024e3,sB:1517961600,tB:1521676800,uB:1525910400,vB:1530144e3,wB:1534982400,xB:1537833600,yB:1543363200,zB:1548201600,"0B":1554768e3,"1B":1561593600,"2B":1566259200,"3B":1570406400,"4B":1573689600,"5B":1578441600,"6B":1583971200,"7B":1587513600,"8B":1592956800,"9B":1595894400,AC:1600128e3,BC:1603238400,CC:161352e4,DC:1612224e3,EC:1616544e3,FC:1619568e3,GC:1623715200,HC:1627948800,Q:1631577600,H:1633392e3,R:1635984e3,SC:1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152e3,Z:1660780800,a:1663113600,b:1668816e3,c:1668643200,d:1671062400,e:1675209600,f:1677024e3,g:1679529600,h:1681948800,i:1684195200,j:1687219200,k:1690329600,l:1692748800,m:1696204800,n:169992e4,o:169992e4,p:1702944e3,q:1707264e3,r:1710115200,s:1711497600,t:1716336e3,u:1719273600,v:1721088e3,w:1724284800,x:1727222400,y:1732665600,z:1736294400},D:{F:"o",B:"o",C:"o",AD:"o",BD:"o",CD:"o",DD:"o",JC:"o",qC:"o",ED:"o",KC:"o"}},G:{A:{E:0,WC:0,FD:0,rC:.0013461,GD:0,HD:.00673049,ID:.00403829,JD:0,KD:.0026922,LD:.0148071,MD:.0013461,ND:.0228837,OD:.200569,PD:.00942269,QD:.0026922,RD:.082112,SD:0,TD:.0026922,UD:.0026922,VD:.013461,WD:.0578822,XD:.0309603,YD:.026922,YC:.0215376,ZC:.0242298,LC:.0282681,ZD:.371523,MC:.0498056,aC:.095573,bC:.0498056,cC:.0942269,dC:.0201915,eC:.0376907,aD:.477865,NC:.0242298,fC:.0457673,gC:.0336525,hC:.0498056,iC:.095573,jC:.173647,bD:.442866,OC:.111726,kC:.234221,lC:.126533,mC:.46575,nC:.301526,oC:9.39442,pC:.0215376},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","WC","FD","rC","GD","HD","ID","E","JD","KD","LD","MD","ND","OD","PD","QD","RD","SD","TD","UD","VD","WD","XD","YD","YC","ZC","LC","ZD","MC","aC","bC","cC","dC","eC","aD","NC","fC","gC","hC","iC","jC","bD","OC","kC","lC","mC","nC","oC","pC","",""],E:"Safari on iOS",F:{WC:1270252800,FD:1283904e3,rC:1299628800,GD:1331078400,HD:1359331200,ID:1394409600,E:1410912e3,JD:1413763200,KD:1442361600,LD:1458518400,MD:1473724800,ND:1490572800,OD:1505779200,PD:1522281600,QD:1537142400,RD:1553472e3,SD:1568851200,TD:1572220800,UD:1580169600,VD:1585008e3,WD:1600214400,XD:1619395200,YD:1632096e3,YC:1639353600,ZC:1647216e3,LC:1652659200,ZD:1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432e3,dC:1679875200,eC:1684368e3,aD:1690156800,NC:1694995200,fC:1698192e3,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,bD:1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936e3,nC:1743379200,oC:1747008e3,pC:null}},H:{A:{cD:.04},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","cD","","",""],E:"Opera Mini",F:{cD:1426464e3}},I:{A:{PC:0,J:0,I:.794067,dD:0,eD:0,fD:0,gD:159068e-9,rC:159068e-9,hD:0,iD:636272e-9},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","dD","eD","fD","PC","J","gD","rC","hD","iD","I","","",""],E:"Android Browser",F:{dD:1256515200,eD:1274313600,fD:1291593600,PC:1298332800,J:1318896e3,gD:1341792e3,rC:1374624e3,hD:1386547200,iD:1401667200,I:1750723200}},J:{A:{D:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","A","","",""],E:"Blackberry Browser",F:{D:1325376e3,A:1359504e3}},K:{A:{A:0,B:0,C:0,H:.95866,JC:0,qC:0,KC:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","JC","qC","C","KC","H","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752e3,JC:1314835200,qC:1318291200,C:1330300800,KC:1349740800,H:1709769600},D:{H:"webkit"}},L:{A:{I:43.5564},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","","",""],E:"Chrome for Android",F:{I:1750723200}},M:{A:{IC:.3289},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","IC","","",""],E:"Firefox for Android",F:{IC:1750723200}},N:{A:{A:0,B:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456e3}},O:{A:{LC:.81328},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","LC","","",""],E:"UC Browser for Android",F:{LC:1710115200},D:{LC:"webkit"}},P:{A:{1:0,2:.0218021,3:.0218021,4:.0218021,5:.0327031,6:.0327031,7:.0545052,8:.0872083,9:1.80957,J:0,jD:0,kD:0,lD:.010901,mD:0,nD:0,XC:0,oD:0,pD:0,qD:0,rD:0,sD:0,MC:0,NC:0,OC:0,tD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","J","jD","kD","lD","mD","nD","XC","oD","pD","qD","rD","sD","MC","NC","OC","tD","1","2","3","4","5","6","7","8","9","","",""],E:"Samsung Internet",F:{1:1677369600,2:1684454400,3:1689292800,4:1697587200,5:1711497600,6:1715126400,7:1717718400,8:1725667200,9:1746057600,J:1461024e3,jD:1481846400,kD:1509408e3,lD:1528329600,mD:1546128e3,nD:1554163200,XC:1567900800,oD:1582588800,pD:1593475200,qD:1605657600,rD:1618531200,sD:1629072e3,MC:1640736e3,NC:1651708800,OC:1659657600,tD:1667260800}},Q:{A:{uD:.18538},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uD","","",""],E:"QQ Browser",F:{uD:1710288e3}},R:{A:{vD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","vD","","",""],E:"Baidu Browser",F:{vD:1710201600}},S:{A:{wD:.01196,xD:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","wD","xD","","",""],E:"KaiOS Browser",F:{wD:1527811200,xD:1631664e3}}}},96846:(e,t,B)=>{"use strict";let u=B(40145),r=B(96966),s=B(84211),n=B(25644);class C{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let B of e)if(!0===B.postcss?B=B():B.postcss&&(B=B.postcss),"object"==typeof B&&Array.isArray(B.plugins))t=t.concat(B.plugins);else if("object"==typeof B&&B.postcssPlugin)t.push(B);else if("function"==typeof B)t.push(B);else{if("object"!=typeof B||!B.parse&&!B.stringify)throw new Error(B+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new r(this,e,t):new s(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=C,C.default=C,n.registerProcessor(C),u.registerProcessor(C)},96966:(e,t,B)=>{"use strict";let u=B(77793),r=B(40145),s=B(13604),n=B(69577),C=B(33717),i=B(25644),o=B(83303),{isClean:a,my:l}=B(84151);B(6156);const D={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},c={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return"object"==typeof e&&"function"==typeof e.then}function d(e){let t=!1,B=D[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[B,B+"-"+t,0,B+"Exit",B+"Exit-"+t]:t?[B,B+"-"+t,B+"Exit",B+"Exit-"+t]:e.append?[B,0,B+"Exit"]:[B,B+"Exit"]}function h(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:d(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function A(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>A(e)),e}let m={};class E{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,B){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof E||t instanceof C)r=A(t.root),t.map&&(void 0===B.map&&(B.map={}),B.map.inline||(B.map.inline=!1),B.map.prev=t.map);else{let e=n;B.syntax&&(e=B.syntax.parse),B.parser&&(e=B.parser),e.parse&&(e=e.parse);try{r=e(t,B)}catch(e){this.processed=!0,this.error=e}r&&!r[l]&&u.rebuild(r)}else r=A(t);this.result=new C(e,r,B),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let B=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?B.postcssVersion:(e.plugin=B.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,B)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,B])};for(let t of this.plugins)if("object"==typeof t)for(let B in t){if(!c[B]&&/^[A-Z]/.test(B))throw new Error(`Unknown event ${B} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[B])if("object"==typeof t[B])for(let u in t[B])e(t,"*"===u?B:B+"-"+u.toLowerCase(),t[B][u]);else"function"==typeof t[B]&&e(t,B,t[B])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let B=t[t.length-1].node;throw this.handleError(e,B)}}}if(this.listeners.OnceExit)for(let[t,B]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>B(e,this.helpers));await Promise.all(t)}else await B(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let B=new s(t,this.result.root,this.result.opts).generate();return this.result.css=B[0],this.result.map=B[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(f(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[B,u]of e){let e;this.result.lastPlugin=B;try{e=u(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:B,visitors:u}=t;if("root"!==B.type&&"document"!==B.type&&!B.parent)return void e.pop();if(u.length>0&&t.visitorIndex{e[a]||this.walkSync(e)});else{let t=this.listeners[B];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}E.registerPostcss=e=>{m=e},e.exports=E,E.default=E,i.registerLazyResult(E),r.registerLazyResult(E)},97065:e=>{e.exports={A:{A:{2:"K sC",2340:"D E F A B"},B:{2:"C L M G N O P",1025:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC wC",513:"4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b",545:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B xC"},D:{2:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB",1025:"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC"},E:{1:"A B C L M G XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",2:"J UB yC WC zC",164:"K",4644:"D E F 0C 1C 2C"},F:{2:"1 2 3 4 5 6 7 8 F B G N O P VB AD BD CD DD JC qC",545:"C ED KC",1025:"0 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{1:"MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",2:"WC FD rC",4260:"GD HD",4644:"E ID JD KD LD"},H:{2:"cD"},I:{2:"PC J dD eD fD gD rC hD iD",1025:"I"},J:{2:"D",4260:"A"},K:{2:"A B JC qC",545:"C KC",1025:"H"},L:{1025:"I"},M:{1:"IC"},N:{2340:"A B"},O:{1025:"LC"},P:{1025:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1025:"uD"},R:{1025:"vD"},S:{1:"xD",4097:"wD"}},B:4,C:"Crisp edges/pixelated images",D:!0}},97149:(e,t,B)=>{"use strict";t.__esModule=!0,t.default=void 0;var u,r=(u=B(48349))&&u.__esModule?u:{default:u},s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var B=n(t);if(B&&B.has(e))return B.get(e);var u={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var C=r?Object.getOwnPropertyDescriptor(e,s):null;C&&(C.get||C.set)?Object.defineProperty(u,s,C):u[s]=e[s]}u.default=e,B&&B.set(e,u);return u}(B(50680));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,B=new WeakMap;return(n=function(e){return e?B:t})(e)}var C=function(e){return new r.default(e)};Object.assign(C,s),delete C.__esModule;var i=C;t.default=i,e.exports=t.default},97161:e=>{e.exports={y:1,n:2,a:4,p:8,u:16,x:32,d:64}},97287:e=>{e.exports={A:{A:{2:"K D E F sC",1028:"B",1316:"A"},B:{1:"0 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I"},C:{1:"0 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",164:"1 2 tC PC J UB K D E F A B C L M G N O P VB wC xC",516:"3 4 5 6 7 8"},D:{1:"0 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"2 3 4 5 6 7 8 9",164:"1 J UB K D E F A B C L M G N O P VB"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",33:"D E 0C 1C",164:"J UB K yC WC zC"},F:{1:"0 1 2 3 4 5 6 7 8 9 O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KC",2:"F B C AD BD CD DD JC qC ED",33:"G N"},G:{1:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",33:"E ID JD",164:"WC FD rC GD HD"},H:{1:"cD"},I:{1:"I hD iD",164:"PC J dD eD fD gD rC"},J:{1:"A",164:"D"},K:{1:"H KC",2:"A B C JC qC"},L:{1:"I"},M:{1:"IC"},N:{1:"B",292:"A"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 J jD kD lD mD nD XC oD pD qD rD sD MC NC OC tD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"wD xD"}},B:4,C:"CSS Flexible Box Layout Module",D:!0}},97773:(e,t,B)=>{let u=B(57441),r=B(59941);class s extends u{normalize(){return"align-content"}prefixed(e,t){let B;return[B,t]=r(t),2012===B?t+"flex-line-pack":super.prefixed(e,t)}set(e,t){let B=r(t)[0];return 2012===B?(e.value=s.oldValues[e.value]||e.value,super.set(e,t)):"final"===B?super.set(e,t):void 0}}s.names=["align-content","flex-line-pack"],s.oldValues={"flex-end":"end","flex-start":"start","space-around":"distribute","space-between":"justify"},e.exports=s},97896:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",2:"C L M G N O P"},C:{1:"0 rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",16:"tC",33:"1 2 3 4 5 6 7 8 9 PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB wC xC"},D:{1:"0 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",16:"J UB K D E F A B C L M",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B"},E:{1:"F A B C L M G 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",16:"J UB K yC WC zC",33:"D E 0C 1C"},F:{1:"0 tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB"},G:{1:"KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",16:"WC FD rC GD",33:"E HD ID JD"},H:{2:"cD"},I:{1:"I",16:"PC J dD eD fD gD rC",33:"hD iD"},J:{16:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{2:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 nD XC oD pD qD rD sD MC NC OC tD",16:"J",33:"jD kD lD mD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",33:"wD"}},B:5,C:"CSS :any-link selector",D:!0}},97960:e=>{e.exports={A:{A:{2:"K D E F sC",33:"A B"},B:{1:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",33:"C L M G N O P"},C:{1:"0 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",33:"1 2 3 4 5 6 7 8 9 tC PC J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B wC xC"},D:{1:"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",33:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB"},E:{33:"J UB K D E F A B C L M G yC WC zC 0C 1C 2C XC JC KC 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C"},F:{1:"0 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",2:"F B C AD BD CD DD JC qC ED KC",33:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB"},G:{33:"E WC FD rC GD HD ID JD KD LD MD ND OD PD QD RD SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC"},H:{2:"cD"},I:{1:"I",33:"PC J dD eD fD gD rC hD iD"},J:{33:"D A"},K:{1:"H",2:"A B C JC qC KC"},L:{1:"I"},M:{1:"IC"},N:{33:"A B"},O:{1:"LC"},P:{1:"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD",33:"J jD"},Q:{1:"uD"},R:{1:"vD"},S:{1:"xD",33:"wD"}},B:5,C:"CSS user-select: none",D:!0}},98114:(e,t,B)=>{let u=B(57441);class r extends u{insert(e,t,B){if("-ms-"===t){let u=this.set(this.clone(e),t);this.needCascade(e)&&(u.raws.before=this.calcBefore(B,e,t));let s="ltr";return e.parent.nodes.forEach(e=>{"direction"===e.prop&&("rtl"!==e.value&&"ltr"!==e.value||(s=e.value))}),u.value=r.msValues[s][e.value]||e.value,e.parent.insertBefore(e,u)}return super.insert(e,t,B)}}r.names=["writing-mode"],r.msValues={ltr:{"horizontal-tb":"lr-tb","vertical-lr":"tb-lr","vertical-rl":"tb-rl"},rtl:{"horizontal-tb":"rl-tb","vertical-lr":"bt-lr","vertical-rl":"bt-rl"}},e.exports=r},98351:e=>{e.exports={A:{A:{2:"K D E F A B sC"},B:{2:"C L M G N O",260:"0 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I",3138:"P"},C:{1:"0 vB wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC uC vC",2:"tC PC",132:"1 2 3 4 5 6 7 8 9 J UB K D E F A B C L M G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB wC xC",644:"oB pB qB rB sB tB uB"},D:{2:"1 2 3 4 J UB K D E F A B C L M G N O P VB",260:"0 wB xB yB zB QC 0B RC 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB I TC IC UC VC",292:"5 6 7 8 9 WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB"},E:{2:"J UB K yC WC zC 0C",260:"M G 3C 4C 5C YC ZC LC 6C MC aC bC cC dC eC 7C NC fC gC hC iC jC 8C OC kC lC mC nC oC pC 9C",292:"D E F A B C L 1C 2C XC JC KC"},F:{2:"F B C AD BD CD DD JC qC ED KC",260:"0 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC Q H R SC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z",292:"1 2 3 4 5 6 7 8 9 G N O P VB WB XB YB ZB aB bB cB dB eB fB gB hB iB"},G:{2:"WC FD rC GD HD",260:"SD TD UD VD WD XD YD YC ZC LC ZD MC aC bC cC dC eC aD NC fC gC hC iC jC bD OC kC lC mC nC oC pC",292:"E ID JD KD LD MD ND OD PD QD RD"},H:{2:"cD"},I:{2:"PC J dD eD fD gD rC",260:"I",292:"hD iD"},J:{2:"D A"},K:{2:"A B C JC qC KC",260:"H"},L:{260:"I"},M:{1:"IC"},N:{2:"A B"},O:{260:"LC"},P:{260:"1 2 3 4 5 6 7 8 9 kD lD mD nD XC oD pD qD rD sD MC NC OC tD",292:"J jD"},Q:{260:"uD"},R:{260:"vD"},S:{1:"xD",644:"wD"}},B:4,C:"CSS clip-path property (for HTML)",D:!0}},99469:(e,t,B)=>{let u=B(57441),{getGridGap:r,inheritGridGap:s,parseTemplate:n,warnGridGap:C,warnMissedAreas:i}=B(59902);class o extends u{insert(e,t,B,u){if("-ms-"!==t)return super.insert(e,t,B);if(e.parent.some(e=>"-ms-grid-rows"===e.prop))return;let o=r(e),a=s(e,o),{areas:l,columns:D,rows:c}=n({decl:e,gap:a||o}),p=Object.keys(l).length>0,f=Boolean(c),d=Boolean(D);return C({decl:e,gap:o,hasColumns:d,result:u}),i(l,e,u),(f&&d||p)&&e.cloneBefore({prop:"-ms-grid-rows",raws:{},value:c}),d&&e.cloneBefore({prop:"-ms-grid-columns",raws:{},value:D}),e}}o.names=["grid-template"],e.exports=o},99552:(e,t,B)=>{let{list:u}=B(12895),r=B(84328),s=B(91396),n=B(76134),C=B(87880);e.exports=class extends n{constructor(e,t,B){super(e,t,B),this.regexpCache=new Map}add(e,t){let B=this.prefixeds(e);if(this.already(e,B,t))return;let u=this.clone(e,{selector:B[this.name][t]});e.parent.insertBefore(e,u)}already(e,t,B){let u=e.parent.index(e)-1;for(;u>=0;){let r=e.parent.nodes[u];if("rule"!==r.type)return!1;let s=!1;for(let e in t[this.name]){let u=t[this.name][e];if(r.selector===u){if(B===e)return!0;s=!0;break}}if(!s)return!1;u-=1}return!1}check(e){return!!e.selector.includes(this.name)&&!!e.selector.match(this.regexp())}old(e){return new s(this,e)}possible(){return r.prefixes()}prefixed(e){return this.name.replace(/^(\W*)/,`$1${e}`)}prefixeds(e){if(e._autoprefixerPrefixeds){if(e._autoprefixerPrefixeds[this.name])return e._autoprefixerPrefixeds}else e._autoprefixerPrefixeds={};let t={};if(e.selector.includes(",")){let B=u.comma(e.selector).filter(e=>e.includes(this.name));for(let e of this.possible())t[e]=B.map(t=>this.replace(t,e)).join(", ")}else for(let B of this.possible())t[B]=this.replace(e.selector,B);return e._autoprefixerPrefixeds[this.name]=t,e._autoprefixerPrefixeds}regexp(e){if(!this.regexpCache.has(e)){let t=e?this.prefixed(e):this.name;this.regexpCache.set(e,new RegExp(`(^|[^:"'=])${C.escapeRegexp(t)}`,"gi"))}return this.regexpCache.get(e)}replace(e,t){return e.replace(this.regexp(),`$1${this.prefixed(t)}`)}}}},t={};function B(u){var r=t[u];if(void 0!==r)return r.exports;var s=t[u]={exports:{}};return e[u].call(s.exports,s,s.exports,B),s.exports}B.d=(e,t)=>{for(var u in t)B.o(t,u)&&!B.o(e,u)&&Object.defineProperty(e,u,{enumerable:!0,get:t[u]})},B.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),B.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),B.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};(()=>{"use strict";B.r(u),B.d(u,{runTest:()=>i});var e=B(12895);const t=e;e.stringify,e.fromJSON,e.plugin,e.parse,e.list,e.document,e.comment,e.atRule,e.rule,e.decl,e.root,e.CssSyntaxError,e.Declaration,e.Container,e.Processor,e.Document,e.Comment,e.Warning,e.AtRule,e.Result,e.Input,e.Rule,e.Root,e.Node;var r=B(22110),s=B(21993);const n="\n.phone {\n &_title {\n width: 500px;\n @media (max-width: 500px) {\n width: auto;\n }\n body.is_dark & {\n color: white;\n }\n }\n img {\n display: block;\n }\n}",C=[{name:"bootstrap-5.3.7.css",options:{from:"third_party/bootstrap-5.3.7.css",map:!1}},{name:"foundation-6.9.0.css",options:{from:"third_party/foundation-6.9.0.css",map:!1}},{name:"angular-material-20.1.6.css",options:{from:"third_party/angular-material-20.1.6.css",map:!1}}];function i(e){const B=t([s({add:!1,overrideBrowserslist:[]})]),u=t([s,r]);return C.map(({name:t,options:u})=>{const r=e[t];return{payload:B.process(r).css+n,options:u}}).map(({payload:e,options:t})=>u.process(e,t).css)}})(),self.WTBenchmark=u})(); \ No newline at end of file diff --git a/web-tooling-benchmark/dist/prettier.bundle.dev.js.z b/web-tooling-benchmark/dist/prettier.bundle.dev.js.z new file mode 100644 index 00000000..b7e8e939 Binary files /dev/null and b/web-tooling-benchmark/dist/prettier.bundle.dev.js.z differ diff --git a/web-tooling-benchmark/dist/prettier.bundle.js b/web-tooling-benchmark/dist/prettier.bundle.js deleted file mode 100644 index 4e3a3164..00000000 --- a/web-tooling-benchmark/dist/prettier.bundle.js +++ /dev/null @@ -1,263 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/prettier/plugins/babel.js": -/*!************************************************!*\ - !*** ./node_modules/prettier/plugins/babel.js ***! - \************************************************/ -/***/ ((module) => { - -(function(f){function e(){var i=f();return i.default||i}if(true)module.exports=e();else // removed by dead control flow -{ var t; }})(function(){"use strict";var Ti=Object.create;var be=Object.defineProperty;var bi=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var Si=Object.getPrototypeOf,Ei=Object.prototype.hasOwnProperty;var Ci=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),Ue=(a,t)=>{for(var e in t)be(a,e,{get:t[e],enumerable:!0})},os=(a,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ai(t))!Ei.call(a,i)&&i!==e&&be(a,i,{get:()=>t[i],enumerable:!(s=bi(t,i))||s.enumerable});return a};var ls=(a,t,e)=>(e=a!=null?Ti(Si(a)):{},os(t||!a||!a.__esModule?be(e,"default",{value:a,enumerable:!0}):e,a)),wi=a=>os(be({},"__esModule",{value:!0}),a);var Tt=Ci(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});function Ii(a,t){if(a==null)return{};var e={};for(var s in a)if({}.hasOwnProperty.call(a,s)){if(t.indexOf(s)!==-1)continue;e[s]=a[s]}return e}var B=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},se=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function D(a,t){let{line:e,column:s,index:i}=a;return new B(e,s+t,i+t)}var hs="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Ni={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:hs},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:hs}},cs={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Ee=a=>a.type==="UpdateExpression"?cs.UpdateExpression[`${a.prefix}`]:cs[a.type],ki={AccessorIsGenerator:({kind:a})=>`A ${a}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",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.",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.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:a})=>`Missing initializer in ${a} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",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.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:a})=>`\`${a}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:a,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`. -- Did you mean \`export { '${a}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:a})=>`'${a==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:a})=>`Unsyntactic ${a==="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 `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:a})=>`A string literal cannot be used as an imported binding. -- Did you mean \`import { "${a}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:a})=>`Expected number in radix ${a}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:a})=>`Escape sequence in keyword ${a}.`,InvalidIdentifier:({identifierName:a})=>`Invalid identifier ${a}.`,InvalidLhs:({ancestor:a})=>`Invalid left-hand side in ${Ee(a)}.`,InvalidLhsBinding:({ancestor:a})=>`Binding invalid left-hand side in ${Ee(a)}.`,InvalidLhsOptionalChaining:({ancestor:a})=>`Invalid optional chaining in the left-hand side of ${Ee(a)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:a})=>`Unexpected character '${a}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:a})=>`Private name #${a} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:a})=>`Label '${a}' is already declared.`,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.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:a})=>`This experimental syntax requires enabling the parser plugin: ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:a})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:a})=>`Duplicate key "${a}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:a})=>`An export name cannot include a lone surrogate, found '\\u${a.toString(16)}'.`,ModuleExportUndefined:({localName:a})=>`Export '${a}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:a})=>`Private names are only allowed in property accesses (\`obj.#${a}\`) or in \`in\` expressions (\`#${a} in obj\`).`,PrivateNameRedeclaration:({identifierName:a})=>`Duplicate private name #${a}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",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.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:a})=>`Unexpected keyword '${a}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:a})=>`Unexpected reserved word '${a}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:a,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${a?`, expected "${a}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:a,onlyValidPropertyName:t})=>`The only valid meta property for ${a} is ${a}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:a})=>`Identifier '${a}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},vi={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:a})=>`Assigning to '${a}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:a})=>`Binding '${a}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Li={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:a})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(a)}\`.`},Di=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Mi=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:a})=>`Invalid topic token ${a}. In order to use ${a} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${a}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:a})=>`Hack-style pipe body cannot be an unparenthesized ${Ee({type:a})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",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.'}),Oi=["message"];function ps(a,t,e){Object.defineProperty(a,t,{enumerable:!1,configurable:!0,value:e})}function Fi({toMessage:a,code:t,reasonCode:e,syntaxPlugin:s}){let i=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let r={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};r[e]&&(e=r[e])}return function r(n,o){let l=new SyntaxError;return l.code=t,l.reasonCode=e,l.loc=n,l.pos=n.index,l.syntaxPlugin=s,i&&(l.missingPlugin=o.missingPlugin),ps(l,"clone",function(c={}){var u;let{line:f,column:d,index:x}=(u=c.loc)!=null?u:n;return r(new B(f,d,x),Object.assign({},o,c.details))}),ps(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){let h=`${a(o)} (${n.line}:${n.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),l}}function F(a,t){if(Array.isArray(a))return s=>F(s,a[0]);let e={};for(let s of Object.keys(a)){let i=a[s],r=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=r,o=Ii(r,Oi),l=typeof n=="string"?()=>n:n;e[s]=Fi(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:l},t?{syntaxPlugin:t}:{},o))}return e}var p=Object.assign({},F(Ni),F(ki),F(vi),F(Li),F`pipelineOperator`(Mi));function Bi(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Ri(a){let t=Bi();if(a==null)return t;if(a.annexB!=null&&a.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(t))a[e]!=null&&(t[e]=a[e]);if(t.startLine===1)a.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:a.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((a.startColumn==null||a.startIndex==null)&&a.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}var{defineProperty:_i}=Object,us=(a,t)=>{a&&_i(a,t,{enumerable:!1,value:a[t]})};function he(a){return us(a.loc.start,"index"),us(a.loc.end,"index"),a}var Ui=a=>class extends a{parse(){let e=he(super.parse());return this.optionFlags&256&&(e.tokens=e.tokens.map(he)),e}parseRegExpLiteral({pattern:e,flags:s}){let i=null;try{i=new RegExp(e,s)}catch{}let r=this.estreeParseLiteral(i);return r.regex={pattern:e,flags:s},r}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let i=this.estreeParseLiteral(s);return i.bigint=String(i.value||e),i}parseDecimalLiteral(e){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||e),i}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,s){let i=this.startNodeAtNode(e);return i.expression=e,this.finishNodeAt(i,"ChainExpression",s)}directiveToStmt(e){let s=e.value;delete e.value,this.castNodeTo(s,"Literal"),s.raw=s.extra.raw,s.value=s.extra.expressionValue;let i=this.castNodeTo(e,"ExpressionStatement");return i.expression=s,i.directive=s.extra.rawValue,delete s.extra,i}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:s,end:i,loc:r,range:n,raw:o,value:l}=e,h=Object.create(e.constructor.prototype);return h.type="Literal",h.start=s,h.end=i,h.loc=r,h.range=n,h.raw=o,h.value=l,h}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,i,r,n){super.parseBlockBody(e,s,i,r,n);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,this.castNodeTo(e,"PrivateIdentifier")}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let i=super.parseLiteral(e,s);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,s,i=!1){super.parseFunctionBody(e,s,i),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,i,r,n,o,l=!1){let h=this.startNode();h.kind=e.kind,h=super.parseMethod(h,s,i,r,n,o,l),delete h.kind;let{typeParameters:c}=e;c&&(delete e.typeParameters,h.typeParameters=c,this.resetStartLocationFromNode(h,c));let u=this.castNodeTo(h,"FunctionExpression");return e.value=u,o==="ClassPrivateMethod"&&(e.computed=!1),o==="ObjectMethod"?(e.kind==="method"&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(s,"PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(s,"PropertyDefinition"),s.computed=!1),s}parseClassAccessorProperty(e){let s=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")&&(s.abstract&&this.hasPlugin("typescript")?(delete s.abstract,this.castNodeTo(s,"TSAbstractAccessorProperty")):this.castNodeTo(s,"AccessorProperty")),s}parseObjectProperty(e,s,i,r){let n=super.parseObjectProperty(e,s,i,r);return n&&(n.kind="init",this.castNodeTo(n,"Property")),n}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}isValidLVal(e,s,i){return e==="Property"?"value":super.isValidLVal(e,s,i)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:i,value:r}=e;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(r,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,i){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(p.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(p.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,i)}finishCallExpression(e,s){let i=super.finishCallExpression(e,s);if(i.callee.type==="Import"){var r,n;this.castNodeTo(i,"ImportExpression"),i.source=i.arguments[0],i.options=(r=i.arguments[1])!=null?r:null,i.attributes=(n=i.arguments[1])!=null?n:null,delete i.arguments,delete i.callee}else i.type==="OptionalCallExpression"?this.castNodeTo(i,"CallExpression"):i.optional=!1;return i}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let i=this.state.lastTokStartLoc,r=super.parseExport(e,s);switch(r.type){case"ExportAllDeclaration":r.exported=null;break;case"ExportNamedDeclaration":r.specifiers.length===1&&r.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(r,"ExportAllDeclaration"),r.exported=r.specifiers[0].exported,delete r.specifiers);case"ExportDefaultDeclaration":{var n;let{declaration:o}=r;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===r.start&&this.resetStartLocation(r,i)}break}return r}stopParseSubscript(e,s){let i=super.stopParseSubscript(e,s);return s.optionalChainMember?this.estreeParseChainExpression(i,e.loc.end):i}parseMember(e,s,i,r,n){let o=super.parseMember(e,s,i,r,n);return o.type==="OptionalMemberExpression"?this.castNodeTo(o,"MemberExpression"):o.optional=!1,o}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}castNodeTo(e,s){let i=super.castNodeTo(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}cloneIdentifier(e){let s=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(s),s}cloneStringLiteral(e){return e.type==="Literal"?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,s,i){return he(super.finishNodeAt(e,s,i))}finishNode(e,s){let i=super.finishNode(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}resetStartLocation(e,s){super.resetStartLocation(e,s),he(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),he(e)}},X=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},C={brace:new X("{"),j_oTag:new X("...",!0)};C.template=new X("`",!0);var T=!0,m=!0,je=!0,ce=!0,V=!0,ji=!0,Ie=class{constructor(t,e={}){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=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},pt=new Map;function E(a,t={}){t.keyword=a;let e=P(a,t);return pt.set(a,e),e}function L(a,t){return P(a,{beforeExpr:T,binop:t})}var de=-1,_=[],ut=[],ft=[],dt=[],mt=[],yt=[];function P(a,t={}){var e,s,i,r;return++de,ut.push(a),ft.push((e=t.binop)!=null?e:-1),dt.push((s=t.beforeExpr)!=null?s:!1),mt.push((i=t.startsExpr)!=null?i:!1),yt.push((r=t.prefix)!=null?r:!1),_.push(new Ie(a,t)),de}function b(a,t={}){var e,s,i,r;return++de,pt.set(a,de),ut.push(a),ft.push((e=t.binop)!=null?e:-1),dt.push((s=t.beforeExpr)!=null?s:!1),mt.push((i=t.startsExpr)!=null?i:!1),yt.push((r=t.prefix)!=null?r:!1),_.push(new Ie("name",t)),de}var $i={bracketL:P("[",{beforeExpr:T,startsExpr:m}),bracketHashL:P("#[",{beforeExpr:T,startsExpr:m}),bracketBarL:P("[|",{beforeExpr:T,startsExpr:m}),bracketR:P("]"),bracketBarR:P("|]"),braceL:P("{",{beforeExpr:T,startsExpr:m}),braceBarL:P("{|",{beforeExpr:T,startsExpr:m}),braceHashL:P("#{",{beforeExpr:T,startsExpr:m}),braceR:P("}"),braceBarR:P("|}"),parenL:P("(",{beforeExpr:T,startsExpr:m}),parenR:P(")"),comma:P(",",{beforeExpr:T}),semi:P(";",{beforeExpr:T}),colon:P(":",{beforeExpr:T}),doubleColon:P("::",{beforeExpr:T}),dot:P("."),question:P("?",{beforeExpr:T}),questionDot:P("?."),arrow:P("=>",{beforeExpr:T}),template:P("template"),ellipsis:P("...",{beforeExpr:T}),backQuote:P("`",{startsExpr:m}),dollarBraceL:P("${",{beforeExpr:T,startsExpr:m}),templateTail:P("...`",{startsExpr:m}),templateNonTail:P("...${",{beforeExpr:T,startsExpr:m}),at:P("@"),hash:P("#",{startsExpr:m}),interpreterDirective:P("#!..."),eq:P("=",{beforeExpr:T,isAssign:ce}),assign:P("_=",{beforeExpr:T,isAssign:ce}),slashAssign:P("_=",{beforeExpr:T,isAssign:ce}),xorAssign:P("_=",{beforeExpr:T,isAssign:ce}),moduloAssign:P("_=",{beforeExpr:T,isAssign:ce}),incDec:P("++/--",{prefix:V,postfix:ji,startsExpr:m}),bang:P("!",{beforeExpr:T,prefix:V,startsExpr:m}),tilde:P("~",{beforeExpr:T,prefix:V,startsExpr:m}),doubleCaret:P("^^",{startsExpr:m}),doubleAt:P("@@",{startsExpr:m}),pipeline:L("|>",0),nullishCoalescing:L("??",1),logicalOR:L("||",1),logicalAND:L("&&",2),bitwiseOR:L("|",3),bitwiseXOR:L("^",4),bitwiseAND:L("&",5),equality:L("==/!=/===/!==",6),lt:L("/<=/>=",7),gt:L("/<=/>=",7),relational:L("/<=/>=",7),bitShift:L("<>/>>>",8),bitShiftL:L("<>/>>>",8),bitShiftR:L("<>/>>>",8),plusMin:P("+/-",{beforeExpr:T,binop:9,prefix:V,startsExpr:m}),modulo:P("%",{binop:10,startsExpr:m}),star:P("*",{binop:10}),slash:L("/",10),exponent:P("**",{beforeExpr:T,binop:11,rightAssociative:!0}),_in:E("in",{beforeExpr:T,binop:7}),_instanceof:E("instanceof",{beforeExpr:T,binop:7}),_break:E("break"),_case:E("case",{beforeExpr:T}),_catch:E("catch"),_continue:E("continue"),_debugger:E("debugger"),_default:E("default",{beforeExpr:T}),_else:E("else",{beforeExpr:T}),_finally:E("finally"),_function:E("function",{startsExpr:m}),_if:E("if"),_return:E("return",{beforeExpr:T}),_switch:E("switch"),_throw:E("throw",{beforeExpr:T,prefix:V,startsExpr:m}),_try:E("try"),_var:E("var"),_const:E("const"),_with:E("with"),_new:E("new",{beforeExpr:T,startsExpr:m}),_this:E("this",{startsExpr:m}),_super:E("super",{startsExpr:m}),_class:E("class",{startsExpr:m}),_extends:E("extends",{beforeExpr:T}),_export:E("export"),_import:E("import",{startsExpr:m}),_null:E("null",{startsExpr:m}),_true:E("true",{startsExpr:m}),_false:E("false",{startsExpr:m}),_typeof:E("typeof",{beforeExpr:T,prefix:V,startsExpr:m}),_void:E("void",{beforeExpr:T,prefix:V,startsExpr:m}),_delete:E("delete",{beforeExpr:T,prefix:V,startsExpr:m}),_do:E("do",{isLoop:je,beforeExpr:T}),_for:E("for",{isLoop:je}),_while:E("while",{isLoop:je}),_as:b("as",{startsExpr:m}),_assert:b("assert",{startsExpr:m}),_async:b("async",{startsExpr:m}),_await:b("await",{startsExpr:m}),_defer:b("defer",{startsExpr:m}),_from:b("from",{startsExpr:m}),_get:b("get",{startsExpr:m}),_let:b("let",{startsExpr:m}),_meta:b("meta",{startsExpr:m}),_of:b("of",{startsExpr:m}),_sent:b("sent",{startsExpr:m}),_set:b("set",{startsExpr:m}),_source:b("source",{startsExpr:m}),_static:b("static",{startsExpr:m}),_using:b("using",{startsExpr:m}),_yield:b("yield",{startsExpr:m}),_asserts:b("asserts",{startsExpr:m}),_checks:b("checks",{startsExpr:m}),_exports:b("exports",{startsExpr:m}),_global:b("global",{startsExpr:m}),_implements:b("implements",{startsExpr:m}),_intrinsic:b("intrinsic",{startsExpr:m}),_infer:b("infer",{startsExpr:m}),_is:b("is",{startsExpr:m}),_mixins:b("mixins",{startsExpr:m}),_proto:b("proto",{startsExpr:m}),_require:b("require",{startsExpr:m}),_satisfies:b("satisfies",{startsExpr:m}),_keyof:b("keyof",{startsExpr:m}),_readonly:b("readonly",{startsExpr:m}),_unique:b("unique",{startsExpr:m}),_abstract:b("abstract",{startsExpr:m}),_declare:b("declare",{startsExpr:m}),_enum:b("enum",{startsExpr:m}),_module:b("module",{startsExpr:m}),_namespace:b("namespace",{startsExpr:m}),_interface:b("interface",{startsExpr:m}),_type:b("type",{startsExpr:m}),_opaque:b("opaque",{startsExpr:m}),name:P("name",{startsExpr:m}),placeholder:P("%%",{startsExpr:m}),string:P("string",{startsExpr:m}),num:P("num",{startsExpr:m}),bigint:P("bigint",{startsExpr:m}),decimal:P("decimal",{startsExpr:m}),regexp:P("regexp",{startsExpr:m}),privateName:P("#name",{startsExpr:m}),eof:P("eof"),jsxName:P("jsxName"),jsxText:P("jsxText",{beforeExpr:T}),jsxTagStart:P("jsxTagStart",{startsExpr:m}),jsxTagEnd:P("jsxTagEnd")};function w(a){return a>=93&&a<=133}function Vi(a){return a<=92}function M(a){return a>=58&&a<=133}function Es(a){return a>=58&&a<=137}function qi(a){return dt[a]}function ue(a){return mt[a]}function zi(a){return a>=29&&a<=33}function fs(a){return a>=129&&a<=131}function Hi(a){return a>=90&&a<=92}function xt(a){return a>=58&&a<=92}function Ki(a){return a>=39&&a<=59}function Wi(a){return a===34}function Ji(a){return yt[a]}function Xi(a){return a>=121&&a<=123}function Gi(a){return a>=124&&a<=130}function H(a){return ut[a]}function Ce(a){return ft[a]}function Yi(a){return a===57}function Ne(a){return a>=24&&a<=25}function R(a){return _[a]}_[8].updateContext=a=>{a.pop()},_[5].updateContext=_[7].updateContext=_[23].updateContext=a=>{a.push(C.brace)},_[22].updateContext=a=>{a[a.length-1]===C.template?a.pop():a.push(C.template)},_[143].updateContext=a=>{a.push(C.j_expr,C.j_oTag)};var Pt="\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-\u1C8A\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\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",Cs="\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\u0897-\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",Qi=new RegExp("["+Pt+"]"),Zi=new RegExp("["+Pt+Cs+"]");Pt=Cs=null;var ws=[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,4,51,13,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,39,27,10,22,251,41,7,1,17,2,60,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,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,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,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,229,29,3,0,496,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],er=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,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,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,343,9,54,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,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function He(a,t){let e=65536;for(let s=0,i=t.length;sa)return!1;if(e+=t[s+1],e>=a)return!0}return!1}function U(a){return a<65?a===36:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&Qi.test(String.fromCharCode(a)):He(a,ws)}function Z(a){return a<48?a===36:a<58?!0:a<65?!1:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&Zi.test(String.fromCharCode(a)):He(a,ws)||He(a,er)}var gt={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},tr=new Set(gt.keyword),sr=new Set(gt.strict),ir=new Set(gt.strictBind);function Is(a,t){return t&&a==="await"||a==="enum"}function Ns(a,t){return Is(a,t)||sr.has(a)}function ks(a){return ir.has(a)}function vs(a,t){return Ns(a,t)||ks(a)}function rr(a){return tr.has(a)}function ar(a,t,e){return a===64&&t===64&&U(e)}var nr=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function or(a){return nr.has(a)}var me=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},ye=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new me(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let i=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(i,t,e,s);let r=i.names.get(t)||0;e&16?r=r|4:(i.firstLexicalName||(i.firstLexicalName=t),r=r|2),i.names.set(t,r),e&8&&this.maybeExportDefined(i,t)}else if(e&4)for(let r=this.scopeStack.length-1;r>=0&&(i=this.scopeStack[r],this.checkRedeclarationInScope(i,t,e,s),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&1667));--r);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(p.VarRedeclaration,i,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let i=t.names.get(e);return s&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1667)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1731&&!(e&4))return e}}},Ke=class extends me{constructor(...t){super(...t),this.declareFunctions=new Set}},We=class extends ye{createScope(t){return new Ke(t)}declareName(t,e,s){let i=this.currentScope();if(e&2048){this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let i=t.names.get(e);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},lr=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),g=F`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:a})=>`Cannot overwrite reserved type ${a}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:a,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${a} = true,\` or \`${a} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:a,enumName:t})=>`Enum member names need to be unique, but the name \`${a}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:a})=>`Enum \`${a}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:a,enumName:t})=>`Enum type \`${a}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:a})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${a}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:a,memberName:t,explicitType:e})=>`Enum \`${a}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:a,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${a}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:a,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${a}\`.`,EnumInvalidMemberName:({enumName:a,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${a}\`.`,EnumNumberMemberNotInitialized:({enumName:a,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${a}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:a})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${a}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:a})=>`Unexpected reserved type ${a}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:a,suggestion:t})=>`\`declare export ${a}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function hr(a){return a.type==="DeclareExportAllDeclaration"||a.type==="DeclareExportDeclaration"&&(!a.declaration||a.declaration.type!=="TypeAlias"&&a.declaration.type!=="InterfaceDeclaration")}function ds(a){return a.importKind==="type"||a.importKind==="typeof"}var cr={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function pr(a,t){let e=[],s=[];for(let i=0;iclass extends a{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return We}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=ur.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let i=this.flowParseType();return this.state.inType=s,i}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(g.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[s,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),i=this.startNode(),r=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return i.params=n.params,i.rest=n.rest,i.this=n._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(g.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),i=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(g.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,g.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),i.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let r=null,n=!1;return i.forEach(o=>{hr(o)?(r==="CommonJS"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(g.DuplicateDeclareModuleExports,o),r==="ES"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="CommonJS",n=!0)}),e.kind=r||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let i=this.state.value;throw this.raise(g.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:cr[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return this.castNodeTo(s,"DeclareTypeAlias"),s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return this.castNodeTo(s,"DeclareOpaqueType"),s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(g.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,i){lr.has(e)&&this.raise(i?g.AssignReservedType:g.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,i=this.startNode(),r=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return i.name=n.name,i.variance=r,i.bound=n.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(g.MissingTypeParamDefault,s),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let i=!1;do{let r=this.flowParseTypeParameter(i);s.params.push(r),r.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==C.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=i}),this.state.inType=s,!this.state.inType&&this.curContext()===C.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,i){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let i=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:i,allowProto:r,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let h,c,u=!1;for(s&&this.match(6)?(this.expect(6),h=9,c=!0):(this.expect(5),h=8,c=!1),l.exact=c;!this.match(h);){let d=!1,x=null,A=null,N=this.startNode();if(r&&this.isContextual(118)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),x=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),d=!0)}let S=this.flowParseVariance();if(this.eat(0))x!=null&&this.unexpected(x),this.eat(0)?(S&&this.unexpected(S.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(N,d))):l.indexers.push(this.flowParseObjectTypeIndexer(N,d,S));else if(this.match(10)||this.match(47))x!=null&&this.unexpected(x),S&&this.unexpected(S.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(N,d));else{let I="init";if(this.isContextual(99)||this.isContextual(104)){let $=this.lookahead();Es($.type)&&(I=this.state.value,this.next())}let W=this.flowParseObjectTypeProperty(N,d,x,S,I,i,n??!c);W===null?(u=!0,A=this.state.lastTokStartLoc):l.properties.push(W)}this.flowObjectTypeSemicolon(),A&&!this.match(8)&&!this.match(9)&&this.raise(g.UnexpectedExplicitInexactInObject,A)}this.expect(h),i&&(l.inexact=u);let f=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,s,i,r,n,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(g.InexactInsideExact,this.state.lastTokStartLoc):this.raise(g.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(g.InexactVariance,r),null):(o||this.raise(g.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),r&&this.raise(g.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=i!=null,e.kind=n;let h=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),r&&this.unexpected(r.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(g.ThisParamBannedInConstructor,e.value.this)):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(h=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=h,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?g.GetterMayNotHaveThisParam:g.SetterMayNotHaveThisParam,e.value.this),i!==s&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){e??(e=this.state.startLoc);let i=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let r=this.startNodeAt(e);r.qualification=i,r.id=this.flowParseRestrictedIdentifier(!0),i=this.finishNode(r,"QualifiedTypeIdentifier")}return i}flowParseGenericType(e,s){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,s,i=!1){if(this.match(14)){let r=this.startNode();[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=r.typeAnnotation?this.finishNode(r,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(M(i.type)){let r=this.startNode();return this.next(),this.flowParseInterface(r)}}else if(this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,i){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||w(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(w(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||fs(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||fs(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(i),e}this.expect(17);let r=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:l,failed:h}=this.tryParseConditionalConsequent(),[c,u]=this.getArrowLikeExpressions(l);if(h||u.length>0){let f=[...n];if(u.length>0){this.state=r,this.state.noArrowAt=f;for(let d=0;d1&&this.raise(g.AmbiguousConditionalArrow,r.startLoc),h&&c.length===1&&(this.state=r,f.push(c[0].start),this.state.noArrowAt=f,{consequent:l,failed:h}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=n,this.expect(14),o.test=e,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let i=[e],r=[];for(;i.length!==0;){let n=i.pop();n.type==="ArrowFunctionExpression"&&n.body.type!=="BlockStatement"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):r.push(n),i.push(n.body)):n.type==="ConditionalExpression"&&(i.push(n.consequent),i.push(n.alternate))}return s?(r.forEach(n=>this.finishArrowValidation(n)),[r,[]]):pr(r,n=>n.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let i;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),i=s(),this.state.noArrowParamsConversionAt.pop()):i=s(),i}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=i,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return i}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(s),i}parseClassId(e,s,i){super.parseClassId(e,s,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,i){let{startLoc:r}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,i),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(g.DeclareClassElement,r):s.value&&this.raise(g.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):ar(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,i){for(let r=0;r1||!s)&&this.raise(g.TypeCastInPattern,n.typeAnnotation)}return e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(e,s,i){return e==="TypeCastExpression"||super.isValidLVal(e,s,i)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,i,r,n,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,i,r,n,o),s.params&&n){let l=s.params;l.length>0&&this.isThisParam(l[0])&&this.raise(g.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&n&&s.value.params){let l=s.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(g.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,i,r){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,i,r)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let s=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,s.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let i=s[0];this.isThisParam(i)&&e.kind==="get"?this.raise(g.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(g.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,i,r,n,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let h;this.match(47)&&!o&&(h=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(e,s,i,r,n,o,l);return h&&((c.value||c).typeParameters=h),c}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(g.PatternIsOptional,e),this.isThisParam(e)&&this.raise(g.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(g.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(g.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startsuper.parseMaybeAssign(e,s),r),!n.error)return n.node;let{context:h}=this.state,c=h[h.length-1];(c===C.j_oTag||c===C.j_expr)&&h.pop()}if((i=n)!=null&&i.error||this.match(47)){var o,l;r=r||this.state.clone();let h,c=this.tryParse(f=>{var d;h=this.flowParseTypeParameterDeclaration();let x=this.forwardNoArrowParamsConversionAt(h,()=>{let N=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(N,h),N});(d=x.extra)!=null&&d.parenthesized&&f();let A=this.maybeUnwrapTypeCastExpression(x);return A.type!=="ArrowFunctionExpression"&&f(),A.typeParameters=h,this.resetStartLocationFromNode(A,h),x},r),u=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(g.UnexpectedTypeParameterBeforeAsyncArrowFunction,h),c.node;u=c.node}if((o=n)!=null&&o.node)return this.state=n.failState,n.node;if(u)return this.state=c.failState,u;throw(l=n)!=null&&l.thrown?n.error:c.thrown?c.error:this.raise(g.UnexpectedTokenAfterTypeParameter,h)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let r=this.startNode();return[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),r});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,i,r=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let n=0;n0&&this.raise(g.ThisParamMustBeFirst,e.params[n]);super.checkParams(e,s,i,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let r=this.startNodeAt(s);r.callee=e,r.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(r,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let r=this.state.clone(),n=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(s)||l(),r);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,i),r);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(e,s,i)}parseSubscript(e,s,i,r){if(this.match(18)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,i)return r.stop=!0,e;this.next();let n=this.startNodeAt(s);return n.callee=e,n.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),n.arguments=this.parseCallExpressionArguments(11),n.optional=!0,this.finishCallExpression(n,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let n=this.startNodeAt(s);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(11),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let i=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(g.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(g.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let i=this.input.charCodeAt(s+e),r=this.input.charCodeAt(s+e+1);return i===58&&r===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:i===58&&r!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(g.EnumBooleanMemberNotInitialized,e,{memberName:i,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?g.EnumInvalidMemberInitializerSymbolType:g.EnumInvalidMemberInitializerPrimaryType:g.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(g.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(g.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let i=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 134:{let i=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:i}}flowEnumCheckExplicitTypeMismatch(e,s,i){let{explicitType:r}=s;r!==null&&r!==i&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let i=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:l,init:h}=this.flowEnumMemberRaw(),c=l.name;if(c==="")continue;/^[a-z]/.test(c)&&this.raise(g.EnumInvalidMemberName,l,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),i.has(c)&&this.raise(g.EnumDuplicateMemberName,l,{memberName:c,enumName:e}),i.add(c);let u={enumName:e,explicitType:s,memberName:c};switch(o.id=l,h.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(h.loc,u,"boolean"),o.init=h.value,r.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(h.loc,u,"number"),o.init=h.value,r.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(h.loc,u,"string"),o.init=h.value,r.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(h.loc,u);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(h.loc,u);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(h.loc,u);break;default:r.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:r,hasUnknownMembers:n}}flowEnumStringMembers(e,s,{enumName:i}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let r of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return s}else{for(let r of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!w(this.state.type))throw this.raise(g.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(g.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let i=s.name,r=s.loc.start,n=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:i,explicitType:n});switch(e.hasUnknownMembers=l,n){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let h=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=o.booleanMembers.length,u=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!c&&!u&&!f&&!d)return h();if(!c&&!u)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!u&&!f&&c>=d){for(let x of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(x.loc.start,{enumName:i,memberName:x.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!f&&u>=d){for(let x of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(x.loc.start,{enumName:i,memberName:x.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(g.EnumInconsistentMemberValues,r,{enumName:i}),h()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},dr=/\r\n|[\r\n\u2028\u2029]/,Ae=new RegExp(dr.source,"g");function ee(a){switch(a){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function ms(a,t,e){for(let s=t;s`Expected corresponding JSX closing tag for <${a}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:a,HTMLEntity:t})=>`Unexpected token \`${a}\`. Did you mean \`${t}\` or \`{'${a}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function q(a){return a?a.type==="JSXOpeningFragment"||a.type==="JSXClosingFragment":!1}function Q(a){if(a.type==="JSXIdentifier")return a.name;if(a.type==="JSXNamespacedName")return a.namespace.name+":"+a.name.name;if(a.type==="JSXMemberExpression")return Q(a.object)+"."+Q(a.property);throw new Error("Node had unexpected type: "+a.type)}var yr=a=>class extends a{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(J.UnterminatedJsxContent,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:ee(i)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),i;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=e?` -`:`\r -`):i=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,i}jsxReadString(e){let s="",i=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(p.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadEntity(),i=this.state.pos):ee(r)?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadNewLine(!1),i=this.state.pos):++this.state.pos}s+=this.input.slice(i,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let i=this.readInt(s,void 0,!1,"bail");if(i!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(i)}else{let s=0,i=!1;for(;s++<10&&this.state.pos1){for(let i=0;i0){if(s&256){let r=!!(s&512),n=(i&4)>0;return r!==n}return!0}return s&128&&(i&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(i&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let i=s-1;i>=0;i--){let n=this.scopeStack[i].tsNames.get(e);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(t)}},Ge=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function we(a,t){return(a?2:0)|(t?1:0)}var Ye=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let i=this.plugins.get(e);for(let r of Object.keys(s))if((i==null?void 0:i[r])!==s[r])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function Ls(a,t){a.trailingComments===void 0?a.trailingComments=t:a.trailingComments.unshift(...t)}function xr(a,t){a.leadingComments===void 0?a.leadingComments=t:a.leadingComments.unshift(...t)}function xe(a,t){a.innerComments===void 0?a.innerComments=t:a.innerComments.unshift(...t)}function z(a,t,e){let s=null,i=t.length;for(;s===null&&i>0;)s=t[--i];s===null||s.start>e.start?xe(a,e.comments):Ls(s,e.comments)}var Qe=class extends Ye{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let i=s-1,r=e[i];r.start===t.end&&(r.leadingNode=t,i--);let{start:n}=t;for(;i>=0;i--){let o=e[i],l=o.end;if(l>n)o.containingNode=t,this.finalizeComment(o),e.splice(i,1);else{l===n&&(o.trailingNode=t);break}}}finalizeComment(t){var e;let{comments:s}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&Ls(t.leadingNode,s),t.trailingNode!==null&&xr(t.trailingNode,s);else{let{containingNode:i,start:r}=t;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":z(i,i.properties,t);break;case"CallExpression":case"OptionalCallExpression":z(i,i.arguments,t);break;case"ImportExpression":z(i,[i.source,(e=i.options)!=null?e:null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":z(i,i.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":z(i,i.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":z(i,i.specifiers,t);break;case"TSEnumDeclaration":z(i,i.members,t);break;case"TSEnumBody":z(i,i.members,t);break;default:xe(i,s)}else xe(i,s)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let i=e[s-1];i.leadingNode===t&&(i.leadingNode=null)}takeSurroundingComments(t,e,s){let{commentStack:i}=this.state,r=i.length;if(r===0)return;let n=r-1;for(;n>=0;n--){let o=i[n],l=o.end;if(o.start===s)o.leadingNode=t;else if(l===e)o.trailingNode=t;else if(l0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startIndex:s,startLine:i,startColumn:r}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.startIndex=s,this.curLine=i,this.lineStart=-r,this.startLoc=this.endLoc=new B(i,r,s)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new B(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new a;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},Pr=function(t){return t>=48&&t<=57},ys={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Se={bin:a=>a===48||a===49,oct:a=>a>=48&&a<=55,dec:a=>a>=48&&a<=57,hex:a=>a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102};function xs(a,t,e,s,i,r){let n=e,o=s,l=i,h="",c=null,u=e,{length:f}=t;for(;;){if(e>=f){r.unterminated(n,o,l),h+=t.slice(u,e);break}let d=t.charCodeAt(e);if(gr(a,d,t,e)){h+=t.slice(u,e);break}if(d===92){h+=t.slice(u,e);let x=Tr(t,e,s,i,a==="template",r);x.ch===null&&!c?c={pos:e,lineStart:s,curLine:i}:h+=x.ch,{pos:e,lineStart:s,curLine:i}=x,u=e}else d===8232||d===8233?(++e,++i,s=e):d===10||d===13?a==="template"?(h+=t.slice(u,e)+` -`,++e,d===13&&t.charCodeAt(e)===10&&++e,++i,u=s=e):r.unterminated(n,o,l):++e}return{pos:e,str:h,firstInvalidLoc:c,lineStart:s,curLine:i,containsInvalid:!!c}}function gr(a,t,e,s){return a==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(a==="double"?34:39)}function Tr(a,t,e,s,i,r){let n=!i;t++;let o=h=>({pos:t,ch:h,lineStart:e,curLine:s}),l=a.charCodeAt(t++);switch(l){case 110:return o(` -`);case 114:return o("\r");case 120:{let h;return{code:h,pos:t}=et(a,t,e,s,2,!1,n,r),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:t}=Ms(a,t,e,s,n,r),o(h===null?null:String.fromCodePoint(h))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:a.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);r.strictNumericEscape(t-1,e,s);default:if(l>=48&&l<=55){let h=t-1,u=/^[0-7]+/.exec(a.slice(h,t+2))[0],f=parseInt(u,8);f>255&&(u=u.slice(0,-1),f=parseInt(u,8)),t+=u.length-1;let d=a.charCodeAt(t);if(u!=="0"||d===56||d===57){if(i)return o(null);r.strictNumericEscape(h,e,s)}return o(String.fromCharCode(f))}return o(String.fromCharCode(l))}}function et(a,t,e,s,i,r,n,o){let l=t,h;return{n:h,pos:t}=Ds(a,t,e,s,16,i,r,!1,o,!n),h===null&&(n?o.invalidEscapeSequence(l,e,s):t=l-1),{code:h,pos:t}}function Ds(a,t,e,s,i,r,n,o,l,h){let c=t,u=i===16?ys.hex:ys.decBinOct,f=i===16?Se.hex:i===10?Se.dec:i===8?Se.oct:Se.bin,d=!1,x=0;for(let A=0,N=r??1/0;A=97?I=S-97+10:S>=65?I=S-65+10:Pr(S)?I=S-48:I=1/0,I>=i){if(I<=9&&h)return{n:null,pos:t};if(I<=9&&l.invalidDigit(t,e,s,i))I=0;else if(n)I=0,d=!0;else break}++t,x=x*i+I}return t===c||r!=null&&t-c!==r||d?{n:null,pos:t}:{n:x,pos:t}}function Ms(a,t,e,s,i,r){let n=a.charCodeAt(t),o;if(n===123){if(++t,{code:o,pos:t}=et(a,t,e,s,a.indexOf("}",t)-t,!0,i,r),++t,o!==null&&o>1114111)if(i)r.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=et(a,t,e,s,4,!1,i,r));return{code:o,pos:t}}function pe(a,t,e){return new B(e,a-t,a)}var br=new Set([103,109,115,105,121,117,100,118]),O=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new se(t.startLoc,t.endLoc)}},tt=class extends Qe{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,i,r,n)=>this.optionFlags&2048?(this.raise(p.InvalidDigit,pe(s,i,r),{radix:n}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(p.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(p.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(p.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(p.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,i,r)=>{this.recordStrictModeErrors(p.StrictNumericEscape,pe(s,i,r))},unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedString,pe(s-1,i,r))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(p.StrictNumericEscape),unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedTemplate,pe(s,i,r))}}),this.state=new Ze,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new O(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return $e.lastIndex=t,$e.test(this.input)?$e.lastIndex:t}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(t){return this.input.charCodeAt(this.nextTokenStartSince(t))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return Ve.lastIndex=t,Ve.test(this.input)?Ve.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,i=this.input.indexOf(t,s+2);if(i===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+t.length,Ae.lastIndex=s+2;Ae.test(this.input)&&Ae.lastIndex<=i;)++this.state.curLine,this.state.lineStart=Ae.lastIndex;if(this.isLookahead)return;let r={type:"CommentBlock",value:this.input.slice(s+2,i),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(i+t.length),loc:new se(e,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(r),r}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){let r=this.skipLineComment(3);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else if(s===60&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let r=this.skipLineComment(4);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else break e}}if((e==null?void 0:e.length)>0){let s=this.state.pos,i={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(p.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?p.RecordExpressionHashIncorrectStartSyntaxType:p.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else U(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!ee(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(U(t)){this.readWord(t);return}}throw this.raise(p.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,i,{pos:r}=this.state;for(;;++r){if(r>=this.length)throw this.raise(p.UnterminatedRegExp,D(t,1));let h=this.input.charCodeAt(r);if(ee(h))throw this.raise(p.UnterminatedRegExp,D(t,1));if(s)s=!1;else{if(h===91)i=!0;else if(h===93&&i)i=!1;else if(h===47&&!i)break;s=h===92}}let n=this.input.slice(e,r);++r;let o="",l=()=>D(t,r+2-e);for(;r=2&&this.input.charCodeAt(e)===48;if(l){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(p.StrictOctalLiteral,s),!this.state.strict){let x=d.indexOf("_");x>0&&this.raise(p.ZeroDigitNumericSeparator,D(s,x))}o=l&&!/[89]/.test(d)}let h=this.input.charCodeAt(this.state.pos);if(h===46&&!o&&(++this.state.pos,this.readInt(10),i=!0,h=this.input.charCodeAt(this.state.pos)),(h===69||h===101)&&!o&&(h=this.input.charCodeAt(++this.state.pos),(h===43||h===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(p.InvalidOrMissingExponent,s),i=!0,n=!0,h=this.input.charCodeAt(this.state.pos)),h===110&&((i||l)&&this.raise(p.InvalidBigIntLiteral,s),++this.state.pos,r=!0),h===109){this.expectPlugin("decimal",this.state.curPosition()),(n||l)&&this.raise(p.InvalidDecimal,s),++this.state.pos;var c=!0}if(U(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());let u=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(r){this.finishToken(136,u);return}if(c){this.finishToken(137,u);return}let f=o?parseInt(u,8):parseFloat(u);this.finishToken(135,f)}readCodePoint(t){let{code:e,pos:s}=Ms(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:i,lineStart:r}=xs(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=i,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:i,curLine:r,lineStart:n}=xs("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=r,s&&(this.state.firstInvalidTemplateEscapePos=new B(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(i)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,i=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;o--){let l=n[o];if(l.loc.index===r)return n[o]=t(i,s);if(l.loc.indexthis.hasPlugin(e)))throw this.raise(p.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,i)=>{this.raise(t,pe(e,s,i))}}},st=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},it=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new st)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,i]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,i):this.parser.raise(p.InvalidPrivateFieldResolution,i,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:i,loneAccessors:r,undefinedPrivateNames:n}=this.current(),o=i.has(t);if(e&3){let l=o&&r.get(t);if(l){let h=l&4,c=e&4,u=l&3,f=e&3;o=u===f||h!==c,o||r.delete(t)}else o||r.set(t,e)}o&&this.parser.raise(p.PrivateNameRedeclaration,s,{identifierName:t}),i.add(t),n.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(p.InvalidPrivateFieldResolution,e,{identifierName:t})}},ie=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},ke=class extends ie{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},rt=class{constructor(t){this.parser=void 0,this.stack=[new ie],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:i}=this,r=i.length-1,n=i[r];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,s);else return;n=i[--r]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,i=s[s.length-1],r=e.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(t,r);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,r);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,i=e[s];for(;i.canBeArrowParameterDeclaration();)i.type===2&&i.recordDeclarationError(p.AwaitBindingIdentifier,t),i=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,i])=>{this.parser.raise(s,i);let r=t.length-2,n=t[r];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(i.index),n=t[--r]})}};function Ar(){return new ie(3)}function Sr(){return new ke(1)}function Er(){return new ke(2)}function Os(){return new ie}var at=class extends tt{addExtra(t,e,s,i=!0){if(!t)return;let{extra:r}=t;r==null&&(r={},t.extra=r),i?r[e]=s:Object.defineProperty(r,e,{enumerable:i,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){if(this.input.startsWith(e,t)){let s=this.input.charCodeAt(t+e.length);return!(Z(s)||(s&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return ms(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return ms(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(p.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let i=t((r=null)=>{throw s.node=r,s});if(this.state.errors.length>e.errors.length){let r=this.state;return this.state=e,this.state.tokensLength=r.tokensLength,{node:i,error:r.errors[e.errors.length],thrown:!1,aborted:!1,failState:r}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let r=this.state;if(this.state=e,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:r};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:r};throw i}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:r,optionalParametersLoc:n}=t,o=!!s||!!i||!!n||!!r;if(!e)return o;s!=null&&this.raise(p.InvalidCoverInitializedName,s),i!=null&&this.raise(p.DuplicateProto,i),r!=null&&this.raise(p.UnexpectedPrivateField,r),n!=null&&this.unexpected(n)}isLiteralPropertyName(){return Es(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=t;let r=this.scope,n=this.getScopeHandler();this.scope=new n(this,t);let o=this.prodParam;this.prodParam=new Ge;let l=this.classScope;this.classScope=new it(this);let h=this.expressionScope;return this.expressionScope=new rt(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=i,this.scope=r,this.prodParam=o,this.classScope=l,this.expressionScope=h}}enterInitialScopes(){let t=0;(this.inModule||this.optionFlags&1)&&(t|=2),this.optionFlags&32&&(t|=1),this.optionFlags&2&&(t|=4);let e=1;this.optionFlags&4&&(e|=512),this.scope.enter(e),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},te=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},re=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new se(s),(t==null?void 0:t.optionFlags)&128&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},nt=re.prototype;nt.__clone=function(){let a=new re(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;ea.type==="ParenthesizedExpression"?Fs(a.expression):a,lt=class extends ot{toAssignable(t,e=!1){var s,i;let r;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(r=Fs(t),e?r.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(p.InvalidParenthesizedAssignment,t):r.type!=="MemberExpression"&&!this.isOptionalMemberExpression(r)&&this.raise(p.InvalidParenthesizedAssignment,t):this.raise(p.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":this.castNodeTo(t,"ObjectPattern");for(let o=0,l=t.properties.length,h=l-1;oi.type!=="ObjectMethod"&&(r===s||i.type!=="SpreadElement")&&this.isAssignable(i))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let i=s&1,r=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(12),i&&this.match(12))r.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),r.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];if(s&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(p.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());r.push(this.parseBindingElement(s,o))}}return r}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseBindingElement(t,e){let s=this.parseMaybeDefault();return(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s),e.length&&(s.decorators=e,this.resetStartLocationFromNode(s,e[0])),this.parseMaybeDefault(s.loc.start,s)}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){if(t??(t=this.state.startLoc),e=e??this.parseBindingAtom(),!this.eat(29))return e;let s=this.startNodeAt(t);return s.left=e,s.right=this.parseMaybeAssignAllowIn(),this.finishNode(s,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,i=!1,r=!1,n=!1){var o;let l=t.type;if(this.isObjectMethod(t))return;let h=this.isOptionalMemberExpression(t);if(h||l==="MemberExpression"){h&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(p.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(p.InvalidPropertyBindingPattern,t);return}if(l==="Identifier"){this.checkIdentifier(t,s,r);let{name:A}=t;i&&(i.has(A)?this.raise(p.ParamDupe,t):i.add(A));return}let c=this.isValidLVal(l,!(n||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(c===!0)return;if(c===!1){let A=s===64?p.InvalidLhs:p.InvalidLhsBinding;this.raise(A,t,{ancestor:e});return}let u,f;typeof c=="string"?(u=c,f=l==="ParenthesizedExpression"):[u,f]=c;let d=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,x=t[u];if(Array.isArray(x))for(let A of x)A&&this.checkLVal(A,d,s,i,r,f);else x&&this.checkLVal(x,d,s,i,r,f)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?vs(t.name,this.inModule):ks(t.name))&&(e===64?this.raise(p.StrictEvalArguments,t,{referenceName:t.name}):this.raise(p.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(p.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(p.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?p.RestTrailingComma:p.ElementAfterRest,this.state.startLoc),!0):!1}};function Cr(a){if(a==null)throw new Error(`Unexpected ${a} value.`);return a}function Ps(a){if(!a)throw new Error("Assert fail")}var y=F`typescript`({AbstractMethodHasImplementation:({methodName:a})=>`Method '${a}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:a})=>`Property '${a}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:a})=>`'declare' is not allowed in ${a}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:a})=>`Accessibility modifier already seen: '${a}'.`,DuplicateModifier:({modifier:a})=>`Duplicate modifier: '${a}'.`,EmptyHeritageClauseType:({token:a})=>`'${a}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:a})=>`'${a[0]}' modifier cannot be used with '${a[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:a})=>`Index signatures cannot have an accessibility modifier ('${a}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:a})=>`'${a}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:a=>`'${a}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:a})=>`'${a}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:a})=>`'${a}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:a})=>`'${a}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:a=>`'${a}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:a})=>`'${a[0]}' modifier must precede '${a[1]}' modifier.`,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.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:a})=>`Private elements cannot have an accessibility modifier ('${a}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:a})=>`Single type parameter ${a} should have a trailing comma. Example usage: <${a},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:a})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${a}.`,UsingDeclarationInAmbientContext:a=>`'${a}' declarations are not allowed in ambient contexts.`});function wr(a){switch(a){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function gs(a){return a==="private"||a==="public"||a==="protected"}function Ir(a){return a==="in"||a==="out"}var Nr=a=>class extends a{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:y.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter})}getScopeHandler(){return Xe}tsIsIdentifier(){return w(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s,i){if(!w(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.includes(r)){if(i&&this.match(106)||s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:i,errorTemplate:r=y.InvalidModifierOnTypeMember},n){let o=(h,c,u,f)=>{c===u&&n[f]&&this.raise(y.InvalidModifiersOrder,h,{orderedModifiers:[u,f]})},l=(h,c,u,f)=>{(n[u]&&c===f||n[f]&&c===u)&&this.raise(y.IncompatibleModifiers,h,{modifiers:[u,f]})};for(;;){let{startLoc:h}=this.state,c=this.tsParseModifier(e.concat(s??[]),i,n.static);if(!c)break;gs(c)?n.accessibility?this.raise(y.DuplicateAccessibilityModifier,h,{modifier:c}):(o(h,c,c,"override"),o(h,c,c,"static"),o(h,c,c,"readonly"),n.accessibility=c):Ir(c)?(n[c]&&this.raise(y.DuplicateModifier,h,{modifier:c}),n[c]=!0,o(h,c,"in","out")):(hasOwnProperty.call(n,c)?this.raise(y.DuplicateModifier,h,{modifier:c}):(o(h,c,"static","readonly"),o(h,c,"static","override"),o(h,c,"override","readonly"),o(h,c,"abstract","override"),l(h,c,"declare","override"),l(h,c,"static","abstract")),n[c]=!0),s!=null&&s.includes(c)&&this.raise(r,h,{modifier:c})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let i=[];for(;!this.tsIsListTerminator(e);)i.push(s());return i}tsParseDelimitedList(e,s,i){return Cr(this.tsParseDelimitedListWorker(e,s,!0,i))}tsParseDelimitedListWorker(e,s,i,r){let n=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=s();if(l==null)return;if(n.push(l),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(12);return}return r&&(r.value=o),n}tsParseBracketedList(e,s,i,r,n){r||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,n);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(y.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(5);let s=this.startNode();return this.isContextual(76)?(s.method=!1,s.key=this.parseIdentifier(!0),s.computed=!1,s.shorthand=!1):this.unexpected(null,76),this.expect(14),s.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(s)],this.expect(8),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),s=[];for(this.expect(5);!this.match(8);){let i=this.state.type;w(i)||i===134?s.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return e.properties=s,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let s;if(e&1&&this.match(78))if(e&2)s=this.parseIdentifier(!0);else{let i=this.startNode();this.next(),s=this.finishNode(i,"ThisExpression")}else s=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdentifier(!!(e&1)),s=this.finishNode(i,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),s.params.length===0&&this.raise(y.EmptyTypeParameters,s),i.value!==-1&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let i=e===19,r="parameters",n="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[r]=this.tsParseBindingListForSignature(),i?s[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:i}=s;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(y.UnsupportedSignatureParameterKind,s,{type:i})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),w(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){if(this.eat(17)&&(e.optional=!0),this.match(10)||this.match(47)){s&&this.raise(y.ReadonlyForMethodSignature,e);let i=e;i.kind&&this.match(47)&&this.raise(y.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let r="parameters",n="typeAnnotation";if(i.kind==="get")i[r].length>0&&(this.raise(p.BadGetterArity,this.state.curPosition()),this.isThisParam(i[r][0])&&this.raise(y.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[r].length!==1)this.raise(p.BadSetterArity,this.state.curPosition());else{let o=i[r][0];this.isThisParam(o)&&this.raise(y.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(y.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(y.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[n]&&this.raise(y.SetAccessorCannotHaveReturnType,i[n])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=e;s&&(i.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(i.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(i,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(i=>{let{type:r}=i;s&&r!=="TSRestType"&&r!=="TSOptionalType"&&!(r==="TSNamedTupleMember"&&i.optional)&&this.raise(y.OptionalTypeBeforeRequired,i),s||(s=r==="TSNamedTupleMember"&&i.optional||r==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,s=this.eat(21),{startLoc:i}=this.state,r,n,o,l,c=M(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,o=!1,n=this.parseIdentifier(!0),this.expect(14),l=this.tsParseType();else if(c===63){o=!0;let u=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(i),u),this.expect(17),this.expect(14),l=this.tsParseType()):(r=!1,l=f,this.expect(17))}else l=this.tsParseType(),o=this.eat(17),r=this.eat(14);if(r){let u;n?(u=this.startNodeAt(i),u.optional=o,u.label=n,u.elementType=l,this.eat(17)&&(u.optional=!0,this.raise(y.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAt(i),u.optional=o,this.raise(y.InvalidTupleMemberLabel,l),u.label=l,u.elementType=this.tsParseType()),l=this.finishNode(u,"TSNamedTupleMember")}else if(o){let u=this.startNodeAt(i);u.typeAnnotation=l,l=this.finishNode(u,"TSOptionalType")}if(s){let u=this.startNodeAt(e);u.typeAnnotation=l,l=this.finishNode(u,"TSRestType")}return l}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let i=this.startNode();return e==="TSConstructorType"&&(i.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(w(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":wr(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAt(e);i.elementType=s,this.expect(3),s=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(e);i.objectType=s,i.indexType=this.tsParseType(),this.expect(3),s=this.finishNode(i,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(y.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return Xi(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,i){let r=this.startNode(),n=this.eat(i),o=[];do o.push(s());while(this.eat(i));return o.length===1&&!n?o[0]:(r.types=o,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(w(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let i=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(i.parameterName=l,i.asserts=!0,i.typeAnnotation=null,l=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(l,i),l.asserts=!0),s.typeAnnotation=l,this.finishNode(s,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return r?(i.parameterName=this.parseIdentifier(),i.asserts=r,i.typeAnnotation=null,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=r,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!w(this.state.type)&&!this.match(78)?!1:(e&&this.raise(p.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){Ps(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(y.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{{let r=this.startNode();return r.expression=this.tsParseEntityName(3),this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSExpressionWithTypeArguments")}});return i.length||this.raise(y.EmptyHeritageClauseType,s,{token:e}),i}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),w(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(y.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==C.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,i){e.isExport=i||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let r=this.tsParseModuleReference();return e.importKind==="type"&&r.type!=="TSExternalModuleReference"&&this.raise(y.ImportAliasHasImportType,r),e.moduleReference=r,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),i=e();return this.state=s,i}tsTryParseAndCatch(e){let s=this.tryParse(i=>e()||i());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),i=e();if(i!==void 0&&i!==!1)return i;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type;return this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 107:if(this.hasPlugin("explicitResourceManagement")&&this.isUsing())return this.raise(y.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 96:if(this.hasPlugin("explicitResourceManagement")&&this.isAwaitUsing())return this.raise(y.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(w(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,i){switch(s.name){case"declare":{let r=this.tsTryParseDeclare(e);return r&&(r.declare=!0),r}case"global":if(this.match(5)){this.scope.enter(1024),this.prodParam.enter(0);let r=e;return r.kind="global",e.global=!0,r.id=s,r.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,i)}}tsParseDeclaration(e,s,i,r){switch(s){case"abstract":if(this.tsCheckLineTerminator(i)&&(this.match(80)||w(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case"module":if(this.tsCheckLineTerminator(i)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(w(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(i)&&w(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(i)&&w(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let r=this.startNodeAt(e);return r.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(r),r.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),r});if(this.state.maybeInArrowParameters=s,!!i)return super.parseArrowExpression(i,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(y.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===C.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Gi(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,s){let i=s.length?s[0].loc.start:this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},r);let n=r.accessibility,o=r.override,l=r.readonly;!(e&4)&&(n||l||o)&&this.raise(y.UnexpectedParameterModifier,i);let h=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(h);let c=this.parseMaybeDefault(h.loc.start,h);if(n||l||o){let u=this.startNodeAt(i);return s.length&&(u.decorators=s),n&&(u.accessibility=n),l&&(u.readonly=l),o&&(u.override=o),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(y.UnsupportedParameterPropertyKind,u),u.parameter=c,this.finishNode(u,"TSParameterProperty")}return s.length&&(h.decorators=s),c}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(y.PatternIsOptional,s)}setArrowFunctionParameters(e,s,i){super.setArrowFunctionParameters(e,s,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,i=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let r=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return r&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,r):r==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(y.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,r,i):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,i))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(y.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,s,i,r){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return r.stop=!0,e;r.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(s);if(f)return f}let h=this.tsParseTypeArgumentsInExpression();if(!h)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(Ne(this.state.type)){let f=super.parseTaggedTemplateExpression(e,s,r);return f.typeParameters=h,f}if(!i&&this.eat(10)){let f=this.startNodeAt(s);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=h,r.optionalChainMember&&(f.optional=n),this.finishCallExpression(f,r.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&ue(c)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(s);return u.expression=e,u.typeParameters=h,this.finishNode(u,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(y.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(l.expression=super.stopParseSubscript(e,r))),l}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:i}=e;i.type==="TSInstantiationExpression"&&!((s=i.extra)!=null&&s.parenthesized)&&(e.typeParameters=i.typeParameters,e.callee=i.expression)}parseExprOp(e,s,i){let r;if(Ce(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(r=this.isContextual(120)))){let n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(r&&this.raise(p.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,r?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,s,i)}return super.parseExprOp(e,s,i)}checkReservedWord(e,s,i,r){this.state.isAmbientContext||super.checkReservedWord(e,s,i,r)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(y.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,r){super.applyImportPhase(e,s,i,r),s?e.exportKind=i==="type"?"type":"value":e.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let s;if(w(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,i);s=super.parseImportSpecifiersAndAfter(e,i)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(y.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){let i=e;this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(i,!1):i.importKind="value",this.tsParseImportEqualsDeclaration(i,r,!0)}else if(this.eat(29)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=e;return this.expectContextual(128),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,i=!1){let{isAmbientContext:r}=this.state,n=super.parseVarStatement(e,s,i||r);if(!r)return n;if(!e.declare&&(s==="using"||s==="await using"))return this.raiseOverwrite(y.UsingDeclarationInAmbientContext,e,s),n;for(let{id:o,init:l}of n.declarations)l&&(s==="var"||s==="let"||o.typeAnnotation?this.raise(y.InitializerNotAllowedInAmbientContext,l):vr(l,this.hasPlugin("estree"))||this.raise(y.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return n}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(i=>gs(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,i){let r=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:y.InvalidModifierOnTypeParameterPositions},s);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,r)&&this.raise(y.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,i,!!s.static)};s.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(e,s,i,r){let n=this.tsTryParseIndexSignature(s);if(n){e.body.push(n),s.abstract&&this.raise(y.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(y.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(y.IndexSignatureHasDeclare,s),s.override&&this.raise(y.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(y.NonAbstractClassHasAbstractMethod,s),s.override&&(i.hadSuperClass||this.raise(y.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,i,r)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(y.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(y.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,i){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,i):void 0)||super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let r=this.lookaheadCharCode();if(r===44||r===61||r===58||r===41)return this.setOptionalParametersError(i),e}return super.parseConditional(e,s,i)}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,i=this.eatContextual(125);if(i&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(y.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let n=w(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||i)&&(e.exportKind="type"),i&&n.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(n,s),n.declare=!0),n):null}parseClassId(e,s,i,r){if((!s||i)&&this.isContextual(113))return;super.parseClassId(e,s,i,e.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(y.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(y.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(y.PrivateElementHasAbstract,e),e.accessibility&&this.raise(y.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(y.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,i,r,n,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&n&&this.raise(y.ConstructorHasTypeParameters,l);let{declare:h=!1,kind:c}=s;h&&(c==="get"||c==="set")&&this.raise(y.DeclareAccessor,s,{kind:c}),l&&(s.typeParameters=l),super.pushClassMethod(e,s,i,r,n,o)}pushClassPrivateMethod(e,s,i,r){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(s.typeParameters=n),super.pushClassPrivateMethod(e,s,i,r)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&e.value.body==null||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,i,r,n,o,l){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);return h&&(e.typeParameters=h),super.parseObjPropValue(e,s,i,r,n,o,l)}parseFunctionParams(e,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(e.typeParameters=i),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var i,r,n,o,l;let h,c,u;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(h=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!c.error)return c.node;let{context:x}=this.state,A=x[x.length-1];(A===C.j_oTag||A===C.j_expr)&&x.pop()}if(!((i=c)!=null&&i.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!h||h===this.state)&&(h=this.state.clone());let f,d=this.tryParse(x=>{var A,N;f=this.tsParseTypeParameters(this.tsParseConstModifier);let S=super.parseMaybeAssign(e,s);return(S.type!=="ArrowFunctionExpression"||(A=S.extra)!=null&&A.parenthesized)&&x(),((N=f)==null?void 0:N.params.length)!==0&&this.resetStartLocationFromNode(S,f),S.typeParameters=f,S},h);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!c&&(Ps(!this.hasPlugin("jsx")),u=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!u.error))return u.node;if((r=c)!=null&&r.node)return this.state=c.failState,c.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;throw((o=c)==null?void 0:o.error)||d.error||((l=u)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(y.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(i=>{let r=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),r});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(y.UnexpectedTypeCastInParameter,e):this.raise(y.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,i){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(i!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,i)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,s){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e,s);return r.typeParameters=i,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,s)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:i}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=i}}parseClass(e,s,i){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,i)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(y.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,i,r,n,o,l){let h=super.parseMethod(e,s,i,r,n,o,l);if((h.abstract||h.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?h.value:h).body){let{key:f}=h;this.raise(y.AbstractMethodHasImplementation,h,{methodName:f.type==="Identifier"&&!h.computed?f.name:`[${this.input.slice(this.offsetToSourcePos(f.start),this.offsetToSourcePos(f.end))}]`})}return h}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,i,r){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,i),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,i,r))}parseImportSpecifier(e,s,i,r,n){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,i),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,i,r,i?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,i){let r=s?"imported":"local",n=s?"local":"exported",o=e[r],l,h=!1,c=!0,u=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let x=this.parseIdentifier();M(this.state.type)?(h=!0,o=d,l=s?this.parseIdentifier():this.parseModuleExportName(),c=!1):(l=x,c=!1)}else M(this.state.type)?(c=!1,l=s?this.parseIdentifier():this.parseModuleExportName()):(h=!0,o=d)}else M(this.state.type)&&(h=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());h&&i&&this.raise(s?y.TypeModifierIsUsedInTypeImports:y.TypeModifierIsUsedInTypeExports,u),e[r]=o,e[n]=l;let f=s?"importKind":"exportKind";e[f]=h?"type":"value",c&&this.eatContextual(93)&&(e[n]=s?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=this.cloneIdentifier(e[r])),s&&this.checkIdentifier(e[n],h?4098:4096)}fillOptionalPropertiesForTSESLint(e){var s,i,r,n,o,l,h,c,u,f,d,x,A,N,S,I,W,$,Mt,Ot,Ft,Bt,Rt,_t,Ut,jt,$t,Vt,qt,zt,Ht,Kt,Wt,Jt,Xt,Gt,Yt,Qt,Zt,es,ts,ss,is,rs,as,ns;switch(e.type){case"ExpressionStatement":(s=e.directive)!=null||(e.directive=void 0);return;case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(i=e.decorators)!=null||(e.decorators=[]),(r=e.optional)!=null||(e.optional=!1),(n=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);return;case"TSParameterProperty":(o=e.accessibility)!=null||(e.accessibility=void 0),(l=e.decorators)!=null||(e.decorators=[]),(h=e.override)!=null||(e.override=!1),(c=e.readonly)!=null||(e.readonly=!1),(u=e.static)!=null||(e.static=!1);return;case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(f=e.declare)!=null||(e.declare=!1),(d=e.returnType)!=null||(e.returnType=void 0),(x=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"Property":(A=e.optional)!=null||(e.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(N=e.optional)!=null||(e.optional=!1);case"TSIndexSignature":(S=e.accessibility)!=null||(e.accessibility=void 0),(I=e.readonly)!=null||(e.readonly=!1),(W=e.static)!=null||(e.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":($=e.declare)!=null||(e.declare=!1),(Mt=e.definite)!=null||(e.definite=!1),(Ot=e.readonly)!=null||(e.readonly=!1),(Ft=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(Bt=e.accessibility)!=null||(e.accessibility=void 0),(Rt=e.decorators)!=null||(e.decorators=[]),(_t=e.override)!=null||(e.override=!1),(Ut=e.optional)!=null||(e.optional=!1);return;case"ClassExpression":(jt=e.id)!=null||(e.id=null);case"ClassDeclaration":($t=e.abstract)!=null||(e.abstract=!1),(Vt=e.declare)!=null||(e.declare=!1),(qt=e.decorators)!=null||(e.decorators=[]),(zt=e.implements)!=null||(e.implements=[]),(Ht=e.superTypeArguments)!=null||(e.superTypeArguments=void 0),(Kt=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(Wt=e.declare)!=null||(e.declare=!1);return;case"VariableDeclarator":(Jt=e.definite)!=null||(e.definite=!1);return;case"TSEnumDeclaration":(Xt=e.const)!=null||(e.const=!1),(Gt=e.declare)!=null||(e.declare=!1);return;case"TSEnumMember":(Yt=e.computed)!=null||(e.computed=!1);return;case"TSImportType":(Qt=e.qualifier)!=null||(e.qualifier=null),(Zt=e.options)!=null||(e.options=null);return;case"TSInterfaceDeclaration":(es=e.declare)!=null||(e.declare=!1),(ts=e.extends)!=null||(e.extends=[]);return;case"TSModuleDeclaration":(ss=e.declare)!=null||(e.declare=!1),(is=e.global)!=null||(e.global=e.kind==="global");return;case"TSTypeParameter":(rs=e.const)!=null||(e.const=!1),(as=e.in)!=null||(e.in=!1),(ns=e.out)!=null||(e.out=!1);return}}};function kr(a){if(a.type!=="MemberExpression")return!1;let{computed:t,property:e}=a;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Rs(a.object)}function vr(a,t){var e;let{type:s}=a;if((e=a.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:i}=a;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(Bs(a,t)||Lr(a,t)||s==="TemplateLiteral"&&a.expressions.length===0||kr(a))}function Bs(a,t){return t?a.type==="Literal"&&(typeof a.value=="number"||"bigint"in a):a.type==="NumericLiteral"||a.type==="BigIntLiteral"}function Lr(a,t){if(a.type==="UnaryExpression"){let{operator:e,argument:s}=a;if(e==="-"&&Bs(s,t))return!0}return!1}function Rs(a){return a.type==="Identifier"?!0:a.type!=="MemberExpression"||a.computed?!1:Rs(a.object)}var Ts=F`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Dr=a=>class extends a{parsePlaceholder(e){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let i=e;return(!i.expectedNode||!i.type)&&(i=this.finishNode(i,"Placeholder")),i.expectedNode=s,i}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,i,r){e!==void 0&&super.checkReservedWord(e,s,i,r)}cloneIdentifier(e){let s=super.cloneIdentifier(e);return s.type==="Placeholder"&&(s.expectedNode=e.expectedNode),s}cloneStringLiteral(e){return e.type==="Placeholder"?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,i){return e==="Placeholder"||super.isValidLVal(e,s,i)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){if(super.chStartsBindingIdentifier(e,s))return!0;let i=this.nextTokenStart();return this.input.charCodeAt(i)===37&&this.input.charCodeAt(i+1)===37}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var i;if(s.type!=="Placeholder"||(i=s.extra)!=null&&i.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let n=e;return n.label=this.finishPlaceholder(s,"Identifier"),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,"LabeledStatement")}this.semicolon();let r=e;return r.name=s.name,this.finishPlaceholder(r,"Statement")}parseBlock(e,s,i){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,i)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,i){let r=s?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(133)||this.match(5))e.id=o;else{if(i||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,r);throw this.raise(Ts.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,i);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,n),this.finishNode(e,r)}parseExport(e,s){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseExport(e,s);let r=e;if(!this.isContextual(98)&&!this.match(12))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(i,"Declaration"),this.finishNode(r,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let n=this.startNode();return n.exported=i,r.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],super.parseExport(r,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(H(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var i;return(i=e.specifiers)!=null&&i.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(i=>i.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let i=this.startNodeAtNode(s);return i.local=s,e.specifiers.push(this.finishNode(i,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Ts.UnexpectedSpace,this.state.lastTokEndLoc)}},Mr=a=>class extends a{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),w(this.state.type)){let i=this.parseIdentifierName(),r=this.createIdentifier(s,i);if(this.castNodeTo(r,"V8IntrinsicIdentifier"),this.match(10))return r}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},bs=["minimal","fsharp","hack","smart"],As=["^^","@@","^","%","#"];function Or(a){if(a.has("decorators")){if(a.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let s=a.get("decorators").decoratorsBeforeExport;if(s!=null&&typeof s!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let i=a.get("decorators").allowCallParenthesized;if(i!=null&&typeof i!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(a.has("flow")&&a.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(a.has("placeholders")&&a.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(a.has("pipelineOperator")){var t;let s=a.get("pipelineOperator").proposal;if(!bs.includes(s)){let i=bs.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}if(s==="hack"){if(a.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(a.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=a.get("pipelineOperator").topicToken;if(!As.includes(i)){let r=As.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}{var e;if(i==="#"&&((e=a.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}}else if(s==="smart"&&((t=a.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}if(a.has("moduleAttributes")){if(a.has("deprecatedImportAssert")||a.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(a.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(a.has("importAssertions")&&a.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!a.has("deprecatedImportAssert")&&a.has("importAttributes")&&a.get("importAttributes").deprecatedAssertSyntax&&a.set("deprecatedImportAssert",{}),a.has("recordAndTuple")){let s=a.get("recordAndTuple").syntaxType;if(s!=null){let i=["hash","bar"];if(!i.includes(s))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+i.map(r=>`'${r}'`).join(", "))}}if(a.has("asyncDoExpressions")&&!a.has("doExpressions")){let s=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw s.missingPlugins="doExpressions",s}if(a.has("optionalChainingAssign")&&a.get("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'.")}var _s={estree:Ui,jsx:yr,flow:fr,typescript:Nr,v8intrinsic:Mr,placeholders:Dr},Fr=Object.keys(_s),ht=class extends lt{checkProto(t,e,s,i){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return s;let r=t.key;return(r.type==="Identifier"?r.name:r.value)==="__proto__"?e?(this.raise(p.RecordNoProto,r),!0):(s&&(i?i.doubleProtoLoc===null&&(i.doubleProtoLoc=r.loc.start):this.raise(p.DuplicateProto,r)),!0):s}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(p.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(140))throw this.raise(p.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&256&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let i=this.startNodeAt(e);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t){t.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc,i=this.isContextual(108);if(i&&this.prodParam.hasYield){this.next();let l=this.parseYield(s);return e&&(l=e.call(this,l,s)),l}let r;t?r=!1:(t=new te,r=!0);let{type:n}=this.state;(n===10||w(n))&&(this.state.potentialArrowAt=this.state.start);let o=this.parseMaybeConditional(t);if(e&&(o=e.call(this,o,s)),zi(this.state.type)){let l=this.startNodeAt(s),h=this.state.value;if(l.operator=h,this.match(29)){this.toAssignable(o,!0),l.left=o;let c=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=c&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=c&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else l.left=o;return this.next(),l.right=this.parseMaybeAssign(),this.checkLVal(o,this.finishNode(l,"AssignmentExpression")),l}else r&&this.checkExpressionErrors(t,!0);if(i){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?ue(l):ue(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.YieldNotInGeneratorFunction,s),this.parseYield(s)}return o}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(t);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,e,t)}parseConditional(t,e,s){if(this.eat(17)){let i=this.startNodeAt(e);return i.test=t,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let r=this.getPrivateNameSV(t);(s>=Ce(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(p.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t.loc.start)}let i=this.state.type;if(Ki(i)&&(this.prodParam.hasIn||!this.match(58))){let r=Ce(i);if(r>s){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let n=this.startNodeAt(e);n.left=t,n.operator=this.state.value;let o=i===41||i===42,l=i===40;if(l&&(r=Ce(42)),this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(p.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);n.right=this.parseExprOpRightExpr(i,r);let h=this.finishNode(n,o||l?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(l&&(c===41||c===42)||o&&c===40)throw this.raise(p.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(h,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(p.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,Yi(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return Di.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(p.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(p.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();let l=this.parseAwait(s);return e||this.checkExponentialAfterUnary(l),l}let r=this.match(34),n=this.startNode();if(Ji(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&l){let h=n.argument;h.type==="Identifier"?this.raise(p.StrictDelete,n):this.hasPropertyAsPrivateName(h)&&this.raise(p.DeletePrivateField,n)}if(!r)return e||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,r,t);if(i){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?ue(l):ue(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let n=t;return this.checkLVal(n.argument,this.finishNode(n,"UpdateExpression")),t}let i=this.state.startLoc,r=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return r;for(;Wi(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(i);n.operator=this.state.value,n.prefix=!1,n.argument=r,this.next(),this.checkLVal(r,r=this.finishNode(n,"UpdateExpression"))}return r}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(t);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,e)}parseSubscripts(t,e,s){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,i),i.maybeAsyncArrow=!1;while(!i.stop);return t}parseSubscript(t,e,s,i){let{type:r}=this.state;if(!s&&r===15)return this.parseBind(t,e,s,i);if(Ne(r))return this.parseTaggedTemplateExpression(t,e,i);let n=!1;if(r===18){if(s&&(this.raise(p.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(t,i);i.optionalChainMember=n=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,i,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(t,e,i,o,n):this.stopParseSubscript(t,i)}}stopParseSubscript(t,e){return e.stop=!0,t}parseMember(t,e,s,i,r){let n=this.startNodeAt(e);return n.object=t,n.computed=i,i?(n.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(p.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),s.optionalChainMember?(n.optional=r,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(t,e,s,i){let r=this.startNodeAt(e);return r.object=t,this.next(),r.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,i){let r=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:l,optionalChainMember:h}=s;l&&(this.expressionScope.enter(Er()),n=new te),h&&(o.optional=i),i?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type!=="Super",o,n);let c=this.finishCallExpression(o,h);return l&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),c)):(l&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=r,c}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let i=this.startNodeAt(e);return i.tag=t,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(p.OptionalChainingNoTemplate,e),this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(p.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,i){let r=[],n=!0,o=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(!1,i,e))}return this.state.inFSharpPipelineDirectBody=o,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&xe(t,e.innerComments),e.callee.trailingComments&&xe(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(e):this.match(10)?this.optionFlags&512?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(p.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let r=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(r)}case 0:return this.parseArrayLike(3,!0,!1,t);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let r=e.callee=this.parseNoCallExpr();if(r.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(p.UnsupportedBind,r)}case 139:return this.raise(p.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.parseTopicReference(r);this.unexpected();break}case 47:{let r=this.input.codePointAt(this.nextTokenStart());U(r)||r===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:{if(i===137)return this.parseDecimalLiteral(this.state.value);if(i===2||i===1)return this.parseArrayLike(this.state.type===2?4:3,!1,!0);if(i===6||i===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0)}if(w(i)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let r=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(w(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return r&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=D(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(e,s,t,i)}finishTopicReference(t,e,s,i){if(this.testTopicReferenceConfiguration(s,e,i))return s==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(t,"PipelinePrimaryTopicReference"));throw this.raise(p.PipeTopicUnconfiguredToken,e,{token:H(i)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:H(s)}]);case"smart":return s===27;default:throw this.raise(p.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(we(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(p.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!(this.optionFlags&16)?this.raise(p.SuperNotAllowed,t):!this.scope.allowSuper&&!(this.optionFlags&16)&&this.raise(p.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(p.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(D(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let i=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||i)&&this.raise(p.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(t){if(this.next(),this.isContextual(105)||this.isContextual(97)){let e=this.isContextual(105);return this.expectPlugin(e?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),t.phase=e?"source":"defer",this.parseImportCall(t)}else{let e=this.createIdentifierAt(this.startNodeAtNode(t),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(p.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,e,"meta")}}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Sr());let i=this.state.maybeInArrowParameters,r=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],l=new te,h=!0,c,u;for(;!this.match(11);){if(h)h=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){u=this.state.startLoc;break}if(this.match(21)){let x=this.state.startLoc;if(c=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),x)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=r;let d=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),u&&this.unexpected(u),c&&this.unexpected(c),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(n),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,f)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!(this.optionFlags&1024))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return this.scope.allowNewTarget||this.raise(p.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(p.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:i,value:r}=this.state,n=e+1,o=this.startNodeAt(D(s,1));r===null&&(t||this.raise(p.InvalidEscapeSequenceTemplate,D(this.state.firstInvalidTemplateEscapePos,1)));let l=this.match(24),h=l?-1:-2,c=i+h;o.value={raw:this.input.slice(n,c).replace(/\r\n?/g,` -`),cooked:r===null?null:r.slice(1,h)},o.tail=l,this.next();let u=this.finishNode(o,"TemplateElement");return this.resetEndLocation(u,D(this.state.lastTokEndLoc,h)),u}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),i=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(t));return e.expressions=r,e.quasis=i,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=!1,o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(l);break}let c;e?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(i),n=this.checkProto(c,s,n,i)),s&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(p.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),l.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=r;let h="ObjectExpression";return e?h="ObjectPattern":s&&(h="RecordExpression"),this.finishNode(l,h)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(p.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),i=!1,r=!1,n;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let l=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!l&&this.maybeAsyncOrAccessorProp(s)){let{key:h}=s,c=h.name;c==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(h),o=this.eat(55),this.parsePropertyName(s)),(c==="get"||c==="set")&&(r=!0,this.resetPreviousNodeTrailingComments(h),s.kind=c,this.match(55)&&(o=!0,this.raise(p.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,i,!1,r,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),i=this.getObjectOrClassMethodParams(t);i.length!==s&&this.raise(t.kind==="get"?p.BadGetterArity:p.BadSetterArity,t),t.kind==="set"&&((e=i[i.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(p.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,i,r){if(r){let n=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||e||this.match(10))return i&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,i){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(i),this.finishObjectProperty(t);if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key));else if(this.match(29)){let r=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=r):this.raise(p.InvalidCoverInitializedName,r),t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key))}else t.value=this.cloneIdentifier(t.key);return t.shorthand=!0,this.finishObjectProperty(t)}}finishObjectProperty(t){return this.finishNode(t,"ObjectProperty")}parseObjPropValue(t,e,s,i,r,n,o){let l=this.parseObjectMethod(t,s,i,r,n)||this.parseObjectProperty(t,e,r,o);return l||this.unexpected(),l}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,r;if(M(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{let n=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=n):this.raise(p.UnexpectedPrivateField,n),r=this.parsePrivateName();break}default:if(s===137){r=this.parseDecimalLiteral(i);break}this.unexpected()}t.key=r,s!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,i,r,n,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(530|(o?576:0)|(r?32:0)),this.prodParam.enter(we(s,t.generator)),this.parseFunctionParams(t,i);let l=this.parseFunctionBodyAndFinish(t,n,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(t,!s,i,n),this.state.inFSharpPipelineDirectBody=r,this.finishNode(n,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,i){this.scope.enter(518);let r=we(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(t,s);let n=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let i=e&&!this.match(5);if(this.expressionScope.enter(Os()),i)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let r=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(t.params);o&&l&&this.raise(p.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let h=!r&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!l,e,h),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,h)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!or(t))return;if(s&&rr(t)){this.raise(p.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?i?vs:Ns:Is)(t,this.inModule)){this.raise(p.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(p.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(p.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(p.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(p.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(p.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(p.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||Ne(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(t){let e=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(p.YieldInParameter,e);let s=!1,i=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!s)break;default:i=this.parseMaybeAssign()}return e.delegate=s,e.argument=i,this.finishNode(e,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(t.source);else if(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(t.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(p.ImportCallArity,t)}}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(p.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(p.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},qe={kind:1},Br={kind:2},Rr=/[\uD800-\uDFFF]/u,ze=/in(?:stanceof)?/y;function _r(a,t,e){for(let s=0;s0)for(let[r,n]of Array.from(this.scope.undefinedExports))this.raise(p.ModuleExportUndefined,n,{localName:r});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return e===140?i=this.finishNode(t,"Program"):i=this.finishNodeAt(t,"Program",D(this.state.startLoc,-1)),i}stmtToDirective(t){let e=this.castNodeTo(t,"Directive"),s=this.castNodeTo(t.expression,"DirectiveLiteral"),i=s.value,r=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),n=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",i),e.value=s,delete t.expression,e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){if(!this.isContextual(107))return!1;let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}isForUsing(){if(!this.isContextual(107))return!1;let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);if(this.isUnparsedContextual(t,"of")){let s=this.lookaheadCharCodeSince(t+2);if(s!==61&&s!==58&&s!==59)return!1}return this.chStartsBindingIdentifier(e,t)?(this.expectPlugin("explicitResourceManagement"),!0):!1}isAwaitUsing(){if(!this.isContextual(96))return!1;let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}chStartsBindingIdentifier(t,e){if(U(t)){if(ze.lastIndex=e,ze.test(this.input)){let s=this.codePointAtPos(ze.lastIndex);if(!Z(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,i=this.startNode(),r=!!(t&2),n=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?p.StrictFunction:this.options.annexB?p.SloppyFunctionAnnexB:p.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!r&&n);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(this.isAwaitUsing())return this.allowsUsing()?r?this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,i):this.raise(p.UnexpectedLexicalDeclaration,i):this.raise(p.UnexpectedUsingDeclaration,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),this.allowsUsing()?r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(p.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),u=this.codePointAtPos(c);if(u!==91&&(!r&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,c)&&u!==123))break}case 75:r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(i,c)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!(this.optionFlags&8)&&!o&&this.raise(p.UnexpectedImportExport,this.state.startLoc),this.next();let c;return s===83?c=this.parseImport(i):c=this.parseExport(i,e),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return r||this.raise(p.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!r&&n)}let l=this.state.value,h=this.parseExpression();return w(s)&&h.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,l,h,t):this.parseExpressionStatement(i,h,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(p.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){if(t){var i;(i=e.decorators)!=null&&i.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(p.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)}return e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(p.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(p.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let r=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(p.DecoratorArgumentsOutsideParentheses,r)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(e);i.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s,e)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(10)){let s=this.startNodeAt(e);return s.callee=t,s.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(qe);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let l=this.isAwaitUsing(),h=l||this.isForUsing(),c=s&&this.hasFollowingBindingAtom()||h;if(this.match(74)||this.match(75)||c){let u=this.startNode(),f;l?(f="await using",this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(u,!0,f);let d=this.finishNode(u,"VariableDeclaration"),x=this.match(58);return x&&h&&this.raise(p.ForInUsing,d),(x||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(t,d,e):(e!==null&&this.unexpected(e),this.parseFor(t,d))}}let i=this.isContextual(95),r=new te,n=this.parseExpression(!0,r),o=this.isContextual(102);if(o&&(s&&this.raise(p.ForOfLet,n),e===null&&i&&n.type==="Identifier"&&this.raise(p.ForOfAsync,n)),o||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(n,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:l}),this.parseForIn(t,n,e)}else this.checkExpressionErrors(r,!0);return e!==null&&this.unexpected(e),this.parseFor(t,n)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return this.prodParam.hasReturn||this.raise(p.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(Br),this.scope.enter(256);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let r=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),r?s.test=this.parseExpression():(i&&this.raise(p.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(p.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(p.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(qe),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(p.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,i){for(let n of this.state.labels)n.name===e&&this.raise(p.LabelRedeclaration,s,{labelName:e});let r=Hi(this.state.type)?1:this.match(71)?2:null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===t.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=r;else break}return this.state.labels.push({name:e,kind:r,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let i=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(i,t,!1,8,s),e&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,i,r){let n=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(n,e?o:void 0,s,i,r)}parseBlockOrModuleBlockBody(t,e,s,i,r){let n=this.state.strict,o=!1,l=!1;for(;!this.match(i);){let h=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(h)){let c=this.stmtToDirective(h);e.push(c),!o&&c.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}t.push(h)}r==null||r.call(this,o),n||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(p.ForInOfLoopInitializer,e,{type:i?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(p.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,i=!1){let r=t.declarations=[];for(t.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!i&&(n.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),r.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(p.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,i=!!(e&1),r=i&&!(e&4),n=!!(e&8);this.initFunction(t,n),this.match(55)&&(s&&this.raise(p.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),i&&(t.id=this.parseFunctionId(r));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(we(n,t.generator)),i||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||w(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Ar()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,i),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},i=[],r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(p.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();i.length&&(n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[]),this.parseClassMember(r,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(p.DecoratorConstructor,n)}}),this.state.strict=e,this.next(),i.length)throw this.raise(p.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=e;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(t,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=e;return i.computed=!1,i.key=s,i.static=!1,t.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,i)}parseClassMemberWithIsStatic(t,e,s,i){let r=e,n=e,o=e,l=e,h=e,c=r,u=r;if(e.static=i,this.parsePropertyNamePrefixOperator(e),this.eat(55)){c.kind="method";let S=this.match(139);if(this.parseClassElementName(c),this.parsePostMemberNameModifiers(c),S){this.pushClassPrivateMethod(t,n,!0,!1);return}this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsGenerator,r.key),this.pushClassMethod(t,r,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&w(this.state.type),d=this.parseClassElementName(e),x=f?d.name:null,A=this.isPrivateName(d),N=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(c.kind="method",A){this.pushClassPrivateMethod(t,n,!1,!1);return}let S=this.isNonstaticConstructor(r),I=!1;S&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(p.DuplicateConstructor,d),S&&this.hasPlugin("typescript")&&e.override&&this.raise(p.OverrideOnConstructor,d),s.hadConstructor=!0,I=s.hadSuperClass),this.pushClassMethod(t,r,!1,!1,S,I)}else if(this.isClassProperty())A?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o);else if(x==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let S=this.eat(55);u.optional&&this.unexpected(N),c.kind="method";let I=this.match(139);this.parseClassElementName(c),this.parsePostMemberNameModifiers(u),I?this.pushClassPrivateMethod(t,n,S,!0):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAsync,r.key),this.pushClassMethod(t,r,S,!0,!1,!1))}else if((x==="get"||x==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),c.kind=x;let S=this.match(139);this.parseClassElementName(r),S?this.pushClassPrivateMethod(t,n,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAccessor,r.key),this.pushClassMethod(t,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else if(x==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let S=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(t,h,S)}else this.isLineTerminator()?A?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===134)&&t.static&&s==="prototype"&&this.raise(p.StaticPrototype,this.state.startLoc),e===139){s==="constructor"&&this.raise(p.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return t.key=i,i}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(720);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=e.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(p.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key);let i=this.parseClassAccessorProperty(e);t.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(t,e,s,i,r,n){t.body.push(this.parseMethod(e,s,i,r,n,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,i){let r=this.parseMethod(e,s,i,!1,!1,"ClassPrivateMethod",!0);t.body.push(r);let n=r.kind==="get"?r.static?6:2:r.kind==="set"?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,n)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(592),this.expressionScope.enter(Os()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,i=8331){if(w(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,i);else if(s||!e)t.id=null;else throw this.raise(p.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),i=this.maybeParseExportDefaultSpecifier(t,s),r=!i||this.eat(12),n=r&&this.eatExportStar(t),o=n&&this.maybeParseExportNamespaceSpecifier(t),l=r&&(!o||this.eat(12)),h=i||n;if(n&&!o){if(i&&this.unexpected(),e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.sawUnambiguousESM=!0,this.finishNode(t,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(t);i&&r&&!n&&!c&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let u;if(h||c){if(u=!1,e)throw this.raise(p.UnsupportedDecoratorExport,t);this.parseExportFrom(t,h)}else u=this.maybeParseExportDeclaration(t);if(h||c||u){var f;let d=t;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.sawUnambiguousESM=!0,this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=t,x=this.parseExportDefaultExpression();if(d.declaration=x,x.type==="ClassDeclaration")this.maybeTakeDecorators(e,x,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.checkExport(d,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,t.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=null,!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.hasPlugin("explicitResourceManagement")&&(this.isUsing()||this.isAwaitUsing()))throw this.raise(p.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(w(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let i=this.nextTokenStart(),r=this.input.charCodeAt(i);if(r===123||this.chStartsBindingIdentifier(r,i)&&!this.input.startsWith("from",i))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||w(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(e+4));return i===34||i===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;if(t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators")))return this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),!0;if(this.hasPlugin("explicitResourceManagement")){if(this.isUsing())return this.raise(p.UsingDeclarationExport,this.state.startLoc),!0;if(this.isAwaitUsing())return this.raise(p.UsingDeclarationExport,this.state.startLoc),!0}return t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,i){if(e){var r;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(p.ExportDefaultFromAsIdentifier,o)}}else if((r=t.specifiers)!=null&&r.length)for(let o of t.specifiers){let{exported:l}=o,h=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,h),!i&&o.local){let{local:c}=o;c.type!=="Identifier"?this.raise(p.ExportBindingIsString,o,{localName:c.value,exportName:h}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(t.declaration){let o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:l}=o;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(t,l.name)}else if(o.type==="VariableDeclaration")for(let l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(p.DuplicateDefaultExport,t):this.raise(p.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),r=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(n,r,t,i))}return e}parseExportSpecifier(t,e,s,i){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=this.cloneStringLiteral(t.local):t.exported||(t.exported=this.cloneIdentifier(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=Rr.exec(t.value);return e&&this.raise(p.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(p.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(p.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var i;s!=="ImportDefaultSpecifier"&&this.raise(p.ImportReflectionNotBinding,e[0].loc.start),((i=t.assertions)==null?void 0:i.length)>0&&this.raise(p.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(i=>{let r;if(i.type==="ExportSpecifier"?r=i.local:i.type==="ImportSpecifier"&&(r=i.imported),r!==void 0)return r.type==="Identifier"?r.name!=="default":r.value!=="default"});s!==void 0&&this.raise(p.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,i){e||(s==="module"?(this.expectPlugin("importReflection",i),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",i),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",i),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.startNode(),i=this.parseIdentifierName(!0),{type:r}=this.state;return(M(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.applyImportPhase(t,e,i,s.loc.start),null):(this.applyImportPhase(t,e,null),this.createIdentifier(s,i))}isPrecedingIdImportPhase(t){let{type:e}=this.state;return w(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),r=i&&this.maybeParseStarImportSpecifier(t);return i&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(e.has(i)&&this.raise(p.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),e.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(p.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(p.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(e=this.parseModuleAttributes(),this.addExtra(t,"deprecatedWithLegacySyntax",!0)):e=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(p.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(M(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(p.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(134),r=this.isContextual(130);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,i,t.importKind==="type"||t.importKind==="typeof",r,void 0);t.specifiers.push(n)}}parseImportSpecifier(t,e,s,i,r){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:n}=t;if(e)throw this.raise(p.ImportBindingIsString,t,{importName:n.value});this.checkReservedWord(n.name,t.loc.start,!0,!0),t.local||(t.local=this.cloneIdentifier(n))}return this.finishImportSpecifier(t,"ImportSpecifier",r)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},ve=class extends ct{constructor(t,e,s){t=Ri(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename,this.startIndex=t.startIndex;let i=0;t.allowAwaitOutsideFunction&&(i|=1),t.allowReturnOutsideFunction&&(i|=2),t.allowImportExportEverywhere&&(i|=8),t.allowSuperOutsideMethod&&(i|=16),t.allowUndeclaredExports&&(i|=64),t.allowNewTargetOutsideFunction&&(i|=4),t.allowYieldOutsideFunction&&(i|=32),t.ranges&&(i|=128),t.tokens&&(i|=256),t.createImportExpressions&&(i|=512),t.createParenthesizedExpressions&&(i|=1024),t.errorRecovery&&(i|=2048),t.attachComment&&(i|=4096),t.annexB&&(i|=8192),this.optionFlags=i}getScopeHandler(){return ye}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}};function Ur(a,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=fe(t,a),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",fe(t,a).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return t.sourceType="script",fe(t,a).parse()}catch{}throw s}}else return fe(t,a).parse()}function jr(a,t){let e=fe(t,a);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function $r(a){let t={};for(let e of Object.keys(a))t[e]=R(a[e]);return t}var Vr=$r($i);function fe(a,t){let e=ve,s=new Map;if(a!=null&&a.plugins){for(let i of a.plugins){let r,n;typeof i=="string"?r=i:[r,n]=i,s.has(r)||s.set(r,n||{})}Or(s),e=qr(s)}return new e(a,t,s)}var Ss=new Map;function qr(a){let t=[];for(let i of Fr)a.has(i)&&t.push(i);let e=t.join("|"),s=Ss.get(e);if(!s){s=ve;for(let i of t)s=_s[i](s);Ss.set(e,s)}return s}Pe.parse=Ur;Pe.parseExpression=jr;Pe.tokTypes=Vr});var $a={};Ue($a,{parsers:()=>ja});var vt={};Ue(vt,{__babel_estree:()=>Ma,__js_expression:()=>La,__ts_expression:()=>Da,__vue_event_binding:()=>ka,__vue_expression:()=>La,__vue_ts_event_binding:()=>va,__vue_ts_expression:()=>Da,babel:()=>ka,"babel-flow":()=>Pi,"babel-ts":()=>va});var Be=ls(Tt(),1);function Le(a){return(t,e,s)=>{let i=!!(s!=null&&s.backwards);if(e===!1)return!1;let{length:r}=t,n=e;for(;n>=0&&n{if(!(a&&t==null)){if(t.findLast)return t.findLast(e);for(let s=t.length-1;s>=0;s--){let i=t[s];if(e(i,s,t))return i}}},Ks=Gr;var Yr=(a,t,e)=>{if(!(a&&t==null))return Array.isArray(t)||typeof t=="string"?t[e<0?t.length+e:e]:t.at(e)},Ws=Yr;var Qr=new Proxy(()=>{},{get:()=>Qr});function v(a){var s,i,r;let t=((s=a.range)==null?void 0:s[0])??a.start,e=(r=((i=a.declaration)==null?void 0:i.decorators)??a.decorators)==null?void 0:r[0];return e?Math.min(v(e),t):t}function k(a){var e;return((e=a.range)==null?void 0:e[1])??a.end}function Zr(a){let t=new Set(a);return e=>t.has(e==null?void 0:e.type)}var ae=Zr;function ea(a,t,e){let s=a.originalText.slice(t,e);for(let i of a[Symbol.for("comments")]){let r=v(i);if(r>e)break;let n=k(i);if(n1&&t.every(e=>e.trimStart()[0]==="*")}var St=new WeakMap;function aa(a){return St.has(a)||St.set(a,ra(a)),St.get(a)}var Et=aa;function na(a){if(a.length<2)return;let t;for(let e=a.length-1;e>=0;e--){let s=a[e];if(t&&k(s)===v(t)&&Et(s)&&Et(t)&&(a.splice(e+1,1),s.value+="*//*"+t.value,s.range=[v(s),k(t)]),!bt(s)&&!G(s))throw new TypeError(`Unknown comment type: "${s.type}".`);t=s}}var Gs=na;var ge=null;function Te(a){if(ge!==null&&typeof ge.property){let t=ge;return ge=Te.prototype=null,t}return ge=Te.prototype=a??Object.create(null),new Te}var oa=10;for(let a=0;a<=oa;a++)Te();function Ct(a){return Te(a)}function la(a,t="type"){Ct(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var Ys=la;var Qs={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]};var ha=Ys(Qs),Zs=ha;function wt(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s{switch(l.type){case"ParenthesizedExpression":{let{expression:h}=l,c=v(l);if(h.type==="TypeCastExpression")return h.range=[c,k(l)],h;let u=!1;if(!r){if(!n){n=[];for(let d of i)Xs(d)&&n.push(k(d))}let f=Ks(!1,n,d=>d<=c);u=f&&s.slice(f,c).trim().length===0}if(!u)return h.extra={...h.extra,parenthesized:!0},h;break}case"LogicalExpression":if(si(l))return It(l);break;case"TemplateLiteral":if(l.expressions.length!==l.quasis.length-1)throw new Error("Malformed template literal.");break;case"TemplateElement":if(e==="flow"||e==="hermes"||e==="espree"||e==="typescript"||r){let h=v(l)+1,c=k(l)-(l.tail?1:2);l.range=[h,c]}break;case"VariableDeclaration":{let h=Ws(!1,l.declarations,-1);h!=null&&h.init&&s[k(h)]!==";"&&(l.range=[v(l),k(h)]);break}case"TSParenthesizedType":return l.typeAnnotation;case"TSTypeParameter":ti(l);break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(l.types.length===1)return l.types[0];break;case"TSMappedType":if(!l.constraint&&!l.key){let{name:h,constraint:c}=ti(l.typeParameter);l.constraint=c,l.key=h,delete l.typeParameter}break;case"TSEnumDeclaration":if(!l.body){let h=k(l.id),{members:c}=l,u=Js({originalText:s,[Symbol.for("comments")]:i},h,c[0]?v(c[0]):k(l)),f=h+u.indexOf("{");l.body={type:"TSEnumBody",members:c,range:[f,k(l)]},delete l.members}break;case"ImportExpression":e==="hermes"&&l.attributes&&!l.options&&(l.options=l.attributes);break}});let o=a.type==="File"?a.program:a;return o.interpreter&&(i.unshift(o.interpreter),delete o.interpreter),r&&a.hashbang&&(i.unshift(a.hashbang),delete a.hashbang),a.type==="Program"&&(a.range=[0,s.length]),a}function ti(a){if(a.type==="TSTypeParameter"&&typeof a.name=="string"){let t=v(a);a.name={type:"Identifier",name:a.name,range:[t,t+a.name.length]}}return a}function si(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function It(a){return si(a)?It({type:"LogicalExpression",operator:a.operator,left:It({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[v(a.left),k(a.right.left)]}),right:a.right.right,range:[v(a),k(a)]}):a}var ii=ca;function pa(a,t){let e=new SyntaxError(a+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(e,t)}var Me=pa;var ri="Unexpected parseExpression() input: ";function ua(a){let{message:t,loc:e,reasonCode:s}=a;if(!e)return a;let{line:i,column:r}=e,n=a;(s==="MissingPlugin"||s==="MissingOneOfPlugins")&&(t="Unexpected token.",n=void 0);let o=` (${i}:${r})`;return t.endsWith(o)&&(t=t.slice(0,-o.length)),t.startsWith(ri)&&(t=t.slice(ri.length)),Me(t,{loc:{start:{line:i,column:r+1}},cause:n})}var Oe=ua;var fa=(a,t,e,s)=>{if(!(a&&t==null))return t.replaceAll?t.replaceAll(e,s):e.global?t.replace(e,s):t.split(e).join(s)},ne=fa;var da=/\*\/$/,ma=/^\/\*\*?/,ya=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,xa=/(^|\s+)\/\/([^\n\r]*)/g,ai=/^(\r?\n)+/,Pa=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ni=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ga=/(\r?\n|^) *\* ?/g,Ta=[];function oi(a){let t=a.match(ya);return t?t[0].trimStart():""}function li(a){let t=` -`;a=ne(!1,a.replace(ma,"").replace(da,""),ga,"$1");let e="";for(;e!==a;)e=a,a=ne(!1,a,Pa,`${t}$1 $2${t}`);a=a.replace(ai,"").trimEnd();let s=Object.create(null),i=ne(!1,a,ni,"").replace(ai,"").trimEnd(),r;for(;r=ni.exec(a);){let n=ne(!1,r[2],xa,"");if(typeof s[r[1]]=="string"||Array.isArray(s[r[1]])){let o=s[r[1]];s[r[1]]=[...Ta,...Array.isArray(o)?o:[o],n]}else s[r[1]]=n}return{comments:i,pragmas:s}}var hi=["noformat","noprettier"],ci=["format","prettier"];function pi(a){let t=De(a);t&&(a=a.slice(t.length+1));let e=oi(a),{pragmas:s,comments:i}=li(e);return{shebang:t,text:a,pragmas:s,comments:i}}function ui(a){let{pragmas:t}=pi(a);return ci.some(e=>Object.prototype.hasOwnProperty.call(t,e))}function fi(a){let{pragmas:t}=pi(a);return hi.some(e=>Object.prototype.hasOwnProperty.call(t,e))}function ba(a){return a=typeof a=="function"?{parse:a}:a,{astFormat:"estree",hasPragma:ui,hasIgnorePragma:fi,locStart:v,locEnd:k,...a}}var Y=ba;var Nt="module",kt="script";function di(a){if(typeof a=="string"){if(a=a.toLowerCase(),/\.(?:mjs|mts)$/iu.test(a))return Nt;if(/\.(?:cjs|cts)$/iu.test(a))return kt}}function Aa(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var Fe=Aa;var oe=a=>Y(Ia(a)),Sa={sourceType:Nt,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,attachComment:!1,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","explicitResourceManagement","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}]],tokens:!1,ranges:!1},mi="v8intrinsic",yi=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],j=(a,t=Sa)=>({...t,plugins:[...t.plugins,...a]}),Ea=/@(?:no)?flow\b/u;function Ca(a,t){if(t!=null&&t.endsWith(".js.flow"))return!0;let e=De(a);e&&(a=a.slice(e.length));let s=zs(a,0);return s!==!1&&(a=a.slice(0,s)),Ea.test(a)}function wa(a,t,e){let s=a(t,e),i=s.errors.find(r=>!Na.has(r.reasonCode));if(i)throw i;return s}function Ia({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{let{filepath:i}=s;if(typeof i!="string"&&(i=void 0),(s.parser==="babel"||s.parser==="__babel_estree")&&Ca(e,i))return s.parser="babel-flow",Pi.parse(e,s);let r=t,n=s.__babelSourceType??di(i);n===kt&&(r=r.map(c=>({...c,sourceType:n})));let o=/%[A-Z]/u.test(e);e.includes("|>")?r=(o?[...yi,mi]:yi).flatMap(u=>r.map(f=>j([u],f))):o&&(r=r.map(c=>j([mi],c)));let l=a?Be.parseExpression:Be.parse,h;try{h=Hs(r.map(c=>()=>wa(l,e,c)))}catch({errors:[c]}){throw Oe(c)}return a&&(h=Fe(h,{text:e,rootMarker:s.rootMarker})),ii(h,{text:e})}}var Na=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert","DeclarationMissingInitializer"]),xi=[j(["jsx"])],ka=oe({optionsCombinations:xi}),va=oe({optionsCombinations:[j(["jsx","typescript"]),j(["typescript"])]}),La=oe({isExpression:!0,optionsCombinations:[j(["jsx"])]}),Da=oe({isExpression:!0,optionsCombinations:[j(["typescript"])]}),Pi=oe({optionsCombinations:[j(["jsx",["flow",{all:!0}],"flowComments"])]}),Ma=oe({optionsCombinations:xi.map(a=>j(["estree"],a))});var Dt={};Ue(Dt,{json:()=>Ba,"json-stringify":()=>Ua,json5:()=>Ra,jsonc:()=>_a});var Re=ls(Tt(),1);function Oa(a){return Array.isArray(a)&&a.length>0}var Lt=Oa;var gi={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function Fa(a){let t=(0,Re.parse)(a,gi),{program:e}=t;if(e.body.length===0&&e.directives.length===0&&!e.interpreter)return t}function _e(a,t={}){let{allowComments:e=!0,allowEmpty:s=!1}=t,i;try{i=(0,Re.parseExpression)(a,gi)}catch(r){if(s&&r.code==="BABEL_PARSER_SYNTAX_ERROR"&&r.reasonCode==="ParseExpressionEmptyInput")try{i=Fa(a)}catch{}if(!i)throw Oe(r)}if(!e&&Lt(i.comments))throw K(i.comments[0],"Comment");return i=Fe(i,{type:"JsonRoot",text:a}),i.node.type==="File"?delete i.node:le(i.node),i}function K(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return Me(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function le(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&le(t);return;case"ObjectExpression":for(let t of a.properties)le(t);return;case"ObjectProperty":if(a.computed)throw K(a.key,"Computed key");if(a.shorthand)throw K(a.key,"Shorthand property");a.key.type!=="Identifier"&&le(a.key),le(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw K(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw K(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw K(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(Lt(a.expressions))throw K(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)le(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw K(a,`'${a.type}'`)}}var Ba=Y({parse:a=>_e(a),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),Ra=Y(a=>_e(a)),_a=Y(a=>_e(a,{allowEmpty:!0})),Ua=Y({parse:a=>_e(a,{allowComments:!1}),astFormat:"estree-json"});var ja={...vt,...Dt};return wi($a);}); - -/***/ }), - -/***/ "./node_modules/prettier/plugins/estree.mjs": -/*!**************************************************!*\ - !*** ./node_modules/prettier/plugins/estree.mjs ***! - \**************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ Nx), -/* harmony export */ languages: () => (/* binding */ Tm), -/* harmony export */ options: () => (/* binding */ Ha), -/* harmony export */ printers: () => (/* binding */ dm) -/* harmony export */ }); -var za=Object.defineProperty;var Us=e=>{throw TypeError(e)};var xr=(e,t)=>{for(var r in t)za(e,r,{get:t[r],enumerable:!0})};var Xs=(e,t,r)=>t.has(e)||Us("Cannot "+r);var mt=(e,t,r)=>(Xs(e,t,"read from private field"),r?r.call(e):t.get(e)),Ys=(e,t,r)=>t.has(e)?Us("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Hs=(e,t,r,n)=>(Xs(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Rs={};xr(Rs,{languages:()=>Tm,options:()=>Ha,printers:()=>dm});var Vs=[{name:"JavaScript",type:"programming",extensions:[".js","._js",".bones",".cjs",".es",".es6",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".start.frag",".end.frag",".wxs"],tmScope:"source.js",aceMode:"javascript",aliases:["js","node"],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],filenames:["Jakefile","start.frag","end.frag"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"],linguistLanguageId:183},{name:"Flow",type:"programming",extensions:[".js.flow"],tmScope:"source.js",aceMode:"javascript",aliases:[],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],filenames:[],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"],linguistLanguageId:183},{name:"JSX",type:"programming",extensions:[".jsx"],tmScope:"source.js.jsx",aceMode:"javascript",aliases:void 0,codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",interpreters:void 0,filenames:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript",linguistLanguageId:183},{name:"TypeScript",type:"programming",extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",aliases:["ts"],codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",interpreters:["bun","deno","ts-node","tsx"],parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"],linguistLanguageId:378},{name:"TSX",type:"programming",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",group:"TypeScript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"],linguistLanguageId:94901924}];var vs={};xr(vs,{canAttachComment:()=>kp,embed:()=>oi,experimentalFeatures:()=>fm,getCommentChildNodes:()=>Ip,getVisitorKeys:()=>br,handleComments:()=>ts,insertPragma:()=>di,isBlockComment:()=>te,isGap:()=>Lp,massageAstNode:()=>Bu,print:()=>Ga,printComment:()=>ju,willPrintOwnComments:()=>rs});var Za=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},X=Za;var eo=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},v=eo;function to(e){return e!==null&&typeof e=="object"}var $s=to;function*ro(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,s=u=>$s(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let a of i)s(a)&&(yield a);else s(i)&&(yield i)}}function*no(e,t){let r=[e];for(let n=0;n/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function zs(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Zs(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var eu=e=>!(zs(e)||Zs(e));var so=/[^\x20-\x7F]/u;function uo(e){if(!e)return 0;if(!so.test(e))return e.length;e=e.replace(Qs()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=eu(n)?1:2)}return t}var st=uo;function hr(e){return(t,r,n)=>{let s=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:u}=t,i=r;for(;i>=0&&i0}var O=lo;var nu=new Proxy(()=>{},{get:()=>nu}),jt=nu;var gr="'",su='"';function mo(e,t){let r=t===!0||t===gr?gr:su,n=r===gr?su:gr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var Sr=mo;function yo(e,t,r){let n=t==='"'?"'":'"',u=X(!1,e,/\\(.)|(["'])/gsu,(i,a,o)=>a===n?a:o===t?"\\"+o:o||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a)?a:"\\"+a));return t+u+t}var uu=yo;function fo(e,t){jt.ok(/^(?["']).*\k$/su.test(e));let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":Sr(r,t.singleQuote);return e.charAt(0)===n?e:uu(r,n,!1)}var ut=fo;var iu=e=>Number.isInteger(e)&&e>=0;function j(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(j(r),t):t}function P(e){var r;return((r=e.range)==null?void 0:r[1])??e.end}function Bt(e,t){let r=j(e);return iu(r)&&r===j(t)}function Do(e,t){let r=P(e);return iu(r)&&r===P(t)}function au(e,t){return Bt(e,t)&&Do(e,t)}var rr=null;function nr(e){if(rr!==null&&typeof rr.property){let t=rr;return rr=nr.prototype=null,t}return rr=nr.prototype=e??Object.create(null),new nr}var Eo=10;for(let e=0;e<=Eo;e++)nr();function On(e){return nr(e)}function Fo(e,t="type"){On(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var Br=Fo;var ou={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]};var Co=Br(ou),br=Co;function Ao(e){let t=new Set(e);return r=>t.has(r==null?void 0:r.type)}var R=Ao;function To(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}var ae=To;var xo=R(["Block","CommentBlock","MultiLine"]),te=xo;var ho=R(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),Pr=ho;var go=R(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),At=go;function So(e,t){let r=t.split(".");for(let n=r.length-1;n>=0;n--){let s=r[n];if(n===0)return e.type==="Identifier"&&e.name===s;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==s)return!1;e=e.object}}function Bo(e,t){return t.some(r=>So(e,r))}var pu=Bo;function bo({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var kr=bo;function ur(e,t){return t(e)||Ks(e,{getVisitorKeys:br,predicate:t})}function Jt(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||w(e)||G(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||xe(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function mu(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Lr(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var yu=R(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),U=R(["ArrayExpression"]),ue=R(["ObjectExpression"]);function fu(e){return e.type==="LogicalExpression"&&e.operator==="??"}function ye(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function Du(e){return e.type==="BooleanLiteral"||e.type==="Literal"&&typeof e.value=="boolean"}function Rn(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&ye(e.argument)}function K(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function Jn(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var wr=R(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),Po=R(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),Re=R(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),Rt=R(["FunctionExpression","ArrowFunctionExpression"]);function ko(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function _n(e){return w(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var Y=R(["JSXElement","JSXFragment"]);function bt(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Or(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function Eu(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!Bt(e,e.typeAnnotation)}var Fe=R(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function dt(e){return G(e)||e.type==="BindExpression"&&!!e.object}var Io=R(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function Nt(e){return kr(e)||Pr(e)||Io(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters&&!e.typeArguments}function Lo(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}var wo=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function Oo(e){return pu(e,wo)}function Pt(e,t){if((e==null?void 0:e.type)!=="CallExpression"||e.optional)return!1;let r=le(e);if(r.length===1){if(_n(e)&&Pt(t))return Rt(r[0]);if(Lo(e.callee))return _n(r[0])}else if((r.length===2||r.length===3)&&(r[0].type==="TemplateLiteral"||K(r[0]))&&Oo(e.callee))return r[2]&&!ye(r[2])?!1:(r.length===2?Rt(r[1]):ko(r[1])&&Q(r[1]).length<=1)||_n(r[1]);return!1}var Fu=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),w=Fu(R(["CallExpression","OptionalCallExpression"])),G=Fu(R(["MemberExpression","OptionalMemberExpression"]));function Nn(e,t=5){return Cu(e,t)<=t}function Cu(e,t){let r=0;for(let n in e){let s=e[n];if(s&&typeof s=="object"&&typeof s.type=="string"&&(r++,r+=Cu(s,t-r)),r>t)return r}return r}var _o=.25;function ir(e,t){let{printWidth:r}=t;if(d(e))return!1;let n=r*_o;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=n||Rn(e)&&!d(e.argument))return!0;let s=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return s?s.length<=n:K(e)?ut(ae(e),t).length<=n:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=n&&!e.quasis[0].value.raw.includes(` -`):e.type==="UnaryExpression"?ir(e.argument,{printWidth:r}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=n-2:wr(e)}function de(e,t){return Y(t)?kt(t):d(t,h.Leading,r=>ee(e,P(r)))}function cu(e){return e.quasis.some(t=>t.value.raw.includes(` -`))}function _r(e,t){return(e.type==="TemplateLiteral"&&cu(e)||e.type==="TaggedTemplateExpression"&&cu(e.quasi))&&!ee(t,j(e),{backwards:!0})}function Mr(e){if(!d(e))return!1;let t=v(!1,Ve(e,h.Dangling),-1);return t&&!te(t)}function Au(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(Rt(r)){if(t+=1,t>1)return!0}else if(w(r)){for(let n of le(r))if(Rt(n))return!0}return!1}function vr(e){let{node:t,parent:r,key:n}=e;return n==="callee"&&w(t)&&w(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var Mo=new Set(["!","-","+","~"]);function we(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return we(e.expression,t);let r=n=>we(n,t-1);if(Jn(e))return st(e.pattern??e.regex.pattern)<=5;if(wr(e)||Po(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(n=>!n.value.raw.includes(` -`))&&e.expressions.every(r);if(ue(e))return e.properties.every(n=>!n.computed&&(n.shorthand||n.value&&r(n.value)));if(U(e))return e.elements.every(n=>n===null||r(n));if(yt(e)){if(e.type==="ImportExpression"||we(e.callee,t)){let n=le(e);return n.length<=t&&n.every(r)}return!1}return G(e)?we(e.object,t)&&we(e.property,t):e.type==="UnaryExpression"&&Mo.has(e.operator)||e.type==="UpdateExpression"?we(e.argument,t):!1}function du(e){return e}function ce(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function pe(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return pe(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return pe(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:pe(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:pe(e.callee,t);case"ConditionalExpression":return pe(e.test,t);case"UpdateExpression":return!e.prefix&&pe(e.argument,t);case"BindExpression":return e.object&&pe(e.object,t);case"SequenceExpression":return pe(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return pe(e.expression,t);default:return t(e)}}var lu={"==":!0,"!=":!0,"===":!0,"!==":!0},Ir={"*":!0,"/":!0,"%":!0},jn={">>":!0,">>>":!0,"<<":!0};function ar(e,t){return!(sr(t)!==sr(e)||e==="**"||lu[e]&&lu[t]||t==="%"&&Ir[e]||e==="%"&&Ir[t]||t!==e&&Ir[t]&&Ir[e]||jn[e]&&jn[t])}var vo=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function sr(e){return vo.get(e)}function Tu(e){return!!jn[e]||e==="|"||e==="^"||e==="&"}function xu(e){var r;if(e.rest)return!0;let t=Q(e);return((r=v(!1,t,-1))==null?void 0:r.type)==="RestElement"}var Mn=new WeakMap;function Q(e){if(Mn.has(e))return Mn.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),Mn.set(e,t),t}function hu(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);r.this&&e.call(s,"this"),Array.isArray(r.parameters)?e.each(s,"parameters"):Array.isArray(r.params)&&e.each(s,"params"),r.rest&&e.call(s,"rest")}var vn=new WeakMap;function le(e){if(vn.has(e))return vn.get(e);if(e.type==="ChainExpression")return le(e.expression);let t=e.arguments;return(e.type==="ImportExpression"||e.type==="TSImportType")&&(t=[e.type==="ImportExpression"?e.source:e.argument],e.options&&t.push(e.options)),vn.set(e,t),t}function Gt(e,t){let{node:r}=e;if(r.type==="ChainExpression")return e.call(()=>Gt(e,t),"expression");r.type==="ImportExpression"||r.type==="TSImportType"?(e.call(n=>t(n,0),r.type==="ImportExpression"?"source":"argument"),r.options&&e.call(n=>t(n,1),"options")):e.each(t,"arguments")}function Gn(e,t){let r=[];if(e.type==="ChainExpression"&&(e=e.expression,r.push("expression")),e.type==="ImportExpression"||e.type==="TSImportType"){if(t===0||t===(e.options?-2:-1))return[...r,e.type==="ImportExpression"?"source":"argument"];if(e.options&&(t===1||t===-1))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function or(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function kt(e){return(e==null?void 0:e.prettierIgnore)||d(e,h.PrettierIgnore)}var h={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},gu=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,s)=>!(e&h.Leading&&!r.leading||e&h.Trailing&&!r.trailing||e&h.Dangling&&(r.leading||r.trailing)||e&h.Block&&!te(r)||e&h.Line&&!At(r)||e&h.First&&n!==0||e&h.Last&&n!==s.length-1||e&h.PrettierIgnore&&!or(r)||t&&!t(r))};function d(e,t,r){if(!O(e==null?void 0:e.comments))return!1;let n=gu(t,r);return n?e.comments.some(n):!0}function Ve(e,t,r){if(!Array.isArray(e==null?void 0:e.comments))return[];let n=gu(t,r);return n?e.comments.filter(n):e.comments}var me=(e,{originalText:t})=>vt(t,P(e));function yt(e){return w(e)||e.type==="NewExpression"||e.type==="ImportExpression"}function Te(e){return e&&(e.type==="ObjectProperty"||e.type==="Property"&&!bt(e))}var xe=R(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),Oe=R(["TSUnionType","UnionTypeAnnotation"]),qt=R(["TSIntersectionType","IntersectionTypeAnnotation"]),Je=R(["TSConditionalType","ConditionalTypeAnnotation"]);var jo=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),Wt=e=>{for(let t of e.quasis)delete t.value};function Su(e,t){var n;if(e.type==="Program"&&delete t.sourceType,(e.type==="BigIntLiteral"||e.type==="BigIntLiteralTypeAnnotation")&&e.value&&(t.value=e.value.toLowerCase()),(e.type==="BigIntLiteral"||e.type==="Literal")&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),e.type==="EmptyStatement"||e.type==="JSXText"||e.type==="JSXExpressionContainer"&&(e.expression.type==="Literal"||e.expression.type==="StringLiteral")&&e.expression.value===" ")return null;if((e.type==="Property"||e.type==="ObjectProperty"||e.type==="MethodDefinition"||e.type==="ClassProperty"||e.type==="ClassMethod"||e.type==="PropertyDefinition"||e.type==="TSDeclareMethod"||e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty"||e.type==="ImportAttribute")&&e.key&&!e.computed){let{key:s}=e;K(s)||ye(s)?t.key=String(s.value):s.type==="Identifier"&&(t.key=s.name)}if(e.type==="JSXElement"&&e.openingElement.name.name==="style"&&e.openingElement.attributes.some(s=>s.type==="JSXAttribute"&&s.name.name==="jsx"))for(let{type:s,expression:u}of t.children)s==="JSXExpressionContainer"&&u.type==="TemplateLiteral"&&Wt(u);e.type==="JSXAttribute"&&e.name.name==="css"&&e.value.type==="JSXExpressionContainer"&&e.value.expression.type==="TemplateLiteral"&&Wt(t.value.expression),e.type==="JSXAttribute"&&((n=e.value)==null?void 0:n.type)==="Literal"&&/["']|"|'/u.test(e.value.value)&&(t.value.value=X(!1,e.value.value,/["']|"|'/gu,'"'));let r=e.expression||e.callee;if(e.type==="Decorator"&&r.type==="CallExpression"&&r.callee.name==="Component"&&r.arguments.length===1){let s=e.expression.arguments[0].properties;for(let[u,i]of t.expression.arguments[0].properties.entries())switch(s[u].key.name){case"styles":U(i.value)&&Wt(i.value.elements[0]);break;case"template":i.value.type==="TemplateLiteral"&&Wt(i.value);break}}e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"||e.tag.name==="css"||e.tag.name==="md"||e.tag.name==="markdown"||e.tag.name==="html")||e.tag.type==="CallExpression")&&Wt(t.quasi),e.type==="TemplateLiteral"&&Wt(t),e.type==="ChainExpression"&&e.expression.type==="TSNonNullExpression"&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression")}Su.ignoredProperties=jo;var Bu=Su;var Ne="string",ge="array",it="cursor",$e="indent",Ke="align",Qe="trim",fe="group",_e="fill",he="if-break",ze="indent-if-break",Ze="line-suffix",Ge="line-suffix-boundary",oe="line",Se="label",Me="break-parent",jr=new Set([it,$e,Ke,Qe,fe,_e,he,ze,Ze,Ge,oe,Se,Me]);function Ro(e){if(typeof e=="string")return Ne;if(Array.isArray(e))return ge;if(!e)return;let{type:t}=e;if(jr.has(t))return t}var Be=Ro;var Jo=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function No(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', -Expected it to be 'string' or 'object'.`;if(Be(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Jo([...jr].map(s=>`'${s}'`));return`Unexpected doc.type '${e.type}'. -Expected it to be ${n}.`}var qn=class extends Error{name="InvalidDocError";constructor(t){super(No(t)),this.doc=t}},Tt=qn;var bu={};function Go(e,t,r,n){let s=[e];for(;s.length>0;){let u=s.pop();if(u===bu){r(s.pop());continue}r&&s.push(u,bu);let i=Be(u);if(!i)throw new Tt(u);if((t==null?void 0:t(u))!==!1)switch(i){case ge:case _e:{let a=i===ge?u:u.parts;for(let o=a.length,p=o-1;p>=0;--p)s.push(a[p]);break}case he:s.push(u.flatContents,u.breakContents);break;case fe:if(n&&u.expandedStates)for(let a=u.expandedStates.length,o=a-1;o>=0;--o)s.push(u.expandedStates[o]);else s.push(u.contents);break;case Ke:case $e:case ze:case Se:case Ze:s.push(u.contents);break;case Ne:case it:case Qe:case Ge:case oe:case Me:break;default:throw new Tt(u)}}}var pr=Go;function ft(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=s(u);return r.set(u,i),i}function s(u){switch(Be(u)){case ge:return t(u.map(n));case _e:return t({...u,parts:u.parts.map(n)});case he:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case fe:{let{expandedStates:i,contents:a}=u;return i?(i=i.map(n),a=i[0]):a=n(a),t({...u,contents:a,expandedStates:i})}case Ke:case $e:case ze:case Se:case Ze:return t({...u,contents:n(u.contents)});case Ne:case it:case Qe:case Ge:case oe:case Me:return t(u);default:throw new Tt(u)}}}function ku(e,t,r){let n=r,s=!1;function u(i){if(s)return!1;let a=t(i);a!==void 0&&(s=!0,n=a)}return pr(e,u),n}function qo(e){if(e.type===fe&&e.break||e.type===oe&&e.hard||e.type===Me)return!0}function re(e){return ku(e,qo,!1)}function Pu(e){if(e.length>0){let t=v(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Iu(e){let t=new Set,r=[];function n(u){if(u.type===Me&&Pu(r),u.type===fe){if(r.push(u),t.has(u))return!1;t.add(u)}}function s(u){u.type===fe&&r.pop().break&&Pu(r)}pr(e,n,s,!0)}function Wo(e){return e.type===oe&&!e.hard?e.soft?"":" ":e.type===he?e.flatContents:e}function cr(e){return ft(e,Wo)}function Uo(e){switch(Be(e)){case _e:if(e.parts.every(t=>t===""))return"";break;case fe:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===fe&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case Ke:case $e:case ze:case Ze:if(!e.contents)return"";break;case he:if(!e.flatContents&&!e.breakContents)return"";break;case ge:{let t=[];for(let r of e){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof v(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...s)}return t.length===0?"":t.length===1?t[0]:t}case Ne:case it:case Qe:case Ge:case oe:case Se:case Me:break;default:throw new Tt(e)}return e}function Ut(e){return ft(e,t=>Uo(t))}function ve(e,t=Rr){return ft(e,r=>typeof r=="string"?b(t,r.split(` -`)):r)}function Xo(e){if(e.type===oe)return!0}function Lu(e){return ku(e,Xo,!1)}function lr(e,t){return e.type===Se?{...e,contents:t(e.contents)}:t(e)}function wu(e){let t=!0;return pr(e,r=>{switch(Be(r)){case Ne:if(r==="")break;case Qe:case Ge:case oe:case Me:return t=!1,!1}}),t}var Wn=()=>{},et=Wn,Un=Wn,Ou=Wn;function D(e){return et(e),{type:$e,contents:e}}function be(e,t){return et(t),{type:Ke,contents:t,n:e}}function l(e,t={}){return et(e),Un(t.expandedStates,!0),{type:fe,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function _u(e){return be(Number.NEGATIVE_INFINITY,e)}function Jr(e){return be(-1,e)}function tt(e,t){return l(e[0],{...t,expandedStates:e})}function Nr(e){return Ou(e),{type:_e,parts:e}}function S(e,t="",r={}){return et(e),t!==""&&et(t),{type:he,breakContents:e,flatContents:t,groupId:r.groupId}}function xt(e,t){return et(e),{type:ze,contents:e,groupId:t.groupId,negate:t.negate}}function Xn(e){return et(e),{type:Ze,contents:e}}var je={type:Ge},Ce={type:Me};var Yn={type:oe,hard:!0},Yo={type:oe,hard:!0,literal:!0},x={type:oe},E={type:oe,soft:!0},F=[Yn,Ce],Rr=[Yo,Ce],mr={type:it};function b(e,t){et(e),Un(t);let r=[];for(let n=0;n0){for(let s=0;s1&&t.every(r=>r.trimStart()[0]==="*")}var Hn=new WeakMap;function Vo(e){return Hn.has(e)||Hn.set(e,Ho(e)),Hn.get(e)}var vu=Vo;function ju(e,t){let r=e.node;if(At(r))return t.originalText.slice(j(r),P(r)).trimEnd();if(vu(r))return $o(r);if(te(r))return["/*",ve(r.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(r))}function $o(e){let t=e.value.split(` -`);return["/*",b(F,t.map((r,n)=>n===0?r.trimEnd():" "+(nrp,ownLine:()=>tp,remaining:()=>np});function Ko(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Vn(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Ko(e)}function De(e,t){t.leading=!0,t.trailing=!1,Vn(e,t)}function Pe(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Vn(e,t)}function z(e,t){t.leading=!1,t.trailing=!0,Vn(e,t)}function Qo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=Ye(e,n),n=_t(e,n),n=Mt(e,n),n=He(e,n);return n}var ot=Qo;function zo(e,t){let r=ot(e,t);return r===!1?"":e.charAt(r)}var ke=zo;function Zo(e,t,r){for(let n=t;nAt(e)||!ie(t,j(e),P(e));function tp(e){return[Yu,Nu,Wu,fp,up,Qn,zn,Ju,Gu,Cp,Ep,es,Xu,Ap,qu,Uu,Zn,ip,Bp,Hu].some(t=>t(e))}function rp(e){return[sp,Wu,Nu,Xu,Qn,zn,Ju,Gu,Uu,Dp,Fp,es,xp,Zn,gp,Sp,bp,Hu].some(t=>t(e))}function np(e){return[Yu,Qn,zn,ap,yp,qu,es,mp,lp,Zn,hp].some(t=>t(e))}function It(e,t){let r=(e.body||e.properties).find(({type:n})=>n!=="EmptyStatement");r?De(r,t):Pe(e,t)}function Kn(e,t){e.type==="BlockStatement"?It(e,t):De(e,t)}function sp({comment:e,followingNode:t}){return t&&Gr(e)?(De(t,e),!0):!1}function Qn({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){if((r==null?void 0:r.type)!=="IfStatement"||!n)return!1;if(ke(s,P(e))===")")return z(t,e),!0;if(t===r.consequent&&n===r.alternate){let i=ot(s,P(r.consequent));if(j(e)"?(Pe(t,e),!0):!1}function yp({comment:e,enclosingNode:t,text:r}){return ke(r,P(e))!==")"?!1:t&&(Vu(t)&&Q(t).length===0||yt(t)&&le(t).length===0)?(Pe(t,e),!0):((t==null?void 0:t.type)==="MethodDefinition"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&Q(t.value).length===0?(Pe(t.value,e),!0):!1}function fp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="ComponentTypeParameter"&&((r==null?void 0:r.type)==="DeclareComponent"||(r==null?void 0:r.type)==="ComponentTypeAnnotation")&&(n==null?void 0:n.type)!=="ComponentTypeParameter"?(z(t,e),!0):((t==null?void 0:t.type)==="ComponentParameter"||(t==null?void 0:t.type)==="RestElement")&&(r==null?void 0:r.type)==="ComponentDeclaration"&&ke(s,P(e))===")"?(z(t,e),!0):!1}function Wu({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="FunctionTypeParam"&&(r==null?void 0:r.type)==="FunctionTypeAnnotation"&&(n==null?void 0:n.type)!=="FunctionTypeParam"?(z(t,e),!0):((t==null?void 0:t.type)==="Identifier"||(t==null?void 0:t.type)==="AssignmentPattern"||(t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern"||(t==null?void 0:t.type)==="RestElement"||(t==null?void 0:t.type)==="TSParameterProperty")&&Vu(r)&&ke(s,P(e))===")"?(z(t,e),!0):!te(e)&&((r==null?void 0:r.type)==="FunctionDeclaration"||(r==null?void 0:r.type)==="FunctionExpression"||(r==null?void 0:r.type)==="ObjectMethod")&&(n==null?void 0:n.type)==="BlockStatement"&&r.body===n&&ot(s,P(e))===j(n)?(It(n,e),!0):!1}function Uu({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="LabeledStatement"?(De(t,e),!0):!1}function Zn({comment:e,enclosingNode:t}){return((t==null?void 0:t.type)==="ContinueStatement"||(t==null?void 0:t.type)==="BreakStatement")&&!t.label?(z(t,e),!0):!1}function Dp({comment:e,precedingNode:t,enclosingNode:r}){return w(r)&&t&&r.callee===t&&r.arguments.length>0?(De(r.arguments[0],e),!0):!1}function Ep({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return Oe(r)?(or(e)&&(n.prettierIgnore=!0,e.unignore=!0),t?(z(t,e),!0):!1):(Oe(n)&&or(e)&&(n.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function Fp({comment:e,enclosingNode:t}){return Te(t)?(De(t,e),!0):!1}function es({comment:e,enclosingNode:t,ast:r,isLastComment:n}){var s;return((s=r==null?void 0:r.body)==null?void 0:s.length)===0?(n?Pe(r,e):De(r,e),!0):(t==null?void 0:t.type)==="Program"&&t.body.length===0&&!O(t.directives)?(n?Pe(t,e):De(t,e),!0):!1}function Cp({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="ForInStatement"||(t==null?void 0:t.type)==="ForOfStatement"?(De(t,e),!0):!1}function Xu({comment:e,precedingNode:t,enclosingNode:r,text:n}){if((r==null?void 0:r.type)==="ImportSpecifier"||(r==null?void 0:r.type)==="ExportSpecifier")return De(r,e),!0;let s=(t==null?void 0:t.type)==="ImportSpecifier"&&(r==null?void 0:r.type)==="ImportDeclaration",u=(t==null?void 0:t.type)==="ExportSpecifier"&&(r==null?void 0:r.type)==="ExportNamedDeclaration";return(s||u)&&ee(n,P(e))?(z(t,e),!0):!1}function Ap({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="AssignmentPattern"?(De(t,e),!0):!1}var dp=new Set(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),Tp=new Set(["ObjectExpression","ArrayExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function xp({comment:e,enclosingNode:t,followingNode:r}){return dp.has(t==null?void 0:t.type)&&r&&(Tp.has(r.type)||te(e))?(De(r,e),!0):!1}function hp({comment:e,enclosingNode:t,followingNode:r,text:n}){return!r&&((t==null?void 0:t.type)==="TSMethodSignature"||(t==null?void 0:t.type)==="TSDeclareFunction"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&ke(n,P(e))===";"?(z(t,e),!0):!1}function Yu({comment:e,enclosingNode:t,followingNode:r}){if(or(e)&&(t==null?void 0:t.type)==="TSMappedType"&&r===t.key)return t.prettierIgnore=!0,e.unignore=!0,!0}function Hu({comment:e,precedingNode:t,enclosingNode:r}){if((r==null?void 0:r.type)==="TSMappedType"&&!t)return Pe(r,e),!0}function gp({comment:e,enclosingNode:t,followingNode:r}){return!t||t.type!=="SwitchCase"||t.test||!r||r!==t.consequent[0]?!1:(r.type==="BlockStatement"&&At(e)?It(r,e):Pe(t,e),!0)}function Sp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return Oe(t)&&((r.type==="TSArrayType"||r.type==="ArrayTypeAnnotation")&&!n||qt(r))?(z(v(!1,t.types,-1),e),!0):!1}function Bp({comment:e,enclosingNode:t,precedingNode:r,followingNode:n}){if(((t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern")&&(n==null?void 0:n.type)==="TSTypeAnnotation")return r?z(r,e):Pe(t,e),!0}function bp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return!n&&(r==null?void 0:r.type)==="UnaryExpression"&&((t==null?void 0:t.type)==="LogicalExpression"||(t==null?void 0:t.type)==="BinaryExpression")&&ie(s,j(r.argument),j(t.right))&&Ru(e,s)&&!ie(s,j(t.right),j(e))?(z(t.right,e),!0):!1}var Vu=R(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod"]);var Pp=new Set(["EmptyStatement","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]);function kp(e){return!Pp.has(e.type)}function Ip(e,t){var r;if((t.parser==="typescript"||t.parser==="flow"||t.parser==="hermes"||t.parser==="acorn"||t.parser==="oxc"||t.parser==="oxc-ts"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree")&&e.type==="MethodDefinition"&&((r=e.value)==null?void 0:r.type)==="FunctionExpression"&&Q(e.value).length===0&&!e.value.returnType&&!O(e.value.typeParameters)&&e.value.body)return[...e.decorators||[],e.key,e.value.body]}function rs(e){let{node:t,parent:r}=e;return(Y(t)||r&&(r.type==="JSXSpreadAttribute"||r.type==="JSXSpreadChild"||Oe(r)||(r.type==="ClassDeclaration"||r.type==="ClassExpression")&&r.superClass===t))&&(!kt(t)||Oe(r))}function Lp(e,{parser:t}){if(t==="flow"||t==="hermes"||t==="babel-flow")return e=X(!1,e,/[\s(]/gu,""),e===""||e==="/*"||e==="/*::"}function $u(e){switch(e){case"cr":return"\r";case"crlf":return`\r -`;default:return` -`}}var Ie=Symbol("MODE_BREAK"),pt=Symbol("MODE_FLAT"),Xt=Symbol("cursor"),ns=Symbol("DOC_FILL_PRINTED_LENGTH");function Ku(){return{value:"",length:0,queue:[]}}function wp(e,t){return ss(e,{type:"indent"},t)}function Op(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Ku():t<0?ss(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:ss(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function ss(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],s="",u=0,i=0,a=0;for(let c of n)switch(c.type){case"indent":m(),r.useTabs?o(1):p(r.tabWidth);break;case"stringAlign":m(),s+=c.n,u+=c.n.length;break;case"numberAlign":i+=1,a+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return y(),{...e,value:s,length:u,queue:n};function o(c){s+=" ".repeat(c),u+=r.tabWidth*c}function p(c){s+=" ".repeat(c),u+=c}function m(){r.useTabs?f():y()}function f(){i>0&&o(i),C()}function y(){a>0&&p(a),C()}function C(){i=0,a=0}}function us(e){let t=0,r=0,n=e.length;e:for(;n--;){let s=e[n];if(s===Xt){r++;continue}for(let u=s.length-1;u>=0;u--){let i=s[u];if(i===" "||i===" ")t++;else{e[n]=s.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Xt);return t}function qr(e,t,r,n,s,u){if(r===Number.POSITIVE_INFINITY)return!0;let i=t.length,a=[e],o=[];for(;r>=0;){if(a.length===0){if(i===0)return!0;a.push(t[--i]);continue}let{mode:p,doc:m}=a.pop(),f=Be(m);switch(f){case Ne:o.push(m),r-=st(m);break;case ge:case _e:{let y=f===ge?m:m.parts,C=m[ns]??0;for(let c=y.length-1;c>=C;c--)a.push({mode:p,doc:y[c]});break}case $e:case Ke:case ze:case Se:a.push({mode:p,doc:m.contents});break;case Qe:r+=us(o);break;case fe:{if(u&&m.break)return!1;let y=m.break?Ie:p,C=m.expandedStates&&y===Ie?v(!1,m.expandedStates,-1):m.contents;a.push({mode:y,doc:C});break}case he:{let C=(m.groupId?s[m.groupId]||pt:p)===Ie?m.breakContents:m.flatContents;C&&a.push({mode:p,doc:C});break}case oe:if(p===Ie||m.hard)return!0;m.soft||(o.push(" "),r--);break;case Ze:n=!0;break;case Ge:if(n)return!1;break}}return!1}function is(e,t){let r={},n=t.printWidth,s=$u(t.endOfLine),u=0,i=[{ind:Ku(),mode:Ie,doc:e}],a=[],o=!1,p=[],m=0;for(Iu(e);i.length>0;){let{ind:y,mode:C,doc:c}=i.pop();switch(Be(c)){case Ne:{let A=s!==` -`?X(!1,c,` -`,s):c;a.push(A),i.length>0&&(u+=st(A));break}case ge:for(let A=c.length-1;A>=0;A--)i.push({ind:y,mode:C,doc:c[A]});break;case it:if(m>=2)throw new Error("There are too many 'cursor' in doc.");a.push(Xt),m++;break;case $e:i.push({ind:wp(y,t),mode:C,doc:c.contents});break;case Ke:i.push({ind:Op(y,c.n,t),mode:C,doc:c.contents});break;case Qe:u-=us(a);break;case fe:switch(C){case pt:if(!o){i.push({ind:y,mode:c.break?Ie:pt,doc:c.contents});break}case Ie:{o=!1;let A={ind:y,mode:pt,doc:c.contents},T=n-u,B=p.length>0;if(!c.break&&qr(A,i,T,B,r))i.push(A);else if(c.expandedStates){let g=v(!1,c.expandedStates,-1);if(c.break){i.push({ind:y,mode:Ie,doc:g});break}else for(let _=1;_=c.expandedStates.length){i.push({ind:y,mode:Ie,doc:g});break}else{let M=c.expandedStates[_],J={ind:y,mode:pt,doc:M};if(qr(J,i,T,B,r)){i.push(J);break}}}else i.push({ind:y,mode:Ie,doc:c.contents});break}}c.id&&(r[c.id]=v(!1,i,-1).mode);break;case _e:{let A=n-u,T=c[ns]??0,{parts:B}=c,g=B.length-T;if(g===0)break;let _=B[T+0],M=B[T+1],J={ind:y,mode:pt,doc:_},I={ind:y,mode:Ie,doc:_},q=qr(J,[],A,p.length>0,r,!0);if(g===1){q?i.push(J):i.push(I);break}let k={ind:y,mode:pt,doc:M},W={ind:y,mode:Ie,doc:M};if(g===2){q?i.push(k,J):i.push(W,I);break}let ne=B[T+2],Z={ind:y,mode:C,doc:{...c,[ns]:T+2}};qr({ind:y,mode:pt,doc:[_,M,ne]},[],A,p.length>0,r,!0)?i.push(Z,k,J):q?i.push(Z,W,J):i.push(Z,W,I);break}case he:case ze:{let A=c.groupId?r[c.groupId]:C;if(A===Ie){let T=c.type===he?c.breakContents:c.negate?c.contents:D(c.contents);T&&i.push({ind:y,mode:C,doc:T})}if(A===pt){let T=c.type===he?c.flatContents:c.negate?D(c.contents):c.contents;T&&i.push({ind:y,mode:C,doc:T})}break}case Ze:p.push({ind:y,mode:C,doc:c.contents});break;case Ge:p.length>0&&i.push({ind:y,mode:C,doc:Yn});break;case oe:switch(C){case pt:if(c.hard)o=!0;else{c.soft||(a.push(" "),u+=1);break}case Ie:if(p.length>0){i.push({ind:y,mode:C,doc:c},...p.reverse()),p.length=0;break}c.literal?y.root?(a.push(s,y.root.value),u=y.root.length):(a.push(s),u=0):(u-=us(a),a.push(s+y.value),u=y.length);break}break;case Se:i.push({ind:y,mode:C,doc:c.contents});break;case Me:break;default:throw new Tt(c)}i.length===0&&p.length>0&&(i.push(...p.reverse()),p.length=0)}let f=a.indexOf(Xt);if(f!==-1){let y=a.indexOf(Xt,f+1);if(y===-1)return{formatted:a.filter(T=>T!==Xt).join("")};let C=a.slice(0,f).join(""),c=a.slice(f+1,y).join(""),A=a.slice(y+1).join("");return{formatted:C+c+A,cursorNodeStart:C.length,cursorNodeText:c}}return{formatted:a.join("")}}function _p(e,t,r=0){let n=0;for(let s=r;s{if(i.push(r()),m.tail)return;let{tabWidth:f}=t,y=m.value.raw,C=y.includes(` -`)?zu(y,f):o;o=C;let c=a[p],A=n[u][p],T=ie(t.originalText,P(m),j(n.quasis[p+1]));if(!T){let g=is(c,{...t,printWidth:Number.POSITIVE_INFINITY}).formatted;g.includes(` -`)?T=!0:c=g}T&&(d(A)||A.type==="Identifier"||G(A)||A.type==="ConditionalExpression"||A.type==="SequenceExpression"||xe(A)||Fe(A))&&(c=[D([E,c]),E]);let B=C===0&&y.endsWith(` -`)?be(Number.NEGATIVE_INFINITY,c):Mu(c,C,f);i.push(l(["${",B,je,"}"]))},"quasis"),i.push("`"),i}function Zu(e,t,r){let n=r("quasi"),{node:s}=e,u="",i=Ve(s.quasi,h.Leading)[0];return i&&(ie(t.originalText,P(s.typeArguments??s.typeParameters??s.tag),j(i))?u=E:u=" "),at(n.label&&{tagged:!0,...n.label},[r("tag"),r(s.typeArguments?"typeArguments":"typeParameters"),u,je,n])}function vp(e,t,r){let{node:n}=e,s=n.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(s.length>1||s.some(u=>u.length>0)){t.__inJestEach=!0;let u=e.map(r,"expressions");t.__inJestEach=!1;let i=[],a=u.map(y=>"${"+is(y,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),o=[{hasLineBreak:!1,cells:[]}];for(let y=1;yy.cells.length)),m=Array.from({length:p}).fill(0),f=[{cells:s},...o.filter(y=>y.cells.length>0)];for(let{cells:y}of f.filter(C=>!C.hasLineBreak))for(let[C,c]of y.entries())m[C]=Math.max(m[C],st(c));return i.push(je,"`",D([F,b(F,f.map(y=>b(" | ",y.cells.map((C,c)=>y.hasLineBreak?C:C+" ".repeat(m[c]-st(C))))))]),F,"`"),i}}function jp(e,t){let{node:r}=e,n=t();return d(r)&&(n=l([D([E,n]),E])),["${",n,je,"}"]}function Yt(e,t){return e.map(r=>jp(r,t),"expressions")}function Ur(e,t){return ft(e,r=>typeof r=="string"?t?X(!1,r,/(\\*)`/gu,"$1$1\\`"):as(r):r)}function as(e){return X(!1,e,/([\\`]|\$\{)/gu,String.raw`\$1`)}function Rp({node:e,parent:t}){let r=/^[fx]?(?:describe|it|test)$/u;return t.type==="TaggedTemplateExpression"&&t.quasi===e&&t.tag.type==="MemberExpression"&&t.tag.property.type==="Identifier"&&t.tag.property.name==="each"&&(t.tag.object.type==="Identifier"&&r.test(t.tag.object.name)||t.tag.object.type==="MemberExpression"&&t.tag.object.property.type==="Identifier"&&(t.tag.object.property.name==="only"||t.tag.object.property.name==="skip")&&t.tag.object.object.type==="Identifier"&&r.test(t.tag.object.object.name))}var ps=[(e,t)=>e.type==="ObjectExpression"&&t==="properties",(e,t)=>e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="Component"&&t==="arguments",(e,t)=>e.type==="Decorator"&&t==="expression"];function ei(e){let t=n=>n.type==="TemplateLiteral",r=(n,s)=>Te(n)&&!n.computed&&n.key.type==="Identifier"&&n.key.name==="styles"&&s==="value";return e.match(t,(n,s)=>U(n)&&s==="elements",r,...ps)||e.match(t,r,...ps)}function ti(e){return e.match(t=>t.type==="TemplateLiteral",(t,r)=>Te(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&r==="value",...ps)}function os(e,t){return d(e,h.Block|h.Leading,({value:r})=>r===` ${t} `)}function Xr({node:e,parent:t},r){return os(e,r)||Jp(t)&&os(t,r)||t.type==="ExpressionStatement"&&os(t,r)}function Jp(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function Np(e,t,r){let{node:n}=r,s=n.quasis.map(m=>m.value.raw),u=0,i=s.reduce((m,f,y)=>y===0?f:m+"@prettier-placeholder-"+u+++"-id"+f,""),a=await e(i,{parser:"scss"}),o=Yt(r,t),p=Gp(a,o);if(!p)throw new Error("Couldn't insert all the expressions");return["`",D([F,p]),E,"`"]}function Gp(e,t){if(!O(t))return e;let r=0,n=ft(Ut(e),s=>typeof s!="string"||!s.includes("@prettier-placeholder")?s:s.split(/@prettier-placeholder-(\d+)-id/u).map((u,i)=>i%2===0?ve(u):(r++,t[u])));return t.length===r?n:null}function qp({node:e,parent:t,grandparent:r}){return r&&e.quasis&&t.type==="JSXExpressionContainer"&&r.type==="JSXElement"&&r.openingElement.name.name==="style"&&r.openingElement.attributes.some(n=>n.type==="JSXAttribute"&&n.name.name==="jsx")||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="css"||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="MemberExpression"&&t.tag.object.name==="css"&&(t.tag.property.name==="global"||t.tag.property.name==="resolve")}function Yr(e){return e.type==="Identifier"&&e.name==="styled"}function ri(e){return/^[A-Z]/u.test(e.object.name)&&e.property.name==="extend"}function Wp({parent:e}){if(!e||e.type!=="TaggedTemplateExpression")return!1;let t=e.tag.type==="ParenthesizedExpression"?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return Yr(t.object)||ri(t);case"CallExpression":return Yr(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&(Yr(t.callee.object.object)||ri(t.callee.object))||t.callee.object.type==="CallExpression"&&Yr(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function Up({parent:e,grandparent:t}){return(t==null?void 0:t.type)==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}function Xp(e){if(qp(e)||Wp(e)||Up(e)||ei(e))return Np}var ni=Xp;async function Yp(e,t,r){let{node:n}=r,s=n.quasis.length,u=Yt(r,t),i=[];for(let a=0;a2&&y[0].trim()===""&&y[1].trim()==="",T=C>2&&y[C-1].trim()===""&&y[C-2].trim()==="",B=y.every(_=>/^\s*(?:#[^\n\r]*)?$/u.test(_));if(!m&&/#[^\n\r]*$/u.test(y[C-1]))return null;let g=null;B?g=Hp(y):g=await e(f,{parser:"graphql"}),g?(g=Ur(g,!1),!p&&A&&i.push(""),i.push(g),!m&&T&&i.push("")):!p&&!m&&A&&i.push(""),c&&i.push(c)}return["`",D([F,b(F,i)]),F,"`"]}function Hp(e){let t=[],r=!1,n=e.map(s=>s.trim());for(let[s,u]of n.entries())u!==""&&(n[s-1]===""&&r?t.push([F,u]):t.push(u),r=!0);return t.length===0?null:b(F,t)}function Vp({node:e,parent:t}){return Xr({node:e,parent:t},"GraphQL")||t&&(t.type==="TaggedTemplateExpression"&&(t.tag.type==="MemberExpression"&&t.tag.object.name==="graphql"&&t.tag.property.name==="experimental"||t.tag.type==="Identifier"&&(t.tag.name==="gql"||t.tag.name==="graphql"))||t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="graphql")}function $p(e){if(Vp(e))return Yp}var si=$p;var cs=0;async function ui(e,t,r,n,s){let{node:u}=n,i=cs;cs=cs+1>>>0;let a=B=>`PRETTIER_HTML_PLACEHOLDER_${B}_${i}_IN_JS`,o=u.quasis.map((B,g,_)=>g===_.length-1?B.value.cooked:B.value.cooked+a(g)).join(""),p=Yt(n,r),m=new RegExp(a(String.raw`(\d+)`),"gu"),f=0,y=await t(o,{parser:e,__onHtmlRoot(B){f=B.children.length}}),C=ft(y,B=>{if(typeof B!="string")return B;let g=[],_=B.split(m);for(let M=0;M<_.length;M++){let J=_[M];if(M%2===0){J&&(J=as(J),s.__embeddedInHtml&&(J=X(!1,J,/<\/(?=script\b)/giu,String.raw`<\/`)),g.push(J));continue}let I=Number(J);g.push(p[I])}return g}),c=/^\s/u.test(o)?" ":"",A=/\s$/u.test(o)?" ":"",T=s.htmlWhitespaceSensitivity==="ignore"?F:c&&A?x:null;return T?l(["`",D([T,l(C)]),T,"`"]):at({hug:!1},l(["`",c,f>1?D(l(C)):l(C),A,"`"]))}function Kp(e){return Xr(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,r)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&r==="quasi")}var Qp=ui.bind(void 0,"html"),zp=ui.bind(void 0,"angular");function Zp(e){if(Kp(e))return Qp;if(ti(e))return zp}var ii=Zp;async function ec(e,t,r){let{node:n}=r,s=X(!1,n.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(o,p)=>"\\".repeat(p.length/2)+"`"),u=tc(s),i=u!=="";i&&(s=X(!1,s,new RegExp(`^${u}`,"gmu"),""));let a=Ur(await e(s,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",i?D([E,a]):[Rr,_u(a)],E,"`"]}function tc(e){let t=e.match(/^([^\S\n]*)\S/mu);return t===null?"":t[1]}function rc(e){if(nc(e))return ec}function nc({node:e,parent:t}){return(t==null?void 0:t.type)==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}var ai=rc;function sc(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||uc(t))return;let r;for(let n of[ni,si,ii,ai])if(r=n(e),!!r)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":async(...s)=>{let u=await r(...s);return u&&at({embed:!0,...u.label},u)}}function uc({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}var oi=sc;var ic=/\*\/$/,ac=/^\/\*\*?/,mi=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,oc=/(^|\s+)\/\/([^\n\r]*)/g,pi=/^(\r?\n)+/,pc=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ci=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,cc=/(\r?\n|^) *\* ?/g,yi=[];function fi(e){let t=e.match(mi);return t?t[0].trimStart():""}function Di(e){let t=e.match(mi),r=t==null?void 0:t[0];return r==null?e:e.slice(r.length)}function Ei(e){let t=` -`;e=X(!1,e.replace(ac,"").replace(ic,""),cc,"$1");let r="";for(;r!==e;)r=e,e=X(!1,e,pc,`${t}$1 $2${t}`);e=e.replace(pi,"").trimEnd();let n=Object.create(null),s=X(!1,e,ci,"").replace(pi,"").trimEnd(),u;for(;u=ci.exec(e);){let i=X(!1,u[2],oc,"");if(typeof n[u[1]]=="string"||Array.isArray(n[u[1]])){let a=n[u[1]];n[u[1]]=[...yi,...Array.isArray(a)?a:[a],i]}else n[u[1]]=i}return{comments:s,pragmas:n}}function Fi({comments:e="",pragmas:t={}}){let r=` -`,n="/**",s=" *",u=" */",i=Object.keys(t),a=i.flatMap(p=>li(p,t[p])).map(p=>`${s} ${p}${r}`).join("");if(!e){if(i.length===0)return"";if(i.length===1&&!Array.isArray(t[i[0]])){let p=t[i[0]];return`${n} ${li(i[0],p)[0]}${u}`}}let o=e.split(r).map(p=>`${s} ${p}`).join(r)+r;return n+r+(e?o:"")+(e&&i.length>0?s+r:"")+a+u}function li(e,t){return[...yi,...Array.isArray(t)?t:[t]].map(r=>`@${e} ${r}`.trim())}var Ci="format";function lc(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` -`);return t===-1?e:e.slice(0,t)}var Ai=lc;function mc(e){let t=Ai(e);t&&(e=e.slice(t.length+1));let r=fi(e),{pragmas:n,comments:s}=Ei(r);return{shebang:t,text:e,pragmas:n,comments:s}}function di(e){let{shebang:t,text:r,pragmas:n,comments:s}=mc(e),u=Di(r),i=Fi({pragmas:{[Ci]:"",...n},comments:s.trimStart()});return(t?`${t} -`:"")+i+(u.startsWith(` -`)?` -`:` - -`)+u}function yc(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:s,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:a}=e,o=s(a),p=u(a);for(let m of n)s(m)>=o&&u(m)<=p&&i.add(m);return r.slice(o,p)}var Ti=yc;function ls(e,t){var u,i,a,o,p,m,f,y,C;if(e.isRoot)return!1;let{node:r,key:n,parent:s}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&Fc(r)&&yr(e))return!0;if(fc(r))return!1;if(r.type==="Identifier"){if((u=r.extra)!=null&&u.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(r.name)||n==="left"&&(r.name==="async"&&!s.await||r.name==="let")&&s.type==="ForOfStatement")return!0;if(r.name==="let"){let c=(i=e.findAncestor(A=>A.type==="ForOfStatement"))==null?void 0:i.left;if(c&&pe(c,A=>A===r))return!0}if(n==="object"&&r.name==="let"&&s.type==="MemberExpression"&&s.computed&&!s.optional){let c=e.findAncestor(T=>T.type==="ExpressionStatement"||T.type==="ForStatement"||T.type==="ForInStatement"),A=c?c.type==="ExpressionStatement"?c.expression:c.type==="ForStatement"?c.init:c.left:void 0;if(A&&pe(A,T=>T===r))return!0}if(n==="expression")switch(r.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let c=e.findAncestor(A=>!xe(A));if(c!==s&&c.type==="ExpressionStatement")return!0}}return!1}if(r.type==="ObjectExpression"||r.type==="FunctionExpression"||r.type==="ClassExpression"||r.type==="DoExpression"){let c=(a=e.findAncestor(A=>A.type==="ExpressionStatement"))==null?void 0:a.expression;if(c&&pe(c,A=>A===r))return!0}if(r.type==="ObjectExpression"){let c=(o=e.findAncestor(A=>A.type==="ArrowFunctionExpression"))==null?void 0:o.body;if(c&&c.type!=="SequenceExpression"&&c.type!=="AssignmentExpression"&&pe(c,A=>A===r))return!0}switch(s.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(n==="superClass"&&(r.type==="ArrowFunctionExpression"||r.type==="AssignmentExpression"||r.type==="AwaitExpression"||r.type==="BinaryExpression"||r.type==="ConditionalExpression"||r.type==="LogicalExpression"||r.type==="NewExpression"||r.type==="ObjectExpression"||r.type==="SequenceExpression"||r.type==="TaggedTemplateExpression"||r.type==="UnaryExpression"||r.type==="UpdateExpression"||r.type==="YieldExpression"||r.type==="TSNonNullExpression"||r.type==="ClassExpression"&&O(r.decorators)))return!0;break;case"ExportDefaultDeclaration":return xi(e,t)||r.type==="SequenceExpression";case"Decorator":if(n==="expression"&&!Ac(r))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression")&&Ec(r))return!0;break;case"BinaryExpression":if(n==="left"&&(s.operator==="in"||s.operator==="instanceof")&&r.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(n==="init"&&e.match(void 0,void 0,(c,A)=>A==="declarations"&&c.type==="VariableDeclaration",(c,A)=>A==="left"&&c.type==="ForInStatement"))return!0;break}switch(r.type){case"UpdateExpression":if(s.type==="UnaryExpression")return r.prefix&&(r.operator==="++"&&s.operator==="+"||r.operator==="--"&&s.operator==="-");case"UnaryExpression":switch(s.type){case"UnaryExpression":return r.operator===s.operator&&(r.operator==="+"||r.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"BinaryExpression":return n==="left"&&s.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(s.type==="UpdateExpression"||r.operator==="in"&&Dc(e))return!0;if(r.operator==="|>"&&((p=r.extra)!=null&&p.parenthesized)){let c=e.grandparent;if(c.type==="BinaryExpression"&&c.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(s.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!xe(r);case"ConditionalExpression":return xe(r)||fu(r);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return n==="callee";case"ClassExpression":case"ClassDeclaration":return n==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"AssignmentExpression":case"AssignmentPattern":return n==="left"&&(r.type==="TSTypeAssertion"||xe(r));case"LogicalExpression":if(r.type==="LogicalExpression")return s.operator!==r.operator;case"BinaryExpression":{let{operator:c,type:A}=r;if(!c&&A!=="TSTypeAssertion")return!0;let T=sr(c),B=s.operator,g=sr(B);return g>T||n==="right"&&g===T||g===T&&!ar(B,c)?!0:g");default:return!1}case"TSFunctionType":if(e.match(c=>c.type==="TSFunctionType",(c,A)=>A==="typeAnnotation"&&c.type==="TSTypeAnnotation",(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression"))return!0;case"TSConditionalType":case"TSConstructorType":case"ConditionalTypeAnnotation":if(n==="extendsType"&&Je(r)&&s.type===r.type||n==="checkType"&&Je(s))return!0;if(n==="extendsType"&&s.type==="TSConditionalType"){let{typeAnnotation:c}=r.returnType||r.typeAnnotation;if(c.type==="TSTypePredicate"&&c.typeAnnotation&&(c=c.typeAnnotation.typeAnnotation),c.type==="TSInferType"&&c.typeParameter.constraint)return!0}case"TSUnionType":case"TSIntersectionType":if((Oe(s)||qt(s))&&s.types.length>1&&(!r.types||r.types.length>1))return!0;case"TSInferType":if(r.type==="TSInferType"){if(s.type==="TSRestType")return!1;if(n==="types"&&(s.type==="TSUnionType"||s.type==="TSIntersectionType")&&r.typeParameter.type==="TSTypeParameter"&&r.typeParameter.constraint)return!0}case"TSTypeOperator":return s.type==="TSArrayType"||s.type==="TSOptionalType"||s.type==="TSRestType"||n==="objectType"&&s.type==="TSIndexedAccessType"||s.type==="TSTypeOperator"||s.type==="TSTypeAnnotation"&&e.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return n==="objectType"&&s.type==="TSIndexedAccessType"||n==="elementType"&&s.type==="TSArrayType";case"TypeOperator":return s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||s.type==="TypeOperator";case"TypeofTypeAnnotation":return n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||n==="elementType"&&s.type==="ArrayTypeAnnotation";case"ArrayTypeAnnotation":return s.type==="NullableTypeAnnotation";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return s.type==="TypeOperator"||s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||s.type==="IntersectionTypeAnnotation"||s.type==="UnionTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"InferTypeAnnotation":case"NullableTypeAnnotation":return s.type==="ArrayTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if(r.type==="ComponentTypeAnnotation"&&(r.rendersType===null||r.rendersType===void 0))return!1;if(e.match(void 0,(A,T)=>T==="typeAnnotation"&&A.type==="TypeAnnotation",(A,T)=>T==="returnType"&&A.type==="ArrowFunctionExpression")||e.match(void 0,(A,T)=>T==="typeAnnotation"&&A.type==="TypePredicate",(A,T)=>T==="typeAnnotation"&&A.type==="TypeAnnotation",(A,T)=>T==="returnType"&&A.type==="ArrowFunctionExpression"))return!0;let c=s.type==="NullableTypeAnnotation"?e.grandparent:s;return c.type==="UnionTypeAnnotation"||c.type==="IntersectionTypeAnnotation"||c.type==="ArrayTypeAnnotation"||n==="objectType"&&(c.type==="IndexedAccessType"||c.type==="OptionalIndexedAccessType")||n==="checkType"&&s.type==="ConditionalTypeAnnotation"||n==="extendsType"&&s.type==="ConditionalTypeAnnotation"&&((m=r.returnType)==null?void 0:m.type)==="InferTypeAnnotation"&&((f=r.returnType)==null?void 0:f.typeParameter.bound)||c.type==="NullableTypeAnnotation"||s.type==="FunctionTypeParam"&&s.name===null&&Q(r).some(A=>{var T;return((T=A.typeAnnotation)==null?void 0:T.type)==="NullableTypeAnnotation"})}case"OptionalIndexedAccessType":return n==="objectType"&&s.type==="IndexedAccessType";case"StringLiteral":case"NumericLiteral":case"Literal":if(typeof r.value=="string"&&s.type==="ExpressionStatement"&&typeof s.directive!="string"){let c=e.grandparent;return c.type==="Program"||c.type==="BlockStatement"}return n==="object"&&G(s)&&ye(r);case"AssignmentExpression":return!((n==="init"||n==="update")&&s.type==="ForStatement"||n==="expression"&&r.left.type!=="ObjectPattern"&&s.type==="ExpressionStatement"||n==="key"&&s.type==="TSPropertySignature"||s.type==="AssignmentExpression"||n==="expressions"&&s.type==="SequenceExpression"&&e.match(void 0,void 0,(c,A)=>(A==="init"||A==="update")&&c.type==="ForStatement")||n==="value"&&s.type==="Property"&&e.match(void 0,void 0,(c,A)=>A==="properties"&&c.type==="ObjectPattern")||s.type==="NGChainedExpression"||n==="node"&&s.type==="JsExpressionRoot");case"ConditionalExpression":switch(s.type){case"TaggedTemplateExpression":case"UnaryExpression":case"SpreadElement":case"BinaryExpression":case"LogicalExpression":case"NGPipeExpression":case"ExportDefaultDeclaration":case"AwaitExpression":case"JSXSpreadAttribute":case"TSTypeAssertion":case"TypeCastExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"ConditionalExpression":return t.experimentalTernaries?!1:n==="test";case"MemberExpression":case"OptionalMemberExpression":return n==="object";default:return!1}case"FunctionExpression":switch(s.type){case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"TaggedTemplateExpression":return!0;default:return!1}case"ArrowFunctionExpression":switch(s.type){case"BinaryExpression":return s.operator!=="|>"||((y=r.extra)==null?void 0:y.parenthesized);case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":case"BindExpression":case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"AwaitExpression":case"TSTypeAssertion":return!0;case"ConditionalExpression":return n==="test";default:return!1}case"ClassExpression":switch(s.type){case"NewExpression":return n==="callee";default:return!1}case"OptionalMemberExpression":case"OptionalCallExpression":case"CallExpression":case"MemberExpression":if(Cc(e))return!0;case"TaggedTemplateExpression":case"TSNonNullExpression":if(n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")){let c=r;for(;c;)switch(c.type){case"CallExpression":case"OptionalCallExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":case"BindExpression":c=c.object;break;case"TaggedTemplateExpression":c=c.tag;break;case"TSNonNullExpression":c=c.expression;break;default:return!1}}return!1;case"BindExpression":return n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")||n==="object"&&G(s);case"NGPipeExpression":return!(s.type==="NGRoot"||s.type==="NGMicrosyntaxExpression"||s.type==="ObjectProperty"&&!((C=r.extra)!=null&&C.parenthesized)||U(s)||n==="arguments"&&w(s)||n==="right"&&s.type==="NGPipeExpression"||n==="property"&&s.type==="MemberExpression"||s.type==="AssignmentExpression");case"JSXFragment":case"JSXElement":return n==="callee"||n==="left"&&s.type==="BinaryExpression"&&s.operator==="<"||!U(s)&&s.type!=="ArrowFunctionExpression"&&s.type!=="AssignmentExpression"&&s.type!=="AssignmentPattern"&&s.type!=="BinaryExpression"&&s.type!=="NewExpression"&&s.type!=="ConditionalExpression"&&s.type!=="ExpressionStatement"&&s.type!=="JsExpressionRoot"&&s.type!=="JSXAttribute"&&s.type!=="JSXElement"&&s.type!=="JSXExpressionContainer"&&s.type!=="JSXFragment"&&s.type!=="LogicalExpression"&&!w(s)&&!Te(s)&&s.type!=="ReturnStatement"&&s.type!=="ThrowStatement"&&s.type!=="TypeCastExpression"&&s.type!=="VariableDeclarator"&&s.type!=="YieldExpression";case"TSInstantiationExpression":return n==="object"&&G(s)}return!1}var fc=R(["BlockStatement","BreakStatement","ComponentDeclaration","ClassBody","ClassDeclaration","ClassMethod","ClassProperty","PropertyDefinition","ClassPrivateProperty","ContinueStatement","DebuggerStatement","DeclareComponent","DeclareClass","DeclareExportAllDeclaration","DeclareExportDeclaration","DeclareFunction","DeclareHook","DeclareInterface","DeclareModule","DeclareModuleExports","DeclareNamespace","DeclareVariable","DeclareEnum","DoWhileStatement","EnumDeclaration","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExpressionStatement","ForInStatement","ForOfStatement","ForStatement","FunctionDeclaration","HookDeclaration","IfStatement","ImportDeclaration","InterfaceDeclaration","LabeledStatement","MethodDefinition","ReturnStatement","SwitchStatement","ThrowStatement","TryStatement","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSNamespaceExportDeclaration","TypeAlias","VariableDeclaration","WhileStatement","WithStatement"]);function Dc(e){let t=0,{node:r}=e;for(;r;){let n=e.getParentNode(t++);if((n==null?void 0:n.type)==="ForStatement"&&n.init===r)return!0;r=n}return!1}function Ec(e){return ur(e,t=>t.type==="ObjectTypeAnnotation"&&ur(t,r=>r.type==="FunctionTypeAnnotation"))}function Fc(e){return ue(e)}function yr(e){let{parent:t,key:r}=e;switch(t.type){case"NGPipeExpression":if(r==="arguments"&&e.isLast)return e.callParent(yr);break;case"ObjectProperty":if(r==="value")return e.callParent(()=>e.key==="properties"&&e.isLast);break;case"BinaryExpression":case"LogicalExpression":if(r==="right")return e.callParent(yr);break;case"ConditionalExpression":if(r==="alternate")return e.callParent(yr);break;case"UnaryExpression":if(t.prefix)return e.callParent(yr);break}return!1}function xi(e,t){let{node:r,parent:n}=e;return r.type==="FunctionExpression"||r.type==="ClassExpression"?n.type==="ExportDefaultDeclaration"||!ls(e,t):!Jt(r)||n.type!=="ExportDefaultDeclaration"&&ls(e,t)?!1:e.call(()=>xi(e,t),...Lr(r))}function Cc(e){return!!(e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&(t.type==="CallExpression"||t.type==="NewExpression"))||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression")||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression")&&(e.match(void 0,void 0,(t,r)=>r==="callee"&&(t.type==="CallExpression"&&!t.optional||t.type==="NewExpression")||r==="object"&&t.type==="MemberExpression"&&!t.optional)||e.match(void 0,void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))}function ms(e){return e.type==="Identifier"?!0:G(e)?!e.computed&&!e.optional&&e.property.type==="Identifier"&&ms(e.object):!1}function Ac(e){return e.type==="ChainExpression"&&(e=e.expression),ms(e)||w(e)&&!e.optional&&ms(e.callee)}var Le=ls;function dc(e,t){let r=t-1;r=Ye(e,r,{backwards:!0}),r=He(e,r,{backwards:!0}),r=Ye(e,r,{backwards:!0});let n=He(e,r,{backwards:!0});return r!==n}var hi=dc;var Tc=()=>!0;function ys(e,t){let r=e.node;return r.printed=!0,t.printer.printComment(e,t)}function xc(e,t){var m;let r=e.node,n=[ys(e,t)],{printer:s,originalText:u,locStart:i,locEnd:a}=t;if((m=s.isBlockComment)==null?void 0:m.call(s,r)){let f=ee(u,a(r))?ee(u,i(r),{backwards:!0})?F:x:" ";n.push(f)}else n.push(F);let p=He(u,Ye(u,a(r)));return p!==!1&&ee(u,p)&&n.push(F),n}function hc(e,t,r){var p;let n=e.node,s=ys(e,t),{printer:u,originalText:i,locStart:a}=t,o=(p=u.isBlockComment)==null?void 0:p.call(u,n);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||ee(i,a(n),{backwards:!0})){let m=hi(i,a(n));return{doc:Xn([F,m?F:"",s]),isBlock:o,hasLineSuffix:!0}}return!o||r!=null&&r.hasLineSuffix?{doc:[Xn([" ",s]),Ce],isBlock:o,hasLineSuffix:!0}:{doc:[" ",s],isBlock:o,hasLineSuffix:!1}}function N(e,t,r={}){let{node:n}=e;if(!O(n==null?void 0:n.comments))return"";let{indent:s=!1,marker:u,filter:i=Tc}=r,a=[];if(e.each(({node:p})=>{p.leading||p.trailing||p.marker!==u||!i(p)||a.push(ys(e,t))},"comments"),a.length===0)return"";let o=b(F,a);return s?D([F,o]):o}function fs(e,t){let r=e.node;if(!r)return{};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(o=>!n.has(o)).length===0)return{leading:"",trailing:""};let u=[],i=[],a;return e.each(()=>{let o=e.node;if(n!=null&&n.has(o))return;let{leading:p,trailing:m}=o;p?u.push(xc(e,t)):m&&(a=hc(e,t,a),i.push(a.doc))},"comments"),{leading:u,trailing:i}}function Ee(e,t,r){let{leading:n,trailing:s}=fs(e,r);return!n&&!s?t:lr(t,u=>[n,u,s])}var Ds=class extends Error{name="UnexpectedNodeError";constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`),this.node=t}},qe=Ds;function Es(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var We,Fs=class{constructor(t){Ys(this,We);Hs(this,We,new Set(t))}getLeadingWhitespaceCount(t){let r=mt(this,We),n=0;for(let s=0;s=0&&r.has(t.charAt(s));s--)n++;return n}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return mt(this,We).has(t.charAt(0))}hasTrailingWhitespace(t){return mt(this,We).has(v(!1,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let n=`[${Es([...mt(this,We)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return t.split(s)}hasWhitespaceCharacter(t){let r=mt(this,We);return Array.prototype.some.call(t,n=>r.has(n))}hasNonWhitespaceCharacter(t){let r=mt(this,We);return Array.prototype.some.call(t,n=>!r.has(n))}isWhitespaceOnly(t){let r=mt(this,We);return Array.prototype.every.call(t,n=>r.has(n))}};We=new WeakMap;var gi=Fs;var Hr=new gi(` -\r `),Cs=e=>e===""||e===x||e===F||e===E;function gc(e,t,r){var _,M,J,I,q;let{node:n}=e;if(n.type==="JSXElement"&&Jc(n))return[r("openingElement"),r("closingElement")];let s=n.type==="JSXElement"?r("openingElement"):r("openingFragment"),u=n.type==="JSXElement"?r("closingElement"):r("closingFragment");if(n.children.length===1&&n.children[0].type==="JSXExpressionContainer"&&(n.children[0].expression.type==="TemplateLiteral"||n.children[0].expression.type==="TaggedTemplateExpression"))return[s,...e.map(r,"children"),u];n.children=n.children.map(k=>Nc(k)?{type:"JSXText",value:" ",raw:" "}:k);let i=n.children.some(Y),a=n.children.filter(k=>k.type==="JSXExpressionContainer").length>1,o=n.type==="JSXElement"&&n.openingElement.attributes.length>1,p=re(s)||i||o||a,m=e.parent.rootMarker==="mdx",f=t.singleQuote?"{' '}":'{" "}',y=m?x:S([f,E]," "),C=((M=(_=n.openingElement)==null?void 0:_.name)==null?void 0:M.name)==="fbt",c=Sc(e,t,r,y,C),A=n.children.some(k=>fr(k));for(let k=c.length-2;k>=0;k--){let W=c[k]===""&&c[k+1]==="",ne=c[k]===F&&c[k+1]===""&&c[k+2]===F,Z=(c[k]===E||c[k]===F)&&c[k+1]===""&&c[k+2]===y,lt=c[k]===y&&c[k+1]===""&&(c[k+2]===E||c[k+2]===F),L=c[k]===y&&c[k+1]===""&&c[k+2]===y,se=c[k]===E&&c[k+1]===""&&c[k+2]===F||c[k]===F&&c[k+1]===""&&c[k+2]===E;ne&&A||W||Z||L||se?c.splice(k,2):lt&&c.splice(k+1,2)}for(;c.length>0&&Cs(v(!1,c,-1));)c.pop();for(;c.length>1&&Cs(c[0])&&Cs(c[1]);)c.shift(),c.shift();let T=[""];for(let[k,W]of c.entries()){if(W===y){if(k===1&&wu(c[k-1])){if(c.length===2){T.push([T.pop(),f]);continue}T.push([f,F],"");continue}else if(k===c.length-1){T.push([T.pop(),f]);continue}else if(c[k-1]===""&&c[k-2]===F){T.push([T.pop(),f]);continue}}k%2===0?T.push([T.pop(),W]):T.push(W,""),re(W)&&(p=!0)}let B=A?Nr(T):l(T,{shouldBreak:!0});if(((J=t.cursorNode)==null?void 0:J.type)==="JSXText"&&n.children.includes(t.cursorNode)?B=[mr,B,mr]:((I=t.nodeBeforeCursor)==null?void 0:I.type)==="JSXText"&&n.children.includes(t.nodeBeforeCursor)?B=[mr,B]:((q=t.nodeAfterCursor)==null?void 0:q.type)==="JSXText"&&n.children.includes(t.nodeAfterCursor)&&(B=[B,mr]),m)return B;let g=l([s,D([F,B]),F,u]);return p?g:tt([l([s,...c,u]),g])}function Sc(e,t,r,n,s){let u="",i=[u];function a(p){u=p,i.push([i.pop(),p])}function o(p){p!==""&&(u=p,i.push(p,""))}return e.each(({node:p,next:m})=>{if(p.type==="JSXText"){let f=ae(p);if(fr(p)){let y=Hr.split(f,!0);y[0]===""&&(y.shift(),/\n/u.test(y[0])?o(Bi(s,y[1],p,m)):o(n),y.shift());let C;if(v(!1,y,-1)===""&&(y.pop(),C=y.pop()),y.length===0)return;for(let[c,A]of y.entries())c%2===1?o(x):a(A);C!==void 0?/\n/u.test(C)?o(Bi(s,u,p,m)):o(n):o(Si(s,u,p,m))}else/\n/u.test(f)?f.match(/\n/gu).length>1&&o(F):o(n)}else{let f=r();if(a(f),m&&fr(m)){let C=Hr.trim(ae(m)),[c]=Hr.split(C);o(Si(s,c,p,m))}else o(F)}},"children"),i}function Si(e,t,r,n){return e?"":r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?t.length===1?E:F:E}function Bi(e,t,r,n){return e?F:t.length===1?r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?F:E:F}var Bc=new Set(["ArrayExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function bc(e,t,r){let{parent:n}=e;if(Bc.has(n.type))return t;let s=Pc(e),u=Le(e,r);return l([u?"":S("("),D([E,t]),E,u?"":S(")")],{shouldBreak:s})}function Pc(e){return e.match(void 0,t=>t.type==="ArrowFunctionExpression",w)&&(e.match(void 0,void 0,void 0,t=>t.type==="JSXExpressionContainer")||e.match(void 0,void 0,void 0,t=>t.type==="ChainExpression",t=>t.type==="JSXExpressionContainer"))}function kc(e,t,r){let{node:n}=e,s=[];if(s.push(r("name")),n.value){let u;if(K(n.value)){let i=ae(n.value),a=X(!1,X(!1,i.slice(1,-1),"'","'"),""",'"'),o=Sr(a,t.jsxSingleQuote);a=o==='"'?X(!1,a,'"',"""):X(!1,a,"'","'"),u=e.call(()=>Ee(e,ve(o+a+o),t),"value")}else u=r("value");s.push("=",u)}return s}function Ic(e,t,r){let{node:n}=e,s=(u,i)=>u.type==="JSXEmptyExpression"||!d(u)&&(U(u)||ue(u)||u.type==="ArrowFunctionExpression"||u.type==="AwaitExpression"&&(s(u.argument,u)||u.argument.type==="JSXElement")||w(u)||u.type==="ChainExpression"&&w(u.expression)||u.type==="FunctionExpression"||u.type==="TemplateLiteral"||u.type==="TaggedTemplateExpression"||u.type==="DoExpression"||Y(i)&&(u.type==="ConditionalExpression"||Fe(u)));return s(n.expression,e.parent)?l(["{",r("expression"),je,"}"]):l(["{",D([E,r("expression")]),E,je,"}"])}function Lc(e,t,r){var a,o;let{node:n}=e,s=d(n.name)||d(n.typeParameters)||d(n.typeArguments);if(n.selfClosing&&n.attributes.length===0&&!s)return["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," />"];if(((a=n.attributes)==null?void 0:a.length)===1&&K(n.attributes[0].value)&&!n.attributes[0].value.value.includes(` -`)&&!s&&!d(n.attributes[0]))return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," ",...e.map(r,"attributes"),n.selfClosing?" />":">"]);let u=(o=n.attributes)==null?void 0:o.some(p=>K(p.value)&&p.value.value.includes(` -`)),i=t.singleAttributePerLine&&n.attributes.length>1?F:x;return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters"),D(e.map(()=>[i,r()],"attributes")),...wc(n,t,s)],{shouldBreak:u})}function wc(e,t,r){return e.selfClosing?[x,"/>"]:Oc(e,t,r)?[">"]:[E,">"]}function Oc(e,t,r){let n=e.attributes.length>0&&d(v(!1,e.attributes,-1),h.Trailing);return e.attributes.length===0&&!r||(t.bracketSameLine||t.jsxBracketSameLine)&&(!r||e.attributes.length>0)&&!n}function _c(e,t,r){let{node:n}=e,s=[];s.push(""),s}function Mc(e,t){let{node:r}=e,n=d(r),s=d(r,h.Line),u=r.type==="JSXOpeningFragment";return[u?"<":""]}function vc(e,t,r){let n=Ee(e,gc(e,t,r),t);return bc(e,n,t)}function jc(e,t){let{node:r}=e,n=d(r,h.Line);return[N(e,t,{indent:n}),n?F:""]}function Rc(e,t,r){let{node:n}=e;return["{",e.call(({node:s})=>{let u=["...",r()];return!d(s)||!rs(e)?u:[D([E,Ee(e,u,t)]),E]},n.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function bi(e,t,r){let{node:n}=e;if(n.type.startsWith("JSX"))switch(n.type){case"JSXAttribute":return kc(e,t,r);case"JSXIdentifier":return n.name;case"JSXNamespacedName":return b(":",[r("namespace"),r("name")]);case"JSXMemberExpression":return b(".",[r("object"),r("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return Rc(e,t,r);case"JSXExpressionContainer":return Ic(e,t,r);case"JSXFragment":case"JSXElement":return vc(e,t,r);case"JSXOpeningElement":return Lc(e,t,r);case"JSXClosingElement":return _c(e,t,r);case"JSXOpeningFragment":case"JSXClosingFragment":return Mc(e,t);case"JSXEmptyExpression":return jc(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new qe(n,"JSX")}}function Jc(e){if(e.children.length===0)return!0;if(e.children.length>1)return!1;let t=e.children[0];return t.type==="JSXText"&&!fr(t)}function fr(e){return e.type==="JSXText"&&(Hr.hasNonWhitespaceCharacter(ae(e))||!/\n/u.test(ae(e)))}function Nc(e){return e.type==="JSXExpressionContainer"&&K(e.expression)&&e.expression.value===" "&&!d(e.expression)}function Pi(e){let{node:t,parent:r}=e;if(!Y(t)||!Y(r))return!1;let{index:n,siblings:s}=e,u;for(let i=n;i>0;i--){let a=s[i-1];if(!(a.type==="JSXText"&&!fr(a))){u=a;break}}return(u==null?void 0:u.type)==="JSXExpressionContainer"&&u.expression.type==="JSXEmptyExpression"&&kt(u.expression)}function Gc(e){return kt(e.node)||Pi(e)}var Vr=Gc;var qc=0;function $r(e,t,r){var M;let{node:n,parent:s,grandparent:u,key:i}=e,a=i!=="body"&&(s.type==="IfStatement"||s.type==="WhileStatement"||s.type==="SwitchStatement"||s.type==="DoWhileStatement"),o=n.operator==="|>"&&((M=e.root.extra)==null?void 0:M.__isUsingHackPipeline),p=As(e,t,r,!1,a);if(a)return p;if(o)return l(p);if(w(s)&&s.callee===n||s.type==="UnaryExpression"||G(s)&&!s.computed)return l([D([E,...p]),E]);let m=s.type==="ReturnStatement"||s.type==="ThrowStatement"||s.type==="JSXExpressionContainer"&&u.type==="JSXAttribute"||n.operator!=="|"&&s.type==="JsExpressionRoot"||n.type!=="NGPipeExpression"&&(s.type==="NGRoot"&&t.parser==="__ng_binding"||s.type==="NGMicrosyntaxExpression"&&u.type==="NGMicrosyntax"&&u.body.length===1)||n===s.body&&s.type==="ArrowFunctionExpression"||n!==s.body&&s.type==="ForStatement"||s.type==="ConditionalExpression"&&u.type!=="ReturnStatement"&&u.type!=="ThrowStatement"&&!w(u)||s.type==="TemplateLiteral",f=s.type==="AssignmentExpression"||s.type==="VariableDeclarator"||s.type==="ClassProperty"||s.type==="PropertyDefinition"||s.type==="TSAbstractPropertyDefinition"||s.type==="ClassPrivateProperty"||Te(s),y=Fe(n.left)&&ar(n.operator,n.left.operator);if(m||Ht(n)&&!y||!Ht(n)&&f)return l(p);if(p.length===0)return"";let C=Y(n.right),c=p.findIndex(J=>typeof J!="string"&&!Array.isArray(J)&&J.type===fe),A=p.slice(0,c===-1?1:c+1),T=p.slice(A.length,C?-1:void 0),B=Symbol("logicalChain-"+ ++qc),g=l([...A,D(T)],{id:B});if(!C)return g;let _=v(!1,p,-1);return l([g,xt(_,{groupId:B})])}function As(e,t,r,n,s){var B;let{node:u}=e;if(!Fe(u))return[l(r())];let i=[];ar(u.operator,u.left.operator)?i=e.call(g=>As(g,t,r,!0,s),"left"):i.push(l(r("left")));let a=Ht(u),o=(u.operator==="|>"||u.type==="NGPipeExpression"||Wc(e,t))&&!de(t.originalText,u.right),m=!d(u.right,h.Leading,Gr)&&de(t.originalText,u.right),f=u.type==="NGPipeExpression"?"|":u.operator,y=u.type==="NGPipeExpression"&&u.arguments.length>0?l(D([E,": ",b([x,": "],e.map(()=>be(2,l(r())),"arguments"))])):"",C;if(a)C=[f,de(t.originalText,u.right)?D([x,r("right"),y]):[" ",r("right"),y]];else{let _=f==="|>"&&((B=e.root.extra)==null?void 0:B.__isUsingHackPipeline)?e.call(M=>As(M,t,r,!0,s),"right"):r("right");if(t.experimentalOperatorPosition==="start"){let M="";if(m)switch(Be(_)){case ge:M=_.splice(0,1)[0];break;case Se:M=_.contents.splice(0,1)[0];break}C=[x,M,f," ",_,y]}else C=[o?x:"",f,o?" ":x,_,y]}let{parent:c}=e,A=d(u.left,h.Trailing|h.Line);if((A||!(s&&u.type==="LogicalExpression")&&c.type!==u.type&&u.left.type!==u.type&&u.right.type!==u.type)&&(C=l(C,{shouldBreak:A})),t.experimentalOperatorPosition==="start"?i.push(a||m?" ":"",C):i.push(o?"":" ",C),n&&d(u)){let g=Ut(Ee(e,i,t));return g.type===_e?g.parts:Array.isArray(g)?g:[g]}return i}function Ht(e){return e.type!=="LogicalExpression"?!1:!!(ue(e.right)&&e.right.properties.length>0||U(e.right)&&e.right.elements.length>0||Y(e.right))}var ki=e=>e.type==="BinaryExpression"&&e.operator==="|";function Wc(e,t){return(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression")&&ki(e.node)&&!e.hasAncestor(r=>!ki(r)&&r.type!=="JsExpressionRoot")}function Li(e,t,r){let{node:n}=e;if(n.type.startsWith("NG"))switch(n.type){case"NGRoot":return[r("node"),d(n.node)?" //"+Ve(n.node)[0].value.trimEnd():""];case"NGPipeExpression":return $r(e,t,r);case"NGChainedExpression":return l(b([";",x],e.map(()=>Yc(e)?r():["(",r(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return e.map(()=>[e.isFirst?"":Ii(e)?" ":[";",x],r()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(n.name)?n.name:JSON.stringify(n.name);case"NGMicrosyntaxExpression":return[r("expression"),n.alias===null?"":[" as ",r("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:s,parent:u}=e,i=Ii(e)||Uc(e)||(s===1&&(n.key.name==="then"||n.key.name==="else"||n.key.name==="as")||s===2&&(n.key.name==="else"&&u.body[s-1].type==="NGMicrosyntaxKeyedExpression"&&u.body[s-1].key.name==="then"||n.key.name==="track"))&&u.body[0].type==="NGMicrosyntaxExpression";return[r("key"),i?" ":": ",r("expression")]}case"NGMicrosyntaxLet":return["let ",r("key"),n.value===null?"":[" = ",r("value")]];case"NGMicrosyntaxAs":return[r("key")," as ",r("alias")];default:throw new qe(n,"Angular")}}function Ii({node:e,index:t}){return e.type==="NGMicrosyntaxKeyedExpression"&&e.key.name==="of"&&t===1}function Uc(e){let{node:t}=e;return e.parent.body[1].key.name==="of"&&t.type==="NGMicrosyntaxKeyedExpression"&&t.key.name==="track"&&t.key.type==="NGMicrosyntaxKey"}var Xc=R(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function Yc({node:e}){return ur(e,Xc)}function ds(e,t,r){let{node:n}=e;return l([b(x,e.map(r,"decorators")),_i(n,t)?F:x])}function wi(e,t,r){return Mi(e.node)?[b(F,e.map(r,"declaration","decorators")),F]:""}function Oi(e,t,r){let{node:n,parent:s}=e,{decorators:u}=n;if(!O(u)||Mi(s)||Vr(e))return"";let i=n.type==="ClassExpression"||n.type==="ClassDeclaration"||_i(n,t);return[e.key==="declaration"&&yu(s)?F:i?Ce:"",b(x,e.map(r,"decorators")),x]}function _i(e,t){return e.decorators.some(r=>ee(t.originalText,P(r)))}function Mi(e){var r;if(e.type!=="ExportDefaultDeclaration"&&e.type!=="ExportNamedDeclaration"&&e.type!=="DeclareExportDeclaration")return!1;let t=(r=e.declaration)==null?void 0:r.decorators;return O(t)&&Bt(e,t[0])}var Dt=class extends Error{name="ArgExpansionBailout"};function Hc(e,t,r){let{node:n}=e,s=le(n);if(s.length===0)return["(",N(e,t),")"];let u=s.length-1;if(Kc(s)){let f=["("];return Gt(e,(y,C)=>{f.push(r()),C!==u&&f.push(", ")}),f.push(")"),f}let i=!1,a=[];Gt(e,({node:f},y)=>{let C=r();y===u||(me(f,t)?(i=!0,C=[C,",",F,F]):C=[C,",",x]),a.push(C)});let o=!t.parser.startsWith("__ng_")&&n.type!=="ImportExpression"&&n.type!=="TSImportType"&&ce(t,"all")?",":"";if(n.type==="TSImportType"&&s.length===1&&(s[0].type==="TSLiteralType"&&K(s[0].literal)||K(s[0]))&&!d(s[0]))return l(["(",...a,S(o),")"]);function p(){return l(["(",D([x,...a]),o,x,")"],{shouldBreak:!0})}if(i||e.parent.type!=="Decorator"&&Au(s))return p();if($c(s)){let f=a.slice(1);if(f.some(re))return p();let y;try{y=r(Gn(n,0),{expandFirstArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(y)?[Ce,tt([["(",l(y,{shouldBreak:!0}),", ",...f,")"],p()])]:tt([["(",y,", ",...f,")"],["(",l(y,{shouldBreak:!0}),", ",...f,")"],p()])}if(Vc(s,a,t)){let f=a.slice(0,-1);if(f.some(re))return p();let y;try{y=r(Gn(n,-1),{expandLastArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(y)?[Ce,tt([["(",...f,l(y,{shouldBreak:!0}),")"],p()])]:tt([["(",...f,y,")"],["(",...f,l(y,{shouldBreak:!0}),")"],p()])}let m=["(",D([E,...a]),S(o),E,")"];return vr(e)?m:l(m,{shouldBreak:a.some(re)||i})}function Dr(e,t=!1){return ue(e)&&(e.properties.length>0||d(e))||U(e)&&(e.elements.length>0||d(e))||e.type==="TSTypeAssertion"&&Dr(e.expression)||xe(e)&&Dr(e.expression)||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&(!e.returnType||!e.returnType.typeAnnotation||e.returnType.typeAnnotation.type!=="TSTypeReference"||Qc(e.body))&&(e.body.type==="BlockStatement"||e.body.type==="ArrowFunctionExpression"&&Dr(e.body,!0)||ue(e.body)||U(e.body)||!t&&(w(e.body)||e.body.type==="ConditionalExpression")||Y(e.body))||e.type==="DoExpression"||e.type==="ModuleExpression"}function Vc(e,t,r){var u,i;let n=v(!1,e,-1);if(e.length===1){let a=v(!1,t,-1);if((u=a.label)!=null&&u.embed&&((i=a.label)==null?void 0:i.hug)!==!1)return!0}let s=v(!1,e,-2);return!d(n,h.Leading)&&!d(n,h.Trailing)&&Dr(n)&&(!s||s.type!==n.type)&&(e.length!==2||s.type!=="ArrowFunctionExpression"||!U(n))&&!(e.length>1&&Ts(n,r))}function $c(e){if(e.length!==2)return!1;let[t,r]=e;return t.type==="ModuleExpression"&&zc(r)?!0:!d(t)&&(t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement")&&r.type!=="FunctionExpression"&&r.type!=="ArrowFunctionExpression"&&r.type!=="ConditionalExpression"&&ji(r)&&!Dr(r)}function ji(e){if(e.type==="ParenthesizedExpression")return ji(e.expression);if(xe(e)||e.type==="TypeCastExpression"){let{typeAnnotation:t}=e;if(t.type==="TypeAnnotation"&&(t=t.typeAnnotation),t.type==="TSArrayType"&&(t=t.elementType,t.type==="TSArrayType"&&(t=t.elementType)),t.type==="GenericTypeAnnotation"||t.type==="TSTypeReference"){let r=t.typeArguments??t.typeParameters;(r==null?void 0:r.params.length)===1&&(t=r.params[0])}return Nt(t)&&we(e.expression,1)}return yt(e)&&le(e).length>1?!1:Fe(e)?we(e.left,1)&&we(e.right,1):Jn(e)||we(e)}function Kc(e){return e.length===2?vi(e,0):e.length===3?e[0].type==="Identifier"&&vi(e,1):!1}function vi(e,t){let r=e[t],n=e[t+1];return r.type==="ArrowFunctionExpression"&&Q(r).length===0&&r.body.type==="BlockStatement"&&n.type==="ArrayExpression"&&!e.some(s=>d(s))}function Qc(e){return e.type==="BlockStatement"&&(e.body.some(t=>t.type!=="EmptyStatement")||d(e,h.Dangling))}function zc(e){if(!(e.type==="ObjectExpression"&&e.properties.length===1))return!1;let[t]=e.properties;return Te(t)?!t.computed&&(t.key.type==="Identifier"&&t.key.name==="type"||K(t.key)&&t.key.value==="type")&&K(t.value)&&t.value.value==="module":!1}var Lt=Hc;var Zc=e=>((e.type==="ChainExpression"||e.type==="TSNonNullExpression")&&(e=e.expression),w(e)&&le(e).length>0);function Ri(e,t,r){var p;let n=r("object"),s=xs(e,t,r),{node:u}=e,i=e.findAncestor(m=>!(G(m)||m.type==="TSNonNullExpression")),a=e.findAncestor(m=>!(m.type==="ChainExpression"||m.type==="TSNonNullExpression")),o=i&&(i.type==="NewExpression"||i.type==="BindExpression"||i.type==="AssignmentExpression"&&i.left.type!=="Identifier")||u.computed||u.object.type==="Identifier"&&u.property.type==="Identifier"&&!G(a)||(a.type==="AssignmentExpression"||a.type==="VariableDeclarator")&&(Zc(u.object)||((p=n.label)==null?void 0:p.memberChain));return at(n.label,[n,o?s:l(D([E,s]))])}function xs(e,t,r){let n=r("property"),{node:s}=e,u=V(e);return s.computed?!s.property||ye(s.property)?[u,"[",n,"]"]:l([u,"[",D([E,n]),E,"]"]):[u,".",n]}function Ji(e,t,r){if(e.node.type==="ChainExpression")return e.call(()=>Ji(e,t,r),"expression");let n=(e.parent.type==="ChainExpression"?e.grandparent:e.parent).type==="ExpressionStatement",s=[];function u(L){let{originalText:se}=t,Ae=ot(se,P(L));return se.charAt(Ae)===")"?Ae!==!1&&vt(se,Ae+1):me(L,t)}function i(){let{node:L}=e;if(L.type==="ChainExpression")return e.call(i,"expression");if(w(L)&&(dt(L.callee)||w(L.callee))){let se=u(L);s.unshift({node:L,hasTrailingEmptyLine:se,printed:[Ee(e,[V(e),rt(e,t,r),Lt(e,t,r)],t),se?F:""]}),e.call(i,"callee")}else dt(L)?(s.unshift({node:L,needsParens:Le(e,t),printed:Ee(e,G(L)?xs(e,t,r):Kr(e,t,r),t)}),e.call(i,"object")):L.type==="TSNonNullExpression"?(s.unshift({node:L,printed:Ee(e,"!",t)}),e.call(i,"expression")):s.unshift({node:L,printed:r()})}let{node:a}=e;s.unshift({node:a,printed:[V(e),rt(e,t,r),Lt(e,t,r)]}),a.callee&&e.call(i,"callee");let o=[],p=[s[0]],m=1;for(;m0&&o.push(p);function y(L){return/^[A-Z]|^[$_]+$/u.test(L)}function C(L){return L.length<=t.tabWidth}function c(L){var Ot;let se=(Ot=L[1][0])==null?void 0:Ot.node.computed;if(L[0].length===1){let nt=L[0][0].node;return nt.type==="ThisExpression"||nt.type==="Identifier"&&(y(nt.name)||n&&C(nt.name)||se)}let Ae=v(!1,L[0],-1).node;return G(Ae)&&Ae.property.type==="Identifier"&&(y(Ae.property.name)||se)}let A=o.length>=2&&!d(o[1][0].node)&&c(o);function T(L){let se=L.map(Ae=>Ae.printed);return L.length>0&&v(!1,L,-1).needsParens?["(",...se,")"]:se}function B(L){return L.length===0?"":D([F,b(F,L.map(T))])}let g=o.map(T),_=g,M=A?3:2,J=o.flat(),I=J.slice(1,-1).some(L=>d(L.node,h.Leading))||J.slice(0,-1).some(L=>d(L.node,h.Trailing))||o[M]&&d(o[M][0].node,h.Leading);if(o.length<=M&&!I&&!o.some(L=>v(!1,L,-1).hasTrailingEmptyLine))return vr(e)?_:l(_);let q=v(!1,o[A?1:0],-1).node,k=!w(q)&&u(q),W=[T(o[0]),A?o.slice(1,2).map(T):"",k?F:"",B(o.slice(A?2:1))],ne=s.map(({node:L})=>L).filter(w);function Z(){let L=v(!1,v(!1,o,-1),-1).node,se=v(!1,g,-1);return w(L)&&re(se)&&ne.slice(0,-1).some(Ae=>Ae.arguments.some(Rt))}let lt;return I||ne.length>2&&ne.some(L=>!L.arguments.every(se=>we(se)))||g.slice(0,-1).some(re)||Z()?lt=l(W):lt=[re(_)||k?Ce:"",tt([_,W])],at({memberChain:!0},lt)}var Ni=Ji;function Qr(e,t,r){var m;let{node:n}=e,s=n.type==="NewExpression",u=n.type==="ImportExpression",i=V(e),a=le(n),o=a.length===1&&_r(a[0],t.originalText);if(o||el(e)||Pt(n,e.parent)){let f=[];if(Gt(e,()=>{f.push(r())}),!(o&&((m=f[0].label)!=null&&m.embed)))return[s?"new ":"",Gi(e,r),i,rt(e,t,r),"(",b(", ",f),")"]}if(!u&&!s&&dt(n.callee)&&!e.call(f=>Le(f,t),"callee",...n.callee.type==="ChainExpression"?["expression"]:[]))return Ni(e,t,r);let p=[s?"new ":"",Gi(e,r),i,rt(e,t,r),Lt(e,t,r)];return u||w(n.callee)?l(p):p}function Gi(e,t){let{node:r}=e;return r.type==="ImportExpression"?`import${r.phase?`.${r.phase}`:""}`:t("callee")}function el(e){let{node:t}=e;if(t.type!=="CallExpression"||t.optional||t.callee.type!=="Identifier")return!1;let r=le(t);return t.callee.name==="require"?r.length===1&&K(r[0])||r.length>1:t.callee.name==="define"&&e.parent.type==="ExpressionStatement"?r.length===1||r.length===2&&r[0].type==="ArrayExpression"||r.length===3&&K(r[0])&&r[1].type==="ArrayExpression":!1}function ht(e,t,r,n,s,u){let i=tl(e,t,r,n,u),a=u?r(u,{assignmentLayout:i}):"";switch(i){case"break-after-operator":return l([l(n),s,l(D([x,a]))]);case"never-break-after-operator":return l([l(n),s," ",a]);case"fluid":{let o=Symbol("assignment");return l([l(n),s,l(D(x),{id:o}),je,xt(a,{groupId:o})])}case"break-lhs":return l([n,s," ",l(a)]);case"chain":return[l(n),s,x,a];case"chain-tail":return[l(n),s,D([x,a])];case"chain-tail-arrow-chain":return[l(n),s,a];case"only-left":return n}}function Wi(e,t,r){let{node:n}=e;return ht(e,t,r,r("left"),[" ",n.operator],"right")}function Ui(e,t,r){return ht(e,t,r,r("id")," =","init")}function tl(e,t,r,n,s){let{node:u}=e,i=u[s];if(!i)return"only-left";let a=!zr(i);if(e.match(zr,Xi,y=>!a||y.type!=="ExpressionStatement"&&y.type!=="VariableDeclaration"))return a?i.type==="ArrowFunctionExpression"&&i.body.type==="ArrowFunctionExpression"?"chain-tail-arrow-chain":"chain-tail":"chain";if(!a&&zr(i.right)||de(t.originalText,i))return"break-after-operator";if(u.type==="ImportAttribute"||i.type==="CallExpression"&&i.callee.name==="require"||t.parser==="json5"||t.parser==="jsonc"||t.parser==="json")return"never-break-after-operator";let m=Lu(n);if(nl(u)||al(u)||hs(u)&&m)return"break-lhs";let f=pl(u,n,t);return e.call(()=>rl(e,t,r,f),s)?"break-after-operator":sl(u)?"break-lhs":!m&&(f||i.type==="TemplateLiteral"||i.type==="TaggedTemplateExpression"||Du(i)||ye(i)||i.type==="ClassExpression")?"never-break-after-operator":"fluid"}function rl(e,t,r,n){let s=e.node;if(Fe(s)&&!Ht(s))return!0;switch(s.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!t.experimentalTernaries&&!ml(s))break;return!0;case"ConditionalExpression":{if(!t.experimentalTernaries){let{test:p}=s;return Fe(p)&&!Ht(p)}let{consequent:a,alternate:o}=s;return a.type==="ConditionalExpression"||o.type==="ConditionalExpression"}case"ClassExpression":return O(s.decorators)}if(n)return!1;let u=s,i=[];for(;;)if(u.type==="UnaryExpression"||u.type==="AwaitExpression"||u.type==="YieldExpression"&&u.argument!==null)u=u.argument,i.push("argument");else if(u.type==="TSNonNullExpression")u=u.expression,i.push("expression");else break;return!!(K(u)||e.call(()=>Yi(e,t,r),...i))}function nl(e){if(Xi(e)){let t=e.left||e.id;return t.type==="ObjectPattern"&&t.properties.length>2&&t.properties.some(r=>{var n;return Te(r)&&(!r.shorthand||((n=r.value)==null?void 0:n.type)==="AssignmentPattern")})}return!1}function zr(e){return e.type==="AssignmentExpression"}function Xi(e){return zr(e)||e.type==="VariableDeclarator"}function sl(e){let t=il(e);if(O(t)){let r=e.type==="TSTypeAliasDeclaration"?"constraint":"bound";if(t.length>1&&t.some(n=>n[r]||n.default))return!0}return!1}var ul=R(["TSTypeAliasDeclaration","TypeAlias"]);function il(e){var t;if(ul(e))return(t=e.typeParameters)==null?void 0:t.params}function al(e){if(e.type!=="VariableDeclarator")return!1;let{typeAnnotation:t}=e.id;if(!t||!t.typeAnnotation)return!1;let r=qi(t.typeAnnotation);return O(r)&&r.length>1&&r.some(n=>O(qi(n))||n.type==="TSConditionalType")}function hs(e){var t;return e.type==="VariableDeclarator"&&((t=e.init)==null?void 0:t.type)==="ArrowFunctionExpression"}var ol=R(["TSTypeReference","GenericTypeAnnotation"]);function qi(e){var t;if(ol(e))return(t=e.typeArguments??e.typeParameters)==null?void 0:t.params}function Yi(e,t,r,n=!1){var i;let{node:s}=e,u=()=>Yi(e,t,r,!0);if(s.type==="ChainExpression"||s.type==="TSNonNullExpression")return e.call(u,"expression");if(w(s)){if((i=Qr(e,t,r).label)!=null&&i.memberChain)return!1;let o=le(s);return!(o.length===0||o.length===1&&ir(o[0],t))||cl(s,r)?!1:e.call(u,"callee")}return G(s)?e.call(u,"object"):n&&(s.type==="Identifier"||s.type==="ThisExpression")}function pl(e,t,r){return Te(e)?(t=Ut(t),typeof t=="string"&&st(t)1)return!0;if(r.length===1){let s=r[0];if(Oe(s)||qt(s)||s.type==="TSTypeLiteral"||s.type==="ObjectTypeAnnotation")return!0}let n=e.typeParameters?"typeParameters":"typeArguments";if(re(t(n)))return!0}return!1}function ll(e){var t;return(t=e.typeParameters??e.typeArguments)==null?void 0:t.params}function ml(e){function t(r){switch(r.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":return!!r.typeParameters;case"TSTypeReference":return!!(r.typeArguments??r.typeParameters);default:return!1}}return t(e.checkType)||t(e.extendsType)}function Ue(e,t,r,n,s){let u=e.node,i=Q(u),a=s?rt(e,t,r):"";if(i.length===0)return[a,"(",N(e,t,{filter:c=>ke(t.originalText,P(c))===")"}),")"];let{parent:o}=e,p=Pt(o),m=gs(u),f=[];if(hu(e,(c,A)=>{let T=A===i.length-1;T&&u.rest&&f.push("..."),f.push(r()),!T&&(f.push(","),p||m?f.push(" "):me(i[A],t)?f.push(F,F):f.push(x))}),n&&!fl(e)){if(re(a)||re(f))throw new Dt;return l([cr(a),"(",cr(f),")"])}let y=i.every(c=>!O(c.decorators));return m&&y?[a,"(",...f,")"]:p?[a,"(",...f,")"]:(Or(o)||Eu(o)||o.type==="TypeAlias"||o.type==="UnionTypeAnnotation"||o.type==="IntersectionTypeAnnotation"||o.type==="FunctionTypeAnnotation"&&o.returnType===u)&&i.length===1&&i[0].name===null&&u.this!==i[0]&&i[0].typeAnnotation&&u.typeParameters===null&&Nt(i[0].typeAnnotation)&&!u.rest?t.arrowParens==="always"||u.type==="HookTypeAnnotation"?["(",...f,")"]:f:[a,"(",D([E,...f]),S(!xu(u)&&ce(t,"all")?",":""),E,")"]}function gs(e){if(!e)return!1;let t=Q(e);if(t.length!==1)return!1;let[r]=t;return!d(r)&&(r.type==="ObjectPattern"||r.type==="ArrayPattern"||r.type==="Identifier"&&r.typeAnnotation&&(r.typeAnnotation.type==="TypeAnnotation"||r.typeAnnotation.type==="TSTypeAnnotation")&&Re(r.typeAnnotation.typeAnnotation)||r.type==="FunctionTypeParam"&&Re(r.typeAnnotation)&&r!==e.rest||r.type==="AssignmentPattern"&&(r.left.type==="ObjectPattern"||r.left.type==="ArrayPattern")&&(r.right.type==="Identifier"||ue(r.right)&&r.right.properties.length===0||U(r.right)&&r.right.elements.length===0))}function yl(e){let t;return e.returnType?(t=e.returnType,t.typeAnnotation&&(t=t.typeAnnotation)):e.typeAnnotation&&(t=e.typeAnnotation),t}function ct(e,t){var s;let r=yl(e);if(!r)return!1;let n=(s=e.typeParameters)==null?void 0:s.params;if(n){if(n.length>1)return!1;if(n.length===1){let u=n[0];if(u.constraint||u.default)return!1}}return Q(e).length===1&&(Re(r)||re(t))}function fl(e){return e.match(t=>t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement",(t,r)=>{if(t.type==="CallExpression"&&r==="arguments"&&t.arguments.length===1&&t.callee.type==="CallExpression"){let n=t.callee.callee;return n.type==="Identifier"||n.type==="MemberExpression"&&!n.computed&&n.object.type==="Identifier"&&n.property.type==="Identifier"}return!1},(t,r)=>t.type==="VariableDeclarator"&&r==="init"||t.type==="ExportDefaultDeclaration"&&r==="declaration"||t.type==="TSExportAssignment"&&r==="expression"||t.type==="AssignmentExpression"&&r==="right"&&t.left.type==="MemberExpression"&&t.left.object.type==="Identifier"&&t.left.object.name==="module"&&t.left.property.type==="Identifier"&&t.left.property.name==="exports",t=>t.type!=="VariableDeclaration"||t.kind==="const"&&t.declarations.length===1)}function Hi(e){let t=Q(e);return t.length>1&&t.some(r=>r.type==="TSParameterProperty")}var Dl=R(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),El=R(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function Fl(e){let{types:t}=e;if(t.some(n=>d(n)))return!1;let r=t.find(n=>El(n));return r?t.every(n=>n===r||Dl(n)):!1}function Ss(e){return Nt(e)||Re(e)?!0:Oe(e)?Fl(e):!1}function Vi(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[$(e),"opaque type ",r("id"),r("typeParameters")];return s.supertype&&u.push(": ",r("supertype")),s.impltype&&u.push(" = ",r("impltype")),u.push(n),u}function Zr(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[$(e)];u.push("type ",r("id"),r("typeParameters"));let i=s.type==="TSTypeAliasDeclaration"?"typeAnnotation":"right";return[ht(e,t,r,u," =",i),n]}function en(e,t,r){let n=!1;return l(e.map(({isFirst:s,previous:u,node:i,index:a})=>{let o=r();if(s)return o;let p=Re(i),m=Re(u);return m&&p?[" & ",n?D(o):o]:!m&&!p||de(t.originalText,i)?t.experimentalOperatorPosition==="start"?D([x,"& ",o]):D([" &",x,o]):(a>1&&(n=!0),[" & ",a>1?D(o):o])},"types"))}function tn(e,t,r){let{node:n}=e,{parent:s}=e,u=s.type!=="TypeParameterInstantiation"&&(!Je(s)||!t.experimentalTernaries)&&s.type!=="TSTypeParameterInstantiation"&&s.type!=="GenericTypeAnnotation"&&s.type!=="TSTypeReference"&&s.type!=="TSTypeAssertion"&&s.type!=="TupleTypeAnnotation"&&s.type!=="TSTupleType"&&!(s.type==="FunctionTypeParam"&&!s.name&&e.grandparent.this!==s)&&!((s.type==="TypeAlias"||s.type==="VariableDeclarator"||s.type==="TSTypeAliasDeclaration")&&de(t.originalText,n)),i=Ss(n),a=e.map(m=>{let f=r();return i||(f=be(2,f)),Ee(m,f,t)},"types");if(i)return b(" | ",a);let o=u&&!de(t.originalText,n),p=[S([o?x:"","| "]),b([x,"| "],a)];return Le(e,t)?l([D(p),E]):(s.type==="TupleTypeAnnotation"||s.type==="TSTupleType")&&s[s.type==="TupleTypeAnnotation"&&s.types?"types":"elementTypes"].length>1?l([D([S(["(",E]),p]),E,S(")")]):l(u?D(p):p)}function Cl(e){var n;let{node:t,parent:r}=e;return t.type==="FunctionTypeAnnotation"&&(Or(r)||!((r.type==="ObjectTypeProperty"||r.type==="ObjectTypeInternalSlot")&&!r.variance&&!r.optional&&Bt(r,t)||r.type==="ObjectTypeCallProperty"||((n=e.getParentNode(2))==null?void 0:n.type)==="DeclareFunction"))}function rn(e,t,r){let{node:n}=e,s=[Vt(e)];(n.type==="TSConstructorType"||n.type==="TSConstructSignatureDeclaration")&&s.push("new ");let u=Ue(e,t,r,!1,!0),i=[];return n.type==="FunctionTypeAnnotation"?i.push(Cl(e)?" => ":": ",r("returnType")):i.push(H(e,r,n.returnType?"returnType":"typeAnnotation")),ct(n,i)&&(u=l(u)),s.push(u,i),l(s)}function nn(e,t,r){return[r("objectType"),V(e),"[",r("indexType"),"]"]}function sn(e,t,r){return["infer ",r("typeParameter")]}function Bs(e,t,r){let{node:n}=e;return[n.postfix?"":r,H(e,t),n.postfix?r:""]}function un(e,t,r){let{node:n}=e;return["...",...n.type==="TupleTypeSpreadElement"&&n.label?[r("label"),": "]:[],r("typeAnnotation")]}function an(e,t,r){let{node:n}=e;return[n.variance?r("variance"):"",r("label"),n.optional?"?":"",": ",r("elementType")]}var Al=new WeakSet;function H(e,t,r="typeAnnotation"){let{node:{[r]:n}}=e;if(!n)return"";let s=!1;if(n.type==="TSTypeAnnotation"||n.type==="TypeAnnotation"){let u=e.call($i,r);(u==="=>"||u===":"&&d(n,h.Leading))&&(s=!0),Al.add(n)}return s?[" ",t(r)]:t(r)}var $i=e=>e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>(r==="returnType"||r==="typeAnnotation")&&(t.type==="TSFunctionType"||t.type==="TSConstructorType"))?"=>":e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>r==="typeAnnotation"&&(t.type==="TSJSDocNullableType"||t.type==="TSJSDocNonNullableType"||t.type==="TSTypePredicate"))||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareFunction")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareHook")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="bound"&&t.type==="TypeParameter"&&t.usesExtendsBound)?"":":";function on(e,t,r){let n=$i(e);return n?[n," ",r("typeAnnotation")]:r("typeAnnotation")}function pn(e){return[e("elementType"),"[]"]}function cn({node:e},t){let r=e.type==="TSTypeQuery"?"exprName":"argument",n=e.type==="TypeofTypeAnnotation"||e.typeArguments?"typeArguments":"typeParameters";return["typeof ",t(r),t(n)]}function ln(e,t){let{node:r}=e;return[r.type==="TSTypePredicate"&&r.asserts?"asserts ":r.type==="TypePredicate"&&r.kind?`${r.kind} `:"",t("parameterName"),r.typeAnnotation?[" is ",H(e,t)]:""]}function V(e){let{node:t}=e;return!t.optional||t.type==="Identifier"&&t===e.parent.key?"":w(t)||G(t)&&t.computed||t.type==="OptionalIndexedAccessType"?"?.":"?"}function mn(e){return e.node.definite||e.match(void 0,(t,r)=>r==="id"&&t.type==="VariableDeclarator"&&t.definite)?"!":""}var dl=new Set(["DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function $(e){let{node:t}=e;return t.declare||dl.has(t.type)&&e.parent.type!=="DeclareExportDeclaration"?"declare ":""}var Tl=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function Vt({node:e}){return e.abstract||Tl.has(e.type)?"abstract ":""}function rt(e,t,r){let n=e.node;return n.typeArguments?r("typeArguments"):n.typeParameters?r("typeParameters"):""}function Kr(e,t,r){return["::",r("callee")]}function Et(e,t,r){return e.type==="EmptyStatement"?";":e.type==="BlockStatement"||r?[" ",t]:D([x,t])}function yn(e,t){return["...",t("argument"),H(e,t)]}function $t(e){return e.accessibility?e.accessibility+" ":""}function xl(e,t,r,n){let{node:s}=e,u=s.inexact?"...":"";return d(s,h.Dangling)?l([r,u,N(e,t,{indent:!0}),E,n]):[r,u,n]}function Kt(e,t,r){let{node:n}=e,s=[],u="[",i="]",a=n.type==="TupleTypeAnnotation"&&n.types?"types":n.type==="TSTupleType"||n.type==="TupleTypeAnnotation"?"elementTypes":"elements",o=n[a];if(o.length===0)s.push(xl(e,t,u,i));else{let p=v(!1,o,-1),m=(p==null?void 0:p.type)!=="RestElement"&&!n.inexact,f=p===null,y=Symbol("array"),C=!t.__inJestEach&&o.length>1&&o.every((T,B,g)=>{let _=T==null?void 0:T.type;if(!U(T)&&!ue(T))return!1;let M=g[B+1];if(M&&_!==M.type)return!1;let J=U(T)?"elements":"properties";return T[J]&&T[J].length>1}),c=Ts(n,t),A=m?f?",":ce(t)?c?S(",","",{groupId:y}):S(","):"":"";s.push(l([u,D([E,c?gl(e,t,r,A):[hl(e,t,r,a,n.inexact),A],N(e,t)]),E,i],{shouldBreak:C,id:y}))}return s.push(V(e),H(e,r)),s}function Ts(e,t){return U(e)&&e.elements.length>1&&e.elements.every(r=>r&&(ye(r)||Rn(r)&&!d(r.argument))&&!d(r,h.Trailing|h.Line,n=>!ee(t.originalText,j(n),{backwards:!0})))}function Ki({node:e},{originalText:t}){let r=s=>_t(t,Mt(t,s)),n=s=>t[s]===","?s:n(r(s+1));return vt(t,n(P(e)))}function hl(e,t,r,n,s){let u=[];return e.each(({node:i,isLast:a})=>{u.push(i?l(r()):""),(!a||s)&&u.push([",",x,i&&Ki(e,t)?E:""])},n),s&&u.push("..."),u}function gl(e,t,r,n){let s=[];return e.each(({isLast:u,next:i})=>{s.push([r(),u?n:","]),u||s.push(Ki(e,t)?[F,F]:d(i,h.Leading|h.Line)?F:x)},"elements"),Nr(s)}var Sl=/^[\$A-Z_a-z\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/,Bl=e=>Sl.test(e),Qi=Bl;function bl(e){return e.length===1?e:e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var Ft=bl;var fn=new WeakMap;function Zi(e){return/^(?:\d+|\d+\.\d+)$/u.test(e)}function zi(e,t){return t.parser==="json"||t.parser==="jsonc"||!K(e.key)||ut(ae(e.key),t).slice(1,-1)!==e.key.value?!1:!!(Qi(e.key.value)&&!(t.parser==="babel-ts"&&e.type==="ClassProperty"||(t.parser==="typescript"||t.parser==="oxc-ts")&&e.type==="PropertyDefinition")||Zi(e.key.value)&&String(Number(e.key.value))===e.key.value&&e.type!=="ImportAttribute"&&(t.parser==="babel"||t.parser==="acorn"||t.parser==="oxc"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree"))}function Pl(e,t){let{key:r}=e.node;return(r.type==="Identifier"||ye(r)&&Zi(Ft(ae(r)))&&String(r.value)===Ft(ae(r))&&!(t.parser==="typescript"||t.parser==="babel-ts"||t.parser==="oxc-ts"))&&(t.parser==="json"||t.parser==="jsonc"||t.quoteProps==="consistent"&&fn.get(e.parent))}function Ct(e,t,r){let{node:n}=e;if(n.computed)return["[",r("key"),"]"];let{parent:s}=e,{key:u}=n;if(t.quoteProps==="consistent"&&!fn.has(s)){let i=e.siblings.some(a=>!a.computed&&K(a.key)&&!zi(a,t));fn.set(s,i)}if(Pl(e,t)){let i=ut(JSON.stringify(u.type==="Identifier"?u.name:u.value.toString()),t);return e.call(a=>Ee(a,i,t),"key")}return zi(n,t)&&(t.quoteProps==="as-needed"||t.quoteProps==="consistent"&&!fn.get(s))?e.call(i=>Ee(i,/^\d/u.test(u.value)?Ft(u.value):u.value,t),"key"):r("key")}function Dn(e,t,r){let{node:n}=e;return n.shorthand?r("value"):ht(e,t,r,Ct(e,t,r),":","value")}var kl=({node:e,key:t,parent:r})=>t==="value"&&e.type==="FunctionExpression"&&(r.type==="ObjectMethod"||r.type==="ClassMethod"||r.type==="ClassPrivateMethod"||r.type==="MethodDefinition"||r.type==="TSAbstractMethodDefinition"||r.type==="TSDeclareMethod"||r.type==="Property"&&bt(r));function En(e,t,r,n){if(kl(e))return Fn(e,t,r);let{node:s}=e,u=!1;if((s.type==="FunctionDeclaration"||s.type==="FunctionExpression")&&(n!=null&&n.expandLastArg)){let{parent:m}=e;w(m)&&(le(m).length>1||Q(s).every(f=>f.type==="Identifier"&&!f.typeAnnotation))&&(u=!0)}let i=[$(e),s.async?"async ":"",`function${s.generator?"*":""} `,s.id?r("id"):""],a=Ue(e,t,r,u),o=Qt(e,r),p=ct(s,o);return i.push(rt(e,t,r),l([p?l(a):a,o]),s.body?" ":"",r("body")),t.semi&&(s.declare||!s.body)&&i.push(";"),i}function Er(e,t,r){let{node:n}=e,{kind:s}=n,u=n.value||n,i=[];return!s||s==="init"||s==="method"||s==="constructor"?u.async&&i.push("async "):(jt.ok(s==="get"||s==="set"),i.push(s," ")),u.generator&&i.push("*"),i.push(Ct(e,t,r),n.optional?"?":"",n===u?Fn(e,t,r):r("value")),i}function Fn(e,t,r){let{node:n}=e,s=Ue(e,t,r),u=Qt(e,r),i=Hi(n),a=ct(n,u),o=[rt(e,t,r),l([i?l(s,{shouldBreak:!0}):a?l(s):s,u])];return n.body?o.push(" ",r("body")):o.push(t.semi?";":""),o}function Il(e){let t=Q(e);return t.length===1&&!e.typeParameters&&!d(e,h.Dangling)&&t[0].type==="Identifier"&&!t[0].typeAnnotation&&!d(t[0])&&!t[0].optional&&!e.predicate&&!e.returnType}function Cn(e,t){if(t.arrowParens==="always")return!1;if(t.arrowParens==="avoid"){let{node:r}=e;return Il(r)}return!1}function Qt(e,t){let{node:r}=e,s=[H(e,t,"returnType")];return r.predicate&&s.push(t("predicate")),s}function ea(e,t,r){let{node:n}=e,s=t.semi?";":"",u=[];if(n.argument){let o=r("argument");Ll(t,n.argument)?o=["(",D([F,o]),F,")"]:(Fe(n.argument)||t.experimentalTernaries&&n.argument.type==="ConditionalExpression"&&(n.argument.consequent.type==="ConditionalExpression"||n.argument.alternate.type==="ConditionalExpression"))&&(o=l([S("("),D([E,o]),E,S(")")])),u.push(" ",o)}let i=d(n,h.Dangling),a=s&&i&&d(n,h.Last|h.Line);return a&&u.push(s),i&&u.push(" ",N(e,t)),a||u.push(s),u}function ta(e,t,r){return["return",ea(e,t,r)]}function ra(e,t,r){return["throw",ea(e,t,r)]}function Ll(e,t){if(de(e.originalText,t)||d(t,h.Leading,r=>ie(e.originalText,j(r),P(r)))&&!Y(t))return!0;if(Jt(t)){let r=t,n;for(;n=mu(r);)if(r=n,de(e.originalText,r))return!0}return!1}var bs=new WeakMap;function na(e){return bs.has(e)||bs.set(e,e.type==="ConditionalExpression"&&!pe(e,t=>t.type==="ObjectExpression")),bs.get(e)}var wl=e=>e.type==="SequenceExpression";function sa(e,t,r,n={}){let s=[],u,i=[],a=!1,o=!n.expandLastArg&&e.node.body.type==="ArrowFunctionExpression",p;(function B(){let{node:g}=e,_=Ol(e,t,r,n);if(s.length===0)s.push(_);else{let{leading:M,trailing:J}=fs(e,t);s.push([M,_]),i.unshift(J)}o&&(a||(a=g.returnType&&Q(g).length>0||g.typeParameters||Q(g).some(M=>M.type!=="Identifier"))),!o||g.body.type!=="ArrowFunctionExpression"?(u=r("body",n),p=g.body):e.call(B,"body")})();let m=!de(t.originalText,p)&&(wl(p)||_l(p,u,t)||!a&&na(p)),f=e.key==="callee"&&yt(e.parent),y=Symbol("arrow-chain"),C=Ml(e,n,{signatureDocs:s,shouldBreak:a}),c=!1,A=!1,T=!1;return o&&(f||n.assignmentLayout)&&(A=!0,T=!d(e.node,h.Leading&h.Line),c=n.assignmentLayout==="chain-tail-arrow-chain"||f&&!m),u=vl(e,t,n,{bodyDoc:u,bodyComments:i,functionBody:p,shouldPutBodyOnSameLine:m}),l([l(A?D([T?E:"",C]):C,{shouldBreak:c,id:y})," =>",o?xt(u,{groupId:y}):l(u),o&&f?S(E,"",{groupId:y}):""])}function Ol(e,t,r,n){let{node:s}=e,u=[];if(s.async&&u.push("async "),Cn(e,t))u.push(r(["params",0]));else{let a=n.expandLastArg||n.expandFirstArg,o=Qt(e,r);if(a){if(re(o))throw new Dt;o=l(cr(o))}u.push(l([Ue(e,t,r,a,!0),o]))}let i=N(e,t,{filter(a){let o=ot(t.originalText,P(a));return o!==!1&&t.originalText.slice(o,o+2)==="=>"}});return i&&u.push(" ",i),u}function _l(e,t,r){var n,s;return U(e)||ue(e)||e.type==="ArrowFunctionExpression"||e.type==="DoExpression"||e.type==="BlockStatement"||Y(e)||((n=t.label)==null?void 0:n.hug)!==!1&&(((s=t.label)==null?void 0:s.embed)||_r(e,r.originalText))}function Ml(e,t,{signatureDocs:r,shouldBreak:n}){if(r.length===1)return r[0];let{parent:s,key:u}=e;return u!=="callee"&&yt(s)||Fe(s)?l([r[0]," =>",D([x,b([" =>",x],r.slice(1))])],{shouldBreak:n}):u==="callee"&&yt(s)||t.assignmentLayout?l(b([" =>",x],r),{shouldBreak:n}):l(D(b([" =>",x],r)),{shouldBreak:n})}function vl(e,t,r,{bodyDoc:n,bodyComments:s,functionBody:u,shouldPutBodyOnSameLine:i}){let{node:a,parent:o}=e,p=r.expandLastArg&&ce(t,"all")?S(","):"",m=(r.expandLastArg||o.type==="JSXExpressionContainer")&&!d(a)?E:"";return i&&na(u)?[" ",l([S("","("),D([E,n]),S("",")"),p,m]),s]:i?[" ",n,s]:[D([x,n,s]),p,m]}var jl=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let s=t[n];if(r(s,n,t))return s}}},ua=jl;function Fr(e,t,r,n){let{node:s}=e,u=[],i=ua(!1,s[n],a=>a.type!=="EmptyStatement");return e.each(({node:a})=>{a.type!=="EmptyStatement"&&(u.push(r()),a!==i&&(u.push(F),me(a,t)&&u.push(F)))},n),u}function An(e,t,r){let n=Rl(e,t,r),{node:s,parent:u}=e;if(s.type==="Program"&&(u==null?void 0:u.type)!=="ModuleExpression")return n?[n,F]:"";let i=[];if(s.type==="StaticBlock"&&i.push("static "),i.push("{"),n)i.push(D([F,n]),F);else{let a=e.grandparent;u.type==="ArrowFunctionExpression"||u.type==="FunctionExpression"||u.type==="FunctionDeclaration"||u.type==="ComponentDeclaration"||u.type==="HookDeclaration"||u.type==="ObjectMethod"||u.type==="ClassMethod"||u.type==="ClassPrivateMethod"||u.type==="ForStatement"||u.type==="WhileStatement"||u.type==="DoWhileStatement"||u.type==="DoExpression"||u.type==="ModuleExpression"||u.type==="CatchClause"&&!a.finalizer||u.type==="TSModuleDeclaration"||s.type==="StaticBlock"||i.push(F)}return i.push("}"),i}function Rl(e,t,r){let{node:n}=e,s=O(n.directives),u=n.body.some(o=>o.type!=="EmptyStatement"),i=d(n,h.Dangling);if(!s&&!u&&!i)return"";let a=[];return s&&(a.push(Fr(e,t,r,"directives")),(u||i)&&(a.push(F),me(v(!1,n.directives,-1),t)&&a.push(F))),u&&a.push(Fr(e,t,r,"body")),i&&a.push(N(e,t)),a}function Jl(e){let t=new WeakMap;return function(r){return t.has(r)||t.set(r,Symbol(e)),t.get(r)}}var dn=Jl;var Cr=dn("typeParameters");function Nl(e,t,r){let{node:n}=e;return Q(n).length===1&&n.type.startsWith("TS")&&!n[r][0].constraint&&e.parent.type==="ArrowFunctionExpression"&&!(t.filepath&&/\.ts$/u.test(t.filepath))}function wt(e,t,r,n){let{node:s}=e;if(!s[n])return"";if(!Array.isArray(s[n]))return r(n);let u=Pt(e.grandparent),i=e.match(p=>!(p[n].length===1&&Re(p[n][0])),void 0,(p,m)=>m==="typeAnnotation",p=>p.type==="Identifier",hs);if(s[n].length===0||!i&&(u||s[n].length===1&&(s[n][0].type==="NullableTypeAnnotation"||Ss(s[n][0]))))return["<",b(", ",e.map(r,n)),Gl(e,t),">"];let o=s.type==="TSTypeParameterInstantiation"?"":Nl(e,t,n)?",":ce(t)?S(","):"";return l(["<",D([E,b([",",x],e.map(r,n))]),o,E,">"],{id:Cr(s)})}function Gl(e,t){let{node:r}=e;if(!d(r,h.Dangling))return"";let n=!d(r,h.Line),s=N(e,t,{indent:!n});return n?s:[s,F]}function Tn(e,t,r){let{node:n}=e,s=[n.const?"const ":""],u=n.type==="TSTypeParameter"?r("name"):n.name;if(n.variance&&s.push(r("variance")),n.in&&s.push("in "),n.out&&s.push("out "),s.push(u),n.bound&&(n.usesExtendsBound&&s.push(" extends "),s.push(H(e,r,"bound"))),n.constraint){let i=Symbol("constraint");s.push(" extends",l(D(x),{id:i}),je,xt(r("constraint"),{groupId:i}))}return n.default&&s.push(" = ",r("default")),l(s)}var ia=R(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function xn(e,t,r){let{node:n}=e,s=[$(e),Vt(e),"class"],u=d(n.id,h.Trailing)||d(n.typeParameters,h.Trailing)||d(n.superClass)||O(n.extends)||O(n.mixins)||O(n.implements),i=[],a=[];if(n.id&&i.push(" ",r("id")),i.push(r("typeParameters")),n.superClass){let m=[Wl(e,t,r),r(n.superTypeArguments?"superTypeArguments":"superTypeParameters")],f=e.call(y=>["extends ",Ee(y,m,t)],"superClass");u?a.push(x,l(f)):a.push(" ",f)}else a.push(Ps(e,t,r,"extends"));a.push(Ps(e,t,r,"mixins"),Ps(e,t,r,"implements"));let o;if(u){let m;pa(n)?m=[...i,D(a)]:m=D([...i,a]),o=aa(n),s.push(l(m,{id:o}))}else s.push(...i,...a);let p=n.body;return u&&O(p.body)?s.push(S(F," ",{groupId:o})):s.push(" "),s.push(r("body")),s}var aa=dn("heritageGroup");function oa(e){return S(F,"",{groupId:aa(e)})}function ql(e){return["extends","mixins","implements"].reduce((t,r)=>t+(Array.isArray(e[r])?e[r].length:0),e.superClass?1:0)>1}function pa(e){return e.typeParameters&&!d(e.typeParameters,h.Trailing|h.Line)&&!ql(e)}function Ps(e,t,r,n){let{node:s}=e;if(!O(s[n]))return"";let u=N(e,t,{marker:n});return[pa(s)?S(" ",x,{groupId:Cr(s.typeParameters)}):x,u,u&&F,n,l(D([x,b([",",x],e.map(r,n))]))]}function Wl(e,t,r){let n=r("superClass"),{parent:s}=e;return s.type==="AssignmentExpression"?l(S(["(",D([E,n]),E,")"],n)):n}function hn(e,t,r){let{node:n}=e,s=[];return O(n.decorators)&&s.push(ds(e,t,r)),s.push($t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),s.push(Er(e,t,r)),s}function gn(e,t,r){let{node:n}=e,s=[],u=t.semi?";":"";O(n.decorators)&&s.push(ds(e,t,r)),s.push($(e),$t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),n.readonly&&s.push("readonly "),n.variance&&s.push(r("variance")),(n.type==="ClassAccessorProperty"||n.type==="AccessorProperty"||n.type==="TSAbstractAccessorProperty")&&s.push("accessor "),s.push(Ct(e,t,r),V(e),mn(e),H(e,r));let i=n.type==="TSAbstractPropertyDefinition"||n.type==="TSAbstractAccessorProperty";return[ht(e,t,r,s," =",i?void 0:"value"),u]}function ca(e,t,r){let{node:n}=e,s=[];return e.each(({node:u,next:i,isLast:a})=>{s.push(r()),!t.semi&&ia(u)&&Ul(u,i)&&s.push(";"),a||(s.push(F),me(u,t)&&s.push(F))},"body"),d(n,h.Dangling)&&s.push(N(e,t)),["{",s.length>0?[D([F,s]),F]:"","}"]}function Ul(e,t){var s;let{type:r,name:n}=e.key;if(!e.computed&&r==="Identifier"&&(n==="static"||n==="get"||n==="set")&&!e.value&&!e.typeAnnotation)return!0;if(!t||t.static||t.accessibility||t.readonly)return!1;if(!t.computed){let u=(s=t.key)==null?void 0:s.name;if(u==="in"||u==="instanceof")return!0}if(ia(t)&&t.variance&&!t.static&&!t.declare)return!0;switch(t.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return t.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((t.value?t.value.async:t.async)||t.kind==="get"||t.kind==="set")return!1;let i=t.value?t.value.generator:t.generator;return!!(t.computed||i)}case"TSIndexSignature":return!0}return!1}var Xl=R(["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"]);function ks(e){return Xl(e)?ks(e.expression):e}var la=R(["FunctionExpression","ArrowFunctionExpression"]);function ma(e){return e.type==="MemberExpression"||e.type==="OptionalMemberExpression"||e.type==="Identifier"&&e.name!=="undefined"}function ya(e,t){if(t.semi||Is(e,t)||Ls(e,t))return!1;let{node:r,key:n,parent:s}=e;return!!(r.type==="ExpressionStatement"&&(n==="body"&&(s.type==="Program"||s.type==="BlockStatement"||s.type==="StaticBlock"||s.type==="TSModuleBlock")||n==="consequent"&&s.type==="SwitchCase")&&e.call(()=>fa(e,t),"expression"))}function fa(e,t){let{node:r}=e;switch(r.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!Cn(e,t))return!0;break;case"UnaryExpression":{let{prefix:n,operator:s}=r;if(n&&(s==="+"||s==="-"))return!0;break}case"BindExpression":if(!r.object)return!0;break;case"Literal":if(r.regex)return!0;break;default:if(Y(r))return!0}return Le(e,t)?!0:Jt(r)?e.call(()=>fa(e,t),...Lr(r)):!1}function Is({node:e,parent:t},r){return(r.parentParser==="markdown"||r.parentParser==="mdx")&&e.type==="ExpressionStatement"&&Y(e.expression)&&t.type==="Program"&&t.body.length===1}function Ls({node:e,parent:t},r){return(r.parser==="__vue_event_binding"||r.parser==="__vue_ts_event_binding")&&e.type==="ExpressionStatement"&&t.type==="Program"&&t.body.length===1}function Da(e,t,r){let n=[r("expression")];if(Ls(e,t)){let s=ks(e.node.expression);(la(s)||ma(s))&&n.push(";")}else Is(e,t)||t.semi&&n.push(";");return n}function Ea(e,t,r){if(t.__isVueBindings||t.__isVueForBindingLeft){let n=e.map(r,"program","body",0,"params");if(n.length===1)return n[0];let s=b([",",x],n);return t.__isVueForBindingLeft?["(",D([E,l(s)]),E,")"]:s}if(t.__isEmbeddedTypescriptGenericParameters){let n=e.map(r,"program","body",0,"typeParameters","params");return b([",",x],n)}}function Aa(e,t){let{node:r}=e;switch(r.type){case"RegExpLiteral":return Fa(r);case"BigIntLiteral":return Sn(r.extra.raw);case"NumericLiteral":return Ft(r.extra.raw);case"StringLiteral":return ve(ut(r.extra.raw,t));case"NullLiteral":return"null";case"BooleanLiteral":return String(r.value);case"DirectiveLiteral":return Ca(r.extra.raw,t);case"Literal":{if(r.regex)return Fa(r.regex);if(r.bigint)return Sn(r.raw);let{value:n}=r;return typeof n=="number"?Ft(r.raw):typeof n=="string"?Yl(e)?Ca(r.raw,t):ve(ut(r.raw,t)):String(n)}}}function Yl(e){if(e.key!=="expression")return;let{parent:t}=e;return t.type==="ExpressionStatement"&&typeof t.directive=="string"}function Sn(e){return e.toLowerCase()}function Fa({pattern:e,flags:t}){return t=[...t].sort().join(""),`/${e}/${t}`}function Ca(e,t){let r=e.slice(1,-1);if(r.includes('"')||r.includes("'"))return e;let n=t.singleQuote?"'":'"';return n+r+n}function Hl(e,t,r){let n=e.originalText.slice(t,r);for(let s of e[Symbol.for("comments")]){let u=j(s);if(u>r)break;let i=P(s);if(ie.type==="ExportDefaultDeclaration"||e.type==="DeclareExportDeclaration"&&e.default;function Bn(e,t,r){let{node:n}=e,s=[wi(e,t,r),$(e),"export",Ta(n)?" default":""],{declaration:u,exported:i}=n;return d(n,h.Dangling)&&(s.push(" ",N(e,t)),Mr(n)&&s.push(F)),u?s.push(" ",r("declaration")):(s.push(Kl(n)),n.type==="ExportAllDeclaration"||n.type==="DeclareExportAllDeclaration"?(s.push(" *"),i&&s.push(" as ",r("exported"))):s.push(ha(e,t,r)),s.push(xa(e,t,r),Sa(e,t,r))),s.push($l(n,t)),s}var Vl=R(["ClassDeclaration","ComponentDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","HookDeclaration","TSDeclareFunction","EnumDeclaration"]);function $l(e,t){return t.semi&&(!e.declaration||Ta(e)&&!Vl(e.declaration))?";":""}function ws(e,t=!0){return e&&e!=="value"?`${t?" ":""}${e}${t?"":" "}`:""}function Os(e,t){return ws(e.importKind,t)}function Kl(e){return ws(e.exportKind)}function xa(e,t,r){let{node:n}=e;if(!n.source)return"";let s=[];return ga(n,t)&&s.push(" from"),s.push(" ",r("source")),s}function ha(e,t,r){let{node:n}=e;if(!ga(n,t))return"";let s=[" "];if(O(n.specifiers)){let u=[],i=[];e.each(()=>{let a=e.node.type;if(a==="ExportNamespaceSpecifier"||a==="ExportDefaultSpecifier"||a==="ImportNamespaceSpecifier"||a==="ImportDefaultSpecifier")u.push(r());else if(a==="ExportSpecifier"||a==="ImportSpecifier")i.push(r());else throw new qe(n,"specifier")},"specifiers"),s.push(b(", ",u)),i.length>0&&(u.length>0&&s.push(", "),i.length>1||u.length>0||n.specifiers.some(o=>d(o))?s.push(l(["{",D([t.bracketSpacing?x:E,b([",",x],i)]),S(ce(t)?",":""),t.bracketSpacing?x:E,"}"])):s.push(["{",t.bracketSpacing?" ":"",...i,t.bracketSpacing?" ":"","}"]))}else s.push("{}");return s}function ga(e,t){return e.type!=="ImportDeclaration"||O(e.specifiers)||e.importKind==="type"?!0:Ar(t,j(e),j(e.source)).trimEnd().endsWith("from")}function Ql(e,t){var n,s;if((n=e.extra)!=null&&n.deprecatedAssertSyntax)return"assert";let r=Ar(t,P(e.source),(s=e.attributes)!=null&&s[0]?j(e.attributes[0]):P(e)).trimStart();return r.startsWith("assert")?"assert":r.startsWith("with")||O(e.attributes)?"with":void 0}function Sa(e,t,r){let{node:n}=e;if(!n.source)return"";let s=Ql(n,t);if(!s)return"";let u=[` ${s} {`];return O(n.attributes)&&(t.bracketSpacing&&u.push(" "),u.push(b(", ",e.map(r,"attributes"))),t.bracketSpacing&&u.push(" ")),u.push("}"),u}function Ba(e,t,r){let{node:n}=e,{type:s}=n,u=s.startsWith("Import"),i=u?"imported":"local",a=u?"local":"exported",o=n[i],p=n[a],m="",f="";return s==="ExportNamespaceSpecifier"||s==="ImportNamespaceSpecifier"?m="*":o&&(m=r(i)),p&&!zl(n)&&(f=r(a)),[ws(s==="ImportSpecifier"?n.importKind:n.exportKind,!1),m,m&&f?" as ":"",f]}function zl(e){if(e.type!=="ImportSpecifier"&&e.type!=="ExportSpecifier")return!1;let{local:t,[e.type==="ImportSpecifier"?"imported":"exported"]:r}=e;if(t.type!==r.type||!au(t,r))return!1;if(K(t))return t.value===r.value&&ae(t)===ae(r);switch(t.type){case"Identifier":return t.name===r.name;default:return!1}}function gt(e,t,r){var J;let n=t.semi?";":"",{node:s}=e,u=s.type==="ObjectTypeAnnotation",i=s.type==="TSEnumBody"||s.type==="EnumBooleanBody"||s.type==="EnumNumberBody"||s.type==="EnumBigIntBody"||s.type==="EnumStringBody"||s.type==="EnumSymbolBody",a=[s.type==="TSTypeLiteral"||i?"members":s.type==="TSInterfaceBody"?"body":"properties"];u&&a.push("indexers","callProperties","internalSlots");let o=a.flatMap(I=>e.map(({node:q})=>({node:q,printed:r(),loc:j(q)}),I));a.length>1&&o.sort((I,q)=>I.loc-q.loc);let{parent:p,key:m}=e,f=u&&m==="body"&&(p.type==="InterfaceDeclaration"||p.type==="DeclareInterface"||p.type==="DeclareClass"),y=s.type==="TSInterfaceBody"||i||f||s.type==="ObjectPattern"&&p.type!=="FunctionDeclaration"&&p.type!=="FunctionExpression"&&p.type!=="ArrowFunctionExpression"&&p.type!=="ObjectMethod"&&p.type!=="ClassMethod"&&p.type!=="ClassPrivateMethod"&&p.type!=="AssignmentPattern"&&p.type!=="CatchClause"&&s.properties.some(I=>I.value&&(I.value.type==="ObjectPattern"||I.value.type==="ArrayPattern"))||s.type!=="ObjectPattern"&&t.objectWrap==="preserve"&&o.length>0&&ie(t.originalText,j(s),o[0].loc),C=f?";":s.type==="TSInterfaceBody"||s.type==="TSTypeLiteral"?S(n,";"):",",c=s.exact?"{|":"{",A=s.exact?"|}":"}",T=[],B=o.map(I=>{let q=[...T,l(I.printed)];return T=[C,x],(I.node.type==="TSPropertySignature"||I.node.type==="TSMethodSignature"||I.node.type==="TSConstructSignatureDeclaration"||I.node.type==="TSCallSignatureDeclaration")&&d(I.node,h.PrettierIgnore)&&T.shift(),me(I.node,t)&&T.push(F),q});if(s.inexact||s.hasUnknownMembers){let I;if(d(s,h.Dangling)){let q=d(s,h.Line);I=[N(e,t),q||ee(t.originalText,P(v(!1,Ve(s),-1)))?F:x,"..."]}else I=["..."];B.push([...T,...I])}let g=(J=v(!1,o,-1))==null?void 0:J.node,_=!(s.inexact||s.hasUnknownMembers||g&&(g.type==="RestElement"||(g.type==="TSPropertySignature"||g.type==="TSCallSignatureDeclaration"||g.type==="TSMethodSignature"||g.type==="TSConstructSignatureDeclaration"||g.type==="TSIndexSignature")&&d(g,h.PrettierIgnore))||e.match(void 0,(I,q)=>I.type==="TSImportType"&&q==="options")),M;if(B.length===0){if(!d(s,h.Dangling))return[c,A,H(e,r)];M=l([c,N(e,t,{indent:!0}),E,A,V(e),H(e,r)])}else M=[f&&O(s.properties)?oa(p):"",c,D([t.bracketSpacing?x:E,...B]),S(_&&(C!==","||ce(t))?C:""),t.bracketSpacing?x:E,A,V(e),H(e,r)];return e.match(I=>I.type==="ObjectPattern"&&!O(I.decorators),_s)||Re(s)&&(e.match(void 0,(I,q)=>q==="typeAnnotation",(I,q)=>q==="typeAnnotation",_s)||e.match(void 0,(I,q)=>I.type==="FunctionTypeParam"&&q==="typeAnnotation",_s))||!y&&e.match(I=>I.type==="ObjectPattern",I=>I.type==="AssignmentExpression"||I.type==="VariableDeclarator")?M:l(M,{shouldBreak:y})}function _s(e,t){return(t==="params"||t==="parameters"||t==="this"||t==="rest")&&gs(e)}function Zl(e){let t=[e];for(let r=0;ry[W]===n),c=y.type===n.type&&!C,A,T,B=0;do T=A||n,A=e.getParentNode(B),B++;while(A&&A.type===n.type&&a.every(W=>A[W]!==T));let g=A||y,_=T;if(s&&(Y(n[a[0]])||Y(o)||Y(p)||Zl(_))){f=!0,c=!0;let W=Z=>[S("("),D([E,Z]),E,S(")")],ne=Z=>Z.type==="NullLiteral"||Z.type==="Literal"&&Z.value===null||Z.type==="Identifier"&&Z.name==="undefined";m.push(" ? ",ne(o)?r(u):W(r(u))," : ",p.type===n.type||ne(p)?r(i):W(r(i)))}else{let W=Z=>t.useTabs?D(r(Z)):be(2,r(Z)),ne=[x,"? ",o.type===n.type?S("","("):"",W(u),o.type===n.type?S("",")"):"",x,": ",W(i)];m.push(y.type!==n.type||y[i]===n||C?ne:t.useTabs?Jr(D(ne)):be(Math.max(0,t.tabWidth-2),ne))}let M=[u,i,...a].some(W=>d(n[W],ne=>te(ne)&&ie(t.originalText,j(ne),P(ne)))),J=W=>y===g?l(W,{shouldBreak:M}):M?[W,Ce]:W,I=!f&&(G(y)||y.type==="NGPipeExpression"&&y.left===n)&&!y.computed,q=rm(e),k=J([em(e,t,r),c?m:D(m),s&&I&&!q?E:""]);return C||q?l([D([E,k]),E]):k}function nm(e,t){return(G(t)||t.type==="NGPipeExpression"&&t.left===e)&&!t.computed}function sm(e,t,r,n){return[...e.map(u=>Ve(u)),Ve(t),Ve(r)].flat().some(u=>te(u)&&ie(n.originalText,j(u),P(u)))}var um=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function im(e){let{node:t}=e;if(t.type!=="ConditionalExpression")return!1;let r,n=t;for(let s=0;!r;s++){let u=e.getParentNode(s);if(u.type==="ChainExpression"&&u.expression===n||w(u)&&u.callee===n||G(u)&&u.object===n||u.type==="TSNonNullExpression"&&u.expression===n){n=u;continue}u.type==="NewExpression"&&u.callee===n||xe(u)&&u.expression===n?(r=e.getParentNode(s+1),n=u):r=u}return n===t?!1:r[um.get(r.type)]===n}var Ms=e=>[S("("),D([E,e]),E,S(")")];function zt(e,t,r,n){if(!t.experimentalTernaries)return ba(e,t,r);let{node:s}=e,u=s.type==="ConditionalExpression",i=Je(s),a=u?"consequent":"trueType",o=u?"alternate":"falseType",p=u?["test"]:["checkType","extendsType"],m=s[a],f=s[o],y=p.map(Xe=>s[Xe]),{parent:C}=e,c=C.type===s.type,A=c&&p.some(Xe=>C[Xe]===s),T=c&&C[o]===s,B=m.type===s.type,g=f.type===s.type,_=g||T,M=t.tabWidth>2||t.useTabs,J,I,q=0;do I=J||s,J=e.getParentNode(q),q++;while(J&&J.type===s.type&&p.every(Xe=>J[Xe]!==I));let k=J||C,W=n&&n.assignmentLayout&&n.assignmentLayout!=="break-after-operator"&&(C.type==="AssignmentExpression"||C.type==="VariableDeclarator"||C.type==="ClassProperty"||C.type==="PropertyDefinition"||C.type==="ClassPrivateProperty"||C.type==="ObjectProperty"||C.type==="Property"),ne=(C.type==="ReturnStatement"||C.type==="ThrowStatement")&&!(B||g),Z=u&&k.type==="JSXExpressionContainer"&&e.grandparent.type!=="JSXAttribute",lt=im(e),L=nm(s,C),se=i&&Le(e,t),Ae=M?t.useTabs?" ":" ".repeat(t.tabWidth-1):"",Ot=sm(y,m,f,t)||B||g,nt=!_&&!c&&!i&&(Z?m.type==="NullLiteral"||m.type==="Literal"&&m.value===null:ir(m,t)&&Nn(s.test,3)),Js=_||T||i&&!c||c&&u&&Nn(s.test,1)||nt,Ns=[];!B&&d(m,h.Dangling)&&e.call(Xe=>{Ns.push(N(Xe,t),F)},"consequent");let er=[];d(s.test,h.Dangling)&&e.call(Xe=>{er.push(N(Xe,t))},"test"),!g&&d(f,h.Dangling)&&e.call(Xe=>{er.push(N(Xe,t))},"alternate"),d(s,h.Dangling)&&er.push(N(e,t));let Gs=Symbol("test"),Va=Symbol("consequent"),dr=Symbol("test-and-consequent"),$a=u?[Ms(r("test")),s.test.type==="ConditionalExpression"?Ce:""]:[r("checkType")," ","extends"," ",Je(s.extendsType)||s.extendsType.type==="TSMappedType"?r("extendsType"):l(Ms(r("extendsType")))],qs=l([$a," ?"],{id:Gs}),Ka=r(a),Tr=D([B||Z&&(Y(m)||c||_)?F:x,Ns,Ka]),Qa=Js?l([qs,_?Tr:S(Tr,l(Tr,{id:Va}),{groupId:Gs})],{id:dr}):[qs,Tr],wn=r(o),Ws=nt?S(wn,Jr(Ms(wn)),{groupId:dr}):wn,tr=[Qa,er.length>0?[D([F,er]),F]:g?F:nt?S(x," ",{groupId:dr}):x,":",g?" ":M?Js?S(Ae,S(_||nt?" ":Ae," "),{groupId:dr}):S(Ae," "):" ",g?Ws:l([D(Ws),Z&&!nt?E:""]),L&&!lt?E:"",Ot?Ce:""];return W&&!Ot?l(D([E,l(tr)])):W||ne?l(D(tr)):lt||i&&A?l([D([E,tr]),se?E:""]):C===k?l(tr):tr}function Pa(e,t,r,n){let{node:s}=e;if(wr(s))return Aa(e,t);let u=t.semi?";":"",i=[];switch(s.type){case"JsExpressionRoot":return r("node");case"JsonRoot":return[N(e,t),r("node"),F];case"File":return Ea(e,t,r)??r("program");case"EmptyStatement":return"";case"ExpressionStatement":return Da(e,t,r);case"ChainExpression":return r("expression");case"ParenthesizedExpression":return!d(s.expression)&&(ue(s.expression)||U(s.expression))?["(",r("expression"),")"]:l(["(",D([E,r("expression")]),E,")"]);case"AssignmentExpression":return Wi(e,t,r);case"VariableDeclarator":return Ui(e,t,r);case"BinaryExpression":case"LogicalExpression":return $r(e,t,r);case"AssignmentPattern":return[r("left")," = ",r("right")];case"OptionalMemberExpression":case"MemberExpression":return Ri(e,t,r);case"MetaProperty":return[r("meta"),".",r("property")];case"BindExpression":return s.object&&i.push(r("object")),i.push(l(D([E,Kr(e,t,r)]))),i;case"Identifier":return[s.name,V(e),mn(e),H(e,r)];case"V8IntrinsicIdentifier":return["%",s.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return yn(e,r);case"FunctionDeclaration":case"FunctionExpression":return En(e,t,r,n);case"ArrowFunctionExpression":return sa(e,t,r,n);case"YieldExpression":return i.push("yield"),s.delegate&&i.push("*"),s.argument&&i.push(" ",r("argument")),i;case"AwaitExpression":if(i.push("await"),s.argument){i.push(" ",r("argument"));let{parent:a}=e;if(w(a)&&a.callee===s||G(a)&&a.object===s){i=[D([E,...i]),E];let o=e.findAncestor(p=>p.type==="AwaitExpression"||p.type==="BlockStatement");if((o==null?void 0:o.type)!=="AwaitExpression"||!pe(o.argument,p=>p===s))return l(i)}}return i;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return Bn(e,t,r);case"ImportDeclaration":return da(e,t,r);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return Ba(e,t,r);case"ImportAttribute":return Dn(e,t,r);case"Program":case"BlockStatement":case"StaticBlock":return An(e,t,r);case"ClassBody":return ca(e,t,r);case"ThrowStatement":return ra(e,t,r);case"ReturnStatement":return ta(e,t,r);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return Qr(e,t,r);case"ObjectExpression":case"ObjectPattern":return gt(e,t,r);case"Property":return bt(s)?Er(e,t,r):Dn(e,t,r);case"ObjectProperty":return Dn(e,t,r);case"ObjectMethod":return Er(e,t,r);case"Decorator":return["@",r("expression")];case"ArrayExpression":case"ArrayPattern":return Kt(e,t,r);case"SequenceExpression":{let{parent:a}=e;if(a.type==="ExpressionStatement"||a.type==="ForStatement"){let p=[];return e.each(({isFirst:m})=>{m?p.push(r()):p.push(",",D([x,r()]))},"expressions"),l(p)}let o=b([",",x],e.map(r,"expressions"));return(a.type==="ReturnStatement"||a.type==="ThrowStatement")&&e.key==="argument"||a.type==="ArrowFunctionExpression"&&e.key==="body"?l(S([D([E,o]),E],o)):l(o)}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[r("value"),u];case"UnaryExpression":return i.push(s.operator),/[a-z]$/u.test(s.operator)&&i.push(" "),d(s.argument)?i.push(l(["(",D([E,r("argument")]),E,")"])):i.push(r("argument")),i;case"UpdateExpression":return[s.prefix?s.operator:"",r("argument"),s.prefix?"":s.operator];case"ConditionalExpression":return zt(e,t,r,n);case"VariableDeclaration":{let a=e.map(r,"declarations"),o=e.parent,p=o.type==="ForStatement"||o.type==="ForInStatement"||o.type==="ForOfStatement",m=s.declarations.some(y=>y.init),f;return a.length===1&&!d(s.declarations[0])?f=a[0]:a.length>0&&(f=D(a[0])),i=[$(e),s.kind,f?[" ",f]:"",D(a.slice(1).map(y=>[",",m&&!p?F:x,y]))],p&&o.body!==s||i.push(u),l(i)}case"WithStatement":return l(["with (",r("object"),")",Et(s.body,r("body"))]);case"IfStatement":{let a=Et(s.consequent,r("consequent")),o=l(["if (",l([D([E,r("test")]),E]),")",a]);if(i.push(o),s.alternate){let p=d(s.consequent,h.Trailing|h.Line)||Mr(s),m=s.consequent.type==="BlockStatement"&&!p;i.push(m?" ":F),d(s,h.Dangling)&&i.push(N(e,t),p?F:" "),i.push("else",l(Et(s.alternate,r("alternate"),s.alternate.type==="IfStatement")))}return i}case"ForStatement":{let a=Et(s.body,r("body")),o=N(e,t),p=o?[o,E]:"";return!s.init&&!s.test&&!s.update?[p,l(["for (;;)",a])]:[p,l(["for (",l([D([E,r("init"),";",x,r("test"),";",x,r("update")]),E]),")",a])]}case"WhileStatement":return l(["while (",l([D([E,r("test")]),E]),")",Et(s.body,r("body"))]);case"ForInStatement":return l(["for (",r("left")," in ",r("right"),")",Et(s.body,r("body"))]);case"ForOfStatement":return l(["for",s.await?" await":""," (",r("left")," of ",r("right"),")",Et(s.body,r("body"))]);case"DoWhileStatement":{let a=Et(s.body,r("body"));return i=[l(["do",a])],s.body.type==="BlockStatement"?i.push(" "):i.push(F),i.push("while (",l([D([E,r("test")]),E]),")",u),i}case"DoExpression":return[s.async?"async ":"","do ",r("body")];case"BreakStatement":case"ContinueStatement":return i.push(s.type==="BreakStatement"?"break":"continue"),s.label&&i.push(" ",r("label")),i.push(u),i;case"LabeledStatement":return s.body.type==="EmptyStatement"?[r("label"),":;"]:[r("label"),": ",r("body")];case"TryStatement":return["try ",r("block"),s.handler?[" ",r("handler")]:"",s.finalizer?[" finally ",r("finalizer")]:""];case"CatchClause":if(s.param){let a=d(s.param,p=>!te(p)||p.leading&&ee(t.originalText,P(p))||p.trailing&&ee(t.originalText,j(p),{backwards:!0})),o=r("param");return["catch ",a?["(",D([E,o]),E,") "]:["(",o,") "],r("body")]}return["catch ",r("body")];case"SwitchStatement":return[l(["switch (",D([E,r("discriminant")]),E,")"])," {",s.cases.length>0?D([F,b(F,e.map(({node:a,isLast:o})=>[r(),!o&&me(a,t)?F:""],"cases"))]):"",F,"}"];case"SwitchCase":{s.test?i.push("case ",r("test"),":"):i.push("default:"),d(s,h.Dangling)&&i.push(" ",N(e,t));let a=s.consequent.filter(o=>o.type!=="EmptyStatement");if(a.length>0){let o=Fr(e,t,r,"consequent");i.push(a.length===1&&a[0].type==="BlockStatement"?[" ",o]:D([F,o]))}return i}case"DebuggerStatement":return["debugger",u];case"ClassDeclaration":case"ClassExpression":return xn(e,t,r);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return hn(e,t,r);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return gn(e,t,r);case"TemplateElement":return ve(s.value.raw);case"TemplateLiteral":return Wr(e,t,r);case"TaggedTemplateExpression":return Zu(e,t,r);case"PrivateIdentifier":return["#",s.name];case"PrivateName":return["#",r("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":return["module ",r("body")];case"InterpreterDirective":default:throw new qe(s,"ESTree")}}function bn(e,t,r){let{parent:n,node:s,key:u}=e,i=[r("expression")];switch(s.type){case"AsConstExpression":i.push(" as const");break;case"AsExpression":case"TSAsExpression":i.push(" as ",r("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":i.push(" satisfies ",r("typeAnnotation"));break}return u==="callee"&&w(n)||u==="object"&&G(n)?l([D([E,...i]),E]):i}function ka(e,t,r){let{node:n}=e,s=[$(e),"component"];n.id&&s.push(" ",r("id")),s.push(r("typeParameters"));let u=am(e,t,r);return n.rendersType?s.push(l([u," ",r("rendersType")])):s.push(l([u])),n.body&&s.push(" ",r("body")),t.semi&&n.type==="DeclareComponent"&&s.push(";"),s}function am(e,t,r){let{node:n}=e,s=n.params;if(n.rest&&(s=[...s,n.rest]),s.length===0)return["(",N(e,t,{filter:i=>ke(t.originalText,P(i))===")"}),")"];let u=[];return pm(e,(i,a)=>{let o=a===s.length-1;o&&n.rest&&u.push("..."),u.push(r()),!o&&(u.push(","),me(s[a],t)?u.push(F,F):u.push(x))}),["(",D([E,...u]),S(ce(t,"all")&&!om(n,s)?",":""),E,")"]}function om(e,t){var r;return e.rest||((r=v(!1,t,-1))==null?void 0:r.type)==="RestElement"}function pm(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);e.each(s,"params"),r.rest&&e.call(s,"rest")}function Ia(e,t,r){let{node:n}=e;return n.shorthand?r("local"):[r("name")," as ",r("local")]}function La(e,t,r){let{node:n}=e,s=[];return n.name&&s.push(r("name"),n.optional?"?: ":": "),s.push(r("typeAnnotation")),s}function Pn(e,t,r){return gt(e,t,r)}function kn(e,t){let{node:r}=e,n=t("id");r.computed&&(n=["[",n,"]"]);let s="";return r.initializer&&(s=t("initializer")),r.init&&(s=t("init")),s?[n," = ",s]:n}function In(e,t){let{node:r}=e;return[$(e),r.const?"const ":"","enum ",t("id")," ",t("body")]}function Oa(e,t,r){let{node:n}=e,s=["hook"];n.id&&s.push(" ",r("id"));let u=Ue(e,t,r,!1,!0),i=Qt(e,r),a=ct(n,i);return s.push(l([a?l(u):u,i]),n.body?" ":"",r("body")),s}function _a(e,t,r){let{node:n}=e,s=[$(e),"hook"];return n.id&&s.push(" ",r("id")),t.semi&&s.push(";"),s}function wa(e){var r;let{node:t}=e;return t.type==="HookTypeAnnotation"&&((r=e.getParentNode(2))==null?void 0:r.type)==="DeclareHook"}function Ma(e,t,r){let{node:n}=e,s=[];s.push(wa(e)?"":"hook ");let u=Ue(e,t,r,!1,!0),i=[];return i.push(wa(e)?": ":" => ",r("returnType")),ct(n,i)&&(u=l(u)),s.push(u,i),l(s)}function Ln(e,t,r){let{node:n}=e,s=[$(e),"interface"],u=[],i=[];n.type!=="InterfaceTypeAnnotation"&&u.push(" ",r("id"),r("typeParameters"));let a=n.typeParameters&&!d(n.typeParameters,h.Trailing|h.Line);return O(n.extends)&&i.push(a?S(" ",x,{groupId:Cr(n.typeParameters)}):x,"extends ",(n.extends.length===1?du:D)(b([",",x],e.map(r,"extends")))),d(n.id,h.Trailing)||O(n.extends)?a?s.push(l([...u,D(i)])):s.push(l(D([...u,...i]))):s.push(...u,...i),s.push(" ",r("body")),l(s)}function cm(e){switch(e){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function ja(e,t,r){let{node:n}=e;return l([n.variance?r("variance"):"","[",D([r("keyTparam")," in ",r("sourceType")]),"]",cm(n.optional),": ",r("propType")])}function va(e,t){return e==="+"||e==="-"?e+t:t}function Ra(e,t,r){let{node:n}=e,s=!1;if(t.objectWrap==="preserve"){let u=j(n),i=Ar(t,u+1,j(n.key)),a=u+1+i.search(/\S/u);ie(t.originalText,u,a)&&(s=!0)}return l(["{",D([t.bracketSpacing?x:E,d(n,h.Dangling)?l([N(e,t),F]):"",l([n.readonly?[va(n.readonly,"readonly")," "]:"","[",r("key")," in ",r("constraint"),n.nameType?[" as ",r("nameType")]:"","]",n.optional?va(n.optional,"?"):"",n.typeAnnotation?": ":"",r("typeAnnotation")]),t.semi?S(";"):""]),t.bracketSpacing?x:E,"}"],{shouldBreak:s})}function Ja(e,t,r){let{node:n}=e;if(Pr(n))return n.type.slice(0,-14).toLowerCase();let s=t.semi?";":"";switch(n.type){case"ComponentDeclaration":case"DeclareComponent":case"ComponentTypeAnnotation":return ka(e,t,r);case"ComponentParameter":return Ia(e,t,r);case"ComponentTypeParameter":return La(e,t,r);case"HookDeclaration":return Oa(e,t,r);case"DeclareHook":return _a(e,t,r);case"HookTypeAnnotation":return Ma(e,t,r);case"DeclareClass":return xn(e,t,r);case"DeclareFunction":return[$(e),"function ",r("id"),r("predicate"),s];case"DeclareModule":return["declare module ",r("id")," ",r("body")];case"DeclareModuleExports":return["declare module.exports",H(e,r),s];case"DeclareNamespace":return["declare namespace ",r("id")," ",r("body")];case"DeclareVariable":return[$(e),n.kind??"var"," ",r("id"),s];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return Bn(e,t,r);case"DeclareOpaqueType":case"OpaqueType":return Vi(e,t,r);case"DeclareTypeAlias":case"TypeAlias":return Zr(e,t,r);case"IntersectionTypeAnnotation":return en(e,t,r);case"UnionTypeAnnotation":return tn(e,t,r);case"ConditionalTypeAnnotation":return zt(e,t,r);case"InferTypeAnnotation":return sn(e,t,r);case"FunctionTypeAnnotation":return rn(e,t,r);case"TupleTypeAnnotation":return Kt(e,t,r);case"TupleTypeLabeledElement":return an(e,t,r);case"TupleTypeSpreadElement":return un(e,t,r);case"GenericTypeAnnotation":return[r("id"),wt(e,t,r,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return nn(e,t,r);case"TypeAnnotation":return on(e,t,r);case"TypeParameter":return Tn(e,t,r);case"TypeofTypeAnnotation":return cn(e,r);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return pn(r);case"DeclareEnum":case"EnumDeclaration":return In(e,r);case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":return[n.type==="EnumSymbolBody"||n.explicitType?`of ${n.type.slice(4,-4).toLowerCase()} `:"",Pn(e,t,r)];case"EnumBooleanMember":case"EnumNumberMember":case"EnumBigIntMember":case"EnumStringMember":case"EnumDefaultedMember":return kn(e,r);case"FunctionTypeParam":{let u=n.name?r("name"):e.parent.this===n?"this":"";return[u,V(e),u?": ":"",r("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return Ln(e,t,r);case"ClassImplements":case"InterfaceExtends":return[r("id"),r("typeParameters")];case"NullableTypeAnnotation":return["?",r("typeAnnotation")];case"Variance":{let{kind:u}=n;return jt.ok(u==="plus"||u==="minus"),u==="plus"?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",r("argument")];case"ObjectTypeCallProperty":return[n.static?"static ":"",r("value")];case"ObjectTypeMappedTypeProperty":return ja(e,t,r);case"ObjectTypeIndexer":return[n.static?"static ":"",n.variance?r("variance"):"","[",r("id"),n.id?": ":"",r("key"),"]: ",r("value")];case"ObjectTypeProperty":{let u="";return n.proto?u="proto ":n.static&&(u="static "),[u,n.kind!=="init"?n.kind+" ":"",n.variance?r("variance"):"",Ct(e,t,r),V(e),bt(n)?"":": ",r("value")]}case"ObjectTypeAnnotation":return gt(e,t,r);case"ObjectTypeInternalSlot":return[n.static?"static ":"","[[",r("id"),"]]",V(e),n.method?"":": ",r("value")];case"ObjectTypeSpreadProperty":return yn(e,r);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[r("qualification"),".",r("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(n.value);case"StringLiteralTypeAnnotation":return ve(ut(ae(n),t));case"NumberLiteralTypeAnnotation":return Ft(ae(n));case"BigIntLiteralTypeAnnotation":return Sn(ae(n));case"TypeCastExpression":return["(",r("expression"),H(e,r),")"];case"TypePredicate":return ln(e,r);case"TypeOperator":return[n.operator," ",r("typeAnnotation")];case"TypeParameterDeclaration":case"TypeParameterInstantiation":return wt(e,t,r,"params");case"InferredPredicate":case"DeclaredPredicate":return[e.key==="predicate"&&e.parent.type!=="DeclareFunction"&&!e.parent.returnType?": ":" ","%checks",...n.type==="DeclaredPredicate"?["(",r("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return bn(e,t,r)}}function Na(e,t,r){var i;let{node:n}=e;if(!n.type.startsWith("TS"))return;if(kr(n))return n.type.slice(2,-7).toLowerCase();let s=t.semi?";":"",u=[];switch(n.type){case"TSThisType":return"this";case"TSTypeAssertion":{let a=!(U(n.expression)||ue(n.expression)),o=l(["<",D([E,r("typeAnnotation")]),E,">"]),p=[S("("),D([E,r("expression")]),E,S(")")];return a?tt([[o,r("expression")],[o,l(p,{shouldBreak:!0})],[o,r("expression")]]):l([o,r("expression")])}case"TSDeclareFunction":return En(e,t,r);case"TSExportAssignment":return["export = ",r("expression"),s];case"TSModuleBlock":return An(e,t,r);case"TSInterfaceBody":case"TSTypeLiteral":return gt(e,t,r);case"TSTypeAliasDeclaration":return Zr(e,t,r);case"TSQualifiedName":return[r("left"),".",r("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return hn(e,t,r);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return gn(e,t,r);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[r("expression"),r(n.typeArguments?"typeArguments":"typeParameters")];case"TSTemplateLiteralType":return Wr(e,t,r);case"TSNamedTupleMember":return an(e,t,r);case"TSRestType":return un(e,t,r);case"TSOptionalType":return[r("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return Ln(e,t,r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return wt(e,t,r,"params");case"TSTypeParameter":return Tn(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":return bn(e,t,r);case"TSArrayType":return pn(r);case"TSPropertySignature":return[n.readonly?"readonly ":"",Ct(e,t,r),V(e),H(e,r)];case"TSParameterProperty":return[$t(n),n.static?"static ":"",n.override?"override ":"",n.readonly?"readonly ":"",r("parameter")];case"TSTypeQuery":return cn(e,r);case"TSIndexSignature":{let a=n.parameters.length>1?S(ce(t)?",":""):"",o=l([D([E,b([", ",E],e.map(r,"parameters"))]),a,E]),p=e.parent.type==="ClassBody"&&e.key==="body";return[p&&n.static?"static ":"",n.readonly?"readonly ":"","[",n.parameters?o:"","]",H(e,r),p?s:""]}case"TSTypePredicate":return ln(e,r);case"TSNonNullExpression":return[r("expression"),"!"];case"TSImportType":return["import",Lt(e,t,r),n.qualifier?[".",r("qualifier")]:"",wt(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return r("literal");case"TSIndexedAccessType":return nn(e,t,r);case"TSTypeOperator":return[n.operator," ",r("typeAnnotation")];case"TSMappedType":return Ra(e,t,r);case"TSMethodSignature":{let a=n.kind&&n.kind!=="method"?`${n.kind} `:"";u.push($t(n),a,n.computed?"[":"",r("key"),n.computed?"]":"",V(e));let o=Ue(e,t,r,!1,!0),p=n.returnType?"returnType":"typeAnnotation",m=n[p],f=m?H(e,r,p):"",y=ct(n,f);return u.push(y?l(o):o),m&&u.push(l(f)),l(u)}case"TSNamespaceExportDeclaration":return["export as namespace ",r("id"),t.semi?";":""];case"TSEnumDeclaration":return In(e,r);case"TSEnumBody":return Pn(e,t,r);case"TSEnumMember":return kn(e,r);case"TSImportEqualsDeclaration":return[n.isExport?"export ":"","import ",Os(n,!1),r("id")," = ",r("moduleReference"),t.semi?";":""];case"TSExternalModuleReference":return["require(",r("expression"),")"];case"TSModuleDeclaration":{let{parent:a}=e,o=a.type==="TSModuleDeclaration",p=((i=n.body)==null?void 0:i.type)==="TSModuleDeclaration";return o?u.push("."):(u.push($(e)),n.kind!=="global"&&u.push(n.kind," ")),u.push(r("id")),p?u.push(r("body")):n.body?u.push(" ",l(r("body"))):u.push(s),u}case"TSConditionalType":return zt(e,t,r);case"TSInferType":return sn(e,t,r);case"TSIntersectionType":return en(e,t,r);case"TSUnionType":return tn(e,t,r);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return rn(e,t,r);case"TSTupleType":return Kt(e,t,r);case"TSTypeReference":return[r("typeName"),wt(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSTypeAnnotation":return on(e,t,r);case"TSEmptyBodyFunctionExpression":return Fn(e,t,r);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return Bs(e,r,"?");case"TSJSDocNonNullableType":return Bs(e,r,"!");case"TSParenthesizedType":default:throw new qe(n,"TypeScript")}}function lm(e,t,r,n){if(Vr(e))return Ti(e,t);for(let s of[Li,bi,Ja,Na,Pa]){let u=s(e,t,r,n);if(u!==void 0)return u}}var mm=R(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);function ym(e,t,r,n){var f;e.isRoot&&((f=t.__onHtmlBindingRoot)==null||f.call(t,e.node,t));let s=lm(e,t,r,n);if(!s)return"";let{node:u}=e;if(mm(u))return s;let i=O(u.decorators),a=Oi(e,t,r),o=u.type==="ClassExpression";if(i&&!o)return lr(s,y=>l([a,y]));let p=Le(e,t),m=ya(e,t);return!a&&!p&&!m?s:lr(s,y=>[m?";":"",p?"(":"",p&&o&&i?[D([x,a,y]),x]:[a,y],p?")":""])}var Ga=ym;var fm={avoidAstMutation:!0};var qa=[{name:"JSON.stringify",type:"data",extensions:[".importmap"],tmScope:"source.json",aceMode:"json",aliases:["geojson","jsonl","sarif","topojson"],codemirrorMode:"javascript",codemirrorMimeType:"application/json",filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"],linguistLanguageId:174},{name:"JSON",type:"data",extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".json.example",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],tmScope:"source.json",aceMode:"json",aliases:["geojson","jsonl","sarif","topojson"],codemirrorMode:"javascript",codemirrorMimeType:"application/json",filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"],linguistLanguageId:174},{name:"JSON with Comments",type:"data",extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],tmScope:"source.json.comments",aceMode:"javascript",aliases:["jsonc"],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",group:"JSON",filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"],linguistLanguageId:423},{name:"JSON5",type:"data",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"],linguistLanguageId:175}];var js={};xr(js,{getVisitorKeys:()=>Ua,massageAstNode:()=>Ya,print:()=>Fm});var Dm={JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]},Wa=Dm;var Em=Br(Wa),Ua=Em;function Fm(e,t,r){let{node:n}=e;switch(n.type){case"JsonRoot":return[r("node"),F];case"ArrayExpression":{if(n.elements.length===0)return"[]";let s=e.map(()=>e.node===null?"null":r(),"elements");return["[",D([F,b([",",F],s)]),F,"]"]}case"ObjectExpression":return n.properties.length===0?"{}":["{",D([F,b([",",F],e.map(r,"properties"))]),F,"}"];case"ObjectProperty":return[r("key"),": ",r("value")];case"UnaryExpression":return[n.operator==="+"?"":n.operator,r("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return n.value?"true":"false";case"StringLiteral":return JSON.stringify(n.value);case"NumericLiteral":return Xa(e)?JSON.stringify(String(n.value)):JSON.stringify(n.value);case"Identifier":return Xa(e)?JSON.stringify(n.name):n.name;case"TemplateLiteral":return r(["quasis",0]);case"TemplateElement":return JSON.stringify(n.value.cooked);default:throw new qe(n,"JSON")}}function Xa(e){return e.key==="key"&&e.parent.type==="ObjectProperty"}var Cm=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function Ya(e,t){let{type:r}=e;if(r==="ObjectProperty"){let{key:n}=e;n.type==="Identifier"?t.key={type:"StringLiteral",value:n.name}:n.type==="NumericLiteral"&&(t.key={type:"StringLiteral",value:String(n.value)});return}if(r==="UnaryExpression"&&e.operator==="+")return t.argument;if(r==="ArrayExpression"){for(let[n,s]of e.elements.entries())s===null&&t.elements.splice(n,0,{type:"NullLiteral"});return}if(r==="TemplateLiteral")return{type:"StringLiteral",value:e.quasis[0].value.cooked}}Ya.ignoredProperties=Cm;var Zt={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var St="JavaScript",Am={arrowParens:{category:St,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:Zt.bracketSameLine,objectWrap:Zt.objectWrap,bracketSpacing:Zt.bracketSpacing,jsxBracketSameLine:{category:St,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:St,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalOperatorPosition:{category:St,type:"choice",default:"end",description:"Where to print operators when binary expressions wrap lines.",choices:[{value:"start",description:"Print operators at the start of new lines."},{value:"end",description:"Print operators at the end of previous lines."}]},experimentalTernaries:{category:St,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:Zt.singleQuote,jsxSingleQuote:{category:St,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:St,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:St,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:Zt.singleAttributePerLine},Ha=Am;var dm={estree:vs,"estree-json":js},Tm=[...Vs,...qa];var Nx=Rs; - - -/***/ }), - -/***/ "./node_modules/prettier/standalone.mjs": -/*!**********************************************!*\ - !*** ./node_modules/prettier/standalone.mjs ***! - \**********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ __debug: () => (/* binding */ ui), -/* harmony export */ check: () => (/* binding */ ri), -/* harmony export */ "default": () => (/* binding */ xf), -/* harmony export */ doc: () => (/* binding */ qt), -/* harmony export */ format: () => (/* binding */ fu), -/* harmony export */ formatWithCursor: () => (/* binding */ cu), -/* harmony export */ getSupportInfo: () => (/* binding */ ni), -/* harmony export */ util: () => (/* binding */ Qt), -/* harmony export */ version: () => (/* binding */ tu) -/* harmony export */ }); -var Fu=Object.create;var pt=Object.defineProperty;var pu=Object.getOwnPropertyDescriptor;var du=Object.getOwnPropertyNames;var mu=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty;var er=e=>{throw TypeError(e)};var Cu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dt=(e,t)=>{for(var r in t)pt(e,r,{get:t[r],enumerable:!0})},hu=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of du(t))!Eu.call(e,u)&&u!==r&&pt(e,u,{get:()=>t[u],enumerable:!(n=pu(t,u))||n.enumerable});return e};var gu=(e,t,r)=>(r=e!=null?Fu(mu(e)):{},hu(t||!e||!e.__esModule?pt(r,"default",{value:e,enumerable:!0}):r,e));var yu=(e,t,r)=>t.has(e)||er("Cannot "+r);var tr=(e,t,r)=>t.has(e)?er("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var fe=(e,t,r)=>(yu(e,t,"access private method"),r);var Pn=Cu(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});function Co(){return new Proxy({},{get:()=>e=>e})}var On=/\r\n|[\n\r\u2028\u2029]/;function ho(e,t,r){let n=Object.assign({column:0,line:-1},e.start),u=Object.assign({},n,e.end),{linesAbove:o=2,linesBelow:i=3}=r||{},s=n.line,a=n.column,c=u.line,D=u.column,p=Math.max(s-(o+1),0),l=Math.min(t.length,c+i);s===-1&&(p=0),c===-1&&(l=t.length);let F=c-s,f={};if(F)for(let d=0;d<=F;d++){let m=d+s;if(!a)f[m]=!0;else if(d===0){let C=t[m-1].length;f[m]=[a,C-a+1]}else if(d===F)f[m]=[0,D];else{let C=t[m-d].length;f[m]=[0,C]}}else a===D?a?f[s]=[a,0]:f[s]=!0:f[s]=[a,D-a];return{start:p,end:l,markerLines:f}}function go(e,t,r={}){let u=Co(!1),o=e.split(On),{start:i,end:s,markerLines:a}=ho(t,o,r),c=t.start&&typeof t.start.column=="number",D=String(s).length,l=e.split(On,s).slice(i,s).map((F,f)=>{let d=i+1+f,C=` ${` ${d}`.slice(-D)} |`,E=a[d],h=!a[d+1];if(E){let x="";if(Array.isArray(E)){let A=F.slice(0,Math.max(E[0]-1,0)).replace(/[^\t]/g," "),$=E[1]||1;x=[` - `,u.gutter(C.replace(/\d/g," "))," ",A,u.marker("^").repeat($)].join(""),h&&r.message&&(x+=" "+u.message(r.message))}return[u.marker(">"),u.gutter(C),F.length>0?` ${F}`:"",x].join("")}else return` ${u.gutter(C)}${F.length>0?` ${F}`:""}`}).join(` -`);return r.message&&!c&&(l=`${" ".repeat(D+1)}${r.message} -${l}`),l}Mt.codeFrameColumns=go});var Zt={};dt(Zt,{__debug:()=>ui,check:()=>ri,doc:()=>qt,format:()=>fu,formatWithCursor:()=>cu,getSupportInfo:()=>ni,util:()=>Qt,version:()=>tu});var Au=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},te=Au;var _e=class{diff(t,r,n={}){let u;typeof n=="function"?(u=n,n={}):"callback"in n&&(u=n.callback);let o=this.castInput(t,n),i=this.castInput(r,n),s=this.removeEmpty(this.tokenize(o,n)),a=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(s,a,n,u)}diffWithOptionsObj(t,r,n,u){var o;let i=E=>{if(E=this.postProcess(E,n),u){setTimeout(function(){u(E)},0);return}else return E},s=r.length,a=t.length,c=1,D=s+a;n.maxEditLength!=null&&(D=Math.min(D,n.maxEditLength));let p=(o=n.timeout)!==null&&o!==void 0?o:1/0,l=Date.now()+p,F=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(F[0],r,t,0,n);if(F[0].oldPos+1>=a&&f+1>=s)return i(this.buildValues(F[0].lastComponent,r,t));let d=-1/0,m=1/0,C=()=>{for(let E=Math.max(d,-c);E<=Math.min(m,c);E+=2){let h,x=F[E-1],A=F[E+1];x&&(F[E-1]=void 0);let $=!1;if(A){let Be=A.oldPos-E;$=A&&0<=Be&&Be=a&&f+1>=s)return i(this.buildValues(h.lastComponent,r,t))||!0;F[E]=h,h.oldPos+1>=a&&(m=Math.min(m,E-1)),f+1>=s&&(d=Math.max(d,E+1))}c++};if(u)(function E(){setTimeout(function(){if(c>D||Date.now()>l)return u(void 0);C()||E()},0)})();else for(;c<=D&&Date.now()<=l;){let E=C();if(E)return E}}addToPath(t,r,n,u,o){let i=t.lastComponent;return i&&!o.oneChangePerToken&&i.added===r&&i.removed===n?{oldPos:t.oldPos+u,lastComponent:{count:i.count+1,added:r,removed:n,previousComponent:i.previousComponent}}:{oldPos:t.oldPos+u,lastComponent:{count:1,added:r,removed:n,previousComponent:i}}}extractCommon(t,r,n,u,o){let i=r.length,s=n.length,a=t.oldPos,c=a-u,D=0;for(;c+1l.length?f:l}),D.value=this.join(p)}else D.value=this.join(r.slice(a,a+D.count));a+=D.count,D.added||(c+=D.count)}}return u}};var mt=class extends _e{tokenize(t){return t.slice()}join(t){return t}removeEmpty(t){return t}},rr=new mt;function Et(e,t,r){return rr.diff(e,t,r)}function nr(e){let t=e.indexOf("\r");return t!==-1?e.charAt(t+1)===` -`?"crlf":"cr":"lf"}function xe(e){switch(e){case"cr":return"\r";case"crlf":return`\r -`;default:return` -`}}function Ct(e,t){let r;switch(t){case` -`:r=/\n/gu;break;case"\r":r=/\r/gu;break;case`\r -`:r=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let n=e.match(r);return n?n.length:0}function ur(e){return te(!1,e,/\r\n?/gu,` -`)}var W="string",Y="array",j="cursor",N="indent",O="align",P="trim",B="group",k="fill",_="if-break",v="indent-if-break",L="line-suffix",I="line-suffix-boundary",g="line",S="label",w="break-parent",Ue=new Set([j,N,O,P,B,k,_,v,L,I,g,S,w]);var Bu=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},y=Bu;function or(e){let t=e.length;for(;t>0&&(e[t-1]==="\r"||e[t-1]===` -`);)t--;return tnew Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function wu(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', -Expected it to be 'string' or 'object'.`;if(M(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=xu([...Ue].map(u=>`'${u}'`));return`Unexpected doc.type '${e.type}'. -Expected it to be ${n}.`}var ht=class extends Error{name="InvalidDocError";constructor(t){super(wu(t)),this.doc=t}},q=ht;var ir={};function bu(e,t,r,n){let u=[e];for(;u.length>0;){let o=u.pop();if(o===ir){r(u.pop());continue}r&&u.push(o,ir);let i=M(o);if(!i)throw new q(o);if((t==null?void 0:t(o))!==!1)switch(i){case Y:case k:{let s=i===Y?o:o.parts;for(let a=s.length,c=a-1;c>=0;--c)u.push(s[c]);break}case _:u.push(o.flatContents,o.breakContents);break;case B:if(n&&o.expandedStates)for(let s=o.expandedStates.length,a=s-1;a>=0;--a)u.push(o.expandedStates[a]);else u.push(o.contents);break;case O:case N:case v:case S:case L:u.push(o.contents);break;case W:case j:case P:case I:case g:case w:break;default:throw new q(o)}}}var le=bu;function be(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(o){if(r.has(o))return r.get(o);let i=u(o);return r.set(o,i),i}function u(o){switch(M(o)){case Y:return t(o.map(n));case k:return t({...o,parts:o.parts.map(n)});case _:return t({...o,breakContents:n(o.breakContents),flatContents:n(o.flatContents)});case B:{let{expandedStates:i,contents:s}=o;return i?(i=i.map(n),s=i[0]):s=n(s),t({...o,contents:s,expandedStates:i})}case O:case N:case v:case S:case L:return t({...o,contents:n(o.contents)});case W:case j:case P:case I:case g:case w:return t(o);default:throw new q(o)}}}function Ve(e,t,r){let n=r,u=!1;function o(i){if(u)return!1;let s=t(i);s!==void 0&&(u=!0,n=s)}return le(e,o),n}function ku(e){if(e.type===B&&e.break||e.type===g&&e.hard||e.type===w)return!0}function Dr(e){return Ve(e,ku,!1)}function sr(e){if(e.length>0){let t=y(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function cr(e){let t=new Set,r=[];function n(o){if(o.type===w&&sr(r),o.type===B){if(r.push(o),t.has(o))return!1;t.add(o)}}function u(o){o.type===B&&r.pop().break&&sr(r)}le(e,n,u,!0)}function Su(e){return e.type===g&&!e.hard?e.soft?"":" ":e.type===_?e.flatContents:e}function fr(e){return be(e,Su)}function ar(e){for(e=[...e];e.length>=2&&y(!1,e,-2).type===g&&y(!1,e,-1).type===w;)e.length-=2;if(e.length>0){let t=we(y(!1,e,-1));e[e.length-1]=t}return e}function we(e){switch(M(e)){case N:case v:case B:case L:case S:{let t=we(e.contents);return{...e,contents:t}}case _:return{...e,breakContents:we(e.breakContents),flatContents:we(e.flatContents)};case k:return{...e,parts:ar(e.parts)};case Y:return ar(e);case W:return or(e);case O:case j:case P:case I:case g:case w:break;default:throw new q(e)}return e}function $e(e){return we(Nu(e))}function Tu(e){switch(M(e)){case k:if(e.parts.every(t=>t===""))return"";break;case B:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===B&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case O:case N:case v:case L:if(!e.contents)return"";break;case _:if(!e.flatContents&&!e.breakContents)return"";break;case Y:{let t=[];for(let r of e){if(!r)continue;let[n,...u]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...u)}return t.length===0?"":t.length===1?t[0]:t}case W:case j:case P:case I:case g:case S:case w:break;default:throw new q(e)}return e}function Nu(e){return be(e,t=>Tu(t))}function lr(e,t=We){return be(e,r=>typeof r=="string"?ke(t,r.split(` -`)):r)}function Ou(e){if(e.type===g)return!0}function Fr(e){return Ve(e,Ou,!1)}function Fe(e,t){return e.type===S?{...e,contents:t(e.contents)}:t(e)}var gt=()=>{},K=gt,yt=gt,pr=gt;function ie(e){return K(e),{type:N,contents:e}}function oe(e,t){return K(t),{type:O,contents:t,n:e}}function At(e,t={}){return K(e),yt(t.expandedStates,!0),{type:B,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function dr(e){return oe(Number.NEGATIVE_INFINITY,e)}function mr(e){return oe({type:"root"},e)}function Er(e){return oe(-1,e)}function Cr(e,t){return At(e[0],{...t,expandedStates:e})}function hr(e){return pr(e),{type:k,parts:e}}function gr(e,t="",r={}){return K(e),t!==""&&K(t),{type:_,breakContents:e,flatContents:t,groupId:r.groupId}}function yr(e,t){return K(e),{type:v,contents:e,groupId:t.groupId,negate:t.negate}}function Se(e){return K(e),{type:L,contents:e}}var Ar={type:I},pe={type:w},Br={type:P},Te={type:g,hard:!0},Bt={type:g,hard:!0,literal:!0},Me={type:g},_r={type:g,soft:!0},z=[Te,pe],We=[Bt,pe],X={type:j};function ke(e,t){K(e),yt(t);let r=[];for(let n=0;n0){for(let u=0;u0?`, { ${D.join(", ")} }`:"";return`indentIfBreak(${n(o.contents)}${p})`}if(o.type===B){let D=[];o.break&&o.break!=="propagated"&&D.push("shouldBreak: true"),o.id&&D.push(`id: ${u(o.id)}`);let p=D.length>0?`, { ${D.join(", ")} }`:"";return o.expandedStates?`conditionalGroup([${o.expandedStates.map(l=>n(l)).join(",")}]${p})`:`group(${n(o.contents)}${p})`}if(o.type===k)return`fill([${o.parts.map(D=>n(D)).join(", ")}])`;if(o.type===L)return"lineSuffix("+n(o.contents)+")";if(o.type===I)return"lineSuffixBoundary";if(o.type===S)return`label(${JSON.stringify(o.label)}, ${n(o.contents)})`;if(o.type===j)return"cursor";throw new Error("Unknown doc type "+o.type)}function u(o){if(typeof o!="symbol")return JSON.stringify(String(o));if(o in t)return t[o];let i=o.description||"symbol";for(let s=0;;s++){let a=i+(s>0?` #${s}`:"");if(!r.has(a))return r.add(a),t[o]=`Symbol.for(${JSON.stringify(a)})`}}}var br=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function kr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Sr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Tr=e=>!(kr(e)||Sr(e));var Pu=/[^\x20-\x7F]/u;function vu(e){if(!e)return 0;if(!Pu.test(e))return e.length;e=e.replace(br()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=Tr(n)?1:2)}return t}var Ne=vu;var R=Symbol("MODE_BREAK"),H=Symbol("MODE_FLAT"),de=Symbol("cursor"),_t=Symbol("DOC_FILL_PRINTED_LENGTH");function Nr(){return{value:"",length:0,queue:[]}}function Lu(e,t){return xt(e,{type:"indent"},t)}function Iu(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Nr():t<0?xt(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:xt(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function xt(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],u="",o=0,i=0,s=0;for(let f of n)switch(f.type){case"indent":D(),r.useTabs?a(1):c(r.tabWidth);break;case"stringAlign":D(),u+=f.n,o+=f.n.length;break;case"numberAlign":i+=1,s+=f.n;break;default:throw new Error(`Unexpected type '${f.type}'`)}return l(),{...e,value:u,length:o,queue:n};function a(f){u+=" ".repeat(f),o+=r.tabWidth*f}function c(f){u+=" ".repeat(f),o+=f}function D(){r.useTabs?p():l()}function p(){i>0&&a(i),F()}function l(){s>0&&c(s),F()}function F(){i=0,s=0}}function wt(e){let t=0,r=0,n=e.length;e:for(;n--;){let u=e[n];if(u===de){r++;continue}for(let o=u.length-1;o>=0;o--){let i=u[o];if(i===" "||i===" ")t++;else{e[n]=u.slice(0,o+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(de);return t}function Ke(e,t,r,n,u,o){if(r===Number.POSITIVE_INFINITY)return!0;let i=t.length,s=[e],a=[];for(;r>=0;){if(s.length===0){if(i===0)return!0;s.push(t[--i]);continue}let{mode:c,doc:D}=s.pop(),p=M(D);switch(p){case W:a.push(D),r-=Ne(D);break;case Y:case k:{let l=p===Y?D:D.parts,F=D[_t]??0;for(let f=l.length-1;f>=F;f--)s.push({mode:c,doc:l[f]});break}case N:case O:case v:case S:s.push({mode:c,doc:D.contents});break;case P:r+=wt(a);break;case B:{if(o&&D.break)return!1;let l=D.break?R:c,F=D.expandedStates&&l===R?y(!1,D.expandedStates,-1):D.contents;s.push({mode:l,doc:F});break}case _:{let F=(D.groupId?u[D.groupId]||H:c)===R?D.breakContents:D.flatContents;F&&s.push({mode:c,doc:F});break}case g:if(c===R||D.hard)return!0;D.soft||(a.push(" "),r--);break;case L:n=!0;break;case I:if(n)return!1;break}}return!1}function me(e,t){let r={},n=t.printWidth,u=xe(t.endOfLine),o=0,i=[{ind:Nr(),mode:R,doc:e}],s=[],a=!1,c=[],D=0;for(cr(e);i.length>0;){let{ind:l,mode:F,doc:f}=i.pop();switch(M(f)){case W:{let d=u!==` -`?te(!1,f,` -`,u):f;s.push(d),i.length>0&&(o+=Ne(d));break}case Y:for(let d=f.length-1;d>=0;d--)i.push({ind:l,mode:F,doc:f[d]});break;case j:if(D>=2)throw new Error("There are too many 'cursor' in doc.");s.push(de),D++;break;case N:i.push({ind:Lu(l,t),mode:F,doc:f.contents});break;case O:i.push({ind:Iu(l,f.n,t),mode:F,doc:f.contents});break;case P:o-=wt(s);break;case B:switch(F){case H:if(!a){i.push({ind:l,mode:f.break?R:H,doc:f.contents});break}case R:{a=!1;let d={ind:l,mode:H,doc:f.contents},m=n-o,C=c.length>0;if(!f.break&&Ke(d,i,m,C,r))i.push(d);else if(f.expandedStates){let E=y(!1,f.expandedStates,-1);if(f.break){i.push({ind:l,mode:R,doc:E});break}else for(let h=1;h=f.expandedStates.length){i.push({ind:l,mode:R,doc:E});break}else{let x=f.expandedStates[h],A={ind:l,mode:H,doc:x};if(Ke(A,i,m,C,r)){i.push(A);break}}}else i.push({ind:l,mode:R,doc:f.contents});break}}f.id&&(r[f.id]=y(!1,i,-1).mode);break;case k:{let d=n-o,m=f[_t]??0,{parts:C}=f,E=C.length-m;if(E===0)break;let h=C[m+0],x=C[m+1],A={ind:l,mode:H,doc:h},$={ind:l,mode:R,doc:h},ue=Ke(A,[],d,c.length>0,r,!0);if(E===1){ue?i.push(A):i.push($);break}let Be={ind:l,mode:H,doc:x},lt={ind:l,mode:R,doc:x};if(E===2){ue?i.push(Be,A):i.push(lt,$);break}let lu=C[m+2],Ft={ind:l,mode:F,doc:{...f,[_t]:m+2}};Ke({ind:l,mode:H,doc:[h,x,lu]},[],d,c.length>0,r,!0)?i.push(Ft,Be,A):ue?i.push(Ft,lt,A):i.push(Ft,lt,$);break}case _:case v:{let d=f.groupId?r[f.groupId]:F;if(d===R){let m=f.type===_?f.breakContents:f.negate?f.contents:ie(f.contents);m&&i.push({ind:l,mode:F,doc:m})}if(d===H){let m=f.type===_?f.flatContents:f.negate?ie(f.contents):f.contents;m&&i.push({ind:l,mode:F,doc:m})}break}case L:c.push({ind:l,mode:F,doc:f.contents});break;case I:c.length>0&&i.push({ind:l,mode:F,doc:Te});break;case g:switch(F){case H:if(f.hard)a=!0;else{f.soft||(s.push(" "),o+=1);break}case R:if(c.length>0){i.push({ind:l,mode:F,doc:f},...c.reverse()),c.length=0;break}f.literal?l.root?(s.push(u,l.root.value),o=l.root.length):(s.push(u),o=0):(o-=wt(s),s.push(u+l.value),o=l.length);break}break;case S:i.push({ind:l,mode:F,doc:f.contents});break;case w:break;default:throw new q(f)}i.length===0&&c.length>0&&(i.push(...c.reverse()),c.length=0)}let p=s.indexOf(de);if(p!==-1){let l=s.indexOf(de,p+1);if(l===-1)return{formatted:s.filter(m=>m!==de).join("")};let F=s.slice(0,p).join(""),f=s.slice(p+1,l).join(""),d=s.slice(l+1).join("");return{formatted:F+f+d,cursorNodeStart:F.length,cursorNodeText:f}}return{formatted:s.join("")}}function Ru(e,t,r=0){let n=0;for(let u=r;u1?y(!1,t,-2):null}getValue(){return y(!1,this.stack,-1)}getNode(t=0){let r=fe(this,Z,kt).call(this,t);return r===-1?null:this.stack[r]}getParentNode(t=0){return this.getNode(t+1)}call(t,...r){let{stack:n}=this,{length:u}=n,o=y(!1,n,-1);for(let i of r)o=o[i],n.push(i,o);try{return t(this)}finally{n.length=u}}callParent(t,r=0){let n=fe(this,Z,kt).call(this,r+1),u=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...u)}}each(t,...r){let{stack:n}=this,{length:u}=n,o=y(!1,n,-1);for(let i of r)o=o[i],n.push(i,o);try{for(let i=0;i{n[o]=t(u,o,i)},...r),n}match(...t){let r=this.stack.length-1,n=null,u=this.stack[r--];for(let o of t){if(u===void 0)return!1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],u=this.stack[r--]),o&&!o(u,n,i))return!1;n=this.stack[r--],u=this.stack[r--]}return!0}findAncestor(t){for(let r of fe(this,Z,ze).call(this))if(t(r))return r}hasAncestor(t){for(let r of fe(this,Z,ze).call(this))if(t(r))return!0;return!1}};Z=new WeakSet,kt=function(t){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t<0)return n;return-1},ze=function*(){let{stack:t}=this;for(let r=t.length-3;r>=0;r-=2){let n=t[r];Array.isArray(n)||(yield n)}};var Or=bt;var Pr=new Proxy(()=>{},{get:()=>Pr}),Oe=Pr;function Yu(e){return e!==null&&typeof e=="object"}var vr=Yu;function*Ce(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,u=o=>vr(o)&&n(o);for(let o of r(e)){let i=e[o];if(Array.isArray(i))for(let s of i)u(s)&&(yield s);else u(i)&&(yield i)}}function*Lr(e,t){let r=[e];for(let n=0;n{let u=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:o}=t,i=r;for(;i>=0&&i0}var qe=Vu;var Yr=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),$u=e=>Object.keys(e).filter(t=>!Yr.has(t));function Wu(e){return e?t=>e(t,Yr):$u}var J=Wu;function Mu(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function St(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Mu(e)}function se(e,t){t.leading=!0,t.trailing=!1,St(e,t)}function ee(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),St(e,t)}function ae(e,t){t.leading=!1,t.trailing=!0,St(e,t)}var Tt=new WeakMap;function Xe(e,t){if(Tt.has(e))return Tt.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:u},locStart:o,locEnd:i}=t;if(!n)return[];let s=((r==null?void 0:r(e,t))??[...Ce(e,{getVisitorKeys:J(u)})]).flatMap(a=>n(a)?[a]:Xe(a,t));return s.sort((a,c)=>o(a)-o(c)||i(a)-i(c)),Tt.set(e,s),s}function Ur(e,t,r,n){let{locStart:u,locEnd:o}=r,i=u(t),s=o(t),a=Xe(e,r),c,D,p=0,l=a.length;for(;p>1,f=a[F],d=u(f),m=o(f);if(d<=i&&s<=m)return Ur(f,t,r,f);if(m<=i){c=f,p=F+1;continue}if(s<=d){D=f,l=F;continue}throw new Error("Comment location overlaps with node location")}if((n==null?void 0:n.type)==="TemplateLiteral"){let{quasis:F}=n,f=Ot(F,t,r);c&&Ot(F,c,r)!==f&&(c=null),D&&Ot(F,D,r)!==f&&(D=null)}return{enclosingNode:n,precedingNode:c,followingNode:D}}var Nt=()=>!1;function Vr(e,t){let{comments:r}=e;if(delete e.comments,!qe(r)||!t.printer.canAttachComment)return;let n=[],{printer:{experimentalFeatures:{avoidAstMutation:u=!1}={},handleComments:o={}},originalText:i}=t,{ownLine:s=Nt,endOfLine:a=Nt,remaining:c=Nt}=o,D=r.map((p,l)=>({...Ur(e,p,t),comment:p,text:i,options:t,ast:e,isLastComment:r.length-1===l}));for(let[p,l]of D.entries()){let{comment:F,precedingNode:f,enclosingNode:d,followingNode:m,text:C,options:E,ast:h,isLastComment:x}=l,A;if(u?A=[l]:(F.enclosingNode=d,F.precedingNode=f,F.followingNode=m,A=[F,C,E,h,x]),Gu(C,E,D,p))F.placement="ownLine",s(...A)||(m?se(m,F):f?ae(f,F):d?ee(d,F):ee(h,F));else if(Ku(C,E,D,p))F.placement="endOfLine",a(...A)||(f?ae(f,F):m?se(m,F):d?ee(d,F):ee(h,F));else if(F.placement="remaining",!c(...A))if(f&&m){let $=n.length;$>0&&n[$-1].followingNode!==m&&jr(n,E),n.push(l)}else f?ae(f,F):m?se(m,F):d?ee(d,F):ee(h,F)}if(jr(n,t),!u)for(let p of r)delete p.precedingNode,delete p.enclosingNode,delete p.followingNode}var $r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gu(e,t,r,n){let{comment:u,precedingNode:o}=r[n],{locStart:i,locEnd:s}=t,a=i(u);if(o)for(let c=n-1;c>=0;c--){let{comment:D,precedingNode:p}=r[c];if(p!==o||!$r(e.slice(s(D),a)))break;a=i(D)}return G(e,a,{backwards:!0})}function Ku(e,t,r,n){let{comment:u,followingNode:o}=r[n],{locStart:i,locEnd:s}=t,a=s(u);if(o)for(let c=n+1;c0;--i){let{comment:c,precedingNode:D,followingNode:p}=e[i-1];Oe.strictEqual(D,n),Oe.strictEqual(p,u);let l=t.originalText.slice(t.locEnd(c),o);if(((a=(s=t.printer).isGap)==null?void 0:a.call(s,l,t))??/^[\s(]*$/u.test(l))o=t.locStart(c);else break}for(let[c,{comment:D}]of e.entries())c1&&c.comments.sort((D,p)=>t.locStart(D)-t.locStart(p));e.length=0}function Ot(e,t,r){let n=r.locStart(t)-1;for(let u=1;u!n.has(a)).length===0)return{leading:"",trailing:""};let o=[],i=[],s;return e.each(()=>{let a=e.node;if(n!=null&&n.has(a))return;let{leading:c,trailing:D}=a;c?o.push(Hu(e,t)):D&&(s=Ju(e,t,s),i.push(s.doc))},"comments"),{leading:o,trailing:i}}function Mr(e,t,r){let{leading:n,trailing:u}=qu(e,r);return!n&&!u?t:Fe(t,o=>[n,o,u])}function Gr(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let n of t){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed}}function Xu(e){return()=>{}}var Kr=Xu;var ve=class extends Error{name="ConfigError"},Le=class extends Error{name="UndefinedParserError"};var zr={checkIgnorePragma:{category:"Special",type:"boolean",default:!1,description:"Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",cliCategory:"Other"},cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing -(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive). -The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset. -The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function Qe({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(u=>u.languages??[]),n=[];for(let u of Zu(Object.assign({},...e.map(({options:o})=>o),zr)))!t&&u.deprecated||(Array.isArray(u.choices)&&(t||(u.choices=u.choices.filter(o=>!o.deprecated)),u.name==="parser"&&(u.choices=[...u.choices,...Qu(u.choices,r,e)])),u.pluginDefaults=Object.fromEntries(e.filter(o=>{var i;return((i=o.defaultOptions)==null?void 0:i[u.name])!==void 0}).map(o=>[o.name,o.defaultOptions[u.name]])),n.push(u));return{languages:r,options:n}}function*Qu(e,t,r){let n=new Set(e.map(u=>u.value));for(let u of t)if(u.parsers){for(let o of u.parsers)if(!n.has(o)){n.add(o);let i=r.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,o)),s=u.name;i!=null&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:o,description:s}}}}function Zu(e){let t=[];for(let[r,n]of Object.entries(e)){let u={name:r,...n};Array.isArray(u.default)&&(u.default=y(!1,u.default,-1).value),t.push(u)}return t}var eo=(e,t)=>{if(!(e&&t==null))return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()},Hr=eo;var Jr,qr,Xr,Qr,Zr,to=((Jr=globalThis.Deno)==null?void 0:Jr.build.os)==="windows"||((Xr=(qr=globalThis.navigator)==null?void 0:qr.platform)==null?void 0:Xr.startsWith("Win"))||((Zr=(Qr=globalThis.process)==null?void 0:Qr.platform)==null?void 0:Zr.startsWith("win"))||!1;function en(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function ro(e){return e=en(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function no(e){e=en(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(t=`\\\\${e.hostname}${t}`),t}function tn(e){return to?no(e):ro(e)}var rn=tn;var uo=e=>String(e).split(/[/\\]/u).pop();function nn(e,t){if(!t)return;let r=uo(t).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(u=>u.toLowerCase()===r))??e.find(({extensions:n})=>n==null?void 0:n.some(u=>r.endsWith(u)))}function oo(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function un(e,t){if(t){if(String(t).startsWith("file:"))try{t=rn(t)}catch{return}if(typeof t=="string")return e.find(({isSupported:r})=>r==null?void 0:r({filepath:t}))}}function io(e,t){let r=Hr(!1,e.plugins).flatMap(u=>u.languages??[]),n=oo(r,t.language)??nn(r,t.physicalFile)??nn(r,t.file)??un(r,t.physicalFile)??un(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var on=io;var re={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(r=>re.value(r)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(r=>`${re.key(r)}: ${re.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t})=>re.value({[e]:t})};var sn=new Proxy(String,{get:()=>sn}),V=sn;var an=(e,t,{descriptor:r})=>{let n=[`${V.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t&&n.push(`we now treat it as ${V.blue(typeof t=="string"?r.key(t):r.pair(t))}`),n.join("; ")+"."};var Ze=Symbol.for("vnopts.VALUE_NOT_EXIST"),ge=Symbol.for("vnopts.VALUE_UNCHANGED");var Dn=" ".repeat(2),fn=(e,t,r)=>{let{text:n,list:u}=r.normalizeExpectedResult(r.schemas[e].expected(r)),o=[];return n&&o.push(cn(e,t,n,r.descriptor)),u&&o.push([cn(e,t,u.title,r.descriptor)].concat(u.values.map(i=>ln(i,r.loggerPrintWidth))).join(` -`)),Fn(o,r.loggerPrintWidth)};function cn(e,t,r,n){return[`Invalid ${V.red(n.key(e))} value.`,`Expected ${V.blue(r)},`,`but received ${t===Ze?V.gray("nothing"):V.red(n.value(t))}.`].join(" ")}function ln({text:e,list:t},r){let n=[];return e&&n.push(`- ${V.blue(e)}`),t&&n.push([`- ${V.blue(t.title)}:`].concat(t.values.map(u=>ln(u,r-Dn.length).replace(/^|\n/g,`$&${Dn}`))).join(` -`)),Fn(n,r)}function Fn(e,t){if(e.length===1)return e[0];let[r,n]=e,[u,o]=e.map(i=>i.split(` -`,1)[0].length);return u>t&&u>o?n:r}var Pt=[],pn=[];function vt(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,u=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-u);)n--,u--;let o=0;for(;os?c>s?s+1:c:c>a?a+1:c;return s}var et=(e,t,{descriptor:r,logger:n,schemas:u})=>{let o=[`Ignored unknown option ${V.yellow(r.pair({key:e,value:t}))}.`],i=Object.keys(u).sort().find(s=>vt(e,s)<3);i&&o.push(`Did you mean ${V.blue(r.key(i))}?`),n.warn(o.join(" "))};var so=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function ao(e,t){let r=new e(t),n=Object.create(r);for(let u of so)u in t&&(n[u]=Do(t[u],r,b.prototype[u].length));return n}var b=class{static create(t){return ao(this,t)}constructor(t){this.name=t.name}default(t){}expected(t){return"nothing"}validate(t,r){return!1}deprecated(t,r){return!1}forward(t,r){}redirect(t,r){}overlap(t,r,n){return t}preprocess(t,r){return t}postprocess(t,r){return ge}};function Do(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var tt=class extends b{constructor(t){super(t),this._sourceName=t.sourceName}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,r){return r.schemas[this._sourceName].validate(t,r)}redirect(t,r){return this._sourceName}};var rt=class extends b{expected(){return"anything"}validate(){return!0}};var nt=class extends b{constructor({valueSchema:t,name:r=t.name,...n}){super({...n,name:r}),this._valueSchema=t}expected(t){let{text:r,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return{text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,r){if(!Array.isArray(t))return!1;let n=[];for(let u of t){let o=r.normalizeValidateResult(this._valueSchema.validate(u,r),u);o!==!0&&n.push(o.value)}return n.length===0?!0:{value:n}}deprecated(t,r){let n=[];for(let u of t){let o=r.normalizeDeprecatedResult(this._valueSchema.deprecated(u,r),u);o!==!1&&n.push(...o.map(({value:i})=>({value:[i]})))}return n}forward(t,r){let n=[];for(let u of t){let o=r.normalizeForwardResult(this._valueSchema.forward(u,r),u);n.push(...o.map(dn))}return n}redirect(t,r){let n=[],u=[];for(let o of t){let i=r.normalizeRedirectResult(this._valueSchema.redirect(o,r),o);"remain"in i&&n.push(i.remain),u.push(...i.redirect.map(dn))}return n.length===0?{redirect:u}:{redirect:u,remain:n}}overlap(t,r){return t.concat(r)}};function dn({from:e,to:t}){return{from:[e],to:t}}var ut=class extends b{expected(){return"true or false"}validate(t){return typeof t=="boolean"}};function En(e,t){let r=Object.create(null);for(let n of e){let u=n[t];if(r[u])throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);r[u]=n}return r}function Cn(e,t){let r=new Map;for(let n of e){let u=n[t];if(r.has(u))throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);r.set(u,n)}return r}function hn(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?!0:(e[r]=!0,!1)}}function gn(e,t){let r=[],n=[];for(let u of e)t(u)?r.push(u):n.push(u);return[r,n]}function yn(e){return e===Math.floor(e)}function An(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,u=["undefined","object","boolean","number","string"];return r!==n?u.indexOf(r)-u.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function Bn(e){return(...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function Lt(e){return e===void 0?{}:e}function It(e){if(typeof e=="string")return{text:e};let{text:t,list:r}=e;return co((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(It)}}:{text:t}}function Rt(e,t){return e===!0?!0:e===!1?{value:t}:e}function Yt(e,t,r=!1){return e===!1?!1:e===!0?r?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function mn(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ot(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>mn(r,t)):[mn(e,t)]}function jt(e,t){let r=ot(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function co(e,t){if(!e)throw new Error(t)}var it=class extends b{constructor(t){super(t),this._choices=Cn(t.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value")}expected({descriptor:t}){let r=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(An).map(t.value),n=r.slice(0,-2),u=r.slice(-2);return{text:n.concat(u.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(t){return this._choices.has(t)}deprecated(t){let r=this._choices.get(t);return r&&r.deprecated?{value:t}:!1}forward(t){let r=this._choices.get(t);return r?r.forward:void 0}redirect(t){let r=this._choices.get(t);return r?r.redirect:void 0}};var st=class extends b{expected(){return"a number"}validate(t,r){return typeof t=="number"}};var at=class extends st{expected(){return"an integer"}validate(t,r){return r.normalizeValidateResult(super.validate(t,r),t)===!0&&yn(t)}};var Ie=class extends b{expected(){return"a string"}validate(t){return typeof t=="string"}};var _n=re,xn=et,wn=fn,bn=an;var Dt=class{constructor(t,r){let{logger:n=console,loggerPrintWidth:u=80,descriptor:o=_n,unknown:i=xn,invalid:s=wn,deprecated:a=bn,missing:c=()=>!1,required:D=()=>!1,preprocess:p=F=>F,postprocess:l=()=>ge}=r||{};this._utils={descriptor:o,logger:n||{warn:()=>{}},loggerPrintWidth:u,schemas:En(t,"name"),normalizeDefaultResult:Lt,normalizeExpectedResult:It,normalizeDeprecatedResult:Yt,normalizeForwardResult:ot,normalizeRedirectResult:jt,normalizeValidateResult:Rt},this._unknownHandler=i,this._invalidHandler=Bn(s),this._deprecatedHandler=a,this._identifyMissing=(F,f)=>!(F in f)||c(F,f),this._identifyRequired=D,this._preprocess=p,this._postprocess=l,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=hn()}normalize(t){let r={},u=[this._preprocess(t,this._utils)],o=()=>{for(;u.length!==0;){let i=u.shift(),s=this._applyNormalization(i,r);u.push(...s)}};o();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in r)){let a=Lt(s.default(this._utils));"value"in a&&u.push({[i]:a.value})}}o();for(let i of Object.keys(this._utils.schemas)){if(!(i in r))continue;let s=this._utils.schemas[i],a=r[i],c=s.postprocess(a,this._utils);c!==ge&&(this._applyValidation(c,i,s),r[i]=c)}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(t,r){let n=[],{knownKeys:u,unknownKeys:o}=this._partitionOptionKeys(t);for(let i of u){let s=this._utils.schemas[i],a=s.preprocess(t[i],this._utils);this._applyValidation(a,i,s);let c=({from:F,to:f})=>{n.push(typeof f=="string"?{[f]:F}:{[f.key]:f.value})},D=({value:F,redirectTo:f})=>{let d=Yt(s.deprecated(F,this._utils),a,!0);if(d!==!1)if(d===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,f,this._utils));else for(let{value:m}of d){let C={key:i,value:m};if(!this._hasDeprecationWarned(C)){let E=typeof f=="string"?{key:f,value:m}:f;this._utils.logger.warn(this._deprecatedHandler(C,E,this._utils))}}};ot(s.forward(a,this._utils),a).forEach(c);let l=jt(s.redirect(a,this._utils),a);if(l.redirect.forEach(c),"remain"in l){let F=l.remain;r[i]=i in r?s.overlap(r[i],F,this._utils):F,D({value:F})}for(let{from:F,to:f}of l.redirect)D({value:F,redirectTo:f})}for(let i of o){let s=t[i];this._applyUnknownHandler(i,s,r,(a,c)=>{n.push({[a]:c})})}return n}_applyRequiredCheck(t){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,t)&&this._identifyRequired(r))throw this._invalidHandler(r,Ze,this._utils)}_partitionOptionKeys(t){let[r,n]=gn(Object.keys(t).filter(u=>!this._identifyMissing(u,t)),u=>u in this._utils.schemas);return{knownKeys:r,unknownKeys:n}}_applyValidation(t,r,n){let u=Rt(n.validate(t,this._utils),t);if(u!==!0)throw this._invalidHandler(r,u.value,this._utils)}_applyUnknownHandler(t,r,n,u){let o=this._unknownHandler(t,r,this._utils);if(o)for(let i of Object.keys(o)){if(this._identifyMissing(i,o))continue;let s=o[i];i in this._utils.schemas?u(i,s):n[i]=s}}_applyPostprocess(t){let r=this._postprocess(t,this._utils);if(r!==ge){if(r.delete)for(let n of r.delete)delete t[n];if(r.override){let{knownKeys:n,unknownKeys:u}=this._partitionOptionKeys(r.override);for(let o of n){let i=r.override[o];this._applyValidation(i,o,this._utils.schemas[o]),t[o]=i}for(let o of u){let i=r.override[o];this._applyUnknownHandler(o,i,t,(s,a)=>{let c=this._utils.schemas[s];this._applyValidation(a,s,c),t[s]=a})}}}}};var Ut;function lo(e,t,{logger:r=!1,isCLI:n=!1,passThrough:u=!1,FlagSchema:o,descriptor:i}={}){if(n){if(!o)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=re;let s=u?Array.isArray(u)?(l,F)=>u.includes(l)?{[l]:F}:void 0:(l,F)=>({[l]:F}):(l,F,f)=>{let{_:d,...m}=f.schemas;return et(l,F,{...f,schemas:m})},a=Fo(t,{isCLI:n,FlagSchema:o}),c=new Dt(a,{logger:r,unknown:s,descriptor:i}),D=r!==!1;D&&Ut&&(c._hasDeprecationWarned=Ut);let p=c.normalize(e);return D&&(Ut=c._hasDeprecationWarned),p}function Fo(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(rt.create({name:"_"}));for(let u of e)n.push(po(u,{isCLI:t,optionInfos:e,FlagSchema:r})),u.alias&&t&&n.push(tt.create({name:u.alias,sourceName:u.name}));return n}function po(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:u}=e,o={name:u},i,s={};switch(e.type){case"int":i=at,t&&(o.preprocess=Number);break;case"string":i=Ie;break;case"choice":i=it,o.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case"boolean":i=ut;break;case"flag":i=n,o.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case"path":i=Ie;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(a,c,D)=>e.exception(a)||c.validate(a,D):o.validate=(a,c,D)=>a===void 0||c.validate(a,D),e.redirect&&(s.redirect=a=>a?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let a=o.preprocess||(c=>c);o.preprocess=(c,D,p)=>D.preprocess(a(Array.isArray(c)?y(!1,c,-1):c),p)}return e.array?nt.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...s,valueSchema:i.create(o)}):i.create({...o,...s})}var kn=lo;var mo=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let u=t[n];if(r(u,n,t))return u}}},Vt=mo;function $t(e,t){if(!t)throw new Error("parserName is required.");let r=Vt(!1,e,u=>u.parsers&&Object.prototype.hasOwnProperty.call(u.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new ve(n)}function Sn(e,t){if(!t)throw new Error("astFormat is required.");let r=Vt(!1,e,u=>u.printers&&Object.prototype.hasOwnProperty.call(u.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new ve(n)}function Re({plugins:e,parser:t}){let r=$t(e,t);return Wt(r,t)}function Wt(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function Tn(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var Nn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function Eo(e,t={}){var p;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=on(r,{physicalFile:r.filepath}),!r.parser)throw new Le(`No parser could be inferred for file "${r.filepath}".`)}else throw new Le("No parser and no file path given, couldn't infer a parser.");let n=Qe({plugins:e.plugins,showDeprecated:!0}).options,u={...Nn,...Object.fromEntries(n.filter(l=>l.default!==void 0).map(l=>[l.name,l.default]))},o=$t(r.plugins,r.parser),i=await Wt(o,r.parser);r.astFormat=i.astFormat,r.locEnd=i.locEnd,r.locStart=i.locStart;let s=(p=o.printers)!=null&&p[i.astFormat]?o:Sn(r.plugins,i.astFormat),a=await Tn(s,i.astFormat);r.printer=a;let c=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,l])=>l!==void 0)):{},D={...u,...c};for(let[l,F]of Object.entries(D))(r[l]===null||r[l]===void 0)&&(r[l]=F);return r.parser==="json"&&(r.trailingComma="none"),kn(r,n,{passThrough:Object.keys(Nn),...t})}var ne=Eo;var vn=gu(Pn(),1);async function yo(e,t){let r=await Re(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let u;try{u=await r.parse(n,t,t)}catch(o){Ao(o,e)}return{text:n,ast:u}}function Ao(e,t){let{loc:r}=e;if(r){let n=(0,vn.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+=` -`+n,e.codeFrame=n,e}throw e}var De=yo;async function Ln(e,t,r,n,u){let{embeddedLanguageFormatting:o,printer:{embed:i,hasPrettierIgnore:s=()=>!1,getVisitorKeys:a}}=r;if(!i||o!=="auto")return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let c=J(i.getVisitorKeys??a),D=[];F();let p=e.stack;for(let{print:f,node:d,pathStack:m}of D)try{e.stack=m;let C=await f(l,t,e,r);C&&u.set(d,C)}catch(C){if(globalThis.PRETTIER_DEBUG)throw C}e.stack=p;function l(f,d){return Bo(f,d,r,n)}function F(){let{node:f}=e;if(f===null||typeof f!="object"||s(e))return;for(let m of c(f))Array.isArray(f[m])?e.each(F,m):e.call(F,m);let d=i(e,r);if(d){if(typeof d=="function"){D.push({print:d,node:f,pathStack:[...e.stack]});return}u.set(f,d)}}}async function Bo(e,t,r,n){let u=await ne({...r,...t,parentParser:r.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:o}=await De(e,u),i=await n(o,u);return $e(i)}function _o(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:u,locEnd:o,[Symbol.for("printedComments")]:i}=t,{node:s}=e,a=u(s),c=o(s);for(let D of n)u(D)>=a&&o(D)<=c&&i.add(D);return r.slice(a,c)}var In=_o;async function Ye(e,t){({ast:e}=await Gt(e,t));let r=new Map,n=new Or(e),u=Kr(t),o=new Map;await Ln(n,s,t,Ye,o);let i=await Rn(n,t,s,void 0,o);if(Gr(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[X,i];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[i,X]}return i;function s(c,D){return c===void 0||c===n?a(D):Array.isArray(c)?n.call(()=>a(D),...c):n.call(()=>a(D),c)}function a(c){u(n);let D=n.node;if(D==null)return"";let p=D&&typeof D=="object"&&c===void 0;if(p&&r.has(D))return r.get(D);let l=Rn(n,t,s,c,o);return p&&r.set(D,l),l}}function Rn(e,t,r,n,u){var a;let{node:o}=e,{printer:i}=t,s;switch((a=i.hasPrettierIgnore)!=null&&a.call(i,e)?s=In(e,t):u.has(o)?s=u.get(o):s=i.print(e,t,r,n),o){case t.cursorNode:s=Fe(s,c=>[X,c,X]);break;case t.nodeBeforeCursor:s=Fe(s,c=>[c,X]);break;case t.nodeAfterCursor:s=Fe(s,c=>[X,c]);break}return i.printComment&&(!i.willPrintOwnComments||!i.willPrintOwnComments(e,t))&&(s=Mr(e,s,t)),s}async function Gt(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("printedComments")]=new Set,Vr(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function xo(e,t){let{cursorOffset:r,locStart:n,locEnd:u}=t,o=J(t.printer.getVisitorKeys),i=F=>n(F)<=r&&u(F)>=r,s=e,a=[e];for(let F of Lr(e,{getVisitorKeys:o,filter:i}))a.push(F),s=F;if(Ir(s,{getVisitorKeys:o}))return{cursorNode:s};let c,D,p=-1,l=Number.POSITIVE_INFINITY;for(;a.length>0&&(c===void 0||D===void 0);){s=a.pop();let F=c!==void 0,f=D!==void 0;for(let d of Ce(s,{getVisitorKeys:o})){if(!F){let m=u(d);m<=r&&m>p&&(c=d,p=m)}if(!f){let m=n(d);m>=r&&mi(l,a)).filter(Boolean);let c={},D=new Set(u(s));for(let l in s)!Object.prototype.hasOwnProperty.call(s,l)||o.has(l)||(D.has(l)?c[l]=i(s[l],s):c[l]=s[l]);let p=r(s,c,a);if(p!==null)return p??c}}var Yn=wo;var bo=(e,t,r)=>{if(!(e&&t==null)){if(t.findLastIndex)return t.findLastIndex(r);for(let n=t.length-1;n>=0;n--){let u=t[n];if(r(u,n,t))return n}return-1}},jn=bo;var ko=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function So(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(u=>$n.has(u.type)&&n.has(u))}function Un(e){let t=jn(!1,e,r=>r.type!=="Program"&&r.type!=="File");return t===-1?e:e.slice(0,t+1)}function To(e,t,{locStart:r,locEnd:n}){let u=e.node,o=t.node;if(u===o)return{startNode:u,endNode:o};let i=r(e.node);for(let a of Un(t.parentNodes))if(r(a)>=i)o=a;else break;let s=n(t.node);for(let a of Un(e.parentNodes)){if(n(a)<=s)u=a;else break;if(u===o)break}return{startNode:u,endNode:o}}function zt(e,t,r,n,u=[],o){let{locStart:i,locEnd:s}=r,a=i(e),c=s(e);if(!(t>c||tn);let s=e.slice(n,u).search(/\S/u),a=s===-1;if(!a)for(n+=s;u>n&&!/\S/u.test(e[u-1]);--u);let c=zt(r,n,t,(F,f)=>Vn(t,F,f),[],"rangeStart"),D=a?c:zt(r,u,t,F=>Vn(t,F),[],"rangeEnd");if(!c||!D)return{rangeStart:0,rangeEnd:0};let p,l;if(ko(t)){let F=So(c,D);p=F,l=F}else({startNode:p,endNode:l}=To(c,D,t));return{rangeStart:Math.min(o(p),o(l)),rangeEnd:Math.max(i(p),i(l))}}var zn="\uFEFF",Mn=Symbol("cursor");async function Hn(e,t,r=0){if(!e||e.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:u}=await De(e,t);t.cursorOffset>=0&&(t={...t,...Kt(n,t)});let o=await Ye(n,t,r);r>0&&(o=Ge([z,o],r,t.tabWidth));let i=me(o,t);if(r>0){let a=i.formatted.trim();i.cursorNodeStart!==void 0&&(i.cursorNodeStart-=i.formatted.indexOf(a),i.cursorNodeStart<0&&(i.cursorNodeStart=0,i.cursorNodeText=i.cursorNodeText.trimStart()),i.cursorNodeStart+i.cursorNodeText.length>a.length&&(i.cursorNodeText=i.cursorNodeText.trimEnd())),i.formatted=a+xe(t.endOfLine)}let s=t[Symbol.for("comments")];if(t.cursorOffset>=0){let a,c,D,p;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&i.cursorNodeText)if(D=i.cursorNodeStart,p=i.cursorNodeText,t.cursorNode)a=t.locStart(t.cursorNode),c=u.slice(a,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");a=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let C=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):u.length;c=u.slice(a,C)}else a=0,c=u,D=0,p=i.formatted;let l=t.cursorOffset-a;if(c===p)return{formatted:i.formatted,cursorOffset:D+l,comments:s};let F=c.split("");F.splice(l,0,Mn);let f=p.split(""),d=Et(F,f),m=D;for(let C of d)if(C.removed){if(C.value.includes(Mn))break}else m+=C.count;return{formatted:i.formatted,cursorOffset:m,comments:s}}return{formatted:i.formatted,cursorOffset:-1,comments:s}}async function Po(e,t){let{ast:r,text:n}=await De(e,t),{rangeStart:u,rangeEnd:o}=Wn(n,t,r),i=n.slice(u,o),s=Math.min(u,n.lastIndexOf(` -`,u)+1),a=n.slice(s,u).match(/^\s*/u)[0],c=Ee(a,t.tabWidth),D=await Hn(i,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>u&&t.cursorOffset<=o?t.cursorOffset-u:-1,endOfLine:"lf"},c),p=D.formatted.trimEnd(),{cursorOffset:l}=t;l>o?l+=p.length-i.length:D.cursorOffset>=0&&(l=D.cursorOffset+u);let F=n.slice(0,u)+p+n.slice(o);if(t.endOfLine!=="lf"){let f=xe(t.endOfLine);l>=0&&f===`\r -`&&(l+=Ct(F.slice(0,l),` -`)),F=te(!1,F,` -`,f)}return{formatted:F,cursorOffset:l,comments:D.comments}}function Ht(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function Gn(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:u}=t;return r=Ht(e,r,-1),n=Ht(e,n,0),u=Ht(e,u,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:u}}function Jn(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o}=Gn(e,t),i=e.charAt(0)===zn;if(i&&(e=e.slice(1),r--,n--,u--),o==="auto"&&(o=nr(e)),e.includes("\r")){let s=a=>Ct(e.slice(0,Math.max(a,0)),`\r -`);r-=s(r),n-=s(n),u-=s(u),e=ur(e)}return{hasBOM:i,text:e,options:Gn(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o})}}async function Kn(e,t){let r=await Re(t);return!r.hasPragma||r.hasPragma(e)}async function vo(e,t){var n;let r=await Re(t);return(n=r.hasIgnorePragma)==null?void 0:n.call(r,e)}async function Jt(e,t){let{hasBOM:r,text:n,options:u}=Jn(e,await ne(t));if(u.rangeStart>=u.rangeEnd&&n!==""||u.requirePragma&&!await Kn(n,u)||u.checkIgnorePragma&&await vo(n,u))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let o;return u.rangeStart>0||u.rangeEnd=0&&o.cursorOffset++),o}async function qn(e,t,r){let{text:n,options:u}=Jn(e,await ne(t)),o=await De(n,u);return r&&(r.preprocessForPrint&&(o.ast=await Gt(o.ast,u)),r.massage&&(o.ast=Yn(o.ast,u))),o}async function Xn(e,t){t=await ne(t);let r=await Ye(e,t);return me(r,t)}async function Qn(e,t){let r=wr(e),{formatted:n}=await Jt(r,{...t,parser:"__js_expression"});return n}async function Zn(e,t){t=await ne(t);let{ast:r}=await De(e,t);return t.cursorOffset>=0&&(t={...t,...Kt(r,t)}),Ye(r,t)}async function eu(e,t){return me(e,await ne(t))}var qt={};dt(qt,{builders:()=>Io,printer:()=>Ro,utils:()=>Yo});var Io={join:ke,line:Me,softline:_r,hardline:z,literalline:We,group:At,conditionalGroup:Cr,fill:hr,lineSuffix:Se,lineSuffixBoundary:Ar,cursor:X,breakParent:pe,ifBreak:gr,trim:Br,indent:ie,indentIfBreak:yr,align:oe,addAlignmentToDoc:Ge,markAsRoot:mr,dedentToRoot:dr,dedent:Er,hardlineWithoutBreakParent:Te,literallineWithoutBreakParent:Bt,label:xr,concat:e=>e},Ro={printDocToString:me},Yo={willBreak:Dr,traverseDoc:le,findInDoc:Ve,mapDoc:be,removeLines:fr,stripTrailingHardline:$e,replaceEndOfLine:lr,canBreak:Fr};var tu="3.6.2";var Qt={};dt(Qt,{addDanglingComment:()=>ee,addLeadingComment:()=>se,addTrailingComment:()=>ae,getAlignmentSize:()=>Ee,getIndentSize:()=>ru,getMaxContinuousCount:()=>nu,getNextNonSpaceNonCommentCharacter:()=>uu,getNextNonSpaceNonCommentCharacterIndex:()=>Xo,getPreferredQuote:()=>iu,getStringWidth:()=>Ne,hasNewline:()=>G,hasNewlineInRange:()=>su,hasSpaces:()=>au,isNextLineEmpty:()=>ti,isNextLineEmptyAfterIndex:()=>ct,isPreviousLineEmpty:()=>Zo,makeString:()=>Du,skip:()=>he,skipEverythingButNewLine:()=>Je,skipInlineComment:()=>ye,skipNewline:()=>U,skipSpaces:()=>T,skipToLineEnd:()=>He,skipTrailingComment:()=>Ae,skipWhitespace:()=>Rr});function jo(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;rMath.max(n,u.length/t.length),0)}var nu=Mo;function Go(e,t){let r=je(e,t);return r===!1?"":e.charAt(r)}var uu=Go;var ft="'",ou='"';function Ko(e,t){let r=t===!0||t===ft?ft:ou,n=r===ft?ou:ft,u=0,o=0;for(let i of e)i===r?u++:i===n&&o++;return u>o?n:r}var iu=Ko;function zo(e,t,r){for(let n=t;ns===n?s:a===t?"\\"+a:a||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)?s:"\\"+s));return t+o+t}var Du=Jo;function qo(e,t,r){return je(e,r(t))}function Xo(e,t){return arguments.length===2||typeof t=="number"?je(e,t):qo(...arguments)}function Qo(e,t,r){return Pe(e,r(t))}function Zo(e,t){return arguments.length===2||typeof t=="number"?Pe(e,t):Qo(...arguments)}function ei(e,t,r){return ct(e,r(t))}function ti(e,t){return arguments.length===2||typeof t=="number"?ct(e,t):ei(...arguments)}function ce(e,t=1){return async(...r)=>{let n=r[t]??{},u=n.plugins??[];return r[t]={...n,plugins:Array.isArray(u)?u:Object.values(u)},e(...r)}}var cu=ce(Jt);async function fu(e,t){let{formatted:r}=await cu(e,{...t,cursorOffset:-1});return r}async function ri(e,t){return await fu(e,t)===e}var ni=ce(Qe,0),ui={parse:ce(qn),formatAST:ce(Xn),formatDoc:ce(Qn),printToDoc:ce(Zn),printDocToString:ce(eu)};var xf=Zt; - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. -(() => { -"use strict"; -/*!**************************!*\ - !*** ./src/prettier.mjs ***! - \**************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ runTest: () => (/* binding */ runTest) -/* harmony export */ }); -/* harmony import */ var prettier_standalone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prettier/standalone */ "./node_modules/prettier/standalone.mjs"); -/* harmony import */ var prettier_parser_babel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prettier/parser-babel */ "./node_modules/prettier/plugins/babel.js"); -/* harmony import */ var prettier_plugins_estree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prettier/plugins/estree */ "./node_modules/prettier/plugins/estree.mjs"); -// Copyright 2017 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - - - -const payloads = [ - { - name: "preact-8.2.5.js", - options: { semi: false, useTabs: false, parser: "babel" }, - }, - { - name: "lodash.core-4.17.21.js", - options: { semi: true, useTabs: true, parser: "babel" }, - }, - { - name: "todomvc/react/app.jsx", - options: { semi: false, useTabs: true, parser: "babel" }, - }, - { - name: "todomvc/react/footer.jsx", - options: { - jsxBracketSameLine: true, - semi: true, - useTabs: true, - parser: "babel", - }, - }, - { - name: "todomvc/react/todoItem.jsx", - options: { semi: false, singleQuote: true, useTabs: true, parser: "babel" }, - }, -]; - -async function runTest(fileData) { - const testData = payloads.map(({ name, options }) => ({ - payload: fileData[name], - options, - })); - - return Promise.all( - testData.map(({ payload, options }) => - prettier_standalone__WEBPACK_IMPORTED_MODULE_0__["default"].format(payload, { ...options, plugins: [prettier_parser_babel__WEBPACK_IMPORTED_MODULE_1__, prettier_plugins_estree__WEBPACK_IMPORTED_MODULE_2__["default"]] }) - ) - ); -} - -})(); - -self.WTBenchmark = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/web-tooling-benchmark/dist/prettier.bundle.min.js b/web-tooling-benchmark/dist/prettier.bundle.min.js new file mode 100644 index 00000000..dd3b46f6 --- /dev/null +++ b/web-tooling-benchmark/dist/prettier.bundle.min.js @@ -0,0 +1 @@ +(()=>{var e={44582:e=>{var t;e.exports=(t=function(){"use strict";var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,i=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty,a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,r)=>{for(var s in r)t(e,s,{get:r[s],enumerable:!0})},u=(e,i,a,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let u of s(i))!n.call(e,u)&&u!==a&&t(e,u,{get:()=>i[u],enumerable:!(o=r(i,u))||o.enumerable});return e},p=(r,s,n)=>(n=null!=r?e(i(r)):{},u(!s&&r&&r.__esModule?n:t(n,"default",{value:r,enumerable:!0}),r)),l=e=>u(t({},"__esModule",{value:!0}),e),c=a(e=>{function t(e,t){if(null==e)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;r[s]=e[s]}return r}Object.defineProperty(e,"__esModule",{value:!0});var r=class{constructor(e,t,r){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=t,this.index=r}},s=class{constructor(e,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=t}};function i(e,t){let{line:s,column:i,index:n}=e;return new r(s,i+t,n+t)}var n="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",a={ImportMetaOutsideModule:{message:"import.meta may appear only with 'sourceType: \"module\"'",code:n},ImportOutsideModule:{message:"'import' and 'export' may appear only with 'sourceType: \"module\"'",code:n}},o={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},u=e=>"UpdateExpression"===e.type?o.UpdateExpression[`${e.prefix}`]:o[e.type],p={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",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.",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.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",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.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:e})=>`'${"ForInStatement"===e?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:e})=>`Unsyntactic ${"BreakStatement"===e?"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 `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${u(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${u(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${u(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,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.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",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.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},l={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},c={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},h=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),d=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${u({type:e})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",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.'}),m=["message"];function y(e,t,r){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:r})}function f({toMessage:e,code:t,reasonCode:s,syntaxPlugin:i}){let n="MissingPlugin"===s||"MissingOneOfPlugins"===s;{let e={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};e[s]&&(s=e[s])}return function a(o,u){let p=new SyntaxError;return p.code=t,p.reasonCode=s,p.loc=o,p.pos=o.index,p.syntaxPlugin=i,n&&(p.missingPlugin=u.missingPlugin),y(p,"clone",function(e={}){var t;let{line:s,column:i,index:n}=null!=(t=e.loc)?t:o;return a(new r(s,i,n),Object.assign({},u,e.details))}),y(p,"details",u),Object.defineProperty(p,"message",{configurable:!0,get(){let t=`${e(u)} (${o.line}:${o.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),p}}function D(e,r){if(Array.isArray(e))return t=>D(t,e[0]);let s={};for(let i of Object.keys(e)){let n=e[i],a="string"==typeof n?{message:()=>n}:"function"==typeof n?{message:n}:n,{message:o}=a,u=t(a,m),p="string"==typeof o?()=>o:o;s[i]=f(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:i,toMessage:p},r?{syntaxPlugin:r}:{},u))}return s}var x=Object.assign({},D(a),D(p),D(l),D(c),D`pipelineOperator`(d));function g(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function E(e){let t=g();if(null==e)return t;if(null!=e.annexB&&!1!==e.annexB)throw new Error("The `annexB` option can only be set to `false`.");for(let r of Object.keys(t))null!=e[r]&&(t[r]=e[r]);if(1===t.startLine)null==e.startIndex&&t.startColumn>0?t.startIndex=t.startColumn:null==e.startColumn&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((null==e.startColumn||null==e.startIndex)&&null!=e.startIndex)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}var{defineProperty:A}=Object,T=(e,t)=>{e&&A(e,t,{enumerable:!1,value:e[t]})};function C(e){return T(e.loc.start,"index"),T(e.loc.end,"index"),e}var F=e=>class extends e{parse(){let e=C(super.parse());return 256&this.optionFlags&&(e.tokens=e.tokens.map(C)),e}parseRegExpLiteral({pattern:e,flags:t}){let r=null;try{r=new RegExp(e,t)}catch{}let s=this.estreeParseLiteral(r);return s.regex={pattern:e,flags:t},s}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let r=this.estreeParseLiteral(t);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let t=this.estreeParseLiteral(null);return t.decimal=String(t.value||e),t}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,t){let r=this.startNodeAtNode(e);return r.expression=e,this.finishNodeAt(r,"ChainExpression",t)}directiveToStmt(e){let t=e.value;delete e.value,this.castNodeTo(t,"Literal"),t.raw=t.extra.raw,t.value=t.extra.expressionValue;let r=this.castNodeTo(e,"ExpressionStatement");return r.expression=t,r.directive=t.extra.rawValue,delete t.extra,r}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:t,end:r,loc:s,range:i,raw:n,value:a}=e,o=Object.create(e.constructor.prototype);return o.type="Literal",o.start=t,o.end=r,o.loc=s,o.range=i,o.raw=n,o.value=a,o}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){null!=e&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var t;return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&!(null!=(t=e.expression.extra)&&t.parenthesized)}parseBlockBody(e,t,r,s,i){super.parseBlockBody(e,t,r,s,i);let n=e.directives.map(e=>this.directiveToStmt(e));e.body=n.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return delete e.id,e.name=t,this.castNodeTo(e,"PrivateIdentifier")}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?"PrivateIdentifier"===e.type:super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,t){let r=super.parseLiteral(e,t);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,t,r=!1){super.parseFunctionBody(e,t,r),e.expression="BlockStatement"!==e.body.type}parseMethod(e,t,r,s,i,n,a=!1){let o=this.startNode();o.kind=e.kind,o=super.parseMethod(o,t,r,s,i,n,a),delete o.kind;let{typeParameters:u}=e;u&&(delete e.typeParameters,o.typeParameters=u,this.resetStartLocationFromNode(o,u));let p=this.castNodeTo(o,"FunctionExpression");return e.value=p,"ClassPrivateMethod"===n&&(e.computed=!1),"ObjectMethod"===n?("method"===e.kind&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return"Literal"===e.type?"constructor"===e.value:super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(t,"PropertyDefinition"),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(t,"PropertyDefinition"),t.computed=!1),t}parseClassAccessorProperty(e){let t=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")&&(t.abstract&&this.hasPlugin("typescript")?(delete t.abstract,this.castNodeTo(t,"TSAbstractAccessorProperty")):this.castNodeTo(t,"AccessorProperty")),t}parseObjectProperty(e,t,r,s){let i=super.parseObjectProperty(e,t,r,s);return i&&(i.kind="init",this.castNodeTo(i,"Property")),i}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}isValidLVal(e,t,r){return"Property"===e?"value":super.isValidLVal(e,t,r)}isAssignable(e,t){return null!=e&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(null!=e&&this.isObjectProperty(e)){let{key:r,value:s}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(s,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,r){"Property"!==e.type||"get"!==e.kind&&"set"!==e.kind?"Property"===e.type&&e.method?this.raise(x.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,r):this.raise(x.PatternHasAccessor,e.key)}finishCallExpression(e,t){let r=super.finishCallExpression(e,t);var s,i;return"Import"===r.callee.type?(this.castNodeTo(r,"ImportExpression"),r.source=r.arguments[0],r.options=null!=(s=r.arguments[1])?s:null,r.attributes=null!=(i=r.arguments[1])?i:null,delete r.arguments,delete r.callee):"OptionalCallExpression"===r.type?this.castNodeTo(r,"CallExpression"):r.optional=!1,r}toReferencedArguments(e){"ImportExpression"!==e.type&&super.toReferencedArguments(e)}parseExport(e,t){let r=this.state.lastTokStartLoc,s=super.parseExport(e,t);switch(s.type){case"ExportAllDeclaration":s.exported=null;break;case"ExportNamedDeclaration":1===s.specifiers.length&&"ExportNamespaceSpecifier"===s.specifiers[0].type&&(this.castNodeTo(s,"ExportAllDeclaration"),s.exported=s.specifiers[0].exported,delete s.specifiers);case"ExportDefaultDeclaration":{var i;let{declaration:e}=s;"ClassDeclaration"===(null==e?void 0:e.type)&&(null==(i=e.decorators)?void 0:i.length)>0&&e.start===s.start&&this.resetStartLocation(s,r)}}return s}stopParseSubscript(e,t){let r=super.stopParseSubscript(e,t);return t.optionalChainMember?this.estreeParseChainExpression(r,e.loc.end):r}parseMember(e,t,r,s,i){let n=super.parseMember(e,t,r,s,i);return"OptionalMemberExpression"===n.type?this.castNodeTo(n,"MemberExpression"):n.optional=!1,n}isOptionalMemberExpression(e){return"ChainExpression"===e.type?"MemberExpression"===e.expression.type:super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return"ChainExpression"===e.type&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return"Property"===e.type&&"init"===e.kind&&!e.method}isObjectMethod(e){return"Property"===e.type&&(e.method||"get"===e.kind||"set"===e.kind)}castNodeTo(e,t){let r=super.castNodeTo(e,t);return this.fillOptionalPropertiesForTSESLint(r),r}cloneIdentifier(e){let t=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(t),t}cloneStringLiteral(e){return"Literal"===e.type?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,t,r){return C(super.finishNodeAt(e,t,r))}finishNode(e,t){let r=super.finishNode(e,t);return this.fillOptionalPropertiesForTSESLint(r),r}resetStartLocation(e,t){super.resetStartLocation(e,t),C(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),C(e)}},b=class{constructor(e,t){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!t}},S={brace:new b("{"),j_oTag:new b("...",!0)};S.template=new b("`",!0);var P=!0,v=!0,w=!0,I=!0,k=!0,N=!0,B=class{constructor(e,t={}){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=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=null!=t.binop?t.binop:null,this.updateContext=null}},L=new Map;function M(e,t={}){t.keyword=e;let r=V(e,t);return L.set(e,r),r}function O(e,t){return V(e,{beforeExpr:P,binop:t})}var j=-1,R=[],_=[],U=[],$=[],q=[],J=[];function V(e,t={}){var r,s,i,n;return++j,_.push(e),U.push(null!=(r=t.binop)?r:-1),$.push(null!=(s=t.beforeExpr)&&s),q.push(null!=(i=t.startsExpr)&&i),J.push(null!=(n=t.prefix)&&n),R.push(new B(e,t)),j}function H(e,t={}){var r,s,i,n;return++j,L.set(e,j),_.push(e),U.push(null!=(r=t.binop)?r:-1),$.push(null!=(s=t.beforeExpr)&&s),q.push(null!=(i=t.startsExpr)&&i),J.push(null!=(n=t.prefix)&&n),R.push(new B("name",t)),j}var W={bracketL:V("[",{beforeExpr:P,startsExpr:v}),bracketHashL:V("#[",{beforeExpr:P,startsExpr:v}),bracketBarL:V("[|",{beforeExpr:P,startsExpr:v}),bracketR:V("]"),bracketBarR:V("|]"),braceL:V("{",{beforeExpr:P,startsExpr:v}),braceBarL:V("{|",{beforeExpr:P,startsExpr:v}),braceHashL:V("#{",{beforeExpr:P,startsExpr:v}),braceR:V("}"),braceBarR:V("|}"),parenL:V("(",{beforeExpr:P,startsExpr:v}),parenR:V(")"),comma:V(",",{beforeExpr:P}),semi:V(";",{beforeExpr:P}),colon:V(":",{beforeExpr:P}),doubleColon:V("::",{beforeExpr:P}),dot:V("."),question:V("?",{beforeExpr:P}),questionDot:V("?."),arrow:V("=>",{beforeExpr:P}),template:V("template"),ellipsis:V("...",{beforeExpr:P}),backQuote:V("`",{startsExpr:v}),dollarBraceL:V("${",{beforeExpr:P,startsExpr:v}),templateTail:V("...`",{startsExpr:v}),templateNonTail:V("...${",{beforeExpr:P,startsExpr:v}),at:V("@"),hash:V("#",{startsExpr:v}),interpreterDirective:V("#!..."),eq:V("=",{beforeExpr:P,isAssign:I}),assign:V("_=",{beforeExpr:P,isAssign:I}),slashAssign:V("_=",{beforeExpr:P,isAssign:I}),xorAssign:V("_=",{beforeExpr:P,isAssign:I}),moduloAssign:V("_=",{beforeExpr:P,isAssign:I}),incDec:V("++/--",{prefix:k,postfix:N,startsExpr:v}),bang:V("!",{beforeExpr:P,prefix:k,startsExpr:v}),tilde:V("~",{beforeExpr:P,prefix:k,startsExpr:v}),doubleCaret:V("^^",{startsExpr:v}),doubleAt:V("@@",{startsExpr:v}),pipeline:O("|>",0),nullishCoalescing:O("??",1),logicalOR:O("||",1),logicalAND:O("&&",2),bitwiseOR:O("|",3),bitwiseXOR:O("^",4),bitwiseAND:O("&",5),equality:O("==/!=/===/!==",6),lt:O("/<=/>=",7),gt:O("/<=/>=",7),relational:O("/<=/>=",7),bitShift:O("<>/>>>",8),bitShiftL:O("<>/>>>",8),bitShiftR:O("<>/>>>",8),plusMin:V("+/-",{beforeExpr:P,binop:9,prefix:k,startsExpr:v}),modulo:V("%",{binop:10,startsExpr:v}),star:V("*",{binop:10}),slash:O("/",10),exponent:V("**",{beforeExpr:P,binop:11,rightAssociative:!0}),_in:M("in",{beforeExpr:P,binop:7}),_instanceof:M("instanceof",{beforeExpr:P,binop:7}),_break:M("break"),_case:M("case",{beforeExpr:P}),_catch:M("catch"),_continue:M("continue"),_debugger:M("debugger"),_default:M("default",{beforeExpr:P}),_else:M("else",{beforeExpr:P}),_finally:M("finally"),_function:M("function",{startsExpr:v}),_if:M("if"),_return:M("return",{beforeExpr:P}),_switch:M("switch"),_throw:M("throw",{beforeExpr:P,prefix:k,startsExpr:v}),_try:M("try"),_var:M("var"),_const:M("const"),_with:M("with"),_new:M("new",{beforeExpr:P,startsExpr:v}),_this:M("this",{startsExpr:v}),_super:M("super",{startsExpr:v}),_class:M("class",{startsExpr:v}),_extends:M("extends",{beforeExpr:P}),_export:M("export"),_import:M("import",{startsExpr:v}),_null:M("null",{startsExpr:v}),_true:M("true",{startsExpr:v}),_false:M("false",{startsExpr:v}),_typeof:M("typeof",{beforeExpr:P,prefix:k,startsExpr:v}),_void:M("void",{beforeExpr:P,prefix:k,startsExpr:v}),_delete:M("delete",{beforeExpr:P,prefix:k,startsExpr:v}),_do:M("do",{isLoop:w,beforeExpr:P}),_for:M("for",{isLoop:w}),_while:M("while",{isLoop:w}),_as:H("as",{startsExpr:v}),_assert:H("assert",{startsExpr:v}),_async:H("async",{startsExpr:v}),_await:H("await",{startsExpr:v}),_defer:H("defer",{startsExpr:v}),_from:H("from",{startsExpr:v}),_get:H("get",{startsExpr:v}),_let:H("let",{startsExpr:v}),_meta:H("meta",{startsExpr:v}),_of:H("of",{startsExpr:v}),_sent:H("sent",{startsExpr:v}),_set:H("set",{startsExpr:v}),_source:H("source",{startsExpr:v}),_static:H("static",{startsExpr:v}),_using:H("using",{startsExpr:v}),_yield:H("yield",{startsExpr:v}),_asserts:H("asserts",{startsExpr:v}),_checks:H("checks",{startsExpr:v}),_exports:H("exports",{startsExpr:v}),_global:H("global",{startsExpr:v}),_implements:H("implements",{startsExpr:v}),_intrinsic:H("intrinsic",{startsExpr:v}),_infer:H("infer",{startsExpr:v}),_is:H("is",{startsExpr:v}),_mixins:H("mixins",{startsExpr:v}),_proto:H("proto",{startsExpr:v}),_require:H("require",{startsExpr:v}),_satisfies:H("satisfies",{startsExpr:v}),_keyof:H("keyof",{startsExpr:v}),_readonly:H("readonly",{startsExpr:v}),_unique:H("unique",{startsExpr:v}),_abstract:H("abstract",{startsExpr:v}),_declare:H("declare",{startsExpr:v}),_enum:H("enum",{startsExpr:v}),_module:H("module",{startsExpr:v}),_namespace:H("namespace",{startsExpr:v}),_interface:H("interface",{startsExpr:v}),_type:H("type",{startsExpr:v}),_opaque:H("opaque",{startsExpr:v}),name:V("name",{startsExpr:v}),placeholder:V("%%",{startsExpr:v}),string:V("string",{startsExpr:v}),num:V("num",{startsExpr:v}),bigint:V("bigint",{startsExpr:v}),decimal:V("decimal",{startsExpr:v}),regexp:V("regexp",{startsExpr:v}),privateName:V("#name",{startsExpr:v}),eof:V("eof"),jsxName:V("jsxName"),jsxText:V("jsxText",{beforeExpr:P}),jsxTagStart:V("jsxTagStart",{startsExpr:v}),jsxTagEnd:V("jsxTagEnd")};function z(e){return e>=93&&e<=133}function K(e){return e<=92}function X(e){return e>=58&&e<=133}function G(e){return e>=58&&e<=137}function Y(e){return $[e]}function Q(e){return q[e]}function Z(e){return e>=29&&e<=33}function ee(e){return e>=129&&e<=131}function te(e){return e>=90&&e<=92}function re(e){return e>=58&&e<=92}function se(e){return e>=39&&e<=59}function ie(e){return 34===e}function ne(e){return J[e]}function ae(e){return e>=121&&e<=123}function oe(e){return e>=124&&e<=130}function ue(e){return _[e]}function pe(e){return U[e]}function le(e){return 57===e}function ce(e){return e>=24&&e<=25}function he(e){return R[e]}R[8].updateContext=e=>{e.pop()},R[5].updateContext=R[7].updateContext=R[23].updateContext=e=>{e.push(S.brace)},R[22].updateContext=e=>{e[e.length-1]===S.template?e.pop():e.push(S.template)},R[143].updateContext=e=>{e.push(S.j_expr,S.j_oTag)};var de="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",me="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",ye=new RegExp("["+de+"]"),fe=new RegExp("["+de+me+"]");de=me=null;var De=[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,4,51,13,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,39,27,10,22,251,41,7,1,17,2,60,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,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,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,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,229,29,3,0,496,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],xe=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,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,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,343,9,54,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,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function ge(e,t){let r=65536;for(let s=0,i=t.length;se)return!1;if(r+=t[s+1],r>=e)return!0}return!1}function Ee(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&ye.test(String.fromCharCode(e)):ge(e,De)))}function Ae(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&fe.test(String.fromCharCode(e)):ge(e,De)||ge(e,xe))))}var Te={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Ce=new Set(Te.keyword),Fe=new Set(Te.strict),be=new Set(Te.strictBind);function Se(e,t){return t&&"await"===e||"enum"===e}function Pe(e,t){return Se(e,t)||Fe.has(e)}function ve(e){return be.has(e)}function we(e,t){return Pe(e,t)||ve(e)}function Ie(e){return Ce.has(e)}function ke(e,t,r){return 64===e&&64===t&&Ee(r)}var Ne=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Be(e){return Ne.has(e)}var Le=class{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}},Me=class{constructor(e,t){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=t}get inTopLevel(){return(1&this.currentScope().flags)>0}get inFunction(){return(2&this.currentVarScopeFlags())>0}get allowSuper(){return(16&this.currentThisScopeFlags())>0}get allowDirectSuper(){return(32&this.currentThisScopeFlags())>0}get allowNewTarget(){return(512&this.currentThisScopeFlags())>0}get inClass(){return(64&this.currentThisScopeFlags())>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(64&e)>0&&!(2&e)}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(128&t)return!0;if(1731&t)return!1}}get inNonArrowFunction(){return(2&this.currentThisScopeFlags())>0}get inBareCaseStatement(){return(256&this.currentScope().flags)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new Le(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(130&e.flags||!this.parser.inModule&&1&e.flags)}declareName(e,t,r){let s=this.currentScope();if(8&t||16&t){this.checkRedeclarationInScope(s,e,t,r);let i=s.names.get(e)||0;16&t?i|=4:(s.firstLexicalName||(s.firstLexicalName=e),i|=2),s.names.set(e,i),8&t&&this.maybeExportDefined(s,e)}else if(4&t)for(let i=this.scopeStack.length-1;i>=0&&(s=this.scopeStack[i],this.checkRedeclarationInScope(s,e,t,r),s.names.set(e,1|(s.names.get(e)||0)),this.maybeExportDefined(s,e),!(1667&s.flags));--i);this.parser.inModule&&1&s.flags&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&1&e.flags&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,r,s){this.isRedeclaredInScope(e,t,r)&&this.parser.raise(x.VarRedeclaration,s,{identifierName:t})}isRedeclaredInScope(e,t,r){if(!(1&r))return!1;if(8&r)return e.names.has(t);let s=e.names.get(t);return 16&r?(2&s)>0||!this.treatFunctionsAsVarInScope(e)&&(1&s)>0:(2&s)>0&&!(8&e.flags&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(4&s)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(1667&t)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(1731&t&&!(4&t))return t}}},Oe=class extends Le{constructor(...e){super(...e),this.declareFunctions=new Set}},je=class extends Me{createScope(e){return new Oe(e)}declareName(e,t,r){let s=this.currentScope();if(2048&t)return this.checkRedeclarationInScope(s,e,t,r),this.maybeExportDefined(s,e),void s.declareFunctions.add(e);super.declareName(e,t,r)}isRedeclaredInScope(e,t,r){if(super.isRedeclaredInScope(e,t,r))return!0;if(2048&r&&!e.declareFunctions.has(t)){let r=e.names.get(t);return(4&r)>0||(2&r)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},Re=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),_e=D`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:r})=>`Enum \`${e}\` has type \`${r}\`, so the initializer of \`${t}\` needs to be a ${r} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:r})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${r}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Ue(e){return"DeclareExportAllDeclaration"===e.type||"DeclareExportDeclaration"===e.type&&(!e.declaration||"TypeAlias"!==e.declaration.type&&"InterfaceDeclaration"!==e.declaration.type)}function $e(e){return"type"===e.importKind||"typeof"===e.importKind}var qe={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Je(e,t){let r=[],s=[];for(let i=0;iclass extends e{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return je}shouldParseTypes(){return this.getPluginOption("flow","all")||"flow"===this.flowPragma}finishToken(e,t){134!==e&&13!==e&&28!==e&&void 0===this.flowPragma&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(void 0===this.flowPragma){let t=Ve.exec(e.value);if(t)if("flow"===t[1])this.flowPragma="flow";else{if("noflow"!==t[1])throw new Error("Unexpected flow pragma");this.flowPragma="noflow"}}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=t,r}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>t.index+1&&this.raise(_e.UnexpectedSpaceBetweenModuloChecks,t),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let t=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[t,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),r=this.startNode(),s=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let i=this.flowParseFunctionTypeParams();return r.params=i.params,r.rest=i.rest,r.this=i._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),s.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(s,"TypeAnnotation"),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,t){return this.match(80)?this.flowParseDeclareClass(e):this.match(68)?this.flowParseDeclareFunction(e):this.match(74)?this.flowParseDeclareVariable(e):this.eatContextual(127)?this.match(16)?this.flowParseDeclareModuleExports(e):(t&&this.raise(_e.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e)):this.isContextual(130)?this.flowParseDeclareTypeAlias(e):this.isContextual(131)?this.flowParseDeclareOpaqueType(e):this.isContextual(129)?this.flowParseDeclareInterface(e):this.match(82)?this.flowParseDeclareExportDeclaration(e,t):void this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let t=e.body=this.startNode(),r=t.body=[];for(this.expect(5);!this.match(8);){let e=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(_e.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(e)):(this.expectContextual(125,_e.UnsupportedStatementInDeclareModule),e=this.flowParseDeclare(e,!0)),r.push(e)}this.scope.exit(),this.expect(8),this.finishNode(t,"BlockStatement");let s=null,i=!1;return r.forEach(e=>{Ue(e)?("CommonJS"===s&&this.raise(_e.AmbiguousDeclareModuleKind,e),s="ES"):"DeclareModuleExports"===e.type&&(i&&this.raise(_e.DuplicateDeclareModuleExports,e),"ES"===s&&this.raise(_e.AmbiguousDeclareModuleKind,e),s="CommonJS",i=!0)}),e.kind=s||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,t){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!t){let e=this.state.value;throw this.raise(_e.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:qe[e]})}return this.match(74)||this.match(68)||this.match(80)||this.isContextual(131)?(e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration")):this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131)?"ExportNamedDeclaration"===(e=this.parseExport(e,null)).type?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration"):void this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return this.castNodeTo(t,"DeclareTypeAlias"),t}flowParseDeclareOpaqueType(e){this.next();let t=this.flowParseOpaqueType(e,!0);return this.castNodeTo(t,"DeclareOpaqueType"),t}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do{e.extends.push(this.flowParseInterfaceExtends())}while(!t&&this.eat(12));if(t){if(e.implements=[],e.mixins=[],this.eatContextual(117))do{e.mixins.push(this.flowParseInterfaceExtends())}while(this.eat(12));if(this.eatContextual(113))do{e.implements.push(this.flowParseInterfaceExtends())}while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){"_"===e&&this.raise(_e.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,r){Re.has(e)&&this.raise(r?_e.AssignReservedType:_e.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifier(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,t){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let t=this.state.startLoc,r=this.startNode(),s=this.flowParseVariance(),i=this.flowParseTypeAnnotatableIdentifier();return r.name=i.name,r.variance=s,r.bound=i.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(_e.MissingTypeParamDefault,t),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let r=!1;do{let e=this.flowParseTypeParameter(r);t.params.push(e),e.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()===S.brace)return e();{let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}}flowParseTypeParameterInstantiationInExpression(){if(47===this.reScan_lt())return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let t=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=t}),this.state.inType=t,!this.state.inType&&this.curContext()===S.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(47!==this.reScan_lt())return;let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do{e.extends.push(this.flowParseInterfaceExtends())}while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,r){return e.static=t,14===this.lookahead().type?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,t){let r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:r,allowProto:s,allowInexact:i}){let n=this.state.inType;this.state.inType=!0;let a=this.startNode();a.callProperties=[],a.properties=[],a.indexers=[],a.internalSlots=[];let o,u,p=!1;for(t&&this.match(6)?(this.expect(6),o=9,u=!0):(this.expect(5),o=8,u=!1),a.exact=u;!this.match(o);){let t=!1,n=null,o=null,l=this.startNode();if(s&&this.isContextual(118)){let t=this.lookahead();14!==t.type&&17!==t.type&&(this.next(),n=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let e=this.lookahead();14!==e.type&&17!==e.type&&(this.next(),t=!0)}let c=this.flowParseVariance();if(this.eat(0))null!=n&&this.unexpected(n),this.eat(0)?(c&&this.unexpected(c.loc.start),a.internalSlots.push(this.flowParseObjectTypeInternalSlot(l,t))):a.indexers.push(this.flowParseObjectTypeIndexer(l,t,c));else if(this.match(10)||this.match(47))null!=n&&this.unexpected(n),c&&this.unexpected(c.loc.start),a.callProperties.push(this.flowParseObjectTypeCallProperty(l,t));else{let e="init";(this.isContextual(99)||this.isContextual(104))&&G(this.lookahead().type)&&(e=this.state.value,this.next());let s=this.flowParseObjectTypeProperty(l,t,n,c,e,r,i??!u);null===s?(p=!0,o=this.state.lastTokStartLoc):a.properties.push(s)}this.flowObjectTypeSemicolon(),o&&!this.match(8)&&!this.match(9)&&this.raise(_e.UnexpectedExplicitInexactInObject,o)}this.expect(o),r&&(a.inexact=p);let l=this.finishNode(a,"ObjectTypeAnnotation");return this.state.inType=n,l}flowParseObjectTypeProperty(e,t,r,s,i,n,a){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(n?a||this.raise(_e.InexactInsideExact,this.state.lastTokStartLoc):this.raise(_e.InexactInsideNonObject,this.state.lastTokStartLoc),s&&this.raise(_e.InexactVariance,s),null):(n||this.raise(_e.UnexpectedSpreadType,this.state.lastTokStartLoc),null!=r&&this.unexpected(r),s&&this.raise(_e.SpreadVariance,s),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=null!=r,e.kind=i;let a=!1;return this.match(47)||this.match(10)?(e.method=!0,null!=r&&this.unexpected(r),s&&this.unexpected(s.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),("get"===i||"set"===i)&&this.flowCheckGetterSetterParams(e),!n&&"constructor"===e.key.name&&e.value.this&&this.raise(_e.ThisParamBannedInConstructor,e.value.this)):("init"!==i&&this.unexpected(),e.method=!1,this.eat(17)&&(a=!0),e.value=this.flowParseTypeInitialiser(),e.variance=s),e.optional=a,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let t="get"===e.kind?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise("get"===e.kind?_e.GetterMayNotHaveThisParam:_e.SetterMayNotHaveThisParam,e.value.this),r!==t&&this.raise("get"===e.kind?x.BadGetterArity:x.BadSetterArity,e),"set"===e.kind&&e.value.rest&&this.raise(x.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){e??(e=this.state.startLoc);let r=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let t=this.startNodeAt(e);t.qualification=r,t.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(t,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,t){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,r)):super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,t,r=!1){if(this.match(14)){let t=this.startNode();[t.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=t.typeAnnotation?this.finishNode(t,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,t,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){if(X(this.lookahead().type)){let e=this.startNode();return this.next(),this.flowParseInterface(e)}}else if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}let t=super.parseStatementLike(e);return void 0===this.flowPragma&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,r){if("Identifier"===t.type)if("declare"===t.name){if(this.match(80)||z(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(z(this.state.type)){if("interface"===t.name)return this.flowParseInterface(e);if("type"===t.name)return this.flowParseTypeAlias(e);if("opaque"===t.name)return this.flowParseOpaqueType(e,!1)}return super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return 126===e||ee(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return 126===e||ee(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let t=this.lookaheadCharCode();if(44===t||61===t||58===t||41===t)return this.setOptionalParametersError(r),e}this.expect(17);let s=this.state.clone(),i=this.state.noArrowAt,n=this.startNodeAt(t),{consequent:a,failed:o}=this.tryParseConditionalConsequent(),[u,p]=this.getArrowLikeExpressions(a);if(o||p.length>0){let e=[...i];if(p.length>0){this.state=s,this.state.noArrowAt=e;for(let t=0;t1&&this.raise(_e.AmbiguousConditionalArrow,s.startLoc),o&&1===u.length&&(this.state=s,e.push(u[0].start),this.state.noArrowAt=e,({consequent:a,failed:o}=this.tryParseConditionalConsequent()))}return this.getArrowLikeExpressions(a,!0),this.state.noArrowAt=i,this.expect(14),n.test=e,n.consequent=a,n.alternate=this.forwardNoArrowParamsConversionAt(n,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(n,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let r=[e],s=[];for(;0!==r.length;){let e=r.pop();"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type?(e.typeParameters||!e.returnType?this.finishArrowValidation(e):s.push(e),r.push(e.body)):"ConditionalExpression"===e.type&&(r.push(e.consequent),r.push(e.alternate))}return t?(s.forEach(e=>this.finishArrowValidation(e)),[s,[]]):Je(s,e=>e.params.every(e=>this.isAssignable(e,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,null==(t=e.extra)?void 0:t.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let r;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),r=t(),this.state.noArrowParamsConversionAt.pop()):r=t(),r}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let e=this.startNodeAt(t);return e.expression=r,e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,"TypeCastExpression")}return r}assertModuleNodeAllowed(e){"ImportDeclaration"===e.type&&("type"===e.importKind||"typeof"===e.importKind)||"ExportNamedDeclaration"===e.type&&"type"===e.exportKind||"ExportAllDeclaration"===e.type&&"type"===e.exportKind||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let t=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}if(this.isContextual(131)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}if(this.isContextual(129)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseInterface(t)}if(this.isContextual(126)){e.exportKind="value";let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDeclaration(e)}eatExportStar(e){return!!super.eatExportStar(e)||!(!this.isContextual(130)||55!==this.lookahead().type)&&(e.exportKind="type",this.next(),this.next(),!0)}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&"type"===e.exportKind&&this.unexpected(t),r}parseClassId(e,t,r){super.parseClassId(e,t,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,r){let{startLoc:s}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,r),t.declare&&("ClassProperty"!==t.type&&"ClassPrivateProperty"!==t.type&&"PropertyDefinition"!==t.type?this.raise(_e.DeclareClassElement,s):t.value&&this.raise(_e.DeclareClassFieldInitializer,t.value))}isIterator(e){return"iterator"===e||"asyncIterator"===e}readIterator(){let e=super.readWord1(),t="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(x.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(132,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);123===e&&124===t?this.finishOp(6,2):!this.state.inType||62!==e&&60!==e?this.state.inType&&63===e?46===t?this.finishOp(18,2):this.finishOp(17,1):ke(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e):this.finishOp(62===e?48:47,1)}isAssignable(e,t){return"TypeCastExpression"===e.type?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&"AssignmentExpression"===e.type&&"TypeCastExpression"===e.left.type&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableList(e,t,r){for(let t=0;t1||!t)&&this.raise(_e.TypeCastInPattern,i.typeAnnotation)}return e}parseArrayLike(e,t,r,s){let i=super.parseArrayLike(e,t,r,s);return t&&!this.state.maybeInArrowParameters&&this.toReferencedList(i.elements),i}isValidLVal(e,t,r){return"TypeCastExpression"===e||super.isValidLVal(e,t,r)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,r,s,i,n){if(t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,r,s,i,n),t.params&&i){let e=t.params;e.length>0&&this.isThisParam(e[0])&&this.raise(_e.ThisParamBannedInConstructor,t)}else if("MethodDefinition"===t.type&&i&&t.value.params){let e=t.value.params;e.length>0&&this.isThisParam(e[0])&&this.raise(_e.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,r,s){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,r,s)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let t=e.implements=[];do{let e=this.startNode();e.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,t.push(this.finishNode(e,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let r=t[0];this.isThisParam(r)&&"get"===e.kind?this.raise(_e.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(_e.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,r,s,i,n,a){let o;e.variance&&this.unexpected(e.variance.loc.start),delete e.variance,this.match(47)&&!n&&(o=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let u=super.parseObjPropValue(e,t,r,s,i,n,a);return o&&((u.value||u).typeParameters=o),u}parseFunctionParamType(e){return this.eat(17)&&("Identifier"!==e.type&&this.raise(_e.PatternIsOptional,e),this.isThisParam(e)&&this.raise(_e.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(_e.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(_e.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return"AssignmentPattern"===r.type&&r.typeAnnotation&&r.right.startsuper.parseMaybeAssign(e,t),i),!s.error)return s.node;let{context:r}=this.state,n=r[r.length-1];(n===S.j_oTag||n===S.j_expr)&&r.pop()}if(null!=(r=s)&&r.error||this.match(47)){var n,a;i=i||this.state.clone();let r,o=this.tryParse(s=>{var i;r=this.flowParseTypeParameterDeclaration();let n=this.forwardNoArrowParamsConversionAt(r,()=>{let s=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(s,r),s});null!=(i=n.extra)&&i.parenthesized&&s();let a=this.maybeUnwrapTypeCastExpression(n);return"ArrowFunctionExpression"!==a.type&&s(),a.typeParameters=r,this.resetStartLocationFromNode(a,r),n},i),u=null;if(o.node&&"ArrowFunctionExpression"===this.maybeUnwrapTypeCastExpression(o.node).type){if(!o.error&&!o.aborted)return o.node.async&&this.raise(_e.UnexpectedTypeParameterBeforeAsyncArrowFunction,r),o.node;u=o.node}if(null!=(n=s)&&n.node)return this.state=s.failState,s.node;if(u)return this.state=o.failState,u;throw null!=(a=s)&&a.thrown?s.error:o.thrown?o.error:this.raise(_e.UnexpectedTokenAfterTypeParameter,r)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(()=>{let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let r=this.startNode();return[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=t,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),r});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,r,s=!0){if(!r||!this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))){for(let t=0;t0&&this.raise(_e.ThisParamMustBeFirst,e.params[t]);super.checkParams(e,t,r,s)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,t,r){if("Identifier"===e.type&&"async"===e.name&&this.state.noArrowAt.includes(t.index)){this.next();let r=this.startNodeAt(t);r.callee=e,r.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(r,"CallExpression")}else if("Identifier"===e.type&&"async"===e.name&&this.match(47)){let s=this.state.clone(),i=this.tryParse(e=>this.parseAsyncArrowWithTypeParameters(t)||e(),s);if(!i.error&&!i.aborted)return i.node;let n=this.tryParse(()=>super.parseSubscripts(e,t,r),s);if(n.node&&!n.error)return n.node;if(i.node)return this.state=i.failState,i.node;if(n.node)return this.state=n.failState,n.node;throw i.error||n.error}return super.parseSubscripts(e,t,r)}parseSubscript(e,t,r,s){if(this.match(18)&&this.isLookaheadToken_lt()){if(s.optionalChainMember=!0,r)return s.stop=!0,e;this.next();let i=this.startNodeAt(t);return i.callee=e,i.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),i.arguments=this.parseCallExpressionArguments(11),i.optional=!0,this.finishCallExpression(i,!0)}if(!r&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let r=this.startNodeAt(t);r.callee=e;let i=this.tryParse(()=>(r.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),r.arguments=super.parseCallExpressionArguments(11),s.optionalChainMember&&(r.optional=!1),this.finishCallExpression(r,s.optionalChainMember)));if(i.node)return i.error&&(this.state=i.failState),i.node}return super.parseSubscript(e,t,r,s)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(47)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(42===e&&47===t&&this.state.hasFlowComment)return this.state.hasFlowComment=!1,this.state.pos+=2,void this.nextToken();super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);124!==e||125!==t?super.readToken_pipe_amp(e):this.finishOp(9,2)}parseTopLevel(e,t){let r=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(_e.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(_e.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();return void(e&&(this.state.pos+=e,this.state.hasFlowComment=!0))}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let r=this.input.charCodeAt(t+e),s=this.input.charCodeAt(t+e+1);return 58===r&&58===s?t+2:"flow-include"===this.input.slice(t+e,t+e+12)?t+12:58===r&&58!==s&&t}hasFlowCommentCompletion(){if(-1===this.input.indexOf("*/",this.state.pos))throw this.raise(x.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(_e.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?"symbol"===t.explicitType?_e.EnumInvalidMemberInitializerSymbolType:_e.EnumInvalidMemberInitializerPrimaryType:_e.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(_e.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(_e.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let r=this.parseNumericLiteral(this.state.value);return t()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 134:{let r=this.parseStringLiteral(this.state.value);return t()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return t()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc;return{id:this.parseIdentifier(!0),init:this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e}}}flowEnumCheckExplicitTypeMismatch(e,t,r){let{explicitType:s}=t;null!==s&&s!==r&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let r=new Set,s={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},i=!1;for(;!this.match(8);){if(this.eat(21)){i=!0;break}let n=this.startNode(),{id:a,init:o}=this.flowEnumMemberRaw(),u=a.name;if(""===u)continue;/^[a-z]/.test(u)&&this.raise(_e.EnumInvalidMemberName,a,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),r.has(u)&&this.raise(_e.EnumDuplicateMemberName,a,{memberName:u,enumName:e}),r.add(u);let p={enumName:e,explicitType:t,memberName:u};switch(n.id=a,o.type){case"boolean":this.flowEnumCheckExplicitTypeMismatch(o.loc,p,"boolean"),n.init=o.value,s.booleanMembers.push(this.finishNode(n,"EnumBooleanMember"));break;case"number":this.flowEnumCheckExplicitTypeMismatch(o.loc,p,"number"),n.init=o.value,s.numberMembers.push(this.finishNode(n,"EnumNumberMember"));break;case"string":this.flowEnumCheckExplicitTypeMismatch(o.loc,p,"string"),n.init=o.value,s.stringMembers.push(this.finishNode(n,"EnumStringMember"));break;case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(o.loc,p);case"none":switch(t){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(o.loc,p);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(o.loc,p);break;default:s.defaultedMembers.push(this.finishNode(n,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:s,hasUnknownMembers:i}}flowEnumStringMembers(e,t,{enumName:r}){if(0===e.length)return t;if(0===t.length)return e;if(t.length>e.length){for(let t of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(t,{enumName:r});return t}for(let e of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:r});return e}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!z(this.state.type))throw this.raise(_e.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),"boolean"!==t&&"number"!==t&&"string"!==t&&"symbol"!==t&&this.raise(_e.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let r=t.name,s=t.loc.start,i=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{members:n,hasUnknownMembers:a}=this.flowEnumMembers({enumName:r,explicitType:i});switch(e.hasUnknownMembers=a,i){case"boolean":return e.explicitType=!0,e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=n.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let t=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let i=n.booleanMembers.length,a=n.numberMembers.length,o=n.stringMembers.length,u=n.defaultedMembers.length;if(!(i||a||o||u))return t();if(!i&&!a)return e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!a&&!o&&i>=u){for(let e of n.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(e.loc.start,{enumName:r,memberName:e.id.name});return e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}if(!i&&!o&&a>=u){for(let e of n.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(e.loc.start,{enumName:r,memberName:e.id.name});return e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}return this.raise(_e.EnumInconsistentMemberValues,s,{enumName:r}),t()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(60===this.input.charCodeAt(e)){let t=this.input.charCodeAt(e+1);return 60!==t&&61!==t}return!1}reScan_lt_gt(){let{type:e}=this.state;47===e?(this.state.pos-=1,this.readToken_lt()):48===e&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return 51===e?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return"TypeCastExpression"===e.type?e.expression:e}},We=new RegExp(/\r\n|[\r\n\u2028\u2029]/.source,"g");function ze(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Ke(e,t,r){for(let s=t;s`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function Ze(e){return!!e&&("JSXOpeningFragment"===e.type||"JSXClosingFragment"===e.type)}function et(e){if("JSXIdentifier"===e.type)return e.name;if("JSXNamespacedName"===e.type)return e.namespace.name+":"+e.name.name;if("JSXMemberExpression"===e.type)return et(e.object)+"."+et(e.property);throw new Error("Node had unexpected type: "+e.type)}var tt=e=>class extends e{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Qe.UnterminatedJsxContent,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:return this.state.pos===this.state.start?void(60===r&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(r)):(e+=this.input.slice(t,this.state.pos),void this.finishToken(142,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;default:ze(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t,r=this.input.charCodeAt(this.state.pos);return++this.state.pos,13===r&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,t=e?"\n":"\r\n"):t=String.fromCharCode(r),++this.state.curLine,this.state.lineStart=this.state.pos,t}jsxReadString(e){let t="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(x.UnterminatedString,this.state.startLoc);let s=this.input.charCodeAt(this.state.pos);if(s===e)break;38===s?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):ze(s)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}t+=this.input.slice(r,this.state.pos++),this.finishToken(134,t)}jsxReadEntity(){let e=++this.state.pos;if(35===this.codePointAtPos(this.state.pos)){++this.state.pos;let e=10;120===this.codePointAtPos(this.state.pos)&&(e=16,++this.state.pos);let t=this.readInt(e,void 0,!1,"bail");if(null!==t&&59===this.codePointAtPos(this.state.pos))return++this.state.pos,String.fromCodePoint(t)}else{let t=0,r=!1;for(;t++<10&&this.state.pos1)for(let t=0;t0?!(256&r)||!!(512&r)!=(4&s)>0:128&r&&(8&s)>0?!!(2&e.names.get(t))&&!!(1&r):!!(2&r&&(1&s)>0)||super.isRedeclaredInScope(e,t,r)}checkLocalExport(e){let{name:t}=e;if(!this.hasImport(t)){for(let e=this.scopeStack.length-1;e>=0;e--){let r=this.scopeStack[e].tsNames.get(t);if((1&r)>0||(16&r)>0)return}super.checkLocalExport(e)}}},it=class{constructor(){this.stacks=[]}enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(2&this.currentFlags())>0}get hasYield(){return(1&this.currentFlags())>0}get hasReturn(){return(4&this.currentFlags())>0}get hasIn(){return(8&this.currentFlags())>0}};function nt(e,t){return(e?2:0)|(t?1:0)}var at=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if("string"==typeof e)return this.plugins.has(e);{let[t,r]=e;if(!this.hasPlugin(t))return!1;let s=this.plugins.get(t);for(let e of Object.keys(r))if((null==s?void 0:s[e])!==r[e])return!1;return!0}}getPluginOption(e,t){var r;return null==(r=this.plugins.get(e))?void 0:r[t]}};function ot(e,t){void 0===e.trailingComments?e.trailingComments=t:e.trailingComments.unshift(...t)}function ut(e,t){void 0===e.leadingComments?e.leadingComments=t:e.leadingComments.unshift(...t)}function pt(e,t){void 0===e.innerComments?e.innerComments=t:e.innerComments.unshift(...t)}function lt(e,t,r){let s=null,i=t.length;for(;null===s&&i>0;)s=t[--i];null===s||s.start>r.start?pt(e,r.comments):ot(s,r.comments)}var ct=class extends at{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,r=t.length;if(0===r)return;let s=r-1,i=t[s];i.start===e.end&&(i.leadingNode=e,s--);let{start:n}=e;for(;s>=0;s--){let r=t[s],i=r.end;if(!(i>n)){i===n&&(r.trailingNode=e);break}r.containingNode=e,this.finalizeComment(r),t.splice(s,1)}}finalizeComment(e){var t;let{comments:r}=e;if(null!==e.leadingNode||null!==e.trailingNode)null!==e.leadingNode&&ot(e.leadingNode,r),null!==e.trailingNode&&ut(e.trailingNode,r);else{let{containingNode:s,start:i}=e;if(44===this.input.charCodeAt(this.offsetToSourcePos(i)-1))switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":lt(s,s.properties,e);break;case"CallExpression":case"OptionalCallExpression":lt(s,s.arguments,e);break;case"ImportExpression":lt(s,[s.source,null!=(t=s.options)?t:null],e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":lt(s,s.params,e);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":lt(s,s.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":lt(s,s.specifiers,e);break;case"TSEnumDeclaration":case"TSEnumBody":lt(s,s.members,e);break;default:pt(s,r)}else pt(s,r)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:r}=t;if(0===r)return;let s=t[r-1];s.leadingNode===e&&(s.leadingNode=null)}takeSurroundingComments(e,t,r){let{commentStack:s}=this.state,i=s.length;if(0===i)return;let n=i-1;for(;n>=0;n--){let i=s[n],a=i.end;if(i.start===r)i.leadingNode=e;else if(a===t)i.trailingNode=e;else if(a0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:t,startIndex:s,startLine:i,startColumn:n}){this.strict=!1!==e&&(!0===e||"module"===t),this.startIndex=s,this.curLine=i,this.lineStart=-n,this.startLoc=this.endLoc=new r(i,n,s)}get maybeInArrowParameters(){return(2&this.flags)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(4&this.flags)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(8&this.flags)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(16&this.flags)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(32&this.flags)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(64&this.flags)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(128&this.flags)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(256&this.flags)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(512&this.flags)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(1024&this.flags)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(2048&this.flags)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(4096&this.flags)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new r(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new e;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},dt=function(e){return e>=48&&e<=57},mt={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},yt={bin:e=>48===e||49===e,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function ft(e,t,r,s,i,n){let a=r,o=s,u=i,p="",l=null,c=r,{length:h}=t;for(;;){if(r>=h){n.unterminated(a,o,u),p+=t.slice(c,r);break}let d=t.charCodeAt(r);if(Dt(e,d,t,r)){p+=t.slice(c,r);break}if(92===d){p+=t.slice(c,r);let a=xt(t,r,s,i,"template"===e,n);null!==a.ch||l?p+=a.ch:l={pos:r,lineStart:s,curLine:i},({pos:r,lineStart:s,curLine:i}=a),c=r}else 8232===d||8233===d?(++i,s=++r):10===d||13===d?"template"===e?(p+=t.slice(c,r)+"\n",++r,13===d&&10===t.charCodeAt(r)&&++r,++i,c=s=r):n.unterminated(a,o,u):++r}return{pos:r,str:p,firstInvalidLoc:l,lineStart:s,curLine:i,containsInvalid:!!l}}function Dt(e,t,r,s){return"template"===e?96===t||36===t&&123===r.charCodeAt(s+1):t===("double"===e?34:39)}function xt(e,t,r,s,i,n){let a=!i;t++;let o=e=>({pos:t,ch:e,lineStart:r,curLine:s}),u=e.charCodeAt(t++);switch(u){case 110:return o("\n");case 114:return o("\r");case 120:{let i;return({code:i,pos:t}=gt(e,t,r,s,2,!1,a,n)),o(null===i?null:String.fromCharCode(i))}case 117:{let i;return({code:i,pos:t}=At(e,t,r,s,a,n)),o(null===i?null:String.fromCodePoint(i))}case 116:return o("\t");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:10===e.charCodeAt(t)&&++t;case 10:r=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);n.strictNumericEscape(t-1,r,s);default:if(u>=48&&u<=55){let a=t-1,u=/^[0-7]+/.exec(e.slice(a,t+2))[0],p=parseInt(u,8);p>255&&(u=u.slice(0,-1),p=parseInt(u,8)),t+=u.length-1;let l=e.charCodeAt(t);if("0"!==u||56===l||57===l){if(i)return o(null);n.strictNumericEscape(a,r,s)}return o(String.fromCharCode(p))}return o(String.fromCharCode(u))}}function gt(e,t,r,s,i,n,a,o){let u,p=t;return({n:u,pos:t}=Et(e,t,r,s,16,i,n,!1,o,!a)),null===u&&(a?o.invalidEscapeSequence(p,r,s):t=p-1),{code:u,pos:t}}function Et(e,t,r,s,i,n,a,o,u,p){let l=t,c=16===i?mt.hex:mt.decBinOct,h=16===i?yt.hex:10===i?yt.dec:8===i?yt.oct:yt.bin,d=!1,m=0;for(let l=0,y=n??1/0;l=97?l-97+10:l>=65?l-65+10:dt(l)?l-48:1/0,n>=i){if(n<=9&&p)return{n:null,pos:t};if(n<=9&&u.invalidDigit(t,r,s,i))n=0;else{if(!a)break;n=0,d=!0}}++t,m=m*i+n}return t===l||null!=n&&t-l!==n||d?{n:null,pos:t}:{n:m,pos:t}}function At(e,t,r,s,i,n){let a;if(123===e.charCodeAt(t)){if(++t,({code:a,pos:t}=gt(e,t,r,s,e.indexOf("}",t)-t,!0,i,n)),++t,null!==a&&a>1114111){if(!i)return{code:null,pos:t};n.invalidCodePoint(t,r,s)}}else({code:a,pos:t}=gt(e,t,r,s,4,!1,i,n));return{code:a,pos:t}}function Tt(e,t,s){return new r(s,e-t,e)}var Ct=new Set([103,109,115,105,121,117,100,118]),Ft=class{constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new s(e.startLoc,e.endLoc)}},bt=class extends ct{constructor(e,t){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(e,t,r,s)=>!!(2048&this.optionFlags)&&(this.raise(x.InvalidDigit,Tt(e,t,r),{radix:s}),!0),numericSeparatorInEscapeSequence:this.errorBuilder(x.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(x.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(x.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(x.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(e,t,r)=>{this.recordStrictModeErrors(x.StrictNumericEscape,Tt(e,t,r))},unterminated:(e,t,r)=>{throw this.raise(x.UnterminatedString,Tt(e-1,t,r))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(x.StrictNumericEscape),unterminated:(e,t,r)=>{throw this.raise(x.UnterminatedTemplate,Tt(e,t,r))}}),this.state=new ht,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),256&this.optionFlags&&this.pushToken(new Ft(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return!!this.match(e)&&(this.next(),!0)}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return Xe.lastIndex=e,Xe.test(this.input)?Xe.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return Ge.lastIndex=e,Ge.test(this.input)?Ge.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if(55296==(64512&t)&&++ethis.raise(e,t)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length?this.finishToken(140):this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let r=this.state.pos,i=this.input.indexOf(e,r+2);if(-1===i)throw this.raise(x.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+e.length,We.lastIndex=r+2;We.test(this.input)&&We.lastIndex<=i;)++this.state.curLine,this.state.lineStart=We.lastIndex;if(this.isLookahead)return;let n={type:"CommentBlock",value:this.input.slice(r+2,i),start:this.sourceToOffsetPos(r),end:this.sourceToOffsetPos(i+e.length),loc:new s(t,this.state.curPosition())};return 256&this.optionFlags&&this.pushToken(n),n}skipLineComment(e){let t,r=this.state.pos;this.isLookahead||(t=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=e);if(this.state.pose))break e;{let e=this.skipLineComment(3);void 0!==e&&(this.addComment(e),null==t||t.push(e))}}else{if(60!==r||this.inModule||!(8192&this.optionFlags))break e;{let e=this.state.pos;if(33!==this.input.charCodeAt(e+1)||45!==this.input.charCodeAt(e+2)||45!==this.input.charCodeAt(e+3))break e;{let e=this.skipLineComment(4);void 0!==e&&(this.addComment(e),null==t||t.push(e))}}}}}if((null==t?void 0:t.length)>0){let r=this.state.pos,s={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(r),comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(s)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let r=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(r)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(0===this.state.pos&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(x.UnexpectedDigitAfterHash,this.state.curPosition());if(123===t||91===t&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),"bar"===this.getPluginOption("recordAndTuple","syntaxType"))throw this.raise(123===t?x.RecordExpressionHashIncorrectStartSyntaxType:x.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,123===t?this.finishToken(7):this.finishToken(1)}else Ee(t)?(++this.state.pos,this.finishToken(139,this.readWord1(t))):92===t?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);e>=48&&e<=57?this.readNumber(!0):46===e&&46===this.input.charCodeAt(this.state.pos+2)?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(0!==this.state.pos||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(33!==e)return!1;let t=this.state.pos;for(this.state.pos+=1;!ze(e)&&++this.state.pos=48&&t<=57?(++this.state.pos,this.finishToken(17)):(this.state.pos+=2,this.finishToken(18))}getTokenFromCode(e){switch(e){case 46:return void this.readToken_dot();case 40:return++this.state.pos,void this.finishToken(10);case 41:return++this.state.pos,void this.finishToken(11);case 59:return++this.state.pos,void this.finishToken(13);case 44:return++this.state.pos,void this.finishToken(12);case 91:if(this.hasPlugin("recordAndTuple")&&124===this.input.charCodeAt(this.state.pos+1)){if("bar"!==this.getPluginOption("recordAndTuple","syntaxType"))throw this.raise(x.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:return++this.state.pos,void this.finishToken(3);case 123:if(this.hasPlugin("recordAndTuple")&&124===this.input.charCodeAt(this.state.pos+1)){if("bar"!==this.getPluginOption("recordAndTuple","syntaxType"))throw this.raise(x.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:return++this.state.pos,void this.finishToken(8);case 58:return void(this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(15,2):(++this.state.pos,this.finishToken(14)));case 63:return void this.readToken_question();case 96:return void this.readTemplateToken();case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(120===e||88===e)return void this.readRadixNumber(16);if(111===e||79===e)return void this.readRadixNumber(8);if(98===e||66===e)return void this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return void this.readNumber(!1);case 34:case 39:return void this.readString(e);case 47:return void this.readToken_slash();case 37:case 42:return void this.readToken_mult_modulo(e);case 124:case 38:return void this.readToken_pipe_amp(e);case 94:return void this.readToken_caret();case 43:case 45:return void this.readToken_plus_min(e);case 60:return void this.readToken_lt();case 62:return void this.readToken_gt();case 61:case 33:return void this.readToken_eq_excl(e);case 126:return void this.finishOp(36,1);case 64:return void this.readToken_atSign();case 35:return void this.readToken_numberSign();case 92:return void this.readWord();default:if(Ee(e))return void this.readWord(e)}throw this.raise(x.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let r=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,r)}readRegexp(){let e,t,r=this.state.startLoc,s=this.state.start+1,{pos:n}=this.state;for(;;++n){if(n>=this.length)throw this.raise(x.UnterminatedRegExp,i(r,1));let s=this.input.charCodeAt(n);if(ze(s))throw this.raise(x.UnterminatedRegExp,i(r,1));if(e)e=!1;else{if(91===s)t=!0;else if(93===s&&t)t=!1;else if(47===s&&!t)break;e=92===s}}let a=this.input.slice(s,n);++n;let o="",u=()=>i(r,n+2-s);for(;n=2&&48===this.input.charCodeAt(t);if(u){let e=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(x.StrictOctalLiteral,r),!this.state.strict){let t=e.indexOf("_");t>0&&this.raise(x.ZeroDigitNumericSeparator,i(r,t))}o=u&&!/[89]/.test(e)}let p=this.input.charCodeAt(this.state.pos);if(46===p&&!o&&(++this.state.pos,this.readInt(10),s=!0,p=this.input.charCodeAt(this.state.pos)),(69===p||101===p)&&!o&&(p=this.input.charCodeAt(++this.state.pos),(43===p||45===p)&&++this.state.pos,null===this.readInt(10)&&this.raise(x.InvalidOrMissingExponent,r),s=!0,a=!0,p=this.input.charCodeAt(this.state.pos)),110===p&&((s||u)&&this.raise(x.InvalidBigIntLiteral,r),++this.state.pos,n=!0),109===p){this.expectPlugin("decimal",this.state.curPosition()),(a||u)&&this.raise(x.InvalidDecimal,r),++this.state.pos;var l=!0}if(Ee(this.codePointAtPos(this.state.pos)))throw this.raise(x.NumberIdentifier,this.state.curPosition());let c=this.input.slice(t,this.state.pos).replace(/[_mn]/g,"");if(n)return void this.finishToken(136,c);if(l)return void this.finishToken(137,c);let h=o?parseInt(c,8):parseFloat(c);this.finishToken(135,h)}readCodePoint(e){let{code:t,pos:r}=At(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=r,t}readString(e){let{str:t,pos:r,curLine:s,lineStart:i}=ft(34===e?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=r+1,this.state.lineStart=i,this.state.curLine=s,this.finishToken(134,t)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:s,pos:i,curLine:n,lineStart:a}=ft("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=a,this.state.curLine=n,s&&(this.state.firstInvalidTemplateEscapePos=new r(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),96===this.input.codePointAt(i)?this.finishToken(24,s?null:e+t+"`"):(this.state.pos++,this.finishToken(25,s?null:e+t+"${"))}recordStrictModeErrors(e,t){let r=t.index;this.state.strict&&!this.state.strictErrors.has(r)?this.raise(e,t):this.state.strictErrors.set(r,[e,t])}readWord1(e){this.state.containsEsc=!1;let t="",r=this.state.pos,s=this.state.pos;for(void 0!==e&&(this.state.pos+=e<=65535?1:2);this.state.pos=0;t--){let r=a[t];if(r.loc.index===n)return a[t]=e(i,s);if(r.loc.indexthis.hasPlugin(e)))throw this.raise(x.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,r,s)=>{this.raise(e,Tt(t,r,s))}}},St=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Pt=class{constructor(e){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new St)}exit(){let e=this.stack.pop(),t=this.current();for(let[r,s]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(r)||t.undefinedPrivateNames.set(r,s):this.parser.raise(x.InvalidPrivateFieldResolution,s,{identifierName:r})}declarePrivateName(e,t,r){let{privateNames:s,loneAccessors:i,undefinedPrivateNames:n}=this.current(),a=s.has(e);if(3&t){let r=a&&i.get(e);r?(a=(3&r)==(3&t)||(4&r)!=(4&t),a||i.delete(e)):a||i.set(e,t)}a&&this.parser.raise(x.PrivateNameRedeclaration,r,{identifierName:e}),s.add(e),n.delete(e)}usePrivateName(e,t){let r;for(r of this.stack)if(r.privateNames.has(e))return;r?r.undefinedPrivateNames.set(e,t):this.parser.raise(x.InvalidPrivateFieldResolution,t,{identifierName:e})}},vt=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return 2===this.type||1===this.type}isCertainlyParameterDeclaration(){return 3===this.type}},wt=class extends vt{constructor(e){super(e),this.declarationErrors=new Map}recordDeclarationError(e,t){let r=t.index;this.declarationErrors.set(r,[e,t])}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},It=class{constructor(e){this.parser=void 0,this.stack=[new vt],this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let r=t.loc.start,{stack:s}=this,i=s.length-1,n=s[i];for(;!n.isCertainlyParameterDeclaration();){if(!n.canBeArrowParameterDeclaration())return;n.recordDeclarationError(e,r),n=s[--i]}this.parser.raise(e,r)}recordArrowParameterBindingError(e,t){let{stack:r}=this,s=r[r.length-1],i=t.loc.start;if(s.isCertainlyParameterDeclaration())this.parser.raise(e,i);else{if(!s.canBeArrowParameterDeclaration())return;s.recordDeclarationError(e,i)}}recordAsyncArrowParametersError(e){let{stack:t}=this,r=t.length-1,s=t[r];for(;s.canBeArrowParameterDeclaration();)2===s.type&&s.recordDeclarationError(x.AwaitBindingIdentifier,e),s=t[--r]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors(([t,r])=>{this.parser.raise(t,r);let s=e.length-2,i=e[s];for(;i.canBeArrowParameterDeclaration();)i.clearDeclarationError(r.index),i=e[--s]})}};function kt(){return new vt(3)}function Nt(){return new wt(1)}function Bt(){return new wt(2)}function Lt(){return new vt}var Mt=class extends bt{addExtra(e,t,r,s=!0){if(!e)return;let{extra:i}=e;null==i&&(i={},e.extra=i),s?i[t]=r:Object.defineProperty(i,t,{enumerable:s,value:r})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let r=this.input.charCodeAt(e+t.length);return!(Ae(r)||55296==(64512&r))}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return!!this.isContextual(e)&&(this.next(),!0)}expectContextual(e,t){if(!this.eatContextual(e)){if(null!=t)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ke(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Ke(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(13))||this.raise(x.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let r={node:null};try{let s=e((e=null)=>{throw r.node=e,r});if(this.state.errors.length>t.errors.length){let e=this.state;return this.state=t,this.state.tokensLength=e.tokensLength,{node:s,error:e.errors[t.errors.length],thrown:!1,aborted:!1,failState:e}}return{node:s,error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let s=this.state;if(this.state=t,e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:s};if(e===r)return{node:r.node,error:null,thrown:!1,aborted:!0,failState:s};throw e}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:r,doubleProtoLoc:s,privateKeyLoc:i,optionalParametersLoc:n}=e;if(!t)return!!(r||s||n||i);null!=r&&this.raise(x.InvalidCoverInitializedName,r),null!=s&&this.raise(x.DuplicateProto,s),null!=i&&this.raise(x.UnexpectedPrivateField,i),null!=n&&this.unexpected(n)}isLiteralPropertyName(){return G(this.state.type)}isPrivateName(e){return"PrivateName"===e.type}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return("MemberExpression"===e.type||"OptionalMemberExpression"===e.type)&&this.isPrivateName(e.property)}isObjectProperty(e){return"ObjectProperty"===e.type}isObjectMethod(e){return"ObjectMethod"===e.type}initializeScopes(e="module"===this.options.sourceType){let t=this.state.labels;this.state.labels=[];let r=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let s=this.inModule;this.inModule=e;let i=this.scope,n=this.getScopeHandler();this.scope=new n(this,e);let a=this.prodParam;this.prodParam=new it;let o=this.classScope;this.classScope=new Pt(this);let u=this.expressionScope;return this.expressionScope=new It(this),()=>{this.state.labels=t,this.exportedIdentifiers=r,this.inModule=s,this.scope=i,this.prodParam=a,this.classScope=o,this.expressionScope=u}}enterInitialScopes(){let e=0;(this.inModule||1&this.optionFlags)&&(e|=2),32&this.optionFlags&&(e|=1),2&this.optionFlags&&(e|=4);let t=1;4&this.optionFlags&&(t|=512),this.scope.enter(t),this.prodParam.enter(e)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;null!==t&&this.expectPlugin("destructuringPrivate",t)}},Ot=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},jt=class{constructor(e,t,r){this.type="",this.start=t,this.end=0,this.loc=new s(r),128&(null==e?void 0:e.optionFlags)&&(this.range=[t,0]),null!=e&&e.filename&&(this.loc.filename=e.filename)}},Rt=jt.prototype;Rt.__clone=function(){let e=new jt(void 0,this.start,this.loc.start),t=Object.keys(this);for(let r=0,s=t.length;r"ParenthesizedExpression"===e.type?Ut(e.expression):e,$t=class extends _t{toAssignable(e,t=!1){var r,s;let i;switch(("ParenthesizedExpression"===e.type||null!=(r=e.extra)&&r.parenthesized)&&(i=Ut(e),t?"Identifier"===i.type?this.expressionScope.recordArrowParameterBindingError(x.InvalidParenthesizedAssignment,e):"MemberExpression"!==i.type&&!this.isOptionalMemberExpression(i)&&this.raise(x.InvalidParenthesizedAssignment,e):this.raise(x.InvalidParenthesizedAssignment,e)),e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":this.castNodeTo(e,"ObjectPattern");for(let r=0,s=e.properties.length,i=s-1;r"ObjectMethod"!==e.type&&(r===t||"SpreadElement"!==e.type)&&this.isAssignable(e))}case"ObjectProperty":return this.isAssignable(e.value);case"SpreadElement":return this.isAssignable(e.argument);case"ArrayExpression":return e.elements.every(e=>null===e||this.isAssignable(e));case"AssignmentExpression":return"="===e.operator;case"ParenthesizedExpression":return this.isAssignable(e.expression);case"MemberExpression":case"OptionalMemberExpression":return!t;default:return!1}}toReferencedList(e,t){return e}toReferencedListDeep(e,t){this.toReferencedList(e,t);for(let t of e)"ArrayExpression"===(null==t?void 0:t.type)&&this.toReferencedListDeep(t.elements)}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(t,"SpreadElement")}parseRestBinding(){let e=this.startNode();return this.next(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(3,93,1),this.finishNode(e,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(e,t,r){let s=1&r,i=[],n=!0;for(;!this.eat(e);)if(n?n=!1:this.expect(12),s&&this.match(12))i.push(null);else{if(this.eat(e))break;if(this.match(21)){let s=this.parseRestBinding();if((this.hasPlugin("flow")||2&r)&&(s=this.parseFunctionParamType(s)),i.push(s),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let e=[];if(2&r)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(x.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());i.push(this.parseBindingElement(r,e))}}return i}parseBindingRestProperty(e){return this.next(),e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,"RestElement")}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(21===e)return this.parseBindingRestProperty(this.startNode());let r=this.startNode();return 139===e?(this.expectPlugin("destructuringPrivate",t),this.classScope.usePrivateName(this.state.value,t),r.key=this.parsePrivateName()):this.parsePropertyName(r),r.method=!1,this.parseObjPropValue(r,t,!1,!1,!0,!1)}parseBindingElement(e,t){let r=this.parseMaybeDefault();return(this.hasPlugin("flow")||2&e)&&this.parseFunctionParamType(r),t.length&&(r.decorators=t,this.resetStartLocationFromNode(r,t[0])),this.parseMaybeDefault(r.loc.start,r)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){if(e??(e=this.state.startLoc),t=t??this.parseBindingAtom(),!this.eat(29))return t;let r=this.startNodeAt(e);return r.left=t,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,"AssignmentPattern")}isValidLVal(e,t,r){switch(e){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(e){return"OptionalMemberExpression"===e.type}checkLVal(e,t,r=64,s=!1,i=!1,n=!1){var a;let o=e.type;if(this.isObjectMethod(e))return;let u=this.isOptionalMemberExpression(e);if(u||"MemberExpression"===o)return u&&(this.expectPlugin("optionalChainingAssign",e.loc.start),"AssignmentExpression"!==t.type&&this.raise(x.InvalidLhsOptionalChaining,e,{ancestor:t})),void(64!==r&&this.raise(x.InvalidPropertyBindingPattern,e));if("Identifier"===o){this.checkIdentifier(e,r,i);let{name:t}=e;return void(s&&(s.has(t)?this.raise(x.ParamDupe,e):s.add(t)))}let p,l,c=this.isValidLVal(o,!(n||null!=(a=e.extra)&&a.parenthesized)&&"AssignmentExpression"===t.type,r);if(!0===c)return;if(!1===c){let s=64===r?x.InvalidLhs:x.InvalidLhsBinding;return void this.raise(s,e,{ancestor:t})}"string"==typeof c?(p=c,l="ParenthesizedExpression"===o):[p,l]=c;let h="ArrayPattern"===o||"ObjectPattern"===o?{type:o}:t,d=e[p];if(Array.isArray(d))for(let e of d)e&&this.checkLVal(e,h,r,s,i,l);else d&&this.checkLVal(d,h,r,s,i,l)}checkIdentifier(e,t,r=!1){this.state.strict&&(r?we(e.name,this.inModule):ve(e.name))&&(64===t?this.raise(x.StrictEvalArguments,e,{referenceName:e.name}):this.raise(x.StrictEvalArgumentsBinding,e,{bindingName:e.name})),8192&t&&"let"===e.name&&this.raise(x.LetInLexicalBinding,e),64&t||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.loc.start)}checkToRestConversion(e,t){switch(e.type){case"ParenthesizedExpression":this.checkToRestConversion(e.expression,t);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(t)break;default:this.raise(x.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return!!this.match(12)&&(this.raise(this.lookaheadCharCode()===e?x.RestTrailingComma:x.ElementAfterRest,this.state.startLoc),!0)}};function qt(e){if(null==e)throw new Error(`Unexpected ${e} value.`);return e}function Jt(e){if(!e)throw new Error("Assert fail")}var Vt=D`typescript`({AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:e=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:e=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,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.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:e=>`'${e}' declarations are not allowed in ambient contexts.`});function Ht(e){switch(e){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function Wt(e){return"private"===e||"public"===e||"protected"===e}function zt(e){return"in"===e||"out"===e}var Kt=e=>class extends e{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:Vt.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:Vt.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:Vt.InvalidModifierOnTypeParameter})}getScopeHandler(){return st}tsIsIdentifier(){return z(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),!this.hasPrecedingLineBreak()&&this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t,r){if(!z(this.state.type)&&58!==this.state.type&&75!==this.state.type)return;let s=this.state.value;if(e.includes(s)){if(r&&this.match(106)||t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return s}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:r,errorTemplate:s=Vt.InvalidModifierOnTypeMember},i){let n=(e,t,r,s)=>{t===r&&i[s]&&this.raise(Vt.InvalidModifiersOrder,e,{orderedModifiers:[r,s]})},a=(e,t,r,s)=>{(i[r]&&t===s||i[s]&&t===r)&&this.raise(Vt.IncompatibleModifiers,e,{modifiers:[r,s]})};for(;;){let{startLoc:o}=this.state,u=this.tsParseModifier(e.concat(t??[]),r,i.static);if(!u)break;Wt(u)?i.accessibility?this.raise(Vt.DuplicateAccessibilityModifier,o,{modifier:u}):(n(o,u,u,"override"),n(o,u,u,"static"),n(o,u,u,"readonly"),i.accessibility=u):zt(u)?(i[u]&&this.raise(Vt.DuplicateModifier,o,{modifier:u}),i[u]=!0,n(o,u,"in","out")):(hasOwnProperty.call(i,u)?this.raise(Vt.DuplicateModifier,o,{modifier:u}):(n(o,u,"static","readonly"),n(o,u,"static","override"),n(o,u,"override","readonly"),n(o,u,"abstract","override"),a(o,u,"declare","override"),a(o,u,"static","abstract")),i[u]=!0),null!=t&&t.includes(u)&&this.raise(s,o,{modifier:u})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,t){let r=[];for(;!this.tsIsListTerminator(e);)r.push(t());return r}tsParseDelimitedList(e,t,r){return qt(this.tsParseDelimitedListWorker(e,t,!0,r))}tsParseDelimitedListWorker(e,t,r,s){let i=[],n=-1;for(;!this.tsIsListTerminator(e);){n=-1;let s=t();if(null==s)return;if(i.push(s),!this.eat(12)){if(this.tsIsListTerminator(e))break;return void(r&&this.expect(12))}n=this.state.lastTokStartLoc.index}return s&&(s.value=n),i}tsParseBracketedList(e,t,r,s,i){s||(r?this.expect(0):this.expect(47));let n=this.tsParseDelimitedList(e,t,i);return r?this.expect(3):this.expect(48),n}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(Vt.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(5);let t=this.startNode();return this.isContextual(76)?(t.method=!1,t.key=this.parseIdentifier(!0),t.computed=!1,t.shorthand=!1):this.unexpected(null,76),this.expect(14),t.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(t)],this.expect(8),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),t=[];for(this.expect(5);!this.match(8);){let e=this.state.type;z(e)||134===e?t.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return e.properties=t,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let t;if(1&e&&this.match(78))if(2&e)t=this.parseIdentifier(!0);else{let e=this.startNode();this.next(),t=this.finishNode(e,"ThisExpression")}else t=this.parseIdentifier(!!(1&e));for(;this.eat(16);){let r=this.startNodeAtNode(t);r.left=t,r.right=this.parseIdentifier(!!(1&e)),t=this.finishNode(r,"TSQualifiedName")}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(81),t.default=this.tsEatThenParseType(29),this.finishNode(t,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let r={value:-1};return t.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),0===t.params.length&&this.raise(Vt.EmptyTypeParameters,t),-1!==r.value&&this.addExtra(t,"trailingComma",r.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsFillSignature(e,t){let r=19===e,s="parameters",i="typeAnnotation";t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),t[s]=this.tsParseBindingListForSignature(),(r||this.match(e))&&(t[i]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let t of e){let{type:e}=t;("AssignmentPattern"===e||"TSParameterProperty"===e)&&this.raise(Vt.UnsupportedSignatureParameterKind,t,{type:e})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,t){return this.tsFillSignature(14,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),!!z(this.state.type)&&(this.next(),this.match(14))}tsTryParseIndexSignature(e){if(!this.match(0)||!this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(3),e.parameters=[t];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,t){if(this.eat(17)&&(e.optional=!0),this.match(10)||this.match(47)){t&&this.raise(Vt.ReadonlyForMethodSignature,e);let r=e;r.kind&&this.match(47)&&this.raise(Vt.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon();let s="parameters",i="typeAnnotation";if("get"===r.kind)r[s].length>0&&(this.raise(x.BadGetterArity,this.state.curPosition()),this.isThisParam(r[s][0])&&this.raise(Vt.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if("set"===r.kind){if(1!==r[s].length)this.raise(x.BadSetterArity,this.state.curPosition());else{let e=r[s][0];this.isThisParam(e)&&this.raise(Vt.AccessorCannotDeclareThisParameter,this.state.curPosition()),"Identifier"===e.type&&e.optional&&this.raise(Vt.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),"RestElement"===e.type&&this.raise(Vt.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r[i]&&this.raise(Vt.SetAccessorCannotHaveReturnType,r[i])}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}{let r=e;t&&(r.readonly=!0);let s=this.tsTryParseTypeAnnotation();return s&&(r.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let t=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(t,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!(!this.match(0)||(this.next(),!this.tsIsIdentifier()))&&(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let t=this.startNode();t.name=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(t,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{let{type:r}=e;t&&"TSRestType"!==r&&"TSOptionalType"!==r&&!("TSNamedTupleMember"===r&&e.optional)&&this.raise(Vt.OptionalTypeBeforeRequired,e),t||(t="TSNamedTupleMember"===r&&e.optional||"TSOptionalType"===r)}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e,t,r,s,i=this.state.startLoc,n=this.eat(21),{startLoc:a}=this.state,o=X(this.state.type)?this.lookaheadCharCode():null;if(58===o)e=!0,r=!1,t=this.parseIdentifier(!0),this.expect(14),s=this.tsParseType();else if(63===o){r=!0;let i=this.state.value,n=this.tsParseNonArrayType();58===this.lookaheadCharCode()?(e=!0,t=this.createIdentifier(this.startNodeAt(a),i),this.expect(17),this.expect(14),s=this.tsParseType()):(e=!1,s=n,this.expect(17))}else s=this.tsParseType(),r=this.eat(17),e=this.eat(14);if(e){let e;t?(e=this.startNodeAt(a),e.optional=r,e.label=t,e.elementType=s,this.eat(17)&&(e.optional=!0,this.raise(Vt.TupleOptionalAfterType,this.state.lastTokStartLoc))):(e=this.startNodeAt(a),e.optional=r,this.raise(Vt.InvalidTupleMemberLabel,s),e.label=s,e.elementType=this.tsParseType()),s=this.finishNode(e,"TSNamedTupleMember")}else if(r){let e=this.startNodeAt(a);e.typeAnnotation=s,s=this.finishNode(e,"TSOptionalType")}if(n){let e=this.startNodeAt(i);e.typeAnnotation=s,s=this.finishNode(e,"TSRestType")}return s}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,t){let r=this.startNode();return"TSConstructorType"===e&&(r.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if("-"===this.state.value){let e=this.startNode(),t=this.lookahead();return 135!==t.type&&136!==t.type&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(z(e)||88===e||84===e){let t=88===e?"TSVoidKeyword":84===e?"TSNullKeyword":Ht(this.state.value);if(void 0!==t&&46!==this.lookaheadCharCode()){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let r=this.startNodeAt(e);r.elementType=t,this.expect(3),t=this.finishNode(r,"TSArrayType")}else{let r=this.startNodeAt(e);r.objectType=t,r.indexType=this.tsParseType(),this.expect(3),t=this.finishNode(r,"TSIndexedAccessType")}return t}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),"readonly"===t&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(Vt.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return ae(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,r){let s=this.startNode(),i=this.eat(r),n=[];do{n.push(t())}while(this.eat(r));return 1!==n.length||i?(s.types=n,this.finishNode(s,e)):n[0]}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return!!this.match(47)||this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(z(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(8,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(3,93,1),e.length===t}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let r=this.startNode(),s=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(s&&this.match(78)){let e=this.tsParseThisTypeOrThisTypePredicate();return"TSThisType"===e.type?(r.parameterName=e,r.asserts=!0,r.typeAnnotation=null,e=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(e,r),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,"TSTypeAnnotation")}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return s?(r.parameterName=this.parseIdentifier(),r.asserts=s,r.typeAnnotation=null,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,t);let n=this.tsParseTypeAnnotation(!1);return r.parameterName=i,r.typeAnnotation=n,r.asserts=s,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(109!==this.state.type)return!1;let e=this.state.containsEsc;return this.next(),!(!z(this.state.type)&&!this.match(78)||(e&&this.raise(x.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),0))}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,"TSTypeAnnotation")}tsParseType(){Jt(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(Vt.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let t=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{{let e=this.startNode();return e.expression=this.tsParseEntityName(3),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSExpressionWithTypeArguments")}});return r.length||this.raise(Vt.EmptyHeritageClauseType,t,{token:e}),r}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),t.declare&&(e.declare=!0),z(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(Vt.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&46!==this.lookaheadCharCode()){let e=this.startNode();return this.next(),this.finishNode(e,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()===S.brace)return e();{let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdentifier(),t||this.checkIdentifier(e.id,1024),this.eat(16)){let t=this.startNode();this.tsParseModuleOrNamespaceDeclaration(t,!0),e.body=t}else this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,t,r){e.isExport=r||!1,e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let s=this.tsParseModuleReference();return"type"===e.importKind&&"TSExternalModuleReference"!==s.type&&this.raise(Vt.ImportAliasHasImportType,s),e.moduleReference=s,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&40===this.lookaheadCharCode()}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let t=this.state.clone(),r=e();return this.state=t,r}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!t.aborted&&t.node)return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),r=e();if(void 0!==r&&!1!==r)return r;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type;return this.tsInAmbientContext(()=>{switch(t){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 100:if(this.state.containsEsc)return;case 75:case 74:return this.match(75)&&this.isLookaheadContextual("enum")?(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0})):(e.declare=!0,this.parseVarStatement(e,this.state.value,!0));case 107:if(this.hasPlugin("explicitResourceManagement")&&this.isUsing())return this.raise(Vt.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 96:if(this.hasPlugin("explicitResourceManagement")&&this.isAwaitUsing())return this.raise(Vt.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 129:{let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}default:if(z(t))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,t,r){switch(t.name){case"declare":{let t=this.tsTryParseDeclare(e);return t&&(t.declare=!0),t}case"global":if(this.match(5)){this.scope.enter(1024),this.prodParam.enter(0);let r=e;return r.kind="global",e.global=!0,r.id=t,r.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1,r)}}tsParseDeclaration(e,t,r,s){switch(t){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||z(this.state.type)))return this.tsParseAbstractDeclaration(e,s);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(z(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&z(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&z(this.state.type))return this.tsParseTypeAliasDeclaration(e)}}tsCheckLineTerminator(e){return e?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let t=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let t=this.startNodeAt(e);return t.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(t),t.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),t});return this.state.maybeInArrowParameters=t,r?super.parseArrowExpression(r,null,!0):void 0}tsParseTypeArgumentsInExpression(){if(47===this.reScan_lt())return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),0===e.params.length?this.raise(Vt.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===S.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return oe(this.state.type)}isExportDefaultSpecifier(){return!this.tsIsDeclarationStart()&&super.isExportDefaultSpecifier()}parseBindingElement(e,t){let r=t.length?t[0].loc.start:this.state.startLoc,s={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},s);let i=s.accessibility,n=s.override,a=s.readonly;!(4&e)&&(i||a||n)&&this.raise(Vt.UnexpectedParameterModifier,r);let o=this.parseMaybeDefault();2&e&&this.parseFunctionParamType(o);let u=this.parseMaybeDefault(o.loc.start,o);if(i||a||n){let e=this.startNodeAt(r);return t.length&&(e.decorators=t),i&&(e.accessibility=i),a&&(e.readonly=a),n&&(e.override=n),"Identifier"!==u.type&&"AssignmentPattern"!==u.type&&this.raise(Vt.UnsupportedParameterPropertyKind,e),e.parameter=u,this.finishNode(e,"TSParameterProperty")}return t.length&&(o.decorators=t),u}isSimpleParameter(e){return"TSParameterProperty"===e.type&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)"Identifier"!==t.type&&t.optional&&!this.state.isAmbientContext&&this.raise(Vt.PatternIsOptional,t)}setArrowFunctionParameters(e,t,r){super.setArrowFunctionParameters(e,t,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let s="FunctionDeclaration"===t?"TSDeclareFunction":"ClassMethod"===t||"ClassPrivateMethod"===t?"TSDeclareMethod":void 0;return s&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,s):"TSDeclareFunction"===s&&this.state.isAmbientContext&&(this.raise(Vt.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,s,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{"TSTypeCastExpression"===(null==e?void 0:e.type)&&this.raise(Vt.UnexpectedTypeAnnotation,e.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t,r,s){let i=super.parseArrayLike(e,t,r,s);return"ArrayExpression"===i.type&&this.tsCheckForInvalidTypeCasts(i.elements),i}parseSubscript(e,t,r,s){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let r=this.startNodeAt(t);return r.expression=e,this.finishNode(r,"TSNonNullExpression")}let i=!1;if(this.match(18)&&60===this.lookaheadCharCode()){if(r)return s.stop=!0,e;s.optionalChainMember=i=!0,this.next()}if(this.match(47)||this.match(51)){let n,a=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let e=this.tsTryParseGenericAsyncArrowFunction(t);if(e)return e}let a=this.tsParseTypeArgumentsInExpression();if(!a)return;if(i&&!this.match(10))return void(n=this.state.curPosition());if(ce(this.state.type)){let r=super.parseTaggedTemplateExpression(e,t,s);return r.typeParameters=a,r}if(!r&&this.eat(10)){let r=this.startNodeAt(t);return r.callee=e,r.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(r.arguments),r.typeParameters=a,s.optionalChainMember&&(r.optional=i),this.finishCallExpression(r,s.optionalChainMember)}let o=this.state.type;if(48===o||52===o||10!==o&&Q(o)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(t);return u.expression=e,u.typeParameters=a,this.finishNode(u,"TSInstantiationExpression")});if(n&&this.unexpected(n,10),a)return"TSInstantiationExpression"===a.type&&((this.match(16)||this.match(18)&&40!==this.lookaheadCharCode())&&this.raise(Vt.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(a.expression=super.stopParseSubscript(e,s))),a}return super.parseSubscript(e,t,r,s)}parseNewCallee(e){var t;super.parseNewCallee(e);let{callee:r}=e;"TSInstantiationExpression"===r.type&&(null==(t=r.extra)||!t.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,t,r){let s;if(pe(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(s=this.isContextual(120)))){let i=this.startNodeAt(t);return i.expression=e,i.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(s&&this.raise(x.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(i,s?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(i,t,r)}return super.parseExprOp(e,t,r)}checkReservedWord(e,t,r,s){this.state.isAmbientContext||super.checkReservedWord(e,t,r,s)}checkImportReflection(e){super.checkImportReflection(e),e.module&&"value"!==e.importKind&&this.raise(Vt.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let t=this.lookaheadCharCode();return e?123===t||42===t:61!==t}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,s){super.applyImportPhase(e,t,r,s),t?e.exportKind="type"===r?"type":"value":e.importKind="type"===r||"typeof"===r?r:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let t;if(z(this.state.type)&&61===this.lookaheadCharCode())return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(61===this.lookaheadCharCode())return this.tsParseImportEqualsDeclaration(e,r);t=super.parseImportSpecifiersAndAfter(e,r)}else t=super.parseImport(e);return"type"===t.importKind&&t.specifiers.length>1&&"ImportDefaultSpecifier"===t.specifiers[0].type&&this.raise(Vt.TypeImportCannotSpecifyDefaultAndNamed,t),t}parseExport(e,t){if(this.match(83)){let t=e;this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(t,!1):t.importKind="value",this.tsParseImportEqualsDeclaration(t,r,!0)}if(this.eat(29)){let t=e;return t.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"TSExportAssignment")}if(this.eatContextual(93)){let t=e;return this.expectContextual(128),t.id=this.parseIdentifier(),this.semicolon(),this.finishNode(t,"TSNamespaceExportDeclaration")}return super.parseExport(e,t)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,r=!1){let{isAmbientContext:s}=this.state,i=super.parseVarStatement(e,t,r||s);if(!s)return i;if(!e.declare&&("using"===t||"await using"===t))return this.raiseOverwrite(Vt.UsingDeclarationInAmbientContext,e,t),i;for(let{id:e,init:r}of i.declarations)r&&("var"===t||"let"===t||e.typeAnnotation?this.raise(Vt.InitializerNotAllowedInAmbientContext,r):Gt(r,this.hasPlugin("estree"))||this.raise(Vt.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,r));return i}parseStatementContent(e,t){if(this.match(75)&&this.isLookaheadContextual("enum")){let e=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(e,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,t){return t.some(t=>Wt(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&123===this.lookaheadCharCode()}parseClassMember(e,t,r){let s=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:s,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:Vt.InvalidModifierOnTypeParameterPositions},t);let i=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,s)&&this.raise(Vt.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,r,!!t.static)};t.declare?this.tsInAmbientContext(i):i()}parseClassMemberWithIsStatic(e,t,r,s){let i=this.tsTryParseIndexSignature(t);if(i)return e.body.push(i),t.abstract&&this.raise(Vt.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(Vt.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(Vt.IndexSignatureHasDeclare,t),void(t.override&&this.raise(Vt.IndexSignatureHasOverride,t));!this.state.inAbstractClass&&t.abstract&&this.raise(Vt.NonAbstractClassHasAbstractMethod,t),t.override&&(r.hadSuperClass||this.raise(Vt.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,r,s)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(Vt.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(Vt.ClassMethodHasDeclare,e)}parseExpressionStatement(e,t,r){return("Identifier"===t.type?this.tsParseExpressionStatement(e,t,r):void 0)||super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){return!!this.tsIsDeclarationStart()||super.shouldParseExportDeclaration()}parseConditional(e,t,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let t=this.lookaheadCharCode();if(44===t||61===t||58===t||41===t)return this.setOptionalParametersError(r),e}return super.parseConditional(e,t,r)}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(t);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(Vt.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let s=z(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return s?(("TSInterfaceDeclaration"===s.type||"TSTypeAliasDeclaration"===s.type||r)&&(e.exportKind="type"),r&&"TSImportEqualsDeclaration"!==s.type&&(this.resetStartLocation(s,t),s.declare=!0),s):null}parseClassId(e,t,r,s){if((!t||r)&&this.isContextual(113))return;super.parseClassId(e,t,r,e.declare?1024:8331);let i=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);i&&(e.typeParameters=i)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(Vt.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:t}=e;this.raise(Vt.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:"Identifier"!==t.type||e.computed?`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`:t.name})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(Vt.PrivateElementHasAbstract,e),e.accessibility&&this.raise(Vt.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(Vt.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,r,s,i,n){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&i&&this.raise(Vt.ConstructorHasTypeParameters,a);let{declare:o=!1,kind:u}=t;o&&("get"===u||"set"===u)&&this.raise(Vt.DeclareAccessor,t,{kind:u}),a&&(t.typeParameters=a),super.pushClassMethod(e,t,r,s,i,n)}pushClassPrivateMethod(e,t,r,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(t.typeParameters=i),super.pushClassPrivateMethod(e,t,r,s)}declareClassPrivateMethodInScope(e,t){"TSDeclareMethod"!==e.type&&("MethodDefinition"===e.type&&null==e.value.body||super.declareClassPrivateMethodInScope(e,t))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,t,r,s,i,n,a){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);return o&&(e.typeParameters=o),super.parseObjPropValue(e,t,r,s,i,n,a)}parseFunctionParams(e,t){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),"Identifier"===e.id.type&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){var r,s,i,n,a;let o,u,p;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(o=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,t),o),!u.error)return u.node;let{context:r}=this.state,s=r[r.length-1];(s===S.j_oTag||s===S.j_expr)&&r.pop()}if(!(null!=(r=u)&&r.error||this.match(47)))return super.parseMaybeAssign(e,t);(!o||o===this.state)&&(o=this.state.clone());let l,c=this.tryParse(r=>{var s,i;l=this.tsParseTypeParameters(this.tsParseConstModifier);let n=super.parseMaybeAssign(e,t);return("ArrowFunctionExpression"!==n.type||null!=(s=n.extra)&&s.parenthesized)&&r(),0!==(null==(i=l)?void 0:i.params.length)&&this.resetStartLocationFromNode(n,l),n.typeParameters=l,n},o);if(!c.error&&!c.aborted)return l&&this.reportReservedArrowTypeParam(l),c.node;if(!u&&(Jt(!this.hasPlugin("jsx")),p=this.tryParse(()=>super.parseMaybeAssign(e,t),o),!p.error))return p.node;if(null!=(s=u)&&s.node)return this.state=u.failState,u.node;if(c.node)return this.state=c.failState,l&&this.reportReservedArrowTypeParam(l),c.node;if(null!=(i=p)&&i.node)return this.state=p.failState,p.node;throw(null==(n=u)?void 0:n.error)||c.error||(null==(a=p)?void 0:a.error)}reportReservedArrowTypeParam(e){var t;1===e.params.length&&!e.params[0].constraint&&(null==(t=e.extra)||!t.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(Vt.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&e(),t});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,t);case"TSParameterProperty":return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,t);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":t?this.expressionScope.recordArrowParameterBindingError(Vt.UnexpectedTypeCastInParameter,e):this.raise(Vt.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case"AssignmentExpression":!t&&"TSTypeCastExpression"===e.left.type&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,r){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(64!==r||!t)&&["expression",!0];default:return super.isValidLVal(e,t,r)}}parseBindingAtom(){return 78===this.state.type?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,t){if(this.match(47)||this.match(51)){let r=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let s=super.parseMaybeDecoratorArguments(e,t);return s.typeParameters=r,s}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,t)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return"AssignmentPattern"===r.type&&r.typeAnnotation&&r.right.startthis.isAssignable(e,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeParameters=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=r}}parseClass(e,t,r){let s=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,r)}finally{this.state.inAbstractClass=s}}tsParseAbstractDeclaration(e,t){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(Vt.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,t,r,s,i,n,a){let o=super.parseMethod(e,t,r,s,i,n,a);if((o.abstract||"TSAbstractMethodDefinition"===o.type)&&(this.hasPlugin("estree")?o.value:o).body){let{key:e}=o;this.raise(Vt.AbstractMethodHasImplementation,o,{methodName:"Identifier"!==e.type||o.computed?`[${this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end))}]`:e.name})}return o}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,t,r,s){return!t&&s?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,t,r,s))}parseImportSpecifier(e,t,r,s,i){return!t&&s?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,t,r,s,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,r){let s,i=t?"imported":"local",n=t?"local":"exported",a=e[i],o=!1,u=!0,p=a.loc.start;if(this.isContextual(93)){let e=this.parseIdentifier();if(this.isContextual(93)){let r=this.parseIdentifier();X(this.state.type)?(o=!0,a=e,s=t?this.parseIdentifier():this.parseModuleExportName(),u=!1):(s=r,u=!1)}else X(this.state.type)?(u=!1,s=t?this.parseIdentifier():this.parseModuleExportName()):(o=!0,a=e)}else X(this.state.type)&&(o=!0,t?(a=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(a.name,a.loc.start,!0,!0)):a=this.parseModuleExportName());o&&r&&this.raise(t?Vt.TypeModifierIsUsedInTypeImports:Vt.TypeModifierIsUsedInTypeExports,p),e[i]=a,e[n]=s,e[t?"importKind":"exportKind"]=o?"type":"value",u&&this.eatContextual(93)&&(e[n]=t?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=this.cloneIdentifier(e[i])),t&&this.checkIdentifier(e[n],o?4098:4096)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case"ExpressionStatement":return void(null!=e.directive||(e.directive=void 0));case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":return null!=e.decorators||(e.decorators=[]),null!=e.optional||(e.optional=!1),void(null!=e.typeAnnotation||(e.typeAnnotation=void 0));case"TSParameterProperty":return null!=e.accessibility||(e.accessibility=void 0),null!=e.decorators||(e.decorators=[]),null!=e.override||(e.override=!1),null!=e.readonly||(e.readonly=!1),void(null!=e.static||(e.static=!1));case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":return null!=e.declare||(e.declare=!1),null!=e.returnType||(e.returnType=void 0),void(null!=e.typeParameters||(e.typeParameters=void 0));case"Property":return void(null!=e.optional||(e.optional=!1));case"TSMethodSignature":case"TSPropertySignature":null!=e.optional||(e.optional=!1);case"TSIndexSignature":return null!=e.accessibility||(e.accessibility=void 0),null!=e.readonly||(e.readonly=!1),void(null!=e.static||(e.static=!1));case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":null!=e.declare||(e.declare=!1),null!=e.definite||(e.definite=!1),null!=e.readonly||(e.readonly=!1),null!=e.typeAnnotation||(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":return null!=e.accessibility||(e.accessibility=void 0),null!=e.decorators||(e.decorators=[]),null!=e.override||(e.override=!1),void(null!=e.optional||(e.optional=!1));case"ClassExpression":null!=e.id||(e.id=null);case"ClassDeclaration":return null!=e.abstract||(e.abstract=!1),null!=e.declare||(e.declare=!1),null!=e.decorators||(e.decorators=[]),null!=e.implements||(e.implements=[]),null!=e.superTypeArguments||(e.superTypeArguments=void 0),void(null!=e.typeParameters||(e.typeParameters=void 0));case"TSTypeAliasDeclaration":case"VariableDeclaration":return void(null!=e.declare||(e.declare=!1));case"VariableDeclarator":return void(null!=e.definite||(e.definite=!1));case"TSEnumDeclaration":return null!=e.const||(e.const=!1),void(null!=e.declare||(e.declare=!1));case"TSEnumMember":return void(null!=e.computed||(e.computed=!1));case"TSImportType":return null!=e.qualifier||(e.qualifier=null),void(null!=e.options||(e.options=null));case"TSInterfaceDeclaration":return null!=e.declare||(e.declare=!1),void(null!=e.extends||(e.extends=[]));case"TSModuleDeclaration":return null!=e.declare||(e.declare=!1),void(null!=e.global||(e.global="global"===e.kind));case"TSTypeParameter":return null!=e.const||(e.const=!1),null!=e.in||(e.in=!1),void(null!=e.out||(e.out=!1))}}};function Xt(e){if("MemberExpression"!==e.type)return!1;let{computed:t,property:r}=e;return(!t||"StringLiteral"===r.type||!("TemplateLiteral"!==r.type||r.expressions.length>0))&&Zt(e.object)}function Gt(e,t){var r;let{type:s}=e;if(null!=(r=e.extra)&&r.parenthesized)return!1;if(t){if("Literal"===s){let{value:t}=e;if("string"==typeof t||"boolean"==typeof t)return!0}}else if("StringLiteral"===s||"BooleanLiteral"===s)return!0;return!!(Yt(e,t)||Qt(e,t)||"TemplateLiteral"===s&&0===e.expressions.length||Xt(e))}function Yt(e,t){return t?"Literal"===e.type&&("number"==typeof e.value||"bigint"in e):"NumericLiteral"===e.type||"BigIntLiteral"===e.type}function Qt(e,t){if("UnaryExpression"===e.type){let{operator:r,argument:s}=e;if("-"===r&&Yt(s,t))return!0}return!1}function Zt(e){return"Identifier"===e.type||"MemberExpression"===e.type&&!e.computed&&Zt(e.object)}var er=D`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),tr=e=>class extends e{parsePlaceholder(e){if(this.match(133)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=t,r}getTokenFromCode(e){37===e&&37===this.input.charCodeAt(this.state.pos+1)?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,t,r,s){void 0!==e&&super.checkReservedWord(e,t,r,s)}cloneIdentifier(e){let t=super.cloneIdentifier(e);return"Placeholder"===t.type&&(t.expectedNode=e.expectedNode),t}cloneStringLiteral(e){return"Placeholder"===e.type?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,t,r){return"Placeholder"===e||super.isValidLVal(e,t,r)}toAssignable(e,t){e&&"Placeholder"===e.type&&"Expression"===e.expectedNode?e.expectedNode="Pattern":super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){if(super.chStartsBindingIdentifier(e,t))return!0;let r=this.nextTokenStart();return 37===this.input.charCodeAt(r)&&37===this.input.charCodeAt(r+1)}verifyBreakContinue(e,t){e.label&&"Placeholder"===e.label.type||super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var r;if("Placeholder"!==t.type||null!=(r=t.extra)&&r.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(14)){let r=e;return r.label=this.finishPlaceholder(t,"Identifier"),this.next(),r.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(r,"LabeledStatement")}this.semicolon();let s=e;return s.name=t.name,this.finishPlaceholder(s,"Statement")}parseBlock(e,t,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,t,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,t,r){let s=t?"ClassDeclaration":"ClassExpression";this.next();let i=this.state.strict,n=this.parsePlaceholder("Identifier");if(n){if(!(this.match(81)||this.match(133)||this.match(5))){if(r||!t)return e.id=null,e.body=this.finishPlaceholder(n,"ClassBody"),this.finishNode(e,s);throw this.raise(er.ClassNameIsRequired,this.state.startLoc)}e.id=n}else this.parseClassId(e,t,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,i),this.finishNode(e,s)}parseExport(e,t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,t);let s=e;if(!this.isContextual(98)&&!this.match(12))return s.specifiers=[],s.source=null,s.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(s,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let i=this.startNode();return i.exported=r,s.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],super.parseExport(s,t)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(ue(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var r;return!(null==(r=e.specifiers)||!r.length)||super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;null!=t&&t.length&&(e.specifiers=t.filter(e=>"Placeholder"===e.exported.type)),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder("Identifier");if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(t,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(t);return r.local=t,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(er.UnexpectedSpace,this.state.lastTokEndLoc)}},rr=e=>class extends e{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,t=this.startNode();if(this.next(),z(this.state.type)){let e=this.parseIdentifierName(),r=this.createIdentifier(t,e);if(this.castNodeTo(r,"V8IntrinsicIdentifier"),this.match(10))return r}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},sr=["minimal","fsharp","hack","smart"],ir=["^^","@@","^","%","#"];function nr(e){if(e.has("decorators")){if(e.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let t=e.get("decorators").decoratorsBeforeExport;if(null!=t&&"boolean"!=typeof t)throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let r=e.get("decorators").allowCallParenthesized;if(null!=r&&"boolean"!=typeof r)throw new Error("'allowCallParenthesized' must be a boolean.")}if(e.has("flow")&&e.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(e.has("placeholders")&&e.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(e.has("pipelineOperator")){var t;let s=e.get("pipelineOperator").proposal;if(!sr.includes(s)){let e=sr.map(e=>`"${e}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}if("hack"===s){if(e.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(e.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let t=e.get("pipelineOperator").topicToken;if(!ir.includes(t)){let e=ir.map(e=>`"${e}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`)}var r;if("#"===t&&"hash"===(null==(r=e.get("recordAndTuple"))?void 0:r.syntaxType))throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",e.get("recordAndTuple")])}\`.`)}else if("smart"===s&&"hash"===(null==(t=e.get("recordAndTuple"))?void 0:t.syntaxType))throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",e.get("recordAndTuple")])}\`.`)}if(e.has("moduleAttributes")){if(e.has("deprecatedImportAssert")||e.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if("may-2020"!==e.get("moduleAttributes").version)throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(e.has("importAssertions")&&e.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!e.has("deprecatedImportAssert")&&e.has("importAttributes")&&e.get("importAttributes").deprecatedAssertSyntax&&e.set("deprecatedImportAssert",{}),e.has("recordAndTuple")){let t=e.get("recordAndTuple").syntaxType;if(null!=t){let e=["hash","bar"];if(!e.includes(t))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+e.map(e=>`'${e}'`).join(", "))}}if(e.has("asyncDoExpressions")&&!e.has("doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(e.has("optionalChainingAssign")&&"2023-07"!==e.get("optionalChainingAssign").version)throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var ar={estree:F,jsx:tt,flow:He,typescript:Kt,v8intrinsic:rr,placeholders:tr},or=Object.keys(ar),ur=class extends $t{checkProto(e,t,r,s){if("SpreadElement"===e.type||this.isObjectMethod(e)||e.computed||e.shorthand)return r;let i=e.key;return"__proto__"===("Identifier"===i.type?i.name:i.value)?t?(this.raise(x.RecordNoProto,i),!0):(r&&(s?null===s.doubleProtoLoc&&(s.doubleProtoLoc=i.loc.start):this.raise(x.DuplicateProto,i)),!0):r}shouldExitDescending(e,t){return"ArrowFunctionExpression"===e.type&&this.offsetToSourcePos(e.start)===t}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(x.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(140))throw this.raise(x.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,256&this.optionFlags&&(e.tokens=this.tokens),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,r=this.parseMaybeAssign(e);if(this.match(12)){let s=this.startNodeAt(t);for(s.expressions=[r];this.eat(12);)s.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return r}parseMaybeAssignDisallowIn(e,t){return this.disallowInAnd(()=>this.parseMaybeAssign(e,t))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let r,s=this.state.startLoc,i=this.isContextual(108);if(i&&this.prodParam.hasYield){this.next();let e=this.parseYield(s);return t&&(e=t.call(this,e,s)),e}e?r=!1:(e=new Ot,r=!0);let{type:n}=this.state;(10===n||z(n))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(e);if(t&&(a=t.call(this,a,s)),Z(this.state.type)){let t=this.startNodeAt(s),r=this.state.value;if(t.operator=r,this.match(29)){this.toAssignable(a,!0),t.left=a;let r=s.index;null!=e.doubleProtoLoc&&e.doubleProtoLoc.index>=r&&(e.doubleProtoLoc=null),null!=e.shorthandAssignLoc&&e.shorthandAssignLoc.index>=r&&(e.shorthandAssignLoc=null),null!=e.privateKeyLoc&&e.privateKeyLoc.index>=r&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null)}else t.left=a;return this.next(),t.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(t,"AssignmentExpression")),t}if(r&&this.checkExpressionErrors(e,!0),i){let{type:e}=this.state;if((this.hasPlugin("v8intrinsic")?Q(e):Q(e)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(x.YieldNotInGeneratorFunction,s),this.parseYield(s)}return a}parseMaybeConditional(e){let t=this.state.startLoc,r=this.state.potentialArrowAt,s=this.parseExprOps(e);return this.shouldExitDescending(s,r)?s:this.parseConditional(s,t,e)}parseConditional(e,t,r){if(this.eat(17)){let r=this.startNodeAt(t);return r.test=e,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return e}parseMaybeUnaryOrPrivate(e){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,r=this.state.potentialArrowAt,s=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(s,r)?s:this.parseExprOp(s,t,-1)}parseExprOp(e,t,r){if(this.isPrivateName(e)){let t=this.getPrivateNameSV(e);(r>=pe(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(x.PrivateInExpectedIn,e,{identifierName:t}),this.classScope.usePrivateName(t,e.loc.start)}let s=this.state.type;if(se(s)&&(this.prodParam.hasIn||!this.match(58))){let i=pe(s);if(i>r){if(39===s){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return e;this.checkPipelineAtInfixOperator(e,t)}let n=this.startNodeAt(t);n.left=e,n.operator=this.state.value;let a=41===s||42===s,o=40===s;if(o&&(i=pe(42)),this.next(),39===s&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&96===this.state.type&&this.prodParam.hasAwait)throw this.raise(x.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);n.right=this.parseExprOpRightExpr(s,i);let u=this.finishNode(n,a||o?"LogicalExpression":"BinaryExpression"),p=this.state.type;if(o&&(41===p||42===p)||a&&40===p)throw this.raise(x.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(u,t,r)}}return e}parseExprOpRightExpr(e,t){let r=this.state.startLoc;if(39===e){switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(t))}if("smart"===this.getPluginOption("pipelineOperator","proposal"))return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(x.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(e,t),r)})}return this.parseExprOpBaseRightExpr(e,t)}parseExprOpBaseRightExpr(e,t){let r=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),r,le(e)?t-1:t)}parseHackPipeBody(){var e;let{startLoc:t}=this.state,r=this.parseMaybeAssign();return h.has(r.type)&&!(null!=(e=r.extra)&&e.parenthesized)&&this.raise(x.PipeUnparenthesizedBody,t,{type:r.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(x.PipeTopicUnused,t),r}checkExponentialAfterUnary(e){this.match(57)&&this.raise(x.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let r=this.state.startLoc,s=this.isContextual(96);if(s&&this.recordAwaitIfAllowed()){this.next();let e=this.parseAwait(r);return t||this.checkExponentialAfterUnary(e),e}let i=this.match(34),n=this.startNode();if(ne(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let r=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&r){let e=n.argument;"Identifier"===e.type?this.raise(x.StrictDelete,n):this.hasPropertyAsPrivateName(e)&&this.raise(x.DeletePrivateField,n)}if(!i)return t||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let a=this.parseUpdate(n,i,e);if(s){let{type:e}=this.state;if((this.hasPlugin("v8intrinsic")?Q(e):Q(e)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(x.AwaitNotInAsyncContext,r),this.parseAwait(r)}return a}parseUpdate(e,t,r){if(t){let t=e;return this.checkLVal(t.argument,this.finishNode(t,"UpdateExpression")),e}let s=this.state.startLoc,i=this.parseExprSubscripts(r);if(this.checkExpressionErrors(r,!1))return i;for(;ie(this.state.type)&&!this.canInsertSemicolon();){let e=this.startNodeAt(s);e.operator=this.state.value,e.prefix=!1,e.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(e,"UpdateExpression"))}return i}parseExprSubscripts(e){let t=this.state.startLoc,r=this.state.potentialArrowAt,s=this.parseExprAtom(e);return this.shouldExitDescending(s,r)?s:this.parseSubscripts(s,t)}parseSubscripts(e,t,r){let s={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do{e=this.parseSubscript(e,t,r,s),s.maybeAsyncArrow=!1}while(!s.stop);return e}parseSubscript(e,t,r,s){let{type:i}=this.state;if(!r&&15===i)return this.parseBind(e,t,r,s);if(ce(i))return this.parseTaggedTemplateExpression(e,t,s);let n=!1;if(18===i){if(r&&(this.raise(x.OptionalChainingNoNew,this.state.startLoc),40===this.lookaheadCharCode()))return this.stopParseSubscript(e,s);s.optionalChainMember=n=!0,this.next()}if(!r&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(e,t,s,n);{let r=this.eat(0);return r||n||this.eat(16)?this.parseMember(e,t,s,r,n):this.stopParseSubscript(e,s)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,r,s,i){let n=this.startNodeAt(t);return n.object=e,n.computed=s,s?(n.property=this.parseExpression(),this.expect(3)):this.match(139)?("Super"===e.type&&this.raise(x.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),r.optionalChainMember?(n.optional=i,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(e,t,r,s){let i=this.startNodeAt(t);return i.object=e,this.next(),i.callee=this.parseNoCallExpr(),s.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),t,r)}parseCoverCallAndAsyncArrowHead(e,t,r,s){let i=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let a=this.startNodeAt(t);a.callee=e;let{maybeAsyncArrow:o,optionalChainMember:u}=r;o&&(this.expressionScope.enter(Bt()),n=new Ot),u&&(a.optional=s),a.arguments=s?this.parseCallExpressionArguments(11):this.parseCallExpressionArguments(11,"Super"!==e.type,a,n);let p=this.finishCallExpression(a,u);return o&&this.shouldParseAsyncArrow()&&!s?(r.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),p=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),p)):(o&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(p)),this.state.maybeInArrowParameters=i,p}toReferencedArguments(e,t){this.toReferencedListDeep(e.arguments,t)}parseTaggedTemplateExpression(e,t,r){let s=this.startNodeAt(t);return s.tag=e,s.quasi=this.parseTemplate(!0),r.optionalChainMember&&this.raise(x.OptionalChainingNoTemplate,t),this.finishNode(s,"TaggedTemplateExpression")}atPossibleAsyncArrow(e){return"Identifier"===e.type&&"async"===e.name&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.offsetToSourcePos(e.start)===this.state.potentialArrowAt}finishCallExpression(e,t){if("Import"===e.callee.type)if(0===e.arguments.length||e.arguments.length>2)this.raise(x.ImportCallArity,e);else for(let t of e.arguments)"SpreadElement"===t.type&&this.raise(x.ImportCallSpreadArgument,t);return this.finishNode(e,t?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(e,t,r,s){let i=[],n=!0,a=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(e);){if(n)n=!1;else if(this.expect(12),this.match(e)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(!1,s,t))}return this.state.inFSharpPipelineDirectBody=a,i}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){var r;return this.resetPreviousNodeTrailingComments(t),this.expect(19),this.parseArrowExpression(e,t.arguments,!0,null==(r=t.extra)?void 0:r.trailingCommaLoc),t.innerComments&&pt(e,t.innerComments),t.callee.trailingComments&&pt(e,t.callee.trailingComments),e}parseNoCallExpr(){let e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let t,r=null,{type:s}=this.state;switch(s){case 79:return this.parseSuper();case 83:return t=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(10)?512&this.optionFlags?this.parseImportCall(t):this.finishNode(t,"Import"):(this.raise(x.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,"Import"));case 78:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let e=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(e)}case 0:return this.parseArrayLike(3,!0,!1,e);case 5:return this.parseObjectLike(8,!1,!1,e);case 68:return this.parseFunctionOrFunctionSent();case 26:r=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(r,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{t=this.startNode(),this.next(),t.object=null;let e=t.callee=this.parseNoCallExpr();if("MemberExpression"===e.type)return this.finishNode(t,"BindExpression");throw this.raise(x.UnsupportedBind,e)}case 139:return this.raise(x.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let e=this.getPluginOption("pipelineOperator","proposal");if(e)return this.parseTopicReference(e);this.unexpected();break}case 47:{let e=this.input.codePointAt(this.nextTokenStart());Ee(e)||62===e?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(137===s)return this.parseDecimalLiteral(this.state.value);if(2===s||1===s)return this.parseArrayLike(2===this.state.type?4:3,!1,!0);if(6===s||7===s)return this.parseObjectLike(6===this.state.type?9:8,!1,!0);if(z(s)){if(this.isContextual(127)&&123===this.lookaheadInLineCharCode())return this.parseModuleExpression();let e=this.state.potentialArrowAt===this.state.start,t=this.state.containsEsc,r=this.parseIdentifier();if(!t&&"async"===r.name&&!this.canInsertSemicolon()){let{type:e}=this.state;if(68===e)return this.resetPreviousNodeTrailingComments(r),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(r));if(z(e))return 61===this.lookaheadCharCode()?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(r)):r;if(90===e)return this.resetPreviousNodeTrailingComments(r),this.parseDo(this.startNodeAtNode(r),!0)}return e&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(r),[r],!1)):r}this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=i(this.state.endLoc,-1),this.parseTopicReference(r);this.unexpected()}parseTopicReference(e){let t=this.startNode(),r=this.state.startLoc,s=this.state.type;return this.next(),this.finishTopicReference(t,r,e,s)}finishTopicReference(e,t,r,s){if(this.testTopicReferenceConfiguration(r,t,s))return"hack"===r?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(x.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(x.PrimaryTopicNotAllowed,t),this.registerTopicReference(),this.finishNode(e,"PipelinePrimaryTopicReference"));throw this.raise(x.PipeTopicUnconfiguredToken,t,{token:ue(s)})}testTopicReferenceConfiguration(e,t,r){switch(e){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:ue(r)}]);case"smart":return 27===r;default:throw this.raise(x.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(nt(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(x.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin("doExpressions"),t&&this.expectPlugin("asyncDoExpressions"),e.async=t,this.next();let r=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=r,this.finishNode(e,"DoExpression")}parseSuper(){let e=this.startNode();return this.next(),!this.match(10)||this.scope.allowDirectSuper||16&this.optionFlags?!this.scope.allowSuper&&!(16&this.optionFlags)&&this.raise(x.UnexpectedSuper,e):this.raise(x.SuperNotAllowed,e),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(x.UnsupportedSuper,e),this.finishNode(e,"Super")}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(i(this.state.startLoc,1)),r=this.state.value;return this.next(),e.id=this.createIdentifier(t,r),this.finishNode(e,"PrivateName")}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let t=this.createIdentifier(this.startNodeAtNode(e),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(e,t,"sent")}return this.parseFunction(e)}parseMetaProperty(e,t,r){e.meta=t;let s=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==r||s)&&this.raise(x.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:r}),this.finishNode(e,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(105)||this.isContextual(97)){let t=this.isContextual(105);return this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),e.phase=t?"source":"defer",this.parseImportCall(e)}{let t=this.createIdentifierAt(this.startNodeAtNode(e),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(x.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,"meta")}}parseLiteralAtNode(e,t,r){return this.addExtra(r,"rawValue",e),this.addExtra(r,"raw",this.input.slice(this.offsetToSourcePos(r.start),this.state.end)),r.value=e,this.next(),this.finishNode(r,t)}parseLiteral(e,t){let r=this.startNode();return this.parseLiteralAtNode(e,t,r)}parseStringLiteral(e){return this.parseLiteral(e,"StringLiteral")}parseNumericLiteral(e){return this.parseLiteral(e,"NumericLiteral")}parseBigIntLiteral(e){return this.parseLiteral(e,"BigIntLiteral")}parseDecimalLiteral(e){return this.parseLiteral(e,"DecimalLiteral")}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,"raw",this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,"RegExpLiteral")}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,"BooleanLiteral")}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,"NullLiteral")}parseParenAndDistinguishExpression(e){let t,r=this.state.startLoc;this.next(),this.expressionScope.enter(Nt());let s=this.state.maybeInArrowParameters,i=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n,a,o=this.state.startLoc,u=[],p=new Ot,l=!0;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,null===p.optionalParametersLoc?null:p.optionalParametersLoc),this.match(11)){a=this.state.startLoc;break}if(this.match(21)){let e=this.state.startLoc;if(n=this.state.startLoc,u.push(this.parseParenItem(this.parseRestBinding(),e)),!this.checkCommaAfterRest(41))break}else u.push(this.parseMaybeAssignAllowIn(p,this.parseParenItem))}let c=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=s,this.state.inFSharpPipelineDirectBody=i;let h=this.startNodeAt(r);return e&&this.shouldParseArrow(u)&&(h=this.parseArrow(h))?(this.checkDestructuringPrivate(p),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(h,u,!1),h):(this.expressionScope.exit(),u.length||this.unexpected(this.state.lastTokStartLoc),a&&this.unexpected(a),n&&this.unexpected(n),this.checkExpressionErrors(p,!0),this.toReferencedListDeep(u,!0),u.length>1?(t=this.startNodeAt(o),t.expressions=u,this.finishNode(t,"SequenceExpression"),this.resetEndLocation(t,c)):t=u[0],this.wrapParenthesis(r,t))}wrapParenthesis(e,t){if(!(1024&this.optionFlags))return this.addExtra(t,"parenthesized",!0),this.addExtra(t,"parenStart",e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let r=this.startNodeAt(e);return r.expression=t,this.finishNode(r,"ParenthesizedExpression")}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(19))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(16)){let t=this.createIdentifier(this.startNodeAtNode(e),"new");this.next();let r=this.parseMetaProperty(e,t,"target");return this.scope.allowNewTarget||this.raise(x.UnexpectedNewTarget,r),r}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(10)){let t=this.parseExprList(11);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,"NewExpression")}parseNewCallee(e){let t=this.match(83),r=this.parseNoCallExpr();e.callee=r,t&&("Import"===r.type||"ImportExpression"===r.type)&&this.raise(x.ImportCallNotNewExpression,r)}parseTemplateElement(e){let{start:t,startLoc:r,end:s,value:n}=this.state,a=t+1,o=this.startNodeAt(i(r,1));null===n&&(e||this.raise(x.InvalidEscapeSequenceTemplate,i(this.state.firstInvalidTemplateEscapePos,1)));let u=this.match(24),p=u?-1:-2,l=s+p;o.value={raw:this.input.slice(a,l).replace(/\r\n?/g,"\n"),cooked:null===n?null:n.slice(1,p)},o.tail=u,this.next();let c=this.finishNode(o,"TemplateElement");return this.resetEndLocation(c,i(this.state.lastTokEndLoc,p)),c}parseTemplate(e){let t=this.startNode(),r=this.parseTemplateElement(e),s=[r],i=[];for(;!r.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),s.push(r=this.parseTemplateElement(e));return t.expressions=i,t.quasis=s,this.finishNode(t,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,r,s){r&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=!1,a=!0,o=this.startNode();for(o.properties=[],this.next();!this.match(e);){if(a)a=!1;else if(this.expect(12),this.match(e)){this.addTrailingCommaExtraToNode(o);break}let i;t?i=this.parseBindingProperty():(i=this.parsePropertyDefinition(s),n=this.checkProto(i,r,n,s)),r&&!this.isObjectProperty(i)&&"SpreadElement"!==i.type&&this.raise(x.InvalidRecordProperty,i),i.shorthand&&this.addExtra(i,"shorthand",!0),o.properties.push(i)}this.next(),this.state.inFSharpPipelineDirectBody=i;let u="ObjectExpression";return t?u="ObjectPattern":r&&(u="RecordExpression"),this.finishNode(o,u)}addTrailingCommaExtraToNode(e){this.addExtra(e,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(e,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&"Identifier"===e.key.type&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(e){let t=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(x.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)t.push(this.parseDecorator());let r,s=this.startNode(),i=!1,n=!1;if(this.match(21))return t.length&&this.unexpected(),this.parseSpread();t.length&&(s.decorators=t,t=[]),s.method=!1,e&&(r=this.state.startLoc);let a=this.eat(55);this.parsePropertyNamePrefixOperator(s);let o=this.state.containsEsc;if(this.parsePropertyName(s,e),!a&&!o&&this.maybeAsyncOrAccessorProp(s)){let{key:e}=s,t=e.name;"async"===t&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(e),a=this.eat(55),this.parsePropertyName(s)),("get"===t||"set"===t)&&(n=!0,this.resetPreviousNodeTrailingComments(e),s.kind=t,this.match(55)&&(a=!0,this.raise(x.AccessorIsGenerator,this.state.curPosition(),{kind:t}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,r,a,i,!1,n,e)}getGetterSetterExpectedParamCount(e){return"get"===e.kind?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var t;let r=this.getGetterSetterExpectedParamCount(e),s=this.getObjectOrClassMethodParams(e);s.length!==r&&this.raise("get"===e.kind?x.BadGetterArity:x.BadSetterArity,e),"set"===e.kind&&"RestElement"===(null==(t=s[s.length-1])?void 0:t.type)&&this.raise(x.BadSetterRestParameter,e)}parseObjectMethod(e,t,r,s,i){if(i){let r=this.parseMethod(e,t,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(r),r}if(r||t||this.match(10))return s&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,r,!1,!1,"ObjectMethod")}parseObjectProperty(e,t,r,s){if(e.shorthand=!1,this.eat(14))return e.value=r?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(s),this.finishObjectProperty(e);if(!e.computed&&"Identifier"===e.key.type){if(this.checkReservedWord(e.key.name,e.key.loc.start,!0,!1),r)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(29)){let r=this.state.startLoc;null!=s?null===s.shorthandAssignLoc&&(s.shorthandAssignLoc=r):this.raise(x.InvalidCoverInitializedName,r),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,"ObjectProperty")}parseObjPropValue(e,t,r,s,i,n,a){let o=this.parseObjectMethod(e,r,s,i,n)||this.parseObjectProperty(e,t,i,a);return o||this.unexpected(),o}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let r,{type:s,value:i}=this.state;if(X(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{let e=this.state.startLoc;null!=t?null===t.privateKeyLoc&&(t.privateKeyLoc=e):this.raise(x.UnexpectedPrivateField,e),r=this.parsePrivateName();break}default:if(137===s){r=this.parseDecimalLiteral(i);break}this.unexpected()}e.key=r,139!==s&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,r,s,i,n,a=!1){this.initFunction(e,r),e.generator=t,this.scope.enter(530|(a?576:0)|(i?32:0)),this.prodParam.enter(nt(r,e.generator)),this.parseFunctionParams(e,s);let o=this.parseFunctionBodyAndFinish(e,n,!0);return this.prodParam.exit(),this.scope.exit(),o}parseArrayLike(e,t,r,s){r&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(e,!r,s,n),this.state.inFSharpPipelineDirectBody=i,this.finishNode(n,r?"TupleExpression":"ArrayExpression")}parseArrowExpression(e,t,r,s){this.scope.enter(518);let i=nt(r,!1);!this.match(5)&&this.prodParam.hasIn&&(i|=8),this.prodParam.enter(i),this.initFunction(e,r);let n=this.state.maybeInArrowParameters;return t&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(e,t,s)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(e,"ArrowFunctionExpression")}setArrowFunctionParameters(e,t,r){this.toAssignableList(t,r,!1),e.params=t}parseFunctionBodyAndFinish(e,t,r=!1){return this.parseFunctionBody(e,!1,r),this.finishNode(e,t)}parseFunctionBody(e,t,r=!1){let s=t&&!this.match(5);if(this.expressionScope.enter(Lt()),s)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let s=this.state.strict,i=this.state.labels;this.state.labels=[],this.prodParam.enter(4|this.prodParam.currentFlags()),e.body=this.parseBlock(!0,!1,i=>{let n=!this.isSimpleParamList(e.params);i&&n&&this.raise(x.IllegalLanguageModeDirective,"method"!==e.kind&&"constructor"!==e.kind||!e.key?e:e.key.loc.end);let a=!s&&this.state.strict;this.checkParams(e,!(this.state.strict||t||r||n),t,a),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,a)}),this.prodParam.exit(),this.state.labels=i}this.expressionScope.exit()}isSimpleParameter(e){return"Identifier"===e.type}isSimpleParamList(e){for(let t=0,r=e.length;t10)&&Be(e))if(r&&Ie(e))this.raise(x.UnexpectedKeyword,t,{keyword:e});else if((this.state.strict?s?we:Pe:Se)(e,this.inModule))this.raise(x.UnexpectedReservedWord,t,{reservedWord:e});else if("yield"===e){if(this.prodParam.hasYield)return void this.raise(x.YieldBindingIdentifier,t)}else if("await"===e){if(this.prodParam.hasAwait)return void this.raise(x.AwaitBindingIdentifier,t);if(this.scope.inStaticBlock)return void this.raise(x.AwaitBindingIdentifierInStaticBlock,t);this.expressionScope.recordAsyncArrowParametersError(t)}else if("arguments"===e&&this.scope.inClassAndNotInNonArrowFunction)return void this.raise(x.ArgumentsInClass,t)}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e){let t=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(x.AwaitExpressionFormalParameter,t),this.eat(55)&&this.raise(x.ObsoleteAwaitStar,t),!this.scope.inFunction&&!(1&this.optionFlags)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(t.argument=this.parseMaybeUnary(null,!0)),this.finishNode(t,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return 53===e||10===e||0===e||ce(e)||102===e&&!this.state.containsEsc||138===e||56===e||this.hasPlugin("v8intrinsic")&&54===e}parseYield(e){let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(x.YieldInParameter,t);let r=!1,s=null;if(!this.hasPrecedingLineBreak())switch(r=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!r)break;default:s=this.parseMaybeAssign()}return t.delegate=r,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(e){if(this.next(),e.source=this.parseMaybeAssignAllowIn(),e.options=null,this.eat(12))if(this.match(11))this.addTrailingCommaExtraToNode(e.source);else if(e.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(e.options),!this.match(11))){do{this.parseMaybeAssignAllowIn()}while(this.eat(12)&&!this.match(11));this.raise(x.ImportCallArity,e)}return this.expect(11),this.finishNode(e,"ImportExpression")}checkPipelineAtInfixOperator(e,t){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&"SequenceExpression"===e.type&&this.raise(x.PipelineHeadSequenceExpression,t)}parseSmartPipelineBodyInStyle(e,t){if(this.isSimpleReference(e)){let r=this.startNodeAt(t);return r.callee=e,this.finishNode(r,"PipelineBareFunction")}{let r=this.startNodeAt(t);return this.checkSmartPipeTopicBodyEarlyErrors(t),r.expression=e,this.finishNode(r,"PipelineTopicExpression")}}isSimpleReference(e){switch(e.type){case"MemberExpression":return!e.computed&&this.isSimpleReference(e.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(e){if(this.match(19))throw this.raise(x.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(x.PipelineTopicUnused,e)}withTopicBindingContext(e){let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}withSmartMixTopicForbiddingContext(e){if(!this.hasPlugin(["pipelineOperator",{proposal:"smart"}]))return e();{let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}}withSoloAwaitPermittingContext(e){let t=this.state.soloAwait;this.state.soloAwait=!0;try{return e()}finally{this.state.soloAwait=t}}allowInAnd(e){let t=this.prodParam.currentFlags();if(8&~t){this.prodParam.enter(8|t);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags();if(8&t){this.prodParam.enter(-9&t);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return null!=this.state.topicContext.maxTopicIndex&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let s=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.state.inFSharpPipelineDirectBody=r,s}parseModuleExpression(){this.expectPlugin("moduleBlocks");let e=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let t=this.startNodeAt(this.state.endLoc);this.next();let r=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,8,"module")}finally{r()}return this.finishNode(e,"ModuleExpression")}parsePropertyNamePrefixOperator(e){}},pr={kind:1},lr={kind:2},cr=/[\uD800-\uDFFF]/u,hr=/in(?:stanceof)?/y;function dr(e,t,r){for(let s=0;s0)for(let[e,t]of Array.from(this.scope.undefinedExports))this.raise(x.ModuleExportUndefined,t,{localName:e});this.addExtra(e,"topLevelAwait",this.state.hasTopLevelAwait)}let s;return s=140===t?this.finishNode(e,"Program"):this.finishNodeAt(e,"Program",i(this.state.startLoc,-1)),s}stmtToDirective(e){let t=this.castNodeTo(e,"Directive"),r=this.castNodeTo(e.expression,"DirectiveLiteral"),s=r.value,i=this.input.slice(this.offsetToSourcePos(r.start),this.offsetToSourcePos(r.end)),n=r.value=i.slice(1,-1);return this.addExtra(r,"raw",i),this.addExtra(r,"rawValue",n),this.addExtra(r,"expressionValue",s),t.value=r,delete e.expression,t}parseInterpreterDirective(){if(!this.match(28))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,"InterpreterDirective")}isLet(){return!!this.isContextual(100)&&this.hasFollowingBindingAtom()}isUsing(){if(!this.isContextual(107))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isForUsing(){if(!this.isContextual(107))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,"of")){let t=this.lookaheadCharCodeSince(e+2);if(61!==t&&58!==t&&59!==t)return!1}return!!this.chStartsBindingIdentifier(t,e)&&(this.expectPlugin("explicitResourceManagement"),!0)}isAwaitUsing(){if(!this.isContextual(96))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,"using")){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return this.expectPlugin("explicitResourceManagement"),!0}return!1}chStartsBindingIdentifier(e,t){if(Ee(e)){if(hr.lastIndex=t,hr.test(this.input)){let e=this.codePointAtPos(hr.lastIndex);if(!Ae(e)&&92!==e)return!1}return!0}return 92===e}chStartsBindingPattern(e){return 91===e||123===e}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return 123===t||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(26)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let r=this.state.type,s=this.startNode(),i=!!(2&e),n=!!(4&e),a=1&e;switch(r){case 60:return this.parseBreakContinueStatement(s,!0);case 63:return this.parseBreakContinueStatement(s,!1);case 64:return this.parseDebuggerStatement(s);case 90:return this.parseDoWhileStatement(s);case 91:return this.parseForStatement(s);case 68:if(46===this.lookaheadCharCode())break;return n||this.raise(this.state.strict?x.StrictFunction:this.options.annexB?x.SloppyFunctionAnnexB:x.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(s,!1,!i&&n);case 80:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,s),!0);case 69:return this.parseIfStatement(s);case 70:return this.parseReturnStatement(s);case 71:return this.parseSwitchStatement(s);case 72:return this.parseThrowStatement(s);case 73:return this.parseTryStatement(s);case 96:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(x.AwaitUsingNotInAsyncContext,s):this.raise(x.UnexpectedLexicalDeclaration,s):this.raise(x.UnexpectedUsingDeclaration,s),this.next(),this.parseVarStatement(s,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),this.allowsUsing()?i||this.raise(x.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(x.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(s,"using");case 100:{if(this.state.containsEsc)break;let e=this.nextTokenStart(),t=this.codePointAtPos(e);if(91!==t&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(t,e)&&123!==t))break}case 75:i||this.raise(x.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let e=this.state.value;return this.parseVarStatement(s,e)}case 92:return this.parseWhileStatement(s);case 76:return this.parseWithStatement(s);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(s);case 83:{let e=this.lookaheadCharCode();if(40===e||46===e)break}case 82:{let e;return!(8&this.optionFlags)&&!a&&this.raise(x.UnexpectedImportExport,this.state.startLoc),this.next(),e=83===r?this.parseImport(s):this.parseExport(s,t),this.assertModuleNodeAllowed(e),e}default:if(this.isAsyncFunction())return i||this.raise(x.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(s,!0,!i&&n)}let o=this.state.value,u=this.parseExpression();return z(r)&&"Identifier"===u.type&&this.eat(14)?this.parseLabeledStatement(s,o,u,e):this.parseExpressionStatement(s,u,t)}assertModuleNodeAllowed(e){!(8&this.optionFlags)&&!this.inModule&&this.raise(x.ImportOutsideModule,e)}decoratorsEnabledBeforeExport(){return!!this.hasPlugin("decorators-legacy")||this.hasPlugin("decorators")&&!1!==this.getPluginOption("decorators","decoratorsBeforeExport")}maybeTakeDecorators(e,t,r){var s;return e&&(null!=(s=t.decorators)&&s.length?("boolean"!=typeof this.getPluginOption("decorators","decoratorsBeforeExport")&&this.raise(x.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),r&&this.resetStartLocationFromNode(r,t)),t}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(e){let t=[];do{t.push(this.parseDecorator())}while(this.match(26));if(this.match(82))e||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(x.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(x.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let e=this.startNode();if(this.next(),this.hasPlugin("decorators")){let t,r=this.state.startLoc;if(this.match(10)){let r=this.state.startLoc;this.next(),t=this.parseExpression(),this.expect(11),t=this.wrapParenthesis(r,t);let s=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(t,r),!1===this.getPluginOption("decorators","allowCallParenthesized")&&e.expression!==t&&this.raise(x.DecoratorArgumentsOutsideParentheses,s)}else{for(t=this.parseIdentifier(!1);this.eat(16);){let e=this.startNodeAt(r);e.object=t,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),e.property=this.parsePrivateName()):e.property=this.parseIdentifier(!0),e.computed=!1,t=this.finishNode(e,"MemberExpression")}e.expression=this.parseMaybeDecoratorArguments(t,r)}}else e.expression=this.parseExprSubscripts();return this.finishNode(e,"Decorator")}parseMaybeDecoratorArguments(e,t){if(this.eat(10)){let r=this.startNodeAt(t);return r.callee=e,r.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(r.arguments),this.finishNode(r,"CallExpression")}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?"BreakStatement":"ContinueStatement")}verifyBreakContinue(e,t){let r;for(r=0;rthis.parseStatement()),this.state.labels.pop(),this.expect(92),e.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(e,"DoWhileStatement")}parseForStatement(e){this.next(),this.state.labels.push(pr);let t=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return null!==t&&this.unexpected(t),this.parseFor(e,null);let r=this.isContextual(100);{let s=this.isAwaitUsing(),i=s||this.isForUsing(),n=r&&this.hasFollowingBindingAtom()||i;if(this.match(74)||this.match(75)||n){let r,n=this.startNode();s?(r="await using",this.recordAwaitIfAllowed()||this.raise(x.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):r=this.state.value,this.next(),this.parseVar(n,!0,r);let a=this.finishNode(n,"VariableDeclaration"),o=this.match(58);return o&&i&&this.raise(x.ForInUsing,a),(o||this.isContextual(102))&&1===a.declarations.length?this.parseForIn(e,a,t):(null!==t&&this.unexpected(t),this.parseFor(e,a))}}let s=this.isContextual(95),i=new Ot,n=this.parseExpression(!0,i),a=this.isContextual(102);if(a&&(r&&this.raise(x.ForOfLet,n),null===t&&s&&"Identifier"===n.type&&this.raise(x.ForOfAsync,n)),a||this.match(58)){this.checkDestructuringPrivate(i),this.toAssignable(n,!0);let r=a?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:r}),this.parseForIn(e,n,t)}return this.checkExpressionErrors(i,!0),null!==t&&this.unexpected(t),this.parseFor(e,n)}parseFunctionStatement(e,t,r){return this.next(),this.parseFunction(e,1|(r?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,"IfStatement")}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(x.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t,r=e.cases=[];this.expect(5),this.state.labels.push(lr),this.scope.enter(256);for(let e;!this.match(8);)if(this.match(61)||this.match(65)){let s=this.match(61);t&&this.finishNode(t,"SwitchCase"),r.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(e&&this.raise(x.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),e=!0,t.test=null),this.expect(14)}else t?t.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(x.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&"Identifier"===e.type?8:0),this.checkLVal(e,{type:"CatchClause"},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(62)){let t=this.startNode();this.next(),this.match(10)?(this.expect(10),t.param=this.parseCatchClauseParam(),this.expect(11)):(t.param=null,this.scope.enter(0)),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(67)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(x.NoCatchOrFinally,e),this.finishNode(e,"TryStatement")}parseVarStatement(e,t,r=!1){return this.next(),this.parseVar(e,!1,t,r),this.semicolon(),this.finishNode(e,"VariableDeclaration")}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(pr),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(e,"WhileStatement")}parseWithStatement(e){return this.state.strict&&this.raise(x.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(e,"WithStatement")}parseEmptyStatement(e){return this.next(),this.finishNode(e,"EmptyStatement")}parseLabeledStatement(e,t,r,s){for(let e of this.state.labels)e.name===t&&this.raise(x.LabelRedeclaration,r,{labelName:t});let i=te(this.state.type)?1:this.match(71)?2:null;for(let t=this.state.labels.length-1;t>=0;t--){let r=this.state.labels[t];if(r.statementStart!==e.start)break;r.statementStart=this.sourceToOffsetPos(this.state.start),r.kind=i}return this.state.labels.push({name:t,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=8&s?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")}parseExpressionStatement(e,t,r){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")}parseBlock(e=!1,t=!0,r){let s=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(5),t&&this.scope.enter(0),this.parseBlockBody(s,e,!1,8,r),t&&this.scope.exit(),this.finishNode(s,"BlockStatement")}isValidDirective(e){return"ExpressionStatement"===e.type&&"StringLiteral"===e.expression.type&&!e.expression.extra.parenthesized}parseBlockBody(e,t,r,s,i){let n=e.body=[],a=e.directives=[];this.parseBlockOrModuleBlockBody(n,t?a:void 0,r,s,i)}parseBlockOrModuleBlockBody(e,t,r,s,i){let n=this.state.strict,a=!1,o=!1;for(;!this.match(s);){let s=r?this.parseModuleItem():this.parseStatementListItem();if(t&&!o){if(this.isValidDirective(s)){let e=this.stmtToDirective(s);t.push(e),!a&&"use strict"===e.value.value&&(a=!0,this.setStrict(!0));continue}o=!0,this.state.strictErrors.clear()}e.push(s)}null==i||i.call(this,a),n||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(11)?null:this.parseExpression(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,"ForStatement")}parseForIn(e,t,r){let s=this.match(58);return this.next(),s?null!==r&&this.unexpected(r):e.await=null!==r,"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||!this.options.annexB||this.state.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(x.ForInOfLoopInitializer,t,{type:s?"ForInStatement":"ForOfStatement"}),"AssignmentPattern"===t.type&&this.raise(x.InvalidLhs,t,{ancestor:{type:"ForStatement"}}),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")}parseVar(e,t,r,s=!1){let i=e.declarations=[];for(e.kind=r;;){let e=this.startNode();if(this.parseVarId(e,r),e.init=this.eat(29)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,null===e.init&&!s&&("Identifier"===e.id.type||t&&(this.match(58)||this.isContextual(102))?("const"===r||"using"===r||"await using"===r)&&!(this.match(58)||this.isContextual(102))&&this.raise(x.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:r}):this.raise(x.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"})),i.push(this.finishNode(e,"VariableDeclarator")),!this.eat(12))break}return e}parseVarId(e,t){let r=this.parseBindingAtom();("using"===t||"await using"===t)&&("ArrayPattern"===r.type||"ObjectPattern"===r.type)&&this.raise(x.UsingDeclarationHasBindingPattern,r.loc.start),this.checkLVal(r,{type:"VariableDeclarator"},"var"===t?5:8201),e.id=r}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let r=2&t,s=!!(1&t),i=s&&!(4&t),n=!!(8&t);this.initFunction(e,n),this.match(55)&&(r&&this.raise(x.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),s&&(e.id=this.parseFunctionId(i));let a=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(nt(n,e.generator)),s||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(e,s?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),s&&!r&&this.registerFunctionStatementId(e),this.state.maybeInArrowParameters=a,e}parseFunctionId(e){return e||z(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(10),this.expressionScope.enter(kt()),e.params=this.parseBindingList(11,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.loc.start)}parseClass(e,t,r){this.next();let s=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,r),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,s),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(e){return"Identifier"===e.type&&"constructor"===e.name||"StringLiteral"===e.type&&"constructor"===e.value}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let r={hadConstructor:!1,hadSuperClass:e},s=[],i=this.startNode();if(i.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(s.length>0)throw this.raise(x.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){s.push(this.parseDecorator());continue}let e=this.startNode();s.length&&(e.decorators=s,this.resetStartLocationFromNode(e,s[0]),s=[]),this.parseClassMember(i,e,r),"constructor"===e.kind&&e.decorators&&e.decorators.length>0&&this.raise(x.DecoratorConstructor,e)}}),this.state.strict=t,this.next(),s.length)throw this.raise(x.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(e,t){let r=this.parseIdentifier(!0);if(this.isClassMethod()){let s=t;return s.kind="method",s.computed=!1,s.key=r,s.static=!1,this.pushClassMethod(e,s,!1,!1,!1,!1),!0}if(this.isClassProperty()){let s=t;return s.computed=!1,s.key=r,s.static=!1,e.body.push(this.parseClassProperty(s)),!0}return this.resetPreviousNodeTrailingComments(r),!1}parseClassMember(e,t,r){let s=this.isContextual(106);if(s){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(5))return void this.parseClassStaticBlock(e,t)}this.parseClassMemberWithIsStatic(e,t,r,s)}parseClassMemberWithIsStatic(e,t,r,s){let i=t,n=t,a=t,o=t,u=t,p=i,l=i;if(t.static=s,this.parsePropertyNamePrefixOperator(t),this.eat(55)){p.kind="method";let t=this.match(139);return this.parseClassElementName(p),this.parsePostMemberNameModifiers(p),t?void this.pushClassPrivateMethod(e,n,!0,!1):(this.isNonstaticConstructor(i)&&this.raise(x.ConstructorIsGenerator,i.key),void this.pushClassMethod(e,i,!0,!1,!1,!1))}let c=!this.state.containsEsc&&z(this.state.type),h=this.parseClassElementName(t),d=c?h.name:null,m=this.isPrivateName(h),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(l),this.isClassMethod()){if(p.kind="method",m)return void this.pushClassPrivateMethod(e,n,!1,!1);let s=this.isNonstaticConstructor(i),a=!1;s&&(i.kind="constructor",r.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(x.DuplicateConstructor,h),s&&this.hasPlugin("typescript")&&t.override&&this.raise(x.OverrideOnConstructor,h),r.hadConstructor=!0,a=r.hadSuperClass),this.pushClassMethod(e,i,!1,!1,s,a)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(e,o):this.pushClassProperty(e,a);else if("async"!==d||this.isLineTerminator())if("get"!==d&&"set"!==d||this.match(55)&&this.isLineTerminator())if("accessor"!==d||this.isLineTerminator())this.isLineTerminator()?m?this.pushClassPrivateProperty(e,o):this.pushClassProperty(e,a):this.unexpected();else{this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(h);let t=this.match(139);this.parseClassElementName(a),this.pushClassAccessorProperty(e,u,t)}else{this.resetPreviousNodeTrailingComments(h),p.kind=d;let t=this.match(139);this.parseClassElementName(i),t?this.pushClassPrivateMethod(e,n,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(x.ConstructorIsAccessor,i.key),this.pushClassMethod(e,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else{this.resetPreviousNodeTrailingComments(h);let t=this.eat(55);l.optional&&this.unexpected(y),p.kind="method";let r=this.match(139);this.parseClassElementName(p),this.parsePostMemberNameModifiers(l),r?this.pushClassPrivateMethod(e,n,t,!0):(this.isNonstaticConstructor(i)&&this.raise(x.ConstructorIsAsync,i.key),this.pushClassMethod(e,i,t,!0,!1,!1))}}parseClassElementName(e){let{type:t,value:r}=this.state;if((132===t||134===t)&&e.static&&"prototype"===r&&this.raise(x.StaticPrototype,this.state.startLoc),139===t){"constructor"===r&&this.raise(x.ConstructorClassPrivateField,this.state.startLoc);let t=this.parsePrivateName();return e.key=t,t}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){var r;this.scope.enter(720);let s=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let i=t.body=[];this.parseBlockOrModuleBlockBody(i,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=s,e.body.push(this.finishNode(t,"StaticBlock")),null!=(r=t.decorators)&&r.length&&this.raise(x.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(x.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let r=this.parseClassPrivateProperty(t);e.body.push(r),this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassAccessorProperty(e,t,r){!r&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(x.ConstructorClassField,t.key);let s=this.parseClassAccessorProperty(t);e.body.push(s),r&&this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassMethod(e,t,r,s,i,n){e.body.push(this.parseMethod(t,r,s,i,n,"ClassMethod",!0))}pushClassPrivateMethod(e,t,r,s){let i=this.parseMethod(t,r,s,!1,!1,"ClassPrivateMethod",!0);e.body.push(i);let n="get"===i.kind?i.static?6:2:"set"===i.kind?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,n)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.loc.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassPrivateProperty")}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassProperty")}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassAccessorProperty")}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(Lt()),this.prodParam.enter(0),e.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,r,s=8331){if(z(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,s);else{if(!r&&t)throw this.raise(x.MissingClassName,this.state.startLoc);e.id=null}}parseClassSuper(e){e.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(e,t){let r=this.parseMaybeImportPhase(e,!0),s=this.maybeParseExportDefaultSpecifier(e,r),i=!s||this.eat(12),n=i&&this.eatExportStar(e),a=n&&this.maybeParseExportNamespaceSpecifier(e),o=i&&(!a||this.eat(12)),u=s||n;if(n&&!a){if(s&&this.unexpected(),t)throw this.raise(x.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,"ExportAllDeclaration")}let p,l=this.maybeParseExportNamedSpecifiers(e);if(s&&i&&!n&&!l&&this.unexpected(null,5),a&&o&&this.unexpected(null,98),u||l){if(p=!1,t)throw this.raise(x.UnsupportedDecoratorExport,e);this.parseExportFrom(e,u)}else p=this.maybeParseExportDeclaration(e);if(u||l||p){var c;let r=e;if(this.checkExport(r,!0,!1,!!r.source),"ClassDeclaration"===(null==(c=r.declaration)?void 0:c.type))this.maybeTakeDecorators(t,r.declaration,r);else if(t)throw this.raise(x.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(r,"ExportNamedDeclaration")}if(this.eat(65)){let r=e,s=this.parseExportDefaultExpression();if(r.declaration=s,"ClassDeclaration"===s.type)this.maybeTakeDecorators(t,s,r);else if(t)throw this.raise(x.UnsupportedDecoratorExport,e);return this.checkExport(r,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(r,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(e){return this.eat(55)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",null==t?void 0:t.loc.start);let r=t||this.parseIdentifier(!0),s=this.startNodeAtNode(r);return s.exported=r,e.specifiers=[this.finishNode(s,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(93)){var t;null!=(t=e).specifiers||(t.specifiers=[]);let r=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),r.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(5)){let t=e;t.specifiers||(t.specifiers=[]);let r="type"===t.exportKind;return t.specifiers.push(...this.parseExportSpecifiers(r)),t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return!!this.shouldParseExportDeclaration()&&(e.specifiers=[],e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0)}isAsyncFunction(){if(!this.isContextual(95))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,"function")}parseExportDefaultExpression(){let e=this.startNode();if(this.match(68))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(80))return this.parseClass(e,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&!0===this.getPluginOption("decorators","decoratorsBeforeExport")&&this.raise(x.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.hasPlugin("explicitResourceManagement")&&(this.isUsing()||this.isAwaitUsing()))throw this.raise(x.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(z(e)){if(95===e&&!this.state.containsEsc||100===e)return!1;if((130===e||129===e)&&!this.state.containsEsc){let e=this.nextTokenStart(),t=this.input.charCodeAt(e);if(123===t||this.chStartsBindingIdentifier(t,e)&&!this.input.startsWith("from",e))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let t=this.nextTokenStart(),r=this.isUnparsedContextual(t,"from");if(44===this.input.charCodeAt(t)||z(this.state.type)&&r)return!0;if(this.match(65)&&r){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return 34===e||39===e}return!1}parseExportFrom(e,t){this.eatContextual(98)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e),this.checkJSONModuleImport(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;if(26===e&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators")))return!0===this.getPluginOption("decorators","decoratorsBeforeExport")&&this.raise(x.DecoratorBeforeExport,this.state.startLoc),!0;if(this.hasPlugin("explicitResourceManagement")){if(this.isUsing())return this.raise(x.UsingDeclarationExport,this.state.startLoc),!0;if(this.isAwaitUsing())return this.raise(x.UsingDeclarationExport,this.state.startLoc),!0}return 74===e||75===e||68===e||80===e||this.isLet()||this.isAsyncFunction()}checkExport(e,t,r,s){var i;if(t)if(r){if(this.checkDuplicateExports(e,"default"),this.hasPlugin("exportDefaultFrom")){var n;let t=e.declaration;"Identifier"===t.type&&"from"===t.name&&t.end-t.start===4&&(null==(n=t.extra)||!n.parenthesized)&&this.raise(x.ExportDefaultFromAsIdentifier,t)}}else if(null!=(i=e.specifiers)&&i.length)for(let t of e.specifiers){let{exported:e}=t,r="Identifier"===e.type?e.name:e.value;if(this.checkDuplicateExports(t,r),!s&&t.local){let{local:e}=t;"Identifier"!==e.type?this.raise(x.ExportBindingIsString,t,{localName:e.value,exportName:r}):(this.checkReservedWord(e.name,e.loc.start,!0,!1),this.scope.checkLocalExport(e))}}else if(e.declaration){let t=e.declaration;if("FunctionDeclaration"===t.type||"ClassDeclaration"===t.type){let{id:r}=t;if(!r)throw new Error("Assertion failure");this.checkDuplicateExports(e,r.name)}else if("VariableDeclaration"===t.type)for(let e of t.declarations)this.checkDeclaration(e.id)}}checkDeclaration(e){if("Identifier"===e.type)this.checkDuplicateExports(e,e.name);else if("ObjectPattern"===e.type)for(let t of e.properties)this.checkDeclaration(t);else if("ArrayPattern"===e.type)for(let t of e.elements)t&&this.checkDeclaration(t);else"ObjectProperty"===e.type?this.checkDeclaration(e.value):"RestElement"===e.type?this.checkDeclaration(e.argument):"AssignmentPattern"===e.type&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&("default"===t?this.raise(x.DuplicateDefaultExport,e):this.raise(x.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],r=!0;for(this.expect(5);!this.eat(8);){if(r)r=!1;else if(this.expect(12),this.eat(8))break;let s=this.isContextual(130),i=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(n,i,e,s))}return t}parseExportSpecifier(e,t,r,s){return this.eatContextual(93)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||(e.exported=this.cloneIdentifier(e.local)),this.finishNode(e,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let e=this.parseStringLiteral(this.state.value),t=cr.exec(e.value);return t&&this.raise(x.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}isJSONModuleImport(e){return null!=e.assertions&&e.assertions.some(({key:e,value:t})=>"json"===t.value&&("Identifier"===e.type?"type"===e.name:"type"===e.value))}checkImportReflection(e){let{specifiers:t}=e,r=1===t.length?t[0].type:null;if("source"===e.phase)"ImportDefaultSpecifier"!==r&&this.raise(x.SourcePhaseImportRequiresDefault,t[0].loc.start);else if("defer"===e.phase)"ImportNamespaceSpecifier"!==r&&this.raise(x.DeferImportRequiresNamespace,t[0].loc.start);else if(e.module){var s;"ImportDefaultSpecifier"!==r&&this.raise(x.ImportReflectionNotBinding,t[0].loc.start),(null==(s=e.assertions)?void 0:s.length)>0&&this.raise(x.ImportReflectionHasAssertion,t[0].loc.start)}}checkJSONModuleImport(e){if(this.isJSONModuleImport(e)&&"ExportAllDeclaration"!==e.type){let{specifiers:t}=e;if(null!=t){let e=t.find(e=>{let t;if("ExportSpecifier"===e.type?t=e.local:"ImportSpecifier"===e.type&&(t=e.imported),void 0!==t)return"Identifier"===t.type?"default"!==t.name:"default"!==t.value});void 0!==e&&this.raise(x.ImportJSONBindingNotDefault,e.loc.start)}}}isPotentialImportPhase(e){return!e&&(this.isContextual(105)||this.isContextual(97)||this.isContextual(127))}applyImportPhase(e,t,r,s){t||("module"===r?(this.expectPlugin("importReflection",s),e.module=!0):this.hasPlugin("importReflection")&&(e.module=!1),"source"===r?(this.expectPlugin("sourcePhaseImports",s),e.phase="source"):"defer"===r?(this.expectPlugin("deferredImportEvaluation",s),e.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let r=this.startNode(),s=this.parseIdentifierName(!0),{type:i}=this.state;return(X(i)?98!==i||102===this.lookaheadCharCode():12!==i)?(this.applyImportPhase(e,t,s,r.loc.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(r,s))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return z(t)?98!==t||102===this.lookaheadCharCode():12!==t}parseImport(e){return this.match(134)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(12),s=r&&this.maybeParseStarImportSpecifier(e);return r&&!s&&this.parseNamedImportSpecifiers(e),this.expectContextual(98),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return null!=e.specifiers||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportReflection(e),this.checkJSONModuleImport(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,r){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,r))}finishImportSpecifier(e,t,r=8201){return this.checkLVal(e.local,{type:t},r),this.finishNode(e,t)}parseImportAttributes(){this.expect(5);let e=[],t=new Set;do{if(this.match(8))break;let r=this.startNode(),s=this.state.value;if(t.has(s)&&this.raise(x.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:s}),t.add(s),this.match(134)?r.key=this.parseStringLiteral(s):r.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(x.ModuleAttributeInvalidValue,this.state.startLoc);r.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(r,"ImportAttribute"))}while(this.eat(12));return this.expect(8),e}parseModuleAttributes(){let e=[],t=new Set;do{let r=this.startNode();if(r.key=this.parseIdentifier(!0),"type"!==r.key.name&&this.raise(x.ModuleAttributeDifferentFromType,r.key),t.has(r.key.name)&&this.raise(x.ModuleAttributesWithDuplicateKeys,r.key,{key:r.key.name}),t.add(r.key.name),this.expect(14),!this.match(134))throw this.raise(x.ModuleAttributeInvalidValue,this.state.startLoc);r.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(r,"ImportAttribute"))}while(this.eat(12));return e}maybeParseImportAttributes(e){let t;var r=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&40===this.lookaheadCharCode())return;this.next(),this.hasPlugin("moduleAttributes")?(t=this.parseModuleAttributes(),this.addExtra(e,"deprecatedWithLegacySyntax",!0)):t=this.parseImportAttributes(),r=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(x.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(e,"deprecatedAssertSyntax",!0),this.next(),t=this.parseImportAttributes()):t=[];!r&&this.hasPlugin("importAssertions")?e.assertions=t:e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let r=this.startNodeAtNode(t);return r.local=t,e.specifiers.push(this.finishImportSpecifier(r,"ImportDefaultSpecifier")),!0}return!!X(this.state.type)&&(this.parseImportSpecifierLocal(e,this.startNode(),"ImportDefaultSpecifier"),!0)}maybeParseStarImportSpecifier(e){if(this.match(55)){let t=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(e,t,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else{if(this.eat(14))throw this.raise(x.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let r=this.startNode(),s=this.match(134),i=this.isContextual(130);r.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(r,s,"type"===e.importKind||"typeof"===e.importKind,i,void 0);e.specifiers.push(n)}}parseImportSpecifier(e,t,r,s,i){if(this.eatContextual(93))e.local=this.parseIdentifier();else{let{imported:r}=e;if(t)throw this.raise(x.ImportBindingIsString,e,{importName:r.value});this.checkReservedWord(r.name,e.loc.start,!0,!0),e.local||(e.local=this.cloneIdentifier(r))}return this.finishImportSpecifier(e,"ImportSpecifier",i)}isThisParam(e){return"Identifier"===e.type&&"this"===e.name}},yr=class extends mr{constructor(e,t,r){super(e=E(e),t),this.options=e,this.initializeScopes(),this.plugins=r,this.filename=e.sourceFilename,this.startIndex=e.startIndex;let s=0;e.allowAwaitOutsideFunction&&(s|=1),e.allowReturnOutsideFunction&&(s|=2),e.allowImportExportEverywhere&&(s|=8),e.allowSuperOutsideMethod&&(s|=16),e.allowUndeclaredExports&&(s|=64),e.allowNewTargetOutsideFunction&&(s|=4),e.allowYieldOutsideFunction&&(s|=32),e.ranges&&(s|=128),e.tokens&&(s|=256),e.createImportExpressions&&(s|=512),e.createParenthesizedExpressions&&(s|=1024),e.errorRecovery&&(s|=2048),e.attachComment&&(s|=4096),e.annexB&&(s|=8192),this.optionFlags=s}getScopeHandler(){return Me}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();return this.nextToken(),e.errors=null,this.parseTopLevel(e,t),e.errors=this.state.errors,e.comments.length=this.state.commentsLen,e}};function fr(e,t){var r;if("unambiguous"!==(null==(r=t)?void 0:r.sourceType))return Er(t,e).parse();t=Object.assign({},t);try{t.sourceType="module";let r=Er(t,e),s=r.parse();if(r.sawUnambiguousESM)return s;if(r.ambiguousScriptDifferentAst)try{return t.sourceType="script",Er(t,e).parse()}catch{}else s.program.sourceType="script";return s}catch(r){try{return t.sourceType="script",Er(t,e).parse()}catch{}throw r}}function Dr(e,t){let r=Er(t,e);return r.options.strictMode&&(r.state.strict=!0),r.getExpression()}function xr(e){let t={};for(let r of Object.keys(e))t[r]=he(e[r]);return t}var gr=xr(W);function Er(e,t){let r=yr,s=new Map;if(null!=e&&e.plugins){for(let t of e.plugins){let e,r;"string"==typeof t?e=t:[e,r]=t,s.has(e)||s.set(e,r||{})}nr(s),r=Tr(s)}return new r(e,t,s)}var Ar=new Map;function Tr(e){let t=[];for(let r of or)e.has(r)&&t.push(r);let r=t.join("|"),s=Ar.get(r);if(!s){s=yr;for(let e of t)s=ar[e](s);Ar.set(r,s)}return s}e.parse=fr,e.parseExpression=Dr,e.tokTypes=gr}),h={};o(h,{parsers:()=>Dt});var d={};o(d,{__babel_estree:()=>st,__js_expression:()=>et,__ts_expression:()=>tt,__vue_event_binding:()=>Qe,__vue_expression:()=>et,__vue_ts_event_binding:()=>Ze,__vue_ts_expression:()=>tt,babel:()=>Qe,"babel-flow":()=>rt,"babel-ts":()=>Ze});var m=p(c(),1);function y(e){return(t,r,s)=>{let i=!(null==s||!s.backwards);if(!1===r)return!1;let{length:n}=t,a=r;for(;a>=0&&a{if(!e||null!=t){if(t.findLast)return t.findLast(r);for(let e=t.length-1;e>=0;e--){let s=t[e];if(r(s,e,t))return s}}},k=I,N=(e,t,r)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[r<0?t.length+r:r]:t.at(r)},B=N,L=new Proxy(()=>{},{get:()=>L});function M(e){var t,r,s;let i=(null==(t=e.range)?void 0:t[0])??e.start,n=null==(s=(null==(r=e.declaration)?void 0:r.decorators)??e.decorators)?void 0:s[0];return n?Math.min(M(n),i):i}function O(e){var t;return(null==(t=e.range)?void 0:t[1])??e.end}function j(e){let t=new Set(e);return e=>t.has(null==e?void 0:e.type)}var R=j;function _(e,t,r){let s=e.originalText.slice(t,r);for(let i of e[Symbol.for("comments")]){let e=M(i);if(e>r)break;let n=O(i);if(n1&&t.every(e=>"*"===e.trimStart()[0])}var z=new WeakMap;function K(e){return z.has(e)||z.set(e,W(e)),z.get(e)}var X=K;function G(e){if(e.length<2)return;let t;for(let r=e.length-1;r>=0;r--){let s=e[r];if(t&&O(s)===M(t)&&X(s)&&X(t)&&(e.splice(r+1,1),s.value+="*//*"+t.value,s.range=[M(s),O(t)]),!q(s)&&!$(s))throw new TypeError(`Unknown comment type: "${s.type}".`);t=s}}var Y=G,Q=null;function Z(e){if(null!==Q&&(Q.property,1)){let e=Q;return Q=Z.prototype=null,e}return Q=Z.prototype=e??Object.create(null),new Z}var ee=10;for(let e=0;e<=ee;e++)Z();function te(e){return Z(e)}function re(e,t="type"){function r(r){let s=r[t],i=e[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:r});return i}return te(e),r}var se=re({ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]});function ie(e,t){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e)){for(let r=0;r{switch(t.type){case"ParenthesizedExpression":{let{expression:e}=t,s=M(t);if("TypeCastExpression"===e.type)return e.range=[s,O(t)],e;let o=!1;if(!a){if(!r){r=[];for(let e of n)H(e)&&r.push(O(e))}let e=k(!1,r,e=>e<=s);o=e&&0===i.slice(e,s).trim().length}if(!o)return e.extra={...e.extra,parenthesized:!0},e;break}case"LogicalExpression":if(ue(t))return pe(t);break;case"TemplateLiteral":if(t.expressions.length!==t.quasis.length-1)throw new Error("Malformed template literal.");break;case"TemplateElement":if("flow"===s||"hermes"===s||"espree"===s||"typescript"===s||a){let e=M(t)+1,r=O(t)-(t.tail?1:2);t.range=[e,r]}break;case"VariableDeclaration":{let e=B(!1,t.declarations,-1);null!=e&&e.init&&";"!==i[O(e)]&&(t.range=[M(t),O(e)]);break}case"TSParenthesizedType":return t.typeAnnotation;case"TSTypeParameter":oe(t);break;case"TopicReference":e.extra={...e.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(1===t.types.length)return t.types[0];break;case"TSMappedType":if(!t.constraint&&!t.key){let{name:e,constraint:r}=oe(t.typeParameter);t.constraint=r,t.key=e,delete t.typeParameter}break;case"TSEnumDeclaration":if(!t.body){let e=O(t.id),{members:r}=t,s=e+U({originalText:i,[Symbol.for("comments")]:n},e,r[0]?M(r[0]):O(t)).indexOf("{");t.body={type:"TSEnumBody",members:r,range:[s,O(t)]},delete t.members}break;case"ImportExpression":"hermes"===s&&t.attributes&&!t.options&&(t.options=t.attributes)}});let o="File"===e.type?e.program:e;return o.interpreter&&(n.unshift(o.interpreter),delete o.interpreter),a&&e.hashbang&&(n.unshift(e.hashbang),delete e.hashbang),"Program"===e.type&&(e.range=[0,i.length]),e}function oe(e){if("TSTypeParameter"===e.type&&"string"==typeof e.name){let t=M(e);e.name={type:"Identifier",name:e.name,range:[t,t+e.name.length]}}return e}function ue(e){return"LogicalExpression"===e.type&&"LogicalExpression"===e.right.type&&e.operator===e.right.operator}function pe(e){return ue(e)?pe({type:"LogicalExpression",operator:e.operator,left:pe({type:"LogicalExpression",operator:e.operator,left:e.left,right:e.right.left,range:[M(e.left),O(e.right.left)]}),right:e.right.right,range:[M(e),O(e)]}):e}R(["RegExpLiteral","BigIntLiteral","NumericLiteral","StringLiteral","DirectiveLiteral","Literal","JSXText","TemplateElement","StringLiteralTypeAnnotation","NumberLiteralTypeAnnotation","BigIntLiteralTypeAnnotation"]);var le=ae;function ce(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var he=ce,de="Unexpected parseExpression() input: ";function me(e){let{message:t,loc:r,reasonCode:s}=e;if(!r)return e;let{line:i,column:n}=r,a=e;("MissingPlugin"===s||"MissingOneOfPlugins"===s)&&(t="Unexpected token.",a=void 0);let o=` (${i}:${n})`;return t.endsWith(o)&&(t=t.slice(0,-o.length)),t.startsWith(de)&&(t=t.slice(de.length)),he(t,{loc:{start:{line:i,column:n+1}},cause:a})}var ye=me,fe=(e,t,r,s)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(r,s):r.global?t.replace(r,s):t.split(r).join(s)},De=fe,xe=/\*\/$/,ge=/^\/\*\*?/,Ee=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Ae=/(^|\s+)\/\/([^\n\r]*)/g,Te=/^(\r?\n)+/,Ce=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Fe=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,be=/(\r?\n|^) *\* ?/g,Se=[];function Pe(e){let t=e.match(Ee);return t?t[0].trimStart():""}function ve(e){let t="\n";e=De(!1,e.replace(ge,"").replace(xe,""),be,"$1");let r="";for(;r!==e;)r=e,e=De(!1,e,Ce,`${t}$1 $2${t}`);e=e.replace(Te,"").trimEnd();let s,i=Object.create(null),n=De(!1,e,Fe,"").replace(Te,"").trimEnd();for(;s=Fe.exec(e);){let e=De(!1,s[2],Ae,"");if("string"==typeof i[s[1]]||Array.isArray(i[s[1]])){let t=i[s[1]];i[s[1]]=[...Se,...Array.isArray(t)?t:[t],e]}else i[s[1]]=e}return{comments:n,pragmas:i}}var we=["noformat","noprettier"],Ie=["format","prettier"];function ke(e){let t=w(e);t&&(e=e.slice(t.length+1));let r=Pe(e),{pragmas:s,comments:i}=ve(r);return{shebang:t,text:e,pragmas:s,comments:i}}function Ne(e){let{pragmas:t}=ke(e);return Ie.some(e=>Object.prototype.hasOwnProperty.call(t,e))}function Be(e){let{pragmas:t}=ke(e);return we.some(e=>Object.prototype.hasOwnProperty.call(t,e))}function Le(e){return e="function"==typeof e?{parse:e}:e,{astFormat:"estree",hasPragma:Ne,hasIgnorePragma:Be,locStart:M,locEnd:O,...e}}var Me=Le,Oe="module",je="script";function Re(e){if("string"==typeof e){if(e=e.toLowerCase(),/\.(?:mjs|mts)$/iu.test(e))return Oe;if(/\.(?:cjs|cts)$/iu.test(e))return je}}function _e(e,t){let{type:r="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:n,comments:a}=e;return delete e.tokens,delete e.comments,{tokens:n,comments:a,type:r,node:e,range:[0,i.length],rootMarker:s}}var Ue=_e,$e=e=>Me(Xe(e)),qe={sourceType:Oe,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,attachComment:!1,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","explicitResourceManagement","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}]],tokens:!1,ranges:!1},Je="v8intrinsic",Ve=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],He=(e,t=qe)=>({...t,plugins:[...t.plugins,...e]}),We=/@(?:no)?flow\b/u;function ze(e,t){if(null!=t&&t.endsWith(".js.flow"))return!0;let r=w(e);r&&(e=e.slice(r.length));let s=b(e,0);return!1!==s&&(e=e.slice(0,s)),We.test(e)}function Ke(e,t,r){let s=e(t,r),i=s.errors.find(e=>!Ge.has(e.reasonCode));if(i)throw i;return s}function Xe({isExpression:e=!1,optionsCombinations:t}){return(r,s={})=>{let{filepath:i}=s;if("string"!=typeof i&&(i=void 0),("babel"===s.parser||"__babel_estree"===s.parser)&&ze(r,i))return s.parser="babel-flow",rt.parse(r,s);let n=t,a=s.__babelSourceType??Re(i);a===je&&(n=n.map(e=>({...e,sourceType:a})));let o=/%[A-Z]/u.test(r);r.includes("|>")?n=(o?[...Ve,Je]:Ve).flatMap(e=>n.map(t=>He([e],t))):o&&(n=n.map(e=>He([Je],e)));let u,p=e?m.parseExpression:m.parse;try{u=P(n.map(e=>()=>Ke(p,r,e)))}catch({errors:[e]}){throw ye(e)}return e&&(u=Ue(u,{text:r,rootMarker:s.rootMarker})),le(u,{text:r})}}var Ge=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert","DeclarationMissingInitializer"]),Ye=[He(["jsx"])],Qe=$e({optionsCombinations:Ye}),Ze=$e({optionsCombinations:[He(["jsx","typescript"]),He(["typescript"])]}),et=$e({isExpression:!0,optionsCombinations:[He(["jsx"])]}),tt=$e({isExpression:!0,optionsCombinations:[He(["typescript"])]}),rt=$e({optionsCombinations:[He(["jsx",["flow",{all:!0}],"flowComments"])]}),st=$e({optionsCombinations:Ye.map(e=>He(["estree"],e))}),it={};o(it,{json:()=>dt,"json-stringify":()=>ft,json5:()=>mt,jsonc:()=>yt});var nt=p(c(),1);function at(e){return Array.isArray(e)&&e.length>0}var ot=at,ut={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function pt(e){let t=(0,nt.parse)(e,ut),{program:r}=t;if(0===r.body.length&&0===r.directives.length&&!r.interpreter)return t}function lt(e,t={}){let r,{allowComments:s=!0,allowEmpty:i=!1}=t;try{r=(0,nt.parseExpression)(e,ut)}catch(t){if(i&&"BABEL_PARSER_SYNTAX_ERROR"===t.code&&"ParseExpressionEmptyInput"===t.reasonCode)try{r=pt(e)}catch{}if(!r)throw ye(t)}if(!s&&ot(r.comments))throw ct(r.comments[0],"Comment");return r=Ue(r,{type:"JsonRoot",text:e}),"File"===r.node.type?delete r.node:ht(r.node),r}function ct(e,t){let[r,s]=[e.loc.start,e.loc.end].map(({line:e,column:t})=>({line:e,column:t+1}));return he(`${t} is not allowed in JSON.`,{loc:{start:r,end:s}})}function ht(e){switch(e.type){case"ArrayExpression":for(let t of e.elements)null!==t&&ht(t);return;case"ObjectExpression":for(let t of e.properties)ht(t);return;case"ObjectProperty":if(e.computed)throw ct(e.key,"Computed key");if(e.shorthand)throw ct(e.key,"Shorthand property");return"Identifier"!==e.key.type&&ht(e.key),void ht(e.value);case"UnaryExpression":{let{operator:t,argument:r}=e;if("+"!==t&&"-"!==t)throw ct(e,`Operator '${e.operator}'`);if("NumericLiteral"===r.type||"Identifier"===r.type&&("Infinity"===r.name||"NaN"===r.name))return;throw ct(r,`Operator '${t}' before '${r.type}'`)}case"Identifier":if("Infinity"!==e.name&&"NaN"!==e.name&&"undefined"!==e.name)throw ct(e,`Identifier '${e.name}'`);return;case"TemplateLiteral":if(ot(e.expressions))throw ct(e.expressions[0],"'TemplateLiteral' with expression");for(let t of e.quasis)ht(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw ct(e,`'${e.type}'`)}}var dt=Me({parse:e=>lt(e),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),mt=Me(e=>lt(e)),yt=Me(e=>lt(e,{allowEmpty:!0})),ft=Me({parse:e=>lt(e,{allowComments:!1}),astFormat:"estree-json"}),Dt={...d,...it};return l(h)}()).default||t}},t={};function r(s){var i=t[s];if(void 0!==i)return i.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};(()=>{"use strict";r.r(s),r.d(s,{runTest:()=>fh});var e,t,i=Object.create,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,u=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,l=e=>{throw TypeError(e)},c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},h=(e,t,r)=>(((e,t,r)=>{t.has(e)||l("Cannot "+r)})(e,t,"access private method"),r),d=(e=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,r,s={}){let i=new Proxy({},{get:()=>e=>e}),n=e.split(t),{start:a,end:o,markerLines:u}=function(e,t,r){let s=Object.assign({column:0,line:-1},e.start),i=Object.assign({},s,e.end),{linesAbove:n=2,linesBelow:a=3}=r||{},o=s.line,u=s.column,p=i.line,l=i.column,c=Math.max(o-(n+1),0),h=Math.min(t.length,p+a);-1===o&&(c=0),-1===p&&(h=t.length);let d=p-o,m={};if(d)for(let e=0;e<=d;e++){let r=e+o;if(u)if(0===e){let e=t[r-1].length;m[r]=[u,e-u+1]}else if(e===d)m[r]=[0,l];else{let s=t[r-e].length;m[r]=[0,s]}else m[r]=!0}else m[o]=u===l?!u||[u,0]:[u,l-u];return{start:c,end:h,markerLines:m}}(r,n,s),p=r.start&&"number"==typeof r.start.column,l=String(o).length,c=e.split(t,o).slice(a,o).map((e,t)=>{let r=a+1+t,n=` ${` ${r}`.slice(-l)} |`,o=u[r],p=!u[r+1];if(o){let t="";if(Array.isArray(o)){let r=e.slice(0,Math.max(o[0]-1,0)).replace(/[^\t]/g," "),a=o[1]||1;t=["\n ",i.gutter(n.replace(/\d/g," "))," ",r,i.marker("^").repeat(a)].join(""),p&&s.message&&(t+=" "+i.message(s.message))}return[i.marker(">"),i.gutter(n),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(n)}${e.length>0?` ${e}`:""}`}).join("\n");return s.message&&!p&&(c=`${" ".repeat(l+1)}${s.message}\n${c}`),c}},()=>(t||e((t={exports:{}}).exports,t),t.exports)),m={};c(m,{__debug:()=>As,check:()=>gs,doc:()=>Xr,format:()=>xs,formatWithCursor:()=>Ds,getSupportInfo:()=>Es,util:()=>es,version:()=>Zr});var y=(e,t,r,s)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(r,s):r.global?t.replace(r,s):t.split(r).join(s)},f=class{diff(e,t,r={}){let s;"function"==typeof r?(s=r,r={}):"callback"in r&&(s=r.callback);let i=this.castInput(e,r),n=this.castInput(t,r),a=this.removeEmpty(this.tokenize(i,r)),o=this.removeEmpty(this.tokenize(n,r));return this.diffWithOptionsObj(a,o,r,s)}diffWithOptionsObj(e,t,r,s){var i;let n=e=>(e=this.postProcess(e,r),s?void setTimeout(function(){s(e)},0):e),a=t.length,o=e.length,u=1,p=a+o;null!=r.maxEditLength&&(p=Math.min(p,r.maxEditLength));let l=null!==(i=r.timeout)&&void 0!==i?i:1/0,c=Date.now()+l,h=[{oldPos:-1,lastComponent:void 0}],d=this.extractCommon(h[0],t,e,0,r);if(h[0].oldPos+1>=o&&d+1>=a)return n(this.buildValues(h[0].lastComponent,t,e));let m=-1/0,y=1/0,f=()=>{for(let s=Math.max(m,-u);s<=Math.min(y,u);s+=2){let i,u=h[s-1],p=h[s+1];u&&(h[s-1]=void 0);let l=!1;if(p){let e=p.oldPos-s;l=p&&0<=e&&e=o&&d+1>=a)return n(this.buildValues(i.lastComponent,t,e))||!0;h[s]=i,i.oldPos+1>=o&&(y=Math.min(y,s-1)),d+1>=a&&(m=Math.max(m,s+1))}else h[s]=void 0}u++};if(s)!function e(){setTimeout(function(){if(u>p||Date.now()>c)return s(void 0);f()||e()},0)}();else for(;u<=p&&Date.now()<=c;){let e=f();if(e)return e}}addToPath(e,t,r,s,i){let n=e.lastComponent;return n&&!i.oneChangePerToken&&n.added===t&&n.removed===r?{oldPos:e.oldPos+s,lastComponent:{count:n.count+1,added:t,removed:r,previousComponent:n.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:t,removed:r,previousComponent:n}}}extractCommon(e,t,r,s,i){let n=t.length,a=r.length,o=e.oldPos,u=o-s,p=0;for(;u+1e.length?s:e}),e.value=this.join(s)}else e.value=this.join(t.slice(o,o+e.count));o+=e.count,e.added||(u+=e.count)}}return i}},D=new class extends f{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function x(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function g(e,t){let r;switch(t){case"\n":r=/\n/gu;break;case"\r":r=/\r/gu;break;case"\r\n":r=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let s=e.match(r);return s?s.length:0}var E="string",A="array",T="cursor",C="indent",F="align",b="trim",S="group",P="fill",v="if-break",w="indent-if-break",I="line-suffix",k="line-suffix-boundary",N="line",B="label",L="break-parent",M=new Set([T,C,F,b,S,P,v,w,I,k,N,B,L]),O=(e,t,r)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[r<0?t.length+r:r]:t.at(r)};var j=function(e){if("string"==typeof e)return E;if(Array.isArray(e))return A;if(!e)return;let{type:t}=e;return M.has(t)?t:void 0};function R(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(j(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if("[object Object]"!==r)return`Unexpected doc '${r}'.`;let s=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...M].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${s}.`}var _=class extends Error{name="InvalidDocError";constructor(e){super(R(e)),this.doc=e}},U=_,$={};var q=function(e,t,r,s){let i=[e];for(;i.length>0;){let e=i.pop();if(e===$){r(i.pop());continue}r&&i.push(e,$);let n=j(e);if(!n)throw new U(e);if(!1!==(null==t?void 0:t(e)))switch(n){case A:case P:{let t=n===A?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case v:i.push(e.flatContents,e.breakContents);break;case S:if(s&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case F:case C:case w:case B:case I:i.push(e.contents);break;case E:case T:case b:case k:case N:case L:break;default:throw new U(e)}}};function J(e,t){if("string"==typeof e)return t(e);let r=new Map;return s(e);function s(e){if(r.has(e))return r.get(e);let i=function(e){switch(j(e)){case A:return t(e.map(s));case P:return t({...e,parts:e.parts.map(s)});case v:return t({...e,breakContents:s(e.breakContents),flatContents:s(e.flatContents)});case S:{let{expandedStates:r,contents:i}=e;return r?(r=r.map(s),i=r[0]):i=s(i),t({...e,contents:i,expandedStates:r})}case F:case C:case w:case B:case I:return t({...e,contents:s(e.contents)});case E:case T:case b:case k:case N:case L:return t(e);default:throw new U(e)}}(e);return r.set(e,i),i}}function V(e,t,r){let s=r,i=!1;return q(e,function(e){if(i)return!1;let r=t(e);void 0!==r&&(i=!0,s=r)}),s}function H(e){if(e.type===S&&e.break||e.type===N&&e.hard||e.type===L)return!0}function W(e){if(e.length>0){let t=O(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function z(e){return e.type!==N||e.hard?e.type===v?e.flatContents:e:e.soft?"":" "}function K(e){for(e=[...e];e.length>=2&&O(!1,e,-2).type===N&&O(!1,e,-1).type===L;)e.length-=2;if(e.length>0){let t=X(O(!1,e,-1));e[e.length-1]=t}return e}function X(e){switch(j(e)){case C:case w:case S:case I:case B:{let t=X(e.contents);return{...e,contents:t}}case v:return{...e,breakContents:X(e.breakContents),flatContents:X(e.flatContents)};case P:return{...e,parts:K(e.parts)};case A:return K(e);case E:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(j(e)){case P:if(e.parts.every(e=>""===e))return"";break;case S:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===S&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case F:case C:case w:case I:if(!e.contents)return"";break;case v:if(!e.flatContents&&!e.breakContents)return"";break;case A:{let t=[];for(let r of e){if(!r)continue;let[e,...s]=Array.isArray(r)?r:[r];"string"==typeof e&&"string"==typeof O(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...s)}return 0===t.length?"":1===t.length?t[0]:t}case E:case T:case b:case k:case N:case B:case L:break;default:throw new U(e)}return e}(e))}(e))}function Y(e){if(e.type===N)return!0}function Q(e,t){return e.type===B?{...e,contents:t(e.contents)}:t(e)}var Z=()=>{},ee=Z,te=Z,re=Z;function se(e){return ee(e),{type:C,contents:e}}function ie(e,t){return ee(t),{type:F,contents:t,n:e}}function ne(e,t={}){return ee(e),te(t.expandedStates,!0),{type:S,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function ae(e){return ee(e),{type:I,contents:e}}var oe={type:k},ue={type:L},pe={type:b},le={type:N,hard:!0},ce={type:N,hard:!0,literal:!0},he={type:N},de={type:N,soft:!0},me=[le,ue],ye=[ce,ue],fe={type:T};function De(e,t){ee(e),te(t);let r=[];for(let s=0;s0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),Ae=/[^\x20-\x7F]/u;var Te=function(e){if(!e)return 0;if(!Ae.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let r of e){let e=r.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Ee(e)?1:2)}return t},Ce=Symbol("MODE_BREAK"),Fe=Symbol("MODE_FLAT"),be=Symbol("cursor"),Se=Symbol("DOC_FILL_PRINTED_LENGTH");function Pe(e,t){return we(e,{type:"indent"},t)}function ve(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?we(e,{type:"dedent"},r):t?"root"===t.type?{...e,root:e}:we(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},r):e}function we(e,t,r){let s="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",n=0,a=0,o=0;for(let e of s)switch(e.type){case"indent":l(),r.useTabs?u(1):p(r.tabWidth);break;case"stringAlign":l(),i+=e.n,n+=e.n.length;break;case"numberAlign":a+=1,o+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return c(),{...e,value:i,length:n,queue:s};function u(e){i+="\t".repeat(e),n+=r.tabWidth*e}function p(e){i+=" ".repeat(e),n+=e}function l(){r.useTabs?(a>0&&u(a),h()):c()}function c(){o>0&&p(o),h()}function h(){a=0,o=0}}function Ie(e){let t=0,r=0,s=e.length;e:for(;s--;){let i=e[s];if(i!==be)for(let r=i.length-1;r>=0;r--){let n=i[r];if(" "!==n&&"\t"!==n){e[s]=i.slice(0,r+1);break e}t++}else r++}if(t>0||r>0)for(e.length=s+1;r-- >0;)e.push(be);return t}function ke(e,t,r,s,i,n){if(r===Number.POSITIVE_INFINITY)return!0;let a=t.length,o=[e],u=[];for(;r>=0;){if(0===o.length){if(0===a)return!0;o.push(t[--a]);continue}let{mode:e,doc:p}=o.pop(),l=j(p);switch(l){case E:u.push(p),r-=Te(p);break;case A:case P:{let t=l===A?p:p.parts,r=p[Se]??0;for(let s=t.length-1;s>=r;s--)o.push({mode:e,doc:t[s]});break}case C:case F:case w:case B:o.push({mode:e,doc:p.contents});break;case b:r+=Ie(u);break;case S:{if(n&&p.break)return!1;let t=p.break?Ce:e,r=p.expandedStates&&t===Ce?O(!1,p.expandedStates,-1):p.contents;o.push({mode:t,doc:r});break}case v:{let t=(p.groupId?i[p.groupId]||Fe:e)===Ce?p.breakContents:p.flatContents;t&&o.push({mode:e,doc:t});break}case N:if(e===Ce||p.hard)return!0;p.soft||(u.push(" "),r--);break;case I:s=!0;break;case k:if(s)return!1}}return!1}function Ne(e,t){let r={},s=t.printWidth,i=x(t.endOfLine),n=0,a=[{ind:{value:"",length:0,queue:[]},mode:Ce,doc:e}],o=[],u=!1,p=[],l=0;for(function(e){let t=new Set,r=[];q(e,function(e){if(e.type===L&&W(r),e.type===S){if(r.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===S&&r.pop().break&&W(r)},!0)}(e);a.length>0;){let{ind:e,mode:c,doc:h}=a.pop();switch(j(h)){case E:{let e="\n"!==i?y(!1,h,"\n",i):h;o.push(e),a.length>0&&(n+=Te(e));break}case A:for(let t=h.length-1;t>=0;t--)a.push({ind:e,mode:c,doc:h[t]});break;case T:if(l>=2)throw new Error("There are too many 'cursor' in doc.");o.push(be),l++;break;case C:a.push({ind:Pe(e,t),mode:c,doc:h.contents});break;case F:a.push({ind:ve(e,h.n,t),mode:c,doc:h.contents});break;case b:n-=Ie(o);break;case S:switch(c){case Fe:if(!u){a.push({ind:e,mode:h.break?Ce:Fe,doc:h.contents});break}case Ce:{u=!1;let t={ind:e,mode:Fe,doc:h.contents},i=s-n,o=p.length>0;if(!h.break&&ke(t,a,i,o,r))a.push(t);else if(h.expandedStates){let t=O(!1,h.expandedStates,-1);if(h.break){a.push({ind:e,mode:Ce,doc:t});break}for(let s=1;s=h.expandedStates.length){a.push({ind:e,mode:Ce,doc:t});break}{let t=h.expandedStates[s],n={ind:e,mode:Fe,doc:t};if(ke(n,a,i,o,r)){a.push(n);break}}}}else a.push({ind:e,mode:Ce,doc:h.contents});break}}h.id&&(r[h.id]=O(!1,a,-1).mode);break;case P:{let t=s-n,i=h[Se]??0,{parts:o}=h,u=o.length-i;if(0===u)break;let l=o[i+0],d=o[i+1],m={ind:e,mode:Fe,doc:l},y={ind:e,mode:Ce,doc:l},f=ke(m,[],t,p.length>0,r,!0);if(1===u){f?a.push(m):a.push(y);break}let D={ind:e,mode:Fe,doc:d},x={ind:e,mode:Ce,doc:d};if(2===u){f?a.push(D,m):a.push(x,y);break}let g=o[i+2],E={ind:e,mode:c,doc:{...h,[Se]:i+2}};ke({ind:e,mode:Fe,doc:[l,d,g]},[],t,p.length>0,r,!0)?a.push(E,D,m):f?a.push(E,x,m):a.push(E,x,y);break}case v:case w:{let t=h.groupId?r[h.groupId]:c;if(t===Ce){let t=h.type===v?h.breakContents:h.negate?h.contents:se(h.contents);t&&a.push({ind:e,mode:c,doc:t})}if(t===Fe){let t=h.type===v?h.flatContents:h.negate?se(h.contents):h.contents;t&&a.push({ind:e,mode:c,doc:t})}break}case I:p.push({ind:e,mode:c,doc:h.contents});break;case k:p.length>0&&a.push({ind:e,mode:c,doc:le});break;case N:switch(c){case Fe:if(!h.hard){h.soft||(o.push(" "),n+=1);break}u=!0;case Ce:if(p.length>0){a.push({ind:e,mode:c,doc:h},...p.reverse()),p.length=0;break}h.literal?e.root?(o.push(i,e.root.value),n=e.root.length):(o.push(i),n=0):(n-=Ie(o),o.push(i+e.value),n=e.length)}break;case B:a.push({ind:e,mode:c,doc:h.contents});break;case L:break;default:throw new U(h)}0===a.length&&p.length>0&&(a.push(...p.reverse()),p.length=0)}let c=o.indexOf(be);if(-1!==c){let e=o.indexOf(be,c+1);if(-1===e)return{formatted:o.filter(e=>e!==be).join("")};let t=o.slice(0,c).join(""),r=o.slice(c+1,e).join("");return{formatted:t+r+o.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:r}}return{formatted:o.join("")}}var Be,Le,Me,Oe=function(e,t,r=0){let s=0;for(let i=r;i=0;r-=2)if(!Array.isArray(t[r])&&--e<0)return r;return-1},Me=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let r=e[t];Array.isArray(r)||(yield r)}};var je=class{constructor(e){((e,t,r)=>{t.has(e)?l("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r)})(this,Be),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return O(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:O(!1,this.stack,-2)}get node(){return O(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=O(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...h(this,Be,Me).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?O(!1,e,-2):null}getValue(){return O(!1,this.stack,-1)}getNode(e=0){let t=h(this,Be,Le).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:r}=this,{length:s}=r,i=O(!1,r,-1);for(let e of t)i=i[e],r.push(e,i);try{return e(this)}finally{r.length=s}}callParent(e,t=0){let r=h(this,Be,Le).call(this,t+1),s=this.stack.splice(r+1);try{return e(this)}finally{this.stack.push(...s)}}each(e,...t){let{stack:r}=this,{length:s}=r,i=O(!1,r,-1);for(let e of t)i=i[e],r.push(e,i);try{for(let t=0;t{r[s]=e(t,s,i)},...t),r}match(...e){let t=this.stack.length-1,r=null,s=this.stack[t--];for(let i of e){if(void 0===s)return!1;let e=null;if("number"==typeof r&&(e=r,r=this.stack[t--],s=this.stack[t--]),i&&!i(s,r,e))return!1;r=this.stack[t--],s=this.stack[t--]}return!0}findAncestor(e){for(let t of h(this,Be,Me).call(this))if(e(t))return t}hasAncestor(e){for(let t of h(this,Be,Me).call(this))if(e(t))return!0;return!1}},Re=new Proxy(()=>{},{get:()=>Re}),_e=Re;var Ue=function(e){return null!==e&&"object"==typeof e};function*$e(e,t){let{getVisitorKeys:r,filter:s=()=>!0}=t,i=e=>Ue(e)&&s(e);for(let t of r(e)){let r=e[t];if(Array.isArray(r))for(let e of r)i(e)&&(yield e);else i(r)&&(yield r)}}function qe(e){return(t,r,s)=>{let i=!(null==s||!s.backwards);if(!1===r)return!1;let{length:n}=t,a=r;for(;a>=0&&a0},Ge=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),Ye=e=>Object.keys(e).filter(e=>!Ge.has(e));var Qe=function(e){return e?t=>e(t,Ge):Ye};function Ze(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"…"),t+(r?" "+r:"")}(e)}function et(e,t){t.leading=!0,t.trailing=!1,Ze(e,t)}function tt(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Ze(e,t)}function rt(e,t){t.leading=!1,t.trailing=!0,Ze(e,t)}var st=new WeakMap;function it(e,t){if(st.has(e))return st.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:s,getVisitorKeys:i},locStart:n,locEnd:a}=t;if(!s)return[];let o=((null==r?void 0:r(e,t))??[...$e(e,{getVisitorKeys:Qe(i)})]).flatMap(e=>s(e)?[e]:it(e,t));return o.sort((e,t)=>n(e)-n(t)||a(e)-a(t)),st.set(e,o),o}function nt(e,t,r,s){let i,n,{locStart:a,locEnd:o}=r,u=a(t),p=o(t),l=it(e,r),c=0,h=l.length;for(;c>1,s=l[e],d=a(s),m=o(s);if(d<=u&&p<=m)return nt(s,t,r,s);if(m<=u)i=s,c=e+1;else{if(!(p<=d))throw new Error("Comment location overlaps with node location");n=s,h=e}}if("TemplateLiteral"===(null==s?void 0:s.type)){let{quasis:e}=s,a=ct(e,t,r);i&&ct(e,i,r)!==a&&(i=null),n&&ct(e,n,r)!==a&&(n=null)}return{enclosingNode:s,precedingNode:i,followingNode:n}}var at=()=>!1;var ot=e=>!/[\S\n\u2028\u2029]/u.test(e);function ut(e,t,r,s){let{comment:i,precedingNode:n}=r[s],{locStart:a,locEnd:o}=t,u=a(i);if(n)for(let t=s-1;t>=0;t--){let{comment:s,precedingNode:i}=r[t];if(i!==n||!ot(e.slice(o(s),u)))break;u=a(s)}return Ke(e,u,{backwards:!0})}function pt(e,t,r,s){let{comment:i,followingNode:n}=r[s],{locStart:a,locEnd:o}=t,u=o(i);if(n)for(let t=s+1;t0;--n){let{comment:i,precedingNode:p,followingNode:l}=e[n-1];_e.strictEqual(p,a),_e.strictEqual(l,o);let c=t.originalText.slice(t.locEnd(i),u);if(!((null==(s=(r=t.printer).isGap)?void 0:s.call(r,c,t))??/^[\s(]*$/u.test(c)))break;u=t.locStart(i)}for(let[t,{comment:r}]of e.entries())t1&&e.comments.sort((e,r)=>t.locStart(e)-t.locStart(r));e.length=0}function ct(e,t,r){let s=r.locStart(t)-1;for(let t=1;t!s.has(e)).length)return{leading:"",trailing:""};let i,n=[],a=[];return e.each(()=>{let r=e.node;if(null!=s&&s.has(r))return;let{leading:o,trailing:u}=r;o?n.push(function(e,t){var r;let s=e.node,i=[dt(e,t)],{printer:n,originalText:a,locStart:o,locEnd:u}=t;if(null==(r=n.isBlockComment)?void 0:r.call(n,s)){let e=Ke(a,u(s))?Ke(a,o(s),{backwards:!0})?me:he:" ";i.push(e)}else i.push(me);let p=ze(a,Ve(a,u(s)));return!1!==p&&Ke(a,p)&&i.push(me),i}(e,t)):u&&(i=function(e,t,r){var s;let i=e.node,n=dt(e,t),{printer:a,originalText:o,locStart:u}=t,p=null==(s=a.isBlockComment)?void 0:s.call(a,i);if(null!=r&&r.hasLineSuffix&&(null==r||!r.isBlock)||Ke(o,u(i),{backwards:!0})){let e=ht(o,u(i));return{doc:ae([me,e?me:"",n]),isBlock:p,hasLineSuffix:!0}}return!p||null!=r&&r.hasLineSuffix?{doc:[ae([" ",n]),ue],isBlock:p,hasLineSuffix:!0}:{doc:[" ",n],isBlock:p,hasLineSuffix:!1}}(e,t,i),a.push(i.doc))},"comments"),{leading:n,trailing:a}}var yt=function(e){return()=>{}},ft=class extends Error{name="ConfigError"},Dt=class extends Error{name="UndefinedParserError"},xt={checkIgnorePragma:{category:"Special",type:"boolean",default:!1,description:"Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",cliCategory:"Other"},cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:"Maintain existing\n(mixed values within one file are normalised by looking at what's used after the first line)"}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function gt({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(e=>e.languages??[]),s=[];for(let i of function(e){let t=[];for(let[r,s]of Object.entries(e)){let e={name:r,...s};Array.isArray(e.default)&&(e.default=O(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),xt)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Et(i.choices,r,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),s.push(i));return{languages:r,options:s}}function*Et(e,t,r){let s=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!s.has(t)){s.add(t);let i=r.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),n=e.name;null!=i&&i.name&&(n+=` (plugin: ${i.name})`),yield{value:t,description:n}}}var At,Tt,Ct,Ft,bt,St=(e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()},Pt="windows"===(null==(At=globalThis.Deno)?void 0:At.build.os)||(null==(Ct=null==(Tt=globalThis.navigator)?void 0:Tt.platform)?void 0:Ct.startsWith("Win"))||(null==(bt=null==(Ft=globalThis.process)?void 0:Ft.platform)?void 0:bt.startsWith("win"))||!1;function vt(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}var wt=function(e){return Pt?function(e){e=vt(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=vt(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)};function It(e,t){if(!t)return;let r=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===r))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>r.endsWith(e)))}function kt(e,t){if(t){if(String(t).startsWith("file:"))try{t=wt(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var Nt=function(e,t){let r=St(!1,e.plugins).flatMap(e=>e.languages??[]),s=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(r,t.language)??It(r,t.physicalFile)??It(r,t.file)??kt(r,t.physicalFile)??kt(r,t.file)??void t.physicalFile;return null==s?void 0:s.parsers[0]},Bt={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>Bt.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${Bt.key(t)}: ${Bt.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>Bt.value({[e]:t})},Lt=new Proxy(String,{get:()=>Lt}),Mt=Lt,Ot=Symbol.for("vnopts.VALUE_NOT_EXIST"),jt=Symbol.for("vnopts.VALUE_UNCHANGED"),Rt=" ".repeat(2);function _t(e,t,r,s){return[`Invalid ${Mt.red(s.key(e))} value.`,`Expected ${Mt.blue(r)},`,`but received ${t===Ot?Mt.gray("nothing"):Mt.red(s.value(t))}.`].join(" ")}function Ut({text:e,list:t},r){let s=[];return e&&s.push(`- ${Mt.blue(e)}`),t&&s.push([`- ${Mt.blue(t.title)}:`].concat(t.values.map(e=>Ut(e,r-Rt.length).replace(/^|\n/g,`$&${Rt}`))).join("\n")),$t(s,r)}function $t(e,t){if(1===e.length)return e[0];let[r,s]=e,[i,n]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>n?s:r}var qt=[],Jt=[];var Vt=(e,t,{descriptor:r,logger:s,schemas:i})=>{let n=[`Ignored unknown option ${Mt.yellow(r.pair({key:e,value:t}))}.`],a=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let s=e.length,i=t.length;for(;s>0&&e.charCodeAt(~-s)===t.charCodeAt(~-i);)s--,i--;let n=0;for(;no?p>o?o+1:p:p>u?u+1:p;return o}(e,t)<3);a&&n.push(`Did you mean ${Mt.blue(r.key(a))}?`),s.warn(n.join(" "))},Ht=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];var Wt=class{static create(e){return function(e,t){let r=new e(t),s=Object.create(r);for(let e of Ht)e in t&&(s[e]=zt(t[e],r,Wt.prototype[e].length));return s}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,r){return e}preprocess(e,t){return e}postprocess(e,t){return jt}};function zt(e,t,r){return"function"==typeof e?(...s)=>e(...s.slice(0,r-1),t,...s.slice(r-1)):()=>e}var Kt=class extends Wt{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},Xt=class extends Wt{expected(){return"anything"}validate(){return!0}},Gt=class extends Wt{constructor({valueSchema:e,name:t=e.name,...r}){super({...r,name:t}),this._valueSchema=e}expected(e){let{text:t,list:r}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:r&&{title:"an array of the following values",values:[{list:r}]}}}validate(e,t){if(!Array.isArray(e))return!1;let r=[];for(let s of e){let e=t.normalizeValidateResult(this._valueSchema.validate(s,t),s);!0!==e&&r.push(e.value)}return 0===r.length||{value:r}}deprecated(e,t){let r=[];for(let s of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(s,t),s);!1!==e&&r.push(...e.map(({value:e})=>({value:[e]})))}return r}forward(e,t){let r=[];for(let s of e){let e=t.normalizeForwardResult(this._valueSchema.forward(s,t),s);r.push(...e.map(Yt))}return r}redirect(e,t){let r=[],s=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&r.push(e.remain),s.push(...e.redirect.map(Yt))}return 0===r.length?{redirect:s}:{redirect:s,remain:r}}overlap(e,t){return e.concat(t)}};function Yt({from:e,to:t}){return{from:[e],to:t}}var Qt=class extends Wt{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function Zt(e,t){let r=Object.create(null);for(let s of e){let e=s[t];if(r[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);r[e]=s}return r}function er(e,t){if(e===t)return 0;let r=typeof e,s=typeof t,i=["undefined","object","boolean","number","string"];return r!==s?i.indexOf(r)-i.indexOf(s):"string"!==r?Number(e)-Number(t):e.localeCompare(t)}function tr(e){return void 0===e?{}:e}function rr(e){if("string"==typeof e)return{text:e};let{text:t,list:r}=e;return function(e,t){if(!e)throw new Error(t)}(void 0!==(t||r),"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(rr)}}:{text:t}}function sr(e,t){return!0===e||(!1===e?{value:t}:e)}function ir(e,t,r=!1){return!1!==e&&(!0===e?!!r||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function nr(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ar(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>nr(e,t)):[nr(e,t)]}function or(e,t){let r=ar("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===r.length?{remain:t,redirect:r}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}var ur,pr=class extends Wt{constructor(e){super(e),this._choices=function(e,t){let r=new Map;for(let s of e){let e=s[t];if(r.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);r.set(e,s)}return r}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(er).map(e.value),r=t.slice(0,-2),s=t.slice(-2);return{text:r.concat(s.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},lr=class extends Wt{expected(){return"a number"}validate(e,t){return"number"==typeof e}},cr=class extends lr{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},hr=class extends Wt{expected(){return"a string"}validate(e){return"string"==typeof e}},dr=Bt,mr=Vt,yr=(e,t,r)=>{let{text:s,list:i}=r.normalizeExpectedResult(r.schemas[e].expected(r)),n=[];return s&&n.push(_t(e,t,s,r.descriptor)),i&&n.push([_t(e,t,i.title,r.descriptor)].concat(i.values.map(e=>Ut(e,r.loggerPrintWidth))).join("\n")),$t(n,r.loggerPrintWidth)},fr=(e,t,{descriptor:r})=>{let s=[`${Mt.yellow("string"==typeof e?r.key(e):r.pair(e))} is deprecated`];return t&&s.push(`we now treat it as ${Mt.blue("string"==typeof t?r.key(t):r.pair(t))}`),s.join("; ")+"."},Dr=class{constructor(e,t){let{logger:r=console,loggerPrintWidth:s=80,descriptor:i=dr,unknown:n=mr,invalid:a=yr,deprecated:o=fr,missing:u=()=>!1,required:p=()=>!1,preprocess:l=e=>e,postprocess:c=()=>jt}=t||{};this._utils={descriptor:i,logger:r||{warn:()=>{}},loggerPrintWidth:s,schemas:Zt(e,"name"),normalizeDefaultResult:tr,normalizeExpectedResult:rr,normalizeDeprecatedResult:ir,normalizeForwardResult:ar,normalizeRedirectResult:or,normalizeValidateResult:sr},this._unknownHandler=n,this._invalidHandler=function(e){return(...t)=>{let r=e(...t);return"string"==typeof r?new Error(r):r}}(a),this._deprecatedHandler=o,this._identifyMissing=(e,t)=>!(e in t)||u(e,t),this._identifyRequired=p,this._preprocess=l,this._postprocess=c,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return!!e[r]||(e[r]=!0,!1)}}()}normalize(e){let t={},r=[this._preprocess(e,this._utils)],s=()=>{for(;0!==r.length;){let e=r.shift(),s=this._applyNormalization(e,t);r.push(...s)}};s();for(let e of Object.keys(this._utils.schemas)){let s=this._utils.schemas[e];if(!(e in t)){let t=tr(s.default(this._utils));"value"in t&&r.push({[e]:t.value})}}s();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let r=this._utils.schemas[e],s=t[e],i=r.postprocess(s,this._utils);i!==jt&&(this._applyValidation(i,e,r),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let r=[],{knownKeys:s,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of s){let s=this._utils.schemas[i],n=s.preprocess(e[i],this._utils);this._applyValidation(n,i,s);let a=({from:e,to:t})=>{r.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},o=({value:e,redirectTo:t})=>{let r=ir(s.deprecated(e,this._utils),n,!0);if(!1!==r)if(!0===r)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of r){let r={key:i,value:e};if(!this._hasDeprecationWarned(r)){let s="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(r,s,this._utils))}}};ar(s.forward(n,this._utils),n).forEach(a);let u=or(s.redirect(n,this._utils),n);if(u.redirect.forEach(a),"remain"in u){let e=u.remain;t[i]=i in t?s.overlap(t[i],e,this._utils):e,o({value:e})}for(let{from:e,to:t}of u.redirect)o({value:e,redirectTo:t})}for(let s of i){let i=e[s];this._applyUnknownHandler(s,i,t,(e,t)=>{r.push({[e]:t})})}return r}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,Ot,this._utils)}_partitionOptionKeys(e){let[t,r]=function(e,t){let r=[],s=[];for(let i of e)t(i)?r.push(i):s.push(i);return[r,s]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:r}}_applyValidation(e,t,r){let s=sr(r.validate(e,this._utils),e);if(!0!==s)throw this._invalidHandler(t,s.value,this._utils)}_applyUnknownHandler(e,t,r,s){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?s(e,t):r[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==jt){if(t.delete)for(let r of t.delete)delete e[r];if(t.override){let{knownKeys:r,unknownKeys:s}=this._partitionOptionKeys(t.override);for(let s of r){let r=t.override[s];this._applyValidation(r,s,this._utils.schemas[s]),e[s]=r}for(let r of s){let s=t.override[r];this._applyUnknownHandler(r,s,e,(t,r)=>{let s=this._utils.schemas[t];this._applyValidation(r,t,s),e[t]=r})}}}}};function xr(e,{isCLI:t,optionInfos:r,FlagSchema:s}){let i,{name:n}=e,a={name:n},o={};switch(e.type){case"int":i=cr,t&&(a.preprocess=Number);break;case"string":case"path":i=hr;break;case"choice":i=pr,a.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Qt;break;case"flag":i=s,a.flags=r.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?a.validate=(t,r,s)=>e.exception(t)||r.validate(t,s):a.validate=(e,t,r)=>void 0===e||t.validate(e,r),e.redirect&&(o.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(o.deprecated=!0),t&&!e.array){let e=a.preprocess||(e=>e);a.preprocess=(t,r,s)=>r.preprocess(e(Array.isArray(t)?O(!1,t,-1):t),s)}return e.array?Gt.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...o,valueSchema:i.create(a)}):i.create({...a,...o})}var gr=function(e,t,{logger:r=!1,isCLI:s=!1,passThrough:i=!1,FlagSchema:n,descriptor:a}={}){if(s){if(!n)throw new Error("'FlagSchema' option is required.");if(!a)throw new Error("'descriptor' option is required.")}else a=Bt;let o=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,r)=>{let{_:s,...i}=r.schemas;return Vt(e,t,{...r,schemas:i})},u=function(e,{isCLI:t,FlagSchema:r}){let s=[];t&&s.push(Xt.create({name:"_"}));for(let i of e)s.push(xr(i,{isCLI:t,optionInfos:e,FlagSchema:r})),i.alias&&t&&s.push(Kt.create({name:i.alias,sourceName:i.name}));return s}(t,{isCLI:s,FlagSchema:n}),p=new Dr(u,{logger:r,unknown:o,descriptor:a}),l=!1!==r;l&&ur&&(p._hasDeprecationWarned=ur);let c=p.normalize(e);return l&&(ur=p._hasDeprecationWarned),c},Er=(e,t,r)=>{if(!e||null!=t){if(t.findLast)return t.findLast(r);for(let e=t.length-1;e>=0;e--){let s=t[e];if(r(s,e,t))return s}}};function Ar(e,t){if(!t)throw new Error("parserName is required.");let r=Er(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(r)return r;let s=`Couldn't resolve parser "${t}".`;throw s+=" Plugins must be explicitly added to the standalone bundle.",new ft(s)}function Tr({plugins:e,parser:t}){return Cr(Ar(e,t),t)}function Cr(e,t){let r=e.parsers[t];return"function"==typeof r?r():r}var Fr={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};var br=async function(e,t={}){var r;let s={...e};if(!s.parser){if(!s.filepath)throw new Dt("No parser and no file path given, couldn't infer a parser.");if(s.parser=Nt(s,{physicalFile:s.filepath}),!s.parser)throw new Dt(`No parser could be inferred for file "${s.filepath}".`)}let i=gt({plugins:e.plugins,showDeprecated:!0}).options,n={...Fr,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},a=Ar(s.plugins,s.parser),o=await Cr(a,s.parser);s.astFormat=o.astFormat,s.locEnd=o.locEnd,s.locStart=o.locStart;let u=null!=(r=a.printers)&&r[o.astFormat]?a:function(e,t){if(!t)throw new Error("astFormat is required.");let r=Er(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(r)return r;let s=`Couldn't find plugin for AST format "${t}".`;throw s+=" Plugins must be explicitly added to the standalone bundle.",new ft(s)}(s.plugins,o.astFormat),p=await function(e,t){let r=e.printers[t];return"function"==typeof r?r():r}(u,o.astFormat);s.printer=p;let l=u.defaultOptions?Object.fromEntries(Object.entries(u.defaultOptions).filter(([,e])=>void 0!==e)):{},c={...n,...l};for(let[e,t]of Object.entries(c))(null===s[e]||void 0===s[e])&&(s[e]=t);return"json"===s.parser&&(s.trailingComma="none"),gr(s,i,{passThrough:Object.keys(Fr),...t})},Sr=((e,t,r)=>(r=null!=e?i(u(e)):{},((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of o(t))!p.call(e,i)&&i!==r&&n(e,i,{get:()=>t[i],enumerable:!(s=a(t,i))||s.enumerable});return e})(!t&&e&&e.__esModule?r:n(r,"default",{value:e,enumerable:!0}),e)))(d(),1);var Pr=async function(e,t){let r,s=await Tr(t),i=s.preprocess?s.preprocess(e,t):e;t.originalText=i;try{r=await s.parse(i,t,t)}catch(t){!function(e,t){let{loc:r}=e;if(r){let s=(0,Sr.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+="\n"+s,e.codeFrame=s,e}throw e}(t,e)}return{text:i,ast:r}};async function vr(e,t,r,s,i){let{embeddedLanguageFormatting:n,printer:{embed:a,hasPrettierIgnore:o=()=>!1,getVisitorKeys:u}}=r;if(!a||"auto"!==n)return;if(a.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let p=Qe(a.getVisitorKeys??u),l=[];!function t(){let{node:s}=e;if(null===s||"object"!=typeof s||o(e))return;for(let r of p(s))Array.isArray(s[r])?e.each(t,r):e.call(t,r);let n=a(e,r);if(n){if("function"==typeof n)return void l.push({print:n,node:s,pathStack:[...e.stack]});i.set(s,n)}}();let c=e.stack;for(let{print:s,node:n,pathStack:a}of l)try{e.stack=a;let o=await s(h,t,e,r);o&&i.set(n,o)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function h(e,t){return async function(e,t,r,s){let i=await br({...r,...t,parentParser:r.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:n}=await Pr(e,i),a=await s(n,i);return G(a)}(e,t,r,s)}e.stack=c}var wr=function(e,t){let{originalText:r,[Symbol.for("comments")]:s,locStart:i,locEnd:n,[Symbol.for("printedComments")]:a}=t,{node:o}=e,u=i(o),p=n(o);for(let e of s)i(e)>=u&&n(e)<=p&&a.add(e);return r.slice(u,p)};async function Ir(e,t){({ast:e}=await Nr(e,t));let r=new Map,s=new je(e),i=yt(t),n=new Map;await vr(s,o,t,Ir,n);let a=await kr(s,t,o,void 0,n);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let e of t){if(!e.printed&&!r.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[fe,a];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[a,fe]}return a;function o(e,t){return void 0===e||e===s?u(t):Array.isArray(e)?s.call(()=>u(t),...e):s.call(()=>u(t),e)}function u(e){i(s);let a=s.node;if(null==a)return"";let u=a&&"object"==typeof a&&void 0===e;if(u&&r.has(a))return r.get(a);let p=kr(s,t,o,e,n);return u&&r.set(a,p),p}}function kr(e,t,r,s,i){var n;let a,{node:o}=e,{printer:u}=t;switch(a=null!=(n=u.hasPrettierIgnore)&&n.call(u,e)?wr(e,t):i.has(o)?i.get(o):u.print(e,t,r,s),o){case t.cursorNode:a=Q(a,e=>[fe,e,fe]);break;case t.nodeBeforeCursor:a=Q(a,e=>[e,fe]);break;case t.nodeAfterCursor:a=Q(a,e=>[fe,e])}return u.printComment&&(!u.willPrintOwnComments||!u.willPrintOwnComments(e,t))&&(a=function(e,t,r){let{leading:s,trailing:i}=mt(e,r);return s||i?Q(t,e=>[s,e,i]):t}(e,a,t)),a}async function Nr(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:r}=e;if(delete e.comments,!Xe(r)||!t.printer.canAttachComment)return;let s=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:n={}},originalText:a}=t,{ownLine:o=at,endOfLine:u=at,remaining:p=at}=n,l=r.map((s,i)=>({...nt(e,s,t),comment:s,text:a,options:t,ast:e,isLastComment:r.length-1===i}));for(let[e,t]of l.entries()){let r,{comment:n,precedingNode:a,enclosingNode:c,followingNode:h,text:d,options:m,ast:y,isLastComment:f}=t;if(i?r=[t]:(n.enclosingNode=c,n.precedingNode=a,n.followingNode=h,r=[n,d,m,y,f]),ut(d,m,l,e))n.placement="ownLine",o(...r)||(h?et(h,n):a?rt(a,n):tt(c||y,n));else if(pt(d,m,l,e))n.placement="endOfLine",u(...r)||(a?rt(a,n):h?et(h,n):tt(c||y,n));else if(n.placement="remaining",!p(...r))if(a&&h){let e=s.length;e>0&&s[e-1].followingNode!==h&<(s,m),s.push(t)}else a?rt(a,n):h?et(h,n):tt(c||y,n)}if(lt(s,t),!i)for(let e of r)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:s}}=t;return{ast:e=s?await s(e,t):e,comments:r}}var Br=function(e,t){let{cursorOffset:r,locStart:s,locEnd:i}=t,n=Qe(t.printer.getVisitorKeys),a=e=>s(e)<=r&&i(e)>=r,o=e,u=[e];for(let t of function*(e,t){let r=[e];for(let e=0;e0&&(void 0===p||void 0===l);){o=u.pop();let e=void 0!==p,t=void 0!==l;for(let a of $e(o,{getVisitorKeys:n})){if(!e){let e=i(a);e<=r&&e>c&&(p=a,c=e)}if(!t){let e=s(a);e>=r&&ee(t,s)).filter(Boolean);let a={},o=new Set(i(t));for(let r in t)!Object.prototype.hasOwnProperty.call(t,r)||n.has(r)||(o.has(r)?a[r]=e(t[r],t):a[r]=t[r]);let u=r(t,a,s);if(null!==u)return u??a}(e)},Mr=(e,t,r)=>{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(r);for(let e=t.length-1;e>=0;e--){if(r(t[e],e,t))return e}return-1}};function Or(e){let t=Mr(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function jr(e,t,r,s,i=[],n){let{locStart:a,locEnd:o}=r,u=a(e),p=o(e);if(!(t>p||ts);let o=e.slice(s,i).search(/\S/u),u=-1===o;if(!u)for(s+=o;i>s&&!/\S/u.test(e[i-1]);--i);let p,l,c=jr(r,s,t,(e,r)=>Ur(t,e,r),[],"rangeStart"),h=u?c:jr(r,i,t,e=>Ur(t,e),[],"rangeEnd");if(!c||!h)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let r=[e.node,...e.parentNodes],s=new Set([t.node,...t.parentNodes]);return r.find(e=>Rr.has(e.type)&&s.has(e))}(c,h);p=e,l=e}else({startNode:p,endNode:l}=function(e,t,{locStart:r,locEnd:s}){let i=e.node,n=t.node;if(i===n)return{startNode:i,endNode:n};let a=r(e.node);for(let e of Or(t.parentNodes)){if(!(r(e)>=a))break;n=e}let o=s(t.node);for(let t of Or(e.parentNodes)){if(!(s(t)<=o))break;if(i=t,i===n)break}return{startNode:i,endNode:n}}(c,h,t));return{rangeStart:Math.min(n(p),n(l)),rangeEnd:Math.max(a(p),a(l))}}var qr=Symbol("cursor");async function Jr(e,t,r=0){if(!e||0===e.trim().length)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:s,text:i}=await Pr(e,t);t.cursorOffset>=0&&(t={...t,...Br(s,t)});let n=await Ir(s,t);r>0&&(n=xe([me,n],r,t.tabWidth));let a=Ne(n,t);if(r>0){let e=a.formatted.trim();void 0!==a.cursorNodeStart&&(a.cursorNodeStart-=a.formatted.indexOf(e),a.cursorNodeStart<0&&(a.cursorNodeStart=0,a.cursorNodeText=a.cursorNodeText.trimStart()),a.cursorNodeStart+a.cursorNodeText.length>e.length&&(a.cursorNodeText=a.cursorNodeText.trimEnd())),a.formatted=e+x(t.endOfLine)}let o=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,r,s,n;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&a.cursorNodeText)if(s=a.cursorNodeStart,n=a.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),r=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let s=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;r=i.slice(e,s)}else e=0,r=i,s=0,n=a.formatted;let u=t.cursorOffset-e;if(r===n)return{formatted:a.formatted,cursorOffset:s+u,comments:o};let p=r.split("");p.splice(u,0,qr);let l=function(e,t,r){return D.diff(e,t,r)}(p,n.split("")),c=s;for(let e of l)if(e.removed){if(e.value.includes(qr))break}else c+=e.count;return{formatted:a.formatted,cursorOffset:c,comments:o}}return{formatted:a.formatted,cursorOffset:-1,comments:o}}function Vr(e,t,r){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?r:t}function Hr(e,t){let{cursorOffset:r,rangeStart:s,rangeEnd:i}=t;return r=Vr(e,r,-1),s=Vr(e,s,0),i=Vr(e,i,e.length),{...t,cursorOffset:r,rangeStart:s,rangeEnd:i}}function Wr(e,t){let{cursorOffset:r,rangeStart:s,rangeEnd:i,endOfLine:n}=Hr(e,t),a="\ufeff"===e.charAt(0);if(a&&(e=e.slice(1),r--,s--,i--),"auto"===n&&(n=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>g(e.slice(0,Math.max(t,0)),"\r\n");r-=t(r),s-=t(s),i-=t(i),e=function(e){return y(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:a,text:e,options:Hr(e,{...t,cursorOffset:r,rangeStart:s,rangeEnd:i,endOfLine:n})}}async function zr(e,t){let r=await Tr(t);return!r.hasPragma||r.hasPragma(e)}async function Kr(e,t){let r,{hasBOM:s,text:i,options:n}=Wr(e,await br(t));return n.rangeStart>=n.rangeEnd&&""!==i||n.requirePragma&&!await zr(i,n)||n.checkIgnorePragma&&await async function(e,t){var r;let s=await Tr(t);return null==(r=s.hasIgnorePragma)?void 0:r.call(s,e)}(i,n)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(n.rangeStart>0||n.rangeEndi&&t.cursorOffset<=n?t.cursorOffset-i:-1,endOfLine:"lf"},p),c=l.formatted.trimEnd(),{cursorOffset:h}=t;h>n?h+=c.length-a.length:l.cursorOffset>=0&&(h=l.cursorOffset+i);let d=s.slice(0,i)+c+s.slice(n);if("lf"!==t.endOfLine){let e=x(t.endOfLine);h>=0&&"\r\n"===e&&(h+=g(d.slice(0,h),"\n")),d=y(!1,d,"\n",e)}return{formatted:d,cursorOffset:h,comments:l.comments}}(i,n):(!n.requirePragma&&n.insertPragma&&n.printer.insertPragma&&!await zr(i,n)&&(i=n.printer.insertPragma(i)),r=await Jr(i,n)),s&&(r.formatted="\ufeff"+r.formatted,r.cursorOffset>=0&&r.cursorOffset++),r)}var Xr={};c(Xr,{builders:()=>Gr,printer:()=>Yr,utils:()=>Qr});var Gr={join:De,line:he,softline:de,hardline:me,literalline:ye,group:ne,conditionalGroup:function(e,t){return ne(e[0],{...t,expandedStates:e})},fill:function(e){return re(e),{type:P,parts:e}},lineSuffix:ae,lineSuffixBoundary:oe,cursor:fe,breakParent:ue,ifBreak:function(e,t="",r={}){return ee(e),""!==t&&ee(t),{type:v,breakContents:e,flatContents:t,groupId:r.groupId}},trim:pe,indent:se,indentIfBreak:function(e,t){return ee(e),{type:w,contents:e,groupId:t.groupId,negate:t.negate}},align:ie,addAlignmentToDoc:xe,markAsRoot:function(e){return ie({type:"root"},e)},dedentToRoot:function(e){return ie(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return ie(-1,e)},hardlineWithoutBreakParent:le,literallineWithoutBreakParent:ce,label:function(e,t){return ee(t),e?{type:B,label:e,contents:t}:t},concat:e=>e},Yr={printDocToString:Ne},Qr={willBreak:function(e){return V(e,H,!1)},traverseDoc:q,findInDoc:V,mapDoc:J,removeLines:function(e){return J(e,z)},stripTrailingHardline:G,replaceEndOfLine:function(e,t=ye){return J(e,e=>"string"==typeof e?De(t,e.split("\n")):e)},canBreak:function(e){return V(e,Y,!1)}},Zr="3.6.2",es={};c(es,{addDanglingComment:()=>tt,addLeadingComment:()=>et,addTrailingComment:()=>rt,getAlignmentSize:()=>Oe,getIndentSize:()=>ns,getMaxContinuousCount:()=>as,getNextNonSpaceNonCommentCharacter:()=>os,getNextNonSpaceNonCommentCharacterIndex:()=>ds,getPreferredQuote:()=>ps,getStringWidth:()=>Te,hasNewline:()=>Ke,hasNewlineInRange:()=>ls,hasSpaces:()=>cs,isNextLineEmpty:()=>ys,isNextLineEmptyAfterIndex:()=>is,isPreviousLineEmpty:()=>ms,makeString:()=>hs,skip:()=>qe,skipEverythingButNewLine:()=>We,skipInlineComment:()=>ts,skipNewline:()=>ze,skipSpaces:()=>Ve,skipToLineEnd:()=>He,skipTrailingComment:()=>rs,skipWhitespace:()=>Je});var ts=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let r=t+2;rMath.max(e,r.length/t.length),0)};var os=function(e,t){let r=ss(e,t);return!1===r?"":e.charAt(r)},us="'";var ps=function(e,t){let r=!0===t||t===us?us:'"',s=r===us?'"':us,i=0,n=0;for(let t of e)t===r?i++:t===s&&n++;return i>n?s:r};var ls=function(e,t,r){for(let s=t;si===s?i:n===t?"\\"+n:n||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function ds(e,t){return 2===arguments.length||"number"==typeof t?ss(e,t):function(e,t,r){return ss(e,r(t))}(...arguments)}function ms(e,t){return 2===arguments.length||"number"==typeof t?ht(e,t):function(e,t,r){return ht(e,r(t))}(...arguments)}function ys(e,t){return 2===arguments.length||"number"==typeof t?is(e,t):function(e,t,r){return is(e,r(t))}(...arguments)}function fs(e,t=1){return async(...r)=>{let s=r[t]??{},i=s.plugins??[];return r[t]={...s,plugins:Array.isArray(i)?i:Object.values(i)},e(...r)}}var Ds=fs(Kr);async function xs(e,t){let{formatted:r}=await Ds(e,{...t,cursorOffset:-1});return r}async function gs(e,t){return await xs(e,t)===e}var Es=fs(gt,0),As={parse:fs(async function(e,t,r){let{text:s,options:i}=Wr(e,await br(t)),n=await Pr(s,i);return r&&(r.preprocessForPrint&&(n.ast=await Nr(n.ast,i)),r.massage&&(n.ast=Lr(n.ast,i))),n}),formatAST:fs(async function(e,t){return t=await br(t),Ne(await Ir(e,t),t)}),formatDoc:fs(async function(e,t){let r=function(e){let t=Object.create(null),r=new Set;return function e(t,r,i){var n,a;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let r=t.map(e).filter(Boolean);return 1===r.length?r[0]:`[${r.join(", ")}]`}if(t.type===N){let e=(null==(n=null==i?void 0:i[r+1])?void 0:n.type)===L;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===L)return(null==(a=null==i?void 0:i[r-1])?void 0:a.type)===N&&i[r-1].hard?void 0:"breakParent";if(t.type===b)return"trim";if(t.type===C)return"indent("+e(t.contents)+")";if(t.type===F)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===v)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${s(t.groupId)} }`:"")+")";if(t.type===w){let r=[];t.negate&&r.push("negate: true"),t.groupId&&r.push(`groupId: ${s(t.groupId)}`);let i=r.length>0?`, { ${r.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===S){let r=[];t.break&&"propagated"!==t.break&&r.push("shouldBreak: true"),t.id&&r.push(`id: ${s(t.id)}`);let i=r.length>0?`, { ${r.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===P)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===I)return"lineSuffix("+e(t.contents)+")";if(t.type===k)return"lineSuffixBoundary";if(t.type===B)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===T)return"cursor";throw new Error("Unknown doc type "+t.type)}(ge(e));function s(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let s=e.description||"symbol";for(let i=0;;i++){let n=s+(i>0?` #${i}`:"");if(!r.has(n))return r.add(n),t[e]=`Symbol.for(${JSON.stringify(n)})`}}}(e),{formatted:s}=await Kr(r,{...t,parser:"__js_expression"});return s}),printToDoc:fs(async function(e,t){t=await br(t);let{ast:r}=await Pr(e,t);return t.cursorOffset>=0&&(t={...t,...Br(r,t)}),Ir(r,t)}),printDocToString:fs(async function(e,t){return Ne(e,await br(t))})},Ts=m,Cs=r(44582),Fs=Object.defineProperty,bs=e=>{throw TypeError(e)},Ss=(e,t)=>{for(var r in t)Fs(e,r,{get:t[r],enumerable:!0})},Ps=(e,t,r)=>t.has(e)||bs("Cannot "+r),vs=(e,t,r)=>(Ps(e,t,"read from private field"),r?r.call(e):t.get(e)),ws={};Ss(ws,{languages:()=>dh,options:()=>ch,printers:()=>hh});var Is={};Ss(Is,{canAttachComment:()=>Vo,embed:()=>Pu,experimentalFeatures:()=>rh,getCommentChildNodes:()=>Ho,getVisitorKeys:()=>pi,handleComments:()=>qa,insertPragma:()=>$u,isBlockComment:()=>hi,isGap:()=>zo,massageAstNode:()=>Ln,print:()=>th,printComment:()=>$a,willPrintOwnComments:()=>Wo});var ks=(e,t,r,s)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(r,s):r.global?t.replace(r,s):t.split(r).join(s)},Ns=(e,t,r)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[r<0?t.length+r:r]:t.at(r)};var Bs=function(e){return null!==e&&"object"==typeof e};function*Ls(e,t){let{getVisitorKeys:r,filter:s=()=>!0}=t,i=e=>Bs(e)&&s(e);for(let t of r(e)){let r=e[t];if(Array.isArray(r))for(let e of r)i(e)&&(yield e);else i(r)&&(yield r)}}function Ms(e,{getVisitorKeys:t,predicate:r}){for(let s of function*(e,t){let r=[e];for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),js=/[^\x20-\x7F]/u;var Rs=function(e){if(!e)return 0;if(!js.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let r of e){let e=r.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Os(e)?1:2)}return t};function _s(e){return(t,r,s)=>{let i=!(null==s||!s.backwards);if(!1===r)return!1;let{length:n}=t,a=r;for(;a>=0&&a0},Xs=new Proxy(()=>{},{get:()=>Xs}),Gs=Xs,Ys="'";var Qs=function(e,t){let r=!0===t||t===Ys?Ys:'"',s=r===Ys?'"':Ys,i=0,n=0;for(let t of e)t===r?i++:t===s&&n++;return i>n?s:r};var Zs=function(e,t,r){let s='"'===t?"'":'"',i=ks(!1,e,/\\(.)|(["'])/gsu,(e,i,n)=>i===s?i:n===t?"\\"+n:n||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};var ei=function(e,t){Gs.ok(/^(?["']).*\k$/su.test(e));let r=e.slice(1,-1),s="json"===t.parser||"jsonc"===t.parser||"json5"===t.parser&&"preserve"===t.quoteProps&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":Qs(r,t.singleQuote);return e.charAt(0)===s?e:Zs(r,s,!1)},ti=e=>Number.isInteger(e)&&e>=0;function ri(e){var t,r,s;let i=(null==(t=e.range)?void 0:t[0])??e.start,n=null==(s=(null==(r=e.declaration)?void 0:r.decorators)??e.decorators)?void 0:s[0];return n?Math.min(ri(n),i):i}function si(e){var t;return(null==(t=e.range)?void 0:t[1])??e.end}function ii(e,t){let r=ri(e);return ti(r)&&r===ri(t)}function ni(e,t){return ii(e,t)&&function(e,t){let r=si(e);return ti(r)&&r===si(t)}(e,t)}var ai=null;function oi(e){if(null!==ai&&(ai.property,1)){let e=ai;return ai=oi.prototype=null,e}return ai=oi.prototype=e??Object.create(null),new oi}for(let e=0;e<=10;e++)oi();var ui=function(e,t="type"){return function(e){oi(e)}(e),function(r){let s=r[t],i=e[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:r});return i}},pi=ui({ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]});var li=function(e){let t=new Set(e);return e=>t.has(null==e?void 0:e.type)};var ci=function(e){var t;return(null==(t=e.extra)?void 0:t.raw)??e.raw},hi=li(["Block","CommentBlock","MultiLine"]),di=li(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),mi=li(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]);var yi=function(e,t){return t.some(t=>function(e,t){let r=t.split(".");for(let t=r.length-1;t>=0;t--){let s=r[t];if(0===t)return"Identifier"===e.type&&e.name===s;if("MemberExpression"!==e.type||e.optional||e.computed||"Identifier"!==e.property.type||e.property.name!==s)return!1;e=e.object}}(e,t))};var fi=function({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")};function Di(e,t){return t(e)||Ms(e,{getVisitorKeys:pi,predicate:t})}function xi(e){return"AssignmentExpression"===e.type||"BinaryExpression"===e.type||"LogicalExpression"===e.type||"NGPipeExpression"===e.type||"ConditionalExpression"===e.type||Ji(e)||Vi(e)||"SequenceExpression"===e.type||"TaggedTemplateExpression"===e.type||"BindExpression"===e.type||"UpdateExpression"===e.type&&!e.prefix||Pn(e)||"TSNonNullExpression"===e.type||"ChainExpression"===e.type}function gi(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Ei(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var Ai=li(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),Ti=li(["ArrayExpression"]),Ci=li(["ObjectExpression"]);function Fi(e){return"NumericLiteral"===e.type||"Literal"===e.type&&"number"==typeof e.value}function bi(e){return"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&Fi(e.argument)}function Si(e){return!(!e||"StringLiteral"!==e.type&&("Literal"!==e.type||"string"!=typeof e.value))}function Pi(e){return"RegExpLiteral"===e.type||"Literal"===e.type&&!!e.regex}var vi=li(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),wi=li(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),Ii=li(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),ki=li(["FunctionExpression","ArrowFunctionExpression"]);function Ni(e){return Ji(e)&&"Identifier"===e.callee.type&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var Bi=li(["JSXElement","JSXFragment"]);function Li(e){return e.method&&"init"===e.kind||"get"===e.kind||"set"===e.kind}function Mi(e){return!("ObjectTypeProperty"!==e.type&&"ObjectTypeInternalSlot"!==e.type||e.static||e.method||"get"===e.kind||"set"===e.kind||"FunctionTypeAnnotation"!==e.value.type)}var Oi=li(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function ji(e){return Vi(e)||"BindExpression"===e.type&&!!e.object}var Ri=li(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function _i(e){return fi(e)||di(e)||Ri(e)||("GenericTypeAnnotation"===e.type||"TSTypeReference"===e.type)&&!e.typeParameters&&!e.typeArguments}var Ui=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function $i(e,t){if("CallExpression"!==(null==e?void 0:e.type)||e.optional)return!1;let r=yn(e);if(1===r.length){if(Ni(e)&&$i(t))return ki(r[0]);if(function(e){return"Identifier"===e.type&&("beforeEach"===e.name||"beforeAll"===e.name||"afterEach"===e.name||"afterAll"===e.name)}(e.callee))return Ni(r[0])}else if((2===r.length||3===r.length)&&("TemplateLiteral"===r[0].type||Si(r[0]))&&function(e){return yi(e,Ui)}(e.callee))return!(r[2]&&!Fi(r[2]))&&((2===r.length?ki(r[1]):function(e){return"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type&&"BlockStatement"===e.body.type}(r[1])&&dn(r[1]).length<=1)||Ni(r[1]));return!1}var qi=e=>t=>("ChainExpression"===(null==t?void 0:t.type)&&(t=t.expression),e(t)),Ji=qi(li(["CallExpression","OptionalCallExpression"])),Vi=qi(li(["MemberExpression","OptionalMemberExpression"]));function Hi(e,t=5){return Wi(e,t)<=t}function Wi(e,t){let r=0;for(let s in e){let i=e[s];if(i&&"object"==typeof i&&"string"==typeof i.type&&(r++,r+=Wi(i,t-r)),r>t)return r}return r}function zi(e,t){let{printWidth:r}=t;if(Tn(e))return!1;let s=.25*r;if("ThisExpression"===e.type||"Identifier"===e.type&&e.name.length<=s||bi(e)&&!Tn(e.argument))return!0;let i="Literal"===e.type&&"regex"in e&&e.regex.pattern||"RegExpLiteral"===e.type&&e.pattern;return i?i.length<=s:Si(e)?ei(ci(e),t).length<=s:"TemplateLiteral"===e.type?0===e.expressions.length&&e.quasis[0].value.raw.length<=s&&!e.quasis[0].value.raw.includes("\n"):"UnaryExpression"===e.type?zi(e.argument,{printWidth:r}):"CallExpression"===e.type&&0===e.arguments.length&&"Identifier"===e.callee.type?e.callee.name.length<=s-2:vi(e)}function Ki(e,t){return Bi(t)?gn(t):Tn(t,En.Leading,t=>Vs(e,si(t)))}function Xi(e){return e.quasis.some(e=>e.value.raw.includes("\n"))}function Gi(e,t){return("TemplateLiteral"===e.type&&Xi(e)||"TaggedTemplateExpression"===e.type&&Xi(e.quasi))&&!Vs(t,ri(e),{backwards:!0})}function Yi(e){if(!Tn(e))return!1;let t=Ns(!1,Cn(e,En.Dangling),-1);return t&&!hi(t)}function Qi(e){let{node:t,parent:r,key:s}=e;return"callee"===s&&Ji(t)&&Ji(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var Zi=new Set(["!","-","+","~"]);function en(e,t=2){if(t<=0)return!1;if("ChainExpression"===e.type||"TSNonNullExpression"===e.type)return en(e.expression,t);let r=e=>en(e,t-1);if(Pi(e))return Rs(e.pattern??e.regex.pattern)<=5;if(vi(e)||wi(e)||"ArgumentPlaceholder"===e.type)return!0;if("TemplateLiteral"===e.type)return e.quasis.every(e=>!e.value.raw.includes("\n"))&&e.expressions.every(r);if(Ci(e))return e.properties.every(e=>!e.computed&&(e.shorthand||e.value&&r(e.value)));if(Ti(e))return e.elements.every(e=>null===e||r(e));if(bn(e)){if("ImportExpression"===e.type||en(e.callee,t)){let s=yn(e);return s.length<=t&&s.every(r)}return!1}return Vi(e)?en(e.object,t)&&en(e.property,t):!!("UnaryExpression"===e.type&&Zi.has(e.operator)||"UpdateExpression"===e.type)&&en(e.argument,t)}function tn(e){return e}function rn(e,t="es5"){return"es5"===e.trailingComma&&"es5"===t||"all"===e.trailingComma&&("all"===t||"es5"===t)}function sn(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return sn(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return sn(e.object,t);case"TaggedTemplateExpression":return"FunctionExpression"!==e.tag.type&&sn(e.tag,t);case"CallExpression":case"OptionalCallExpression":return"FunctionExpression"!==e.callee.type&&sn(e.callee,t);case"ConditionalExpression":return sn(e.test,t);case"UpdateExpression":return!e.prefix&&sn(e.argument,t);case"BindExpression":return e.object&&sn(e.object,t);case"SequenceExpression":return sn(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return sn(e.expression,t);default:return t(e)}}var nn={"==":!0,"!=":!0,"===":!0,"!==":!0},an={"*":!0,"/":!0,"%":!0},on={">>":!0,">>>":!0,"<<":!0};function un(e,t){return!(ln(t)!==ln(e)||"**"===e||nn[e]&&nn[t]||"%"===t&&an[e]||"%"===e&&an[t]||t!==e&&an[t]&&an[e]||on[e]&&on[t])}var pn=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(e=>[e,t])));function ln(e){return pn.get(e)}function cn(e){var t;if(e.rest)return!0;let r=dn(e);return"RestElement"===(null==(t=Ns(!1,r,-1))?void 0:t.type)}var hn=new WeakMap;function dn(e){if(hn.has(e))return hn.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),hn.set(e,t),t}var mn=new WeakMap;function yn(e){if(mn.has(e))return mn.get(e);if("ChainExpression"===e.type)return yn(e.expression);let t=e.arguments;return("ImportExpression"===e.type||"TSImportType"===e.type)&&(t=["ImportExpression"===e.type?e.source:e.argument],e.options&&t.push(e.options)),mn.set(e,t),t}function fn(e,t){let{node:r}=e;if("ChainExpression"===r.type)return e.call(()=>fn(e,t),"expression");"ImportExpression"===r.type||"TSImportType"===r.type?(e.call(e=>t(e,0),"ImportExpression"===r.type?"source":"argument"),r.options&&e.call(e=>t(e,1),"options")):e.each(t,"arguments")}function Dn(e,t){let r=[];if("ChainExpression"===e.type&&(e=e.expression,r.push("expression")),"ImportExpression"===e.type||"TSImportType"===e.type){if(0===t||t===(e.options?-2:-1))return[...r,"ImportExpression"===e.type?"source":"argument"];if(e.options&&(1===t||-1===t))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function xn(e){return"prettier-ignore"===e.value.trim()&&!e.unignore}function gn(e){return(null==e?void 0:e.prettierIgnore)||Tn(e,En.PrettierIgnore)}var En={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},An=(e,t)=>{if("function"==typeof e&&(t=e,e=0),e||t)return(r,s,i)=>!(e&En.Leading&&!r.leading||e&En.Trailing&&!r.trailing||e&En.Dangling&&(r.leading||r.trailing)||e&En.Block&&!hi(r)||e&En.Line&&!mi(r)||e&En.First&&0!==s||e&En.Last&&s!==i.length-1||e&En.PrettierIgnore&&!xn(r)||t&&!t(r))};function Tn(e,t,r){if(!Ks(null==e?void 0:e.comments))return!1;let s=An(t,r);return!s||e.comments.some(s)}function Cn(e,t,r){if(!Array.isArray(null==e?void 0:e.comments))return[];let s=An(t,r);return s?e.comments.filter(s):e.comments}var Fn=(e,{originalText:t})=>zs(t,si(e));function bn(e){return Ji(e)||"NewExpression"===e.type||"ImportExpression"===e.type}function Sn(e){return e&&("ObjectProperty"===e.type||"Property"===e.type&&!Li(e))}var Pn=li(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),vn=li(["TSUnionType","UnionTypeAnnotation"]),wn=li(["TSIntersectionType","IntersectionTypeAnnotation"]),In=li(["TSConditionalType","ConditionalTypeAnnotation"]),kn=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),Nn=e=>{for(let t of e.quasis)delete t.value};function Bn(e,t){var r;if("Program"===e.type&&delete t.sourceType,("BigIntLiteral"===e.type||"BigIntLiteralTypeAnnotation"===e.type)&&e.value&&(t.value=e.value.toLowerCase()),("BigIntLiteral"===e.type||"Literal"===e.type)&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),"EmptyStatement"===e.type||"JSXText"===e.type||"JSXExpressionContainer"===e.type&&("Literal"===e.expression.type||"StringLiteral"===e.expression.type)&&" "===e.expression.value)return null;if(("Property"===e.type||"ObjectProperty"===e.type||"MethodDefinition"===e.type||"ClassProperty"===e.type||"ClassMethod"===e.type||"PropertyDefinition"===e.type||"TSDeclareMethod"===e.type||"TSPropertySignature"===e.type||"ObjectTypeProperty"===e.type||"ImportAttribute"===e.type)&&e.key&&!e.computed){let{key:r}=e;Si(r)||Fi(r)?t.key=String(r.value):"Identifier"===r.type&&(t.key=r.name)}if("JSXElement"===e.type&&"style"===e.openingElement.name.name&&e.openingElement.attributes.some(e=>"JSXAttribute"===e.type&&"jsx"===e.name.name))for(let{type:e,expression:r}of t.children)"JSXExpressionContainer"===e&&"TemplateLiteral"===r.type&&Nn(r);"JSXAttribute"===e.type&&"css"===e.name.name&&"JSXExpressionContainer"===e.value.type&&"TemplateLiteral"===e.value.expression.type&&Nn(t.value.expression),"JSXAttribute"===e.type&&"Literal"===(null==(r=e.value)?void 0:r.type)&&/["']|"|'/u.test(e.value.value)&&(t.value.value=ks(!1,e.value.value,/["']|"|'/gu,'"'));let s=e.expression||e.callee;if("Decorator"===e.type&&"CallExpression"===s.type&&"Component"===s.callee.name&&1===s.arguments.length){let r=e.expression.arguments[0].properties;for(let[e,s]of t.expression.arguments[0].properties.entries())switch(r[e].key.name){case"styles":Ti(s.value)&&Nn(s.value.elements[0]);break;case"template":"TemplateLiteral"===s.value.type&&Nn(s.value)}}"TaggedTemplateExpression"===e.type&&("MemberExpression"===e.tag.type||"Identifier"===e.tag.type&&("gql"===e.tag.name||"graphql"===e.tag.name||"css"===e.tag.name||"md"===e.tag.name||"markdown"===e.tag.name||"html"===e.tag.name)||"CallExpression"===e.tag.type)&&Nn(t.quasi),"TemplateLiteral"===e.type&&Nn(t),"ChainExpression"===e.type&&"TSNonNullExpression"===e.expression.type&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression")}Bn.ignoredProperties=kn;var Ln=Bn,Mn="string",On="array",jn="cursor",Rn="indent",_n="align",Un="trim",$n="group",qn="fill",Jn="if-break",Vn="indent-if-break",Hn="line-suffix",Wn="line-suffix-boundary",zn="line",Kn="label",Xn="break-parent",Gn=new Set([jn,Rn,_n,Un,$n,qn,Jn,Vn,Hn,Wn,zn,Kn,Xn]);var Yn=function(e){if("string"==typeof e)return Mn;if(Array.isArray(e))return On;if(!e)return;let{type:t}=e;return Gn.has(t)?t:void 0};function Qn(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Yn(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if("[object Object]"!==r)return`Unexpected doc '${r}'.`;let s=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...Gn].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${s}.`}var Zn=class extends Error{name="InvalidDocError";constructor(e){super(Qn(e)),this.doc=e}},ea=Zn,ta={};var ra=function(e,t,r,s){let i=[e];for(;i.length>0;){let e=i.pop();if(e===ta){r(i.pop());continue}r&&i.push(e,ta);let n=Yn(e);if(!n)throw new ea(e);if(!1!==(null==t?void 0:t(e)))switch(n){case On:case qn:{let t=n===On?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case Jn:i.push(e.flatContents,e.breakContents);break;case $n:if(s&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case _n:case Rn:case Vn:case Kn:case Hn:i.push(e.contents);break;case Mn:case jn:case Un:case Wn:case zn:case Xn:break;default:throw new ea(e)}}};function sa(e,t){if("string"==typeof e)return t(e);let r=new Map;return s(e);function s(e){if(r.has(e))return r.get(e);let i=function(e){switch(Yn(e)){case On:return t(e.map(s));case qn:return t({...e,parts:e.parts.map(s)});case Jn:return t({...e,breakContents:s(e.breakContents),flatContents:s(e.flatContents)});case $n:{let{expandedStates:r,contents:i}=e;return r?(r=r.map(s),i=r[0]):i=s(i),t({...e,contents:i,expandedStates:r})}case _n:case Rn:case Vn:case Kn:case Hn:return t({...e,contents:s(e.contents)});case Mn:case jn:case Un:case Wn:case zn:case Xn:return t(e);default:throw new ea(e)}}(e);return r.set(e,i),i}}function ia(e,t,r){let s=r,i=!1;return ra(e,function(e){if(i)return!1;let r=t(e);void 0!==r&&(i=!0,s=r)}),s}function na(e){if(e.type===$n&&e.break||e.type===zn&&e.hard||e.type===Xn)return!0}function aa(e){return ia(e,na,!1)}function oa(e){if(e.length>0){let t=Ns(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function ua(e){return e.type!==zn||e.hard?e.type===Jn?e.flatContents:e:e.soft?"":" "}function pa(e){return sa(e,ua)}function la(e){return sa(e,e=>function(e){switch(Yn(e)){case qn:if(e.parts.every(e=>""===e))return"";break;case $n:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===$n&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case _n:case Rn:case Vn:case Hn:if(!e.contents)return"";break;case Jn:if(!e.flatContents&&!e.breakContents)return"";break;case On:{let t=[];for(let r of e){if(!r)continue;let[e,...s]=Array.isArray(r)?r:[r];"string"==typeof e&&"string"==typeof Ns(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...s)}return 0===t.length?"":1===t.length?t[0]:t}case Mn:case jn:case Un:case Wn:case zn:case Kn:case Xn:break;default:throw new ea(e)}return e}(e))}function ca(e,t=Ma){return sa(e,e=>"string"==typeof e?ja(t,e.split("\n")):e)}function ha(e){if(e.type===zn)return!0}function da(e,t){return e.type===Kn?{...e,contents:t(e.contents)}:t(e)}function ma(e){let t=!0;return ra(e,e=>{switch(Yn(e)){case Mn:if(""===e)break;case Un:case Wn:case zn:case Xn:return t=!1,!1}}),t}var ya=()=>{},fa=ya,Da=ya,xa=ya;function ga(e){return fa(e),{type:Rn,contents:e}}function Ea(e,t){return fa(t),{type:_n,contents:t,n:e}}function Aa(e,t={}){return fa(e),Da(t.expandedStates,!0),{type:$n,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Ta(e){return Ea(Number.NEGATIVE_INFINITY,e)}function Ca(e){return Ea(-1,e)}function Fa(e,t){return Aa(e[0],{...t,expandedStates:e})}function ba(e){return xa(e),{type:qn,parts:e}}function Sa(e,t="",r={}){return fa(e),""!==t&&fa(t),{type:Jn,breakContents:e,flatContents:t,groupId:r.groupId}}function Pa(e,t){return fa(e),{type:Vn,contents:e,groupId:t.groupId,negate:t.negate}}function va(e){return fa(e),{type:Hn,contents:e}}var wa={type:Wn},Ia={type:Xn},ka={type:zn,hard:!0},Na={type:zn},Ba={type:zn,soft:!0},La=[ka,Ia],Ma=[{type:zn,hard:!0,literal:!0},Ia],Oa={type:jn};function ja(e,t){fa(e),Da(t);let r=[];for(let s=0;s1&&t.every(e=>"*"===e.trimStart()[0])}(e)),_a.get(e)};function $a(e,t){let r=e.node;if(mi(r))return t.originalText.slice(ri(r),si(r)).trimEnd();if(Ua(r))return function(e){let t=e.value.split("\n");return["/*",ja(La,t.map((e,r)=>0===r?e.trimEnd():" "+(r20&&(r=r.slice(0,19)+"…"),t+(r?" "+r:"")}(e)}function Va(e,t){t.leading=!0,t.trailing=!1,Ja(e,t)}function Ha(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Ja(e,t)}function Wa(e,t){t.leading=!1,t.trailing=!0,Ja(e,t)}Ss(qa,{endOfLine:()=>eo,ownLine:()=>Za,remaining:()=>to});var za=function(e,t){let r=null,s=t;for(;s!==r;)r=s,s=Us(e,s),s=Hs(e,s),s=Ws(e,s),s=Js(e,s);return s};var Ka=function(e,t){let r=za(e,t);return!1===r?"":e.charAt(r)};var Xa=function(e,t,r){for(let s=t;smi(e)||!Xa(t,ri(e),si(e));function Za(e){return[Oo,lo,To,Ao,uo,no,ao,oo,mo,wo,So,vo,Io,ko,fo,Co,Fo,po,Uo,jo].some(t=>t(e))}function eo(e){return[io,To,lo,Io,no,ao,oo,mo,Co,bo,Po,vo,Lo,Fo,Ro,_o,$o,jo].some(t=>t(e))}function to(e){return[Oo,no,ao,co,Eo,fo,vo,go,xo,Fo,Mo].some(t=>t(e))}function ro(e,t){let r=(e.body||e.properties).find(({type:e})=>"EmptyStatement"!==e);r?Va(r,t):Ha(e,t)}function so(e,t){"BlockStatement"===e.type?ro(e,t):Va(e,t)}function io({comment:e,followingNode:t}){return!(!t||!Ya(e))&&(Va(t,e),!0)}function no({comment:e,precedingNode:t,enclosingNode:r,followingNode:s,text:i}){if("IfStatement"!==(null==r?void 0:r.type)||!s)return!1;if(")"===Ka(i,si(e)))return Wa(t,e),!0;if(t===r.consequent&&s===r.alternate){let s=za(i,si(r.consequent));if(ri(e)"===r.slice(s,s+2)&&(Ha(t,e),!0)}function Eo({comment:e,enclosingNode:t,text:r}){return")"===Ka(r,si(e))&&(t&&(qo(t)&&0===dn(t).length||bn(t)&&0===yn(t).length)?(Ha(t,e),!0):("MethodDefinition"===(null==t?void 0:t.type)||"TSAbstractMethodDefinition"===(null==t?void 0:t.type))&&0===dn(t.value).length&&(Ha(t.value,e),!0))}function Ao({comment:e,precedingNode:t,enclosingNode:r,followingNode:s,text:i}){return"ComponentTypeParameter"!==(null==t?void 0:t.type)||"DeclareComponent"!==(null==r?void 0:r.type)&&"ComponentTypeAnnotation"!==(null==r?void 0:r.type)||"ComponentTypeParameter"===(null==s?void 0:s.type)?("ComponentParameter"===(null==t?void 0:t.type)||"RestElement"===(null==t?void 0:t.type))&&"ComponentDeclaration"===(null==r?void 0:r.type)&&")"===Ka(i,si(e))&&(Wa(t,e),!0):(Wa(t,e),!0)}function To({comment:e,precedingNode:t,enclosingNode:r,followingNode:s,text:i}){return"FunctionTypeParam"===(null==t?void 0:t.type)&&"FunctionTypeAnnotation"===(null==r?void 0:r.type)&&"FunctionTypeParam"!==(null==s?void 0:s.type)?(Wa(t,e),!0):"Identifier"!==(null==t?void 0:t.type)&&"AssignmentPattern"!==(null==t?void 0:t.type)&&"ObjectPattern"!==(null==t?void 0:t.type)&&"ArrayPattern"!==(null==t?void 0:t.type)&&"RestElement"!==(null==t?void 0:t.type)&&"TSParameterProperty"!==(null==t?void 0:t.type)||!qo(r)||")"!==Ka(i,si(e))?!(hi(e)||"FunctionDeclaration"!==(null==r?void 0:r.type)&&"FunctionExpression"!==(null==r?void 0:r.type)&&"ObjectMethod"!==(null==r?void 0:r.type)||"BlockStatement"!==(null==s?void 0:s.type)||r.body!==s||za(i,si(e))!==ri(s))&&(ro(s,e),!0):(Wa(t,e),!0)}function Co({comment:e,enclosingNode:t}){return"LabeledStatement"===(null==t?void 0:t.type)&&(Va(t,e),!0)}function Fo({comment:e,enclosingNode:t}){return!("ContinueStatement"!==(null==t?void 0:t.type)&&"BreakStatement"!==(null==t?void 0:t.type)||t.label)&&(Wa(t,e),!0)}function bo({comment:e,precedingNode:t,enclosingNode:r}){return!!(Ji(r)&&t&&r.callee===t&&r.arguments.length>0)&&(Va(r.arguments[0],e),!0)}function So({comment:e,precedingNode:t,enclosingNode:r,followingNode:s}){return vn(r)?(xn(e)&&(s.prettierIgnore=!0,e.unignore=!0),!!t&&(Wa(t,e),!0)):(vn(s)&&xn(e)&&(s.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function Po({comment:e,enclosingNode:t}){return!!Sn(t)&&(Va(t,e),!0)}function vo({comment:e,enclosingNode:t,ast:r,isLastComment:s}){var i;return 0===(null==(i=null==r?void 0:r.body)?void 0:i.length)?(s?Ha(r,e):Va(r,e),!0):"Program"===(null==t?void 0:t.type)&&0===t.body.length&&!Ks(t.directives)&&(s?Ha(t,e):Va(t,e),!0)}function wo({comment:e,enclosingNode:t}){return("ForInStatement"===(null==t?void 0:t.type)||"ForOfStatement"===(null==t?void 0:t.type))&&(Va(t,e),!0)}function Io({comment:e,precedingNode:t,enclosingNode:r,text:s}){if("ImportSpecifier"===(null==r?void 0:r.type)||"ExportSpecifier"===(null==r?void 0:r.type))return Va(r,e),!0;let i="ImportSpecifier"===(null==t?void 0:t.type)&&"ImportDeclaration"===(null==r?void 0:r.type),n="ExportSpecifier"===(null==t?void 0:t.type)&&"ExportNamedDeclaration"===(null==r?void 0:r.type);return!(!i&&!n||!Vs(s,si(e)))&&(Wa(t,e),!0)}function ko({comment:e,enclosingNode:t}){return"AssignmentPattern"===(null==t?void 0:t.type)&&(Va(t,e),!0)}var No=new Set(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),Bo=new Set(["ObjectExpression","ArrayExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function Lo({comment:e,enclosingNode:t,followingNode:r}){return!(!No.has(null==t?void 0:t.type)||!r||!Bo.has(r.type)&&!hi(e))&&(Va(r,e),!0)}function Mo({comment:e,enclosingNode:t,followingNode:r,text:s}){return!(r||"TSMethodSignature"!==(null==t?void 0:t.type)&&"TSDeclareFunction"!==(null==t?void 0:t.type)&&"TSAbstractMethodDefinition"!==(null==t?void 0:t.type)||";"!==Ka(s,si(e)))&&(Wa(t,e),!0)}function Oo({comment:e,enclosingNode:t,followingNode:r}){if(xn(e)&&"TSMappedType"===(null==t?void 0:t.type)&&r===t.key)return t.prettierIgnore=!0,e.unignore=!0,!0}function jo({comment:e,precedingNode:t,enclosingNode:r}){if("TSMappedType"===(null==r?void 0:r.type)&&!t)return Ha(r,e),!0}function Ro({comment:e,enclosingNode:t,followingNode:r}){return!(!t||"SwitchCase"!==t.type||t.test||!r||r!==t.consequent[0])&&("BlockStatement"===r.type&&mi(e)?ro(r,e):Ha(t,e),!0)}function _o({comment:e,precedingNode:t,enclosingNode:r,followingNode:s}){return!(!vn(t)||("TSArrayType"!==r.type&&"ArrayTypeAnnotation"!==r.type||s)&&!wn(r))&&(Wa(Ns(!1,t.types,-1),e),!0)}function Uo({comment:e,enclosingNode:t,precedingNode:r,followingNode:s}){if(("ObjectPattern"===(null==t?void 0:t.type)||"ArrayPattern"===(null==t?void 0:t.type))&&"TSTypeAnnotation"===(null==s?void 0:s.type))return r?Wa(r,e):Ha(t,e),!0}function $o({comment:e,precedingNode:t,enclosingNode:r,followingNode:s,text:i}){return!(s||"UnaryExpression"!==(null==r?void 0:r.type)||"LogicalExpression"!==(null==t?void 0:t.type)&&"BinaryExpression"!==(null==t?void 0:t.type)||!Xa(i,ri(r.argument),ri(t.right))||!Qa(e,i)||Xa(i,ri(t.right),ri(e)))&&(Wa(t.right,e),!0)}var qo=li(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod"]),Jo=new Set(["EmptyStatement","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]);function Vo(e){return!Jo.has(e.type)}function Ho(e,t){var r;if(("typescript"===t.parser||"flow"===t.parser||"hermes"===t.parser||"acorn"===t.parser||"oxc"===t.parser||"oxc-ts"===t.parser||"espree"===t.parser||"meriyah"===t.parser||"__babel_estree"===t.parser)&&"MethodDefinition"===e.type&&"FunctionExpression"===(null==(r=e.value)?void 0:r.type)&&0===dn(e.value).length&&!e.value.returnType&&!Ks(e.value.typeParameters)&&e.value.body)return[...e.decorators||[],e.key,e.value.body]}function Wo(e){let{node:t,parent:r}=e;return(Bi(t)||r&&("JSXSpreadAttribute"===r.type||"JSXSpreadChild"===r.type||vn(r)||("ClassDeclaration"===r.type||"ClassExpression"===r.type)&&r.superClass===t))&&(!gn(t)||vn(r))}function zo(e,{parser:t}){if("flow"===t||"hermes"===t||"babel-flow"===t)return""===(e=ks(!1,e,/[\s(]/gu,""))||"/*"===e||"/*::"===e}var Ko=Symbol("MODE_BREAK"),Xo=Symbol("MODE_FLAT"),Go=Symbol("cursor"),Yo=Symbol("DOC_FILL_PRINTED_LENGTH");function Qo(e,t){return eu(e,{type:"indent"},t)}function Zo(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?eu(e,{type:"dedent"},r):t?"root"===t.type?{...e,root:e}:eu(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},r):e}function eu(e,t,r){let s="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",n=0,a=0,o=0;for(let e of s)switch(e.type){case"indent":l(),r.useTabs?u(1):p(r.tabWidth);break;case"stringAlign":l(),i+=e.n,n+=e.n.length;break;case"numberAlign":a+=1,o+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return c(),{...e,value:i,length:n,queue:s};function u(e){i+="\t".repeat(e),n+=r.tabWidth*e}function p(e){i+=" ".repeat(e),n+=e}function l(){r.useTabs?(a>0&&u(a),h()):c()}function c(){o>0&&p(o),h()}function h(){a=0,o=0}}function tu(e){let t=0,r=0,s=e.length;e:for(;s--;){let i=e[s];if(i!==Go)for(let r=i.length-1;r>=0;r--){let n=i[r];if(" "!==n&&"\t"!==n){e[s]=i.slice(0,r+1);break e}t++}else r++}if(t>0||r>0)for(e.length=s+1;r-- >0;)e.push(Go);return t}function ru(e,t,r,s,i,n){if(r===Number.POSITIVE_INFINITY)return!0;let a=t.length,o=[e],u=[];for(;r>=0;){if(0===o.length){if(0===a)return!0;o.push(t[--a]);continue}let{mode:e,doc:p}=o.pop(),l=Yn(p);switch(l){case Mn:u.push(p),r-=Rs(p);break;case On:case qn:{let t=l===On?p:p.parts,r=p[Yo]??0;for(let s=t.length-1;s>=r;s--)o.push({mode:e,doc:t[s]});break}case Rn:case _n:case Vn:case Kn:o.push({mode:e,doc:p.contents});break;case Un:r+=tu(u);break;case $n:{if(n&&p.break)return!1;let t=p.break?Ko:e,r=p.expandedStates&&t===Ko?Ns(!1,p.expandedStates,-1):p.contents;o.push({mode:t,doc:r});break}case Jn:{let t=(p.groupId?i[p.groupId]||Xo:e)===Ko?p.breakContents:p.flatContents;t&&o.push({mode:e,doc:t});break}case zn:if(e===Ko||p.hard)return!0;p.soft||(u.push(" "),r--);break;case Hn:s=!0;break;case Wn:if(s)return!1}}return!1}function su(e,t){let r={},s=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine),n=0,a=[{ind:{value:"",length:0,queue:[]},mode:Ko,doc:e}],o=[],u=!1,p=[],l=0;for(function(e){let t=new Set,r=[];ra(e,function(e){if(e.type===Xn&&oa(r),e.type===$n){if(r.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===$n&&r.pop().break&&oa(r)},!0)}(e);a.length>0;){let{ind:e,mode:c,doc:h}=a.pop();switch(Yn(h)){case Mn:{let e="\n"!==i?ks(!1,h,"\n",i):h;o.push(e),a.length>0&&(n+=Rs(e));break}case On:for(let t=h.length-1;t>=0;t--)a.push({ind:e,mode:c,doc:h[t]});break;case jn:if(l>=2)throw new Error("There are too many 'cursor' in doc.");o.push(Go),l++;break;case Rn:a.push({ind:Qo(e,t),mode:c,doc:h.contents});break;case _n:a.push({ind:Zo(e,h.n,t),mode:c,doc:h.contents});break;case Un:n-=tu(o);break;case $n:switch(c){case Xo:if(!u){a.push({ind:e,mode:h.break?Ko:Xo,doc:h.contents});break}case Ko:{u=!1;let t={ind:e,mode:Xo,doc:h.contents},i=s-n,o=p.length>0;if(!h.break&&ru(t,a,i,o,r))a.push(t);else if(h.expandedStates){let t=Ns(!1,h.expandedStates,-1);if(h.break){a.push({ind:e,mode:Ko,doc:t});break}for(let s=1;s=h.expandedStates.length){a.push({ind:e,mode:Ko,doc:t});break}{let t=h.expandedStates[s],n={ind:e,mode:Xo,doc:t};if(ru(n,a,i,o,r)){a.push(n);break}}}}else a.push({ind:e,mode:Ko,doc:h.contents});break}}h.id&&(r[h.id]=Ns(!1,a,-1).mode);break;case qn:{let t=s-n,i=h[Yo]??0,{parts:o}=h,u=o.length-i;if(0===u)break;let l=o[i+0],d=o[i+1],m={ind:e,mode:Xo,doc:l},y={ind:e,mode:Ko,doc:l},f=ru(m,[],t,p.length>0,r,!0);if(1===u){f?a.push(m):a.push(y);break}let D={ind:e,mode:Xo,doc:d},x={ind:e,mode:Ko,doc:d};if(2===u){f?a.push(D,m):a.push(x,y);break}let g=o[i+2],E={ind:e,mode:c,doc:{...h,[Yo]:i+2}};ru({ind:e,mode:Xo,doc:[l,d,g]},[],t,p.length>0,r,!0)?a.push(E,D,m):f?a.push(E,x,m):a.push(E,x,y);break}case Jn:case Vn:{let t=h.groupId?r[h.groupId]:c;if(t===Ko){let t=h.type===Jn?h.breakContents:h.negate?h.contents:ga(h.contents);t&&a.push({ind:e,mode:c,doc:t})}if(t===Xo){let t=h.type===Jn?h.flatContents:h.negate?ga(h.contents):h.contents;t&&a.push({ind:e,mode:c,doc:t})}break}case Hn:p.push({ind:e,mode:c,doc:h.contents});break;case Wn:p.length>0&&a.push({ind:e,mode:c,doc:ka});break;case zn:switch(c){case Xo:if(!h.hard){h.soft||(o.push(" "),n+=1);break}u=!0;case Ko:if(p.length>0){a.push({ind:e,mode:c,doc:h},...p.reverse()),p.length=0;break}h.literal?e.root?(o.push(i,e.root.value),n=e.root.length):(o.push(i),n=0):(n-=tu(o),o.push(i+e.value),n=e.length)}break;case Kn:a.push({ind:e,mode:c,doc:h.contents});break;case Xn:break;default:throw new ea(h)}0===a.length&&p.length>0&&(a.push(...p.reverse()),p.length=0)}let c=o.indexOf(Go);if(-1!==c){let e=o.indexOf(Go,c+1);if(-1===e)return{formatted:o.filter(e=>e!==Go).join("")};let t=o.slice(0,c).join(""),r=o.slice(c+1,e).join("");return{formatted:t+r+o.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:r}}return{formatted:o.join("")}}var iu=function(e,t,r=0){let s=0;for(let i=r;i1||i.some(e=>e.length>0)){t.__inJestEach=!0;let n=e.map(r,"expressions");t.__inJestEach=!1;let a=[],o=n.map(e=>"${"+su(e,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),u=[{hasLineBreak:!1,cells:[]}];for(let e=1;ee.cells.length)),l=Array.from({length:p}).fill(0),c=[{cells:i},...u.filter(e=>e.cells.length>0)];for(let{cells:e}of c.filter(e=>!e.hasLineBreak))for(let[t,r]of e.entries())l[t]=Math.max(l[t],Rs(r));return a.push(wa,"`",ga([La,ja(La,c.map(e=>ja(" | ",e.cells.map((t,r)=>e.hasLineBreak?t:t+" ".repeat(l[r]-Rs(t))))))]),La,"`"),a}}(e,t,r);if(s)return s}let i="expressions";"TSTemplateLiteralType"===s.type&&(i="types");let n=[],a=e.map(r,i);n.push(wa,"`");let o=0;return e.each(({index:e,node:u})=>{if(n.push(r()),u.tail)return;let{tabWidth:p}=t,l=u.value.raw,c=l.includes("\n")?nu(l,p):o;o=c;let h=a[e],d=s[i][e],m=Xa(t.originalText,si(u),ri(s.quasis[e+1]));if(!m){let e=su(h,{...t,printWidth:Number.POSITIVE_INFINITY}).formatted;e.includes("\n")?m=!0:h=e}m&&(Tn(d)||"Identifier"===d.type||Vi(d)||"ConditionalExpression"===d.type||"SequenceExpression"===d.type||Pn(d)||Oi(d))&&(h=[ga([Ba,h]),Ba]);let y=0===c&&l.endsWith("\n")?Ea(Number.NEGATIVE_INFINITY,h):function(e,t,r){fa(e);let s=e;if(t>0){for(let e=0;efunction(e,t){let{node:r}=e,s=t();return Tn(r)&&(s=Aa([ga([Ba,s]),Ba])),["${",s,wa,"}"]}(e,t),"expressions")}function uu(e,t){return sa(e,e=>"string"==typeof e?t?ks(!1,e,/(\\*)`/gu,"$1$1\\`"):pu(e):e)}function pu(e){return ks(!1,e,/([\\`]|\$\{)/gu,String.raw`\$1`)}var lu=[(e,t)=>"ObjectExpression"===e.type&&"properties"===t,(e,t)=>"CallExpression"===e.type&&"Identifier"===e.callee.type&&"Component"===e.callee.name&&"arguments"===t,(e,t)=>"Decorator"===e.type&&"expression"===t];function cu(e,t){return Tn(e,En.Block|En.Leading,({value:e})=>e===` ${t} `)}function hu({node:e,parent:t},r){return cu(e,r)||function(e){return"AsConstExpression"===e.type||"TSAsExpression"===e.type&&"TSTypeReference"===e.typeAnnotation.type&&"Identifier"===e.typeAnnotation.typeName.type&&"const"===e.typeAnnotation.typeName.name}(t)&&cu(t,r)||"ExpressionStatement"===t.type&&cu(t,r)}async function du(e,t,r){let{node:s}=r,i=s.quasis.map(e=>e.value.raw),n=0,a=i.reduce((e,t,r)=>0===r?t:e+"@prettier-placeholder-"+n+++"-id"+t,""),o=function(e,t){if(!Ks(t))return e;let r=0,s=sa(la(e),e=>"string"==typeof e&&e.includes("@prettier-placeholder")?e.split(/@prettier-placeholder-(\d+)-id/u).map((e,s)=>s%2==0?ca(e):(r++,t[e])):e);return t.length===r?s:null}(await e(a,{parser:"scss"}),ou(r,t));if(!o)throw new Error("Couldn't insert all the expressions");return["`",ga([La,o]),Ba,"`"]}function mu(e){return"Identifier"===e.type&&"styled"===e.name}function yu(e){return/^[A-Z]/u.test(e.object.name)&&"extend"===e.property.name}var fu=function(e){if(function({node:e,parent:t,grandparent:r}){return r&&e.quasis&&"JSXExpressionContainer"===t.type&&"JSXElement"===r.type&&"style"===r.openingElement.name.name&&r.openingElement.attributes.some(e=>"JSXAttribute"===e.type&&"jsx"===e.name.name)||"TaggedTemplateExpression"===(null==t?void 0:t.type)&&"Identifier"===t.tag.type&&"css"===t.tag.name||"TaggedTemplateExpression"===(null==t?void 0:t.type)&&"MemberExpression"===t.tag.type&&"css"===t.tag.object.name&&("global"===t.tag.property.name||"resolve"===t.tag.property.name)}(e)||function({parent:e}){if(!e||"TaggedTemplateExpression"!==e.type)return!1;let t="ParenthesizedExpression"===e.tag.type?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return mu(t.object)||yu(t);case"CallExpression":return mu(t.callee)||"MemberExpression"===t.callee.type&&("MemberExpression"===t.callee.object.type&&(mu(t.callee.object.object)||yu(t.callee.object))||"CallExpression"===t.callee.object.type&&mu(t.callee.object.callee));case"Identifier":return"css"===t.name;default:return!1}}(e)||function({parent:e,grandparent:t}){return"JSXAttribute"===(null==t?void 0:t.type)&&"JSXExpressionContainer"===e.type&&"JSXIdentifier"===t.name.type&&"css"===t.name.name}(e)||function(e){let t=e=>"TemplateLiteral"===e.type,r=(e,t)=>Sn(e)&&!e.computed&&"Identifier"===e.key.type&&"styles"===e.key.name&&"value"===t;return e.match(t,(e,t)=>Ti(e)&&"elements"===t,r,...lu)||e.match(t,r,...lu)}(e))return du};async function Du(e,t,r){let{node:s}=r,i=s.quasis.length,n=ou(r,t),a=[];for(let t=0;t2&&""===p[0].trim()&&""===p[1].trim(),d=l>2&&""===p[l-1].trim()&&""===p[l-2].trim(),m=p.every(e=>/^\s*(?:#[^\n\r]*)?$/u.test(e));if(!o&&/#[^\n\r]*$/u.test(p[l-1]))return null;let y=null;y=m?xu(p):await e(u,{parser:"graphql"}),y?(y=uu(y,!1),!r&&h&&a.push(""),a.push(y),!o&&d&&a.push("")):!r&&!o&&h&&a.push(""),c&&a.push(c)}return["`",ga([La,ja(La,a)]),La,"`"]}function xu(e){let t=[],r=!1,s=e.map(e=>e.trim());for(let[e,i]of s.entries())""!==i&&(""===s[e-1]&&r?t.push([La,i]):t.push(i),r=!0);return 0===t.length?null:ja(La,t)}var gu=function(e){if(function({node:e,parent:t}){return hu({node:e,parent:t},"GraphQL")||t&&("TaggedTemplateExpression"===t.type&&("MemberExpression"===t.tag.type&&"graphql"===t.tag.object.name&&"experimental"===t.tag.property.name||"Identifier"===t.tag.type&&("gql"===t.tag.name||"graphql"===t.tag.name))||"CallExpression"===t.type&&"Identifier"===t.callee.type&&"graphql"===t.callee.name)}(e))return Du},Eu=0;async function Au(e,t,r,s,i){let{node:n}=s,a=Eu;Eu=Eu+1>>>0;let o=e=>`PRETTIER_HTML_PLACEHOLDER_${e}_${a}_IN_JS`,u=n.quasis.map((e,t,r)=>t===r.length-1?e.value.cooked:e.value.cooked+o(t)).join(""),p=ou(s,r),l=new RegExp(o(String.raw`(\d+)`),"gu"),c=0,h=await t(u,{parser:e,__onHtmlRoot(e){c=e.children.length}}),d=sa(h,e=>{if("string"!=typeof e)return e;let t=[],r=e.split(l);for(let e=0;e1?ga(Aa(d)):Aa(d),y,"`"]))}var Tu=Au.bind(void 0,"html"),Cu=Au.bind(void 0,"angular");var Fu=function(e){return function(e){return hu(e,"HTML")||e.match(e=>"TemplateLiteral"===e.type,(e,t)=>"TaggedTemplateExpression"===e.type&&"Identifier"===e.tag.type&&"html"===e.tag.name&&"quasi"===t)}(e)?Tu:function(e){return e.match(e=>"TemplateLiteral"===e.type,(e,t)=>Sn(e)&&!e.computed&&"Identifier"===e.key.type&&"template"===e.key.name&&"value"===t,...lu)}(e)?Cu:void 0};async function bu(e,t,r){let{node:s}=r,i=ks(!1,s.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(e,t)=>"\\".repeat(t.length/2)+"`"),n=function(e){let t=e.match(/^([^\S\n]*)\S/mu);return null===t?"":t[1]}(i),a=""!==n;a&&(i=ks(!1,i,new RegExp(`^${n}`,"gmu"),""));let o=uu(await e(i,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",a?ga([Ba,o]):[Ma,Ta(o)],Ba,"`"]}var Su=function(e){if(function({node:e,parent:t}){return"TaggedTemplateExpression"===(null==t?void 0:t.type)&&1===e.quasis.length&&"Identifier"===t.tag.type&&("md"===t.tag.name||"markdown"===t.tag.name)}(e))return bu};var Pu=function(e){let t,{node:r}=e;if("TemplateLiteral"===r.type&&!function({quasis:e}){return e.some(({value:{cooked:e}})=>null===e)}(r))for(let s of[fu,gu,Fu,Su])if(t=s(e),t)return 1===r.quasis.length&&""===r.quasis[0].value.raw.trim()?"``":async(...e)=>{let r=await t(...e);return r&&Ra({embed:!0,...r.label},r)}},vu=/\*\/$/,wu=/^\/\*\*?/,Iu=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,ku=/(^|\s+)\/\/([^\n\r]*)/g,Nu=/^(\r?\n)+/,Bu=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Lu=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,Mu=/(\r?\n|^) *\* ?/g,Ou=[];function ju(e,t){return[...Ou,...Array.isArray(t)?t:[t]].map(t=>`@${e} ${t}`.trim())}var Ru="format";var _u=function(e){if(!e.startsWith("#!"))return"";let t=e.indexOf("\n");return-1===t?e:e.slice(0,t)};function Uu(e){let t=_u(e);t&&(e=e.slice(t.length+1));let r=function(e){let t=e.match(Iu);return t?t[0].trimStart():""}(e),{pragmas:s,comments:i}=function(e){e=ks(!1,e.replace(wu,"").replace(vu,""),Mu,"$1");let t="";for(;t!==e;)t=e,e=ks(!1,e,Bu,"\n$1 $2\n");e=e.replace(Nu,"").trimEnd();let r,s=Object.create(null),i=ks(!1,e,Lu,"").replace(Nu,"").trimEnd();for(;r=Lu.exec(e);){let e=ks(!1,r[2],ku,"");if("string"==typeof s[r[1]]||Array.isArray(s[r[1]])){let t=s[r[1]];s[r[1]]=[...Ou,...Array.isArray(t)?t:[t],e]}else s[r[1]]=e}return{comments:i,pragmas:s}}(r);return{shebang:t,text:e,pragmas:s,comments:i}}function $u(e){let{shebang:t,text:r,pragmas:s,comments:i}=Uu(e),n=function(e){let t=e.match(Iu),r=null==t?void 0:t[0];return null==r?e:e.slice(r.length)}(r),a=function({comments:e="",pragmas:t={}}){let r="\n",s=" *",i=Object.keys(t),n=i.flatMap(e=>ju(e,t[e])).map(e=>`${s} ${e}${r}`).join("");if(!e){if(0===i.length)return"";if(1===i.length&&!Array.isArray(t[i[0]])){let e=t[i[0]];return`/** ${ju(i[0],e)[0]} */`}}let a=e.split(r).map(e=>`${s} ${e}`).join(r)+r;return"/**\n"+(e?a:"")+(e&&i.length>0?s+r:"")+n+" */"}({pragmas:{[Ru]:"",...s},comments:i.trimStart()});return(t?`${t}\n`:"")+a+(n.startsWith("\n")?"\n":"\n\n")+n}var qu=function(e,t){let{originalText:r,[Symbol.for("comments")]:s,locStart:i,locEnd:n,[Symbol.for("printedComments")]:a}=t,{node:o}=e,u=i(o),p=n(o);for(let e of s)i(e)>=u&&n(e)<=p&&a.add(e);return r.slice(u,p)};function Ju(e,t){var r,s,i,n,a,o,u,p,l;if(e.isRoot)return!1;let{node:c,key:h,parent:d}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&function(e){return Ci(e)}(c)&&Hu(e))return!0;if(Vu(c))return!1;if("Identifier"===c.type){if(null!=(r=c.extra)&&r.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(c.name)||"left"===h&&("async"===c.name&&!d.await||"let"===c.name)&&"ForOfStatement"===d.type)return!0;if("let"===c.name){let t=null==(s=e.findAncestor(e=>"ForOfStatement"===e.type))?void 0:s.left;if(t&&sn(t,e=>e===c))return!0}if("object"===h&&"let"===c.name&&"MemberExpression"===d.type&&d.computed&&!d.optional){let t=e.findAncestor(e=>"ExpressionStatement"===e.type||"ForStatement"===e.type||"ForInStatement"===e.type),r=t?"ExpressionStatement"===t.type?t.expression:"ForStatement"===t.type?t.init:t.left:void 0;if(r&&sn(r,e=>e===c))return!0}if("expression"===h)switch(c.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let t=e.findAncestor(e=>!Pn(e));if(t!==d&&"ExpressionStatement"===t.type)return!0}}return!1}if("ObjectExpression"===c.type||"FunctionExpression"===c.type||"ClassExpression"===c.type||"DoExpression"===c.type){let t=null==(i=e.findAncestor(e=>"ExpressionStatement"===e.type))?void 0:i.expression;if(t&&sn(t,e=>e===c))return!0}if("ObjectExpression"===c.type){let t=null==(n=e.findAncestor(e=>"ArrowFunctionExpression"===e.type))?void 0:n.body;if(t&&"SequenceExpression"!==t.type&&"AssignmentExpression"!==t.type&&sn(t,e=>e===c))return!0}switch(d.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if("superClass"===h&&("ArrowFunctionExpression"===c.type||"AssignmentExpression"===c.type||"AwaitExpression"===c.type||"BinaryExpression"===c.type||"ConditionalExpression"===c.type||"LogicalExpression"===c.type||"NewExpression"===c.type||"ObjectExpression"===c.type||"SequenceExpression"===c.type||"TaggedTemplateExpression"===c.type||"UnaryExpression"===c.type||"UpdateExpression"===c.type||"YieldExpression"===c.type||"TSNonNullExpression"===c.type||"ClassExpression"===c.type&&Ks(c.decorators)))return!0;break;case"ExportDefaultDeclaration":return Wu(e,t)||"SequenceExpression"===c.type;case"Decorator":if("expression"===h&&!function(e){return"ChainExpression"===e.type&&(e=e.expression),zu(e)||Ji(e)&&!e.optional&&zu(e.callee)}(c))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(e,t)=>"returnType"===t&&"ArrowFunctionExpression"===e.type)&&function(e){return Di(e,e=>"ObjectTypeAnnotation"===e.type&&Di(e,e=>"FunctionTypeAnnotation"===e.type))}(c))return!0;break;case"BinaryExpression":if("left"===h&&("in"===d.operator||"instanceof"===d.operator)&&"UnaryExpression"===c.type)return!0;break;case"VariableDeclarator":if("init"===h&&e.match(void 0,void 0,(e,t)=>"declarations"===t&&"VariableDeclaration"===e.type,(e,t)=>"left"===t&&"ForInStatement"===e.type))return!0}switch(c.type){case"UpdateExpression":if("UnaryExpression"===d.type)return c.prefix&&("++"===c.operator&&"+"===d.operator||"--"===c.operator&&"-"===d.operator);case"UnaryExpression":switch(d.type){case"UnaryExpression":return c.operator===d.operator&&("+"===c.operator||"-"===c.operator);case"BindExpression":case"TaggedTemplateExpression":case"TSNonNullExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return"object"===h;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return"callee"===h;case"BinaryExpression":return"left"===h&&"**"===d.operator;default:return!1}case"BinaryExpression":if("UpdateExpression"===d.type||"in"===c.operator&&function(e){let t=0,{node:r}=e;for(;r;){let s=e.getParentNode(t++);if("ForStatement"===(null==s?void 0:s.type)&&s.init===r)return!0;r=s}return!1}(e))return!0;if("|>"===c.operator&&null!=(a=c.extra)&&a.parenthesized){let t=e.grandparent;if("BinaryExpression"===t.type&&"|>"===t.operator)return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(d.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!Pn(c);case"ConditionalExpression":return Pn(c)||function(e){return"LogicalExpression"===e.type&&"??"===e.operator}(c);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return"callee"===h;case"ClassExpression":case"ClassDeclaration":return"superClass"===h;case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return"object"===h;case"AssignmentExpression":case"AssignmentPattern":return"left"===h&&("TSTypeAssertion"===c.type||Pn(c));case"LogicalExpression":if("LogicalExpression"===c.type)return d.operator!==c.operator;case"BinaryExpression":{let{operator:e,type:t}=c;if(!e&&"TSTypeAssertion"!==t)return!0;let r=ln(e),s=d.operator,i=ln(s);return i>r||"right"===h&&i===r||i===r&&!un(s,e)||(i"===d.operator);default:return!1}case"TSFunctionType":if(e.match(e=>"TSFunctionType"===e.type,(e,t)=>"typeAnnotation"===t&&"TSTypeAnnotation"===e.type,(e,t)=>"returnType"===t&&"ArrowFunctionExpression"===e.type))return!0;case"TSConditionalType":case"TSConstructorType":case"ConditionalTypeAnnotation":if("extendsType"===h&&In(c)&&d.type===c.type||"checkType"===h&&In(d))return!0;if("extendsType"===h&&"TSConditionalType"===d.type){let{typeAnnotation:e}=c.returnType||c.typeAnnotation;if("TSTypePredicate"===e.type&&e.typeAnnotation&&(e=e.typeAnnotation.typeAnnotation),"TSInferType"===e.type&&e.typeParameter.constraint)return!0}case"TSUnionType":case"TSIntersectionType":if((vn(d)||wn(d))&&d.types.length>1&&(!c.types||c.types.length>1))return!0;case"TSInferType":if("TSInferType"===c.type){if("TSRestType"===d.type)return!1;if("types"===h&&("TSUnionType"===d.type||"TSIntersectionType"===d.type)&&"TSTypeParameter"===c.typeParameter.type&&c.typeParameter.constraint)return!0}case"TSTypeOperator":return"TSArrayType"===d.type||"TSOptionalType"===d.type||"TSRestType"===d.type||"objectType"===h&&"TSIndexedAccessType"===d.type||"TSTypeOperator"===d.type||"TSTypeAnnotation"===d.type&&e.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return"objectType"===h&&"TSIndexedAccessType"===d.type||"elementType"===h&&"TSArrayType"===d.type;case"TypeOperator":return"ArrayTypeAnnotation"===d.type||"NullableTypeAnnotation"===d.type||"objectType"===h&&("IndexedAccessType"===d.type||"OptionalIndexedAccessType"===d.type)||"TypeOperator"===d.type;case"TypeofTypeAnnotation":return"objectType"===h&&("IndexedAccessType"===d.type||"OptionalIndexedAccessType"===d.type)||"elementType"===h&&"ArrayTypeAnnotation"===d.type;case"ArrayTypeAnnotation":return"NullableTypeAnnotation"===d.type;case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return"TypeOperator"===d.type||"ArrayTypeAnnotation"===d.type||"NullableTypeAnnotation"===d.type||"IntersectionTypeAnnotation"===d.type||"UnionTypeAnnotation"===d.type||"objectType"===h&&("IndexedAccessType"===d.type||"OptionalIndexedAccessType"===d.type);case"InferTypeAnnotation":case"NullableTypeAnnotation":return"ArrayTypeAnnotation"===d.type||"objectType"===h&&("IndexedAccessType"===d.type||"OptionalIndexedAccessType"===d.type);case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if("ComponentTypeAnnotation"===c.type&&(null===c.rendersType||void 0===c.rendersType))return!1;if(e.match(void 0,(e,t)=>"typeAnnotation"===t&&"TypeAnnotation"===e.type,(e,t)=>"returnType"===t&&"ArrowFunctionExpression"===e.type)||e.match(void 0,(e,t)=>"typeAnnotation"===t&&"TypePredicate"===e.type,(e,t)=>"typeAnnotation"===t&&"TypeAnnotation"===e.type,(e,t)=>"returnType"===t&&"ArrowFunctionExpression"===e.type))return!0;let t="NullableTypeAnnotation"===d.type?e.grandparent:d;return"UnionTypeAnnotation"===t.type||"IntersectionTypeAnnotation"===t.type||"ArrayTypeAnnotation"===t.type||"objectType"===h&&("IndexedAccessType"===t.type||"OptionalIndexedAccessType"===t.type)||"checkType"===h&&"ConditionalTypeAnnotation"===d.type||"extendsType"===h&&"ConditionalTypeAnnotation"===d.type&&"InferTypeAnnotation"===(null==(o=c.returnType)?void 0:o.type)&&(null==(u=c.returnType)?void 0:u.typeParameter.bound)||"NullableTypeAnnotation"===t.type||"FunctionTypeParam"===d.type&&null===d.name&&dn(c).some(e=>{var t;return"NullableTypeAnnotation"===(null==(t=e.typeAnnotation)?void 0:t.type)})}case"OptionalIndexedAccessType":return"objectType"===h&&"IndexedAccessType"===d.type;case"StringLiteral":case"NumericLiteral":case"Literal":if("string"==typeof c.value&&"ExpressionStatement"===d.type&&"string"!=typeof d.directive){let t=e.grandparent;return"Program"===t.type||"BlockStatement"===t.type}return"object"===h&&Vi(d)&&Fi(c);case"AssignmentExpression":return!(("init"===h||"update"===h)&&"ForStatement"===d.type||"expression"===h&&"ObjectPattern"!==c.left.type&&"ExpressionStatement"===d.type||"key"===h&&"TSPropertySignature"===d.type||"AssignmentExpression"===d.type||"expressions"===h&&"SequenceExpression"===d.type&&e.match(void 0,void 0,(e,t)=>("init"===t||"update"===t)&&"ForStatement"===e.type)||"value"===h&&"Property"===d.type&&e.match(void 0,void 0,(e,t)=>"properties"===t&&"ObjectPattern"===e.type)||"NGChainedExpression"===d.type||"node"===h&&"JsExpressionRoot"===d.type);case"ConditionalExpression":switch(d.type){case"TaggedTemplateExpression":case"UnaryExpression":case"SpreadElement":case"BinaryExpression":case"LogicalExpression":case"NGPipeExpression":case"ExportDefaultDeclaration":case"AwaitExpression":case"JSXSpreadAttribute":case"TSTypeAssertion":case"TypeCastExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return"callee"===h;case"ConditionalExpression":return!t.experimentalTernaries&&"test"===h;case"MemberExpression":case"OptionalMemberExpression":return"object"===h;default:return!1}case"FunctionExpression":switch(d.type){case"NewExpression":case"CallExpression":case"OptionalCallExpression":return"callee"===h;case"TaggedTemplateExpression":return!0;default:return!1}case"ArrowFunctionExpression":switch(d.type){case"BinaryExpression":return"|>"!==d.operator||(null==(p=c.extra)?void 0:p.parenthesized);case"NewExpression":case"CallExpression":case"OptionalCallExpression":return"callee"===h;case"MemberExpression":case"OptionalMemberExpression":return"object"===h;case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":case"BindExpression":case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"AwaitExpression":case"TSTypeAssertion":return!0;case"ConditionalExpression":return"test"===h;default:return!1}case"ClassExpression":return"NewExpression"===d.type&&"callee"===h;case"OptionalMemberExpression":case"OptionalCallExpression":case"CallExpression":case"MemberExpression":if(function(e){return!!(e.match(void 0,(e,t)=>"expression"===t&&"ChainExpression"===e.type,(e,t)=>"tag"===t&&"TaggedTemplateExpression"===e.type)||e.match(e=>"OptionalCallExpression"===e.type||"OptionalMemberExpression"===e.type,(e,t)=>"tag"===t&&"TaggedTemplateExpression"===e.type)||e.match(e=>"OptionalCallExpression"===e.type||"OptionalMemberExpression"===e.type,(e,t)=>"expression"===t&&"TSNonNullExpression"===e.type,(e,t)=>"tag"===t&&"TaggedTemplateExpression"===e.type)||e.match(void 0,(e,t)=>"expression"===t&&"ChainExpression"===e.type,(e,t)=>"expression"===t&&"TSNonNullExpression"===e.type,(e,t)=>"tag"===t&&"TaggedTemplateExpression"===e.type)||e.match(void 0,(e,t)=>"expression"===t&&"TSNonNullExpression"===e.type,(e,t)=>"expression"===t&&"ChainExpression"===e.type,(e,t)=>"tag"===t&&"TaggedTemplateExpression"===e.type)||e.match(e=>"OptionalMemberExpression"===e.type||"OptionalCallExpression"===e.type,(e,t)=>"object"===t&&"MemberExpression"===e.type||"callee"===t&&("CallExpression"===e.type||"NewExpression"===e.type))||e.match(e=>"OptionalMemberExpression"===e.type||"OptionalCallExpression"===e.type,(e,t)=>"expression"===t&&"TSNonNullExpression"===e.type,(e,t)=>"object"===t&&"MemberExpression"===e.type||"callee"===t&&"CallExpression"===e.type)||e.match(e=>"CallExpression"===e.type||"MemberExpression"===e.type,(e,t)=>"expression"===t&&"ChainExpression"===e.type)&&(e.match(void 0,void 0,(e,t)=>"callee"===t&&("CallExpression"===e.type&&!e.optional||"NewExpression"===e.type)||"object"===t&&"MemberExpression"===e.type&&!e.optional)||e.match(void 0,void 0,(e,t)=>"expression"===t&&"TSNonNullExpression"===e.type,(e,t)=>"object"===t&&"MemberExpression"===e.type||"callee"===t&&"CallExpression"===e.type))||e.match(e=>"CallExpression"===e.type||"MemberExpression"===e.type,(e,t)=>"expression"===t&&"TSNonNullExpression"===e.type,(e,t)=>"expression"===t&&"ChainExpression"===e.type,(e,t)=>"object"===t&&"MemberExpression"===e.type||"callee"===t&&"CallExpression"===e.type))}(e))return!0;case"TaggedTemplateExpression":case"TSNonNullExpression":if("callee"===h&&("BindExpression"===d.type||"NewExpression"===d.type)){let e=c;for(;e;)switch(e.type){case"CallExpression":case"OptionalCallExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":case"BindExpression":e=e.object;break;case"TaggedTemplateExpression":e=e.tag;break;case"TSNonNullExpression":e=e.expression;break;default:return!1}}return!1;case"BindExpression":return"callee"===h&&("BindExpression"===d.type||"NewExpression"===d.type)||"object"===h&&Vi(d);case"NGPipeExpression":return!("NGRoot"===d.type||"NGMicrosyntaxExpression"===d.type||"ObjectProperty"===d.type&&(null==(l=c.extra)||!l.parenthesized)||Ti(d)||"arguments"===h&&Ji(d)||"right"===h&&"NGPipeExpression"===d.type||"property"===h&&"MemberExpression"===d.type||"AssignmentExpression"===d.type);case"JSXFragment":case"JSXElement":return"callee"===h||"left"===h&&"BinaryExpression"===d.type&&"<"===d.operator||!Ti(d)&&"ArrowFunctionExpression"!==d.type&&"AssignmentExpression"!==d.type&&"AssignmentPattern"!==d.type&&"BinaryExpression"!==d.type&&"NewExpression"!==d.type&&"ConditionalExpression"!==d.type&&"ExpressionStatement"!==d.type&&"JsExpressionRoot"!==d.type&&"JSXAttribute"!==d.type&&"JSXElement"!==d.type&&"JSXExpressionContainer"!==d.type&&"JSXFragment"!==d.type&&"LogicalExpression"!==d.type&&!Ji(d)&&!Sn(d)&&"ReturnStatement"!==d.type&&"ThrowStatement"!==d.type&&"TypeCastExpression"!==d.type&&"VariableDeclarator"!==d.type&&"YieldExpression"!==d.type;case"TSInstantiationExpression":return"object"===h&&Vi(d)}return!1}var Vu=li(["BlockStatement","BreakStatement","ComponentDeclaration","ClassBody","ClassDeclaration","ClassMethod","ClassProperty","PropertyDefinition","ClassPrivateProperty","ContinueStatement","DebuggerStatement","DeclareComponent","DeclareClass","DeclareExportAllDeclaration","DeclareExportDeclaration","DeclareFunction","DeclareHook","DeclareInterface","DeclareModule","DeclareModuleExports","DeclareNamespace","DeclareVariable","DeclareEnum","DoWhileStatement","EnumDeclaration","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExpressionStatement","ForInStatement","ForOfStatement","ForStatement","FunctionDeclaration","HookDeclaration","IfStatement","ImportDeclaration","InterfaceDeclaration","LabeledStatement","MethodDefinition","ReturnStatement","SwitchStatement","ThrowStatement","TryStatement","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSNamespaceExportDeclaration","TypeAlias","VariableDeclaration","WhileStatement","WithStatement"]);function Hu(e){let{parent:t,key:r}=e;switch(t.type){case"NGPipeExpression":if("arguments"===r&&e.isLast)return e.callParent(Hu);break;case"ObjectProperty":if("value"===r)return e.callParent(()=>"properties"===e.key&&e.isLast);break;case"BinaryExpression":case"LogicalExpression":if("right"===r)return e.callParent(Hu);break;case"ConditionalExpression":if("alternate"===r)return e.callParent(Hu);break;case"UnaryExpression":if(t.prefix)return e.callParent(Hu)}return!1}function Wu(e,t){let{node:r,parent:s}=e;return"FunctionExpression"===r.type||"ClassExpression"===r.type?"ExportDefaultDeclaration"===s.type||!Ju(e,t):!(!xi(r)||"ExportDefaultDeclaration"!==s.type&&Ju(e,t))&&e.call(()=>Wu(e,t),...Ei(r))}function zu(e){return"Identifier"===e.type||!!Vi(e)&&(!e.computed&&!e.optional&&"Identifier"===e.property.type&&zu(e.object))}var Ku=Ju;var Xu=function(e,t){let r=t-1;return r=Us(e,r,{backwards:!0}),r=Js(e,r,{backwards:!0}),r=Us(e,r,{backwards:!0}),r!==Js(e,r,{backwards:!0})},Gu=()=>!0;function Yu(e,t){return e.node.printed=!0,t.printer.printComment(e,t)}function Qu(e,t,r={}){let{node:s}=e;if(!Ks(null==s?void 0:s.comments))return"";let{indent:i=!1,marker:n,filter:a=Gu}=r,o=[];if(e.each(({node:r})=>{r.leading||r.trailing||r.marker!==n||!a(r)||o.push(Yu(e,t))},"comments"),0===o.length)return"";let u=ja(La,o);return i?ga([La,u]):u}function Zu(e,t){let r=e.node;if(!r)return{};let s=t[Symbol.for("printedComments")];if(0===(r.comments||[]).filter(e=>!s.has(e)).length)return{leading:"",trailing:""};let i,n=[],a=[];return e.each(()=>{let r=e.node;if(null!=s&&s.has(r))return;let{leading:o,trailing:u}=r;o?n.push(function(e,t){var r;let s=e.node,i=[Yu(e,t)],{printer:n,originalText:a,locStart:o,locEnd:u}=t;if(null==(r=n.isBlockComment)?void 0:r.call(n,s)){let e=Vs(a,u(s))?Vs(a,o(s),{backwards:!0})?La:Na:" ";i.push(e)}else i.push(La);let p=Js(a,Us(a,u(s)));return!1!==p&&Vs(a,p)&&i.push(La),i}(e,t)):u&&(i=function(e,t,r){var s;let i=e.node,n=Yu(e,t),{printer:a,originalText:o,locStart:u}=t,p=null==(s=a.isBlockComment)?void 0:s.call(a,i);if(null!=r&&r.hasLineSuffix&&(null==r||!r.isBlock)||Vs(o,u(i),{backwards:!0})){let e=Xu(o,u(i));return{doc:va([La,e?La:"",n]),isBlock:p,hasLineSuffix:!0}}return!p||null!=r&&r.hasLineSuffix?{doc:[va([" ",n]),Ia],isBlock:p,hasLineSuffix:!0}:{doc:[" ",n],isBlock:p,hasLineSuffix:!1}}(e,t,i),a.push(i.doc))},"comments"),{leading:n,trailing:a}}function ep(e,t,r){let{leading:s,trailing:i}=Zu(e,r);return s||i?da(t,e=>[s,e,i]):t}var tp=class extends Error{name="UnexpectedNodeError";constructor(e,t,r="type"){super(`Unexpected ${t} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},rp=tp;var sp;sp=new WeakMap;var ip=class{constructor(e){((e,t,r)=>{t.has(e)?bs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r)})(this,sp),((e,t,r,s)=>{Ps(e,t,"write to private field"),s?s.call(e,r):t.set(e,r)})(this,sp,new Set(e))}getLeadingWhitespaceCount(e){let t=vs(this,sp),r=0;for(let s=0;s=0&&t.has(e.charAt(s));s--)r++;return r}getLeadingWhitespace(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(0,t)}getTrailingWhitespace(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(e.length-t)}hasLeadingWhitespace(e){return vs(this,sp).has(e.charAt(0))}hasTrailingWhitespace(e){return vs(this,sp).has(Ns(!1,e,-1))}trimStart(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(t)}trimEnd(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-t)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,t=!1){let r=`[${function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}([...vs(this,sp)].join(""))}]+`,s=new RegExp(t?`(${r})`:r,"u");return e.split(s)}hasWhitespaceCharacter(e){let t=vs(this,sp);return Array.prototype.some.call(e,e=>t.has(e))}hasNonWhitespaceCharacter(e){let t=vs(this,sp);return Array.prototype.some.call(e,e=>!t.has(e))}isWhitespaceOnly(e){let t=vs(this,sp);return Array.prototype.every.call(e,e=>t.has(e))}},np=new ip(" \n\r\t"),ap=e=>""===e||e===Na||e===La||e===Ba;function op(e,t,r){var s,i,n,a,o;let{node:u}=e;if("JSXElement"===u.type&&function(e){if(0===e.children.length)return!0;if(e.children.length>1)return!1;let t=e.children[0];return"JSXText"===t.type&&!mp(t)}(u))return[r("openingElement"),r("closingElement")];let p="JSXElement"===u.type?r("openingElement"):r("openingFragment"),l="JSXElement"===u.type?r("closingElement"):r("closingFragment");if(1===u.children.length&&"JSXExpressionContainer"===u.children[0].type&&("TemplateLiteral"===u.children[0].expression.type||"TaggedTemplateExpression"===u.children[0].expression.type))return[p,...e.map(r,"children"),l];u.children=u.children.map(e=>function(e){return"JSXExpressionContainer"===e.type&&Si(e.expression)&&" "===e.expression.value&&!Tn(e.expression)}(e)?{type:"JSXText",value:" ",raw:" "}:e);let c=u.children.some(Bi),h=u.children.filter(e=>"JSXExpressionContainer"===e.type).length>1,d="JSXElement"===u.type&&u.openingElement.attributes.length>1,m=aa(p)||c||d||h,y="mdx"===e.parent.rootMarker,f=t.singleQuote?"{' '}":'{" "}',D=y?Na:Sa([f,Ba]," "),x=function(e,t,r,s,i){let n="",a=[n];function o(e){n=e,a.push([a.pop(),e])}function u(e){""!==e&&(n=e,a.push(e,""))}return e.each(({node:e,next:t})=>{if("JSXText"===e.type){let r=ci(e);if(mp(e)){let a,p=np.split(r,!0);if(""===p[0]&&(p.shift(),/\n/u.test(p[0])?u(pp(i,p[1],e,t)):u(s),p.shift()),""===Ns(!1,p,-1)&&(p.pop(),a=p.pop()),0===p.length)return;for(let[e,t]of p.entries())e%2==1?u(Na):o(t);void 0!==a?/\n/u.test(a)?u(pp(i,n,e,t)):u(s):u(up(i,n,e,t))}else/\n/u.test(r)?r.match(/\n/gu).length>1&&u(La):u(s)}else{if(o(r()),t&&mp(t)){let r=np.trim(ci(t)),[s]=np.split(r);u(up(i,s,e,t))}else u(La)}},"children"),a}(e,0,r,D,"fbt"===(null==(i=null==(s=u.openingElement)?void 0:s.name)?void 0:i.name)),g=u.children.some(e=>mp(e));for(let e=x.length-2;e>=0;e--){let t=""===x[e]&&""===x[e+1],r=x[e]===La&&""===x[e+1]&&x[e+2]===La,s=(x[e]===Ba||x[e]===La)&&""===x[e+1]&&x[e+2]===D,i=x[e]===D&&""===x[e+1]&&(x[e+2]===Ba||x[e+2]===La),n=x[e]===D&&""===x[e+1]&&x[e+2]===D,a=x[e]===Ba&&""===x[e+1]&&x[e+2]===La||x[e]===La&&""===x[e+1]&&x[e+2]===Ba;r&&g||t||s||n||a?x.splice(e,2):i&&x.splice(e+1,2)}for(;x.length>0&&ap(Ns(!1,x,-1));)x.pop();for(;x.length>1&&ap(x[0])&&ap(x[1]);)x.shift(),x.shift();let E=[""];for(let[e,t]of x.entries()){if(t===D){if(1===e&&ma(x[e-1])){if(2===x.length){E.push([E.pop(),f]);continue}E.push([f,La],"");continue}if(e===x.length-1){E.push([E.pop(),f]);continue}if(""===x[e-1]&&x[e-2]===La){E.push([E.pop(),f]);continue}}e%2==0?E.push([E.pop(),t]):E.push(t,""),aa(t)&&(m=!0)}let A=g?ba(E):Aa(E,{shouldBreak:!0});if("JSXText"===(null==(n=t.cursorNode)?void 0:n.type)&&u.children.includes(t.cursorNode)?A=[Oa,A,Oa]:"JSXText"===(null==(a=t.nodeBeforeCursor)?void 0:a.type)&&u.children.includes(t.nodeBeforeCursor)?A=[Oa,A]:"JSXText"===(null==(o=t.nodeAfterCursor)?void 0:o.type)&&u.children.includes(t.nodeAfterCursor)&&(A=[A,Oa]),y)return A;let T=Aa([p,ga([La,A]),La,l]);return m?T:Fa([Aa([p,...x,l]),T])}function up(e,t,r,s){return e?"":"JSXElement"===r.type&&!r.closingElement||"JSXElement"===(null==s?void 0:s.type)&&!s.closingElement?1===t.length?Ba:La:Ba}function pp(e,t,r,s){return e?La:1===t.length?"JSXElement"===r.type&&!r.closingElement||"JSXElement"===(null==s?void 0:s.type)&&!s.closingElement?La:Ba:La}var lp=new Set(["ArrayExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function cp(e,t,r){let{parent:s}=e;if(lp.has(s.type))return t;let i=function(e){return e.match(void 0,e=>"ArrowFunctionExpression"===e.type,Ji)&&(e.match(void 0,void 0,void 0,e=>"JSXExpressionContainer"===e.type)||e.match(void 0,void 0,void 0,e=>"ChainExpression"===e.type,e=>"JSXExpressionContainer"===e.type))}(e),n=Ku(e,r);return Aa([n?"":Sa("("),ga([Ba,t]),Ba,n?"":Sa(")")],{shouldBreak:i})}function hp(e,t,r){return e.selfClosing?[Na,"/>"]:function(e,t,r){let s=e.attributes.length>0&&Tn(Ns(!1,e.attributes,-1),En.Trailing);return 0===e.attributes.length&&!r||(t.bracketSameLine||t.jsxBracketSameLine)&&(!r||e.attributes.length>0)&&!s}(e,t,r)?[">"]:[Ba,">"]}function dp(e,t,r){let{node:s}=e;if(s.type.startsWith("JSX"))switch(s.type){case"JSXAttribute":return function(e,t,r){let{node:s}=e,i=[];if(i.push(r("name")),s.value){let n;if(Si(s.value)){let r=ci(s.value),i=ks(!1,ks(!1,r.slice(1,-1),"'","'"),""",'"'),a=Qs(i,t.jsxSingleQuote);i='"'===a?ks(!1,i,'"',"""):ks(!1,i,"'","'"),n=e.call(()=>ep(e,ca(a+i+a),t),"value")}else n=r("value");i.push("=",n)}return i}(e,t,r);case"JSXIdentifier":return s.name;case"JSXNamespacedName":return ja(":",[r("namespace"),r("name")]);case"JSXMemberExpression":return ja(".",[r("object"),r("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return function(e,t,r){let{node:s}=e;return["{",e.call(({node:s})=>{let i=["...",r()];return Tn(s)&&Wo(e)?[ga([Ba,ep(e,i,t)]),Ba]:i},"JSXSpreadAttribute"===s.type?"argument":"expression"),"}"]}(e,t,r);case"JSXExpressionContainer":return function(e,t,r){let{node:s}=e,i=(e,t)=>"JSXEmptyExpression"===e.type||!Tn(e)&&(Ti(e)||Ci(e)||"ArrowFunctionExpression"===e.type||"AwaitExpression"===e.type&&(i(e.argument,e)||"JSXElement"===e.argument.type)||Ji(e)||"ChainExpression"===e.type&&Ji(e.expression)||"FunctionExpression"===e.type||"TemplateLiteral"===e.type||"TaggedTemplateExpression"===e.type||"DoExpression"===e.type||Bi(t)&&("ConditionalExpression"===e.type||Oi(e)));return i(s.expression,e.parent)?Aa(["{",r("expression"),wa,"}"]):Aa(["{",ga([Ba,r("expression")]),Ba,wa,"}"])}(e,0,r);case"JSXFragment":case"JSXElement":return function(e,t,r){return cp(e,ep(e,op(e,t,r),t),t)}(e,t,r);case"JSXOpeningElement":return function(e,t,r){var s,i;let{node:n}=e,a=Tn(n.name)||Tn(n.typeParameters)||Tn(n.typeArguments);if(n.selfClosing&&0===n.attributes.length&&!a)return["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," />"];if(1===(null==(s=n.attributes)?void 0:s.length)&&Si(n.attributes[0].value)&&!n.attributes[0].value.value.includes("\n")&&!a&&!Tn(n.attributes[0]))return Aa(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," ",...e.map(r,"attributes"),n.selfClosing?" />":">"]);let o=null==(i=n.attributes)?void 0:i.some(e=>Si(e.value)&&e.value.value.includes("\n")),u=t.singleAttributePerLine&&n.attributes.length>1?La:Na;return Aa(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters"),ga(e.map(()=>[u,r()],"attributes")),...hp(n,t,a)],{shouldBreak:o})}(e,t,r);case"JSXClosingElement":return function(e,t,r){let{node:s}=e,i=[];i.push(""),i}(e,0,r);case"JSXOpeningFragment":case"JSXClosingFragment":return function(e,t){let{node:r}=e,s=Tn(r),i=Tn(r,En.Line),n="JSXOpeningFragment"===r.type;return[n?"<":""]}(e,t);case"JSXEmptyExpression":return function(e,t){let{node:r}=e,s=Tn(r,En.Line);return[Qu(e,t,{indent:s}),s?La:""]}(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new rp(s,"JSX")}}function mp(e){return"JSXText"===e.type&&(np.hasNonWhitespaceCharacter(ci(e))||!/\n/u.test(ci(e)))}var yp=function(e){return gn(e.node)||function(e){let{node:t,parent:r}=e;if(!Bi(t)||!Bi(r))return!1;let s,{index:i,siblings:n}=e;for(let e=i;e>0;e--){let t=n[e-1];if("JSXText"!==t.type||mp(t)){s=t;break}}return"JSXExpressionContainer"===(null==s?void 0:s.type)&&"JSXEmptyExpression"===s.expression.type&&gn(s.expression)}(e)},fp=0;function Dp(e,t,r){var s;let{node:i,parent:n,grandparent:a,key:o}=e,u="body"!==o&&("IfStatement"===n.type||"WhileStatement"===n.type||"SwitchStatement"===n.type||"DoWhileStatement"===n.type),p="|>"===i.operator&&(null==(s=e.root.extra)?void 0:s.__isUsingHackPipeline),l=xp(e,t,r,!1,u);if(u)return l;if(p)return Aa(l);if(Ji(n)&&n.callee===i||"UnaryExpression"===n.type||Vi(n)&&!n.computed)return Aa([ga([Ba,...l]),Ba]);let c="ReturnStatement"===n.type||"ThrowStatement"===n.type||"JSXExpressionContainer"===n.type&&"JSXAttribute"===a.type||"|"!==i.operator&&"JsExpressionRoot"===n.type||"NGPipeExpression"!==i.type&&("NGRoot"===n.type&&"__ng_binding"===t.parser||"NGMicrosyntaxExpression"===n.type&&"NGMicrosyntax"===a.type&&1===a.body.length)||i===n.body&&"ArrowFunctionExpression"===n.type||i!==n.body&&"ForStatement"===n.type||"ConditionalExpression"===n.type&&"ReturnStatement"!==a.type&&"ThrowStatement"!==a.type&&!Ji(a)||"TemplateLiteral"===n.type,h="AssignmentExpression"===n.type||"VariableDeclarator"===n.type||"ClassProperty"===n.type||"PropertyDefinition"===n.type||"TSAbstractPropertyDefinition"===n.type||"ClassPrivateProperty"===n.type||Sn(n),d=Oi(i.left)&&un(i.operator,i.left.operator);if(c||gp(i)&&!d||!gp(i)&&h)return Aa(l);if(0===l.length)return"";let m=Bi(i.right),y=l.findIndex(e=>"string"!=typeof e&&!Array.isArray(e)&&e.type===$n),f=l.slice(0,-1===y?1:y+1),D=l.slice(f.length,m?-1:void 0),x=Symbol("logicalChain-"+ ++fp),g=Aa([...f,ga(D)],{id:x});return m?Aa([g,Pa(Ns(!1,l,-1),{groupId:x})]):g}function xp(e,t,r,s,i){var n;let{node:a}=e;if(!Oi(a))return[Aa(r())];let o=[];un(a.operator,a.left.operator)?o=e.call(e=>xp(e,t,r,!0,i),"left"):o.push(Aa(r("left")));let u,p=gp(a),l=("|>"===a.operator||"NGPipeExpression"===a.type||function(e,t){return("__vue_expression"===t.parser||"__vue_ts_expression"===t.parser)&&Ep(e.node)&&!e.hasAncestor(e=>!Ep(e)&&"JsExpressionRoot"!==e.type)}(e,t))&&!Ki(t.originalText,a.right),c=!Tn(a.right,En.Leading,Ya)&&Ki(t.originalText,a.right),h="NGPipeExpression"===a.type?"|":a.operator,d="NGPipeExpression"===a.type&&a.arguments.length>0?Aa(ga([Ba,": ",ja([Na,": "],e.map(()=>Ea(2,Aa(r())),"arguments"))])):"";if(p)u=[h,Ki(t.originalText,a.right)?ga([Na,r("right"),d]):[" ",r("right"),d]];else{let s="|>"===h&&(null==(n=e.root.extra)?void 0:n.__isUsingHackPipeline)?e.call(e=>xp(e,t,r,!0,i),"right"):r("right");if("start"===t.experimentalOperatorPosition){let e="";if(c)switch(Yn(s)){case On:e=s.splice(0,1)[0];break;case Kn:e=s.contents.splice(0,1)[0]}u=[Na,e,h," ",s,d]}else u=[l?Na:"",h,l?" ":Na,s,d]}let{parent:m}=e,y=Tn(a.left,En.Trailing|En.Line);if((y||!(i&&"LogicalExpression"===a.type)&&m.type!==a.type&&a.left.type!==a.type&&a.right.type!==a.type)&&(u=Aa(u,{shouldBreak:y})),"start"===t.experimentalOperatorPosition?o.push(p||c?" ":"",u):o.push(l?"":" ",u),s&&Tn(a)){let r=la(ep(e,o,t));return r.type===qn?r.parts:Array.isArray(r)?r:[r]}return o}function gp(e){return"LogicalExpression"===e.type&&!!(Ci(e.right)&&e.right.properties.length>0||Ti(e.right)&&e.right.elements.length>0||Bi(e.right))}var Ep=e=>"BinaryExpression"===e.type&&"|"===e.operator;function Ap(e,t,r){let{node:s}=e;if(s.type.startsWith("NG"))switch(s.type){case"NGRoot":return[r("node"),Tn(s.node)?" //"+Cn(s.node)[0].value.trimEnd():""];case"NGPipeExpression":return Dp(e,t,r);case"NGChainedExpression":return Aa(ja([";",Na],e.map(()=>function({node:e}){return Di(e,Cp)}(e)?r():["(",r(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return e.map(()=>[e.isFirst?"":Tp(e)?" ":[";",Na],r()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(s.name)?s.name:JSON.stringify(s.name);case"NGMicrosyntaxExpression":return[r("expression"),null===s.alias?"":[" as ",r("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:t,parent:i}=e,n=Tp(e)||function(e){let{node:t}=e;return"of"===e.parent.body[1].key.name&&"NGMicrosyntaxKeyedExpression"===t.type&&"track"===t.key.name&&"NGMicrosyntaxKey"===t.key.type}(e)||(1===t&&("then"===s.key.name||"else"===s.key.name||"as"===s.key.name)||2===t&&("else"===s.key.name&&"NGMicrosyntaxKeyedExpression"===i.body[t-1].type&&"then"===i.body[t-1].key.name||"track"===s.key.name))&&"NGMicrosyntaxExpression"===i.body[0].type;return[r("key"),n?" ":": ",r("expression")]}case"NGMicrosyntaxLet":return["let ",r("key"),null===s.value?"":[" = ",r("value")]];case"NGMicrosyntaxAs":return[r("key")," as ",r("alias")];default:throw new rp(s,"Angular")}}function Tp({node:e,index:t}){return"NGMicrosyntaxKeyedExpression"===e.type&&"of"===e.key.name&&1===t}var Cp=li(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function Fp(e,t,r){let{node:s}=e;return Aa([ja(Na,e.map(r,"decorators")),Sp(s,t)?La:Na])}function bp(e,t,r){return Pp(e.node)?[ja(La,e.map(r,"declaration","decorators")),La]:""}function Sp(e,t){return e.decorators.some(e=>Vs(t.originalText,si(e)))}function Pp(e){var t;if("ExportDefaultDeclaration"!==e.type&&"ExportNamedDeclaration"!==e.type&&"DeclareExportDeclaration"!==e.type)return!1;let r=null==(t=e.declaration)?void 0:t.decorators;return Ks(r)&&ii(e,r[0])}var vp=class extends Error{name="ArgExpansionBailout"};function wp(e,t=!1){return Ci(e)&&(e.properties.length>0||Tn(e))||Ti(e)&&(e.elements.length>0||Tn(e))||"TSTypeAssertion"===e.type&&wp(e.expression)||Pn(e)&&wp(e.expression)||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type&&(!e.returnType||!e.returnType.typeAnnotation||"TSTypeReference"!==e.returnType.typeAnnotation.type||function(e){return"BlockStatement"===e.type&&(e.body.some(e=>"EmptyStatement"!==e.type)||Tn(e,En.Dangling))}(e.body))&&("BlockStatement"===e.body.type||"ArrowFunctionExpression"===e.body.type&&wp(e.body,!0)||Ci(e.body)||Ti(e.body)||!t&&(Ji(e.body)||"ConditionalExpression"===e.body.type)||Bi(e.body))||"DoExpression"===e.type||"ModuleExpression"===e.type}function Ip(e){if("ParenthesizedExpression"===e.type)return Ip(e.expression);if(Pn(e)||"TypeCastExpression"===e.type){let{typeAnnotation:t}=e;if("TypeAnnotation"===t.type&&(t=t.typeAnnotation),"TSArrayType"===t.type&&(t=t.elementType,"TSArrayType"===t.type&&(t=t.elementType)),"GenericTypeAnnotation"===t.type||"TSTypeReference"===t.type){let e=t.typeArguments??t.typeParameters;1===(null==e?void 0:e.params.length)&&(t=e.params[0])}return _i(t)&&en(e.expression,1)}return!(bn(e)&&yn(e).length>1)&&(Oi(e)?en(e.left,1)&&en(e.right,1):Pi(e)||en(e))}function kp(e,t){let r=e[t],s=e[t+1];return"ArrowFunctionExpression"===r.type&&0===dn(r).length&&"BlockStatement"===r.body.type&&"ArrayExpression"===s.type&&!e.some(e=>Tn(e))}var Np=function(e,t,r){let{node:s}=e,i=yn(s);if(0===i.length)return["(",Qu(e,t),")"];let n=i.length-1;if(function(e){return 2===e.length?kp(e,0):3===e.length&&("Identifier"===e[0].type&&kp(e,1))}(i)){let t=["("];return fn(e,(e,s)=>{t.push(r()),s!==n&&t.push(", ")}),t.push(")"),t}let a=!1,o=[];fn(e,({node:e},s)=>{let i=r();s===n||(Fn(e,t)?(a=!0,i=[i,",",La,La]):i=[i,",",Na]),o.push(i)});let u=!t.parser.startsWith("__ng_")&&"ImportExpression"!==s.type&&"TSImportType"!==s.type&&rn(t,"all")?",":"";if("TSImportType"===s.type&&1===i.length&&("TSLiteralType"===i[0].type&&Si(i[0].literal)||Si(i[0]))&&!Tn(i[0]))return Aa(["(",...o,Sa(u),")"]);function p(){return Aa(["(",ga([Na,...o]),u,Na,")"],{shouldBreak:!0})}if(a||"Decorator"!==e.parent.type&&function(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(ki(r)){if(t+=1,t>1)return!0}else if(Ji(r))for(let e of yn(r))if(ki(e))return!0;return!1}(i))return p();if(function(e){if(2!==e.length)return!1;let[t,r]=e;return!("ModuleExpression"!==t.type||!function(e){if("ObjectExpression"!==e.type||1!==e.properties.length)return!1;let[t]=e.properties;return!!Sn(t)&&(!t.computed&&("Identifier"===t.key.type&&"type"===t.key.name||Si(t.key)&&"type"===t.key.value)&&Si(t.value)&&"module"===t.value.value)}(r))||!Tn(t)&&("FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type&&"BlockStatement"===t.body.type)&&"FunctionExpression"!==r.type&&"ArrowFunctionExpression"!==r.type&&"ConditionalExpression"!==r.type&&Ip(r)&&!wp(r)}(i)){let e,t=o.slice(1);if(t.some(aa))return p();try{e=r(Dn(s,0),{expandFirstArg:!0})}catch(e){if(e instanceof vp)return p();throw e}return aa(e)?[Ia,Fa([["(",Aa(e,{shouldBreak:!0}),", ",...t,")"],p()])]:Fa([["(",e,", ",...t,")"],["(",Aa(e,{shouldBreak:!0}),", ",...t,")"],p()])}if(function(e,t,r){var s,i;let n=Ns(!1,e,-1);if(1===e.length){let e=Ns(!1,t,-1);if(null!=(s=e.label)&&s.embed&&!1!==(null==(i=e.label)?void 0:i.hug))return!0}let a=Ns(!1,e,-2);return!Tn(n,En.Leading)&&!Tn(n,En.Trailing)&&wp(n)&&(!a||a.type!==n.type)&&(2!==e.length||"ArrowFunctionExpression"!==a.type||!Ti(n))&&!(e.length>1&&Sl(n,r))}(i,o,t)){let e,t=o.slice(0,-1);if(t.some(aa))return p();try{e=r(Dn(s,-1),{expandLastArg:!0})}catch(e){if(e instanceof vp)return p();throw e}return aa(e)?[Ia,Fa([["(",...t,Aa(e,{shouldBreak:!0}),")"],p()])]:Fa([["(",...t,e,")"],["(",...t,Aa(e,{shouldBreak:!0}),")"],p()])}let l=["(",ga([Ba,...o]),Sa(u),Ba,")"];return Qi(e)?l:Aa(l,{shouldBreak:o.some(aa)||a})};function Bp(e,t,r){var s;let i=r("object"),n=Lp(e,t,r),{node:a}=e,o=e.findAncestor(e=>!(Vi(e)||"TSNonNullExpression"===e.type)),u=e.findAncestor(e=>!("ChainExpression"===e.type||"TSNonNullExpression"===e.type)),p=o&&("NewExpression"===o.type||"BindExpression"===o.type||"AssignmentExpression"===o.type&&"Identifier"!==o.left.type)||a.computed||"Identifier"===a.object.type&&"Identifier"===a.property.type&&!Vi(u)||("AssignmentExpression"===u.type||"VariableDeclarator"===u.type)&&((e=>(("ChainExpression"===e.type||"TSNonNullExpression"===e.type)&&(e=e.expression),Ji(e)&&yn(e).length>0))(a.object)||(null==(s=i.label)?void 0:s.memberChain));return Ra(i.label,[i,p?n:Aa(ga([Ba,n]))])}function Lp(e,t,r){let s=r("property"),{node:i}=e,n=ml(e);return i.computed?!i.property||Fi(i.property)?[n,"[",s,"]"]:Aa([n,"[",ga([Ba,s]),Ba,"]"]):[n,".",s]}var Mp=function e(t,r,s){if("ChainExpression"===t.node.type)return t.call(()=>e(t,r,s),"expression");let i="ExpressionStatement"===("ChainExpression"===t.parent.type?t.grandparent:t.parent).type,n=[];function a(e){let{originalText:t}=r,s=za(t,si(e));return")"===t.charAt(s)?!1!==s&&zs(t,s+1):Fn(e,r)}let{node:o}=t;n.unshift({node:o,printed:[ml(t),El(t,r,s),Np(t,r,s)]}),o.callee&&t.call(function e(){let{node:i}=t;if("ChainExpression"===i.type)return t.call(e,"expression");if(Ji(i)&&(ji(i.callee)||Ji(i.callee))){let o=a(i);n.unshift({node:i,hasTrailingEmptyLine:o,printed:[ep(t,[ml(t),El(t,r,s),Np(t,r,s)],r),o?La:""]}),t.call(e,"callee")}else ji(i)?(n.unshift({node:i,needsParens:Ku(t,r),printed:ep(t,Vi(i)?Lp(t,0,s):Al(t,r,s),r)}),t.call(e,"object")):"TSNonNullExpression"===i.type?(n.unshift({node:i,printed:ep(t,"!",r)}),t.call(e,"expression")):n.unshift({node:i,printed:s()})},"callee");let u=[],p=[n[0]],l=1;for(;l0&&u.push(p);let d=u.length>=2&&!Tn(u[1][0].node)&&function(e){var t;let s=null==(t=e[1][0])?void 0:t.node.computed;if(1===e[0].length){let t=e[0][0].node;return"ThisExpression"===t.type||"Identifier"===t.type&&(h(t.name)||i&&function(e){return e.length<=r.tabWidth}(t.name)||s)}let n=Ns(!1,e[0],-1).node;return Vi(n)&&"Identifier"===n.property.type&&(h(n.property.name)||s)}(u);function m(e){let t=e.map(e=>e.printed);return e.length>0&&Ns(!1,e,-1).needsParens?["(",...t,")"]:t}let y=u.map(m),f=y,D=d?3:2,x=u.flat(),g=x.slice(1,-1).some(e=>Tn(e.node,En.Leading))||x.slice(0,-1).some(e=>Tn(e.node,En.Trailing))||u[D]&&Tn(u[D][0].node,En.Leading);if(u.length<=D&&!g&&!u.some(e=>Ns(!1,e,-1).hasTrailingEmptyLine))return Qi(t)?f:Aa(f);let E,A=Ns(!1,u[d?1:0],-1).node,T=!Ji(A)&&a(A),C=[m(u[0]),d?u.slice(1,2).map(m):"",T?La:"",function(e){return 0===e.length?"":ga([La,ja(La,e.map(m))])}(u.slice(d?2:1))],F=n.map(({node:e})=>e).filter(Ji);return E=g||F.length>2&&F.some(e=>!e.arguments.every(e=>en(e)))||y.slice(0,-1).some(aa)||function(){let e=Ns(!1,Ns(!1,u,-1),-1).node,t=Ns(!1,y,-1);return Ji(e)&&aa(t)&&F.slice(0,-1).some(e=>e.arguments.some(ki))}()?Aa(C):[aa(f)||T?Ia:"",Fa([f,C])],Ra({memberChain:!0},E)};function Op(e,t,r){var s;let{node:i}=e,n="NewExpression"===i.type,a="ImportExpression"===i.type,o=ml(e),u=yn(i),p=1===u.length&&Gi(u[0],t.originalText);if(p||function(e){let{node:t}=e;if("CallExpression"!==t.type||t.optional||"Identifier"!==t.callee.type)return!1;let r=yn(t);return"require"===t.callee.name?1===r.length&&Si(r[0])||r.length>1:"define"===t.callee.name&&"ExpressionStatement"===e.parent.type&&(1===r.length||2===r.length&&"ArrayExpression"===r[0].type||3===r.length&&Si(r[0])&&"ArrayExpression"===r[1].type)}(e)||$i(i,e.parent)){let i=[];if(fn(e,()=>{i.push(r())}),!p||null==(s=i[0].label)||!s.embed)return[n?"new ":"",jp(e,r),o,El(e,t,r),"(",ja(", ",i),")"]}if(!a&&!n&&ji(i.callee)&&!e.call(e=>Ku(e,t),"callee",..."ChainExpression"===i.callee.type?["expression"]:[]))return Mp(e,t,r);let l=[n?"new ":"",jp(e,r),o,El(e,t,r),Np(e,t,r)];return a||Ji(i.callee)?Aa(l):l}function jp(e,t){let{node:r}=e;return"ImportExpression"===r.type?"import"+(r.phase?`.${r.phase}`:""):t("callee")}function Rp(e,t,r,s,i,n){let a=function(e,t,r,s,i){let{node:n}=e,a=n[i];if(!a)return"only-left";let o=!_p(a);if(e.match(_p,Up,e=>!o||"ExpressionStatement"!==e.type&&"VariableDeclaration"!==e.type))return o?"ArrowFunctionExpression"===a.type&&"ArrowFunctionExpression"===a.body.type?"chain-tail-arrow-chain":"chain-tail":"chain";if(!o&&_p(a.right)||Ki(t.originalText,a))return"break-after-operator";if("ImportAttribute"===n.type||"CallExpression"===a.type&&"require"===a.callee.name||"json5"===t.parser||"jsonc"===t.parser||"json"===t.parser)return"never-break-after-operator";let u=function(e){return ia(e,ha,!1)}(s);if(function(e){if(Up(e)){let t=e.left||e.id;return"ObjectPattern"===t.type&&t.properties.length>2&&t.properties.some(e=>{var t;return Sn(e)&&(!e.shorthand||"AssignmentPattern"===(null==(t=e.value)?void 0:t.type))})}return!1}(n)||function(e){if("VariableDeclarator"!==e.type)return!1;let{typeAnnotation:t}=e.id;if(!t||!t.typeAnnotation)return!1;let r=Vp(t.typeAnnotation);return Ks(r)&&r.length>1&&r.some(e=>Ks(Vp(e))||"TSConditionalType"===e.type)}(n)||qp(n)&&u)return"break-lhs";let p=function(e,t,r){return!!Sn(e)&&(t=la(t),"string"==typeof t&&Rs(t)function(e,t,r,s){let i=e.node;if(Oi(i)&&!gp(i))return!0;switch(i.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!t.experimentalTernaries&&!function(e){function t(e){switch(e.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":return!!e.typeParameters;case"TSTypeReference":return!!(e.typeArguments??e.typeParameters);default:return!1}}return t(e.checkType)||t(e.extendsType)}(i))break;return!0;case"ConditionalExpression":{if(!t.experimentalTernaries){let{test:e}=i;return Oi(e)&&!gp(e)}let{consequent:e,alternate:r}=i;return"ConditionalExpression"===e.type||"ConditionalExpression"===r.type}case"ClassExpression":return Ks(i.decorators)}if(s)return!1;let n=i,a=[];for(;;)if("UnaryExpression"===n.type||"AwaitExpression"===n.type||"YieldExpression"===n.type&&null!==n.argument)n=n.argument,a.push("argument");else{if("TSNonNullExpression"!==n.type)break;n=n.expression,a.push("expression")}return!(!Si(n)&&!e.call(()=>Hp(e,t,r),...a))}(e,t,r,p),i)?"break-after-operator":function(e){let t=function(e){var t;if($p(e))return null==(t=e.typeParameters)?void 0:t.params}(e);if(Ks(t)){let r="TSTypeAliasDeclaration"===e.type?"constraint":"bound";if(t.length>1&&t.some(e=>e[r]||e.default))return!0}return!1}(n)?"break-lhs":!u&&(p||"TemplateLiteral"===a.type||"TaggedTemplateExpression"===a.type||function(e){return"BooleanLiteral"===e.type||"Literal"===e.type&&"boolean"==typeof e.value}(a)||Fi(a)||"ClassExpression"===a.type)?"never-break-after-operator":"fluid"}(e,t,r,s,n),o=n?r(n,{assignmentLayout:a}):"";switch(a){case"break-after-operator":return Aa([Aa(s),i,Aa(ga([Na,o]))]);case"never-break-after-operator":return Aa([Aa(s),i," ",o]);case"fluid":{let e=Symbol("assignment");return Aa([Aa(s),i,Aa(ga(Na),{id:e}),wa,Pa(o,{groupId:e})])}case"break-lhs":return Aa([s,i," ",Aa(o)]);case"chain":return[Aa(s),i,Na,o];case"chain-tail":return[Aa(s),i,ga([Na,o])];case"chain-tail-arrow-chain":return[Aa(s),i,o];case"only-left":return s}}function _p(e){return"AssignmentExpression"===e.type}function Up(e){return _p(e)||"VariableDeclarator"===e.type}var $p=li(["TSTypeAliasDeclaration","TypeAlias"]);function qp(e){var t;return"VariableDeclarator"===e.type&&"ArrowFunctionExpression"===(null==(t=e.init)?void 0:t.type)}var Jp=li(["TSTypeReference","GenericTypeAnnotation"]);function Vp(e){var t;if(Jp(e))return null==(t=e.typeArguments??e.typeParameters)?void 0:t.params}function Hp(e,t,r,s=!1){var i;let{node:n}=e,a=()=>Hp(e,t,r,!0);if("ChainExpression"===n.type||"TSNonNullExpression"===n.type)return e.call(a,"expression");if(Ji(n)){if(null!=(i=Op(e,t,r).label)&&i.memberChain)return!1;let s=yn(n);return!(!(0===s.length||1===s.length&&zi(s[0],t))||function(e,t){let r=function(e){var t;return null==(t=e.typeParameters??e.typeArguments)?void 0:t.params}(e);if(Ks(r)){if(r.length>1)return!0;if(1===r.length){let e=r[0];if(vn(e)||wn(e)||"TSTypeLiteral"===e.type||"ObjectTypeAnnotation"===e.type)return!0}if(aa(t(e.typeParameters?"typeParameters":"typeArguments")))return!0}return!1}(n,r))&&e.call(a,"callee")}return Vi(n)?e.call(a,"object"):s&&("Identifier"===n.type||"ThisExpression"===n.type)}function Wp(e,t,r,s,i){let n=e.node,a=dn(n),o=i?El(e,t,r):"";if(0===a.length)return[o,"(",Qu(e,t,{filter:e=>")"===Ka(t.originalText,si(e))}),")"];let{parent:u}=e,p=$i(u),l=zp(n),c=[];if(function(e,t){let{node:r}=e,s=0,i=e=>t(e,s++);r.this&&e.call(i,"this"),Array.isArray(r.parameters)?e.each(i,"parameters"):Array.isArray(r.params)&&e.each(i,"params"),r.rest&&e.call(i,"rest")}(e,(e,s)=>{let i=s===a.length-1;i&&n.rest&&c.push("..."),c.push(r()),!i&&(c.push(","),p||l?c.push(" "):Fn(a[s],t)?c.push(La,La):c.push(Na))}),s&&!function(e){return e.match(e=>"ArrowFunctionExpression"===e.type&&"BlockStatement"===e.body.type,(e,t)=>{if("CallExpression"===e.type&&"arguments"===t&&1===e.arguments.length&&"CallExpression"===e.callee.type){let t=e.callee.callee;return"Identifier"===t.type||"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&"Identifier"===t.property.type}return!1},(e,t)=>"VariableDeclarator"===e.type&&"init"===t||"ExportDefaultDeclaration"===e.type&&"declaration"===t||"TSExportAssignment"===e.type&&"expression"===t||"AssignmentExpression"===e.type&&"right"===t&&"MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"module"===e.left.object.name&&"Identifier"===e.left.property.type&&"exports"===e.left.property.name,e=>"VariableDeclaration"!==e.type||"const"===e.kind&&1===e.declarations.length)}(e)){if(aa(o)||aa(c))throw new vp;return Aa([pa(o),"(",pa(c),")"])}let h=a.every(e=>!Ks(e.decorators));return l&&h||p?[o,"(",...c,")"]:(Mi(u)||function(e){return!("TypeAnnotation"!==e.type&&"TSTypeAnnotation"!==e.type||"FunctionTypeAnnotation"!==e.typeAnnotation.type||e.static||ii(e,e.typeAnnotation))}(u)||"TypeAlias"===u.type||"UnionTypeAnnotation"===u.type||"IntersectionTypeAnnotation"===u.type||"FunctionTypeAnnotation"===u.type&&u.returnType===n)&&1===a.length&&null===a[0].name&&n.this!==a[0]&&a[0].typeAnnotation&&null===n.typeParameters&&_i(a[0].typeAnnotation)&&!n.rest?"always"===t.arrowParens||"HookTypeAnnotation"===n.type?["(",...c,")"]:c:[o,"(",ga([Ba,...c]),Sa(!cn(n)&&rn(t,"all")?",":""),Ba,")"]}function zp(e){if(!e)return!1;let t=dn(e);if(1!==t.length)return!1;let[r]=t;return!Tn(r)&&("ObjectPattern"===r.type||"ArrayPattern"===r.type||"Identifier"===r.type&&r.typeAnnotation&&("TypeAnnotation"===r.typeAnnotation.type||"TSTypeAnnotation"===r.typeAnnotation.type)&&Ii(r.typeAnnotation.typeAnnotation)||"FunctionTypeParam"===r.type&&Ii(r.typeAnnotation)&&r!==e.rest||"AssignmentPattern"===r.type&&("ObjectPattern"===r.left.type||"ArrayPattern"===r.left.type)&&("Identifier"===r.right.type||Ci(r.right)&&0===r.right.properties.length||Ti(r.right)&&0===r.right.elements.length))}function Kp(e,t){var r;let s=function(e){let t;return e.returnType?(t=e.returnType,t.typeAnnotation&&(t=t.typeAnnotation)):e.typeAnnotation&&(t=e.typeAnnotation),t}(e);if(!s)return!1;let i=null==(r=e.typeParameters)?void 0:r.params;if(i){if(i.length>1)return!1;if(1===i.length){let e=i[0];if(e.constraint||e.default)return!1}}return 1===dn(e).length&&(Ii(s)||aa(t))}var Xp=li(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),Gp=li(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function Yp(e){return!(!_i(e)&&!Ii(e))||!!vn(e)&&function(e){let{types:t}=e;if(t.some(e=>Tn(e)))return!1;let r=t.find(e=>Gp(e));return!!r&&t.every(e=>e===r||Xp(e))}(e)}function Qp(e,t,r){let s=t.semi?";":"",{node:i}=e,n=[Dl(e)];return n.push("type ",r("id"),r("typeParameters")),[Rp(e,t,r,n," =","TSTypeAliasDeclaration"===i.type?"typeAnnotation":"right"),s]}function Zp(e,t,r){let s=!1;return Aa(e.map(({isFirst:e,previous:i,node:n,index:a})=>{let o=r();if(e)return o;let u=Ii(n),p=Ii(i);return p&&u?[" & ",s?ga(o):o]:!p&&!u||Ki(t.originalText,n)?"start"===t.experimentalOperatorPosition?ga([Na,"& ",o]):ga([" &",Na,o]):(a>1&&(s=!0),[" & ",a>1?ga(o):o])},"types"))}function el(e,t,r){let{node:s}=e,{parent:i}=e,n=!("TypeParameterInstantiation"===i.type||In(i)&&t.experimentalTernaries||"TSTypeParameterInstantiation"===i.type||"GenericTypeAnnotation"===i.type||"TSTypeReference"===i.type||"TSTypeAssertion"===i.type||"TupleTypeAnnotation"===i.type||"TSTupleType"===i.type||"FunctionTypeParam"===i.type&&!i.name&&e.grandparent.this!==i||("TypeAlias"===i.type||"VariableDeclarator"===i.type||"TSTypeAliasDeclaration"===i.type)&&Ki(t.originalText,s)),a=Yp(s),o=e.map(e=>{let s=r();return a||(s=Ea(2,s)),ep(e,s,t)},"types");if(a)return ja(" | ",o);let u=[Sa([n&&!Ki(t.originalText,s)?Na:"","| "]),ja([Na,"| "],o)];return Ku(e,t)?Aa([ga(u),Ba]):("TupleTypeAnnotation"===i.type||"TSTupleType"===i.type)&&i["TupleTypeAnnotation"===i.type&&i.types?"types":"elementTypes"].length>1?Aa([ga([Sa(["(",Ba]),u]),Ba,Sa(")")]):Aa(n?ga(u):u)}function tl(e,t,r){let{node:s}=e,i=[gl(e)];("TSConstructorType"===s.type||"TSConstructSignatureDeclaration"===s.type)&&i.push("new ");let n=Wp(e,t,r,!1,!0),a=[];return"FunctionTypeAnnotation"===s.type?a.push(function(e){var t;let{node:r,parent:s}=e;return"FunctionTypeAnnotation"===r.type&&(Mi(s)||!(("ObjectTypeProperty"===s.type||"ObjectTypeInternalSlot"===s.type)&&!s.variance&&!s.optional&&ii(s,r)||"ObjectTypeCallProperty"===s.type||"DeclareFunction"===(null==(t=e.getParentNode(2))?void 0:t.type)))}(e)?" => ":": ",r("returnType")):a.push(ul(e,r,s.returnType?"returnType":"typeAnnotation")),Kp(s,a)&&(n=Aa(n)),i.push(n,a),Aa(i)}function rl(e,t,r){return[r("objectType"),ml(e),"[",r("indexType"),"]"]}function sl(e,t,r){return["infer ",r("typeParameter")]}function il(e,t,r){let{node:s}=e;return[s.postfix?"":r,ul(e,t),s.postfix?r:""]}function nl(e,t,r){let{node:s}=e;return["...",..."TupleTypeSpreadElement"===s.type&&s.label?[r("label"),": "]:[],r("typeAnnotation")]}function al(e,t,r){let{node:s}=e;return[s.variance?r("variance"):"",r("label"),s.optional?"?":"",": ",r("elementType")]}var ol=new WeakSet;function ul(e,t,r="typeAnnotation"){let{node:{[r]:s}}=e;if(!s)return"";let i=!1;if("TSTypeAnnotation"===s.type||"TypeAnnotation"===s.type){let t=e.call(pl,r);("=>"===t||":"===t&&Tn(s,En.Leading))&&(i=!0),ol.add(s)}return i?[" ",t(r)]:t(r)}var pl=e=>e.match(e=>"TSTypeAnnotation"===e.type,(e,t)=>!("returnType"!==t&&"typeAnnotation"!==t||"TSFunctionType"!==e.type&&"TSConstructorType"!==e.type))?"=>":e.match(e=>"TSTypeAnnotation"===e.type,(e,t)=>"typeAnnotation"===t&&("TSJSDocNullableType"===e.type||"TSJSDocNonNullableType"===e.type||"TSTypePredicate"===e.type))||e.match(e=>"TypeAnnotation"===e.type,(e,t)=>"typeAnnotation"===t&&"Identifier"===e.type,(e,t)=>"id"===t&&"DeclareFunction"===e.type)||e.match(e=>"TypeAnnotation"===e.type,(e,t)=>"typeAnnotation"===t&&"Identifier"===e.type,(e,t)=>"id"===t&&"DeclareHook"===e.type)||e.match(e=>"TypeAnnotation"===e.type,(e,t)=>"bound"===t&&"TypeParameter"===e.type&&e.usesExtendsBound)?"":":";function ll(e,t,r){let s=pl(e);return s?[s," ",r("typeAnnotation")]:r("typeAnnotation")}function cl(e){return[e("elementType"),"[]"]}function hl({node:e},t){let r="TSTypeQuery"===e.type?"exprName":"argument",s="TypeofTypeAnnotation"===e.type||e.typeArguments?"typeArguments":"typeParameters";return["typeof ",t(r),t(s)]}function dl(e,t){let{node:r}=e;return["TSTypePredicate"===r.type&&r.asserts?"asserts ":"TypePredicate"===r.type&&r.kind?`${r.kind} `:"",t("parameterName"),r.typeAnnotation?[" is ",ul(e,t)]:""]}function ml(e){let{node:t}=e;return!t.optional||"Identifier"===t.type&&t===e.parent.key?"":Ji(t)||Vi(t)&&t.computed||"OptionalIndexedAccessType"===t.type?"?.":"?"}function yl(e){return e.node.definite||e.match(void 0,(e,t)=>"id"===t&&"VariableDeclarator"===e.type&&e.definite)?"!":""}var fl=new Set(["DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function Dl(e){let{node:t}=e;return t.declare||fl.has(t.type)&&"DeclareExportDeclaration"!==e.parent.type?"declare ":""}var xl=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function gl({node:e}){return e.abstract||xl.has(e.type)?"abstract ":""}function El(e,t,r){let s=e.node;return s.typeArguments?r("typeArguments"):s.typeParameters?r("typeParameters"):""}function Al(e,t,r){return["::",r("callee")]}function Tl(e,t,r){return"EmptyStatement"===e.type?";":"BlockStatement"===e.type||r?[" ",t]:ga([Na,t])}function Cl(e,t){return["...",t("argument"),ul(e,t)]}function Fl(e){return e.accessibility?e.accessibility+" ":""}function bl(e,t,r){let{node:s}=e,i=[],n="TupleTypeAnnotation"===s.type&&s.types?"types":"TSTupleType"===s.type||"TupleTypeAnnotation"===s.type?"elementTypes":"elements",a=s[n];if(0===a.length)i.push(function(e,t,r,s){let{node:i}=e,n=i.inexact?"...":"";return Tn(i,En.Dangling)?Aa([r,n,Qu(e,t,{indent:!0}),Ba,s]):[r,n,s]}(e,t,"[","]"));else{let o=Ns(!1,a,-1),u="RestElement"!==(null==o?void 0:o.type)&&!s.inexact,p=null===o,l=Symbol("array"),c=!t.__inJestEach&&a.length>1&&a.every((e,t,r)=>{let s=null==e?void 0:e.type;if(!Ti(e)&&!Ci(e))return!1;let i=r[t+1];if(i&&s!==i.type)return!1;let n=Ti(e)?"elements":"properties";return e[n]&&e[n].length>1}),h=Sl(s,t),d=u?p?",":rn(t)?h?Sa(",","",{groupId:l}):Sa(","):"":"";i.push(Aa(["[",ga([Ba,h?wl(e,t,r,d):[vl(e,t,r,n,s.inexact),d],Qu(e,t)]),Ba,"]"],{shouldBreak:c,id:l}))}return i.push(ml(e),ul(e,r)),i}function Sl(e,t){return Ti(e)&&e.elements.length>1&&e.elements.every(e=>e&&(Fi(e)||bi(e)&&!Tn(e.argument))&&!Tn(e,En.Trailing|En.Line,e=>!Vs(t.originalText,ri(e),{backwards:!0})))}function Pl({node:e},{originalText:t}){let r=e=>","===t[e]?e:r((e=>Hs(t,Ws(t,e)))(e+1));return zs(t,r(si(e)))}function vl(e,t,r,s,i){let n=[];return e.each(({node:s,isLast:a})=>{n.push(s?Aa(r()):""),(!a||i)&&n.push([",",Na,s&&Pl(e,t)?Ba:""])},s),i&&n.push("..."),n}function wl(e,t,r,s){let i=[];return e.each(({isLast:n,next:a})=>{i.push([r(),n?s:","]),n||i.push(Pl(e,t)?[La,La]:Tn(a,En.Leading|En.Line)?La:Na)},"elements"),ba(i)}var Il=/^[\$A-Z_a-z\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/,kl=e=>Il.test(e);var Nl=function(e){return 1===e.length?e:e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")},Bl=new WeakMap;function Ll(e){return/^(?:\d+|\d+\.\d+)$/u.test(e)}function Ml(e,t){return!("json"===t.parser||"jsonc"===t.parser||!Si(e.key)||ei(ci(e.key),t).slice(1,-1)!==e.key.value)&&!((!kl(e.key.value)||"babel-ts"===t.parser&&"ClassProperty"===e.type||("typescript"===t.parser||"oxc-ts"===t.parser)&&"PropertyDefinition"===e.type)&&(!Ll(e.key.value)||String(Number(e.key.value))!==e.key.value||"ImportAttribute"===e.type||"babel"!==t.parser&&"acorn"!==t.parser&&"oxc"!==t.parser&&"espree"!==t.parser&&"meriyah"!==t.parser&&"__babel_estree"!==t.parser))}function Ol(e,t,r){let{node:s}=e;if(s.computed)return["[",r("key"),"]"];let{parent:i}=e,{key:n}=s;if("consistent"===t.quoteProps&&!Bl.has(i)){let r=e.siblings.some(e=>!e.computed&&Si(e.key)&&!Ml(e,t));Bl.set(i,r)}if(function(e,t){let{key:r}=e.node;return("Identifier"===r.type||Fi(r)&&Ll(Nl(ci(r)))&&String(r.value)===Nl(ci(r))&&!("typescript"===t.parser||"babel-ts"===t.parser||"oxc-ts"===t.parser))&&("json"===t.parser||"jsonc"===t.parser||"consistent"===t.quoteProps&&Bl.get(e.parent))}(e,t)){let r=ei(JSON.stringify("Identifier"===n.type?n.name:n.value.toString()),t);return e.call(e=>ep(e,r,t),"key")}return Ml(s,t)&&("as-needed"===t.quoteProps||"consistent"===t.quoteProps&&!Bl.get(i))?e.call(e=>ep(e,/^\d/u.test(n.value)?Nl(n.value):n.value,t),"key"):r("key")}function jl(e,t,r){let{node:s}=e;return s.shorthand?r("value"):Rp(e,t,r,Ol(e,t,r),":","value")}function Rl(e,t,r,s){if((({node:e,key:t,parent:r})=>"value"===t&&"FunctionExpression"===e.type&&("ObjectMethod"===r.type||"ClassMethod"===r.type||"ClassPrivateMethod"===r.type||"MethodDefinition"===r.type||"TSAbstractMethodDefinition"===r.type||"TSDeclareMethod"===r.type||"Property"===r.type&&Li(r)))(e))return Ul(e,t,r);let{node:i}=e,n=!1;if(("FunctionDeclaration"===i.type||"FunctionExpression"===i.type)&&null!=s&&s.expandLastArg){let{parent:t}=e;Ji(t)&&(yn(t).length>1||dn(i).every(e=>"Identifier"===e.type&&!e.typeAnnotation))&&(n=!0)}let a=[Dl(e),i.async?"async ":"",`function${i.generator?"*":""} `,i.id?r("id"):""],o=Wp(e,t,r,n),u=ql(e,r),p=Kp(i,u);return a.push(El(e,0,r),Aa([p?Aa(o):o,u]),i.body?" ":"",r("body")),t.semi&&(i.declare||!i.body)&&a.push(";"),a}function _l(e,t,r){let{node:s}=e,{kind:i}=s,n=s.value||s,a=[];return i&&"init"!==i&&"method"!==i&&"constructor"!==i?(Gs.ok("get"===i||"set"===i),a.push(i," ")):n.async&&a.push("async "),n.generator&&a.push("*"),a.push(Ol(e,t,r),s.optional?"?":"",s===n?Ul(e,t,r):r("value")),a}function Ul(e,t,r){let{node:s}=e,i=Wp(e,t,r),n=ql(e,r),a=function(e){let t=dn(e);return t.length>1&&t.some(e=>"TSParameterProperty"===e.type)}(s),o=Kp(s,n),u=[El(e,0,r),Aa([a?Aa(i,{shouldBreak:!0}):o?Aa(i):i,n])];return s.body?u.push(" ",r("body")):u.push(t.semi?";":""),u}function $l(e,t){if("always"===t.arrowParens)return!1;if("avoid"===t.arrowParens){let{node:t}=e;return function(e){let t=dn(e);return!(1!==t.length||e.typeParameters||Tn(e,En.Dangling)||"Identifier"!==t[0].type||t[0].typeAnnotation||Tn(t[0])||t[0].optional||e.predicate||e.returnType)}(t)}return!1}function ql(e,t){let{node:r}=e,s=[ul(e,t,"returnType")];return r.predicate&&s.push(t("predicate")),s}function Jl(e,t,r){let{node:s}=e,i=t.semi?";":"",n=[];if(s.argument){let e=r("argument");!function(e,t){if(Ki(e.originalText,t)||Tn(t,En.Leading,t=>Xa(e.originalText,ri(t),si(t)))&&!Bi(t))return!0;if(xi(t)){let r,s=t;for(;r=gi(s);)if(s=r,Ki(e.originalText,s))return!0}return!1}(t,s.argument)?(Oi(s.argument)||t.experimentalTernaries&&"ConditionalExpression"===s.argument.type&&("ConditionalExpression"===s.argument.consequent.type||"ConditionalExpression"===s.argument.alternate.type))&&(e=Aa([Sa("("),ga([Ba,e]),Ba,Sa(")")])):e=["(",ga([La,e]),La,")"],n.push(" ",e)}let a=Tn(s,En.Dangling),o=i&&a&&Tn(s,En.Last|En.Line);return o&&n.push(i),a&&n.push(" ",Qu(e,t)),o||n.push(i),n}var Vl=new WeakMap;function Hl(e){return Vl.has(e)||Vl.set(e,"ConditionalExpression"===e.type&&!sn(e,e=>"ObjectExpression"===e.type)),Vl.get(e)}function Wl(e,t,r,s={}){let i,n,a=[],o=[],u=!1,p=!s.expandLastArg&&"ArrowFunctionExpression"===e.node.body.type;!function l(){let{node:c}=e,h=function(e,t,r,s){let{node:i}=e,n=[];if(i.async&&n.push("async "),$l(e,t))n.push(r(["params",0]));else{let i=s.expandLastArg||s.expandFirstArg,a=ql(e,r);if(i){if(aa(a))throw new vp;a=Aa(pa(a))}n.push(Aa([Wp(e,t,r,i,!0),a]))}let a=Qu(e,t,{filter(e){let r=za(t.originalText,si(e));return!1!==r&&"=>"===t.originalText.slice(r,r+2)}});return a&&n.push(" ",a),n}(e,t,r,s);if(0===a.length)a.push(h);else{let{leading:r,trailing:s}=Zu(e,t);a.push([r,h]),o.unshift(s)}p&&(u||(u=c.returnType&&dn(c).length>0||c.typeParameters||dn(c).some(e=>"Identifier"!==e.type))),p&&"ArrowFunctionExpression"===c.body.type?e.call(l,"body"):(i=r("body",s),n=c.body)}();let l=!Ki(t.originalText,n)&&((e=>"SequenceExpression"===e.type)(n)||function(e,t,r){var s,i;return Ti(e)||Ci(e)||"ArrowFunctionExpression"===e.type||"DoExpression"===e.type||"BlockStatement"===e.type||Bi(e)||!1!==(null==(s=t.label)?void 0:s.hug)&&((null==(i=t.label)?void 0:i.embed)||Gi(e,r.originalText))}(n,i,t)||!u&&Hl(n)),c="callee"===e.key&&bn(e.parent),h=Symbol("arrow-chain"),d=function(e,t,{signatureDocs:r,shouldBreak:s}){if(1===r.length)return r[0];let{parent:i,key:n}=e;return"callee"!==n&&bn(i)||Oi(i)?Aa([r[0]," =>",ga([Na,ja([" =>",Na],r.slice(1))])],{shouldBreak:s}):"callee"===n&&bn(i)||t.assignmentLayout?Aa(ja([" =>",Na],r),{shouldBreak:s}):Aa(ga(ja([" =>",Na],r)),{shouldBreak:s})}(e,s,{signatureDocs:a,shouldBreak:u}),m=!1,y=!1,f=!1;return p&&(c||s.assignmentLayout)&&(y=!0,f=!Tn(e.node,En.Leading&En.Line),m="chain-tail-arrow-chain"===s.assignmentLayout||c&&!l),i=function(e,t,r,{bodyDoc:s,bodyComments:i,functionBody:n,shouldPutBodyOnSameLine:a}){let{node:o,parent:u}=e,p=r.expandLastArg&&rn(t,"all")?Sa(","):"",l=!r.expandLastArg&&"JSXExpressionContainer"!==u.type||Tn(o)?"":Ba;return a&&Hl(n)?[" ",Aa([Sa("","("),ga([Ba,s]),Sa("",")"),p,l]),i]:a?[" ",s,i]:[ga([Na,s,i]),p,l]}(e,t,s,{bodyDoc:i,bodyComments:o,functionBody:n,shouldPutBodyOnSameLine:l}),Aa([Aa(y?ga([f?Ba:"",d]):d,{shouldBreak:m,id:h})," =>",p?Pa(i,{groupId:h}):Aa(i),p&&c?Sa(Ba,"",{groupId:h}):""])}var zl=(e,t,r)=>{if(!e||null!=t){if(t.findLast)return t.findLast(r);for(let e=t.length-1;e>=0;e--){let s=t[e];if(r(s,e,t))return s}}};function Kl(e,t,r,s){let{node:i}=e,n=[],a=zl(!1,i[s],e=>"EmptyStatement"!==e.type);return e.each(({node:e})=>{"EmptyStatement"!==e.type&&(n.push(r()),e!==a&&(n.push(La),Fn(e,t)&&n.push(La)))},s),n}function Xl(e,t,r){let s=function(e,t,r){let{node:s}=e,i=Ks(s.directives),n=s.body.some(e=>"EmptyStatement"!==e.type),a=Tn(s,En.Dangling);if(!i&&!n&&!a)return"";let o=[];return i&&(o.push(Kl(e,t,r,"directives")),(n||a)&&(o.push(La),Fn(Ns(!1,s.directives,-1),t)&&o.push(La))),n&&o.push(Kl(e,t,r,"body")),a&&o.push(Qu(e,t)),o}(e,t,r),{node:i,parent:n}=e;if("Program"===i.type&&"ModuleExpression"!==(null==n?void 0:n.type))return s?[s,La]:"";let a=[];if("StaticBlock"===i.type&&a.push("static "),a.push("{"),s)a.push(ga([La,s]),La);else{let t=e.grandparent;"ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type||"FunctionDeclaration"===n.type||"ComponentDeclaration"===n.type||"HookDeclaration"===n.type||"ObjectMethod"===n.type||"ClassMethod"===n.type||"ClassPrivateMethod"===n.type||"ForStatement"===n.type||"WhileStatement"===n.type||"DoWhileStatement"===n.type||"DoExpression"===n.type||"ModuleExpression"===n.type||"CatchClause"===n.type&&!t.finalizer||"TSModuleDeclaration"===n.type||"StaticBlock"===i.type||a.push(La)}return a.push("}"),a}var Gl=function(e){let t=new WeakMap;return function(r){return t.has(r)||t.set(r,Symbol(e)),t.get(r)}},Yl=Gl("typeParameters");function Ql(e,t,r,s){let{node:i}=e;if(!i[s])return"";if(!Array.isArray(i[s]))return r(s);let n=$i(e.grandparent),a=e.match(e=>!(1===e[s].length&&Ii(e[s][0])),void 0,(e,t)=>"typeAnnotation"===t,e=>"Identifier"===e.type,qp);if(0===i[s].length||!a&&(n||1===i[s].length&&("NullableTypeAnnotation"===i[s][0].type||Yp(i[s][0]))))return["<",ja(", ",e.map(r,s)),Zl(e,t),">"];let o="TSTypeParameterInstantiation"===i.type?"":function(e,t,r){let{node:s}=e;return 1===dn(s).length&&s.type.startsWith("TS")&&!s[r][0].constraint&&"ArrowFunctionExpression"===e.parent.type&&!(t.filepath&&/\.ts$/u.test(t.filepath))}(e,t,s)?",":rn(t)?Sa(","):"";return Aa(["<",ga([Ba,ja([",",Na],e.map(r,s))]),o,Ba,">"],{id:Yl(i)})}function Zl(e,t){let{node:r}=e;if(!Tn(r,En.Dangling))return"";let s=!Tn(r,En.Line),i=Qu(e,t,{indent:!s});return s?i:[i,La]}function ec(e,t,r){let{node:s}=e,i=[s.const?"const ":""],n="TSTypeParameter"===s.type?r("name"):s.name;if(s.variance&&i.push(r("variance")),s.in&&i.push("in "),s.out&&i.push("out "),i.push(n),s.bound&&(s.usesExtendsBound&&i.push(" extends "),i.push(ul(e,r,"bound"))),s.constraint){let e=Symbol("constraint");i.push(" extends",Aa(ga(Na),{id:e}),wa,Pa(r("constraint"),{groupId:e}))}return s.default&&i.push(" = ",r("default")),Aa(i)}var tc=li(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function rc(e,t,r){let s,{node:i}=e,n=[Dl(e),gl(e),"class"],a=Tn(i.id,En.Trailing)||Tn(i.typeParameters,En.Trailing)||Tn(i.superClass)||Ks(i.extends)||Ks(i.mixins)||Ks(i.implements),o=[],u=[];if(i.id&&o.push(" ",r("id")),o.push(r("typeParameters")),i.superClass){let s=[oc(e,t,r),r(i.superTypeArguments?"superTypeArguments":"superTypeParameters")],n=e.call(e=>["extends ",ep(e,s,t)],"superClass");a?u.push(Na,Aa(n)):u.push(" ",n)}else u.push(ac(e,t,r,"extends"));if(u.push(ac(e,t,r,"mixins"),ac(e,t,r,"implements")),a){let e;e=nc(i)?[...o,ga(u)]:ga([...o,u]),s=sc(i),n.push(Aa(e,{id:s}))}else n.push(...o,...u);let p=i.body;return a&&Ks(p.body)?n.push(Sa(La," ",{groupId:s})):n.push(" "),n.push(r("body")),n}var sc=Gl("heritageGroup");function ic(e){return Sa(La,"",{groupId:sc(e)})}function nc(e){return e.typeParameters&&!Tn(e.typeParameters,En.Trailing|En.Line)&&!function(e){return["extends","mixins","implements"].reduce((t,r)=>t+(Array.isArray(e[r])?e[r].length:0),e.superClass?1:0)>1}(e)}function ac(e,t,r,s){let{node:i}=e;if(!Ks(i[s]))return"";let n=Qu(e,t,{marker:s});return[nc(i)?Sa(" ",Na,{groupId:Yl(i.typeParameters)}):Na,n,n&&La,s,Aa(ga([Na,ja([",",Na],e.map(r,s))]))]}function oc(e,t,r){let s=r("superClass"),{parent:i}=e;return"AssignmentExpression"===i.type?Aa(Sa(["(",ga([Ba,s]),Ba,")"],s)):s}function uc(e,t,r){let{node:s}=e,i=[];return Ks(s.decorators)&&i.push(Fp(e,t,r)),i.push(Fl(s)),s.static&&i.push("static "),i.push(gl(e)),s.override&&i.push("override "),i.push(_l(e,t,r)),i}function pc(e,t,r){let{node:s}=e,i=[],n=t.semi?";":"";return Ks(s.decorators)&&i.push(Fp(e,t,r)),i.push(Dl(e),Fl(s)),s.static&&i.push("static "),i.push(gl(e)),s.override&&i.push("override "),s.readonly&&i.push("readonly "),s.variance&&i.push(r("variance")),("ClassAccessorProperty"===s.type||"AccessorProperty"===s.type||"TSAbstractAccessorProperty"===s.type)&&i.push("accessor "),i.push(Ol(e,t,r),ml(e),yl(e),ul(e,r)),[Rp(e,t,r,i," =","TSAbstractPropertyDefinition"===s.type||"TSAbstractAccessorProperty"===s.type?void 0:"value"),n]}function lc(e,t,r){let{node:s}=e,i=[];return e.each(({node:e,next:s,isLast:n})=>{i.push(r()),!t.semi&&tc(e)&&function(e,t){var r;let{type:s,name:i}=e.key;if(!(e.computed||"Identifier"!==s||"static"!==i&&"get"!==i&&"set"!==i||e.value||e.typeAnnotation))return!0;if(!t||t.static||t.accessibility||t.readonly)return!1;if(!t.computed){let e=null==(r=t.key)?void 0:r.name;if("in"===e||"instanceof"===e)return!0}if(tc(t)&&t.variance&&!t.static&&!t.declare)return!0;switch(t.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return t.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((t.value?t.value.async:t.async)||"get"===t.kind||"set"===t.kind)return!1;let e=t.value?t.value.generator:t.generator;return!(!t.computed&&!e)}case"TSIndexSignature":return!0}return!1}(e,s)&&i.push(";"),n||(i.push(La),Fn(e,t)&&i.push(La))},"body"),Tn(s,En.Dangling)&&i.push(Qu(e,t)),["{",i.length>0?[ga([La,i]),La]:"","}"]}var cc=li(["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"]);function hc(e){return cc(e)?hc(e.expression):e}var dc=li(["FunctionExpression","ArrowFunctionExpression"]);function mc(e,t){if(t.semi||fc(e,t)||Dc(e,t))return!1;let{node:r,key:s,parent:i}=e;return!("ExpressionStatement"!==r.type||("body"!==s||"Program"!==i.type&&"BlockStatement"!==i.type&&"StaticBlock"!==i.type&&"TSModuleBlock"!==i.type)&&("consequent"!==s||"SwitchCase"!==i.type)||!e.call(()=>yc(e,t),"expression"))}function yc(e,t){let{node:r}=e;switch(r.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!$l(e,t))return!0;break;case"UnaryExpression":{let{prefix:e,operator:t}=r;if(e&&("+"===t||"-"===t))return!0;break}case"BindExpression":if(!r.object)return!0;break;case"Literal":if(r.regex)return!0;break;default:if(Bi(r))return!0}return!!Ku(e,t)||!!xi(r)&&e.call(()=>yc(e,t),...Ei(r))}function fc({node:e,parent:t},r){return("markdown"===r.parentParser||"mdx"===r.parentParser)&&"ExpressionStatement"===e.type&&Bi(e.expression)&&"Program"===t.type&&1===t.body.length}function Dc({node:e,parent:t},r){return("__vue_event_binding"===r.parser||"__vue_ts_event_binding"===r.parser)&&"ExpressionStatement"===e.type&&"Program"===t.type&&1===t.body.length}function xc(e,t,r){let s=[r("expression")];if(Dc(e,t)){let t=hc(e.node.expression);(dc(t)||function(e){return"MemberExpression"===e.type||"OptionalMemberExpression"===e.type||"Identifier"===e.type&&"undefined"!==e.name}(t))&&s.push(";")}else fc(e,t)||t.semi&&s.push(";");return s}function gc(e){return e.toLowerCase()}function Ec({pattern:e,flags:t}){return`/${e}/${t=[...t].sort().join("")}`}function Ac(e,t){let r=e.slice(1,-1);if(r.includes('"')||r.includes("'"))return e;let s=t.singleQuote?"'":'"';return s+r+s}var Tc=function(e,t,r){let s=e.originalText.slice(t,r);for(let i of e[Symbol.for("comments")]){let e=ri(i);if(e>r)break;let n=si(i);if(n"ExportDefaultDeclaration"===e.type||"DeclareExportDeclaration"===e.type&&e.default;function Fc(e,t,r){let{node:s}=e,i=[bp(e,0,r),Dl(e),"export",Cc(s)?" default":""],{declaration:n,exported:a}=s;return Tn(s,En.Dangling)&&(i.push(" ",Qu(e,t)),Yi(s)&&i.push(La)),n?i.push(" ",r("declaration")):(i.push(function(e){return Sc(e.exportKind)}(s)),"ExportAllDeclaration"===s.type||"DeclareExportAllDeclaration"===s.type?(i.push(" *"),a&&i.push(" as ",r("exported"))):i.push(wc(e,t,r)),i.push(vc(e,t,r),kc(e,t,r))),i.push(function(e,t){return t.semi&&(!e.declaration||Cc(e)&&!bc(e.declaration))?";":""}(s,t)),i}var bc=li(["ClassDeclaration","ComponentDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","HookDeclaration","TSDeclareFunction","EnumDeclaration"]);function Sc(e,t=!0){return e&&"value"!==e?`${t?" ":""}${e}${t?"":" "}`:""}function Pc(e,t){return Sc(e.importKind,t)}function vc(e,t,r){let{node:s}=e;if(!s.source)return"";let i=[];return Ic(s,t)&&i.push(" from"),i.push(" ",r("source")),i}function wc(e,t,r){let{node:s}=e;if(!Ic(s,t))return"";let i=[" "];if(Ks(s.specifiers)){let n=[],a=[];e.each(()=>{let t=e.node.type;if("ExportNamespaceSpecifier"===t||"ExportDefaultSpecifier"===t||"ImportNamespaceSpecifier"===t||"ImportDefaultSpecifier"===t)n.push(r());else{if("ExportSpecifier"!==t&&"ImportSpecifier"!==t)throw new rp(s,"specifier");a.push(r())}},"specifiers"),i.push(ja(", ",n)),a.length>0&&(n.length>0&&i.push(", "),a.length>1||n.length>0||s.specifiers.some(e=>Tn(e))?i.push(Aa(["{",ga([t.bracketSpacing?Na:Ba,ja([",",Na],a)]),Sa(rn(t)?",":""),t.bracketSpacing?Na:Ba,"}"])):i.push(["{",t.bracketSpacing?" ":"",...a,t.bracketSpacing?" ":"","}"]))}else i.push("{}");return i}function Ic(e,t){return!("ImportDeclaration"===e.type&&!Ks(e.specifiers)&&"type"!==e.importKind)||Tc(t,ri(e),ri(e.source)).trimEnd().endsWith("from")}function kc(e,t,r){let{node:s}=e;if(!s.source)return"";let i=function(e,t){var r,s;if(null!=(r=e.extra)&&r.deprecatedAssertSyntax)return"assert";let i=Tc(t,si(e.source),null!=(s=e.attributes)&&s[0]?ri(e.attributes[0]):si(e)).trimStart();return i.startsWith("assert")?"assert":i.startsWith("with")||Ks(e.attributes)?"with":void 0}(s,t);if(!i)return"";let n=[` ${i} {`];return Ks(s.attributes)&&(t.bracketSpacing&&n.push(" "),n.push(ja(", ",e.map(r,"attributes"))),t.bracketSpacing&&n.push(" ")),n.push("}"),n}function Nc(e,t,r){let{node:s}=e,{type:i}=s,n=i.startsWith("Import"),a=n?"imported":"local",o=n?"local":"exported",u=s[a],p=s[o],l="",c="";return"ExportNamespaceSpecifier"===i||"ImportNamespaceSpecifier"===i?l="*":u&&(l=r(a)),p&&!function(e){if("ImportSpecifier"!==e.type&&"ExportSpecifier"!==e.type)return!1;let{local:t,["ImportSpecifier"===e.type?"imported":"exported"]:r}=e;if(t.type!==r.type||!ni(t,r))return!1;if(Si(t))return t.value===r.value&&ci(t)===ci(r);if("Identifier"===t.type)return t.name===r.name;return!1}(s)&&(c=r(o)),[Sc("ImportSpecifier"===i?s.importKind:s.exportKind,!1),l,l&&c?" as ":"",c]}function Bc(e,t,r){var s;let i=t.semi?";":"",{node:n}=e,a="ObjectTypeAnnotation"===n.type,o="TSEnumBody"===n.type||"EnumBooleanBody"===n.type||"EnumNumberBody"===n.type||"EnumBigIntBody"===n.type||"EnumStringBody"===n.type||"EnumSymbolBody"===n.type,u=["TSTypeLiteral"===n.type||o?"members":"TSInterfaceBody"===n.type?"body":"properties"];a&&u.push("indexers","callProperties","internalSlots");let p=u.flatMap(t=>e.map(({node:e})=>({node:e,printed:r(),loc:ri(e)}),t));u.length>1&&p.sort((e,t)=>e.loc-t.loc);let{parent:l,key:c}=e,h=a&&"body"===c&&("InterfaceDeclaration"===l.type||"DeclareInterface"===l.type||"DeclareClass"===l.type),d="TSInterfaceBody"===n.type||o||h||"ObjectPattern"===n.type&&"FunctionDeclaration"!==l.type&&"FunctionExpression"!==l.type&&"ArrowFunctionExpression"!==l.type&&"ObjectMethod"!==l.type&&"ClassMethod"!==l.type&&"ClassPrivateMethod"!==l.type&&"AssignmentPattern"!==l.type&&"CatchClause"!==l.type&&n.properties.some(e=>e.value&&("ObjectPattern"===e.value.type||"ArrayPattern"===e.value.type))||"ObjectPattern"!==n.type&&"preserve"===t.objectWrap&&p.length>0&&Xa(t.originalText,ri(n),p[0].loc),m=h?";":"TSInterfaceBody"===n.type||"TSTypeLiteral"===n.type?Sa(i,";"):",",y=n.exact?"{|":"{",f=n.exact?"|}":"}",D=[],x=p.map(e=>{let r=[...D,Aa(e.printed)];return D=[m,Na],("TSPropertySignature"===e.node.type||"TSMethodSignature"===e.node.type||"TSConstructSignatureDeclaration"===e.node.type||"TSCallSignatureDeclaration"===e.node.type)&&Tn(e.node,En.PrettierIgnore)&&D.shift(),Fn(e.node,t)&&D.push(La),r});if(n.inexact||n.hasUnknownMembers){let r;if(Tn(n,En.Dangling)){let s=Tn(n,En.Line);r=[Qu(e,t),s||Vs(t.originalText,si(Ns(!1,Cn(n),-1)))?La:Na,"..."]}else r=["..."];x.push([...D,...r])}let g,E=null==(s=Ns(!1,p,-1))?void 0:s.node,A=!(n.inexact||n.hasUnknownMembers||E&&("RestElement"===E.type||("TSPropertySignature"===E.type||"TSCallSignatureDeclaration"===E.type||"TSMethodSignature"===E.type||"TSConstructSignatureDeclaration"===E.type||"TSIndexSignature"===E.type)&&Tn(E,En.PrettierIgnore))||e.match(void 0,(e,t)=>"TSImportType"===e.type&&"options"===t));if(0===x.length){if(!Tn(n,En.Dangling))return[y,f,ul(e,r)];g=Aa([y,Qu(e,t,{indent:!0}),Ba,f,ml(e),ul(e,r)])}else g=[h&&Ks(n.properties)?ic(l):"",y,ga([t.bracketSpacing?Na:Ba,...x]),Sa(A&&(","!==m||rn(t))?m:""),t.bracketSpacing?Na:Ba,f,ml(e),ul(e,r)];return e.match(e=>"ObjectPattern"===e.type&&!Ks(e.decorators),Lc)||Ii(n)&&(e.match(void 0,(e,t)=>"typeAnnotation"===t,(e,t)=>"typeAnnotation"===t,Lc)||e.match(void 0,(e,t)=>"FunctionTypeParam"===e.type&&"typeAnnotation"===t,Lc))||!d&&e.match(e=>"ObjectPattern"===e.type,e=>"AssignmentExpression"===e.type||"VariableDeclarator"===e.type)?g:Aa(g,{shouldBreak:d})}function Lc(e,t){return("params"===t||"parameters"===t||"this"===t||"rest"===t)&&zp(e)}function Mc(e,t,r){let{node:s}=e,i="ConditionalExpression"===s.type,n=i?"alternate":"falseType",{parent:a}=e,o=i?r("test"):[r("checkType")," ","extends"," ",r("extendsType")];return a.type===s.type&&a[n]===s?Ea(2,o):o}var Oc=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function jc(e,t,r){let s,i,{node:n}=e,a="ConditionalExpression"===n.type,o=a?"consequent":"trueType",u=a?"alternate":"falseType",p=a?["test"]:["checkType","extendsType"],l=n[o],c=n[u],h=[],d=!1,{parent:m}=e,y=m.type===n.type&&p.some(e=>m[e]===n),f=m.type===n.type&&!y,D=0;do{i=s||n,s=e.getParentNode(D),D++}while(s&&s.type===n.type&&p.every(e=>s[e]!==i));let x=s||m,g=i;if(a&&(Bi(n[p[0]])||Bi(l)||Bi(c)||function(e){let t=[e];for(let e=0;e[Sa("("),ga([Ba,e]),Ba,Sa(")")],t=e=>"NullLiteral"===e.type||"Literal"===e.type&&null===e.value||"Identifier"===e.type&&"undefined"===e.name;h.push(" ? ",t(l)?r(o):e(r(o))," : ",c.type===n.type||t(c)?r(u):e(r(u)))}else{let e=e=>t.useTabs?ga(r(e)):Ea(2,r(e)),s=[Na,"? ",l.type===n.type?Sa("","("):"",e(o),l.type===n.type?Sa("",")"):"",Na,": ",e(u)];h.push(m.type!==n.type||m[u]===n||y?s:t.useTabs?Ca(ga(s)):Ea(Math.max(0,t.tabWidth-2),s))}let E=[o,u,...p].some(e=>Tn(n[e],e=>hi(e)&&Xa(t.originalText,ri(e),si(e)))),A=!d&&(Vi(m)||"NGPipeExpression"===m.type&&m.left===n)&&!m.computed,T=function(e){let{node:t}=e;if("ConditionalExpression"!==t.type)return!1;let r,s=t;for(let t=0;!r;t++){let i=e.getParentNode(t);"ChainExpression"===i.type&&i.expression===s||Ji(i)&&i.callee===s||Vi(i)&&i.object===s||"TSNonNullExpression"===i.type&&i.expression===s?s=i:"NewExpression"===i.type&&i.callee===s||Pn(i)&&i.expression===s?(r=e.getParentNode(t+1),s=i):r=i}return s!==t&&r[Oc.get(r.type)]===s}(e),C=(e=>m===x?Aa(e,{shouldBreak:E}):E?[e,Ia]:e)([Mc(e,0,r),f?h:ga(h),a&&A&&!T?Ba:""]);return y||T?Aa([ga([Ba,C]),Ba]):C}var Rc=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);var _c=e=>[Sa("("),ga([Ba,e]),Ba,Sa(")")];function Uc(e,t,r,s){if(!t.experimentalTernaries)return jc(e,t,r);let i,n,{node:a}=e,o="ConditionalExpression"===a.type,u=In(a),p=o?"consequent":"trueType",l=o?"alternate":"falseType",c=o?["test"]:["checkType","extendsType"],h=a[p],d=a[l],m=c.map(e=>a[e]),{parent:y}=e,f=y.type===a.type,D=f&&c.some(e=>y[e]===a),x=f&&y[l]===a,g=h.type===a.type,E=d.type===a.type,A=E||x,T=t.tabWidth>2||t.useTabs,C=0;do{n=i||a,i=e.getParentNode(C),C++}while(i&&i.type===a.type&&c.every(e=>i[e]!==n));let F=i||y,b=s&&s.assignmentLayout&&"break-after-operator"!==s.assignmentLayout&&("AssignmentExpression"===y.type||"VariableDeclarator"===y.type||"ClassProperty"===y.type||"PropertyDefinition"===y.type||"ClassPrivateProperty"===y.type||"ObjectProperty"===y.type||"Property"===y.type),S=("ReturnStatement"===y.type||"ThrowStatement"===y.type)&&!(g||E),P=o&&"JSXExpressionContainer"===F.type&&"JSXAttribute"!==e.grandparent.type,v=function(e){let{node:t}=e;if("ConditionalExpression"!==t.type)return!1;let r,s=t;for(let t=0;!r;t++){let i=e.getParentNode(t);"ChainExpression"===i.type&&i.expression===s||Ji(i)&&i.callee===s||Vi(i)&&i.object===s||"TSNonNullExpression"===i.type&&i.expression===s?s=i:"NewExpression"===i.type&&i.callee===s||Pn(i)&&i.expression===s?(r=e.getParentNode(t+1),s=i):r=i}return s!==t&&r[Rc.get(r.type)]===s}(e),w=function(e,t){return(Vi(t)||"NGPipeExpression"===t.type&&t.left===e)&&!t.computed}(a,y),I=u&&Ku(e,t),k=T?t.useTabs?"\t":" ".repeat(t.tabWidth-1):"",N=function(e,t,r,s){return[...e.map(e=>Cn(e)),Cn(t),Cn(r)].flat().some(e=>hi(e)&&Xa(s.originalText,ri(e),si(e)))}(m,h,d,t)||g||E,B=!A&&!f&&!u&&(P?"NullLiteral"===h.type||"Literal"===h.type&&null===h.value:zi(h,t)&&Hi(a.test,3)),L=A||x||u&&!f||f&&o&&Hi(a.test,1)||B,M=[];!g&&Tn(h,En.Dangling)&&e.call(e=>{M.push(Qu(e,t),La)},"consequent");let O=[];Tn(a.test,En.Dangling)&&e.call(e=>{O.push(Qu(e,t))},"test"),!E&&Tn(d,En.Dangling)&&e.call(e=>{O.push(Qu(e,t))},"alternate"),Tn(a,En.Dangling)&&O.push(Qu(e,t));let j=Symbol("test"),R=Symbol("consequent"),_=Symbol("test-and-consequent"),U=o?[_c(r("test")),"ConditionalExpression"===a.test.type?Ia:""]:[r("checkType")," ","extends"," ",In(a.extendsType)||"TSMappedType"===a.extendsType.type?r("extendsType"):Aa(_c(r("extendsType")))],$=Aa([U," ?"],{id:j}),q=r(p),J=ga([g||P&&(Bi(h)||f||A)?La:Na,M,q]),V=L?Aa([$,A?J:Sa(J,Aa(J,{id:R}),{groupId:j})],{id:_}):[$,J],H=r(l),W=B?Sa(H,Ca(_c(H)),{groupId:_}):H,z=[V,O.length>0?[ga([La,O]),La]:E?La:B?Sa(Na," ",{groupId:_}):Na,":",E?" ":T?L?Sa(k,Sa(A||B?" ":k," "),{groupId:_}):Sa(k," "):" ",E?W:Aa([ga(W),P&&!B?Ba:""]),w&&!v?Ba:"",N?Ia:""];return b&&!N?Aa(ga([Ba,Aa(z)])):b||S?Aa(ga(z)):v||u&&D?Aa([ga([Ba,z]),I?Ba:""]):y===F?Aa(z):z}function $c(e,t,r,s){let{node:i}=e;if(vi(i))return function(e,t){let{node:r}=e;switch(r.type){case"RegExpLiteral":return Ec(r);case"BigIntLiteral":return gc(r.extra.raw);case"NumericLiteral":return Nl(r.extra.raw);case"StringLiteral":return ca(ei(r.extra.raw,t));case"NullLiteral":return"null";case"BooleanLiteral":return String(r.value);case"DirectiveLiteral":return Ac(r.extra.raw,t);case"Literal":{if(r.regex)return Ec(r.regex);if(r.bigint)return gc(r.raw);let{value:s}=r;return"number"==typeof s?Nl(r.raw):"string"==typeof s?function(e){if("expression"!==e.key)return;let{parent:t}=e;return"ExpressionStatement"===t.type&&"string"==typeof t.directive}(e)?Ac(r.raw,t):ca(ei(r.raw,t)):String(s)}}}(e,t);let n=t.semi?";":"",a=[];switch(i.type){case"JsExpressionRoot":return r("node");case"JsonRoot":return[Qu(e,t),r("node"),La];case"File":return function(e,t,r){if(t.__isVueBindings||t.__isVueForBindingLeft){let s=e.map(r,"program","body",0,"params");if(1===s.length)return s[0];let i=ja([",",Na],s);return t.__isVueForBindingLeft?["(",ga([Ba,Aa(i)]),Ba,")"]:i}if(t.__isEmbeddedTypescriptGenericParameters){let t=e.map(r,"program","body",0,"typeParameters","params");return ja([",",Na],t)}}(e,t,r)??r("program");case"EmptyStatement":return"";case"ExpressionStatement":return xc(e,t,r);case"ChainExpression":return r("expression");case"ParenthesizedExpression":return Tn(i.expression)||!Ci(i.expression)&&!Ti(i.expression)?Aa(["(",ga([Ba,r("expression")]),Ba,")"]):["(",r("expression"),")"];case"AssignmentExpression":return function(e,t,r){let{node:s}=e;return Rp(e,t,r,r("left"),[" ",s.operator],"right")}(e,t,r);case"VariableDeclarator":return function(e,t,r){return Rp(e,t,r,r("id")," =","init")}(e,t,r);case"BinaryExpression":case"LogicalExpression":return Dp(e,t,r);case"AssignmentPattern":return[r("left")," = ",r("right")];case"OptionalMemberExpression":case"MemberExpression":return Bp(e,t,r);case"MetaProperty":return[r("meta"),".",r("property")];case"BindExpression":return i.object&&a.push(r("object")),a.push(Aa(ga([Ba,Al(0,0,r)]))),a;case"Identifier":return[i.name,ml(e),yl(e),ul(e,r)];case"V8IntrinsicIdentifier":return["%",i.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return Cl(e,r);case"FunctionDeclaration":case"FunctionExpression":return Rl(e,t,r,s);case"ArrowFunctionExpression":return Wl(e,t,r,s);case"YieldExpression":return a.push("yield"),i.delegate&&a.push("*"),i.argument&&a.push(" ",r("argument")),a;case"AwaitExpression":if(a.push("await"),i.argument){a.push(" ",r("argument"));let{parent:t}=e;if(Ji(t)&&t.callee===i||Vi(t)&&t.object===i){a=[ga([Ba,...a]),Ba];let t=e.findAncestor(e=>"AwaitExpression"===e.type||"BlockStatement"===e.type);if("AwaitExpression"!==(null==t?void 0:t.type)||!sn(t.argument,e=>e===i))return Aa(a)}}return a;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return Fc(e,t,r);case"ImportDeclaration":return function(e,t,r){let{node:s}=e;return["import",s.phase?` ${s.phase}`:"",Pc(s),wc(e,t,r),vc(e,t,r),kc(e,t,r),t.semi?";":""]}(e,t,r);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return Nc(e,0,r);case"ImportAttribute":case"ObjectProperty":return jl(e,t,r);case"Program":case"BlockStatement":case"StaticBlock":return Xl(e,t,r);case"ClassBody":return lc(e,t,r);case"ThrowStatement":return function(e,t,r){return["throw",Jl(e,t,r)]}(e,t,r);case"ReturnStatement":return function(e,t,r){return["return",Jl(e,t,r)]}(e,t,r);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return Op(e,t,r);case"ObjectExpression":case"ObjectPattern":return Bc(e,t,r);case"Property":return Li(i)?_l(e,t,r):jl(e,t,r);case"ObjectMethod":return _l(e,t,r);case"Decorator":return["@",r("expression")];case"ArrayExpression":case"ArrayPattern":return bl(e,t,r);case"SequenceExpression":{let{parent:t}=e;if("ExpressionStatement"===t.type||"ForStatement"===t.type){let t=[];return e.each(({isFirst:e})=>{e?t.push(r()):t.push(",",ga([Na,r()]))},"expressions"),Aa(t)}let s=ja([",",Na],e.map(r,"expressions"));return("ReturnStatement"===t.type||"ThrowStatement"===t.type)&&"argument"===e.key||"ArrowFunctionExpression"===t.type&&"body"===e.key?Aa(Sa([ga([Ba,s]),Ba],s)):Aa(s)}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[r("value"),n];case"UnaryExpression":return a.push(i.operator),/[a-z]$/u.test(i.operator)&&a.push(" "),Tn(i.argument)?a.push(Aa(["(",ga([Ba,r("argument")]),Ba,")"])):a.push(r("argument")),a;case"UpdateExpression":return[i.prefix?i.operator:"",r("argument"),i.prefix?"":i.operator];case"ConditionalExpression":return Uc(e,t,r,s);case"VariableDeclaration":{let t,s=e.map(r,"declarations"),o=e.parent,u="ForStatement"===o.type||"ForInStatement"===o.type||"ForOfStatement"===o.type,p=i.declarations.some(e=>e.init);return 1!==s.length||Tn(i.declarations[0])?s.length>0&&(t=ga(s[0])):t=s[0],a=[Dl(e),i.kind,t?[" ",t]:"",ga(s.slice(1).map(e=>[",",p&&!u?La:Na,e]))],u&&o.body!==i||a.push(n),Aa(a)}case"WithStatement":return Aa(["with (",r("object"),")",Tl(i.body,r("body"))]);case"IfStatement":{let s=Tl(i.consequent,r("consequent")),n=Aa(["if (",Aa([ga([Ba,r("test")]),Ba]),")",s]);if(a.push(n),i.alternate){let s=Tn(i.consequent,En.Trailing|En.Line)||Yi(i),n="BlockStatement"===i.consequent.type&&!s;a.push(n?" ":La),Tn(i,En.Dangling)&&a.push(Qu(e,t),s?La:" "),a.push("else",Aa(Tl(i.alternate,r("alternate"),"IfStatement"===i.alternate.type)))}return a}case"ForStatement":{let s=Tl(i.body,r("body")),n=Qu(e,t),a=n?[n,Ba]:"";return i.init||i.test||i.update?[a,Aa(["for (",Aa([ga([Ba,r("init"),";",Na,r("test"),";",Na,r("update")]),Ba]),")",s])]:[a,Aa(["for (;;)",s])]}case"WhileStatement":return Aa(["while (",Aa([ga([Ba,r("test")]),Ba]),")",Tl(i.body,r("body"))]);case"ForInStatement":return Aa(["for (",r("left")," in ",r("right"),")",Tl(i.body,r("body"))]);case"ForOfStatement":return Aa(["for",i.await?" await":""," (",r("left")," of ",r("right"),")",Tl(i.body,r("body"))]);case"DoWhileStatement":return a=[Aa(["do",Tl(i.body,r("body"))])],"BlockStatement"===i.body.type?a.push(" "):a.push(La),a.push("while (",Aa([ga([Ba,r("test")]),Ba]),")",n),a;case"DoExpression":return[i.async?"async ":"","do ",r("body")];case"BreakStatement":case"ContinueStatement":return a.push("BreakStatement"===i.type?"break":"continue"),i.label&&a.push(" ",r("label")),a.push(n),a;case"LabeledStatement":return"EmptyStatement"===i.body.type?[r("label"),":;"]:[r("label"),": ",r("body")];case"TryStatement":return["try ",r("block"),i.handler?[" ",r("handler")]:"",i.finalizer?[" finally ",r("finalizer")]:""];case"CatchClause":if(i.param){let e=Tn(i.param,e=>!hi(e)||e.leading&&Vs(t.originalText,si(e))||e.trailing&&Vs(t.originalText,ri(e),{backwards:!0})),s=r("param");return["catch ",e?["(",ga([Ba,s]),Ba,") "]:["(",s,") "],r("body")]}return["catch ",r("body")];case"SwitchStatement":return[Aa(["switch (",ga([Ba,r("discriminant")]),Ba,")"])," {",i.cases.length>0?ga([La,ja(La,e.map(({node:e,isLast:s})=>[r(),!s&&Fn(e,t)?La:""],"cases"))]):"",La,"}"];case"SwitchCase":{i.test?a.push("case ",r("test"),":"):a.push("default:"),Tn(i,En.Dangling)&&a.push(" ",Qu(e,t));let s=i.consequent.filter(e=>"EmptyStatement"!==e.type);if(s.length>0){let i=Kl(e,t,r,"consequent");a.push(1===s.length&&"BlockStatement"===s[0].type?[" ",i]:ga([La,i]))}return a}case"DebuggerStatement":return["debugger",n];case"ClassDeclaration":case"ClassExpression":return rc(e,t,r);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return uc(e,t,r);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return pc(e,t,r);case"TemplateElement":return ca(i.value.raw);case"TemplateLiteral":return au(e,t,r);case"TaggedTemplateExpression":return function(e,t,r){let s=r("quasi"),{node:i}=e,n="",a=Cn(i.quasi,En.Leading)[0];return a&&(n=Xa(t.originalText,si(i.typeArguments??i.typeParameters??i.tag),ri(a))?Ba:" "),Ra(s.label&&{tagged:!0,...s.label},[r("tag"),r(i.typeArguments?"typeArguments":"typeParameters"),n,wa,s])}(e,t,r);case"PrivateIdentifier":return["#",i.name];case"PrivateName":return["#",r("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":return["module ",r("body")];default:throw new rp(i,"ESTree")}}function qc(e,t,r){let{parent:s,node:i,key:n}=e,a=[r("expression")];switch(i.type){case"AsConstExpression":a.push(" as const");break;case"AsExpression":case"TSAsExpression":a.push(" as ",r("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":a.push(" satisfies ",r("typeAnnotation"))}return"callee"===n&&Ji(s)||"object"===n&&Vi(s)?Aa([ga([Ba,...a]),Ba]):a}function Jc(e,t,r){let{node:s}=e,i=[Dl(e),"component"];s.id&&i.push(" ",r("id")),i.push(r("typeParameters"));let n=function(e,t,r){let{node:s}=e,i=s.params;if(s.rest&&(i=[...i,s.rest]),0===i.length)return["(",Qu(e,t,{filter:e=>")"===Ka(t.originalText,si(e))}),")"];let n=[];return function(e,t){let{node:r}=e,s=0,i=e=>t(e,s++);e.each(i,"params"),r.rest&&e.call(i,"rest")}(e,(e,a)=>{let o=a===i.length-1;o&&s.rest&&n.push("..."),n.push(r()),!o&&(n.push(","),Fn(i[a],t)?n.push(La,La):n.push(Na))}),["(",ga([Ba,...n]),Sa(rn(t,"all")&&!Vc(s,i)?",":""),Ba,")"]}(e,t,r);return s.rendersType?i.push(Aa([n," ",r("rendersType")])):i.push(Aa([n])),s.body&&i.push(" ",r("body")),t.semi&&"DeclareComponent"===s.type&&i.push(";"),i}function Vc(e,t){var r;return e.rest||"RestElement"===(null==(r=Ns(!1,t,-1))?void 0:r.type)}function Hc(e,t,r){return Bc(e,t,r)}function Wc(e,t){let{node:r}=e,s=t("id");r.computed&&(s=["[",s,"]"]);let i="";return r.initializer&&(i=t("initializer")),r.init&&(i=t("init")),i?[s," = ",i]:s}function zc(e,t){let{node:r}=e;return[Dl(e),r.const?"const ":"","enum ",t("id")," ",t("body")]}function Kc(e){var t;let{node:r}=e;return"HookTypeAnnotation"===r.type&&"DeclareHook"===(null==(t=e.getParentNode(2))?void 0:t.type)}function Xc(e,t,r){let{node:s}=e,i=[Dl(e),"interface"],n=[],a=[];"InterfaceTypeAnnotation"!==s.type&&n.push(" ",r("id"),r("typeParameters"));let o=s.typeParameters&&!Tn(s.typeParameters,En.Trailing|En.Line);return Ks(s.extends)&&a.push(o?Sa(" ",Na,{groupId:Yl(s.typeParameters)}):Na,"extends ",(1===s.extends.length?tn:ga)(ja([",",Na],e.map(r,"extends")))),Tn(s.id,En.Trailing)||Ks(s.extends)?o?i.push(Aa([...n,ga(a)])):i.push(Aa(ga([...n,...a]))):i.push(...n,...a),i.push(" ",r("body")),Aa(i)}function Gc(e){switch(e){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function Yc(e,t){return"+"===e||"-"===e?e+t:t}function Qc(e,t,r){let{node:s}=e;if(di(s))return s.type.slice(0,-14).toLowerCase();let i=t.semi?";":"";switch(s.type){case"ComponentDeclaration":case"DeclareComponent":case"ComponentTypeAnnotation":return Jc(e,t,r);case"ComponentParameter":return function(e,t,r){let{node:s}=e;return s.shorthand?r("local"):[r("name")," as ",r("local")]}(e,0,r);case"ComponentTypeParameter":return function(e,t,r){let{node:s}=e,i=[];return s.name&&i.push(r("name"),s.optional?"?: ":": "),i.push(r("typeAnnotation")),i}(e,0,r);case"HookDeclaration":return function(e,t,r){let{node:s}=e,i=["hook"];s.id&&i.push(" ",r("id"));let n=Wp(e,t,r,!1,!0),a=ql(e,r),o=Kp(s,a);return i.push(Aa([o?Aa(n):n,a]),s.body?" ":"",r("body")),i}(e,t,r);case"DeclareHook":return function(e,t,r){let{node:s}=e,i=[Dl(e),"hook"];return s.id&&i.push(" ",r("id")),t.semi&&i.push(";"),i}(e,t,r);case"HookTypeAnnotation":return function(e,t,r){let{node:s}=e,i=[];i.push(Kc(e)?"":"hook ");let n=Wp(e,t,r,!1,!0),a=[];return a.push(Kc(e)?": ":" => ",r("returnType")),Kp(s,a)&&(n=Aa(n)),i.push(n,a),Aa(i)}(e,t,r);case"DeclareClass":return rc(e,t,r);case"DeclareFunction":return[Dl(e),"function ",r("id"),r("predicate"),i];case"DeclareModule":return["declare module ",r("id")," ",r("body")];case"DeclareModuleExports":return["declare module.exports",ul(e,r),i];case"DeclareNamespace":return["declare namespace ",r("id")," ",r("body")];case"DeclareVariable":return[Dl(e),s.kind??"var"," ",r("id"),i];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return Fc(e,t,r);case"DeclareOpaqueType":case"OpaqueType":return function(e,t,r){let s=t.semi?";":"",{node:i}=e,n=[Dl(e),"opaque type ",r("id"),r("typeParameters")];return i.supertype&&n.push(": ",r("supertype")),i.impltype&&n.push(" = ",r("impltype")),n.push(s),n}(e,t,r);case"DeclareTypeAlias":case"TypeAlias":return Qp(e,t,r);case"IntersectionTypeAnnotation":return Zp(e,t,r);case"UnionTypeAnnotation":return el(e,t,r);case"ConditionalTypeAnnotation":return Uc(e,t,r);case"InferTypeAnnotation":return sl(0,0,r);case"FunctionTypeAnnotation":return tl(e,t,r);case"TupleTypeAnnotation":return bl(e,t,r);case"TupleTypeLabeledElement":return al(e,0,r);case"TupleTypeSpreadElement":return nl(e,0,r);case"GenericTypeAnnotation":return[r("id"),Ql(e,t,r,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return rl(e,0,r);case"TypeAnnotation":return ll(e,0,r);case"TypeParameter":return ec(e,0,r);case"TypeofTypeAnnotation":return hl(e,r);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return cl(r);case"DeclareEnum":case"EnumDeclaration":return zc(e,r);case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":return["EnumSymbolBody"===s.type||s.explicitType?`of ${s.type.slice(4,-4).toLowerCase()} `:"",Hc(e,t,r)];case"EnumBooleanMember":case"EnumNumberMember":case"EnumBigIntMember":case"EnumStringMember":case"EnumDefaultedMember":return Wc(e,r);case"FunctionTypeParam":{let t=s.name?r("name"):e.parent.this===s?"this":"";return[t,ml(e),t?": ":"",r("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return Xc(e,0,r);case"ClassImplements":case"InterfaceExtends":return[r("id"),r("typeParameters")];case"NullableTypeAnnotation":return["?",r("typeAnnotation")];case"Variance":{let{kind:e}=s;return Gs.ok("plus"===e||"minus"===e),"plus"===e?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",r("argument")];case"ObjectTypeCallProperty":return[s.static?"static ":"",r("value")];case"ObjectTypeMappedTypeProperty":return function(e,t,r){let{node:s}=e;return Aa([s.variance?r("variance"):"","[",ga([r("keyTparam")," in ",r("sourceType")]),"]",Gc(s.optional),": ",r("propType")])}(e,0,r);case"ObjectTypeIndexer":return[s.static?"static ":"",s.variance?r("variance"):"","[",r("id"),s.id?": ":"",r("key"),"]: ",r("value")];case"ObjectTypeProperty":{let i="";return s.proto?i="proto ":s.static&&(i="static "),[i,"init"!==s.kind?s.kind+" ":"",s.variance?r("variance"):"",Ol(e,t,r),ml(e),Li(s)?"":": ",r("value")]}case"ObjectTypeAnnotation":return Bc(e,t,r);case"ObjectTypeInternalSlot":return[s.static?"static ":"","[[",r("id"),"]]",ml(e),s.method?"":": ",r("value")];case"ObjectTypeSpreadProperty":return Cl(e,r);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[r("qualification"),".",r("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(s.value);case"StringLiteralTypeAnnotation":return ca(ei(ci(s),t));case"NumberLiteralTypeAnnotation":return Nl(ci(s));case"BigIntLiteralTypeAnnotation":return gc(ci(s));case"TypeCastExpression":return["(",r("expression"),ul(e,r),")"];case"TypePredicate":return dl(e,r);case"TypeOperator":return[s.operator," ",r("typeAnnotation")];case"TypeParameterDeclaration":case"TypeParameterInstantiation":return Ql(e,t,r,"params");case"InferredPredicate":case"DeclaredPredicate":return["predicate"!==e.key||"DeclareFunction"===e.parent.type||e.parent.returnType?" ":": ","%checks",..."DeclaredPredicate"===s.type?["(",r("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return qc(e,0,r)}}function Zc(e,t,r){var s;let{node:i}=e;if(!i.type.startsWith("TS"))return;if(fi(i))return i.type.slice(2,-7).toLowerCase();let n=t.semi?";":"",a=[];switch(i.type){case"TSThisType":return"this";case"TSTypeAssertion":{let e=!(Ti(i.expression)||Ci(i.expression)),t=Aa(["<",ga([Ba,r("typeAnnotation")]),Ba,">"]),s=[Sa("("),ga([Ba,r("expression")]),Ba,Sa(")")];return e?Fa([[t,r("expression")],[t,Aa(s,{shouldBreak:!0})],[t,r("expression")]]):Aa([t,r("expression")])}case"TSDeclareFunction":return Rl(e,t,r);case"TSExportAssignment":return["export = ",r("expression"),n];case"TSModuleBlock":return Xl(e,t,r);case"TSInterfaceBody":case"TSTypeLiteral":return Bc(e,t,r);case"TSTypeAliasDeclaration":return Qp(e,t,r);case"TSQualifiedName":return[r("left"),".",r("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return uc(e,t,r);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return pc(e,t,r);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[r("expression"),r(i.typeArguments?"typeArguments":"typeParameters")];case"TSTemplateLiteralType":return au(e,t,r);case"TSNamedTupleMember":return al(e,0,r);case"TSRestType":return nl(e,0,r);case"TSOptionalType":return[r("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return Xc(e,0,r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return Ql(e,t,r,"params");case"TSTypeParameter":return ec(e,0,r);case"TSAsExpression":case"TSSatisfiesExpression":return qc(e,0,r);case"TSArrayType":return cl(r);case"TSPropertySignature":return[i.readonly?"readonly ":"",Ol(e,t,r),ml(e),ul(e,r)];case"TSParameterProperty":return[Fl(i),i.static?"static ":"",i.override?"override ":"",i.readonly?"readonly ":"",r("parameter")];case"TSTypeQuery":return hl(e,r);case"TSIndexSignature":{let s=i.parameters.length>1?Sa(rn(t)?",":""):"",a=Aa([ga([Ba,ja([", ",Ba],e.map(r,"parameters"))]),s,Ba]),o="ClassBody"===e.parent.type&&"body"===e.key;return[o&&i.static?"static ":"",i.readonly?"readonly ":"","[",i.parameters?a:"","]",ul(e,r),o?n:""]}case"TSTypePredicate":return dl(e,r);case"TSNonNullExpression":return[r("expression"),"!"];case"TSImportType":return["import",Np(e,t,r),i.qualifier?[".",r("qualifier")]:"",Ql(e,t,r,i.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return r("literal");case"TSIndexedAccessType":return rl(e,0,r);case"TSTypeOperator":return[i.operator," ",r("typeAnnotation")];case"TSMappedType":return function(e,t,r){let{node:s}=e,i=!1;if("preserve"===t.objectWrap){let e=ri(s),r=e+1+Tc(t,e+1,ri(s.key)).search(/\S/u);Xa(t.originalText,e,r)&&(i=!0)}return Aa(["{",ga([t.bracketSpacing?Na:Ba,Tn(s,En.Dangling)?Aa([Qu(e,t),La]):"",Aa([s.readonly?[Yc(s.readonly,"readonly")," "]:"","[",r("key")," in ",r("constraint"),s.nameType?[" as ",r("nameType")]:"","]",s.optional?Yc(s.optional,"?"):"",s.typeAnnotation?": ":"",r("typeAnnotation")]),t.semi?Sa(";"):""]),t.bracketSpacing?Na:Ba,"}"],{shouldBreak:i})}(e,t,r);case"TSMethodSignature":{let s=i.kind&&"method"!==i.kind?`${i.kind} `:"";a.push(Fl(i),s,i.computed?"[":"",r("key"),i.computed?"]":"",ml(e));let n=Wp(e,t,r,!1,!0),o=i.returnType?"returnType":"typeAnnotation",u=i[o],p=u?ul(e,r,o):"",l=Kp(i,p);return a.push(l?Aa(n):n),u&&a.push(Aa(p)),Aa(a)}case"TSNamespaceExportDeclaration":return["export as namespace ",r("id"),t.semi?";":""];case"TSEnumDeclaration":return zc(e,r);case"TSEnumBody":return Hc(e,t,r);case"TSEnumMember":return Wc(e,r);case"TSImportEqualsDeclaration":return[i.isExport?"export ":"","import ",Pc(i,!1),r("id")," = ",r("moduleReference"),t.semi?";":""];case"TSExternalModuleReference":return["require(",r("expression"),")"];case"TSModuleDeclaration":{let{parent:t}=e,o="TSModuleDeclaration"===t.type,u="TSModuleDeclaration"===(null==(s=i.body)?void 0:s.type);return o?a.push("."):(a.push(Dl(e)),"global"!==i.kind&&a.push(i.kind," ")),a.push(r("id")),u?a.push(r("body")):i.body?a.push(" ",Aa(r("body"))):a.push(n),a}case"TSConditionalType":return Uc(e,t,r);case"TSInferType":return sl(0,0,r);case"TSIntersectionType":return Zp(e,t,r);case"TSUnionType":return el(e,t,r);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return tl(e,t,r);case"TSTupleType":return bl(e,t,r);case"TSTypeReference":return[r("typeName"),Ql(e,t,r,i.typeArguments?"typeArguments":"typeParameters")];case"TSTypeAnnotation":return ll(e,0,r);case"TSEmptyBodyFunctionExpression":return Ul(e,t,r);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return il(e,r,"?");case"TSJSDocNonNullableType":return il(e,r,"!");default:throw new rp(i,"TypeScript")}}var eh=li(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);var th=function(e,t,r,s){var i;e.isRoot&&(null==(i=t.__onHtmlBindingRoot)||i.call(t,e.node,t));let n=function(e,t,r,s){if(yp(e))return qu(e,t);for(let i of[Ap,dp,Qc,Zc,$c]){let n=i(e,t,r,s);if(void 0!==n)return n}}(e,t,r,s);if(!n)return"";let{node:a}=e;if(eh(a))return n;let o=Ks(a.decorators),u=function(e,t,r){let{node:s,parent:i}=e,{decorators:n}=s;if(!Ks(n)||Pp(i)||yp(e))return"";let a="ClassExpression"===s.type||"ClassDeclaration"===s.type||Sp(s,t);return["declaration"===e.key&&Ai(i)?La:a?Ia:"",ja(Na,e.map(r,"decorators")),Na]}(e,t,r),p="ClassExpression"===a.type;if(o&&!p)return da(n,e=>Aa([u,e]));let l=Ku(e,t),c=mc(e,t);return u||l||c?da(n,e=>[c?";":"",l?"(":"",l&&p&&o?[ga([Na,u,e]),Na]:[u,e],l?")":""]):n},rh={avoidAstMutation:!0},sh={};Ss(sh,{getVisitorKeys:()=>ih,massageAstNode:()=>uh,print:()=>nh});var ih=ui({JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]});function nh(e,t,r){let{node:s}=e;switch(s.type){case"JsonRoot":return[r("node"),La];case"ArrayExpression":{if(0===s.elements.length)return"[]";let t=e.map(()=>null===e.node?"null":r(),"elements");return["[",ga([La,ja([",",La],t)]),La,"]"]}case"ObjectExpression":return 0===s.properties.length?"{}":["{",ga([La,ja([",",La],e.map(r,"properties"))]),La,"}"];case"ObjectProperty":return[r("key"),": ",r("value")];case"UnaryExpression":return["+"===s.operator?"":s.operator,r("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return s.value?"true":"false";case"StringLiteral":return JSON.stringify(s.value);case"NumericLiteral":return ah(e)?JSON.stringify(String(s.value)):JSON.stringify(s.value);case"Identifier":return ah(e)?JSON.stringify(s.name):s.name;case"TemplateLiteral":return r(["quasis",0]);case"TemplateElement":return JSON.stringify(s.value.cooked);default:throw new rp(s,"JSON")}}function ah(e){return"key"===e.key&&"ObjectProperty"===e.parent.type}var oh=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function uh(e,t){let{type:r}=e;if("ObjectProperty"===r){let{key:r}=e;return void("Identifier"===r.type?t.key={type:"StringLiteral",value:r.name}:"NumericLiteral"===r.type&&(t.key={type:"StringLiteral",value:String(r.value)}))}if("UnaryExpression"===r&&"+"===e.operator)return t.argument;if("ArrayExpression"!==r)return"TemplateLiteral"===r?{type:"StringLiteral",value:e.quasis[0].value.cooked}:void 0;for(let[r,s]of e.elements.entries())null===s&&t.elements.splice(r,0,{type:"NullLiteral"})}uh.ignoredProperties=oh;var ph={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},lh="JavaScript",ch={arrowParens:{category:lh,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:ph.bracketSameLine,objectWrap:ph.objectWrap,bracketSpacing:ph.bracketSpacing,jsxBracketSameLine:{category:lh,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:lh,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalOperatorPosition:{category:lh,type:"choice",default:"end",description:"Where to print operators when binary expressions wrap lines.",choices:[{value:"start",description:"Print operators at the start of new lines."},{value:"end",description:"Print operators at the end of previous lines."}]},experimentalTernaries:{category:lh,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:ph.singleQuote,jsxSingleQuote:{category:lh,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:lh,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:lh,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:ph.singleAttributePerLine},hh={estree:Is,"estree-json":sh},dh=[{name:"JavaScript",type:"programming",extensions:[".js","._js",".bones",".cjs",".es",".es6",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".start.frag",".end.frag",".wxs"],tmScope:"source.js",aceMode:"javascript",aliases:["js","node"],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],filenames:["Jakefile","start.frag","end.frag"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"],linguistLanguageId:183},{name:"Flow",type:"programming",extensions:[".js.flow"],tmScope:"source.js",aceMode:"javascript",aliases:[],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],filenames:[],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"],linguistLanguageId:183},{name:"JSX",type:"programming",extensions:[".jsx"],tmScope:"source.js.jsx",aceMode:"javascript",aliases:void 0,codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",interpreters:void 0,filenames:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript",linguistLanguageId:183},{name:"TypeScript",type:"programming",extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",aliases:["ts"],codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",interpreters:["bun","deno","ts-node","tsx"],parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"],linguistLanguageId:378},{name:"TSX",type:"programming",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",group:"TypeScript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"],linguistLanguageId:94901924},{name:"JSON.stringify",type:"data",extensions:[".importmap"],tmScope:"source.json",aceMode:"json",aliases:["geojson","jsonl","sarif","topojson"],codemirrorMode:"javascript",codemirrorMimeType:"application/json",filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"],linguistLanguageId:174},{name:"JSON",type:"data",extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".json.example",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],tmScope:"source.json",aceMode:"json",aliases:["geojson","jsonl","sarif","topojson"],codemirrorMode:"javascript",codemirrorMimeType:"application/json",filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"],linguistLanguageId:174},{name:"JSON with Comments",type:"data",extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],tmScope:"source.json.comments",aceMode:"javascript",aliases:["jsonc"],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",group:"JSON",filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"],linguistLanguageId:423},{name:"JSON5",type:"data",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"],linguistLanguageId:175}],mh=ws;const yh=[{name:"preact-8.2.5.js",options:{semi:!1,useTabs:!1,parser:"babel"}},{name:"lodash.core-4.17.21.js",options:{semi:!0,useTabs:!0,parser:"babel"}},{name:"todomvc/react/app.jsx",options:{semi:!1,useTabs:!0,parser:"babel"}},{name:"todomvc/react/footer.jsx",options:{jsxBracketSameLine:!0,semi:!0,useTabs:!0,parser:"babel"}},{name:"todomvc/react/todoItem.jsx",options:{semi:!1,singleQuote:!0,useTabs:!0,parser:"babel"}}];async function fh(e){const t=yh.map(({name:t,options:r})=>({payload:e[t],options:r}));return Promise.all(t.map(({payload:e,options:t})=>Ts.format(e,{...t,plugins:[Cs,mh]})))}})(),self.WTBenchmark=s})(); \ No newline at end of file diff --git a/web-tooling-benchmark/dist/source-map.bundle.dev.js.z b/web-tooling-benchmark/dist/source-map.bundle.dev.js.z new file mode 100644 index 00000000..ff93f16e Binary files /dev/null and b/web-tooling-benchmark/dist/source-map.bundle.dev.js.z differ diff --git a/web-tooling-benchmark/dist/source-map.bundle.js b/web-tooling-benchmark/dist/source-map.bundle.js deleted file mode 100644 index 2cc7763f..00000000 --- a/web-tooling-benchmark/dist/source-map.bundle.js +++ /dev/null @@ -1,7981 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/punycode/punycode.es6.js": -/*!***********************************************!*\ - !*** ./node_modules/punycode/punycode.es6.js ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ decode: () => (/* binding */ decode), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ encode: () => (/* binding */ encode), -/* harmony export */ toASCII: () => (/* binding */ toASCII), -/* harmony export */ toUnicode: () => (/* binding */ toUnicode), -/* harmony export */ ucs2decode: () => (/* binding */ ucs2decode), -/* harmony export */ ucs2encode: () => (/* binding */ ucs2encode) -/* harmony export */ }); - - -/** Highest positive signed 32-bit float value */ -const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -const base = 36; -const tMin = 1; -const tMax = 26; -const skew = 38; -const damp = 700; -const initialBias = 72; -const initialN = 128; // 0x80 -const delimiter = '-'; // '\x2D' - -/** Regular expressions */ -const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. -const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -const errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -const baseMinusTMin = base - tMin; -const floor = Math.floor; -const stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, callback) { - const result = []; - let length = array.length; - while (length--) { - result[length] = callback(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {String} A new string of characters returned by the callback - * function. - */ -function mapDomain(domain, callback) { - const parts = domain.split('@'); - let result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - domain = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - domain = domain.replace(regexSeparators, '\x2E'); - const labels = domain.split('.'); - const encoded = map(labels, callback).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - const extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -const ucs2encode = codePoints => String.fromCodePoint(...codePoints); - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -const basicToDigit = function(codePoint) { - if (codePoint >= 0x30 && codePoint < 0x3A) { - return 26 + (codePoint - 0x30); - } - if (codePoint >= 0x41 && codePoint < 0x5B) { - return codePoint - 0x41; - } - if (codePoint >= 0x61 && codePoint < 0x7B) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -const digitToBasic = function(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -const adapt = function(delta, numPoints, firstTime) { - let k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -const decode = function(input) { - // Don't use UCS-2. - const output = []; - const inputLength = input.length; - let i = 0; - let n = initialN; - let bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (let j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - const oldi = i; - for (let w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - const digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base) { - error('invalid-input'); - } - if (digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - const baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - - } - - return String.fromCodePoint(...output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -const encode = function(input) { - const output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - const inputLength = input.length; - - // Initialize the state. - let n = initialN; - let delta = 0; - let bias = initialBias; - - // Handle the basic code points. - for (const currentValue of input) { - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - const basicLength = output.length; - let handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - let m = maxInt; - for (const currentValue of input) { - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - const handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (const currentValue of input) { - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - if (currentValue === n) { - // Represent delta as a generalized variable-length integer. - let q = delta; - for (let k = base; /* no condition */; k += base) { - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - const qMinusT = q - t; - const baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -const toUnicode = function(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -const toASCII = function(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -const punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.3.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (punycode); - - -/***/ }), - -/***/ "./node_modules/source-map/lib/array-set.js": -/*!**************************************************!*\ - !*** ./node_modules/source-map/lib/array-set.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -class ArraySet { - constructor() { - this._array = []; - this._set = new Map(); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - static fromArray(aArray, aAllowDuplicates) { - const set = new ArraySet(); - for (let i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - } - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - size() { - return this._set.size; - } - - /** - * Add the given string to this set. - * - * @param String aStr - */ - add(aStr, aAllowDuplicates) { - const isDuplicate = this.has(aStr); - const idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - this._set.set(aStr, idx); - } - } - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - has(aStr) { - return this._set.has(aStr); - } - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - indexOf(aStr) { - const idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - throw new Error('"' + aStr + '" is not in the set.'); - } - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error("No element indexed by " + aIdx); - } - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - toArray() { - return this._array.slice(); - } -} -exports.ArraySet = ArraySet; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/base64-vlq.js": -/*!***************************************************!*\ - !*** ./node_modules/source-map/lib/base64-vlq.js ***! - \***************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -const base64 = __webpack_require__(/*! ./base64 */ "./node_modules/source-map/lib/base64.js"); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -const VLQ_BASE_SHIFT = 5; - -// binary: 100000 -const VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -const VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -const VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - let encoded = ""; - let digit; - - let vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/base64.js": -/*!***********************************************!*\ - !*** ./node_modules/source-map/lib/base64.js ***! - \***********************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -const intToCharMap = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/binary-search.js": -/*!******************************************************!*\ - !*** ./node_modules/source-map/lib/binary-search.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - const mid = Math.floor((aHigh - aLow) / 2) + aLow; - const cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias === exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } - return mid; - } - - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } - return aLow < 0 ? -1 : aLow; -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - let index = recursiveSearch( - -1, - aHaystack.length, - aNeedle, - aHaystack, - aCompare, - aBias || exports.GREATEST_LOWER_BOUND - ); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element to - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/mapping-list.js": -/*!*****************************************************!*\ - !*** ./node_modules/source-map/lib/mapping-list.js ***! - \*****************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -const util = __webpack_require__(/*! ./util */ "./node_modules/source-map/lib/util.js"); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - const lineA = mappingA.generatedLine; - const lineB = mappingB.generatedLine; - const columnA = mappingA.generatedColumn; - const columnB = mappingB.generatedColumn; - return ( - lineB > lineA || - (lineB == lineA && columnB >= columnA) || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0 - ); -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a negligible overhead in general - * case for a large speedup in case of mappings being added in order. - */ -class MappingList { - constructor() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = { generatedLine: -1, generatedColumn: 0 }; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - unsortedForEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - } - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - } - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - } -} - -exports.MappingList = MappingList; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/read-wasm-browser.js": -/*!**********************************************************!*\ - !*** ./node_modules/source-map/lib/read-wasm-browser.js ***! - \**********************************************************/ -/***/ ((module) => { - -"use strict"; - - -let mappingsWasm = null; - -module.exports = function readWasm() { - if (typeof mappingsWasm === "string") { - return fetch(mappingsWasm).then(response => response.arrayBuffer()); - } - if (mappingsWasm instanceof ArrayBuffer) { - return Promise.resolve(mappingsWasm); - } - - throw new Error( - "You must provide the string URL or ArrayBuffer contents " + - "of lib/mappings.wasm by calling " + - "SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) " + - "before using SourceMapConsumer" - ); -}; - -module.exports.initialize = input => { - mappingsWasm = input; -}; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/source-map-consumer.js": -/*!************************************************************!*\ - !*** ./node_modules/source-map/lib/source-map-consumer.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -const util = __webpack_require__(/*! ./util */ "./node_modules/source-map/lib/util.js"); -const binarySearch = __webpack_require__(/*! ./binary-search */ "./node_modules/source-map/lib/binary-search.js"); -const ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/source-map/lib/array-set.js").ArraySet); -const base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/source-map/lib/base64-vlq.js"); // eslint-disable-line no-unused-vars -const readWasm = __webpack_require__(/*! ../lib/read-wasm */ "./node_modules/source-map/lib/read-wasm-browser.js"); -const wasm = __webpack_require__(/*! ./wasm */ "./node_modules/source-map/lib/wasm.js"); - -const INTERNAL = Symbol("smcInternal"); - -class SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - // If the constructor was called by super(), just return Promise. - // Yes, this is a hack to retain the pre-existing API of the base-class - // constructor also being an async factory function. - if (aSourceMap == INTERNAL) { - return Promise.resolve(this); - } - - return _factory(aSourceMap, aSourceMapURL); - } - - static initialize(opts) { - readWasm.initialize(opts["lib/mappings.wasm"]); - } - - static fromSourceMap(aSourceMap, aSourceMapURL) { - return _factoryBSM(aSourceMap, aSourceMapURL); - } - - /** - * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl` - * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async - * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait - * for `f` to complete, call `destroy` on the consumer, and return `f`'s return - * value. - * - * You must not use the consumer after `f` completes! - * - * By using `with`, you do not have to remember to manually call `destroy` on - * the consumer, since it will be called automatically once `f` completes. - * - * ```js - * const xSquared = await SourceMapConsumer.with( - * myRawSourceMap, - * null, - * async function (consumer) { - * // Use `consumer` inside here and don't worry about remembering - * // to call `destroy`. - * - * const x = await whatever(consumer); - * return x * x; - * } - * ); - * - * // You may not use that `consumer` anymore out here; it has - * // been destroyed. But you can use `xSquared`. - * console.log(xSquared); - * ``` - */ - static async with(rawSourceMap, sourceMapUrl, f) { - const consumer = await new SourceMapConsumer(rawSourceMap, sourceMapUrl); - try { - return await f(consumer); - } finally { - consumer.destroy(); - } - } - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - eachMapping(aCallback, aContext, aOrder) { - throw new Error("Subclasses must implement eachMapping"); - } - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - allGeneratedPositionsFor(aArgs) { - throw new Error("Subclasses must implement allGeneratedPositionsFor"); - } - - destroy() { - throw new Error("Subclasses must implement destroy"); - } -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -class BasicSourceMapConsumer extends SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - return super(INTERNAL).then(that => { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const version = util.getArg(sourceMap, "version"); - const sources = util.getArg(sourceMap, "sources").map(String); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - const names = util.getArg(sourceMap, "names", []); - const sourceRoot = util.getArg(sourceMap, "sourceRoot", null); - const sourcesContent = util.getArg(sourceMap, "sourcesContent", null); - const mappings = util.getArg(sourceMap, "mappings"); - const file = util.getArg(sourceMap, "file", null); - const x_google_ignoreList = util.getArg( - sourceMap, - "x_google_ignoreList", - null - ); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != that._version) { - throw new Error("Unsupported version: " + version); - } - - that._sourceLookupCache = new Map(); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - that._names = ArraySet.fromArray(names.map(String), true); - that._sources = ArraySet.fromArray(sources, true); - - that._absoluteSources = ArraySet.fromArray( - that._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }), - true - ); - - that.sourceRoot = sourceRoot; - that.sourcesContent = sourcesContent; - that._mappings = mappings; - that._sourceMapURL = aSourceMapURL; - that.file = file; - that.x_google_ignoreList = x_google_ignoreList; - - that._computedColumnSpans = false; - that._mappingsPtr = 0; - that._wasm = null; - - return wasm().then(w => { - that._wasm = w; - return that; - }); - }); - } - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - _findSourceIndex(aSource) { - // In the most common usecases, we'll be constantly looking up the index for the same source - // files, so we cache the index lookup to avoid constantly recomputing the full URLs. - const cachedIndex = this._sourceLookupCache.get(aSource); - if (typeof cachedIndex === "number") { - return cachedIndex; - } - - // Treat the source as map-relative overall by default. - const sourceAsMapRelative = util.computeSourceURL( - null, - aSource, - this._sourceMapURL - ); - if (this._absoluteSources.has(sourceAsMapRelative)) { - const index = this._absoluteSources.indexOf(sourceAsMapRelative); - this._sourceLookupCache.set(aSource, index); - return index; - } - - // Fall back to treating the source as sourceRoot-relative. - const sourceAsSourceRootRelative = util.computeSourceURL( - this.sourceRoot, - aSource, - this._sourceMapURL - ); - if (this._absoluteSources.has(sourceAsSourceRootRelative)) { - const index = this._absoluteSources.indexOf(sourceAsSourceRootRelative); - this._sourceLookupCache.set(aSource, index); - return index; - } - - // To avoid this cache growing forever, we do not cache lookup misses. - return -1; - } - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - static fromSourceMap(aSourceMap, aSourceMapURL) { - return new BasicSourceMapConsumer(aSourceMap.toString()); - } - - get sources() { - return this._absoluteSources.toArray(); - } - - _getMappingsPtr() { - if (this._mappingsPtr === 0) { - this._parseMappings(); - } - - return this._mappingsPtr; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - _parseMappings() { - const aStr = this._mappings; - const size = aStr.length; - - // Interpret signed result of allocate_mappings as unsigned, otherwise - // addresses higher than 2GB will be negative. - const mappingsBufPtr = this._wasm.exports.allocate_mappings(size) >>> 0; - const mappingsBuf = new Uint8Array( - this._wasm.exports.memory.buffer, - mappingsBufPtr, - size - ); - for (let i = 0; i < size; i++) { - mappingsBuf[i] = aStr.charCodeAt(i); - } - - const mappingsPtr = this._wasm.exports.parse_mappings(mappingsBufPtr); - - if (!mappingsPtr) { - const error = this._wasm.exports.get_last_error(); - let msg = `Error parsing mappings (code ${error}): `; - - // XXX: keep these error codes in sync with `wasm-mappings`. - switch (error) { - case 1: - msg += - "the mappings contained a negative line, column, source index, or name index"; - break; - case 2: - msg += "the mappings contained a number larger than 2**32"; - break; - case 3: - msg += "reached EOF while in the middle of parsing a VLQ"; - break; - case 4: - msg += "invalid base 64 character while parsing a VLQ"; - break; - default: - msg += "unknown error code"; - break; - } - - throw new Error(msg); - } - - this._mappingsPtr = mappingsPtr; - } - - eachMapping(aCallback, aContext, aOrder) { - const context = aContext || null; - const order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - this._wasm.withMappingCallback( - mapping => { - if (mapping.source !== null) { - mapping.source = this._absoluteSources.at(mapping.source); - - if (mapping.name !== null) { - mapping.name = this._names.at(mapping.name); - } - } - if (this._computedColumnSpans && mapping.lastGeneratedColumn === null) { - mapping.lastGeneratedColumn = Infinity; - } - - aCallback.call(context, mapping); - }, - () => { - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - this._wasm.exports.by_generated_location(this._getMappingsPtr()); - break; - case SourceMapConsumer.ORIGINAL_ORDER: - this._wasm.exports.by_original_location(this._getMappingsPtr()); - break; - default: - throw new Error("Unknown order of iteration."); - } - } - ); - } - - allGeneratedPositionsFor(aArgs) { - let source = util.getArg(aArgs, "source"); - const originalLine = util.getArg(aArgs, "line"); - const originalColumn = aArgs.column || 0; - - source = this._findSourceIndex(source); - if (source < 0) { - return []; - } - - if (originalLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - const mappings = []; - - this._wasm.withMappingCallback( - m => { - let lastColumn = m.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - mappings.push({ - line: m.generatedLine, - column: m.generatedColumn, - lastColumn, - }); - }, - () => { - this._wasm.exports.all_generated_locations_for( - this._getMappingsPtr(), - source, - originalLine - 1, - "column" in aArgs, - originalColumn - ); - } - ); - - return mappings; - } - - destroy() { - if (this._mappingsPtr !== 0) { - this._wasm.exports.free_mappings(this._mappingsPtr); - this._mappingsPtr = 0; - } - } - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - computeColumnSpans() { - if (this._computedColumnSpans) { - return; - } - - this._wasm.exports.compute_column_spans(this._getMappingsPtr()); - this._computedColumnSpans = true; - } - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - originalPositionFor(aArgs) { - const needle = { - generatedLine: util.getArg(aArgs, "line"), - generatedColumn: util.getArg(aArgs, "column"), - }; - - if (needle.generatedLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (needle.generatedColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - let bias = util.getArg( - aArgs, - "bias", - SourceMapConsumer.GREATEST_LOWER_BOUND - ); - if (bias == null) { - bias = SourceMapConsumer.GREATEST_LOWER_BOUND; - } - - let mapping; - this._wasm.withMappingCallback( - m => (mapping = m), - () => { - this._wasm.exports.original_location_for( - this._getMappingsPtr(), - needle.generatedLine - 1, - needle.generatedColumn, - bias - ); - } - ); - - if (mapping) { - if (mapping.generatedLine === needle.generatedLine) { - let source = util.getArg(mapping, "source", null); - if (source !== null) { - source = this._absoluteSources.at(source); - } - - let name = util.getArg(mapping, "name", null); - if (name !== null) { - name = this._names.at(name); - } - - return { - source, - line: util.getArg(mapping, "originalLine", null), - column: util.getArg(mapping, "originalColumn", null), - name, - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null, - }; - } - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return ( - this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { - return sc == null; - }) - ); - } - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - const index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - generatedPositionFor(aArgs) { - let source = util.getArg(aArgs, "source"); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null, - }; - } - - const needle = { - source, - originalLine: util.getArg(aArgs, "line"), - originalColumn: util.getArg(aArgs, "column"), - }; - - if (needle.originalLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (needle.originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - let bias = util.getArg( - aArgs, - "bias", - SourceMapConsumer.GREATEST_LOWER_BOUND - ); - if (bias == null) { - bias = SourceMapConsumer.GREATEST_LOWER_BOUND; - } - - let mapping; - this._wasm.withMappingCallback( - m => (mapping = m), - () => { - this._wasm.exports.generated_location_for( - this._getMappingsPtr(), - needle.source, - needle.originalLine - 1, - needle.originalColumn, - bias - ); - } - ); - - if (mapping) { - if (mapping.source === needle.source) { - let lastColumn = mapping.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - return { - line: util.getArg(mapping, "generatedLine", null), - column: util.getArg(mapping, "generatedColumn", null), - lastColumn, - }; - } - } - - return { - line: null, - column: null, - lastColumn: null, - }; - } -} - -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -class IndexedSourceMapConsumer extends SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - return super(INTERNAL).then(that => { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const version = util.getArg(sourceMap, "version"); - const sections = util.getArg(sourceMap, "sections"); - - if (version != that._version) { - throw new Error("Unsupported version: " + version); - } - - let lastOffset = { - line: -1, - column: 0, - }; - return Promise.all( - sections.map(s => { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error( - "Support for url field in sections not implemented." - ); - } - const offset = util.getArg(s, "offset"); - const offsetLine = util.getArg(offset, "line"); - const offsetColumn = util.getArg(offset, "column"); - - if ( - offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column) - ) { - throw new Error( - "Section offsets must be ordered and non-overlapping." - ); - } - lastOffset = offset; - - const cons = new SourceMapConsumer( - util.getArg(s, "map"), - aSourceMapURL - ); - return cons.then(consumer => { - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1, - }, - consumer, - }; - }); - }) - ).then(s => { - that._sections = s; - return that; - }); - }); - } - - /** - * The list of original sources. - */ - get sources() { - const sources = []; - for (let i = 0; i < this._sections.length; i++) { - for (let j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - originalPositionFor(aArgs) { - const needle = { - generatedLine: util.getArg(aArgs, "line"), - generatedColumn: util.getArg(aArgs, "column"), - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - const sectionIndex = binarySearch.search( - needle, - this._sections, - function (aNeedle, section) { - const cmp = - aNeedle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - // The generated column is 0-based, but the section offset column is - // stored 1-based. - return ( - aNeedle.generatedColumn - - (section.generatedOffset.generatedColumn - 1) - ); - } - ); - const section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null, - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), - column: - needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias, - }); - } - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - } - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - sourceContentFor(aSource, nullOnMissing) { - for (let i = 0; i < this._sections.length; i++) { - const section = this._sections[i]; - - const content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - - _findSectionIndex(source) { - for (let i = 0; i < this._sections.length; i++) { - const { consumer } = this._sections[i]; - if (consumer._findSourceIndex(source) !== -1) { - return i; - } - } - return -1; - } - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - generatedPositionFor(aArgs) { - const index = this._findSectionIndex(util.getArg(aArgs, "source")); - const section = index >= 0 ? this._sections[index] : null; - const nextSection = - index >= 0 && index + 1 < this._sections.length - ? this._sections[index + 1] - : null; - - const generatedPosition = - section && section.consumer.generatedPositionFor(aArgs); - if (generatedPosition && generatedPosition.line !== null) { - const lineShift = section.generatedOffset.generatedLine - 1; - const columnShift = section.generatedOffset.generatedColumn - 1; - - if (generatedPosition.line === 1) { - generatedPosition.column += columnShift; - if (typeof generatedPosition.lastColumn === "number") { - generatedPosition.lastColumn += columnShift; - } - } - - if ( - generatedPosition.lastColumn === Infinity && - nextSection && - generatedPosition.line === nextSection.generatedOffset.generatedLine - ) { - generatedPosition.lastColumn = - nextSection.generatedOffset.generatedColumn - 2; - } - generatedPosition.line += lineShift; - - return generatedPosition; - } - - return { - line: null, - column: null, - lastColumn: null, - }; - } - - allGeneratedPositionsFor(aArgs) { - const index = this._findSectionIndex(util.getArg(aArgs, "source")); - const section = index >= 0 ? this._sections[index] : null; - const nextSection = - index >= 0 && index + 1 < this._sections.length - ? this._sections[index + 1] - : null; - - if (!section) return []; - - return section.consumer - .allGeneratedPositionsFor(aArgs) - .map(generatedPosition => { - const lineShift = section.generatedOffset.generatedLine - 1; - const columnShift = section.generatedOffset.generatedColumn - 1; - - if (generatedPosition.line === 1) { - generatedPosition.column += columnShift; - if (typeof generatedPosition.lastColumn === "number") { - generatedPosition.lastColumn += columnShift; - } - } - - if ( - generatedPosition.lastColumn === Infinity && - nextSection && - generatedPosition.line === nextSection.generatedOffset.generatedLine - ) { - generatedPosition.lastColumn = - nextSection.generatedOffset.generatedColumn - 2; - } - generatedPosition.line += lineShift; - - return generatedPosition; - }); - } - - eachMapping(aCallback, aContext, aOrder) { - this._sections.forEach((section, index) => { - const nextSection = - index + 1 < this._sections.length ? this._sections[index + 1] : null; - const { generatedOffset } = section; - - const lineShift = generatedOffset.generatedLine - 1; - const columnShift = generatedOffset.generatedColumn - 1; - - section.consumer.eachMapping( - function (mapping) { - if (mapping.generatedLine === 1) { - mapping.generatedColumn += columnShift; - - if (typeof mapping.lastGeneratedColumn === "number") { - mapping.lastGeneratedColumn += columnShift; - } - } - - if ( - mapping.lastGeneratedColumn === Infinity && - nextSection && - mapping.generatedLine === nextSection.generatedOffset.generatedLine - ) { - mapping.lastGeneratedColumn = - nextSection.generatedOffset.generatedColumn - 2; - } - mapping.generatedLine += lineShift; - - aCallback.call(this, mapping); - }, - aContext, - aOrder - ); - }); - } - - computeColumnSpans() { - for (let i = 0; i < this._sections.length; i++) { - this._sections[i].consumer.computeColumnSpans(); - } - } - - destroy() { - for (let i = 0; i < this._sections.length; i++) { - this._sections[i].consumer.destroy(); - } - } -} -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - -/* - * Cheat to get around inter-twingled classes. `factory()` can be at the end - * where it has access to non-hoisted classes, but it gets hoisted itself. - */ -function _factory(aSourceMap, aSourceMapURL) { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const consumer = - sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - return Promise.resolve(consumer); -} - -function _factoryBSM(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} - - -/***/ }), - -/***/ "./node_modules/source-map/lib/source-map-generator.js": -/*!*************************************************************!*\ - !*** ./node_modules/source-map/lib/source-map-generator.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -const base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/source-map/lib/base64-vlq.js"); -const util = __webpack_require__(/*! ./util */ "./node_modules/source-map/lib/util.js"); -const ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/source-map/lib/array-set.js").ArraySet); -const MappingList = (__webpack_require__(/*! ./mapping-list */ "./node_modules/source-map/lib/mapping-list.js").MappingList); - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -class SourceMapGenerator { - constructor(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, "file", null); - this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); - this._skipValidation = util.getArg(aArgs, "skipValidation", false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - static fromSourceMap(aSourceMapConsumer) { - const sourceRoot = aSourceMapConsumer.sourceRoot; - const generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot, - }); - aSourceMapConsumer.eachMapping(function (mapping) { - const newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn, - }, - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn, - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - let sourceRelative = sourceFile; - if (sourceRoot != null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - const content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - } - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - addMapping(aArgs) { - const generated = util.getArg(aArgs, "generated"); - const original = util.getArg(aArgs, "original", null); - let source = util.getArg(aArgs, "source", null); - let name = util.getArg(aArgs, "name", null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original && original.line, - originalColumn: original && original.column, - source, - name, - }); - } - - /** - * Set the source content for a source file. - */ - setSourceContent(aSourceFile, aSourceContent) { - let source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - } - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - let sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - "SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - const sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - const newSources = - this._mappings.toArray().length > 0 ? new ArraySet() : this._sources; - const newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - const original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn, - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source); - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - const source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - const name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (srcFile) { - const content = aSourceMapConsumer.sourceContentFor(srcFile); - if (content != null) { - if (aSourceMapPath != null) { - srcFile = util.join(aSourceMapPath, srcFile); - } - if (sourceRoot != null) { - srcFile = util.relative(sourceRoot, srcFile); - } - this.setSourceContent(srcFile, content); - } - }, this); - } - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - _validateMapping(aGenerated, aOriginal, aSource, aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if ( - aOriginal && - typeof aOriginal.line !== "number" && - typeof aOriginal.column !== "number" - ) { - throw new Error( - "original.line and original.column are not numbers -- you probably meant to omit " + - "the original mapping entirely and only map the generated position. If so, pass " + - "null for the original mapping instead of an object with empty or null values." - ); - } - - if ( - aGenerated && - "line" in aGenerated && - "column" in aGenerated && - aGenerated.line > 0 && - aGenerated.column >= 0 && - !aOriginal && - !aSource && - !aName - ) { - // Case 1. - } else if ( - aGenerated && - "line" in aGenerated && - "column" in aGenerated && - aOriginal && - "line" in aOriginal && - "column" in aOriginal && - aGenerated.line > 0 && - aGenerated.column >= 0 && - aOriginal.line > 0 && - aOriginal.column >= 0 && - aSource - ) { - // Cases 2 and 3. - } else { - throw new Error( - "Invalid mapping: " + - JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName, - }) - ); - } - } - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - _serializeMappings() { - let previousGeneratedColumn = 0; - let previousGeneratedLine = 1; - let previousOriginalColumn = 0; - let previousOriginalLine = 0; - let previousName = 0; - let previousSource = 0; - let result = ""; - let next; - let mapping; - let nameIdx; - let sourceIdx; - - const mappings = this._mappings.toArray(); - for (let i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = ""; - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ";"; - previousGeneratedLine++; - } - } else if (i > 0) { - if ( - !util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1]) - ) { - continue; - } - next += ","; - } - - next += base64VLQ.encode( - mapping.generatedColumn - previousGeneratedColumn - ); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode( - mapping.originalLine - 1 - previousOriginalLine - ); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode( - mapping.originalColumn - previousOriginalColumn - ); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - } - - _generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - const key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - } - - /** - * Externalize the source map. - */ - toJSON() { - const map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings(), - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent( - map.sources, - map.sourceRoot - ); - } - - return map; - } - - /** - * Render the source map being generated to a string. - */ - toString() { - return JSON.stringify(this.toJSON()); - } -} - -SourceMapGenerator.prototype._version = 3; -exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/source-node.js": -/*!****************************************************!*\ - !*** ./node_modules/source-map/lib/source-node.js ***! - \****************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -const SourceMapGenerator = (__webpack_require__(/*! ./source-map-generator */ "./node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator); -const util = __webpack_require__(/*! ./util */ "./node_modules/source-map/lib/util.js"); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -const REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -const NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -const isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -class SourceNode { - constructor(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - static fromStringWithSourceMap( - aGeneratedCode, - aSourceMapConsumer, - aRelativePath - ) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - const node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - const remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - let remainingLinesIndex = 0; - const shiftNextLine = function () { - const lineContents = getNextLine(); - // The last line of a file might not have a newline. - const newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length - ? remainingLines[remainingLinesIndex++] - : undefined; - } - }; - - // We need to remember the position of "remainingLines" - let lastGeneratedLine = 1, - lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - let lastMapping = null; - let nextLine; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - nextLine = remainingLines[remainingLinesIndex] || ""; - const code = nextLine.substr( - 0, - mapping.generatedColumn - lastGeneratedColumn - ); - remainingLines[remainingLinesIndex] = nextLine.substr( - mapping.generatedColumn - lastGeneratedColumn - ); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - nextLine = remainingLines[remainingLinesIndex] || ""; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr( - mapping.generatedColumn - ); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - const content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - const source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add( - new SourceNode( - mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name - ) - ); - } - } - } - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + - aChunk - ); - } - return this; - } - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (let i = aChunk.length - 1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + - aChunk - ); - } - return this; - } - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - walk(aFn) { - let chunk; - for (let i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } else if (chunk !== "") { - aFn(chunk, { - source: this.source, - line: this.line, - column: this.column, - name: this.name, - }); - } - } - } - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - join(aSep) { - let newChildren; - let i; - const len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len - 1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - } - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - replaceRight(aPattern, aReplacement) { - const lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } else if (typeof lastChild === "string") { - this.children[this.children.length - 1] = lastChild.replace( - aPattern, - aReplacement - ); - } else { - this.children.push("".replace(aPattern, aReplacement)); - } - return this; - } - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - } - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - walkSourceContents(aFn) { - for (let i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - const sources = Object.keys(this.sourceContents); - for (let i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - } - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - toString() { - let str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - } - - /** - * Returns the string representation of this source node along with a source - * map. - */ - toStringWithSourceMap(aArgs) { - const generated = { - code: "", - line: 1, - column: 0, - }; - const map = new SourceMapGenerator(aArgs); - let sourceMappingActive = false; - let lastOriginalSource = null; - let lastOriginalLine = null; - let lastOriginalColumn = null; - let lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if ( - original.source !== null && - original.line !== null && - original.column !== null - ) { - if ( - lastOriginalSource !== original.source || - lastOriginalLine !== original.line || - lastOriginalColumn !== original.column || - lastOriginalName !== original.name - ) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column, - }, - generated: { - line: generated.line, - column: generated.column, - }, - name: original.name, - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column, - }, - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (let idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column, - }, - generated: { - line: generated.line, - column: generated.column, - }, - name: original.name, - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map }; - } -} - -exports.SourceNode = SourceNode; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/url.js": -/*!********************************************!*\ - !*** ./node_modules/source-map/lib/url.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - -// Note: This file is overridden in the 'package.json#browser' field to -// substitute lib/url-browser.js instead. - -// Use the URL global for Node 10, and the 'url' module for Node 8. -module.exports = typeof URL === "function" ? URL : (__webpack_require__(/*! url */ "./node_modules/whatwg-url/index.js").URL); - - -/***/ }), - -/***/ "./node_modules/source-map/lib/util.js": -/*!*********************************************!*\ - !*** ./node_modules/source-map/lib/util.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -const URL = __webpack_require__(/*! ./url */ "./node_modules/source-map/lib/url.js"); - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } - throw new Error('"' + aName + '" is a required argument.'); -} -exports.getArg = getArg; - -const supportsNullProto = (function () { - const obj = Object.create(null); - return !("__proto__" in obj); -})(); - -function identity(s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return "$" + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - const length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - /* eslint-disable no-multi-spaces */ - if ( - s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */ - ) { - return false; - } - /* eslint-enable no-multi-spaces */ - - for (let i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - let cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = - compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, "")); -} -exports.parseSourceMapInput = parseSourceMapInput; - -// We use 'http' as the base here because we want URLs processed relative -// to the safe base to be treated as "special" URLs during parsing using -// the WHATWG URL parsing. This ensures that backslash normalization -// applies to the path and such. -const PROTOCOL = "http:"; -const PROTOCOL_AND_HOST = `${PROTOCOL}//host`; - -/** - * Make it easy to create small utilities that tweak a URL's path. - */ -function createSafeHandler(cb) { - return input => { - const type = getURLType(input); - const base = buildSafeBase(input); - const url = new URL(input, base); - - cb(url); - - const result = url.toString(); - - if (type === "absolute") { - return result; - } else if (type === "scheme-relative") { - return result.slice(PROTOCOL.length); - } else if (type === "path-absolute") { - return result.slice(PROTOCOL_AND_HOST.length); - } - - // This assumes that the callback will only change - // the path, search and hash values. - return computeRelativeURL(base, result); - }; -} - -function withBase(url, base) { - return new URL(url, base).toString(); -} - -function buildUniqueSegment(prefix, str) { - let id = 0; - do { - const ident = prefix + id++; - if (str.indexOf(ident) === -1) return ident; - } while (true); -} - -function buildSafeBase(str) { - const maxDotParts = str.split("..").length - 1; - - // If we used a segment that also existed in `str`, then we would be unable - // to compute relative paths. For example, if `segment` were just "a": - // - // const url = "../../a/" - // const base = buildSafeBase(url); // http://host/a/a/ - // const joined = "http://host/a/"; - // const result = relative(base, joined); - // - // Expected: "../../a/"; - // Actual: "a/" - // - const segment = buildUniqueSegment("p", str); - - let base = `${PROTOCOL_AND_HOST}/`; - for (let i = 0; i < maxDotParts; i++) { - base += `${segment}/`; - } - return base; -} - -const ABSOLUTE_SCHEME = /^[A-Za-z0-9\+\-\.]+:/; -function getURLType(url) { - if (url[0] === "/") { - if (url[1] === "/") return "scheme-relative"; - return "path-absolute"; - } - - return ABSOLUTE_SCHEME.test(url) ? "absolute" : "path-relative"; -} - -/** - * Given two URLs that are assumed to be on the same - * protocol/host/user/password build a relative URL from the - * path, params, and hash values. - * - * @param rootURL The root URL that the target will be relative to. - * @param targetURL The target that the relative URL points to. - * @return A rootURL-relative, normalized URL value. - */ -function computeRelativeURL(rootURL, targetURL) { - if (typeof rootURL === "string") rootURL = new URL(rootURL); - if (typeof targetURL === "string") targetURL = new URL(targetURL); - - const targetParts = targetURL.pathname.split("/"); - const rootParts = rootURL.pathname.split("/"); - - // If we've got a URL path ending with a "/", we remove it since we'd - // otherwise be relative to the wrong location. - if (rootParts.length > 0 && !rootParts[rootParts.length - 1]) { - rootParts.pop(); - } - - while ( - targetParts.length > 0 && - rootParts.length > 0 && - targetParts[0] === rootParts[0] - ) { - targetParts.shift(); - rootParts.shift(); - } - - const relativePath = rootParts - .map(() => "..") - .concat(targetParts) - .join("/"); - - return relativePath + targetURL.search + targetURL.hash; -} - -/** - * Given a URL, ensure that it is treated as a directory URL. - * - * @param url - * @return A normalized URL value. - */ -const ensureDirectory = createSafeHandler(url => { - url.pathname = url.pathname.replace(/\/?$/, "/"); -}); - -/** - * Given a URL, strip off any filename if one is present. - * - * @param url - * @return A normalized URL value. - */ -const trimFilename = createSafeHandler(url => { - url.href = new URL(".", url.toString()).toString(); -}); - -/** - * Normalize a given URL. - * * Convert backslashes. - * * Remove any ".." and "." segments. - * - * @param url - * @return A normalized URL value. - */ -const normalize = createSafeHandler(url => {}); -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * All returned URLs will be normalized. - * - * @param aRoot The root path or URL. Assumed to reference a directory. - * @param aPath The path or URL to be joined with the root. - * @return A joined and normalized URL value. - */ -function join(aRoot, aPath) { - const pathType = getURLType(aPath); - const rootType = getURLType(aRoot); - - aRoot = ensureDirectory(aRoot); - - if (pathType === "absolute") { - return withBase(aPath, undefined); - } - if (rootType === "absolute") { - return withBase(aPath, aRoot); - } - - if (pathType === "scheme-relative") { - return normalize(aPath); - } - if (rootType === "scheme-relative") { - return withBase(aPath, withBase(aRoot, PROTOCOL_AND_HOST)).slice( - PROTOCOL.length - ); - } - - if (pathType === "path-absolute") { - return normalize(aPath); - } - if (rootType === "path-absolute") { - return withBase(aPath, withBase(aRoot, PROTOCOL_AND_HOST)).slice( - PROTOCOL_AND_HOST.length - ); - } - - const base = buildSafeBase(aPath + aRoot); - const newPath = withBase(aPath, withBase(aRoot, base)); - return computeRelativeURL(base, newPath); -} -exports.join = join; - -/** - * Make a path relative to a URL or another path. If returning a - * relative URL is not possible, the original target will be returned. - * All returned URLs will be normalized. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - * @return A rootURL-relative (if possible), normalized URL value. - */ -function relative(rootURL, targetURL) { - const result = relativeIfPossible(rootURL, targetURL); - - return typeof result === "string" ? result : normalize(targetURL); -} -exports.relative = relative; - -function relativeIfPossible(rootURL, targetURL) { - const urlType = getURLType(rootURL); - if (urlType !== getURLType(targetURL)) { - return null; - } - - const base = buildSafeBase(rootURL + targetURL); - const root = new URL(rootURL, base); - const target = new URL(targetURL, base); - - try { - new URL("", target.toString()); - } catch (err) { - // Bail if the URL doesn't support things being relative to it, - // For example, data: and blob: URLs. - return null; - } - - if ( - target.protocol !== root.protocol || - target.user !== root.user || - target.password !== root.password || - target.hostname !== root.hostname || - target.port !== root.port - ) { - return null; - } - - return computeRelativeURL(root, target); -} - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - // The source map spec states that "sourceRoot" and "sources" entries are to be appended. While - // that is a little vague, implementations have generally interpreted that as joining the - // URLs with a `/` between then, assuming the "sourceRoot" doesn't already end with one. - // For example, - // - // sourceRoot: "some-dir", - // sources: ["/some-path.js"] - // - // and - // - // sourceRoot: "some-dir/", - // sources: ["/some-path.js"] - // - // must behave as "some-dir/some-path.js". - // - // With this library's the transition to a more URL-focused implementation, that behavior is - // preserved here. To acheive that, we trim the "/" from absolute-path when a sourceRoot value - // is present in order to make the sources entries behave as if they are relative to the - // "sourceRoot", as they would have if the two strings were simply concated. - if (sourceRoot && getURLType(sourceURL) === "path-absolute") { - sourceURL = sourceURL.replace(/^\//, ""); - } - - let url = normalize(sourceURL || ""); - - // Parsing URLs can be expensive, so we only perform these joins when needed. - if (sourceRoot) url = join(sourceRoot, url); - if (sourceMapURL) url = join(trimFilename(sourceMapURL), url); - return url; -} -exports.computeSourceURL = computeSourceURL; - - -/***/ }), - -/***/ "./node_modules/source-map/lib/wasm.js": -/*!*********************************************!*\ - !*** ./node_modules/source-map/lib/wasm.js ***! - \*********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const readWasm = __webpack_require__(/*! ../lib/read-wasm */ "./node_modules/source-map/lib/read-wasm-browser.js"); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.lastGeneratedColumn = null; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -let cachedWasm = null; - -module.exports = function wasm() { - if (cachedWasm) { - return cachedWasm; - } - - const callbackStack = []; - - cachedWasm = readWasm() - .then(buffer => { - return WebAssembly.instantiate(buffer, { - env: { - mapping_callback( - generatedLine, - generatedColumn, - - hasLastGeneratedColumn, - lastGeneratedColumn, - - hasOriginal, - source, - originalLine, - originalColumn, - - hasName, - name - ) { - const mapping = new Mapping(); - // JS uses 1-based line numbers, wasm uses 0-based. - mapping.generatedLine = generatedLine + 1; - mapping.generatedColumn = generatedColumn; - - if (hasLastGeneratedColumn) { - // JS uses inclusive last generated column, wasm uses exclusive. - mapping.lastGeneratedColumn = lastGeneratedColumn - 1; - } - - if (hasOriginal) { - mapping.source = source; - // JS uses 1-based line numbers, wasm uses 0-based. - mapping.originalLine = originalLine + 1; - mapping.originalColumn = originalColumn; - - if (hasName) { - mapping.name = name; - } - } - - callbackStack[callbackStack.length - 1](mapping); - }, - - start_all_generated_locations_for() { - console.time("all_generated_locations_for"); - }, - end_all_generated_locations_for() { - console.timeEnd("all_generated_locations_for"); - }, - - start_compute_column_spans() { - console.time("compute_column_spans"); - }, - end_compute_column_spans() { - console.timeEnd("compute_column_spans"); - }, - - start_generated_location_for() { - console.time("generated_location_for"); - }, - end_generated_location_for() { - console.timeEnd("generated_location_for"); - }, - - start_original_location_for() { - console.time("original_location_for"); - }, - end_original_location_for() { - console.timeEnd("original_location_for"); - }, - - start_parse_mappings() { - console.time("parse_mappings"); - }, - end_parse_mappings() { - console.timeEnd("parse_mappings"); - }, - - start_sort_by_generated_location() { - console.time("sort_by_generated_location"); - }, - end_sort_by_generated_location() { - console.timeEnd("sort_by_generated_location"); - }, - - start_sort_by_original_location() { - console.time("sort_by_original_location"); - }, - end_sort_by_original_location() { - console.timeEnd("sort_by_original_location"); - }, - }, - }); - }) - .then(Wasm => { - return { - exports: Wasm.instance.exports, - withMappingCallback: (mappingCallback, f) => { - callbackStack.push(mappingCallback); - try { - f(); - } finally { - callbackStack.pop(); - } - }, - }; - }) - .then(null, e => { - cachedWasm = null; - throw e; - }); - - return cachedWasm; -}; - - -/***/ }), - -/***/ "./node_modules/source-map/source-map.js": -/*!***********************************************!*\ - !*** ./node_modules/source-map/source-map.js ***! - \***********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = __webpack_require__(/*! ./lib/source-map-generator */ "./node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator; -exports.SourceMapConsumer = __webpack_require__(/*! ./lib/source-map-consumer */ "./node_modules/source-map/lib/source-map-consumer.js").SourceMapConsumer; -exports.SourceNode = __webpack_require__(/*! ./lib/source-node */ "./node_modules/source-map/lib/source-node.js").SourceNode; - - -/***/ }), - -/***/ "./node_modules/text-encoder/index.js": -/*!********************************************!*\ - !*** ./node_modules/text-encoder/index.js ***! - \********************************************/ -/***/ ((module) => { - -var utf8Encodings = [ - 'utf8', - 'utf-8', - 'unicode-1-1-utf-8' -]; - -function TextEncoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } else { - this.encoding = 'utf-8'; - this.encode = function(str) { - if (typeof str !== 'string') { - throw new TypeError('passed argument must be of tye string'); - } - var binstr = unescape(encodeURIComponent(str)), - arr = new Uint8Array(binstr.length); - const split = binstr.split(''); - for (let i = 0; i < split.length; i++) { - arr[i] = split[i].charCodeAt(0); - } - return arr; - }; - } -} - -function TextDecoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } - else { - this.encoding = 'utf-8'; - this.decode = function (view, options) { - if (typeof view === 'undefined') { - return ''; - } - - var stream = (typeof options !== 'undefined' && stream in options) ? options.stream : false; - if (typeof stream !== 'boolean') { - throw new TypeError('stream option must be boolean'); - } - - if (!ArrayBuffer.isView(view)) { - throw new TypeError('passed argument must be an array buffer view'); - } else { - var arr = new Uint8Array(view.buffer, view.byteOffset, view.byteLength), - charArr = new Array(arr.length); - for (let i = 0; i < arr.length; i++) { - charArr[i] = String.fromCharCode(arr[i]); - } - return decodeURIComponent(escape(charArr.join(''))); - } - } - } -} - -module.exports = { - TextEncoder, - TextDecoder, -}; - - -/***/ }), - -/***/ "./node_modules/tr46/index.js": -/*!************************************!*\ - !*** ./node_modules/tr46/index.js ***! - \************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const punycode = __webpack_require__(/*! punycode/ */ "./node_modules/punycode/punycode.es6.js"); -const regexes = __webpack_require__(/*! ./lib/regexes.js */ "./node_modules/tr46/lib/regexes.js"); -const mappingTable = __webpack_require__(/*! ./lib/mappingTable.json */ "./node_modules/tr46/lib/mappingTable.json"); -const { STATUS_MAPPING } = __webpack_require__(/*! ./lib/statusMapping.js */ "./node_modules/tr46/lib/statusMapping.js"); - -function containsNonASCII(str) { - return /[^\x00-\x7F]/u.test(str); -} - -function findStatus(val) { - let start = 0; - let end = mappingTable.length - 1; - - while (start <= end) { - const mid = Math.floor((start + end) / 2); - - const target = mappingTable[mid]; - const min = Array.isArray(target[0]) ? target[0][0] : target[0]; - const max = Array.isArray(target[0]) ? target[0][1] : target[0]; - - if (min <= val && max >= val) { - return target.slice(1); - } else if (min > val) { - end = mid - 1; - } else { - start = mid + 1; - } - } - - return null; -} - -function mapChars(domainName, { transitionalProcessing }) { - let processed = ""; - - for (const ch of domainName) { - const [status, mapping] = findStatus(ch.codePointAt(0)); - - switch (status) { - case STATUS_MAPPING.disallowed: - processed += ch; - break; - case STATUS_MAPPING.ignored: - break; - case STATUS_MAPPING.mapped: - if (transitionalProcessing && ch === "ẞ") { - processed += "ss"; - } else { - processed += mapping; - } - break; - case STATUS_MAPPING.deviation: - if (transitionalProcessing) { - processed += mapping; - } else { - processed += ch; - } - break; - case STATUS_MAPPING.valid: - processed += ch; - break; - } - } - - return processed; -} - -function validateLabel(label, { - checkHyphens, - checkBidi, - checkJoiners, - transitionalProcessing, - useSTD3ASCIIRules, - isBidi -}) { - // "must be satisfied for a non-empty label" - if (label.length === 0) { - return true; - } - - // "1. The label must be in Unicode Normalization Form NFC." - if (label.normalize("NFC") !== label) { - return false; - } - - const codePoints = Array.from(label); - - // "2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character in both the - // third and fourth positions." - // - // "3. If CheckHyphens, the label must neither begin nor end with a U+002D HYPHEN-MINUS character." - if (checkHyphens) { - if ((codePoints[2] === "-" && codePoints[3] === "-") || - (label.startsWith("-") || label.endsWith("-"))) { - return false; - } - } - - // "4. If not CheckHyphens, the label must not begin with “xn--”." - if (!checkHyphens) { - if (label.startsWith("xn--")) { - return false; - } - } - - // "5. The label must not contain a U+002E ( . ) FULL STOP." - if (label.includes(".")) { - return false; - } - - // "6. The label must not begin with a combining mark, that is: General_Category=Mark." - if (regexes.combiningMarks.test(codePoints[0])) { - return false; - } - - // "7. Each code point in the label must only have certain Status values according to Section 5" - for (const ch of codePoints) { - const codePoint = ch.codePointAt(0); - const [status] = findStatus(codePoint); - if (transitionalProcessing) { - // "For Transitional Processing (deprecated), each value must be valid." - if (status !== STATUS_MAPPING.valid) { - return false; - } - } else if (status !== STATUS_MAPPING.valid && status !== STATUS_MAPPING.deviation) { - // "For Nontransitional Processing, each value must be either valid or deviation." - return false; - } - // "In addition, if UseSTD3ASCIIRules=true and the code point is an ASCII code point (U+0000..U+007F), then it must - // be a lowercase letter (a-z), a digit (0-9), or a hyphen-minus (U+002D). (Note: This excludes uppercase ASCII - // A-Z which are mapped in UTS #46 and disallowed in IDNA2008.)" - if (useSTD3ASCIIRules && codePoint <= 0x7F) { - if (!/^(?:[a-z]|[0-9]|-)$/u.test(ch)) { - return false; - } - } - } - - // "8. If CheckJoiners, the label must satisify the ContextJ rules" - // https://tools.ietf.org/html/rfc5892#appendix-A - if (checkJoiners) { - let last = 0; - for (const [i, ch] of codePoints.entries()) { - if (ch === "\u200C" || ch === "\u200D") { - if (i > 0) { - if (regexes.combiningClassVirama.test(codePoints[i - 1])) { - continue; - } - if (ch === "\u200C") { - // TODO: make this more efficient - const next = codePoints.indexOf("\u200C", i + 1); - const test = next < 0 ? codePoints.slice(last) : codePoints.slice(last, next); - if (regexes.validZWNJ.test(test.join(""))) { - last = i + 1; - continue; - } - } - } - return false; - } - } - } - - // "9. If CheckBidi, and if the domain name is a Bidi domain name, then the label must satisfy..." - // https://tools.ietf.org/html/rfc5893#section-2 - if (checkBidi && isBidi) { - let rtl; - - // 1 - if (regexes.bidiS1LTR.test(codePoints[0])) { - rtl = false; - } else if (regexes.bidiS1RTL.test(codePoints[0])) { - rtl = true; - } else { - return false; - } - - if (rtl) { - // 2-4 - if (!regexes.bidiS2.test(label) || - !regexes.bidiS3.test(label) || - (regexes.bidiS4EN.test(label) && regexes.bidiS4AN.test(label))) { - return false; - } - } else if (!regexes.bidiS5.test(label) || - !regexes.bidiS6.test(label)) { // 5-6 - return false; - } - } - - return true; -} - -function isBidiDomain(labels) { - const domain = labels.map(label => { - if (label.startsWith("xn--")) { - try { - return punycode.decode(label.substring(4)); - } catch { - return ""; - } - } - return label; - }).join("."); - return regexes.bidiDomain.test(domain); -} - -function processing(domainName, options) { - // 1. Map. - let string = mapChars(domainName, options); - - // 2. Normalize. - string = string.normalize("NFC"); - - // 3. Break. - const labels = string.split("."); - const isBidi = isBidiDomain(labels); - - // 4. Convert/Validate. - let error = false; - for (const [i, origLabel] of labels.entries()) { - let label = origLabel; - let transitionalProcessingForThisLabel = options.transitionalProcessing; - if (label.startsWith("xn--")) { - if (containsNonASCII(label)) { - error = true; - continue; - } - - try { - label = punycode.decode(label.substring(4)); - } catch { - if (!options.ignoreInvalidPunycode) { - error = true; - continue; - } - } - labels[i] = label; - - if (label === "" || !containsNonASCII(label)) { - error = true; - } - - transitionalProcessingForThisLabel = false; - } - - // No need to validate if we already know there is an error. - if (error) { - continue; - } - const validation = validateLabel(label, { - ...options, - transitionalProcessing: transitionalProcessingForThisLabel, - isBidi - }); - if (!validation) { - error = true; - } - } - - return { - string: labels.join("."), - error - }; -} - -function toASCII(domainName, { - checkHyphens = false, - checkBidi = false, - checkJoiners = false, - useSTD3ASCIIRules = false, - verifyDNSLength = false, - transitionalProcessing = false, - ignoreInvalidPunycode = false -} = {}) { - const result = processing(domainName, { - checkHyphens, - checkBidi, - checkJoiners, - useSTD3ASCIIRules, - transitionalProcessing, - ignoreInvalidPunycode - }); - let labels = result.string.split("."); - labels = labels.map(l => { - if (containsNonASCII(l)) { - try { - return `xn--${punycode.encode(l)}`; - } catch { - result.error = true; - } - } - return l; - }); - - if (verifyDNSLength) { - const total = labels.join(".").length; - if (total > 253 || total === 0) { - result.error = true; - } - - for (let i = 0; i < labels.length; ++i) { - if (labels[i].length > 63 || labels[i].length === 0) { - result.error = true; - break; - } - } - } - - if (result.error) { - return null; - } - return labels.join("."); -} - -function toUnicode(domainName, { - checkHyphens = false, - checkBidi = false, - checkJoiners = false, - useSTD3ASCIIRules = false, - transitionalProcessing = false, - ignoreInvalidPunycode = false -} = {}) { - const result = processing(domainName, { - checkHyphens, - checkBidi, - checkJoiners, - useSTD3ASCIIRules, - transitionalProcessing, - ignoreInvalidPunycode - }); - - return { - domain: result.string, - error: result.error - }; -} - -module.exports = { - toASCII, - toUnicode -}; - - -/***/ }), - -/***/ "./node_modules/tr46/lib/mappingTable.json": -/*!*************************************************!*\ - !*** ./node_modules/tr46/lib/mappingTable.json ***! - \*************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = /*#__PURE__*/JSON.parse('[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"−"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"Ꭸ"],[43897,1,"Ꭹ"],[43898,1,"Ꭺ"],[43899,1,"Ꭻ"],[43900,1,"Ꭼ"],[43901,1,"Ꭽ"],[43902,1,"Ꭾ"],[43903,1,"Ꭿ"],[43904,1,"Ꮀ"],[43905,1,"Ꮁ"],[43906,1,"Ꮂ"],[43907,1,"Ꮃ"],[43908,1,"Ꮄ"],[43909,1,"Ꮅ"],[43910,1,"Ꮆ"],[43911,1,"Ꮇ"],[43912,1,"Ꮈ"],[43913,1,"Ꮉ"],[43914,1,"Ꮊ"],[43915,1,"Ꮋ"],[43916,1,"Ꮌ"],[43917,1,"Ꮍ"],[43918,1,"Ꮎ"],[43919,1,"Ꮏ"],[43920,1,"Ꮐ"],[43921,1,"Ꮑ"],[43922,1,"Ꮒ"],[43923,1,"Ꮓ"],[43924,1,"Ꮔ"],[43925,1,"Ꮕ"],[43926,1,"Ꮖ"],[43927,1,"Ꮗ"],[43928,1,"Ꮘ"],[43929,1,"Ꮙ"],[43930,1,"Ꮚ"],[43931,1,"Ꮛ"],[43932,1,"Ꮜ"],[43933,1,"Ꮝ"],[43934,1,"Ꮞ"],[43935,1,"Ꮟ"],[43936,1,"Ꮠ"],[43937,1,"Ꮡ"],[43938,1,"Ꮢ"],[43939,1,"Ꮣ"],[43940,1,"Ꮤ"],[43941,1,"Ꮥ"],[43942,1,"Ꮦ"],[43943,1,"Ꮧ"],[43944,1,"Ꮨ"],[43945,1,"Ꮩ"],[43946,1,"Ꮪ"],[43947,1,"Ꮫ"],[43948,1,"Ꮬ"],[43949,1,"Ꮭ"],[43950,1,"Ꮮ"],[43951,1,"Ꮯ"],[43952,1,"Ꮰ"],[43953,1,"Ꮱ"],[43954,1,"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,"\\""],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"\'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69371],3],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118015],3],[[118016,118451],2],[[118452,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[[129674,129678],3],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[[129735,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[[129770,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]'); - -/***/ }), - -/***/ "./node_modules/tr46/lib/regexes.js": -/*!******************************************!*\ - !*** ./node_modules/tr46/lib/regexes.js ***! - \******************************************/ -/***/ ((module) => { - -"use strict"; - - -const combiningMarks = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u; -const combiningClassVirama = /[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u; -const validZWNJ = /[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u; -const bidiDomain = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; -const bidiS1LTR = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u; -const bidiS1RTL = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; -const bidiS2 = /^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u; -const bidiS3 = /[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; -const bidiS4EN = /[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u; -const bidiS4AN = /[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u; -const bidiS5 = /^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\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\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u; -const bidiS6 = /[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; - -module.exports = { - combiningMarks, - combiningClassVirama, - validZWNJ, - bidiDomain, - bidiS1LTR, - bidiS1RTL, - bidiS2, - bidiS3, - bidiS4EN, - bidiS4AN, - bidiS5, - bidiS6 - }; - - -/***/ }), - -/***/ "./node_modules/tr46/lib/statusMapping.js": -/*!************************************************!*\ - !*** ./node_modules/tr46/lib/statusMapping.js ***! - \************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports.STATUS_MAPPING = { - mapped: 1, - valid: 2, - disallowed: 3, - deviation: 6, - ignored: 7 -}; - - -/***/ }), - -/***/ "./node_modules/webidl-conversions/lib/index.js": -/*!******************************************************!*\ - !*** ./node_modules/webidl-conversions/lib/index.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -function makeException(ErrorType, message, options) { - if (options.globals) { - ErrorType = options.globals[ErrorType.name]; - } - return new ErrorType(`${options.context ? options.context : "Value"} ${message}.`); -} - -function toNumber(value, options) { - if (typeof value === "bigint") { - throw makeException(TypeError, "is a BigInt which cannot be converted to a number", options); - } - if (!options.globals) { - return Number(value); - } - return options.globals.Number(value); -} - -// Round x to the nearest integer, choosing the even integer if it lies halfway between two. -function evenRound(x) { - // There are four cases for numbers with fractional part being .5: - // - // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example - // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0 - // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2 - // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0 - // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2 - // (where n is a non-negative integer) - // - // Branch here for cases 1 and 4 - if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) || - (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) { - return censorNegativeZero(Math.floor(x)); - } - - return censorNegativeZero(Math.round(x)); -} - -function integerPart(n) { - return censorNegativeZero(Math.trunc(n)); -} - -function sign(x) { - return x < 0 ? -1 : 1; -} - -function modulo(x, y) { - // https://tc39.github.io/ecma262/#eqn-modulo - // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos - const signMightNotMatch = x % y; - if (sign(y) !== sign(signMightNotMatch)) { - return signMightNotMatch + y; - } - return signMightNotMatch; -} - -function censorNegativeZero(x) { - return x === 0 ? 0 : x; -} - -function createIntegerConversion(bitLength, { unsigned }) { - let lowerBound, upperBound; - if (unsigned) { - lowerBound = 0; - upperBound = 2 ** bitLength - 1; - } else { - lowerBound = -(2 ** (bitLength - 1)); - upperBound = 2 ** (bitLength - 1) - 1; - } - - const twoToTheBitLength = 2 ** bitLength; - const twoToOneLessThanTheBitLength = 2 ** (bitLength - 1); - - return (value, options = {}) => { - let x = toNumber(value, options); - x = censorNegativeZero(x); - - if (options.enforceRange) { - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite number", options); - } - - x = integerPart(x); - - if (x < lowerBound || x > upperBound) { - throw makeException( - TypeError, - `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, - options - ); - } - - return x; - } - - if (!Number.isNaN(x) && options.clamp) { - x = Math.min(Math.max(x, lowerBound), upperBound); - x = evenRound(x); - return x; - } - - if (!Number.isFinite(x) || x === 0) { - return 0; - } - x = integerPart(x); - - // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if - // possible. Hopefully it's an optimization for the non-64-bitLength cases too. - if (x >= lowerBound && x <= upperBound) { - return x; - } - - // These will not work great for bitLength of 64, but oh well. See the README for more details. - x = modulo(x, twoToTheBitLength); - if (!unsigned && x >= twoToOneLessThanTheBitLength) { - return x - twoToTheBitLength; - } - return x; - }; -} - -function createLongLongConversion(bitLength, { unsigned }) { - const upperBound = Number.MAX_SAFE_INTEGER; - const lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; - const asBigIntN = unsigned ? BigInt.asUintN : BigInt.asIntN; - - return (value, options = {}) => { - let x = toNumber(value, options); - x = censorNegativeZero(x); - - if (options.enforceRange) { - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite number", options); - } - - x = integerPart(x); - - if (x < lowerBound || x > upperBound) { - throw makeException( - TypeError, - `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, - options - ); - } - - return x; - } - - if (!Number.isNaN(x) && options.clamp) { - x = Math.min(Math.max(x, lowerBound), upperBound); - x = evenRound(x); - return x; - } - - if (!Number.isFinite(x) || x === 0) { - return 0; - } - - let xBigInt = BigInt(integerPart(x)); - xBigInt = asBigIntN(bitLength, xBigInt); - return Number(xBigInt); - }; -} - -exports.any = value => { - return value; -}; - -exports.undefined = () => { - return undefined; -}; - -exports.boolean = value => { - return Boolean(value); -}; - -exports.byte = createIntegerConversion(8, { unsigned: false }); -exports.octet = createIntegerConversion(8, { unsigned: true }); - -exports.short = createIntegerConversion(16, { unsigned: false }); -exports["unsigned short"] = createIntegerConversion(16, { unsigned: true }); - -exports.long = createIntegerConversion(32, { unsigned: false }); -exports["unsigned long"] = createIntegerConversion(32, { unsigned: true }); - -exports["long long"] = createLongLongConversion(64, { unsigned: false }); -exports["unsigned long long"] = createLongLongConversion(64, { unsigned: true }); - -exports.double = (value, options = {}) => { - const x = toNumber(value, options); - - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite floating-point value", options); - } - - return x; -}; - -exports["unrestricted double"] = (value, options = {}) => { - const x = toNumber(value, options); - - return x; -}; - -exports.float = (value, options = {}) => { - const x = toNumber(value, options); - - if (!Number.isFinite(x)) { - throw makeException(TypeError, "is not a finite floating-point value", options); - } - - if (Object.is(x, -0)) { - return x; - } - - const y = Math.fround(x); - - if (!Number.isFinite(y)) { - throw makeException(TypeError, "is outside the range of a single-precision floating-point value", options); - } - - return y; -}; - -exports["unrestricted float"] = (value, options = {}) => { - const x = toNumber(value, options); - - if (isNaN(x)) { - return x; - } - - if (Object.is(x, -0)) { - return x; - } - - return Math.fround(x); -}; - -exports.DOMString = (value, options = {}) => { - if (options.treatNullAsEmptyString && value === null) { - return ""; - } - - if (typeof value === "symbol") { - throw makeException(TypeError, "is a symbol, which cannot be converted to a string", options); - } - - const StringCtor = options.globals ? options.globals.String : String; - return StringCtor(value); -}; - -exports.ByteString = (value, options = {}) => { - const x = exports.DOMString(value, options); - let c; - for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { - if (c > 255) { - throw makeException(TypeError, "is not a valid ByteString", options); - } - } - - return x; -}; - -exports.USVString = (value, options = {}) => { - const S = exports.DOMString(value, options); - const n = S.length; - const U = []; - for (let i = 0; i < n; ++i) { - const c = S.charCodeAt(i); - if (c < 0xD800 || c > 0xDFFF) { - U.push(String.fromCodePoint(c)); - } else if (0xDC00 <= c && c <= 0xDFFF) { - U.push(String.fromCodePoint(0xFFFD)); - } else if (i === n - 1) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - const d = S.charCodeAt(i + 1); - if (0xDC00 <= d && d <= 0xDFFF) { - const a = c & 0x3FF; - const b = d & 0x3FF; - U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b)); - ++i; - } else { - U.push(String.fromCodePoint(0xFFFD)); - } - } - } - - return U.join(""); -}; - -exports.object = (value, options = {}) => { - if (value === null || (typeof value !== "object" && typeof value !== "function")) { - throw makeException(TypeError, "is not an object", options); - } - - return value; -}; - -const abByteLengthGetter = - Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; -const sabByteLengthGetter = - typeof SharedArrayBuffer === "function" ? - Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get : - null; - -function isNonSharedArrayBuffer(value) { - try { - // This will throw on SharedArrayBuffers, but not detached ArrayBuffers. - // (The spec says it should throw, but the spec conflicts with implementations: https://github.com/tc39/ecma262/issues/678) - abByteLengthGetter.call(value); - - return true; - } catch { - return false; - } -} - -function isSharedArrayBuffer(value) { - try { - sabByteLengthGetter.call(value); - return true; - } catch { - return false; - } -} - -function isArrayBufferDetached(value) { - try { - // eslint-disable-next-line no-new - new Uint8Array(value); - return false; - } catch { - return true; - } -} - -exports.ArrayBuffer = (value, options = {}) => { - if (!isNonSharedArrayBuffer(value)) { - if (options.allowShared && !isSharedArrayBuffer(value)) { - throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options); - } - throw makeException(TypeError, "is not an ArrayBuffer", options); - } - if (isArrayBufferDetached(value)) { - throw makeException(TypeError, "is a detached ArrayBuffer", options); - } - - return value; -}; - -const dvByteLengthGetter = - Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; -exports.DataView = (value, options = {}) => { - try { - dvByteLengthGetter.call(value); - } catch (e) { - throw makeException(TypeError, "is not a DataView", options); - } - - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is backed by a SharedArrayBuffer, which is not allowed", options); - } - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is backed by a detached ArrayBuffer", options); - } - - return value; -}; - -// Returns the unforgeable `TypedArray` constructor name or `undefined`, -// if the `this` value isn't a valid `TypedArray` object. -// -// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag -const typedArrayNameGetter = Object.getOwnPropertyDescriptor( - Object.getPrototypeOf(Uint8Array).prototype, - Symbol.toStringTag -).get; -[ - Int8Array, - Int16Array, - Int32Array, - Uint8Array, - Uint16Array, - Uint32Array, - Uint8ClampedArray, - Float32Array, - Float64Array -].forEach(func => { - const { name } = func; - const article = /^[AEIOU]/u.test(name) ? "an" : "a"; - exports[name] = (value, options = {}) => { - if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) { - throw makeException(TypeError, `is not ${article} ${name} object`, options); - } - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); - } - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); - } - - return value; - }; -}); - -// Common definitions - -exports.ArrayBufferView = (value, options = {}) => { - if (!ArrayBuffer.isView(value)) { - throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options); - } - - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); - } - - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); - } - return value; -}; - -exports.BufferSource = (value, options = {}) => { - if (ArrayBuffer.isView(value)) { - if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { - throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); - } - - if (isArrayBufferDetached(value.buffer)) { - throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); - } - return value; - } - - if (!options.allowShared && !isNonSharedArrayBuffer(value)) { - throw makeException(TypeError, "is not an ArrayBuffer or a view on one", options); - } - if (options.allowShared && !isSharedArrayBuffer(value) && !isNonSharedArrayBuffer(value)) { - throw makeException(TypeError, "is not an ArrayBuffer, SharedArrayBuffer, or a view on one", options); - } - if (isArrayBufferDetached(value)) { - throw makeException(TypeError, "is a detached ArrayBuffer", options); - } - - return value; -}; - -exports.DOMTimeStamp = exports["unsigned long long"]; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/index.js": -/*!******************************************!*\ - !*** ./node_modules/whatwg-url/index.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const { URL, URLSearchParams } = __webpack_require__(/*! ./webidl2js-wrapper */ "./node_modules/whatwg-url/webidl2js-wrapper.js"); -const urlStateMachine = __webpack_require__(/*! ./lib/url-state-machine */ "./node_modules/whatwg-url/lib/url-state-machine.js"); -const percentEncoding = __webpack_require__(/*! ./lib/percent-encoding */ "./node_modules/whatwg-url/lib/percent-encoding.js"); - -const sharedGlobalObject = { Array, Object, Promise, String, TypeError }; -URL.install(sharedGlobalObject, ["Window"]); -URLSearchParams.install(sharedGlobalObject, ["Window"]); - -exports.URL = sharedGlobalObject.URL; -exports.URLSearchParams = sharedGlobalObject.URLSearchParams; - -exports.parseURL = urlStateMachine.parseURL; -exports.basicURLParse = urlStateMachine.basicURLParse; -exports.serializeURL = urlStateMachine.serializeURL; -exports.serializePath = urlStateMachine.serializePath; -exports.serializeHost = urlStateMachine.serializeHost; -exports.serializeInteger = urlStateMachine.serializeInteger; -exports.serializeURLOrigin = urlStateMachine.serializeURLOrigin; -exports.setTheUsername = urlStateMachine.setTheUsername; -exports.setThePassword = urlStateMachine.setThePassword; -exports.cannotHaveAUsernamePasswordPort = urlStateMachine.cannotHaveAUsernamePasswordPort; -exports.hasAnOpaquePath = urlStateMachine.hasAnOpaquePath; - -exports.percentDecodeString = percentEncoding.percentDecodeString; -exports.percentDecodeBytes = percentEncoding.percentDecodeBytes; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/Function.js": -/*!*************************************************!*\ - !*** ./node_modules/whatwg-url/lib/Function.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const conversions = __webpack_require__(/*! webidl-conversions */ "./node_modules/webidl-conversions/lib/index.js"); -const utils = __webpack_require__(/*! ./utils.js */ "./node_modules/whatwg-url/lib/utils.js"); - -exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { - if (typeof value !== "function") { - throw new globalObject.TypeError(context + " is not a function"); - } - - function invokeTheCallbackFunction(...args) { - const thisArg = utils.tryWrapperForImpl(this); - let callResult; - - for (let i = 0; i < args.length; i++) { - args[i] = utils.tryWrapperForImpl(args[i]); - } - - callResult = Reflect.apply(value, thisArg, args); - - callResult = conversions["any"](callResult, { context: context, globals: globalObject }); - - return callResult; - } - - invokeTheCallbackFunction.construct = (...args) => { - for (let i = 0; i < args.length; i++) { - args[i] = utils.tryWrapperForImpl(args[i]); - } - - let callResult = Reflect.construct(value, args); - - callResult = conversions["any"](callResult, { context: context, globals: globalObject }); - - return callResult; - }; - - invokeTheCallbackFunction[utils.wrapperSymbol] = value; - invokeTheCallbackFunction.objectReference = value; - - return invokeTheCallbackFunction; -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URL-impl.js": -/*!*************************************************!*\ - !*** ./node_modules/whatwg-url/lib/URL-impl.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -const usm = __webpack_require__(/*! ./url-state-machine */ "./node_modules/whatwg-url/lib/url-state-machine.js"); -const urlencoded = __webpack_require__(/*! ./urlencoded */ "./node_modules/whatwg-url/lib/urlencoded.js"); -const URLSearchParams = __webpack_require__(/*! ./URLSearchParams */ "./node_modules/whatwg-url/lib/URLSearchParams.js"); - -exports.implementation = class URLImpl { - // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error - // messages in the constructor that distinguish between the different causes of failure. - constructor(globalObject, [url, base]) { - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === null) { - throw new TypeError(`Invalid base URL: ${base}`); - } - } - - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === null) { - throw new TypeError(`Invalid URL: ${url}`); - } - - const query = parsedURL.query !== null ? parsedURL.query : ""; - - this._url = parsedURL; - - // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips - // question mark by default. Therefore the doNotStripQMark hack is used. - this._query = URLSearchParams.createImpl(globalObject, [query], { doNotStripQMark: true }); - this._query._url = this; - } - - static parse(globalObject, input, base) { - try { - return new URLImpl(globalObject, [input, base]); - } catch { - return null; - } - } - - static canParse(url, base) { - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === null) { - return false; - } - } - - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === null) { - return false; - } - - return true; - } - - get href() { - return usm.serializeURL(this._url); - } - - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === null) { - throw new TypeError(`Invalid URL: ${v}`); - } - - this._url = parsedURL; - - this._query._list.splice(0); - const { query } = parsedURL; - if (query !== null) { - this._query._list = urlencoded.parseUrlencodedString(query); - } - } - - get origin() { - return usm.serializeURLOrigin(this._url); - } - - get protocol() { - return `${this._url.scheme}:`; - } - - set protocol(v) { - usm.basicURLParse(`${v}:`, { url: this._url, stateOverride: "scheme start" }); - } - - get username() { - return this._url.username; - } - - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setTheUsername(this._url, v); - } - - get password() { - return this._url.password; - } - - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setThePassword(this._url, v); - } - - get host() { - const url = this._url; - - if (url.host === null) { - return ""; - } - - if (url.port === null) { - return usm.serializeHost(url.host); - } - - return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`; - } - - set host(v) { - if (usm.hasAnOpaquePath(this._url)) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } - - get hostname() { - if (this._url.host === null) { - return ""; - } - - return usm.serializeHost(this._url.host); - } - - set hostname(v) { - if (usm.hasAnOpaquePath(this._url)) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } - - get port() { - if (this._url.port === null) { - return ""; - } - - return usm.serializeInteger(this._url.port); - } - - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } - - get pathname() { - return usm.serializePath(this._url); - } - - set pathname(v) { - if (usm.hasAnOpaquePath(this._url)) { - return; - } - - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } - - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } - - return `?${this._url.query}`; - } - - set search(v) { - const url = this._url; - - if (v === "") { - url.query = null; - this._query._list = []; - return; - } - - const input = v[0] === "?" ? v.substring(1) : v; - url.query = ""; - usm.basicURLParse(input, { url, stateOverride: "query" }); - this._query._list = urlencoded.parseUrlencodedString(input); - } - - get searchParams() { - return this._query; - } - - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } - - return `#${this._url.fragment}`; - } - - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; - } - - const input = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); - } - - toJSON() { - return this.href; - } -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URL.js": -/*!********************************************!*\ - !*** ./node_modules/whatwg-url/lib/URL.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const conversions = __webpack_require__(/*! webidl-conversions */ "./node_modules/webidl-conversions/lib/index.js"); -const utils = __webpack_require__(/*! ./utils.js */ "./node_modules/whatwg-url/lib/utils.js"); - -const implSymbol = utils.implSymbol; -const ctorRegistrySymbol = utils.ctorRegistrySymbol; - -const interfaceName = "URL"; - -exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; -}; -exports.isImpl = value => { - return utils.isObject(value) && value instanceof Impl.implementation; -}; -exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { - if (exports.is(value)) { - return utils.implForWrapper(value); - } - throw new globalObject.TypeError(`${context} is not of type 'URL'.`); -}; - -function makeWrapper(globalObject, newTarget) { - let proto; - if (newTarget !== undefined) { - proto = newTarget.prototype; - } - - if (!utils.isObject(proto)) { - proto = globalObject[ctorRegistrySymbol]["URL"].prototype; - } - - return Object.create(proto); -} - -exports.create = (globalObject, constructorArgs, privateData) => { - const wrapper = makeWrapper(globalObject); - return exports.setup(wrapper, globalObject, constructorArgs, privateData); -}; - -exports.createImpl = (globalObject, constructorArgs, privateData) => { - const wrapper = exports.create(globalObject, constructorArgs, privateData); - return utils.implForWrapper(wrapper); -}; - -exports._internalSetup = (wrapper, globalObject) => {}; - -exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { - privateData.wrapper = wrapper; - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: new Impl.implementation(globalObject, constructorArgs, privateData), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper; -}; - -exports["new"] = (globalObject, newTarget) => { - const wrapper = makeWrapper(globalObject, newTarget); - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: Object.create(Impl.implementation.prototype), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper[implSymbol]; -}; - -const exposed = new Set(["Window", "Worker"]); - -exports.install = (globalObject, globalNames) => { - if (!globalNames.some(globalName => exposed.has(globalName))) { - return; - } - - const ctorRegistry = utils.initCtorRegistry(globalObject); - class URL { - constructor(url) { - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to construct 'URL': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to construct 'URL': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return exports.setup(Object.create(new.target.prototype), globalObject, args); - } - - toJSON() { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol].toJSON(); - } - - get href() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["href"]; - } - - set href(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'href' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["href"] = V; - } - - toString() { - const esValue = this; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["href"]; - } - - get origin() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["origin"]; - } - - get protocol() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["protocol"]; - } - - set protocol(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'protocol' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["protocol"] = V; - } - - get username() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["username"]; - } - - set username(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'username' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["username"] = V; - } - - get password() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["password"]; - } - - set password(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'password' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["password"] = V; - } - - get host() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["host"]; - } - - set host(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'host' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["host"] = V; - } - - get hostname() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["hostname"]; - } - - set hostname(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'hostname' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["hostname"] = V; - } - - get port() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["port"]; - } - - set port(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'port' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["port"] = V; - } - - get pathname() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["pathname"]; - } - - set pathname(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'pathname' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["pathname"] = V; - } - - get search() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["search"]; - } - - set search(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'search' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["search"] = V; - } - - get searchParams() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL."); - } - - return utils.getSameObject(this, "searchParams", () => { - return utils.tryWrapperForImpl(esValue[implSymbol]["searchParams"]); - }); - } - - get hash() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL."); - } - - return esValue[implSymbol]["hash"]; - } - - set hash(V) { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL."); - } - - V = conversions["USVString"](V, { - context: "Failed to set the 'hash' property on 'URL': The provided value", - globals: globalObject - }); - - esValue[implSymbol]["hash"] = V; - } - - static parse(url) { - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'parse' on 'URL': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'parse' on 'URL': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args)); - } - - static canParse(url) { - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'canParse' on 'URL': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'canParse' on 'URL': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return Impl.implementation.canParse(...args); - } - } - Object.defineProperties(URL.prototype, { - toJSON: { enumerable: true }, - href: { enumerable: true }, - toString: { enumerable: true }, - origin: { enumerable: true }, - protocol: { enumerable: true }, - username: { enumerable: true }, - password: { enumerable: true }, - host: { enumerable: true }, - hostname: { enumerable: true }, - port: { enumerable: true }, - pathname: { enumerable: true }, - search: { enumerable: true }, - searchParams: { enumerable: true }, - hash: { enumerable: true }, - [Symbol.toStringTag]: { value: "URL", configurable: true } - }); - Object.defineProperties(URL, { parse: { enumerable: true }, canParse: { enumerable: true } }); - ctorRegistry[interfaceName] = URL; - - Object.defineProperty(globalObject, interfaceName, { - configurable: true, - writable: true, - value: URL - }); - - if (globalNames.includes("Window")) { - Object.defineProperty(globalObject, "webkitURL", { - configurable: true, - writable: true, - value: URL - }); - } -}; - -const Impl = __webpack_require__(/*! ./URL-impl.js */ "./node_modules/whatwg-url/lib/URL-impl.js"); - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URLSearchParams-impl.js": -/*!*************************************************************!*\ - !*** ./node_modules/whatwg-url/lib/URLSearchParams-impl.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -const urlencoded = __webpack_require__(/*! ./urlencoded */ "./node_modules/whatwg-url/lib/urlencoded.js"); - -exports.implementation = class URLSearchParamsImpl { - constructor(globalObject, constructorArgs, { doNotStripQMark = false }) { - let init = constructorArgs[0]; - this._list = []; - this._url = null; - - if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { - init = init.slice(1); - } - - if (Array.isArray(init)) { - for (const pair of init) { - if (pair.length !== 2) { - throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " + - "contain exactly two elements."); - } - this._list.push([pair[0], pair[1]]); - } - } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { - for (const name of Object.keys(init)) { - const value = init[name]; - this._list.push([name, value]); - } - } else { - this._list = urlencoded.parseUrlencodedString(init); - } - } - - _updateSteps() { - if (this._url !== null) { - let serializedQuery = urlencoded.serializeUrlencoded(this._list); - if (serializedQuery === "") { - serializedQuery = null; - } - - this._url._url.query = serializedQuery; - } - } - - get size() { - return this._list.length; - } - - append(name, value) { - this._list.push([name, value]); - this._updateSteps(); - } - - delete(name, value) { - let i = 0; - while (i < this._list.length) { - if (this._list[i][0] === name && (value === undefined || this._list[i][1] === value)) { - this._list.splice(i, 1); - } else { - i++; - } - } - this._updateSteps(); - } - - get(name) { - for (const tuple of this._list) { - if (tuple[0] === name) { - return tuple[1]; - } - } - return null; - } - - getAll(name) { - const output = []; - for (const tuple of this._list) { - if (tuple[0] === name) { - output.push(tuple[1]); - } - } - return output; - } - - has(name, value) { - for (const tuple of this._list) { - if (tuple[0] === name && (value === undefined || tuple[1] === value)) { - return true; - } - } - return false; - } - - set(name, value) { - let found = false; - let i = 0; - while (i < this._list.length) { - if (this._list[i][0] === name) { - if (found) { - this._list.splice(i, 1); - } else { - found = true; - this._list[i][1] = value; - i++; - } - } else { - i++; - } - } - if (!found) { - this._list.push([name, value]); - } - this._updateSteps(); - } - - sort() { - this._list.sort((a, b) => { - if (a[0] < b[0]) { - return -1; - } - if (a[0] > b[0]) { - return 1; - } - return 0; - }); - - this._updateSteps(); - } - - [Symbol.iterator]() { - return this._list[Symbol.iterator](); - } - - toString() { - return urlencoded.serializeUrlencoded(this._list); - } -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/URLSearchParams.js": -/*!********************************************************!*\ - !*** ./node_modules/whatwg-url/lib/URLSearchParams.js ***! - \********************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const conversions = __webpack_require__(/*! webidl-conversions */ "./node_modules/webidl-conversions/lib/index.js"); -const utils = __webpack_require__(/*! ./utils.js */ "./node_modules/whatwg-url/lib/utils.js"); - -const Function = __webpack_require__(/*! ./Function.js */ "./node_modules/whatwg-url/lib/Function.js"); -const newObjectInRealm = utils.newObjectInRealm; -const implSymbol = utils.implSymbol; -const ctorRegistrySymbol = utils.ctorRegistrySymbol; - -const interfaceName = "URLSearchParams"; - -exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; -}; -exports.isImpl = value => { - return utils.isObject(value) && value instanceof Impl.implementation; -}; -exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { - if (exports.is(value)) { - return utils.implForWrapper(value); - } - throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`); -}; - -exports.createDefaultIterator = (globalObject, target, kind) => { - const ctorRegistry = globalObject[ctorRegistrySymbol]; - const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"]; - const iterator = Object.create(iteratorPrototype); - Object.defineProperty(iterator, utils.iterInternalSymbol, { - value: { target, kind, index: 0 }, - configurable: true - }); - return iterator; -}; - -function makeWrapper(globalObject, newTarget) { - let proto; - if (newTarget !== undefined) { - proto = newTarget.prototype; - } - - if (!utils.isObject(proto)) { - proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype; - } - - return Object.create(proto); -} - -exports.create = (globalObject, constructorArgs, privateData) => { - const wrapper = makeWrapper(globalObject); - return exports.setup(wrapper, globalObject, constructorArgs, privateData); -}; - -exports.createImpl = (globalObject, constructorArgs, privateData) => { - const wrapper = exports.create(globalObject, constructorArgs, privateData); - return utils.implForWrapper(wrapper); -}; - -exports._internalSetup = (wrapper, globalObject) => {}; - -exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { - privateData.wrapper = wrapper; - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: new Impl.implementation(globalObject, constructorArgs, privateData), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper; -}; - -exports["new"] = (globalObject, newTarget) => { - const wrapper = makeWrapper(globalObject, newTarget); - - exports._internalSetup(wrapper, globalObject); - Object.defineProperty(wrapper, implSymbol, { - value: Object.create(Impl.implementation.prototype), - configurable: true - }); - - wrapper[implSymbol][utils.wrapperSymbol] = wrapper; - if (Impl.init) { - Impl.init(wrapper[implSymbol]); - } - return wrapper[implSymbol]; -}; - -const exposed = new Set(["Window", "Worker"]); - -exports.install = (globalObject, globalNames) => { - if (!globalNames.some(globalName => exposed.has(globalName))) { - return; - } - - const ctorRegistry = utils.initCtorRegistry(globalObject); - class URLSearchParams { - constructor() { - const args = []; - { - let curArg = arguments[0]; - if (curArg !== undefined) { - if (utils.isObject(curArg)) { - if (curArg[Symbol.iterator] !== undefined) { - if (!utils.isObject(curArg)) { - throw new globalObject.TypeError( - "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object." - ); - } else { - const V = []; - const tmp = curArg; - for (let nextItem of tmp) { - if (!utils.isObject(nextItem)) { - throw new globalObject.TypeError( - "Failed to construct 'URLSearchParams': parameter 1" + - " sequence" + - "'s element" + - " is not an iterable object." - ); - } else { - const V = []; - const tmp = nextItem; - for (let nextItem of tmp) { - nextItem = conversions["USVString"](nextItem, { - context: - "Failed to construct 'URLSearchParams': parameter 1" + - " sequence" + - "'s element" + - "'s element", - globals: globalObject - }); - - V.push(nextItem); - } - nextItem = V; - } - - V.push(nextItem); - } - curArg = V; - } - } else { - if (!utils.isObject(curArg)) { - throw new globalObject.TypeError( - "Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object." - ); - } else { - const result = Object.create(null); - for (const key of Reflect.ownKeys(curArg)) { - const desc = Object.getOwnPropertyDescriptor(curArg, key); - if (desc && desc.enumerable) { - let typedKey = key; - - typedKey = conversions["USVString"](typedKey, { - context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key", - globals: globalObject - }); - - let typedValue = curArg[key]; - - typedValue = conversions["USVString"](typedValue, { - context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value", - globals: globalObject - }); - - result[typedKey] = typedValue; - } - } - curArg = result; - } - } - } else { - curArg = conversions["USVString"](curArg, { - context: "Failed to construct 'URLSearchParams': parameter 1", - globals: globalObject - }); - } - } else { - curArg = ""; - } - args.push(curArg); - } - return exports.setup(Object.create(new.target.prototype), globalObject, args); - } - - append(name, value) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'append' called on an object that is not a valid instance of URLSearchParams." - ); - } - - if (arguments.length < 2) { - throw new globalObject.TypeError( - `Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'append' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'append' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].append(...args)); - } - - delete(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'delete' called on an object that is not a valid instance of URLSearchParams." - ); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'delete' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args)); - } - - get(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams."); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'get' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - return esValue[implSymbol].get(...args); - } - - getAll(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'getAll' called on an object that is not a valid instance of URLSearchParams." - ); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args)); - } - - has(name) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams."); - } - - if (arguments.length < 1) { - throw new globalObject.TypeError( - `Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'has' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - if (curArg !== undefined) { - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'has' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - } - args.push(curArg); - } - return esValue[implSymbol].has(...args); - } - - set(name, value) { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams."); - } - - if (arguments.length < 2) { - throw new globalObject.TypeError( - `Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` - ); - } - const args = []; - { - let curArg = arguments[0]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'set' on 'URLSearchParams': parameter 1", - globals: globalObject - }); - args.push(curArg); - } - { - let curArg = arguments[1]; - curArg = conversions["USVString"](curArg, { - context: "Failed to execute 'set' on 'URLSearchParams': parameter 2", - globals: globalObject - }); - args.push(curArg); - } - return utils.tryWrapperForImpl(esValue[implSymbol].set(...args)); - } - - sort() { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams."); - } - - return utils.tryWrapperForImpl(esValue[implSymbol].sort()); - } - - toString() { - const esValue = this !== null && this !== undefined ? this : globalObject; - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'toString' called on an object that is not a valid instance of URLSearchParams." - ); - } - - return esValue[implSymbol].toString(); - } - - keys() { - if (!exports.is(this)) { - throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams."); - } - return exports.createDefaultIterator(globalObject, this, "key"); - } - - values() { - if (!exports.is(this)) { - throw new globalObject.TypeError( - "'values' called on an object that is not a valid instance of URLSearchParams." - ); - } - return exports.createDefaultIterator(globalObject, this, "value"); - } - - entries() { - if (!exports.is(this)) { - throw new globalObject.TypeError( - "'entries' called on an object that is not a valid instance of URLSearchParams." - ); - } - return exports.createDefaultIterator(globalObject, this, "key+value"); - } - - forEach(callback) { - if (!exports.is(this)) { - throw new globalObject.TypeError( - "'forEach' called on an object that is not a valid instance of URLSearchParams." - ); - } - if (arguments.length < 1) { - throw new globalObject.TypeError( - "Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present." - ); - } - callback = Function.convert(globalObject, callback, { - context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1" - }); - const thisArg = arguments[1]; - let pairs = Array.from(this[implSymbol]); - let i = 0; - while (i < pairs.length) { - const [key, value] = pairs[i].map(utils.tryWrapperForImpl); - callback.call(thisArg, value, key, this); - pairs = Array.from(this[implSymbol]); - i++; - } - } - - get size() { - const esValue = this !== null && this !== undefined ? this : globalObject; - - if (!exports.is(esValue)) { - throw new globalObject.TypeError( - "'get size' called on an object that is not a valid instance of URLSearchParams." - ); - } - - return esValue[implSymbol]["size"]; - } - } - Object.defineProperties(URLSearchParams.prototype, { - append: { enumerable: true }, - delete: { enumerable: true }, - get: { enumerable: true }, - getAll: { enumerable: true }, - has: { enumerable: true }, - set: { enumerable: true }, - sort: { enumerable: true }, - toString: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true }, - forEach: { enumerable: true }, - size: { enumerable: true }, - [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, - [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } - }); - ctorRegistry[interfaceName] = URLSearchParams; - - ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], { - [Symbol.toStringTag]: { - configurable: true, - value: "URLSearchParams Iterator" - } - }); - utils.define(ctorRegistry["URLSearchParams Iterator"], { - next() { - const internal = this && this[utils.iterInternalSymbol]; - if (!internal) { - throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object"); - } - - const { target, kind, index } = internal; - const values = Array.from(target[implSymbol]); - const len = values.length; - if (index >= len) { - return newObjectInRealm(globalObject, { value: undefined, done: true }); - } - - const pair = values[index]; - internal.index = index + 1; - return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind)); - } - }); - - Object.defineProperty(globalObject, interfaceName, { - configurable: true, - writable: true, - value: URLSearchParams - }); -}; - -const Impl = __webpack_require__(/*! ./URLSearchParams-impl.js */ "./node_modules/whatwg-url/lib/URLSearchParams-impl.js"); - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/encoding.js": -/*!*************************************************!*\ - !*** ./node_modules/whatwg-url/lib/encoding.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/* provided dependency */ var TextEncoder = __webpack_require__(/*! text-encoder */ "./node_modules/text-encoder/index.js")["TextEncoder"]; -/* provided dependency */ var TextDecoder = __webpack_require__(/*! text-encoder */ "./node_modules/text-encoder/index.js")["TextDecoder"]; - -const utf8Encoder = new TextEncoder(); -const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); - -function utf8Encode(string) { - return utf8Encoder.encode(string); -} - -function utf8DecodeWithoutBOM(bytes) { - return utf8Decoder.decode(bytes); -} - -module.exports = { - utf8Encode, - utf8DecodeWithoutBOM -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/infra.js": -/*!**********************************************!*\ - !*** ./node_modules/whatwg-url/lib/infra.js ***! - \**********************************************/ -/***/ ((module) => { - -"use strict"; - - -// Note that we take code points as JS numbers, not JS strings. - -function isASCIIDigit(c) { - return c >= 0x30 && c <= 0x39; -} - -function isASCIIAlpha(c) { - return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); -} - -function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); -} - -function isASCIIHex(c) { - return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); -} - -module.exports = { - isASCIIDigit, - isASCIIAlpha, - isASCIIAlphanumeric, - isASCIIHex -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/percent-encoding.js": -/*!*********************************************************!*\ - !*** ./node_modules/whatwg-url/lib/percent-encoding.js ***! - \*********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const { isASCIIHex } = __webpack_require__(/*! ./infra */ "./node_modules/whatwg-url/lib/infra.js"); -const { utf8Encode } = __webpack_require__(/*! ./encoding */ "./node_modules/whatwg-url/lib/encoding.js"); - -function p(char) { - return char.codePointAt(0); -} - -// https://url.spec.whatwg.org/#percent-encode -function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = `0${hex}`; - } - - return `%${hex}`; -} - -// https://url.spec.whatwg.org/#percent-decode -function percentDecodeBytes(input) { - const output = new Uint8Array(input.byteLength); - let outputIndex = 0; - for (let i = 0; i < input.byteLength; ++i) { - const byte = input[i]; - if (byte !== 0x25) { - output[outputIndex++] = byte; - } else if (byte === 0x25 && (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) { - output[outputIndex++] = byte; - } else { - const bytePoint = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16); - output[outputIndex++] = bytePoint; - i += 2; - } - } - - return output.slice(0, outputIndex); -} - -// https://url.spec.whatwg.org/#string-percent-decode -function percentDecodeString(input) { - const bytes = utf8Encode(input); - return percentDecodeBytes(bytes); -} - -// https://url.spec.whatwg.org/#c0-control-percent-encode-set -function isC0ControlPercentEncode(c) { - return c <= 0x1F || c > 0x7E; -} - -// https://url.spec.whatwg.org/#fragment-percent-encode-set -const extraFragmentPercentEncodeSet = new Set([p(" "), p("\""), p("<"), p(">"), p("`")]); -function isFragmentPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#query-percent-encode-set -const extraQueryPercentEncodeSet = new Set([p(" "), p("\""), p("#"), p("<"), p(">")]); -function isQueryPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraQueryPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#special-query-percent-encode-set -function isSpecialQueryPercentEncode(c) { - return isQueryPercentEncode(c) || c === p("'"); -} - -// https://url.spec.whatwg.org/#path-percent-encode-set -const extraPathPercentEncodeSet = new Set([p("?"), p("`"), p("{"), p("}"), p("^")]); -function isPathPercentEncode(c) { - return isQueryPercentEncode(c) || extraPathPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#userinfo-percent-encode-set -const extraUserinfoPercentEncodeSet = - new Set([p("/"), p(":"), p(";"), p("="), p("@"), p("["), p("\\"), p("]"), p("|")]); -function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#component-percent-encode-set -const extraComponentPercentEncodeSet = new Set([p("$"), p("%"), p("&"), p("+"), p(",")]); -function isComponentPercentEncode(c) { - return isUserinfoPercentEncode(c) || extraComponentPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set -const extraURLEncodedPercentEncodeSet = new Set([p("!"), p("'"), p("("), p(")"), p("~")]); -function isURLEncodedPercentEncode(c) { - return isComponentPercentEncode(c) || extraURLEncodedPercentEncodeSet.has(c); -} - -// https://url.spec.whatwg.org/#code-point-percent-encode-after-encoding -// https://url.spec.whatwg.org/#utf-8-percent-encode -// Assuming encoding is always utf-8 allows us to trim one of the logic branches. TODO: support encoding. -// The "-Internal" variant here has code points as JS strings. The external version used by other files has code points -// as JS numbers, like the rest of the codebase. -function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) { - const bytes = utf8Encode(codePoint); - let output = ""; - for (const byte of bytes) { - // Our percentEncodePredicate operates on bytes, not code points, so this is slightly different from the spec. - if (!percentEncodePredicate(byte)) { - output += String.fromCharCode(byte); - } else { - output += percentEncode(byte); - } - } - - return output; -} - -function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) { - return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate); -} - -// https://url.spec.whatwg.org/#string-percent-encode-after-encoding -// https://url.spec.whatwg.org/#string-utf-8-percent-encode -function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) { - let output = ""; - for (const codePoint of input) { - if (spaceAsPlus && codePoint === " ") { - output += "+"; - } else { - output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate); - } - } - return output; -} - -module.exports = { - isC0ControlPercentEncode, - isFragmentPercentEncode, - isQueryPercentEncode, - isSpecialQueryPercentEncode, - isPathPercentEncode, - isUserinfoPercentEncode, - isURLEncodedPercentEncode, - percentDecodeString, - percentDecodeBytes, - utf8PercentEncodeString, - utf8PercentEncodeCodePoint -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/url-state-machine.js": -/*!**********************************************************!*\ - !*** ./node_modules/whatwg-url/lib/url-state-machine.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const tr46 = __webpack_require__(/*! tr46 */ "./node_modules/tr46/index.js"); - -const infra = __webpack_require__(/*! ./infra */ "./node_modules/whatwg-url/lib/infra.js"); -const { utf8DecodeWithoutBOM } = __webpack_require__(/*! ./encoding */ "./node_modules/whatwg-url/lib/encoding.js"); -const { percentDecodeString, utf8PercentEncodeCodePoint, utf8PercentEncodeString, isC0ControlPercentEncode, - isFragmentPercentEncode, isQueryPercentEncode, isSpecialQueryPercentEncode, isPathPercentEncode, - isUserinfoPercentEncode } = __webpack_require__(/*! ./percent-encoding */ "./node_modules/whatwg-url/lib/percent-encoding.js"); - -function p(char) { - return char.codePointAt(0); -} - -const specialSchemes = { - ftp: 21, - file: null, - http: 80, - https: 443, - ws: 80, - wss: 443 -}; - -const failure = Symbol("failure"); - -function countSymbols(str) { - return [...str].length; -} - -function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? undefined : String.fromCodePoint(c); -} - -function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; -} - -function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; -} - -function isWindowsDriveLetterCodePoints(cp1, cp2) { - return infra.isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|")); -} - -function isWindowsDriveLetterString(string) { - return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); -} - -function isNormalizedWindowsDriveLetterString(string) { - return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; -} - -function containsForbiddenHostCodePoint(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; -} - -function containsForbiddenDomainCodePoint(string) { - return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1; -} - -function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; -} - -function isSpecial(url) { - return isSpecialScheme(url.scheme); -} - -function isNotSpecial(url) { - return !isSpecialScheme(url.scheme); -} - -function defaultPort(scheme) { - return specialSchemes[scheme]; -} - -function parseIPv4Number(input) { - if (input === "") { - return failure; - } - - let R = 10; - - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; - } - - if (input === "") { - return 0; - } - - let regex = /[^0-7]/u; - if (R === 10) { - regex = /[^0-9]/u; - } - if (R === 16) { - regex = /[^0-9A-Fa-f]/u; - } - - if (regex.test(input)) { - return failure; - } - - return parseInt(input, R); -} - -function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } - - if (parts.length > 4) { - return failure; - } - - const numbers = []; - for (const part of parts) { - const n = parseIPv4Number(part); - if (n === failure) { - return failure; - } - - numbers.push(n); - } - - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; - } - } - if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) { - return failure; - } - - let ipv4 = numbers.pop(); - let counter = 0; - - for (const n of numbers) { - ipv4 += n * 256 ** (3 - counter); - ++counter; - } - - return ipv4; -} - -function serializeIPv4(address) { - let output = ""; - let n = address; - - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = `.${output}`; - } - n = Math.floor(n / 256); - } - - return output; -} - -function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - - input = Array.from(input, c => c.codePointAt(0)); - - if (input[pointer] === p(":")) { - if (input[pointer + 1] !== p(":")) { - return failure; - } - - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } - - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; - } - - if (input[pointer] === p(":")) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - - let value = 0; - let length = 0; - - while (length < 4 && infra.isASCIIHex(input[pointer])) { - value = value * 0x10 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; - } - - if (input[pointer] === p(".")) { - if (length === 0) { - return failure; - } - - pointer -= length; - - if (pieceIndex > 6) { - return failure; - } - - let numbersSeen = 0; - - while (input[pointer] !== undefined) { - let ipv4Piece = null; - - if (numbersSeen > 0) { - if (input[pointer] === p(".") && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - - if (!infra.isASCIIDigit(input[pointer])) { - return failure; - } - - while (infra.isASCIIDigit(input[pointer])) { - const number = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - - address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; - - ++numbersSeen; - - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - - if (numbersSeen !== 4) { - return failure; - } - - break; - } else if (input[pointer] === p(":")) { - ++pointer; - if (input[pointer] === undefined) { - return failure; - } - } else if (input[pointer] !== undefined) { - return failure; - } - - address[pieceIndex] = value; - ++pieceIndex; - } - - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } - - return address; -} - -function serializeIPv6(address) { - let output = ""; - const compress = findTheIPv6AddressCompressedPieceIndex(address); - let ignore0 = false; - - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - - output += address[pieceIndex].toString(16); - - if (pieceIndex !== 7) { - output += ":"; - } - } - - return output; -} - -function parseHost(input, isOpaque = false) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; - } - - return parseIPv6(input.substring(1, input.length - 1)); - } - - if (isOpaque) { - return parseOpaqueHost(input); - } - - const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); - const asciiDomain = domainToASCII(domain); - if (asciiDomain === failure) { - return failure; - } - - if (endsInANumber(asciiDomain)) { - return parseIPv4(asciiDomain); - } - - return asciiDomain; -} - -function endsInANumber(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length === 1) { - return false; - } - parts.pop(); - } - - const last = parts[parts.length - 1]; - if (parseIPv4Number(last) !== failure) { - return true; - } - - if (/^[0-9]+$/u.test(last)) { - return true; - } - - return false; -} - -function parseOpaqueHost(input) { - if (containsForbiddenHostCodePoint(input)) { - return failure; - } - - return utf8PercentEncodeString(input, isC0ControlPercentEncode); -} - -function findTheIPv6AddressCompressedPieceIndex(address) { - let longestIndex = null; - let longestSize = 1; // only find elements > 1 - let foundIndex = null; - let foundSize = 0; - - for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) { - if (address[pieceIndex] !== 0) { - if (foundSize > longestSize) { - longestIndex = foundIndex; - longestSize = foundSize; - } - - foundIndex = null; - foundSize = 0; - } else { - if (foundIndex === null) { - foundIndex = pieceIndex; - } - ++foundSize; - } - } - - if (foundSize > longestSize) { - return foundIndex; - } - - return longestIndex; -} - -function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } - - // IPv6 serializer - if (host instanceof Array) { - return `[${serializeIPv6(host)}]`; - } - - return host; -} - -function domainToASCII(domain, beStrict = false) { - const result = tr46.toASCII(domain, { - checkHyphens: beStrict, - checkBidi: true, - checkJoiners: true, - useSTD3ASCIIRules: beStrict, - transitionalProcessing: false, - verifyDNSLength: beStrict, - ignoreInvalidPunycode: false - }); - if (result === null) { - return failure; - } - - if (!beStrict) { - if (result === "") { - return failure; - } - if (containsForbiddenDomainCodePoint(result)) { - return failure; - } - } - return result; -} - -function trimControlChars(string) { - // Avoid using regexp because of this V8 bug: https://issues.chromium.org/issues/42204424 - - let start = 0; - let end = string.length; - for (; start < end; ++start) { - if (string.charCodeAt(start) > 0x20) { - break; - } - } - for (; end > start; --end) { - if (string.charCodeAt(end - 1) > 0x20) { - break; - } - } - return string.substring(start, end); -} - -function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/ug, ""); -} - -function shortenPath(url) { - const { path } = url; - if (path.length === 0) { - return; - } - if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { - return; - } - - path.pop(); -} - -function includesCredentials(url) { - return url.username !== "" || url.password !== ""; -} - -function cannotHaveAUsernamePasswordPort(url) { - return url.host === null || url.host === "" || url.scheme === "file"; -} - -function hasAnOpaquePath(url) { - return typeof url.path === "string"; -} - -function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/u.test(string); -} - -function URLStateMachine(input, base, encodingOverride, url, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; - - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null - }; - - const res = trimControlChars(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - } - - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - - this.state = stateOverride || "scheme start"; - - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - - this.input = Array.from(this.input, c => c.codePointAt(0)); - - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); - - // exec state machine - const ret = this[`parse ${this.state}`](c, cStr); - if (!ret) { - break; // terminate algorithm - } else if (ret === failure) { - this.failure = true; - break; - } - } -} - -URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { - if (infra.isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (infra.isASCIIAlphanumeric(c) || c === p("+") || c === p("-") || c === p(".")) { - this.buffer += cStr.toLowerCase(); - } else if (c === p(":")) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } - - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } - - if (this.url.scheme === "file" && this.url.host === "") { - return false; - } - } - this.url.scheme = this.buffer; - if (this.stateOverride) { - if (this.url.port === defaultPort(this.url.scheme)) { - this.url.port = null; - } - return false; - } - this.buffer = ""; - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== p("/") || this.input[this.pointer + 2] !== p("/")) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === p("/")) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.path = ""; - this.state = "opaque path"; - } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || (hasAnOpaquePath(this.base) && c !== p("#"))) { - return failure; - } else if (hasAnOpaquePath(this.base) && c === p("#")) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path; - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { - if (c === p("/") && this.input[this.pointer + 1] === p("/")) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { - if (c === p("/")) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (c === p("/")) { - this.state = "relative slash"; - } else if (isSpecial(this.url) && c === p("\\")) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (!isNaN(c)) { - this.url.query = null; - this.url.path.pop(); - this.state = "path"; - --this.pointer; - } - } - - return true; -}; - -URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === p("/") || c === p("\\"))) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === p("/")) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { - if (c === p("/") && this.input[this.pointer + 1] === p("/")) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== p("/") && c !== p("\\")) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - - return true; -}; - -URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { - if (c === p("@")) { - this.parseError = true; - if (this.atFlag) { - this.buffer = `%40${this.buffer}`; - } - this.atFlag = true; - - // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); - - if (codePoint === p(":") && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || - (isSpecial(this.url) && c === p("\\"))) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse hostname"] = -URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === p(":") && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } - - if (this.stateOverride === "hostname") { - return false; - } - - const host = parseHost(this.buffer, isNotSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "port"; - } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || - (isSpecial(this.url) && c === p("\\"))) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && - (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } - - const host = parseHost(this.buffer, isNotSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === p("[")) { - this.arrFlag = true; - } else if (c === p("]")) { - this.arrFlag = false; - } - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (infra.isASCIIDigit(c)) { - this.buffer += cStr; - } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || - (isSpecial(this.url) && c === p("\\")) || - this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > 2 ** 16 - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -const fileOtherwiseCodePoints = new Set([p("/"), p("\\"), p("?"), p("#")]); - -function startsWithWindowsDriveLetter(input, pointer) { - const length = input.length - pointer; - return length >= 2 && - isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && - (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); -} - -URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; - this.url.host = ""; - - if (c === p("/") || c === p("\\")) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (!isNaN(c)) { - this.url.query = null; - if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { - shortenPath(this.url); - } else { - this.parseError = true; - this.url.path = []; - } - - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === p("/") || c === p("\\")) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (!startsWithWindowsDriveLetter(this.input, this.pointer) && - isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } - this.url.host = this.base.host; - } - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { - if (isNaN(c) || c === p("/") || c === p("\\") || c === p("?") || c === p("#")) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isNotSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - - if (this.stateOverride) { - return false; - } - - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === p("\\")) { - this.parseError = true; - } - this.state = "path"; - - if (c !== p("/") && c !== p("\\")) { - --this.pointer; - } - } else if (!this.stateOverride && c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== undefined) { - this.state = "path"; - if (c !== p("/")) { - --this.pointer; - } - } else if (this.stateOverride && this.url.host === null) { - this.url.path.push(""); - } - - return true; -}; - -URLStateMachine.prototype["parse path"] = function parsePath(c) { - if (isNaN(c) || c === p("/") || (isSpecial(this.url) && c === p("\\")) || - (!this.stateOverride && (c === p("?") || c === p("#")))) { - if (isSpecial(this.url) && c === p("\\")) { - this.parseError = true; - } - - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c !== p("/") && - !(isSpecial(this.url) && c === p("\\"))) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - this.buffer = `${this.buffer[0]}:`; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } - if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += utf8PercentEncodeCodePoint(c, isPathPercentEncode); - } - - return true; -}; - -URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) { - if (c === p("?")) { - this.url.query = ""; - this.state = "query"; - } else if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c === p(" ")) { - const remaining = this.input[this.pointer + 1]; - if (remaining === p("?") || remaining === p("#")) { - this.url.path += "%20"; - } else { - this.url.path += " "; - } - } else { - // TODO: Add: not a URL code point - if (!isNaN(c) && c !== p("%")) { - this.parseError = true; - } - - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - if (!isNaN(c)) { - this.url.path += utf8PercentEncodeCodePoint(c, isC0ControlPercentEncode); - } - } - - return true; -}; - -URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - - if ((!this.stateOverride && c === p("#")) || isNaN(c)) { - const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode; - this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate); - - this.buffer = ""; - - if (c === p("#")) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else if (!isNaN(c)) { - // TODO: If c is not a URL code point and not "%", parse error. - - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (!isNaN(c)) { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === p("%") && - (!infra.isASCIIHex(this.input[this.pointer + 1]) || - !infra.isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode); - } - - return true; -}; - -function serializeURL(url, excludeFragment) { - let output = `${url.scheme}:`; - if (url.host !== null) { - output += "//"; - - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += `:${url.password}`; - } - output += "@"; - } - - output += serializeHost(url.host); - - if (url.port !== null) { - output += `:${url.port}`; - } - } - - if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") { - output += "/."; - } - output += serializePath(url); - - if (url.query !== null) { - output += `?${url.query}`; - } - - if (!excludeFragment && url.fragment !== null) { - output += `#${url.fragment}`; - } - - return output; -} - -function serializeOrigin(tuple) { - let result = `${tuple.scheme}://`; - result += serializeHost(tuple.host); - - if (tuple.port !== null) { - result += `:${tuple.port}`; - } - - return result; -} - -function serializePath(url) { - if (hasAnOpaquePath(url)) { - return url.path; - } - - let output = ""; - for (const segment of url.path) { - output += `/${segment}`; - } - return output; -} - -module.exports.serializeURL = serializeURL; - -module.exports.serializePath = serializePath; - -module.exports.serializeURLOrigin = function (url) { - // https://url.spec.whatwg.org/#concept-url-origin - switch (url.scheme) { - case "blob": { - const pathURL = module.exports.parseURL(serializePath(url)); - if (pathURL === null) { - return "null"; - } - if (pathURL.scheme !== "http" && pathURL.scheme !== "https") { - return "null"; - } - return module.exports.serializeURLOrigin(pathURL); - } - case "ftp": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port - }); - case "file": - // The spec says: - // > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin. - // Browsers tested so far: - // - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g. - // https://bugs.chromium.org/p/chromium/issues/detail?id=37586 - // - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see - // https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs - return "null"; - default: - // serializing an opaque origin returns "null" - return "null"; - } -}; - -module.exports.basicURLParse = function (input, options) { - if (options === undefined) { - options = {}; - } - - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return null; - } - - return usm.url; -}; - -module.exports.setTheUsername = function (url, username) { - url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode); -}; - -module.exports.setThePassword = function (url, password) { - url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode); -}; - -module.exports.serializeHost = serializeHost; - -module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - -module.exports.hasAnOpaquePath = hasAnOpaquePath; - -module.exports.serializeInteger = function (integer) { - return String(integer); -}; - -module.exports.parseURL = function (input, options) { - if (options === undefined) { - options = {}; - } - - // We don't handle blobs, so this just delegates: - return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/urlencoded.js": -/*!***************************************************!*\ - !*** ./node_modules/whatwg-url/lib/urlencoded.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const { utf8Encode, utf8DecodeWithoutBOM } = __webpack_require__(/*! ./encoding */ "./node_modules/whatwg-url/lib/encoding.js"); -const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = __webpack_require__(/*! ./percent-encoding */ "./node_modules/whatwg-url/lib/percent-encoding.js"); - -function p(char) { - return char.codePointAt(0); -} - -// https://url.spec.whatwg.org/#concept-urlencoded-parser -function parseUrlencoded(input) { - const sequences = strictlySplitByteSequence(input, p("&")); - const output = []; - for (const bytes of sequences) { - if (bytes.length === 0) { - continue; - } - - let name, value; - const indexOfEqual = bytes.indexOf(p("=")); - - if (indexOfEqual >= 0) { - name = bytes.slice(0, indexOfEqual); - value = bytes.slice(indexOfEqual + 1); - } else { - name = bytes; - value = new Uint8Array(0); - } - - name = replaceByteInByteSequence(name, 0x2B, 0x20); - value = replaceByteInByteSequence(value, 0x2B, 0x20); - - const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name)); - const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value)); - - output.push([nameString, valueString]); - } - return output; -} - -// https://url.spec.whatwg.org/#concept-urlencoded-string-parser -function parseUrlencodedString(input) { - return parseUrlencoded(utf8Encode(input)); -} - -// https://url.spec.whatwg.org/#concept-urlencoded-serializer -function serializeUrlencoded(tuples) { - // TODO: accept and use encoding argument - - let output = ""; - for (const [i, tuple] of tuples.entries()) { - const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true); - const value = utf8PercentEncodeString(tuple[1], isURLEncodedPercentEncode, true); - - if (i !== 0) { - output += "&"; - } - output += `${name}=${value}`; - } - return output; -} - -function strictlySplitByteSequence(buf, cp) { - const list = []; - let last = 0; - let i = buf.indexOf(cp); - while (i >= 0) { - list.push(buf.slice(last, i)); - last = i + 1; - i = buf.indexOf(cp, last); - } - if (last !== buf.length) { - list.push(buf.slice(last)); - } - return list; -} - -function replaceByteInByteSequence(buf, from, to) { - let i = buf.indexOf(from); - while (i >= 0) { - buf[i] = to; - i = buf.indexOf(from, i + 1); - } - return buf; -} - -module.exports = { - parseUrlencodedString, - serializeUrlencoded -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/lib/utils.js": -/*!**********************************************!*\ - !*** ./node_modules/whatwg-url/lib/utils.js ***! - \**********************************************/ -/***/ ((module, exports) => { - -"use strict"; - - -// Returns "Type(value) is Object" in ES terminology. -function isObject(value) { - return (typeof value === "object" && value !== null) || typeof value === "function"; -} - -const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); - -// Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]` -// instead of `[[Get]]` and `[[Set]]` and only allowing objects -function define(target, source) { - for (const key of Reflect.ownKeys(source)) { - const descriptor = Reflect.getOwnPropertyDescriptor(source, key); - if (descriptor && !Reflect.defineProperty(target, key, descriptor)) { - throw new TypeError(`Cannot redefine property: ${String(key)}`); - } - } -} - -function newObjectInRealm(globalObject, object) { - const ctorRegistry = initCtorRegistry(globalObject); - return Object.defineProperties( - Object.create(ctorRegistry["%Object.prototype%"]), - Object.getOwnPropertyDescriptors(object) - ); -} - -const wrapperSymbol = Symbol("wrapper"); -const implSymbol = Symbol("impl"); -const sameObjectCaches = Symbol("SameObject caches"); -const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); - -const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype); - -function initCtorRegistry(globalObject) { - if (hasOwn(globalObject, ctorRegistrySymbol)) { - return globalObject[ctorRegistrySymbol]; - } - - const ctorRegistry = Object.create(null); - - // In addition to registering all the WebIDL2JS-generated types in the constructor registry, - // we also register a few intrinsics that we make use of in generated code, since they are not - // easy to grab from the globalObject variable. - ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype; - ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf( - Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()) - ); - - try { - ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf( - Object.getPrototypeOf( - globalObject.eval("(async function* () {})").prototype - ) - ); - } catch { - ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype; - } - - globalObject[ctorRegistrySymbol] = ctorRegistry; - return ctorRegistry; -} - -function getSameObject(wrapper, prop, creator) { - if (!wrapper[sameObjectCaches]) { - wrapper[sameObjectCaches] = Object.create(null); - } - - if (prop in wrapper[sameObjectCaches]) { - return wrapper[sameObjectCaches][prop]; - } - - wrapper[sameObjectCaches][prop] = creator(); - return wrapper[sameObjectCaches][prop]; -} - -function wrapperForImpl(impl) { - return impl ? impl[wrapperSymbol] : null; -} - -function implForWrapper(wrapper) { - return wrapper ? wrapper[implSymbol] : null; -} - -function tryWrapperForImpl(impl) { - const wrapper = wrapperForImpl(impl); - return wrapper ? wrapper : impl; -} - -function tryImplForWrapper(wrapper) { - const impl = implForWrapper(wrapper); - return impl ? impl : wrapper; -} - -const iterInternalSymbol = Symbol("internal"); - -function isArrayIndexPropName(P) { - if (typeof P !== "string") { - return false; - } - const i = P >>> 0; - if (i === 2 ** 32 - 1) { - return false; - } - const s = `${i}`; - if (P !== s) { - return false; - } - return true; -} - -const byteLengthGetter = - Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; -function isArrayBuffer(value) { - try { - byteLengthGetter.call(value); - return true; - } catch (e) { - return false; - } -} - -function iteratorResult([key, value], kind) { - let result; - switch (kind) { - case "key": - result = key; - break; - case "value": - result = value; - break; - case "key+value": - result = [key, value]; - break; - } - return { value: result, done: false }; -} - -const supportsPropertyIndex = Symbol("supports property index"); -const supportedPropertyIndices = Symbol("supported property indices"); -const supportsPropertyName = Symbol("supports property name"); -const supportedPropertyNames = Symbol("supported property names"); -const indexedGet = Symbol("indexed property get"); -const indexedSetNew = Symbol("indexed property set new"); -const indexedSetExisting = Symbol("indexed property set existing"); -const namedGet = Symbol("named property get"); -const namedSetNew = Symbol("named property set new"); -const namedSetExisting = Symbol("named property set existing"); -const namedDelete = Symbol("named property delete"); - -const asyncIteratorNext = Symbol("async iterator get the next iteration result"); -const asyncIteratorReturn = Symbol("async iterator return steps"); -const asyncIteratorInit = Symbol("async iterator initialization steps"); -const asyncIteratorEOI = Symbol("async iterator end of iteration"); - -module.exports = exports = { - isObject, - hasOwn, - define, - newObjectInRealm, - wrapperSymbol, - implSymbol, - getSameObject, - ctorRegistrySymbol, - initCtorRegistry, - wrapperForImpl, - implForWrapper, - tryWrapperForImpl, - tryImplForWrapper, - iterInternalSymbol, - isArrayBuffer, - isArrayIndexPropName, - supportsPropertyIndex, - supportedPropertyIndices, - supportsPropertyName, - supportedPropertyNames, - indexedGet, - indexedSetNew, - indexedSetExisting, - namedGet, - namedSetNew, - namedSetExisting, - namedDelete, - asyncIteratorNext, - asyncIteratorReturn, - asyncIteratorInit, - asyncIteratorEOI, - iteratorResult -}; - - -/***/ }), - -/***/ "./node_modules/whatwg-url/webidl2js-wrapper.js": -/*!******************************************************!*\ - !*** ./node_modules/whatwg-url/webidl2js-wrapper.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const URL = __webpack_require__(/*! ./lib/URL */ "./node_modules/whatwg-url/lib/URL.js"); -const URLSearchParams = __webpack_require__(/*! ./lib/URLSearchParams */ "./node_modules/whatwg-url/lib/URLSearchParams.js"); - -exports.URL = URL; -exports.URLSearchParams = URLSearchParams; - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. -(() => { -"use strict"; -/*!****************************!*\ - !*** ./src/source-map.mjs ***! - \****************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ runTest: () => (/* binding */ runTest) -/* harmony export */ }); -/* harmony import */ var source_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! source-map */ "./node_modules/source-map/source-map.js"); -// Copyright 2017 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - -const payloads = [ - "lodash-4.17.4.min.js.map", - "preact-10.27.1.min.module.js.map", - "source-map.min-0.5.7.js.map", - "underscore-1.13.7.min.js.map", -]; - -async function runTest(fileData) { - const testData = payloads.map((name) => fileData[name]); - - source_map__WEBPACK_IMPORTED_MODULE_0__.SourceMapConsumer.initialize({ - "lib/mappings.wasm": fileData["source-map/lib/mappings.wasm"], - }); - - for (const payload of testData) { - // Parse the source map first... - const smc = await new source_map__WEBPACK_IMPORTED_MODULE_0__.SourceMapConsumer(payload); - // ...then serialize the parsed source map to a String. - const smg = source_map__WEBPACK_IMPORTED_MODULE_0__.SourceMapGenerator.fromSourceMap(smc); - - // Create a SourceNode from the generated code and a SourceMapConsumer. - const fswsm = await source_map__WEBPACK_IMPORTED_MODULE_0__.SourceNode.fromStringWithSourceMap( - payload, - smc - ); - - return [smg.toString(), fswsm.toString()]; - } -} - -})(); - -self.WTBenchmark = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/web-tooling-benchmark/dist/source-map.bundle.min.js b/web-tooling-benchmark/dist/source-map.bundle.min.js new file mode 100644 index 00000000..02c82e9d --- /dev/null +++ b/web-tooling-benchmark/dist/source-map.bundle.min.js @@ -0,0 +1 @@ +(()=>{var u={1683:(u,e,t)=>{const r=t(54041).SourceMapGenerator,n=t(90251),o=/(\r?\n)/,s="$$$isSourceNode$$$";class i{constructor(u,e,t,r,n){this.children=[],this.sourceContents={},this.line=null==u?null:u,this.column=null==e?null:e,this.source=null==t?null:t,this.name=null==n?null:n,this[s]=!0,null!=r&&this.add(r)}static fromStringWithSourceMap(u,e,t){const r=new i,s=u.split(o);let A=0;const a=function(){return u()+(u()||"");function u(){return A=0;e--)this.prepend(u[e]);else{if(!u[s]&&"string"!=typeof u)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);this.children.unshift(u)}return this}walk(u){let e;for(let t=0,r=this.children.length;t0){for(e=[],t=0;t{"use strict";const r=t(76648),n=t(52682);e.URL=r,e.URLSearchParams=n},17092:(u,e,t)=>{const r=t(32364);e.encode=function(u){let e,t="",n=function(u){return u<0?1+(-u<<1):0+(u<<1)}(u);do{e=31&n,n>>>=5,n>0&&(e|=32),t+=r.encode(e)}while(n>0);return t}},18445:u=>{"use strict";u.exports.STATUS_MAPPING={mapped:1,valid:2,disallowed:3,deviation:6,ignored:7}},19665:(u,e,t)=>{e.SourceMapGenerator=t(54041).SourceMapGenerator,e.SourceMapConsumer=t(47446).SourceMapConsumer,e.SourceNode=t(1683).SourceNode},28991:(u,e,t)=>{const r=t(46257);function n(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}let o=null;u.exports=function(){if(o)return o;const u=[];return o=r().then(e=>WebAssembly.instantiate(e,{env:{mapping_callback(e,t,r,o,s,i,A,a,F,E){const l=new n;l.generatedLine=e+1,l.generatedColumn=t,r&&(l.lastGeneratedColumn=o-1),s&&(l.source=i,l.originalLine=A+1,l.originalColumn=a,F&&(l.name=E)),u[u.length-1](l)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(e=>({exports:e.instance.exports,withMappingCallback:(e,t)=>{u.push(e);try{t()}finally{u.pop()}}})).then(null,u=>{throw o=null,u}),o}},32364:(u,e)=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(u){if(0<=u&&u{"use strict";const r=t(48379),n=t(80378),o=t(92472),{STATUS_MAPPING:s}=t(18445);function i(u){return/[^\x00-\x7F]/u.test(u)}function A(u){let e=0,t=o.length-1;for(;e<=t;){const r=Math.floor((e+t)/2),n=o[r],s=Array.isArray(n[0])?n[0][0]:n[0],i=Array.isArray(n[0])?n[0][1]:n[0];if(s<=u&&i>=u)return n.slice(1);s>u?t=r-1:e=r+1}return null}function a(u,{checkHyphens:e,checkBidi:t,checkJoiners:r,transitionalProcessing:o,useSTD3ASCIIRules:i,isBidi:a}){if(0===u.length)return!0;if(u.normalize("NFC")!==u)return!1;const F=Array.from(u);if(e&&("-"===F[2]&&"-"===F[3]||u.startsWith("-")||u.endsWith("-")))return!1;if(!e&&u.startsWith("xn--"))return!1;if(u.includes("."))return!1;if(n.combiningMarks.test(F[0]))return!1;for(const u of F){const e=u.codePointAt(0),[t]=A(e);if(o){if(t!==s.valid)return!1}else if(t!==s.valid&&t!==s.deviation)return!1;if(i&&e<=127&&!/^(?:[a-z]|[0-9]|-)$/u.test(u))return!1}if(r){let u=0;for(const[e,t]of F.entries())if("‌"===t||"‍"===t){if(e>0){if(n.combiningClassVirama.test(F[e-1]))continue;if("‌"===t){const t=F.indexOf("‌",e+1),r=t<0?F.slice(u):F.slice(u,t);if(n.validZWNJ.test(r.join(""))){u=e+1;continue}}}return!1}}if(t&&a){let e;if(n.bidiS1LTR.test(F[0]))e=!1;else{if(!n.bidiS1RTL.test(F[0]))return!1;e=!0}if(e){if(!n.bidiS2.test(u)||!n.bidiS3.test(u)||n.bidiS4EN.test(u)&&n.bidiS4AN.test(u))return!1}else if(!n.bidiS5.test(u)||!n.bidiS6.test(u))return!1}return!0}function F(u,e){let t=function(u,{transitionalProcessing:e}){let t="";for(const r of u){const[u,n]=A(r.codePointAt(0));switch(u){case s.disallowed:t+=r;break;case s.ignored:break;case s.mapped:t+=e&&"ẞ"===r?"ss":n;break;case s.deviation:t+=e?n:r;break;case s.valid:t+=r}}return t}(u,e);t=t.normalize("NFC");const o=t.split("."),F=function(u){const e=u.map(u=>{if(u.startsWith("xn--"))try{return r.decode(u.substring(4))}catch{return""}return u}).join(".");return n.bidiDomain.test(e)}(o);let E=!1;for(const[u,t]of o.entries()){let n=t,s=e.transitionalProcessing;if(n.startsWith("xn--")){if(i(n)){E=!0;continue}try{n=r.decode(n.substring(4))}catch{if(!e.ignoreInvalidPunycode){E=!0;continue}}o[u]=n,""!==n&&i(n)||(E=!0),s=!1}if(E)continue;a(n,{...e,transitionalProcessing:s,isBidi:F})||(E=!0)}return{string:o.join("."),error:E}}u.exports={toASCII:function(u,{checkHyphens:e=!1,checkBidi:t=!1,checkJoiners:n=!1,useSTD3ASCIIRules:o=!1,verifyDNSLength:s=!1,transitionalProcessing:A=!1,ignoreInvalidPunycode:a=!1}={}){const E=F(u,{checkHyphens:e,checkBidi:t,checkJoiners:n,useSTD3ASCIIRules:o,transitionalProcessing:A,ignoreInvalidPunycode:a});let l=E.string.split(".");if(l=l.map(u=>{if(i(u))try{return`xn--${r.encode(u)}`}catch{E.error=!0}return u}),s){const u=l.join(".").length;(u>253||0===u)&&(E.error=!0);for(let u=0;u63||0===l[u].length){E.error=!0;break}}return E.error?null:l.join(".")},toUnicode:function(u,{checkHyphens:e=!1,checkBidi:t=!1,checkJoiners:r=!1,useSTD3ASCIIRules:n=!1,transitionalProcessing:o=!1,ignoreInvalidPunycode:s=!1}={}){const i=F(u,{checkHyphens:e,checkBidi:t,checkJoiners:r,useSTD3ASCIIRules:n,transitionalProcessing:o,ignoreInvalidPunycode:s});return{domain:i.string,error:i.error}}}},41163:(u,e)=>{function t(u,r,n,o,s,i){const A=Math.floor((r-u)/2)+u,a=s(n,o[A],!0);return 0===a?A:a>0?r-A>1?t(A,r,n,o,s,i):i===e.LEAST_UPPER_BOUND?r1?t(u,A,n,o,s,i):i==e.LEAST_UPPER_BOUND?A:u<0?-1:u}e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2,e.search=function(u,r,n,o){if(0===r.length)return-1;let s=t(-1,r.length,u,r,n,o||e.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===n(r[s],r[s-1],!0);)--s;return s}},41656:(u,e,t)=>{"use strict";const{isASCIIHex:r}=t(47167),{utf8Encode:n}=t(58408);function o(u){return u.codePointAt(0)}function s(u){let e=u.toString(16).toUpperCase();return 1===e.length&&(e=`0${e}`),`%${e}`}function i(u){const e=new Uint8Array(u.byteLength);let t=0;for(let n=0;n126}const a=new Set([o(" "),o('"'),o("<"),o(">"),o("`")]);const F=new Set([o(" "),o('"'),o("#"),o("<"),o(">")]);function E(u){return A(u)||F.has(u)}const l=new Set([o("?"),o("`"),o("{"),o("}"),o("^")]);function C(u){return E(u)||l.has(u)}const D=new Set([o("/"),o(":"),o(";"),o("="),o("@"),o("["),o("\\"),o("]"),o("|")]);function B(u){return C(u)||D.has(u)}const c=new Set([o("$"),o("%"),o("&"),o("+"),o(",")]);const h=new Set([o("!"),o("'"),o("("),o(")"),o("~")]);function p(u,e){const t=n(u);let r="";for(const u of t)e(u)?r+=s(u):r+=String.fromCharCode(u);return r}u.exports={isC0ControlPercentEncode:A,isFragmentPercentEncode:function(u){return A(u)||a.has(u)},isQueryPercentEncode:E,isSpecialQueryPercentEncode:function(u){return E(u)||u===o("'")},isPathPercentEncode:C,isUserinfoPercentEncode:B,isURLEncodedPercentEncode:function(u){return function(u){return B(u)||c.has(u)}(u)||h.has(u)},percentDecodeString:function(u){return i(n(u))},percentDecodeBytes:i,utf8PercentEncodeString:function(u,e,t=!1){let r="";for(const n of u)r+=t&&" "===n?"+":p(n,e);return r},utf8PercentEncodeCodePoint:function(u,e){return p(String.fromCodePoint(u),e)}}},43302:(u,e,t)=>{const r=t(90251);e.P=class{constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(u,e){this._array.forEach(u,e)}add(u){!function(u,e){const t=u.generatedLine,n=e.generatedLine,o=u.generatedColumn,s=e.generatedColumn;return n>t||n==t&&s>=o||r.compareByGeneratedPositionsInflated(u,e)<=0}(this._last,u)?(this._sorted=!1,this._array.push(u)):(this._last=u,this._array.push(u))}toArray(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},44817:(u,e,t)=>{"use strict";const r=t(85616),n=t(46892);e.convert=(u,e,{context:t="The provided value"}={})=>{if("function"!=typeof e)throw new u.TypeError(t+" is not a function");function o(...o){const s=n.tryWrapperForImpl(this);let i;for(let u=0;u{for(let u=0;u{"use strict";let e=null;u.exports=function(){if("string"==typeof e)return fetch(e).then(u=>u.arrayBuffer());if(e instanceof ArrayBuffer)return Promise.resolve(e);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},u.exports.initialize=u=>{e=u}},46892:(u,e)=>{"use strict";const t=Function.prototype.call.bind(Object.prototype.hasOwnProperty);const r=Symbol("wrapper"),n=Symbol("impl"),o=Symbol("SameObject caches"),s=Symbol.for("[webidl2js] constructor registry"),i=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function A(u){if(t(u,s))return u[s];const e=Object.create(null);e["%Object.prototype%"]=u.Object.prototype,e["%IteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf((new u.Array)[Symbol.iterator]()));try{e["%AsyncIteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(u.eval("(async function* () {})").prototype))}catch{e["%AsyncIteratorPrototype%"]=i}return u[s]=e,e}function a(u){return u?u[r]:null}function F(u){return u?u[n]:null}const E=Symbol("internal");const l=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;const C=Symbol("supports property index"),D=Symbol("supported property indices"),B=Symbol("supports property name"),c=Symbol("supported property names"),h=Symbol("indexed property get"),p=Symbol("indexed property set new"),f=Symbol("indexed property set existing"),d=Symbol("named property get"),g=Symbol("named property set new"),m=Symbol("named property set existing"),y=Symbol("named property delete"),b=Symbol("async iterator get the next iteration result"),w=Symbol("async iterator return steps"),S=Symbol("async iterator initialization steps"),_=Symbol("async iterator end of iteration");u.exports={isObject:function(u){return"object"==typeof u&&null!==u||"function"==typeof u},hasOwn:t,define:function(u,e){for(const t of Reflect.ownKeys(e)){const r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&!Reflect.defineProperty(u,t,r))throw new TypeError(`Cannot redefine property: ${String(t)}`)}},newObjectInRealm:function(u,e){const t=A(u);return Object.defineProperties(Object.create(t["%Object.prototype%"]),Object.getOwnPropertyDescriptors(e))},wrapperSymbol:r,implSymbol:n,getSameObject:function(u,e,t){return u[o]||(u[o]=Object.create(null)),e in u[o]||(u[o][e]=t()),u[o][e]},ctorRegistrySymbol:s,initCtorRegistry:A,wrapperForImpl:a,implForWrapper:F,tryWrapperForImpl:function(u){const e=a(u);return e||u},tryImplForWrapper:function(u){const e=F(u);return e||u},iterInternalSymbol:E,isArrayBuffer:function(u){try{return l.call(u),!0}catch(u){return!1}},isArrayIndexPropName:function(u){if("string"!=typeof u)return!1;const e=u>>>0;return e!==2**32-1&&u===`${e}`},supportsPropertyIndex:C,supportedPropertyIndices:D,supportsPropertyName:B,supportedPropertyNames:c,indexedGet:h,indexedSetNew:p,indexedSetExisting:f,namedGet:d,namedSetNew:g,namedSetExisting:m,namedDelete:y,asyncIteratorNext:b,asyncIteratorReturn:w,asyncIteratorInit:S,asyncIteratorEOI:_,iteratorResult:function([u,e],t){let r;switch(t){case"key":r=u;break;case"value":r=e;break;case"key+value":r=[u,e]}return{value:r,done:!1}}}},47167:u=>{"use strict";function e(u){return u>=48&&u<=57}function t(u){return u>=65&&u<=90||u>=97&&u<=122}u.exports={isASCIIDigit:e,isASCIIAlpha:t,isASCIIAlphanumeric:function(u){return t(u)||e(u)},isASCIIHex:function(u){return e(u)||u>=65&&u<=70||u>=97&&u<=102}}},47446:(u,e,t)=>{const r=t(90251),n=t(41163),o=t(80735).C,s=(t(17092),t(46257)),i=t(28991),A=Symbol("smcInternal");class a{constructor(u,e){return u==A?Promise.resolve(this):function(u,e){let t=u;"string"==typeof u&&(t=r.parseSourceMapInput(u));const n=null!=t.sections?new E(t,e):new F(t,e);return Promise.resolve(n)}(u,e)}static initialize(u){s.initialize(u["lib/mappings.wasm"])}static fromSourceMap(u,e){return function(u,e){return F.fromSourceMap(u,e)}(u,e)}static async with(u,e,t){const r=await new a(u,e);try{return await t(r)}finally{r.destroy()}}eachMapping(u,e,t){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(u){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}}a.prototype._version=3,a.GENERATED_ORDER=1,a.ORIGINAL_ORDER=2,a.GREATEST_LOWER_BOUND=1,a.LEAST_UPPER_BOUND=2,e.SourceMapConsumer=a;class F extends a{constructor(u,e){return super(A).then(t=>{let n=u;"string"==typeof u&&(n=r.parseSourceMapInput(u));const s=r.getArg(n,"version"),A=r.getArg(n,"sources").map(String),a=r.getArg(n,"names",[]),F=r.getArg(n,"sourceRoot",null),E=r.getArg(n,"sourcesContent",null),l=r.getArg(n,"mappings"),C=r.getArg(n,"file",null),D=r.getArg(n,"x_google_ignoreList",null);if(s!=t._version)throw new Error("Unsupported version: "+s);return t._sourceLookupCache=new Map,t._names=o.fromArray(a.map(String),!0),t._sources=o.fromArray(A,!0),t._absoluteSources=o.fromArray(t._sources.toArray().map(function(u){return r.computeSourceURL(F,u,e)}),!0),t.sourceRoot=F,t.sourcesContent=E,t._mappings=l,t._sourceMapURL=e,t.file=C,t.x_google_ignoreList=D,t._computedColumnSpans=!1,t._mappingsPtr=0,t._wasm=null,i().then(u=>(t._wasm=u,t))})}_findSourceIndex(u){const e=this._sourceLookupCache.get(u);if("number"==typeof e)return e;const t=r.computeSourceURL(null,u,this._sourceMapURL);if(this._absoluteSources.has(t)){const e=this._absoluteSources.indexOf(t);return this._sourceLookupCache.set(u,e),e}const n=r.computeSourceURL(this.sourceRoot,u,this._sourceMapURL);if(this._absoluteSources.has(n)){const e=this._absoluteSources.indexOf(n);return this._sourceLookupCache.set(u,e),e}return-1}static fromSourceMap(u,e){return new F(u.toString())}get sources(){return this._absoluteSources.toArray()}_getMappingsPtr(){return 0===this._mappingsPtr&&this._parseMappings(),this._mappingsPtr}_parseMappings(){const u=this._mappings,e=u.length,t=this._wasm.exports.allocate_mappings(e)>>>0,r=new Uint8Array(this._wasm.exports.memory.buffer,t,e);for(let t=0;t{null!==e.source&&(e.source=this._absoluteSources.at(e.source),null!==e.name&&(e.name=this._names.at(e.name))),this._computedColumnSpans&&null===e.lastGeneratedColumn&&(e.lastGeneratedColumn=1/0),u.call(r,e)},()=>{switch(n){case a.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case a.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(u){let e=r.getArg(u,"source");const t=r.getArg(u,"line"),n=u.column||0;if(e=this._findSourceIndex(e),e<0)return[];if(t<1)throw new Error("Line numbers must be >= 1");if(n<0)throw new Error("Column numbers must be >= 0");const o=[];return this._wasm.withMappingCallback(u=>{let e=u.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),o.push({line:u.generatedLine,column:u.generatedColumn,lastColumn:e})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),e,t-1,"column"in u,n)}),o}destroy(){0!==this._mappingsPtr&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(u){const e={generatedLine:r.getArg(u,"line"),generatedColumn:r.getArg(u,"column")};if(e.generatedLine<1)throw new Error("Line numbers must be >= 1");if(e.generatedColumn<0)throw new Error("Column numbers must be >= 0");let t,n=r.getArg(u,"bias",a.GREATEST_LOWER_BOUND);if(null==n&&(n=a.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(u=>t=u,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),e.generatedLine-1,e.generatedColumn,n)}),t&&t.generatedLine===e.generatedLine){let u=r.getArg(t,"source",null);null!==u&&(u=this._absoluteSources.at(u));let e=r.getArg(t,"name",null);return null!==e&&(e=this._names.at(e)),{source:u,line:r.getArg(t,"originalLine",null),column:r.getArg(t,"originalColumn",null),name:e}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(u){return null==u}))}sourceContentFor(u,e){if(!this.sourcesContent)return null;const t=this._findSourceIndex(u);if(t>=0)return this.sourcesContent[t];if(e)return null;throw new Error('"'+u+'" is not in the SourceMap.')}generatedPositionFor(u){let e=r.getArg(u,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};const t={source:e,originalLine:r.getArg(u,"line"),originalColumn:r.getArg(u,"column")};if(t.originalLine<1)throw new Error("Line numbers must be >= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");let n,o=r.getArg(u,"bias",a.GREATEST_LOWER_BOUND);if(null==o&&(o=a.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(u=>n=u,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),t.source,t.originalLine-1,t.originalColumn,o)}),n&&n.source===t.source){let u=n.lastGeneratedColumn;return this._computedColumnSpans&&null===u&&(u=1/0),{line:r.getArg(n,"generatedLine",null),column:r.getArg(n,"generatedColumn",null),lastColumn:u}}return{line:null,column:null,lastColumn:null}}}F.prototype.consumer=a;class E extends a{constructor(u,e){return super(A).then(t=>{let n=u;"string"==typeof u&&(n=r.parseSourceMapInput(u));const o=r.getArg(n,"version"),s=r.getArg(n,"sections");if(o!=t._version)throw new Error("Unsupported version: "+o);let i={line:-1,column:0};return Promise.all(s.map(u=>{if(u.url)throw new Error("Support for url field in sections not implemented.");const t=r.getArg(u,"offset"),n=r.getArg(t,"line"),o=r.getArg(t,"column");if(n({generatedOffset:{generatedLine:n+1,generatedColumn:o+1},consumer:u}))})).then(u=>(t._sections=u,t))})}get sources(){const u=[];for(let e=0;e=0?this._sections[e]:null,n=e>=0&&e+1=0?this._sections[e]:null,n=e>=0&&e+1{const e=t.generatedOffset.generatedLine-1,r=t.generatedOffset.generatedColumn-1;return 1===u.line&&(u.column+=r,"number"==typeof u.lastColumn&&(u.lastColumn+=r)),u.lastColumn===1/0&&n&&u.line===n.generatedOffset.generatedLine&&(u.lastColumn=n.generatedOffset.generatedColumn-2),u.line+=e,u}):[]}eachMapping(u,e,t){this._sections.forEach((r,n)=>{const o=n+1{"use strict";t.r(e),t.d(e,{decode:()=>p,default:()=>m,encode:()=>f,toASCII:()=>g,toUnicode:()=>d,ucs2decode:()=>C,ucs2encode:()=>D});const r=2147483647,n=36,o=/^xn--/,s=/[^\0-\x7F]/,i=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},a=Math.floor,F=String.fromCharCode;function E(u){throw new RangeError(A[u])}function l(u,e){const t=u.split("@");let r="";t.length>1&&(r=t[0]+"@",u=t[1]);const n=function(u,e){const t=[];let r=u.length;for(;r--;)t[r]=e(u[r]);return t}((u=u.replace(i,".")).split("."),e).join(".");return r+n}function C(u){const e=[];let t=0;const r=u.length;for(;t=55296&&n<=56319&&tString.fromCodePoint(...u),B=function(u){return u>=48&&u<58?u-48+26:u>=65&&u<91?u-65:u>=97&&u<123?u-97:n},c=function(u,e){return u+22+75*(u<26)-((0!=e)<<5)},h=function(u,e,t){let r=0;for(u=t?a(u/700):u>>1,u+=a(u/e);u>455;r+=n)u=a(u/35);return a(r+36*u/(u+38))},p=function(u){const e=[],t=u.length;let o=0,s=128,i=72,A=u.lastIndexOf("-");A<0&&(A=0);for(let t=0;t=128&&E("not-basic"),e.push(u.charCodeAt(t));for(let F=A>0?A+1:0;F=t&&E("invalid-input");const A=B(u.charCodeAt(F++));A>=n&&E("invalid-input"),A>a((r-o)/e)&&E("overflow"),o+=A*e;const l=s<=i?1:s>=i+26?26:s-i;if(Aa(r/C)&&E("overflow"),e*=C}const l=e.length+1;i=h(o-A,l,0==A),a(o/l)>r-s&&E("overflow"),s+=a(o/l),o%=l,e.splice(o++,0,s)}return String.fromCodePoint(...e)},f=function(u){const e=[],t=(u=C(u)).length;let o=128,s=0,i=72;for(const t of u)t<128&&e.push(F(t));const A=e.length;let l=A;for(A&&e.push("-");l=o&&ea((r-s)/C)&&E("overflow"),s+=(t-o)*C,o=t;for(const t of u)if(tr&&E("overflow"),t===o){let u=s;for(let t=n;;t+=n){const r=t<=i?1:t>=i+26?26:t-i;if(u{"use strict";const r=t(85616),n=t(46892),o=t(44817),s=n.newObjectInRealm,i=n.implSymbol,A=n.ctorRegistrySymbol,a="URLSearchParams";function F(u,e){let t;return void 0!==e&&(t=e.prototype),n.isObject(t)||(t=u[A].URLSearchParams.prototype),Object.create(t)}e.is=u=>n.isObject(u)&&n.hasOwn(u,i)&&u[i]instanceof l.implementation,e.isImpl=u=>n.isObject(u)&&u instanceof l.implementation,e.convert=(u,t,{context:r="The provided value"}={})=>{if(e.is(t))return n.implForWrapper(t);throw new u.TypeError(`${r} is not of type 'URLSearchParams'.`)},e.createDefaultIterator=(u,e,t)=>{const r=u[A]["URLSearchParams Iterator"],o=Object.create(r);return Object.defineProperty(o,n.iterInternalSymbol,{value:{target:e,kind:t,index:0},configurable:!0}),o},e.create=(u,t,r)=>{const n=F(u);return e.setup(n,u,t,r)},e.createImpl=(u,t,r)=>{const o=e.create(u,t,r);return n.implForWrapper(o)},e._internalSetup=(u,e)=>{},e.setup=(u,t,r=[],o={})=>(o.wrapper=u,e._internalSetup(u,t),Object.defineProperty(u,i,{value:new l.implementation(t,r,o),configurable:!0}),u[i][n.wrapperSymbol]=u,l.init&&l.init(u[i]),u),e.new=(u,t)=>{const r=F(u,t);return e._internalSetup(r,u),Object.defineProperty(r,i,{value:Object.create(l.implementation.prototype),configurable:!0}),r[i][n.wrapperSymbol]=r,l.init&&l.init(r[i]),r[i]};const E=new Set(["Window","Worker"]);e.install=(u,t)=>{if(!t.some(u=>E.has(u)))return;const A=n.initCtorRegistry(u);class F{constructor(){const t=[];{let e=arguments[0];if(void 0!==e)if(n.isObject(e))if(void 0!==e[Symbol.iterator]){if(!n.isObject(e))throw new u.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");{const t=[],o=e;for(let e of o){if(!n.isObject(e))throw new u.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");{const t=[],n=e;for(let e of n)e=r.USVString(e,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:u}),t.push(e);e=t}t.push(e)}e=t}}else{if(!n.isObject(e))throw new u.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");{const t=Object.create(null);for(const n of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,n);if(o&&o.enumerable){let o=n;o=r.USVString(o,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:u});let s=e[n];s=r.USVString(s,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:u}),t[o]=s}}e=t}}else e=r.USVString(e,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:u});else e="";t.push(e)}return e.setup(Object.create(new.target.prototype),u,t)}append(t,o){const s=null!=this?this:u;if(!e.is(s))throw new u.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new u.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);const A=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:u}),A.push(e)}{let e=arguments[1];e=r.USVString(e,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:u}),A.push(e)}return n.tryWrapperForImpl(s[i].append(...A))}delete(t){const o=null!=this?this:u;if(!e.is(o))throw new u.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new u.TypeError(`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const s=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:u}),s.push(e)}{let e=arguments[1];void 0!==e&&(e=r.USVString(e,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:u})),s.push(e)}return n.tryWrapperForImpl(o[i].delete(...s))}get(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new u.TypeError(`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const o=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:u}),o.push(e)}return n[i].get(...o)}getAll(t){const o=null!=this?this:u;if(!e.is(o))throw new u.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new u.TypeError(`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const s=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:u}),s.push(e)}return n.tryWrapperForImpl(o[i].getAll(...s))}has(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new u.TypeError(`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const o=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:u}),o.push(e)}{let e=arguments[1];void 0!==e&&(e=r.USVString(e,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:u})),o.push(e)}return n[i].has(...o)}set(t,o){const s=null!=this?this:u;if(!e.is(s))throw new u.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new u.TypeError(`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);const A=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:u}),A.push(e)}{let e=arguments[1];e=r.USVString(e,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:u}),A.push(e)}return n.tryWrapperForImpl(s[i].set(...A))}sort(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return n.tryWrapperForImpl(t[i].sort())}toString(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return t[i].toString()}keys(){if(!e.is(this))throw new u.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(u,this,"key")}values(){if(!e.is(this))throw new u.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(u,this,"value")}entries(){if(!e.is(this))throw new u.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(u,this,"key+value")}forEach(t){if(!e.is(this))throw new u.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new u.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");t=o.convert(u,t,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});const r=arguments[1];let s=Array.from(this[i]),A=0;for(;A=A.length)return s(u,{value:void 0,done:!0});const a=A[o];return e.index=o+1,s(u,n.iteratorResult(a.map(n.tryWrapperForImpl),r))}}),Object.defineProperty(u,a,{configurable:!0,writable:!0,value:F})};const l=t(68549)},54041:(u,e,t)=>{const r=t(17092),n=t(90251),o=t(80735).C,s=t(43302).P;class i{constructor(u){u||(u={}),this._file=n.getArg(u,"file",null),this._sourceRoot=n.getArg(u,"sourceRoot",null),this._skipValidation=n.getArg(u,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new s,this._sourcesContents=null}static fromSourceMap(u){const e=u.sourceRoot,t=new i({file:u.file,sourceRoot:e});return u.eachMapping(function(u){const r={generated:{line:u.generatedLine,column:u.generatedColumn}};null!=u.source&&(r.source=u.source,null!=e&&(r.source=n.relative(e,r.source)),r.original={line:u.originalLine,column:u.originalColumn},null!=u.name&&(r.name=u.name)),t.addMapping(r)}),u.sources.forEach(function(r){let o=r;null!=e&&(o=n.relative(e,r)),t._sources.has(o)||t._sources.add(o);const s=u.sourceContentFor(r);null!=s&&t.setSourceContent(r,s)}),t}addMapping(u){const e=n.getArg(u,"generated"),t=n.getArg(u,"original",null);let r=n.getArg(u,"source",null),o=n.getArg(u,"name",null);this._skipValidation||this._validateMapping(e,t,r,o),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:t&&t.line,originalColumn:t&&t.column,source:r,name:o})}setSourceContent(u,e){let t=u;null!=this._sourceRoot&&(t=n.relative(this._sourceRoot,t)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(t)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(u,e,t){let r=e;if(null==e){if(null==u.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=u.file}const s=this._sourceRoot;null!=s&&(r=n.relative(s,r));const i=this._mappings.toArray().length>0?new o:this._sources,A=new o;this._mappings.unsortedForEach(function(e){if(e.source===r&&null!=e.originalLine){const r=u.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=r.source&&(e.source=r.source,null!=t&&(e.source=n.join(t,e.source)),null!=s&&(e.source=n.relative(s,e.source)),e.originalLine=r.line,e.originalColumn=r.column,null!=r.name&&(e.name=r.name))}const o=e.source;null==o||i.has(o)||i.add(o);const a=e.name;null==a||A.has(a)||A.add(a)},this),this._sources=i,this._names=A,u.sources.forEach(function(e){const r=u.sourceContentFor(e);null!=r&&(null!=t&&(e=n.join(t,e)),null!=s&&(e=n.relative(s,e)),this.setSourceContent(e,r))},this)}_validateMapping(u,e,t,r){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(u&&"line"in u&&"column"in u&&u.line>0&&u.column>=0&&!e&&!t&&!r);else if(!(u&&"line"in u&&"column"in u&&e&&"line"in e&&"column"in e&&u.line>0&&u.column>=0&&e.line>0&&e.column>=0&&t))throw new Error("Invalid mapping: "+JSON.stringify({generated:u,source:t,original:e,name:r}))}_serializeMappings(){let u,e,t,o,s=0,i=1,A=0,a=0,F=0,E=0,l="";const C=this._mappings.toArray();for(let D=0,B=C.length;D0){if(!n.compareByGeneratedPositionsInflated(e,C[D-1]))continue;u+=","}u+=r.encode(e.generatedColumn-s),s=e.generatedColumn,null!=e.source&&(o=this._sources.indexOf(e.source),u+=r.encode(o-E),E=o,u+=r.encode(e.originalLine-1-a),a=e.originalLine-1,u+=r.encode(e.originalColumn-A),A=e.originalColumn,null!=e.name&&(t=this._names.indexOf(e.name),u+=r.encode(t-F),F=t)),l+=u}return l}_generateSourcesContent(u,e){return u.map(function(u){if(!this._sourcesContents)return null;null!=e&&(u=n.relative(e,u));const t=n.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)}toJSON(){const u={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(u.file=this._file),null!=this._sourceRoot&&(u.sourceRoot=this._sourceRoot),this._sourcesContents&&(u.sourcesContent=this._generateSourcesContent(u.sources,u.sourceRoot)),u}toString(){return JSON.stringify(this.toJSON())}}i.prototype._version=3,e.SourceMapGenerator=i},58408:(u,e,t)=>{"use strict";var r=t(93775).TextEncoder,n=t(93775).TextDecoder;const o=new r,s=new n("utf-8",{ignoreBOM:!0});u.exports={utf8Encode:function(u){return o.encode(u)},utf8DecodeWithoutBOM:function(u){return s.decode(u)}}},67079:(u,e,t)=>{"use strict";const r=t(95484),n=t(85252),o=t(52682);e.implementation=class u{constructor(u,[e,t]){let n=null;if(void 0!==t&&(n=r.basicURLParse(t),null===n))throw new TypeError(`Invalid base URL: ${t}`);const s=r.basicURLParse(e,{baseURL:n});if(null===s)throw new TypeError(`Invalid URL: ${e}`);const i=null!==s.query?s.query:"";this._url=s,this._query=o.createImpl(u,[i],{doNotStripQMark:!0}),this._query._url=this}static parse(e,t,r){try{return new u(e,[t,r])}catch{return null}}static canParse(u,e){let t=null;if(void 0!==e&&(t=r.basicURLParse(e),null===t))return!1;return null!==r.basicURLParse(u,{baseURL:t})}get href(){return r.serializeURL(this._url)}set href(u){const e=r.basicURLParse(u);if(null===e)throw new TypeError(`Invalid URL: ${u}`);this._url=e,this._query._list.splice(0);const{query:t}=e;null!==t&&(this._query._list=n.parseUrlencodedString(t))}get origin(){return r.serializeURLOrigin(this._url)}get protocol(){return`${this._url.scheme}:`}set protocol(u){r.basicURLParse(`${u}:`,{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(u){r.cannotHaveAUsernamePasswordPort(this._url)||r.setTheUsername(this._url,u)}get password(){return this._url.password}set password(u){r.cannotHaveAUsernamePasswordPort(this._url)||r.setThePassword(this._url,u)}get host(){const u=this._url;return null===u.host?"":null===u.port?r.serializeHost(u.host):`${r.serializeHost(u.host)}:${r.serializeInteger(u.port)}`}set host(u){r.hasAnOpaquePath(this._url)||r.basicURLParse(u,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":r.serializeHost(this._url.host)}set hostname(u){r.hasAnOpaquePath(this._url)||r.basicURLParse(u,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":r.serializeInteger(this._url.port)}set port(u){r.cannotHaveAUsernamePasswordPort(this._url)||(""===u?this._url.port=null:r.basicURLParse(u,{url:this._url,stateOverride:"port"}))}get pathname(){return r.serializePath(this._url)}set pathname(u){r.hasAnOpaquePath(this._url)||(this._url.path=[],r.basicURLParse(u,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":`?${this._url.query}`}set search(u){const e=this._url;if(""===u)return e.query=null,void(this._query._list=[]);const t="?"===u[0]?u.substring(1):u;e.query="",r.basicURLParse(t,{url:e,stateOverride:"query"}),this._query._list=n.parseUrlencodedString(t)}get searchParams(){return this._query}get hash(){return null===this._url.fragment||""===this._url.fragment?"":`#${this._url.fragment}`}set hash(u){if(""===u)return void(this._url.fragment=null);const e="#"===u[0]?u.substring(1):u;this._url.fragment="",r.basicURLParse(e,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},68549:(u,e,t)=>{"use strict";const r=t(85252);e.implementation=class{constructor(u,e,{doNotStripQMark:t=!1}){let n=e[0];if(this._list=[],this._url=null,t||"string"!=typeof n||"?"!==n[0]||(n=n.slice(1)),Array.isArray(n))for(const u of n){if(2!==u.length)throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");this._list.push([u[0],u[1]])}else if("object"==typeof n&&null===Object.getPrototypeOf(n))for(const u of Object.keys(n)){const e=n[u];this._list.push([u,e])}else this._list=r.parseUrlencodedString(n)}_updateSteps(){if(null!==this._url){let u=r.serializeUrlencoded(this._list);""===u&&(u=null),this._url._url.query=u}}get size(){return this._list.length}append(u,e){this._list.push([u,e]),this._updateSteps()}delete(u,e){let t=0;for(;tu[0]e[0]?1:0),this._updateSteps()}[Symbol.iterator](){return this._list[Symbol.iterator]()}toString(){return r.serializeUrlencoded(this._list)}}},72626:(u,e,t)=>{"use strict";u.exports="function"==typeof URL?URL:t(75833).URL},75833:(u,e,t)=>{"use strict";const{URL:r,URLSearchParams:n}=t(3181),o=t(95484),s=t(41656),i={Array,Object,Promise,String,TypeError};r.install(i,["Window"]),n.install(i,["Window"]),e.URL=i.URL,o.parseURL,o.basicURLParse,o.serializeURL,o.serializePath,o.serializeHost,o.serializeInteger,o.serializeURLOrigin,o.setTheUsername,o.setThePassword,o.cannotHaveAUsernamePasswordPort,o.hasAnOpaquePath,s.percentDecodeString,s.percentDecodeBytes},76648:(u,e,t)=>{"use strict";const r=t(85616),n=t(46892),o=n.implSymbol,s=n.ctorRegistrySymbol;function i(u,e){let t;return void 0!==e&&(t=e.prototype),n.isObject(t)||(t=u[s].URL.prototype),Object.create(t)}e.is=u=>n.isObject(u)&&n.hasOwn(u,o)&&u[o]instanceof a.implementation,e.isImpl=u=>n.isObject(u)&&u instanceof a.implementation,e.convert=(u,t,{context:r="The provided value"}={})=>{if(e.is(t))return n.implForWrapper(t);throw new u.TypeError(`${r} is not of type 'URL'.`)},e.create=(u,t,r)=>{const n=i(u);return e.setup(n,u,t,r)},e.createImpl=(u,t,r)=>{const o=e.create(u,t,r);return n.implForWrapper(o)},e._internalSetup=(u,e)=>{},e.setup=(u,t,r=[],s={})=>(s.wrapper=u,e._internalSetup(u,t),Object.defineProperty(u,o,{value:new a.implementation(t,r,s),configurable:!0}),u[o][n.wrapperSymbol]=u,a.init&&a.init(u[o]),u),e.new=(u,t)=>{const r=i(u,t);return e._internalSetup(r,u),Object.defineProperty(r,o,{value:Object.create(a.implementation.prototype),configurable:!0}),r[o][n.wrapperSymbol]=r,a.init&&a.init(r[o]),r[o]};const A=new Set(["Window","Worker"]);e.install=(u,t)=>{if(!t.some(u=>A.has(u)))return;const s=n.initCtorRegistry(u);class i{constructor(t){if(arguments.length<1)throw new u.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);const n=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to construct 'URL': parameter 1",globals:u}),n.push(e)}{let e=arguments[1];void 0!==e&&(e=r.USVString(e,{context:"Failed to construct 'URL': parameter 2",globals:u})),n.push(e)}return e.setup(Object.create(new.target.prototype),u,n)}toJSON(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return t[o].toJSON()}get href(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get href' called on an object that is not a valid instance of URL.");return t[o].href}set href(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set href' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:u}),n[o].href=t}toString(){if(!e.is(this))throw new u.TypeError("'toString' called on an object that is not a valid instance of URL.");return this[o].href}get origin(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get origin' called on an object that is not a valid instance of URL.");return t[o].origin}get protocol(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return t[o].protocol}set protocol(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set protocol' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:u}),n[o].protocol=t}get username(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get username' called on an object that is not a valid instance of URL.");return t[o].username}set username(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set username' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:u}),n[o].username=t}get password(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get password' called on an object that is not a valid instance of URL.");return t[o].password}set password(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set password' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:u}),n[o].password=t}get host(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get host' called on an object that is not a valid instance of URL.");return t[o].host}set host(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set host' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:u}),n[o].host=t}get hostname(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return t[o].hostname}set hostname(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set hostname' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:u}),n[o].hostname=t}get port(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get port' called on an object that is not a valid instance of URL.");return t[o].port}set port(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set port' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:u}),n[o].port=t}get pathname(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return t[o].pathname}set pathname(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set pathname' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:u}),n[o].pathname=t}get search(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get search' called on an object that is not a valid instance of URL.");return t[o].search}set search(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set search' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:u}),n[o].search=t}get searchParams(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return n.getSameObject(this,"searchParams",()=>n.tryWrapperForImpl(t[o].searchParams))}get hash(){const t=null!=this?this:u;if(!e.is(t))throw new u.TypeError("'get hash' called on an object that is not a valid instance of URL.");return t[o].hash}set hash(t){const n=null!=this?this:u;if(!e.is(n))throw new u.TypeError("'set hash' called on an object that is not a valid instance of URL.");t=r.USVString(t,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:u}),n[o].hash=t}static parse(e){if(arguments.length<1)throw new u.TypeError(`Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.`);const t=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'parse' on 'URL': parameter 1",globals:u}),t.push(e)}{let e=arguments[1];void 0!==e&&(e=r.USVString(e,{context:"Failed to execute 'parse' on 'URL': parameter 2",globals:u})),t.push(e)}return n.tryWrapperForImpl(a.implementation.parse(u,...t))}static canParse(e){if(arguments.length<1)throw new u.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);const t=[];{let e=arguments[0];e=r.USVString(e,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:u}),t.push(e)}{let e=arguments[1];void 0!==e&&(e=r.USVString(e,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:u})),t.push(e)}return a.implementation.canParse(...t)}}Object.defineProperties(i.prototype,{toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0},[Symbol.toStringTag]:{value:"URL",configurable:!0}}),Object.defineProperties(i,{parse:{enumerable:!0},canParse:{enumerable:!0}}),s.URL=i,Object.defineProperty(u,"URL",{configurable:!0,writable:!0,value:i}),t.includes("Window")&&Object.defineProperty(u,"webkitURL",{configurable:!0,writable:!0,value:i})};const a=t(67079)},80378:u=>{"use strict";u.exports={combiningMarks:/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u,combiningClassVirama:/[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u,validZWNJ:/[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u,bidiDomain:/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,bidiS1LTR:/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u,bidiS1RTL:/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,bidiS2:/^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u,bidiS3:/[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u,bidiS4EN:/[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u,bidiS4AN:/[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u,bidiS5:/^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\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\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u,bidiS6:/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\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\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\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\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u}},80735:(u,e)=>{class t{constructor(){this._array=[],this._set=new Map}static fromArray(u,e){const r=new t;for(let t=0,n=u.length;t=0)return e;throw new Error('"'+u+'" is not in the set.')}at(u){if(u>=0&&u{"use strict";const{utf8Encode:r,utf8DecodeWithoutBOM:n}=t(58408),{percentDecodeBytes:o,utf8PercentEncodeString:s,isURLEncodedPercentEncode:i}=t(41656);function A(u){return u.codePointAt(0)}function a(u,e,t){let r=u.indexOf(e);for(;r>=0;)u[r]=t,r=u.indexOf(e,r+1);return u}u.exports={parseUrlencodedString:function(u){return function(u){const e=function(u,e){const t=[];let r=0,n=u.indexOf(e);for(;n>=0;)t.push(u.slice(r,n)),r=n+1,n=u.indexOf(e,r);return r!==u.length&&t.push(u.slice(r)),t}(u,A("&")),t=[];for(const u of e){if(0===u.length)continue;let e,r;const s=u.indexOf(A("="));s>=0?(e=u.slice(0,s),r=u.slice(s+1)):(e=u,r=new Uint8Array(0)),e=a(e,43,32),r=a(r,43,32);const i=n(o(e)),F=n(o(r));t.push([i,F])}return t}(r(u))},serializeUrlencoded:function(u){let e="";for(const[t,r]of u.entries()){0!==t&&(e+="&"),e+=`${s(r[0],i,!0)}=${s(r[1],i,!0)}`}return e}}},85616:(u,e)=>{"use strict";function t(u,e,t){return t.globals&&(u=t.globals[u.name]),new u(`${t.context?t.context:"Value"} ${e}.`)}function r(u,e){if("bigint"==typeof u)throw t(TypeError,"is a BigInt which cannot be converted to a number",e);return e.globals?e.globals.Number(u):Number(u)}function n(u){return i(u>0&&u%1==.5&&!(1&u)||u<0&&u%1==-.5&&!(1&~u)?Math.floor(u):Math.round(u))}function o(u){return i(Math.trunc(u))}function s(u){return u<0?-1:1}function i(u){return 0===u?0:u}function A(u,{unsigned:e}){let A,a;e?(A=0,a=2**u-1):(A=-(2**(u-1)),a=2**(u-1)-1);const F=2**u,E=2**(u-1);return(u,l={})=>{let C=r(u,l);if(C=i(C),l.enforceRange){if(!Number.isFinite(C))throw t(TypeError,"is not a finite number",l);if(C=o(C),Ca)throw t(TypeError,`is outside the accepted range of ${A} to ${a}, inclusive`,l);return C}return!Number.isNaN(C)&&l.clamp?(C=Math.min(Math.max(C,A),a),C=n(C),C):Number.isFinite(C)&&0!==C?(C=o(C),C>=A&&C<=a?C:(C=function(u,e){const t=u%e;return s(e)!==s(t)?t+e:t}(C,F),!e&&C>=E?C-F:C)):0}}function a(u,{unsigned:e}){const s=Number.MAX_SAFE_INTEGER,A=e?0:Number.MIN_SAFE_INTEGER,a=e?BigInt.asUintN:BigInt.asIntN;return(e,F={})=>{let E=r(e,F);if(E=i(E),F.enforceRange){if(!Number.isFinite(E))throw t(TypeError,"is not a finite number",F);if(E=o(E),Es)throw t(TypeError,`is outside the accepted range of ${A} to ${s}, inclusive`,F);return E}if(!Number.isNaN(E)&&F.clamp)return E=Math.min(Math.max(E,A),s),E=n(E),E;if(!Number.isFinite(E)||0===E)return 0;let l=BigInt(o(E));return l=a(u,l),Number(l)}}e.any=u=>u,e.undefined=()=>{},e.boolean=u=>Boolean(u),e.byte=A(8,{unsigned:!1}),e.octet=A(8,{unsigned:!0}),e.short=A(16,{unsigned:!1}),e["unsigned short"]=A(16,{unsigned:!0}),e.long=A(32,{unsigned:!1}),e["unsigned long"]=A(32,{unsigned:!0}),e["long long"]=a(64,{unsigned:!1}),e["unsigned long long"]=a(64,{unsigned:!0}),e.double=(u,e={})=>{const n=r(u,e);if(!Number.isFinite(n))throw t(TypeError,"is not a finite floating-point value",e);return n},e["unrestricted double"]=(u,e={})=>r(u,e),e.float=(u,e={})=>{const n=r(u,e);if(!Number.isFinite(n))throw t(TypeError,"is not a finite floating-point value",e);if(Object.is(n,-0))return n;const o=Math.fround(n);if(!Number.isFinite(o))throw t(TypeError,"is outside the range of a single-precision floating-point value",e);return o},e["unrestricted float"]=(u,e={})=>{const t=r(u,e);return isNaN(t)||Object.is(t,-0)?t:Math.fround(t)},e.DOMString=(u,e={})=>{if(e.treatNullAsEmptyString&&null===u)return"";if("symbol"==typeof u)throw t(TypeError,"is a symbol, which cannot be converted to a string",e);return(e.globals?e.globals.String:String)(u)},e.ByteString=(u,r={})=>{const n=e.DOMString(u,r);let o;for(let u=0;void 0!==(o=n.codePointAt(u));++u)if(o>255)throw t(TypeError,"is not a valid ByteString",r);return n},e.USVString=(u,t={})=>{const r=e.DOMString(u,t),n=r.length,o=[];for(let u=0;u57343)o.push(String.fromCodePoint(e));else if(56320<=e&&e<=57343)o.push(String.fromCodePoint(65533));else if(u===n-1)o.push(String.fromCodePoint(65533));else{const t=r.charCodeAt(u+1);if(56320<=t&&t<=57343){const r=1023&e,n=1023&t;o.push(String.fromCodePoint(65536+1024*r+n)),++u}else o.push(String.fromCodePoint(65533))}}return o.join("")},e.object=(u,e={})=>{if(null===u||"object"!=typeof u&&"function"!=typeof u)throw t(TypeError,"is not an object",e);return u};const F=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,E="function"==typeof SharedArrayBuffer?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get:null;function l(u){try{return F.call(u),!0}catch{return!1}}function C(u){try{return E.call(u),!0}catch{return!1}}function D(u){try{return new Uint8Array(u),!1}catch{return!0}}e.ArrayBuffer=(u,e={})=>{if(!l(u)){if(e.allowShared&&!C(u))throw t(TypeError,"is not an ArrayBuffer or SharedArrayBuffer",e);throw t(TypeError,"is not an ArrayBuffer",e)}if(D(u))throw t(TypeError,"is a detached ArrayBuffer",e);return u};const B=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;e.DataView=(u,e={})=>{try{B.call(u)}catch(u){throw t(TypeError,"is not a DataView",e)}if(!e.allowShared&&C(u.buffer))throw t(TypeError,"is backed by a SharedArrayBuffer, which is not allowed",e);if(D(u.buffer))throw t(TypeError,"is backed by a detached ArrayBuffer",e);return u};const c=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach(u=>{const{name:r}=u,n=/^[AEIOU]/u.test(r)?"an":"a";e[r]=(u,e={})=>{if(!ArrayBuffer.isView(u)||c.call(u)!==r)throw t(TypeError,`is not ${n} ${r} object`,e);if(!e.allowShared&&C(u.buffer))throw t(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",e);if(D(u.buffer))throw t(TypeError,"is a view on a detached ArrayBuffer",e);return u}}),e.ArrayBufferView=(u,e={})=>{if(!ArrayBuffer.isView(u))throw t(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",e);if(!e.allowShared&&C(u.buffer))throw t(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",e);if(D(u.buffer))throw t(TypeError,"is a view on a detached ArrayBuffer",e);return u},e.BufferSource=(u,e={})=>{if(ArrayBuffer.isView(u)){if(!e.allowShared&&C(u.buffer))throw t(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",e);if(D(u.buffer))throw t(TypeError,"is a view on a detached ArrayBuffer",e);return u}if(!e.allowShared&&!l(u))throw t(TypeError,"is not an ArrayBuffer or a view on one",e);if(e.allowShared&&!C(u)&&!l(u))throw t(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",e);if(D(u))throw t(TypeError,"is a detached ArrayBuffer",e);return u},e.DOMTimeStamp=e["unsigned long long"]},90251:(u,e,t)=>{const r=t(72626);e.getArg=function(u,e,t){if(e in u)return u[e];if(3===arguments.length)return t;throw new Error('"'+e+'" is a required argument.')};const n=!("__proto__"in Object.create(null));function o(u){return u}function s(u){if(!u)return!1;const e=u.length;if(e<9)return!1;if(95!==u.charCodeAt(e-1)||95!==u.charCodeAt(e-2)||111!==u.charCodeAt(e-3)||116!==u.charCodeAt(e-4)||111!==u.charCodeAt(e-5)||114!==u.charCodeAt(e-6)||112!==u.charCodeAt(e-7)||95!==u.charCodeAt(e-8)||95!==u.charCodeAt(e-9))return!1;for(let t=e-10;t>=0;t--)if(36!==u.charCodeAt(t))return!1;return!0}function i(u,e){return u===e?0:null===u?1:null===e?-1:u>e?1:-1}e.toSetString=n?o:function(u){return s(u)?"$"+u:u},e.fromSetString=n?o:function(u){return s(u)?u.slice(1):u},e.compareByGeneratedPositionsInflated=function(u,e){let t=u.generatedLine-e.generatedLine;return 0!==t?t:(t=u.generatedColumn-e.generatedColumn,0!==t?t:(t=i(u.source,e.source),0!==t?t:(t=u.originalLine-e.originalLine,0!==t?t:(t=u.originalColumn-e.originalColumn,0!==t?t:i(u.name,e.name)))))},e.parseSourceMapInput=function(u){return JSON.parse(u.replace(/^\)]}'[^\n]*\n/,""))};const A="http:",a=`${A}//host`;function F(u){return e=>{const t=D(e),n=l(e),o=new r(e,n);u(o);const s=o.toString();return"absolute"===t?s:"scheme-relative"===t?s.slice(5):"path-absolute"===t?s.slice(a.length):B(n,s)}}function E(u,e){return new r(u,e).toString()}function l(u){const e=u.split("..").length-1,t=function(u,e){let t=0;for(;;){const r=u+t++;if(-1===e.indexOf(r))return r}}("p",u);let r=`${a}/`;for(let u=0;u0&&!n[n.length-1]&&n.pop();t.length>0&&n.length>0&&t[0]===n[0];)t.shift(),n.shift();return n.map(()=>"..").concat(t).join("/")+e.search+e.hash}const c=F(u=>{u.pathname=u.pathname.replace(/\/?$/,"/")}),h=F(u=>{u.href=new r(".",u.toString()).toString()}),p=F(u=>{});function f(u,e){const t=D(e),r=D(u);if(u=c(u),"absolute"===t)return E(e,void 0);if("absolute"===r)return E(e,u);if("scheme-relative"===t)return p(e);if("scheme-relative"===r)return E(e,E(u,a)).slice(5);if("path-absolute"===t)return p(e);if("path-absolute"===r)return E(e,E(u,a)).slice(a.length);const n=l(e+u);return B(n,E(e,E(u,n)))}e.normalize=p,e.join=f,e.relative=function(u,e){const t=function(u,e){const t=D(u);if(t!==D(e))return null;const n=l(u+e),o=new r(u,n),s=new r(e,n);try{new r("",s.toString())}catch(u){return null}if(s.protocol!==o.protocol||s.user!==o.user||s.password!==o.password||s.hostname!==o.hostname||s.port!==o.port)return null;return B(o,s)}(u,e);return"string"==typeof t?t:p(e)},e.computeSourceURL=function(u,e,t){u&&"path-absolute"===D(e)&&(e=e.replace(/^\//,""));let r=p(e||"");return u&&(r=f(u,r)),t&&(r=f(h(t),r)),r}},92472:u=>{"use strict";u.exports=JSON.parse('[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"−"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"Ꭸ"],[43897,1,"Ꭹ"],[43898,1,"Ꭺ"],[43899,1,"Ꭻ"],[43900,1,"Ꭼ"],[43901,1,"Ꭽ"],[43902,1,"Ꭾ"],[43903,1,"Ꭿ"],[43904,1,"Ꮀ"],[43905,1,"Ꮁ"],[43906,1,"Ꮂ"],[43907,1,"Ꮃ"],[43908,1,"Ꮄ"],[43909,1,"Ꮅ"],[43910,1,"Ꮆ"],[43911,1,"Ꮇ"],[43912,1,"Ꮈ"],[43913,1,"Ꮉ"],[43914,1,"Ꮊ"],[43915,1,"Ꮋ"],[43916,1,"Ꮌ"],[43917,1,"Ꮍ"],[43918,1,"Ꮎ"],[43919,1,"Ꮏ"],[43920,1,"Ꮐ"],[43921,1,"Ꮑ"],[43922,1,"Ꮒ"],[43923,1,"Ꮓ"],[43924,1,"Ꮔ"],[43925,1,"Ꮕ"],[43926,1,"Ꮖ"],[43927,1,"Ꮗ"],[43928,1,"Ꮘ"],[43929,1,"Ꮙ"],[43930,1,"Ꮚ"],[43931,1,"Ꮛ"],[43932,1,"Ꮜ"],[43933,1,"Ꮝ"],[43934,1,"Ꮞ"],[43935,1,"Ꮟ"],[43936,1,"Ꮠ"],[43937,1,"Ꮡ"],[43938,1,"Ꮢ"],[43939,1,"Ꮣ"],[43940,1,"Ꮤ"],[43941,1,"Ꮥ"],[43942,1,"Ꮦ"],[43943,1,"Ꮧ"],[43944,1,"Ꮨ"],[43945,1,"Ꮩ"],[43946,1,"Ꮪ"],[43947,1,"Ꮫ"],[43948,1,"Ꮬ"],[43949,1,"Ꮭ"],[43950,1,"Ꮮ"],[43951,1,"Ꮯ"],[43952,1,"Ꮰ"],[43953,1,"Ꮱ"],[43954,1,"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,"\\""],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"\'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69371],3],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118015],3],[[118016,118451],2],[[118452,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[[129674,129678],3],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[[129735,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[[129770,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]')},93775:u=>{var e=["utf8","utf-8","unicode-1-1-utf-8"];u.exports={TextEncoder:function(u){if(e.indexOf(u)<0&&void 0!==u&&null!=u)throw new RangeError("Invalid encoding type. Only utf-8 is supported");this.encoding="utf-8",this.encode=function(u){if("string"!=typeof u)throw new TypeError("passed argument must be of tye string");var e=unescape(encodeURIComponent(u)),t=new Uint8Array(e.length);const r=e.split("");for(let u=0;u{"use strict";const r=t(36673),n=t(47167),{utf8DecodeWithoutBOM:o}=t(58408),{percentDecodeString:s,utf8PercentEncodeCodePoint:i,utf8PercentEncodeString:A,isC0ControlPercentEncode:a,isFragmentPercentEncode:F,isQueryPercentEncode:E,isSpecialQueryPercentEncode:l,isPathPercentEncode:C,isUserinfoPercentEncode:D}=t(41656);function B(u){return u.codePointAt(0)}const c={ftp:21,file:null,http:80,https:443,ws:80,wss:443},h=Symbol("failure");function p(u){return[...u].length}function f(u,e){const t=u[e];return isNaN(t)?void 0:String.fromCodePoint(t)}function d(u){return"."===u||"%2e"===u.toLowerCase()}function g(u){return 2===u.length&&n.isASCIIAlpha(u.codePointAt(0))&&(":"===u[1]||"|"===u[1])}function m(u){return-1!==u.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)}function y(u){return void 0!==c[u]}function b(u){return y(u.scheme)}function w(u){return!y(u.scheme)}function S(u){return c[u]}function _(u){if(""===u)return h;let e=10;if(u.length>=2&&"0"===u.charAt(0)&&"x"===u.charAt(1).toLowerCase()?(u=u.substring(2),e=16):u.length>=2&&"0"===u.charAt(0)&&(u=u.substring(1),e=8),""===u)return 0;let t=/[^0-7]/u;return 10===e&&(t=/[^0-9]/u),16===e&&(t=/[^0-9A-Fa-f]/u),t.test(u)?h:parseInt(u,e)}function v(u,e=!1){if("["===u[0])return"]"!==u[u.length-1]?h:function(u){const e=[0,0,0,0,0,0,0,0];let t=0,r=null,o=0;if((u=Array.from(u,u=>u.codePointAt(0)))[o]===B(":")){if(u[o+1]!==B(":"))return h;o+=2,++t,r=t}for(;o6)return h;let r=0;for(;void 0!==u[o];){let s=null;if(r>0){if(!(u[o]===B(".")&&r<4))return h;++o}if(!n.isASCIIDigit(u[o]))return h;for(;n.isASCIIDigit(u[o]);){const e=parseInt(f(u,o));if(null===s)s=e;else{if(0===s)return h;s=10*s+e}if(s>255)return h;++o}e[t]=256*e[t]+s,++r,2!==r&&4!==r||++t}if(4!==r)return h;break}if(u[o]===B(":")){if(++o,void 0===u[o])return h}else if(void 0!==u[o])return h;e[t]=s,++t}if(null!==r){let u=t-r;for(t=7;0!==t&&u>0;){const n=e[r+u-1];e[r+u-1]=e[t],e[t]=n,--t,--u}}else if(null===r&&8!==t)return h;return e}(u.substring(1,u.length-1));if(e)return function(u){if(m(u))return h;return A(u,a)}(u);const t=function(u,e=!1){const t=r.toASCII(u,{checkHyphens:e,checkBidi:!0,checkJoiners:!0,useSTD3ASCIIRules:e,transitionalProcessing:!1,verifyDNSLength:e,ignoreInvalidPunycode:!1});if(null===t)return h;if(!e){if(""===t)return h;if(m(n=t)||-1!==n.search(/[\u0000-\u001F]|%|\u007F/u))return h}var n;return t}(o(s(u)));return t===h?h:function(u){const e=u.split(".");if(""===e[e.length-1]){if(1===e.length)return!1;e.pop()}const t=e[e.length-1];if(_(t)!==h)return!0;if(/^[0-9]+$/u.test(t))return!0;return!1}(t)?function(u){const e=u.split(".");if(""===e[e.length-1]&&e.length>1&&e.pop(),e.length>4)return h;const t=[];for(const u of e){const e=_(u);if(e===h)return h;t.push(e)}for(let u=0;u255)return h;if(t[t.length-1]>=256**(5-t.length))return h;let r=t.pop(),n=0;for(const u of t)r+=u*256**(3-n),++n;return r}(t):t}function x(u){return"number"==typeof u?function(u){let e="",t=u;for(let u=1;u<=4;++u)e=String(t%256)+e,4!==u&&(e=`.${e}`),t=Math.floor(t/256);return e}(u):u instanceof Array?`[${function(u){let e="";const t=function(u){let e=null,t=1,r=null,n=0;for(let o=0;ot&&(e=r,t=n),r=null,n=0):(null===r&&(r=o),++n);return n>t?r:e}(u);let r=!1;for(let n=0;n<=7;++n)if(!r||0!==u[n]){if(r&&(r=!1),t===n){e+=0===n?"::":":",r=!0;continue}e+=u[n].toString(16),7!==n&&(e+=":")}return e}(u)}]`:u}function P(u){const{path:e}=u;var t;0!==e.length&&("file"===u.scheme&&1===e.length&&(t=e[0],/^[A-Za-z]:$/u.test(t))||e.pop())}function L(u){return""!==u.username||""!==u.password}function U(u){return"string"==typeof u.path}function R(u,e,t,r,n){if(this.pointer=0,this.input=u,this.base=e||null,this.encodingOverride=t||"utf-8",this.stateOverride=n,this.url=r,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};const u=function(u){let e=0,t=u.length;for(;e32);++e);for(;t>e&&!(u.charCodeAt(t-1)>32);--t);return u.substring(e,t)}(this.input);u!==this.input&&(this.parseError=!0),this.input=u}const o=function(u){return u.replace(/\u0009|\u000A|\u000D/gu,"")}(this.input);for(o!==this.input&&(this.parseError=!0),this.input=o,this.state=n||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=Array.from(this.input,u=>u.codePointAt(0));this.pointer<=this.input.length;++this.pointer){const u=this.input[this.pointer],e=isNaN(u)?void 0:String.fromCodePoint(u),t=this[`parse ${this.state}`](u,e);if(!t)break;if(t===h){this.failure=!0;break}}}R.prototype["parse scheme start"]=function(u,e){if(n.isASCIIAlpha(u))this.buffer+=e.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,h;this.state="no scheme",--this.pointer}return!0},R.prototype["parse scheme"]=function(u,e){if(n.isASCIIAlphanumeric(u)||u===B("+")||u===B("-")||u===B("."))this.buffer+=e.toLowerCase();else if(u===B(":")){if(this.stateOverride){if(b(this.url)&&!y(this.buffer))return!1;if(!b(this.url)&&y(this.buffer))return!1;if((L(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&""===this.url.host)return!1}if(this.url.scheme=this.buffer,this.stateOverride)return this.url.port===S(this.url.scheme)&&(this.url.port=null),!1;this.buffer="","file"===this.url.scheme?(this.input[this.pointer+1]===B("/")&&this.input[this.pointer+2]===B("/")||(this.parseError=!0),this.state="file"):b(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":b(this.url)?this.state="special authority slashes":this.input[this.pointer+1]===B("/")?(this.state="path or authority",++this.pointer):(this.url.path="",this.state="opaque path")}else{if(this.stateOverride)return this.parseError=!0,h;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},R.prototype["parse no scheme"]=function(u){return null===this.base||U(this.base)&&u!==B("#")?h:(U(this.base)&&u===B("#")?(this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},R.prototype["parse special relative or authority"]=function(u){return u===B("/")&&this.input[this.pointer+1]===B("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},R.prototype["parse path or authority"]=function(u){return u===B("/")?this.state="authority":(this.state="path",--this.pointer),!0},R.prototype["parse relative"]=function(u){return this.url.scheme=this.base.scheme,u===B("/")?this.state="relative slash":b(this.url)&&u===B("\\")?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,u===B("?")?(this.url.query="",this.state="query"):u===B("#")?(this.url.fragment="",this.state="fragment"):isNaN(u)||(this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer)),!0},R.prototype["parse relative slash"]=function(u){return!b(this.url)||u!==B("/")&&u!==B("\\")?u===B("/")?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(u===B("\\")&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},R.prototype["parse special authority slashes"]=function(u){return u===B("/")&&this.input[this.pointer+1]===B("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},R.prototype["parse special authority ignore slashes"]=function(u){return u!==B("/")&&u!==B("\\")?(this.state="authority",--this.pointer):this.parseError=!0,!0},R.prototype["parse authority"]=function(u,e){if(u===B("@")){this.parseError=!0,this.atFlag&&(this.buffer=`%40${this.buffer}`),this.atFlag=!0;const u=p(this.buffer);for(let e=0;e65535)return this.parseError=!0,h;this.url.port=u===S(this.url.scheme)?null:u,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}return!0};const O=new Set([B("/"),B("\\"),B("?"),B("#")]);function j(u,e){const t=u.length-e;return t>=2&&(r=u[e],o=u[e+1],n.isASCIIAlpha(r)&&(o===B(":")||o===B("|")))&&(2===t||O.has(u[e+2]));var r,o}function I(u){if(U(u))return u.path;let e="";for(const t of u.path)e+=`/${t}`;return e}R.prototype["parse file"]=function(u){return this.url.scheme="file",this.url.host="",u===B("/")||u===B("\\")?(u===B("\\")&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,u===B("?")?(this.url.query="",this.state="query"):u===B("#")?(this.url.fragment="",this.state="fragment"):isNaN(u)||(this.url.query=null,j(this.input,this.pointer)?(this.parseError=!0,this.url.path=[]):P(this.url),this.state="path",--this.pointer)):(this.state="path",--this.pointer),!0},R.prototype["parse file slash"]=function(u){var e;return u===B("/")||u===B("\\")?(u===B("\\")&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(!j(this.input,this.pointer)&&(2===(e=this.base.path[0]).length&&n.isASCIIAlpha(e.codePointAt(0))&&":"===e[1])&&this.url.path.push(this.base.path[0]),this.url.host=this.base.host),this.state="path",--this.pointer),!0},R.prototype["parse file host"]=function(u,e){if(isNaN(u)||u===B("/")||u===B("\\")||u===B("?")||u===B("#"))if(--this.pointer,!this.stateOverride&&g(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let u=v(this.buffer,w(this.url));if(u===h)return h;if("localhost"===u&&(u=""),this.url.host=u,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=e;return!0},R.prototype["parse path start"]=function(u){return b(this.url)?(u===B("\\")&&(this.parseError=!0),this.state="path",u!==B("/")&&u!==B("\\")&&--this.pointer):this.stateOverride||u!==B("?")?this.stateOverride||u!==B("#")?void 0!==u?(this.state="path",u!==B("/")&&--this.pointer):this.stateOverride&&null===this.url.host&&this.url.path.push(""):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},R.prototype["parse path"]=function(u){var e;return isNaN(u)||u===B("/")||b(this.url)&&u===B("\\")||!this.stateOverride&&(u===B("?")||u===B("#"))?(b(this.url)&&u===B("\\")&&(this.parseError=!0),".."===(e=(e=this.buffer).toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e?(P(this.url),u===B("/")||b(this.url)&&u===B("\\")||this.url.path.push("")):!d(this.buffer)||u===B("/")||b(this.url)&&u===B("\\")?d(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&g(this.buffer)&&(this.buffer=`${this.buffer[0]}:`),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="",u===B("?")&&(this.url.query="",this.state="query"),u===B("#")&&(this.url.fragment="",this.state="fragment")):(u!==B("%")||n.isASCIIHex(this.input[this.pointer+1])&&n.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=i(u,C)),!0},R.prototype["parse opaque path"]=function(u){if(u===B("?"))this.url.query="",this.state="query";else if(u===B("#"))this.url.fragment="",this.state="fragment";else if(u===B(" ")){const u=this.input[this.pointer+1];u===B("?")||u===B("#")?this.url.path+="%20":this.url.path+=" "}else isNaN(u)||u===B("%")||(this.parseError=!0),u!==B("%")||n.isASCIIHex(this.input[this.pointer+1])&&n.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),isNaN(u)||(this.url.path+=i(u,a));return!0},R.prototype["parse query"]=function(u,e){if(b(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8"),!this.stateOverride&&u===B("#")||isNaN(u)){const e=b(this.url)?l:E;this.url.query+=A(this.buffer,e),this.buffer="",u===B("#")&&(this.url.fragment="",this.state="fragment")}else isNaN(u)||(u!==B("%")||n.isASCIIHex(this.input[this.pointer+1])&&n.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=e);return!0},R.prototype["parse fragment"]=function(u){return isNaN(u)||(u!==B("%")||n.isASCIIHex(this.input[this.pointer+1])&&n.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=i(u,F)),!0},u.exports.serializeURL=function(u,e){let t=`${u.scheme}:`;return null!==u.host&&(t+="//",""===u.username&&""===u.password||(t+=u.username,""!==u.password&&(t+=`:${u.password}`),t+="@"),t+=x(u.host),null!==u.port&&(t+=`:${u.port}`)),null===u.host&&!U(u)&&u.path.length>1&&""===u.path[0]&&(t+="/."),t+=I(u),null!==u.query&&(t+=`?${u.query}`),e||null===u.fragment||(t+=`#${u.fragment}`),t},u.exports.serializePath=I,u.exports.serializeURLOrigin=function(e){switch(e.scheme){case"blob":{const t=u.exports.parseURL(I(e));return null===t||"http"!==t.scheme&&"https"!==t.scheme?"null":u.exports.serializeURLOrigin(t)}case"ftp":case"http":case"https":case"ws":case"wss":return function(u){let e=`${u.scheme}://`;return e+=x(u.host),null!==u.port&&(e+=`:${u.port}`),e}({scheme:e.scheme,host:e.host,port:e.port});default:return"null"}},u.exports.basicURLParse=function(u,e){void 0===e&&(e={});const t=new R(u,e.baseURL,e.encodingOverride,e.url,e.stateOverride);return t.failure?null:t.url},u.exports.setTheUsername=function(u,e){u.username=A(e,D)},u.exports.setThePassword=function(u,e){u.password=A(e,D)},u.exports.serializeHost=x,u.exports.cannotHaveAUsernamePasswordPort=function(u){return null===u.host||""===u.host||"file"===u.scheme},u.exports.hasAnOpaquePath=U,u.exports.serializeInteger=function(u){return String(u)},u.exports.parseURL=function(e,t){return void 0===t&&(t={}),u.exports.basicURLParse(e,{baseURL:t.baseURL,encodingOverride:t.encodingOverride})}}},e={};function t(r){var n=e[r];if(void 0!==n)return n.exports;var o=e[r]={exports:{}};return u[r](o,o.exports,t),o.exports}t.d=(u,e)=>{for(var r in e)t.o(e,r)&&!t.o(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:e[r]})},t.o=(u,e)=>Object.prototype.hasOwnProperty.call(u,e),t.r=u=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var r={};(()=>{"use strict";t.r(r),t.d(r,{runTest:()=>n});var u=t(19665);const e=["lodash-4.17.4.min.js.map","preact-10.27.1.min.module.js.map","source-map.min-0.5.7.js.map","underscore-1.13.7.min.js.map"];async function n(t){const r=e.map(u=>t[u]);u.SourceMapConsumer.initialize({"lib/mappings.wasm":t["source-map/lib/mappings.wasm"]});for(const e of r){const t=await new u.SourceMapConsumer(e),r=u.SourceMapGenerator.fromSourceMap(t),n=await u.SourceNode.fromStringWithSourceMap(e,t);return[r.toString(),n.toString()]}}})(),self.WTBenchmark=r})(); \ No newline at end of file diff --git a/web-tooling-benchmark/dist/terser.LICENSE.txt b/web-tooling-benchmark/dist/terser.LICENSE.txt index bc4f017a..31695aa6 100644 --- a/web-tooling-benchmark/dist/terser.LICENSE.txt +++ b/web-tooling-benchmark/dist/terser.LICENSE.txt @@ -1,26 +1,3 @@ -@jridgewell/gen-mapping -MIT -Copyright 2024 Justin Ridgewell - -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. - - @jridgewell/resolve-uri MIT Copyright 2019 Justin Ridgewell @@ -43,75 +20,6 @@ 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. -@jridgewell/source-map -MIT -Copyright 2024 Justin Ridgewell - -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. - - -@jridgewell/sourcemap-codec -MIT -Copyright 2024 Justin Ridgewell - -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. - - -@jridgewell/trace-mapping -MIT -Copyright 2024 Justin Ridgewell - -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. - - process MIT (The MIT License) @@ -138,37 +46,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -terser -BSD-2-Clause -Copyright 2012-2018 (c) Mihai Bazon - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - text-encoder ISC The MIT License (MIT) diff --git a/web-tooling-benchmark/dist/terser.bundle.dev.js.z b/web-tooling-benchmark/dist/terser.bundle.dev.js.z new file mode 100644 index 00000000..b45d464a Binary files /dev/null and b/web-tooling-benchmark/dist/terser.bundle.dev.js.z differ diff --git a/web-tooling-benchmark/dist/terser.bundle.js b/web-tooling-benchmark/dist/terser.bundle.js deleted file mode 100644 index f4dbdd97..00000000 --- a/web-tooling-benchmark/dist/terser.bundle.js +++ /dev/null @@ -1,36247 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs": -/*!*******************************************************************!*\ - !*** ./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ GenMapping: () => (/* binding */ GenMapping), -/* harmony export */ addMapping: () => (/* binding */ addMapping), -/* harmony export */ addSegment: () => (/* binding */ addSegment), -/* harmony export */ allMappings: () => (/* binding */ allMappings), -/* harmony export */ fromMap: () => (/* binding */ fromMap), -/* harmony export */ maybeAddMapping: () => (/* binding */ maybeAddMapping), -/* harmony export */ maybeAddSegment: () => (/* binding */ maybeAddSegment), -/* harmony export */ setIgnore: () => (/* binding */ setIgnore), -/* harmony export */ setSourceContent: () => (/* binding */ setSourceContent), -/* harmony export */ toDecodedMap: () => (/* binding */ toDecodedMap), -/* harmony export */ toEncodedMap: () => (/* binding */ toEncodedMap) -/* harmony export */ }); -/* harmony import */ var _jridgewell_sourcemap_codec__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jridgewell/sourcemap-codec */ "./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs"); -/* harmony import */ var _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jridgewell/trace-mapping */ "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs"); -// src/set-array.ts -var SetArray = class { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } -}; -function cast(set) { - return set; -} -function get(setarr, key) { - return cast(setarr)._indexes[key]; -} -function put(setarr, key) { - const index = get(setarr, key); - if (index !== void 0) return index; - const { array, _indexes: indexes } = cast(setarr); - const length = array.push(key); - return indexes[key] = length - 1; -} -function remove(setarr, key) { - const index = get(setarr, key); - if (index === void 0) return; - const { array, _indexes: indexes } = cast(setarr); - for (let i = index + 1; i < array.length; i++) { - const k = array[i]; - array[i - 1] = k; - indexes[k]--; - } - indexes[key] = void 0; - array.pop(); -} - -// src/gen-mapping.ts - - - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; - -// src/gen-mapping.ts -var NO_NAME = -1; -var GenMapping = class { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - this._ignoreList = new SetArray(); - } -}; -function cast2(map) { - return map; -} -function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - return addSegmentInternal( - false, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -} -function addMapping(map, mapping) { - return addMappingInternal(false, map, mapping); -} -var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal( - true, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -}; -var maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); -}; -function setSourceContent(map, source, content) { - const { - _sources: sources, - _sourcesContent: sourcesContent - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - sourcesContent[index] = content; -} -function setIgnore(map, source, ignore = true) { - const { - _sources: sources, - _sourcesContent: sourcesContent, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (ignore) put(ignoreList, index); - else remove(ignoreList, index); -} -function toDecodedMap(map) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - // _generatedRanges: generatedRanges, - } = cast2(map); - removeEmptyFinalLines(mappings); - return { - version: 3, - file: map.file || void 0, - names: names.array, - sourceRoot: map.sourceRoot || void 0, - sources: sources.array, - sourcesContent, - mappings, - // originalScopes, - // generatedRanges, - ignoreList: ignoreList.array - }; -} -function toEncodedMap(map) { - const decoded = toDecodedMap(map); - return Object.assign({}, decoded, { - // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), - // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), - mappings: (0,_jridgewell_sourcemap_codec__WEBPACK_IMPORTED_MODULE_0__.encode)(decoded.mappings) - }); -} -function fromMap(input) { - const map = new _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__.TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - putAll(cast2(gen)._names, map.names); - putAll(cast2(gen)._sources, map.sources); - cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); - cast2(gen)._mappings = (0,_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__.decodedMappings)(map); - if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); - return gen; -} -function allMappings(map) { - const out = []; - const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); - for (let i = 0; i < mappings.length; i++) { - const line = mappings[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generated = { line: i + 1, column: seg[COLUMN] }; - let source = void 0; - let original = void 0; - let name = void 0; - if (seg.length !== 1) { - source = sources.array[seg[SOURCES_INDEX]]; - original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; - if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; - } - out.push({ generated, source, original, name }); - } - } - return out; -} -function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names - // _originalScopes: originalScopes, - } = cast2(map); - const line = getIndex(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) return; - return insert(line, index, [genColumn]); - } - assert(sourceLine); - assert(sourceColumn); - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - return insert( - line, - index, - name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] - ); -} -function assert(_val) { -} -function getIndex(arr, index) { - for (let i = arr.length; i <= index; i++) { - arr[i] = []; - } - return arr[index]; -} -function getColumnIndex(line, genColumn) { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) break; - } - return index; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -function removeEmptyFinalLines(mappings) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) break; - } - if (len < length) mappings.length = len; -} -function putAll(setarr, array) { - for (let i = 0; i < array.length; i++) put(setarr, array[i]); -} -function skipSourceless(line, index) { - if (index === 0) return true; - const prev = line[index - 1]; - return prev.length === 1; -} -function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - if (index === 0) return false; - const prev = line[index - 1]; - if (prev.length === 1) return false; - return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); -} -function addMappingInternal(skipable, map, mapping) { - const { generated, source, original, name, content } = mapping; - if (!source) { - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - null, - null, - null, - null, - null - ); - } - assert(original); - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - source, - original.line - 1, - original.column, - name, - content - ); -} - -//# sourceMappingURL=gen-mapping.mjs.map - - -/***/ }), - -/***/ "./node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js ***! - \**********************************************************************/ -/***/ (function(module) { - -(function (global, factory) { - true ? module.exports = factory() : - 0; -})(this, (function () { 'use strict'; - - // Matches the scheme of a URL, eg "http://" - const schemeRegex = /^[\w+.-]+:\/\//; - /** - * Matches the parts of a URL: - * 1. Scheme, including ":", guaranteed. - * 2. User/password, including "@", optional. - * 3. Host, guaranteed. - * 4. Port, including ":", optional. - * 5. Path, including "/", optional. - * 6. Query, including "?", optional. - * 7. Hash, including "#", optional. - */ - const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; - /** - * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start - * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). - * - * 1. Host, optional. - * 2. Path, which may include "/", guaranteed. - * 3. Query, including "?", optional. - * 4. Hash, including "#", optional. - */ - const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; - function isAbsoluteUrl(input) { - return schemeRegex.test(input); - } - function isSchemeRelativeUrl(input) { - return input.startsWith('//'); - } - function isAbsolutePath(input) { - return input.startsWith('/'); - } - function isFileUrl(input) { - return input.startsWith('file:'); - } - function isRelative(input) { - return /^[.?#]/.test(input); - } - function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); - } - function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); - } - function makeUrl(scheme, user, host, port, path, query, hash) { - return { - scheme, - user, - host, - port, - path, - query, - hash, - type: 7 /* Absolute */, - }; - } - function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = 6 /* SchemeRelative */; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - url.type = 5 /* AbsolutePath */; - return url; - } - if (isFileUrl(input)) - return parseFileUrl(input); - if (isAbsoluteUrl(input)) - return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.type = input - ? input.startsWith('?') - ? 3 /* Query */ - : input.startsWith('#') - ? 2 /* Hash */ - : 4 /* RelativePath */ - : 1 /* Empty */; - return url; - } - function stripPathFilename(path) { - // If a path ends with a parent directory "..", then it's a relative path with excess parent - // paths. It's not a file, so we can't strip it. - if (path.endsWith('/..')) - return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - function mergePaths(url, base) { - normalizePath(base, base.type); - // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative - // path). - if (url.path === '/') { - url.path = base.path; - } - else { - // Resolution happens relative to the base path's directory, not the file. - url.path = stripPathFilename(base.path) + url.path; - } - } - /** - * The path can have empty directories "//", unneeded parents "foo/..", or current directory - * "foo/.". We need to normalize to a standard representation. - */ - function normalizePath(url, type) { - const rel = type <= 4 /* RelativePath */; - const pieces = url.path.split('/'); - // We need to preserve the first piece always, so that we output a leading slash. The item at - // pieces[0] is an empty string. - let pointer = 1; - // Positive is the number of real directories we've output, used for popping a parent directory. - // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". - let positive = 0; - // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will - // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a - // real directory, we won't need to append, unless the other conditions happen again. - let addTrailingSlash = false; - for (let i = 1; i < pieces.length; i++) { - const piece = pieces[i]; - // An empty directory, could be a trailing slash, or just a double "//" in the path. - if (!piece) { - addTrailingSlash = true; - continue; - } - // If we encounter a real directory, then we don't need to append anymore. - addTrailingSlash = false; - // A current directory, which we can always drop. - if (piece === '.') - continue; - // A parent directory, we need to see if there are any real directories we can pop. Else, we - // have an excess of parents, and we'll need to keep the "..". - if (piece === '..') { - if (positive) { - addTrailingSlash = true; - positive--; - pointer--; - } - else if (rel) { - // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute - // URL, protocol relative URL, or an absolute path, we don't need to keep excess. - pieces[pointer++] = piece; - } - continue; - } - // We've encountered a real directory. Move it to the next insertion pointer, which accounts for - // any popped or dropped directories. - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for (let i = 1; i < pointer; i++) { - path += '/' + pieces[i]; - } - if (!path || (addTrailingSlash && !path.endsWith('/..'))) { - path += '/'; - } - url.path = path; - } - /** - * Attempts to resolve `input` URL/path relative to `base`. - */ - function resolve(input, base) { - if (!input && !base) - return ''; - const url = parseUrl(input); - let inputType = url.type; - if (base && inputType !== 7 /* Absolute */) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; - switch (inputType) { - case 1 /* Empty */: - url.hash = baseUrl.hash; - // fall through - case 2 /* Hash */: - url.query = baseUrl.query; - // fall through - case 3 /* Query */: - case 4 /* RelativePath */: - mergePaths(url, baseUrl); - // fall through - case 5 /* AbsolutePath */: - // The host, user, and port are joined, you can't copy one without the others. - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - // fall through - case 6 /* SchemeRelative */: - // The input doesn't have a schema at least, so we need to copy at least that over. - url.scheme = baseUrl.scheme; - } - if (baseType > inputType) - inputType = baseType; - } - normalizePath(url, inputType); - const queryHash = url.query + url.hash; - switch (inputType) { - // This is impossible, because of the empty checks at the start of the function. - // case UrlType.Empty: - case 2 /* Hash */: - case 3 /* Query */: - return queryHash; - case 4 /* RelativePath */: { - // The first char is always a "/", and we need it to be relative. - const path = url.path.slice(1); - if (!path) - return queryHash || '.'; - if (isRelative(base || input) && !isRelative(path)) { - // If base started with a leading ".", or there is no base and input started with a ".", - // then we need to ensure that the relative path starts with a ".". We don't know if - // relative starts with a "..", though, so check before prepending. - return './' + path + queryHash; - } - return path + queryHash; - } - case 5 /* AbsolutePath */: - return url.path + queryHash; - default: - return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; - } - } - - return resolve; - -})); -//# sourceMappingURL=resolve-uri.umd.js.map - - -/***/ }), - -/***/ "./node_modules/@jridgewell/source-map/dist/source-map.mjs": -/*!*****************************************************************!*\ - !*** ./node_modules/@jridgewell/source-map/dist/source-map.mjs ***! - \*****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SourceMapConsumer: () => (/* binding */ SourceMapConsumer), -/* harmony export */ SourceMapGenerator: () => (/* binding */ SourceMapGenerator) -/* harmony export */ }); -/* harmony import */ var _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jridgewell/trace-mapping */ "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs"); -/* harmony import */ var _jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jridgewell/gen-mapping */ "./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs"); -// src/source-map.ts - - -var SourceMapConsumer = class _SourceMapConsumer { - constructor(map, mapUrl) { - const trace = this._map = new _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__.AnyMap(map, mapUrl); - this.file = trace.file; - this.names = trace.names; - this.sourceRoot = trace.sourceRoot; - this.sources = trace.resolvedSources; - this.sourcesContent = trace.sourcesContent; - this.version = trace.version; - } - static fromSourceMap(map, mapUrl) { - if (map.toDecodedMap) { - return new _SourceMapConsumer(map.toDecodedMap(), mapUrl); - } - return new _SourceMapConsumer(map.toJSON(), mapUrl); - } - get mappings() { - return (0,_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__.encodedMappings)(this._map); - } - originalPositionFor(needle) { - return (0,_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__.originalPositionFor)(this._map, needle); - } - generatedPositionFor(originalPosition) { - return (0,_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__.generatedPositionFor)(this._map, originalPosition); - } - allGeneratedPositionsFor(originalPosition) { - return (0,_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__.allGeneratedPositionsFor)(this._map, originalPosition); - } - hasContentsOfAllSources() { - if (!this.sourcesContent || this.sourcesContent.length !== this.sources.length) { - return false; - } - for (const content of this.sourcesContent) { - if (content == null) { - return false; - } - } - return true; - } - sourceContentFor(source, nullOnMissing) { - const sourceContent = (0,_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__.sourceContentFor)(this._map, source); - if (sourceContent != null) { - return sourceContent; - } - if (nullOnMissing) { - return null; - } - throw new Error(`"${source}" is not in the SourceMap.`); - } - eachMapping(callback, context) { - (0,_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__.eachMapping)(this._map, context ? callback.bind(context) : callback); - } - destroy() { - } -}; -var SourceMapGenerator = class _SourceMapGenerator { - constructor(opts) { - this._map = opts instanceof _jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__.GenMapping ? opts : new _jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__.GenMapping(opts); - } - static fromSourceMap(consumer) { - return new _SourceMapGenerator((0,_jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__.fromMap)(consumer)); - } - addMapping(mapping) { - (0,_jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__.maybeAddMapping)(this._map, mapping); - } - setSourceContent(source, content) { - (0,_jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__.setSourceContent)(this._map, source, content); - } - toJSON() { - return (0,_jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__.toEncodedMap)(this._map); - } - toString() { - return JSON.stringify(this.toJSON()); - } - toDecodedMap() { - return (0,_jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__.toDecodedMap)(this._map); - } -}; - -//# sourceMappingURL=source-map.mjs.map - - -/***/ }), - -/***/ "./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs": -/*!***************************************************************************!*\ - !*** ./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs ***! - \***************************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ decode: () => (/* binding */ decode), -/* harmony export */ decodeGeneratedRanges: () => (/* binding */ decodeGeneratedRanges), -/* harmony export */ decodeOriginalScopes: () => (/* binding */ decodeOriginalScopes), -/* harmony export */ encode: () => (/* binding */ encode), -/* harmony export */ encodeGeneratedRanges: () => (/* binding */ encodeGeneratedRanges), -/* harmony export */ encodeOriginalScopes: () => (/* binding */ encodeOriginalScopes) -/* harmony export */ }); -/* provided dependency */ var TextDecoder = __webpack_require__(/*! text-encoder */ "./node_modules/text-encoder/index.js")["TextDecoder"]; -// src/vlq.ts -var comma = ",".charCodeAt(0); -var semicolon = ";".charCodeAt(0); -var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var intToChar = new Uint8Array(64); -var charToInt = new Uint8Array(128); -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; -} -function decodeInteger(reader, relative) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = reader.next(); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -2147483648 | -value; - } - return relative + value; -} -function encodeInteger(builder, num, relative) { - let delta = num - relative; - delta = delta < 0 ? -delta << 1 | 1 : delta << 1; - do { - let clamped = delta & 31; - delta >>>= 5; - if (delta > 0) clamped |= 32; - builder.write(intToChar[clamped]); - } while (delta > 0); - return num; -} -function hasMoreVlq(reader, max) { - if (reader.pos >= max) return false; - return reader.peek() !== comma; -} - -// src/strings.ts -var bufLength = 1024 * 16; -var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { - decode(buf) { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - } -} : { - decode(buf) { - let out = ""; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - } -}; -var StringWriter = class { - constructor() { - this.pos = 0; - this.out = ""; - this.buffer = new Uint8Array(bufLength); - } - write(v) { - const { buffer } = this; - buffer[this.pos++] = v; - if (this.pos === bufLength) { - this.out += td.decode(buffer); - this.pos = 0; - } - } - flush() { - const { buffer, out, pos } = this; - return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; - } -}; -var StringReader = class { - constructor(buffer) { - this.pos = 0; - this.buffer = buffer; - } - next() { - return this.buffer.charCodeAt(this.pos++); - } - peek() { - return this.buffer.charCodeAt(this.pos); - } - indexOf(char) { - const { buffer, pos } = this; - const idx = buffer.indexOf(char, pos); - return idx === -1 ? buffer.length : idx; - } -}; - -// src/scopes.ts -var EMPTY = []; -function decodeOriginalScopes(input) { - const { length } = input; - const reader = new StringReader(input); - const scopes = []; - const stack = []; - let line = 0; - for (; reader.pos < length; reader.pos++) { - line = decodeInteger(reader, line); - const column = decodeInteger(reader, 0); - if (!hasMoreVlq(reader, length)) { - const last = stack.pop(); - last[2] = line; - last[3] = column; - continue; - } - const kind = decodeInteger(reader, 0); - const fields = decodeInteger(reader, 0); - const hasName = fields & 1; - const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; - let vars = EMPTY; - if (hasMoreVlq(reader, length)) { - vars = []; - do { - const varsIndex = decodeInteger(reader, 0); - vars.push(varsIndex); - } while (hasMoreVlq(reader, length)); - } - scope.vars = vars; - scopes.push(scope); - stack.push(scope); - } - return scopes; -} -function encodeOriginalScopes(scopes) { - const writer = new StringWriter(); - for (let i = 0; i < scopes.length; ) { - i = _encodeOriginalScopes(scopes, i, writer, [0]); - } - return writer.flush(); -} -function _encodeOriginalScopes(scopes, index, writer, state) { - const scope = scopes[index]; - const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; - if (index > 0) writer.write(comma); - state[0] = encodeInteger(writer, startLine, state[0]); - encodeInteger(writer, startColumn, 0); - encodeInteger(writer, kind, 0); - const fields = scope.length === 6 ? 1 : 0; - encodeInteger(writer, fields, 0); - if (scope.length === 6) encodeInteger(writer, scope[5], 0); - for (const v of vars) { - encodeInteger(writer, v, 0); - } - for (index++; index < scopes.length; ) { - const next = scopes[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeOriginalScopes(scopes, index, writer, state); - } - writer.write(comma); - state[0] = encodeInteger(writer, endLine, state[0]); - encodeInteger(writer, endColumn, 0); - return index; -} -function decodeGeneratedRanges(input) { - const { length } = input; - const reader = new StringReader(input); - const ranges = []; - const stack = []; - let genLine = 0; - let definitionSourcesIndex = 0; - let definitionScopeIndex = 0; - let callsiteSourcesIndex = 0; - let callsiteLine = 0; - let callsiteColumn = 0; - let bindingLine = 0; - let bindingColumn = 0; - do { - const semi = reader.indexOf(";"); - let genColumn = 0; - for (; reader.pos < semi; reader.pos++) { - genColumn = decodeInteger(reader, genColumn); - if (!hasMoreVlq(reader, semi)) { - const last = stack.pop(); - last[2] = genLine; - last[3] = genColumn; - continue; - } - const fields = decodeInteger(reader, 0); - const hasDefinition = fields & 1; - const hasCallsite = fields & 2; - const hasScope = fields & 4; - let callsite = null; - let bindings = EMPTY; - let range; - if (hasDefinition) { - const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); - definitionScopeIndex = decodeInteger( - reader, - definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 - ); - definitionSourcesIndex = defSourcesIndex; - range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; - } else { - range = [genLine, genColumn, 0, 0]; - } - range.isScope = !!hasScope; - if (hasCallsite) { - const prevCsi = callsiteSourcesIndex; - const prevLine = callsiteLine; - callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); - const sameSource = prevCsi === callsiteSourcesIndex; - callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); - callsiteColumn = decodeInteger( - reader, - sameSource && prevLine === callsiteLine ? callsiteColumn : 0 - ); - callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; - } - range.callsite = callsite; - if (hasMoreVlq(reader, semi)) { - bindings = []; - do { - bindingLine = genLine; - bindingColumn = genColumn; - const expressionsCount = decodeInteger(reader, 0); - let expressionRanges; - if (expressionsCount < -1) { - expressionRanges = [[decodeInteger(reader, 0)]]; - for (let i = -1; i > expressionsCount; i--) { - const prevBl = bindingLine; - bindingLine = decodeInteger(reader, bindingLine); - bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); - const expression = decodeInteger(reader, 0); - expressionRanges.push([expression, bindingLine, bindingColumn]); - } - } else { - expressionRanges = [[expressionsCount]]; - } - bindings.push(expressionRanges); - } while (hasMoreVlq(reader, semi)); - } - range.bindings = bindings; - ranges.push(range); - stack.push(range); - } - genLine++; - reader.pos = semi + 1; - } while (reader.pos < length); - return ranges; -} -function encodeGeneratedRanges(ranges) { - if (ranges.length === 0) return ""; - const writer = new StringWriter(); - for (let i = 0; i < ranges.length; ) { - i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); - } - return writer.flush(); -} -function _encodeGeneratedRanges(ranges, index, writer, state) { - const range = ranges[index]; - const { - 0: startLine, - 1: startColumn, - 2: endLine, - 3: endColumn, - isScope, - callsite, - bindings - } = range; - if (state[0] < startLine) { - catchupLine(writer, state[0], startLine); - state[0] = startLine; - state[1] = 0; - } else if (index > 0) { - writer.write(comma); - } - state[1] = encodeInteger(writer, range[1], state[1]); - const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); - encodeInteger(writer, fields, 0); - if (range.length === 6) { - const { 4: sourcesIndex, 5: scopesIndex } = range; - if (sourcesIndex !== state[2]) { - state[3] = 0; - } - state[2] = encodeInteger(writer, sourcesIndex, state[2]); - state[3] = encodeInteger(writer, scopesIndex, state[3]); - } - if (callsite) { - const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; - if (sourcesIndex !== state[4]) { - state[5] = 0; - state[6] = 0; - } else if (callLine !== state[5]) { - state[6] = 0; - } - state[4] = encodeInteger(writer, sourcesIndex, state[4]); - state[5] = encodeInteger(writer, callLine, state[5]); - state[6] = encodeInteger(writer, callColumn, state[6]); - } - if (bindings) { - for (const binding of bindings) { - if (binding.length > 1) encodeInteger(writer, -binding.length, 0); - const expression = binding[0][0]; - encodeInteger(writer, expression, 0); - let bindingStartLine = startLine; - let bindingStartColumn = startColumn; - for (let i = 1; i < binding.length; i++) { - const expRange = binding[i]; - bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); - bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); - encodeInteger(writer, expRange[0], 0); - } - } - } - for (index++; index < ranges.length; ) { - const next = ranges[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeGeneratedRanges(ranges, index, writer, state); - } - if (state[0] < endLine) { - catchupLine(writer, state[0], endLine); - state[0] = endLine; - state[1] = 0; - } else { - writer.write(comma); - } - state[1] = encodeInteger(writer, endColumn, state[1]); - return index; -} -function catchupLine(writer, lastLine, line) { - do { - writer.write(semicolon); - } while (++lastLine < line); -} - -// src/sourcemap-codec.ts -function decode(mappings) { - const { length } = mappings; - const reader = new StringReader(mappings); - const decoded = []; - let genColumn = 0; - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - do { - const semi = reader.indexOf(";"); - const line = []; - let sorted = true; - let lastCol = 0; - genColumn = 0; - while (reader.pos < semi) { - let seg; - genColumn = decodeInteger(reader, genColumn); - if (genColumn < lastCol) sorted = false; - lastCol = genColumn; - if (hasMoreVlq(reader, semi)) { - sourcesIndex = decodeInteger(reader, sourcesIndex); - sourceLine = decodeInteger(reader, sourceLine); - sourceColumn = decodeInteger(reader, sourceColumn); - if (hasMoreVlq(reader, semi)) { - namesIndex = decodeInteger(reader, namesIndex); - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; - } else { - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; - } - } else { - seg = [genColumn]; - } - line.push(seg); - reader.pos++; - } - if (!sorted) sort(line); - decoded.push(line); - reader.pos = semi + 1; - } while (reader.pos <= length); - return decoded; -} -function sort(line) { - line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[0] - b[0]; -} -function encode(decoded) { - const writer = new StringWriter(); - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) writer.write(semicolon); - if (line.length === 0) continue; - let genColumn = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - if (j > 0) writer.write(comma); - genColumn = encodeInteger(writer, segment[0], genColumn); - if (segment.length === 1) continue; - sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); - sourceLine = encodeInteger(writer, segment[2], sourceLine); - sourceColumn = encodeInteger(writer, segment[3], sourceColumn); - if (segment.length === 4) continue; - namesIndex = encodeInteger(writer, segment[4], namesIndex); - } - } - return writer.flush(); -} - -//# sourceMappingURL=sourcemap-codec.mjs.map - - -/***/ }), - -/***/ "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs": -/*!***********************************************************************!*\ - !*** ./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs ***! - \***********************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AnyMap: () => (/* binding */ FlattenMap), -/* harmony export */ FlattenMap: () => (/* binding */ FlattenMap), -/* harmony export */ GREATEST_LOWER_BOUND: () => (/* binding */ GREATEST_LOWER_BOUND), -/* harmony export */ LEAST_UPPER_BOUND: () => (/* binding */ LEAST_UPPER_BOUND), -/* harmony export */ TraceMap: () => (/* binding */ TraceMap), -/* harmony export */ allGeneratedPositionsFor: () => (/* binding */ allGeneratedPositionsFor), -/* harmony export */ decodedMap: () => (/* binding */ decodedMap), -/* harmony export */ decodedMappings: () => (/* binding */ decodedMappings), -/* harmony export */ eachMapping: () => (/* binding */ eachMapping), -/* harmony export */ encodedMap: () => (/* binding */ encodedMap), -/* harmony export */ encodedMappings: () => (/* binding */ encodedMappings), -/* harmony export */ generatedPositionFor: () => (/* binding */ generatedPositionFor), -/* harmony export */ isIgnored: () => (/* binding */ isIgnored), -/* harmony export */ originalPositionFor: () => (/* binding */ originalPositionFor), -/* harmony export */ presortedDecodedMap: () => (/* binding */ presortedDecodedMap), -/* harmony export */ sourceContentFor: () => (/* binding */ sourceContentFor), -/* harmony export */ traceSegment: () => (/* binding */ traceSegment) -/* harmony export */ }); -/* harmony import */ var _jridgewell_sourcemap_codec__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jridgewell/sourcemap-codec */ "./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs"); -/* harmony import */ var _jridgewell_resolve_uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jridgewell/resolve-uri */ "./node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"); -// src/trace-mapping.ts - - -// src/resolve.ts - - -// src/strip-filename.ts -function stripFilename(path) { - if (!path) return ""; - const index = path.lastIndexOf("/"); - return path.slice(0, index + 1); -} - -// src/resolve.ts -function resolver(mapUrl, sourceRoot) { - const from = stripFilename(mapUrl); - const prefix = sourceRoot ? sourceRoot + "/" : ""; - return (source) => _jridgewell_resolve_uri__WEBPACK_IMPORTED_MODULE_1__(prefix + (source || ""), from); -} - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; -var REV_GENERATED_LINE = 1; -var REV_GENERATED_COLUMN = 2; - -// src/sort.ts -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) return mappings; - if (!owned) mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; -} -function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) return i; - } - return mappings.length; -} -function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; -} -function sortSegments(line, owned) { - if (!owned) line = line.slice(); - return line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[COLUMN] - b[COLUMN]; -} - -// src/binary-search.ts -var found = false; -function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + (high - low >> 1); - const cmp = haystack[mid][COLUMN] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } else { - high = mid - 1; - } - } - found = false; - return low - 1; -} -function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; index = i++) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} -function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; index = i--) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} -function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1 - }; -} -function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - low = lastIndex === -1 ? 0 : lastIndex; - } else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return state.lastIndex = binarySearch(haystack, needle, low, high); -} - -// src/by-source.ts -function buildBySources(decoded, memos) { - const sources = memos.map(buildNullArray); - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) continue; - const sourceIndex2 = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const originalSource = sources[sourceIndex2]; - const originalLine = originalSource[sourceLine] || (originalSource[sourceLine] = []); - const memo = memos[sourceIndex2]; - let index = upperBound( - originalLine, - sourceColumn, - memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine) - ); - memo.lastIndex = ++index; - insert(originalLine, index, [sourceColumn, i, seg[COLUMN]]); - } - } - return sources; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -function buildNullArray() { - return { __proto__: null }; -} - -// src/types.ts -function parse(map) { - return typeof map === "string" ? JSON.parse(map) : map; -} - -// src/flatten-map.ts -var FlattenMap = function(map, mapUrl) { - const parsed = parse(map); - if (!("sections" in parsed)) { - return new TraceMap(parsed, mapUrl); - } - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const ignoreList = []; - recurse( - parsed, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - 0, - 0, - Infinity, - Infinity - ); - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - ignoreList - }; - return presortedDecodedMap(joined); -}; -function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const { sections } = input; - for (let i = 0; i < sections.length; i++) { - const { map, offset } = sections[i]; - let sl = stopLine; - let sc = stopColumn; - if (i + 1 < sections.length) { - const nextOffset = sections[i + 1].offset; - sl = Math.min(stopLine, lineOffset + nextOffset.line); - if (sl === stopLine) { - sc = Math.min(stopColumn, columnOffset + nextOffset.column); - } else if (sl < stopLine) { - sc = columnOffset + nextOffset.column; - } - } - addSection( - map, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - lineOffset + offset.line, - columnOffset + offset.column, - sl, - sc - ); - } -} -function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const parsed = parse(input); - if ("sections" in parsed) return recurse(...arguments); - const map = new TraceMap(parsed, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; - append(sources, resolvedSources); - append(names, map.names); - if (contents) append(sourcesContent, contents); - else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); - if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - if (lineI > stopLine) return; - const out = getLine(mappings, lineI); - const cOffset = i === 0 ? columnOffset : 0; - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - if (lineI === stopLine && column >= stopColumn) return; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - out.push( - seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] - ); - } - } -} -function append(arr, other) { - for (let i = 0; i < other.length; i++) arr.push(other[i]); -} -function getLine(arr, index) { - for (let i = arr.length; i <= index; i++) arr[i] = []; - return arr[index]; -} - -// src/trace-mapping.ts -var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; -var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; -var LEAST_UPPER_BOUND = -1; -var GREATEST_LOWER_BOUND = 1; -var TraceMap = class { - constructor(map, mapUrl) { - const isString = typeof map === "string"; - if (!isString && map._decodedMemo) return map; - const parsed = parse(map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names || []; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; - const resolve = resolver(mapUrl, sourceRoot); - this.resolvedSources = sources.map(resolve); - const { mappings } = parsed; - if (typeof mappings === "string") { - this._encoded = mappings; - this._decoded = void 0; - } else if (Array.isArray(mappings)) { - this._encoded = void 0; - this._decoded = maybeSort(mappings, isString); - } else if (parsed.sections) { - throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - } else { - throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); - } - this._decodedMemo = memoizedState(); - this._bySources = void 0; - this._bySourceMemos = void 0; - } -}; -function cast(map) { - return map; -} -function encodedMappings(map) { - var _a, _b; - return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = (0,_jridgewell_sourcemap_codec__WEBPACK_IMPORTED_MODULE_0__.encode)(cast(map)._decoded); -} -function decodedMappings(map) { - var _a; - return (_a = cast(map))._decoded || (_a._decoded = (0,_jridgewell_sourcemap_codec__WEBPACK_IMPORTED_MODULE_0__.decode)(cast(map)._encoded)); -} -function traceSegment(map, line, column) { - const decoded = decodedMappings(map); - if (line >= decoded.length) return null; - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - GREATEST_LOWER_BOUND - ); - return index === -1 ? null : segments[index]; -} -function originalPositionFor(map, needle) { - let { line, column, bias } = needle; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - if (line >= decoded.length) return OMapping(null, null, null, null); - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - bias || GREATEST_LOWER_BOUND - ); - if (index === -1) return OMapping(null, null, null, null); - const segment = segments[index]; - if (segment.length === 1) return OMapping(null, null, null, null); - const { names, resolvedSources } = map; - return OMapping( - resolvedSources[segment[SOURCES_INDEX]], - segment[SOURCE_LINE] + 1, - segment[SOURCE_COLUMN], - segment.length === 5 ? names[segment[NAMES_INDEX]] : null - ); -} -function generatedPositionFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); -} -function allGeneratedPositionsFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); -} -function eachMapping(map, cb) { - const decoded = decodedMappings(map); - const { names, resolvedSources } = map; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) name = names[seg[4]]; - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name - }); - } - } -} -function sourceIndex(map, source) { - const { sources, resolvedSources } = map; - let index = sources.indexOf(source); - if (index === -1) index = resolvedSources.indexOf(source); - return index; -} -function sourceContentFor(map, source) { - const { sourcesContent } = map; - if (sourcesContent == null) return null; - const index = sourceIndex(map, source); - return index === -1 ? null : sourcesContent[index]; -} -function isIgnored(map, source) { - const { ignoreList } = map; - if (ignoreList == null) return false; - const index = sourceIndex(map, source); - return index === -1 ? false : ignoreList.includes(index); -} -function presortedDecodedMap(map, mapUrl) { - const tracer = new TraceMap(clone(map, []), mapUrl); - cast(tracer)._decoded = map.mappings; - return tracer; -} -function decodedMap(map) { - return clone(map, decodedMappings(map)); -} -function encodedMap(map) { - return clone(map, encodedMappings(map)); -} -function clone(map, mappings) { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - ignoreList: map.ignoreList || map.x_google_ignoreList - }; -} -function OMapping(source, line, column, name) { - return { source, line, column, name }; -} -function GMapping(line, column) { - return { line, column }; -} -function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } else if (bias === LEAST_UPPER_BOUND) index++; - if (index === -1 || index === segments.length) return -1; - return index; -} -function sliceGeneratedPositions(segments, memo, line, column, bias) { - let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); - if (!found && bias === LEAST_UPPER_BOUND) min++; - if (min === -1 || min === segments.length) return []; - const matchedColumn = found ? column : segments[min][COLUMN]; - if (!found) min = lowerBound(segments, matchedColumn, min); - const max = upperBound(segments, matchedColumn, min); - const result = []; - for (; min <= max; min++) { - const segment = segments[min]; - result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); - } - return result; -} -function generatedPosition(map, source, line, column, bias, all) { - var _a; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const { sources, resolvedSources } = map; - let sourceIndex2 = sources.indexOf(source); - if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); - if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); - const generated = (_a = cast(map))._bySources || (_a._bySources = buildBySources( - decodedMappings(map), - cast(map)._bySourceMemos = sources.map(memoizedState) - )); - const segments = generated[sourceIndex2][line]; - if (segments == null) return all ? [] : GMapping(null, null); - const memo = cast(map)._bySourceMemos[sourceIndex2]; - if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); - const index = traceSegmentInternal(segments, memo, line, column, bias); - if (index === -1) return GMapping(null, null); - const segment = segments[index]; - return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); -} - -//# sourceMappingURL=trace-mapping.mjs.map - - -/***/ }), - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/***/ ((module) => { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/terser/lib/ast.js": -/*!****************************************!*\ - !*** ./node_modules/terser/lib/ast.js ***! - \****************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AST_Accessor: () => (/* binding */ AST_Accessor), -/* harmony export */ AST_Array: () => (/* binding */ AST_Array), -/* harmony export */ AST_Arrow: () => (/* binding */ AST_Arrow), -/* harmony export */ AST_Assign: () => (/* binding */ AST_Assign), -/* harmony export */ AST_Atom: () => (/* binding */ AST_Atom), -/* harmony export */ AST_Await: () => (/* binding */ AST_Await), -/* harmony export */ AST_BigInt: () => (/* binding */ AST_BigInt), -/* harmony export */ AST_Binary: () => (/* binding */ AST_Binary), -/* harmony export */ AST_Block: () => (/* binding */ AST_Block), -/* harmony export */ AST_BlockStatement: () => (/* binding */ AST_BlockStatement), -/* harmony export */ AST_Boolean: () => (/* binding */ AST_Boolean), -/* harmony export */ AST_Break: () => (/* binding */ AST_Break), -/* harmony export */ AST_Call: () => (/* binding */ AST_Call), -/* harmony export */ AST_Case: () => (/* binding */ AST_Case), -/* harmony export */ AST_Catch: () => (/* binding */ AST_Catch), -/* harmony export */ AST_Chain: () => (/* binding */ AST_Chain), -/* harmony export */ AST_Class: () => (/* binding */ AST_Class), -/* harmony export */ AST_ClassExpression: () => (/* binding */ AST_ClassExpression), -/* harmony export */ AST_ClassPrivateProperty: () => (/* binding */ AST_ClassPrivateProperty), -/* harmony export */ AST_ClassProperty: () => (/* binding */ AST_ClassProperty), -/* harmony export */ AST_ClassStaticBlock: () => (/* binding */ AST_ClassStaticBlock), -/* harmony export */ AST_ConciseMethod: () => (/* binding */ AST_ConciseMethod), -/* harmony export */ AST_Conditional: () => (/* binding */ AST_Conditional), -/* harmony export */ AST_Const: () => (/* binding */ AST_Const), -/* harmony export */ AST_Constant: () => (/* binding */ AST_Constant), -/* harmony export */ AST_Continue: () => (/* binding */ AST_Continue), -/* harmony export */ AST_DWLoop: () => (/* binding */ AST_DWLoop), -/* harmony export */ AST_Debugger: () => (/* binding */ AST_Debugger), -/* harmony export */ AST_DefClass: () => (/* binding */ AST_DefClass), -/* harmony export */ AST_Default: () => (/* binding */ AST_Default), -/* harmony export */ AST_DefaultAssign: () => (/* binding */ AST_DefaultAssign), -/* harmony export */ AST_Definitions: () => (/* binding */ AST_Definitions), -/* harmony export */ AST_Defun: () => (/* binding */ AST_Defun), -/* harmony export */ AST_Destructuring: () => (/* binding */ AST_Destructuring), -/* harmony export */ AST_Directive: () => (/* binding */ AST_Directive), -/* harmony export */ AST_Do: () => (/* binding */ AST_Do), -/* harmony export */ AST_Dot: () => (/* binding */ AST_Dot), -/* harmony export */ AST_DotHash: () => (/* binding */ AST_DotHash), -/* harmony export */ AST_EmptyStatement: () => (/* binding */ AST_EmptyStatement), -/* harmony export */ AST_Exit: () => (/* binding */ AST_Exit), -/* harmony export */ AST_Expansion: () => (/* binding */ AST_Expansion), -/* harmony export */ AST_Export: () => (/* binding */ AST_Export), -/* harmony export */ AST_False: () => (/* binding */ AST_False), -/* harmony export */ AST_Finally: () => (/* binding */ AST_Finally), -/* harmony export */ AST_For: () => (/* binding */ AST_For), -/* harmony export */ AST_ForIn: () => (/* binding */ AST_ForIn), -/* harmony export */ AST_ForOf: () => (/* binding */ AST_ForOf), -/* harmony export */ AST_Function: () => (/* binding */ AST_Function), -/* harmony export */ AST_Hole: () => (/* binding */ AST_Hole), -/* harmony export */ AST_If: () => (/* binding */ AST_If), -/* harmony export */ AST_Import: () => (/* binding */ AST_Import), -/* harmony export */ AST_ImportMeta: () => (/* binding */ AST_ImportMeta), -/* harmony export */ AST_Infinity: () => (/* binding */ AST_Infinity), -/* harmony export */ AST_IterationStatement: () => (/* binding */ AST_IterationStatement), -/* harmony export */ AST_Jump: () => (/* binding */ AST_Jump), -/* harmony export */ AST_Label: () => (/* binding */ AST_Label), -/* harmony export */ AST_LabelRef: () => (/* binding */ AST_LabelRef), -/* harmony export */ AST_LabeledStatement: () => (/* binding */ AST_LabeledStatement), -/* harmony export */ AST_Lambda: () => (/* binding */ AST_Lambda), -/* harmony export */ AST_Let: () => (/* binding */ AST_Let), -/* harmony export */ AST_LoopControl: () => (/* binding */ AST_LoopControl), -/* harmony export */ AST_NaN: () => (/* binding */ AST_NaN), -/* harmony export */ AST_NameMapping: () => (/* binding */ AST_NameMapping), -/* harmony export */ AST_New: () => (/* binding */ AST_New), -/* harmony export */ AST_NewTarget: () => (/* binding */ AST_NewTarget), -/* harmony export */ AST_Node: () => (/* binding */ AST_Node), -/* harmony export */ AST_Null: () => (/* binding */ AST_Null), -/* harmony export */ AST_Number: () => (/* binding */ AST_Number), -/* harmony export */ AST_Object: () => (/* binding */ AST_Object), -/* harmony export */ AST_ObjectGetter: () => (/* binding */ AST_ObjectGetter), -/* harmony export */ AST_ObjectKeyVal: () => (/* binding */ AST_ObjectKeyVal), -/* harmony export */ AST_ObjectProperty: () => (/* binding */ AST_ObjectProperty), -/* harmony export */ AST_ObjectSetter: () => (/* binding */ AST_ObjectSetter), -/* harmony export */ AST_PrefixedTemplateString: () => (/* binding */ AST_PrefixedTemplateString), -/* harmony export */ AST_PrivateGetter: () => (/* binding */ AST_PrivateGetter), -/* harmony export */ AST_PrivateIn: () => (/* binding */ AST_PrivateIn), -/* harmony export */ AST_PrivateMethod: () => (/* binding */ AST_PrivateMethod), -/* harmony export */ AST_PrivateSetter: () => (/* binding */ AST_PrivateSetter), -/* harmony export */ AST_PropAccess: () => (/* binding */ AST_PropAccess), -/* harmony export */ AST_RegExp: () => (/* binding */ AST_RegExp), -/* harmony export */ AST_Return: () => (/* binding */ AST_Return), -/* harmony export */ AST_Scope: () => (/* binding */ AST_Scope), -/* harmony export */ AST_Sequence: () => (/* binding */ AST_Sequence), -/* harmony export */ AST_SimpleStatement: () => (/* binding */ AST_SimpleStatement), -/* harmony export */ AST_Statement: () => (/* binding */ AST_Statement), -/* harmony export */ AST_StatementWithBody: () => (/* binding */ AST_StatementWithBody), -/* harmony export */ AST_String: () => (/* binding */ AST_String), -/* harmony export */ AST_Sub: () => (/* binding */ AST_Sub), -/* harmony export */ AST_Super: () => (/* binding */ AST_Super), -/* harmony export */ AST_Switch: () => (/* binding */ AST_Switch), -/* harmony export */ AST_SwitchBranch: () => (/* binding */ AST_SwitchBranch), -/* harmony export */ AST_Symbol: () => (/* binding */ AST_Symbol), -/* harmony export */ AST_SymbolBlockDeclaration: () => (/* binding */ AST_SymbolBlockDeclaration), -/* harmony export */ AST_SymbolCatch: () => (/* binding */ AST_SymbolCatch), -/* harmony export */ AST_SymbolClass: () => (/* binding */ AST_SymbolClass), -/* harmony export */ AST_SymbolClassProperty: () => (/* binding */ AST_SymbolClassProperty), -/* harmony export */ AST_SymbolConst: () => (/* binding */ AST_SymbolConst), -/* harmony export */ AST_SymbolDeclaration: () => (/* binding */ AST_SymbolDeclaration), -/* harmony export */ AST_SymbolDefClass: () => (/* binding */ AST_SymbolDefClass), -/* harmony export */ AST_SymbolDefun: () => (/* binding */ AST_SymbolDefun), -/* harmony export */ AST_SymbolExport: () => (/* binding */ AST_SymbolExport), -/* harmony export */ AST_SymbolExportForeign: () => (/* binding */ AST_SymbolExportForeign), -/* harmony export */ AST_SymbolFunarg: () => (/* binding */ AST_SymbolFunarg), -/* harmony export */ AST_SymbolImport: () => (/* binding */ AST_SymbolImport), -/* harmony export */ AST_SymbolImportForeign: () => (/* binding */ AST_SymbolImportForeign), -/* harmony export */ AST_SymbolLambda: () => (/* binding */ AST_SymbolLambda), -/* harmony export */ AST_SymbolLet: () => (/* binding */ AST_SymbolLet), -/* harmony export */ AST_SymbolMethod: () => (/* binding */ AST_SymbolMethod), -/* harmony export */ AST_SymbolPrivateProperty: () => (/* binding */ AST_SymbolPrivateProperty), -/* harmony export */ AST_SymbolRef: () => (/* binding */ AST_SymbolRef), -/* harmony export */ AST_SymbolVar: () => (/* binding */ AST_SymbolVar), -/* harmony export */ AST_TemplateSegment: () => (/* binding */ AST_TemplateSegment), -/* harmony export */ AST_TemplateString: () => (/* binding */ AST_TemplateString), -/* harmony export */ AST_This: () => (/* binding */ AST_This), -/* harmony export */ AST_Throw: () => (/* binding */ AST_Throw), -/* harmony export */ AST_Token: () => (/* binding */ AST_Token), -/* harmony export */ AST_Toplevel: () => (/* binding */ AST_Toplevel), -/* harmony export */ AST_True: () => (/* binding */ AST_True), -/* harmony export */ AST_Try: () => (/* binding */ AST_Try), -/* harmony export */ AST_TryBlock: () => (/* binding */ AST_TryBlock), -/* harmony export */ AST_Unary: () => (/* binding */ AST_Unary), -/* harmony export */ AST_UnaryPostfix: () => (/* binding */ AST_UnaryPostfix), -/* harmony export */ AST_UnaryPrefix: () => (/* binding */ AST_UnaryPrefix), -/* harmony export */ AST_Undefined: () => (/* binding */ AST_Undefined), -/* harmony export */ AST_Var: () => (/* binding */ AST_Var), -/* harmony export */ AST_VarDef: () => (/* binding */ AST_VarDef), -/* harmony export */ AST_While: () => (/* binding */ AST_While), -/* harmony export */ AST_With: () => (/* binding */ AST_With), -/* harmony export */ AST_Yield: () => (/* binding */ AST_Yield), -/* harmony export */ TreeTransformer: () => (/* binding */ TreeTransformer), -/* harmony export */ TreeWalker: () => (/* binding */ TreeWalker), -/* harmony export */ _INLINE: () => (/* binding */ _INLINE), -/* harmony export */ _KEY: () => (/* binding */ _KEY), -/* harmony export */ _MANGLEPROP: () => (/* binding */ _MANGLEPROP), -/* harmony export */ _NOINLINE: () => (/* binding */ _NOINLINE), -/* harmony export */ _PURE: () => (/* binding */ _PURE), -/* harmony export */ walk: () => (/* binding */ walk), -/* harmony export */ walk_abort: () => (/* binding */ walk_abort), -/* harmony export */ walk_body: () => (/* binding */ walk_body), -/* harmony export */ walk_parent: () => (/* binding */ walk_parent) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse.js */ "./node_modules/terser/lib/parse.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - -function DEFNODE(type, props, ctor, methods, base = AST_Node) { - if (!props) props = []; - else props = props.split(/\s+/); - var self_props = props; - if (base && base.PROPS) - props = props.concat(base.PROPS); - const proto = base && Object.create(base.prototype); - if (proto) { - ctor.prototype = proto; - ctor.BASE = base; - } - if (base) base.SUBCLASSES.push(ctor); - ctor.prototype.CTOR = ctor; - ctor.prototype.constructor = ctor; - ctor.PROPS = props || null; - ctor.SELF_PROPS = self_props; - ctor.SUBCLASSES = []; - if (type) { - ctor.prototype.TYPE = ctor.TYPE = type; - } - if (methods) for (let i in methods) if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.HOP)(methods, i)) { - if (i[0] === "$") { - ctor[i.substr(1)] = methods[i]; - } else { - ctor.prototype[i] = methods[i]; - } - } - ctor.DEFMETHOD = function(name, method) { - this.prototype[name] = method; - }; - return ctor; -} - -const has_tok_flag = (tok, flag) => Boolean(tok.flags & flag); -const set_tok_flag = (tok, flag, truth) => { - if (truth) { - tok.flags |= flag; - } else { - tok.flags &= ~flag; - } -}; - -const TOK_FLAG_NLB = 0b0001; -const TOK_FLAG_QUOTE_SINGLE = 0b0010; -const TOK_FLAG_QUOTE_EXISTS = 0b0100; -const TOK_FLAG_TEMPLATE_END = 0b1000; - -class AST_Token { - constructor(type, value, line, col, pos, nlb, comments_before, comments_after, file) { - this.flags = (nlb ? 1 : 0); - - this.type = type; - this.value = value; - this.line = line; - this.col = col; - this.pos = pos; - this.comments_before = comments_before; - this.comments_after = comments_after; - this.file = file; - - Object.seal(this); - } - - // Return a string summary of the token for node.js console.log - [Symbol.for("nodejs.util.inspect.custom")](_depth, options) { - const special = str => options.stylize(str, "special"); - const quote = typeof this.value === "string" && this.value.includes("`") ? "'" : "`"; - const value = `${quote}${this.value}${quote}`; - return `${special("[AST_Token")} ${value} at ${this.line}:${this.col}${special("]")}`; - } - - get nlb() { - return has_tok_flag(this, TOK_FLAG_NLB); - } - - set nlb(new_nlb) { - set_tok_flag(this, TOK_FLAG_NLB, new_nlb); - } - - get quote() { - return !has_tok_flag(this, TOK_FLAG_QUOTE_EXISTS) - ? "" - : (has_tok_flag(this, TOK_FLAG_QUOTE_SINGLE) ? "'" : '"'); - } - - set quote(quote_type) { - set_tok_flag(this, TOK_FLAG_QUOTE_SINGLE, quote_type === "'"); - set_tok_flag(this, TOK_FLAG_QUOTE_EXISTS, !!quote_type); - } - - get template_end() { - return has_tok_flag(this, TOK_FLAG_TEMPLATE_END); - } - - set template_end(new_template_end) { - set_tok_flag(this, TOK_FLAG_TEMPLATE_END, new_template_end); - } -} - -var AST_Node = DEFNODE("Node", "start end", function AST_Node(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - _clone: function(deep) { - if (deep) { - var self = this.clone(); - return self.transform(new TreeTransformer(function(node) { - if (node !== self) { - return node.clone(true); - } - })); - } - return new this.CTOR(this); - }, - clone: function(deep) { - return this._clone(deep); - }, - $documentation: "Base class of all AST nodes", - $propdoc: { - start: "[AST_Token] The first token of this node", - end: "[AST_Token] The last token of this node" - }, - _walk: function(visitor) { - return visitor._visit(this); - }, - walk: function(visitor) { - return this._walk(visitor); // not sure the indirection will be any help - }, - _children_backwards: () => {} -}, null); - -/* -----[ statements ]----- */ - -var AST_Statement = DEFNODE("Statement", null, function AST_Statement(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class of all statements", -}); - -var AST_Debugger = DEFNODE("Debugger", null, function AST_Debugger(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Represents a debugger statement", -}, AST_Statement); - -var AST_Directive = DEFNODE("Directive", "value quote", function AST_Directive(props) { - if (props) { - this.value = props.value; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Represents a directive, like \"use strict\";", - $propdoc: { - value: "[string] The value of this directive as a plain string (it's not an AST_String!)", - quote: "[string] the original quote character" - }, -}, AST_Statement); - -var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", function AST_SimpleStatement(props) { - if (props) { - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", - $propdoc: { - body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - } -}, AST_Statement); - -function walk_body(node, visitor) { - const body = node.body; - for (var i = 0, len = body.length; i < len; i++) { - body[i]._walk(visitor); - } -} - -function clone_block_scope(deep) { - var clone = this._clone(deep); - if (this.block_scope) { - clone.block_scope = this.block_scope.clone(); - } - return clone; -} - -var AST_Block = DEFNODE("Block", "body block_scope", function AST_Block(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A body of statements (usually braced)", - $propdoc: { - body: "[AST_Statement*] an array of statements", - block_scope: "[AST_Scope] the block scope" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - }, - clone: clone_block_scope -}, AST_Statement); - -var AST_BlockStatement = DEFNODE("BlockStatement", null, function AST_BlockStatement(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A block statement", -}, AST_Block); - -var AST_EmptyStatement = DEFNODE("EmptyStatement", null, function AST_EmptyStatement(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The empty statement (empty block or simply a semicolon)" -}, AST_Statement); - -var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", function AST_StatementWithBody(props) { - if (props) { - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", - $propdoc: { - body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" - } -}, AST_Statement); - -var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", function AST_LabeledStatement(props) { - if (props) { - this.label = props.label; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Statement with a label", - $propdoc: { - label: "[AST_Label] a label definition" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.label._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.label); - }, - clone: function(deep) { - var node = this._clone(deep); - if (deep) { - var label = node.label; - var def = this.label; - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_LoopControl - && node.label && node.label.thedef === def) { - node.label.thedef = label; - label.references.push(node); - } - })); - } - return node; - } -}, AST_StatementWithBody); - -var AST_IterationStatement = DEFNODE( - "IterationStatement", - "block_scope", - function AST_IterationStatement(props) { - if (props) { - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Internal class. All loops inherit from it.", - $propdoc: { - block_scope: "[AST_Scope] the block scope for this iteration statement." - }, - clone: clone_block_scope - }, - AST_StatementWithBody -); - -var AST_DWLoop = DEFNODE("DWLoop", "condition", function AST_DWLoop(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for do/while statements", - $propdoc: { - condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" - } -}, AST_IterationStatement); - -var AST_Do = DEFNODE("Do", null, function AST_Do(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `do` statement", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - this.condition._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.condition); - push(this.body); - } -}, AST_DWLoop); - -var AST_While = DEFNODE("While", null, function AST_While(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `while` statement", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.condition); - }, -}, AST_DWLoop); - -var AST_For = DEFNODE("For", "init condition step", function AST_For(props) { - if (props) { - this.init = props.init; - this.condition = props.condition; - this.step = props.step; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for` statement", - $propdoc: { - init: "[AST_Node?] the `for` initialization code, or null if empty", - condition: "[AST_Node?] the `for` termination clause, or null if empty", - step: "[AST_Node?] the `for` update clause, or null if empty" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.init) this.init._walk(visitor); - if (this.condition) this.condition._walk(visitor); - if (this.step) this.step._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - if (this.step) push(this.step); - if (this.condition) push(this.condition); - if (this.init) push(this.init); - }, -}, AST_IterationStatement); - -var AST_ForIn = DEFNODE("ForIn", "init object", function AST_ForIn(props) { - if (props) { - this.init = props.init; - this.object = props.object; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for ... in` statement", - $propdoc: { - init: "[AST_Node] the `for/in` initialization code", - object: "[AST_Node] the object that we're looping through" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.init._walk(visitor); - this.object._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - if (this.object) push(this.object); - if (this.init) push(this.init); - }, -}, AST_IterationStatement); - -var AST_ForOf = DEFNODE("ForOf", "await", function AST_ForOf(props) { - if (props) { - this.await = props.await; - this.init = props.init; - this.object = props.object; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for ... of` statement", -}, AST_ForIn); - -var AST_With = DEFNODE("With", "expression", function AST_With(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `with` statement", - $propdoc: { - expression: "[AST_Node] the `with` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.expression); - }, -}, AST_StatementWithBody); - -/* -----[ scope and functions ]----- */ - -var AST_Scope = DEFNODE( - "Scope", - "variables uses_with uses_eval parent_scope enclosed cname", - function AST_Scope(props) { - if (props) { - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for all statements introducing a lexical scope", - $propdoc: { - variables: "[Map/S] a map of name -> SymbolDef for all variables/functions defined in this scope", - uses_with: "[boolean/S] tells whether this scope uses the `with` statement", - uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", - parent_scope: "[AST_Scope?/S] link to the parent scope", - enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", - cname: "[integer/S] current index for mangling variables (used internally by the mangler)", - }, - get_defun_scope: function() { - var self = this; - while (self.is_block_scope()) { - self = self.parent_scope; - } - return self; - }, - clone: function(deep, toplevel) { - var node = this._clone(deep); - if (deep && this.variables && toplevel && !this._block_scope) { - node.figure_out_scope({}, { - toplevel: toplevel, - parent_scope: this.parent_scope - }); - } else { - if (this.variables) node.variables = new Map(this.variables); - if (this.enclosed) node.enclosed = this.enclosed.slice(); - if (this._block_scope) node._block_scope = this._block_scope; - } - return node; - }, - pinned: function() { - return this.uses_eval || this.uses_with; - } - }, - AST_Block -); - -var AST_Toplevel = DEFNODE("Toplevel", "globals", function AST_Toplevel(props) { - if (props) { - this.globals = props.globals; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The toplevel scope", - $propdoc: { - globals: "[Map/S] a map of name -> SymbolDef for all undeclared names", - }, - wrap_commonjs: function(name) { - var body = this.body; - var wrapped_tl = "(function(exports){'$ORIG';})(typeof " + name + "=='undefined'?(" + name + "={}):" + name + ");"; - wrapped_tl = (0,_parse_js__WEBPACK_IMPORTED_MODULE_1__.parse)(wrapped_tl); - wrapped_tl = wrapped_tl.transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MAP.splice(body); - } - })); - return wrapped_tl; - }, - wrap_enclose: function(args_values) { - if (typeof args_values != "string") args_values = ""; - var index = args_values.indexOf(":"); - if (index < 0) index = args_values.length; - var body = this.body; - return (0,_parse_js__WEBPACK_IMPORTED_MODULE_1__.parse)([ - "(function(", - args_values.slice(0, index), - '){"$ORIG"})(', - args_values.slice(index + 1), - ")" - ].join("")).transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MAP.splice(body); - } - })); - } -}, AST_Scope); - -var AST_Expansion = DEFNODE("Expansion", "expression", function AST_Expansion(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list", - $propdoc: { - expression: "[AST_Node] the thing to be expanded" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression.walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Lambda = DEFNODE( - "Lambda", - "name argnames uses_arguments is_generator async", - function AST_Lambda(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for functions", - $propdoc: { - name: "[AST_SymbolDeclaration?] the name of this function", - argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments", - uses_arguments: "[boolean/S] tells whether this function accesses the arguments array", - is_generator: "[boolean] is this a generator method", - async: "[boolean] is this method async", - }, - args_as_names: function () { - var out = []; - for (var i = 0; i < this.argnames.length; i++) { - if (this.argnames[i] instanceof AST_Destructuring) { - out.push(...this.argnames[i].all_symbols()); - } else { - out.push(this.argnames[i]); - } - } - return out; - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.name) this.name._walk(visitor); - var argnames = this.argnames; - for (var i = 0, len = argnames.length; i < len; i++) { - argnames[i]._walk(visitor); - } - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - - i = this.argnames.length; - while (i--) push(this.argnames[i]); - - if (this.name) push(this.name); - }, - is_braceless() { - return this.body[0] instanceof AST_Return && this.body[0].value; - }, - // Default args and expansion don't count, so .argnames.length doesn't cut it - length_property() { - let length = 0; - - for (const arg of this.argnames) { - if (arg instanceof AST_SymbolFunarg || arg instanceof AST_Destructuring) { - length++; - } - } - - return length; - } - }, - AST_Scope -); - -var AST_Accessor = DEFNODE("Accessor", null, function AST_Accessor(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A setter/getter function. The `name` property is always null." -}, AST_Lambda); - -var AST_Function = DEFNODE("Function", null, function AST_Function(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A function expression" -}, AST_Lambda); - -var AST_Arrow = DEFNODE("Arrow", null, function AST_Arrow(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An ES6 Arrow function ((a) => b)" -}, AST_Lambda); - -var AST_Defun = DEFNODE("Defun", null, function AST_Defun(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A function definition" -}, AST_Lambda); - -/* -----[ DESTRUCTURING ]----- */ -var AST_Destructuring = DEFNODE("Destructuring", "names is_array", function AST_Destructuring(props) { - if (props) { - this.names = props.names; - this.is_array = props.is_array; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A destructuring of several names. Used in destructuring assignment and with destructuring function argument names", - $propdoc: { - "names": "[AST_Node*] Array of properties or elements", - "is_array": "[Boolean] Whether the destructuring represents an object or array" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.names.forEach(function(name) { - name._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.names.length; - while (i--) push(this.names[i]); - }, - all_symbols: function() { - var out = []; - walk(this, node => { - if (node instanceof AST_SymbolDeclaration) { - out.push(node); - } - if (node instanceof AST_Lambda) { - return true; - } - }); - return out; - } -}); - -var AST_PrefixedTemplateString = DEFNODE( - "PrefixedTemplateString", - "template_string prefix", - function AST_PrefixedTemplateString(props) { - if (props) { - this.template_string = props.template_string; - this.prefix = props.prefix; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "A templatestring with a prefix, such as String.raw`foobarbaz`", - $propdoc: { - template_string: "[AST_TemplateString] The template string", - prefix: "[AST_Node] The prefix, which will get called." - }, - _walk: function(visitor) { - return visitor._visit(this, function () { - this.prefix._walk(visitor); - this.template_string._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.template_string); - push(this.prefix); - }, - } -); - -var AST_TemplateString = DEFNODE("TemplateString", "segments", function AST_TemplateString(props) { - if (props) { - this.segments = props.segments; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A template string literal", - $propdoc: { - segments: "[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment." - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.segments.forEach(function(seg) { - seg._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.segments.length; - while (i--) push(this.segments[i]); - } -}); - -var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", function AST_TemplateSegment(props) { - if (props) { - this.value = props.value; - this.raw = props.raw; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A segment of a template string literal", - $propdoc: { - value: "Content of the segment", - raw: "Raw source of the segment", - } -}); - -/* -----[ JUMPS ]----- */ - -var AST_Jump = DEFNODE("Jump", null, function AST_Jump(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)" -}, AST_Statement); - -/** Base class for “exits” (`return` and `throw`) */ -var AST_Exit = DEFNODE("Exit", "value", function AST_Exit(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for “exits” (`return` and `throw`)", - $propdoc: { - value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" - }, - _walk: function(visitor) { - return visitor._visit(this, this.value && function() { - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value) push(this.value); - }, -}, AST_Jump); - -var AST_Return = DEFNODE("Return", null, function AST_Return(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `return` statement" -}, AST_Exit); - -var AST_Throw = DEFNODE("Throw", null, function AST_Throw(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `throw` statement" -}, AST_Exit); - -var AST_LoopControl = DEFNODE("LoopControl", "label", function AST_LoopControl(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for loop control statements (`break` and `continue`)", - $propdoc: { - label: "[AST_LabelRef?] the label, or null if none", - }, - _walk: function(visitor) { - return visitor._visit(this, this.label && function() { - this.label._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.label) push(this.label); - }, -}, AST_Jump); - -var AST_Break = DEFNODE("Break", null, function AST_Break(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `break` statement" -}, AST_LoopControl); - -var AST_Continue = DEFNODE("Continue", null, function AST_Continue(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `continue` statement" -}, AST_LoopControl); - -var AST_Await = DEFNODE("Await", "expression", function AST_Await(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An `await` statement", - $propdoc: { - expression: "[AST_Node] the mandatory expression being awaited", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Yield = DEFNODE("Yield", "expression is_star", function AST_Yield(props) { - if (props) { - this.expression = props.expression; - this.is_star = props.is_star; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `yield` statement", - $propdoc: { - expression: "[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false", - is_star: "[Boolean] Whether this is a yield or yield* statement" - }, - _walk: function(visitor) { - return visitor._visit(this, this.expression && function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.expression) push(this.expression); - } -}); - -/* -----[ IF ]----- */ - -var AST_If = DEFNODE("If", "condition alternative", function AST_If(props) { - if (props) { - this.condition = props.condition; - this.alternative = props.alternative; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `if` statement", - $propdoc: { - condition: "[AST_Node] the `if` condition", - alternative: "[AST_Statement?] the `else` part, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - if (this.alternative) this.alternative._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.alternative) { - push(this.alternative); - } - push(this.body); - push(this.condition); - } -}, AST_StatementWithBody); - -/* -----[ SWITCH ]----- */ - -var AST_Switch = DEFNODE("Switch", "expression", function AST_Switch(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `switch` statement", - $propdoc: { - expression: "[AST_Node] the `switch` “discriminant”" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - push(this.expression); - } -}, AST_Block); - -var AST_SwitchBranch = DEFNODE("SwitchBranch", null, function AST_SwitchBranch(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for `switch` branches", -}, AST_Block); - -var AST_Default = DEFNODE("Default", null, function AST_Default(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `default` switch branch", -}, AST_SwitchBranch); - -var AST_Case = DEFNODE("Case", "expression", function AST_Case(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `case` switch branch", - $propdoc: { - expression: "[AST_Node] the `case` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - push(this.expression); - }, -}, AST_SwitchBranch); - -/* -----[ EXCEPTIONS ]----- */ - -var AST_Try = DEFNODE("Try", "body bcatch bfinally", function AST_Try(props) { - if (props) { - this.body = props.body; - this.bcatch = props.bcatch; - this.bfinally = props.bfinally; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `try` statement", - $propdoc: { - body: "[AST_TryBlock] the try block", - bcatch: "[AST_Catch?] the catch block, or null if not present", - bfinally: "[AST_Finally?] the finally block, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - if (this.bcatch) this.bcatch._walk(visitor); - if (this.bfinally) this.bfinally._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.bfinally) push(this.bfinally); - if (this.bcatch) push(this.bcatch); - push(this.body); - }, -}, AST_Statement); - -var AST_TryBlock = DEFNODE("TryBlock", null, function AST_TryBlock(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `try` block of a try statement" -}, AST_Block); - -var AST_Catch = DEFNODE("Catch", "argname", function AST_Catch(props) { - if (props) { - this.argname = props.argname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `catch` node; only makes sense as part of a `try` statement", - $propdoc: { - argname: "[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.argname) this.argname._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - if (this.argname) push(this.argname); - }, -}, AST_Block); - -var AST_Finally = DEFNODE("Finally", null, function AST_Finally(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `finally` node; only makes sense as part of a `try` statement" -}, AST_Block); - -/* -----[ VAR/CONST ]----- */ - -var AST_Definitions = DEFNODE("Definitions", "definitions", function AST_Definitions(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", - $propdoc: { - definitions: "[AST_VarDef*] array of variable definitions" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var definitions = this.definitions; - for (var i = 0, len = definitions.length; i < len; i++) { - definitions[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.definitions.length; - while (i--) push(this.definitions[i]); - }, -}, AST_Statement); - -var AST_Var = DEFNODE("Var", null, function AST_Var(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `var` statement" -}, AST_Definitions); - -var AST_Let = DEFNODE("Let", null, function AST_Let(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `let` statement" -}, AST_Definitions); - -var AST_Const = DEFNODE("Const", null, function AST_Const(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `const` statement" -}, AST_Definitions); - -var AST_VarDef = DEFNODE("VarDef", "name value", function AST_VarDef(props) { - if (props) { - this.name = props.name; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A variable declaration; only appears in a AST_Definitions node", - $propdoc: { - name: "[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable", - value: "[AST_Node?] initializer, or null of there's no initializer" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.name._walk(visitor); - if (this.value) this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value) push(this.value); - push(this.name); - }, - declarations_as_names() { - if (this.name instanceof AST_SymbolDeclaration) { - return [this]; - } else { - return this.name.all_symbols(); - } - } -}); - -var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", function AST_NameMapping(props) { - if (props) { - this.foreign_name = props.foreign_name; - this.name = props.name; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The part of the export/import statement that declare names from a module.", - $propdoc: { - foreign_name: "[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)", - name: "[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module." - }, - _walk: function (visitor) { - return visitor._visit(this, function() { - this.foreign_name._walk(visitor); - this.name._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.name); - push(this.foreign_name); - }, -}); - -var AST_Import = DEFNODE( - "Import", - "imported_name imported_names module_name attributes", - function AST_Import(props) { - if (props) { - this.imported_name = props.imported_name; - this.imported_names = props.imported_names; - this.module_name = props.module_name; - this.attributes = props.attributes; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "An `import` statement", - $propdoc: { - imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.", - imported_names: "[AST_NameMapping*] The names of non-default imported variables", - module_name: "[AST_String] String literal describing where this module came from", - attributes: "[AST_Object?] The import attributes (with {...})" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.imported_name) { - this.imported_name._walk(visitor); - } - if (this.imported_names) { - this.imported_names.forEach(function(name_import) { - name_import._walk(visitor); - }); - } - this.module_name._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.module_name); - if (this.imported_names) { - let i = this.imported_names.length; - while (i--) push(this.imported_names[i]); - } - if (this.imported_name) push(this.imported_name); - }, - } -); - -var AST_ImportMeta = DEFNODE("ImportMeta", null, function AST_ImportMeta(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A reference to import.meta", -}); - -var AST_Export = DEFNODE( - "Export", - "exported_definition exported_value is_default exported_names module_name attributes", - function AST_Export(props) { - if (props) { - this.exported_definition = props.exported_definition; - this.exported_value = props.exported_value; - this.is_default = props.is_default; - this.exported_names = props.exported_names; - this.module_name = props.module_name; - this.attributes = props.attributes; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "An `export` statement", - $propdoc: { - exported_definition: "[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition", - exported_value: "[AST_Node?] An exported value", - exported_names: "[AST_NameMapping*?] List of exported names", - module_name: "[AST_String?] Name of the file to load exports from", - is_default: "[Boolean] Whether this is the default exported value of this module", - attributes: "[AST_Object?] The import attributes" - }, - _walk: function (visitor) { - return visitor._visit(this, function () { - if (this.exported_definition) { - this.exported_definition._walk(visitor); - } - if (this.exported_value) { - this.exported_value._walk(visitor); - } - if (this.exported_names) { - this.exported_names.forEach(function(name_export) { - name_export._walk(visitor); - }); - } - if (this.module_name) { - this.module_name._walk(visitor); - } - }); - }, - _children_backwards(push) { - if (this.module_name) push(this.module_name); - if (this.exported_names) { - let i = this.exported_names.length; - while (i--) push(this.exported_names[i]); - } - if (this.exported_value) push(this.exported_value); - if (this.exported_definition) push(this.exported_definition); - } - }, - AST_Statement -); - -/* -----[ OTHER ]----- */ - -var AST_Call = DEFNODE( - "Call", - "expression args optional _annotations", - function AST_Call(props) { - if (props) { - this.expression = props.expression; - this.args = props.args; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; - }, - { - $documentation: "A function call expression", - $propdoc: { - expression: "[AST_Node] expression to invoke as function", - args: "[AST_Node*] array of arguments", - optional: "[boolean] whether this is an optional call (IE ?.() )", - _annotations: "[number] bitfield containing information about the call" - }, - initialize() { - if (this._annotations == null) this._annotations = 0; - }, - _walk(visitor) { - return visitor._visit(this, function() { - var args = this.args; - for (var i = 0, len = args.length; i < len; i++) { - args[i]._walk(visitor); - } - this.expression._walk(visitor); // TODO why do we need to crawl this last? - }); - }, - _children_backwards(push) { - let i = this.args.length; - while (i--) push(this.args[i]); - push(this.expression); - }, - } -); - -var AST_New = DEFNODE("New", null, function AST_New(props) { - if (props) { - this.expression = props.expression; - this.args = props.args; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; -}, { - $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" -}, AST_Call); - -var AST_Sequence = DEFNODE("Sequence", "expressions", function AST_Sequence(props) { - if (props) { - this.expressions = props.expressions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A sequence expression (comma-separated expressions)", - $propdoc: { - expressions: "[AST_Node*] array of expressions (at least two)" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expressions.forEach(function(node) { - node._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.expressions.length; - while (i--) push(this.expressions[i]); - }, -}); - -var AST_PropAccess = DEFNODE( - "PropAccess", - "expression property optional", - function AST_PropAccess(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`", - $propdoc: { - expression: "[AST_Node] the “container” expression", - property: "[AST_Node|string] the property to access. For AST_Dot & AST_DotHash this is always a plain string, while for AST_Sub it's an arbitrary AST_Node", - - optional: "[boolean] whether this is an optional property access (IE ?.)" - } - } -); - -var AST_Dot = DEFNODE("Dot", "quote", function AST_Dot(props) { - if (props) { - this.quote = props.quote; - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A dotted property access expression", - $propdoc: { - quote: "[string] the original quote character when transformed from AST_Sub", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}, AST_PropAccess); - -var AST_DotHash = DEFNODE("DotHash", "", function AST_DotHash(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A dotted property access to a private property", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}, AST_PropAccess); - -var AST_Sub = DEFNODE("Sub", null, function AST_Sub(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Index-style property access, i.e. `a[\"foo\"]`", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.property._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.property); - push(this.expression); - }, -}, AST_PropAccess); - -var AST_Chain = DEFNODE("Chain", "expression", function AST_Chain(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A chain expression like a?.b?.(c)?.[d]", - $propdoc: { - expression: "[AST_Call|AST_Dot|AST_DotHash|AST_Sub] chain element." - }, - _walk: function (visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Unary = DEFNODE("Unary", "operator expression", function AST_Unary(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for unary expressions", - $propdoc: { - operator: "[string] the operator", - expression: "[AST_Node] expression that this unary operator applies to" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, function AST_UnaryPrefix(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" -}, AST_Unary); - -var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, function AST_UnaryPostfix(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Unary postfix expression, i.e. `i++`" -}, AST_Unary); - -var AST_Binary = DEFNODE("Binary", "operator left right", function AST_Binary(props) { - if (props) { - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Binary expression, i.e. `a + b`", - $propdoc: { - left: "[AST_Node] left-hand side expression", - operator: "[string] the operator", - right: "[AST_Node] right-hand side expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.left._walk(visitor); - this.right._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.right); - push(this.left); - }, -}); - -var AST_Conditional = DEFNODE( - "Conditional", - "condition consequent alternative", - function AST_Conditional(props) { - if (props) { - this.condition = props.condition; - this.consequent = props.consequent; - this.alternative = props.alternative; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", - $propdoc: { - condition: "[AST_Node]", - consequent: "[AST_Node]", - alternative: "[AST_Node]" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.consequent._walk(visitor); - this.alternative._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.alternative); - push(this.consequent); - push(this.condition); - }, - } -); - -var AST_Assign = DEFNODE("Assign", "logical", function AST_Assign(props) { - if (props) { - this.logical = props.logical; - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An assignment expression — `a = b + 5`", - $propdoc: { - logical: "Whether it's a logical assignment" - } -}, AST_Binary); - -var AST_DefaultAssign = DEFNODE("DefaultAssign", null, function AST_DefaultAssign(props) { - if (props) { - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A default assignment expression like in `(a = 3) => a`" -}, AST_Binary); - -/* -----[ LITERALS ]----- */ - -var AST_Array = DEFNODE("Array", "elements", function AST_Array(props) { - if (props) { - this.elements = props.elements; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An array literal", - $propdoc: { - elements: "[AST_Node*] array of elements" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var elements = this.elements; - for (var i = 0, len = elements.length; i < len; i++) { - elements[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.elements.length; - while (i--) push(this.elements[i]); - }, -}); - -var AST_Object = DEFNODE("Object", "properties", function AST_Object(props) { - if (props) { - this.properties = props.properties; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An object literal", - $propdoc: { - properties: "[AST_ObjectProperty*] array of properties" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var properties = this.properties; - for (var i = 0, len = properties.length; i < len; i++) { - properties[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.properties.length; - while (i--) push(this.properties[i]); - }, -}); - -/* -----[ OBJECT/CLASS PROPERTIES ]----- */ - -/** - * Everything inside the curly braces of an object/class is a subclass of AST_ObjectProperty, except for AST_ClassStaticBlock. - **/ -var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", function AST_ObjectProperty(props) { - if (props) { - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "Base class for literal object properties", - $propdoc: { - key: "[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.", - value: "[AST_Node] property value. For getters, setters and methods this is an AST_Accessor." - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.key instanceof AST_Node) - this.key._walk(visitor); - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.value); - if (this.key instanceof AST_Node) push(this.key); - }, -}); - -var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", "quote", function AST_ObjectKeyVal(props) { - if (props) { - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A key: value object property", - $propdoc: { - quote: "[string] the original quote character" - }, - computed_key() { - return this.key instanceof AST_Node; - } -}, AST_ObjectProperty); - -var AST_PrivateSetter = DEFNODE("PrivateSetter", "static", function AST_PrivateSetter(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - static: "[boolean] whether this is a static private setter" - }, - $documentation: "A private setter property", - computed_key() { - return false; - } -}, AST_ObjectProperty); - -var AST_PrivateGetter = DEFNODE("PrivateGetter", "static", function AST_PrivateGetter(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - static: "[boolean] whether this is a static private getter" - }, - $documentation: "A private getter property", - computed_key() { - return false; - } -}, AST_ObjectProperty); - -var AST_ObjectSetter = DEFNODE("ObjectSetter", "quote static", function AST_ObjectSetter(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] whether this is a static setter (classes only)" - }, - $documentation: "An object setter property", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } -}, AST_ObjectProperty); - -var AST_ObjectGetter = DEFNODE("ObjectGetter", "quote static", function AST_ObjectGetter(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] whether this is a static getter (classes only)" - }, - $documentation: "An object getter property", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } -}, AST_ObjectProperty); - -var AST_ConciseMethod = DEFNODE("ConciseMethod", "quote static", function AST_ConciseMethod(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] is this method static (classes only)", - }, - $documentation: "An ES6 concise method inside an object or class", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } -}, AST_ObjectProperty); - -var AST_PrivateMethod = DEFNODE("PrivateMethod", "static", function AST_PrivateMethod(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A private class method inside a class", - $propdoc: { - static: "[boolean] is this a static private method", - }, - computed_key() { - return false; - }, -}, AST_ObjectProperty); - -var AST_Class = DEFNODE("Class", "name extends properties", function AST_Class(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - name: "[AST_SymbolClass|AST_SymbolDefClass?] optional class name.", - extends: "[AST_Node]? optional parent class", - properties: "[AST_ObjectProperty|AST_ClassStaticBlock]* array of properties or static blocks" - }, - $documentation: "An ES6 class", - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.name) { - this.name._walk(visitor); - } - if (this.extends) { - this.extends._walk(visitor); - } - this.properties.forEach((prop) => prop._walk(visitor)); - }); - }, - _children_backwards(push) { - let i = this.properties.length; - while (i--) push(this.properties[i]); - if (this.extends) push(this.extends); - if (this.name) push(this.name); - }, - /** go through the bits that are executed instantly, not when the class is `new`'d. Doesn't walk the name. */ - visit_nondeferred_class_parts(visitor) { - if (this.extends) { - this.extends._walk(visitor); - } - this.properties.forEach((prop) => { - if (prop instanceof AST_ClassStaticBlock) { - prop._walk(visitor); - return; - } - if (prop.computed_key()) { - visitor.push(prop); - prop.key._walk(visitor); - visitor.pop(); - } - if ( - prop instanceof AST_ClassPrivateProperty && prop.static && prop.value - || prop instanceof AST_ClassProperty && prop.static && prop.value - ) { - visitor.push(prop); - prop.value._walk(visitor); - visitor.pop(); - } - }); - }, - /** go through the bits that are executed later, when the class is `new`'d or a static method is called */ - visit_deferred_class_parts(visitor) { - this.properties.forEach((prop) => { - if ( - prop instanceof AST_ConciseMethod - || prop instanceof AST_PrivateMethod - ) { - prop.walk(visitor); - } else if ( - prop instanceof AST_ClassProperty && !prop.static && prop.value - || prop instanceof AST_ClassPrivateProperty && !prop.static && prop.value - ) { - visitor.push(prop); - prop.value._walk(visitor); - visitor.pop(); - } - }); - }, - is_self_referential: function() { - const this_id = this.name && this.name.definition().id; - let found = false; - let class_this = true; - this.visit_nondeferred_class_parts(new TreeWalker((node, descend) => { - if (found) return true; - if (node instanceof AST_This) return (found = class_this); - if (node instanceof AST_SymbolRef) return (found = node.definition().id === this_id); - if (node instanceof AST_Lambda && !(node instanceof AST_Arrow)) { - const class_this_save = class_this; - class_this = false; - descend(); - class_this = class_this_save; - return true; - } - })); - return found; - }, -}, AST_Scope /* TODO a class might have a scope but it's not a scope */); - -var AST_ClassProperty = DEFNODE("ClassProperty", "static quote", function AST_ClassProperty(props) { - if (props) { - this.static = props.static; - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A class property", - $propdoc: { - static: "[boolean] whether this is a static key", - quote: "[string] which quote is being used" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.key instanceof AST_Node) - this.key._walk(visitor); - if (this.value instanceof AST_Node) - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value instanceof AST_Node) push(this.value); - if (this.key instanceof AST_Node) push(this.key); - }, - computed_key() { - return !(this.key instanceof AST_SymbolClassProperty); - } -}, AST_ObjectProperty); - -var AST_ClassPrivateProperty = DEFNODE("ClassPrivateProperty", "", function AST_ClassPrivateProperty(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class property for a private property", - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.value instanceof AST_Node) - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value instanceof AST_Node) push(this.value); - }, - computed_key() { - return false; - }, -}, AST_ObjectProperty); - -var AST_PrivateIn = DEFNODE("PrivateIn", "key value", function AST_PrivateIn(props) { - if (props) { - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An `in` binop when the key is private, eg #x in this", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.key._walk(visitor); - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.value); - push(this.key); - }, -}); - -var AST_DefClass = DEFNODE("DefClass", null, function AST_DefClass(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class definition", -}, AST_Class); - -var AST_ClassStaticBlock = DEFNODE("ClassStaticBlock", "body block_scope", function AST_ClassStaticBlock (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; -}, { - $documentation: "A block containing statements to be executed in the context of the class", - $propdoc: { - body: "[AST_Statement*] an array of statements", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - }, - clone: clone_block_scope, - computed_key() { - return false; - }, -}, AST_Scope); - -var AST_ClassExpression = DEFNODE("ClassExpression", null, function AST_ClassExpression(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class expression." -}, AST_Class); - -var AST_Symbol = DEFNODE("Symbol", "scope name thedef", function AST_Symbol(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - name: "[string] name of this symbol", - scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", - thedef: "[SymbolDef/S] the definition of this symbol" - }, - $documentation: "Base class for all symbols" -}); - -var AST_NewTarget = DEFNODE("NewTarget", null, function AST_NewTarget(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A reference to new.target" -}); - -var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", function AST_SymbolDeclaration(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)", -}, AST_Symbol); - -var AST_SymbolVar = DEFNODE("SymbolVar", null, function AST_SymbolVar(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol defining a variable", -}, AST_SymbolDeclaration); - -var AST_SymbolBlockDeclaration = DEFNODE( - "SymbolBlockDeclaration", - null, - function AST_SymbolBlockDeclaration(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for block-scoped declaration symbols" - }, - AST_SymbolDeclaration -); - -var AST_SymbolConst = DEFNODE("SymbolConst", null, function AST_SymbolConst(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A constant declaration" -}, AST_SymbolBlockDeclaration); - -var AST_SymbolLet = DEFNODE("SymbolLet", null, function AST_SymbolLet(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A block-scoped `let` declaration" -}, AST_SymbolBlockDeclaration); - -var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, function AST_SymbolFunarg(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a function argument", -}, AST_SymbolVar); - -var AST_SymbolDefun = DEFNODE("SymbolDefun", null, function AST_SymbolDefun(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol defining a function", -}, AST_SymbolDeclaration); - -var AST_SymbolMethod = DEFNODE("SymbolMethod", null, function AST_SymbolMethod(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol in an object defining a method", -}, AST_Symbol); - -var AST_SymbolClassProperty = DEFNODE("SymbolClassProperty", null, function AST_SymbolClassProperty(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol for a class property", -}, AST_Symbol); - -var AST_SymbolLambda = DEFNODE("SymbolLambda", null, function AST_SymbolLambda(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a function expression", -}, AST_SymbolDeclaration); - -var AST_SymbolDefClass = DEFNODE("SymbolDefClass", null, function AST_SymbolDefClass(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class." -}, AST_SymbolBlockDeclaration); - -var AST_SymbolClass = DEFNODE("SymbolClass", null, function AST_SymbolClass(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a class's name. Lexically scoped to the class." -}, AST_SymbolDeclaration); - -var AST_SymbolCatch = DEFNODE("SymbolCatch", null, function AST_SymbolCatch(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming the exception in catch", -}, AST_SymbolBlockDeclaration); - -var AST_SymbolImport = DEFNODE("SymbolImport", null, function AST_SymbolImport(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol referring to an imported name", -}, AST_SymbolBlockDeclaration); - -var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign", "quote", function AST_SymbolImportForeign(props) { - if (props) { - this.quote = props.quote; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes", -}, AST_Symbol); - -var AST_Label = DEFNODE("Label", "references", function AST_Label(props) { - if (props) { - this.references = props.references; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a label (declaration)", - $propdoc: { - references: "[AST_LoopControl*] a list of nodes referring to this label" - }, - initialize: function() { - this.references = []; - this.thedef = this; - } -}, AST_Symbol); - -var AST_SymbolRef = DEFNODE("SymbolRef", null, function AST_SymbolRef(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Reference to some symbol (not definition/declaration)", -}, AST_Symbol); - -var AST_SymbolExport = DEFNODE("SymbolExport", "quote", function AST_SymbolExport(props) { - if (props) { - this.quote = props.quote; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol referring to a name to export", -}, AST_SymbolRef); - -var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign", "quote", function AST_SymbolExportForeign(props) { - if (props) { - this.quote = props.quote; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes", -}, AST_Symbol); - -var AST_LabelRef = DEFNODE("LabelRef", null, function AST_LabelRef(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Reference to a label symbol", -}, AST_Symbol); - -var AST_SymbolPrivateProperty = DEFNODE("SymbolPrivateProperty", null, function AST_SymbolPrivateProperty(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol that refers to a private property", -}, AST_Symbol); - -var AST_This = DEFNODE("This", null, function AST_This(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `this` symbol", -}, AST_Symbol); - -var AST_Super = DEFNODE("Super", null, function AST_Super(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `super` symbol", -}, AST_This); - -var AST_Constant = DEFNODE("Constant", null, function AST_Constant(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for all constants", - getValue: function() { - return this.value; - } -}); - -var AST_String = DEFNODE("String", "value quote", function AST_String(props) { - if (props) { - this.value = props.value; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A string literal", - $propdoc: { - value: "[string] the contents of this string", - quote: "[string] the original quote character" - } -}, AST_Constant); - -var AST_Number = DEFNODE("Number", "value raw", function AST_Number(props) { - if (props) { - this.value = props.value; - this.raw = props.raw; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A number literal", - $propdoc: { - value: "[number] the numeric value", - raw: "[string] numeric value as string" - } -}, AST_Constant); - -var AST_BigInt = DEFNODE("BigInt", "value raw", function AST_BigInt(props) { - if (props) { - this.value = props.value; - this.raw = props.raw; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A big int literal", - $propdoc: { - value: "[string] big int value, represented as a string", - raw: "[string] the original format preserved" - } -}, AST_Constant); - -var AST_RegExp = DEFNODE("RegExp", "value", function AST_RegExp(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A regexp literal", - $propdoc: { - value: "[RegExp] the actual regexp", - } -}, AST_Constant); - -var AST_Atom = DEFNODE("Atom", null, function AST_Atom(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for atoms", -}, AST_Constant); - -var AST_Null = DEFNODE("Null", null, function AST_Null(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `null` atom", - value: null -}, AST_Atom); - -var AST_NaN = DEFNODE("NaN", null, function AST_NaN(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The impossible value", - value: 0/0 -}, AST_Atom); - -var AST_Undefined = DEFNODE("Undefined", null, function AST_Undefined(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `undefined` value", - value: (function() {}()) -}, AST_Atom); - -var AST_Hole = DEFNODE("Hole", null, function AST_Hole(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A hole in an array", - value: (function() {}()) -}, AST_Atom); - -var AST_Infinity = DEFNODE("Infinity", null, function AST_Infinity(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `Infinity` value", - value: 1/0 -}, AST_Atom); - -var AST_Boolean = DEFNODE("Boolean", null, function AST_Boolean(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for booleans", -}, AST_Atom); - -var AST_False = DEFNODE("False", null, function AST_False(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `false` atom", - value: false -}, AST_Boolean); - -var AST_True = DEFNODE("True", null, function AST_True(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `true` atom", - value: true -}, AST_Boolean); - -/* -----[ Walk function ]---- */ - -/** - * Walk nodes in depth-first search fashion. - * Callback can return `walk_abort` symbol to stop iteration. - * It can also return `true` to stop iteration just for child nodes. - * Iteration can be stopped and continued by passing the `to_visit` argument, - * which is given to the callback in the second argument. - **/ -function walk(node, cb, to_visit = [node]) { - const push = to_visit.push.bind(to_visit); - while (to_visit.length) { - const node = to_visit.pop(); - const ret = cb(node, to_visit); - - if (ret) { - if (ret === walk_abort) return true; - continue; - } - - node._children_backwards(push); - } - return false; -} - -/** - * Walks an AST node and its children. - * - * {cb} can return `walk_abort` to interrupt the walk. - * - * @param node - * @param cb {(node, info: { parent: (nth) => any }) => (boolean | undefined)} - * - * @returns {boolean} whether the walk was aborted - * - * @example - * const found_some_cond = walk_parent(my_ast_node, (node, { parent }) => { - * if (some_cond(node, parent())) return walk_abort - * }); - */ -function walk_parent(node, cb, initial_stack) { - const to_visit = [node]; - const push = to_visit.push.bind(to_visit); - const stack = initial_stack ? initial_stack.slice() : []; - const parent_pop_indices = []; - - let current; - - const info = { - parent: (n = 0) => { - if (n === -1) { - return current; - } - - // [ p1 p0 ] [ 1 0 ] - if (initial_stack && n >= stack.length) { - n -= stack.length; - return initial_stack[ - initial_stack.length - (n + 1) - ]; - } - - return stack[stack.length - (1 + n)]; - }, - }; - - while (to_visit.length) { - current = to_visit.pop(); - - while ( - parent_pop_indices.length && - to_visit.length == parent_pop_indices[parent_pop_indices.length - 1] - ) { - stack.pop(); - parent_pop_indices.pop(); - } - - const ret = cb(current, info); - - if (ret) { - if (ret === walk_abort) return true; - continue; - } - - const visit_length = to_visit.length; - - current._children_backwards(push); - - // Push only if we're going to traverse the children - if (to_visit.length > visit_length) { - stack.push(current); - parent_pop_indices.push(visit_length - 1); - } - } - - return false; -} - -const walk_abort = Symbol("abort walk"); - -/* -----[ TreeWalker ]----- */ - -class TreeWalker { - constructor(callback) { - this.visit = callback; - this.stack = []; - this.directives = Object.create(null); - } - - _visit(node, descend) { - this.push(node); - var ret = this.visit(node, descend ? function() { - descend.call(node); - } : _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop); - if (!ret && descend) { - descend.call(node); - } - this.pop(); - return ret; - } - - parent(n) { - return this.stack[this.stack.length - 2 - (n || 0)]; - } - - push(node) { - if (node instanceof AST_Lambda) { - this.directives = Object.create(this.directives); - } else if (node instanceof AST_Directive && !this.directives[node.value]) { - this.directives[node.value] = node; - } else if (node instanceof AST_Class) { - this.directives = Object.create(this.directives); - if (!this.directives["use strict"]) { - this.directives["use strict"] = node; - } - } - this.stack.push(node); - } - - pop() { - var node = this.stack.pop(); - if (node instanceof AST_Lambda || node instanceof AST_Class) { - this.directives = Object.getPrototypeOf(this.directives); - } - } - - self() { - return this.stack[this.stack.length - 1]; - } - - find_parent(type) { - var stack = this.stack; - for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof type) return x; - } - } - - is_within_loop() { - let i = this.stack.length - 1; - let child = this.stack[i]; - while (i--) { - const node = this.stack[i]; - - if (node instanceof AST_Lambda) return false; - if ( - node instanceof AST_IterationStatement - // exclude for-loop bits that only run once - && !((node instanceof AST_For) && child === node.init) - && !((node instanceof AST_ForIn || node instanceof AST_ForOf) && child === node.object) - ) { - return true; - } - - child = node; - } - - return false; - } - - find_scope() { - var stack = this.stack; - for (var i = stack.length; --i >= 0;) { - const p = stack[i]; - if (p instanceof AST_Toplevel) return p; - if (p instanceof AST_Lambda) return p; - if (p.block_scope) return p.block_scope; - } - } - - has_directive(type) { - var dir = this.directives[type]; - if (dir) return dir; - var node = this.stack[this.stack.length - 1]; - if (node instanceof AST_Scope && node.body) { - for (var i = 0; i < node.body.length; ++i) { - var st = node.body[i]; - if (!(st instanceof AST_Directive)) break; - if (st.value == type) return st; - } - } - } - - loopcontrol_target(node) { - var stack = this.stack; - if (node.label) for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_LabeledStatement && x.label.name == node.label.name) - return x.body; - } else for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_IterationStatement - || node instanceof AST_Break && x instanceof AST_Switch) - return x; - } - } -} - -// Tree transformer helpers. -class TreeTransformer extends TreeWalker { - constructor(before, after) { - super(); - this.before = before; - this.after = after; - } -} - -const _PURE = 0b00000001; -const _INLINE = 0b00000010; -const _NOINLINE = 0b00000100; -const _KEY = 0b00001000; -const _MANGLEPROP = 0b00010000; - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/cli.js": -/*!****************************************!*\ - !*** ./node_modules/terser/lib/cli.js ***! - \****************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ run_cli: () => (/* binding */ run_cli) -/* harmony export */ }); -/* harmony import */ var _main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../main.js */ "./node_modules/terser/main.js"); -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse.js */ "./node_modules/terser/lib/parse.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _output_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./output.js */ "./node_modules/terser/lib/output.js"); -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); - - - - - -async function run_cli({ program, packageJson, fs, path }) { - const skip_keys = new Set([ "cname", "parent_scope", "scope", "uses_eval", "uses_with" ]); - var files = {}; - var options = { - compress: false, - mangle: false - }; - const default_options = await (0,_main_js__WEBPACK_IMPORTED_MODULE_0__._default_options)(); - program.version(packageJson.name + " " + packageJson.version); - program.parseArgv = program.parse; - program.parse = undefined; - - if (process.argv.includes("ast")) program.helpInformation = describe_ast; - else if (process.argv.includes("options")) program.helpInformation = function() { - var text = []; - for (var option in default_options) { - text.push("--" + (option === "sourceMap" ? "source-map" : option) + " options:"); - text.push(format_object(default_options[option])); - text.push(""); - } - return text.join("\n"); - }; - - program.option("-p, --parse ", "Specify parser options.", parse_js()); - program.option("-c, --compress [options]", "Enable compressor/specify compressor options.", parse_js()); - program.option("-m, --mangle [options]", "Mangle names/specify mangler options.", parse_js()); - program.option("--mangle-props [options]", "Mangle properties/specify mangler options.", parse_js()); - program.option("-f, --format [options]", "Format options.", parse_js()); - program.option("-b, --beautify [options]", "Alias for --format.", parse_js()); - program.option("-o, --output ", "Output file (default STDOUT)."); - program.option("--comments [filter]", "Preserve copyright comments in the output."); - program.option("--config-file ", "Read minify() options from JSON file."); - program.option("-d, --define [=value]", "Global definitions.", parse_js("define")); - program.option("--ecma ", "Specify ECMAScript release: 5, 2015, 2016 or 2017..."); - program.option("-e, --enclose [arg[,...][:value[,...]]]", "Embed output in a big function with configurable arguments and values."); - program.option("--ie8", "Support non-standard Internet Explorer 8."); - program.option("--keep-classnames", "Do not mangle/drop class names."); - program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name."); - program.option("--module", "Input is an ES6 module"); - program.option("--name-cache ", "File to hold mangled name mappings."); - program.option("--rename", "Force symbol expansion."); - program.option("--no-rename", "Disable symbol expansion."); - program.option("--safari10", "Support non-standard Safari 10."); - program.option("--source-map [options]", "Enable source map/specify source map options.", parse_js()); - program.option("--timings", "Display operations run time on STDERR."); - program.option("--toplevel", "Compress and/or mangle variables in toplevel scope."); - program.option("--wrap ", "Embed everything as a function with “exports” corresponding to “name” globally."); - program.arguments("[files...]").parseArgv(process.argv); - if (program.configFile) { - options = JSON.parse(read_file(program.configFile)); - } - if (!program.output && program.sourceMap && program.sourceMap.url != "inline") { - fatal("ERROR: cannot write source map to STDOUT"); - } - - [ - "compress", - "enclose", - "ie8", - "mangle", - "module", - "safari10", - "sourceMap", - "toplevel", - "wrap" - ].forEach(function(name) { - if (name in program) { - options[name] = program[name]; - } - }); - - if ("ecma" in program) { - if (program.ecma != (program.ecma | 0)) fatal("ERROR: ecma must be an integer"); - const ecma = program.ecma | 0; - if (ecma > 5 && ecma < 2015) - options.ecma = ecma + 2009; - else - options.ecma = ecma; - } - if (program.format || program.beautify) { - const chosenOption = program.format || program.beautify; - options.format = typeof chosenOption === "object" ? chosenOption : {}; - } - if (program.comments) { - if (typeof options.format != "object") options.format = {}; - options.format.comments = typeof program.comments == "string" ? (program.comments == "false" ? false : program.comments) : "some"; - } - if (program.define) { - if (typeof options.compress != "object") options.compress = {}; - if (typeof options.compress.global_defs != "object") options.compress.global_defs = {}; - for (var expr in program.define) { - options.compress.global_defs[expr] = program.define[expr]; - } - } - if (program.keepClassnames) { - options.keep_classnames = true; - } - if (program.keepFnames) { - options.keep_fnames = true; - } - if (program.mangleProps) { - if (program.mangleProps.domprops) { - delete program.mangleProps.domprops; - } else { - if (typeof program.mangleProps != "object") program.mangleProps = {}; - if (!Array.isArray(program.mangleProps.reserved)) program.mangleProps.reserved = []; - } - if (typeof options.mangle != "object") options.mangle = {}; - options.mangle.properties = program.mangleProps; - } - if (program.nameCache) { - options.nameCache = JSON.parse(read_file(program.nameCache, "{}")); - } - if (program.output == "ast") { - options.format = { - ast: true, - code: false - }; - } - if (program.parse) { - if (!program.parse.acorn && !program.parse.spidermonkey) { - options.parse = program.parse; - } else if (program.sourceMap && program.sourceMap.content == "inline") { - fatal("ERROR: inline source map only works with built-in parser"); - } - } - if (~program.rawArgs.indexOf("--rename")) { - options.rename = true; - } else if (!program.rename) { - options.rename = false; - } - - let convert_path = name => name; - if (typeof program.sourceMap == "object" && "base" in program.sourceMap) { - convert_path = function() { - var base = program.sourceMap.base; - delete options.sourceMap.base; - return function(name) { - return path.relative(base, name); - }; - }(); - } - - let filesList; - if (options.files && options.files.length) { - filesList = options.files; - - delete options.files; - } else if (program.args.length) { - filesList = program.args; - } - - if (filesList) { - simple_glob(filesList).forEach(function(name) { - files[convert_path(name)] = read_file(name); - }); - } else { - await new Promise((resolve) => { - var chunks = []; - process.stdin.setEncoding("utf8"); - process.stdin.on("data", function(chunk) { - chunks.push(chunk); - }).on("end", function() { - files = [ chunks.join("") ]; - resolve(); - }); - process.stdin.resume(); - }); - } - - await run_cli(); - - function convert_ast(fn) { - return _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null)); - } - - async function run_cli() { - var content = program.sourceMap && program.sourceMap.content; - if (content && content !== "inline") { - options.sourceMap.content = read_file(content, content); - } - if (program.timings) options.timings = true; - - try { - if (program.parse) { - if (program.parse.acorn) { - files = convert_ast(function(toplevel, name) { - return require("acorn").parse(files[name], { - ecmaVersion: 2024, - locations: true, - program: toplevel, - sourceFile: name, - sourceType: options.module || program.parse.module ? "module" : "script" - }); - }); - } else if (program.parse.spidermonkey) { - files = convert_ast(function(toplevel, name) { - var obj = JSON.parse(files[name]); - if (!toplevel) return obj; - toplevel.body = toplevel.body.concat(obj.body); - return toplevel; - }); - } - } - } catch (ex) { - fatal(ex); - } - - let result; - try { - result = await (0,_main_js__WEBPACK_IMPORTED_MODULE_0__.minify)(files, options, fs); - } catch (ex) { - if (ex.name == "SyntaxError") { - print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col); - var col = ex.col; - var lines = files[ex.filename].split(/\r?\n/); - var line = lines[ex.line - 1]; - if (!line && !col) { - line = lines[ex.line - 2]; - col = line.length; - } - if (line) { - var limit = 70; - if (col > limit) { - line = line.slice(col - limit); - col = limit; - } - print_error(line.slice(0, 80)); - print_error(line.slice(0, col).replace(/\S/g, " ") + "^"); - } - } - if (ex.defs) { - print_error("Supported options:"); - print_error(format_object(ex.defs)); - } - fatal(ex); - return; - } - - if (program.output == "ast") { - if (!options.compress && !options.mangle) { - result.ast.figure_out_scope({}); - } - console.log(JSON.stringify(result.ast, function(key, value) { - if (value) switch (key) { - case "thedef": - return symdef(value); - case "enclosed": - return value.length ? value.map(symdef) : undefined; - case "variables": - case "globals": - return value.size ? collect_from_map(value, symdef) : undefined; - } - if (skip_keys.has(key)) return; - if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Token) return; - if (value instanceof Map) return; - if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node) { - var result = { - _class: "AST_" + value.TYPE - }; - if (value.block_scope) { - result.variables = value.block_scope.variables; - result.enclosed = value.block_scope.enclosed; - } - value.CTOR.PROPS.forEach(function(prop) { - if (prop !== "block_scope") { - result[prop] = value[prop]; - } - }); - return result; - } - return value; - }, 2)); - } else if (program.output == "spidermonkey") { - try { - const minified = await (0,_main_js__WEBPACK_IMPORTED_MODULE_0__.minify)( - result.code, - { - compress: false, - mangle: false, - format: { - ast: true, - code: false - } - }, - fs - ); - console.log(JSON.stringify(minified.ast.to_mozilla_ast(), null, 2)); - } catch (ex) { - fatal(ex); - return; - } - } else if (program.output) { - fs.mkdirSync(path.dirname(program.output), { recursive: true }); - fs.writeFileSync(program.output, result.code); - if (options.sourceMap && options.sourceMap.url !== "inline" && result.map) { - fs.writeFileSync(program.output + ".map", result.map); - } - } else { - console.log(result.code); - } - if (program.nameCache) { - fs.writeFileSync(program.nameCache, JSON.stringify(options.nameCache)); - } - if (result.timings) for (var phase in result.timings) { - print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s"); - } - } - - function fatal(message) { - if (message instanceof Error) message = message.stack.replace(/^\S*?Error:/, "ERROR:"); - print_error(message); - process.exit(1); - } - - // A file glob function that only supports "*" and "?" wildcards in the basename. - // Example: "foo/bar/*baz??.*.js" - // Argument `glob` may be a string or an array of strings. - // Returns an array of strings. Garbage in, garbage out. - function simple_glob(glob) { - if (Array.isArray(glob)) { - return [].concat.apply([], glob.map(simple_glob)); - } - if (glob && glob.match(/[*?]/)) { - var dir = path.dirname(glob); - try { - var entries = fs.readdirSync(dir); - } catch (ex) {} - if (entries) { - var pattern = "^" + path.basename(glob) - .replace(/[.+^$[\]\\(){}]/g, "\\$&") - .replace(/\*/g, "[^/\\\\]*") - .replace(/\?/g, "[^/\\\\]") + "$"; - var mod = process.platform === "win32" ? "i" : ""; - var rx = new RegExp(pattern, mod); - var results = entries.filter(function(name) { - return rx.test(name); - }).map(function(name) { - return path.join(dir, name); - }); - if (results.length) return results; - } - } - return [ glob ]; - } - - function read_file(path, default_value) { - try { - return fs.readFileSync(path, "utf8"); - } catch (ex) { - if ((ex.code == "ENOENT" || ex.code == "ENAMETOOLONG") && default_value != null) return default_value; - fatal(ex); - } - } - - function parse_js(flag) { - return function(value, options) { - options = options || {}; - try { - (0,_ast_js__WEBPACK_IMPORTED_MODULE_2__.walk)((0,_parse_js__WEBPACK_IMPORTED_MODULE_1__.parse)(value, { expression: true }), node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Assign) { - var name = node.left.print_to_string(); - var value = node.right; - if (flag) { - options[name] = value; - } else if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Array) { - options[name] = value.elements.map(to_string); - } else if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_RegExp) { - value = value.value; - options[name] = new RegExp(value.source, value.flags); - } else { - options[name] = to_string(value); - } - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess) { - var name = node.print_to_string(); - options[name] = true; - return true; - } - if (!(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence)) throw node; - - function to_string(value) { - return value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Constant ? value.getValue() : value.print_to_string({ - quote_keys: true - }); - } - }); - } catch(ex) { - if (flag) { - fatal("Error parsing arguments for '" + flag + "': " + value); - } else { - options[value] = null; - } - } - return options; - }; - } - - function symdef(def) { - var ret = (1e6 + def.id) + " " + def.name; - if (def.mangled_name) ret += " " + def.mangled_name; - return ret; - } - - function collect_from_map(map, callback) { - var result = []; - map.forEach(function (def) { - result.push(callback(def)); - }); - return result; - } - - function format_object(obj) { - var lines = []; - var padding = ""; - Object.keys(obj).map(function(name) { - if (padding.length < name.length) padding = Array(name.length + 1).join(" "); - return [ name, JSON.stringify(obj[name]) ]; - }).forEach(function(tokens) { - lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]); - }); - return lines.join("\n"); - } - - function print_error(msg) { - process.stderr.write(msg); - process.stderr.write("\n"); - } - - function describe_ast() { - var out = (0,_output_js__WEBPACK_IMPORTED_MODULE_3__.OutputStream)({ beautify: true }); - function doitem(ctor) { - out.print("AST_" + ctor.TYPE); - const props = ctor.SELF_PROPS.filter(prop => !/^\$/.test(prop)); - - if (props.length > 0) { - out.space(); - out.with_parens(function() { - props.forEach(function(prop, i) { - if (i) out.space(); - out.print(prop); - }); - }); - } - - if (ctor.documentation) { - out.space(); - out.print_string(ctor.documentation); - } - - if (ctor.SUBCLASSES.length > 0) { - out.space(); - out.with_block(function() { - ctor.SUBCLASSES.forEach(function(ctor) { - out.indent(); - doitem(ctor); - out.newline(); - }); - }); - } - } - doitem(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node); - return out + "\n"; - } -} - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/common.js": -/*!****************************************************!*\ - !*** ./node_modules/terser/lib/compress/common.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ as_statement_array: () => (/* binding */ as_statement_array), -/* harmony export */ best_of: () => (/* binding */ best_of), -/* harmony export */ best_of_expression: () => (/* binding */ best_of_expression), -/* harmony export */ best_of_statement: () => (/* binding */ best_of_statement), -/* harmony export */ can_be_evicted_from_block: () => (/* binding */ can_be_evicted_from_block), -/* harmony export */ get_simple_key: () => (/* binding */ get_simple_key), -/* harmony export */ has_break_or_continue: () => (/* binding */ has_break_or_continue), -/* harmony export */ identifier_atom: () => (/* binding */ identifier_atom), -/* harmony export */ is_empty: () => (/* binding */ is_empty), -/* harmony export */ is_func_expr: () => (/* binding */ is_func_expr), -/* harmony export */ is_identifier_atom: () => (/* binding */ is_identifier_atom), -/* harmony export */ is_iife_call: () => (/* binding */ is_iife_call), -/* harmony export */ is_reachable: () => (/* binding */ is_reachable), -/* harmony export */ is_recursive_ref: () => (/* binding */ is_recursive_ref), -/* harmony export */ is_ref_of: () => (/* binding */ is_ref_of), -/* harmony export */ maintain_this_binding: () => (/* binding */ maintain_this_binding), -/* harmony export */ make_empty_function: () => (/* binding */ make_empty_function), -/* harmony export */ make_node_from_constant: () => (/* binding */ make_node_from_constant), -/* harmony export */ make_sequence: () => (/* binding */ make_sequence), -/* harmony export */ merge_sequence: () => (/* binding */ merge_sequence), -/* harmony export */ read_property: () => (/* binding */ read_property), -/* harmony export */ requires_sequence_to_maintain_binding: () => (/* binding */ requires_sequence_to_maintain_binding), -/* harmony export */ retain_top_func: () => (/* binding */ retain_top_func) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/first_in_statement.js */ "./node_modules/terser/lib/utils/first_in_statement.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - -function merge_sequence(array, node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - array.push(...node.expressions); - } else { - array.push(node); - } - return array; -} - -function make_sequence(orig, expressions) { - if (expressions.length == 1) return expressions[0]; - if (expressions.length == 0) throw new Error("trying to create a sequence with length zero!"); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, orig, { - expressions: expressions.reduce(merge_sequence, []) - }); -} - -function make_empty_function(self) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function, self, { - uses_arguments: false, - argnames: [], - body: [], - is_generator: false, - async: false, - variables: new Map(), - uses_with: false, - uses_eval: false, - parent_scope: null, - enclosed: [], - cname: 0, - block_scope: undefined, - }); -} - -function make_node_from_constant(val, orig) { - switch (typeof val) { - case "string": - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, orig, { - value: val - }); - case "number": - if (isNaN(val)) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NaN, orig); - if (isFinite(val)) { - return 1 / val < 0 ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, orig, { - operator: "-", - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, orig, { value: -val }) - }) : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, orig, { value: val }); - } - return val < 0 ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, orig, { - operator: "-", - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity, orig) - }) : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity, orig); - case "bigint": - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BigInt, orig, { value: val.toString() }); - case "boolean": - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(val ? _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True : _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_False, orig); - case "undefined": - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, orig); - default: - if (val === null) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null, orig, { value: null }); - } - if (val instanceof RegExp) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp, orig, { - value: { - source: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.regexp_source_fix)(val.source), - flags: val.flags - } - }); - } - throw new Error((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.string_template)("Can't handle constant of type: {type}", { - type: typeof val - })); - } -} - -function best_of_expression(ast1, ast2) { - return ast1.size() > ast2.size() ? ast2 : ast1; -} - -function best_of_statement(ast1, ast2) { - return best_of_expression( - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, ast1, { - body: ast1 - }), - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, ast2, { - body: ast2 - }) - ).body; -} - -/** Find which node is smaller, and return that */ -function best_of(compressor, ast1, ast2) { - if ((0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__.first_in_statement)(compressor)) { - return best_of_statement(ast1, ast2); - } else { - return best_of_expression(ast1, ast2); - } -} - -/** Simplify an object property's key, if possible */ -function get_simple_key(key) { - if (key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant) { - return key.getValue(); - } - if (key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && key.operator == "void" - && key.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant) { - return; - } - return key; -} - -function read_property(obj, key) { - key = get_simple_key(key); - if (key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) return; - - var value; - if (obj instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array) { - var elements = obj.elements; - if (key == "length") return make_node_from_constant(elements.length, obj); - if (typeof key == "number" && key in elements) value = elements[key]; - } else if (obj instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object) { - key = "" + key; - var props = obj.properties; - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - if (!(prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal)) return; - if (!value && props[i].key === key) value = props[i].value; - } - } - - return value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef && value.fixed_value() || value; -} - -function has_break_or_continue(loop, parent) { - var found = false; - var tw = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker(function(node) { - if (found || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LoopControl && tw.loopcontrol_target(node) === loop) { - return found = true; - } - }); - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement) tw.push(parent); - tw.push(loop); - loop.body.walk(tw); - return found; -} - -// we shouldn't compress (1,func)(something) to -// func(something) because that changes the meaning of -// the func (becomes lexical instead of global). -function maintain_this_binding(parent, orig, val) { - if (requires_sequence_to_maintain_binding(parent, orig, val)) { - const zero = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, orig, { value: 0 }); - return make_sequence(orig, [ zero, val ]); - } else { - return val; - } -} - -/** Detect (1, x.noThis)(), (0, eval)(), which need sequences */ -function requires_sequence_to_maintain_binding(parent, orig, val) { - return ( - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix && parent.operator == "delete" - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call && parent.expression === orig - && ( - val instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain - || val instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - || val instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef && val.name == "eval" - ) - ); -} - -function is_func_expr(node) { - return node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function; -} - -/** - * Used to determine whether the node can benefit from negation. - * Not the case with arrow functions (you need an extra set of parens). */ -function is_iife_call(node) { - if (node.TYPE != "Call") return false; - return node.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function || is_iife_call(node.expression); -} - -function is_empty(thing) { - if (thing === null) return true; - if (thing instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement) return true; - if (thing instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement) return thing.body.length == 0; - return false; -} - -const identifier_atom = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("Infinity NaN undefined"); -function is_identifier_atom(node) { - return node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NaN - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined; -} - -/** Check if this is a SymbolRef node which has one def of a certain AST type */ -function is_ref_of(ref, type) { - if (!(ref instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef)) return false; - var orig = ref.definition().orig; - for (var i = orig.length; --i >= 0;) { - if (orig[i] instanceof type) return true; - } -} - -/**Can we turn { block contents... } into just the block contents ? - * Not if one of these is inside. - **/ -function can_be_evicted_from_block(node) { - return !( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefClass || - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun || - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Let || - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Const || - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export || - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Import - ); -} - -function as_statement_array(thing) { - if (thing === null) return []; - if (thing instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement) return thing.body; - if (thing instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement) return []; - if (thing instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Statement) return [ thing ]; - throw new Error("Can't convert thing to statement array"); -} - -function is_reachable(scope_node, defs) { - const find_ref = node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef && defs.includes(node.definition())) { - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - } - }; - - return (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_parent)(scope_node, (node, info) => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope && node !== scope_node) { - var parent = info.parent(); - - if ( - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && parent.expression === node - // Async/Generators aren't guaranteed to sync evaluate all of - // their body steps, so it's possible they close over the variable. - && !(node.async || node.is_generator) - ) { - return; - } - - if ((0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(node, find_ref)) return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - - return true; - } - }); -} - -/** Check if a ref refers to the name of a function/class it's defined within */ -function is_recursive_ref(tw, def) { - var node; - for (var i = 0; node = tw.parent(i); i++) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) { - var name = node.name; - if (name && name.definition() === def) { - return true; - } - } - } - return false; -} - -// TODO this only works with AST_Defun, shouldn't it work for other ways of defining functions? -function retain_top_func(fn, compressor) { - return compressor.top_retain - && fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun - && (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.has_flag)(fn, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.TOP) - && fn.name - && compressor.top_retain(fn.name.definition()); -} - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/compressor-flags.js": -/*!**************************************************************!*\ - !*** ./node_modules/terser/lib/compress/compressor-flags.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ CLEAR_BETWEEN_PASSES: () => (/* binding */ CLEAR_BETWEEN_PASSES), -/* harmony export */ FALSY: () => (/* binding */ FALSY), -/* harmony export */ INLINED: () => (/* binding */ INLINED), -/* harmony export */ OPTIMIZED: () => (/* binding */ OPTIMIZED), -/* harmony export */ SQUEEZED: () => (/* binding */ SQUEEZED), -/* harmony export */ TOP: () => (/* binding */ TOP), -/* harmony export */ TRUTHY: () => (/* binding */ TRUTHY), -/* harmony export */ UNDEFINED: () => (/* binding */ UNDEFINED), -/* harmony export */ UNUSED: () => (/* binding */ UNUSED), -/* harmony export */ WRITE_ONLY: () => (/* binding */ WRITE_ONLY), -/* harmony export */ clear_flag: () => (/* binding */ clear_flag), -/* harmony export */ has_flag: () => (/* binding */ has_flag), -/* harmony export */ set_flag: () => (/* binding */ set_flag) -/* harmony export */ }); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// bitfield flags to be stored in node.flags. -// These are set and unset during compression, and store information in the node without requiring multiple fields. -const UNUSED = 0b00000001; -const TRUTHY = 0b00000010; -const FALSY = 0b00000100; -const UNDEFINED = 0b00001000; -const INLINED = 0b00010000; -// Nodes to which values are ever written. Used when keep_assign is part of the unused option string. -const WRITE_ONLY = 0b00100000; - -// information specific to a single compression pass -const SQUEEZED = 0b0000000100000000; -const OPTIMIZED = 0b0000001000000000; -const TOP = 0b0000010000000000; -const CLEAR_BETWEEN_PASSES = SQUEEZED | OPTIMIZED | TOP; - -const has_flag = (node, flag) => node.flags & flag; -const set_flag = (node, flag) => { node.flags |= flag; }; -const clear_flag = (node, flag) => { node.flags &= ~flag; }; - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/drop-side-effect-free.js": -/*!*******************************************************************!*\ - !*** ./node_modules/terser/lib/compress/drop-side-effect-free.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/first_in_statement.js */ "./node_modules/terser/lib/utils/first_in_statement.js"); -/* harmony import */ var _native_objects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./native-objects.js */ "./node_modules/terser/lib/compress/native-objects.js"); -/* harmony import */ var _inference_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inference.js */ "./node_modules/terser/lib/compress/inference.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - - - -// AST_Node#drop_side_effect_free() gets called when we don't care about the value, -// only about side effects. We'll be defining this method for each node type in this module -// -// Examples: -// foo++ -> foo++ -// 1 + func() -> func() -// 10 -> (nothing) -// knownPureFunc(foo++) -> foo++ - -function def_drop_side_effect_free(node_or_nodes, func) { - for (const node of [].concat(node_or_nodes)) { - node.DEFMETHOD("drop_side_effect_free", func); - } -} - -// Drop side-effect-free elements from an array of expressions. -// Returns an array of expressions with side-effects or null -// if all elements were dropped. Note: original array may be -// returned if nothing changed. -function trim(nodes, compressor, first_in_statement) { - var len = nodes.length; - if (!len) return null; - - var ret = [], changed = false; - for (var i = 0; i < len; i++) { - var node = nodes[i].drop_side_effect_free(compressor, first_in_statement); - changed |= node !== nodes[i]; - if (node) { - ret.push(node); - first_in_statement = false; - } - } - return changed ? ret.length ? ret : null : nodes; -} - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_this); -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, function (compressor, first_in_statement) { - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_4__.is_nullish_shortcircuited)(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - - if (!this.is_callee_pure(compressor)) { - if (this.expression.is_call_pure(compressor)) { - var exprs = this.args.slice(); - exprs.unshift(this.expression.expression); - exprs = trim(exprs, compressor, first_in_statement); - return exprs && (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, exprs); - } - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_6__.is_func_expr)(this.expression) - && (!this.expression.name || !this.expression.name.definition().references.length)) { - var node = this.clone(); - node.expression.process_expression(false, compressor); - return node; - } - return this; - } - - var args = trim(this.args, compressor, first_in_statement); - return args && (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, args); -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Accessor, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function (compressor) { - const with_effects = []; - - if (this.is_self_referential() && this.has_side_effects(compressor)) { - return this; - } - - const trimmed_extends = this.extends && this.extends.drop_side_effect_free(compressor); - if (trimmed_extends) with_effects.push(trimmed_extends); - - for (const prop of this.properties) { - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock) { - if (prop.has_side_effects(compressor)) { - return this; // Be cautious about these - } - } else { - const trimmed_prop = prop.drop_side_effect_free(compressor); - if (trimmed_prop) with_effects.push(trimmed_prop); - } - } - - if (!with_effects.length) - return null; - - const exprs = (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, with_effects); - if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefClass) { - // We want a statement - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, this, { body: exprs }); - } else { - return exprs; - } -}); - -def_drop_side_effect_free([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassProperty, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassPrivateProperty, -], function (compressor) { - const key = this.computed_key() && this.key.drop_side_effect_free(compressor); - - const value = this.static && this.value - && this.value.drop_side_effect_free(compressor); - - if (key && value) - return (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, [key, value]); - return key || value || null; -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function (compressor, first_in_statement) { - var right = this.right.drop_side_effect_free(compressor); - if (!right) - return this.left.drop_side_effect_free(compressor, first_in_statement); - if (_inference_js__WEBPACK_IMPORTED_MODULE_4__.lazy_op.has(this.operator)) { - if (right === this.right) - return this; - var node = this.clone(); - node.right = right; - return node; - } else { - var left = this.left.drop_side_effect_free(compressor, first_in_statement); - if (!left) - return this.right.drop_side_effect_free(compressor, first_in_statement); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, [left, right]); - } -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function (compressor) { - if (this.logical) - return this; - - var left = this.left; - if (left.has_side_effects(compressor) - || compressor.has_directive("use strict") - && left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - && left.expression.is_constant()) { - return this; - } - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_5__.set_flag)(this, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_5__.WRITE_ONLY); - while (left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess) { - left = left.expression; - } - if (left.is_constant_expression(compressor.find_parent(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope))) { - return this.right.drop_side_effect_free(compressor); - } - return this; -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function (compressor) { - var consequent = this.consequent.drop_side_effect_free(compressor); - var alternative = this.alternative.drop_side_effect_free(compressor); - if (consequent === this.consequent && alternative === this.alternative) - return this; - if (!consequent) - return alternative ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, this, { - operator: "||", - left: this.condition, - right: alternative - }) : this.condition.drop_side_effect_free(compressor); - if (!alternative) - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, this, { - operator: "&&", - left: this.condition, - right: consequent - }); - var node = this.clone(); - node.consequent = consequent; - node.alternative = alternative; - return node; -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function (compressor, first_in_statement) { - if (_inference_js__WEBPACK_IMPORTED_MODULE_4__.unary_side_effects.has(this.operator)) { - if (!this.expression.has_side_effects(compressor)) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_5__.set_flag)(this, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_5__.WRITE_ONLY); - } else { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_5__.clear_flag)(this, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_5__.WRITE_ONLY); - } - return this; - } - if (this.operator == "typeof" && this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) - return null; - var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); - if (first_in_statement && expression && (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.is_iife_call)(expression)) { - if (expression === this.expression && this.operator == "!") - return this; - return expression.negate(compressor, first_in_statement); - } - return expression; -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, function (compressor) { - const safe_access = this.is_declared(compressor) - || _native_objects_js__WEBPACK_IMPORTED_MODULE_3__.pure_prop_access_globals.has(this.name); - return safe_access ? null : this; -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, function (compressor, first_in_statement) { - var values = trim(this.properties, compressor, first_in_statement); - return values && (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, values); -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal, function (compressor, first_in_statement) { - const computed_key = this.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node; - const key = computed_key && this.key.drop_side_effect_free(compressor, first_in_statement); - const value = this.value.drop_side_effect_free(compressor, first_in_statement); - if (key && value) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, [key, value]); - } - return key || value; -}); - -def_drop_side_effect_free([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectSetter, -], function () { - return this.computed_key() ? this.key : null; -}); - -def_drop_side_effect_free([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateSetter, -], function () { - return null; -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, function (compressor, first_in_statement) { - var values = trim(this.elements, compressor, first_in_statement); - return values && (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, values); -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, function (compressor, first_in_statement) { - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_4__.is_nullish_shortcircuited)(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return this; - } - - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, function (compressor, first_in_statement) { - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_4__.is_nullish_shortcircuited)(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return this; - } - - var property = this.property.drop_side_effect_free(compressor); - if (property && this.optional) return this; - - var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); - - if (expression && property) return (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, [expression, property]); - return expression || property; -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function (compressor, first_in_statement) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function (compressor) { - var last = this.tail_node(); - var expr = last.drop_side_effect_free(compressor); - if (expr === last) - return this; - var expressions = this.expressions.slice(0, -1); - if (expr) - expressions.push(expr); - if (!expressions.length) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, this, { value: 0 }); - } - return (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, expressions); -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion, function (compressor, first_in_statement) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateSegment, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); - -def_drop_side_effect_free(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString, function (compressor) { - var values = trim(this.segments, compressor, _utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__.first_in_statement); - return values && (0,_common_js__WEBPACK_IMPORTED_MODULE_6__.make_sequence)(this, values); -}); - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/drop-unused.js": -/*!*********************************************************!*\ - !*** ./node_modules/terser/lib/compress/drop-unused.js ***! - \*********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scope.js */ "./node_modules/terser/lib/scope.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/* harmony import */ var _inference_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./inference.js */ "./node_modules/terser/lib/compress/inference.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - - -const r_keep_assign = /keep_assign/; - -/** Drop unused variables from this scope */ -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope.DEFMETHOD("drop_unused", function(compressor) { - if (!compressor.option("unused")) return; - if (compressor.has_directive("use asm")) return; - if (!this.variables) return; // not really a scope (eg: AST_Class) - - var self = this; - if (self.pinned()) return; - var drop_funcs = !(self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel) || compressor.toplevel.funcs; - var drop_vars = !(self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel) || compressor.toplevel.vars; - const assign_as_unused = r_keep_assign.test(compressor.option("unused")) ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false : function(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - && !node.logical - && ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.has_flag)(node, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.WRITE_ONLY) || node.operator == "=") - ) { - return node.left; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary && (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.has_flag)(node, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.WRITE_ONLY)) { - return node.expression; - } - }; - var in_use_ids = new Map(); - var fixed_ids = new Map(); - if (self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel && compressor.top_retain) { - self.variables.forEach(function(def) { - if (compressor.top_retain(def)) { - in_use_ids.set(def.id, def); - } - }); - } - var var_defs_by_id = new Map(); - var initializations = new Map(); - - // pass 1: find out which symbols are directly used in - // this scope (not in nested scopes). - var scope = this; - var tw = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker(function(node, descend) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda && node.uses_arguments && !tw.has_directive("use strict")) { - node.argnames.forEach(function(argname) { - if (!(argname instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration)) return; - var def = argname.definition(); - in_use_ids.set(def.id, def); - }); - } - if (node === self) return; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class && node.has_side_effects(compressor)) { - if (node.is_self_referential()) { - descend(); - } else { - node.visit_nondeferred_class_parts(tw); - } - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefClass) { - var node_def = node.name.definition(); - const in_export = tw.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export; - if (in_export || !drop_funcs && scope === self) { - if (node_def.global) { - in_use_ids.set(node_def.id, node_def); - } - } - - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.map_add)(initializations, node_def.id, node); - return true; // don't go in nested scopes - } - // In the root scope, we drop things. In inner scopes, we just check for uses. - const in_root_scope = scope === self; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg && in_root_scope) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.map_add)(var_defs_by_id, node.definition().id, node); - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions && in_root_scope) { - const in_export = tw.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export; - node.definitions.forEach(function(def) { - if (def.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolVar) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.map_add)(var_defs_by_id, def.name.definition().id, def); - } - if (in_export || !drop_vars) { - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(def.name, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration) { - const def = node.definition(); - if (def.global) { - in_use_ids.set(def.id, def); - } - } - }); - } - if (def.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring) { - def.walk(tw); - } - if (def.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration && def.value) { - var node_def = def.name.definition(); - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.map_add)(initializations, node_def.id, def.value); - if (!node_def.chained && def.name.fixed_value() === def.value) { - fixed_ids.set(node_def.id, def); - } - if (def.value.has_side_effects(compressor)) { - def.value.walk(tw); - } - } - }); - return true; - } - return scan_ref_scoped(node, descend); - }); - self.walk(tw); - // pass 2: for every used symbol we need to walk its - // initialization code to figure out if it uses other - // symbols (that may not be in_use). - tw = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker(scan_ref_scoped); - in_use_ids.forEach(function (def) { - var init = initializations.get(def.id); - if (init) init.forEach(function(init) { - init.walk(tw); - }); - }); - // pass 3: we should drop declarations not in_use - var tt = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer( - function before(node, descend, in_list) { - var parent = tt.parent(); - if (drop_vars) { - const sym = assign_as_unused(node); - if (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - var def = sym.definition(); - var in_use = in_use_ids.has(def.id); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign) { - if (!in_use || fixed_ids.has(def.id) && fixed_ids.get(def.id) !== node) { - const assignee = node.right.transform(tt); - if (!in_use && !assignee.has_side_effects(compressor) && !(0,_inference_js__WEBPACK_IMPORTED_MODULE_5__.is_used_in_expression)(tt)) { - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.skip : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, node, { value: 0 }); - } - return (0,_common_js__WEBPACK_IMPORTED_MODULE_4__.maintain_this_binding)(parent, node, assignee); - } - } else if (!in_use) { - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.skip : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, node, { value: 0 }); - } - } - } - if (scope !== self) return; - var def; - if (node.name - && (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassExpression - && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.keep_name)(compressor.option("keep_classnames"), (def = node.name.definition()).name) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function - && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.keep_name)(compressor.option("keep_fnames"), (def = node.name.definition()).name))) { - // any declarations with same name will overshadow - // name of this anonymous function and can therefore - // never be used anywhere - if (!in_use_ids.has(def.id) || def.orig.length > 1) node.name = null; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Accessor)) { - var trim = - !compressor.option("keep_fargs") - // Is this an IIFE that won't refer to its name? - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && parent.expression === node - && !node.pinned() - && (!node.name || node.name.unreferenced()); - for (var a = node.argnames, i = a.length; --i >= 0;) { - var sym = a[i]; - if (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) { - sym = sym.expression; - } - if (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefaultAssign) { - sym = sym.left; - } - // Do not drop destructuring arguments. - // They constitute a type assertion of sorts - if ( - !(sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring) - && !in_use_ids.has(sym.definition().id) - ) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.set_flag)(sym, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.UNUSED); - if (trim) { - a.pop(); - } - } else { - trim = false; - } - } - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefClass && node !== self) { - const def = node.name.definition(); - descend(node, this); - const keep_class = def.global && !drop_funcs || in_use_ids.has(def.id); - if (!keep_class) { - const kept = node.drop_side_effect_free(compressor); - if (kept == null) { - def.eliminated++; - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.skip : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, node); - } - return kept; - } - return node; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun && node !== self) { - const def = node.name.definition(); - const keep = def.global && !drop_funcs || in_use_ids.has(def.id); - if (!keep) { - def.eliminated++; - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.skip : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, node); - } - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions && !(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn && parent.init === node)) { - var drop_block = !(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel) && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var); - // place uninitialized names at the start - var body = [], head = [], tail = []; - // for unused names whose initialization has - // side effects, we can cascade the init. code - // into the next one, or next statement. - var side_effects = []; - node.definitions.forEach(function(def) { - if (def.value) def.value = def.value.transform(tt); - var is_destructure = def.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring; - var sym = is_destructure - ? new _scope_js__WEBPACK_IMPORTED_MODULE_2__.SymbolDef(null, { name: "" }) /* fake SymbolDef */ - : def.name.definition(); - if (drop_block && sym.global) return tail.push(def); - if (!(drop_vars || drop_block) - || is_destructure - && (def.name.names.length - || def.name.is_array - || compressor.option("pure_getters") != true) - || in_use_ids.has(sym.id) - ) { - if (def.value && fixed_ids.has(sym.id) && fixed_ids.get(sym.id) !== def) { - def.value = def.value.drop_side_effect_free(compressor); - } - if (def.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolVar) { - var var_defs = var_defs_by_id.get(sym.id); - if (var_defs.length > 1 && (!def.value || sym.orig.indexOf(def.name) > sym.eliminated)) { - if (def.value) { - var ref = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, def.name, def.name); - sym.references.push(ref); - var assign = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, def, { - operator: "=", - logical: false, - left: ref, - right: def.value - }); - if (fixed_ids.get(sym.id) === def) { - fixed_ids.set(sym.id, assign); - } - side_effects.push(assign.transform(tt)); - } - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.remove)(var_defs, def); - sym.eliminated++; - return; - } - } - if (def.value) { - if (side_effects.length > 0) { - if (tail.length > 0) { - side_effects.push(def.value); - def.value = (0,_common_js__WEBPACK_IMPORTED_MODULE_4__.make_sequence)(def.value, side_effects); - } else { - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, node, { - body: (0,_common_js__WEBPACK_IMPORTED_MODULE_4__.make_sequence)(node, side_effects) - })); - } - side_effects = []; - } - tail.push(def); - } else { - head.push(def); - } - } else if (sym.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolCatch) { - var value = def.value && def.value.drop_side_effect_free(compressor); - if (value) side_effects.push(value); - def.value = null; - head.push(def); - } else { - var value = def.value && def.value.drop_side_effect_free(compressor); - if (value) { - side_effects.push(value); - } - sym.eliminated++; - } - }); - if (head.length > 0 || tail.length > 0) { - node.definitions = head.concat(tail); - body.push(node); - } - if (side_effects.length > 0) { - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, node, { - body: (0,_common_js__WEBPACK_IMPORTED_MODULE_4__.make_sequence)(node, side_effects) - })); - } - switch (body.length) { - case 0: - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.skip : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, node); - case 1: - return body[0]; - default: - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.splice(body) : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, node, { body }); - } - } - // certain combination of unused name + side effect leads to: - // https://github.com/mishoo/UglifyJS2/issues/44 - // https://github.com/mishoo/UglifyJS2/issues/1830 - // https://github.com/mishoo/UglifyJS2/issues/1838 - // that's an invalid AST. - // We fix it at this stage by moving the `var` outside the `for`. - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For) { - descend(node, this); - var block; - if (node.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement) { - block = node.init; - node.init = block.body.pop(); - block.body.push(node); - } - if (node.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - node.init = node.init.body; - } else if ((0,_common_js__WEBPACK_IMPORTED_MODULE_4__.is_empty)(node.init)) { - node.init = null; - } - return !block ? node : in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.splice(block.body) : block; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement - && node.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For - ) { - descend(node, this); - if (node.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement) { - var block = node.body; - node.body = block.body.pop(); - block.body.push(node); - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.splice(block.body) : block; - } - return node; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement) { - descend(node, this); - if (in_list && node.body.every(_common_js__WEBPACK_IMPORTED_MODULE_4__.can_be_evicted_from_block)) { - return _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.splice(node.body); - } - return node; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock)) { - const save_scope = scope; - scope = node; - descend(node, this); - scope = save_scope; - return node; - } - }, - function after(node, in_list) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - switch (node.expressions.length) { - case 0: return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.skip : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, node, { value: 0 }); - case 1: return node.expressions[0]; - } - } - } - ); - - self.transform(tt); - - function scan_ref_scoped(node, descend) { - var node_def; - const sym = assign_as_unused(node); - if (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && !(0,_common_js__WEBPACK_IMPORTED_MODULE_4__.is_ref_of)(node.left, _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolBlockDeclaration) - && self.variables.get(sym.name) === (node_def = sym.definition()) - ) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign) { - node.right.walk(tw); - if (!node_def.chained && node.left.fixed_value() === node.right) { - fixed_ids.set(node_def.id, node); - } - } - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - node_def = node.definition(); - if (!in_use_ids.has(node_def.id)) { - in_use_ids.set(node_def.id, node_def); - if (node_def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolCatch) { - const redef = node_def.scope.is_block_scope() - && node_def.scope.get_defun_scope().variables.get(node_def.name); - if (redef) in_use_ids.set(redef.id, redef); - } - } - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) { - descend(); - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock)) { - var save_scope = scope; - scope = node; - descend(); - scope = save_scope; - return true; - } - } -}); - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/evaluate.js": -/*!******************************************************!*\ - !*** ./node_modules/terser/lib/compress/evaluate.js ***! - \******************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ nullish: () => (/* binding */ nullish) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _inference_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inference.js */ "./node_modules/terser/lib/compress/inference.js"); -/* harmony import */ var _native_objects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./native-objects.js */ "./node_modules/terser/lib/compress/native-objects.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - -// methods to evaluate a constant expression - -function def_eval(node, func) { - node.DEFMETHOD("_eval", func); -} - -// Used to propagate a nullish short-circuit signal upwards through the chain. -const nullish = Symbol("This AST_Chain is nullish"); - -// If the node has been successfully reduced to a constant, -// then its value is returned; otherwise the element itself -// is returned. -// They can be distinguished as constant value is never a -// descendant of AST_Node. -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.DEFMETHOD("evaluate", function (compressor) { - if (!compressor.option("evaluate")) - return this; - var val = this._eval(compressor, 1); - if (!val || val instanceof RegExp) - return val; - if (typeof val == "function" || typeof val == "object" || val == nullish) - return this; - - // Evaluated strings can be larger than the original expression - if (typeof val === "string") { - const unevaluated_size = this.size(compressor); - if (val.length + 2 > unevaluated_size) return this; - } - - return val; -}); - -var unaryPrefix = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)("! ~ - + void"); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.DEFMETHOD("is_constant", function () { - // Accomodate when compress option evaluate=false - // as well as the common constant expressions !0 and -1 - if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Constant) { - return !(this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_RegExp); - } else { - return this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPrefix - && unaryPrefix.has(this.operator) - && ( - // `this.expression` may be an `AST_RegExp`, - // so not only `.is_constant()`. - this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Constant - || this.expression.is_constant() - ); - } -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Statement, function () { - throw new Error((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.string_template)("Cannot evaluate a statement [{file}:{line},{col}]", this.start)); -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda, _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_this); -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Class, _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_this); -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_this); -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Constant, function () { - return this.getValue(); -}); - -const supports_bigint = typeof BigInt === "function"; -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BigInt, function () { - if (supports_bigint) { - return BigInt(this.value); - } else { - return this; - } -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_RegExp, function (compressor) { - let evaluated = compressor.evaluated_regexps.get(this.value); - if (evaluated === undefined && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.regexp_is_safe)(this.value.source)) { - try { - const { source, flags } = this.value; - evaluated = new RegExp(source, flags); - } catch (e) { - evaluated = null; - } - compressor.evaluated_regexps.set(this.value, evaluated); - } - return evaluated || this; -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TemplateString, function () { - if (this.segments.length !== 1) return this; - return this.segments[0].value; -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function, function (compressor) { - if (compressor.option("unsafe")) { - var fn = function () { }; - fn.node = this; - fn.toString = () => this.print_to_string(); - return fn; - } - return this; -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array, function (compressor, depth) { - if (compressor.option("unsafe")) { - var elements = []; - for (var i = 0, len = this.elements.length; i < len; i++) { - var element = this.elements[i]; - var value = element._eval(compressor, depth); - if (element === value) - return this; - elements.push(value); - } - return elements; - } - return this; -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object, function (compressor, depth) { - if (compressor.option("unsafe")) { - var val = {}; - for (var i = 0, len = this.properties.length; i < len; i++) { - var prop = this.properties[i]; - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion) - return this; - var key = prop.key; - if (key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol) { - key = key.name; - } else if (key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node) { - key = key._eval(compressor, depth); - if (key === prop.key) - return this; - } - if (typeof Object.prototype[key] === "function") { - return this; - } - if (prop.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function) - continue; - val[key] = prop.value._eval(compressor, depth); - if (val[key] === prop.value) - return this; - } - return val; - } - return this; -}); - -var non_converting_unary = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)("! typeof void"); -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPrefix, function (compressor, depth) { - var e = this.expression; - if (compressor.option("typeofs") - && this.operator == "typeof") { - // Function would be evaluated to an array and so typeof would - // incorrectly return 'object'. Hence making is a special case. - if (e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef - && e.fixed_value() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda) { - return typeof function () { }; - } - if ( - (e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array - || (e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef - && (e.fixed_value() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object - || e.fixed_value() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array))) - && !e.has_side_effects(compressor) - ) { - return typeof {}; - } - } - if (!non_converting_unary.has(this.operator)) - depth++; - e = e._eval(compressor, depth); - if (e === this.expression) - return this; - switch (this.operator) { - case "!": return !e; - case "typeof": - // typeof returns "object" or "function" on different platforms - // so cannot evaluate reliably - if (e instanceof RegExp) - return this; - return typeof e; - case "void": return void e; - case "~": return ~e; - case "-": return -e; - case "+": return +e; - } - return this; -}); - -var non_converting_binary = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)("&& || ?? === !=="); -const identity_comparison = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)("== != === !=="); -const has_identity = value => typeof value === "object" - || typeof value === "function" - || typeof value === "symbol"; - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Binary, function (compressor, depth) { - if (!non_converting_binary.has(this.operator)) - depth++; - - var left = this.left._eval(compressor, depth); - if (left === this.left) - return this; - var right = this.right._eval(compressor, depth); - if (right === this.right) - return this; - - if (left != null - && right != null - && identity_comparison.has(this.operator) - && has_identity(left) - && has_identity(right) - && typeof left === typeof right) { - // Do not compare by reference - return this; - } - - // Do not mix BigInt and Number; Don't use `>>>` on BigInt or `/ 0n` - if ( - (typeof left === "bigint") !== (typeof right === "bigint") - || typeof left === "bigint" - && (this.operator === ">>>" - || this.operator === "/" && Number(right) === 0) - ) { - return this; - } - - var result; - switch (this.operator) { - case "&&": result = left && right; break; - case "||": result = left || right; break; - case "??": result = left != null ? left : right; break; - case "|": result = left | right; break; - case "&": result = left & right; break; - case "^": result = left ^ right; break; - case "+": result = left + right; break; - case "*": result = left * right; break; - case "**": result = left ** right; break; - case "/": result = left / right; break; - case "%": result = left % right; break; - case "-": result = left - right; break; - case "<<": result = left << right; break; - case ">>": result = left >> right; break; - case ">>>": result = left >>> right; break; - case "==": result = left == right; break; - case "===": result = left === right; break; - case "!=": result = left != right; break; - case "!==": result = left !== right; break; - case "<": result = left < right; break; - case "<=": result = left <= right; break; - case ">": result = left > right; break; - case ">=": result = left >= right; break; - default: - return this; - } - if (typeof result === "number" && isNaN(result) && compressor.find_parent(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_With)) { - // leave original expression as is - return this; - } - return result; -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Conditional, function (compressor, depth) { - var condition = this.condition._eval(compressor, depth); - if (condition === this.condition) - return this; - var node = condition ? this.consequent : this.alternative; - var value = node._eval(compressor, depth); - return value === node ? this : value; -}); - -// Set of AST_SymbolRef which are currently being evaluated. -// Avoids infinite recursion of ._eval() -const reentrant_ref_eval = new Set(); -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef, function (compressor, depth) { - if (reentrant_ref_eval.has(this)) - return this; - - var fixed = this.fixed_value(); - if (!fixed) - return this; - - reentrant_ref_eval.add(this); - const value = fixed._eval(compressor, depth); - reentrant_ref_eval.delete(this); - - if (value === fixed) - return this; - - if (value && typeof value == "object") { - var escaped = this.definition().escaped; - if (escaped && depth > escaped) - return this; - } - return value; -}); - -const global_objs = { Array, Math, Number, Object, String }; - -const regexp_flags = new Set([ - "dotAll", - "global", - "ignoreCase", - "multiline", - "sticky", - "unicode", -]); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PropAccess, function (compressor, depth) { - let obj = this.expression._eval(compressor, depth + 1); - if (obj === nullish || (this.optional && obj == null)) return nullish; - - // `.length` of strings and arrays is always safe - if (this.property === "length") { - if (typeof obj === "string") { - return obj.length; - } - - const is_spreadless_array = - obj instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array - && obj.elements.every(el => !(el instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion)); - - if ( - is_spreadless_array - && obj.elements.every(el => !el.has_side_effects(compressor)) - ) { - return obj.elements.length; - } - } - - if (compressor.option("unsafe")) { - var key = this.property; - if (key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node) { - key = key._eval(compressor, depth); - if (key === this.property) - return this; - } - - var exp = this.expression; - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_2__.is_undeclared_ref)(exp)) { - var aa; - var first_arg = exp.name === "hasOwnProperty" - && key === "call" - && (aa = compressor.parent() && compressor.parent().args) - && (aa && aa[0] - && aa[0].evaluate(compressor)); - - first_arg = first_arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Dot ? first_arg.expression : first_arg; - - if (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) { - return this.clone(); - } - if (!(0,_native_objects_js__WEBPACK_IMPORTED_MODULE_3__.is_pure_native_value)(exp.name, key)) - return this; - obj = global_objs[exp.name]; - } else { - if (obj instanceof RegExp) { - if (key == "source") { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.regexp_source_fix)(obj.source); - } else if (key == "flags" || regexp_flags.has(key)) { - return obj[key]; - } - } - if (!obj || obj === exp || !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.HOP)(obj, key)) - return this; - - if (typeof obj == "function") - switch (key) { - case "name": - return obj.node.name ? obj.node.name.name : ""; - case "length": - return obj.node.length_property(); - default: - return this; - } - } - return obj[key]; - } - return this; -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Chain, function (compressor, depth) { - const evaluated = this.expression._eval(compressor, depth); - return evaluated === nullish - ? undefined - : evaluated === this.expression - ? this - : evaluated; -}); - -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call, function (compressor, depth) { - var exp = this.expression; - - const callee = exp._eval(compressor, depth); - if (callee === nullish || (this.optional && callee == null)) return nullish; - - if (compressor.option("unsafe") && exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PropAccess) { - var key = exp.property; - if (key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node) { - key = key._eval(compressor, depth); - if (key === exp.property) - return this; - } - var val; - var e = exp.expression; - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_2__.is_undeclared_ref)(e)) { - var first_arg = e.name === "hasOwnProperty" && - key === "call" && - (this.args[0] && this.args[0].evaluate(compressor)); - - first_arg = first_arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Dot ? first_arg.expression : first_arg; - - if ((first_arg == null || first_arg.thedef && first_arg.thedef.undeclared)) { - return this.clone(); - } - if (!(0,_native_objects_js__WEBPACK_IMPORTED_MODULE_3__.is_pure_native_fn)(e.name, key)) return this; - val = global_objs[e.name]; - } else { - val = e._eval(compressor, depth + 1); - if (val === e || !val) - return this; - if (!(0,_native_objects_js__WEBPACK_IMPORTED_MODULE_3__.is_pure_native_method)(val.constructor.name, key)) - return this; - } - var args = []; - for (var i = 0, len = this.args.length; i < len; i++) { - var arg = this.args[i]; - var value = arg._eval(compressor, depth); - if (arg === value) - return this; - if (arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda) - return this; - args.push(value); - } - try { - return val[key].apply(val, args); - } catch (ex) { - // We don't really care - } - } - return this; -}); - -// Also a subclass of AST_Call -def_eval(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_New, _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_this); - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/global-defs.js": -/*!*********************************************************!*\ - !*** ./node_modules/terser/lib/compress/global-defs.js ***! - \*********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/* harmony import */ var _inference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inference.js */ "./node_modules/terser/lib/compress/inference.js"); - - - - - -(function(def_find_defs) { - function to_node(value, orig) { - if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - if (!(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant)) { - // Value may be a function, an array including functions and even a complex assign / block expression, - // so it should never be shared in different places. - // Otherwise wrong information may be used in the compression phase - value = value.clone(true); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(value.CTOR, orig, value); - } - if (Array.isArray(value)) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, orig, { - elements: value.map(function(value) { - return to_node(value, orig); - }) - }); - if (value && typeof value == "object") { - var props = []; - for (var key in value) if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.HOP)(value, key)) { - props.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal, orig, { - key: key, - value: to_node(value[key], orig) - })); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, orig, { - properties: props - }); - } - return (0,_common_js__WEBPACK_IMPORTED_MODULE_2__.make_node_from_constant)(value, orig); - } - - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel.DEFMETHOD("resolve_defines", function(compressor) { - if (!compressor.option("global_defs")) return this; - this.figure_out_scope({ ie8: compressor.option("ie8") }); - return this.transform(new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer(function(node) { - var def = node._find_defs(compressor, ""); - if (!def) return; - var level = 0, child = node, parent; - while (parent = this.parent(level++)) { - if (!(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess)) break; - if (parent.expression !== child) break; - child = parent; - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.is_lhs)(child, parent)) { - return; - } - return def; - })); - }); - def_find_defs(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.noop); - def_find_defs(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function(compressor, suffix) { - return this.expression._find_defs(compressor, suffix); - }); - def_find_defs(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, function(compressor, suffix) { - return this.expression._find_defs(compressor, "." + this.property + suffix); - }); - def_find_defs(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration, function() { - if (!this.global()) return; - }); - def_find_defs(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, function(compressor, suffix) { - if (!this.global()) return; - var defines = compressor.option("global_defs"); - var name = this.name + suffix; - if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.HOP)(defines, name)) return to_node(defines[name], this); - }); - def_find_defs(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ImportMeta, function(compressor, suffix) { - var defines = compressor.option("global_defs"); - var name = "import.meta" + suffix; - if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.HOP)(defines, name)) return to_node(defines[name], this); - }); -})(function(node, func) { - node.DEFMETHOD("_find_defs", func); -}); - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/index.js": -/*!***************************************************!*\ - !*** ./node_modules/terser/lib/compress/index.js ***! - \***************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Compressor: () => (/* binding */ Compressor) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/first_in_statement.js */ "./node_modules/terser/lib/utils/first_in_statement.js"); -/* harmony import */ var _equivalent_to_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../equivalent-to.js */ "./node_modules/terser/lib/equivalent-to.js"); -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../parse.js */ "./node_modules/terser/lib/parse.js"); -/* harmony import */ var _output_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../output.js */ "./node_modules/terser/lib/output.js"); -/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../scope.js */ "./node_modules/terser/lib/scope.js"); -/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../size.js */ "./node_modules/terser/lib/size.js"); -/* harmony import */ var _evaluate_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./evaluate.js */ "./node_modules/terser/lib/compress/evaluate.js"); -/* harmony import */ var _drop_side_effect_free_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./drop-side-effect-free.js */ "./node_modules/terser/lib/compress/drop-side-effect-free.js"); -/* harmony import */ var _drop_unused_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./drop-unused.js */ "./node_modules/terser/lib/compress/drop-unused.js"); -/* harmony import */ var _reduce_vars_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./reduce-vars.js */ "./node_modules/terser/lib/compress/reduce-vars.js"); -/* harmony import */ var _inference_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./inference.js */ "./node_modules/terser/lib/compress/inference.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/* harmony import */ var _tighten_body_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./tighten-body.js */ "./node_modules/terser/lib/compress/tighten-body.js"); -/* harmony import */ var _inline_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./inline.js */ "./node_modules/terser/lib/compress/inline.js"); -/* harmony import */ var _global_defs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./global-defs.js */ "./node_modules/terser/lib/compress/global-defs.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - - - - - - - - - - - - - - -class Compressor extends _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker { - constructor(options, { false_by_default = false, mangle_options = false }) { - super(); - if (options.defaults !== undefined && !options.defaults) false_by_default = true; - this.options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.defaults)(options, { - arguments : false, - arrows : !false_by_default, - booleans : !false_by_default, - booleans_as_integers : false, - collapse_vars : !false_by_default, - comparisons : !false_by_default, - computed_props: !false_by_default, - conditionals : !false_by_default, - dead_code : !false_by_default, - defaults : true, - directives : !false_by_default, - drop_console : false, - drop_debugger : !false_by_default, - ecma : 5, - evaluate : !false_by_default, - expression : false, - global_defs : false, - hoist_funs : false, - hoist_props : !false_by_default, - hoist_vars : false, - ie8 : false, - if_return : !false_by_default, - inline : !false_by_default, - join_vars : !false_by_default, - keep_classnames: false, - keep_fargs : true, - keep_fnames : false, - keep_infinity : false, - lhs_constants : !false_by_default, - loops : !false_by_default, - module : false, - negate_iife : !false_by_default, - passes : 1, - properties : !false_by_default, - pure_getters : !false_by_default && "strict", - pure_funcs : null, - pure_new : false, - reduce_funcs : !false_by_default, - reduce_vars : !false_by_default, - sequences : !false_by_default, - side_effects : !false_by_default, - switches : !false_by_default, - top_retain : null, - toplevel : !!(options && options["top_retain"]), - typeofs : !false_by_default, - unsafe : false, - unsafe_arrows : false, - unsafe_comps : false, - unsafe_Function: false, - unsafe_math : false, - unsafe_symbols: false, - unsafe_methods: false, - unsafe_proto : false, - unsafe_regexp : false, - unsafe_undefined: false, - unused : !false_by_default, - warnings : false // legacy - }, true); - var global_defs = this.options["global_defs"]; - if (typeof global_defs == "object") for (var key in global_defs) { - if (key[0] === "@" && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.HOP)(global_defs, key)) { - global_defs[key.slice(1)] = (0,_parse_js__WEBPACK_IMPORTED_MODULE_4__.parse)(global_defs[key], { - expression: true - }); - } - } - if (this.options["inline"] === true) this.options["inline"] = 3; - var pure_funcs = this.options["pure_funcs"]; - if (typeof pure_funcs == "function") { - this.pure_funcs = pure_funcs; - } else { - this.pure_funcs = pure_funcs ? function(node) { - return !pure_funcs.includes(node.expression.print_to_string()); - } : _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true; - } - var top_retain = this.options["top_retain"]; - if (top_retain instanceof RegExp) { - this.top_retain = function(def) { - return top_retain.test(def.name); - }; - } else if (typeof top_retain == "function") { - this.top_retain = top_retain; - } else if (top_retain) { - if (typeof top_retain == "string") { - top_retain = top_retain.split(/,/); - } - this.top_retain = function(def) { - return top_retain.includes(def.name); - }; - } - if (this.options["module"]) { - this.directives["use strict"] = true; - this.options["toplevel"] = true; - } - var toplevel = this.options["toplevel"]; - this.toplevel = typeof toplevel == "string" ? { - funcs: /funcs/.test(toplevel), - vars: /vars/.test(toplevel) - } : { - funcs: toplevel, - vars: toplevel - }; - var sequences = this.options["sequences"]; - this.sequences_limit = sequences == 1 ? 800 : sequences | 0; - this.evaluated_regexps = new Map(); - this._toplevel = undefined; - this._mangle_options = mangle_options - ? (0,_scope_js__WEBPACK_IMPORTED_MODULE_6__.format_mangler_options)(mangle_options) - : mangle_options; - } - - mangle_options() { - var nth_identifier = this._mangle_options && this._mangle_options.nth_identifier || _scope_js__WEBPACK_IMPORTED_MODULE_6__.base54; - var module = this._mangle_options && this._mangle_options.module || this.option("module"); - return { ie8: this.option("ie8"), nth_identifier, module }; - } - - option(key) { - return this.options[key]; - } - - exposed(def) { - if (def.export) return true; - if (def.global) for (var i = 0, len = def.orig.length; i < len; i++) - if (!this.toplevel[def.orig[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDefun ? "funcs" : "vars"]) - return true; - return false; - } - - in_boolean_context() { - if (!this.option("booleans")) return false; - var self = this.self(); - for (var i = 0, p; p = this.parent(i); i++) { - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional && p.condition === self - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DWLoop && p.condition === self - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For && p.condition === self - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If && p.condition === self - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix && p.operator == "!" && p.expression === self) { - return true; - } - if ( - p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && ( - p.operator == "&&" - || p.operator == "||" - || p.operator == "??" - ) - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional - || p.tail_node() === self - ) { - self = p; - } else { - return false; - } - } - } - - in_32_bit_context(other_operand_must_be_number) { - if (!this.option("evaluate")) return false; - var self = this.self(); - for (var i = 0, p; p = this.parent(i); i++) { - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && _inference_js__WEBPACK_IMPORTED_MODULE_12__.bitwise_binop.has(p.operator)) { - if (other_operand_must_be_number) { - return (self === p.left ? p.right : p.left).is_number(this); - } else { - return true; - } - } - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix) { - return p.operator === "~"; - } - if ( - p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && ( - p.operator == "&&" - || p.operator == "||" - || p.operator == "??" - ) - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional && p.condition !== self - || p.tail_node() === self - ) { - self = p; - } else { - return false; - } - } - } - - in_computed_key() { - if (!this.option("evaluate")) return false; - var self = this.self(); - for (var i = 0, p; p = this.parent(i); i++) { - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectProperty && p.key === self) { - return true; - } - } - return false; - } - - get_toplevel() { - return this._toplevel; - } - - compress(toplevel) { - toplevel = toplevel.resolve_defines(this); - this._toplevel = toplevel; - if (this.option("expression")) { - this._toplevel.process_expression(true); - } - var passes = +this.options.passes || 1; - var min_count = 1 / 0; - var stopping = false; - var mangle = this.mangle_options(); - for (var pass = 0; pass < passes; pass++) { - this._toplevel.figure_out_scope(mangle); - if (pass === 0 && this.option("drop_console")) { - // must be run before reduce_vars and compress pass - this._toplevel = this._toplevel.drop_console(this.option("drop_console")); - } - if (pass > 0 || this.option("reduce_vars")) { - this._toplevel.reset_opt_flags(this); - } - this._toplevel = this._toplevel.transform(this); - if (passes > 1) { - let count = 0; - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(this._toplevel, () => { count++; }); - if (count < min_count) { - min_count = count; - stopping = false; - } else if (stopping) { - break; - } else { - stopping = true; - } - } - } - if (this.option("expression")) { - this._toplevel.process_expression(false); - } - toplevel = this._toplevel; - this._toplevel = undefined; - return toplevel; - } - - before(node, descend) { - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(node, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.SQUEEZED)) return node; - var was_scope = false; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) { - node = node.hoist_properties(this); - node = node.hoist_declarations(this); - was_scope = true; - } - // Before https://github.com/mishoo/UglifyJS2/pull/1602 AST_Node.optimize() - // would call AST_Node.transform() if a different instance of AST_Node is - // produced after def_optimize(). - // This corrupts TreeWalker.stack, which cause AST look-ups to malfunction. - // Migrate and defer all children's AST_Node.transform() to below, which - // will now happen after this parent AST_Node has been properly substituted - // thus gives a consistent AST snapshot. - descend(node, this); - // Existing code relies on how AST_Node.optimize() worked, and omitting the - // following replacement call would result in degraded efficiency of both - // output and performance. - descend(node, this); - var opt = node.optimize(this); - if (was_scope && opt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) { - opt.drop_unused(this); - descend(opt, this); - } - if (opt === node) (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.set_flag)(opt, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.SQUEEZED); - return opt; - } - - /** Alternative to plain is_lhs() which doesn't work within .optimize() */ - is_lhs() { - const self = this.stack[this.stack.length - 1]; - const parent = this.stack[this.stack.length - 2]; - return (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_lhs)(self, parent); - } -} - - -function def_optimize(node, optimizer) { - node.DEFMETHOD("optimize", function(compressor) { - var self = this; - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(self, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.OPTIMIZED)) return self; - if (compressor.has_directive("use asm")) return self; - var opt = optimizer(self, compressor); - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.set_flag)(opt, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.OPTIMIZED); - return opt; - }); -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, function(self) { - return self; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel.DEFMETHOD("drop_console", function(options) { - const isArray = Array.isArray(options); - const tt = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer(function(self) { - if (self.TYPE !== "Call") { - return; - } - - var exp = self.expression; - - if (!(exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess)) { - return; - } - - var name = exp.expression; - var property = exp.property; - var depth = 2; - while (name.expression) { - property = name.property; - name = name.expression; - depth++; - } - - if (isArray && !options.includes(property)) { - return; - } - - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undeclared_ref)(name) && name.name == "console") { - if ( - depth === 3 - && !["call", "apply"].includes(exp.property) - && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_used_in_expression)(tt) - ) { - // a (used) call to Function.prototype methods (eg: console.log.bind(console)) - // but not .call and .apply which would also return undefined. - exp.expression = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_empty_function)(self); - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.set_flag)(exp.expression, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.SQUEEZED); - self.args = []; - } else { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self); - } - } - }); - - return this.transform(tt); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.DEFMETHOD("equivalent_to", function(node) { - return (0,_equivalent_to_js__WEBPACK_IMPORTED_MODULE_3__.equivalent_to)(this, node); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) { - var self = this; - var tt = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer(function(node) { - if (insert && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return, node, { - value: node.body - }); - } - if (!insert && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return) { - if (compressor) { - var value = node.value && node.value.drop_side_effect_free(compressor, true); - return value - ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, node, { body: value }) - : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, node); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, node, { - body: node.value || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, node, { - operator: "void", - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, node, { - value: 0 - }) - }) - }); - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda && node !== self) { - return node; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block) { - var index = node.body.length - 1; - if (index >= 0) { - node.body[index] = node.body[index].transform(tt); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - node.body = node.body.transform(tt); - if (node.alternative) { - node.alternative = node.alternative.transform(tt); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With) { - node.body = node.body.transform(tt); - } - return node; - }); - self.transform(tt); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel.DEFMETHOD("reset_opt_flags", function(compressor) { - const self = this; - const reduce_vars = compressor.option("reduce_vars"); - - const preparation = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker(function(node, descend) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.clear_flag)(node, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.CLEAR_BETWEEN_PASSES); - if (reduce_vars) { - if (compressor.top_retain - && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun // Only functions are retained - && preparation.parent() === self - ) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.set_flag)(node, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.TOP); - } - return node.reduce_vars(preparation, descend, compressor); - } - }); - // Stack of look-up tables to keep track of whether a `SymbolDef` has been - // properly assigned before use: - // - `push()` & `pop()` when visiting conditional branches - preparation.safe_ids = Object.create(null); - preparation.in_loop = null; - preparation.loop_ids = new Map(); - preparation.defs_to_safe_ids = new Map(); - self.walk(preparation); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol.DEFMETHOD("fixed_value", function() { - var fixed = this.thedef.fixed; - if (!fixed || fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) return fixed; - return fixed(); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef.DEFMETHOD("is_immutable", function() { - var orig = this.definition().orig; - return orig.length == 1 && orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolLambda; -}); - -function find_variable(compressor, name) { - var scope, i = 0; - while (scope = compressor.parent(i++)) { - if (scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) break; - if (scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Catch && scope.argname) { - scope = scope.argname.definition().scope; - break; - } - } - return scope.find_variable(name); -} - -var global_names = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError"); -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) { - return !this.definition().undeclared - || compressor.option("unsafe") && global_names.has(this.name); -}); - -/* -----[ optimizers ]----- */ - -var directives = new Set(["use asm", "use strict"]); -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Directive, function(self, compressor) { - if (compressor.option("directives") - && (!directives.has(self.value) || compressor.has_directive(self.value) !== self)) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, self); - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Debugger, function(self, compressor) { - if (compressor.option("drop_debugger")) - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, self); - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement, function(self, compressor) { - if (self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break - && compressor.loopcontrol_target(self.body) === self.body) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, self); - } - return self.label.references.length == 0 ? self.body : self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block, function(self, compressor) { - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.tighten_body)(self.body, compressor); - return self; -}); - -function can_be_extracted_from_if_block(node) { - return !( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Const - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Let - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class - ); -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, function(self, compressor) { - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.tighten_body)(self.body, compressor); - switch (self.body.length) { - case 1: - if (!compressor.has_directive("use strict") - && compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If - && can_be_extracted_from_if_block(self.body[0]) - || (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.can_be_evicted_from_block)(self.body[0])) { - return self.body[0]; - } - break; - case 0: return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, self); - } - return self; -}); - -function opt_AST_Lambda(self, compressor) { - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.tighten_body)(self.body, compressor); - if (compressor.option("side_effects") - && self.body.length == 1 - && self.body[0] === compressor.has_directive("use strict")) { - self.body.length = 0; - } - return self; -} -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda, opt_AST_Lambda); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { - var self = this; - if (compressor.has_directive("use asm")) return self; - - var hoist_funs = compressor.option("hoist_funs"); - var hoist_vars = compressor.option("hoist_vars"); - - if (hoist_funs || hoist_vars) { - var dirs = []; - var hoisted = []; - var vars = new Map(), vars_found = 0, var_decl = 0; - // let's count var_decl first, we seem to waste a lot of - // space if we hoist `var` when there's only one. - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(self, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope && node !== self) - return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var) { - ++var_decl; - return true; - } - }); - hoist_vars = hoist_vars && var_decl > 1; - var tt = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer( - function before(node) { - if (node !== self) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Directive) { - dirs.push(node); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, node); - } - if (hoist_funs && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun - && !(tt.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export) - && tt.parent() === self) { - hoisted.push(node); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, node); - } - if ( - hoist_vars - && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var - && !node.definitions.some(def => def.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring) - ) { - node.definitions.forEach(function(def) { - vars.set(def.name.name, def); - ++vars_found; - }); - var seq = node.to_assignments(compressor); - var p = tt.parent(); - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn && p.init === node) { - if (seq == null) { - var def = node.definitions[0].name; - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, def, def); - } - return seq; - } - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For && p.init === node) { - return seq; - } - if (!seq) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, node); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, node, { - body: seq - }); - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) - return node; // to avoid descending in nested scopes - } - } - ); - self = self.transform(tt); - if (vars_found > 0) { - // collect only vars which don't show up in self's arguments list - var defs = []; - const is_lambda = self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda; - const args_as_names = is_lambda ? self.args_as_names() : null; - vars.forEach((def, name) => { - if (is_lambda && args_as_names.some((x) => x.name === def.name.name)) { - vars.delete(name); - } else { - def = def.clone(); - def.value = null; - defs.push(def); - vars.set(name, def); - } - }); - if (defs.length > 0) { - // try to merge in assignments - for (var i = 0; i < self.body.length;) { - if (self.body[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - var expr = self.body[i].body, sym, assign; - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - && expr.operator == "=" - && (sym = expr.left) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol - && vars.has(sym.name) - ) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = expr.right; - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.remove)(defs, def); - defs.push(def); - self.body.splice(i, 1); - continue; - } - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence - && (assign = expr.expressions[0]) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - && assign.operator == "=" - && (sym = assign.left) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol - && vars.has(sym.name) - ) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = assign.right; - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.remove)(defs, def); - defs.push(def); - self.body[i].body = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(expr, expr.expressions.slice(1)); - continue; - } - } - if (self.body[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement) { - self.body.splice(i, 1); - continue; - } - if (self.body[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement) { - self.body.splice(i, 1, ...self.body[i].body); - continue; - } - break; - } - defs = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var, self, { - definitions: defs - }); - hoisted.push(defs); - } - } - self.body = dirs.concat(hoisted, self.body); - } - return self; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { - var self = this; - if (!compressor.option("hoist_props") || compressor.has_directive("use asm")) return self; - var top_retain = self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel && compressor.top_retain || _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false; - var defs_by_id = new Map(); - var hoister = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer(function(node, descend) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef) { - const sym = node.name; - let def; - let value; - if (sym.scope === self - && (def = sym.definition()).escaped != 1 - && !def.assignments - && !def.direct_access - && !def.single_use - && !compressor.exposed(def) - && !top_retain(def) - && (value = sym.fixed_value()) === node.value - && value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object - && !value.properties.some(prop => - prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion || prop.computed_key() - ) - ) { - descend(node, this); - const defs = new Map(); - const assignments = []; - value.properties.forEach(({ key, value }) => { - const scope = hoister.find_scope(); - const symbol = self.create_symbol(sym.CTOR, { - source: sym, - scope, - conflict_scopes: new Set([ - scope, - ...sym.definition().references.map(ref => ref.scope) - ]), - tentative_name: sym.name + "_" + key - }); - - defs.set(String(key), symbol.definition()); - - assignments.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, node, { - name: symbol, - value - })); - }); - defs_by_id.set(def.id, defs); - return _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.splice(assignments); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - && node.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - ) { - const defs = defs_by_id.get(node.expression.definition().id); - if (defs) { - const def = defs.get(String((0,_common_js__WEBPACK_IMPORTED_MODULE_14__.get_simple_key)(node.property))); - const sym = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, node, { - name: def.name, - scope: node.expression.scope, - thedef: def - }); - sym.reference({}); - return sym; - } - } - }); - return self.transform(hoister); -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, function(self, compressor) { - if (compressor.option("side_effects")) { - var body = self.body; - var node = body.drop_side_effect_free(compressor, true); - if (!node) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, self); - } - if (node !== body) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self, { body: node }); - } - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_While, function(self, compressor) { - return compressor.option("loops") ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For, self, self).optimize(compressor) : self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Do, function(self, compressor) { - if (!compressor.option("loops")) return self; - var cond = self.condition.tail_node().evaluate(compressor); - if (!(cond instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - if (cond) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For, self, { - body: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self.body, { - body: [ - self.body, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.condition, { - body: self.condition - }) - ] - }) - }).optimize(compressor); - if (!(0,_common_js__WEBPACK_IMPORTED_MODULE_14__.has_break_or_continue)(self, compressor.parent())) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self.body, { - body: [ - self.body, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.condition, { - body: self.condition - }) - ] - }).optimize(compressor); - } - } - return self; -}); - -function if_break_in_loop(self, compressor) { - var first = self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement ? self.body.body[0] : self.body; - if (compressor.option("dead_code") && is_break(first)) { - var body = []; - if (self.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Statement) { - body.push(self.init); - } else if (self.init) { - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.init, { - body: self.init - })); - } - if (self.condition) { - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.condition, { - body: self.condition - })); - } - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.trim_unreachable_code)(compressor, self.body, body); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: body - }); - } - if (first instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - if (is_break(first.body)) { - if (self.condition) { - self.condition = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition.negate(compressor), - }); - } else { - self.condition = first.condition.negate(compressor); - } - drop_it(first.alternative); - } else if (is_break(first.alternative)) { - if (self.condition) { - self.condition = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition, - }); - } else { - self.condition = first.condition; - } - drop_it(first.body); - } - } - return self; - - function is_break(node) { - return node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break - && compressor.loopcontrol_target(node) === compressor.self(); - } - - function drop_it(rest) { - rest = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.as_statement_array)(rest); - if (self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement) { - self.body = self.body.clone(); - self.body.body = rest.concat(self.body.body.slice(1)); - self.body = self.body.transform(compressor); - } else { - self.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self.body, { - body: rest - }).transform(compressor); - } - self = if_break_in_loop(self, compressor); - } -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For, function(self, compressor) { - if (!compressor.option("loops")) return self; - if (compressor.option("side_effects") && self.init) { - self.init = self.init.drop_side_effect_free(compressor); - } - if (self.condition) { - var cond = self.condition.evaluate(compressor); - if (!(cond instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - if (cond) self.condition = null; - else if (!compressor.option("dead_code")) { - var orig = self.condition; - self.condition = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(cond, self.condition); - self.condition = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of_expression)(self.condition.transform(compressor), orig); - } - } - if (compressor.option("dead_code")) { - if (cond instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) cond = self.condition.tail_node().evaluate(compressor); - if (!cond) { - var body = []; - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.trim_unreachable_code)(compressor, self.body, body); - if (self.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Statement) { - body.push(self.init); - } else if (self.init) { - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.init, { - body: self.init - })); - } - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.condition, { - body: self.condition - })); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } - } - return if_break_in_loop(self, compressor); -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, function(self, compressor) { - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_14__.is_empty)(self.alternative)) self.alternative = null; - - if (!compressor.option("conditionals")) return self; - // if condition can be statically determined, drop - // one of the blocks. note, statically determined implies - // “has no side effects”; also it doesn't work for cases like - // `x && true`, though it probably should. - var cond = self.condition.evaluate(compressor); - if (!compressor.option("dead_code") && !(cond instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - var orig = self.condition; - self.condition = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(cond, orig); - self.condition = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of_expression)(self.condition.transform(compressor), orig); - } - if (compressor.option("dead_code")) { - if (cond instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) cond = self.condition.tail_node().evaluate(compressor); - if (!cond) { - var body = []; - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.trim_unreachable_code)(compressor, self.body, body); - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.condition, { - body: self.condition - })); - if (self.alternative) body.push(self.alternative); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { body: body }).optimize(compressor); - } else if (!(cond instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - var body = []; - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.condition, { - body: self.condition - })); - body.push(self.body); - if (self.alternative) { - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.trim_unreachable_code)(compressor, self.alternative, body); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } - var negated = self.condition.negate(compressor); - var self_condition_length = self.condition.size(); - var negated_length = negated.size(); - var negated_is_best = negated_length < self_condition_length; - if (self.alternative && negated_is_best) { - negated_is_best = false; // because we already do the switch here. - // no need to swap values of self_condition_length and negated_length - // here because they are only used in an equality comparison later on. - self.condition = negated; - var tmp = self.body; - self.body = self.alternative || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, self); - self.alternative = tmp; - } - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_14__.is_empty)(self.body) && (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.is_empty)(self.alternative)) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self.condition, { - body: self.condition.clone() - }).optimize(compressor); - } - if (self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement - && self.alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self, { - body: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition : self.condition, - consequent : self.body.body, - alternative : self.alternative.body - }) - }).optimize(compressor); - } - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_14__.is_empty)(self.alternative) && self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - if (self_condition_length === negated_length && !negated_is_best - && self.condition instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && self.condition.operator == "||") { - // although the code length of self.condition and negated are the same, - // negated does not require additional surrounding parentheses. - // see https://github.com/mishoo/UglifyJS2/issues/979 - negated_is_best = true; - } - if (negated_is_best) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self, { - body: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator : "||", - left : negated, - right : self.body.body - }) - }).optimize(compressor); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self, { - body: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator : "&&", - left : self.condition, - right : self.body.body - }) - }).optimize(compressor); - } - if (self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement - && self.alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, self, { - body: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator : "||", - left : self.condition, - right : self.alternative.body - }) - }).optimize(compressor); - } - if (self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit - && self.alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit - && self.body.TYPE == self.alternative.TYPE) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(self.body.CTOR, self, { - value: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition : self.condition, - consequent : self.body.value || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self.body), - alternative : self.alternative.value || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self.alternative) - }).transform(compressor) - }).optimize(compressor); - } - if (self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If - && !self.body.alternative - && !self.alternative) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, self, { - condition: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.condition, { - operator: "&&", - left: self.condition, - right: self.body.condition - }), - body: self.body.body, - alternative: null - }); - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.aborts)(self.body)) { - if (self.alternative) { - var alt = self.alternative; - self.alternative = null; - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: [ self, alt ] - }).optimize(compressor); - } - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.aborts)(self.alternative)) { - var body = self.body; - self.body = self.alternative; - self.condition = negated_is_best ? negated : self.condition.negate(compressor); - self.alternative = null; - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: [ self, body ] - }).optimize(compressor); - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch, function(self, compressor) { - if (!compressor.option("switches")) return self; - var branch; - var value = self.expression.evaluate(compressor); - if (!(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - var orig = self.expression; - self.expression = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(value, orig); - self.expression = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of_expression)(self.expression.transform(compressor), orig); - } - if (!compressor.option("dead_code")) return self; - if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - value = self.expression.tail_node().evaluate(compressor); - } - var decl = []; - var body = []; - var default_branch; - var exact_match; - for (var i = 0, len = self.body.length; i < len && !exact_match; i++) { - branch = self.body[i]; - if (branch instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Default) { - if (!default_branch) { - default_branch = branch; - } else { - eliminate_branch(branch, body[body.length - 1]); - } - } else if (!(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - var exp = branch.expression.evaluate(compressor); - if (!(exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) && exp !== value) { - eliminate_branch(branch, body[body.length - 1]); - continue; - } - if (exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node && !exp.has_side_effects(compressor)) { - exp = branch.expression.tail_node().evaluate(compressor); - } - if (exp === value) { - exact_match = branch; - if (default_branch) { - var default_index = body.indexOf(default_branch); - body.splice(default_index, 1); - eliminate_branch(default_branch, body[default_index - 1]); - default_branch = null; - } - } - } - body.push(branch); - } - while (i < len) eliminate_branch(self.body[i++], body[body.length - 1]); - self.body = body; - - let default_or_exact = default_branch || exact_match; - default_branch = null; - exact_match = null; - - // group equivalent branches so they will be located next to each other, - // that way the next micro-optimization will merge them. - // ** bail micro-optimization if not a simple switch case with breaks - if (body.every((branch, i) => - (branch === default_or_exact || branch.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant) - && (branch.body.length === 0 || (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.aborts)(branch) || body.length - 1 === i)) - ) { - for (let i = 0; i < body.length; i++) { - const branch = body[i]; - for (let j = i + 1; j < body.length; j++) { - const next = body[j]; - if (next.body.length === 0) continue; - const last_branch = j === (body.length - 1); - const equivalentBranch = branches_equivalent(next, branch, false); - if (equivalentBranch || (last_branch && branches_equivalent(next, branch, true))) { - if (!equivalentBranch && last_branch) { - next.body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break)); - } - - // let's find previous siblings with inert fallthrough... - let x = j - 1; - let fallthroughDepth = 0; - while (x > i) { - if (is_inert_body(body[x--])) { - fallthroughDepth++; - } else { - break; - } - } - - const plucked = body.splice(j - fallthroughDepth, 1 + fallthroughDepth); - body.splice(i + 1, 0, ...plucked); - i += plucked.length; - } - } - } - } - - // merge equivalent branches in a row - for (let i = 0; i < body.length; i++) { - let branch = body[i]; - if (branch.body.length === 0) continue; - if (!(0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.aborts)(branch)) continue; - - for (let j = i + 1; j < body.length; i++, j++) { - let next = body[j]; - if (next.body.length === 0) continue; - if ( - branches_equivalent(next, branch, false) - || (j === body.length - 1 && branches_equivalent(next, branch, true)) - ) { - branch.body = []; - branch = next; - continue; - } - break; - } - } - - // Prune any empty branches at the end of the switch statement. - { - let i = body.length - 1; - for (; i >= 0; i--) { - let bbody = body[i].body; - if (is_break(bbody[bbody.length - 1], compressor)) bbody.pop(); - if (!is_inert_body(body[i])) break; - } - // i now points to the index of a branch that contains a body. By incrementing, it's - // pointing to the first branch that's empty. - i++; - if (!default_or_exact || body.indexOf(default_or_exact) >= i) { - // The default behavior is to do nothing. We can take advantage of that to - // remove all case expressions that are side-effect free that also do - // nothing, since they'll default to doing nothing. But we can't remove any - // case expressions before one that would side-effect, since they may cause - // the side-effect to be skipped. - for (let j = body.length - 1; j >= i; j--) { - let branch = body[j]; - if (branch === default_or_exact) { - default_or_exact = null; - body.pop(); - } else if (!branch.expression.has_side_effects(compressor)) { - body.pop(); - } else { - break; - } - } - } - } - - - // Prune side-effect free branches that fall into default. - DEFAULT: if (default_or_exact) { - let default_index = body.indexOf(default_or_exact); - let default_body_index = default_index; - for (; default_body_index < body.length - 1; default_body_index++) { - if (!is_inert_body(body[default_body_index])) break; - } - if (default_body_index < body.length - 1) { - break DEFAULT; - } - - let side_effect_index = body.length - 1; - for (; side_effect_index >= 0; side_effect_index--) { - let branch = body[side_effect_index]; - if (branch === default_or_exact) continue; - if (branch.expression.has_side_effects(compressor)) break; - } - // If the default behavior comes after any side-effect case expressions, - // then we can fold all side-effect free cases into the default branch. - // If the side-effect case is after the default, then any side-effect - // free cases could prevent the side-effect from occurring. - if (default_body_index > side_effect_index) { - let prev_body_index = default_index - 1; - for (; prev_body_index >= 0; prev_body_index--) { - if (!is_inert_body(body[prev_body_index])) break; - } - let before = Math.max(side_effect_index, prev_body_index) + 1; - let after = default_index; - if (side_effect_index > default_index) { - // If the default falls into the same body as a side-effect - // case, then we need preserve that case and only prune the - // cases after it. - after = side_effect_index; - body[side_effect_index].body = body[default_body_index].body; - } else { - // The default will be the last branch. - default_or_exact.body = body[default_body_index].body; - } - - // Prune everything after the default (or last side-effect case) - // until the next case with a body. - body.splice(after + 1, default_body_index - after); - // Prune everything before the default that falls into it. - body.splice(before, default_index - before); - } - } - - // See if we can remove the switch entirely if all cases (the default) fall into the same case body. - DEFAULT: if (default_or_exact) { - let i = body.findIndex(branch => !is_inert_body(branch)); - let caseBody; - // `i` is equal to one of the following: - // - `-1`, there is no body in the switch statement. - // - `body.length - 1`, all cases fall into the same body. - // - anything else, there are multiple bodies in the switch. - if (i === body.length - 1) { - // All cases fall into the case body. - let branch = body[i]; - if (has_nested_break(self)) break DEFAULT; - - // This is the last case body, and we've already pruned any breaks, so it's - // safe to hoist. - caseBody = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, branch, { - body: branch.body - }); - branch.body = []; - } else if (i !== -1) { - // If there are multiple bodies, then we cannot optimize anything. - break DEFAULT; - } - - let sideEffect = body.find( - branch => branch !== default_or_exact && branch.expression.has_side_effects(compressor) - ); - // If no cases cause a side-effect, we can eliminate the switch entirely. - if (!sideEffect) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: decl.concat( - statement(self.expression), - default_or_exact.expression ? statement(default_or_exact.expression) : [], - caseBody || [] - ) - }).optimize(compressor); - } - - // If we're this far, either there was no body or all cases fell into the same body. - // If there was no body, then we don't need a default branch (because the default is - // do nothing). If there was a body, we'll extract it to after the switch, so the - // switch's new default is to do nothing and we can still prune it. - const default_index = body.indexOf(default_or_exact); - body.splice(default_index, 1); - default_or_exact = null; - - if (caseBody) { - // Recurse into switch statement one more time so that we can append the case body - // outside of the switch. This recursion will only happen once since we've pruned - // the default case. - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: decl.concat(self, caseBody) - }).optimize(compressor); - } - // If we fall here, there is a default branch somewhere, there are no case bodies, - // and there's a side-effect somewhere. Just let the below paths take care of it. - } - - if (body.length > 0) { - body[0].body = decl.concat(body[0].body); - } - - if (body.length == 0) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: decl.concat(statement(self.expression)) - }).optimize(compressor); - } - if (body.length == 1 && !has_nested_break(self)) { - // This is the last case body, and we've already pruned any breaks, so it's - // safe to hoist. - let branch = body[0]; - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, self, { - condition: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "===", - left: self.expression, - right: branch.expression, - }), - body: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, branch, { - body: branch.body - }), - alternative: null - }).optimize(compressor); - } - if (body.length === 2 && default_or_exact && !has_nested_break(self)) { - let branch = body[0] === default_or_exact ? body[1] : body[0]; - let exact_exp = default_or_exact.expression && statement(default_or_exact.expression); - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.aborts)(body[0])) { - // Only the first branch body could have a break (at the last statement) - let first = body[0]; - if (is_break(first.body[first.body.length - 1], compressor)) { - first.body.pop(); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, self, { - condition: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "===", - left: self.expression, - right: branch.expression, - }), - body: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, branch, { - body: branch.body - }), - alternative: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, default_or_exact, { - body: [].concat( - exact_exp || [], - default_or_exact.body - ) - }) - }).optimize(compressor); - } - let operator = "==="; - let consequent = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, branch, { - body: branch.body, - }); - let always = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, default_or_exact, { - body: [].concat( - exact_exp || [], - default_or_exact.body - ) - }); - if (body[0] === default_or_exact) { - operator = "!=="; - let tmp = always; - always = consequent; - consequent = tmp; - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: [ - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, self, { - condition: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: operator, - left: self.expression, - right: branch.expression, - }), - body: consequent, - alternative: null, - }), - always, - ], - }).optimize(compressor); - } - return self; - - function eliminate_branch(branch, prev) { - if (prev && !(0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.aborts)(prev)) { - prev.body = prev.body.concat(branch.body); - } else { - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.trim_unreachable_code)(compressor, branch, decl); - } - } - function branches_equivalent(branch, prev, insertBreak) { - let bbody = branch.body; - let pbody = prev.body; - if (insertBreak) { - bbody = bbody.concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break)); - } - if (bbody.length !== pbody.length) return false; - let bblock = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, branch, { body: bbody }); - let pblock = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, prev, { body: pbody }); - return bblock.equivalent_to(pblock); - } - function statement(body) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, body, { body }); - } - function has_nested_break(root) { - let has_break = false; - - let tw = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker(node => { - if (has_break) return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda) return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) return true; - if (!is_break(node, tw)) return; - let parent = tw.parent(); - if ( - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SwitchBranch - && parent.body[parent.body.length - 1] === node - ) { - return; - } - has_break = true; - }); - root.walk(tw); - return has_break; - } - function is_break(node, stack) { - return node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break - && stack.loopcontrol_target(node) === self; - } - function is_inert_body(branch) { - return !(0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.aborts)(branch) && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, branch, { - body: branch.body - }).has_side_effects(compressor); - } -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try, function(self, compressor) { - if (self.bcatch && self.bfinally && self.bfinally.body.every(_common_js__WEBPACK_IMPORTED_MODULE_14__.is_empty)) self.bfinally = null; - - if (compressor.option("dead_code") && self.body.body.every(_common_js__WEBPACK_IMPORTED_MODULE_14__.is_empty)) { - var body = []; - if (self.bcatch) { - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.trim_unreachable_code)(compressor, self.bcatch, body); - } - if (self.bfinally) body.push(...self.bfinally.body); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, self, { - body: body - }).optimize(compressor); - } - return self; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { - var reduce_vars = compressor.option("reduce_vars"); - var assignments = []; - - for (const def of this.definitions) { - if (def.value) { - var name = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, def.name, def.name); - assignments.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, def, { - operator : "=", - logical: false, - left : name, - right : def.value - })); - if (reduce_vars) name.definition().fixed = false; - } - const thedef = def.name.definition(); - thedef.eliminated++; - thedef.replaced--; - } - - if (assignments.length == 0) return null; - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(this, assignments); -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions, function(self) { - if (self.definitions.length == 0) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, self); - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, function(self, compressor) { - if ( - self.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolLet - && self.value != null - && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(self.value, compressor) - ) { - self.value = null; - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Import, function(self) { - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, function(self, compressor) { - var exp = self.expression; - var fn = exp; - inline_array_like_spread(self.args); - var simple_args = self.args.every((arg) => !(arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion)); - - if (compressor.option("reduce_vars") && fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - fn = fn.fixed_value(); - } - - var is_func = fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda; - - if (is_func && fn.pinned()) return self; - - if (compressor.option("unused") - && simple_args - && is_func - && !fn.uses_arguments) { - var pos = 0, last = 0; - for (var i = 0, len = self.args.length; i < len; i++) { - if (fn.argnames[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) { - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(fn.argnames[i].expression, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.UNUSED)) while (i < len) { - var node = self.args[i++].drop_side_effect_free(compressor); - if (node) { - self.args[pos++] = node; - } - } else while (i < len) { - self.args[pos++] = self.args[i++]; - } - last = pos; - break; - } - var trim = i >= fn.argnames.length; - if (trim || (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(fn.argnames[i], _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.UNUSED)) { - var node = self.args[i].drop_side_effect_free(compressor); - if (node) { - self.args[pos++] = node; - } else if (!trim) { - self.args[pos++] = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self.args[i], { - value: 0 - }); - continue; - } - } else { - self.args[pos++] = self.args[i]; - } - last = pos; - } - self.args.length = last; - } - - if ( - exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot - && exp.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && exp.expression.name === "console" - && exp.expression.definition().undeclared - && exp.property === "assert" - ) { - const condition = self.args[0]; - if (condition) { - const value = condition.evaluate(compressor); - - if (value === 1 || value === true) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self); - } - } - } - - if (compressor.option("unsafe") && !exp.contains_optional()) { - if (exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot && exp.start.value === "Array" && exp.property === "from" && self.args.length === 1) { - const [argument] = self.args; - if (argument instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, argument, { - elements: argument.elements - }).optimize(compressor); - } - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undeclared_ref)(exp)) switch (exp.name) { - case "Array": - if (self.args.length != 1) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, self, { - elements: self.args - }).optimize(compressor); - } else if (self.args[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && self.args[0].value <= 11) { - const elements = []; - for (let i = 0; i < self.args[0].value; i++) elements.push(new _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Hole); - return new _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array({ elements }); - } - break; - case "Object": - if (self.args.length == 0) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, self, { - properties: [] - }); - } - break; - case "String": - if (self.args.length == 0) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { - value: "" - }); - if (self.args.length <= 1) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - left: self.args[0], - operator: "+", - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { value: "" }) - }).optimize(compressor); - break; - case "Number": - if (self.args.length == 0) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: 0 - }); - if (self.args.length == 1 && compressor.option("unsafe_math")) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - expression: self.args[0], - operator: "+" - }).optimize(compressor); - } - break; - case "Symbol": - if (self.args.length == 1 && self.args[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String && compressor.option("unsafe_symbols")) - self.args.length = 0; - break; - case "Boolean": - if (self.args.length == 0) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_False, self); - if (self.args.length == 1) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - expression: self.args[0], - operator: "!" - }), - operator: "!" - }).optimize(compressor); - break; - case "RegExp": - var params = []; - if (self.args.length >= 1 - && self.args.length <= 2 - && self.args.every((arg) => { - var value = arg.evaluate(compressor); - params.push(value); - return arg !== value; - }) - && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.regexp_is_safe)(params[0]) - ) { - let [ source, flags ] = params; - source = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.regexp_source_fix)(new RegExp(source).source); - const rx = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp, self, { - value: { source, flags } - }); - if (rx._eval(compressor) !== rx) { - return rx; - } - } - break; - } else if (exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot) switch(exp.property) { - case "toString": - if (self.args.length == 0 && !exp.expression.may_throw_on_access(compressor)) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { value: "" }), - operator: "+", - right: exp.expression - }).optimize(compressor); - } - break; - case "join": - if (exp.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array) EXIT: { - var separator; - if (self.args.length > 0) { - separator = self.args[0].evaluate(compressor); - if (separator === self.args[0]) break EXIT; // not a constant - } - var elements = []; - var consts = []; - for (var i = 0, len = exp.expression.elements.length; i < len; i++) { - var el = exp.expression.elements[i]; - if (el instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) break EXIT; - var value = el.evaluate(compressor); - if (value !== el) { - consts.push(value); - } else { - if (consts.length > 0) { - elements.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { - value: consts.join(separator) - })); - consts.length = 0; - } - elements.push(el); - } - } - if (consts.length > 0) { - elements.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { - value: consts.join(separator) - })); - } - if (elements.length == 0) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { value: "" }); - if (elements.length == 1) { - if (elements[0].is_string(compressor)) { - return elements[0]; - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, elements[0], { - operator : "+", - left : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { value: "" }), - right : elements[0] - }); - } - if (separator == "") { - var first; - if (elements[0].is_string(compressor) - || elements[1].is_string(compressor)) { - first = elements.shift(); - } else { - first = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { value: "" }); - } - return elements.reduce(function(prev, el) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, el, { - operator : "+", - left : prev, - right : el - }); - }, first).optimize(compressor); - } - // need this awkward cloning to not affect original element - // best_of will decide which one to get through. - var node = self.clone(); - node.expression = node.expression.clone(); - node.expression.expression = node.expression.expression.clone(); - node.expression.expression.elements = elements; - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, self, node); - } - break; - case "charAt": - if (exp.expression.is_string(compressor)) { - var arg = self.args[0]; - var index = arg ? arg.evaluate(compressor) : 0; - if (index !== arg) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, exp, { - expression: exp.expression, - property: (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(index | 0, arg || exp) - }).optimize(compressor); - } - } - break; - case "apply": - if (self.args.length == 2 && self.args[1] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array) { - var args = self.args[1].elements.slice(); - args.unshift(self.args[0]); - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, self, { - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, exp, { - expression: exp.expression, - optional: false, - property: "call" - }), - args: args - }).optimize(compressor); - } - break; - case "call": - var func = exp.expression; - if (func instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - func = func.fixed_value(); - } - if (func instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda && !func.contains_this()) { - return (self.args.length ? (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(this, [ - self.args[0], - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, self, { - expression: exp.expression, - args: self.args.slice(1) - }) - ]) : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, self, { - expression: exp.expression, - args: [] - })).optimize(compressor); - } - break; - } - } - - if (compressor.option("unsafe_Function") - && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undeclared_ref)(exp) - && exp.name == "Function") { - // new Function() => function(){} - if (self.args.length == 0) return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_empty_function)(self).optimize(compressor); - if (self.args.every((x) => x instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String)) { - // quite a corner-case, but we can handle it: - // https://github.com/mishoo/UglifyJS2/issues/203 - // if the code argument is a constant, then we can minify it. - try { - var code = "n(function(" + self.args.slice(0, -1).map(function(arg) { - return arg.value; - }).join(",") + "){" + self.args[self.args.length - 1].value + "})"; - var ast = (0,_parse_js__WEBPACK_IMPORTED_MODULE_4__.parse)(code); - var mangle = compressor.mangle_options(); - ast.figure_out_scope(mangle); - var comp = new Compressor(compressor.options, { - mangle_options: compressor._mangle_options - }); - ast = ast.transform(comp); - ast.figure_out_scope(mangle); - ast.compute_char_frequency(mangle); - ast.mangle_names(mangle); - var fun; - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(ast, node => { - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_14__.is_func_expr)(node)) { - fun = node; - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - } - }); - var code = (0,_output_js__WEBPACK_IMPORTED_MODULE_5__.OutputStream)(); - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement.prototype._codegen.call(fun, fun, code); - self.args = [ - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { - value: fun.argnames.map(function(arg) { - return arg.print_to_string(); - }).join(",") - }), - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self.args[self.args.length - 1], { - value: code.get().replace(/^{|}$/g, "") - }) - ]; - return self; - } catch (ex) { - if (!(ex instanceof _parse_js__WEBPACK_IMPORTED_MODULE_4__.JS_Parse_Error)) { - throw ex; - } - - // Otherwise, it crashes at runtime. Or maybe it's nonstandard syntax. - } - } - } - - return (0,_inline_js__WEBPACK_IMPORTED_MODULE_16__.inline_into_call)(self, compressor); -}); - -/** Does this node contain optional property access or optional call? */ -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.DEFMETHOD("contains_optional", function() { - if ( - this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - || this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - || this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain - ) { - if (this.optional) { - return true; - } else { - return this.expression.contains_optional(); - } - } else { - return false; - } -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_New, function(self, compressor) { - if ( - compressor.option("unsafe") && - (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undeclared_ref)(self.expression) && - ["Object", "RegExp", "Function", "Error", "Array"].includes(self.expression.name) - ) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, self, self).transform(compressor); - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(self, compressor) { - if (!compressor.option("side_effects")) return self; - var expressions = []; - filter_for_side_effects(); - var end = expressions.length - 1; - trim_right_for_undefined(); - if (end == 0) { - self = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.maintain_this_binding)(compressor.parent(), compressor.self(), expressions[0]); - if (!(self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence)) self = self.optimize(compressor); - return self; - } - self.expressions = expressions; - return self; - - function filter_for_side_effects() { - var first = (0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__.first_in_statement)(compressor); - var last = self.expressions.length - 1; - self.expressions.forEach(function(expr, index) { - if (index < last) expr = expr.drop_side_effect_free(compressor, first); - if (expr) { - (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.merge_sequence)(expressions, expr); - first = false; - } - }); - } - - function trim_right_for_undefined() { - while (end > 0 && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(expressions[end], compressor)) end--; - if (end < expressions.length - 1) { - expressions[end] = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - operator : "void", - expression : expressions[end] - }); - expressions.length = end + 1; - } - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - var x = this.expression.expressions.slice(); - var e = this.clone(); - e.expression = x.pop(); - x.push(e); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(this, x).optimize(compressor); - } - } - return this; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPostfix, function(self, compressor) { - return self.lift_sequences(compressor); -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, function(self, compressor) { - var e = self.expression; - if ( - self.operator == "delete" && - !( - e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef || - e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess || - e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain || - (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.is_identifier_atom)(e) - ) - ) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [e, (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, self)]).optimize(compressor); - } - var seq = self.lift_sequences(compressor); - if (seq !== self) { - return seq; - } - if (compressor.option("side_effects") && self.operator == "void") { - e = e.drop_side_effect_free(compressor); - if (e) { - self.expression = e; - return self; - } else { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self).optimize(compressor); - } - } - if (compressor.in_boolean_context()) { - switch (self.operator) { - case "!": - if (e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix && e.operator == "!") { - // !!foo ==> foo, if we're in boolean context - return e.expression; - } - if (e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary) { - self = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, self, e.negate(compressor, (0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__.first_in_statement)(compressor))); - } - break; - case "typeof": - // typeof always returns a non-empty string, thus it's - // always true in booleans - // And we don't need to check if it's undeclared, because in typeof, that's OK - return (e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, self) : (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - e, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, self) - ])).optimize(compressor); - } - } - if (self.operator == "-" && e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity) { - e = e.transform(compressor); - } - if (e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && (self.operator == "+" || self.operator == "-") - && (e.operator == "*" || e.operator == "/" || e.operator == "%")) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: e.operator, - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, e.left, { - operator: self.operator, - expression: e.left - }), - right: e.right - }); - } - - if (compressor.option("evaluate")) { - // ~~x => x (in 32-bit context) - // ~~{32 bit integer} => {32 bit integer} - if ( - self.operator === "~" - && self.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && self.expression.operator === "~" - && (compressor.in_32_bit_context(false) || self.expression.expression.is_32_bit_integer(compressor)) - ) { - return self.expression.expression; - } - - // ~(x ^ y) => x ^ ~y - if ( - self.operator === "~" - && e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && e.operator === "^" - ) { - if (e.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix && e.left.operator === "~") { - // ~(~x ^ y) => x ^ y - e.left = e.left.bitwise_negate(compressor, true); - } else { - e.right = e.right.bitwise_negate(compressor, true); - } - return e; - } - } - - if ( - self.operator != "-" - // avoid infinite recursion of numerals - || !(e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BigInt) - ) { - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(ev, self).optimize(compressor); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, ev, self); - } - } - return self; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - var x = this.left.expressions.slice(); - var e = this.clone(); - e.left = x.pop(); - x.push(e); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(this, x).optimize(compressor); - } - if (this.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence && !this.left.has_side_effects(compressor)) { - var assign = this.operator == "=" && this.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef; - var x = this.right.expressions; - var last = x.length - 1; - for (var i = 0; i < last; i++) { - if (!assign && x[i].has_side_effects(compressor)) break; - } - if (i == last) { - x = x.slice(); - var e = this.clone(); - e.right = x.pop(); - x.push(e); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(this, x).optimize(compressor); - } else if (i > 0) { - var e = this.clone(); - e.right = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(this.right, x.slice(i)); - x = x.slice(0, i); - x.push(e); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(this, x).optimize(compressor); - } - } - } - return this; -}); - -var commutativeOperators = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("== === != !== * & | ^"); -function is_object(node) { - return node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class; -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(self, compressor) { - function reversible() { - return self.left.is_constant() - || self.right.is_constant() - || !self.left.has_side_effects(compressor) - && !self.right.has_side_effects(compressor); - } - function reverse(op) { - if (reversible()) { - if (op) self.operator = op; - var tmp = self.left; - self.left = self.right; - self.right = tmp; - } - } - if (compressor.option("lhs_constants") && commutativeOperators.has(self.operator)) { - if (self.right.is_constant() - && !self.left.is_constant()) { - // if right is a constant, whatever side effects the - // left side might have could not influence the - // result. hence, force switch. - - if (!(self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && _parse_js__WEBPACK_IMPORTED_MODULE_4__.PRECEDENCE[self.left.operator] >= _parse_js__WEBPACK_IMPORTED_MODULE_4__.PRECEDENCE[self.operator])) { - reverse(); - } - } - } - self = self.lift_sequences(compressor); - if (compressor.option("comparisons")) switch (self.operator) { - case "===": - case "!==": - var is_strict_comparison = true; - if ( - (self.left.is_string(compressor) && self.right.is_string(compressor)) || - (self.left.is_number(compressor) && self.right.is_number(compressor)) || - (self.left.is_bigint(compressor) && self.right.is_bigint(compressor)) || - (self.left.is_boolean() && self.right.is_boolean()) || - self.left.equivalent_to(self.right) - ) { - self.operator = self.operator.substr(0, 2); - } - - // XXX: intentionally falling down to the next case - case "==": - case "!=": - // void 0 == x => null == x - if (!is_strict_comparison && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(self.left, compressor)) { - self.left = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null, self.left); - // x == void 0 => x == null - } else if (!is_strict_comparison && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(self.right, compressor)) { - self.right = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null, self.right); - } else if (compressor.option("typeofs") - // "undefined" == typeof x => undefined === x - && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String - && self.left.value == "undefined" - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && self.right.operator == "typeof") { - var expr = self.right.expression; - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef ? expr.is_declared(compressor) - : !(expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess && compressor.option("ie8"))) { - self.right = expr; - self.left = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self.left).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } else if (compressor.option("typeofs") - // typeof x === "undefined" => x === undefined - && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && self.left.operator == "typeof" - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String - && self.right.value == "undefined") { - var expr = self.left.expression; - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef ? expr.is_declared(compressor) - : !(expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess && compressor.option("ie8"))) { - self.left = expr; - self.right = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self.right).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } else if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - // obj !== obj => false - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && self.left.definition() === self.right.definition() - && is_object(self.left.fixed_value())) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(self.operator[0] == "=" ? _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True : _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_False, self); - } else if (self.left.is_32_bit_integer(compressor) && self.right.is_32_bit_integer(compressor)) { - const not = node => (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, node, { - operator: "!", - expression: node - }); - const booleanify = (node, truthy) => { - if (truthy) { - return compressor.in_boolean_context() - ? node - : not(not(node)); - } else { - return not(node); - } - }; - - // The only falsy 32-bit integer is 0 - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && self.left.value === 0) { - return booleanify(self.right, self.operator[0] === "!"); - } - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && self.right.value === 0) { - return booleanify(self.left, self.operator[0] === "!"); - } - - // Mask all-bits check - // (x & 0xFF) != 0xFF => !(~x & 0xFF) - let and_op, x, mask; - if ( - (and_op = - self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary ? self.left - : self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary ? self.right : null) - && (mask = and_op === self.left ? self.right : self.left) - && and_op.operator === "&" - && mask instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number - && mask.is_32_bit_integer(compressor) - && (x = - and_op.left.equivalent_to(mask) ? and_op.right - : and_op.right.equivalent_to(mask) ? and_op.left : null) - ) { - let optimized = booleanify((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "&", - left: mask, - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - operator: "~", - expression: x - }) - }), self.operator[0] === "!"); - - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, optimized, self); - } - } - break; - case "&&": - case "||": - var lhs = self.left; - if (lhs.operator == self.operator) { - lhs = lhs.right; - } - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && lhs.operator == (self.operator == "&&" ? "!==" : "===") - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && lhs.operator == self.right.operator - && ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(lhs.left, compressor) && self.right.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null - || lhs.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(self.right.left, compressor)) - && !lhs.right.has_side_effects(compressor) - && lhs.right.equivalent_to(self.right.right)) { - var combined = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: lhs.operator.slice(0, -1), - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null, self), - right: lhs.right - }); - if (lhs !== self.left) { - combined = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator, - left: self.left.left, - right: combined - }); - } - return combined; - } - break; - } - if (self.operator == "+" && compressor.in_boolean_context()) { - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if (ll && typeof ll == "string") { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - self.right, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, self) - ]).optimize(compressor); - } - if (rr && typeof rr == "string") { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - self.left, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, self) - ]).optimize(compressor); - } - } - if (compressor.option("comparisons") && self.is_boolean()) { - if (!(compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary) - || compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign) { - var negated = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - operator: "!", - expression: self.negate(compressor, (0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__.first_in_statement)(compressor)) - }); - self = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, self, negated); - } - if (compressor.option("unsafe_comps")) { - switch (self.operator) { - case "<": reverse(">"); break; - case "<=": reverse(">="); break; - } - } - } - if (self.operator == "+") { - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String - && self.right.getValue() == "" - && self.left.is_string(compressor)) { - return self.left; - } - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String - && self.left.getValue() == "" - && self.right.is_string(compressor)) { - return self.right; - } - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.left.operator == "+" - && self.left.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String - && self.left.left.getValue() == "" - && self.right.is_string(compressor)) { - self.left = self.left.right; - return self; - } - } - if (compressor.option("evaluate")) { - switch (self.operator) { - case "&&": - var ll = (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(self.left, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.TRUTHY) - ? true - : (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(self.left, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.FALSY) - ? false - : self.left.evaluate(compressor); - if (!ll) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.maintain_this_binding)(compressor.parent(), compressor.self(), self.left).optimize(compressor); - } else if (!(ll instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ self.left, self.right ]).optimize(compressor); - } - var rr = self.right.evaluate(compressor); - if (!rr) { - if (compressor.in_boolean_context()) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - self.left, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_False, self) - ]).optimize(compressor); - } else { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.set_flag)(self, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.FALSY); - } - } else if (!(rr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - var parent = compressor.parent(); - if (parent.operator == "&&" && parent.left === compressor.self() || compressor.in_boolean_context()) { - return self.left.optimize(compressor); - } - } - // x || false && y ---> x ? y : false - if (self.left.operator == "||") { - var lr = self.left.right.evaluate(compressor); - if (!lr) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition: self.left.left, - consequent: self.right, - alternative: self.left.right - }).optimize(compressor); - } - break; - case "||": - var ll = (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(self.left, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.TRUTHY) - ? true - : (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.has_flag)(self.left, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.FALSY) - ? false - : self.left.evaluate(compressor); - if (!ll) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ self.left, self.right ]).optimize(compressor); - } else if (!(ll instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.maintain_this_binding)(compressor.parent(), compressor.self(), self.left).optimize(compressor); - } - var rr = self.right.evaluate(compressor); - if (!rr) { - var parent = compressor.parent(); - if (parent.operator == "||" && parent.left === compressor.self() || compressor.in_boolean_context()) { - return self.left.optimize(compressor); - } - } else if (!(rr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - if (compressor.in_boolean_context()) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - self.left, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, self) - ]).optimize(compressor); - } else { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.set_flag)(self, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.TRUTHY); - } - } - if (self.left.operator == "&&") { - var lr = self.left.right.evaluate(compressor); - if (lr && !(lr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition: self.left.left, - consequent: self.left.right, - alternative: self.right - }).optimize(compressor); - } - break; - case "??": - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_nullish)(self.left, compressor)) { - return self.right; - } - - var ll = self.left.evaluate(compressor); - if (!(ll instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node)) { - // if we know the value for sure we can simply compute right away. - return ll == null ? self.right : self.left; - } - - if (compressor.in_boolean_context()) { - const rr = self.right.evaluate(compressor); - if (!(rr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) && !rr) { - return self.left; - } - } - } - var associative = true; - switch (self.operator) { - case "+": - // (x + "foo") + "bar" => x + "foobar" - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.left.operator == "+" - && self.left.is_string(compressor)) { - var binary = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "+", - left: self.left.right, - right: self.right, - }); - var r = binary.optimize(compressor); - if (binary !== r) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "+", - left: self.left.left, - right: r - }); - } - } - // (x + "foo") + ("bar" + y) => (x + "foobar") + y - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.left.operator == "+" - && self.left.is_string(compressor) - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.right.operator == "+" - && self.right.is_string(compressor)) { - var binary = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "+", - left: self.left.right, - right: self.right.left, - }); - var m = binary.optimize(compressor); - if (binary !== m) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "+", - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.left, { - operator: "+", - left: self.left.left, - right: m - }), - right: self.right.right - }); - } - } - // a + -b => a - b - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && self.right.operator == "-" - && self.left.is_number_or_bigint(compressor)) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "-", - left: self.left, - right: self.right.expression - }); - break; - } - // -a + b => b - a - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && self.left.operator == "-" - && reversible() - && self.right.is_number_or_bigint(compressor)) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "-", - left: self.right, - right: self.left.expression - }); - break; - } - // `foo${bar}baz` + 1 => `foo${bar}baz1` - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString) { - var l = self.left; - var r = self.right.evaluate(compressor); - if (r != self.right) { - l.segments[l.segments.length - 1].value += String(r); - return l; - } - } - // 1 + `foo${bar}baz` => `1foo${bar}baz` - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString) { - var r = self.right; - var l = self.left.evaluate(compressor); - if (l != self.left) { - r.segments[0].value = String(l) + r.segments[0].value; - return r; - } - } - // `1${bar}2` + `foo${bar}baz` => `1${bar}2foo${bar}baz` - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString) { - var l = self.left; - var segments = l.segments; - var r = self.right; - segments[segments.length - 1].value += r.segments[0].value; - for (var i = 1; i < r.segments.length; i++) { - segments.push(r.segments[i]); - } - return l; - } - case "*": - associative = compressor.option("unsafe_math"); - case "&": - case "|": - case "^": - // a + +b => +b + a - if ( - self.left.is_number_or_bigint(compressor) - && self.right.is_number_or_bigint(compressor) - && reversible() - && !(self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.left.operator != self.operator - && _parse_js__WEBPACK_IMPORTED_MODULE_4__.PRECEDENCE[self.left.operator] >= _parse_js__WEBPACK_IMPORTED_MODULE_4__.PRECEDENCE[self.operator])) { - var reversed = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator, - left: self.right, - right: self.left - }); - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && !(self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant)) { - self = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, reversed, self); - } else { - self = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, self, reversed); - } - } - if (associative && self.is_number_or_bigint(compressor)) { - // a + (b + c) => (a + b) + c - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.right.operator == self.operator) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator, - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.left, { - operator: self.operator, - left: self.left, - right: self.right.left, - start: self.left.start, - end: self.right.left.end - }), - right: self.right.right - }); - } - // (n + 2) + 3 => 5 + n - // (2 * n) * 3 => 6 + n - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.left.operator == self.operator) { - if (self.left.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator, - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.left, { - operator: self.operator, - left: self.left.left, - right: self.right, - start: self.left.left.start, - end: self.right.end - }), - right: self.left.right - }); - } else if (self.left.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator, - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.left, { - operator: self.operator, - left: self.left.right, - right: self.right, - start: self.left.right.start, - end: self.right.end - }), - right: self.left.left - }); - } - } - // (a | 1) | (2 | d) => (3 | a) | b - if (self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.left.operator == self.operator - && self.left.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.right.operator == self.operator - && self.right.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator, - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.left, { - operator: self.operator, - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.left.left, { - operator: self.operator, - left: self.left.right, - right: self.right.left, - start: self.left.right.start, - end: self.right.left.end - }), - right: self.left.left - }), - right: self.right.right - }); - } - } - } - - // bitwise ops - if (_inference_js__WEBPACK_IMPORTED_MODULE_12__.bitwise_binop.has(self.operator)) { - // Use De Morgan's laws - // z & (X | y) - // => z & X (given y & z === 0) - // => z & X | {y & z} (given y & z !== 0) - let y, z, x_node, y_node, z_node = self.left; - if ( - self.operator === "&" - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.right.operator === "|" - && typeof (z = self.left.evaluate(compressor)) === "number" - ) { - if (typeof (y = self.right.right.evaluate(compressor)) === "number") { - // z & (X | y) - x_node = self.right.left; - y_node = self.right.right; - } else if (typeof (y = self.right.left.evaluate(compressor)) === "number") { - // z & (y | X) - x_node = self.right.right; - y_node = self.right.left; - } - - if (x_node && y_node) { - if ((y & z) === 0) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator, - left: z_node, - right: x_node - }); - } else { - const reordered_ops = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "|", - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "&", - left: x_node, - right: z_node - }), - right: (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(y & z, y_node), - }); - - self = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, self, reordered_ops); - } - } - } - - // x | x => 0 | x - // x & x => 0 | x - if ( - (self.operator === "|" || self.operator === "&") - && self.left.equivalent_to(self.right) - && !self.left.has_side_effects(compressor) - && compressor.in_32_bit_context(true) - ) { - self.left = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { value: 0 }); - self.operator = "|"; - } - - // ~x ^ ~y => x ^ y - if ( - self.operator === "^" - && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && self.left.operator === "~" - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && self.right.operator === "~" - ) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "^", - left: self.left.expression, - right: self.right.expression - }); - } - - - // Shifts that do nothing - // {anything} >> 0 => {anything} | 0 - // {anything} << 0 => {anything} | 0 - if ( - (self.operator === "<<" || self.operator === ">>") - && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && self.right.value === 0 - ) { - self.operator = "|"; - } - - // Find useless to-bitwise conversions - // {32 bit integer} | 0 => {32 bit integer} - // {32 bit integer} ^ 0 => {32 bit integer} - const zero_side = self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && self.right.value === 0 ? self.right - : self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && self.left.value === 0 ? self.left - : null; - const non_zero_side = zero_side && (zero_side === self.right ? self.left : self.right); - if ( - zero_side - && (self.operator === "|" || self.operator === "^") - && (non_zero_side.is_32_bit_integer(compressor) || compressor.in_32_bit_context(true)) - ) { - return non_zero_side; - } - - // {anything} & 0 => 0 - if ( - zero_side - && self.operator === "&" - && !non_zero_side.has_side_effects(compressor) - && non_zero_side.is_32_bit_integer(compressor) - ) { - return zero_side; - } - - // ~0 is all ones, as well as -1. - // We can ellide some operations with it. - const is_full_mask = (node) => - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && node.value === -1 - || - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && node.operator === "-" - && node.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number - && node.expression.value === 1; - - const full_mask = is_full_mask(self.right) ? self.right - : is_full_mask(self.left) ? self.left - : null; - const other_side = (full_mask === self.right ? self.left : self.right); - - // {32 bit integer} & -1 => {32 bit integer} - if ( - full_mask - && self.operator === "&" - && ( - other_side.is_32_bit_integer(compressor) - || compressor.in_32_bit_context(true) - ) - ) { - return other_side; - } - - // {anything} ^ -1 => ~{anything} - if ( - full_mask - && self.operator === "^" - && ( - other_side.is_32_bit_integer(compressor) - || compressor.in_32_bit_context(true) - ) - ) { - return other_side.bitwise_negate(compressor); - } - } - } - // x && (y && z) ==> x && y && z - // x || (y || z) ==> x || y || z - // x + ("y" + z) ==> x + "y" + z - // "x" + (y + "z")==> "x" + y + "z" - if (self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && self.right.operator == self.operator - && (_inference_js__WEBPACK_IMPORTED_MODULE_12__.lazy_op.has(self.operator) - || (self.operator == "+" - && (self.right.left.is_string(compressor) - || (self.left.is_string(compressor) - && self.right.right.is_string(compressor))))) - ) { - self.left = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self.left, { - operator : self.operator, - left : self.left.transform(compressor), - right : self.right.left.transform(compressor) - }); - self.right = self.right.right.transform(compressor); - return self.transform(compressor); - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(ev, self).optimize(compressor); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, ev, self); - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolExport, function(self) { - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, function(self, compressor) { - if ( - !compressor.option("ie8") - && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undeclared_ref)(self) - && !compressor.find_parent(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With) - ) { - switch (self.name) { - case "undefined": - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self).optimize(compressor); - case "NaN": - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NaN, self).optimize(compressor); - case "Infinity": - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity, self).optimize(compressor); - } - } - - if (compressor.option("reduce_vars") && !compressor.is_lhs()) { - return (0,_inline_js__WEBPACK_IMPORTED_MODULE_16__.inline_into_symbolref)(self, compressor); - } else { - return self; - } -}); - -function is_atomic(lhs, self) { - return lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef || lhs.TYPE === self.TYPE; -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, function(self, compressor) { - if (compressor.option("unsafe_undefined")) { - var undef = find_variable(compressor, "undefined"); - if (undef) { - var ref = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, self, { - name : "undefined", - scope : undef.scope, - thedef : undef - }); - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.set_flag)(ref, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.UNDEFINED); - return ref; - } - } - var lhs = compressor.is_lhs(); - if (lhs && is_atomic(lhs, self)) return self; - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - operator: "void", - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: 0 - }) - }); -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity, function(self, compressor) { - var lhs = compressor.is_lhs(); - if (lhs && is_atomic(lhs, self)) return self; - if ( - compressor.option("keep_infinity") - && !(lhs && !is_atomic(lhs, self)) - && !find_variable(compressor, "Infinity") - ) { - return self; - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "/", - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: 1 - }), - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: 0 - }) - }); -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NaN, function(self, compressor) { - var lhs = compressor.is_lhs(); - if (lhs && !is_atomic(lhs, self) - || find_variable(compressor, "NaN")) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "/", - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: 0 - }), - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: 0 - }) - }); - } - return self; -}); - -const ASSIGN_OPS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("+ - / * % >> << >>> | ^ &"); -const ASSIGN_OPS_COMMUTATIVE = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("* | ^ &"); -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(self, compressor) { - if (self.logical) { - return self.lift_sequences(compressor); - } - - var def; - // x = x ---> x - if ( - self.operator === "=" - && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && self.left.name !== "arguments" - && !(def = self.left.definition()).undeclared - && self.right.equivalent_to(self.left) - ) { - return self.right; - } - - if (compressor.option("dead_code") - && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && (def = self.left.definition()).scope === compressor.find_parent(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda)) { - var level = 0, node, parent = self; - do { - node = parent; - parent = compressor.parent(level++); - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit) { - if (in_try(level, parent)) break; - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_14__.is_reachable)(def.scope, [ def ])) break; - if (self.operator == "=") return self.right; - def.fixed = false; - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: self.operator.slice(0, -1), - left: self.left, - right: self.right - }).optimize(compressor); - } - } while (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && parent.right === node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence && parent.tail_node() === node); - } - self = self.lift_sequences(compressor); - - if (self.operator == "=" && self.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef && self.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary) { - // x = expr1 OP expr2 - if (self.right.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && self.right.left.name == self.left.name - && ASSIGN_OPS.has(self.right.operator)) { - // x = x - 2 ---> x -= 2 - self.operator = self.right.operator + "="; - self.right = self.right.right; - } else if (self.right.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && self.right.right.name == self.left.name - && ASSIGN_OPS_COMMUTATIVE.has(self.right.operator) - && !self.right.left.has_side_effects(compressor)) { - // x = 2 & x ---> x &= 2 - self.operator = self.right.operator + "="; - self.right = self.right.left; - } - } - return self; - - function in_try(level, node) { - function may_assignment_throw() { - const right = self.right; - self.right = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null, right); - const may_throw = node.may_throw(compressor); - self.right = right; - - return may_throw; - } - - var stop_at = self.left.definition().scope.get_defun_scope(); - var parent; - while ((parent = compressor.parent(level++)) !== stop_at) { - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try) { - if (parent.bfinally) return true; - if (parent.bcatch && may_assignment_throw()) return true; - } - } - } -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefaultAssign, function(self, compressor) { - if (!compressor.option("evaluate")) { - return self; - } - var evaluateRight = self.right.evaluate(compressor); - - // `[x = undefined] = foo` ---> `[x] = foo` - // `(arg = undefined) => ...` ---> `(arg) => ...` (unless `keep_fargs`) - // `((arg = undefined) => ...)()` ---> `((arg) => ...)()` - let lambda, iife; - if (evaluateRight === undefined) { - if ( - (lambda = compressor.parent()) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda - ? ( - compressor.option("keep_fargs") === false - || (iife = compressor.parent(1)).TYPE === "Call" - && iife.expression === lambda - ) - : true - ) { - self = self.left; - } - } else if (evaluateRight !== self.right) { - evaluateRight = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(evaluateRight, self.right); - self.right = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of_expression)(evaluateRight, self.right); - } - - return self; -}); - -function is_nullish_check(check, check_subject, compressor) { - if (check_subject.may_throw(compressor)) return false; - - let nullish_side; - - // foo == null - if ( - check instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && check.operator === "==" - // which side is nullish? - && ( - (nullish_side = (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_nullish)(check.left, compressor) && check.left) - || (nullish_side = (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_nullish)(check.right, compressor) && check.right) - ) - // is the other side the same as the check_subject - && ( - nullish_side === check.left - ? check.right - : check.left - ).equivalent_to(check_subject) - ) { - return true; - } - - // foo === null || foo === undefined - if (check instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && check.operator === "||") { - let null_cmp; - let undefined_cmp; - - const find_comparison = cmp => { - if (!( - cmp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && (cmp.operator === "===" || cmp.operator === "==") - )) { - return false; - } - - let found = 0; - let defined_side; - - if (cmp.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null) { - found++; - null_cmp = cmp; - defined_side = cmp.right; - } - if (cmp.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null) { - found++; - null_cmp = cmp; - defined_side = cmp.left; - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(cmp.left, compressor)) { - found++; - undefined_cmp = cmp; - defined_side = cmp.right; - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(cmp.right, compressor)) { - found++; - undefined_cmp = cmp; - defined_side = cmp.left; - } - - if (found !== 1) { - return false; - } - - if (!defined_side.equivalent_to(check_subject)) { - return false; - } - - return true; - }; - - if (!find_comparison(check.left)) return false; - if (!find_comparison(check.right)) return false; - - if (null_cmp && undefined_cmp && null_cmp !== undefined_cmp) { - return true; - } - } - - return false; -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(self, compressor) { - if (!compressor.option("conditionals")) return self; - // This looks like lift_sequences(), should probably be under "sequences" - if (self.condition instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - var expressions = self.condition.expressions.slice(); - self.condition = expressions.pop(); - expressions.push(self); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, expressions); - } - var cond = self.condition.evaluate(compressor); - if (cond !== self.condition) { - if (cond) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.maintain_this_binding)(compressor.parent(), compressor.self(), self.consequent); - } else { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.maintain_this_binding)(compressor.parent(), compressor.self(), self.alternative); - } - } - var negated = cond.negate(compressor, (0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_2__.first_in_statement)(compressor)); - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, cond, negated) === negated) { - self = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition: negated, - consequent: self.alternative, - alternative: self.consequent - }); - } - var condition = self.condition; - var consequent = self.consequent; - var alternative = self.alternative; - // x?x:y --> x||y - if (condition instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && consequent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && condition.definition() === consequent.definition()) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "||", - left: condition, - right: alternative - }); - } - // if (foo) exp = something; else exp = something_else; - // | - // v - // exp = foo ? something : something_else; - if ( - consequent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - && alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - && consequent.operator === alternative.operator - && consequent.logical === alternative.logical - && consequent.left.equivalent_to(alternative.left) - && (!self.condition.has_side_effects(compressor) - || consequent.operator == "=" - && !consequent.left.has_side_effects(compressor)) - ) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, self, { - operator: consequent.operator, - left: consequent.left, - logical: consequent.logical, - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition: self.condition, - consequent: consequent.right, - alternative: alternative.right - }) - }); - } - // x ? y(a) : y(b) --> y(x ? a : b) - var arg_index; - if (consequent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && alternative.TYPE === consequent.TYPE - && consequent.args.length > 0 - && consequent.args.length == alternative.args.length - && consequent.expression.equivalent_to(alternative.expression) - && !self.condition.has_side_effects(compressor) - && !consequent.expression.has_side_effects(compressor) - && typeof (arg_index = single_arg_diff()) == "number") { - var node = consequent.clone(); - node.args[arg_index] = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition: self.condition, - consequent: consequent.args[arg_index], - alternative: alternative.args[arg_index] - }); - return node; - } - // a ? b : c ? b : d --> (a || c) ? b : d - if (alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional - && consequent.equivalent_to(alternative.consequent)) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "||", - left: condition, - right: alternative.condition - }), - consequent: consequent, - alternative: alternative.alternative - }).optimize(compressor); - } - - // a == null ? b : a -> a ?? b - if ( - compressor.option("ecma") >= 2020 && - is_nullish_check(condition, alternative, compressor) - ) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "??", - left: alternative, - right: consequent - }).optimize(compressor); - } - - // a ? b : (c, b) --> (a || c), b - if (alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence - && consequent.equivalent_to(alternative.expressions[alternative.expressions.length - 1])) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "||", - left: condition, - right: (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, alternative.expressions.slice(0, -1)) - }), - consequent - ]).optimize(compressor); - } - // a ? b : (c && b) --> (a || c) && b - if (alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && alternative.operator == "&&" - && consequent.equivalent_to(alternative.right)) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "&&", - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "||", - left: condition, - right: alternative.left - }), - right: consequent - }).optimize(compressor); - } - // x?y?z:a:a --> x&&y?z:a - if (consequent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional - && consequent.alternative.equivalent_to(alternative)) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, self, { - condition: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - left: self.condition, - operator: "&&", - right: consequent.condition - }), - consequent: consequent.consequent, - alternative: alternative - }); - } - // x ? y : y --> x, y - if (consequent.equivalent_to(alternative)) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - self.condition, - consequent - ]).optimize(compressor); - } - // x ? y || z : z --> x && y || z - if (consequent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && consequent.operator == "||" - && consequent.right.equivalent_to(alternative)) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "||", - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "&&", - left: self.condition, - right: consequent.left - }), - right: alternative - }).optimize(compressor); - } - - const in_bool = compressor.in_boolean_context(); - if (is_true(self.consequent)) { - if (is_false(self.alternative)) { - // c ? true : false ---> !!c - return booleanize(self.condition); - } - // c ? true : x ---> !!c || x - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "||", - left: booleanize(self.condition), - right: self.alternative - }); - } - if (is_false(self.consequent)) { - if (is_true(self.alternative)) { - // c ? false : true ---> !c - return booleanize(self.condition.negate(compressor)); - } - // c ? false : x ---> !c && x - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition.negate(compressor)), - right: self.alternative - }); - } - if (is_true(self.alternative)) { - // c ? x : true ---> !c || x - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "||", - left: booleanize(self.condition.negate(compressor)), - right: self.consequent - }); - } - if (is_false(self.alternative)) { - // c ? x : false ---> !!c && x - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition), - right: self.consequent - }); - } - - return self; - - function booleanize(node) { - if (node.is_boolean()) return node; - // !!expression - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, node, { - operator: "!", - expression: node.negate(compressor) - }); - } - - // AST_True or !0 - function is_true(node) { - return node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True - || in_bool - && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && node.getValue() - || (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && !node.expression.getValue()); - } - // AST_False or !1 - function is_false(node) { - return node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_False - || in_bool - && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && !node.getValue() - || (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - && node.expression.getValue()); - } - - function single_arg_diff() { - var a = consequent.args; - var b = alternative.args; - for (var i = 0, len = a.length; i < len; i++) { - if (a[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) return; - if (!a[i].equivalent_to(b[i])) { - if (b[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) return; - for (var j = i + 1; j < len; j++) { - if (a[j] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) return; - if (!a[j].equivalent_to(b[j])) return; - } - return i; - } - } - } -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Boolean, function(self, compressor) { - if (compressor.in_boolean_context()) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: +self.value - }); - var p = compressor.parent(); - if (compressor.option("booleans_as_integers")) { - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && (p.operator == "===" || p.operator == "!==")) { - p.operator = p.operator.replace(/=$/, ""); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: +self.value - }); - } - if (compressor.option("booleans")) { - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && (p.operator == "==" - || p.operator == "!=")) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: +self.value - }); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, self, { - operator: "!", - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { - value: 1 - self.value - }) - }); - } - return self; -}); - -function safe_to_flatten(value, compressor) { - if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - value = value.fixed_value(); - } - if (!value) return false; - if (!(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda || value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class)) return true; - if (!(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda && value.contains_this())) return true; - return compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_New; -} - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess.DEFMETHOD("flatten_object", function(key, compressor) { - if (!compressor.option("properties")) return; - if (key === "__proto__") return; - if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DotHash) return; - - var arrows = compressor.option("unsafe_arrows") && compressor.option("ecma") >= 2015; - var expr = this.expression; - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object) { - var props = expr.properties; - - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - - if ("" + (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod ? prop.key.name : prop.key) == key) { - const all_props_flattenable = props.every((p) => - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal - || arrows && p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod && !p.value.is_generator - ) - && !p.computed_key() - ); - - if (!all_props_flattenable) return; - if (!safe_to_flatten(prop.value, compressor)) return; - - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, this, { - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, expr, { - elements: props.map(function(prop) { - var v = prop.value; - if (v instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Accessor) { - v = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function, v, v); - } - - var k = prop.key; - if (k instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node && !(k instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolMethod)) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(prop, [ k, v ]); - } - - return v; - }) - }), - property: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, this, { - value: i - }) - }); - } - } - } -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, function(self, compressor) { - var expr = self.expression; - var prop = self.property; - if (compressor.option("properties")) { - var key = prop.evaluate(compressor); - if (key !== prop) { - if (typeof key == "string") { - if (key == "undefined") { - key = undefined; - } else { - var value = parseFloat(key); - if (value.toString() == key) { - key = value; - } - } - } - prop = self.property = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of_expression)( - prop, - (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(key, prop).transform(compressor) - ); - var property = "" + key; - if ((0,_parse_js__WEBPACK_IMPORTED_MODULE_4__.is_basic_identifier_string)(property) - && property.length <= prop.size() + 1) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, self, { - expression: expr, - optional: self.optional, - property: property, - quote: prop.quote, - }).optimize(compressor); - } - } - } - var fn; - OPT_ARGUMENTS: if (compressor.option("arguments") - && expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && expr.name == "arguments" - && expr.definition().orig.length == 1 - && (fn = expr.scope) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda - && fn.uses_arguments - && !(fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow) - && prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number) { - var index = prop.getValue(); - var params = new Set(); - var argnames = fn.argnames; - for (var n = 0; n < argnames.length; n++) { - if (!(argnames[n] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg)) { - break OPT_ARGUMENTS; // destructuring parameter - bail - } - var param = argnames[n].name; - if (params.has(param)) { - break OPT_ARGUMENTS; // duplicate parameter - bail - } - params.add(param); - } - var argname = fn.argnames[index]; - if (argname && compressor.has_directive("use strict")) { - var def = argname.definition(); - if (!compressor.option("reduce_vars") || def.assignments || def.orig.length > 1) { - argname = null; - } - } else if (!argname && !compressor.option("keep_fargs") && index < fn.argnames.length + 5) { - while (index >= fn.argnames.length) { - argname = fn.create_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg, { - source: fn, - scope: fn, - tentative_name: "argument_" + fn.argnames.length, - }); - fn.argnames.push(argname); - } - } - if (argname) { - var sym = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, self, argname); - sym.reference({}); - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.clear_flag)(argname, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_13__.UNUSED); - return sym; - } - } - if (compressor.is_lhs()) return self; - if (key !== prop) { - var sub = self.flatten_object(property, compressor); - if (sub) { - expr = self.expression = sub.expression; - prop = self.property = sub.property; - } - } - if (compressor.option("properties") && compressor.option("side_effects") - && prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number && expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array) { - var index = prop.getValue(); - var elements = expr.elements; - var retValue = elements[index]; - FLATTEN: if (safe_to_flatten(retValue, compressor)) { - var flatten = true; - var values = []; - for (var i = elements.length; --i > index;) { - var value = elements[i].drop_side_effect_free(compressor); - if (value) { - values.unshift(value); - if (flatten && value.has_side_effects(compressor)) flatten = false; - } - } - if (retValue instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) break FLATTEN; - retValue = retValue instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Hole ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, retValue) : retValue; - if (!flatten) values.unshift(retValue); - while (--i >= 0) { - var value = elements[i]; - if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) break FLATTEN; - value = value.drop_side_effect_free(compressor); - if (value) values.unshift(value); - else index--; - } - if (flatten) { - values.push(retValue); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, values).optimize(compressor); - } else return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, self, { - expression: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, expr, { - elements: values - }), - property: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, prop, { - value: index - }) - }); - } - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(ev, self).optimize(compressor); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, ev, self); - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function (self, compressor) { - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_nullish)(self.expression, compressor)) { - let parent = compressor.parent(); - // It's valid to delete a nullish optional chain, but if we optimized - // this to `delete undefined` then it would appear to be a syntax error - // when we try to optimize the delete. Thankfully, `delete 0` is fine. - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix && parent.operator === "delete") { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(0, self); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self); - } - if ( - self.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - || self.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - ) { - return self; - } else { - // Keep the AST valid, in case the child swapped itself - return self.expression; - } -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, function(self, compressor) { - const parent = compressor.parent(); - if (compressor.is_lhs()) return self; - if (compressor.option("unsafe_proto") - && self.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot - && self.expression.property == "prototype") { - var exp = self.expression.expression; - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undeclared_ref)(exp)) switch (exp.name) { - case "Array": - self.expression = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, self.expression, { - elements: [] - }); - break; - case "Function": - self.expression = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_empty_function)(self.expression); - break; - case "Number": - self.expression = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self.expression, { - value: 0 - }); - break; - case "Object": - self.expression = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, self.expression, { - properties: [] - }); - break; - case "RegExp": - self.expression = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp, self.expression, { - value: { source: "t", flags: "" } - }); - break; - case "String": - self.expression = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self.expression, { - value: "" - }); - break; - } - } - if (!(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call) || !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(parent, _ast_js__WEBPACK_IMPORTED_MODULE_0__._NOINLINE)) { - const sub = self.flatten_object(self.property, compressor); - if (sub) return sub.optimize(compressor); - } - - if (self.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - && parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess) { - return self; - } - - let ev = self.evaluate(compressor); - if (ev !== self) { - ev = (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_node_from_constant)(ev, self).optimize(compressor); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, ev, self); - } - return self; -}); - -function literals_in_boolean_context(self, compressor) { - if (compressor.in_boolean_context()) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.best_of)(compressor, self, (0,_common_js__WEBPACK_IMPORTED_MODULE_14__.make_sequence)(self, [ - self, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, self) - ]).optimize(compressor)); - } - return self; -} - -function inline_array_like_spread(elements) { - for (var i = 0; i < elements.length; i++) { - var el = elements[i]; - if (el instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) { - var expr = el.expression; - if ( - expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array - && !expr.elements.some(elm => elm instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Hole) - ) { - elements.splice(i, 1, ...expr.elements); - // Step back one, as the element at i is now new. - i--; - } - // In array-like spread, spreading a non-iterable value is TypeError. - // We therefore can’t optimize anything else, unlike with object spread. - } - } -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_array_like_spread(self.elements); - return self; -}); - -function inline_object_prop_spread(props) { - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) { - const expr = prop.expression; - if ( - expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object - && expr.properties.every(prop => prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal) - ) { - props.splice(i, 1, ...expr.properties); - // Step back one, as the property at i is now new. - i--; - } else if (( - // `expr.is_constant()` returns `false` for `AST_RegExp`, so need both. - expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant - || expr.is_constant() - ) && !(expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String)) { - // Unlike array-like spread, in object spread, spreading a - // non-iterable value silently does nothing; it is thus safe - // to remove. AST_String is the only iterable constant. - props.splice(i, 1); - i--; - } - } - } -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_object_prop_spread(self.properties); - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp, literals_in_boolean_context); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return, function(self, compressor) { - if (self.value && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(self.value, compressor)) { - self.value = null; - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow, opt_AST_Lambda); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function, function(self, compressor) { - self = opt_AST_Lambda(self, compressor); - if (compressor.option("unsafe_arrows") - && compressor.option("ecma") >= 2015 - && !self.name - && !self.is_generator - && !self.uses_arguments - && !self.pinned()) { - const uses_this = (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(self, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This) return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - }); - if (!uses_this) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow, self, self).optimize(compressor); - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function(self) { - for (let i = 0; i < self.properties.length; i++) { - const prop = self.properties[i]; - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock && prop.body.length == 0) { - self.properties.splice(i, 1); - i--; - } - } - - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock, function(self, compressor) { - (0,_tighten_body_js__WEBPACK_IMPORTED_MODULE_15__.tighten_body)(self.body, compressor); - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Yield, function(self, compressor) { - if (self.expression && !self.is_star && (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_undefined)(self.expression, compressor)) { - self.expression = null; - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString, function(self, compressor) { - if ( - !compressor.option("evaluate") - || compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrefixedTemplateString - ) { - return self; - } - - var segments = []; - for (var i = 0; i < self.segments.length; i++) { - var segment = self.segments[i]; - if (segment instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - var result = segment.evaluate(compressor); - // Evaluate to constant value - // Constant value shorter than ${segment} - if (result !== segment && (result + "").length <= segment.size() + "${}".length) { - // There should always be a previous and next segment if segment is a node - segments[segments.length - 1].value = segments[segments.length - 1].value + result + self.segments[++i].value; - continue; - } - // `before ${`innerBefore ${any} innerAfter`} after` => `before innerBefore ${any} innerAfter after` - // TODO: - // `before ${'test' + foo} after` => `before innerBefore ${any} innerAfter after` - // `before ${foo + 'test} after` => `before innerBefore ${any} innerAfter after` - if (segment instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString) { - var inners = segment.segments; - segments[segments.length - 1].value += inners[0].value; - for (var j = 1; j < inners.length; j++) { - segment = inners[j]; - segments.push(segment); - } - continue; - } - } - segments.push(segment); - } - self.segments = segments; - - // `foo` => "foo" - if (segments.length == 1) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, segments[0]); - } - - if ( - segments.length === 3 - && segments[1] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node - && ( - segments[1].is_string(compressor) - || segments[1].is_number_or_bigint(compressor) - || (0,_inference_js__WEBPACK_IMPORTED_MODULE_12__.is_nullish)(segments[1], compressor) - || compressor.option("unsafe") - ) - ) { - // `foo${bar}` => "foo" + bar - if (segments[2].value === "") { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "+", - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { - value: segments[0].value, - }), - right: segments[1], - }); - } - // `${bar}baz` => bar + "baz" - if (segments[0].value === "") { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, self, { - operator: "+", - left: segments[1], - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, self, { - value: segments[2].value, - }), - }); - } - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrefixedTemplateString, function(self) { - return self; -}); - -// ["p"]:1 ---> p:1 -// [42]:1 ---> 42:1 -function lift_key(self, compressor) { - if (!compressor.option("computed_props")) return self; - // save a comparison in the typical case - if (!(self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant)) return self; - // allow certain acceptable props as not all AST_Constants are true constants - if (self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String || self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number) { - const key = self.key.value.toString(); - - if (key === "__proto__") return self; - if (key == "constructor" - && compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) return self; - if (self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal) { - self.quote = self.key.quote; - self.key = key; - } else if (self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassProperty) { - self.quote = self.key.quote; - self.key = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolClassProperty, self.key, { - name: key, - }); - } else { - self.quote = self.key.quote; - self.key = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolMethod, self.key, { - name: key, - }); - } - } - return self; -} - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectProperty, lift_key); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod, function(self, compressor) { - lift_key(self, compressor); - // p(){return x;} ---> p:()=>x - if (compressor.option("arrows") - && compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object - && !self.value.is_generator - && !self.value.uses_arguments - && !self.value.pinned() - && self.value.body.length == 1 - && self.value.body[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return - && self.value.body[0].value - && !self.value.contains_this()) { - var arrow = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow, self.value, self.value); - arrow.async = self.value.async; - arrow.is_generator = self.value.is_generator; - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal, self, { - key: self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolMethod ? self.key.name : self.key, - value: arrow, - quote: self.quote, - }); - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal, function(self, compressor) { - lift_key(self, compressor); - // p:function(){} ---> p(){} - // p:function*(){} ---> *p(){} - // p:async function(){} ---> async p(){} - // p:()=>{} ---> p(){} - // p:async()=>{} ---> async p(){} - var unsafe_methods = compressor.option("unsafe_methods"); - if (unsafe_methods - && compressor.option("ecma") >= 2015 - && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + ""))) { - var key = self.key; - var value = self.value; - var is_arrow_with_block = value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow - && Array.isArray(value.body) - && !value.contains_this(); - if ((is_arrow_with_block || value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function) && !value.name) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod, self, { - key: key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node ? key : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolMethod, self, { - name: key, - }), - value: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Accessor, value, value), - quote: self.quote, - }); - } - } - return self; -}); - -def_optimize(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring, function(self, compressor) { - if (compressor.option("pure_getters") == true - && compressor.option("unused") - && !self.is_array - && Array.isArray(self.names) - && !is_destructuring_export_decl(compressor) - && !(self.names[self.names.length - 1] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion)) { - var keep = []; - for (var i = 0; i < self.names.length; i++) { - var elem = self.names[i]; - if (!(elem instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal - && typeof elem.key == "string" - && elem.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration - && !should_retain(compressor, elem.value.definition()))) { - keep.push(elem); - } - } - if (keep.length != self.names.length) { - self.names = keep; - } - } - return self; - - function is_destructuring_export_decl(compressor) { - var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/]; - for (var a = 0, p = 0, len = ancestors.length; a < len; p++) { - var parent = compressor.parent(p); - if (!parent) return false; - if (a === 0 && parent.TYPE == "Destructuring") continue; - if (!ancestors[a].test(parent.TYPE)) { - return false; - } - a++; - } - return true; - } - - function should_retain(compressor, def) { - if (def.references.length) return true; - if (!def.global) return false; - if (compressor.toplevel.vars) { - if (compressor.top_retain) { - return compressor.top_retain(def); - } - return false; - } - return true; - } -}); - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/inference.js": -/*!*******************************************************!*\ - !*** ./node_modules/terser/lib/compress/inference.js ***! - \*******************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ aborts: () => (/* binding */ aborts), -/* harmony export */ bitwise_binop: () => (/* binding */ bitwise_binop), -/* harmony export */ is_lhs: () => (/* binding */ is_lhs), -/* harmony export */ is_modified: () => (/* binding */ is_modified), -/* harmony export */ is_nullish: () => (/* binding */ is_nullish), -/* harmony export */ is_nullish_shortcircuited: () => (/* binding */ is_nullish_shortcircuited), -/* harmony export */ is_undeclared_ref: () => (/* binding */ is_undeclared_ref), -/* harmony export */ is_undefined: () => (/* binding */ is_undefined), -/* harmony export */ is_used_in_expression: () => (/* binding */ is_used_in_expression), -/* harmony export */ lazy_op: () => (/* binding */ lazy_op), -/* harmony export */ unary_side_effects: () => (/* binding */ unary_side_effects) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/* harmony import */ var _native_objects_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./native-objects.js */ "./node_modules/terser/lib/compress/native-objects.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - -// Functions and methods to infer certain facts about expressions -// It's not always possible to be 100% sure about something just by static analysis, -// so `true` means yes, and `false` means maybe - -const is_undeclared_ref = (node) => - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef && node.definition().undeclared; - -const bitwise_binop = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("<<< >> << & | ^ ~"); -const lazy_op = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("&& || ??"); -const unary_side_effects = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("delete ++ --"); - -// methods to determine whether an expression has a boolean result type -(function(def_is_boolean) { - const unary_bool = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("! delete"); - const binary_bool = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("in instanceof == != === !== < <= >= >"); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, function() { - return unary_bool.has(this.operator); - }); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function() { - return binary_bool.has(this.operator) - || lazy_op.has(this.operator) - && this.left.is_boolean() - && this.right.is_boolean(); - }); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function() { - return this.consequent.is_boolean() && this.alternative.is_boolean(); - }); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function() { - return this.operator == "=" && this.right.is_boolean(); - }); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function() { - return this.tail_node().is_boolean(); - }); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_is_boolean(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_False, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); -})(function(node, func) { - node.DEFMETHOD("is_boolean", func); -}); - -// methods to determine if an expression has a numeric result type -(function(def_is_number) { - def_is_number(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_is_number(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - const unary = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("+ - ~ ++ --"); - def_is_number(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function(compressor) { - return unary.has(this.operator) && this.expression.is_number(compressor); - }); - const numeric_ops = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("- * / % & | ^ << >> >>>"); - def_is_number(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - if (this.operator === "+") { - // Both sides need to be `number`. Or one is a `number` and the other is number-ish. - return this.left.is_number(compressor) && this.right.is_number_or_bigint(compressor) - || this.right.is_number(compressor) && this.left.is_number_or_bigint(compressor); - } else if (numeric_ops.has(this.operator)) { - return this.left.is_number(compressor) || this.right.is_number(compressor); - } else { - return false; - } - }); - def_is_number(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(compressor) { - return (this.operator === "=" || numeric_ops.has(this.operator.slice(0, -1))) - && this.right.is_number(compressor); - }); - def_is_number(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - return this.tail_node().is_number(compressor); - }); - def_is_number(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor) { - return this.consequent.is_number(compressor) && this.alternative.is_number(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("is_number", func); -}); - -// methods to determine if an expression returns a BigInt -(function(def_is_bigint) { - def_is_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_is_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BigInt, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - const unary = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("+ - ~ ++ --"); - def_is_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function(compressor) { - return unary.has(this.operator) && this.expression.is_bigint(compressor); - }); - const numeric_ops = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("- * / % & | ^ << >>"); - def_is_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - if (this.operator === "+") { - return this.left.is_bigint(compressor) && this.right.is_number_or_bigint(compressor) - || this.right.is_bigint(compressor) && this.left.is_number_or_bigint(compressor); - } else if (numeric_ops.has(this.operator)) { - return this.left.is_bigint(compressor) || this.right.is_bigint(compressor); - } else { - return false; - } - }); - def_is_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(compressor) { - return (numeric_ops.has(this.operator.slice(0, -1)) || this.operator == "=") - && this.right.is_bigint(compressor); - }); - def_is_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - return this.tail_node().is_bigint(compressor); - }); - def_is_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor) { - return this.consequent.is_bigint(compressor) && this.alternative.is_bigint(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("is_bigint", func); -}); - -// methods to determine if an expression is a number or a bigint -(function(def_is_number_or_bigint) { - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BigInt, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - const numeric_unary_ops = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("+ - ~ ++ --"); - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function(_compressor) { - return numeric_unary_ops.has(this.operator); - }); - const numeric_ops = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("- * / % & | ^ << >>"); - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - return this.operator === "+" - ? this.left.is_number_or_bigint(compressor) && this.right.is_number_or_bigint(compressor) - : numeric_ops.has(this.operator); - }); - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(compressor) { - return numeric_ops.has(this.operator.slice(0, -1)) - || this.operator == "=" && this.right.is_number_or_bigint(compressor); - }); - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - return this.tail_node().is_number_or_bigint(compressor); - }); - def_is_number_or_bigint(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor) { - return this.consequent.is_number_or_bigint(compressor) && this.alternative.is_number_or_bigint(compressor); - }); -}(function (node, func) { - node.DEFMETHOD("is_number_or_bigint", func); -})); - - -// methods to determine if an expression is a 32 bit integer (IE results from bitwise ops, or is an integer constant fitting in that size -(function(def_is_32_bit_integer) { - def_is_32_bit_integer(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_is_32_bit_integer(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, function(_compressor) { - return this.value === (this.value | 0); - }); - def_is_32_bit_integer(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, function(compressor) { - return this.operator == "~" ? this.expression.is_number(compressor) - : this.operator === "+" ? this.expression.is_32_bit_integer(compressor) - : false; - }); - def_is_32_bit_integer(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - return bitwise_binop.has(this.operator) - && (this.left.is_number(compressor) || this.right.is_number(compressor)); - }); -}(function (node, func) { - node.DEFMETHOD("is_32_bit_integer", func); -})); - -// methods to determine if an expression has a string result type -(function(def_is_string) { - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, function() { - return this.operator == "typeof"; - }); - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - return this.operator == "+" && - (this.left.is_string(compressor) || this.right.is_string(compressor)); - }); - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(compressor) { - return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor); - }); - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - return this.tail_node().is_string(compressor); - }); - def_is_string(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor) { - return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("is_string", func); -}); - -function is_undefined(node, compressor) { - return ( - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.has_flag)(node, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.UNDEFINED) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix - && node.operator == "void" - && !node.expression.has_side_effects(compressor) - ); -} - -// Is the node explicitly null or undefined. -function is_null_or_undefined(node, compressor) { - let fixed; - return ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null - || is_undefined(node, compressor) - || ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && (fixed = node.definition().fixed) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node - && is_nullish(fixed, compressor) - ) - ); -} - -// Find out if this expression is optionally chained from a base-point that we -// can statically analyze as null or undefined. -function is_nullish_shortcircuited(node, compressor) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call) { - return ( - (node.optional && is_null_or_undefined(node.expression, compressor)) - || is_nullish_shortcircuited(node.expression, compressor) - ); - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain) return is_nullish_shortcircuited(node.expression, compressor); - return false; -} - -// Find out if something is == null, or can short circuit into nullish. -// Used to optimize ?. and ?? -function is_nullish(node, compressor) { - if (is_null_or_undefined(node, compressor)) return true; - return is_nullish_shortcircuited(node, compressor); -} - -// Determine if expression might cause side effects -// If there's a possibility that a node may change something when it's executed, this returns true -(function(def_has_side_effects) { - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - - function any(list, compressor) { - for (var i = list.length; --i >= 0;) - if (list[i].has_side_effects(compressor)) - return true; - return false; - } - - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, function(compressor) { - if ( - !this.is_callee_pure(compressor) - && (!this.expression.is_call_pure(compressor) - || this.expression.has_side_effects(compressor)) - ) { - return true; - } - return any(this.args, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try, function(compressor) { - return this.body.has_side_effects(compressor) - || this.bcatch && this.bcatch.has_side_effects(compressor) - || this.bfinally && this.bfinally.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.body && this.body.has_side_effects(compressor) - || this.alternative && this.alternative.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ImportMeta, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function (compressor) { - if (this.extends && this.extends.has_side_effects(compressor)) { - return true; - } - return any(this.properties, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock, function(compressor) { - return any(this.body, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - return this.left.has_side_effects(compressor) - || this.right.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.consequent.has_side_effects(compressor) - || this.alternative.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function(compressor) { - return unary_side_effects.has(this.operator) - || this.expression.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) && !_native_objects_js__WEBPACK_IMPORTED_MODULE_4__.pure_prop_access_globals.has(this.name); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolClassProperty, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, function(compressor) { - return any(this.properties, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal, function(compressor) { - return ( - this.computed_key() && this.key.has_side_effects(compressor) - || this.value && this.value.has_side_effects(compressor) - ); - }); - def_has_side_effects([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassProperty, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassPrivateProperty, - ], function(compressor) { - return ( - this.computed_key() && this.key.has_side_effects(compressor) - || this.static && this.value && this.value.has_side_effects(compressor) - ); - }); - def_has_side_effects([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateSetter, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectSetter, - ], function(compressor) { - return this.computed_key() && this.key.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, function(compressor) { - return any(this.elements, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, function(compressor) { - if (is_nullish(this, compressor)) { - return this.expression.has_side_effects(compressor); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return true; - } - - return this.expression.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, function(compressor) { - if (is_nullish(this, compressor)) { - return this.expression.has_side_effects(compressor); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return true; - } - - var property = this.property.has_side_effects(compressor); - if (property && this.optional) return true; // "?." is a condition - - return property || this.expression.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function (compressor) { - return this.expression.has_side_effects(compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, function() { - return this.value != null; - }); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateSegment, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_has_side_effects(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString, function(compressor) { - return any(this.segments, compressor); - }); -})(function(node_or_nodes, func) { - for (const node of [].concat(node_or_nodes)) { - node.DEFMETHOD("has_side_effects", func); - } -}); - -// determine if expression may throw -(function(def_may_throw) { - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ImportMeta, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - - function any(list, compressor) { - for (var i = list.length; --i >= 0;) - if (list[i].may_throw(compressor)) - return true; - return false; - } - - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function(compressor) { - if (this.extends && this.extends.may_throw(compressor)) return true; - return any(this.properties, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock, function (compressor) { - return any(this.body, compressor); - }); - - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, function(compressor) { - return any(this.elements, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(compressor) { - if (this.right.may_throw(compressor)) return true; - if (!compressor.has_directive("use strict") - && this.operator == "=" - && this.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - return false; - } - return this.left.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - return this.left.may_throw(compressor) - || this.right.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, function(compressor) { - if (is_nullish(this, compressor)) return false; - if (any(this.args, compressor)) return true; - if (this.is_callee_pure(compressor)) return false; - if (this.expression.may_throw(compressor)) return true; - return !(this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda) - || any(this.expression.body, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor) { - return this.condition.may_throw(compressor) - || this.consequent.may_throw(compressor) - || this.alternative.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, function(compressor) { - return this.condition.may_throw(compressor) - || this.body && this.body.may_throw(compressor) - || this.alternative && this.alternative.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, function(compressor) { - return any(this.properties, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal, function(compressor) { - return ( - this.computed_key() && this.key.may_throw(compressor) - || this.value ? this.value.may_throw(compressor) : false - ); - }); - def_may_throw([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassProperty, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassPrivateProperty, - ], function(compressor) { - return ( - this.computed_key() && this.key.may_throw(compressor) - || this.static && this.value && this.value.may_throw(compressor) - ); - }); - def_may_throw([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectSetter, - ], function(compressor) { - return this.computed_key() && this.key.may_throw(compressor); - }); - def_may_throw([ - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateSetter, - ], _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return, function(compressor) { - return this.value && this.value.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, function(compressor) { - if (is_nullish(this, compressor)) return false; - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, function(compressor) { - if (is_nullish(this, compressor)) return false; - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor) - || this.property.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function(compressor) { - return this.expression.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) && !_native_objects_js__WEBPACK_IMPORTED_MODULE_4__.pure_prop_access_globals.has(this.name); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolClassProperty, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try, function(compressor) { - return this.bcatch ? this.bcatch.may_throw(compressor) : this.body.may_throw(compressor) - || this.bfinally && this.bfinally.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function(compressor) { - if (this.operator == "typeof" && this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) - return false; - return this.expression.may_throw(compressor); - }); - def_may_throw(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, function(compressor) { - if (!this.value) return false; - return this.value.may_throw(compressor); - }); -})(function(node_or_nodes, func) { - for (const node of [].concat(node_or_nodes)) { - node.DEFMETHOD("may_throw", func); - } -}); - -// determine if expression is constant -(function(def_is_constant_expression) { - function all_refs_local(scope) { - let result = true; - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(this, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.has_flag)(this, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.INLINED)) { - result = false; - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - } - var def = node.definition(); - if ( - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.member)(def, this.enclosed) - && !this.variables.has(def.name) - ) { - if (scope) { - var scope_def = scope.find_variable(node); - if (def.undeclared ? !scope_def : scope_def === def) { - result = "f"; - return true; - } - } - result = false; - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - } - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This && this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow) { - result = false; - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - } - }); - return result; - } - - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function(scope) { - if (this.extends && !this.extends.is_constant_expression(scope)) { - return false; - } - - for (const prop of this.properties) { - if (prop.computed_key() && !prop.key.is_constant_expression(scope)) { - return false; - } - if (prop.static && prop.value && !prop.value.is_constant_expression(scope)) { - return false; - } - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock) { - return false; - } - } - - return all_refs_local.call(this, scope); - }); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda, all_refs_local); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function() { - return this.expression.is_constant_expression(); - }); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function() { - return this.left.is_constant_expression() - && this.right.is_constant_expression(); - }); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, function() { - return this.elements.every((l) => l.is_constant_expression()); - }); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, function() { - return this.properties.every((l) => l.is_constant_expression()); - }); - def_is_constant_expression(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectProperty, function() { - return !!(!(this.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) && this.value && this.value.is_constant_expression()); - }); -})(function(node, func) { - node.DEFMETHOD("is_constant_expression", func); -}); - - -// may_throw_on_access() -// returns true if this node may be null, undefined or contain `AST_Accessor` -(function(def_may_throw_on_access) { - _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.DEFMETHOD("may_throw_on_access", function(compressor) { - return !compressor.option("pure_getters") - || this._dot_throw(compressor); - }); - - function is_strict(compressor) { - return /strict/.test(compressor.option("pure_getters")); - } - - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, is_strict); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, function(compressor) { - if (!is_strict(compressor)) return false; - for (var i = this.properties.length; --i >=0;) - if (this.properties[i]._dot_throw(compressor)) return true; - return false; - }); - // Do not be as strict with classes as we are with objects. - // Hopefully the community is not going to abuse static getters and setters. - // https://github.com/terser/terser/issues/724#issuecomment-643655656 - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectProperty, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectGetter, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_true); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion, function(compressor) { - return this.expression._dot_throw(compressor); - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPostfix, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, function() { - return this.operator == "void"; - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor) { - return (this.operator == "&&" || this.operator == "||" || this.operator == "??") - && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(compressor) { - if (this.logical) return true; - - return this.operator == "=" - && this.right._dot_throw(compressor); - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor) { - return this.consequent._dot_throw(compressor) - || this.alternative._dot_throw(compressor); - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot, function(compressor) { - if (!is_strict(compressor)) return false; - - if (this.property == "prototype") { - return !( - this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function - || this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class - ); - } - return true; - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function(compressor) { - return this.expression._dot_throw(compressor); - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - return this.tail_node()._dot_throw(compressor); - }); - def_may_throw_on_access(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, function(compressor) { - if (this.name === "arguments" && this.scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda) return false; - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.has_flag)(this, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.UNDEFINED)) return true; - if (!is_strict(compressor)) return false; - if (is_undeclared_ref(this) && this.is_declared(compressor)) return false; - if (this.is_immutable()) return false; - var fixed = this.fixed_value(); - return !fixed || fixed._dot_throw(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("_dot_throw", func); -}); - -function is_lhs(node, parent) { - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary && unary_side_effects.has(parent.operator)) return parent.expression; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign && parent.left === node) return node; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn && parent.init === node) return node; -} - -// method to negate an expression -(function(def_negate) { - function basic_negation(exp) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, exp, { - operator: "!", - expression: exp - }); - } - function best(orig, alt, first_in_statement) { - var negated = basic_negation(orig); - if (first_in_statement) { - var stat = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, alt, { - body: alt - }); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_2__.best_of_expression)(negated, stat) === stat ? alt : negated; - } - return (0,_common_js__WEBPACK_IMPORTED_MODULE_2__.best_of_expression)(negated, alt); - } - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, function() { - return basic_negation(this); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Statement, function() { - throw new Error("Cannot negate a statement"); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function, function() { - return basic_negation(this); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function() { - return basic_negation(this); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow, function() { - return basic_negation(this); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, function() { - if (this.operator == "!") - return this.expression; - return basic_negation(this); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(compressor) { - var expressions = this.expressions.slice(); - expressions.push(expressions.pop().negate(compressor)); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_2__.make_sequence)(this, expressions); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(compressor, first_in_statement) { - var self = this.clone(); - self.consequent = self.consequent.negate(compressor); - self.alternative = self.alternative.negate(compressor); - return best(this, self, first_in_statement); - }); - def_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(compressor, first_in_statement) { - var self = this.clone(), op = this.operator; - if (compressor.option("unsafe_comps")) { - switch (op) { - case "<=" : self.operator = ">" ; return self; - case "<" : self.operator = ">=" ; return self; - case ">=" : self.operator = "<" ; return self; - case ">" : self.operator = "<=" ; return self; - } - } - switch (op) { - case "==" : self.operator = "!="; return self; - case "!=" : self.operator = "=="; return self; - case "===": self.operator = "!=="; return self; - case "!==": self.operator = "==="; return self; - case "&&": - self.operator = "||"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - case "||": - self.operator = "&&"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - } - return basic_negation(this); - }); -})(function(node, func) { - node.DEFMETHOD("negate", function(compressor, first_in_statement) { - return func.call(this, compressor, first_in_statement); - }); -}); - -(function (def_bitwise_negate) { - function basic_bitwise_negation(exp) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, exp, { - operator: "~", - expression: exp - }); - } - - def_bitwise_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, function(_compressor) { - return basic_bitwise_negation(this); - }); - - def_bitwise_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, function(_compressor) { - const neg = ~this.value; - if (neg.toString().length > this.value.toString().length) { - return basic_bitwise_negation(this); - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, this, { value: neg }); - }); - - def_bitwise_negate(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, function(compressor, in_32_bit_context) { - if ( - this.operator == "~" - && ( - this.expression.is_32_bit_integer(compressor) || - (in_32_bit_context != null ? in_32_bit_context : compressor.in_32_bit_context()) - ) - ) { - return this.expression; - } else { - return basic_bitwise_negation(this); - } - }); -})(function (node, func) { - node.DEFMETHOD("bitwise_negate", func); -}); - -// Is the callee of this function pure? -var global_pure_fns = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.makePredicate)("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError"); -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call.DEFMETHOD("is_callee_pure", function(compressor) { - if (compressor.option("unsafe")) { - var expr = this.expression; - var first_arg = (this.args && this.args[0] && this.args[0].evaluate(compressor)); - if ( - expr.expression && expr.expression.name === "hasOwnProperty" && - (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) - ) { - return false; - } - if (is_undeclared_ref(expr) && global_pure_fns.has(expr.name)) return true; - if ( - expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot - && is_undeclared_ref(expr.expression) - && (0,_native_objects_js__WEBPACK_IMPORTED_MODULE_4__.is_pure_native_fn)(expr.expression.name, expr.property) - ) { - return true; - } - } - if ((this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_New) && compressor.option("pure_new")) { - return true; - } - if (compressor.option("side_effects") && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(this, _ast_js__WEBPACK_IMPORTED_MODULE_0__._PURE)) { - return true; - } - return !compressor.pure_funcs(this); -}); - -// If I call this, is it a pure function? -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.DEFMETHOD("is_call_pure", _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_false); -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot.DEFMETHOD("is_call_pure", function(compressor) { - if (!compressor.option("unsafe")) return; - const expr = this.expression; - - let native_obj; - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array) { - native_obj = "Array"; - } else if (expr.is_boolean()) { - native_obj = "Boolean"; - } else if (expr.is_number(compressor)) { - native_obj = "Number"; - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp) { - native_obj = "RegExp"; - } else if (expr.is_string(compressor)) { - native_obj = "String"; - } else if (!this.may_throw_on_access(compressor)) { - native_obj = "Object"; - } - return native_obj != null && (0,_native_objects_js__WEBPACK_IMPORTED_MODULE_4__.is_pure_native_method)(native_obj, this.property); -}); - -// tell me if a statement aborts -const aborts = (thing) => thing && thing.aborts(); - -(function(def_aborts) { - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Statement, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Jump, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_this); - function block_aborts() { - for (var i = 0; i < this.body.length; i++) { - if (aborts(this.body[i])) { - return this.body[i]; - } - } - return null; - } - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Import, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.return_null); - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, block_aborts); - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SwitchBranch, block_aborts); - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefClass, function () { - for (const prop of this.properties) { - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock) { - if (prop.aborts()) return prop; - } - } - return null; - }); - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock, block_aborts); - def_aborts(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, function() { - return this.alternative && aborts(this.body) && aborts(this.alternative) && this; - }); -})(function(node, func) { - node.DEFMETHOD("aborts", func); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.DEFMETHOD("contains_this", function() { - return (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(this, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This) return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - if ( - node !== this - && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope - && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow) - ) { - return true; - } - }); -}); - -function is_modified(compressor, tw, node, value, level, immutable) { - var parent = tw.parent(level); - var lhs = is_lhs(node, parent); - if (lhs) return lhs; - if (!immutable - && parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && parent.expression === node - && !(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow) - && !(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) - && !parent.is_callee_pure(compressor) - && (!(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function) - || !(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_New) && value.contains_this())) { - return true; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array) { - return is_modified(compressor, tw, parent, parent, level + 1); - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal && node === parent.value) { - var obj = tw.parent(level + 1); - return is_modified(compressor, tw, obj, obj, level + 2); - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess && parent.expression === node) { - var prop = (0,_common_js__WEBPACK_IMPORTED_MODULE_2__.read_property)(value, parent.property); - return !immutable && is_modified(compressor, tw, parent, prop, level + 1); - } -} - -/** - * Check if a node may be used by the expression it's in - * void (0, 1, {node}, 2) -> false - * console.log(0, {node}) -> true - */ -function is_used_in_expression(tw) { - for (let p = -1, node, parent; node = tw.parent(p), parent = tw.parent(p + 1); p++) { - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - const nth_expression = parent.expressions.indexOf(node); - if (nth_expression !== parent.expressions.length - 1) { - // Detect (0, x.noThis)() constructs - const grandparent = tw.parent(p + 2); - if ( - parent.expressions.length > 2 - || parent.expressions.length === 1 - || !(0,_common_js__WEBPACK_IMPORTED_MODULE_2__.requires_sequence_to_maintain_binding)(grandparent, parent, parent.expressions[1]) - ) { - return false; - } - return true; - } else { - continue; - } - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary) { - const op = parent.operator; - if (op === "void") { - return false; - } - if (op === "typeof" || op === "+" || op === "-" || op === "!" || op === "~") { - continue; - } - } - if ( - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement - ) { - return false; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) { - return false; - } - return true; - } - - return true; -} - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/inline.js": -/*!****************************************************!*\ - !*** ./node_modules/terser/lib/compress/inline.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ inline_into_call: () => (/* binding */ inline_into_call), -/* harmony export */ inline_into_symbolref: () => (/* binding */ inline_into_symbolref) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../size.js */ "./node_modules/terser/lib/size.js"); -/* harmony import */ var _evaluate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./evaluate.js */ "./node_modules/terser/lib/compress/evaluate.js"); -/* harmony import */ var _drop_side_effect_free_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./drop-side-effect-free.js */ "./node_modules/terser/lib/compress/drop-side-effect-free.js"); -/* harmony import */ var _reduce_vars_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./reduce-vars.js */ "./node_modules/terser/lib/compress/reduce-vars.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - - - - -/** - * Module that contains the inlining logic. - * - * @module - * - * The stars of the show are `inline_into_symbolref` and `inline_into_call`. - */ - -function within_array_or_object_literal(compressor) { - var node, level = 0; - while (node = compressor.parent(level++)) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Statement) return false; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object) { - return true; - } - } - return false; -} - -function scope_encloses_variables_in_this_scope(scope, pulled_scope) { - for (const enclosed of pulled_scope.enclosed) { - if (pulled_scope.variables.has(enclosed.name)) { - continue; - } - const looked_up = scope.find_variable(enclosed.name); - if (looked_up) { - if (looked_up === enclosed) continue; - return true; - } - } - return false; -} - -/** - * An extra check function for `top_retain` option, compare the length of const identifier - * and init value length and return true if init value is longer than identifier. for example: - * ``` - * // top_retain: ["example"] - * const example = 100 - * ``` - * it will return false because length of "100" is short than identifier "example". - */ -function is_const_symbol_short_than_init_value(def, fixed_value) { - if (def.orig.length === 1 && fixed_value) { - const init_value_length = fixed_value.size(); - const identifer_length = def.name.length; - return init_value_length > identifer_length; - } - return true; -} - -function inline_into_symbolref(self, compressor) { - if (compressor.in_computed_key()) return self; - - const parent = compressor.parent(); - const def = self.definition(); - const nearest_scope = compressor.find_scope(); - let fixed = self.fixed_value(); - if ( - compressor.top_retain && - def.global && - compressor.top_retain(def) && - // when identifier is in top_retain option dose not mean we can always inline it. - // if identifier name is longer then init value, we can replace it. - is_const_symbol_short_than_init_value(def, fixed) - ) { - // keep it - def.fixed = false; - def.single_use = false; - return self; - } - - if (dont_inline_lambda_in_loop(compressor, fixed)) return self; - - let single_use = def.single_use - && !(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && (parent.is_callee_pure(compressor)) - || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(parent, _ast_js__WEBPACK_IMPORTED_MODULE_0__._NOINLINE)) - && !(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export - && fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda - && fixed.name); - - if (single_use && fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - single_use = - !fixed.has_side_effects(compressor) - && !fixed.may_throw(compressor); - } - - if (fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class && def.scope !== self.scope) { - return self; - } - - if (single_use && (fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda || fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class)) { - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_7__.retain_top_func)(fixed, compressor)) { - single_use = false; - } else if (def.scope !== self.scope - && (def.escaped == 1 - || (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.has_flag)(fixed, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.INLINED) - || within_array_or_object_literal(compressor) - || !compressor.option("reduce_funcs"))) { - single_use = false; - } else if ((0,_common_js__WEBPACK_IMPORTED_MODULE_7__.is_recursive_ref)(compressor, def)) { - single_use = false; - } else if (def.scope !== self.scope || def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg) { - single_use = fixed.is_constant_expression(self.scope); - if (single_use == "f") { - var scope = self.scope; - do { - if (scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun || (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.is_func_expr)(scope)) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.set_flag)(scope, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.INLINED); - } - } while (scope = scope.parent_scope); - } - } - } - - if (single_use && (fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda || fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class)) { - single_use = - def.scope === self.scope - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && parent.expression === self - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - && !(fixed.name && fixed.name.definition().recursive_refs > 0); - } - - if (single_use && fixed) { - if (fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefClass) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.set_flag)(fixed, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.SQUEEZED); - fixed = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassExpression, fixed, fixed); - } - if (fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.set_flag)(fixed, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.SQUEEZED); - fixed = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function, fixed, fixed); - } - if (def.recursive_refs > 0 && fixed.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDefun) { - const defun_def = fixed.name.definition(); - let lambda_def = fixed.variables.get(fixed.name.name); - let name = lambda_def && lambda_def.orig[0]; - if (!(name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolLambda)) { - name = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolLambda, fixed.name, fixed.name); - name.scope = fixed; - fixed.name = name; - lambda_def = fixed.def_function(name); - } - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(fixed, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef && node.definition() === defun_def) { - node.thedef = lambda_def; - lambda_def.references.push(node); - } - }); - } - if ( - (fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda || fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) - && fixed.parent_scope !== nearest_scope - ) { - fixed = fixed.clone(true, compressor.get_toplevel()); - - nearest_scope.add_child_scope(fixed); - } - return fixed.optimize(compressor); - } - - // multiple uses - if (fixed) { - let replace; - - if (fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This) { - if (!(def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg) - && def.references.every((ref) => - def.scope === ref.scope - )) { - replace = fixed; - } - } else { - var ev = fixed.evaluate(compressor); - if ( - ev !== fixed - && (compressor.option("unsafe_regexp") || !(ev instanceof RegExp)) - ) { - replace = (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.make_node_from_constant)(ev, fixed); - } - } - - if (replace) { - const name_length = self.size(compressor); - const replace_size = replace.size(compressor); - - let overhead = 0; - if (compressor.option("unused") && !compressor.exposed(def)) { - overhead = - (name_length + 2 + fixed.size(compressor)) / - (def.references.length - def.assignments); - } - - if (replace_size <= name_length + overhead) { - return replace; - } - } - } - - return self; -} - -function inline_into_call(self, compressor) { - if (compressor.in_computed_key()) return self; - - var exp = self.expression; - var fn = exp; - var simple_args = self.args.every((arg) => !(arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion)); - - if (compressor.option("reduce_vars") - && fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(self, _ast_js__WEBPACK_IMPORTED_MODULE_0__._NOINLINE) - ) { - const fixed = fn.fixed_value(); - - if ( - (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.retain_top_func)(fixed, compressor) - || !compressor.toplevel.funcs && exp.definition().global - ) { - return self; - } - - fn = fixed; - } - - if ( - dont_inline_lambda_in_loop(compressor, fn) - && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(self, _ast_js__WEBPACK_IMPORTED_MODULE_0__._INLINE) - ) return self; - - var is_func = fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda; - - var stat = is_func && fn.body[0]; - var is_regular_func = is_func && !fn.is_generator && !fn.async; - var can_inline = is_regular_func && compressor.option("inline") && !self.is_callee_pure(compressor); - if (can_inline && stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return) { - let returned = stat.value; - if (!returned || returned.is_constant_expression()) { - if (returned) { - returned = returned.clone(true); - } else { - returned = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self); - } - const args = self.args.concat(returned); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.make_sequence)(self, args).optimize(compressor); - } - - // optimize identity function - if ( - fn.argnames.length === 1 - && (fn.argnames[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg) - && self.args.length < 2 - && !(self.args[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) - && returned instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && returned.name === fn.argnames[0].name - ) { - const replacement = - (self.args[0] || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined)).optimize(compressor); - - let parent; - if ( - replacement instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - && (parent = compressor.parent()) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && parent.expression === self - ) { - // identity function was being used to remove `this`, like in - // - // id(bag.no_this)(...) - // - // Replace with a larger but more effish (0, bag.no_this) wrapper. - - return (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.make_sequence)(self, [ - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, self, { value: 0 }), - replacement - ]); - } - // replace call with first argument or undefined if none passed - return replacement; - } - } - - if (can_inline) { - var scope, in_loop, level = -1; - let def; - let returned_value; - let nearest_scope; - if (simple_args - && !fn.uses_arguments - && !(compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) - && !(fn.name && fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function) - && (returned_value = can_flatten_body(stat)) - && (exp === fn - || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(self, _ast_js__WEBPACK_IMPORTED_MODULE_0__._INLINE) - || compressor.option("unused") - && (def = exp.definition()).references.length == 1 - && !(0,_common_js__WEBPACK_IMPORTED_MODULE_7__.is_recursive_ref)(compressor, def) - && fn.is_constant_expression(exp.scope)) - && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(self, _ast_js__WEBPACK_IMPORTED_MODULE_0__._PURE | _ast_js__WEBPACK_IMPORTED_MODULE_0__._NOINLINE) - && !fn.contains_this() - && can_inject_symbols() - && (nearest_scope = compressor.find_scope()) - && !scope_encloses_variables_in_this_scope(nearest_scope, fn) - && !(function in_default_assign() { - // Due to the fact function parameters have their own scope - // which can't use `var something` in the function body within, - // we simply don't inline into DefaultAssign. - let i = 0; - let p; - while ((p = compressor.parent(i++))) { - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefaultAssign) return true; - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block) break; - } - return false; - })() - && !(scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) - ) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.set_flag)(fn, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.SQUEEZED); - nearest_scope.add_child_scope(fn); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.make_sequence)(self, flatten_fn(returned_value)).optimize(compressor); - } - } - - if (can_inline && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(self, _ast_js__WEBPACK_IMPORTED_MODULE_0__._INLINE)) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.set_flag)(fn, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.SQUEEZED); - fn = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(fn.CTOR === _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun ? _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function : fn.CTOR, fn, fn); - fn = fn.clone(true); - fn.figure_out_scope({}, { - parent_scope: compressor.find_scope(), - toplevel: compressor.get_toplevel() - }); - - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, self, { - expression: fn, - args: self.args, - }).optimize(compressor); - } - - const can_drop_this_call = is_regular_func && compressor.option("side_effects") && fn.body.every(_common_js__WEBPACK_IMPORTED_MODULE_7__.is_empty); - if (can_drop_this_call) { - var args = self.args.concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self)); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.make_sequence)(self, args).optimize(compressor); - } - - if (compressor.option("negate_iife") - && compressor.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement - && (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.is_iife_call)(self)) { - return self.negate(compressor, true); - } - - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.make_node_from_constant)(ev, self).optimize(compressor); - return (0,_common_js__WEBPACK_IMPORTED_MODULE_7__.best_of)(compressor, ev, self); - } - - return self; - - function return_value(stat) { - if (!stat) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self); - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return) { - if (!stat.value) return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self); - return stat.value.clone(true); - } - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, stat, { - operator: "void", - expression: stat.body.clone(true) - }); - } - } - - function can_flatten_body(stat) { - var body = fn.body; - var len = body.length; - if (compressor.option("inline") < 3) { - return len == 1 && return_value(stat); - } - stat = null; - for (var i = 0; i < len; i++) { - var line = body[i]; - if (line instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var) { - if (stat && !line.definitions.every((var_def) => - !var_def.value - )) { - return false; - } - } else if (stat) { - return false; - } else if (!(line instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement)) { - stat = line; - } - } - return return_value(stat); - } - - function can_inject_args(block_scoped, safe_to_inject) { - for (var i = 0, len = fn.argnames.length; i < len; i++) { - var arg = fn.argnames[i]; - if (arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DefaultAssign) { - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.has_flag)(arg.left, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.UNUSED)) continue; - return false; - } - if (arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring) return false; - if (arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) { - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.has_flag)(arg.expression, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.UNUSED)) continue; - return false; - } - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.has_flag)(arg, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.UNUSED)) continue; - if (!safe_to_inject - || block_scoped.has(arg.name) - || _common_js__WEBPACK_IMPORTED_MODULE_7__.identifier_atom.has(arg.name) - || scope.conflicting_def(arg.name)) { - return false; - } - if (in_loop) in_loop.push(arg.definition()); - } - return true; - } - - function can_inject_vars(block_scoped, safe_to_inject) { - var len = fn.body.length; - for (var i = 0; i < len; i++) { - var stat = fn.body[i]; - if (!(stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var)) continue; - if (!safe_to_inject) return false; - for (var j = stat.definitions.length; --j >= 0;) { - var name = stat.definitions[j].name; - if (name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring - || block_scoped.has(name.name) - || _common_js__WEBPACK_IMPORTED_MODULE_7__.identifier_atom.has(name.name) - || scope.conflicting_def(name.name)) { - return false; - } - if (in_loop) in_loop.push(name.definition()); - } - } - return true; - } - - function can_inject_symbols() { - var block_scoped = new Set(); - do { - scope = compressor.parent(++level); - if (scope.is_block_scope() && scope.block_scope) { - // TODO this is sometimes undefined during compression. - // But it should always have a value! - scope.block_scope.variables.forEach(function (variable) { - block_scoped.add(variable.name); - }); - } - if (scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Catch) { - // TODO can we delete? AST_Catch is a block scope. - if (scope.argname) { - block_scoped.add(scope.argname.name); - } - } else if (scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_IterationStatement) { - in_loop = []; - } else if (scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - if (scope.fixed_value() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) return false; - } - } while (!(scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope)); - - var safe_to_inject = !(scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel) || compressor.toplevel.vars; - var inline = compressor.option("inline"); - if (!can_inject_vars(block_scoped, inline >= 3 && safe_to_inject)) return false; - if (!can_inject_args(block_scoped, inline >= 2 && safe_to_inject)) return false; - return !in_loop || in_loop.length == 0 || !(0,_common_js__WEBPACK_IMPORTED_MODULE_7__.is_reachable)(fn, in_loop); - } - - function append_var(decls, expressions, name, value) { - var def = name.definition(); - - // Name already exists, only when a function argument had the same name - const already_appended = scope.variables.has(name.name); - if (!already_appended) { - scope.variables.set(name.name, def); - scope.enclosed.push(def); - decls.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, name, { - name: name, - value: null - })); - } - - var sym = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, name, name); - def.references.push(sym); - if (value) expressions.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, self, { - operator: "=", - logical: false, - left: sym, - right: value.clone() - })); - } - - function flatten_args(decls, expressions) { - var len = fn.argnames.length; - for (var i = self.args.length; --i >= len;) { - expressions.push(self.args[i]); - } - for (i = len; --i >= 0;) { - var name = fn.argnames[i]; - var value = self.args[i]; - if ((0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.has_flag)(name, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_6__.UNUSED) || !name.name || scope.conflicting_def(name.name)) { - if (value) expressions.push(value); - } else { - var symbol = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolVar, name, name); - name.definition().orig.push(symbol); - if (!value && in_loop) value = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, self); - append_var(decls, expressions, symbol, value); - } - } - decls.reverse(); - expressions.reverse(); - } - - function flatten_vars(decls, expressions) { - var pos = expressions.length; - for (var i = 0, lines = fn.body.length; i < lines; i++) { - var stat = fn.body[i]; - if (!(stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var)) continue; - for (var j = 0, defs = stat.definitions.length; j < defs; j++) { - var var_def = stat.definitions[j]; - var name = var_def.name; - append_var(decls, expressions, name, var_def.value); - if (in_loop && fn.argnames.every((argname) => - argname.name != name.name - )) { - var def = fn.variables.get(name.name); - var sym = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, name, name); - def.references.push(sym); - expressions.splice(pos++, 0, (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, var_def, { - operator: "=", - logical: false, - left: sym, - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, name) - })); - } - } - } - } - - function flatten_fn(returned_value) { - var decls = []; - var expressions = []; - flatten_args(decls, expressions); - flatten_vars(decls, expressions); - expressions.push(returned_value); - - if (decls.length) { - const i = scope.body.indexOf(compressor.parent(level - 1)) + 1; - scope.body.splice(i, 0, (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var, fn, { - definitions: decls - })); - } - - return expressions.map(exp => exp.clone(true)); - } -} - -/** prevent inlining functions into loops, for performance reasons */ -function dont_inline_lambda_in_loop(compressor, maybe_lambda) { - return ( - (maybe_lambda instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda || maybe_lambda instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class) - && !!compressor.is_within_loop() - ); -} - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/native-objects.js": -/*!************************************************************!*\ - !*** ./node_modules/terser/lib/compress/native-objects.js ***! - \************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ is_pure_native_fn: () => (/* binding */ is_pure_native_fn), -/* harmony export */ is_pure_native_method: () => (/* binding */ is_pure_native_method), -/* harmony export */ is_pure_native_value: () => (/* binding */ is_pure_native_value), -/* harmony export */ pure_prop_access_globals: () => (/* binding */ pure_prop_access_globals) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - -// Lists of native methods, useful for `unsafe` option which assumes they exist. -// Note: Lots of methods and functions are missing here, in case they aren't pure -// or not available in all JS environments. - -function make_nested_lookup(obj) { - const out = new Map(); - for (var key of Object.keys(obj)) { - out.set(key, (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)(obj[key])); - } - - const does_have = (global_name, fname) => { - const inner_map = out.get(global_name); - return inner_map != null && inner_map.has(fname); - }; - return does_have; -} - -// Objects which are safe to access without throwing or causing a side effect. -// Usually we'd check the `unsafe` option first but these are way too common for that -const pure_prop_access_globals = new Set([ - "Number", - "String", - "Array", - "Object", - "Function", - "Promise", -]); - -const object_methods = [ - "constructor", - "toString", - "valueOf", -]; - -const is_pure_native_method = make_nested_lookup({ - Array: [ - "at", - "flat", - "includes", - "indexOf", - "join", - "lastIndexOf", - "slice", - ...object_methods, - ], - Boolean: object_methods, - Function: object_methods, - Number: [ - "toExponential", - "toFixed", - "toPrecision", - ...object_methods, - ], - Object: object_methods, - RegExp: [ - "test", - ...object_methods, - ], - String: [ - "at", - "charAt", - "charCodeAt", - "charPointAt", - "concat", - "endsWith", - "fromCharCode", - "fromCodePoint", - "includes", - "indexOf", - "italics", - "lastIndexOf", - "localeCompare", - "match", - "matchAll", - "normalize", - "padStart", - "padEnd", - "repeat", - "replace", - "replaceAll", - "search", - "slice", - "split", - "startsWith", - "substr", - "substring", - "repeat", - "toLocaleLowerCase", - "toLocaleUpperCase", - "toLowerCase", - "toUpperCase", - "trim", - "trimEnd", - "trimStart", - ...object_methods, - ], -}); - -const is_pure_native_fn = make_nested_lookup({ - Array: [ - "isArray", - ], - Math: [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan", - "atan2", - "pow", - "max", - "min", - ], - Number: [ - "isFinite", - "isNaN", - ], - Object: [ - "create", - "getOwnPropertyDescriptor", - "getOwnPropertyNames", - "getPrototypeOf", - "isExtensible", - "isFrozen", - "isSealed", - "hasOwn", - "keys", - ], - String: [ - "fromCharCode", - ], -}); - -// Known numeric values which come with JS environments -const is_pure_native_value = make_nested_lookup({ - Math: [ - "E", - "LN10", - "LN2", - "LOG2E", - "LOG10E", - "PI", - "SQRT1_2", - "SQRT2", - ], - Number: [ - "MAX_VALUE", - "MIN_VALUE", - "NaN", - "NEGATIVE_INFINITY", - "POSITIVE_INFINITY", - ], -}); - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/reduce-vars.js": -/*!*********************************************************!*\ - !*** ./node_modules/terser/lib/compress/reduce-vars.js ***! - \*********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _inference_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inference.js */ "./node_modules/terser/lib/compress/inference.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - -/** - * Define the method AST_Node#reduce_vars, which goes through the AST in - * execution order to perform basic flow analysis - */ -function def_reduce_vars(node, func) { - node.DEFMETHOD("reduce_vars", func); -} - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.noop); - -/** Clear definition properties */ -function reset_def(compressor, def) { - def.assignments = 0; - def.chained = false; - def.direct_access = false; - def.escaped = 0; - def.recursive_refs = 0; - def.references = []; - def.single_use = undefined; - if ( - def.scope.pinned() - || (def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg && def.scope.uses_arguments) - ) { - def.fixed = false; - } else if (def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolConst || !compressor.exposed(def)) { - def.fixed = def.init; - } else { - def.fixed = false; - } -} - -function reset_variables(tw, compressor, node) { - node.variables.forEach(function(def) { - reset_def(compressor, def); - if (def.fixed === null) { - tw.defs_to_safe_ids.set(def.id, tw.safe_ids); - mark(tw, def, true); - } else if (def.fixed) { - tw.loop_ids.set(def.id, tw.in_loop); - mark(tw, def, true); - } - }); -} - -function reset_block_variables(compressor, node) { - if (node.block_scope) node.block_scope.variables.forEach((def) => { - reset_def(compressor, def); - }); -} - -function push(tw) { - tw.safe_ids = Object.create(tw.safe_ids); -} - -function pop(tw) { - tw.safe_ids = Object.getPrototypeOf(tw.safe_ids); -} - -function mark(tw, def, safe) { - tw.safe_ids[def.id] = safe; -} - -function safe_to_read(tw, def) { - if (def.single_use == "m") return false; - if (tw.safe_ids[def.id]) { - if (def.fixed == null) { - var orig = def.orig[0]; - if (orig instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg || orig.name == "arguments") return false; - def.fixed = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, orig); - } - return true; - } - return def.fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun; -} - -function safe_to_assign(tw, def, scope, value) { - if (def.fixed === undefined) return true; - let def_safe_ids; - if (def.fixed === null - && (def_safe_ids = tw.defs_to_safe_ids.get(def.id)) - ) { - def_safe_ids[def.id] = false; - tw.defs_to_safe_ids.delete(def.id); - return true; - } - if (!(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.HOP)(tw.safe_ids, def.id)) return false; - if (!safe_to_read(tw, def)) return false; - if (def.fixed === false) return false; - if (def.fixed != null && (!value || def.references.length > def.assignments)) return false; - if (def.fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun) { - return value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node && def.fixed.parent_scope === scope; - } - return def.orig.every((sym) => { - return !(sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolConst - || sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDefun - || sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolLambda); - }); -} - -function ref_once(tw, compressor, def) { - return compressor.option("unused") - && !def.scope.pinned() - && def.references.length - def.recursive_refs == 1 - && tw.loop_ids.get(def.id) === tw.in_loop; -} - -function is_immutable(value) { - if (!value) return false; - return value.is_constant() - || value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda - || value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This; -} - -// A definition "escapes" when its value can leave the point of use. -// Example: `a = b || c` -// In this example, "b" and "c" are escaping, because they're going into "a" -// -// def.escaped is != 0 when it escapes. -// -// When greater than 1, it means that N chained properties will be read off -// of that def before an escape occurs. This is useful for evaluating -// property accesses, where you need to know when to stop. -function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) { - var parent = tw.parent(level); - if (value) { - if (value.is_constant()) return; - if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassExpression) return; - } - - if ( - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call && (node !== parent.expression || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_New) - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit && node === parent.value && node.scope !== d.scope - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef && node === parent.value - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Yield && node === parent.value && node.scope !== d.scope - ) { - if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; - if (!d.escaped || d.escaped > depth) d.escaped = depth; - return; - } else if ( - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Await - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && _inference_js__WEBPACK_IMPORTED_MODULE_2__.lazy_op.has(parent.operator) - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional && node !== parent.condition - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence && node === parent.tail_node() - ) { - mark_escaped(tw, d, scope, parent, parent, level + 1, depth); - } else if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal && node === parent.value) { - var obj = tw.parent(level + 1); - - mark_escaped(tw, d, scope, obj, obj, level + 2, depth); - } else if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess && node === parent.expression) { - value = (0,_common_js__WEBPACK_IMPORTED_MODULE_4__.read_property)(value, parent.property); - - mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); - if (value) return; - } - - if (level > 0) return; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence && node !== parent.tail_node()) return; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) return; - - d.direct_access = true; -} - -const suppress = node => (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(node, node => { - if (!(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol)) return; - var d = node.definition(); - if (!d) return; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) d.references.push(node); - d.fixed = false; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Accessor, function(tw, descend, compressor) { - push(tw); - reset_variables(tw, compressor, this); - descend(); - pop(tw); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, function(tw, descend, compressor) { - var node = this; - if (node.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring) { - suppress(node.left); - return; - } - - const finish_walk = () => { - if (node.logical) { - node.left.walk(tw); - - push(tw); - node.right.walk(tw); - pop(tw); - - return true; - } - }; - - var sym = node.left; - if (!(sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef)) return finish_walk(); - - var def = sym.definition(); - var safe = safe_to_assign(tw, def, sym.scope, node.right); - def.assignments++; - if (!safe) return finish_walk(); - - var fixed = def.fixed; - if (!fixed && node.operator != "=" && !node.logical) return finish_walk(); - - var eq = node.operator == "="; - var value = eq ? node.right : node; - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_2__.is_modified)(compressor, tw, node, value, 0)) return finish_walk(); - - def.references.push(sym); - - if (!node.logical) { - if (!eq) def.chained = true; - - def.fixed = eq ? function() { - return node.right; - } : function() { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node ? fixed : fixed(), - right: node.right - }); - }; - } - - if (node.logical) { - mark(tw, def, false); - push(tw); - node.right.walk(tw); - pop(tw); - return true; - } - - mark(tw, def, false); - node.right.walk(tw); - mark(tw, def, true); - - mark_escaped(tw, def, sym.scope, node, value, 0, 1); - - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(tw) { - if (!_inference_js__WEBPACK_IMPORTED_MODULE_2__.lazy_op.has(this.operator)) return; - this.left.walk(tw); - push(tw); - this.right.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block, function(tw, descend, compressor) { - reset_block_variables(compressor, this); -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case, function(tw) { - push(tw); - this.expression.walk(tw); - pop(tw); - push(tw); - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_body)(this, tw); - pop(tw); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function(tw, descend) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.clear_flag)(this, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.INLINED); - push(tw); - descend(); - pop(tw); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock, function(tw, descend, compressor) { - reset_block_variables(compressor, this); -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(tw) { - this.condition.walk(tw); - push(tw); - this.consequent.walk(tw); - pop(tw); - push(tw); - this.alternative.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function(tw, descend) { - // Chains' conditions apply left-to-right, cumulatively. - // If we walk normally we don't go in that order because we would pop before pushing again - // Solution: AST_PropAccess and AST_Call push when they are optional, and never pop. - // Then we pop everything when they are done being walked. - const safe_ids = tw.safe_ids; - - descend(); - - // Unroll back to start - tw.safe_ids = safe_ids; - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, function (tw) { - this.expression.walk(tw); - - if (this.optional) { - // Never pop -- it's popped at AST_Chain above - push(tw); - } - - for (const arg of this.args) arg.walk(tw); - - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess, function (tw) { - if (!this.optional) return; - - this.expression.walk(tw); - - // Never pop -- it's popped at AST_Chain above - push(tw); - - if (this.property instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) this.property.walk(tw); - - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Default, function(tw, descend) { - push(tw); - descend(); - pop(tw); - return true; -}); - -function mark_lambda(tw, descend, compressor) { - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.clear_flag)(this, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_3__.INLINED); - push(tw); - reset_variables(tw, compressor, this); - - var iife; - if (!this.name - && !this.uses_arguments - && !this.pinned() - && (iife = tw.parent()) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && iife.expression === this - && !iife.args.some(arg => arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) - && this.argnames.every(arg_name => arg_name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol) - ) { - // Virtually turn IIFE parameters into variable definitions: - // (function(a,b) {...})(c,d) => (function() {var a=c,b=d; ...})() - // So existing transformation rules can work on them. - this.argnames.forEach((arg, i) => { - if (!arg.definition) return; - var d = arg.definition(); - // Avoid setting fixed when there's more than one origin for a variable value - if (d.orig.length > 1) return; - if (d.fixed === undefined && (!this.uses_arguments || tw.has_directive("use strict"))) { - d.fixed = function() { - return iife.args[i] || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, iife); - }; - tw.loop_ids.set(d.id, tw.in_loop); - mark(tw, d, true); - } else { - d.fixed = false; - } - }); - } - - descend(); - pop(tw); - - handle_defined_after_hoist(this); - - return true; -} - -/** - * It's possible for a hoisted function to use something that's not defined yet. Example: - * - * hoisted(); - * var defined_after = true; - * function hoisted() { - * // use defined_after - * } - * - * Or even indirectly: - * - * B(); - * var defined_after = true; - * function A() { - * // use defined_after - * } - * function B() { - * A(); - * } - * - * Access a variable before declaration will either throw a ReferenceError - * (if the variable is declared with `let` or `const`), - * or get an `undefined` (if the variable is declared with `var`). - * - * If the variable is inlined into the function, the behavior will change. - * - * This function is called on the parent to disallow inlining of such variables, - */ -function handle_defined_after_hoist(parent) { - const defuns = []; - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(parent, node => { - if (node === parent) return; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun) { - defuns.push(node); - return true; - } - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement - ) return true; - }); - - // `defun` id to array of `defun` it uses - const defun_dependencies_map = new Map(); - // `defun` id to array of enclosing `def` that are used by the function - const dependencies_map = new Map(); - // all symbol ids that will be tracked for read/write - const symbols_of_interest = new Set(); - const defuns_of_interest = new Set(); - - for (const defun of defuns) { - const fname_def = defun.name.definition(); - const enclosing_defs = []; - - for (const def of defun.enclosed) { - if ( - def.fixed === false - || def === fname_def - || def.scope.get_defun_scope() !== parent - ) { - continue; - } - - symbols_of_interest.add(def.id); - - // found a reference to another function - if ( - def.assignments === 0 - && def.orig.length === 1 - && def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDefun - ) { - defuns_of_interest.add(def.id); - symbols_of_interest.add(def.id); - - defuns_of_interest.add(fname_def.id); - symbols_of_interest.add(fname_def.id); - - if (!defun_dependencies_map.has(fname_def.id)) { - defun_dependencies_map.set(fname_def.id, []); - } - defun_dependencies_map.get(fname_def.id).push(def.id); - - continue; - } - - enclosing_defs.push(def); - } - - if (enclosing_defs.length) { - dependencies_map.set(fname_def.id, enclosing_defs); - defuns_of_interest.add(fname_def.id); - symbols_of_interest.add(fname_def.id); - } - } - - // No defuns use outside constants - if (!dependencies_map.size) { - return; - } - - // Increment to count "symbols of interest" (defuns or defs) that we found. - // These are tracked in AST order so we can check which is after which. - let symbol_index = 1; - // Map a defun ID to its first read (a `symbol_index`) - const defun_first_read_map = new Map(); - // Map a symbol ID to its last write (a `symbol_index`) - const symbol_last_write_map = new Map(); - - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_parent)(parent, (node, walk_info) => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol && node.thedef) { - const id = node.definition().id; - - symbol_index++; - - // Track last-writes to symbols - if (symbols_of_interest.has(id)) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration || (0,_inference_js__WEBPACK_IMPORTED_MODULE_2__.is_lhs)(node, walk_info.parent())) { - symbol_last_write_map.set(id, symbol_index); - } - } - - // Track first-reads of defuns (refined later) - if (defuns_of_interest.has(id)) { - if (!defun_first_read_map.has(id) && !(0,_common_js__WEBPACK_IMPORTED_MODULE_4__.is_recursive_ref)(walk_info, id)) { - defun_first_read_map.set(id, symbol_index); - } - } - } - }); - - // Refine `defun_first_read_map` to be as high as possible - for (const [defun, defun_first_read] of defun_first_read_map) { - // Update all depdencies of `defun` - const queue = new Set(defun_dependencies_map.get(defun)); - for (const enclosed_defun of queue) { - let enclosed_defun_first_read = defun_first_read_map.get(enclosed_defun); - if (enclosed_defun_first_read != null && enclosed_defun_first_read < defun_first_read) { - continue; - } - - defun_first_read_map.set(enclosed_defun, defun_first_read); - - for (const enclosed_enclosed_defun of defun_dependencies_map.get(enclosed_defun) || []) { - queue.add(enclosed_enclosed_defun); - } - } - } - - // ensure write-then-read order, otherwise clear `fixed` - // This is safe because last-writes (found_symbol_writes) are assumed to be as late as possible, and first-reads (defun_first_read_map) are assumed to be as early as possible. - for (const [defun, defs] of dependencies_map) { - const defun_first_read = defun_first_read_map.get(defun); - if (defun_first_read === undefined) { - continue; - } - - for (const def of defs) { - if (def.fixed === false) { - continue; - } - - let def_last_write = symbol_last_write_map.get(def.id) || 0; - - if (defun_first_read < def_last_write) { - def.fixed = false; - } - } - } -} - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda, mark_lambda); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Do, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - this.body.walk(tw); - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_4__.has_break_or_continue)(this)) { - pop(tw); - push(tw); - } - this.condition.walk(tw); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - if (this.init) this.init.walk(tw); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - if (this.condition) this.condition.walk(tw); - this.body.walk(tw); - if (this.step) { - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_4__.has_break_or_continue)(this)) { - pop(tw); - push(tw); - } - this.step.walk(tw); - } - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - suppress(this.init); - this.object.walk(tw); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - this.body.walk(tw); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, function(tw) { - this.condition.walk(tw); - push(tw); - this.body.walk(tw); - pop(tw); - if (this.alternative) { - push(tw); - this.alternative.walk(tw); - pop(tw); - } - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement, function(tw) { - push(tw); - this.body.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolCatch, function() { - this.definition().fixed = false; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, function(tw, descend, compressor) { - var d = this.definition(); - d.references.push(this); - if (d.references.length == 1 - && !d.fixed - && d.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDefun) { - tw.loop_ids.set(d.id, tw.in_loop); - } - var fixed_value; - if (d.fixed === undefined || !safe_to_read(tw, d)) { - d.fixed = false; - } else if (d.fixed) { - fixed_value = this.fixed_value(); - if ( - fixed_value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda - && (0,_common_js__WEBPACK_IMPORTED_MODULE_4__.is_recursive_ref)(tw, d) - ) { - d.recursive_refs++; - } else if (fixed_value - && !compressor.exposed(d) - && ref_once(tw, compressor, d) - ) { - d.single_use = - fixed_value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda && !fixed_value.pinned() - || fixed_value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class - || d.scope === this.scope && fixed_value.is_constant_expression(); - } else { - d.single_use = false; - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_2__.is_modified)(compressor, tw, this, fixed_value, 0, is_immutable(fixed_value))) { - if (d.single_use) { - d.single_use = "m"; - } else { - d.fixed = false; - } - } - } - mark_escaped(tw, d, this.scope, this, fixed_value, 0, 1); -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel, function(tw, descend, compressor) { - this.globals.forEach(function(def) { - reset_def(compressor, def); - }); - reset_variables(tw, compressor, this); - descend(); - handle_defined_after_hoist(this); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - push(tw); - this.body.walk(tw); - pop(tw); - if (this.bcatch) { - push(tw); - this.bcatch.walk(tw); - pop(tw); - } - if (this.bfinally) this.bfinally.walk(tw); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function(tw) { - var node = this; - if (node.operator !== "++" && node.operator !== "--") return; - var exp = node.expression; - if (!(exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef)) return; - var def = exp.definition(); - var safe = safe_to_assign(tw, def, exp.scope, true); - def.assignments++; - if (!safe) return; - var fixed = def.fixed; - if (!fixed) return; - def.references.push(exp); - def.chained = true; - def.fixed = function() { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, node, { - operator: "+", - expression: fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node ? fixed : fixed() - }), - right: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, node, { - value: 1 - }) - }); - }; - mark(tw, def, true); - return true; -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, function(tw, descend) { - var node = this; - if (node.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring) { - suppress(node.name); - return; - } - var d = node.name.definition(); - if (node.value) { - if (safe_to_assign(tw, d, node.name.scope, node.value)) { - d.fixed = function() { - return node.value; - }; - tw.loop_ids.set(d.id, tw.in_loop); - mark(tw, d, false); - descend(); - mark(tw, d, true); - return true; - } else { - d.fixed = false; - } - } -}); - -def_reduce_vars(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_While, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - descend(); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - - -/***/ }), - -/***/ "./node_modules/terser/lib/compress/tighten-body.js": -/*!**********************************************************!*\ - !*** ./node_modules/terser/lib/compress/tighten-body.js ***! - \**********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ tighten_body: () => (/* binding */ tighten_body), -/* harmony export */ trim_unreachable_code: () => (/* binding */ trim_unreachable_code) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _native_objects_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./native-objects.js */ "./node_modules/terser/lib/compress/native-objects.js"); -/* harmony import */ var _inference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inference.js */ "./node_modules/terser/lib/compress/inference.js"); -/* harmony import */ var _compressor_flags_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./compressor-flags.js */ "./node_modules/terser/lib/compress/compressor-flags.js"); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./common.js */ "./node_modules/terser/lib/compress/common.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - - -function loop_body(x) { - if (x instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_IterationStatement) { - return x.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement ? x.body : x; - } - return x; -} - -function is_lhs_read_only(lhs) { - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This) return true; - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) return lhs.definition().orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolLambda; - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess) { - lhs = lhs.expression; - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - if (lhs.is_immutable()) return false; - lhs = lhs.fixed_value(); - } - if (!lhs) return true; - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp) return false; - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Constant) return true; - return is_lhs_read_only(lhs); - } - return false; -} - -/** var a = 1 --> var a*/ -function remove_initializers(var_statement) { - var decls = []; - var_statement.definitions.forEach(function(def) { - if (def.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration) { - def.value = null; - decls.push(def); - } else { - def.declarations_as_names().forEach(name => { - decls.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, def, { - name, - value: null - })); - }); - } - }); - return decls.length ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var, var_statement, { definitions: decls }) : null; -} - -/** Called on code which we know is unreachable, to keep elements that affect outside of it. */ -function trim_unreachable_code(compressor, stat, target) { - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(stat, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var) { - const no_initializers = remove_initializers(node); - if (no_initializers) target.push(no_initializers); - return true; - } - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun - && (node === stat || !compressor.has_directive("use strict")) - ) { - target.push(node === stat ? node : (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var, node, { - definitions: [ - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, node, { - name: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolVar, node.name, node.name), - value: null - }) - ] - })); - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Import) { - target.push(node); - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) { - return true; - } - }); -} - -/** Tighten a bunch of statements together, and perform statement-level optimization. */ -function tighten_body(statements, compressor) { - const nearest_scope = compressor.find_scope(); - const defun_scope = nearest_scope.get_defun_scope(); - const { in_loop, in_try } = find_loop_scope_try(); - - var CHANGED, max_iter = 10; - do { - CHANGED = false; - eliminate_spurious_blocks(statements); - if (compressor.option("dead_code")) { - eliminate_dead_code(statements, compressor); - } - if (compressor.option("if_return")) { - handle_if_return(statements, compressor); - } - if (compressor.sequences_limit > 0) { - sequencesize(statements, compressor); - sequencesize_2(statements, compressor); - } - if (compressor.option("join_vars")) { - join_consecutive_vars(statements); - } - if (compressor.option("collapse_vars")) { - collapse(statements, compressor); - } - } while (CHANGED && max_iter-- > 0); - - function find_loop_scope_try() { - var node = compressor.self(), level = 0, in_loop = false, in_try = false; - do { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_IterationStatement) { - in_loop = true; - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) { - break; - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TryBlock) { - in_try = true; - } - } while (node = compressor.parent(level++)); - - return { in_loop, in_try }; - } - - // Search from right to left for assignment-like expressions: - // - `var a = x;` - // - `a = x;` - // - `++a` - // For each candidate, scan from left to right for first usage, then try - // to fold assignment into the site for compression. - // Will not attempt to collapse assignments into or past code blocks - // which are not sequentially executed, e.g. loops and conditionals. - function collapse(statements, compressor) { - if (nearest_scope.pinned() || defun_scope.pinned()) - return statements; - var args; - var candidates = []; - var stat_index = statements.length; - var scanner = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer(function (node) { - if (abort) - return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) - return node; - hit_index++; - if (hit_index < hit_stack.length) - return handle_custom_scan_order(node); - hit = true; - stop_after = find_stop(node, 0); - if (stop_after === node) - abort = true; - return node; - } - // Stop immediately if these node types are encountered - var parent = scanner.parent(); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - && (node.logical || node.operator != "=" && lhs.equivalent_to(node.left)) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Await - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call && lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess && lhs.equivalent_to(node.expression) - || - (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess) - && node.optional - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Debugger - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion - && node.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol - && ( - node.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This - || node.expression.definition().references.length > 1 - ) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_IterationStatement && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LoopControl - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Yield - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For && node !== parent.init - || !replace_all - && ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && !node.is_declared(compressor) - && !_native_objects_js__WEBPACK_IMPORTED_MODULE_2__.pure_prop_access_globals.has(node) - ) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(parent, _ast_js__WEBPACK_IMPORTED_MODULE_0__._NOINLINE) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectProperty && node.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node - ) { - abort = true; - return node; - } - // Stop only if candidate is found within conditional branches - if (!stop_if_hit && (!lhs_local || !replace_all) - && (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && _inference_js__WEBPACK_IMPORTED_MODULE_3__.lazy_op.has(parent.operator) && parent.left !== node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional && parent.condition !== node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If && parent.condition !== node)) { - stop_if_hit = parent; - } - // Replace variable with assignment when found - if ( - can_replace - && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration) - && lhs.equivalent_to(node) - && !shadows(scanner.find_scope() || nearest_scope, lvalues) - ) { - if (stop_if_hit) { - abort = true; - return node; - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.is_lhs)(node, parent)) { - if (value_def) - replaced++; - return node; - } else { - replaced++; - if (value_def && candidate instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef) - return node; - } - CHANGED = abort = true; - if (candidate instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPostfix) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix, candidate, candidate); - } - if (candidate instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef) { - var def = candidate.name.definition(); - var value = candidate.value; - if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) { - def.replaced++; - if (funarg && (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.is_identifier_atom)(value)) { - return value.transform(compressor); - } else { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.maintain_this_binding)(parent, node, value); - } - } - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign, candidate, { - operator: "=", - logical: false, - left: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, candidate.name, candidate.name), - right: value - }); - } - (0,_compressor_flags_js__WEBPACK_IMPORTED_MODULE_4__.clear_flag)(candidate, _compressor_flags_js__WEBPACK_IMPORTED_MODULE_4__.WRITE_ONLY); - return candidate; - } - // These node types have child nodes that execute sequentially, - // but are otherwise not safe to scan into or beyond them. - var sym; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit - && (side_effects || lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess || may_modify(lhs)) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - && (side_effects || node.expression.may_throw_on_access(compressor)) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && ((lvalues.has(node.name) && lvalues.get(node.name).modified) || side_effects && may_modify(node)) - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef && node.value - && (lvalues.has(node.name.name) || side_effects && may_modify(node.name)) - || (sym = (0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.is_lhs)(node.left, node)) - && (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess || lvalues.has(sym.name)) - || may_throw - && (in_try ? node.has_side_effects(compressor) : side_effects_external(node))) { - stop_after = node; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) - abort = true; - } - return handle_custom_scan_order(node); - }, function (node) { - if (abort) - return; - if (stop_after === node) - abort = true; - if (stop_if_hit === node) - stop_if_hit = null; - }); - - var multi_replacer = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer(function (node) { - if (abort) - return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) - return node; - hit_index++; - if (hit_index < hit_stack.length) - return; - hit = true; - return node; - } - // Replace variable when found - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && node.name == def.name) { - if (!--replaced) - abort = true; - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.is_lhs)(node, multi_replacer.parent())) - return node; - def.replaced++; - value_def.replaced--; - return candidate.value; - } - // Skip (non-executed) functions and (leading) default case in switch statements - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Default || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) - return node; - }); - - while (--stat_index >= 0) { - // Treat parameters as collapsible in IIFE, i.e. - // function(a, b){ ... }(x()); - // would be translated into equivalent assignments: - // var a = x(), b = undefined; - if (stat_index == 0 && compressor.option("unused")) - extract_args(); - // Find collapsible assignments - var hit_stack = []; - extract_candidates(statements[stat_index]); - while (candidates.length > 0) { - hit_stack = candidates.pop(); - var hit_index = 0; - var candidate = hit_stack[hit_stack.length - 1]; - var value_def = null; - var stop_after = null; - var stop_if_hit = null; - var lhs = get_lhs(candidate); - if (!lhs || is_lhs_read_only(lhs) || lhs.has_side_effects(compressor)) - continue; - // Locate symbols which may execute code outside of scanning range - var lvalues = get_lvalues(candidate); - var lhs_local = is_lhs_local(lhs); - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - lvalues.set(lhs.name, { def: lhs.definition(), modified: false }); - } - var side_effects = value_has_side_effects(candidate); - var replace_all = replace_all_symbols(); - var may_throw = candidate.may_throw(compressor); - var funarg = candidate.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg; - var hit = funarg; - var abort = false, replaced = 0, can_replace = !args || !hit; - if (!can_replace) { - for ( - let j = compressor.self().argnames.lastIndexOf(candidate.name) + 1; - !abort && j < args.length; - j++ - ) { - args[j].transform(scanner); - } - can_replace = true; - } - for (var i = stat_index; !abort && i < statements.length; i++) { - statements[i].transform(scanner); - } - if (value_def) { - var def = candidate.name.definition(); - if (abort && def.references.length - def.replaced > replaced) - replaced = false; - else { - abort = false; - hit_index = 0; - hit = funarg; - for (var i = stat_index; !abort && i < statements.length; i++) { - statements[i].transform(multi_replacer); - } - value_def.single_use = false; - } - } - if (replaced && !remove_candidate(candidate)) - statements.splice(stat_index, 1); - } - } - - function handle_custom_scan_order(node) { - // Skip (non-executed) functions - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) - return node; - - // Scan case expressions first in a switch statement - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch) { - node.expression = node.expression.transform(scanner); - for (var i = 0, len = node.body.length; !abort && i < len; i++) { - var branch = node.body[i]; - if (branch instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case) { - if (!hit) { - if (branch !== hit_stack[hit_index]) - continue; - hit_index++; - } - branch.expression = branch.expression.transform(scanner); - if (!replace_all) - break; - } - } - abort = true; - return node; - } - } - - function redefined_within_scope(def, scope) { - if (def.global) - return false; - let cur_scope = def.scope; - while (cur_scope && cur_scope !== scope) { - if (cur_scope.variables.has(def.name)) { - return true; - } - cur_scope = cur_scope.parent_scope; - } - return false; - } - - function has_overlapping_symbol(fn, arg, fn_strict) { - var found = false, scan_this = !(fn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow); - arg.walk(new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker(function (node, descend) { - if (found) - return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef && (fn.variables.has(node.name) || redefined_within_scope(node.definition(), fn))) { - var s = node.definition().scope; - if (s !== defun_scope) - while (s = s.parent_scope) { - if (s === defun_scope) - return true; - } - return found = true; - } - if ((fn_strict || scan_this) && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This) { - return found = true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow)) { - var prev = scan_this; - scan_this = false; - descend(); - scan_this = prev; - return true; - } - })); - return found; - } - - function arg_is_injectable(arg) { - if (arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) return false; - const contains_await = (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(arg, (node) => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Await) return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - }); - if (contains_await) return false; - return true; - } - function extract_args() { - var iife, fn = compressor.self(); - if ((0,_common_js__WEBPACK_IMPORTED_MODULE_5__.is_func_expr)(fn) - && !fn.name - && !fn.uses_arguments - && !fn.pinned() - && (iife = compressor.parent()) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call - && iife.expression === fn - && iife.args.every(arg_is_injectable) - ) { - var fn_strict = compressor.has_directive("use strict"); - if (fn_strict && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.member)(fn_strict, fn.body)) - fn_strict = false; - var len = fn.argnames.length; - args = iife.args.slice(len); - var names = new Set(); - for (var i = len; --i >= 0;) { - var sym = fn.argnames[i]; - var arg = iife.args[i]; - // The following two line fix is a duplicate of the fix at - // https://github.com/terser/terser/commit/011d3eb08cefe6922c7d1bdfa113fc4aeaca1b75 - // This might mean that these two pieces of code (one here in collapse_vars and another in reduce_vars - // Might be doing the exact same thing. - const def = sym.definition && sym.definition(); - const is_reassigned = def && def.orig.length > 1; - if (is_reassigned) - continue; - args.unshift((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, sym, { - name: sym, - value: arg - })); - if (names.has(sym.name)) - continue; - names.add(sym.name); - if (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion) { - var elements = iife.args.slice(i); - if (elements.every((arg) => !has_overlapping_symbol(fn, arg, fn_strict) - )) { - candidates.unshift([(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, sym, { - name: sym.expression, - value: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, iife, { - elements: elements - }) - })]); - } - } else { - if (!arg) { - arg = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, sym).transform(compressor); - } else if (arg instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda && arg.pinned() - || has_overlapping_symbol(fn, arg, fn_strict)) { - arg = null; - } - if (arg) - candidates.unshift([(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, sym, { - name: sym, - value: arg - })]); - } - } - } - } - - function extract_candidates(expr) { - hit_stack.push(expr); - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign) { - if (!expr.left.has_side_effects(compressor) - && !(expr.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain)) { - candidates.push(hit_stack.slice()); - } - extract_candidates(expr.right); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary) { - extract_candidates(expr.left); - extract_candidates(expr.right); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call && !(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.has_annotation)(expr, _ast_js__WEBPACK_IMPORTED_MODULE_0__._NOINLINE)) { - extract_candidates(expr.expression); - expr.args.forEach(extract_candidates); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case) { - extract_candidates(expr.expression); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional) { - extract_candidates(expr.condition); - extract_candidates(expr.consequent); - extract_candidates(expr.alternative); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions) { - var len = expr.definitions.length; - // limit number of trailing variable definitions for consideration - var i = len - 200; - if (i < 0) - i = 0; - for (; i < len; i++) { - extract_candidates(expr.definitions[i]); - } - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DWLoop) { - extract_candidates(expr.condition); - if (!(expr.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit) { - if (expr.value) - extract_candidates(expr.value); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For) { - if (expr.init) - extract_candidates(expr.init); - if (expr.condition) - extract_candidates(expr.condition); - if (expr.step) - extract_candidates(expr.step); - if (!(expr.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn) { - extract_candidates(expr.object); - if (!(expr.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - extract_candidates(expr.condition); - if (!(expr.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block)) { - extract_candidates(expr.body); - } - if (expr.alternative && !(expr.alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block)) { - extract_candidates(expr.alternative); - } - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - expr.expressions.forEach(extract_candidates); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - extract_candidates(expr.body); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch) { - extract_candidates(expr.expression); - expr.body.forEach(extract_candidates); - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary) { - if (expr.operator == "++" || expr.operator == "--") { - candidates.push(hit_stack.slice()); - } - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef) { - if (expr.value && !(expr.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain)) { - candidates.push(hit_stack.slice()); - extract_candidates(expr.value); - } - } - hit_stack.pop(); - } - - function find_stop(node, level, write_only) { - var parent = scanner.parent(level); - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign) { - if (write_only - && !parent.logical - && !(parent.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess - || lvalues.has(parent.left.name))) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary) { - if (write_only && (!_inference_js__WEBPACK_IMPORTED_MODULE_3__.lazy_op.has(parent.operator) || parent.left === node)) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call) - return node; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case) - return node; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional) { - if (write_only && parent.condition === node) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions) { - return find_stop(parent, level + 1, true); - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit) { - return write_only ? find_stop(parent, level + 1, write_only) : node; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - if (write_only && parent.condition === node) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_IterationStatement) - return node; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - return find_stop(parent, level + 1, parent.tail_node() !== node); - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - return find_stop(parent, level + 1, true); - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch) - return node; - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef) - return node; - return null; - } - - function mangleable_var(var_def) { - var value = var_def.value; - if (!(value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef)) - return; - if (value.name == "arguments") - return; - var def = value.definition(); - if (def.undeclared) - return; - return value_def = def; - } - - function get_lhs(expr) { - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign && expr.logical) { - return false; - } else if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef && expr.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration) { - var def = expr.name.definition(); - if (!(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.member)(expr.name, def.orig)) - return; - var referenced = def.references.length - def.replaced; - if (!referenced) - return; - var declared = def.orig.length - def.eliminated; - if (declared > 1 && !(expr.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg) - || (referenced > 1 ? mangleable_var(expr) : !compressor.exposed(def))) { - return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef, expr.name, expr.name); - } - } else { - const lhs = expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - ? expr.left - : expr.expression; - return !(0,_common_js__WEBPACK_IMPORTED_MODULE_5__.is_ref_of)(lhs, _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolConst) - && !(0,_common_js__WEBPACK_IMPORTED_MODULE_5__.is_ref_of)(lhs, _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolLet) && lhs; - } - } - - function get_rvalue(expr) { - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign) { - return expr.right; - } else { - return expr.value; - } - } - - function get_lvalues(expr) { - var lvalues = new Map(); - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary) - return lvalues; - var tw = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeWalker(function (node) { - var sym = node; - while (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess) - sym = sym.expression; - if (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - const prev = lvalues.get(sym.name); - if (!prev || !prev.modified) { - lvalues.set(sym.name, { - def: sym.definition(), - modified: (0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.is_modified)(compressor, tw, node, node, 0) - }); - } - } - }); - get_rvalue(expr).walk(tw); - return lvalues; - } - - function remove_candidate(expr) { - if (expr.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolFunarg) { - var iife = compressor.parent(), argnames = compressor.self().argnames; - var index = argnames.indexOf(expr.name); - if (index < 0) { - iife.args.length = Math.min(iife.args.length, argnames.length - 1); - } else { - var args = iife.args; - if (args[index]) - args[index] = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number, args[index], { - value: 0 - }); - } - return true; - } - var found = false; - return statements[stat_index].transform(new _ast_js__WEBPACK_IMPORTED_MODULE_0__.TreeTransformer(function (node, descend, in_list) { - if (found) - return node; - if (node === expr || node.body === expr) { - found = true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef) { - node.value = node.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolConst - ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, node.value) // `const` always needs value. - : null; - return node; - } - return in_list ? _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP.skip : null; - } - }, function (node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) - switch (node.expressions.length) { - case 0: return null; - case 1: return node.expressions[0]; - } - })); - } - - function is_lhs_local(lhs) { - while (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess) - lhs = lhs.expression; - return lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef - && lhs.definition().scope.get_defun_scope() === defun_scope - && !(in_loop - && (lvalues.has(lhs.name) - || candidate instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary - || (candidate instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign - && !candidate.logical - && candidate.operator != "="))); - } - - function value_has_side_effects(expr) { - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary) - return _inference_js__WEBPACK_IMPORTED_MODULE_3__.unary_side_effects.has(expr.operator); - return get_rvalue(expr).has_side_effects(compressor); - } - - function replace_all_symbols() { - if (side_effects) - return false; - if (value_def) - return true; - if (lhs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) { - var def = lhs.definition(); - if (def.references.length - def.replaced == (candidate instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef ? 1 : 2)) { - return true; - } - } - return false; - } - - function may_modify(sym) { - if (!sym.definition) - return true; // AST_Destructuring - var def = sym.definition(); - if (def.orig.length == 1 && def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDefun) - return false; - if (def.scope.get_defun_scope() !== defun_scope) - return true; - return def.references.some((ref) => - ref.scope.get_defun_scope() !== defun_scope - ); - } - - function side_effects_external(node, lhs) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign) - return side_effects_external(node.left, true); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary) - return side_effects_external(node.expression, true); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef) - return node.value && side_effects_external(node.value); - if (lhs) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot) - return side_effects_external(node.expression, true); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub) - return side_effects_external(node.expression, true); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef) - return node.definition().scope.get_defun_scope() !== defun_scope; - } - return false; - } - - /** - * Will any of the pulled-in lvalues shadow a variable in newScope or parents? - * similar to scope_encloses_variables_in_this_scope */ - function shadows(my_scope, lvalues) { - for (const { def } of lvalues.values()) { - const looked_up = my_scope.find_variable(def.name); - if (looked_up) { - if (looked_up === def) continue; - return true; - } - } - return false; - } - } - - function eliminate_spurious_blocks(statements) { - var seen_dirs = []; - for (var i = 0; i < statements.length;) { - var stat = statements[i]; - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement && stat.body.every(_common_js__WEBPACK_IMPORTED_MODULE_5__.can_be_evicted_from_block)) { - CHANGED = true; - eliminate_spurious_blocks(stat.body); - statements.splice(i, 1, ...stat.body); - i += stat.body.length; - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement) { - CHANGED = true; - statements.splice(i, 1); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Directive) { - if (seen_dirs.indexOf(stat.value) < 0) { - i++; - seen_dirs.push(stat.value); - } else { - CHANGED = true; - statements.splice(i, 1); - } - } else - i++; - } - } - - function handle_if_return(statements, compressor) { - var self = compressor.self(); - var multiple_if_returns = has_multiple_if_returns(statements); - var in_lambda = self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda; - // Prevent extremely deep nesting - // https://github.com/terser/terser/issues/1432 - // https://github.com/webpack/webpack/issues/17548 - const iteration_start = Math.min(statements.length, 500); - for (var i = iteration_start; --i >= 0;) { - var stat = statements[i]; - var j = next_index(i); - var next = statements[j]; - - if (in_lambda && !next && stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return) { - if (!stat.value) { - CHANGED = true; - statements.splice(i, 1); - continue; - } - if (stat.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix && stat.value.operator == "void") { - CHANGED = true; - statements[i] = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, stat, { - body: stat.value.expression - }); - continue; - } - } - - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - let ab, new_else; - - ab = (0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.aborts)(stat.body); - if ( - can_merge_flow(ab) - && (new_else = as_statement_array_with_return(stat.body, ab)) - ) { - if (ab.label) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.remove)(ab.label.thedef.references, ab); - } - CHANGED = true; - stat = stat.clone(); - stat.condition = stat.condition.negate(compressor); - stat.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, stat, { - body: (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.as_statement_array)(stat.alternative).concat(extract_defuns()) - }); - stat.alternative = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, stat, { - body: new_else - }); - statements[i] = stat.transform(compressor); - continue; - } - - ab = (0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.aborts)(stat.alternative); - if ( - can_merge_flow(ab) - && (new_else = as_statement_array_with_return(stat.alternative, ab)) - ) { - if (ab.label) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.remove)(ab.label.thedef.references, ab); - } - CHANGED = true; - stat = stat.clone(); - stat.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, stat.body, { - body: (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.as_statement_array)(stat.body).concat(extract_defuns()) - }); - stat.alternative = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, stat.alternative, { - body: new_else - }); - statements[i] = stat.transform(compressor); - continue; - } - } - - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If && stat.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return) { - var value = stat.body.value; - //--- - // pretty silly case, but: - // if (foo()) return; return; ==> foo(); return; - if (!value && !stat.alternative - && (in_lambda && !next || next instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return && !next.value)) { - CHANGED = true; - statements[i] = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, stat.condition, { - body: stat.condition - }); - continue; - } - //--- - // if (foo()) return x; return y; ==> return foo() ? x : y; - if (value && !stat.alternative && next instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return && next.value) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = next; - statements[i] = stat.transform(compressor); - statements.splice(j, 1); - continue; - } - //--- - // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined; - if (value && !stat.alternative - && (!next && in_lambda && multiple_if_returns - || next instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return)) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = next || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return, stat, { - value: null - }); - statements[i] = stat.transform(compressor); - if (next) - statements.splice(j, 1); - continue; - } - //--- - // if (a) return b; if (c) return d; e; ==> return a ? b : c ? d : void e; - // - // if sequences is not enabled, this can lead to an endless loop (issue #866). - // however, with sequences on this helps producing slightly better output for - // the example code. - var prev = statements[prev_index(i)]; - if (compressor.option("sequences") && in_lambda && !stat.alternative - && prev instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If && prev.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return - && next_index(j) == statements.length && next instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement, next, { - body: [ - next, - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return, next, { - value: null - }) - ] - }); - statements[i] = stat.transform(compressor); - statements.splice(j, 1); - continue; - } - } - } - - function has_multiple_if_returns(statements) { - var n = 0; - for (var i = statements.length; --i >= 0;) { - var stat = statements[i]; - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If && stat.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return) { - if (++n > 1) - return true; - } - } - return false; - } - - function is_return_void(value) { - return !value || value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPrefix && value.operator == "void"; - } - - function can_merge_flow(ab) { - if (!ab) - return false; - for (var j = i + 1, len = statements.length; j < len; j++) { - var stat = statements[j]; - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Const || stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Let) - return false; - } - var lct = ab instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LoopControl ? compressor.loopcontrol_target(ab) : null; - return ab instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return && in_lambda && is_return_void(ab.value) - || ab instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Continue && self === loop_body(lct) - || ab instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break && lct instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement && self === lct; - } - - function extract_defuns() { - var tail = statements.slice(i + 1); - statements.length = i + 1; - return tail.filter(function (stat) { - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun) { - statements.push(stat); - return false; - } - return true; - }); - } - - function as_statement_array_with_return(node, ab) { - var body = (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.as_statement_array)(node); - if (ab !== body[body.length - 1]) { - return undefined; - } - body = body.slice(0, -1); - if (!body.every(stat => (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.can_be_evicted_from_block)(stat))) { - return undefined; - } - if (ab.value) { - body.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, ab.value, { - body: ab.value.expression - })); - } - return body; - } - - function next_index(i) { - for (var j = i + 1, len = statements.length; j < len; j++) { - var stat = statements[j]; - if (!(stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var && declarations_only(stat))) { - break; - } - } - return j; - } - - function prev_index(i) { - for (var j = i; --j >= 0;) { - var stat = statements[j]; - if (!(stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var && declarations_only(stat))) { - break; - } - } - return j; - } - } - - function eliminate_dead_code(statements, compressor) { - var has_quit; - var self = compressor.self(); - for (var i = 0, n = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LoopControl) { - var lct = compressor.loopcontrol_target(stat); - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break - && !(lct instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_IterationStatement) - && loop_body(lct) === self - || stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Continue - && loop_body(lct) === self) { - if (stat.label) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.remove)(stat.label.thedef.references, stat); - } - } else { - statements[n++] = stat; - } - } else { - statements[n++] = stat; - } - if ((0,_inference_js__WEBPACK_IMPORTED_MODULE_3__.aborts)(stat)) { - has_quit = statements.slice(i + 1); - break; - } - } - statements.length = n; - CHANGED = n != len; - if (has_quit) - has_quit.forEach(function (stat) { - trim_unreachable_code(compressor, stat, statements); - }); - } - - function declarations_only(node) { - return node.definitions.every((var_def) => !var_def.value); - } - - function sequencesize(statements, compressor) { - if (statements.length < 2) - return; - var seq = [], n = 0; - function push_seq() { - if (!seq.length) - return; - var body = (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.make_sequence)(seq[0], seq); - statements[n++] = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, body, { body: body }); - seq = []; - } - for (var i = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - if (seq.length >= compressor.sequences_limit) - push_seq(); - var body = stat.body; - if (seq.length > 0) - body = body.drop_side_effect_free(compressor); - if (body) - (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.merge_sequence)(seq, body); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions && declarations_only(stat) - || stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun) { - statements[n++] = stat; - } else { - push_seq(); - statements[n++] = stat; - } - } - push_seq(); - statements.length = n; - if (n != len) - CHANGED = true; - } - - function to_simple_statement(block, decls) { - if (!(block instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BlockStatement)) - return block; - var stat = null; - for (var i = 0, len = block.body.length; i < len; i++) { - var line = block.body[i]; - if (line instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var && declarations_only(line)) { - decls.push(line); - } else if (stat || line instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Const || line instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Let) { - return false; - } else { - stat = line; - } - } - return stat; - } - - function sequencesize_2(statements, compressor) { - function cons_seq(right) { - n--; - CHANGED = true; - var left = prev.body; - return (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.make_sequence)(left, [left, right]).transform(compressor); - } - var n = 0, prev; - for (var i = 0; i < statements.length; i++) { - var stat = statements[i]; - if (prev) { - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit) { - stat.value = cons_seq(stat.value || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined, stat).transform(compressor)); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For) { - if (!(stat.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions)) { - const abort = (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk)(prev.body, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Scope) - return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary - && node.operator === "in") { - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_abort; - } - }); - if (!abort) { - if (stat.init) - stat.init = cons_seq(stat.init); - else { - stat.init = prev.body; - n--; - CHANGED = true; - } - } - } - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn) { - if (!(stat.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Const) && !(stat.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Let)) { - stat.object = cons_seq(stat.object); - } - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - stat.condition = cons_seq(stat.condition); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch) { - stat.expression = cons_seq(stat.expression); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With) { - stat.expression = cons_seq(stat.expression); - } - } - if (compressor.option("conditionals") && stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - var decls = []; - var body = to_simple_statement(stat.body, decls); - var alt = to_simple_statement(stat.alternative, decls); - if (body !== false && alt !== false && decls.length > 0) { - var len = decls.length; - decls.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, stat, { - condition: stat.condition, - body: body || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement, stat.body), - alternative: alt - })); - decls.unshift(n, 1); - [].splice.apply(statements, decls); - i += len; - n += len + 1; - prev = null; - CHANGED = true; - continue; - } - } - statements[n++] = stat; - prev = stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement ? stat : null; - } - statements.length = n; - } - - function join_object_assignments(defn, body) { - if (!(defn instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions)) - return; - var def = defn.definitions[defn.definitions.length - 1]; - if (!(def.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object)) - return; - var exprs; - if (body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign && !body.logical) { - exprs = [body]; - } else if (body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - exprs = body.expressions.slice(); - } - if (!exprs) - return; - var trimmed = false; - do { - var node = exprs[0]; - if (!(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Assign)) - break; - if (node.operator != "=") - break; - if (!(node.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess)) - break; - var sym = node.left.expression; - if (!(sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef)) - break; - if (def.name.name != sym.name) - break; - if (!node.right.is_constant_expression(nearest_scope)) - break; - var prop = node.left.property; - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - prop = prop.evaluate(compressor); - } - if (prop instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) - break; - prop = "" + prop; - var diff = compressor.option("ecma") < 2015 - && compressor.has_directive("use strict") ? function (node) { - return node.key != prop && (node.key && node.key.name != prop); - } : function (node) { - return node.key && node.key.name != prop; - }; - if (!def.value.properties.every(diff)) - break; - var p = def.value.properties.filter(function (p) { return p.key === prop; })[0]; - if (!p) { - def.value.properties.push((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal, node, { - key: prop, - value: node.right - })); - } else { - p.value = new _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence({ - start: p.start, - expressions: [p.value.clone(), node.right.clone()], - end: p.end - }); - } - exprs.shift(); - trimmed = true; - } while (exprs.length); - return trimmed && exprs; - } - - function join_consecutive_vars(statements) { - var defs; - for (var i = 0, j = -1, len = statements.length; i < len; i++) { - var stat = statements[i]; - var prev = statements[j]; - if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions) { - if (prev && prev.TYPE == stat.TYPE) { - prev.definitions = prev.definitions.concat(stat.definitions); - CHANGED = true; - } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) { - defs.definitions = defs.definitions.concat(stat.definitions); - CHANGED = true; - } else { - statements[++j] = stat; - defs = stat; - } - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit) { - stat.value = extract_object_assignments(stat.value); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For) { - var exprs = join_object_assignments(prev, stat.init); - if (exprs) { - CHANGED = true; - stat.init = exprs.length ? (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.make_sequence)(stat.init, exprs) : null; - statements[++j] = stat; - } else if ( - prev instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var - && (!stat.init || stat.init.TYPE == prev.TYPE) - ) { - if (stat.init) { - prev.definitions = prev.definitions.concat(stat.init.definitions); - } - stat.init = prev; - statements[j] = stat; - CHANGED = true; - } else if ( - defs instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var - && stat.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var - && declarations_only(stat.init) - ) { - defs.definitions = defs.definitions.concat(stat.init.definitions); - stat.init = null; - statements[++j] = stat; - CHANGED = true; - } else { - statements[++j] = stat; - } - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn) { - stat.object = extract_object_assignments(stat.object); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If) { - stat.condition = extract_object_assignments(stat.condition); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement) { - var exprs = join_object_assignments(prev, stat.body); - if (exprs) { - CHANGED = true; - if (!exprs.length) - continue; - stat.body = (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.make_sequence)(stat.body, exprs); - } - statements[++j] = stat; - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch) { - stat.expression = extract_object_assignments(stat.expression); - } else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With) { - stat.expression = extract_object_assignments(stat.expression); - } else { - statements[++j] = stat; - } - } - statements.length = j + 1; - - function extract_object_assignments(value) { - statements[++j] = stat; - var exprs = join_object_assignments(prev, value); - if (exprs) { - CHANGED = true; - if (exprs.length) { - return (0,_common_js__WEBPACK_IMPORTED_MODULE_5__.make_sequence)(value, exprs); - } else if (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) { - return value.tail_node().left; - } else { - return value.left; - } - } - return value; - } - } -} - - -/***/ }), - -/***/ "./node_modules/terser/lib/equivalent-to.js": -/*!**************************************************!*\ - !*** ./node_modules/terser/lib/equivalent-to.js ***! - \**************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ equivalent_to: () => (/* binding */ equivalent_to) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); - - -const shallow_cmp = (node1, node2) => { - return ( - node1 === null && node2 === null - || node1.TYPE === node2.TYPE && node1.shallow_cmp(node2) - ); -}; - -const equivalent_to = (tree1, tree2) => { - if (!shallow_cmp(tree1, tree2)) return false; - const walk_1_state = [tree1]; - const walk_2_state = [tree2]; - - const walk_1_push = walk_1_state.push.bind(walk_1_state); - const walk_2_push = walk_2_state.push.bind(walk_2_state); - - while (walk_1_state.length && walk_2_state.length) { - const node_1 = walk_1_state.pop(); - const node_2 = walk_2_state.pop(); - - if (!shallow_cmp(node_1, node_2)) return false; - - node_1._children_backwards(walk_1_push); - node_2._children_backwards(walk_2_push); - - if (walk_1_state.length !== walk_2_state.length) { - // Different number of children - return false; - } - } - - return walk_1_state.length == 0 && walk_2_state.length == 0; -}; - -const pass_through = () => true; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.prototype.shallow_cmp = function () { - throw new Error("did not find a shallow_cmp function for " + this.constructor.name); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Debugger.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Directive.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement.prototype.shallow_cmp = function(other) { - return this.label.name === other.label.name; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Do.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_While.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For.prototype.shallow_cmp = function(other) { - return (this.init == null ? other.init == null : this.init === other.init) && (this.condition == null ? other.condition == null : this.condition === other.condition) && (this.step == null ? other.step == null : this.step === other.step); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForOf.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda.prototype.shallow_cmp = function(other) { - return this.is_generator === other.is_generator && this.async === other.async; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring.prototype.shallow_cmp = function(other) { - return this.is_array === other.is_array; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrefixedTemplateString.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateSegment.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Jump.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LoopControl.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Await.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Yield.prototype.shallow_cmp = function(other) { - return this.is_star === other.is_star; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If.prototype.shallow_cmp = function(other) { - return this.alternative == null ? other.alternative == null : this.alternative === other.alternative; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SwitchBranch.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try.prototype.shallow_cmp = function(other) { - return (this.body === other.body) && (this.bcatch == null ? other.bcatch == null : this.bcatch === other.bcatch) && (this.bfinally == null ? other.bfinally == null : this.bfinally === other.bfinally); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Catch.prototype.shallow_cmp = function(other) { - return this.argname == null ? other.argname == null : this.argname === other.argname; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Finally.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef.prototype.shallow_cmp = function(other) { - return this.value == null ? other.value == null : this.value === other.value; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NameMapping.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Import.prototype.shallow_cmp = function(other) { - return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names) && (this.attributes == null ? other.attributes == null : this.attributes === other.attributes); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ImportMeta.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export.prototype.shallow_cmp = function(other) { - return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && (this.attributes == null ? other.attributes == null : this.attributes === other.attributes) && this.module_name === other.module_name && this.is_default === other.is_default; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot.prototype.shallow_cmp = function(other) { - return this.property === other.property; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DotHash.prototype.shallow_cmp = function(other) { - return this.property === other.property; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary.prototype.shallow_cmp = function(other) { - return this.operator === other.operator; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary.prototype.shallow_cmp = function(other) { - return this.operator === other.operator; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateIn.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectProperty.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal.prototype.shallow_cmp = function(other) { - return this.key === other.key && this.quote === other.quote; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectSetter.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectGetter.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateMethod.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class.prototype.shallow_cmp = function(other) { - return (this.name == null ? other.name == null : this.name === other.name) && (this.extends == null ? other.extends == null : this.extends === other.extends); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassProperty.prototype.shallow_cmp = function(other) { - return this.static === other.static - && (typeof this.key === "string" - ? this.key === other.key - : true /* AST_Node handled elsewhere */); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassPrivateProperty.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol.prototype.shallow_cmp = function(other) { - return this.name === other.name; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NewTarget.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Super.prototype.shallow_cmp = pass_through; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BigInt.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp.prototype.shallow_cmp = function (other) { - return ( - this.value.flags === other.value.flags - && this.value.source === other.value.source - ); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Atom.prototype.shallow_cmp = pass_through; - - -/***/ }), - -/***/ "./node_modules/terser/lib/minify.js": -/*!*******************************************!*\ - !*** ./node_modules/terser/lib/minify.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ minify: () => (/* binding */ minify), -/* harmony export */ minify_sync: () => (/* binding */ minify_sync), -/* harmony export */ to_ascii: () => (/* binding */ to_ascii) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parse.js */ "./node_modules/terser/lib/parse.js"); -/* harmony import */ var _output_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./output.js */ "./node_modules/terser/lib/output.js"); -/* harmony import */ var _compress_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./compress/index.js */ "./node_modules/terser/lib/compress/index.js"); -/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scope.js */ "./node_modules/terser/lib/scope.js"); -/* harmony import */ var _sourcemap_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sourcemap.js */ "./node_modules/terser/lib/sourcemap.js"); -/* harmony import */ var _propmangle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./propmangle.js */ "./node_modules/terser/lib/propmangle.js"); -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); - -/* eslint-env browser, es6, node */ - - - - - - - - - - -// to/from base64 functions -// Prefer built-in Buffer, if available, then use hack -// https://developer.mozilla.org/en-US/docs/Glossary/Base64#The_Unicode_Problem -var to_ascii = typeof Buffer !== "undefined" - ? (b64) => Buffer.from(b64, "base64").toString() - : (b64) => decodeURIComponent(escape(atob(b64))); -var to_base64 = typeof Buffer !== "undefined" - ? (str) => Buffer.from(str).toString("base64") - : (str) => btoa(unescape(encodeURIComponent(str))); - -function read_source_map(code) { - var match = /(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(code); - if (!match) { - console.warn("inline source map not found"); - return null; - } - return to_ascii(match[2]); -} - -function set_shorthand(name, options, keys) { - if (options[name]) { - keys.forEach(function(key) { - if (options[key]) { - if (typeof options[key] != "object") options[key] = {}; - if (!(name in options[key])) options[key][name] = options[name]; - } - }); - } -} - -function init_cache(cache) { - if (!cache) return; - if (!("props" in cache)) { - cache.props = new Map(); - } else if (!(cache.props instanceof Map)) { - cache.props = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.map_from_object)(cache.props); - } -} - -function cache_to_json(cache) { - return { - props: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.map_to_object)(cache.props) - }; -} - -function log_input(files, options, fs, debug_folder) { - if (!(fs && fs.writeFileSync && fs.mkdirSync)) { - return; - } - - try { - fs.mkdirSync(debug_folder); - } catch (e) { - if (e.code !== "EEXIST") throw e; - } - - const log_path = `${debug_folder}/terser-debug-${(Math.random() * 9999999) | 0}.log`; - - options = options || {}; - - const options_str = JSON.stringify(options, (_key, thing) => { - if (typeof thing === "function") return "[Function " + thing.toString() + "]"; - if (thing instanceof RegExp) return "[RegExp " + thing.toString() + "]"; - return thing; - }, 4); - - const files_str = (file) => { - if (typeof file === "object" && options.parse && options.parse.spidermonkey) { - return JSON.stringify(file, null, 2); - } else if (typeof file === "object") { - return Object.keys(file) - .map((key) => key + ": " + files_str(file[key])) - .join("\n\n"); - } else if (typeof file === "string") { - return "```\n" + file + "\n```"; - } else { - return file; // What do? - } - }; - - fs.writeFileSync(log_path, "Options: \n" + options_str + "\n\nInput files:\n\n" + files_str(files) + "\n"); -} - -function* minify_sync_or_async(files, options, _fs_module) { - if ( - _fs_module - && typeof process === "object" - && process.env - && typeof process.env.TERSER_DEBUG_DIR === "string" - ) { - log_input(files, options, _fs_module, process.env.TERSER_DEBUG_DIR); - } - - options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { - compress: {}, - ecma: undefined, - enclose: false, - ie8: false, - keep_classnames: undefined, - keep_fnames: false, - mangle: {}, - module: false, - nameCache: null, - output: null, - format: null, - parse: {}, - rename: undefined, - safari10: false, - sourceMap: false, - spidermonkey: false, - timings: false, - toplevel: false, - warnings: false, - wrap: false, - }, true); - - var timings = options.timings && { - start: Date.now() - }; - if (options.keep_classnames === undefined) { - options.keep_classnames = options.keep_fnames; - } - if (options.rename === undefined) { - options.rename = options.compress && options.mangle; - } - if (options.output && options.format) { - throw new Error("Please only specify either output or format option, preferrably format."); - } - options.format = options.format || options.output || {}; - set_shorthand("ecma", options, [ "parse", "compress", "format" ]); - set_shorthand("ie8", options, [ "compress", "mangle", "format" ]); - set_shorthand("keep_classnames", options, [ "compress", "mangle" ]); - set_shorthand("keep_fnames", options, [ "compress", "mangle" ]); - set_shorthand("module", options, [ "parse", "compress", "mangle" ]); - set_shorthand("safari10", options, [ "mangle", "format" ]); - set_shorthand("toplevel", options, [ "compress", "mangle" ]); - set_shorthand("warnings", options, [ "compress" ]); // legacy - var quoted_props; - if (options.mangle) { - options.mangle = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options.mangle, { - cache: options.nameCache && (options.nameCache.vars || {}), - eval: false, - ie8: false, - keep_classnames: false, - keep_fnames: false, - module: false, - nth_identifier: _scope_js__WEBPACK_IMPORTED_MODULE_5__.base54, - properties: false, - reserved: [], - safari10: false, - toplevel: false, - }, true); - if (options.mangle.properties) { - if (typeof options.mangle.properties != "object") { - options.mangle.properties = {}; - } - if (options.mangle.properties.keep_quoted) { - quoted_props = options.mangle.properties.reserved; - if (!Array.isArray(quoted_props)) quoted_props = []; - options.mangle.properties.reserved = quoted_props; - } - if (options.nameCache && !("cache" in options.mangle.properties)) { - options.mangle.properties.cache = options.nameCache.props || {}; - } - } - init_cache(options.mangle.cache); - init_cache(options.mangle.properties.cache); - } - if (options.sourceMap) { - options.sourceMap = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options.sourceMap, { - asObject: false, - content: null, - filename: null, - includeSources: false, - root: null, - url: null, - }, true); - } - - // -- Parse phase -- - if (timings) timings.parse = Date.now(); - var toplevel; - if (files instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel) { - toplevel = files; - } else { - if (typeof files == "string" || (options.parse.spidermonkey && !Array.isArray(files))) { - files = [ files ]; - } - options.parse = options.parse || {}; - options.parse.toplevel = null; - - if (options.parse.spidermonkey) { - options.parse.toplevel = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.from_mozilla_ast(Object.keys(files).reduce(function(toplevel, name) { - if (!toplevel) return files[name]; - toplevel.body = toplevel.body.concat(files[name].body); - return toplevel; - }, null)); - } else { - delete options.parse.spidermonkey; - - for (var name in files) if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.HOP)(files, name)) { - options.parse.filename = name; - options.parse.toplevel = (0,_parse_js__WEBPACK_IMPORTED_MODULE_2__.parse)(files[name], options.parse); - if (options.sourceMap && options.sourceMap.content == "inline") { - if (Object.keys(files).length > 1) - throw new Error("inline source map only works with singular input"); - options.sourceMap.content = read_source_map(files[name]); - } - } - } - if (options.parse.toplevel === null) { - throw new Error("no source file given"); - } - - toplevel = options.parse.toplevel; - } - if (quoted_props && options.mangle.properties.keep_quoted !== "strict") { - (0,_propmangle_js__WEBPACK_IMPORTED_MODULE_7__.reserve_quoted_keys)(toplevel, quoted_props); - } - var annotated_props; - if (options.mangle && options.mangle.properties) { - annotated_props = (0,_propmangle_js__WEBPACK_IMPORTED_MODULE_7__.find_annotated_props)(toplevel); - } - if (options.wrap) { - toplevel = toplevel.wrap_commonjs(options.wrap); - } - if (options.enclose) { - toplevel = toplevel.wrap_enclose(options.enclose); - } - if (timings) timings.rename = Date.now(); - // disable rename on harmony due to expand_names bug in for-of loops - // https://github.com/mishoo/UglifyJS2/issues/2794 - if (false) // removed by dead control flow -{} - - // -- Compress phase -- - if (timings) timings.compress = Date.now(); - if (options.compress) { - toplevel = new _compress_index_js__WEBPACK_IMPORTED_MODULE_4__.Compressor(options.compress, { - mangle_options: options.mangle - }).compress(toplevel); - } - - // -- Mangle phase -- - if (timings) timings.scope = Date.now(); - if (options.mangle) toplevel.figure_out_scope(options.mangle); - if (timings) timings.mangle = Date.now(); - if (options.mangle) { - toplevel.compute_char_frequency(options.mangle); - toplevel.mangle_names(options.mangle); - toplevel = (0,_propmangle_js__WEBPACK_IMPORTED_MODULE_7__.mangle_private_properties)(toplevel, options.mangle); - } - if (timings) timings.properties = Date.now(); - if (options.mangle && options.mangle.properties) { - toplevel = (0,_propmangle_js__WEBPACK_IMPORTED_MODULE_7__.mangle_properties)(toplevel, options.mangle.properties, annotated_props); - } - - // Format phase - if (timings) timings.format = Date.now(); - var result = {}; - if (options.format.ast) { - result.ast = toplevel; - } - if (options.format.spidermonkey) { - result.ast = toplevel.to_mozilla_ast(); - } - let format_options; - if (!(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.HOP)(options.format, "code") || options.format.code) { - // Make a shallow copy so that we can modify without mutating the user's input. - format_options = {...options.format}; - if (!format_options.ast) { - // Destroy stuff to save RAM. (unless the deprecated `ast` option is on) - format_options._destroy_ast = true; - - (0,_ast_js__WEBPACK_IMPORTED_MODULE_1__.walk)(toplevel, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope) { - node.variables = undefined; - node.enclosed = undefined; - node.parent_scope = undefined; - } - if (node.block_scope) { - node.block_scope.variables = undefined; - node.block_scope.enclosed = undefined; - node.block_scope.parent_scope = undefined; - } - }); - } - - if (options.sourceMap) { - if (options.sourceMap.includeSources && files instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel) { - throw new Error("original source content unavailable"); - } - format_options.source_map = yield* (0,_sourcemap_js__WEBPACK_IMPORTED_MODULE_6__.SourceMap)({ - file: options.sourceMap.filename, - orig: options.sourceMap.content, - root: options.sourceMap.root, - files: options.sourceMap.includeSources ? files : null, - }); - } - delete format_options.ast; - delete format_options.code; - delete format_options.spidermonkey; - var stream = (0,_output_js__WEBPACK_IMPORTED_MODULE_3__.OutputStream)(format_options); - toplevel.print(stream); - result.code = stream.get(); - if (options.sourceMap) { - Object.defineProperty(result, "map", { - configurable: true, - enumerable: true, - get() { - const map = format_options.source_map.getEncoded(); - return (result.map = options.sourceMap.asObject ? map : JSON.stringify(map)); - }, - set(value) { - Object.defineProperty(result, "map", { - value, - writable: true, - }); - } - }); - result.decoded_map = format_options.source_map.getDecoded(); - if (options.sourceMap.url == "inline") { - var sourceMap = typeof result.map === "object" ? JSON.stringify(result.map) : result.map; - result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(sourceMap); - } else if (options.sourceMap.url) { - result.code += "\n//# sourceMappingURL=" + options.sourceMap.url; - } - } - } - if (options.nameCache && options.mangle) { - if (options.mangle.cache) options.nameCache.vars = cache_to_json(options.mangle.cache); - if (options.mangle.properties && options.mangle.properties.cache) { - options.nameCache.props = cache_to_json(options.mangle.properties.cache); - } - } - if (format_options && format_options.source_map) { - format_options.source_map.destroy(); - } - if (timings) { - timings.end = Date.now(); - result.timings = { - parse: 1e-3 * (timings.rename - timings.parse), - rename: 1e-3 * (timings.compress - timings.rename), - compress: 1e-3 * (timings.scope - timings.compress), - scope: 1e-3 * (timings.mangle - timings.scope), - mangle: 1e-3 * (timings.properties - timings.mangle), - properties: 1e-3 * (timings.format - timings.properties), - format: 1e-3 * (timings.end - timings.format), - total: 1e-3 * (timings.end - timings.start) - }; - } - return result; -} - -async function minify(files, options, _fs_module) { - const gen = minify_sync_or_async(files, options, _fs_module); - - let yielded; - let val; - do { - val = gen.next(await yielded); - yielded = val.value; - } while (!val.done); - - return val.value; -} - -function minify_sync(files, options, _fs_module) { - const gen = minify_sync_or_async(files, options, _fs_module); - - let yielded; - let val; - do { - if (yielded && typeof yielded.then === "function") { - throw new Error("minify_sync cannot be used with the legacy source-map module"); - } - val = gen.next(yielded); - yielded = val.value; - } while (!val.done); - - return val.value; -} - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/mozilla-ast.js": -/*!************************************************!*\ - !*** ./node_modules/terser/lib/mozilla-ast.js ***! - \************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parse.js */ "./node_modules/terser/lib/parse.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - -(function() { - - var normalize_directives = function(body) { - for (var i = 0; i < body.length; i++) { - if (body[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Statement && body[i].body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String) { - body[i] = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Directive({ - start: body[i].start, - end: body[i].end, - quote: '"', - value: body[i].body.value - }); - } else { - return body; - } - } - - return body; - }; - - function import_attributes_from_moz(attributes) { - if (attributes && attributes.length > 0) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object({ - start: my_start_token(attributes), - end: my_end_token(attributes), - properties: attributes.map((attr) => - new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal({ - start: my_start_token(attr), - end: my_end_token(attr), - key: attr.key.name || attr.key.value, - value: from_moz(attr.value) - }) - ) - }); - } - return null; - } - - var MOZ_TO_ME = { - Program: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel({ - start: my_start_token(M), - end: my_end_token(M), - body: normalize_directives(M.body.map(from_moz)) - }); - }, - - ArrayPattern: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.elements.map(function(elm) { - if (elm === null) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole(); - } - return from_moz(elm); - }), - is_array: true - }); - }, - - ObjectPattern: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.properties.map(from_moz), - is_array: false - }); - }, - - AssignmentPattern: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign({ - start: my_start_token(M), - end: my_end_token(M), - left: from_moz(M.left), - operator: "=", - right: from_moz(M.right) - }); - }, - - SpreadElement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - RestElement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - TemplateElement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TemplateSegment({ - start: my_start_token(M), - end: my_end_token(M), - value: M.value.cooked, - raw: M.value.raw - }); - }, - - TemplateLiteral: function(M) { - var segments = []; - for (var i = 0; i < M.quasis.length; i++) { - segments.push(from_moz(M.quasis[i])); - if (M.expressions[i]) { - segments.push(from_moz(M.expressions[i])); - } - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TemplateString({ - start: my_start_token(M), - end: my_end_token(M), - segments: segments - }); - }, - - TaggedTemplateExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrefixedTemplateString({ - start: my_start_token(M), - end: my_end_token(M), - template_string: from_moz(M.quasi), - prefix: from_moz(M.tag) - }); - }, - - FunctionDeclaration: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun({ - start: my_start_token(M), - end: my_end_token(M), - name: M.id && from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefun, M.id), - argnames: M.params.map(M => from_moz_pattern(M, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg)), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - }, - - FunctionExpression: function(M) { - return from_moz_lambda(M, /*is_method=*/false); - }, - - ArrowFunctionExpression: function(M) { - const body = M.body.type === "BlockStatement" - ? from_moz(M.body).body - : [(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.make_node)(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Return, {}, { value: from_moz(M.body) })]; - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Arrow({ - start: my_start_token(M), - end: my_end_token(M), - argnames: M.params.map(p => from_moz_pattern(p, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg)), - body, - async: M.async, - }); - }, - - ExpressionStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SimpleStatement({ - start: my_start_token(M), - end: my_end_token(M), - body: from_moz(M.expression) - }); - }, - - TryStatement: function(M) { - var handlers = M.handlers || [M.handler]; - if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) { - throw new Error("Multiple catch clauses are not supported."); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Try({ - start : my_start_token(M), - end : my_end_token(M), - body : new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TryBlock(from_moz(M.block)), - bcatch : from_moz(handlers[0]), - bfinally : M.finalizer ? new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Finally(from_moz(M.finalizer)) : null - }); - }, - - Property: function(M) { - if (M.kind == "init" && !M.method) { - var args = { - start : my_start_token(M.key || M.value), - end : my_end_token(M.value), - key : M.computed - ? from_moz(M.key) - : M.key.name || String(M.key.value), - quote : from_moz_quote(M.key, M.computed), - static : false, // always an object - value : from_moz(M.value) - }; - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal(args); - } else { - var value = from_moz_lambda(M.value, /*is_method=*/true); - var args = { - start : my_start_token(M.key || M.value), - end : my_end_token(M.value), - key : M.computed - ? from_moz(M.key) - : from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod, M.key), - quote : from_moz_quote(M.key, M.computed), - static : false, // always an object - value, - }; - - if (M.kind == "get") return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectGetter(args); - if (M.kind == "set") return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectSetter(args); - if (M.method) return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ConciseMethod(args); - } - }, - - MethodDefinition: function(M) { - const is_private = M.key.type === "PrivateIdentifier"; - const key = M.computed ? from_moz(M.key) : new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod({ name: M.key.name || String(M.key.value) }); - - var args = { - start : my_start_token(M), - end : my_end_token(M), - key, - quote : from_moz_quote(M.key, M.computed), - value : from_moz_lambda(M.value, /*is_method=*/true), - static : M.static, - }; - if (M.kind == "get") { - return new (is_private ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateGetter : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectGetter)(args); - } - if (M.kind == "set") { - return new (is_private ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateSetter : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectSetter)(args); - } - return new (is_private ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateMethod : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ConciseMethod)(args); - }, - - FieldDefinition: function(M) { - let key; - if (M.computed) { - key = from_moz(M.key); - } else { - if (M.key.type !== "Identifier") throw new Error("Non-Identifier key in FieldDefinition"); - key = from_moz(M.key); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassProperty({ - start : my_start_token(M), - end : my_end_token(M), - quote : from_moz_quote(M.key, M.computed), - key, - value : from_moz(M.value), - static : M.static, - }); - }, - - PropertyDefinition: function(M) { - let key; - if (M.computed) { - key = from_moz(M.key); - } else if (M.key.type === "PrivateIdentifier") { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassPrivateProperty({ - start : my_start_token(M), - end : my_end_token(M), - key : from_moz(M.key), - value : from_moz(M.value), - static : M.static, - }); - } else { - key = from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolClassProperty, M.key); - } - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassProperty({ - start : my_start_token(M), - end : my_end_token(M), - quote : from_moz_quote(M.key, M.computed), - key, - value : from_moz(M.value), - static : M.static, - }); - }, - - PrivateIdentifier: function (M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolPrivateProperty({ - start: my_start_token(M), - end: my_end_token(M), - name: M.name - }); - }, - - StaticBlock: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassStaticBlock({ - start : my_start_token(M), - end : my_end_token(M), - body : M.body.map(from_moz), - }); - }, - - ArrayExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array({ - start : my_start_token(M), - end : my_end_token(M), - elements : M.elements.map(function(elem) { - return elem === null ? new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole() : from_moz(elem); - }) - }); - }, - - ObjectExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object({ - start : my_start_token(M), - end : my_end_token(M), - properties : M.properties.map(function(prop) { - if (prop.type === "SpreadElement") { - return from_moz(prop); - } - prop.type = "Property"; - return from_moz(prop); - }) - }); - }, - - SequenceExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sequence({ - start : my_start_token(M), - end : my_end_token(M), - expressions: M.expressions.map(from_moz) - }); - }, - - MemberExpression: function(M) { - if (M.property.type === "PrivateIdentifier") { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DotHash({ - start : my_start_token(M), - end : my_end_token(M), - property : M.property.name, - expression : from_moz(M.object), - optional : M.optional || false - }); - } - return new (M.computed ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sub : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Dot)({ - start : my_start_token(M), - end : my_end_token(M), - property : M.computed ? from_moz(M.property) : M.property.name, - expression : from_moz(M.object), - optional : M.optional || false - }); - }, - - ChainExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Chain({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.expression) - }); - }, - - SwitchCase: function(M) { - return new (M.test ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Case : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Default)({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.test), - body : M.consequent.map(from_moz) - }); - }, - - VariableDeclaration: function(M) { - let decl_type; - let sym_type; - if (M.kind === "const") { - decl_type = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Const; - sym_type = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolConst; - } else if (M.kind === "let") { - decl_type = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Let; - sym_type = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLet; - } else { - decl_type = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Var; - sym_type = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolVar; - } - const definitions = M.declarations.map(M => { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_VarDef({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz_pattern(M.id, sym_type), - value: from_moz(M.init), - }); - }); - return new decl_type({ - start : my_start_token(M), - end : my_end_token(M), - definitions : definitions, - }); - }, - - ImportDeclaration: function(M) { - var imported_name = null; - var imported_names = null; - M.specifiers.forEach(function (specifier) { - if (specifier.type === "ImportSpecifier" || specifier.type === "ImportNamespaceSpecifier") { - if (!imported_names) { imported_names = []; } - imported_names.push(from_moz(specifier)); - } else if (specifier.type === "ImportDefaultSpecifier") { - imported_name = from_moz(specifier); - } - }); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Import({ - start : my_start_token(M), - end : my_end_token(M), - imported_name: imported_name, - imported_names : imported_names, - module_name : from_moz(M.source), - attributes: import_attributes_from_moz(M.attributes || M.assertions) - }); - }, - - ImportSpecifier: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - foreign_name: from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImportForeign, M.imported, M.imported.type === "Literal"), - name: from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport, M.local) - }); - }, - - ImportDefaultSpecifier: function(M) { - return from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport, M.local); - }, - - ImportNamespaceSpecifier: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - foreign_name: new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImportForeign({ name: "*" }), - name: from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport, M.local) - }); - }, - - ImportExpression: function(M) { - const args = [from_moz(M.source)]; - if (M.options) { - args.push(from_moz(M.options)); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz({ - type: "Identifier", - name: "import" - }), - optional: false, - args - }); - }, - - ExportAllDeclaration: function(M) { - var foreign_name = M.exported == null ? - new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExportForeign({ name: "*" }) : - from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExportForeign, M.exported, M.exported.type === "Literal"); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_names: [ - new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - name: new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExport({ name: "*" }), - foreign_name: foreign_name - }) - ], - module_name: from_moz(M.source), - attributes: import_attributes_from_moz(M.attributes || M.assertions) - }); - }, - - ExportNamedDeclaration: function(M) { - if (M.declaration) { - // export const, export function, ... - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_definition: from_moz(M.declaration), - exported_names: null, - module_name: null, - attributes: null, - }); - } else { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_definition: null, - exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(from_moz) : [], - module_name: from_moz(M.source), - attributes: import_attributes_from_moz(M.attributes || M.assertions), - }); - } - }, - - ExportDefaultDeclaration: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_value: from_moz(M.declaration), - is_default: true - }); - }, - - ExportSpecifier: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - foreign_name: from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExportForeign, M.exported, M.exported.type === "Literal"), - name: from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExport, M.local, M.local.type === "Literal"), - }); - }, - - Literal: function(M) { - var val = M.value, args = { - start : my_start_token(M), - end : my_end_token(M) - }; - var rx = M.regex; - if (rx && rx.pattern) { - // RegExpLiteral as per ESTree AST spec - args.value = { - source: rx.pattern, - flags: rx.flags - }; - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_RegExp(args); - } else if (rx) { - // support legacy RegExp - const rx_source = M.raw || val; - const match = rx_source.match(/^\/(.*)\/(\w*)$/); - if (!match) throw new Error("Invalid regex source " + rx_source); - const [_, source, flags] = match; - args.value = { source, flags }; - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_RegExp(args); - } - const bi = typeof M.value === "bigint" ? M.value.toString() : M.bigint; - if (typeof bi === "string") { - args.value = bi; - args.raw = M.raw; - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BigInt(args); - } - if (val === null) return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Null(args); - switch (typeof val) { - case "string": - args.quote = "\""; - args.value = val; - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String(args); - case "number": - args.value = val; - args.raw = M.raw || val.toString(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Number(args); - case "boolean": - return new (val ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_True : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_False)(args); - } - }, - - MetaProperty: function(M) { - if (M.meta.name === "new" && M.property.name === "target") { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NewTarget({ - start: my_start_token(M), - end: my_end_token(M) - }); - } else if (M.meta.name === "import" && M.property.name === "meta") { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ImportMeta({ - start: my_start_token(M), - end: my_end_token(M) - }); - } - }, - - Identifier: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef({ - start : my_start_token(M), - end : my_end_token(M), - name : M.name - }); - }, - - EmptyStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_EmptyStatement({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - BlockStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BlockStatement({ - start: my_start_token(M), - end: my_end_token(M), - body: M.body.map(from_moz) - }); - }, - - IfStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_If({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.consequent), - alternative: from_moz(M.alternate) - }); - }, - - LabeledStatement: function(M) { - try { - const label = from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Label, M.label); - FROM_MOZ_LABELS.push(label); - - const stat = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabeledStatement({ - start: my_start_token(M), - end: my_end_token(M), - label, - body: from_moz(M.body) - }); - - return stat; - } finally { - FROM_MOZ_LABELS.pop(); - } - }, - - BreakStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Break({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz_label_ref(M.label), - }); - }, - - ContinueStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Continue({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz_label_ref(M.label), - }); - }, - - WithStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_With({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.object), - body: from_moz(M.body) - }); - }, - - SwitchStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Switch({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.discriminant), - body: M.cases.map(from_moz) - }); - }, - - ReturnStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Return({ - start: my_start_token(M), - end: my_end_token(M), - value: from_moz(M.argument) - }); - }, - - ThrowStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Throw({ - start: my_start_token(M), - end: my_end_token(M), - value: from_moz(M.argument) - }); - }, - - WhileStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_While({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.body) - }); - }, - - DoWhileStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Do({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.body) - }); - }, - - ForStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_For({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.init), - condition: from_moz(M.test), - step: from_moz(M.update), - body: from_moz(M.body) - }); - }, - - ForInStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForIn({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.left), - object: from_moz(M.right), - body: from_moz(M.body) - }); - }, - - ForOfStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForOf({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.left), - object: from_moz(M.right), - body: from_moz(M.body), - await: M.await - }); - }, - - AwaitExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Await({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - YieldExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Yield({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument), - is_star: M.delegate - }); - }, - - DebuggerStatement: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Debugger({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - CatchClause: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Catch({ - start: my_start_token(M), - end: my_end_token(M), - argname: M.param ? from_moz_pattern(M.param, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch) : null, - body: from_moz(M.body).body - }); - }, - - ThisExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_This({ - start: my_start_token(M), - name: "this", - end: my_end_token(M) - }); - }, - - Super: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Super({ - start: my_start_token(M), - end: my_end_token(M), - name: "super", - }); - }, - - BinaryExpression: function(M) { - if (M.left.type === "PrivateIdentifier") { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateIn({ - start: my_start_token(M), - end: my_end_token(M), - key: new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolPrivateProperty({ - start: my_start_token(M.left), - end: my_end_token(M.left), - name: M.left.name - }), - value: from_moz(M.right), - }); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Binary({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - LogicalExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Binary({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - AssignmentExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Assign({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - logical: M.operator === "??=" || M.operator === "&&=" || M.operator === "||=", - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - ConditionalExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Conditional({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - consequent: from_moz(M.consequent), - alternative: from_moz(M.alternate) - }); - }, - - NewExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_New({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.callee), - args: M.arguments.map(from_moz) - }); - }, - - CallExpression: function(M) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.callee), - optional: M.optional, - args: M.arguments.map(from_moz) - }); - } - }; - - MOZ_TO_ME.UpdateExpression = - MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) { - var prefix = "prefix" in M ? M.prefix - : M.type == "UnaryExpression" ? true : false; - return new (prefix ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPrefix : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPostfix)({ - start : my_start_token(M), - end : my_end_token(M), - operator : M.operator, - expression : from_moz(M.argument) - }); - }; - - MOZ_TO_ME.ClassDeclaration = - MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) { - return new (M.type === "ClassDeclaration" ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefClass : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassExpression)({ - start : my_start_token(M), - end : my_end_token(M), - name : M.id && from_moz_symbol(M.type === "ClassDeclaration" ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefClass : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolClass, M.id), - extends : from_moz(M.superClass), - properties: M.body.body.map(from_moz) - }); - }; - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_EmptyStatement, function To_Moz_EmptyStatement() { - return { - type: "EmptyStatement" - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BlockStatement, function To_Moz_BlockStatement(M) { - return { - type: "BlockStatement", - body: M.body.map(to_moz) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_If, function To_Moz_IfStatement(M) { - return { - type: "IfStatement", - test: to_moz(M.condition), - consequent: to_moz(M.body), - alternate: to_moz(M.alternative) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabeledStatement, function To_Moz_LabeledStatement(M) { - return { - type: "LabeledStatement", - label: to_moz(M.label), - body: to_moz(M.body) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Break, function To_Moz_BreakStatement(M) { - return { - type: "BreakStatement", - label: to_moz(M.label) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Continue, function To_Moz_ContinueStatement(M) { - return { - type: "ContinueStatement", - label: to_moz(M.label) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_With, function To_Moz_WithStatement(M) { - return { - type: "WithStatement", - object: to_moz(M.expression), - body: to_moz(M.body) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Switch, function To_Moz_SwitchStatement(M) { - return { - type: "SwitchStatement", - discriminant: to_moz(M.expression), - cases: M.body.map(to_moz) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Return, function To_Moz_ReturnStatement(M) { - return { - type: "ReturnStatement", - argument: to_moz(M.value) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Throw, function To_Moz_ThrowStatement(M) { - return { - type: "ThrowStatement", - argument: to_moz(M.value) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_While, function To_Moz_WhileStatement(M) { - return { - type: "WhileStatement", - test: to_moz(M.condition), - body: to_moz(M.body) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Do, function To_Moz_DoWhileStatement(M) { - return { - type: "DoWhileStatement", - test: to_moz(M.condition), - body: to_moz(M.body) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_For, function To_Moz_ForStatement(M) { - return { - type: "ForStatement", - init: to_moz(M.init), - test: to_moz(M.condition), - update: to_moz(M.step), - body: to_moz(M.body) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForIn, function To_Moz_ForInStatement(M) { - return { - type: "ForInStatement", - left: to_moz(M.init), - right: to_moz(M.object), - body: to_moz(M.body) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForOf, function To_Moz_ForOfStatement(M) { - return { - type: "ForOfStatement", - left: to_moz(M.init), - right: to_moz(M.object), - body: to_moz(M.body), - await: M.await - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Await, function To_Moz_AwaitExpression(M) { - return { - type: "AwaitExpression", - argument: to_moz(M.expression) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Yield, function To_Moz_YieldExpression(M) { - return { - type: "YieldExpression", - argument: to_moz(M.expression), - delegate: M.is_star - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Debugger, function To_Moz_DebuggerStatement() { - return { - type: "DebuggerStatement" - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_VarDef, function To_Moz_VariableDeclarator(M) { - return { - type: "VariableDeclarator", - id: to_moz(M.name), - init: to_moz(M.value) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_This, function To_Moz_ThisExpression() { - return { - type: "ThisExpression" - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Super, function To_Moz_Super() { - return { - type: "Super" - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Conditional, function To_Moz_ConditionalExpression(M) { - return { - type: "ConditionalExpression", - test: to_moz(M.condition), - consequent: to_moz(M.consequent), - alternate: to_moz(M.alternative) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_New, function To_Moz_NewExpression(M) { - return { - type: "NewExpression", - callee: to_moz(M.expression), - arguments: M.args.map(to_moz) - }; - }); - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call, function To_Moz_CallExpression(M) { - if (M.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef && M.expression.name === "import") { - const [source, options] = M.args.map(to_moz); - return { - type: "ImportExpression", - source, - options: options || null - }; - } - - return { - type: "CallExpression", - callee: to_moz(M.expression), - optional: M.optional, - arguments: M.args.map(to_moz) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel, function To_Moz_Program(M) { - return to_moz_scope("Program", M); - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion, function To_Moz_Spread(M) { - return { - type: to_moz_in_destructuring() ? "RestElement" : "SpreadElement", - argument: to_moz(M.expression) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) { - return { - type: "TaggedTemplateExpression", - tag: to_moz(M.prefix), - quasi: to_moz(M.template_string) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TemplateString, function To_Moz_TemplateLiteral(M) { - var quasis = []; - var expressions = []; - for (var i = 0; i < M.segments.length; i++) { - if (i % 2 !== 0) { - expressions.push(to_moz(M.segments[i])); - } else { - quasis.push({ - type: "TemplateElement", - value: { - raw: M.segments[i].raw, - cooked: M.segments[i].value - }, - tail: i === M.segments.length - 1 - }); - } - } - return { - type: "TemplateLiteral", - quasis: quasis, - expressions: expressions - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun, function To_Moz_FunctionDeclaration(M) { - return { - type: "FunctionDeclaration", - id: to_moz(M.name), - params: M.argnames.map(to_moz_pattern), - generator: M.is_generator, - async: M.async, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function, function To_Moz_FunctionExpression(M) { - return { - type: "FunctionExpression", - id: to_moz(M.name), - params: M.argnames.map(to_moz_pattern), - generator: M.is_generator || false, - async: M.async || false, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Arrow, function To_Moz_ArrowFunctionExpression(M) { - var body = M.body.length === 1 && M.body[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Return && M.body[0].value - ? to_moz(M.body[0].value) - : { - type: "BlockStatement", - body: M.body.map(to_moz) - }; - return { - type: "ArrowFunctionExpression", - params: M.argnames.map(to_moz_pattern), - async: M.async, - body: body, - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring, function To_Moz_ObjectPattern(M) { - if (M.is_array) { - return { - type: "ArrayPattern", - elements: M.names.map( - M => M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole ? null : to_moz_pattern(M) - ), - }; - } - return { - type: "ObjectPattern", - properties: M.names.map(M => { - if (M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal) { - var computed = M.computed_key(); - const [shorthand, key] = to_moz_property_key(M.key, computed, M.quote, M.value); - - return { - type: "Property", - computed, - kind: "init", - key: key, - method: false, - shorthand, - value: to_moz_pattern(M.value) - }; - } else { - return to_moz_pattern(M); - } - }), - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign, function To_Moz_AssignmentExpression(M) { - return { - type: "AssignmentPattern", - left: to_moz_pattern(M.left), - right: to_moz(M.right), - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Directive, function To_Moz_Directive(M) { - return { - type: "ExpressionStatement", - expression: { - type: "Literal", - value: M.value, - raw: M.print_to_string() - }, - directive: M.value - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SimpleStatement, function To_Moz_ExpressionStatement(M) { - return { - type: "ExpressionStatement", - expression: to_moz(M.body) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SwitchBranch, function To_Moz_SwitchCase(M) { - return { - type: "SwitchCase", - test: to_moz(M.expression), - consequent: M.body.map(to_moz) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Try, function To_Moz_TryStatement(M) { - return { - type: "TryStatement", - block: to_moz_block(M.body), - handler: to_moz(M.bcatch), - guardedHandlers: [], - finalizer: to_moz(M.bfinally) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Catch, function To_Moz_CatchClause(M) { - return { - type: "CatchClause", - param: M.argname != null ? to_moz_pattern(M.argname) : null, - body: to_moz_block(M) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Definitions, function To_Moz_VariableDeclaration(M) { - return { - type: "VariableDeclaration", - kind: - M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Const ? "const" : - M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Let ? "let" : "var", - declarations: M.definitions.map(to_moz) - }; - }); - - function import_attributes_to_moz(attribute) { - const import_attributes = []; - if (attribute) { - for (const { key, value } of attribute.properties) { - const key_moz = (0,_parse_js__WEBPACK_IMPORTED_MODULE_2__.is_basic_identifier_string)(key) - ? { type: "Identifier", name: key } - : { type: "Literal", value: key, raw: JSON.stringify(key) }; - import_attributes.push({ - type: "ImportAttribute", - key: key_moz, - value: to_moz(value) - }); - } - } - return import_attributes; - } - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export, function To_Moz_ExportDeclaration(M) { - if (M.exported_names) { - var first_exported = M.exported_names[0]; - if (first_exported && first_exported.name.name === "*" && !first_exported.name.quote) { - var foreign_name = first_exported.foreign_name; - var exported = foreign_name.name === "*" && !foreign_name.quote - ? null - : to_moz(foreign_name); - return { - type: "ExportAllDeclaration", - source: to_moz(M.module_name), - exported: exported, - attributes: import_attributes_to_moz(M.attributes) - }; - } - return { - type: "ExportNamedDeclaration", - specifiers: M.exported_names.map(function (name_mapping) { - return { - type: "ExportSpecifier", - exported: to_moz(name_mapping.foreign_name), - local: to_moz(name_mapping.name) - }; - }), - declaration: to_moz(M.exported_definition), - source: to_moz(M.module_name), - attributes: import_attributes_to_moz(M.attributes) - }; - } - - if (M.is_default) { - return { - type: "ExportDefaultDeclaration", - declaration: to_moz(M.exported_value || M.exported_definition), - }; - } else { - return { - type: "ExportNamedDeclaration", - declaration: to_moz(M.exported_value || M.exported_definition), - specifiers: [], - source: null, - }; - } - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Import, function To_Moz_ImportDeclaration(M) { - var specifiers = []; - if (M.imported_name) { - specifiers.push({ - type: "ImportDefaultSpecifier", - local: to_moz(M.imported_name) - }); - } - if (M.imported_names) { - var first_imported_foreign_name = M.imported_names[0].foreign_name; - if (first_imported_foreign_name.name === "*" && !first_imported_foreign_name.quote) { - specifiers.push({ - type: "ImportNamespaceSpecifier", - local: to_moz(M.imported_names[0].name) - }); - } else { - M.imported_names.forEach(function(name_mapping) { - specifiers.push({ - type: "ImportSpecifier", - local: to_moz(name_mapping.name), - imported: to_moz(name_mapping.foreign_name) - }); - }); - } - } - return { - type: "ImportDeclaration", - specifiers: specifiers, - source: to_moz(M.module_name), - attributes: import_attributes_to_moz(M.attributes) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ImportMeta, function To_Moz_MetaProperty() { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "import" - }, - property: { - type: "Identifier", - name: "meta" - } - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sequence, function To_Moz_SequenceExpression(M) { - return { - type: "SequenceExpression", - expressions: M.expressions.map(to_moz) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DotHash, function To_Moz_PrivateMemberExpression(M) { - return { - type: "MemberExpression", - object: to_moz(M.expression), - computed: false, - property: { - type: "PrivateIdentifier", - name: M.property - }, - optional: M.optional - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PropAccess, function To_Moz_MemberExpression(M) { - var isComputed = M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sub; - return { - type: "MemberExpression", - object: to_moz(M.expression), - computed: isComputed, - property: isComputed ? to_moz(M.property) : {type: "Identifier", name: M.property}, - optional: M.optional - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Chain, function To_Moz_ChainExpression(M) { - return { - type: "ChainExpression", - expression: to_moz(M.expression) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Unary, function To_Moz_Unary(M) { - return { - type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression", - operator: M.operator, - prefix: M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPrefix, - argument: to_moz(M.expression) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Binary, function To_Moz_BinaryExpression(M) { - if (M.operator == "=" && to_moz_in_destructuring()) { - return { - type: "AssignmentPattern", - left: to_moz(M.left), - right: to_moz(M.right) - }; - } - - const type = M.operator == "&&" || M.operator == "||" || M.operator === "??" - ? "LogicalExpression" - : "BinaryExpression"; - - return { - type, - left: to_moz(M.left), - operator: M.operator, - right: to_moz(M.right) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Assign, function To_Moz_AssignmentExpression(M) { - return { - type: "AssignmentExpression", - operator: M.operator, - left: to_moz(M.left), - right: to_moz(M.right) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateIn, function To_Moz_BinaryExpression_PrivateIn(M) { - return { - type: "BinaryExpression", - left: { type: "PrivateIdentifier", name: M.key.name }, - operator: "in", - right: to_moz(M.value), - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array, function To_Moz_ArrayExpression(M) { - return { - type: "ArrayExpression", - elements: M.elements.map(to_moz) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object, function To_Moz_ObjectExpression(M) { - return { - type: "ObjectExpression", - properties: M.properties.map(to_moz) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectProperty, function To_Moz_Property(M, parent) { - var computed = M.computed_key(); - const [shorthand, key] = to_moz_property_key(M.key, computed, M.quote, M.value); - - var kind; - if (M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectGetter) { - kind = "get"; - } else - if (M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectSetter) { - kind = "set"; - } - if (M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateGetter || M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateSetter) { - const kind = M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateGetter ? "get" : "set"; - return { - type: "MethodDefinition", - computed: false, - kind: kind, - static: M.static, - key: { - type: "PrivateIdentifier", - name: M.key.name - }, - value: to_moz(M.value) - }; - } - if (M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassPrivateProperty) { - return { - type: "PropertyDefinition", - key: { - type: "PrivateIdentifier", - name: M.key.name - }, - value: to_moz(M.value), - computed: false, - static: M.static - }; - } - if (M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassProperty) { - return { - type: "PropertyDefinition", - key, - value: to_moz(M.value), - computed, - static: M.static - }; - } - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Class) { - return { - type: "MethodDefinition", - computed: computed, - kind: kind, - static: M.static, - key: to_moz(M.key), - value: to_moz(M.value) - }; - } - return { - type: "Property", - computed: computed, - method: false, - shorthand, - kind: kind, - key: key, - value: to_moz(M.value) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal, function To_Moz_Property(M) { - var computed = M.computed_key(); - const [shorthand, key] = to_moz_property_key(M.key, computed, M.quote, M.value); - - return { - type: "Property", - computed: computed, - shorthand: shorthand, - method: false, - kind: "init", - key: key, - value: to_moz(M.value) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) { - const computed = M.computed_key(); - const [_always_false, key] = to_moz_property_key(M.key, computed, M.quote, M.value); - - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object) { - return { - type: "Property", - kind: "init", - computed, - method: true, - shorthand: false, - key, - value: to_moz(M.value), - }; - } - - return { - type: "MethodDefinition", - kind: !computed && M.key.name === "constructor" ? "constructor" : "method", - computed, - key, - value: to_moz(M.value), - static: M.static, - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateMethod, function To_Moz_MethodDefinition(M) { - return { - type: "MethodDefinition", - kind: "method", - key: { type: "PrivateIdentifier", name: M.key.name }, - value: to_moz(M.value), - computed: false, - static: M.static, - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Class, function To_Moz_Class(M) { - var type = M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassExpression ? "ClassExpression" : "ClassDeclaration"; - return { - type: type, - superClass: to_moz(M.extends), - id: M.name ? to_moz(M.name) : null, - body: { - type: "ClassBody", - body: M.properties.map(to_moz) - } - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassStaticBlock, function To_Moz_StaticBlock(M) { - return { - type: "StaticBlock", - body: M.body.map(to_moz), - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NewTarget, function To_Moz_MetaProperty() { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "new" - }, - property: { - type: "Identifier", - name: "target" - } - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol, function To_Moz_Identifier(M, parent) { - if ( - (M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod && parent.quote) || - (( - M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImportForeign || - M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExportForeign || - M instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExport - ) && M.quote) - ) { - return { - type: "Literal", - value: M.name - }; - } - var def = M.definition(); - return { - type: "Identifier", - name: def ? def.mangled_name || def.name : M.name - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_RegExp, function To_Moz_RegExpLiteral(M) { - const pattern = M.value.source; - const flags = M.value.flags; - return { - type: "Literal", - value: null, - raw: M.print_to_string(), - regex: { pattern, flags } - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Constant, function To_Moz_Literal(M) { - var value = M.value; - return { - type: "Literal", - value: value, - raw: M.raw || M.print_to_string() - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Atom, function To_Moz_Atom(M) { - return { - type: "Identifier", - name: String(M.value) - }; - }); - - def_to_moz(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BigInt, M => ({ - type: "Literal", - // value cannot be represented natively - // see: https://github.com/estree/estree/blob/master/es2020.md#bigintliteral - value: null, - // `M.value` is a string that may be a hex number representation. - // but "bigint" property should have only decimal digits - bigint: typeof BigInt === "function" ? BigInt(M.value).toString() : M.value, - raw: M.raw, - })); - - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Boolean.DEFMETHOD("to_mozilla_ast", _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Constant.prototype.to_mozilla_ast); - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Null.DEFMETHOD("to_mozilla_ast", _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Constant.prototype.to_mozilla_ast); - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole.DEFMETHOD("to_mozilla_ast", function To_Moz_ArrayHole() { return null; }); - - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Block.DEFMETHOD("to_mozilla_ast", _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BlockStatement.prototype.to_mozilla_ast); - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda.DEFMETHOD("to_mozilla_ast", _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function.prototype.to_mozilla_ast); - - /* -----[ tools ]----- */ - - function my_start_token(moznode) { - var loc = moznode.loc, start = loc && loc.start; - var range = moznode.range; - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Token( - "", - "", - start && start.line || 0, - start && start.column || 0, - range ? range [0] : moznode.start, - false, - [], - [], - loc && loc.source, - ); - } - - function my_end_token(moznode) { - var loc = moznode.loc, end = loc && loc.end; - var range = moznode.range; - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Token( - "", - "", - end && end.line || 0, - end && end.column || 0, - range ? range [0] : moznode.end, - false, - [], - [], - loc && loc.source, - ); - } - - var FROM_MOZ_LABELS = null; - - function from_moz(node) { - if (node == null) return null; - return MOZ_TO_ME[node.type](node); - } - - function from_moz_quote(moz_key, computed) { - if (!computed && moz_key.type === "Literal" && typeof moz_key.value === "string") { - return '"'; - } else { - return ""; - } - } - - function from_moz_symbol(symbol_type, M, has_quote) { - return new symbol_type({ - start: my_start_token(M), - quote: has_quote ? '"' : undefined, - name: M.type === "Identifier" ? M.name : String(M.value), - end: my_end_token(M), - }); - } - - function from_moz_lambda(M, is_method) { - return new (is_method ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Accessor : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function)({ - start: my_start_token(M), - end: my_end_token(M), - name: M.id && from_moz_symbol(is_method ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLambda, M.id), - argnames: M.params.map(M => from_moz_pattern(M, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg)), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - } - - function from_moz_pattern(M, sym_type) { - switch (M.type) { - case "ObjectPattern": - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.properties.map(p => from_moz_pattern(p, sym_type)), - is_array: false - }); - - case "Property": - var key = M.key; - var args = { - start : my_start_token(key || M.value), - end : my_end_token(M.value), - key : key.type == "Identifier" ? key.name : String(key.value), - quote : !M.computed && key.type === "Literal" && typeof key.value === "string" - ? '"' - : "", - value : from_moz_pattern(M.value, sym_type) - }; - if (M.computed) { - args.key = from_moz(M.key); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal(args); - - case "ArrayPattern": - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.elements.map(function(elm) { - if (elm === null) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole(); - } - return from_moz_pattern(elm, sym_type); - }), - is_array: true - }); - - case "SpreadElement": - case "RestElement": - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz_pattern(M.argument, sym_type), - }); - - case "AssignmentPattern": - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign({ - start : my_start_token(M), - end : my_end_token(M), - left : from_moz_pattern(M.left, sym_type), - operator: "=", - right : from_moz(M.right), - }); - - case "Identifier": - return new sym_type({ - start : my_start_token(M), - end : my_end_token(M), - name : M.name, - }); - - default: - throw new Error("Invalid node type for destructuring: " + M.type); - } - } - - function from_moz_label_ref(m_label) { - if (!m_label) return null; - - const label = from_moz_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabelRef, m_label); - - let i = FROM_MOZ_LABELS.length; - while (i--) { - const label_origin = FROM_MOZ_LABELS[i]; - - if (label.name === label_origin.name) { - label.thedef = label_origin; - break; - } - } - - return label; - } - - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.from_mozilla_ast = function(node) { - var save_labels = FROM_MOZ_LABELS; - FROM_MOZ_LABELS = []; - var ast = from_moz(node); - FROM_MOZ_LABELS = save_labels; - return ast; - }; - - function set_moz_loc(mynode, moznode) { - var start = mynode.start; - var end = mynode.end; - if (!(start && end)) { - return moznode; - } - if (start.pos != null && end.endpos != null) { - moznode.range = [start.pos, end.endpos]; - } - if (start.line) { - moznode.loc = { - start: {line: start.line, column: start.col}, - end: end.endline ? {line: end.endline, column: end.endcol} : null - }; - if (start.file) { - moznode.loc.source = start.file; - } - } - return moznode; - } - - function def_to_moz(mytype, handler) { - mytype.DEFMETHOD("to_mozilla_ast", function(parent) { - return set_moz_loc(this, handler(this, parent)); - }); - } - - var TO_MOZ_STACK = null; - - function to_moz(node) { - if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; } - TO_MOZ_STACK.push(node); - var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null; - TO_MOZ_STACK.pop(); - if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; } - return ast; - } - - /** Object property keys can be number literals, string literals, or raw names. Additionally they can be shorthand. We decide that here. */ - function to_moz_property_key(key, computed = false, quote = false, value = null) { - if (computed) { - return [false, to_moz(key)]; - } - - const key_name = typeof key === "string" ? key : key.name; - let moz_key; - if (quote) { - moz_key = { type: "Literal", value: key_name, raw: JSON.stringify(key_name) }; - } else if ("" + +key_name === key_name && +key_name >= 0) { - // representable as a number - moz_key = { type: "Literal", value: +key_name, raw: JSON.stringify(+key_name) }; - } else { - moz_key = { type: "Identifier", name: key_name }; - } - - const shorthand = - moz_key.type === "Identifier" - && moz_key.name === key_name - && (value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol && value.name === key_name - || value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign && value.left.name === key_name); - return [shorthand, moz_key]; - } - - function to_moz_pattern(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion) { - return { - type: "RestElement", - argument: to_moz_pattern(node.expression), - }; - } - - if (( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PropAccess - )) { - // Plain translation - return to_moz(node); - } - - throw new Error(node.TYPE); - } - - function to_moz_in_destructuring() { - var i = TO_MOZ_STACK.length; - while (i--) { - if (TO_MOZ_STACK[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring) { - return true; - } - } - return false; - } - - function to_moz_block(node) { - return { - type: "BlockStatement", - body: node.body.map(to_moz) - }; - } - - function to_moz_scope(type, node) { - var body = node.body.map(to_moz); - if (node.body[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SimpleStatement && node.body[0].body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String) { - body.unshift(to_moz(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_EmptyStatement(node.body[0]))); - } - return { - type: type, - body: body - }; - } -})(); - - -/***/ }), - -/***/ "./node_modules/terser/lib/output.js": -/*!*******************************************!*\ - !*** ./node_modules/terser/lib/output.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ OutputStream: () => (/* binding */ OutputStream) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/first_in_statement.js */ "./node_modules/terser/lib/utils/first_in_statement.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parse.js */ "./node_modules/terser/lib/parse.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - - -const CODE_LINE_BREAK = 10; -const CODE_SPACE = 32; - -const r_annotation = /[@#]__(PURE|INLINE|NOINLINE)__/; - -function is_some_comments(comment) { - // multiline comment - return ( - (comment.type === "comment2" || comment.type === "comment1") - && /@preserve|@copyright|@lic|@cc_on|^\**!/i.test(comment.value) - ); -} - -const ROPE_COMMIT_WHEN = 8 * 1000; -class Rope { - constructor() { - this.committed = ""; - this.current = ""; - } - - append(str) { - /** When `this.current` is too long, commit it. */ - if (this.current.length > ROPE_COMMIT_WHEN) { - this.committed += this.current + str; - this.current = ""; - } else { - this.current += str; - } - } - - insertAt(char, index) { - const { committed, current } = this; - if (index < committed.length) { - this.committed = committed.slice(0, index) + char + committed.slice(index); - } else if (index === committed.length) { - this.committed += char; - } else { - index -= committed.length; - this.committed += current.slice(0, index) + char; - this.current = current.slice(index); - } - } - - charAt(index) { - const { committed } = this; - if (index < committed.length) return committed[index]; - return this.current[index - committed.length]; - } - - charCodeAt(index) { - const { committed } = this; - if (index < committed.length) return committed.charCodeAt(index); - return this.current.charCodeAt(index - committed.length); - } - - length() { - return this.committed.length + this.current.length; - } - - expectDirective() { - // /^$|[;{][\s\n]*$/ - - let ch, n = this.length(); - - if (n <= 0) return true; - - // Skip N whitespace from the end - while ( - (ch = this.charCodeAt(--n)) - && (ch == CODE_SPACE || ch == CODE_LINE_BREAK) - ); - - // either ";", or "{", or the string ended - return !ch || ch === 59 || ch === 123; - } - - hasNLB() { - let n = this.length() - 1; - while (n >= 0) { - const code = this.charCodeAt(n--); - - if (code === CODE_LINE_BREAK) return true; - if (code !== CODE_SPACE) return false; - } - return true; - } - - - toString() { - return this.committed + this.current; - } -} - -function OutputStream(options) { - - var readonly = !options; - options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { - ascii_only : false, - beautify : false, - braces : false, - comments : "some", - ecma : 5, - ie8 : false, - indent_level : 4, - indent_start : 0, - inline_script : true, - keep_numbers : false, - keep_quoted_props : false, - max_line_len : false, - preamble : null, - preserve_annotations : false, - quote_keys : false, - quote_style : 0, - safari10 : false, - semicolons : true, - shebang : true, - shorthand : undefined, - source_map : null, - webkit : false, - width : 80, - wrap_iife : false, - wrap_func_args : false, - - _destroy_ast : false - }, true); - - if (options.shorthand === undefined) - options.shorthand = options.ecma > 5; - - // Convert comment option to RegExp if necessary and set up comments filter - var comment_filter = _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false; // Default case, throw all comments away - if (options.comments) { - let comments = options.comments; - if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { - var regex_pos = options.comments.lastIndexOf("/"); - comments = new RegExp( - options.comments.substr(1, regex_pos - 1), - options.comments.substr(regex_pos + 1) - ); - } - if (comments instanceof RegExp) { - comment_filter = function(comment) { - return comment.type != "comment5" && comments.test(comment.value); - }; - } else if (typeof comments === "function") { - comment_filter = function(comment) { - return comment.type != "comment5" && comments(this, comment); - }; - } else if (comments === "some") { - comment_filter = is_some_comments; - } else { // NOTE includes "all" option - comment_filter = _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_true; - } - } - - if (options.preserve_annotations) { - let prev_comment_filter = comment_filter; - comment_filter = function (comment) { - return r_annotation.test(comment.value) || prev_comment_filter.apply(this, arguments); - }; - } - - var indentation = 0; - var current_col = 0; - var current_line = 1; - var current_pos = 0; - var OUTPUT = new Rope(); - let printed_comments = new Set(); - - var to_utf8 = options.ascii_only ? function(str, identifier = false, regexp = false) { - if (options.ecma >= 2015 && !options.safari10 && !regexp) { - str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { - var code = (0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.get_full_char_code)(ch, 0).toString(16); - return "\\u{" + code + "}"; - }); - } - return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - if (code.length <= 2 && !identifier) { - while (code.length < 2) code = "0" + code; - return "\\x" + code; - } else { - while (code.length < 4) code = "0" + code; - return "\\u" + code; - } - }); - } : function(str) { - return str.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g, function(match, lone) { - if (lone) { - return "\\u" + lone.charCodeAt(0).toString(16); - } - return match; - }); - }; - - function make_string(str, quote) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, - function(s, i) { - switch (s) { - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - case "\\": return "\\\\"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\\t"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\x0B": return options.ie8 ? "\\x0B" : "\\v"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case "\ufeff": return "\\ufeff"; - case "\0": - return /[0-9]/.test((0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.get_full_char)(str, i+1)) ? "\\x00" : "\\0"; - } - return s; - }); - function quote_single() { - return "'" + str.replace(/\x27/g, "\\'") + "'"; - } - function quote_double() { - return '"' + str.replace(/\x22/g, '\\"') + '"'; - } - function quote_template() { - return "`" + str.replace(/`/g, "\\`") + "`"; - } - str = to_utf8(str); - if (quote === "`") return quote_template(); - switch (options.quote_style) { - case 1: - return quote_single(); - case 2: - return quote_double(); - case 3: - return quote == "'" ? quote_single() : quote_double(); - default: - return dq > sq ? quote_single() : quote_double(); - } - } - - function encode_string(str, quote) { - var ret = make_string(str, quote); - if (options.inline_script) { - ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); - ret = ret.replace(/\x3c!--/g, "\\x3c!--"); - ret = ret.replace(/--\x3e/g, "--\\x3e"); - } - return ret; - } - - function make_name(name) { - name = name.toString(); - name = to_utf8(name, true); - return name; - } - - function make_indent(back) { - return " ".repeat(options.indent_start + indentation - back * options.indent_level); - } - - /* -----[ beautification/minification ]----- */ - - var has_parens = false; - var might_need_space = false; - var might_need_semicolon = false; - var might_add_newline = 0; - var need_newline_indented = false; - var need_space = false; - var newline_insert = -1; - var last = ""; - var mapping_token, mapping_name, mappings = options.source_map && []; - - var do_add_mapping = mappings ? function() { - mappings.forEach(function(mapping) { - try { - let { name, token } = mapping; - if (name !== false) { - if (token.type == "name" || token.type === "privatename") { - name = token.value; - } else if (name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol) { - name = token.type === "string" ? token.value : name.name; - } - } - options.source_map.add( - mapping.token.file, - mapping.line, mapping.col, - mapping.token.line, mapping.token.col, - (0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.is_basic_identifier_string)(name) ? name : undefined - ); - } catch(ex) { - // Ignore bad mapping - } - }); - mappings = []; - } : _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop; - - var ensure_line_len = options.max_line_len ? function() { - if (current_col > options.max_line_len) { - if (might_add_newline) { - OUTPUT.insertAt("\n", might_add_newline); - const len_after_newline = OUTPUT.length() - might_add_newline - 1; - if (mappings) { - var delta = len_after_newline - current_col; - mappings.forEach(function(mapping) { - mapping.line++; - mapping.col += delta; - }); - } - current_line++; - current_pos++; - current_col = len_after_newline; - } - } - if (might_add_newline) { - might_add_newline = 0; - do_add_mapping(); - } - } : _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop; - - var requireSemicolonChars = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)("( [ + * / - , . `"); - - function print(str) { - str = String(str); - var ch = (0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.get_full_char)(str, 0); - if (need_newline_indented && ch) { - need_newline_indented = false; - if (ch !== "\n") { - print("\n"); - indent(); - } - } - if (need_space && ch) { - need_space = false; - if (!/[\s;})]/.test(ch)) { - space(); - } - } - newline_insert = -1; - var prev = last.charAt(last.length - 1); - if (might_need_semicolon) { - might_need_semicolon = false; - - if (prev === ":" && ch === "}" || (!ch || !";}".includes(ch)) && prev !== ";") { - if (options.semicolons || requireSemicolonChars.has(ch)) { - OUTPUT.append(";"); - current_col++; - current_pos++; - } else { - ensure_line_len(); - if (current_col > 0) { - OUTPUT.append("\n"); - current_pos++; - current_line++; - current_col = 0; - } - - if (/^\s+$/.test(str)) { - // reset the semicolon flag, since we didn't print one - // now and might still have to later - might_need_semicolon = true; - } - } - - if (!options.beautify) - might_need_space = false; - } - } - - if (might_need_space) { - if (((0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.is_identifier_char)(prev) - && ((0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.is_identifier_char)(ch) || ch == "\\")) - || (ch == "/" && ch == prev) - || ((ch == "+" || ch == "-") && ch == last) - ) { - OUTPUT.append(" "); - current_col++; - current_pos++; - } - might_need_space = false; - } - - if (mapping_token) { - mappings.push({ - token: mapping_token, - name: mapping_name, - line: current_line, - col: current_col - }); - mapping_token = false; - if (!might_add_newline) do_add_mapping(); - } - - OUTPUT.append(str); - has_parens = str[str.length - 1] == "("; - current_pos += str.length; - var a = str.split(/\r?\n/), n = a.length - 1; - current_line += n; - current_col += a[0].length; - if (n > 0) { - ensure_line_len(); - current_col = a[n].length; - } - last = str; - } - - var star = function() { - print("*"); - }; - - var space = options.beautify ? function() { - print(" "); - } : function() { - might_need_space = true; - }; - - var indent = options.beautify ? function(half) { - if (options.beautify) { - print(make_indent(half ? 0.5 : 0)); - } - } : _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop; - - var with_indent = options.beautify ? function(col, cont) { - if (col === true) col = next_indent(); - var save_indentation = indentation; - indentation = col; - var ret = cont(); - indentation = save_indentation; - return ret; - } : function(col, cont) { return cont(); }; - - var newline = options.beautify ? function() { - if (newline_insert < 0) return print("\n"); - if (OUTPUT.charAt(newline_insert) != "\n") { - OUTPUT.insertAt("\n", newline_insert); - current_pos++; - current_line++; - } - newline_insert++; - } : options.max_line_len ? function() { - ensure_line_len(); - might_add_newline = OUTPUT.length(); - } : _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop; - - var semicolon = options.beautify ? function() { - print(";"); - } : function() { - might_need_semicolon = true; - }; - - function force_semicolon() { - might_need_semicolon = false; - print(";"); - } - - function next_indent() { - return indentation + options.indent_level; - } - - function with_block(cont) { - var ret; - print("{"); - newline(); - with_indent(next_indent(), function() { - ret = cont(); - }); - indent(); - print("}"); - return ret; - } - - function with_parens(cont) { - print("("); - //XXX: still nice to have that for argument lists - //var ret = with_indent(current_col, cont); - var ret = cont(); - print(")"); - return ret; - } - - function with_square(cont) { - print("["); - //var ret = with_indent(current_col, cont); - var ret = cont(); - print("]"); - return ret; - } - - function comma() { - print(","); - space(); - } - - function colon() { - print(":"); - space(); - } - - var add_mapping = mappings ? function(token, name) { - mapping_token = token; - mapping_name = name; - } : _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop; - - function get() { - if (might_add_newline) { - ensure_line_len(); - } - return OUTPUT.toString(); - } - - function filter_comment(comment) { - if (!options.preserve_annotations) { - comment = comment.replace(r_annotation, " "); - } - if (/^\s*$/.test(comment)) { - return ""; - } - return comment.replace(/(<\s*\/\s*)(script)/i, "<\\/$2"); - } - - function prepend_comments(node) { - var self = this; - var start = node.start; - if (!start) return; - var printed_comments = self.printed_comments; - - // There cannot be a newline between return/yield and its value. - const keyword_with_value = - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Exit && node.value - || (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Await || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Yield) - && node.expression; - - if ( - start.comments_before - && printed_comments.has(start.comments_before) - ) { - if (keyword_with_value) { - start.comments_before = []; - } else { - return; - } - } - - var comments = start.comments_before; - if (!comments) { - comments = start.comments_before = []; - } - printed_comments.add(comments); - - if (keyword_with_value) { - var tw = new _ast_js__WEBPACK_IMPORTED_MODULE_2__.TreeWalker(function(node) { - var parent = tw.parent(); - if (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Exit - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Await - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Yield - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && parent.left === node - || parent.TYPE == "Call" && parent.expression === node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional && parent.condition === node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Dot && parent.expression === node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence && parent.expressions[0] === node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sub && parent.expression === node - || parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_UnaryPostfix) { - if (!node.start) return; - var text = node.start.comments_before; - if (text && !printed_comments.has(text)) { - printed_comments.add(text); - comments = comments.concat(text); - } - } else { - return true; - } - }); - tw.push(node); - keyword_with_value.walk(tw); - } - - if (current_pos == 0) { - if (comments.length > 0 && options.shebang && comments[0].type === "comment5" - && !printed_comments.has(comments[0])) { - print("#!" + comments.shift().value + "\n"); - indent(); - } - var preamble = options.preamble; - if (preamble) { - print(preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n")); - } - } - - comments = comments.filter(comment_filter, node).filter(c => !printed_comments.has(c)); - if (comments.length == 0) return; - var last_nlb = OUTPUT.hasNLB(); - comments.forEach(function(c, i) { - printed_comments.add(c); - if (!last_nlb) { - if (c.nlb) { - print("\n"); - indent(); - last_nlb = true; - } else if (i > 0) { - space(); - } - } - - if (/comment[134]/.test(c.type)) { - var value = filter_comment(c.value); - if (value) { - print("//" + value + "\n"); - indent(); - } - last_nlb = true; - } else if (c.type == "comment2") { - var value = filter_comment(c.value); - if (value) { - print("/*" + value + "*/"); - } - last_nlb = false; - } - }); - if (!last_nlb) { - if (start.nlb) { - print("\n"); - indent(); - } else { - space(); - } - } - } - - function append_comments(node, tail) { - var self = this; - var token = node.end; - if (!token) return; - var printed_comments = self.printed_comments; - var comments = token[tail ? "comments_before" : "comments_after"]; - if (!comments || printed_comments.has(comments)) return; - if (!(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Statement || comments.every((c) => - !/comment[134]/.test(c.type) - ))) return; - printed_comments.add(comments); - var insert = OUTPUT.length(); - comments.filter(comment_filter, node).forEach(function(c, i) { - if (printed_comments.has(c)) return; - printed_comments.add(c); - need_space = false; - if (need_newline_indented) { - print("\n"); - indent(); - need_newline_indented = false; - } else if (c.nlb && (i > 0 || !OUTPUT.hasNLB())) { - print("\n"); - indent(); - } else if (i > 0 || !tail) { - space(); - } - if (/comment[134]/.test(c.type)) { - const value = filter_comment(c.value); - if (value) { - print("//" + value); - } - need_newline_indented = true; - } else if (c.type == "comment2") { - const value = filter_comment(c.value); - if (value) { - print("/*" + value + "*/"); - } - need_space = true; - } - }); - if (OUTPUT.length() > insert) newline_insert = insert; - } - - /** - * When output.option("_destroy_ast") is enabled, destroy the function. - * Call this after printing it. - */ - const gc_scope = - options["_destroy_ast"] - ? function gc_scope(scope) { - scope.body.length = 0; - scope.argnames.length = 0; - } - : _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop; - - var stack = []; - return { - get : get, - toString : get, - indent : indent, - in_directive : false, - use_asm : null, - active_scope : null, - indentation : function() { return indentation; }, - current_width : function() { return current_col - indentation; }, - should_break : function() { return options.width && this.current_width() >= options.width; }, - has_parens : function() { return has_parens; }, - newline : newline, - print : print, - star : star, - space : space, - comma : comma, - colon : colon, - last : function() { return last; }, - semicolon : semicolon, - force_semicolon : force_semicolon, - to_utf8 : to_utf8, - print_name : function(name) { print(make_name(name)); }, - print_string : function(str, quote, escape_directive) { - var encoded = encode_string(str, quote); - if (escape_directive === true && !encoded.includes("\\")) { - // Insert semicolons to break directive prologue - if (!OUTPUT.expectDirective()) { - force_semicolon(); - } - force_semicolon(); - } - print(encoded); - }, - print_template_string_chars: function(str) { - var encoded = encode_string(str, "`").replace(/\${/g, "\\${"); - return print(encoded.substr(1, encoded.length - 2)); - }, - encode_string : encode_string, - next_indent : next_indent, - with_indent : with_indent, - with_block : with_block, - with_parens : with_parens, - with_square : with_square, - add_mapping : add_mapping, - option : function(opt) { return options[opt]; }, - gc_scope, - printed_comments: printed_comments, - prepend_comments: readonly ? _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop : prepend_comments, - append_comments : readonly || comment_filter === _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false ? _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop : append_comments, - line : function() { return current_line; }, - col : function() { return current_col; }, - pos : function() { return current_pos; }, - push_node : function(node) { stack.push(node); }, - pop_node : function() { return stack.pop(); }, - parent : function(n) { - return stack[stack.length - 2 - (n || 0)]; - } - }; - -} - -/* -----[ code generators ]----- */ - -(function() { - - /* -----[ utils ]----- */ - - function DEFPRINT(nodetype, generator) { - nodetype.DEFMETHOD("_codegen", generator); - } - - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node.DEFMETHOD("print", function(output, force_parens) { - var self = this, generator = self._codegen; - if (self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Scope) { - output.active_scope = self; - } else if (!output.use_asm && self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Directive && self.value == "use asm") { - output.use_asm = output.active_scope; - } - function doit() { - output.prepend_comments(self); - self.add_source_map(output); - generator(self, output); - output.append_comments(self); - } - output.push_node(self); - if (force_parens || self.needs_parens(output)) { - output.with_parens(doit); - } else { - doit(); - } - output.pop_node(); - if (self === output.use_asm) { - output.use_asm = null; - } - }); - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node.DEFMETHOD("_print", _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node.prototype.print); - - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node.DEFMETHOD("print_to_string", function(options) { - var output = OutputStream(options); - this.print(output); - return output.get(); - }); - - /* -----[ PARENTHESES ]----- */ - - function PARENS(nodetype, func) { - if (Array.isArray(nodetype)) { - nodetype.forEach(function(nodetype) { - PARENS(nodetype, func); - }); - } else { - nodetype.DEFMETHOD("needs_parens", func); - } - } - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false); - - // a function expression needs parens around it when it's provably - // the first token to appear in a statement. - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Function, function(output) { - if (!output.has_parens() && (0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__.first_in_statement)(output)) { - return true; - } - - if (output.option("webkit")) { - var p = output.parent(); - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this) { - return true; - } - } - - if (output.option("wrap_iife")) { - var p = output.parent(); - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this) { - return true; - } - } - - if (output.option("wrap_func_args")) { - var p = output.parent(); - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.args.includes(this)) { - return true; - } - } - - return false; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Arrow, function(output) { - var p = output.parent(); - - if ( - output.option("wrap_func_args") - && p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call - && p.args.includes(this) - ) { - return true; - } - return p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional && p.condition === this; - }); - - // same goes for an object literal (as in AST_Function), because - // otherwise {...} would be interpreted as a block of code. - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Object, function(output) { - return !output.has_parens() && (0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__.first_in_statement)(output); - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassExpression, _utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__.first_in_statement); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary, function(output) { - var p = output.parent(); - return p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary - && p.operator === "**" - && this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_UnaryPrefix - && p.left === this - && this.operator !== "++" - && this.operator !== "--"; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Await, function(output) { - var p = output.parent(); - return p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && p.operator === "**" && p.left === this - || output.option("safari10") && p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_UnaryPrefix; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence, function(output) { - var p = output.parent(); - return p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call // (foo, bar)() or foo(1, (2, 3), 4) - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary // !(foo, bar, baz) - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary // 1 + (2, 3) + 4 ==> 8 - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4 - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2 - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ] - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2 - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30) - * ==> 20 (side effect, set a := 10 and b := 20) */ - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Arrow // x => (x, x) - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DefaultAssign // x => (x = (0, function(){})) - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Expansion // [...(a, b)] - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ForOf && this === p.object // for (e of (foo, bar)) {} - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Yield // yield (foo, bar) - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Export // export default (foo, bar) - ; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary, function(output) { - var p = output.parent(); - // (foo && bar)() - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this) - return true; - // typeof (foo && bar) - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary) - return true; - // (foo && bar)["prop"], (foo && bar).prop - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this) - return true; - // this deals with precedence: 3 * (2 + 1) - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary) { - const parent_op = p.operator; - const op = this.operator; - - // It is forbidden for ?? to be used with || or && without parens. - if (op === "??" && (parent_op === "||" || parent_op === "&&")) { - return true; - } - if (parent_op === "??" && (op === "||" || op === "&&")) { - return true; - } - - const pp = _parse_js__WEBPACK_IMPORTED_MODULE_3__.PRECEDENCE[parent_op]; - const sp = _parse_js__WEBPACK_IMPORTED_MODULE_3__.PRECEDENCE[op]; - if (pp > sp - || (pp == sp - && (this === p.right || parent_op == "**"))) { - return true; - } - } - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateIn) { - const op = this.operator; - - const pp = _parse_js__WEBPACK_IMPORTED_MODULE_3__.PRECEDENCE["in"]; - const sp = _parse_js__WEBPACK_IMPORTED_MODULE_3__.PRECEDENCE[op]; - if (pp > sp || (pp == sp && this === p.value)) { - return true; - } - } - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateIn, function(output) { - var p = output.parent(); - // (#x in this)() - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this) { - return true; - } - // typeof (#x in this) - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary) { - return true; - } - // (#x in this)["prop"], (#x in this).prop - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this) { - return true; - } - // same precedence as regular in operator - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary) { - const parent_op = p.operator; - - const pp = _parse_js__WEBPACK_IMPORTED_MODULE_3__.PRECEDENCE[parent_op]; - const sp = _parse_js__WEBPACK_IMPORTED_MODULE_3__.PRECEDENCE["in"]; - if (pp > sp - || (pp == sp - && (this === p.right || parent_op == "**"))) { - return true; - } - } - // rules are the same as binary in, but the class differs - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateIn && this === p.value) { - return true; - } - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Yield, function(output) { - var p = output.parent(); - // (yield 1) + (yield 2) - // a = yield 3 - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && p.operator !== "=") - return true; - // (yield 1)() - // new (yield 1)() - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this) - return true; - // (yield 1) ? yield 2 : yield 3 - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional && p.condition === this) - return true; - // -(yield 4) - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary) - return true; - // (yield x).foo - // (yield x)['foo'] - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this) - return true; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Chain, function(output) { - var p = output.parent(); - if (!(p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess)) return false; - return p.expression === this; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess, function(output) { - var p = output.parent(); - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_New && p.expression === this) { - // i.e. new (foo.bar().baz) - // - // if there's one call into this subtree, then we need - // parens around it too, otherwise the call will be - // interpreted as passing the arguments to the upper New - // expression. - return (0,_ast_js__WEBPACK_IMPORTED_MODULE_2__.walk)(this, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Scope) return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call) { - return _ast_js__WEBPACK_IMPORTED_MODULE_2__.walk_abort; // makes walk() return true. - } - }); - } - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call, function(output) { - var p = output.parent(), p1; - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_New && p.expression === this - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Export && p.is_default && this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Function) - return true; - - // workaround for Safari bug. - // https://bugs.webkit.org/show_bug.cgi?id=123506 - return this.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Function - && p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess - && p.expression === this - && (p1 = output.parent(1)) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Assign - && p1.left === p; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_New, function(output) { - var p = output.parent(); - if (this.args.length === 0 - && (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this - || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrefixedTemplateString && p.prefix === this)) // (new foo)(bar) - return true; - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Number, function(output) { - var p = output.parent(); - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this) { - var value = this.getValue(); - if (value < 0 || /^0/.test(make_num(value))) { - return true; - } - } - }); - - PARENS(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_BigInt, function(output) { - var p = output.parent(); - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this) { - var value = this.getValue(); - if (value.startsWith("-")) { - return true; - } - } - }); - - PARENS([ _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Assign, _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional ], function(output) { - var p = output.parent(); - // !(a = false) → true - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary) - return true; - // 1 + (a = 2) + 3 → 6, side effect setting a = 2 - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && !(p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Assign)) - return true; - // (a = func)() —or— new (a = Object)() - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && p.expression === this) - return true; - // (a = foo) ? bar : baz - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional && p.condition === this) - return true; - // (a = foo)["prop"] —or— (a = foo).prop - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess && p.expression === this) - return true; - // ({a, b} = {a: 1, b: 2}), a destructuring assignment - if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Assign && this.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Destructuring && this.left.is_array === false) - return true; - }); - - /* -----[ PRINTERS ]----- */ - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Directive, function(self, output) { - output.print_string(self.value, self.quote); - output.semicolon(); - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Expansion, function (self, output) { - output.print("..."); - self.expression.print(output); - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Destructuring, function (self, output) { - output.print(self.is_array ? "[" : "{"); - var len = self.names.length; - self.names.forEach(function (name, i) { - if (i > 0) output.comma(); - name.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i == len - 1 && name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Hole) output.comma(); - }); - output.print(self.is_array ? "]" : "}"); - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Debugger, function(self, output) { - output.print("debugger"); - output.semicolon(); - }); - - /* -----[ statements ]----- */ - - function display_body(body, is_toplevel, output, allow_directives) { - var last = body.length - 1; - output.in_directive = allow_directives; - body.forEach(function(stmt, i) { - if (output.in_directive === true && !(stmt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Directive || - stmt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_EmptyStatement || - (stmt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SimpleStatement && stmt.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String) - )) { - output.in_directive = false; - } - if (!(stmt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_EmptyStatement)) { - output.indent(); - stmt.print(output); - if (!(i == last && is_toplevel)) { - output.newline(); - if (is_toplevel) output.newline(); - } - } - if (output.in_directive === true && - stmt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SimpleStatement && - stmt.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String - ) { - output.in_directive = false; - } - }); - output.in_directive = false; - } - - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { - print_maybe_braced_body(this.body, output); - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Statement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Toplevel, function(self, output) { - display_body(self.body, true, output, true); - output.print(""); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_LabeledStatement, function(self, output) { - self.label.print(output); - output.colon(); - self.body.print(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SimpleStatement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - function print_braced_empty(self, output) { - output.print("{"); - output.with_indent(output.next_indent(), function() { - output.append_comments(self, true); - }); - output.add_mapping(self.end); - output.print("}"); - } - function print_braced(self, output, allow_directives) { - if (self.body.length > 0) { - output.with_block(function() { - display_body(self.body, false, output, allow_directives); - output.add_mapping(self.end); - }); - } else print_braced_empty(self, output); - } - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_BlockStatement, function(self, output) { - print_braced(self, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_EmptyStatement, function(self, output) { - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Do, function(self, output) { - output.print("do"); - output.space(); - make_block(self.body, output); - output.space(); - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_While, function(self, output) { - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_For, function(self, output) { - output.print("for"); - output.space(); - output.with_parens(function() { - if (self.init) { - if (self.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Definitions) { - self.init.print(output); - } else { - parenthesize_for_noin(self.init, output, true); - } - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.condition) { - self.condition.print(output); - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.step) { - self.step.print(output); - } - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ForIn, function(self, output) { - output.print("for"); - if (self.await) { - output.space(); - output.print("await"); - } - output.space(); - output.with_parens(function() { - self.init.print(output); - output.space(); - output.print(self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ForOf ? "of" : "in"); - output.space(); - self.object.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_With, function(self, output) { - output.print("with"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - self._do_print_body(output); - }); - - /* -----[ functions ]----- */ - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { - var self = this; - if (!nokeyword) { - if (self.async) { - output.print("async"); - output.space(); - } - output.print("function"); - if (self.is_generator) { - output.star(); - } - if (self.name) { - output.space(); - } - } - if (self.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol) { - self.name.print(output); - } else if (nokeyword && self.name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node) { - output.with_square(function() { - self.name.print(output); // Computed method name - }); - } - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - output.space(); - print_braced(self, output, true); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Lambda, function(self, output) { - self._do_print(output); - output.gc_scope(self); - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrefixedTemplateString, function(self, output) { - var tag = self.prefix; - var parenthesize_tag = tag instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Lambda - || tag instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary - || tag instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional - || tag instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence - || tag instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary - || tag instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Dot && tag.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Object; - if (parenthesize_tag) output.print("("); - self.prefix.print(output); - if (parenthesize_tag) output.print(")"); - self.template_string.print(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_TemplateString, function(self, output) { - var is_tagged = output.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrefixedTemplateString; - - output.print("`"); - for (var i = 0; i < self.segments.length; i++) { - if (!(self.segments[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_TemplateSegment)) { - output.print("${"); - self.segments[i].print(output); - output.print("}"); - } else if (is_tagged) { - output.print(self.segments[i].raw); - } else { - output.print_template_string_chars(self.segments[i].value); - } - } - output.print("`"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_TemplateSegment, function(self, output) { - output.print_template_string_chars(self.value); - }); - - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Arrow.DEFMETHOD("_do_print", function(output) { - var self = this; - var parent = output.parent(); - var needs_parens = (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && - !(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Assign) && - !(parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DefaultAssign)) || - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary || - (parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call && self === parent.expression); - if (needs_parens) { output.print("("); } - if (self.async) { - output.print("async"); - output.space(); - } - if (self.argnames.length === 1 && self.argnames[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol) { - self.argnames[0].print(output); - } else { - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - } - output.space(); - output.print("=>"); - output.space(); - const first_statement = self.body[0]; - if ( - self.body.length === 1 - && first_statement instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Return - ) { - const returned = first_statement.value; - if (!returned) { - output.print("{}"); - } else if ((0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__.left_is_object)(returned)) { - output.print("("); - returned.print(output); - output.print(")"); - } else { - returned.print(output); - } - } else { - print_braced(self, output); - } - if (needs_parens) { output.print(")"); } - output.gc_scope(self); - }); - - /* -----[ exits ]----- */ - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Exit.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.value) { - output.space(); - const comments = this.value.start.comments_before; - if (comments && comments.length && !output.printed_comments.has(comments)) { - output.print("("); - this.value.print(output); - output.print(")"); - } else { - this.value.print(output); - } - } - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Return, function(self, output) { - self._do_print(output, "return"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Throw, function(self, output) { - self._do_print(output, "throw"); - }); - - /* -----[ yield ]----- */ - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Yield, function(self, output) { - var star = self.is_star ? "*" : ""; - output.print("yield" + star); - if (self.expression) { - output.space(); - self.expression.print(output); - } - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Await, function(self, output) { - output.print("await"); - output.space(); - var e = self.expression; - var parens = !( - e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SymbolRef - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Unary - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Constant - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Await - || e instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Object - ); - if (parens) output.print("("); - self.expression.print(output); - if (parens) output.print(")"); - }); - - /* -----[ loop control ]----- */ - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.label) { - output.space(); - this.label.print(output); - } - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Break, function(self, output) { - self._do_print(output, "break"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Continue, function(self, output) { - self._do_print(output, "continue"); - }); - - /* -----[ if ]----- */ - function make_then(self, output) { - var b = self.body; - if (output.option("braces") - || output.option("ie8") && b instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Do) - return make_block(b, output); - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block braces if needed. - if (!b) return output.force_semicolon(); - while (true) { - if (b instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_If) { - if (!b.alternative) { - make_block(self.body, output); - return; - } - b = b.alternative; - } else if (b instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_StatementWithBody) { - b = b.body; - } else break; - } - print_maybe_braced_body(self.body, output); - } - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_If, function(self, output) { - output.print("if"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - if (self.alternative) { - make_then(self, output); - output.space(); - output.print("else"); - output.space(); - if (self.alternative instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_If) - self.alternative.print(output); - else - print_maybe_braced_body(self.alternative, output); - } else { - self._do_print_body(output); - } - }); - - /* -----[ switch ]----- */ - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Switch, function(self, output) { - output.print("switch"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - var last = self.body.length - 1; - if (last < 0) print_braced_empty(self, output); - else output.with_block(function() { - self.body.forEach(function(branch, i) { - output.indent(true); - branch.print(output); - if (i < last && branch.body.length > 0) - output.newline(); - }); - }); - }); - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { - output.newline(); - this.body.forEach(function(stmt) { - output.indent(); - stmt.print(output); - output.newline(); - }); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Default, function(self, output) { - output.print("default:"); - self._do_print_body(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Case, function(self, output) { - output.print("case"); - output.space(); - self.expression.print(output); - output.print(":"); - self._do_print_body(output); - }); - - /* -----[ exceptions ]----- */ - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Try, function(self, output) { - output.print("try"); - output.space(); - self.body.print(output); - if (self.bcatch) { - output.space(); - self.bcatch.print(output); - } - if (self.bfinally) { - output.space(); - self.bfinally.print(output); - } - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_TryBlock, function(self, output) { - print_braced(self, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Catch, function(self, output) { - output.print("catch"); - if (self.argname) { - output.space(); - output.with_parens(function() { - self.argname.print(output); - }); - } - output.space(); - print_braced(self, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Finally, function(self, output) { - output.print("finally"); - output.space(); - print_braced(self, output); - }); - - /* -----[ var/const ]----- */ - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - output.space(); - this.definitions.forEach(function(def, i) { - if (i) output.comma(); - def.print(output); - }); - var p = output.parent(); - var in_for = p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_For || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ForIn; - var output_semicolon = !in_for || p && p.init !== this; - if (output_semicolon) - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Let, function(self, output) { - self._do_print(output, "let"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Var, function(self, output) { - self._do_print(output, "var"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Const, function(self, output) { - self._do_print(output, "const"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Import, function(self, output) { - output.print("import"); - output.space(); - if (self.imported_name) { - self.imported_name.print(output); - } - if (self.imported_name && self.imported_names) { - output.print(","); - output.space(); - } - if (self.imported_names) { - if (self.imported_names.length === 1 && - self.imported_names[0].foreign_name.name === "*" && - !self.imported_names[0].foreign_name.quote) { - self.imported_names[0].print(output); - } else { - output.print("{"); - self.imported_names.forEach(function (name_import, i) { - output.space(); - name_import.print(output); - if (i < self.imported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } - if (self.imported_name || self.imported_names) { - output.space(); - output.print("from"); - output.space(); - } - self.module_name.print(output); - if (self.attributes) { - output.print("with"); - self.attributes.print(output); - } - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ImportMeta, function(self, output) { - output.print("import.meta"); - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_NameMapping, function(self, output) { - var is_import = output.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Import; - var definition = self.name.definition(); - var foreign_name = self.foreign_name; - var names_are_different = - (definition && definition.mangled_name || self.name.name) !== - foreign_name.name; - if (!names_are_different && - foreign_name.name === "*" && - !!foreign_name.quote != !!self.name.quote) { - // export * as "*" - names_are_different = true; - } - var foreign_name_is_name = !foreign_name.quote; - if (names_are_different) { - if (is_import) { - if (foreign_name_is_name) { - output.print(foreign_name.name); - } else { - output.print_string(foreign_name.name, foreign_name.quote); - } - } else { - if (!self.name.quote) { - self.name.print(output); - } else { - output.print_string(self.name.name, self.name.quote); - } - - } - output.space(); - output.print("as"); - output.space(); - if (is_import) { - self.name.print(output); - } else { - if (foreign_name_is_name) { - output.print(foreign_name.name); - } else { - output.print_string(foreign_name.name, foreign_name.quote); - } - } - } else { - if (!self.name.quote) { - self.name.print(output); - } else { - output.print_string(self.name.name, self.name.quote); - } - } - }); - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Export, function(self, output) { - output.print("export"); - output.space(); - if (self.is_default) { - output.print("default"); - output.space(); - } - if (self.exported_names) { - if (self.exported_names.length === 1 && - self.exported_names[0].name.name === "*" && - !self.exported_names[0].name.quote) { - self.exported_names[0].print(output); - } else { - output.print("{"); - self.exported_names.forEach(function(name_export, i) { - output.space(); - name_export.print(output); - if (i < self.exported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } else if (self.exported_value) { - self.exported_value.print(output); - } else if (self.exported_definition) { - self.exported_definition.print(output); - if (self.exported_definition instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Definitions) return; - } - if (self.module_name) { - output.space(); - output.print("from"); - output.space(); - self.module_name.print(output); - } - if (self.attributes) { - output.print("with"); - self.attributes.print(output); - } - if (self.exported_value - && !(self.exported_value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Defun || - self.exported_value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Function || - self.exported_value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Class) - || self.module_name - || self.exported_names - ) { - output.semicolon(); - } - }); - - function parenthesize_for_noin(node, output, noin) { - var parens = false; - // need to take some precautions here: - // https://github.com/mishoo/UglifyJS2/issues/60 - if (noin) { - parens = (0,_ast_js__WEBPACK_IMPORTED_MODULE_2__.walk)(node, node => { - // Don't go into scopes -- except arrow functions: - // https://github.com/terser/terser/issues/1019#issuecomment-877642607 - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Scope && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Arrow)) { - return true; - } - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && node.operator == "in" - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateIn - ) { - return _ast_js__WEBPACK_IMPORTED_MODULE_2__.walk_abort; // makes walk() return true - } - }); - } - node.print(output, parens); - } - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_VarDef, function(self, output) { - self.name.print(output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - var p = output.parent(1); - var noin = p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_For || p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ForIn; - parenthesize_for_noin(self.value, output, noin); - } - }); - - /* -----[ other expressions ]----- */ - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call, function(self, output) { - self.expression.print(output); - if (self instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_New && self.args.length === 0) - return; - if (self.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call || self.expression instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Lambda) { - output.add_mapping(self.start); - } - if (self.optional) output.print("?."); - output.with_parens(function() { - self.args.forEach(function(expr, i) { - if (i) output.comma(); - expr.print(output); - }); - }); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_New, function(self, output) { - output.print("new"); - output.space(); - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call.prototype._codegen(self, output); - }); - - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence.DEFMETHOD("_do_print", function(output) { - this.expressions.forEach(function(node, index) { - if (index > 0) { - output.comma(); - if (output.should_break()) { - output.newline(); - output.indent(); - } - } - node.print(output); - }); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence, function(self, output) { - self._do_print(output); - // var p = output.parent(); - // if (p instanceof AST_Statement) { - // output.with_indent(output.next_indent(), function(){ - // self._do_print(output); - // }); - // } else { - // self._do_print(output); - // } - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Dot, function(self, output) { - var expr = self.expression; - expr.print(output); - var prop = self.property; - var print_computed = _parse_js__WEBPACK_IMPORTED_MODULE_3__.ALL_RESERVED_WORDS.has(prop) - ? output.option("ie8") - : !(0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.is_identifier_string)( - prop, - output.option("ecma") >= 2015 && !output.option("safari10") - ); - - if (self.optional) output.print("?."); - - if (print_computed) { - output.print("["); - output.add_mapping(self.end); - output.print_string(prop); - output.print("]"); - } else { - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Number && expr.getValue() >= 0) { - if (!/[xa-f.)]/i.test(output.last())) { - output.print("."); - } - } - if (!self.optional) output.print("."); - // the name after dot would be mapped about here. - output.add_mapping(self.end); - output.print_name(prop); - } - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DotHash, function(self, output) { - var expr = self.expression; - expr.print(output); - var prop = self.property; - - if (self.optional) output.print("?"); - output.print(".#"); - output.add_mapping(self.end); - output.print_name(prop); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sub, function(self, output) { - self.expression.print(output); - if (self.optional) output.print("?."); - output.print("["); - self.property.print(output); - output.print("]"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Chain, function(self, output) { - self.expression.print(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_UnaryPrefix, function(self, output) { - var op = self.operator; - if (op === "--" && output.last().endsWith("!")) { - // avoid printing " - output.print(" "); - } else { - // the space is optional depending on "beautify" - output.space(); - } - output.print(op); - output.space(); - self.right.print(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional, function(self, output) { - self.condition.print(output); - output.space(); - output.print("?"); - output.space(); - self.consequent.print(output); - output.space(); - output.colon(); - self.alternative.print(output); - }); - - /* -----[ literals ]----- */ - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Array, function(self, output) { - output.with_square(function() { - var a = self.elements, len = a.length; - if (len > 0) output.space(); - a.forEach(function(exp, i) { - if (i) output.comma(); - exp.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i === len - 1 && exp instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Hole) - output.comma(); - }); - if (len > 0) output.space(); - }); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Object, function(self, output) { - if (self.properties.length > 0) output.with_block(function() { - self.properties.forEach(function(prop, i) { - if (i) { - output.print(","); - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); - else print_braced_empty(self, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Class, function(self, output) { - output.print("class"); - output.space(); - if (self.name) { - self.name.print(output); - output.space(); - } - if (self.extends) { - var parens = ( - !(self.extends instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SymbolRef) - && !(self.extends instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PropAccess) - && !(self.extends instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassExpression) - && !(self.extends instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Function) - ); - output.print("extends"); - if (parens) { - output.print("("); - } else { - output.space(); - } - self.extends.print(output); - if (parens) { - output.print(")"); - } else { - output.space(); - } - } - if (self.properties.length > 0) output.with_block(function() { - self.properties.forEach(function(prop, i) { - if (i) { - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); - else output.print("{}"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_NewTarget, function(self, output) { - output.print("new.target"); - }); - - /** Prints a prop name. Returns whether it can be used as a shorthand. */ - function print_property_name(key, quote, output) { - if (output.option("quote_keys")) { - output.print_string(key); - return false; - } - if ("" + +key == key && key >= 0) { - if (output.option("keep_numbers")) { - output.print(key); - return false; - } - output.print(make_num(key)); - return false; - } - var print_string = _parse_js__WEBPACK_IMPORTED_MODULE_3__.ALL_RESERVED_WORDS.has(key) - ? output.option("ie8") - : ( - output.option("ecma") < 2015 || output.option("safari10") - ? !(0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.is_basic_identifier_string)(key) - : !(0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.is_identifier_string)(key, true) - ); - if (print_string || (quote && output.option("keep_quoted_props"))) { - output.print_string(key, quote); - return false; - } - output.print_name(key); - return true; - } - - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectKeyVal, function(self, output) { - function get_name(self) { - var def = self.definition(); - return def ? def.mangled_name || def.name : self.name; - } - - const try_shorthand = output.option("shorthand") && !(self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node); - if ( - try_shorthand - && self.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol - && get_name(self.value) === self.key - && !_parse_js__WEBPACK_IMPORTED_MODULE_3__.ALL_RESERVED_WORDS.has(self.key) - ) { - const was_shorthand = print_property_name(self.key, self.quote, output); - if (!was_shorthand) { - output.colon(); - self.value.print(output); - } - } else if ( - try_shorthand - && self.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DefaultAssign - && self.value.left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol - && get_name(self.value.left) === self.key - ) { - const was_shorthand = print_property_name(self.key, self.quote, output); - if (!was_shorthand) { - output.colon(); - self.value.left.print(output); - } - output.space(); - output.print("="); - output.space(); - self.value.right.print(output); - } else { - if (!(self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node)) { - print_property_name(self.key, self.quote, output); - } else { - output.with_square(function() { - self.key.print(output); - }); - } - output.colon(); - self.value.print(output); - } - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassPrivateProperty, (self, output) => { - if (self.static) { - output.print("static"); - output.space(); - } - - output.print("#"); - - print_property_name(self.key.name, undefined, output); - - if (self.value) { - output.print("="); - self.value.print(output); - } - - output.semicolon(); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassProperty, (self, output) => { - if (self.static) { - output.print("static"); - output.space(); - } - - if (self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SymbolClassProperty) { - print_property_name(self.key.name, self.quote, output); - } else { - output.print("["); - self.key.print(output); - output.print("]"); - } - - if (self.value) { - output.print("="); - self.value.print(output); - } - - output.semicolon(); - }); - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectProperty.DEFMETHOD("_print_getter_setter", function(type, is_private, output) { - var self = this; - if (self.static) { - output.print("static"); - output.space(); - } - if (type) { - output.print(type); - output.space(); - } - if (self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SymbolMethod) { - if (is_private) output.print("#"); - print_property_name(self.key.name, self.quote, output); - self.key.add_source_map(output); - } else { - output.with_square(function() { - self.key.print(output); - }); - } - self.value._do_print(output, true); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectSetter, function(self, output) { - self._print_getter_setter("set", false, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectGetter, function(self, output) { - self._print_getter_setter("get", false, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateSetter, function(self, output) { - self._print_getter_setter("set", true, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateGetter, function(self, output) { - self._print_getter_setter("get", true, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ConciseMethod, function(self, output) { - var type; - if (self.value.is_generator && self.value.async) { - type = "async*"; - } else if (self.value.is_generator) { - type = "*"; - } else if (self.value.async) { - type = "async"; - } - self._print_getter_setter(type, false, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateMethod, function(self, output) { - var type; - if (self.value.is_generator && self.value.async) { - type = "async*"; - } else if (self.value.is_generator) { - type = "*"; - } else if (self.value.async) { - type = "async"; - } - self._print_getter_setter(type, true, output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateIn, function(self, output) { - self.key.print(output); - output.space(); - output.print("in"); - output.space(); - self.value.print(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SymbolPrivateProperty, function(self, output) { - output.print("#" + self.name); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassStaticBlock, function (self, output) { - output.print("static"); - output.space(); - print_braced(self, output); - }); - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol.DEFMETHOD("_do_print", function(output) { - var def = this.definition(); - output.print_name(def ? def.mangled_name || def.name : this.name); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol, function (self, output) { - self._do_print(output); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Hole, _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_This, function(self, output) { - output.print("this"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Super, function(self, output) { - output.print("super"); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Constant, function(self, output) { - output.print(self.getValue()); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String, function(self, output) { - output.print_string(self.getValue(), self.quote, output.in_directive); - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Number, function(self, output) { - if ((output.option("keep_numbers") || output.use_asm) && self.raw) { - output.print(self.raw); - } else { - output.print(make_num(self.getValue())); - } - }); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_BigInt, function(self, output) { - if (output.option("keep_numbers") && self.raw) { - output.print(self.raw); - } else { - output.print(self.getValue() + "n"); - } - }); - - const r_slash_script = /(<\s*\/\s*script)/i; - const r_starts_with_script = /^\s*script/i; - const slash_script_replace = (_, $1) => $1.replace("/", "\\/"); - DEFPRINT(_ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_RegExp, function(self, output) { - let { source, flags } = self.getValue(); - source = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.regexp_source_fix)(source); - flags = flags ? (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.sort_regexp_flags)(flags) : ""; - - // Avoid outputting end of script tag - source = source.replace(r_slash_script, slash_script_replace); - if (r_starts_with_script.test(source) && output.last().endsWith("<")) { - output.print(" "); - } - - output.print(output.to_utf8(`/${source}/${flags}`, false, true)); - - const parent = output.parent(); - if ( - parent instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary - && /^\w/.test(parent.operator) - && parent.left === self - ) { - output.print(" "); - } - }); - - /** if, for, while, may or may not have braces surrounding its body */ - function print_maybe_braced_body(stat, output) { - if (output.option("braces")) { - make_block(stat, output); - } else { - if (!stat || stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_EmptyStatement) - output.force_semicolon(); - else if (stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Let || stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Const || stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Class) - make_block(stat, output); - else - stat.print(output); - } - } - - function best_of(a) { - var best = a[0], len = best.length; - for (var i = 1; i < a.length; ++i) { - if (a[i].length < len) { - best = a[i]; - len = best.length; - } - } - return best; - } - - function make_num(num) { - var str = num.toString(10).replace(/^0\./, ".").replace("e+", "e"); - var candidates = [ str ]; - if (Math.floor(num) === num) { - if (num < 0) { - candidates.push("-0x" + (-num).toString(16).toLowerCase()); - } else { - candidates.push("0x" + num.toString(16).toLowerCase()); - } - } - var match, len, digits; - if (match = /^\.0+/.exec(str)) { - len = match[0].length; - digits = str.slice(len); - candidates.push(digits + "e-" + (digits.length + len - 1)); - } else if (match = /0+$/.exec(str)) { - len = match[0].length; - candidates.push(str.slice(0, -len) + "e" + len); - } else if (match = /^(\d)\.(\d+)e(-?\d+)$/.exec(str)) { - candidates.push(match[1] + match[2] + "e" + (match[3] - match[2].length)); - } - return best_of(candidates); - } - - function make_block(stmt, output) { - if (!stmt || stmt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_EmptyStatement) - output.print("{}"); - else if (stmt instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_BlockStatement) - stmt.print(output); - else output.with_block(function() { - output.indent(); - stmt.print(output); - output.newline(); - }); - } - - /* -----[ source map generators ]----- */ - - function DEFMAP(nodetype, generator) { - nodetype.forEach(function(nodetype) { - nodetype.DEFMETHOD("add_source_map", generator); - }); - } - - DEFMAP([ - // We could easily add info for ALL nodes, but it seems to me that - // would be quite wasteful, hence this noop in the base class. - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Node, - // since the label symbol will mark it - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_LabeledStatement, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Toplevel, - ], _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.noop); - - // XXX: I'm not exactly sure if we need it for all of these nodes, - // or if we should add even more. - DEFMAP([ - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Array, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_BlockStatement, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Catch, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Class, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Constant, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Debugger, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Definitions, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Directive, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Finally, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Jump, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Lambda, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_New, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Object, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_StatementWithBody, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Symbol, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Switch, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SwitchBranch, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_TemplateString, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_TemplateSegment, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Try, - ], function(output) { - output.add_mapping(this.start); - }); - - DEFMAP([ - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectSetter, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateGetter, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateSetter, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ConciseMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateMethod, - ], function(output) { - output.add_mapping(this.start, false /*name handled below*/); - }); - - DEFMAP([ - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SymbolMethod, - _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_SymbolPrivateProperty - ], function(output) { - const tok_type = this.end && this.end.type; - if (tok_type === "name" || tok_type === "privatename") { - output.add_mapping(this.end, this.name); - } else { - output.add_mapping(this.end); - } - }); - - DEFMAP([ _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectProperty ], function(output) { - output.add_mapping(this.start, this.key); - }); -})(); - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/parse.js": -/*!******************************************!*\ - !*** ./node_modules/terser/lib/parse.js ***! - \******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ALL_RESERVED_WORDS: () => (/* binding */ ALL_RESERVED_WORDS), -/* harmony export */ JS_Parse_Error: () => (/* binding */ JS_Parse_Error), -/* harmony export */ PRECEDENCE: () => (/* binding */ PRECEDENCE), -/* harmony export */ get_full_char: () => (/* binding */ get_full_char), -/* harmony export */ get_full_char_code: () => (/* binding */ get_full_char_code), -/* harmony export */ is_basic_identifier_string: () => (/* binding */ is_basic_identifier_string), -/* harmony export */ is_identifier_char: () => (/* binding */ is_identifier_char), -/* harmony export */ is_identifier_string: () => (/* binding */ is_identifier_string), -/* harmony export */ is_surrogate_pair_head: () => (/* binding */ is_surrogate_pair_head), -/* harmony export */ is_surrogate_pair_tail: () => (/* binding */ is_surrogate_pair_tail), -/* harmony export */ js_error: () => (/* binding */ js_error), -/* harmony export */ parse: () => (/* binding */ parse), -/* harmony export */ tokenizer: () => (/* binding */ tokenizer) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - -var LATEST_RAW = ""; // Only used for numbers and template strings -var TEMPLATE_RAWS = new Map(); // Raw template strings - -var KEYWORDS = "break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with"; -var KEYWORDS_ATOM = "false null true"; -var RESERVED_WORDS = "enum import super this " + KEYWORDS_ATOM + " " + KEYWORDS; -var ALL_RESERVED_WORDS = "implements interface package private protected public static " + RESERVED_WORDS; -var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case yield await"; - -KEYWORDS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)(KEYWORDS); -RESERVED_WORDS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)(RESERVED_WORDS); -KEYWORDS_BEFORE_EXPRESSION = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)(KEYWORDS_BEFORE_EXPRESSION); -KEYWORDS_ATOM = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)(KEYWORDS_ATOM); -ALL_RESERVED_WORDS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)(ALL_RESERVED_WORDS); - -var OPERATOR_CHARS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.characters)("+-*&%=<>!?|~^")); - -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_ES6_OCT_NUMBER = /^0o[0-7]+$/i; -var RE_BIN_NUMBER = /^0b[01]+$/i; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; -var RE_BIG_INT = /^(0[xob])?[0-9a-f]+n$/i; - -var OPERATORS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "**", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "||=", - "&&=", - "??=", - "/=", - "*=", - "**=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "??", - "||", -]); - -var WHITESPACE_CHARS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.characters)(" \u00a0\n\r\t\f\u000b\u200b\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\uFEFF")); - -var NEWLINE_CHARS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.characters)("\n\r\u2028\u2029")); - -var PUNC_AFTER_EXPRESSION = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.characters)(";]),:")); - -var PUNC_BEFORE_EXPRESSION = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.characters)("[{(,;:")); - -var PUNC_CHARS = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.characters)("[]{}(),;:")); - -/* -----[ Tokenizer ]----- */ - -// surrogate safe regexps adapted from https://github.com/mathiasbynens/unicode-8.0.0/tree/89b412d8a71ecca9ed593d9e9fa073ab64acfebe/Binary_Property -var UNICODE = { - ID_Start: /[$A-Z_a-z\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - ID_Continue: /(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/, -}; - -function get_full_char(str, pos) { - if (is_surrogate_pair_head(str.charCodeAt(pos))) { - if (is_surrogate_pair_tail(str.charCodeAt(pos + 1))) { - return str.charAt(pos) + str.charAt(pos + 1); - } - } else if (is_surrogate_pair_tail(str.charCodeAt(pos))) { - if (is_surrogate_pair_head(str.charCodeAt(pos - 1))) { - return str.charAt(pos - 1) + str.charAt(pos); - } - } - return str.charAt(pos); -} - -function get_full_char_code(str, pos) { - // https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates - if (is_surrogate_pair_head(str.charCodeAt(pos))) { - return 0x10000 + (str.charCodeAt(pos) - 0xd800 << 10) + str.charCodeAt(pos + 1) - 0xdc00; - } - return str.charCodeAt(pos); -} - -function get_full_char_length(str) { - var surrogates = 0; - - for (var i = 0; i < str.length; i++) { - if (is_surrogate_pair_head(str.charCodeAt(i)) && is_surrogate_pair_tail(str.charCodeAt(i + 1))) { - surrogates++; - i++; - } - } - - return str.length - surrogates; -} - -function from_char_code(code) { - // Based on https://github.com/mathiasbynens/String.fromCodePoint/blob/master/fromcodepoint.js - if (code > 0xFFFF) { - code -= 0x10000; - return (String.fromCharCode((code >> 10) + 0xD800) + - String.fromCharCode((code % 0x400) + 0xDC00)); - } - return String.fromCharCode(code); -} - -function is_surrogate_pair_head(code) { - return code >= 0xd800 && code <= 0xdbff; -} - -function is_surrogate_pair_tail(code) { - return code >= 0xdc00 && code <= 0xdfff; -} - -function is_digit(code) { - return code >= 48 && code <= 57; -} - -function is_identifier_start(ch) { - return UNICODE.ID_Start.test(ch); -} - -function is_identifier_char(ch) { - return UNICODE.ID_Continue.test(ch); -} - -const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i; - -function is_basic_identifier_string(str) { - return BASIC_IDENT.test(str); -} - -function is_identifier_string(str, allow_surrogates) { - if (BASIC_IDENT.test(str)) { - return true; - } - if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) { - return false; - } - var match = UNICODE.ID_Start.exec(str); - if (!match || match.index !== 0) { - return false; - } - - str = str.slice(match[0].length); - if (!str) { - return true; - } - - match = UNICODE.ID_Continue.exec(str); - return !!match && match[0].length === str.length; -} - -function parse_js_number(num, allow_e = true) { - if (!allow_e && num.includes("e")) { - return NaN; - } - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_ES6_OCT_NUMBER.test(num)) { - return parseInt(num.substr(2), 8); - } else if (RE_BIN_NUMBER.test(num)) { - return parseInt(num.substr(2), 2); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } else { - var val = parseFloat(num); - if (val == num) return val; - } -} - -class JS_Parse_Error extends Error { - constructor(message, filename, line, col, pos) { - super(); - - this.name = "SyntaxError"; - this.message = message; - this.filename = filename; - this.line = line; - this.col = col; - this.pos = pos; - } -} - -function js_error(message, filename, line, col, pos) { - throw new JS_Parse_Error(message, filename, line, col, pos); -} - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -} - -var EX_EOF = {}; - -function tokenizer($TEXT, filename, html5_comments, shebang) { - var S = { - text : $TEXT, - filename : filename, - pos : 0, - tokpos : 0, - line : 1, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - brace_counter : 0, - template_braces : [], - comments_before : [], - directives : {}, - directive_stack : [] - }; - - function peek() { return get_full_char(S.text, S.pos); } - - // Used because parsing ?. involves a lookahead for a digit - function is_option_chain_op() { - const must_be_dot = S.text.charCodeAt(S.pos + 1) === 46; - if (!must_be_dot) return false; - - const cannot_be_digit = S.text.charCodeAt(S.pos + 2); - return cannot_be_digit < 48 || cannot_be_digit > 57; - } - - function next(signal_eof, in_string) { - var ch = get_full_char(S.text, S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (NEWLINE_CHARS.has(ch)) { - S.newline_before = S.newline_before || !in_string; - ++S.line; - S.col = 0; - if (ch == "\r" && peek() == "\n") { - // treat a \r\n sequence as a single \n - ++S.pos; - ch = "\n"; - } - } else { - if (ch.length > 1) { - ++S.pos; - ++S.col; - } - ++S.col; - } - return ch; - } - - function forward(i) { - while (i--) next(); - } - - function looking_at(str) { - return S.text.substr(S.pos, str.length) == str; - } - - function find_eol() { - var text = S.text; - for (var i = S.pos, n = S.text.length; i < n; ++i) { - var ch = text[i]; - if (NEWLINE_CHARS.has(ch)) - return i; - } - return -1; - } - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - } - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - } - - var prev_was_dot = false; - var previous_token = null; - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX.has(value)) || - (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION.has(value)) || - (type == "punc" && PUNC_BEFORE_EXPRESSION.has(value))) || - (type == "arrow"); - if (type == "punc" && (value == "." || value == "?.")) { - prev_was_dot = true; - } else if (!is_comment) { - prev_was_dot = false; - } - const line = S.tokline; - const col = S.tokcol; - const pos = S.tokpos; - const nlb = S.newline_before; - const file = filename; - let comments_before = []; - let comments_after = []; - - if (!is_comment) { - comments_before = S.comments_before; - comments_after = S.comments_before = []; - } - S.newline_before = false; - const tok = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Token(type, value, line, col, pos, nlb, comments_before, comments_after, file); - - if (!is_comment) previous_token = tok; - return tok; - } - - function skip_whitespace() { - while (WHITESPACE_CHARS.has(peek())) - next(); - } - - function read_while(pred) { - var ret = "", ch, i = 0; - while ((ch = peek()) && pred(ch, i++)) - ret += next(); - return ret; - } - - function parse_error(err) { - js_error(err, filename, S.tokline, S.tokcol, S.tokpos); - } - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".", is_big_int = false, numeric_separator = false; - var num = read_while(function(ch, i) { - if (is_big_int) return false; - - var code = ch.charCodeAt(0); - switch (code) { - case 95: // _ - return (numeric_separator = true); - case 98: case 66: // bB - return (has_x = true); // Can occur in hex sequence, don't return false yet - case 111: case 79: // oO - case 120: case 88: // xX - return has_x ? false : (has_x = true); - case 101: case 69: // eE - return has_x ? true : has_e ? false : (has_e = after_e = true); - case 45: // - - return after_e || (i == 0 && !prefix); - case 43: // + - return after_e; - case (after_e = false, 46): // . - return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false; - case 110: // n - is_big_int = true; - return true; - } - - return ( - code >= 48 && code <= 57 // 0-9 - || code >= 97 && code <= 102 // a-f - || code >= 65 && code <= 70 // A-F - ); - }); - if (prefix) num = prefix + num; - - LATEST_RAW = num; - - if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) { - parse_error("Legacy octal literals are not allowed in strict mode"); - } - if (numeric_separator) { - if (num.endsWith("_")) { - parse_error("Numeric separators are not allowed at the end of numeric literals"); - } else if (num.includes("__")) { - parse_error("Only one underscore is allowed as numeric separator"); - } - num = num.replace(/_/g, ""); - } - if (is_big_int) { - const without_n = num.slice(0, -1); - const allow_e = RE_HEX_NUMBER.test(without_n); - const valid = parse_js_number(without_n, allow_e); - if (!has_dot && RE_BIG_INT.test(num) && !isNaN(valid)) - return token("big_int", without_n); - parse_error("Invalid or unexpected token"); - } - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - } - - function is_octal(ch) { - return ch >= "0" && ch <= "7"; - } - - function read_escaped_char(in_string, strict_hex, template_string) { - var ch = next(true, in_string); - switch (ch.charCodeAt(0)) { - case 110 : return "\n"; - case 114 : return "\r"; - case 116 : return "\t"; - case 98 : return "\b"; - case 118 : return "\u000b"; // \v - case 102 : return "\f"; - case 120 : return String.fromCharCode(hex_bytes(2, strict_hex)); // \x - case 117 : // \u - if (peek() == "{") { - next(true); - if (peek() === "}") - parse_error("Expecting hex-character between {}"); - while (peek() == "0") next(true); // No significance - var result, length = find("}", true) - S.pos; - // Avoid 32 bit integer overflow (1 << 32 === 1) - // We know first character isn't 0 and thus out of range anyway - if (length > 6 || (result = hex_bytes(length, strict_hex)) > 0x10FFFF) { - parse_error("Unicode reference out of bounds"); - } - next(true); - return from_char_code(result); - } - return String.fromCharCode(hex_bytes(4, strict_hex)); - case 10 : return ""; // newline - case 13 : // \r - if (peek() == "\n") { // DOS newline - next(true, in_string); - return ""; - } - } - if (is_octal(ch)) { - if (template_string && strict_hex) { - const represents_null_character = ch === "0" && !is_octal(peek()); - if (!represents_null_character) { - parse_error("Octal escape sequences are not allowed in template strings"); - } - } - return read_octal_escape_sequence(ch, strict_hex); - } - return ch; - } - - function read_octal_escape_sequence(ch, strict_octal) { - // Read - var p = peek(); - if (p >= "0" && p <= "7") { - ch += next(true); - if (ch[0] <= "3" && (p = peek()) >= "0" && p <= "7") - ch += next(true); - } - - // Parse - if (ch === "0") return "\0"; - if (ch.length > 0 && next_token.has_directive("use strict") && strict_octal) - parse_error("Legacy octal escape sequences are not allowed in strict mode"); - return String.fromCharCode(parseInt(ch, 8)); - } - - function hex_bytes(n, strict_hex) { - var num = 0; - for (; n > 0; --n) { - if (!strict_hex && isNaN(parseInt(peek(), 16))) { - return parseInt(num, 16) || ""; - } - var digit = next(true); - if (isNaN(parseInt(digit, 16))) - parse_error("Invalid hex-character pattern in string"); - num += digit; - } - return parseInt(num, 16); - } - - var read_string = with_eof_error("Unterminated string constant", function() { - const start_pos = S.pos; - var quote = next(), ret = []; - for (;;) { - var ch = next(true, true); - if (ch == "\\") ch = read_escaped_char(true, true); - else if (ch == "\r" || ch == "\n") parse_error("Unterminated string constant"); - else if (ch == quote) break; - ret.push(ch); - } - var tok = token("string", ret.join("")); - LATEST_RAW = S.text.slice(start_pos, S.pos); - tok.quote = quote; - return tok; - }); - - var read_template_characters = with_eof_error("Unterminated template", function(begin) { - if (begin) { - S.template_braces.push(S.brace_counter); - } - var content = "", raw = "", ch, tok; - next(true, true); - while ((ch = next(true, true)) != "`") { - if (ch == "\r") { - if (peek() == "\n") ++S.pos; - ch = "\n"; - } else if (ch == "$" && peek() == "{") { - next(true, true); - S.brace_counter++; - tok = token(begin ? "template_head" : "template_cont", content); - TEMPLATE_RAWS.set(tok, raw); - tok.template_end = false; - return tok; - } - - raw += ch; - if (ch == "\\") { - var tmp = S.pos; - var prev_is_tag = previous_token && (previous_token.type === "name" || previous_token.type === "punc" && (previous_token.value === ")" || previous_token.value === "]")); - ch = read_escaped_char(true, !prev_is_tag, true); - raw += S.text.substr(tmp, S.pos - tmp); - } - - content += ch; - } - S.template_braces.pop(); - tok = token(begin ? "template_head" : "template_cont", content); - TEMPLATE_RAWS.set(tok, raw); - tok.template_end = true; - return tok; - }); - - function skip_line_comment(type) { - var regex_allowed = S.regex_allowed; - var i = find_eol(), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - S.col = S.tokcol + (S.pos - S.tokpos); - S.comments_before.push(token(type, ret, true)); - S.regex_allowed = regex_allowed; - return next_token; - } - - var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function() { - var regex_allowed = S.regex_allowed; - var i = find("*/", true); - var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, "\n"); - // update stream position - forward(get_full_char_length(text) /* text length doesn't count \r\n as 2 char while S.pos - i does */ + 2); - S.comments_before.push(token("comment2", text, true)); - S.newline_before = S.newline_before || text.includes("\n"); - S.regex_allowed = regex_allowed; - return next_token; - }); - - var read_name = function () { - let start = S.pos, end = start - 1, ch = "c"; - - while ( - (ch = S.text.charAt(++end)) - && (ch >= "a" && ch <= "z" || ch >= "A" && ch <= "Z") - ); - - if (end > start + 1 && ch && ch !== "\\" && !is_identifier_char(ch)) { - S.pos += end - start; - S.col += end - start; - return S.text.slice(start, S.pos); - } - - return read_name_hard(); - }; - - var read_name_hard = with_eof_error("Unterminated identifier name", function() { - var name = [], ch, escaped = false; - var read_escaped_identifier_char = function() { - escaped = true; - next(); - if (peek() !== "u") { - parse_error("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"); - } - return read_escaped_char(false, true); - }; - - // Read first character (ID_Start) - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_start(ch)) { - parse_error("First identifier char is an invalid identifier char"); - } - } else if (is_identifier_start(ch)) { - next(); - } else { - return ""; - } - - name.push(ch); - - // Read ID_Continue - while ((ch = peek()) != null) { - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_char(ch)) { - parse_error("Invalid escaped identifier char"); - } - } else { - if (!is_identifier_char(ch)) { - break; - } - next(); - } - name.push(ch); - } - const name_str = name.join(""); - if (RESERVED_WORDS.has(name_str) && escaped) { - parse_error("Escaped characters are not allowed in keywords"); - } - return name_str; - }); - - var read_regexp = with_eof_error("Unterminated regular expression", function(source) { - var prev_backslash = false, ch, in_class = false; - while ((ch = next(true))) if (NEWLINE_CHARS.has(ch)) { - parse_error("Unexpected line terminator"); - } else if (prev_backslash) { - if (/^[\u0000-\u007F]$/.test(ch)) { - source += "\\" + ch; - } else { - // Remove the useless slash before the escape, but only for characters that won't be added to regexp syntax - source += ch; - } - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - source += ch; - } else if (ch == "]" && in_class) { - in_class = false; - source += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - source += ch; - } - const flags = read_name(); - return token("regexp", "/" + source + "/" + flags); - }); - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (OPERATORS.has(bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - } - return token("operator", grow(prefix || next())); - } - - function handle_slash() { - next(); - switch (peek()) { - case "/": - next(); - return skip_line_comment("comment1"); - case "*": - next(); - return skip_multiline_comment(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - } - - function handle_eq_sign() { - next(); - if (peek() === ">") { - next(); - return token("arrow", "=>"); - } else { - return read_operator("="); - } - } - - function handle_dot() { - next(); - if (is_digit(peek().charCodeAt(0))) { - return read_num("."); - } - if (peek() === ".") { - next(); // Consume second dot - next(); // Consume third dot - return token("expand", "..."); - } - - return token("punc", "."); - } - - function read_word() { - var word = read_name(); - if (prev_was_dot) return token("name", word); - return KEYWORDS_ATOM.has(word) ? token("atom", word) - : !KEYWORDS.has(word) ? token("name", word) - : OPERATORS.has(word) ? token("operator", word) - : token("keyword", word); - } - - function read_private_word() { - next(); - return token("privatename", read_name()); - } - - function with_eof_error(eof_error, cont) { - return function(x) { - try { - return cont(x); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - } - - function next_token(force_regexp) { - if (force_regexp != null) - return read_regexp(force_regexp); - if (shebang && S.pos == 0 && looking_at("#!")) { - start_token(); - forward(2); - skip_line_comment("comment5"); - } - for (;;) { - skip_whitespace(); - start_token(); - if (html5_comments) { - if (looking_at("") && S.newline_before) { - forward(3); - skip_line_comment("comment4"); - continue; - } - } - var ch = peek(); - if (!ch) return token("eof"); - var code = ch.charCodeAt(0); - switch (code) { - case 34: case 39: return read_string(); - case 46: return handle_dot(); - case 47: { - var tok = handle_slash(); - if (tok === next_token) continue; - return tok; - } - case 61: return handle_eq_sign(); - case 63: { - if (!is_option_chain_op()) break; // Handled below - - next(); // ? - next(); // . - - return token("punc", "?."); - } - case 96: return read_template_characters(true); - case 123: - S.brace_counter++; - break; - case 125: - S.brace_counter--; - if (S.template_braces.length > 0 - && S.template_braces[S.template_braces.length - 1] === S.brace_counter) - return read_template_characters(false); - break; - } - if (is_digit(code)) return read_num(); - if (PUNC_CHARS.has(ch)) return token("punc", next()); - if (OPERATOR_CHARS.has(ch)) return read_operator(); - if (code == 92 || is_identifier_start(ch)) return read_word(); - if (code == 35) return read_private_word(); - break; - } - parse_error("Unexpected character '" + ch + "'"); - } - - next_token.next = next; - next_token.peek = peek; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - next_token.add_directive = function(directive) { - S.directive_stack[S.directive_stack.length - 1].push(directive); - - if (S.directives[directive] === undefined) { - S.directives[directive] = 1; - } else { - S.directives[directive]++; - } - }; - - next_token.push_directives_stack = function() { - S.directive_stack.push([]); - }; - - next_token.pop_directives_stack = function() { - var directives = S.directive_stack[S.directive_stack.length - 1]; - - for (var i = 0; i < directives.length; i++) { - S.directives[directives[i]]--; - } - - S.directive_stack.pop(); - }; - - next_token.has_directive = function(directive) { - return S.directives[directive] > 0; - }; - - return next_token; - -} - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)([ "--", "++" ]); - -var ASSIGNMENT = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)([ "=", "+=", "-=", "??=", "&&=", "||=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - -var LOGICAL_ASSIGNMENT = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)([ "??=", "&&=", "||=" ]); - -var PRECEDENCE = (function(a, ret) { - for (var i = 0; i < a.length; ++i) { - for (const op of a[i]) { - ret[op] = i + 1; - } - } - return ret; -})( - [ - ["||"], - ["??"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"], - ["**"] - ], - {} -); - -var ATOMIC_START_TOKEN = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.makePredicate)([ "atom", "num", "big_int", "string", "regexp", "name"]); - -/* -----[ Parser ]----- */ - -function parse($TEXT, options) { - // maps start tokens to count of comments found outside of their parens - // Example: /* I count */ ( /* I don't */ foo() ) - // Useful because comments_before property of call with parens outside - // contains both comments inside and outside these parens. Used to find the - // right #__PURE__ comments for an expression - const outer_comments_before_counts = new WeakMap(); - - options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { - bare_returns : false, - ecma : null, // Legacy - expression : false, - filename : null, - html5_comments : true, - module : false, - shebang : true, - strict : false, - toplevel : null, - }, true); - - var S = { - input : (typeof $TEXT == "string" - ? tokenizer($TEXT, options.filename, - options.html5_comments, options.shebang) - : $TEXT), - token : null, - prev : null, - peeked : null, - in_function : 0, - in_async : -1, - in_generator : -1, - in_directives : true, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - } - - function peek() { return S.peeked || (S.peeked = S.input()); } - - function next() { - S.prev = S.token; - - if (!S.peeked) peek(); - S.token = S.peeked; - S.peeked = null; - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - } - - function prev() { - return S.prev; - } - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - ctx.filename, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - } - - function token_error(token, msg) { - croak(msg, token.line, token.col); - } - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - } - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); - } - - function expect(punc) { return expect_token("punc", punc); } - - function has_newline_before(token) { - return token.nlb || !token.comments_before.every((comment) => !comment.nlb); - } - - function can_insert_semicolon() { - return !options.strict - && (is("eof") || is("punc", "}") || has_newline_before(S.token)); - } - - function is_in_generator() { - return S.in_generator === S.in_function; - } - - function is_in_async() { - return S.in_async === S.in_function; - } - - function can_await() { - return ( - S.in_async === S.in_function - || S.in_function === 0 && S.input.has_directive("use strict") - ); - } - - function semicolon(optional) { - if (is("punc", ";")) next(); - else if (!optional && !can_insert_semicolon()) unexpected(); - } - - function parenthesised() { - expect("("); - var exp = expression(true); - expect(")"); - return exp; - } - - function embed_tokens(parser) { - return function _embed_tokens_wrapper(...args) { - const start = S.token; - const expr = parser(...args); - expr.start = start; - expr.end = prev(); - return expr; - }; - } - - function handle_regexp() { - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - } - - var statement = embed_tokens(function statement(is_export_default, is_for_body, is_if_body) { - handle_regexp(); - switch (S.token.type) { - case "string": - if (S.in_directives) { - var token = peek(); - if (!LATEST_RAW.includes("\\") - && (is_token(token, "punc", ";") - || is_token(token, "punc", "}") - || has_newline_before(token) - || is_token(token, "eof"))) { - S.input.add_directive(S.token.value); - } else { - S.in_directives = false; - } - } - var dir = S.in_directives, stat = simple_statement(); - return dir && stat.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String ? new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Directive(stat.body) : stat; - case "template_head": - case "num": - case "big_int": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - case "privatename": - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - - if (S.token.value == "async" && is_token(peek(), "keyword", "function")) { - next(); - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun, false, true, is_export_default); - } - if (S.token.value == "import" && !is_token(peek(), "punc", "(") && !is_token(peek(), "punc", ".")) { - next(); - var node = import_statement(); - semicolon(); - return node; - } - return is_token(peek(), "punc", ":") - ? labeled_statement() - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BlockStatement({ - start : S.token, - body : block_(), - end : prev() - }); - case "[": - case "(": - return simple_statement(); - case ";": - S.in_directives = false; - next(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_EmptyStatement(); - default: - unexpected(); - } - - case "keyword": - switch (S.token.value) { - case "break": - next(); - return break_cont(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Break); - - case "continue": - next(); - return break_cont(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Continue); - - case "debugger": - next(); - semicolon(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Debugger(); - - case "do": - next(); - var body = in_loop(statement); - expect_token("keyword", "while"); - var condition = parenthesised(); - semicolon(true); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Do({ - body : body, - condition : condition - }); - - case "while": - next(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_While({ - condition : parenthesised(), - body : in_loop(function() { return statement(false, true); }) - }); - - case "for": - next(); - return for_(); - - case "class": - next(); - if (is_for_body) { - croak("classes are not allowed as the body of a loop"); - } - if (is_if_body) { - croak("classes are not allowed as the body of an if"); - } - return class_(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefClass, is_export_default); - - case "function": - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun, false, false, is_export_default); - - case "if": - next(); - return if_(); - - case "return": - if (S.in_function == 0 && !options.bare_returns) - croak("'return' outside of function"); - next(); - var value = null; - if (is("punc", ";")) { - next(); - } else if (!can_insert_semicolon()) { - value = expression(true); - semicolon(); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Return({ - value: value - }); - - case "switch": - next(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Switch({ - expression : parenthesised(), - body : in_loop(switch_body_) - }); - - case "throw": - next(); - if (has_newline_before(S.token)) - croak("Illegal newline after 'throw'"); - var value = expression(true); - semicolon(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Throw({ - value: value - }); - - case "try": - next(); - return try_(); - - case "var": - next(); - var node = var_(); - semicolon(); - return node; - - case "let": - next(); - var node = let_(); - semicolon(); - return node; - - case "const": - next(); - var node = const_(); - semicolon(); - return node; - - case "with": - if (S.input.has_directive("use strict")) { - croak("Strict mode may not include a with statement"); - } - next(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_With({ - expression : parenthesised(), - body : statement() - }); - - case "export": - if (!is_token(peek(), "punc", "(")) { - next(); - var node = export_statement(); - if (is("punc", ";")) semicolon(); - return node; - } - } - } - unexpected(); - }); - - function labeled_statement() { - var label = as_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Label); - if (label.name === "await" && is_in_async()) { - token_error(S.prev, "await cannot be used as label inside async function"); - } - if (S.labels.some((l) => l.name === label.name)) { - // ECMA-262, 12.12: An ECMAScript program is considered - // syntactically incorrect if it contains a - // LabelledStatement that is enclosed by a - // LabelledStatement with the same Identifier as label. - croak("Label " + label.name + " defined twice"); - } - expect(":"); - S.labels.push(label); - var stat = statement(); - S.labels.pop(); - if (!(stat instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_IterationStatement)) { - // check for `continue` that refers to this label. - // those should be reported as syntax errors. - // https://github.com/mishoo/UglifyJS2/issues/287 - label.references.forEach(function(ref) { - if (ref instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Continue) { - ref = ref.label.start; - croak("Continue label `" + label.name + "` refers to non-IterationStatement.", - ref.line, ref.col, ref.pos); - } - }); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabeledStatement({ body: stat, label: label }); - } - - function simple_statement(tmp) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); - } - - function break_cont(type) { - var label = null, ldef; - if (!can_insert_semicolon()) { - label = as_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabelRef, true); - } - if (label != null) { - ldef = S.labels.find((l) => l.name === label.name); - if (!ldef) - croak("Undefined label " + label.name); - label.thedef = ldef; - } else if (S.in_loop == 0) - croak(type.TYPE + " not inside a loop or switch"); - semicolon(); - var stat = new type({ label: label }); - if (ldef) ldef.references.push(stat); - return stat; - } - - function for_() { - var for_await_error = "`for await` invalid in this context"; - var await_tok = S.token; - if (await_tok.type == "name" && await_tok.value == "await") { - if (!can_await()) { - token_error(await_tok, for_await_error); - } - next(); - } else { - await_tok = false; - } - expect("("); - var init = null; - if (!is("punc", ";")) { - init = - is("keyword", "var") ? (next(), var_(true)) : - is("keyword", "let") ? (next(), let_(true)) : - is("keyword", "const") ? (next(), const_(true)) : - expression(true, true); - var is_in = is("operator", "in"); - var is_of = is("name", "of"); - if (await_tok && !is_of) { - token_error(await_tok, for_await_error); - } - if (is_in || is_of) { - if (init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Definitions) { - if (init.definitions.length > 1) - token_error(init.start, "Only one variable declaration allowed in for..in loop"); - } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring)) { - token_error(init.start, "Invalid left-hand side in for..in loop"); - } - next(); - if (is_in) { - return for_in(init); - } else { - return for_of(init, !!await_tok); - } - } - } else if (await_tok) { - token_error(await_tok, for_await_error); - } - return regular_for(init); - } - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(true); - expect(";"); - var step = is("punc", ")") ? null : expression(true); - expect(")"); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_For({ - init : init, - condition : test, - step : step, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_of(init, is_await) { - var lhs = init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Definitions ? init.definitions[0].name : null; - var obj = expression(true); - expect(")"); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForOf({ - await : is_await, - init : init, - name : lhs, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_in(init) { - var obj = expression(true); - expect(")"); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForIn({ - init : init, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - var arrow_function = function(start, argnames, is_async) { - if (has_newline_before(S.token)) { - croak("Unexpected newline before arrow (=>)"); - } - - expect_token("arrow", "=>"); - - var body = _function_body(is("punc", "{"), false, is_async); - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Arrow({ - start : start, - end : body.end, - async : is_async, - argnames : argnames, - body : body - }); - }; - - var function_ = function(ctor, is_generator, is_async, is_export_default) { - var in_statement = ctor === _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun; - if (is("operator", "*")) { - is_generator = true; - next(); - } - - var name = is("name") ? as_symbol(in_statement ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefun : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLambda) : null; - if (in_statement && !name) { - if (is_export_default) { - ctor = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function; - } else { - unexpected(); - } - } - - if (name && ctor !== _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Accessor && !(name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDeclaration)) - unexpected(prev()); - - var args = []; - var body = _function_body(true, is_generator, is_async, name, args); - return new ctor({ - start : args.start, - end : body.end, - is_generator: is_generator, - async : is_async, - name : name, - argnames: args, - body : body - }); - }; - - class UsedParametersTracker { - constructor(is_parameter, strict, duplicates_ok = false) { - this.is_parameter = is_parameter; - this.duplicates_ok = duplicates_ok; - this.parameters = new Set(); - this.duplicate = null; - this.default_assignment = false; - this.spread = false; - this.strict_mode = !!strict; - } - add_parameter(token) { - if (this.parameters.has(token.value)) { - if (this.duplicate === null) { - this.duplicate = token; - } - this.check_strict(); - } else { - this.parameters.add(token.value); - if (this.is_parameter) { - switch (token.value) { - case "arguments": - case "eval": - case "yield": - if (this.strict_mode) { - token_error(token, "Unexpected " + token.value + " identifier as parameter inside strict mode"); - } - break; - default: - if (RESERVED_WORDS.has(token.value)) { - unexpected(); - } - } - } - } - } - mark_default_assignment(token) { - if (this.default_assignment === false) { - this.default_assignment = token; - } - } - mark_spread(token) { - if (this.spread === false) { - this.spread = token; - } - } - mark_strict_mode() { - this.strict_mode = true; - } - is_strict() { - return this.default_assignment !== false || this.spread !== false || this.strict_mode; - } - check_strict() { - if (this.is_strict() && this.duplicate !== null && !this.duplicates_ok) { - token_error(this.duplicate, "Parameter " + this.duplicate.value + " was used already"); - } - } - } - - function parameters(params) { - var used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); - - expect("("); - - while (!is("punc", ")")) { - var param = parameter(used_parameters); - params.push(param); - - if (!is("punc", ")")) { - expect(","); - } - - if (param instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion) { - break; - } - } - - next(); - } - - function parameter(used_parameters, symbol_type) { - var param; - var expand = false; - if (used_parameters === undefined) { - used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); - } - if (is("expand", "...")) { - expand = S.token; - used_parameters.mark_spread(S.token); - next(); - } - param = binding_element(used_parameters, symbol_type); - - if (is("operator", "=") && expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - param = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign({ - start: param.start, - left: param, - operator: "=", - right: expression(false), - end: S.token - }); - } - - if (expand !== false) { - if (!is("punc", ")")) { - unexpected(); - } - param = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: expand, - expression: param, - end: expand - }); - } - used_parameters.check_strict(); - - return param; - } - - function binding_element(used_parameters, symbol_type) { - var elements = []; - var first = true; - var is_expand = false; - var expand_token; - var first_token = S.token; - if (used_parameters === undefined) { - const strict = S.input.has_directive("use strict"); - const duplicates_ok = symbol_type === _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolVar; - used_parameters = new UsedParametersTracker(false, strict, duplicates_ok); - } - symbol_type = symbol_type === undefined ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg : symbol_type; - if (is("punc", "[")) { - next(); - while (!is("punc", "]")) { - if (first) { - first = false; - } else { - expect(","); - } - - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("punc")) { - switch (S.token.value) { - case ",": - elements.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole({ - start: S.token, - end: S.token - })); - continue; - case "]": // Trailing comma after last element - break; - case "[": - case "{": - elements.push(binding_element(used_parameters, symbol_type)); - break; - default: - unexpected(); - } - } else if (is("name")) { - used_parameters.add_parameter(S.token); - elements.push(as_symbol(symbol_type)); - } else { - croak("Invalid function parameter"); - } - if (is("operator", "=") && is_expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1] = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign({ - start: elements[elements.length - 1].start, - left: elements[elements.length - 1], - operator: "=", - right: expression(false), - end: S.token - }); - } - if (is_expand) { - if (!is("punc", "]")) { - croak("Rest element must be last element"); - } - elements[elements.length - 1] = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: expand_token, - expression: elements[elements.length - 1], - end: expand_token - }); - } - } - expect("]"); - used_parameters.check_strict(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: first_token, - names: elements, - is_array: true, - end: prev() - }); - } else if (is("punc", "{")) { - next(); - while (!is("punc", "}")) { - if (first) { - first = false; - } else { - expect(","); - } - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("name") && (is_token(peek(), "punc") || is_token(peek(), "operator")) && [",", "}", "="].includes(peek().value)) { - used_parameters.add_parameter(S.token); - var start = prev(); - var value = as_symbol(symbol_type); - if (is_expand) { - elements.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: expand_token, - expression: value, - end: value.end, - })); - } else { - elements.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal({ - start: start, - key: value.name, - value: value, - end: value.end, - })); - } - } else if (is("punc", "}")) { - continue; // Allow trailing hole - } else { - var property_token = S.token; - var property = as_property_name(); - if (property === null) { - unexpected(prev()); - } else if (prev().type === "name" && !is("punc", ":")) { - elements.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal({ - start: prev(), - key: property, - value: new symbol_type({ - start: prev(), - name: property, - end: prev() - }), - end: prev() - })); - } else { - expect(":"); - elements.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal({ - start: property_token, - quote: property_token.quote, - key: property, - value: binding_element(used_parameters, symbol_type), - end: prev() - })); - } - } - if (is_expand) { - if (!is("punc", "}")) { - croak("Rest element must be last element"); - } - } else if (is("operator", "=")) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1].value = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign({ - start: elements[elements.length - 1].value.start, - left: elements[elements.length - 1].value, - operator: "=", - right: expression(false), - end: S.token - }); - } - } - expect("}"); - used_parameters.check_strict(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: first_token, - names: elements, - is_array: false, - end: prev() - }); - } else if (is("name")) { - used_parameters.add_parameter(S.token); - return as_symbol(symbol_type); - } else { - croak("Invalid function parameter"); - } - } - - function params_or_seq_(allow_arrows, maybe_sequence) { - var spread_token; - var invalid_sequence; - var trailing_comma; - var a = []; - expect("("); - while (!is("punc", ")")) { - if (spread_token) unexpected(spread_token); - if (is("expand", "...")) { - spread_token = S.token; - if (maybe_sequence) invalid_sequence = S.token; - next(); - a.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: prev(), - expression: expression(), - end: S.token, - })); - } else { - a.push(expression()); - } - if (!is("punc", ")")) { - expect(","); - if (is("punc", ")")) { - trailing_comma = prev(); - if (maybe_sequence) invalid_sequence = trailing_comma; - } - } - } - expect(")"); - if (allow_arrows && is("arrow", "=>")) { - if (spread_token && trailing_comma) unexpected(trailing_comma); - } else if (invalid_sequence) { - unexpected(invalid_sequence); - } - return a; - } - - function _function_body(block, generator, is_async, name, args) { - var loop = S.in_loop; - var labels = S.labels; - var current_generator = S.in_generator; - var current_async = S.in_async; - ++S.in_function; - if (generator) - S.in_generator = S.in_function; - if (is_async) - S.in_async = S.in_function; - if (args) parameters(args); - if (block) - S.in_directives = true; - S.in_loop = 0; - S.labels = []; - if (block) { - S.input.push_directives_stack(); - var a = block_(); - if (name) _verify_symbol(name); - if (args) args.forEach(_verify_symbol); - S.input.pop_directives_stack(); - } else { - var a = [new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Return({ - start: S.token, - value: expression(false), - end: S.token - })]; - } - --S.in_function; - S.in_loop = loop; - S.labels = labels; - S.in_generator = current_generator; - S.in_async = current_async; - return a; - } - - function _await_expression() { - // Previous token must be "await" and not be interpreted as an identifier - if (!can_await()) { - croak("Unexpected await expression outside async function", - S.prev.line, S.prev.col, S.prev.pos); - } - // the await expression is parsed as a unary expression in Babel - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Await({ - start: prev(), - end: S.token, - expression : maybe_unary(true), - }); - } - - function _yield_expression() { - var start = S.token; - var star = false; - var has_expression = true; - - // Attempt to get expression or star (and then the mandatory expression) - // behind yield on the same line. - // - // If nothing follows on the same line of the yieldExpression, - // it should default to the value `undefined` for yield to return. - // In that case, the `undefined` stored as `null` in ast. - // - // Note 1: It isn't allowed for yield* to close without an expression - // Note 2: If there is a nlb between yield and star, it is interpret as - // yield * - if ( - can_insert_semicolon() - || is("punc") && PUNC_AFTER_EXPRESSION.has(S.token.value) - || is("template_cont") - ) { - has_expression = false; - } else if (is("operator", "*")) { - star = true; - next(); - } - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Yield({ - start : start, - is_star : star, - expression : has_expression ? expression() : null, - end : prev() - }); - } - - function if_() { - var cond = parenthesised(), body = statement(false, false, true), belse = null; - if (is("keyword", "else")) { - next(); - belse = statement(false, false, true); - } - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_If({ - condition : cond, - body : body, - alternative : belse - }); - } - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - } - - function switch_body_() { - expect("{"); - var a = [], cur = null, branch = null, tmp; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - if (branch) branch.end = prev(); - cur = []; - branch = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Case({ - start : (tmp = S.token, next(), tmp), - expression : expression(true), - body : cur - }); - a.push(branch); - expect(":"); - } else if (is("keyword", "default")) { - if (branch) branch.end = prev(); - cur = []; - branch = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Default({ - start : (tmp = S.token, next(), expect(":"), tmp), - body : cur - }); - a.push(branch); - } else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - if (branch) branch.end = prev(); - next(); - return a; - } - - function try_() { - var body, bcatch = null, bfinally = null; - body = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TryBlock({ - start : S.token, - body : block_(), - end : prev(), - }); - if (is("keyword", "catch")) { - var start = S.token; - next(); - if (is("punc", "{")) { - var name = null; - } else { - expect("("); - var name = parameter(undefined, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch); - expect(")"); - } - bcatch = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Catch({ - start : start, - argname : name, - body : block_(), - end : prev() - }); - } - if (is("keyword", "finally")) { - var start = S.token; - next(); - bfinally = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Finally({ - start : start, - body : block_(), - end : prev() - }); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Try({ - body : body, - bcatch : bcatch, - bfinally : bfinally - }); - } - - /** - * var - * vardef1 = 2, - * vardef2 = 3; - */ - function vardefs(no_in, kind) { - var var_defs = []; - var def; - for (;;) { - var sym_type = - kind === "var" ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolVar : - kind === "const" ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolConst : - kind === "let" ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLet : null; - // var { a } = b - if (is("punc", "{") || is("punc", "[")) { - def = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_VarDef({ - start: S.token, - name: binding_element(undefined, sym_type), - value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null, - end: prev() - }); - } else { - def = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_VarDef({ - start : S.token, - name : as_symbol(sym_type), - value : is("operator", "=") - ? (next(), expression(false, no_in)) - : !no_in && kind === "const" - ? croak("Missing initializer in const declaration") : null, - end : prev() - }); - if (def.name.name == "import") croak("Unexpected token: import"); - } - var_defs.push(def); - if (!is("punc", ",")) - break; - next(); - } - return var_defs; - } - - var var_ = function(no_in) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Var({ - start : prev(), - definitions : vardefs(no_in, "var"), - end : prev() - }); - }; - - var let_ = function(no_in) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Let({ - start : prev(), - definitions : vardefs(no_in, "let"), - end : prev() - }); - }; - - var const_ = function(no_in) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Const({ - start : prev(), - definitions : vardefs(no_in, "const"), - end : prev() - }); - }; - - var new_ = function(allow_calls) { - var start = S.token; - expect_token("operator", "new"); - if (is("punc", ".")) { - next(); - expect_token("name", "target"); - return subscripts(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NewTarget({ - start : start, - end : prev() - }), allow_calls); - } - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")", true); - } else { - args = []; - } - var call = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_New({ - start : start, - expression : newexp, - args : args, - end : prev() - }); - annotate(call); - return subscripts(call, allow_calls); - }; - - function as_atom_node() { - var tok = S.token, ret; - switch (tok.type) { - case "name": - ret = _make_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef); - break; - case "num": - ret = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Number({ - start: tok, - end: tok, - value: tok.value, - raw: LATEST_RAW - }); - break; - case "big_int": - ret = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_BigInt({ - start: tok, - end: tok, - value: tok.value, - raw: LATEST_RAW, - }); - break; - case "string": - ret = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String({ - start : tok, - end : tok, - value : tok.value, - quote : tok.quote - }); - annotate(ret); - break; - case "regexp": - const [_, source, flags] = tok.value.match(/^\/(.*)\/(\w*)$/); - - ret = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_RegExp({ start: tok, end: tok, value: { source, flags } }); - break; - case "atom": - switch (tok.value) { - case "false": - ret = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_False({ start: tok, end: tok }); - break; - case "true": - ret = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_True({ start: tok, end: tok }); - break; - case "null": - ret = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Null({ start: tok, end: tok }); - break; - } - break; - } - next(); - return ret; - } - - function to_fun_args(ex, default_seen_above) { - var insert_default = function(ex, default_value) { - if (default_value) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign({ - start: ex.start, - left: ex, - operator: "=", - right: default_value, - end: default_value.end - }); - } - return ex; - }; - if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object) { - return insert_default(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: false, - names: ex.properties.map(prop => to_fun_args(prop)) - }), default_seen_above); - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal) { - ex.value = to_fun_args(ex.value); - return insert_default(ex, default_seen_above); - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole) { - return ex; - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring) { - ex.names = ex.names.map(name => to_fun_args(name)); - return insert_default(ex, default_seen_above); - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef) { - return insert_default(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg({ - name: ex.name, - start: ex.start, - end: ex.end - }), default_seen_above); - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion) { - ex.expression = to_fun_args(ex.expression); - return insert_default(ex, default_seen_above); - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array) { - return insert_default(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: true, - names: ex.elements.map(elm => to_fun_args(elm)) - }), default_seen_above); - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Assign) { - return insert_default(to_fun_args(ex.left, ex.right), default_seen_above); - } else if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign) { - ex.left = to_fun_args(ex.left); - return ex; - } else { - croak("Invalid function parameter", ex.start.line, ex.start.col); - } - } - - var expr_atom = function(allow_calls, allow_arrows) { - if (is("operator", "new")) { - return new_(allow_calls); - } - if (is("name", "import") && is_token(peek(), "punc", ".")) { - return import_meta(allow_calls); - } - var start = S.token; - var peeked; - var async = is("name", "async") - && (peeked = peek()).value != "[" - && peeked.type != "arrow" - && as_atom_node(); - if (is("punc")) { - switch (S.token.value) { - case "(": - if (async && !allow_calls) break; - var exprs = params_or_seq_(allow_arrows, !async); - if (allow_arrows && is("arrow", "=>")) { - return arrow_function(start, exprs.map(e => to_fun_args(e)), !!async); - } - var ex = async ? new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call({ - expression: async, - args: exprs - }) : to_expr_or_sequence(start, exprs); - if (ex.start) { - const outer_comments_before = start.comments_before.length; - outer_comments_before_counts.set(start, outer_comments_before); - ex.start.comments_before.unshift(...start.comments_before); - start.comments_before = ex.start.comments_before; - if (outer_comments_before == 0 && start.comments_before.length > 0) { - var comment = start.comments_before[0]; - if (!comment.nlb) { - comment.nlb = start.nlb; - start.nlb = false; - } - } - start.comments_after = ex.start.comments_after; - } - ex.start = start; - var end = prev(); - if (ex.end) { - end.comments_before = ex.end.comments_before; - ex.end.comments_after.push(...end.comments_after); - end.comments_after = ex.end.comments_after; - } - ex.end = end; - if (ex instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call) annotate(ex); - return subscripts(ex, allow_calls); - case "[": - return subscripts(array_(), allow_calls); - case "{": - return subscripts(object_or_destructuring_(), allow_calls); - } - if (!async) unexpected(); - } - if (allow_arrows && is("name") && is_token(peek(), "arrow")) { - var param = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg({ - name: S.token.value, - start: start, - end: start, - }); - next(); - return arrow_function(start, [param], !!async); - } - if (is("keyword", "function")) { - next(); - var func = function_(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function, false, !!async); - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (async) return subscripts(async, allow_calls); - if (is("keyword", "class")) { - next(); - var cls = class_(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassExpression); - cls.start = start; - cls.end = prev(); - return subscripts(cls, allow_calls); - } - if (is("template_head")) { - return subscripts(template_string(), allow_calls); - } - if (ATOMIC_START_TOKEN.has(S.token.type)) { - return subscripts(as_atom_node(), allow_calls); - } - unexpected(); - }; - - function template_string() { - var segments = [], start = S.token; - - segments.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TemplateSegment({ - start: S.token, - raw: TEMPLATE_RAWS.get(S.token), - value: S.token.value, - end: S.token - })); - - while (!S.token.template_end) { - next(); - handle_regexp(); - segments.push(expression(true)); - - segments.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TemplateSegment({ - start: S.token, - raw: TEMPLATE_RAWS.get(S.token), - value: S.token.value, - end: S.token - })); - } - next(); - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_TemplateString({ - start: start, - segments: segments, - end: S.token - }); - } - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Hole({ start: S.token, end: S.token })); - } else if (is("expand", "...")) { - next(); - a.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({start: prev(), expression: expression(),end: S.token})); - } else { - a.push(expression(false)); - } - } - next(); - return a; - } - - var array_ = embed_tokens(function() { - expect("["); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array({ - elements: expr_list("]", !options.strict, true) - }); - }); - - var create_accessor = embed_tokens((is_generator, is_async) => { - return function_(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Accessor, is_generator, is_async); - }); - - var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() { - var start = S.token, first = true, a = []; - expect("{"); - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!options.strict && is("punc", "}")) - // allow trailing comma - break; - - start = S.token; - if (start.type == "expand") { - next(); - a.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: start, - expression: expression(false), - end: prev(), - })); - continue; - } - if(is("privatename")) { - croak("private fields are not allowed in an object"); - } - var name = as_property_name(); - var value; - - // Check property and fetch value - if (!is("punc", ":")) { - var concise = object_or_class_property(name, start); - if (concise) { - a.push(concise); - continue; - } - - value = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef({ - start: prev(), - name: name, - end: prev() - }); - } else if (name === null) { - unexpected(prev()); - } else { - next(); // `:` - see first condition - value = expression(false); - } - - // Check for default value and alter value accordingly if necessary - if (is("operator", "=")) { - next(); - value = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Assign({ - start: start, - left: value, - operator: "=", - right: expression(false), - logical: false, - end: prev() - }); - } - - // Create property - const kv = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectKeyVal({ - start: start, - quote: start.quote, - key: name, - value: value, - end: prev() - }); - a.push(annotate(kv)); - } - next(); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object({ properties: a }); - }); - - function class_(KindOfClass, is_export_default) { - var start, method, class_name, extends_, properties = []; - - S.input.push_directives_stack(); // Push directive stack, but not scope stack - S.input.add_directive("use strict"); - - if (S.token.type == "name" && S.token.value != "extends") { - class_name = as_symbol(KindOfClass === _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefClass ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefClass : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolClass); - } - - if (KindOfClass === _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefClass && !class_name) { - if (is_export_default) { - KindOfClass = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassExpression; - } else { - unexpected(); - } - } - - if (S.token.value == "extends") { - next(); - extends_ = expression(true); - } - - expect("{"); - // mark in class feild, - const save_in_class = S.in_class; - S.in_class = true; - while (is("punc", ";")) { next(); } // Leading semicolons are okay in class bodies. - while (!is("punc", "}")) { - start = S.token; - method = object_or_class_property(as_property_name(), start, true); - if (!method) { unexpected(); } - properties.push(method); - while (is("punc", ";")) { next(); } - } - // mark in class feild, - S.in_class = save_in_class; - - S.input.pop_directives_stack(); - - next(); - - return new KindOfClass({ - start: start, - name: class_name, - extends: extends_, - properties: properties, - end: prev(), - }); - } - - function object_or_class_property(name, start, is_class) { - const get_symbol_ast = (name, SymbolClass) => { - if (typeof name === "string") { - return new SymbolClass({ start, name, end: prev() }); - } else if (name === null) { - unexpected(); - } - return name; - }; - - const is_not_method_start = () => - !is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("punc", ";") && !is("operator", "="); - - var is_async = false; - var is_static = false; - var is_generator = false; - var is_private = false; - var accessor_type = null; - - if (is_class && name === "static" && is_not_method_start()) { - const static_block = class_static_block(); - if (static_block != null) { - return static_block; - } - is_static = true; - name = as_property_name(); - } - if (name === "async" && is_not_method_start()) { - is_async = true; - name = as_property_name(); - } - if (prev().type === "operator" && prev().value === "*") { - is_generator = true; - name = as_property_name(); - } - if ((name === "get" || name === "set") && is_not_method_start()) { - accessor_type = name; - name = as_property_name(); - } - if (prev().type === "privatename") { - is_private = true; - } - - const property_token = prev(); - - if (accessor_type != null) { - if (!is_private) { - const AccessorClass = accessor_type === "get" - ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectGetter - : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectSetter; - - name = get_symbol_ast(name, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod); - return annotate(new AccessorClass({ - start, - static: is_static, - key: name, - quote: name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod ? property_token.quote : undefined, - value: create_accessor(), - end: prev() - })); - } else { - const AccessorClass = accessor_type === "get" - ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateGetter - : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateSetter; - - return annotate(new AccessorClass({ - start, - static: is_static, - key: get_symbol_ast(name, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod), - value: create_accessor(), - end: prev(), - })); - } - } - - if (is("punc", "(")) { - name = get_symbol_ast(name, _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod); - const AST_MethodVariant = is_private - ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateMethod - : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ConciseMethod; - var node = new AST_MethodVariant({ - start : start, - static : is_static, - key : name, - quote : name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod ? - property_token.quote : undefined, - value : create_accessor(is_generator, is_async), - end : prev() - }); - return annotate(node); - } - - if (is_class) { - const AST_SymbolVariant = is_private - ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolPrivateProperty - : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolClassProperty; - const AST_ClassPropertyVariant = is_private - ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassPrivateProperty - : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassProperty; - - const key = get_symbol_ast(name, AST_SymbolVariant); - const quote = key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolClassProperty - ? property_token.quote - : undefined; - if (is("operator", "=")) { - next(); - return annotate( - new AST_ClassPropertyVariant({ - start, - static: is_static, - quote, - key, - value: expression(false), - end: prev() - }) - ); - } else if ( - is("name") - || is("privatename") - || is("punc", "[") - || is("operator", "*") - || is("punc", ";") - || is("punc", "}") - || is("string") - || is("num") - || is("big_int") - ) { - return annotate( - new AST_ClassPropertyVariant({ - start, - static: is_static, - quote, - key, - end: prev() - }) - ); - } - } - } - - function class_static_block() { - if (!is("punc", "{")) { - return null; - } - - const start = S.token; - const body = []; - - next(); - - while (!is("punc", "}")) { - body.push(statement()); - } - - next(); - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassStaticBlock({ start, body, end: prev() }); - } - - function maybe_import_attributes() { - if ( - (is("keyword", "with") || is("name", "assert")) - && !has_newline_before(S.token) - ) { - next(); - return object_or_destructuring_(); - } - return null; - } - - function import_statement() { - var start = prev(); - - var imported_name; - var imported_names; - if (is("name")) { - imported_name = as_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport); - } - - if (is("punc", ",")) { - next(); - } - - imported_names = map_names(true); - - if (imported_names || imported_name) { - expect_token("name", "from"); - } - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - - const attributes = maybe_import_attributes(); - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Import({ - start, - imported_name, - imported_names, - module_name: new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - attributes, - end: S.token, - }); - } - - function import_meta(allow_calls) { - var start = S.token; - expect_token("name", "import"); - expect_token("punc", "."); - expect_token("name", "meta"); - return subscripts(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ImportMeta({ - start: start, - end: prev() - }), allow_calls); - } - - function map_name(is_import) { - function make_symbol(type, quote) { - return new type({ - name: as_property_name(), - quote: quote || undefined, - start: prev(), - end: prev() - }); - } - - var foreign_type = is_import ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImportForeign : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExportForeign; - var type = is_import ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExport; - var start = S.token; - var foreign_name; - var name; - - if (is_import) { - foreign_name = make_symbol(foreign_type, start.quote); - } else { - name = make_symbol(type, start.quote); - } - if (is("name", "as")) { - next(); // The "as" word - if (is_import) { - name = make_symbol(type); - } else { - foreign_name = make_symbol(foreign_type, S.token.quote); - } - } else { - if (is_import) { - name = new type(foreign_name); - } else { - foreign_name = new foreign_type(name); - } - } - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: prev(), - }); - } - - function map_nameAsterisk(is_import, import_or_export_foreign_name) { - var foreign_type = is_import ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImportForeign : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExportForeign; - var type = is_import ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExport; - var start = S.token; - var name, foreign_name; - var end = prev(); - - if (is_import) { - name = import_or_export_foreign_name; - } else { - foreign_name = import_or_export_foreign_name; - } - - name = name || new type({ - start: start, - name: "*", - end: end, - }); - - foreign_name = foreign_name || new foreign_type({ - start: start, - name: "*", - end: end, - }); - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: end, - }); - } - - function map_names(is_import) { - var names; - if (is("punc", "{")) { - next(); - names = []; - while (!is("punc", "}")) { - names.push(map_name(is_import)); - if (is("punc", ",")) { - next(); - } - } - next(); - } else if (is("operator", "*")) { - var name; - next(); - if (is("name", "as")) { - next(); // The "as" word - name = is_import ? as_symbol(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport) : as_symbol_or_string(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExportForeign); - } - names = [map_nameAsterisk(is_import, name)]; - } - return names; - } - - function export_statement() { - var start = S.token; - var is_default; - var exported_names; - - if (is("keyword", "default")) { - is_default = true; - next(); - } else if (exported_names = map_names(false)) { - if (is("name", "from")) { - next(); - - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - - const attributes = maybe_import_attributes(); - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - module_name: new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - end: prev(), - attributes - }); - } else { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - end: prev(), - }); - } - } - - var node; - var exported_value; - var exported_definition; - if (is("punc", "{") - || is_default - && (is("keyword", "class") || is("keyword", "function")) - && is_token(peek(), "punc")) { - exported_value = expression(false); - semicolon(); - } else if ((node = statement(is_default)) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Definitions && is_default) { - unexpected(node.start); - } else if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Definitions - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefClass - ) { - exported_definition = node; - } else if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ClassExpression - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function - ) { - exported_value = node; - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SimpleStatement) { - exported_value = node.body; - } else { - unexpected(node.start); - } - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export({ - start: start, - is_default: is_default, - exported_value: exported_value, - exported_definition: exported_definition, - end: prev(), - attributes: null - }); - } - - function as_property_name() { - var tmp = S.token; - switch (tmp.type) { - case "punc": - if (tmp.value === "[") { - next(); - var ex = expression(false); - expect("]"); - return ex; - } else unexpected(tmp); - case "operator": - if (tmp.value === "*") { - next(); - return null; - } - if (!["delete", "in", "instanceof", "new", "typeof", "void"].includes(tmp.value)) { - unexpected(tmp); - } - /* falls through */ - case "name": - case "privatename": - case "string": - case "keyword": - case "atom": - next(); - return tmp.value; - case "num": - case "big_int": - next(); - return "" + tmp.value; - default: - unexpected(tmp); - } - } - - function as_name() { - var tmp = S.token; - if (tmp.type != "name" && tmp.type != "privatename") unexpected(); - next(); - return tmp.value; - } - - function _make_symbol(type) { - var name = S.token.value; - return new (name == "this" ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_This : - name == "super" ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Super : - type)({ - name : String(name), - start : S.token, - end : S.token - }); - } - - function _verify_symbol(sym) { - var name = sym.name; - if (is_in_generator() && name == "yield") { - token_error(sym.start, "Yield cannot be used as identifier inside generators"); - } - if (S.input.has_directive("use strict")) { - if (name == "yield") { - token_error(sym.start, "Unexpected yield identifier inside strict mode"); - } - if (sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDeclaration && (name == "arguments" || name == "eval")) { - token_error(sym.start, "Unexpected " + name + " in strict mode"); - } - } - } - - function as_symbol(type, noerror) { - if (!is("name")) { - if (!noerror) croak("Name expected"); - return null; - } - var sym = _make_symbol(type); - _verify_symbol(sym); - next(); - return sym; - } - - function as_symbol_or_string(type) { - if (!is("name")) { - if (!is("string")) { - croak("Name or string expected"); - } - var tok = S.token; - var ret = new type({ - start : tok, - end : tok, - name : tok.value, - quote : tok.quote - }); - next(); - return ret; - } - var sym = _make_symbol(type); - _verify_symbol(sym); - next(); - return sym; - } - - // Annotate AST_Call, AST_Lambda or AST_New with the special comments - function annotate(node, before_token = node.start) { - var comments = before_token.comments_before; - const comments_outside_parens = outer_comments_before_counts.get(before_token); - var i = comments_outside_parens != null ? comments_outside_parens : comments.length; - while (--i >= 0) { - var comment = comments[i]; - if (/[@#]__/.test(comment.value)) { - if (/[@#]__PURE__/.test(comment.value)) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.set_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_1__._PURE); - break; - } - if (/[@#]__INLINE__/.test(comment.value)) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.set_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_1__._INLINE); - break; - } - if (/[@#]__NOINLINE__/.test(comment.value)) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.set_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_1__._NOINLINE); - break; - } - if (/[@#]__KEY__/.test(comment.value)) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.set_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_1__._KEY); - break; - } - if (/[@#]__MANGLE_PROP__/.test(comment.value)) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.set_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_1__._MANGLEPROP); - break; - } - } - } - return node; - } - - var subscripts = function(expr, allow_calls, is_chain) { - var start = expr.start; - if (is("punc", ".")) { - next(); - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - const AST_DotVariant = is("privatename") ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DotHash : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Dot; - return annotate(subscripts(new AST_DotVariant({ - start : start, - expression : expr, - optional : false, - property : as_name(), - end : prev() - }), allow_calls, is_chain)); - } - if (is("punc", "[")) { - next(); - var prop = expression(true); - expect("]"); - return annotate(subscripts(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sub({ - start : start, - expression : expr, - optional : false, - property : prop, - end : prev() - }), allow_calls, is_chain)); - } - if (allow_calls && is("punc", "(")) { - next(); - var call = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call({ - start : start, - expression : expr, - optional : false, - args : call_args(), - end : prev() - }); - annotate(call); - return subscripts(call, true, is_chain); - } - - // Optional chain - if (is("punc", "?.")) { - next(); - - let chain_contents; - - if (allow_calls && is("punc", "(")) { - next(); - - const call = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call({ - start, - optional: true, - expression: expr, - args: call_args(), - end: prev() - }); - annotate(call); - - chain_contents = subscripts(call, true, true); - } else if (is("name") || is("privatename")) { - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - const AST_DotVariant = is("privatename") ? _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DotHash : _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Dot; - chain_contents = annotate(subscripts(new AST_DotVariant({ - start, - expression: expr, - optional: true, - property: as_name(), - end: prev() - }), allow_calls, true)); - } else if (is("punc", "[")) { - next(); - const property = expression(true); - expect("]"); - chain_contents = annotate(subscripts(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sub({ - start, - expression: expr, - optional: true, - property, - end: prev() - }), allow_calls, true)); - } - - if (!chain_contents) unexpected(); - - if (chain_contents instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Chain) return chain_contents; - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Chain({ - start, - expression: chain_contents, - end: prev() - }); - } - - if (is("template_head")) { - if (is_chain) { - // a?.b`c` is a syntax error - unexpected(); - } - - return subscripts(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrefixedTemplateString({ - start: start, - prefix: expr, - template_string: template_string(), - end: prev() - }), allow_calls); - } - return expr; - }; - - function call_args() { - var args = []; - while (!is("punc", ")")) { - if (is("expand", "...")) { - next(); - args.push(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion({ - start: prev(), - expression: expression(false), - end: prev() - })); - } else { - args.push(expression(false)); - } - if (!is("punc", ")")) { - expect(","); - } - } - next(); - return args; - } - - var maybe_unary = function(allow_calls, allow_arrows) { - var start = S.token; - if (start.type == "name" && start.value == "await" && can_await()) { - next(); - return _await_expression(); - } - if (is("operator") && UNARY_PREFIX.has(start.value)) { - next(); - handle_regexp(); - var ex = make_unary(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPrefix, start, maybe_unary(allow_calls)); - ex.start = start; - ex.end = prev(); - return ex; - } - var val = expr_atom(allow_calls, allow_arrows); - while (is("operator") && UNARY_POSTFIX.has(S.token.value) && !has_newline_before(S.token)) { - if (val instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Arrow) unexpected(); - val = make_unary(_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPostfix, S.token, val); - val.start = start; - val.end = S.token; - next(); - } - return val; - }; - - function make_unary(ctor, token, expr) { - var op = token.value; - switch (op) { - case "++": - case "--": - if (!is_assignable(expr)) - croak("Invalid use of " + op + " operator", token.line, token.col, token.pos); - break; - case "delete": - if (expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef && S.input.has_directive("use strict")) - croak("Calling delete on expression not allowed in strict mode", expr.start.line, expr.start.col, expr.start.pos); - break; - } - return new ctor({ operator: op, expression: expr }); - } - - var expr_op = function(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op == "in" && no_in) op = null; - if (op == "**" && left instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_UnaryPrefix - /* unary token in front not allowed - parenthesis required */ - && !is_token(left.start, "punc", "(") - && left.operator !== "--" && left.operator !== "++") - unexpected(left.start); - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && (prec > min_prec || (op === "**" && min_prec === prec))) { - next(); - var right = expr_ops(no_in, prec, true); - return expr_op(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Binary({ - start : left.start, - left : left, - operator : op, - right : right, - end : right.end - }), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in, min_prec, allow_calls, allow_arrows) { - // maybe_unary won't return us a AST_SymbolPrivateProperty - if (!no_in && min_prec < PRECEDENCE["in"] && is("privatename")) { - if(!S.in_class) { - croak("Private field must be used in an enclosing class"); - } - - const start = S.token; - const key = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolPrivateProperty({ - start, - name: start.value, - end: start - }); - next(); - expect_token("operator", "in"); - - const private_in = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PrivateIn({ - start, - key, - value: expr_ops(no_in, PRECEDENCE["in"], true), - end: prev() - }); - - return expr_op(private_in, 0, no_in); - } else { - return expr_op(maybe_unary(allow_calls, allow_arrows), min_prec, no_in); - } - } - - var maybe_conditional = function(no_in) { - var start = S.token; - var expr = expr_ops(no_in, 0, true, true); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Conditional({ - start : start, - condition : expr, - consequent : yes, - alternative : expression(false, no_in), - end : prev() - }); - } - return expr; - }; - - function is_assignable(expr) { - return expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_PropAccess || expr instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef; - } - - function to_destructuring(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Object) { - node = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: node.start, - names: node.properties.map(to_destructuring), - is_array: false, - end: node.end - }); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Array) { - var names = []; - - for (var i = 0; i < node.elements.length; i++) { - // Only allow expansion as last element - if (node.elements[i] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Expansion) { - if (i + 1 !== node.elements.length) { - token_error(node.elements[i].start, "Spread must the be last element in destructuring array"); - } - node.elements[i].expression = to_destructuring(node.elements[i].expression); - } - - names.push(to_destructuring(node.elements[i])); - } - - node = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring({ - start: node.start, - names: names, - is_array: true, - end: node.end - }); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ObjectProperty) { - node.value = to_destructuring(node.value); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Assign) { - node = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefaultAssign({ - start: node.start, - left: node.left, - operator: "=", - right: node.right, - end: node.end - }); - } - return node; - } - - // In ES6, AssignmentExpression can also be an ArrowFunction - var maybe_assign = function(no_in) { - handle_regexp(); - var start = S.token; - - if (start.type == "name" && start.value == "yield") { - if (is_in_generator()) { - next(); - return _yield_expression(); - } else if (S.input.has_directive("use strict")) { - token_error(S.token, "Unexpected yield identifier inside strict mode"); - } - } - - var left = maybe_conditional(no_in); - var val = S.token.value; - - if (is("operator") && ASSIGNMENT.has(val)) { - if (is_assignable(left) || (left = to_destructuring(left)) instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring) { - next(); - - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Assign({ - start : start, - left : left, - operator : val, - right : maybe_assign(no_in), - logical : LOGICAL_ASSIGNMENT.has(val), - end : prev() - }); - } - croak("Invalid assignment"); - } - return left; - }; - - var to_expr_or_sequence = function(start, exprs) { - if (exprs.length === 1) { - return exprs[0]; - } else if (exprs.length > 1) { - return new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sequence({ start, expressions: exprs, end: peek() }); - } else { - croak("Invalid parenthesized expression"); - } - }; - - var expression = function(commas, no_in) { - var start = S.token; - var exprs = []; - while (true) { - exprs.push(maybe_assign(no_in)); - if (!commas || !is("punc", ",")) break; - next(); - commas = true; - } - return to_expr_or_sequence(start, exprs); - }; - - function in_loop(cont) { - ++S.in_loop; - var ret = cont(); - --S.in_loop; - return ret; - } - - if (options.expression) { - return expression(true); - } - - return (function parse_toplevel() { - var start = S.token; - var body = []; - S.input.push_directives_stack(); - if (options.module) S.input.add_directive("use strict"); - while (!is("eof")) { - body.push(statement()); - } - S.input.pop_directives_stack(); - var end = prev(); - var toplevel = options.toplevel; - if (toplevel) { - toplevel.body = toplevel.body.concat(body); - toplevel.end = end; - } else { - toplevel = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel({ start: start, body: body, end: end }); - } - TEMPLATE_RAWS = new Map(); - return toplevel; - })(); - -} - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/propmangle.js": -/*!***********************************************!*\ - !*** ./node_modules/terser/lib/propmangle.js ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ find_annotated_props: () => (/* binding */ find_annotated_props), -/* harmony export */ mangle_private_properties: () => (/* binding */ mangle_private_properties), -/* harmony export */ mangle_properties: () => (/* binding */ mangle_properties), -/* harmony export */ reserve_quoted_keys: () => (/* binding */ reserve_quoted_keys) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scope.js */ "./node_modules/terser/lib/scope.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _tools_domprops_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tools/domprops.js */ "./node_modules/terser/tools/domprops.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - -/* global global, self */ - - - - - - -function find_builtins(reserved) { - _tools_domprops_js__WEBPACK_IMPORTED_MODULE_3__.domprops.forEach(add); - - // Compatibility fix for some standard defined globals not defined on every js environment - var new_globals = ["Symbol", "Map", "Promise", "Proxy", "Reflect", "Set", "WeakMap", "WeakSet"]; - var objects = {}; - var global_ref = typeof global === "object" ? global : self; - - new_globals.forEach(function (new_global) { - objects[new_global] = global_ref[new_global] || function() {}; - }); - - [ - "null", - "true", - "false", - "NaN", - "Infinity", - "-Infinity", - "undefined", - ].forEach(add); - [ Object, Array, Function, Number, - String, Boolean, Error, Math, - Date, RegExp, objects.Symbol, ArrayBuffer, - DataView, decodeURI, decodeURIComponent, - encodeURI, encodeURIComponent, eval, EvalError, - Float32Array, Float64Array, Int8Array, Int16Array, - Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat, - parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError, - objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array, - Uint8ClampedArray, Uint16Array, Uint32Array, URIError, - objects.WeakMap, objects.WeakSet - ].forEach(function(ctor) { - Object.getOwnPropertyNames(ctor).map(add); - if (ctor.prototype) { - Object.getOwnPropertyNames(ctor.prototype).map(add); - } - }); - function add(name) { - reserved.add(name); - } -} - -function reserve_quoted_keys(ast, reserved) { - function add(name) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.push_uniq)(reserved, name); - } - - ast.walk(new _ast_js__WEBPACK_IMPORTED_MODULE_2__.TreeWalker(function(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectKeyVal && node.quote) { - add(node.key); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectProperty && node.quote) { - add(node.key.name); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sub) { - addStrings(node.property, add); - } - })); -} - -function addStrings(node, add) { - node.walk(new _ast_js__WEBPACK_IMPORTED_MODULE_2__.TreeWalker(function(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence) { - addStrings(node.tail_node(), add); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String) { - add(node.value); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional) { - addStrings(node.consequent, add); - addStrings(node.alternative, add); - } - return true; - })); -} - -function mangle_private_properties(ast, options) { - var cprivate = -1; - var private_cache = new Map(); - var nth_identifier = options.nth_identifier || _scope_js__WEBPACK_IMPORTED_MODULE_1__.base54; - - ast = ast.transform(new _ast_js__WEBPACK_IMPORTED_MODULE_2__.TreeTransformer(function(node) { - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassPrivateProperty - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateMethod - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateGetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateSetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateIn - ) { - node.key.name = mangle_private(node.key.name); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DotHash) { - node.property = mangle_private(node.property); - } - })); - return ast; - - function mangle_private(name) { - let mangled = private_cache.get(name); - if (!mangled) { - mangled = nth_identifier.get(++cprivate); - private_cache.set(name, mangled); - } - - return mangled; - } -} - -function find_annotated_props(ast) { - var annotated_props = new Set(); - (0,_ast_js__WEBPACK_IMPORTED_MODULE_2__.walk)(ast, node => { - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassPrivateProperty - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateMethod - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateGetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateSetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DotHash - ) { - // handled by mangle_private_properties - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectKeyVal) { - if (typeof node.key == "string" && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.has_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._MANGLEPROP)) { - annotated_props.add(node.key); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectProperty) { - // setter or getter, since KeyVal is handled above - if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.has_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._MANGLEPROP)) { - annotated_props.add(node.key.name); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Dot) { - if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.has_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._MANGLEPROP)) { - annotated_props.add(node.property); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sub) { - if (node.property instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.has_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._MANGLEPROP)) { - annotated_props.add(node.property.value); - } - } - }); - return annotated_props; -} - -function mangle_properties(ast, options, annotated_props = find_annotated_props(ast)) { - options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { - builtins: false, - cache: null, - debug: false, - keep_quoted: false, - nth_identifier: _scope_js__WEBPACK_IMPORTED_MODULE_1__.base54, - only_cache: false, - regex: null, - reserved: null, - undeclared: false, - only_annotated: false, - }, true); - - var nth_identifier = options.nth_identifier; - - var reserved_option = options.reserved; - if (!Array.isArray(reserved_option)) reserved_option = [reserved_option]; - var reserved = new Set(reserved_option); - if (!options.builtins) find_builtins(reserved); - - var cname = -1; - - var cache; - if (options.cache) { - cache = options.cache.props; - } else { - cache = new Map(); - } - - var only_annotated = options.only_annotated; - var regex = options.regex && new RegExp(options.regex); - - // note debug is either false (disabled), or a string of the debug suffix to use (enabled). - // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true' - // the same as passing an empty string. - var debug = options.debug !== false; - var debug_name_suffix; - if (debug) { - debug_name_suffix = (options.debug === true ? "" : options.debug); - } - - var names_to_mangle = new Set(); - var unmangleable = new Set(); - // Track each already-mangled name to prevent nth_identifier from generating - // the same name. - cache.forEach((mangled_name) => unmangleable.add(mangled_name)); - - var keep_quoted = !!options.keep_quoted; - - // step 1: find candidates to mangle - ast.walk(new _ast_js__WEBPACK_IMPORTED_MODULE_2__.TreeWalker(function(node) { - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassPrivateProperty - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateMethod - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateGetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateSetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DotHash - ) { - // handled by mangle_private_properties - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectKeyVal) { - if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { - add(node.key); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectProperty) { - // setter or getter, since KeyVal is handled above - if (!keep_quoted || !node.quote) { - add(node.key.name); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Dot) { - var declared = !!options.undeclared; - if (!declared) { - var root = node; - while (root.expression) { - root = root.expression; - } - declared = !(root.thedef && root.thedef.undeclared); - } - if (declared && - (!keep_quoted || !node.quote)) { - add(node.property); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sub) { - if (!keep_quoted) { - addStrings(node.property, add); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - addStrings(node.args[1], add); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && node.operator === "in") { - addStrings(node.left, add); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.has_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._KEY)) { - add(node.value); - } - })); - - // step 2: transform the tree, renaming properties - return ast.transform(new _ast_js__WEBPACK_IMPORTED_MODULE_2__.TreeTransformer(function(node) { - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ClassPrivateProperty - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateMethod - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateGetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_PrivateSetter - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_DotHash - ) { - // handled by mangle_private_properties - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectKeyVal) { - if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { - node.key = mangle(node.key); - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_ObjectProperty) { - // setter, getter, method or class field - if (!keep_quoted || !node.quote) { - if (!node.computed_key()) { - node.key.name = mangle(node.key.name); - } - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Dot) { - if (!keep_quoted || !node.quote) { - node.property = mangle(node.property); - } - } else if (!keep_quoted && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sub) { - node.property = mangleStrings(node.property); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - node.args[1] = mangleStrings(node.args[1]); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Binary && node.operator === "in") { - node.left = mangleStrings(node.left); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.has_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._KEY)) { - // Clear _KEY annotation to prevent double mangling - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.clear_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._KEY); - node.value = mangle(node.value); - } - })); - - // only function declarations after this line - - function can_mangle(name) { - if (unmangleable.has(name)) return false; - if (reserved.has(name)) return false; - if (options.only_cache) { - return cache.has(name); - } - if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false; - return true; - } - - function should_mangle(name) { - if (only_annotated && !annotated_props.has(name)) return false; - if (regex && !regex.test(name)) { - return annotated_props.has(name); - } - if (reserved.has(name)) return false; - return cache.has(name) - || names_to_mangle.has(name); - } - - function add(name) { - if (can_mangle(name)) { - names_to_mangle.add(name); - } - - if (!should_mangle(name)) { - unmangleable.add(name); - } - } - - function mangle(name) { - if (!should_mangle(name)) { - return name; - } - - var mangled = cache.get(name); - if (!mangled) { - if (debug) { - // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo -> o._$foo$NNN_. - var debug_mangled = "_$" + name + "$" + debug_name_suffix + "_"; - - if (can_mangle(debug_mangled)) { - mangled = debug_mangled; - } - } - - // either debug mode is off, or it is on and we could not use the mangled name - if (!mangled) { - do { - mangled = nth_identifier.get(++cname); - } while (!can_mangle(mangled)); - } - - cache.set(name, mangled); - } - return mangled; - } - - function mangleStrings(node) { - return node.transform(new _ast_js__WEBPACK_IMPORTED_MODULE_2__.TreeTransformer(function(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Sequence) { - var last = node.expressions.length - 1; - node.expressions[last] = mangleStrings(node.expressions[last]); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_String) { - // Clear _KEY annotation to prevent double mangling - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.clear_annotation)(node, _ast_js__WEBPACK_IMPORTED_MODULE_2__._KEY); - node.value = mangle(node.value); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_2__.AST_Conditional) { - node.consequent = mangleStrings(node.consequent); - node.alternative = mangleStrings(node.alternative); - } - return node; - })); - } -} - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/scope.js": -/*!******************************************!*\ - !*** ./node_modules/terser/lib/scope.js ***! - \******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SymbolDef: () => (/* binding */ SymbolDef), -/* harmony export */ base54: () => (/* binding */ base54), -/* harmony export */ format_mangler_options: () => (/* binding */ format_mangler_options) -/* harmony export */ }); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parse.js */ "./node_modules/terser/lib/parse.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - - -const MASK_EXPORT_DONT_MANGLE = 1 << 0; -const MASK_EXPORT_WANT_MANGLE = 1 << 1; - -let function_defs = null; -let unmangleable_names = null; -/** - * When defined, there is a function declaration somewhere that's inside of a block. - * See https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-block-level-function-declarations-web-legacy-compatibility-semantics -*/ -let scopes_with_block_defuns = null; - -class SymbolDef { - constructor(scope, orig, init) { - this.name = orig.name; - this.orig = [ orig ]; - this.init = init; - this.eliminated = 0; - this.assignments = 0; - this.scope = scope; - this.replaced = 0; - this.global = false; - this.export = 0; - this.mangled_name = null; - this.undeclared = false; - this.id = SymbolDef.next_id++; - this.chained = false; - this.direct_access = false; - this.escaped = 0; - this.recursive_refs = 0; - this.references = []; - this.should_replace = undefined; - this.single_use = false; - this.fixed = false; - Object.seal(this); - } - fixed_value() { - if (!this.fixed || this.fixed instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node) return this.fixed; - return this.fixed(); - } - unmangleable(options) { - if (!options) options = {}; - - if ( - function_defs && - function_defs.has(this.id) && - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.keep_name)(options.keep_fnames, this.orig[0].name) - ) return true; - - return this.global && !options.toplevel - || (this.export & MASK_EXPORT_DONT_MANGLE) - || this.undeclared - || !options.eval && this.scope.pinned() - || (this.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLambda - || this.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefun) && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.keep_name)(options.keep_fnames, this.orig[0].name) - || this.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolMethod - || (this.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolClass - || this.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefClass) && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.keep_name)(options.keep_classnames, this.orig[0].name); - } - mangle(options) { - const cache = options.cache && options.cache.props; - if (this.global && cache && cache.has(this.name)) { - this.mangled_name = cache.get(this.name); - } else if (!this.mangled_name && !this.unmangleable(options)) { - var s = this.scope; - var sym = this.orig[0]; - if (options.ie8 && sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLambda) - s = s.parent_scope; - const redefinition = redefined_catch_def(this); - this.mangled_name = redefinition - ? redefinition.mangled_name || redefinition.name - : s.next_mangled(options, this); - if (this.global && cache) { - cache.set(this.name, this.mangled_name); - } - } - } -} - -SymbolDef.next_id = 1; - -function redefined_catch_def(def) { - if (def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch - && def.scope.is_block_scope() - ) { - return def.scope.get_defun_scope().variables.get(def.name); - } -} - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("figure_out_scope", function(options, { parent_scope = undefined, toplevel = this } = {}) { - options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { - cache: null, - ie8: false, - safari10: false, - module: false, - }); - - if (!(toplevel instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel)) { - throw new Error("Invalid toplevel scope"); - } - - // pass 1: setup scope chaining and handle definitions - var scope = this.parent_scope = parent_scope; - var labels = new Map(); - var defun = null; - var in_destructuring = null; - var for_scopes = []; - var tw = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.TreeWalker((node, descend) => { - if (node.is_block_scope()) { - const save_scope = scope; - node.block_scope = scope = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope(node); - scope._block_scope = true; - scope.init_scope_vars(save_scope); - scope.uses_with = save_scope.uses_with; - scope.uses_eval = save_scope.uses_eval; - - if (options.safari10) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_For || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForIn || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_ForOf) { - for_scopes.push(scope); - } - } - - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Switch) { - // XXX: HACK! Ensure the switch expression gets the correct scope (the parent scope) and the body gets the contained scope - // AST_Switch has a scope within the body, but it itself "is a block scope" - // This means the switched expression has to belong to the outer scope - // while the body inside belongs to the switch itself. - // This is pretty nasty and warrants an AST change - const the_block_scope = scope; - scope = save_scope; - node.expression.walk(tw); - scope = the_block_scope; - for (let i = 0; i < node.body.length; i++) { - node.body[i].walk(tw); - } - } else { - descend(); - } - scope = save_scope; - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Destructuring) { - const save_destructuring = in_destructuring; - in_destructuring = node; - descend(); - in_destructuring = save_destructuring; - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope) { - node.init_scope_vars(scope); - var save_scope = scope; - var save_defun = defun; - var save_labels = labels; - defun = scope = node; - labels = new Map(); - descend(); - scope = save_scope; - defun = save_defun; - labels = save_labels; - return true; // don't descend again in TreeWalker - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabeledStatement) { - var l = node.label; - if (labels.has(l.name)) { - throw new Error((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.string_template)("Label {name} defined twice", l)); - } - labels.set(l.name, l); - descend(); - labels.delete(l.name); - return true; // no descend again - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_With) { - for (var s = scope; s; s = s.parent_scope) - s.uses_with = true; - return; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol) { - node.scope = scope; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Label) { - node.thedef = node; - node.references = []; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLambda) { - defun.def_function(node, node.name == "arguments" ? undefined : defun); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefun) { - // Careful here, the scope where this should be defined is - // the parent scope. The reason is that we enter a new - // scope when we encounter the AST_Defun node (which is - // instanceof AST_Scope) but we get to the symbol a bit - // later. - const closest_scope = defun.parent_scope; - - // In strict mode, function definitions are block-scoped - node.scope = tw.directives["use strict"] - ? closest_scope - : closest_scope.get_defun_scope(); - - mark_export(node.scope.def_function(node, defun), 1); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolClass) { - mark_export(defun.def_variable(node, defun), 1); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolImport) { - scope.def_variable(node); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolDefClass) { - // This deals with the name of the class being available - // inside the class. - mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1); - } else if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolVar - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLet - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolConst - || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch - ) { - var def; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolBlockDeclaration) { - def = scope.def_variable(node, null); - } else { - def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : undefined); - } - if (!def.orig.every((sym) => { - if (sym === node) return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolBlockDeclaration) { - return sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLambda; - } - return !(sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolLet || sym instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolConst); - })) { - (0,_parse_js__WEBPACK_IMPORTED_MODULE_2__.js_error)( - `"${node.name}" is redeclared`, - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - if (!(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg)) mark_export(def, 2); - if (defun !== scope) { - node.mark_enclosed(); - var def = scope.find_variable(node); - if (node.thedef !== def) { - node.thedef = def; - node.reference(); - } - } - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabelRef) { - var sym = labels.get(node.name); - if (!sym) throw new Error((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.string_template)("Undefined label {name} [{line},{col}]", { - name: node.name, - line: node.start.line, - col: node.start.col - })); - node.thedef = sym; - } - if (!(scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel) && (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Import)) { - (0,_parse_js__WEBPACK_IMPORTED_MODULE_2__.js_error)( - `"${node.TYPE}" statement may only appear at the top level`, - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - }); - - if (options.module) { - tw.directives["use strict"] = true; - } - - this.walk(tw); - - function mark_export(def, level) { - if (in_destructuring) { - var i = 0; - do { - level++; - } while (tw.parent(i++) !== in_destructuring); - } - var node = tw.parent(level); - if (def.export = node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Export ? MASK_EXPORT_DONT_MANGLE : 0) { - var exported = node.exported_definition; - if ((exported instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun || exported instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DefClass) && node.is_default) { - def.export = MASK_EXPORT_WANT_MANGLE; - } - } - } - - // pass 2: find back references and eval - const is_toplevel = this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel; - if (is_toplevel) { - this.globals = new Map(); - } - - var tw = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.TreeWalker(node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LoopControl && node.label) { - node.label.thedef.references.push(node); - return true; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef) { - var name = node.name; - if (name == "eval" && tw.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Call) { - for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) { - s.uses_eval = true; - } - } - var sym; - if (tw.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_NameMapping && tw.parent(1).module_name - || !(sym = node.scope.find_variable(name))) { - - sym = toplevel.def_global(node); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE; - } else if (sym.scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda && name == "arguments") { - sym.scope.get_defun_scope().uses_arguments = true; - } - node.thedef = sym; - node.reference(); - if (node.scope.is_block_scope() - && !(sym.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolBlockDeclaration)) { - node.scope = node.scope.get_defun_scope(); - } - return true; - } - // ensure mangling works if catch reuses a scope variable - var def; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch && (def = redefined_catch_def(node.definition()))) { - var s = node.scope; - while (s) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.push_uniq)(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } - } - }); - this.walk(tw); - - // pass 3: work around IE8 and Safari catch scope bugs - if (options.ie8 || options.safari10) { - (0,_ast_js__WEBPACK_IMPORTED_MODULE_1__.walk)(this, node => { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch) { - var name = node.name; - var refs = node.thedef.references; - var scope = node.scope.get_defun_scope(); - var def = scope.find_variable(name) - || toplevel.globals.get(name) - || scope.def_variable(node); - refs.forEach(function(ref) { - ref.thedef = def; - ref.reference(); - }); - node.thedef = def; - node.reference(); - return true; - } - }); - } - - // pass 4: add symbol definitions to loop scopes - // Safari/Webkit bug workaround - loop init let variable shadowing argument. - // https://github.com/mishoo/UglifyJS2/issues/1753 - // https://bugs.webkit.org/show_bug.cgi?id=171041 - if (options.safari10) { - for (const scope of for_scopes) { - scope.parent_scope.variables.forEach(function(def) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.push_uniq)(scope.enclosed, def); - }); - } - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel.DEFMETHOD("def_global", function(node) { - var globals = this.globals, name = node.name; - if (globals.has(name)) { - return globals.get(name); - } else { - var g = new SymbolDef(this, node); - g.undeclared = true; - g.global = true; - globals.set(name, g); - return g; - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope) { - this.variables = new Map(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) - this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement - this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` - this.parent_scope = parent_scope; // the parent scope - this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes - this.cname = -1; // the current index for mangling functions/variables -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("conflicting_def", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - || (this.parent_scope && this.parent_scope.conflicting_def(name)) - ); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("conflicting_def_shallow", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - ); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("add_child_scope", function (scope) { - // `scope` is going to be moved into `this` right now. - // Update the required scopes' information - - if (scope.parent_scope === this) return; - - scope.parent_scope = this; - - // Propagate to this.uses_arguments from arrow functions - if ((scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Arrow) && (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda && !this.uses_arguments)) { - this.uses_arguments = (0,_ast_js__WEBPACK_IMPORTED_MODULE_1__.walk)(scope, node => { - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolRef - && node.scope instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda - && node.name === "arguments" - ) { - return _ast_js__WEBPACK_IMPORTED_MODULE_1__.walk_abort; - } - - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda && !(node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Arrow)) { - return true; - } - }); - } - - this.uses_with = this.uses_with || scope.uses_with; - this.uses_eval = this.uses_eval || scope.uses_eval; - - const scope_ancestry = (() => { - const ancestry = []; - let cur = this; - do { - ancestry.push(cur); - } while ((cur = cur.parent_scope)); - ancestry.reverse(); - return ancestry; - })(); - - const new_scope_enclosed_set = new Set(scope.enclosed); - const to_enclose = []; - for (const scope_topdown of scope_ancestry) { - to_enclose.forEach(e => (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.push_uniq)(scope_topdown.enclosed, e)); - for (const def of scope_topdown.variables.values()) { - if (new_scope_enclosed_set.has(def)) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.push_uniq)(to_enclose, def); - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.push_uniq)(scope_topdown.enclosed, def); - } - } - } -}); - -function find_scopes_visible_from(scopes) { - const found_scopes = new Set(); - - for (const scope of new Set(scopes)) { - (function bubble_up(scope) { - if (scope == null || found_scopes.has(scope)) return; - - found_scopes.add(scope); - - bubble_up(scope.parent_scope); - })(scope); - } - - return [...found_scopes]; -} - -// Creates a symbol during compression -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { - source, - tentative_name, - scope, - conflict_scopes = [scope], - init = null -} = {}) { - let symbol_name; - - conflict_scopes = find_scopes_visible_from(conflict_scopes); - - if (tentative_name) { - // Implement hygiene (no new names are conflicting with existing names) - tentative_name = - symbol_name = - tentative_name.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/ig, "_"); - - let i = 0; - while (conflict_scopes.find(s => s.conflicting_def_shallow(symbol_name))) { - symbol_name = tentative_name + "$" + i++; - } - } - - if (!symbol_name) { - throw new Error("No symbol name could be generated in create_symbol()"); - } - - const symbol = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.make_node)(SymClass, source, { - name: symbol_name, - scope - }); - - this.def_variable(symbol, init || null); - - symbol.mark_enclosed(); - - return symbol; -}); - - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.DEFMETHOD("is_block_scope", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Class.DEFMETHOD("is_block_scope", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda.DEFMETHOD("is_block_scope", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel.DEFMETHOD("is_block_scope", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SwitchBranch.DEFMETHOD("is_block_scope", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Block.DEFMETHOD("is_block_scope", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_true); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("is_block_scope", function () { - return this._block_scope || false; -}); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_IterationStatement.DEFMETHOD("is_block_scope", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_true); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda.DEFMETHOD("init_scope_vars", function() { - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; - this.def_variable(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg({ - name: "arguments", - start: this.start, - end: this.end - })); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Arrow.DEFMETHOD("init_scope_vars", function() { - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol.DEFMETHOD("mark_enclosed", function() { - var def = this.definition(); - var s = this.scope; - while (s) { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.push_uniq)(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol.DEFMETHOD("reference", function() { - this.definition().references.push(this); - this.mark_enclosed(); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("find_variable", function(name) { - if (name instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol) name = name.name; - return this.variables.get(name) - || (this.parent_scope && this.parent_scope.find_variable(name)); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("def_function", function(symbol, init) { - var def = this.def_variable(symbol, init); - if (!def.init || def.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun) def.init = init; - return def; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("def_variable", function(symbol, init) { - var def = this.variables.get(symbol.name); - if (def) { - def.orig.push(symbol); - if (def.init && (def.scope !== symbol.scope || def.init instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function)) { - def.init = init; - } - } else { - def = new SymbolDef(this, symbol, init); - this.variables.set(symbol.name, def); - def.global = !this.parent_scope; - } - return symbol.thedef = def; -}); - -function next_mangled(scope, options) { - let defun_scope; - if ( - scopes_with_block_defuns - && (defun_scope = scope.get_defun_scope()) - && scopes_with_block_defuns.has(defun_scope) - ) { - scope = defun_scope; - } - - var ext = scope.enclosed; - var nth_identifier = options.nth_identifier; - out: while (true) { - var m = nth_identifier.get(++scope.cname); - if (_parse_js__WEBPACK_IMPORTED_MODULE_2__.ALL_RESERVED_WORDS.has(m)) continue; // skip over "do" - - // https://github.com/mishoo/UglifyJS2/issues/242 -- do not - // shadow a name reserved from mangling. - if (options.reserved.has(m)) continue; - - // Functions with short names might collide with base54 output - // and therefore cause collisions when keep_fnames is true. - if (unmangleable_names && unmangleable_names.has(m)) continue out; - - // we must ensure that the mangled name does not shadow a name - // from some parent scope that is referenced in this or in - // inner scopes. - for (let i = ext.length; --i >= 0;) { - const def = ext[i]; - const name = def.mangled_name || (def.unmangleable(options) && def.name); - if (m == name) continue out; - } - return m; - } -} - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope.DEFMETHOD("next_mangled", function(options) { - return next_mangled(this, options); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel.DEFMETHOD("next_mangled", function(options) { - let name; - const mangled_names = this.mangled_names; - do { - name = next_mangled(this, options); - } while (mangled_names.has(name)); - return name; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Function.DEFMETHOD("next_mangled", function(options, def) { - // #179, #326 - // in Safari strict mode, something like (function x(x){...}) is a syntax error; - // a function expression's argument cannot shadow the function expression's name - - var tricky_def = def.orig[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolFunarg && this.name && this.name.definition(); - - // the function's mangled_name is null when keep_fnames is true - var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null; - - while (true) { - var name = next_mangled(this, options); - if (!tricky_name || tricky_name != name) - return name; - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol.DEFMETHOD("unmangleable", function(options) { - var def = this.definition(); - return !def || def.unmangleable(options); -}); - -// labels are always mangleable -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Label.DEFMETHOD("unmangleable", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_false); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol.DEFMETHOD("unreferenced", function() { - return !this.definition().references.length && !this.scope.pinned(); -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol.DEFMETHOD("definition", function() { - return this.thedef; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol.DEFMETHOD("global", function() { - return this.thedef.global; -}); - -/** - * Format the mangler options (if any) into their appropriate types - */ -function format_mangler_options(options) { - options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { - eval : false, - nth_identifier : base54, - ie8 : false, - keep_classnames: false, - keep_fnames : false, - module : false, - reserved : [], - toplevel : false, - }); - if (options.module) options.toplevel = true; - if (!Array.isArray(options.reserved) - && !(options.reserved instanceof Set) - ) { - options.reserved = []; - } - options.reserved = new Set(options.reserved); - // Never mangle arguments - options.reserved.add("arguments"); - return options; -} - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel.DEFMETHOD("mangle_names", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - - // We only need to mangle declaration nodes. Special logic wired - // into the code generator will display the mangled name if it's - // present (and for AST_SymbolRef-s it'll use the mangled name of - // the AST_SymbolDeclaration that it points to). - var lname = -1; - var to_mangle = []; - - if (options.keep_fnames) { - function_defs = new Set(); - } - - const mangled_names = this.mangled_names = new Set(); - unmangleable_names = new Set(); - - if (options.cache) { - this.globals.forEach(collect); - if (options.cache.props) { - options.cache.props.forEach(function(mangled_name) { - mangled_names.add(mangled_name); - }); - } - } - - var tw = new _ast_js__WEBPACK_IMPORTED_MODULE_1__.TreeWalker(function(node, descend) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_LabeledStatement) { - // lname is incremented when we get to the AST_Label - var save_nesting = lname; - descend(); - lname = save_nesting; - return true; // don't descend again in TreeWalker - } - if ( - node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Defun - && !(tw.parent() instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope) - ) { - scopes_with_block_defuns = scopes_with_block_defuns || new Set(); - scopes_with_block_defuns.add(node.parent_scope.get_defun_scope()); - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope) { - node.variables.forEach(collect); - return; - } - if (node.is_block_scope()) { - node.block_scope.variables.forEach(collect); - return; - } - if ( - function_defs - && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_VarDef - && node.value instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Lambda - && !node.value.name - && (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.keep_name)(options.keep_fnames, node.name.name) - ) { - function_defs.add(node.name.definition().id); - return; - } - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Label) { - let name; - do { - name = nth_identifier.get(++lname); - } while (_parse_js__WEBPACK_IMPORTED_MODULE_2__.ALL_RESERVED_WORDS.has(name)); - node.mangled_name = name; - return true; - } - if (!(options.ie8 || options.safari10) && node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch) { - to_mangle.push(node.definition()); - return; - } - }); - - this.walk(tw); - - if (options.keep_fnames || options.keep_classnames) { - // Collect a set of short names which are unmangleable, - // for use in avoiding collisions in next_mangled. - to_mangle.forEach(def => { - if (def.name.length < 6 && def.unmangleable(options)) { - unmangleable_names.add(def.name); - } - }); - } - - to_mangle.forEach(def => { def.mangle(options); }); - - function_defs = null; - unmangleable_names = null; - scopes_with_block_defuns = null; - - function collect(symbol) { - if (symbol.export & MASK_EXPORT_DONT_MANGLE) { - unmangleable_names.add(symbol.name); - } else if (!options.reserved.has(symbol.name)) { - to_mangle.push(symbol); - } - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { - const cache = options.cache && options.cache.props; - const avoid = new Set(); - options.reserved.forEach(to_avoid); - this.globals.forEach(add_def); - this.walk(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.TreeWalker(function(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope) node.variables.forEach(add_def); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch) add_def(node.definition()); - })); - return avoid; - - function to_avoid(name) { - avoid.add(name); - } - - function add_def(def) { - var name = def.name; - if (def.global && cache && cache.has(name)) name = cache.get(name); - else if (!def.unmangleable(options)) return; - to_avoid(name); - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel.DEFMETHOD("expand_names", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - if (nth_identifier.reset && nth_identifier.sort) { - nth_identifier.reset(); - nth_identifier.sort(); - } - var avoid = this.find_colliding_names(options); - var cname = 0; - this.globals.forEach(rename); - this.walk(new _ast_js__WEBPACK_IMPORTED_MODULE_1__.TreeWalker(function(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Scope) node.variables.forEach(rename); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_SymbolCatch) rename(node.definition()); - })); - - function next_name() { - var name; - do { - name = nth_identifier.get(cname++); - } while (avoid.has(name) || _parse_js__WEBPACK_IMPORTED_MODULE_2__.ALL_RESERVED_WORDS.has(name)); - return name; - } - - function rename(def) { - if (def.global && options.cache) return; - if (def.unmangleable(options)) return; - if (options.reserved.has(def.name)) return; - const redefinition = redefined_catch_def(def); - const name = def.name = redefinition ? redefinition.name : next_name(); - def.orig.forEach(function(sym) { - sym.name = name; - }); - def.references.forEach(function(sym) { - sym.name = name; - }); - } -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.DEFMETHOD("tail_node", _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.return_this); -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sequence.DEFMETHOD("tail_node", function() { - return this.expressions[this.expressions.length - 1]; -}); - -_ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - if (!nth_identifier.reset || !nth_identifier.consider || !nth_identifier.sort) { - // If the identifier mangler is invariant, skip computing character frequency. - return; - } - nth_identifier.reset(); - - try { - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.prototype.print = function(stream, force_parens) { - this._print(stream, force_parens); - if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Symbol && !this.unmangleable(options)) { - nth_identifier.consider(this.name, -1); - } else if (options.properties) { - if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_DotHash) { - nth_identifier.consider("#" + this.property, -1); - } else if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Dot) { - nth_identifier.consider(this.property, -1); - } else if (this instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sub) { - skip_string(this.property); - } - } - }; - nth_identifier.consider(this.print_to_string(), 1); - } finally { - _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.prototype.print = _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Node.prototype._print; - } - nth_identifier.sort(); - - function skip_string(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_String) { - nth_identifier.consider(node.value, -1); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Conditional) { - skip_string(node.consequent); - skip_string(node.alternative); - } else if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_1__.AST_Sequence) { - skip_string(node.tail_node()); - } - } -}); - -const base54 = (() => { - const leading = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""); - const digits = "0123456789".split(""); - let chars; - let frequency; - function reset() { - frequency = new Map(); - leading.forEach(function(ch) { - frequency.set(ch, 0); - }); - digits.forEach(function(ch) { - frequency.set(ch, 0); - }); - } - function consider(str, delta) { - for (var i = str.length; --i >= 0;) { - frequency.set(str[i], frequency.get(str[i]) + delta); - } - } - function compare(a, b) { - return frequency.get(b) - frequency.get(a); - } - function sort() { - chars = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.mergeSort)(leading, compare).concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.mergeSort)(digits, compare)); - } - // Ensure this is in a usable initial state. - reset(); - sort(); - function base54(num) { - var ret = "", base = 54; - num++; - do { - num--; - ret += chars[num % base]; - num = Math.floor(num / base); - base = 64; - } while (num > 0); - return ret; - } - - return { - get: base54, - consider, - reset, - sort - }; -})(); - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/size.js": -/*!*****************************************!*\ - !*** ./node_modules/terser/lib/size.js ***! - \*****************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/first_in_statement.js */ "./node_modules/terser/lib/utils/first_in_statement.js"); - - - -let mangle_options = undefined; -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.prototype.size = function (compressor, stack) { - mangle_options = compressor && compressor._mangle_options; - - let size = 0; - (0,_ast_js__WEBPACK_IMPORTED_MODULE_0__.walk_parent)(this, (node, info) => { - size += node._size(info); - - // Braceless arrow functions have fake "return" statements - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow && node.is_braceless()) { - size += node.body[0].value._size(info); - return true; - } - }, stack || (compressor && compressor.stack)); - - // just to save a bit of memory - mangle_options = undefined; - - return size; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node.prototype._size = () => 0; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Debugger.prototype._size = () => 8; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Directive.prototype._size = function () { - // TODO string encoding stuff - return 2 + this.value.length; -}; - -/** Count commas/semicolons necessary to show a list of expressions/statements */ -const list_overhead = (array) => array.length && array.length - 1; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block.prototype._size = function () { - return 2 + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Toplevel.prototype._size = function() { - return list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_EmptyStatement.prototype._size = () => 1; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement.prototype._size = () => 2; // x: - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Do.prototype._size = () => 9; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_While.prototype._size = () => 7; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For.prototype._size = () => 8; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn.prototype._size = () => 8; -// AST_ForOf inherits ^ - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With.prototype._size = () => 6; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion.prototype._size = () => 3; - -const lambda_modifiers = func => - (func.is_generator ? 1 : 0) + (func.async ? 6 : 0); - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Accessor.prototype._size = function () { - return lambda_modifiers(this) + 4 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Function.prototype._size = function (info) { - const first = !!(0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__.first_in_statement)(info); - return (first * 2) + lambda_modifiers(this) + 12 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Defun.prototype._size = function () { - return lambda_modifiers(this) + 13 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Arrow.prototype._size = function () { - let args_and_arrow = 2 + list_overhead(this.argnames); - - if ( - !( - this.argnames.length === 1 - && this.argnames[0] instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol - ) - ) { - args_and_arrow += 2; // parens around the args - } - - const body_overhead = this.is_braceless() ? 0 : list_overhead(this.body) + 2; - - return lambda_modifiers(this) + args_and_arrow + body_overhead; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring.prototype._size = () => 2; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString.prototype._size = function () { - return 2 + (Math.floor(this.segments.length / 2) * 3); /* "${}" */ -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateSegment.prototype._size = function () { - return this.value.length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Return.prototype._size = function () { - return this.value ? 7 : 6; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Throw.prototype._size = () => 6; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Break.prototype._size = function () { - return this.label ? 6 : 5; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Continue.prototype._size = function () { - return this.label ? 9 : 8; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If.prototype._size = () => 4; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch.prototype._size = function () { - return 8 + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case.prototype._size = function () { - return 5 + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Default.prototype._size = function () { - return 8 + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try.prototype._size = () => 3; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Catch.prototype._size = function () { - let size = 7 + list_overhead(this.body); - if (this.argname) { - size += 2; - } - return size; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Finally.prototype._size = function () { - return 7 + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Var.prototype._size = function () { - return 4 + list_overhead(this.definitions); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Let.prototype._size = function () { - return 4 + list_overhead(this.definitions); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Const.prototype._size = function () { - return 6 + list_overhead(this.definitions); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef.prototype._size = function () { - return this.value ? 1 : 0; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NameMapping.prototype._size = function () { - // foreign name isn't mangled - return this.name ? 4 : 0; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Import.prototype._size = function () { - // import - let size = 6; - - if (this.imported_name) size += 1; - - // from - if (this.imported_name || this.imported_names) size += 5; - - // braces, and the commas - if (this.imported_names) { - size += 2 + list_overhead(this.imported_names); - } - - return size; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ImportMeta.prototype._size = () => 11; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export.prototype._size = function () { - let size = 7 + (this.is_default ? 8 : 0); - - if (this.exported_value) { - size += this.exported_value._size(); - } - - if (this.exported_names) { - // Braces and commas - size += 2 + list_overhead(this.exported_names); - } - - if (this.module_name) { - // "from " - size += 5; - } - - return size; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call.prototype._size = function () { - if (this.optional) { - return 4 + list_overhead(this.args); - } - return 2 + list_overhead(this.args); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_New.prototype._size = function () { - return 6 + list_overhead(this.args); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence.prototype._size = function () { - return list_overhead(this.expressions); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot.prototype._size = function () { - if (this.optional) { - return this.property.length + 2; - } - return this.property.length + 1; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_DotHash.prototype._size = function () { - if (this.optional) { - return this.property.length + 3; - } - return this.property.length + 2; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub.prototype._size = function () { - return this.optional ? 4 : 2; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary.prototype._size = function () { - if (this.operator === "typeof") return 7; - if (this.operator === "void") return 5; - return this.operator.length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary.prototype._size = function (info) { - if (this.operator === "in") return 4; - - let size = this.operator.length; - - if ( - (this.operator === "+" || this.operator === "-") - && this.right instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary && this.right.operator === this.operator - ) { - // 1+ +a > needs space between the + - size += 1; - } - - if (this.needs_parens(info)) { - size += 2; - } - - return size; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional.prototype._size = () => 3; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array.prototype._size = function () { - return 2 + list_overhead(this.elements); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object.prototype._size = function (info) { - let base = 2; - if ((0,_utils_first_in_statement_js__WEBPACK_IMPORTED_MODULE_1__.first_in_statement)(info)) { - base += 2; // parens - } - return base + list_overhead(this.properties); -}; - -/*#__INLINE__*/ -const key_size = key => - typeof key === "string" ? key.length : 0; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectKeyVal.prototype._size = function () { - return key_size(this.key) + 1; -}; - -/*#__INLINE__*/ -const static_size = is_static => is_static ? 7 : 0; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectGetter.prototype._size = function () { - return 5 + static_size(this.static) + key_size(this.key); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectSetter.prototype._size = function () { - return 5 + static_size(this.static) + key_size(this.key); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod.prototype._size = function () { - return static_size(this.static) + key_size(this.key); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateMethod.prototype._size = function () { - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod.prototype._size.call(this) + 1; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateGetter.prototype._size = function () { - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod.prototype._size.call(this) + 4; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateSetter.prototype._size = function () { - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ConciseMethod.prototype._size.call(this) + 4; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateIn.prototype._size = function () { - return 5; // "#", and " in " -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class.prototype._size = function () { - return ( - (this.name ? 8 : 7) - + (this.extends ? 8 : 0) - ); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock.prototype._size = function () { - // "static{}" + semicolons - return 8 + list_overhead(this.body); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassProperty.prototype._size = function () { - return ( - static_size(this.static) - + (typeof this.key === "string" ? this.key.length + 2 : 0) - + (this.value ? 1 : 0) - ); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassPrivateProperty.prototype._size = function () { - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassProperty.prototype._size.call(this) + 1; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol.prototype._size = function () { - if (!(mangle_options && this.thedef && !this.thedef.unmangleable(mangle_options))) { - return this.name.length; - } else { - return 1; - } -}; - -// TODO take propmangle into account -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolClassProperty.prototype._size = function () { - return this.name.length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolRef.prototype._size = _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolDeclaration.prototype._size = function () { - if (this.name === "arguments") return 9; - - return _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Symbol.prototype._size.call(this); -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NewTarget.prototype._size = () => 10; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolImportForeign.prototype._size = function () { - return this.name.length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SymbolExportForeign.prototype._size = function () { - return this.name.length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_This.prototype._size = () => 4; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Super.prototype._size = () => 5; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_String.prototype._size = function () { - return this.value.length + 2; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number.prototype._size = function () { - const { value } = this; - if (value === 0) return 1; - if (value > 0 && Math.floor(value) === value) { - return Math.floor(Math.log10(value) + 1); - } - return value.toString().length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_BigInt.prototype._size = function () { - return this.value.length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_RegExp.prototype._size = function () { - return this.value.toString().length; -}; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Null.prototype._size = () => 4; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NaN.prototype._size = () => 3; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Undefined.prototype._size = () => 6; // "void 0" - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Hole.prototype._size = () => 0; // comma is taken into account by list_overhead() - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Infinity.prototype._size = () => 8; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_True.prototype._size = () => 4; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_False.prototype._size = () => 5; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Await.prototype._size = () => 6; - -_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Yield.prototype._size = () => 6; - - -/***/ }), - -/***/ "./node_modules/terser/lib/sourcemap.js": -/*!**********************************************!*\ - !*** ./node_modules/terser/lib/sourcemap.js ***! - \**********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SourceMap: () => (/* binding */ SourceMap) -/* harmony export */ }); -/* harmony import */ var _jridgewell_source_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jridgewell/source-map */ "./node_modules/@jridgewell/source-map/dist/source-map.mjs"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - -// a small wrapper around source-map and @jridgewell/source-map -function* SourceMap(options) { - options = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.defaults)(options, { - file : null, - root : null, - orig : null, - files: {}, - }); - - var orig_map; - var generator = new _jridgewell_source_map__WEBPACK_IMPORTED_MODULE_0__.SourceMapGenerator({ - file : options.file, - sourceRoot : options.root - }); - - let sourcesContent = {__proto__: null}; - let files = options.files; - for (var name in files) if ((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.HOP)(files, name)) { - sourcesContent[name] = files[name]; - } - if (options.orig) { - // We support both @jridgewell/source-map (which has a sync - // SourceMapConsumer) and source-map (which has an async - // SourceMapConsumer). - orig_map = yield new _jridgewell_source_map__WEBPACK_IMPORTED_MODULE_0__.SourceMapConsumer(options.orig); - if (orig_map.sourcesContent) { - orig_map.sources.forEach(function(source, i) { - var content = orig_map.sourcesContent[i]; - if (content) { - sourcesContent[source] = content; - } - }); - } - } - - function add(source, gen_line, gen_col, orig_line, orig_col, name) { - let generatedPos = { line: gen_line, column: gen_col }; - - if (orig_map) { - var info = orig_map.originalPositionFor({ - line: orig_line, - column: orig_col - }); - if (info.source === null) { - generator.addMapping({ - generated: generatedPos, - original: null, - source: null, - name: null - }); - return; - } - source = info.source; - orig_line = info.line; - orig_col = info.column; - name = info.name || name; - } - generator.addMapping({ - generated : generatedPos, - original : { line: orig_line, column: orig_col }, - source : source, - name : name - }); - generator.setSourceContent(source, sourcesContent[source]); - } - - function clean(map) { - const allNull = map.sourcesContent && map.sourcesContent.every(c => c == null); - if (allNull) delete map.sourcesContent; - if (map.file === undefined) delete map.file; - if (map.sourceRoot === undefined) delete map.sourceRoot; - return map; - } - - function getDecoded() { - if (!generator.toDecodedMap) return null; - return clean(generator.toDecodedMap()); - } - - function getEncoded() { - return clean(generator.toJSON()); - } - - function destroy() { - // @jridgewell/source-map's SourceMapConsumer does not need to be - // manually freed. - if (orig_map && orig_map.destroy) orig_map.destroy(); - } - - return { - add, - getDecoded, - getEncoded, - destroy, - }; -} - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/transform.js": -/*!**********************************************!*\ - !*** ./node_modules/terser/lib/transform.js ***! - \**********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast.js */ "./node_modules/terser/lib/ast.js"); -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/index.js */ "./node_modules/terser/lib/utils/index.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - - -function def_transform(node, descend) { - node.DEFMETHOD("transform", function(tw, in_list) { - let transformed = undefined; - tw.push(this); - if (tw.before) transformed = tw.before(this, descend, in_list); - if (transformed === undefined) { - transformed = this; - descend(transformed, tw); - if (tw.after) { - const after_ret = tw.after(transformed, in_list); - if (after_ret !== undefined) transformed = after_ret; - } - } - tw.pop(); - return transformed; - }); -} - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node, _utils_index_js__WEBPACK_IMPORTED_MODULE_1__.noop); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LabeledStatement, function(self, tw) { - self.label = self.label.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_SimpleStatement, function(self, tw) { - self.body = self.body.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Block, function(self, tw) { - self.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.body, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Do, function(self, tw) { - self.body = self.body.transform(tw); - self.condition = self.condition.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_While, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_For, function(self, tw) { - if (self.init) self.init = self.init.transform(tw); - if (self.condition) self.condition = self.condition.transform(tw); - if (self.step) self.step = self.step.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ForIn, function(self, tw) { - self.init = self.init.transform(tw); - self.object = self.object.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_With, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Exit, function(self, tw) { - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_LoopControl, function(self, tw) { - if (self.label) self.label = self.label.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_If, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - if (self.alternative) self.alternative = self.alternative.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Switch, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.body, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Case, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.body, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Try, function(self, tw) { - self.body = self.body.transform(tw); - if (self.bcatch) self.bcatch = self.bcatch.transform(tw); - if (self.bfinally) self.bfinally = self.bfinally.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Catch, function(self, tw) { - if (self.argname) self.argname = self.argname.transform(tw); - self.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.body, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Definitions, function(self, tw) { - self.definitions = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.definitions, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_VarDef, function(self, tw) { - self.name = self.name.transform(tw); - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Destructuring, function(self, tw) { - self.names = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.names, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Lambda, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - self.argnames = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.argnames, tw, /* allow_splicing */ false); - if (self.body instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - self.body = self.body.transform(tw); - } else { - self.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.body, tw); - } -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Call, function(self, tw) { - self.expression = self.expression.transform(tw); - self.args = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.args, tw, /* allow_splicing */ false); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence, function(self, tw) { - const result = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.expressions, tw); - self.expressions = result.length - ? result - : [new _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Number({ value: 0 })]; -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PropAccess, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub, function(self, tw) { - self.expression = self.expression.transform(tw); - self.property = self.property.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Yield, function(self, tw) { - if (self.expression) self.expression = self.expression.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Await, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Unary, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary, function(self, tw) { - self.left = self.left.transform(tw); - self.right = self.right.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrivateIn, function(self, tw) { - self.key = self.key.transform(tw); - self.value = self.value.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional, function(self, tw) { - self.condition = self.condition.transform(tw); - self.consequent = self.consequent.transform(tw); - self.alternative = self.alternative.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Array, function(self, tw) { - self.elements = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.elements, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object, function(self, tw) { - self.properties = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.properties, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ObjectProperty, function(self, tw) { - if (self.key instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - self.key = self.key.transform(tw); - } - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Class, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - if (self.extends) self.extends = self.extends.transform(tw); - self.properties = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.properties, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_ClassStaticBlock, function(self, tw) { - self.body = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.body, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Expansion, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_NameMapping, function(self, tw) { - self.foreign_name = self.foreign_name.transform(tw); - self.name = self.name.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Import, function(self, tw) { - if (self.imported_name) self.imported_name = self.imported_name.transform(tw); - if (self.imported_names) (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.imported_names, tw); - self.module_name = self.module_name.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Export, function(self, tw) { - if (self.exported_definition) self.exported_definition = self.exported_definition.transform(tw); - if (self.exported_value) self.exported_value = self.exported_value.transform(tw); - if (self.exported_names) (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.exported_names, tw); - if (self.module_name) self.module_name = self.module_name.transform(tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_TemplateString, function(self, tw) { - self.segments = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.MAP)(self.segments, tw); -}); - -def_transform(_ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrefixedTemplateString, function(self, tw) { - self.prefix = self.prefix.transform(tw); - self.template_string = self.template_string.transform(tw); -}); - - - -/***/ }), - -/***/ "./node_modules/terser/lib/utils/first_in_statement.js": -/*!*************************************************************!*\ - !*** ./node_modules/terser/lib/utils/first_in_statement.js ***! - \*************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ first_in_statement: () => (/* binding */ first_in_statement), -/* harmony export */ left_is_object: () => (/* binding */ left_is_object) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); - - -// return true if the node at the top of the stack (that means the -// innermost node in the current output) is lexically the first in -// a statement. -function first_in_statement(stack) { - let node = stack.parent(-1); - for (let i = 0, p; p = stack.parent(i); i++) { - if (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Statement && p.body === node) - return true; - if ((p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence && p.expressions[0] === node) || - (p.TYPE === "Call" && p.expression === node) || - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrefixedTemplateString && p.prefix === node) || - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot && p.expression === node) || - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub && p.expression === node) || - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain && p.expression === node) || - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional && p.condition === node) || - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary && p.left === node) || - (p instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPostfix && p.expression === node) - ) { - node = p; - } else { - return false; - } - } -} - -// Returns whether the leftmost item in the expression is an object -function left_is_object(node) { - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Object) return true; - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sequence) return left_is_object(node.expressions[0]); - if (node.TYPE === "Call") return left_is_object(node.expression); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_PrefixedTemplateString) return left_is_object(node.prefix); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Dot || node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Sub) return left_is_object(node.expression); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Chain) return left_is_object(node.expression); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Conditional) return left_is_object(node.condition); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Binary) return left_is_object(node.left); - if (node instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_UnaryPostfix) return left_is_object(node.expression); - return false; -} - - - - -/***/ }), - -/***/ "./node_modules/terser/lib/utils/index.js": -/*!************************************************!*\ - !*** ./node_modules/terser/lib/utils/index.js ***! - \************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HOP: () => (/* binding */ HOP), -/* harmony export */ MAP: () => (/* binding */ MAP), -/* harmony export */ characters: () => (/* binding */ characters), -/* harmony export */ clear_annotation: () => (/* binding */ clear_annotation), -/* harmony export */ defaults: () => (/* binding */ defaults), -/* harmony export */ has_annotation: () => (/* binding */ has_annotation), -/* harmony export */ keep_name: () => (/* binding */ keep_name), -/* harmony export */ makePredicate: () => (/* binding */ makePredicate), -/* harmony export */ make_node: () => (/* binding */ make_node), -/* harmony export */ map_add: () => (/* binding */ map_add), -/* harmony export */ map_from_object: () => (/* binding */ map_from_object), -/* harmony export */ map_to_object: () => (/* binding */ map_to_object), -/* harmony export */ member: () => (/* binding */ member), -/* harmony export */ mergeSort: () => (/* binding */ mergeSort), -/* harmony export */ noop: () => (/* binding */ noop), -/* harmony export */ push_uniq: () => (/* binding */ push_uniq), -/* harmony export */ regexp_is_safe: () => (/* binding */ regexp_is_safe), -/* harmony export */ regexp_source_fix: () => (/* binding */ regexp_source_fix), -/* harmony export */ remove: () => (/* binding */ remove), -/* harmony export */ return_false: () => (/* binding */ return_false), -/* harmony export */ return_null: () => (/* binding */ return_null), -/* harmony export */ return_this: () => (/* binding */ return_this), -/* harmony export */ return_true: () => (/* binding */ return_true), -/* harmony export */ set_annotation: () => (/* binding */ set_annotation), -/* harmony export */ sort_regexp_flags: () => (/* binding */ sort_regexp_flags), -/* harmony export */ string_template: () => (/* binding */ string_template) -/* harmony export */ }); -/* harmony import */ var _ast_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ast.js */ "./node_modules/terser/lib/ast.js"); -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - - - - - -function characters(str) { - return str.split(""); -} - -function member(name, array) { - return array.includes(name); -} - -class DefaultsError extends Error { - constructor(msg, defs) { - super(); - - this.name = "DefaultsError"; - this.message = msg; - this.defs = defs; - } -} - -function defaults(args, defs, croak) { - if (args === true) { - args = {}; - } else if (args != null && typeof args === "object") { - args = {...args}; - } - - const ret = args || {}; - - if (croak) for (const i in ret) if (HOP(ret, i) && !HOP(defs, i)) { - throw new DefaultsError("`" + i + "` is not a supported option", defs); - } - - for (const i in defs) if (HOP(defs, i)) { - if (!args || !HOP(args, i)) { - ret[i] = defs[i]; - } else if (i === "ecma") { - let ecma = args[i] | 0; - if (ecma > 5 && ecma < 2015) ecma += 2009; - ret[i] = ecma; - } else { - ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; - } - } - - return ret; -} - -function noop() {} -function return_false() { return false; } -function return_true() { return true; } -function return_this() { return this; } -function return_null() { return null; } - -var MAP = (function() { - function MAP(a, tw, allow_splicing = true) { - const new_a = []; - - for (let i = 0; i < a.length; ++i) { - let item = a[i]; - let ret = item.transform(tw, allow_splicing); - - if (ret instanceof _ast_js__WEBPACK_IMPORTED_MODULE_0__.AST_Node) { - new_a.push(ret); - } else if (ret instanceof Splice) { - new_a.push(...ret.v); - } - } - - return new_a; - } - - MAP.splice = function(val) { return new Splice(val); }; - MAP.skip = {}; - function Splice(val) { this.v = val; } - return MAP; -})(); - -function make_node(ctor, orig, props) { - if (!props) props = {}; - if (orig) { - if (!props.start) props.start = orig.start; - if (!props.end) props.end = orig.end; - } - return new ctor(props); -} - -function push_uniq(array, el) { - if (!array.includes(el)) - array.push(el); -} - -function string_template(text, props) { - return text.replace(/{(.+?)}/g, function(str, p) { - return props && props[p]; - }); -} - -function remove(array, el) { - for (var i = array.length; --i >= 0;) { - if (array[i] === el) array.splice(i, 1); - } -} - -function mergeSort(array, cmp) { - if (array.length < 2) return array.slice(); - function merge(a, b) { - var r = [], ai = 0, bi = 0, i = 0; - while (ai < a.length && bi < b.length) { - cmp(a[ai], b[bi]) <= 0 - ? r[i++] = a[ai++] - : r[i++] = b[bi++]; - } - if (ai < a.length) r.push.apply(r, a.slice(ai)); - if (bi < b.length) r.push.apply(r, b.slice(bi)); - return r; - } - function _ms(a) { - if (a.length <= 1) - return a; - var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); - left = _ms(left); - right = _ms(right); - return merge(left, right); - } - return _ms(array); -} - -function makePredicate(words) { - if (!Array.isArray(words)) words = words.split(" "); - - return new Set(words.sort()); -} - -function map_add(map, key, value) { - if (map.has(key)) { - map.get(key).push(value); - } else { - map.set(key, [ value ]); - } -} - -function map_from_object(obj) { - var map = new Map(); - for (var key in obj) { - if (HOP(obj, key) && key.charAt(0) === "$") { - map.set(key.substr(1), obj[key]); - } - } - return map; -} - -function map_to_object(map) { - var obj = Object.create(null); - map.forEach(function (value, key) { - obj["$" + key] = value; - }); - return obj; -} - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -function keep_name(keep_setting, name) { - return keep_setting === true - || (keep_setting instanceof RegExp && keep_setting.test(name)); -} - -var lineTerminatorEscape = { - "\0": "0", - "\n": "n", - "\r": "r", - "\u2028": "u2028", - "\u2029": "u2029", -}; -function regexp_source_fix(source) { - // V8 does not escape line terminators in regexp patterns in node 12 - // We'll also remove literal \0 - return source.replace(/[\0\n\r\u2028\u2029]/g, function (match, offset) { - var escaped = source[offset - 1] == "\\" - && (source[offset - 2] != "\\" - || /(?:^|[^\\])(?:\\{2})*$/.test(source.slice(0, offset - 1))); - return (escaped ? "" : "\\") + lineTerminatorEscape[match]; - }); -} - -// Subset of regexps that is not going to cause regexp based DDOS -// https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS -const re_safe_regexp = /^[\\/|\0\s\w^$.[\]()]*$/; - -/** Check if the regexp is safe for Terser to create without risking a RegExp DOS */ -const regexp_is_safe = (source) => re_safe_regexp.test(source); - -const all_flags = "dgimsuyv"; -function sort_regexp_flags(flags) { - const existing_flags = new Set(flags.split("")); - let out = ""; - for (const flag of all_flags) { - if (existing_flags.has(flag)) { - out += flag; - existing_flags.delete(flag); - } - } - if (existing_flags.size) { - // Flags Terser doesn't know about - existing_flags.forEach(flag => { out += flag; }); - } - return out; -} - -function has_annotation(node, annotation) { - return node._annotations & annotation; -} - -function set_annotation(node, annotation) { - node._annotations |= annotation; -} - -function clear_annotation(node, annotation) { - node._annotations &= ~annotation; -} - - - - -/***/ }), - -/***/ "./node_modules/terser/main.js": -/*!*************************************!*\ - !*** ./node_modules/terser/main.js ***! - \*************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ _default_options: () => (/* binding */ _default_options), -/* harmony export */ _run_cli: () => (/* reexport safe */ _lib_cli_js__WEBPACK_IMPORTED_MODULE_3__.run_cli), -/* harmony export */ minify: () => (/* reexport safe */ _lib_minify_js__WEBPACK_IMPORTED_MODULE_2__.minify), -/* harmony export */ minify_sync: () => (/* reexport safe */ _lib_minify_js__WEBPACK_IMPORTED_MODULE_2__.minify_sync) -/* harmony export */ }); -/* harmony import */ var _lib_transform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/transform.js */ "./node_modules/terser/lib/transform.js"); -/* harmony import */ var _lib_mozilla_ast_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/mozilla-ast.js */ "./node_modules/terser/lib/mozilla-ast.js"); -/* harmony import */ var _lib_minify_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/minify.js */ "./node_modules/terser/lib/minify.js"); -/* harmony import */ var _lib_cli_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/cli.js */ "./node_modules/terser/lib/cli.js"); - - - - - - - -async function _default_options() { - const defs = {}; - - Object.keys(infer_options({ 0: 0 })).forEach((component) => { - const options = infer_options({ - [component]: {0: 0} - }); - - if (options) defs[component] = options; - }); - return defs; -} - -async function infer_options(options) { - try { - await (0,_lib_minify_js__WEBPACK_IMPORTED_MODULE_2__.minify)("", options); - } catch (error) { - return error.defs; - } -} - - -/***/ }), - -/***/ "./node_modules/terser/tools/domprops.js": -/*!***********************************************!*\ - !*** ./node_modules/terser/tools/domprops.js ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ domprops: () => (/* binding */ domprops) -/* harmony export */ }); -var domprops = [ - "$&", - "$'", - "$*", - "$+", - "$1", - "$2", - "$3", - "$4", - "$5", - "$6", - "$7", - "$8", - "$9", - "$_", - "$`", - "$input", - "-moz-animation", - "-moz-animation-delay", - "-moz-animation-direction", - "-moz-animation-duration", - "-moz-animation-fill-mode", - "-moz-animation-iteration-count", - "-moz-animation-name", - "-moz-animation-play-state", - "-moz-animation-timing-function", - "-moz-appearance", - "-moz-backface-visibility", - "-moz-border-end", - "-moz-border-end-color", - "-moz-border-end-style", - "-moz-border-end-width", - "-moz-border-image", - "-moz-border-start", - "-moz-border-start-color", - "-moz-border-start-style", - "-moz-border-start-width", - "-moz-box-align", - "-moz-box-direction", - "-moz-box-flex", - "-moz-box-ordinal-group", - "-moz-box-orient", - "-moz-box-pack", - "-moz-box-sizing", - "-moz-float-edge", - "-moz-font-feature-settings", - "-moz-font-language-override", - "-moz-force-broken-image-icon", - "-moz-hyphens", - "-moz-image-region", - "-moz-margin-end", - "-moz-margin-start", - "-moz-orient", - "-moz-osx-font-smoothing", - "-moz-outline-radius", - "-moz-outline-radius-bottomleft", - "-moz-outline-radius-bottomright", - "-moz-outline-radius-topleft", - "-moz-outline-radius-topright", - "-moz-padding-end", - "-moz-padding-start", - "-moz-perspective", - "-moz-perspective-origin", - "-moz-tab-size", - "-moz-text-size-adjust", - "-moz-transform", - "-moz-transform-origin", - "-moz-transform-style", - "-moz-transition", - "-moz-transition-delay", - "-moz-transition-duration", - "-moz-transition-property", - "-moz-transition-timing-function", - "-moz-user-focus", - "-moz-user-input", - "-moz-user-modify", - "-moz-user-select", - "-moz-window-dragging", - "-webkit-align-content", - "-webkit-align-items", - "-webkit-align-self", - "-webkit-animation", - "-webkit-animation-delay", - "-webkit-animation-direction", - "-webkit-animation-duration", - "-webkit-animation-fill-mode", - "-webkit-animation-iteration-count", - "-webkit-animation-name", - "-webkit-animation-play-state", - "-webkit-animation-timing-function", - "-webkit-appearance", - "-webkit-backface-visibility", - "-webkit-background-clip", - "-webkit-background-origin", - "-webkit-background-size", - "-webkit-border-bottom-left-radius", - "-webkit-border-bottom-right-radius", - "-webkit-border-image", - "-webkit-border-radius", - "-webkit-border-top-left-radius", - "-webkit-border-top-right-radius", - "-webkit-box-align", - "-webkit-box-direction", - "-webkit-box-flex", - "-webkit-box-ordinal-group", - "-webkit-box-orient", - "-webkit-box-pack", - "-webkit-box-shadow", - "-webkit-box-sizing", - "-webkit-clip-path", - "-webkit-filter", - "-webkit-flex", - "-webkit-flex-basis", - "-webkit-flex-direction", - "-webkit-flex-flow", - "-webkit-flex-grow", - "-webkit-flex-shrink", - "-webkit-flex-wrap", - "-webkit-font-feature-settings", - "-webkit-justify-content", - "-webkit-line-clamp", - "-webkit-mask", - "-webkit-mask-clip", - "-webkit-mask-composite", - "-webkit-mask-image", - "-webkit-mask-origin", - "-webkit-mask-position", - "-webkit-mask-position-x", - "-webkit-mask-position-y", - "-webkit-mask-repeat", - "-webkit-mask-size", - "-webkit-order", - "-webkit-perspective", - "-webkit-perspective-origin", - "-webkit-text-fill-color", - "-webkit-text-security", - "-webkit-text-size-adjust", - "-webkit-text-stroke", - "-webkit-text-stroke-color", - "-webkit-text-stroke-width", - "-webkit-transform", - "-webkit-transform-origin", - "-webkit-transform-style", - "-webkit-transition", - "-webkit-transition-delay", - "-webkit-transition-duration", - "-webkit-transition-property", - "-webkit-transition-timing-function", - "-webkit-user-select", - "@@iterator", - "ABORT_ERR", - "ACTIVE", - "ACTIVE_ATTRIBUTES", - "ACTIVE_TEXTURE", - "ACTIVE_UNIFORMS", - "ACTIVE_UNIFORM_BLOCKS", - "ADDITION", - "ALIASED_LINE_WIDTH_RANGE", - "ALIASED_POINT_SIZE_RANGE", - "ALL", - "ALLOW_KEYBOARD_INPUT", - "ALLPASS", - "ALPHA", - "ALPHA_BITS", - "ALREADY_SIGNALED", - "ALT_MASK", - "ALWAYS", - "ANY_SAMPLES_PASSED", - "ANY_SAMPLES_PASSED_CONSERVATIVE", - "ANY_TYPE", - "ANY_UNORDERED_NODE_TYPE", - "ARRAY_BUFFER", - "ARRAY_BUFFER_BINDING", - "ATTACHED_SHADERS", - "ATTRIBUTE_NODE", - "AT_TARGET", - "AbortController", - "AbortSignal", - "AbsoluteOrientationSensor", - "AbstractRange", - "Accelerometer", - "AddSearchProvider", - "AggregateError", - "AnalyserNode", - "Animation", - "AnimationEffect", - "AnimationEvent", - "AnimationPlaybackEvent", - "AnimationTimeline", - "AnonXMLHttpRequest", - "Any", - "AnyPermissions", - "ApplicationCache", - "ApplicationCacheErrorEvent", - "Array", - "ArrayBuffer", - "ArrayType", - "Atomics", - "Attr", - "Audio", - "AudioBuffer", - "AudioBufferSourceNode", - "AudioContext", - "AudioData", - "AudioDecoder", - "AudioDestinationNode", - "AudioEncoder", - "AudioListener", - "AudioNode", - "AudioParam", - "AudioParamMap", - "AudioProcessingEvent", - "AudioScheduledSourceNode", - "AudioSinkInfo", - "AudioStreamTrack", - "AudioWorklet", - "AudioWorkletNode", - "AuthenticatorAssertionResponse", - "AuthenticatorAttestationResponse", - "AuthenticatorResponse", - "AutocompleteErrorEvent", - "BACK", - "BAD_BOUNDARYPOINTS_ERR", - "BAD_REQUEST", - "BANDPASS", - "BLEND", - "BLEND_COLOR", - "BLEND_DST_ALPHA", - "BLEND_DST_RGB", - "BLEND_EQUATION", - "BLEND_EQUATION_ALPHA", - "BLEND_EQUATION_RGB", - "BLEND_SRC_ALPHA", - "BLEND_SRC_RGB", - "BLUE", - "BLUE_BITS", - "BLUR", - "BOOL", - "BOOLEAN_TYPE", - "BOOL_VEC2", - "BOOL_VEC3", - "BOOL_VEC4", - "BOTH", - "BROWSER_DEFAULT_WEBGL", - "BUBBLING_PHASE", - "BUFFER_SIZE", - "BUFFER_USAGE", - "BYTE", - "BYTES_PER_ELEMENT", - "BackgroundFetchManager", - "BackgroundFetchRecord", - "BackgroundFetchRegistration", - "BarProp", - "BarcodeDetector", - "BaseAudioContext", - "BaseHref", - "BatteryManager", - "BeforeInstallPromptEvent", - "BeforeLoadEvent", - "BeforeUnloadEvent", - "BigInt", - "BigInt64Array", - "BigUint64Array", - "BiquadFilterNode", - "Blob", - "BlobEvent", - "Bluetooth", - "BluetoothCharacteristicProperties", - "BluetoothDevice", - "BluetoothRemoteGATTCharacteristic", - "BluetoothRemoteGATTDescriptor", - "BluetoothRemoteGATTServer", - "BluetoothRemoteGATTService", - "BluetoothUUID", - "Boolean", - "BroadcastChannel", - "BrowserCaptureMediaStreamTrack", - "BrowserInfo", - "ByteLengthQueuingStrategy", - "CAPTURING_PHASE", - "CCW", - "CDATASection", - "CDATA_SECTION_NODE", - "CHANGE", - "CHARSET_RULE", - "CHECKING", - "CLAMP_TO_EDGE", - "CLICK", - "CLOSED", - "CLOSING", - "COLOR", - "COLOR_ATTACHMENT0", - "COLOR_ATTACHMENT1", - "COLOR_ATTACHMENT10", - "COLOR_ATTACHMENT11", - "COLOR_ATTACHMENT12", - "COLOR_ATTACHMENT13", - "COLOR_ATTACHMENT14", - "COLOR_ATTACHMENT15", - "COLOR_ATTACHMENT2", - "COLOR_ATTACHMENT3", - "COLOR_ATTACHMENT4", - "COLOR_ATTACHMENT5", - "COLOR_ATTACHMENT6", - "COLOR_ATTACHMENT7", - "COLOR_ATTACHMENT8", - "COLOR_ATTACHMENT9", - "COLOR_BUFFER_BIT", - "COLOR_CLEAR_VALUE", - "COLOR_WRITEMASK", - "COMMENT_NODE", - "COMPARE_REF_TO_TEXTURE", - "COMPILE_STATUS", - "COMPLETION_STATUS_KHR", - "COMPRESSED_RGBA_S3TC_DXT1_EXT", - "COMPRESSED_RGBA_S3TC_DXT3_EXT", - "COMPRESSED_RGBA_S3TC_DXT5_EXT", - "COMPRESSED_RGB_S3TC_DXT1_EXT", - "COMPRESSED_TEXTURE_FORMATS", - "COMPUTE", - "CONDITION_SATISFIED", - "CONFIGURATION_UNSUPPORTED", - "CONNECTING", - "CONSTANT_ALPHA", - "CONSTANT_COLOR", - "CONSTRAINT_ERR", - "CONTEXT_LOST_WEBGL", - "CONTROL_MASK", - "COPY_DST", - "COPY_READ_BUFFER", - "COPY_READ_BUFFER_BINDING", - "COPY_SRC", - "COPY_WRITE_BUFFER", - "COPY_WRITE_BUFFER_BINDING", - "COUNTER_STYLE_RULE", - "CSS", - "CSS2Properties", - "CSSAnimation", - "CSSCharsetRule", - "CSSConditionRule", - "CSSContainerRule", - "CSSCounterStyleRule", - "CSSFontFaceRule", - "CSSFontFeatureValuesRule", - "CSSFontPaletteValuesRule", - "CSSGroupingRule", - "CSSImageValue", - "CSSImportRule", - "CSSKeyframeRule", - "CSSKeyframesRule", - "CSSKeywordValue", - "CSSLayerBlockRule", - "CSSLayerStatementRule", - "CSSMarginRule", - "CSSMathClamp", - "CSSMathInvert", - "CSSMathMax", - "CSSMathMin", - "CSSMathNegate", - "CSSMathProduct", - "CSSMathSum", - "CSSMathValue", - "CSSMatrixComponent", - "CSSMediaRule", - "CSSMozDocumentRule", - "CSSNameSpaceRule", - "CSSNamespaceRule", - "CSSNestedDeclarations", - "CSSNumericArray", - "CSSNumericValue", - "CSSPageDescriptors", - "CSSPageRule", - "CSSPerspective", - "CSSPositionTryDescriptors", - "CSSPositionTryRule", - "CSSPositionValue", - "CSSPrimitiveValue", - "CSSPropertyRule", - "CSSRotate", - "CSSRule", - "CSSRuleList", - "CSSScale", - "CSSScopeRule", - "CSSSkew", - "CSSSkewX", - "CSSSkewY", - "CSSStartingStyleRule", - "CSSStyleDeclaration", - "CSSStyleRule", - "CSSStyleSheet", - "CSSStyleValue", - "CSSSupportsRule", - "CSSTransformComponent", - "CSSTransformValue", - "CSSTransition", - "CSSTranslate", - "CSSUnitValue", - "CSSUnknownRule", - "CSSUnparsedValue", - "CSSValue", - "CSSValueList", - "CSSVariableReferenceValue", - "CSSVariablesDeclaration", - "CSSVariablesRule", - "CSSViewTransitionRule", - "CSSViewportRule", - "CSS_ATTR", - "CSS_CM", - "CSS_COUNTER", - "CSS_CUSTOM", - "CSS_DEG", - "CSS_DIMENSION", - "CSS_EMS", - "CSS_EXS", - "CSS_FILTER_BLUR", - "CSS_FILTER_BRIGHTNESS", - "CSS_FILTER_CONTRAST", - "CSS_FILTER_CUSTOM", - "CSS_FILTER_DROP_SHADOW", - "CSS_FILTER_GRAYSCALE", - "CSS_FILTER_HUE_ROTATE", - "CSS_FILTER_INVERT", - "CSS_FILTER_OPACITY", - "CSS_FILTER_REFERENCE", - "CSS_FILTER_SATURATE", - "CSS_FILTER_SEPIA", - "CSS_GRAD", - "CSS_HZ", - "CSS_IDENT", - "CSS_IN", - "CSS_INHERIT", - "CSS_KHZ", - "CSS_MATRIX", - "CSS_MATRIX3D", - "CSS_MM", - "CSS_MS", - "CSS_NUMBER", - "CSS_PC", - "CSS_PERCENTAGE", - "CSS_PERSPECTIVE", - "CSS_PRIMITIVE_VALUE", - "CSS_PT", - "CSS_PX", - "CSS_RAD", - "CSS_RECT", - "CSS_RGBCOLOR", - "CSS_ROTATE", - "CSS_ROTATE3D", - "CSS_ROTATEX", - "CSS_ROTATEY", - "CSS_ROTATEZ", - "CSS_S", - "CSS_SCALE", - "CSS_SCALE3D", - "CSS_SCALEX", - "CSS_SCALEY", - "CSS_SCALEZ", - "CSS_SKEW", - "CSS_SKEWX", - "CSS_SKEWY", - "CSS_STRING", - "CSS_TRANSLATE", - "CSS_TRANSLATE3D", - "CSS_TRANSLATEX", - "CSS_TRANSLATEY", - "CSS_TRANSLATEZ", - "CSS_UNKNOWN", - "CSS_URI", - "CSS_VALUE_LIST", - "CSS_VH", - "CSS_VMAX", - "CSS_VMIN", - "CSS_VW", - "CULL_FACE", - "CULL_FACE_MODE", - "CURRENT_PROGRAM", - "CURRENT_QUERY", - "CURRENT_VERTEX_ATTRIB", - "CUSTOM", - "CW", - "Cache", - "CacheStorage", - "CanvasCaptureMediaStream", - "CanvasCaptureMediaStreamTrack", - "CanvasGradient", - "CanvasPattern", - "CanvasRenderingContext2D", - "CaptureController", - "CaretPosition", - "ChannelMergerNode", - "ChannelSplitterNode", - "ChapterInformation", - "CharacterBoundsUpdateEvent", - "CharacterData", - "ClientRect", - "ClientRectList", - "Clipboard", - "ClipboardEvent", - "ClipboardItem", - "CloseEvent", - "CloseWatcher", - "Collator", - "ColorArray", - "ColorValue", - "CommandEvent", - "Comment", - "CompileError", - "CompositionEvent", - "CompressionStream", - "Console", - "ConstantSourceNode", - "ContentVisibilityAutoStateChangeEvent", - "ContextFilter", - "ContextType", - "Controllers", - "ConvolverNode", - "CookieChangeEvent", - "CookieStore", - "CookieStoreManager", - "CountQueuingStrategy", - "Counter", - "CreateType", - "Credential", - "CredentialsContainer", - "CropTarget", - "Crypto", - "CryptoKey", - "CustomElementRegistry", - "CustomEvent", - "CustomStateSet", - "DATABASE_ERR", - "DATA_CLONE_ERR", - "DATA_ERR", - "DBLCLICK", - "DECR", - "DECR_WRAP", - "DELETE_STATUS", - "DEPTH", - "DEPTH24_STENCIL8", - "DEPTH32F_STENCIL8", - "DEPTH_ATTACHMENT", - "DEPTH_BITS", - "DEPTH_BUFFER_BIT", - "DEPTH_CLEAR_VALUE", - "DEPTH_COMPONENT", - "DEPTH_COMPONENT16", - "DEPTH_COMPONENT24", - "DEPTH_COMPONENT32F", - "DEPTH_FUNC", - "DEPTH_RANGE", - "DEPTH_STENCIL", - "DEPTH_STENCIL_ATTACHMENT", - "DEPTH_TEST", - "DEPTH_WRITEMASK", - "DEVICE_INELIGIBLE", - "DIRECTION_DOWN", - "DIRECTION_LEFT", - "DIRECTION_RIGHT", - "DIRECTION_UP", - "DISABLED", - "DISPATCH_REQUEST_ERR", - "DITHER", - "DOCUMENT_FRAGMENT_NODE", - "DOCUMENT_NODE", - "DOCUMENT_POSITION_CONTAINED_BY", - "DOCUMENT_POSITION_CONTAINS", - "DOCUMENT_POSITION_DISCONNECTED", - "DOCUMENT_POSITION_FOLLOWING", - "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", - "DOCUMENT_POSITION_PRECEDING", - "DOCUMENT_TYPE_NODE", - "DOMCursor", - "DOMError", - "DOMException", - "DOMImplementation", - "DOMImplementationLS", - "DOMMatrix", - "DOMMatrixReadOnly", - "DOMParser", - "DOMPoint", - "DOMPointReadOnly", - "DOMQuad", - "DOMRect", - "DOMRectList", - "DOMRectReadOnly", - "DOMRequest", - "DOMSTRING_SIZE_ERR", - "DOMSettableTokenList", - "DOMStringList", - "DOMStringMap", - "DOMTokenList", - "DOMTransactionEvent", - "DOM_DELTA_LINE", - "DOM_DELTA_PAGE", - "DOM_DELTA_PIXEL", - "DOM_INPUT_METHOD_DROP", - "DOM_INPUT_METHOD_HANDWRITING", - "DOM_INPUT_METHOD_IME", - "DOM_INPUT_METHOD_KEYBOARD", - "DOM_INPUT_METHOD_MULTIMODAL", - "DOM_INPUT_METHOD_OPTION", - "DOM_INPUT_METHOD_PASTE", - "DOM_INPUT_METHOD_SCRIPT", - "DOM_INPUT_METHOD_UNKNOWN", - "DOM_INPUT_METHOD_VOICE", - "DOM_KEY_LOCATION_JOYSTICK", - "DOM_KEY_LOCATION_LEFT", - "DOM_KEY_LOCATION_MOBILE", - "DOM_KEY_LOCATION_NUMPAD", - "DOM_KEY_LOCATION_RIGHT", - "DOM_KEY_LOCATION_STANDARD", - "DOM_VK_0", - "DOM_VK_1", - "DOM_VK_2", - "DOM_VK_3", - "DOM_VK_4", - "DOM_VK_5", - "DOM_VK_6", - "DOM_VK_7", - "DOM_VK_8", - "DOM_VK_9", - "DOM_VK_A", - "DOM_VK_ACCEPT", - "DOM_VK_ADD", - "DOM_VK_ALT", - "DOM_VK_ALTGR", - "DOM_VK_AMPERSAND", - "DOM_VK_ASTERISK", - "DOM_VK_AT", - "DOM_VK_ATTN", - "DOM_VK_B", - "DOM_VK_BACKSPACE", - "DOM_VK_BACK_QUOTE", - "DOM_VK_BACK_SLASH", - "DOM_VK_BACK_SPACE", - "DOM_VK_C", - "DOM_VK_CANCEL", - "DOM_VK_CAPS_LOCK", - "DOM_VK_CIRCUMFLEX", - "DOM_VK_CLEAR", - "DOM_VK_CLOSE_BRACKET", - "DOM_VK_CLOSE_CURLY_BRACKET", - "DOM_VK_CLOSE_PAREN", - "DOM_VK_COLON", - "DOM_VK_COMMA", - "DOM_VK_CONTEXT_MENU", - "DOM_VK_CONTROL", - "DOM_VK_CONVERT", - "DOM_VK_CRSEL", - "DOM_VK_CTRL", - "DOM_VK_D", - "DOM_VK_DECIMAL", - "DOM_VK_DELETE", - "DOM_VK_DIVIDE", - "DOM_VK_DOLLAR", - "DOM_VK_DOUBLE_QUOTE", - "DOM_VK_DOWN", - "DOM_VK_E", - "DOM_VK_EISU", - "DOM_VK_END", - "DOM_VK_ENTER", - "DOM_VK_EQUALS", - "DOM_VK_EREOF", - "DOM_VK_ESCAPE", - "DOM_VK_EXCLAMATION", - "DOM_VK_EXECUTE", - "DOM_VK_EXSEL", - "DOM_VK_F", - "DOM_VK_F1", - "DOM_VK_F10", - "DOM_VK_F11", - "DOM_VK_F12", - "DOM_VK_F13", - "DOM_VK_F14", - "DOM_VK_F15", - "DOM_VK_F16", - "DOM_VK_F17", - "DOM_VK_F18", - "DOM_VK_F19", - "DOM_VK_F2", - "DOM_VK_F20", - "DOM_VK_F21", - "DOM_VK_F22", - "DOM_VK_F23", - "DOM_VK_F24", - "DOM_VK_F25", - "DOM_VK_F26", - "DOM_VK_F27", - "DOM_VK_F28", - "DOM_VK_F29", - "DOM_VK_F3", - "DOM_VK_F30", - "DOM_VK_F31", - "DOM_VK_F32", - "DOM_VK_F33", - "DOM_VK_F34", - "DOM_VK_F35", - "DOM_VK_F36", - "DOM_VK_F4", - "DOM_VK_F5", - "DOM_VK_F6", - "DOM_VK_F7", - "DOM_VK_F8", - "DOM_VK_F9", - "DOM_VK_FINAL", - "DOM_VK_FRONT", - "DOM_VK_G", - "DOM_VK_GREATER_THAN", - "DOM_VK_H", - "DOM_VK_HANGUL", - "DOM_VK_HANJA", - "DOM_VK_HASH", - "DOM_VK_HELP", - "DOM_VK_HK_TOGGLE", - "DOM_VK_HOME", - "DOM_VK_HYPHEN_MINUS", - "DOM_VK_I", - "DOM_VK_INSERT", - "DOM_VK_J", - "DOM_VK_JUNJA", - "DOM_VK_K", - "DOM_VK_KANA", - "DOM_VK_KANJI", - "DOM_VK_L", - "DOM_VK_LEFT", - "DOM_VK_LEFT_TAB", - "DOM_VK_LESS_THAN", - "DOM_VK_M", - "DOM_VK_META", - "DOM_VK_MODECHANGE", - "DOM_VK_MULTIPLY", - "DOM_VK_N", - "DOM_VK_NONCONVERT", - "DOM_VK_NUMPAD0", - "DOM_VK_NUMPAD1", - "DOM_VK_NUMPAD2", - "DOM_VK_NUMPAD3", - "DOM_VK_NUMPAD4", - "DOM_VK_NUMPAD5", - "DOM_VK_NUMPAD6", - "DOM_VK_NUMPAD7", - "DOM_VK_NUMPAD8", - "DOM_VK_NUMPAD9", - "DOM_VK_NUM_LOCK", - "DOM_VK_O", - "DOM_VK_OEM_1", - "DOM_VK_OEM_102", - "DOM_VK_OEM_2", - "DOM_VK_OEM_3", - "DOM_VK_OEM_4", - "DOM_VK_OEM_5", - "DOM_VK_OEM_6", - "DOM_VK_OEM_7", - "DOM_VK_OEM_8", - "DOM_VK_OEM_COMMA", - "DOM_VK_OEM_MINUS", - "DOM_VK_OEM_PERIOD", - "DOM_VK_OEM_PLUS", - "DOM_VK_OPEN_BRACKET", - "DOM_VK_OPEN_CURLY_BRACKET", - "DOM_VK_OPEN_PAREN", - "DOM_VK_P", - "DOM_VK_PA1", - "DOM_VK_PAGEDOWN", - "DOM_VK_PAGEUP", - "DOM_VK_PAGE_DOWN", - "DOM_VK_PAGE_UP", - "DOM_VK_PAUSE", - "DOM_VK_PERCENT", - "DOM_VK_PERIOD", - "DOM_VK_PIPE", - "DOM_VK_PLAY", - "DOM_VK_PLUS", - "DOM_VK_PRINT", - "DOM_VK_PRINTSCREEN", - "DOM_VK_PROCESSKEY", - "DOM_VK_PROPERITES", - "DOM_VK_Q", - "DOM_VK_QUESTION_MARK", - "DOM_VK_QUOTE", - "DOM_VK_R", - "DOM_VK_REDO", - "DOM_VK_RETURN", - "DOM_VK_RIGHT", - "DOM_VK_S", - "DOM_VK_SCROLL_LOCK", - "DOM_VK_SELECT", - "DOM_VK_SEMICOLON", - "DOM_VK_SEPARATOR", - "DOM_VK_SHIFT", - "DOM_VK_SLASH", - "DOM_VK_SLEEP", - "DOM_VK_SPACE", - "DOM_VK_SUBTRACT", - "DOM_VK_T", - "DOM_VK_TAB", - "DOM_VK_TILDE", - "DOM_VK_U", - "DOM_VK_UNDERSCORE", - "DOM_VK_UNDO", - "DOM_VK_UNICODE", - "DOM_VK_UP", - "DOM_VK_V", - "DOM_VK_VOLUME_DOWN", - "DOM_VK_VOLUME_MUTE", - "DOM_VK_VOLUME_UP", - "DOM_VK_W", - "DOM_VK_WIN", - "DOM_VK_WINDOW", - "DOM_VK_WIN_ICO_00", - "DOM_VK_WIN_ICO_CLEAR", - "DOM_VK_WIN_ICO_HELP", - "DOM_VK_WIN_OEM_ATTN", - "DOM_VK_WIN_OEM_AUTO", - "DOM_VK_WIN_OEM_BACKTAB", - "DOM_VK_WIN_OEM_CLEAR", - "DOM_VK_WIN_OEM_COPY", - "DOM_VK_WIN_OEM_CUSEL", - "DOM_VK_WIN_OEM_ENLW", - "DOM_VK_WIN_OEM_FINISH", - "DOM_VK_WIN_OEM_FJ_JISHO", - "DOM_VK_WIN_OEM_FJ_LOYA", - "DOM_VK_WIN_OEM_FJ_MASSHOU", - "DOM_VK_WIN_OEM_FJ_ROYA", - "DOM_VK_WIN_OEM_FJ_TOUROKU", - "DOM_VK_WIN_OEM_JUMP", - "DOM_VK_WIN_OEM_PA1", - "DOM_VK_WIN_OEM_PA2", - "DOM_VK_WIN_OEM_PA3", - "DOM_VK_WIN_OEM_RESET", - "DOM_VK_WIN_OEM_WSCTRL", - "DOM_VK_X", - "DOM_VK_XF86XK_ADD_FAVORITE", - "DOM_VK_XF86XK_APPLICATION_LEFT", - "DOM_VK_XF86XK_APPLICATION_RIGHT", - "DOM_VK_XF86XK_AUDIO_CYCLE_TRACK", - "DOM_VK_XF86XK_AUDIO_FORWARD", - "DOM_VK_XF86XK_AUDIO_LOWER_VOLUME", - "DOM_VK_XF86XK_AUDIO_MEDIA", - "DOM_VK_XF86XK_AUDIO_MUTE", - "DOM_VK_XF86XK_AUDIO_NEXT", - "DOM_VK_XF86XK_AUDIO_PAUSE", - "DOM_VK_XF86XK_AUDIO_PLAY", - "DOM_VK_XF86XK_AUDIO_PREV", - "DOM_VK_XF86XK_AUDIO_RAISE_VOLUME", - "DOM_VK_XF86XK_AUDIO_RANDOM_PLAY", - "DOM_VK_XF86XK_AUDIO_RECORD", - "DOM_VK_XF86XK_AUDIO_REPEAT", - "DOM_VK_XF86XK_AUDIO_REWIND", - "DOM_VK_XF86XK_AUDIO_STOP", - "DOM_VK_XF86XK_AWAY", - "DOM_VK_XF86XK_BACK", - "DOM_VK_XF86XK_BACK_FORWARD", - "DOM_VK_XF86XK_BATTERY", - "DOM_VK_XF86XK_BLUE", - "DOM_VK_XF86XK_BLUETOOTH", - "DOM_VK_XF86XK_BOOK", - "DOM_VK_XF86XK_BRIGHTNESS_ADJUST", - "DOM_VK_XF86XK_CALCULATOR", - "DOM_VK_XF86XK_CALENDAR", - "DOM_VK_XF86XK_CD", - "DOM_VK_XF86XK_CLOSE", - "DOM_VK_XF86XK_COMMUNITY", - "DOM_VK_XF86XK_CONTRAST_ADJUST", - "DOM_VK_XF86XK_COPY", - "DOM_VK_XF86XK_CUT", - "DOM_VK_XF86XK_CYCLE_ANGLE", - "DOM_VK_XF86XK_DISPLAY", - "DOM_VK_XF86XK_DOCUMENTS", - "DOM_VK_XF86XK_DOS", - "DOM_VK_XF86XK_EJECT", - "DOM_VK_XF86XK_EXCEL", - "DOM_VK_XF86XK_EXPLORER", - "DOM_VK_XF86XK_FAVORITES", - "DOM_VK_XF86XK_FINANCE", - "DOM_VK_XF86XK_FORWARD", - "DOM_VK_XF86XK_FRAME_BACK", - "DOM_VK_XF86XK_FRAME_FORWARD", - "DOM_VK_XF86XK_GAME", - "DOM_VK_XF86XK_GO", - "DOM_VK_XF86XK_GREEN", - "DOM_VK_XF86XK_HIBERNATE", - "DOM_VK_XF86XK_HISTORY", - "DOM_VK_XF86XK_HOME_PAGE", - "DOM_VK_XF86XK_HOT_LINKS", - "DOM_VK_XF86XK_I_TOUCH", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_UP", - "DOM_VK_XF86XK_KBD_LIGHT_ON_OFF", - "DOM_VK_XF86XK_LAUNCH0", - "DOM_VK_XF86XK_LAUNCH1", - "DOM_VK_XF86XK_LAUNCH2", - "DOM_VK_XF86XK_LAUNCH3", - "DOM_VK_XF86XK_LAUNCH4", - "DOM_VK_XF86XK_LAUNCH5", - "DOM_VK_XF86XK_LAUNCH6", - "DOM_VK_XF86XK_LAUNCH7", - "DOM_VK_XF86XK_LAUNCH8", - "DOM_VK_XF86XK_LAUNCH9", - "DOM_VK_XF86XK_LAUNCH_A", - "DOM_VK_XF86XK_LAUNCH_B", - "DOM_VK_XF86XK_LAUNCH_C", - "DOM_VK_XF86XK_LAUNCH_D", - "DOM_VK_XF86XK_LAUNCH_E", - "DOM_VK_XF86XK_LAUNCH_F", - "DOM_VK_XF86XK_LIGHT_BULB", - "DOM_VK_XF86XK_LOG_OFF", - "DOM_VK_XF86XK_MAIL", - "DOM_VK_XF86XK_MAIL_FORWARD", - "DOM_VK_XF86XK_MARKET", - "DOM_VK_XF86XK_MEETING", - "DOM_VK_XF86XK_MEMO", - "DOM_VK_XF86XK_MENU_KB", - "DOM_VK_XF86XK_MENU_PB", - "DOM_VK_XF86XK_MESSENGER", - "DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_MON_BRIGHTNESS_UP", - "DOM_VK_XF86XK_MUSIC", - "DOM_VK_XF86XK_MY_COMPUTER", - "DOM_VK_XF86XK_MY_SITES", - "DOM_VK_XF86XK_NEW", - "DOM_VK_XF86XK_NEWS", - "DOM_VK_XF86XK_OFFICE_HOME", - "DOM_VK_XF86XK_OPEN", - "DOM_VK_XF86XK_OPEN_URL", - "DOM_VK_XF86XK_OPTION", - "DOM_VK_XF86XK_PASTE", - "DOM_VK_XF86XK_PHONE", - "DOM_VK_XF86XK_PICTURES", - "DOM_VK_XF86XK_POWER_DOWN", - "DOM_VK_XF86XK_POWER_OFF", - "DOM_VK_XF86XK_RED", - "DOM_VK_XF86XK_REFRESH", - "DOM_VK_XF86XK_RELOAD", - "DOM_VK_XF86XK_REPLY", - "DOM_VK_XF86XK_ROCKER_DOWN", - "DOM_VK_XF86XK_ROCKER_ENTER", - "DOM_VK_XF86XK_ROCKER_UP", - "DOM_VK_XF86XK_ROTATE_WINDOWS", - "DOM_VK_XF86XK_ROTATION_KB", - "DOM_VK_XF86XK_ROTATION_PB", - "DOM_VK_XF86XK_SAVE", - "DOM_VK_XF86XK_SCREEN_SAVER", - "DOM_VK_XF86XK_SCROLL_CLICK", - "DOM_VK_XF86XK_SCROLL_DOWN", - "DOM_VK_XF86XK_SCROLL_UP", - "DOM_VK_XF86XK_SEARCH", - "DOM_VK_XF86XK_SEND", - "DOM_VK_XF86XK_SHOP", - "DOM_VK_XF86XK_SPELL", - "DOM_VK_XF86XK_SPLIT_SCREEN", - "DOM_VK_XF86XK_STANDBY", - "DOM_VK_XF86XK_START", - "DOM_VK_XF86XK_STOP", - "DOM_VK_XF86XK_SUBTITLE", - "DOM_VK_XF86XK_SUPPORT", - "DOM_VK_XF86XK_SUSPEND", - "DOM_VK_XF86XK_TASK_PANE", - "DOM_VK_XF86XK_TERMINAL", - "DOM_VK_XF86XK_TIME", - "DOM_VK_XF86XK_TOOLS", - "DOM_VK_XF86XK_TOP_MENU", - "DOM_VK_XF86XK_TO_DO_LIST", - "DOM_VK_XF86XK_TRAVEL", - "DOM_VK_XF86XK_USER1KB", - "DOM_VK_XF86XK_USER2KB", - "DOM_VK_XF86XK_USER_PB", - "DOM_VK_XF86XK_UWB", - "DOM_VK_XF86XK_VENDOR_HOME", - "DOM_VK_XF86XK_VIDEO", - "DOM_VK_XF86XK_VIEW", - "DOM_VK_XF86XK_WAKE_UP", - "DOM_VK_XF86XK_WEB_CAM", - "DOM_VK_XF86XK_WHEEL_BUTTON", - "DOM_VK_XF86XK_WLAN", - "DOM_VK_XF86XK_WORD", - "DOM_VK_XF86XK_WWW", - "DOM_VK_XF86XK_XFER", - "DOM_VK_XF86XK_YELLOW", - "DOM_VK_XF86XK_ZOOM_IN", - "DOM_VK_XF86XK_ZOOM_OUT", - "DOM_VK_Y", - "DOM_VK_Z", - "DOM_VK_ZOOM", - "DONE", - "DONT_CARE", - "DOWNLOADING", - "DRAGDROP", - "DRAW_BUFFER0", - "DRAW_BUFFER1", - "DRAW_BUFFER10", - "DRAW_BUFFER11", - "DRAW_BUFFER12", - "DRAW_BUFFER13", - "DRAW_BUFFER14", - "DRAW_BUFFER15", - "DRAW_BUFFER2", - "DRAW_BUFFER3", - "DRAW_BUFFER4", - "DRAW_BUFFER5", - "DRAW_BUFFER6", - "DRAW_BUFFER7", - "DRAW_BUFFER8", - "DRAW_BUFFER9", - "DRAW_FRAMEBUFFER", - "DRAW_FRAMEBUFFER_BINDING", - "DST_ALPHA", - "DST_COLOR", - "DYNAMIC_COPY", - "DYNAMIC_DRAW", - "DYNAMIC_READ", - "DataChannel", - "DataTransfer", - "DataTransferItem", - "DataTransferItemList", - "DataView", - "Date", - "DateTimeFormat", - "DecompressionStream", - "DelayNode", - "DelegatedInkTrailPresenter", - "DeprecationReportBody", - "DesktopNotification", - "DesktopNotificationCenter", - "Details", - "DeviceLightEvent", - "DeviceMotionEvent", - "DeviceMotionEventAcceleration", - "DeviceMotionEventRotationRate", - "DeviceOrientationEvent", - "DeviceProximityEvent", - "DeviceStorage", - "DeviceStorageChangeEvent", - "Directory", - "DisplayNames", - "Document", - "DocumentFragment", - "DocumentPictureInPicture", - "DocumentPictureInPictureEvent", - "DocumentTimeline", - "DocumentType", - "DragEvent", - "DurationFormat", - "DynamicsCompressorNode", - "E", - "ELEMENT_ARRAY_BUFFER", - "ELEMENT_ARRAY_BUFFER_BINDING", - "ELEMENT_NODE", - "EMPTY", - "ENCODING_ERR", - "ENDED", - "END_TO_END", - "END_TO_START", - "ENTITY_NODE", - "ENTITY_REFERENCE_NODE", - "EPSILON", - "EQUAL", - "EQUALPOWER", - "ERROR", - "EXPONENTIAL_DISTANCE", - "EditContext", - "Element", - "ElementInternals", - "ElementQuery", - "EncodedAudioChunk", - "EncodedVideoChunk", - "EnterPictureInPictureEvent", - "Entity", - "EntityReference", - "Error", - "ErrorEvent", - "EvalError", - "Event", - "EventCounts", - "EventException", - "EventSource", - "EventTarget", - "Exception", - "ExtensionContext", - "ExtensionDisabledReason", - "ExtensionInfo", - "ExtensionInstallType", - "ExtensionType", - "External", - "EyeDropper", - "FASTEST", - "FIDOSDK", - "FILTER_ACCEPT", - "FILTER_INTERRUPT", - "FILTER_REJECT", - "FILTER_SKIP", - "FINISHED_STATE", - "FIRST_ORDERED_NODE_TYPE", - "FLOAT", - "FLOAT_32_UNSIGNED_INT_24_8_REV", - "FLOAT_MAT2", - "FLOAT_MAT2x3", - "FLOAT_MAT2x4", - "FLOAT_MAT3", - "FLOAT_MAT3x2", - "FLOAT_MAT3x4", - "FLOAT_MAT4", - "FLOAT_MAT4x2", - "FLOAT_MAT4x3", - "FLOAT_VEC2", - "FLOAT_VEC3", - "FLOAT_VEC4", - "FOCUS", - "FONT_FACE_RULE", - "FONT_FEATURE_VALUES_RULE", - "FRAGMENT", - "FRAGMENT_SHADER", - "FRAGMENT_SHADER_DERIVATIVE_HINT", - "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", - "FRAMEBUFFER", - "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", - "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", - "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", - "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", - "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", - "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", - "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", - "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", - "FRAMEBUFFER_ATTACHMENT_RED_SIZE", - "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", - "FRAMEBUFFER_BINDING", - "FRAMEBUFFER_COMPLETE", - "FRAMEBUFFER_DEFAULT", - "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", - "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", - "FRAMEBUFFER_UNSUPPORTED", - "FRONT", - "FRONT_AND_BACK", - "FRONT_FACE", - "FUNC_ADD", - "FUNC_REVERSE_SUBTRACT", - "FUNC_SUBTRACT", - "FeaturePolicy", - "FeaturePolicyViolationReportBody", - "FederatedCredential", - "Feed", - "FeedEntry", - "Fence", - "FencedFrameConfig", - "File", - "FileError", - "FileList", - "FileReader", - "FileSystem", - "FileSystemDirectoryEntry", - "FileSystemDirectoryHandle", - "FileSystemDirectoryReader", - "FileSystemEntry", - "FileSystemFileEntry", - "FileSystemFileHandle", - "FileSystemHandle", - "FileSystemWritableFileStream", - "FinalizationRegistry", - "FindInPage", - "Float16Array", - "Float32Array", - "Float64Array", - "FocusEvent", - "FontData", - "FontFace", - "FontFaceSet", - "FontFaceSetLoadEvent", - "FormData", - "FormDataEvent", - "FragmentDirective", - "Function", - "GENERATE_MIPMAP_HINT", - "GEQUAL", - "GPU", - "GPUAdapter", - "GPUAdapterInfo", - "GPUBindGroup", - "GPUBindGroupLayout", - "GPUBuffer", - "GPUBufferUsage", - "GPUCanvasContext", - "GPUColorWrite", - "GPUCommandBuffer", - "GPUCommandEncoder", - "GPUCompilationInfo", - "GPUCompilationMessage", - "GPUComputePassEncoder", - "GPUComputePipeline", - "GPUDevice", - "GPUDeviceLostInfo", - "GPUError", - "GPUExternalTexture", - "GPUInternalError", - "GPUMapMode", - "GPUOutOfMemoryError", - "GPUPipelineError", - "GPUPipelineLayout", - "GPUQuerySet", - "GPUQueue", - "GPURenderBundle", - "GPURenderBundleEncoder", - "GPURenderPassEncoder", - "GPURenderPipeline", - "GPUSampler", - "GPUShaderModule", - "GPUShaderStage", - "GPUSupportedFeatures", - "GPUSupportedLimits", - "GPUTexture", - "GPUTextureUsage", - "GPUTextureView", - "GPUUncapturedErrorEvent", - "GPUValidationError", - "GREATER", - "GREEN", - "GREEN_BITS", - "GainNode", - "Gamepad", - "GamepadAxisMoveEvent", - "GamepadButton", - "GamepadButtonEvent", - "GamepadEvent", - "GamepadHapticActuator", - "GamepadPose", - "Geolocation", - "GeolocationCoordinates", - "GeolocationPosition", - "GeolocationPositionError", - "GestureEvent", - "GetInfo", - "Global", - "GravitySensor", - "Gyroscope", - "HALF_FLOAT", - "HAVE_CURRENT_DATA", - "HAVE_ENOUGH_DATA", - "HAVE_FUTURE_DATA", - "HAVE_METADATA", - "HAVE_NOTHING", - "HEADERS_RECEIVED", - "HID", - "HIDConnectionEvent", - "HIDDEN", - "HIDDevice", - "HIDInputReportEvent", - "HIERARCHY_REQUEST_ERR", - "HIGHPASS", - "HIGHSHELF", - "HIGH_FLOAT", - "HIGH_INT", - "HORIZONTAL", - "HORIZONTAL_AXIS", - "HRTF", - "HTMLAllCollection", - "HTMLAnchorElement", - "HTMLAppletElement", - "HTMLAreaElement", - "HTMLAudioElement", - "HTMLBRElement", - "HTMLBaseElement", - "HTMLBaseFontElement", - "HTMLBlockquoteElement", - "HTMLBodyElement", - "HTMLButtonElement", - "HTMLCanvasElement", - "HTMLCollection", - "HTMLCommandElement", - "HTMLContentElement", - "HTMLDListElement", - "HTMLDataElement", - "HTMLDataListElement", - "HTMLDetailsElement", - "HTMLDialogElement", - "HTMLDirectoryElement", - "HTMLDivElement", - "HTMLDocument", - "HTMLElement", - "HTMLEmbedElement", - "HTMLFencedFrameElement", - "HTMLFieldSetElement", - "HTMLFontElement", - "HTMLFormControlsCollection", - "HTMLFormElement", - "HTMLFrameElement", - "HTMLFrameSetElement", - "HTMLHRElement", - "HTMLHeadElement", - "HTMLHeadingElement", - "HTMLHtmlElement", - "HTMLIFrameElement", - "HTMLImageElement", - "HTMLInputElement", - "HTMLIsIndexElement", - "HTMLKeygenElement", - "HTMLLIElement", - "HTMLLabelElement", - "HTMLLegendElement", - "HTMLLinkElement", - "HTMLMapElement", - "HTMLMarqueeElement", - "HTMLMediaElement", - "HTMLMenuElement", - "HTMLMenuItemElement", - "HTMLMetaElement", - "HTMLMeterElement", - "HTMLModElement", - "HTMLOListElement", - "HTMLObjectElement", - "HTMLOptGroupElement", - "HTMLOptionElement", - "HTMLOptionsCollection", - "HTMLOutputElement", - "HTMLParagraphElement", - "HTMLParamElement", - "HTMLPictureElement", - "HTMLPreElement", - "HTMLProgressElement", - "HTMLPropertiesCollection", - "HTMLQuoteElement", - "HTMLScriptElement", - "HTMLSelectElement", - "HTMLShadowElement", - "HTMLSlotElement", - "HTMLSourceElement", - "HTMLSpanElement", - "HTMLStyleElement", - "HTMLTableCaptionElement", - "HTMLTableCellElement", - "HTMLTableColElement", - "HTMLTableElement", - "HTMLTableRowElement", - "HTMLTableSectionElement", - "HTMLTemplateElement", - "HTMLTextAreaElement", - "HTMLTimeElement", - "HTMLTitleElement", - "HTMLTrackElement", - "HTMLUListElement", - "HTMLUnknownElement", - "HTMLVideoElement", - "HashChangeEvent", - "Headers", - "Highlight", - "HighlightRegistry", - "History", - "Hz", - "ICE_CHECKING", - "ICE_CLOSED", - "ICE_COMPLETED", - "ICE_CONNECTED", - "ICE_FAILED", - "ICE_GATHERING", - "ICE_WAITING", - "IDBCursor", - "IDBCursorWithValue", - "IDBDatabase", - "IDBDatabaseException", - "IDBFactory", - "IDBFileHandle", - "IDBFileRequest", - "IDBIndex", - "IDBKeyRange", - "IDBMutableFile", - "IDBObjectStore", - "IDBOpenDBRequest", - "IDBRequest", - "IDBTransaction", - "IDBVersionChangeEvent", - "IDLE", - "IIRFilterNode", - "IMPLEMENTATION_COLOR_READ_FORMAT", - "IMPLEMENTATION_COLOR_READ_TYPE", - "IMPORT_RULE", - "INCR", - "INCR_WRAP", - "INDEX", - "INDEX_SIZE_ERR", - "INDIRECT", - "INT", - "INTERLEAVED_ATTRIBS", - "INT_2_10_10_10_REV", - "INT_SAMPLER_2D", - "INT_SAMPLER_2D_ARRAY", - "INT_SAMPLER_3D", - "INT_SAMPLER_CUBE", - "INT_VEC2", - "INT_VEC3", - "INT_VEC4", - "INUSE_ATTRIBUTE_ERR", - "INVALID_ACCESS_ERR", - "INVALID_CHARACTER_ERR", - "INVALID_ENUM", - "INVALID_EXPRESSION_ERR", - "INVALID_FRAMEBUFFER_OPERATION", - "INVALID_INDEX", - "INVALID_MODIFICATION_ERR", - "INVALID_NODE_TYPE_ERR", - "INVALID_OPERATION", - "INVALID_STATE_ERR", - "INVALID_VALUE", - "INVERSE_DISTANCE", - "INVERT", - "IceCandidate", - "IconInfo", - "IdentityCredential", - "IdentityCredentialError", - "IdentityProvider", - "IdleDeadline", - "IdleDetector", - "Image", - "ImageBitmap", - "ImageBitmapRenderingContext", - "ImageCapture", - "ImageData", - "ImageDataType", - "ImageDecoder", - "ImageTrack", - "ImageTrackList", - "Infinity", - "Ink", - "InputDeviceCapabilities", - "InputDeviceInfo", - "InputEvent", - "InputMethodContext", - "InstallTrigger", - "InstallTriggerImpl", - "Instance", - "Int16Array", - "Int32Array", - "Int8Array", - "Intent", - "InternalError", - "IntersectionObserver", - "IntersectionObserverEntry", - "Intl", - "IsSearchProviderInstalled", - "Iterator", - "JSON", - "JSTag", - "KEEP", - "KEYDOWN", - "KEYFRAMES_RULE", - "KEYFRAME_RULE", - "KEYPRESS", - "KEYUP", - "KeyEvent", - "Keyboard", - "KeyboardEvent", - "KeyboardLayoutMap", - "KeyframeEffect", - "LENGTHADJUST_SPACING", - "LENGTHADJUST_SPACINGANDGLYPHS", - "LENGTHADJUST_UNKNOWN", - "LEQUAL", - "LESS", - "LINEAR", - "LINEAR_DISTANCE", - "LINEAR_MIPMAP_LINEAR", - "LINEAR_MIPMAP_NEAREST", - "LINES", - "LINE_LOOP", - "LINE_STRIP", - "LINE_WIDTH", - "LINK_STATUS", - "LIVE", - "LN10", - "LN2", - "LOADED", - "LOADING", - "LOG10E", - "LOG2E", - "LOWPASS", - "LOWSHELF", - "LOW_FLOAT", - "LOW_INT", - "LSException", - "LSParserFilter", - "LUMINANCE", - "LUMINANCE_ALPHA", - "LanguageCode", - "LargestContentfulPaint", - "LaunchParams", - "LaunchQueue", - "LaunchType", - "LayoutShift", - "LayoutShiftAttribution", - "LinearAccelerationSensor", - "LinkError", - "ListFormat", - "LocalMediaStream", - "Locale", - "Location", - "Lock", - "LockManager", - "MAP_READ", - "MAP_WRITE", - "MARGIN_RULE", - "MAX", - "MAX_3D_TEXTURE_SIZE", - "MAX_ARRAY_TEXTURE_LAYERS", - "MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND", - "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", - "MAX_COLOR_ATTACHMENTS", - "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_COMBINED_TEXTURE_IMAGE_UNITS", - "MAX_COMBINED_UNIFORM_BLOCKS", - "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", - "MAX_CUBE_MAP_TEXTURE_SIZE", - "MAX_DRAW_BUFFERS", - "MAX_ELEMENTS_INDICES", - "MAX_ELEMENTS_VERTICES", - "MAX_ELEMENT_INDEX", - "MAX_FRAGMENT_INPUT_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_BLOCKS", - "MAX_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_VECTORS", - "MAX_PROGRAM_TEXEL_OFFSET", - "MAX_RENDERBUFFER_SIZE", - "MAX_SAFE_INTEGER", - "MAX_SAMPLES", - "MAX_SERVER_WAIT_TIMEOUT", - "MAX_TEXTURE_IMAGE_UNITS", - "MAX_TEXTURE_LOD_BIAS", - "MAX_TEXTURE_MAX_ANISOTROPY_EXT", - "MAX_TEXTURE_SIZE", - "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", - "MAX_UNIFORM_BLOCK_SIZE", - "MAX_UNIFORM_BUFFER_BINDINGS", - "MAX_VALUE", - "MAX_VARYING_COMPONENTS", - "MAX_VARYING_VECTORS", - "MAX_VERTEX_ATTRIBS", - "MAX_VERTEX_OUTPUT_COMPONENTS", - "MAX_VERTEX_TEXTURE_IMAGE_UNITS", - "MAX_VERTEX_UNIFORM_BLOCKS", - "MAX_VERTEX_UNIFORM_COMPONENTS", - "MAX_VERTEX_UNIFORM_VECTORS", - "MAX_VIEWPORT_DIMS", - "MEDIA_ERR_ABORTED", - "MEDIA_ERR_DECODE", - "MEDIA_ERR_ENCRYPTED", - "MEDIA_ERR_NETWORK", - "MEDIA_ERR_SRC_NOT_SUPPORTED", - "MEDIA_KEYERR_CLIENT", - "MEDIA_KEYERR_DOMAIN", - "MEDIA_KEYERR_HARDWARECHANGE", - "MEDIA_KEYERR_OUTPUT", - "MEDIA_KEYERR_SERVICE", - "MEDIA_KEYERR_UNKNOWN", - "MEDIA_RULE", - "MEDIUM_FLOAT", - "MEDIUM_INT", - "META_MASK", - "MIDIAccess", - "MIDIConnectionEvent", - "MIDIInput", - "MIDIInputMap", - "MIDIMessageEvent", - "MIDIOutput", - "MIDIOutputMap", - "MIDIPort", - "MIN", - "MIN_PROGRAM_TEXEL_OFFSET", - "MIN_SAFE_INTEGER", - "MIN_VALUE", - "MIRRORED_REPEAT", - "MODE_ASYNCHRONOUS", - "MODE_SYNCHRONOUS", - "MODIFICATION", - "MOUSEDOWN", - "MOUSEDRAG", - "MOUSEMOVE", - "MOUSEOUT", - "MOUSEOVER", - "MOUSEUP", - "MOZ_KEYFRAMES_RULE", - "MOZ_KEYFRAME_RULE", - "MOZ_SOURCE_CURSOR", - "MOZ_SOURCE_ERASER", - "MOZ_SOURCE_KEYBOARD", - "MOZ_SOURCE_MOUSE", - "MOZ_SOURCE_PEN", - "MOZ_SOURCE_TOUCH", - "MOZ_SOURCE_UNKNOWN", - "MSGESTURE_FLAG_BEGIN", - "MSGESTURE_FLAG_CANCEL", - "MSGESTURE_FLAG_END", - "MSGESTURE_FLAG_INERTIA", - "MSGESTURE_FLAG_NONE", - "MSPOINTER_TYPE_MOUSE", - "MSPOINTER_TYPE_PEN", - "MSPOINTER_TYPE_TOUCH", - "MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE", - "MS_ASYNC_CALLBACK_STATUS_CANCEL", - "MS_ASYNC_CALLBACK_STATUS_CHOOSEANY", - "MS_ASYNC_CALLBACK_STATUS_ERROR", - "MS_ASYNC_CALLBACK_STATUS_JOIN", - "MS_ASYNC_OP_STATUS_CANCELED", - "MS_ASYNC_OP_STATUS_ERROR", - "MS_ASYNC_OP_STATUS_SUCCESS", - "MS_MANIPULATION_STATE_ACTIVE", - "MS_MANIPULATION_STATE_CANCELLED", - "MS_MANIPULATION_STATE_COMMITTED", - "MS_MANIPULATION_STATE_DRAGGING", - "MS_MANIPULATION_STATE_INERTIA", - "MS_MANIPULATION_STATE_PRESELECT", - "MS_MANIPULATION_STATE_SELECTING", - "MS_MANIPULATION_STATE_STOPPED", - "MS_MEDIA_ERR_ENCRYPTED", - "MS_MEDIA_KEYERR_CLIENT", - "MS_MEDIA_KEYERR_DOMAIN", - "MS_MEDIA_KEYERR_HARDWARECHANGE", - "MS_MEDIA_KEYERR_OUTPUT", - "MS_MEDIA_KEYERR_SERVICE", - "MS_MEDIA_KEYERR_UNKNOWN", - "Map", - "Math", - "MathMLElement", - "MediaCapabilities", - "MediaCapabilitiesInfo", - "MediaController", - "MediaDeviceInfo", - "MediaDevices", - "MediaElementAudioSourceNode", - "MediaEncryptedEvent", - "MediaError", - "MediaKeyError", - "MediaKeyEvent", - "MediaKeyMessageEvent", - "MediaKeyNeededEvent", - "MediaKeySession", - "MediaKeyStatusMap", - "MediaKeySystemAccess", - "MediaKeys", - "MediaList", - "MediaMetadata", - "MediaQueryList", - "MediaQueryListEvent", - "MediaRecorder", - "MediaRecorderErrorEvent", - "MediaSession", - "MediaSettingsRange", - "MediaSource", - "MediaSourceHandle", - "MediaStream", - "MediaStreamAudioDestinationNode", - "MediaStreamAudioSourceNode", - "MediaStreamEvent", - "MediaStreamTrack", - "MediaStreamTrackAudioSourceNode", - "MediaStreamTrackAudioStats", - "MediaStreamTrackEvent", - "MediaStreamTrackGenerator", - "MediaStreamTrackProcessor", - "MediaStreamTrackVideoStats", - "Memory", - "MessageChannel", - "MessageEvent", - "MessagePort", - "MessageSender", - "Methods", - "MimeType", - "MimeTypeArray", - "Module", - "MouseEvent", - "MouseScrollEvent", - "MozAnimation", - "MozAnimationDelay", - "MozAnimationDirection", - "MozAnimationDuration", - "MozAnimationFillMode", - "MozAnimationIterationCount", - "MozAnimationName", - "MozAnimationPlayState", - "MozAnimationTimingFunction", - "MozAppearance", - "MozBackfaceVisibility", - "MozBinding", - "MozBorderBottomColors", - "MozBorderEnd", - "MozBorderEndColor", - "MozBorderEndStyle", - "MozBorderEndWidth", - "MozBorderImage", - "MozBorderLeftColors", - "MozBorderRightColors", - "MozBorderStart", - "MozBorderStartColor", - "MozBorderStartStyle", - "MozBorderStartWidth", - "MozBorderTopColors", - "MozBoxAlign", - "MozBoxDirection", - "MozBoxFlex", - "MozBoxOrdinalGroup", - "MozBoxOrient", - "MozBoxPack", - "MozBoxSizing", - "MozCSSKeyframeRule", - "MozCSSKeyframesRule", - "MozColumnCount", - "MozColumnFill", - "MozColumnGap", - "MozColumnRule", - "MozColumnRuleColor", - "MozColumnRuleStyle", - "MozColumnRuleWidth", - "MozColumnWidth", - "MozColumns", - "MozContactChangeEvent", - "MozFloatEdge", - "MozFontFeatureSettings", - "MozFontLanguageOverride", - "MozForceBrokenImageIcon", - "MozHyphens", - "MozImageRegion", - "MozMarginEnd", - "MozMarginStart", - "MozMmsEvent", - "MozMmsMessage", - "MozMobileMessageThread", - "MozOSXFontSmoothing", - "MozOrient", - "MozOsxFontSmoothing", - "MozOutlineRadius", - "MozOutlineRadiusBottomleft", - "MozOutlineRadiusBottomright", - "MozOutlineRadiusTopleft", - "MozOutlineRadiusTopright", - "MozPaddingEnd", - "MozPaddingStart", - "MozPerspective", - "MozPerspectiveOrigin", - "MozPowerManager", - "MozSettingsEvent", - "MozSmsEvent", - "MozSmsMessage", - "MozStackSizing", - "MozTabSize", - "MozTextAlignLast", - "MozTextDecorationColor", - "MozTextDecorationLine", - "MozTextDecorationStyle", - "MozTextSizeAdjust", - "MozTransform", - "MozTransformOrigin", - "MozTransformStyle", - "MozTransition", - "MozTransitionDelay", - "MozTransitionDuration", - "MozTransitionProperty", - "MozTransitionTimingFunction", - "MozUserFocus", - "MozUserInput", - "MozUserModify", - "MozUserSelect", - "MozWindowDragging", - "MozWindowShadow", - "MutationEvent", - "MutationObserver", - "MutationRecord", - "MutedInfo", - "MutedInfoReason", - "NAMESPACE_ERR", - "NAMESPACE_RULE", - "NEAREST", - "NEAREST_MIPMAP_LINEAR", - "NEAREST_MIPMAP_NEAREST", - "NEGATIVE_INFINITY", - "NETWORK_EMPTY", - "NETWORK_ERR", - "NETWORK_IDLE", - "NETWORK_LOADED", - "NETWORK_LOADING", - "NETWORK_NO_SOURCE", - "NEVER", - "NEW", - "NEXT", - "NEXT_NO_DUPLICATE", - "NICEST", - "NODE_AFTER", - "NODE_BEFORE", - "NODE_BEFORE_AND_AFTER", - "NODE_INSIDE", - "NONE", - "NON_TRANSIENT_ERR", - "NOTATION_NODE", - "NOTCH", - "NOTEQUAL", - "NOT_ALLOWED_ERR", - "NOT_FOUND_ERR", - "NOT_READABLE_ERR", - "NOT_SUPPORTED_ERR", - "NO_DATA_ALLOWED_ERR", - "NO_ERR", - "NO_ERROR", - "NO_MODIFICATION_ALLOWED_ERR", - "NUMBER_TYPE", - "NUM_COMPRESSED_TEXTURE_FORMATS", - "NaN", - "NamedNodeMap", - "NavigateEvent", - "Navigation", - "NavigationActivation", - "NavigationCurrentEntryChangeEvent", - "NavigationDestination", - "NavigationHistoryEntry", - "NavigationPreloadManager", - "NavigationTransition", - "Navigator", - "NavigatorLogin", - "NavigatorManagedData", - "NavigatorUAData", - "NearbyLinks", - "NetworkInformation", - "Node", - "NodeFilter", - "NodeIterator", - "NodeList", - "NotRestoredReasonDetails", - "NotRestoredReasons", - "Notation", - "Notification", - "NotifyPaintEvent", - "Number", - "NumberFormat", - "OBJECT_TYPE", - "OBSOLETE", - "OK", - "ONE", - "ONE_MINUS_CONSTANT_ALPHA", - "ONE_MINUS_CONSTANT_COLOR", - "ONE_MINUS_DST_ALPHA", - "ONE_MINUS_DST_COLOR", - "ONE_MINUS_SRC_ALPHA", - "ONE_MINUS_SRC_COLOR", - "OPEN", - "OPENED", - "OPENING", - "ORDERED_NODE_ITERATOR_TYPE", - "ORDERED_NODE_SNAPSHOT_TYPE", - "OTHER_ERROR", - "OTPCredential", - "OUT_OF_MEMORY", - "Object", - "OfflineAudioCompletionEvent", - "OfflineAudioContext", - "OfflineResourceList", - "OffscreenCanvas", - "OffscreenCanvasRenderingContext2D", - "OnClickData", - "OnInstalledReason", - "OnPerformanceWarningCategory", - "OnPerformanceWarningSeverity", - "OnRestartRequiredReason", - "Option", - "OrientationSensor", - "OscillatorNode", - "OverconstrainedError", - "OverflowEvent", - "PACK_ALIGNMENT", - "PACK_ROW_LENGTH", - "PACK_SKIP_PIXELS", - "PACK_SKIP_ROWS", - "PAGE_RULE", - "PARSE_ERR", - "PATHSEG_ARC_ABS", - "PATHSEG_ARC_REL", - "PATHSEG_CLOSEPATH", - "PATHSEG_CURVETO_CUBIC_ABS", - "PATHSEG_CURVETO_CUBIC_REL", - "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", - "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", - "PATHSEG_CURVETO_QUADRATIC_ABS", - "PATHSEG_CURVETO_QUADRATIC_REL", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", - "PATHSEG_LINETO_ABS", - "PATHSEG_LINETO_HORIZONTAL_ABS", - "PATHSEG_LINETO_HORIZONTAL_REL", - "PATHSEG_LINETO_REL", - "PATHSEG_LINETO_VERTICAL_ABS", - "PATHSEG_LINETO_VERTICAL_REL", - "PATHSEG_MOVETO_ABS", - "PATHSEG_MOVETO_REL", - "PATHSEG_UNKNOWN", - "PATH_EXISTS_ERR", - "PEAKING", - "PERMISSION_DENIED", - "PERSISTENT", - "PI", - "PIXEL_PACK_BUFFER", - "PIXEL_PACK_BUFFER_BINDING", - "PIXEL_UNPACK_BUFFER", - "PIXEL_UNPACK_BUFFER_BINDING", - "PLAYING_STATE", - "POINTS", - "POLYGON_OFFSET_FACTOR", - "POLYGON_OFFSET_FILL", - "POLYGON_OFFSET_UNITS", - "POSITION_UNAVAILABLE", - "POSITIVE_INFINITY", - "PREV", - "PREV_NO_DUPLICATE", - "PROCESSING_INSTRUCTION_NODE", - "PageChangeEvent", - "PageRevealEvent", - "PageSettings", - "PageSwapEvent", - "PageTransitionEvent", - "PaintRequest", - "PaintRequestList", - "PannerNode", - "PasswordCredential", - "Path2D", - "PaymentAddress", - "PaymentInstruments", - "PaymentManager", - "PaymentMethodChangeEvent", - "PaymentRequest", - "PaymentRequestUpdateEvent", - "PaymentResponse", - "Performance", - "PerformanceElementTiming", - "PerformanceEntry", - "PerformanceEventTiming", - "PerformanceLongAnimationFrameTiming", - "PerformanceLongTaskTiming", - "PerformanceMark", - "PerformanceMeasure", - "PerformanceNavigation", - "PerformanceNavigationTiming", - "PerformanceObserver", - "PerformanceObserverEntryList", - "PerformancePaintTiming", - "PerformanceResourceTiming", - "PerformanceScriptTiming", - "PerformanceServerTiming", - "PerformanceTiming", - "PeriodicSyncManager", - "PeriodicWave", - "PermissionStatus", - "Permissions", - "PhotoCapabilities", - "PictureInPictureEvent", - "PictureInPictureWindow", - "PlatformArch", - "PlatformInfo", - "PlatformNaclArch", - "PlatformOs", - "Plugin", - "PluginArray", - "PluralRules", - "PointerEvent", - "PopStateEvent", - "PopupBlockedEvent", - "Port", - "Presentation", - "PresentationAvailability", - "PresentationConnection", - "PresentationConnectionAvailableEvent", - "PresentationConnectionCloseEvent", - "PresentationConnectionList", - "PresentationReceiver", - "PresentationRequest", - "PressureObserver", - "PressureRecord", - "ProcessingInstruction", - "Profiler", - "ProgressEvent", - "Promise", - "PromiseRejectionEvent", - "PropertyNodeList", - "ProtectedAudience", - "Proxy", - "PublicKeyCredential", - "PushManager", - "PushSubscription", - "PushSubscriptionOptions", - "Q", - "QUERY_RESOLVE", - "QUERY_RESULT", - "QUERY_RESULT_AVAILABLE", - "QUOTA_ERR", - "QUOTA_EXCEEDED_ERR", - "QueryInterface", - "R11F_G11F_B10F", - "R16F", - "R16I", - "R16UI", - "R32F", - "R32I", - "R32UI", - "R8", - "R8I", - "R8UI", - "R8_SNORM", - "RASTERIZER_DISCARD", - "READ", - "READ_BUFFER", - "READ_FRAMEBUFFER", - "READ_FRAMEBUFFER_BINDING", - "READ_ONLY", - "READ_ONLY_ERR", - "READ_WRITE", - "RED", - "RED_BITS", - "RED_INTEGER", - "REMOVAL", - "RENDERBUFFER", - "RENDERBUFFER_ALPHA_SIZE", - "RENDERBUFFER_BINDING", - "RENDERBUFFER_BLUE_SIZE", - "RENDERBUFFER_DEPTH_SIZE", - "RENDERBUFFER_GREEN_SIZE", - "RENDERBUFFER_HEIGHT", - "RENDERBUFFER_INTERNAL_FORMAT", - "RENDERBUFFER_RED_SIZE", - "RENDERBUFFER_SAMPLES", - "RENDERBUFFER_STENCIL_SIZE", - "RENDERBUFFER_WIDTH", - "RENDERER", - "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", - "RENDERING_INTENT_AUTO", - "RENDERING_INTENT_PERCEPTUAL", - "RENDERING_INTENT_RELATIVE_COLORIMETRIC", - "RENDERING_INTENT_SATURATION", - "RENDERING_INTENT_UNKNOWN", - "RENDER_ATTACHMENT", - "REPEAT", - "REPLACE", - "RG", - "RG16F", - "RG16I", - "RG16UI", - "RG32F", - "RG32I", - "RG32UI", - "RG8", - "RG8I", - "RG8UI", - "RG8_SNORM", - "RGB", - "RGB10_A2", - "RGB10_A2UI", - "RGB16F", - "RGB16I", - "RGB16UI", - "RGB32F", - "RGB32I", - "RGB32UI", - "RGB565", - "RGB5_A1", - "RGB8", - "RGB8I", - "RGB8UI", - "RGB8_SNORM", - "RGB9_E5", - "RGBA", - "RGBA16F", - "RGBA16I", - "RGBA16UI", - "RGBA32F", - "RGBA32I", - "RGBA32UI", - "RGBA4", - "RGBA8", - "RGBA8I", - "RGBA8UI", - "RGBA8_SNORM", - "RGBA_INTEGER", - "RGBColor", - "RGB_INTEGER", - "RG_INTEGER", - "ROTATION_CLOCKWISE", - "ROTATION_COUNTERCLOCKWISE", - "RTCCertificate", - "RTCDTMFSender", - "RTCDTMFToneChangeEvent", - "RTCDataChannel", - "RTCDataChannelEvent", - "RTCDtlsTransport", - "RTCEncodedAudioFrame", - "RTCEncodedVideoFrame", - "RTCError", - "RTCErrorEvent", - "RTCIceCandidate", - "RTCIceTransport", - "RTCPeerConnection", - "RTCPeerConnectionIceErrorEvent", - "RTCPeerConnectionIceEvent", - "RTCRtpReceiver", - "RTCRtpScriptTransform", - "RTCRtpSender", - "RTCRtpTransceiver", - "RTCSctpTransport", - "RTCSessionDescription", - "RTCStatsReport", - "RTCTrackEvent", - "RadioNodeList", - "Range", - "RangeError", - "RangeException", - "ReadableByteStreamController", - "ReadableStream", - "ReadableStreamBYOBReader", - "ReadableStreamBYOBRequest", - "ReadableStreamDefaultController", - "ReadableStreamDefaultReader", - "RecordErrorEvent", - "Rect", - "ReferenceError", - "Reflect", - "RegExp", - "RelativeOrientationSensor", - "RelativeTimeFormat", - "RemotePlayback", - "Report", - "ReportBody", - "ReportingObserver", - "Request", - "RequestUpdateCheckStatus", - "ResizeObserver", - "ResizeObserverEntry", - "ResizeObserverSize", - "Response", - "RuntimeError", - "SAMPLER_2D", - "SAMPLER_2D_ARRAY", - "SAMPLER_2D_ARRAY_SHADOW", - "SAMPLER_2D_SHADOW", - "SAMPLER_3D", - "SAMPLER_BINDING", - "SAMPLER_CUBE", - "SAMPLER_CUBE_SHADOW", - "SAMPLES", - "SAMPLE_ALPHA_TO_COVERAGE", - "SAMPLE_BUFFERS", - "SAMPLE_COVERAGE", - "SAMPLE_COVERAGE_INVERT", - "SAMPLE_COVERAGE_VALUE", - "SAWTOOTH", - "SCHEDULED_STATE", - "SCISSOR_BOX", - "SCISSOR_TEST", - "SCROLL_PAGE_DOWN", - "SCROLL_PAGE_UP", - "SDP_ANSWER", - "SDP_OFFER", - "SDP_PRANSWER", - "SECURITY_ERR", - "SELECT", - "SEPARATE_ATTRIBS", - "SERIALIZE_ERR", - "SEVERITY_ERROR", - "SEVERITY_FATAL_ERROR", - "SEVERITY_WARNING", - "SHADER_COMPILER", - "SHADER_TYPE", - "SHADING_LANGUAGE_VERSION", - "SHIFT_MASK", - "SHORT", - "SHOWING", - "SHOW_ALL", - "SHOW_ATTRIBUTE", - "SHOW_CDATA_SECTION", - "SHOW_COMMENT", - "SHOW_DOCUMENT", - "SHOW_DOCUMENT_FRAGMENT", - "SHOW_DOCUMENT_TYPE", - "SHOW_ELEMENT", - "SHOW_ENTITY", - "SHOW_ENTITY_REFERENCE", - "SHOW_NOTATION", - "SHOW_PROCESSING_INSTRUCTION", - "SHOW_TEXT", - "SIGNALED", - "SIGNED_NORMALIZED", - "SINE", - "SOUNDFIELD", - "SQLException", - "SQRT1_2", - "SQRT2", - "SQUARE", - "SRC_ALPHA", - "SRC_ALPHA_SATURATE", - "SRC_COLOR", - "SRGB", - "SRGB8", - "SRGB8_ALPHA8", - "START_TO_END", - "START_TO_START", - "STATIC_COPY", - "STATIC_DRAW", - "STATIC_READ", - "STENCIL", - "STENCIL_ATTACHMENT", - "STENCIL_BACK_FAIL", - "STENCIL_BACK_FUNC", - "STENCIL_BACK_PASS_DEPTH_FAIL", - "STENCIL_BACK_PASS_DEPTH_PASS", - "STENCIL_BACK_REF", - "STENCIL_BACK_VALUE_MASK", - "STENCIL_BACK_WRITEMASK", - "STENCIL_BITS", - "STENCIL_BUFFER_BIT", - "STENCIL_CLEAR_VALUE", - "STENCIL_FAIL", - "STENCIL_FUNC", - "STENCIL_INDEX", - "STENCIL_INDEX8", - "STENCIL_PASS_DEPTH_FAIL", - "STENCIL_PASS_DEPTH_PASS", - "STENCIL_REF", - "STENCIL_TEST", - "STENCIL_VALUE_MASK", - "STENCIL_WRITEMASK", - "STORAGE", - "STORAGE_BINDING", - "STREAM_COPY", - "STREAM_DRAW", - "STREAM_READ", - "STRING_TYPE", - "STYLE_RULE", - "SUBPIXEL_BITS", - "SUPPORTS_RULE", - "SVGAElement", - "SVGAltGlyphDefElement", - "SVGAltGlyphElement", - "SVGAltGlyphItemElement", - "SVGAngle", - "SVGAnimateColorElement", - "SVGAnimateElement", - "SVGAnimateMotionElement", - "SVGAnimateTransformElement", - "SVGAnimatedAngle", - "SVGAnimatedBoolean", - "SVGAnimatedEnumeration", - "SVGAnimatedInteger", - "SVGAnimatedLength", - "SVGAnimatedLengthList", - "SVGAnimatedNumber", - "SVGAnimatedNumberList", - "SVGAnimatedPreserveAspectRatio", - "SVGAnimatedRect", - "SVGAnimatedString", - "SVGAnimatedTransformList", - "SVGAnimationElement", - "SVGCircleElement", - "SVGClipPathElement", - "SVGColor", - "SVGComponentTransferFunctionElement", - "SVGCursorElement", - "SVGDefsElement", - "SVGDescElement", - "SVGDiscardElement", - "SVGDocument", - "SVGElement", - "SVGElementInstance", - "SVGElementInstanceList", - "SVGEllipseElement", - "SVGException", - "SVGFEBlendElement", - "SVGFEColorMatrixElement", - "SVGFEComponentTransferElement", - "SVGFECompositeElement", - "SVGFEConvolveMatrixElement", - "SVGFEDiffuseLightingElement", - "SVGFEDisplacementMapElement", - "SVGFEDistantLightElement", - "SVGFEDropShadowElement", - "SVGFEFloodElement", - "SVGFEFuncAElement", - "SVGFEFuncBElement", - "SVGFEFuncGElement", - "SVGFEFuncRElement", - "SVGFEGaussianBlurElement", - "SVGFEImageElement", - "SVGFEMergeElement", - "SVGFEMergeNodeElement", - "SVGFEMorphologyElement", - "SVGFEOffsetElement", - "SVGFEPointLightElement", - "SVGFESpecularLightingElement", - "SVGFESpotLightElement", - "SVGFETileElement", - "SVGFETurbulenceElement", - "SVGFilterElement", - "SVGFontElement", - "SVGFontFaceElement", - "SVGFontFaceFormatElement", - "SVGFontFaceNameElement", - "SVGFontFaceSrcElement", - "SVGFontFaceUriElement", - "SVGForeignObjectElement", - "SVGGElement", - "SVGGeometryElement", - "SVGGlyphElement", - "SVGGlyphRefElement", - "SVGGradientElement", - "SVGGraphicsElement", - "SVGHKernElement", - "SVGImageElement", - "SVGLength", - "SVGLengthList", - "SVGLineElement", - "SVGLinearGradientElement", - "SVGMPathElement", - "SVGMarkerElement", - "SVGMaskElement", - "SVGMatrix", - "SVGMetadataElement", - "SVGMissingGlyphElement", - "SVGNumber", - "SVGNumberList", - "SVGPaint", - "SVGPathElement", - "SVGPathSeg", - "SVGPathSegArcAbs", - "SVGPathSegArcRel", - "SVGPathSegClosePath", - "SVGPathSegCurvetoCubicAbs", - "SVGPathSegCurvetoCubicRel", - "SVGPathSegCurvetoCubicSmoothAbs", - "SVGPathSegCurvetoCubicSmoothRel", - "SVGPathSegCurvetoQuadraticAbs", - "SVGPathSegCurvetoQuadraticRel", - "SVGPathSegCurvetoQuadraticSmoothAbs", - "SVGPathSegCurvetoQuadraticSmoothRel", - "SVGPathSegLinetoAbs", - "SVGPathSegLinetoHorizontalAbs", - "SVGPathSegLinetoHorizontalRel", - "SVGPathSegLinetoRel", - "SVGPathSegLinetoVerticalAbs", - "SVGPathSegLinetoVerticalRel", - "SVGPathSegList", - "SVGPathSegMovetoAbs", - "SVGPathSegMovetoRel", - "SVGPatternElement", - "SVGPoint", - "SVGPointList", - "SVGPolygonElement", - "SVGPolylineElement", - "SVGPreserveAspectRatio", - "SVGRadialGradientElement", - "SVGRect", - "SVGRectElement", - "SVGRenderingIntent", - "SVGSVGElement", - "SVGScriptElement", - "SVGSetElement", - "SVGStopElement", - "SVGStringList", - "SVGStyleElement", - "SVGSwitchElement", - "SVGSymbolElement", - "SVGTRefElement", - "SVGTSpanElement", - "SVGTextContentElement", - "SVGTextElement", - "SVGTextPathElement", - "SVGTextPositioningElement", - "SVGTitleElement", - "SVGTransform", - "SVGTransformList", - "SVGUnitTypes", - "SVGUseElement", - "SVGVKernElement", - "SVGViewElement", - "SVGViewSpec", - "SVGZoomAndPan", - "SVGZoomEvent", - "SVG_ANGLETYPE_DEG", - "SVG_ANGLETYPE_GRAD", - "SVG_ANGLETYPE_RAD", - "SVG_ANGLETYPE_UNKNOWN", - "SVG_ANGLETYPE_UNSPECIFIED", - "SVG_CHANNEL_A", - "SVG_CHANNEL_B", - "SVG_CHANNEL_G", - "SVG_CHANNEL_R", - "SVG_CHANNEL_UNKNOWN", - "SVG_COLORTYPE_CURRENTCOLOR", - "SVG_COLORTYPE_RGBCOLOR", - "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", - "SVG_COLORTYPE_UNKNOWN", - "SVG_EDGEMODE_DUPLICATE", - "SVG_EDGEMODE_NONE", - "SVG_EDGEMODE_UNKNOWN", - "SVG_EDGEMODE_WRAP", - "SVG_FEBLEND_MODE_COLOR", - "SVG_FEBLEND_MODE_COLOR_BURN", - "SVG_FEBLEND_MODE_COLOR_DODGE", - "SVG_FEBLEND_MODE_DARKEN", - "SVG_FEBLEND_MODE_DIFFERENCE", - "SVG_FEBLEND_MODE_EXCLUSION", - "SVG_FEBLEND_MODE_HARD_LIGHT", - "SVG_FEBLEND_MODE_HUE", - "SVG_FEBLEND_MODE_LIGHTEN", - "SVG_FEBLEND_MODE_LUMINOSITY", - "SVG_FEBLEND_MODE_MULTIPLY", - "SVG_FEBLEND_MODE_NORMAL", - "SVG_FEBLEND_MODE_OVERLAY", - "SVG_FEBLEND_MODE_SATURATION", - "SVG_FEBLEND_MODE_SCREEN", - "SVG_FEBLEND_MODE_SOFT_LIGHT", - "SVG_FEBLEND_MODE_UNKNOWN", - "SVG_FECOLORMATRIX_TYPE_HUEROTATE", - "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", - "SVG_FECOLORMATRIX_TYPE_MATRIX", - "SVG_FECOLORMATRIX_TYPE_SATURATE", - "SVG_FECOLORMATRIX_TYPE_UNKNOWN", - "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", - "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", - "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", - "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", - "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", - "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", - "SVG_FECOMPOSITE_OPERATOR_ATOP", - "SVG_FECOMPOSITE_OPERATOR_IN", - "SVG_FECOMPOSITE_OPERATOR_LIGHTER", - "SVG_FECOMPOSITE_OPERATOR_OUT", - "SVG_FECOMPOSITE_OPERATOR_OVER", - "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_XOR", - "SVG_INVALID_VALUE_ERR", - "SVG_LENGTHTYPE_CM", - "SVG_LENGTHTYPE_EMS", - "SVG_LENGTHTYPE_EXS", - "SVG_LENGTHTYPE_IN", - "SVG_LENGTHTYPE_MM", - "SVG_LENGTHTYPE_NUMBER", - "SVG_LENGTHTYPE_PC", - "SVG_LENGTHTYPE_PERCENTAGE", - "SVG_LENGTHTYPE_PT", - "SVG_LENGTHTYPE_PX", - "SVG_LENGTHTYPE_UNKNOWN", - "SVG_MARKERUNITS_STROKEWIDTH", - "SVG_MARKERUNITS_UNKNOWN", - "SVG_MARKERUNITS_USERSPACEONUSE", - "SVG_MARKER_ORIENT_ANGLE", - "SVG_MARKER_ORIENT_AUTO", - "SVG_MARKER_ORIENT_AUTO_START_REVERSE", - "SVG_MARKER_ORIENT_UNKNOWN", - "SVG_MASKTYPE_ALPHA", - "SVG_MASKTYPE_LUMINANCE", - "SVG_MATRIX_NOT_INVERTABLE", - "SVG_MEETORSLICE_MEET", - "SVG_MEETORSLICE_SLICE", - "SVG_MEETORSLICE_UNKNOWN", - "SVG_MORPHOLOGY_OPERATOR_DILATE", - "SVG_MORPHOLOGY_OPERATOR_ERODE", - "SVG_MORPHOLOGY_OPERATOR_UNKNOWN", - "SVG_PAINTTYPE_CURRENTCOLOR", - "SVG_PAINTTYPE_NONE", - "SVG_PAINTTYPE_RGBCOLOR", - "SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", - "SVG_PAINTTYPE_UNKNOWN", - "SVG_PAINTTYPE_URI", - "SVG_PAINTTYPE_URI_CURRENTCOLOR", - "SVG_PAINTTYPE_URI_NONE", - "SVG_PAINTTYPE_URI_RGBCOLOR", - "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", - "SVG_PRESERVEASPECTRATIO_NONE", - "SVG_PRESERVEASPECTRATIO_UNKNOWN", - "SVG_PRESERVEASPECTRATIO_XMAXYMAX", - "SVG_PRESERVEASPECTRATIO_XMAXYMID", - "SVG_PRESERVEASPECTRATIO_XMAXYMIN", - "SVG_PRESERVEASPECTRATIO_XMIDYMAX", - "SVG_PRESERVEASPECTRATIO_XMIDYMID", - "SVG_PRESERVEASPECTRATIO_XMIDYMIN", - "SVG_PRESERVEASPECTRATIO_XMINYMAX", - "SVG_PRESERVEASPECTRATIO_XMINYMID", - "SVG_PRESERVEASPECTRATIO_XMINYMIN", - "SVG_SPREADMETHOD_PAD", - "SVG_SPREADMETHOD_REFLECT", - "SVG_SPREADMETHOD_REPEAT", - "SVG_SPREADMETHOD_UNKNOWN", - "SVG_STITCHTYPE_NOSTITCH", - "SVG_STITCHTYPE_STITCH", - "SVG_STITCHTYPE_UNKNOWN", - "SVG_TRANSFORM_MATRIX", - "SVG_TRANSFORM_ROTATE", - "SVG_TRANSFORM_SCALE", - "SVG_TRANSFORM_SKEWX", - "SVG_TRANSFORM_SKEWY", - "SVG_TRANSFORM_TRANSLATE", - "SVG_TRANSFORM_UNKNOWN", - "SVG_TURBULENCE_TYPE_FRACTALNOISE", - "SVG_TURBULENCE_TYPE_TURBULENCE", - "SVG_TURBULENCE_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", - "SVG_UNIT_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_USERSPACEONUSE", - "SVG_WRONG_TYPE_ERR", - "SVG_ZOOMANDPAN_DISABLE", - "SVG_ZOOMANDPAN_MAGNIFY", - "SVG_ZOOMANDPAN_UNKNOWN", - "SYNC_CONDITION", - "SYNC_FENCE", - "SYNC_FLAGS", - "SYNC_FLUSH_COMMANDS_BIT", - "SYNC_GPU_COMMANDS_COMPLETE", - "SYNC_STATUS", - "SYNTAX_ERR", - "SavedPages", - "Scheduler", - "Scheduling", - "Screen", - "ScreenDetailed", - "ScreenDetails", - "ScreenOrientation", - "Script", - "ScriptProcessorNode", - "ScrollAreaEvent", - "ScrollTimeline", - "SecurityPolicyViolationEvent", - "Segmenter", - "Selection", - "Sensor", - "SensorErrorEvent", - "Serial", - "SerialPort", - "ServiceWorker", - "ServiceWorkerContainer", - "ServiceWorkerRegistration", - "SessionDescription", - "Set", - "ShadowRoot", - "SharedArrayBuffer", - "SharedStorage", - "SharedStorageWorklet", - "SharedWorker", - "SharingState", - "SimpleGestureEvent", - "SnapEvent", - "SourceBuffer", - "SourceBufferList", - "SpeechSynthesis", - "SpeechSynthesisErrorEvent", - "SpeechSynthesisEvent", - "SpeechSynthesisUtterance", - "SpeechSynthesisVoice", - "StaticRange", - "StereoPannerNode", - "StopIteration", - "Storage", - "StorageBucket", - "StorageBucketManager", - "StorageEvent", - "StorageManager", - "String", - "StructType", - "StylePropertyMap", - "StylePropertyMapReadOnly", - "StyleSheet", - "StyleSheetList", - "SubmitEvent", - "SubtleCrypto", - "Symbol", - "SyncManager", - "SyntaxError", - "TAB_ID_NONE", - "TAB_INDEX_NONE", - "TEMPORARY", - "TEXTPATH_METHODTYPE_ALIGN", - "TEXTPATH_METHODTYPE_STRETCH", - "TEXTPATH_METHODTYPE_UNKNOWN", - "TEXTPATH_SPACINGTYPE_AUTO", - "TEXTPATH_SPACINGTYPE_EXACT", - "TEXTPATH_SPACINGTYPE_UNKNOWN", - "TEXTURE", - "TEXTURE0", - "TEXTURE1", - "TEXTURE10", - "TEXTURE11", - "TEXTURE12", - "TEXTURE13", - "TEXTURE14", - "TEXTURE15", - "TEXTURE16", - "TEXTURE17", - "TEXTURE18", - "TEXTURE19", - "TEXTURE2", - "TEXTURE20", - "TEXTURE21", - "TEXTURE22", - "TEXTURE23", - "TEXTURE24", - "TEXTURE25", - "TEXTURE26", - "TEXTURE27", - "TEXTURE28", - "TEXTURE29", - "TEXTURE3", - "TEXTURE30", - "TEXTURE31", - "TEXTURE4", - "TEXTURE5", - "TEXTURE6", - "TEXTURE7", - "TEXTURE8", - "TEXTURE9", - "TEXTURE_2D", - "TEXTURE_2D_ARRAY", - "TEXTURE_3D", - "TEXTURE_BASE_LEVEL", - "TEXTURE_BINDING", - "TEXTURE_BINDING_2D", - "TEXTURE_BINDING_2D_ARRAY", - "TEXTURE_BINDING_3D", - "TEXTURE_BINDING_CUBE_MAP", - "TEXTURE_COMPARE_FUNC", - "TEXTURE_COMPARE_MODE", - "TEXTURE_CUBE_MAP", - "TEXTURE_CUBE_MAP_NEGATIVE_X", - "TEXTURE_CUBE_MAP_NEGATIVE_Y", - "TEXTURE_CUBE_MAP_NEGATIVE_Z", - "TEXTURE_CUBE_MAP_POSITIVE_X", - "TEXTURE_CUBE_MAP_POSITIVE_Y", - "TEXTURE_CUBE_MAP_POSITIVE_Z", - "TEXTURE_IMMUTABLE_FORMAT", - "TEXTURE_IMMUTABLE_LEVELS", - "TEXTURE_MAG_FILTER", - "TEXTURE_MAX_ANISOTROPY_EXT", - "TEXTURE_MAX_LEVEL", - "TEXTURE_MAX_LOD", - "TEXTURE_MIN_FILTER", - "TEXTURE_MIN_LOD", - "TEXTURE_WRAP_R", - "TEXTURE_WRAP_S", - "TEXTURE_WRAP_T", - "TEXT_NODE", - "TIMEOUT", - "TIMEOUT_ERR", - "TIMEOUT_EXPIRED", - "TIMEOUT_IGNORED", - "TOO_LARGE_ERR", - "TRANSACTION_INACTIVE_ERR", - "TRANSFORM_FEEDBACK", - "TRANSFORM_FEEDBACK_ACTIVE", - "TRANSFORM_FEEDBACK_BINDING", - "TRANSFORM_FEEDBACK_BUFFER", - "TRANSFORM_FEEDBACK_BUFFER_BINDING", - "TRANSFORM_FEEDBACK_BUFFER_MODE", - "TRANSFORM_FEEDBACK_BUFFER_SIZE", - "TRANSFORM_FEEDBACK_BUFFER_START", - "TRANSFORM_FEEDBACK_PAUSED", - "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", - "TRANSFORM_FEEDBACK_VARYINGS", - "TRIANGLE", - "TRIANGLES", - "TRIANGLE_FAN", - "TRIANGLE_STRIP", - "TYPE_BACK_FORWARD", - "TYPE_ERR", - "TYPE_MISMATCH_ERR", - "TYPE_NAVIGATE", - "TYPE_RELOAD", - "TYPE_RESERVED", - "Tab", - "TabStatus", - "Table", - "Tag", - "TaskAttributionTiming", - "TaskController", - "TaskPriorityChangeEvent", - "TaskSignal", - "Text", - "TextDecoder", - "TextDecoderStream", - "TextEncoder", - "TextEncoderStream", - "TextEvent", - "TextFormat", - "TextFormatUpdateEvent", - "TextMetrics", - "TextTrack", - "TextTrackCue", - "TextTrackCueList", - "TextTrackList", - "TextUpdateEvent", - "TimeEvent", - "TimeRanges", - "ToggleEvent", - "Touch", - "TouchEvent", - "TouchList", - "TrackEvent", - "TransformStream", - "TransformStreamDefaultController", - "TransitionEvent", - "TreeWalker", - "TrustedHTML", - "TrustedScript", - "TrustedScriptURL", - "TrustedTypePolicy", - "TrustedTypePolicyFactory", - "TypeError", - "TypedObject", - "U2F", - "UIEvent", - "UNCACHED", - "UNIFORM", - "UNIFORM_ARRAY_STRIDE", - "UNIFORM_BLOCK_ACTIVE_UNIFORMS", - "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", - "UNIFORM_BLOCK_BINDING", - "UNIFORM_BLOCK_DATA_SIZE", - "UNIFORM_BLOCK_INDEX", - "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", - "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", - "UNIFORM_BUFFER", - "UNIFORM_BUFFER_BINDING", - "UNIFORM_BUFFER_OFFSET_ALIGNMENT", - "UNIFORM_BUFFER_SIZE", - "UNIFORM_BUFFER_START", - "UNIFORM_IS_ROW_MAJOR", - "UNIFORM_MATRIX_STRIDE", - "UNIFORM_OFFSET", - "UNIFORM_SIZE", - "UNIFORM_TYPE", - "UNKNOWN_ERR", - "UNKNOWN_RULE", - "UNMASKED_RENDERER_WEBGL", - "UNMASKED_VENDOR_WEBGL", - "UNORDERED_NODE_ITERATOR_TYPE", - "UNORDERED_NODE_SNAPSHOT_TYPE", - "UNPACK_ALIGNMENT", - "UNPACK_COLORSPACE_CONVERSION_WEBGL", - "UNPACK_FLIP_Y_WEBGL", - "UNPACK_IMAGE_HEIGHT", - "UNPACK_PREMULTIPLY_ALPHA_WEBGL", - "UNPACK_ROW_LENGTH", - "UNPACK_SKIP_IMAGES", - "UNPACK_SKIP_PIXELS", - "UNPACK_SKIP_ROWS", - "UNSCHEDULED_STATE", - "UNSENT", - "UNSIGNALED", - "UNSIGNED_BYTE", - "UNSIGNED_INT", - "UNSIGNED_INT_10F_11F_11F_REV", - "UNSIGNED_INT_24_8", - "UNSIGNED_INT_2_10_10_10_REV", - "UNSIGNED_INT_5_9_9_9_REV", - "UNSIGNED_INT_SAMPLER_2D", - "UNSIGNED_INT_SAMPLER_2D_ARRAY", - "UNSIGNED_INT_SAMPLER_3D", - "UNSIGNED_INT_SAMPLER_CUBE", - "UNSIGNED_INT_VEC2", - "UNSIGNED_INT_VEC3", - "UNSIGNED_INT_VEC4", - "UNSIGNED_NORMALIZED", - "UNSIGNED_SHORT", - "UNSIGNED_SHORT_4_4_4_4", - "UNSIGNED_SHORT_5_5_5_1", - "UNSIGNED_SHORT_5_6_5", - "UNSPECIFIED_EVENT_TYPE_ERR", - "UPDATEREADY", - "URIError", - "URL", - "URLPattern", - "URLSearchParams", - "URLUnencoded", - "URL_MISMATCH_ERR", - "USB", - "USBAlternateInterface", - "USBConfiguration", - "USBConnectionEvent", - "USBDevice", - "USBEndpoint", - "USBInTransferResult", - "USBInterface", - "USBIsochronousInTransferPacket", - "USBIsochronousInTransferResult", - "USBIsochronousOutTransferPacket", - "USBIsochronousOutTransferResult", - "USBOutTransferResult", - "UTC", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - "UpdateFilter", - "UpdatePropertyName", - "UserActivation", - "UserMessageHandler", - "UserMessageHandlersNamespace", - "UserProximityEvent", - "VALIDATE_STATUS", - "VALIDATION_ERR", - "VARIABLES_RULE", - "VENDOR", - "VERSION", - "VERSION_CHANGE", - "VERSION_ERR", - "VERTEX", - "VERTEX_ARRAY_BINDING", - "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", - "VERTEX_ATTRIB_ARRAY_DIVISOR", - "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", - "VERTEX_ATTRIB_ARRAY_ENABLED", - "VERTEX_ATTRIB_ARRAY_INTEGER", - "VERTEX_ATTRIB_ARRAY_NORMALIZED", - "VERTEX_ATTRIB_ARRAY_POINTER", - "VERTEX_ATTRIB_ARRAY_SIZE", - "VERTEX_ATTRIB_ARRAY_STRIDE", - "VERTEX_ATTRIB_ARRAY_TYPE", - "VERTEX_SHADER", - "VERTICAL", - "VERTICAL_AXIS", - "VER_ERR", - "VIEWPORT", - "VIEWPORT_RULE", - "VRDisplay", - "VRDisplayCapabilities", - "VRDisplayEvent", - "VREyeParameters", - "VRFieldOfView", - "VRFrameData", - "VRPose", - "VRStageParameters", - "VTTCue", - "VTTRegion", - "ValidityState", - "VideoColorSpace", - "VideoDecoder", - "VideoEncoder", - "VideoFrame", - "VideoPlaybackQuality", - "VideoStreamTrack", - "ViewTimeline", - "ViewTransition", - "ViewTransitionTypeSet", - "ViewType", - "VirtualKeyboard", - "VirtualKeyboardGeometryChangeEvent", - "VisibilityStateEntry", - "VisualViewport", - "WAIT_FAILED", - "WEBKIT_FILTER_RULE", - "WEBKIT_KEYFRAMES_RULE", - "WEBKIT_KEYFRAME_RULE", - "WEBKIT_REGION_RULE", - "WGSLLanguageFeatures", - "WINDOW_ID_CURRENT", - "WINDOW_ID_NONE", - "WRITE", - "WRONG_DOCUMENT_ERR", - "WakeLock", - "WakeLockSentinel", - "WasmAnyRef", - "WaveShaperNode", - "WeakMap", - "WeakRef", - "WeakSet", - "WebAssembly", - "WebGL2RenderingContext", - "WebGLActiveInfo", - "WebGLBuffer", - "WebGLContextEvent", - "WebGLFramebuffer", - "WebGLObject", - "WebGLProgram", - "WebGLQuery", - "WebGLRenderbuffer", - "WebGLRenderingContext", - "WebGLSampler", - "WebGLShader", - "WebGLShaderPrecisionFormat", - "WebGLSync", - "WebGLTexture", - "WebGLTransformFeedback", - "WebGLUniformLocation", - "WebGLVertexArray", - "WebGLVertexArrayObject", - "WebKitAnimationEvent", - "WebKitBlobBuilder", - "WebKitCSSFilterRule", - "WebKitCSSFilterValue", - "WebKitCSSKeyframeRule", - "WebKitCSSKeyframesRule", - "WebKitCSSMatrix", - "WebKitCSSRegionRule", - "WebKitCSSTransformValue", - "WebKitDataCue", - "WebKitGamepad", - "WebKitMediaKeyError", - "WebKitMediaKeyMessageEvent", - "WebKitMediaKeySession", - "WebKitMediaKeys", - "WebKitMediaSource", - "WebKitMutationObserver", - "WebKitNamespace", - "WebKitPlaybackTargetAvailabilityEvent", - "WebKitPoint", - "WebKitShadowRoot", - "WebKitSourceBuffer", - "WebKitSourceBufferList", - "WebKitTransitionEvent", - "WebSocket", - "WebSocketError", - "WebSocketStream", - "WebTransport", - "WebTransportBidirectionalStream", - "WebTransportDatagramDuplexStream", - "WebTransportError", - "WebTransportReceiveStream", - "WebTransportSendStream", - "WebkitAlignContent", - "WebkitAlignItems", - "WebkitAlignSelf", - "WebkitAnimation", - "WebkitAnimationDelay", - "WebkitAnimationDirection", - "WebkitAnimationDuration", - "WebkitAnimationFillMode", - "WebkitAnimationIterationCount", - "WebkitAnimationName", - "WebkitAnimationPlayState", - "WebkitAnimationTimingFunction", - "WebkitAppearance", - "WebkitBackfaceVisibility", - "WebkitBackgroundClip", - "WebkitBackgroundOrigin", - "WebkitBackgroundSize", - "WebkitBorderBottomLeftRadius", - "WebkitBorderBottomRightRadius", - "WebkitBorderImage", - "WebkitBorderRadius", - "WebkitBorderTopLeftRadius", - "WebkitBorderTopRightRadius", - "WebkitBoxAlign", - "WebkitBoxDirection", - "WebkitBoxFlex", - "WebkitBoxOrdinalGroup", - "WebkitBoxOrient", - "WebkitBoxPack", - "WebkitBoxShadow", - "WebkitBoxSizing", - "WebkitClipPath", - "WebkitFilter", - "WebkitFlex", - "WebkitFlexBasis", - "WebkitFlexDirection", - "WebkitFlexFlow", - "WebkitFlexGrow", - "WebkitFlexShrink", - "WebkitFlexWrap", - "WebkitFontFeatureSettings", - "WebkitJustifyContent", - "WebkitLineClamp", - "WebkitMask", - "WebkitMaskClip", - "WebkitMaskComposite", - "WebkitMaskImage", - "WebkitMaskOrigin", - "WebkitMaskPosition", - "WebkitMaskPositionX", - "WebkitMaskPositionY", - "WebkitMaskRepeat", - "WebkitMaskSize", - "WebkitOrder", - "WebkitPerspective", - "WebkitPerspectiveOrigin", - "WebkitTextFillColor", - "WebkitTextSecurity", - "WebkitTextSizeAdjust", - "WebkitTextStroke", - "WebkitTextStrokeColor", - "WebkitTextStrokeWidth", - "WebkitTransform", - "WebkitTransformOrigin", - "WebkitTransformStyle", - "WebkitTransition", - "WebkitTransitionDelay", - "WebkitTransitionDuration", - "WebkitTransitionProperty", - "WebkitTransitionTimingFunction", - "WebkitUserSelect", - "WheelEvent", - "Window", - "WindowControlsOverlay", - "WindowControlsOverlayGeometryChangeEvent", - "WindowState", - "WindowType", - "Worker", - "Worklet", - "WritableStream", - "WritableStreamDefaultController", - "WritableStreamDefaultWriter", - "XMLDocument", - "XMLHttpRequest", - "XMLHttpRequestEventTarget", - "XMLHttpRequestException", - "XMLHttpRequestProgressEvent", - "XMLHttpRequestUpload", - "XMLSerializer", - "XMLStylesheetProcessingInstruction", - "XPathEvaluator", - "XPathException", - "XPathExpression", - "XPathNSResolver", - "XPathResult", - "XRAnchor", - "XRAnchorSet", - "XRBoundedReferenceSpace", - "XRCPUDepthInformation", - "XRCamera", - "XRDOMOverlayState", - "XRDepthInformation", - "XRFrame", - "XRHand", - "XRHitTestResult", - "XRHitTestSource", - "XRInputSource", - "XRInputSourceArray", - "XRInputSourceEvent", - "XRInputSourcesChangeEvent", - "XRJointPose", - "XRJointSpace", - "XRLayer", - "XRLightEstimate", - "XRLightProbe", - "XRPose", - "XRRay", - "XRReferenceSpace", - "XRReferenceSpaceEvent", - "XRRenderState", - "XRRigidTransform", - "XRSession", - "XRSessionEvent", - "XRSpace", - "XRSystem", - "XRTransientInputHitTestResult", - "XRTransientInputHitTestSource", - "XRView", - "XRViewerPose", - "XRViewport", - "XRWebGLBinding", - "XRWebGLDepthInformation", - "XRWebGLLayer", - "XSLTProcessor", - "ZERO", - "ZoomSettings", - "ZoomSettingsMode", - "ZoomSettingsScope", - "_XD0M_", - "_YD0M_", - "__REACT_DEVTOOLS_GLOBAL_HOOK__", - "__brand", - "__defineGetter__", - "__defineSetter__", - "__lookupGetter__", - "__lookupSetter__", - "__opera", - "__proto__", - "_browserjsran", - "a", - "aLink", - "abbr", - "abort", - "aborted", - "aboutConfigPrefs", - "abs", - "absolute", - "acceleration", - "accelerationIncludingGravity", - "accelerator", - "accent-color", - "accentColor", - "accept", - "acceptCharset", - "acceptNode", - "access", - "accessKey", - "accessKeyLabel", - "accuracy", - "acos", - "acosh", - "action", - "actionURL", - "actions", - "activated", - "activation", - "activationStart", - "active", - "activeCues", - "activeElement", - "activeSourceBuffers", - "activeSourceCount", - "activeTexture", - "activeVRDisplays", - "activityLog", - "actualBoundingBoxAscent", - "actualBoundingBoxDescent", - "actualBoundingBoxLeft", - "actualBoundingBoxRight", - "adAuctionComponents", - "adAuctionHeaders", - "add", - "addAll", - "addBehavior", - "addCandidate", - "addColorStop", - "addCue", - "addElement", - "addEventListener", - "addFilter", - "addFromString", - "addFromUri", - "addIceCandidate", - "addImport", - "addListener", - "addModule", - "addNamed", - "addPageRule", - "addPath", - "addPointer", - "addRange", - "addRegion", - "addRule", - "addSearchEngine", - "addSourceBuffer", - "addStream", - "addTextTrack", - "addTrack", - "addTransceiver", - "addWakeLockListener", - "added", - "addedNodes", - "additionalName", - "additiveSymbols", - "addons", - "address", - "addressLine", - "addressModeU", - "addressModeV", - "addressModeW", - "adoptNode", - "adoptedCallback", - "adoptedStyleSheets", - "adr", - "advance", - "after", - "alarms", - "album", - "alert", - "algorithm", - "align", - "align-content", - "align-items", - "align-self", - "alignContent", - "alignItems", - "alignSelf", - "alignmentBaseline", - "alinkColor", - "all", - "allSettled", - "allocationSize", - "allow", - "allowFullscreen", - "allowPaymentRequest", - "allowedDirections", - "allowedFeatures", - "allowedToPlay", - "allowsFeature", - "alpha", - "alphaMode", - "alphaToCoverageEnabled", - "alphabeticBaseline", - "alt", - "altGraphKey", - "altHtml", - "altKey", - "altLeft", - "alternate", - "alternateSetting", - "alternates", - "altitude", - "altitudeAccuracy", - "altitudeAngle", - "amplitude", - "ancestorOrigins", - "anchor", - "anchorNode", - "anchorOffset", - "anchorSpace", - "anchors", - "and", - "angle", - "angularAcceleration", - "angularVelocity", - "animVal", - "animate", - "animated", - "animatedInstanceRoot", - "animatedNormalizedPathSegList", - "animatedPathSegList", - "animatedPoints", - "animation", - "animation-composition", - "animation-delay", - "animation-direction", - "animation-duration", - "animation-fill-mode", - "animation-iteration-count", - "animation-name", - "animation-play-state", - "animation-timing-function", - "animationComposition", - "animationDelay", - "animationDirection", - "animationDuration", - "animationFillMode", - "animationIterationCount", - "animationName", - "animationPlayState", - "animationStartTime", - "animationTimingFunction", - "animationsPaused", - "anniversary", - "antialias", - "anticipatedRemoval", - "any", - "app", - "appCodeName", - "appMinorVersion", - "appName", - "appNotifications", - "appVersion", - "appearance", - "append", - "appendBuffer", - "appendChild", - "appendData", - "appendItem", - "appendMedium", - "appendNamed", - "appendRule", - "appendStream", - "appendWindowEnd", - "appendWindowStart", - "applets", - "applicationCache", - "applicationServerKey", - "apply", - "applyConstraints", - "applyElement", - "arc", - "arcTo", - "arch", - "architecture", - "archive", - "areas", - "arguments", - "ariaAtomic", - "ariaAutoComplete", - "ariaBrailleLabel", - "ariaBrailleRoleDescription", - "ariaBusy", - "ariaChecked", - "ariaColCount", - "ariaColIndex", - "ariaColIndexText", - "ariaColSpan", - "ariaCurrent", - "ariaDescription", - "ariaDisabled", - "ariaExpanded", - "ariaHasPopup", - "ariaHidden", - "ariaInvalid", - "ariaKeyShortcuts", - "ariaLabel", - "ariaLevel", - "ariaLive", - "ariaModal", - "ariaMultiLine", - "ariaMultiSelectable", - "ariaOrientation", - "ariaPlaceholder", - "ariaPosInSet", - "ariaPressed", - "ariaReadOnly", - "ariaRelevant", - "ariaRequired", - "ariaRoleDescription", - "ariaRowCount", - "ariaRowIndex", - "ariaRowIndexText", - "ariaRowSpan", - "ariaSelected", - "ariaSetSize", - "ariaSort", - "ariaValueMax", - "ariaValueMin", - "ariaValueNow", - "ariaValueText", - "arrayBuffer", - "arrayLayerCount", - "arrayStride", - "artist", - "artwork", - "as", - "asIntN", - "asUintN", - "ascentOverride", - "asin", - "asinh", - "aspect", - "aspect-ratio", - "aspectRatio", - "assert", - "assign", - "assignedElements", - "assignedNodes", - "assignedSlot", - "async", - "asyncDispose", - "asyncIterator", - "at", - "atEnd", - "atan", - "atan2", - "atanh", - "atob", - "attachEvent", - "attachInternals", - "attachShader", - "attachShadow", - "attachedElements", - "attachments", - "attack", - "attestationObject", - "attrChange", - "attrName", - "attributeChangedCallback", - "attributeFilter", - "attributeName", - "attributeNamespace", - "attributeOldValue", - "attributeStyleMap", - "attributes", - "attribution", - "attributionSrc", - "audioBitrateMode", - "audioBitsPerSecond", - "audioTracks", - "audioWorklet", - "authenticatedSignedWrites", - "authenticatorAttachment", - "authenticatorData", - "autoIncrement", - "autobuffer", - "autocapitalize", - "autocomplete", - "autocorrect", - "autofocus", - "automationRate", - "autoplay", - "availHeight", - "availLeft", - "availTop", - "availWidth", - "availability", - "available", - "averageLatency", - "aversion", - "ax", - "axes", - "axis", - "ay", - "azimuth", - "azimuthAngle", - "b", - "back", - "backdrop-filter", - "backdropFilter", - "backends", - "backface-visibility", - "backfaceVisibility", - "background", - "background-attachment", - "background-blend-mode", - "background-clip", - "background-color", - "background-image", - "background-origin", - "background-position", - "background-position-x", - "background-position-y", - "background-repeat", - "background-size", - "backgroundAttachment", - "backgroundBlendMode", - "backgroundClip", - "backgroundColor", - "backgroundFetch", - "backgroundImage", - "backgroundOrigin", - "backgroundPosition", - "backgroundPositionX", - "backgroundPositionY", - "backgroundRepeat", - "backgroundSize", - "badInput", - "badge", - "balance", - "baseArrayLayer", - "baseFrequencyX", - "baseFrequencyY", - "baseLatency", - "baseLayer", - "baseMipLevel", - "baseNode", - "baseOffset", - "basePalette", - "baseURI", - "baseVal", - "baseline-source", - "baselineShift", - "baselineSource", - "battery", - "bday", - "before", - "beginComputePass", - "beginElement", - "beginElementAt", - "beginOcclusionQuery", - "beginPath", - "beginQuery", - "beginRenderPass", - "beginTransformFeedback", - "beginningOfPassWriteIndex", - "behavior", - "behaviorCookie", - "behaviorPart", - "behaviorUrns", - "beta", - "bezierCurveTo", - "bgColor", - "bgProperties", - "bias", - "big", - "bigint64", - "biguint64", - "binaryType", - "bind", - "bindAttribLocation", - "bindBuffer", - "bindBufferBase", - "bindBufferRange", - "bindFramebuffer", - "bindGroupLayouts", - "bindRenderbuffer", - "bindSampler", - "bindTexture", - "bindTransformFeedback", - "bindVertexArray", - "binding", - "bitness", - "blend", - "blendColor", - "blendEquation", - "blendEquationSeparate", - "blendFunc", - "blendFuncSeparate", - "blink", - "blitFramebuffer", - "blob", - "block-size", - "blockDirection", - "blockSize", - "blockedURI", - "blocking", - "blockingDuration", - "blue", - "bluetooth", - "blur", - "body", - "bodyUsed", - "bold", - "bookmarks", - "booleanValue", - "border", - "border-block", - "border-block-color", - "border-block-end", - "border-block-end-color", - "border-block-end-style", - "border-block-end-width", - "border-block-start", - "border-block-start-color", - "border-block-start-style", - "border-block-start-width", - "border-block-style", - "border-block-width", - "border-bottom", - "border-bottom-color", - "border-bottom-left-radius", - "border-bottom-right-radius", - "border-bottom-style", - "border-bottom-width", - "border-collapse", - "border-color", - "border-end-end-radius", - "border-end-start-radius", - "border-image", - "border-image-outset", - "border-image-repeat", - "border-image-slice", - "border-image-source", - "border-image-width", - "border-inline", - "border-inline-color", - "border-inline-end", - "border-inline-end-color", - "border-inline-end-style", - "border-inline-end-width", - "border-inline-start", - "border-inline-start-color", - "border-inline-start-style", - "border-inline-start-width", - "border-inline-style", - "border-inline-width", - "border-left", - "border-left-color", - "border-left-style", - "border-left-width", - "border-radius", - "border-right", - "border-right-color", - "border-right-style", - "border-right-width", - "border-spacing", - "border-start-end-radius", - "border-start-start-radius", - "border-style", - "border-top", - "border-top-color", - "border-top-left-radius", - "border-top-right-radius", - "border-top-style", - "border-top-width", - "border-width", - "borderBlock", - "borderBlockColor", - "borderBlockEnd", - "borderBlockEndColor", - "borderBlockEndStyle", - "borderBlockEndWidth", - "borderBlockStart", - "borderBlockStartColor", - "borderBlockStartStyle", - "borderBlockStartWidth", - "borderBlockStyle", - "borderBlockWidth", - "borderBottom", - "borderBottomColor", - "borderBottomLeftRadius", - "borderBottomRightRadius", - "borderBottomStyle", - "borderBottomWidth", - "borderBoxSize", - "borderCollapse", - "borderColor", - "borderColorDark", - "borderColorLight", - "borderEndEndRadius", - "borderEndStartRadius", - "borderImage", - "borderImageOutset", - "borderImageRepeat", - "borderImageSlice", - "borderImageSource", - "borderImageWidth", - "borderInline", - "borderInlineColor", - "borderInlineEnd", - "borderInlineEndColor", - "borderInlineEndStyle", - "borderInlineEndWidth", - "borderInlineStart", - "borderInlineStartColor", - "borderInlineStartStyle", - "borderInlineStartWidth", - "borderInlineStyle", - "borderInlineWidth", - "borderLeft", - "borderLeftColor", - "borderLeftStyle", - "borderLeftWidth", - "borderRadius", - "borderRight", - "borderRightColor", - "borderRightStyle", - "borderRightWidth", - "borderSpacing", - "borderStartEndRadius", - "borderStartStartRadius", - "borderStyle", - "borderTop", - "borderTopColor", - "borderTopLeftRadius", - "borderTopRightRadius", - "borderTopStyle", - "borderTopWidth", - "borderWidth", - "bottom", - "bottomMargin", - "bound", - "boundElements", - "boundingClientRect", - "boundingHeight", - "boundingLeft", - "boundingRect", - "boundingTop", - "boundingWidth", - "bounds", - "boundsGeometry", - "box-decoration-break", - "box-shadow", - "box-sizing", - "boxDecorationBreak", - "boxShadow", - "boxSizing", - "brand", - "brands", - "break-after", - "break-before", - "break-inside", - "breakAfter", - "breakBefore", - "breakInside", - "broadcast", - "browser", - "browserLanguage", - "browserSettings", - "browsingData", - "browsingTopics", - "btoa", - "bubbles", - "buffer", - "bufferData", - "bufferDepth", - "bufferSize", - "bufferSubData", - "buffered", - "bufferedAmount", - "bufferedAmountLowThreshold", - "buffers", - "buildID", - "buildNumber", - "button", - "buttonID", - "buttons", - "byobRequest", - "byteLength", - "byteOffset", - "bytes", - "bytesPerRow", - "bytesWritten", - "c", - "cache", - "caches", - "call", - "caller", - "camera", - "canBeFormatted", - "canBeMounted", - "canBeShared", - "canConstructInDedicatedWorker", - "canGoBack", - "canGoForward", - "canHaveChildren", - "canHaveHTML", - "canInsertDTMF", - "canIntercept", - "canLoadAdAuctionFencedFrame", - "canLoadOpaqueURL", - "canMakePayment", - "canParse", - "canPlayType", - "canPresent", - "canShare", - "canTransition", - "canTrickleIceCandidates", - "cancel", - "cancelAndHoldAtTime", - "cancelAnimationFrame", - "cancelBubble", - "cancelIdleCallback", - "cancelScheduledValues", - "cancelVideoFrameCallback", - "cancelWatchAvailability", - "cancelable", - "candidate", - "canonicalUUID", - "canvas", - "cap", - "capabilities", - "caption", - "caption-side", - "captionSide", - "captivePortal", - "capture", - "captureEvents", - "captureStackTrace", - "captureStream", - "captureTab", - "captureVisibleTab", - "caret-color", - "caretBidiLevel", - "caretColor", - "caretPositionFromPoint", - "caretRangeFromPoint", - "cast", - "catch", - "category", - "cbrt", - "cd", - "ceil", - "cellIndex", - "cellPadding", - "cellSpacing", - "cells", - "ch", - "chOff", - "chain", - "challenge", - "changeType", - "changed", - "changedTouches", - "channel", - "channelCount", - "channelCountMode", - "channelInterpretation", - "chapterInfo", - "char", - "charAt", - "charCode", - "charCodeAt", - "charIndex", - "charLength", - "characterBounds", - "characterBoundsRangeStart", - "characterData", - "characterDataOldValue", - "characterSet", - "characteristic", - "charging", - "chargingTime", - "charset", - "check", - "checkDCE", - "checkEnclosure", - "checkFramebufferStatus", - "checkIntersection", - "checkValidity", - "checkVisibility", - "checked", - "childElementCount", - "childList", - "childNodes", - "children", - "chrome", - "ciphertext", - "cite", - "city", - "claimInterface", - "claimed", - "classList", - "className", - "classid", - "clear", - "clearAppBadge", - "clearAttributes", - "clearBuffer", - "clearBufferfi", - "clearBufferfv", - "clearBufferiv", - "clearBufferuiv", - "clearColor", - "clearData", - "clearDepth", - "clearHalt", - "clearImmediate", - "clearInterval", - "clearLiveSeekableRange", - "clearMarks", - "clearMaxGCPauseAccumulator", - "clearMeasures", - "clearOriginJoinedAdInterestGroups", - "clearParameters", - "clearRect", - "clearResourceTimings", - "clearShadow", - "clearStencil", - "clearTimeout", - "clearValue", - "clearWatch", - "click", - "clickCount", - "clientDataJSON", - "clientHeight", - "clientInformation", - "clientLeft", - "clientRect", - "clientRects", - "clientTop", - "clientWaitSync", - "clientWidth", - "clientX", - "clientY", - "clip", - "clip-path", - "clip-rule", - "clipBottom", - "clipLeft", - "clipPath", - "clipPathUnits", - "clipRight", - "clipRule", - "clipTop", - "clipboard", - "clipboardData", - "clonable", - "clone", - "cloneContents", - "cloneNode", - "cloneRange", - "close", - "closeCode", - "closePath", - "closed", - "closest", - "clz", - "clz32", - "cm", - "cmp", - "code", - "codeBase", - "codePointAt", - "codeType", - "codedHeight", - "codedRect", - "codedWidth", - "colSpan", - "collapse", - "collapseToEnd", - "collapseToStart", - "collapsed", - "collect", - "collections", - "colno", - "color", - "color-adjust", - "color-interpolation", - "color-interpolation-filters", - "color-scheme", - "colorAdjust", - "colorAttachments", - "colorDepth", - "colorFormats", - "colorInterpolation", - "colorInterpolationFilters", - "colorMask", - "colorScheme", - "colorSpace", - "colorType", - "cols", - "column-count", - "column-fill", - "column-gap", - "column-rule", - "column-rule-color", - "column-rule-style", - "column-rule-width", - "column-span", - "column-width", - "columnCount", - "columnFill", - "columnGap", - "columnNumber", - "columnRule", - "columnRuleColor", - "columnRuleStyle", - "columnRuleWidth", - "columnSpan", - "columnWidth", - "columns", - "command", - "commands", - "commit", - "commitLoadTime", - "commitPreferences", - "commitStyles", - "commonAncestorContainer", - "compact", - "compare", - "compareBoundaryPoints", - "compareDocumentPosition", - "compareEndPoints", - "compareExchange", - "compareNode", - "comparePoint", - "compatMode", - "compatible", - "compile", - "compileShader", - "compileStreaming", - "complete", - "completed", - "component", - "componentFromPoint", - "composed", - "composedPath", - "composite", - "compositionEndOffset", - "compositionStartOffset", - "compressedTexImage2D", - "compressedTexImage3D", - "compressedTexSubImage2D", - "compressedTexSubImage3D", - "compute", - "computedStyleMap", - "concat", - "conditionText", - "coneInnerAngle", - "coneOuterAngle", - "coneOuterGain", - "config", - "configurable", - "configuration", - "configurationName", - "configurationValue", - "configurations", - "configure", - "confirm", - "confirmComposition", - "confirmSiteSpecificTrackingException", - "confirmWebWideTrackingException", - "congestionControl", - "connect", - "connectEnd", - "connectNative", - "connectShark", - "connectStart", - "connected", - "connectedCallback", - "connection", - "connectionInfo", - "connectionList", - "connectionSpeed", - "connectionState", - "connections", - "console", - "consolidate", - "constants", - "constraint", - "constrictionActive", - "construct", - "constructor", - "contactID", - "contain", - "contain-intrinsic-block-size", - "contain-intrinsic-height", - "contain-intrinsic-inline-size", - "contain-intrinsic-size", - "contain-intrinsic-width", - "containIntrinsicBlockSize", - "containIntrinsicHeight", - "containIntrinsicInlineSize", - "containIntrinsicSize", - "containIntrinsicWidth", - "container", - "container-name", - "container-type", - "containerId", - "containerName", - "containerQuery", - "containerSrc", - "containerType", - "contains", - "containsNode", - "content", - "content-visibility", - "contentBoxSize", - "contentDocument", - "contentEditable", - "contentHint", - "contentOverflow", - "contentRect", - "contentScriptType", - "contentStyleType", - "contentType", - "contentVisibility", - "contentWindow", - "context", - "contextId", - "contextIds", - "contextMenu", - "contextMenus", - "contextType", - "contextTypes", - "contextmenu", - "contextualIdentities", - "continue", - "continuePrimaryKey", - "continuous", - "control", - "controlTransferIn", - "controlTransferOut", - "controller", - "controls", - "controlsList", - "convertPointFromNode", - "convertQuadFromNode", - "convertRectFromNode", - "convertToBlob", - "convertToSpecifiedUnits", - "cookie", - "cookieEnabled", - "cookieStore", - "cookies", - "coords", - "copyBufferSubData", - "copyBufferToBuffer", - "copyBufferToTexture", - "copyExternalImageToTexture", - "copyFromChannel", - "copyTexImage2D", - "copyTexSubImage2D", - "copyTexSubImage3D", - "copyTextureToBuffer", - "copyTextureToTexture", - "copyTo", - "copyToChannel", - "copyWithin", - "correspondingElement", - "correspondingUseElement", - "corruptedVideoFrames", - "cos", - "cosh", - "count", - "countReset", - "counter-increment", - "counter-reset", - "counter-set", - "counterIncrement", - "counterReset", - "counterSet", - "country", - "cpuClass", - "cpuSleepAllowed", - "cqb", - "cqh", - "cqi", - "cqmax", - "cqmin", - "cqw", - "create", - "createAnalyser", - "createAnchor", - "createAnswer", - "createAttribute", - "createAttributeNS", - "createAuctionNonce", - "createBidirectionalStream", - "createBindGroup", - "createBindGroupLayout", - "createBiquadFilter", - "createBuffer", - "createBufferSource", - "createCDATASection", - "createCSSStyleSheet", - "createCaption", - "createChannelMerger", - "createChannelSplitter", - "createCommandEncoder", - "createComment", - "createComputePipeline", - "createComputePipelineAsync", - "createConicGradient", - "createConstantSource", - "createContextualFragment", - "createControlRange", - "createConvolver", - "createDTMFSender", - "createDataChannel", - "createDelay", - "createDelayNode", - "createDocument", - "createDocumentFragment", - "createDocumentType", - "createDynamicsCompressor", - "createElement", - "createElementNS", - "createEncodedStreams", - "createEntityReference", - "createEvent", - "createEventObject", - "createExpression", - "createFramebuffer", - "createFunction", - "createGain", - "createGainNode", - "createHTML", - "createHTMLDocument", - "createIIRFilter", - "createImageBitmap", - "createImageData", - "createIndex", - "createJavaScriptNode", - "createLinearGradient", - "createMediaElementSource", - "createMediaKeys", - "createMediaStreamDestination", - "createMediaStreamSource", - "createMediaStreamTrackSource", - "createMutableFile", - "createNSResolver", - "createNodeIterator", - "createNotification", - "createObjectStore", - "createObjectURL", - "createOffer", - "createOscillator", - "createPanner", - "createPattern", - "createPeriodicWave", - "createPipelineLayout", - "createPolicy", - "createPopup", - "createProcessingInstruction", - "createProgram", - "createQuery", - "createQuerySet", - "createRadialGradient", - "createRange", - "createRangeCollection", - "createReader", - "createRenderBundleEncoder", - "createRenderPipeline", - "createRenderPipelineAsync", - "createRenderbuffer", - "createSVGAngle", - "createSVGLength", - "createSVGMatrix", - "createSVGNumber", - "createSVGPathSegArcAbs", - "createSVGPathSegArcRel", - "createSVGPathSegClosePath", - "createSVGPathSegCurvetoCubicAbs", - "createSVGPathSegCurvetoCubicRel", - "createSVGPathSegCurvetoCubicSmoothAbs", - "createSVGPathSegCurvetoCubicSmoothRel", - "createSVGPathSegCurvetoQuadraticAbs", - "createSVGPathSegCurvetoQuadraticRel", - "createSVGPathSegCurvetoQuadraticSmoothAbs", - "createSVGPathSegCurvetoQuadraticSmoothRel", - "createSVGPathSegLinetoAbs", - "createSVGPathSegLinetoHorizontalAbs", - "createSVGPathSegLinetoHorizontalRel", - "createSVGPathSegLinetoRel", - "createSVGPathSegLinetoVerticalAbs", - "createSVGPathSegLinetoVerticalRel", - "createSVGPathSegMovetoAbs", - "createSVGPathSegMovetoRel", - "createSVGPoint", - "createSVGRect", - "createSVGTransform", - "createSVGTransformFromMatrix", - "createSampler", - "createScript", - "createScriptProcessor", - "createScriptURL", - "createSession", - "createShader", - "createShaderModule", - "createShadowRoot", - "createStereoPanner", - "createStyleSheet", - "createTBody", - "createTFoot", - "createTHead", - "createTask", - "createTextNode", - "createTextRange", - "createTexture", - "createTouch", - "createTouchList", - "createTransformFeedback", - "createTreeWalker", - "createUnidirectionalStream", - "createVertexArray", - "createView", - "createWaveShaper", - "createWorklet", - "createWritable", - "creationTime", - "credentialless", - "credentials", - "criticalCHRestart", - "cropTo", - "crossOrigin", - "crossOriginIsolated", - "crypto", - "csi", - "csp", - "cssFloat", - "cssRules", - "cssText", - "cssValueType", - "ctrlKey", - "ctrlLeft", - "cues", - "cullFace", - "cullMode", - "currentCSSZoom", - "currentDirection", - "currentEntry", - "currentLocalDescription", - "currentNode", - "currentPage", - "currentRect", - "currentRemoteDescription", - "currentScale", - "currentScreen", - "currentScript", - "currentSrc", - "currentState", - "currentStyle", - "currentTarget", - "currentTime", - "currentTranslate", - "currentView", - "cursor", - "curve", - "customElements", - "customError", - "cx", - "cy", - "d", - "data", - "dataFld", - "dataFormatAs", - "dataLoss", - "dataLossMessage", - "dataPageSize", - "dataSrc", - "dataTransfer", - "database", - "databases", - "datagrams", - "dataset", - "dateTime", - "db", - "debug", - "debuggerEnabled", - "declarativeNetRequest", - "declare", - "decode", - "decodeAudioData", - "decodeQueueSize", - "decodeURI", - "decodeURIComponent", - "decodedBodySize", - "decoding", - "decodingInfo", - "decrypt", - "default", - "defaultCharset", - "defaultChecked", - "defaultMuted", - "defaultPlaybackRate", - "defaultPolicy", - "defaultPrevented", - "defaultQueue", - "defaultRequest", - "defaultSelected", - "defaultStatus", - "defaultURL", - "defaultValue", - "defaultView", - "defaultstatus", - "defer", - "define", - "defineMagicFunction", - "defineMagicVariable", - "defineProperties", - "defineProperty", - "deg", - "delay", - "delayTime", - "delegatesFocus", - "delete", - "deleteBuffer", - "deleteCaption", - "deleteCell", - "deleteContents", - "deleteData", - "deleteDatabase", - "deleteFramebuffer", - "deleteFromDocument", - "deleteIndex", - "deleteMedium", - "deleteObjectStore", - "deleteProgram", - "deleteProperty", - "deleteQuery", - "deleteRenderbuffer", - "deleteRow", - "deleteRule", - "deleteSampler", - "deleteShader", - "deleteSync", - "deleteTFoot", - "deleteTHead", - "deleteTexture", - "deleteTransformFeedback", - "deleteVertexArray", - "deleted", - "deliverChangeRecords", - "deliveredFrames", - "deliveredFramesDuration", - "delivery", - "deliveryInfo", - "deliveryStatus", - "deliveryTimestamp", - "deliveryType", - "delta", - "deltaMode", - "deltaX", - "deltaY", - "deltaZ", - "dependentLocality", - "deprecatedReplaceInURN", - "deprecatedRunAdAuctionEnforcesKAnonymity", - "deprecatedURNToURL", - "depthBias", - "depthBiasClamp", - "depthBiasSlopeScale", - "depthClearValue", - "depthCompare", - "depthDataFormat", - "depthFailOp", - "depthFar", - "depthFunc", - "depthLoadOp", - "depthMask", - "depthNear", - "depthOrArrayLayers", - "depthRange", - "depthReadOnly", - "depthStencil", - "depthStencilAttachment", - "depthStencilFormat", - "depthStoreOp", - "depthUsage", - "depthWriteEnabled", - "deref", - "deriveBits", - "deriveKey", - "descentOverride", - "description", - "deselectAll", - "designMode", - "desiredSize", - "destination", - "destinationURL", - "destroy", - "detach", - "detachEvent", - "detachShader", - "detached", - "detail", - "details", - "detect", - "detectLanguage", - "detune", - "device", - "deviceClass", - "deviceId", - "deviceMemory", - "devicePixelContentBoxSize", - "devicePixelRatio", - "deviceProtocol", - "deviceSubclass", - "deviceVersionMajor", - "deviceVersionMinor", - "deviceVersionSubminor", - "deviceXDPI", - "deviceYDPI", - "devtools", - "devtools_panels", - "didTimeout", - "difference", - "diffuseConstant", - "digest", - "dimension", - "dimensions", - "dir", - "dirName", - "direction", - "dirxml", - "disable", - "disablePictureInPicture", - "disableRemotePlayback", - "disableVertexAttribArray", - "disabled", - "discard", - "discardedFrames", - "dischargingTime", - "disconnect", - "disconnectShark", - "disconnectedCallback", - "dispatchEvent", - "dispatchWorkgroups", - "dispatchWorkgroupsIndirect", - "display", - "displayHeight", - "displayId", - "displayName", - "displayWidth", - "dispose", - "disposition", - "distanceModel", - "div", - "divisor", - "djsapi", - "djsproxy", - "dns", - "doImport", - "doNotTrack", - "doScroll", - "doctype", - "document", - "documentElement", - "documentId", - "documentIds", - "documentLifecycle", - "documentMode", - "documentOrigin", - "documentOrigins", - "documentPictureInPicture", - "documentURI", - "documentUrl", - "documentUrls", - "dolphin", - "dolphinGameCenter", - "dolphininfo", - "dolphinmeta", - "dom", - "domComplete", - "domContentLoadedEventEnd", - "domContentLoadedEventStart", - "domInteractive", - "domLoading", - "domOverlayState", - "domain", - "domainLookupEnd", - "domainLookupStart", - "dominant-baseline", - "dominantBaseline", - "done", - "dopplerFactor", - "dotAll", - "downDegrees", - "downlink", - "download", - "downloadRequest", - "downloadTotal", - "downloaded", - "downloads", - "dpcm", - "dpi", - "dppx", - "dragDrop", - "draggable", - "draw", - "drawArrays", - "drawArraysInstanced", - "drawArraysInstancedANGLE", - "drawBuffers", - "drawCustomFocusRing", - "drawElements", - "drawElementsInstanced", - "drawElementsInstancedANGLE", - "drawFocusIfNeeded", - "drawImage", - "drawImageFromRect", - "drawIndexed", - "drawIndexedIndirect", - "drawIndirect", - "drawRangeElements", - "drawSystemFocusRing", - "drawingBufferColorSpace", - "drawingBufferFormat", - "drawingBufferHeight", - "drawingBufferStorage", - "drawingBufferWidth", - "drop", - "dropEffect", - "droppedVideoFrames", - "dropzone", - "dstFactor", - "dtmf", - "dump", - "dumpProfile", - "duplex", - "duplicate", - "durability", - "duration", - "dvb", - "dvh", - "dvi", - "dvmax", - "dvmin", - "dvname", - "dvnum", - "dvw", - "dx", - "dy", - "dynamicId", - "dynsrc", - "e", - "edgeMode", - "editContext", - "effect", - "effectAllowed", - "effectiveDirective", - "effectiveType", - "effects", - "elapsedTime", - "element", - "elementFromPoint", - "elementTiming", - "elements", - "elementsFromPoint", - "elevation", - "ellipse", - "em", - "emHeightAscent", - "emHeightDescent", - "email", - "embeds", - "emit", - "emma", - "empty", - "empty-cells", - "emptyCells", - "emptyHTML", - "emptyScript", - "emulatedPosition", - "enable", - "enableBackground", - "enableDelegations", - "enableStyleSheetsForSet", - "enableVertexAttribArray", - "enabled", - "enabledFeatures", - "enabledPlugin", - "encode", - "encodeInto", - "encodeQueueSize", - "encodeURI", - "encodeURIComponent", - "encodedBodySize", - "encoding", - "encodingInfo", - "encrypt", - "enctype", - "end", - "endContainer", - "endElement", - "endElementAt", - "endOcclusionQuery", - "endOfPassWriteIndex", - "endOfStream", - "endOffset", - "endQuery", - "endTime", - "endTransformFeedback", - "ended", - "endpoint", - "endpointNumber", - "endpoints", - "endsWith", - "enqueue", - "enterKeyHint", - "entities", - "entries", - "entry", - "entryPoint", - "entryType", - "enumerable", - "enumerate", - "enumerateDevices", - "enumerateEditable", - "environmentBlendMode", - "equals", - "error", - "errorCode", - "errorDetail", - "errorText", - "escape", - "estimate", - "eval", - "evaluate", - "event", - "eventCounts", - "eventPhase", - "events", - "every", - "ex", - "exception", - "exchange", - "exec", - "execCommand", - "execCommandShowHelp", - "execScript", - "executeBundles", - "executionStart", - "exitFullscreen", - "exitPictureInPicture", - "exitPointerLock", - "exitPresent", - "exp", - "expand", - "expandEntityReferences", - "expando", - "expansion", - "expectedImprovement", - "experiments", - "expiration", - "expirationTime", - "expires", - "expiryDate", - "explicitOriginalTarget", - "expm1", - "exponent", - "exponentialRampToValueAtTime", - "exportKey", - "exports", - "extend", - "extension", - "extensionTypes", - "extensions", - "extentNode", - "extentOffset", - "external", - "externalResourcesRequired", - "externalTexture", - "extractContents", - "extractable", - "eye", - "f", - "f16round", - "face", - "factoryReset", - "failOp", - "failureReason", - "fallback", - "family", - "familyName", - "farthestViewportElement", - "fastSeek", - "fatal", - "featureId", - "featurePolicy", - "featureSettings", - "features", - "fence", - "fenceSync", - "fetch", - "fetchPriority", - "fetchStart", - "fftSize", - "fgColor", - "fieldOfView", - "file", - "fileCreatedDate", - "fileHandle", - "fileModifiedDate", - "fileName", - "fileSize", - "fileUpdatedDate", - "filename", - "files", - "filesystem", - "fill", - "fill-opacity", - "fill-rule", - "fillJointRadii", - "fillLightMode", - "fillOpacity", - "fillPoses", - "fillRect", - "fillRule", - "fillStyle", - "fillText", - "filter", - "filterResX", - "filterResY", - "filterUnits", - "filters", - "finally", - "find", - "findIndex", - "findLast", - "findLastIndex", - "findRule", - "findText", - "finish", - "finishDocumentLoadTime", - "finishLoadTime", - "finished", - "fireEvent", - "firesTouchEvents", - "firstChild", - "firstElementChild", - "firstInterimResponseStart", - "firstPage", - "firstPaintAfterLoadTime", - "firstPaintTime", - "firstUIEventTimestamp", - "fixed", - "flags", - "flat", - "flatMap", - "flex", - "flex-basis", - "flex-direction", - "flex-flow", - "flex-grow", - "flex-shrink", - "flex-wrap", - "flexBasis", - "flexDirection", - "flexFlow", - "flexGrow", - "flexShrink", - "flexWrap", - "flipX", - "flipY", - "float", - "float32", - "float64", - "flood-color", - "flood-opacity", - "floodColor", - "floodOpacity", - "floor", - "flush", - "focus", - "focusNode", - "focusOffset", - "font", - "font-family", - "font-feature-settings", - "font-kerning", - "font-language-override", - "font-optical-sizing", - "font-palette", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-synthesis", - "font-synthesis-position", - "font-synthesis-small-caps", - "font-synthesis-style", - "font-synthesis-weight", - "font-variant", - "font-variant-alternates", - "font-variant-caps", - "font-variant-east-asian", - "font-variant-ligatures", - "font-variant-numeric", - "font-variant-position", - "font-variation-settings", - "font-weight", - "fontBoundingBoxAscent", - "fontBoundingBoxDescent", - "fontFamily", - "fontFeatureSettings", - "fontKerning", - "fontLanguageOverride", - "fontOpticalSizing", - "fontPalette", - "fontSize", - "fontSizeAdjust", - "fontSmoothingEnabled", - "fontStretch", - "fontStyle", - "fontSynthesis", - "fontSynthesisPosition", - "fontSynthesisSmallCaps", - "fontSynthesisStyle", - "fontSynthesisWeight", - "fontVariant", - "fontVariantAlternates", - "fontVariantCaps", - "fontVariantEastAsian", - "fontVariantLigatures", - "fontVariantNumeric", - "fontVariantPosition", - "fontVariationSettings", - "fontWeight", - "fontcolor", - "fontfaces", - "fonts", - "fontsize", - "for", - "forEach", - "force", - "forceFallbackAdapter", - "forceRedraw", - "forced-color-adjust", - "forcedColorAdjust", - "forcedStyleAndLayoutDuration", - "forget", - "form", - "formAction", - "formData", - "formEnctype", - "formMethod", - "formNoValidate", - "formTarget", - "format", - "formatToParts", - "forms", - "forward", - "forwardX", - "forwardY", - "forwardZ", - "foundation", - "fr", - "fragment", - "fragmentDirective", - "frame", - "frameBorder", - "frameCount", - "frameElement", - "frameId", - "frameIds", - "frameSpacing", - "framebuffer", - "framebufferHeight", - "framebufferRenderbuffer", - "framebufferTexture2D", - "framebufferTextureLayer", - "framebufferWidth", - "frames", - "freeSpace", - "freeze", - "frequency", - "frequencyBinCount", - "from", - "fromAsync", - "fromBase64", - "fromCharCode", - "fromCodePoint", - "fromElement", - "fromEntries", - "fromFloat32Array", - "fromFloat64Array", - "fromHex", - "fromMatrix", - "fromPoint", - "fromQuad", - "fromRect", - "frontFace", - "fround", - "fullName", - "fullPath", - "fullRange", - "fullScreen", - "fullVersionList", - "fullscreen", - "fullscreenElement", - "fullscreenEnabled", - "fx", - "fy", - "g", - "gain", - "gamepad", - "gamma", - "gap", - "gatheringState", - "gatt", - "geckoProfiler", - "genderIdentity", - "generateCertificate", - "generateKey", - "generateMipmap", - "generateRequest", - "geolocation", - "gestureObject", - "get", - "getAcceptLanguages", - "getActiveAttrib", - "getActiveUniform", - "getActiveUniformBlockName", - "getActiveUniformBlockParameter", - "getActiveUniforms", - "getAdjacentText", - "getAll", - "getAllKeys", - "getAllResponseHeaders", - "getAllowlistForFeature", - "getAnimations", - "getAsFile", - "getAsFileSystemHandle", - "getAsString", - "getAttachedShaders", - "getAttribLocation", - "getAttribute", - "getAttributeNS", - "getAttributeNames", - "getAttributeNode", - "getAttributeNodeNS", - "getAttributeType", - "getAudioTracks", - "getAuthenticatorData", - "getAutoplayPolicy", - "getAvailability", - "getBBox", - "getBackgroundPage", - "getBadgeBackgroundColor", - "getBadgeText", - "getBadgeTextColor", - "getBattery", - "getBigInt64", - "getBigUint64", - "getBindGroupLayout", - "getBlob", - "getBookmark", - "getBoundingClientRect", - "getBounds", - "getBoxQuads", - "getBrowserInfo", - "getBufferParameter", - "getBufferSubData", - "getByteFrequencyData", - "getByteTimeDomainData", - "getCSSCanvasContext", - "getCTM", - "getCameraImage", - "getCandidateWindowClientRect", - "getCanonicalLocales", - "getCapabilities", - "getCaptureHandle", - "getChannelData", - "getCharNumAtPosition", - "getCharacteristic", - "getCharacteristics", - "getClientExtensionResults", - "getClientRect", - "getClientRects", - "getCoalescedEvents", - "getCompilationInfo", - "getCompositionAlternatives", - "getComputedStyle", - "getComputedTextLength", - "getComputedTiming", - "getConfiguration", - "getConstraints", - "getContext", - "getContextAttributes", - "getContexts", - "getContributingSources", - "getCounterValue", - "getCueAsHTML", - "getCueById", - "getCurrent", - "getCurrentPosition", - "getCurrentTexture", - "getCurrentTime", - "getData", - "getDatabaseNames", - "getDate", - "getDay", - "getDefaultComputedStyle", - "getDepthInMeters", - "getDepthInformation", - "getDescriptor", - "getDescriptors", - "getDestinationInsertionPoints", - "getDevices", - "getDirectory", - "getDirectoryHandle", - "getDisplayMedia", - "getDistributedNodes", - "getEditable", - "getElementById", - "getElementsByClassName", - "getElementsByName", - "getElementsByTagName", - "getElementsByTagNameNS", - "getEnclosureList", - "getEndPositionOfChar", - "getEntries", - "getEntriesByName", - "getEntriesByType", - "getError", - "getExtension", - "getExtentOfChar", - "getEyeParameters", - "getFeature", - "getFiberRoots", - "getFile", - "getFileHandle", - "getFiles", - "getFilesAndDirectories", - "getFingerprints", - "getFloat16", - "getFloat32", - "getFloat64", - "getFloatFrequencyData", - "getFloatTimeDomainData", - "getFloatValue", - "getFragDataLocation", - "getFrameData", - "getFrameId", - "getFramebufferAttachmentParameter", - "getFrequencyResponse", - "getFullYear", - "getGamepads", - "getHTML", - "getHeaderExtensionsToNegotiate", - "getHighEntropyValues", - "getHitTestResults", - "getHitTestResultsForTransientInput", - "getHours", - "getIdentityAssertion", - "getIds", - "getImageData", - "getIndexedParameter", - "getInfo", - "getInnerHTML", - "getInstalledRelatedApps", - "getInt16", - "getInt32", - "getInt8", - "getInterestGroupAdAuctionData", - "getInternalModuleRanges", - "getInternalformatParameter", - "getIntersectionList", - "getItem", - "getItems", - "getJointPose", - "getKey", - "getKeyframes", - "getLastFocused", - "getLayers", - "getLayoutMap", - "getLightEstimate", - "getLineDash", - "getLocalCandidates", - "getLocalParameters", - "getLocalStreams", - "getManagedConfiguration", - "getManifest", - "getMappedRange", - "getMarks", - "getMatchedCSSRules", - "getMaxGCPauseSinceClear", - "getMeasures", - "getMessage", - "getMetadata", - "getMilliseconds", - "getMinutes", - "getModifierState", - "getMonth", - "getName", - "getNamedItem", - "getNamedItemNS", - "getNativeFramebufferScaleFactor", - "getNegotiatedHeaderExtensions", - "getNestedConfigs", - "getNotifications", - "getNotifier", - "getNumberOfChars", - "getOffsetReferenceSpace", - "getOutputTimestamp", - "getOverrideHistoryNavigationMode", - "getOverrideStyle", - "getOwnPropertyDescriptor", - "getOwnPropertyDescriptors", - "getOwnPropertyNames", - "getOwnPropertySymbols", - "getPackageDirectoryEntry", - "getParameter", - "getParameters", - "getParent", - "getPathSegAtLength", - "getPermissionWarningsByManifest", - "getPhotoCapabilities", - "getPhotoSettings", - "getPlatformInfo", - "getPointAtLength", - "getPopup", - "getPorts", - "getPose", - "getPredictedEvents", - "getPreference", - "getPreferenceDefault", - "getPreferredCanvasFormat", - "getPresentationAttribute", - "getPreventDefault", - "getPrimaryService", - "getPrimaryServices", - "getProgramInfoLog", - "getProgramParameter", - "getPropertyCSSValue", - "getPropertyPriority", - "getPropertyShorthand", - "getPropertyType", - "getPropertyValue", - "getPrototypeOf", - "getPublicKey", - "getPublicKeyAlgorithm", - "getQuery", - "getQueryParameter", - "getRGBColorValue", - "getRandomValues", - "getRangeAt", - "getReader", - "getReceivers", - "getRectValue", - "getReflectionCubeMap", - "getRegistration", - "getRegistrations", - "getRemoteCandidates", - "getRemoteCertificates", - "getRemoteParameters", - "getRemoteStreams", - "getRenderbufferParameter", - "getResponseHeader", - "getRoot", - "getRootNode", - "getRotationOfChar", - "getSVGDocument", - "getSamplerParameter", - "getScreenCTM", - "getScreenDetails", - "getSeconds", - "getSelectedCandidatePair", - "getSelection", - "getSelf", - "getSenders", - "getService", - "getSetCookie", - "getSettings", - "getShaderInfoLog", - "getShaderParameter", - "getShaderPrecisionFormat", - "getShaderSource", - "getSignals", - "getSimpleDuration", - "getSiteIcons", - "getSources", - "getSpeculativeParserUrls", - "getStartPositionOfChar", - "getStartTime", - "getState", - "getStats", - "getStatusForPolicy", - "getStorageUpdates", - "getStreamById", - "getStringValue", - "getSubStringLength", - "getSubscription", - "getSubscriptions", - "getSupportedConstraints", - "getSupportedExtensions", - "getSupportedFormats", - "getSyncParameter", - "getSynchronizationSources", - "getTags", - "getTargetRanges", - "getTexParameter", - "getTextFormats", - "getTime", - "getTimezoneOffset", - "getTiming", - "getTitle", - "getTitlebarAreaRect", - "getTotalLength", - "getTrackById", - "getTracks", - "getTransceivers", - "getTransform", - "getTransformFeedbackVarying", - "getTransformToElement", - "getTransports", - "getType", - "getTypeMapping", - "getUILanguage", - "getURL", - "getUTCDate", - "getUTCDay", - "getUTCFullYear", - "getUTCHours", - "getUTCMilliseconds", - "getUTCMinutes", - "getUTCMonth", - "getUTCSeconds", - "getUint16", - "getUint32", - "getUint8", - "getUniform", - "getUniformBlockIndex", - "getUniformIndices", - "getUniformLocation", - "getUserInfo", - "getUserMedia", - "getUserSettings", - "getVRDisplays", - "getValues", - "getVarDate", - "getVariableValue", - "getVertexAttrib", - "getVertexAttribOffset", - "getVideoPlaybackQuality", - "getVideoTracks", - "getViewerPose", - "getViewport", - "getViews", - "getVoices", - "getWakeLockState", - "getWriter", - "getYear", - "getZoom", - "getZoomSettings", - "givenName", - "global", - "globalAlpha", - "globalCompositeOperation", - "globalPrivacyControl", - "globalThis", - "glyphOrientationHorizontal", - "glyphOrientationVertical", - "glyphRef", - "go", - "goBack", - "goForward", - "gpu", - "grabFrame", - "grad", - "gradientTransform", - "gradientUnits", - "grammars", - "green", - "grid", - "grid-area", - "grid-auto-columns", - "grid-auto-flow", - "grid-auto-rows", - "grid-column", - "grid-column-end", - "grid-column-gap", - "grid-column-start", - "grid-gap", - "grid-row", - "grid-row-end", - "grid-row-gap", - "grid-row-start", - "grid-template", - "grid-template-areas", - "grid-template-columns", - "grid-template-rows", - "gridArea", - "gridAutoColumns", - "gridAutoFlow", - "gridAutoRows", - "gridColumn", - "gridColumnEnd", - "gridColumnGap", - "gridColumnStart", - "gridGap", - "gridRow", - "gridRowEnd", - "gridRowGap", - "gridRowStart", - "gridTemplate", - "gridTemplateAreas", - "gridTemplateColumns", - "gridTemplateRows", - "gripSpace", - "group", - "groupBy", - "groupCollapsed", - "groupEnd", - "groupId", - "groups", - "grow", - "growable", - "guestProcessId", - "guestRenderFrameRoutingId", - "hadRecentInput", - "hand", - "handedness", - "hangingBaseline", - "hapticActuators", - "hardwareConcurrency", - "has", - "hasAttribute", - "hasAttributeNS", - "hasAttributes", - "hasBeenActive", - "hasChildNodes", - "hasComposition", - "hasDynamicOffset", - "hasEnrolledInstrument", - "hasExtension", - "hasExternalDisplay", - "hasFeature", - "hasFocus", - "hasIndices", - "hasInstance", - "hasLayout", - "hasOrientation", - "hasOwn", - "hasOwnProperty", - "hasPointerCapture", - "hasPosition", - "hasPrivateToken", - "hasReading", - "hasRedemptionRecord", - "hasRegExpGroups", - "hasStorageAccess", - "hasUAVisualTransition", - "hasUnpartitionedCookieAccess", - "hash", - "hashChange", - "head", - "headers", - "heading", - "height", - "hid", - "hidden", - "hide", - "hideFocus", - "hidePopover", - "high", - "highWaterMark", - "highlight", - "highlights", - "hint", - "hints", - "history", - "honorificPrefix", - "honorificSuffix", - "horizontalOverflow", - "host", - "hostCandidate", - "hostname", - "href", - "hrefTranslate", - "hreflang", - "hspace", - "html5TagCheckInerface", - "htmlFor", - "htmlText", - "httpEquiv", - "httpRequestStatusCode", - "hwTimestamp", - "hyphenate-character", - "hyphenateCharacter", - "hyphens", - "hypot", - "i18n", - "ic", - "iccId", - "iceConnectionState", - "iceGatheringState", - "iceTransport", - "icon", - "iconURL", - "id", - "identifier", - "identity", - "ideographicBaseline", - "idle", - "idpLoginUrl", - "ignoreBOM", - "ignoreCase", - "ignoreDepthValues", - "image", - "image-orientation", - "image-rendering", - "imageHeight", - "imageOrientation", - "imageRendering", - "imageSizes", - "imageSmoothingEnabled", - "imageSmoothingQuality", - "imageSrcset", - "imageWidth", - "images", - "ime-mode", - "imeMode", - "implementation", - "importExternalTexture", - "importKey", - "importNode", - "importStylesheet", - "imports", - "impp", - "imul", - "in", - "in1", - "in2", - "inBandMetadataTrackDispatchType", - "inIncognitoContext", - "inRange", - "includes", - "incognito", - "incomingBidirectionalStreams", - "incomingHighWaterMark", - "incomingMaxAge", - "incomingUnidirectionalStreams", - "incremental", - "indeterminate", - "index", - "indexNames", - "indexOf", - "indexedDB", - "indicate", - "indices", - "inert", - "inertiaDestinationX", - "inertiaDestinationY", - "info", - "inherits", - "init", - "initAnimationEvent", - "initBeforeLoadEvent", - "initClipboardEvent", - "initCloseEvent", - "initCommandEvent", - "initCompositionEvent", - "initCustomEvent", - "initData", - "initDataType", - "initDeviceMotionEvent", - "initDeviceOrientationEvent", - "initDragEvent", - "initErrorEvent", - "initEvent", - "initFocusEvent", - "initGestureEvent", - "initHashChangeEvent", - "initKeyEvent", - "initKeyboardEvent", - "initMSManipulationEvent", - "initMessageEvent", - "initMouseEvent", - "initMouseScrollEvent", - "initMouseWheelEvent", - "initMutationEvent", - "initNSMouseEvent", - "initOverflowEvent", - "initPageEvent", - "initPageTransitionEvent", - "initPointerEvent", - "initPopStateEvent", - "initProgressEvent", - "initScrollAreaEvent", - "initSimpleGestureEvent", - "initStorageEvent", - "initTextEvent", - "initTimeEvent", - "initTouchEvent", - "initTransitionEvent", - "initUIEvent", - "initWebKitAnimationEvent", - "initWebKitTransitionEvent", - "initWebKitWheelEvent", - "initWheelEvent", - "initialTime", - "initialValue", - "initialize", - "initiatorType", - "inject", - "ink", - "inline-size", - "inlineSize", - "inlineVerticalFieldOfView", - "inner", - "innerHTML", - "innerHeight", - "innerText", - "innerWidth", - "input", - "inputBuffer", - "inputEncoding", - "inputMethod", - "inputMode", - "inputSource", - "inputSources", - "inputType", - "inputs", - "insertAdjacentElement", - "insertAdjacentHTML", - "insertAdjacentText", - "insertBefore", - "insertCell", - "insertDTMF", - "insertData", - "insertDebugMarker", - "insertItemBefore", - "insertNode", - "insertRow", - "insertRule", - "inset", - "inset-block", - "inset-block-end", - "inset-block-start", - "inset-inline", - "inset-inline-end", - "inset-inline-start", - "insetBlock", - "insetBlockEnd", - "insetBlockStart", - "insetInline", - "insetInlineEnd", - "insetInlineStart", - "install", - "installing", - "instanceRoot", - "instantiate", - "instantiateStreaming", - "instruments", - "int16", - "int32", - "int8", - "integrity", - "interactionId", - "interactionMode", - "intercept", - "interfaceClass", - "interfaceName", - "interfaceNumber", - "interfaceProtocol", - "interfaceSubclass", - "interfaces", - "interimResults", - "internalSubset", - "interpretation", - "intersection", - "intersectionRatio", - "intersectionRect", - "intersectsNode", - "interval", - "invalidIteratorState", - "invalidateFramebuffer", - "invalidateSubFramebuffer", - "inverse", - "invertSelf", - "invoker", - "invokerType", - "is", - "is2D", - "isActive", - "isAllowedFileSchemeAccess", - "isAllowedIncognitoAccess", - "isAlternate", - "isArray", - "isAutoSelected", - "isBingCurrentSearchDefault", - "isBuffer", - "isCandidateWindowVisible", - "isChar", - "isCollapsed", - "isComposing", - "isConcatSpreadable", - "isConditionalMediationAvailable", - "isConfigSupported", - "isConnected", - "isContentEditable", - "isContentHandlerRegistered", - "isContextLost", - "isDefaultNamespace", - "isDirectory", - "isDisabled", - "isDisjointFrom", - "isEnabled", - "isEqual", - "isEqualNode", - "isExtended", - "isExtensible", - "isExternalCTAP2SecurityKeySupported", - "isFallbackAdapter", - "isFile", - "isFinite", - "isFirstPersonObserver", - "isFramebuffer", - "isFrozen", - "isGenerator", - "isHTML", - "isHistoryNavigation", - "isId", - "isIdentity", - "isInjected", - "isInputPending", - "isInteger", - "isInternal", - "isIntersecting", - "isLockFree", - "isMap", - "isMultiLine", - "isNaN", - "isOpen", - "isPointInFill", - "isPointInPath", - "isPointInRange", - "isPointInStroke", - "isPrefAlternate", - "isPresenting", - "isPrimary", - "isProgram", - "isPropertyImplicit", - "isProtocolHandlerRegistered", - "isPrototypeOf", - "isQuery", - "isRawJSON", - "isRenderbuffer", - "isSafeInteger", - "isSameEntry", - "isSameNode", - "isSampler", - "isScript", - "isScriptURL", - "isSealed", - "isSecureContext", - "isSessionSupported", - "isShader", - "isSubsetOf", - "isSupersetOf", - "isSupported", - "isSync", - "isTextEdit", - "isTexture", - "isTransformFeedback", - "isTrusted", - "isTypeSupported", - "isUserVerifyingPlatformAuthenticatorAvailable", - "isVertexArray", - "isView", - "isVisible", - "isWellFormed", - "isochronousTransferIn", - "isochronousTransferOut", - "isolation", - "italics", - "item", - "itemId", - "itemProp", - "itemRef", - "itemScope", - "itemType", - "itemValue", - "items", - "iterateNext", - "iterationComposite", - "iterator", - "javaEnabled", - "jitterBufferTarget", - "jobTitle", - "join", - "joinAdInterestGroup", - "jointName", - "json", - "justify-content", - "justify-items", - "justify-self", - "justifyContent", - "justifyItems", - "justifySelf", - "k1", - "k2", - "k3", - "k4", - "kHz", - "keepalive", - "kernelMatrix", - "kernelUnitLengthX", - "kernelUnitLengthY", - "kerning", - "key", - "keyCode", - "keyFor", - "keyIdentifier", - "keyLightEnabled", - "keyLocation", - "keyPath", - "keyStatuses", - "keySystem", - "keyText", - "keyUsage", - "keyboard", - "keys", - "keytype", - "kind", - "knee", - "knownSources", - "label", - "labels", - "lang", - "language", - "languages", - "largeArcFlag", - "lastChild", - "lastElementChild", - "lastError", - "lastEventId", - "lastIndex", - "lastIndexOf", - "lastInputTime", - "lastMatch", - "lastMessageSubject", - "lastMessageType", - "lastModified", - "lastModifiedDate", - "lastPage", - "lastParen", - "lastState", - "lastStyleSheetSet", - "latency", - "latitude", - "launchQueue", - "layerName", - "layerX", - "layerY", - "layout", - "layoutFlow", - "layoutGrid", - "layoutGridChar", - "layoutGridLine", - "layoutGridMode", - "layoutGridType", - "lbound", - "leaveAdInterestGroup", - "left", - "leftContext", - "leftDegrees", - "leftMargin", - "leftProjectionMatrix", - "leftViewMatrix", - "length", - "lengthAdjust", - "lengthComputable", - "letter-spacing", - "letterSpacing", - "level", - "lh", - "lighting-color", - "lightingColor", - "limitingConeAngle", - "limits", - "line", - "line-break", - "line-height", - "lineAlign", - "lineBreak", - "lineCap", - "lineDashOffset", - "lineGapOverride", - "lineHeight", - "lineJoin", - "lineNum", - "lineNumber", - "linePos", - "lineTo", - "lineWidth", - "linearAcceleration", - "linearRampToValueAtTime", - "linearVelocity", - "lineno", - "lines", - "link", - "linkColor", - "linkProgram", - "links", - "list", - "list-style", - "list-style-image", - "list-style-position", - "list-style-type", - "listStyle", - "listStyleImage", - "listStylePosition", - "listStyleType", - "listener", - "listeners", - "load", - "loadEventEnd", - "loadEventStart", - "loadOp", - "loadTime", - "loadTimes", - "loaded", - "loading", - "localDescription", - "localName", - "localService", - "localStorage", - "locale", - "localeCompare", - "location", - "locationbar", - "lock", - "locked", - "lockedFile", - "locks", - "lodMaxClamp", - "lodMinClamp", - "log", - "log10", - "log1p", - "log2", - "logicalXDPI", - "logicalYDPI", - "login", - "loglevel", - "longDesc", - "longitude", - "lookupNamespaceURI", - "lookupPrefix", - "loop", - "loopEnd", - "loopStart", - "looping", - "lost", - "low", - "lower", - "lowerBound", - "lowerOpen", - "lowsrc", - "lvb", - "lvh", - "lvi", - "lvmax", - "lvmin", - "lvw", - "m11", - "m12", - "m13", - "m14", - "m21", - "m22", - "m23", - "m24", - "m31", - "m32", - "m33", - "m34", - "m41", - "m42", - "m43", - "m44", - "magFilter", - "makeXRCompatible", - "managed", - "management", - "manifest", - "manufacturer", - "manufacturerName", - "map", - "mapAsync", - "mapState", - "mappedAtCreation", - "mapping", - "margin", - "margin-block", - "margin-block-end", - "margin-block-start", - "margin-bottom", - "margin-inline", - "margin-inline-end", - "margin-inline-start", - "margin-left", - "margin-right", - "margin-top", - "marginBlock", - "marginBlockEnd", - "marginBlockStart", - "marginBottom", - "marginHeight", - "marginInline", - "marginInlineEnd", - "marginInlineStart", - "marginLeft", - "marginRight", - "marginTop", - "marginWidth", - "mark", - "marker", - "marker-end", - "marker-mid", - "marker-offset", - "marker-start", - "markerEnd", - "markerHeight", - "markerMid", - "markerOffset", - "markerStart", - "markerUnits", - "markerWidth", - "marks", - "mask", - "mask-clip", - "mask-composite", - "mask-image", - "mask-mode", - "mask-origin", - "mask-position", - "mask-position-x", - "mask-position-y", - "mask-repeat", - "mask-size", - "mask-type", - "maskClip", - "maskComposite", - "maskContentUnits", - "maskImage", - "maskMode", - "maskOrigin", - "maskPosition", - "maskPositionX", - "maskPositionY", - "maskRepeat", - "maskSize", - "maskType", - "maskUnits", - "match", - "matchAll", - "matchMedia", - "matchMedium", - "matchPatterns", - "matches", - "math-depth", - "math-style", - "mathDepth", - "mathStyle", - "matrix", - "matrixTransform", - "max", - "max-block-size", - "max-height", - "max-inline-size", - "max-width", - "maxActions", - "maxAlternatives", - "maxAnisotropy", - "maxBindGroups", - "maxBindGroupsPlusVertexBuffers", - "maxBindingsPerBindGroup", - "maxBlockSize", - "maxBufferSize", - "maxByteLength", - "maxChannelCount", - "maxChannels", - "maxColorAttachmentBytesPerSample", - "maxColorAttachments", - "maxComputeInvocationsPerWorkgroup", - "maxComputeWorkgroupSizeX", - "maxComputeWorkgroupSizeY", - "maxComputeWorkgroupSizeZ", - "maxComputeWorkgroupStorageSize", - "maxComputeWorkgroupsPerDimension", - "maxConnectionsPerServer", - "maxDatagramSize", - "maxDecibels", - "maxDistance", - "maxDrawCount", - "maxDynamicStorageBuffersPerPipelineLayout", - "maxDynamicUniformBuffersPerPipelineLayout", - "maxHeight", - "maxInlineSize", - "maxInterStageShaderComponents", - "maxInterStageShaderVariables", - "maxLayers", - "maxLength", - "maxMessageSize", - "maxPacketLifeTime", - "maxRetransmits", - "maxSampledTexturesPerShaderStage", - "maxSamplersPerShaderStage", - "maxStorageBufferBindingSize", - "maxStorageBuffersPerShaderStage", - "maxStorageTexturesPerShaderStage", - "maxTextureArrayLayers", - "maxTextureDimension1D", - "maxTextureDimension2D", - "maxTextureDimension3D", - "maxTouchPoints", - "maxUniformBufferBindingSize", - "maxUniformBuffersPerShaderStage", - "maxValue", - "maxVertexAttributes", - "maxVertexBufferArrayStride", - "maxVertexBuffers", - "maxWidth", - "maximumLatency", - "measure", - "measureText", - "media", - "mediaCapabilities", - "mediaDevices", - "mediaElement", - "mediaGroup", - "mediaKeys", - "mediaSession", - "mediaStream", - "mediaText", - "meetOrSlice", - "memory", - "menubar", - "menus", - "menusChild", - "menusInternal", - "mergeAttributes", - "message", - "messageClass", - "messageHandlers", - "messageType", - "messages", - "metaKey", - "metadata", - "method", - "methodDetails", - "methodName", - "mid", - "mimeType", - "mimeTypes", - "min", - "min-block-size", - "min-height", - "min-inline-size", - "min-width", - "minBindingSize", - "minBlockSize", - "minDecibels", - "minFilter", - "minHeight", - "minInlineSize", - "minLength", - "minStorageBufferOffsetAlignment", - "minUniformBufferOffsetAlignment", - "minValue", - "minWidth", - "minimumLatency", - "mipLevel", - "mipLevelCount", - "mipmapFilter", - "miterLimit", - "mix-blend-mode", - "mixBlendMode", - "mm", - "mobile", - "mode", - "model", - "modify", - "module", - "mount", - "move", - "moveBy", - "moveEnd", - "moveFirst", - "moveFocusDown", - "moveFocusLeft", - "moveFocusRight", - "moveFocusUp", - "moveInSuccession", - "moveNext", - "moveRow", - "moveStart", - "moveTo", - "moveToBookmark", - "moveToElementText", - "moveToPoint", - "movementX", - "movementY", - "mozAdd", - "mozAnimationStartTime", - "mozAnon", - "mozApps", - "mozAudioCaptured", - "mozAudioChannelType", - "mozAutoplayEnabled", - "mozCancelAnimationFrame", - "mozCancelFullScreen", - "mozCancelRequestAnimationFrame", - "mozCaptureStream", - "mozCaptureStreamUntilEnded", - "mozClearDataAt", - "mozContact", - "mozContacts", - "mozCreateFileHandle", - "mozCurrentTransform", - "mozCurrentTransformInverse", - "mozCursor", - "mozDash", - "mozDashOffset", - "mozDecodedFrames", - "mozExitPointerLock", - "mozFillRule", - "mozFragmentEnd", - "mozFrameDelay", - "mozFullScreen", - "mozFullScreenElement", - "mozFullScreenEnabled", - "mozGetAll", - "mozGetAllKeys", - "mozGetAsFile", - "mozGetDataAt", - "mozGetMetadata", - "mozGetUserMedia", - "mozHasAudio", - "mozHasItem", - "mozHidden", - "mozImageSmoothingEnabled", - "mozIndexedDB", - "mozInnerScreenX", - "mozInnerScreenY", - "mozInputSource", - "mozIsTextField", - "mozItem", - "mozItemCount", - "mozItems", - "mozLength", - "mozLockOrientation", - "mozMatchesSelector", - "mozMovementX", - "mozMovementY", - "mozOpaque", - "mozOrientation", - "mozPaintCount", - "mozPaintedFrames", - "mozParsedFrames", - "mozPay", - "mozPointerLockElement", - "mozPresentedFrames", - "mozPreservesPitch", - "mozPressure", - "mozPrintCallback", - "mozRTCIceCandidate", - "mozRTCPeerConnection", - "mozRTCSessionDescription", - "mozRemove", - "mozRequestAnimationFrame", - "mozRequestFullScreen", - "mozRequestPointerLock", - "mozSetDataAt", - "mozSetImageElement", - "mozSourceNode", - "mozSrcObject", - "mozSystem", - "mozTCPSocket", - "mozTextStyle", - "mozTypesAt", - "mozUnlockOrientation", - "mozUserCancelled", - "mozVisibilityState", - "ms", - "msAnimation", - "msAnimationDelay", - "msAnimationDirection", - "msAnimationDuration", - "msAnimationFillMode", - "msAnimationIterationCount", - "msAnimationName", - "msAnimationPlayState", - "msAnimationStartTime", - "msAnimationTimingFunction", - "msBackfaceVisibility", - "msBlockProgression", - "msCSSOMElementFloatMetrics", - "msCaching", - "msCachingEnabled", - "msCancelRequestAnimationFrame", - "msCapsLockWarningOff", - "msClearImmediate", - "msClose", - "msContentZoomChaining", - "msContentZoomFactor", - "msContentZoomLimit", - "msContentZoomLimitMax", - "msContentZoomLimitMin", - "msContentZoomSnap", - "msContentZoomSnapPoints", - "msContentZoomSnapType", - "msContentZooming", - "msConvertURL", - "msCrypto", - "msDoNotTrack", - "msElementsFromPoint", - "msElementsFromRect", - "msExitFullscreen", - "msExtendedCode", - "msFillRule", - "msFirstPaint", - "msFlex", - "msFlexAlign", - "msFlexDirection", - "msFlexFlow", - "msFlexItemAlign", - "msFlexLinePack", - "msFlexNegative", - "msFlexOrder", - "msFlexPack", - "msFlexPositive", - "msFlexPreferredSize", - "msFlexWrap", - "msFlowFrom", - "msFlowInto", - "msFontFeatureSettings", - "msFullscreenElement", - "msFullscreenEnabled", - "msGetInputContext", - "msGetRegionContent", - "msGetUntransformedBounds", - "msGraphicsTrustStatus", - "msGridColumn", - "msGridColumnAlign", - "msGridColumnSpan", - "msGridColumns", - "msGridRow", - "msGridRowAlign", - "msGridRowSpan", - "msGridRows", - "msHidden", - "msHighContrastAdjust", - "msHyphenateLimitChars", - "msHyphenateLimitLines", - "msHyphenateLimitZone", - "msHyphens", - "msImageSmoothingEnabled", - "msImeAlign", - "msIndexedDB", - "msInterpolationMode", - "msIsStaticHTML", - "msKeySystem", - "msKeys", - "msLaunchUri", - "msLockOrientation", - "msManipulationViewsEnabled", - "msMatchMedia", - "msMatchesSelector", - "msMaxTouchPoints", - "msOrientation", - "msOverflowStyle", - "msPerspective", - "msPerspectiveOrigin", - "msPlayToDisabled", - "msPlayToPreferredSourceUri", - "msPlayToPrimary", - "msPointerEnabled", - "msRegionOverflow", - "msReleasePointerCapture", - "msRequestAnimationFrame", - "msRequestFullscreen", - "msSaveBlob", - "msSaveOrOpenBlob", - "msScrollChaining", - "msScrollLimit", - "msScrollLimitXMax", - "msScrollLimitXMin", - "msScrollLimitYMax", - "msScrollLimitYMin", - "msScrollRails", - "msScrollSnapPointsX", - "msScrollSnapPointsY", - "msScrollSnapType", - "msScrollSnapX", - "msScrollSnapY", - "msScrollTranslation", - "msSetImmediate", - "msSetMediaKeys", - "msSetPointerCapture", - "msTextCombineHorizontal", - "msTextSizeAdjust", - "msToBlob", - "msTouchAction", - "msTouchSelect", - "msTraceAsyncCallbackCompleted", - "msTraceAsyncCallbackStarting", - "msTraceAsyncOperationCompleted", - "msTraceAsyncOperationStarting", - "msTransform", - "msTransformOrigin", - "msTransformStyle", - "msTransition", - "msTransitionDelay", - "msTransitionDuration", - "msTransitionProperty", - "msTransitionTimingFunction", - "msUnlockOrientation", - "msUpdateAsyncCallbackRelation", - "msUserSelect", - "msVisibilityState", - "msWrapFlow", - "msWrapMargin", - "msWrapThrough", - "msWriteProfilerMark", - "msZoom", - "msZoomTo", - "mt", - "mul", - "multiEntry", - "multiSelectionObj", - "multiline", - "multiple", - "multiply", - "multiplySelf", - "multisample", - "multisampled", - "mutableFile", - "muted", - "n", - "nacl_arch", - "name", - "nameList", - "nameProp", - "namedItem", - "namedRecordset", - "names", - "namespaceURI", - "namespaces", - "nativeApplication", - "nativeMap", - "nativeObjectCreate", - "nativeSet", - "nativeWeakMap", - "naturalHeight", - "naturalWidth", - "navigate", - "navigation", - "navigationMode", - "navigationPreload", - "navigationStart", - "navigationType", - "navigator", - "near", - "nearestViewportElement", - "negative", - "negotiated", - "netscape", - "networkState", - "networkStatus", - "newScale", - "newState", - "newTranslate", - "newURL", - "newValue", - "newValueSpecifiedUnits", - "newVersion", - "newhome", - "next", - "nextElementSibling", - "nextHopProtocol", - "nextNode", - "nextPage", - "nextSibling", - "nickname", - "noHref", - "noModule", - "noResize", - "noShade", - "noValidate", - "noWrap", - "node", - "nodeName", - "nodeType", - "nodeValue", - "nonce", - "normDepthBufferFromNormView", - "normalize", - "normalizedPathSegList", - "normandyAddonStudy", - "notRestoredReasons", - "notationName", - "notations", - "note", - "noteGrainOn", - "noteOff", - "noteOn", - "notifications", - "notify", - "now", - "npnNegotiatedProtocol", - "numOctaves", - "number", - "numberOfChannels", - "numberOfFrames", - "numberOfInputs", - "numberOfItems", - "numberOfOutputs", - "numberValue", - "oMatchesSelector", - "object", - "object-fit", - "object-position", - "objectFit", - "objectPosition", - "objectStore", - "objectStoreNames", - "objectType", - "observe", - "occlusionQuerySet", - "of", - "off", - "offscreenBuffering", - "offset", - "offset-anchor", - "offset-distance", - "offset-path", - "offset-position", - "offset-rotate", - "offsetAnchor", - "offsetDistance", - "offsetHeight", - "offsetLeft", - "offsetNode", - "offsetParent", - "offsetPath", - "offsetPosition", - "offsetRotate", - "offsetTop", - "offsetWidth", - "offsetX", - "offsetY", - "ok", - "oldState", - "oldURL", - "oldValue", - "oldVersion", - "olderShadowRoot", - "omnibox", - "on", - "onActivated", - "onAdded", - "onAttached", - "onBoundsChanged", - "onBrowserUpdateAvailable", - "onClicked", - "onCommitFiberRoot", - "onCommitFiberUnmount", - "onConnect", - "onConnectExternal", - "onConnectNative", - "onCreated", - "onDetached", - "onDisabled", - "onEnabled", - "onFocusChanged", - "onHighlighted", - "onInstalled", - "onLine", - "onMessage", - "onMessageExternal", - "onMoved", - "onPerformanceWarning", - "onPostCommitFiberRoot", - "onRemoved", - "onReplaced", - "onRestartRequired", - "onStartup", - "onSubmittedWorkDone", - "onSuspend", - "onSuspendCanceled", - "onUninstalled", - "onUpdateAvailable", - "onUpdated", - "onUserScriptConnect", - "onUserScriptMessage", - "onUserSettingsChanged", - "onZoomChange", - "onabort", - "onabsolutedeviceorientation", - "onactivate", - "onactive", - "onaddsourcebuffer", - "onaddstream", - "onaddtrack", - "onafterprint", - "onafterscriptexecute", - "onafterupdate", - "onanimationcancel", - "onanimationend", - "onanimationiteration", - "onanimationstart", - "onappinstalled", - "onaudioend", - "onaudioprocess", - "onaudiostart", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onbeforeactivate", - "onbeforecopy", - "onbeforecut", - "onbeforedeactivate", - "onbeforeeditfocus", - "onbeforeinput", - "onbeforeinstallprompt", - "onbeforematch", - "onbeforepaste", - "onbeforeprint", - "onbeforescriptexecute", - "onbeforetoggle", - "onbeforeunload", - "onbeforeupdate", - "onbeforexrselect", - "onbegin", - "onblocked", - "onblur", - "onbounce", - "onboundary", - "onbufferedamountlow", - "oncached", - "oncancel", - "oncandidatewindowhide", - "oncandidatewindowshow", - "oncandidatewindowupdate", - "oncanplay", - "oncanplaythrough", - "oncapturehandlechange", - "once", - "oncellchange", - "onchange", - "oncharacterboundsupdate", - "oncharacteristicvaluechanged", - "onchargingchange", - "onchargingtimechange", - "onchecking", - "onclick", - "onclose", - "onclosing", - "oncompassneedscalibration", - "oncomplete", - "oncompositionend", - "oncompositionstart", - "onconnect", - "onconnecting", - "onconnectionavailable", - "onconnectionstatechange", - "oncontentvisibilityautostatechange", - "oncontextlost", - "oncontextmenu", - "oncontextrestored", - "oncontrollerchange", - "oncontrolselect", - "oncopy", - "oncuechange", - "oncurrententrychange", - "oncurrentscreenchange", - "oncut", - "ondataavailable", - "ondatachannel", - "ondatasetchanged", - "ondatasetcomplete", - "ondblclick", - "ondeactivate", - "ondequeue", - "ondevicechange", - "ondevicelight", - "ondevicemotion", - "ondeviceorientation", - "ondeviceorientationabsolute", - "ondeviceproximity", - "ondischargingtimechange", - "ondisconnect", - "ondisplay", - "ondispose", - "ondownloading", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onencrypted", - "onend", - "onended", - "onenter", - "onenterpictureinpicture", - "onerror", - "onerrorupdate", - "onexit", - "onfencedtreeclick", - "onfilterchange", - "onfinish", - "onfocus", - "onfocusin", - "onfocusout", - "onformdata", - "onfreeze", - "onfullscreenchange", - "onfullscreenerror", - "ongamepadconnected", - "ongamepaddisconnected", - "ongatheringstatechange", - "ongattserverdisconnected", - "ongeometrychange", - "ongesturechange", - "ongestureend", - "ongesturestart", - "ongotpointercapture", - "onhashchange", - "onhelp", - "onicecandidate", - "onicecandidateerror", - "oniceconnectionstatechange", - "onicegatheringstatechange", - "oninactive", - "oninput", - "oninputreport", - "oninputsourceschange", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeystatuseschange", - "onkeyup", - "onlanguagechange", - "onlayoutcomplete", - "onleavepictureinpicture", - "onlevelchange", - "onload", - "onloadT", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloading", - "onloadingdone", - "onloadingerror", - "onloadstart", - "onlosecapture", - "onlostpointercapture", - "only", - "onmanagedconfigurationchange", - "onmark", - "onmessage", - "onmessageerror", - "onmidimessage", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onmove", - "onmoveend", - "onmovestart", - "onmozfullscreenchange", - "onmozfullscreenerror", - "onmozorientationchange", - "onmozpointerlockchange", - "onmozpointerlockerror", - "onmscontentzoom", - "onmsfullscreenchange", - "onmsfullscreenerror", - "onmsgesturechange", - "onmsgesturedoubletap", - "onmsgestureend", - "onmsgesturehold", - "onmsgesturestart", - "onmsgesturetap", - "onmsgotpointercapture", - "onmsinertiastart", - "onmslostpointercapture", - "onmsmanipulationstatechanged", - "onmsneedkey", - "onmsorientationchange", - "onmspointercancel", - "onmspointerdown", - "onmspointerenter", - "onmspointerhover", - "onmspointerleave", - "onmspointermove", - "onmspointerout", - "onmspointerover", - "onmspointerup", - "onmssitemodejumplistitemremoved", - "onmsthumbnailclick", - "onmute", - "onnavigate", - "onnavigateerror", - "onnavigatesuccess", - "onnegotiationneeded", - "onnomatch", - "onnoupdate", - "onobsolete", - "onoffline", - "ononline", - "onopen", - "onorientationchange", - "onpagechange", - "onpagehide", - "onpagereveal", - "onpageshow", - "onpageswap", - "onpaste", - "onpause", - "onpayerdetailchange", - "onpaymentmethodchange", - "onplay", - "onplaying", - "onpluginstreamstart", - "onpointercancel", - "onpointerdown", - "onpointerenter", - "onpointerleave", - "onpointerlockchange", - "onpointerlockerror", - "onpointermove", - "onpointerout", - "onpointerover", - "onpointerrawupdate", - "onpointerup", - "onpopstate", - "onprerenderingchange", - "onprioritychange", - "onprocessorerror", - "onprogress", - "onpropertychange", - "onratechange", - "onreading", - "onreadystatechange", - "onreflectionchange", - "onrejectionhandled", - "onrelease", - "onremove", - "onremovesourcebuffer", - "onremovestream", - "onremovetrack", - "onrepeat", - "onreset", - "onresize", - "onresizeend", - "onresizestart", - "onresourcetimingbufferfull", - "onresult", - "onresume", - "onrowenter", - "onrowexit", - "onrowsdelete", - "onrowsinserted", - "onscreenschange", - "onscroll", - "onscrollend", - "onscrollsnapchange", - "onscrollsnapchanging", - "onsearch", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onselectedcandidatepairchange", - "onselectend", - "onselectionchange", - "onselectstart", - "onshippingaddresschange", - "onshippingoptionchange", - "onshow", - "onsignalingstatechange", - "onsinkchange", - "onslotchange", - "onsoundend", - "onsoundstart", - "onsourceclose", - "onsourceclosed", - "onsourceended", - "onsourceopen", - "onspeechend", - "onspeechstart", - "onsqueeze", - "onsqueezeend", - "onsqueezestart", - "onstalled", - "onstart", - "onstatechange", - "onstop", - "onstorage", - "onstoragecommit", - "onsubmit", - "onsuccess", - "onsuspend", - "onterminate", - "ontextformatupdate", - "ontextinput", - "ontextupdate", - "ontimeout", - "ontimeupdate", - "ontoggle", - "ontonechange", - "ontouchcancel", - "ontouchend", - "ontouchmove", - "ontouchstart", - "ontrack", - "ontransitioncancel", - "ontransitionend", - "ontransitionrun", - "ontransitionstart", - "onuncapturederror", - "onunhandledrejection", - "onunload", - "onunmute", - "onupdate", - "onupdateend", - "onupdatefound", - "onupdateready", - "onupdatestart", - "onupgradeneeded", - "onuserproximity", - "onversionchange", - "onvisibilitychange", - "onvoiceschanged", - "onvolumechange", - "onvrdisplayactivate", - "onvrdisplayconnect", - "onvrdisplaydeactivate", - "onvrdisplaydisconnect", - "onvrdisplaypresentchange", - "onwaiting", - "onwaitingforkey", - "onwarning", - "onwebkitanimationend", - "onwebkitanimationiteration", - "onwebkitanimationstart", - "onwebkitcurrentplaybacktargetiswirelesschanged", - "onwebkitfullscreenchange", - "onwebkitfullscreenerror", - "onwebkitkeyadded", - "onwebkitkeyerror", - "onwebkitkeymessage", - "onwebkitneedkey", - "onwebkitorientationchange", - "onwebkitplaybacktargetavailabilitychanged", - "onwebkitpointerlockchange", - "onwebkitpointerlockerror", - "onwebkitresourcetimingbufferfull", - "onwebkittransitionend", - "onwheel", - "onzoom", - "opacity", - "open", - "openCursor", - "openDatabase", - "openKeyCursor", - "openOptionsPage", - "openOrClosedShadowRoot", - "openPopup", - "opened", - "opener", - "opera", - "operation", - "operationType", - "operator", - "opr", - "optimum", - "options", - "or", - "order", - "orderX", - "orderY", - "ordered", - "org", - "organization", - "orient", - "orientAngle", - "orientType", - "orientation", - "orientationX", - "orientationY", - "orientationZ", - "origin", - "originAgentCluster", - "originalPolicy", - "originalTarget", - "orphans", - "os", - "oscpu", - "outerHTML", - "outerHeight", - "outerText", - "outerWidth", - "outgoingHighWaterMark", - "outgoingMaxAge", - "outline", - "outline-color", - "outline-offset", - "outline-style", - "outline-width", - "outlineColor", - "outlineOffset", - "outlineStyle", - "outlineWidth", - "outputBuffer", - "outputChannelCount", - "outputLatency", - "outputs", - "overflow", - "overflow-anchor", - "overflow-block", - "overflow-clip-margin", - "overflow-inline", - "overflow-wrap", - "overflow-x", - "overflow-y", - "overflowAnchor", - "overflowBlock", - "overflowClipMargin", - "overflowInline", - "overflowWrap", - "overflowX", - "overflowY", - "overlaysContent", - "overrideColors", - "overrideMimeType", - "oversample", - "overscroll-behavior", - "overscroll-behavior-block", - "overscroll-behavior-inline", - "overscroll-behavior-x", - "overscroll-behavior-y", - "overscrollBehavior", - "overscrollBehaviorBlock", - "overscrollBehaviorInline", - "overscrollBehaviorX", - "overscrollBehaviorY", - "ownKeys", - "ownerDocument", - "ownerElement", - "ownerNode", - "ownerRule", - "ownerSVGElement", - "owningElement", - "p1", - "p2", - "p3", - "p4", - "packetSize", - "packets", - "pad", - "padEnd", - "padStart", - "padding", - "padding-block", - "padding-block-end", - "padding-block-start", - "padding-bottom", - "padding-inline", - "padding-inline-end", - "padding-inline-start", - "padding-left", - "padding-right", - "padding-top", - "paddingBlock", - "paddingBlockEnd", - "paddingBlockStart", - "paddingBottom", - "paddingInline", - "paddingInlineEnd", - "paddingInlineStart", - "paddingLeft", - "paddingRight", - "paddingTop", - "page", - "page-break-after", - "page-break-before", - "page-break-inside", - "page-orientation", - "pageAction", - "pageBreakAfter", - "pageBreakBefore", - "pageBreakInside", - "pageCount", - "pageLeft", - "pageOrientation", - "pageT", - "pageTop", - "pageX", - "pageXOffset", - "pageY", - "pageYOffset", - "pages", - "paint-order", - "paintOrder", - "paintRequests", - "paintType", - "paintWorklet", - "palette", - "pan", - "panningModel", - "parameterData", - "parameters", - "parent", - "parentElement", - "parentNode", - "parentRule", - "parentStyleSheet", - "parentTextEdit", - "parentWindow", - "parse", - "parseAll", - "parseCreationOptionsFromJSON", - "parseFloat", - "parseFromString", - "parseHTMLUnsafe", - "parseInt", - "parseRequestOptionsFromJSON", - "part", - "participants", - "passOp", - "passive", - "password", - "pasteHTML", - "path", - "pathLength", - "pathSegList", - "pathSegType", - "pathSegTypeAsLetter", - "pathname", - "pattern", - "patternContentUnits", - "patternMismatch", - "patternTransform", - "patternUnits", - "pause", - "pauseAnimations", - "pauseDuration", - "pauseOnExit", - "pauseProfilers", - "pauseTransformFeedback", - "paused", - "payerEmail", - "payerName", - "payerPhone", - "paymentManager", - "pc", - "pdfViewerEnabled", - "peerIdentity", - "pending", - "pendingLocalDescription", - "pendingRemoteDescription", - "percent", - "performance", - "periodicSync", - "permission", - "permissionState", - "permissions", - "persist", - "persisted", - "persistentDeviceId", - "personalbar", - "perspective", - "perspective-origin", - "perspectiveOrigin", - "phone", - "phoneticFamilyName", - "phoneticGivenName", - "photo", - "pictureInPictureChild", - "pictureInPictureElement", - "pictureInPictureEnabled", - "pictureInPictureWindow", - "ping", - "pipeThrough", - "pipeTo", - "pitch", - "pixelBottom", - "pixelDepth", - "pixelHeight", - "pixelLeft", - "pixelRight", - "pixelStorei", - "pixelTop", - "pixelUnitToMillimeterX", - "pixelUnitToMillimeterY", - "pixelWidth", - "pkcs11", - "place-content", - "place-items", - "place-self", - "placeContent", - "placeItems", - "placeSelf", - "placeholder", - "platform", - "platformVersion", - "platforms", - "play", - "playEffect", - "playState", - "playbackRate", - "playbackState", - "playbackTime", - "played", - "playoutDelayHint", - "playsInline", - "plugins", - "pluginspage", - "pname", - "pointer-events", - "pointerBeforeReferenceNode", - "pointerEnabled", - "pointerEvents", - "pointerId", - "pointerLockElement", - "pointerType", - "points", - "pointsAtX", - "pointsAtY", - "pointsAtZ", - "polygonOffset", - "pop", - "popDebugGroup", - "popErrorScope", - "popover", - "popoverTargetAction", - "popoverTargetElement", - "populateMatrix", - "popupWindowFeatures", - "popupWindowName", - "popupWindowURI", - "port", - "port1", - "port2", - "ports", - "posBottom", - "posHeight", - "posLeft", - "posRight", - "posTop", - "posWidth", - "pose", - "position", - "position-anchor", - "position-area", - "positionAlign", - "positionAnchor", - "positionArea", - "positionX", - "positionY", - "positionZ", - "postError", - "postMessage", - "postTask", - "postalCode", - "poster", - "postscriptName", - "pow", - "powerEfficient", - "powerOff", - "powerPreference", - "preMultiplySelf", - "precision", - "preferredReflectionFormat", - "preferredStyleSheetSet", - "preferredStylesheetSet", - "prefix", - "preload", - "premultipliedAlpha", - "prepend", - "prerendering", - "presentation", - "presentationArea", - "presentationStyle", - "preserveAlpha", - "preserveAspectRatio", - "preserveAspectRatioString", - "preservesPitch", - "pressed", - "pressure", - "prevValue", - "preventDefault", - "preventExtensions", - "preventSilentAccess", - "previousElementSibling", - "previousNode", - "previousPage", - "previousPriority", - "previousRect", - "previousScale", - "previousSibling", - "previousTranslate", - "primaries", - "primaryKey", - "primaryLightDirection", - "primaryLightIntensity", - "primitive", - "primitiveType", - "primitiveUnits", - "principals", - "print", - "print-color-adjust", - "printColorAdjust", - "printPreview", - "priority", - "privacy", - "privateKey", - "privateToken", - "probablySupportsContext", - "probeSpace", - "process", - "processIceMessage", - "processingEnd", - "processingStart", - "processorOptions", - "product", - "productId", - "productName", - "productSub", - "profile", - "profileEnd", - "profiles", - "projectionMatrix", - "promise", - "prompt", - "properties", - "propertyIsEnumerable", - "propertyName", - "protectedAudience", - "protocol", - "protocolLong", - "prototype", - "provider", - "proxy", - "pseudoClass", - "pseudoElement", - "pt", - "publicId", - "publicKey", - "published", - "pulse", - "push", - "pushDebugGroup", - "pushErrorScope", - "pushManager", - "pushNotification", - "pushState", - "put", - "putImageData", - "px", - "quadraticCurveTo", - "qualifier", - "quaternion", - "query", - "queryCommandEnabled", - "queryCommandIndeterm", - "queryCommandState", - "queryCommandSupported", - "queryCommandText", - "queryCommandValue", - "queryFeatureSupport", - "queryLocalFonts", - "queryPermission", - "querySelector", - "querySelectorAll", - "querySet", - "queue", - "queueMicrotask", - "quote", - "quotes", - "r", - "r1", - "r2", - "race", - "rad", - "radiogroup", - "radius", - "radiusX", - "radiusY", - "random", - "randomUUID", - "range", - "rangeCount", - "rangeEnd", - "rangeMax", - "rangeMin", - "rangeOffset", - "rangeOverflow", - "rangeParent", - "rangeStart", - "rangeUnderflow", - "rate", - "ratio", - "raw", - "rawId", - "rawJSON", - "rawValueToMeters", - "rcap", - "rch", - "read", - "readAsArrayBuffer", - "readAsBinaryString", - "readAsBlob", - "readAsDataURL", - "readAsText", - "readBuffer", - "readEntries", - "readOnly", - "readPixels", - "readReportRequested", - "readText", - "readValue", - "readable", - "ready", - "readyState", - "reason", - "reasons", - "reboot", - "receiveFeatureReport", - "receivedAlert", - "receiver", - "receivers", - "recipient", - "recommendedViewportScale", - "reconnect", - "recordNumber", - "recordsAvailable", - "recordset", - "rect", - "red", - "redEyeReduction", - "redirect", - "redirectCount", - "redirectEnd", - "redirectStart", - "redirected", - "reduce", - "reduceRight", - "reduction", - "refDistance", - "refX", - "refY", - "referenceNode", - "referenceSpace", - "referrer", - "referrerPolicy", - "refresh", - "region", - "regionAnchorX", - "regionAnchorY", - "regionId", - "regions", - "register", - "registerContentHandler", - "registerElement", - "registerInternalModuleStart", - "registerInternalModuleStop", - "registerProperty", - "registerProtocolHandler", - "reject", - "rel", - "relList", - "relatedAddress", - "relatedNode", - "relatedPort", - "relatedTarget", - "relayProtocol", - "release", - "releaseCapture", - "releaseEvents", - "releaseInterface", - "releaseLock", - "releasePointerCapture", - "releaseShaderCompiler", - "released", - "reliability", - "reliable", - "reliableWrite", - "reload", - "rem", - "remainingSpace", - "remote", - "remoteDescription", - "remove", - "removeAllRanges", - "removeAttribute", - "removeAttributeNS", - "removeAttributeNode", - "removeBehavior", - "removeChild", - "removeCue", - "removeEntry", - "removeEventListener", - "removeFilter", - "removeImport", - "removeItem", - "removeListener", - "removeNamedItem", - "removeNamedItemNS", - "removeNode", - "removeParameter", - "removeProperty", - "removeRange", - "removeRegion", - "removeRule", - "removeSiteSpecificTrackingException", - "removeSourceBuffer", - "removeStream", - "removeTrack", - "removeVariable", - "removeWakeLockListener", - "removeWebWideTrackingException", - "removed", - "removedNodes", - "renderBlockingStatus", - "renderHeight", - "renderStart", - "renderState", - "renderTime", - "renderWidth", - "renderbufferStorage", - "renderbufferStorageMultisample", - "renderedBuffer", - "rendererInterfaces", - "renderers", - "renderingMode", - "renotify", - "repeat", - "repetitionCount", - "replace", - "replaceAdjacentText", - "replaceAll", - "replaceChild", - "replaceChildren", - "replaceData", - "replaceId", - "replaceItem", - "replaceNode", - "replaceState", - "replaceSync", - "replaceTrack", - "replaceWholeText", - "replaceWith", - "reportError", - "reportEvent", - "reportId", - "reportValidity", - "request", - "requestAdapter", - "requestAdapterInfo", - "requestAnimationFrame", - "requestAutocomplete", - "requestClose", - "requestData", - "requestDevice", - "requestFrame", - "requestFullscreen", - "requestHitTestSource", - "requestHitTestSourceForTransientInput", - "requestId", - "requestIdleCallback", - "requestLightProbe", - "requestMIDIAccess", - "requestMediaKeySystemAccess", - "requestPermission", - "requestPictureInPicture", - "requestPointerLock", - "requestPort", - "requestPresent", - "requestPresenter", - "requestReferenceSpace", - "requestSession", - "requestStart", - "requestStorageAccess", - "requestStorageAccessFor", - "requestSubmit", - "requestTime", - "requestUpdateCheck", - "requestVideoFrameCallback", - "requestViewportScale", - "requestWindow", - "requestingWindow", - "requireInteraction", - "required", - "requiredExtensions", - "requiredFeatures", - "requiredLimits", - "reset", - "resetLatency", - "resetPose", - "resetTransform", - "resizable", - "resize", - "resizeBy", - "resizeTo", - "resolve", - "resolveQuerySet", - "resolveTarget", - "resource", - "respond", - "respondWithNewView", - "response", - "responseBody", - "responseEnd", - "responseReady", - "responseStart", - "responseStatus", - "responseText", - "responseType", - "responseURL", - "responseXML", - "restart", - "restartAfterDelay", - "restartIce", - "restore", - "result", - "resultIndex", - "resultType", - "results", - "resume", - "resumeProfilers", - "resumeTransformFeedback", - "retry", - "returnValue", - "rev", - "reverse", - "reversed", - "revocable", - "revokeObjectURL", - "rex", - "rgbColor", - "ric", - "right", - "rightContext", - "rightDegrees", - "rightMargin", - "rightProjectionMatrix", - "rightViewMatrix", - "rlh", - "role", - "rolloffFactor", - "root", - "rootBounds", - "rootElement", - "rootMargin", - "rotate", - "rotateAxisAngle", - "rotateAxisAngleSelf", - "rotateFromVector", - "rotateFromVectorSelf", - "rotateSelf", - "rotation", - "rotationAngle", - "rotationRate", - "round", - "roundRect", - "row-gap", - "rowGap", - "rowIndex", - "rowSpan", - "rows", - "rowsPerImage", - "rtcpTransport", - "rtt", - "ruby-align", - "ruby-position", - "rubyAlign", - "rubyOverhang", - "rubyPosition", - "rules", - "run", - "runAdAuction", - "runtime", - "runtimeStyle", - "rx", - "ry", - "s", - "safari", - "sameDocument", - "sample", - "sampleCount", - "sampleCoverage", - "sampleInterval", - "sampleRate", - "sampleType", - "sampler", - "samplerParameterf", - "samplerParameteri", - "sandbox", - "save", - "saveAsPDF", - "saveData", - "scale", - "scale3d", - "scale3dSelf", - "scaleNonUniform", - "scaleNonUniformSelf", - "scaleSelf", - "scheduler", - "scheduling", - "scheme", - "scissor", - "scope", - "scopeName", - "scoped", - "screen", - "screenBrightness", - "screenEnabled", - "screenLeft", - "screenPixelToMillimeterX", - "screenPixelToMillimeterY", - "screenState", - "screenTop", - "screenX", - "screenY", - "screens", - "scriptURL", - "scripting", - "scripts", - "scroll", - "scroll-behavior", - "scroll-margin", - "scroll-margin-block", - "scroll-margin-block-end", - "scroll-margin-block-start", - "scroll-margin-bottom", - "scroll-margin-inline", - "scroll-margin-inline-end", - "scroll-margin-inline-start", - "scroll-margin-left", - "scroll-margin-right", - "scroll-margin-top", - "scroll-padding", - "scroll-padding-block", - "scroll-padding-block-end", - "scroll-padding-block-start", - "scroll-padding-bottom", - "scroll-padding-inline", - "scroll-padding-inline-end", - "scroll-padding-inline-start", - "scroll-padding-left", - "scroll-padding-right", - "scroll-padding-top", - "scroll-snap-align", - "scroll-snap-stop", - "scroll-snap-type", - "scrollAmount", - "scrollBehavior", - "scrollBy", - "scrollByLines", - "scrollByPages", - "scrollDelay", - "scrollHeight", - "scrollIntoView", - "scrollIntoViewIfNeeded", - "scrollLeft", - "scrollLeftMax", - "scrollMargin", - "scrollMarginBlock", - "scrollMarginBlockEnd", - "scrollMarginBlockStart", - "scrollMarginBottom", - "scrollMarginInline", - "scrollMarginInlineEnd", - "scrollMarginInlineStart", - "scrollMarginLeft", - "scrollMarginRight", - "scrollMarginTop", - "scrollMaxX", - "scrollMaxY", - "scrollPadding", - "scrollPaddingBlock", - "scrollPaddingBlockEnd", - "scrollPaddingBlockStart", - "scrollPaddingBottom", - "scrollPaddingInline", - "scrollPaddingInlineEnd", - "scrollPaddingInlineStart", - "scrollPaddingLeft", - "scrollPaddingRight", - "scrollPaddingTop", - "scrollRestoration", - "scrollSnapAlign", - "scrollSnapStop", - "scrollSnapType", - "scrollTo", - "scrollTop", - "scrollTopMax", - "scrollWidth", - "scrollX", - "scrollY", - "scrollbar-color", - "scrollbar-gutter", - "scrollbar-width", - "scrollbar3dLightColor", - "scrollbarArrowColor", - "scrollbarBaseColor", - "scrollbarColor", - "scrollbarDarkShadowColor", - "scrollbarFaceColor", - "scrollbarGutter", - "scrollbarHighlightColor", - "scrollbarShadowColor", - "scrollbarTrackColor", - "scrollbarWidth", - "scrollbars", - "scrolling", - "scrollingElement", - "sctp", - "sctpCauseCode", - "sdp", - "sdpLineNumber", - "sdpMLineIndex", - "sdpMid", - "seal", - "search", - "searchBox", - "searchBoxJavaBridge_", - "searchParams", - "sectionRowIndex", - "secureConnectionStart", - "security", - "seed", - "seek", - "seekToNextFrame", - "seekable", - "seeking", - "select", - "selectAllChildren", - "selectAlternateInterface", - "selectAudioOutput", - "selectConfiguration", - "selectNode", - "selectNodeContents", - "selectNodes", - "selectSingleNode", - "selectSubString", - "selectURL", - "selected", - "selectedIndex", - "selectedOptions", - "selectedStyleSheetSet", - "selectedStylesheetSet", - "selectedTrack", - "selection", - "selectionDirection", - "selectionEnd", - "selectionStart", - "selector", - "selectorText", - "self", - "send", - "sendAsBinary", - "sendBeacon", - "sendFeatureReport", - "sendMessage", - "sendNativeMessage", - "sendOrder", - "sendReport", - "sender", - "sentAlert", - "sentTimestamp", - "separator", - "serial", - "serialNumber", - "serializable", - "serializeToString", - "serverTiming", - "service", - "serviceWorker", - "session", - "sessionId", - "sessionStorage", - "sessions", - "set", - "setActionHandler", - "setActive", - "setAlpha", - "setAppBadge", - "setAttribute", - "setAttributeNS", - "setAttributeNode", - "setAttributeNodeNS", - "setAttributionReporting", - "setBadgeBackgroundColor", - "setBadgeText", - "setBadgeTextColor", - "setBaseAndExtent", - "setBigInt64", - "setBigUint64", - "setBindGroup", - "setBingCurrentSearchDefault", - "setBlendConstant", - "setCameraActive", - "setCapture", - "setCaptureHandleConfig", - "setCodecPreferences", - "setColor", - "setCompositeOperation", - "setConfiguration", - "setConsumer", - "setCurrentTime", - "setCustomValidity", - "setData", - "setDate", - "setDragImage", - "setEnabled", - "setEnd", - "setEndAfter", - "setEndBefore", - "setEndPoint", - "setExpires", - "setFillColor", - "setFilterRes", - "setFloat16", - "setFloat32", - "setFloat64", - "setFloatValue", - "setFocusBehavior", - "setFormValue", - "setFromBase64", - "setFromHex", - "setFullYear", - "setHTMLUnsafe", - "setHeaderExtensionsToNegotiate", - "setHeaderValue", - "setHours", - "setIcon", - "setIdentityProvider", - "setImmediate", - "setIndexBuffer", - "setInt16", - "setInt32", - "setInt8", - "setInterval", - "setItem", - "setKeyframes", - "setLineCap", - "setLineDash", - "setLineJoin", - "setLineWidth", - "setLiveSeekableRange", - "setLocalDescription", - "setMatrix", - "setMatrixValue", - "setMediaKeys", - "setMicrophoneActive", - "setMilliseconds", - "setMinutes", - "setMiterLimit", - "setMonth", - "setNamedItem", - "setNamedItemNS", - "setNonUserCodeExceptions", - "setOrientToAngle", - "setOrientToAuto", - "setOrientation", - "setOverrideHistoryNavigationMode", - "setPaint", - "setParameter", - "setParameters", - "setPeriodicWave", - "setPipeline", - "setPointerCapture", - "setPopup", - "setPosition", - "setPositionState", - "setPreference", - "setPriority", - "setPrivateToken", - "setProperty", - "setPrototypeOf", - "setRGBColor", - "setRGBColorICCColor", - "setRadius", - "setRangeText", - "setRemoteDescription", - "setReportEventDataForAutomaticBeacons", - "setRequestHeader", - "setResizable", - "setResourceTimingBufferSize", - "setRotate", - "setScale", - "setScissorRect", - "setSeconds", - "setSelectionRange", - "setServerCertificate", - "setShadow", - "setSharedStorageContext", - "setSignals", - "setSinkId", - "setSkewX", - "setSkewY", - "setStart", - "setStartAfter", - "setStartBefore", - "setStatus", - "setStdDeviation", - "setStencilReference", - "setStreams", - "setStrictMode", - "setStringValue", - "setStrokeColor", - "setSuggestResult", - "setTargetAtTime", - "setTargetValueAtTime", - "setTime", - "setTimeout", - "setTitle", - "setTransform", - "setTranslate", - "setUTCDate", - "setUTCFullYear", - "setUTCHours", - "setUTCMilliseconds", - "setUTCMinutes", - "setUTCMonth", - "setUTCSeconds", - "setUint16", - "setUint32", - "setUint8", - "setUninstallURL", - "setUpdateUrlData", - "setUri", - "setValidity", - "setValueAtTime", - "setValueCurveAtTime", - "setVariable", - "setVelocity", - "setVersion", - "setVertexBuffer", - "setViewport", - "setYear", - "setZoom", - "setZoomSettings", - "settingName", - "settingValue", - "sex", - "shaderLocation", - "shaderSource", - "shadowBlur", - "shadowColor", - "shadowOffsetX", - "shadowOffsetY", - "shadowRoot", - "shadowRootClonable", - "shadowRootDelegatesFocus", - "shadowRootMode", - "shadowRootSerializable", - "shape", - "shape-image-threshold", - "shape-margin", - "shape-outside", - "shape-rendering", - "shapeImageThreshold", - "shapeMargin", - "shapeOutside", - "shapeRendering", - "share", - "sharedStorage", - "sharedStorageWritable", - "sheet", - "shift", - "shiftKey", - "shiftLeft", - "shippingAddress", - "shippingOption", - "shippingType", - "show", - "showDirectoryPicker", - "showHelp", - "showModal", - "showModalDialog", - "showModelessDialog", - "showNotification", - "showOpenFilePicker", - "showPicker", - "showPopover", - "showSaveFilePicker", - "sidebar", - "sidebarAction", - "sign", - "signal", - "signalingState", - "signature", - "silent", - "sin", - "singleNodeValue", - "sinh", - "sinkId", - "sittingToStandingTransform", - "size", - "sizeAdjust", - "sizeToContent", - "sizeX", - "sizeZ", - "sizes", - "skewX", - "skewXSelf", - "skewY", - "skewYSelf", - "skipTransition", - "skipped", - "slice", - "slope", - "slot", - "slotAssignment", - "small", - "smil", - "smooth", - "smoothingTimeConstant", - "snapTargetBlock", - "snapTargetInline", - "snapToLines", - "snapshotItem", - "snapshotLength", - "some", - "sort", - "sortingCode", - "source", - "sourceBuffer", - "sourceBuffers", - "sourceCapabilities", - "sourceCharPosition", - "sourceFile", - "sourceFunctionName", - "sourceIndex", - "sourceMap", - "sourceURL", - "sources", - "spacing", - "span", - "speak", - "speakAs", - "speaking", - "species", - "specified", - "specularConstant", - "specularExponent", - "speechSynthesis", - "speed", - "speedOfSound", - "spellcheck", - "sphericalHarmonicsCoefficients", - "splice", - "split", - "splitText", - "spreadMethod", - "sqrt", - "src", - "srcElement", - "srcFactor", - "srcFilter", - "srcObject", - "srcUrn", - "srcdoc", - "srclang", - "srcset", - "stack", - "stackTraceLimit", - "stacktrace", - "stageParameters", - "standalone", - "standby", - "start", - "startContainer", - "startE", - "startIce", - "startLoadTime", - "startMessages", - "startNotifications", - "startOffset", - "startProfiling", - "startRendering", - "startShark", - "startTime", - "startViewTransition", - "startsWith", - "state", - "states", - "stats", - "status", - "statusCode", - "statusMessage", - "statusText", - "statusbar", - "stdDeviationX", - "stdDeviationY", - "stencilBack", - "stencilClearValue", - "stencilFront", - "stencilFunc", - "stencilFuncSeparate", - "stencilLoadOp", - "stencilMask", - "stencilMaskSeparate", - "stencilOp", - "stencilOpSeparate", - "stencilReadMask", - "stencilReadOnly", - "stencilStoreOp", - "stencilWriteMask", - "step", - "stepDown", - "stepMismatch", - "stepMode", - "stepUp", - "sticky", - "stitchTiles", - "stop", - "stop-color", - "stop-opacity", - "stopColor", - "stopImmediatePropagation", - "stopNotifications", - "stopOpacity", - "stopProfiling", - "stopPropagation", - "stopShark", - "stopped", - "storage", - "storageArea", - "storageBuckets", - "storageName", - "storageStatus", - "storageTexture", - "store", - "storeOp", - "storeSiteSpecificTrackingException", - "storeWebWideTrackingException", - "stpVersion", - "stream", - "streamErrorCode", - "streams", - "stretch", - "strike", - "string", - "stringValue", - "stringify", - "stripIndexFormat", - "stroke", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "strokeDasharray", - "strokeDashoffset", - "strokeLinecap", - "strokeLinejoin", - "strokeMiterlimit", - "strokeOpacity", - "strokeRect", - "strokeStyle", - "strokeText", - "strokeWidth", - "structuredClone", - "style", - "styleAndLayoutStart", - "styleFloat", - "styleMap", - "styleMedia", - "styleSheet", - "styleSheetSets", - "styleSheets", - "sub", - "subarray", - "subject", - "submit", - "submitFrame", - "submitter", - "subscribe", - "substr", - "substring", - "substringData", - "subtle", - "subtree", - "suffix", - "suffixes", - "summary", - "sup", - "supported", - "supportedContentEncodings", - "supportedEntryTypes", - "supportedValuesOf", - "supports", - "supportsFiber", - "supportsSession", - "supportsText", - "surfaceScale", - "surroundContents", - "suspend", - "suspendRedraw", - "svb", - "svh", - "svi", - "svmax", - "svmin", - "svw", - "swapCache", - "swapNode", - "sweepFlag", - "symbols", - "symmetricDifference", - "sync", - "syntax", - "sysexEnabled", - "system", - "systemCode", - "systemId", - "systemLanguage", - "systemXDPI", - "systemYDPI", - "tBodies", - "tFoot", - "tHead", - "tab", - "tab-size", - "tabId", - "tabIds", - "tabIndex", - "tabSize", - "table", - "table-layout", - "tableLayout", - "tableValues", - "tabs", - "tag", - "tagName", - "tagUrn", - "tags", - "taintEnabled", - "take", - "takePhoto", - "takeRecords", - "tan", - "tangentialPressure", - "tanh", - "target", - "targetAddressSpace", - "targetElement", - "targetRayMode", - "targetRaySpace", - "targetTouches", - "targetURL", - "targetX", - "targetY", - "targets", - "tcpType", - "tee", - "tel", - "telemetry", - "terminate", - "test", - "texImage2D", - "texImage3D", - "texParameterf", - "texParameteri", - "texStorage2D", - "texStorage3D", - "texSubImage2D", - "texSubImage3D", - "text", - "text-align", - "text-align-last", - "text-anchor", - "text-combine-upright", - "text-decoration", - "text-decoration-color", - "text-decoration-line", - "text-decoration-skip-ink", - "text-decoration-style", - "text-decoration-thickness", - "text-emphasis", - "text-emphasis-color", - "text-emphasis-position", - "text-emphasis-style", - "text-indent", - "text-justify", - "text-orientation", - "text-overflow", - "text-rendering", - "text-shadow", - "text-transform", - "text-underline-offset", - "text-underline-position", - "text-wrap", - "text-wrap-mode", - "text-wrap-style", - "textAlign", - "textAlignLast", - "textAnchor", - "textAutospace", - "textBaseline", - "textCombineUpright", - "textContent", - "textDecoration", - "textDecorationBlink", - "textDecorationColor", - "textDecorationLine", - "textDecorationLineThrough", - "textDecorationNone", - "textDecorationOverline", - "textDecorationSkipInk", - "textDecorationStyle", - "textDecorationThickness", - "textDecorationUnderline", - "textEmphasis", - "textEmphasisColor", - "textEmphasisPosition", - "textEmphasisStyle", - "textIndent", - "textJustify", - "textJustifyTrim", - "textKashida", - "textKashidaSpace", - "textLength", - "textOrientation", - "textOverflow", - "textRendering", - "textShadow", - "textTracks", - "textTransform", - "textUnderlineOffset", - "textUnderlinePosition", - "textWrap", - "textWrapMode", - "textWrapStyle", - "texture", - "theme", - "then", - "threadId", - "threshold", - "thresholds", - "throwIfAborted", - "tiltX", - "tiltY", - "time", - "timeEnd", - "timeLog", - "timeOrigin", - "timeRemaining", - "timeStamp", - "timecode", - "timeline", - "timelineTime", - "timeout", - "timestamp", - "timestampOffset", - "timestampWrites", - "timing", - "title", - "titlebarAreaRect", - "tlsChannelId", - "to", - "toArray", - "toBase64", - "toBlob", - "toDataURL", - "toDateString", - "toElement", - "toExponential", - "toFixed", - "toFloat32Array", - "toFloat64Array", - "toGMTString", - "toHex", - "toISOString", - "toJSON", - "toLocaleDateString", - "toLocaleFormat", - "toLocaleLowerCase", - "toLocaleString", - "toLocaleTimeString", - "toLocaleUpperCase", - "toLowerCase", - "toMatrix", - "toMethod", - "toPrecision", - "toPrimitive", - "toReversed", - "toSdp", - "toSorted", - "toSource", - "toSpliced", - "toStaticHTML", - "toString", - "toStringTag", - "toSum", - "toTimeString", - "toUTCString", - "toUpperCase", - "toWellFormed", - "toggle", - "toggleAttribute", - "toggleLongPressEnabled", - "togglePopover", - "toggleReaderMode", - "token", - "tone", - "toneBuffer", - "tooLong", - "tooShort", - "toolbar", - "top", - "topMargin", - "topSites", - "topology", - "total", - "totalFrameDelay", - "totalFrames", - "totalFramesDuration", - "totalVideoFrames", - "touch-action", - "touchAction", - "touched", - "touches", - "trace", - "track", - "trackVisibility", - "trackedAnchors", - "tracks", - "tran", - "transaction", - "transactions", - "transceiver", - "transfer", - "transferControlToOffscreen", - "transferFromImageBitmap", - "transferImageBitmap", - "transferIn", - "transferOut", - "transferSize", - "transferToFixedLength", - "transferToImageBitmap", - "transform", - "transform-box", - "transform-origin", - "transform-style", - "transformBox", - "transformFeedbackVaryings", - "transformOrigin", - "transformPoint", - "transformString", - "transformStyle", - "transformToDocument", - "transformToFragment", - "transition", - "transition-behavior", - "transition-delay", - "transition-duration", - "transition-property", - "transition-timing-function", - "transitionBehavior", - "transitionDelay", - "transitionDuration", - "transitionProperty", - "transitionTimingFunction", - "translate", - "translateSelf", - "translationX", - "translationY", - "transport", - "traverseTo", - "trim", - "trimEnd", - "trimLeft", - "trimRight", - "trimStart", - "trueSpeed", - "trunc", - "truncate", - "trustedTypes", - "try", - "turn", - "twist", - "type", - "typeDetail", - "typeMismatch", - "typeMustMatch", - "types", - "u2f", - "ubound", - "uint16", - "uint32", - "uint8", - "uint8Clamped", - "unadjustedMovement", - "unclippedDepth", - "unconfigure", - "undefined", - "underlineStyle", - "underlineThickness", - "unescape", - "uneval", - "ungroup", - "unicode", - "unicode-bidi", - "unicodeBidi", - "unicodeRange", - "unicodeSets", - "uniform1f", - "uniform1fv", - "uniform1i", - "uniform1iv", - "uniform1ui", - "uniform1uiv", - "uniform2f", - "uniform2fv", - "uniform2i", - "uniform2iv", - "uniform2ui", - "uniform2uiv", - "uniform3f", - "uniform3fv", - "uniform3i", - "uniform3iv", - "uniform3ui", - "uniform3uiv", - "uniform4f", - "uniform4fv", - "uniform4i", - "uniform4iv", - "uniform4ui", - "uniform4uiv", - "uniformBlockBinding", - "uniformMatrix2fv", - "uniformMatrix2x3fv", - "uniformMatrix2x4fv", - "uniformMatrix3fv", - "uniformMatrix3x2fv", - "uniformMatrix3x4fv", - "uniformMatrix4fv", - "uniformMatrix4x2fv", - "uniformMatrix4x3fv", - "uninstallSelf", - "union", - "unique", - "uniqueID", - "uniqueNumber", - "unit", - "unitType", - "units", - "unloadEventEnd", - "unloadEventStart", - "unlock", - "unmap", - "unmount", - "unobserve", - "unpackColorSpace", - "unpause", - "unpauseAnimations", - "unreadCount", - "unregister", - "unregisterContentHandler", - "unregisterProtocolHandler", - "unscopables", - "unselectable", - "unshift", - "unsubscribe", - "unsuspendRedraw", - "unsuspendRedrawAll", - "unwatch", - "unwrapKey", - "upDegrees", - "upX", - "upY", - "upZ", - "update", - "updateAdInterestGroups", - "updateCallbackDone", - "updateCharacterBounds", - "updateCommands", - "updateControlBounds", - "updateCurrentEntry", - "updateIce", - "updateInkTrailStartPoint", - "updateInterval", - "updatePlaybackRate", - "updateRangeEnd", - "updateRangeStart", - "updateRenderState", - "updateSelection", - "updateSelectionBounds", - "updateSettings", - "updateText", - "updateTiming", - "updateViaCache", - "updateWith", - "updated", - "updating", - "upgrade", - "upload", - "uploadTotal", - "uploaded", - "upper", - "upperBound", - "upperOpen", - "uri", - "url", - "urn", - "urns", - "usage", - "usages", - "usb", - "usbVersionMajor", - "usbVersionMinor", - "usbVersionSubminor", - "useCurrentView", - "useMap", - "useProgram", - "usedSpace", - "user-select", - "userActivation", - "userAgent", - "userAgentData", - "userChoice", - "userHandle", - "userHint", - "userInitiated", - "userLanguage", - "userSelect", - "userState", - "userVisibleOnly", - "username", - "usernameFragment", - "utterance", - "uuid", - "v8BreakIterator", - "vAlign", - "vLink", - "valid", - "validate", - "validateProgram", - "validationMessage", - "validity", - "value", - "valueAsDate", - "valueAsNumber", - "valueAsString", - "valueInSpecifiedUnits", - "valueMissing", - "valueOf", - "valueText", - "valueType", - "values", - "variable", - "variant", - "variationSettings", - "vb", - "vector-effect", - "vectorEffect", - "velocityAngular", - "velocityExpansion", - "velocityX", - "velocityY", - "vendor", - "vendorId", - "vendorSub", - "verify", - "version", - "vertex", - "vertexAttrib1f", - "vertexAttrib1fv", - "vertexAttrib2f", - "vertexAttrib2fv", - "vertexAttrib3f", - "vertexAttrib3fv", - "vertexAttrib4f", - "vertexAttrib4fv", - "vertexAttribDivisor", - "vertexAttribDivisorANGLE", - "vertexAttribI4i", - "vertexAttribI4iv", - "vertexAttribI4ui", - "vertexAttribI4uiv", - "vertexAttribIPointer", - "vertexAttribPointer", - "vertical", - "vertical-align", - "verticalAlign", - "verticalOverflow", - "vh", - "vi", - "vibrate", - "vibrationActuator", - "videoBitsPerSecond", - "videoHeight", - "videoTracks", - "videoWidth", - "view", - "viewBox", - "viewBoxString", - "viewDimension", - "viewFormats", - "viewTarget", - "viewTargetString", - "viewTransition", - "viewport", - "viewportAnchorX", - "viewportAnchorY", - "viewportElement", - "views", - "violatedDirective", - "virtualKeyboard", - "virtualKeyboardPolicy", - "visibility", - "visibilityState", - "visible", - "visibleRect", - "visualViewport", - "vlinkColor", - "vmax", - "vmin", - "voice", - "voiceURI", - "volume", - "vrml", - "vspace", - "vw", - "w", - "wait", - "waitAsync", - "waitSync", - "waiting", - "wake", - "wakeLock", - "wand", - "warmup", - "warn", - "wasAlternateProtocolAvailable", - "wasClean", - "wasDiscarded", - "wasFetchedViaSpdy", - "wasNpnNegotiated", - "watch", - "watchAvailability", - "watchPosition", - "webNavigation", - "webRequest", - "webdriver", - "webkitAddKey", - "webkitAlignContent", - "webkitAlignItems", - "webkitAlignSelf", - "webkitAnimation", - "webkitAnimationDelay", - "webkitAnimationDirection", - "webkitAnimationDuration", - "webkitAnimationFillMode", - "webkitAnimationIterationCount", - "webkitAnimationName", - "webkitAnimationPlayState", - "webkitAnimationTimingFunction", - "webkitAppearance", - "webkitAudioContext", - "webkitAudioDecodedByteCount", - "webkitAudioPannerNode", - "webkitBackfaceVisibility", - "webkitBackground", - "webkitBackgroundAttachment", - "webkitBackgroundClip", - "webkitBackgroundColor", - "webkitBackgroundImage", - "webkitBackgroundOrigin", - "webkitBackgroundPosition", - "webkitBackgroundPositionX", - "webkitBackgroundPositionY", - "webkitBackgroundRepeat", - "webkitBackgroundSize", - "webkitBackingStorePixelRatio", - "webkitBorderBottomLeftRadius", - "webkitBorderBottomRightRadius", - "webkitBorderImage", - "webkitBorderImageOutset", - "webkitBorderImageRepeat", - "webkitBorderImageSlice", - "webkitBorderImageSource", - "webkitBorderImageWidth", - "webkitBorderRadius", - "webkitBorderTopLeftRadius", - "webkitBorderTopRightRadius", - "webkitBoxAlign", - "webkitBoxDirection", - "webkitBoxFlex", - "webkitBoxOrdinalGroup", - "webkitBoxOrient", - "webkitBoxPack", - "webkitBoxShadow", - "webkitBoxSizing", - "webkitCancelAnimationFrame", - "webkitCancelFullScreen", - "webkitCancelKeyRequest", - "webkitCancelRequestAnimationFrame", - "webkitClearResourceTimings", - "webkitClipPath", - "webkitClosedCaptionsVisible", - "webkitConvertPointFromNodeToPage", - "webkitConvertPointFromPageToNode", - "webkitCreateShadowRoot", - "webkitCurrentFullScreenElement", - "webkitCurrentPlaybackTargetIsWireless", - "webkitDecodedFrameCount", - "webkitDirectionInvertedFromDevice", - "webkitDisplayingFullscreen", - "webkitDroppedFrameCount", - "webkitEnterFullScreen", - "webkitEnterFullscreen", - "webkitEntries", - "webkitExitFullScreen", - "webkitExitFullscreen", - "webkitExitPointerLock", - "webkitFilter", - "webkitFlex", - "webkitFlexBasis", - "webkitFlexDirection", - "webkitFlexFlow", - "webkitFlexGrow", - "webkitFlexShrink", - "webkitFlexWrap", - "webkitFontFeatureSettings", - "webkitFullScreenKeyboardInputAllowed", - "webkitFullscreenElement", - "webkitFullscreenEnabled", - "webkitGenerateKeyRequest", - "webkitGetAsEntry", - "webkitGetDatabaseNames", - "webkitGetEntries", - "webkitGetEntriesByName", - "webkitGetEntriesByType", - "webkitGetFlowByName", - "webkitGetGamepads", - "webkitGetImageDataHD", - "webkitGetNamedFlows", - "webkitGetRegionFlowRanges", - "webkitGetUserMedia", - "webkitHasClosedCaptions", - "webkitHidden", - "webkitIDBCursor", - "webkitIDBDatabase", - "webkitIDBDatabaseError", - "webkitIDBDatabaseException", - "webkitIDBFactory", - "webkitIDBIndex", - "webkitIDBKeyRange", - "webkitIDBObjectStore", - "webkitIDBRequest", - "webkitIDBTransaction", - "webkitImageSmoothingEnabled", - "webkitIndexedDB", - "webkitInitMessageEvent", - "webkitIsFullScreen", - "webkitJustifyContent", - "webkitKeys", - "webkitLineClamp", - "webkitLineDashOffset", - "webkitLockOrientation", - "webkitMask", - "webkitMaskClip", - "webkitMaskComposite", - "webkitMaskImage", - "webkitMaskOrigin", - "webkitMaskPosition", - "webkitMaskPositionX", - "webkitMaskPositionY", - "webkitMaskRepeat", - "webkitMaskSize", - "webkitMatchesSelector", - "webkitMediaStream", - "webkitNotifications", - "webkitOfflineAudioContext", - "webkitOrder", - "webkitOrientation", - "webkitPeerConnection00", - "webkitPersistentStorage", - "webkitPerspective", - "webkitPerspectiveOrigin", - "webkitPointerLockElement", - "webkitPostMessage", - "webkitPreservesPitch", - "webkitPutImageDataHD", - "webkitRTCPeerConnection", - "webkitRegionOverset", - "webkitRelativePath", - "webkitRequestAnimationFrame", - "webkitRequestFileSystem", - "webkitRequestFullScreen", - "webkitRequestFullscreen", - "webkitRequestPointerLock", - "webkitResolveLocalFileSystemURL", - "webkitSetMediaKeys", - "webkitSetResourceTimingBufferSize", - "webkitShadowRoot", - "webkitShowPlaybackTargetPicker", - "webkitSlice", - "webkitSpeechGrammar", - "webkitSpeechGrammarList", - "webkitSpeechRecognition", - "webkitSpeechRecognitionError", - "webkitSpeechRecognitionEvent", - "webkitStorageInfo", - "webkitSupportsFullscreen", - "webkitTemporaryStorage", - "webkitTextFillColor", - "webkitTextSecurity", - "webkitTextSizeAdjust", - "webkitTextStroke", - "webkitTextStrokeColor", - "webkitTextStrokeWidth", - "webkitTransform", - "webkitTransformOrigin", - "webkitTransformStyle", - "webkitTransition", - "webkitTransitionDelay", - "webkitTransitionDuration", - "webkitTransitionProperty", - "webkitTransitionTimingFunction", - "webkitURL", - "webkitUnlockOrientation", - "webkitUserSelect", - "webkitVideoDecodedByteCount", - "webkitVisibilityState", - "webkitWirelessVideoPlaybackDisabled", - "webkitdirectory", - "webkitdropzone", - "webstore", - "weight", - "wgslLanguageFeatures", - "whatToShow", - "wheelDelta", - "wheelDeltaX", - "wheelDeltaY", - "whenDefined", - "which", - "white-space", - "white-space-collapse", - "whiteSpace", - "whiteSpaceCollapse", - "wholeText", - "widows", - "width", - "will-change", - "willChange", - "willValidate", - "window", - "windowAttribution", - "windowControlsOverlay", - "windowId", - "windowIds", - "windows", - "with", - "withCredentials", - "withResolvers", - "word-break", - "word-spacing", - "word-wrap", - "wordBreak", - "wordSpacing", - "wordWrap", - "workerStart", - "worklet", - "wow64", - "wrap", - "wrapKey", - "writable", - "writableAuxiliaries", - "write", - "writeBuffer", - "writeMask", - "writeText", - "writeTexture", - "writeTimestamp", - "writeValue", - "writeValueWithResponse", - "writeValueWithoutResponse", - "writeWithoutResponse", - "writeln", - "writing-mode", - "writingMode", - "writingSuggestions", - "x", - "x1", - "x2", - "xChannelSelector", - "xmlEncoding", - "xmlStandalone", - "xmlVersion", - "xmlbase", - "xmllang", - "xmlspace", - "xor", - "xr", - "y", - "y1", - "y2", - "yChannelSelector", - "yandex", - "yield", - "z", - "z-index", - "zIndex", - "zoom", - "zoomAndPan", - "zoomRectScreen", -]; - - -/***/ }), - -/***/ "./node_modules/text-encoder/index.js": -/*!********************************************!*\ - !*** ./node_modules/text-encoder/index.js ***! - \********************************************/ -/***/ ((module) => { - -var utf8Encodings = [ - 'utf8', - 'utf-8', - 'unicode-1-1-utf-8' -]; - -function TextEncoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } else { - this.encoding = 'utf-8'; - this.encode = function(str) { - if (typeof str !== 'string') { - throw new TypeError('passed argument must be of tye string'); - } - var binstr = unescape(encodeURIComponent(str)), - arr = new Uint8Array(binstr.length); - const split = binstr.split(''); - for (let i = 0; i < split.length; i++) { - arr[i] = split[i].charCodeAt(0); - } - return arr; - }; - } -} - -function TextDecoder(encoding) { - if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { - throw new RangeError('Invalid encoding type. Only utf-8 is supported'); - } - else { - this.encoding = 'utf-8'; - this.decode = function (view, options) { - if (typeof view === 'undefined') { - return ''; - } - - var stream = (typeof options !== 'undefined' && stream in options) ? options.stream : false; - if (typeof stream !== 'boolean') { - throw new TypeError('stream option must be boolean'); - } - - if (!ArrayBuffer.isView(view)) { - throw new TypeError('passed argument must be an array buffer view'); - } else { - var arr = new Uint8Array(view.buffer, view.byteOffset, view.byteLength), - charArr = new Array(arr.length); - for (let i = 0; i < arr.length; i++) { - charArr[i] = String.fromCharCode(arr[i]); - } - return decodeURIComponent(escape(charArr.join(''))); - } - } - } -} - -module.exports = { - TextEncoder, - TextDecoder, -}; - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. -(() => { -"use strict"; -/*!************************!*\ - !*** ./src/terser.mjs ***! - \************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ runTest: () => (/* binding */ runTest) -/* harmony export */ }); -/* harmony import */ var terser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! terser */ "./node_modules/terser/main.js"); -// Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - -const payloads = [ - { - name: "speedometer-es2015-test-2.0.js", - options: { compress: { passes: 1, sequences: false } }, - }, -]; - -async function runTest(fileData) { - const testData = payloads.map(({ name, options }) => ({ - payload: fileData[name], - options, - })); - - return await Promise.all( - testData.map(({ payload, options }) => (0,terser__WEBPACK_IMPORTED_MODULE_0__.minify)(payload, options)) - ); -} - -})(); - -self.WTBenchmark = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/web-tooling-benchmark/dist/terser.bundle.min.js b/web-tooling-benchmark/dist/terser.bundle.min.js new file mode 100644 index 00000000..587a56ed --- /dev/null +++ b/web-tooling-benchmark/dist/terser.bundle.min.js @@ -0,0 +1 @@ +(()=>{var e={4424:function(e){e.exports=function(){"use strict";const e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function i(t){return e.test(t)}function r(e){return e.startsWith("//")}function o(e){return e.startsWith("/")}function a(e){return e.startsWith("file:")}function s(e){return/^[.?#]/.test(e)}function u(e){const n=t.exec(e);return l(n[1],n[2]||"",n[3],n[4]||"",n[5]||"/",n[6]||"",n[7]||"")}function c(e){const t=n.exec(e),i=t[2];return l("file:","",t[1]||"","",o(i)?i:"/"+i,t[3]||"",t[4]||"")}function l(e,t,n,i,r,o,a){return{scheme:e,user:t,host:n,port:i,path:r,query:o,hash:a,type:7}}function f(e){if(r(e)){const t=u("http:"+e);return t.scheme="",t.type=6,t}if(o(e)){const t=u("http://foo.com"+e);return t.scheme="",t.host="",t.type=5,t}if(a(e))return c(e);if(i(e))return u(e);const t=u("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}function p(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}function d(e,t){h(t,t.type),"/"===e.path?e.path=t.path:e.path=p(t.path)+e.path}function h(e,t){const n=t<=4,i=e.path.split("/");let r=1,o=0,a=!1;for(let e=1;ei&&(i=r)}h(n,i);const r=n.query+n.hash;switch(i){case 2:case 3:return r;case 4:{const i=n.path.slice(1);return i?s(t||e)&&!s(i)?"./"+i+r:i+r:r||"."}case 5:return n.path+r;default:return n.scheme+"//"+n.user+n.host+n.port+n.path+r}}return _}()},65606:e=>{var t,n,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&p())}function p(){if(!c){var e=a(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l1)for(var n=1;n{var t=["utf8","utf-8","unicode-1-1-utf-8"];e.exports={TextEncoder:function(e){if(t.indexOf(e)<0&&void 0!==e&&null!=e)throw new RangeError("Invalid encoding type. Only utf-8 is supported");this.encoding="utf-8",this.encode=function(e){if("string"!=typeof e)throw new TypeError("passed argument must be of tye string");var t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);const i=t.split("");for(let e=0;e{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";function e(e){return e.split("")}function t(e,t){return t.includes(e)}n.r(i),n.d(i,{runTest:()=>Ra});class r extends Error{constructor(e,t){super(),this.name="DefaultsError",this.message=e,this.defs=t}}function o(e,t,n){!0===e?e={}:null!=e&&"object"==typeof e&&(e={...e});const i=e||{};if(n)for(const e in i)if(v(i,e)&&!v(t,e))throw new r("`"+e+"` is not a supported option",t);for(const n in t)if(v(t,n))if(e&&v(e,n))if("ecma"===n){let t=0|e[n];t>5&&t<2015&&(t+=2009),i[n]=t}else i[n]=e&&v(e,n)?e[n]:t[n];else i[n]=t[n];return i}function a(){}function s(){return!1}function u(){return!0}function c(){return this}function l(){return null}var f=function(){function e(e,n,i=!0){const r=[];for(let o=0;o=0;)e[n]===t&&e.splice(n,1)}function m(e,t){if(e.length<2)return e.slice();return function e(n){if(n.length<=1)return n;var i=Math.floor(n.length/2),r=n.slice(0,i),o=n.slice(i);return function(e,n){for(var i=[],r=0,o=0,a=0;ry.test(e);function T(e,t){return e._annotations&t}function C(e,t){e._annotations|=t}function R(e,t){e._annotations&=~t}var O="",F=new Map,k="break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with",M="false null true",w="enum import super this "+M+" "+k,x="implements interface package private protected public static "+w,I="return new delete throw else case yield await";k=g(k),w=g(w),I=g(I),M=g(M),x=g(x);var N=g(e("+-*&%=<>!?|~^")),P=/^0x[0-9a-f]+$/i,B=/^0[0-7]+$/,L=/^0o[0-7]+$/i,V=/^0b[01]+$/i,U=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,G=/^(0[xob])?[0-9a-f]+n$/i,K=g(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","||=","&&=","??=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","??","||"]),H=g(e("  \n\r\t\f\v​           \u2028\u2029   \ufeff")),X=g(e("\n\r\u2028\u2029")),z=g(e(";]),:")),W=g(e("[{(,;:")),q=g(e("[]{}(),;:")),Y={ID_Start:/[$A-Z_a-z\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/};function $(e,t){if(j(e.charCodeAt(t))){if(Z(e.charCodeAt(t+1)))return e.charAt(t)+e.charAt(t+1)}else if(Z(e.charCodeAt(t))&&j(e.charCodeAt(t-1)))return e.charAt(t-1)+e.charAt(t);return e.charAt(t)}function j(e){return e>=55296&&e<=56319}function Z(e){return e>=56320&&e<=57343}function Q(e){return e>=48&&e<=57}function J(e){return Y.ID_Start.test(e)}function ee(e){return Y.ID_Continue.test(e)}const te=/^[a-z_$][a-z0-9_$]*$/i;function ne(e){return te.test(e)}function ie(e,t){if(te.test(e))return!0;if(!t&&/[\ud800-\udfff]/.test(e))return!1;var n=Y.ID_Start.exec(e);return!(!n||0!==n.index)&&(!(e=e.slice(n[0].length))||!!(n=Y.ID_Continue.exec(e))&&n[0].length===e.length)}function re(e,t=!0){if(!t&&e.includes("e"))return NaN;if(P.test(e))return parseInt(e.substr(2),16);if(B.test(e))return parseInt(e.substr(1),8);if(L.test(e))return parseInt(e.substr(2),8);if(V.test(e))return parseInt(e.substr(2),2);if(U.test(e))return parseFloat(e);var n=parseFloat(e);return n==e?n:void 0}class oe extends Error{constructor(e,t,n,i,r){super(),this.name="SyntaxError",this.message=e,this.filename=t,this.line=n,this.col=i,this.pos=r}}function ae(e,t,n,i,r){throw new oe(e,t,n,i,r)}function se(e,t,n){return e.type==t&&(null==n||e.value==n)}var ue={};function ce(e,t,n,i){var r={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function o(){return $(r.text,r.pos)}function a(){if(!(46===r.text.charCodeAt(r.pos+1)))return!1;const e=r.text.charCodeAt(r.pos+2);return e<48||e>57}function s(e,t){var n=$(r.text,r.pos++);if(e&&!n)throw ue;return X.has(n)?(r.newline_before=r.newline_before||!t,++r.line,r.col=0,"\r"==n&&"\n"==o()&&(++r.pos,n="\n")):(n.length>1&&(++r.pos,++r.col),++r.col),n}function u(e){for(;e--;)s()}function c(e){return r.text.substr(r.pos,e.length)==e}function l(e,t){var n=r.text.indexOf(e,r.pos);if(t&&-1==n)throw ue;return n}function f(){r.tokline=r.line,r.tokcol=r.col,r.tokpos=r.pos}var p=!1,d=null;function h(e,n,i){r.regex_allowed="operator"==e&&!fe.has(n)||"keyword"==e&&I.has(n)||"punc"==e&&W.has(n)||"arrow"==e,"punc"!=e||"."!=n&&"?."!=n?i||(p=!1):p=!0;const o=r.tokline,a=r.tokcol,s=r.tokpos,u=r.newline_before,c=t;let l=[],f=[];i||(l=r.comments_before,f=r.comments_before=[]),r.newline_before=!1;const h=new be(e,n,o,a,s,u,l,f,c);return i||(d=h),h}function _(){for(;H.has(o());)s()}function m(e){ae(e,t,r.tokline,r.tokcol,r.tokpos)}function g(e){var t=!1,n=!1,i=!1,r="."==e,a=!1,u=!1,c=function(e){for(var t,n="",i=0;(t=o())&&e(t,i++);)n+=s();return n}(function(o,s){if(a)return!1;var c=o.charCodeAt(0);switch(c){case 95:return u=!0;case 98:case 66:return i=!0;case 111:case 79:case 120:case 88:return!i&&(i=!0);case 101:case 69:return!!i||!t&&(t=n=!0);case 45:return n||0==s&&!e;case 43:return n;case n=!1,46:return!(r||i||t)&&(r=!0);case 110:return a=!0,!0}return c>=48&&c<=57||c>=97&&c<=102||c>=65&&c<=70});if(e&&(c=e+c),O=c,B.test(c)&&ne.has_directive("use strict")&&m("Legacy octal literals are not allowed in strict mode"),u&&(c.endsWith("_")?m("Numeric separators are not allowed at the end of numeric literals"):c.includes("__")&&m("Only one underscore is allowed as numeric separator"),c=c.replace(/_/g,"")),a){const e=c.slice(0,-1),t=re(e,P.test(e));if(!r&&G.test(c)&&!isNaN(t))return h("big_int",e);m("Invalid or unexpected token")}var l=re(c);if(!isNaN(l))return h("num",l);m("Invalid syntax: "+c)}function E(e){return e>="0"&&e<="7"}function v(e,t,n){var i,a=s(!0,e);switch(a.charCodeAt(0)){case 110:return"\n";case 114:return"\r";case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 120:return String.fromCharCode(b(2,t));case 117:if("{"==o()){for(s(!0),"}"===o()&&m("Expecting hex-character between {}");"0"==o();)s(!0);var u,c=l("}",!0)-r.pos;return(c>6||(u=b(c,t))>1114111)&&m("Unicode reference out of bounds"),s(!0),(i=u)>65535?(i-=65536,String.fromCharCode(55296+(i>>10))+String.fromCharCode(i%1024+56320)):String.fromCharCode(i)}return String.fromCharCode(b(4,t));case 10:return"";case 13:if("\n"==o())return s(!0,e),""}if(E(a)){if(n&&t){"0"===a&&!E(o())||m("Octal escape sequences are not allowed in template strings")}return function(e,t){var n=o();n>="0"&&n<="7"&&(e+=s(!0))[0]<="3"&&(n=o())>="0"&&n<="7"&&(e+=s(!0));if("0"===e)return"\0";e.length>0&&ne.has_directive("use strict")&&t&&m("Legacy octal escape sequences are not allowed in strict mode");return String.fromCharCode(parseInt(e,8))}(a,t)}return a}function b(e,t){for(var n=0;e>0;--e){if(!t&&isNaN(parseInt(o(),16)))return parseInt(n,16)||"";var i=s(!0);isNaN(parseInt(i,16))&&m("Invalid hex-character pattern in string"),n+=i}return parseInt(n,16)}var D=te("Unterminated string constant",function(){const e=r.pos;for(var t=s(),n=[];;){var i=s(!0,!0);if("\\"==i)i=v(!0,!0);else if("\r"==i||"\n"==i)m("Unterminated string constant");else if(i==t)break;n.push(i)}var o=h("string",n.join(""));return O=r.text.slice(e,r.pos),o.quote=t,o}),S=te("Unterminated template",function(e){e&&r.template_braces.push(r.brace_counter);var t,n,i="",a="";for(s(!0,!0);"`"!=(t=s(!0,!0));){if("\r"==t)"\n"==o()&&++r.pos,t="\n";else if("$"==t&&"{"==o())return s(!0,!0),r.brace_counter++,n=h(e?"template_head":"template_cont",i),F.set(n,a),n.template_end=!1,n;if(a+=t,"\\"==t){var u=r.pos;t=v(!0,!(d&&("name"===d.type||"punc"===d.type&&(")"===d.value||"]"===d.value))),!0),a+=r.text.substr(u,r.pos-u)}i+=t}return r.template_braces.pop(),n=h(e?"template_head":"template_cont",i),F.set(n,a),n.template_end=!0,n});function y(e){var t,n=r.regex_allowed,i=function(){for(var e=r.text,t=r.pos,n=r.text.length;t="a"&&n<="z"||n>="A"&&n<="Z"););return t>e+1&&n&&"\\"!==n&&!ee(n)?(r.pos+=t-e,r.col+=t-e,r.text.slice(e,r.pos)):C()},C=te("Unterminated identifier name",function(){var e,t=[],n=!1,i=function(){return n=!0,s(),"u"!==o()&&m("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"),v(!1,!0)};if("\\"===(e=o()))J(e=i())||m("First identifier char is an invalid identifier char");else{if(!J(e))return"";s()}for(t.push(e);null!=(e=o());){if("\\"===(e=o()))ee(e=i())||m("Invalid escaped identifier char");else{if(!ee(e))break;s()}t.push(e)}const r=t.join("");return w.has(r)&&n&&m("Escaped characters are not allowed in keywords"),r}),R=te("Unterminated regular expression",function(e){for(var t,n=!1,i=!1;t=s(!0);)if(X.has(t))m("Unexpected line terminator");else if(n)/^[\u0000-\u007F]$/.test(t)?e+="\\"+t:e+=t,n=!1;else if("["==t)i=!0,e+=t;else if("]"==t&&i)i=!1,e+=t;else{if("/"==t&&!i)break;"\\"==t?n=!0:e+=t}return h("regexp","/"+e+"/"+T())});function x(e){return h("operator",function e(t){if(!o())return t;var n=t+o();return K.has(n)?(s(),e(n)):t}(e||s()))}function L(){switch(s(),o()){case"/":return s(),y("comment1");case"*":return s(),A()}return r.regex_allowed?R(""):x("/")}function V(){return s(),">"===o()?(s(),h("arrow","=>")):x("=")}function U(){return s(),Q(o().charCodeAt(0))?g("."):"."===o()?(s(),s(),h("expand","...")):h("punc",".")}function z(){var e=T();return p?h("name",e):M.has(e)?h("atom",e):k.has(e)?K.has(e)?h("operator",e):h("keyword",e):h("name",e)}function Y(){return s(),h("privatename",T())}function te(e,t){return function(n){try{return t(n)}catch(t){if(t!==ue)throw t;m(e)}}}function ne(e){if(null!=e)return R(e);for(i&&0==r.pos&&c("#!")&&(f(),u(2),y("comment5"));;){if(_(),f(),n){if(c("\x3c!--")){u(4),y("comment3");continue}if(c("--\x3e")&&r.newline_before){u(3),y("comment4");continue}}var t=o();if(!t)return h("eof");var l=t.charCodeAt(0);switch(l){case 34:case 39:return D();case 46:return U();case 47:var p=L();if(p===ne)continue;return p;case 61:return V();case 63:if(!a())break;return s(),s(),h("punc","?.");case 96:return S(!0);case 123:r.brace_counter++;break;case 125:if(r.brace_counter--,r.template_braces.length>0&&r.template_braces[r.template_braces.length-1]===r.brace_counter)return S(!1)}if(Q(l))return g();if(q.has(t))return h("punc",s());if(N.has(t))return x();if(92==l||J(t))return z();if(35==l)return Y();break}m("Unexpected character '"+t+"'")}return ne.next=s,ne.peek=o,ne.context=function(e){return e&&(r=e),r},ne.add_directive=function(e){r.directive_stack[r.directive_stack.length-1].push(e),void 0===r.directives[e]?r.directives[e]=1:r.directives[e]++},ne.push_directives_stack=function(){r.directive_stack.push([])},ne.pop_directives_stack=function(){for(var e=r.directive_stack[r.directive_stack.length-1],t=0;t0},ne}var le=g(["typeof","void","delete","--","++","!","~","-","+"]),fe=g(["--","++"]),pe=g(["=","+=","-=","??=","&&=","||=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]),de=g(["??=","&&=","||="]),he=function(e,t){for(var n=0;n","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{}),_e=g(["atom","num","big_int","string","regexp","name"]);function me(e,t){const n=new WeakMap;t=o(t,{bare_returns:!1,ecma:null,expression:!1,filename:null,html5_comments:!0,module:!1,shebang:!0,strict:!1,toplevel:null},!0);var i={input:"string"==typeof e?ce(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:!0,in_loop:0,labels:[]};function r(e,t){return se(i.token,e,t)}function a(){return i.peeked||(i.peeked=i.input())}function s(){return i.prev=i.token,i.peeked||a(),i.token=i.peeked,i.peeked=null,i.in_directives=i.in_directives&&("string"==i.token.type||r("punc",";")),i.token}function u(){return i.prev}function c(e,t,n,r){var o=i.input.context();ae(e,o.filename,null!=t?t:o.tokline,null!=n?n:o.tokcol,null!=r?r:o.tokpos)}function l(e,t){c(t,e.line,e.col)}function f(e){null==e&&(e=i.token),l(e,"Unexpected token: "+e.type+" ("+e.value+")")}function p(e,t){if(r(e,t))return s();l(i.token,"Unexpected token "+i.token.type+" «"+i.token.value+"», expected "+e+" «"+t+"»")}function d(e){return p("punc",e)}function h(e){return e.nlb||!e.comments_before.every(e=>!e.nlb)}function _(){return!t.strict&&(r("eof")||r("punc","}")||h(i.token))}function m(){return i.in_generator===i.in_function}function g(){return i.in_async===i.in_function||0===i.in_function&&i.input.has_directive("use strict")}function E(e){r("punc",";")?s():e||_()||f()}function v(){d("(");var e=lt(!0);return d(")"),e}function b(e){return function(...t){const n=i.token,r=e(...t);return r.start=n,r.end=u(),r}}function D(){(r("operator","/")||r("operator","/="))&&(i.peeked=null,i.token=i.input(i.token.value.substr(1)))}i.token=s();var S=b(function e(n,o,m){switch(D(),i.token.type){case"string":if(i.in_directives){var b=a();!O.includes("\\")&&(se(b,"punc",";")||se(b,"punc","}")||h(b)||se(b,"eof"))?i.input.add_directive(i.token.value):i.in_directives=!1}var S=i.in_directives,C=A();return S&&C.body instanceof Mn?new Ae(C.body):C;case"template_head":case"num":case"big_int":case"regexp":case"operator":case"atom":return A();case"name":case"privatename":if(r("privatename")&&!i.in_class&&c("Private field must be used in an enclosing class"),"async"==i.token.value&&se(a(),"keyword","function"))return s(),s(),o&&c("functions are not allowed as the body of a loop"),I(Ye,!1,!0,n);if("import"==i.token.value&&!se(a(),"punc","(")&&!se(a(),"punc",".")){s();var F=function(){var e,t,n=u();r("name")&&(e=De(bn));r("punc",",")&&s();((t=ue(!0))||e)&&p("name","from");var o=i.token;"string"!==o.type&&f();s();const a=ie();return new yt({start:n,imported_name:e,imported_names:t,module_name:new Mn({start:o,value:o.value,quote:o.quote,end:o}),attributes:a,end:i.token})}();return E(),F}return se(a(),"punc",":")?y():A();case"punc":switch(i.token.value){case"{":return new Fe({start:i.token,body:U(),end:u()});case"[":case"(":return A();case";":return i.in_directives=!1,s(),new ke;default:f()}case"keyword":switch(i.token.value){case"break":return s(),T(rt);case"continue":return s(),T(ot);case"debugger":return s(),E(),new ye;case"do":s();var w=It(e);p("keyword","while");var x=v();return E(!0),new Ne({body:w,condition:x});case"while":return s(),new Pe({condition:v(),body:It(function(){return e(!1,!0)})});case"for":return s(),function(){var e="`for await` invalid in this context",t=i.token;"name"==t.type&&"await"==t.value?(g()||l(t,e),s()):t=!1;d("(");var n=null;if(r("punc",";"))t&&l(t,e);else{n=r("keyword","var")?(s(),H(!0)):r("keyword","let")?(s(),X(!0)):r("keyword","const")?(s(),W(!0)):lt(!0,!0);var o=r("operator","in"),a=r("name","of");if(t&&!a&&l(t,e),o||a)return n instanceof gt?n.definitions.length>1&&l(n.start,"Only one variable declaration allowed in for..in loop"):Xe(n)||(n=Je(n))instanceof $e||l(n.start,"Invalid left-hand side in for..in loop"),s(),o?M(n):k(n,!!t)}return R(n)}();case"class":return s(),o&&c("classes are not allowed as the body of a loop"),m&&c("classes are not allowed as the body of an if"),te(tn,n);case"function":return s(),o&&c("functions are not allowed as the body of a loop"),I(Ye,!1,!1,n);case"if":return s(),V();case"return":0!=i.in_function||t.bare_returns||c("'return' outside of function"),s();var N=null;return r("punc",";")?s():_()||(N=lt(!0),E()),new tt({value:N});case"switch":return s(),new ct({expression:v(),body:It(G)});case"throw":s(),h(i.token)&&c("Illegal newline after 'throw'");N=lt(!0);return E(),new nt({value:N});case"try":return s(),function(){var e,t=null,n=null;if(e=new ht({start:i.token,body:U(),end:u()}),r("keyword","catch")){var o=i.token;if(s(),r("punc","{"))var a=null;else{d("(");a=P(void 0,vn);d(")")}t=new _t({start:o,argname:a,body:U(),end:u()})}if(r("keyword","finally")){o=i.token;s(),n=new mt({start:o,body:U(),end:u()})}t||n||c("Missing catch/finally blocks");return new dt({body:e,bcatch:t,bfinally:n})}();case"var":s();F=H();return E(),F;case"let":s();F=X();return E(),F;case"const":s();F=W();return E(),F;case"with":return i.input.has_directive("use strict")&&c("Strict mode may not include a with statement"),s(),new Ue({expression:v(),body:e()});case"export":if(!se(a(),"punc","(")){s();F=me();return r("punc",";")&&E(),F}}}f()});function y(){var e=De(Sn);"await"===e.name&&i.in_async===i.in_function&&l(i.prev,"await cannot be used as label inside async function"),i.labels.some(t=>t.name===e.name)&&c("Label "+e.name+" defined twice"),d(":"),i.labels.push(e);var t=S();return i.labels.pop(),t instanceof xe||e.references.forEach(function(t){t instanceof ot&&(t=t.label.start,c("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos))}),new we({body:t,label:e})}function A(e){return new Te({body:(e=lt(!0),E(),e)})}function T(e){var t,n=null;_()||(n=De(Cn,!0)),null!=n?((t=i.labels.find(e=>e.name===n.name))||c("Undefined label "+n.name),n.thedef=t):0==i.in_loop&&c(e.TYPE+" not inside a loop or switch"),E();var r=new e({label:n});return t&&t.references.push(r),r}function R(e){d(";");var t=r("punc",";")?null:lt(!0);d(";");var n=r("punc",")")?null:lt(!0);return d(")"),new Be({init:e,condition:t,step:n,body:It(function(){return S(!1,!0)})})}function k(e,t){var n=e instanceof gt?e.definitions[0].name:null,i=lt(!0);return d(")"),new Ve({await:t,init:e,name:n,object:i,body:It(function(){return S(!1,!0)})})}function M(e){var t=lt(!0);return d(")"),new Le({init:e,object:t,body:It(function(){return S(!1,!0)})})}var x=function(e,t,n){h(i.token)&&c("Unexpected newline before arrow (=>)"),p("arrow","=>");var o=L(r("punc","{"),!1,n);return new qe({start:e,end:o.end,async:n,argnames:t,body:o})},I=function(e,t,n,i){var o=e===Ye;r("operator","*")&&(t=!0,s());var a=r("name")?De(o?dn:mn):null;o&&!a&&(i?e=We:f()),!a||e===ze||a instanceof sn||f(u());var c=[],l=L(!0,t,n,a,c);return new e({start:c.start,end:l.end,is_generator:t,async:n,name:a,argnames:c,body:l})};class N{constructor(e,t,n=!1){this.is_parameter=e,this.duplicates_ok=n,this.parameters=new Set,this.duplicate=null,this.default_assignment=!1,this.spread=!1,this.strict_mode=!!t}add_parameter(e){if(this.parameters.has(e.value))null===this.duplicate&&(this.duplicate=e),this.check_strict();else if(this.parameters.add(e.value),this.is_parameter)switch(e.value){case"arguments":case"eval":case"yield":this.strict_mode&&l(e,"Unexpected "+e.value+" identifier as parameter inside strict mode");break;default:w.has(e.value)&&f()}}mark_default_assignment(e){!1===this.default_assignment&&(this.default_assignment=e)}mark_spread(e){!1===this.spread&&(this.spread=e)}mark_strict_mode(){this.strict_mode=!0}is_strict(){return!1!==this.default_assignment||!1!==this.spread||this.strict_mode}check_strict(){this.is_strict()&&null!==this.duplicate&&!this.duplicates_ok&&l(this.duplicate,"Parameter "+this.duplicate.value+" was used already")}}function P(e,t){var n,o=!1;return void 0===e&&(e=new N(!0,i.input.has_directive("use strict"))),r("expand","...")&&(o=i.token,e.mark_spread(i.token),s()),n=B(e,t),r("operator","=")&&!1===o&&(e.mark_default_assignment(i.token),s(),n=new Ut({start:n.start,left:n,operator:"=",right:lt(!1),end:i.token})),!1!==o&&(r("punc",")")||f(),n=new He({start:o,expression:n,end:o})),e.check_strict(),n}function B(e,t){var n,o=[],l=!0,p=!1,h=i.token;if(void 0===e){const n=i.input.has_directive("use strict");e=new N(!1,n,t===un)}if(t=void 0===t?pn:t,r("punc","[")){for(s();!r("punc","]");){if(l?l=!1:d(","),r("expand","...")&&(p=!0,n=i.token,e.mark_spread(i.token),s()),r("punc"))switch(i.token.value){case",":o.push(new Vn({start:i.token,end:i.token}));continue;case"]":break;case"[":case"{":o.push(B(e,t));break;default:f()}else r("name")?(e.add_parameter(i.token),o.push(De(t))):c("Invalid function parameter");r("operator","=")&&!1===p&&(e.mark_default_assignment(i.token),s(),o[o.length-1]=new Ut({start:o[o.length-1].start,left:o[o.length-1],operator:"=",right:lt(!1),end:i.token})),p&&(r("punc","]")||c("Rest element must be last element"),o[o.length-1]=new He({start:n,expression:o[o.length-1],end:n}))}return d("]"),e.check_strict(),new $e({start:h,names:o,is_array:!0,end:u()})}if(r("punc","{")){for(s();!r("punc","}");){if(l?l=!1:d(","),r("expand","...")&&(p=!0,n=i.token,e.mark_spread(i.token),s()),r("name")&&(se(a(),"punc")||se(a(),"operator"))&&[",","}","="].includes(a().value)){e.add_parameter(i.token);var _=u(),m=De(t);p?o.push(new He({start:n,expression:m,end:m.end})):o.push(new Xt({start:_,key:m.name,value:m,end:m.end}))}else{if(r("punc","}"))continue;var g=i.token,E=ge();null===E?f(u()):"name"!==u().type||r("punc",":")?(d(":"),o.push(new Xt({start:g,quote:g.quote,key:E,value:B(e,t),end:u()}))):o.push(new Xt({start:u(),key:E,value:new t({start:u(),name:E,end:u()}),end:u()}))}p?r("punc","}")||c("Rest element must be last element"):r("operator","=")&&(e.mark_default_assignment(i.token),s(),o[o.length-1].value=new Ut({start:o[o.length-1].value.start,left:o[o.length-1].value,operator:"=",right:lt(!1),end:i.token}))}return d("}"),e.check_strict(),new $e({start:h,names:o,is_array:!1,end:u()})}if(r("name"))return e.add_parameter(i.token),De(t);c("Invalid function parameter")}function L(e,t,n,o,a){var u=i.in_loop,c=i.labels,l=i.in_generator,f=i.in_async;if(++i.in_function,t&&(i.in_generator=i.in_function),n&&(i.in_async=i.in_function),a&&function(e){var t=new N(!0,i.input.has_directive("use strict"));for(d("(");!r("punc",")");){var n=P(t);if(e.push(n),r("punc",")")||d(","),n instanceof He)break}s()}(a),e&&(i.in_directives=!0),i.in_loop=0,i.labels=[],e){i.input.push_directives_stack();var p=U();o&&be(o),a&&a.forEach(be),i.input.pop_directives_stack()}else p=[new tt({start:i.token,value:lt(!1),end:i.token})];return--i.in_function,i.in_loop=u,i.labels=c,i.in_generator=l,i.in_async=f,p}function V(){var e=v(),t=S(!1,!1,!0),n=null;return r("keyword","else")&&(s(),n=S(!1,!1,!0)),new ut({condition:e,body:t,alternative:n})}function U(){d("{");for(var e=[];!r("punc","}");)r("eof")&&f(),e.push(S());return s(),e}function G(){d("{");for(var e,t=[],n=null,o=null;!r("punc","}");)r("eof")&&f(),r("keyword","case")?(o&&(o.end=u()),n=[],o=new pt({start:(e=i.token,s(),e),expression:lt(!0),body:n}),t.push(o),d(":")):r("keyword","default")?(o&&(o.end=u()),n=[],o=new ft({start:(e=i.token,s(),d(":"),e),body:n}),t.push(o)):(n||f(),n.push(S()));return o&&(o.end=u()),s(),t}function K(e,t){for(var n,o=[];;){var a="var"===t?un:"const"===t?ln:"let"===t?fn:null;if(r("punc","{")||r("punc","[")?n=new Dt({start:i.token,name:B(void 0,a),value:r("operator","=")?(p("operator","="),lt(!1,e)):null,end:u()}):"import"==(n=new Dt({start:i.token,name:De(a),value:r("operator","=")?(s(),lt(!1,e)):e||"const"!==t?null:c("Missing initializer in const declaration"),end:u()})).name.name&&c("Unexpected token: import"),o.push(n),!r("punc",","))break;s()}return o}var H=function(e){return new Et({start:u(),definitions:K(e,"var"),end:u()})},X=function(e){return new vt({start:u(),definitions:K(e,"let"),end:u()})},W=function(e){return new bt({start:u(),definitions:K(e,"const"),end:u()})};function q(){var e,t=i.token;switch(t.type){case"name":e=ve(yn);break;case"num":e=new wn({start:t,end:t,value:t.value,raw:O});break;case"big_int":e=new xn({start:t,end:t,value:t.value,raw:O});break;case"string":Se(e=new Mn({start:t,end:t,value:t.value,quote:t.quote}));break;case"regexp":const[n,i,r]=t.value.match(/^\/(.*)\/(\w*)$/);e=new In({start:t,end:t,value:{source:i,flags:r}});break;case"atom":switch(t.value){case"false":e=new Kn({start:t,end:t});break;case"true":e=new Hn({start:t,end:t});break;case"null":e=new Pn({start:t,end:t})}}return s(),e}function Y(e,t){var n=function(e,t){return t?new Ut({start:e.start,left:e,operator:"=",right:t,end:t.end}):e};return e instanceof Kt?n(new $e({start:e.start,end:e.end,is_array:!1,names:e.properties.map(e=>Y(e))}),t):e instanceof Xt?(e.value=Y(e.value),n(e,t)):e instanceof Vn?e:e instanceof $e?(e.names=e.names.map(e=>Y(e)),n(e,t)):e instanceof yn?n(new pn({name:e.name,start:e.start,end:e.end}),t):e instanceof He?(e.expression=Y(e.expression),n(e,t)):e instanceof Gt?n(new $e({start:e.start,end:e.end,is_array:!0,names:e.elements.map(e=>Y(e))}),t):e instanceof Vt?n(Y(e.left,e.right),t):e instanceof Ut?(e.left=Y(e.left),e):void c("Invalid function parameter",e.start.line,e.start.col)}var $=function(e,t){if(r("operator","new"))return function(e){var t=i.token;if(p("operator","new"),r("punc","."))return s(),p("name","target"),Ce(new an({start:t,end:u()}),e);var n,o=$(!1);r("punc","(")?(s(),n=Z(")",!0)):n=[];var a=new Rt({start:t,expression:o,args:n,end:u()});return Se(a),Ce(a,e)}(e);if(r("name","import")&&se(a(),"punc","."))return function(e){var t=i.token;return p("name","import"),p("punc","."),p("name","meta"),Ce(new At({start:t,end:u()}),e)}(e);var o,c=i.token,l=r("name","async")&&"["!=(o=a()).value&&"arrow"!=o.type&&q();if(r("punc")){switch(i.token.value){case"(":if(l&&!e)break;var h=function(e,t){var n,o,a,c=[];for(d("(");!r("punc",")");)n&&f(n),r("expand","...")?(n=i.token,t&&(o=i.token),s(),c.push(new He({start:u(),expression:lt(),end:i.token}))):c.push(lt()),r("punc",")")||(d(","),r("punc",")")&&(a=u(),t&&(o=a)));return d(")"),e&&r("arrow","=>")?n&&a&&f(a):o&&f(o),c}(t,!l);if(t&&r("arrow","=>"))return x(c,h.map(e=>Y(e)),!!l);var _=l?new Ct({expression:l,args:h}):it(c,h);if(_.start){const e=c.comments_before.length;if(n.set(c,e),_.start.comments_before.unshift(...c.comments_before),c.comments_before=_.start.comments_before,0==e&&c.comments_before.length>0){var m=c.comments_before[0];m.nlb||(m.nlb=c.nlb,c.nlb=!1)}c.comments_after=_.start.comments_after}_.start=c;var g=u();return _.end&&(g.comments_before=_.end.comments_before,_.end.comments_after.push(...g.comments_after),g.comments_after=_.end.comments_after),_.end=g,_ instanceof Ct&&Se(_),Ce(_,e);case"[":return Ce(Q(),e);case"{":return Ce(ee(),e)}l||f()}if(t&&r("name")&&se(a(),"arrow")){var E=new pn({name:i.token.value,start:c,end:c});return s(),x(c,[E],!!l)}if(r("keyword","function")){s();var v=I(We,!1,!!l);return v.start=c,v.end=u(),Ce(v,e)}if(l)return Ce(l,e);if(r("keyword","class")){s();var b=te(rn);return b.start=c,b.end=u(),Ce(b,e)}return r("template_head")?Ce(j(),e):_e.has(i.token.type)?Ce(q(),e):void f()};function j(){var e=[],t=i.token;for(e.push(new Qe({start:i.token,raw:F.get(i.token),value:i.token.value,end:i.token}));!i.token.template_end;)s(),D(),e.push(lt(!0)),e.push(new Qe({start:i.token,raw:F.get(i.token),value:i.token.value,end:i.token}));return s(),new Ze({start:t,segments:e,end:i.token})}function Z(e,t,n){for(var o=!0,a=[];!r("punc",e)&&(o?o=!1:d(","),!t||!r("punc",e));)r("punc",",")&&n?a.push(new Vn({start:i.token,end:i.token})):r("expand","...")?(s(),a.push(new He({start:u(),expression:lt(),end:i.token}))):a.push(lt(!1));return s(),a}var Q=b(function(){return d("["),new Gt({elements:Z("]",!t.strict,!0)})}),J=b((e,t)=>I(ze,e,t)),ee=b(function(){var e=i.token,n=!0,o=[];for(d("{");!r("punc","}")&&(n?n=!1:d(","),t.strict||!r("punc","}"));){if("expand"==(e=i.token).type){s(),o.push(new He({start:e,expression:lt(!1),end:u()}));continue}r("privatename")&&c("private fields are not allowed in an object");var a,l=ge();if(r("punc",":"))null===l?f(u()):(s(),a=lt(!1));else{var p=ne(l,e);if(p){o.push(p);continue}a=new yn({start:u(),name:l,end:u()})}r("operator","=")&&(s(),a=new Vt({start:e,left:a,operator:"=",right:lt(!1),logical:!1,end:u()}));const t=new Xt({start:e,quote:e.quote,key:l,value:a,end:u()});o.push(Se(t))}return s(),new Kt({properties:o})});function te(e,t){var n,o,a,c,l=[];i.input.push_directives_stack(),i.input.add_directive("use strict"),"name"==i.token.type&&"extends"!=i.token.value&&(a=De(e===tn?gn:En)),e!==tn||a||(t?e=rn:f()),"extends"==i.token.value&&(s(),c=lt(!0)),d("{");const p=i.in_class;for(i.in_class=!0;r("punc",";");)s();for(;!r("punc","}");)for(n=i.token,(o=ne(ge(),n,!0))||f(),l.push(o);r("punc",";");)s();return i.in_class=p,i.input.pop_directives_stack(),s(),new e({start:n,name:a,extends:c,properties:l,end:u()})}function ne(e,t,n){const o=(e,n)=>"string"==typeof e?new n({start:t,name:e,end:u()}):(null===e&&f(),e),a=()=>!(r("punc","(")||r("punc",",")||r("punc","}")||r("punc",";")||r("operator","="));var c=!1,l=!1,p=!1,d=!1,h=null;if(n&&"static"===e&&a()){const t=function(){if(!r("punc","{"))return null;const e=i.token,t=[];s();for(;!r("punc","}");)t.push(S());return s(),new nn({start:e,body:t,end:u()})}();if(null!=t)return t;l=!0,e=ge()}"async"===e&&a()&&(c=!0,e=ge()),"operator"===u().type&&"*"===u().value&&(p=!0,e=ge()),"get"!==e&&"set"!==e||!a()||(h=e,e=ge()),"privatename"===u().type&&(d=!0);const _=u();if(null!=h){if(d){return Se(new("get"===h?Wt:zt)({start:t,static:l,key:o(e,hn),value:J(),end:u()}))}{const n="get"===h?Yt:qt;return e=o(e,hn),Se(new n({start:t,static:l,key:e,quote:e instanceof hn?_.quote:void 0,value:J(),end:u()}))}}if(r("punc","(")){e=o(e,hn);return Se(new(d?jt:$t)({start:t,static:l,key:e,quote:e instanceof hn?_.quote:void 0,value:J(p,c),end:u()}))}if(n){const n=d?Jt:Qt,i=o(e,d?Rn:_n),a=i instanceof _n?_.quote:void 0;if(r("operator","="))return s(),Se(new n({start:t,static:l,quote:a,key:i,value:lt(!1),end:u()}));if(r("name")||r("privatename")||r("punc","[")||r("operator","*")||r("punc",";")||r("punc","}")||r("string")||r("num")||r("big_int"))return Se(new n({start:t,static:l,quote:a,key:i,end:u()}))}}function ie(){return!r("keyword","with")&&!r("name","assert")||h(i.token)?null:(s(),ee())}function re(e){function t(e,t){return new e({name:ge(),quote:t||void 0,start:u(),end:u()})}var n,o,a=e?Dn:Tn,c=e?bn:An,l=i.token;return e?n=t(a,l.quote):o=t(c,l.quote),r("name","as")?(s(),e?o=t(c):n=t(a,i.token.quote)):e?o=new c(n):n=new a(o),new St({start:l,foreign_name:n,name:o,end:u()})}function oe(e,t){var n,r,o=e?Dn:Tn,a=e?bn:An,s=i.token,c=u();return e?n=t:r=t,n=n||new a({start:s,name:"*",end:c}),r=r||new o({start:s,name:"*",end:c}),new St({start:s,foreign_name:r,name:n,end:c})}function ue(e){var t;if(r("punc","{")){for(s(),t=[];!r("punc","}");)t.push(re(e)),r("punc",",")&&s();s()}else if(r("operator","*")){var n;s(),r("name","as")&&(s(),n=e?De(bn):function(e){if(!r("name")){r("string")||c("Name or string expected");var t=i.token,n=new e({start:t,end:t,name:t.value,quote:t.quote});return s(),n}var o=ve(e);return be(o),s(),o}(Tn)),t=[oe(e,n)]}return t}function me(){var e,t,n,o,c,l=i.token;if(r("keyword","default"))e=!0,s();else if(t=ue(!1)){if(r("name","from")){s();var p=i.token;"string"!==p.type&&f(),s();const n=ie();return new Tt({start:l,is_default:e,exported_names:t,module_name:new Mn({start:p,value:p.value,quote:p.quote,end:p}),end:u(),attributes:n})}return new Tt({start:l,is_default:e,exported_names:t,end:u()})}return r("punc","{")||e&&(r("keyword","class")||r("keyword","function"))&&se(a(),"punc")?(o=lt(!1),E()):(n=S(e))instanceof gt&&e?f(n.start):n instanceof gt||n instanceof Ye||n instanceof tn?c=n:n instanceof rn||n instanceof We?o=n:n instanceof Te?o=n.body:f(n.start),new Tt({start:l,is_default:e,exported_value:o,exported_definition:c,end:u(),attributes:null})}function ge(){var e=i.token;switch(e.type){case"punc":if("["===e.value){s();var t=lt(!1);return d("]"),t}f(e);case"operator":if("*"===e.value)return s(),null;["delete","in","instanceof","new","typeof","void"].includes(e.value)||f(e);case"name":case"privatename":case"string":case"keyword":case"atom":return s(),e.value;case"num":case"big_int":return s(),""+e.value;default:f(e)}}function Ee(){var e=i.token;return"name"!=e.type&&"privatename"!=e.type&&f(),s(),e.value}function ve(e){var t=i.token.value;return new("this"==t?On:"super"==t?Fn:e)({name:String(t),start:i.token,end:i.token})}function be(e){var t=e.name;m()&&"yield"==t&&l(e.start,"Yield cannot be used as identifier inside generators"),i.input.has_directive("use strict")&&("yield"==t&&l(e.start,"Unexpected yield identifier inside strict mode"),e instanceof sn&&("arguments"==t||"eval"==t)&&l(e.start,"Unexpected "+t+" in strict mode"))}function De(e,t){if(!r("name"))return t||c("Name expected"),null;var n=ve(e);return be(n),s(),n}function Se(e,t=e.start){var i=t.comments_before;const r=n.get(t);for(var o=null!=r?r:i.length;--o>=0;){var a=i[o];if(/[@#]__/.test(a.value)){if(/[@#]__PURE__/.test(a.value)){C(e,$n);break}if(/[@#]__INLINE__/.test(a.value)){C(e,jn);break}if(/[@#]__NOINLINE__/.test(a.value)){C(e,Zn);break}if(/[@#]__KEY__/.test(a.value)){C(e,Qn);break}if(/[@#]__MANGLE_PROP__/.test(a.value)){C(e,Jn);break}}}return e}var Ce=function(e,t,n){var o=e.start;if(r("punc",".")){s(),r("privatename")&&!i.in_class&&c("Private field must be used in an enclosing class");const a=r("privatename")?Mt:kt;return Se(Ce(new a({start:o,expression:e,optional:!1,property:Ee(),end:u()}),t,n))}if(r("punc","[")){s();var a=lt(!0);return d("]"),Se(Ce(new wt({start:o,expression:e,optional:!1,property:a,end:u()}),t,n))}if(t&&r("punc","(")){s();var l=new Ct({start:o,expression:e,optional:!1,args:Re(),end:u()});return Se(l),Ce(l,!0,n)}if(r("punc","?.")){let n;if(s(),t&&r("punc","(")){s();const t=new Ct({start:o,optional:!0,expression:e,args:Re(),end:u()});Se(t),n=Ce(t,!0,!0)}else if(r("name")||r("privatename")){r("privatename")&&!i.in_class&&c("Private field must be used in an enclosing class");const a=r("privatename")?Mt:kt;n=Se(Ce(new a({start:o,expression:e,optional:!0,property:Ee(),end:u()}),t,!0))}else if(r("punc","[")){s();const i=lt(!0);d("]"),n=Se(Ce(new wt({start:o,expression:e,optional:!0,property:i,end:u()}),t,!0))}return n||f(),n instanceof xt?n:new xt({start:o,expression:n,end:u()})}return r("template_head")?(n&&f(),Ce(new je({start:o,prefix:e,template_string:j(),end:u()}),t)):e};function Re(){for(var e=[];!r("punc",")");)r("expand","...")?(s(),e.push(new He({start:u(),expression:lt(!1),end:u()}))):e.push(lt(!1)),r("punc",")")||d(",");return s(),e}var Oe=function(e,t){var n=i.token;if("name"==n.type&&"await"==n.value&&g())return s(),g()||c("Unexpected await expression outside async function",i.prev.line,i.prev.col,i.prev.pos),new at({start:u(),end:i.token,expression:Oe(!0)});if(r("operator")&&le.has(n.value)){s(),D();var o=Me(Nt,n,Oe(e));return o.start=n,o.end=u(),o}for(var a=$(e,t);r("operator")&&fe.has(i.token.value)&&!h(i.token);)a instanceof qe&&f(),(a=Me(Pt,i.token,a)).start=n,a.end=i.token,s();return a};function Me(e,t,n){var r=t.value;switch(r){case"++":case"--":Xe(n)||c("Invalid use of "+r+" operator",t.line,t.col,t.pos);break;case"delete":n instanceof yn&&i.input.has_directive("use strict")&&c("Calling delete on expression not allowed in strict mode",n.start.line,n.start.col,n.start.pos)}return new e({operator:r,expression:n})}var Ie=function(e,t,n){var o=r("operator")?i.token.value:null;"in"==o&&n&&(o=null),"**"==o&&e instanceof Nt&&!se(e.start,"punc","(")&&"--"!==e.operator&&"++"!==e.operator&&f(e.start);var a=null!=o?he[o]:null;if(null!=a&&(a>t||"**"===o&&t===a)){s();var u=Ge(n,a,!0);return Ie(new Bt({start:e.start,left:e,operator:o,right:u,end:u.end}),t,n)}return e};function Ge(e,t,n,o){if(!e&&t1?new Ot({start:e,expressions:t,end:a()}):void c("Invalid parenthesized expression")},lt=function(e,t){for(var n=i.token,o=[];o.push(et(t)),e&&r("punc",",");)s(),e=!0;return it(n,o)};function It(e){++i.in_loop;var t=e();return--i.in_loop,t}return t.expression?lt(!0):function(){var e=i.token,n=[];for(i.input.push_directives_stack(),t.module&&i.input.add_directive("use strict");!r("eof");)n.push(S());i.input.pop_directives_stack();var o=u(),a=t.toplevel;return a?(a.body=a.body.concat(n),a.end=o):a=new Ke({start:e,body:n,end:o}),F=new Map,a}()}function ge(e,t,n,i,r=De){var o=t=t?t.split(/\s+/):[];r&&r.PROPS&&(t=t.concat(r.PROPS));const a=r&&Object.create(r.prototype);if(a&&(n.prototype=a,n.BASE=r),r&&r.SUBCLASSES.push(n),n.prototype.CTOR=n,n.prototype.constructor=n,n.PROPS=t||null,n.SELF_PROPS=o,n.SUBCLASSES=[],e&&(n.prototype.TYPE=n.TYPE=e),i)for(let e in i)v(i,e)&&("$"===e[0]?n[e.substr(1)]=i[e]:n.prototype[e]=i[e]);return n.DEFMETHOD=function(e,t){this.prototype[e]=t},n}const Ee=(e,t)=>Boolean(e.flags&t),ve=(e,t,n)=>{n?e.flags|=t:e.flags&=~t};class be{constructor(e,t,n,i,r,o,a,s,u){this.flags=o?1:0,this.type=e,this.value=t,this.line=n,this.col=i,this.pos=r,this.comments_before=a,this.comments_after=s,this.file=u,Object.seal(this)}[Symbol.for("nodejs.util.inspect.custom")](e,t){const n=e=>t.stylize(e,"special"),i="string"==typeof this.value&&this.value.includes("`")?"'":"`",r=`${i}${this.value}${i}`;return`${n("[AST_Token")} ${r} at ${this.line}:${this.col}${n("]")}`}get nlb(){return Ee(this,1)}set nlb(e){ve(this,1,e)}get quote(){return Ee(this,4)?Ee(this,2)?"'":'"':""}set quote(e){ve(this,2,"'"===e),ve(this,4,!!e)}get template_end(){return Ee(this,8)}set template_end(e){ve(this,8,e)}}var De=ge("Node","start end",function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{_clone:function(e){if(e){var t=this.clone();return t.transform(new Yn(function(e){if(e!==t)return e.clone(!0)}))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)},_children_backwards:()=>{}},null),Se=ge("Statement",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class of all statements"}),ye=ge("Debugger",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Represents a debugger statement"},Se),Ae=ge("Directive","value quote",function(e){e&&(this.value=e.value,this.quote=e.quote,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},Se),Te=ge("SimpleStatement","body",function(e){e&&(this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,function(){this.body._walk(e)})},_children_backwards(e){e(this.body)}},Se);function Ce(e,t){const n=e.body;for(var i=0,r=n.length;i SymbolDef for all variables/functions defined in this scope",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){for(var e=this;e.is_block_scope();)e=e.parent_scope;return e},clone:function(e,t){var n=this._clone(e);return e&&this.variables&&t&&!this._block_scope?n.figure_out_scope({},{toplevel:t,parent_scope:this.parent_scope}):(this.variables&&(n.variables=new Map(this.variables)),this.enclosed&&(n.enclosed=this.enclosed.slice()),this._block_scope&&(n._block_scope=this._block_scope)),n},pinned:function(){return this.uses_eval||this.uses_with}},Oe),Ke=ge("Toplevel","globals",function(e){e&&(this.globals=e.globals,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The toplevel scope",$propdoc:{globals:"[Map/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body,n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";return n=(n=me(n)).transform(new Yn(function(e){if(e instanceof Ae&&"$ORIG"==e.value)return f.splice(t)}))},wrap_enclose:function(e){"string"!=typeof e&&(e="");var t=e.indexOf(":");t<0&&(t=e.length);var n=this.body;return me(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new Yn(function(e){if(e instanceof Ae&&"$ORIG"==e.value)return f.splice(n)}))}},Ge),He=ge("Expansion","expression",function(e){e&&(this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){return e._visit(this,function(){this.expression.walk(e)})},_children_backwards(e){e(this.expression)}}),Xe=ge("Lambda","name argnames uses_arguments is_generator async",function(e){e&&(this.name=e.name,this.argnames=e.argnames,this.uses_arguments=e.uses_arguments,this.is_generator=e.is_generator,this.async=e.async,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){for(var e=[],t=0;t b)"},Xe),Ye=ge("Defun",null,function(e){e&&(this.name=e.name,this.argnames=e.argnames,this.uses_arguments=e.uses_arguments,this.is_generator=e.is_generator,this.async=e.async,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A function definition"},Xe),$e=ge("Destructuring","names is_array",function(e){e&&(this.names=e.names,this.is_array=e.is_array,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,function(){this.names.forEach(function(t){t._walk(e)})})},_children_backwards(e){let t=this.names.length;for(;t--;)e(this.names[t])},all_symbols:function(){var e=[];return Xn(this,t=>{if(t instanceof sn&&e.push(t),t instanceof Xe)return!0}),e}}),je=ge("PrefixedTemplateString","template_string prefix",function(e){e&&(this.template_string=e.template_string,this.prefix=e.prefix,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_Node] The prefix, which will get called."},_walk:function(e){return e._visit(this,function(){this.prefix._walk(e),this.template_string._walk(e)})},_children_backwards(e){e(this.template_string),e(this.prefix)}}),Ze=ge("TemplateString","segments",function(e){e&&(this.segments=e.segments,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,function(){this.segments.forEach(function(t){t._walk(e)})})},_children_backwards(e){let t=this.segments.length;for(;t--;)e(this.segments[t])}}),Qe=ge("TemplateSegment","value raw",function(e){e&&(this.value=e.value,this.raw=e.raw,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw source of the segment"}}),Je=ge("Jump",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"},Se),et=ge("Exit","value",function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for “exits” (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e)})},_children_backwards(e){this.value&&e(this.value)}},Je),tt=ge("Return",null,function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `return` statement"},et),nt=ge("Throw",null,function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `throw` statement"},et),it=ge("LoopControl","label",function(e){e&&(this.label=e.label,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e)})},_children_backwards(e){this.label&&e(this.label)}},Je),rt=ge("Break",null,function(e){e&&(this.label=e.label,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `break` statement"},it),ot=ge("Continue",null,function(e){e&&(this.label=e.label,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `continue` statement"},it),at=ge("Await","expression",function(e){e&&(this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"An `await` statement",$propdoc:{expression:"[AST_Node] the mandatory expression being awaited"},_walk:function(e){return e._visit(this,function(){this.expression._walk(e)})},_children_backwards(e){e(this.expression)}}),st=ge("Yield","expression is_star",function(e){e&&(this.expression=e.expression,this.is_star=e.is_star,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `yield` statement",$propdoc:{expression:"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false",is_star:"[Boolean] Whether this is a yield or yield* statement"},_walk:function(e){return e._visit(this,this.expression&&function(){this.expression._walk(e)})},_children_backwards(e){this.expression&&e(this.expression)}}),ut=ge("If","condition alternative",function(e){e&&(this.condition=e.condition,this.alternative=e.alternative,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,function(){this.condition._walk(e),this.body._walk(e),this.alternative&&this.alternative._walk(e)})},_children_backwards(e){this.alternative&&e(this.alternative),e(this.body),e(this.condition)}},Me),ct=ge("Switch","expression",function(e){e&&(this.expression=e.expression,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` “discriminant”"},_walk:function(e){return e._visit(this,function(){this.expression._walk(e),Ce(this,e)})},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression)}},Oe),lt=ge("SwitchBranch",null,function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for `switch` branches"},Oe),ft=ge("Default",null,function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `default` switch branch"},lt),pt=ge("Case","expression",function(e){e&&(this.expression=e.expression,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,function(){this.expression._walk(e),Ce(this,e)})},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression)}},lt),dt=ge("Try","body bcatch bfinally",function(e){e&&(this.body=e.body,this.bcatch=e.bcatch,this.bfinally=e.bfinally,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `try` statement",$propdoc:{body:"[AST_TryBlock] the try block",bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,function(){this.body._walk(e),this.bcatch&&this.bcatch._walk(e),this.bfinally&&this.bfinally._walk(e)})},_children_backwards(e){this.bfinally&&e(this.bfinally),this.bcatch&&e(this.bcatch),e(this.body)}},Se),ht=ge("TryBlock",null,function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `try` block of a try statement"},Oe),_t=ge("Catch","argname",function(e){e&&(this.argname=e.argname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,function(){this.argname&&this.argname._walk(e),Ce(this,e)})},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);this.argname&&e(this.argname)}},Oe),mt=ge("Finally",null,function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},Oe),gt=ge("Definitions","definitions",function(e){e&&(this.definitions=e.definitions,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,function(){for(var t=this.definitions,n=0,i=t.length;n a`"},Bt),Gt=ge("Array","elements",function(e){e&&(this.elements=e.elements,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,function(){for(var t=this.elements,n=0,i=t.length;n!1},Ht),Wt=ge("PrivateGetter","static",function(e){e&&(this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$propdoc:{static:"[boolean] whether this is a static private getter"},$documentation:"A private getter property",computed_key:()=>!1},Ht),qt=ge("ObjectSetter","quote static",function(e){e&&(this.quote=e.quote,this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end,this._annotations=e._annotations),this.flags=0},{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static setter (classes only)"},$documentation:"An object setter property",computed_key(){return!(this.key instanceof hn)}},Ht),Yt=ge("ObjectGetter","quote static",function(e){e&&(this.quote=e.quote,this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end,this._annotations=e._annotations),this.flags=0},{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static getter (classes only)"},$documentation:"An object getter property",computed_key(){return!(this.key instanceof hn)}},Ht),$t=ge("ConciseMethod","quote static",function(e){e&&(this.quote=e.quote,this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end,this._annotations=e._annotations),this.flags=0},{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] is this method static (classes only)"},$documentation:"An ES6 concise method inside an object or class",computed_key(){return!(this.key instanceof hn)}},Ht),jt=ge("PrivateMethod","static",function(e){e&&(this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A private class method inside a class",$propdoc:{static:"[boolean] is this a static private method"},computed_key:()=>!1},Ht),Zt=ge("Class","name extends properties",function(e){e&&(this.name=e.name,this.extends=e.extends,this.properties=e.properties,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$propdoc:{name:"[AST_SymbolClass|AST_SymbolDefClass?] optional class name.",extends:"[AST_Node]? optional parent class",properties:"[AST_ObjectProperty|AST_ClassStaticBlock]* array of properties or static blocks"},$documentation:"An ES6 class",_walk:function(e){return e._visit(this,function(){this.name&&this.name._walk(e),this.extends&&this.extends._walk(e),this.properties.forEach(t=>t._walk(e))})},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);this.extends&&e(this.extends),this.name&&e(this.name)},visit_nondeferred_class_parts(e){this.extends&&this.extends._walk(e),this.properties.forEach(t=>{t instanceof nn?t._walk(e):(t.computed_key()&&(e.push(t),t.key._walk(e),e.pop()),(t instanceof Jt&&t.static&&t.value||t instanceof Qt&&t.static&&t.value)&&(e.push(t),t.value._walk(e),e.pop()))})},visit_deferred_class_parts(e){this.properties.forEach(t=>{t instanceof $t||t instanceof jt?t.walk(e):(t instanceof Qt&&!t.static&&t.value||t instanceof Jt&&!t.static&&t.value)&&(e.push(t),t.value._walk(e),e.pop())})},is_self_referential:function(){const e=this.name&&this.name.definition().id;let t=!1,n=!0;return this.visit_nondeferred_class_parts(new qn((i,r)=>{if(t)return!0;if(i instanceof On)return t=n;if(i instanceof yn)return t=i.definition().id===e;if(i instanceof Xe&&!(i instanceof qe)){const e=n;return n=!1,r(),n=e,!0}})),t}},Ge),Qt=ge("ClassProperty","static quote",function(e){e&&(this.static=e.static,this.quote=e.quote,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end,this._annotations=e._annotations),this.flags=0},{$documentation:"A class property",$propdoc:{static:"[boolean] whether this is a static key",quote:"[string] which quote is being used"},_walk:function(e){return e._visit(this,function(){this.key instanceof De&&this.key._walk(e),this.value instanceof De&&this.value._walk(e)})},_children_backwards(e){this.value instanceof De&&e(this.value),this.key instanceof De&&e(this.key)},computed_key(){return!(this.key instanceof _n)}},Ht),Jt=ge("ClassPrivateProperty","",function(e){e&&(this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A class property for a private property",_walk:function(e){return e._visit(this,function(){this.value instanceof De&&this.value._walk(e)})},_children_backwards(e){this.value instanceof De&&e(this.value)},computed_key:()=>!1},Ht),en=ge("PrivateIn","key value",function(e){e&&(this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"An `in` binop when the key is private, eg #x in this",_walk:function(e){return e._visit(this,function(){this.key._walk(e),this.value._walk(e)})},_children_backwards(e){e(this.value),e(this.key)}}),tn=ge("DefClass",null,function(e){e&&(this.name=e.name,this.extends=e.extends,this.properties=e.properties,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A class definition"},Zt),nn=ge("ClassStaticBlock","body block_scope",function(e){this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end},{$documentation:"A block containing statements to be executed in the context of the class",$propdoc:{body:"[AST_Statement*] an array of statements"},_walk:function(e){return e._visit(this,function(){Ce(this,e)})},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t])},clone:Re,computed_key:()=>!1},Ge),rn=ge("ClassExpression",null,function(e){e&&(this.name=e.name,this.extends=e.extends,this.properties=e.properties,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A class expression."},Zt),on=ge("Symbol","scope name thedef",function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$propdoc:{name:"[string] name of this symbol",scope:"[AST_Scope/S] the current scope (not necessarily the definition scope)",thedef:"[SymbolDef/S] the definition of this symbol"},$documentation:"Base class for all symbols"}),an=ge("NewTarget",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A reference to new.target"}),sn=ge("SymbolDeclaration","init",function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)"},on),un=ge("SymbolVar",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol defining a variable"},sn),cn=ge("SymbolBlockDeclaration",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for block-scoped declaration symbols"},sn),ln=ge("SymbolConst",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A constant declaration"},cn),fn=ge("SymbolLet",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A block-scoped `let` declaration"},cn),pn=ge("SymbolFunarg",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol naming a function argument"},un),dn=ge("SymbolDefun",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol defining a function"},sn),hn=ge("SymbolMethod",null,function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol in an object defining a method"},on),_n=ge("SymbolClassProperty",null,function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol for a class property"},on),mn=ge("SymbolLambda",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol naming a function expression"},sn),gn=ge("SymbolDefClass",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class."},cn),En=ge("SymbolClass",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol naming a class's name. Lexically scoped to the class."},sn),vn=ge("SymbolCatch",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol naming the exception in catch"},cn),bn=ge("SymbolImport",null,function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol referring to an imported name"},cn),Dn=ge("SymbolImportForeign","quote",function(e){e&&(this.quote=e.quote,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes"},on),Sn=ge("Label","references",function(e){e&&(this.references=e.references,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end,this.initialize()),this.flags=0},{$documentation:"Symbol naming a label (declaration)",$propdoc:{references:"[AST_LoopControl*] a list of nodes referring to this label"},initialize:function(){this.references=[],this.thedef=this}},on),yn=ge("SymbolRef",null,function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Reference to some symbol (not definition/declaration)"},on),An=ge("SymbolExport","quote",function(e){e&&(this.quote=e.quote,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Symbol referring to a name to export"},yn),Tn=ge("SymbolExportForeign","quote",function(e){e&&(this.quote=e.quote,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes"},on),Cn=ge("LabelRef",null,function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Reference to a label symbol"},on),Rn=ge("SymbolPrivateProperty",null,function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A symbol that refers to a private property"},on),On=ge("This",null,function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `this` symbol"},on),Fn=ge("Super",null,function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `super` symbol"},On),kn=ge("Constant",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for all constants",getValue:function(){return this.value}}),Mn=ge("String","value quote",function(e){e&&(this.value=e.value,this.quote=e.quote,this.start=e.start,this.end=e.end,this._annotations=e._annotations),this.flags=0},{$documentation:"A string literal",$propdoc:{value:"[string] the contents of this string",quote:"[string] the original quote character"}},kn),wn=ge("Number","value raw",function(e){e&&(this.value=e.value,this.raw=e.raw,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A number literal",$propdoc:{value:"[number] the numeric value",raw:"[string] numeric value as string"}},kn),xn=ge("BigInt","value raw",function(e){e&&(this.value=e.value,this.raw=e.raw,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A big int literal",$propdoc:{value:"[string] big int value, represented as a string",raw:"[string] the original format preserved"}},kn),In=ge("RegExp","value",function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A regexp literal",$propdoc:{value:"[RegExp] the actual regexp"}},kn),Nn=ge("Atom",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for atoms"},kn),Pn=ge("Null",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `null` atom",value:null},Nn),Bn=ge("NaN",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The impossible value",value:NaN},Nn),Ln=ge("Undefined",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `undefined` value",value:void 0},Nn),Vn=ge("Hole",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"A hole in an array",value:void 0},Nn),Un=ge("Infinity",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `Infinity` value",value:1/0},Nn),Gn=ge("Boolean",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"Base class for booleans"},Nn),Kn=ge("False",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `false` atom",value:!1},Gn),Hn=ge("True",null,function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0},{$documentation:"The `true` atom",value:!0},Gn);function Xn(e,t,n=[e]){const i=n.push.bind(n);for(;n.length;){const e=n.pop(),r=t(e,n);if(r){if(r===Wn)return!0}else e._children_backwards(i)}return!1}function zn(e,t,n){const i=[e],r=i.push.bind(i),o=n?n.slice():[],a=[];let s;const u={parent:(e=0)=>-1===e?s:n&&e>=o.length?(e-=o.length,n[n.length-(e+1)]):o[o.length-(1+e)]};for(;i.length;){for(s=i.pop();a.length&&i.length==a[a.length-1];)o.pop(),a.pop();const e=t(s,u);if(e){if(e===Wn)return!0;continue}const n=i.length;s._children_backwards(r),i.length>n&&(o.push(s),a.push(n-1))}return!1}const Wn=Symbol("abort walk");class qn{constructor(e){this.visit=e,this.stack=[],this.directives=Object.create(null)}_visit(e,t){this.push(e);var n=this.visit(e,t?function(){t.call(e)}:a);return!n&&t&&t.call(e),this.pop(),n}parent(e){return this.stack[this.stack.length-2-(e||0)]}push(e){e instanceof Xe?this.directives=Object.create(this.directives):e instanceof Ae&&!this.directives[e.value]?this.directives[e.value]=e:e instanceof Zt&&(this.directives=Object.create(this.directives),this.directives["use strict"]||(this.directives["use strict"]=e)),this.stack.push(e)}pop(){var e=this.stack.pop();(e instanceof Xe||e instanceof Zt)&&(this.directives=Object.getPrototypeOf(this.directives))}self(){return this.stack[this.stack.length-1]}find_parent(e){for(var t=this.stack,n=t.length;--n>=0;){var i=t[n];if(i instanceof e)return i}}is_within_loop(){let e=this.stack.length-1,t=this.stack[e];for(;e--;){const n=this.stack[e];if(n instanceof Xe)return!1;if(n instanceof xe&&!(n instanceof Be&&t===n.init)&&(!(n instanceof Le||n instanceof Ve)||t!==n.object))return!0;t=n}return!1}find_scope(){for(var e=this.stack,t=e.length;--t>=0;){const n=e[t];if(n instanceof Ke)return n;if(n instanceof Xe)return n;if(n.block_scope)return n.block_scope}}has_directive(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof Ge&&n.body)for(var i=0;i=0;){if((i=t[n])instanceof we&&i.label.name==e.label.name)return i.body}else for(n=t.length;--n>=0;){var i;if((i=t[n])instanceof xe||e instanceof rt&&i instanceof ct)return i}}}class Yn extends qn{constructor(e,t){super(),this.before=e,this.after=t}}const $n=1,jn=2,Zn=4,Qn=8,Jn=16;function ei(e,t){e.DEFMETHOD("transform",function(e,n){let i;if(e.push(this),e.before&&(i=e.before(this,t,n)),void 0===i&&(i=this,t(i,e),e.after)){const t=e.after(i,n);void 0!==t&&(i=t)}return e.pop(),i})}function ti(e){let t=e.parent(-1);for(let n,i=0;n=e.parent(i);i++){if(n instanceof Se&&n.body===t)return!0;if(!(n instanceof Ot&&n.expressions[0]===t||"Call"===n.TYPE&&n.expression===t||n instanceof je&&n.prefix===t||n instanceof kt&&n.expression===t||n instanceof wt&&n.expression===t||n instanceof xt&&n.expression===t||n instanceof Lt&&n.condition===t||n instanceof Bt&&n.left===t||n instanceof Pt&&n.expression===t))return!1;t=n}}function ni(e){return e instanceof Kt||(e instanceof Ot?ni(e.expressions[0]):"Call"===e.TYPE?ni(e.expression):e instanceof je?ni(e.prefix):e instanceof kt||e instanceof wt||e instanceof xt?ni(e.expression):e instanceof Lt?ni(e.condition):e instanceof Bt?ni(e.left):e instanceof Pt&&ni(e.expression))}ei(De,a),ei(we,function(e,t){e.label=e.label.transform(t),e.body=e.body.transform(t)}),ei(Te,function(e,t){e.body=e.body.transform(t)}),ei(Oe,function(e,t){e.body=f(e.body,t)}),ei(Ne,function(e,t){e.body=e.body.transform(t),e.condition=e.condition.transform(t)}),ei(Pe,function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t)}),ei(Be,function(e,t){e.init&&(e.init=e.init.transform(t)),e.condition&&(e.condition=e.condition.transform(t)),e.step&&(e.step=e.step.transform(t)),e.body=e.body.transform(t)}),ei(Le,function(e,t){e.init=e.init.transform(t),e.object=e.object.transform(t),e.body=e.body.transform(t)}),ei(Ue,function(e,t){e.expression=e.expression.transform(t),e.body=e.body.transform(t)}),ei(et,function(e,t){e.value&&(e.value=e.value.transform(t))}),ei(it,function(e,t){e.label&&(e.label=e.label.transform(t))}),ei(ut,function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t),e.alternative&&(e.alternative=e.alternative.transform(t))}),ei(ct,function(e,t){e.expression=e.expression.transform(t),e.body=f(e.body,t)}),ei(pt,function(e,t){e.expression=e.expression.transform(t),e.body=f(e.body,t)}),ei(dt,function(e,t){e.body=e.body.transform(t),e.bcatch&&(e.bcatch=e.bcatch.transform(t)),e.bfinally&&(e.bfinally=e.bfinally.transform(t))}),ei(_t,function(e,t){e.argname&&(e.argname=e.argname.transform(t)),e.body=f(e.body,t)}),ei(gt,function(e,t){e.definitions=f(e.definitions,t)}),ei(Dt,function(e,t){e.name=e.name.transform(t),e.value&&(e.value=e.value.transform(t))}),ei($e,function(e,t){e.names=f(e.names,t)}),ei(Xe,function(e,t){e.name&&(e.name=e.name.transform(t)),e.argnames=f(e.argnames,t,!1),e.body instanceof De?e.body=e.body.transform(t):e.body=f(e.body,t)}),ei(Ct,function(e,t){e.expression=e.expression.transform(t),e.args=f(e.args,t,!1)}),ei(Ot,function(e,t){const n=f(e.expressions,t);e.expressions=n.length?n:[new wn({value:0})]}),ei(Ft,function(e,t){e.expression=e.expression.transform(t)}),ei(wt,function(e,t){e.expression=e.expression.transform(t),e.property=e.property.transform(t)}),ei(xt,function(e,t){e.expression=e.expression.transform(t)}),ei(st,function(e,t){e.expression&&(e.expression=e.expression.transform(t))}),ei(at,function(e,t){e.expression=e.expression.transform(t)}),ei(It,function(e,t){e.expression=e.expression.transform(t)}),ei(Bt,function(e,t){e.left=e.left.transform(t),e.right=e.right.transform(t)}),ei(en,function(e,t){e.key=e.key.transform(t),e.value=e.value.transform(t)}),ei(Lt,function(e,t){e.condition=e.condition.transform(t),e.consequent=e.consequent.transform(t),e.alternative=e.alternative.transform(t)}),ei(Gt,function(e,t){e.elements=f(e.elements,t)}),ei(Kt,function(e,t){e.properties=f(e.properties,t)}),ei(Ht,function(e,t){e.key instanceof De&&(e.key=e.key.transform(t)),e.value&&(e.value=e.value.transform(t))}),ei(Zt,function(e,t){e.name&&(e.name=e.name.transform(t)),e.extends&&(e.extends=e.extends.transform(t)),e.properties=f(e.properties,t)}),ei(nn,function(e,t){e.body=f(e.body,t)}),ei(He,function(e,t){e.expression=e.expression.transform(t)}),ei(St,function(e,t){e.foreign_name=e.foreign_name.transform(t),e.name=e.name.transform(t)}),ei(yt,function(e,t){e.imported_name&&(e.imported_name=e.imported_name.transform(t)),e.imported_names&&f(e.imported_names,t),e.module_name=e.module_name.transform(t)}),ei(Tt,function(e,t){e.exported_definition&&(e.exported_definition=e.exported_definition.transform(t)),e.exported_value&&(e.exported_value=e.exported_value.transform(t)),e.exported_names&&f(e.exported_names,t),e.module_name&&(e.module_name=e.module_name.transform(t))}),ei(Ze,function(e,t){e.segments=f(e.segments,t)}),ei(je,function(e,t){e.prefix=e.prefix.transform(t),e.template_string=e.template_string.transform(t)}),function(){var e=function(e){for(var t=0;t0?new Kt({start:r(e),end:o(e),properties:e.map(e=>new Xt({start:r(e),end:o(e),key:e.key.name||e.key.value,value:s(e.value)}))}):null}var n={Program:function(t){return new Ke({start:r(t),end:o(t),body:e(t.body.map(s))})},ArrayPattern:function(e){return new $e({start:r(e),end:o(e),names:e.elements.map(function(e){return null===e?new Vn:s(e)}),is_array:!0})},ObjectPattern:function(e){return new $e({start:r(e),end:o(e),names:e.properties.map(s),is_array:!1})},AssignmentPattern:function(e){return new Ut({start:r(e),end:o(e),left:s(e.left),operator:"=",right:s(e.right)})},SpreadElement:function(e){return new He({start:r(e),end:o(e),expression:s(e.argument)})},RestElement:function(e){return new He({start:r(e),end:o(e),expression:s(e.argument)})},TemplateElement:function(e){return new Qe({start:r(e),end:o(e),value:e.value.cooked,raw:e.value.raw})},TemplateLiteral:function(e){for(var t=[],n=0;nf(e,pn)),is_generator:t.generator,async:t.async,body:e(s(t.body).body)})},FunctionExpression:function(e){return l(e,!1)},ArrowFunctionExpression:function(e){const t="BlockStatement"===e.body.type?s(e.body).body:[p(tt,{},{value:s(e.body)})];return new qe({start:r(e),end:o(e),argnames:e.params.map(e=>f(e,pn)),body:t,async:e.async})},ExpressionStatement:function(e){return new Te({start:r(e),end:o(e),body:s(e.expression)})},TryStatement:function(e){var t=e.handlers||[e.handler];if(t.length>1||e.guardedHandlers&&e.guardedHandlers.length)throw new Error("Multiple catch clauses are not supported.");return new dt({start:r(e),end:o(e),body:new ht(s(e.block)),bcatch:s(t[0]),bfinally:e.finalizer?new mt(s(e.finalizer)):null})},Property:function(e){if("init"==e.kind&&!e.method){var t={start:r(e.key||e.value),end:o(e.value),key:e.computed?s(e.key):e.key.name||String(e.key.value),quote:u(e.key,e.computed),static:!1,value:s(e.value)};return new Xt(t)}var n=l(e.value,!0);t={start:r(e.key||e.value),end:o(e.value),key:e.computed?s(e.key):c(hn,e.key),quote:u(e.key,e.computed),static:!1,value:n};return"get"==e.kind?new Yt(t):"set"==e.kind?new qt(t):e.method?new $t(t):void 0},MethodDefinition:function(e){const t="PrivateIdentifier"===e.key.type,n=e.computed?s(e.key):new hn({name:e.key.name||String(e.key.value)});var i={start:r(e),end:o(e),key:n,quote:u(e.key,e.computed),value:l(e.value,!0),static:e.static};return"get"==e.kind?new(t?Wt:Yt)(i):"set"==e.kind?new(t?zt:qt)(i):new(t?jt:$t)(i)},FieldDefinition:function(e){let t;if(e.computed)t=s(e.key);else{if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in FieldDefinition");t=s(e.key)}return new Qt({start:r(e),end:o(e),quote:u(e.key,e.computed),key:t,value:s(e.value),static:e.static})},PropertyDefinition:function(e){let t;if(e.computed)t=s(e.key);else{if("PrivateIdentifier"===e.key.type)return new Jt({start:r(e),end:o(e),key:s(e.key),value:s(e.value),static:e.static});t=c(_n,e.key)}return new Qt({start:r(e),end:o(e),quote:u(e.key,e.computed),key:t,value:s(e.value),static:e.static})},PrivateIdentifier:function(e){return new Rn({start:r(e),end:o(e),name:e.name})},StaticBlock:function(e){return new nn({start:r(e),end:o(e),body:e.body.map(s)})},ArrayExpression:function(e){return new Gt({start:r(e),end:o(e),elements:e.elements.map(function(e){return null===e?new Vn:s(e)})})},ObjectExpression:function(e){return new Kt({start:r(e),end:o(e),properties:e.properties.map(function(e){return"SpreadElement"===e.type||(e.type="Property"),s(e)})})},SequenceExpression:function(e){return new Ot({start:r(e),end:o(e),expressions:e.expressions.map(s)})},MemberExpression:function(e){return"PrivateIdentifier"===e.property.type?new Mt({start:r(e),end:o(e),property:e.property.name,expression:s(e.object),optional:e.optional||!1}):new(e.computed?wt:kt)({start:r(e),end:o(e),property:e.computed?s(e.property):e.property.name,expression:s(e.object),optional:e.optional||!1})},ChainExpression:function(e){return new xt({start:r(e),end:o(e),expression:s(e.expression)})},SwitchCase:function(e){return new(e.test?pt:ft)({start:r(e),end:o(e),expression:s(e.test),body:e.consequent.map(s)})},VariableDeclaration:function(e){let t,n;"const"===e.kind?(t=bt,n=ln):"let"===e.kind?(t=vt,n=fn):(t=Et,n=un);const i=e.declarations.map(e=>new Dt({start:r(e),end:o(e),name:f(e.id,n),value:s(e.init)}));return new t({start:r(e),end:o(e),definitions:i})},ImportDeclaration:function(e){var n=null,i=null;return e.specifiers.forEach(function(e){"ImportSpecifier"===e.type||"ImportNamespaceSpecifier"===e.type?(i||(i=[]),i.push(s(e))):"ImportDefaultSpecifier"===e.type&&(n=s(e))}),new yt({start:r(e),end:o(e),imported_name:n,imported_names:i,module_name:s(e.source),attributes:t(e.attributes||e.assertions)})},ImportSpecifier:function(e){return new St({start:r(e),end:o(e),foreign_name:c(Dn,e.imported,"Literal"===e.imported.type),name:c(bn,e.local)})},ImportDefaultSpecifier:function(e){return c(bn,e.local)},ImportNamespaceSpecifier:function(e){return new St({start:r(e),end:o(e),foreign_name:new Dn({name:"*"}),name:c(bn,e.local)})},ImportExpression:function(e){const t=[s(e.source)];return e.options&&t.push(s(e.options)),new Ct({start:r(e),end:o(e),expression:s({type:"Identifier",name:"import"}),optional:!1,args:t})},ExportAllDeclaration:function(e){var n=null==e.exported?new Tn({name:"*"}):c(Tn,e.exported,"Literal"===e.exported.type);return new Tt({start:r(e),end:o(e),exported_names:[new St({start:r(e),end:o(e),name:new An({name:"*"}),foreign_name:n})],module_name:s(e.source),attributes:t(e.attributes||e.assertions)})},ExportNamedDeclaration:function(e){return e.declaration?new Tt({start:r(e),end:o(e),exported_definition:s(e.declaration),exported_names:null,module_name:null,attributes:null}):new Tt({start:r(e),end:o(e),exported_definition:null,exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map(s):[],module_name:s(e.source),attributes:t(e.attributes||e.assertions)})},ExportDefaultDeclaration:function(e){return new Tt({start:r(e),end:o(e),exported_value:s(e.declaration),is_default:!0})},ExportSpecifier:function(e){return new St({start:r(e),end:o(e),foreign_name:c(Tn,e.exported,"Literal"===e.exported.type),name:c(An,e.local,"Literal"===e.local.type)})},Literal:function(e){var t=e.value,n={start:r(e),end:o(e)},i=e.regex;if(i&&i.pattern)return n.value={source:i.pattern,flags:i.flags},new In(n);if(i){const i=e.raw||t,r=i.match(/^\/(.*)\/(\w*)$/);if(!r)throw new Error("Invalid regex source "+i);const[o,a,s]=r;return n.value={source:a,flags:s},new In(n)}const a="bigint"==typeof e.value?e.value.toString():e.bigint;if("string"==typeof a)return n.value=a,n.raw=e.raw,new xn(n);if(null===t)return new Pn(n);switch(typeof t){case"string":return n.quote='"',n.value=t,new Mn(n);case"number":return n.value=t,n.raw=e.raw||t.toString(),new wn(n);case"boolean":return new(t?Hn:Kn)(n)}},MetaProperty:function(e){return"new"===e.meta.name&&"target"===e.property.name?new an({start:r(e),end:o(e)}):"import"===e.meta.name&&"meta"===e.property.name?new At({start:r(e),end:o(e)}):void 0},Identifier:function(e){return new yn({start:r(e),end:o(e),name:e.name})},EmptyStatement:function(e){return new ke({start:r(e),end:o(e)})},BlockStatement:function(e){return new Fe({start:r(e),end:o(e),body:e.body.map(s)})},IfStatement:function(e){return new ut({start:r(e),end:o(e),condition:s(e.test),body:s(e.consequent),alternative:s(e.alternate)})},LabeledStatement:function(e){try{const t=c(Sn,e.label);a.push(t);return new we({start:r(e),end:o(e),label:t,body:s(e.body)})}finally{a.pop()}},BreakStatement:function(e){return new rt({start:r(e),end:o(e),label:d(e.label)})},ContinueStatement:function(e){return new ot({start:r(e),end:o(e),label:d(e.label)})},WithStatement:function(e){return new Ue({start:r(e),end:o(e),expression:s(e.object),body:s(e.body)})},SwitchStatement:function(e){return new ct({start:r(e),end:o(e),expression:s(e.discriminant),body:e.cases.map(s)})},ReturnStatement:function(e){return new tt({start:r(e),end:o(e),value:s(e.argument)})},ThrowStatement:function(e){return new nt({start:r(e),end:o(e),value:s(e.argument)})},WhileStatement:function(e){return new Pe({start:r(e),end:o(e),condition:s(e.test),body:s(e.body)})},DoWhileStatement:function(e){return new Ne({start:r(e),end:o(e),condition:s(e.test),body:s(e.body)})},ForStatement:function(e){return new Be({start:r(e),end:o(e),init:s(e.init),condition:s(e.test),step:s(e.update),body:s(e.body)})},ForInStatement:function(e){return new Le({start:r(e),end:o(e),init:s(e.left),object:s(e.right),body:s(e.body)})},ForOfStatement:function(e){return new Ve({start:r(e),end:o(e),init:s(e.left),object:s(e.right),body:s(e.body),await:e.await})},AwaitExpression:function(e){return new at({start:r(e),end:o(e),expression:s(e.argument)})},YieldExpression:function(e){return new st({start:r(e),end:o(e),expression:s(e.argument),is_star:e.delegate})},DebuggerStatement:function(e){return new ye({start:r(e),end:o(e)})},CatchClause:function(e){return new _t({start:r(e),end:o(e),argname:e.param?f(e.param,vn):null,body:s(e.body).body})},ThisExpression:function(e){return new On({start:r(e),name:"this",end:o(e)})},Super:function(e){return new Fn({start:r(e),end:o(e),name:"super"})},BinaryExpression:function(e){return"PrivateIdentifier"===e.left.type?new en({start:r(e),end:o(e),key:new Rn({start:r(e.left),end:o(e.left),name:e.left.name}),value:s(e.right)}):new Bt({start:r(e),end:o(e),operator:e.operator,left:s(e.left),right:s(e.right)})},LogicalExpression:function(e){return new Bt({start:r(e),end:o(e),operator:e.operator,left:s(e.left),right:s(e.right)})},AssignmentExpression:function(e){return new Vt({start:r(e),end:o(e),operator:e.operator,logical:"??="===e.operator||"&&="===e.operator||"||="===e.operator,left:s(e.left),right:s(e.right)})},ConditionalExpression:function(e){return new Lt({start:r(e),end:o(e),condition:s(e.test),consequent:s(e.consequent),alternative:s(e.alternate)})},NewExpression:function(e){return new Rt({start:r(e),end:o(e),expression:s(e.callee),args:e.arguments.map(s)})},CallExpression:function(e){return new Ct({start:r(e),end:o(e),expression:s(e.callee),optional:e.optional,args:e.arguments.map(s)})}};function i(e){const t=[];if(e)for(const{key:n,value:i}of e.properties){const e=ne(n)?{type:"Identifier",name:n}:{type:"Literal",value:n,raw:JSON.stringify(n)};t.push({type:"ImportAttribute",key:e,value:m(i)})}return t}function r(e){var t=e.loc,n=t&&t.start,i=e.range;return new be("","",n&&n.line||0,n&&n.column||0,i?i[0]:e.start,!1,[],[],t&&t.source)}function o(e){var t=e.loc,n=t&&t.end,i=e.range;return new be("","",n&&n.line||0,n&&n.column||0,i?i[0]:e.end,!1,[],[],t&&t.source)}n.UpdateExpression=n.UnaryExpression=function(e){return new(("prefix"in e?e.prefix:"UnaryExpression"==e.type)?Nt:Pt)({start:r(e),end:o(e),operator:e.operator,expression:s(e.argument)})},n.ClassDeclaration=n.ClassExpression=function(e){return new("ClassDeclaration"===e.type?tn:rn)({start:r(e),end:o(e),name:e.id&&c("ClassDeclaration"===e.type?gn:En,e.id),extends:s(e.superClass),properties:e.body.body.map(s)})},h(ke,function(){return{type:"EmptyStatement"}}),h(Fe,function(e){return{type:"BlockStatement",body:e.body.map(m)}}),h(ut,function(e){return{type:"IfStatement",test:m(e.condition),consequent:m(e.body),alternate:m(e.alternative)}}),h(we,function(e){return{type:"LabeledStatement",label:m(e.label),body:m(e.body)}}),h(rt,function(e){return{type:"BreakStatement",label:m(e.label)}}),h(ot,function(e){return{type:"ContinueStatement",label:m(e.label)}}),h(Ue,function(e){return{type:"WithStatement",object:m(e.expression),body:m(e.body)}}),h(ct,function(e){return{type:"SwitchStatement",discriminant:m(e.expression),cases:e.body.map(m)}}),h(tt,function(e){return{type:"ReturnStatement",argument:m(e.value)}}),h(nt,function(e){return{type:"ThrowStatement",argument:m(e.value)}}),h(Pe,function(e){return{type:"WhileStatement",test:m(e.condition),body:m(e.body)}}),h(Ne,function(e){return{type:"DoWhileStatement",test:m(e.condition),body:m(e.body)}}),h(Be,function(e){return{type:"ForStatement",init:m(e.init),test:m(e.condition),update:m(e.step),body:m(e.body)}}),h(Le,function(e){return{type:"ForInStatement",left:m(e.init),right:m(e.object),body:m(e.body)}}),h(Ve,function(e){return{type:"ForOfStatement",left:m(e.init),right:m(e.object),body:m(e.body),await:e.await}}),h(at,function(e){return{type:"AwaitExpression",argument:m(e.expression)}}),h(st,function(e){return{type:"YieldExpression",argument:m(e.expression),delegate:e.is_star}}),h(ye,function(){return{type:"DebuggerStatement"}}),h(Dt,function(e){return{type:"VariableDeclarator",id:m(e.name),init:m(e.value)}}),h(On,function(){return{type:"ThisExpression"}}),h(Fn,function(){return{type:"Super"}}),h(Lt,function(e){return{type:"ConditionalExpression",test:m(e.condition),consequent:m(e.consequent),alternate:m(e.alternative)}}),h(Rt,function(e){return{type:"NewExpression",callee:m(e.expression),arguments:e.args.map(m)}}),h(Ct,function(e){if(e.expression instanceof yn&&"import"===e.expression.name){const[t,n]=e.args.map(m);return{type:"ImportExpression",source:t,options:n||null}}return{type:"CallExpression",callee:m(e.expression),optional:e.optional,arguments:e.args.map(m)}}),h(Ke,function(e){return D("Program",e)}),h(He,function(e){return{type:v()?"RestElement":"SpreadElement",argument:m(e.expression)}}),h(je,function(e){return{type:"TaggedTemplateExpression",tag:m(e.prefix),quasi:m(e.template_string)}}),h(Ze,function(e){for(var t=[],n=[],i=0;ie instanceof Vn?null:E(e))}:{type:"ObjectPattern",properties:e.names.map(e=>{if(e instanceof Xt){var t=e.computed_key();const[n,i]=g(e.key,t,e.quote,e.value);return{type:"Property",computed:t,kind:"init",key:i,method:!1,shorthand:n,value:E(e.value)}}return E(e)})}}),h(Ut,function(e){return{type:"AssignmentPattern",left:E(e.left),right:m(e.right)}}),h(Ae,function(e){return{type:"ExpressionStatement",expression:{type:"Literal",value:e.value,raw:e.print_to_string()},directive:e.value}}),h(Te,function(e){return{type:"ExpressionStatement",expression:m(e.body)}}),h(lt,function(e){return{type:"SwitchCase",test:m(e.expression),consequent:e.body.map(m)}}),h(dt,function(e){return{type:"TryStatement",block:b(e.body),handler:m(e.bcatch),guardedHandlers:[],finalizer:m(e.bfinally)}}),h(_t,function(e){return{type:"CatchClause",param:null!=e.argname?E(e.argname):null,body:b(e)}}),h(gt,function(e){return{type:"VariableDeclaration",kind:e instanceof bt?"const":e instanceof vt?"let":"var",declarations:e.definitions.map(m)}}),h(Tt,function(e){if(e.exported_names){var t=e.exported_names[0];if(t&&"*"===t.name.name&&!t.name.quote){var n=t.foreign_name,r="*"!==n.name||n.quote?m(n):null;return{type:"ExportAllDeclaration",source:m(e.module_name),exported:r,attributes:i(e.attributes)}}return{type:"ExportNamedDeclaration",specifiers:e.exported_names.map(function(e){return{type:"ExportSpecifier",exported:m(e.foreign_name),local:m(e.name)}}),declaration:m(e.exported_definition),source:m(e.module_name),attributes:i(e.attributes)}}return e.is_default?{type:"ExportDefaultDeclaration",declaration:m(e.exported_value||e.exported_definition)}:{type:"ExportNamedDeclaration",declaration:m(e.exported_value||e.exported_definition),specifiers:[],source:null}}),h(yt,function(e){var t=[];if(e.imported_name&&t.push({type:"ImportDefaultSpecifier",local:m(e.imported_name)}),e.imported_names){var n=e.imported_names[0].foreign_name;"*"!==n.name||n.quote?e.imported_names.forEach(function(e){t.push({type:"ImportSpecifier",local:m(e.name),imported:m(e.foreign_name)})}):t.push({type:"ImportNamespaceSpecifier",local:m(e.imported_names[0].name)})}return{type:"ImportDeclaration",specifiers:t,source:m(e.module_name),attributes:i(e.attributes)}}),h(At,function(){return{type:"MetaProperty",meta:{type:"Identifier",name:"import"},property:{type:"Identifier",name:"meta"}}}),h(Ot,function(e){return{type:"SequenceExpression",expressions:e.expressions.map(m)}}),h(Mt,function(e){return{type:"MemberExpression",object:m(e.expression),computed:!1,property:{type:"PrivateIdentifier",name:e.property},optional:e.optional}}),h(Ft,function(e){var t=e instanceof wt;return{type:"MemberExpression",object:m(e.expression),computed:t,property:t?m(e.property):{type:"Identifier",name:e.property},optional:e.optional}}),h(xt,function(e){return{type:"ChainExpression",expression:m(e.expression)}}),h(It,function(e){return{type:"++"==e.operator||"--"==e.operator?"UpdateExpression":"UnaryExpression",operator:e.operator,prefix:e instanceof Nt,argument:m(e.expression)}}),h(Bt,function(e){if("="==e.operator&&v())return{type:"AssignmentPattern",left:m(e.left),right:m(e.right)};return{type:"&&"==e.operator||"||"==e.operator||"??"===e.operator?"LogicalExpression":"BinaryExpression",left:m(e.left),operator:e.operator,right:m(e.right)}}),h(Vt,function(e){return{type:"AssignmentExpression",operator:e.operator,left:m(e.left),right:m(e.right)}}),h(en,function(e){return{type:"BinaryExpression",left:{type:"PrivateIdentifier",name:e.key.name},operator:"in",right:m(e.value)}}),h(Gt,function(e){return{type:"ArrayExpression",elements:e.elements.map(m)}}),h(Kt,function(e){return{type:"ObjectExpression",properties:e.properties.map(m)}}),h(Ht,function(e,t){var n=e.computed_key();const[i,r]=g(e.key,n,e.quote,e.value);var o;if(e instanceof Yt?o="get":e instanceof qt&&(o="set"),e instanceof Wt||e instanceof zt){return{type:"MethodDefinition",computed:!1,kind:e instanceof Wt?"get":"set",static:e.static,key:{type:"PrivateIdentifier",name:e.key.name},value:m(e.value)}}return e instanceof Jt?{type:"PropertyDefinition",key:{type:"PrivateIdentifier",name:e.key.name},value:m(e.value),computed:!1,static:e.static}:e instanceof Qt?{type:"PropertyDefinition",key:r,value:m(e.value),computed:n,static:e.static}:t instanceof Zt?{type:"MethodDefinition",computed:n,kind:o,static:e.static,key:m(e.key),value:m(e.value)}:{type:"Property",computed:n,method:!1,shorthand:i,kind:o,key:r,value:m(e.value)}}),h(Xt,function(e){var t=e.computed_key();const[n,i]=g(e.key,t,e.quote,e.value);return{type:"Property",computed:t,shorthand:n,method:!1,kind:"init",key:i,value:m(e.value)}}),h($t,function(e,t){const n=e.computed_key(),[i,r]=g(e.key,n,e.quote,e.value);return t instanceof Kt?{type:"Property",kind:"init",computed:n,method:!0,shorthand:!1,key:r,value:m(e.value)}:{type:"MethodDefinition",kind:n||"constructor"!==e.key.name?"method":"constructor",computed:n,key:r,value:m(e.value),static:e.static}}),h(jt,function(e){return{type:"MethodDefinition",kind:"method",key:{type:"PrivateIdentifier",name:e.key.name},value:m(e.value),computed:!1,static:e.static}}),h(Zt,function(e){return{type:e instanceof rn?"ClassExpression":"ClassDeclaration",superClass:m(e.extends),id:e.name?m(e.name):null,body:{type:"ClassBody",body:e.properties.map(m)}}}),h(nn,function(e){return{type:"StaticBlock",body:e.body.map(m)}}),h(an,function(){return{type:"MetaProperty",meta:{type:"Identifier",name:"new"},property:{type:"Identifier",name:"target"}}}),h(on,function(e,t){if(e instanceof hn&&t.quote||(e instanceof Dn||e instanceof Tn||e instanceof An)&&e.quote)return{type:"Literal",value:e.name};var n=e.definition();return{type:"Identifier",name:n?n.mangled_name||n.name:e.name}}),h(In,function(e){const t=e.value.source,n=e.value.flags;return{type:"Literal",value:null,raw:e.print_to_string(),regex:{pattern:t,flags:n}}}),h(kn,function(e){return{type:"Literal",value:e.value,raw:e.raw||e.print_to_string()}}),h(Nn,function(e){return{type:"Identifier",name:String(e.value)}}),h(xn,e=>({type:"Literal",value:null,bigint:"function"==typeof BigInt?BigInt(e.value).toString():e.value,raw:e.raw})),Gn.DEFMETHOD("to_mozilla_ast",kn.prototype.to_mozilla_ast),Pn.DEFMETHOD("to_mozilla_ast",kn.prototype.to_mozilla_ast),Vn.DEFMETHOD("to_mozilla_ast",function(){return null}),Oe.DEFMETHOD("to_mozilla_ast",Fe.prototype.to_mozilla_ast),Xe.DEFMETHOD("to_mozilla_ast",We.prototype.to_mozilla_ast);var a=null;function s(e){return null==e?null:n[e.type](e)}function u(e,t){return t||"Literal"!==e.type||"string"!=typeof e.value?"":'"'}function c(e,t,n){return new e({start:r(t),quote:n?'"':void 0,name:"Identifier"===t.type?t.name:String(t.value),end:o(t)})}function l(t,n){return new(n?ze:We)({start:r(t),end:o(t),name:t.id&&c(n?hn:mn,t.id),argnames:t.params.map(e=>f(e,pn)),is_generator:t.generator,async:t.async,body:e(s(t.body).body)})}function f(e,t){switch(e.type){case"ObjectPattern":return new $e({start:r(e),end:o(e),names:e.properties.map(e=>f(e,t)),is_array:!1});case"Property":var n=e.key,i={start:r(n||e.value),end:o(e.value),key:"Identifier"==n.type?n.name:String(n.value),quote:e.computed||"Literal"!==n.type||"string"!=typeof n.value?"":'"',value:f(e.value,t)};return e.computed&&(i.key=s(e.key)),new Xt(i);case"ArrayPattern":return new $e({start:r(e),end:o(e),names:e.elements.map(function(e){return null===e?new Vn:f(e,t)}),is_array:!0});case"SpreadElement":case"RestElement":return new He({start:r(e),end:o(e),expression:f(e.argument,t)});case"AssignmentPattern":return new Ut({start:r(e),end:o(e),left:f(e.left,t),operator:"=",right:s(e.right)});case"Identifier":return new t({start:r(e),end:o(e),name:e.name});default:throw new Error("Invalid node type for destructuring: "+e.type)}}function d(e){if(!e)return null;const t=c(Cn,e);let n=a.length;for(;n--;){const e=a[n];if(t.name===e.name){t.thedef=e;break}}return t}function h(e,t){e.DEFMETHOD("to_mozilla_ast",function(e){return n=this,i=t(this,e),r=n.start,o=n.end,r&&o?(null!=r.pos&&null!=o.endpos&&(i.range=[r.pos,o.endpos]),r.line&&(i.loc={start:{line:r.line,column:r.col},end:o.endline?{line:o.endline,column:o.endcol}:null},r.file&&(i.loc.source=r.file)),i):i;var n,i,r,o})}De.from_mozilla_ast=function(e){var t=a;a=[];var n=s(e);return a=t,n};var _=null;function m(e){null===_&&(_=[]),_.push(e);var t=null!=e?e.to_mozilla_ast(_[_.length-2]):null;return _.pop(),0===_.length&&(_=null),t}function g(e,t=!1,n=!1,i=null){if(t)return[!1,m(e)];const r="string"==typeof e?e:e.name;let o;o=n?{type:"Literal",value:r,raw:JSON.stringify(r)}:""+ +r===r&&+r>=0?{type:"Literal",value:+r,raw:JSON.stringify(+r)}:{type:"Identifier",name:r};return["Identifier"===o.type&&o.name===r&&(i instanceof on&&i.name===r||i instanceof Ut&&i.left.name===r),o]}function E(e){if(e instanceof He)return{type:"RestElement",argument:E(e.expression)};if(e instanceof on||e instanceof $e||e instanceof Ut||e instanceof Ft)return m(e);throw new Error(e.TYPE)}function v(){for(var e=_.length;e--;)if(_[e]instanceof $e)return!0;return!1}function b(e){return{type:"BlockStatement",body:e.body.map(m)}}function D(e,t){var n=t.body.map(m);return t.body[0]instanceof Te&&t.body[0].body instanceof Mn&&n.unshift(m(new ke(t.body[0]))),{type:e,body:n}}}();const ii=/[@#]__(PURE|INLINE|NOINLINE)__/;function ri(e){return("comment2"===e.type||"comment1"===e.type)&&/@preserve|@copyright|@lic|@cc_on|^\**!/i.test(e.value)}class oi{constructor(){this.committed="",this.current=""}append(e){this.current.length>8e3?(this.committed+=this.current+e,this.current=""):this.current+=e}insertAt(e,t){const{committed:n,current:i}=this;t=0;){const t=this.charCodeAt(e--);if(10===t)return!0;if(32!==t)return!1}return!0}toString(){return this.committed+this.current}}function ai(e){var t=!e;void 0===(e=o(e,{ascii_only:!1,beautify:!1,braces:!1,comments:"some",ecma:5,ie8:!1,indent_level:4,indent_start:0,inline_script:!0,keep_numbers:!1,keep_quoted_props:!1,max_line_len:!1,preamble:null,preserve_annotations:!1,quote_keys:!1,quote_style:0,safari10:!1,semicolons:!0,shebang:!0,shorthand:void 0,source_map:null,webkit:!1,width:80,wrap_iife:!1,wrap_func_args:!1,_destroy_ast:!1},!0)).shorthand&&(e.shorthand=e.ecma>5);var n=s;if(e.comments){let t=e.comments;if("string"==typeof e.comments&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var i=e.comments.lastIndexOf("/");t=new RegExp(e.comments.substr(1,i-1),e.comments.substr(i+1))}n=t instanceof RegExp?function(e){return"comment5"!=e.type&&t.test(e.value)}:"function"==typeof t?function(e){return"comment5"!=e.type&&t(this,e)}:"some"===t?ri:u}if(e.preserve_annotations){let e=n;n=function(t){return ii.test(t.value)||e.apply(this,arguments)}}var r=0,c=0,l=1,f=0,p=new oi;let d=new Set;var h=e.ascii_only?function(t,n=!1,i=!1){return e.ecma>=2015&&!e.safari10&&!i&&(t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,function(e){var t=function(e,t){return j(e.charCodeAt(t))?65536+(e.charCodeAt(t)-55296<<10)+e.charCodeAt(t+1)-56320:e.charCodeAt(t)}(e,0).toString(16);return"\\u{"+t+"}"})),t.replace(/[\u0000-\u001f\u007f-\uffff]/g,function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){for(;t.length<2;)t="0"+t;return"\\x"+t}for(;t.length<4;)t="0"+t;return"\\u"+t})}:function(e){return e.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g,function(e,t){return t?"\\u"+t.charCodeAt(0).toString(16):e})};function _(t,n){var i=function(t,n){var i=0,r=0;function o(){return"'"+t.replace(/\x27/g,"\\'")+"'"}function a(){return'"'+t.replace(/\x22/g,'\\"')+'"'}if(t=t.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,function(n,o){switch(n){case'"':return++i,'"';case"'":return++r,"'";case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\v":return e.ie8?"\\x0B":"\\v";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";case"\ufeff":return"\\ufeff";case"\0":return/[0-9]/.test($(t,o+1))?"\\x00":"\\0"}return n}),t=h(t),"`"===n)return"`"+t.replace(/`/g,"\\`")+"`";switch(e.quote_style){case 1:return o();case 2:return a();case 3:return"'"==n?o():a();default:return i>r?o():a()}}(t,n);return e.inline_script&&(i=(i=(i=i.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2")).replace(/\x3c!--/g,"\\x3c!--")).replace(/--\x3e/g,"--\\x3e")),i}var m,E,v=!1,b=!1,D=!1,S=0,y=!1,A=!1,T=-1,C="",R=e.source_map&&[],O=R?function(){R.forEach(function(t){try{let{name:n,token:i}=t;!1!==n&&("name"==i.type||"privatename"===i.type?n=i.value:n instanceof on&&(n="string"===i.type?i.value:n.name)),e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,ne(n)?n:void 0)}catch(e){}}),R=[]}:a,F=e.max_line_len?function(){if(c>e.max_line_len&&S){p.insertAt("\n",S);const e=p.length()-S-1;if(R){var t=e-c;R.forEach(function(e){e.line++,e.col+=t})}l++,f++,c=e}S&&(S=0,O())}:a,k=g("( [ + * / - , . `");function M(t){var n=$(t=String(t),0);y&&n&&(y=!1,"\n"!==n&&(M("\n"),x())),A&&n&&(A=!1,/[\s;})]/.test(n)||w()),T=-1;var i=C.charAt(C.length-1);D&&(D=!1,(":"!==i||"}"!==n)&&(n&&";}".includes(n)||";"===i)||(e.semicolons||k.has(n)?(p.append(";"),c++,f++):(F(),c>0&&(p.append("\n"),f++,l++,c=0),/^\s+$/.test(t)&&(D=!0)),e.beautify||(b=!1))),b&&((ee(i)&&(ee(n)||"\\"==n)||"/"==n&&n==i||("+"==n||"-"==n)&&n==C)&&(p.append(" "),c++,f++),b=!1),m&&(R.push({token:m,name:E,line:l,col:c}),m=!1,S||O()),p.append(t),v="("==t[t.length-1],f+=t.length;var r=t.split(/\r?\n/),o=r.length-1;l+=o,c+=r[0].length,o>0&&(F(),c=r[o].length),C=t}var w=e.beautify?function(){M(" ")}:function(){b=!0},x=e.beautify?function(t){var n;e.beautify&&M((n=t?.5:0," ".repeat(e.indent_start+r-n*e.indent_level)))}:a,I=e.beautify?function(e,t){!0===e&&(e=L());var n=r;r=e;var i=t();return r=n,i}:function(e,t){return t()},N=e.beautify?function(){if(T<0)return M("\n");"\n"!=p.charAt(T)&&(p.insertAt("\n",T),f++,l++),T++}:e.max_line_len?function(){F(),S=p.length()}:a,P=e.beautify?function(){M(";")}:function(){D=!0};function B(){D=!1,M(";")}function L(){return r+e.indent_level}var V=R?function(e,t){m=e,E=t}:a;function U(){return S&&F(),p.toString()}function G(t){return e.preserve_annotations||(t=t.replace(ii," ")),/^\s*$/.test(t)?"":t.replace(/(<\s*\/\s*)(script)/i,"<\\/$2")}const K=e._destroy_ast?function(e){e.body.length=0,e.argnames.length=0}:a;var H=[];return{get:U,toString:U,indent:x,in_directive:!1,use_asm:null,active_scope:null,indentation:function(){return r},current_width:function(){return c-r},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return v},newline:N,print:M,star:function(){M("*")},space:w,comma:function(){M(","),w()},colon:function(){M(":"),w()},last:function(){return C},semicolon:P,force_semicolon:B,to_utf8:h,print_name:function(e){M(function(e){return e=e.toString(),h(e,!0)}(e))},print_string:function(e,t,n){var i=_(e,t);!0!==n||i.includes("\\")||(p.expectDirective()||B(),B()),M(i)},print_template_string_chars:function(e){var t=_(e,"`").replace(/\${/g,"\\${");return M(t.substr(1,t.length-2))},encode_string:_,next_indent:L,with_indent:I,with_block:function(e){var t;return M("{"),N(),I(L(),function(){t=e()}),x(),M("}"),t},with_parens:function(e){M("(");var t=e();return M(")"),t},with_square:function(e){M("[");var t=e();return M("]"),t},add_mapping:V,option:function(t){return e[t]},gc_scope:K,printed_comments:d,prepend_comments:t?a:function(t){var i=t.start;if(!i)return;var r=this.printed_comments;const o=t instanceof et&&t.value||(t instanceof at||t instanceof st)&&t.expression;if(i.comments_before&&r.has(i.comments_before)){if(!o)return;i.comments_before=[]}var a=i.comments_before;if(a||(a=i.comments_before=[]),r.add(a),o){var s=new qn(function(e){var t=s.parent();if(!(t instanceof et||t instanceof at||t instanceof st||t instanceof Bt&&t.left===e||"Call"==t.TYPE&&t.expression===e||t instanceof Lt&&t.condition===e||t instanceof kt&&t.expression===e||t instanceof Ot&&t.expressions[0]===e||t instanceof wt&&t.expression===e||t instanceof Pt))return!0;if(e.start){var n=e.start.comments_before;n&&!r.has(n)&&(r.add(n),a=a.concat(n))}});s.push(t),o.walk(s)}if(0==f){a.length>0&&e.shebang&&"comment5"===a[0].type&&!r.has(a[0])&&(M("#!"+a.shift().value+"\n"),x());var u=e.preamble;u&&M(u.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"))}if(0!=(a=a.filter(n,t).filter(e=>!r.has(e))).length){var c=p.hasNLB();a.forEach(function(e,t){if(r.add(e),c||(e.nlb?(M("\n"),x(),c=!0):t>0&&w()),/comment[134]/.test(e.type))(n=G(e.value))&&(M("//"+n+"\n"),x()),c=!0;else if("comment2"==e.type){var n;(n=G(e.value))&&M("/*"+n+"*/"),c=!1}}),c||(i.nlb?(M("\n"),x()):w())}},append_comments:t||n===s?a:function(e,t){var i=e.end;if(i){var r=this.printed_comments,o=i[t?"comments_before":"comments_after"];if(o&&!r.has(o)&&(e instanceof Se||o.every(e=>!/comment[134]/.test(e.type)))){r.add(o);var a=p.length();o.filter(n,e).forEach(function(e,n){if(!r.has(e))if(r.add(e),A=!1,y?(M("\n"),x(),y=!1):e.nlb&&(n>0||!p.hasNLB())?(M("\n"),x()):(n>0||!t)&&w(),/comment[134]/.test(e.type)){const t=G(e.value);t&&M("//"+t),y=!0}else if("comment2"==e.type){const t=G(e.value);t&&M("/*"+t+"*/"),A=!0}}),p.length()>a&&(T=a)}}},line:function(){return l},col:function(){return c},pos:function(){return f},push_node:function(e){H.push(e)},pop_node:function(){return H.pop()},parent:function(e){return H[H.length-2-(e||0)]}}}!function(){function e(e,t){e.DEFMETHOD("_codegen",t)}function t(e,n){Array.isArray(e)?e.forEach(function(e){t(e,n)}):e.DEFMETHOD("needs_parens",n)}function n(e,t,n,i){var r=e.length-1;n.in_directive=i,e.forEach(function(e,i){!0!==n.in_directive||e instanceof Ae||e instanceof ke||e instanceof Te&&e.body instanceof Mn||(n.in_directive=!1),e instanceof ke||(n.indent(),e.print(n),i==r&&t||(n.newline(),t&&n.newline())),!0===n.in_directive&&e instanceof Te&&e.body instanceof Mn&&(n.in_directive=!1)}),n.in_directive=!1}function i(e,t){t.print("{"),t.with_indent(t.next_indent(),function(){t.append_comments(e,!0)}),t.add_mapping(e.end),t.print("}")}function r(e,t,r){e.body.length>0?t.with_block(function(){n(e.body,!1,t,r),t.add_mapping(e.end)}):i(e,t)}function o(e,t,n){var i=!1;n&&(i=Xn(e,e=>e instanceof Ge&&!(e instanceof qe)||(e instanceof Bt&&"in"==e.operator||e instanceof en?Wn:void 0))),e.print(t,i)}function u(e,t,n){return n.option("quote_keys")?(n.print_string(e),!1):""+ +e==e&&e>=0?n.option("keep_numbers")?(n.print(e),!1):(n.print(d(e)),!1):(x.has(e)?n.option("ie8"):n.option("ecma")<2015||n.option("safari10")?!ne(e):!ie(e,!0))||t&&n.option("keep_quoted_props")?(n.print_string(e,t),!1):(n.print_name(e),!0)}De.DEFMETHOD("print",function(e,t){var n=this,i=n._codegen;function r(){e.prepend_comments(n),n.add_source_map(e),i(n,e),e.append_comments(n)}n instanceof Ge?e.active_scope=n:!e.use_asm&&n instanceof Ae&&"use asm"==n.value&&(e.use_asm=e.active_scope),e.push_node(n),t||n.needs_parens(e)?e.with_parens(r):r(),e.pop_node(),n===e.use_asm&&(e.use_asm=null)}),De.DEFMETHOD("_print",De.prototype.print),De.DEFMETHOD("print_to_string",function(e){var t=ai(e);return this.print(t),t.get()}),t(De,s),t(We,function(e){if(!e.has_parens()&&ti(e))return!0;var t;if(e.option("webkit")&&((t=e.parent())instanceof Ft&&t.expression===this))return!0;if(e.option("wrap_iife")&&((t=e.parent())instanceof Ct&&t.expression===this))return!0;if(e.option("wrap_func_args")&&((t=e.parent())instanceof Ct&&t.args.includes(this)))return!0;return!1}),t(qe,function(e){var t=e.parent();return!!(e.option("wrap_func_args")&&t instanceof Ct&&t.args.includes(this))||(t instanceof Ft&&t.expression===this||t instanceof Lt&&t.condition===this)}),t(Kt,function(e){return!e.has_parens()&&ti(e)}),t(rn,ti),t(It,function(e){var t=e.parent();return t instanceof Ft&&t.expression===this||t instanceof Ct&&t.expression===this||t instanceof Bt&&"**"===t.operator&&this instanceof Nt&&t.left===this&&"++"!==this.operator&&"--"!==this.operator}),t(at,function(e){var t=e.parent();return t instanceof Ft&&t.expression===this||t instanceof Ct&&t.expression===this||t instanceof Bt&&"**"===t.operator&&t.left===this||e.option("safari10")&&t instanceof Nt}),t(Ot,function(e){var t=e.parent();return t instanceof Ct||t instanceof It||t instanceof Bt||t instanceof Dt||t instanceof Ft||t instanceof Gt||t instanceof Ht||t instanceof Lt||t instanceof qe||t instanceof Ut||t instanceof He||t instanceof Ve&&this===t.object||t instanceof st||t instanceof Tt}),t(Bt,function(e){var t=e.parent();if(t instanceof Ct&&t.expression===this)return!0;if(t instanceof It)return!0;if(t instanceof Ft&&t.expression===this)return!0;if(t instanceof Bt){const e=t.operator,n=this.operator;if("??"===n&&("||"===e||"&&"===e))return!0;if("??"===e&&("||"===n||"&&"===n))return!0;const i=he[e],r=he[n];if(i>r||i==r&&(this===t.right||"**"==e))return!0}if(t instanceof en){const e=this.operator,n=he.in,i=he[e];if(n>i||n==i&&this===t.value)return!0}}),t(en,function(e){var t=e.parent();if(t instanceof Ct&&t.expression===this)return!0;if(t instanceof It)return!0;if(t instanceof Ft&&t.expression===this)return!0;if(t instanceof Bt){const e=t.operator,n=he[e],i=he.in;if(n>i||n==i&&(this===t.right||"**"==e))return!0}return t instanceof en&&this===t.value||void 0}),t(st,function(e){var t=e.parent();return t instanceof Bt&&"="!==t.operator||(t instanceof Ct&&t.expression===this||(t instanceof Lt&&t.condition===this||(t instanceof It||(t instanceof Ft&&t.expression===this||void 0))))}),t(xt,function(e){var t=e.parent();return(t instanceof Ct||t instanceof Ft)&&t.expression===this}),t(Ft,function(e){var t=e.parent();if(t instanceof Rt&&t.expression===this)return Xn(this,e=>e instanceof Ge||(e instanceof Ct?Wn:void 0))}),t(Ct,function(e){var t,n=e.parent();return!!(n instanceof Rt&&n.expression===this||n instanceof Tt&&n.is_default&&this.expression instanceof We)||this.expression instanceof We&&n instanceof Ft&&n.expression===this&&(t=e.parent(1))instanceof Vt&&t.left===n}),t(Rt,function(e){var t=e.parent();if(0===this.args.length&&(t instanceof Ft||t instanceof Ct&&t.expression===this||t instanceof je&&t.prefix===this))return!0}),t(wn,function(e){var t=e.parent();if(t instanceof Ft&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(d(n)))return!0}}),t(xn,function(e){var t=e.parent();if(t instanceof Ft&&t.expression===this&&this.getValue().startsWith("-"))return!0}),t([Vt,Lt],function(e){var t=e.parent();return t instanceof It||(t instanceof Bt&&!(t instanceof Vt)||(t instanceof Ct&&t.expression===this||(t instanceof Lt&&t.condition===this||(t instanceof Ft&&t.expression===this||(this instanceof Vt&&this.left instanceof $e&&!1===this.left.is_array||void 0)))))}),e(Ae,function(e,t){t.print_string(e.value,e.quote),t.semicolon()}),e(He,function(e,t){t.print("..."),e.expression.print(t)}),e($e,function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach(function(e,i){i>0&&t.comma(),e.print(t),i==n-1&&e instanceof Vn&&t.comma()}),t.print(e.is_array?"]":"}")}),e(ye,function(e,t){t.print("debugger"),t.semicolon()}),Me.DEFMETHOD("_do_print_body",function(e){p(this.body,e)}),e(Se,function(e,t){e.body.print(t),t.semicolon()}),e(Ke,function(e,t){n(e.body,!0,t,!0),t.print("")}),e(we,function(e,t){e.label.print(t),t.colon(),e.body.print(t)}),e(Te,function(e,t){e.body.print(t),t.semicolon()}),e(Fe,function(e,t){r(e,t)}),e(ke,function(e,t){t.semicolon()}),e(Ne,function(e,t){t.print("do"),t.space(),h(e.body,t),t.space(),t.print("while"),t.space(),t.with_parens(function(){e.condition.print(t)}),t.semicolon()}),e(Pe,function(e,t){t.print("while"),t.space(),t.with_parens(function(){e.condition.print(t)}),t.space(),e._do_print_body(t)}),e(Be,function(e,t){t.print("for"),t.space(),t.with_parens(function(){e.init?(e.init instanceof gt?e.init.print(t):o(e.init,t,!0),t.print(";"),t.space()):t.print(";"),e.condition?(e.condition.print(t),t.print(";"),t.space()):t.print(";"),e.step&&e.step.print(t)}),t.space(),e._do_print_body(t)}),e(Le,function(e,t){t.print("for"),e.await&&(t.space(),t.print("await")),t.space(),t.with_parens(function(){e.init.print(t),t.space(),t.print(e instanceof Ve?"of":"in"),t.space(),e.object.print(t)}),t.space(),e._do_print_body(t)}),e(Ue,function(e,t){t.print("with"),t.space(),t.with_parens(function(){e.expression.print(t)}),t.space(),e._do_print_body(t)}),Xe.DEFMETHOD("_do_print",function(e,t){var n=this;t||(n.async&&(e.print("async"),e.space()),e.print("function"),n.is_generator&&e.star(),n.name&&e.space()),n.name instanceof on?n.name.print(e):t&&n.name instanceof De&&e.with_square(function(){n.name.print(e)}),e.with_parens(function(){n.argnames.forEach(function(t,n){n&&e.comma(),t.print(e)})}),e.space(),r(n,e,!0)}),e(Xe,function(e,t){e._do_print(t),t.gc_scope(e)}),e(je,function(e,t){var n=e.prefix,i=n instanceof Xe||n instanceof Bt||n instanceof Lt||n instanceof Ot||n instanceof It||n instanceof kt&&n.expression instanceof Kt;i&&t.print("("),e.prefix.print(t),i&&t.print(")"),e.template_string.print(t)}),e(Ze,function(e,t){var n=t.parent()instanceof je;t.print("`");for(var i=0;i"),e.space();const o=t.body[0];if(1===t.body.length&&o instanceof tt){const t=o.value;t?ni(t)?(e.print("("),t.print(e),e.print(")")):t.print(e):e.print("{}")}else r(t,e);i&&e.print(")"),e.gc_scope(t)}),et.DEFMETHOD("_do_print",function(e,t){if(e.print(t),this.value){e.space();const t=this.value.start.comments_before;t&&t.length&&!e.printed_comments.has(t)?(e.print("("),this.value.print(e),e.print(")")):this.value.print(e)}e.semicolon()}),e(tt,function(e,t){e._do_print(t,"return")}),e(nt,function(e,t){e._do_print(t,"throw")}),e(st,function(e,t){var n=e.is_star?"*":"";t.print("yield"+n),e.expression&&(t.space(),e.expression.print(t))}),e(at,function(e,t){t.print("await"),t.space();var n=e.expression,i=!(n instanceof Ct||n instanceof yn||n instanceof Ft||n instanceof It||n instanceof kn||n instanceof at||n instanceof Kt);i&&t.print("("),e.expression.print(t),i&&t.print(")")}),it.DEFMETHOD("_do_print",function(e,t){e.print(t),this.label&&(e.space(),this.label.print(e)),e.semicolon()}),e(rt,function(e,t){e._do_print(t,"break")}),e(ot,function(e,t){e._do_print(t,"continue")}),e(ut,function(e,t){t.print("if"),t.space(),t.with_parens(function(){e.condition.print(t)}),t.space(),e.alternative?(!function(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof Ne)return h(n,t);if(!n)return t.force_semicolon();for(;;)if(n instanceof ut){if(!n.alternative)return void h(e.body,t);n=n.alternative}else{if(!(n instanceof Me))break;n=n.body}p(e.body,t)}(e,t),t.space(),t.print("else"),t.space(),e.alternative instanceof ut?e.alternative.print(t):p(e.alternative,t)):e._do_print_body(t)}),e(ct,function(e,t){t.print("switch"),t.space(),t.with_parens(function(){e.expression.print(t)}),t.space();var n=e.body.length-1;n<0?i(e,t):t.with_block(function(){e.body.forEach(function(e,i){t.indent(!0),e.print(t),i0&&t.newline()})})}),lt.DEFMETHOD("_do_print_body",function(e){e.newline(),this.body.forEach(function(t){e.indent(),t.print(e),e.newline()})}),e(ft,function(e,t){t.print("default:"),e._do_print_body(t)}),e(pt,function(e,t){t.print("case"),t.space(),e.expression.print(t),t.print(":"),e._do_print_body(t)}),e(dt,function(e,t){t.print("try"),t.space(),e.body.print(t),e.bcatch&&(t.space(),e.bcatch.print(t)),e.bfinally&&(t.space(),e.bfinally.print(t))}),e(ht,function(e,t){r(e,t)}),e(_t,function(e,t){t.print("catch"),e.argname&&(t.space(),t.with_parens(function(){e.argname.print(t)})),t.space(),r(e,t)}),e(mt,function(e,t){t.print("finally"),t.space(),r(e,t)}),gt.DEFMETHOD("_do_print",function(e,t){e.print(t),e.space(),this.definitions.forEach(function(t,n){n&&e.comma(),t.print(e)});var n=e.parent();(!(n instanceof Be||n instanceof Le)||n&&n.init!==this)&&e.semicolon()}),e(vt,function(e,t){e._do_print(t,"let")}),e(Et,function(e,t){e._do_print(t,"var")}),e(bt,function(e,t){e._do_print(t,"const")}),e(yt,function(e,t){t.print("import"),t.space(),e.imported_name&&e.imported_name.print(t),e.imported_name&&e.imported_names&&(t.print(","),t.space()),e.imported_names&&(1!==e.imported_names.length||"*"!==e.imported_names[0].foreign_name.name||e.imported_names[0].foreign_name.quote?(t.print("{"),e.imported_names.forEach(function(n,i){t.space(),n.print(t),i0&&(e.comma(),e.should_break()&&(e.newline(),e.indent())),t.print(e)})}),e(Ot,function(e,t){e._do_print(t)}),e(kt,function(e,t){var n=e.expression;n.print(t);var i=e.property,r=x.has(i)?t.option("ie8"):!ie(i,t.option("ecma")>=2015&&!t.option("safari10"));e.optional&&t.print("?."),r?(t.print("["),t.add_mapping(e.end),t.print_string(i),t.print("]")):(n instanceof wn&&n.getValue()>=0&&(/[xa-f.)]/i.test(t.last())||t.print(".")),e.optional||t.print("."),t.add_mapping(e.end),t.print_name(i))}),e(Mt,function(e,t){e.expression.print(t);var n=e.property;e.optional&&t.print("?"),t.print(".#"),t.add_mapping(e.end),t.print_name(n)}),e(wt,function(e,t){e.expression.print(t),e.optional&&t.print("?."),t.print("["),e.property.print(t),t.print("]")}),e(xt,function(e,t){e.expression.print(t)}),e(Nt,function(e,t){var n=e.operator;"--"===n&&t.last().endsWith("!")&&t.print(" "),t.print(n),(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof Nt&&/^[+-]/.test(e.expression.operator))&&t.space(),e.expression.print(t)}),e(Pt,function(e,t){e.expression.print(t),t.print(e.operator)}),e(Bt,function(e,t){var n=e.operator;e.left.print(t),">"==n[0]&&t.last().endsWith("--")?t.print(" "):t.space(),t.print(n),t.space(),e.right.print(t)}),e(Lt,function(e,t){e.condition.print(t),t.space(),t.print("?"),t.space(),e.consequent.print(t),t.space(),t.colon(),e.alternative.print(t)}),e(Gt,function(e,t){t.with_square(function(){var n=e.elements,i=n.length;i>0&&t.space(),n.forEach(function(e,n){n&&t.comma(),e.print(t),n===i-1&&e instanceof Vn&&t.comma()}),i>0&&t.space()})}),e(Kt,function(e,t){e.properties.length>0?t.with_block(function(){e.properties.forEach(function(e,n){n&&(t.print(","),t.newline()),t.indent(),e.print(t)}),t.newline()}):i(e,t)}),e(Zt,function(e,t){if(t.print("class"),t.space(),e.name&&(e.name.print(t),t.space()),e.extends){var n=!(e.extends instanceof yn||e.extends instanceof Ft||e.extends instanceof rn||e.extends instanceof We);t.print("extends"),n?t.print("("):t.space(),e.extends.print(t),n?t.print(")"):t.space()}e.properties.length>0?t.with_block(function(){e.properties.forEach(function(e,n){n&&t.newline(),t.indent(),e.print(t)}),t.newline()}):t.print("{}")}),e(an,function(e,t){t.print("new.target")}),e(Xt,function(e,t){function n(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}const i=t.option("shorthand")&&!(e.key instanceof De);if(i&&e.value instanceof on&&n(e.value)===e.key&&!x.has(e.key)){u(e.key,e.quote,t)||(t.colon(),e.value.print(t))}else if(i&&e.value instanceof Ut&&e.value.left instanceof on&&n(e.value.left)===e.key){u(e.key,e.quote,t)||(t.colon(),e.value.left.print(t)),t.space(),t.print("="),t.space(),e.value.right.print(t)}else e.key instanceof De?t.with_square(function(){e.key.print(t)}):u(e.key,e.quote,t),t.colon(),e.value.print(t)}),e(Jt,(e,t)=>{e.static&&(t.print("static"),t.space()),t.print("#"),u(e.key.name,void 0,t),e.value&&(t.print("="),e.value.print(t)),t.semicolon()}),e(Qt,(e,t)=>{e.static&&(t.print("static"),t.space()),e.key instanceof _n?u(e.key.name,e.quote,t):(t.print("["),e.key.print(t),t.print("]")),e.value&&(t.print("="),e.value.print(t)),t.semicolon()}),Ht.DEFMETHOD("_print_getter_setter",function(e,t,n){var i=this;i.static&&(n.print("static"),n.space()),e&&(n.print(e),n.space()),i.key instanceof hn?(t&&n.print("#"),u(i.key.name,i.quote,n),i.key.add_source_map(n)):n.with_square(function(){i.key.print(n)}),i.value._do_print(n,!0)}),e(qt,function(e,t){e._print_getter_setter("set",!1,t)}),e(Yt,function(e,t){e._print_getter_setter("get",!1,t)}),e(zt,function(e,t){e._print_getter_setter("set",!0,t)}),e(Wt,function(e,t){e._print_getter_setter("get",!0,t)}),e($t,function(e,t){var n;e.value.is_generator&&e.value.async?n="async*":e.value.is_generator?n="*":e.value.async&&(n="async"),e._print_getter_setter(n,!1,t)}),e(jt,function(e,t){var n;e.value.is_generator&&e.value.async?n="async*":e.value.is_generator?n="*":e.value.async&&(n="async"),e._print_getter_setter(n,!0,t)}),e(en,function(e,t){e.key.print(t),t.space(),t.print("in"),t.space(),e.value.print(t)}),e(Rn,function(e,t){t.print("#"+e.name)}),e(nn,function(e,t){t.print("static"),t.space(),r(e,t)}),on.DEFMETHOD("_do_print",function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name)}),e(on,function(e,t){e._do_print(t)}),e(Vn,a),e(On,function(e,t){t.print("this")}),e(Fn,function(e,t){t.print("super")}),e(kn,function(e,t){t.print(e.getValue())}),e(Mn,function(e,t){t.print_string(e.getValue(),e.quote,t.in_directive)}),e(wn,function(e,t){(t.option("keep_numbers")||t.use_asm)&&e.raw?t.print(e.raw):t.print(d(e.getValue()))}),e(xn,function(e,t){t.option("keep_numbers")&&e.raw?t.print(e.raw):t.print(e.getValue()+"n")});const c=/(<\s*\/\s*script)/i,l=/^\s*script/i,f=(e,t)=>t.replace("/","\\/");function p(e,t){t.option("braces")?h(e,t):!e||e instanceof ke?t.force_semicolon():e instanceof vt||e instanceof bt||e instanceof Zt?h(e,t):e.print(t)}function d(e){var t,n,i,r=e.toString(10).replace(/^0\./,".").replace("e+","e"),o=[r];return Math.floor(e)===e&&(e<0?o.push("-0x"+(-e).toString(16).toLowerCase()):o.push("0x"+e.toString(16).toLowerCase())),(t=/^\.0+/.exec(r))?(n=t[0].length,i=r.slice(n),o.push(i+"e-"+(i.length+n-1))):(t=/0+$/.exec(r))?(n=t[0].length,o.push(r.slice(0,-n)+"e"+n)):(t=/^(\d)\.(\d+)e(-?\d+)$/.exec(r))&&o.push(t[1]+t[2]+"e"+(t[3]-t[2].length)),function(e){for(var t=e[0],n=t.length,i=1;i{n+=e}),n}(i):"",n=n.replace(c,f),l.test(n)&&t.last().endsWith("<")&&t.print(" "),t.print(t.to_utf8(`/${n}/${i}`,!1,!0));const r=t.parent();r instanceof Bt&&/^\w/.test(r.operator)&&r.left===e&&t.print(" ")}),_([De,we,Ke],a),_([Gt,Fe,_t,Zt,kn,ye,gt,Ae,mt,Je,Xe,Rt,Kt,Me,on,ct,lt,Ze,Qe,dt],function(e){e.add_mapping(this.start)}),_([Yt,qt,Wt,zt,$t,jt],function(e){e.add_mapping(this.start,!1)}),_([hn,Rn],function(e){const t=this.end&&this.end.type;"name"===t||"privatename"===t?e.add_mapping(this.end,this.name):e.add_mapping(this.end)}),_([Ht],function(e){e.add_mapping(this.start,this.key)})}();const si=(e,t)=>null===e&&null===t||e.TYPE===t.TYPE&&e.shallow_cmp(t),ui=()=>!0;De.prototype.shallow_cmp=function(){throw new Error("did not find a shallow_cmp function for "+this.constructor.name)},ye.prototype.shallow_cmp=ui,Ae.prototype.shallow_cmp=function(e){return this.value===e.value},Te.prototype.shallow_cmp=ui,Oe.prototype.shallow_cmp=ui,ke.prototype.shallow_cmp=ui,we.prototype.shallow_cmp=function(e){return this.label.name===e.label.name},Ne.prototype.shallow_cmp=ui,Pe.prototype.shallow_cmp=ui,Be.prototype.shallow_cmp=function(e){return(null==this.init?null==e.init:this.init===e.init)&&(null==this.condition?null==e.condition:this.condition===e.condition)&&(null==this.step?null==e.step:this.step===e.step)},Le.prototype.shallow_cmp=ui,Ve.prototype.shallow_cmp=ui,Ue.prototype.shallow_cmp=ui,Ke.prototype.shallow_cmp=ui,He.prototype.shallow_cmp=ui,Xe.prototype.shallow_cmp=function(e){return this.is_generator===e.is_generator&&this.async===e.async},$e.prototype.shallow_cmp=function(e){return this.is_array===e.is_array},je.prototype.shallow_cmp=ui,Ze.prototype.shallow_cmp=ui,Qe.prototype.shallow_cmp=function(e){return this.value===e.value},Je.prototype.shallow_cmp=ui,it.prototype.shallow_cmp=ui,at.prototype.shallow_cmp=ui,st.prototype.shallow_cmp=function(e){return this.is_star===e.is_star},ut.prototype.shallow_cmp=function(e){return null==this.alternative?null==e.alternative:this.alternative===e.alternative},ct.prototype.shallow_cmp=ui,lt.prototype.shallow_cmp=ui,dt.prototype.shallow_cmp=function(e){return this.body===e.body&&(null==this.bcatch?null==e.bcatch:this.bcatch===e.bcatch)&&(null==this.bfinally?null==e.bfinally:this.bfinally===e.bfinally)},_t.prototype.shallow_cmp=function(e){return null==this.argname?null==e.argname:this.argname===e.argname},mt.prototype.shallow_cmp=ui,gt.prototype.shallow_cmp=ui,Dt.prototype.shallow_cmp=function(e){return null==this.value?null==e.value:this.value===e.value},St.prototype.shallow_cmp=ui,yt.prototype.shallow_cmp=function(e){return(null==this.imported_name?null==e.imported_name:this.imported_name===e.imported_name)&&(null==this.imported_names?null==e.imported_names:this.imported_names===e.imported_names)&&(null==this.attributes?null==e.attributes:this.attributes===e.attributes)},At.prototype.shallow_cmp=ui,Tt.prototype.shallow_cmp=function(e){return(null==this.exported_definition?null==e.exported_definition:this.exported_definition===e.exported_definition)&&(null==this.exported_value?null==e.exported_value:this.exported_value===e.exported_value)&&(null==this.exported_names?null==e.exported_names:this.exported_names===e.exported_names)&&(null==this.attributes?null==e.attributes:this.attributes===e.attributes)&&this.module_name===e.module_name&&this.is_default===e.is_default},Ct.prototype.shallow_cmp=ui,Ot.prototype.shallow_cmp=ui,Ft.prototype.shallow_cmp=ui,xt.prototype.shallow_cmp=ui,kt.prototype.shallow_cmp=function(e){return this.property===e.property},Mt.prototype.shallow_cmp=function(e){return this.property===e.property},It.prototype.shallow_cmp=function(e){return this.operator===e.operator},Bt.prototype.shallow_cmp=function(e){return this.operator===e.operator},en.prototype.shallow_cmp=ui,Lt.prototype.shallow_cmp=ui,Gt.prototype.shallow_cmp=ui,Kt.prototype.shallow_cmp=ui,Ht.prototype.shallow_cmp=ui,Xt.prototype.shallow_cmp=function(e){return this.key===e.key&&this.quote===e.quote},qt.prototype.shallow_cmp=function(e){return this.static===e.static},Yt.prototype.shallow_cmp=function(e){return this.static===e.static},$t.prototype.shallow_cmp=function(e){return this.static===e.static},jt.prototype.shallow_cmp=function(e){return this.static===e.static},Zt.prototype.shallow_cmp=function(e){return(null==this.name?null==e.name:this.name===e.name)&&(null==this.extends?null==e.extends:this.extends===e.extends)},Qt.prototype.shallow_cmp=function(e){return this.static===e.static&&("string"!=typeof this.key||this.key===e.key)},Jt.prototype.shallow_cmp=function(e){return this.static===e.static},on.prototype.shallow_cmp=function(e){return this.name===e.name},an.prototype.shallow_cmp=ui,On.prototype.shallow_cmp=ui,Fn.prototype.shallow_cmp=ui,Mn.prototype.shallow_cmp=function(e){return this.value===e.value},wn.prototype.shallow_cmp=function(e){return this.value===e.value},xn.prototype.shallow_cmp=function(e){return this.value===e.value},In.prototype.shallow_cmp=function(e){return this.value.flags===e.value.flags&&this.value.source===e.value.source},Nn.prototype.shallow_cmp=ui;let ci=null,li=null,fi=null;class pi{constructor(e,t,n){this.name=t.name,this.orig=[t],this.init=n,this.eliminated=0,this.assignments=0,this.scope=e,this.replaced=0,this.global=!1,this.export=0,this.mangled_name=null,this.undeclared=!1,this.id=pi.next_id++,this.chained=!1,this.direct_access=!1,this.escaped=0,this.recursive_refs=0,this.references=[],this.should_replace=void 0,this.single_use=!1,this.fixed=!1,Object.seal(this)}fixed_value(){return!this.fixed||this.fixed instanceof De?this.fixed:this.fixed()}unmangleable(e){return e||(e={}),!!(ci&&ci.has(this.id)&&b(e.keep_fnames,this.orig[0].name))||(this.global&&!e.toplevel||1&this.export||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof mn||this.orig[0]instanceof dn)&&b(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof hn||(this.orig[0]instanceof En||this.orig[0]instanceof gn)&&b(e.keep_classnames,this.orig[0].name))}mangle(e){const t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name))this.mangled_name=t.get(this.name);else if(!this.mangled_name&&!this.unmangleable(e)){var n=this.scope,i=this.orig[0];e.ie8&&i instanceof mn&&(n=n.parent_scope);const r=di(this);this.mangled_name=r?r.mangled_name||r.name:n.next_mangled(e,this),this.global&&t&&t.set(this.name,this.mangled_name)}}}function di(e){if(e.orig[0]instanceof vn&&e.scope.is_block_scope())return e.scope.get_defun_scope().variables.get(e.name)}function hi(e,t){let n;fi&&(n=e.get_defun_scope())&&fi.has(n)&&(e=n);var i=e.enclosed,r=t.nth_identifier;e:for(;;){var o=r.get(++e.cname);if(!x.has(o)&&!(t.reserved.has(o)||li&&li.has(o))){for(let e=i.length;--e>=0;){const n=i[e];if(o==(n.mangled_name||n.unmangleable(t)&&n.name))continue e}return o}}}function _i(e){return(e=o(e,{eval:!1,nth_identifier:mi,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,reserved:[],toplevel:!1})).module&&(e.toplevel=!0),Array.isArray(e.reserved)||e.reserved instanceof Set||(e.reserved=[]),e.reserved=new Set(e.reserved),e.reserved.add("arguments"),e}pi.next_id=1,Ge.DEFMETHOD("figure_out_scope",function(e,{parent_scope:t,toplevel:n=this}={}){if(e=o(e,{cache:null,ie8:!1,safari10:!1,module:!1}),!(n instanceof Ke))throw new Error("Invalid toplevel scope");var i=this.parent_scope=t,r=new Map,a=null,s=null,u=[],c=new qn((t,n)=>{if(t.is_block_scope()){const r=i;if(t.block_scope=i=new Ge(t),i._block_scope=!0,i.init_scope_vars(r),i.uses_with=r.uses_with,i.uses_eval=r.uses_eval,e.safari10&&(t instanceof Be||t instanceof Le||t instanceof Ve)&&u.push(i),t instanceof ct){const e=i;i=r,t.expression.walk(c),i=e;for(let e=0;ee===t||(t instanceof cn?e instanceof mn:!(e instanceof fn||e instanceof ln)))||ae(`"${t.name}" is redeclared`,t.start.file,t.start.line,t.start.col,t.start.pos),t instanceof pn||l(m,2),a!==i){t.mark_enclosed();var m=i.find_variable(t);t.thedef!==m&&(t.thedef=m,t.reference())}}else if(t instanceof Cn){var g=r.get(t.name);if(!g)throw new Error(h("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=g}i instanceof Ke||!(t instanceof Tt||t instanceof yt)||ae(`"${t.TYPE}" statement may only appear at the top level`,t.start.file,t.start.line,t.start.col,t.start.pos)}});function l(e,t){if(s){var n=0;do{t++}while(c.parent(n++)!==s)}var i=c.parent(t);if(e.export=i instanceof Tt?1:0){var r=i.exported_definition;(r instanceof Ye||r instanceof tn)&&i.is_default&&(e.export=2)}}e.module&&(c.directives["use strict"]=!0),this.walk(c);this instanceof Ke&&(this.globals=new Map);c=new qn(e=>{if(e instanceof it&&e.label)return e.label.thedef.references.push(e),!0;if(e instanceof yn){var t,i=e.name;if("eval"==i&&c.parent()instanceof Ct)for(var r=e.scope;r&&!r.uses_eval;r=r.parent_scope)r.uses_eval=!0;return c.parent()instanceof St&&c.parent(1).module_name||!(t=e.scope.find_variable(i))?(t=n.def_global(e),e instanceof An&&(t.export=1)):t.scope instanceof Xe&&"arguments"==i&&(t.scope.get_defun_scope().uses_arguments=!0),e.thedef=t,e.reference(),!e.scope.is_block_scope()||t.orig[0]instanceof cn||(e.scope=e.scope.get_defun_scope()),!0}var o;if(e instanceof vn&&(o=di(e.definition())))for(r=e.scope;r&&(d(r.enclosed,o),r!==o.scope);)r=r.parent_scope});if(this.walk(c),(e.ie8||e.safari10)&&Xn(this,e=>{if(e instanceof vn){var t=e.name,i=e.thedef.references,r=e.scope.get_defun_scope(),o=r.find_variable(t)||n.globals.get(t)||r.def_variable(e);return i.forEach(function(e){e.thedef=o,e.reference()}),e.thedef=o,e.reference(),!0}}),e.safari10)for(const e of u)e.parent_scope.variables.forEach(function(t){d(e.enclosed,t)})}),Ke.DEFMETHOD("def_global",function(e){var t=this.globals,n=e.name;if(t.has(n))return t.get(n);var i=new pi(this,e);return i.undeclared=!0,i.global=!0,t.set(n,i),i}),Ge.DEFMETHOD("init_scope_vars",function(e){this.variables=new Map,this.uses_with=!1,this.uses_eval=!1,this.parent_scope=e,this.enclosed=[],this.cname=-1}),Ge.DEFMETHOD("conflicting_def",function(e){return this.enclosed.find(t=>t.name===e)||this.variables.has(e)||this.parent_scope&&this.parent_scope.conflicting_def(e)}),Ge.DEFMETHOD("conflicting_def_shallow",function(e){return this.enclosed.find(t=>t.name===e)||this.variables.has(e)}),Ge.DEFMETHOD("add_child_scope",function(e){if(e.parent_scope===this)return;e.parent_scope=this,e instanceof qe&&this instanceof Xe&&!this.uses_arguments&&(this.uses_arguments=Xn(e,e=>e instanceof yn&&e.scope instanceof Xe&&"arguments"===e.name?Wn:e instanceof Xe&&!(e instanceof qe)||void 0)),this.uses_with=this.uses_with||e.uses_with,this.uses_eval=this.uses_eval||e.uses_eval;const t=(()=>{const e=[];let t=this;do{e.push(t)}while(t=t.parent_scope);return e.reverse(),e})(),n=new Set(e.enclosed),i=[];for(const e of t){i.forEach(t=>d(e.enclosed,t));for(const t of e.variables.values())n.has(t)&&(d(i,t),d(e.enclosed,t))}}),Ge.DEFMETHOD("create_symbol",function(e,{source:t,tentative_name:n,scope:i,conflict_scopes:r=[i],init:o=null}={}){let a;if(r=function(e){const t=new Set;for(const n of new Set(e))(function e(n){null==n||t.has(n)||(t.add(n),e(n.parent_scope))})(n);return[...t]}(r),n){n=a=n.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/gi,"_");let e=0;for(;r.find(e=>e.conflicting_def_shallow(a));)a=n+"$"+e++}if(!a)throw new Error("No symbol name could be generated in create_symbol()");const s=p(e,t,{name:a,scope:i});return this.def_variable(s,o||null),s.mark_enclosed(),s}),De.DEFMETHOD("is_block_scope",s),Zt.DEFMETHOD("is_block_scope",s),Xe.DEFMETHOD("is_block_scope",s),Ke.DEFMETHOD("is_block_scope",s),lt.DEFMETHOD("is_block_scope",s),Oe.DEFMETHOD("is_block_scope",u),Ge.DEFMETHOD("is_block_scope",function(){return this._block_scope||!1}),xe.DEFMETHOD("is_block_scope",u),Xe.DEFMETHOD("init_scope_vars",function(){Ge.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1,this.def_variable(new pn({name:"arguments",start:this.start,end:this.end}))}),qe.DEFMETHOD("init_scope_vars",function(){Ge.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1}),on.DEFMETHOD("mark_enclosed",function(){for(var e=this.definition(),t=this.scope;t&&(d(t.enclosed,e),t!==e.scope);)t=t.parent_scope}),on.DEFMETHOD("reference",function(){this.definition().references.push(this),this.mark_enclosed()}),Ge.DEFMETHOD("find_variable",function(e){return e instanceof on&&(e=e.name),this.variables.get(e)||this.parent_scope&&this.parent_scope.find_variable(e)}),Ge.DEFMETHOD("def_function",function(e,t){var n=this.def_variable(e,t);return(!n.init||n.init instanceof Ye)&&(n.init=t),n}),Ge.DEFMETHOD("def_variable",function(e,t){var n=this.variables.get(e.name);return n?(n.orig.push(e),n.init&&(n.scope!==e.scope||n.init instanceof We)&&(n.init=t)):(n=new pi(this,e,t),this.variables.set(e.name,n),n.global=!this.parent_scope),e.thedef=n}),Ge.DEFMETHOD("next_mangled",function(e){return hi(this,e)}),Ke.DEFMETHOD("next_mangled",function(e){let t;const n=this.mangled_names;do{t=hi(this,e)}while(n.has(t));return t}),We.DEFMETHOD("next_mangled",function(e,t){for(var n=t.orig[0]instanceof pn&&this.name&&this.name.definition(),i=n?n.mangled_name||n.name:null;;){var r=hi(this,e);if(!i||i!=r)return r}}),on.DEFMETHOD("unmangleable",function(e){var t=this.definition();return!t||t.unmangleable(e)}),Sn.DEFMETHOD("unmangleable",s),on.DEFMETHOD("unreferenced",function(){return!this.definition().references.length&&!this.scope.pinned()}),on.DEFMETHOD("definition",function(){return this.thedef}),on.DEFMETHOD("global",function(){return this.thedef.global}),Ke.DEFMETHOD("mangle_names",function(e){var t=(e=_i(e)).nth_identifier,n=-1,i=[];e.keep_fnames&&(ci=new Set);const r=this.mangled_names=new Set;li=new Set,e.cache&&(this.globals.forEach(a),e.cache.props&&e.cache.props.forEach(function(e){r.add(e)}));var o=new qn(function(r,s){if(r instanceof we){var u=n;return s(),n=u,!0}if(r instanceof Ye&&!(o.parent()instanceof Ge)&&(fi=fi||new Set,fi.add(r.parent_scope.get_defun_scope())),r instanceof Ge)r.variables.forEach(a);else if(r.is_block_scope())r.block_scope.variables.forEach(a);else if(ci&&r instanceof Dt&&r.value instanceof Xe&&!r.value.name&&b(e.keep_fnames,r.name.name))ci.add(r.name.definition().id);else{if(r instanceof Sn){let e;do{e=t.get(++n)}while(x.has(e));return r.mangled_name=e,!0}!e.ie8&&!e.safari10&&r instanceof vn&&i.push(r.definition())}});function a(t){1&t.export?li.add(t.name):e.reserved.has(t.name)||i.push(t)}this.walk(o),(e.keep_fnames||e.keep_classnames)&&i.forEach(t=>{t.name.length<6&&t.unmangleable(e)&&li.add(t.name)}),i.forEach(t=>{t.mangle(e)}),ci=null,li=null,fi=null}),Ke.DEFMETHOD("find_colliding_names",function(e){const t=e.cache&&e.cache.props,n=new Set;return e.reserved.forEach(i),this.globals.forEach(r),this.walk(new qn(function(e){e instanceof Ge&&e.variables.forEach(r),e instanceof vn&&r(e.definition())})),n;function i(e){n.add(e)}function r(n){var r=n.name;if(n.global&&t&&t.has(r))r=t.get(r);else if(!n.unmangleable(e))return;i(r)}}),Ke.DEFMETHOD("expand_names",function(e){var t=(e=_i(e)).nth_identifier;t.reset&&t.sort&&(t.reset(),t.sort());var n=this.find_colliding_names(e),i=0;function r(r){if(r.global&&e.cache)return;if(r.unmangleable(e))return;if(e.reserved.has(r.name))return;const o=di(r),a=r.name=o?o.name:function(){var e;do{e=t.get(i++)}while(n.has(e)||x.has(e));return e}();r.orig.forEach(function(e){e.name=a}),r.references.forEach(function(e){e.name=a})}this.globals.forEach(r),this.walk(new qn(function(e){e instanceof Ge&&e.variables.forEach(r),e instanceof vn&&r(e.definition())}))}),De.DEFMETHOD("tail_node",c),Ot.DEFMETHOD("tail_node",function(){return this.expressions[this.expressions.length-1]}),Ke.DEFMETHOD("compute_char_frequency",function(e){var t=(e=_i(e)).nth_identifier;if(t.reset&&t.consider&&t.sort){t.reset();try{De.prototype.print=function(i,r){this._print(i,r),this instanceof on&&!this.unmangleable(e)?t.consider(this.name,-1):e.properties&&(this instanceof Mt?t.consider("#"+this.property,-1):this instanceof kt?t.consider(this.property,-1):this instanceof wt&&n(this.property))},t.consider(this.print_to_string(),1)}finally{De.prototype.print=De.prototype._print}t.sort()}function n(e){e instanceof Mn?t.consider(e.value,-1):e instanceof Lt?(n(e.consequent),n(e.alternative)):e instanceof Ot&&n(e.tail_node())}});const mi=(()=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""),t="0123456789".split("");let n,i;function r(){i=new Map,e.forEach(function(e){i.set(e,0)}),t.forEach(function(e){i.set(e,0)})}function o(e,t){return i.get(t)-i.get(e)}function a(){n=m(e,o).concat(m(t,o))}return r(),a(),{get:function(e){var t="",i=54;e++;do{e--,t+=n[e%i],e=Math.floor(e/i),i=64}while(e>0);return t},consider:function(e,t){for(var n=e.length;--n>=0;)i.set(e[n],i.get(e[n])+t)},reset:r,sort:a}})();let gi;De.prototype.size=function(e,t){gi=e&&e._mangle_options;let n=0;return zn(this,(e,t)=>{if(n+=e._size(t),e instanceof qe&&e.is_braceless())return n+=e.body[0].value._size(t),!0},t||e&&e.stack),gi=void 0,n},De.prototype._size=()=>0,ye.prototype._size=()=>8,Ae.prototype._size=function(){return 2+this.value.length};const Ei=e=>e.length&&e.length-1;Oe.prototype._size=function(){return 2+Ei(this.body)},Ke.prototype._size=function(){return Ei(this.body)},ke.prototype._size=()=>1,we.prototype._size=()=>2,Ne.prototype._size=()=>9,Pe.prototype._size=()=>7,Be.prototype._size=()=>8,Le.prototype._size=()=>8,Ue.prototype._size=()=>6,He.prototype._size=()=>3;const vi=e=>(e.is_generator?1:0)+(e.async?6:0);ze.prototype._size=function(){return vi(this)+4+Ei(this.argnames)+Ei(this.body)},We.prototype._size=function(e){return 2*!!ti(e)+vi(this)+12+Ei(this.argnames)+Ei(this.body)},Ye.prototype._size=function(){return vi(this)+13+Ei(this.argnames)+Ei(this.body)},qe.prototype._size=function(){let e=2+Ei(this.argnames);1===this.argnames.length&&this.argnames[0]instanceof on||(e+=2);const t=this.is_braceless()?0:Ei(this.body)+2;return vi(this)+e+t},$e.prototype._size=()=>2,Ze.prototype._size=function(){return 2+3*Math.floor(this.segments.length/2)},Qe.prototype._size=function(){return this.value.length},tt.prototype._size=function(){return this.value?7:6},nt.prototype._size=()=>6,rt.prototype._size=function(){return this.label?6:5},ot.prototype._size=function(){return this.label?9:8},ut.prototype._size=()=>4,ct.prototype._size=function(){return 8+Ei(this.body)},pt.prototype._size=function(){return 5+Ei(this.body)},ft.prototype._size=function(){return 8+Ei(this.body)},dt.prototype._size=()=>3,_t.prototype._size=function(){let e=7+Ei(this.body);return this.argname&&(e+=2),e},mt.prototype._size=function(){return 7+Ei(this.body)},Et.prototype._size=function(){return 4+Ei(this.definitions)},vt.prototype._size=function(){return 4+Ei(this.definitions)},bt.prototype._size=function(){return 6+Ei(this.definitions)},Dt.prototype._size=function(){return this.value?1:0},St.prototype._size=function(){return this.name?4:0},yt.prototype._size=function(){let e=6;return this.imported_name&&(e+=1),(this.imported_name||this.imported_names)&&(e+=5),this.imported_names&&(e+=2+Ei(this.imported_names)),e},At.prototype._size=()=>11,Tt.prototype._size=function(){let e=7+(this.is_default?8:0);return this.exported_value&&(e+=this.exported_value._size()),this.exported_names&&(e+=2+Ei(this.exported_names)),this.module_name&&(e+=5),e},Ct.prototype._size=function(){return this.optional?4+Ei(this.args):2+Ei(this.args)},Rt.prototype._size=function(){return 6+Ei(this.args)},Ot.prototype._size=function(){return Ei(this.expressions)},kt.prototype._size=function(){return this.optional?this.property.length+2:this.property.length+1},Mt.prototype._size=function(){return this.optional?this.property.length+3:this.property.length+2},wt.prototype._size=function(){return this.optional?4:2},It.prototype._size=function(){return"typeof"===this.operator?7:"void"===this.operator?5:this.operator.length},Bt.prototype._size=function(e){if("in"===this.operator)return 4;let t=this.operator.length;return("+"===this.operator||"-"===this.operator)&&this.right instanceof It&&this.right.operator===this.operator&&(t+=1),this.needs_parens(e)&&(t+=2),t},Lt.prototype._size=()=>3,Gt.prototype._size=function(){return 2+Ei(this.elements)},Kt.prototype._size=function(e){let t=2;return ti(e)&&(t+=2),t+Ei(this.properties)};const bi=e=>"string"==typeof e?e.length:0;Xt.prototype._size=function(){return bi(this.key)+1};const Di=e=>e?7:0;Yt.prototype._size=function(){return 5+Di(this.static)+bi(this.key)},qt.prototype._size=function(){return 5+Di(this.static)+bi(this.key)},$t.prototype._size=function(){return Di(this.static)+bi(this.key)},jt.prototype._size=function(){return $t.prototype._size.call(this)+1},Wt.prototype._size=function(){return $t.prototype._size.call(this)+4},zt.prototype._size=function(){return $t.prototype._size.call(this)+4},en.prototype._size=function(){return 5},Zt.prototype._size=function(){return(this.name?8:7)+(this.extends?8:0)},nn.prototype._size=function(){return 8+Ei(this.body)},Qt.prototype._size=function(){return Di(this.static)+("string"==typeof this.key?this.key.length+2:0)+(this.value?1:0)},Jt.prototype._size=function(){return Qt.prototype._size.call(this)+1},on.prototype._size=function(){return gi&&this.thedef&&!this.thedef.unmangleable(gi)?1:this.name.length},_n.prototype._size=function(){return this.name.length},yn.prototype._size=sn.prototype._size=function(){return"arguments"===this.name?9:on.prototype._size.call(this)},an.prototype._size=()=>10,Dn.prototype._size=function(){return this.name.length},Tn.prototype._size=function(){return this.name.length},On.prototype._size=()=>4,Fn.prototype._size=()=>5,Mn.prototype._size=function(){return this.value.length+2},wn.prototype._size=function(){const{value:e}=this;return 0===e?1:e>0&&Math.floor(e)===e?Math.floor(Math.log10(e)+1):e.toString().length},xn.prototype._size=function(){return this.value.length},In.prototype._size=function(){return this.value.toString().length},Pn.prototype._size=()=>4,Bn.prototype._size=()=>3,Ln.prototype._size=()=>6,Vn.prototype._size=()=>0,Un.prototype._size=()=>8,Hn.prototype._size=()=>4,Kn.prototype._size=()=>5,at.prototype._size=()=>6,st.prototype._size=()=>6;const Si=32,yi=256,Ai=1024,Ti=(e,t)=>e.flags&t,Ci=(e,t)=>{e.flags|=t},Ri=(e,t)=>{e.flags&=~t};function Oi(e,t){return t instanceof Ot?e.push(...t.expressions):e.push(t),e}function Fi(e,t){if(1==t.length)return t[0];if(0==t.length)throw new Error("trying to create a sequence with length zero!");return p(Ot,e,{expressions:t.reduce(Oi,[])})}function ki(e){return p(We,e,{uses_arguments:!1,argnames:[],body:[],is_generator:!1,async:!1,variables:new Map,uses_with:!1,uses_eval:!1,parent_scope:null,enclosed:[],cname:0,block_scope:void 0})}function Mi(e,t){switch(typeof e){case"string":return p(Mn,t,{value:e});case"number":return isNaN(e)?p(Bn,t):isFinite(e)?1/e<0?p(Nt,t,{operator:"-",expression:p(wn,t,{value:-e})}):p(wn,t,{value:e}):e<0?p(Nt,t,{operator:"-",expression:p(Un,t)}):p(Un,t);case"bigint":return p(xn,t,{value:e.toString()});case"boolean":return p(e?Hn:Kn,t);case"undefined":return p(Ln,t);default:if(null===e)return p(Pn,t,{value:null});if(e instanceof RegExp)return p(In,t,{value:{source:S(e.source),flags:e.flags}});throw new Error(h("Can't handle constant of type: {type}",{type:typeof e}))}}function wi(e,t){return e.size()>t.size()?t:e}function xi(e,t,n){return ti(e)?function(e,t){return wi(p(Te,e,{body:e}),p(Te,t,{body:t})).body}(t,n):wi(t,n)}function Ii(e){return e instanceof kn?e.getValue():e instanceof Nt&&"void"==e.operator&&e.expression instanceof kn?void 0:e}function Ni(e,t){if(!((t=Ii(t))instanceof De)){var n;if(e instanceof Gt){var i=e.elements;if("length"==t)return Mi(i.length,e);"number"==typeof t&&t in i&&(n=i[t])}else if(e instanceof Kt){t=""+t;for(var r=e.properties,o=r.length;--o>=0;){if(!(r[o]instanceof Xt))return;n||r[o].key!==t||(n=r[o].value)}}return n instanceof yn&&n.fixed_value()||n}}function Pi(e,t){var n=!1,i=new qn(function(t){return!!(n||t instanceof Ge)||(t instanceof it&&i.loopcontrol_target(t)===e?n=!0:void 0)});return t instanceof we&&i.push(t),i.push(e),e.body.walk(i),n}function Bi(e,t,n){if(Li(e,t,n)){return Fi(t,[p(wn,t,{value:0}),n])}return n}function Li(e,t,n){return e instanceof Nt&&"delete"==e.operator||e instanceof Ct&&e.expression===t&&(n instanceof xt||n instanceof Ft||n instanceof yn&&"eval"==n.name)}function Vi(e){return e instanceof qe||e instanceof We}function Ui(e){return"Call"==e.TYPE&&(e.expression instanceof We||Ui(e.expression))}function Gi(e){return null===e||(e instanceof ke||e instanceof Fe&&0==e.body.length)}const Ki=g("Infinity NaN undefined");function Hi(e){return e instanceof Un||e instanceof Bn||e instanceof Ln}function Xi(e,t){if(!(e instanceof yn))return!1;for(var n=e.definition().orig,i=n.length;--i>=0;)if(n[i]instanceof t)return!0}function zi(e){return!(e instanceof tn||e instanceof Ye||e instanceof vt||e instanceof bt||e instanceof Tt||e instanceof yt)}function Wi(e){if(null===e)return[];if(e instanceof Fe)return e.body;if(e instanceof ke)return[];if(e instanceof Se)return[e];throw new Error("Can't convert thing to statement array")}function qi(e,t){const n=e=>{if(e instanceof yn&&t.includes(e.definition()))return Wn};return zn(e,(t,i)=>{if(t instanceof Ge&&t!==e){var r=i.parent();if(r instanceof Ct&&r.expression===t&&!t.async&&!t.is_generator)return;return!Xn(t,n)||Wn}})}function Yi(e,t){for(var n,i=0;n=e.parent(i);i++)if(n instanceof Xe||n instanceof Zt){var r=n.name;if(r&&r.definition()===t)return!0}return!1}function $i(e,t){return t.top_retain&&e instanceof Ye&&Ti(e,Ai)&&e.name&&t.top_retain(e.name.definition())}function ji(e){const t=new Map;for(var n of Object.keys(e))t.set(n,g(e[n]));return(e,n)=>{const i=t.get(e);return null!=i&&i.has(n)}}const Zi=new Set(["Number","String","Array","Object","Function","Promise"]),Qi=["constructor","toString","valueOf"],Ji=ji({Array:["at","flat","includes","indexOf","join","lastIndexOf","slice",...Qi],Boolean:Qi,Function:Qi,Number:["toExponential","toFixed","toPrecision",...Qi],Object:Qi,RegExp:["test",...Qi],String:["at","charAt","charCodeAt","charPointAt","concat","endsWith","fromCharCode","fromCodePoint","includes","indexOf","italics","lastIndexOf","localeCompare","match","matchAll","normalize","padStart","padEnd","repeat","replace","replaceAll","search","slice","split","startsWith","substr","substring","repeat","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimEnd","trimStart",...Qi]}),er=ji({Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","hasOwn","keys"],String:["fromCharCode"]}),tr=ji({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]}),nr=e=>e instanceof yn&&e.definition().undeclared,ir=g("<<< >> << & | ^ ~"),rr=g("&& || ??"),or=g("delete ++ --");var ar,sr;function ur(e,t){return Ti(e,8)||e instanceof Ln||e instanceof Nt&&"void"==e.operator&&!e.expression.has_side_effects(t)}function cr(e,t){let n;return e instanceof Pn||ur(e,t)||e instanceof yn&&(n=e.definition().fixed)instanceof De&&fr(n,t)}function lr(e,t){return e instanceof Ft||e instanceof Ct?e.optional&&cr(e.expression,t)||lr(e.expression,t):e instanceof xt&&lr(e.expression,t)}function fr(e,t){return!!cr(e,t)||lr(e,t)}function pr(e,t){return t instanceof It&&or.has(t.operator)?t.expression:t instanceof Vt&&t.left===e||t instanceof Le&&t.init===e?e:void 0}!function(e){const t=g("! delete"),n=g("in instanceof == != === !== < <= >= >");e(De,s),e(Nt,function(){return t.has(this.operator)}),e(Bt,function(){return n.has(this.operator)||rr.has(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()}),e(Lt,function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()}),e(Vt,function(){return"="==this.operator&&this.right.is_boolean()}),e(Ot,function(){return this.tail_node().is_boolean()}),e(Hn,u),e(Kn,u)}(function(e,t){e.DEFMETHOD("is_boolean",t)}),function(e){e(De,s),e(wn,u);const t=g("+ - ~ ++ --");e(It,function(e){return t.has(this.operator)&&this.expression.is_number(e)});const n=g("- * / % & | ^ << >> >>>");e(Bt,function(e){return"+"===this.operator?this.left.is_number(e)&&this.right.is_number_or_bigint(e)||this.right.is_number(e)&&this.left.is_number_or_bigint(e):!!n.has(this.operator)&&(this.left.is_number(e)||this.right.is_number(e))}),e(Vt,function(e){return("="===this.operator||n.has(this.operator.slice(0,-1)))&&this.right.is_number(e)}),e(Ot,function(e){return this.tail_node().is_number(e)}),e(Lt,function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)})}(function(e,t){e.DEFMETHOD("is_number",t)}),function(e){e(De,s),e(xn,u);const t=g("+ - ~ ++ --");e(It,function(e){return t.has(this.operator)&&this.expression.is_bigint(e)});const n=g("- * / % & | ^ << >>");e(Bt,function(e){return"+"===this.operator?this.left.is_bigint(e)&&this.right.is_number_or_bigint(e)||this.right.is_bigint(e)&&this.left.is_number_or_bigint(e):!!n.has(this.operator)&&(this.left.is_bigint(e)||this.right.is_bigint(e))}),e(Vt,function(e){return(n.has(this.operator.slice(0,-1))||"="==this.operator)&&this.right.is_bigint(e)}),e(Ot,function(e){return this.tail_node().is_bigint(e)}),e(Lt,function(e){return this.consequent.is_bigint(e)&&this.alternative.is_bigint(e)})}(function(e,t){e.DEFMETHOD("is_bigint",t)}),function(e){e(De,s),e(wn,u),e(xn,u);const t=g("+ - ~ ++ --");e(It,function(e){return t.has(this.operator)});const n=g("- * / % & | ^ << >>");e(Bt,function(e){return"+"===this.operator?this.left.is_number_or_bigint(e)&&this.right.is_number_or_bigint(e):n.has(this.operator)}),e(Vt,function(e){return n.has(this.operator.slice(0,-1))||"="==this.operator&&this.right.is_number_or_bigint(e)}),e(Ot,function(e){return this.tail_node().is_number_or_bigint(e)}),e(Lt,function(e){return this.consequent.is_number_or_bigint(e)&&this.alternative.is_number_or_bigint(e)})}(function(e,t){e.DEFMETHOD("is_number_or_bigint",t)}),(ar=function(e,t){e.DEFMETHOD("is_32_bit_integer",t)})(De,s),ar(wn,function(e){return this.value===(0|this.value)}),ar(Nt,function(e){return"~"==this.operator?this.expression.is_number(e):"+"===this.operator&&this.expression.is_32_bit_integer(e)}),ar(Bt,function(e){return ir.has(this.operator)&&(this.left.is_number(e)||this.right.is_number(e))}),(sr=function(e,t){e.DEFMETHOD("is_string",t)})(De,s),sr(Mn,u),sr(Ze,u),sr(Nt,function(){return"typeof"==this.operator}),sr(Bt,function(e){return"+"==this.operator&&(this.left.is_string(e)||this.right.is_string(e))}),sr(Vt,function(e){return("="==this.operator||"+="==this.operator)&&this.right.is_string(e)}),sr(Ot,function(e){return this.tail_node().is_string(e)}),sr(Lt,function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)}),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return!0;return!1}e(De,u),e(ke,s),e(kn,s),e(On,s),e(Oe,function(e){return t(this.body,e)}),e(Ct,function(e){return!(this.is_callee_pure(e)||this.expression.is_call_pure(e)&&!this.expression.has_side_effects(e))||t(this.args,e)}),e(ct,function(e){return this.expression.has_side_effects(e)||t(this.body,e)}),e(pt,function(e){return this.expression.has_side_effects(e)||t(this.body,e)}),e(dt,function(e){return this.body.has_side_effects(e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)}),e(ut,function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)}),e(At,s),e(we,function(e){return this.body.has_side_effects(e)}),e(Te,function(e){return this.body.has_side_effects(e)}),e(Xe,s),e(Zt,function(e){return!(!this.extends||!this.extends.has_side_effects(e))||t(this.properties,e)}),e(nn,function(e){return t(this.body,e)}),e(Bt,function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)}),e(Vt,u),e(Lt,function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)}),e(It,function(e){return or.has(this.operator)||this.expression.has_side_effects(e)}),e(yn,function(e){return!this.is_declared(e)&&!Zi.has(this.name)}),e(_n,s),e(sn,s),e(Kt,function(e){return t(this.properties,e)}),e(Xt,function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value&&this.value.has_side_effects(e)}),e([Qt,Jt],function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)}),e([jt,Wt,zt,$t,Yt,qt],function(e){return this.computed_key()&&this.key.has_side_effects(e)}),e(Gt,function(e){return t(this.elements,e)}),e(kt,function(e){return fr(this,e)?this.expression.has_side_effects(e):!(this.optional||!this.expression.may_throw_on_access(e))||this.expression.has_side_effects(e)}),e(wt,function(e){if(fr(this,e))return this.expression.has_side_effects(e);if(!this.optional&&this.expression.may_throw_on_access(e))return!0;var t=this.property.has_side_effects(e);return!(!t||!this.optional)||(t||this.expression.has_side_effects(e))}),e(xt,function(e){return this.expression.has_side_effects(e)}),e(Ot,function(e){return t(this.expressions,e)}),e(gt,function(e){return t(this.definitions,e)}),e(Dt,function(){return null!=this.value}),e(Qe,s),e(Ze,function(e){return t(this.segments,e)})}(function(e,t){for(const n of[].concat(e))n.DEFMETHOD("has_side_effects",t)}),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return!0;return!1}e(De,u),e(kn,s),e(ke,s),e(Xe,s),e(sn,s),e(On,s),e(At,s),e(Zt,function(e){return!(!this.extends||!this.extends.may_throw(e))||t(this.properties,e)}),e(nn,function(e){return t(this.body,e)}),e(Gt,function(e){return t(this.elements,e)}),e(Vt,function(e){return!!this.right.may_throw(e)||!(!e.has_directive("use strict")&&"="==this.operator&&this.left instanceof yn)&&this.left.may_throw(e)}),e(Bt,function(e){return this.left.may_throw(e)||this.right.may_throw(e)}),e(Oe,function(e){return t(this.body,e)}),e(Ct,function(e){return!fr(this,e)&&(!!t(this.args,e)||!this.is_callee_pure(e)&&(!!this.expression.may_throw(e)||(!(this.expression instanceof Xe)||t(this.expression.body,e))))}),e(pt,function(e){return this.expression.may_throw(e)||t(this.body,e)}),e(Lt,function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)}),e(gt,function(e){return t(this.definitions,e)}),e(ut,function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)}),e(we,function(e){return this.body.may_throw(e)}),e(Kt,function(e){return t(this.properties,e)}),e(Xt,function(e){return!!(this.computed_key()&&this.key.may_throw(e)||this.value)&&this.value.may_throw(e)}),e([Qt,Jt],function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)}),e([$t,Yt,qt],function(e){return this.computed_key()&&this.key.may_throw(e)}),e([jt,Wt,zt],s),e(tt,function(e){return this.value&&this.value.may_throw(e)}),e(Ot,function(e){return t(this.expressions,e)}),e(Te,function(e){return this.body.may_throw(e)}),e(kt,function(e){return!fr(this,e)&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e))}),e(wt,function(e){return!fr(this,e)&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e))}),e(xt,function(e){return this.expression.may_throw(e)}),e(ct,function(e){return this.expression.may_throw(e)||t(this.body,e)}),e(yn,function(e){return!this.is_declared(e)&&!Zi.has(this.name)}),e(_n,s),e(dt,function(e){return this.bcatch?this.bcatch.may_throw(e):this.body.may_throw(e)||this.bfinally&&this.bfinally.may_throw(e)}),e(It,function(e){return!("typeof"==this.operator&&this.expression instanceof yn)&&this.expression.may_throw(e)}),e(Dt,function(e){return!!this.value&&this.value.may_throw(e)})}(function(e,t){for(const n of[].concat(e))n.DEFMETHOD("may_throw",t)}),function(e){function n(e){let n=!0;return Xn(this,i=>{if(i instanceof yn){if(Ti(this,16))return n=!1,Wn;var r=i.definition();if(t(r,this.enclosed)&&!this.variables.has(r.name)){if(e){var o=e.find_variable(i);if(r.undeclared?!o:o===r)return n="f",!0}return n=!1,Wn}return!0}if(i instanceof On&&this instanceof qe)return n=!1,Wn}),n}e(De,s),e(kn,u),e(Zt,function(e){if(this.extends&&!this.extends.is_constant_expression(e))return!1;for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e))return!1;if(t.static&&t.value&&!t.value.is_constant_expression(e))return!1;if(t instanceof nn)return!1}return n.call(this,e)}),e(Xe,n),e(It,function(){return this.expression.is_constant_expression()}),e(Bt,function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()}),e(Gt,function(){return this.elements.every(e=>e.is_constant_expression())}),e(Kt,function(){return this.properties.every(e=>e.is_constant_expression())}),e(Ht,function(){return!(this.key instanceof De||!this.value||!this.value.is_constant_expression())})}(function(e,t){e.DEFMETHOD("is_constant_expression",t)}),function(e){function t(e){return/strict/.test(e.option("pure_getters"))}De.DEFMETHOD("may_throw_on_access",function(e){return!e.option("pure_getters")||this._dot_throw(e)}),e(De,t),e(Pn,u),e(Ln,u),e(kn,s),e(Gt,s),e(Kt,function(e){if(!t(e))return!1;for(var n=this.properties.length;--n>=0;)if(this.properties[n]._dot_throw(e))return!0;return!1}),e(Zt,s),e(Ht,s),e(Yt,u),e(He,function(e){return this.expression._dot_throw(e)}),e(We,s),e(qe,s),e(Pt,s),e(Nt,function(){return"void"==this.operator}),e(Bt,function(e){return("&&"==this.operator||"||"==this.operator||"??"==this.operator)&&(this.left._dot_throw(e)||this.right._dot_throw(e))}),e(Vt,function(e){return!!this.logical||"="==this.operator&&this.right._dot_throw(e)}),e(Lt,function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)}),e(kt,function(e){return!!t(e)&&("prototype"!=this.property||!(this.expression instanceof We||this.expression instanceof Zt))}),e(xt,function(e){return this.expression._dot_throw(e)}),e(Ot,function(e){return this.tail_node()._dot_throw(e)}),e(yn,function(e){if("arguments"===this.name&&this.scope instanceof Xe)return!1;if(Ti(this,8))return!0;if(!t(e))return!1;if(nr(this)&&this.is_declared(e))return!1;if(this.is_immutable())return!1;var n=this.fixed_value();return!n||n._dot_throw(e)})}(function(e,t){e.DEFMETHOD("_dot_throw",t)}),function(e){function t(e){return p(Nt,e,{operator:"!",expression:e})}function n(e,n,i){var r=t(e);if(i){var o=p(Te,n,{body:n});return wi(r,o)===o?n:r}return wi(r,n)}e(De,function(){return t(this)}),e(Se,function(){throw new Error("Cannot negate a statement")}),e(We,function(){return t(this)}),e(Zt,function(){return t(this)}),e(qe,function(){return t(this)}),e(Nt,function(){return"!"==this.operator?this.expression:t(this)}),e(Ot,function(e){var t=this.expressions.slice();return t.push(t.pop().negate(e)),Fi(this,t)}),e(Lt,function(e,t){var i=this.clone();return i.consequent=i.consequent.negate(e),i.alternative=i.alternative.negate(e),n(this,i,t)}),e(Bt,function(e,i){var r=this.clone(),o=this.operator;if(e.option("unsafe_comps"))switch(o){case"<=":return r.operator=">",r;case"<":return r.operator=">=",r;case">=":return r.operator="<",r;case">":return r.operator="<=",r}switch(o){case"==":return r.operator="!=",r;case"!=":return r.operator="==",r;case"===":return r.operator="!==",r;case"!==":return r.operator="===",r;case"&&":return r.operator="||",r.left=r.left.negate(e,i),r.right=r.right.negate(e),n(this,r,i);case"||":return r.operator="&&",r.left=r.left.negate(e,i),r.right=r.right.negate(e),n(this,r,i)}return t(this)})}(function(e,t){e.DEFMETHOD("negate",function(e,n){return t.call(this,e,n)})}),function(e){function t(e){return p(Nt,e,{operator:"~",expression:e})}e(De,function(e){return t(this)}),e(wn,function(e){const n=~this.value;return n.toString().length>this.value.toString().length?t(this):p(wn,this,{value:n})}),e(Nt,function(e,n){return"~"==this.operator&&(this.expression.is_32_bit_integer(e)||(null!=n?n:e.in_32_bit_context()))?this.expression:t(this)})}(function(e,t){e.DEFMETHOD("bitwise_negate",t)});var dr=g("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");Ct.DEFMETHOD("is_callee_pure",function(e){if(e.option("unsafe")){var t=this.expression,n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&"hasOwnProperty"===t.expression.name&&(null==n||n.thedef&&n.thedef.undeclared))return!1;if(nr(t)&&dr.has(t.name))return!0;if(t instanceof kt&&nr(t.expression)&&er(t.expression.name,t.property))return!0}return!!(this instanceof Rt&&e.option("pure_new"))||(!(!e.option("side_effects")||!T(this,$n))||!e.pure_funcs(this))}),De.DEFMETHOD("is_call_pure",s),kt.DEFMETHOD("is_call_pure",function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;return t instanceof Gt?n="Array":t.is_boolean()?n="Boolean":t.is_number(e)?n="Number":t instanceof In?n="RegExp":t.is_string(e)?n="String":this.may_throw_on_access(e)||(n="Object"),null!=n&&Ji(n,this.property)});const hr=e=>e&&e.aborts();function _r(e,t,n,i,r,o){var a=t.parent(r),s=pr(n,a);if(s)return s;if(!o&&a instanceof Ct&&a.expression===n&&!(i instanceof qe)&&!(i instanceof Zt)&&!a.is_callee_pure(e)&&(!(i instanceof We)||!(a instanceof Rt)&&i.contains_this()))return!0;if(a instanceof Gt)return _r(e,t,a,a,r+1);if(a instanceof Xt&&n===a.value){var u=t.parent(r+1);return _r(e,t,u,u,r+2)}if(a instanceof Ft&&a.expression===n){var c=Ni(i,a.property);return!o&&_r(e,t,a,c,r+1)}}function mr(e){for(let t,n,i=-1;t=e.parent(i),n=e.parent(i+1);i++){if(n instanceof Ot){if(n.expressions.indexOf(t)!==n.expressions.length-1){const t=e.parent(i+2);return!(n.expressions.length>2||1===n.expressions.length||!Li(t,n,n.expressions[1]))}continue}if(n instanceof It){const e=n.operator;if("void"===e)return!1;if("typeof"===e||"+"===e||"-"===e||"!"===e||"~"===e)continue}return!(n instanceof Te||n instanceof we)&&!(n instanceof Ge)}return!0}function gr(e,t){e.DEFMETHOD("_eval",t)}!function(e){function t(){for(var e=0;ee instanceof On?Wn:e!==this&&e instanceof Ge&&!(e instanceof qe)||void 0)});const Er=Symbol("This AST_Chain is nullish");De.DEFMETHOD("evaluate",function(e){if(!e.option("evaluate"))return this;var t=this._eval(e,1);if(!t||t instanceof RegExp)return t;if("function"==typeof t||"object"==typeof t||t==Er)return this;if("string"==typeof t){const n=this.size(e);if(t.length+2>n)return this}return t});var vr=g("! ~ - + void");De.DEFMETHOD("is_constant",function(){return this instanceof kn?!(this instanceof In):this instanceof Nt&&vr.has(this.operator)&&(this.expression instanceof kn||this.expression.is_constant())}),gr(Se,function(){throw new Error(h("Cannot evaluate a statement [{file}:{line},{col}]",this.start))}),gr(Xe,c),gr(Zt,c),gr(De,c),gr(kn,function(){return this.getValue()});const br="function"==typeof BigInt;gr(xn,function(){return br?BigInt(this.value):this}),gr(In,function(e){let t=e.evaluated_regexps.get(this.value);if(void 0===t&&A(this.value.source)){try{const{source:e,flags:n}=this.value;t=new RegExp(e,n)}catch(e){t=null}e.evaluated_regexps.set(this.value,t)}return t||this}),gr(Ze,function(){return 1!==this.segments.length?this:this.segments[0].value}),gr(We,function(e){if(e.option("unsafe")){var t=function(){};return t.node=this,t.toString=()=>this.print_to_string(),t}return this}),gr(Gt,function(e,t){if(e.option("unsafe")){for(var n=[],i=0,r=this.elements.length;i"object"==typeof e||"function"==typeof e||"symbol"==typeof e;gr(Bt,function(e,t){Sr.has(this.operator)||t++;var n=this.left._eval(e,t);if(n===this.left)return this;var i,r=this.right._eval(e,t);if(r===this.right)return this;if(null!=n&&null!=r&&yr.has(this.operator)&&Ar(n)&&Ar(r)&&typeof n==typeof r)return this;if("bigint"==typeof n!=("bigint"==typeof r)||"bigint"==typeof n&&(">>>"===this.operator||"/"===this.operator&&0===Number(r)))return this;switch(this.operator){case"&&":i=n&&r;break;case"||":i=n||r;break;case"??":i=null!=n?n:r;break;case"|":i=n|r;break;case"&":i=n&r;break;case"^":i=n^r;break;case"+":i=n+r;break;case"*":i=n*r;break;case"**":i=n**r;break;case"/":i=n/r;break;case"%":i=n%r;break;case"-":i=n-r;break;case"<<":i=n<>":i=n>>r;break;case">>>":i=n>>>r;break;case"==":i=n==r;break;case"===":i=n===r;break;case"!=":i=n!=r;break;case"!==":i=n!==r;break;case"<":i=n":i=n>r;break;case">=":i=n>=r;break;default:return this}return"number"==typeof i&&isNaN(i)&&e.find_parent(Ue)?this:i}),gr(Lt,function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var i=n?this.consequent:this.alternative,r=i._eval(e,t);return r===i?this:r});const Tr=new Set;gr(yn,function(e,t){if(Tr.has(this))return this;var n=this.fixed_value();if(!n)return this;Tr.add(this);const i=n._eval(e,t);if(Tr.delete(this),i===n)return this;if(i&&"object"==typeof i){var r=this.definition().escaped;if(r&&t>r)return this}return i});const Cr={Array,Math,Number,Object,String},Rr=new Set(["dotAll","global","ignoreCase","multiline","sticky","unicode"]);function Or(e,t){for(const n of[].concat(e))n.DEFMETHOD("drop_side_effect_free",t)}function Fr(e,t,n){var i=e.length;if(!i)return null;for(var r=[],o=!1,a=0;a!(e instanceof He))&&n.elements.every(t=>!t.has_side_effects(e)))return n.elements.length}if(e.option("unsafe")){var i=this.property;if(i instanceof De&&(i=i._eval(e,t))===this.property)return this;var r=this.expression;if(nr(r)){var o,a="hasOwnProperty"===r.name&&"call"===i&&(o=e.parent()&&e.parent().args)&&o&&o[0]&&o[0].evaluate(e);if(null==(a=a instanceof kt?a.expression:a)||a.thedef&&a.thedef.undeclared)return this.clone();if(!tr(r.name,i))return this;n=Cr[r.name]}else{if(n instanceof RegExp){if("source"==i)return S(n.source);if("flags"==i||Rr.has(i))return n[i]}if(!n||n===r||!v(n,i))return this;if("function"==typeof n)switch(i){case"name":return n.node.name?n.node.name.name:"";case"length":return n.node.length_property();default:return this}}return n[i]}return this}),gr(xt,function(e,t){const n=this.expression._eval(e,t);return n===Er?void 0:n===this.expression?this:n}),gr(Ct,function(e,t){var n=this.expression;const i=n._eval(e,t);if(i===Er||this.optional&&null==i)return Er;if(e.option("unsafe")&&n instanceof Ft){var r,o=n.property;if(o instanceof De&&(o=o._eval(e,t))===n.property)return this;var a=n.expression;if(nr(a)){var s="hasOwnProperty"===a.name&&"call"===o&&this.args[0]&&this.args[0].evaluate(e);if(null==(s=s instanceof kt?s.expression:s)||s.thedef&&s.thedef.undeclared)return this.clone();if(!er(a.name,o))return this;r=Cr[a.name]}else{if((r=a._eval(e,t+1))===a||!r)return this;if(!Ji(r.constructor.name,o))return this}for(var u=[],c=0,l=this.args.length;c{wr(e,t)})}function Nr(e){e.safe_ids=Object.create(e.safe_ids)}function Pr(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids)}function Br(e,t,n){e.safe_ids[t.id]=n}function Lr(e,t){if("m"==t.single_use)return!1;if(e.safe_ids[t.id]){if(null==t.fixed){var n=t.orig[0];if(n instanceof pn||"arguments"==n.name)return!1;t.fixed=p(Ln,n)}return!0}return t.fixed instanceof Ye}function Vr(e,t,n,i){if(void 0===t.fixed)return!0;let r;return null===t.fixed&&(r=e.defs_to_safe_ids.get(t.id))?(r[t.id]=!1,e.defs_to_safe_ids.delete(t.id),!0):!!v(e.safe_ids,t.id)&&(!!Lr(e,t)&&(!1!==t.fixed&&(!(null!=t.fixed&&(!i||t.references.length>t.assignments))&&(t.fixed instanceof Ye?i instanceof De&&t.fixed.parent_scope===n:t.orig.every(e=>!(e instanceof ln||e instanceof dn||e instanceof mn))))))}function Ur(e,t,n,i,r,o=0,a=1){var s=e.parent(o);if(r){if(r.is_constant())return;if(r instanceof rn)return}if(s instanceof Vt&&("="===s.operator||s.logical)&&i===s.right||s instanceof Ct&&(i!==s.expression||s instanceof Rt)||s instanceof et&&i===s.value&&i.scope!==t.scope||s instanceof Dt&&i===s.value||s instanceof st&&i===s.value&&i.scope!==t.scope)return!(a>1)||r&&r.is_constant_expression(n)||(a=1),void((!t.escaped||t.escaped>a)&&(t.escaped=a));if(s instanceof Gt||s instanceof at||s instanceof Bt&&rr.has(s.operator)||s instanceof Lt&&i!==s.condition||s instanceof He||s instanceof Ot&&i===s.tail_node())Ur(e,t,n,s,s,o+1,a);else if(s instanceof Xt&&i===s.value){var u=e.parent(o+1);Ur(e,t,n,u,u,o+2,a)}else if(s instanceof Ft&&i===s.expression&&(Ur(e,t,n,s,r=Ni(r,s.property),o+1,a+1),r))return;o>0||s instanceof Ot&&i!==s.tail_node()||s instanceof Te||(t.direct_access=!0)}Ge.DEFMETHOD("drop_unused",function(e){if(!e.option("unused"))return;if(e.has_directive("use asm"))return;if(!this.variables)return;var t=this;if(t.pinned())return;var n=!(t instanceof Ke)||e.toplevel.funcs,i=!(t instanceof Ke)||e.toplevel.vars;const r=kr.test(e.option("unused"))?s:function(e){return e instanceof Vt&&!e.logical&&(Ti(e,Si)||"="==e.operator)?e.left:e instanceof It&&Ti(e,Si)?e.expression:void 0};var o=new Map,a=new Map;t instanceof Ke&&e.top_retain&&t.variables.forEach(function(t){e.top_retain(t)&&o.set(t.id,t)});var u=new Map,c=new Map,l=this,d=new qn(function(r,s){if(r instanceof Xe&&r.uses_arguments&&!d.has_directive("use strict")&&r.argnames.forEach(function(e){if(e instanceof sn){var t=e.definition();o.set(t.id,t)}}),r===t)return;if(r instanceof Zt&&r.has_side_effects(e)&&(r.is_self_referential()?s():r.visit_nondeferred_class_parts(d)),r instanceof Ye||r instanceof tn){var f=r.name.definition();return(d.parent()instanceof Tt||!n&&l===t)&&f.global&&o.set(f.id,f),E(c,f.id,r),!0}const p=l===t;if(r instanceof pn&&p&&E(u,r.definition().id,r),r instanceof gt&&p){const t=d.parent()instanceof Tt;return r.definitions.forEach(function(n){if(n.name instanceof un&&E(u,n.name.definition().id,n),!t&&i||Xn(n.name,e=>{if(e instanceof sn){const t=e.definition();t.global&&o.set(t.id,t)}}),n.name instanceof $e&&n.walk(d),n.name instanceof sn&&n.value){var r=n.name.definition();E(c,r.id,n.value),r.chained||n.name.fixed_value()!==n.value||a.set(r.id,n),n.value.has_side_effects(e)&&n.value.walk(d)}}),!0}return m(r,s)});t.walk(d),d=new qn(m),o.forEach(function(e){var t=c.get(e.id);t&&t.forEach(function(e){e.walk(d)})});var h=new Yn(function(s,c,d){var m=h.parent();if(i){const t=r(s);if(t instanceof yn){var g=t.definition(),E=o.has(g.id);if(s instanceof Vt){if(!E||a.has(g.id)&&a.get(g.id)!==s){const t=s.right.transform(h);return E||t.has_side_effects(e)||mr(h)?Bi(m,s,t):d?f.skip:p(wn,s,{value:0})}}else if(!E)return d?f.skip:p(wn,s,{value:0})}}if(l===t){if(s.name&&(s instanceof rn&&!b(e.option("keep_classnames"),(g=s.name.definition()).name)||s instanceof We&&!b(e.option("keep_fnames"),(g=s.name.definition()).name))&&(!o.has(g.id)||g.orig.length>1)&&(s.name=null),s instanceof Xe&&!(s instanceof ze))for(var v=!e.option("keep_fargs")||m instanceof Ct&&m.expression===s&&!s.pinned()&&(!s.name||s.name.unreferenced()),D=s.argnames,S=D.length;--S>=0;){var y=D[S];y instanceof He&&(y=y.expression),y instanceof Ut&&(y=y.left),y instanceof $e||o.has(y.definition().id)?v=!1:(Ci(y,1),v&&D.pop())}if(s instanceof tn&&s!==t){const t=s.name.definition();c(s,this);if(!(t.global&&!n||o.has(t.id))){const n=s.drop_side_effect_free(e);return null==n?(t.eliminated++,d?f.skip:p(ke,s)):n}return s}if(s instanceof Ye&&s!==t){const e=s.name.definition();if(!(e.global&&!n||o.has(e.id)))return e.eliminated++,d?f.skip:p(ke,s)}if(s instanceof gt&&!(m instanceof Le&&m.init===s)){var A=!(m instanceof Ke||s instanceof Et),T=[],C=[],R=[],O=[];switch(s.definitions.forEach(function(t){t.value&&(t.value=t.value.transform(h));var n=t.name instanceof $e,r=n?new pi(null,{name:""}):t.name.definition();if(A&&r.global)return R.push(t);if(!i&&!A||n&&(t.name.names.length||t.name.is_array||1!=e.option("pure_getters"))||o.has(r.id)){if(t.value&&a.has(r.id)&&a.get(r.id)!==t&&(t.value=t.value.drop_side_effect_free(e)),t.name instanceof un){var c=u.get(r.id);if(c.length>1&&(!t.value||r.orig.indexOf(t.name)>r.eliminated)){if(t.value){var l=p(yn,t.name,t.name);r.references.push(l);var f=p(Vt,t,{operator:"=",logical:!1,left:l,right:t.value});a.get(r.id)===t&&a.set(r.id,f),O.push(f.transform(h))}return _(c,t),void r.eliminated++}}t.value?(O.length>0&&(R.length>0?(O.push(t.value),t.value=Fi(t.value,O)):T.push(p(Te,s,{body:Fi(s,O)})),O=[]),R.push(t)):C.push(t)}else if(r.orig[0]instanceof vn){(d=t.value&&t.value.drop_side_effect_free(e))&&O.push(d),t.value=null,C.push(t)}else{var d;(d=t.value&&t.value.drop_side_effect_free(e))&&O.push(d),r.eliminated++}}),(C.length>0||R.length>0)&&(s.definitions=C.concat(R),T.push(s)),O.length>0&&T.push(p(Te,s,{body:Fi(s,O)})),T.length){case 0:return d?f.skip:p(ke,s);case 1:return T[0];default:return d?f.splice(T):p(Fe,s,{body:T})}}if(s instanceof Be)return c(s,this),s.init instanceof Fe&&(F=s.init,s.init=F.body.pop(),F.body.push(s)),s.init instanceof Te?s.init=s.init.body:Gi(s.init)&&(s.init=null),F?d?f.splice(F.body):F:s;if(s instanceof we&&s.body instanceof Be){if(c(s,this),s.body instanceof Fe){var F=s.body;return s.body=F.body.pop(),F.body.push(s),d?f.splice(F.body):F}return s}if(s instanceof Fe)return c(s,this),d&&s.body.every(zi)?f.splice(s.body):s;if(s instanceof Ge&&!(s instanceof nn)){const e=l;return l=s,c(s,this),l=e,s}}},function(e,t){if(e instanceof Ot)switch(e.expressions.length){case 0:return t?f.skip:p(wn,e,{value:0});case 1:return e.expressions[0]}});function m(e,n){var i;const s=r(e);if(s instanceof yn&&!Xi(e.left,cn)&&t.variables.get(s.name)===(i=s.definition()))return e instanceof Vt&&(e.right.walk(d),i.chained||e.left.fixed_value()!==e.right||a.set(i.id,e)),!0;if(e instanceof yn){if(i=e.definition(),!o.has(i.id)&&(o.set(i.id,i),i.orig[0]instanceof vn)){const e=i.scope.is_block_scope()&&i.scope.get_defun_scope().variables.get(i.name);e&&o.set(e.id,e)}return!0}if(e instanceof Zt)return n(),!0;if(e instanceof Ge&&!(e instanceof nn)){var u=l;return l=e,n(),l=u,!0}}t.transform(h)}),Mr(De,a);const Gr=e=>Xn(e,e=>{if(e instanceof on){var t=e.definition();t&&(e instanceof yn&&t.references.push(e),t.fixed=!1)}});function Kr(e){const t=[];Xn(e,n=>{if(n!==e)return n instanceof Ye?(t.push(n),!0):n instanceof Ge||n instanceof Te||void 0});const n=new Map,i=new Map,r=new Set,o=new Set;for(const a of t){const t=a.name.definition(),s=[];for(const i of a.enclosed)!1!==i.fixed&&i!==t&&i.scope.get_defun_scope()===e&&(r.add(i.id),0===i.assignments&&1===i.orig.length&&i.orig[0]instanceof dn?(o.add(i.id),r.add(i.id),o.add(t.id),r.add(t.id),n.has(t.id)||n.set(t.id,[]),n.get(t.id).push(i.id)):s.push(i));s.length&&(i.set(t.id,s),o.add(t.id),r.add(t.id))}if(!i.size)return;let a=1;const s=new Map,u=new Map;zn(e,(e,t)=>{if(e instanceof on&&e.thedef){const n=e.definition().id;a++,r.has(n)&&(e instanceof sn||pr(e,t.parent()))&&u.set(n,a),o.has(n)&&(s.has(n)||Yi(t,n)||s.set(n,a))}});for(const[e,t]of s){const i=new Set(n.get(e));for(const e of i){let r=s.get(e);if(!(null!=r&&r{if(i instanceof Et){const e=(o=[],(r=i).definitions.forEach(function(e){e.name instanceof sn?(e.value=null,o.push(e)):e.declarations_as_names().forEach(t=>{o.push(p(Dt,e,{name:t,value:null}))})}),o.length?p(Et,r,{definitions:o}):null);return e&&n.push(e),!0}var r,o;return i instanceof Ye&&(i===t||!e.has_directive("use strict"))?(n.push(i===t?i:p(Et,i,{definitions:[p(Dt,i,{name:p(un,i.name,i.name),value:null})]})),!0):i instanceof Tt||i instanceof yt?(n.push(i),!0):i instanceof Ge||void 0})}function Wr(e,n){const i=n.find_scope(),r=i.get_defun_scope(),{in_loop:o,in_try:a}=function(){var e=n.self(),t=0,i=!1,r=!1;do{if(e instanceof xe)i=!0;else{if(e instanceof Ge)break;e instanceof ht&&(r=!0)}}while(e=n.parent(t++));return{in_loop:i,in_try:r}}();var s,u=10;do{s=!1,l(e),n.option("dead_code")&&h(e,n),n.option("if_return")&&d(e,n),n.sequences_limit>0&&(g(e,n),v(e,n)),n.option("join_vars")&&D(e),n.option("collapse_vars")&&c(e,n)}while(s&&u-- >0);function c(e,n){if(i.pinned()||r.pinned())return e;for(var u,c=[],l=e.length,d=new Yn(function(e){if(k)return e;if(!F)return e!==_[m]?e:++m<_.length?N(e):(F=!0,(v=U(e,0))===e&&(k=!0),e);var t,r=d.parent();if(e instanceof Vt&&(e.logical||"="!=e.operator&&D.equivalent_to(e.left))||e instanceof at||e instanceof Ct&&D instanceof Ft&&D.equivalent_to(e.expression)||(e instanceof Ct||e instanceof Ft)&&e.optional||e instanceof ye||e instanceof $e||e instanceof He&&e.expression instanceof on&&(e.expression instanceof On||e.expression.definition().references.length>1)||e instanceof xe&&!(e instanceof Be)||e instanceof it||e instanceof dt||e instanceof Ue||e instanceof st||e instanceof Tt||e instanceof Zt||r instanceof Be&&e!==r.init||!C&&e instanceof yn&&!e.is_declared(n)&&!Zi.has(e)||e instanceof yn&&r instanceof Ct&&T(r,Zn)||e instanceof Ht&&e.key instanceof De)return k=!0,e;if(b||y&&C||!(r instanceof Bt&&rr.has(r.operator)&&r.left!==e||r instanceof Lt&&r.condition!==e||r instanceof ut&&r.condition!==e)||(b=r),w&&!(e instanceof sn)&&D.equivalent_to(e)&&!function(e,t){for(const{def:n}of t.values()){const t=e.find_variable(n.name);if(t){if(t===n)continue;return!0}}return!1}(d.find_scope()||i,S)){if(b)return k=!0,e;if(pr(e,r))return E&&M++,e;if(M++,E&&g instanceof Dt)return e;if(s=k=!0,g instanceof Pt)return p(Nt,g,g);if(g instanceof Dt){var o=g.name.definition(),u=g.value;return o.references.length-o.replaced!=1||n.exposed(o)?p(Vt,g,{operator:"=",logical:!1,left:p(yn,g.name,g.name),right:u}):(o.replaced++,O&&Hi(u)?u.transform(n):Bi(r,e,u))}return Ri(g,Si),g}return(e instanceof Ct||e instanceof et&&(A||D instanceof Ft||Y(D))||e instanceof Ft&&(A||e.expression.may_throw_on_access(n))||e instanceof yn&&(S.has(e.name)&&S.get(e.name).modified||A&&Y(e))||e instanceof Dt&&e.value&&(S.has(e.name.name)||A&&Y(e.name))||(t=pr(e.left,e))&&(t instanceof Ft||S.has(t.name))||R&&(a?e.has_side_effects(n):$(e)))&&(v=e,e instanceof Ge&&(k=!0)),N(e)},function(e){k||(v===e&&(k=!0),b===e&&(b=null))}),h=new Yn(function(e){if(k)return e;if(!F){if(e!==_[m])return e;if(++m<_.length)return;return F=!0,e}return e instanceof yn&&e.name==I.name?(--M||(k=!0),pr(e,h.parent())?e:(I.replaced++,E.replaced--,g.value)):e instanceof ft||e instanceof Ge?e:void 0});--l>=0;){0==l&&n.option("unused")&&L();var _=[];for(V(e[l]);c.length>0;){_=c.pop();var m=0,g=_[_.length-1],E=null,v=null,b=null,D=G(g);if(D&&!Xr(D)&&!D.has_side_effects(n)){var S=H(g),y=z(D);D instanceof yn&&S.set(D.name,{def:D.definition(),modified:!1});var A=W(g),C=q(),R=g.may_throw(n),O=g.name instanceof pn,F=O,k=!1,M=0,w=!u||!F;if(!w){for(let e=n.self().argnames.lastIndexOf(g.name)+1;!k&&eM)M=!1;else{k=!1,m=0,F=O;for(x=l;!k&&x{if(e instanceof at)return Wn})}function L(){var e,i=n.self();if(Vi(i)&&!i.name&&!i.uses_arguments&&!i.pinned()&&(e=n.parent())instanceof Ct&&e.expression===i&&e.args.every(B)){var r=n.has_directive("use strict");r&&!t(r,i.body)&&(r=!1);var o=i.argnames.length;u=e.args.slice(o);for(var a=new Set,s=o;--s>=0;){var l=i.argnames[s],f=e.args[s];const t=l.definition&&l.definition();if(!(t&&t.orig.length>1)&&(u.unshift(p(Dt,l,{name:l,value:f})),!a.has(l.name)))if(a.add(l.name),l instanceof He){var d=e.args.slice(s);d.every(e=>!P(i,e,r))&&c.unshift([p(Dt,l,{name:l.expression,value:p(Gt,e,{elements:d})})])}else f?(f instanceof Xe&&f.pinned()||P(i,f,r))&&(f=null):f=p(Ln,l).transform(n),f&&c.unshift([p(Dt,l,{name:l,value:f})])}}}function V(e){if(_.push(e),e instanceof Vt)e.left.has_side_effects(n)||e.right instanceof xt||c.push(_.slice()),V(e.right);else if(e instanceof Bt)V(e.left),V(e.right);else if(e instanceof Ct&&!T(e,Zn))V(e.expression),e.args.forEach(V);else if(e instanceof pt)V(e.expression);else if(e instanceof Lt)V(e.condition),V(e.consequent),V(e.alternative);else if(e instanceof gt){var t=e.definitions.length,i=t-200;for(i<0&&(i=0);i1&&!(e.name instanceof pn)||(r>1?function(e){var t=e.value;if(t instanceof yn&&"arguments"!=t.name){var n=t.definition();if(!n.undeclared)return E=n}}(e):!n.exposed(i))?p(yn,e.name,e.name):void 0}}function K(e){return e instanceof Vt?e.right:e.value}function H(e){var t=new Map;if(e instanceof It)return t;var i=new qn(function(e){for(var r=e;r instanceof Ft;)r=r.expression;if(r instanceof yn){const o=t.get(r.name);o&&o.modified||t.set(r.name,{def:r.definition(),modified:_r(n,i,e,e,0)})}});return K(e).walk(i),t}function X(t){if(t.name instanceof pn){var i=n.parent(),r=n.self().argnames,o=r.indexOf(t.name);if(o<0)i.args.length=Math.min(i.args.length,r.length-1);else{var a=i.args;a[o]&&(a[o]=p(wn,a[o],{value:0}))}return!0}var s=!1;return e[l].transform(new Yn(function(e,n,i){return s?e:e===t||e.body===t?(s=!0,e instanceof Dt?(e.value=e.name instanceof ln?p(Ln,e.value):null,e):i?f.skip:null):void 0},function(e){if(e instanceof Ot)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}}))}function z(e){for(;e instanceof Ft;)e=e.expression;return e instanceof yn&&e.definition().scope.get_defun_scope()===r&&!(o&&(S.has(e.name)||g instanceof It||g instanceof Vt&&!g.logical&&"="!=g.operator))}function W(e){return e instanceof It?or.has(e.operator):K(e).has_side_effects(n)}function q(){if(A)return!1;if(E)return!0;if(D instanceof yn){var e=D.definition();if(e.references.length-e.replaced==(g instanceof Dt?1:2))return!0}return!1}function Y(e){if(!e.definition)return!0;var t=e.definition();return!(1==t.orig.length&&t.orig[0]instanceof dn)&&(t.scope.get_defun_scope()!==r||t.references.some(e=>e.scope.get_defun_scope()!==r))}function $(e,t){if(e instanceof Vt)return $(e.left,!0);if(e instanceof It)return $(e.expression,!0);if(e instanceof Dt)return e.value&&$(e.value);if(t){if(e instanceof kt)return $(e.expression,!0);if(e instanceof wt)return $(e.expression,!0);if(e instanceof yn)return e.definition().scope.get_defun_scope()!==r}return!1}}function l(e){for(var t=[],n=0;n=0;){var i=e[n];if(i instanceof ut&&i.body instanceof tt&&++t>1)return!0}return!1}(e),r=n instanceof Xe;for(var o=Math.min(e.length,500);--o>=0;){var a=e[o],u=E(o),c=e[u];if(r&&!c&&a instanceof tt){if(!a.value){s=!0,e.splice(o,1);continue}if(a.value instanceof Nt&&"void"==a.value.operator){s=!0,e[o]=p(Te,a,{body:a.value.expression});continue}}if(a instanceof ut){let n,i;if(n=hr(a.body),d(n)&&(i=g(a.body,n))){n.label&&_(n.label.thedef.references,n),s=!0,(a=a.clone()).condition=a.condition.negate(t),a.body=p(Fe,a,{body:Wi(a.alternative).concat(h())}),a.alternative=p(Fe,a,{body:i}),e[o]=a.transform(t);continue}if(n=hr(a.alternative),d(n)&&(i=g(a.alternative,n))){n.label&&_(n.label.thedef.references,n),s=!0,(a=a.clone()).body=p(Fe,a.body,{body:Wi(a.body).concat(h())}),a.alternative=p(Fe,a.alternative,{body:i}),e[o]=a.transform(t);continue}}if(a instanceof ut&&a.body instanceof tt){var l=a.body.value;if(!l&&!a.alternative&&(r&&!c||c instanceof tt&&!c.value)){s=!0,e[o]=p(Te,a.condition,{body:a.condition});continue}if(l&&!a.alternative&&c instanceof tt&&c.value){s=!0,(a=a.clone()).alternative=c,e[o]=a.transform(t),e.splice(u,1);continue}if(l&&!a.alternative&&(!c&&r&&i||c instanceof tt)){s=!0,(a=a.clone()).alternative=c||p(tt,a,{value:null}),e[o]=a.transform(t),c&&e.splice(u,1);continue}var f=e[v(o)];if(t.option("sequences")&&r&&!a.alternative&&f instanceof ut&&f.body instanceof tt&&E(u)==e.length&&c instanceof Te){s=!0,(a=a.clone()).alternative=p(Fe,c,{body:[c,p(tt,c,{value:null})]}),e[o]=a.transform(t),e.splice(u,1);continue}}}function d(i){if(!i)return!1;for(var a=o+1,s=e.length;azi(e)))return t.value&&n.push(p(Te,t.value,{body:t.value.expression})),n}function E(t){for(var n=t+1,i=e.length;n=0;){var i=e[n];if(!(i instanceof Et&&m(i)))break}return n}}function h(e,t){for(var n,i=t.self(),r=0,o=0,a=e.length;r!e.value)}function g(e,t){if(!(e.length<2)){for(var n=[],i=0,r=0,o=e.length;r=t.sequences_limit&&c();var u=a.body;n.length>0&&(u=u.drop_side_effect_free(t)),u&&Oi(n,u)}else a instanceof gt&&m(a)||a instanceof Ye||c(),e[i++]=a}c(),e.length=i,i!=o&&(s=!0)}function c(){if(n.length){var t=Fi(n[0],n);e[i++]=p(Te,t,{body:t}),n=[]}}}function E(e,t){if(!(e instanceof Fe))return e;for(var n=null,i=0,r=e.body.length;ie instanceof Ge||(e instanceof Bt&&"in"===e.operator?Wn:void 0))||(a.init?a.init=n(a.init):(a.init=i.body,r--,s=!0))}}else a instanceof Le?a.init instanceof bt||a.init instanceof vt||(a.object=n(a.object)):a instanceof ut?a.condition=n(a.condition):(a instanceof ct||a instanceof Ue)&&(a.expression=n(a.expression));if(t.option("conditionals")&&a instanceof ut){var u=[],c=E(a.body,u),l=E(a.alternative,u);if(!1!==c&&!1!==l&&u.length>0){var f=u.length;u.push(p(ut,a,{condition:a.condition,body:c||p(ke,a.body),alternative:l})),u.unshift(r,1),[].splice.apply(e,u),o+=f,r+=f+1,i=null,s=!0;continue}}e[r++]=a,i=a instanceof Te?a:null}e.length=r}function b(e,t){if(e instanceof gt){var r,o=e.definitions[e.definitions.length-1];if(o.value instanceof Kt)if(t instanceof Vt&&!t.logical?r=[t]:t instanceof Ot&&(r=t.expressions.slice()),r){var a=!1;do{var s=r[0];if(!(s instanceof Vt))break;if("="!=s.operator)break;if(!(s.left instanceof Ft))break;var u=s.left.expression;if(!(u instanceof yn))break;if(o.name.name!=u.name)break;if(!s.right.is_constant_expression(i))break;var c=s.left.property;if(c instanceof De&&(c=c.evaluate(n)),c instanceof De)break;c=""+c;var l=n.option("ecma")<2015&&n.has_directive("use strict")?function(e){return e.key!=c&&e.key&&e.key.name!=c}:function(e){return e.key&&e.key.name!=c};if(!o.value.properties.every(l))break;var f=o.value.properties.filter(function(e){return e.key===c})[0];f?f.value=new Ot({start:f.start,expressions:[f.value.clone(),s.right.clone()],end:f.end}):o.value.properties.push(p(Xt,s,{key:c,value:s.right})),r.shift(),a=!0}while(r.length);return a&&r}}}function D(e){for(var t,n=0,i=-1,r=e.length;ne.name.length;return!0}(i,o))return i.fixed=!1,i.single_use=!1,e;if(jr(t,o))return e;let a=i.single_use&&!(n instanceof Ct&&n.is_callee_pure(t)||T(n,Zn))&&!(n instanceof Tt&&o instanceof Xe&&o.name);if(a&&o instanceof De&&(a=!o.has_side_effects(t)&&!o.may_throw(t)),o instanceof Zt&&i.scope!==e.scope)return e;if(a&&(o instanceof Xe||o instanceof Zt))if($i(o,t))a=!1;else if(i.scope===e.scope||1!=i.escaped&&!Ti(o,16)&&!function(e){for(var t,n=0;t=e.parent(n++);){if(t instanceof Se)return!1;if(t instanceof Gt||t instanceof Xt||t instanceof Kt)return!0}return!1}(t)&&t.option("reduce_funcs")){if(Yi(t,i))a=!1;else if((i.scope!==e.scope||i.orig[0]instanceof pn)&&(a=o.is_constant_expression(e.scope),"f"==a)){var s=e.scope;do{(s instanceof Ye||Vi(s))&&Ci(s,16)}while(s=s.parent_scope)}}else a=!1;if(a&&(o instanceof Xe||o instanceof Zt)&&(a=i.scope===e.scope&&!qr(r,o)||n instanceof Ct&&n.expression===e&&!qr(r,o)&&!(o.name&&o.name.definition().recursive_refs>0)),a&&o){if(o instanceof tn&&(Ci(o,yi),o=p(rn,o,o)),o instanceof Ye&&(Ci(o,yi),o=p(We,o,o)),i.recursive_refs>0&&o.name instanceof dn){const e=o.name.definition();let t=o.variables.get(o.name.name),n=t&&t.orig[0];n instanceof mn||(n=p(mn,o.name,o.name),n.scope=o,o.name=n,t=o.def_function(n)),Xn(o,n=>{n instanceof yn&&n.definition()===e&&(n.thedef=t,t.references.push(n))})}return(o instanceof Xe||o instanceof Zt)&&o.parent_scope!==r&&(o=o.clone(!0,t.get_toplevel()),r.add_child_scope(o)),o.optimize(t)}if(o){let n;if(o instanceof On)i.orig[0]instanceof pn||!i.references.every(e=>i.scope===e.scope)||(n=o);else{var u=o.evaluate(t);u===o||!t.option("unsafe_regexp")&&u instanceof RegExp||(n=Mi(u,o))}if(n){const r=e.size(t),a=n.size(t);let s=0;if(t.option("unused")&&!t.exposed(i)&&(s=(r+2+o.size(t))/(i.references.length-i.assignments)),a<=r+s)return n}}return e}function $r(e,t){if(t.in_computed_key())return e;var n=e.expression,i=n,r=e.args.every(e=>!(e instanceof He));if(t.option("reduce_vars")&&i instanceof yn&&!T(e,Zn)){const r=i.fixed_value();if($i(r,t)||!t.toplevel.funcs&&n.definition().global)return e;i=r}if(jr(t,i)&&!T(e,jn))return e;var o=i instanceof Xe,a=o&&i.body[0],s=o&&!i.is_generator&&!i.async,u=s&&t.option("inline")&&!e.is_callee_pure(t);if(u&&a instanceof tt){let n=a.value;if(!n||n.is_constant_expression()){n=n?n.clone(!0):p(Ln,e);const i=e.args.concat(n);return Fi(e,i).optimize(t)}if(1===i.argnames.length&&i.argnames[0]instanceof pn&&e.args.length<2&&!(e.args[0]instanceof He)&&n instanceof yn&&n.name===i.argnames[0].name){const n=(e.args[0]||p(Ln)).optimize(t);let i;return n instanceof Ft&&(i=t.parent())instanceof Ct&&i.expression===e?Fi(e,[p(wn,e,{value:0}),n]):n}}if(u){var c,l,f=-1;let o,s,u;if(r&&!i.uses_arguments&&!(t.parent()instanceof Zt)&&!(i.name&&i instanceof We)&&(s=function(e){var n=i.body,r=n.length;if(t.option("inline")<3)return 1==r&&_(e);e=null;for(var o=0;o!e.value))return!1}else{if(e)return!1;a instanceof ke||(e=a)}}return _(e)}(a))&&(n===i||T(e,jn)||t.option("unused")&&1==(o=n.definition()).references.length&&!Yi(t,o)&&i.is_constant_expression(n.scope))&&!T(e,$n|Zn)&&!i.contains_this()&&function(){var e=new Set;do{if((c=t.parent(++f)).is_block_scope()&&c.block_scope&&c.block_scope.variables.forEach(function(t){e.add(t.name)}),c instanceof _t)c.argname&&e.add(c.argname.name);else if(c instanceof xe)l=[];else if(c instanceof yn&&c.fixed_value()instanceof Ge)return!1}while(!(c instanceof Ge));var n=!(c instanceof Ke)||t.toplevel.vars,r=t.option("inline");return!!function(e,t){for(var n=i.body.length,r=0;r=0;){var s=o.definitions[a].name;if(s instanceof $e||e.has(s.name)||Ki.has(s.name)||c.conflicting_def(s.name))return!1;l&&l.push(s.definition())}}}return!0}(e,r>=3&&n)&&(!!function(e,t){for(var n=0,r=i.argnames.length;n=2&&n)&&(!l||0==l.length||!qi(i,l)))}()&&(u=t.find_scope())&&!qr(u,i)&&!function(){let e,n=0;for(;e=t.parent(n++);){if(e instanceof Ut)return!0;if(e instanceof Oe)break}return!1}()&&!(c instanceof Zt))return Ci(i,yi),u.add_child_scope(i),Fi(e,function(n){var r=[],o=[];if(function(t,n){for(var r=i.argnames.length,o=e.args.length;--o>=r;)n.push(e.args[o]);for(o=r;--o>=0;){var a=i.argnames[o],s=e.args[o];if(Ti(a,1)||!a.name||c.conflicting_def(a.name))s&&n.push(s);else{var u=p(un,a,a);a.definition().orig.push(u),!s&&l&&(s=p(Ln,e)),m(t,n,u,s)}}t.reverse(),n.reverse()}(r,o),function(e,t){for(var n=t.length,r=0,o=i.body.length;re.name!=f.name)){var d=i.variables.get(f.name),h=p(yn,f,f);d.references.push(h),t.splice(n++,0,p(Vt,c,{operator:"=",logical:!1,left:h,right:p(Ln,f)}))}}}}(r,o),o.push(n),r.length){const e=c.body.indexOf(t.parent(f-1))+1;c.body.splice(e,0,p(Et,i,{definitions:r}))}return o.map(e=>e.clone(!0))}(s)).optimize(t)}if(u&&T(e,jn))return Ci(i,yi),(i=(i=p(i.CTOR===Ye?We:i.CTOR,i,i)).clone(!0)).figure_out_scope({},{parent_scope:t.find_scope(),toplevel:t.get_toplevel()}),p(Ct,e,{expression:i,args:e.args}).optimize(t);if(s&&t.option("side_effects")&&i.body.every(Gi)){var d=e.args.concat(p(Ln,e));return Fi(e,d).optimize(t)}if(t.option("negate_iife")&&t.parent()instanceof Te&&Ui(e))return e.negate(t,!0);var h=e.evaluate(t);return h!==e?(h=Mi(h,e).optimize(t),xi(t,h,e)):e;function _(t){return t?t instanceof tt?t.value?t.value.clone(!0):p(Ln,e):t instanceof Te?p(Nt,t,{operator:"void",expression:t.body.clone(!0)}):void 0:p(Ln,e)}function m(t,n,i,r){var o=i.definition();c.variables.has(i.name)||(c.variables.set(i.name,o),c.enclosed.push(o),t.push(p(Dt,i,{name:i,value:null})));var a=p(yn,i,i);o.references.push(a),r&&n.push(p(Vt,e,{operator:"=",logical:!1,left:a,right:r.clone()}))}}function jr(e,t){return(t instanceof Xe||t instanceof Zt)&&!!e.is_within_loop()}Mr(ze,function(e,t,n){return Nr(e),xr(e,n,this),t(),Pr(e),!0}),Mr(Vt,function(e,t,n){var i=this;if(i.left instanceof $e)return void Gr(i.left);const r=()=>{if(i.logical)return i.left.walk(e),Nr(e),i.right.walk(e),Pr(e),!0};var o=i.left;if(!(o instanceof yn))return r();var a=o.definition(),s=Vr(e,a,o.scope,i.right);if(a.assignments++,!s)return r();var u=a.fixed;if(!u&&"="!=i.operator&&!i.logical)return r();var c="="==i.operator,l=c?i.right:i;return _r(n,e,i,l,0)?r():(a.references.push(o),i.logical||(c||(a.chained=!0),a.fixed=c?function(){return i.right}:function(){return p(Bt,i,{operator:i.operator.slice(0,-1),left:u instanceof De?u:u(),right:i.right})}),i.logical?(Br(e,a,!1),Nr(e),i.right.walk(e),Pr(e),!0):(Br(e,a,!1),i.right.walk(e),Br(e,a,!0),Ur(e,a,o.scope,i,l,0,1),!0))}),Mr(Bt,function(e){if(rr.has(this.operator))return this.left.walk(e),Nr(e),this.right.walk(e),Pr(e),!0}),Mr(Oe,function(e,t,n){Ir(n,this)}),Mr(pt,function(e){return Nr(e),this.expression.walk(e),Pr(e),Nr(e),Ce(this,e),Pr(e),!0}),Mr(Zt,function(e,t){return Ri(this,16),Nr(e),t(),Pr(e),!0}),Mr(nn,function(e,t,n){Ir(n,this)}),Mr(Lt,function(e){return this.condition.walk(e),Nr(e),this.consequent.walk(e),Pr(e),Nr(e),this.alternative.walk(e),Pr(e),!0}),Mr(xt,function(e,t){const n=e.safe_ids;return t(),e.safe_ids=n,!0}),Mr(Ct,function(e){this.expression.walk(e),this.optional&&Nr(e);for(const t of this.args)t.walk(e);return!0}),Mr(Ft,function(e){if(this.optional)return this.expression.walk(e),Nr(e),this.property instanceof De&&this.property.walk(e),!0}),Mr(ft,function(e,t){return Nr(e),t(),Pr(e),!0}),Mr(Xe,function(e,t,n){var i;return Ri(this,16),Nr(e),xr(e,n,this),!this.name&&!this.uses_arguments&&!this.pinned()&&(i=e.parent())instanceof Ct&&i.expression===this&&!i.args.some(e=>e instanceof He)&&this.argnames.every(e=>e instanceof on)&&this.argnames.forEach((t,n)=>{if(t.definition){var r=t.definition();r.orig.length>1||(void 0!==r.fixed||this.uses_arguments&&!e.has_directive("use strict")?r.fixed=!1:(r.fixed=function(){return i.args[n]||p(Ln,i)},e.loop_ids.set(r.id,e.in_loop),Br(e,r,!0)))}}),t(),Pr(e),Kr(this),!0}),Mr(Ne,function(e,t,n){Ir(n,this);const i=e.in_loop;return e.in_loop=this,Nr(e),this.body.walk(e),Pi(this)&&(Pr(e),Nr(e)),this.condition.walk(e),Pr(e),e.in_loop=i,!0}),Mr(Be,function(e,t,n){Ir(n,this),this.init&&this.init.walk(e);const i=e.in_loop;return e.in_loop=this,Nr(e),this.condition&&this.condition.walk(e),this.body.walk(e),this.step&&(Pi(this)&&(Pr(e),Nr(e)),this.step.walk(e)),Pr(e),e.in_loop=i,!0}),Mr(Le,function(e,t,n){Ir(n,this),Gr(this.init),this.object.walk(e);const i=e.in_loop;return e.in_loop=this,Nr(e),this.body.walk(e),Pr(e),e.in_loop=i,!0}),Mr(ut,function(e){return this.condition.walk(e),Nr(e),this.body.walk(e),Pr(e),this.alternative&&(Nr(e),this.alternative.walk(e),Pr(e)),!0}),Mr(we,function(e){return Nr(e),this.body.walk(e),Pr(e),!0}),Mr(vn,function(){this.definition().fixed=!1}),Mr(yn,function(e,t,n){var i,r,o=this.definition();o.references.push(this),1==o.references.length&&!o.fixed&&o.orig[0]instanceof dn&&e.loop_ids.set(o.id,e.in_loop),void 0!==o.fixed&&Lr(e,o)?o.fixed&&((i=this.fixed_value())instanceof Xe&&Yi(e,o)?o.recursive_refs++:i&&!n.exposed(o)&&function(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids.get(n.id)===e.in_loop}(e,n,o)?o.single_use=i instanceof Xe&&!i.pinned()||i instanceof Zt||o.scope===this.scope&&i.is_constant_expression():o.single_use=!1,_r(n,e,this,i,0,!!(r=i)&&(r.is_constant()||r instanceof Xe||r instanceof On))&&(o.single_use?o.single_use="m":o.fixed=!1)):o.fixed=!1,Ur(e,o,this.scope,this,i,0,1)}),Mr(Ke,function(e,t,n){return this.globals.forEach(function(e){wr(n,e)}),xr(e,n,this),t(),Kr(this),!0}),Mr(dt,function(e,t,n){return Ir(n,this),Nr(e),this.body.walk(e),Pr(e),this.bcatch&&(Nr(e),this.bcatch.walk(e),Pr(e)),this.bfinally&&this.bfinally.walk(e),!0}),Mr(It,function(e){var t=this;if("++"===t.operator||"--"===t.operator){var n=t.expression;if(n instanceof yn){var i=n.definition(),r=Vr(e,i,n.scope,!0);if(i.assignments++,r){var o=i.fixed;if(o)return i.references.push(n),i.chained=!0,i.fixed=function(){return p(Bt,t,{operator:t.operator.slice(0,-1),left:p(Nt,t,{operator:"+",expression:o instanceof De?o:o()}),right:p(wn,t,{value:1})})},Br(e,i,!0),!0}}}}),Mr(Dt,function(e,t){var n=this;if(n.name instanceof $e)Gr(n.name);else{var i=n.name.definition();if(n.value){if(Vr(e,i,n.name.scope,n.value))return i.fixed=function(){return n.value},e.loop_ids.set(i.id,e.in_loop),Br(e,i,!1),t(),Br(e,i,!0),!0;i.fixed=!1}}}),Mr(Pe,function(e,t,n){Ir(n,this);const i=e.in_loop;return e.in_loop=this,Nr(e),t(),Pr(e),e.in_loop=i,!0}),function(e){function t(e,n){if(e instanceof De)return e instanceof kn||(e=e.clone(!0)),p(e.CTOR,n,e);if(Array.isArray(e))return p(Gt,n,{elements:e.map(function(e){return t(e,n)})});if(e&&"object"==typeof e){var i=[];for(var r in e)v(e,r)&&i.push(p(Xt,n,{key:r,value:t(e[r],n)}));return p(Kt,n,{properties:i})}return Mi(e,n)}Ke.DEFMETHOD("resolve_defines",function(e){return e.option("global_defs")?(this.figure_out_scope({ie8:e.option("ie8")}),this.transform(new Yn(function(t){var n=t._find_defs(e,"");if(n){for(var i,r=0,o=t;(i=this.parent(r++))&&i instanceof Ft&&i.expression===o;)o=i;if(!pr(o,i))return n}}))):this}),e(De,a),e(xt,function(e,t){return this.expression._find_defs(e,t)}),e(kt,function(e,t){return this.expression._find_defs(e,"."+this.property+t)}),e(sn,function(){this.global()}),e(yn,function(e,n){if(this.global()){var i=e.option("global_defs"),r=this.name+n;return v(i,r)?t(i[r],this):void 0}}),e(At,function(e,n){var i=e.option("global_defs"),r="import.meta"+n;if(v(i,r))return t(i[r],this)})}(function(e,t){e.DEFMETHOD("_find_defs",t)});class Zr extends qn{constructor(e,{false_by_default:t=!1,mangle_options:n=!1}){super(),void 0===e.defaults||e.defaults||(t=!0),this.options=o(e,{arguments:!1,arrows:!t,booleans:!t,booleans_as_integers:!1,collapse_vars:!t,comparisons:!t,computed_props:!t,conditionals:!t,dead_code:!t,defaults:!0,directives:!t,drop_console:!1,drop_debugger:!t,ecma:5,evaluate:!t,expression:!1,global_defs:!1,hoist_funs:!1,hoist_props:!t,hoist_vars:!1,ie8:!1,if_return:!t,inline:!t,join_vars:!t,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1,lhs_constants:!t,loops:!t,module:!1,negate_iife:!t,passes:1,properties:!t,pure_getters:!t&&"strict",pure_funcs:null,pure_new:!1,reduce_funcs:!t,reduce_vars:!t,sequences:!t,side_effects:!t,switches:!t,top_retain:null,toplevel:!(!e||!e.top_retain),typeofs:!t,unsafe:!1,unsafe_arrows:!1,unsafe_comps:!1,unsafe_Function:!1,unsafe_math:!1,unsafe_symbols:!1,unsafe_methods:!1,unsafe_proto:!1,unsafe_regexp:!1,unsafe_undefined:!1,unused:!t,warnings:!1},!0);var i=this.options.global_defs;if("object"==typeof i)for(var r in i)"@"===r[0]&&v(i,r)&&(i[r.slice(1)]=me(i[r],{expression:!0}));!0===this.options.inline&&(this.options.inline=3);var a=this.options.pure_funcs;this.pure_funcs="function"==typeof a?a:a?function(e){return!a.includes(e.expression.print_to_string())}:u;var s=this.options.top_retain;s instanceof RegExp?this.top_retain=function(e){return s.test(e.name)}:"function"==typeof s?this.top_retain=s:s&&("string"==typeof s&&(s=s.split(/,/)),this.top_retain=function(e){return s.includes(e.name)}),this.options.module&&(this.directives["use strict"]=!0,this.options.toplevel=!0);var c=this.options.toplevel;this.toplevel="string"==typeof c?{funcs:/funcs/.test(c),vars:/vars/.test(c)}:{funcs:c,vars:c};var l=this.options.sequences;this.sequences_limit=1==l?800:0|l,this.evaluated_regexps=new Map,this._toplevel=void 0,this._mangle_options=n?_i(n):n}mangle_options(){var e=this._mangle_options&&this._mangle_options.nth_identifier||mi,t=this._mangle_options&&this._mangle_options.module||this.option("module");return{ie8:this.option("ie8"),nth_identifier:e,module:t}}option(e){return this.options[e]}exposed(e){if(e.export)return!0;if(e.global)for(var t=0,n=e.orig.length;t0||this.option("reduce_vars"))&&this._toplevel.reset_opt_flags(this),this._toplevel=this._toplevel.transform(this),t>1){let e=0;if(Xn(this._toplevel,()=>{e++}),e{if(!si(e,t))return!1;const n=[e],i=[t],r=n.push.bind(n),o=i.push.bind(i);for(;n.length&&i.length;){const e=n.pop(),t=i.pop();if(!si(e,t))return!1;if(e._children_backwards(r),t._children_backwards(o),n.length!==i.length)return!1}return 0==n.length&&0==i.length})(this,e)}),Ge.DEFMETHOD("process_expression",function(e,t){var n=this,i=new Yn(function(r){if(e&&r instanceof Te)return p(tt,r,{value:r.body});if(!e&&r instanceof tt){if(t){var o=r.value&&r.value.drop_side_effect_free(t,!0);return o?p(Te,r,{body:o}):p(ke,r)}return p(Te,r,{body:r.value||p(Nt,r,{operator:"void",expression:p(wn,r,{value:0})})})}if(r instanceof Zt||r instanceof Xe&&r!==n)return r;if(r instanceof Oe){var a=r.body.length-1;a>=0&&(r.body[a]=r.body[a].transform(i))}else r instanceof ut?(r.body=r.body.transform(i),r.alternative&&(r.alternative=r.alternative.transform(i))):r instanceof Ue&&(r.body=r.body.transform(i));return r});n.transform(i)}),Ke.DEFMETHOD("reset_opt_flags",function(e){const t=this,n=e.option("reduce_vars"),i=new qn(function(r,o){if(Ri(r,1792),n)return e.top_retain&&r instanceof Ye&&i.parent()===t&&Ci(r,Ai),r.reduce_vars(i,o,e)});i.safe_ids=Object.create(null),i.in_loop=null,i.loop_ids=new Map,i.defs_to_safe_ids=new Map,t.walk(i)}),on.DEFMETHOD("fixed_value",function(){var e=this.thedef.fixed;return!e||e instanceof De?e:e()}),yn.DEFMETHOD("is_immutable",function(){var e=this.definition().orig;return 1==e.length&&e[0]instanceof mn});var eo=g("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");yn.DEFMETHOD("is_declared",function(e){return!this.definition().undeclared||e.option("unsafe")&&eo.has(this.name)});var to=new Set(["use asm","use strict"]);function no(e,t){return Wr(e.body,t),t.option("side_effects")&&1==e.body.length&&e.body[0]===t.has_directive("use strict")&&(e.body.length=0),e}function io(e,t){var n=e.body instanceof Fe?e.body.body[0]:e.body;if(t.option("dead_code")&&r(n)){var i=[];return e.init instanceof Se?i.push(e.init):e.init&&i.push(p(Te,e.init,{body:e.init})),e.condition&&i.push(p(Te,e.condition,{body:e.condition})),zr(t,e.body,i),p(Fe,e,{body:i})}return n instanceof ut&&(r(n.body)?(e.condition?e.condition=p(Bt,e.condition,{left:e.condition,operator:"&&",right:n.condition.negate(t)}):e.condition=n.condition.negate(t),o(n.alternative)):r(n.alternative)&&(e.condition?e.condition=p(Bt,e.condition,{left:e.condition,operator:"&&",right:n.condition}):e.condition=n.condition,o(n.body))),e;function r(e){return e instanceof rt&&t.loopcontrol_target(e)===t.self()}function o(n){n=Wi(n),e.body instanceof Fe?(e.body=e.body.clone(),e.body.body=n.concat(e.body.body.slice(1)),e.body=e.body.transform(t)):e.body=p(Fe,e.body,{body:n}).transform(t),e=io(e,t)}}Qr(Ae,function(e,t){return!t.option("directives")||to.has(e.value)&&t.has_directive(e.value)===e?e:p(ke,e)}),Qr(ye,function(e,t){return t.option("drop_debugger")?p(ke,e):e}),Qr(we,function(e,t){return e.body instanceof rt&&t.loopcontrol_target(e.body)===e.body?p(ke,e):0==e.label.references.length?e.body:e}),Qr(Oe,function(e,t){return Wr(e.body,t),e}),Qr(Fe,function(e,t){switch(Wr(e.body,t),e.body.length){case 1:if(!t.has_directive("use strict")&&t.parent()instanceof ut&&!((n=e.body[0])instanceof bt||n instanceof vt||n instanceof Zt)||zi(e.body[0]))return e.body[0];break;case 0:return p(ke,e)}var n;return e}),Qr(Xe,no),Ge.DEFMETHOD("hoist_declarations",function(e){var t=this;if(e.has_directive("use asm"))return t;var n=e.option("hoist_funs"),i=e.option("hoist_vars");if(n||i){var r=[],o=[],a=new Map,s=0,u=0;Xn(t,e=>e instanceof Ge&&e!==t||(e instanceof Et?(++u,!0):void 0)),i=i&&u>1;var c=new Yn(function(u){if(u!==t){if(u instanceof Ae)return r.push(u),p(ke,u);if(n&&u instanceof Ye&&!(c.parent()instanceof Tt)&&c.parent()===t)return o.push(u),p(ke,u);if(i&&u instanceof Et&&!u.definitions.some(e=>e.name instanceof $e)){u.definitions.forEach(function(e){a.set(e.name.name,e),++s});var l=u.to_assignments(e),f=c.parent();if(f instanceof Le&&f.init===u){if(null==l){var d=u.definitions[0].name;return p(yn,d,d)}return l}return f instanceof Be&&f.init===u?l:l?p(Te,u,{body:l}):p(ke,u)}if(u instanceof Ge)return u}});if(t=t.transform(c),s>0){var l=[];const e=t instanceof Xe,n=e?t.args_as_names():null;if(a.forEach((t,i)=>{e&&n.some(e=>e.name===t.name.name)?a.delete(i):((t=t.clone()).value=null,l.push(t),a.set(i,t))}),l.length>0){for(;0e instanceof He||e.computed_key())){a(o,this);const e=new Map,n=[];return c.properties.forEach(({key:i,value:a})=>{const u=r.find_scope(),c=t.create_symbol(s.CTOR,{source:s,scope:u,conflict_scopes:new Set([u,...s.definition().references.map(e=>e.scope)]),tentative_name:s.name+"_"+i});e.set(String(i),c.definition()),n.push(p(Dt,o,{name:c,value:a}))}),i.set(u.id,e),f.splice(n)}}else if(o instanceof Ft&&o.expression instanceof yn){const e=i.get(o.expression.definition().id);if(e){const t=e.get(String(Ii(o.property))),n=p(yn,o,{name:t.name,scope:o.expression.scope,thedef:t});return n.reference({}),n}}});return t.transform(r)}),Qr(Te,function(e,t){if(t.option("side_effects")){var n=e.body,i=n.drop_side_effect_free(t,!0);if(!i)return p(ke,e);if(i!==n)return p(Te,e,{body:i})}return e}),Qr(Pe,function(e,t){return t.option("loops")?p(Be,e,e).optimize(t):e}),Qr(Ne,function(e,t){if(!t.option("loops"))return e;var n=e.condition.tail_node().evaluate(t);if(!(n instanceof De)){if(n)return p(Be,e,{body:p(Fe,e.body,{body:[e.body,p(Te,e.condition,{body:e.condition})]})}).optimize(t);if(!Pi(e,t.parent()))return p(Fe,e.body,{body:[e.body,p(Te,e.condition,{body:e.condition})]}).optimize(t)}return e}),Qr(Be,function(e,t){if(!t.option("loops"))return e;if(t.option("side_effects")&&e.init&&(e.init=e.init.drop_side_effect_free(t)),e.condition){var n=e.condition.evaluate(t);if(!(n instanceof De))if(n)e.condition=null;else if(!t.option("dead_code")){var i=e.condition;e.condition=Mi(n,e.condition),e.condition=wi(e.condition.transform(t),i)}if(t.option("dead_code")&&(n instanceof De&&(n=e.condition.tail_node().evaluate(t)),!n)){var r=[];return zr(t,e.body,r),e.init instanceof Se?r.push(e.init):e.init&&r.push(p(Te,e.init,{body:e.init})),r.push(p(Te,e.condition,{body:e.condition})),p(Fe,e,{body:r}).optimize(t)}}return io(e,t)}),Qr(ut,function(e,t){if(Gi(e.alternative)&&(e.alternative=null),!t.option("conditionals"))return e;var n=e.condition.evaluate(t);if(!(t.option("dead_code")||n instanceof De)){var i=e.condition;e.condition=Mi(n,i),e.condition=wi(e.condition.transform(t),i)}if(t.option("dead_code")){if(n instanceof De&&(n=e.condition.tail_node().evaluate(t)),!n){var r=[];return zr(t,e.body,r),r.push(p(Te,e.condition,{body:e.condition})),e.alternative&&r.push(e.alternative),p(Fe,e,{body:r}).optimize(t)}if(!(n instanceof De))return(r=[]).push(p(Te,e.condition,{body:e.condition})),r.push(e.body),e.alternative&&zr(t,e.alternative,r),p(Fe,e,{body:r}).optimize(t)}var o=e.condition.negate(t),a=e.condition.size(),s=o.size(),u=s(e===h||e.expression instanceof kn)&&(0===e.body.length||hr(e)||u.length-1===t)))for(let e=0;ee&&b(u[t--]);)a++;const s=u.splice(n-a,1+a);u.splice(e+1,0,...s),e+=s.length}}}for(let e=0;e=0;e--){let n=u[e].body;if(v(n[n.length-1],t)&&n.pop(),!b(u[e]))break}if(e++,!h||u.indexOf(h)>=e)for(let n=u.length-1;n>=e;n--){let e=u[n];if(e===h)h=null,u.pop();else{if(e.expression.has_side_effects(t))break;u.pop()}}}e:if(h){let e=u.indexOf(h),n=e;for(;n=0;i--){let e=u[i];if(e!==h&&e.expression.has_side_effects(t))break}if(n>i){let t=e-1;for(;t>=0&&b(u[t]);t--);let r=Math.max(i,t)+1,o=e;i>e?(o=i,u[i].body=u[n].body):h.body=u[n].body,u.splice(o+1,n-o),u.splice(r,e-r)}}e:if(h){let n,i=u.findIndex(e=>!b(e));if(i===u.length-1){let t=u[i];if(E(e))break e;n=p(Fe,t,{body:t.body}),t.body=[]}else if(-1!==i)break e;let r=u.find(e=>e!==h&&e.expression.has_side_effects(t));if(!r)return p(Fe,e,{body:s.concat(g(e.expression),h.expression?g(h.expression):[],n||[])}).optimize(t);const o=u.indexOf(h);if(u.splice(o,1),h=null,n)return p(Fe,e,{body:s.concat(e,n)}).optimize(t)}if(u.length>0&&(u[0].body=s.concat(u[0].body)),0==u.length)return p(Fe,e,{body:s.concat(g(e.expression))}).optimize(t);if(1==u.length&&!E(e)){let n=u[0];return p(ut,e,{condition:p(Bt,e,{operator:"===",left:e.expression,right:n.expression}),body:p(Fe,n,{body:n.body}),alternative:null}).optimize(t)}if(2===u.length&&h&&!E(e)){let n=u[0]===h?u[1]:u[0],i=h.expression&&g(h.expression);if(hr(u[0])){let r=u[0];return v(r.body[r.body.length-1],t)&&r.body.pop(),p(ut,e,{condition:p(Bt,e,{operator:"===",left:e.expression,right:n.expression}),body:p(Fe,n,{body:n.body}),alternative:p(Fe,h,{body:[].concat(i||[],h.body)})}).optimize(t)}let r="===",o=p(Fe,n,{body:n.body}),a=p(Fe,h,{body:[].concat(i||[],h.body)});if(u[0]===h){r="!==";let e=a;a=o,o=e}return p(Fe,e,{body:[p(ut,e,{condition:p(Bt,e,{operator:r,left:e.expression,right:n.expression}),body:o,alternative:null}),a]}).optimize(t)}return e;function _(e,n){n&&!hr(n)?n.body=n.body.concat(e.body):zr(t,e,s)}function m(e,t,n){let i=e.body,r=t.body;if(n&&(i=i.concat(p(rt))),i.length!==r.length)return!1;let o=p(Fe,e,{body:i}),a=p(Fe,t,{body:r});return o.equivalent_to(a)}function g(e){return p(Te,e,{body:e})}function E(e){let t=!1,n=new qn(e=>{if(t)return!0;if(e instanceof Xe)return!0;if(e instanceof Te)return!0;if(!v(e,n))return;let i=n.parent();i instanceof lt&&i.body[i.body.length-1]===e||(t=!0)});return e.walk(n),t}function v(t,n){return t instanceof rt&&n.loopcontrol_target(t)===e}function b(e){return!hr(e)&&!p(Fe,e,{body:e.body}).has_side_effects(t)}}),Qr(dt,function(e,t){if(e.bcatch&&e.bfinally&&e.bfinally.body.every(Gi)&&(e.bfinally=null),t.option("dead_code")&&e.body.body.every(Gi)){var n=[];return e.bcatch&&zr(t,e.bcatch,n),e.bfinally&&n.push(...e.bfinally.body),p(Fe,e,{body:n}).optimize(t)}return e}),gt.DEFMETHOD("to_assignments",function(e){var t=e.option("reduce_vars"),n=[];for(const e of this.definitions){if(e.value){var i=p(yn,e.name,e.name);n.push(p(Vt,e,{operator:"=",logical:!1,left:i,right:e.value})),t&&(i.definition().fixed=!1)}const r=e.name.definition();r.eliminated++,r.replaced--}return 0==n.length?null:Fi(this,n)}),Qr(gt,function(e){return 0==e.definitions.length?p(ke,e):e}),Qr(Dt,function(e,t){return e.name instanceof fn&&null!=e.value&&ur(e.value,t)&&(e.value=null),e}),Qr(yt,function(e){return e}),Qr(Ct,function(e,t){var n=e.expression,i=n;lo(e.args);var r=e.args.every(e=>!(e instanceof He));t.option("reduce_vars")&&i instanceof yn&&(i=i.fixed_value());var o=i instanceof Xe;if(o&&i.pinned())return e;if(t.option("unused")&&r&&o&&!i.uses_arguments){for(var a=0,s=0,u=0,c=e.args.length;u=i.argnames.length;if(l||Ti(i.argnames[u],1)){if(v=e.args[u].drop_side_effect_free(t))e.args[a++]=v;else if(!l){e.args[a++]=p(wn,e.args[u],{value:0});continue}}else e.args[a++]=e.args[u];s=a}e.args.length=s}if(n instanceof kt&&n.expression instanceof yn&&"console"===n.expression.name&&n.expression.definition().undeclared&&"assert"===n.property){const n=e.args[0];if(n){const i=n.evaluate(t);if(1===i||!0===i)return p(Ln,e)}}if(t.option("unsafe")&&!n.contains_optional()){if(n instanceof kt&&"Array"===n.start.value&&"from"===n.property&&1===e.args.length){const[n]=e.args;if(n instanceof Gt)return p(Gt,n,{elements:n.elements}).optimize(t)}if(nr(n))switch(n.name){case"Array":if(1!=e.args.length)return p(Gt,e,{elements:e.args}).optimize(t);if(e.args[0]instanceof wn&&e.args[0].value<=11){const t=[];for(let n=0;n=1&&e.args.length<=2&&e.args.every(e=>{var n=e.evaluate(t);return f.push(n),e!==n})&&A(f[0])){let[n,i]=f;n=S(new RegExp(n).source);const r=p(In,e,{value:{source:n,flags:i}});if(r._eval(t)!==r)return r}}else if(n instanceof kt)switch(n.property){case"toString":if(0==e.args.length&&!n.expression.may_throw_on_access(t))return p(Bt,e,{left:p(Mn,e,{value:""}),operator:"+",right:n.expression}).optimize(t);break;case"join":if(n.expression instanceof Gt)e:{var d;if(!(e.args.length>0&&(d=e.args[0].evaluate(t))===e.args[0])){var h,_=[],m=[];for(u=0,c=n.expression.elements.length;u0&&(_.push(p(Mn,e,{value:m.join(d)})),m.length=0),_.push(g))}return m.length>0&&_.push(p(Mn,e,{value:m.join(d)})),0==_.length?p(Mn,e,{value:""}):1==_.length?_[0].is_string(t)?_[0]:p(Bt,_[0],{operator:"+",left:p(Mn,e,{value:""}),right:_[0]}):""==d?(h=_[0].is_string(t)||_[1].is_string(t)?_.shift():p(Mn,e,{value:""}),_.reduce(function(e,t){return p(Bt,t,{operator:"+",left:e,right:t})},h).optimize(t)):((v=e.clone()).expression=v.expression.clone(),v.expression.expression=v.expression.expression.clone(),v.expression.expression.elements=_,xi(t,e,v));var v}}break;case"charAt":if(n.expression.is_string(t)){var b=e.args[0],D=b?b.evaluate(t):0;if(D!==b)return p(wt,n,{expression:n.expression,property:Mi(0|D,b||n)}).optimize(t)}break;case"apply":if(2==e.args.length&&e.args[1]instanceof Gt){var y=e.args[1].elements.slice();return y.unshift(e.args[0]),p(Ct,e,{expression:p(kt,n,{expression:n.expression,optional:!1,property:"call"}),args:y}).optimize(t)}break;case"call":var T=n.expression;if(T instanceof yn&&(T=T.fixed_value()),T instanceof Xe&&!T.contains_this())return(e.args.length?Fi(this,[e.args[0],p(Ct,e,{expression:n.expression,args:e.args.slice(1)})]):p(Ct,e,{expression:n.expression,args:[]})).optimize(t)}}if(t.option("unsafe_Function")&&nr(n)&&"Function"==n.name){if(0==e.args.length)return ki(e).optimize(t);if(e.args.every(e=>e instanceof Mn))try{var C="n(function("+e.args.slice(0,-1).map(function(e){return e.value}).join(",")+"){"+e.args[e.args.length-1].value+"})",R=me(C),O=t.mangle_options();R.figure_out_scope(O);var F,k=new Zr(t.options,{mangle_options:t._mangle_options});(R=R.transform(k)).figure_out_scope(O),R.compute_char_frequency(O),R.mangle_names(O),Xn(R,e=>{if(Vi(e))return F=e,Wn});C=ai();return Fe.prototype._codegen.call(F,F,C),e.args=[p(Mn,e,{value:F.argnames.map(function(e){return e.print_to_string()}).join(",")}),p(Mn,e.args[e.args.length-1],{value:C.get().replace(/^{|}$/g,"")})],e}catch(e){if(!(e instanceof oe))throw e}}return $r(e,t)}),De.DEFMETHOD("contains_optional",function(){return(this instanceof Ft||this instanceof Ct||this instanceof xt)&&(!!this.optional||this.expression.contains_optional())}),Qr(Rt,function(e,t){return t.option("unsafe")&&nr(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name)?p(Ct,e,e).transform(t):e}),Qr(Ot,function(e,t){if(!t.option("side_effects"))return e;var n,i,r=[];n=ti(t),i=e.expressions.length-1,e.expressions.forEach(function(e,o){o0&&ur(r[o],t);)o--;o0)return(n=this.clone()).right=Fi(this.right,t.slice(o)),(t=t.slice(0,o)).push(n),Fi(this,t).optimize(e)}}return this});var ro=g("== === != !== * & | ^");function oo(e,t){return e instanceof yn||e.TYPE===t.TYPE}Qr(Bt,function(e,t){function n(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function i(t){if(n()){t&&(e.operator=t);var i=e.left;e.left=e.right,e.right=i}}if(t.option("lhs_constants")&&ro.has(e.operator)&&e.right.is_constant()&&!e.left.is_constant()&&(e.left instanceof Bt&&he[e.left.operator]>=he[e.operator]||i()),e=e.lift_sequences(t),t.option("comparisons"))switch(e.operator){case"===":case"!==":var r=!0;(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_bigint(t)&&e.right.is_bigint(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right))&&(e.operator=e.operator.substr(0,2));case"==":case"!=":if(!r&&ur(e.left,t))e.left=p(Pn,e.left);else if(!r&&ur(e.right,t))e.right=p(Pn,e.right);else if(t.option("typeofs")&&e.left instanceof Mn&&"undefined"==e.left.value&&e.right instanceof Nt&&"typeof"==e.right.operator){((o=e.right.expression)instanceof yn?!o.is_declared(t):o instanceof Ft&&t.option("ie8"))||(e.right=o,e.left=p(Ln,e.left).optimize(t),2==e.operator.length&&(e.operator+="="))}else if(t.option("typeofs")&&e.left instanceof Nt&&"typeof"==e.left.operator&&e.right instanceof Mn&&"undefined"==e.right.value){var o;((o=e.left.expression)instanceof yn?!o.is_declared(t):o instanceof Ft&&t.option("ie8"))||(e.left=o,e.right=p(Ln,e.right).optimize(t),2==e.operator.length&&(e.operator+="="))}else{if(e.left instanceof yn&&e.right instanceof yn&&e.left.definition()===e.right.definition()&&((u=e.left.fixed_value())instanceof Gt||u instanceof Xe||u instanceof Kt||u instanceof Zt))return p("="==e.operator[0]?Hn:Kn,e);if(e.left.is_32_bit_integer(t)&&e.right.is_32_bit_integer(t)){const n=e=>p(Nt,e,{operator:"!",expression:e}),i=(e,i)=>i?t.in_boolean_context()?e:n(n(e)):n(e);if(e.left instanceof wn&&0===e.left.value)return i(e.right,"!"===e.operator[0]);if(e.right instanceof wn&&0===e.right.value)return i(e.left,"!"===e.operator[0]);let r,o,a;if((r=e.left instanceof Bt?e.left:e.right instanceof Bt?e.right:null)&&(a=r===e.left?e.right:e.left)&&"&"===r.operator&&a instanceof wn&&a.is_32_bit_integer(t)&&(o=r.left.equivalent_to(a)?r.right:r.right.equivalent_to(a)?r.left:null)){let n=i(p(Bt,e,{operator:"&",left:a,right:p(Nt,e,{operator:"~",expression:o})}),"!"===e.operator[0]);return xi(t,n,e)}}}break;case"&&":case"||":var a=e.left;if(a.operator==e.operator&&(a=a.right),a instanceof Bt&&a.operator==("&&"==e.operator?"!==":"===")&&e.right instanceof Bt&&a.operator==e.right.operator&&(ur(a.left,t)&&e.right.left instanceof Pn||a.left instanceof Pn&&ur(e.right.left,t))&&!a.right.has_side_effects(t)&&a.right.equivalent_to(e.right.right)){var s=p(Bt,e,{operator:a.operator.slice(0,-1),left:p(Pn,e),right:a.right});return a!==e.left&&(s=p(Bt,e,{operator:e.operator,left:e.left.left,right:s})),s}}var u;if("+"==e.operator&&t.in_boolean_context()){var c=e.left.evaluate(t),l=e.right.evaluate(t);if(c&&"string"==typeof c)return Fi(e,[e.right,p(Hn,e)]).optimize(t);if(l&&"string"==typeof l)return Fi(e,[e.left,p(Hn,e)]).optimize(t)}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof Bt)||t.parent()instanceof Vt){var f=p(Nt,e,{operator:"!",expression:e.negate(t,ti(t))});e=xi(t,e,f)}if(t.option("unsafe_comps"))switch(e.operator){case"<":i(">");break;case"<=":i(">=")}}if("+"==e.operator){if(e.right instanceof Mn&&""==e.right.getValue()&&e.left.is_string(t))return e.left;if(e.left instanceof Mn&&""==e.left.getValue()&&e.right.is_string(t))return e.right;if(e.left instanceof Bt&&"+"==e.left.operator&&e.left.left instanceof Mn&&""==e.left.left.getValue()&&e.right.is_string(t))return e.left=e.left.right,e}if(t.option("evaluate")){switch(e.operator){case"&&":if(!(c=!!Ti(e.left,2)||!Ti(e.left,4)&&e.left.evaluate(t)))return Bi(t.parent(),t.self(),e.left).optimize(t);if(!(c instanceof De))return Fi(e,[e.left,e.right]).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof De)){if("&&"==(d=t.parent()).operator&&d.left===t.self()||t.in_boolean_context())return e.left.optimize(t)}}else{if(t.in_boolean_context())return Fi(e,[e.left,p(Kn,e)]).optimize(t);Ci(e,4)}if("||"==e.left.operator)if(!(h=e.left.right.evaluate(t)))return p(Lt,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t);break;case"||":var d,h;if(!(c=!!Ti(e.left,2)||!Ti(e.left,4)&&e.left.evaluate(t)))return Fi(e,[e.left,e.right]).optimize(t);if(!(c instanceof De))return Bi(t.parent(),t.self(),e.left).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof De)){if(t.in_boolean_context())return Fi(e,[e.left,p(Hn,e)]).optimize(t);Ci(e,2)}}else if("||"==(d=t.parent()).operator&&d.left===t.self()||t.in_boolean_context())return e.left.optimize(t);if("&&"==e.left.operator)if((h=e.left.right.evaluate(t))&&!(h instanceof De))return p(Lt,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t);break;case"??":if(fr(e.left,t))return e.right;if(!((c=e.left.evaluate(t))instanceof De))return null==c?e.right:e.left;if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof De||n))return e.left}}var _=!0;switch(e.operator){case"+":if(e.right instanceof kn&&e.left instanceof Bt&&"+"==e.left.operator&&e.left.is_string(t)){var m=(g=p(Bt,e,{operator:"+",left:e.left.right,right:e.right})).optimize(t);g!==m&&(e=p(Bt,e,{operator:"+",left:e.left.left,right:m}))}if(e.left instanceof Bt&&"+"==e.left.operator&&e.left.is_string(t)&&e.right instanceof Bt&&"+"==e.right.operator&&e.right.is_string(t)){var g,E=(g=p(Bt,e,{operator:"+",left:e.left.right,right:e.right.left})).optimize(t);g!==E&&(e=p(Bt,e,{operator:"+",left:p(Bt,e.left,{operator:"+",left:e.left.left,right:E}),right:e.right.right}))}if(e.right instanceof Nt&&"-"==e.right.operator&&e.left.is_number_or_bigint(t)){e=p(Bt,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof Nt&&"-"==e.left.operator&&n()&&e.right.is_number_or_bigint(t)){e=p(Bt,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof Ze){var v=e.left;if((m=e.right.evaluate(t))!=e.right)return v.segments[v.segments.length-1].value+=String(m),v}if(e.right instanceof Ze){m=e.right;if((v=e.left.evaluate(t))!=e.left)return m.segments[0].value=String(v)+m.segments[0].value,m}if(e.left instanceof Ze&&e.right instanceof Ze){var b=(v=e.left).segments;m=e.right;b[b.length-1].value+=m.segments[0].value;for(var D=1;D=he[e.operator])){var S=p(Bt,e,{operator:e.operator,left:e.right,right:e.left});e=e.right instanceof kn&&!(e.left instanceof kn)?xi(t,S,e):xi(t,e,S)}_&&e.is_number_or_bigint(t)&&(e.right instanceof Bt&&e.right.operator==e.operator&&(e=p(Bt,e,{operator:e.operator,left:p(Bt,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof kn&&e.left instanceof Bt&&e.left.operator==e.operator&&(e.left.left instanceof kn?e=p(Bt,e,{operator:e.operator,left:p(Bt,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right}):e.left.right instanceof kn&&(e=p(Bt,e,{operator:e.operator,left:p(Bt,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left}))),e.left instanceof Bt&&e.left.operator==e.operator&&e.left.right instanceof kn&&e.right instanceof Bt&&e.right.operator==e.operator&&e.right.left instanceof kn&&(e=p(Bt,e,{operator:e.operator,left:p(Bt,e.left,{operator:e.operator,left:p(Bt,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})))}if(ir.has(e.operator)){let n,i,r,o,a=e.left;if("&"===e.operator&&e.right instanceof Bt&&"|"===e.right.operator&&"number"==typeof(i=e.left.evaluate(t))&&("number"==typeof(n=e.right.right.evaluate(t))?(r=e.right.left,o=e.right.right):"number"==typeof(n=e.right.left.evaluate(t))&&(r=e.right.right,o=e.right.left),r&&o))if(0===(n&i))e=p(Bt,e,{operator:e.operator,left:a,right:r});else{const s=p(Bt,e,{operator:"|",left:p(Bt,e,{operator:"&",left:r,right:a}),right:Mi(n&i,o)});e=xi(t,e,s)}"|"!==e.operator&&"&"!==e.operator||!e.left.equivalent_to(e.right)||e.left.has_side_effects(t)||!t.in_32_bit_context(!0)||(e.left=p(wn,e,{value:0}),e.operator="|"),"^"===e.operator&&e.left instanceof Nt&&"~"===e.left.operator&&e.right instanceof Nt&&"~"===e.right.operator&&(e=p(Bt,e,{operator:"^",left:e.left.expression,right:e.right.expression})),("<<"===e.operator||">>"===e.operator)&&e.right instanceof wn&&0===e.right.value&&(e.operator="|");const s=e.right instanceof wn&&0===e.right.value?e.right:e.left instanceof wn&&0===e.left.value?e.left:null,u=s&&(s===e.right?e.left:e.right);if(s&&("|"===e.operator||"^"===e.operator)&&(u.is_32_bit_integer(t)||t.in_32_bit_context(!0)))return u;if(s&&"&"===e.operator&&!u.has_side_effects(t)&&u.is_32_bit_integer(t))return s;const c=e=>e instanceof wn&&-1===e.value||e instanceof Nt&&"-"===e.operator&&e.expression instanceof wn&&1===e.expression.value,l=c(e.right)?e.right:c(e.left)?e.left:null,f=l===e.right?e.left:e.right;if(l&&"&"===e.operator&&(f.is_32_bit_integer(t)||t.in_32_bit_context(!0)))return f;if(l&&"^"===e.operator&&(f.is_32_bit_integer(t)||t.in_32_bit_context(!0)))return f.bitwise_negate(t)}}if(e.right instanceof Bt&&e.right.operator==e.operator&&(rr.has(e.operator)||"+"==e.operator&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t))))return e.left=p(Bt,e.left,{operator:e.operator,left:e.left.transform(t),right:e.right.left.transform(t)}),e.right=e.right.right.transform(t),e.transform(t);var y=e.evaluate(t);return y!==e?(y=Mi(y,e).optimize(t),xi(t,y,e)):e}),Qr(An,function(e){return e}),Qr(yn,function(e,t){if(!t.option("ie8")&&nr(e)&&!t.find_parent(Ue))switch(e.name){case"undefined":return p(Ln,e).optimize(t);case"NaN":return p(Bn,e).optimize(t);case"Infinity":return p(Un,e).optimize(t)}return t.option("reduce_vars")&&!t.is_lhs()?Yr(e,t):e}),Qr(Ln,function(e,t){if(t.option("unsafe_undefined")){var n=Jr(t,"undefined");if(n){var i=p(yn,e,{name:"undefined",scope:n.scope,thedef:n});return Ci(i,8),i}}var r=t.is_lhs();return r&&oo(r,e)?e:p(Nt,e,{operator:"void",expression:p(wn,e,{value:0})})}),Qr(Un,function(e,t){var n=t.is_lhs();return n&&oo(n,e)?e:!t.option("keep_infinity")||n&&!oo(n,e)||Jr(t,"Infinity")?p(Bt,e,{operator:"/",left:p(wn,e,{value:1}),right:p(wn,e,{value:0})}):e}),Qr(Bn,function(e,t){var n=t.is_lhs();return n&&!oo(n,e)||Jr(t,"NaN")?p(Bt,e,{operator:"/",left:p(wn,e,{value:0}),right:p(wn,e,{value:0})}):e});const ao=g("+ - / * % >> << >>> | ^ &"),so=g("* | ^ &");function uo(e,t){return e instanceof yn&&(e=e.fixed_value()),!!e&&(!(e instanceof Xe||e instanceof Zt)||(!(e instanceof Xe&&e.contains_this())||t.parent()instanceof Rt))}function co(e,t){return t.in_boolean_context()?xi(t,e,Fi(e,[e,p(Hn,e)]).optimize(t)):e}function lo(e){for(var t=0;te instanceof Vn)&&(e.splice(t,1,...i.elements),t--)}}}function fo(e,t){if(!t.option("computed_props"))return e;if(!(e.key instanceof kn))return e;if(e.key instanceof Mn||e.key instanceof wn){const n=e.key.value.toString();if("__proto__"===n)return e;if("constructor"==n&&t.parent()instanceof Zt)return e;e instanceof Xt?(e.quote=e.key.quote,e.key=n):e instanceof Qt?(e.quote=e.key.quote,e.key=p(_n,e.key,{name:n})):(e.quote=e.key.quote,e.key=p(hn,e.key,{name:n}))}return e}Qr(Vt,function(e,t){if(e.logical)return e.lift_sequences(t);var n;if("="===e.operator&&e.left instanceof yn&&"arguments"!==e.left.name&&!(n=e.left.definition()).undeclared&&e.right.equivalent_to(e.left))return e.right;if(t.option("dead_code")&&e.left instanceof yn&&(n=e.left.definition()).scope===t.find_parent(Xe)){var i,r=0,o=e;do{if(i=o,(o=t.parent(r++))instanceof et){if(a(r,o))break;if(qi(n.scope,[n]))break;return"="==e.operator?e.right:(n.fixed=!1,p(Bt,e,{operator:e.operator.slice(0,-1),left:e.left,right:e.right}).optimize(t))}}while(o instanceof Bt&&o.right===i||o instanceof Ot&&o.tail_node()===i)}return"="==(e=e.lift_sequences(t)).operator&&e.left instanceof yn&&e.right instanceof Bt&&(e.right.left instanceof yn&&e.right.left.name==e.left.name&&ao.has(e.right.operator)?(e.operator=e.right.operator+"=",e.right=e.right.right):e.right.right instanceof yn&&e.right.right.name==e.left.name&&so.has(e.right.operator)&&!e.right.left.has_side_effects(t)&&(e.operator=e.right.operator+"=",e.right=e.right.left)),e;function a(n,i){function r(){const n=e.right;e.right=p(Pn,n);const r=i.may_throw(t);return e.right=n,r}for(var o,a=e.left.definition().scope.get_defun_scope();(o=t.parent(n++))!==a;)if(o instanceof dt){if(o.bfinally)return!0;if(o.bcatch&&r())return!0}}}),Qr(Ut,function(e,t){if(!t.option("evaluate"))return e;var n=e.right.evaluate(t);let i,r;return void 0===n?(i=t.parent())instanceof Xe&&!1!==t.option("keep_fargs")&&("Call"!==(r=t.parent(1)).TYPE||r.expression!==i)||(e=e.left):n!==e.right&&(n=Mi(n,e.right),e.right=wi(n,e.right)),e}),Qr(Lt,function(e,t){if(!t.option("conditionals"))return e;if(e.condition instanceof Ot){var n=e.condition.expressions.slice();return e.condition=n.pop(),n.push(e),Fi(e,n)}var i=e.condition.evaluate(t);if(i!==e.condition)return Bi(t.parent(),t.self(),i?e.consequent:e.alternative);var r=i.negate(t,ti(t));xi(t,i,r)===r&&(e=p(Lt,e,{condition:r,consequent:e.alternative,alternative:e.consequent}));var o,a=e.condition,s=e.consequent,u=e.alternative;if(a instanceof yn&&s instanceof yn&&a.definition()===s.definition())return p(Bt,e,{operator:"||",left:a,right:u});if(s instanceof Vt&&u instanceof Vt&&s.operator===u.operator&&s.logical===u.logical&&s.left.equivalent_to(u.left)&&(!e.condition.has_side_effects(t)||"="==s.operator&&!s.left.has_side_effects(t)))return p(Vt,e,{operator:s.operator,left:s.left,logical:s.logical,right:p(Lt,e,{condition:e.condition,consequent:s.right,alternative:u.right})});if(s instanceof Ct&&u.TYPE===s.TYPE&&s.args.length>0&&s.args.length==u.args.length&&s.expression.equivalent_to(u.expression)&&!e.condition.has_side_effects(t)&&!s.expression.has_side_effects(t)&&"number"==typeof(o=function(){for(var e=s.args,t=u.args,n=0,i=e.length;n=2020&&function(e,t,n){if(t.may_throw(n))return!1;let i;if(e instanceof Bt&&"=="===e.operator&&((i=fr(e.left,n)&&e.left)||(i=fr(e.right,n)&&e.right))&&(i===e.left?e.right:e.left).equivalent_to(t))return!0;if(e instanceof Bt&&"||"===e.operator){let i,r;const o=e=>{if(!(e instanceof Bt)||"==="!==e.operator&&"=="!==e.operator)return!1;let o,a=0;return e.left instanceof Pn&&(a++,i=e,o=e.right),e.right instanceof Pn&&(a++,i=e,o=e.left),ur(e.left,n)&&(a++,r=e,o=e.right),ur(e.right,n)&&(a++,r=e,o=e.left),1===a&&!!o.equivalent_to(t)};if(!o(e.left))return!1;if(!o(e.right))return!1;if(i&&r&&i!==r)return!0}return!1}(a,u,t))return p(Bt,e,{operator:"??",left:u,right:s}).optimize(t);if(u instanceof Ot&&s.equivalent_to(u.expressions[u.expressions.length-1]))return Fi(e,[p(Bt,e,{operator:"||",left:a,right:Fi(e,u.expressions.slice(0,-1))}),s]).optimize(t);if(u instanceof Bt&&"&&"==u.operator&&s.equivalent_to(u.right))return p(Bt,e,{operator:"&&",left:p(Bt,e,{operator:"||",left:a,right:u.left}),right:s}).optimize(t);if(s instanceof Lt&&s.alternative.equivalent_to(u))return p(Lt,e,{condition:p(Bt,e,{left:e.condition,operator:"&&",right:s.condition}),consequent:s.consequent,alternative:u});if(s.equivalent_to(u))return Fi(e,[e.condition,s]).optimize(t);if(s instanceof Bt&&"||"==s.operator&&s.right.equivalent_to(u))return p(Bt,e,{operator:"||",left:p(Bt,e,{operator:"&&",left:e.condition,right:s.left}),right:u}).optimize(t);const l=t.in_boolean_context();return d(e.consequent)?h(e.alternative)?f(e.condition):p(Bt,e,{operator:"||",left:f(e.condition),right:e.alternative}):h(e.consequent)?d(e.alternative)?f(e.condition.negate(t)):p(Bt,e,{operator:"&&",left:f(e.condition.negate(t)),right:e.alternative}):d(e.alternative)?p(Bt,e,{operator:"||",left:f(e.condition.negate(t)),right:e.consequent}):h(e.alternative)?p(Bt,e,{operator:"&&",left:f(e.condition),right:e.consequent}):e;function f(e){return e.is_boolean()?e:p(Nt,e,{operator:"!",expression:e.negate(t)})}function d(e){return e instanceof Hn||l&&e instanceof kn&&e.getValue()||e instanceof Nt&&"!"==e.operator&&e.expression instanceof kn&&!e.expression.getValue()}function h(e){return e instanceof Kn||l&&e instanceof kn&&!e.getValue()||e instanceof Nt&&"!"==e.operator&&e.expression instanceof kn&&e.expression.getValue()}}),Qr(Gn,function(e,t){if(t.in_boolean_context())return p(wn,e,{value:+e.value});var n=t.parent();return t.option("booleans_as_integers")?(n instanceof Bt&&("==="==n.operator||"!=="==n.operator)&&(n.operator=n.operator.replace(/=$/,"")),p(wn,e,{value:+e.value})):t.option("booleans")?n instanceof Bt&&("=="==n.operator||"!="==n.operator)?p(wn,e,{value:+e.value}):p(Nt,e,{operator:"!",expression:p(wn,e,{value:1-e.value})}):e}),Ft.DEFMETHOD("flatten_object",function(e,t){if(t.option("properties")&&"__proto__"!==e&&!(this instanceof Mt)){var n=t.option("unsafe_arrows")&&t.option("ecma")>=2015,i=this.expression;if(i instanceof Kt)for(var r=i.properties,o=r.length;--o>=0;){var a=r[o];if(""+(a instanceof $t?a.key.name:a.key)==e){if(!r.every(e=>(e instanceof Xt||n&&e instanceof $t&&!e.value.is_generator)&&!e.computed_key()))return;if(!uo(a.value,t))return;return p(wt,this,{expression:p(Gt,i,{elements:r.map(function(e){var t=e.value;t instanceof ze&&(t=p(We,t,t));var n=e.key;return n instanceof De&&!(n instanceof hn)?Fi(e,[n,t]):t})}),property:p(wn,this,{value:o})})}}}}),Qr(wt,function(e,t){var n,i=e.expression,r=e.property;if(t.option("properties")){var o=r.evaluate(t);if(o!==r){if("string"==typeof o)if("undefined"==o)o=void 0;else(S=parseFloat(o)).toString()==o&&(o=S);r=e.property=wi(r,Mi(o,r).transform(t));var a=""+o;if(ne(a)&&a.length<=r.size()+1)return p(kt,e,{expression:i,optional:e.optional,property:a,quote:r.quote}).optimize(t)}}e:if(t.option("arguments")&&i instanceof yn&&"arguments"==i.name&&1==i.definition().orig.length&&(n=i.scope)instanceof Xe&&n.uses_arguments&&!(n instanceof qe)&&r instanceof wn){for(var s=r.getValue(),u=new Set,c=n.argnames,l=0;l1)&&(d=null)}else if(!d&&!t.option("keep_fargs")&&s=n.argnames.length;)d=n.create_symbol(pn,{source:n,scope:n,tentative_name:"argument_"+n.argnames.length}),n.argnames.push(d);if(d){var _=p(yn,e,d);return _.reference({}),Ri(d,1),_}}if(t.is_lhs())return e;if(o!==r){var m=e.flatten_object(a,t);m&&(i=e.expression=m.expression,r=e.property=m.property)}if(t.option("properties")&&t.option("side_effects")&&r instanceof wn&&i instanceof Gt){s=r.getValue();var g=i.elements,E=g[s];e:if(uo(E,t)){for(var v=!0,b=[],D=g.length;--D>s;){(S=g[D].drop_side_effect_free(t))&&(b.unshift(S),v&&S.has_side_effects(t)&&(v=!1))}if(E instanceof He)break e;for(E=E instanceof Vn?p(Ln,E):E,v||b.unshift(E);--D>=0;){var S;if((S=g[D])instanceof He)break e;(S=S.drop_side_effect_free(t))?b.unshift(S):s--}return v?(b.push(E),Fi(e,b).optimize(t)):p(wt,e,{expression:p(Gt,i,{elements:b}),property:p(wn,r,{value:s})})}}var y=e.evaluate(t);return y!==e?xi(t,y=Mi(y,e).optimize(t),e):e}),Qr(xt,function(e,t){if(fr(e.expression,t)){let n=t.parent();return n instanceof Nt&&"delete"===n.operator?Mi(0,e):p(Ln,e)}return e.expression instanceof Ft||e.expression instanceof Ct?e:e.expression}),Qr(kt,function(e,t){const n=t.parent();if(t.is_lhs())return e;if(t.option("unsafe_proto")&&e.expression instanceof kt&&"prototype"==e.expression.property){var i=e.expression.expression;if(nr(i))switch(i.name){case"Array":e.expression=p(Gt,e.expression,{elements:[]});break;case"Function":e.expression=ki(e.expression);break;case"Number":e.expression=p(wn,e.expression,{value:0});break;case"Object":e.expression=p(Kt,e.expression,{properties:[]});break;case"RegExp":e.expression=p(In,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=p(Mn,e.expression,{value:""})}}if(!(n instanceof Ct&&T(n,Zn))){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}if(e.expression instanceof Ft&&n instanceof Ft)return e;let r=e.evaluate(t);return r!==e?(r=Mi(r,e).optimize(t),xi(t,r,e)):e}),Qr(Gt,function(e,t){var n=co(e,t);return n!==e?n:(lo(e.elements),e)}),Qr(Kt,function(e,t){var n=co(e,t);return n!==e?n:(function(e){for(var t=0;te instanceof Xt)?(e.splice(t,1,...i.properties),t--):!(i instanceof kn||i.is_constant())||i instanceof Mn||(e.splice(t,1),t--)}}}(e.properties),e)}),Qr(In,co),Qr(tt,function(e,t){return e.value&&ur(e.value,t)&&(e.value=null),e}),Qr(qe,no),Qr(We,function(e,t){if(e=no(e,t),t.option("unsafe_arrows")&&t.option("ecma")>=2015&&!e.name&&!e.is_generator&&!e.uses_arguments&&!e.pinned()){if(!Xn(e,e=>{if(e instanceof On)return Wn}))return p(qe,e,e).optimize(t)}return e}),Qr(Zt,function(e){for(let t=0;t=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var i=e.key,r=e.value;if((r instanceof qe&&Array.isArray(r.body)&&!r.contains_this()||r instanceof We)&&!r.name)return p($t,e,{key:i instanceof De?i:p(hn,e,{name:i}),value:p(ze,r,r),quote:e.quote})}return e}),Qr($e,function(e,t){if(1==t.option("pure_getters")&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!function(e){for(var t=[/^VarDef$/,/^(Const|Let|Var)$/,/^Export$/],n=0,i=0,r=t.length;n>>=1,o&&(n=-2147483648|-n),t+n}function bo(e,t,n){let i=t-n;i=i<0?-i<<1|1:i<<1;do{let t=31&i;i>>>=5,i>0&&(t|=32),e.write(go[t])}while(i>0);return t}function Do(e,t){return!(e.pos>=t)&&e.peek()!==ho}var So=void 0!==po?new po:"undefined"!=typeof Buffer?{decode:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}:{decode(e){let t="";for(let n=0;n0?t+So.decode(e.subarray(0,n)):t}},Ao=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){const{buffer:t,pos:n}=this,i=t.indexOf(e,n);return-1===i?t.length:i}};function To(e){e.sort(Co)}function Co(e,t){return e[0]-t[0]}function Ro(e){const t=new yo;let n=0,i=0,r=0,o=0;for(let a=0;a0&&t.write(_o),0===s.length)continue;let u=0;for(let e=0;e0&&t.write(ho),u=bo(t,a[0],u),1!==a.length&&(n=bo(t,a[1],n),i=bo(t,a[2],i),r=bo(t,a[3],r),4!==a.length&&(o=bo(t,a[4],o)))}}return t.flush()}var Oo=n(4424);function Fo(e,t){for(let n=t;n=0&&e[i][0]===t;n=i--);return n}function Po(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function Bo(e,t,n,i){const{lastKey:r,lastNeedle:o,lastIndex:a}=n;let s=0,u=e.length-1;if(i===r){if(t===o)return xo=-1!==a&&e[a][0]===t,a;t>=o?s=-1===a?0:a:u=a}return n.lastKey=i,n.lastNeedle=t,n.lastIndex=function(e,t,n,i){for(;n<=i;){const r=n+(i-n>>1),o=e[r][0]-t;if(0===o)return xo=!0,r;o<0?n=r+1:i=r-1}return xo=!1,n-1}(e,t,s,u)}function Lo(e,t,n){for(let n=e.length;n>t;n--)e[n]=e[n-1];e[t]=n}function Vo(){return{__proto__:null}}function Uo(e){return"string"==typeof e?JSON.parse(e):e}var Go=function(e,t){const n=Uo(e);if(!("sections"in n))return new Yo(n,t);const i=[],r=[],o=[],a=[],s=[];Ko(n,t,i,r,o,a,s,0,0,1/0,1/0);return function(e,t){const n=new Yo(Qo(e,[]),t);return n._decoded=e.mappings,n}({version:3,file:n.file,names:a,sources:r,sourcesContent:o,mappings:i,ignoreList:s})};function Ko(e,t,n,i,r,o,a,s,u,c,l){const{sections:f}=e;for(let e=0;ec)return;const i=zo(n,t),r=0===e?u:0,o=_[e];for(let e=0;e=l)return;if(1===n.length){i.push([a]);continue}const s=d+n[1],u=n[2],f=n[3];i.push(4===n.length?[a,s,u,f]:[a,s,u,f,h+n[4]])}}}function Xo(e,t){for(let n=0;nOo(i+(e||""),n)}(t,s);this.resolvedSources=u.map(l);const{mappings:f}=i;if("string"==typeof f)this._encoded=f,this._decoded=void 0;else{if(!Array.isArray(f))throw i.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(i)}`);this._encoded=void 0,this._decoded=function(e,t){const n=Fo(e,0);if(n===e.length)return e;t||(e=e.slice());for(let i=n;i=0&&!(e[t].length>0);n=t,t--);n=0;n=i--){if(t>=e[i][0])break}return n}(d,i);if(!r){if(e&&function(e,t){if(0===t)return!0;const n=e[t-1];return 1===n.length}(d,h))return;return ca(d,h,[i])}const _=oa(l,r),m=s?oa(p,s):-1;if(_===f.length&&(f[_]=null!=u?u:null),!e||!function(e,t,n,i,r,o){if(0===t)return!1;const a=e[t-1];return 1!==a.length&&(n===a[1]&&i===a[2]&&r===a[3]&&o===(5===a.length?a[4]:-1))}(d,h,_,o,a,m))return ca(d,h,s?[i,_,o,a,m]:[i,_,o,a])}function ca(e,t,n){for(let n=e.length;n>t;n--)e[n]=e[n-1];e[t]=n}function la(e,t){for(let n=0;n=o.length)return Jo(null,null,null,null);const a=o[n],s=ta(a,e._decodedMemo,n,i,r||1);if(-1===s)return Jo(null,null,null,null);const u=a[s];if(1===u.length)return Jo(null,null,null,null);const{names:c,resolvedSources:l}=e;return Jo(l[u[1]],u[2]+1,u[3],5===u.length?c[u[4]]:null)}(this._map,e)}generatedPositionFor(e){return function(e,t){const{source:n,line:i,column:r,bias:o}=t;return na(e,n,i,r,o||1,!1)}(this._map,e)}allGeneratedPositionsFor(e){return function(e,t){const{source:n,line:i,column:r,bias:o}=t;return na(e,n,i,r,o||-1,!0)}(this._map,e)}hasContentsOfAllSources(){if(!this.sourcesContent||this.sourcesContent.length!==this.sources.length)return!1;for(const e of this.sourcesContent)if(null==e)return!1;return!0}sourceContentFor(e,t){const n=function(e,t){const{sourcesContent:n}=e;if(null==n)return null;const i=Zo(e,t);return-1===i?null:n[i]}(this._map,e);if(null!=n)return n;if(t)return null;throw new Error(`"${e}" is not in the SourceMap.`)}eachMapping(e,t){!function(e,t){const n=jo(e),{names:i,resolvedSources:r}=e;for(let e=0;enull),n._mappings=jo(t),t.ignoreList&&la(n._ignoreList,t.ignoreList),n}(t))}addMapping(e){((e,t)=>{fa(!0,e,t)})(this._map,e)}setSourceContent(e,t){!function(e,t,n){const{_sources:i,_sourcesContent:r}=e;r[oa(i,t)]=n}(this._map,e,t)}toJSON(){return function(e){const t=sa(e);return Object.assign({},t,{mappings:Ro(t.mappings)})}(this._map)}toString(){return JSON.stringify(this.toJSON())}toDecodedMap(){return sa(this._map)}};var ha=["$&","$'","$*","$+","$1","$2","$3","$4","$5","$6","$7","$8","$9","$_","$`","$input","-moz-animation","-moz-animation-delay","-moz-animation-direction","-moz-animation-duration","-moz-animation-fill-mode","-moz-animation-iteration-count","-moz-animation-name","-moz-animation-play-state","-moz-animation-timing-function","-moz-appearance","-moz-backface-visibility","-moz-border-end","-moz-border-end-color","-moz-border-end-style","-moz-border-end-width","-moz-border-image","-moz-border-start","-moz-border-start-color","-moz-border-start-style","-moz-border-start-width","-moz-box-align","-moz-box-direction","-moz-box-flex","-moz-box-ordinal-group","-moz-box-orient","-moz-box-pack","-moz-box-sizing","-moz-float-edge","-moz-font-feature-settings","-moz-font-language-override","-moz-force-broken-image-icon","-moz-hyphens","-moz-image-region","-moz-margin-end","-moz-margin-start","-moz-orient","-moz-osx-font-smoothing","-moz-outline-radius","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius-topleft","-moz-outline-radius-topright","-moz-padding-end","-moz-padding-start","-moz-perspective","-moz-perspective-origin","-moz-tab-size","-moz-text-size-adjust","-moz-transform","-moz-transform-origin","-moz-transform-style","-moz-transition","-moz-transition-delay","-moz-transition-duration","-moz-transition-property","-moz-transition-timing-function","-moz-user-focus","-moz-user-input","-moz-user-modify","-moz-user-select","-moz-window-dragging","-webkit-align-content","-webkit-align-items","-webkit-align-self","-webkit-animation","-webkit-animation-delay","-webkit-animation-direction","-webkit-animation-duration","-webkit-animation-fill-mode","-webkit-animation-iteration-count","-webkit-animation-name","-webkit-animation-play-state","-webkit-animation-timing-function","-webkit-appearance","-webkit-backface-visibility","-webkit-background-clip","-webkit-background-origin","-webkit-background-size","-webkit-border-bottom-left-radius","-webkit-border-bottom-right-radius","-webkit-border-image","-webkit-border-radius","-webkit-border-top-left-radius","-webkit-border-top-right-radius","-webkit-box-align","-webkit-box-direction","-webkit-box-flex","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-shadow","-webkit-box-sizing","-webkit-clip-path","-webkit-filter","-webkit-flex","-webkit-flex-basis","-webkit-flex-direction","-webkit-flex-flow","-webkit-flex-grow","-webkit-flex-shrink","-webkit-flex-wrap","-webkit-font-feature-settings","-webkit-justify-content","-webkit-line-clamp","-webkit-mask","-webkit-mask-clip","-webkit-mask-composite","-webkit-mask-image","-webkit-mask-origin","-webkit-mask-position","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-repeat","-webkit-mask-size","-webkit-order","-webkit-perspective","-webkit-perspective-origin","-webkit-text-fill-color","-webkit-text-security","-webkit-text-size-adjust","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-transform","-webkit-transform-origin","-webkit-transform-style","-webkit-transition","-webkit-transition-delay","-webkit-transition-duration","-webkit-transition-property","-webkit-transition-timing-function","-webkit-user-select","@@iterator","ABORT_ERR","ACTIVE","ACTIVE_ATTRIBUTES","ACTIVE_TEXTURE","ACTIVE_UNIFORMS","ACTIVE_UNIFORM_BLOCKS","ADDITION","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","ALL","ALLOW_KEYBOARD_INPUT","ALLPASS","ALPHA","ALPHA_BITS","ALREADY_SIGNALED","ALT_MASK","ALWAYS","ANY_SAMPLES_PASSED","ANY_SAMPLES_PASSED_CONSERVATIVE","ANY_TYPE","ANY_UNORDERED_NODE_TYPE","ARRAY_BUFFER","ARRAY_BUFFER_BINDING","ATTACHED_SHADERS","ATTRIBUTE_NODE","AT_TARGET","AbortController","AbortSignal","AbsoluteOrientationSensor","AbstractRange","Accelerometer","AddSearchProvider","AggregateError","AnalyserNode","Animation","AnimationEffect","AnimationEvent","AnimationPlaybackEvent","AnimationTimeline","AnonXMLHttpRequest","Any","AnyPermissions","ApplicationCache","ApplicationCacheErrorEvent","Array","ArrayBuffer","ArrayType","Atomics","Attr","Audio","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioData","AudioDecoder","AudioDestinationNode","AudioEncoder","AudioListener","AudioNode","AudioParam","AudioParamMap","AudioProcessingEvent","AudioScheduledSourceNode","AudioSinkInfo","AudioStreamTrack","AudioWorklet","AudioWorkletNode","AuthenticatorAssertionResponse","AuthenticatorAttestationResponse","AuthenticatorResponse","AutocompleteErrorEvent","BACK","BAD_BOUNDARYPOINTS_ERR","BAD_REQUEST","BANDPASS","BLEND","BLEND_COLOR","BLEND_DST_ALPHA","BLEND_DST_RGB","BLEND_EQUATION","BLEND_EQUATION_ALPHA","BLEND_EQUATION_RGB","BLEND_SRC_ALPHA","BLEND_SRC_RGB","BLUE","BLUE_BITS","BLUR","BOOL","BOOLEAN_TYPE","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","BOTH","BROWSER_DEFAULT_WEBGL","BUBBLING_PHASE","BUFFER_SIZE","BUFFER_USAGE","BYTE","BYTES_PER_ELEMENT","BackgroundFetchManager","BackgroundFetchRecord","BackgroundFetchRegistration","BarProp","BarcodeDetector","BaseAudioContext","BaseHref","BatteryManager","BeforeInstallPromptEvent","BeforeLoadEvent","BeforeUnloadEvent","BigInt","BigInt64Array","BigUint64Array","BiquadFilterNode","Blob","BlobEvent","Bluetooth","BluetoothCharacteristicProperties","BluetoothDevice","BluetoothRemoteGATTCharacteristic","BluetoothRemoteGATTDescriptor","BluetoothRemoteGATTServer","BluetoothRemoteGATTService","BluetoothUUID","Boolean","BroadcastChannel","BrowserCaptureMediaStreamTrack","BrowserInfo","ByteLengthQueuingStrategy","CAPTURING_PHASE","CCW","CDATASection","CDATA_SECTION_NODE","CHANGE","CHARSET_RULE","CHECKING","CLAMP_TO_EDGE","CLICK","CLOSED","CLOSING","COLOR","COLOR_ATTACHMENT0","COLOR_ATTACHMENT1","COLOR_ATTACHMENT10","COLOR_ATTACHMENT11","COLOR_ATTACHMENT12","COLOR_ATTACHMENT13","COLOR_ATTACHMENT14","COLOR_ATTACHMENT15","COLOR_ATTACHMENT2","COLOR_ATTACHMENT3","COLOR_ATTACHMENT4","COLOR_ATTACHMENT5","COLOR_ATTACHMENT6","COLOR_ATTACHMENT7","COLOR_ATTACHMENT8","COLOR_ATTACHMENT9","COLOR_BUFFER_BIT","COLOR_CLEAR_VALUE","COLOR_WRITEMASK","COMMENT_NODE","COMPARE_REF_TO_TEXTURE","COMPILE_STATUS","COMPLETION_STATUS_KHR","COMPRESSED_RGBA_S3TC_DXT1_EXT","COMPRESSED_RGBA_S3TC_DXT3_EXT","COMPRESSED_RGBA_S3TC_DXT5_EXT","COMPRESSED_RGB_S3TC_DXT1_EXT","COMPRESSED_TEXTURE_FORMATS","COMPUTE","CONDITION_SATISFIED","CONFIGURATION_UNSUPPORTED","CONNECTING","CONSTANT_ALPHA","CONSTANT_COLOR","CONSTRAINT_ERR","CONTEXT_LOST_WEBGL","CONTROL_MASK","COPY_DST","COPY_READ_BUFFER","COPY_READ_BUFFER_BINDING","COPY_SRC","COPY_WRITE_BUFFER","COPY_WRITE_BUFFER_BINDING","COUNTER_STYLE_RULE","CSS","CSS2Properties","CSSAnimation","CSSCharsetRule","CSSConditionRule","CSSContainerRule","CSSCounterStyleRule","CSSFontFaceRule","CSSFontFeatureValuesRule","CSSFontPaletteValuesRule","CSSGroupingRule","CSSImageValue","CSSImportRule","CSSKeyframeRule","CSSKeyframesRule","CSSKeywordValue","CSSLayerBlockRule","CSSLayerStatementRule","CSSMarginRule","CSSMathClamp","CSSMathInvert","CSSMathMax","CSSMathMin","CSSMathNegate","CSSMathProduct","CSSMathSum","CSSMathValue","CSSMatrixComponent","CSSMediaRule","CSSMozDocumentRule","CSSNameSpaceRule","CSSNamespaceRule","CSSNestedDeclarations","CSSNumericArray","CSSNumericValue","CSSPageDescriptors","CSSPageRule","CSSPerspective","CSSPositionTryDescriptors","CSSPositionTryRule","CSSPositionValue","CSSPrimitiveValue","CSSPropertyRule","CSSRotate","CSSRule","CSSRuleList","CSSScale","CSSScopeRule","CSSSkew","CSSSkewX","CSSSkewY","CSSStartingStyleRule","CSSStyleDeclaration","CSSStyleRule","CSSStyleSheet","CSSStyleValue","CSSSupportsRule","CSSTransformComponent","CSSTransformValue","CSSTransition","CSSTranslate","CSSUnitValue","CSSUnknownRule","CSSUnparsedValue","CSSValue","CSSValueList","CSSVariableReferenceValue","CSSVariablesDeclaration","CSSVariablesRule","CSSViewTransitionRule","CSSViewportRule","CSS_ATTR","CSS_CM","CSS_COUNTER","CSS_CUSTOM","CSS_DEG","CSS_DIMENSION","CSS_EMS","CSS_EXS","CSS_FILTER_BLUR","CSS_FILTER_BRIGHTNESS","CSS_FILTER_CONTRAST","CSS_FILTER_CUSTOM","CSS_FILTER_DROP_SHADOW","CSS_FILTER_GRAYSCALE","CSS_FILTER_HUE_ROTATE","CSS_FILTER_INVERT","CSS_FILTER_OPACITY","CSS_FILTER_REFERENCE","CSS_FILTER_SATURATE","CSS_FILTER_SEPIA","CSS_GRAD","CSS_HZ","CSS_IDENT","CSS_IN","CSS_INHERIT","CSS_KHZ","CSS_MATRIX","CSS_MATRIX3D","CSS_MM","CSS_MS","CSS_NUMBER","CSS_PC","CSS_PERCENTAGE","CSS_PERSPECTIVE","CSS_PRIMITIVE_VALUE","CSS_PT","CSS_PX","CSS_RAD","CSS_RECT","CSS_RGBCOLOR","CSS_ROTATE","CSS_ROTATE3D","CSS_ROTATEX","CSS_ROTATEY","CSS_ROTATEZ","CSS_S","CSS_SCALE","CSS_SCALE3D","CSS_SCALEX","CSS_SCALEY","CSS_SCALEZ","CSS_SKEW","CSS_SKEWX","CSS_SKEWY","CSS_STRING","CSS_TRANSLATE","CSS_TRANSLATE3D","CSS_TRANSLATEX","CSS_TRANSLATEY","CSS_TRANSLATEZ","CSS_UNKNOWN","CSS_URI","CSS_VALUE_LIST","CSS_VH","CSS_VMAX","CSS_VMIN","CSS_VW","CULL_FACE","CULL_FACE_MODE","CURRENT_PROGRAM","CURRENT_QUERY","CURRENT_VERTEX_ATTRIB","CUSTOM","CW","Cache","CacheStorage","CanvasCaptureMediaStream","CanvasCaptureMediaStreamTrack","CanvasGradient","CanvasPattern","CanvasRenderingContext2D","CaptureController","CaretPosition","ChannelMergerNode","ChannelSplitterNode","ChapterInformation","CharacterBoundsUpdateEvent","CharacterData","ClientRect","ClientRectList","Clipboard","ClipboardEvent","ClipboardItem","CloseEvent","CloseWatcher","Collator","ColorArray","ColorValue","CommandEvent","Comment","CompileError","CompositionEvent","CompressionStream","Console","ConstantSourceNode","ContentVisibilityAutoStateChangeEvent","ContextFilter","ContextType","Controllers","ConvolverNode","CookieChangeEvent","CookieStore","CookieStoreManager","CountQueuingStrategy","Counter","CreateType","Credential","CredentialsContainer","CropTarget","Crypto","CryptoKey","CustomElementRegistry","CustomEvent","CustomStateSet","DATABASE_ERR","DATA_CLONE_ERR","DATA_ERR","DBLCLICK","DECR","DECR_WRAP","DELETE_STATUS","DEPTH","DEPTH24_STENCIL8","DEPTH32F_STENCIL8","DEPTH_ATTACHMENT","DEPTH_BITS","DEPTH_BUFFER_BIT","DEPTH_CLEAR_VALUE","DEPTH_COMPONENT","DEPTH_COMPONENT16","DEPTH_COMPONENT24","DEPTH_COMPONENT32F","DEPTH_FUNC","DEPTH_RANGE","DEPTH_STENCIL","DEPTH_STENCIL_ATTACHMENT","DEPTH_TEST","DEPTH_WRITEMASK","DEVICE_INELIGIBLE","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DISABLED","DISPATCH_REQUEST_ERR","DITHER","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC","DOCUMENT_POSITION_PRECEDING","DOCUMENT_TYPE_NODE","DOMCursor","DOMError","DOMException","DOMImplementation","DOMImplementationLS","DOMMatrix","DOMMatrixReadOnly","DOMParser","DOMPoint","DOMPointReadOnly","DOMQuad","DOMRect","DOMRectList","DOMRectReadOnly","DOMRequest","DOMSTRING_SIZE_ERR","DOMSettableTokenList","DOMStringList","DOMStringMap","DOMTokenList","DOMTransactionEvent","DOM_DELTA_LINE","DOM_DELTA_PAGE","DOM_DELTA_PIXEL","DOM_INPUT_METHOD_DROP","DOM_INPUT_METHOD_HANDWRITING","DOM_INPUT_METHOD_IME","DOM_INPUT_METHOD_KEYBOARD","DOM_INPUT_METHOD_MULTIMODAL","DOM_INPUT_METHOD_OPTION","DOM_INPUT_METHOD_PASTE","DOM_INPUT_METHOD_SCRIPT","DOM_INPUT_METHOD_UNKNOWN","DOM_INPUT_METHOD_VOICE","DOM_KEY_LOCATION_JOYSTICK","DOM_KEY_LOCATION_LEFT","DOM_KEY_LOCATION_MOBILE","DOM_KEY_LOCATION_NUMPAD","DOM_KEY_LOCATION_RIGHT","DOM_KEY_LOCATION_STANDARD","DOM_VK_0","DOM_VK_1","DOM_VK_2","DOM_VK_3","DOM_VK_4","DOM_VK_5","DOM_VK_6","DOM_VK_7","DOM_VK_8","DOM_VK_9","DOM_VK_A","DOM_VK_ACCEPT","DOM_VK_ADD","DOM_VK_ALT","DOM_VK_ALTGR","DOM_VK_AMPERSAND","DOM_VK_ASTERISK","DOM_VK_AT","DOM_VK_ATTN","DOM_VK_B","DOM_VK_BACKSPACE","DOM_VK_BACK_QUOTE","DOM_VK_BACK_SLASH","DOM_VK_BACK_SPACE","DOM_VK_C","DOM_VK_CANCEL","DOM_VK_CAPS_LOCK","DOM_VK_CIRCUMFLEX","DOM_VK_CLEAR","DOM_VK_CLOSE_BRACKET","DOM_VK_CLOSE_CURLY_BRACKET","DOM_VK_CLOSE_PAREN","DOM_VK_COLON","DOM_VK_COMMA","DOM_VK_CONTEXT_MENU","DOM_VK_CONTROL","DOM_VK_CONVERT","DOM_VK_CRSEL","DOM_VK_CTRL","DOM_VK_D","DOM_VK_DECIMAL","DOM_VK_DELETE","DOM_VK_DIVIDE","DOM_VK_DOLLAR","DOM_VK_DOUBLE_QUOTE","DOM_VK_DOWN","DOM_VK_E","DOM_VK_EISU","DOM_VK_END","DOM_VK_ENTER","DOM_VK_EQUALS","DOM_VK_EREOF","DOM_VK_ESCAPE","DOM_VK_EXCLAMATION","DOM_VK_EXECUTE","DOM_VK_EXSEL","DOM_VK_F","DOM_VK_F1","DOM_VK_F10","DOM_VK_F11","DOM_VK_F12","DOM_VK_F13","DOM_VK_F14","DOM_VK_F15","DOM_VK_F16","DOM_VK_F17","DOM_VK_F18","DOM_VK_F19","DOM_VK_F2","DOM_VK_F20","DOM_VK_F21","DOM_VK_F22","DOM_VK_F23","DOM_VK_F24","DOM_VK_F25","DOM_VK_F26","DOM_VK_F27","DOM_VK_F28","DOM_VK_F29","DOM_VK_F3","DOM_VK_F30","DOM_VK_F31","DOM_VK_F32","DOM_VK_F33","DOM_VK_F34","DOM_VK_F35","DOM_VK_F36","DOM_VK_F4","DOM_VK_F5","DOM_VK_F6","DOM_VK_F7","DOM_VK_F8","DOM_VK_F9","DOM_VK_FINAL","DOM_VK_FRONT","DOM_VK_G","DOM_VK_GREATER_THAN","DOM_VK_H","DOM_VK_HANGUL","DOM_VK_HANJA","DOM_VK_HASH","DOM_VK_HELP","DOM_VK_HK_TOGGLE","DOM_VK_HOME","DOM_VK_HYPHEN_MINUS","DOM_VK_I","DOM_VK_INSERT","DOM_VK_J","DOM_VK_JUNJA","DOM_VK_K","DOM_VK_KANA","DOM_VK_KANJI","DOM_VK_L","DOM_VK_LEFT","DOM_VK_LEFT_TAB","DOM_VK_LESS_THAN","DOM_VK_M","DOM_VK_META","DOM_VK_MODECHANGE","DOM_VK_MULTIPLY","DOM_VK_N","DOM_VK_NONCONVERT","DOM_VK_NUMPAD0","DOM_VK_NUMPAD1","DOM_VK_NUMPAD2","DOM_VK_NUMPAD3","DOM_VK_NUMPAD4","DOM_VK_NUMPAD5","DOM_VK_NUMPAD6","DOM_VK_NUMPAD7","DOM_VK_NUMPAD8","DOM_VK_NUMPAD9","DOM_VK_NUM_LOCK","DOM_VK_O","DOM_VK_OEM_1","DOM_VK_OEM_102","DOM_VK_OEM_2","DOM_VK_OEM_3","DOM_VK_OEM_4","DOM_VK_OEM_5","DOM_VK_OEM_6","DOM_VK_OEM_7","DOM_VK_OEM_8","DOM_VK_OEM_COMMA","DOM_VK_OEM_MINUS","DOM_VK_OEM_PERIOD","DOM_VK_OEM_PLUS","DOM_VK_OPEN_BRACKET","DOM_VK_OPEN_CURLY_BRACKET","DOM_VK_OPEN_PAREN","DOM_VK_P","DOM_VK_PA1","DOM_VK_PAGEDOWN","DOM_VK_PAGEUP","DOM_VK_PAGE_DOWN","DOM_VK_PAGE_UP","DOM_VK_PAUSE","DOM_VK_PERCENT","DOM_VK_PERIOD","DOM_VK_PIPE","DOM_VK_PLAY","DOM_VK_PLUS","DOM_VK_PRINT","DOM_VK_PRINTSCREEN","DOM_VK_PROCESSKEY","DOM_VK_PROPERITES","DOM_VK_Q","DOM_VK_QUESTION_MARK","DOM_VK_QUOTE","DOM_VK_R","DOM_VK_REDO","DOM_VK_RETURN","DOM_VK_RIGHT","DOM_VK_S","DOM_VK_SCROLL_LOCK","DOM_VK_SELECT","DOM_VK_SEMICOLON","DOM_VK_SEPARATOR","DOM_VK_SHIFT","DOM_VK_SLASH","DOM_VK_SLEEP","DOM_VK_SPACE","DOM_VK_SUBTRACT","DOM_VK_T","DOM_VK_TAB","DOM_VK_TILDE","DOM_VK_U","DOM_VK_UNDERSCORE","DOM_VK_UNDO","DOM_VK_UNICODE","DOM_VK_UP","DOM_VK_V","DOM_VK_VOLUME_DOWN","DOM_VK_VOLUME_MUTE","DOM_VK_VOLUME_UP","DOM_VK_W","DOM_VK_WIN","DOM_VK_WINDOW","DOM_VK_WIN_ICO_00","DOM_VK_WIN_ICO_CLEAR","DOM_VK_WIN_ICO_HELP","DOM_VK_WIN_OEM_ATTN","DOM_VK_WIN_OEM_AUTO","DOM_VK_WIN_OEM_BACKTAB","DOM_VK_WIN_OEM_CLEAR","DOM_VK_WIN_OEM_COPY","DOM_VK_WIN_OEM_CUSEL","DOM_VK_WIN_OEM_ENLW","DOM_VK_WIN_OEM_FINISH","DOM_VK_WIN_OEM_FJ_JISHO","DOM_VK_WIN_OEM_FJ_LOYA","DOM_VK_WIN_OEM_FJ_MASSHOU","DOM_VK_WIN_OEM_FJ_ROYA","DOM_VK_WIN_OEM_FJ_TOUROKU","DOM_VK_WIN_OEM_JUMP","DOM_VK_WIN_OEM_PA1","DOM_VK_WIN_OEM_PA2","DOM_VK_WIN_OEM_PA3","DOM_VK_WIN_OEM_RESET","DOM_VK_WIN_OEM_WSCTRL","DOM_VK_X","DOM_VK_XF86XK_ADD_FAVORITE","DOM_VK_XF86XK_APPLICATION_LEFT","DOM_VK_XF86XK_APPLICATION_RIGHT","DOM_VK_XF86XK_AUDIO_CYCLE_TRACK","DOM_VK_XF86XK_AUDIO_FORWARD","DOM_VK_XF86XK_AUDIO_LOWER_VOLUME","DOM_VK_XF86XK_AUDIO_MEDIA","DOM_VK_XF86XK_AUDIO_MUTE","DOM_VK_XF86XK_AUDIO_NEXT","DOM_VK_XF86XK_AUDIO_PAUSE","DOM_VK_XF86XK_AUDIO_PLAY","DOM_VK_XF86XK_AUDIO_PREV","DOM_VK_XF86XK_AUDIO_RAISE_VOLUME","DOM_VK_XF86XK_AUDIO_RANDOM_PLAY","DOM_VK_XF86XK_AUDIO_RECORD","DOM_VK_XF86XK_AUDIO_REPEAT","DOM_VK_XF86XK_AUDIO_REWIND","DOM_VK_XF86XK_AUDIO_STOP","DOM_VK_XF86XK_AWAY","DOM_VK_XF86XK_BACK","DOM_VK_XF86XK_BACK_FORWARD","DOM_VK_XF86XK_BATTERY","DOM_VK_XF86XK_BLUE","DOM_VK_XF86XK_BLUETOOTH","DOM_VK_XF86XK_BOOK","DOM_VK_XF86XK_BRIGHTNESS_ADJUST","DOM_VK_XF86XK_CALCULATOR","DOM_VK_XF86XK_CALENDAR","DOM_VK_XF86XK_CD","DOM_VK_XF86XK_CLOSE","DOM_VK_XF86XK_COMMUNITY","DOM_VK_XF86XK_CONTRAST_ADJUST","DOM_VK_XF86XK_COPY","DOM_VK_XF86XK_CUT","DOM_VK_XF86XK_CYCLE_ANGLE","DOM_VK_XF86XK_DISPLAY","DOM_VK_XF86XK_DOCUMENTS","DOM_VK_XF86XK_DOS","DOM_VK_XF86XK_EJECT","DOM_VK_XF86XK_EXCEL","DOM_VK_XF86XK_EXPLORER","DOM_VK_XF86XK_FAVORITES","DOM_VK_XF86XK_FINANCE","DOM_VK_XF86XK_FORWARD","DOM_VK_XF86XK_FRAME_BACK","DOM_VK_XF86XK_FRAME_FORWARD","DOM_VK_XF86XK_GAME","DOM_VK_XF86XK_GO","DOM_VK_XF86XK_GREEN","DOM_VK_XF86XK_HIBERNATE","DOM_VK_XF86XK_HISTORY","DOM_VK_XF86XK_HOME_PAGE","DOM_VK_XF86XK_HOT_LINKS","DOM_VK_XF86XK_I_TOUCH","DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN","DOM_VK_XF86XK_KBD_BRIGHTNESS_UP","DOM_VK_XF86XK_KBD_LIGHT_ON_OFF","DOM_VK_XF86XK_LAUNCH0","DOM_VK_XF86XK_LAUNCH1","DOM_VK_XF86XK_LAUNCH2","DOM_VK_XF86XK_LAUNCH3","DOM_VK_XF86XK_LAUNCH4","DOM_VK_XF86XK_LAUNCH5","DOM_VK_XF86XK_LAUNCH6","DOM_VK_XF86XK_LAUNCH7","DOM_VK_XF86XK_LAUNCH8","DOM_VK_XF86XK_LAUNCH9","DOM_VK_XF86XK_LAUNCH_A","DOM_VK_XF86XK_LAUNCH_B","DOM_VK_XF86XK_LAUNCH_C","DOM_VK_XF86XK_LAUNCH_D","DOM_VK_XF86XK_LAUNCH_E","DOM_VK_XF86XK_LAUNCH_F","DOM_VK_XF86XK_LIGHT_BULB","DOM_VK_XF86XK_LOG_OFF","DOM_VK_XF86XK_MAIL","DOM_VK_XF86XK_MAIL_FORWARD","DOM_VK_XF86XK_MARKET","DOM_VK_XF86XK_MEETING","DOM_VK_XF86XK_MEMO","DOM_VK_XF86XK_MENU_KB","DOM_VK_XF86XK_MENU_PB","DOM_VK_XF86XK_MESSENGER","DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN","DOM_VK_XF86XK_MON_BRIGHTNESS_UP","DOM_VK_XF86XK_MUSIC","DOM_VK_XF86XK_MY_COMPUTER","DOM_VK_XF86XK_MY_SITES","DOM_VK_XF86XK_NEW","DOM_VK_XF86XK_NEWS","DOM_VK_XF86XK_OFFICE_HOME","DOM_VK_XF86XK_OPEN","DOM_VK_XF86XK_OPEN_URL","DOM_VK_XF86XK_OPTION","DOM_VK_XF86XK_PASTE","DOM_VK_XF86XK_PHONE","DOM_VK_XF86XK_PICTURES","DOM_VK_XF86XK_POWER_DOWN","DOM_VK_XF86XK_POWER_OFF","DOM_VK_XF86XK_RED","DOM_VK_XF86XK_REFRESH","DOM_VK_XF86XK_RELOAD","DOM_VK_XF86XK_REPLY","DOM_VK_XF86XK_ROCKER_DOWN","DOM_VK_XF86XK_ROCKER_ENTER","DOM_VK_XF86XK_ROCKER_UP","DOM_VK_XF86XK_ROTATE_WINDOWS","DOM_VK_XF86XK_ROTATION_KB","DOM_VK_XF86XK_ROTATION_PB","DOM_VK_XF86XK_SAVE","DOM_VK_XF86XK_SCREEN_SAVER","DOM_VK_XF86XK_SCROLL_CLICK","DOM_VK_XF86XK_SCROLL_DOWN","DOM_VK_XF86XK_SCROLL_UP","DOM_VK_XF86XK_SEARCH","DOM_VK_XF86XK_SEND","DOM_VK_XF86XK_SHOP","DOM_VK_XF86XK_SPELL","DOM_VK_XF86XK_SPLIT_SCREEN","DOM_VK_XF86XK_STANDBY","DOM_VK_XF86XK_START","DOM_VK_XF86XK_STOP","DOM_VK_XF86XK_SUBTITLE","DOM_VK_XF86XK_SUPPORT","DOM_VK_XF86XK_SUSPEND","DOM_VK_XF86XK_TASK_PANE","DOM_VK_XF86XK_TERMINAL","DOM_VK_XF86XK_TIME","DOM_VK_XF86XK_TOOLS","DOM_VK_XF86XK_TOP_MENU","DOM_VK_XF86XK_TO_DO_LIST","DOM_VK_XF86XK_TRAVEL","DOM_VK_XF86XK_USER1KB","DOM_VK_XF86XK_USER2KB","DOM_VK_XF86XK_USER_PB","DOM_VK_XF86XK_UWB","DOM_VK_XF86XK_VENDOR_HOME","DOM_VK_XF86XK_VIDEO","DOM_VK_XF86XK_VIEW","DOM_VK_XF86XK_WAKE_UP","DOM_VK_XF86XK_WEB_CAM","DOM_VK_XF86XK_WHEEL_BUTTON","DOM_VK_XF86XK_WLAN","DOM_VK_XF86XK_WORD","DOM_VK_XF86XK_WWW","DOM_VK_XF86XK_XFER","DOM_VK_XF86XK_YELLOW","DOM_VK_XF86XK_ZOOM_IN","DOM_VK_XF86XK_ZOOM_OUT","DOM_VK_Y","DOM_VK_Z","DOM_VK_ZOOM","DONE","DONT_CARE","DOWNLOADING","DRAGDROP","DRAW_BUFFER0","DRAW_BUFFER1","DRAW_BUFFER10","DRAW_BUFFER11","DRAW_BUFFER12","DRAW_BUFFER13","DRAW_BUFFER14","DRAW_BUFFER15","DRAW_BUFFER2","DRAW_BUFFER3","DRAW_BUFFER4","DRAW_BUFFER5","DRAW_BUFFER6","DRAW_BUFFER7","DRAW_BUFFER8","DRAW_BUFFER9","DRAW_FRAMEBUFFER","DRAW_FRAMEBUFFER_BINDING","DST_ALPHA","DST_COLOR","DYNAMIC_COPY","DYNAMIC_DRAW","DYNAMIC_READ","DataChannel","DataTransfer","DataTransferItem","DataTransferItemList","DataView","Date","DateTimeFormat","DecompressionStream","DelayNode","DelegatedInkTrailPresenter","DeprecationReportBody","DesktopNotification","DesktopNotificationCenter","Details","DeviceLightEvent","DeviceMotionEvent","DeviceMotionEventAcceleration","DeviceMotionEventRotationRate","DeviceOrientationEvent","DeviceProximityEvent","DeviceStorage","DeviceStorageChangeEvent","Directory","DisplayNames","Document","DocumentFragment","DocumentPictureInPicture","DocumentPictureInPictureEvent","DocumentTimeline","DocumentType","DragEvent","DurationFormat","DynamicsCompressorNode","E","ELEMENT_ARRAY_BUFFER","ELEMENT_ARRAY_BUFFER_BINDING","ELEMENT_NODE","EMPTY","ENCODING_ERR","ENDED","END_TO_END","END_TO_START","ENTITY_NODE","ENTITY_REFERENCE_NODE","EPSILON","EQUAL","EQUALPOWER","ERROR","EXPONENTIAL_DISTANCE","EditContext","Element","ElementInternals","ElementQuery","EncodedAudioChunk","EncodedVideoChunk","EnterPictureInPictureEvent","Entity","EntityReference","Error","ErrorEvent","EvalError","Event","EventCounts","EventException","EventSource","EventTarget","Exception","ExtensionContext","ExtensionDisabledReason","ExtensionInfo","ExtensionInstallType","ExtensionType","External","EyeDropper","FASTEST","FIDOSDK","FILTER_ACCEPT","FILTER_INTERRUPT","FILTER_REJECT","FILTER_SKIP","FINISHED_STATE","FIRST_ORDERED_NODE_TYPE","FLOAT","FLOAT_32_UNSIGNED_INT_24_8_REV","FLOAT_MAT2","FLOAT_MAT2x3","FLOAT_MAT2x4","FLOAT_MAT3","FLOAT_MAT3x2","FLOAT_MAT3x4","FLOAT_MAT4","FLOAT_MAT4x2","FLOAT_MAT4x3","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","FOCUS","FONT_FACE_RULE","FONT_FEATURE_VALUES_RULE","FRAGMENT","FRAGMENT_SHADER","FRAGMENT_SHADER_DERIVATIVE_HINT","FRAGMENT_SHADER_DERIVATIVE_HINT_OES","FRAMEBUFFER","FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE","FRAMEBUFFER_ATTACHMENT_BLUE_SIZE","FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING","FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE","FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE","FRAMEBUFFER_ATTACHMENT_GREEN_SIZE","FRAMEBUFFER_ATTACHMENT_OBJECT_NAME","FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE","FRAMEBUFFER_ATTACHMENT_RED_SIZE","FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE","FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE","FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER","FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL","FRAMEBUFFER_BINDING","FRAMEBUFFER_COMPLETE","FRAMEBUFFER_DEFAULT","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MULTISAMPLE","FRAMEBUFFER_UNSUPPORTED","FRONT","FRONT_AND_BACK","FRONT_FACE","FUNC_ADD","FUNC_REVERSE_SUBTRACT","FUNC_SUBTRACT","FeaturePolicy","FeaturePolicyViolationReportBody","FederatedCredential","Feed","FeedEntry","Fence","FencedFrameConfig","File","FileError","FileList","FileReader","FileSystem","FileSystemDirectoryEntry","FileSystemDirectoryHandle","FileSystemDirectoryReader","FileSystemEntry","FileSystemFileEntry","FileSystemFileHandle","FileSystemHandle","FileSystemWritableFileStream","FinalizationRegistry","FindInPage","Float16Array","Float32Array","Float64Array","FocusEvent","FontData","FontFace","FontFaceSet","FontFaceSetLoadEvent","FormData","FormDataEvent","FragmentDirective","Function","GENERATE_MIPMAP_HINT","GEQUAL","GPU","GPUAdapter","GPUAdapterInfo","GPUBindGroup","GPUBindGroupLayout","GPUBuffer","GPUBufferUsage","GPUCanvasContext","GPUColorWrite","GPUCommandBuffer","GPUCommandEncoder","GPUCompilationInfo","GPUCompilationMessage","GPUComputePassEncoder","GPUComputePipeline","GPUDevice","GPUDeviceLostInfo","GPUError","GPUExternalTexture","GPUInternalError","GPUMapMode","GPUOutOfMemoryError","GPUPipelineError","GPUPipelineLayout","GPUQuerySet","GPUQueue","GPURenderBundle","GPURenderBundleEncoder","GPURenderPassEncoder","GPURenderPipeline","GPUSampler","GPUShaderModule","GPUShaderStage","GPUSupportedFeatures","GPUSupportedLimits","GPUTexture","GPUTextureUsage","GPUTextureView","GPUUncapturedErrorEvent","GPUValidationError","GREATER","GREEN","GREEN_BITS","GainNode","Gamepad","GamepadAxisMoveEvent","GamepadButton","GamepadButtonEvent","GamepadEvent","GamepadHapticActuator","GamepadPose","Geolocation","GeolocationCoordinates","GeolocationPosition","GeolocationPositionError","GestureEvent","GetInfo","Global","GravitySensor","Gyroscope","HALF_FLOAT","HAVE_CURRENT_DATA","HAVE_ENOUGH_DATA","HAVE_FUTURE_DATA","HAVE_METADATA","HAVE_NOTHING","HEADERS_RECEIVED","HID","HIDConnectionEvent","HIDDEN","HIDDevice","HIDInputReportEvent","HIERARCHY_REQUEST_ERR","HIGHPASS","HIGHSHELF","HIGH_FLOAT","HIGH_INT","HORIZONTAL","HORIZONTAL_AXIS","HRTF","HTMLAllCollection","HTMLAnchorElement","HTMLAppletElement","HTMLAreaElement","HTMLAudioElement","HTMLBRElement","HTMLBaseElement","HTMLBaseFontElement","HTMLBlockquoteElement","HTMLBodyElement","HTMLButtonElement","HTMLCanvasElement","HTMLCollection","HTMLCommandElement","HTMLContentElement","HTMLDListElement","HTMLDataElement","HTMLDataListElement","HTMLDetailsElement","HTMLDialogElement","HTMLDirectoryElement","HTMLDivElement","HTMLDocument","HTMLElement","HTMLEmbedElement","HTMLFencedFrameElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormControlsCollection","HTMLFormElement","HTMLFrameElement","HTMLFrameSetElement","HTMLHRElement","HTMLHeadElement","HTMLHeadingElement","HTMLHtmlElement","HTMLIFrameElement","HTMLImageElement","HTMLInputElement","HTMLIsIndexElement","HTMLKeygenElement","HTMLLIElement","HTMLLabelElement","HTMLLegendElement","HTMLLinkElement","HTMLMapElement","HTMLMarqueeElement","HTMLMediaElement","HTMLMenuElement","HTMLMenuItemElement","HTMLMetaElement","HTMLMeterElement","HTMLModElement","HTMLOListElement","HTMLObjectElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOptionsCollection","HTMLOutputElement","HTMLParagraphElement","HTMLParamElement","HTMLPictureElement","HTMLPreElement","HTMLProgressElement","HTMLPropertiesCollection","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLShadowElement","HTMLSlotElement","HTMLSourceElement","HTMLSpanElement","HTMLStyleElement","HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTableRowElement","HTMLTableSectionElement","HTMLTemplateElement","HTMLTextAreaElement","HTMLTimeElement","HTMLTitleElement","HTMLTrackElement","HTMLUListElement","HTMLUnknownElement","HTMLVideoElement","HashChangeEvent","Headers","Highlight","HighlightRegistry","History","Hz","ICE_CHECKING","ICE_CLOSED","ICE_COMPLETED","ICE_CONNECTED","ICE_FAILED","ICE_GATHERING","ICE_WAITING","IDBCursor","IDBCursorWithValue","IDBDatabase","IDBDatabaseException","IDBFactory","IDBFileHandle","IDBFileRequest","IDBIndex","IDBKeyRange","IDBMutableFile","IDBObjectStore","IDBOpenDBRequest","IDBRequest","IDBTransaction","IDBVersionChangeEvent","IDLE","IIRFilterNode","IMPLEMENTATION_COLOR_READ_FORMAT","IMPLEMENTATION_COLOR_READ_TYPE","IMPORT_RULE","INCR","INCR_WRAP","INDEX","INDEX_SIZE_ERR","INDIRECT","INT","INTERLEAVED_ATTRIBS","INT_2_10_10_10_REV","INT_SAMPLER_2D","INT_SAMPLER_2D_ARRAY","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_VEC2","INT_VEC3","INT_VEC4","INUSE_ATTRIBUTE_ERR","INVALID_ACCESS_ERR","INVALID_CHARACTER_ERR","INVALID_ENUM","INVALID_EXPRESSION_ERR","INVALID_FRAMEBUFFER_OPERATION","INVALID_INDEX","INVALID_MODIFICATION_ERR","INVALID_NODE_TYPE_ERR","INVALID_OPERATION","INVALID_STATE_ERR","INVALID_VALUE","INVERSE_DISTANCE","INVERT","IceCandidate","IconInfo","IdentityCredential","IdentityCredentialError","IdentityProvider","IdleDeadline","IdleDetector","Image","ImageBitmap","ImageBitmapRenderingContext","ImageCapture","ImageData","ImageDataType","ImageDecoder","ImageTrack","ImageTrackList","Infinity","Ink","InputDeviceCapabilities","InputDeviceInfo","InputEvent","InputMethodContext","InstallTrigger","InstallTriggerImpl","Instance","Int16Array","Int32Array","Int8Array","Intent","InternalError","IntersectionObserver","IntersectionObserverEntry","Intl","IsSearchProviderInstalled","Iterator","JSON","JSTag","KEEP","KEYDOWN","KEYFRAMES_RULE","KEYFRAME_RULE","KEYPRESS","KEYUP","KeyEvent","Keyboard","KeyboardEvent","KeyboardLayoutMap","KeyframeEffect","LENGTHADJUST_SPACING","LENGTHADJUST_SPACINGANDGLYPHS","LENGTHADJUST_UNKNOWN","LEQUAL","LESS","LINEAR","LINEAR_DISTANCE","LINEAR_MIPMAP_LINEAR","LINEAR_MIPMAP_NEAREST","LINES","LINE_LOOP","LINE_STRIP","LINE_WIDTH","LINK_STATUS","LIVE","LN10","LN2","LOADED","LOADING","LOG10E","LOG2E","LOWPASS","LOWSHELF","LOW_FLOAT","LOW_INT","LSException","LSParserFilter","LUMINANCE","LUMINANCE_ALPHA","LanguageCode","LargestContentfulPaint","LaunchParams","LaunchQueue","LaunchType","LayoutShift","LayoutShiftAttribution","LinearAccelerationSensor","LinkError","ListFormat","LocalMediaStream","Locale","Location","Lock","LockManager","MAP_READ","MAP_WRITE","MARGIN_RULE","MAX","MAX_3D_TEXTURE_SIZE","MAX_ARRAY_TEXTURE_LAYERS","MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND","MAX_CLIENT_WAIT_TIMEOUT_WEBGL","MAX_COLOR_ATTACHMENTS","MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_COMBINED_UNIFORM_BLOCKS","MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_DRAW_BUFFERS","MAX_ELEMENTS_INDICES","MAX_ELEMENTS_VERTICES","MAX_ELEMENT_INDEX","MAX_FRAGMENT_INPUT_COMPONENTS","MAX_FRAGMENT_UNIFORM_BLOCKS","MAX_FRAGMENT_UNIFORM_COMPONENTS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_PROGRAM_TEXEL_OFFSET","MAX_RENDERBUFFER_SIZE","MAX_SAFE_INTEGER","MAX_SAMPLES","MAX_SERVER_WAIT_TIMEOUT","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_LOD_BIAS","MAX_TEXTURE_MAX_ANISOTROPY_EXT","MAX_TEXTURE_SIZE","MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS","MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS","MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS","MAX_UNIFORM_BLOCK_SIZE","MAX_UNIFORM_BUFFER_BINDINGS","MAX_VALUE","MAX_VARYING_COMPONENTS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_OUTPUT_COMPONENTS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_BLOCKS","MAX_VERTEX_UNIFORM_COMPONENTS","MAX_VERTEX_UNIFORM_VECTORS","MAX_VIEWPORT_DIMS","MEDIA_ERR_ABORTED","MEDIA_ERR_DECODE","MEDIA_ERR_ENCRYPTED","MEDIA_ERR_NETWORK","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_KEYERR_CLIENT","MEDIA_KEYERR_DOMAIN","MEDIA_KEYERR_HARDWARECHANGE","MEDIA_KEYERR_OUTPUT","MEDIA_KEYERR_SERVICE","MEDIA_KEYERR_UNKNOWN","MEDIA_RULE","MEDIUM_FLOAT","MEDIUM_INT","META_MASK","MIDIAccess","MIDIConnectionEvent","MIDIInput","MIDIInputMap","MIDIMessageEvent","MIDIOutput","MIDIOutputMap","MIDIPort","MIN","MIN_PROGRAM_TEXEL_OFFSET","MIN_SAFE_INTEGER","MIN_VALUE","MIRRORED_REPEAT","MODE_ASYNCHRONOUS","MODE_SYNCHRONOUS","MODIFICATION","MOUSEDOWN","MOUSEDRAG","MOUSEMOVE","MOUSEOUT","MOUSEOVER","MOUSEUP","MOZ_KEYFRAMES_RULE","MOZ_KEYFRAME_RULE","MOZ_SOURCE_CURSOR","MOZ_SOURCE_ERASER","MOZ_SOURCE_KEYBOARD","MOZ_SOURCE_MOUSE","MOZ_SOURCE_PEN","MOZ_SOURCE_TOUCH","MOZ_SOURCE_UNKNOWN","MSGESTURE_FLAG_BEGIN","MSGESTURE_FLAG_CANCEL","MSGESTURE_FLAG_END","MSGESTURE_FLAG_INERTIA","MSGESTURE_FLAG_NONE","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_PEN","MSPOINTER_TYPE_TOUCH","MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE","MS_ASYNC_CALLBACK_STATUS_CANCEL","MS_ASYNC_CALLBACK_STATUS_CHOOSEANY","MS_ASYNC_CALLBACK_STATUS_ERROR","MS_ASYNC_CALLBACK_STATUS_JOIN","MS_ASYNC_OP_STATUS_CANCELED","MS_ASYNC_OP_STATUS_ERROR","MS_ASYNC_OP_STATUS_SUCCESS","MS_MANIPULATION_STATE_ACTIVE","MS_MANIPULATION_STATE_CANCELLED","MS_MANIPULATION_STATE_COMMITTED","MS_MANIPULATION_STATE_DRAGGING","MS_MANIPULATION_STATE_INERTIA","MS_MANIPULATION_STATE_PRESELECT","MS_MANIPULATION_STATE_SELECTING","MS_MANIPULATION_STATE_STOPPED","MS_MEDIA_ERR_ENCRYPTED","MS_MEDIA_KEYERR_CLIENT","MS_MEDIA_KEYERR_DOMAIN","MS_MEDIA_KEYERR_HARDWARECHANGE","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_SERVICE","MS_MEDIA_KEYERR_UNKNOWN","Map","Math","MathMLElement","MediaCapabilities","MediaCapabilitiesInfo","MediaController","MediaDeviceInfo","MediaDevices","MediaElementAudioSourceNode","MediaEncryptedEvent","MediaError","MediaKeyError","MediaKeyEvent","MediaKeyMessageEvent","MediaKeyNeededEvent","MediaKeySession","MediaKeyStatusMap","MediaKeySystemAccess","MediaKeys","MediaList","MediaMetadata","MediaQueryList","MediaQueryListEvent","MediaRecorder","MediaRecorderErrorEvent","MediaSession","MediaSettingsRange","MediaSource","MediaSourceHandle","MediaStream","MediaStreamAudioDestinationNode","MediaStreamAudioSourceNode","MediaStreamEvent","MediaStreamTrack","MediaStreamTrackAudioSourceNode","MediaStreamTrackAudioStats","MediaStreamTrackEvent","MediaStreamTrackGenerator","MediaStreamTrackProcessor","MediaStreamTrackVideoStats","Memory","MessageChannel","MessageEvent","MessagePort","MessageSender","Methods","MimeType","MimeTypeArray","Module","MouseEvent","MouseScrollEvent","MozAnimation","MozAnimationDelay","MozAnimationDirection","MozAnimationDuration","MozAnimationFillMode","MozAnimationIterationCount","MozAnimationName","MozAnimationPlayState","MozAnimationTimingFunction","MozAppearance","MozBackfaceVisibility","MozBinding","MozBorderBottomColors","MozBorderEnd","MozBorderEndColor","MozBorderEndStyle","MozBorderEndWidth","MozBorderImage","MozBorderLeftColors","MozBorderRightColors","MozBorderStart","MozBorderStartColor","MozBorderStartStyle","MozBorderStartWidth","MozBorderTopColors","MozBoxAlign","MozBoxDirection","MozBoxFlex","MozBoxOrdinalGroup","MozBoxOrient","MozBoxPack","MozBoxSizing","MozCSSKeyframeRule","MozCSSKeyframesRule","MozColumnCount","MozColumnFill","MozColumnGap","MozColumnRule","MozColumnRuleColor","MozColumnRuleStyle","MozColumnRuleWidth","MozColumnWidth","MozColumns","MozContactChangeEvent","MozFloatEdge","MozFontFeatureSettings","MozFontLanguageOverride","MozForceBrokenImageIcon","MozHyphens","MozImageRegion","MozMarginEnd","MozMarginStart","MozMmsEvent","MozMmsMessage","MozMobileMessageThread","MozOSXFontSmoothing","MozOrient","MozOsxFontSmoothing","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright","MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozPaddingEnd","MozPaddingStart","MozPerspective","MozPerspectiveOrigin","MozPowerManager","MozSettingsEvent","MozSmsEvent","MozSmsMessage","MozStackSizing","MozTabSize","MozTextAlignLast","MozTextDecorationColor","MozTextDecorationLine","MozTextDecorationStyle","MozTextSizeAdjust","MozTransform","MozTransformOrigin","MozTransformStyle","MozTransition","MozTransitionDelay","MozTransitionDuration","MozTransitionProperty","MozTransitionTimingFunction","MozUserFocus","MozUserInput","MozUserModify","MozUserSelect","MozWindowDragging","MozWindowShadow","MutationEvent","MutationObserver","MutationRecord","MutedInfo","MutedInfoReason","NAMESPACE_ERR","NAMESPACE_RULE","NEAREST","NEAREST_MIPMAP_LINEAR","NEAREST_MIPMAP_NEAREST","NEGATIVE_INFINITY","NETWORK_EMPTY","NETWORK_ERR","NETWORK_IDLE","NETWORK_LOADED","NETWORK_LOADING","NETWORK_NO_SOURCE","NEVER","NEW","NEXT","NEXT_NO_DUPLICATE","NICEST","NODE_AFTER","NODE_BEFORE","NODE_BEFORE_AND_AFTER","NODE_INSIDE","NONE","NON_TRANSIENT_ERR","NOTATION_NODE","NOTCH","NOTEQUAL","NOT_ALLOWED_ERR","NOT_FOUND_ERR","NOT_READABLE_ERR","NOT_SUPPORTED_ERR","NO_DATA_ALLOWED_ERR","NO_ERR","NO_ERROR","NO_MODIFICATION_ALLOWED_ERR","NUMBER_TYPE","NUM_COMPRESSED_TEXTURE_FORMATS","NaN","NamedNodeMap","NavigateEvent","Navigation","NavigationActivation","NavigationCurrentEntryChangeEvent","NavigationDestination","NavigationHistoryEntry","NavigationPreloadManager","NavigationTransition","Navigator","NavigatorLogin","NavigatorManagedData","NavigatorUAData","NearbyLinks","NetworkInformation","Node","NodeFilter","NodeIterator","NodeList","NotRestoredReasonDetails","NotRestoredReasons","Notation","Notification","NotifyPaintEvent","Number","NumberFormat","OBJECT_TYPE","OBSOLETE","OK","ONE","ONE_MINUS_CONSTANT_ALPHA","ONE_MINUS_CONSTANT_COLOR","ONE_MINUS_DST_ALPHA","ONE_MINUS_DST_COLOR","ONE_MINUS_SRC_ALPHA","ONE_MINUS_SRC_COLOR","OPEN","OPENED","OPENING","ORDERED_NODE_ITERATOR_TYPE","ORDERED_NODE_SNAPSHOT_TYPE","OTHER_ERROR","OTPCredential","OUT_OF_MEMORY","Object","OfflineAudioCompletionEvent","OfflineAudioContext","OfflineResourceList","OffscreenCanvas","OffscreenCanvasRenderingContext2D","OnClickData","OnInstalledReason","OnPerformanceWarningCategory","OnPerformanceWarningSeverity","OnRestartRequiredReason","Option","OrientationSensor","OscillatorNode","OverconstrainedError","OverflowEvent","PACK_ALIGNMENT","PACK_ROW_LENGTH","PACK_SKIP_PIXELS","PACK_SKIP_ROWS","PAGE_RULE","PARSE_ERR","PATHSEG_ARC_ABS","PATHSEG_ARC_REL","PATHSEG_CLOSEPATH","PATHSEG_CURVETO_CUBIC_ABS","PATHSEG_CURVETO_CUBIC_REL","PATHSEG_CURVETO_CUBIC_SMOOTH_ABS","PATHSEG_CURVETO_CUBIC_SMOOTH_REL","PATHSEG_CURVETO_QUADRATIC_ABS","PATHSEG_CURVETO_QUADRATIC_REL","PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS","PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL","PATHSEG_LINETO_ABS","PATHSEG_LINETO_HORIZONTAL_ABS","PATHSEG_LINETO_HORIZONTAL_REL","PATHSEG_LINETO_REL","PATHSEG_LINETO_VERTICAL_ABS","PATHSEG_LINETO_VERTICAL_REL","PATHSEG_MOVETO_ABS","PATHSEG_MOVETO_REL","PATHSEG_UNKNOWN","PATH_EXISTS_ERR","PEAKING","PERMISSION_DENIED","PERSISTENT","PI","PIXEL_PACK_BUFFER","PIXEL_PACK_BUFFER_BINDING","PIXEL_UNPACK_BUFFER","PIXEL_UNPACK_BUFFER_BINDING","PLAYING_STATE","POINTS","POLYGON_OFFSET_FACTOR","POLYGON_OFFSET_FILL","POLYGON_OFFSET_UNITS","POSITION_UNAVAILABLE","POSITIVE_INFINITY","PREV","PREV_NO_DUPLICATE","PROCESSING_INSTRUCTION_NODE","PageChangeEvent","PageRevealEvent","PageSettings","PageSwapEvent","PageTransitionEvent","PaintRequest","PaintRequestList","PannerNode","PasswordCredential","Path2D","PaymentAddress","PaymentInstruments","PaymentManager","PaymentMethodChangeEvent","PaymentRequest","PaymentRequestUpdateEvent","PaymentResponse","Performance","PerformanceElementTiming","PerformanceEntry","PerformanceEventTiming","PerformanceLongAnimationFrameTiming","PerformanceLongTaskTiming","PerformanceMark","PerformanceMeasure","PerformanceNavigation","PerformanceNavigationTiming","PerformanceObserver","PerformanceObserverEntryList","PerformancePaintTiming","PerformanceResourceTiming","PerformanceScriptTiming","PerformanceServerTiming","PerformanceTiming","PeriodicSyncManager","PeriodicWave","PermissionStatus","Permissions","PhotoCapabilities","PictureInPictureEvent","PictureInPictureWindow","PlatformArch","PlatformInfo","PlatformNaclArch","PlatformOs","Plugin","PluginArray","PluralRules","PointerEvent","PopStateEvent","PopupBlockedEvent","Port","Presentation","PresentationAvailability","PresentationConnection","PresentationConnectionAvailableEvent","PresentationConnectionCloseEvent","PresentationConnectionList","PresentationReceiver","PresentationRequest","PressureObserver","PressureRecord","ProcessingInstruction","Profiler","ProgressEvent","Promise","PromiseRejectionEvent","PropertyNodeList","ProtectedAudience","Proxy","PublicKeyCredential","PushManager","PushSubscription","PushSubscriptionOptions","Q","QUERY_RESOLVE","QUERY_RESULT","QUERY_RESULT_AVAILABLE","QUOTA_ERR","QUOTA_EXCEEDED_ERR","QueryInterface","R11F_G11F_B10F","R16F","R16I","R16UI","R32F","R32I","R32UI","R8","R8I","R8UI","R8_SNORM","RASTERIZER_DISCARD","READ","READ_BUFFER","READ_FRAMEBUFFER","READ_FRAMEBUFFER_BINDING","READ_ONLY","READ_ONLY_ERR","READ_WRITE","RED","RED_BITS","RED_INTEGER","REMOVAL","RENDERBUFFER","RENDERBUFFER_ALPHA_SIZE","RENDERBUFFER_BINDING","RENDERBUFFER_BLUE_SIZE","RENDERBUFFER_DEPTH_SIZE","RENDERBUFFER_GREEN_SIZE","RENDERBUFFER_HEIGHT","RENDERBUFFER_INTERNAL_FORMAT","RENDERBUFFER_RED_SIZE","RENDERBUFFER_SAMPLES","RENDERBUFFER_STENCIL_SIZE","RENDERBUFFER_WIDTH","RENDERER","RENDERING_INTENT_ABSOLUTE_COLORIMETRIC","RENDERING_INTENT_AUTO","RENDERING_INTENT_PERCEPTUAL","RENDERING_INTENT_RELATIVE_COLORIMETRIC","RENDERING_INTENT_SATURATION","RENDERING_INTENT_UNKNOWN","RENDER_ATTACHMENT","REPEAT","REPLACE","RG","RG16F","RG16I","RG16UI","RG32F","RG32I","RG32UI","RG8","RG8I","RG8UI","RG8_SNORM","RGB","RGB10_A2","RGB10_A2UI","RGB16F","RGB16I","RGB16UI","RGB32F","RGB32I","RGB32UI","RGB565","RGB5_A1","RGB8","RGB8I","RGB8UI","RGB8_SNORM","RGB9_E5","RGBA","RGBA16F","RGBA16I","RGBA16UI","RGBA32F","RGBA32I","RGBA32UI","RGBA4","RGBA8","RGBA8I","RGBA8UI","RGBA8_SNORM","RGBA_INTEGER","RGBColor","RGB_INTEGER","RG_INTEGER","ROTATION_CLOCKWISE","ROTATION_COUNTERCLOCKWISE","RTCCertificate","RTCDTMFSender","RTCDTMFToneChangeEvent","RTCDataChannel","RTCDataChannelEvent","RTCDtlsTransport","RTCEncodedAudioFrame","RTCEncodedVideoFrame","RTCError","RTCErrorEvent","RTCIceCandidate","RTCIceTransport","RTCPeerConnection","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCRtpReceiver","RTCRtpScriptTransform","RTCRtpSender","RTCRtpTransceiver","RTCSctpTransport","RTCSessionDescription","RTCStatsReport","RTCTrackEvent","RadioNodeList","Range","RangeError","RangeException","ReadableByteStreamController","ReadableStream","ReadableStreamBYOBReader","ReadableStreamBYOBRequest","ReadableStreamDefaultController","ReadableStreamDefaultReader","RecordErrorEvent","Rect","ReferenceError","Reflect","RegExp","RelativeOrientationSensor","RelativeTimeFormat","RemotePlayback","Report","ReportBody","ReportingObserver","Request","RequestUpdateCheckStatus","ResizeObserver","ResizeObserverEntry","ResizeObserverSize","Response","RuntimeError","SAMPLER_2D","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_2D_SHADOW","SAMPLER_3D","SAMPLER_BINDING","SAMPLER_CUBE","SAMPLER_CUBE_SHADOW","SAMPLES","SAMPLE_ALPHA_TO_COVERAGE","SAMPLE_BUFFERS","SAMPLE_COVERAGE","SAMPLE_COVERAGE_INVERT","SAMPLE_COVERAGE_VALUE","SAWTOOTH","SCHEDULED_STATE","SCISSOR_BOX","SCISSOR_TEST","SCROLL_PAGE_DOWN","SCROLL_PAGE_UP","SDP_ANSWER","SDP_OFFER","SDP_PRANSWER","SECURITY_ERR","SELECT","SEPARATE_ATTRIBS","SERIALIZE_ERR","SEVERITY_ERROR","SEVERITY_FATAL_ERROR","SEVERITY_WARNING","SHADER_COMPILER","SHADER_TYPE","SHADING_LANGUAGE_VERSION","SHIFT_MASK","SHORT","SHOWING","SHOW_ALL","SHOW_ATTRIBUTE","SHOW_CDATA_SECTION","SHOW_COMMENT","SHOW_DOCUMENT","SHOW_DOCUMENT_FRAGMENT","SHOW_DOCUMENT_TYPE","SHOW_ELEMENT","SHOW_ENTITY","SHOW_ENTITY_REFERENCE","SHOW_NOTATION","SHOW_PROCESSING_INSTRUCTION","SHOW_TEXT","SIGNALED","SIGNED_NORMALIZED","SINE","SOUNDFIELD","SQLException","SQRT1_2","SQRT2","SQUARE","SRC_ALPHA","SRC_ALPHA_SATURATE","SRC_COLOR","SRGB","SRGB8","SRGB8_ALPHA8","START_TO_END","START_TO_START","STATIC_COPY","STATIC_DRAW","STATIC_READ","STENCIL","STENCIL_ATTACHMENT","STENCIL_BACK_FAIL","STENCIL_BACK_FUNC","STENCIL_BACK_PASS_DEPTH_FAIL","STENCIL_BACK_PASS_DEPTH_PASS","STENCIL_BACK_REF","STENCIL_BACK_VALUE_MASK","STENCIL_BACK_WRITEMASK","STENCIL_BITS","STENCIL_BUFFER_BIT","STENCIL_CLEAR_VALUE","STENCIL_FAIL","STENCIL_FUNC","STENCIL_INDEX","STENCIL_INDEX8","STENCIL_PASS_DEPTH_FAIL","STENCIL_PASS_DEPTH_PASS","STENCIL_REF","STENCIL_TEST","STENCIL_VALUE_MASK","STENCIL_WRITEMASK","STORAGE","STORAGE_BINDING","STREAM_COPY","STREAM_DRAW","STREAM_READ","STRING_TYPE","STYLE_RULE","SUBPIXEL_BITS","SUPPORTS_RULE","SVGAElement","SVGAltGlyphDefElement","SVGAltGlyphElement","SVGAltGlyphItemElement","SVGAngle","SVGAnimateColorElement","SVGAnimateElement","SVGAnimateMotionElement","SVGAnimateTransformElement","SVGAnimatedAngle","SVGAnimatedBoolean","SVGAnimatedEnumeration","SVGAnimatedInteger","SVGAnimatedLength","SVGAnimatedLengthList","SVGAnimatedNumber","SVGAnimatedNumberList","SVGAnimatedPreserveAspectRatio","SVGAnimatedRect","SVGAnimatedString","SVGAnimatedTransformList","SVGAnimationElement","SVGCircleElement","SVGClipPathElement","SVGColor","SVGComponentTransferFunctionElement","SVGCursorElement","SVGDefsElement","SVGDescElement","SVGDiscardElement","SVGDocument","SVGElement","SVGElementInstance","SVGElementInstanceList","SVGEllipseElement","SVGException","SVGFEBlendElement","SVGFEColorMatrixElement","SVGFEComponentTransferElement","SVGFECompositeElement","SVGFEConvolveMatrixElement","SVGFEDiffuseLightingElement","SVGFEDisplacementMapElement","SVGFEDistantLightElement","SVGFEDropShadowElement","SVGFEFloodElement","SVGFEFuncAElement","SVGFEFuncBElement","SVGFEFuncGElement","SVGFEFuncRElement","SVGFEGaussianBlurElement","SVGFEImageElement","SVGFEMergeElement","SVGFEMergeNodeElement","SVGFEMorphologyElement","SVGFEOffsetElement","SVGFEPointLightElement","SVGFESpecularLightingElement","SVGFESpotLightElement","SVGFETileElement","SVGFETurbulenceElement","SVGFilterElement","SVGFontElement","SVGFontFaceElement","SVGFontFaceFormatElement","SVGFontFaceNameElement","SVGFontFaceSrcElement","SVGFontFaceUriElement","SVGForeignObjectElement","SVGGElement","SVGGeometryElement","SVGGlyphElement","SVGGlyphRefElement","SVGGradientElement","SVGGraphicsElement","SVGHKernElement","SVGImageElement","SVGLength","SVGLengthList","SVGLineElement","SVGLinearGradientElement","SVGMPathElement","SVGMarkerElement","SVGMaskElement","SVGMatrix","SVGMetadataElement","SVGMissingGlyphElement","SVGNumber","SVGNumberList","SVGPaint","SVGPathElement","SVGPathSeg","SVGPathSegArcAbs","SVGPathSegArcRel","SVGPathSegClosePath","SVGPathSegCurvetoCubicAbs","SVGPathSegCurvetoCubicRel","SVGPathSegCurvetoCubicSmoothAbs","SVGPathSegCurvetoCubicSmoothRel","SVGPathSegCurvetoQuadraticAbs","SVGPathSegCurvetoQuadraticRel","SVGPathSegCurvetoQuadraticSmoothAbs","SVGPathSegCurvetoQuadraticSmoothRel","SVGPathSegLinetoAbs","SVGPathSegLinetoHorizontalAbs","SVGPathSegLinetoHorizontalRel","SVGPathSegLinetoRel","SVGPathSegLinetoVerticalAbs","SVGPathSegLinetoVerticalRel","SVGPathSegList","SVGPathSegMovetoAbs","SVGPathSegMovetoRel","SVGPatternElement","SVGPoint","SVGPointList","SVGPolygonElement","SVGPolylineElement","SVGPreserveAspectRatio","SVGRadialGradientElement","SVGRect","SVGRectElement","SVGRenderingIntent","SVGSVGElement","SVGScriptElement","SVGSetElement","SVGStopElement","SVGStringList","SVGStyleElement","SVGSwitchElement","SVGSymbolElement","SVGTRefElement","SVGTSpanElement","SVGTextContentElement","SVGTextElement","SVGTextPathElement","SVGTextPositioningElement","SVGTitleElement","SVGTransform","SVGTransformList","SVGUnitTypes","SVGUseElement","SVGVKernElement","SVGViewElement","SVGViewSpec","SVGZoomAndPan","SVGZoomEvent","SVG_ANGLETYPE_DEG","SVG_ANGLETYPE_GRAD","SVG_ANGLETYPE_RAD","SVG_ANGLETYPE_UNKNOWN","SVG_ANGLETYPE_UNSPECIFIED","SVG_CHANNEL_A","SVG_CHANNEL_B","SVG_CHANNEL_G","SVG_CHANNEL_R","SVG_CHANNEL_UNKNOWN","SVG_COLORTYPE_CURRENTCOLOR","SVG_COLORTYPE_RGBCOLOR","SVG_COLORTYPE_RGBCOLOR_ICCCOLOR","SVG_COLORTYPE_UNKNOWN","SVG_EDGEMODE_DUPLICATE","SVG_EDGEMODE_NONE","SVG_EDGEMODE_UNKNOWN","SVG_EDGEMODE_WRAP","SVG_FEBLEND_MODE_COLOR","SVG_FEBLEND_MODE_COLOR_BURN","SVG_FEBLEND_MODE_COLOR_DODGE","SVG_FEBLEND_MODE_DARKEN","SVG_FEBLEND_MODE_DIFFERENCE","SVG_FEBLEND_MODE_EXCLUSION","SVG_FEBLEND_MODE_HARD_LIGHT","SVG_FEBLEND_MODE_HUE","SVG_FEBLEND_MODE_LIGHTEN","SVG_FEBLEND_MODE_LUMINOSITY","SVG_FEBLEND_MODE_MULTIPLY","SVG_FEBLEND_MODE_NORMAL","SVG_FEBLEND_MODE_OVERLAY","SVG_FEBLEND_MODE_SATURATION","SVG_FEBLEND_MODE_SCREEN","SVG_FEBLEND_MODE_SOFT_LIGHT","SVG_FEBLEND_MODE_UNKNOWN","SVG_FECOLORMATRIX_TYPE_HUEROTATE","SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA","SVG_FECOLORMATRIX_TYPE_MATRIX","SVG_FECOLORMATRIX_TYPE_SATURATE","SVG_FECOLORMATRIX_TYPE_UNKNOWN","SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE","SVG_FECOMPONENTTRANSFER_TYPE_GAMMA","SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY","SVG_FECOMPONENTTRANSFER_TYPE_LINEAR","SVG_FECOMPONENTTRANSFER_TYPE_TABLE","SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_ARITHMETIC","SVG_FECOMPOSITE_OPERATOR_ATOP","SVG_FECOMPOSITE_OPERATOR_IN","SVG_FECOMPOSITE_OPERATOR_LIGHTER","SVG_FECOMPOSITE_OPERATOR_OUT","SVG_FECOMPOSITE_OPERATOR_OVER","SVG_FECOMPOSITE_OPERATOR_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_XOR","SVG_INVALID_VALUE_ERR","SVG_LENGTHTYPE_CM","SVG_LENGTHTYPE_EMS","SVG_LENGTHTYPE_EXS","SVG_LENGTHTYPE_IN","SVG_LENGTHTYPE_MM","SVG_LENGTHTYPE_NUMBER","SVG_LENGTHTYPE_PC","SVG_LENGTHTYPE_PERCENTAGE","SVG_LENGTHTYPE_PT","SVG_LENGTHTYPE_PX","SVG_LENGTHTYPE_UNKNOWN","SVG_MARKERUNITS_STROKEWIDTH","SVG_MARKERUNITS_UNKNOWN","SVG_MARKERUNITS_USERSPACEONUSE","SVG_MARKER_ORIENT_ANGLE","SVG_MARKER_ORIENT_AUTO","SVG_MARKER_ORIENT_AUTO_START_REVERSE","SVG_MARKER_ORIENT_UNKNOWN","SVG_MASKTYPE_ALPHA","SVG_MASKTYPE_LUMINANCE","SVG_MATRIX_NOT_INVERTABLE","SVG_MEETORSLICE_MEET","SVG_MEETORSLICE_SLICE","SVG_MEETORSLICE_UNKNOWN","SVG_MORPHOLOGY_OPERATOR_DILATE","SVG_MORPHOLOGY_OPERATOR_ERODE","SVG_MORPHOLOGY_OPERATOR_UNKNOWN","SVG_PAINTTYPE_CURRENTCOLOR","SVG_PAINTTYPE_NONE","SVG_PAINTTYPE_RGBCOLOR","SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR","SVG_PAINTTYPE_UNKNOWN","SVG_PAINTTYPE_URI","SVG_PAINTTYPE_URI_CURRENTCOLOR","SVG_PAINTTYPE_URI_NONE","SVG_PAINTTYPE_URI_RGBCOLOR","SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR","SVG_PRESERVEASPECTRATIO_NONE","SVG_PRESERVEASPECTRATIO_UNKNOWN","SVG_PRESERVEASPECTRATIO_XMAXYMAX","SVG_PRESERVEASPECTRATIO_XMAXYMID","SVG_PRESERVEASPECTRATIO_XMAXYMIN","SVG_PRESERVEASPECTRATIO_XMIDYMAX","SVG_PRESERVEASPECTRATIO_XMIDYMID","SVG_PRESERVEASPECTRATIO_XMIDYMIN","SVG_PRESERVEASPECTRATIO_XMINYMAX","SVG_PRESERVEASPECTRATIO_XMINYMID","SVG_PRESERVEASPECTRATIO_XMINYMIN","SVG_SPREADMETHOD_PAD","SVG_SPREADMETHOD_REFLECT","SVG_SPREADMETHOD_REPEAT","SVG_SPREADMETHOD_UNKNOWN","SVG_STITCHTYPE_NOSTITCH","SVG_STITCHTYPE_STITCH","SVG_STITCHTYPE_UNKNOWN","SVG_TRANSFORM_MATRIX","SVG_TRANSFORM_ROTATE","SVG_TRANSFORM_SCALE","SVG_TRANSFORM_SKEWX","SVG_TRANSFORM_SKEWY","SVG_TRANSFORM_TRANSLATE","SVG_TRANSFORM_UNKNOWN","SVG_TURBULENCE_TYPE_FRACTALNOISE","SVG_TURBULENCE_TYPE_TURBULENCE","SVG_TURBULENCE_TYPE_UNKNOWN","SVG_UNIT_TYPE_OBJECTBOUNDINGBOX","SVG_UNIT_TYPE_UNKNOWN","SVG_UNIT_TYPE_USERSPACEONUSE","SVG_WRONG_TYPE_ERR","SVG_ZOOMANDPAN_DISABLE","SVG_ZOOMANDPAN_MAGNIFY","SVG_ZOOMANDPAN_UNKNOWN","SYNC_CONDITION","SYNC_FENCE","SYNC_FLAGS","SYNC_FLUSH_COMMANDS_BIT","SYNC_GPU_COMMANDS_COMPLETE","SYNC_STATUS","SYNTAX_ERR","SavedPages","Scheduler","Scheduling","Screen","ScreenDetailed","ScreenDetails","ScreenOrientation","Script","ScriptProcessorNode","ScrollAreaEvent","ScrollTimeline","SecurityPolicyViolationEvent","Segmenter","Selection","Sensor","SensorErrorEvent","Serial","SerialPort","ServiceWorker","ServiceWorkerContainer","ServiceWorkerRegistration","SessionDescription","Set","ShadowRoot","SharedArrayBuffer","SharedStorage","SharedStorageWorklet","SharedWorker","SharingState","SimpleGestureEvent","SnapEvent","SourceBuffer","SourceBufferList","SpeechSynthesis","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","SpeechSynthesisUtterance","SpeechSynthesisVoice","StaticRange","StereoPannerNode","StopIteration","Storage","StorageBucket","StorageBucketManager","StorageEvent","StorageManager","String","StructType","StylePropertyMap","StylePropertyMapReadOnly","StyleSheet","StyleSheetList","SubmitEvent","SubtleCrypto","Symbol","SyncManager","SyntaxError","TAB_ID_NONE","TAB_INDEX_NONE","TEMPORARY","TEXTPATH_METHODTYPE_ALIGN","TEXTPATH_METHODTYPE_STRETCH","TEXTPATH_METHODTYPE_UNKNOWN","TEXTPATH_SPACINGTYPE_AUTO","TEXTPATH_SPACINGTYPE_EXACT","TEXTPATH_SPACINGTYPE_UNKNOWN","TEXTURE","TEXTURE0","TEXTURE1","TEXTURE10","TEXTURE11","TEXTURE12","TEXTURE13","TEXTURE14","TEXTURE15","TEXTURE16","TEXTURE17","TEXTURE18","TEXTURE19","TEXTURE2","TEXTURE20","TEXTURE21","TEXTURE22","TEXTURE23","TEXTURE24","TEXTURE25","TEXTURE26","TEXTURE27","TEXTURE28","TEXTURE29","TEXTURE3","TEXTURE30","TEXTURE31","TEXTURE4","TEXTURE5","TEXTURE6","TEXTURE7","TEXTURE8","TEXTURE9","TEXTURE_2D","TEXTURE_2D_ARRAY","TEXTURE_3D","TEXTURE_BASE_LEVEL","TEXTURE_BINDING","TEXTURE_BINDING_2D","TEXTURE_BINDING_2D_ARRAY","TEXTURE_BINDING_3D","TEXTURE_BINDING_CUBE_MAP","TEXTURE_COMPARE_FUNC","TEXTURE_COMPARE_MODE","TEXTURE_CUBE_MAP","TEXTURE_CUBE_MAP_NEGATIVE_X","TEXTURE_CUBE_MAP_NEGATIVE_Y","TEXTURE_CUBE_MAP_NEGATIVE_Z","TEXTURE_CUBE_MAP_POSITIVE_X","TEXTURE_CUBE_MAP_POSITIVE_Y","TEXTURE_CUBE_MAP_POSITIVE_Z","TEXTURE_IMMUTABLE_FORMAT","TEXTURE_IMMUTABLE_LEVELS","TEXTURE_MAG_FILTER","TEXTURE_MAX_ANISOTROPY_EXT","TEXTURE_MAX_LEVEL","TEXTURE_MAX_LOD","TEXTURE_MIN_FILTER","TEXTURE_MIN_LOD","TEXTURE_WRAP_R","TEXTURE_WRAP_S","TEXTURE_WRAP_T","TEXT_NODE","TIMEOUT","TIMEOUT_ERR","TIMEOUT_EXPIRED","TIMEOUT_IGNORED","TOO_LARGE_ERR","TRANSACTION_INACTIVE_ERR","TRANSFORM_FEEDBACK","TRANSFORM_FEEDBACK_ACTIVE","TRANSFORM_FEEDBACK_BINDING","TRANSFORM_FEEDBACK_BUFFER","TRANSFORM_FEEDBACK_BUFFER_BINDING","TRANSFORM_FEEDBACK_BUFFER_MODE","TRANSFORM_FEEDBACK_BUFFER_SIZE","TRANSFORM_FEEDBACK_BUFFER_START","TRANSFORM_FEEDBACK_PAUSED","TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN","TRANSFORM_FEEDBACK_VARYINGS","TRIANGLE","TRIANGLES","TRIANGLE_FAN","TRIANGLE_STRIP","TYPE_BACK_FORWARD","TYPE_ERR","TYPE_MISMATCH_ERR","TYPE_NAVIGATE","TYPE_RELOAD","TYPE_RESERVED","Tab","TabStatus","Table","Tag","TaskAttributionTiming","TaskController","TaskPriorityChangeEvent","TaskSignal","Text","TextDecoder","TextDecoderStream","TextEncoder","TextEncoderStream","TextEvent","TextFormat","TextFormatUpdateEvent","TextMetrics","TextTrack","TextTrackCue","TextTrackCueList","TextTrackList","TextUpdateEvent","TimeEvent","TimeRanges","ToggleEvent","Touch","TouchEvent","TouchList","TrackEvent","TransformStream","TransformStreamDefaultController","TransitionEvent","TreeWalker","TrustedHTML","TrustedScript","TrustedScriptURL","TrustedTypePolicy","TrustedTypePolicyFactory","TypeError","TypedObject","U2F","UIEvent","UNCACHED","UNIFORM","UNIFORM_ARRAY_STRIDE","UNIFORM_BLOCK_ACTIVE_UNIFORMS","UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES","UNIFORM_BLOCK_BINDING","UNIFORM_BLOCK_DATA_SIZE","UNIFORM_BLOCK_INDEX","UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER","UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER","UNIFORM_BUFFER","UNIFORM_BUFFER_BINDING","UNIFORM_BUFFER_OFFSET_ALIGNMENT","UNIFORM_BUFFER_SIZE","UNIFORM_BUFFER_START","UNIFORM_IS_ROW_MAJOR","UNIFORM_MATRIX_STRIDE","UNIFORM_OFFSET","UNIFORM_SIZE","UNIFORM_TYPE","UNKNOWN_ERR","UNKNOWN_RULE","UNMASKED_RENDERER_WEBGL","UNMASKED_VENDOR_WEBGL","UNORDERED_NODE_ITERATOR_TYPE","UNORDERED_NODE_SNAPSHOT_TYPE","UNPACK_ALIGNMENT","UNPACK_COLORSPACE_CONVERSION_WEBGL","UNPACK_FLIP_Y_WEBGL","UNPACK_IMAGE_HEIGHT","UNPACK_PREMULTIPLY_ALPHA_WEBGL","UNPACK_ROW_LENGTH","UNPACK_SKIP_IMAGES","UNPACK_SKIP_PIXELS","UNPACK_SKIP_ROWS","UNSCHEDULED_STATE","UNSENT","UNSIGNALED","UNSIGNED_BYTE","UNSIGNED_INT","UNSIGNED_INT_10F_11F_11F_REV","UNSIGNED_INT_24_8","UNSIGNED_INT_2_10_10_10_REV","UNSIGNED_INT_5_9_9_9_REV","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_VEC2","UNSIGNED_INT_VEC3","UNSIGNED_INT_VEC4","UNSIGNED_NORMALIZED","UNSIGNED_SHORT","UNSIGNED_SHORT_4_4_4_4","UNSIGNED_SHORT_5_5_5_1","UNSIGNED_SHORT_5_6_5","UNSPECIFIED_EVENT_TYPE_ERR","UPDATEREADY","URIError","URL","URLPattern","URLSearchParams","URLUnencoded","URL_MISMATCH_ERR","USB","USBAlternateInterface","USBConfiguration","USBConnectionEvent","USBDevice","USBEndpoint","USBInTransferResult","USBInterface","USBIsochronousInTransferPacket","USBIsochronousInTransferResult","USBIsochronousOutTransferPacket","USBIsochronousOutTransferResult","USBOutTransferResult","UTC","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","UpdateFilter","UpdatePropertyName","UserActivation","UserMessageHandler","UserMessageHandlersNamespace","UserProximityEvent","VALIDATE_STATUS","VALIDATION_ERR","VARIABLES_RULE","VENDOR","VERSION","VERSION_CHANGE","VERSION_ERR","VERTEX","VERTEX_ARRAY_BINDING","VERTEX_ATTRIB_ARRAY_BUFFER_BINDING","VERTEX_ATTRIB_ARRAY_DIVISOR","VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE","VERTEX_ATTRIB_ARRAY_ENABLED","VERTEX_ATTRIB_ARRAY_INTEGER","VERTEX_ATTRIB_ARRAY_NORMALIZED","VERTEX_ATTRIB_ARRAY_POINTER","VERTEX_ATTRIB_ARRAY_SIZE","VERTEX_ATTRIB_ARRAY_STRIDE","VERTEX_ATTRIB_ARRAY_TYPE","VERTEX_SHADER","VERTICAL","VERTICAL_AXIS","VER_ERR","VIEWPORT","VIEWPORT_RULE","VRDisplay","VRDisplayCapabilities","VRDisplayEvent","VREyeParameters","VRFieldOfView","VRFrameData","VRPose","VRStageParameters","VTTCue","VTTRegion","ValidityState","VideoColorSpace","VideoDecoder","VideoEncoder","VideoFrame","VideoPlaybackQuality","VideoStreamTrack","ViewTimeline","ViewTransition","ViewTransitionTypeSet","ViewType","VirtualKeyboard","VirtualKeyboardGeometryChangeEvent","VisibilityStateEntry","VisualViewport","WAIT_FAILED","WEBKIT_FILTER_RULE","WEBKIT_KEYFRAMES_RULE","WEBKIT_KEYFRAME_RULE","WEBKIT_REGION_RULE","WGSLLanguageFeatures","WINDOW_ID_CURRENT","WINDOW_ID_NONE","WRITE","WRONG_DOCUMENT_ERR","WakeLock","WakeLockSentinel","WasmAnyRef","WaveShaperNode","WeakMap","WeakRef","WeakSet","WebAssembly","WebGL2RenderingContext","WebGLActiveInfo","WebGLBuffer","WebGLContextEvent","WebGLFramebuffer","WebGLObject","WebGLProgram","WebGLQuery","WebGLRenderbuffer","WebGLRenderingContext","WebGLSampler","WebGLShader","WebGLShaderPrecisionFormat","WebGLSync","WebGLTexture","WebGLTransformFeedback","WebGLUniformLocation","WebGLVertexArray","WebGLVertexArrayObject","WebKitAnimationEvent","WebKitBlobBuilder","WebKitCSSFilterRule","WebKitCSSFilterValue","WebKitCSSKeyframeRule","WebKitCSSKeyframesRule","WebKitCSSMatrix","WebKitCSSRegionRule","WebKitCSSTransformValue","WebKitDataCue","WebKitGamepad","WebKitMediaKeyError","WebKitMediaKeyMessageEvent","WebKitMediaKeySession","WebKitMediaKeys","WebKitMediaSource","WebKitMutationObserver","WebKitNamespace","WebKitPlaybackTargetAvailabilityEvent","WebKitPoint","WebKitShadowRoot","WebKitSourceBuffer","WebKitSourceBufferList","WebKitTransitionEvent","WebSocket","WebSocketError","WebSocketStream","WebTransport","WebTransportBidirectionalStream","WebTransportDatagramDuplexStream","WebTransportError","WebTransportReceiveStream","WebTransportSendStream","WebkitAlignContent","WebkitAlignItems","WebkitAlignSelf","WebkitAnimation","WebkitAnimationDelay","WebkitAnimationDirection","WebkitAnimationDuration","WebkitAnimationFillMode","WebkitAnimationIterationCount","WebkitAnimationName","WebkitAnimationPlayState","WebkitAnimationTimingFunction","WebkitAppearance","WebkitBackfaceVisibility","WebkitBackgroundClip","WebkitBackgroundOrigin","WebkitBackgroundSize","WebkitBorderBottomLeftRadius","WebkitBorderBottomRightRadius","WebkitBorderImage","WebkitBorderRadius","WebkitBorderTopLeftRadius","WebkitBorderTopRightRadius","WebkitBoxAlign","WebkitBoxDirection","WebkitBoxFlex","WebkitBoxOrdinalGroup","WebkitBoxOrient","WebkitBoxPack","WebkitBoxShadow","WebkitBoxSizing","WebkitClipPath","WebkitFilter","WebkitFlex","WebkitFlexBasis","WebkitFlexDirection","WebkitFlexFlow","WebkitFlexGrow","WebkitFlexShrink","WebkitFlexWrap","WebkitFontFeatureSettings","WebkitJustifyContent","WebkitLineClamp","WebkitMask","WebkitMaskClip","WebkitMaskComposite","WebkitMaskImage","WebkitMaskOrigin","WebkitMaskPosition","WebkitMaskPositionX","WebkitMaskPositionY","WebkitMaskRepeat","WebkitMaskSize","WebkitOrder","WebkitPerspective","WebkitPerspectiveOrigin","WebkitTextFillColor","WebkitTextSecurity","WebkitTextSizeAdjust","WebkitTextStroke","WebkitTextStrokeColor","WebkitTextStrokeWidth","WebkitTransform","WebkitTransformOrigin","WebkitTransformStyle","WebkitTransition","WebkitTransitionDelay","WebkitTransitionDuration","WebkitTransitionProperty","WebkitTransitionTimingFunction","WebkitUserSelect","WheelEvent","Window","WindowControlsOverlay","WindowControlsOverlayGeometryChangeEvent","WindowState","WindowType","Worker","Worklet","WritableStream","WritableStreamDefaultController","WritableStreamDefaultWriter","XMLDocument","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestException","XMLHttpRequestProgressEvent","XMLHttpRequestUpload","XMLSerializer","XMLStylesheetProcessingInstruction","XPathEvaluator","XPathException","XPathExpression","XPathNSResolver","XPathResult","XRAnchor","XRAnchorSet","XRBoundedReferenceSpace","XRCPUDepthInformation","XRCamera","XRDOMOverlayState","XRDepthInformation","XRFrame","XRHand","XRHitTestResult","XRHitTestSource","XRInputSource","XRInputSourceArray","XRInputSourceEvent","XRInputSourcesChangeEvent","XRJointPose","XRJointSpace","XRLayer","XRLightEstimate","XRLightProbe","XRPose","XRRay","XRReferenceSpace","XRReferenceSpaceEvent","XRRenderState","XRRigidTransform","XRSession","XRSessionEvent","XRSpace","XRSystem","XRTransientInputHitTestResult","XRTransientInputHitTestSource","XRView","XRViewerPose","XRViewport","XRWebGLBinding","XRWebGLDepthInformation","XRWebGLLayer","XSLTProcessor","ZERO","ZoomSettings","ZoomSettingsMode","ZoomSettingsScope","_XD0M_","_YD0M_","__REACT_DEVTOOLS_GLOBAL_HOOK__","__brand","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__opera","__proto__","_browserjsran","a","aLink","abbr","abort","aborted","aboutConfigPrefs","abs","absolute","acceleration","accelerationIncludingGravity","accelerator","accent-color","accentColor","accept","acceptCharset","acceptNode","access","accessKey","accessKeyLabel","accuracy","acos","acosh","action","actionURL","actions","activated","activation","activationStart","active","activeCues","activeElement","activeSourceBuffers","activeSourceCount","activeTexture","activeVRDisplays","activityLog","actualBoundingBoxAscent","actualBoundingBoxDescent","actualBoundingBoxLeft","actualBoundingBoxRight","adAuctionComponents","adAuctionHeaders","add","addAll","addBehavior","addCandidate","addColorStop","addCue","addElement","addEventListener","addFilter","addFromString","addFromUri","addIceCandidate","addImport","addListener","addModule","addNamed","addPageRule","addPath","addPointer","addRange","addRegion","addRule","addSearchEngine","addSourceBuffer","addStream","addTextTrack","addTrack","addTransceiver","addWakeLockListener","added","addedNodes","additionalName","additiveSymbols","addons","address","addressLine","addressModeU","addressModeV","addressModeW","adoptNode","adoptedCallback","adoptedStyleSheets","adr","advance","after","alarms","album","alert","algorithm","align","align-content","align-items","align-self","alignContent","alignItems","alignSelf","alignmentBaseline","alinkColor","all","allSettled","allocationSize","allow","allowFullscreen","allowPaymentRequest","allowedDirections","allowedFeatures","allowedToPlay","allowsFeature","alpha","alphaMode","alphaToCoverageEnabled","alphabeticBaseline","alt","altGraphKey","altHtml","altKey","altLeft","alternate","alternateSetting","alternates","altitude","altitudeAccuracy","altitudeAngle","amplitude","ancestorOrigins","anchor","anchorNode","anchorOffset","anchorSpace","anchors","and","angle","angularAcceleration","angularVelocity","animVal","animate","animated","animatedInstanceRoot","animatedNormalizedPathSegList","animatedPathSegList","animatedPoints","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","animationComposition","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationStartTime","animationTimingFunction","animationsPaused","anniversary","antialias","anticipatedRemoval","any","app","appCodeName","appMinorVersion","appName","appNotifications","appVersion","appearance","append","appendBuffer","appendChild","appendData","appendItem","appendMedium","appendNamed","appendRule","appendStream","appendWindowEnd","appendWindowStart","applets","applicationCache","applicationServerKey","apply","applyConstraints","applyElement","arc","arcTo","arch","architecture","archive","areas","arguments","ariaAtomic","ariaAutoComplete","ariaBrailleLabel","ariaBrailleRoleDescription","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColIndexText","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRelevant","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowIndexText","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","arrayBuffer","arrayLayerCount","arrayStride","artist","artwork","as","asIntN","asUintN","ascentOverride","asin","asinh","aspect","aspect-ratio","aspectRatio","assert","assign","assignedElements","assignedNodes","assignedSlot","async","asyncDispose","asyncIterator","at","atEnd","atan","atan2","atanh","atob","attachEvent","attachInternals","attachShader","attachShadow","attachedElements","attachments","attack","attestationObject","attrChange","attrName","attributeChangedCallback","attributeFilter","attributeName","attributeNamespace","attributeOldValue","attributeStyleMap","attributes","attribution","attributionSrc","audioBitrateMode","audioBitsPerSecond","audioTracks","audioWorklet","authenticatedSignedWrites","authenticatorAttachment","authenticatorData","autoIncrement","autobuffer","autocapitalize","autocomplete","autocorrect","autofocus","automationRate","autoplay","availHeight","availLeft","availTop","availWidth","availability","available","averageLatency","aversion","ax","axes","axis","ay","azimuth","azimuthAngle","b","back","backdrop-filter","backdropFilter","backends","backface-visibility","backfaceVisibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundFetch","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","badInput","badge","balance","baseArrayLayer","baseFrequencyX","baseFrequencyY","baseLatency","baseLayer","baseMipLevel","baseNode","baseOffset","basePalette","baseURI","baseVal","baseline-source","baselineShift","baselineSource","battery","bday","before","beginComputePass","beginElement","beginElementAt","beginOcclusionQuery","beginPath","beginQuery","beginRenderPass","beginTransformFeedback","beginningOfPassWriteIndex","behavior","behaviorCookie","behaviorPart","behaviorUrns","beta","bezierCurveTo","bgColor","bgProperties","bias","big","bigint64","biguint64","binaryType","bind","bindAttribLocation","bindBuffer","bindBufferBase","bindBufferRange","bindFramebuffer","bindGroupLayouts","bindRenderbuffer","bindSampler","bindTexture","bindTransformFeedback","bindVertexArray","binding","bitness","blend","blendColor","blendEquation","blendEquationSeparate","blendFunc","blendFuncSeparate","blink","blitFramebuffer","blob","block-size","blockDirection","blockSize","blockedURI","blocking","blockingDuration","blue","bluetooth","blur","body","bodyUsed","bold","bookmarks","booleanValue","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderBoxSize","borderCollapse","borderColor","borderColorDark","borderColorLight","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","bottomMargin","bound","boundElements","boundingClientRect","boundingHeight","boundingLeft","boundingRect","boundingTop","boundingWidth","bounds","boundsGeometry","box-decoration-break","box-shadow","box-sizing","boxDecorationBreak","boxShadow","boxSizing","brand","brands","break-after","break-before","break-inside","breakAfter","breakBefore","breakInside","broadcast","browser","browserLanguage","browserSettings","browsingData","browsingTopics","btoa","bubbles","buffer","bufferData","bufferDepth","bufferSize","bufferSubData","buffered","bufferedAmount","bufferedAmountLowThreshold","buffers","buildID","buildNumber","button","buttonID","buttons","byobRequest","byteLength","byteOffset","bytes","bytesPerRow","bytesWritten","c","cache","caches","call","caller","camera","canBeFormatted","canBeMounted","canBeShared","canConstructInDedicatedWorker","canGoBack","canGoForward","canHaveChildren","canHaveHTML","canInsertDTMF","canIntercept","canLoadAdAuctionFencedFrame","canLoadOpaqueURL","canMakePayment","canParse","canPlayType","canPresent","canShare","canTransition","canTrickleIceCandidates","cancel","cancelAndHoldAtTime","cancelAnimationFrame","cancelBubble","cancelIdleCallback","cancelScheduledValues","cancelVideoFrameCallback","cancelWatchAvailability","cancelable","candidate","canonicalUUID","canvas","cap","capabilities","caption","caption-side","captionSide","captivePortal","capture","captureEvents","captureStackTrace","captureStream","captureTab","captureVisibleTab","caret-color","caretBidiLevel","caretColor","caretPositionFromPoint","caretRangeFromPoint","cast","catch","category","cbrt","cd","ceil","cellIndex","cellPadding","cellSpacing","cells","ch","chOff","chain","challenge","changeType","changed","changedTouches","channel","channelCount","channelCountMode","channelInterpretation","chapterInfo","char","charAt","charCode","charCodeAt","charIndex","charLength","characterBounds","characterBoundsRangeStart","characterData","characterDataOldValue","characterSet","characteristic","charging","chargingTime","charset","check","checkDCE","checkEnclosure","checkFramebufferStatus","checkIntersection","checkValidity","checkVisibility","checked","childElementCount","childList","childNodes","children","chrome","ciphertext","cite","city","claimInterface","claimed","classList","className","classid","clear","clearAppBadge","clearAttributes","clearBuffer","clearBufferfi","clearBufferfv","clearBufferiv","clearBufferuiv","clearColor","clearData","clearDepth","clearHalt","clearImmediate","clearInterval","clearLiveSeekableRange","clearMarks","clearMaxGCPauseAccumulator","clearMeasures","clearOriginJoinedAdInterestGroups","clearParameters","clearRect","clearResourceTimings","clearShadow","clearStencil","clearTimeout","clearValue","clearWatch","click","clickCount","clientDataJSON","clientHeight","clientInformation","clientLeft","clientRect","clientRects","clientTop","clientWaitSync","clientWidth","clientX","clientY","clip","clip-path","clip-rule","clipBottom","clipLeft","clipPath","clipPathUnits","clipRight","clipRule","clipTop","clipboard","clipboardData","clonable","clone","cloneContents","cloneNode","cloneRange","close","closeCode","closePath","closed","closest","clz","clz32","cm","cmp","code","codeBase","codePointAt","codeType","codedHeight","codedRect","codedWidth","colSpan","collapse","collapseToEnd","collapseToStart","collapsed","collect","collections","colno","color","color-adjust","color-interpolation","color-interpolation-filters","color-scheme","colorAdjust","colorAttachments","colorDepth","colorFormats","colorInterpolation","colorInterpolationFilters","colorMask","colorScheme","colorSpace","colorType","cols","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columnCount","columnFill","columnGap","columnNumber","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","command","commands","commit","commitLoadTime","commitPreferences","commitStyles","commonAncestorContainer","compact","compare","compareBoundaryPoints","compareDocumentPosition","compareEndPoints","compareExchange","compareNode","comparePoint","compatMode","compatible","compile","compileShader","compileStreaming","complete","completed","component","componentFromPoint","composed","composedPath","composite","compositionEndOffset","compositionStartOffset","compressedTexImage2D","compressedTexImage3D","compressedTexSubImage2D","compressedTexSubImage3D","compute","computedStyleMap","concat","conditionText","coneInnerAngle","coneOuterAngle","coneOuterGain","config","configurable","configuration","configurationName","configurationValue","configurations","configure","confirm","confirmComposition","confirmSiteSpecificTrackingException","confirmWebWideTrackingException","congestionControl","connect","connectEnd","connectNative","connectShark","connectStart","connected","connectedCallback","connection","connectionInfo","connectionList","connectionSpeed","connectionState","connections","console","consolidate","constants","constraint","constrictionActive","construct","constructor","contactID","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","containIntrinsicBlockSize","containIntrinsicHeight","containIntrinsicInlineSize","containIntrinsicSize","containIntrinsicWidth","container","container-name","container-type","containerId","containerName","containerQuery","containerSrc","containerType","contains","containsNode","content","content-visibility","contentBoxSize","contentDocument","contentEditable","contentHint","contentOverflow","contentRect","contentScriptType","contentStyleType","contentType","contentVisibility","contentWindow","context","contextId","contextIds","contextMenu","contextMenus","contextType","contextTypes","contextmenu","contextualIdentities","continue","continuePrimaryKey","continuous","control","controlTransferIn","controlTransferOut","controller","controls","controlsList","convertPointFromNode","convertQuadFromNode","convertRectFromNode","convertToBlob","convertToSpecifiedUnits","cookie","cookieEnabled","cookieStore","cookies","coords","copyBufferSubData","copyBufferToBuffer","copyBufferToTexture","copyExternalImageToTexture","copyFromChannel","copyTexImage2D","copyTexSubImage2D","copyTexSubImage3D","copyTextureToBuffer","copyTextureToTexture","copyTo","copyToChannel","copyWithin","correspondingElement","correspondingUseElement","corruptedVideoFrames","cos","cosh","count","countReset","counter-increment","counter-reset","counter-set","counterIncrement","counterReset","counterSet","country","cpuClass","cpuSleepAllowed","cqb","cqh","cqi","cqmax","cqmin","cqw","create","createAnalyser","createAnchor","createAnswer","createAttribute","createAttributeNS","createAuctionNonce","createBidirectionalStream","createBindGroup","createBindGroupLayout","createBiquadFilter","createBuffer","createBufferSource","createCDATASection","createCSSStyleSheet","createCaption","createChannelMerger","createChannelSplitter","createCommandEncoder","createComment","createComputePipeline","createComputePipelineAsync","createConicGradient","createConstantSource","createContextualFragment","createControlRange","createConvolver","createDTMFSender","createDataChannel","createDelay","createDelayNode","createDocument","createDocumentFragment","createDocumentType","createDynamicsCompressor","createElement","createElementNS","createEncodedStreams","createEntityReference","createEvent","createEventObject","createExpression","createFramebuffer","createFunction","createGain","createGainNode","createHTML","createHTMLDocument","createIIRFilter","createImageBitmap","createImageData","createIndex","createJavaScriptNode","createLinearGradient","createMediaElementSource","createMediaKeys","createMediaStreamDestination","createMediaStreamSource","createMediaStreamTrackSource","createMutableFile","createNSResolver","createNodeIterator","createNotification","createObjectStore","createObjectURL","createOffer","createOscillator","createPanner","createPattern","createPeriodicWave","createPipelineLayout","createPolicy","createPopup","createProcessingInstruction","createProgram","createQuery","createQuerySet","createRadialGradient","createRange","createRangeCollection","createReader","createRenderBundleEncoder","createRenderPipeline","createRenderPipelineAsync","createRenderbuffer","createSVGAngle","createSVGLength","createSVGMatrix","createSVGNumber","createSVGPathSegArcAbs","createSVGPathSegArcRel","createSVGPathSegClosePath","createSVGPathSegCurvetoCubicAbs","createSVGPathSegCurvetoCubicRel","createSVGPathSegCurvetoCubicSmoothAbs","createSVGPathSegCurvetoCubicSmoothRel","createSVGPathSegCurvetoQuadraticAbs","createSVGPathSegCurvetoQuadraticRel","createSVGPathSegCurvetoQuadraticSmoothAbs","createSVGPathSegCurvetoQuadraticSmoothRel","createSVGPathSegLinetoAbs","createSVGPathSegLinetoHorizontalAbs","createSVGPathSegLinetoHorizontalRel","createSVGPathSegLinetoRel","createSVGPathSegLinetoVerticalAbs","createSVGPathSegLinetoVerticalRel","createSVGPathSegMovetoAbs","createSVGPathSegMovetoRel","createSVGPoint","createSVGRect","createSVGTransform","createSVGTransformFromMatrix","createSampler","createScript","createScriptProcessor","createScriptURL","createSession","createShader","createShaderModule","createShadowRoot","createStereoPanner","createStyleSheet","createTBody","createTFoot","createTHead","createTask","createTextNode","createTextRange","createTexture","createTouch","createTouchList","createTransformFeedback","createTreeWalker","createUnidirectionalStream","createVertexArray","createView","createWaveShaper","createWorklet","createWritable","creationTime","credentialless","credentials","criticalCHRestart","cropTo","crossOrigin","crossOriginIsolated","crypto","csi","csp","cssFloat","cssRules","cssText","cssValueType","ctrlKey","ctrlLeft","cues","cullFace","cullMode","currentCSSZoom","currentDirection","currentEntry","currentLocalDescription","currentNode","currentPage","currentRect","currentRemoteDescription","currentScale","currentScreen","currentScript","currentSrc","currentState","currentStyle","currentTarget","currentTime","currentTranslate","currentView","cursor","curve","customElements","customError","cx","cy","d","data","dataFld","dataFormatAs","dataLoss","dataLossMessage","dataPageSize","dataSrc","dataTransfer","database","databases","datagrams","dataset","dateTime","db","debug","debuggerEnabled","declarativeNetRequest","declare","decode","decodeAudioData","decodeQueueSize","decodeURI","decodeURIComponent","decodedBodySize","decoding","decodingInfo","decrypt","default","defaultCharset","defaultChecked","defaultMuted","defaultPlaybackRate","defaultPolicy","defaultPrevented","defaultQueue","defaultRequest","defaultSelected","defaultStatus","defaultURL","defaultValue","defaultView","defaultstatus","defer","define","defineMagicFunction","defineMagicVariable","defineProperties","defineProperty","deg","delay","delayTime","delegatesFocus","delete","deleteBuffer","deleteCaption","deleteCell","deleteContents","deleteData","deleteDatabase","deleteFramebuffer","deleteFromDocument","deleteIndex","deleteMedium","deleteObjectStore","deleteProgram","deleteProperty","deleteQuery","deleteRenderbuffer","deleteRow","deleteRule","deleteSampler","deleteShader","deleteSync","deleteTFoot","deleteTHead","deleteTexture","deleteTransformFeedback","deleteVertexArray","deleted","deliverChangeRecords","deliveredFrames","deliveredFramesDuration","delivery","deliveryInfo","deliveryStatus","deliveryTimestamp","deliveryType","delta","deltaMode","deltaX","deltaY","deltaZ","dependentLocality","deprecatedReplaceInURN","deprecatedRunAdAuctionEnforcesKAnonymity","deprecatedURNToURL","depthBias","depthBiasClamp","depthBiasSlopeScale","depthClearValue","depthCompare","depthDataFormat","depthFailOp","depthFar","depthFunc","depthLoadOp","depthMask","depthNear","depthOrArrayLayers","depthRange","depthReadOnly","depthStencil","depthStencilAttachment","depthStencilFormat","depthStoreOp","depthUsage","depthWriteEnabled","deref","deriveBits","deriveKey","descentOverride","description","deselectAll","designMode","desiredSize","destination","destinationURL","destroy","detach","detachEvent","detachShader","detached","detail","details","detect","detectLanguage","detune","device","deviceClass","deviceId","deviceMemory","devicePixelContentBoxSize","devicePixelRatio","deviceProtocol","deviceSubclass","deviceVersionMajor","deviceVersionMinor","deviceVersionSubminor","deviceXDPI","deviceYDPI","devtools","devtools_panels","didTimeout","difference","diffuseConstant","digest","dimension","dimensions","dir","dirName","direction","dirxml","disable","disablePictureInPicture","disableRemotePlayback","disableVertexAttribArray","disabled","discard","discardedFrames","dischargingTime","disconnect","disconnectShark","disconnectedCallback","dispatchEvent","dispatchWorkgroups","dispatchWorkgroupsIndirect","display","displayHeight","displayId","displayName","displayWidth","dispose","disposition","distanceModel","div","divisor","djsapi","djsproxy","dns","doImport","doNotTrack","doScroll","doctype","document","documentElement","documentId","documentIds","documentLifecycle","documentMode","documentOrigin","documentOrigins","documentPictureInPicture","documentURI","documentUrl","documentUrls","dolphin","dolphinGameCenter","dolphininfo","dolphinmeta","dom","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domOverlayState","domain","domainLookupEnd","domainLookupStart","dominant-baseline","dominantBaseline","done","dopplerFactor","dotAll","downDegrees","downlink","download","downloadRequest","downloadTotal","downloaded","downloads","dpcm","dpi","dppx","dragDrop","draggable","draw","drawArrays","drawArraysInstanced","drawArraysInstancedANGLE","drawBuffers","drawCustomFocusRing","drawElements","drawElementsInstanced","drawElementsInstancedANGLE","drawFocusIfNeeded","drawImage","drawImageFromRect","drawIndexed","drawIndexedIndirect","drawIndirect","drawRangeElements","drawSystemFocusRing","drawingBufferColorSpace","drawingBufferFormat","drawingBufferHeight","drawingBufferStorage","drawingBufferWidth","drop","dropEffect","droppedVideoFrames","dropzone","dstFactor","dtmf","dump","dumpProfile","duplex","duplicate","durability","duration","dvb","dvh","dvi","dvmax","dvmin","dvname","dvnum","dvw","dx","dy","dynamicId","dynsrc","e","edgeMode","editContext","effect","effectAllowed","effectiveDirective","effectiveType","effects","elapsedTime","element","elementFromPoint","elementTiming","elements","elementsFromPoint","elevation","ellipse","em","emHeightAscent","emHeightDescent","email","embeds","emit","emma","empty","empty-cells","emptyCells","emptyHTML","emptyScript","emulatedPosition","enable","enableBackground","enableDelegations","enableStyleSheetsForSet","enableVertexAttribArray","enabled","enabledFeatures","enabledPlugin","encode","encodeInto","encodeQueueSize","encodeURI","encodeURIComponent","encodedBodySize","encoding","encodingInfo","encrypt","enctype","end","endContainer","endElement","endElementAt","endOcclusionQuery","endOfPassWriteIndex","endOfStream","endOffset","endQuery","endTime","endTransformFeedback","ended","endpoint","endpointNumber","endpoints","endsWith","enqueue","enterKeyHint","entities","entries","entry","entryPoint","entryType","enumerable","enumerate","enumerateDevices","enumerateEditable","environmentBlendMode","equals","error","errorCode","errorDetail","errorText","escape","estimate","eval","evaluate","event","eventCounts","eventPhase","events","every","ex","exception","exchange","exec","execCommand","execCommandShowHelp","execScript","executeBundles","executionStart","exitFullscreen","exitPictureInPicture","exitPointerLock","exitPresent","exp","expand","expandEntityReferences","expando","expansion","expectedImprovement","experiments","expiration","expirationTime","expires","expiryDate","explicitOriginalTarget","expm1","exponent","exponentialRampToValueAtTime","exportKey","exports","extend","extension","extensionTypes","extensions","extentNode","extentOffset","external","externalResourcesRequired","externalTexture","extractContents","extractable","eye","f","f16round","face","factoryReset","failOp","failureReason","fallback","family","familyName","farthestViewportElement","fastSeek","fatal","featureId","featurePolicy","featureSettings","features","fence","fenceSync","fetch","fetchPriority","fetchStart","fftSize","fgColor","fieldOfView","file","fileCreatedDate","fileHandle","fileModifiedDate","fileName","fileSize","fileUpdatedDate","filename","files","filesystem","fill","fill-opacity","fill-rule","fillJointRadii","fillLightMode","fillOpacity","fillPoses","fillRect","fillRule","fillStyle","fillText","filter","filterResX","filterResY","filterUnits","filters","finally","find","findIndex","findLast","findLastIndex","findRule","findText","finish","finishDocumentLoadTime","finishLoadTime","finished","fireEvent","firesTouchEvents","firstChild","firstElementChild","firstInterimResponseStart","firstPage","firstPaintAfterLoadTime","firstPaintTime","firstUIEventTimestamp","fixed","flags","flat","flatMap","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","flipX","flipY","float","float32","float64","flood-color","flood-opacity","floodColor","floodOpacity","floor","flush","focus","focusNode","focusOffset","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","fontBoundingBoxAscent","fontBoundingBoxDescent","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontOpticalSizing","fontPalette","fontSize","fontSizeAdjust","fontSmoothingEnabled","fontStretch","fontStyle","fontSynthesis","fontSynthesisPosition","fontSynthesisSmallCaps","fontSynthesisStyle","fontSynthesisWeight","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","fontcolor","fontfaces","fonts","fontsize","for","forEach","force","forceFallbackAdapter","forceRedraw","forced-color-adjust","forcedColorAdjust","forcedStyleAndLayoutDuration","forget","form","formAction","formData","formEnctype","formMethod","formNoValidate","formTarget","format","formatToParts","forms","forward","forwardX","forwardY","forwardZ","foundation","fr","fragment","fragmentDirective","frame","frameBorder","frameCount","frameElement","frameId","frameIds","frameSpacing","framebuffer","framebufferHeight","framebufferRenderbuffer","framebufferTexture2D","framebufferTextureLayer","framebufferWidth","frames","freeSpace","freeze","frequency","frequencyBinCount","from","fromAsync","fromBase64","fromCharCode","fromCodePoint","fromElement","fromEntries","fromFloat32Array","fromFloat64Array","fromHex","fromMatrix","fromPoint","fromQuad","fromRect","frontFace","fround","fullName","fullPath","fullRange","fullScreen","fullVersionList","fullscreen","fullscreenElement","fullscreenEnabled","fx","fy","g","gain","gamepad","gamma","gap","gatheringState","gatt","geckoProfiler","genderIdentity","generateCertificate","generateKey","generateMipmap","generateRequest","geolocation","gestureObject","get","getAcceptLanguages","getActiveAttrib","getActiveUniform","getActiveUniformBlockName","getActiveUniformBlockParameter","getActiveUniforms","getAdjacentText","getAll","getAllKeys","getAllResponseHeaders","getAllowlistForFeature","getAnimations","getAsFile","getAsFileSystemHandle","getAsString","getAttachedShaders","getAttribLocation","getAttribute","getAttributeNS","getAttributeNames","getAttributeNode","getAttributeNodeNS","getAttributeType","getAudioTracks","getAuthenticatorData","getAutoplayPolicy","getAvailability","getBBox","getBackgroundPage","getBadgeBackgroundColor","getBadgeText","getBadgeTextColor","getBattery","getBigInt64","getBigUint64","getBindGroupLayout","getBlob","getBookmark","getBoundingClientRect","getBounds","getBoxQuads","getBrowserInfo","getBufferParameter","getBufferSubData","getByteFrequencyData","getByteTimeDomainData","getCSSCanvasContext","getCTM","getCameraImage","getCandidateWindowClientRect","getCanonicalLocales","getCapabilities","getCaptureHandle","getChannelData","getCharNumAtPosition","getCharacteristic","getCharacteristics","getClientExtensionResults","getClientRect","getClientRects","getCoalescedEvents","getCompilationInfo","getCompositionAlternatives","getComputedStyle","getComputedTextLength","getComputedTiming","getConfiguration","getConstraints","getContext","getContextAttributes","getContexts","getContributingSources","getCounterValue","getCueAsHTML","getCueById","getCurrent","getCurrentPosition","getCurrentTexture","getCurrentTime","getData","getDatabaseNames","getDate","getDay","getDefaultComputedStyle","getDepthInMeters","getDepthInformation","getDescriptor","getDescriptors","getDestinationInsertionPoints","getDevices","getDirectory","getDirectoryHandle","getDisplayMedia","getDistributedNodes","getEditable","getElementById","getElementsByClassName","getElementsByName","getElementsByTagName","getElementsByTagNameNS","getEnclosureList","getEndPositionOfChar","getEntries","getEntriesByName","getEntriesByType","getError","getExtension","getExtentOfChar","getEyeParameters","getFeature","getFiberRoots","getFile","getFileHandle","getFiles","getFilesAndDirectories","getFingerprints","getFloat16","getFloat32","getFloat64","getFloatFrequencyData","getFloatTimeDomainData","getFloatValue","getFragDataLocation","getFrameData","getFrameId","getFramebufferAttachmentParameter","getFrequencyResponse","getFullYear","getGamepads","getHTML","getHeaderExtensionsToNegotiate","getHighEntropyValues","getHitTestResults","getHitTestResultsForTransientInput","getHours","getIdentityAssertion","getIds","getImageData","getIndexedParameter","getInfo","getInnerHTML","getInstalledRelatedApps","getInt16","getInt32","getInt8","getInterestGroupAdAuctionData","getInternalModuleRanges","getInternalformatParameter","getIntersectionList","getItem","getItems","getJointPose","getKey","getKeyframes","getLastFocused","getLayers","getLayoutMap","getLightEstimate","getLineDash","getLocalCandidates","getLocalParameters","getLocalStreams","getManagedConfiguration","getManifest","getMappedRange","getMarks","getMatchedCSSRules","getMaxGCPauseSinceClear","getMeasures","getMessage","getMetadata","getMilliseconds","getMinutes","getModifierState","getMonth","getName","getNamedItem","getNamedItemNS","getNativeFramebufferScaleFactor","getNegotiatedHeaderExtensions","getNestedConfigs","getNotifications","getNotifier","getNumberOfChars","getOffsetReferenceSpace","getOutputTimestamp","getOverrideHistoryNavigationMode","getOverrideStyle","getOwnPropertyDescriptor","getOwnPropertyDescriptors","getOwnPropertyNames","getOwnPropertySymbols","getPackageDirectoryEntry","getParameter","getParameters","getParent","getPathSegAtLength","getPermissionWarningsByManifest","getPhotoCapabilities","getPhotoSettings","getPlatformInfo","getPointAtLength","getPopup","getPorts","getPose","getPredictedEvents","getPreference","getPreferenceDefault","getPreferredCanvasFormat","getPresentationAttribute","getPreventDefault","getPrimaryService","getPrimaryServices","getProgramInfoLog","getProgramParameter","getPropertyCSSValue","getPropertyPriority","getPropertyShorthand","getPropertyType","getPropertyValue","getPrototypeOf","getPublicKey","getPublicKeyAlgorithm","getQuery","getQueryParameter","getRGBColorValue","getRandomValues","getRangeAt","getReader","getReceivers","getRectValue","getReflectionCubeMap","getRegistration","getRegistrations","getRemoteCandidates","getRemoteCertificates","getRemoteParameters","getRemoteStreams","getRenderbufferParameter","getResponseHeader","getRoot","getRootNode","getRotationOfChar","getSVGDocument","getSamplerParameter","getScreenCTM","getScreenDetails","getSeconds","getSelectedCandidatePair","getSelection","getSelf","getSenders","getService","getSetCookie","getSettings","getShaderInfoLog","getShaderParameter","getShaderPrecisionFormat","getShaderSource","getSignals","getSimpleDuration","getSiteIcons","getSources","getSpeculativeParserUrls","getStartPositionOfChar","getStartTime","getState","getStats","getStatusForPolicy","getStorageUpdates","getStreamById","getStringValue","getSubStringLength","getSubscription","getSubscriptions","getSupportedConstraints","getSupportedExtensions","getSupportedFormats","getSyncParameter","getSynchronizationSources","getTags","getTargetRanges","getTexParameter","getTextFormats","getTime","getTimezoneOffset","getTiming","getTitle","getTitlebarAreaRect","getTotalLength","getTrackById","getTracks","getTransceivers","getTransform","getTransformFeedbackVarying","getTransformToElement","getTransports","getType","getTypeMapping","getUILanguage","getURL","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getUint16","getUint32","getUint8","getUniform","getUniformBlockIndex","getUniformIndices","getUniformLocation","getUserInfo","getUserMedia","getUserSettings","getVRDisplays","getValues","getVarDate","getVariableValue","getVertexAttrib","getVertexAttribOffset","getVideoPlaybackQuality","getVideoTracks","getViewerPose","getViewport","getViews","getVoices","getWakeLockState","getWriter","getYear","getZoom","getZoomSettings","givenName","global","globalAlpha","globalCompositeOperation","globalPrivacyControl","globalThis","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","go","goBack","goForward","gpu","grabFrame","grad","gradientTransform","gradientUnits","grammars","green","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","gripSpace","group","groupBy","groupCollapsed","groupEnd","groupId","groups","grow","growable","guestProcessId","guestRenderFrameRoutingId","hadRecentInput","hand","handedness","hangingBaseline","hapticActuators","hardwareConcurrency","has","hasAttribute","hasAttributeNS","hasAttributes","hasBeenActive","hasChildNodes","hasComposition","hasDynamicOffset","hasEnrolledInstrument","hasExtension","hasExternalDisplay","hasFeature","hasFocus","hasIndices","hasInstance","hasLayout","hasOrientation","hasOwn","hasOwnProperty","hasPointerCapture","hasPosition","hasPrivateToken","hasReading","hasRedemptionRecord","hasRegExpGroups","hasStorageAccess","hasUAVisualTransition","hasUnpartitionedCookieAccess","hash","hashChange","head","headers","heading","height","hid","hidden","hide","hideFocus","hidePopover","high","highWaterMark","highlight","highlights","hint","hints","history","honorificPrefix","honorificSuffix","horizontalOverflow","host","hostCandidate","hostname","href","hrefTranslate","hreflang","hspace","html5TagCheckInerface","htmlFor","htmlText","httpEquiv","httpRequestStatusCode","hwTimestamp","hyphenate-character","hyphenateCharacter","hyphens","hypot","i18n","ic","iccId","iceConnectionState","iceGatheringState","iceTransport","icon","iconURL","id","identifier","identity","ideographicBaseline","idle","idpLoginUrl","ignoreBOM","ignoreCase","ignoreDepthValues","image","image-orientation","image-rendering","imageHeight","imageOrientation","imageRendering","imageSizes","imageSmoothingEnabled","imageSmoothingQuality","imageSrcset","imageWidth","images","ime-mode","imeMode","implementation","importExternalTexture","importKey","importNode","importStylesheet","imports","impp","imul","in","in1","in2","inBandMetadataTrackDispatchType","inIncognitoContext","inRange","includes","incognito","incomingBidirectionalStreams","incomingHighWaterMark","incomingMaxAge","incomingUnidirectionalStreams","incremental","indeterminate","index","indexNames","indexOf","indexedDB","indicate","indices","inert","inertiaDestinationX","inertiaDestinationY","info","inherits","init","initAnimationEvent","initBeforeLoadEvent","initClipboardEvent","initCloseEvent","initCommandEvent","initCompositionEvent","initCustomEvent","initData","initDataType","initDeviceMotionEvent","initDeviceOrientationEvent","initDragEvent","initErrorEvent","initEvent","initFocusEvent","initGestureEvent","initHashChangeEvent","initKeyEvent","initKeyboardEvent","initMSManipulationEvent","initMessageEvent","initMouseEvent","initMouseScrollEvent","initMouseWheelEvent","initMutationEvent","initNSMouseEvent","initOverflowEvent","initPageEvent","initPageTransitionEvent","initPointerEvent","initPopStateEvent","initProgressEvent","initScrollAreaEvent","initSimpleGestureEvent","initStorageEvent","initTextEvent","initTimeEvent","initTouchEvent","initTransitionEvent","initUIEvent","initWebKitAnimationEvent","initWebKitTransitionEvent","initWebKitWheelEvent","initWheelEvent","initialTime","initialValue","initialize","initiatorType","inject","ink","inline-size","inlineSize","inlineVerticalFieldOfView","inner","innerHTML","innerHeight","innerText","innerWidth","input","inputBuffer","inputEncoding","inputMethod","inputMode","inputSource","inputSources","inputType","inputs","insertAdjacentElement","insertAdjacentHTML","insertAdjacentText","insertBefore","insertCell","insertDTMF","insertData","insertDebugMarker","insertItemBefore","insertNode","insertRow","insertRule","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","install","installing","instanceRoot","instantiate","instantiateStreaming","instruments","int16","int32","int8","integrity","interactionId","interactionMode","intercept","interfaceClass","interfaceName","interfaceNumber","interfaceProtocol","interfaceSubclass","interfaces","interimResults","internalSubset","interpretation","intersection","intersectionRatio","intersectionRect","intersectsNode","interval","invalidIteratorState","invalidateFramebuffer","invalidateSubFramebuffer","inverse","invertSelf","invoker","invokerType","is","is2D","isActive","isAllowedFileSchemeAccess","isAllowedIncognitoAccess","isAlternate","isArray","isAutoSelected","isBingCurrentSearchDefault","isBuffer","isCandidateWindowVisible","isChar","isCollapsed","isComposing","isConcatSpreadable","isConditionalMediationAvailable","isConfigSupported","isConnected","isContentEditable","isContentHandlerRegistered","isContextLost","isDefaultNamespace","isDirectory","isDisabled","isDisjointFrom","isEnabled","isEqual","isEqualNode","isExtended","isExtensible","isExternalCTAP2SecurityKeySupported","isFallbackAdapter","isFile","isFinite","isFirstPersonObserver","isFramebuffer","isFrozen","isGenerator","isHTML","isHistoryNavigation","isId","isIdentity","isInjected","isInputPending","isInteger","isInternal","isIntersecting","isLockFree","isMap","isMultiLine","isNaN","isOpen","isPointInFill","isPointInPath","isPointInRange","isPointInStroke","isPrefAlternate","isPresenting","isPrimary","isProgram","isPropertyImplicit","isProtocolHandlerRegistered","isPrototypeOf","isQuery","isRawJSON","isRenderbuffer","isSafeInteger","isSameEntry","isSameNode","isSampler","isScript","isScriptURL","isSealed","isSecureContext","isSessionSupported","isShader","isSubsetOf","isSupersetOf","isSupported","isSync","isTextEdit","isTexture","isTransformFeedback","isTrusted","isTypeSupported","isUserVerifyingPlatformAuthenticatorAvailable","isVertexArray","isView","isVisible","isWellFormed","isochronousTransferIn","isochronousTransferOut","isolation","italics","item","itemId","itemProp","itemRef","itemScope","itemType","itemValue","items","iterateNext","iterationComposite","iterator","javaEnabled","jitterBufferTarget","jobTitle","join","joinAdInterestGroup","jointName","json","justify-content","justify-items","justify-self","justifyContent","justifyItems","justifySelf","k1","k2","k3","k4","kHz","keepalive","kernelMatrix","kernelUnitLengthX","kernelUnitLengthY","kerning","key","keyCode","keyFor","keyIdentifier","keyLightEnabled","keyLocation","keyPath","keyStatuses","keySystem","keyText","keyUsage","keyboard","keys","keytype","kind","knee","knownSources","label","labels","lang","language","languages","largeArcFlag","lastChild","lastElementChild","lastError","lastEventId","lastIndex","lastIndexOf","lastInputTime","lastMatch","lastMessageSubject","lastMessageType","lastModified","lastModifiedDate","lastPage","lastParen","lastState","lastStyleSheetSet","latency","latitude","launchQueue","layerName","layerX","layerY","layout","layoutFlow","layoutGrid","layoutGridChar","layoutGridLine","layoutGridMode","layoutGridType","lbound","leaveAdInterestGroup","left","leftContext","leftDegrees","leftMargin","leftProjectionMatrix","leftViewMatrix","length","lengthAdjust","lengthComputable","letter-spacing","letterSpacing","level","lh","lighting-color","lightingColor","limitingConeAngle","limits","line","line-break","line-height","lineAlign","lineBreak","lineCap","lineDashOffset","lineGapOverride","lineHeight","lineJoin","lineNum","lineNumber","linePos","lineTo","lineWidth","linearAcceleration","linearRampToValueAtTime","linearVelocity","lineno","lines","link","linkColor","linkProgram","links","list","list-style","list-style-image","list-style-position","list-style-type","listStyle","listStyleImage","listStylePosition","listStyleType","listener","listeners","load","loadEventEnd","loadEventStart","loadOp","loadTime","loadTimes","loaded","loading","localDescription","localName","localService","localStorage","locale","localeCompare","location","locationbar","lock","locked","lockedFile","locks","lodMaxClamp","lodMinClamp","log","log10","log1p","log2","logicalXDPI","logicalYDPI","login","loglevel","longDesc","longitude","lookupNamespaceURI","lookupPrefix","loop","loopEnd","loopStart","looping","lost","low","lower","lowerBound","lowerOpen","lowsrc","lvb","lvh","lvi","lvmax","lvmin","lvw","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","magFilter","makeXRCompatible","managed","management","manifest","manufacturer","manufacturerName","map","mapAsync","mapState","mappedAtCreation","mapping","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginHeight","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marginWidth","mark","marker","marker-end","marker-mid","marker-offset","marker-start","markerEnd","markerHeight","markerMid","markerOffset","markerStart","markerUnits","markerWidth","marks","mask","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-position-x","mask-position-y","mask-repeat","mask-size","mask-type","maskClip","maskComposite","maskContentUnits","maskImage","maskMode","maskOrigin","maskPosition","maskPositionX","maskPositionY","maskRepeat","maskSize","maskType","maskUnits","match","matchAll","matchMedia","matchMedium","matchPatterns","matches","math-depth","math-style","mathDepth","mathStyle","matrix","matrixTransform","max","max-block-size","max-height","max-inline-size","max-width","maxActions","maxAlternatives","maxAnisotropy","maxBindGroups","maxBindGroupsPlusVertexBuffers","maxBindingsPerBindGroup","maxBlockSize","maxBufferSize","maxByteLength","maxChannelCount","maxChannels","maxColorAttachmentBytesPerSample","maxColorAttachments","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupStorageSize","maxComputeWorkgroupsPerDimension","maxConnectionsPerServer","maxDatagramSize","maxDecibels","maxDistance","maxDrawCount","maxDynamicStorageBuffersPerPipelineLayout","maxDynamicUniformBuffersPerPipelineLayout","maxHeight","maxInlineSize","maxInterStageShaderComponents","maxInterStageShaderVariables","maxLayers","maxLength","maxMessageSize","maxPacketLifeTime","maxRetransmits","maxSampledTexturesPerShaderStage","maxSamplersPerShaderStage","maxStorageBufferBindingSize","maxStorageBuffersPerShaderStage","maxStorageTexturesPerShaderStage","maxTextureArrayLayers","maxTextureDimension1D","maxTextureDimension2D","maxTextureDimension3D","maxTouchPoints","maxUniformBufferBindingSize","maxUniformBuffersPerShaderStage","maxValue","maxVertexAttributes","maxVertexBufferArrayStride","maxVertexBuffers","maxWidth","maximumLatency","measure","measureText","media","mediaCapabilities","mediaDevices","mediaElement","mediaGroup","mediaKeys","mediaSession","mediaStream","mediaText","meetOrSlice","memory","menubar","menus","menusChild","menusInternal","mergeAttributes","message","messageClass","messageHandlers","messageType","messages","metaKey","metadata","method","methodDetails","methodName","mid","mimeType","mimeTypes","min","min-block-size","min-height","min-inline-size","min-width","minBindingSize","minBlockSize","minDecibels","minFilter","minHeight","minInlineSize","minLength","minStorageBufferOffsetAlignment","minUniformBufferOffsetAlignment","minValue","minWidth","minimumLatency","mipLevel","mipLevelCount","mipmapFilter","miterLimit","mix-blend-mode","mixBlendMode","mm","mobile","mode","model","modify","module","mount","move","moveBy","moveEnd","moveFirst","moveFocusDown","moveFocusLeft","moveFocusRight","moveFocusUp","moveInSuccession","moveNext","moveRow","moveStart","moveTo","moveToBookmark","moveToElementText","moveToPoint","movementX","movementY","mozAdd","mozAnimationStartTime","mozAnon","mozApps","mozAudioCaptured","mozAudioChannelType","mozAutoplayEnabled","mozCancelAnimationFrame","mozCancelFullScreen","mozCancelRequestAnimationFrame","mozCaptureStream","mozCaptureStreamUntilEnded","mozClearDataAt","mozContact","mozContacts","mozCreateFileHandle","mozCurrentTransform","mozCurrentTransformInverse","mozCursor","mozDash","mozDashOffset","mozDecodedFrames","mozExitPointerLock","mozFillRule","mozFragmentEnd","mozFrameDelay","mozFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozGetAll","mozGetAllKeys","mozGetAsFile","mozGetDataAt","mozGetMetadata","mozGetUserMedia","mozHasAudio","mozHasItem","mozHidden","mozImageSmoothingEnabled","mozIndexedDB","mozInnerScreenX","mozInnerScreenY","mozInputSource","mozIsTextField","mozItem","mozItemCount","mozItems","mozLength","mozLockOrientation","mozMatchesSelector","mozMovementX","mozMovementY","mozOpaque","mozOrientation","mozPaintCount","mozPaintedFrames","mozParsedFrames","mozPay","mozPointerLockElement","mozPresentedFrames","mozPreservesPitch","mozPressure","mozPrintCallback","mozRTCIceCandidate","mozRTCPeerConnection","mozRTCSessionDescription","mozRemove","mozRequestAnimationFrame","mozRequestFullScreen","mozRequestPointerLock","mozSetDataAt","mozSetImageElement","mozSourceNode","mozSrcObject","mozSystem","mozTCPSocket","mozTextStyle","mozTypesAt","mozUnlockOrientation","mozUserCancelled","mozVisibilityState","ms","msAnimation","msAnimationDelay","msAnimationDirection","msAnimationDuration","msAnimationFillMode","msAnimationIterationCount","msAnimationName","msAnimationPlayState","msAnimationStartTime","msAnimationTimingFunction","msBackfaceVisibility","msBlockProgression","msCSSOMElementFloatMetrics","msCaching","msCachingEnabled","msCancelRequestAnimationFrame","msCapsLockWarningOff","msClearImmediate","msClose","msContentZoomChaining","msContentZoomFactor","msContentZoomLimit","msContentZoomLimitMax","msContentZoomLimitMin","msContentZoomSnap","msContentZoomSnapPoints","msContentZoomSnapType","msContentZooming","msConvertURL","msCrypto","msDoNotTrack","msElementsFromPoint","msElementsFromRect","msExitFullscreen","msExtendedCode","msFillRule","msFirstPaint","msFlex","msFlexAlign","msFlexDirection","msFlexFlow","msFlexItemAlign","msFlexLinePack","msFlexNegative","msFlexOrder","msFlexPack","msFlexPositive","msFlexPreferredSize","msFlexWrap","msFlowFrom","msFlowInto","msFontFeatureSettings","msFullscreenElement","msFullscreenEnabled","msGetInputContext","msGetRegionContent","msGetUntransformedBounds","msGraphicsTrustStatus","msGridColumn","msGridColumnAlign","msGridColumnSpan","msGridColumns","msGridRow","msGridRowAlign","msGridRowSpan","msGridRows","msHidden","msHighContrastAdjust","msHyphenateLimitChars","msHyphenateLimitLines","msHyphenateLimitZone","msHyphens","msImageSmoothingEnabled","msImeAlign","msIndexedDB","msInterpolationMode","msIsStaticHTML","msKeySystem","msKeys","msLaunchUri","msLockOrientation","msManipulationViewsEnabled","msMatchMedia","msMatchesSelector","msMaxTouchPoints","msOrientation","msOverflowStyle","msPerspective","msPerspectiveOrigin","msPlayToDisabled","msPlayToPreferredSourceUri","msPlayToPrimary","msPointerEnabled","msRegionOverflow","msReleasePointerCapture","msRequestAnimationFrame","msRequestFullscreen","msSaveBlob","msSaveOrOpenBlob","msScrollChaining","msScrollLimit","msScrollLimitXMax","msScrollLimitXMin","msScrollLimitYMax","msScrollLimitYMin","msScrollRails","msScrollSnapPointsX","msScrollSnapPointsY","msScrollSnapType","msScrollSnapX","msScrollSnapY","msScrollTranslation","msSetImmediate","msSetMediaKeys","msSetPointerCapture","msTextCombineHorizontal","msTextSizeAdjust","msToBlob","msTouchAction","msTouchSelect","msTraceAsyncCallbackCompleted","msTraceAsyncCallbackStarting","msTraceAsyncOperationCompleted","msTraceAsyncOperationStarting","msTransform","msTransformOrigin","msTransformStyle","msTransition","msTransitionDelay","msTransitionDuration","msTransitionProperty","msTransitionTimingFunction","msUnlockOrientation","msUpdateAsyncCallbackRelation","msUserSelect","msVisibilityState","msWrapFlow","msWrapMargin","msWrapThrough","msWriteProfilerMark","msZoom","msZoomTo","mt","mul","multiEntry","multiSelectionObj","multiline","multiple","multiply","multiplySelf","multisample","multisampled","mutableFile","muted","n","nacl_arch","name","nameList","nameProp","namedItem","namedRecordset","names","namespaceURI","namespaces","nativeApplication","nativeMap","nativeObjectCreate","nativeSet","nativeWeakMap","naturalHeight","naturalWidth","navigate","navigation","navigationMode","navigationPreload","navigationStart","navigationType","navigator","near","nearestViewportElement","negative","negotiated","netscape","networkState","networkStatus","newScale","newState","newTranslate","newURL","newValue","newValueSpecifiedUnits","newVersion","newhome","next","nextElementSibling","nextHopProtocol","nextNode","nextPage","nextSibling","nickname","noHref","noModule","noResize","noShade","noValidate","noWrap","node","nodeName","nodeType","nodeValue","nonce","normDepthBufferFromNormView","normalize","normalizedPathSegList","normandyAddonStudy","notRestoredReasons","notationName","notations","note","noteGrainOn","noteOff","noteOn","notifications","notify","now","npnNegotiatedProtocol","numOctaves","number","numberOfChannels","numberOfFrames","numberOfInputs","numberOfItems","numberOfOutputs","numberValue","oMatchesSelector","object","object-fit","object-position","objectFit","objectPosition","objectStore","objectStoreNames","objectType","observe","occlusionQuerySet","of","off","offscreenBuffering","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","offsetAnchor","offsetDistance","offsetHeight","offsetLeft","offsetNode","offsetParent","offsetPath","offsetPosition","offsetRotate","offsetTop","offsetWidth","offsetX","offsetY","ok","oldState","oldURL","oldValue","oldVersion","olderShadowRoot","omnibox","on","onActivated","onAdded","onAttached","onBoundsChanged","onBrowserUpdateAvailable","onClicked","onCommitFiberRoot","onCommitFiberUnmount","onConnect","onConnectExternal","onConnectNative","onCreated","onDetached","onDisabled","onEnabled","onFocusChanged","onHighlighted","onInstalled","onLine","onMessage","onMessageExternal","onMoved","onPerformanceWarning","onPostCommitFiberRoot","onRemoved","onReplaced","onRestartRequired","onStartup","onSubmittedWorkDone","onSuspend","onSuspendCanceled","onUninstalled","onUpdateAvailable","onUpdated","onUserScriptConnect","onUserScriptMessage","onUserSettingsChanged","onZoomChange","onabort","onabsolutedeviceorientation","onactivate","onactive","onaddsourcebuffer","onaddstream","onaddtrack","onafterprint","onafterscriptexecute","onafterupdate","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onappinstalled","onaudioend","onaudioprocess","onaudiostart","onautocomplete","onautocompleteerror","onauxclick","onbeforeactivate","onbeforecopy","onbeforecut","onbeforedeactivate","onbeforeeditfocus","onbeforeinput","onbeforeinstallprompt","onbeforematch","onbeforepaste","onbeforeprint","onbeforescriptexecute","onbeforetoggle","onbeforeunload","onbeforeupdate","onbeforexrselect","onbegin","onblocked","onblur","onbounce","onboundary","onbufferedamountlow","oncached","oncancel","oncandidatewindowhide","oncandidatewindowshow","oncandidatewindowupdate","oncanplay","oncanplaythrough","oncapturehandlechange","once","oncellchange","onchange","oncharacterboundsupdate","oncharacteristicvaluechanged","onchargingchange","onchargingtimechange","onchecking","onclick","onclose","onclosing","oncompassneedscalibration","oncomplete","oncompositionend","oncompositionstart","onconnect","onconnecting","onconnectionavailable","onconnectionstatechange","oncontentvisibilityautostatechange","oncontextlost","oncontextmenu","oncontextrestored","oncontrollerchange","oncontrolselect","oncopy","oncuechange","oncurrententrychange","oncurrentscreenchange","oncut","ondataavailable","ondatachannel","ondatasetchanged","ondatasetcomplete","ondblclick","ondeactivate","ondequeue","ondevicechange","ondevicelight","ondevicemotion","ondeviceorientation","ondeviceorientationabsolute","ondeviceproximity","ondischargingtimechange","ondisconnect","ondisplay","ondispose","ondownloading","ondrag","ondragend","ondragenter","ondragexit","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onencrypted","onend","onended","onenter","onenterpictureinpicture","onerror","onerrorupdate","onexit","onfencedtreeclick","onfilterchange","onfinish","onfocus","onfocusin","onfocusout","onformdata","onfreeze","onfullscreenchange","onfullscreenerror","ongamepadconnected","ongamepaddisconnected","ongatheringstatechange","ongattserverdisconnected","ongeometrychange","ongesturechange","ongestureend","ongesturestart","ongotpointercapture","onhashchange","onhelp","onicecandidate","onicecandidateerror","oniceconnectionstatechange","onicegatheringstatechange","oninactive","oninput","oninputreport","oninputsourceschange","oninvalid","onkeydown","onkeypress","onkeystatuseschange","onkeyup","onlanguagechange","onlayoutcomplete","onleavepictureinpicture","onlevelchange","onload","onloadT","onloadeddata","onloadedmetadata","onloadend","onloading","onloadingdone","onloadingerror","onloadstart","onlosecapture","onlostpointercapture","only","onmanagedconfigurationchange","onmark","onmessage","onmessageerror","onmidimessage","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onmove","onmoveend","onmovestart","onmozfullscreenchange","onmozfullscreenerror","onmozorientationchange","onmozpointerlockchange","onmozpointerlockerror","onmscontentzoom","onmsfullscreenchange","onmsfullscreenerror","onmsgesturechange","onmsgesturedoubletap","onmsgestureend","onmsgesturehold","onmsgesturestart","onmsgesturetap","onmsgotpointercapture","onmsinertiastart","onmslostpointercapture","onmsmanipulationstatechanged","onmsneedkey","onmsorientationchange","onmspointercancel","onmspointerdown","onmspointerenter","onmspointerhover","onmspointerleave","onmspointermove","onmspointerout","onmspointerover","onmspointerup","onmssitemodejumplistitemremoved","onmsthumbnailclick","onmute","onnavigate","onnavigateerror","onnavigatesuccess","onnegotiationneeded","onnomatch","onnoupdate","onobsolete","onoffline","ononline","onopen","onorientationchange","onpagechange","onpagehide","onpagereveal","onpageshow","onpageswap","onpaste","onpause","onpayerdetailchange","onpaymentmethodchange","onplay","onplaying","onpluginstreamstart","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointerlockchange","onpointerlockerror","onpointermove","onpointerout","onpointerover","onpointerrawupdate","onpointerup","onpopstate","onprerenderingchange","onprioritychange","onprocessorerror","onprogress","onpropertychange","onratechange","onreading","onreadystatechange","onreflectionchange","onrejectionhandled","onrelease","onremove","onremovesourcebuffer","onremovestream","onremovetrack","onrepeat","onreset","onresize","onresizeend","onresizestart","onresourcetimingbufferfull","onresult","onresume","onrowenter","onrowexit","onrowsdelete","onrowsinserted","onscreenschange","onscroll","onscrollend","onscrollsnapchange","onscrollsnapchanging","onsearch","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectedcandidatepairchange","onselectend","onselectionchange","onselectstart","onshippingaddresschange","onshippingoptionchange","onshow","onsignalingstatechange","onsinkchange","onslotchange","onsoundend","onsoundstart","onsourceclose","onsourceclosed","onsourceended","onsourceopen","onspeechend","onspeechstart","onsqueeze","onsqueezeend","onsqueezestart","onstalled","onstart","onstatechange","onstop","onstorage","onstoragecommit","onsubmit","onsuccess","onsuspend","onterminate","ontextformatupdate","ontextinput","ontextupdate","ontimeout","ontimeupdate","ontoggle","ontonechange","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontrack","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onuncapturederror","onunhandledrejection","onunload","onunmute","onupdate","onupdateend","onupdatefound","onupdateready","onupdatestart","onupgradeneeded","onuserproximity","onversionchange","onvisibilitychange","onvoiceschanged","onvolumechange","onvrdisplayactivate","onvrdisplayconnect","onvrdisplaydeactivate","onvrdisplaydisconnect","onvrdisplaypresentchange","onwaiting","onwaitingforkey","onwarning","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkitcurrentplaybacktargetiswirelesschanged","onwebkitfullscreenchange","onwebkitfullscreenerror","onwebkitkeyadded","onwebkitkeyerror","onwebkitkeymessage","onwebkitneedkey","onwebkitorientationchange","onwebkitplaybacktargetavailabilitychanged","onwebkitpointerlockchange","onwebkitpointerlockerror","onwebkitresourcetimingbufferfull","onwebkittransitionend","onwheel","onzoom","opacity","open","openCursor","openDatabase","openKeyCursor","openOptionsPage","openOrClosedShadowRoot","openPopup","opened","opener","opera","operation","operationType","operator","opr","optimum","options","or","order","orderX","orderY","ordered","org","organization","orient","orientAngle","orientType","orientation","orientationX","orientationY","orientationZ","origin","originAgentCluster","originalPolicy","originalTarget","orphans","os","oscpu","outerHTML","outerHeight","outerText","outerWidth","outgoingHighWaterMark","outgoingMaxAge","outline","outline-color","outline-offset","outline-style","outline-width","outlineColor","outlineOffset","outlineStyle","outlineWidth","outputBuffer","outputChannelCount","outputLatency","outputs","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overflowAnchor","overflowBlock","overflowClipMargin","overflowInline","overflowWrap","overflowX","overflowY","overlaysContent","overrideColors","overrideMimeType","oversample","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","ownKeys","ownerDocument","ownerElement","ownerNode","ownerRule","ownerSVGElement","owningElement","p1","p2","p3","p4","packetSize","packets","pad","padEnd","padStart","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","page-break-after","page-break-before","page-break-inside","page-orientation","pageAction","pageBreakAfter","pageBreakBefore","pageBreakInside","pageCount","pageLeft","pageOrientation","pageT","pageTop","pageX","pageXOffset","pageY","pageYOffset","pages","paint-order","paintOrder","paintRequests","paintType","paintWorklet","palette","pan","panningModel","parameterData","parameters","parent","parentElement","parentNode","parentRule","parentStyleSheet","parentTextEdit","parentWindow","parse","parseAll","parseCreationOptionsFromJSON","parseFloat","parseFromString","parseHTMLUnsafe","parseInt","parseRequestOptionsFromJSON","part","participants","passOp","passive","password","pasteHTML","path","pathLength","pathSegList","pathSegType","pathSegTypeAsLetter","pathname","pattern","patternContentUnits","patternMismatch","patternTransform","patternUnits","pause","pauseAnimations","pauseDuration","pauseOnExit","pauseProfilers","pauseTransformFeedback","paused","payerEmail","payerName","payerPhone","paymentManager","pc","pdfViewerEnabled","peerIdentity","pending","pendingLocalDescription","pendingRemoteDescription","percent","performance","periodicSync","permission","permissionState","permissions","persist","persisted","persistentDeviceId","personalbar","perspective","perspective-origin","perspectiveOrigin","phone","phoneticFamilyName","phoneticGivenName","photo","pictureInPictureChild","pictureInPictureElement","pictureInPictureEnabled","pictureInPictureWindow","ping","pipeThrough","pipeTo","pitch","pixelBottom","pixelDepth","pixelHeight","pixelLeft","pixelRight","pixelStorei","pixelTop","pixelUnitToMillimeterX","pixelUnitToMillimeterY","pixelWidth","pkcs11","place-content","place-items","place-self","placeContent","placeItems","placeSelf","placeholder","platform","platformVersion","platforms","play","playEffect","playState","playbackRate","playbackState","playbackTime","played","playoutDelayHint","playsInline","plugins","pluginspage","pname","pointer-events","pointerBeforeReferenceNode","pointerEnabled","pointerEvents","pointerId","pointerLockElement","pointerType","points","pointsAtX","pointsAtY","pointsAtZ","polygonOffset","pop","popDebugGroup","popErrorScope","popover","popoverTargetAction","popoverTargetElement","populateMatrix","popupWindowFeatures","popupWindowName","popupWindowURI","port","port1","port2","ports","posBottom","posHeight","posLeft","posRight","posTop","posWidth","pose","position","position-anchor","position-area","positionAlign","positionAnchor","positionArea","positionX","positionY","positionZ","postError","postMessage","postTask","postalCode","poster","postscriptName","pow","powerEfficient","powerOff","powerPreference","preMultiplySelf","precision","preferredReflectionFormat","preferredStyleSheetSet","preferredStylesheetSet","prefix","preload","premultipliedAlpha","prepend","prerendering","presentation","presentationArea","presentationStyle","preserveAlpha","preserveAspectRatio","preserveAspectRatioString","preservesPitch","pressed","pressure","prevValue","preventDefault","preventExtensions","preventSilentAccess","previousElementSibling","previousNode","previousPage","previousPriority","previousRect","previousScale","previousSibling","previousTranslate","primaries","primaryKey","primaryLightDirection","primaryLightIntensity","primitive","primitiveType","primitiveUnits","principals","print","print-color-adjust","printColorAdjust","printPreview","priority","privacy","privateKey","privateToken","probablySupportsContext","probeSpace","process","processIceMessage","processingEnd","processingStart","processorOptions","product","productId","productName","productSub","profile","profileEnd","profiles","projectionMatrix","promise","prompt","properties","propertyIsEnumerable","propertyName","protectedAudience","protocol","protocolLong","prototype","provider","proxy","pseudoClass","pseudoElement","pt","publicId","publicKey","published","pulse","push","pushDebugGroup","pushErrorScope","pushManager","pushNotification","pushState","put","putImageData","px","quadraticCurveTo","qualifier","quaternion","query","queryCommandEnabled","queryCommandIndeterm","queryCommandState","queryCommandSupported","queryCommandText","queryCommandValue","queryFeatureSupport","queryLocalFonts","queryPermission","querySelector","querySelectorAll","querySet","queue","queueMicrotask","quote","quotes","r","r1","r2","race","rad","radiogroup","radius","radiusX","radiusY","random","randomUUID","range","rangeCount","rangeEnd","rangeMax","rangeMin","rangeOffset","rangeOverflow","rangeParent","rangeStart","rangeUnderflow","rate","ratio","raw","rawId","rawJSON","rawValueToMeters","rcap","rch","read","readAsArrayBuffer","readAsBinaryString","readAsBlob","readAsDataURL","readAsText","readBuffer","readEntries","readOnly","readPixels","readReportRequested","readText","readValue","readable","ready","readyState","reason","reasons","reboot","receiveFeatureReport","receivedAlert","receiver","receivers","recipient","recommendedViewportScale","reconnect","recordNumber","recordsAvailable","recordset","rect","red","redEyeReduction","redirect","redirectCount","redirectEnd","redirectStart","redirected","reduce","reduceRight","reduction","refDistance","refX","refY","referenceNode","referenceSpace","referrer","referrerPolicy","refresh","region","regionAnchorX","regionAnchorY","regionId","regions","register","registerContentHandler","registerElement","registerInternalModuleStart","registerInternalModuleStop","registerProperty","registerProtocolHandler","reject","rel","relList","relatedAddress","relatedNode","relatedPort","relatedTarget","relayProtocol","release","releaseCapture","releaseEvents","releaseInterface","releaseLock","releasePointerCapture","releaseShaderCompiler","released","reliability","reliable","reliableWrite","reload","rem","remainingSpace","remote","remoteDescription","remove","removeAllRanges","removeAttribute","removeAttributeNS","removeAttributeNode","removeBehavior","removeChild","removeCue","removeEntry","removeEventListener","removeFilter","removeImport","removeItem","removeListener","removeNamedItem","removeNamedItemNS","removeNode","removeParameter","removeProperty","removeRange","removeRegion","removeRule","removeSiteSpecificTrackingException","removeSourceBuffer","removeStream","removeTrack","removeVariable","removeWakeLockListener","removeWebWideTrackingException","removed","removedNodes","renderBlockingStatus","renderHeight","renderStart","renderState","renderTime","renderWidth","renderbufferStorage","renderbufferStorageMultisample","renderedBuffer","rendererInterfaces","renderers","renderingMode","renotify","repeat","repetitionCount","replace","replaceAdjacentText","replaceAll","replaceChild","replaceChildren","replaceData","replaceId","replaceItem","replaceNode","replaceState","replaceSync","replaceTrack","replaceWholeText","replaceWith","reportError","reportEvent","reportId","reportValidity","request","requestAdapter","requestAdapterInfo","requestAnimationFrame","requestAutocomplete","requestClose","requestData","requestDevice","requestFrame","requestFullscreen","requestHitTestSource","requestHitTestSourceForTransientInput","requestId","requestIdleCallback","requestLightProbe","requestMIDIAccess","requestMediaKeySystemAccess","requestPermission","requestPictureInPicture","requestPointerLock","requestPort","requestPresent","requestPresenter","requestReferenceSpace","requestSession","requestStart","requestStorageAccess","requestStorageAccessFor","requestSubmit","requestTime","requestUpdateCheck","requestVideoFrameCallback","requestViewportScale","requestWindow","requestingWindow","requireInteraction","required","requiredExtensions","requiredFeatures","requiredLimits","reset","resetLatency","resetPose","resetTransform","resizable","resize","resizeBy","resizeTo","resolve","resolveQuerySet","resolveTarget","resource","respond","respondWithNewView","response","responseBody","responseEnd","responseReady","responseStart","responseStatus","responseText","responseType","responseURL","responseXML","restart","restartAfterDelay","restartIce","restore","result","resultIndex","resultType","results","resume","resumeProfilers","resumeTransformFeedback","retry","returnValue","rev","reverse","reversed","revocable","revokeObjectURL","rex","rgbColor","ric","right","rightContext","rightDegrees","rightMargin","rightProjectionMatrix","rightViewMatrix","rlh","role","rolloffFactor","root","rootBounds","rootElement","rootMargin","rotate","rotateAxisAngle","rotateAxisAngleSelf","rotateFromVector","rotateFromVectorSelf","rotateSelf","rotation","rotationAngle","rotationRate","round","roundRect","row-gap","rowGap","rowIndex","rowSpan","rows","rowsPerImage","rtcpTransport","rtt","ruby-align","ruby-position","rubyAlign","rubyOverhang","rubyPosition","rules","run","runAdAuction","runtime","runtimeStyle","rx","ry","s","safari","sameDocument","sample","sampleCount","sampleCoverage","sampleInterval","sampleRate","sampleType","sampler","samplerParameterf","samplerParameteri","sandbox","save","saveAsPDF","saveData","scale","scale3d","scale3dSelf","scaleNonUniform","scaleNonUniformSelf","scaleSelf","scheduler","scheduling","scheme","scissor","scope","scopeName","scoped","screen","screenBrightness","screenEnabled","screenLeft","screenPixelToMillimeterX","screenPixelToMillimeterY","screenState","screenTop","screenX","screenY","screens","scriptURL","scripting","scripts","scroll","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollAmount","scrollBehavior","scrollBy","scrollByLines","scrollByPages","scrollDelay","scrollHeight","scrollIntoView","scrollIntoViewIfNeeded","scrollLeft","scrollLeftMax","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollMaxX","scrollMaxY","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollRestoration","scrollSnapAlign","scrollSnapStop","scrollSnapType","scrollTo","scrollTop","scrollTopMax","scrollWidth","scrollX","scrollY","scrollbar-color","scrollbar-gutter","scrollbar-width","scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarColor","scrollbarDarkShadowColor","scrollbarFaceColor","scrollbarGutter","scrollbarHighlightColor","scrollbarShadowColor","scrollbarTrackColor","scrollbarWidth","scrollbars","scrolling","scrollingElement","sctp","sctpCauseCode","sdp","sdpLineNumber","sdpMLineIndex","sdpMid","seal","search","searchBox","searchBoxJavaBridge_","searchParams","sectionRowIndex","secureConnectionStart","security","seed","seek","seekToNextFrame","seekable","seeking","select","selectAllChildren","selectAlternateInterface","selectAudioOutput","selectConfiguration","selectNode","selectNodeContents","selectNodes","selectSingleNode","selectSubString","selectURL","selected","selectedIndex","selectedOptions","selectedStyleSheetSet","selectedStylesheetSet","selectedTrack","selection","selectionDirection","selectionEnd","selectionStart","selector","selectorText","self","send","sendAsBinary","sendBeacon","sendFeatureReport","sendMessage","sendNativeMessage","sendOrder","sendReport","sender","sentAlert","sentTimestamp","separator","serial","serialNumber","serializable","serializeToString","serverTiming","service","serviceWorker","session","sessionId","sessionStorage","sessions","set","setActionHandler","setActive","setAlpha","setAppBadge","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","setAttributionReporting","setBadgeBackgroundColor","setBadgeText","setBadgeTextColor","setBaseAndExtent","setBigInt64","setBigUint64","setBindGroup","setBingCurrentSearchDefault","setBlendConstant","setCameraActive","setCapture","setCaptureHandleConfig","setCodecPreferences","setColor","setCompositeOperation","setConfiguration","setConsumer","setCurrentTime","setCustomValidity","setData","setDate","setDragImage","setEnabled","setEnd","setEndAfter","setEndBefore","setEndPoint","setExpires","setFillColor","setFilterRes","setFloat16","setFloat32","setFloat64","setFloatValue","setFocusBehavior","setFormValue","setFromBase64","setFromHex","setFullYear","setHTMLUnsafe","setHeaderExtensionsToNegotiate","setHeaderValue","setHours","setIcon","setIdentityProvider","setImmediate","setIndexBuffer","setInt16","setInt32","setInt8","setInterval","setItem","setKeyframes","setLineCap","setLineDash","setLineJoin","setLineWidth","setLiveSeekableRange","setLocalDescription","setMatrix","setMatrixValue","setMediaKeys","setMicrophoneActive","setMilliseconds","setMinutes","setMiterLimit","setMonth","setNamedItem","setNamedItemNS","setNonUserCodeExceptions","setOrientToAngle","setOrientToAuto","setOrientation","setOverrideHistoryNavigationMode","setPaint","setParameter","setParameters","setPeriodicWave","setPipeline","setPointerCapture","setPopup","setPosition","setPositionState","setPreference","setPriority","setPrivateToken","setProperty","setPrototypeOf","setRGBColor","setRGBColorICCColor","setRadius","setRangeText","setRemoteDescription","setReportEventDataForAutomaticBeacons","setRequestHeader","setResizable","setResourceTimingBufferSize","setRotate","setScale","setScissorRect","setSeconds","setSelectionRange","setServerCertificate","setShadow","setSharedStorageContext","setSignals","setSinkId","setSkewX","setSkewY","setStart","setStartAfter","setStartBefore","setStatus","setStdDeviation","setStencilReference","setStreams","setStrictMode","setStringValue","setStrokeColor","setSuggestResult","setTargetAtTime","setTargetValueAtTime","setTime","setTimeout","setTitle","setTransform","setTranslate","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setUint16","setUint32","setUint8","setUninstallURL","setUpdateUrlData","setUri","setValidity","setValueAtTime","setValueCurveAtTime","setVariable","setVelocity","setVersion","setVertexBuffer","setViewport","setYear","setZoom","setZoomSettings","settingName","settingValue","sex","shaderLocation","shaderSource","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","shadowRoot","shadowRootClonable","shadowRootDelegatesFocus","shadowRootMode","shadowRootSerializable","shape","shape-image-threshold","shape-margin","shape-outside","shape-rendering","shapeImageThreshold","shapeMargin","shapeOutside","shapeRendering","share","sharedStorage","sharedStorageWritable","sheet","shift","shiftKey","shiftLeft","shippingAddress","shippingOption","shippingType","show","showDirectoryPicker","showHelp","showModal","showModalDialog","showModelessDialog","showNotification","showOpenFilePicker","showPicker","showPopover","showSaveFilePicker","sidebar","sidebarAction","sign","signal","signalingState","signature","silent","sin","singleNodeValue","sinh","sinkId","sittingToStandingTransform","size","sizeAdjust","sizeToContent","sizeX","sizeZ","sizes","skewX","skewXSelf","skewY","skewYSelf","skipTransition","skipped","slice","slope","slot","slotAssignment","small","smil","smooth","smoothingTimeConstant","snapTargetBlock","snapTargetInline","snapToLines","snapshotItem","snapshotLength","some","sort","sortingCode","source","sourceBuffer","sourceBuffers","sourceCapabilities","sourceCharPosition","sourceFile","sourceFunctionName","sourceIndex","sourceMap","sourceURL","sources","spacing","span","speak","speakAs","speaking","species","specified","specularConstant","specularExponent","speechSynthesis","speed","speedOfSound","spellcheck","sphericalHarmonicsCoefficients","splice","split","splitText","spreadMethod","sqrt","src","srcElement","srcFactor","srcFilter","srcObject","srcUrn","srcdoc","srclang","srcset","stack","stackTraceLimit","stacktrace","stageParameters","standalone","standby","start","startContainer","startE","startIce","startLoadTime","startMessages","startNotifications","startOffset","startProfiling","startRendering","startShark","startTime","startViewTransition","startsWith","state","states","stats","status","statusCode","statusMessage","statusText","statusbar","stdDeviationX","stdDeviationY","stencilBack","stencilClearValue","stencilFront","stencilFunc","stencilFuncSeparate","stencilLoadOp","stencilMask","stencilMaskSeparate","stencilOp","stencilOpSeparate","stencilReadMask","stencilReadOnly","stencilStoreOp","stencilWriteMask","step","stepDown","stepMismatch","stepMode","stepUp","sticky","stitchTiles","stop","stop-color","stop-opacity","stopColor","stopImmediatePropagation","stopNotifications","stopOpacity","stopProfiling","stopPropagation","stopShark","stopped","storage","storageArea","storageBuckets","storageName","storageStatus","storageTexture","store","storeOp","storeSiteSpecificTrackingException","storeWebWideTrackingException","stpVersion","stream","streamErrorCode","streams","stretch","strike","string","stringValue","stringify","stripIndexFormat","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeRect","strokeStyle","strokeText","strokeWidth","structuredClone","style","styleAndLayoutStart","styleFloat","styleMap","styleMedia","styleSheet","styleSheetSets","styleSheets","sub","subarray","subject","submit","submitFrame","submitter","subscribe","substr","substring","substringData","subtle","subtree","suffix","suffixes","summary","sup","supported","supportedContentEncodings","supportedEntryTypes","supportedValuesOf","supports","supportsFiber","supportsSession","supportsText","surfaceScale","surroundContents","suspend","suspendRedraw","svb","svh","svi","svmax","svmin","svw","swapCache","swapNode","sweepFlag","symbols","symmetricDifference","sync","syntax","sysexEnabled","system","systemCode","systemId","systemLanguage","systemXDPI","systemYDPI","tBodies","tFoot","tHead","tab","tab-size","tabId","tabIds","tabIndex","tabSize","table","table-layout","tableLayout","tableValues","tabs","tag","tagName","tagUrn","tags","taintEnabled","take","takePhoto","takeRecords","tan","tangentialPressure","tanh","target","targetAddressSpace","targetElement","targetRayMode","targetRaySpace","targetTouches","targetURL","targetX","targetY","targets","tcpType","tee","tel","telemetry","terminate","test","texImage2D","texImage3D","texParameterf","texParameteri","texStorage2D","texStorage3D","texSubImage2D","texSubImage3D","text","text-align","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","textAlign","textAlignLast","textAnchor","textAutospace","textBaseline","textCombineUpright","textContent","textDecoration","textDecorationBlink","textDecorationColor","textDecorationLine","textDecorationLineThrough","textDecorationNone","textDecorationOverline","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textDecorationUnderline","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textJustify","textJustifyTrim","textKashida","textKashidaSpace","textLength","textOrientation","textOverflow","textRendering","textShadow","textTracks","textTransform","textUnderlineOffset","textUnderlinePosition","textWrap","textWrapMode","textWrapStyle","texture","theme","then","threadId","threshold","thresholds","throwIfAborted","tiltX","tiltY","time","timeEnd","timeLog","timeOrigin","timeRemaining","timeStamp","timecode","timeline","timelineTime","timeout","timestamp","timestampOffset","timestampWrites","timing","title","titlebarAreaRect","tlsChannelId","to","toArray","toBase64","toBlob","toDataURL","toDateString","toElement","toExponential","toFixed","toFloat32Array","toFloat64Array","toGMTString","toHex","toISOString","toJSON","toLocaleDateString","toLocaleFormat","toLocaleLowerCase","toLocaleString","toLocaleTimeString","toLocaleUpperCase","toLowerCase","toMatrix","toMethod","toPrecision","toPrimitive","toReversed","toSdp","toSorted","toSource","toSpliced","toStaticHTML","toString","toStringTag","toSum","toTimeString","toUTCString","toUpperCase","toWellFormed","toggle","toggleAttribute","toggleLongPressEnabled","togglePopover","toggleReaderMode","token","tone","toneBuffer","tooLong","tooShort","toolbar","top","topMargin","topSites","topology","total","totalFrameDelay","totalFrames","totalFramesDuration","totalVideoFrames","touch-action","touchAction","touched","touches","trace","track","trackVisibility","trackedAnchors","tracks","tran","transaction","transactions","transceiver","transfer","transferControlToOffscreen","transferFromImageBitmap","transferImageBitmap","transferIn","transferOut","transferSize","transferToFixedLength","transferToImageBitmap","transform","transform-box","transform-origin","transform-style","transformBox","transformFeedbackVaryings","transformOrigin","transformPoint","transformString","transformStyle","transformToDocument","transformToFragment","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","transitionBehavior","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","translateSelf","translationX","translationY","transport","traverseTo","trim","trimEnd","trimLeft","trimRight","trimStart","trueSpeed","trunc","truncate","trustedTypes","try","turn","twist","type","typeDetail","typeMismatch","typeMustMatch","types","u2f","ubound","uint16","uint32","uint8","uint8Clamped","unadjustedMovement","unclippedDepth","unconfigure","undefined","underlineStyle","underlineThickness","unescape","uneval","ungroup","unicode","unicode-bidi","unicodeBidi","unicodeRange","unicodeSets","uniform1f","uniform1fv","uniform1i","uniform1iv","uniform1ui","uniform1uiv","uniform2f","uniform2fv","uniform2i","uniform2iv","uniform2ui","uniform2uiv","uniform3f","uniform3fv","uniform3i","uniform3iv","uniform3ui","uniform3uiv","uniform4f","uniform4fv","uniform4i","uniform4iv","uniform4ui","uniform4uiv","uniformBlockBinding","uniformMatrix2fv","uniformMatrix2x3fv","uniformMatrix2x4fv","uniformMatrix3fv","uniformMatrix3x2fv","uniformMatrix3x4fv","uniformMatrix4fv","uniformMatrix4x2fv","uniformMatrix4x3fv","uninstallSelf","union","unique","uniqueID","uniqueNumber","unit","unitType","units","unloadEventEnd","unloadEventStart","unlock","unmap","unmount","unobserve","unpackColorSpace","unpause","unpauseAnimations","unreadCount","unregister","unregisterContentHandler","unregisterProtocolHandler","unscopables","unselectable","unshift","unsubscribe","unsuspendRedraw","unsuspendRedrawAll","unwatch","unwrapKey","upDegrees","upX","upY","upZ","update","updateAdInterestGroups","updateCallbackDone","updateCharacterBounds","updateCommands","updateControlBounds","updateCurrentEntry","updateIce","updateInkTrailStartPoint","updateInterval","updatePlaybackRate","updateRangeEnd","updateRangeStart","updateRenderState","updateSelection","updateSelectionBounds","updateSettings","updateText","updateTiming","updateViaCache","updateWith","updated","updating","upgrade","upload","uploadTotal","uploaded","upper","upperBound","upperOpen","uri","url","urn","urns","usage","usages","usb","usbVersionMajor","usbVersionMinor","usbVersionSubminor","useCurrentView","useMap","useProgram","usedSpace","user-select","userActivation","userAgent","userAgentData","userChoice","userHandle","userHint","userInitiated","userLanguage","userSelect","userState","userVisibleOnly","username","usernameFragment","utterance","uuid","v8BreakIterator","vAlign","vLink","valid","validate","validateProgram","validationMessage","validity","value","valueAsDate","valueAsNumber","valueAsString","valueInSpecifiedUnits","valueMissing","valueOf","valueText","valueType","values","variable","variant","variationSettings","vb","vector-effect","vectorEffect","velocityAngular","velocityExpansion","velocityX","velocityY","vendor","vendorId","vendorSub","verify","version","vertex","vertexAttrib1f","vertexAttrib1fv","vertexAttrib2f","vertexAttrib2fv","vertexAttrib3f","vertexAttrib3fv","vertexAttrib4f","vertexAttrib4fv","vertexAttribDivisor","vertexAttribDivisorANGLE","vertexAttribI4i","vertexAttribI4iv","vertexAttribI4ui","vertexAttribI4uiv","vertexAttribIPointer","vertexAttribPointer","vertical","vertical-align","verticalAlign","verticalOverflow","vh","vi","vibrate","vibrationActuator","videoBitsPerSecond","videoHeight","videoTracks","videoWidth","view","viewBox","viewBoxString","viewDimension","viewFormats","viewTarget","viewTargetString","viewTransition","viewport","viewportAnchorX","viewportAnchorY","viewportElement","views","violatedDirective","virtualKeyboard","virtualKeyboardPolicy","visibility","visibilityState","visible","visibleRect","visualViewport","vlinkColor","vmax","vmin","voice","voiceURI","volume","vrml","vspace","vw","w","wait","waitAsync","waitSync","waiting","wake","wakeLock","wand","warmup","warn","wasAlternateProtocolAvailable","wasClean","wasDiscarded","wasFetchedViaSpdy","wasNpnNegotiated","watch","watchAvailability","watchPosition","webNavigation","webRequest","webdriver","webkitAddKey","webkitAlignContent","webkitAlignItems","webkitAlignSelf","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppearance","webkitAudioContext","webkitAudioDecodedByteCount","webkitAudioPannerNode","webkitBackfaceVisibility","webkitBackground","webkitBackgroundAttachment","webkitBackgroundClip","webkitBackgroundColor","webkitBackgroundImage","webkitBackgroundOrigin","webkitBackgroundPosition","webkitBackgroundPositionX","webkitBackgroundPositionY","webkitBackgroundRepeat","webkitBackgroundSize","webkitBackingStorePixelRatio","webkitBorderBottomLeftRadius","webkitBorderBottomRightRadius","webkitBorderImage","webkitBorderImageOutset","webkitBorderImageRepeat","webkitBorderImageSlice","webkitBorderImageSource","webkitBorderImageWidth","webkitBorderRadius","webkitBorderTopLeftRadius","webkitBorderTopRightRadius","webkitBoxAlign","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxShadow","webkitBoxSizing","webkitCancelAnimationFrame","webkitCancelFullScreen","webkitCancelKeyRequest","webkitCancelRequestAnimationFrame","webkitClearResourceTimings","webkitClipPath","webkitClosedCaptionsVisible","webkitConvertPointFromNodeToPage","webkitConvertPointFromPageToNode","webkitCreateShadowRoot","webkitCurrentFullScreenElement","webkitCurrentPlaybackTargetIsWireless","webkitDecodedFrameCount","webkitDirectionInvertedFromDevice","webkitDisplayingFullscreen","webkitDroppedFrameCount","webkitEnterFullScreen","webkitEnterFullscreen","webkitEntries","webkitExitFullScreen","webkitExitFullscreen","webkitExitPointerLock","webkitFilter","webkitFlex","webkitFlexBasis","webkitFlexDirection","webkitFlexFlow","webkitFlexGrow","webkitFlexShrink","webkitFlexWrap","webkitFontFeatureSettings","webkitFullScreenKeyboardInputAllowed","webkitFullscreenElement","webkitFullscreenEnabled","webkitGenerateKeyRequest","webkitGetAsEntry","webkitGetDatabaseNames","webkitGetEntries","webkitGetEntriesByName","webkitGetEntriesByType","webkitGetFlowByName","webkitGetGamepads","webkitGetImageDataHD","webkitGetNamedFlows","webkitGetRegionFlowRanges","webkitGetUserMedia","webkitHasClosedCaptions","webkitHidden","webkitIDBCursor","webkitIDBDatabase","webkitIDBDatabaseError","webkitIDBDatabaseException","webkitIDBFactory","webkitIDBIndex","webkitIDBKeyRange","webkitIDBObjectStore","webkitIDBRequest","webkitIDBTransaction","webkitImageSmoothingEnabled","webkitIndexedDB","webkitInitMessageEvent","webkitIsFullScreen","webkitJustifyContent","webkitKeys","webkitLineClamp","webkitLineDashOffset","webkitLockOrientation","webkitMask","webkitMaskClip","webkitMaskComposite","webkitMaskImage","webkitMaskOrigin","webkitMaskPosition","webkitMaskPositionX","webkitMaskPositionY","webkitMaskRepeat","webkitMaskSize","webkitMatchesSelector","webkitMediaStream","webkitNotifications","webkitOfflineAudioContext","webkitOrder","webkitOrientation","webkitPeerConnection00","webkitPersistentStorage","webkitPerspective","webkitPerspectiveOrigin","webkitPointerLockElement","webkitPostMessage","webkitPreservesPitch","webkitPutImageDataHD","webkitRTCPeerConnection","webkitRegionOverset","webkitRelativePath","webkitRequestAnimationFrame","webkitRequestFileSystem","webkitRequestFullScreen","webkitRequestFullscreen","webkitRequestPointerLock","webkitResolveLocalFileSystemURL","webkitSetMediaKeys","webkitSetResourceTimingBufferSize","webkitShadowRoot","webkitShowPlaybackTargetPicker","webkitSlice","webkitSpeechGrammar","webkitSpeechGrammarList","webkitSpeechRecognition","webkitSpeechRecognitionError","webkitSpeechRecognitionEvent","webkitStorageInfo","webkitSupportsFullscreen","webkitTemporaryStorage","webkitTextFillColor","webkitTextSecurity","webkitTextSizeAdjust","webkitTextStroke","webkitTextStrokeColor","webkitTextStrokeWidth","webkitTransform","webkitTransformOrigin","webkitTransformStyle","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitURL","webkitUnlockOrientation","webkitUserSelect","webkitVideoDecodedByteCount","webkitVisibilityState","webkitWirelessVideoPlaybackDisabled","webkitdirectory","webkitdropzone","webstore","weight","wgslLanguageFeatures","whatToShow","wheelDelta","wheelDeltaX","wheelDeltaY","whenDefined","which","white-space","white-space-collapse","whiteSpace","whiteSpaceCollapse","wholeText","widows","width","will-change","willChange","willValidate","window","windowAttribution","windowControlsOverlay","windowId","windowIds","windows","with","withCredentials","withResolvers","word-break","word-spacing","word-wrap","wordBreak","wordSpacing","wordWrap","workerStart","worklet","wow64","wrap","wrapKey","writable","writableAuxiliaries","write","writeBuffer","writeMask","writeText","writeTexture","writeTimestamp","writeValue","writeValueWithResponse","writeValueWithoutResponse","writeWithoutResponse","writeln","writing-mode","writingMode","writingSuggestions","x","x1","x2","xChannelSelector","xmlEncoding","xmlStandalone","xmlVersion","xmlbase","xmllang","xmlspace","xor","xr","y","y1","y2","yChannelSelector","yandex","yield","z","z-index","zIndex","zoom","zoomAndPan","zoomRectScreen"];function _a(e,t){e.walk(new qn(function(e){return e instanceof Ot?_a(e.tail_node(),t):e instanceof Mn?t(e.value):e instanceof Lt&&(_a(e.consequent,t),_a(e.alternative,t)),!0}))}function ma(e){var t=new Set;return Xn(e,e=>{e instanceof Jt||e instanceof jt||e instanceof Wt||e instanceof zt||e instanceof Mt||(e instanceof Xt?"string"==typeof e.key&&T(e,Jn)&&t.add(e.key):e instanceof Ht?T(e,Jn)&&t.add(e.key.name):e instanceof kt?T(e,Jn)&&t.add(e.property):e instanceof wt&&e.property instanceof Mn&&T(e,Jn)&&t.add(e.property.value))}),t}function ga(e,t,n=ma(e)){var i=(t=o(t,{builtins:!1,cache:null,debug:!1,keep_quoted:!1,nth_identifier:mi,only_cache:!1,regex:null,reserved:null,undeclared:!1,only_annotated:!1},!0)).nth_identifier,r=t.reserved;Array.isArray(r)||(r=[r]);var a=new Set(r);t.builtins||function(e){ha.forEach(i);var t={},n="object"==typeof global?global:self;function i(t){e.add(t)}["Symbol","Map","Promise","Proxy","Reflect","Set","WeakMap","WeakSet"].forEach(function(e){t[e]=n[e]||function(){}}),["null","true","false","NaN","Infinity","-Infinity","undefined"].forEach(i),[Object,Array,Function,Number,String,Boolean,Error,Math,Date,RegExp,t.Symbol,ArrayBuffer,DataView,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,eval,EvalError,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,isFinite,isNaN,JSON,t.Map,parseFloat,parseInt,t.Promise,t.Proxy,RangeError,ReferenceError,t.Reflect,t.Set,SyntaxError,TypeError,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,URIError,t.WeakMap,t.WeakSet].forEach(function(e){Object.getOwnPropertyNames(e).map(i),e.prototype&&Object.getOwnPropertyNames(e.prototype).map(i)})}(a);var s,u=-1;s=t.cache?t.cache.props:new Map;var c,l=t.only_annotated,f=t.regex&&new RegExp(t.regex),p=!1!==t.debug;p&&(c=!0===t.debug?"":t.debug);var d=new Set,h=new Set;s.forEach(e=>h.add(e));var _=!!t.keep_quoted;return e.walk(new qn(function(e){if(e instanceof Jt||e instanceof jt||e instanceof Wt||e instanceof zt||e instanceof Mt);else if(e instanceof Xt)"string"!=typeof e.key||_&&e.quote||E(e.key);else if(e instanceof Ht)_&&e.quote||E(e.key.name);else if(e instanceof kt){var n=!!t.undeclared;if(!n){for(var i=e;i.expression;)i=i.expression;n=!(i.thedef&&i.thedef.undeclared)}!n||_&&e.quote||E(e.property)}else e instanceof wt?_||_a(e.property,E):e instanceof Ct&&"Object.defineProperty"==e.expression.print_to_string()?_a(e.args[1],E):e instanceof Bt&&"in"===e.operator?_a(e.left,E):e instanceof Mn&&T(e,Qn)&&E(e.value)})),e.transform(new Yn(function(e){e instanceof Jt||e instanceof jt||e instanceof Wt||e instanceof zt||e instanceof Mt||(e instanceof Xt?"string"!=typeof e.key||_&&e.quote||(e.key=v(e.key)):e instanceof Ht?_&&e.quote||e.computed_key()||(e.key.name=v(e.key.name)):e instanceof kt?_&&e.quote||(e.property=v(e.property)):!_&&e instanceof wt?e.property=b(e.property):e instanceof Ct&&"Object.defineProperty"==e.expression.print_to_string()?e.args[1]=b(e.args[1]):e instanceof Bt&&"in"===e.operator?e.left=b(e.left):e instanceof Mn&&T(e,Qn)&&(R(e,Qn),e.value=v(e.value)))}));function m(e){return!h.has(e)&&(!a.has(e)&&(t.only_cache?s.has(e):!/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(e)))}function g(e){return!(l&&!n.has(e))&&(f&&!f.test(e)?n.has(e):!a.has(e)&&(s.has(e)||d.has(e)))}function E(e){m(e)&&d.add(e),g(e)||h.add(e)}function v(e){if(!g(e))return e;var t=s.get(e);if(!t){if(p){var n="_$"+e+"$"+c+"_";m(n)&&(t=n)}if(!t)do{t=i.get(++u)}while(!m(t));s.set(e,t)}return t}function b(e){return e.transform(new Yn(function(e){if(e instanceof Ot){var t=e.expressions.length-1;e.expressions[t]=b(e.expressions[t])}else e instanceof Mn?(R(e,Qn),e.value=v(e.value)):e instanceof Lt&&(e.consequent=b(e.consequent),e.alternative=b(e.alternative));return e}))}}var Ea=n(65606),va="undefined"!=typeof Buffer?e=>Buffer.from(e,"base64").toString():e=>decodeURIComponent(escape(atob(e))),ba="undefined"!=typeof Buffer?e=>Buffer.from(e).toString("base64"):e=>btoa(unescape(encodeURIComponent(e)));function Da(e){var t=/(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(e);return t?va(t[2]):(console.warn("inline source map not found"),null)}function Sa(e,t,n){t[e]&&n.forEach(function(n){t[n]&&("object"!=typeof t[n]&&(t[n]={}),e in t[n]||(t[n][e]=t[e]))})}function ya(e){e&&("props"in e?e.props instanceof Map||(e.props=function(e){var t=new Map;for(var n in e)v(e,n)&&"$"===n.charAt(0)&&t.set(n.substr(1),e[n]);return t}(e.props)):e.props=new Map)}function Aa(e){return{props:(t=e.props,n=Object.create(null),t.forEach(function(e,t){n["$"+t]=e}),n)};var t,n}function*Ta(e,t,n){n&&"object"==typeof Ea&&Ea.env&&"string"==typeof Ea.env.TERSER_DEBUG_DIR&&function(e,t,n,i){if(!(n&&n.writeFileSync&&n.mkdirSync))return;try{n.mkdirSync(i)}catch(e){if("EEXIST"!==e.code)throw e}const r=`${i}/terser-debug-${9999999*Math.random()|0}.log`;t=t||{};const o=JSON.stringify(t,(e,t)=>"function"==typeof t?"[Function "+t.toString()+"]":t instanceof RegExp?"[RegExp "+t.toString()+"]":t,4),a=e=>"object"==typeof e&&t.parse&&t.parse.spidermonkey?JSON.stringify(e,null,2):"object"==typeof e?Object.keys(e).map(t=>t+": "+a(e[t])).join("\n\n"):"string"==typeof e?"```\n"+e+"\n```":e;n.writeFileSync(r,"Options: \n"+o+"\n\nInput files:\n\n"+a(e)+"\n")}(e,t,n,Ea.env.TERSER_DEBUG_DIR);var i,r,a,s=(t=o(t,{compress:{},ecma:void 0,enclose:!1,ie8:!1,keep_classnames:void 0,keep_fnames:!1,mangle:{},module:!1,nameCache:null,output:null,format:null,parse:{},rename:void 0,safari10:!1,sourceMap:!1,spidermonkey:!1,timings:!1,toplevel:!1,warnings:!1,wrap:!1},!0)).timings&&{start:Date.now()};if(void 0===t.keep_classnames&&(t.keep_classnames=t.keep_fnames),void 0===t.rename&&(t.rename=t.compress&&t.mangle),t.output&&t.format)throw new Error("Please only specify either output or format option, preferrably format.");if(t.format=t.format||t.output||{},Sa("ecma",t,["parse","compress","format"]),Sa("ie8",t,["compress","mangle","format"]),Sa("keep_classnames",t,["compress","mangle"]),Sa("keep_fnames",t,["compress","mangle"]),Sa("module",t,["parse","compress","mangle"]),Sa("safari10",t,["mangle","format"]),Sa("toplevel",t,["compress","mangle"]),Sa("warnings",t,["compress"]),t.mangle&&(t.mangle=o(t.mangle,{cache:t.nameCache&&(t.nameCache.vars||{}),eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,nth_identifier:mi,properties:!1,reserved:[],safari10:!1,toplevel:!1},!0),t.mangle.properties&&("object"!=typeof t.mangle.properties&&(t.mangle.properties={}),t.mangle.properties.keep_quoted&&(i=t.mangle.properties.reserved,Array.isArray(i)||(i=[]),t.mangle.properties.reserved=i),t.nameCache&&!("cache"in t.mangle.properties)&&(t.mangle.properties.cache=t.nameCache.props||{})),ya(t.mangle.cache),ya(t.mangle.properties.cache)),t.sourceMap&&(t.sourceMap=o(t.sourceMap,{asObject:!1,content:null,filename:null,includeSources:!1,root:null,url:null},!0)),s&&(s.parse=Date.now()),e instanceof Ke)r=e;else{if(("string"==typeof e||t.parse.spidermonkey&&!Array.isArray(e))&&(e=[e]),t.parse=t.parse||{},t.parse.toplevel=null,t.parse.spidermonkey)t.parse.toplevel=De.from_mozilla_ast(Object.keys(e).reduce(function(t,n){return t?(t.body=t.body.concat(e[n].body),t):e[n]},null));else for(var u in delete t.parse.spidermonkey,e)if(v(e,u)&&(t.parse.filename=u,t.parse.toplevel=me(e[u],t.parse),t.sourceMap&&"inline"==t.sourceMap.content)){if(Object.keys(e).length>1)throw new Error("inline source map only works with singular input");t.sourceMap.content=Da(e[u])}if(null===t.parse.toplevel)throw new Error("no source file given");r=t.parse.toplevel}i&&"strict"!==t.mangle.properties.keep_quoted&&function(e,t){function n(e){d(t,e)}e.walk(new qn(function(e){e instanceof Xt&&e.quote?n(e.key):e instanceof Ht&&e.quote?n(e.key.name):e instanceof wt&&_a(e.property,n)}))}(r,i),t.mangle&&t.mangle.properties&&(a=ma(r)),t.wrap&&(r=r.wrap_commonjs(t.wrap)),t.enclose&&(r=r.wrap_enclose(t.enclose)),s&&(s.rename=Date.now()),s&&(s.compress=Date.now()),t.compress&&(r=new Zr(t.compress,{mangle_options:t.mangle}).compress(r)),s&&(s.scope=Date.now()),t.mangle&&r.figure_out_scope(t.mangle),s&&(s.mangle=Date.now()),t.mangle&&(r.compute_char_frequency(t.mangle),r.mangle_names(t.mangle),r=function(e,t){var n=-1,i=new Map,r=t.nth_identifier||mi;return e.transform(new Yn(function(e){e instanceof Jt||e instanceof jt||e instanceof Wt||e instanceof zt||e instanceof en?e.key.name=o(e.key.name):e instanceof Mt&&(e.property=o(e.property))}));function o(e){let t=i.get(e);return t||(t=r.get(++n),i.set(e,t)),t}}(r,t.mangle)),s&&(s.properties=Date.now()),t.mangle&&t.mangle.properties&&(r=ga(r,t.mangle.properties,a)),s&&(s.format=Date.now());var c={};let l;if(t.format.ast&&(c.ast=r),t.format.spidermonkey&&(c.ast=r.to_mozilla_ast()),!v(t.format,"code")||t.format.code){if(l={...t.format},l.ast||(l._destroy_ast=!0,Xn(r,e=>{e instanceof Ge&&(e.variables=void 0,e.enclosed=void 0,e.parent_scope=void 0),e.block_scope&&(e.block_scope.variables=void 0,e.block_scope.enclosed=void 0,e.block_scope.parent_scope=void 0)})),t.sourceMap){if(t.sourceMap.includeSources&&e instanceof Ke)throw new Error("original source content unavailable");l.source_map=yield*function*(e){var t;e=o(e,{file:null,root:null,orig:null,files:{}});var n=new da({file:e.file,sourceRoot:e.root});let i={__proto__:null},r=e.files;for(var a in r)v(r,a)&&(i[a]=r[a]);function s(e){return e.sourcesContent&&e.sourcesContent.every(e=>null==e)&&delete e.sourcesContent,void 0===e.file&&delete e.file,void 0===e.sourceRoot&&delete e.sourceRoot,e}return e.orig&&(t=yield new pa(e.orig)).sourcesContent&&t.sources.forEach(function(e,n){var r=t.sourcesContent[n];r&&(i[e]=r)}),{add:function(e,r,o,a,s,u){let c={line:r,column:o};if(t){var l=t.originalPositionFor({line:a,column:s});if(null===l.source)return void n.addMapping({generated:c,original:null,source:null,name:null});e=l.source,a=l.line,s=l.column,u=l.name||u}n.addMapping({generated:c,original:{line:a,column:s},source:e,name:u}),n.setSourceContent(e,i[e])},getDecoded:function(){return n.toDecodedMap?s(n.toDecodedMap()):null},getEncoded:function(){return s(n.toJSON())},destroy:function(){t&&t.destroy&&t.destroy()}}}({file:t.sourceMap.filename,orig:t.sourceMap.content,root:t.sourceMap.root,files:t.sourceMap.includeSources?e:null})}delete l.ast,delete l.code,delete l.spidermonkey;var f=ai(l);if(r.print(f),c.code=f.get(),t.sourceMap)if(Object.defineProperty(c,"map",{configurable:!0,enumerable:!0,get(){const e=l.source_map.getEncoded();return c.map=t.sourceMap.asObject?e:JSON.stringify(e)},set(e){Object.defineProperty(c,"map",{value:e,writable:!0})}}),c.decoded_map=l.source_map.getDecoded(),"inline"==t.sourceMap.url){var p="object"==typeof c.map?JSON.stringify(c.map):c.map;c.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+ba(p)}else t.sourceMap.url&&(c.code+="\n//# sourceMappingURL="+t.sourceMap.url)}return t.nameCache&&t.mangle&&(t.mangle.cache&&(t.nameCache.vars=Aa(t.mangle.cache)),t.mangle.properties&&t.mangle.properties.cache&&(t.nameCache.props=Aa(t.mangle.properties.cache))),l&&l.source_map&&l.source_map.destroy(),s&&(s.end=Date.now(),c.timings={parse:.001*(s.rename-s.parse),rename:.001*(s.compress-s.rename),compress:.001*(s.scope-s.compress),scope:.001*(s.mangle-s.scope),mangle:.001*(s.properties-s.mangle),properties:.001*(s.format-s.properties),format:.001*(s.end-s.format),total:.001*(s.end-s.start)}),c}n(65606);const Ca=[{name:"speedometer-es2015-test-2.0.js",options:{compress:{passes:1,sequences:!1}}}];async function Ra(e){const t=Ca.map(({name:t,options:n})=>({payload:e[t],options:n}));return await Promise.all(t.map(({payload:e,options:t})=>async function(e,t,n){const i=Ta(e,t,n);let r,o;do{o=i.next(await r),r=o.value}while(!o.done);return o.value}(e,t)))}})(),self.WTBenchmark=i})(); \ No newline at end of file diff --git a/web-tooling-benchmark/dist/typescript.bundle.dev.js.z b/web-tooling-benchmark/dist/typescript.bundle.dev.js.z new file mode 100644 index 00000000..75d2730c Binary files /dev/null and b/web-tooling-benchmark/dist/typescript.bundle.dev.js.z differ diff --git a/web-tooling-benchmark/dist/typescript.bundle.js b/web-tooling-benchmark/dist/typescript.bundle.js deleted file mode 100644 index cdfb22c1..00000000 --- a/web-tooling-benchmark/dist/typescript.bundle.js +++ /dev/null @@ -1,198428 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/***/ ((module) => { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/typescript/lib sync recursive": -/*!*******************************************!*\ - !*** ./node_modules/typescript/lib/ sync ***! - \*******************************************/ -/***/ ((module) => { - -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = () => ([]); -webpackEmptyContext.resolve = webpackEmptyContext; -webpackEmptyContext.id = "./node_modules/typescript/lib sync recursive"; -module.exports = webpackEmptyContext; - -/***/ }), - -/***/ "./node_modules/typescript/lib/typescript.js": -/*!***************************************************!*\ - !*** ./node_modules/typescript/lib/typescript.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var __filename = "/index.js"; -var __dirname = "/"; -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -var ts = {}; ((module) => { -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => (__copyProps, mod); // Modified helper to skip setting __esModule. - -// src/typescript/typescript.ts -var typescript_exports = {}; -__export(typescript_exports, { - ANONYMOUS: () => ANONYMOUS, - AccessFlags: () => AccessFlags, - AssertionLevel: () => AssertionLevel, - AssignmentDeclarationKind: () => AssignmentDeclarationKind, - AssignmentKind: () => AssignmentKind, - Associativity: () => Associativity, - BreakpointResolver: () => ts_BreakpointResolver_exports, - BuilderFileEmit: () => BuilderFileEmit, - BuilderProgramKind: () => BuilderProgramKind, - BuilderState: () => BuilderState, - 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, - 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, - ImportKind: () => ImportKind, - ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, - IndentStyle: () => IndentStyle, - IndexFlags: () => IndexFlags, - IndexKind: () => IndexKind, - InferenceFlags: () => InferenceFlags, - InferencePriority: () => InferencePriority, - InlayHintKind: () => InlayHintKind2, - InlayHints: () => ts_InlayHints_exports, - InternalEmitFlags: () => InternalEmitFlags, - InternalNodeBuilderFlags: () => InternalNodeBuilderFlags, - InternalSymbolName: () => InternalSymbolName, - IntersectionFlags: () => IntersectionFlags, - InvalidatedProjectKind: () => InvalidatedProjectKind, - JSDocParsingMode: () => JSDocParsingMode, - JsDoc: () => ts_JsDoc_exports, - JsTyping: () => ts_JsTyping_exports, - JsxEmit: () => JsxEmit, - JsxFlags: () => JsxFlags, - JsxReferenceKind: () => JsxReferenceKind, - LanguageFeatureMinimumTarget: () => LanguageFeatureMinimumTarget, - LanguageServiceMode: () => LanguageServiceMode, - LanguageVariant: () => LanguageVariant, - LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, - ListFormat: () => ListFormat, - LogLevel: () => LogLevel, - MapCode: () => ts_MapCode_exports, - 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, - PredicateSemantics: () => PredicateSemantics, - PreparePasteEdits: () => ts_preparePasteEdits_exports, - PrivateIdentifierKind: () => PrivateIdentifierKind, - ProcessLevel: () => ProcessLevel, - ProgramUpdateLevel: () => ProgramUpdateLevel, - QuotePreference: () => QuotePreference, - RegularExpressionFlags: () => RegularExpressionFlags, - 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, - SignatureInfo: () => SignatureInfo, - SignatureKind: () => SignatureKind, - SmartSelectionRange: () => ts_SmartSelectionRange_exports, - SnippetKind: () => SnippetKind, - StatisticType: () => StatisticType, - StructureIsReused: () => StructureIsReused, - SymbolAccessibility: () => SymbolAccessibility, - SymbolDisplay: () => ts_SymbolDisplay_exports, - SymbolDisplayPartKind: () => SymbolDisplayPartKind, - SymbolFlags: () => SymbolFlags, - SymbolFormatFlags: () => SymbolFormatFlags, - SyntaxKind: () => SyntaxKind, - 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, - 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, - arrayOf: () => arrayOf, - arrayReverseIterator: () => arrayReverseIterator, - arrayToMap: () => arrayToMap, - arrayToMultiMap: () => arrayToMultiMap, - arrayToNumericMap: () => arrayToNumericMap, - assertType: () => assertType, - assign: () => assign, - asyncSuperHelper: () => asyncSuperHelper, - attachFileToDiagnostics: () => attachFileToDiagnostics, - 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, - canHaveModuleSpecifier: () => canHaveModuleSpecifier, - canHaveSymbol: () => canHaveSymbol, - canIncludeBindAndCheckDiagnostics: () => canIncludeBindAndCheckDiagnostics, - canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, - canProduceDiagnostics: () => canProduceDiagnostics, - canUsePropertyAccess: () => canUsePropertyAccess, - canWatchAffectingLocation: () => canWatchAffectingLocation, - canWatchAtTypes: () => canWatchAtTypes, - canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, - canWatchDirectoryOrFilePath: () => canWatchDirectoryOrFilePath, - cartesianProduct: () => cartesianProduct, - cast: () => cast, - chainBundle: () => chainBundle, - chainDiagnosticMessages: () => chainDiagnosticMessages, - changeAnyExtension: () => changeAnyExtension, - changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, - changeExtension: () => changeExtension, - changeFullExtension: () => changeFullExtension, - changesAffectModuleResolution: () => changesAffectModuleResolution, - changesAffectingProgramStructure: () => changesAffectingProgramStructure, - characterCodeToRegularExpressionFlag: () => characterCodeToRegularExpressionFlag, - childIsDecorated: () => childIsDecorated, - classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, - classHasClassThisAssignment: () => classHasClassThisAssignment, - classHasDeclaredOrExplicitlyAssignedName: () => classHasDeclaredOrExplicitlyAssignedName, - classHasExplicitlyAssignedName: () => classHasExplicitlyAssignedName, - classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, - classicNameResolver: () => classicNameResolver, - classifier: () => ts_classifier_exports, - cleanExtendedConfigCache: () => cleanExtendedConfigCache, - clear: () => clear, - clearMap: () => clearMap, - clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, - climbPastPropertyAccess: () => climbPastPropertyAccess, - clone: () => clone, - cloneCompilerOptions: () => cloneCompilerOptions, - closeFileWatcher: () => closeFileWatcher, - closeFileWatcherOf: () => closeFileWatcherOf, - codefix: () => ts_codefix_exports, - collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, - collectExternalModuleInfo: () => collectExternalModuleInfo, - combine: () => combine, - combinePaths: () => combinePaths, - commandLineOptionOfCustomType: () => commandLineOptionOfCustomType, - commentPragmas: () => commentPragmas, - commonOptionsWithBuild: () => commonOptionsWithBuild, - compact: () => compact, - compareBooleans: () => compareBooleans, - compareDataObjects: () => compareDataObjects, - compareDiagnostics: () => compareDiagnostics, - 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, - compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, - compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, - compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, - compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, - compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, - computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, - computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, - computeLineOfPosition: () => computeLineOfPosition, - computeLineStarts: () => computeLineStarts, - computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, - 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, - createBuilderProgram: () => createBuilderProgram, - createBuilderProgramUsingIncrementalBuildInfo: () => createBuilderProgramUsingIncrementalBuildInfo, - createBuilderStatusReporter: () => createBuilderStatusReporter, - 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, - createEvaluator: () => createEvaluator, - createExpressionForJsxElement: () => createExpressionForJsxElement, - createExpressionForJsxFragment: () => createExpressionForJsxFragment, - createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, - createExpressionForPropertyName: () => createExpressionForPropertyName, - createExpressionFromEntityName: () => createExpressionFromEntityName, - createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createFileDiagnostic: () => createFileDiagnostic, - createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createFlowNode: () => createFlowNode, - createForOfBindingStatement: () => createForOfBindingStatement, - createFutureSourceFile: () => createFutureSourceFile, - createGetCanonicalFileName: () => createGetCanonicalFileName, - createGetIsolatedDeclarationErrors: () => createGetIsolatedDeclarationErrors, - createGetSourceFile: () => createGetSourceFile, - createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, - createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, - createGetSymbolWalker: () => createGetSymbolWalker, - createIncrementalCompilerHost: () => createIncrementalCompilerHost, - createIncrementalProgram: () => createIncrementalProgram, - createJsxFactoryExpression: () => createJsxFactoryExpression, - createLanguageService: () => createLanguageService, - createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createModeAwareCache: () => createModeAwareCache, - createModeAwareCacheKey: () => createModeAwareCacheKey, - createModeMismatchDetails: () => createModeMismatchDetails, - createModuleNotFoundChain: () => createModuleNotFoundChain, - createModuleResolutionCache: () => createModuleResolutionCache, - createModuleResolutionLoader: () => createModuleResolutionLoader, - createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache, - createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, - createMultiMap: () => createMultiMap, - createNameResolver: () => createNameResolver, - createNodeConverters: () => createNodeConverters, - createNodeFactory: () => createNodeFactory, - createOptionNameMap: () => createOptionNameMap, - createOverload: () => createOverload, - createPackageJsonImportFilter: () => createPackageJsonImportFilter, - createPackageJsonInfo: () => createPackageJsonInfo, - createParenthesizerRules: () => createParenthesizerRules, - createPatternMatcher: () => createPatternMatcher, - createPrinter: () => createPrinter, - createPrinterWithDefaults: () => createPrinterWithDefaults, - createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, - createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, - createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, - createProgram: () => createProgram, - createProgramDiagnostics: () => createProgramDiagnostics, - 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, - createSyntacticTypeNodeBuilder: () => createSyntacticTypeNodeBuilder, - 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, - createWatchCompilerHost: () => createWatchCompilerHost2, - createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, - createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, - createWatchFactory: () => createWatchFactory, - createWatchHost: () => createWatchHost, - createWatchProgram: () => createWatchProgram, - createWatchStatusReporter: () => createWatchStatusReporter, - createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - declarationNameToString: () => declarationNameToString, - decodeMappings: () => decodeMappings, - decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, - deduplicate: () => deduplicate, - defaultHoverMaximumTruncationLength: () => defaultHoverMaximumTruncationLength, - defaultInitCompilerOptions: () => defaultInitCompilerOptions, - defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, - diagnosticCategoryName: () => diagnosticCategoryName, - diagnosticToString: () => diagnosticToString, - diagnosticsEqualityComparer: () => diagnosticsEqualityComparer, - directoryProbablyExists: () => directoryProbablyExists, - directorySeparator: () => directorySeparator, - displayPart: () => displayPart, - displayPartsToString: () => displayPartsToString, - disposeEmitNodes: () => disposeEmitNodes, - documentSpansEqual: () => documentSpansEqual, - dumpTracingLegend: () => dumpTracingLegend, - elementAt: () => elementAt, - elideNodes: () => elideNodes, - emitDetachedComments: () => emitDetachedComments, - emitFiles: () => emitFiles, - emitFilesAndReportErrors: () => emitFilesAndReportErrors, - emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, - emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, - emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, - emitResolverSkipsTypeChecking: () => emitResolverSkipsTypeChecking, - emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, - emptyArray: () => emptyArray, - emptyFileSystemEntries: () => emptyFileSystemEntries, - emptyMap: () => emptyMap, - emptyOptions: () => emptyOptions, - endsWith: () => endsWith, - ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, - ensureScriptKind: () => ensureScriptKind, - ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, - entityNameToString: () => entityNameToString, - enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, - equalOwnProperties: () => equalOwnProperties, - equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, - equateStringsCaseSensitive: () => equateStringsCaseSensitive, - equateValues: () => equateValues, - escapeJsxAttributeString: () => escapeJsxAttributeString, - escapeLeadingUnderscores: () => escapeLeadingUnderscores, - escapeNonAsciiString: () => escapeNonAsciiString, - escapeSnippetText: () => escapeSnippetText, - escapeString: () => escapeString, - escapeTemplateSubstitution: () => escapeTemplateSubstitution, - evaluatorResult: () => evaluatorResult, - every: () => every, - exclusivelyPrefixedNodeCoreModules: () => exclusivelyPrefixedNodeCoreModules, - executeCommandLine: () => executeCommandLine, - expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, - explainFiles: () => explainFiles, - explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, - exportAssignmentIsAlias: () => exportAssignmentIsAlias, - expressionResultIsUnused: () => expressionResultIsUnused, - extend: () => extend, - 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, - findConstructorDeclaration: () => findConstructorDeclaration, - findContainingList: () => findContainingList, - findDiagnosticForNode: () => findDiagnosticForNode, - findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, - findIndex: () => findIndex, - findLast: () => findLast, - findLastIndex: () => findLastIndex, - findListItemInfo: () => findListItemInfo, - 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, - forEachAncestorDirectoryStoppingAtGlobalCache: () => forEachAncestorDirectoryStoppingAtGlobalCache, - forEachChild: () => forEachChild, - forEachChildRecursively: () => forEachChildRecursively, - forEachDynamicImportOrRequireCall: () => forEachDynamicImportOrRequireCall, - forEachEmittedFile: () => forEachEmittedFile, - forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, - forEachEntry: () => forEachEntry, - forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, - forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, - forEachKey: () => forEachKey, - forEachLeadingCommentRange: () => forEachLeadingCommentRange, - forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, - forEachNameOfDefaultExport: () => forEachNameOfDefaultExport, - forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName, - forEachProjectReference: () => forEachProjectReference, - forEachPropertyAssignment: () => forEachPropertyAssignment, - forEachResolvedProjectReference: () => forEachResolvedProjectReference, - forEachReturnStatement: () => forEachReturnStatement, - forEachRight: () => forEachRight, - forEachTrailingCommentRange: () => forEachTrailingCommentRange, - forEachTsConfigPropArray: () => forEachTsConfigPropArray, - forEachUnique: () => forEachUnique, - forEachYieldExpression: () => forEachYieldExpression, - formatColorAndReset: () => formatColorAndReset, - formatDiagnostic: () => formatDiagnostic, - formatDiagnostics: () => formatDiagnostics, - formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, - formatGeneratedName: () => formatGeneratedName, - formatGeneratedNamePart: () => formatGeneratedNamePart, - formatLocation: () => formatLocation, - formatMessage: () => formatMessage, - formatStringFromArgs: () => formatStringFromArgs, - formatting: () => ts_formatting_exports, - generateDjb2Hash: () => generateDjb2Hash, - generateTSConfig: () => generateTSConfig, - getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, - getAdjustedRenameLocation: () => getAdjustedRenameLocation, - getAliasDeclarationFromName: () => getAliasDeclarationFromName, - getAllAccessorDeclarations: () => getAllAccessorDeclarations, - getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, - getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, - getAllJSDocTags: () => getAllJSDocTags, - getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, - getAllKeys: () => getAllKeys, - getAllProjectOutputs: () => getAllProjectOutputs, - getAllSuperTypeNodes: () => getAllSuperTypeNodes, - getAllowImportingTsExtensions: () => getAllowImportingTsExtensions, - 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, - getCanonicalDiagnostic: () => getCanonicalDiagnostic, - getCheckFlags: () => getCheckFlags, - getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, - getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, - getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, - getCombinedModifierFlags: () => getCombinedModifierFlags, - getCombinedNodeFlags: () => getCombinedNodeFlags, - getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, - getCommentRange: () => getCommentRange, - getCommonSourceDirectory: () => getCommonSourceDirectory, - getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, - getCompilerOptionValue: () => getCompilerOptionValue, - 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, - getDeclarationDiagnostics: () => getDeclarationDiagnostics, - getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, - getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, - getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, - getDeclarationFileExtension: () => getDeclarationFileExtension, - getDeclarationFromName: () => getDeclarationFromName, - getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, - getDeclarationOfKind: () => getDeclarationOfKind, - getDeclarationsOfKind: () => getDeclarationsOfKind, - getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, - getDecorators: () => getDecorators, - getDefaultCompilerOptions: () => getDefaultCompilerOptions2, - getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, - getDefaultLibFileName: () => getDefaultLibFileName, - getDefaultLibFilePath: () => getDefaultLibFilePath, - getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, - getDefaultLikeExportNameFromDeclaration: () => getDefaultLikeExportNameFromDeclaration, - getDefaultResolutionModeForFileWorker: () => getDefaultResolutionModeForFileWorker, - 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, - getEmitModuleFormatOfFileWorker: () => getEmitModuleFormatOfFileWorker, - 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, - getImpliedNodeFormatForEmitWorker: () => getImpliedNodeFormatForEmitWorker, - getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, - getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, - getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, - getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, - getIndentString: () => getIndentString, - getInferredLibraryNameResolveFrom: () => getInferredLibraryNameResolveFrom, - getInitializedVariables: () => getInitializedVariables, - getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, - getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, - getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, - getInternalEmitFlags: () => getInternalEmitFlags, - getInvokedExpression: () => getInvokedExpression, - getIsFileExcluded: () => getIsFileExcluded, - 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, - 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, - getLibFileNameFromLibReference: () => getLibFileNameFromLibReference, - getLibNameFromLibReference: () => getLibNameFromLibReference, - getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName, - getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, - getLineInfo: () => getLineInfo, - getLineOfLocalPosition: () => getLineOfLocalPosition, - 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, - getNameOfScriptTarget: () => getNameOfScriptTarget, - getNameOrArgument: () => getNameOrArgument, - getNameTable: () => getNameTable, - getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, - getNewLineCharacter: () => getNewLineCharacter, - getNewLineKind: () => getNewLineKind, - getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, - getNewTargetContainer: () => getNewTargetContainer, - getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, - getNodeChildren: () => getNodeChildren, - getNodeForGeneratedName: () => getNodeForGeneratedName, - getNodeId: () => getNodeId, - getNodeKind: () => getNodeKind, - getNodeModifiers: () => getNodeModifiers, - getNodeModulePathParts: () => getNodeModulePathParts, - getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, - getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, - getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, - getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, - getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots, - getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode, - getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, - getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, - getNormalizedPathComponents: () => getNormalizedPathComponents, - getObjectFlags: () => getObjectFlags, - getOperatorAssociativity: () => getOperatorAssociativity, - getOperatorPrecedence: () => getOperatorPrecedence, - getOptionFromName: () => getOptionFromName, - getOptionsForLibraryResolution: () => getOptionsForLibraryResolution, - getOptionsNameMap: () => getOptionsNameMap, - getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue, - getOptionsSyntaxByValue: () => getOptionsSyntaxByValue, - getOrCreateEmitNode: () => getOrCreateEmitNode, - getOrUpdate: () => getOrUpdate, - getOriginalNode: () => getOriginalNode, - getOriginalNodeId: () => getOriginalNodeId, - getOutputDeclarationFileName: () => getOutputDeclarationFileName, - getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker, - getOutputExtension: () => getOutputExtension, - getOutputFileNames: () => getOutputFileNames, - getOutputJSFileNameWorker: () => getOutputJSFileNameWorker, - getOutputPathsFor: () => getOutputPathsFor, - getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, - getOwnKeys: () => getOwnKeys, - getOwnValues: () => getOwnValues, - getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, - getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, - getPackageScopeForPath: () => getPackageScopeForPath, - getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, - getParentNodeInSpan: () => getParentNodeInSpan, - getParseTreeNode: () => getParseTreeNode, - getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, - getPathComponents: () => getPathComponents, - getPathFromPathComponents: () => getPathFromPathComponents, - getPathUpdater: () => getPathUpdater, - getPathsBasePath: () => getPathsBasePath, - getPatternFromSpec: () => getPatternFromSpec, - getPendingEmitKindWithSeen: () => getPendingEmitKindWithSeen, - getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, - getPossibleGenericSignatures: () => getPossibleGenericSignatures, - getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, - getPossibleOriginalInputPathWithoutChangingExt: () => getPossibleOriginalInputPathWithoutChangingExt, - getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, - getPreEmitDiagnostics: () => getPreEmitDiagnostics, - getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, - getPrivateIdentifier: () => getPrivateIdentifier, - getProperties: () => getProperties, - getProperty: () => getProperty, - getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, - getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, - 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, - getResolvedModuleFromResolution: () => getResolvedModuleFromResolution, - getResolvedTypeReferenceDirectiveFromResolution: () => getResolvedTypeReferenceDirectiveFromResolution, - getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, - getRestParameterElementType: () => getRestParameterElementType, - getRightMostAssignedExpression: () => getRightMostAssignedExpression, - getRootDeclaration: () => getRootDeclaration, - getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache, - getRootLength: () => getRootLength, - getScriptKind: () => getScriptKind, - getScriptKindFromFileName: () => getScriptKindFromFileName, - getScriptTargetFeatures: () => getScriptTargetFeatures, - getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, - getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, - getSemanticClassifications: () => getSemanticClassifications, - getSemanticJsxChildren: () => getSemanticJsxChildren, - getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, - getSetAccessorValueParameter: () => getSetAccessorValueParameter, - getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, - getShebang: () => getShebang, - getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, - getSnapshotText: () => getSnapshotText, - getSnippetElement: () => getSnippetElement, - getSourceFileOfModule: () => getSourceFileOfModule, - getSourceFileOfNode: () => getSourceFileOfNode, - getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, - 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, - 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, - handleWatchOptionsConfigDirTemplateSubstitution: () => handleWatchOptionsConfigDirTemplateSubstitution, - hasAbstractModifier: () => hasAbstractModifier, - hasAccessorModifier: () => hasAccessorModifier, - hasAmbientModifier: () => hasAmbientModifier, - hasChangesInResolutions: () => hasChangesInResolutions, - hasContextSensitiveParameters: () => hasContextSensitiveParameters, - hasDecorators: () => hasDecorators, - hasDocComment: () => hasDocComment, - hasDynamicName: () => hasDynamicName, - hasEffectiveModifier: () => hasEffectiveModifier, - hasEffectiveModifiers: () => hasEffectiveModifiers, - hasEffectiveReadonlyModifier: () => hasEffectiveReadonlyModifier, - hasExtension: () => hasExtension, - hasImplementationTSFileExtension: () => hasImplementationTSFileExtension, - hasIndexSignature: () => hasIndexSignature, - hasInferredType: () => hasInferredType, - 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, - hostGetCanonicalFileName: () => hostGetCanonicalFileName, - hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, - idText: () => idText, - identifierIsThisKeyword: () => identifierIsThisKeyword, - identifierToKeywordKind: () => identifierToKeywordKind, - identity: () => identity, - identitySourceMapConsumer: () => identitySourceMapConsumer, - ignoreSourceNewlines: () => ignoreSourceNewlines, - ignoredPaths: () => ignoredPaths, - importFromModuleSpecifier: () => importFromModuleSpecifier, - importSyntaxAffectsModuleResolution: () => importSyntaxAffectsModuleResolution, - indexOfAnyCharCode: () => indexOfAnyCharCode, - indexOfNode: () => indexOfNode, - indicesOf: () => indicesOf, - inferredTypesContainingFile: () => inferredTypesContainingFile, - injectClassNamedEvaluationHelperBlockIfMissing: () => injectClassNamedEvaluationHelperBlockIfMissing, - injectClassThisAssignmentIfMissing: () => injectClassThisAssignmentIfMissing, - insertImports: () => insertImports, - 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, - isAliasableExpression: () => isAliasableExpression, - isAmbientModule: () => isAmbientModule, - isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, - isAnyDirectorySeparator: () => isAnyDirectorySeparator, - isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, - isAnyImportOrReExport: () => isAnyImportOrReExport, - isAnyImportOrRequireStatement: () => isAnyImportOrRequireStatement, - 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, - isBinaryLogicalOperator: () => isBinaryLogicalOperator, - isBinaryOperatorToken: () => isBinaryOperatorToken, - isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall, - isBindableStaticAccessExpression: () => isBindableStaticAccessExpression, - isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, - isBindableStaticNameExpression: () => isBindableStaticNameExpression, - isBindingElement: () => isBindingElement, - isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, - isBindingName: () => isBindingName, - isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, - isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, - isBindingPattern: () => isBindingPattern, - isBlock: () => isBlock, - isBlockLike: () => isBlockLike, - isBlockOrCatchScoped: () => isBlockOrCatchScoped, - isBlockScope: () => isBlockScope, - isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel, - isBooleanLiteral: () => isBooleanLiteral, - isBreakOrContinueStatement: () => isBreakOrContinueStatement, - isBreakStatement: () => isBreakStatement, - isBuildCommand: () => isBuildCommand, - isBuildInfoFile: () => isBuildInfoFile, - isBuilderProgram: () => isBuilderProgram, - isBundle: () => isBundle, - 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, - isCircularBuildOrder: () => isCircularBuildOrder, - isClassDeclaration: () => isClassDeclaration, - isClassElement: () => isClassElement, - isClassExpression: () => isClassExpression, - isClassInstanceProperty: () => isClassInstanceProperty, - isClassLike: () => isClassLike, - isClassMemberModifier: () => isClassMemberModifier, - isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock, - isClassOrTypeElement: () => isClassOrTypeElement, - isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, - isClassThisAssignmentBlock: () => isClassThisAssignmentBlock, - 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, - isConstAssertion: () => isConstAssertion, - 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, - isDiskPathRoot: () => isDiskPathRoot, - isDoStatement: () => isDoStatement, - isDocumentRegistryEntry: () => isDocumentRegistryEntry, - isDotDotDotToken: () => isDotDotDotToken, - isDottedName: () => isDottedName, - isDynamicName: () => isDynamicName, - isEffectiveExternalModule: () => isEffectiveExternalModule, - 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, - isFullSourceFile: () => isFullSourceFile, - 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, - isGeneratedIdentifier: () => isGeneratedIdentifier, - isGeneratedPrivateIdentifier: () => isGeneratedPrivateIdentifier, - isGetAccessor: () => isGetAccessor, - isGetAccessorDeclaration: () => isGetAccessorDeclaration, - isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, - isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, - isGlobalSourceFile: () => isGlobalSourceFile, - 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, - isImportable: () => isImportable, - 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, - isIncrementalBuildInfo: () => isIncrementalBuildInfo, - isIncrementalBundleEmitBuildInfo: () => isIncrementalBundleEmitBuildInfo, - 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, - isJSDocImportTag: () => isJSDocImportTag, - 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, - isJsxCallLike: () => isJsxCallLike, - 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, - isLet: () => isLet, - isLineBreak: () => isLineBreak, - isLiteralComputedPropertyDeclarationName: () => isLiteralComputedPropertyDeclarationName, - isLiteralExpression: () => isLiteralExpression, - isLiteralExpressionOfObject: () => isLiteralExpressionOfObject, - isLiteralImportTypeNode: () => isLiteralImportTypeNode, - isLiteralKind: () => isLiteralKind, - isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, - 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, - isModuleExportName: () => isModuleExportName, - isModuleExportsAccessExpression: () => isModuleExportsAccessExpression, - isModuleIdentifier: () => isModuleIdentifier, - isModuleName: () => isModuleName, - isModuleOrEnumDeclaration: () => isModuleOrEnumDeclaration, - isModuleReference: () => isModuleReference, - isModuleSpecifierLike: () => isModuleSpecifierLike, - isModuleWithStringLiteralName: () => isModuleWithStringLiteralName, - isNameOfFunctionDeclaration: () => isNameOfFunctionDeclaration, - isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, - 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, - isNewScopeNode: () => isNewScopeNode, - isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, - isNodeArray: () => isNodeArray, - isNodeArrayMultiLine: () => isNodeArrayMultiLine, - isNodeDescendantOf: () => isNodeDescendantOf, - isNodeKind: () => isNodeKind, - isNodeLikeSystem: () => isNodeLikeSystem, - isNodeModulesDirectory: () => isNodeModulesDirectory, - isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, - isNonContextualKeyword: () => isNonContextualKeyword, - isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, - isNonNullAccess: () => isNonNullAccess, - isNonNullChain: () => isNonNullChain, - isNonNullExpression: () => isNonNullExpression, - isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName, - 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, - isOmittedExpression: () => isOmittedExpression, - isOptionalChain: () => isOptionalChain, - isOptionalChainRoot: () => isOptionalChainRoot, - isOptionalDeclaration: () => isOptionalDeclaration, - isOptionalJSDocPropertyLikeTag: () => isOptionalJSDocPropertyLikeTag, - isOptionalTypeNode: () => isOptionalTypeNode, - isOuterExpression: () => isOuterExpression, - isOutermostOptionalChain: () => isOutermostOptionalChain, - isOverrideModifier: () => isOverrideModifier, - isPackageJsonInfo: () => isPackageJsonInfo, - isPackedArrayLiteral: () => isPackedArrayLiteral, - isParameter: () => isParameter, - isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, - isParameterPropertyModifier: () => isParameterPropertyModifier, - isParenthesizedExpression: () => isParenthesizedExpression, - isParenthesizedTypeNode: () => isParenthesizedTypeNode, - isParseTreeNode: () => isParseTreeNode, - isPartOfParameterDeclaration: () => isPartOfParameterDeclaration, - isPartOfTypeNode: () => isPartOfTypeNode, - isPartOfTypeOnlyImportOrExportDeclaration: () => isPartOfTypeOnlyImportOrExportDeclaration, - isPartOfTypeQuery: () => isPartOfTypeQuery, - isPartiallyEmittedExpression: () => isPartiallyEmittedExpression, - isPatternMatch: () => isPatternMatch, - isPinnedComment: () => isPinnedComment, - isPlainJsFile: () => isPlainJsFile, - isPlusToken: () => isPlusToken, - isPossiblyTypeArgumentPosition: () => isPossiblyTypeArgumentPosition, - isPostfixUnaryExpression: () => isPostfixUnaryExpression, - isPrefixUnaryExpression: () => isPrefixUnaryExpression, - isPrimitiveLiteralValue: () => isPrimitiveLiteralValue, - isPrivateIdentifier: () => isPrivateIdentifier, - isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration, - isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression, - isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol, - isProgramUptoDate: () => isProgramUptoDate, - isPrologueDirective: () => isPrologueDirective, - isPropertyAccessChain: () => isPropertyAccessChain, - isPropertyAccessEntityNameExpression: () => isPropertyAccessEntityNameExpression, - isPropertyAccessExpression: () => isPropertyAccessExpression, - isPropertyAccessOrQualifiedName: () => isPropertyAccessOrQualifiedName, - isPropertyAccessOrQualifiedNameOrImportTypeNode: () => isPropertyAccessOrQualifiedNameOrImportTypeNode, - isPropertyAssignment: () => isPropertyAssignment, - isPropertyDeclaration: () => isPropertyDeclaration, - isPropertyName: () => isPropertyName, - isPropertyNameLiteral: () => isPropertyNameLiteral, - isPropertySignature: () => isPropertySignature, - isPrototypeAccess: () => isPrototypeAccess, - isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, - isPunctuation: () => isPunctuation, - isPushOrUnshiftIdentifier: () => isPushOrUnshiftIdentifier, - isQualifiedName: () => isQualifiedName, - isQuestionDotToken: () => isQuestionDotToken, - isQuestionOrExclamationToken: () => isQuestionOrExclamationToken, - isQuestionOrPlusOrMinusToken: () => isQuestionOrPlusOrMinusToken, - isQuestionToken: () => isQuestionToken, - 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, - isSemicolonClassElement: () => isSemicolonClassElement, - isSetAccessor: () => isSetAccessor, - isSetAccessorDeclaration: () => isSetAccessorDeclaration, - isShiftOperatorOrHigher: () => isShiftOperatorOrHigher, - isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, - isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, - isSideEffectImport: () => isSideEffectImport, - isSignedNumericLiteral: () => isSignedNumericLiteral, - isSimpleCopiableExpression: () => isSimpleCopiableExpression, - isSimpleInlineableExpression: () => isSimpleInlineableExpression, - isSimpleParameterList: () => isSimpleParameterList, - isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, - isSolutionConfig: () => isSolutionConfig, - isSourceElement: () => isSourceElement, - isSourceFile: () => isSourceFile, - isSourceFileFromLibrary: () => isSourceFileFromLibrary, - isSourceFileJS: () => isSourceFileJS, - isSourceFileNotJson: () => isSourceFileNotJson, - isSourceMapping: () => isSourceMapping, - isSpecialPropertyDeclaration: () => isSpecialPropertyDeclaration, - isSpreadAssignment: () => isSpreadAssignment, - isSpreadElement: () => isSpreadElement, - isStatement: () => isStatement, - isStatementButNotDeclaration: () => isStatementButNotDeclaration, - isStatementOrBlock: () => isStatementOrBlock, - isStatementWithLocals: () => isStatementWithLocals, - isStatic: () => isStatic, - isStaticModifier: () => isStaticModifier, - isString: () => isString, - isStringANonContextualKeyword: () => isStringANonContextualKeyword, - isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, - isStringDoubleQuoted: () => isStringDoubleQuoted, - isStringLiteral: () => isStringLiteral, - isStringLiteralLike: () => isStringLiteralLike, - isStringLiteralOrJsxExpression: () => isStringLiteralOrJsxExpression, - isStringLiteralOrTemplate: () => isStringLiteralOrTemplate, - isStringOrNumericLiteralLike: () => isStringOrNumericLiteralLike, - isStringOrRegularExpressionOrTemplateLiteral: () => isStringOrRegularExpressionOrTemplateLiteral, - isStringTextContainingNode: () => isStringTextContainingNode, - isSuperCall: () => isSuperCall, - isSuperKeyword: () => isSuperKeyword, - 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, - 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, - isUrl: () => isUrl, - isValidBigIntString: () => isValidBigIntString, - isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, - isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, - isValueSignatureDeclaration: () => isValueSignatureDeclaration, - isVarAwaitUsing: () => isVarAwaitUsing, - isVarConst: () => isVarConst, - isVarConstLike: () => isVarConstLike, - isVarUsing: () => isVarUsing, - isVariableDeclaration: () => isVariableDeclaration, - isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, - isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, - isVariableDeclarationInitializedToRequire: () => isVariableDeclarationInitializedToRequire, - isVariableDeclarationList: () => isVariableDeclarationList, - isVariableLike: () => isVariableLike, - 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, - loadModuleFromGlobalCache: () => loadModuleFromGlobalCache, - loadWithModeAwareCache: () => loadWithModeAwareCache, - makeIdentifierFromModuleName: () => makeIdentifierFromModuleName, - makeImport: () => makeImport, - makeStringLiteral: () => makeStringLiteral, - mangleScopedPackageName: () => mangleScopedPackageName, - map: () => map, - mapAllOrFail: () => mapAllOrFail, - mapDefined: () => mapDefined, - mapDefinedIterator: () => mapDefinedIterator, - mapEntries: () => mapEntries, - mapIterator: () => mapIterator, - mapOneOrMany: () => mapOneOrMany, - mapToDisplayParts: () => mapToDisplayParts, - matchFiles: () => matchFiles, - matchPatternOrExact: () => matchPatternOrExact, - matchedText: () => matchedText, - matchesExclude: () => matchesExclude, - matchesExcludeWorker: () => matchesExcludeWorker, - maxBy: () => maxBy, - maybeBind: () => maybeBind, - maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, - memoize: () => memoize, - memoizeOne: () => memoizeOne, - min: () => min, - minAndMax: () => minAndMax, - missingFileModifiedTime: () => missingFileModifiedTime, - modifierToFlag: () => modifierToFlag, - modifiersToFlags: () => modifiersToFlags, - moduleExportNameIsDefault: () => moduleExportNameIsDefault, - moduleExportNameTextEscaped: () => moduleExportNameTextEscaped, - moduleExportNameTextUnescaped: () => moduleExportNameTextUnescaped, - moduleOptionDeclaration: () => moduleOptionDeclaration, - moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo, - moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter, - moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations, - moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports, - moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules, - moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier, - moduleSpecifiers: () => ts_moduleSpecifiers_exports, - moduleSupportsImportAttributes: () => moduleSupportsImportAttributes, - moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier, - 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, - nodeCoreModules: () => nodeCoreModules, - 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, - noop: () => noop, - noopFileWatcher: () => noopFileWatcher, - normalizePath: () => normalizePath, - normalizeSlashes: () => normalizeSlashes, - normalizeSpans: () => normalizeSpans, - 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, - or: () => or, - orderedRemoveItem: () => orderedRemoveItem, - orderedRemoveItemAt: () => orderedRemoveItemAt, - packageIdToPackageName: () => packageIdToPackageName, - packageIdToString: () => packageIdToString, - 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, - pasteEdits: () => ts_PasteEdits_exports, - patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory, - pathContainsNodeModules: () => pathContainsNodeModules, - pathIsAbsolute: () => pathIsAbsolute, - pathIsBareSpecifier: () => pathIsBareSpecifier, - pathIsRelative: () => pathIsRelative, - patternText: () => patternText, - performIncrementalCompilation: () => performIncrementalCompilation, - performance: () => ts_performance_exports, - positionBelongsToNode: () => positionBelongsToNode, - positionIsASICandidate: () => positionIsASICandidate, - positionIsSynthesized: () => positionIsSynthesized, - positionsAreOnSameLine: () => positionsAreOnSameLine, - preProcessFile: () => preProcessFile, - probablyUsesSemicolons: () => probablyUsesSemicolons, - processCommentPragmas: () => processCommentPragmas, - processPragmasIntoFields: () => processPragmasIntoFields, - processTaggedTemplateExpression: () => processTaggedTemplateExpression, - programContainsEsModules: () => programContainsEsModules, - programContainsModules: () => programContainsModules, - projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, - 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, - readJson: () => readJson, - readJsonConfigFile: () => readJsonConfigFile, - readJsonOrUndefined: () => readJsonOrUndefined, - reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, - reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, - reduceLeft: () => reduceLeft, - reduceLeftIterator: () => reduceLeftIterator, - reducePathComponents: () => reducePathComponents, - refactor: () => ts_refactor_exports, - regExpEscape: () => regExpEscape, - regularExpressionFlagToCharacterCode: () => regularExpressionFlagToCharacterCode, - relativeComplement: () => relativeComplement, - removeAllComments: () => removeAllComments, - removeEmitHelper: () => removeEmitHelper, - removeExtension: () => removeExtension, - removeFileExtension: () => removeFileExtension, - removeIgnoredPath: () => removeIgnoredPath, - removeMinAndVersionNumbers: () => removeMinAndVersionNumbers, - 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, - returnFalse: () => returnFalse, - returnNoopFileWatcher: () => returnNoopFileWatcher, - returnTrue: () => returnTrue, - returnUndefined: () => returnUndefined, - returnsPromise: () => returnsPromise, - rewriteModuleSpecifier: () => rewriteModuleSpecifier, - sameFlatMap: () => sameFlatMap, - sameMap: () => sameMap, - sameMapping: () => sameMapping, - scanTokenAtPosition: () => scanTokenAtPosition, - scanner: () => scanner, - semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, - serializeCompilerOptions: () => serializeCompilerOptions, - server: () => ts_server_exports4, - servicesVersion: () => servicesVersion, - setCommentRange: () => setCommentRange, - setConfigFileInOptions: () => setConfigFileInOptions, - setConstantValue: () => setConstantValue, - setEmitFlags: () => setEmitFlags, - setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, - setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, - setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, - setIdentifierTypeArguments: () => setIdentifierTypeArguments, - setInternalEmitFlags: () => setInternalEmitFlags, - setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, - setNodeChildren: () => setNodeChildren, - 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, - shouldRewriteModuleSpecifier: () => shouldRewriteModuleSpecifier, - shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, - showModuleSpecifier: () => showModuleSpecifier, - signatureHasRestParameter: () => signatureHasRestParameter, - signatureToDisplayParts: () => signatureToDisplayParts, - single: () => single, - singleElementArray: () => singleElementArray, - singleIterator: () => singleIterator, - singleOrMany: () => singleOrMany, - singleOrUndefined: () => singleOrUndefined, - skipAlias: () => skipAlias, - skipConstraint: () => skipConstraint, - skipOuterExpressions: () => skipOuterExpressions, - skipParentheses: () => skipParentheses, - skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions, - skipTrivia: () => skipTrivia, - skipTypeChecking: () => skipTypeChecking, - skipTypeCheckingIgnoringNoCheck: () => skipTypeCheckingIgnoringNoCheck, - skipTypeParentheses: () => skipTypeParentheses, - skipWhile: () => skipWhile, - sliceAfter: () => sliceAfter, - some: () => some, - sortAndDeduplicate: () => sortAndDeduplicate, - sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics, - sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions, - sourceFileMayBeEmitted: () => sourceFileMayBeEmitted, - sourceMapCommentRegExp: () => sourceMapCommentRegExp, - sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart, - spacePart: () => spacePart, - spanMap: () => spanMap, - startEndContainsRange: () => startEndContainsRange, - startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd, - startOnNewLine: () => startOnNewLine, - startTracing: () => startTracing, - startsWith: () => startsWith, - startsWithDirectory: () => startsWithDirectory, - startsWithUnderscore: () => startsWithUnderscore, - startsWithUseStrict: () => startsWithUseStrict, - stringContainsAt: () => stringContainsAt, - stringToToken: () => stringToToken, - stripQuotes: () => stripQuotes, - supportedDeclarationExtensions: () => supportedDeclarationExtensions, - supportedJSExtensionsFlat: () => supportedJSExtensionsFlat, - supportedLocaleDirectories: () => supportedLocaleDirectories, - supportedTSExtensionsFlat: () => supportedTSExtensionsFlat, - supportedTSImplementationExtensions: () => supportedTSImplementationExtensions, - suppressLeadingAndTrailingTrivia: () => suppressLeadingAndTrailingTrivia, - suppressLeadingTrivia: () => suppressLeadingTrivia, - suppressTrailingTrivia: () => suppressTrailingTrivia, - symbolEscapedNameNoDefault: () => symbolEscapedNameNoDefault, - symbolName: () => symbolName, - symbolNameNoDefault: () => symbolNameNoDefault, - symbolToDisplayParts: () => symbolToDisplayParts, - sys: () => sys, - sysLog: () => sysLog, - tagNamesAreEquivalent: () => tagNamesAreEquivalent, - takeWhile: () => takeWhile, - targetOptionDeclaration: () => targetOptionDeclaration, - targetToLibMap: () => targetToLibMap, - testFormatSettings: () => testFormatSettings, - textChangeRangeIsUnchanged: () => textChangeRangeIsUnchanged, - textChangeRangeNewSpan: () => textChangeRangeNewSpan, - textChanges: () => ts_textChanges_exports, - textOrKeywordPart: () => textOrKeywordPart, - textPart: () => textPart, - textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive, - textRangeContainsTextSpan: () => textRangeContainsTextSpan, - textRangeIntersectsWithTextSpan: () => textRangeIntersectsWithTextSpan, - textSpanContainsPosition: () => textSpanContainsPosition, - textSpanContainsTextRange: () => textSpanContainsTextRange, - 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, - toPath: () => toPath, - toProgramEmitPending: () => toProgramEmitPending, - toSorted: () => toSorted, - tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword, - tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan, - tokenToString: () => tokenToString, - trace: () => trace, - tracing: () => tracing, - tracingEnabled: () => tracingEnabled, - transferSourceFileChildren: () => transferSourceFileChildren, - transform: () => transform, - transformClassFields: () => transformClassFields, - transformDeclarations: () => transformDeclarations, - transformECMAScriptModule: () => transformECMAScriptModule, - transformES2015: () => transformES2015, - transformES2016: () => transformES2016, - transformES2017: () => transformES2017, - transformES2018: () => transformES2018, - transformES2019: () => transformES2019, - transformES2020: () => transformES2020, - transformES2021: () => transformES2021, - transformESDecorators: () => transformESDecorators, - transformESNext: () => transformESNext, - transformGenerators: () => transformGenerators, - transformImpliedNodeFormatDependentModule: () => transformImpliedNodeFormatDependentModule, - transformJsx: () => transformJsx, - transformLegacyDecorators: () => transformLegacyDecorators, - transformModule: () => transformModule, - transformNamedEvaluation: () => transformNamedEvaluation, - transformNodes: () => transformNodes, - transformSystemModule: () => transformSystemModule, - transformTypeScript: () => transformTypeScript, - transpile: () => transpile, - transpileDeclaration: () => transpileDeclaration, - 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, - tryParseJson: () => tryParseJson, - tryParsePattern: () => tryParsePattern, - tryParsePatterns: () => tryParsePatterns, - tryParseRawSourceMap: () => tryParseRawSourceMap, - tryReadDirectory: () => tryReadDirectory, - tryReadFile: () => tryReadFile, - tryRemoveDirectoryPrefix: () => tryRemoveDirectoryPrefix, - tryRemoveExtension: () => tryRemoveExtension, - tryRemovePrefix: () => tryRemovePrefix, - tryRemoveSuffix: () => tryRemoveSuffix, - tscBuildOption: () => tscBuildOption, - typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, - typeAliasNamePart: () => typeAliasNamePart, - typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, - typeKeywords: () => typeKeywords, - typeParameterNamePart: () => typeParameterNamePart, - typeToDisplayParts: () => typeToDisplayParts, - unchangedPollThresholds: () => unchangedPollThresholds, - unchangedTextChangeRange: () => unchangedTextChangeRange, - unescapeLeadingUnderscores: () => unescapeLeadingUnderscores, - unmangleScopedPackageName: () => unmangleScopedPackageName, - unorderedRemoveItem: () => unorderedRemoveItem, - unprefixedNodeCoreModules: () => unprefixedNodeCoreModules, - unreachableCodeIsError: () => unreachableCodeIsError, - unsetNodeChildren: () => unsetNodeChildren, - unusedLabelIsError: () => unusedLabelIsError, - unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - unwrapParenthesizedExpression: () => unwrapParenthesizedExpression, - updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updateResolutionField: () => updateResolutionField, - updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateSourceFile: () => updateSourceFile, - updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - usingSingleLineStringWriter: () => usingSingleLineStringWriter, - utf16EncodeAsString: () => utf16EncodeAsString, - validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage, - version: () => version, - versionMajorMinor: () => versionMajorMinor, - visitArray: () => visitArray, - visitCommaListElements: () => visitCommaListElements, - visitEachChild: () => visitEachChild, - visitFunctionBody: () => visitFunctionBody, - visitIterationBody: () => visitIterationBody, - visitLexicalEnvironment: () => visitLexicalEnvironment, - visitNode: () => visitNode, - visitNodes: () => visitNodes2, - visitParameterList: () => visitParameterList, - walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, - walkUpOuterExpressions: () => walkUpOuterExpressions, - walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, - walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, - walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, - whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp, - writeCommentRange: () => writeCommentRange, - writeFile: () => writeFile, - writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, - zipWith: () => zipWith -}); -module.exports = __toCommonJS(typescript_exports); - -// src/compiler/corePublic.ts -var versionMajorMinor = "5.9"; -var version = "5.9.2"; -var Comparison = /* @__PURE__ */ ((Comparison3) => { - Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; - Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; - Comparison3[Comparison3["GreaterThan"] = 1] = "GreaterThan"; - return Comparison3; -})(Comparison || {}); - -// src/compiler/core.ts -var emptyArray = []; -var emptyMap = /* @__PURE__ */ new Map(); -function length(array) { - return array !== void 0 ? array.length : 0; -} -function forEach(array, callback) { - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const result = callback(array[i], i); - if (result) { - return result; - } - } - } - return void 0; -} -function forEachRight(array, callback) { - if (array !== void 0) { - for (let i = array.length - 1; i >= 0; i--) { - const result = callback(array[i], i); - if (result) { - return result; - } - } - } - return void 0; -} -function firstDefined(array, callback) { - if (array === void 0) { - return void 0; - } - for (let i = 0; i < array.length; i++) { - const result = callback(array[i], i); - if (result !== void 0) { - return result; - } - } - return void 0; -} -function firstDefinedIterator(iter, callback) { - for (const value of iter) { - const result = callback(value); - if (result !== void 0) { - return result; - } - } - return void 0; -} -function reduceLeftIterator(iterator, f, initial) { - let result = initial; - if (iterator) { - let pos = 0; - for (const value of iterator) { - result = f(result, value, pos); - pos++; - } - } - return result; -} -function zipWith(arrayA, arrayB, callback) { - const result = []; - Debug.assertEqual(arrayA.length, arrayB.length); - for (let i = 0; i < arrayA.length; i++) { - result.push(callback(arrayA[i], arrayB[i], i)); - } - return result; -} -function intersperse(input, element) { - if (input.length <= 1) { - return input; - } - const result = []; - for (let i = 0, n = input.length; i < n; i++) { - if (i !== 0) result.push(element); - result.push(input[i]); - } - return result; -} -function every(array, callback) { - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - if (!callback(array[i], i)) { - return false; - } - } - } - return true; -} -function find(array, predicate, startIndex) { - if (array === void 0) return void 0; - for (let i = startIndex ?? 0; i < array.length; i++) { - const value = array[i]; - if (predicate(value, i)) { - return value; - } - } - return void 0; -} -function findLast(array, predicate, startIndex) { - if (array === void 0) return void 0; - for (let i = startIndex ?? array.length - 1; i >= 0; i--) { - const value = array[i]; - if (predicate(value, i)) { - return value; - } - } - return void 0; -} -function findIndex(array, predicate, startIndex) { - if (array === void 0) return -1; - for (let i = startIndex ?? 0; i < array.length; i++) { - if (predicate(array[i], i)) { - return i; - } - } - return -1; -} -function findLastIndex(array, predicate, startIndex) { - if (array === void 0) return -1; - for (let i = startIndex ?? array.length - 1; i >= 0; i--) { - if (predicate(array[i], i)) { - return i; - } - } - return -1; -} -function contains(array, value, equalityComparer = equateValues) { - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - if (equalityComparer(array[i], value)) { - return true; - } - } - } - return false; -} -function indexOfAnyCharCode(text, charCodes, start) { - for (let i = start ?? 0; i < text.length; i++) { - if (contains(charCodes, text.charCodeAt(i))) { - return i; - } - } - return -1; -} -function countWhere(array, predicate) { - let count = 0; - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const v = array[i]; - if (predicate(v, i)) { - count++; - } - } - } - return count; -} -function filter(array, f) { - if (array !== void 0) { - const len = array.length; - let i = 0; - while (i < len && f(array[i])) i++; - if (i < len) { - const result = array.slice(0, i); - i++; - while (i < len) { - const item = array[i]; - if (f(item)) { - result.push(item); - } - i++; - } - return result; - } - } - return array; -} -function filterMutate(array, f) { - let outIndex = 0; - for (let i = 0; i < array.length; i++) { - if (f(array[i], i, array)) { - array[outIndex] = array[i]; - outIndex++; - } - } - array.length = outIndex; -} -function clear(array) { - array.length = 0; -} -function map(array, f) { - let result; - if (array !== void 0) { - result = []; - for (let i = 0; i < array.length; i++) { - result.push(f(array[i], i)); - } - } - return result; -} -function* mapIterator(iter, mapFn) { - for (const x of iter) { - yield mapFn(x); - } -} -function sameMap(array, f) { - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const item = array[i]; - const mapped = f(item, i); - if (item !== mapped) { - const result = array.slice(0, i); - result.push(mapped); - for (i++; i < array.length; i++) { - result.push(f(array[i], i)); - } - return result; - } - } - } - return array; -} -function flatten(array) { - const result = []; - for (let i = 0; i < array.length; i++) { - const v = array[i]; - if (v) { - if (isArray(v)) { - addRange(result, v); - } else { - result.push(v); - } - } - } - return result; -} -function flatMap(array, mapfn) { - let result; - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const v = mapfn(array[i], i); - if (v) { - if (isArray(v)) { - result = addRange(result, v); - } else { - result = append(result, v); - } - } - } - } - return result ?? emptyArray; -} -function flatMapToMutable(array, mapfn) { - const result = []; - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const v = mapfn(array[i], i); - if (v) { - if (isArray(v)) { - addRange(result, v); - } else { - result.push(v); - } - } - } - } - return result; -} -function* flatMapIterator(iter, mapfn) { - for (const x of iter) { - const iter2 = mapfn(x); - if (!iter2) continue; - yield* iter2; - } -} -function sameFlatMap(array, mapfn) { - let result; - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const item = array[i]; - const mapped = mapfn(item, i); - if (result || item !== mapped || isArray(mapped)) { - if (!result) { - result = array.slice(0, i); - } - if (isArray(mapped)) { - addRange(result, mapped); - } else { - result.push(mapped); - } - } - } - } - return result ?? array; -} -function mapAllOrFail(array, mapFn) { - const result = []; - for (let i = 0; i < array.length; i++) { - const mapped = mapFn(array[i], i); - if (mapped === void 0) { - return void 0; - } - result.push(mapped); - } - return result; -} -function mapDefined(array, mapFn) { - const result = []; - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const mapped = mapFn(array[i], i); - if (mapped !== void 0) { - result.push(mapped); - } - } - } - return result; -} -function* mapDefinedIterator(iter, mapFn) { - for (const x of iter) { - const value = mapFn(x); - if (value !== void 0) { - yield value; - } - } -} -function getOrUpdate(map2, key, callback) { - if (map2.has(key)) { - return map2.get(key); - } - const value = callback(); - map2.set(key, value); - return value; -} -function tryAddToSet(set, value) { - if (!set.has(value)) { - set.add(value); - return true; - } - return false; -} -function* singleIterator(value) { - yield value; -} -function spanMap(array, keyfn, mapfn) { - let result; - if (array !== void 0) { - result = []; - const len = array.length; - let previousKey; - let key; - let start = 0; - let pos = 0; - while (start < len) { - while (pos < len) { - const value = array[pos]; - key = keyfn(value, pos); - if (pos === 0) { - previousKey = key; - } else if (key !== previousKey) { - break; - } - pos++; - } - if (start < pos) { - const v = mapfn(array.slice(start, pos), previousKey, start, pos); - if (v) { - result.push(v); - } - start = pos; - } - previousKey = key; - pos++; - } - } - return result; -} -function mapEntries(map2, f) { - if (map2 === void 0) { - return void 0; - } - const result = /* @__PURE__ */ new Map(); - map2.forEach((value, key) => { - const [newKey, newValue] = f(key, value); - result.set(newKey, newValue); - }); - return result; -} -function some(array, predicate) { - if (array !== void 0) { - if (predicate !== void 0) { - for (let i = 0; i < array.length; i++) { - if (predicate(array[i])) { - return true; - } - } - } else { - return array.length > 0; - } - } - return false; -} -function getRangesWhere(arr, pred, cb) { - let start; - for (let i = 0; i < arr.length; i++) { - if (pred(arr[i])) { - start = start === void 0 ? i : start; - } else { - if (start !== void 0) { - cb(start, i); - start = void 0; - } - } - } - if (start !== void 0) cb(start, arr.length); -} -function concatenate(array1, array2) { - if (array2 === void 0 || array2.length === 0) return array1; - if (array1 === void 0 || array1.length === 0) return array2; - return [...array1, ...array2]; -} -function selectIndex(_, i) { - return i; -} -function indicesOf(array) { - return array.map(selectIndex); -} -function deduplicateRelational(array, equalityComparer, comparer) { - const indices = indicesOf(array); - stableSortIndices(array, indices, comparer); - let last2 = array[indices[0]]; - const deduplicated = [indices[0]]; - for (let i = 1; i < indices.length; i++) { - const index = indices[i]; - const item = array[index]; - if (!equalityComparer(last2, item)) { - deduplicated.push(index); - last2 = item; - } - } - deduplicated.sort(); - return deduplicated.map((i) => array[i]); -} -function deduplicateEquality(array, equalityComparer) { - const result = []; - for (let i = 0; i < array.length; i++) { - pushIfUnique(result, array[i], equalityComparer); - } - return result; -} -function deduplicate(array, equalityComparer, comparer) { - return array.length === 0 ? [] : array.length === 1 ? array.slice() : comparer ? deduplicateRelational(array, equalityComparer, comparer) : deduplicateEquality(array, equalityComparer); -} -function deduplicateSorted(array, comparer) { - if (array.length === 0) return emptyArray; - let last2 = array[0]; - const deduplicated = [last2]; - for (let i = 1; i < array.length; i++) { - const next = array[i]; - switch (comparer(next, last2)) { - // equality comparison - case true: - // relational comparison - // falls through - case 0 /* EqualTo */: - continue; - case -1 /* LessThan */: - return Debug.fail("Array is unsorted."); - } - deduplicated.push(last2 = next); - } - return deduplicated; -} -function createSortedArray() { - return []; -} -function insertSorted(array, insert, compare, equalityComparer, allowDuplicates) { - if (array.length === 0) { - array.push(insert); - return true; - } - const insertIndex = binarySearch(array, insert, identity, compare); - if (insertIndex < 0) { - if (equalityComparer && !allowDuplicates) { - const idx = ~insertIndex; - if (idx > 0 && equalityComparer(insert, array[idx - 1])) { - return false; - } - if (idx < array.length && equalityComparer(insert, array[idx])) { - array.splice(idx, 1, insert); - return true; - } - } - array.splice(~insertIndex, 0, insert); - return true; - } - if (allowDuplicates) { - array.splice(insertIndex, 0, insert); - return true; - } - return false; -} -function sortAndDeduplicate(array, comparer, equalityComparer) { - return deduplicateSorted(toSorted(array, comparer), equalityComparer ?? comparer ?? compareStringsCaseSensitive); -} -function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) { - if (array1 === void 0 || array2 === void 0) { - return array1 === array2; - } - if (array1.length !== array2.length) { - return false; - } - for (let i = 0; i < array1.length; i++) { - if (!equalityComparer(array1[i], array2[i], i)) { - return false; - } - } - return true; -} -function compact(array) { - let result; - if (array !== void 0) { - for (let i = 0; i < array.length; i++) { - const v = array[i]; - if (result ?? !v) { - result ?? (result = array.slice(0, i)); - if (v) { - result.push(v); - } - } - } - } - return result ?? array; -} -function relativeComplement(arrayA, arrayB, comparer) { - if (!arrayB || !arrayA || arrayB.length === 0 || arrayA.length === 0) return arrayB; - const result = []; - loopB: - for (let offsetA = 0, offsetB = 0; offsetB < arrayB.length; offsetB++) { - if (offsetB > 0) { - Debug.assertGreaterThanOrEqual(comparer(arrayB[offsetB], arrayB[offsetB - 1]), 0 /* EqualTo */); - } - loopA: - for (const startA = offsetA; offsetA < arrayA.length; offsetA++) { - if (offsetA > startA) { - Debug.assertGreaterThanOrEqual(comparer(arrayA[offsetA], arrayA[offsetA - 1]), 0 /* EqualTo */); - } - switch (comparer(arrayB[offsetB], arrayA[offsetA])) { - case -1 /* LessThan */: - result.push(arrayB[offsetB]); - continue loopB; - case 0 /* EqualTo */: - continue loopB; - case 1 /* GreaterThan */: - continue loopA; - } - } - } - return result; -} -function append(to, value) { - if (value === void 0) return to; - if (to === void 0) return [value]; - to.push(value); - return to; -} -function combine(xs, ys) { - if (xs === void 0) return ys; - if (ys === void 0) return xs; - if (isArray(xs)) return isArray(ys) ? concatenate(xs, ys) : append(xs, ys); - if (isArray(ys)) return append(ys, xs); - return [xs, ys]; -} -function toOffset(array, offset) { - return offset < 0 ? array.length + offset : offset; -} -function addRange(to, from, start, end) { - if (from === void 0 || from.length === 0) return to; - if (to === void 0) return from.slice(start, end); - start = start === void 0 ? 0 : toOffset(from, start); - end = end === void 0 ? from.length : toOffset(from, end); - for (let i = start; i < end && i < from.length; i++) { - if (from[i] !== void 0) { - to.push(from[i]); - } - } - return to; -} -function pushIfUnique(array, toAdd, equalityComparer) { - if (contains(array, toAdd, equalityComparer)) { - return false; - } else { - array.push(toAdd); - return true; - } -} -function appendIfUnique(array, toAdd, equalityComparer) { - if (array !== void 0) { - pushIfUnique(array, toAdd, equalityComparer); - return array; - } else { - return [toAdd]; - } -} -function stableSortIndices(array, indices, comparer) { - indices.sort((x, y) => comparer(array[x], array[y]) || compareValues(x, y)); -} -function toSorted(array, comparer) { - return array.length === 0 ? emptyArray : array.slice().sort(comparer); -} -function* arrayReverseIterator(array) { - for (let i = array.length - 1; i >= 0; i--) { - yield array[i]; - } -} -function rangeEquals(array1, array2, pos, end) { - while (pos < end) { - if (array1[pos] !== array2[pos]) { - return false; - } - pos++; - } - return true; -} -var elementAt = !!Array.prototype.at ? (array, offset) => array == null ? void 0 : array.at(offset) : (array, offset) => { - if (array !== void 0) { - offset = toOffset(array, offset); - if (offset < array.length) { - return array[offset]; - } - } - return void 0; -}; -function firstOrUndefined(array) { - return array === void 0 || array.length === 0 ? void 0 : array[0]; -} -function firstOrUndefinedIterator(iter) { - if (iter !== void 0) { - for (const value of iter) { - return value; - } - } - return void 0; -} -function first(array) { - Debug.assert(array.length !== 0); - return array[0]; -} -function firstIterator(iter) { - for (const value of iter) { - return value; - } - Debug.fail("iterator is empty"); -} -function lastOrUndefined(array) { - return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1]; -} -function last(array) { - Debug.assert(array.length !== 0); - return array[array.length - 1]; -} -function singleOrUndefined(array) { - return array !== void 0 && array.length === 1 ? array[0] : void 0; -} -function single(array) { - return Debug.checkDefined(singleOrUndefined(array)); -} -function singleOrMany(array) { - return array !== void 0 && array.length === 1 ? array[0] : array; -} -function replaceElement(array, index, value) { - const result = array.slice(0); - result[index] = value; - return result; -} -function binarySearch(array, value, keySelector, keyComparer, offset) { - return binarySearchKey(array, keySelector(value), keySelector, keyComparer, offset); -} -function binarySearchKey(array, key, keySelector, keyComparer, offset) { - if (!some(array)) { - return -1; - } - let low = offset ?? 0; - let high = array.length - 1; - while (low <= high) { - const middle = low + (high - low >> 1); - const midKey = keySelector(array[middle], middle); - switch (keyComparer(midKey, key)) { - case -1 /* LessThan */: - low = middle + 1; - break; - case 0 /* EqualTo */: - return middle; - case 1 /* GreaterThan */: - high = middle - 1; - break; - } - } - return ~low; -} -function reduceLeft(array, f, initial, start, count) { - if (array && array.length > 0) { - const size = array.length; - if (size > 0) { - let pos = start === void 0 || start < 0 ? 0 : start; - const end = count === void 0 || pos + count > size - 1 ? size - 1 : pos + count; - let result; - if (arguments.length <= 2) { - result = array[pos]; - pos++; - } else { - result = initial; - } - while (pos <= end) { - result = f(result, array[pos], pos); - pos++; - } - return result; - } - } - return initial; -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -function hasProperty(map2, key) { - return hasOwnProperty.call(map2, key); -} -function getProperty(map2, key) { - return hasOwnProperty.call(map2, key) ? map2[key] : void 0; -} -function getOwnKeys(map2) { - const keys = []; - for (const key in map2) { - if (hasOwnProperty.call(map2, key)) { - keys.push(key); - } - } - return keys; -} -function getAllKeys(obj) { - const result = []; - do { - const names = Object.getOwnPropertyNames(obj); - for (const name of names) { - pushIfUnique(result, name); - } - } while (obj = Object.getPrototypeOf(obj)); - return result; -} -function getOwnValues(collection) { - const values = []; - for (const key in collection) { - if (hasOwnProperty.call(collection, key)) { - values.push(collection[key]); - } - } - return values; -} -function arrayOf(count, f) { - const result = new Array(count); - for (let i = 0; i < count; i++) { - result[i] = f(i); - } - return result; -} -function arrayFrom(iterator, map2) { - const result = []; - for (const value of iterator) { - result.push(map2 ? map2(value) : value); - } - return result; -} -function assign(t, ...args) { - for (const arg of args) { - if (arg === void 0) continue; - for (const p in arg) { - if (hasProperty(arg, p)) { - t[p] = arg[p]; - } - } - } - return t; -} -function equalOwnProperties(left, right, equalityComparer = equateValues) { - if (left === right) return true; - if (!left || !right) return false; - for (const key in left) { - if (hasOwnProperty.call(left, key)) { - if (!hasOwnProperty.call(right, key)) return false; - if (!equalityComparer(left[key], right[key])) return false; - } - } - for (const key in right) { - if (hasOwnProperty.call(right, key)) { - if (!hasOwnProperty.call(left, key)) return false; - } - } - return true; -} -function arrayToMap(array, makeKey, makeValue = identity) { - const result = /* @__PURE__ */ new Map(); - for (let i = 0; i < array.length; i++) { - const value = array[i]; - const key = makeKey(value); - if (key !== void 0) result.set(key, makeValue(value)); - } - return result; -} -function arrayToNumericMap(array, makeKey, makeValue = identity) { - const result = []; - for (let i = 0; i < array.length; i++) { - const value = array[i]; - result[makeKey(value)] = makeValue(value); - } - return result; -} -function arrayToMultiMap(values, makeKey, makeValue = identity) { - const result = createMultiMap(); - for (let i = 0; i < values.length; i++) { - const value = values[i]; - result.add(makeKey(value), makeValue(value)); - } - return result; -} -function group(values, getGroupId, resultSelector = identity) { - return arrayFrom(arrayToMultiMap(values, getGroupId).values(), resultSelector); -} -function groupBy(values, keySelector) { - const result = {}; - if (values !== void 0) { - for (let i = 0; i < values.length; i++) { - const value = values[i]; - const key = `${keySelector(value)}`; - const array = result[key] ?? (result[key] = []); - array.push(value); - } - } - return result; -} -function clone(object) { - const result = {}; - for (const id in object) { - if (hasOwnProperty.call(object, id)) { - result[id] = object[id]; - } - } - return result; -} -function extend(first2, second) { - const result = {}; - for (const id in second) { - if (hasOwnProperty.call(second, id)) { - result[id] = second[id]; - } - } - for (const id in first2) { - if (hasOwnProperty.call(first2, id)) { - result[id] = first2[id]; - } - } - return result; -} -function copyProperties(first2, second) { - for (const id in second) { - if (hasOwnProperty.call(second, id)) { - first2[id] = second[id]; - } - } -} -function maybeBind(obj, fn) { - return fn == null ? void 0 : fn.bind(obj); -} -function createMultiMap() { - const map2 = /* @__PURE__ */ new Map(); - map2.add = multiMapAdd; - map2.remove = multiMapRemove; - return map2; -} -function multiMapAdd(key, value) { - let values = this.get(key); - if (values !== void 0) { - values.push(value); - } else { - this.set(key, values = [value]); - } - return values; -} -function multiMapRemove(key, value) { - const values = this.get(key); - if (values !== void 0) { - unorderedRemoveItem(values, value); - if (!values.length) { - this.delete(key); - } - } -} -function createQueue(items) { - const elements = (items == null ? void 0 : items.slice()) ?? []; - let headIndex = 0; - function isEmpty() { - return headIndex === elements.length; - } - function enqueue(...items2) { - elements.push(...items2); - } - function dequeue() { - if (isEmpty()) { - throw new Error("Queue is empty"); - } - const result = elements[headIndex]; - elements[headIndex] = void 0; - headIndex++; - if (headIndex > 100 && headIndex > elements.length >> 1) { - const newLength = elements.length - headIndex; - elements.copyWithin( - /*target*/ - 0, - /*start*/ - headIndex - ); - elements.length = newLength; - headIndex = 0; - } - return result; - } - return { - enqueue, - dequeue, - isEmpty - }; -} -function createSet(getHashCode, equals) { - const multiMap = /* @__PURE__ */ new Map(); - let size = 0; - function* getElementIterator() { - for (const value of multiMap.values()) { - if (isArray(value)) { - yield* value; - } else { - yield value; - } - } - } - const set = { - has(element) { - const hash = getHashCode(element); - if (!multiMap.has(hash)) return false; - const candidates = multiMap.get(hash); - if (isArray(candidates)) return contains(candidates, element, equals); - return equals(candidates, element); - }, - add(element) { - const hash = getHashCode(element); - if (multiMap.has(hash)) { - const values = multiMap.get(hash); - if (isArray(values)) { - if (!contains(values, element, equals)) { - values.push(element); - size++; - } - } else { - const value = values; - if (!equals(value, element)) { - multiMap.set(hash, [value, element]); - size++; - } - } - } else { - multiMap.set(hash, element); - size++; - } - return this; - }, - delete(element) { - const hash = getHashCode(element); - if (!multiMap.has(hash)) return false; - const candidates = multiMap.get(hash); - if (isArray(candidates)) { - for (let i = 0; i < candidates.length; i++) { - if (equals(candidates[i], element)) { - if (candidates.length === 1) { - multiMap.delete(hash); - } else if (candidates.length === 2) { - multiMap.set(hash, candidates[1 - i]); - } else { - unorderedRemoveItemAt(candidates, i); - } - size--; - return true; - } - } - } else { - const candidate = candidates; - if (equals(candidate, element)) { - multiMap.delete(hash); - size--; - return true; - } - } - return false; - }, - clear() { - multiMap.clear(); - size = 0; - }, - get size() { - return size; - }, - forEach(action) { - for (const elements of arrayFrom(multiMap.values())) { - if (isArray(elements)) { - for (const element of elements) { - action(element, element, set); - } - } else { - const element = elements; - action(element, element, set); - } - } - }, - keys() { - return getElementIterator(); - }, - values() { - return getElementIterator(); - }, - *entries() { - for (const value of getElementIterator()) { - yield [value, value]; - } - }, - [Symbol.iterator]: () => { - return getElementIterator(); - }, - [Symbol.toStringTag]: multiMap[Symbol.toStringTag] - }; - return set; -} -function isArray(value) { - return Array.isArray(value); -} -function toArray(value) { - return isArray(value) ? value : [value]; -} -function isString(text) { - return typeof text === "string"; -} -function isNumber(x) { - return typeof x === "number"; -} -function tryCast(value, test) { - return value !== void 0 && test(value) ? value : void 0; -} -function cast(value, test) { - if (value !== void 0 && test(value)) return value; - return Debug.fail(`Invalid cast. The supplied value ${value} did not pass the test '${Debug.getFunctionName(test)}'.`); -} -function noop(_) { -} -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} -function returnUndefined() { - return void 0; -} -function identity(x) { - return x; -} -function toLowerCase(x) { - return x.toLowerCase(); -} -var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g; -function toFileNameLowerCase(x) { - return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x; -} -function notImplemented() { - throw new Error("Not implemented"); -} -function memoize(callback) { - let value; - return () => { - if (callback) { - value = callback(); - callback = void 0; - } - return value; - }; -} -function memoizeOne(callback) { - const map2 = /* @__PURE__ */ new Map(); - return (arg) => { - const key = `${typeof arg}:${arg}`; - let value = map2.get(key); - if (value === void 0 && !map2.has(key)) { - value = callback(arg); - map2.set(key, value); - } - return value; - }; -} -var AssertionLevel = /* @__PURE__ */ ((AssertionLevel2) => { - AssertionLevel2[AssertionLevel2["None"] = 0] = "None"; - AssertionLevel2[AssertionLevel2["Normal"] = 1] = "Normal"; - AssertionLevel2[AssertionLevel2["Aggressive"] = 2] = "Aggressive"; - AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive"; - return AssertionLevel2; -})(AssertionLevel || {}); -function equateValues(a, b) { - return a === b; -} -function equateStringsCaseInsensitive(a, b) { - return a === b || a !== void 0 && b !== void 0 && a.toUpperCase() === b.toUpperCase(); -} -function equateStringsCaseSensitive(a, b) { - return equateValues(a, b); -} -function compareComparableValues(a, b) { - return a === b ? 0 /* EqualTo */ : a === void 0 ? -1 /* LessThan */ : b === void 0 ? 1 /* GreaterThan */ : a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; -} -function compareValues(a, b) { - return compareComparableValues(a, b); -} -function compareTextSpans(a, b) { - return compareValues(a == null ? void 0 : a.start, b == null ? void 0 : b.start) || compareValues(a == null ? void 0 : a.length, b == null ? void 0 : b.length); -} -function maxBy(arr, init, mapper) { - for (let i = 0; i < arr.length; i++) { - init = Math.max(init, mapper(arr[i])); - } - return init; -} -function min(items, compare) { - return reduceLeft(items, (x, y) => compare(x, y) === -1 /* LessThan */ ? x : y); -} -function compareStringsCaseInsensitive(a, b) { - if (a === b) return 0 /* EqualTo */; - if (a === void 0) return -1 /* LessThan */; - if (b === void 0) return 1 /* GreaterThan */; - a = a.toUpperCase(); - b = b.toUpperCase(); - return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */; -} -function compareStringsCaseInsensitiveEslintCompatible(a, b) { - if (a === b) return 0 /* EqualTo */; - if (a === void 0) return -1 /* LessThan */; - if (b === void 0) return 1 /* GreaterThan */; - a = a.toLowerCase(); - b = b.toLowerCase(); - return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */; -} -function compareStringsCaseSensitive(a, b) { - return compareComparableValues(a, b); -} -function getStringComparer(ignoreCase) { - return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive; -} -var createUIStringComparer = /* @__PURE__ */ (() => { - return createIntlCollatorStringComparer; - function compareWithCallback(a, b, comparer) { - if (a === b) return 0 /* EqualTo */; - if (a === void 0) return -1 /* LessThan */; - if (b === void 0) return 1 /* GreaterThan */; - const value = comparer(a, b); - return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; - } - function createIntlCollatorStringComparer(locale) { - const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant", numeric: true }).compare; - return (a, b) => compareWithCallback(a, b, comparer); - } -})(); -var uiComparerCaseSensitive; -var uiLocale; -function getUILocale() { - return uiLocale; -} -function setUILocale(value) { - if (uiLocale !== value) { - uiLocale = value; - uiComparerCaseSensitive = void 0; - } -} -function compareStringsCaseSensitiveUI(a, b) { - uiComparerCaseSensitive ?? (uiComparerCaseSensitive = createUIStringComparer(uiLocale)); - return uiComparerCaseSensitive(a, b); -} -function compareProperties(a, b, key, comparer) { - return a === b ? 0 /* EqualTo */ : a === void 0 ? -1 /* LessThan */ : b === void 0 ? 1 /* GreaterThan */ : comparer(a[key], b[key]); -} -function compareBooleans(a, b) { - return compareValues(a ? 1 : 0, b ? 1 : 0); -} -function getSpellingSuggestion(name, candidates, getName) { - const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34)); - let bestDistance = Math.floor(name.length * 0.4) + 1; - let bestCandidate; - for (const candidate of candidates) { - const candidateName = getName(candidate); - if (candidateName !== void 0 && Math.abs(candidateName.length - name.length) <= maximumLengthDifference) { - if (candidateName === name) { - continue; - } - if (candidateName.length < 3 && candidateName.toLowerCase() !== name.toLowerCase()) { - continue; - } - const distance = levenshteinWithMax(name, candidateName, bestDistance - 0.1); - if (distance === void 0) { - continue; - } - Debug.assert(distance < bestDistance); - bestDistance = distance; - bestCandidate = candidate; - } - } - return bestCandidate; -} -function levenshteinWithMax(s1, s2, max) { - let previous = new Array(s2.length + 1); - let current = new Array(s2.length + 1); - const big = max + 0.01; - for (let i = 0; i <= s2.length; i++) { - previous[i] = i; - } - for (let i = 1; i <= s1.length; i++) { - const c1 = s1.charCodeAt(i - 1); - const minJ = Math.ceil(i > max ? i - max : 1); - const maxJ = Math.floor(s2.length > max + i ? max + i : s2.length); - current[0] = i; - let colMin = i; - for (let j = 1; j < minJ; j++) { - current[j] = big; - } - for (let j = minJ; j <= maxJ; j++) { - const substitutionDistance = s1[i - 1].toLowerCase() === s2[j - 1].toLowerCase() ? previous[j - 1] + 0.1 : previous[j - 1] + 2; - const dist = c1 === s2.charCodeAt(j - 1) ? previous[j - 1] : Math.min( - /*delete*/ - previous[j] + 1, - /*insert*/ - current[j - 1] + 1, - /*substitute*/ - substitutionDistance - ); - current[j] = dist; - colMin = Math.min(colMin, dist); - } - for (let j = maxJ + 1; j <= s2.length; j++) { - current[j] = big; - } - if (colMin > max) { - return void 0; - } - const temp = previous; - previous = current; - current = temp; - } - const res = previous[s2.length]; - return res > max ? void 0 : res; -} -function endsWith(str, suffix, ignoreCase) { - const expectedPos = str.length - suffix.length; - return expectedPos >= 0 && (ignoreCase ? equateStringsCaseInsensitive(str.slice(expectedPos), suffix) : str.indexOf(suffix, expectedPos) === expectedPos); -} -function removeSuffix(str, suffix) { - return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str; -} -function tryRemoveSuffix(str, suffix) { - return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0; -} -function removeMinAndVersionNumbers(fileName) { - let end = fileName.length; - for (let pos = end - 1; pos > 0; pos--) { - let ch = fileName.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - do { - --pos; - ch = fileName.charCodeAt(pos); - } while (pos > 0 && ch >= 48 /* _0 */ && ch <= 57 /* _9 */); - } else if (pos > 4 && (ch === 110 /* n */ || ch === 78 /* N */)) { - --pos; - ch = fileName.charCodeAt(pos); - if (ch !== 105 /* i */ && ch !== 73 /* I */) { - break; - } - --pos; - ch = fileName.charCodeAt(pos); - if (ch !== 109 /* m */ && ch !== 77 /* M */) { - break; - } - --pos; - ch = fileName.charCodeAt(pos); - } else { - break; - } - if (ch !== 45 /* minus */ && ch !== 46 /* dot */) { - break; - } - end = pos; - } - return end === fileName.length ? fileName : fileName.slice(0, end); -} -function orderedRemoveItem(array, item) { - for (let i = 0; i < array.length; i++) { - if (array[i] === item) { - orderedRemoveItemAt(array, i); - return true; - } - } - return false; -} -function orderedRemoveItemAt(array, index) { - for (let i = index; i < array.length - 1; i++) { - array[i] = array[i + 1]; - } - array.pop(); -} -function unorderedRemoveItemAt(array, index) { - array[index] = array[array.length - 1]; - array.pop(); -} -function unorderedRemoveItem(array, item) { - return unorderedRemoveFirstItemWhere(array, (element) => element === item); -} -function unorderedRemoveFirstItemWhere(array, predicate) { - for (let i = 0; i < array.length; i++) { - if (predicate(array[i])) { - unorderedRemoveItemAt(array, i); - return true; - } - } - return false; -} -function createGetCanonicalFileName(useCaseSensitiveFileNames2) { - return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase; -} -function patternText({ prefix, suffix }) { - return `${prefix}*${suffix}`; -} -function matchedText(pattern, candidate) { - Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); -} -function findBestPatternMatch(values, getPattern, candidate) { - let matchedValue; - let longestMatchPrefixLength = -1; - for (let i = 0; i < values.length; i++) { - const v = values[i]; - const pattern = getPattern(v); - if (pattern.prefix.length > longestMatchPrefixLength && isPatternMatch(pattern, candidate)) { - longestMatchPrefixLength = pattern.prefix.length; - matchedValue = v; - } - } - return matchedValue; -} -function startsWith(str, prefix, ignoreCase) { - return ignoreCase ? equateStringsCaseInsensitive(str.slice(0, prefix.length), prefix) : str.lastIndexOf(prefix, 0) === 0; -} -function removePrefix(str, prefix) { - return startsWith(str, prefix) ? str.substr(prefix.length) : str; -} -function tryRemovePrefix(str, prefix, getCanonicalFileName = identity) { - return startsWith(getCanonicalFileName(str), getCanonicalFileName(prefix)) ? str.substring(prefix.length) : void 0; -} -function isPatternMatch({ prefix, suffix }, candidate) { - return candidate.length >= prefix.length + suffix.length && startsWith(candidate, prefix) && endsWith(candidate, suffix); -} -function and(f, g) { - return (arg) => f(arg) && g(arg); -} -function or(...fs) { - return (...args) => { - let lastResult; - for (const f of fs) { - lastResult = f(...args); - if (lastResult) { - return lastResult; - } - } - return lastResult; - }; -} -function not(fn) { - return (...args) => !fn(...args); -} -function assertType(_) { -} -function singleElementArray(t) { - return t === void 0 ? void 0 : [t]; -} -function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { - unchanged ?? (unchanged = noop); - let newIndex = 0; - let oldIndex = 0; - const newLen = newItems.length; - const oldLen = oldItems.length; - let hasChanges = false; - while (newIndex < newLen && oldIndex < oldLen) { - const newItem = newItems[newIndex]; - const oldItem = oldItems[oldIndex]; - const compareResult = comparer(newItem, oldItem); - if (compareResult === -1 /* LessThan */) { - inserted(newItem); - newIndex++; - hasChanges = true; - } else if (compareResult === 1 /* GreaterThan */) { - deleted(oldItem); - oldIndex++; - hasChanges = true; - } else { - unchanged(oldItem, newItem); - newIndex++; - oldIndex++; - } - } - while (newIndex < newLen) { - inserted(newItems[newIndex++]); - hasChanges = true; - } - while (oldIndex < oldLen) { - deleted(oldItems[oldIndex++]); - hasChanges = true; - } - return hasChanges; -} -function cartesianProduct(arrays) { - const result = []; - cartesianProductWorker( - arrays, - result, - /*outer*/ - void 0, - 0 - ); - return result; -} -function cartesianProductWorker(arrays, result, outer, index) { - for (const element of arrays[index]) { - let inner; - if (outer) { - inner = outer.slice(); - inner.push(element); - } else { - inner = [element]; - } - if (index === arrays.length - 1) { - result.push(inner); - } else { - cartesianProductWorker(arrays, result, inner, index + 1); - } - } -} -function takeWhile(array, predicate) { - if (array !== void 0) { - const len = array.length; - let index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(0, index); - } -} -function skipWhile(array, predicate) { - if (array !== void 0) { - const len = array.length; - let index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(index); - } -} -function isNodeLikeSystem() { - return typeof process !== "undefined" && !!process.nextTick && !process.browser && "function" !== "undefined"; -} - -// src/compiler/debug.ts -var 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 || {}); -var Debug; -((Debug2) => { - let currentAssertionLevel = 0 /* None */; - Debug2.currentLogLevel = 2 /* Warning */; - Debug2.isDebugging = false; - function shouldLog(level) { - return Debug2.currentLogLevel <= level; - } - Debug2.shouldLog = shouldLog; - function logMessage(level, s) { - if (Debug2.loggingHost && shouldLog(level)) { - Debug2.loggingHost.log(level, s); - } - } - function log(s) { - logMessage(3 /* Info */, s); - } - Debug2.log = log; - ((_log) => { - function error2(s) { - logMessage(1 /* Error */, s); - } - _log.error = error2; - function warn(s) { - logMessage(2 /* Warning */, s); - } - _log.warn = warn; - function log2(s) { - logMessage(3 /* Info */, s); - } - _log.log = log2; - function trace2(s) { - logMessage(4 /* Verbose */, s); - } - _log.trace = trace2; - })(log = Debug2.log || (Debug2.log = {})); - const assertionCache = {}; - function getAssertionLevel() { - return currentAssertionLevel; - } - Debug2.getAssertionLevel = getAssertionLevel; - function setAssertionLevel(level) { - const prevAssertionLevel = currentAssertionLevel; - currentAssertionLevel = level; - if (level > prevAssertionLevel) { - for (const key of getOwnKeys(assertionCache)) { - const cachedFunc = assertionCache[key]; - if (cachedFunc !== void 0 && Debug2[key] !== cachedFunc.assertion && level >= cachedFunc.level) { - Debug2[key] = cachedFunc; - assertionCache[key] = void 0; - } - } - } - } - Debug2.setAssertionLevel = setAssertionLevel; - function shouldAssert(level) { - return currentAssertionLevel >= level; - } - Debug2.shouldAssert = shouldAssert; - function shouldAssertFunction(level, name) { - if (!shouldAssert(level)) { - assertionCache[name] = { level, assertion: Debug2[name] }; - Debug2[name] = noop; - return false; - } - return true; - } - function fail(message, stackCrawlMark) { - debugger; - const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure."); - if (Error.captureStackTrace) { - Error.captureStackTrace(e, stackCrawlMark || fail); - } - throw e; - } - Debug2.fail = fail; - function failBadSyntaxKind(node, message, stackCrawlMark) { - return fail( - `${message || "Unexpected node."}\r -Node ${formatSyntaxKind(node.kind)} was unexpected.`, - stackCrawlMark || failBadSyntaxKind - ); - } - Debug2.failBadSyntaxKind = failBadSyntaxKind; - function assert(expression, message, verboseDebugInfo, stackCrawlMark) { - if (!expression) { - message = message ? `False expression: ${message}` : "False expression."; - if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); - } - fail(message, stackCrawlMark || assert); - } - } - Debug2.assert = assert; - function assertEqual(a, b, msg, msg2, stackCrawlMark) { - if (a !== b) { - const message = msg ? msg2 ? `${msg} ${msg2}` : msg : ""; - fail(`Expected ${a} === ${b}. ${message}`, stackCrawlMark || assertEqual); - } - } - Debug2.assertEqual = assertEqual; - function assertLessThan(a, b, msg, stackCrawlMark) { - if (a >= b) { - fail(`Expected ${a} < ${b}. ${msg || ""}`, stackCrawlMark || assertLessThan); - } - } - Debug2.assertLessThan = assertLessThan; - function assertLessThanOrEqual(a, b, stackCrawlMark) { - if (a > b) { - fail(`Expected ${a} <= ${b}`, stackCrawlMark || assertLessThanOrEqual); - } - } - Debug2.assertLessThanOrEqual = assertLessThanOrEqual; - function assertGreaterThanOrEqual(a, b, stackCrawlMark) { - if (a < b) { - fail(`Expected ${a} >= ${b}`, stackCrawlMark || assertGreaterThanOrEqual); - } - } - Debug2.assertGreaterThanOrEqual = assertGreaterThanOrEqual; - function assertIsDefined(value, message, stackCrawlMark) { - if (value === void 0 || value === null) { - fail(message, stackCrawlMark || assertIsDefined); - } - } - Debug2.assertIsDefined = assertIsDefined; - function checkDefined(value, message, stackCrawlMark) { - assertIsDefined(value, message, stackCrawlMark || checkDefined); - return value; - } - Debug2.checkDefined = checkDefined; - function assertEachIsDefined(value, message, stackCrawlMark) { - for (const v of value) { - assertIsDefined(v, message, stackCrawlMark || assertEachIsDefined); - } - } - Debug2.assertEachIsDefined = assertEachIsDefined; - function checkEachDefined(value, message, stackCrawlMark) { - assertEachIsDefined(value, message, stackCrawlMark || checkEachDefined); - return value; - } - Debug2.checkEachDefined = checkEachDefined; - function assertNever(member, message = "Illegal value:", stackCrawlMark) { - const detail = typeof member === "object" && hasProperty(member, "kind") && hasProperty(member, "pos") ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member); - return fail(`${message} ${detail}`, stackCrawlMark || assertNever); - } - Debug2.assertNever = assertNever; - function assertEachNode(nodes, test, message, stackCrawlMark) { - if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) { - assert( - test === void 0 || every(nodes, test), - message || "Unexpected node.", - () => `Node array did not pass test '${getFunctionName(test)}'.`, - stackCrawlMark || assertEachNode - ); - } - } - Debug2.assertEachNode = assertEachNode; - function assertNode(node, test, message, stackCrawlMark) { - if (shouldAssertFunction(1 /* Normal */, "assertNode")) { - assert( - node !== void 0 && (test === void 0 || test(node)), - message || "Unexpected node.", - () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, - stackCrawlMark || assertNode - ); - } - } - Debug2.assertNode = assertNode; - function assertNotNode(node, test, message, stackCrawlMark) { - if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) { - assert( - node === void 0 || test === void 0 || !test(node), - message || "Unexpected node.", - () => `Node ${formatSyntaxKind(node.kind)} should not have passed test '${getFunctionName(test)}'.`, - stackCrawlMark || assertNotNode - ); - } - } - Debug2.assertNotNode = assertNotNode; - function assertOptionalNode(node, test, message, stackCrawlMark) { - if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) { - assert( - test === void 0 || node === void 0 || test(node), - message || "Unexpected node.", - () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, - stackCrawlMark || assertOptionalNode - ); - } - } - Debug2.assertOptionalNode = assertOptionalNode; - function assertOptionalToken(node, kind, message, stackCrawlMark) { - if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) { - assert( - kind === void 0 || node === void 0 || node.kind === kind, - message || "Unexpected node.", - () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} was not a '${formatSyntaxKind(kind)}' token.`, - stackCrawlMark || assertOptionalToken - ); - } - } - Debug2.assertOptionalToken = assertOptionalToken; - function assertMissingNode(node, message, stackCrawlMark) { - if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) { - assert( - node === void 0, - message || "Unexpected node.", - () => `Node ${formatSyntaxKind(node.kind)} was unexpected'.`, - stackCrawlMark || assertMissingNode - ); - } - } - Debug2.assertMissingNode = assertMissingNode; - function type(_value) { - } - Debug2.type = type; - function getFunctionName(func) { - if (typeof func !== "function") { - return ""; - } else if (hasProperty(func, "name")) { - return func.name; - } else { - const text = Function.prototype.toString.call(func); - const match = /^function\s+([\w$]+)\s*\(/.exec(text); - return match ? match[1] : ""; - } - } - Debug2.getFunctionName = getFunctionName; - function formatSymbol(symbol) { - return `{ name: ${unescapeLeadingUnderscores(symbol.escapedName)}; flags: ${formatSymbolFlags(symbol.flags)}; declarations: ${map(symbol.declarations, (node) => formatSyntaxKind(node.kind))} }`; - } - Debug2.formatSymbol = formatSymbol; - function formatEnum(value = 0, enumObject, isFlags) { - const members = getEnumMembers(enumObject); - if (value === 0) { - return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0"; - } - if (isFlags) { - const result = []; - let remainingFlags = value; - for (const [enumValue, enumName] of members) { - if (enumValue > value) { - break; - } - if (enumValue !== 0 && enumValue & value) { - result.push(enumName); - remainingFlags &= ~enumValue; - } - } - if (remainingFlags === 0) { - return result.join("|"); - } - } else { - for (const [enumValue, enumName] of members) { - if (enumValue === value) { - return enumName; - } - } - } - return value.toString(); - } - Debug2.formatEnum = formatEnum; - const enumMemberCache = /* @__PURE__ */ new Map(); - function getEnumMembers(enumObject) { - const existing = enumMemberCache.get(enumObject); - if (existing) { - return existing; - } - const result = []; - for (const name in enumObject) { - const value = enumObject[name]; - if (typeof value === "number") { - result.push([value, name]); - } - } - const sorted = toSorted(result, (x, y) => compareValues(x[0], y[0])); - enumMemberCache.set(enumObject, sorted); - return sorted; - } - function formatSyntaxKind(kind) { - return formatEnum( - kind, - SyntaxKind, - /*isFlags*/ - false - ); - } - Debug2.formatSyntaxKind = formatSyntaxKind; - function formatSnippetKind(kind) { - return formatEnum( - kind, - SnippetKind, - /*isFlags*/ - false - ); - } - Debug2.formatSnippetKind = formatSnippetKind; - function formatScriptKind(kind) { - return formatEnum( - kind, - ScriptKind, - /*isFlags*/ - false - ); - } - Debug2.formatScriptKind = formatScriptKind; - function formatNodeFlags(flags) { - return formatEnum( - flags, - NodeFlags, - /*isFlags*/ - true - ); - } - Debug2.formatNodeFlags = formatNodeFlags; - function formatNodeCheckFlags(flags) { - return formatEnum( - flags, - NodeCheckFlags, - /*isFlags*/ - true - ); - } - Debug2.formatNodeCheckFlags = formatNodeCheckFlags; - function formatModifierFlags(flags) { - return formatEnum( - flags, - ModifierFlags, - /*isFlags*/ - true - ); - } - Debug2.formatModifierFlags = formatModifierFlags; - function formatTransformFlags(flags) { - return formatEnum( - flags, - TransformFlags, - /*isFlags*/ - true - ); - } - Debug2.formatTransformFlags = formatTransformFlags; - function formatEmitFlags(flags) { - return formatEnum( - flags, - EmitFlags, - /*isFlags*/ - true - ); - } - Debug2.formatEmitFlags = formatEmitFlags; - function formatSymbolFlags(flags) { - return formatEnum( - flags, - SymbolFlags, - /*isFlags*/ - true - ); - } - Debug2.formatSymbolFlags = formatSymbolFlags; - function formatTypeFlags(flags) { - return formatEnum( - flags, - TypeFlags, - /*isFlags*/ - true - ); - } - Debug2.formatTypeFlags = formatTypeFlags; - function formatSignatureFlags(flags) { - return formatEnum( - flags, - SignatureFlags, - /*isFlags*/ - true - ); - } - Debug2.formatSignatureFlags = formatSignatureFlags; - function formatObjectFlags(flags) { - return formatEnum( - flags, - ObjectFlags, - /*isFlags*/ - true - ); - } - Debug2.formatObjectFlags = formatObjectFlags; - function formatFlowFlags(flags) { - return formatEnum( - flags, - FlowFlags, - /*isFlags*/ - true - ); - } - Debug2.formatFlowFlags = formatFlowFlags; - function formatRelationComparisonResult(result) { - return formatEnum( - result, - RelationComparisonResult, - /*isFlags*/ - true - ); - } - Debug2.formatRelationComparisonResult = formatRelationComparisonResult; - function formatCheckMode(mode) { - return formatEnum( - mode, - CheckMode, - /*isFlags*/ - true - ); - } - Debug2.formatCheckMode = formatCheckMode; - function formatSignatureCheckMode(mode) { - return formatEnum( - mode, - SignatureCheckMode, - /*isFlags*/ - true - ); - } - Debug2.formatSignatureCheckMode = formatSignatureCheckMode; - function formatTypeFacts(facts) { - return formatEnum( - facts, - TypeFacts, - /*isFlags*/ - true - ); - } - Debug2.formatTypeFacts = formatTypeFacts; - let isDebugInfoEnabled = false; - let flowNodeProto; - function attachFlowNodeDebugInfoWorker(flowNode) { - if (!("__debugFlowFlags" in flowNode)) { - Object.defineProperties(flowNode, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value() { - const flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : this.flags & 16 /* Assignment */ ? "FlowAssignment" : this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : this.flags & 512 /* Call */ ? "FlowCall" : this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : "UnknownFlow"; - const remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); - return `${flowHeader}${remainingFlags ? ` (${formatFlowFlags(remainingFlags)})` : ""}`; - } - }, - __debugFlowFlags: { - get() { - return formatEnum( - this.flags, - FlowFlags, - /*isFlags*/ - true - ); - } - }, - __debugToString: { - value() { - return formatControlFlowGraph(this); - } - } - }); - } - } - function attachFlowNodeDebugInfo(flowNode) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - if (!flowNodeProto) { - flowNodeProto = Object.create(Object.prototype); - attachFlowNodeDebugInfoWorker(flowNodeProto); - } - Object.setPrototypeOf(flowNode, flowNodeProto); - } else { - attachFlowNodeDebugInfoWorker(flowNode); - } - } - return flowNode; - } - Debug2.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; - let nodeArrayProto; - function attachNodeArrayDebugInfoWorker(array) { - if (!("__tsDebuggerDisplay" in array)) { - Object.defineProperties(array, { - __tsDebuggerDisplay: { - value(defaultValue) { - defaultValue = String(defaultValue).replace(/(?:,[\s\w]+:[^,]+)+\]$/, "]"); - return `NodeArray ${defaultValue}`; - } - } - }); - } - } - function attachNodeArrayDebugInfo(array) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - if (!nodeArrayProto) { - nodeArrayProto = Object.create(Array.prototype); - attachNodeArrayDebugInfoWorker(nodeArrayProto); - } - Object.setPrototypeOf(array, nodeArrayProto); - } else { - attachNodeArrayDebugInfoWorker(array); - } - } - } - Debug2.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; - function enableDebugInfo() { - if (isDebugInfoEnabled) return; - const weakTypeTextMap = /* @__PURE__ */ new WeakMap(); - const weakNodeTextMap = /* @__PURE__ */ new WeakMap(); - Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value() { - const symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : "Symbol"; - const remainingSymbolFlags = this.flags & ~33554432 /* Transient */; - return `${symbolHeader} '${symbolName(this)}'${remainingSymbolFlags ? ` (${formatSymbolFlags(remainingSymbolFlags)})` : ""}`; - } - }, - __debugFlags: { - get() { - return formatSymbolFlags(this.flags); - } - } - }); - Object.defineProperties(objectAllocator.getTypeConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value() { - const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 1024 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type"; - const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0; - return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`; - } - }, - __debugFlags: { - get() { - return formatTypeFlags(this.flags); - } - }, - __debugObjectFlags: { - get() { - return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; - } - }, - __debugTypeToString: { - value() { - let text = weakTypeTextMap.get(this); - if (text === void 0) { - text = this.checker.typeToString(this); - weakTypeTextMap.set(this, text); - } - return text; - } - } - }); - Object.defineProperties(objectAllocator.getSignatureConstructor().prototype, { - __debugFlags: { - get() { - return formatSignatureFlags(this.flags); - } - }, - __debugSignatureToString: { - value() { - var _a; - return (_a = this.checker) == null ? void 0 : _a.signatureToString(this); - } - } - }); - const nodeConstructors = [ - objectAllocator.getNodeConstructor(), - objectAllocator.getIdentifierConstructor(), - objectAllocator.getTokenConstructor(), - objectAllocator.getSourceFileConstructor() - ]; - for (const ctor of nodeConstructors) { - if (!hasProperty(ctor.prototype, "__debugKind")) { - Object.defineProperties(ctor.prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value() { - const nodeHeader = isGeneratedIdentifier(this) ? "GeneratedIdentifier" : isIdentifier(this) ? `Identifier '${idText(this)}'` : isPrivateIdentifier(this) ? `PrivateIdentifier '${idText(this)}'` : isStringLiteral(this) ? `StringLiteral ${JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")}` : isNumericLiteral(this) ? `NumericLiteral ${this.text}` : isBigIntLiteral(this) ? `BigIntLiteral ${this.text}n` : isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : isParameter(this) ? "ParameterDeclaration" : isConstructorDeclaration(this) ? "ConstructorDeclaration" : isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : isTypePredicateNode(this) ? "TypePredicateNode" : isTypeReferenceNode(this) ? "TypeReferenceNode" : isFunctionTypeNode(this) ? "FunctionTypeNode" : isConstructorTypeNode(this) ? "ConstructorTypeNode" : isTypeQueryNode(this) ? "TypeQueryNode" : isTypeLiteralNode(this) ? "TypeLiteralNode" : isArrayTypeNode(this) ? "ArrayTypeNode" : isTupleTypeNode(this) ? "TupleTypeNode" : isOptionalTypeNode(this) ? "OptionalTypeNode" : isRestTypeNode(this) ? "RestTypeNode" : isUnionTypeNode(this) ? "UnionTypeNode" : isIntersectionTypeNode(this) ? "IntersectionTypeNode" : isConditionalTypeNode(this) ? "ConditionalTypeNode" : isInferTypeNode(this) ? "InferTypeNode" : isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : isThisTypeNode(this) ? "ThisTypeNode" : isTypeOperatorNode(this) ? "TypeOperatorNode" : isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : isMappedTypeNode(this) ? "MappedTypeNode" : isLiteralTypeNode(this) ? "LiteralTypeNode" : isNamedTupleMember(this) ? "NamedTupleMember" : isImportTypeNode(this) ? "ImportTypeNode" : formatSyntaxKind(this.kind); - return `${nodeHeader}${this.flags ? ` (${formatNodeFlags(this.flags)})` : ""}`; - } - }, - __debugKind: { - get() { - return formatSyntaxKind(this.kind); - } - }, - __debugNodeFlags: { - get() { - return formatNodeFlags(this.flags); - } - }, - __debugModifierFlags: { - get() { - return formatModifierFlags(getEffectiveModifierFlagsNoCache(this)); - } - }, - __debugTransformFlags: { - get() { - return formatTransformFlags(this.transformFlags); - } - }, - __debugIsParseTreeNode: { - get() { - return isParseTreeNode(this); - } - }, - __debugEmitFlags: { - get() { - return formatEmitFlags(getEmitFlags(this)); - } - }, - __debugGetText: { - value(includeTrivia) { - if (nodeIsSynthesized(this)) return ""; - let text = weakNodeTextMap.get(this); - if (text === void 0) { - const parseNode = getParseTreeNode(this); - const sourceFile = parseNode && getSourceFileOfNode(parseNode); - text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - weakNodeTextMap.set(this, text); - } - return text; - } - } - }); - } - } - isDebugInfoEnabled = true; - } - Debug2.enableDebugInfo = enableDebugInfo; - function formatVariance(varianceFlags) { - const variance = varianceFlags & 7 /* VarianceMask */; - let result = variance === 0 /* Invariant */ ? "in out" : variance === 3 /* Bivariant */ ? "[bivariant]" : variance === 2 /* Contravariant */ ? "in" : variance === 1 /* Covariant */ ? "out" : variance === 4 /* Independent */ ? "[independent]" : ""; - if (varianceFlags & 8 /* Unmeasurable */) { - result += " (unmeasurable)"; - } else if (varianceFlags & 16 /* Unreliable */) { - result += " (unreliable)"; - } - return result; - } - Debug2.formatVariance = formatVariance; - class DebugTypeMapper { - __debugToString() { - var _a; - type(this); - switch (this.kind) { - case 3 /* Function */: - return ((_a = this.debugInfo) == null ? void 0 : _a.call(this)) || "(function mapper)"; - case 0 /* Simple */: - return `${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`; - case 1 /* Array */: - return zipWith( - this.sources, - this.targets || map(this.sources, () => "any"), - (s, t) => `${s.__debugTypeToString()} -> ${typeof t === "string" ? t : t.__debugTypeToString()}` - ).join(", "); - case 2 /* Deferred */: - return zipWith( - this.sources, - this.targets, - (s, t) => `${s.__debugTypeToString()} -> ${t().__debugTypeToString()}` - ).join(", "); - case 5 /* Merged */: - case 4 /* Composite */: - return `m1: ${this.mapper1.__debugToString().split("\n").join("\n ")} -m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`; - default: - return assertNever(this); - } - } - } - Debug2.DebugTypeMapper = DebugTypeMapper; - function attachDebugPrototypeIfDebug(mapper) { - if (Debug2.isDebugging) { - return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype); - } - return mapper; - } - Debug2.attachDebugPrototypeIfDebug = attachDebugPrototypeIfDebug; - function printControlFlowGraph(flowNode) { - return console.log(formatControlFlowGraph(flowNode)); - } - Debug2.printControlFlowGraph = printControlFlowGraph; - function formatControlFlowGraph(flowNode) { - let nextDebugFlowId = -1; - function getDebugFlowNodeId(f) { - if (!f.id) { - f.id = nextDebugFlowId; - nextDebugFlowId--; - } - return f.id; - } - let BoxCharacter; - ((BoxCharacter2) => { - BoxCharacter2["lr"] = "\u2500"; - BoxCharacter2["ud"] = "\u2502"; - BoxCharacter2["dr"] = "\u256D"; - BoxCharacter2["dl"] = "\u256E"; - BoxCharacter2["ul"] = "\u256F"; - BoxCharacter2["ur"] = "\u2570"; - BoxCharacter2["udr"] = "\u251C"; - BoxCharacter2["udl"] = "\u2524"; - BoxCharacter2["dlr"] = "\u252C"; - BoxCharacter2["ulr"] = "\u2534"; - BoxCharacter2["udlr"] = "\u256B"; - })(BoxCharacter || (BoxCharacter = {})); - let Connection; - ((Connection2) => { - Connection2[Connection2["None"] = 0] = "None"; - Connection2[Connection2["Up"] = 1] = "Up"; - Connection2[Connection2["Down"] = 2] = "Down"; - Connection2[Connection2["Left"] = 4] = "Left"; - Connection2[Connection2["Right"] = 8] = "Right"; - Connection2[Connection2["UpDown"] = 3] = "UpDown"; - Connection2[Connection2["LeftRight"] = 12] = "LeftRight"; - Connection2[Connection2["UpLeft"] = 5] = "UpLeft"; - Connection2[Connection2["UpRight"] = 9] = "UpRight"; - Connection2[Connection2["DownLeft"] = 6] = "DownLeft"; - Connection2[Connection2["DownRight"] = 10] = "DownRight"; - Connection2[Connection2["UpDownLeft"] = 7] = "UpDownLeft"; - Connection2[Connection2["UpDownRight"] = 11] = "UpDownRight"; - Connection2[Connection2["UpLeftRight"] = 13] = "UpLeftRight"; - Connection2[Connection2["DownLeftRight"] = 14] = "DownLeftRight"; - Connection2[Connection2["UpDownLeftRight"] = 15] = "UpDownLeftRight"; - Connection2[Connection2["NoChildren"] = 16] = "NoChildren"; - })(Connection || (Connection = {})); - const hasAntecedentFlags = 16 /* Assignment */ | 96 /* Condition */ | 128 /* SwitchClause */ | 256 /* ArrayMutation */ | 512 /* Call */ | 1024 /* ReduceLabel */; - const hasNodeFlags = 2 /* Start */ | 16 /* Assignment */ | 512 /* Call */ | 96 /* Condition */ | 256 /* ArrayMutation */; - const links = /* @__PURE__ */ Object.create( - /*o*/ - null - ); - const nodes = []; - const edges = []; - const root = buildGraphNode(flowNode, /* @__PURE__ */ new Set()); - for (const node of nodes) { - node.text = renderFlowNode(node.flowNode, node.circular); - computeLevel(node); - } - const height = computeHeight(root); - const columnWidths = computeColumnWidths(height); - computeLanes(root, 0); - return renderGraph(); - function isFlowSwitchClause(f) { - return !!(f.flags & 128 /* SwitchClause */); - } - function hasAntecedents(f) { - return !!(f.flags & 12 /* Label */) && !!f.antecedent; - } - function hasAntecedent(f) { - return !!(f.flags & hasAntecedentFlags); - } - function hasNode(f) { - return !!(f.flags & hasNodeFlags); - } - function getChildren(node) { - const children = []; - for (const edge of node.edges) { - if (edge.source === node) { - children.push(edge.target); - } - } - return children; - } - function getParents(node) { - const parents = []; - for (const edge of node.edges) { - if (edge.target === node) { - parents.push(edge.source); - } - } - return parents; - } - function buildGraphNode(flowNode2, seen) { - const id = getDebugFlowNodeId(flowNode2); - let graphNode = links[id]; - if (graphNode && seen.has(flowNode2)) { - graphNode.circular = true; - graphNode = { - id: -1, - flowNode: flowNode2, - edges: [], - text: "", - lane: -1, - endLane: -1, - level: -1, - circular: "circularity" - }; - nodes.push(graphNode); - return graphNode; - } - seen.add(flowNode2); - if (!graphNode) { - links[id] = graphNode = { id, flowNode: flowNode2, edges: [], text: "", lane: -1, endLane: -1, level: -1, circular: false }; - nodes.push(graphNode); - if (hasAntecedents(flowNode2)) { - for (const antecedent of flowNode2.antecedent) { - buildGraphEdge(graphNode, antecedent, seen); - } - } else if (hasAntecedent(flowNode2)) { - buildGraphEdge(graphNode, flowNode2.antecedent, seen); - } - } - seen.delete(flowNode2); - return graphNode; - } - function buildGraphEdge(source, antecedent, seen) { - const target = buildGraphNode(antecedent, seen); - const edge = { source, target }; - edges.push(edge); - source.edges.push(edge); - target.edges.push(edge); - } - function computeLevel(node) { - if (node.level !== -1) { - return node.level; - } - let level = 0; - for (const parent2 of getParents(node)) { - level = Math.max(level, computeLevel(parent2) + 1); - } - return node.level = level; - } - function computeHeight(node) { - let height2 = 0; - for (const child of getChildren(node)) { - height2 = Math.max(height2, computeHeight(child)); - } - return height2 + 1; - } - function computeColumnWidths(height2) { - const columns = fill(Array(height2), 0); - for (const node of nodes) { - columns[node.level] = Math.max(columns[node.level], node.text.length); - } - return columns; - } - function computeLanes(node, lane) { - if (node.lane === -1) { - node.lane = lane; - node.endLane = lane; - const children = getChildren(node); - for (let i = 0; i < children.length; i++) { - if (i > 0) lane++; - const child = children[i]; - computeLanes(child, lane); - if (child.endLane > node.endLane) { - lane = child.endLane; - } - } - node.endLane = lane; - } - } - function getHeader2(flags) { - if (flags & 2 /* Start */) return "Start"; - if (flags & 4 /* BranchLabel */) return "Branch"; - if (flags & 8 /* LoopLabel */) return "Loop"; - if (flags & 16 /* Assignment */) return "Assignment"; - if (flags & 32 /* TrueCondition */) return "True"; - if (flags & 64 /* FalseCondition */) return "False"; - if (flags & 128 /* SwitchClause */) return "SwitchClause"; - if (flags & 256 /* ArrayMutation */) return "ArrayMutation"; - if (flags & 512 /* Call */) return "Call"; - if (flags & 1024 /* ReduceLabel */) return "ReduceLabel"; - if (flags & 1 /* Unreachable */) return "Unreachable"; - throw new Error(); - } - function getNodeText(node) { - const sourceFile = getSourceFileOfNode(node); - return getSourceTextOfNodeFromSourceFile( - sourceFile, - node, - /*includeTrivia*/ - false - ); - } - function renderFlowNode(flowNode2, circular) { - let text = getHeader2(flowNode2.flags); - if (circular) { - text = `${text}#${getDebugFlowNodeId(flowNode2)}`; - } - if (isFlowSwitchClause(flowNode2)) { - const clauses = []; - const { switchStatement, clauseStart, clauseEnd } = flowNode2.node; - for (let i = clauseStart; i < clauseEnd; i++) { - const clause = switchStatement.caseBlock.clauses[i]; - if (isDefaultClause(clause)) { - clauses.push("default"); - } else { - clauses.push(getNodeText(clause.expression)); - } - } - text += ` (${clauses.join(", ")})`; - } else if (hasNode(flowNode2)) { - if (flowNode2.node) { - text += ` (${getNodeText(flowNode2.node)})`; - } - } - return circular === "circularity" ? `Circular(${text})` : text; - } - function renderGraph() { - const columnCount = columnWidths.length; - const laneCount = maxBy(nodes, 0, (n) => n.lane) + 1; - const lanes = fill(Array(laneCount), ""); - const grid = columnWidths.map(() => Array(laneCount)); - const connectors = columnWidths.map(() => fill(Array(laneCount), 0)); - for (const node of nodes) { - grid[node.level][node.lane] = node; - const children = getChildren(node); - for (let i = 0; i < children.length; i++) { - const child = children[i]; - let connector = 8 /* Right */; - if (child.lane === node.lane) connector |= 4 /* Left */; - if (i > 0) connector |= 1 /* Up */; - if (i < children.length - 1) connector |= 2 /* Down */; - connectors[node.level][child.lane] |= connector; - } - if (children.length === 0) { - connectors[node.level][node.lane] |= 16 /* NoChildren */; - } - const parents = getParents(node); - for (let i = 0; i < parents.length; i++) { - const parent2 = parents[i]; - let connector = 4 /* Left */; - if (i > 0) connector |= 1 /* Up */; - if (i < parents.length - 1) connector |= 2 /* Down */; - connectors[node.level - 1][parent2.lane] |= connector; - } - } - for (let column = 0; column < columnCount; column++) { - for (let lane = 0; lane < laneCount; lane++) { - const left = column > 0 ? connectors[column - 1][lane] : 0; - const above = lane > 0 ? connectors[column][lane - 1] : 0; - let connector = connectors[column][lane]; - if (!connector) { - if (left & 8 /* Right */) connector |= 12 /* LeftRight */; - if (above & 2 /* Down */) connector |= 3 /* UpDown */; - connectors[column][lane] = connector; - } - } - } - for (let column = 0; column < columnCount; column++) { - for (let lane = 0; lane < lanes.length; lane++) { - const connector = connectors[column][lane]; - const fill2 = connector & 4 /* Left */ ? "\u2500" /* lr */ : " "; - const node = grid[column][lane]; - if (!node) { - if (column < columnCount - 1) { - writeLane(lane, repeat(fill2, columnWidths[column] + 1)); - } - } else { - writeLane(lane, node.text); - if (column < columnCount - 1) { - writeLane(lane, " "); - writeLane(lane, repeat(fill2, columnWidths[column] - node.text.length)); - } - } - writeLane(lane, getBoxCharacter(connector)); - writeLane(lane, connector & 8 /* Right */ && column < columnCount - 1 && !grid[column + 1][lane] ? "\u2500" /* lr */ : " "); - } - } - return ` -${lanes.join("\n")} -`; - function writeLane(lane, text) { - lanes[lane] += text; - } - } - function getBoxCharacter(connector) { - switch (connector) { - case 3 /* UpDown */: - return "\u2502" /* ud */; - case 12 /* LeftRight */: - return "\u2500" /* lr */; - case 5 /* UpLeft */: - return "\u256F" /* ul */; - case 9 /* UpRight */: - return "\u2570" /* ur */; - case 6 /* DownLeft */: - return "\u256E" /* dl */; - case 10 /* DownRight */: - return "\u256D" /* dr */; - case 7 /* UpDownLeft */: - return "\u2524" /* udl */; - case 11 /* UpDownRight */: - return "\u251C" /* udr */; - case 13 /* UpLeftRight */: - return "\u2534" /* ulr */; - case 14 /* DownLeftRight */: - return "\u252C" /* dlr */; - case 15 /* UpDownLeftRight */: - return "\u256B" /* udlr */; - } - return " "; - } - function fill(array, value) { - if (array.fill) { - array.fill(value); - } else { - for (let i = 0; i < array.length; i++) { - array[i] = value; - } - } - return array; - } - function repeat(ch, length2) { - if (ch.repeat) { - return length2 > 0 ? ch.repeat(length2) : ""; - } - let s = ""; - while (s.length < length2) { - s += ch; - } - return s; - } - } - Debug2.formatControlFlowGraph = formatControlFlowGraph; -})(Debug || (Debug = {})); - -// src/compiler/semver.ts -var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; -var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i; -var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i; -var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i; -var buildPartRegExp = /^[a-z0-9-]+$/i; -var numericIdentifierRegExp = /^(?:0|[1-9]\d*)$/; -var _Version = class _Version { - constructor(major, minor = 0, patch = 0, prerelease = "", build2 = "") { - if (typeof major === "string") { - const result = Debug.checkDefined(tryParseComponents(major), "Invalid version"); - ({ major, minor, patch, prerelease, build: build2 } = result); - } - Debug.assert(major >= 0, "Invalid argument: major"); - Debug.assert(minor >= 0, "Invalid argument: minor"); - Debug.assert(patch >= 0, "Invalid argument: patch"); - const prereleaseArray = prerelease ? isArray(prerelease) ? prerelease : prerelease.split(".") : emptyArray; - const buildArray = build2 ? isArray(build2) ? build2 : build2.split(".") : emptyArray; - Debug.assert(every(prereleaseArray, (s) => prereleasePartRegExp.test(s)), "Invalid argument: prerelease"); - Debug.assert(every(buildArray, (s) => buildPartRegExp.test(s)), "Invalid argument: build"); - this.major = major; - this.minor = minor; - this.patch = patch; - this.prerelease = prereleaseArray; - this.build = buildArray; - } - static tryParse(text) { - const result = tryParseComponents(text); - if (!result) return void 0; - const { major, minor, patch, prerelease, build: build2 } = result; - return new _Version(major, minor, patch, prerelease, build2); - } - compareTo(other) { - if (this === other) return 0 /* EqualTo */; - if (other === void 0) return 1 /* GreaterThan */; - return compareValues(this.major, other.major) || compareValues(this.minor, other.minor) || compareValues(this.patch, other.patch) || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); - } - increment(field) { - switch (field) { - case "major": - return new _Version(this.major + 1, 0, 0); - case "minor": - return new _Version(this.major, this.minor + 1, 0); - case "patch": - return new _Version(this.major, this.minor, this.patch + 1); - default: - return Debug.assertNever(field); - } - } - with(fields) { - const { - major = this.major, - minor = this.minor, - patch = this.patch, - prerelease = this.prerelease, - build: build2 = this.build - } = fields; - return new _Version(major, minor, patch, prerelease, build2); - } - toString() { - let result = `${this.major}.${this.minor}.${this.patch}`; - if (some(this.prerelease)) result += `-${this.prerelease.join(".")}`; - if (some(this.build)) result += `+${this.build.join(".")}`; - return result; - } -}; -_Version.zero = new _Version(0, 0, 0, ["0"]); -var Version = _Version; -function tryParseComponents(text) { - const match = versionRegExp.exec(text); - if (!match) return void 0; - const [, major, minor = "0", patch = "0", prerelease = "", build2 = ""] = match; - if (prerelease && !prereleaseRegExp.test(prerelease)) return void 0; - if (build2 && !buildRegExp.test(build2)) return void 0; - return { - major: parseInt(major, 10), - minor: parseInt(minor, 10), - patch: parseInt(patch, 10), - prerelease, - build: build2 - }; -} -function comparePrereleaseIdentifiers(left, right) { - if (left === right) return 0 /* EqualTo */; - if (left.length === 0) return right.length === 0 ? 0 /* EqualTo */ : 1 /* GreaterThan */; - if (right.length === 0) return -1 /* LessThan */; - const length2 = Math.min(left.length, right.length); - for (let i = 0; i < length2; i++) { - const leftIdentifier = left[i]; - const rightIdentifier = right[i]; - if (leftIdentifier === rightIdentifier) continue; - const leftIsNumeric = numericIdentifierRegExp.test(leftIdentifier); - const rightIsNumeric = numericIdentifierRegExp.test(rightIdentifier); - if (leftIsNumeric || rightIsNumeric) { - if (leftIsNumeric !== rightIsNumeric) return leftIsNumeric ? -1 /* LessThan */ : 1 /* GreaterThan */; - const result = compareValues(+leftIdentifier, +rightIdentifier); - if (result) return result; - } else { - const result = compareStringsCaseSensitive(leftIdentifier, rightIdentifier); - if (result) return result; - } - } - return compareValues(left.length, right.length); -} -var VersionRange = class _VersionRange { - constructor(spec) { - this._alternatives = spec ? Debug.checkDefined(parseRange(spec), "Invalid range spec.") : emptyArray; - } - static tryParse(text) { - const sets = parseRange(text); - if (sets) { - const range = new _VersionRange(""); - range._alternatives = sets; - return range; - } - return void 0; - } - /** - * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`. - * in `node-semver`. - */ - test(version2) { - if (typeof version2 === "string") version2 = new Version(version2); - return testDisjunction(version2, this._alternatives); - } - toString() { - return formatDisjunction(this._alternatives); - } -}; -var logicalOrRegExp = /\|\|/; -var whitespaceRegExp = /\s+/; -var partialRegExp = /^([x*0]|[1-9]\d*)(?:\.([x*0]|[1-9]\d*)(?:\.([x*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; -var hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i; -var rangeRegExp = /^([~^<>=]|<=|>=)?\s*([a-z0-9-+.*]+)$/i; -function parseRange(text) { - const alternatives = []; - for (let range of text.trim().split(logicalOrRegExp)) { - if (!range) continue; - const comparators = []; - range = range.trim(); - const match = hyphenRegExp.exec(range); - if (match) { - if (!parseHyphen(match[1], match[2], comparators)) return void 0; - } else { - for (const simple of range.split(whitespaceRegExp)) { - const match2 = rangeRegExp.exec(simple.trim()); - if (!match2 || !parseComparator(match2[1], match2[2], comparators)) return void 0; - } - } - alternatives.push(comparators); - } - return alternatives; -} -function parsePartial(text) { - const match = partialRegExp.exec(text); - if (!match) return void 0; - const [, major, minor = "*", patch = "*", prerelease, build2] = match; - const version2 = new Version( - isWildcard(major) ? 0 : parseInt(major, 10), - isWildcard(major) || isWildcard(minor) ? 0 : parseInt(minor, 10), - isWildcard(major) || isWildcard(minor) || isWildcard(patch) ? 0 : parseInt(patch, 10), - prerelease, - build2 - ); - return { version: version2, major, minor, patch }; -} -function parseHyphen(left, right, comparators) { - const leftResult = parsePartial(left); - if (!leftResult) return false; - const rightResult = parsePartial(right); - if (!rightResult) return false; - if (!isWildcard(leftResult.major)) { - comparators.push(createComparator(">=", leftResult.version)); - } - if (!isWildcard(rightResult.major)) { - comparators.push( - isWildcard(rightResult.minor) ? createComparator("<", rightResult.version.increment("major")) : isWildcard(rightResult.patch) ? createComparator("<", rightResult.version.increment("minor")) : createComparator("<=", rightResult.version) - ); - } - return true; -} -function parseComparator(operator, text, comparators) { - const result = parsePartial(text); - if (!result) return false; - const { version: version2, major, minor, patch } = result; - if (!isWildcard(major)) { - switch (operator) { - case "~": - comparators.push(createComparator(">=", version2)); - comparators.push(createComparator( - "<", - version2.increment( - isWildcard(minor) ? "major" : "minor" - ) - )); - break; - case "^": - comparators.push(createComparator(">=", version2)); - comparators.push(createComparator( - "<", - version2.increment( - version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch" - ) - )); - break; - case "<": - case ">=": - comparators.push( - isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version2.with({ prerelease: "0" })) : createComparator(operator, version2) - ); - break; - case "<=": - case ">": - comparators.push( - isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("major").with({ prerelease: "0" })) : isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("minor").with({ prerelease: "0" })) : createComparator(operator, version2) - ); - break; - case "=": - case void 0: - if (isWildcard(minor) || isWildcard(patch)) { - comparators.push(createComparator(">=", version2.with({ prerelease: "0" }))); - comparators.push(createComparator("<", version2.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" }))); - } else { - comparators.push(createComparator("=", version2)); - } - break; - default: - return false; - } - } else if (operator === "<" || operator === ">") { - comparators.push(createComparator("<", Version.zero)); - } - return true; -} -function isWildcard(part) { - return part === "*" || part === "x" || part === "X"; -} -function createComparator(operator, operand) { - return { operator, operand }; -} -function testDisjunction(version2, alternatives) { - if (alternatives.length === 0) return true; - for (const alternative of alternatives) { - if (testAlternative(version2, alternative)) return true; - } - return false; -} -function testAlternative(version2, comparators) { - for (const comparator of comparators) { - if (!testComparator(version2, comparator.operator, comparator.operand)) return false; - } - return true; -} -function testComparator(version2, operator, operand) { - const cmp = version2.compareTo(operand); - switch (operator) { - case "<": - return cmp < 0; - case "<=": - return cmp <= 0; - case ">": - return cmp > 0; - case ">=": - return cmp >= 0; - case "=": - return cmp === 0; - default: - return Debug.assertNever(operator); - } -} -function formatDisjunction(alternatives) { - return map(alternatives, formatAlternative).join(" || ") || "*"; -} -function formatAlternative(comparators) { - return map(comparators, formatComparator).join(" "); -} -function formatComparator(comparator) { - return `${comparator.operator}${comparator.operand}`; -} - -// src/compiler/performanceCore.ts -function tryGetPerformance() { - if (isNodeLikeSystem()) { - try { - const { performance: performance2 } = __webpack_require__(/*! perf_hooks */ "?07ec"); - if (performance2) { - return { - shouldWriteNativeEvents: false, - performance: performance2 - }; - } - } catch { - } - } - if (typeof performance === "object") { - return { - shouldWriteNativeEvents: true, - performance - }; - } - return void 0; -} -function tryGetPerformanceHooks() { - const p = tryGetPerformance(); - if (!p) return void 0; - const { shouldWriteNativeEvents, performance: performance2 } = p; - const hooks = { - shouldWriteNativeEvents, - performance: void 0, - performanceTime: void 0 - }; - if (typeof performance2.timeOrigin === "number" && typeof performance2.now === "function") { - hooks.performanceTime = performance2; - } - if (hooks.performanceTime && typeof performance2.mark === "function" && typeof performance2.measure === "function" && typeof performance2.clearMarks === "function" && typeof performance2.clearMeasures === "function") { - hooks.performance = performance2; - } - return hooks; -} -var nativePerformanceHooks = tryGetPerformanceHooks(); -var nativePerformanceTime = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performanceTime; -function tryGetNativePerformanceHooks() { - return nativePerformanceHooks; -} -var timestamp = nativePerformanceTime ? () => nativePerformanceTime.now() : Date.now; - -// src/compiler/_namespaces/ts.performance.ts -var ts_performance_exports = {}; -__export(ts_performance_exports, { - clearMarks: () => clearMarks, - clearMeasures: () => clearMeasures, - createTimer: () => createTimer, - createTimerIf: () => createTimerIf, - disable: () => disable, - enable: () => enable, - forEachMark: () => forEachMark, - forEachMeasure: () => forEachMeasure, - getCount: () => getCount, - getDuration: () => getDuration, - isEnabled: () => isEnabled, - mark: () => mark, - measure: () => measure, - nullTimer: () => nullTimer -}); - -// src/compiler/performance.ts -var perfHooks; -var performanceImpl; -function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : nullTimer; -} -function createTimer(measureName, startMarkName, endMarkName) { - let enterCount = 0; - return { - enter, - exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } else if (enterCount < 0) { - Debug.fail("enter/exit count does not match."); - } - } -} -var nullTimer = { enter: noop, exit: noop }; -var enabled = false; -var timeorigin = timestamp(); -var marks = /* @__PURE__ */ new Map(); -var counts = /* @__PURE__ */ new Map(); -var durations = /* @__PURE__ */ new Map(); -function mark(markName) { - if (enabled) { - const count = counts.get(markName) ?? 0; - counts.set(markName, count + 1); - marks.set(markName, timestamp()); - performanceImpl == null ? void 0 : performanceImpl.mark(markName); - if (typeof onProfilerEvent === "function") { - onProfilerEvent(markName); - } - } -} -function measure(measureName, startMarkName, endMarkName) { - if (enabled) { - const end = (endMarkName !== void 0 ? marks.get(endMarkName) : void 0) ?? timestamp(); - const start = (startMarkName !== void 0 ? marks.get(startMarkName) : void 0) ?? timeorigin; - const previousDuration = durations.get(measureName) || 0; - durations.set(measureName, previousDuration + (end - start)); - performanceImpl == null ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); - } -} -function getCount(markName) { - return counts.get(markName) || 0; -} -function getDuration(measureName) { - return durations.get(measureName) || 0; -} -function forEachMeasure(cb) { - durations.forEach((duration, measureName) => cb(measureName, duration)); -} -function forEachMark(cb) { - marks.forEach((_time, markName) => cb(markName)); -} -function clearMeasures(name) { - if (name !== void 0) durations.delete(name); - else durations.clear(); - performanceImpl == null ? void 0 : performanceImpl.clearMeasures(name); -} -function clearMarks(name) { - if (name !== void 0) { - counts.delete(name); - marks.delete(name); - } else { - counts.clear(); - marks.clear(); - } - performanceImpl == null ? void 0 : performanceImpl.clearMarks(name); -} -function isEnabled() { - return enabled; -} -function enable(system = sys) { - var _a; - if (!enabled) { - enabled = true; - perfHooks || (perfHooks = tryGetNativePerformanceHooks()); - if (perfHooks == null ? void 0 : perfHooks.performance) { - timeorigin = perfHooks.performance.timeOrigin; - if (perfHooks.shouldWriteNativeEvents || ((_a = system == null ? void 0 : system.cpuProfilingEnabled) == null ? void 0 : _a.call(system)) || (system == null ? void 0 : system.debugMode)) { - performanceImpl = perfHooks.performance; - } - } - } - return true; -} -function disable() { - if (enabled) { - marks.clear(); - counts.clear(); - durations.clear(); - performanceImpl = void 0; - enabled = false; - } -} - -// src/compiler/tracing.ts -var tracing; -var tracingEnabled; -((tracingEnabled2) => { - let fs; - let traceCount = 0; - let traceFd = 0; - let mode; - const typeCatalog = []; - let legendPath; - const legend = []; - function startTracing2(tracingMode, traceDir, configFilePath) { - Debug.assert(!tracing, "Tracing already started"); - if (fs === void 0) { - try { - fs = __webpack_require__(/*! fs */ "?2e60"); - } catch (e) { - throw new Error(`tracing requires having fs -(original error: ${e.message || e})`); - } - } - mode = tracingMode; - typeCatalog.length = 0; - if (legendPath === void 0) { - legendPath = combinePaths(traceDir, "legend.json"); - } - if (!fs.existsSync(traceDir)) { - fs.mkdirSync(traceDir, { recursive: true }); - } - const countPart = mode === "build" ? `.${process.pid}-${++traceCount}` : mode === "server" ? `.${process.pid}` : ``; - const tracePath = combinePaths(traceDir, `trace${countPart}.json`); - const typesPath = combinePaths(traceDir, `types${countPart}.json`); - legend.push({ - configFilePath, - tracePath, - typesPath - }); - traceFd = fs.openSync(tracePath, "w"); - tracing = tracingEnabled2; - const meta = { cat: "__metadata", ph: "M", ts: 1e3 * timestamp(), pid: 1, tid: 1 }; - fs.writeSync( - traceFd, - "[\n" + [{ name: "process_name", args: { name: "tsc" }, ...meta }, { name: "thread_name", args: { name: "Main" }, ...meta }, { name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }].map((v) => JSON.stringify(v)).join(",\n") - ); - } - tracingEnabled2.startTracing = startTracing2; - function stopTracing() { - Debug.assert(tracing, "Tracing is not in progress"); - Debug.assert(!!typeCatalog.length === (mode !== "server")); - fs.writeSync(traceFd, ` -] -`); - fs.closeSync(traceFd); - tracing = void 0; - if (typeCatalog.length) { - dumpTypes(typeCatalog); - } else { - legend[legend.length - 1].typesPath = void 0; - } - } - tracingEnabled2.stopTracing = stopTracing; - function recordType(type) { - if (mode !== "server") { - typeCatalog.push(type); - } - } - tracingEnabled2.recordType = recordType; - let Phase; - ((Phase2) => { - Phase2["Parse"] = "parse"; - Phase2["Program"] = "program"; - Phase2["Bind"] = "bind"; - Phase2["Check"] = "check"; - Phase2["CheckTypes"] = "checkTypes"; - Phase2["Emit"] = "emit"; - Phase2["Session"] = "session"; - })(Phase = tracingEnabled2.Phase || (tracingEnabled2.Phase = {})); - function instant(phase, name, args) { - writeEvent("I", phase, name, args, `"s":"g"`); - } - tracingEnabled2.instant = instant; - const eventStack = []; - function push(phase, name, args, separateBeginAndEnd = false) { - if (separateBeginAndEnd) { - writeEvent("B", phase, name, args); - } - eventStack.push({ phase, name, args, time: 1e3 * timestamp(), separateBeginAndEnd }); - } - tracingEnabled2.push = push; - function pop(results) { - Debug.assert(eventStack.length > 0); - writeStackEvent(eventStack.length - 1, 1e3 * timestamp(), results); - eventStack.length--; - } - tracingEnabled2.pop = pop; - function popAll() { - const endTime = 1e3 * timestamp(); - for (let i = eventStack.length - 1; i >= 0; i--) { - writeStackEvent(i, endTime); - } - eventStack.length = 0; - } - tracingEnabled2.popAll = popAll; - const sampleInterval = 1e3 * 10; - function writeStackEvent(index, endTime, results) { - const { phase, name, args, time, separateBeginAndEnd } = eventStack[index]; - if (separateBeginAndEnd) { - Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`"); - writeEvent( - "E", - phase, - name, - args, - /*extras*/ - void 0, - endTime - ); - } else if (sampleInterval - time % sampleInterval <= endTime - time) { - writeEvent("X", phase, name, { ...args, results }, `"dur":${endTime - time}`, time); - } - } - function writeEvent(eventType, phase, name, args, extras, time = 1e3 * timestamp()) { - if (mode === "server" && phase === "checkTypes" /* CheckTypes */) return; - mark("beginTracing"); - fs.writeSync(traceFd, `, -{"pid":1,"tid":1,"ph":"${eventType}","cat":"${phase}","ts":${time},"name":"${name}"`); - if (extras) fs.writeSync(traceFd, `,${extras}`); - if (args) fs.writeSync(traceFd, `,"args":${JSON.stringify(args)}`); - fs.writeSync(traceFd, `}`); - mark("endTracing"); - measure("Tracing", "beginTracing", "endTracing"); - } - function getLocation(node) { - const file = getSourceFileOfNode(node); - return !file ? void 0 : { - path: file.path, - start: indexFromOne(getLineAndCharacterOfPosition(file, node.pos)), - end: indexFromOne(getLineAndCharacterOfPosition(file, node.end)) - }; - function indexFromOne(lc) { - return { - line: lc.line + 1, - character: lc.character + 1 - }; - } - } - function dumpTypes(types) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s; - mark("beginDumpTypes"); - const typesPath = legend[legend.length - 1].typesPath; - const typesFd = fs.openSync(typesPath, "w"); - const recursionIdentityMap = /* @__PURE__ */ new Map(); - fs.writeSync(typesFd, "["); - const numTypes = types.length; - for (let i = 0; i < numTypes; i++) { - const type = types[i]; - const objectFlags = type.objectFlags; - const symbol = type.aliasSymbol ?? type.symbol; - let display; - if (objectFlags & 16 /* Anonymous */ | type.flags & 2944 /* Literal */) { - try { - display = (_a = type.checker) == null ? void 0 : _a.typeToString(type); - } catch { - display = void 0; - } - } - let indexedAccessProperties = {}; - if (type.flags & 8388608 /* IndexedAccess */) { - const indexedAccessType = type; - indexedAccessProperties = { - indexedAccessObjectType: (_b = indexedAccessType.objectType) == null ? void 0 : _b.id, - indexedAccessIndexType: (_c = indexedAccessType.indexType) == null ? void 0 : _c.id - }; - } - let referenceProperties = {}; - if (objectFlags & 4 /* Reference */) { - const referenceType = type; - referenceProperties = { - instantiatedType: (_d = referenceType.target) == null ? void 0 : _d.id, - typeArguments: (_e = referenceType.resolvedTypeArguments) == null ? void 0 : _e.map((t) => t.id), - referenceLocation: getLocation(referenceType.node) - }; - } - let conditionalProperties = {}; - if (type.flags & 16777216 /* Conditional */) { - const conditionalType = type; - conditionalProperties = { - conditionalCheckType: (_f = conditionalType.checkType) == null ? void 0 : _f.id, - conditionalExtendsType: (_g = conditionalType.extendsType) == null ? void 0 : _g.id, - conditionalTrueType: ((_h = conditionalType.resolvedTrueType) == null ? void 0 : _h.id) ?? -1, - conditionalFalseType: ((_i = conditionalType.resolvedFalseType) == null ? void 0 : _i.id) ?? -1 - }; - } - let substitutionProperties = {}; - if (type.flags & 33554432 /* Substitution */) { - const substitutionType = type; - substitutionProperties = { - substitutionBaseType: (_j = substitutionType.baseType) == null ? void 0 : _j.id, - constraintType: (_k = substitutionType.constraint) == null ? void 0 : _k.id - }; - } - let reverseMappedProperties = {}; - if (objectFlags & 1024 /* ReverseMapped */) { - const reverseMappedType = type; - reverseMappedProperties = { - reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id, - reverseMappedMappedType: (_m = reverseMappedType.mappedType) == null ? void 0 : _m.id, - reverseMappedConstraintType: (_n = reverseMappedType.constraintType) == null ? void 0 : _n.id - }; - } - let evolvingArrayProperties = {}; - if (objectFlags & 256 /* EvolvingArray */) { - const evolvingArrayType = type; - evolvingArrayProperties = { - evolvingArrayElementType: evolvingArrayType.elementType.id, - evolvingArrayFinalType: (_o = evolvingArrayType.finalArrayType) == null ? void 0 : _o.id - }; - } - let recursionToken; - const recursionIdentity = type.checker.getRecursionIdentity(type); - if (recursionIdentity) { - recursionToken = recursionIdentityMap.get(recursionIdentity); - if (!recursionToken) { - recursionToken = recursionIdentityMap.size; - recursionIdentityMap.set(recursionIdentity, recursionToken); - } - } - const descriptor = { - id: type.id, - intrinsicName: type.intrinsicName, - symbolName: (symbol == null ? void 0 : symbol.escapedName) && unescapeLeadingUnderscores(symbol.escapedName), - recursionId: recursionToken, - isTuple: objectFlags & 8 /* Tuple */ ? true : void 0, - unionTypes: type.flags & 1048576 /* Union */ ? (_p = type.types) == null ? void 0 : _p.map((t) => t.id) : void 0, - intersectionTypes: type.flags & 2097152 /* Intersection */ ? type.types.map((t) => t.id) : void 0, - aliasTypeArguments: (_q = type.aliasTypeArguments) == null ? void 0 : _q.map((t) => t.id), - keyofType: type.flags & 4194304 /* Index */ ? (_r = type.type) == null ? void 0 : _r.id : void 0, - ...indexedAccessProperties, - ...referenceProperties, - ...conditionalProperties, - ...substitutionProperties, - ...reverseMappedProperties, - ...evolvingArrayProperties, - destructuringPattern: getLocation(type.pattern), - firstDeclaration: getLocation((_s = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _s[0]), - flags: Debug.formatTypeFlags(type.flags).split("|"), - display - }; - fs.writeSync(typesFd, JSON.stringify(descriptor)); - if (i < numTypes - 1) { - fs.writeSync(typesFd, ",\n"); - } - } - fs.writeSync(typesFd, "]\n"); - fs.closeSync(typesFd); - mark("endDumpTypes"); - measure("Dump types", "beginDumpTypes", "endDumpTypes"); - } - function dumpLegend() { - if (!legendPath) { - return; - } - fs.writeFileSync(legendPath, JSON.stringify(legend)); - } - tracingEnabled2.dumpLegend = dumpLegend; -})(tracingEnabled || (tracingEnabled = {})); -var startTracing = tracingEnabled.startTracing; -var dumpTracingLegend = tracingEnabled.dumpLegend; - -// src/compiler/types.ts -var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { - SyntaxKind5[SyntaxKind5["Unknown"] = 0] = "Unknown"; - SyntaxKind5[SyntaxKind5["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind5[SyntaxKind5["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind5[SyntaxKind5["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind5[SyntaxKind5["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind5[SyntaxKind5["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - SyntaxKind5[SyntaxKind5["ShebangTrivia"] = 6] = "ShebangTrivia"; - SyntaxKind5[SyntaxKind5["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; - SyntaxKind5[SyntaxKind5["NonTextFileMarkerTrivia"] = 8] = "NonTextFileMarkerTrivia"; - SyntaxKind5[SyntaxKind5["NumericLiteral"] = 9] = "NumericLiteral"; - SyntaxKind5[SyntaxKind5["BigIntLiteral"] = 10] = "BigIntLiteral"; - SyntaxKind5[SyntaxKind5["StringLiteral"] = 11] = "StringLiteral"; - SyntaxKind5[SyntaxKind5["JsxText"] = 12] = "JsxText"; - SyntaxKind5[SyntaxKind5["JsxTextAllWhiteSpaces"] = 13] = "JsxTextAllWhiteSpaces"; - SyntaxKind5[SyntaxKind5["RegularExpressionLiteral"] = 14] = "RegularExpressionLiteral"; - SyntaxKind5[SyntaxKind5["NoSubstitutionTemplateLiteral"] = 15] = "NoSubstitutionTemplateLiteral"; - SyntaxKind5[SyntaxKind5["TemplateHead"] = 16] = "TemplateHead"; - SyntaxKind5[SyntaxKind5["TemplateMiddle"] = 17] = "TemplateMiddle"; - SyntaxKind5[SyntaxKind5["TemplateTail"] = 18] = "TemplateTail"; - SyntaxKind5[SyntaxKind5["OpenBraceToken"] = 19] = "OpenBraceToken"; - SyntaxKind5[SyntaxKind5["CloseBraceToken"] = 20] = "CloseBraceToken"; - SyntaxKind5[SyntaxKind5["OpenParenToken"] = 21] = "OpenParenToken"; - SyntaxKind5[SyntaxKind5["CloseParenToken"] = 22] = "CloseParenToken"; - SyntaxKind5[SyntaxKind5["OpenBracketToken"] = 23] = "OpenBracketToken"; - SyntaxKind5[SyntaxKind5["CloseBracketToken"] = 24] = "CloseBracketToken"; - SyntaxKind5[SyntaxKind5["DotToken"] = 25] = "DotToken"; - SyntaxKind5[SyntaxKind5["DotDotDotToken"] = 26] = "DotDotDotToken"; - SyntaxKind5[SyntaxKind5["SemicolonToken"] = 27] = "SemicolonToken"; - SyntaxKind5[SyntaxKind5["CommaToken"] = 28] = "CommaToken"; - SyntaxKind5[SyntaxKind5["QuestionDotToken"] = 29] = "QuestionDotToken"; - SyntaxKind5[SyntaxKind5["LessThanToken"] = 30] = "LessThanToken"; - SyntaxKind5[SyntaxKind5["LessThanSlashToken"] = 31] = "LessThanSlashToken"; - SyntaxKind5[SyntaxKind5["GreaterThanToken"] = 32] = "GreaterThanToken"; - SyntaxKind5[SyntaxKind5["LessThanEqualsToken"] = 33] = "LessThanEqualsToken"; - SyntaxKind5[SyntaxKind5["GreaterThanEqualsToken"] = 34] = "GreaterThanEqualsToken"; - SyntaxKind5[SyntaxKind5["EqualsEqualsToken"] = 35] = "EqualsEqualsToken"; - SyntaxKind5[SyntaxKind5["ExclamationEqualsToken"] = 36] = "ExclamationEqualsToken"; - SyntaxKind5[SyntaxKind5["EqualsEqualsEqualsToken"] = 37] = "EqualsEqualsEqualsToken"; - SyntaxKind5[SyntaxKind5["ExclamationEqualsEqualsToken"] = 38] = "ExclamationEqualsEqualsToken"; - SyntaxKind5[SyntaxKind5["EqualsGreaterThanToken"] = 39] = "EqualsGreaterThanToken"; - SyntaxKind5[SyntaxKind5["PlusToken"] = 40] = "PlusToken"; - SyntaxKind5[SyntaxKind5["MinusToken"] = 41] = "MinusToken"; - SyntaxKind5[SyntaxKind5["AsteriskToken"] = 42] = "AsteriskToken"; - SyntaxKind5[SyntaxKind5["AsteriskAsteriskToken"] = 43] = "AsteriskAsteriskToken"; - SyntaxKind5[SyntaxKind5["SlashToken"] = 44] = "SlashToken"; - SyntaxKind5[SyntaxKind5["PercentToken"] = 45] = "PercentToken"; - SyntaxKind5[SyntaxKind5["PlusPlusToken"] = 46] = "PlusPlusToken"; - SyntaxKind5[SyntaxKind5["MinusMinusToken"] = 47] = "MinusMinusToken"; - SyntaxKind5[SyntaxKind5["LessThanLessThanToken"] = 48] = "LessThanLessThanToken"; - SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanToken"] = 49] = "GreaterThanGreaterThanToken"; - SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanGreaterThanToken"] = 50] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind5[SyntaxKind5["AmpersandToken"] = 51] = "AmpersandToken"; - SyntaxKind5[SyntaxKind5["BarToken"] = 52] = "BarToken"; - SyntaxKind5[SyntaxKind5["CaretToken"] = 53] = "CaretToken"; - SyntaxKind5[SyntaxKind5["ExclamationToken"] = 54] = "ExclamationToken"; - SyntaxKind5[SyntaxKind5["TildeToken"] = 55] = "TildeToken"; - SyntaxKind5[SyntaxKind5["AmpersandAmpersandToken"] = 56] = "AmpersandAmpersandToken"; - SyntaxKind5[SyntaxKind5["BarBarToken"] = 57] = "BarBarToken"; - SyntaxKind5[SyntaxKind5["QuestionToken"] = 58] = "QuestionToken"; - SyntaxKind5[SyntaxKind5["ColonToken"] = 59] = "ColonToken"; - SyntaxKind5[SyntaxKind5["AtToken"] = 60] = "AtToken"; - SyntaxKind5[SyntaxKind5["QuestionQuestionToken"] = 61] = "QuestionQuestionToken"; - SyntaxKind5[SyntaxKind5["BacktickToken"] = 62] = "BacktickToken"; - SyntaxKind5[SyntaxKind5["HashToken"] = 63] = "HashToken"; - SyntaxKind5[SyntaxKind5["EqualsToken"] = 64] = "EqualsToken"; - SyntaxKind5[SyntaxKind5["PlusEqualsToken"] = 65] = "PlusEqualsToken"; - SyntaxKind5[SyntaxKind5["MinusEqualsToken"] = 66] = "MinusEqualsToken"; - SyntaxKind5[SyntaxKind5["AsteriskEqualsToken"] = 67] = "AsteriskEqualsToken"; - SyntaxKind5[SyntaxKind5["AsteriskAsteriskEqualsToken"] = 68] = "AsteriskAsteriskEqualsToken"; - SyntaxKind5[SyntaxKind5["SlashEqualsToken"] = 69] = "SlashEqualsToken"; - SyntaxKind5[SyntaxKind5["PercentEqualsToken"] = 70] = "PercentEqualsToken"; - SyntaxKind5[SyntaxKind5["LessThanLessThanEqualsToken"] = 71] = "LessThanLessThanEqualsToken"; - SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanEqualsToken"] = 72] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanGreaterThanEqualsToken"] = 73] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind5[SyntaxKind5["AmpersandEqualsToken"] = 74] = "AmpersandEqualsToken"; - SyntaxKind5[SyntaxKind5["BarEqualsToken"] = 75] = "BarEqualsToken"; - SyntaxKind5[SyntaxKind5["BarBarEqualsToken"] = 76] = "BarBarEqualsToken"; - SyntaxKind5[SyntaxKind5["AmpersandAmpersandEqualsToken"] = 77] = "AmpersandAmpersandEqualsToken"; - SyntaxKind5[SyntaxKind5["QuestionQuestionEqualsToken"] = 78] = "QuestionQuestionEqualsToken"; - SyntaxKind5[SyntaxKind5["CaretEqualsToken"] = 79] = "CaretEqualsToken"; - SyntaxKind5[SyntaxKind5["Identifier"] = 80] = "Identifier"; - SyntaxKind5[SyntaxKind5["PrivateIdentifier"] = 81] = "PrivateIdentifier"; - SyntaxKind5[SyntaxKind5["JSDocCommentTextToken"] = 82] = "JSDocCommentTextToken"; - SyntaxKind5[SyntaxKind5["BreakKeyword"] = 83] = "BreakKeyword"; - SyntaxKind5[SyntaxKind5["CaseKeyword"] = 84] = "CaseKeyword"; - SyntaxKind5[SyntaxKind5["CatchKeyword"] = 85] = "CatchKeyword"; - SyntaxKind5[SyntaxKind5["ClassKeyword"] = 86] = "ClassKeyword"; - SyntaxKind5[SyntaxKind5["ConstKeyword"] = 87] = "ConstKeyword"; - SyntaxKind5[SyntaxKind5["ContinueKeyword"] = 88] = "ContinueKeyword"; - SyntaxKind5[SyntaxKind5["DebuggerKeyword"] = 89] = "DebuggerKeyword"; - SyntaxKind5[SyntaxKind5["DefaultKeyword"] = 90] = "DefaultKeyword"; - SyntaxKind5[SyntaxKind5["DeleteKeyword"] = 91] = "DeleteKeyword"; - SyntaxKind5[SyntaxKind5["DoKeyword"] = 92] = "DoKeyword"; - SyntaxKind5[SyntaxKind5["ElseKeyword"] = 93] = "ElseKeyword"; - SyntaxKind5[SyntaxKind5["EnumKeyword"] = 94] = "EnumKeyword"; - SyntaxKind5[SyntaxKind5["ExportKeyword"] = 95] = "ExportKeyword"; - SyntaxKind5[SyntaxKind5["ExtendsKeyword"] = 96] = "ExtendsKeyword"; - SyntaxKind5[SyntaxKind5["FalseKeyword"] = 97] = "FalseKeyword"; - SyntaxKind5[SyntaxKind5["FinallyKeyword"] = 98] = "FinallyKeyword"; - SyntaxKind5[SyntaxKind5["ForKeyword"] = 99] = "ForKeyword"; - SyntaxKind5[SyntaxKind5["FunctionKeyword"] = 100] = "FunctionKeyword"; - SyntaxKind5[SyntaxKind5["IfKeyword"] = 101] = "IfKeyword"; - SyntaxKind5[SyntaxKind5["ImportKeyword"] = 102] = "ImportKeyword"; - SyntaxKind5[SyntaxKind5["InKeyword"] = 103] = "InKeyword"; - SyntaxKind5[SyntaxKind5["InstanceOfKeyword"] = 104] = "InstanceOfKeyword"; - SyntaxKind5[SyntaxKind5["NewKeyword"] = 105] = "NewKeyword"; - SyntaxKind5[SyntaxKind5["NullKeyword"] = 106] = "NullKeyword"; - SyntaxKind5[SyntaxKind5["ReturnKeyword"] = 107] = "ReturnKeyword"; - SyntaxKind5[SyntaxKind5["SuperKeyword"] = 108] = "SuperKeyword"; - SyntaxKind5[SyntaxKind5["SwitchKeyword"] = 109] = "SwitchKeyword"; - SyntaxKind5[SyntaxKind5["ThisKeyword"] = 110] = "ThisKeyword"; - SyntaxKind5[SyntaxKind5["ThrowKeyword"] = 111] = "ThrowKeyword"; - SyntaxKind5[SyntaxKind5["TrueKeyword"] = 112] = "TrueKeyword"; - SyntaxKind5[SyntaxKind5["TryKeyword"] = 113] = "TryKeyword"; - SyntaxKind5[SyntaxKind5["TypeOfKeyword"] = 114] = "TypeOfKeyword"; - SyntaxKind5[SyntaxKind5["VarKeyword"] = 115] = "VarKeyword"; - SyntaxKind5[SyntaxKind5["VoidKeyword"] = 116] = "VoidKeyword"; - SyntaxKind5[SyntaxKind5["WhileKeyword"] = 117] = "WhileKeyword"; - SyntaxKind5[SyntaxKind5["WithKeyword"] = 118] = "WithKeyword"; - SyntaxKind5[SyntaxKind5["ImplementsKeyword"] = 119] = "ImplementsKeyword"; - SyntaxKind5[SyntaxKind5["InterfaceKeyword"] = 120] = "InterfaceKeyword"; - SyntaxKind5[SyntaxKind5["LetKeyword"] = 121] = "LetKeyword"; - SyntaxKind5[SyntaxKind5["PackageKeyword"] = 122] = "PackageKeyword"; - SyntaxKind5[SyntaxKind5["PrivateKeyword"] = 123] = "PrivateKeyword"; - SyntaxKind5[SyntaxKind5["ProtectedKeyword"] = 124] = "ProtectedKeyword"; - SyntaxKind5[SyntaxKind5["PublicKeyword"] = 125] = "PublicKeyword"; - SyntaxKind5[SyntaxKind5["StaticKeyword"] = 126] = "StaticKeyword"; - SyntaxKind5[SyntaxKind5["YieldKeyword"] = 127] = "YieldKeyword"; - SyntaxKind5[SyntaxKind5["AbstractKeyword"] = 128] = "AbstractKeyword"; - SyntaxKind5[SyntaxKind5["AccessorKeyword"] = 129] = "AccessorKeyword"; - SyntaxKind5[SyntaxKind5["AsKeyword"] = 130] = "AsKeyword"; - SyntaxKind5[SyntaxKind5["AssertsKeyword"] = 131] = "AssertsKeyword"; - SyntaxKind5[SyntaxKind5["AssertKeyword"] = 132] = "AssertKeyword"; - SyntaxKind5[SyntaxKind5["AnyKeyword"] = 133] = "AnyKeyword"; - SyntaxKind5[SyntaxKind5["AsyncKeyword"] = 134] = "AsyncKeyword"; - SyntaxKind5[SyntaxKind5["AwaitKeyword"] = 135] = "AwaitKeyword"; - SyntaxKind5[SyntaxKind5["BooleanKeyword"] = 136] = "BooleanKeyword"; - SyntaxKind5[SyntaxKind5["ConstructorKeyword"] = 137] = "ConstructorKeyword"; - SyntaxKind5[SyntaxKind5["DeclareKeyword"] = 138] = "DeclareKeyword"; - SyntaxKind5[SyntaxKind5["GetKeyword"] = 139] = "GetKeyword"; - SyntaxKind5[SyntaxKind5["InferKeyword"] = 140] = "InferKeyword"; - SyntaxKind5[SyntaxKind5["IntrinsicKeyword"] = 141] = "IntrinsicKeyword"; - SyntaxKind5[SyntaxKind5["IsKeyword"] = 142] = "IsKeyword"; - SyntaxKind5[SyntaxKind5["KeyOfKeyword"] = 143] = "KeyOfKeyword"; - SyntaxKind5[SyntaxKind5["ModuleKeyword"] = 144] = "ModuleKeyword"; - SyntaxKind5[SyntaxKind5["NamespaceKeyword"] = 145] = "NamespaceKeyword"; - SyntaxKind5[SyntaxKind5["NeverKeyword"] = 146] = "NeverKeyword"; - SyntaxKind5[SyntaxKind5["OutKeyword"] = 147] = "OutKeyword"; - SyntaxKind5[SyntaxKind5["ReadonlyKeyword"] = 148] = "ReadonlyKeyword"; - SyntaxKind5[SyntaxKind5["RequireKeyword"] = 149] = "RequireKeyword"; - SyntaxKind5[SyntaxKind5["NumberKeyword"] = 150] = "NumberKeyword"; - SyntaxKind5[SyntaxKind5["ObjectKeyword"] = 151] = "ObjectKeyword"; - SyntaxKind5[SyntaxKind5["SatisfiesKeyword"] = 152] = "SatisfiesKeyword"; - SyntaxKind5[SyntaxKind5["SetKeyword"] = 153] = "SetKeyword"; - SyntaxKind5[SyntaxKind5["StringKeyword"] = 154] = "StringKeyword"; - SyntaxKind5[SyntaxKind5["SymbolKeyword"] = 155] = "SymbolKeyword"; - SyntaxKind5[SyntaxKind5["TypeKeyword"] = 156] = "TypeKeyword"; - SyntaxKind5[SyntaxKind5["UndefinedKeyword"] = 157] = "UndefinedKeyword"; - SyntaxKind5[SyntaxKind5["UniqueKeyword"] = 158] = "UniqueKeyword"; - SyntaxKind5[SyntaxKind5["UnknownKeyword"] = 159] = "UnknownKeyword"; - 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["DeferKeyword"] = 166] = "DeferKeyword"; - SyntaxKind5[SyntaxKind5["QualifiedName"] = 167] = "QualifiedName"; - SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 168] = "ComputedPropertyName"; - SyntaxKind5[SyntaxKind5["TypeParameter"] = 169] = "TypeParameter"; - SyntaxKind5[SyntaxKind5["Parameter"] = 170] = "Parameter"; - SyntaxKind5[SyntaxKind5["Decorator"] = 171] = "Decorator"; - SyntaxKind5[SyntaxKind5["PropertySignature"] = 172] = "PropertySignature"; - SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 173] = "PropertyDeclaration"; - SyntaxKind5[SyntaxKind5["MethodSignature"] = 174] = "MethodSignature"; - SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 175] = "MethodDeclaration"; - SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 176] = "ClassStaticBlockDeclaration"; - SyntaxKind5[SyntaxKind5["Constructor"] = 177] = "Constructor"; - SyntaxKind5[SyntaxKind5["GetAccessor"] = 178] = "GetAccessor"; - SyntaxKind5[SyntaxKind5["SetAccessor"] = 179] = "SetAccessor"; - SyntaxKind5[SyntaxKind5["CallSignature"] = 180] = "CallSignature"; - SyntaxKind5[SyntaxKind5["ConstructSignature"] = 181] = "ConstructSignature"; - SyntaxKind5[SyntaxKind5["IndexSignature"] = 182] = "IndexSignature"; - SyntaxKind5[SyntaxKind5["TypePredicate"] = 183] = "TypePredicate"; - SyntaxKind5[SyntaxKind5["TypeReference"] = 184] = "TypeReference"; - SyntaxKind5[SyntaxKind5["FunctionType"] = 185] = "FunctionType"; - SyntaxKind5[SyntaxKind5["ConstructorType"] = 186] = "ConstructorType"; - SyntaxKind5[SyntaxKind5["TypeQuery"] = 187] = "TypeQuery"; - SyntaxKind5[SyntaxKind5["TypeLiteral"] = 188] = "TypeLiteral"; - SyntaxKind5[SyntaxKind5["ArrayType"] = 189] = "ArrayType"; - SyntaxKind5[SyntaxKind5["TupleType"] = 190] = "TupleType"; - SyntaxKind5[SyntaxKind5["OptionalType"] = 191] = "OptionalType"; - SyntaxKind5[SyntaxKind5["RestType"] = 192] = "RestType"; - SyntaxKind5[SyntaxKind5["UnionType"] = 193] = "UnionType"; - SyntaxKind5[SyntaxKind5["IntersectionType"] = 194] = "IntersectionType"; - SyntaxKind5[SyntaxKind5["ConditionalType"] = 195] = "ConditionalType"; - SyntaxKind5[SyntaxKind5["InferType"] = 196] = "InferType"; - SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 197] = "ParenthesizedType"; - SyntaxKind5[SyntaxKind5["ThisType"] = 198] = "ThisType"; - SyntaxKind5[SyntaxKind5["TypeOperator"] = 199] = "TypeOperator"; - SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 200] = "IndexedAccessType"; - SyntaxKind5[SyntaxKind5["MappedType"] = 201] = "MappedType"; - SyntaxKind5[SyntaxKind5["LiteralType"] = 202] = "LiteralType"; - SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 203] = "NamedTupleMember"; - SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 204] = "TemplateLiteralType"; - SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 205] = "TemplateLiteralTypeSpan"; - SyntaxKind5[SyntaxKind5["ImportType"] = 206] = "ImportType"; - SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 207] = "ObjectBindingPattern"; - SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 208] = "ArrayBindingPattern"; - SyntaxKind5[SyntaxKind5["BindingElement"] = 209] = "BindingElement"; - SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 210] = "ArrayLiteralExpression"; - SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 211] = "ObjectLiteralExpression"; - SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 212] = "PropertyAccessExpression"; - SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 213] = "ElementAccessExpression"; - SyntaxKind5[SyntaxKind5["CallExpression"] = 214] = "CallExpression"; - SyntaxKind5[SyntaxKind5["NewExpression"] = 215] = "NewExpression"; - SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 216] = "TaggedTemplateExpression"; - SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 217] = "TypeAssertionExpression"; - SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 218] = "ParenthesizedExpression"; - SyntaxKind5[SyntaxKind5["FunctionExpression"] = 219] = "FunctionExpression"; - SyntaxKind5[SyntaxKind5["ArrowFunction"] = 220] = "ArrowFunction"; - SyntaxKind5[SyntaxKind5["DeleteExpression"] = 221] = "DeleteExpression"; - SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 222] = "TypeOfExpression"; - SyntaxKind5[SyntaxKind5["VoidExpression"] = 223] = "VoidExpression"; - SyntaxKind5[SyntaxKind5["AwaitExpression"] = 224] = "AwaitExpression"; - SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression"; - SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression"; - SyntaxKind5[SyntaxKind5["BinaryExpression"] = 227] = "BinaryExpression"; - SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 228] = "ConditionalExpression"; - SyntaxKind5[SyntaxKind5["TemplateExpression"] = 229] = "TemplateExpression"; - SyntaxKind5[SyntaxKind5["YieldExpression"] = 230] = "YieldExpression"; - SyntaxKind5[SyntaxKind5["SpreadElement"] = 231] = "SpreadElement"; - SyntaxKind5[SyntaxKind5["ClassExpression"] = 232] = "ClassExpression"; - SyntaxKind5[SyntaxKind5["OmittedExpression"] = 233] = "OmittedExpression"; - SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments"; - SyntaxKind5[SyntaxKind5["AsExpression"] = 235] = "AsExpression"; - SyntaxKind5[SyntaxKind5["NonNullExpression"] = 236] = "NonNullExpression"; - SyntaxKind5[SyntaxKind5["MetaProperty"] = 237] = "MetaProperty"; - SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 238] = "SyntheticExpression"; - SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 239] = "SatisfiesExpression"; - SyntaxKind5[SyntaxKind5["TemplateSpan"] = 240] = "TemplateSpan"; - SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 241] = "SemicolonClassElement"; - SyntaxKind5[SyntaxKind5["Block"] = 242] = "Block"; - SyntaxKind5[SyntaxKind5["EmptyStatement"] = 243] = "EmptyStatement"; - SyntaxKind5[SyntaxKind5["VariableStatement"] = 244] = "VariableStatement"; - SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 245] = "ExpressionStatement"; - SyntaxKind5[SyntaxKind5["IfStatement"] = 246] = "IfStatement"; - SyntaxKind5[SyntaxKind5["DoStatement"] = 247] = "DoStatement"; - SyntaxKind5[SyntaxKind5["WhileStatement"] = 248] = "WhileStatement"; - SyntaxKind5[SyntaxKind5["ForStatement"] = 249] = "ForStatement"; - SyntaxKind5[SyntaxKind5["ForInStatement"] = 250] = "ForInStatement"; - SyntaxKind5[SyntaxKind5["ForOfStatement"] = 251] = "ForOfStatement"; - SyntaxKind5[SyntaxKind5["ContinueStatement"] = 252] = "ContinueStatement"; - SyntaxKind5[SyntaxKind5["BreakStatement"] = 253] = "BreakStatement"; - SyntaxKind5[SyntaxKind5["ReturnStatement"] = 254] = "ReturnStatement"; - SyntaxKind5[SyntaxKind5["WithStatement"] = 255] = "WithStatement"; - SyntaxKind5[SyntaxKind5["SwitchStatement"] = 256] = "SwitchStatement"; - SyntaxKind5[SyntaxKind5["LabeledStatement"] = 257] = "LabeledStatement"; - SyntaxKind5[SyntaxKind5["ThrowStatement"] = 258] = "ThrowStatement"; - SyntaxKind5[SyntaxKind5["TryStatement"] = 259] = "TryStatement"; - SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 260] = "DebuggerStatement"; - SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 261] = "VariableDeclaration"; - SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 262] = "VariableDeclarationList"; - SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 263] = "FunctionDeclaration"; - SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 264] = "ClassDeclaration"; - SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 265] = "InterfaceDeclaration"; - SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 266] = "TypeAliasDeclaration"; - SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 267] = "EnumDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 268] = "ModuleDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleBlock"] = 269] = "ModuleBlock"; - SyntaxKind5[SyntaxKind5["CaseBlock"] = 270] = "CaseBlock"; - SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 271] = "NamespaceExportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 272] = "ImportEqualsDeclaration"; - SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 273] = "ImportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportClause"] = 274] = "ImportClause"; - SyntaxKind5[SyntaxKind5["NamespaceImport"] = 275] = "NamespaceImport"; - SyntaxKind5[SyntaxKind5["NamedImports"] = 276] = "NamedImports"; - SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 277] = "ImportSpecifier"; - SyntaxKind5[SyntaxKind5["ExportAssignment"] = 278] = "ExportAssignment"; - SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 279] = "ExportDeclaration"; - SyntaxKind5[SyntaxKind5["NamedExports"] = 280] = "NamedExports"; - SyntaxKind5[SyntaxKind5["NamespaceExport"] = 281] = "NamespaceExport"; - SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 282] = "ExportSpecifier"; - SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 283] = "MissingDeclaration"; - SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 284] = "ExternalModuleReference"; - SyntaxKind5[SyntaxKind5["JsxElement"] = 285] = "JsxElement"; - SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 286] = "JsxSelfClosingElement"; - SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 287] = "JsxOpeningElement"; - SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 288] = "JsxClosingElement"; - SyntaxKind5[SyntaxKind5["JsxFragment"] = 289] = "JsxFragment"; - SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 290] = "JsxOpeningFragment"; - SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 291] = "JsxClosingFragment"; - SyntaxKind5[SyntaxKind5["JsxAttribute"] = 292] = "JsxAttribute"; - SyntaxKind5[SyntaxKind5["JsxAttributes"] = 293] = "JsxAttributes"; - SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 294] = "JsxSpreadAttribute"; - SyntaxKind5[SyntaxKind5["JsxExpression"] = 295] = "JsxExpression"; - SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 296] = "JsxNamespacedName"; - SyntaxKind5[SyntaxKind5["CaseClause"] = 297] = "CaseClause"; - SyntaxKind5[SyntaxKind5["DefaultClause"] = 298] = "DefaultClause"; - SyntaxKind5[SyntaxKind5["HeritageClause"] = 299] = "HeritageClause"; - SyntaxKind5[SyntaxKind5["CatchClause"] = 300] = "CatchClause"; - SyntaxKind5[SyntaxKind5["ImportAttributes"] = 301] = "ImportAttributes"; - SyntaxKind5[SyntaxKind5["ImportAttribute"] = 302] = "ImportAttribute"; - SyntaxKind5[SyntaxKind5["AssertClause"] = 301 /* ImportAttributes */] = "AssertClause"; - SyntaxKind5[SyntaxKind5["AssertEntry"] = 302 /* ImportAttribute */] = "AssertEntry"; - SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 303] = "ImportTypeAssertionContainer"; - SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 304] = "PropertyAssignment"; - SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 305] = "ShorthandPropertyAssignment"; - SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 306] = "SpreadAssignment"; - SyntaxKind5[SyntaxKind5["EnumMember"] = 307] = "EnumMember"; - SyntaxKind5[SyntaxKind5["SourceFile"] = 308] = "SourceFile"; - SyntaxKind5[SyntaxKind5["Bundle"] = 309] = "Bundle"; - SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 310] = "JSDocTypeExpression"; - SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 311] = "JSDocNameReference"; - SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 312] = "JSDocMemberName"; - SyntaxKind5[SyntaxKind5["JSDocAllType"] = 313] = "JSDocAllType"; - SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 314] = "JSDocUnknownType"; - SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 315] = "JSDocNullableType"; - SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 316] = "JSDocNonNullableType"; - SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 317] = "JSDocOptionalType"; - SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 318] = "JSDocFunctionType"; - SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 319] = "JSDocVariadicType"; - SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 320] = "JSDocNamepathType"; - SyntaxKind5[SyntaxKind5["JSDoc"] = 321] = "JSDoc"; - SyntaxKind5[SyntaxKind5["JSDocComment"] = 321 /* JSDoc */] = "JSDocComment"; - SyntaxKind5[SyntaxKind5["JSDocText"] = 322] = "JSDocText"; - SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 323] = "JSDocTypeLiteral"; - SyntaxKind5[SyntaxKind5["JSDocSignature"] = 324] = "JSDocSignature"; - SyntaxKind5[SyntaxKind5["JSDocLink"] = 325] = "JSDocLink"; - SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 326] = "JSDocLinkCode"; - SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 327] = "JSDocLinkPlain"; - SyntaxKind5[SyntaxKind5["JSDocTag"] = 328] = "JSDocTag"; - SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 329] = "JSDocAugmentsTag"; - SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 330] = "JSDocImplementsTag"; - SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 331] = "JSDocAuthorTag"; - SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 332] = "JSDocDeprecatedTag"; - SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 333] = "JSDocClassTag"; - SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 334] = "JSDocPublicTag"; - SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 335] = "JSDocPrivateTag"; - SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 336] = "JSDocProtectedTag"; - SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 337] = "JSDocReadonlyTag"; - SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 338] = "JSDocOverrideTag"; - SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 339] = "JSDocCallbackTag"; - SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 340] = "JSDocOverloadTag"; - SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 341] = "JSDocEnumTag"; - SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 342] = "JSDocParameterTag"; - SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 343] = "JSDocReturnTag"; - SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 344] = "JSDocThisTag"; - SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 345] = "JSDocTypeTag"; - SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 346] = "JSDocTemplateTag"; - SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 347] = "JSDocTypedefTag"; - SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 348] = "JSDocSeeTag"; - SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 349] = "JSDocPropertyTag"; - SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 350] = "JSDocThrowsTag"; - SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 351] = "JSDocSatisfiesTag"; - SyntaxKind5[SyntaxKind5["JSDocImportTag"] = 352] = "JSDocImportTag"; - SyntaxKind5[SyntaxKind5["SyntaxList"] = 353] = "SyntaxList"; - SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 354] = "NotEmittedStatement"; - SyntaxKind5[SyntaxKind5["NotEmittedTypeElement"] = 355] = "NotEmittedTypeElement"; - SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; - SyntaxKind5[SyntaxKind5["CommaListExpression"] = 357] = "CommaListExpression"; - SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 358] = "SyntheticReferenceExpression"; - SyntaxKind5[SyntaxKind5["Count"] = 359] = "Count"; - SyntaxKind5[SyntaxKind5["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment"; - SyntaxKind5[SyntaxKind5["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment"; - SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment"; - SyntaxKind5[SyntaxKind5["LastCompoundAssignment"] = 79 /* CaretEqualsToken */] = "LastCompoundAssignment"; - SyntaxKind5[SyntaxKind5["FirstReservedWord"] = 83 /* BreakKeyword */] = "FirstReservedWord"; - SyntaxKind5[SyntaxKind5["LastReservedWord"] = 118 /* WithKeyword */] = "LastReservedWord"; - SyntaxKind5[SyntaxKind5["FirstKeyword"] = 83 /* BreakKeyword */] = "FirstKeyword"; - SyntaxKind5[SyntaxKind5["LastKeyword"] = 166 /* DeferKeyword */] = "LastKeyword"; - SyntaxKind5[SyntaxKind5["FirstFutureReservedWord"] = 119 /* ImplementsKeyword */] = "FirstFutureReservedWord"; - SyntaxKind5[SyntaxKind5["LastFutureReservedWord"] = 127 /* YieldKeyword */] = "LastFutureReservedWord"; - SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 183 /* TypePredicate */] = "FirstTypeNode"; - SyntaxKind5[SyntaxKind5["LastTypeNode"] = 206 /* ImportType */] = "LastTypeNode"; - SyntaxKind5[SyntaxKind5["FirstPunctuation"] = 19 /* OpenBraceToken */] = "FirstPunctuation"; - SyntaxKind5[SyntaxKind5["LastPunctuation"] = 79 /* CaretEqualsToken */] = "LastPunctuation"; - SyntaxKind5[SyntaxKind5["FirstToken"] = 0 /* Unknown */] = "FirstToken"; - SyntaxKind5[SyntaxKind5["LastToken"] = 166 /* LastKeyword */] = "LastToken"; - SyntaxKind5[SyntaxKind5["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken"; - SyntaxKind5[SyntaxKind5["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken"; - SyntaxKind5[SyntaxKind5["FirstLiteralToken"] = 9 /* NumericLiteral */] = "FirstLiteralToken"; - SyntaxKind5[SyntaxKind5["LastLiteralToken"] = 15 /* NoSubstitutionTemplateLiteral */] = "LastLiteralToken"; - SyntaxKind5[SyntaxKind5["FirstTemplateToken"] = 15 /* NoSubstitutionTemplateLiteral */] = "FirstTemplateToken"; - SyntaxKind5[SyntaxKind5["LastTemplateToken"] = 18 /* TemplateTail */] = "LastTemplateToken"; - SyntaxKind5[SyntaxKind5["FirstBinaryOperator"] = 30 /* LessThanToken */] = "FirstBinaryOperator"; - SyntaxKind5[SyntaxKind5["LastBinaryOperator"] = 79 /* CaretEqualsToken */] = "LastBinaryOperator"; - SyntaxKind5[SyntaxKind5["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement"; - SyntaxKind5[SyntaxKind5["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement"; - SyntaxKind5[SyntaxKind5["FirstNode"] = 167 /* QualifiedName */] = "FirstNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 310 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 352 /* JSDocImportTag */] = "LastJSDocNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 328 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 352 /* JSDocImportTag */] = "LastJSDocTagNode"; - SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword"; - SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 166 /* LastKeyword */] = "LastContextualKeyword"; - return SyntaxKind5; -})(SyntaxKind || {}); -var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { - NodeFlags3[NodeFlags3["None"] = 0] = "None"; - NodeFlags3[NodeFlags3["Let"] = 1] = "Let"; - NodeFlags3[NodeFlags3["Const"] = 2] = "Const"; - 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 || {}); -var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { - ModifierFlags3[ModifierFlags3["None"] = 0] = "None"; - 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"] = 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 || {}); -var JsxFlags = /* @__PURE__ */ ((JsxFlags2) => { - JsxFlags2[JsxFlags2["None"] = 0] = "None"; - JsxFlags2[JsxFlags2["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; - JsxFlags2[JsxFlags2["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; - JsxFlags2[JsxFlags2["IntrinsicElement"] = 3] = "IntrinsicElement"; - return JsxFlags2; -})(JsxFlags || {}); -var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => { - RelationComparisonResult3[RelationComparisonResult3["None"] = 0] = "None"; - RelationComparisonResult3[RelationComparisonResult3["Succeeded"] = 1] = "Succeeded"; - RelationComparisonResult3[RelationComparisonResult3["Failed"] = 2] = "Failed"; - RelationComparisonResult3[RelationComparisonResult3["ReportsUnmeasurable"] = 8] = "ReportsUnmeasurable"; - RelationComparisonResult3[RelationComparisonResult3["ReportsUnreliable"] = 16] = "ReportsUnreliable"; - RelationComparisonResult3[RelationComparisonResult3["ReportsMask"] = 24] = "ReportsMask"; - RelationComparisonResult3[RelationComparisonResult3["ComplexityOverflow"] = 32] = "ComplexityOverflow"; - RelationComparisonResult3[RelationComparisonResult3["StackDepthOverflow"] = 64] = "StackDepthOverflow"; - RelationComparisonResult3[RelationComparisonResult3["Overflow"] = 96] = "Overflow"; - return RelationComparisonResult3; -})(RelationComparisonResult || {}); -var PredicateSemantics = /* @__PURE__ */ ((PredicateSemantics2) => { - PredicateSemantics2[PredicateSemantics2["None"] = 0] = "None"; - PredicateSemantics2[PredicateSemantics2["Always"] = 1] = "Always"; - PredicateSemantics2[PredicateSemantics2["Never"] = 2] = "Never"; - PredicateSemantics2[PredicateSemantics2["Sometimes"] = 3] = "Sometimes"; - return PredicateSemantics2; -})(PredicateSemantics || {}); -var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => { - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel"; - GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; - return GeneratedIdentifierFlags2; -})(GeneratedIdentifierFlags || {}); -var RegularExpressionFlags = /* @__PURE__ */ ((RegularExpressionFlags2) => { - RegularExpressionFlags2[RegularExpressionFlags2["None"] = 0] = "None"; - RegularExpressionFlags2[RegularExpressionFlags2["HasIndices"] = 1] = "HasIndices"; - RegularExpressionFlags2[RegularExpressionFlags2["Global"] = 2] = "Global"; - RegularExpressionFlags2[RegularExpressionFlags2["IgnoreCase"] = 4] = "IgnoreCase"; - RegularExpressionFlags2[RegularExpressionFlags2["Multiline"] = 8] = "Multiline"; - RegularExpressionFlags2[RegularExpressionFlags2["DotAll"] = 16] = "DotAll"; - RegularExpressionFlags2[RegularExpressionFlags2["Unicode"] = 32] = "Unicode"; - RegularExpressionFlags2[RegularExpressionFlags2["UnicodeSets"] = 64] = "UnicodeSets"; - RegularExpressionFlags2[RegularExpressionFlags2["Sticky"] = 128] = "Sticky"; - RegularExpressionFlags2[RegularExpressionFlags2["AnyUnicodeMode"] = 96] = "AnyUnicodeMode"; - RegularExpressionFlags2[RegularExpressionFlags2["Modifiers"] = 28] = "Modifiers"; - return RegularExpressionFlags2; -})(RegularExpressionFlags || {}); -var TokenFlags = /* @__PURE__ */ ((TokenFlags2) => { - TokenFlags2[TokenFlags2["None"] = 0] = "None"; - TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 1] = "PrecedingLineBreak"; - TokenFlags2[TokenFlags2["PrecedingJSDocComment"] = 2] = "PrecedingJSDocComment"; - TokenFlags2[TokenFlags2["Unterminated"] = 4] = "Unterminated"; - TokenFlags2[TokenFlags2["ExtendedUnicodeEscape"] = 8] = "ExtendedUnicodeEscape"; - TokenFlags2[TokenFlags2["Scientific"] = 16] = "Scientific"; - TokenFlags2[TokenFlags2["Octal"] = 32] = "Octal"; - TokenFlags2[TokenFlags2["HexSpecifier"] = 64] = "HexSpecifier"; - TokenFlags2[TokenFlags2["BinarySpecifier"] = 128] = "BinarySpecifier"; - TokenFlags2[TokenFlags2["OctalSpecifier"] = 256] = "OctalSpecifier"; - TokenFlags2[TokenFlags2["ContainsSeparator"] = 512] = "ContainsSeparator"; - TokenFlags2[TokenFlags2["UnicodeEscape"] = 1024] = "UnicodeEscape"; - TokenFlags2[TokenFlags2["ContainsInvalidEscape"] = 2048] = "ContainsInvalidEscape"; - TokenFlags2[TokenFlags2["HexEscape"] = 4096] = "HexEscape"; - TokenFlags2[TokenFlags2["ContainsLeadingZero"] = 8192] = "ContainsLeadingZero"; - TokenFlags2[TokenFlags2["ContainsInvalidSeparator"] = 16384] = "ContainsInvalidSeparator"; - TokenFlags2[TokenFlags2["PrecedingJSDocLeadingAsterisks"] = 32768] = "PrecedingJSDocLeadingAsterisks"; - TokenFlags2[TokenFlags2["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; - TokenFlags2[TokenFlags2["WithSpecifier"] = 448] = "WithSpecifier"; - TokenFlags2[TokenFlags2["StringLiteralFlags"] = 7176] = "StringLiteralFlags"; - TokenFlags2[TokenFlags2["NumericLiteralFlags"] = 25584] = "NumericLiteralFlags"; - TokenFlags2[TokenFlags2["TemplateLiteralLikeFlags"] = 7176] = "TemplateLiteralLikeFlags"; - TokenFlags2[TokenFlags2["IsInvalid"] = 26656] = "IsInvalid"; - return TokenFlags2; -})(TokenFlags || {}); -var FlowFlags = /* @__PURE__ */ ((FlowFlags2) => { - FlowFlags2[FlowFlags2["Unreachable"] = 1] = "Unreachable"; - FlowFlags2[FlowFlags2["Start"] = 2] = "Start"; - FlowFlags2[FlowFlags2["BranchLabel"] = 4] = "BranchLabel"; - FlowFlags2[FlowFlags2["LoopLabel"] = 8] = "LoopLabel"; - FlowFlags2[FlowFlags2["Assignment"] = 16] = "Assignment"; - FlowFlags2[FlowFlags2["TrueCondition"] = 32] = "TrueCondition"; - FlowFlags2[FlowFlags2["FalseCondition"] = 64] = "FalseCondition"; - FlowFlags2[FlowFlags2["SwitchClause"] = 128] = "SwitchClause"; - FlowFlags2[FlowFlags2["ArrayMutation"] = 256] = "ArrayMutation"; - FlowFlags2[FlowFlags2["Call"] = 512] = "Call"; - FlowFlags2[FlowFlags2["ReduceLabel"] = 1024] = "ReduceLabel"; - FlowFlags2[FlowFlags2["Referenced"] = 2048] = "Referenced"; - FlowFlags2[FlowFlags2["Shared"] = 4096] = "Shared"; - FlowFlags2[FlowFlags2["Label"] = 12] = "Label"; - FlowFlags2[FlowFlags2["Condition"] = 96] = "Condition"; - return FlowFlags2; -})(FlowFlags || {}); -var CommentDirectiveType = /* @__PURE__ */ ((CommentDirectiveType2) => { - CommentDirectiveType2[CommentDirectiveType2["ExpectError"] = 0] = "ExpectError"; - CommentDirectiveType2[CommentDirectiveType2["Ignore"] = 1] = "Ignore"; - return CommentDirectiveType2; -})(CommentDirectiveType || {}); -var OperationCanceledException = class { -}; -var FileIncludeKind = /* @__PURE__ */ ((FileIncludeKind2) => { - FileIncludeKind2[FileIncludeKind2["RootFile"] = 0] = "RootFile"; - FileIncludeKind2[FileIncludeKind2["SourceFromProjectReference"] = 1] = "SourceFromProjectReference"; - FileIncludeKind2[FileIncludeKind2["OutputFromProjectReference"] = 2] = "OutputFromProjectReference"; - FileIncludeKind2[FileIncludeKind2["Import"] = 3] = "Import"; - FileIncludeKind2[FileIncludeKind2["ReferenceFile"] = 4] = "ReferenceFile"; - FileIncludeKind2[FileIncludeKind2["TypeReferenceDirective"] = 5] = "TypeReferenceDirective"; - FileIncludeKind2[FileIncludeKind2["LibFile"] = 6] = "LibFile"; - FileIncludeKind2[FileIncludeKind2["LibReferenceDirective"] = 7] = "LibReferenceDirective"; - FileIncludeKind2[FileIncludeKind2["AutomaticTypeDirectiveFile"] = 8] = "AutomaticTypeDirectiveFile"; - return FileIncludeKind2; -})(FileIncludeKind || {}); -var FilePreprocessingDiagnosticsKind = /* @__PURE__ */ ((FilePreprocessingDiagnosticsKind2) => { - FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingLibReferenceDiagnostic"] = 0] = "FilePreprocessingLibReferenceDiagnostic"; - FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingFileExplainingDiagnostic"] = 1] = "FilePreprocessingFileExplainingDiagnostic"; - FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["ResolutionDiagnostics"] = 2] = "ResolutionDiagnostics"; - return FilePreprocessingDiagnosticsKind2; -})(FilePreprocessingDiagnosticsKind || {}); -var EmitOnly = /* @__PURE__ */ ((EmitOnly4) => { - EmitOnly4[EmitOnly4["Js"] = 0] = "Js"; - EmitOnly4[EmitOnly4["Dts"] = 1] = "Dts"; - EmitOnly4[EmitOnly4["BuilderSignature"] = 2] = "BuilderSignature"; - return EmitOnly4; -})(EmitOnly || {}); -var StructureIsReused = /* @__PURE__ */ ((StructureIsReused2) => { - StructureIsReused2[StructureIsReused2["Not"] = 0] = "Not"; - StructureIsReused2[StructureIsReused2["SafeModules"] = 1] = "SafeModules"; - StructureIsReused2[StructureIsReused2["Completely"] = 2] = "Completely"; - return StructureIsReused2; -})(StructureIsReused || {}); -var ExitStatus = /* @__PURE__ */ ((ExitStatus2) => { - ExitStatus2[ExitStatus2["Success"] = 0] = "Success"; - ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; - ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; - ExitStatus2[ExitStatus2["InvalidProject_OutputsSkipped"] = 3] = "InvalidProject_OutputsSkipped"; - ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkipped"] = 4] = "ProjectReferenceCycle_OutputsSkipped"; - return ExitStatus2; -})(ExitStatus || {}); -var MemberOverrideStatus = /* @__PURE__ */ ((MemberOverrideStatus2) => { - MemberOverrideStatus2[MemberOverrideStatus2["Ok"] = 0] = "Ok"; - MemberOverrideStatus2[MemberOverrideStatus2["NeedsOverride"] = 1] = "NeedsOverride"; - MemberOverrideStatus2[MemberOverrideStatus2["HasInvalidOverride"] = 2] = "HasInvalidOverride"; - return MemberOverrideStatus2; -})(MemberOverrideStatus || {}); -var UnionReduction = /* @__PURE__ */ ((UnionReduction2) => { - UnionReduction2[UnionReduction2["None"] = 0] = "None"; - UnionReduction2[UnionReduction2["Literal"] = 1] = "Literal"; - UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype"; - return UnionReduction2; -})(UnionReduction || {}); -var IntersectionFlags = /* @__PURE__ */ ((IntersectionFlags2) => { - IntersectionFlags2[IntersectionFlags2["None"] = 0] = "None"; - IntersectionFlags2[IntersectionFlags2["NoSupertypeReduction"] = 1] = "NoSupertypeReduction"; - IntersectionFlags2[IntersectionFlags2["NoConstraintReduction"] = 2] = "NoConstraintReduction"; - return IntersectionFlags2; -})(IntersectionFlags || {}); -var ContextFlags = /* @__PURE__ */ ((ContextFlags3) => { - ContextFlags3[ContextFlags3["None"] = 0] = "None"; - ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature"; - ContextFlags3[ContextFlags3["NoConstraints"] = 2] = "NoConstraints"; - ContextFlags3[ContextFlags3["Completions"] = 4] = "Completions"; - ContextFlags3[ContextFlags3["SkipBindingPatterns"] = 8] = "SkipBindingPatterns"; - return ContextFlags3; -})(ContextFlags || {}); -var NodeBuilderFlags = /* @__PURE__ */ ((NodeBuilderFlags2) => { - NodeBuilderFlags2[NodeBuilderFlags2["None"] = 0] = "None"; - NodeBuilderFlags2[NodeBuilderFlags2["NoTruncation"] = 1] = "NoTruncation"; - NodeBuilderFlags2[NodeBuilderFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; - NodeBuilderFlags2[NodeBuilderFlags2["GenerateNamesForShadowedTypeParams"] = 4] = "GenerateNamesForShadowedTypeParams"; - NodeBuilderFlags2[NodeBuilderFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback"; - NodeBuilderFlags2[NodeBuilderFlags2["ForbidIndexedAccessSymbolReferences"] = 16] = "ForbidIndexedAccessSymbolReferences"; - NodeBuilderFlags2[NodeBuilderFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; - NodeBuilderFlags2[NodeBuilderFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; - NodeBuilderFlags2[NodeBuilderFlags2["UseOnlyExternalAliasing"] = 128] = "UseOnlyExternalAliasing"; - NodeBuilderFlags2[NodeBuilderFlags2["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; - NodeBuilderFlags2[NodeBuilderFlags2["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; - NodeBuilderFlags2[NodeBuilderFlags2["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; - NodeBuilderFlags2[NodeBuilderFlags2["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; - NodeBuilderFlags2[NodeBuilderFlags2["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; - NodeBuilderFlags2[NodeBuilderFlags2["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; - NodeBuilderFlags2[NodeBuilderFlags2["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; - NodeBuilderFlags2[NodeBuilderFlags2["UseSingleQuotesForStringLiteralType"] = 268435456] = "UseSingleQuotesForStringLiteralType"; - NodeBuilderFlags2[NodeBuilderFlags2["NoTypeReduction"] = 536870912] = "NoTypeReduction"; - NodeBuilderFlags2[NodeBuilderFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifiedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifiedNameInPlaceOfIdentifier"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; - NodeBuilderFlags2[NodeBuilderFlags2["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; - NodeBuilderFlags2[NodeBuilderFlags2["IgnoreErrors"] = 70221824] = "IgnoreErrors"; - NodeBuilderFlags2[NodeBuilderFlags2["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; - NodeBuilderFlags2[NodeBuilderFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; - NodeBuilderFlags2[NodeBuilderFlags2["InInitialEntityName"] = 16777216] = "InInitialEntityName"; - return NodeBuilderFlags2; -})(NodeBuilderFlags || {}); -var InternalNodeBuilderFlags = /* @__PURE__ */ ((InternalNodeBuilderFlags2) => { - InternalNodeBuilderFlags2[InternalNodeBuilderFlags2["None"] = 0] = "None"; - InternalNodeBuilderFlags2[InternalNodeBuilderFlags2["WriteComputedProps"] = 1] = "WriteComputedProps"; - InternalNodeBuilderFlags2[InternalNodeBuilderFlags2["NoSyntacticPrinter"] = 2] = "NoSyntacticPrinter"; - InternalNodeBuilderFlags2[InternalNodeBuilderFlags2["DoNotIncludeSymbolChain"] = 4] = "DoNotIncludeSymbolChain"; - InternalNodeBuilderFlags2[InternalNodeBuilderFlags2["AllowUnresolvedNames"] = 8] = "AllowUnresolvedNames"; - return InternalNodeBuilderFlags2; -})(InternalNodeBuilderFlags || {}); -var TypeFormatFlags = /* @__PURE__ */ ((TypeFormatFlags2) => { - 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"; - TypeFormatFlags2[TypeFormatFlags2["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; - TypeFormatFlags2[TypeFormatFlags2["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; - TypeFormatFlags2[TypeFormatFlags2["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; - TypeFormatFlags2[TypeFormatFlags2["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; - TypeFormatFlags2[TypeFormatFlags2["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; - TypeFormatFlags2[TypeFormatFlags2["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; - TypeFormatFlags2[TypeFormatFlags2["UseSingleQuotesForStringLiteralType"] = 268435456] = "UseSingleQuotesForStringLiteralType"; - TypeFormatFlags2[TypeFormatFlags2["NoTypeReduction"] = 536870912] = "NoTypeReduction"; - TypeFormatFlags2[TypeFormatFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; - TypeFormatFlags2[TypeFormatFlags2["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; - TypeFormatFlags2[TypeFormatFlags2["AddUndefined"] = 131072] = "AddUndefined"; - TypeFormatFlags2[TypeFormatFlags2["WriteArrowStyleSignature"] = 262144] = "WriteArrowStyleSignature"; - TypeFormatFlags2[TypeFormatFlags2["InArrayType"] = 524288] = "InArrayType"; - TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType"; - TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; - TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; - TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330095] = "NodeBuilderFlagsMask"; - return TypeFormatFlags2; -})(TypeFormatFlags || {}); -var SymbolFormatFlags = /* @__PURE__ */ ((SymbolFormatFlags2) => { - SymbolFormatFlags2[SymbolFormatFlags2["None"] = 0] = "None"; - SymbolFormatFlags2[SymbolFormatFlags2["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; - SymbolFormatFlags2[SymbolFormatFlags2["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; - SymbolFormatFlags2[SymbolFormatFlags2["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind"; - SymbolFormatFlags2[SymbolFormatFlags2["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope"; - SymbolFormatFlags2[SymbolFormatFlags2["WriteComputedProps"] = 16] = "WriteComputedProps"; - SymbolFormatFlags2[SymbolFormatFlags2["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain"; - return SymbolFormatFlags2; -})(SymbolFormatFlags || {}); -var SymbolAccessibility = /* @__PURE__ */ ((SymbolAccessibility2) => { - SymbolAccessibility2[SymbolAccessibility2["Accessible"] = 0] = "Accessible"; - SymbolAccessibility2[SymbolAccessibility2["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility2[SymbolAccessibility2["CannotBeNamed"] = 2] = "CannotBeNamed"; - SymbolAccessibility2[SymbolAccessibility2["NotResolved"] = 3] = "NotResolved"; - return SymbolAccessibility2; -})(SymbolAccessibility || {}); -var TypePredicateKind = /* @__PURE__ */ ((TypePredicateKind2) => { - TypePredicateKind2[TypePredicateKind2["This"] = 0] = "This"; - TypePredicateKind2[TypePredicateKind2["Identifier"] = 1] = "Identifier"; - TypePredicateKind2[TypePredicateKind2["AssertsThis"] = 2] = "AssertsThis"; - TypePredicateKind2[TypePredicateKind2["AssertsIdentifier"] = 3] = "AssertsIdentifier"; - return TypePredicateKind2; -})(TypePredicateKind || {}); -var TypeReferenceSerializationKind = /* @__PURE__ */ ((TypeReferenceSerializationKind2) => { - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["Unknown"] = 0] = "Unknown"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["TypeWithConstructSignatureAndValue"] = 1] = "TypeWithConstructSignatureAndValue"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["VoidNullableOrNeverType"] = 2] = "VoidNullableOrNeverType"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["NumberLikeType"] = 3] = "NumberLikeType"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["BigIntLikeType"] = 4] = "BigIntLikeType"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["StringLikeType"] = 5] = "StringLikeType"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["BooleanType"] = 6] = "BooleanType"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ArrayLikeType"] = 7] = "ArrayLikeType"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ESSymbolType"] = 8] = "ESSymbolType"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["Promise"] = 9] = "Promise"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["TypeWithCallSignature"] = 10] = "TypeWithCallSignature"; - TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ObjectType"] = 11] = "ObjectType"; - return TypeReferenceSerializationKind2; -})(TypeReferenceSerializationKind || {}); -var SymbolFlags = /* @__PURE__ */ ((SymbolFlags3) => { - SymbolFlags3[SymbolFlags3["None"] = 0] = "None"; - SymbolFlags3[SymbolFlags3["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; - SymbolFlags3[SymbolFlags3["BlockScopedVariable"] = 2] = "BlockScopedVariable"; - SymbolFlags3[SymbolFlags3["Property"] = 4] = "Property"; - SymbolFlags3[SymbolFlags3["EnumMember"] = 8] = "EnumMember"; - SymbolFlags3[SymbolFlags3["Function"] = 16] = "Function"; - SymbolFlags3[SymbolFlags3["Class"] = 32] = "Class"; - SymbolFlags3[SymbolFlags3["Interface"] = 64] = "Interface"; - SymbolFlags3[SymbolFlags3["ConstEnum"] = 128] = "ConstEnum"; - SymbolFlags3[SymbolFlags3["RegularEnum"] = 256] = "RegularEnum"; - SymbolFlags3[SymbolFlags3["ValueModule"] = 512] = "ValueModule"; - SymbolFlags3[SymbolFlags3["NamespaceModule"] = 1024] = "NamespaceModule"; - SymbolFlags3[SymbolFlags3["TypeLiteral"] = 2048] = "TypeLiteral"; - SymbolFlags3[SymbolFlags3["ObjectLiteral"] = 4096] = "ObjectLiteral"; - SymbolFlags3[SymbolFlags3["Method"] = 8192] = "Method"; - SymbolFlags3[SymbolFlags3["Constructor"] = 16384] = "Constructor"; - SymbolFlags3[SymbolFlags3["GetAccessor"] = 32768] = "GetAccessor"; - SymbolFlags3[SymbolFlags3["SetAccessor"] = 65536] = "SetAccessor"; - SymbolFlags3[SymbolFlags3["Signature"] = 131072] = "Signature"; - SymbolFlags3[SymbolFlags3["TypeParameter"] = 262144] = "TypeParameter"; - SymbolFlags3[SymbolFlags3["TypeAlias"] = 524288] = "TypeAlias"; - SymbolFlags3[SymbolFlags3["ExportValue"] = 1048576] = "ExportValue"; - SymbolFlags3[SymbolFlags3["Alias"] = 2097152] = "Alias"; - SymbolFlags3[SymbolFlags3["Prototype"] = 4194304] = "Prototype"; - SymbolFlags3[SymbolFlags3["ExportStar"] = 8388608] = "ExportStar"; - SymbolFlags3[SymbolFlags3["Optional"] = 16777216] = "Optional"; - SymbolFlags3[SymbolFlags3["Transient"] = 33554432] = "Transient"; - SymbolFlags3[SymbolFlags3["Assignment"] = 67108864] = "Assignment"; - SymbolFlags3[SymbolFlags3["ModuleExports"] = 134217728] = "ModuleExports"; - SymbolFlags3[SymbolFlags3["All"] = -1] = "All"; - SymbolFlags3[SymbolFlags3["Enum"] = 384] = "Enum"; - SymbolFlags3[SymbolFlags3["Variable"] = 3] = "Variable"; - SymbolFlags3[SymbolFlags3["Value"] = 111551] = "Value"; - SymbolFlags3[SymbolFlags3["Type"] = 788968] = "Type"; - SymbolFlags3[SymbolFlags3["Namespace"] = 1920] = "Namespace"; - SymbolFlags3[SymbolFlags3["Module"] = 1536] = "Module"; - SymbolFlags3[SymbolFlags3["Accessor"] = 98304] = "Accessor"; - SymbolFlags3[SymbolFlags3["FunctionScopedVariableExcludes"] = 111550] = "FunctionScopedVariableExcludes"; - SymbolFlags3[SymbolFlags3["BlockScopedVariableExcludes"] = 111551 /* Value */] = "BlockScopedVariableExcludes"; - SymbolFlags3[SymbolFlags3["ParameterExcludes"] = 111551 /* Value */] = "ParameterExcludes"; - SymbolFlags3[SymbolFlags3["PropertyExcludes"] = 0 /* None */] = "PropertyExcludes"; - SymbolFlags3[SymbolFlags3["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; - SymbolFlags3[SymbolFlags3["FunctionExcludes"] = 110991] = "FunctionExcludes"; - SymbolFlags3[SymbolFlags3["ClassExcludes"] = 899503] = "ClassExcludes"; - SymbolFlags3[SymbolFlags3["InterfaceExcludes"] = 788872] = "InterfaceExcludes"; - SymbolFlags3[SymbolFlags3["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; - SymbolFlags3[SymbolFlags3["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; - SymbolFlags3[SymbolFlags3["ValueModuleExcludes"] = 110735] = "ValueModuleExcludes"; - SymbolFlags3[SymbolFlags3["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags3[SymbolFlags3["MethodExcludes"] = 103359] = "MethodExcludes"; - SymbolFlags3[SymbolFlags3["GetAccessorExcludes"] = 46015] = "GetAccessorExcludes"; - SymbolFlags3[SymbolFlags3["SetAccessorExcludes"] = 78783] = "SetAccessorExcludes"; - SymbolFlags3[SymbolFlags3["AccessorExcludes"] = 13247] = "AccessorExcludes"; - SymbolFlags3[SymbolFlags3["TypeParameterExcludes"] = 526824] = "TypeParameterExcludes"; - SymbolFlags3[SymbolFlags3["TypeAliasExcludes"] = 788968 /* Type */] = "TypeAliasExcludes"; - SymbolFlags3[SymbolFlags3["AliasExcludes"] = 2097152 /* Alias */] = "AliasExcludes"; - SymbolFlags3[SymbolFlags3["ModuleMember"] = 2623475] = "ModuleMember"; - SymbolFlags3[SymbolFlags3["ExportHasLocal"] = 944] = "ExportHasLocal"; - SymbolFlags3[SymbolFlags3["BlockScoped"] = 418] = "BlockScoped"; - SymbolFlags3[SymbolFlags3["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; - SymbolFlags3[SymbolFlags3["ClassMember"] = 106500] = "ClassMember"; - SymbolFlags3[SymbolFlags3["ExportSupportsDefaultModifier"] = 112] = "ExportSupportsDefaultModifier"; - SymbolFlags3[SymbolFlags3["ExportDoesNotSupportDefaultModifier"] = -113] = "ExportDoesNotSupportDefaultModifier"; - SymbolFlags3[SymbolFlags3["Classifiable"] = 2885600] = "Classifiable"; - SymbolFlags3[SymbolFlags3["LateBindingContainer"] = 6256] = "LateBindingContainer"; - return SymbolFlags3; -})(SymbolFlags || {}); -var CheckFlags = /* @__PURE__ */ ((CheckFlags2) => { - CheckFlags2[CheckFlags2["None"] = 0] = "None"; - CheckFlags2[CheckFlags2["Instantiated"] = 1] = "Instantiated"; - CheckFlags2[CheckFlags2["SyntheticProperty"] = 2] = "SyntheticProperty"; - CheckFlags2[CheckFlags2["SyntheticMethod"] = 4] = "SyntheticMethod"; - CheckFlags2[CheckFlags2["Readonly"] = 8] = "Readonly"; - CheckFlags2[CheckFlags2["ReadPartial"] = 16] = "ReadPartial"; - CheckFlags2[CheckFlags2["WritePartial"] = 32] = "WritePartial"; - CheckFlags2[CheckFlags2["HasNonUniformType"] = 64] = "HasNonUniformType"; - CheckFlags2[CheckFlags2["HasLiteralType"] = 128] = "HasLiteralType"; - CheckFlags2[CheckFlags2["ContainsPublic"] = 256] = "ContainsPublic"; - CheckFlags2[CheckFlags2["ContainsProtected"] = 512] = "ContainsProtected"; - CheckFlags2[CheckFlags2["ContainsPrivate"] = 1024] = "ContainsPrivate"; - CheckFlags2[CheckFlags2["ContainsStatic"] = 2048] = "ContainsStatic"; - CheckFlags2[CheckFlags2["Late"] = 4096] = "Late"; - CheckFlags2[CheckFlags2["ReverseMapped"] = 8192] = "ReverseMapped"; - CheckFlags2[CheckFlags2["OptionalParameter"] = 16384] = "OptionalParameter"; - CheckFlags2[CheckFlags2["RestParameter"] = 32768] = "RestParameter"; - CheckFlags2[CheckFlags2["DeferredType"] = 65536] = "DeferredType"; - CheckFlags2[CheckFlags2["HasNeverType"] = 131072] = "HasNeverType"; - CheckFlags2[CheckFlags2["Mapped"] = 262144] = "Mapped"; - CheckFlags2[CheckFlags2["StripOptional"] = 524288] = "StripOptional"; - CheckFlags2[CheckFlags2["Unresolved"] = 1048576] = "Unresolved"; - CheckFlags2[CheckFlags2["Synthetic"] = 6] = "Synthetic"; - CheckFlags2[CheckFlags2["Discriminant"] = 192] = "Discriminant"; - CheckFlags2[CheckFlags2["Partial"] = 48] = "Partial"; - return CheckFlags2; -})(CheckFlags || {}); -var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => { - InternalSymbolName2["Call"] = "__call"; - InternalSymbolName2["Constructor"] = "__constructor"; - InternalSymbolName2["New"] = "__new"; - InternalSymbolName2["Index"] = "__index"; - InternalSymbolName2["ExportStar"] = "__export"; - InternalSymbolName2["Global"] = "__global"; - InternalSymbolName2["Missing"] = "__missing"; - InternalSymbolName2["Type"] = "__type"; - InternalSymbolName2["Object"] = "__object"; - InternalSymbolName2["JSXAttributes"] = "__jsxAttributes"; - InternalSymbolName2["Class"] = "__class"; - InternalSymbolName2["Function"] = "__function"; - InternalSymbolName2["Computed"] = "__computed"; - InternalSymbolName2["Resolving"] = "__resolving__"; - InternalSymbolName2["ExportEquals"] = "export="; - InternalSymbolName2["Default"] = "default"; - InternalSymbolName2["This"] = "this"; - InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression"; - InternalSymbolName2["ImportAttributes"] = "__importAttributes"; - return InternalSymbolName2; -})(InternalSymbolName || {}); -var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags3) => { - NodeCheckFlags3[NodeCheckFlags3["None"] = 0] = "None"; - NodeCheckFlags3[NodeCheckFlags3["TypeChecked"] = 1] = "TypeChecked"; - NodeCheckFlags3[NodeCheckFlags3["LexicalThis"] = 2] = "LexicalThis"; - NodeCheckFlags3[NodeCheckFlags3["CaptureThis"] = 4] = "CaptureThis"; - NodeCheckFlags3[NodeCheckFlags3["CaptureNewTarget"] = 8] = "CaptureNewTarget"; - NodeCheckFlags3[NodeCheckFlags3["SuperInstance"] = 16] = "SuperInstance"; - NodeCheckFlags3[NodeCheckFlags3["SuperStatic"] = 32] = "SuperStatic"; - NodeCheckFlags3[NodeCheckFlags3["ContextChecked"] = 64] = "ContextChecked"; - NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAccessInAsync"] = 128] = "MethodWithSuperPropertyAccessInAsync"; - NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAssignmentInAsync"] = 256] = "MethodWithSuperPropertyAssignmentInAsync"; - NodeCheckFlags3[NodeCheckFlags3["CaptureArguments"] = 512] = "CaptureArguments"; - NodeCheckFlags3[NodeCheckFlags3["EnumValuesComputed"] = 1024] = "EnumValuesComputed"; - NodeCheckFlags3[NodeCheckFlags3["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass"; - NodeCheckFlags3[NodeCheckFlags3["LoopWithCapturedBlockScopedBinding"] = 4096] = "LoopWithCapturedBlockScopedBinding"; - NodeCheckFlags3[NodeCheckFlags3["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding"; - NodeCheckFlags3[NodeCheckFlags3["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding"; - NodeCheckFlags3[NodeCheckFlags3["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop"; - NodeCheckFlags3[NodeCheckFlags3["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter"; - NodeCheckFlags3[NodeCheckFlags3["AssignmentsMarked"] = 131072] = "AssignmentsMarked"; - NodeCheckFlags3[NodeCheckFlags3["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference"; - NodeCheckFlags3[NodeCheckFlags3["ConstructorReference"] = 536870912] = "ConstructorReference"; - NodeCheckFlags3[NodeCheckFlags3["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers"; - NodeCheckFlags3[NodeCheckFlags3["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer"; - NodeCheckFlags3[NodeCheckFlags3["InCheckIdentifier"] = 4194304] = "InCheckIdentifier"; - NodeCheckFlags3[NodeCheckFlags3["PartiallyTypeChecked"] = 8388608] = "PartiallyTypeChecked"; - NodeCheckFlags3[NodeCheckFlags3["LazyFlags"] = 539358128] = "LazyFlags"; - return NodeCheckFlags3; -})(NodeCheckFlags || {}); -var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => { - TypeFlags2[TypeFlags2["Any"] = 1] = "Any"; - TypeFlags2[TypeFlags2["Unknown"] = 2] = "Unknown"; - TypeFlags2[TypeFlags2["String"] = 4] = "String"; - TypeFlags2[TypeFlags2["Number"] = 8] = "Number"; - TypeFlags2[TypeFlags2["Boolean"] = 16] = "Boolean"; - TypeFlags2[TypeFlags2["Enum"] = 32] = "Enum"; - TypeFlags2[TypeFlags2["BigInt"] = 64] = "BigInt"; - TypeFlags2[TypeFlags2["StringLiteral"] = 128] = "StringLiteral"; - TypeFlags2[TypeFlags2["NumberLiteral"] = 256] = "NumberLiteral"; - TypeFlags2[TypeFlags2["BooleanLiteral"] = 512] = "BooleanLiteral"; - TypeFlags2[TypeFlags2["EnumLiteral"] = 1024] = "EnumLiteral"; - TypeFlags2[TypeFlags2["BigIntLiteral"] = 2048] = "BigIntLiteral"; - TypeFlags2[TypeFlags2["ESSymbol"] = 4096] = "ESSymbol"; - TypeFlags2[TypeFlags2["UniqueESSymbol"] = 8192] = "UniqueESSymbol"; - TypeFlags2[TypeFlags2["Void"] = 16384] = "Void"; - TypeFlags2[TypeFlags2["Undefined"] = 32768] = "Undefined"; - TypeFlags2[TypeFlags2["Null"] = 65536] = "Null"; - TypeFlags2[TypeFlags2["Never"] = 131072] = "Never"; - TypeFlags2[TypeFlags2["TypeParameter"] = 262144] = "TypeParameter"; - TypeFlags2[TypeFlags2["Object"] = 524288] = "Object"; - TypeFlags2[TypeFlags2["Union"] = 1048576] = "Union"; - TypeFlags2[TypeFlags2["Intersection"] = 2097152] = "Intersection"; - TypeFlags2[TypeFlags2["Index"] = 4194304] = "Index"; - TypeFlags2[TypeFlags2["IndexedAccess"] = 8388608] = "IndexedAccess"; - TypeFlags2[TypeFlags2["Conditional"] = 16777216] = "Conditional"; - TypeFlags2[TypeFlags2["Substitution"] = 33554432] = "Substitution"; - TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral"; - TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping"; - TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1"; - TypeFlags2[TypeFlags2["Reserved2"] = 1073741824] = "Reserved2"; - TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; - TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; - TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; - TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit"; - TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable"; - TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; - TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; - TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; - TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; - TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; - TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; - TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; - TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; - TypeFlags2[TypeFlags2["BooleanLike"] = 528] = "BooleanLike"; - TypeFlags2[TypeFlags2["EnumLike"] = 1056] = "EnumLike"; - TypeFlags2[TypeFlags2["ESSymbolLike"] = 12288] = "ESSymbolLike"; - TypeFlags2[TypeFlags2["VoidLike"] = 49152] = "VoidLike"; - TypeFlags2[TypeFlags2["Primitive"] = 402784252] = "Primitive"; - TypeFlags2[TypeFlags2["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable"; - TypeFlags2[TypeFlags2["DisjointDomains"] = 469892092] = "DisjointDomains"; - TypeFlags2[TypeFlags2["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; - TypeFlags2[TypeFlags2["StructuredType"] = 3670016] = "StructuredType"; - TypeFlags2[TypeFlags2["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags2[TypeFlags2["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; - TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; - TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable"; - TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; - TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; - TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable"; - TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton"; - TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable"; - TypeFlags2[TypeFlags2["IncludesMask"] = 473694207] = "IncludesMask"; - TypeFlags2[TypeFlags2["IncludesMissingType"] = 262144 /* TypeParameter */] = "IncludesMissingType"; - TypeFlags2[TypeFlags2["IncludesNonWideningType"] = 4194304 /* Index */] = "IncludesNonWideningType"; - 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["IncludesError"] = 1073741824 /* Reserved2 */] = "IncludesError"; - TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion"; - return TypeFlags2; -})(TypeFlags || {}); -var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => { - ObjectFlags3[ObjectFlags3["None"] = 0] = "None"; - ObjectFlags3[ObjectFlags3["Class"] = 1] = "Class"; - ObjectFlags3[ObjectFlags3["Interface"] = 2] = "Interface"; - ObjectFlags3[ObjectFlags3["Reference"] = 4] = "Reference"; - ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple"; - ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous"; - ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped"; - ObjectFlags3[ObjectFlags3["Instantiated"] = 64] = "Instantiated"; - ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 128] = "ObjectLiteral"; - ObjectFlags3[ObjectFlags3["EvolvingArray"] = 256] = "EvolvingArray"; - ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; - ObjectFlags3[ObjectFlags3["ReverseMapped"] = 1024] = "ReverseMapped"; - ObjectFlags3[ObjectFlags3["JsxAttributes"] = 2048] = "JsxAttributes"; - ObjectFlags3[ObjectFlags3["JSLiteral"] = 4096] = "JSLiteral"; - ObjectFlags3[ObjectFlags3["FreshLiteral"] = 8192] = "FreshLiteral"; - ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 16384] = "ArrayLiteral"; - ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 32768] = "PrimitiveUnion"; - ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 65536] = "ContainsWideningType"; - ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral"; - ObjectFlags3[ObjectFlags3["NonInferrableType"] = 262144] = "NonInferrableType"; - ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed"; - ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables"; - ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType"; - 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"; - ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType"; - ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone"; - ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated"; - ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists"; - ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed"; - ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 4194304] = "IsGenericObjectType"; - ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 8388608] = "IsGenericIndexType"; - ObjectFlags3[ObjectFlags3["IsGenericType"] = 12582912] = "IsGenericType"; - ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 16777216] = "ContainsIntersections"; - ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed"; - ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion"; - ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed"; - ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 33554432] = "IsNeverIntersection"; - ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 67108864] = "IsConstrainedTypeVariable"; - return ObjectFlags3; -})(ObjectFlags || {}); -var VarianceFlags = /* @__PURE__ */ ((VarianceFlags2) => { - VarianceFlags2[VarianceFlags2["Invariant"] = 0] = "Invariant"; - VarianceFlags2[VarianceFlags2["Covariant"] = 1] = "Covariant"; - VarianceFlags2[VarianceFlags2["Contravariant"] = 2] = "Contravariant"; - VarianceFlags2[VarianceFlags2["Bivariant"] = 3] = "Bivariant"; - VarianceFlags2[VarianceFlags2["Independent"] = 4] = "Independent"; - VarianceFlags2[VarianceFlags2["VarianceMask"] = 7] = "VarianceMask"; - VarianceFlags2[VarianceFlags2["Unmeasurable"] = 8] = "Unmeasurable"; - VarianceFlags2[VarianceFlags2["Unreliable"] = 16] = "Unreliable"; - VarianceFlags2[VarianceFlags2["AllowsStructuralFallback"] = 24] = "AllowsStructuralFallback"; - return VarianceFlags2; -})(VarianceFlags || {}); -var ElementFlags = /* @__PURE__ */ ((ElementFlags2) => { - ElementFlags2[ElementFlags2["Required"] = 1] = "Required"; - ElementFlags2[ElementFlags2["Optional"] = 2] = "Optional"; - ElementFlags2[ElementFlags2["Rest"] = 4] = "Rest"; - ElementFlags2[ElementFlags2["Variadic"] = 8] = "Variadic"; - ElementFlags2[ElementFlags2["Fixed"] = 3] = "Fixed"; - ElementFlags2[ElementFlags2["Variable"] = 12] = "Variable"; - ElementFlags2[ElementFlags2["NonRequired"] = 14] = "NonRequired"; - ElementFlags2[ElementFlags2["NonRest"] = 11] = "NonRest"; - return ElementFlags2; -})(ElementFlags || {}); -var AccessFlags = /* @__PURE__ */ ((AccessFlags2) => { - AccessFlags2[AccessFlags2["None"] = 0] = "None"; - AccessFlags2[AccessFlags2["IncludeUndefined"] = 1] = "IncludeUndefined"; - AccessFlags2[AccessFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures"; - AccessFlags2[AccessFlags2["Writing"] = 4] = "Writing"; - AccessFlags2[AccessFlags2["CacheSymbol"] = 8] = "CacheSymbol"; - AccessFlags2[AccessFlags2["AllowMissing"] = 16] = "AllowMissing"; - AccessFlags2[AccessFlags2["ExpressionPosition"] = 32] = "ExpressionPosition"; - AccessFlags2[AccessFlags2["ReportDeprecated"] = 64] = "ReportDeprecated"; - AccessFlags2[AccessFlags2["SuppressNoImplicitAnyError"] = 128] = "SuppressNoImplicitAnyError"; - AccessFlags2[AccessFlags2["Contextual"] = 256] = "Contextual"; - AccessFlags2[AccessFlags2["Persistent"] = 1 /* IncludeUndefined */] = "Persistent"; - return AccessFlags2; -})(AccessFlags || {}); -var IndexFlags = /* @__PURE__ */ ((IndexFlags2) => { - IndexFlags2[IndexFlags2["None"] = 0] = "None"; - IndexFlags2[IndexFlags2["StringsOnly"] = 1] = "StringsOnly"; - IndexFlags2[IndexFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures"; - IndexFlags2[IndexFlags2["NoReducibleCheck"] = 4] = "NoReducibleCheck"; - return IndexFlags2; -})(IndexFlags || {}); -var JsxReferenceKind = /* @__PURE__ */ ((JsxReferenceKind2) => { - JsxReferenceKind2[JsxReferenceKind2["Component"] = 0] = "Component"; - JsxReferenceKind2[JsxReferenceKind2["Function"] = 1] = "Function"; - JsxReferenceKind2[JsxReferenceKind2["Mixed"] = 2] = "Mixed"; - return JsxReferenceKind2; -})(JsxReferenceKind || {}); -var SignatureKind = /* @__PURE__ */ ((SignatureKind2) => { - SignatureKind2[SignatureKind2["Call"] = 0] = "Call"; - SignatureKind2[SignatureKind2["Construct"] = 1] = "Construct"; - return SignatureKind2; -})(SignatureKind || {}); -var SignatureFlags = /* @__PURE__ */ ((SignatureFlags5) => { - SignatureFlags5[SignatureFlags5["None"] = 0] = "None"; - SignatureFlags5[SignatureFlags5["HasRestParameter"] = 1] = "HasRestParameter"; - SignatureFlags5[SignatureFlags5["HasLiteralTypes"] = 2] = "HasLiteralTypes"; - SignatureFlags5[SignatureFlags5["Abstract"] = 4] = "Abstract"; - SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain"; - SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain"; - SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile"; - SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable"; - SignatureFlags5[SignatureFlags5["IsSignatureCandidateForOverloadFailure"] = 128] = "IsSignatureCandidateForOverloadFailure"; - SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 167] = "PropagatingFlags"; - SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags"; - return SignatureFlags5; -})(SignatureFlags || {}); -var IndexKind = /* @__PURE__ */ ((IndexKind2) => { - IndexKind2[IndexKind2["String"] = 0] = "String"; - IndexKind2[IndexKind2["Number"] = 1] = "Number"; - return IndexKind2; -})(IndexKind || {}); -var TypeMapKind = /* @__PURE__ */ ((TypeMapKind2) => { - TypeMapKind2[TypeMapKind2["Simple"] = 0] = "Simple"; - TypeMapKind2[TypeMapKind2["Array"] = 1] = "Array"; - TypeMapKind2[TypeMapKind2["Deferred"] = 2] = "Deferred"; - TypeMapKind2[TypeMapKind2["Function"] = 3] = "Function"; - TypeMapKind2[TypeMapKind2["Composite"] = 4] = "Composite"; - TypeMapKind2[TypeMapKind2["Merged"] = 5] = "Merged"; - return TypeMapKind2; -})(TypeMapKind || {}); -var InferencePriority = /* @__PURE__ */ ((InferencePriority2) => { - InferencePriority2[InferencePriority2["None"] = 0] = "None"; - InferencePriority2[InferencePriority2["NakedTypeVariable"] = 1] = "NakedTypeVariable"; - InferencePriority2[InferencePriority2["SpeculativeTuple"] = 2] = "SpeculativeTuple"; - InferencePriority2[InferencePriority2["SubstituteSource"] = 4] = "SubstituteSource"; - InferencePriority2[InferencePriority2["HomomorphicMappedType"] = 8] = "HomomorphicMappedType"; - InferencePriority2[InferencePriority2["PartialHomomorphicMappedType"] = 16] = "PartialHomomorphicMappedType"; - InferencePriority2[InferencePriority2["MappedTypeConstraint"] = 32] = "MappedTypeConstraint"; - InferencePriority2[InferencePriority2["ContravariantConditional"] = 64] = "ContravariantConditional"; - InferencePriority2[InferencePriority2["ReturnType"] = 128] = "ReturnType"; - InferencePriority2[InferencePriority2["LiteralKeyof"] = 256] = "LiteralKeyof"; - InferencePriority2[InferencePriority2["NoConstraints"] = 512] = "NoConstraints"; - InferencePriority2[InferencePriority2["AlwaysStrict"] = 1024] = "AlwaysStrict"; - InferencePriority2[InferencePriority2["MaxValue"] = 2048] = "MaxValue"; - InferencePriority2[InferencePriority2["PriorityImpliesCombination"] = 416] = "PriorityImpliesCombination"; - InferencePriority2[InferencePriority2["Circularity"] = -1] = "Circularity"; - return InferencePriority2; -})(InferencePriority || {}); -var InferenceFlags = /* @__PURE__ */ ((InferenceFlags2) => { - InferenceFlags2[InferenceFlags2["None"] = 0] = "None"; - InferenceFlags2[InferenceFlags2["NoDefault"] = 1] = "NoDefault"; - InferenceFlags2[InferenceFlags2["AnyDefault"] = 2] = "AnyDefault"; - InferenceFlags2[InferenceFlags2["SkippedGenericFunction"] = 4] = "SkippedGenericFunction"; - return InferenceFlags2; -})(InferenceFlags || {}); -var Ternary = /* @__PURE__ */ ((Ternary2) => { - Ternary2[Ternary2["False"] = 0] = "False"; - Ternary2[Ternary2["Unknown"] = 1] = "Unknown"; - Ternary2[Ternary2["Maybe"] = 3] = "Maybe"; - Ternary2[Ternary2["True"] = -1] = "True"; - return Ternary2; -})(Ternary || {}); -var AssignmentDeclarationKind = /* @__PURE__ */ ((AssignmentDeclarationKind2) => { - AssignmentDeclarationKind2[AssignmentDeclarationKind2["None"] = 0] = "None"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["ExportsProperty"] = 1] = "ExportsProperty"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["ModuleExports"] = 2] = "ModuleExports"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["PrototypeProperty"] = 3] = "PrototypeProperty"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["ThisProperty"] = 4] = "ThisProperty"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["Property"] = 5] = "Property"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["Prototype"] = 6] = "Prototype"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePropertyValue"] = 7] = "ObjectDefinePropertyValue"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePropertyExports"] = 8] = "ObjectDefinePropertyExports"; - AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePrototypeProperty"] = 9] = "ObjectDefinePrototypeProperty"; - return AssignmentDeclarationKind2; -})(AssignmentDeclarationKind || {}); -var DiagnosticCategory = /* @__PURE__ */ ((DiagnosticCategory2) => { - DiagnosticCategory2[DiagnosticCategory2["Warning"] = 0] = "Warning"; - DiagnosticCategory2[DiagnosticCategory2["Error"] = 1] = "Error"; - DiagnosticCategory2[DiagnosticCategory2["Suggestion"] = 2] = "Suggestion"; - DiagnosticCategory2[DiagnosticCategory2["Message"] = 3] = "Message"; - return DiagnosticCategory2; -})(DiagnosticCategory || {}); -function diagnosticCategoryName(d, lowerCase = true) { - const name = DiagnosticCategory[d.category]; - return lowerCase ? name.toLowerCase() : name; -} -var 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 || {}); -var ModuleDetectionKind = /* @__PURE__ */ ((ModuleDetectionKind2) => { - ModuleDetectionKind2[ModuleDetectionKind2["Legacy"] = 1] = "Legacy"; - ModuleDetectionKind2[ModuleDetectionKind2["Auto"] = 2] = "Auto"; - ModuleDetectionKind2[ModuleDetectionKind2["Force"] = 3] = "Force"; - return ModuleDetectionKind2; -})(ModuleDetectionKind || {}); -var 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 || {}); -var 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 || {}); -var 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 || {}); -var 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["Node18"] = 101] = "Node18"; - ModuleKind3[ModuleKind3["Node20"] = 102] = "Node20"; - ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext"; - ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve"; - return ModuleKind3; -})(ModuleKind || {}); -var 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 || {}); -var ImportsNotUsedAsValues = /* @__PURE__ */ ((ImportsNotUsedAsValues2) => { - ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Remove"] = 0] = "Remove"; - ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Preserve"] = 1] = "Preserve"; - ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Error"] = 2] = "Error"; - return ImportsNotUsedAsValues2; -})(ImportsNotUsedAsValues || {}); -var NewLineKind = /* @__PURE__ */ ((NewLineKind3) => { - NewLineKind3[NewLineKind3["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; - NewLineKind3[NewLineKind3["LineFeed"] = 1] = "LineFeed"; - return NewLineKind3; -})(NewLineKind || {}); -var 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 || {}); -var ScriptTarget = /* @__PURE__ */ ((ScriptTarget12) => { - ScriptTarget12[ScriptTarget12["ES3"] = 0] = "ES3"; - ScriptTarget12[ScriptTarget12["ES5"] = 1] = "ES5"; - ScriptTarget12[ScriptTarget12["ES2015"] = 2] = "ES2015"; - ScriptTarget12[ScriptTarget12["ES2016"] = 3] = "ES2016"; - ScriptTarget12[ScriptTarget12["ES2017"] = 4] = "ES2017"; - ScriptTarget12[ScriptTarget12["ES2018"] = 5] = "ES2018"; - ScriptTarget12[ScriptTarget12["ES2019"] = 6] = "ES2019"; - ScriptTarget12[ScriptTarget12["ES2020"] = 7] = "ES2020"; - ScriptTarget12[ScriptTarget12["ES2021"] = 8] = "ES2021"; - ScriptTarget12[ScriptTarget12["ES2022"] = 9] = "ES2022"; - ScriptTarget12[ScriptTarget12["ES2023"] = 10] = "ES2023"; - ScriptTarget12[ScriptTarget12["ES2024"] = 11] = "ES2024"; - ScriptTarget12[ScriptTarget12["ESNext"] = 99] = "ESNext"; - ScriptTarget12[ScriptTarget12["JSON"] = 100] = "JSON"; - ScriptTarget12[ScriptTarget12["Latest"] = 99 /* ESNext */] = "Latest"; - return ScriptTarget12; -})(ScriptTarget || {}); -var LanguageVariant = /* @__PURE__ */ ((LanguageVariant3) => { - LanguageVariant3[LanguageVariant3["Standard"] = 0] = "Standard"; - LanguageVariant3[LanguageVariant3["JSX"] = 1] = "JSX"; - return LanguageVariant3; -})(LanguageVariant || {}); -var WatchDirectoryFlags = /* @__PURE__ */ ((WatchDirectoryFlags3) => { - WatchDirectoryFlags3[WatchDirectoryFlags3["None"] = 0] = "None"; - WatchDirectoryFlags3[WatchDirectoryFlags3["Recursive"] = 1] = "Recursive"; - return WatchDirectoryFlags3; -})(WatchDirectoryFlags || {}); -var CharacterCodes = /* @__PURE__ */ ((CharacterCodes2) => { - CharacterCodes2[CharacterCodes2["EOF"] = -1] = "EOF"; - CharacterCodes2[CharacterCodes2["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes2[CharacterCodes2["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; - CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed"; - CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn"; - CharacterCodes2[CharacterCodes2["lineSeparator"] = 8232] = "lineSeparator"; - CharacterCodes2[CharacterCodes2["paragraphSeparator"] = 8233] = "paragraphSeparator"; - CharacterCodes2[CharacterCodes2["nextLine"] = 133] = "nextLine"; - CharacterCodes2[CharacterCodes2["space"] = 32] = "space"; - CharacterCodes2[CharacterCodes2["nonBreakingSpace"] = 160] = "nonBreakingSpace"; - CharacterCodes2[CharacterCodes2["enQuad"] = 8192] = "enQuad"; - CharacterCodes2[CharacterCodes2["emQuad"] = 8193] = "emQuad"; - CharacterCodes2[CharacterCodes2["enSpace"] = 8194] = "enSpace"; - CharacterCodes2[CharacterCodes2["emSpace"] = 8195] = "emSpace"; - CharacterCodes2[CharacterCodes2["threePerEmSpace"] = 8196] = "threePerEmSpace"; - CharacterCodes2[CharacterCodes2["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; - CharacterCodes2[CharacterCodes2["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; - CharacterCodes2[CharacterCodes2["figureSpace"] = 8199] = "figureSpace"; - CharacterCodes2[CharacterCodes2["punctuationSpace"] = 8200] = "punctuationSpace"; - CharacterCodes2[CharacterCodes2["thinSpace"] = 8201] = "thinSpace"; - CharacterCodes2[CharacterCodes2["hairSpace"] = 8202] = "hairSpace"; - CharacterCodes2[CharacterCodes2["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; - CharacterCodes2[CharacterCodes2["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; - 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"; - CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1"; - CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2"; - CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3"; - CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4"; - CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5"; - CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6"; - CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7"; - CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8"; - CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9"; - CharacterCodes2[CharacterCodes2["a"] = 97] = "a"; - CharacterCodes2[CharacterCodes2["b"] = 98] = "b"; - CharacterCodes2[CharacterCodes2["c"] = 99] = "c"; - CharacterCodes2[CharacterCodes2["d"] = 100] = "d"; - CharacterCodes2[CharacterCodes2["e"] = 101] = "e"; - CharacterCodes2[CharacterCodes2["f"] = 102] = "f"; - CharacterCodes2[CharacterCodes2["g"] = 103] = "g"; - CharacterCodes2[CharacterCodes2["h"] = 104] = "h"; - CharacterCodes2[CharacterCodes2["i"] = 105] = "i"; - CharacterCodes2[CharacterCodes2["j"] = 106] = "j"; - CharacterCodes2[CharacterCodes2["k"] = 107] = "k"; - CharacterCodes2[CharacterCodes2["l"] = 108] = "l"; - CharacterCodes2[CharacterCodes2["m"] = 109] = "m"; - CharacterCodes2[CharacterCodes2["n"] = 110] = "n"; - CharacterCodes2[CharacterCodes2["o"] = 111] = "o"; - CharacterCodes2[CharacterCodes2["p"] = 112] = "p"; - CharacterCodes2[CharacterCodes2["q"] = 113] = "q"; - CharacterCodes2[CharacterCodes2["r"] = 114] = "r"; - CharacterCodes2[CharacterCodes2["s"] = 115] = "s"; - CharacterCodes2[CharacterCodes2["t"] = 116] = "t"; - CharacterCodes2[CharacterCodes2["u"] = 117] = "u"; - CharacterCodes2[CharacterCodes2["v"] = 118] = "v"; - CharacterCodes2[CharacterCodes2["w"] = 119] = "w"; - CharacterCodes2[CharacterCodes2["x"] = 120] = "x"; - CharacterCodes2[CharacterCodes2["y"] = 121] = "y"; - CharacterCodes2[CharacterCodes2["z"] = 122] = "z"; - CharacterCodes2[CharacterCodes2["A"] = 65] = "A"; - CharacterCodes2[CharacterCodes2["B"] = 66] = "B"; - CharacterCodes2[CharacterCodes2["C"] = 67] = "C"; - CharacterCodes2[CharacterCodes2["D"] = 68] = "D"; - CharacterCodes2[CharacterCodes2["E"] = 69] = "E"; - CharacterCodes2[CharacterCodes2["F"] = 70] = "F"; - CharacterCodes2[CharacterCodes2["G"] = 71] = "G"; - CharacterCodes2[CharacterCodes2["H"] = 72] = "H"; - CharacterCodes2[CharacterCodes2["I"] = 73] = "I"; - CharacterCodes2[CharacterCodes2["J"] = 74] = "J"; - CharacterCodes2[CharacterCodes2["K"] = 75] = "K"; - CharacterCodes2[CharacterCodes2["L"] = 76] = "L"; - CharacterCodes2[CharacterCodes2["M"] = 77] = "M"; - CharacterCodes2[CharacterCodes2["N"] = 78] = "N"; - CharacterCodes2[CharacterCodes2["O"] = 79] = "O"; - CharacterCodes2[CharacterCodes2["P"] = 80] = "P"; - CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q"; - CharacterCodes2[CharacterCodes2["R"] = 82] = "R"; - CharacterCodes2[CharacterCodes2["S"] = 83] = "S"; - CharacterCodes2[CharacterCodes2["T"] = 84] = "T"; - CharacterCodes2[CharacterCodes2["U"] = 85] = "U"; - CharacterCodes2[CharacterCodes2["V"] = 86] = "V"; - CharacterCodes2[CharacterCodes2["W"] = 87] = "W"; - CharacterCodes2[CharacterCodes2["X"] = 88] = "X"; - CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y"; - CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z"; - CharacterCodes2[CharacterCodes2["ampersand"] = 38] = "ampersand"; - CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk"; - CharacterCodes2[CharacterCodes2["at"] = 64] = "at"; - CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash"; - CharacterCodes2[CharacterCodes2["backtick"] = 96] = "backtick"; - CharacterCodes2[CharacterCodes2["bar"] = 124] = "bar"; - CharacterCodes2[CharacterCodes2["caret"] = 94] = "caret"; - CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace"; - CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket"; - CharacterCodes2[CharacterCodes2["closeParen"] = 41] = "closeParen"; - CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon"; - CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma"; - CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot"; - CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote"; - CharacterCodes2[CharacterCodes2["equals"] = 61] = "equals"; - CharacterCodes2[CharacterCodes2["exclamation"] = 33] = "exclamation"; - CharacterCodes2[CharacterCodes2["greaterThan"] = 62] = "greaterThan"; - CharacterCodes2[CharacterCodes2["hash"] = 35] = "hash"; - CharacterCodes2[CharacterCodes2["lessThan"] = 60] = "lessThan"; - CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus"; - CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace"; - CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket"; - CharacterCodes2[CharacterCodes2["openParen"] = 40] = "openParen"; - CharacterCodes2[CharacterCodes2["percent"] = 37] = "percent"; - CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus"; - CharacterCodes2[CharacterCodes2["question"] = 63] = "question"; - CharacterCodes2[CharacterCodes2["semicolon"] = 59] = "semicolon"; - CharacterCodes2[CharacterCodes2["singleQuote"] = 39] = "singleQuote"; - CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash"; - CharacterCodes2[CharacterCodes2["tilde"] = 126] = "tilde"; - CharacterCodes2[CharacterCodes2["backspace"] = 8] = "backspace"; - CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed"; - CharacterCodes2[CharacterCodes2["byteOrderMark"] = 65279] = "byteOrderMark"; - CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab"; - CharacterCodes2[CharacterCodes2["verticalTab"] = 11] = "verticalTab"; - return CharacterCodes2; -})(CharacterCodes || {}); -var Extension = /* @__PURE__ */ ((Extension2) => { - Extension2["Ts"] = ".ts"; - Extension2["Tsx"] = ".tsx"; - Extension2["Dts"] = ".d.ts"; - Extension2["Js"] = ".js"; - Extension2["Jsx"] = ".jsx"; - Extension2["Json"] = ".json"; - Extension2["TsBuildInfo"] = ".tsbuildinfo"; - Extension2["Mjs"] = ".mjs"; - Extension2["Mts"] = ".mts"; - Extension2["Dmts"] = ".d.mts"; - Extension2["Cjs"] = ".cjs"; - Extension2["Cts"] = ".cts"; - Extension2["Dcts"] = ".d.cts"; - return Extension2; -})(Extension || {}); -var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => { - TransformFlags3[TransformFlags3["None"] = 0] = "None"; - TransformFlags3[TransformFlags3["ContainsTypeScript"] = 1] = "ContainsTypeScript"; - TransformFlags3[TransformFlags3["ContainsJsx"] = 2] = "ContainsJsx"; - TransformFlags3[TransformFlags3["ContainsESNext"] = 4] = "ContainsESNext"; - TransformFlags3[TransformFlags3["ContainsES2022"] = 8] = "ContainsES2022"; - TransformFlags3[TransformFlags3["ContainsES2021"] = 16] = "ContainsES2021"; - TransformFlags3[TransformFlags3["ContainsES2020"] = 32] = "ContainsES2020"; - TransformFlags3[TransformFlags3["ContainsES2019"] = 64] = "ContainsES2019"; - TransformFlags3[TransformFlags3["ContainsES2018"] = 128] = "ContainsES2018"; - TransformFlags3[TransformFlags3["ContainsES2017"] = 256] = "ContainsES2017"; - TransformFlags3[TransformFlags3["ContainsES2016"] = 512] = "ContainsES2016"; - TransformFlags3[TransformFlags3["ContainsES2015"] = 1024] = "ContainsES2015"; - TransformFlags3[TransformFlags3["ContainsGenerator"] = 2048] = "ContainsGenerator"; - TransformFlags3[TransformFlags3["ContainsDestructuringAssignment"] = 4096] = "ContainsDestructuringAssignment"; - TransformFlags3[TransformFlags3["ContainsTypeScriptClassSyntax"] = 8192] = "ContainsTypeScriptClassSyntax"; - TransformFlags3[TransformFlags3["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; - TransformFlags3[TransformFlags3["ContainsRestOrSpread"] = 32768] = "ContainsRestOrSpread"; - TransformFlags3[TransformFlags3["ContainsObjectRestOrSpread"] = 65536] = "ContainsObjectRestOrSpread"; - TransformFlags3[TransformFlags3["ContainsComputedPropertyName"] = 131072] = "ContainsComputedPropertyName"; - TransformFlags3[TransformFlags3["ContainsBlockScopedBinding"] = 262144] = "ContainsBlockScopedBinding"; - TransformFlags3[TransformFlags3["ContainsBindingPattern"] = 524288] = "ContainsBindingPattern"; - TransformFlags3[TransformFlags3["ContainsYield"] = 1048576] = "ContainsYield"; - TransformFlags3[TransformFlags3["ContainsAwait"] = 2097152] = "ContainsAwait"; - TransformFlags3[TransformFlags3["ContainsHoistedDeclarationOrCompletion"] = 4194304] = "ContainsHoistedDeclarationOrCompletion"; - TransformFlags3[TransformFlags3["ContainsDynamicImport"] = 8388608] = "ContainsDynamicImport"; - TransformFlags3[TransformFlags3["ContainsClassFields"] = 16777216] = "ContainsClassFields"; - TransformFlags3[TransformFlags3["ContainsDecorators"] = 33554432] = "ContainsDecorators"; - TransformFlags3[TransformFlags3["ContainsPossibleTopLevelAwait"] = 67108864] = "ContainsPossibleTopLevelAwait"; - TransformFlags3[TransformFlags3["ContainsLexicalSuper"] = 134217728] = "ContainsLexicalSuper"; - TransformFlags3[TransformFlags3["ContainsUpdateExpressionForIdentifier"] = 268435456] = "ContainsUpdateExpressionForIdentifier"; - TransformFlags3[TransformFlags3["ContainsPrivateIdentifierInExpression"] = 536870912] = "ContainsPrivateIdentifierInExpression"; - TransformFlags3[TransformFlags3["HasComputedFlags"] = -2147483648] = "HasComputedFlags"; - TransformFlags3[TransformFlags3["AssertTypeScript"] = 1 /* ContainsTypeScript */] = "AssertTypeScript"; - TransformFlags3[TransformFlags3["AssertJsx"] = 2 /* ContainsJsx */] = "AssertJsx"; - TransformFlags3[TransformFlags3["AssertESNext"] = 4 /* ContainsESNext */] = "AssertESNext"; - TransformFlags3[TransformFlags3["AssertES2022"] = 8 /* ContainsES2022 */] = "AssertES2022"; - TransformFlags3[TransformFlags3["AssertES2021"] = 16 /* ContainsES2021 */] = "AssertES2021"; - TransformFlags3[TransformFlags3["AssertES2020"] = 32 /* ContainsES2020 */] = "AssertES2020"; - TransformFlags3[TransformFlags3["AssertES2019"] = 64 /* ContainsES2019 */] = "AssertES2019"; - TransformFlags3[TransformFlags3["AssertES2018"] = 128 /* ContainsES2018 */] = "AssertES2018"; - TransformFlags3[TransformFlags3["AssertES2017"] = 256 /* ContainsES2017 */] = "AssertES2017"; - TransformFlags3[TransformFlags3["AssertES2016"] = 512 /* ContainsES2016 */] = "AssertES2016"; - TransformFlags3[TransformFlags3["AssertES2015"] = 1024 /* ContainsES2015 */] = "AssertES2015"; - TransformFlags3[TransformFlags3["AssertGenerator"] = 2048 /* ContainsGenerator */] = "AssertGenerator"; - TransformFlags3[TransformFlags3["AssertDestructuringAssignment"] = 4096 /* ContainsDestructuringAssignment */] = "AssertDestructuringAssignment"; - TransformFlags3[TransformFlags3["OuterExpressionExcludes"] = -2147483648 /* HasComputedFlags */] = "OuterExpressionExcludes"; - TransformFlags3[TransformFlags3["PropertyAccessExcludes"] = -2147483648 /* OuterExpressionExcludes */] = "PropertyAccessExcludes"; - TransformFlags3[TransformFlags3["NodeExcludes"] = -2147483648 /* PropertyAccessExcludes */] = "NodeExcludes"; - TransformFlags3[TransformFlags3["ArrowFunctionExcludes"] = -2072174592] = "ArrowFunctionExcludes"; - TransformFlags3[TransformFlags3["FunctionExcludes"] = -1937940480] = "FunctionExcludes"; - TransformFlags3[TransformFlags3["ConstructorExcludes"] = -1937948672] = "ConstructorExcludes"; - TransformFlags3[TransformFlags3["MethodOrAccessorExcludes"] = -2005057536] = "MethodOrAccessorExcludes"; - TransformFlags3[TransformFlags3["PropertyExcludes"] = -2013249536] = "PropertyExcludes"; - TransformFlags3[TransformFlags3["ClassExcludes"] = -2147344384] = "ClassExcludes"; - TransformFlags3[TransformFlags3["ModuleExcludes"] = -1941676032] = "ModuleExcludes"; - TransformFlags3[TransformFlags3["TypeExcludes"] = -2] = "TypeExcludes"; - TransformFlags3[TransformFlags3["ObjectLiteralExcludes"] = -2147278848] = "ObjectLiteralExcludes"; - TransformFlags3[TransformFlags3["ArrayLiteralOrCallOrNewExcludes"] = -2147450880] = "ArrayLiteralOrCallOrNewExcludes"; - TransformFlags3[TransformFlags3["VariableDeclarationListExcludes"] = -2146893824] = "VariableDeclarationListExcludes"; - TransformFlags3[TransformFlags3["ParameterExcludes"] = -2147483648 /* NodeExcludes */] = "ParameterExcludes"; - TransformFlags3[TransformFlags3["CatchClauseExcludes"] = -2147418112] = "CatchClauseExcludes"; - TransformFlags3[TransformFlags3["BindingPatternExcludes"] = -2147450880] = "BindingPatternExcludes"; - TransformFlags3[TransformFlags3["ContainsLexicalThisOrSuper"] = 134234112] = "ContainsLexicalThisOrSuper"; - TransformFlags3[TransformFlags3["PropertyNamePropagatingFlags"] = 134234112] = "PropertyNamePropagatingFlags"; - return TransformFlags3; -})(TransformFlags || {}); -var SnippetKind = /* @__PURE__ */ ((SnippetKind3) => { - SnippetKind3[SnippetKind3["TabStop"] = 0] = "TabStop"; - SnippetKind3[SnippetKind3["Placeholder"] = 1] = "Placeholder"; - SnippetKind3[SnippetKind3["Choice"] = 2] = "Choice"; - SnippetKind3[SnippetKind3["Variable"] = 3] = "Variable"; - return SnippetKind3; -})(SnippetKind || {}); -var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => { - EmitFlags3[EmitFlags3["None"] = 0] = "None"; - EmitFlags3[EmitFlags3["SingleLine"] = 1] = "SingleLine"; - EmitFlags3[EmitFlags3["MultiLine"] = 2] = "MultiLine"; - EmitFlags3[EmitFlags3["AdviseOnEmitNode"] = 4] = "AdviseOnEmitNode"; - EmitFlags3[EmitFlags3["NoSubstitution"] = 8] = "NoSubstitution"; - EmitFlags3[EmitFlags3["CapturesThis"] = 16] = "CapturesThis"; - EmitFlags3[EmitFlags3["NoLeadingSourceMap"] = 32] = "NoLeadingSourceMap"; - EmitFlags3[EmitFlags3["NoTrailingSourceMap"] = 64] = "NoTrailingSourceMap"; - EmitFlags3[EmitFlags3["NoSourceMap"] = 96] = "NoSourceMap"; - EmitFlags3[EmitFlags3["NoNestedSourceMaps"] = 128] = "NoNestedSourceMaps"; - EmitFlags3[EmitFlags3["NoTokenLeadingSourceMaps"] = 256] = "NoTokenLeadingSourceMaps"; - EmitFlags3[EmitFlags3["NoTokenTrailingSourceMaps"] = 512] = "NoTokenTrailingSourceMaps"; - EmitFlags3[EmitFlags3["NoTokenSourceMaps"] = 768] = "NoTokenSourceMaps"; - EmitFlags3[EmitFlags3["NoLeadingComments"] = 1024] = "NoLeadingComments"; - EmitFlags3[EmitFlags3["NoTrailingComments"] = 2048] = "NoTrailingComments"; - EmitFlags3[EmitFlags3["NoComments"] = 3072] = "NoComments"; - EmitFlags3[EmitFlags3["NoNestedComments"] = 4096] = "NoNestedComments"; - EmitFlags3[EmitFlags3["HelperName"] = 8192] = "HelperName"; - EmitFlags3[EmitFlags3["ExportName"] = 16384] = "ExportName"; - EmitFlags3[EmitFlags3["LocalName"] = 32768] = "LocalName"; - EmitFlags3[EmitFlags3["InternalName"] = 65536] = "InternalName"; - EmitFlags3[EmitFlags3["Indented"] = 131072] = "Indented"; - EmitFlags3[EmitFlags3["NoIndentation"] = 262144] = "NoIndentation"; - EmitFlags3[EmitFlags3["AsyncFunctionBody"] = 524288] = "AsyncFunctionBody"; - EmitFlags3[EmitFlags3["ReuseTempVariableScope"] = 1048576] = "ReuseTempVariableScope"; - EmitFlags3[EmitFlags3["CustomPrologue"] = 2097152] = "CustomPrologue"; - EmitFlags3[EmitFlags3["NoHoisting"] = 4194304] = "NoHoisting"; - EmitFlags3[EmitFlags3["Iterator"] = 8388608] = "Iterator"; - EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; - return EmitFlags3; -})(EmitFlags || {}); -var InternalEmitFlags = /* @__PURE__ */ ((InternalEmitFlags3) => { - InternalEmitFlags3[InternalEmitFlags3["None"] = 0] = "None"; - InternalEmitFlags3[InternalEmitFlags3["TypeScriptClassWrapper"] = 1] = "TypeScriptClassWrapper"; - InternalEmitFlags3[InternalEmitFlags3["NeverApplyImportHelper"] = 2] = "NeverApplyImportHelper"; - InternalEmitFlags3[InternalEmitFlags3["IgnoreSourceNewlines"] = 4] = "IgnoreSourceNewlines"; - InternalEmitFlags3[InternalEmitFlags3["Immutable"] = 8] = "Immutable"; - InternalEmitFlags3[InternalEmitFlags3["IndirectCall"] = 16] = "IndirectCall"; - InternalEmitFlags3[InternalEmitFlags3["TransformPrivateStaticElements"] = 32] = "TransformPrivateStaticElements"; - return InternalEmitFlags3; -})(InternalEmitFlags || {}); -var LanguageFeatureMinimumTarget = { - Classes: 2 /* ES2015 */, - ForOf: 2 /* ES2015 */, - Generators: 2 /* ES2015 */, - Iteration: 2 /* ES2015 */, - SpreadElements: 2 /* ES2015 */, - RestElements: 2 /* ES2015 */, - TaggedTemplates: 2 /* ES2015 */, - DestructuringAssignment: 2 /* ES2015 */, - BindingPatterns: 2 /* ES2015 */, - ArrowFunctions: 2 /* ES2015 */, - BlockScopedVariables: 2 /* ES2015 */, - ObjectAssign: 2 /* ES2015 */, - RegularExpressionFlagsUnicode: 2 /* ES2015 */, - RegularExpressionFlagsSticky: 2 /* ES2015 */, - Exponentiation: 3 /* ES2016 */, - AsyncFunctions: 4 /* ES2017 */, - ForAwaitOf: 5 /* ES2018 */, - AsyncGenerators: 5 /* ES2018 */, - AsyncIteration: 5 /* ES2018 */, - ObjectSpreadRest: 5 /* ES2018 */, - RegularExpressionFlagsDotAll: 5 /* ES2018 */, - BindinglessCatch: 6 /* ES2019 */, - BigInt: 7 /* ES2020 */, - NullishCoalesce: 7 /* ES2020 */, - OptionalChaining: 7 /* ES2020 */, - LogicalAssignment: 8 /* ES2021 */, - TopLevelAwait: 9 /* ES2022 */, - ClassFields: 9 /* ES2022 */, - PrivateNamesAndClassStaticBlocks: 9 /* ES2022 */, - RegularExpressionFlagsHasIndices: 9 /* ES2022 */, - ShebangComments: 10 /* ES2023 */, - RegularExpressionFlagsUnicodeSets: 11 /* ES2024 */, - UsingAndAwaitUsing: 99 /* ESNext */, - ClassAndClassElementDecorators: 99 /* ESNext */ -}; -var ExternalEmitHelpers = /* @__PURE__ */ ((ExternalEmitHelpers2) => { - ExternalEmitHelpers2[ExternalEmitHelpers2["Extends"] = 1] = "Extends"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Assign"] = 2] = "Assign"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Rest"] = 4] = "Rest"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Decorate"] = 8] = "Decorate"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ESDecorateAndRunInitializers"] = 8 /* Decorate */] = "ESDecorateAndRunInitializers"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Metadata"] = 16] = "Metadata"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Param"] = 32] = "Param"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Awaiter"] = 64] = "Awaiter"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Generator"] = 128] = "Generator"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Values"] = 256] = "Values"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Read"] = 512] = "Read"; - ExternalEmitHelpers2[ExternalEmitHelpers2["SpreadArray"] = 1024] = "SpreadArray"; - ExternalEmitHelpers2[ExternalEmitHelpers2["Await"] = 2048] = "Await"; - ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGenerator"] = 4096] = "AsyncGenerator"; - ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncDelegator"] = 8192] = "AsyncDelegator"; - ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncValues"] = 16384] = "AsyncValues"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ExportStar"] = 32768] = "ExportStar"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ImportStar"] = 65536] = "ImportStar"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ImportDefault"] = 131072] = "ImportDefault"; - ExternalEmitHelpers2[ExternalEmitHelpers2["MakeTemplateObject"] = 262144] = "MakeTemplateObject"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldGet"] = 524288] = "ClassPrivateFieldGet"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldSet"] = 1048576] = "ClassPrivateFieldSet"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldIn"] = 2097152] = "ClassPrivateFieldIn"; - ExternalEmitHelpers2[ExternalEmitHelpers2["SetFunctionName"] = 4194304] = "SetFunctionName"; - ExternalEmitHelpers2[ExternalEmitHelpers2["PropKey"] = 8388608] = "PropKey"; - ExternalEmitHelpers2[ExternalEmitHelpers2["AddDisposableResourceAndDisposeResources"] = 16777216] = "AddDisposableResourceAndDisposeResources"; - ExternalEmitHelpers2[ExternalEmitHelpers2["RewriteRelativeImportExtension"] = 33554432] = "RewriteRelativeImportExtension"; - ExternalEmitHelpers2[ExternalEmitHelpers2["FirstEmitHelper"] = 1 /* Extends */] = "FirstEmitHelper"; - ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 16777216 /* AddDisposableResourceAndDisposeResources */] = "LastEmitHelper"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ForOfIncludes"] = 256 /* Values */] = "ForOfIncludes"; - ExternalEmitHelpers2[ExternalEmitHelpers2["ForAwaitOfIncludes"] = 16384 /* AsyncValues */] = "ForAwaitOfIncludes"; - ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; - ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncDelegatorIncludes"] = 26624] = "AsyncDelegatorIncludes"; - ExternalEmitHelpers2[ExternalEmitHelpers2["SpreadIncludes"] = 1536] = "SpreadIncludes"; - return ExternalEmitHelpers2; -})(ExternalEmitHelpers || {}); -var EmitHint = /* @__PURE__ */ ((EmitHint5) => { - EmitHint5[EmitHint5["SourceFile"] = 0] = "SourceFile"; - EmitHint5[EmitHint5["Expression"] = 1] = "Expression"; - EmitHint5[EmitHint5["IdentifierName"] = 2] = "IdentifierName"; - EmitHint5[EmitHint5["MappedTypeParameter"] = 3] = "MappedTypeParameter"; - EmitHint5[EmitHint5["Unspecified"] = 4] = "Unspecified"; - EmitHint5[EmitHint5["EmbeddedStatement"] = 5] = "EmbeddedStatement"; - EmitHint5[EmitHint5["JsxAttributeValue"] = 6] = "JsxAttributeValue"; - EmitHint5[EmitHint5["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes"; - return EmitHint5; -})(EmitHint || {}); -var OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => { - OuterExpressionKinds2[OuterExpressionKinds2["Parentheses"] = 1] = "Parentheses"; - OuterExpressionKinds2[OuterExpressionKinds2["TypeAssertions"] = 2] = "TypeAssertions"; - OuterExpressionKinds2[OuterExpressionKinds2["NonNullAssertions"] = 4] = "NonNullAssertions"; - OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; - OuterExpressionKinds2[OuterExpressionKinds2["ExpressionsWithTypeArguments"] = 16] = "ExpressionsWithTypeArguments"; - OuterExpressionKinds2[OuterExpressionKinds2["Satisfies"] = 32] = "Satisfies"; - OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 38] = "Assertions"; - OuterExpressionKinds2[OuterExpressionKinds2["All"] = 63] = "All"; - OuterExpressionKinds2[OuterExpressionKinds2["ExcludeJSDocTypeAssertion"] = -2147483648] = "ExcludeJSDocTypeAssertion"; - return OuterExpressionKinds2; -})(OuterExpressionKinds || {}); -var LexicalEnvironmentFlags = /* @__PURE__ */ ((LexicalEnvironmentFlags2) => { - LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["None"] = 0] = "None"; - LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["InParameters"] = 1] = "InParameters"; - LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["VariablesHoistedInParameters"] = 2] = "VariablesHoistedInParameters"; - return LexicalEnvironmentFlags2; -})(LexicalEnvironmentFlags || {}); -var ListFormat = /* @__PURE__ */ ((ListFormat2) => { - ListFormat2[ListFormat2["None"] = 0] = "None"; - ListFormat2[ListFormat2["SingleLine"] = 0] = "SingleLine"; - ListFormat2[ListFormat2["MultiLine"] = 1] = "MultiLine"; - ListFormat2[ListFormat2["PreserveLines"] = 2] = "PreserveLines"; - ListFormat2[ListFormat2["LinesMask"] = 3] = "LinesMask"; - ListFormat2[ListFormat2["NotDelimited"] = 0] = "NotDelimited"; - ListFormat2[ListFormat2["BarDelimited"] = 4] = "BarDelimited"; - ListFormat2[ListFormat2["AmpersandDelimited"] = 8] = "AmpersandDelimited"; - ListFormat2[ListFormat2["CommaDelimited"] = 16] = "CommaDelimited"; - ListFormat2[ListFormat2["AsteriskDelimited"] = 32] = "AsteriskDelimited"; - ListFormat2[ListFormat2["DelimitersMask"] = 60] = "DelimitersMask"; - ListFormat2[ListFormat2["AllowTrailingComma"] = 64] = "AllowTrailingComma"; - ListFormat2[ListFormat2["Indented"] = 128] = "Indented"; - ListFormat2[ListFormat2["SpaceBetweenBraces"] = 256] = "SpaceBetweenBraces"; - ListFormat2[ListFormat2["SpaceBetweenSiblings"] = 512] = "SpaceBetweenSiblings"; - ListFormat2[ListFormat2["Braces"] = 1024] = "Braces"; - ListFormat2[ListFormat2["Parenthesis"] = 2048] = "Parenthesis"; - ListFormat2[ListFormat2["AngleBrackets"] = 4096] = "AngleBrackets"; - ListFormat2[ListFormat2["SquareBrackets"] = 8192] = "SquareBrackets"; - ListFormat2[ListFormat2["BracketsMask"] = 15360] = "BracketsMask"; - ListFormat2[ListFormat2["OptionalIfUndefined"] = 16384] = "OptionalIfUndefined"; - ListFormat2[ListFormat2["OptionalIfEmpty"] = 32768] = "OptionalIfEmpty"; - ListFormat2[ListFormat2["Optional"] = 49152] = "Optional"; - ListFormat2[ListFormat2["PreferNewLine"] = 65536] = "PreferNewLine"; - ListFormat2[ListFormat2["NoTrailingNewLine"] = 131072] = "NoTrailingNewLine"; - ListFormat2[ListFormat2["NoInterveningComments"] = 262144] = "NoInterveningComments"; - ListFormat2[ListFormat2["NoSpaceIfEmpty"] = 524288] = "NoSpaceIfEmpty"; - ListFormat2[ListFormat2["SingleElement"] = 1048576] = "SingleElement"; - ListFormat2[ListFormat2["SpaceAfterList"] = 2097152] = "SpaceAfterList"; - ListFormat2[ListFormat2["Modifiers"] = 2359808] = "Modifiers"; - ListFormat2[ListFormat2["HeritageClauses"] = 512] = "HeritageClauses"; - ListFormat2[ListFormat2["SingleLineTypeLiteralMembers"] = 768] = "SingleLineTypeLiteralMembers"; - ListFormat2[ListFormat2["MultiLineTypeLiteralMembers"] = 32897] = "MultiLineTypeLiteralMembers"; - ListFormat2[ListFormat2["SingleLineTupleTypeElements"] = 528] = "SingleLineTupleTypeElements"; - ListFormat2[ListFormat2["MultiLineTupleTypeElements"] = 657] = "MultiLineTupleTypeElements"; - ListFormat2[ListFormat2["UnionTypeConstituents"] = 516] = "UnionTypeConstituents"; - ListFormat2[ListFormat2["IntersectionTypeConstituents"] = 520] = "IntersectionTypeConstituents"; - ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements"; - ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements"; - ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties"; - 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"; - ListFormat2[ListFormat2["NewExpressionArguments"] = 18960] = "NewExpressionArguments"; - ListFormat2[ListFormat2["TemplateExpressionSpans"] = 262144] = "TemplateExpressionSpans"; - ListFormat2[ListFormat2["SingleLineBlockStatements"] = 768] = "SingleLineBlockStatements"; - ListFormat2[ListFormat2["MultiLineBlockStatements"] = 129] = "MultiLineBlockStatements"; - ListFormat2[ListFormat2["VariableDeclarationList"] = 528] = "VariableDeclarationList"; - ListFormat2[ListFormat2["SingleLineFunctionBodyStatements"] = 768] = "SingleLineFunctionBodyStatements"; - ListFormat2[ListFormat2["MultiLineFunctionBodyStatements"] = 1 /* MultiLine */] = "MultiLineFunctionBodyStatements"; - ListFormat2[ListFormat2["ClassHeritageClauses"] = 0 /* SingleLine */] = "ClassHeritageClauses"; - ListFormat2[ListFormat2["ClassMembers"] = 129] = "ClassMembers"; - ListFormat2[ListFormat2["InterfaceMembers"] = 129] = "InterfaceMembers"; - ListFormat2[ListFormat2["EnumMembers"] = 145] = "EnumMembers"; - ListFormat2[ListFormat2["CaseBlockClauses"] = 129] = "CaseBlockClauses"; - ListFormat2[ListFormat2["NamedImportsOrExportsElements"] = 525136] = "NamedImportsOrExportsElements"; - ListFormat2[ListFormat2["JsxElementOrFragmentChildren"] = 262144] = "JsxElementOrFragmentChildren"; - ListFormat2[ListFormat2["JsxElementAttributes"] = 262656] = "JsxElementAttributes"; - ListFormat2[ListFormat2["CaseOrDefaultClauseStatements"] = 163969] = "CaseOrDefaultClauseStatements"; - ListFormat2[ListFormat2["HeritageClauseTypes"] = 528] = "HeritageClauseTypes"; - ListFormat2[ListFormat2["SourceFileStatements"] = 131073] = "SourceFileStatements"; - ListFormat2[ListFormat2["Decorators"] = 2146305] = "Decorators"; - ListFormat2[ListFormat2["TypeArguments"] = 53776] = "TypeArguments"; - ListFormat2[ListFormat2["TypeParameters"] = 53776] = "TypeParameters"; - ListFormat2[ListFormat2["Parameters"] = 2576] = "Parameters"; - ListFormat2[ListFormat2["IndexSignatureParameters"] = 8848] = "IndexSignatureParameters"; - ListFormat2[ListFormat2["JSDocComment"] = 33] = "JSDocComment"; - return ListFormat2; -})(ListFormat || {}); -var PragmaKindFlags = /* @__PURE__ */ ((PragmaKindFlags2) => { - PragmaKindFlags2[PragmaKindFlags2["None"] = 0] = "None"; - PragmaKindFlags2[PragmaKindFlags2["TripleSlashXML"] = 1] = "TripleSlashXML"; - PragmaKindFlags2[PragmaKindFlags2["SingleLine"] = 2] = "SingleLine"; - PragmaKindFlags2[PragmaKindFlags2["MultiLine"] = 4] = "MultiLine"; - PragmaKindFlags2[PragmaKindFlags2["All"] = 7] = "All"; - PragmaKindFlags2[PragmaKindFlags2["Default"] = 7 /* All */] = "Default"; - return PragmaKindFlags2; -})(PragmaKindFlags || {}); -var commentPragmas = { - "reference": { - args: [ - { name: "types", optional: true, captureSpan: true }, - { name: "lib", optional: true, captureSpan: true }, - { name: "path", optional: true, captureSpan: true }, - { name: "no-default-lib", optional: true }, - { name: "resolution-mode", optional: true }, - { name: "preserve", optional: true } - ], - kind: 1 /* TripleSlashXML */ - }, - "amd-dependency": { - args: [{ name: "path" }, { name: "name", optional: true }], - kind: 1 /* TripleSlashXML */ - }, - "amd-module": { - args: [{ name: "name" }], - kind: 1 /* TripleSlashXML */ - }, - "ts-check": { - kind: 2 /* SingleLine */ - }, - "ts-nocheck": { - kind: 2 /* SingleLine */ - }, - "jsx": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsxfrag": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsximportsource": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsxruntime": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - } -}; -var 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 || {}); - -// src/compiler/sys.ts -function generateDjb2Hash(data) { - let acc = 5381; - for (let i = 0; i < data.length; i++) { - acc = (acc << 5) + acc + data.charCodeAt(i); - } - return acc.toString(); -} -function setStackTraceLimit() { - if (Error.stackTraceLimit < 100) { - Error.stackTraceLimit = 100; - } -} -var FileWatcherEventKind = /* @__PURE__ */ ((FileWatcherEventKind2) => { - FileWatcherEventKind2[FileWatcherEventKind2["Created"] = 0] = "Created"; - FileWatcherEventKind2[FileWatcherEventKind2["Changed"] = 1] = "Changed"; - FileWatcherEventKind2[FileWatcherEventKind2["Deleted"] = 2] = "Deleted"; - return FileWatcherEventKind2; -})(FileWatcherEventKind || {}); -var PollingInterval = /* @__PURE__ */ ((PollingInterval3) => { - PollingInterval3[PollingInterval3["High"] = 2e3] = "High"; - PollingInterval3[PollingInterval3["Medium"] = 500] = "Medium"; - PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; - return PollingInterval3; -})(PollingInterval || {}); -var missingFileModifiedTime = /* @__PURE__ */ new Date(0); -function getModifiedTime(host, fileName) { - return host.getModifiedTime(fileName) || missingFileModifiedTime; -} -function createPollingIntervalBasedLevels(levels) { - return { - [250 /* Low */]: levels.Low, - [500 /* Medium */]: levels.Medium, - [2e3 /* High */]: levels.High - }; -} -var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; -var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); -var unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); -function setCustomPollingValues(system) { - if (!system.getEnvironmentVariable) { - return; - } - const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval); - pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize; - unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds; - function getLevel(envVar, level) { - return system.getEnvironmentVariable(`${envVar}_${level.toUpperCase()}`); - } - function getCustomLevels(baseVariable) { - let customLevels; - setCustomLevel("Low"); - setCustomLevel("Medium"); - setCustomLevel("High"); - return customLevels; - function setCustomLevel(level) { - const customLevel = getLevel(baseVariable, level); - if (customLevel) { - (customLevels || (customLevels = {}))[level] = Number(customLevel); - } - } - } - function setCustomLevels(baseVariable, levels) { - const customLevels = getCustomLevels(baseVariable); - if (customLevels) { - setLevel("Low"); - setLevel("Medium"); - setLevel("High"); - return true; - } - return false; - function setLevel(level) { - levels[level] = customLevels[level] || levels[level]; - } - } - function getCustomPollingBasedLevels(baseVariable, defaultLevels) { - const customLevels = getCustomLevels(baseVariable); - return (pollingIntervalChanged || customLevels) && createPollingIntervalBasedLevels(customLevels ? { ...defaultLevels, ...customLevels } : defaultLevels); - } -} -function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) { - let definedValueCopyToIndex = pollIndex; - for (let canVisit = queue.length; chunkSize && canVisit; nextPollIndex(), canVisit--) { - const watchedFile = queue[pollIndex]; - if (!watchedFile) { - continue; - } else if (watchedFile.isClosed) { - queue[pollIndex] = void 0; - continue; - } - chunkSize--; - const fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(host, watchedFile.fileName)); - if (watchedFile.isClosed) { - queue[pollIndex] = void 0; - continue; - } - callbackOnWatchFileStat == null ? void 0 : callbackOnWatchFileStat(watchedFile, pollIndex, fileChanged); - if (queue[pollIndex]) { - if (definedValueCopyToIndex < pollIndex) { - queue[definedValueCopyToIndex] = watchedFile; - queue[pollIndex] = void 0; - } - definedValueCopyToIndex++; - } - } - return pollIndex; - function nextPollIndex() { - pollIndex++; - if (pollIndex === queue.length) { - if (definedValueCopyToIndex < pollIndex) { - queue.length = definedValueCopyToIndex; - } - pollIndex = 0; - definedValueCopyToIndex = 0; - } - } -} -function createDynamicPriorityPollingWatchFile(host) { - const watchedFiles = []; - const changedFilesInLastPoll = []; - const lowPollingIntervalQueue = createPollingIntervalQueue(250 /* Low */); - const mediumPollingIntervalQueue = createPollingIntervalQueue(500 /* Medium */); - const highPollingIntervalQueue = createPollingIntervalQueue(2e3 /* High */); - return watchFile2; - function watchFile2(fileName, callback, defaultPollingInterval) { - const file = { - fileName, - callback, - unchangedPolls: 0, - mtime: getModifiedTime(host, fileName) - }; - watchedFiles.push(file); - addToPollingIntervalQueue(file, defaultPollingInterval); - return { - close: () => { - file.isClosed = true; - unorderedRemoveItem(watchedFiles, file); - } - }; - } - function createPollingIntervalQueue(pollingInterval) { - const queue = []; - queue.pollingInterval = pollingInterval; - queue.pollIndex = 0; - queue.pollScheduled = false; - return queue; - } - function pollPollingIntervalQueue(_timeoutType, queue) { - queue.pollIndex = pollQueue(queue, queue.pollingInterval, queue.pollIndex, pollingChunkSize[queue.pollingInterval]); - if (queue.length) { - scheduleNextPoll(queue.pollingInterval); - } else { - Debug.assert(queue.pollIndex === 0); - queue.pollScheduled = false; - } - } - function pollLowPollingIntervalQueue(_timeoutType, queue) { - pollQueue( - changedFilesInLastPoll, - 250 /* Low */, - /*pollIndex*/ - 0, - changedFilesInLastPoll.length - ); - pollPollingIntervalQueue(_timeoutType, queue); - if (!queue.pollScheduled && changedFilesInLastPoll.length) { - scheduleNextPoll(250 /* Low */); - } - } - function pollQueue(queue, pollingInterval, pollIndex, chunkSize) { - return pollWatchedFileQueue( - host, - queue, - pollIndex, - chunkSize, - onWatchFileStat - ); - function onWatchFileStat(watchedFile, pollIndex2, fileChanged) { - if (fileChanged) { - watchedFile.unchangedPolls = 0; - if (queue !== changedFilesInLastPoll) { - queue[pollIndex2] = void 0; - addChangedFileToLowPollingIntervalQueue(watchedFile); - } - } else if (watchedFile.unchangedPolls !== unchangedPollThresholds[pollingInterval]) { - watchedFile.unchangedPolls++; - } else if (queue === changedFilesInLastPoll) { - watchedFile.unchangedPolls = 1; - queue[pollIndex2] = void 0; - addToPollingIntervalQueue(watchedFile, 250 /* Low */); - } else if (pollingInterval !== 2e3 /* High */) { - watchedFile.unchangedPolls++; - queue[pollIndex2] = void 0; - addToPollingIntervalQueue(watchedFile, pollingInterval === 250 /* Low */ ? 500 /* Medium */ : 2e3 /* High */); - } - } - } - function pollingIntervalQueue(pollingInterval) { - switch (pollingInterval) { - case 250 /* Low */: - return lowPollingIntervalQueue; - case 500 /* Medium */: - return mediumPollingIntervalQueue; - case 2e3 /* High */: - return highPollingIntervalQueue; - } - } - function addToPollingIntervalQueue(file, pollingInterval) { - pollingIntervalQueue(pollingInterval).push(file); - scheduleNextPollIfNotAlreadyScheduled(pollingInterval); - } - function addChangedFileToLowPollingIntervalQueue(file) { - changedFilesInLastPoll.push(file); - scheduleNextPollIfNotAlreadyScheduled(250 /* Low */); - } - function scheduleNextPollIfNotAlreadyScheduled(pollingInterval) { - if (!pollingIntervalQueue(pollingInterval).pollScheduled) { - scheduleNextPoll(pollingInterval); - } - } - function scheduleNextPoll(pollingInterval) { - pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval)); - } -} -function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) { - const fileWatcherCallbacks = createMultiMap(); - const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0; - const dirWatchers = /* @__PURE__ */ new Map(); - const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2); - return nonPollingWatchFile; - function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) { - const filePath = toCanonicalName(fileName); - if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) { - fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime); - } - const dirPath = getDirectoryPath(filePath) || "."; - const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions); - watcher.referenceCount++; - return { - close: () => { - if (watcher.referenceCount === 1) { - watcher.close(); - dirWatchers.delete(dirPath); - } else { - watcher.referenceCount--; - } - fileWatcherCallbacks.remove(filePath, callback); - } - }; - } - function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { - const watcher = fsWatch( - dirName, - 1 /* Directory */, - (eventName, relativeFileName) => { - if (!isString(relativeFileName)) return; - const fileName = getNormalizedAbsolutePath(relativeFileName, dirName); - const filePath = toCanonicalName(fileName); - const callbacks = fileName && fileWatcherCallbacks.get(filePath); - if (callbacks) { - let currentModifiedTime; - let eventKind = 1 /* Changed */; - if (fileTimestamps) { - const existingTime = fileTimestamps.get(filePath); - if (eventName === "change") { - currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime; - if (currentModifiedTime.getTime() === existingTime.getTime()) return; - } - currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime); - fileTimestamps.set(filePath, currentModifiedTime); - if (existingTime === missingFileModifiedTime) eventKind = 0 /* Created */; - else if (currentModifiedTime === missingFileModifiedTime) eventKind = 2 /* Deleted */; - } - for (const fileCallback of callbacks) { - fileCallback(fileName, eventKind, currentModifiedTime); - } - } - }, - /*recursive*/ - false, - 500 /* Medium */, - fallbackOptions - ); - watcher.referenceCount = 0; - dirWatchers.set(dirPath, watcher); - return watcher; - } -} -function createFixedChunkSizePollingWatchFile(host) { - const watchedFiles = []; - let pollIndex = 0; - let pollScheduled; - return watchFile2; - function watchFile2(fileName, callback) { - const file = { - fileName, - callback, - mtime: getModifiedTime(host, fileName) - }; - watchedFiles.push(file); - scheduleNextPoll(); - return { - close: () => { - file.isClosed = true; - unorderedRemoveItem(watchedFiles, file); - } - }; - } - function pollQueue() { - pollScheduled = void 0; - pollIndex = pollWatchedFileQueue(host, watchedFiles, pollIndex, pollingChunkSize[250 /* Low */]); - scheduleNextPoll(); - } - function scheduleNextPoll() { - if (!watchedFiles.length || pollScheduled) return; - pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue"); - } -} -function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) { - const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); - const path = toCanonicalFileName(name); - const existing = cache.get(path); - if (existing) { - existing.callbacks.push(callback); - } else { - cache.set(path, { - watcher: createWatcher( - // Cant infer types correctly so lets satisfy checker - (param1, param2, param3) => { - var _a; - return (_a = cache.get(path)) == null ? void 0 : _a.callbacks.slice().forEach((cb) => cb(param1, param2, param3)); - } - ), - callbacks: [callback] - }); - } - return { - close: () => { - const watcher = cache.get(path); - if (!watcher) return; - if (!orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length) return; - cache.delete(path); - closeFileWatcherOf(watcher); - } - }; -} -function onWatchedFileStat(watchedFile, modifiedTime) { - const oldTime = watchedFile.mtime.getTime(); - const newTime = modifiedTime.getTime(); - if (oldTime !== newTime) { - watchedFile.mtime = modifiedTime; - watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime); - return true; - } - return false; -} -function getFileWatcherEventKind(oldTime, newTime) { - return oldTime === 0 ? 0 /* Created */ : newTime === 0 ? 2 /* Deleted */ : 1 /* Changed */; -} -var ignoredPaths = ["/node_modules/.", "/.git", "/.#"]; -var curSysLog = noop; -function sysLog(s) { - return curSysLog(s); -} -function setSysLog(logger) { - curSysLog = logger; -} -function createDirectoryWatcherSupportingRecursive({ - watchDirectory, - useCaseSensitiveFileNames: useCaseSensitiveFileNames2, - getCurrentDirectory, - getAccessibleSortedChildDirectories, - fileSystemEntryExists, - realpath, - setTimeout: setTimeout2, - clearTimeout: clearTimeout2 -}) { - const cache = /* @__PURE__ */ new Map(); - const callbackCache = createMultiMap(); - const cacheToUpdateChildWatches = /* @__PURE__ */ new Map(); - let timerToUpdateChildWatches; - 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, link) { - const dirPath = toCanonicalFilePath(dirName); - let directoryWatcher = cache.get(dirPath); - if (directoryWatcher) { - directoryWatcher.refCount++; - } else { - directoryWatcher = { - watcher: watchDirectory( - dirName, - (fileName) => { - var _a; - if (isIgnoredPath(fileName, options)) return; - if (options == null ? void 0 : options.synchronousWatchDirectory) { - if (!((_a = cache.get(dirPath)) == null ? void 0 : _a.targetWatcher)) invokeCallbacks(dirName, dirPath, fileName); - updateChildWatches(dirName, dirPath, options); - } else { - nonSyncUpdateChildWatches(dirName, dirPath, fileName, options); - } - }, - /*recursive*/ - false, - options - ), - refCount: 1, - childWatches: emptyArray, - targetWatcher: void 0, - links: void 0 - }; - cache.set(dirPath, directoryWatcher); - updateChildWatches(dirName, dirPath, options); - } - if (link) (directoryWatcher.links ?? (directoryWatcher.links = /* @__PURE__ */ new Set())).add(link); - const callbackToAdd = callback && { dirName, callback }; - if (callbackToAdd) { - callbackCache.add(dirPath, callbackToAdd); - } - return { - dirName, - close: () => { - var _a; - const directoryWatcher2 = Debug.checkDefined(cache.get(dirPath)); - if (callbackToAdd) callbackCache.remove(dirPath, callbackToAdd); - if (link) (_a = directoryWatcher2.links) == null ? void 0 : _a.delete(link); - directoryWatcher2.refCount--; - if (directoryWatcher2.refCount) return; - cache.delete(dirPath); - directoryWatcher2.links = void 0; - closeFileWatcherOf(directoryWatcher2); - closeTargetWatcher(directoryWatcher2); - directoryWatcher2.childWatches.forEach(closeFileWatcher); - } - }; - } - function invokeCallbacks(dirName, dirPath, fileNameOrInvokeMap, fileNames) { - var _a, _b; - let fileName; - let invokeMap; - if (isString(fileNameOrInvokeMap)) { - fileName = fileNameOrInvokeMap; - } else { - invokeMap = fileNameOrInvokeMap; - } - callbackCache.forEach((callbacks, rootDirName) => { - if (invokeMap && invokeMap.get(rootDirName) === true) return; - if (rootDirName === dirPath || startsWith(dirPath, rootDirName) && dirPath[rootDirName.length] === directorySeparator) { - if (invokeMap) { - if (fileNames) { - const existing = invokeMap.get(rootDirName); - if (existing) { - existing.push(...fileNames); - } else { - invokeMap.set(rootDirName, fileNames.slice()); - } - } else { - invokeMap.set(rootDirName, true); - } - } else { - callbacks.forEach(({ callback }) => callback(fileName)); - } - } - }); - (_b = (_a = cache.get(dirPath)) == null ? void 0 : _a.links) == null ? void 0 : _b.forEach((link) => { - const toPathInLink = (fileName2) => combinePaths(link, getRelativePathFromDirectory(dirName, fileName2, toCanonicalFilePath)); - if (invokeMap) { - invokeCallbacks(link, toCanonicalFilePath(link), invokeMap, fileNames == null ? void 0 : fileNames.map(toPathInLink)); - } else { - invokeCallbacks(link, toCanonicalFilePath(link), toPathInLink(fileName)); - } - }); - } - function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { - const parentWatcher = cache.get(dirPath); - if (parentWatcher && fileSystemEntryExists(dirName, 1 /* Directory */)) { - scheduleUpdateChildWatches(dirName, dirPath, fileName, options); - return; - } - invokeCallbacks(dirName, dirPath, fileName); - closeTargetWatcher(parentWatcher); - removeChildWatches(parentWatcher); - } - function scheduleUpdateChildWatches(dirName, dirPath, fileName, options) { - const existing = cacheToUpdateChildWatches.get(dirPath); - if (existing) { - existing.fileNames.push(fileName); - } else { - cacheToUpdateChildWatches.set(dirPath, { dirName, options, fileNames: [fileName] }); - } - if (timerToUpdateChildWatches) { - clearTimeout2(timerToUpdateChildWatches); - timerToUpdateChildWatches = void 0; - } - timerToUpdateChildWatches = setTimeout2(onTimerToUpdateChildWatches, 1e3, "timerToUpdateChildWatches"); - } - function onTimerToUpdateChildWatches() { - var _a; - timerToUpdateChildWatches = void 0; - sysLog(`sysLog:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size}`); - const start = timestamp(); - const invokeMap = /* @__PURE__ */ new Map(); - while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { - const result = cacheToUpdateChildWatches.entries().next(); - Debug.assert(!result.done); - const { value: [dirPath, { dirName, options, fileNames }] } = result; - cacheToUpdateChildWatches.delete(dirPath); - const hasChanges = updateChildWatches(dirName, dirPath, options); - if (!((_a = cache.get(dirPath)) == null ? void 0 : _a.targetWatcher)) invokeCallbacks(dirName, dirPath, invokeMap, hasChanges ? void 0 : fileNames); - } - sysLog(`sysLog:: invokingWatchers:: Elapsed:: ${timestamp() - start}ms:: ${cacheToUpdateChildWatches.size}`); - callbackCache.forEach((callbacks, rootDirName) => { - const existing = invokeMap.get(rootDirName); - if (existing) { - callbacks.forEach(({ callback, dirName }) => { - if (isArray(existing)) { - existing.forEach(callback); - } else { - callback(dirName); - } - }); - } - }); - const elapsed = timestamp() - start; - sysLog(`sysLog:: Elapsed:: ${elapsed}ms:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size} ${timerToUpdateChildWatches}`); - } - function removeChildWatches(parentWatcher) { - if (!parentWatcher) return; - const existingChildWatches = parentWatcher.childWatches; - parentWatcher.childWatches = emptyArray; - for (const childWatcher of existingChildWatches) { - childWatcher.close(); - removeChildWatches(cache.get(toCanonicalFilePath(childWatcher.dirName))); - } - } - function closeTargetWatcher(watcher) { - if (watcher == null ? void 0 : watcher.targetWatcher) { - watcher.targetWatcher.close(); - watcher.targetWatcher = void 0; - } - } - function updateChildWatches(parentDir, parentDirPath, options) { - const parentWatcher = cache.get(parentDirPath); - if (!parentWatcher) return false; - const target = normalizePath(realpath(parentDir)); - let hasChanges; - let newChildWatches; - if (filePathComparer(target, parentDir) === 0 /* EqualTo */) { - hasChanges = enumerateInsertsAndDeletes( - fileSystemEntryExists(parentDir, 1 /* Directory */) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { - const childFullName = getNormalizedAbsolutePath(child, parentDir); - return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : void 0; - }) : emptyArray, - parentWatcher.childWatches, - (child, childWatcher) => filePathComparer(child, childWatcher.dirName), - createAndAddChildDirectoryWatcher, - closeFileWatcher, - addChildDirectoryWatcher - ); - } else if (parentWatcher.targetWatcher && filePathComparer(target, parentWatcher.targetWatcher.dirName) === 0 /* EqualTo */) { - hasChanges = false; - Debug.assert(parentWatcher.childWatches === emptyArray); - } else { - closeTargetWatcher(parentWatcher); - parentWatcher.targetWatcher = createDirectoryWatcher( - target, - options, - /*callback*/ - void 0, - parentDir - ); - parentWatcher.childWatches.forEach(closeFileWatcher); - hasChanges = true; - } - parentWatcher.childWatches = newChildWatches || emptyArray; - return hasChanges; - function createAndAddChildDirectoryWatcher(childName) { - const result = createDirectoryWatcher(childName, options); - addChildDirectoryWatcher(result); - } - function addChildDirectoryWatcher(childWatcher) { - (newChildWatches || (newChildWatches = [])).push(childWatcher); - } - } - function isIgnoredPath(path, options) { - return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory); - } - function isInPath(path, searchPath) { - if (path.includes(searchPath)) return true; - if (useCaseSensitiveFileNames2) return false; - return toCanonicalFilePath(path).includes(searchPath); - } -} -var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => { - FileSystemEntryKind2[FileSystemEntryKind2["File"] = 0] = "File"; - FileSystemEntryKind2[FileSystemEntryKind2["Directory"] = 1] = "Directory"; - return FileSystemEntryKind2; -})(FileSystemEntryKind || {}); -function createFileWatcherCallback(callback) { - return (_fileName, eventKind, modifiedTime) => callback(eventKind === 1 /* Changed */ ? "change" : "rename", "", modifiedTime); -} -function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime3) { - return (eventName, _relativeFileName, modifiedTime) => { - if (eventName === "rename") { - modifiedTime || (modifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime); - callback(fileName, modifiedTime !== missingFileModifiedTime ? 0 /* Created */ : 2 /* Deleted */, modifiedTime); - } else { - callback(fileName, 1 /* Changed */, modifiedTime); - } - }; -} -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, useCaseSensitiveFileNames2, getCurrentDirectory) { - return (eventName, relativeFileName) => { - if (eventName === "rename") { - const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName)); - if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) { - callback(fileName); - } - } - }; -} -function createSystemWatchFunctions({ - pollingWatchFileWorker, - getModifiedTime: getModifiedTime3, - setTimeout: setTimeout2, - clearTimeout: clearTimeout2, - fsWatchWorker, - fileSystemEntryExists, - useCaseSensitiveFileNames: useCaseSensitiveFileNames2, - getCurrentDirectory, - fsSupportsRecursiveFsWatch, - getAccessibleSortedChildDirectories, - realpath, - tscWatchFile, - useNonPollingWatchers, - tscWatchDirectory, - inodeWatching, - fsWatchWithTimestamp, - sysLog: sysLog2 -}) { - const pollingWatches = /* @__PURE__ */ new Map(); - const fsWatches = /* @__PURE__ */ new Map(); - const fsWatchesRecursive = /* @__PURE__ */ new Map(); - let dynamicPollingWatchFile; - let fixedChunkSizePollingWatchFile; - let nonPollingWatchFile; - let hostRecursiveDirectoryWatcher; - let hitSystemWatcherLimit = false; - return { - watchFile: watchFile2, - watchDirectory - }; - function watchFile2(fileName, callback, pollingInterval, options) { - options = updateOptionsForWatchFile(options, useNonPollingWatchers); - const watchFileKind = Debug.checkDefined(options.watchFile); - switch (watchFileKind) { - case 0 /* FixedPollingInterval */: - return pollingWatchFile( - fileName, - callback, - 250 /* Low */, - /*options*/ - void 0 - ); - case 1 /* PriorityPollingInterval */: - return pollingWatchFile( - fileName, - callback, - pollingInterval, - /*options*/ - void 0 - ); - case 2 /* DynamicPriorityPolling */: - return ensureDynamicPollingWatchFile()( - fileName, - callback, - pollingInterval, - /*options*/ - void 0 - ); - case 3 /* FixedChunkSizePolling */: - return ensureFixedChunkSizePollingWatchFile()( - fileName, - callback, - /* pollingInterval */ - void 0, - /*options*/ - void 0 - ); - case 4 /* UseFsEvents */: - return fsWatch( - fileName, - 0 /* File */, - createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime3), - /*recursive*/ - false, - pollingInterval, - getFallbackOptions(options) - ); - case 5 /* UseFsEventsOnParentDirectory */: - if (!nonPollingWatchFile) { - nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp); - } - return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options)); - default: - Debug.assertNever(watchFileKind); - } - } - function ensureDynamicPollingWatchFile() { - return dynamicPollingWatchFile || (dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime3, setTimeout: setTimeout2 })); - } - function ensureFixedChunkSizePollingWatchFile() { - return fixedChunkSizePollingWatchFile || (fixedChunkSizePollingWatchFile = createFixedChunkSizePollingWatchFile({ getModifiedTime: getModifiedTime3, setTimeout: setTimeout2 })); - } - function updateOptionsForWatchFile(options, useNonPollingWatchers2) { - if (options && options.watchFile !== void 0) return options; - switch (tscWatchFile) { - case "PriorityPollingInterval": - return { watchFile: 1 /* PriorityPollingInterval */ }; - case "DynamicPriorityPolling": - return { watchFile: 2 /* DynamicPriorityPolling */ }; - case "UseFsEvents": - return generateWatchFileOptions(4 /* UseFsEvents */, 1 /* PriorityInterval */, options); - case "UseFsEventsWithFallbackDynamicPolling": - return generateWatchFileOptions(4 /* UseFsEvents */, 2 /* DynamicPriority */, options); - case "UseFsEventsOnParentDirectory": - useNonPollingWatchers2 = true; - // fall through - default: - return useNonPollingWatchers2 ? ( - // Use notifications from FS to watch with falling back to fs.watchFile - generateWatchFileOptions(5 /* UseFsEventsOnParentDirectory */, 1 /* PriorityInterval */, options) - ) : ( - // Default to using fs events - { watchFile: 4 /* UseFsEvents */ } - ); - } - } - function generateWatchFileOptions(watchFile3, fallbackPolling, options) { - const defaultFallbackPolling = options == null ? void 0 : options.fallbackPolling; - return { - watchFile: watchFile3, - fallbackPolling: defaultFallbackPolling === void 0 ? fallbackPolling : defaultFallbackPolling - }; - } - function watchDirectory(directoryName, callback, recursive, options) { - if (fsSupportsRecursiveFsWatch) { - return fsWatch( - directoryName, - 1 /* Directory */, - createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory), - recursive, - 500 /* Medium */, - getFallbackOptions(options) - ); - } - if (!hostRecursiveDirectoryWatcher) { - hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({ - useCaseSensitiveFileNames: useCaseSensitiveFileNames2, - getCurrentDirectory, - fileSystemEntryExists, - getAccessibleSortedChildDirectories, - watchDirectory: nonRecursiveWatchDirectory, - realpath, - setTimeout: setTimeout2, - clearTimeout: clearTimeout2 - }); - } - return hostRecursiveDirectoryWatcher(directoryName, callback, recursive, options); - } - function nonRecursiveWatchDirectory(directoryName, callback, recursive, options) { - Debug.assert(!recursive); - const watchDirectoryOptions = updateOptionsForWatchDirectory(options); - const watchDirectoryKind = Debug.checkDefined(watchDirectoryOptions.watchDirectory); - switch (watchDirectoryKind) { - case 1 /* FixedPollingInterval */: - return pollingWatchFile( - directoryName, - () => callback(directoryName), - 500 /* Medium */, - /*options*/ - void 0 - ); - case 2 /* DynamicPriorityPolling */: - return ensureDynamicPollingWatchFile()( - directoryName, - () => callback(directoryName), - 500 /* Medium */, - /*options*/ - void 0 - ); - case 3 /* FixedChunkSizePolling */: - return ensureFixedChunkSizePollingWatchFile()( - directoryName, - () => callback(directoryName), - /* pollingInterval */ - void 0, - /*options*/ - void 0 - ); - case 0 /* UseFsEvents */: - return fsWatch( - directoryName, - 1 /* Directory */, - createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory), - recursive, - 500 /* Medium */, - getFallbackOptions(watchDirectoryOptions) - ); - default: - Debug.assertNever(watchDirectoryKind); - } - } - function updateOptionsForWatchDirectory(options) { - if (options && options.watchDirectory !== void 0) return options; - switch (tscWatchDirectory) { - case "RecursiveDirectoryUsingFsWatchFile": - return { watchDirectory: 1 /* FixedPollingInterval */ }; - case "RecursiveDirectoryUsingDynamicPriorityPolling": - return { watchDirectory: 2 /* DynamicPriorityPolling */ }; - default: - const defaultFallbackPolling = options == null ? void 0 : options.fallbackPolling; - return { - watchDirectory: 0 /* UseFsEvents */, - fallbackPolling: defaultFallbackPolling !== void 0 ? defaultFallbackPolling : void 0 - }; - } - } - function pollingWatchFile(fileName, callback, pollingInterval, options) { - return createSingleWatcherPerName( - pollingWatches, - useCaseSensitiveFileNames2, - fileName, - callback, - (cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options) - ); - } - function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { - return createSingleWatcherPerName( - recursive ? fsWatchesRecursive : fsWatches, - useCaseSensitiveFileNames2, - fileOrDirectory, - callback, - (cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions) - ); - } - function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { - let lastDirectoryPartWithDirectorySeparator; - let lastDirectoryPart; - if (inodeWatching) { - lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substring(fileOrDirectory.lastIndexOf(directorySeparator)); - lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(directorySeparator.length); - } - let watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ? watchMissingFileSystemEntry() : watchPresentFileSystemEntry(); - return { - close: () => { - if (watcher) { - watcher.close(); - watcher = void 0; - } - } - }; - function updateWatcher(createWatcher) { - if (watcher) { - sysLog2(`sysLog:: ${fileOrDirectory}:: Changing watcher to ${createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing"}FileSystemEntryWatcher`); - watcher.close(); - watcher = createWatcher(); - } - } - function watchPresentFileSystemEntry() { - if (hitSystemWatcherLimit) { - sysLog2(`sysLog:: ${fileOrDirectory}:: Defaulting to watchFile`); - return watchPresentFileSystemEntryWithFsWatchFile(); - } - try { - const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)( - fileOrDirectory, - recursive, - inodeWatching ? callbackChangingToMissingFileSystemEntry : callback - ); - presentWatcher.on("error", () => { - callback("rename", ""); - updateWatcher(watchMissingFileSystemEntry); - }); - return presentWatcher; - } catch (e) { - hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC"); - sysLog2(`sysLog:: ${fileOrDirectory}:: Changing to watchFile`); - return watchPresentFileSystemEntryWithFsWatchFile(); - } - } - function callbackChangingToMissingFileSystemEntry(event, relativeName) { - let originalRelativeName; - if (relativeName && endsWith(relativeName, "~")) { - originalRelativeName = relativeName; - relativeName = relativeName.slice(0, relativeName.length - 1); - } - if (event === "rename" && (!relativeName || relativeName === lastDirectoryPart || endsWith(relativeName, lastDirectoryPartWithDirectorySeparator))) { - const modifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime; - if (originalRelativeName) callback(event, originalRelativeName, modifiedTime); - callback(event, relativeName, modifiedTime); - if (inodeWatching) { - updateWatcher(modifiedTime === missingFileModifiedTime ? watchMissingFileSystemEntry : watchPresentFileSystemEntry); - } else if (modifiedTime === missingFileModifiedTime) { - updateWatcher(watchMissingFileSystemEntry); - } - } else { - if (originalRelativeName) callback(event, originalRelativeName); - callback(event, relativeName); - } - } - function watchPresentFileSystemEntryWithFsWatchFile() { - return watchFile2( - fileOrDirectory, - createFileWatcherCallback(callback), - fallbackPollingInterval, - fallbackOptions - ); - } - function watchMissingFileSystemEntry() { - return watchFile2( - fileOrDirectory, - (_fileName, eventKind, modifiedTime) => { - if (eventKind === 0 /* Created */) { - modifiedTime || (modifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime); - if (modifiedTime !== missingFileModifiedTime) { - callback("rename", "", modifiedTime); - updateWatcher(watchPresentFileSystemEntry); - } - } - }, - fallbackPollingInterval, - fallbackOptions - ); - } - } - 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; - sys2.writeFile = (path, data, writeBom) => writeFileEnsuringDirectories( - path, - data, - !!writeBom, - (path2, data2, writeByteOrderMark) => originalWriteFile.call(sys2, path2, data2, writeByteOrderMark), - (path2) => sys2.createDirectory(path2), - (path2) => sys2.directoryExists(path2) - ); -} -var sys = (() => { - const byteOrderMarkIndicator = "\uFEFF"; - function getNodeSystem() { - const nativePattern = /^native |^\([^)]+\)$|^(?:internal[\\/]|[\w\s]+(?:\.js)?$)/; - const _fs = __webpack_require__(/*! fs */ "?2e60"); - const _path = __webpack_require__(/*! path */ "?3711"); - const _os = __webpack_require__(/*! os */ "?c37c"); - let _crypto; - try { - _crypto = __webpack_require__(/*! crypto */ "?d829"); - } catch { - _crypto = void 0; - } - let activeSession; - let profilePath = "./profile.cpuprofile"; - const isMacOs = process.platform === "darwin"; - const isLinuxOrMacOs = process.platform === "linux" || isMacOs; - const statSyncOptions = { throwIfNoEntry: false }; - const platform = _os.platform(); - const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive(); - const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; - const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = process.platform === "win32" || isMacOs; - const getCurrentDirectory = memoize(() => process.cwd()); - const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ - pollingWatchFileWorker: fsWatchFileWorker, - getModifiedTime: getModifiedTime3, - setTimeout, - clearTimeout, - fsWatchWorker, - useCaseSensitiveFileNames: useCaseSensitiveFileNames2, - getCurrentDirectory, - fileSystemEntryExists, - // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows - // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) - fsSupportsRecursiveFsWatch, - getAccessibleSortedChildDirectories: (path) => getAccessibleFileSystemEntries(path).directories, - realpath, - tscWatchFile: process.env.TSC_WATCHFILE, - 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: useCaseSensitiveFileNames2, - write(s) { - process.stdout.write(s); - }, - getWidthOfTerminal() { - return process.stdout.columns; - }, - writeOutputIsTTY() { - return process.stdout.isTTY; - }, - readFile, - writeFile: writeFile2, - watchFile: watchFile2, - watchDirectory, - preferNonRecursiveWatch: !fsSupportsRecursiveFsWatch, - resolvePath: (path) => _path.resolve(path), - fileExists, - directoryExists, - getAccessibleFileSystemEntries, - createDirectory(directoryName) { - if (!nodeSystem.directoryExists(directoryName)) { - try { - _fs.mkdirSync(directoryName); - } catch (e) { - if (e.code !== "EEXIST") { - throw e; - } - } - } - }, - getExecutingFilePath() { - return executingFilePath; - }, - getCurrentDirectory, - getDirectories, - getEnvironmentVariable(name) { - return process.env[name] || ""; - }, - readDirectory, - getModifiedTime: getModifiedTime3, - setModifiedTime, - deleteFile, - createHash: _crypto ? createSHA256Hash : generateDjb2Hash, - createSHA256Hash: _crypto ? createSHA256Hash : void 0, - getMemoryUsage() { - if (__webpack_require__.g.gc) { - __webpack_require__.g.gc(); - } - return process.memoryUsage().heapUsed; - }, - getFileSize(path) { - const stat = statSync(path); - if (stat == null ? void 0 : stat.isFile()) { - return stat.size; - } - return 0; - }, - exit(exitCode) { - disableCPUProfiler(() => process.exit(exitCode)); - }, - enableCPUProfiler, - 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)) || !!process.recordreplay, - tryEnableSourceMapsForHost() { - try { - (__webpack_require__(/*! source-map-support */ "?5d40").install)(); - } catch { - } - }, - setTimeout, - clearTimeout, - clearScreen: () => { - process.stdout.write("\x1B[2J\x1B[3J\x1B[H"); - }, - setBlocking: () => { - var _a; - const handle = (_a = process.stdout) == null ? void 0 : _a._handle; - if (handle && handle.setBlocking) { - handle.setBlocking(true); - } - }, - base64decode: (input) => Buffer.from(input, "base64").toString("utf8"), - base64encode: (input) => Buffer.from(input).toString("base64"), - require: (baseDir, moduleName) => { - try { - const modulePath = resolveJSModule(moduleName, baseDir, nodeSystem); - return { module: __webpack_require__("./node_modules/typescript/lib sync recursive")(modulePath), modulePath, error: void 0 }; - } catch (error2) { - return { module: void 0, modulePath: void 0, error: error2 }; - } - } - }; - return nodeSystem; - function statSync(path) { - try { - return _fs.statSync(path, statSyncOptions); - } catch { - return void 0; - } - } - function enableCPUProfiler(path, cb) { - if (activeSession) { - cb(); - return false; - } - const inspector = __webpack_require__(/*! inspector */ "?e316"); - if (!inspector || !inspector.Session) { - cb(); - return false; - } - const session = new inspector.Session(); - session.connect(); - session.post("Profiler.enable", () => { - session.post("Profiler.start", () => { - activeSession = session; - profilePath = path; - cb(); - }); - }); - return true; - } - function cleanupPaths(profile) { - let externalFileCounter = 0; - const remappedPaths = /* @__PURE__ */ new Map(); - const normalizedDir = normalizeSlashes(_path.dirname(executingFilePath)); - const fileUrlRoot = `file://${getRootLength(normalizedDir) === 1 ? "" : "/"}${normalizedDir}`; - for (const node of profile.nodes) { - if (node.callFrame.url) { - const url = normalizeSlashes(node.callFrame.url); - if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) { - node.callFrame.url = getRelativePathToDirectoryOrUrl( - fileUrlRoot, - url, - fileUrlRoot, - createGetCanonicalFileName(useCaseSensitiveFileNames2), - /*isAbsolutePathAnUrl*/ - true - ); - } else if (!nativePattern.test(url)) { - node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, `external${externalFileCounter}.js`)).get(url); - externalFileCounter++; - } - } - } - return profile; - } - function disableCPUProfiler(cb) { - if (activeSession && activeSession !== "stopping") { - const s = activeSession; - activeSession.post("Profiler.stop", (err, { profile }) => { - var _a; - if (!err) { - if ((_a = statSync(profilePath)) == null ? void 0 : _a.isDirectory()) { - profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); - } - try { - _fs.mkdirSync(_path.dirname(profilePath), { recursive: true }); - } catch { - } - _fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile))); - } - activeSession = void 0; - s.disconnect(); - cb(); - }); - activeSession = "stopping"; - return true; - } else { - cb(); - return false; - } - } - function isFileSystemCaseSensitive() { - if (platform === "win32" || platform === "win64") { - return false; - } - return !fileExists(swapCase(__filename)); - } - function swapCase(s) { - return s.replace(/\w/g, (ch) => { - const up = ch.toUpperCase(); - return ch === up ? ch.toLowerCase() : up; - }); - } - function fsWatchFileWorker(fileName, callback, pollingInterval) { - _fs.watchFile(fileName, { persistent: true, interval: pollingInterval }, fileChanged); - let eventKind; - return { - close: () => _fs.unwatchFile(fileName, fileChanged) - }; - function fileChanged(curr, prev) { - const isPreviouslyDeleted = +prev.mtime === 0 || eventKind === 2 /* Deleted */; - if (+curr.mtime === 0) { - if (isPreviouslyDeleted) { - return; - } - eventKind = 2 /* Deleted */; - } else if (isPreviouslyDeleted) { - eventKind = 0 /* Created */; - } else if (+curr.mtime === +prev.mtime) { - return; - } else { - eventKind = 1 /* Changed */; - } - callback(fileName, eventKind, curr.mtime); - } - } - function fsWatchWorker(fileOrDirectory, recursive, callback) { - return _fs.watch( - fileOrDirectory, - fsSupportsRecursiveFsWatch ? { persistent: true, recursive: !!recursive } : { persistent: true }, - callback - ); - } - function readFile(fileName, _encoding) { - let buffer; - try { - buffer = _fs.readFileSync(fileName); - } catch { - return void 0; - } - let len = buffer.length; - if (len >= 2 && buffer[0] === 254 && buffer[1] === 255) { - len &= ~1; - for (let i = 0; i < len; i += 2) { - const temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - } - return buffer.toString("utf16le", 2); - } - if (len >= 2 && buffer[0] === 255 && buffer[1] === 254) { - return buffer.toString("utf16le", 2); - } - if (len >= 3 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { - return buffer.toString("utf8", 3); - } - return buffer.toString("utf8"); - } - function writeFile2(fileName, data, writeByteOrderMark) { - if (writeByteOrderMark) { - data = byteOrderMarkIndicator + data; - } - let fd; - try { - fd = _fs.openSync(fileName, "w"); - _fs.writeSync( - fd, - data, - /*position*/ - void 0, - "utf8" - ); - } finally { - if (fd !== void 0) { - _fs.closeSync(fd); - } - } - } - function getAccessibleFileSystemEntries(path) { - try { - const entries = _fs.readdirSync(path || ".", { withFileTypes: true }); - const files = []; - const directories = []; - for (const dirent of entries) { - const entry = typeof dirent === "string" ? dirent : dirent.name; - if (entry === "." || entry === "..") { - continue; - } - let stat; - if (typeof dirent === "string" || dirent.isSymbolicLink()) { - const name = combinePaths(path, entry); - stat = statSync(name); - if (!stat) { - continue; - } - } else { - stat = dirent; - } - if (stat.isFile()) { - files.push(entry); - } else if (stat.isDirectory()) { - directories.push(entry); - } - } - files.sort(); - directories.sort(); - return { files, directories }; - } catch { - return emptyFileSystemEntries; - } - } - function readDirectory(path, extensions, excludes, includes, depth) { - return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); - } - function fileSystemEntryExists(path, entryKind) { - const stat = statSync(path); - if (!stat) { - return false; - } - switch (entryKind) { - case 0 /* File */: - return stat.isFile(); - case 1 /* Directory */: - return stat.isDirectory(); - default: - return false; - } - } - function fileExists(path) { - return fileSystemEntryExists(path, 0 /* File */); - } - function directoryExists(path) { - return fileSystemEntryExists(path, 1 /* Directory */); - } - function getDirectories(path) { - return getAccessibleFileSystemEntries(path).directories.slice(); - } - function fsRealPathHandlingLongPath(path) { - return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path); - } - function realpath(path) { - try { - return fsRealpath(path); - } catch { - return path; - } - } - function getModifiedTime3(path) { - var _a; - return (_a = statSync(path)) == null ? void 0 : _a.mtime; - } - function setModifiedTime(path, time) { - try { - _fs.utimesSync(path, time, time); - } catch { - return; - } - } - function deleteFile(path) { - try { - return _fs.unlinkSync(path); - } catch { - return; - } - } - function createSHA256Hash(data) { - const hash = _crypto.createHash("sha256"); - hash.update(data); - return hash.digest("hex"); - } - } - let sys2; - if (isNodeLikeSystem()) { - sys2 = getNodeSystem(); - } - if (sys2) { - patchWriteFileEnsuringDirectory(sys2); - } - return sys2; -})(); -function setSys(s) { - sys = s; -} -if (sys && sys.getEnvironmentVariable) { - setCustomPollingValues(sys); - Debug.setAssertionLevel( - /^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */ - ); -} -if (sys && sys.debugMode) { - Debug.isDebugging = true; -} - -// src/compiler/path.ts -var directorySeparator = "/"; -var altDirectorySeparator = "\\"; -var urlSchemeSeparator = "://"; -var backslashRegExp = /\\/g; -function isAnyDirectorySeparator(charCode) { - return charCode === 47 /* slash */ || charCode === 92 /* backslash */; -} -function isUrl(path) { - return getEncodedRootLength(path) < 0; -} -function isRootedDiskPath(path) { - return getEncodedRootLength(path) > 0; -} -function isDiskPathRoot(path) { - const rootLength = getEncodedRootLength(path); - return rootLength > 0 && rootLength === path.length; -} -function pathIsAbsolute(path) { - return getEncodedRootLength(path) !== 0; -} -function pathIsRelative(path) { - return /^\.\.?(?:$|[\\/])/.test(path); -} -function pathIsBareSpecifier(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path); -} -function hasExtension(fileName) { - return getBaseFileName(fileName).includes("."); -} -function fileExtensionIs(path, extension) { - return path.length > extension.length && endsWith(path, extension); -} -function fileExtensionIsOneOf(path, extensions) { - for (const extension of extensions) { - if (fileExtensionIs(path, extension)) { - return true; - } - } - return false; -} -function hasTrailingDirectorySeparator(path) { - return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); -} -function isVolumeCharacter(charCode) { - return charCode >= 97 /* a */ && charCode <= 122 /* z */ || charCode >= 65 /* A */ && charCode <= 90 /* Z */; -} -function getFileUrlVolumeSeparatorEnd(url, start) { - const ch0 = url.charCodeAt(start); - if (ch0 === 58 /* colon */) return start + 1; - if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { - const ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 /* a */ || ch2 === 65 /* A */) return start + 3; - } - return -1; -} -function getEncodedRootLength(path) { - if (!path) return 0; - const ch0 = path.charCodeAt(0); - if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { - if (path.charCodeAt(1) !== ch0) return 1; - const p1 = path.indexOf(ch0 === 47 /* slash */ ? directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) return path.length; - return p1 + 1; - } - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { - const ch2 = path.charCodeAt(2); - if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) return 3; - if (path.length === 2) return 2; - } - const schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - const authorityStart = schemeEnd + urlSchemeSeparator.length; - const authorityEnd = path.indexOf(directorySeparator, authorityStart); - if (authorityEnd !== -1) { - const scheme = path.slice(0, schemeEnd); - const authority = path.slice(authorityStart, authorityEnd); - if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); - } - return ~path.length; - } - return 0; -} -function getRootLength(path) { - const rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; -} -function getDirectoryPath(path) { - path = normalizeSlashes(path); - const rootLength = getRootLength(path); - if (rootLength === path.length) return path; - path = removeTrailingDirectorySeparator(path); - return path.slice(0, Math.max(rootLength, path.lastIndexOf(directorySeparator))); -} -function getBaseFileName(path, extensions, ignoreCase) { - path = normalizeSlashes(path); - const rootLength = getRootLength(path); - if (rootLength === path.length) return ""; - path = removeTrailingDirectorySeparator(path); - const name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(directorySeparator) + 1)); - const extension = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name, extensions, ignoreCase) : void 0; - return extension ? name.slice(0, name.length - extension.length) : name; -} -function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { - if (!startsWith(extension, ".")) extension = "." + extension; - if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { - const pathExtension = path.slice(path.length - extension.length); - if (stringEqualityComparer(pathExtension, extension)) { - return pathExtension; - } - } -} -function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { - if (typeof extensions === "string") { - return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; - } - for (const extension of extensions) { - const result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); - if (result) return result; - } - return ""; -} -function getAnyExtensionFromPath(path, extensions, ignoreCase) { - if (extensions) { - return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive); - } - const baseFileName = getBaseFileName(path); - const extensionIndex = baseFileName.lastIndexOf("."); - if (extensionIndex >= 0) { - return baseFileName.substring(extensionIndex); - } - return ""; -} -function pathComponents(path, rootLength) { - const root = path.substring(0, rootLength); - const rest = path.substring(rootLength).split(directorySeparator); - if (rest.length && !lastOrUndefined(rest)) rest.pop(); - return [root, ...rest]; -} -function getPathComponents(path, currentDirectory = "") { - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); -} -function getPathFromPathComponents(pathComponents2, length2) { - if (pathComponents2.length === 0) return ""; - const root = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]); - return root + pathComponents2.slice(1, length2).join(directorySeparator); -} -function normalizeSlashes(path) { - return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path; -} -function reducePathComponents(components) { - if (!some(components)) return []; - const reduced = [components[0]]; - for (let i = 1; i < components.length; i++) { - const component = components[i]; - if (!component) continue; - if (component === ".") continue; - if (component === "..") { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== "..") { - reduced.pop(); - continue; - } - } else if (reduced[0]) continue; - } - reduced.push(component); - } - return reduced; -} -function combinePaths(path, ...paths) { - if (path) path = normalizeSlashes(path); - for (let relativePath of paths) { - if (!relativePath) continue; - relativePath = normalizeSlashes(relativePath); - if (!path || getRootLength(relativePath) !== 0) { - path = relativePath; - } else { - path = ensureTrailingDirectorySeparator(path) + relativePath; - } - } - return path; -} -function resolvePath(path, ...paths) { - return normalizePath(some(paths) ? combinePaths(path, ...paths) : normalizeSlashes(path)); -} -function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); -} -function getNormalizedAbsolutePath(path, currentDirectory) { - let rootLength = getRootLength(path); - if (rootLength === 0 && currentDirectory) { - path = combinePaths(currentDirectory, path); - rootLength = getRootLength(path); - } else { - path = normalizeSlashes(path); - } - const simpleNormalized = simpleNormalizePath(path); - if (simpleNormalized !== void 0) { - return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized; - } - const length2 = path.length; - const root = path.substring(0, rootLength); - let normalized; - let index = rootLength; - let segmentStart = index; - let normalizedUpTo = index; - let seenNonDotDotSegment = rootLength !== 0; - while (index < length2) { - segmentStart = index; - let ch = path.charCodeAt(index); - while (ch === 47 /* slash */ && index + 1 < length2) { - index++; - ch = path.charCodeAt(index); - } - if (index > segmentStart) { - normalized ?? (normalized = path.substring(0, segmentStart - 1)); - segmentStart = index; - } - let segmentEnd = path.indexOf(directorySeparator, index + 1); - if (segmentEnd === -1) { - segmentEnd = length2; - } - const segmentLength = segmentEnd - segmentStart; - if (segmentLength === 1 && path.charCodeAt(index) === 46 /* dot */) { - normalized ?? (normalized = path.substring(0, normalizedUpTo)); - } else if (segmentLength === 2 && path.charCodeAt(index) === 46 /* dot */ && path.charCodeAt(index + 1) === 46 /* dot */) { - if (!seenNonDotDotSegment) { - if (normalized !== void 0) { - normalized += normalized.length === rootLength ? ".." : "/.."; - } else { - normalizedUpTo = index + 2; - } - } else if (normalized === void 0) { - if (normalizedUpTo - 2 >= 0) { - normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2))); - } else { - normalized = path.substring(0, normalizedUpTo); - } - } else { - const lastSlash = normalized.lastIndexOf(directorySeparator); - if (lastSlash !== -1) { - normalized = normalized.substring(0, Math.max(rootLength, lastSlash)); - } else { - normalized = root; - } - if (normalized.length === rootLength) { - seenNonDotDotSegment = rootLength !== 0; - } - } - } else if (normalized !== void 0) { - if (normalized.length !== rootLength) { - normalized += directorySeparator; - } - seenNonDotDotSegment = true; - normalized += path.substring(segmentStart, segmentEnd); - } else { - seenNonDotDotSegment = true; - normalizedUpTo = segmentEnd; - } - index = segmentEnd + 1; - } - return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(path) : path); -} -function normalizePath(path) { - path = normalizeSlashes(path); - let normalized = simpleNormalizePath(path); - if (normalized !== void 0) { - return normalized; - } - normalized = getNormalizedAbsolutePath(path, ""); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; -} -function simpleNormalizePath(path) { - if (!relativePathSegmentRegExp.test(path)) { - return path; - } - let simplified = path.replace(/\/\.\//g, "/"); - if (simplified.startsWith("./")) { - simplified = simplified.slice(2); - } - if (simplified !== path) { - path = simplified; - if (!relativePathSegmentRegExp.test(path)) { - return path; - } - } - return void 0; -} -function getPathWithoutRoot(pathComponents2) { - if (pathComponents2.length === 0) return ""; - return pathComponents2.slice(1).join(directorySeparator); -} -function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { - return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); -} -function toPath(fileName, basePath, getCanonicalFileName) { - const nonCanonicalizedPath = isRootedDiskPath(fileName) ? normalizePath(fileName) : getNormalizedAbsolutePath(fileName, basePath); - return getCanonicalFileName(nonCanonicalizedPath); -} -function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; -} -function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + directorySeparator; - } - return path; -} -function ensurePathIsNonModuleName(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; -} -function changeAnyExtension(path, ext, extensions, ignoreCase) { - 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); -} -var relativePathSegmentRegExp = /\/\/|(?:^|\/)\.\.?(?:$|\/)/; -function comparePathsWorker(a, b, componentComparer) { - if (a === b) return 0 /* EqualTo */; - if (a === void 0) return -1 /* LessThan */; - if (b === void 0) return 1 /* GreaterThan */; - const aRoot = a.substring(0, getRootLength(a)); - const bRoot = b.substring(0, getRootLength(b)); - const result = compareStringsCaseInsensitive(aRoot, bRoot); - if (result !== 0 /* EqualTo */) { - return result; - } - const aRest = a.substring(aRoot.length); - const bRest = b.substring(bRoot.length); - if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { - return componentComparer(aRest, bRest); - } - const aComponents = reducePathComponents(getPathComponents(a)); - const bComponents = reducePathComponents(getPathComponents(b)); - const sharedLength = Math.min(aComponents.length, bComponents.length); - for (let i = 1; i < sharedLength; i++) { - const result2 = componentComparer(aComponents[i], bComponents[i]); - if (result2 !== 0 /* EqualTo */) { - return result2; - } - } - return compareValues(aComponents.length, bComponents.length); -} -function comparePathsCaseSensitive(a, b) { - return comparePathsWorker(a, b, compareStringsCaseSensitive); -} -function comparePathsCaseInsensitive(a, b) { - return comparePathsWorker(a, b, compareStringsCaseInsensitive); -} -function comparePaths(a, b, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - a = combinePaths(currentDirectory, a); - b = combinePaths(currentDirectory, b); - } else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - return comparePathsWorker(a, b, getStringComparer(ignoreCase)); -} -function containsPath(parent2, child, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - parent2 = combinePaths(currentDirectory, parent2); - child = combinePaths(currentDirectory, child); - } else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - if (parent2 === void 0 || child === void 0) return false; - if (parent2 === child) return true; - const parentComponents = reducePathComponents(getPathComponents(parent2)); - const childComponents = reducePathComponents(getPathComponents(child)); - if (childComponents.length < parentComponents.length) { - return false; - } - const componentEqualityComparer = ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive; - for (let i = 0; i < parentComponents.length; i++) { - const equalityComparer = i === 0 ? equateStringsCaseInsensitive : componentEqualityComparer; - if (!equalityComparer(parentComponents[i], childComponents[i])) { - return false; - } - } - return true; -} -function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { - const canonicalFileName = getCanonicalFileName(fileName); - const canonicalDirectoryName = getCanonicalFileName(directoryName); - return startsWith(canonicalFileName, canonicalDirectoryName + "/") || startsWith(canonicalFileName, canonicalDirectoryName + "\\"); -} -function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { - const fromComponents = reducePathComponents(getPathComponents(from)); - const toComponents = reducePathComponents(getPathComponents(to)); - let start; - for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - const fromComponent = getCanonicalFileName(fromComponents[start]); - const toComponent = getCanonicalFileName(toComponents[start]); - const comparer = start === 0 ? equateStringsCaseInsensitive : stringEqualityComparer; - if (!comparer(fromComponent, toComponent)) break; - } - if (start === 0) { - return toComponents; - } - const components = toComponents.slice(start); - const relative = []; - for (; start < fromComponents.length; start++) { - relative.push(".."); - } - return ["", ...relative, ...components]; -} -function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative"); - const getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : identity; - const ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; - const pathComponents2 = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive, getCanonicalFileName); - return getPathFromPathComponents(pathComponents2); -} -function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { - return !isRootedDiskPath(absoluteOrRelativePath) ? absoluteOrRelativePath : getRelativePathToDirectoryOrUrl( - basePath, - absoluteOrRelativePath, - basePath, - getCanonicalFileName, - /*isAbsolutePathAnUrl*/ - false - ); -} -function getRelativePathFromFile(from, to, getCanonicalFileName) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); -} -function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - const pathComponents2 = getPathComponentsRelativeTo( - resolvePath(currentDirectory, directoryPathOrUrl), - resolvePath(currentDirectory, relativeOrAbsolutePath), - equateStringsCaseSensitive, - getCanonicalFileName - ); - const firstComponent = pathComponents2[0]; - if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { - const prefix = firstComponent.charAt(0) === directorySeparator ? "file://" : "file:///"; - pathComponents2[0] = prefix + firstComponent; - } - return getPathFromPathComponents(pathComponents2); -} -function forEachAncestorDirectory(directory, callback) { - while (true) { - const result = callback(directory); - if (result !== void 0) { - return result; - } - const parentPath = getDirectoryPath(directory); - if (parentPath === directory) { - return void 0; - } - directory = parentPath; - } -} -function isNodeModulesDirectory(dirPath) { - return endsWith(dirPath, "/node_modules"); -} - -// src/compiler/diagnosticInformationMap.generated.ts -function diag(code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated) { - return { code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated }; -} -var Diagnostics = { - Unterminated_string_literal: diag(1002, 1 /* Error */, "Unterminated_string_literal_1002", "Unterminated string literal."), - Identifier_expected: diag(1003, 1 /* Error */, "Identifier_expected_1003", "Identifier expected."), - _0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."), - A_file_cannot_have_a_reference_to_itself: diag(1006, 1 /* Error */, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."), - The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, 1 /* Error */, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."), - Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."), - Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."), - An_element_access_expression_should_take_an_argument: diag(1011, 1 /* Error */, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."), - Unexpected_token: diag(1012, 1 /* Error */, "Unexpected_token_1012", "Unexpected token."), - A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma: diag(1013, 1 /* Error */, "A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013", "A rest parameter or binding pattern may not have a trailing comma."), - A_rest_parameter_must_be_last_in_a_parameter_list: diag(1014, 1 /* Error */, "A_rest_parameter_must_be_last_in_a_parameter_list_1014", "A rest parameter must be last in a parameter list."), - Parameter_cannot_have_question_mark_and_initializer: diag(1015, 1 /* Error */, "Parameter_cannot_have_question_mark_and_initializer_1015", "Parameter cannot have question mark and initializer."), - A_required_parameter_cannot_follow_an_optional_parameter: diag(1016, 1 /* Error */, "A_required_parameter_cannot_follow_an_optional_parameter_1016", "A required parameter cannot follow an optional parameter."), - An_index_signature_cannot_have_a_rest_parameter: diag(1017, 1 /* Error */, "An_index_signature_cannot_have_a_rest_parameter_1017", "An index signature cannot have a rest parameter."), - An_index_signature_parameter_cannot_have_an_accessibility_modifier: diag(1018, 1 /* Error */, "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018", "An index signature parameter cannot have an accessibility modifier."), - An_index_signature_parameter_cannot_have_a_question_mark: diag(1019, 1 /* Error */, "An_index_signature_parameter_cannot_have_a_question_mark_1019", "An index signature parameter cannot have a question mark."), - An_index_signature_parameter_cannot_have_an_initializer: diag(1020, 1 /* Error */, "An_index_signature_parameter_cannot_have_an_initializer_1020", "An index signature parameter cannot have an initializer."), - An_index_signature_must_have_a_type_annotation: diag(1021, 1 /* Error */, "An_index_signature_must_have_a_type_annotation_1021", "An index signature must have a type annotation."), - An_index_signature_parameter_must_have_a_type_annotation: diag(1022, 1 /* Error */, "An_index_signature_parameter_must_have_a_type_annotation_1022", "An index signature parameter must have a type annotation."), - readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: diag(1024, 1 /* Error */, "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024", "'readonly' modifier can only appear on a property declaration or index signature."), - An_index_signature_cannot_have_a_trailing_comma: diag(1025, 1 /* Error */, "An_index_signature_cannot_have_a_trailing_comma_1025", "An index signature cannot have a trailing comma."), - Accessibility_modifier_already_seen: diag(1028, 1 /* Error */, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), - _0_modifier_must_precede_1_modifier: diag(1029, 1 /* Error */, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), - _0_modifier_already_seen: diag(1030, 1 /* Error */, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), - _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, 1 /* Error */, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), - super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, 1 /* Error */, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), - Only_ambient_modules_can_use_quoted_names: diag(1035, 1 /* Error */, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), - Statements_are_not_allowed_in_ambient_contexts: diag(1036, 1 /* Error */, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: diag(1038, 1 /* Error */, "A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038", "A 'declare' modifier cannot be used in an already ambient context."), - Initializers_are_not_allowed_in_ambient_contexts: diag(1039, 1 /* Error */, "Initializers_are_not_allowed_in_ambient_contexts_1039", "Initializers are not allowed in ambient contexts."), - _0_modifier_cannot_be_used_in_an_ambient_context: diag(1040, 1 /* Error */, "_0_modifier_cannot_be_used_in_an_ambient_context_1040", "'{0}' modifier cannot be used in an ambient context."), - _0_modifier_cannot_be_used_here: diag(1042, 1 /* Error */, "_0_modifier_cannot_be_used_here_1042", "'{0}' modifier cannot be used here."), - _0_modifier_cannot_appear_on_a_module_or_namespace_element: diag(1044, 1 /* Error */, "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044", "'{0}' modifier cannot appear on a module or namespace element."), - Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: diag(1046, 1 /* Error */, "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046", "Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."), - A_rest_parameter_cannot_be_optional: diag(1047, 1 /* Error */, "A_rest_parameter_cannot_be_optional_1047", "A rest parameter cannot be optional."), - A_rest_parameter_cannot_have_an_initializer: diag(1048, 1 /* Error */, "A_rest_parameter_cannot_have_an_initializer_1048", "A rest parameter cannot have an initializer."), - A_set_accessor_must_have_exactly_one_parameter: diag(1049, 1 /* Error */, "A_set_accessor_must_have_exactly_one_parameter_1049", "A 'set' accessor must have exactly one parameter."), - A_set_accessor_cannot_have_an_optional_parameter: diag(1051, 1 /* Error */, "A_set_accessor_cannot_have_an_optional_parameter_1051", "A 'set' accessor cannot have an optional parameter."), - A_set_accessor_parameter_cannot_have_an_initializer: diag(1052, 1 /* Error */, "A_set_accessor_parameter_cannot_have_an_initializer_1052", "A 'set' accessor parameter cannot have an initializer."), - A_set_accessor_cannot_have_rest_parameter: diag(1053, 1 /* Error */, "A_set_accessor_cannot_have_rest_parameter_1053", "A 'set' accessor cannot have rest parameter."), - A_get_accessor_cannot_have_parameters: diag(1054, 1 /* Error */, "A_get_accessor_cannot_have_parameters_1054", "A 'get' accessor cannot have parameters."), - Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: diag(1055, 1 /* Error */, "Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compa_1055", "Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value."), - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: diag(1056, 1 /* Error */, "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", "Accessors are only available when targeting ECMAScript 5 and higher."), - The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1058, 1 /* Error */, "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", "The return type of an async function must either be a valid promise or must not contain a callable 'then' member."), - A_promise_must_have_a_then_method: diag(1059, 1 /* Error */, "A_promise_must_have_a_then_method_1059", "A promise must have a 'then' method."), - The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: diag(1060, 1 /* Error */, "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", "The first parameter of the 'then' method of a promise must be a callback."), - Enum_member_must_have_initializer: diag(1061, 1 /* Error */, "Enum_member_must_have_initializer_1061", "Enum member must have initializer."), - 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."), - _0_modifier_cannot_appear_on_a_type_member: diag(1070, 1 /* Error */, "_0_modifier_cannot_appear_on_a_type_member_1070", "'{0}' modifier cannot appear on a type member."), - _0_modifier_cannot_appear_on_an_index_signature: diag(1071, 1 /* Error */, "_0_modifier_cannot_appear_on_an_index_signature_1071", "'{0}' modifier cannot appear on an index signature."), - A_0_modifier_cannot_be_used_with_an_import_declaration: diag(1079, 1 /* Error */, "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", "A '{0}' modifier cannot be used with an import declaration."), - Invalid_reference_directive_syntax: diag(1084, 1 /* Error */, "Invalid_reference_directive_syntax_1084", "Invalid 'reference' directive syntax."), - _0_modifier_cannot_appear_on_a_constructor_declaration: diag(1089, 1 /* Error */, "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", "'{0}' modifier cannot appear on a constructor declaration."), - _0_modifier_cannot_appear_on_a_parameter: diag(1090, 1 /* Error */, "_0_modifier_cannot_appear_on_a_parameter_1090", "'{0}' modifier cannot appear on a parameter."), - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: diag(1091, 1 /* Error */, "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091", "Only a single variable declaration is allowed in a 'for...in' statement."), - Type_parameters_cannot_appear_on_a_constructor_declaration: diag(1092, 1 /* Error */, "Type_parameters_cannot_appear_on_a_constructor_declaration_1092", "Type parameters cannot appear on a constructor declaration."), - Type_annotation_cannot_appear_on_a_constructor_declaration: diag(1093, 1 /* Error */, "Type_annotation_cannot_appear_on_a_constructor_declaration_1093", "Type annotation cannot appear on a constructor declaration."), - An_accessor_cannot_have_type_parameters: diag(1094, 1 /* Error */, "An_accessor_cannot_have_type_parameters_1094", "An accessor cannot have type parameters."), - A_set_accessor_cannot_have_a_return_type_annotation: diag(1095, 1 /* Error */, "A_set_accessor_cannot_have_a_return_type_annotation_1095", "A 'set' accessor cannot have a return type annotation."), - An_index_signature_must_have_exactly_one_parameter: diag(1096, 1 /* Error */, "An_index_signature_must_have_exactly_one_parameter_1096", "An index signature must have exactly one parameter."), - _0_list_cannot_be_empty: diag(1097, 1 /* Error */, "_0_list_cannot_be_empty_1097", "'{0}' list cannot be empty."), - Type_parameter_list_cannot_be_empty: diag(1098, 1 /* Error */, "Type_parameter_list_cannot_be_empty_1098", "Type parameter list cannot be empty."), - Type_argument_list_cannot_be_empty: diag(1099, 1 /* Error */, "Type_argument_list_cannot_be_empty_1099", "Type argument list cannot be empty."), - Invalid_use_of_0_in_strict_mode: diag(1100, 1 /* Error */, "Invalid_use_of_0_in_strict_mode_1100", "Invalid use of '{0}' in strict mode."), - with_statements_are_not_allowed_in_strict_mode: diag(1101, 1 /* Error */, "with_statements_are_not_allowed_in_strict_mode_1101", "'with' statements are not allowed in strict mode."), - delete_cannot_be_called_on_an_identifier_in_strict_mode: diag(1102, 1 /* Error */, "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", "'delete' cannot be called on an identifier in strict mode."), - for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1103, 1 /* Error */, "for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103", "'for await' loops are only allowed within async functions and at the top levels of modules."), - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: diag(1104, 1 /* Error */, "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", "A 'continue' statement can only be used within an enclosing iteration statement."), - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: diag(1105, 1 /* Error */, "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", "A 'break' statement can only be used within an enclosing iteration or switch statement."), - The_left_hand_side_of_a_for_of_statement_may_not_be_async: diag(1106, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106", "The left-hand side of a 'for...of' statement may not be 'async'."), - Jump_target_cannot_cross_function_boundary: diag(1107, 1 /* Error */, "Jump_target_cannot_cross_function_boundary_1107", "Jump target cannot cross function boundary."), - 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."), - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, 1 /* Error */, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."), - An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, 1 /* Error */, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."), - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, 1 /* Error */, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."), - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, 1 /* Error */, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."), - An_export_assignment_cannot_have_modifiers: diag(1120, 1 /* Error */, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."), - Octal_literals_are_not_allowed_Use_the_syntax_0: diag(1121, 1 /* Error */, "Octal_literals_are_not_allowed_Use_the_syntax_0_1121", "Octal literals are not allowed. Use the syntax '{0}'."), - Variable_declaration_list_cannot_be_empty: diag(1123, 1 /* Error */, "Variable_declaration_list_cannot_be_empty_1123", "Variable declaration list cannot be empty."), - Digit_expected: diag(1124, 1 /* Error */, "Digit_expected_1124", "Digit expected."), - Hexadecimal_digit_expected: diag(1125, 1 /* Error */, "Hexadecimal_digit_expected_1125", "Hexadecimal digit expected."), - Unexpected_end_of_text: diag(1126, 1 /* Error */, "Unexpected_end_of_text_1126", "Unexpected end of text."), - Invalid_character: diag(1127, 1 /* Error */, "Invalid_character_1127", "Invalid character."), - Declaration_or_statement_expected: diag(1128, 1 /* Error */, "Declaration_or_statement_expected_1128", "Declaration or statement expected."), - Statement_expected: diag(1129, 1 /* Error */, "Statement_expected_1129", "Statement expected."), - case_or_default_expected: diag(1130, 1 /* Error */, "case_or_default_expected_1130", "'case' or 'default' expected."), - Property_or_signature_expected: diag(1131, 1 /* Error */, "Property_or_signature_expected_1131", "Property or signature expected."), - Enum_member_expected: diag(1132, 1 /* Error */, "Enum_member_expected_1132", "Enum member expected."), - Variable_declaration_expected: diag(1134, 1 /* Error */, "Variable_declaration_expected_1134", "Variable declaration expected."), - Argument_expression_expected: diag(1135, 1 /* Error */, "Argument_expression_expected_1135", "Argument expression expected."), - Property_assignment_expected: diag(1136, 1 /* Error */, "Property_assignment_expected_1136", "Property assignment expected."), - Expression_or_comma_expected: diag(1137, 1 /* Error */, "Expression_or_comma_expected_1137", "Expression or comma expected."), - Parameter_declaration_expected: diag(1138, 1 /* Error */, "Parameter_declaration_expected_1138", "Parameter declaration expected."), - Type_parameter_declaration_expected: diag(1139, 1 /* Error */, "Type_parameter_declaration_expected_1139", "Type parameter declaration expected."), - Type_argument_expected: diag(1140, 1 /* Error */, "Type_argument_expected_1140", "Type argument expected."), - String_literal_expected: diag(1141, 1 /* Error */, "String_literal_expected_1141", "String literal expected."), - Line_break_not_permitted_here: diag(1142, 1 /* Error */, "Line_break_not_permitted_here_1142", "Line break not permitted here."), - or_expected: diag(1144, 1 /* Error */, "or_expected_1144", "'{' or ';' expected."), - or_JSX_element_expected: diag(1145, 1 /* Error */, "or_JSX_element_expected_1145", "'{' or JSX element expected."), - Declaration_expected: diag(1146, 1 /* Error */, "Declaration_expected_1146", "Declaration expected."), - 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."), - _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."), - A_yield_expression_is_only_allowed_in_a_generator_body: diag(1163, 1 /* Error */, "A_yield_expression_is_only_allowed_in_a_generator_body_1163", "A 'yield' expression is only allowed in a generator body."), - Computed_property_names_are_not_allowed_in_enums: diag(1164, 1 /* Error */, "Computed_property_names_are_not_allowed_in_enums_1164", "Computed property names are not allowed in enums."), - A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1165, 1 /* Error */, "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165", "A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."), - A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type: diag(1166, 1 /* Error */, "A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166", "A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."), - A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1168, 1 /* Error */, "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168", "A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."), - A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1169, 1 /* Error */, "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169", "A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."), - A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1170, 1 /* Error */, "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170", "A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."), - A_comma_expression_is_not_allowed_in_a_computed_property_name: diag(1171, 1 /* Error */, "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171", "A comma expression is not allowed in a computed property name."), - extends_clause_already_seen: diag(1172, 1 /* Error */, "extends_clause_already_seen_1172", "'extends' clause already seen."), - extends_clause_must_precede_implements_clause: diag(1173, 1 /* Error */, "extends_clause_must_precede_implements_clause_1173", "'extends' clause must precede 'implements' clause."), - Classes_can_only_extend_a_single_class: diag(1174, 1 /* Error */, "Classes_can_only_extend_a_single_class_1174", "Classes can only extend a single class."), - implements_clause_already_seen: diag(1175, 1 /* Error */, "implements_clause_already_seen_1175", "'implements' clause already seen."), - Interface_declaration_cannot_have_implements_clause: diag(1176, 1 /* Error */, "Interface_declaration_cannot_have_implements_clause_1176", "Interface declaration cannot have 'implements' clause."), - Binary_digit_expected: diag(1177, 1 /* Error */, "Binary_digit_expected_1177", "Binary digit expected."), - Octal_digit_expected: diag(1178, 1 /* Error */, "Octal_digit_expected_1178", "Octal digit expected."), - Unexpected_token_expected: diag(1179, 1 /* Error */, "Unexpected_token_expected_1179", "Unexpected token. '{' expected."), - Property_destructuring_pattern_expected: diag(1180, 1 /* Error */, "Property_destructuring_pattern_expected_1180", "Property destructuring pattern expected."), - Array_element_destructuring_pattern_expected: diag(1181, 1 /* Error */, "Array_element_destructuring_pattern_expected_1181", "Array element destructuring pattern expected."), - A_destructuring_declaration_must_have_an_initializer: diag(1182, 1 /* Error */, "A_destructuring_declaration_must_have_an_initializer_1182", "A destructuring declaration must have an initializer."), - An_implementation_cannot_be_declared_in_ambient_contexts: diag(1183, 1 /* Error */, "An_implementation_cannot_be_declared_in_ambient_contexts_1183", "An implementation cannot be declared in ambient contexts."), - Modifiers_cannot_appear_here: diag(1184, 1 /* Error */, "Modifiers_cannot_appear_here_1184", "Modifiers cannot appear here."), - Merge_conflict_marker_encountered: diag(1185, 1 /* Error */, "Merge_conflict_marker_encountered_1185", "Merge conflict marker encountered."), - A_rest_element_cannot_have_an_initializer: diag(1186, 1 /* Error */, "A_rest_element_cannot_have_an_initializer_1186", "A rest element cannot have an initializer."), - A_parameter_property_may_not_be_declared_using_a_binding_pattern: diag(1187, 1 /* Error */, "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187", "A parameter property may not be declared using a binding pattern."), - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: diag(1188, 1 /* Error */, "Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188", "Only a single variable declaration is allowed in a 'for...of' statement."), - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: diag(1189, 1 /* Error */, "The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189", "The variable declaration of a 'for...in' statement cannot have an initializer."), - The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: diag(1190, 1 /* Error */, "The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190", "The variable declaration of a 'for...of' statement cannot have an initializer."), - An_import_declaration_cannot_have_modifiers: diag(1191, 1 /* Error */, "An_import_declaration_cannot_have_modifiers_1191", "An import declaration cannot have modifiers."), - Module_0_has_no_default_export: diag(1192, 1 /* Error */, "Module_0_has_no_default_export_1192", "Module '{0}' has no default export."), - An_export_declaration_cannot_have_modifiers: diag(1193, 1 /* Error */, "An_export_declaration_cannot_have_modifiers_1193", "An export declaration cannot have modifiers."), - Export_declarations_are_not_permitted_in_a_namespace: diag(1194, 1 /* Error */, "Export_declarations_are_not_permitted_in_a_namespace_1194", "Export declarations are not permitted in a namespace."), - export_Asterisk_does_not_re_export_a_default: diag(1195, 1 /* Error */, "export_Asterisk_does_not_re_export_a_default_1195", "'export *' does not re-export a default."), - Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified: diag(1196, 1 /* Error */, "Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196", "Catch clause variable type annotation must be 'any' or 'unknown' if specified."), - Catch_clause_variable_cannot_have_an_initializer: diag(1197, 1 /* Error */, "Catch_clause_variable_cannot_have_an_initializer_1197", "Catch clause variable cannot have an initializer."), - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: diag(1198, 1 /* Error */, "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198", "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."), - Unterminated_Unicode_escape_sequence: diag(1199, 1 /* Error */, "Unterminated_Unicode_escape_sequence_1199", "Unterminated Unicode escape sequence."), - Line_terminator_not_permitted_before_arrow: diag(1200, 1 /* Error */, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), - 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: diag(1202, 1 /* Error */, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), - Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1 /* Error */, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), - Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."), - Decorators_are_not_valid_here: diag(1206, 1 /* Error */, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), - Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1 /* Error */, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1 /* Error */, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), - Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1 /* Error */, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), - A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1 /* Error */, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), - Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), - Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: diag(1213, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."), - Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: diag(1214, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."), - Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1 /* Error */, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), - Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1 /* Error */, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), - Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1 /* Error */, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), - Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1 /* Error */, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), - An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1 /* Error */, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), - _0_tag_already_specified: diag(1223, 1 /* Error */, "_0_tag_already_specified_1223", "'{0}' tag already specified."), - Signature_0_must_be_a_type_predicate: diag(1224, 1 /* Error */, "Signature_0_must_be_a_type_predicate_1224", "Signature '{0}' must be a type predicate."), - Cannot_find_parameter_0: diag(1225, 1 /* Error */, "Cannot_find_parameter_0_1225", "Cannot find parameter '{0}'."), - Type_predicate_0_is_not_assignable_to_1: diag(1226, 1 /* Error */, "Type_predicate_0_is_not_assignable_to_1_1226", "Type predicate '{0}' is not assignable to '{1}'."), - Parameter_0_is_not_in_the_same_position_as_parameter_1: diag(1227, 1 /* Error */, "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", "Parameter '{0}' is not in the same position as parameter '{1}'."), - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: diag(1228, 1 /* Error */, "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", "A type predicate is only allowed in return type position for functions and methods."), - A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, 1 /* Error */, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."), - A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, 1 /* Error */, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."), - An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, 1 /* Error */, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."), - An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1232, 1 /* Error */, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."), - An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1233, 1 /* Error */, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."), - An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, 1 /* Error */, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."), - A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: diag(1235, 1 /* Error */, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."), - The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, 1 /* Error */, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."), - The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, 1 /* Error */, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."), - Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, 1 /* Error */, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."), - Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: diag(1239, 1 /* Error */, "Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239", "Unable to resolve signature of parameter decorator when called as an expression."), - Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: diag(1240, 1 /* Error */, "Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240", "Unable to resolve signature of property decorator when called as an expression."), - Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: diag(1241, 1 /* Error */, "Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241", "Unable to resolve signature of method decorator when called as an expression."), - abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: diag(1242, 1 /* Error */, "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242", "'abstract' modifier can only appear on a class, method, or property declaration."), - _0_modifier_cannot_be_used_with_1_modifier: diag(1243, 1 /* Error */, "_0_modifier_cannot_be_used_with_1_modifier_1243", "'{0}' modifier cannot be used with '{1}' modifier."), - Abstract_methods_can_only_appear_within_an_abstract_class: diag(1244, 1 /* Error */, "Abstract_methods_can_only_appear_within_an_abstract_class_1244", "Abstract methods can only appear within an abstract class."), - Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: diag(1245, 1 /* Error */, "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", "Method '{0}' cannot have an implementation because it is marked abstract."), - An_interface_property_cannot_have_an_initializer: diag(1246, 1 /* Error */, "An_interface_property_cannot_have_an_initializer_1246", "An interface property cannot have an initializer."), - A_type_literal_property_cannot_have_an_initializer: diag(1247, 1 /* Error */, "A_type_literal_property_cannot_have_an_initializer_1247", "A type literal property cannot have an initializer."), - A_class_member_cannot_have_the_0_keyword: diag(1248, 1 /* Error */, "A_class_member_cannot_have_the_0_keyword_1248", "A class member cannot have the '{0}' keyword."), - A_decorator_can_only_decorate_a_method_implementation_not_an_overload: diag(1249, 1 /* Error */, "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", "A decorator can only decorate a method implementation, not an overload."), - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5: diag(1250, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'."), - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definiti_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode."), - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode: diag(1252, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_au_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode."), - Abstract_properties_can_only_appear_within_an_abstract_class: diag(1253, 1 /* Error */, "Abstract_properties_can_only_appear_within_an_abstract_class_1253", "Abstract properties can only appear within an abstract class."), - A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, 1 /* Error */, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."), - A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, 1 /* Error */, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), - A_required_element_cannot_follow_an_optional_element: diag(1257, 1 /* Error */, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), - A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1258, 1 /* Error */, "A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258", "A default export must be at the top level of a file or module declaration."), - Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, 1 /* Error */, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), - Keywords_cannot_contain_escape_characters: diag(1260, 1 /* Error */, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), - Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, 1 /* Error */, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), - Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), - Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, 1 /* Error */, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), - Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, 1 /* Error */, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), - A_rest_element_cannot_follow_another_rest_element: diag(1265, 1 /* Error */, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."), - An_optional_element_cannot_follow_a_rest_element: diag(1266, 1 /* Error */, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), - Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1 /* Error */, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), - An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1 /* Error */, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), - Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."), - Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1 /* Error */, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), - Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1 /* Error */, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), - A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1 /* Error */, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), - _0_modifier_cannot_appear_on_a_type_parameter: diag(1273, 1 /* Error */, "_0_modifier_cannot_appear_on_a_type_parameter_1273", "'{0}' modifier cannot appear on a type parameter"), - _0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"), - accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), - An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), - _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"), - The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: diag(1278, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."), - The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: diag(1279, 1 /* Error */, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."), - 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: diag(1280, 1 /* Error */, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "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."), - Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: diag(1281, 1 /* Error */, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."), - An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1282, 1 /* Error */, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), - An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), - An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), - An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), - ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax: diag(1286, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'."), - 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 }'."), - ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."), - This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1 /* Error */, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."), - ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript: diag(1295, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript."), - 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."), - 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: diag(1312, 1 /* Error */, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), - The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, 1 /* Error */, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."), - Global_module_exports_may_only_appear_in_module_files: diag(1314, 1 /* Error */, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."), - Global_module_exports_may_only_appear_in_declaration_files: diag(1315, 1 /* Error */, "Global_module_exports_may_only_appear_in_declaration_files_1315", "Global module exports may only appear in declaration files."), - Global_module_exports_may_only_appear_at_top_level: diag(1316, 1 /* Error */, "Global_module_exports_may_only_appear_at_top_level_1316", "Global module exports may only appear at top level."), - A_parameter_property_cannot_be_declared_using_a_rest_parameter: diag(1317, 1 /* Error */, "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", "A parameter property cannot be declared using a rest parameter."), - An_abstract_accessor_cannot_have_an_implementation: diag(1318, 1 /* Error */, "An_abstract_accessor_cannot_have_an_implementation_1318", "An abstract accessor cannot have an implementation."), - A_default_export_can_only_be_used_in_an_ECMAScript_style_module: diag(1319, 1 /* Error */, "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", "A default export can only be used in an ECMAScript-style module."), - Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1 /* Error */, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."), - Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1 /* Error */, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."), - Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1 /* Error */, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."), - Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'."), - Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'."), - Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1 /* Error */, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."), - This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1 /* Error */, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."), - String_literal_with_double_quotes_expected: diag(1327, 1 /* Error */, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), - Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, 1 /* Error */, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), - _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, 1 /* Error */, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), - A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly: diag(1330, 1 /* Error */, "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330", "A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."), - A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly: diag(1331, 1 /* Error */, "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331", "A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."), - A_variable_whose_type_is_a_unique_symbol_type_must_be_const: diag(1332, 1 /* Error */, "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332", "A variable whose type is a 'unique symbol' type must be 'const'."), - unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, 1 /* Error */, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), - unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, 1 /* Error */, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), - unique_symbol_types_are_not_allowed_here: diag(1335, 1 /* Error */, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), - An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead: diag(1337, 1 /* Error */, "An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337", "An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."), - infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, 1 /* Error */, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), - Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), - Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), - Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'."), - A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), - An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), - This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1 /* Error */, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), - use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, 1 /* Error */, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), - Non_simple_parameter_declared_here: diag(1348, 1 /* Error */, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), - use_strict_directive_used_here: diag(1349, 1 /* Error */, "use_strict_directive_used_here_1349", "'use strict' directive used here."), - Print_the_final_configuration_instead_of_building: diag(1350, 3 /* Message */, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."), - An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, 1 /* Error */, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."), - A_bigint_literal_cannot_use_exponential_notation: diag(1352, 1 /* Error */, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."), - A_bigint_literal_must_be_an_integer: diag(1353, 1 /* Error */, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."), - readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: diag(1354, 1 /* Error */, "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354", "'readonly' type modifier is only permitted on array and tuple literal types."), - A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals: diag(1355, 1 /* Error */, "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355", "A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."), - Did_you_mean_to_mark_this_function_as_async: diag(1356, 1 /* Error */, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"), - An_enum_member_name_must_be_followed_by_a_or: diag(1357, 1 /* Error */, "An_enum_member_name_must_be_followed_by_a_or_1357", "An enum member name must be followed by a ',', '=', or '}'."), - Tagged_template_expressions_are_not_permitted_in_an_optional_chain: diag(1358, 1 /* Error */, "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358", "Tagged template expressions are not permitted in an optional chain."), - Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: diag(1359, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359", "Identifier expected. '{0}' is a reserved word that cannot be used here."), - Type_0_does_not_satisfy_the_expected_type_1: diag(1360, 1 /* Error */, "Type_0_does_not_satisfy_the_expected_type_1_1360", "Type '{0}' does not satisfy the expected type '{1}'."), - _0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type: diag(1361, 1 /* Error */, "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361", "'{0}' cannot be used as a value because it was imported using 'import type'."), - _0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type: diag(1362, 1 /* Error */, "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362", "'{0}' cannot be used as a value because it was exported using 'export type'."), - A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both: diag(1363, 1 /* Error */, "A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363", "A type-only import can specify a default import or named bindings, but not both."), - Convert_to_type_only_export: diag(1364, 3 /* Message */, "Convert_to_type_only_export_1364", "Convert to type-only export"), - Convert_all_re_exported_types_to_type_only_exports: diag(1365, 3 /* Message */, "Convert_all_re_exported_types_to_type_only_exports_1365", "Convert all re-exported types to type-only exports"), - Split_into_two_separate_import_declarations: diag(1366, 3 /* Message */, "Split_into_two_separate_import_declarations_1366", "Split into two separate import declarations"), - Split_all_invalid_type_only_imports: diag(1367, 3 /* Message */, "Split_all_invalid_type_only_imports_1367", "Split all invalid type-only imports"), - 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}'?"), - 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_node18_node20_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', 'node18', 'node20', '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 `}`?"), - Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), - Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), - Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), - Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), - Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), - _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, 1 /* Error */, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), - _0_is_not_allowed_as_a_parameter_name: diag(1390, 1 /* Error */, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."), - An_import_alias_cannot_use_import_type: diag(1392, 1 /* Error */, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"), - Imported_via_0_from_file_1: diag(1393, 3 /* Message */, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"), - Imported_via_0_from_file_1_with_packageId_2: diag(1394, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"), - Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions: diag(1395, 3 /* Message */, "Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395", "Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"), - Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions: diag(1396, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396", "Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"), - Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions: diag(1397, 3 /* Message */, "Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397", "Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"), - Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions: diag(1398, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398", "Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"), - File_is_included_via_import_here: diag(1399, 3 /* Message */, "File_is_included_via_import_here_1399", "File is included via import here."), - Referenced_via_0_from_file_1: diag(1400, 3 /* Message */, "Referenced_via_0_from_file_1_1400", "Referenced via '{0}' from file '{1}'"), - File_is_included_via_reference_here: diag(1401, 3 /* Message */, "File_is_included_via_reference_here_1401", "File is included via reference here."), - Type_library_referenced_via_0_from_file_1: diag(1402, 3 /* Message */, "Type_library_referenced_via_0_from_file_1_1402", "Type library referenced via '{0}' from file '{1}'"), - Type_library_referenced_via_0_from_file_1_with_packageId_2: diag(1403, 3 /* Message */, "Type_library_referenced_via_0_from_file_1_with_packageId_2_1403", "Type library referenced via '{0}' from file '{1}' with packageId '{2}'"), - File_is_included_via_type_library_reference_here: diag(1404, 3 /* Message */, "File_is_included_via_type_library_reference_here_1404", "File is included via type library reference here."), - Library_referenced_via_0_from_file_1: diag(1405, 3 /* Message */, "Library_referenced_via_0_from_file_1_1405", "Library referenced via '{0}' from file '{1}'"), - File_is_included_via_library_reference_here: diag(1406, 3 /* Message */, "File_is_included_via_library_reference_here_1406", "File is included via library reference here."), - Matched_by_include_pattern_0_in_1: diag(1407, 3 /* Message */, "Matched_by_include_pattern_0_in_1_1407", "Matched by include pattern '{0}' in '{1}'"), - File_is_matched_by_include_pattern_specified_here: diag(1408, 3 /* Message */, "File_is_matched_by_include_pattern_specified_here_1408", "File is matched by include pattern specified here."), - Part_of_files_list_in_tsconfig_json: diag(1409, 3 /* Message */, "Part_of_files_list_in_tsconfig_json_1409", "Part of 'files' list in tsconfig.json"), - File_is_matched_by_files_list_specified_here: diag(1410, 3 /* Message */, "File_is_matched_by_files_list_specified_here_1410", "File is matched by 'files' list specified here."), - Output_from_referenced_project_0_included_because_1_specified: diag(1411, 3 /* Message */, "Output_from_referenced_project_0_included_because_1_specified_1411", "Output from referenced project '{0}' included because '{1}' specified"), - Output_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1412, 3 /* Message */, "Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412", "Output from referenced project '{0}' included because '--module' is specified as 'none'"), - File_is_output_from_referenced_project_specified_here: diag(1413, 3 /* Message */, "File_is_output_from_referenced_project_specified_here_1413", "File is output from referenced project specified here."), - Source_from_referenced_project_0_included_because_1_specified: diag(1414, 3 /* Message */, "Source_from_referenced_project_0_included_because_1_specified_1414", "Source from referenced project '{0}' included because '{1}' specified"), - Source_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1415, 3 /* Message */, "Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415", "Source from referenced project '{0}' included because '--module' is specified as 'none'"), - File_is_source_from_referenced_project_specified_here: diag(1416, 3 /* Message */, "File_is_source_from_referenced_project_specified_here_1416", "File is source from referenced project specified here."), - Entry_point_of_type_library_0_specified_in_compilerOptions: diag(1417, 3 /* Message */, "Entry_point_of_type_library_0_specified_in_compilerOptions_1417", "Entry point of type library '{0}' specified in compilerOptions"), - Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1: diag(1418, 3 /* Message */, "Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418", "Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"), - File_is_entry_point_of_type_library_specified_here: diag(1419, 3 /* Message */, "File_is_entry_point_of_type_library_specified_here_1419", "File is entry point of type library specified here."), - Entry_point_for_implicit_type_library_0: diag(1420, 3 /* Message */, "Entry_point_for_implicit_type_library_0_1420", "Entry point for implicit type library '{0}'"), - Entry_point_for_implicit_type_library_0_with_packageId_1: diag(1421, 3 /* Message */, "Entry_point_for_implicit_type_library_0_with_packageId_1_1421", "Entry point for implicit type library '{0}' with packageId '{1}'"), - Library_0_specified_in_compilerOptions: diag(1422, 3 /* Message */, "Library_0_specified_in_compilerOptions_1422", "Library '{0}' specified in compilerOptions"), - File_is_library_specified_here: diag(1423, 3 /* Message */, "File_is_library_specified_here_1423", "File is library specified here."), - Default_library: diag(1424, 3 /* Message */, "Default_library_1424", "Default library"), - Default_library_for_target_0: diag(1425, 3 /* Message */, "Default_library_for_target_0_1425", "Default library for target '{0}'"), - File_is_default_library_for_target_specified_here: diag(1426, 3 /* Message */, "File_is_default_library_for_target_specified_here_1426", "File is default library for target specified here."), - Root_file_specified_for_compilation: diag(1427, 3 /* Message */, "Root_file_specified_for_compilation_1427", "Root file specified for compilation"), - File_is_output_of_project_reference_source_0: diag(1428, 3 /* Message */, "File_is_output_of_project_reference_source_0_1428", "File is output of project reference source '{0}'"), - 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_node18_node20_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', 'node18', 'node20', '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}'?"), - Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1 /* Error */, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), - Namespace_must_be_given_a_name: diag(1437, 1 /* Error */, "Namespace_must_be_given_a_name_1437", "Namespace must be given a name."), - Interface_must_be_given_a_name: diag(1438, 1 /* Error */, "Interface_must_be_given_a_name_1438", "Interface must be given a name."), - Type_alias_must_be_given_a_name: diag(1439, 1 /* Error */, "Type_alias_must_be_given_a_name_1439", "Type alias must be given a name."), - Variable_declaration_not_allowed_at_this_location: diag(1440, 1 /* Error */, "Variable_declaration_not_allowed_at_this_location_1440", "Variable declaration not allowed at this location."), - Cannot_start_a_function_call_in_a_type_annotation: diag(1441, 1 /* Error */, "Cannot_start_a_function_call_in_a_type_annotation_1441", "Cannot start a function call in a type annotation."), - Expected_for_property_initializer: diag(1442, 1 /* Error */, "Expected_for_property_initializer_1442", "Expected '=' for property initializer."), - Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1 /* Error */, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), - _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_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_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."), - Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1456, 1 /* Error */, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."), - Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk: diag(1457, 3 /* Message */, "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457", "Matched by default include pattern '**/*'"), - File_is_ECMAScript_module_because_0_has_field_type_with_value_module: diag(1458, 3 /* Message */, "File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458", `File is ECMAScript module because '{0}' has field "type" with value "module"`), - 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."), - An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, 1 /* Error */, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."), - An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, 1 /* Error */, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."), - Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, 3 /* Message */, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."), - auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, 3 /* Message */, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", '"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'), - An_instantiation_expression_cannot_be_followed_by_a_property_access: diag(1477, 1 /* Error */, "An_instantiation_expression_cannot_be_followed_by_a_property_access_1477", "An instantiation expression cannot be followed by a property access."), - Identifier_or_string_literal_expected: diag(1478, 1 /* Error */, "Identifier_or_string_literal_expected_1478", "Identifier or string literal expected."), - 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: diag(1479, 1 /* Error */, "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", `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.`), - To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module: diag(1480, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480", 'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'), - To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), - To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), - To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), - _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), - _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), - Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."), - Octal_escape_sequences_are_not_allowed_Use_the_syntax_0: diag(1487, 1 /* Error */, "Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487", "Octal escape sequences are not allowed. Use the syntax '{0}'."), - 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."), - Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator: diag(1497, 1 /* Error */, "Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497", "Expression must be enclosed in parentheses to be used as a decorator."), - Invalid_syntax_in_decorator: diag(1498, 1 /* Error */, "Invalid_syntax_in_decorator_1498", "Invalid syntax in decorator."), - Unknown_regular_expression_flag: diag(1499, 1 /* Error */, "Unknown_regular_expression_flag_1499", "Unknown regular expression flag."), - Duplicate_regular_expression_flag: diag(1500, 1 /* Error */, "Duplicate_regular_expression_flag_1500", "Duplicate regular expression flag."), - This_regular_expression_flag_is_only_available_when_targeting_0_or_later: diag(1501, 1 /* Error */, "This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501", "This regular expression flag is only available when targeting '{0}' or later."), - The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously: diag(1502, 1 /* Error */, "The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1502", "The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."), - Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later: diag(1503, 1 /* Error */, "Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1503", "Named capturing groups are only available when targeting 'ES2018' or later."), - Subpattern_flags_must_be_present_when_there_is_a_minus_sign: diag(1504, 1 /* Error */, "Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1504", "Subpattern flags must be present when there is a minus sign."), - Incomplete_quantifier_Digit_expected: diag(1505, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1505", "Incomplete quantifier. Digit expected."), - Numbers_out_of_order_in_quantifier: diag(1506, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1506", "Numbers out of order in quantifier."), - There_is_nothing_available_for_repetition: diag(1507, 1 /* Error */, "There_is_nothing_available_for_repetition_1507", "There is nothing available for repetition."), - Unexpected_0_Did_you_mean_to_escape_it_with_backslash: diag(1508, 1 /* Error */, "Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1508", "Unexpected '{0}'. Did you mean to escape it with backslash?"), - This_regular_expression_flag_cannot_be_toggled_within_a_subpattern: diag(1509, 1 /* Error */, "This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1509", "This regular expression flag cannot be toggled within a subpattern."), - k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets: diag(1510, 1 /* Error */, "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510", "'\\k' must be followed by a capturing group name enclosed in angle brackets."), - q_is_only_available_inside_character_class: diag(1511, 1 /* Error */, "q_is_only_available_inside_character_class_1511", "'\\q' is only available inside character class."), - c_must_be_followed_by_an_ASCII_letter: diag(1512, 1 /* Error */, "c_must_be_followed_by_an_ASCII_letter_1512", "'\\c' must be followed by an ASCII letter."), - Undetermined_character_escape: diag(1513, 1 /* Error */, "Undetermined_character_escape_1513", "Undetermined character escape."), - Expected_a_capturing_group_name: diag(1514, 1 /* Error */, "Expected_a_capturing_group_name_1514", "Expected a capturing group name."), - Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other: diag(1515, 1 /* Error */, "Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1515", "Named capturing groups with the same name must be mutually exclusive to each other."), - A_character_class_range_must_not_be_bounded_by_another_character_class: diag(1516, 1 /* Error */, "A_character_class_range_must_not_be_bounded_by_another_character_class_1516", "A character class range must not be bounded by another character class."), - Range_out_of_order_in_character_class: diag(1517, 1 /* Error */, "Range_out_of_order_in_character_class_1517", "Range out of order in character class."), - Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class: diag(1518, 1 /* Error */, "Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1518", "Anything that would possibly match more than a single character is invalid inside a negated character class."), - Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead: diag(1519, 1 /* Error */, "Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1519", "Operators must not be mixed within a character class. Wrap it in a nested class instead."), - Expected_a_class_set_operand: diag(1520, 1 /* Error */, "Expected_a_class_set_operand_1520", "Expected a class set operand."), - q_must_be_followed_by_string_alternatives_enclosed_in_braces: diag(1521, 1 /* Error */, "q_must_be_followed_by_string_alternatives_enclosed_in_braces_1521", "'\\q' must be followed by string alternatives enclosed in braces."), - A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash: diag(1522, 1 /* Error */, "A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1522", "A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"), - Expected_a_Unicode_property_name: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_name_1523", "Expected a Unicode property name."), - Unknown_Unicode_property_name: diag(1524, 1 /* Error */, "Unknown_Unicode_property_name_1524", "Unknown Unicode property name."), - Expected_a_Unicode_property_value: diag(1525, 1 /* Error */, "Expected_a_Unicode_property_value_1525", "Expected a Unicode property value."), - Unknown_Unicode_property_value: diag(1526, 1 /* Error */, "Unknown_Unicode_property_value_1526", "Unknown Unicode property value."), - Expected_a_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Expected_a_Unicode_property_name_or_value_1527", "Expected a Unicode property name or value."), - Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set: diag(1528, 1 /* Error */, "Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1528", "Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."), - Unknown_Unicode_property_name_or_value: diag(1529, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1529", "Unknown Unicode property name or value."), - Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1530, 1 /* Error */, "Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1530", "Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."), - _0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces: diag(1531, 1 /* Error */, "_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1531", "'\\{0}' must be followed by a Unicode property value expression enclosed in braces."), - There_is_no_capturing_group_named_0_in_this_regular_expression: diag(1532, 1 /* Error */, "There_is_no_capturing_group_named_0_in_this_regular_expression_1532", "There is no capturing group named '{0}' in this regular expression."), - This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression: diag(1533, 1 /* Error */, "This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_r_1533", "This backreference refers to a group that does not exist. There are only {0} capturing groups in this regular expression."), - This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression: diag(1534, 1 /* Error */, "This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regul_1534", "This backreference refers to a group that does not exist. There are no capturing groups in this regular expression."), - This_character_cannot_be_escaped_in_a_regular_expression: diag(1535, 1 /* Error */, "This_character_cannot_be_escaped_in_a_regular_expression_1535", "This character cannot be escaped in a regular expression."), - Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead: diag(1536, 1 /* Error */, "Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended__1536", "Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '{0}' instead."), - Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class: diag(1537, 1 /* Error */, "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537", "Decimal escape sequences and backreferences are not allowed in a character class."), - Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1538, 1 /* Error */, "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538", "Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."), - A_bigint_literal_cannot_be_used_as_a_property_name: diag(1539, 1 /* Error */, "A_bigint_literal_cannot_be_used_as_a_property_name_1539", "A 'bigint' literal cannot be used as a property name."), - A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag( - 1540, - 2 /* Suggestion */, - "A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540", - "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.", - /*reportsUnnecessary*/ - void 0, - /*elidedInCompatabilityPyramid*/ - void 0, - /*reportsDeprecated*/ - true - ), - Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1541, 1 /* Error */, "Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541", "Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."), - Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1542, 1 /* Error */, "Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542", "Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."), - Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0: diag(1543, 1 /* Error */, "Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543", `Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`), - Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0: diag(1544, 1 /* Error */, "Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544", "Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."), - using_declarations_are_not_allowed_in_ambient_contexts: diag(1545, 1 /* Error */, "using_declarations_are_not_allowed_in_ambient_contexts_1545", "'using' declarations are not allowed in ambient contexts."), - await_using_declarations_are_not_allowed_in_ambient_contexts: diag(1546, 1 /* Error */, "await_using_declarations_are_not_allowed_in_ambient_contexts_1546", "'await using' declarations are not allowed in ambient contexts."), - 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( - 2202, - 1 /* Error */, - "Call_signature_return_types_0_and_1_are_incompatible_2202", - "Call signature return types '{0}' and '{1}' are incompatible.", - /*reportsUnnecessary*/ - void 0, - /*elidedInCompatabilityPyramid*/ - true - ), - Construct_signature_return_types_0_and_1_are_incompatible: diag( - 2203, - 1 /* Error */, - "Construct_signature_return_types_0_and_1_are_incompatible_2203", - "Construct signature return types '{0}' and '{1}' are incompatible.", - /*reportsUnnecessary*/ - void 0, - /*elidedInCompatabilityPyramid*/ - true - ), - Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag( - 2204, - 1 /* Error */, - "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204", - "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.", - /*reportsUnnecessary*/ - void 0, - /*elidedInCompatabilityPyramid*/ - true - ), - Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag( - 2205, - 1 /* Error */, - "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", - "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", - /*reportsUnnecessary*/ - void 0, - /*elidedInCompatabilityPyramid*/ - true - ), - The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, 1 /* Error */, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."), - The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, 1 /* Error */, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."), - This_type_parameter_might_need_an_extends_0_constraint: diag(2208, 1 /* Error */, "This_type_parameter_might_need_an_extends_0_constraint_2208", "This type parameter might need an `extends {0}` constraint."), - The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), - The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), - Add_extends_constraint: diag(2211, 3 /* Message */, "Add_extends_constraint_2211", "Add `extends` constraint."), - Add_extends_constraint_to_all_type_parameters: diag(2212, 3 /* Message */, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"), - Duplicate_identifier_0: diag(2300, 1 /* Error */, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, 1 /* Error */, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), - Static_members_cannot_reference_class_type_parameters: diag(2302, 1 /* Error */, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), - Circular_definition_of_import_alias_0: diag(2303, 1 /* Error */, "Circular_definition_of_import_alias_0_2303", "Circular definition of import alias '{0}'."), - Cannot_find_name_0: diag(2304, 1 /* Error */, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), - Module_0_has_no_exported_member_1: diag(2305, 1 /* Error */, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), - File_0_is_not_a_module: diag(2306, 1 /* Error */, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), - Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, 1 /* Error */, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), - Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, 1 /* Error */, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, 1 /* Error */, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), - Type_0_recursively_references_itself_as_a_base_type: diag(2310, 1 /* Error */, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), - Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function: diag(2311, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311", "Cannot find name '{0}'. Did you mean to write this in an async function?"), - An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, 1 /* Error */, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), - Type_parameter_0_has_a_circular_constraint: diag(2313, 1 /* Error */, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), - Generic_type_0_requires_1_type_argument_s: diag(2314, 1 /* Error */, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), - Type_0_is_not_generic: diag(2315, 1 /* Error */, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), - Global_type_0_must_be_a_class_or_interface_type: diag(2316, 1 /* Error */, "Global_type_0_must_be_a_class_or_interface_type_2316", "Global type '{0}' must be a class or interface type."), - Global_type_0_must_have_1_type_parameter_s: diag(2317, 1 /* Error */, "Global_type_0_must_have_1_type_parameter_s_2317", "Global type '{0}' must have {1} type parameter(s)."), - Cannot_find_global_type_0: diag(2318, 1 /* Error */, "Cannot_find_global_type_0_2318", "Cannot find global type '{0}'."), - Named_property_0_of_types_1_and_2_are_not_identical: diag(2319, 1 /* Error */, "Named_property_0_of_types_1_and_2_are_not_identical_2319", "Named property '{0}' of types '{1}' and '{2}' are not identical."), - Interface_0_cannot_simultaneously_extend_types_1_and_2: diag(2320, 1 /* Error */, "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."), - Excessive_stack_depth_comparing_types_0_and_1: diag(2321, 1 /* Error */, "Excessive_stack_depth_comparing_types_0_and_1_2321", "Excessive stack depth comparing types '{0}' and '{1}'."), - Type_0_is_not_assignable_to_type_1: diag(2322, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_2322", "Type '{0}' is not assignable to type '{1}'."), - Cannot_redeclare_exported_variable_0: diag(2323, 1 /* Error */, "Cannot_redeclare_exported_variable_0_2323", "Cannot redeclare exported variable '{0}'."), - Property_0_is_missing_in_type_1: diag(2324, 1 /* Error */, "Property_0_is_missing_in_type_1_2324", "Property '{0}' is missing in type '{1}'."), - Property_0_is_private_in_type_1_but_not_in_type_2: diag(2325, 1 /* Error */, "Property_0_is_private_in_type_1_but_not_in_type_2_2325", "Property '{0}' is private in type '{1}' but not in type '{2}'."), - Types_of_property_0_are_incompatible: diag(2326, 1 /* Error */, "Types_of_property_0_are_incompatible_2326", "Types of property '{0}' are incompatible."), - Property_0_is_optional_in_type_1_but_required_in_type_2: diag(2327, 1 /* Error */, "Property_0_is_optional_in_type_1_but_required_in_type_2_2327", "Property '{0}' is optional in type '{1}' but required in type '{2}'."), - Types_of_parameters_0_and_1_are_incompatible: diag(2328, 1 /* Error */, "Types_of_parameters_0_and_1_are_incompatible_2328", "Types of parameters '{0}' and '{1}' are incompatible."), - Index_signature_for_type_0_is_missing_in_type_1: diag(2329, 1 /* Error */, "Index_signature_for_type_0_is_missing_in_type_1_2329", "Index signature for type '{0}' is missing in type '{1}'."), - _0_and_1_index_signatures_are_incompatible: diag(2330, 1 /* Error */, "_0_and_1_index_signatures_are_incompatible_2330", "'{0}' and '{1}' index signatures are incompatible."), - this_cannot_be_referenced_in_a_module_or_namespace_body: diag(2331, 1 /* Error */, "this_cannot_be_referenced_in_a_module_or_namespace_body_2331", "'this' cannot be referenced in a module or namespace body."), - this_cannot_be_referenced_in_current_location: diag(2332, 1 /* Error */, "this_cannot_be_referenced_in_current_location_2332", "'this' cannot be referenced in current location."), - this_cannot_be_referenced_in_a_static_property_initializer: diag(2334, 1 /* Error */, "this_cannot_be_referenced_in_a_static_property_initializer_2334", "'this' cannot be referenced in a static property initializer."), - super_can_only_be_referenced_in_a_derived_class: diag(2335, 1 /* Error */, "super_can_only_be_referenced_in_a_derived_class_2335", "'super' can only be referenced in a derived class."), - super_cannot_be_referenced_in_constructor_arguments: diag(2336, 1 /* Error */, "super_cannot_be_referenced_in_constructor_arguments_2336", "'super' cannot be referenced in constructor arguments."), - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: diag(2337, 1 /* Error */, "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337", "Super calls are not permitted outside constructors or in nested functions inside constructors."), - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: diag(2338, 1 /* Error */, "super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338", "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."), - Property_0_does_not_exist_on_type_1: diag(2339, 1 /* Error */, "Property_0_does_not_exist_on_type_1_2339", "Property '{0}' does not exist on type '{1}'."), - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: diag(2340, 1 /* Error */, "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", "Only public and protected methods of the base class are accessible via the 'super' keyword."), - Property_0_is_private_and_only_accessible_within_class_1: diag(2341, 1 /* Error */, "Property_0_is_private_and_only_accessible_within_class_1_2341", "Property '{0}' is private and only accessible within class '{1}'."), - 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."), - Only_a_void_function_can_be_called_with_the_new_keyword: diag(2350, 1 /* Error */, "Only_a_void_function_can_be_called_with_the_new_keyword_2350", "Only a void function can be called with the 'new' keyword."), - This_expression_is_not_constructable: diag(2351, 1 /* Error */, "This_expression_is_not_constructable_2351", "This expression is not constructable."), - 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: diag(2352, 1 /* Error */, "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352", "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."), - Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, 1 /* Error */, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."), - This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, 1 /* Error */, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."), - A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value: diag(2355, 1 /* Error */, "A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."), - 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_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."), - Operator_0_cannot_be_applied_to_types_1_and_2: diag(2365, 1 /* Error */, "Operator_0_cannot_be_applied_to_types_1_and_2_2365", "Operator '{0}' cannot be applied to types '{1}' and '{2}'."), - Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: diag(2366, 1 /* Error */, "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", "Function lacks ending return statement and return type does not include 'undefined'."), - This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap: diag(2367, 1 /* Error */, "This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367", "This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."), - Type_parameter_name_cannot_be_0: diag(2368, 1 /* Error */, "Type_parameter_name_cannot_be_0_2368", "Type parameter name cannot be '{0}'."), - A_parameter_property_is_only_allowed_in_a_constructor_implementation: diag(2369, 1 /* Error */, "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", "A parameter property is only allowed in a constructor implementation."), - A_rest_parameter_must_be_of_an_array_type: diag(2370, 1 /* Error */, "A_rest_parameter_must_be_of_an_array_type_2370", "A rest parameter must be of an array type."), - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: diag(2371, 1 /* Error */, "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", "A parameter initializer is only allowed in a function or constructor implementation."), - Parameter_0_cannot_reference_itself: diag(2372, 1 /* Error */, "Parameter_0_cannot_reference_itself_2372", "Parameter '{0}' cannot reference itself."), - Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, 1 /* Error */, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."), - Duplicate_index_signature_for_type_0: diag(2374, 1 /* Error */, "Duplicate_index_signature_for_type_0_2374", "Duplicate index signature for type '{0}'."), - Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2375, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), - 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: diag(2376, 1 /* Error */, "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376", "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."), - Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, 1 /* Error */, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."), - A_get_accessor_must_return_a_value: diag(2378, 1 /* Error */, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."), - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2379, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), - Overload_signatures_must_all_be_exported_or_non_exported: diag(2383, 1 /* Error */, "Overload_signatures_must_all_be_exported_or_non_exported_2383", "Overload signatures must all be exported or non-exported."), - Overload_signatures_must_all_be_ambient_or_non_ambient: diag(2384, 1 /* Error */, "Overload_signatures_must_all_be_ambient_or_non_ambient_2384", "Overload signatures must all be ambient or non-ambient."), - Overload_signatures_must_all_be_public_private_or_protected: diag(2385, 1 /* Error */, "Overload_signatures_must_all_be_public_private_or_protected_2385", "Overload signatures must all be public, private or protected."), - Overload_signatures_must_all_be_optional_or_required: diag(2386, 1 /* Error */, "Overload_signatures_must_all_be_optional_or_required_2386", "Overload signatures must all be optional or required."), - Function_overload_must_be_static: diag(2387, 1 /* Error */, "Function_overload_must_be_static_2387", "Function overload must be static."), - Function_overload_must_not_be_static: diag(2388, 1 /* Error */, "Function_overload_must_not_be_static_2388", "Function overload must not be static."), - Function_implementation_name_must_be_0: diag(2389, 1 /* Error */, "Function_implementation_name_must_be_0_2389", "Function implementation name must be '{0}'."), - Constructor_implementation_is_missing: diag(2390, 1 /* Error */, "Constructor_implementation_is_missing_2390", "Constructor implementation is missing."), - Function_implementation_is_missing_or_not_immediately_following_the_declaration: diag(2391, 1 /* Error */, "Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391", "Function implementation is missing or not immediately following the declaration."), - Multiple_constructor_implementations_are_not_allowed: diag(2392, 1 /* Error */, "Multiple_constructor_implementations_are_not_allowed_2392", "Multiple constructor implementations are not allowed."), - Duplicate_function_implementation: diag(2393, 1 /* Error */, "Duplicate_function_implementation_2393", "Duplicate function implementation."), - This_overload_signature_is_not_compatible_with_its_implementation_signature: diag(2394, 1 /* Error */, "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394", "This overload signature is not compatible with its implementation signature."), - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: diag(2395, 1 /* Error */, "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", "Individual declarations in merged declaration '{0}' must be all exported or all local."), - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: diag(2396, 1 /* Error */, "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."), - Declaration_name_conflicts_with_built_in_global_identifier_0: diag(2397, 1 /* Error */, "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", "Declaration name conflicts with built-in global identifier '{0}'."), - constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, 1 /* Error */, "constructor_cannot_be_used_as_a_parameter_property_name_2398", "'constructor' cannot be used as a parameter property name."), - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: diag(2399, 1 /* Error */, "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."), - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: diag(2400, 1 /* Error */, "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."), - 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: diag(2401, 1 /* Error */, "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401", "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."), - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, 1 /* Error */, "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402", "Expression resolves to '_super' that compiler uses to capture base class reference."), - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: diag(2403, 1 /* Error */, "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403", "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."), - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: diag(2404, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404", "The left-hand side of a 'for...in' statement cannot use a type annotation."), - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: diag(2405, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405", "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."), - The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: diag(2406, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", "The left-hand side of a 'for...in' statement must be a variable or a property access."), - 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: diag(2407, 1 /* Error */, "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407", "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}'."), - Setters_cannot_return_a_value: diag(2408, 1 /* Error */, "Setters_cannot_return_a_value_2408", "Setters cannot return a value."), - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: diag(2409, 1 /* Error */, "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", "Return type of constructor signature must be assignable to the instance type of the class."), - The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: diag(2410, 1 /* Error */, "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."), - Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target: diag(2412, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."), - Property_0_of_type_1_is_not_assignable_to_2_index_type_3: diag(2411, 1 /* Error */, "Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411", "Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."), - _0_index_type_1_is_not_assignable_to_2_index_type_3: diag(2413, 1 /* Error */, "_0_index_type_1_is_not_assignable_to_2_index_type_3_2413", "'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."), - Class_name_cannot_be_0: diag(2414, 1 /* Error */, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), - Class_0_incorrectly_extends_base_class_1: diag(2415, 1 /* Error */, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), - Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, 1 /* Error */, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), - Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, 1 /* Error */, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), - Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, 1 /* Error */, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), - Types_of_construct_signatures_are_incompatible: diag(2419, 1 /* Error */, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), - Class_0_incorrectly_implements_interface_1: diag(2420, 1 /* Error */, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), - A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, 1 /* Error */, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, 1 /* Error */, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, 1 /* Error */, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2426, 1 /* Error */, "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."), - Interface_name_cannot_be_0: diag(2427, 1 /* Error */, "Interface_name_cannot_be_0_2427", "Interface name cannot be '{0}'."), - All_declarations_of_0_must_have_identical_type_parameters: diag(2428, 1 /* Error */, "All_declarations_of_0_must_have_identical_type_parameters_2428", "All declarations of '{0}' must have identical type parameters."), - Interface_0_incorrectly_extends_interface_1: diag(2430, 1 /* Error */, "Interface_0_incorrectly_extends_interface_1_2430", "Interface '{0}' incorrectly extends interface '{1}'."), - Enum_name_cannot_be_0: diag(2431, 1 /* Error */, "Enum_name_cannot_be_0_2431", "Enum name cannot be '{0}'."), - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: diag(2432, 1 /* Error */, "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."), - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: diag(2433, 1 /* Error */, "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", "A namespace declaration cannot be in a different file from a class or function with which it is merged."), - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: diag(2434, 1 /* Error */, "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", "A namespace declaration cannot be located prior to a class or function with which it is merged."), - Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: diag(2435, 1 /* Error */, "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", "Ambient modules cannot be nested in other modules or namespaces."), - Ambient_module_declaration_cannot_specify_relative_module_name: diag(2436, 1 /* Error */, "Ambient_module_declaration_cannot_specify_relative_module_name_2436", "Ambient module declaration cannot specify relative module name."), - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: diag(2437, 1 /* Error */, "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", "Module '{0}' is hidden by a local declaration with the same name."), - Import_name_cannot_be_0: diag(2438, 1 /* Error */, "Import_name_cannot_be_0_2438", "Import name cannot be '{0}'."), - Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: diag(2439, 1 /* Error */, "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", "Import or export declaration in an ambient module declaration cannot reference module through relative module name."), - Import_declaration_conflicts_with_local_declaration_of_0: diag(2440, 1 /* Error */, "Import_declaration_conflicts_with_local_declaration_of_0_2440", "Import declaration conflicts with local declaration of '{0}'."), - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: diag(2441, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."), - Types_have_separate_declarations_of_a_private_property_0: diag(2442, 1 /* Error */, "Types_have_separate_declarations_of_a_private_property_0_2442", "Types have separate declarations of a private property '{0}'."), - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: diag(2443, 1 /* Error */, "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."), - Property_0_is_protected_in_type_1_but_public_in_type_2: diag(2444, 1 /* Error */, "Property_0_is_protected_in_type_1_but_public_in_type_2_2444", "Property '{0}' is protected in type '{1}' but public in type '{2}'."), - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: diag(2445, 1 /* Error */, "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445", "Property '{0}' is protected and only accessible within class '{1}' and its subclasses."), - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2: diag(2446, 1 /* Error */, "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446", "Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."), - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: diag(2447, 1 /* Error */, "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."), - Block_scoped_variable_0_used_before_its_declaration: diag(2448, 1 /* Error */, "Block_scoped_variable_0_used_before_its_declaration_2448", "Block-scoped variable '{0}' used before its declaration."), - Class_0_used_before_its_declaration: diag(2449, 1 /* Error */, "Class_0_used_before_its_declaration_2449", "Class '{0}' used before its declaration."), - Enum_0_used_before_its_declaration: diag(2450, 1 /* Error */, "Enum_0_used_before_its_declaration_2450", "Enum '{0}' used before its declaration."), - Cannot_redeclare_block_scoped_variable_0: diag(2451, 1 /* Error */, "Cannot_redeclare_block_scoped_variable_0_2451", "Cannot redeclare block-scoped variable '{0}'."), - An_enum_member_cannot_have_a_numeric_name: diag(2452, 1 /* Error */, "An_enum_member_cannot_have_a_numeric_name_2452", "An enum member cannot have a numeric name."), - Variable_0_is_used_before_being_assigned: diag(2454, 1 /* Error */, "Variable_0_is_used_before_being_assigned_2454", "Variable '{0}' is used before being assigned."), - Type_alias_0_circularly_references_itself: diag(2456, 1 /* Error */, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."), - Type_alias_name_cannot_be_0: diag(2457, 1 /* Error */, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."), - An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, 1 /* Error */, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."), - Module_0_declares_1_locally_but_it_is_not_exported: diag(2459, 1 /* Error */, "Module_0_declares_1_locally_but_it_is_not_exported_2459", "Module '{0}' declares '{1}' locally, but it is not exported."), - Module_0_declares_1_locally_but_it_is_exported_as_2: diag(2460, 1 /* Error */, "Module_0_declares_1_locally_but_it_is_exported_as_2_2460", "Module '{0}' declares '{1}' locally, but it is exported as '{2}'."), - Type_0_is_not_an_array_type: diag(2461, 1 /* Error */, "Type_0_is_not_an_array_type_2461", "Type '{0}' is not an array type."), - A_rest_element_must_be_last_in_a_destructuring_pattern: diag(2462, 1 /* Error */, "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", "A rest element must be last in a destructuring pattern."), - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: diag(2463, 1 /* Error */, "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", "A binding pattern parameter cannot be optional in an implementation signature."), - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: diag(2464, 1 /* Error */, "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", "A computed property name must be of type 'string', 'number', 'symbol', or 'any'."), - this_cannot_be_referenced_in_a_computed_property_name: diag(2465, 1 /* Error */, "this_cannot_be_referenced_in_a_computed_property_name_2465", "'this' cannot be referenced in a computed property name."), - super_cannot_be_referenced_in_a_computed_property_name: diag(2466, 1 /* Error */, "super_cannot_be_referenced_in_a_computed_property_name_2466", "'super' cannot be referenced in a computed property name."), - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: diag(2467, 1 /* Error */, "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467", "A computed property name cannot reference a type parameter from its containing type."), - Cannot_find_global_value_0: diag(2468, 1 /* Error */, "Cannot_find_global_value_0_2468", "Cannot find global value '{0}'."), - The_0_operator_cannot_be_applied_to_type_symbol: diag(2469, 1 /* Error */, "The_0_operator_cannot_be_applied_to_type_symbol_2469", "The '{0}' operator cannot be applied to type 'symbol'."), - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, 1 /* Error */, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), - Enum_declarations_must_all_be_const_or_non_const: diag(2473, 1 /* Error */, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), - const_enum_member_initializers_must_be_constant_expressions: diag(2474, 1 /* Error */, "const_enum_member_initializers_must_be_constant_expressions_2474", "const enum member initializers must be constant expressions."), - 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: diag(2475, 1 /* Error */, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'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."), - A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, 1 /* Error */, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, 1 /* Error */, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, 1 /* Error */, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: diag(2480, 1 /* Error */, "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", "'let' is not allowed to be used as a name in 'let' or 'const' declarations."), - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: diag(2481, 1 /* Error */, "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."), - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: diag(2483, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", "The left-hand side of a 'for...of' statement cannot use a type annotation."), - Export_declaration_conflicts_with_exported_declaration_of_0: diag(2484, 1 /* Error */, "Export_declaration_conflicts_with_exported_declaration_of_0_2484", "Export declaration conflicts with exported declaration of '{0}'."), - The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: diag(2487, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", "The left-hand side of a 'for...of' statement must be a variable or a property access."), - Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2488, 1 /* Error */, "Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."), - An_iterator_must_have_a_next_method: diag(2489, 1 /* Error */, "An_iterator_must_have_a_next_method_2489", "An iterator must have a 'next()' method."), - The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property: diag(2490, 1 /* Error */, "The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490", "The type returned by the '{0}()' method of an iterator must have a 'value' property."), - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: diag(2491, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", "The left-hand side of a 'for...in' statement cannot be a destructuring pattern."), - Cannot_redeclare_identifier_0_in_catch_clause: diag(2492, 1 /* Error */, "Cannot_redeclare_identifier_0_in_catch_clause_2492", "Cannot redeclare identifier '{0}' in catch clause."), - Tuple_type_0_of_length_1_has_no_element_at_index_2: diag(2493, 1 /* Error */, "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493", "Tuple type '{0}' of length '{1}' has no element at index '{2}'."), - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: diag(2494, 1 /* Error */, "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."), - Type_0_is_not_an_array_type_or_a_string_type: diag(2495, 1 /* Error */, "Type_0_is_not_an_array_type_or_a_string_type_2495", "Type '{0}' is not an array type or a string type."), - The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression: diag(2496, 1 /* Error */, "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_func_2496", "The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression."), - This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: diag(2497, 1 /* Error */, "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497", "This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."), - Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: diag(2498, 1 /* Error */, "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498", "Module '{0}' uses 'export =' and cannot be used with 'export *'."), - An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2499, 1 /* Error */, "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499", "An interface can only extend an identifier/qualified-name with optional type arguments."), - A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2500, 1 /* Error */, "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500", "A class can only implement an identifier/qualified-name with optional type arguments."), - A_rest_element_cannot_contain_a_binding_pattern: diag(2501, 1 /* Error */, "A_rest_element_cannot_contain_a_binding_pattern_2501", "A rest element cannot contain a binding pattern."), - _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: diag(2502, 1 /* Error */, "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", "'{0}' is referenced directly or indirectly in its own type annotation."), - Cannot_find_namespace_0: diag(2503, 1 /* Error */, "Cannot_find_namespace_0_2503", "Cannot find namespace '{0}'."), - Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: diag(2504, 1 /* Error */, "Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."), - A_generator_cannot_have_a_void_type_annotation: diag(2505, 1 /* Error */, "A_generator_cannot_have_a_void_type_annotation_2505", "A generator cannot have a 'void' type annotation."), - _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, 1 /* Error */, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), - Type_0_is_not_a_constructor_function_type: diag(2507, 1 /* Error */, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), - No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, 1 /* Error */, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), - Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, 1 /* Error */, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), - Base_constructors_must_all_have_the_same_return_type: diag(2510, 1 /* Error */, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), - Cannot_create_an_instance_of_an_abstract_class: diag(2511, 1 /* Error */, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), - Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, 1 /* Error */, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), - Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: diag(2513, 1 /* Error */, "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513", "Abstract method '{0}' in class '{1}' cannot be accessed via super expression."), - A_tuple_type_cannot_be_indexed_with_a_negative_value: diag(2514, 1 /* Error */, "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514", "A tuple type cannot be indexed with a negative value."), - Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, 1 /* Error */, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."), - All_declarations_of_an_abstract_method_must_be_consecutive: diag(2516, 1 /* Error */, "All_declarations_of_an_abstract_method_must_be_consecutive_2516", "All declarations of an abstract method must be consecutive."), - Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: diag(2517, 1 /* Error */, "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", "Cannot assign an abstract constructor type to a non-abstract constructor type."), - A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: diag(2518, 1 /* Error */, "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", "A 'this'-based type guard is not compatible with a parameter-based type guard."), - An_async_iterator_must_have_a_next_method: diag(2519, 1 /* Error */, "An_async_iterator_must_have_a_next_method_2519", "An async iterator must have a 'next()' method."), - Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: diag(2520, 1 /* Error */, "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."), - The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method: diag(2522, 1 /* Error */, "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_sta_2522", "The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method."), - yield_expressions_cannot_be_used_in_a_parameter_initializer: diag(2523, 1 /* Error */, "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523", "'yield' expressions cannot be used in a parameter initializer."), - await_expressions_cannot_be_used_in_a_parameter_initializer: diag(2524, 1 /* Error */, "await_expressions_cannot_be_used_in_a_parameter_initializer_2524", "'await' expressions cannot be used in a parameter initializer."), - A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: diag(2526, 1 /* Error */, "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", "A 'this' type is available only in a non-static member of a class or interface."), - The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary: diag(2527, 1 /* Error */, "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527", "The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."), - A_module_cannot_have_multiple_default_exports: diag(2528, 1 /* Error */, "A_module_cannot_have_multiple_default_exports_2528", "A module cannot have multiple default exports."), - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: diag(2529, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."), - Property_0_is_incompatible_with_index_signature: diag(2530, 1 /* Error */, "Property_0_is_incompatible_with_index_signature_2530", "Property '{0}' is incompatible with index signature."), - Object_is_possibly_null: diag(2531, 1 /* Error */, "Object_is_possibly_null_2531", "Object is possibly 'null'."), - Object_is_possibly_undefined: diag(2532, 1 /* Error */, "Object_is_possibly_undefined_2532", "Object is possibly 'undefined'."), - Object_is_possibly_null_or_undefined: diag(2533, 1 /* Error */, "Object_is_possibly_null_or_undefined_2533", "Object is possibly 'null' or 'undefined'."), - A_function_returning_never_cannot_have_a_reachable_end_point: diag(2534, 1 /* Error */, "A_function_returning_never_cannot_have_a_reachable_end_point_2534", "A function returning 'never' cannot have a reachable end point."), - Type_0_cannot_be_used_to_index_type_1: diag(2536, 1 /* Error */, "Type_0_cannot_be_used_to_index_type_1_2536", "Type '{0}' cannot be used to index type '{1}'."), - Type_0_has_no_matching_index_signature_for_type_1: diag(2537, 1 /* Error */, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), - Type_0_cannot_be_used_as_an_index_type: diag(2538, 1 /* Error */, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), - Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, 1 /* Error */, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), - Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), - Index_signature_in_type_0_only_permits_reading: diag(2542, 1 /* Error */, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), - Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, 1 /* Error */, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), - Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: diag(2544, 1 /* Error */, "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."), - A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: diag(2545, 1 /* Error */, "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", "A mixin class must have a constructor with a single rest parameter of type 'any[]'."), - The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, 1 /* Error */, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), - Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, 1 /* Error */, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, 1 /* Error */, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."), - Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), - Cannot_find_name_0_Did_you_mean_1: diag(2552, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), - Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, 1 /* Error */, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), - Expected_0_arguments_but_got_1: diag(2554, 1 /* Error */, "Expected_0_arguments_but_got_1_2554", "Expected {0} arguments, but got {1}."), - Expected_at_least_0_arguments_but_got_1: diag(2555, 1 /* Error */, "Expected_at_least_0_arguments_but_got_1_2555", "Expected at least {0} arguments, but got {1}."), - A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter: diag(2556, 1 /* Error */, "A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556", "A spread argument must either have a tuple type or be passed to a rest parameter."), - Expected_0_type_arguments_but_got_1: diag(2558, 1 /* Error */, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), - Type_0_has_no_properties_in_common_with_type_1: diag(2559, 1 /* Error */, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), - Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, 1 /* Error */, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), - Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2: diag(2561, 1 /* Error */, "Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561", "Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"), - Base_class_expressions_cannot_reference_class_type_parameters: diag(2562, 1 /* Error */, "Base_class_expressions_cannot_reference_class_type_parameters_2562", "Base class expressions cannot reference class type parameters."), - The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, 1 /* Error */, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), - Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, 1 /* Error */, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), - Property_0_is_used_before_being_assigned: diag(2565, 1 /* Error */, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), - A_rest_element_cannot_have_a_property_name: diag(2566, 1 /* Error */, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), - Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, 1 /* Error */, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), - Property_0_may_not_exist_on_type_1_Did_you_mean_2: diag(2568, 1 /* Error */, "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568", "Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"), - Could_not_find_name_0_Did_you_mean_1: diag(2570, 1 /* Error */, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"), - Object_is_of_type_unknown: diag(2571, 1 /* Error */, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."), - A_rest_element_type_must_be_an_array_type: diag(2574, 1 /* Error */, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), - No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, 1 /* Error */, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), - Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead: diag(2576, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576", "Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"), - Return_type_annotation_circularly_references_itself: diag(2577, 1 /* Error */, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), - Unused_ts_expect_error_directive: diag(2578, 1 /* Error */, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), - 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: diag(2582, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."), - _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: diag(2585, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{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."), - Cannot_assign_to_0_because_it_is_a_constant: diag(2588, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), - Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, 1 /* Error */, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), - Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, 1 /* Error */, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), - 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: diag(2591, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."), - 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: diag(2592, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."), - 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: diag(2593, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."), - This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, 1 /* Error */, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."), - _0_can_only_be_imported_by_using_a_default_import: diag(2595, 1 /* Error */, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), - _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, 1 /* Error */, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), - _0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, 1 /* Error */, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."), - _0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2598, 1 /* Error */, "_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598", "'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."), - JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, 1 /* Error */, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), - Property_0_in_type_1_is_not_assignable_to_type_2: diag(2603, 1 /* Error */, "Property_0_in_type_1_is_not_assignable_to_type_2_2603", "Property '{0}' in type '{1}' is not assignable to type '{2}'."), - JSX_element_type_0_does_not_have_any_construct_or_call_signatures: diag(2604, 1 /* Error */, "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", "JSX element type '{0}' does not have any construct or call signatures."), - Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: diag(2606, 1 /* Error */, "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", "Property '{0}' of JSX spread attribute is not assignable to target property."), - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: diag(2607, 1 /* Error */, "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", "JSX element class does not support attributes because it does not have a '{0}' property."), - The_global_type_JSX_0_may_not_have_more_than_one_property: diag(2608, 1 /* Error */, "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", "The global type 'JSX.{0}' may not have more than one property."), - JSX_spread_child_must_be_an_array_type: diag(2609, 1 /* Error */, "JSX_spread_child_must_be_an_array_type_2609", "JSX spread child must be an array type."), - _0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property: diag(2610, 1 /* Error */, "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610", "'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."), - _0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor: diag(2611, 1 /* Error */, "_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611", "'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."), - 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: diag(2612, 1 /* Error */, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "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."), - Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, 1 /* Error */, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"), - Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, 1 /* Error */, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"), - Type_of_property_0_circularly_references_itself_in_mapped_type_1: diag(2615, 1 /* Error */, "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615", "Type of property '{0}' circularly references itself in mapped type '{1}'."), - _0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import: diag(2616, 1 /* Error */, "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616", "'{0}' can only be imported by using 'import {1} = require({2})' or a default import."), - _0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2617, 1 /* Error */, "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617", "'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."), - Source_has_0_element_s_but_target_requires_1: diag(2618, 1 /* Error */, "Source_has_0_element_s_but_target_requires_1_2618", "Source has {0} element(s) but target requires {1}."), - Source_has_0_element_s_but_target_allows_only_1: diag(2619, 1 /* Error */, "Source_has_0_element_s_but_target_allows_only_1_2619", "Source has {0} element(s) but target allows only {1}."), - Target_requires_0_element_s_but_source_may_have_fewer: diag(2620, 1 /* Error */, "Target_requires_0_element_s_but_source_may_have_fewer_2620", "Target requires {0} element(s) but source may have fewer."), - Target_allows_only_0_element_s_but_source_may_have_more: diag(2621, 1 /* Error */, "Target_allows_only_0_element_s_but_source_may_have_more_2621", "Target allows only {0} element(s) but source may have more."), - Source_provides_no_match_for_required_element_at_position_0_in_target: diag(2623, 1 /* Error */, "Source_provides_no_match_for_required_element_at_position_0_in_target_2623", "Source provides no match for required element at position {0} in target."), - Source_provides_no_match_for_variadic_element_at_position_0_in_target: diag(2624, 1 /* Error */, "Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624", "Source provides no match for variadic element at position {0} in target."), - Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target: diag(2625, 1 /* Error */, "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625", "Variadic element at position {0} in source does not match element at position {1} in target."), - Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target: diag(2626, 1 /* Error */, "Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626", "Type at position {0} in source is not compatible with type at position {1} in target."), - Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target: diag(2627, 1 /* Error */, "Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627", "Type at positions {0} through {1} in source is not compatible with type at position {2} in target."), - Cannot_assign_to_0_because_it_is_an_enum: diag(2628, 1 /* Error */, "Cannot_assign_to_0_because_it_is_an_enum_2628", "Cannot assign to '{0}' because it is an enum."), - Cannot_assign_to_0_because_it_is_a_class: diag(2629, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_class_2629", "Cannot assign to '{0}' because it is a class."), - Cannot_assign_to_0_because_it_is_a_function: diag(2630, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_function_2630", "Cannot assign to '{0}' because it is a function."), - Cannot_assign_to_0_because_it_is_a_namespace: diag(2631, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_namespace_2631", "Cannot assign to '{0}' because it is a namespace."), - Cannot_assign_to_0_because_it_is_an_import: diag(2632, 1 /* Error */, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."), - JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, 1 /* Error */, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"), - _0_index_signatures_are_incompatible: diag(2634, 1 /* Error */, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."), - Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, 1 /* Error */, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."), - Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: diag(2636, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."), - Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: diag(2637, 1 /* Error */, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."), - Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, 1 /* Error */, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."), - React_components_cannot_include_JSX_namespace_names: diag(2639, 1 /* Error */, "React_components_cannot_include_JSX_namespace_names_2639", "React components cannot include JSX namespace names"), - Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, 1 /* Error */, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."), - Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more: diag(2650, 1 /* Error */, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650", "Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."), - A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, 1 /* Error */, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."), - Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, 1 /* Error */, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."), - Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: diag(2653, 1 /* Error */, "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."), - Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2: diag(2654, 1 /* Error */, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."), - Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more: diag(2655, 1 /* Error */, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."), - Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1: diag(2656, 1 /* Error */, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656", "Non-abstract class expression is missing implementations for the following members of '{0}': {1}."), - JSX_expressions_must_have_one_parent_element: diag(2657, 1 /* Error */, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."), - Type_0_provides_no_match_for_the_signature_1: diag(2658, 1 /* Error */, "Type_0_provides_no_match_for_the_signature_1_2658", "Type '{0}' provides no match for the signature '{1}'."), - super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: diag(2659, 1 /* Error */, "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."), - super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: diag(2660, 1 /* Error */, "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", "'super' can only be referenced in members of derived classes or object literal expressions."), - Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: diag(2661, 1 /* Error */, "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", "Cannot export '{0}'. Only local declarations can be exported from a module."), - Cannot_find_name_0_Did_you_mean_the_static_member_1_0: diag(2662, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"), - Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: diag(2663, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"), - Invalid_module_name_in_augmentation_module_0_cannot_be_found: diag(2664, 1 /* Error */, "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", "Invalid module name in augmentation, module '{0}' cannot be found."), - Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: diag(2665, 1 /* Error */, "Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665", "Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."), - Exports_and_export_assignments_are_not_permitted_in_module_augmentations: diag(2666, 1 /* Error */, "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", "Exports and export assignments are not permitted in module augmentations."), - Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: diag(2667, 1 /* Error */, "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."), - export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: diag(2668, 1 /* Error */, "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."), - Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: diag(2669, 1 /* Error */, "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."), - Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: diag(2670, 1 /* Error */, "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."), - Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: diag(2671, 1 /* Error */, "Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671", "Cannot augment module '{0}' because it resolves to a non-module entity."), - Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: diag(2672, 1 /* Error */, "Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672", "Cannot assign a '{0}' constructor type to a '{1}' constructor type."), - Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: diag(2673, 1 /* Error */, "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673", "Constructor of class '{0}' is private and only accessible within the class declaration."), - Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: diag(2674, 1 /* Error */, "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674", "Constructor of class '{0}' is protected and only accessible within the class declaration."), - Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: diag(2675, 1 /* Error */, "Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675", "Cannot extend a class '{0}'. Class constructor is marked as private."), - Accessors_must_both_be_abstract_or_non_abstract: diag(2676, 1 /* Error */, "Accessors_must_both_be_abstract_or_non_abstract_2676", "Accessors must both be abstract or non-abstract."), - A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: diag(2677, 1 /* Error */, "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677", "A type predicate's type must be assignable to its parameter's type."), - Type_0_is_not_comparable_to_type_1: diag(2678, 1 /* Error */, "Type_0_is_not_comparable_to_type_1_2678", "Type '{0}' is not comparable to type '{1}'."), - A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: diag(2679, 1 /* Error */, "A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679", "A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."), - A_0_parameter_must_be_the_first_parameter: diag(2680, 1 /* Error */, "A_0_parameter_must_be_the_first_parameter_2680", "A '{0}' parameter must be the first parameter."), - A_constructor_cannot_have_a_this_parameter: diag(2681, 1 /* Error */, "A_constructor_cannot_have_a_this_parameter_2681", "A constructor cannot have a 'this' parameter."), - this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: diag(2683, 1 /* Error */, "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", "'this' implicitly has type 'any' because it does not have a type annotation."), - The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: diag(2684, 1 /* Error */, "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."), - The_this_types_of_each_signature_are_incompatible: diag(2685, 1 /* Error */, "The_this_types_of_each_signature_are_incompatible_2685", "The 'this' types of each signature are incompatible."), - _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: diag(2686, 1 /* Error */, "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686", "'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."), - All_declarations_of_0_must_have_identical_modifiers: diag(2687, 1 /* Error */, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), - Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), - Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), - _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), - Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), - Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag( - 2695, - 1 /* Error */, - "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", - "Left side of comma operator is unused and has no side effects.", - /*reportsUnnecessary*/ - true - ), - The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, 1 /* Error */, "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"), - An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, 1 /* Error */, "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), - Spread_types_may_only_be_created_from_object_types: diag(2698, 1 /* Error */, "Spread_types_may_only_be_created_from_object_types_2698", "Spread types may only be created from object types."), - Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: diag(2699, 1 /* Error */, "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."), - Rest_types_may_only_be_created_from_object_types: diag(2700, 1 /* Error */, "Rest_types_may_only_be_created_from_object_types_2700", "Rest types may only be created from object types."), - The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: diag(2701, 1 /* Error */, "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", "The target of an object rest assignment must be a variable or a property access."), - _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: diag(2702, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", "'{0}' only refers to a type, but is being used as a namespace here."), - The_operand_of_a_delete_operator_must_be_a_property_reference: diag(2703, 1 /* Error */, "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", "The operand of a 'delete' operator must be a property reference."), - The_operand_of_a_delete_operator_cannot_be_a_read_only_property: diag(2704, 1 /* Error */, "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", "The operand of a 'delete' operator cannot be a read-only property."), - An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, 1 /* Error */, "An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_2705", "An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), - Required_type_parameters_may_not_follow_optional_type_parameters: diag(2706, 1 /* Error */, "Required_type_parameters_may_not_follow_optional_type_parameters_2706", "Required type parameters may not follow optional type parameters."), - Generic_type_0_requires_between_1_and_2_type_arguments: diag(2707, 1 /* Error */, "Generic_type_0_requires_between_1_and_2_type_arguments_2707", "Generic type '{0}' requires between {1} and {2} type arguments."), - Cannot_use_namespace_0_as_a_value: diag(2708, 1 /* Error */, "Cannot_use_namespace_0_as_a_value_2708", "Cannot use namespace '{0}' as a value."), - Cannot_use_namespace_0_as_a_type: diag(2709, 1 /* Error */, "Cannot_use_namespace_0_as_a_type_2709", "Cannot use namespace '{0}' as a type."), - _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: diag(2710, 1 /* Error */, "_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710", "'{0}' are specified twice. The attribute named '{0}' will be overwritten."), - A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2711, 1 /* Error */, "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711", "A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), - A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2712, 1 /* Error */, "A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_t_2712", "A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), - 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: diag(2713, 1 /* Error */, "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713", `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}"]'?`), - The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context: diag(2714, 1 /* Error */, "The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714", "The expression of an export assignment must be an identifier or qualified name in an ambient context."), - Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: diag(2715, 1 /* Error */, "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715", "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."), - Type_parameter_0_has_a_circular_default: diag(2716, 1 /* Error */, "Type_parameter_0_has_a_circular_default_2716", "Type parameter '{0}' has a circular default."), - Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, 1 /* Error */, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), - Duplicate_property_0: diag(2718, 1 /* Error */, "Duplicate_property_0_2718", "Duplicate property '{0}'."), - Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), - Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, 1 /* Error */, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), - Cannot_invoke_an_object_which_is_possibly_null: diag(2721, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), - Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), - Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), - _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, 1 /* Error */, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), - Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 and above with module {0}."), - Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), - Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1 /* Error */, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), - _0_is_declared_here: diag(2728, 3 /* Message */, "_0_is_declared_here_2728", "'{0}' is declared here."), - Property_0_is_used_before_its_initialization: diag(2729, 1 /* Error */, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), - An_arrow_function_cannot_have_a_this_parameter: diag(2730, 1 /* Error */, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), - Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, 1 /* Error */, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), - Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, 1 /* Error */, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), - Property_0_was_also_declared_here: diag(2733, 1 /* Error */, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), - Are_you_missing_a_semicolon: diag(2734, 1 /* Error */, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), - Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, 1 /* Error */, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), - Operator_0_cannot_be_applied_to_type_1: diag(2736, 1 /* Error */, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."), - BigInt_literals_are_not_available_when_targeting_lower_than_ES2020: diag(2737, 1 /* Error */, "BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737", "BigInt literals are not available when targeting lower than ES2020."), - An_outer_value_of_this_is_shadowed_by_this_container: diag(2738, 3 /* Message */, "An_outer_value_of_this_is_shadowed_by_this_container_2738", "An outer value of 'this' is shadowed by this container."), - Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, 1 /* Error */, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), - Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, 1 /* Error */, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), - Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, 1 /* Error */, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), - The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, 1 /* Error */, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), - No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: diag(2743, 1 /* Error */, "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743", "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."), - Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: diag(2744, 1 /* Error */, "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744", "Type parameter defaults can only reference previously declared type parameters."), - This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), - This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), - _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), - Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."), - _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), - The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), - Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), - The_first_export_default_is_here: diag(2752, 1 /* Error */, "The_first_export_default_is_here_2752", "The first export default is here."), - Another_export_default_is_here: diag(2753, 1 /* Error */, "Another_export_default_is_here_2753", "Another export default is here."), - super_may_not_use_type_arguments: diag(2754, 1 /* Error */, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."), - No_constituent_of_type_0_is_callable: diag(2755, 1 /* Error */, "No_constituent_of_type_0_is_callable_2755", "No constituent of type '{0}' is callable."), - Not_all_constituents_of_type_0_are_callable: diag(2756, 1 /* Error */, "Not_all_constituents_of_type_0_are_callable_2756", "Not all constituents of type '{0}' are callable."), - Type_0_has_no_call_signatures: diag(2757, 1 /* Error */, "Type_0_has_no_call_signatures_2757", "Type '{0}' has no call signatures."), - Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2758, 1 /* Error */, "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758", "Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."), - No_constituent_of_type_0_is_constructable: diag(2759, 1 /* Error */, "No_constituent_of_type_0_is_constructable_2759", "No constituent of type '{0}' is constructable."), - Not_all_constituents_of_type_0_are_constructable: diag(2760, 1 /* Error */, "Not_all_constituents_of_type_0_are_constructable_2760", "Not all constituents of type '{0}' are constructable."), - Type_0_has_no_construct_signatures: diag(2761, 1 /* Error */, "Type_0_has_no_construct_signatures_2761", "Type '{0}' has no construct signatures."), - Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2762, 1 /* Error */, "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762", "Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."), - Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0: diag(2763, 1 /* Error */, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."), - Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0: diag(2764, 1 /* Error */, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."), - Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0: diag(2765, 1 /* Error */, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."), - Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0: diag(2766, 1 /* Error */, "Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766", "Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."), - The_0_property_of_an_iterator_must_be_a_method: diag(2767, 1 /* Error */, "The_0_property_of_an_iterator_must_be_a_method_2767", "The '{0}' property of an iterator must be a method."), - The_0_property_of_an_async_iterator_must_be_a_method: diag(2768, 1 /* Error */, "The_0_property_of_an_async_iterator_must_be_a_method_2768", "The '{0}' property of an async iterator must be a method."), - No_overload_matches_this_call: diag(2769, 1 /* Error */, "No_overload_matches_this_call_2769", "No overload matches this call."), - The_last_overload_gave_the_following_error: diag(2770, 1 /* Error */, "The_last_overload_gave_the_following_error_2770", "The last overload gave the following error."), - The_last_overload_is_declared_here: diag(2771, 1 /* Error */, "The_last_overload_is_declared_here_2771", "The last overload is declared here."), - Overload_0_of_1_2_gave_the_following_error: diag(2772, 1 /* Error */, "Overload_0_of_1_2_gave_the_following_error_2772", "Overload {0} of {1}, '{2}', gave the following error."), - Did_you_forget_to_use_await: diag(2773, 1 /* Error */, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"), - This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, 1 /* Error */, "This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774", "This condition will always return true since this function is always defined. Did you mean to call it instead?"), - Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation: diag(2775, 1 /* Error */, "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775", "Assertions require every name in the call target to be declared with an explicit type annotation."), - Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name: diag(2776, 1 /* Error */, "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776", "Assertions require the call target to be an identifier or qualified name."), - The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access: diag(2777, 1 /* Error */, "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777", "The operand of an increment or decrement operator may not be an optional property access."), - The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access: diag(2778, 1 /* Error */, "The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778", "The target of an object rest assignment may not be an optional property access."), - The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access: diag(2779, 1 /* Error */, "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779", "The left-hand side of an assignment expression may not be an optional property access."), - The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access: diag(2780, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780", "The left-hand side of a 'for...in' statement may not be an optional property access."), - The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), - _0_needs_an_explicit_type_annotation: diag(2782, 3 /* Message */, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), - _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, 1 /* Error */, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), - get_and_set_accessors_cannot_declare_this_parameters: diag(2784, 1 /* Error */, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), - This_spread_always_overwrites_this_property: diag(2785, 1 /* Error */, "This_spread_always_overwrites_this_property_2785", "This spread always overwrites this property."), - _0_cannot_be_used_as_a_JSX_component: diag(2786, 1 /* Error */, "_0_cannot_be_used_as_a_JSX_component_2786", "'{0}' cannot be used as a JSX component."), - Its_return_type_0_is_not_a_valid_JSX_element: diag(2787, 1 /* Error */, "Its_return_type_0_is_not_a_valid_JSX_element_2787", "Its return type '{0}' is not a valid JSX element."), - Its_instance_type_0_is_not_a_valid_JSX_element: diag(2788, 1 /* Error */, "Its_instance_type_0_is_not_a_valid_JSX_element_2788", "Its instance type '{0}' is not a valid JSX element."), - Its_element_type_0_is_not_a_valid_JSX_element: diag(2789, 1 /* Error */, "Its_element_type_0_is_not_a_valid_JSX_element_2789", "Its element type '{0}' is not a valid JSX element."), - The_operand_of_a_delete_operator_must_be_optional: diag(2790, 1 /* Error */, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), - Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, 1 /* Error */, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), - Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option: diag(2792, 1 /* Error */, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"), - The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, 1 /* Error */, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), - Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, 1 /* Error */, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), - The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, 1 /* Error */, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), - It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, 1 /* Error */, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), - A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract: diag(2797, 1 /* Error */, "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797", "A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."), - The_declaration_was_marked_as_deprecated_here: diag(2798, 1 /* Error */, "The_declaration_was_marked_as_deprecated_here_2798", "The declaration was marked as deprecated here."), - Type_produces_a_tuple_type_that_is_too_large_to_represent: diag(2799, 1 /* Error */, "Type_produces_a_tuple_type_that_is_too_large_to_represent_2799", "Type produces a tuple type that is too large to represent."), - Expression_produces_a_tuple_type_that_is_too_large_to_represent: diag(2800, 1 /* Error */, "Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800", "Expression produces a tuple type that is too large to represent."), - This_condition_will_always_return_true_since_this_0_is_always_defined: diag(2801, 1 /* Error */, "This_condition_will_always_return_true_since_this_0_is_always_defined_2801", "This condition will always return true since this '{0}' is always defined."), - Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher: diag(2802, 1 /* Error */, "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802", "Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."), - Cannot_assign_to_private_method_0_Private_methods_are_not_writable: diag(2803, 1 /* Error */, "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803", "Cannot assign to private method '{0}'. Private methods are not writable."), - Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name: diag(2804, 1 /* Error */, "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804", "Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."), - Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), - 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: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "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}'."), - A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), - Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."), - Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), - Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), - Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), - Class_declaration_cannot_implement_overload_list_for_0: diag(2813, 1 /* Error */, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."), - Function_with_bodies_can_only_merge_with_classes_that_are_ambient: diag(2814, 1 /* Error */, "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814", "Function with bodies can only merge with classes that are ambient."), - arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks: diag(2815, 1 /* Error */, "arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815", "'arguments' cannot be referenced in property initializers or class static initialization blocks."), - Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class: diag(2816, 1 /* Error */, "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816", "Cannot use 'this' in a static property initializer of a decorated class."), - Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, 1 /* Error */, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."), - 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_node18_node20_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', '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_node18_node20_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', '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_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_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."), - This_condition_will_always_return_0: diag(2845, 1 /* Error */, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."), - 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_node18_node20_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', 'node18', 'node20', '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."), - Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish: diag(2869, 1 /* Error */, "Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869", "Right operand of ?? is unreachable because the left operand is never nullish."), - This_binary_expression_is_never_nullish_Are_you_missing_parentheses: diag(2870, 1 /* Error */, "This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870", "This binary expression is never nullish. Are you missing parentheses?"), - This_expression_is_always_nullish: diag(2871, 1 /* Error */, "This_expression_is_always_nullish_2871", "This expression is always nullish."), - This_kind_of_expression_is_always_truthy: diag(2872, 1 /* Error */, "This_kind_of_expression_is_always_truthy_2872", "This kind of expression is always truthy."), - This_kind_of_expression_is_always_falsy: diag(2873, 1 /* Error */, "This_kind_of_expression_is_always_falsy_2873", "This kind of expression is always falsy."), - This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found: diag(2874, 1 /* Error */, "This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found_2874", "This JSX tag requires '{0}' to be in scope, but it could not be found."), - This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed: diag(2875, 1 /* Error */, "This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_fo_2875", "This JSX tag requires the module path '{0}' to exist, but none could be found. Make sure you have types for the appropriate package installed."), - This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0: diag(2876, 1 /* Error */, "This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876", 'This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "{0}".'), - This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1 /* Error */, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."), - This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."), - Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."), - Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."), - This_expression_is_never_nullish: diag(2881, 1 /* Error */, "This_expression_is_never_nullish_2881", "This expression is never nullish."), - 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}'."), - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4006, 1 /* Error */, "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006", "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4008, 1 /* Error */, "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008", "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4010, 1 /* Error */, "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010", "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."), - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4012, 1 /* Error */, "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012", "Type parameter '{0}' of public method from exported class has or is using private name '{1}'."), - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4014, 1 /* Error */, "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", "Type parameter '{0}' of method from exported interface has or is using private name '{1}'."), - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4016, 1 /* Error */, "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", "Type parameter '{0}' of exported function has or is using private name '{1}'."), - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4019, 1 /* Error */, "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", "Implements clause of exported class '{0}' has or is using private name '{1}'."), - extends_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4020, 1 /* Error */, "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", "'extends' clause of exported class '{0}' has or is using private name '{1}'."), - extends_clause_of_exported_class_has_or_is_using_private_name_0: diag(4021, 1 /* Error */, "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021", "'extends' clause of exported class has or is using private name '{0}'."), - extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: diag(4022, 1 /* Error */, "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", "'extends' clause of exported interface '{0}' has or is using private name '{1}'."), - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4023, 1 /* Error */, "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."), - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: diag(4024, 1 /* Error */, "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", "Exported variable '{0}' has or is using name '{1}' from private module '{2}'."), - Exported_variable_0_has_or_is_using_private_name_1: diag(4025, 1 /* Error */, "Exported_variable_0_has_or_is_using_private_name_1_4025", "Exported variable '{0}' has or is using private name '{1}'."), - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4026, 1 /* Error */, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026", "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4027, 1 /* Error */, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027", "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4028, 1 /* Error */, "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028", "Public static property '{0}' of exported class has or is using private name '{1}'."), - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4029, 1 /* Error */, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029", "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4030, 1 /* Error */, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030", "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), - Public_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4031, 1 /* Error */, "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031", "Public property '{0}' of exported class has or is using private name '{1}'."), - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4032, 1 /* Error */, "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032", "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), - Property_0_of_exported_interface_has_or_is_using_private_name_1: diag(4033, 1 /* Error */, "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033", "Property '{0}' of exported interface has or is using private name '{1}'."), - Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4034, 1 /* Error */, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034", "Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), - Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4035, 1 /* Error */, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035", "Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."), - Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4036, 1 /* Error */, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036", "Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), - Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4037, 1 /* Error */, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037", "Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."), - Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4038, 1 /* Error */, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), - Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4039, 1 /* Error */, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), - Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4040, 1 /* Error */, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040", "Return type of public static getter '{0}' from exported class has or is using private name '{1}'."), - Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4041, 1 /* Error */, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041", "Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), - Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4042, 1 /* Error */, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042", "Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), - Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4043, 1 /* Error */, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043", "Return type of public getter '{0}' from exported class has or is using private name '{1}'."), - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4044, 1 /* Error */, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044", "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."), - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4045, 1 /* Error */, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045", "Return type of constructor signature from exported interface has or is using private name '{0}'."), - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4046, 1 /* Error */, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046", "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."), - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4047, 1 /* Error */, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047", "Return type of call signature from exported interface has or is using private name '{0}'."), - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4048, 1 /* Error */, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048", "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."), - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4049, 1 /* Error */, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049", "Return type of index signature from exported interface has or is using private name '{0}'."), - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4050, 1 /* Error */, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050", "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."), - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4051, 1 /* Error */, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051", "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."), - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: diag(4052, 1 /* Error */, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052", "Return type of public static method from exported class has or is using private name '{0}'."), - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4053, 1 /* Error */, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053", "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."), - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4054, 1 /* Error */, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054", "Return type of public method from exported class has or is using name '{0}' from private module '{1}'."), - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: diag(4055, 1 /* Error */, "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055", "Return type of public method from exported class has or is using private name '{0}'."), - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4056, 1 /* Error */, "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056", "Return type of method from exported interface has or is using name '{0}' from private module '{1}'."), - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: diag(4057, 1 /* Error */, "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057", "Return type of method from exported interface has or is using private name '{0}'."), - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4058, 1 /* Error */, "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058", "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."), - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: diag(4059, 1 /* Error */, "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059", "Return type of exported function has or is using name '{0}' from private module '{1}'."), - Return_type_of_exported_function_has_or_is_using_private_name_0: diag(4060, 1 /* Error */, "Return_type_of_exported_function_has_or_is_using_private_name_0_4060", "Return type of exported function has or is using private name '{0}'."), - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4061, 1 /* Error */, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."), - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4062, 1 /* Error */, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: diag(4063, 1 /* Error */, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063", "Parameter '{0}' of constructor from exported class has or is using private name '{1}'."), - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4064, 1 /* Error */, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064", "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4065, 1 /* Error */, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065", "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4066, 1 /* Error */, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066", "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4067, 1 /* Error */, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067", "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4068, 1 /* Error */, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."), - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4069, 1 /* Error */, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4070, 1 /* Error */, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070", "Parameter '{0}' of public static method from exported class has or is using private name '{1}'."), - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4071, 1 /* Error */, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071", "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."), - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4072, 1 /* Error */, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072", "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4073, 1 /* Error */, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073", "Parameter '{0}' of public method from exported class has or is using private name '{1}'."), - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4074, 1 /* Error */, "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074", "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4075, 1 /* Error */, "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075", "Parameter '{0}' of method from exported interface has or is using private name '{1}'."), - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4076, 1 /* Error */, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076", "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."), - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: diag(4077, 1 /* Error */, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077", "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4078, 1 /* Error */, "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078", "Parameter '{0}' of exported function has or is using private name '{1}'."), - Exported_type_alias_0_has_or_is_using_private_name_1: diag(4081, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_4081", "Exported type alias '{0}' has or is using private name '{1}'."), - Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."), - Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."), - Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."), - Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."), - Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."), - Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected: diag(4094, 1 /* Error */, "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", "Property '{0}' of exported anonymous class type may not be private or protected."), - Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4095, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095", "Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), - Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4096, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096", "Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), - Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4097, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097", "Public static method '{0}' of exported class has or is using private name '{1}'."), - Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4098, 1 /* Error */, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098", "Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), - Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4099, 1 /* Error */, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099", "Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), - Public_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4100, 1 /* Error */, "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100", "Public method '{0}' of exported class has or is using private name '{1}'."), - Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4101, 1 /* Error */, "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101", "Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), - Method_0_of_exported_interface_has_or_is_using_private_name_1: diag(4102, 1 /* Error */, "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102", "Method '{0}' of exported interface has or is using private name '{1}'."), - Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: diag(4103, 1 /* Error */, "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103", "Type parameter '{0}' of exported mapped object type is using private name '{1}'."), - The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1: diag(4104, 1 /* Error */, "The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104", "The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."), - Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter: diag(4105, 1 /* Error */, "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105", "Private or protected member '{0}' cannot be accessed on a type parameter."), - Parameter_0_of_accessor_has_or_is_using_private_name_1: diag(4106, 1 /* Error */, "Parameter_0_of_accessor_has_or_is_using_private_name_1_4106", "Parameter '{0}' of accessor has or is using private name '{1}'."), - Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2: diag(4107, 1 /* Error */, "Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107", "Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."), - Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4108, 1 /* Error */, "Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108", "Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."), - Type_arguments_for_0_circularly_reference_themselves: diag(4109, 1 /* Error */, "Type_arguments_for_0_circularly_reference_themselves_4109", "Type arguments for '{0}' circularly reference themselves."), - Tuple_type_arguments_circularly_reference_themselves: diag(4110, 1 /* Error */, "Tuple_type_arguments_circularly_reference_themselves_4110", "Tuple type arguments circularly reference themselves."), - Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0: diag(4111, 1 /* Error */, "Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111", "Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."), - This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class: diag(4112, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112", "This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."), - This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0: diag(4113, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."), - This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0: diag(4114, 1 /* Error */, "This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114", "This member must have an 'override' modifier because it overrides a member in the base class '{0}'."), - This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0: diag(4115, 1 /* Error */, "This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115", "This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."), - This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: diag(4116, 1 /* Error */, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."), - This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4117, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"), - The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: diag(4118, 1 /* Error */, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."), - This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4119, 1 /* Error */, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), - This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4120, 1 /* Error */, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), - This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."), - This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."), - This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"), - Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), - Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."), - One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."), - This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."), - This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."), - 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}'."), - Cannot_read_file_0_Colon_1: diag(5012, 1 /* Error */, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), - Unknown_compiler_option_0: diag(5023, 1 /* Error */, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), - Compiler_option_0_requires_a_value_of_type_1: diag(5024, 1 /* Error */, "Compiler_option_0_requires_a_value_of_type_1_5024", "Compiler option '{0}' requires a value of type {1}."), - Unknown_compiler_option_0_Did_you_mean_1: diag(5025, 1 /* Error */, "Unknown_compiler_option_0_Did_you_mean_1_5025", "Unknown compiler option '{0}'. Did you mean '{1}'?"), - Could_not_write_file_0_Colon_1: diag(5033, 1 /* Error */, "Could_not_write_file_0_Colon_1_5033", "Could not write file '{0}': {1}."), - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: diag(5042, 1 /* Error */, "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", "Option 'project' cannot be mixed with source files on a command line."), - Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: diag(5047, 1 /* Error */, "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."), - Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: diag(5051, 1 /* Error */, "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."), - Option_0_cannot_be_specified_without_specifying_option_1: diag(5052, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_5052", "Option '{0}' cannot be specified without specifying option '{1}'."), - Option_0_cannot_be_specified_with_option_1: diag(5053, 1 /* Error */, "Option_0_cannot_be_specified_with_option_1_5053", "Option '{0}' cannot be specified with option '{1}'."), - A_tsconfig_json_file_is_already_defined_at_Colon_0: diag(5054, 1 /* Error */, "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", "A 'tsconfig.json' file is already defined at: '{0}'."), - Cannot_write_file_0_because_it_would_overwrite_input_file: diag(5055, 1 /* Error */, "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", "Cannot write file '{0}' because it would overwrite input file."), - Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: diag(5056, 1 /* Error */, "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", "Cannot write file '{0}' because it would be overwritten by multiple input files."), - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, 1 /* Error */, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), - The_specified_path_does_not_exist_Colon_0: diag(5058, 1 /* Error */, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), - Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, 1 /* Error */, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), - Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, 1 /* Error */, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), - Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, 1 /* Error */, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), - Substitutions_for_pattern_0_should_be_an_array: diag(5063, 1 /* Error */, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), - Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, 1 /* Error */, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."), - File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, 1 /* Error */, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."), - Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: diag(5066, 1 /* Error */, "Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066", "Substitutions for pattern '{0}' shouldn't be an empty array."), - Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(5067, 1 /* Error */, "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067", "Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."), - 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_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."), - _0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2: diag(5075, 1 /* Error */, "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."), - _0_and_1_operations_cannot_be_mixed_without_parentheses: diag(5076, 1 /* Error */, "_0_and_1_operations_cannot_be_mixed_without_parentheses_5076", "'{0}' and '{1}' operations cannot be mixed without parentheses."), - Unknown_build_option_0_Did_you_mean_1: diag(5077, 1 /* Error */, "Unknown_build_option_0_Did_you_mean_1_5077", "Unknown build option '{0}'. Did you mean '{1}'?"), - Unknown_watch_option_0: diag(5078, 1 /* Error */, "Unknown_watch_option_0_5078", "Unknown watch option '{0}'."), - Unknown_watch_option_0_Did_you_mean_1: diag(5079, 1 /* Error */, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), - Watch_option_0_requires_a_value_of_type_1: diag(5080, 1 /* Error */, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), - 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}'."), - 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."), - The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1 /* Error */, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), - Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1 /* Error */, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), - Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1 /* Error */, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), - Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."), - 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_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'."), - Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), - Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."), - Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), - Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), - Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), - 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."), - Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: diag(6004, 3 /* Message */, "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004", "Specify the location where debugger should locate TypeScript files instead of source locations."), - Watch_input_files: diag(6005, 3 /* Message */, "Watch_input_files_6005", "Watch input files."), - Redirect_output_structure_to_the_directory: diag(6006, 3 /* Message */, "Redirect_output_structure_to_the_directory_6006", "Redirect output structure to the directory."), - Do_not_erase_const_enum_declarations_in_generated_code: diag(6007, 3 /* Message */, "Do_not_erase_const_enum_declarations_in_generated_code_6007", "Do not erase const enum declarations in generated code."), - Do_not_emit_outputs_if_any_errors_were_reported: diag(6008, 3 /* Message */, "Do_not_emit_outputs_if_any_errors_were_reported_6008", "Do not emit outputs if any errors were reported."), - Do_not_emit_comments_to_output: diag(6009, 3 /* Message */, "Do_not_emit_comments_to_output_6009", "Do not emit comments to output."), - Do_not_emit_outputs: diag(6010, 3 /* Message */, "Do_not_emit_outputs_6010", "Do not emit outputs."), - Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, 3 /* Message */, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), - Skip_type_checking_of_declaration_files: diag(6012, 3 /* Message */, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), - Do_not_resolve_the_real_path_of_symlinks: diag(6013, 3 /* Message */, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), - Only_emit_d_ts_declaration_files: diag(6014, 3 /* Message */, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), - Specify_ECMAScript_target_version: diag(6015, 3 /* Message */, "Specify_ECMAScript_target_version_6015", "Specify ECMAScript target version."), - Specify_module_code_generation: diag(6016, 3 /* Message */, "Specify_module_code_generation_6016", "Specify module code generation."), - Print_this_message: diag(6017, 3 /* Message */, "Print_this_message_6017", "Print this message."), - Print_the_compiler_s_version: diag(6019, 3 /* Message */, "Print_the_compiler_s_version_6019", "Print the compiler's version."), - Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: diag(6020, 3 /* Message */, "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."), - Syntax_Colon_0: diag(6023, 3 /* Message */, "Syntax_Colon_0_6023", "Syntax: {0}"), - options: diag(6024, 3 /* Message */, "options_6024", "options"), - file: diag(6025, 3 /* Message */, "file_6025", "file"), - Examples_Colon_0: diag(6026, 3 /* Message */, "Examples_Colon_0_6026", "Examples: {0}"), - Options_Colon: diag(6027, 3 /* Message */, "Options_Colon_6027", "Options:"), - Version_0: diag(6029, 3 /* Message */, "Version_0_6029", "Version {0}"), - Insert_command_line_options_and_files_from_a_file: diag(6030, 3 /* Message */, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), - Starting_compilation_in_watch_mode: diag(6031, 3 /* Message */, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), - File_change_detected_Starting_incremental_compilation: diag(6032, 3 /* Message */, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), - KIND: diag(6034, 3 /* Message */, "KIND_6034", "KIND"), - FILE: diag(6035, 3 /* Message */, "FILE_6035", "FILE"), - VERSION: diag(6036, 3 /* Message */, "VERSION_6036", "VERSION"), - LOCATION: diag(6037, 3 /* Message */, "LOCATION_6037", "LOCATION"), - DIRECTORY: diag(6038, 3 /* Message */, "DIRECTORY_6038", "DIRECTORY"), - STRATEGY: diag(6039, 3 /* Message */, "STRATEGY_6039", "STRATEGY"), - FILE_OR_DIRECTORY: diag(6040, 3 /* Message */, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"), - Errors_Files: diag(6041, 3 /* Message */, "Errors_Files_6041", "Errors Files"), - Generates_corresponding_map_file: diag(6043, 3 /* Message */, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."), - Compiler_option_0_expects_an_argument: diag(6044, 1 /* Error */, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."), - Unterminated_quoted_string_in_response_file_0: diag(6045, 1 /* Error */, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."), - Argument_for_0_option_must_be_Colon_1: diag(6046, 1 /* Error */, "Argument_for_0_option_must_be_Colon_1_6046", "Argument for '{0}' option must be: {1}."), - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: diag(6048, 1 /* Error */, "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", "Locale must be of the form or -. For example '{0}' or '{1}'."), - Unable_to_open_file_0: diag(6050, 1 /* Error */, "Unable_to_open_file_0_6050", "Unable to open file '{0}'."), - Corrupted_locale_file_0: diag(6051, 1 /* Error */, "Corrupted_locale_file_0_6051", "Corrupted locale file {0}."), - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: diag(6052, 3 /* Message */, "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052", "Raise error on expressions and declarations with an implied 'any' type."), - File_0_not_found: diag(6053, 1 /* Error */, "File_0_not_found_6053", "File '{0}' not found."), - File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1: diag(6054, 1 /* Error */, "File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054", "File '{0}' has an unsupported extension. The only supported extensions are {1}."), - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: diag(6055, 3 /* Message */, "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055", "Suppress noImplicitAny errors for indexing objects lacking index signatures."), - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: diag(6056, 3 /* Message */, "Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056", "Do not emit declarations for code that has an '@internal' annotation."), - Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: diag(6058, 3 /* Message */, "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058", "Specify the root directory of input files. Use to control the output directory structure with --outDir."), - File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: diag(6059, 1 /* Error */, "File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059", "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."), - Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: diag(6060, 3 /* Message */, "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060", "Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."), - NEWLINE: diag(6061, 3 /* Message */, "NEWLINE_6061", "NEWLINE"), - Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: diag(6064, 1 /* Error */, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."), - Enables_experimental_support_for_ES7_decorators: diag(6065, 3 /* Message */, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."), - Enables_experimental_support_for_emitting_type_metadata_for_decorators: diag(6066, 3 /* Message */, "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066", "Enables experimental support for emitting type metadata for decorators."), - Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: diag(6070, 3 /* Message */, "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", "Initializes a TypeScript project and creates a tsconfig.json file."), - Successfully_created_a_tsconfig_json_file: diag(6071, 3 /* Message */, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."), - Suppress_excess_property_checks_for_object_literals: diag(6072, 3 /* Message */, "Suppress_excess_property_checks_for_object_literals_6072", "Suppress excess property checks for object literals."), - Stylize_errors_and_messages_using_color_and_context_experimental: diag(6073, 3 /* Message */, "Stylize_errors_and_messages_using_color_and_context_experimental_6073", "Stylize errors and messages using color and context (experimental)."), - Do_not_report_errors_on_unused_labels: diag(6074, 3 /* Message */, "Do_not_report_errors_on_unused_labels_6074", "Do not report errors on unused labels."), - Report_error_when_not_all_code_paths_in_function_return_a_value: diag(6075, 3 /* Message */, "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", "Report error when not all code paths in function return a value."), - Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, 3 /* Message */, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), - Do_not_report_errors_on_unreachable_code: diag(6077, 3 /* Message */, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), - 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."), - 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"), - Enable_tracing_of_the_name_resolution_process: diag(6085, 3 /* Message */, "Enable_tracing_of_the_name_resolution_process_6085", "Enable tracing of the name resolution process."), - Resolving_module_0_from_1: diag(6086, 3 /* Message */, "Resolving_module_0_from_1_6086", "======== Resolving module '{0}' from '{1}'. ========"), - Explicitly_specified_module_resolution_kind_Colon_0: diag(6087, 3 /* Message */, "Explicitly_specified_module_resolution_kind_Colon_0_6087", "Explicitly specified module resolution kind: '{0}'."), - Module_resolution_kind_is_not_specified_using_0: diag(6088, 3 /* Message */, "Module_resolution_kind_is_not_specified_using_0_6088", "Module resolution kind is not specified, using '{0}'."), - Module_name_0_was_successfully_resolved_to_1: diag(6089, 3 /* Message */, "Module_name_0_was_successfully_resolved_to_1_6089", "======== Module name '{0}' was successfully resolved to '{1}'. ========"), - Module_name_0_was_not_resolved: diag(6090, 3 /* Message */, "Module_name_0_was_not_resolved_6090", "======== Module name '{0}' was not resolved. ========"), - paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: diag(6091, 3 /* Message */, "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091", "'paths' option is specified, looking for a pattern to match module name '{0}'."), - Module_name_0_matched_pattern_1: diag(6092, 3 /* Message */, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."), - Trying_substitution_0_candidate_module_location_Colon_1: diag(6093, 3 /* Message */, "Trying_substitution_0_candidate_module_location_Colon_1_6093", "Trying substitution '{0}', candidate module location: '{1}'."), - Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), - Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."), - File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."), - File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."), - Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."), - Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), - package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), - package_json_has_0_field_1_that_references_2: diag(6101, 3 /* Message */, "package_json_has_0_field_1_that_references_2_6101", "'package.json' has '{0}' field '{1}' that references '{2}'."), - Allow_javascript_files_to_be_compiled: diag(6102, 3 /* Message */, "Allow_javascript_files_to_be_compiled_6102", "Allow javascript files to be compiled."), - Checking_if_0_is_the_longest_matching_prefix_for_1_2: diag(6104, 3 /* Message */, "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."), - Expected_type_of_0_field_in_package_json_to_be_1_got_2: diag(6105, 3 /* Message */, "Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105", "Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."), - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: diag(6106, 3 /* Message */, "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."), - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: diag(6107, 3 /* Message */, "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", "'rootDirs' option is set, using it to resolve relative module name '{0}'."), - Longest_matching_prefix_for_0_is_1: diag(6108, 3 /* Message */, "Longest_matching_prefix_for_0_is_1_6108", "Longest matching prefix for '{0}' is '{1}'."), - Loading_0_from_the_root_dir_1_candidate_location_2: diag(6109, 3 /* Message */, "Loading_0_from_the_root_dir_1_candidate_location_2_6109", "Loading '{0}' from the root dir '{1}', candidate location '{2}'."), - Trying_other_entries_in_rootDirs: diag(6110, 3 /* Message */, "Trying_other_entries_in_rootDirs_6110", "Trying other entries in 'rootDirs'."), - Module_resolution_using_rootDirs_has_failed: diag(6111, 3 /* Message */, "Module_resolution_using_rootDirs_has_failed_6111", "Module resolution using 'rootDirs' has failed."), - Do_not_emit_use_strict_directives_in_module_output: diag(6112, 3 /* Message */, "Do_not_emit_use_strict_directives_in_module_output_6112", "Do not emit 'use strict' directives in module output."), - Enable_strict_null_checks: diag(6113, 3 /* Message */, "Enable_strict_null_checks_6113", "Enable strict null checks."), - Unknown_option_excludes_Did_you_mean_exclude: diag(6114, 1 /* Error */, "Unknown_option_excludes_Did_you_mean_exclude_6114", "Unknown option 'excludes'. Did you mean 'exclude'?"), - Raise_error_on_this_expressions_with_an_implied_any_type: diag(6115, 3 /* Message */, "Raise_error_on_this_expressions_with_an_implied_any_type_6115", "Raise error on 'this' expressions with an implied 'any' type."), - Resolving_type_reference_directive_0_containing_file_1_root_directory_2: diag(6116, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116", "======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"), - Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: diag(6119, 3 /* Message */, "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"), - Type_reference_directive_0_was_not_resolved: diag(6120, 3 /* Message */, "Type_reference_directive_0_was_not_resolved_6120", "======== Type reference directive '{0}' was not resolved. ========"), - Resolving_with_primary_search_path_0: diag(6121, 3 /* Message */, "Resolving_with_primary_search_path_0_6121", "Resolving with primary search path '{0}'."), - Root_directory_cannot_be_determined_skipping_primary_search_paths: diag(6122, 3 /* Message */, "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", "Root directory cannot be determined, skipping primary search paths."), - Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: diag(6123, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"), - Type_declaration_files_to_be_included_in_compilation: diag(6124, 3 /* Message */, "Type_declaration_files_to_be_included_in_compilation_6124", "Type declaration files to be included in compilation."), - Looking_up_in_node_modules_folder_initial_location_0: diag(6125, 3 /* Message */, "Looking_up_in_node_modules_folder_initial_location_0_6125", "Looking up in 'node_modules' folder, initial location '{0}'."), - Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: diag(6126, 3 /* Message */, "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."), - Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: diag(6127, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"), - Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: diag(6128, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"), - Resolving_real_path_for_0_result_1: diag(6130, 3 /* Message */, "Resolving_real_path_for_0_result_1_6130", "Resolving real path for '{0}', result '{1}'."), - Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: diag(6131, 1 /* Error */, "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."), - File_name_0_has_a_1_extension_stripping_it: diag(6132, 3 /* Message */, "File_name_0_has_a_1_extension_stripping_it_6132", "File name '{0}' has a '{1}' extension - stripping it."), - _0_is_declared_but_its_value_is_never_read: diag( - 6133, - 1 /* Error */, - "_0_is_declared_but_its_value_is_never_read_6133", - "'{0}' is declared but its value is never read.", - /*reportsUnnecessary*/ - true - ), - Report_errors_on_unused_locals: diag(6134, 3 /* Message */, "Report_errors_on_unused_locals_6134", "Report errors on unused locals."), - Report_errors_on_unused_parameters: diag(6135, 3 /* Message */, "Report_errors_on_unused_parameters_6135", "Report errors on unused parameters."), - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: diag(6136, 3 /* Message */, "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", "The maximum dependency depth to search under node_modules and load JavaScript files."), - Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1: diag(6137, 1 /* Error */, "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137", "Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."), - Property_0_is_declared_but_its_value_is_never_read: diag( - 6138, - 1 /* Error */, - "Property_0_is_declared_but_its_value_is_never_read_6138", - "Property '{0}' is declared but its value is never read.", - /*reportsUnnecessary*/ - true - ), - Import_emit_helpers_from_tslib: diag(6139, 3 /* Message */, "Import_emit_helpers_from_tslib_6139", "Import emit helpers from 'tslib'."), - Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: diag(6140, 1 /* Error */, "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."), - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: diag(6141, 3 /* Message */, "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", 'Parse in strict mode and emit "use strict" for each source file.'), - Module_0_was_resolved_to_1_but_jsx_is_not_set: diag(6142, 1 /* Error */, "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", "Module '{0}' was resolved to '{1}', but '--jsx' is not set."), - Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: diag(6144, 3 /* Message */, "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", "Module '{0}' was resolved as locally declared ambient module in file '{1}'."), - Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: diag(6146, 3 /* Message */, "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."), - Resolution_for_module_0_was_found_in_cache_from_location_1: diag(6147, 3 /* Message */, "Resolution_for_module_0_was_found_in_cache_from_location_1_6147", "Resolution for module '{0}' was found in cache from location '{1}'."), - Directory_0_does_not_exist_skipping_all_lookups_in_it: diag(6148, 3 /* Message */, "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", "Directory '{0}' does not exist, skipping all lookups in it."), - Show_diagnostic_information: diag(6149, 3 /* Message */, "Show_diagnostic_information_6149", "Show diagnostic information."), - Show_verbose_diagnostic_information: diag(6150, 3 /* Message */, "Show_verbose_diagnostic_information_6150", "Show verbose diagnostic information."), - Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: diag(6151, 3 /* Message */, "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", "Emit a single file with source maps instead of having a separate file."), - Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: diag(6152, 3 /* Message */, "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."), - Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: diag(6153, 3 /* Message */, "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", "Transpile each file as a separate module (similar to 'ts.transpileModule')."), - Print_names_of_generated_files_part_of_the_compilation: diag(6154, 3 /* Message */, "Print_names_of_generated_files_part_of_the_compilation_6154", "Print names of generated files part of the compilation."), - Print_names_of_files_part_of_the_compilation: diag(6155, 3 /* Message */, "Print_names_of_files_part_of_the_compilation_6155", "Print names of files part of the compilation."), - The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: diag(6156, 3 /* Message */, "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", "The locale used when displaying messages to the user (e.g. 'en-us')"), - Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: diag(6157, 3 /* Message */, "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", "Do not generate custom helper functions like '__extends' in compiled output."), - Do_not_include_the_default_library_file_lib_d_ts: diag(6158, 3 /* Message */, "Do_not_include_the_default_library_file_lib_d_ts_6158", "Do not include the default library file (lib.d.ts)."), - Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: diag(6159, 3 /* Message */, "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", "Do not add triple-slash references or imported modules to the list of compiled files."), - Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: diag(6160, 3 /* Message */, "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."), - List_of_folders_to_include_type_definitions_from: diag(6161, 3 /* Message */, "List_of_folders_to_include_type_definitions_from_6161", "List of folders to include type definitions from."), - Disable_size_limitations_on_JavaScript_projects: diag(6162, 3 /* Message */, "Disable_size_limitations_on_JavaScript_projects_6162", "Disable size limitations on JavaScript projects."), - The_character_set_of_the_input_files: diag(6163, 3 /* Message */, "The_character_set_of_the_input_files_6163", "The character set of the input files."), - Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1: diag(6164, 3 /* Message */, "Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164", "Skipping module '{0}' that looks like an absolute URI, target file types: {1}."), - Do_not_truncate_error_messages: diag(6165, 3 /* Message */, "Do_not_truncate_error_messages_6165", "Do not truncate error messages."), - Output_directory_for_generated_declaration_files: diag(6166, 3 /* Message */, "Output_directory_for_generated_declaration_files_6166", "Output directory for generated declaration files."), - A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: diag(6167, 3 /* Message */, "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."), - List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: diag(6168, 3 /* Message */, "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", "List of root folders whose combined content represents the structure of the project at runtime."), - Show_all_compiler_options: diag(6169, 3 /* Message */, "Show_all_compiler_options_6169", "Show all compiler options."), - Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: diag(6170, 3 /* Message */, "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"), - Command_line_Options: diag(6171, 3 /* Message */, "Command_line_Options_6171", "Command-line Options"), - Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5: diag(6179, 3 /* Message */, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5'."), - Enable_all_strict_type_checking_options: diag(6180, 3 /* Message */, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."), - Scoped_package_detected_looking_in_0: diag(6182, 3 /* Message */, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"), - Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6183, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), - Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6184, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), - Enable_strict_checking_of_function_types: diag(6186, 3 /* Message */, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), - Enable_strict_checking_of_property_initialization_in_classes: diag(6187, 3 /* Message */, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), - Numeric_separators_are_not_allowed_here: diag(6188, 1 /* Error */, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), - Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, 1 /* Error */, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), - Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, 3 /* Message */, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."), - All_imports_in_import_declaration_are_unused: diag( - 6192, - 1 /* Error */, - "All_imports_in_import_declaration_are_unused_6192", - "All imports in import declaration are unused.", - /*reportsUnnecessary*/ - true - ), - Found_1_error_Watching_for_file_changes: diag(6193, 3 /* Message */, "Found_1_error_Watching_for_file_changes_6193", "Found 1 error. Watching for file changes."), - Found_0_errors_Watching_for_file_changes: diag(6194, 3 /* Message */, "Found_0_errors_Watching_for_file_changes_6194", "Found {0} errors. Watching for file changes."), - Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols: diag(6195, 3 /* Message */, "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195", "Resolve 'keyof' to string valued property names only (no numbers or symbols)."), - _0_is_declared_but_never_used: diag( - 6196, - 1 /* Error */, - "_0_is_declared_but_never_used_6196", - "'{0}' is declared but never used.", - /*reportsUnnecessary*/ - true - ), - Include_modules_imported_with_json_extension: diag(6197, 3 /* Message */, "Include_modules_imported_with_json_extension_6197", "Include modules imported with '.json' extension"), - All_destructured_elements_are_unused: diag( - 6198, - 1 /* Error */, - "All_destructured_elements_are_unused_6198", - "All destructured elements are unused.", - /*reportsUnnecessary*/ - true - ), - All_variables_are_unused: diag( - 6199, - 1 /* Error */, - "All_variables_are_unused_6199", - "All variables are unused.", - /*reportsUnnecessary*/ - true - ), - Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, 1 /* Error */, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"), - Conflicts_are_in_this_file: diag(6201, 3 /* Message */, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."), - Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, 1 /* Error */, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), - _0_was_also_declared_here: diag(6203, 3 /* Message */, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), - and_here: diag(6204, 3 /* Message */, "and_here_6204", "and here."), - All_type_parameters_are_unused: diag(6205, 1 /* Error */, "All_type_parameters_are_unused_6205", "All type parameters are unused."), - package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, 3 /* Message */, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), - package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, 3 /* Message */, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), - package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, 3 /* Message */, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), - package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range: diag(6209, 3 /* Message */, "package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209", "'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."), - An_argument_for_0_was_not_provided: diag(6210, 3 /* Message */, "An_argument_for_0_was_not_provided_6210", "An argument for '{0}' was not provided."), - An_argument_matching_this_binding_pattern_was_not_provided: diag(6211, 3 /* Message */, "An_argument_matching_this_binding_pattern_was_not_provided_6211", "An argument matching this binding pattern was not provided."), - Did_you_mean_to_call_this_expression: diag(6212, 3 /* Message */, "Did_you_mean_to_call_this_expression_6212", "Did you mean to call this expression?"), - Did_you_mean_to_use_new_with_this_expression: diag(6213, 3 /* Message */, "Did_you_mean_to_use_new_with_this_expression_6213", "Did you mean to use 'new' with this expression?"), - Enable_strict_bind_call_and_apply_methods_on_functions: diag(6214, 3 /* Message */, "Enable_strict_bind_call_and_apply_methods_on_functions_6214", "Enable strict 'bind', 'call', and 'apply' methods on functions."), - Using_compiler_options_of_project_reference_redirect_0: diag(6215, 3 /* Message */, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."), - Found_1_error: diag(6216, 3 /* Message */, "Found_1_error_6216", "Found 1 error."), - Found_0_errors: diag(6217, 3 /* Message */, "Found_0_errors_6217", "Found {0} errors."), - Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2: diag(6218, 3 /* Message */, "Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218", "======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"), - Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3: diag(6219, 3 /* Message */, "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219", "======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"), - package_json_had_a_falsy_0_field: diag(6220, 3 /* Message */, "package_json_had_a_falsy_0_field_6220", "'package.json' had a falsy '{0}' field."), - Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects: diag(6221, 3 /* Message */, "Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221", "Disable use of source files instead of declaration files from referenced projects."), - Emit_class_fields_with_Define_instead_of_Set: diag(6222, 3 /* Message */, "Emit_class_fields_with_Define_instead_of_Set_6222", "Emit class fields with Define instead of Set."), - Generates_a_CPU_profile: diag(6223, 3 /* Message */, "Generates_a_CPU_profile_6223", "Generates a CPU profile."), - Disable_solution_searching_for_this_project: diag(6224, 3 /* Message */, "Disable_solution_searching_for_this_project_6224", "Disable solution searching for this project."), - Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory: diag(6225, 3 /* Message */, "Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225", "Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."), - Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling: diag(6226, 3 /* Message */, "Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226", "Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."), - Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize: diag(6227, 3 /* Message */, "Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227", "Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."), - Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3: diag(6229, 1 /* Error */, "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229", "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."), - Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line: diag(6230, 1 /* Error */, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."), - Could_not_resolve_the_path_0_with_the_extensions_Colon_1: diag(6231, 1 /* Error */, "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231", "Could not resolve the path '{0}' with the extensions: {1}."), - Declaration_augments_declaration_in_another_file_This_cannot_be_serialized: diag(6232, 1 /* Error */, "Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232", "Declaration augments declaration in another file. This cannot be serialized."), - This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file: diag(6233, 1 /* Error */, "This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233", "This is the declaration being augmented. Consider moving the augmenting declaration into the same file."), - This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, 1 /* Error */, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), - Disable_loading_referenced_projects: diag(6235, 3 /* Message */, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), - Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, 1 /* Error */, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), - Generates_an_event_trace_and_a_list_of_types: diag(6237, 3 /* Message */, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), - Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, 1 /* Error */, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"), - File_0_exists_according_to_earlier_cached_lookups: diag(6239, 3 /* Message */, "File_0_exists_according_to_earlier_cached_lookups_6239", "File '{0}' exists according to earlier cached lookups."), - File_0_does_not_exist_according_to_earlier_cached_lookups: diag(6240, 3 /* Message */, "File_0_does_not_exist_according_to_earlier_cached_lookups_6240", "File '{0}' does not exist according to earlier cached lookups."), - Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1: diag(6241, 3 /* Message */, "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241", "Resolution for type reference directive '{0}' was found in cache from location '{1}'."), - Resolving_type_reference_directive_0_containing_file_1: diag(6242, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_1_6242", "======== Resolving type reference directive '{0}', containing file '{1}'. ========"), - Interpret_optional_property_types_as_written_rather_than_adding_undefined: diag(6243, 3 /* Message */, "Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243", "Interpret optional property types as written, rather than adding 'undefined'."), - Modules: diag(6244, 3 /* Message */, "Modules_6244", "Modules"), - File_Management: diag(6245, 3 /* Message */, "File_Management_6245", "File Management"), - Emit: diag(6246, 3 /* Message */, "Emit_6246", "Emit"), - JavaScript_Support: diag(6247, 3 /* Message */, "JavaScript_Support_6247", "JavaScript Support"), - Type_Checking: diag(6248, 3 /* Message */, "Type_Checking_6248", "Type Checking"), - Editor_Support: diag(6249, 3 /* Message */, "Editor_Support_6249", "Editor Support"), - Watch_and_Build_Modes: diag(6250, 3 /* Message */, "Watch_and_Build_Modes_6250", "Watch and Build Modes"), - Compiler_Diagnostics: diag(6251, 3 /* Message */, "Compiler_Diagnostics_6251", "Compiler Diagnostics"), - Interop_Constraints: diag(6252, 3 /* Message */, "Interop_Constraints_6252", "Interop Constraints"), - Backwards_Compatibility: diag(6253, 3 /* Message */, "Backwards_Compatibility_6253", "Backwards Compatibility"), - Language_and_Environment: diag(6254, 3 /* Message */, "Language_and_Environment_6254", "Language and Environment"), - Projects: diag(6255, 3 /* Message */, "Projects_6255", "Projects"), - Output_Formatting: diag(6256, 3 /* Message */, "Output_Formatting_6256", "Output Formatting"), - Completeness: diag(6257, 3 /* Message */, "Completeness_6257", "Completeness"), - _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, 1 /* Error */, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"), - Found_1_error_in_0: diag(6259, 3 /* Message */, "Found_1_error_in_0_6259", "Found 1 error in {0}"), - Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, 3 /* Message */, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"), - Found_0_errors_in_1_files: diag(6261, 3 /* Message */, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."), - File_name_0_has_a_1_extension_looking_up_2_instead: diag(6262, 3 /* Message */, "File_name_0_has_a_1_extension_looking_up_2_instead_6262", "File name '{0}' has a '{1}' extension - looking up '{2}' instead."), - Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set: diag(6263, 1 /* Error */, "Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263", "Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."), - Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present: diag(6264, 3 /* Message */, "Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264", "Enable importing files with any extension, provided a declaration file is present."), - Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder: diag(6265, 3 /* Message */, "Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265", "Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."), - Option_0_can_only_be_specified_on_command_line: diag(6266, 1 /* Error */, "Option_0_can_only_be_specified_on_command_line_6266", "Option '{0}' can only be specified on command line."), - Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, 3 /* Message */, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."), - Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, 3 /* Message */, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."), - Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, 3 /* Message */, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."), - package_json_scope_0_has_no_imports_defined: diag(6273, 3 /* Message */, "package_json_scope_0_has_no_imports_defined_6273", "package.json scope '{0}' has no imports defined."), - package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), - package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), - 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'."), - package_json_has_a_peerDependencies_field: diag(6281, 3 /* Message */, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."), - Found_peerDependency_0_with_1_version: diag(6282, 3 /* Message */, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."), - Failed_to_find_peerDependency_0: diag(6283, 3 /* Message */, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."), - File_Layout: diag(6284, 3 /* Message */, "File_Layout_6284", "File Layout"), - Environment_Settings: diag(6285, 3 /* Message */, "Environment_Settings_6285", "Environment Settings"), - See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule: diag(6286, 3 /* Message */, "See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule_6286", "See also https://aka.ms/tsconfig/module"), - For_nodejs_Colon: diag(6287, 3 /* Message */, "For_nodejs_Colon_6287", "For nodejs:"), - and_npm_install_D_types_Slashnode: diag(6290, 3 /* Message */, "and_npm_install_D_types_Slashnode_6290", "and npm install -D @types/node"), - Other_Outputs: diag(6291, 3 /* Message */, "Other_Outputs_6291", "Other Outputs"), - Stricter_Typechecking_Options: diag(6292, 3 /* Message */, "Stricter_Typechecking_Options_6292", "Stricter Typechecking Options"), - Style_Options: diag(6293, 3 /* Message */, "Style_Options_6293", "Style Options"), - Recommended_Options: diag(6294, 3 /* Message */, "Recommended_Options_6294", "Recommended Options"), - 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}'."), - Referenced_project_0_must_have_setting_composite_Colon_true: diag(6306, 1 /* Error */, "Referenced_project_0_must_have_setting_composite_Colon_true_6306", `Referenced project '{0}' must have setting "composite": true.`), - File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern: diag(6307, 1 /* Error */, "File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307", "File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."), - Referenced_project_0_may_not_disable_emit: diag(6310, 1 /* Error */, "Referenced_project_0_may_not_disable_emit_6310", "Referenced project '{0}' may not disable emit."), - Project_0_is_out_of_date_because_output_1_is_older_than_input_2: diag(6350, 3 /* Message */, "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350", "Project '{0}' is out of date because output '{1}' is older than input '{2}'"), - Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2: diag(6351, 3 /* Message */, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"), - Project_0_is_out_of_date_because_output_file_1_does_not_exist: diag(6352, 3 /* Message */, "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352", "Project '{0}' is out of date because output file '{1}' does not exist"), - Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: diag(6353, 3 /* Message */, "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353", "Project '{0}' is out of date because its dependency '{1}' is out of date"), - Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: diag(6354, 3 /* Message */, "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354", "Project '{0}' is up to date with .d.ts files from its dependencies"), - Projects_in_this_build_Colon_0: diag(6355, 3 /* Message */, "Projects_in_this_build_Colon_0_6355", "Projects in this build: {0}"), - A_non_dry_build_would_delete_the_following_files_Colon_0: diag(6356, 3 /* Message */, "A_non_dry_build_would_delete_the_following_files_Colon_0_6356", "A non-dry build would delete the following files: {0}"), - A_non_dry_build_would_build_project_0: diag(6357, 3 /* Message */, "A_non_dry_build_would_build_project_0_6357", "A non-dry build would build project '{0}'"), - Building_project_0: diag(6358, 3 /* Message */, "Building_project_0_6358", "Building project '{0}'..."), - Updating_output_timestamps_of_project_0: diag(6359, 3 /* Message */, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."), - Project_0_is_up_to_date: diag(6361, 3 /* Message */, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"), - Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"), - Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"), - Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, 3 /* Message */, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"), - Delete_the_outputs_of_all_projects: diag(6365, 3 /* Message */, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."), - Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, 3 /* Message */, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"), - Option_build_must_be_the_first_command_line_argument: diag(6369, 1 /* Error */, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."), - Options_0_and_1_cannot_be_combined: diag(6370, 1 /* Error */, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."), - Updating_unchanged_output_timestamps_of_project_0: diag(6371, 3 /* Message */, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."), - A_non_dry_build_would_update_timestamps_for_output_of_project_0: diag(6374, 3 /* Message */, "A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374", "A non-dry build would update timestamps for output of project '{0}'"), - Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, 1 /* Error */, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"), - Composite_projects_may_not_disable_incremental_compilation: diag(6379, 1 /* Error */, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."), - Specify_file_to_store_incremental_compilation_information: diag(6380, 3 /* Message */, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"), - Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, 3 /* Message */, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"), - Skipping_build_of_project_0_because_its_dependency_1_was_not_built: diag(6382, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382", "Skipping build of project '{0}' because its dependency '{1}' was not built"), - Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), - Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, 3 /* Message */, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), - _0_is_deprecated: diag( - 6385, - 2 /* Suggestion */, - "_0_is_deprecated_6385", - "'{0}' is deprecated.", - /*reportsUnnecessary*/ - void 0, - /*elidedInCompatabilityPyramid*/ - void 0, - /*reportsDeprecated*/ - true - ), - Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, 3 /* Message */, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), - The_signature_0_of_1_is_deprecated: diag( - 6387, - 2 /* Suggestion */, - "The_signature_0_of_1_is_deprecated_6387", - "The signature '{0}' of '{1}' is deprecated.", - /*reportsUnnecessary*/ - void 0, - /*elidedInCompatabilityPyramid*/ - void 0, - /*reportsDeprecated*/ - true - ), - Project_0_is_being_forcibly_rebuilt: diag(6388, 3 /* Message */, "Project_0_is_being_forcibly_rebuilt_6388", "Project '{0}' is being forcibly rebuilt"), - Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved: diag(6389, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389", "Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."), - Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6390, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), - Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6391, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), - Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved: diag(6392, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."), - Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6393, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), - Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6394, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), - Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6395, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), - Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6396, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), - Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6397, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), - Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6398, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), - Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted: diag(6399, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"), - Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, 3 /* Message */, "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"), - Project_0_is_out_of_date_because_there_was_error_reading_file_1: diag(6401, 3 /* Message */, "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", "Project '{0}' is out of date because there was error reading file '{1}'"), - Resolving_in_0_mode_with_conditions_1: diag(6402, 3 /* Message */, "Resolving_in_0_mode_with_conditions_1_6402", "Resolving in {0} mode with conditions {1}."), - Matched_0_condition_1: diag(6403, 3 /* Message */, "Matched_0_condition_1_6403", "Matched '{0}' condition '{1}'."), - Using_0_subpath_1_with_target_2: diag(6404, 3 /* Message */, "Using_0_subpath_1_with_target_2_6404", "Using '{0}' subpath '{1}' with target '{2}'."), - Saw_non_matching_condition_0: diag(6405, 3 /* Message */, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."), - Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions: diag(6406, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406", "Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"), - Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set: diag(6407, 3 /* Message */, "Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407", "Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."), - Use_the_package_json_exports_field_when_resolving_package_imports: diag(6408, 3 /* Message */, "Use_the_package_json_exports_field_when_resolving_package_imports_6408", "Use the package.json 'exports' field when resolving package imports."), - Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."), - Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."), - true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."), - Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."), - Entering_conditional_exports: diag(6413, 3 /* Message */, "Entering_conditional_exports_6413", "Entering conditional exports."), - 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}."), - Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors: diag(6419, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."), - Project_0_is_out_of_date_because_1: diag(6420, 3 /* Message */, "Project_0_is_out_of_date_because_1_6420", "Project '{0}' is out of date because {1}."), - Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files: diag(6421, 3 /* Message */, "Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421", "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."), - 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."), - Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, 3 /* Message */, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), - File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, 1 /* Error */, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), - Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, 3 /* Message */, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."), - Consider_adding_a_declare_modifier_to_this_class: diag(6506, 3 /* Message */, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."), - Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files."), - Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, 3 /* Message */, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."), - Allow_accessing_UMD_globals_from_modules: diag(6602, 3 /* Message */, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."), - Disable_error_reporting_for_unreachable_code: diag(6603, 3 /* Message */, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."), - Disable_error_reporting_for_unused_labels: diag(6604, 3 /* Message */, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."), - Ensure_use_strict_is_always_emitted: diag(6605, 3 /* Message */, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."), - Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, 3 /* Message */, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."), - Specify_the_base_directory_to_resolve_non_relative_module_names: diag(6607, 3 /* Message */, "Specify_the_base_directory_to_resolve_non_relative_module_names_6607", "Specify the base directory to resolve non-relative module names."), - No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files: diag(6608, 3 /* Message */, "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608", "No longer supported. In early versions, manually set the text encoding for reading files."), - Enable_error_reporting_in_type_checked_JavaScript_files: diag(6609, 3 /* Message */, "Enable_error_reporting_in_type_checked_JavaScript_files_6609", "Enable error reporting in type-checked JavaScript files."), - Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references: diag(6611, 3 /* Message */, "Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611", "Enable constraints that allow a TypeScript project to be used with project references."), - Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project: diag(6612, 3 /* Message */, "Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612", "Generate .d.ts files from TypeScript and JavaScript files in your project."), - Specify_the_output_directory_for_generated_declaration_files: diag(6613, 3 /* Message */, "Specify_the_output_directory_for_generated_declaration_files_6613", "Specify the output directory for generated declaration files."), - Create_sourcemaps_for_d_ts_files: diag(6614, 3 /* Message */, "Create_sourcemaps_for_d_ts_files_6614", "Create sourcemaps for d.ts files."), - Output_compiler_performance_information_after_building: diag(6615, 3 /* Message */, "Output_compiler_performance_information_after_building_6615", "Output compiler performance information after building."), - Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project: diag(6616, 3 /* Message */, "Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616", "Disables inference for type acquisition by looking at filenames in a project."), - Reduce_the_number_of_projects_loaded_automatically_by_TypeScript: diag(6617, 3 /* Message */, "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617", "Reduce the number of projects loaded automatically by TypeScript."), - Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server: diag(6618, 3 /* Message */, "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618", "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."), - Opt_a_project_out_of_multi_project_reference_checking_when_editing: diag(6619, 3 /* Message */, "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619", "Opt a project out of multi-project reference checking when editing."), - Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, 3 /* Message */, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects."), - Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration: diag(6621, 3 /* Message */, "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621", "Emit more compliant, but verbose and less performant JavaScript for iteration."), - Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6622, 3 /* Message */, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."), - Only_output_d_ts_files_and_not_JavaScript_files: diag(6623, 3 /* Message */, "Only_output_d_ts_files_and_not_JavaScript_files_6623", "Only output d.ts files and not JavaScript files."), - Emit_design_type_metadata_for_decorated_declarations_in_source_files: diag(6624, 3 /* Message */, "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624", "Emit design-type metadata for decorated declarations in source files."), - Disable_the_type_acquisition_for_JavaScript_projects: diag(6625, 3 /* Message */, "Disable_the_type_acquisition_for_JavaScript_projects_6625", "Disable the type acquisition for JavaScript projects"), - Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, 3 /* Message */, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."), - Filters_results_from_the_include_option: diag(6627, 3 /* Message */, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), - Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3 /* Message */, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), - Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3 /* Message */, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), - Enable_experimental_support_for_legacy_experimental_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."), - Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3 /* Message */, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), - Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3 /* Message */, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), - Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3 /* Message */, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), - Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers: diag(6634, 3 /* Message */, "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634", "Specify what approach the watcher should use if the system runs out of native file watchers."), - Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include: diag(6635, 3 /* Message */, "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635", "Include a list of files. This does not support glob patterns, as opposed to `include`."), - Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, 3 /* Message */, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date."), - Ensure_that_casing_is_correct_in_imports: diag(6637, 3 /* Message */, "Ensure_that_casing_is_correct_in_imports_6637", "Ensure that casing is correct in imports."), - Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging: diag(6638, 3 /* Message */, "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638", "Emit a v8 CPU profile of the compiler run for debugging."), - Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file: diag(6639, 3 /* Message */, "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639", "Allow importing helper functions from tslib once per project, instead of including them per-file."), - Skip_building_downstream_projects_on_error_in_upstream_project: diag(6640, 3 /* Message */, "Skip_building_downstream_projects_on_error_in_upstream_project_6640", "Skip building downstream projects on error in upstream project."), - Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation: diag(6641, 3 /* Message */, "Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641", "Specify a list of glob patterns that match files to be included in compilation."), - Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects: diag(6642, 3 /* Message */, "Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642", "Save .tsbuildinfo files to allow for incremental compilation of projects."), - Include_sourcemap_files_inside_the_emitted_JavaScript: diag(6643, 3 /* Message */, "Include_sourcemap_files_inside_the_emitted_JavaScript_6643", "Include sourcemap files inside the emitted JavaScript."), - Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript: diag(6644, 3 /* Message */, "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644", "Include source code in the sourcemaps inside the emitted JavaScript."), - Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports: diag(6645, 3 /* Message */, "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645", "Ensure that each file can be safely transpiled without relying on other imports."), - Specify_what_JSX_code_is_generated: diag(6646, 3 /* Message */, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."), - Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, 3 /* Message */, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."), - Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment: diag(6648, 3 /* Message */, "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648", "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."), - Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, 3 /* Message */, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."), - Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option: diag(6650, 3 /* Message */, "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650", "Make keyof only return strings instead of string, numbers or symbols. Legacy option."), - Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment: diag(6651, 3 /* Message */, "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651", "Specify a set of bundled library declaration files that describe the target runtime environment."), - Print_the_names_of_emitted_files_after_a_compilation: diag(6652, 3 /* Message */, "Print_the_names_of_emitted_files_after_a_compilation_6652", "Print the names of emitted files after a compilation."), - Print_all_of_the_files_read_during_the_compilation: diag(6653, 3 /* Message */, "Print_all_of_the_files_read_during_the_compilation_6653", "Print all of the files read during the compilation."), - Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit: diag(6654, 3 /* Message */, "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654", "Set the language of the messaging from TypeScript. This does not affect emit."), - Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6655, 3 /* Message */, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655", "Specify the location where debugger should locate map files instead of generated locations."), - Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, 3 /* Message */, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."), - Specify_what_module_code_is_generated: diag(6657, 3 /* Message */, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."), - Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier: diag(6658, 3 /* Message */, "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658", "Specify how TypeScript looks up a file from a given module specifier."), - Set_the_newline_character_for_emitting_files: diag(6659, 3 /* Message */, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."), - Disable_emitting_files_from_a_compilation: diag(6660, 3 /* Message */, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."), - Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, 3 /* Message */, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like '__extends' in compiled output."), - Disable_emitting_files_if_any_type_checking_errors_are_reported: diag(6662, 3 /* Message */, "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662", "Disable emitting files if any type checking errors are reported."), - Disable_truncating_types_in_error_messages: diag(6663, 3 /* Message */, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."), - Enable_error_reporting_for_fallthrough_cases_in_switch_statements: diag(6664, 3 /* Message */, "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664", "Enable error reporting for fallthrough cases in switch statements."), - Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, 3 /* Message */, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied 'any' type."), - Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier: diag(6666, 3 /* Message */, "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666", "Ensure overriding members in derived classes are marked with an override modifier."), - Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function: diag(6667, 3 /* Message */, "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667", "Enable error reporting for codepaths that do not explicitly return in a function."), - Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, 3 /* Message */, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when 'this' is given the type 'any'."), - Disable_adding_use_strict_directives_in_emitted_JavaScript_files: diag(6669, 3 /* Message */, "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669", "Disable adding 'use strict' directives in emitted JavaScript files."), - Disable_including_any_library_files_including_the_default_lib_d_ts: diag(6670, 3 /* Message */, "Disable_including_any_library_files_including_the_default_lib_d_ts_6670", "Disable including any library files, including the default lib.d.ts."), - Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, 3 /* Message */, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type."), - Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, 3 /* Message */, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."), - Disable_strict_checking_of_generic_signatures_in_function_types: diag(6673, 3 /* Message */, "Disable_strict_checking_of_generic_signatures_in_function_types_6673", "Disable strict checking of generic signatures in function types."), - Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, 3 /* Message */, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add 'undefined' to a type when accessed using an index."), - Enable_error_reporting_when_local_variables_aren_t_read: diag(6675, 3 /* Message */, "Enable_error_reporting_when_local_variables_aren_t_read_6675", "Enable error reporting when local variables aren't read."), - Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, 3 /* Message */, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read."), - Deprecated_setting_Use_outFile_instead: diag(6677, 3 /* Message */, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."), - Specify_an_output_folder_for_all_emitted_files: diag(6678, 3 /* Message */, "Specify_an_output_folder_for_all_emitted_files_6678", "Specify an output folder for all emitted files."), - Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, 3 /* Message */, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."), - Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations: diag(6680, 3 /* Message */, "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680", "Specify a set of entries that re-map imports to additional lookup locations."), - Specify_a_list_of_language_service_plugins_to_include: diag(6681, 3 /* Message */, "Specify_a_list_of_language_service_plugins_to_include_6681", "Specify a list of language service plugins to include."), - Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, 3 /* Message */, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing 'const enum' declarations in generated code."), - Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node: diag(6683, 3 /* Message */, "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683", "Disable resolving symlinks to their realpath. This correlates to the same flag in node."), - Disable_wiping_the_console_in_watch_mode: diag(6684, 3 /* Message */, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode."), - Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, 3 /* Message */, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read."), - Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, 3 /* Message */, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."), - Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references: diag(6687, 3 /* Message */, "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687", "Specify an array of objects that specify paths for projects. Used in project references."), - Disable_emitting_comments: diag(6688, 3 /* Message */, "Disable_emitting_comments_6688", "Disable emitting comments."), - Enable_importing_json_files: diag(6689, 3 /* Message */, "Enable_importing_json_files_6689", "Enable importing .json files."), - Specify_the_root_folder_within_your_source_files: diag(6690, 3 /* Message */, "Specify_the_root_folder_within_your_source_files_6690", "Specify the root folder within your source files."), - Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules: diag(6691, 3 /* Message */, "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691", "Allow multiple folders to be treated as one when resolving modules."), - Skip_type_checking_d_ts_files_that_are_included_with_TypeScript: diag(6692, 3 /* Message */, "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692", "Skip type checking .d.ts files that are included with TypeScript."), - Skip_type_checking_all_d_ts_files: diag(6693, 3 /* Message */, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."), - Create_source_map_files_for_emitted_JavaScript_files: diag(6694, 3 /* Message */, "Create_source_map_files_for_emitted_JavaScript_files_6694", "Create source map files for emitted JavaScript files."), - Specify_the_root_path_for_debuggers_to_find_the_reference_source_code: diag(6695, 3 /* Message */, "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695", "Specify the root path for debuggers to find the reference source code."), - Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, 3 /* Message */, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."), - When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible: diag(6698, 3 /* Message */, "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698", "When assigning functions, check to ensure parameters and the return values are subtype-compatible."), - When_type_checking_take_into_account_null_and_undefined: diag(6699, 3 /* Message */, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account 'null' and 'undefined'."), - Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor: diag(6700, 3 /* Message */, "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700", "Check for class properties that are declared but not set in the constructor."), - Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, 3 /* Message */, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have '@internal' in their JSDoc comments."), - Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals: diag(6702, 3 /* Message */, "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702", "Disable reporting of excess property errors during the creation of object literals."), - Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, 3 /* Message */, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."), - Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6704, 3 /* Message */, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704", "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."), - Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations: diag(6705, 3 /* Message */, "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705", "Set the JavaScript language version for emitted JavaScript and include compatible library declarations."), - Log_paths_used_during_the_moduleResolution_process: diag(6706, 3 /* Message */, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the 'moduleResolution' process."), - Specify_the_path_to_tsbuildinfo_incremental_compilation_file: diag(6707, 3 /* Message */, "Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707", "Specify the path to .tsbuildinfo incremental compilation file."), - Specify_options_for_automatic_acquisition_of_declaration_files: diag(6709, 3 /* Message */, "Specify_options_for_automatic_acquisition_of_declaration_files_6709", "Specify options for automatic acquisition of declaration files."), - Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, 3 /* Message */, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like './node_modules/@types'."), - Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file: diag(6711, 3 /* Message */, "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711", "Specify type package names to be included without being referenced in a source file."), - Emit_ECMAScript_standard_compliant_class_fields: diag(6712, 3 /* Message */, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."), - Enable_verbose_logging: diag(6713, 3 /* Message */, "Enable_verbose_logging_6713", "Enable verbose logging."), - Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: diag(6714, 3 /* Message */, "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714", "Specify how directories are watched on systems that lack recursive file-watching functionality."), - Specify_how_the_TypeScript_watch_mode_works: diag(6715, 3 /* Message */, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."), - Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), - Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), - Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."), - Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3 /* Message */, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."), - Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript: diag(6721, 3 /* Message */, "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721", "Do not allow runtime constructs that are not part of ECMAScript."), - Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), - Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."), - Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3 /* Message */, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."), - Check_side_effect_imports: diag(6806, 3 /* Message */, "Check_side_effect_imports_6806", "Check side effect imports."), - This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: diag(6807, 1 /* Error */, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."), - Enable_lib_replacement: diag(6808, 3 /* Message */, "Enable_lib_replacement_6808", "Enable lib replacement."), - one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"), - one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"), - type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"), - default_Colon: diag(6903, 3 /* Message */, "default_Colon_6903", "default:"), - module_system_or_esModuleInterop: diag(6904, 3 /* Message */, "module_system_or_esModuleInterop_6904", 'module === "system" or esModuleInterop'), - false_unless_strict_is_set: diag(6905, 3 /* Message */, "false_unless_strict_is_set_6905", "`false`, unless `strict` is set"), - false_unless_composite_is_set: diag(6906, 3 /* Message */, "false_unless_composite_is_set_6906", "`false`, unless `composite` is set"), - node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified: diag(6907, 3 /* Message */, "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907", '`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'), - if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk: diag(6908, 3 /* Message */, "if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908", '`[]` if `files` is specified, otherwise `["**/*"]`'), - true_if_composite_false_otherwise: diag(6909, 3 /* Message */, "true_if_composite_false_otherwise_6909", "`true` if `composite`, `false` otherwise"), - module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node: diag(69010, 3 /* Message */, "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010", "module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"), - Computed_from_the_list_of_input_files: diag(6911, 3 /* Message */, "Computed_from_the_list_of_input_files_6911", "Computed from the list of input files"), - Platform_specific: diag(6912, 3 /* Message */, "Platform_specific_6912", "Platform specific"), - You_can_learn_about_all_of_the_compiler_options_at_0: diag(6913, 3 /* Message */, "You_can_learn_about_all_of_the_compiler_options_at_0_6913", "You can learn about all of the compiler options at {0}"), - Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon: diag(6914, 3 /* Message */, "Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914", "Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"), - Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0: diag(6915, 3 /* Message */, "Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915", "Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"), - COMMON_COMMANDS: diag(6916, 3 /* Message */, "COMMON_COMMANDS_6916", "COMMON COMMANDS"), - ALL_COMPILER_OPTIONS: diag(6917, 3 /* Message */, "ALL_COMPILER_OPTIONS_6917", "ALL COMPILER OPTIONS"), - WATCH_OPTIONS: diag(6918, 3 /* Message */, "WATCH_OPTIONS_6918", "WATCH OPTIONS"), - BUILD_OPTIONS: diag(6919, 3 /* Message */, "BUILD_OPTIONS_6919", "BUILD OPTIONS"), - COMMON_COMPILER_OPTIONS: diag(6920, 3 /* Message */, "COMMON_COMPILER_OPTIONS_6920", "COMMON COMPILER OPTIONS"), - COMMAND_LINE_FLAGS: diag(6921, 3 /* Message */, "COMMAND_LINE_FLAGS_6921", "COMMAND LINE FLAGS"), - tsc_Colon_The_TypeScript_Compiler: diag(6922, 3 /* Message */, "tsc_Colon_The_TypeScript_Compiler_6922", "tsc: The TypeScript Compiler"), - Compiles_the_current_project_tsconfig_json_in_the_working_directory: diag(6923, 3 /* Message */, "Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923", "Compiles the current project (tsconfig.json in the working directory.)"), - Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options: diag(6924, 3 /* Message */, "Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924", "Ignoring tsconfig.json, compiles the specified files with default compiler options."), - Build_a_composite_project_in_the_working_directory: diag(6925, 3 /* Message */, "Build_a_composite_project_in_the_working_directory_6925", "Build a composite project in the working directory."), - Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory: diag(6926, 3 /* Message */, "Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926", "Creates a tsconfig.json with the recommended settings in the working directory."), - Compiles_the_TypeScript_project_located_at_the_specified_path: diag(6927, 3 /* Message */, "Compiles_the_TypeScript_project_located_at_the_specified_path_6927", "Compiles the TypeScript project located at the specified path."), - An_expanded_version_of_this_information_showing_all_possible_compiler_options: diag(6928, 3 /* Message */, "An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928", "An expanded version of this information, showing all possible compiler options"), - Compiles_the_current_project_with_additional_settings: diag(6929, 3 /* Message */, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."), - true_for_ES2022_and_above_including_ESNext: diag(6930, 3 /* Message */, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."), - List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, 1 /* Error */, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."), - Variable_0_implicitly_has_an_1_type: diag(7005, 1 /* Error */, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), - Parameter_0_implicitly_has_an_1_type: diag(7006, 1 /* Error */, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), - Member_0_implicitly_has_an_1_type: diag(7008, 1 /* Error */, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), - This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."), - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), - Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), - Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), - Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: diag(7016, 1 /* Error */, "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", "Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."), - Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: diag(7017, 1 /* Error */, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017", "Element implicitly has an 'any' type because type '{0}' has no index signature."), - Object_literal_s_property_0_implicitly_has_an_1_type: diag(7018, 1 /* Error */, "Object_literal_s_property_0_implicitly_has_an_1_type_7018", "Object literal's property '{0}' implicitly has an '{1}' type."), - Rest_parameter_0_implicitly_has_an_any_type: diag(7019, 1 /* Error */, "Rest_parameter_0_implicitly_has_an_any_type_7019", "Rest parameter '{0}' implicitly has an 'any[]' type."), - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7020, 1 /* Error */, "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020", "Call signature, which lacks return-type annotation, implicitly has an 'any' return type."), - _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: diag(7022, 1 /* Error */, "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022", "'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."), - _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: diag(7023, 1 /* Error */, "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", "'{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."), - 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: diag(7024, 1 /* Error */, "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", "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."), - Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation: diag(7025, 1 /* Error */, "Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation_7025", "Generator implicitly has yield type '{0}'. Consider supplying a return type annotation."), - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: diag(7026, 1 /* Error */, "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."), - Unreachable_code_detected: diag( - 7027, - 1 /* Error */, - "Unreachable_code_detected_7027", - "Unreachable code detected.", - /*reportsUnnecessary*/ - true - ), - Unused_label: diag( - 7028, - 1 /* Error */, - "Unused_label_7028", - "Unused label.", - /*reportsUnnecessary*/ - true - ), - Fallthrough_case_in_switch: diag(7029, 1 /* Error */, "Fallthrough_case_in_switch_7029", "Fallthrough case in switch."), - Not_all_code_paths_return_a_value: diag(7030, 1 /* Error */, "Not_all_code_paths_return_a_value_7030", "Not all code paths return a value."), - Binding_element_0_implicitly_has_an_1_type: diag(7031, 1 /* Error */, "Binding_element_0_implicitly_has_an_1_type_7031", "Binding element '{0}' implicitly has an '{1}' type."), - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, 1 /* Error */, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), - Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, 1 /* Error */, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), - Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, 1 /* Error */, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), - Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, 1 /* Error */, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), - Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, 1 /* Error */, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), - Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, 3 /* Message */, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), - 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: diag(7038, 3 /* Message */, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "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."), - Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, 1 /* Error */, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), - If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1: diag(7040, 1 /* Error */, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"), - The_containing_arrow_function_captures_the_global_value_of_this: diag(7041, 1 /* Error */, "The_containing_arrow_function_captures_the_global_value_of_this_7041", "The containing arrow function captures the global value of 'this'."), - Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, 1 /* Error */, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."), - Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, 2 /* Suggestion */, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), - Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, 2 /* Suggestion */, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), - Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7045, 2 /* Suggestion */, "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045", "Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), - Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: diag(7046, 2 /* Suggestion */, "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046", "Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."), - Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: diag(7047, 2 /* Suggestion */, "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047", "Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."), - Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, 2 /* Suggestion */, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), - Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, 2 /* Suggestion */, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), - _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, 2 /* Suggestion */, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), - Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, 1 /* Error */, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), - Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1: diag(7052, 1 /* Error */, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052", "Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"), - Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, 1 /* Error */, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), - No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, 1 /* Error */, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), - _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), - The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, 1 /* Error */, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), - yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation: diag(7057, 1 /* Error */, "yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057", "'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."), - If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1: diag(7058, 1 /* Error */, "If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058", "If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"), - This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, 1 /* Error */, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."), - This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, 1 /* Error */, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."), - A_mapped_type_may_not_declare_properties_or_methods: diag(7061, 1 /* Error */, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."), - You_cannot_rename_this_element: diag(8e3, 1 /* Error */, "You_cannot_rename_this_element_8000", "You cannot rename this element."), - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), - import_can_only_be_used_in_TypeScript_files: diag(8002, 1 /* Error */, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), - export_can_only_be_used_in_TypeScript_files: diag(8003, 1 /* Error */, "export_can_only_be_used_in_TypeScript_files_8003", "'export =' can only be used in TypeScript files."), - Type_parameter_declarations_can_only_be_used_in_TypeScript_files: diag(8004, 1 /* Error */, "Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004", "Type parameter declarations can only be used in TypeScript files."), - implements_clauses_can_only_be_used_in_TypeScript_files: diag(8005, 1 /* Error */, "implements_clauses_can_only_be_used_in_TypeScript_files_8005", "'implements' clauses can only be used in TypeScript files."), - _0_declarations_can_only_be_used_in_TypeScript_files: diag(8006, 1 /* Error */, "_0_declarations_can_only_be_used_in_TypeScript_files_8006", "'{0}' declarations can only be used in TypeScript files."), - Type_aliases_can_only_be_used_in_TypeScript_files: diag(8008, 1 /* Error */, "Type_aliases_can_only_be_used_in_TypeScript_files_8008", "Type aliases can only be used in TypeScript files."), - The_0_modifier_can_only_be_used_in_TypeScript_files: diag(8009, 1 /* Error */, "The_0_modifier_can_only_be_used_in_TypeScript_files_8009", "The '{0}' modifier can only be used in TypeScript files."), - Type_annotations_can_only_be_used_in_TypeScript_files: diag(8010, 1 /* Error */, "Type_annotations_can_only_be_used_in_TypeScript_files_8010", "Type annotations can only be used in TypeScript files."), - Type_arguments_can_only_be_used_in_TypeScript_files: diag(8011, 1 /* Error */, "Type_arguments_can_only_be_used_in_TypeScript_files_8011", "Type arguments can only be used in TypeScript files."), - 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."), - JSDoc_0_is_not_attached_to_a_class: diag(8022, 1 /* Error */, "JSDoc_0_is_not_attached_to_a_class_8022", "JSDoc '@{0}' is not attached to a class."), - JSDoc_0_1_does_not_match_the_extends_2_clause: diag(8023, 1 /* Error */, "JSDoc_0_1_does_not_match_the_extends_2_clause_8023", "JSDoc '@{0} {1}' does not match the 'extends {2}' clause."), - JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name: diag(8024, 1 /* Error */, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name."), - Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: diag(8025, 1 /* Error */, "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025", "Class declarations cannot have more than one '@augments' or '@extends' tag."), - Expected_0_type_arguments_provide_these_with_an_extends_tag: diag(8026, 1 /* Error */, "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026", "Expected {0} type arguments; provide these with an '@extends' tag."), - Expected_0_1_type_arguments_provide_these_with_an_extends_tag: diag(8027, 1 /* Error */, "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027", "Expected {0}-{1} type arguments; provide these with an '@extends' tag."), - JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: diag(8028, 1 /* Error */, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."), - JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, 1 /* Error */, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), - The_type_of_a_function_declaration_must_match_the_function_s_signature: diag(8030, 1 /* Error */, "The_type_of_a_function_declaration_must_match_the_function_s_signature_8030", "The type of a function declaration must match the function's signature."), - You_cannot_rename_a_module_via_a_global_import: diag(8031, 1 /* Error */, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."), - Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, 1 /* Error */, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."), - A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, 1 /* Error */, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."), - The_tag_was_first_specified_here: diag(8034, 1 /* Error */, "The_tag_was_first_specified_here_8034", "The tag was first specified here."), - You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), - You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), - Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), - Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."), - A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: diag(8039, 1 /* Error */, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"), - Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), - Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), - Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: diag(9007, 1 /* Error */, "Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007", "Function must have an explicit return type annotation with --isolatedDeclarations."), - Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: diag(9008, 1 /* Error */, "Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008", "Method must have an explicit return type annotation with --isolatedDeclarations."), - At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations: diag(9009, 1 /* Error */, "At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9009", "At least one accessor must have an explicit type annotation with --isolatedDeclarations."), - Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations: diag(9010, 1 /* Error */, "Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010", "Variable must have an explicit type annotation with --isolatedDeclarations."), - Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations: diag(9011, 1 /* Error */, "Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011", "Parameter must have an explicit type annotation with --isolatedDeclarations."), - Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations: diag(9012, 1 /* Error */, "Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012", "Property must have an explicit type annotation with --isolatedDeclarations."), - Expression_type_can_t_be_inferred_with_isolatedDeclarations: diag(9013, 1 /* Error */, "Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013", "Expression type can't be inferred with --isolatedDeclarations."), - Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations: diag(9014, 1 /* Error */, "Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014", "Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations."), - Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations: diag(9015, 1 /* Error */, "Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015", "Objects that contain spread assignments can't be inferred with --isolatedDeclarations."), - Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations: diag(9016, 1 /* Error */, "Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016", "Objects that contain shorthand properties can't be inferred with --isolatedDeclarations."), - Only_const_arrays_can_be_inferred_with_isolatedDeclarations: diag(9017, 1 /* Error */, "Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017", "Only const arrays can be inferred with --isolatedDeclarations."), - Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations: diag(9018, 1 /* Error */, "Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018", "Arrays with spread elements can't inferred with --isolatedDeclarations."), - Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations: diag(9019, 1 /* Error */, "Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019", "Binding elements can't be exported directly with --isolatedDeclarations."), - Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations: diag(9020, 1 /* Error */, "Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020", "Enum member initializers must be computable without references to external symbols with --isolatedDeclarations."), - Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations: diag(9021, 1 /* Error */, "Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021", "Extends clause can't contain an expression with --isolatedDeclarations."), - Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations: diag(9022, 1 /* Error */, "Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022", "Inference from class expressions is not supported with --isolatedDeclarations."), - Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function: diag(9023, 1 /* Error */, "Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023", "Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function."), - Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations: diag(9025, 1 /* Error */, "Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_sup_9025", "Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations."), - Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations: diag(9026, 1 /* Error */, "Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026", "Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations."), - Add_a_type_annotation_to_the_variable_0: diag(9027, 1 /* Error */, "Add_a_type_annotation_to_the_variable_0_9027", "Add a type annotation to the variable {0}."), - Add_a_type_annotation_to_the_parameter_0: diag(9028, 1 /* Error */, "Add_a_type_annotation_to_the_parameter_0_9028", "Add a type annotation to the parameter {0}."), - Add_a_type_annotation_to_the_property_0: diag(9029, 1 /* Error */, "Add_a_type_annotation_to_the_property_0_9029", "Add a type annotation to the property {0}."), - Add_a_return_type_to_the_function_expression: diag(9030, 1 /* Error */, "Add_a_return_type_to_the_function_expression_9030", "Add a return type to the function expression."), - Add_a_return_type_to_the_function_declaration: diag(9031, 1 /* Error */, "Add_a_return_type_to_the_function_declaration_9031", "Add a return type to the function declaration."), - Add_a_return_type_to_the_get_accessor_declaration: diag(9032, 1 /* Error */, "Add_a_return_type_to_the_get_accessor_declaration_9032", "Add a return type to the get accessor declaration."), - Add_a_type_to_parameter_of_the_set_accessor_declaration: diag(9033, 1 /* Error */, "Add_a_type_to_parameter_of_the_set_accessor_declaration_9033", "Add a type to parameter of the set accessor declaration."), - Add_a_return_type_to_the_method: diag(9034, 1 /* Error */, "Add_a_return_type_to_the_method_9034", "Add a return type to the method"), - Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit: diag(9035, 1 /* Error */, "Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035", "Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."), - Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it: diag(9036, 1 /* Error */, "Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036", "Move the expression in default export to a variable and add a type annotation to it."), - Default_exports_can_t_be_inferred_with_isolatedDeclarations: diag(9037, 1 /* Error */, "Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037", "Default exports can't be inferred with --isolatedDeclarations."), - Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations: diag(9038, 1 /* Error */, "Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038", "Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."), - Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations: diag(9039, 1 /* Error */, "Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039", "Type containing private name '{0}' can't be used with --isolatedDeclarations."), - JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), - JSX_elements_cannot_have_multiple_attributes_with_the_same_name: diag(17001, 1 /* Error */, "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", "JSX elements cannot have multiple attributes with the same name."), - Expected_corresponding_JSX_closing_tag_for_0: diag(17002, 1 /* Error */, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."), - Cannot_use_JSX_unless_the_jsx_flag_is_provided: diag(17004, 1 /* Error */, "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", "Cannot use JSX unless the '--jsx' flag is provided."), - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: diag(17005, 1 /* Error */, "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", "A constructor cannot contain a 'super' call when its class extends 'null'."), - An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17006, 1 /* Error */, "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17007, 1 /* Error */, "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), - JSX_element_0_has_no_corresponding_closing_tag: diag(17008, 1 /* Error */, "JSX_element_0_has_no_corresponding_closing_tag_17008", "JSX element '{0}' has no corresponding closing tag."), - super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: diag(17009, 1 /* Error */, "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", "'super' must be called before accessing 'this' in the constructor of a derived class."), - Unknown_type_acquisition_option_0: diag(17010, 1 /* Error */, "Unknown_type_acquisition_option_0_17010", "Unknown type acquisition option '{0}'."), - super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: diag(17011, 1 /* Error */, "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", "'super' must be called before accessing a property of 'super' in the constructor of a derived class."), - _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: diag(17012, 1 /* Error */, "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"), - Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: diag(17013, 1 /* Error */, "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."), - JSX_fragment_has_no_corresponding_closing_tag: diag(17014, 1 /* Error */, "JSX_fragment_has_no_corresponding_closing_tag_17014", "JSX fragment has no corresponding closing tag."), - Expected_corresponding_closing_tag_for_JSX_fragment: diag(17015, 1 /* Error */, "Expected_corresponding_closing_tag_for_JSX_fragment_17015", "Expected corresponding closing tag for JSX fragment."), - The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option: diag(17016, 1 /* Error */, "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016", "The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."), - An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments: diag(17017, 1 /* Error */, "An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017", "An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."), - 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}'."), - File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module: diag(80001, 2 /* Suggestion */, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001", "File is a CommonJS module; it may be converted to an ES module."), - This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, 2 /* Suggestion */, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."), - Import_may_be_converted_to_a_default_import: diag(80003, 2 /* Suggestion */, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."), - JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, 2 /* Suggestion */, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."), - require_call_may_be_converted_to_an_import: diag(80005, 2 /* Suggestion */, "require_call_may_be_converted_to_an_import_80005", "'require' call may be converted to an import."), - This_may_be_converted_to_an_async_function: diag(80006, 2 /* Suggestion */, "This_may_be_converted_to_an_async_function_80006", "This may be converted to an async function."), - await_has_no_effect_on_the_type_of_this_expression: diag(80007, 2 /* Suggestion */, "await_has_no_effect_on_the_type_of_this_expression_80007", "'await' has no effect on the type of this expression."), - Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers: diag(80008, 2 /* Suggestion */, "Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008", "Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."), - JSDoc_typedef_may_be_converted_to_TypeScript_type: diag(80009, 2 /* Suggestion */, "JSDoc_typedef_may_be_converted_to_TypeScript_type_80009", "JSDoc typedef may be converted to TypeScript type."), - JSDoc_typedefs_may_be_converted_to_TypeScript_types: diag(80010, 2 /* Suggestion */, "JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010", "JSDoc typedefs may be converted to TypeScript types."), - Add_missing_super_call: diag(90001, 3 /* Message */, "Add_missing_super_call_90001", "Add missing 'super()' call"), - Make_super_call_the_first_statement_in_the_constructor: diag(90002, 3 /* Message */, "Make_super_call_the_first_statement_in_the_constructor_90002", "Make 'super()' call the first statement in the constructor"), - Change_extends_to_implements: diag(90003, 3 /* Message */, "Change_extends_to_implements_90003", "Change 'extends' to 'implements'"), - Remove_unused_declaration_for_Colon_0: diag(90004, 3 /* Message */, "Remove_unused_declaration_for_Colon_0_90004", "Remove unused declaration for: '{0}'"), - Remove_import_from_0: diag(90005, 3 /* Message */, "Remove_import_from_0_90005", "Remove import from '{0}'"), - Implement_interface_0: diag(90006, 3 /* Message */, "Implement_interface_0_90006", "Implement interface '{0}'"), - Implement_inherited_abstract_class: diag(90007, 3 /* Message */, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"), - Add_0_to_unresolved_variable: diag(90008, 3 /* Message */, "Add_0_to_unresolved_variable_90008", "Add '{0}.' to unresolved variable"), - Remove_variable_statement: diag(90010, 3 /* Message */, "Remove_variable_statement_90010", "Remove variable statement"), - Remove_template_tag: diag(90011, 3 /* Message */, "Remove_template_tag_90011", "Remove template tag"), - Remove_type_parameters: diag(90012, 3 /* Message */, "Remove_type_parameters_90012", "Remove type parameters"), - Import_0_from_1: diag(90013, 3 /* Message */, "Import_0_from_1_90013", `Import '{0}' from "{1}"`), - Change_0_to_1: diag(90014, 3 /* Message */, "Change_0_to_1_90014", "Change '{0}' to '{1}'"), - Declare_property_0: diag(90016, 3 /* Message */, "Declare_property_0_90016", "Declare property '{0}'"), - Add_index_signature_for_property_0: diag(90017, 3 /* Message */, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"), - Disable_checking_for_this_file: diag(90018, 3 /* Message */, "Disable_checking_for_this_file_90018", "Disable checking for this file"), - Ignore_this_error_message: diag(90019, 3 /* Message */, "Ignore_this_error_message_90019", "Ignore this error message"), - Initialize_property_0_in_the_constructor: diag(90020, 3 /* Message */, "Initialize_property_0_in_the_constructor_90020", "Initialize property '{0}' in the constructor"), - Initialize_static_property_0: diag(90021, 3 /* Message */, "Initialize_static_property_0_90021", "Initialize static property '{0}'"), - Change_spelling_to_0: diag(90022, 3 /* Message */, "Change_spelling_to_0_90022", "Change spelling to '{0}'"), - Declare_method_0: diag(90023, 3 /* Message */, "Declare_method_0_90023", "Declare method '{0}'"), - Declare_static_method_0: diag(90024, 3 /* Message */, "Declare_static_method_0_90024", "Declare static method '{0}'"), - Prefix_0_with_an_underscore: diag(90025, 3 /* Message */, "Prefix_0_with_an_underscore_90025", "Prefix '{0}' with an underscore"), - Rewrite_as_the_indexed_access_type_0: diag(90026, 3 /* Message */, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), - Declare_static_property_0: diag(90027, 3 /* Message */, "Declare_static_property_0_90027", "Declare static property '{0}'"), - Call_decorator_expression: diag(90028, 3 /* Message */, "Call_decorator_expression_90028", "Call decorator expression"), - Add_async_modifier_to_containing_function: diag(90029, 3 /* Message */, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), - Replace_infer_0_with_unknown: diag(90030, 3 /* Message */, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"), - Replace_all_unused_infer_with_unknown: diag(90031, 3 /* Message */, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), - Add_parameter_name: diag(90034, 3 /* Message */, "Add_parameter_name_90034", "Add parameter name"), - Declare_private_property_0: diag(90035, 3 /* Message */, "Declare_private_property_0_90035", "Declare private property '{0}'"), - Replace_0_with_Promise_1: diag(90036, 3 /* Message */, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"), - Fix_all_incorrect_return_type_of_an_async_functions: diag(90037, 3 /* Message */, "Fix_all_incorrect_return_type_of_an_async_functions_90037", "Fix all incorrect return type of an async functions"), - Declare_private_method_0: diag(90038, 3 /* Message */, "Declare_private_method_0_90038", "Declare private method '{0}'"), - Remove_unused_destructuring_declaration: diag(90039, 3 /* Message */, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"), - Remove_unused_declarations_for_Colon_0: diag(90041, 3 /* Message */, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"), - Declare_a_private_field_named_0: diag(90053, 3 /* Message */, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), - Includes_imports_of_types_referenced_by_0: diag(90054, 3 /* Message */, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"), - Remove_type_from_import_declaration_from_0: diag(90055, 3 /* Message */, "Remove_type_from_import_declaration_from_0_90055", `Remove 'type' from import declaration from "{0}"`), - Remove_type_from_import_of_0_from_1: diag(90056, 3 /* Message */, "Remove_type_from_import_of_0_from_1_90056", `Remove 'type' from import of '{0}' from "{1}"`), - Add_import_from_0: diag(90057, 3 /* Message */, "Add_import_from_0_90057", 'Add import from "{0}"'), - Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'), - Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"), - Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"), - Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"), - Add_annotation_of_type_0: diag(90062, 3 /* Message */, "Add_annotation_of_type_0_90062", "Add annotation of type '{0}'"), - Add_return_type_0: diag(90063, 3 /* Message */, "Add_return_type_0_90063", "Add return type '{0}'"), - Extract_base_class_to_variable: diag(90064, 3 /* Message */, "Extract_base_class_to_variable_90064", "Extract base class to variable"), - Extract_default_export_to_variable: diag(90065, 3 /* Message */, "Extract_default_export_to_variable_90065", "Extract default export to variable"), - Extract_binding_expressions_to_variable: diag(90066, 3 /* Message */, "Extract_binding_expressions_to_variable_90066", "Extract binding expressions to variable"), - Add_all_missing_type_annotations: diag(90067, 3 /* Message */, "Add_all_missing_type_annotations_90067", "Add all missing type annotations"), - Add_satisfies_and_an_inline_type_assertion_with_0: diag(90068, 3 /* Message */, "Add_satisfies_and_an_inline_type_assertion_with_0_90068", "Add satisfies and an inline type assertion with '{0}'"), - Extract_to_variable_and_replace_with_0_as_typeof_0: diag(90069, 3 /* Message */, "Extract_to_variable_and_replace_with_0_as_typeof_0_90069", "Extract to variable and replace with '{0} as typeof {0}'"), - Mark_array_literal_as_const: diag(90070, 3 /* Message */, "Mark_array_literal_as_const_90070", "Mark array literal as const"), - Annotate_types_of_properties_expando_function_in_a_namespace: diag(90071, 3 /* Message */, "Annotate_types_of_properties_expando_function_in_a_namespace_90071", "Annotate types of properties expando function in a namespace"), - Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), - Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), - Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), - Extract_function: diag(95005, 3 /* Message */, "Extract_function_95005", "Extract function"), - Extract_constant: diag(95006, 3 /* Message */, "Extract_constant_95006", "Extract constant"), - Extract_to_0_in_enclosing_scope: diag(95007, 3 /* Message */, "Extract_to_0_in_enclosing_scope_95007", "Extract to {0} in enclosing scope"), - Extract_to_0_in_1_scope: diag(95008, 3 /* Message */, "Extract_to_0_in_1_scope_95008", "Extract to {0} in {1} scope"), - Annotate_with_type_from_JSDoc: diag(95009, 3 /* Message */, "Annotate_with_type_from_JSDoc_95009", "Annotate with type from JSDoc"), - Infer_type_of_0_from_usage: diag(95011, 3 /* Message */, "Infer_type_of_0_from_usage_95011", "Infer type of '{0}' from usage"), - Infer_parameter_types_from_usage: diag(95012, 3 /* Message */, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), - Convert_to_default_import: diag(95013, 3 /* Message */, "Convert_to_default_import_95013", "Convert to default import"), - Install_0: diag(95014, 3 /* Message */, "Install_0_95014", "Install '{0}'"), - Replace_import_with_0: diag(95015, 3 /* Message */, "Replace_import_with_0_95015", "Replace import with '{0}'."), - Use_synthetic_default_member: diag(95016, 3 /* Message */, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), - Convert_to_ES_module: diag(95017, 3 /* Message */, "Convert_to_ES_module_95017", "Convert to ES module"), - Add_undefined_type_to_property_0: diag(95018, 3 /* Message */, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), - Add_initializer_to_property_0: diag(95019, 3 /* Message */, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), - Add_definite_assignment_assertion_to_property_0: diag(95020, 3 /* Message */, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), - Convert_all_type_literals_to_mapped_type: diag(95021, 3 /* Message */, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), - Add_all_missing_members: diag(95022, 3 /* Message */, "Add_all_missing_members_95022", "Add all missing members"), - Infer_all_types_from_usage: diag(95023, 3 /* Message */, "Infer_all_types_from_usage_95023", "Infer all types from usage"), - Delete_all_unused_declarations: diag(95024, 3 /* Message */, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), - Prefix_all_unused_declarations_with_where_possible: diag(95025, 3 /* Message */, "Prefix_all_unused_declarations_with_where_possible_95025", "Prefix all unused declarations with '_' where possible"), - Fix_all_detected_spelling_errors: diag(95026, 3 /* Message */, "Fix_all_detected_spelling_errors_95026", "Fix all detected spelling errors"), - Add_initializers_to_all_uninitialized_properties: diag(95027, 3 /* Message */, "Add_initializers_to_all_uninitialized_properties_95027", "Add initializers to all uninitialized properties"), - Add_definite_assignment_assertions_to_all_uninitialized_properties: diag(95028, 3 /* Message */, "Add_definite_assignment_assertions_to_all_uninitialized_properties_95028", "Add definite assignment assertions to all uninitialized properties"), - Add_undefined_type_to_all_uninitialized_properties: diag(95029, 3 /* Message */, "Add_undefined_type_to_all_uninitialized_properties_95029", "Add undefined type to all uninitialized properties"), - Change_all_jsdoc_style_types_to_TypeScript: diag(95030, 3 /* Message */, "Change_all_jsdoc_style_types_to_TypeScript_95030", "Change all jsdoc-style types to TypeScript"), - Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types: diag(95031, 3 /* Message */, "Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031", "Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"), - Implement_all_unimplemented_interfaces: diag(95032, 3 /* Message */, "Implement_all_unimplemented_interfaces_95032", "Implement all unimplemented interfaces"), - Install_all_missing_types_packages: diag(95033, 3 /* Message */, "Install_all_missing_types_packages_95033", "Install all missing types packages"), - Rewrite_all_as_indexed_access_types: diag(95034, 3 /* Message */, "Rewrite_all_as_indexed_access_types_95034", "Rewrite all as indexed access types"), - Convert_all_to_default_imports: diag(95035, 3 /* Message */, "Convert_all_to_default_imports_95035", "Convert all to default imports"), - Make_all_super_calls_the_first_statement_in_their_constructor: diag(95036, 3 /* Message */, "Make_all_super_calls_the_first_statement_in_their_constructor_95036", "Make all 'super()' calls the first statement in their constructor"), - Add_qualifier_to_all_unresolved_variables_matching_a_member_name: diag(95037, 3 /* Message */, "Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037", "Add qualifier to all unresolved variables matching a member name"), - Change_all_extended_interfaces_to_implements: diag(95038, 3 /* Message */, "Change_all_extended_interfaces_to_implements_95038", "Change all extended interfaces to 'implements'"), - Add_all_missing_super_calls: diag(95039, 3 /* Message */, "Add_all_missing_super_calls_95039", "Add all missing super calls"), - Implement_all_inherited_abstract_classes: diag(95040, 3 /* Message */, "Implement_all_inherited_abstract_classes_95040", "Implement all inherited abstract classes"), - Add_all_missing_async_modifiers: diag(95041, 3 /* Message */, "Add_all_missing_async_modifiers_95041", "Add all missing 'async' modifiers"), - Add_ts_ignore_to_all_error_messages: diag(95042, 3 /* Message */, "Add_ts_ignore_to_all_error_messages_95042", "Add '@ts-ignore' to all error messages"), - Annotate_everything_with_types_from_JSDoc: diag(95043, 3 /* Message */, "Annotate_everything_with_types_from_JSDoc_95043", "Annotate everything with types from JSDoc"), - Add_to_all_uncalled_decorators: diag(95044, 3 /* Message */, "Add_to_all_uncalled_decorators_95044", "Add '()' to all uncalled decorators"), - Convert_all_constructor_functions_to_classes: diag(95045, 3 /* Message */, "Convert_all_constructor_functions_to_classes_95045", "Convert all constructor functions to classes"), - Generate_get_and_set_accessors: diag(95046, 3 /* Message */, "Generate_get_and_set_accessors_95046", "Generate 'get' and 'set' accessors"), - Convert_require_to_import: diag(95047, 3 /* Message */, "Convert_require_to_import_95047", "Convert 'require' to 'import'"), - Convert_all_require_to_import: diag(95048, 3 /* Message */, "Convert_all_require_to_import_95048", "Convert all 'require' to 'import'"), - Move_to_a_new_file: diag(95049, 3 /* Message */, "Move_to_a_new_file_95049", "Move to a new file"), - Remove_unreachable_code: diag(95050, 3 /* Message */, "Remove_unreachable_code_95050", "Remove unreachable code"), - Remove_all_unreachable_code: diag(95051, 3 /* Message */, "Remove_all_unreachable_code_95051", "Remove all unreachable code"), - Add_missing_typeof: diag(95052, 3 /* Message */, "Add_missing_typeof_95052", "Add missing 'typeof'"), - Remove_unused_label: diag(95053, 3 /* Message */, "Remove_unused_label_95053", "Remove unused label"), - Remove_all_unused_labels: diag(95054, 3 /* Message */, "Remove_all_unused_labels_95054", "Remove all unused labels"), - Convert_0_to_mapped_object_type: diag(95055, 3 /* Message */, "Convert_0_to_mapped_object_type_95055", "Convert '{0}' to mapped object type"), - Convert_namespace_import_to_named_imports: diag(95056, 3 /* Message */, "Convert_namespace_import_to_named_imports_95056", "Convert namespace import to named imports"), - Convert_named_imports_to_namespace_import: diag(95057, 3 /* Message */, "Convert_named_imports_to_namespace_import_95057", "Convert named imports to namespace import"), - Add_or_remove_braces_in_an_arrow_function: diag(95058, 3 /* Message */, "Add_or_remove_braces_in_an_arrow_function_95058", "Add or remove braces in an arrow function"), - Add_braces_to_arrow_function: diag(95059, 3 /* Message */, "Add_braces_to_arrow_function_95059", "Add braces to arrow function"), - Remove_braces_from_arrow_function: diag(95060, 3 /* Message */, "Remove_braces_from_arrow_function_95060", "Remove braces from arrow function"), - Convert_default_export_to_named_export: diag(95061, 3 /* Message */, "Convert_default_export_to_named_export_95061", "Convert default export to named export"), - Convert_named_export_to_default_export: diag(95062, 3 /* Message */, "Convert_named_export_to_default_export_95062", "Convert named export to default export"), - Add_missing_enum_member_0: diag(95063, 3 /* Message */, "Add_missing_enum_member_0_95063", "Add missing enum member '{0}'"), - Add_all_missing_imports: diag(95064, 3 /* Message */, "Add_all_missing_imports_95064", "Add all missing imports"), - Convert_to_async_function: diag(95065, 3 /* Message */, "Convert_to_async_function_95065", "Convert to async function"), - Convert_all_to_async_functions: diag(95066, 3 /* Message */, "Convert_all_to_async_functions_95066", "Convert all to async functions"), - Add_missing_call_parentheses: diag(95067, 3 /* Message */, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), - Add_all_missing_call_parentheses: diag(95068, 3 /* Message */, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), - Add_unknown_conversion_for_non_overlapping_types: diag(95069, 3 /* Message */, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), - Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, 3 /* Message */, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), - Add_missing_new_operator_to_call: diag(95071, 3 /* Message */, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), - Add_missing_new_operator_to_all_calls: diag(95072, 3 /* Message */, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), - Add_names_to_all_parameters_without_names: diag(95073, 3 /* Message */, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), - Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, 3 /* Message */, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"), - Convert_parameters_to_destructured_object: diag(95075, 3 /* Message */, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"), - Extract_type: diag(95077, 3 /* Message */, "Extract_type_95077", "Extract type"), - Extract_to_type_alias: diag(95078, 3 /* Message */, "Extract_to_type_alias_95078", "Extract to type alias"), - Extract_to_typedef: diag(95079, 3 /* Message */, "Extract_to_typedef_95079", "Extract to typedef"), - Infer_this_type_of_0_from_usage: diag(95080, 3 /* Message */, "Infer_this_type_of_0_from_usage_95080", "Infer 'this' type of '{0}' from usage"), - Add_const_to_unresolved_variable: diag(95081, 3 /* Message */, "Add_const_to_unresolved_variable_95081", "Add 'const' to unresolved variable"), - Add_const_to_all_unresolved_variables: diag(95082, 3 /* Message */, "Add_const_to_all_unresolved_variables_95082", "Add 'const' to all unresolved variables"), - Add_await: diag(95083, 3 /* Message */, "Add_await_95083", "Add 'await'"), - Add_await_to_initializer_for_0: diag(95084, 3 /* Message */, "Add_await_to_initializer_for_0_95084", "Add 'await' to initializer for '{0}'"), - Fix_all_expressions_possibly_missing_await: diag(95085, 3 /* Message */, "Fix_all_expressions_possibly_missing_await_95085", "Fix all expressions possibly missing 'await'"), - Remove_unnecessary_await: diag(95086, 3 /* Message */, "Remove_unnecessary_await_95086", "Remove unnecessary 'await'"), - Remove_all_unnecessary_uses_of_await: diag(95087, 3 /* Message */, "Remove_all_unnecessary_uses_of_await_95087", "Remove all unnecessary uses of 'await'"), - Enable_the_jsx_flag_in_your_configuration_file: diag(95088, 3 /* Message */, "Enable_the_jsx_flag_in_your_configuration_file_95088", "Enable the '--jsx' flag in your configuration file"), - Add_await_to_initializers: diag(95089, 3 /* Message */, "Add_await_to_initializers_95089", "Add 'await' to initializers"), - Extract_to_interface: diag(95090, 3 /* Message */, "Extract_to_interface_95090", "Extract to interface"), - Convert_to_a_bigint_numeric_literal: diag(95091, 3 /* Message */, "Convert_to_a_bigint_numeric_literal_95091", "Convert to a bigint numeric literal"), - Convert_all_to_bigint_numeric_literals: diag(95092, 3 /* Message */, "Convert_all_to_bigint_numeric_literals_95092", "Convert all to bigint numeric literals"), - Convert_const_to_let: diag(95093, 3 /* Message */, "Convert_const_to_let_95093", "Convert 'const' to 'let'"), - Prefix_with_declare: diag(95094, 3 /* Message */, "Prefix_with_declare_95094", "Prefix with 'declare'"), - Prefix_all_incorrect_property_declarations_with_declare: diag(95095, 3 /* Message */, "Prefix_all_incorrect_property_declarations_with_declare_95095", "Prefix all incorrect property declarations with 'declare'"), - Convert_to_template_string: diag(95096, 3 /* Message */, "Convert_to_template_string_95096", "Convert to template string"), - Add_export_to_make_this_file_into_a_module: diag(95097, 3 /* Message */, "Add_export_to_make_this_file_into_a_module_95097", "Add 'export {}' to make this file into a module"), - Set_the_target_option_in_your_configuration_file_to_0: diag(95098, 3 /* Message */, "Set_the_target_option_in_your_configuration_file_to_0_95098", "Set the 'target' option in your configuration file to '{0}'"), - Set_the_module_option_in_your_configuration_file_to_0: diag(95099, 3 /* Message */, "Set_the_module_option_in_your_configuration_file_to_0_95099", "Set the 'module' option in your configuration file to '{0}'"), - Convert_invalid_character_to_its_html_entity_code: diag(95100, 3 /* Message */, "Convert_invalid_character_to_its_html_entity_code_95100", "Convert invalid character to its html entity code"), - Convert_all_invalid_characters_to_HTML_entity_code: diag(95101, 3 /* Message */, "Convert_all_invalid_characters_to_HTML_entity_code_95101", "Convert all invalid characters to HTML entity code"), - Convert_all_const_to_let: diag(95102, 3 /* Message */, "Convert_all_const_to_let_95102", "Convert all 'const' to 'let'"), - Convert_function_expression_0_to_arrow_function: diag(95105, 3 /* Message */, "Convert_function_expression_0_to_arrow_function_95105", "Convert function expression '{0}' to arrow function"), - Convert_function_declaration_0_to_arrow_function: diag(95106, 3 /* Message */, "Convert_function_declaration_0_to_arrow_function_95106", "Convert function declaration '{0}' to arrow function"), - Fix_all_implicit_this_errors: diag(95107, 3 /* Message */, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"), - Wrap_invalid_character_in_an_expression_container: diag(95108, 3 /* Message */, "Wrap_invalid_character_in_an_expression_container_95108", "Wrap invalid character in an expression container"), - Wrap_all_invalid_characters_in_an_expression_container: diag(95109, 3 /* Message */, "Wrap_all_invalid_characters_in_an_expression_container_95109", "Wrap all invalid characters in an expression container"), - Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file: diag(95110, 3 /* Message */, "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110", "Visit https://aka.ms/tsconfig to read more about this file"), - Add_a_return_statement: diag(95111, 3 /* Message */, "Add_a_return_statement_95111", "Add a return statement"), - Remove_braces_from_arrow_function_body: diag(95112, 3 /* Message */, "Remove_braces_from_arrow_function_body_95112", "Remove braces from arrow function body"), - Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal: diag(95113, 3 /* Message */, "Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113", "Wrap the following body with parentheses which should be an object literal"), - Add_all_missing_return_statement: diag(95114, 3 /* Message */, "Add_all_missing_return_statement_95114", "Add all missing return statement"), - Remove_braces_from_all_arrow_function_bodies_with_relevant_issues: diag(95115, 3 /* Message */, "Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115", "Remove braces from all arrow function bodies with relevant issues"), - Wrap_all_object_literal_with_parentheses: diag(95116, 3 /* Message */, "Wrap_all_object_literal_with_parentheses_95116", "Wrap all object literal with parentheses"), - Move_labeled_tuple_element_modifiers_to_labels: diag(95117, 3 /* Message */, "Move_labeled_tuple_element_modifiers_to_labels_95117", "Move labeled tuple element modifiers to labels"), - Convert_overload_list_to_single_signature: diag(95118, 3 /* Message */, "Convert_overload_list_to_single_signature_95118", "Convert overload list to single signature"), - Generate_get_and_set_accessors_for_all_overriding_properties: diag(95119, 3 /* Message */, "Generate_get_and_set_accessors_for_all_overriding_properties_95119", "Generate 'get' and 'set' accessors for all overriding properties"), - Wrap_in_JSX_fragment: diag(95120, 3 /* Message */, "Wrap_in_JSX_fragment_95120", "Wrap in JSX fragment"), - Wrap_all_unparented_JSX_in_JSX_fragment: diag(95121, 3 /* Message */, "Wrap_all_unparented_JSX_in_JSX_fragment_95121", "Wrap all unparented JSX in JSX fragment"), - Convert_arrow_function_or_function_expression: diag(95122, 3 /* Message */, "Convert_arrow_function_or_function_expression_95122", "Convert arrow function or function expression"), - Convert_to_anonymous_function: diag(95123, 3 /* Message */, "Convert_to_anonymous_function_95123", "Convert to anonymous function"), - Convert_to_named_function: diag(95124, 3 /* Message */, "Convert_to_named_function_95124", "Convert to named function"), - Convert_to_arrow_function: diag(95125, 3 /* Message */, "Convert_to_arrow_function_95125", "Convert to arrow function"), - Remove_parentheses: diag(95126, 3 /* Message */, "Remove_parentheses_95126", "Remove parentheses"), - Could_not_find_a_containing_arrow_function: diag(95127, 3 /* Message */, "Could_not_find_a_containing_arrow_function_95127", "Could not find a containing arrow function"), - Containing_function_is_not_an_arrow_function: diag(95128, 3 /* Message */, "Containing_function_is_not_an_arrow_function_95128", "Containing function is not an arrow function"), - Could_not_find_export_statement: diag(95129, 3 /* Message */, "Could_not_find_export_statement_95129", "Could not find export statement"), - This_file_already_has_a_default_export: diag(95130, 3 /* Message */, "This_file_already_has_a_default_export_95130", "This file already has a default export"), - Could_not_find_import_clause: diag(95131, 3 /* Message */, "Could_not_find_import_clause_95131", "Could not find import clause"), - Could_not_find_namespace_import_or_named_imports: diag(95132, 3 /* Message */, "Could_not_find_namespace_import_or_named_imports_95132", "Could not find namespace import or named imports"), - Selection_is_not_a_valid_type_node: diag(95133, 3 /* Message */, "Selection_is_not_a_valid_type_node_95133", "Selection is not a valid type node"), - No_type_could_be_extracted_from_this_type_node: diag(95134, 3 /* Message */, "No_type_could_be_extracted_from_this_type_node_95134", "No type could be extracted from this type node"), - Could_not_find_property_for_which_to_generate_accessor: diag(95135, 3 /* Message */, "Could_not_find_property_for_which_to_generate_accessor_95135", "Could not find property for which to generate accessor"), - Name_is_not_valid: diag(95136, 3 /* Message */, "Name_is_not_valid_95136", "Name is not valid"), - Can_only_convert_property_with_modifier: diag(95137, 3 /* Message */, "Can_only_convert_property_with_modifier_95137", "Can only convert property with modifier"), - Switch_each_misused_0_to_1: diag(95138, 3 /* Message */, "Switch_each_misused_0_to_1_95138", "Switch each misused '{0}' to '{1}'"), - Convert_to_optional_chain_expression: diag(95139, 3 /* Message */, "Convert_to_optional_chain_expression_95139", "Convert to optional chain expression"), - Could_not_find_convertible_access_expression: diag(95140, 3 /* Message */, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), - Could_not_find_matching_access_expressions: diag(95141, 3 /* Message */, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), - Can_only_convert_logical_AND_access_chains: diag(95142, 3 /* Message */, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), - Add_void_to_Promise_resolved_without_a_value: diag(95143, 3 /* Message */, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), - Add_void_to_all_Promises_resolved_without_a_value: diag(95144, 3 /* Message */, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), - Use_element_access_for_0: diag(95145, 3 /* Message */, "Use_element_access_for_0_95145", "Use element access for '{0}'"), - Use_element_access_for_all_undeclared_properties: diag(95146, 3 /* Message */, "Use_element_access_for_all_undeclared_properties_95146", "Use element access for all undeclared properties."), - Delete_all_unused_imports: diag(95147, 3 /* Message */, "Delete_all_unused_imports_95147", "Delete all unused imports"), - Infer_function_return_type: diag(95148, 3 /* Message */, "Infer_function_return_type_95148", "Infer function return type"), - Return_type_must_be_inferred_from_a_function: diag(95149, 3 /* Message */, "Return_type_must_be_inferred_from_a_function_95149", "Return type must be inferred from a function"), - Could_not_determine_function_return_type: diag(95150, 3 /* Message */, "Could_not_determine_function_return_type_95150", "Could not determine function return type"), - 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_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"), - Method_not_implemented: diag(95158, 3 /* Message */, "Method_not_implemented_95158", "Method not implemented."), - Function_not_implemented: diag(95159, 3 /* Message */, "Function_not_implemented_95159", "Function not implemented."), - Add_override_modifier: diag(95160, 3 /* Message */, "Add_override_modifier_95160", "Add 'override' modifier"), - Remove_override_modifier: diag(95161, 3 /* Message */, "Remove_override_modifier_95161", "Remove 'override' modifier"), - Add_all_missing_override_modifiers: diag(95162, 3 /* Message */, "Add_all_missing_override_modifiers_95162", "Add all missing 'override' modifiers"), - Remove_all_unnecessary_override_modifiers: diag(95163, 3 /* Message */, "Remove_all_unnecessary_override_modifiers_95163", "Remove all unnecessary 'override' modifiers"), - Can_only_convert_named_export: diag(95164, 3 /* Message */, "Can_only_convert_named_export_95164", "Can only convert named export"), - Add_missing_properties: diag(95165, 3 /* Message */, "Add_missing_properties_95165", "Add missing properties"), - Add_all_missing_properties: diag(95166, 3 /* Message */, "Add_all_missing_properties_95166", "Add all missing properties"), - Add_missing_attributes: diag(95167, 3 /* Message */, "Add_missing_attributes_95167", "Add missing attributes"), - Add_all_missing_attributes: diag(95168, 3 /* Message */, "Add_all_missing_attributes_95168", "Add all missing attributes"), - Add_undefined_to_optional_property_type: diag(95169, 3 /* Message */, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"), - Convert_named_imports_to_default_import: diag(95170, 3 /* Message */, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"), - Delete_unused_param_tag_0: diag(95171, 3 /* Message */, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"), - Delete_all_unused_param_tags: diag(95172, 3 /* Message */, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"), - Rename_param_tag_name_0_to_1: diag(95173, 3 /* Message */, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"), - Use_0: diag(95174, 3 /* Message */, "Use_0_95174", "Use `{0}`."), - Use_Number_isNaN_in_all_conditions: diag(95175, 3 /* Message */, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."), - Convert_typedef_to_TypeScript_type: diag(95176, 3 /* Message */, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."), - 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"), - Wrap_in_parentheses: diag(95194, 3 /* Message */, "Wrap_in_parentheses_95194", "Wrap in parentheses"), - Wrap_all_invalid_decorator_expressions_in_parentheses: diag(95195, 3 /* Message */, "Wrap_all_invalid_decorator_expressions_in_parentheses_95195", "Wrap all invalid decorator expressions in parentheses"), - Add_resolution_mode_import_attribute: diag(95196, 3 /* Message */, "Add_resolution_mode_import_attribute_95196", "Add 'resolution-mode' import attribute"), - Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it: diag(95197, 3 /* Message */, "Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it_95197", "Add 'resolution-mode' import attribute to all type-only imports that need it"), - 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?"), - Private_identifiers_cannot_be_used_as_parameters: diag(18009, 1 /* Error */, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), - An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, 1 /* Error */, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), - The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, 1 /* Error */, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), - constructor_is_a_reserved_word: diag(18012, 1 /* Error */, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), - Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier: diag(18013, 1 /* Error */, "Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013", "Property '{0}' is not accessible outside class '{1}' because it has a private identifier."), - The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling: diag(18014, 1 /* Error */, "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014", "The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."), - Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2: diag(18015, 1 /* Error */, "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015", "Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."), - Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, 1 /* Error */, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), - The_shadowing_declaration_of_0_is_defined_here: diag(18017, 1 /* Error */, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), - The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, 1 /* Error */, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), - _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, 1 /* Error */, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), - An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, 1 /* Error */, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), - can_only_be_used_at_the_start_of_a_file: diag(18026, 1 /* Error */, "can_only_be_used_at_the_start_of_a_file_18026", "'#!' can only be used at the start of a file."), - Compiler_reserves_name_0_when_emitting_private_identifier_downlevel: diag(18027, 1 /* Error */, "Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027", "Compiler reserves name '{0}' when emitting private identifier downlevel."), - Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18028, 1 /* Error */, "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028", "Private identifiers are only available when targeting ECMAScript 2015 and higher."), - Private_identifiers_are_not_allowed_in_variable_declarations: diag(18029, 1 /* Error */, "Private_identifiers_are_not_allowed_in_variable_declarations_18029", "Private identifiers are not allowed in variable declarations."), - An_optional_chain_cannot_contain_private_identifiers: diag(18030, 1 /* Error */, "An_optional_chain_cannot_contain_private_identifiers_18030", "An optional chain cannot contain private identifiers."), - The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents: diag(18031, 1 /* Error */, "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031", "The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."), - The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some: diag(18032, 1 /* Error */, "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032", "The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."), - Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values: diag(18033, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033", "Type '{0}' is not assignable to type '{1}' as required for computed enum member values."), - 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."), - 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."), - Types_cannot_appear_in_export_declarations_in_JavaScript_files: diag(18043, 1 /* Error */, "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043", "Types cannot appear in export declarations in JavaScript files."), - _0_is_automatically_exported_here: diag(18044, 3 /* Message */, "_0_is_automatically_exported_here_18044", "'{0}' is automatically exported here."), - Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18045, 1 /* Error */, "Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045", "Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."), - _0_is_of_type_unknown: diag(18046, 1 /* Error */, "_0_is_of_type_unknown_18046", "'{0}' is of type 'unknown'."), - _0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), - _0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), - _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), - 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."), - 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."), - _0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055", "'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."), - Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."), - String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: diag(18057, 1 /* Error */, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'."), - Default_imports_are_not_allowed_in_a_deferred_import: diag(18058, 1 /* Error */, "Default_imports_are_not_allowed_in_a_deferred_import_18058", "Default imports are not allowed in a deferred import."), - Named_imports_are_not_allowed_in_a_deferred_import: diag(18059, 1 /* Error */, "Named_imports_are_not_allowed_in_a_deferred_import_18059", "Named imports are not allowed in a deferred import."), - Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve: diag(18060, 1 /* Error */, "Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve_18060", "Deferred imports are only supported when the '--module' flag is set to 'esnext' or 'preserve'."), - _0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer: diag(18061, 1 /* Error */, "_0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer_18061", "'{0}' is not a valid meta-property for keyword 'import'. Did you mean 'meta' or 'defer'?") -}; - -// src/compiler/scanner.ts -function tokenIsIdentifierOrKeyword(token) { - return token >= 80 /* Identifier */; -} -function tokenIsIdentifierOrKeywordOrGreaterThan(token) { - return token === 32 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token); -} -var textToKeywordObj = { - abstract: 128 /* AbstractKeyword */, - accessor: 129 /* AccessorKeyword */, - any: 133 /* AnyKeyword */, - as: 130 /* AsKeyword */, - asserts: 131 /* AssertsKeyword */, - assert: 132 /* AssertKeyword */, - bigint: 163 /* BigIntKeyword */, - boolean: 136 /* BooleanKeyword */, - break: 83 /* BreakKeyword */, - case: 84 /* CaseKeyword */, - catch: 85 /* CatchKeyword */, - class: 86 /* ClassKeyword */, - continue: 88 /* ContinueKeyword */, - const: 87 /* ConstKeyword */, - ["constructor"]: 137 /* ConstructorKeyword */, - debugger: 89 /* DebuggerKeyword */, - declare: 138 /* DeclareKeyword */, - default: 90 /* DefaultKeyword */, - defer: 166 /* DeferKeyword */, - delete: 91 /* DeleteKeyword */, - do: 92 /* DoKeyword */, - else: 93 /* ElseKeyword */, - enum: 94 /* EnumKeyword */, - export: 95 /* ExportKeyword */, - extends: 96 /* ExtendsKeyword */, - false: 97 /* FalseKeyword */, - finally: 98 /* FinallyKeyword */, - for: 99 /* ForKeyword */, - from: 161 /* FromKeyword */, - function: 100 /* FunctionKeyword */, - get: 139 /* GetKeyword */, - if: 101 /* IfKeyword */, - implements: 119 /* ImplementsKeyword */, - import: 102 /* ImportKeyword */, - in: 103 /* InKeyword */, - infer: 140 /* InferKeyword */, - instanceof: 104 /* InstanceOfKeyword */, - interface: 120 /* InterfaceKeyword */, - intrinsic: 141 /* IntrinsicKeyword */, - is: 142 /* IsKeyword */, - keyof: 143 /* KeyOfKeyword */, - let: 121 /* LetKeyword */, - module: 144 /* ModuleKeyword */, - namespace: 145 /* NamespaceKeyword */, - never: 146 /* NeverKeyword */, - new: 105 /* NewKeyword */, - null: 106 /* NullKeyword */, - number: 150 /* NumberKeyword */, - object: 151 /* ObjectKeyword */, - package: 122 /* PackageKeyword */, - private: 123 /* PrivateKeyword */, - protected: 124 /* ProtectedKeyword */, - public: 125 /* PublicKeyword */, - override: 164 /* OverrideKeyword */, - out: 147 /* OutKeyword */, - readonly: 148 /* ReadonlyKeyword */, - require: 149 /* RequireKeyword */, - global: 162 /* GlobalKeyword */, - return: 107 /* ReturnKeyword */, - satisfies: 152 /* SatisfiesKeyword */, - set: 153 /* SetKeyword */, - static: 126 /* StaticKeyword */, - string: 154 /* StringKeyword */, - super: 108 /* SuperKeyword */, - switch: 109 /* SwitchKeyword */, - symbol: 155 /* SymbolKeyword */, - this: 110 /* ThisKeyword */, - throw: 111 /* ThrowKeyword */, - true: 112 /* TrueKeyword */, - try: 113 /* TryKeyword */, - type: 156 /* TypeKeyword */, - typeof: 114 /* TypeOfKeyword */, - undefined: 157 /* UndefinedKeyword */, - unique: 158 /* UniqueKeyword */, - unknown: 159 /* UnknownKeyword */, - using: 160 /* UsingKeyword */, - var: 115 /* VarKeyword */, - void: 116 /* VoidKeyword */, - while: 117 /* WhileKeyword */, - with: 118 /* WithKeyword */, - yield: 127 /* YieldKeyword */, - async: 134 /* AsyncKeyword */, - await: 135 /* AwaitKeyword */, - of: 165 /* OfKeyword */ -}; -var textToKeyword = new Map(Object.entries(textToKeywordObj)); -var textToToken = new Map(Object.entries({ - ...textToKeywordObj, - "{": 19 /* OpenBraceToken */, - "}": 20 /* CloseBraceToken */, - "(": 21 /* OpenParenToken */, - ")": 22 /* CloseParenToken */, - "[": 23 /* OpenBracketToken */, - "]": 24 /* CloseBracketToken */, - ".": 25 /* DotToken */, - "...": 26 /* DotDotDotToken */, - ";": 27 /* SemicolonToken */, - ",": 28 /* CommaToken */, - "<": 30 /* LessThanToken */, - ">": 32 /* GreaterThanToken */, - "<=": 33 /* LessThanEqualsToken */, - ">=": 34 /* GreaterThanEqualsToken */, - "==": 35 /* EqualsEqualsToken */, - "!=": 36 /* ExclamationEqualsToken */, - "===": 37 /* EqualsEqualsEqualsToken */, - "!==": 38 /* ExclamationEqualsEqualsToken */, - "=>": 39 /* EqualsGreaterThanToken */, - "+": 40 /* PlusToken */, - "-": 41 /* MinusToken */, - "**": 43 /* AsteriskAsteriskToken */, - "*": 42 /* AsteriskToken */, - "/": 44 /* SlashToken */, - "%": 45 /* PercentToken */, - "++": 46 /* PlusPlusToken */, - "--": 47 /* MinusMinusToken */, - "<<": 48 /* LessThanLessThanToken */, - ">": 49 /* GreaterThanGreaterThanToken */, - ">>>": 50 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 51 /* AmpersandToken */, - "|": 52 /* BarToken */, - "^": 53 /* CaretToken */, - "!": 54 /* ExclamationToken */, - "~": 55 /* TildeToken */, - "&&": 56 /* AmpersandAmpersandToken */, - "||": 57 /* BarBarToken */, - "?": 58 /* QuestionToken */, - "??": 61 /* QuestionQuestionToken */, - "?.": 29 /* QuestionDotToken */, - ":": 59 /* ColonToken */, - "=": 64 /* EqualsToken */, - "+=": 65 /* PlusEqualsToken */, - "-=": 66 /* MinusEqualsToken */, - "*=": 67 /* AsteriskEqualsToken */, - "**=": 68 /* AsteriskAsteriskEqualsToken */, - "/=": 69 /* SlashEqualsToken */, - "%=": 70 /* PercentEqualsToken */, - "<<=": 71 /* LessThanLessThanEqualsToken */, - ">>=": 72 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 74 /* AmpersandEqualsToken */, - "|=": 75 /* BarEqualsToken */, - "^=": 79 /* CaretEqualsToken */, - "||=": 76 /* BarBarEqualsToken */, - "&&=": 77 /* AmpersandAmpersandEqualsToken */, - "??=": 78 /* QuestionQuestionEqualsToken */, - "@": 60 /* AtToken */, - "#": 63 /* HashToken */, - "`": 62 /* BacktickToken */ -})); -var charCodeToRegExpFlag = /* @__PURE__ */ new Map([ - [100 /* d */, 1 /* HasIndices */], - [103 /* g */, 2 /* Global */], - [105 /* i */, 4 /* IgnoreCase */], - [109 /* m */, 8 /* Multiline */], - [115 /* s */, 16 /* DotAll */], - [117 /* u */, 32 /* Unicode */], - [118 /* v */, 64 /* UnicodeSets */], - [121 /* y */, 128 /* Sticky */] -]); -var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([ - [1 /* HasIndices */, LanguageFeatureMinimumTarget.RegularExpressionFlagsHasIndices], - [16 /* DotAll */, LanguageFeatureMinimumTarget.RegularExpressionFlagsDotAll], - [32 /* Unicode */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicode], - [64 /* UnicodeSets */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicodeSets], - [128 /* Sticky */, LanguageFeatureMinimumTarget.RegularExpressionFlagsSticky] -]); -var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 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, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 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, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; -var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 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, 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, 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, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 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, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 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, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 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, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 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, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 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, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 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, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 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, 65062, 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]; -var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2160, 2183, 2185, 2190, 2208, 2249, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3165, 3165, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3293, 3294, 3296, 3297, 3313, 3314, 3332, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 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, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5905, 5919, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6988, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 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, 8305, 8305, 8319, 8319, 8336, 8348, 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, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12735, 12784, 12799, 13312, 19903, 19968, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42954, 42960, 42961, 42963, 42963, 42965, 42969, 42994, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43881, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 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, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 66928, 66938, 66940, 66954, 66956, 66962, 66964, 66965, 66967, 66977, 66979, 66993, 66995, 67001, 67003, 67004, 67072, 67382, 67392, 67413, 67424, 67431, 67456, 67461, 67463, 67504, 67506, 67514, 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, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69248, 69289, 69296, 69297, 69376, 69404, 69415, 69415, 69424, 69445, 69488, 69505, 69552, 69572, 69600, 69622, 69635, 69687, 69745, 69746, 69749, 69749, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69959, 69959, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70207, 70208, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70753, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71488, 71494, 71680, 71723, 71840, 71903, 71935, 71942, 71945, 71945, 71948, 71955, 71957, 71958, 71960, 71983, 71999, 71999, 72001, 72001, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72368, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73474, 73474, 73476, 73488, 73490, 73523, 73648, 73648, 73728, 74649, 74752, 74862, 74880, 75075, 77712, 77808, 77824, 78895, 78913, 78918, 82944, 83526, 92160, 92728, 92736, 92766, 92784, 92862, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101589, 101632, 101640, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 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, 122624, 122654, 122661, 122666, 122928, 122989, 123136, 123180, 123191, 123197, 123214, 123214, 123536, 123565, 123584, 123627, 124112, 124139, 124896, 124902, 124904, 124907, 124909, 124910, 124912, 124926, 124928, 125124, 125184, 125251, 125259, 125259, 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, 173791, 173824, 177977, 177984, 178205, 178208, 183969, 183984, 191456, 191472, 192093, 194560, 195101, 196608, 201546, 201552, 205743]; -var 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, 2160, 2183, 2185, 2190, 2200, 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, 2901, 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, 3132, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3165, 3165, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3293, 3294, 3296, 3299, 3302, 3311, 3313, 3315, 3328, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3457, 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, 3790, 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, 5909, 5919, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6159, 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, 6847, 6862, 6912, 6988, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 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, 8204, 8205, 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, 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, 12543, 12549, 12591, 12593, 12686, 12704, 12735, 12784, 12799, 13312, 19903, 19968, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42954, 42960, 42961, 42963, 42963, 42965, 42969, 42994, 43047, 43052, 43052, 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, 43881, 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, 65381, 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, 66928, 66938, 66940, 66954, 66956, 66962, 66964, 66965, 66967, 66977, 66979, 66993, 66995, 67001, 67003, 67004, 67072, 67382, 67392, 67413, 67424, 67431, 67456, 67461, 67463, 67504, 67506, 67514, 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, 69248, 69289, 69291, 69292, 69296, 69297, 69373, 69404, 69415, 69415, 69424, 69456, 69488, 69509, 69552, 69572, 69600, 69622, 69632, 69702, 69734, 69749, 69759, 69818, 69826, 69826, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69959, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70094, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70209, 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, 70753, 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, 71488, 71494, 71680, 71738, 71840, 71913, 71935, 71942, 71945, 71945, 71948, 71955, 71957, 71958, 71960, 71989, 71991, 71992, 71995, 72003, 72016, 72025, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72368, 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, 73472, 73488, 73490, 73530, 73534, 73538, 73552, 73561, 73648, 73648, 73728, 74649, 74752, 74862, 74880, 75075, 77712, 77808, 77824, 78895, 78912, 78933, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92784, 92862, 92864, 92873, 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, 94180, 94192, 94193, 94208, 100343, 100352, 101589, 101632, 101640, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 118528, 118573, 118576, 118598, 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, 122624, 122654, 122661, 122666, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 122928, 122989, 123023, 123023, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123536, 123566, 123584, 123641, 124112, 124153, 124896, 124902, 124904, 124907, 124909, 124910, 124912, 124926, 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, 130032, 130041, 131072, 173791, 173824, 177977, 177984, 178205, 178208, 183969, 183984, 191456, 191472, 192093, 194560, 195101, 196608, 201546, 201552, 205743, 917760, 917999]; -var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/; -var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/; -var jsDocSeeOrLink = /@(?:see|link)/i; -function lookupInUnicodeMap(code, map2) { - if (code < map2[0]) { - return false; - } - let lo = 0; - let hi = map2.length; - let mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map2[mid] <= code && code <= map2[mid + 1]) { - return true; - } - if (code < map2[mid]) { - hi = mid; - } else { - lo = mid + 2; - } - } - return false; -} -function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 2 /* ES2015 */ ? lookupInUnicodeMap(code, unicodeESNextIdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); -} -function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 2 /* ES2015 */ ? lookupInUnicodeMap(code, unicodeESNextIdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); -} -function makeReverseMap(source) { - const result = []; - source.forEach((value, name) => { - result[value] = name; - }); - return result; -} -var tokenStrings = makeReverseMap(textToToken); -function tokenToString(t) { - return tokenStrings[t]; -} -function stringToToken(s) { - return textToToken.get(s); -} -var regExpFlagCharCodes = makeReverseMap(charCodeToRegExpFlag); -function regularExpressionFlagToCharacterCode(f) { - return regExpFlagCharCodes[f]; -} -function characterCodeToRegularExpressionFlag(ch) { - return charCodeToRegExpFlag.get(ch); -} -function computeLineStarts(text) { - const result = []; - let pos = 0; - let lineStart = 0; - while (pos < text.length) { - const ch = text.charCodeAt(pos); - pos++; - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - // falls through - case 10 /* lineFeed */: - result.push(lineStart); - lineStart = pos; - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { - result.push(lineStart); - lineStart = pos; - } - break; - } - } - result.push(lineStart); - return result; -} -function getPositionOfLineAndCharacter(sourceFile, line, character, allowEdits) { - return sourceFile.getPositionOfLineAndCharacter ? sourceFile.getPositionOfLineAndCharacter(line, character, allowEdits) : computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, allowEdits); -} -function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { - if (line < 0 || line >= lineStarts.length) { - if (allowEdits) { - line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; - } else { - Debug.fail(`Bad line number. Line: ${line}, lineStarts.length: ${lineStarts.length} , line map is correct? ${debugText !== void 0 ? arrayIsEqualTo(lineStarts, computeLineStarts(debugText)) : "unknown"}`); - } - } - const res = lineStarts[line] + character; - if (allowEdits) { - return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; - } - if (line < lineStarts.length - 1) { - Debug.assert(res < lineStarts[line + 1]); - } else if (debugText !== void 0) { - Debug.assert(res <= debugText.length); - } - return res; -} -function getLineStarts(sourceFile) { - return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); -} -function computeLineAndCharacterOfPosition(lineStarts, position) { - const lineNumber = computeLineOfPosition(lineStarts, position); - return { - line: lineNumber, - character: position - lineStarts[lineNumber] - }; -} -function computeLineOfPosition(lineStarts, position, lowerBound) { - let lineNumber = binarySearch(lineStarts, position, identity, compareValues, lowerBound); - if (lineNumber < 0) { - lineNumber = ~lineNumber - 1; - Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file"); - } - return lineNumber; -} -function getLinesBetweenPositions(sourceFile, pos1, pos2) { - if (pos1 === pos2) return 0; - const lineStarts = getLineStarts(sourceFile); - const lower = Math.min(pos1, pos2); - const isNegative = lower === pos2; - const upper = isNegative ? pos1 : pos2; - const lowerLine = computeLineOfPosition(lineStarts, lower); - const upperLine = computeLineOfPosition(lineStarts, upper, lowerLine); - return isNegative ? lowerLine - upperLine : upperLine - lowerLine; -} -function getLineAndCharacterOfPosition(sourceFile, position) { - return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); -} -function isWhiteSpaceLike(ch) { - return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); -} -function isWhiteSpaceSingleLine(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 133 /* nextLine */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; -} -function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; -} -function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; -} -function isHexDigit(ch) { - return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */; -} -function isASCIILetter(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */; -} -function isWordCharacter(ch) { - return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */; -} -function isOctalDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; -} -function couldStartTrivia(text, pos) { - const ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - case 47 /* slash */: - // starts of normal trivia - // falls through - case 60 /* lessThan */: - case 124 /* bar */: - case 61 /* equals */: - case 62 /* greaterThan */: - return true; - case 35 /* hash */: - return pos === 0; - default: - return ch > 127 /* maxAsciiCharacter */; - } -} -function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments, inJSDoc) { - if (positionIsSynthesized(pos)) { - return pos; - } - let canConsumeStar = false; - while (true) { - const ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos++; - } - // falls through - case 10 /* lineFeed */: - pos++; - if (stopAfterLineBreak) { - return pos; - } - canConsumeStar = !!inJSDoc; - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - if (stopAtComments) { - break; - } - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - canConsumeStar = false; - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - canConsumeStar = false; - continue; - } - break; - case 60 /* lessThan */: - case 124 /* bar */: - case 61 /* equals */: - case 62 /* greaterThan */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos); - canConsumeStar = false; - continue; - } - break; - case 35 /* hash */: - if (pos === 0 && isShebangTrivia(text, pos)) { - pos = scanShebangTrivia(text, pos); - canConsumeStar = false; - continue; - } - break; - case 42 /* asterisk */: - if (canConsumeStar) { - pos++; - canConsumeStar = false; - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && isWhiteSpaceLike(ch)) { - pos++; - continue; - } - break; - } - return pos; - } -} -var mergeConflictMarkerLength = "<<<<<<<".length; -function isConflictMarkerTrivia(text, pos) { - Debug.assert(pos >= 0); - if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { - const ch = text.charCodeAt(pos); - if (pos + mergeConflictMarkerLength < text.length) { - for (let i = 0; i < mergeConflictMarkerLength; i++) { - if (text.charCodeAt(pos + i) !== ch) { - return false; - } - } - return ch === 61 /* equals */ || text.charCodeAt(pos + mergeConflictMarkerLength) === 32 /* space */; - } - } - return false; -} -function scanConflictMarkerTrivia(text, pos, error2) { - if (error2) { - error2(Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); - } - const ch = text.charCodeAt(pos); - const len = text.length; - if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - while (pos < len && !isLineBreak(text.charCodeAt(pos))) { - pos++; - } - } else { - Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); - while (pos < len) { - const currentChar = text.charCodeAt(pos); - if ((currentChar === 61 /* equals */ || currentChar === 62 /* greaterThan */) && currentChar !== ch && isConflictMarkerTrivia(text, pos)) { - break; - } - pos++; - } - } - return pos; -} -var shebangTriviaRegex = /^#!.*/; -function isShebangTrivia(text, pos) { - Debug.assert(pos === 0); - return shebangTriviaRegex.test(text); -} -function scanShebangTrivia(text, pos) { - const shebang = shebangTriviaRegex.exec(text)[0]; - pos = pos + shebang.length; - return pos; -} -function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) { - let pendingPos; - let pendingEnd; - let pendingKind; - let pendingHasTrailingNewLine; - let hasPendingCommentRange = false; - let collecting = trailing; - let accumulator = initial; - if (pos === 0) { - collecting = true; - const shebang = getShebang(text); - if (shebang) { - pos = shebang.length; - } - } - scan: - while (pos >= 0 && pos < text.length) { - const ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos++; - } - // falls through - case 10 /* lineFeed */: - pos++; - if (trailing) { - break scan; - } - collecting = true; - if (hasPendingCommentRange) { - pendingHasTrailingNewLine = true; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - const nextChar = text.charCodeAt(pos + 1); - let hasTrailingNewLine = false; - if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { - const kind = nextChar === 47 /* slash */ ? 2 /* SingleLineCommentTrivia */ : 3 /* MultiLineCommentTrivia */; - const startPos = pos; - pos += 2; - if (nextChar === 47 /* slash */) { - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - hasTrailingNewLine = true; - break; - } - pos++; - } - } else { - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - } - if (collecting) { - if (hasPendingCommentRange) { - accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); - if (!reduce && accumulator) { - return accumulator; - } - } - pendingPos = startPos; - pendingEnd = pos; - pendingKind = kind; - pendingHasTrailingNewLine = hasTrailingNewLine; - hasPendingCommentRange = true; - } - continue; - } - break scan; - default: - if (ch > 127 /* maxAsciiCharacter */ && isWhiteSpaceLike(ch)) { - if (hasPendingCommentRange && isLineBreak(ch)) { - pendingHasTrailingNewLine = true; - } - pos++; - continue; - } - break scan; - } - } - if (hasPendingCommentRange) { - accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); - } - return accumulator; -} -function forEachLeadingCommentRange(text, pos, cb, state) { - return iterateCommentRanges( - /*reduce*/ - false, - text, - pos, - /*trailing*/ - false, - cb, - state - ); -} -function forEachTrailingCommentRange(text, pos, cb, state) { - return iterateCommentRanges( - /*reduce*/ - false, - text, - pos, - /*trailing*/ - true, - cb, - state - ); -} -function reduceEachLeadingCommentRange(text, pos, cb, state, initial) { - return iterateCommentRanges( - /*reduce*/ - true, - text, - pos, - /*trailing*/ - false, - cb, - state, - initial - ); -} -function reduceEachTrailingCommentRange(text, pos, cb, state, initial) { - return iterateCommentRanges( - /*reduce*/ - true, - text, - pos, - /*trailing*/ - true, - cb, - state, - initial - ); -} -function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments = []) { - comments.push({ kind, pos, end, hasTrailingNewLine }); - return comments; -} -function getLeadingCommentRanges(text, pos) { - return reduceEachLeadingCommentRange( - text, - pos, - appendCommentRange, - /*state*/ - void 0, - /*initial*/ - void 0 - ); -} -function getTrailingCommentRanges(text, pos) { - return reduceEachTrailingCommentRange( - text, - pos, - appendCommentRange, - /*state*/ - void 0, - /*initial*/ - void 0 - ); -} -function getShebang(text) { - const match = shebangTriviaRegex.exec(text); - if (match) { - return match[0]; - } -} -function isIdentifierStart(ch, languageVersion) { - return isASCIILetter(ch) || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); -} -function isIdentifierPart(ch, languageVersion, identifierVariant) { - return isWordCharacter(ch) || ch === 36 /* $ */ || // "-" and ":" are valid in JSX Identifiers - (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); -} -function isIdentifierText(name, languageVersion, identifierVariant) { - let ch = codePointAt(name, 0); - if (!isIdentifierStart(ch, languageVersion)) { - return false; - } - for (let i = charSize(ch); i < name.length; i += charSize(ch)) { - if (!isIdentifierPart(ch = codePointAt(name, i), languageVersion, identifierVariant)) { - return false; - } - } - return true; -} -function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) { - var text = textInitial; - var pos; - var end; - var fullStartPos; - var tokenStart; - var token; - var tokenValue; - var tokenFlags; - var commentDirectives; - var skipJsDocLeadingAsterisks = 0; - var scriptKind = 0 /* Unknown */; - var jsDocParsingMode = 0 /* ParseAll */; - setText(text, start, length2); - var scanner2 = { - getTokenFullStart: () => fullStartPos, - getStartPos: () => fullStartPos, - getTokenEnd: () => pos, - getTextPos: () => pos, - getToken: () => token, - getTokenStart: () => tokenStart, - getTokenPos: () => tokenStart, - getTokenText: () => text.substring(tokenStart, pos), - getTokenValue: () => tokenValue, - hasUnicodeEscape: () => (tokenFlags & 1024 /* UnicodeEscape */) !== 0, - hasExtendedUnicodeEscape: () => (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0, - hasPrecedingLineBreak: () => (tokenFlags & 1 /* PrecedingLineBreak */) !== 0, - hasPrecedingJSDocComment: () => (tokenFlags & 2 /* PrecedingJSDocComment */) !== 0, - hasPrecedingJSDocLeadingAsterisks: () => (tokenFlags & 32768 /* PrecedingJSDocLeadingAsterisks */) !== 0, - isIdentifier: () => token === 80 /* Identifier */ || token > 118 /* LastReservedWord */, - isReservedWord: () => token >= 83 /* FirstReservedWord */ && token <= 118 /* LastReservedWord */, - isUnterminated: () => (tokenFlags & 4 /* Unterminated */) !== 0, - getCommentDirectives: () => commentDirectives, - getNumericLiteralFlags: () => tokenFlags & 25584 /* NumericLiteralFlags */, - getTokenFlags: () => tokenFlags, - reScanGreaterToken, - reScanAsteriskEqualsToken, - reScanSlashToken, - reScanTemplateToken, - reScanTemplateHeadOrNoSubstitutionTemplate, - scanJsxIdentifier, - scanJsxAttributeValue, - reScanJsxAttributeValue, - reScanJsxToken, - reScanLessThanToken, - reScanHashToken, - reScanQuestionToken, - reScanInvalidIdentifier, - scanJsxToken, - scanJsDocToken, - scanJSDocCommentTextToken, - scan, - getText, - clearCommentDirectives, - setText, - setScriptTarget, - setLanguageVariant, - setScriptKind, - setJSDocParsingMode, - setOnError, - resetTokenState, - setTextPos: resetTokenState, - setSkipJsDocLeadingAsterisks, - tryScan, - lookAhead, - scanRange - }; - if (Debug.isDebugging) { - Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", { - get: () => { - const text2 = scanner2.getText(); - return text2.slice(0, scanner2.getTokenFullStart()) + "\u2551" + text2.slice(scanner2.getTokenFullStart()); - } - }); - } - return scanner2; - function codePointUnchecked(pos2) { - return codePointAt(text, pos2); - } - function codePointChecked(pos2) { - return pos2 >= 0 && pos2 < end ? codePointUnchecked(pos2) : -1 /* EOF */; - } - function charCodeUnchecked(pos2) { - return text.charCodeAt(pos2); - } - function charCodeChecked(pos2) { - return pos2 >= 0 && pos2 < end ? charCodeUnchecked(pos2) : -1 /* EOF */; - } - function error2(message, errPos = pos, length3, arg0) { - if (onError) { - const oldPos = pos; - pos = errPos; - onError(message, length3 || 0, arg0); - pos = oldPos; - } - } - function scanNumberFragment() { - let start2 = pos; - let allowSeparator = false; - let isPreviousTokenSeparator = false; - let result = ""; - while (true) { - const ch = charCodeUnchecked(pos); - if (ch === 95 /* _ */) { - tokenFlags |= 512 /* ContainsSeparator */; - if (allowSeparator) { - allowSeparator = false; - isPreviousTokenSeparator = true; - result += text.substring(start2, pos); - } else { - tokenFlags |= 16384 /* ContainsInvalidSeparator */; - if (isPreviousTokenSeparator) { - error2(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); - } else { - error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); - } - } - pos++; - start2 = pos; - continue; - } - if (isDigit(ch)) { - allowSeparator = true; - isPreviousTokenSeparator = false; - pos++; - continue; - } - break; - } - if (charCodeUnchecked(pos - 1) === 95 /* _ */) { - tokenFlags |= 16384 /* ContainsInvalidSeparator */; - error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); - } - return result + text.substring(start2, pos); - } - function scanNumber() { - let start2 = pos; - let mainFragment; - if (charCodeUnchecked(pos) === 48 /* _0 */) { - pos++; - if (charCodeUnchecked(pos) === 95 /* _ */) { - tokenFlags |= 512 /* ContainsSeparator */ | 16384 /* ContainsInvalidSeparator */; - error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); - pos--; - mainFragment = scanNumberFragment(); - } else if (!scanDigits()) { - tokenFlags |= 8192 /* ContainsLeadingZero */; - mainFragment = "" + +tokenValue; - } else if (!tokenValue) { - mainFragment = "0"; - } else { - tokenValue = "" + parseInt(tokenValue, 8); - tokenFlags |= 32 /* Octal */; - const withMinus = token === 41 /* MinusToken */; - const literal = (withMinus ? "-" : "") + "0o" + (+tokenValue).toString(8); - if (withMinus) start2--; - error2(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal); - return 9 /* NumericLiteral */; - } - } else { - mainFragment = scanNumberFragment(); - } - let decimalFragment; - let scientificFragment; - if (charCodeUnchecked(pos) === 46 /* dot */) { - pos++; - decimalFragment = scanNumberFragment(); - } - let end2 = pos; - if (charCodeUnchecked(pos) === 69 /* E */ || charCodeUnchecked(pos) === 101 /* e */) { - pos++; - tokenFlags |= 16 /* Scientific */; - if (charCodeUnchecked(pos) === 43 /* plus */ || charCodeUnchecked(pos) === 45 /* minus */) pos++; - const preNumericPart = pos; - const finalFragment = scanNumberFragment(); - if (!finalFragment) { - error2(Diagnostics.Digit_expected); - } else { - scientificFragment = text.substring(end2, preNumericPart) + finalFragment; - end2 = pos; - } - } - let result; - if (tokenFlags & 512 /* ContainsSeparator */) { - result = mainFragment; - if (decimalFragment) { - result += "." + decimalFragment; - } - if (scientificFragment) { - result += scientificFragment; - } - } else { - result = text.substring(start2, end2); - } - if (tokenFlags & 8192 /* ContainsLeadingZero */) { - 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 */)); - tokenValue = "" + +result; - return 9 /* NumericLiteral */; - } else { - tokenValue = result; - const type = checkBigIntSuffix(); - checkForIdentifierStartAfterNumericLiteral(start2); - return type; - } - } - function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) { - if (!isIdentifierStart(codePointUnchecked(pos), languageVersion)) { - return; - } - const identifierStart = pos; - const { length: length3 } = scanIdentifierParts(); - if (length3 === 1 && text[identifierStart] === "n") { - if (isScientific) { - error2(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); - } else { - error2(Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); - } - } else { - error2(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length3); - pos = identifierStart; - } - } - function scanDigits() { - const start2 = pos; - let isOctal = true; - while (isDigit(charCodeChecked(pos))) { - if (!isOctalDigit(charCodeUnchecked(pos))) { - isOctal = false; - } - pos++; - } - tokenValue = text.substring(start2, pos); - return isOctal; - } - function scanExactNumberOfHexDigits(count, canHaveSeparators) { - const valueString = scanHexDigits( - /*minCount*/ - count, - /*scanAsManyAsPossible*/ - false, - canHaveSeparators - ); - return valueString ? parseInt(valueString, 16) : -1; - } - function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { - return scanHexDigits( - /*minCount*/ - count, - /*scanAsManyAsPossible*/ - true, - canHaveSeparators - ); - } - function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { - let valueChars = []; - let allowSeparator = false; - let isPreviousTokenSeparator = false; - while (valueChars.length < minCount || scanAsManyAsPossible) { - let ch = charCodeUnchecked(pos); - if (canHaveSeparators && ch === 95 /* _ */) { - tokenFlags |= 512 /* ContainsSeparator */; - if (allowSeparator) { - allowSeparator = false; - isPreviousTokenSeparator = true; - } else if (isPreviousTokenSeparator) { - error2(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); - } else { - error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); - } - pos++; - continue; - } - allowSeparator = canHaveSeparators; - if (ch >= 65 /* A */ && ch <= 70 /* F */) { - ch += 97 /* a */ - 65 /* A */; - } else if (!(ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch >= 97 /* a */ && ch <= 102 /* f */)) { - break; - } - valueChars.push(ch); - pos++; - isPreviousTokenSeparator = false; - } - if (valueChars.length < minCount) { - valueChars = []; - } - if (charCodeUnchecked(pos - 1) === 95 /* _ */) { - error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); - } - return String.fromCharCode(...valueChars); - } - function scanString(jsxAttributeString = false) { - const quote2 = charCodeUnchecked(pos); - pos++; - let result = ""; - let start2 = pos; - while (true) { - if (pos >= end) { - result += text.substring(start2, pos); - tokenFlags |= 4 /* Unterminated */; - error2(Diagnostics.Unterminated_string_literal); - break; - } - const ch = charCodeUnchecked(pos); - if (ch === quote2) { - result += text.substring(start2, pos); - pos++; - break; - } - if (ch === 92 /* backslash */ && !jsxAttributeString) { - result += text.substring(start2, pos); - result += scanEscapeSequence(1 /* String */ | 2 /* ReportErrors */); - start2 = pos; - continue; - } - if ((ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */) && !jsxAttributeString) { - result += text.substring(start2, pos); - tokenFlags |= 4 /* Unterminated */; - error2(Diagnostics.Unterminated_string_literal); - break; - } - pos++; - } - return result; - } - function scanTemplateAndSetTokenValue(shouldEmitInvalidEscapeError) { - const startedWithBacktick = charCodeUnchecked(pos) === 96 /* backtick */; - pos++; - let start2 = pos; - let contents = ""; - let resultingToken; - while (true) { - if (pos >= end) { - contents += text.substring(start2, pos); - tokenFlags |= 4 /* Unterminated */; - error2(Diagnostics.Unterminated_template_literal); - resultingToken = startedWithBacktick ? 15 /* NoSubstitutionTemplateLiteral */ : 18 /* TemplateTail */; - break; - } - const currChar = charCodeUnchecked(pos); - if (currChar === 96 /* backtick */) { - contents += text.substring(start2, pos); - pos++; - resultingToken = startedWithBacktick ? 15 /* NoSubstitutionTemplateLiteral */ : 18 /* TemplateTail */; - break; - } - if (currChar === 36 /* $ */ && pos + 1 < end && charCodeUnchecked(pos + 1) === 123 /* openBrace */) { - contents += text.substring(start2, pos); - pos += 2; - resultingToken = startedWithBacktick ? 16 /* TemplateHead */ : 17 /* TemplateMiddle */; - break; - } - if (currChar === 92 /* backslash */) { - contents += text.substring(start2, pos); - contents += scanEscapeSequence(1 /* String */ | (shouldEmitInvalidEscapeError ? 2 /* ReportErrors */ : 0)); - start2 = pos; - continue; - } - if (currChar === 13 /* carriageReturn */) { - contents += text.substring(start2, pos); - pos++; - if (pos < end && charCodeUnchecked(pos) === 10 /* lineFeed */) { - pos++; - } - contents += "\n"; - start2 = pos; - continue; - } - pos++; - } - Debug.assert(resultingToken !== void 0); - tokenValue = contents; - return resultingToken; - } - function scanEscapeSequence(flags) { - const start2 = pos; - pos++; - if (pos >= end) { - error2(Diagnostics.Unexpected_end_of_text); - return ""; - } - const ch = charCodeUnchecked(pos); - pos++; - switch (ch) { - case 48 /* _0 */: - if (pos >= end || !isDigit(charCodeUnchecked(pos))) { - return "\0"; - } - // '\01', '\011' - // falls through - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - if (pos < end && isOctalDigit(charCodeUnchecked(pos))) { - pos++; - } - // '\17', '\177' - // falls through - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - if (pos < end && isOctalDigit(charCodeUnchecked(pos))) { - pos++; - } - tokenFlags |= 2048 /* ContainsInvalidEscape */; - if (flags & 6 /* ReportInvalidEscapeErrors */) { - const code = parseInt(text.substring(start2 + 1, pos), 8); - if (flags & 4 /* RegularExpression */ && !(flags & 32 /* AtomEscape */) && ch !== 48 /* _0 */) { - error2(Diagnostics.Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0")); - } else { - 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); - case 56 /* _8 */: - case 57 /* _9 */: - tokenFlags |= 2048 /* ContainsInvalidEscape */; - if (flags & 6 /* ReportInvalidEscapeErrors */) { - if (flags & 4 /* RegularExpression */ && !(flags & 32 /* AtomEscape */)) { - error2(Diagnostics.Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class, start2, pos - start2); - } else { - error2(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos)); - } - return String.fromCharCode(ch); - } - return text.substring(start2, pos); - case 98 /* b */: - return "\b"; - case 116 /* t */: - return " "; - case 110 /* n */: - return "\n"; - case 118 /* v */: - return "\v"; - case 102 /* f */: - return "\f"; - case 114 /* r */: - return "\r"; - case 39 /* singleQuote */: - return "'"; - case 34 /* doubleQuote */: - return '"'; - case 117 /* u */: - if (pos < end && charCodeUnchecked(pos) === 123 /* openBrace */) { - pos -= 2; - const result = scanExtendedUnicodeEscape(!!(flags & 6 /* ReportInvalidEscapeErrors */)); - if (!(flags & 17 /* AllowExtendedUnicodeEscape */)) { - tokenFlags |= 2048 /* ContainsInvalidEscape */; - if (flags & 6 /* ReportInvalidEscapeErrors */) { - error2(Diagnostics.Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2); - } - } - return result; - } - for (; pos < start2 + 6; pos++) { - if (!(pos < end && isHexDigit(charCodeUnchecked(pos)))) { - tokenFlags |= 2048 /* ContainsInvalidEscape */; - if (flags & 6 /* ReportInvalidEscapeErrors */) { - error2(Diagnostics.Hexadecimal_digit_expected); - } - return text.substring(start2, pos); - } - } - tokenFlags |= 1024 /* UnicodeEscape */; - const escapedValue = parseInt(text.substring(start2 + 2, pos), 16); - const escapedValueString = String.fromCharCode(escapedValue); - if (flags & 16 /* AnyUnicodeMode */ && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && charCodeUnchecked(pos + 2) !== 123 /* openBrace */) { - const nextStart = pos; - let nextPos = pos + 2; - for (; nextPos < nextStart + 6; nextPos++) { - if (!isHexDigit(charCodeUnchecked(nextPos))) { - return escapedValueString; - } - } - const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16); - if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) { - pos = nextPos; - return escapedValueString + String.fromCharCode(nextEscapedValue); - } - } - return escapedValueString; - case 120 /* x */: - for (; pos < start2 + 4; pos++) { - if (!(pos < end && isHexDigit(charCodeUnchecked(pos)))) { - tokenFlags |= 2048 /* ContainsInvalidEscape */; - if (flags & 6 /* ReportInvalidEscapeErrors */) { - error2(Diagnostics.Hexadecimal_digit_expected); - } - return text.substring(start2, pos); - } - } - tokenFlags |= 4096 /* HexEscape */; - return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16)); - // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), - // the line terminator is interpreted to be "the empty code unit sequence". - case 13 /* carriageReturn */: - if (pos < end && charCodeUnchecked(pos) === 10 /* lineFeed */) { - pos++; - } - // falls through - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - return ""; - default: - if (flags & 16 /* AnyUnicodeMode */ || flags & 4 /* RegularExpression */ && !(flags & 8 /* AnnexB */) && isIdentifierPart(ch, languageVersion)) { - error2(Diagnostics.This_character_cannot_be_escaped_in_a_regular_expression, pos - 2, 2); - } - return String.fromCharCode(ch); - } - } - function scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError) { - const start2 = pos; - pos += 3; - const escapedStart = pos; - const escapedValueString = scanMinimumNumberOfHexDigits( - 1, - /*canHaveSeparators*/ - false - ); - const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; - let isInvalidExtendedEscape = false; - if (escapedValue < 0) { - if (shouldEmitInvalidEscapeError) { - error2(Diagnostics.Hexadecimal_digit_expected); - } - isInvalidExtendedEscape = true; - } else if (escapedValue > 1114111) { - if (shouldEmitInvalidEscapeError) { - error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart); - } - isInvalidExtendedEscape = true; - } - if (pos >= end) { - if (shouldEmitInvalidEscapeError) { - error2(Diagnostics.Unexpected_end_of_text); - } - isInvalidExtendedEscape = true; - } else if (charCodeUnchecked(pos) === 125 /* closeBrace */) { - pos++; - } else { - if (shouldEmitInvalidEscapeError) { - error2(Diagnostics.Unterminated_Unicode_escape_sequence); - } - isInvalidExtendedEscape = true; - } - if (isInvalidExtendedEscape) { - tokenFlags |= 2048 /* ContainsInvalidEscape */; - return text.substring(start2, pos); - } - tokenFlags |= 8 /* ExtendedUnicodeEscape */; - return utf16EncodeAsString(escapedValue); - } - function peekUnicodeEscape() { - if (pos + 5 < end && charCodeUnchecked(pos + 1) === 117 /* u */) { - const start2 = pos; - pos += 2; - const value = scanExactNumberOfHexDigits( - 4, - /*canHaveSeparators*/ - false - ); - pos = start2; - return value; - } - return -1; - } - function peekExtendedUnicodeEscape() { - if (codePointUnchecked(pos + 1) === 117 /* u */ && codePointUnchecked(pos + 2) === 123 /* openBrace */) { - const start2 = pos; - pos += 3; - const escapedValueString = scanMinimumNumberOfHexDigits( - 1, - /*canHaveSeparators*/ - false - ); - const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; - pos = start2; - return escapedValue; - } - return -1; - } - function scanIdentifierParts() { - let result = ""; - let start2 = pos; - while (pos < end) { - let ch = codePointUnchecked(pos); - if (isIdentifierPart(ch, languageVersion)) { - pos += charSize(ch); - } else if (ch === 92 /* backslash */) { - ch = peekExtendedUnicodeEscape(); - if (ch >= 0 && isIdentifierPart(ch, languageVersion)) { - result += scanExtendedUnicodeEscape( - /*shouldEmitInvalidEscapeError*/ - true - ); - start2 = pos; - continue; - } - ch = peekUnicodeEscape(); - if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) { - break; - } - tokenFlags |= 1024 /* UnicodeEscape */; - result += text.substring(start2, pos); - result += utf16EncodeAsString(ch); - pos += 6; - start2 = pos; - } else { - break; - } - } - result += text.substring(start2, pos); - return result; - } - function getIdentifierToken() { - const len = tokenValue.length; - if (len >= 2 && len <= 12) { - const ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */) { - const keyword = textToKeyword.get(tokenValue); - if (keyword !== void 0) { - return token = keyword; - } - } - } - return token = 80 /* Identifier */; - } - function scanBinaryOrOctalDigits(base) { - let value = ""; - let separatorAllowed = false; - let isPreviousTokenSeparator = false; - while (true) { - const ch = charCodeUnchecked(pos); - if (ch === 95 /* _ */) { - tokenFlags |= 512 /* ContainsSeparator */; - if (separatorAllowed) { - separatorAllowed = false; - isPreviousTokenSeparator = true; - } else if (isPreviousTokenSeparator) { - error2(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); - } else { - error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); - } - pos++; - continue; - } - separatorAllowed = true; - if (!isDigit(ch) || ch - 48 /* _0 */ >= base) { - break; - } - value += text[pos]; - pos++; - isPreviousTokenSeparator = false; - } - if (charCodeUnchecked(pos - 1) === 95 /* _ */) { - error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); - } - return value; - } - function checkBigIntSuffix() { - if (charCodeUnchecked(pos) === 110 /* n */) { - tokenValue += "n"; - if (tokenFlags & 384 /* BinaryOrOctalSpecifier */) { - tokenValue = parsePseudoBigInt(tokenValue) + "n"; - } - pos++; - return 10 /* BigIntLiteral */; - } else { - const numericValue = tokenFlags & 128 /* BinarySpecifier */ ? parseInt(tokenValue.slice(2), 2) : tokenFlags & 256 /* OctalSpecifier */ ? parseInt(tokenValue.slice(2), 8) : +tokenValue; - tokenValue = "" + numericValue; - return 9 /* NumericLiteral */; - } - } - function scan() { - fullStartPos = pos; - tokenFlags = 0 /* None */; - while (true) { - tokenStart = pos; - if (pos >= end) { - return token = 1 /* EndOfFileToken */; - } - const ch = codePointUnchecked(pos); - if (pos === 0) { - if (ch === 35 /* hash */ && isShebangTrivia(text, pos)) { - pos = scanShebangTrivia(text, pos); - if (skipTrivia2) { - continue; - } else { - return token = 6 /* ShebangTrivia */; - } - } - } - switch (ch) { - case 10 /* lineFeed */: - case 13 /* carriageReturn */: - tokenFlags |= 1 /* PrecedingLineBreak */; - if (skipTrivia2) { - pos++; - continue; - } else { - if (ch === 13 /* carriageReturn */ && pos + 1 < end && charCodeUnchecked(pos + 1) === 10 /* lineFeed */) { - pos += 2; - } else { - pos++; - } - return token = 4 /* NewLineTrivia */; - } - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 5760 /* ogham */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 8287 /* mathematicalSpace */: - case 12288 /* ideographicSpace */: - case 65279 /* byteOrderMark */: - if (skipTrivia2) { - pos++; - continue; - } else { - while (pos < end && isWhiteSpaceSingleLine(charCodeUnchecked(pos))) { - pos++; - } - return token = 5 /* WhitespaceTrivia */; - } - case 33 /* exclamation */: - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */; - } - return pos += 2, token = 36 /* ExclamationEqualsToken */; - } - pos++; - return token = 54 /* ExclamationToken */; - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString(); - return token = 11 /* StringLiteral */; - case 96 /* backtick */: - return token = scanTemplateAndSetTokenValue( - /*shouldEmitInvalidEscapeError*/ - false - ); - case 37 /* percent */: - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 70 /* PercentEqualsToken */; - } - pos++; - return token = 45 /* PercentToken */; - case 38 /* ampersand */: - if (charCodeUnchecked(pos + 1) === 38 /* ampersand */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 77 /* AmpersandAmpersandEqualsToken */; - } - return pos += 2, token = 56 /* AmpersandAmpersandToken */; - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 74 /* AmpersandEqualsToken */; - } - pos++; - return token = 51 /* AmpersandToken */; - case 40 /* openParen */: - pos++; - return token = 21 /* OpenParenToken */; - case 41 /* closeParen */: - pos++; - return token = 22 /* CloseParenToken */; - case 42 /* asterisk */: - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 67 /* AsteriskEqualsToken */; - } - if (charCodeUnchecked(pos + 1) === 42 /* asterisk */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 68 /* AsteriskAsteriskEqualsToken */; - } - return pos += 2, token = 43 /* AsteriskAsteriskToken */; - } - pos++; - if (skipJsDocLeadingAsterisks && (tokenFlags & 32768 /* PrecedingJSDocLeadingAsterisks */) === 0 && tokenFlags & 1 /* PrecedingLineBreak */) { - tokenFlags |= 32768 /* PrecedingJSDocLeadingAsterisks */; - continue; - } - return token = 42 /* AsteriskToken */; - case 43 /* plus */: - if (charCodeUnchecked(pos + 1) === 43 /* plus */) { - return pos += 2, token = 46 /* PlusPlusToken */; - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 65 /* PlusEqualsToken */; - } - pos++; - return token = 40 /* PlusToken */; - case 44 /* comma */: - pos++; - return token = 28 /* CommaToken */; - case 45 /* minus */: - if (charCodeUnchecked(pos + 1) === 45 /* minus */) { - return pos += 2, token = 47 /* MinusMinusToken */; - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 66 /* MinusEqualsToken */; - } - pos++; - return token = 41 /* MinusToken */; - case 46 /* dot */: - if (isDigit(charCodeUnchecked(pos + 1))) { - scanNumber(); - return token = 9 /* NumericLiteral */; - } - if (charCodeUnchecked(pos + 1) === 46 /* dot */ && charCodeUnchecked(pos + 2) === 46 /* dot */) { - return pos += 3, token = 26 /* DotDotDotToken */; - } - pos++; - return token = 25 /* DotToken */; - case 47 /* slash */: - if (charCodeUnchecked(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < end) { - if (isLineBreak(charCodeUnchecked(pos))) { - break; - } - pos++; - } - commentDirectives = appendIfCommentDirective( - commentDirectives, - text.slice(tokenStart, pos), - commentDirectiveRegExSingleLine, - tokenStart - ); - if (skipTrivia2) { - continue; - } else { - return token = 2 /* SingleLineCommentTrivia */; - } - } - if (charCodeUnchecked(pos + 1) === 42 /* asterisk */) { - pos += 2; - const isJSDoc2 = charCodeUnchecked(pos) === 42 /* asterisk */ && charCodeUnchecked(pos + 1) !== 47 /* slash */; - let commentClosed = false; - let lastLineStart = tokenStart; - while (pos < end) { - const ch2 = charCodeUnchecked(pos); - if (ch2 === 42 /* asterisk */ && charCodeUnchecked(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - pos++; - if (isLineBreak(ch2)) { - lastLineStart = pos; - tokenFlags |= 1 /* PrecedingLineBreak */; - } - } - if (isJSDoc2 && shouldParseJSDoc()) { - tokenFlags |= 2 /* PrecedingJSDocComment */; - } - commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart); - if (!commentClosed) { - error2(Diagnostics.Asterisk_Slash_expected); - } - if (skipTrivia2) { - continue; - } else { - if (!commentClosed) { - tokenFlags |= 4 /* Unterminated */; - } - return token = 3 /* MultiLineCommentTrivia */; - } - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 69 /* SlashEqualsToken */; - } - pos++; - return token = 44 /* SlashToken */; - case 48 /* _0 */: - if (pos + 2 < end && (charCodeUnchecked(pos + 1) === 88 /* X */ || charCodeUnchecked(pos + 1) === 120 /* x */)) { - pos += 2; - tokenValue = scanMinimumNumberOfHexDigits( - 1, - /*canHaveSeparators*/ - true - ); - if (!tokenValue) { - error2(Diagnostics.Hexadecimal_digit_expected); - tokenValue = "0"; - } - tokenValue = "0x" + tokenValue; - tokenFlags |= 64 /* HexSpecifier */; - return token = checkBigIntSuffix(); - } else if (pos + 2 < end && (charCodeUnchecked(pos + 1) === 66 /* B */ || charCodeUnchecked(pos + 1) === 98 /* b */)) { - pos += 2; - tokenValue = scanBinaryOrOctalDigits( - /* base */ - 2 - ); - if (!tokenValue) { - error2(Diagnostics.Binary_digit_expected); - tokenValue = "0"; - } - tokenValue = "0b" + tokenValue; - tokenFlags |= 128 /* BinarySpecifier */; - return token = checkBigIntSuffix(); - } else if (pos + 2 < end && (charCodeUnchecked(pos + 1) === 79 /* O */ || charCodeUnchecked(pos + 1) === 111 /* o */)) { - pos += 2; - tokenValue = scanBinaryOrOctalDigits( - /* base */ - 8 - ); - if (!tokenValue) { - error2(Diagnostics.Octal_digit_expected); - tokenValue = "0"; - } - tokenValue = "0o" + tokenValue; - tokenFlags |= 256 /* OctalSpecifier */; - return token = checkBigIntSuffix(); - } - // falls through - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - return token = scanNumber(); - case 58 /* colon */: - pos++; - return token = 59 /* ColonToken */; - case 59 /* semicolon */: - pos++; - return token = 27 /* SemicolonToken */; - case 60 /* lessThan */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error2); - if (skipTrivia2) { - continue; - } else { - return token = 7 /* ConflictMarkerTrivia */; - } - } - if (charCodeUnchecked(pos + 1) === 60 /* lessThan */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 71 /* LessThanLessThanEqualsToken */; - } - return pos += 2, token = 48 /* LessThanLessThanToken */; - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 33 /* LessThanEqualsToken */; - } - if (languageVariant === 1 /* JSX */ && charCodeUnchecked(pos + 1) === 47 /* slash */ && charCodeUnchecked(pos + 2) !== 42 /* asterisk */) { - return pos += 2, token = 31 /* LessThanSlashToken */; - } - pos++; - return token = 30 /* LessThanToken */; - case 61 /* equals */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error2); - if (skipTrivia2) { - continue; - } else { - return token = 7 /* ConflictMarkerTrivia */; - } - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 37 /* EqualsEqualsEqualsToken */; - } - return pos += 2, token = 35 /* EqualsEqualsToken */; - } - if (charCodeUnchecked(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 39 /* EqualsGreaterThanToken */; - } - pos++; - return token = 64 /* EqualsToken */; - case 62 /* greaterThan */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error2); - if (skipTrivia2) { - continue; - } else { - return token = 7 /* ConflictMarkerTrivia */; - } - } - pos++; - return token = 32 /* GreaterThanToken */; - case 63 /* question */: - if (charCodeUnchecked(pos + 1) === 46 /* dot */ && !isDigit(charCodeUnchecked(pos + 2))) { - return pos += 2, token = 29 /* QuestionDotToken */; - } - if (charCodeUnchecked(pos + 1) === 63 /* question */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 78 /* QuestionQuestionEqualsToken */; - } - return pos += 2, token = 61 /* QuestionQuestionToken */; - } - pos++; - return token = 58 /* QuestionToken */; - case 91 /* openBracket */: - pos++; - return token = 23 /* OpenBracketToken */; - case 93 /* closeBracket */: - pos++; - return token = 24 /* CloseBracketToken */; - case 94 /* caret */: - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 79 /* CaretEqualsToken */; - } - pos++; - return token = 53 /* CaretToken */; - case 123 /* openBrace */: - pos++; - return token = 19 /* OpenBraceToken */; - case 124 /* bar */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error2); - if (skipTrivia2) { - continue; - } else { - return token = 7 /* ConflictMarkerTrivia */; - } - } - if (charCodeUnchecked(pos + 1) === 124 /* bar */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 76 /* BarBarEqualsToken */; - } - return pos += 2, token = 57 /* BarBarToken */; - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 75 /* BarEqualsToken */; - } - pos++; - return token = 52 /* BarToken */; - case 125 /* closeBrace */: - pos++; - return token = 20 /* CloseBraceToken */; - case 126 /* tilde */: - pos++; - return token = 55 /* TildeToken */; - case 64 /* at */: - pos++; - return token = 60 /* AtToken */; - case 92 /* backslash */: - const extendedCookedChar = peekExtendedUnicodeEscape(); - if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { - tokenValue = scanExtendedUnicodeEscape( - /*shouldEmitInvalidEscapeError*/ - true - ) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - const cookedChar = peekUnicodeEscape(); - if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { - pos += 6; - tokenFlags |= 1024 /* UnicodeEscape */; - tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - error2(Diagnostics.Invalid_character); - pos++; - return token = 0 /* Unknown */; - case 35 /* hash */: - if (pos !== 0 && text[pos + 1] === "!") { - error2(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2); - pos++; - return token = 0 /* Unknown */; - } - const charAfterHash = codePointUnchecked(pos + 1); - if (charAfterHash === 92 /* backslash */) { - pos++; - const extendedCookedChar2 = peekExtendedUnicodeEscape(); - if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) { - tokenValue = "#" + scanExtendedUnicodeEscape( - /*shouldEmitInvalidEscapeError*/ - true - ) + scanIdentifierParts(); - return token = 81 /* PrivateIdentifier */; - } - const cookedChar2 = peekUnicodeEscape(); - if (cookedChar2 >= 0 && isIdentifierStart(cookedChar2, languageVersion)) { - pos += 6; - tokenFlags |= 1024 /* UnicodeEscape */; - tokenValue = "#" + String.fromCharCode(cookedChar2) + scanIdentifierParts(); - return token = 81 /* PrivateIdentifier */; - } - pos--; - } - if (isIdentifierStart(charAfterHash, languageVersion)) { - pos++; - scanIdentifier(charAfterHash, languageVersion); - } else { - tokenValue = "#"; - error2(Diagnostics.Invalid_character, pos++, charSize(ch)); - } - return token = 81 /* PrivateIdentifier */; - case 65533 /* replacementCharacter */: - error2(Diagnostics.File_appears_to_be_binary, 0, 0); - pos = end; - return token = 8 /* NonTextFileMarkerTrivia */; - default: - const identifierKind = scanIdentifier(ch, languageVersion); - if (identifierKind) { - return token = identifierKind; - } else if (isWhiteSpaceSingleLine(ch)) { - pos += charSize(ch); - continue; - } else if (isLineBreak(ch)) { - tokenFlags |= 1 /* PrecedingLineBreak */; - pos += charSize(ch); - continue; - } - const size = charSize(ch); - 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; - tokenFlags = 0; - const ch = codePointUnchecked(pos); - const identifierKind = scanIdentifier(ch, 99 /* ESNext */); - if (identifierKind) { - return token = identifierKind; - } - pos += charSize(ch); - return token; - } - function scanIdentifier(startCharacter, languageVersion2) { - let ch = startCharacter; - if (isIdentifierStart(ch, languageVersion2)) { - pos += charSize(ch); - while (pos < end && isIdentifierPart(ch = codePointUnchecked(pos), languageVersion2)) pos += charSize(ch); - tokenValue = text.substring(tokenStart, pos); - if (ch === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return getIdentifierToken(); - } - } - function reScanGreaterToken() { - if (token === 32 /* GreaterThanToken */) { - if (charCodeUnchecked(pos) === 62 /* greaterThan */) { - if (charCodeUnchecked(pos + 1) === 62 /* greaterThan */) { - if (charCodeUnchecked(pos + 2) === 61 /* equals */) { - return pos += 3, token = 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - return pos += 2, token = 50 /* GreaterThanGreaterThanGreaterThanToken */; - } - if (charCodeUnchecked(pos + 1) === 61 /* equals */) { - return pos += 2, token = 72 /* GreaterThanGreaterThanEqualsToken */; - } - pos++; - return token = 49 /* GreaterThanGreaterThanToken */; - } - if (charCodeUnchecked(pos) === 61 /* equals */) { - pos++; - return token = 34 /* GreaterThanEqualsToken */; - } - } - return token; - } - function reScanAsteriskEqualsToken() { - Debug.assert(token === 67 /* AsteriskEqualsToken */, "'reScanAsteriskEqualsToken' should only be called on a '*='"); - pos = tokenStart + 1; - return token = 64 /* EqualsToken */; - } - function reScanSlashToken(reportErrors2) { - if (token === 44 /* SlashToken */ || token === 69 /* SlashEqualsToken */) { - const startOfRegExpBody = tokenStart + 1; - pos = startOfRegExpBody; - let inEscape = false; - let namedCaptureGroups = false; - let inCharacterClass = false; - while (true) { - const ch = charCodeChecked(pos); - if (ch === -1 /* EOF */ || isLineBreak(ch)) { - tokenFlags |= 4 /* Unterminated */; - break; - } - if (inEscape) { - inEscape = false; - } else if (ch === 47 /* slash */ && !inCharacterClass) { - break; - } else if (ch === 91 /* openBracket */) { - inCharacterClass = true; - } else if (ch === 92 /* backslash */) { - inEscape = true; - } else if (ch === 93 /* closeBracket */) { - inCharacterClass = false; - } else if (!inCharacterClass && ch === 40 /* openParen */ && charCodeChecked(pos + 1) === 63 /* question */ && charCodeChecked(pos + 2) === 60 /* lessThan */ && charCodeChecked(pos + 3) !== 61 /* equals */ && charCodeChecked(pos + 3) !== 33 /* exclamation */) { - namedCaptureGroups = true; - } - pos++; - } - const endOfRegExpBody = pos; - if (tokenFlags & 4 /* Unterminated */) { - pos = startOfRegExpBody; - inEscape = false; - let characterClassDepth = 0; - let inDecimalQuantifier = false; - let groupDepth = 0; - while (pos < endOfRegExpBody) { - const ch = charCodeUnchecked(pos); - if (inEscape) { - inEscape = false; - } else if (ch === 92 /* backslash */) { - inEscape = true; - } else if (ch === 91 /* openBracket */) { - characterClassDepth++; - } else if (ch === 93 /* closeBracket */ && characterClassDepth) { - characterClassDepth--; - } else if (!characterClassDepth) { - if (ch === 123 /* openBrace */) { - inDecimalQuantifier = true; - } else if (ch === 125 /* closeBrace */ && inDecimalQuantifier) { - inDecimalQuantifier = false; - } else if (!inDecimalQuantifier) { - if (ch === 40 /* openParen */) { - groupDepth++; - } else if (ch === 41 /* closeParen */ && groupDepth) { - groupDepth--; - } else if (ch === 41 /* closeParen */ || ch === 93 /* closeBracket */ || ch === 125 /* closeBrace */) { - break; - } - } - } - pos++; - } - while (isWhiteSpaceLike(charCodeChecked(pos - 1)) || charCodeChecked(pos - 1) === 59 /* semicolon */) pos--; - error2(Diagnostics.Unterminated_regular_expression_literal, tokenStart, pos - tokenStart); - } else { - pos++; - let regExpFlags = 0 /* None */; - while (true) { - const ch = codePointChecked(pos); - if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) { - break; - } - const size = charSize(ch); - if (reportErrors2) { - const flag = characterCodeToRegularExpressionFlag(ch); - if (flag === void 0) { - error2(Diagnostics.Unknown_regular_expression_flag, pos, size); - } else if (regExpFlags & flag) { - error2(Diagnostics.Duplicate_regular_expression_flag, pos, size); - } else if (((regExpFlags | flag) & 96 /* AnyUnicodeMode */) === 96 /* AnyUnicodeMode */) { - error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos, size); - } else { - regExpFlags |= flag; - checkRegularExpressionFlagAvailability(flag, size); - } - } - pos += size; - } - if (reportErrors2) { - scanRange(startOfRegExpBody, endOfRegExpBody - startOfRegExpBody, () => { - scanRegularExpressionWorker( - regExpFlags, - /*annexB*/ - true, - namedCaptureGroups - ); - }); - } - } - tokenValue = text.substring(tokenStart, pos); - token = 14 /* RegularExpressionLiteral */; - } - return token; - } - function scanRegularExpressionWorker(regExpFlags, annexB, namedCaptureGroups) { - var unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */); - var anyUnicodeMode = !!(regExpFlags & 96 /* AnyUnicodeMode */); - var anyUnicodeModeOrNonAnnexB = anyUnicodeMode || !annexB; - var mayContainStrings = false; - var numberOfCapturingGroups = 0; - var groupSpecifiers; - var groupNameReferences; - var decimalEscapes; - var namedCapturingGroupsScopeStack = []; - var topNamedCapturingGroupsScope; - function scanDisjunction(isInGroup) { - while (true) { - namedCapturingGroupsScopeStack.push(topNamedCapturingGroupsScope); - topNamedCapturingGroupsScope = void 0; - scanAlternative(isInGroup); - topNamedCapturingGroupsScope = namedCapturingGroupsScopeStack.pop(); - if (charCodeChecked(pos) !== 124 /* bar */) { - return; - } - pos++; - } - } - function scanAlternative(isInGroup) { - let isPreviousTermQuantifiable = false; - while (true) { - const start2 = pos; - const ch = charCodeChecked(pos); - switch (ch) { - case -1 /* EOF */: - return; - case 94 /* caret */: - case 36 /* $ */: - pos++; - isPreviousTermQuantifiable = false; - break; - case 92 /* backslash */: - pos++; - switch (charCodeChecked(pos)) { - case 98 /* b */: - case 66 /* B */: - pos++; - isPreviousTermQuantifiable = false; - break; - default: - scanAtomEscape(); - isPreviousTermQuantifiable = true; - break; - } - break; - case 40 /* openParen */: - pos++; - if (charCodeChecked(pos) === 63 /* question */) { - pos++; - switch (charCodeChecked(pos)) { - case 61 /* equals */: - case 33 /* exclamation */: - pos++; - isPreviousTermQuantifiable = !anyUnicodeModeOrNonAnnexB; - break; - case 60 /* lessThan */: - const groupNameStart = pos; - pos++; - switch (charCodeChecked(pos)) { - case 61 /* equals */: - case 33 /* exclamation */: - pos++; - isPreviousTermQuantifiable = false; - break; - default: - scanGroupName( - /*isReference*/ - false - ); - scanExpectedChar(62 /* greaterThan */); - if (languageVersion < 5 /* ES2018 */) { - error2(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart); - } - numberOfCapturingGroups++; - isPreviousTermQuantifiable = true; - break; - } - break; - default: - const start3 = pos; - const setFlags = scanPatternModifiers(0 /* None */); - if (charCodeChecked(pos) === 45 /* minus */) { - pos++; - scanPatternModifiers(setFlags); - if (pos === start3 + 1) { - error2(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start3, pos - start3); - } - } - scanExpectedChar(58 /* colon */); - isPreviousTermQuantifiable = true; - break; - } - } else { - numberOfCapturingGroups++; - isPreviousTermQuantifiable = true; - } - scanDisjunction( - /*isInGroup*/ - true - ); - scanExpectedChar(41 /* closeParen */); - break; - case 123 /* openBrace */: - pos++; - const digitsStart = pos; - scanDigits(); - const min2 = tokenValue; - if (!anyUnicodeModeOrNonAnnexB && !min2) { - isPreviousTermQuantifiable = true; - break; - } - if (charCodeChecked(pos) === 44 /* comma */) { - pos++; - scanDigits(); - const max = tokenValue; - if (!min2) { - if (max || charCodeChecked(pos) === 125 /* closeBrace */) { - error2(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0); - } else { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch)); - isPreviousTermQuantifiable = true; - break; - } - } else if (max && Number.parseInt(min2) > Number.parseInt(max) && (anyUnicodeModeOrNonAnnexB || charCodeChecked(pos) === 125 /* closeBrace */)) { - error2(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart); - } - } else if (!min2) { - if (anyUnicodeModeOrNonAnnexB) { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch)); - } - isPreviousTermQuantifiable = true; - break; - } - if (charCodeChecked(pos) !== 125 /* closeBrace */) { - if (anyUnicodeModeOrNonAnnexB) { - error2(Diagnostics._0_expected, pos, 0, String.fromCharCode(125 /* closeBrace */)); - pos--; - } else { - isPreviousTermQuantifiable = true; - break; - } - } - // falls through - case 42 /* asterisk */: - case 43 /* plus */: - case 63 /* question */: - pos++; - if (charCodeChecked(pos) === 63 /* question */) { - pos++; - } - if (!isPreviousTermQuantifiable) { - error2(Diagnostics.There_is_nothing_available_for_repetition, start2, pos - start2); - } - isPreviousTermQuantifiable = false; - break; - case 46 /* dot */: - pos++; - isPreviousTermQuantifiable = true; - break; - case 91 /* openBracket */: - pos++; - if (unicodeSetsMode) { - scanClassSetExpression(); - } else { - scanClassRanges(); - } - scanExpectedChar(93 /* closeBracket */); - isPreviousTermQuantifiable = true; - break; - case 41 /* closeParen */: - if (isInGroup) { - return; - } - // falls through - case 93 /* closeBracket */: - case 125 /* closeBrace */: - if (anyUnicodeModeOrNonAnnexB || ch === 41 /* closeParen */) { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - } - pos++; - isPreviousTermQuantifiable = true; - break; - case 47 /* slash */: - case 124 /* bar */: - return; - default: - scanSourceCharacter(); - isPreviousTermQuantifiable = true; - break; - } - } - } - function scanPatternModifiers(currFlags) { - while (true) { - const ch = codePointChecked(pos); - if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) { - break; - } - const size = charSize(ch); - const flag = characterCodeToRegularExpressionFlag(ch); - if (flag === void 0) { - error2(Diagnostics.Unknown_regular_expression_flag, pos, size); - } else if (currFlags & flag) { - error2(Diagnostics.Duplicate_regular_expression_flag, pos, size); - } else if (!(flag & 28 /* Modifiers */)) { - error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, size); - } else { - currFlags |= flag; - checkRegularExpressionFlagAvailability(flag, size); - } - pos += size; - } - return currFlags; - } - function scanAtomEscape() { - Debug.assertEqual(charCodeUnchecked(pos - 1), 92 /* backslash */); - switch (charCodeChecked(pos)) { - case 107 /* k */: - pos++; - if (charCodeChecked(pos) === 60 /* lessThan */) { - pos++; - scanGroupName( - /*isReference*/ - true - ); - scanExpectedChar(62 /* greaterThan */); - } else if (anyUnicodeModeOrNonAnnexB || namedCaptureGroups) { - error2(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2); - } - break; - case 113 /* q */: - if (unicodeSetsMode) { - pos++; - error2(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2); - break; - } - // falls through - default: - Debug.assert(scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape( - /*atomEscape*/ - true - )); - break; - } - } - function scanDecimalEscape() { - Debug.assertEqual(charCodeUnchecked(pos - 1), 92 /* backslash */); - const ch = charCodeChecked(pos); - if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) { - const start2 = pos; - scanDigits(); - decimalEscapes = append(decimalEscapes, { pos: start2, end: pos, value: +tokenValue }); - return true; - } - return false; - } - function scanCharacterEscape(atomEscape) { - Debug.assertEqual(charCodeUnchecked(pos - 1), 92 /* backslash */); - let ch = charCodeChecked(pos); - switch (ch) { - case -1 /* EOF */: - error2(Diagnostics.Undetermined_character_escape, pos - 1, 1); - return "\\"; - case 99 /* c */: - pos++; - ch = charCodeChecked(pos); - if (isASCIILetter(ch)) { - pos++; - return String.fromCharCode(ch & 31); - } - if (anyUnicodeModeOrNonAnnexB) { - error2(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2); - } else if (atomEscape) { - pos--; - return "\\"; - } - return String.fromCharCode(ch); - case 94 /* caret */: - case 36 /* $ */: - case 47 /* slash */: - case 92 /* backslash */: - case 46 /* dot */: - case 42 /* asterisk */: - case 43 /* plus */: - case 63 /* question */: - case 40 /* openParen */: - case 41 /* closeParen */: - case 91 /* openBracket */: - case 93 /* closeBracket */: - case 123 /* openBrace */: - case 125 /* closeBrace */: - case 124 /* bar */: - pos++; - return String.fromCharCode(ch); - default: - pos--; - return scanEscapeSequence( - 4 /* RegularExpression */ | (annexB ? 8 /* AnnexB */ : 0) | (anyUnicodeMode ? 16 /* AnyUnicodeMode */ : 0) | (atomEscape ? 32 /* AtomEscape */ : 0) - ); - } - } - function scanGroupName(isReference) { - Debug.assertEqual(charCodeUnchecked(pos - 1), 60 /* lessThan */); - tokenStart = pos; - scanIdentifier(codePointChecked(pos), languageVersion); - if (pos === tokenStart) { - error2(Diagnostics.Expected_a_capturing_group_name); - } else if (isReference) { - groupNameReferences = append(groupNameReferences, { pos: tokenStart, end: pos, name: tokenValue }); - } else if ((topNamedCapturingGroupsScope == null ? void 0 : topNamedCapturingGroupsScope.has(tokenValue)) || namedCapturingGroupsScopeStack.some((group2) => group2 == null ? void 0 : group2.has(tokenValue))) { - error2(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart); - } else { - topNamedCapturingGroupsScope ?? (topNamedCapturingGroupsScope = /* @__PURE__ */ new Set()); - topNamedCapturingGroupsScope.add(tokenValue); - groupSpecifiers ?? (groupSpecifiers = /* @__PURE__ */ new Set()); - groupSpecifiers.add(tokenValue); - } - } - function isClassContentExit(ch) { - return ch === 93 /* closeBracket */ || ch === -1 /* EOF */ || pos >= end; - } - function scanClassRanges() { - Debug.assertEqual(charCodeUnchecked(pos - 1), 91 /* openBracket */); - if (charCodeChecked(pos) === 94 /* caret */) { - pos++; - } - while (true) { - const ch = charCodeChecked(pos); - if (isClassContentExit(ch)) { - return; - } - const minStart = pos; - const minCharacter = scanClassAtom(); - if (charCodeChecked(pos) === 45 /* minus */) { - pos++; - const ch2 = charCodeChecked(pos); - if (isClassContentExit(ch2)) { - return; - } - if (!minCharacter && anyUnicodeModeOrNonAnnexB) { - error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart); - } - const maxStart = pos; - const maxCharacter = scanClassAtom(); - if (!maxCharacter && anyUnicodeModeOrNonAnnexB) { - error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart); - continue; - } - if (!minCharacter) { - continue; - } - const minCharacterValue = codePointAt(minCharacter, 0); - const maxCharacterValue = codePointAt(maxCharacter, 0); - if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) { - error2(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart); - } - } - } - } - function scanClassSetExpression() { - Debug.assertEqual(charCodeUnchecked(pos - 1), 91 /* openBracket */); - let isCharacterComplement = false; - if (charCodeChecked(pos) === 94 /* caret */) { - pos++; - isCharacterComplement = true; - } - let expressionMayContainStrings = false; - let ch = charCodeChecked(pos); - if (isClassContentExit(ch)) { - return; - } - let start2 = pos; - let operand; - switch (text.slice(pos, pos + 2)) { - // TODO: don't use slice - case "--": - case "&&": - error2(Diagnostics.Expected_a_class_set_operand); - mayContainStrings = false; - break; - default: - operand = scanClassSetOperand(); - break; - } - switch (charCodeChecked(pos)) { - case 45 /* minus */: - if (charCodeChecked(pos + 1) === 45 /* minus */) { - if (isCharacterComplement && mayContainStrings) { - error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2); - } - expressionMayContainStrings = mayContainStrings; - scanClassSetSubExpression(3 /* ClassSubtraction */); - mayContainStrings = !isCharacterComplement && expressionMayContainStrings; - return; - } - break; - case 38 /* ampersand */: - if (charCodeChecked(pos + 1) === 38 /* ampersand */) { - scanClassSetSubExpression(2 /* ClassIntersection */); - if (isCharacterComplement && mayContainStrings) { - error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2); - } - expressionMayContainStrings = mayContainStrings; - mayContainStrings = !isCharacterComplement && expressionMayContainStrings; - return; - } else { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - } - break; - default: - if (isCharacterComplement && mayContainStrings) { - error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2); - } - expressionMayContainStrings = mayContainStrings; - break; - } - while (true) { - ch = charCodeChecked(pos); - if (ch === -1 /* EOF */) { - break; - } - switch (ch) { - case 45 /* minus */: - pos++; - ch = charCodeChecked(pos); - if (isClassContentExit(ch)) { - mayContainStrings = !isCharacterComplement && expressionMayContainStrings; - return; - } - if (ch === 45 /* minus */) { - pos++; - error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); - start2 = pos - 2; - operand = text.slice(start2, pos); - continue; - } else { - if (!operand) { - error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start2, pos - 1 - start2); - } - const secondStart = pos; - const secondOperand = scanClassSetOperand(); - if (isCharacterComplement && mayContainStrings) { - error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart); - } - expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings); - if (!secondOperand) { - error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart); - break; - } - if (!operand) { - break; - } - const minCharacterValue = codePointAt(operand, 0); - const maxCharacterValue = codePointAt(secondOperand, 0); - if (operand.length === charSize(minCharacterValue) && secondOperand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) { - error2(Diagnostics.Range_out_of_order_in_character_class, start2, pos - start2); - } - } - break; - case 38 /* ampersand */: - start2 = pos; - pos++; - if (charCodeChecked(pos) === 38 /* ampersand */) { - pos++; - error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); - if (charCodeChecked(pos) === 38 /* ampersand */) { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - pos++; - } - } else { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch)); - } - operand = text.slice(start2, pos); - continue; - } - if (isClassContentExit(charCodeChecked(pos))) { - break; - } - start2 = pos; - switch (text.slice(pos, pos + 2)) { - // TODO: don't use slice - case "--": - case "&&": - error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2); - pos += 2; - operand = text.slice(start2, pos); - break; - default: - operand = scanClassSetOperand(); - break; - } - } - mayContainStrings = !isCharacterComplement && expressionMayContainStrings; - } - function scanClassSetSubExpression(expressionType) { - let expressionMayContainStrings = mayContainStrings; - while (true) { - let ch = charCodeChecked(pos); - if (isClassContentExit(ch)) { - break; - } - switch (ch) { - case 45 /* minus */: - pos++; - if (charCodeChecked(pos) === 45 /* minus */) { - pos++; - if (expressionType !== 3 /* ClassSubtraction */) { - error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); - } - } else { - error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1); - } - break; - case 38 /* ampersand */: - pos++; - if (charCodeChecked(pos) === 38 /* ampersand */) { - pos++; - if (expressionType !== 2 /* ClassIntersection */) { - error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); - } - if (charCodeChecked(pos) === 38 /* ampersand */) { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - pos++; - } - } else { - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch)); - } - break; - default: - switch (expressionType) { - case 3 /* ClassSubtraction */: - error2(Diagnostics._0_expected, pos, 0, "--"); - break; - case 2 /* ClassIntersection */: - error2(Diagnostics._0_expected, pos, 0, "&&"); - break; - default: - break; - } - break; - } - ch = charCodeChecked(pos); - if (isClassContentExit(ch)) { - error2(Diagnostics.Expected_a_class_set_operand); - break; - } - scanClassSetOperand(); - expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings); - } - mayContainStrings = expressionMayContainStrings; - } - function scanClassSetOperand() { - mayContainStrings = false; - switch (charCodeChecked(pos)) { - case -1 /* EOF */: - return ""; - case 91 /* openBracket */: - pos++; - scanClassSetExpression(); - scanExpectedChar(93 /* closeBracket */); - return ""; - case 92 /* backslash */: - pos++; - if (scanCharacterClassEscape()) { - return ""; - } else if (charCodeChecked(pos) === 113 /* q */) { - pos++; - if (charCodeChecked(pos) === 123 /* openBrace */) { - pos++; - scanClassStringDisjunctionContents(); - scanExpectedChar(125 /* closeBrace */); - return ""; - } else { - error2(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2); - return "q"; - } - } - pos--; - // falls through - default: - return scanClassSetCharacter(); - } - } - function scanClassStringDisjunctionContents() { - Debug.assertEqual(charCodeUnchecked(pos - 1), 123 /* openBrace */); - let characterCount = 0; - while (true) { - const ch = charCodeChecked(pos); - switch (ch) { - case -1 /* EOF */: - return; - case 125 /* closeBrace */: - if (characterCount !== 1) { - mayContainStrings = true; - } - return; - case 124 /* bar */: - if (characterCount !== 1) { - mayContainStrings = true; - } - pos++; - start = pos; - characterCount = 0; - break; - default: - scanClassSetCharacter(); - characterCount++; - break; - } - } - } - function scanClassSetCharacter() { - const ch = charCodeChecked(pos); - if (ch === -1 /* EOF */) { - return ""; - } - if (ch === 92 /* backslash */) { - pos++; - const ch2 = charCodeChecked(pos); - switch (ch2) { - case 98 /* b */: - pos++; - return "\b"; - case 38 /* ampersand */: - case 45 /* minus */: - case 33 /* exclamation */: - case 35 /* hash */: - case 37 /* percent */: - case 44 /* comma */: - case 58 /* colon */: - case 59 /* semicolon */: - case 60 /* lessThan */: - case 61 /* equals */: - case 62 /* greaterThan */: - case 64 /* at */: - case 96 /* backtick */: - case 126 /* tilde */: - pos++; - return String.fromCharCode(ch2); - default: - return scanCharacterEscape( - /*atomEscape*/ - false - ); - } - } else if (ch === charCodeChecked(pos + 1)) { - switch (ch) { - case 38 /* ampersand */: - case 33 /* exclamation */: - case 35 /* hash */: - case 37 /* percent */: - case 42 /* asterisk */: - case 43 /* plus */: - case 44 /* comma */: - case 46 /* dot */: - case 58 /* colon */: - case 59 /* semicolon */: - case 60 /* lessThan */: - case 61 /* equals */: - case 62 /* greaterThan */: - case 63 /* question */: - case 64 /* at */: - case 96 /* backtick */: - case 126 /* tilde */: - error2(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2); - pos += 2; - return text.substring(pos - 2, pos); - } - } - switch (ch) { - case 47 /* slash */: - case 40 /* openParen */: - case 41 /* closeParen */: - case 91 /* openBracket */: - case 93 /* closeBracket */: - case 123 /* openBrace */: - case 125 /* closeBrace */: - case 45 /* minus */: - case 124 /* bar */: - error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - pos++; - return String.fromCharCode(ch); - } - return scanSourceCharacter(); - } - function scanClassAtom() { - if (charCodeChecked(pos) === 92 /* backslash */) { - pos++; - const ch = charCodeChecked(pos); - switch (ch) { - case 98 /* b */: - pos++; - return "\b"; - case 45 /* minus */: - pos++; - return String.fromCharCode(ch); - default: - if (scanCharacterClassEscape()) { - return ""; - } - return scanCharacterEscape( - /*atomEscape*/ - false - ); - } - } else { - return scanSourceCharacter(); - } - } - function scanCharacterClassEscape() { - Debug.assertEqual(charCodeUnchecked(pos - 1), 92 /* backslash */); - let isCharacterComplement = false; - const start2 = pos - 1; - const ch = charCodeChecked(pos); - switch (ch) { - case 100 /* d */: - case 68 /* D */: - case 115 /* s */: - case 83 /* S */: - case 119 /* w */: - case 87 /* W */: - pos++; - return true; - case 80 /* P */: - isCharacterComplement = true; - // falls through - case 112 /* p */: - pos++; - if (charCodeChecked(pos) === 123 /* openBrace */) { - pos++; - const propertyNameOrValueStart = pos; - const propertyNameOrValue = scanWordCharacters(); - if (charCodeChecked(pos) === 61 /* equals */) { - const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue); - if (pos === propertyNameOrValueStart) { - error2(Diagnostics.Expected_a_Unicode_property_name); - } else if (propertyName === void 0) { - error2(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart); - const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity); - if (suggestion) { - error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion); - } - } - pos++; - const propertyValueStart = pos; - const propertyValue = scanWordCharacters(); - if (pos === propertyValueStart) { - error2(Diagnostics.Expected_a_Unicode_property_value); - } else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) { - error2(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart); - const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity); - if (suggestion) { - error2(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion); - } - } - } else { - if (pos === propertyNameOrValueStart) { - error2(Diagnostics.Expected_a_Unicode_property_name_or_value); - } else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) { - if (!unicodeSetsMode) { - error2(Diagnostics.Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set, propertyNameOrValueStart, pos - propertyNameOrValueStart); - } else if (isCharacterComplement) { - error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart); - } else { - mayContainStrings = true; - } - } else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) { - error2(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart); - const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity); - if (suggestion) { - error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion); - } - } - } - scanExpectedChar(125 /* closeBrace */); - if (!anyUnicodeMode) { - error2(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2); - } - } else if (anyUnicodeModeOrNonAnnexB) { - error2(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch)); - } else { - pos--; - return false; - } - return true; - } - return false; - } - function scanWordCharacters() { - let value = ""; - while (true) { - const ch = charCodeChecked(pos); - if (ch === -1 /* EOF */ || !isWordCharacter(ch)) { - break; - } - value += String.fromCharCode(ch); - pos++; - } - return value; - } - function scanSourceCharacter() { - const size = anyUnicodeMode ? charSize(codePointChecked(pos)) : 1; - pos += size; - return size > 0 ? text.substring(pos - size, pos) : ""; - } - function scanExpectedChar(ch) { - if (charCodeChecked(pos) === ch) { - pos++; - } else { - error2(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch)); - } - } - scanDisjunction( - /*isInGroup*/ - false - ); - forEach(groupNameReferences, (reference) => { - if (!(groupSpecifiers == null ? void 0 : groupSpecifiers.has(reference.name))) { - error2(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name); - if (groupSpecifiers) { - const suggestion = getSpellingSuggestion(reference.name, groupSpecifiers, identity); - if (suggestion) { - error2(Diagnostics.Did_you_mean_0, reference.pos, reference.end - reference.pos, suggestion); - } - } - } - }); - forEach(decimalEscapes, (escape) => { - if (escape.value > numberOfCapturingGroups) { - if (numberOfCapturingGroups) { - error2(Diagnostics.This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression, escape.pos, escape.end - escape.pos, numberOfCapturingGroups); - } else { - error2(Diagnostics.This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression, escape.pos, escape.end - escape.pos); - } - } - }); - } - function checkRegularExpressionFlagAvailability(flag, size) { - const availableFrom = regExpFlagToFirstAvailableLanguageVersion.get(flag); - if (availableFrom && languageVersion < availableFrom) { - error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, size, getNameOfScriptTarget(availableFrom)); - } - } - function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) { - const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx); - if (type === void 0) { - return commentDirectives2; - } - return append( - commentDirectives2, - { - range: { pos: lineStart, end: pos }, - type - } - ); - } - function getDirectiveFromComment(text2, commentDirectiveRegEx) { - const match = commentDirectiveRegEx.exec(text2); - if (!match) { - return void 0; - } - switch (match[1]) { - case "ts-expect-error": - return 0 /* ExpectError */; - case "ts-ignore": - return 1 /* Ignore */; - } - return void 0; - } - function reScanTemplateToken(isTaggedTemplate) { - pos = tokenStart; - return token = scanTemplateAndSetTokenValue(!isTaggedTemplate); - } - function reScanTemplateHeadOrNoSubstitutionTemplate() { - pos = tokenStart; - return token = scanTemplateAndSetTokenValue( - /*shouldEmitInvalidEscapeError*/ - true - ); - } - function reScanJsxToken(allowMultilineJsxText = true) { - pos = tokenStart = fullStartPos; - return token = scanJsxToken(allowMultilineJsxText); - } - function reScanLessThanToken() { - if (token === 48 /* LessThanLessThanToken */) { - pos = tokenStart + 1; - return token = 30 /* LessThanToken */; - } - return token; - } - function reScanHashToken() { - if (token === 81 /* PrivateIdentifier */) { - pos = tokenStart + 1; - return token = 63 /* HashToken */; - } - return token; - } - function reScanQuestionToken() { - Debug.assert(token === 61 /* QuestionQuestionToken */, "'reScanQuestionToken' should only be called on a '??'"); - pos = tokenStart + 1; - return token = 58 /* QuestionToken */; - } - function scanJsxToken(allowMultilineJsxText = true) { - fullStartPos = tokenStart = pos; - if (pos >= end) { - return token = 1 /* EndOfFileToken */; - } - let char = charCodeUnchecked(pos); - if (char === 60 /* lessThan */) { - if (charCodeUnchecked(pos + 1) === 47 /* slash */) { - pos += 2; - return token = 31 /* LessThanSlashToken */; - } - pos++; - return token = 30 /* LessThanToken */; - } - if (char === 123 /* openBrace */) { - pos++; - return token = 19 /* OpenBraceToken */; - } - let firstNonWhitespace = 0; - while (pos < end) { - char = charCodeUnchecked(pos); - if (char === 123 /* openBrace */) { - break; - } - if (char === 60 /* lessThan */) { - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error2); - return token = 7 /* ConflictMarkerTrivia */; - } - break; - } - if (char === 62 /* greaterThan */) { - error2(Diagnostics.Unexpected_token_Did_you_mean_or_gt, pos, 1); - } - if (char === 125 /* closeBrace */) { - error2(Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1); - } - if (isLineBreak(char) && firstNonWhitespace === 0) { - firstNonWhitespace = -1; - } else if (!allowMultilineJsxText && isLineBreak(char) && firstNonWhitespace > 0) { - break; - } else if (!isWhiteSpaceLike(char)) { - firstNonWhitespace = pos; - } - pos++; - } - tokenValue = text.substring(fullStartPos, pos); - return firstNonWhitespace === -1 ? 13 /* JsxTextAllWhiteSpaces */ : 12 /* JsxText */; - } - function scanJsxIdentifier() { - if (tokenIsIdentifierOrKeyword(token)) { - while (pos < end) { - const ch = charCodeUnchecked(pos); - if (ch === 45 /* minus */) { - tokenValue += "-"; - pos++; - continue; - } - const oldPos = pos; - tokenValue += scanIdentifierParts(); - if (pos === oldPos) { - break; - } - } - return getIdentifierToken(); - } - return token; - } - function scanJsxAttributeValue() { - fullStartPos = pos; - switch (charCodeUnchecked(pos)) { - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString( - /*jsxAttributeString*/ - true - ); - return token = 11 /* StringLiteral */; - default: - return scan(); - } - } - function reScanJsxAttributeValue() { - pos = tokenStart = fullStartPos; - return scanJsxAttributeValue(); - } - function scanJSDocCommentTextToken(inBackticks) { - fullStartPos = tokenStart = pos; - tokenFlags = 0 /* None */; - if (pos >= end) { - return token = 1 /* EndOfFileToken */; - } - for (let ch = charCodeUnchecked(pos); pos < end && (!isLineBreak(ch) && ch !== 96 /* backtick */); ch = codePointUnchecked(++pos)) { - if (!inBackticks) { - if (ch === 123 /* openBrace */) { - break; - } else if (ch === 64 /* at */ && pos - 1 >= 0 && isWhiteSpaceSingleLine(charCodeUnchecked(pos - 1)) && !(pos + 1 < end && isWhiteSpaceLike(charCodeUnchecked(pos + 1)))) { - break; - } - } - } - if (pos === tokenStart) { - return scanJsDocToken(); - } - tokenValue = text.substring(tokenStart, pos); - return token = 82 /* JSDocCommentTextToken */; - } - function scanJsDocToken() { - fullStartPos = tokenStart = pos; - tokenFlags = 0 /* None */; - if (pos >= end) { - return token = 1 /* EndOfFileToken */; - } - const ch = codePointUnchecked(pos); - pos += charSize(ch); - switch (ch) { - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - while (pos < end && isWhiteSpaceSingleLine(charCodeUnchecked(pos))) { - pos++; - } - return token = 5 /* WhitespaceTrivia */; - case 64 /* at */: - return token = 60 /* AtToken */; - case 13 /* carriageReturn */: - if (charCodeUnchecked(pos) === 10 /* lineFeed */) { - pos++; - } - // falls through - case 10 /* lineFeed */: - tokenFlags |= 1 /* PrecedingLineBreak */; - return token = 4 /* NewLineTrivia */; - case 42 /* asterisk */: - return token = 42 /* AsteriskToken */; - case 123 /* openBrace */: - return token = 19 /* OpenBraceToken */; - case 125 /* closeBrace */: - return token = 20 /* CloseBraceToken */; - case 91 /* openBracket */: - return token = 23 /* OpenBracketToken */; - case 93 /* closeBracket */: - return token = 24 /* CloseBracketToken */; - case 40 /* openParen */: - return token = 21 /* OpenParenToken */; - case 41 /* closeParen */: - return token = 22 /* CloseParenToken */; - case 60 /* lessThan */: - return token = 30 /* LessThanToken */; - case 62 /* greaterThan */: - return token = 32 /* GreaterThanToken */; - case 61 /* equals */: - return token = 64 /* EqualsToken */; - case 44 /* comma */: - return token = 28 /* CommaToken */; - case 46 /* dot */: - return token = 25 /* DotToken */; - case 96 /* backtick */: - return token = 62 /* BacktickToken */; - case 35 /* hash */: - return token = 63 /* HashToken */; - case 92 /* backslash */: - pos--; - const extendedCookedChar = peekExtendedUnicodeEscape(); - if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { - tokenValue = scanExtendedUnicodeEscape( - /*shouldEmitInvalidEscapeError*/ - true - ) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - const cookedChar = peekUnicodeEscape(); - if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { - pos += 6; - tokenFlags |= 1024 /* UnicodeEscape */; - tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - pos++; - return token = 0 /* Unknown */; - } - if (isIdentifierStart(ch, languageVersion)) { - let char = ch; - while (pos < end && isIdentifierPart(char = codePointUnchecked(pos), languageVersion) || char === 45 /* minus */) pos += charSize(char); - tokenValue = text.substring(tokenStart, pos); - if (char === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return token = getIdentifierToken(); - } else { - return token = 0 /* Unknown */; - } - } - function speculationHelper(callback, isLookahead) { - const savePos = pos; - const saveStartPos = fullStartPos; - const saveTokenPos = tokenStart; - const saveToken = token; - const saveTokenValue = tokenValue; - const saveTokenFlags = tokenFlags; - const result = callback(); - if (!result || isLookahead) { - pos = savePos; - fullStartPos = saveStartPos; - tokenStart = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - tokenFlags = saveTokenFlags; - } - return result; - } - function scanRange(start2, length3, callback) { - const saveEnd = end; - const savePos = pos; - const saveStartPos = fullStartPos; - const saveTokenPos = tokenStart; - const saveToken = token; - const saveTokenValue = tokenValue; - const saveTokenFlags = tokenFlags; - const saveErrorExpectations = commentDirectives; - setText(text, start2, length3); - const result = callback(); - end = saveEnd; - pos = savePos; - fullStartPos = saveStartPos; - tokenStart = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - tokenFlags = saveTokenFlags; - commentDirectives = saveErrorExpectations; - return result; - } - function lookAhead(callback) { - return speculationHelper( - callback, - /*isLookahead*/ - true - ); - } - function tryScan(callback) { - return speculationHelper( - callback, - /*isLookahead*/ - false - ); - } - function getText() { - return text; - } - function clearCommentDirectives() { - commentDirectives = void 0; - } - function setText(newText, start2, length3) { - text = newText || ""; - end = length3 === void 0 ? text.length : start2 + length3; - resetTokenState(start2 || 0); - } - function setOnError(errorCallback) { - onError = errorCallback; - } - function setScriptTarget(scriptTarget) { - languageVersion = scriptTarget; - } - function setLanguageVariant(variant) { - languageVariant = variant; - } - function setScriptKind(kind) { - scriptKind = kind; - } - function setJSDocParsingMode(kind) { - jsDocParsingMode = kind; - } - function resetTokenState(position) { - Debug.assert(position >= 0); - pos = position; - fullStartPos = position; - tokenStart = position; - token = 0 /* Unknown */; - tokenValue = void 0; - tokenFlags = 0 /* None */; - } - function setSkipJsDocLeadingAsterisks(skip) { - skipJsDocLeadingAsterisks += skip ? 1 : -1; - } -} -function codePointAt(s, i) { - return s.codePointAt(i); -} -function charSize(ch) { - if (ch >= 65536) { - return 2; - } - if (ch === -1 /* EOF */) { - return 0; - } - return 1; -} -function utf16EncodeAsStringFallback(codePoint) { - Debug.assert(0 <= codePoint && codePoint <= 1114111); - if (codePoint <= 65535) { - return String.fromCharCode(codePoint); - } - const codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 55296; - const codeUnit2 = (codePoint - 65536) % 1024 + 56320; - return String.fromCharCode(codeUnit1, codeUnit2); -} -var utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback; -function utf16EncodeAsString(codePoint) { - return utf16EncodeAsStringWorker(codePoint); -} -var nonBinaryUnicodeProperties = new Map(Object.entries({ - General_Category: "General_Category", - gc: "General_Category", - Script: "Script", - sc: "Script", - Script_Extensions: "Script_Extensions", - scx: "Script_Extensions" -})); -var binaryUnicodeProperties = /* @__PURE__ */ new Set(["ASCII", "ASCII_Hex_Digit", "AHex", "Alphabetic", "Alpha", "Any", "Assigned", "Bidi_Control", "Bidi_C", "Bidi_Mirrored", "Bidi_M", "Case_Ignorable", "CI", "Cased", "Changes_When_Casefolded", "CWCF", "Changes_When_Casemapped", "CWCM", "Changes_When_Lowercased", "CWL", "Changes_When_NFKC_Casefolded", "CWKCF", "Changes_When_Titlecased", "CWT", "Changes_When_Uppercased", "CWU", "Dash", "Default_Ignorable_Code_Point", "DI", "Deprecated", "Dep", "Diacritic", "Dia", "Emoji", "Emoji_Component", "EComp", "Emoji_Modifier", "EMod", "Emoji_Modifier_Base", "EBase", "Emoji_Presentation", "EPres", "Extended_Pictographic", "ExtPict", "Extender", "Ext", "Grapheme_Base", "Gr_Base", "Grapheme_Extend", "Gr_Ext", "Hex_Digit", "Hex", "IDS_Binary_Operator", "IDSB", "IDS_Trinary_Operator", "IDST", "ID_Continue", "IDC", "ID_Start", "IDS", "Ideographic", "Ideo", "Join_Control", "Join_C", "Logical_Order_Exception", "LOE", "Lowercase", "Lower", "Math", "Noncharacter_Code_Point", "NChar", "Pattern_Syntax", "Pat_Syn", "Pattern_White_Space", "Pat_WS", "Quotation_Mark", "QMark", "Radical", "Regional_Indicator", "RI", "Sentence_Terminal", "STerm", "Soft_Dotted", "SD", "Terminal_Punctuation", "Term", "Unified_Ideograph", "UIdeo", "Uppercase", "Upper", "Variation_Selector", "VS", "White_Space", "space", "XID_Continue", "XIDC", "XID_Start", "XIDS"]); -var binaryUnicodePropertiesOfStrings = /* @__PURE__ */ new Set(["Basic_Emoji", "Emoji_Keycap_Sequence", "RGI_Emoji_Modifier_Sequence", "RGI_Emoji_Flag_Sequence", "RGI_Emoji_Tag_Sequence", "RGI_Emoji_ZWJ_Sequence", "RGI_Emoji"]); -var valuesOfNonBinaryUnicodeProperties = { - General_Category: /* @__PURE__ */ new Set(["C", "Other", "Cc", "Control", "cntrl", "Cf", "Format", "Cn", "Unassigned", "Co", "Private_Use", "Cs", "Surrogate", "L", "Letter", "LC", "Cased_Letter", "Ll", "Lowercase_Letter", "Lm", "Modifier_Letter", "Lo", "Other_Letter", "Lt", "Titlecase_Letter", "Lu", "Uppercase_Letter", "M", "Mark", "Combining_Mark", "Mc", "Spacing_Mark", "Me", "Enclosing_Mark", "Mn", "Nonspacing_Mark", "N", "Number", "Nd", "Decimal_Number", "digit", "Nl", "Letter_Number", "No", "Other_Number", "P", "Punctuation", "punct", "Pc", "Connector_Punctuation", "Pd", "Dash_Punctuation", "Pe", "Close_Punctuation", "Pf", "Final_Punctuation", "Pi", "Initial_Punctuation", "Po", "Other_Punctuation", "Ps", "Open_Punctuation", "S", "Symbol", "Sc", "Currency_Symbol", "Sk", "Modifier_Symbol", "Sm", "Math_Symbol", "So", "Other_Symbol", "Z", "Separator", "Zl", "Line_Separator", "Zp", "Paragraph_Separator", "Zs", "Space_Separator"]), - Script: /* @__PURE__ */ new Set(["Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "Arab", "Arabic", "Armi", "Imperial_Aramaic", "Armn", "Armenian", "Avst", "Avestan", "Bali", "Balinese", "Bamu", "Bamum", "Bass", "Bassa_Vah", "Batk", "Batak", "Beng", "Bengali", "Bhks", "Bhaiksuki", "Bopo", "Bopomofo", "Brah", "Brahmi", "Brai", "Braille", "Bugi", "Buginese", "Buhd", "Buhid", "Cakm", "Chakma", "Cans", "Canadian_Aboriginal", "Cari", "Carian", "Cham", "Cher", "Cherokee", "Chrs", "Chorasmian", "Copt", "Coptic", "Qaac", "Cpmn", "Cypro_Minoan", "Cprt", "Cypriot", "Cyrl", "Cyrillic", "Deva", "Devanagari", "Diak", "Dives_Akuru", "Dogr", "Dogra", "Dsrt", "Deseret", "Dupl", "Duployan", "Egyp", "Egyptian_Hieroglyphs", "Elba", "Elbasan", "Elym", "Elymaic", "Ethi", "Ethiopic", "Geor", "Georgian", "Glag", "Glagolitic", "Gong", "Gunjala_Gondi", "Gonm", "Masaram_Gondi", "Goth", "Gothic", "Gran", "Grantha", "Grek", "Greek", "Gujr", "Gujarati", "Guru", "Gurmukhi", "Hang", "Hangul", "Hani", "Han", "Hano", "Hanunoo", "Hatr", "Hatran", "Hebr", "Hebrew", "Hira", "Hiragana", "Hluw", "Anatolian_Hieroglyphs", "Hmng", "Pahawh_Hmong", "Hmnp", "Nyiakeng_Puachue_Hmong", "Hrkt", "Katakana_Or_Hiragana", "Hung", "Old_Hungarian", "Ital", "Old_Italic", "Java", "Javanese", "Kali", "Kayah_Li", "Kana", "Katakana", "Kawi", "Khar", "Kharoshthi", "Khmr", "Khmer", "Khoj", "Khojki", "Kits", "Khitan_Small_Script", "Knda", "Kannada", "Kthi", "Kaithi", "Lana", "Tai_Tham", "Laoo", "Lao", "Latn", "Latin", "Lepc", "Lepcha", "Limb", "Limbu", "Lina", "Linear_A", "Linb", "Linear_B", "Lisu", "Lyci", "Lycian", "Lydi", "Lydian", "Mahj", "Mahajani", "Maka", "Makasar", "Mand", "Mandaic", "Mani", "Manichaean", "Marc", "Marchen", "Medf", "Medefaidrin", "Mend", "Mende_Kikakui", "Merc", "Meroitic_Cursive", "Mero", "Meroitic_Hieroglyphs", "Mlym", "Malayalam", "Modi", "Mong", "Mongolian", "Mroo", "Mro", "Mtei", "Meetei_Mayek", "Mult", "Multani", "Mymr", "Myanmar", "Nagm", "Nag_Mundari", "Nand", "Nandinagari", "Narb", "Old_North_Arabian", "Nbat", "Nabataean", "Newa", "Nkoo", "Nko", "Nshu", "Nushu", "Ogam", "Ogham", "Olck", "Ol_Chiki", "Orkh", "Old_Turkic", "Orya", "Oriya", "Osge", "Osage", "Osma", "Osmanya", "Ougr", "Old_Uyghur", "Palm", "Palmyrene", "Pauc", "Pau_Cin_Hau", "Perm", "Old_Permic", "Phag", "Phags_Pa", "Phli", "Inscriptional_Pahlavi", "Phlp", "Psalter_Pahlavi", "Phnx", "Phoenician", "Plrd", "Miao", "Prti", "Inscriptional_Parthian", "Rjng", "Rejang", "Rohg", "Hanifi_Rohingya", "Runr", "Runic", "Samr", "Samaritan", "Sarb", "Old_South_Arabian", "Saur", "Saurashtra", "Sgnw", "SignWriting", "Shaw", "Shavian", "Shrd", "Sharada", "Sidd", "Siddham", "Sind", "Khudawadi", "Sinh", "Sinhala", "Sogd", "Sogdian", "Sogo", "Old_Sogdian", "Sora", "Sora_Sompeng", "Soyo", "Soyombo", "Sund", "Sundanese", "Sylo", "Syloti_Nagri", "Syrc", "Syriac", "Tagb", "Tagbanwa", "Takr", "Takri", "Tale", "Tai_Le", "Talu", "New_Tai_Lue", "Taml", "Tamil", "Tang", "Tangut", "Tavt", "Tai_Viet", "Telu", "Telugu", "Tfng", "Tifinagh", "Tglg", "Tagalog", "Thaa", "Thaana", "Thai", "Tibt", "Tibetan", "Tirh", "Tirhuta", "Tnsa", "Tangsa", "Toto", "Ugar", "Ugaritic", "Vaii", "Vai", "Vith", "Vithkuqi", "Wara", "Warang_Citi", "Wcho", "Wancho", "Xpeo", "Old_Persian", "Xsux", "Cuneiform", "Yezi", "Yezidi", "Yiii", "Yi", "Zanb", "Zanabazar_Square", "Zinh", "Inherited", "Qaai", "Zyyy", "Common", "Zzzz", "Unknown"]), - Script_Extensions: void 0 -}; -valuesOfNonBinaryUnicodeProperties.Script_Extensions = valuesOfNonBinaryUnicodeProperties.Script; - -// src/compiler/utilitiesPublic.ts -function isExternalModuleNameRelative(moduleName) { - return pathIsRelative(moduleName) || isRootedDiskPath(moduleName); -} -function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics, diagnosticsEqualityComparer); -} -var targetToLibMap = /* @__PURE__ */ new Map([ - [99 /* ESNext */, "lib.esnext.full.d.ts"], - [11 /* ES2024 */, "lib.es2024.full.d.ts"], - [10 /* ES2023 */, "lib.es2023.full.d.ts"], - [9 /* ES2022 */, "lib.es2022.full.d.ts"], - [8 /* ES2021 */, "lib.es2021.full.d.ts"], - [7 /* ES2020 */, "lib.es2020.full.d.ts"], - [6 /* ES2019 */, "lib.es2019.full.d.ts"], - [5 /* ES2018 */, "lib.es2018.full.d.ts"], - [4 /* ES2017 */, "lib.es2017.full.d.ts"], - [3 /* ES2016 */, "lib.es2016.full.d.ts"], - [2 /* ES2015 */, "lib.es6.d.ts"] - // We don't use lib.es2015.full.d.ts due to breaking change. -]); -function getDefaultLibFileName(options) { - const target = getEmitScriptTarget(options); - switch (target) { - case 99 /* ESNext */: - case 11 /* ES2024 */: - case 10 /* ES2023 */: - case 9 /* ES2022 */: - case 8 /* ES2021 */: - case 7 /* ES2020 */: - case 6 /* ES2019 */: - case 5 /* ES2018 */: - case 4 /* ES2017 */: - case 3 /* ES2016 */: - case 2 /* ES2015 */: - return targetToLibMap.get(target); - default: - return "lib.d.ts"; - } -} -function textSpanEnd(span) { - return span.start + span.length; -} -function textSpanIsEmpty(span) { - return span.length === 0; -} -function textSpanContainsPosition(span, position) { - return position >= span.start && position < textSpanEnd(span); -} -function textRangeContainsPositionInclusive(range, position) { - return position >= range.pos && position <= range.end; -} -function textSpanContainsTextSpan(span, other) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); -} -function textSpanContainsTextRange(span, range) { - return range.pos >= span.start && range.end <= textSpanEnd(span); -} -function textRangeContainsTextSpan(range, span) { - return span.start >= range.pos && textSpanEnd(span) <= range.end; -} -function textSpanOverlapsWith(span, other) { - return textSpanOverlap(span, other) !== void 0; -} -function textSpanOverlap(span1, span2) { - const overlap = textSpanIntersection(span1, span2); - return overlap && overlap.length === 0 ? void 0 : overlap; -} -function textSpanIntersectsWithTextSpan(span, other) { - return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length); -} -function textSpanIntersectsWith(span, start, length2) { - return decodedTextSpanIntersectsWith(span.start, span.length, start, length2); -} -function decodedTextSpanIntersectsWith(start1, length1, start2, length2) { - const end1 = start1 + length1; - const end2 = start2 + length2; - return start2 <= end1 && end2 >= start1; -} -function textSpanIntersectsWithPosition(span, position) { - return position <= textSpanEnd(span) && position >= span.start; -} -function textRangeIntersectsWithTextSpan(range, span) { - return textSpanIntersectsWith(span, range.pos, range.end - range.pos); -} -function textSpanIntersection(span1, span2) { - const start = Math.max(span1.start, span2.start); - const end = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - return start <= end ? createTextSpanFromBounds(start, end) : void 0; -} -function normalizeSpans(spans) { - spans = spans.filter((span) => span.length > 0).sort((a, b) => { - return a.start !== b.start ? a.start - b.start : a.length - b.length; - }); - const result = []; - let i = 0; - while (i < spans.length) { - let span = spans[i]; - let j = i + 1; - while (j < spans.length && textSpanIntersectsWithTextSpan(span, spans[j])) { - const start = Math.min(span.start, spans[j].start); - const end = Math.max(textSpanEnd(span), textSpanEnd(spans[j])); - span = createTextSpanFromBounds(start, end); - j++; - } - i = j; - result.push(span); - } - return result; -} -function createTextSpan(start, length2) { - if (start < 0) { - throw new Error("start < 0"); - } - if (length2 < 0) { - throw new Error("length < 0"); - } - return { start, length: length2 }; -} -function createTextSpanFromBounds(start, end) { - return createTextSpan(start, end - start); -} -function textChangeRangeNewSpan(range) { - return createTextSpan(range.span.start, range.newLength); -} -function textChangeRangeIsUnchanged(range) { - return textSpanIsEmpty(range.span) && range.newLength === 0; -} -function createTextChangeRange(span, newLength) { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - return { span, newLength }; -} -var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); -function collapseTextChangeRangesAcrossMultipleVersions(changes) { - if (changes.length === 0) { - return unchangedTextChangeRange; - } - if (changes.length === 1) { - return changes[0]; - } - const change0 = changes[0]; - let oldStartN = change0.span.start; - let oldEndN = textSpanEnd(change0.span); - let newEndN = oldStartN + change0.newLength; - for (let i = 1; i < changes.length; i++) { - const nextChange = changes[i]; - const oldStart1 = oldStartN; - const oldEnd1 = oldEndN; - const newEnd1 = newEndN; - const oldStart2 = nextChange.span.start; - const oldEnd2 = textSpanEnd(nextChange.span); - const newEnd2 = oldStart2 + nextChange.newLength; - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return createTextChangeRange( - createTextSpanFromBounds(oldStartN, oldEndN), - /*newLength*/ - newEndN - oldStartN - ); -} -function getTypeParameterOwner(d) { - if (d && d.kind === 169 /* TypeParameter */) { - for (let current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 265 /* InterfaceDeclaration */) { - return current; - } - } - } -} -function isParameterPropertyDeclaration(node, parent2) { - return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 177 /* Constructor */; -} -function isEmptyBindingPattern(node) { - if (isBindingPattern(node)) { - return every(node.elements, isEmptyBindingElement); - } - return false; -} -function isEmptyBindingElement(node) { - if (isOmittedExpression(node)) { - return true; - } - return isEmptyBindingPattern(node.name); -} -function walkUpBindingElementsAndPatterns(binding) { - let node = binding.parent; - while (isBindingElement(node.parent)) { - node = node.parent.parent; - } - return node.parent; -} -function getCombinedFlags(node, getFlags) { - if (isBindingElement(node)) { - node = walkUpBindingElementsAndPatterns(node); - } - let flags = getFlags(node); - if (node.kind === 261 /* VariableDeclaration */) { - node = node.parent; - } - if (node && node.kind === 262 /* VariableDeclarationList */) { - flags |= getFlags(node); - node = node.parent; - } - if (node && node.kind === 244 /* VariableStatement */) { - flags |= getFlags(node); - } - return flags; -} -function getCombinedModifierFlags(node) { - return getCombinedFlags(node, getEffectiveModifierFlags); -} -function getCombinedNodeFlagsAlwaysIncludeJSDoc(node) { - return getCombinedFlags(node, getEffectiveModifierFlagsAlwaysIncludeJSDoc); -} -function getCombinedNodeFlags(node) { - return getCombinedFlags(node, getNodeFlags); -} -function getNodeFlags(node) { - return node.flags; -} -var supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]; -function validateLocaleAndSetLanguage(locale, sys2, errors) { - const lowerCaseLocale = locale.toLowerCase(); - 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")); - } - return; - } - const language = matchResult[1]; - const territory = matchResult[2]; - if (contains(supportedLocaleDirectories, lowerCaseLocale) && !trySetLanguageAndTerritory(language, territory, errors)) { - trySetLanguageAndTerritory( - language, - /*territory*/ - void 0, - errors - ); - } - setUILocale(locale); - function trySetLanguageAndTerritory(language2, territory2, errors2) { - const compilerFilePath = normalizePath(sys2.getExecutingFilePath()); - const containingDirectoryPath = getDirectoryPath(compilerFilePath); - let filePath = combinePaths(containingDirectoryPath, language2); - if (territory2) { - filePath = filePath + "-" + territory2; - } - filePath = sys2.resolvePath(combinePaths(filePath, "diagnosticMessages.generated.json")); - if (!sys2.fileExists(filePath)) { - return false; - } - let fileContents = ""; - try { - fileContents = sys2.readFile(filePath); - } catch { - if (errors2) { - errors2.push(createCompilerDiagnostic(Diagnostics.Unable_to_open_file_0, filePath)); - } - return false; - } - try { - setLocalizedDiagnosticMessages(JSON.parse(fileContents)); - } catch { - if (errors2) { - errors2.push(createCompilerDiagnostic(Diagnostics.Corrupted_locale_file_0, filePath)); - } - return false; - } - return true; - } -} -function getOriginalNode(node, nodeTest) { - if (node) { - while (node.original !== void 0) { - node = node.original; - } - } - if (!node || !nodeTest) { - return node; - } - return nodeTest(node) ? node : void 0; -} -function findAncestor(node, callback) { - while (node) { - const result = callback(node); - if (result === "quit") { - return void 0; - } else if (result) { - return node; - } - node = node.parent; - } - return void 0; -} -function isParseTreeNode(node) { - return (node.flags & 16 /* Synthesized */) === 0; -} -function getParseTreeNode(node, nodeTest) { - if (node === void 0 || isParseTreeNode(node)) { - return node; - } - node = node.original; - while (node) { - if (isParseTreeNode(node)) { - return !nodeTest || nodeTest(node) ? node : void 0; - } - node = node.original; - } -} -function escapeLeadingUnderscores(identifier) { - return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; -} -function unescapeLeadingUnderscores(identifier) { - const id = identifier; - return id.length >= 3 && id.charCodeAt(0) === 95 /* _ */ && id.charCodeAt(1) === 95 /* _ */ && id.charCodeAt(2) === 95 /* _ */ ? id.substr(1) : id; -} -function idText(identifierOrPrivateName) { - return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); -} -function identifierToKeywordKind(node) { - const token = stringToToken(node.escapedText); - return token ? tryCast(token, isKeyword) : void 0; -} -function symbolName(symbol) { - if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { - return idText(symbol.valueDeclaration.name); - } - return unescapeLeadingUnderscores(symbol.escapedName); -} -function nameForNamelessJSDocTypedef(declaration) { - const hostNode = declaration.parent.parent; - if (!hostNode) { - return void 0; - } - if (isDeclaration(hostNode)) { - return getDeclarationIdentifier(hostNode); - } - switch (hostNode.kind) { - case 244 /* VariableStatement */: - if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { - return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); - } - break; - case 245 /* ExpressionStatement */: - let expr = hostNode.expression; - if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 64 /* EqualsToken */) { - expr = expr.left; - } - switch (expr.kind) { - case 212 /* PropertyAccessExpression */: - return expr.name; - case 213 /* ElementAccessExpression */: - const arg = expr.argumentExpression; - if (isIdentifier(arg)) { - return arg; - } - } - break; - case 218 /* ParenthesizedExpression */: { - return getDeclarationIdentifier(hostNode.expression); - } - case 257 /* LabeledStatement */: { - if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { - return getDeclarationIdentifier(hostNode.statement); - } - break; - } - } -} -function getDeclarationIdentifier(node) { - const name = getNameOfDeclaration(node); - return name && isIdentifier(name) ? name : void 0; -} -function nodeHasName(statement, name) { - if (isNamedDeclaration(statement) && isIdentifier(statement.name) && idText(statement.name) === idText(name)) { - return true; - } - if (isVariableStatement(statement) && some(statement.declarationList.declarations, (d) => nodeHasName(d, name))) { - return true; - } - return false; -} -function getNameOfJSDocTypedef(declaration) { - return declaration.name || nameForNamelessJSDocTypedef(declaration); -} -function isNamedDeclaration(node) { - return !!node.name; -} -function getNonAssignedNameOfDeclaration(declaration) { - switch (declaration.kind) { - case 80 /* Identifier */: - return declaration; - case 349 /* JSDocPropertyTag */: - case 342 /* JSDocParameterTag */: { - const { name } = declaration; - if (name.kind === 167 /* QualifiedName */) { - return name.right; - } - break; - } - case 214 /* CallExpression */: - case 227 /* BinaryExpression */: { - const expr2 = declaration; - switch (getAssignmentDeclarationKind(expr2)) { - case 1 /* ExportsProperty */: - case 4 /* ThisProperty */: - case 5 /* Property */: - case 3 /* PrototypeProperty */: - return getElementOrPropertyAccessArgumentExpressionOrName(expr2.left); - case 7 /* ObjectDefinePropertyValue */: - case 8 /* ObjectDefinePropertyExports */: - case 9 /* ObjectDefinePrototypeProperty */: - return expr2.arguments[1]; - default: - return void 0; - } - } - case 347 /* JSDocTypedefTag */: - return getNameOfJSDocTypedef(declaration); - case 341 /* JSDocEnumTag */: - return nameForNamelessJSDocTypedef(declaration); - case 278 /* ExportAssignment */: { - const { expression } = declaration; - return isIdentifier(expression) ? expression : void 0; - } - case 213 /* ElementAccessExpression */: - const expr = declaration; - if (isBindableStaticElementAccessExpression(expr)) { - return expr.argumentExpression; - } - } - return declaration.name; -} -function getNameOfDeclaration(declaration) { - if (declaration === void 0) return void 0; - return getNonAssignedNameOfDeclaration(declaration) || (isFunctionExpression(declaration) || isArrowFunction(declaration) || isClassExpression(declaration) ? getAssignedName(declaration) : void 0); -} -function getAssignedName(node) { - if (!node.parent) { - return void 0; - } else if (isPropertyAssignment(node.parent) || isBindingElement(node.parent)) { - return node.parent.name; - } else if (isBinaryExpression(node.parent) && node === node.parent.right) { - if (isIdentifier(node.parent.left)) { - return node.parent.left; - } else if (isAccessExpression(node.parent.left)) { - return getElementOrPropertyAccessArgumentExpressionOrName(node.parent.left); - } - } else if (isVariableDeclaration(node.parent) && isIdentifier(node.parent.name)) { - return node.parent.name; - } -} -function getDecorators(node) { - if (hasDecorators(node)) { - return filter(node.modifiers, isDecorator); - } -} -function getModifiers(node) { - if (hasSyntacticModifier(node, 98303 /* Modifier */)) { - return filter(node.modifiers, isModifier); - } -} -function getJSDocParameterTagsWorker(param, noCache) { - if (param.name) { - if (isIdentifier(param.name)) { - const name = param.name.escapedText; - return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name); - } else { - const i = param.parent.parameters.indexOf(param); - Debug.assert(i > -1, "Parameters should always be in their parents' parameter list"); - const paramTags = getJSDocTagsWorker(param.parent, noCache).filter(isJSDocParameterTag); - if (i < paramTags.length) { - return [paramTags[i]]; - } - } - } - return emptyArray; -} -function getJSDocParameterTags(param) { - return getJSDocParameterTagsWorker( - param, - /*noCache*/ - false - ); -} -function getJSDocParameterTagsNoCache(param) { - return getJSDocParameterTagsWorker( - param, - /*noCache*/ - true - ); -} -function getJSDocTypeParameterTagsWorker(param, noCache) { - const name = param.name.escapedText; - return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocTemplateTag(tag) && tag.typeParameters.some((tp) => tp.name.escapedText === name)); -} -function getJSDocTypeParameterTags(param) { - return getJSDocTypeParameterTagsWorker( - param, - /*noCache*/ - false - ); -} -function getJSDocTypeParameterTagsNoCache(param) { - return getJSDocTypeParameterTagsWorker( - param, - /*noCache*/ - true - ); -} -function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, isJSDocParameterTag); -} -function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, isJSDocAugmentsTag); -} -function getJSDocImplementsTags(node) { - return getAllJSDocTags(node, isJSDocImplementsTag); -} -function getJSDocClassTag(node) { - return getFirstJSDocTag(node, isJSDocClassTag); -} -function getJSDocPublicTag(node) { - return getFirstJSDocTag(node, isJSDocPublicTag); -} -function getJSDocPublicTagNoCache(node) { - return getFirstJSDocTag( - node, - isJSDocPublicTag, - /*noCache*/ - true - ); -} -function getJSDocPrivateTag(node) { - return getFirstJSDocTag(node, isJSDocPrivateTag); -} -function getJSDocPrivateTagNoCache(node) { - return getFirstJSDocTag( - node, - isJSDocPrivateTag, - /*noCache*/ - true - ); -} -function getJSDocProtectedTag(node) { - return getFirstJSDocTag(node, isJSDocProtectedTag); -} -function getJSDocProtectedTagNoCache(node) { - return getFirstJSDocTag( - node, - isJSDocProtectedTag, - /*noCache*/ - true - ); -} -function getJSDocReadonlyTag(node) { - return getFirstJSDocTag(node, isJSDocReadonlyTag); -} -function getJSDocReadonlyTagNoCache(node) { - return getFirstJSDocTag( - node, - isJSDocReadonlyTag, - /*noCache*/ - true - ); -} -function getJSDocOverrideTagNoCache(node) { - return getFirstJSDocTag( - node, - isJSDocOverrideTag, - /*noCache*/ - true - ); -} -function getJSDocDeprecatedTag(node) { - return getFirstJSDocTag(node, isJSDocDeprecatedTag); -} -function getJSDocDeprecatedTagNoCache(node) { - return getFirstJSDocTag( - node, - isJSDocDeprecatedTag, - /*noCache*/ - true - ); -} -function getJSDocEnumTag(node) { - return getFirstJSDocTag(node, isJSDocEnumTag); -} -function getJSDocThisTag(node) { - return getFirstJSDocTag(node, isJSDocThisTag); -} -function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, isJSDocReturnTag); -} -function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, isJSDocTemplateTag); -} -function getJSDocSatisfiesTag(node) { - return getFirstJSDocTag(node, isJSDocSatisfiesTag); -} -function getJSDocTypeTag(node) { - const tag = getFirstJSDocTag(node, isJSDocTypeTag); - if (tag && tag.typeExpression && tag.typeExpression.type) { - return tag; - } - return void 0; -} -function getJSDocType(node) { - let tag = getFirstJSDocTag(node, isJSDocTypeTag); - if (!tag && isParameter(node)) { - tag = find(getJSDocParameterTags(node), (tag2) => !!tag2.typeExpression); - } - return tag && tag.typeExpression && tag.typeExpression.type; -} -function getJSDocReturnType(node) { - const returnTag = getJSDocReturnTag(node); - if (returnTag && returnTag.typeExpression) { - return returnTag.typeExpression.type; - } - const typeTag = getJSDocTypeTag(node); - if (typeTag && typeTag.typeExpression) { - const type = typeTag.typeExpression.type; - if (isTypeLiteralNode(type)) { - const sig = find(type.members, isCallSignatureDeclaration); - return sig && sig.type; - } - if (isFunctionTypeNode(type) || isJSDocFunctionType(type)) { - return type.type; - } - } -} -function getJSDocTagsWorker(node, noCache) { - var _a; - if (!canHaveJSDoc(node)) return emptyArray; - let tags = (_a = node.jsDoc) == null ? void 0 : _a.jsDocCache; - if (tags === void 0 || noCache) { - const comments = getJSDocCommentsAndTags(node, noCache); - Debug.assert(comments.length < 2 || comments[0] !== comments[1]); - tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j); - if (!noCache) { - node.jsDoc ?? (node.jsDoc = []); - node.jsDoc.jsDocCache = tags; - } - } - return tags; -} -function getJSDocTags(node) { - return getJSDocTagsWorker( - node, - /*noCache*/ - false - ); -} -function getFirstJSDocTag(node, predicate, noCache) { - return find(getJSDocTagsWorker(node, noCache), predicate); -} -function getAllJSDocTags(node, predicate) { - return getJSDocTags(node).filter(predicate); -} -function getAllJSDocTagsOfKind(node, kind) { - 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 === 322 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); -} -function formatJSDocLink(link) { - const kind = link.kind === 325 /* JSDocLink */ ? "link" : link.kind === 326 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; - const name = link.name ? entityNameToString(link.name) : ""; - const space = link.name && (link.text === "" || link.text.startsWith("://")) ? "" : " "; - return `{@${kind} ${name}${space}${link.text}}`; -} -function getEffectiveTypeParameterDeclarations(node) { - if (isJSDocSignature(node)) { - if (isJSDocOverloadTag(node.parent)) { - const jsDoc = getJSDocRoot(node.parent); - if (jsDoc && length(jsDoc.tags)) { - return flatMap(jsDoc.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0); - } - } - return emptyArray; - } - if (isJSDocTypeAlias(node)) { - Debug.assert(node.parent.kind === 321 /* JSDoc */); - return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0); - } - if (node.typeParameters) { - return node.typeParameters; - } - if (canHaveIllegalTypeParameters(node) && node.typeParameters) { - return node.typeParameters; - } - if (isInJSFile(node)) { - const decls = getJSDocTypeParameterDeclarations(node); - if (decls.length) { - return decls; - } - const typeTag = getJSDocType(node); - if (typeTag && isFunctionTypeNode(typeTag) && typeTag.typeParameters) { - return typeTag.typeParameters; - } - } - return emptyArray; -} -function getEffectiveConstraintOfTypeParameter(node) { - return node.constraint ? node.constraint : isJSDocTemplateTag(node.parent) && node === node.parent.typeParameters[0] ? node.parent.constraint : void 0; -} -function isMemberName(node) { - return node.kind === 80 /* Identifier */ || node.kind === 81 /* PrivateIdentifier */; -} -function isGetOrSetAccessorDeclaration(node) { - return node.kind === 179 /* SetAccessor */ || node.kind === 178 /* GetAccessor */; -} -function isPropertyAccessChain(node) { - return isPropertyAccessExpression(node) && !!(node.flags & 64 /* OptionalChain */); -} -function isElementAccessChain(node) { - return isElementAccessExpression(node) && !!(node.flags & 64 /* OptionalChain */); -} -function isCallChain(node) { - return isCallExpression(node) && !!(node.flags & 64 /* OptionalChain */); -} -function isOptionalChain(node) { - const kind = node.kind; - return !!(node.flags & 64 /* OptionalChain */) && (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */ || kind === 214 /* CallExpression */ || kind === 236 /* NonNullExpression */); -} -function isOptionalChainRoot(node) { - return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; -} -function isExpressionOfOptionalChainRoot(node) { - return isOptionalChainRoot(node.parent) && node.parent.expression === node; -} -function isOutermostOptionalChain(node) { - return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression; -} -function isNullishCoalesce(node) { - return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 61 /* QuestionQuestionToken */; -} -function isConstTypeReference(node) { - return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments; -} -function skipPartiallyEmittedExpressions(node) { - return skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); -} -function isNonNullChain(node) { - return isNonNullExpression(node) && !!(node.flags & 64 /* OptionalChain */); -} -function isBreakOrContinueStatement(node) { - return node.kind === 253 /* BreakStatement */ || node.kind === 252 /* ContinueStatement */; -} -function isNamedExportBindings(node) { - return node.kind === 281 /* NamespaceExport */ || node.kind === 280 /* NamedExports */; -} -function isJSDocPropertyLikeTag(node) { - return node.kind === 349 /* JSDocPropertyTag */ || node.kind === 342 /* JSDocParameterTag */; -} -function isNodeKind(kind) { - return kind >= 167 /* FirstNode */; -} -function isTokenKind(kind) { - return kind >= 0 /* FirstToken */ && kind <= 166 /* LastToken */; -} -function isToken(n) { - return isTokenKind(n.kind); -} -function isNodeArray(array) { - return hasProperty(array, "pos") && hasProperty(array, "end"); -} -function isLiteralKind(kind) { - return 9 /* FirstLiteralToken */ <= kind && kind <= 15 /* LastLiteralToken */; -} -function isLiteralExpression(node) { - return isLiteralKind(node.kind); -} -function isLiteralExpressionOfObject(node) { - switch (node.kind) { - case 211 /* ObjectLiteralExpression */: - case 210 /* ArrayLiteralExpression */: - case 14 /* RegularExpressionLiteral */: - case 219 /* FunctionExpression */: - case 232 /* ClassExpression */: - return true; - } - return false; -} -function isTemplateLiteralKind(kind) { - return 15 /* FirstTemplateToken */ <= kind && kind <= 18 /* LastTemplateToken */; -} -function isTemplateLiteralToken(node) { - return isTemplateLiteralKind(node.kind); -} -function isTemplateMiddleOrTemplateTail(node) { - const kind = node.kind; - return kind === 17 /* TemplateMiddle */ || kind === 18 /* TemplateTail */; -} -function isImportOrExportSpecifier(node) { - return isImportSpecifier(node) || isExportSpecifier(node); -} -function isTypeOnlyImportDeclaration(node) { - switch (node.kind) { - case 277 /* ImportSpecifier */: - return node.isTypeOnly || node.parent.parent.phaseModifier === 156 /* TypeKeyword */; - case 275 /* NamespaceImport */: - return node.parent.phaseModifier === 156 /* TypeKeyword */; - case 274 /* ImportClause */: - return node.phaseModifier === 156 /* TypeKeyword */; - case 272 /* ImportEqualsDeclaration */: - return node.isTypeOnly; - } - return false; -} -function isTypeOnlyExportDeclaration(node) { - switch (node.kind) { - case 282 /* ExportSpecifier */: - return node.isTypeOnly || node.parent.parent.isTypeOnly; - case 279 /* ExportDeclaration */: - return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; - case 281 /* NamespaceExport */: - return node.parent.isTypeOnly; - } - return false; -} -function isTypeOnlyImportOrExportDeclaration(node) { - return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); -} -function isPartOfTypeOnlyImportOrExportDeclaration(node) { - return findAncestor(node, isTypeOnlyImportOrExportDeclaration) !== void 0; -} -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; -} -function isGeneratedPrivateIdentifier(node) { - 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); -} -function isPrivateIdentifierPropertyAccessExpression(node) { - return isPropertyAccessExpression(node) && isPrivateIdentifier(node.name); -} -function isModifierKind(token) { - switch (token) { - case 128 /* AbstractKeyword */: - case 129 /* AccessorKeyword */: - case 134 /* AsyncKeyword */: - case 87 /* ConstKeyword */: - case 138 /* DeclareKeyword */: - case 90 /* DefaultKeyword */: - case 95 /* ExportKeyword */: - case 103 /* InKeyword */: - case 125 /* PublicKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - case 148 /* ReadonlyKeyword */: - case 126 /* StaticKeyword */: - case 147 /* OutKeyword */: - case 164 /* OverrideKeyword */: - return true; - } - return false; -} -function isParameterPropertyModifier(kind) { - return !!(modifierToFlag(kind) & 31 /* ParameterPropertyModifier */); -} -function isClassMemberModifier(idToken) { - 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 === 167 /* 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 === 168 /* ComputedPropertyName */; -} -function isBindingName(node) { - const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 207 /* ObjectBindingPattern */ || kind === 208 /* ArrayBindingPattern */; -} -function isFunctionLike(node) { - return !!node && isFunctionLikeKind(node.kind); -} -function isFunctionLikeOrClassStaticBlockDeclaration(node) { - return !!node && (isFunctionLikeKind(node.kind) || isClassStaticBlockDeclaration(node)); -} -function isFunctionLikeDeclaration(node) { - return node && isFunctionLikeDeclarationKind(node.kind); -} -function isBooleanLiteral(node) { - return node.kind === 112 /* TrueKeyword */ || node.kind === 97 /* FalseKeyword */; -} -function isFunctionLikeDeclarationKind(kind) { - switch (kind) { - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return true; - default: - return false; - } -} -function isFunctionLikeKind(kind) { - switch (kind) { - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 324 /* JSDocSignature */: - case 181 /* ConstructSignature */: - case 182 /* IndexSignature */: - case 185 /* FunctionType */: - case 318 /* JSDocFunctionType */: - case 186 /* ConstructorType */: - return true; - default: - return isFunctionLikeDeclarationKind(kind); - } -} -function isFunctionOrModuleBlock(node) { - return isSourceFile(node) || isModuleBlock(node) || isBlock(node) && isFunctionLike(node.parent); -} -function isClassElement(node) { - const kind = node.kind; - return kind === 177 /* Constructor */ || kind === 173 /* PropertyDeclaration */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 182 /* IndexSignature */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */; -} -function isClassLike(node) { - return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */); -} -function isAccessor(node) { - return node && (node.kind === 178 /* GetAccessor */ || node.kind === 179 /* 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 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return true; - default: - return false; - } -} -function isModifierLike(node) { - return isModifier(node) || isDecorator(node); -} -function isTypeElement(node) { - const kind = node.kind; - return kind === 181 /* ConstructSignature */ || kind === 180 /* CallSignature */ || kind === 172 /* PropertySignature */ || kind === 174 /* MethodSignature */ || kind === 182 /* IndexSignature */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 355 /* NotEmittedTypeElement */; -} -function isClassOrTypeElement(node) { - return isTypeElement(node) || isClassElement(node); -} -function isObjectLiteralElementLike(node) { - const kind = node.kind; - return kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 306 /* SpreadAssignment */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; -} -function isTypeNode(node) { - return isTypeNodeKind(node.kind); -} -function isFunctionOrConstructorTypeNode(node) { - switch (node.kind) { - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - return true; - } - return false; -} -function isBindingPattern(node) { - if (node) { - const kind = node.kind; - return kind === 208 /* ArrayBindingPattern */ || kind === 207 /* ObjectBindingPattern */; - } - return false; -} -function isAssignmentPattern(node) { - const kind = node.kind; - return kind === 210 /* ArrayLiteralExpression */ || kind === 211 /* ObjectLiteralExpression */; -} -function isArrayBindingElement(node) { - const kind = node.kind; - return kind === 209 /* BindingElement */ || kind === 233 /* OmittedExpression */; -} -function isDeclarationBindingElement(bindingElement) { - switch (bindingElement.kind) { - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 209 /* BindingElement */: - return true; - } - return false; -} -function isBindingOrAssignmentElement(node) { - return isVariableDeclaration(node) || isParameter(node) || isObjectBindingOrAssignmentElement(node) || isArrayBindingOrAssignmentElement(node); -} -function isBindingOrAssignmentPattern(node) { - return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); -} -function isObjectBindingOrAssignmentPattern(node) { - switch (node.kind) { - case 207 /* ObjectBindingPattern */: - case 211 /* ObjectLiteralExpression */: - return true; - } - return false; -} -function isObjectBindingOrAssignmentElement(node) { - switch (node.kind) { - case 209 /* BindingElement */: - case 304 /* PropertyAssignment */: - // AssignmentProperty - case 305 /* ShorthandPropertyAssignment */: - // AssignmentProperty - case 306 /* SpreadAssignment */: - return true; - } - return false; -} -function isArrayBindingOrAssignmentPattern(node) { - switch (node.kind) { - case 208 /* ArrayBindingPattern */: - case 210 /* ArrayLiteralExpression */: - return true; - } - return false; -} -function isArrayBindingOrAssignmentElement(node) { - switch (node.kind) { - case 209 /* BindingElement */: - case 233 /* OmittedExpression */: - // Elision - case 231 /* SpreadElement */: - // AssignmentRestElement - case 210 /* ArrayLiteralExpression */: - // ArrayAssignmentPattern - case 211 /* ObjectLiteralExpression */: - // ObjectAssignmentPattern - case 80 /* Identifier */: - // DestructuringAssignmentTarget - case 212 /* PropertyAccessExpression */: - // DestructuringAssignmentTarget - case 213 /* ElementAccessExpression */: - return true; - } - return isAssignmentExpression( - node, - /*excludeCompoundAssignment*/ - true - ); -} -function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { - const kind = node.kind; - return kind === 212 /* PropertyAccessExpression */ || kind === 167 /* QualifiedName */ || kind === 206 /* ImportType */; -} -function isPropertyAccessOrQualifiedName(node) { - const kind = node.kind; - return kind === 212 /* PropertyAccessExpression */ || kind === 167 /* QualifiedName */; -} -function isCallLikeOrFunctionLikeExpression(node) { - return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node); -} -function isCallLikeExpression(node) { - switch (node.kind) { - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 216 /* TaggedTemplateExpression */: - case 171 /* Decorator */: - case 287 /* JsxOpeningElement */: - case 286 /* JsxSelfClosingElement */: - case 290 /* JsxOpeningFragment */: - return true; - case 227 /* BinaryExpression */: - return node.operatorToken.kind === 104 /* InstanceOfKeyword */; - default: - return false; - } -} -function isCallOrNewExpression(node) { - return node.kind === 214 /* CallExpression */ || node.kind === 215 /* NewExpression */; -} -function isTemplateLiteral(node) { - const kind = node.kind; - return kind === 229 /* TemplateExpression */ || kind === 15 /* NoSubstitutionTemplateLiteral */; -} -function isLeftHandSideExpression(node) { - return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); -} -function isLeftHandSideExpressionKind(kind) { - switch (kind) { - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - case 215 /* NewExpression */: - case 214 /* CallExpression */: - case 285 /* JsxElement */: - case 286 /* JsxSelfClosingElement */: - case 289 /* JsxFragment */: - case 216 /* TaggedTemplateExpression */: - case 210 /* ArrayLiteralExpression */: - case 218 /* ParenthesizedExpression */: - case 211 /* ObjectLiteralExpression */: - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 80 /* Identifier */: - case 81 /* PrivateIdentifier */: - // technically this is only an Expression if it's in a `#field in expr` BinaryExpression - case 14 /* RegularExpressionLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 229 /* TemplateExpression */: - case 97 /* FalseKeyword */: - case 106 /* NullKeyword */: - case 110 /* ThisKeyword */: - case 112 /* TrueKeyword */: - case 108 /* SuperKeyword */: - case 236 /* NonNullExpression */: - case 234 /* ExpressionWithTypeArguments */: - case 237 /* MetaProperty */: - case 102 /* ImportKeyword */: - // technically this is only an Expression if it's in a CallExpression - case 283 /* MissingDeclaration */: - return true; - default: - return false; - } -} -function isUnaryExpression(node) { - return isUnaryExpressionKind(skipPartiallyEmittedExpressions(node).kind); -} -function isUnaryExpressionKind(kind) { - switch (kind) { - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - case 221 /* DeleteExpression */: - case 222 /* TypeOfExpression */: - case 223 /* VoidExpression */: - case 224 /* AwaitExpression */: - case 217 /* TypeAssertionExpression */: - return true; - default: - return isLeftHandSideExpressionKind(kind); - } -} -function isUnaryExpressionWithWrite(expr) { - switch (expr.kind) { - case 226 /* PostfixUnaryExpression */: - return true; - case 225 /* PrefixUnaryExpression */: - return expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; - default: - return false; - } -} -function isLiteralTypeLiteral(node) { - switch (node.kind) { - case 106 /* NullKeyword */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 225 /* PrefixUnaryExpression */: - return true; - default: - return isLiteralExpression(node); - } -} -function isExpression(node) { - return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); -} -function isExpressionKind(kind) { - switch (kind) { - case 228 /* ConditionalExpression */: - case 230 /* YieldExpression */: - case 220 /* ArrowFunction */: - case 227 /* BinaryExpression */: - case 231 /* SpreadElement */: - case 235 /* AsExpression */: - case 233 /* OmittedExpression */: - case 357 /* CommaListExpression */: - case 356 /* PartiallyEmittedExpression */: - case 239 /* SatisfiesExpression */: - return true; - default: - return isUnaryExpressionKind(kind); - } -} -function isAssertionExpression(node) { - const kind = node.kind; - return kind === 217 /* TypeAssertionExpression */ || kind === 235 /* AsExpression */; -} -function isIterationStatement(node, lookInLabeledStatements) { - switch (node.kind) { - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - return true; - case 257 /* LabeledStatement */: - return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); - } - return false; -} -function isScopeMarker(node) { - return isExportAssignment(node) || isExportDeclaration(node); -} -function hasScopeMarker(statements) { - return some(statements, isScopeMarker); -} -function needsScopeMarker(result) { - return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result, 32 /* Export */) && !isAmbientModule(result); -} -function isExternalModuleIndicator(result) { - return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */); -} -function isForInOrOfStatement(node) { - return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */; -} -function isConciseBody(node) { - return isBlock(node) || isExpression(node); -} -function isFunctionBody(node) { - return isBlock(node); -} -function isForInitializer(node) { - return isVariableDeclarationList(node) || isExpression(node); -} -function isModuleBody(node) { - const kind = node.kind; - return kind === 269 /* ModuleBlock */ || kind === 268 /* ModuleDeclaration */ || kind === 80 /* Identifier */; -} -function isNamespaceBody(node) { - const kind = node.kind; - return kind === 269 /* ModuleBlock */ || kind === 268 /* ModuleDeclaration */; -} -function isJSDocNamespaceBody(node) { - const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 268 /* ModuleDeclaration */; -} -function isNamedImportBindings(node) { - const kind = node.kind; - return kind === 276 /* NamedImports */ || kind === 275 /* NamespaceImport */; -} -function isModuleOrEnumDeclaration(node) { - return node.kind === 268 /* ModuleDeclaration */ || node.kind === 267 /* EnumDeclaration */; -} -function canHaveSymbol(node) { - switch (node.kind) { - case 220 /* ArrowFunction */: - case 227 /* BinaryExpression */: - case 209 /* BindingElement */: - case 214 /* CallExpression */: - case 180 /* CallSignature */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 176 /* ClassStaticBlockDeclaration */: - case 177 /* Constructor */: - case 186 /* ConstructorType */: - case 181 /* ConstructSignature */: - case 213 /* ElementAccessExpression */: - case 267 /* EnumDeclaration */: - case 307 /* EnumMember */: - case 278 /* ExportAssignment */: - case 279 /* ExportDeclaration */: - case 282 /* ExportSpecifier */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 185 /* FunctionType */: - case 178 /* GetAccessor */: - case 80 /* Identifier */: - case 274 /* ImportClause */: - case 272 /* ImportEqualsDeclaration */: - case 277 /* ImportSpecifier */: - case 182 /* IndexSignature */: - case 265 /* InterfaceDeclaration */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - case 318 /* JSDocFunctionType */: - case 342 /* JSDocParameterTag */: - case 349 /* JSDocPropertyTag */: - case 324 /* JSDocSignature */: - case 347 /* JSDocTypedefTag */: - case 323 /* JSDocTypeLiteral */: - case 292 /* JsxAttribute */: - case 293 /* JsxAttributes */: - case 294 /* JsxSpreadAttribute */: - case 201 /* MappedType */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 268 /* ModuleDeclaration */: - case 203 /* NamedTupleMember */: - case 281 /* NamespaceExport */: - case 271 /* NamespaceExportDeclaration */: - case 275 /* NamespaceImport */: - case 215 /* NewExpression */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 9 /* NumericLiteral */: - case 211 /* ObjectLiteralExpression */: - case 170 /* Parameter */: - case 212 /* PropertyAccessExpression */: - case 304 /* PropertyAssignment */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 179 /* SetAccessor */: - case 305 /* ShorthandPropertyAssignment */: - case 308 /* SourceFile */: - case 306 /* SpreadAssignment */: - case 11 /* StringLiteral */: - case 266 /* TypeAliasDeclaration */: - case 188 /* TypeLiteral */: - case 169 /* TypeParameter */: - case 261 /* VariableDeclaration */: - return true; - default: - return false; - } -} -function canHaveLocals(node) { - switch (node.kind) { - case 220 /* ArrowFunction */: - case 242 /* Block */: - case 180 /* CallSignature */: - case 270 /* CaseBlock */: - case 300 /* CatchClause */: - case 176 /* ClassStaticBlockDeclaration */: - case 195 /* ConditionalType */: - case 177 /* Constructor */: - case 186 /* ConstructorType */: - case 181 /* ConstructSignature */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 185 /* FunctionType */: - case 178 /* GetAccessor */: - case 182 /* IndexSignature */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - case 318 /* JSDocFunctionType */: - case 324 /* JSDocSignature */: - case 347 /* JSDocTypedefTag */: - case 201 /* MappedType */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 268 /* ModuleDeclaration */: - case 179 /* SetAccessor */: - case 308 /* SourceFile */: - case 266 /* TypeAliasDeclaration */: - return true; - default: - return false; - } -} -function isDeclarationKind(kind) { - return kind === 220 /* ArrowFunction */ || kind === 209 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 177 /* Constructor */ || kind === 267 /* EnumDeclaration */ || kind === 307 /* EnumMember */ || kind === 282 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 219 /* FunctionExpression */ || kind === 178 /* GetAccessor */ || kind === 274 /* ImportClause */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 277 /* ImportSpecifier */ || kind === 265 /* InterfaceDeclaration */ || kind === 292 /* JsxAttribute */ || kind === 175 /* MethodDeclaration */ || kind === 174 /* MethodSignature */ || kind === 268 /* ModuleDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 275 /* NamespaceImport */ || kind === 281 /* NamespaceExport */ || kind === 170 /* Parameter */ || kind === 304 /* PropertyAssignment */ || kind === 173 /* PropertyDeclaration */ || kind === 172 /* PropertySignature */ || kind === 179 /* SetAccessor */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 266 /* TypeAliasDeclaration */ || kind === 169 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 347 /* JSDocTypedefTag */ || kind === 339 /* JSDocCallbackTag */ || kind === 349 /* JSDocPropertyTag */ || kind === 203 /* NamedTupleMember */; -} -function isDeclarationStatementKind(kind) { - return kind === 263 /* FunctionDeclaration */ || kind === 283 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 278 /* ExportAssignment */ || kind === 271 /* NamespaceExportDeclaration */; -} -function isStatementKindButNotDeclarationKind(kind) { - return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 354 /* NotEmittedStatement */; -} -function isDeclaration(node) { - if (node.kind === 169 /* TypeParameter */) { - return node.parent && node.parent.kind !== 346 /* JSDocTemplateTag */ || isInJSFile(node); - } - return isDeclarationKind(node.kind); -} -function isDeclarationStatement(node) { - return isDeclarationStatementKind(node.kind); -} -function isStatementButNotDeclaration(node) { - return isStatementKindButNotDeclarationKind(node.kind); -} -function isStatement(node) { - const kind = node.kind; - return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node); -} -function isBlockStatement(node) { - if (node.kind !== 242 /* Block */) return false; - if (node.parent !== void 0) { - if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 300 /* CatchClause */) { - return false; - } - } - return !isFunctionBlock(node); -} -function isStatementOrBlock(node) { - const kind = node.kind; - return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */; -} -function isModuleReference(node) { - const kind = node.kind; - return kind === 284 /* ExternalModuleReference */ || kind === 167 /* QualifiedName */ || kind === 80 /* Identifier */; -} -function isJsxTagNameExpression(node) { - const kind = node.kind; - return kind === 110 /* ThisKeyword */ || kind === 80 /* Identifier */ || kind === 212 /* PropertyAccessExpression */ || kind === 296 /* JsxNamespacedName */; -} -function isJsxChild(node) { - const kind = node.kind; - return kind === 285 /* JsxElement */ || kind === 295 /* JsxExpression */ || kind === 286 /* JsxSelfClosingElement */ || kind === 12 /* JsxText */ || kind === 289 /* JsxFragment */; -} -function isJsxAttributeLike(node) { - const kind = node.kind; - return kind === 292 /* JsxAttribute */ || kind === 294 /* JsxSpreadAttribute */; -} -function isStringLiteralOrJsxExpression(node) { - const kind = node.kind; - return kind === 11 /* StringLiteral */ || kind === 295 /* JsxExpression */; -} -function isJsxOpeningLikeElement(node) { - const kind = node.kind; - return kind === 287 /* JsxOpeningElement */ || kind === 286 /* JsxSelfClosingElement */; -} -function isJsxCallLike(node) { - const kind = node.kind; - return kind === 287 /* JsxOpeningElement */ || kind === 286 /* JsxSelfClosingElement */ || kind === 290 /* JsxOpeningFragment */; -} -function isCaseOrDefaultClause(node) { - const kind = node.kind; - return kind === 297 /* CaseClause */ || kind === 298 /* DefaultClause */; -} -function isJSDocNode(node) { - return node.kind >= 310 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; -} -function isJSDocCommentContainingNode(node) { - return node.kind === 321 /* JSDoc */ || node.kind === 320 /* JSDocNamepathType */ || node.kind === 322 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); -} -function isJSDocTag(node) { - return node.kind >= 328 /* FirstJSDocTagNode */ && node.kind <= 352 /* LastJSDocTagNode */; -} -function isSetAccessor(node) { - return node.kind === 179 /* SetAccessor */; -} -function isGetAccessor(node) { - return node.kind === 178 /* GetAccessor */; -} -function hasJSDocNodes(node) { - if (!canHaveJSDoc(node)) return false; - const { jsDoc } = node; - return !!jsDoc && jsDoc.length > 0; -} -function hasType(node) { - return !!node.type; -} -function hasInitializer(node) { - return !!node.initializer; -} -function hasOnlyExpressionInitializer(node) { - switch (node.kind) { - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 209 /* BindingElement */: - case 173 /* PropertyDeclaration */: - case 304 /* PropertyAssignment */: - case 307 /* EnumMember */: - return true; - default: - return false; - } -} -function isObjectLiteralElement(node) { - return node.kind === 292 /* JsxAttribute */ || node.kind === 294 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); -} -function isTypeReferenceType(node) { - return node.kind === 184 /* TypeReference */ || node.kind === 234 /* ExpressionWithTypeArguments */; -} -var MAX_SMI_X86 = 1073741823; -function guessIndentation(lines) { - let indentation = MAX_SMI_X86; - for (const line of lines) { - if (!line.length) { - continue; - } - let i = 0; - for (; i < line.length && i < indentation; i++) { - if (!isWhiteSpaceLike(line.charCodeAt(i))) { - break; - } - } - if (i < indentation) { - indentation = i; - } - if (indentation === 0) { - return 0; - } - } - return indentation === MAX_SMI_X86 ? void 0 : indentation; -} -function isStringLiteralLike(node) { - return node.kind === 11 /* StringLiteral */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */; -} -function isJSDocLinkLike(node) { - return node.kind === 325 /* JSDocLink */ || node.kind === 326 /* JSDocLinkCode */ || node.kind === 327 /* JSDocLinkPlain */; -} -function hasRestParameter(s) { - const last2 = lastOrUndefined(s.parameters); - return !!last2 && isRestParameter(last2); -} -function isRestParameter(node) { - const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type; - return node.dotDotDotToken !== void 0 || !!type && type.kind === 319 /* 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 === 170 /* 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); - }); -} - -// src/compiler/utilities.ts -var resolvingEmptyArray = []; -var externalHelpersModuleNameText = "tslib"; -var defaultMaximumTruncationLength = 160; -var noTruncationMaximumTruncationLength = 1e6; -var defaultHoverMaximumTruncationLength = 500; -function getDeclarationOfKind(symbol, kind) { - const declarations = symbol.declarations; - if (declarations) { - for (const declaration of declarations) { - if (declaration.kind === kind) { - return declaration; - } - } - } - return void 0; -} -function getDeclarationsOfKind(symbol, kind) { - return filter(symbol.declarations || emptyArray, (d) => d.kind === kind); -} -function createSymbolTable(symbols) { - const result = /* @__PURE__ */ new Map(); - if (symbols) { - for (const symbol of symbols) { - result.set(symbol.escapedName, symbol); - } - } - return result; -} -function isTransientSymbol(symbol) { - return (symbol.flags & 33554432 /* Transient */) !== 0; -} -function isExternalModuleSymbol(moduleSymbol) { - return !!(moduleSymbol.flags & 1536 /* Module */) && moduleSymbol.escapedName.charCodeAt(0) === 34 /* doubleQuote */; -} -var stringWriter = createSingleLineStringWriter(); -function createSingleLineStringWriter() { - var str = ""; - const writeText = (text) => str += text; - return { - getText: () => str, - write: writeText, - rawWrite: writeText, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeLiteral: writeText, - writeParameter: writeText, - writeProperty: writeText, - writeSymbol: (s, _) => writeText(s), - writeTrailingSemicolon: writeText, - writeComment: writeText, - getTextPos: () => str.length, - getLine: () => 0, - getColumn: () => 0, - getIndent: () => 0, - isAtStartOfLine: () => false, - hasTrailingComment: () => false, - hasTrailingWhitespace: () => !!str.length && isWhiteSpaceLike(str.charCodeAt(str.length - 1)), - // Completely ignore indentation for string writers. And map newlines to - // a single space. - writeLine: () => str += " ", - increaseIndent: noop, - decreaseIndent: noop, - clear: () => str = "" - }; -} -function changesAffectModuleResolution(oldOptions, newOptions) { - return oldOptions.configFilePath !== newOptions.configFilePath || optionsHaveModuleResolutionChanges(oldOptions, newOptions); -} -function optionsHaveModuleResolutionChanges(oldOptions, newOptions) { - return optionsHaveChanges(oldOptions, newOptions, moduleResolutionOptionDeclarations); -} -function changesAffectingProgramStructure(oldOptions, newOptions) { - return optionsHaveChanges(oldOptions, newOptions, optionsAffectingProgramStructure); -} -function optionsHaveChanges(oldOptions, newOptions, optionDeclarations2) { - return oldOptions !== newOptions && optionDeclarations2.some((o) => !isJsonEqual(getCompilerOptionValue(oldOptions, o), getCompilerOptionValue(newOptions, o))); -} -function forEachAncestor(node, callback) { - while (true) { - const res = callback(node); - if (res === "quit") return void 0; - if (res !== void 0) return res; - if (isSourceFile(node)) return void 0; - node = node.parent; - } -} -function forEachEntry(map2, callback) { - const iterator = map2.entries(); - for (const [key, value] of iterator) { - const result = callback(value, key); - if (result) { - return result; - } - } - return void 0; -} -function forEachKey(map2, callback) { - const iterator = map2.keys(); - for (const key of iterator) { - const result = callback(key); - if (result) { - return result; - } - } - return void 0; -} -function copyEntries(source, target) { - source.forEach((value, key) => { - target.set(key, value); - }); -} -function usingSingleLineStringWriter(action) { - const oldString = stringWriter.getText(); - try { - action(stringWriter); - return stringWriter.getText(); - } finally { - stringWriter.clear(); - stringWriter.writeKeyword(oldString); - } -} -function getFullWidth(node) { - return node.end - node.pos; -} -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.alternateResult === newResolution.alternateResult; -} -function getResolvedModuleFromResolution(resolution) { - return resolution.resolvedModule; -} -function getResolvedTypeReferenceDirectiveFromResolution(resolution) { - return resolution.resolvedTypeReferenceDirective; -} -function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) { - 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, - alternateResultMessage[0], - ...alternateResultMessage[1] - ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, - packageName, - mangleScopedPackageName(packageName) - ) : host.packageBundlesTypes(packageName) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, - packageName, - moduleReference - ) : chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, - moduleReference, - mangleScopedPackageName(packageName) - ); - if (result) result.repopulateInfo = () => ({ moduleReference, mode, packageName: packageName === moduleReference ? void 0 : packageName }); - return result; -} -function createModeMismatchDetails(currentSourceFile) { - const ext = tryGetExtensionFromPath2(currentSourceFile.fileName); - const scope = currentSourceFile.packageJsonScope; - const targetExt = ext === ".ts" /* Ts */ ? ".mts" /* Mts */ : ext === ".js" /* Js */ ? ".mjs" /* Mjs */ : void 0; - const result = scope && !scope.contents.packageJsonContent.type ? targetExt ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1, - targetExt, - combinePaths(scope.packageDirectory, "package.json") - ) : chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0, - combinePaths(scope.packageDirectory, "package.json") - ) : targetExt ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module, - targetExt - ) : chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module - ); - result.repopulateInfo = () => true; - return result; -} -function packageIdIsEqual(a, b) { - return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version && a.peerDependencies === b.peerDependencies; -} -function packageIdToPackageName({ name, subModuleName }) { - return subModuleName ? `${name}/${subModuleName}` : name; -} -function packageIdToString(packageId) { - return `${packageIdToPackageName(packageId)}@${packageId.version}${packageId.peerDependencies ?? ""}`; -} -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, 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 oldResolution = getOldResolution(entry); - const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; - if (changed) { - return true; - } - } - return false; -} -function containsParseError(node) { - aggregateChildData(node); - return (node.flags & 1048576 /* ThisNodeOrAnySubNodesHasError */) !== 0; -} -function aggregateChildData(node) { - if (!(node.flags & 2097152 /* HasAggregatedChildData */)) { - const thisNodeOrAnySubNodesHasError = (node.flags & 262144 /* ThisNodeHasError */) !== 0 || forEachChild(node, containsParseError); - if (thisNodeOrAnySubNodesHasError) { - node.flags |= 1048576 /* ThisNodeOrAnySubNodesHasError */; - } - node.flags |= 2097152 /* HasAggregatedChildData */; - } -} -function getSourceFileOfNode(node) { - while (node && node.kind !== 308 /* SourceFile */) { - node = node.parent; - } - return node; -} -function getSourceFileOfModule(module2) { - return getSourceFileOfNode(module2.valueDeclaration || getNonAugmentationDeclaration(module2)); -} -function isPlainJsFile(file, checkJs) { - return !!file && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */) && !file.checkJsDirective && checkJs === void 0; -} -function isStatementWithLocals(node) { - switch (node.kind) { - case 242 /* Block */: - case 270 /* CaseBlock */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - return true; - } - return false; -} -function getStartPositionOfLine(line, sourceFile) { - Debug.assert(line >= 0); - return getLineStarts(sourceFile)[line]; -} -function nodePosToString(node) { - const file = getSourceFileOfNode(node); - const loc = getLineAndCharacterOfPosition(file, node.pos); - return `${file.fileName}(${loc.line + 1},${loc.character + 1})`; -} -function getEndLinePosition(line, sourceFile) { - Debug.assert(line >= 0); - const lineStarts = getLineStarts(sourceFile); - const lineIndex = line; - const sourceText = sourceFile.text; - if (lineIndex + 1 === lineStarts.length) { - return sourceText.length - 1; - } else { - const start = lineStarts[lineIndex]; - let pos = lineStarts[lineIndex + 1] - 1; - Debug.assert(isLineBreak(sourceText.charCodeAt(pos))); - while (start <= pos && isLineBreak(sourceText.charCodeAt(pos))) { - pos--; - } - return pos; - } -} -function isFileLevelUniqueName(sourceFile, name, hasGlobalName) { - return !(hasGlobalName && hasGlobalName(name)) && !sourceFile.identifiers.has(name); -} -function nodeIsMissing(node) { - if (node === void 0) { - return true; - } - return node.pos === node.end && node.pos >= 0 && node.kind !== 1 /* EndOfFileToken */; -} -function nodeIsPresent(node) { - return !nodeIsMissing(node); -} -function isGrammarError(parent2, child) { - if (isTypeParameterDeclaration(parent2)) return child === parent2.expression; - if (isClassStaticBlockDeclaration(parent2)) return child === parent2.modifiers; - if (isPropertySignature(parent2)) return child === parent2.initializer; - if (isPropertyDeclaration(parent2)) return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2); - if (isPropertyAssignment(parent2)) return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); - if (isShorthandPropertyAssignment(parent2)) return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); - if (isMethodDeclaration(parent2)) return child === parent2.exclamationToken; - if (isConstructorDeclaration(parent2)) return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); - if (isGetAccessorDeclaration(parent2)) return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); - if (isSetAccessorDeclaration(parent2)) return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration); - if (isNamespaceExportDeclaration(parent2)) return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike); - return false; -} -function isGrammarErrorElement(nodeArray, child, isElement) { - if (!nodeArray || isArray(child) || !isElement(child)) return false; - return contains(nodeArray, child); -} -function insertStatementsAfterPrologue(to, from, isPrologueDirective2) { - if (from === void 0 || from.length === 0) return to; - let statementIndex = 0; - for (; statementIndex < to.length; ++statementIndex) { - if (!isPrologueDirective2(to[statementIndex])) { - break; - } - } - to.splice(statementIndex, 0, ...from); - return to; -} -function insertStatementAfterPrologue(to, statement, isPrologueDirective2) { - if (statement === void 0) return to; - let statementIndex = 0; - for (; statementIndex < to.length; ++statementIndex) { - if (!isPrologueDirective2(to[statementIndex])) { - break; - } - } - to.splice(statementIndex, 0, statement); - return to; -} -function isAnyPrologueDirective(node) { - return isPrologueDirective(node) || !!(getEmitFlags(node) & 2097152 /* CustomPrologue */); -} -function insertStatementsAfterStandardPrologue(to, from) { - return insertStatementsAfterPrologue(to, from, isPrologueDirective); -} -function insertStatementsAfterCustomPrologue(to, from) { - return insertStatementsAfterPrologue(to, from, isAnyPrologueDirective); -} -function insertStatementAfterStandardPrologue(to, statement) { - return insertStatementAfterPrologue(to, statement, isPrologueDirective); -} -function insertStatementAfterCustomPrologue(to, statement) { - return insertStatementAfterPrologue(to, statement, isAnyPrologueDirective); -} -function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { - if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) { - const textSubStr = text.substring(commentPos, commentEnd); - return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDModuleRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || fullTripleSlashLibReferenceRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false; - } - return false; -} -function isPinnedComment(text, start) { - return text.charCodeAt(start + 1) === 42 /* asterisk */ && text.charCodeAt(start + 2) === 33 /* exclamation */; -} -function createCommentDirectivesMap(sourceFile, commentDirectives) { - const directivesByLine = new Map( - commentDirectives.map((commentDirective) => [ - `${getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line}`, - commentDirective - ]) - ); - const usedLines = /* @__PURE__ */ new Map(); - return { getUnusedExpectations, markUsed }; - function getUnusedExpectations() { - return arrayFrom(directivesByLine.entries()).filter(([line, directive]) => directive.type === 0 /* ExpectError */ && !usedLines.get(line)).map(([_, directive]) => directive); - } - function markUsed(line) { - if (!directivesByLine.has(`${line}`)) { - return false; - } - usedLines.set(`${line}`, true); - return true; - } -} -function getTokenPosOfNode(node, sourceFile, includeJsDoc) { - if (nodeIsMissing(node)) { - return node.pos; - } - if (isJSDocNode(node) || node.kind === 12 /* JsxText */) { - return skipTrivia( - (sourceFile ?? getSourceFileOfNode(node)).text, - node.pos, - /*stopAfterLineBreak*/ - false, - /*stopAtComments*/ - true - ); - } - if (includeJsDoc && hasJSDocNodes(node)) { - return getTokenPosOfNode(node.jsDoc[0], sourceFile); - } - if (node.kind === 353 /* SyntaxList */) { - sourceFile ?? (sourceFile = getSourceFileOfNode(node)); - const first2 = firstOrUndefined(getNodeChildren(node, sourceFile)); - if (first2) { - return getTokenPosOfNode(first2, sourceFile, includeJsDoc); - } - } - return skipTrivia( - (sourceFile ?? getSourceFileOfNode(node)).text, - node.pos, - /*stopAfterLineBreak*/ - false, - /*stopAtComments*/ - false, - isInJSDoc(node) - ); -} -function getNonDecoratorTokenPosOfNode(node, sourceFile) { - const lastDecorator = !nodeIsMissing(node) && canHaveModifiers(node) ? findLast(node.modifiers, isDecorator) : void 0; - if (!lastDecorator) { - return getTokenPosOfNode(node, sourceFile); - } - return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastDecorator.end); -} -function getNonModifierTokenPosOfNode(node, sourceFile) { - const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0; - if (!lastModifier) { - return getTokenPosOfNode(node, sourceFile); - } - return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end); -} -function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) { - return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia); -} -function isJSDocTypeExpressionOrChild(node) { - return !!findAncestor(node, isJSDocTypeExpression); -} -function isExportNamespaceAsDefaultDeclaration(node) { - return !!(isExportDeclaration(node) && node.exportClause && isNamespaceExport(node.exportClause) && moduleExportNameIsDefault(node.exportClause.name)); -} -function moduleExportNameTextUnescaped(node) { - return node.kind === 11 /* StringLiteral */ ? node.text : unescapeLeadingUnderscores(node.escapedText); -} -function moduleExportNameTextEscaped(node) { - return node.kind === 11 /* StringLiteral */ ? escapeLeadingUnderscores(node.text) : node.escapedText; -} -function moduleExportNameIsDefault(node) { - return (node.kind === 11 /* StringLiteral */ ? node.text : node.escapedText) === "default" /* Default */; -} -function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) { - if (nodeIsMissing(node)) { - return ""; - } - 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) => line.replace(/^\s*\*/, "").trimStart()).join("\n"); - } - return text; -} -function getTextOfNode(node, includeTrivia = false) { - return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); -} -function getPos(range) { - return range.pos; -} -function indexOfNode(nodeArray, node) { - return binarySearch(nodeArray, node, getPos, compareValues); -} -function getEmitFlags(node) { - const emitNode = node.emitNode; - return emitNode && emitNode.flags || 0; -} -function getInternalEmitFlags(node) { - const emitNode = node.emitNode; - return emitNode && emitNode.internalFlags || 0; -} -var 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", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Iterator: new Map(Object.entries({ - es2015: emptyArray - })), - AsyncIterator: new Map(Object.entries({ - es2015: emptyArray - })), - ArrayBuffer: new Map(Object.entries({ - es2024: [ - "maxByteLength", - "resizable", - "resize", - "detached", - "transfer", - "transferToFixedLength" - ] - })), - Atomics: new Map(Object.entries({ - es2017: [ - "add", - "and", - "compareExchange", - "exchange", - "isLockFree", - "load", - "or", - "store", - "sub", - "wait", - "notify", - "xor" - ], - es2024: [ - "waitAsync" - ], - esnext: [ - "pause" - ] - })), - SharedArrayBuffer: new Map(Object.entries({ - es2017: [ - "byteLength", - "slice" - ], - es2024: [ - "growable", - "maxByteLength", - "grow" - ] - })), - 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" - ], - es2024: [ - "unicodeSets" - ] - })), - 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" - ], - esnext: [ - "fromAsync" - ] - })), - ObjectConstructor: new Map(Object.entries({ - es2015: [ - "assign", - "getOwnPropertySymbols", - "keys", - "is", - "setPrototypeOf" - ], - es2017: [ - "values", - "entries", - "getOwnPropertyDescriptors" - ], - es2019: [ - "fromEntries" - ], - es2022: [ - "hasOwn" - ], - es2024: [ - "groupBy" - ] - })), - 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" - ], - esnext: [ - "f16round" - ] - })), - Map: new Map(Object.entries({ - es2015: [ - "entries", - "keys", - "values" - ] - })), - MapConstructor: new Map(Object.entries({ - es2024: [ - "groupBy" - ] - })), - Set: new Map(Object.entries({ - es2015: [ - "entries", - "keys", - "values" - ], - esnext: [ - "union", - "intersection", - "difference", - "symmetricDifference", - "isSubsetOf", - "isSupersetOf", - "isDisjointFrom" - ] - })), - PromiseConstructor: new Map(Object.entries({ - es2015: [ - "all", - "race", - "reject", - "resolve" - ], - es2020: [ - "allSettled" - ], - es2021: [ - "any" - ], - es2024: [ - "withResolvers" - ] - })), - 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" - ], - es2024: [ - "isWellFormed", - "toWellFormed" - ] - })), - 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" - ], - esnext: [ - "metadata", - "dispose", - "asyncDispose" - ] - })), - DataView: new Map(Object.entries({ - es2020: [ - "setBigInt64", - "setBigUint64", - "getBigInt64", - "getBigUint64" - ], - esnext: [ - "setFloat16", - "getFloat16" - ] - })), - 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", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Uint8Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Uint8ClampedArray: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Int16Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Uint16Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Int32Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Uint32Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Float16Array: new Map(Object.entries({ - esnext: emptyArray - })), - Float32Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Float64Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - BigInt64Array: new Map(Object.entries({ - es2020: emptyArray, - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - BigUint64Array: new Map(Object.entries({ - es2020: emptyArray, - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast", - "toReversed", - "toSorted", - "toSpliced", - "with" - ] - })), - Error: new Map(Object.entries({ - es2022: [ - "cause" - ] - })) - })) -); -var GetLiteralTextFlags = /* @__PURE__ */ ((GetLiteralTextFlags2) => { - GetLiteralTextFlags2[GetLiteralTextFlags2["None"] = 0] = "None"; - GetLiteralTextFlags2[GetLiteralTextFlags2["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; - GetLiteralTextFlags2[GetLiteralTextFlags2["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; - GetLiteralTextFlags2[GetLiteralTextFlags2["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; - GetLiteralTextFlags2[GetLiteralTextFlags2["AllowNumericSeparator"] = 8] = "AllowNumericSeparator"; - return GetLiteralTextFlags2; -})(GetLiteralTextFlags || {}); -function getLiteralText(node, sourceFile, flags) { - if (sourceFile && canUseOriginalText(node, flags)) { - return getSourceTextOfNodeFromSourceFile(sourceFile, node); - } - switch (node.kind) { - case 11 /* StringLiteral */: { - const escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; - if (node.singleQuote) { - return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; - } else { - return '"' + escapeText(node.text, 34 /* doubleQuote */) + '"'; - } - } - case 15 /* NoSubstitutionTemplateLiteral */: - case 16 /* TemplateHead */: - case 17 /* TemplateMiddle */: - case 18 /* TemplateTail */: { - const escapeText = flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; - const rawText = node.rawText ?? escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); - switch (node.kind) { - case 15 /* NoSubstitutionTemplateLiteral */: - return "`" + rawText + "`"; - case 16 /* TemplateHead */: - return "`" + rawText + "${"; - case 17 /* TemplateMiddle */: - return "}" + rawText + "${"; - case 18 /* TemplateTail */: - return "}" + rawText + "`"; - } - break; - } - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - return node.text; - case 14 /* RegularExpressionLiteral */: - if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); - } - return node.text; - } - return Debug.fail(`Literal kind '${node.kind}' not accounted for.`); -} -function canUseOriginalText(node, flags) { - if (nodeIsSynthesized(node) || !node.parent || flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return false; - } - if (isNumericLiteral(node)) { - if (node.numericLiteralFlags & 26656 /* IsInvalid */) { - return false; - } - if (node.numericLiteralFlags & 512 /* ContainsSeparator */) { - return !!(flags & 8 /* AllowNumericSeparator */); - } - } - return !isBigIntLiteral(node); -} -function getTextOfConstantValue(value) { - return isString(value) ? `"${escapeString(value)}"` : "" + value; -} -function makeIdentifierFromModuleName(moduleName) { - return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); -} -function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 7 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); -} -function isCatchClauseVariableDeclarationOrBindingElement(declaration) { - const node = getRootDeclaration(declaration); - return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 300 /* CatchClause */; -} -function isAmbientModule(node) { - return isModuleDeclaration(node) && (node.name.kind === 11 /* StringLiteral */ || isGlobalScopeAugmentation(node)); -} -function isModuleWithStringLiteralName(node) { - return isModuleDeclaration(node) && node.name.kind === 11 /* StringLiteral */; -} -function isNonGlobalAmbientModule(node) { - return isModuleDeclaration(node) && isStringLiteral(node.name); -} -function isEffectiveModuleDeclaration(node) { - return isModuleDeclaration(node) || isIdentifier(node); -} -function isShorthandAmbientModuleSymbol(moduleSymbol) { - return isShorthandAmbientModule(moduleSymbol.valueDeclaration); -} -function isShorthandAmbientModule(node) { - return !!node && node.kind === 268 /* ModuleDeclaration */ && !node.body; -} -function isBlockScopedContainerTopLevel(node) { - return node.kind === 308 /* SourceFile */ || node.kind === 268 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node); -} -function isGlobalScopeAugmentation(module2) { - return !!(module2.flags & 2048 /* GlobalAugmentation */); -} -function isExternalModuleAugmentation(node) { - return isAmbientModule(node) && isModuleAugmentationExternal(node); -} -function isModuleAugmentationExternal(node) { - switch (node.parent.kind) { - case 308 /* SourceFile */: - return isExternalModule(node.parent); - case 269 /* ModuleBlock */: - return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent); - } - return false; -} -function getNonAugmentationDeclaration(symbol) { - var _a; - return (_a = symbol.declarations) == null ? void 0 : _a.find((d) => !isExternalModuleAugmentation(d) && !(isModuleDeclaration(d) && isGlobalScopeAugmentation(d))); -} -function isCommonJSContainingModuleKind(kind) { - return kind === 1 /* CommonJS */ || 100 /* Node16 */ <= kind && kind <= 199 /* NodeNext */; -} -function isEffectiveExternalModule(node, compilerOptions) { - return isExternalModule(node) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; -} -function isEffectiveStrictModeSourceFile(node, compilerOptions) { - switch (node.scriptKind) { - case 1 /* JS */: - case 3 /* TS */: - case 2 /* JSX */: - case 4 /* TSX */: - break; - default: - return false; - } - if (node.isDeclarationFile) { - return false; - } - if (getStrictOptionValue(compilerOptions, "alwaysStrict")) { - return true; - } - if (startsWithUseStrict(node.statements)) { - return true; - } - if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { - return true; - } - return false; -} -function isAmbientPropertyDeclaration(node) { - return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node, 128 /* Ambient */); -} -function isBlockScope(node, parentNode) { - switch (node.kind) { - case 308 /* SourceFile */: - case 270 /* CaseBlock */: - case 300 /* CatchClause */: - case 268 /* ModuleDeclaration */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 173 /* PropertyDeclaration */: - case 176 /* ClassStaticBlockDeclaration */: - return true; - case 242 /* Block */: - return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode); - } - return false; -} -function isDeclarationWithTypeParameters(node) { - Debug.type(node); - switch (node.kind) { - case 339 /* JSDocCallbackTag */: - case 347 /* JSDocTypedefTag */: - case 324 /* JSDocSignature */: - return true; - default: - assertType(node); - return isDeclarationWithTypeParameterChildren(node); - } -} -function isDeclarationWithTypeParameterChildren(node) { - Debug.type(node); - switch (node.kind) { - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 174 /* MethodSignature */: - case 182 /* IndexSignature */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 318 /* JSDocFunctionType */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 346 /* JSDocTemplateTag */: - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return true; - default: - assertType(node); - return false; - } -} -function isAnyImportSyntax(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - return true; - default: - return false; - } -} -function isAnyImportOrBareOrAccessedRequire(node) { - return isAnyImportSyntax(node) || isVariableDeclarationInitializedToBareOrAccessedRequire(node); -} -function isAnyImportOrRequireStatement(node) { - return isAnyImportSyntax(node) || isRequireVariableStatement(node); -} -function isLateVisibilityPaintedStatement(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 244 /* VariableStatement */: - case 264 /* ClassDeclaration */: - case 263 /* FunctionDeclaration */: - case 268 /* ModuleDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - return true; - default: - return false; - } -} -function hasPossibleExternalModuleReference(node) { - return isAnyImportOrReExport(node) || isModuleDeclaration(node) || isImportTypeNode(node) || isImportCall(node); -} -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)); -} -function forEachEnclosingBlockScopeContainer(node, cb) { - let container = getEnclosingBlockScopeContainer(node); - while (container) { - cb(container); - container = getEnclosingBlockScopeContainer(container); - } -} -function declarationNameToString(name) { - return !name || getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); -} -function getNameFromIndexInfo(info) { - return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0; -} -function isComputedNonLiteralName(name) { - return name.kind === 168 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); -} -function tryGetTextOfPropertyName(name) { - var _a; - switch (name.kind) { - case 80 /* Identifier */: - case 81 /* PrivateIdentifier */: - return ((_a = name.emitNode) == null ? void 0 : _a.autoGenerate) ? void 0 : name.escapedText; - case 11 /* StringLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - return escapeLeadingUnderscores(name.text); - case 168 /* ComputedPropertyName */: - if (isStringOrNumericLiteralLike(name.expression)) return escapeLeadingUnderscores(name.expression.text); - return void 0; - case 296 /* JsxNamespacedName */: - return getEscapedTextOfJsxNamespacedName(name); - default: - return Debug.assertNever(name); - } -} -function getTextOfPropertyName(name) { - return Debug.checkDefined(tryGetTextOfPropertyName(name)); -} -function entityNameToString(name) { - switch (name.kind) { - case 110 /* ThisKeyword */: - return "this"; - case 81 /* PrivateIdentifier */: - case 80 /* Identifier */: - return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name); - case 167 /* QualifiedName */: - return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 212 /* PropertyAccessExpression */: - if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) { - return entityNameToString(name.expression) + "." + entityNameToString(name.name); - } else { - return Debug.assertNever(name.name); - } - case 312 /* JSDocMemberName */: - return entityNameToString(name.left) + "#" + entityNameToString(name.right); - case 296 /* JsxNamespacedName */: - return entityNameToString(name.namespace) + ":" + entityNameToString(name.name); - default: - return Debug.assertNever(name); - } -} -function createDiagnosticForNode(node, message, ...args) { - const sourceFile = getSourceFileOfNode(node); - return createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args); -} -function createDiagnosticForNodeArray(sourceFile, nodes, message, ...args) { - const start = skipTrivia(sourceFile.text, nodes.pos); - return createFileDiagnostic(sourceFile, start, nodes.end - start, message, ...args); -} -function createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args) { - const span = getErrorSpanForNode(sourceFile, node); - return createFileDiagnostic(sourceFile, span.start, span.length, message, ...args); -} -function createDiagnosticForNodeFromMessageChain(sourceFile, node, messageChain, relatedInformation) { - const span = getErrorSpanForNode(sourceFile, node); - return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation); -} -function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, messageChain, relatedInformation) { - const start = skipTrivia(sourceFile.text, nodes.pos); - return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation); -} -function assertDiagnosticLocation(sourceText, start, length2) { - Debug.assertGreaterThanOrEqual(start, 0); - Debug.assertGreaterThanOrEqual(length2, 0); - Debug.assertLessThanOrEqual(start, sourceText.length); - Debug.assertLessThanOrEqual(start + length2, sourceText.length); -} -function createFileDiagnosticFromMessageChain(file, start, length2, messageChain, relatedInformation) { - assertDiagnosticLocation(file.text, start, length2); - return { - file, - start, - length: length2, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation, - canonicalHead: messageChain.canonicalHead - }; -} -function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { - return { - file: sourceFile, - start: 0, - length: 0, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation - }; -} -function createDiagnosticMessageChainFromDiagnostic(diagnostic) { - return typeof diagnostic.messageText === "string" ? { - code: diagnostic.code, - category: diagnostic.category, - messageText: diagnostic.messageText, - next: diagnostic.next - } : diagnostic.messageText; -} -function createDiagnosticForRange(sourceFile, range, message) { - return { - file: sourceFile, - start: range.pos, - length: range.end - range.pos, - code: message.code, - category: message.category, - messageText: message.message - }; -} -function getCanonicalDiagnostic(message, ...args) { - return { - code: message.code, - messageText: formatMessage(message, ...args) - }; -} -function getSpanOfTokenAtPosition(sourceFile, pos) { - const scanner2 = createScanner( - sourceFile.languageVersion, - /*skipTrivia*/ - true, - sourceFile.languageVariant, - sourceFile.text, - /*onError*/ - void 0, - pos - ); - scanner2.scan(); - const start = scanner2.getTokenStart(); - return createTextSpanFromBounds(start, scanner2.getTokenEnd()); -} -function scanTokenAtPosition(sourceFile, pos) { - const scanner2 = createScanner( - sourceFile.languageVersion, - /*skipTrivia*/ - true, - sourceFile.languageVariant, - sourceFile.text, - /*onError*/ - void 0, - pos - ); - scanner2.scan(); - return scanner2.getToken(); -} -function getErrorSpanForArrowFunction(sourceFile, node) { - const pos = skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 242 /* Block */) { - const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos); - const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end); - if (startLine < endLine) { - return createTextSpan(pos, getEndLinePosition(startLine, sourceFile) - pos + 1); - } - } - return createTextSpanFromBounds(pos, node.end); -} -function getErrorSpanForNode(sourceFile, node) { - let errorNode = node; - switch (node.kind) { - case 308 /* SourceFile */: { - const pos2 = skipTrivia( - sourceFile.text, - 0, - /*stopAfterLineBreak*/ - false - ); - if (pos2 === sourceFile.text.length) { - return createTextSpan(0, 0); - } - return getSpanOfTokenAtPosition(sourceFile, pos2); - } - // This list is a work in progress. Add missing node kinds to improve their error - // spans. - case 261 /* VariableDeclaration */: - case 209 /* BindingElement */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 268 /* ModuleDeclaration */: - case 267 /* EnumDeclaration */: - case 307 /* EnumMember */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 266 /* TypeAliasDeclaration */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 275 /* NamespaceImport */: - errorNode = node.name; - break; - case 220 /* ArrowFunction */: - return getErrorSpanForArrowFunction(sourceFile, node); - case 297 /* CaseClause */: - case 298 /* 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 254 /* ReturnStatement */: - case 230 /* YieldExpression */: { - const pos2 = skipTrivia(sourceFile.text, node.pos); - return getSpanOfTokenAtPosition(sourceFile, pos2); - } - case 239 /* SatisfiesExpression */: { - const pos2 = skipTrivia(sourceFile.text, node.expression.end); - return getSpanOfTokenAtPosition(sourceFile, pos2); - } - case 351 /* JSDocSatisfiesTag */: { - const pos2 = skipTrivia(sourceFile.text, node.tagName.pos); - return getSpanOfTokenAtPosition(sourceFile, pos2); - } - case 177 /* Constructor */: { - const constructorDeclaration = node; - const start = skipTrivia(sourceFile.text, constructorDeclaration.pos); - const scanner2 = createScanner( - sourceFile.languageVersion, - /*skipTrivia*/ - true, - sourceFile.languageVariant, - sourceFile.text, - /*onError*/ - void 0, - start - ); - let token = scanner2.scan(); - while (token !== 137 /* ConstructorKeyword */ && token !== 1 /* EndOfFileToken */) { - token = scanner2.scan(); - } - const end = scanner2.getTokenEnd(); - return createTextSpanFromBounds(start, end); - } - } - if (errorNode === void 0) { - return getSpanOfTokenAtPosition(sourceFile, node.pos); - } - Debug.assert(!isJSDoc(errorNode)); - const isMissing = nodeIsMissing(errorNode); - const pos = isMissing || isJsxText(node) ? errorNode.pos : skipTrivia(sourceFile.text, errorNode.pos); - if (isMissing) { - Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); - Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); - } else { - Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); - Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); - } - return createTextSpanFromBounds(pos, errorNode.end); -} -function isGlobalSourceFile(node) { - return node.kind === 308 /* SourceFile */ && !isExternalOrCommonJsModule(node); -} -function isExternalOrCommonJsModule(file) { - return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== void 0; -} -function isJsonSourceFile(file) { - return file.scriptKind === 6 /* JSON */; -} -function isEnumConst(node) { - return !!(getCombinedModifierFlags(node) & 4096 /* Const */); -} -function isDeclarationReadonly(declaration) { - 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) & 7 /* BlockScoped */) === 2 /* Const */; -} -function isVarConstLike(node) { - const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */; - return blockScopeKind === 2 /* Const */ || blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */; -} -function isLet(node) { - return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 1 /* Let */; -} -function isSuperCall(n) { - return n.kind === 214 /* CallExpression */ && n.expression.kind === 108 /* SuperKeyword */; -} -function isImportCall(n) { - if (n.kind !== 214 /* CallExpression */) return false; - const e = n.expression; - return e.kind === 102 /* ImportKeyword */ || isMetaProperty(e) && e.keywordToken === 102 /* ImportKeyword */ && e.name.escapedText === "defer"; -} -function isImportMeta(n) { - return isMetaProperty(n) && n.keywordToken === 102 /* ImportKeyword */ && n.name.escapedText === "meta"; -} -function isLiteralImportTypeNode(n) { - return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal); -} -function isPrologueDirective(node) { - return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 11 /* StringLiteral */; -} -function isCustomPrologue(node) { - return !!(getEmitFlags(node) & 2097152 /* CustomPrologue */); -} -function isHoistedFunction(node) { - return isCustomPrologue(node) && isFunctionDeclaration(node); -} -function isHoistedVariable(node) { - return isIdentifier(node.name) && !node.initializer; -} -function isHoistedVariableStatement(node) { - return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable); -} -function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return node.kind !== 12 /* JsxText */ ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; -} -function getJSDocCommentRanges(node, text) { - const commentRanges = node.kind === 170 /* Parameter */ || node.kind === 169 /* TypeParameter */ || node.kind === 219 /* FunctionExpression */ || node.kind === 220 /* ArrowFunction */ || node.kind === 218 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 282 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); - return filter(commentRanges, (comment) => comment.end <= node.end && // Due to parse errors sometime empty parameter may get comments assigned to it that end up not in parameter range - text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */); -} -var fullTripleSlashReferencePathRegEx = /^\/\/\/\s*/; -var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^\/\/\/\s*/; -var fullTripleSlashLibReferenceRegEx = /^\/\/\/\s*/; -var fullTripleSlashAMDReferencePathRegEx = /^\/\/\/\s*/; -var fullTripleSlashAMDModuleRegEx = /^\/\/\/\s*/; -var defaultLibReferenceRegEx = /^\/\/\/\s*/; -function isPartOfTypeNode(node) { - if (183 /* FirstTypeNode */ <= node.kind && node.kind <= 206 /* LastTypeNode */) { - return true; - } - switch (node.kind) { - case 133 /* AnyKeyword */: - case 159 /* UnknownKeyword */: - case 150 /* NumberKeyword */: - case 163 /* BigIntKeyword */: - case 154 /* StringKeyword */: - case 136 /* BooleanKeyword */: - case 155 /* SymbolKeyword */: - case 151 /* ObjectKeyword */: - case 157 /* UndefinedKeyword */: - case 106 /* NullKeyword */: - case 146 /* NeverKeyword */: - return true; - case 116 /* VoidKeyword */: - return node.parent.kind !== 223 /* VoidExpression */; - case 234 /* ExpressionWithTypeArguments */: - return isPartOfTypeExpressionWithTypeArguments(node); - case 169 /* TypeParameter */: - return node.parent.kind === 201 /* MappedType */ || node.parent.kind === 196 /* InferType */; - // Identifiers and qualified names may be type nodes, depending on their context. Climb - // above them to find the lowest container - case 80 /* Identifier */: - if (node.parent.kind === 167 /* QualifiedName */ && node.parent.right === node) { - node = node.parent; - } else if (node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.name === node) { - node = node.parent; - } - Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 167 /* QualifiedName */ || node.kind === 212 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - // falls through - case 167 /* QualifiedName */: - case 212 /* PropertyAccessExpression */: - case 110 /* ThisKeyword */: { - const { parent: parent2 } = node; - if (parent2.kind === 187 /* TypeQuery */) { - return false; - } - if (parent2.kind === 206 /* ImportType */) { - return !parent2.isTypeOf; - } - if (183 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 206 /* LastTypeNode */) { - return true; - } - switch (parent2.kind) { - case 234 /* ExpressionWithTypeArguments */: - return isPartOfTypeExpressionWithTypeArguments(parent2); - case 169 /* TypeParameter */: - return node === parent2.constraint; - case 346 /* JSDocTemplateTag */: - return node === parent2.constraint; - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 170 /* Parameter */: - case 261 /* VariableDeclaration */: - return node === parent2.type; - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return node === parent2.type; - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 182 /* IndexSignature */: - return node === parent2.type; - case 217 /* TypeAssertionExpression */: - return node === parent2.type; - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 216 /* TaggedTemplateExpression */: - return contains(parent2.typeArguments, node); - } - } - } - return false; -} -function isPartOfTypeExpressionWithTypeArguments(node) { - return isJSDocImplementsTag(node.parent) || isJSDocAugmentsTag(node.parent) || isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node); -} -function forEachReturnStatement(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 254 /* ReturnStatement */: - return visitor(node); - case 270 /* CaseBlock */: - case 242 /* Block */: - case 246 /* IfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 255 /* WithStatement */: - case 256 /* SwitchStatement */: - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - case 257 /* LabeledStatement */: - case 259 /* TryStatement */: - case 300 /* CatchClause */: - return forEachChild(node, traverse); - } - } -} -function forEachYieldExpression(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 230 /* YieldExpression */: - visitor(node); - const operand = node.expression; - if (operand) { - traverse(operand); - } - return; - case 267 /* EnumDeclaration */: - case 265 /* InterfaceDeclaration */: - case 268 /* ModuleDeclaration */: - case 266 /* TypeAliasDeclaration */: - return; - default: - if (isFunctionLike(node)) { - if (node.name && node.name.kind === 168 /* ComputedPropertyName */) { - traverse(node.name.expression); - return; - } - } else if (!isPartOfTypeNode(node)) { - forEachChild(node, traverse); - } - } - } -} -function getRestParameterElementType(node) { - if (node && node.kind === 189 /* ArrayType */) { - return node.elementType; - } else if (node && node.kind === 184 /* TypeReference */) { - return singleOrUndefined(node.typeArguments); - } else { - return void 0; - } -} -function getMembersOfDeclaration(node) { - switch (node.kind) { - case 265 /* InterfaceDeclaration */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 188 /* TypeLiteral */: - return node.members; - case 211 /* ObjectLiteralExpression */: - return node.properties; - } -} -function isVariableLike(node) { - if (node) { - switch (node.kind) { - case 209 /* BindingElement */: - case 307 /* EnumMember */: - case 170 /* Parameter */: - case 304 /* PropertyAssignment */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 305 /* ShorthandPropertyAssignment */: - case 261 /* VariableDeclaration */: - return true; - } - } - return false; -} -function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 262 /* VariableDeclarationList */ && node.parent.parent.kind === 244 /* VariableStatement */; -} -function isCommonJsExportedExpression(node) { - if (!isInJSFile(node)) return false; - return isObjectLiteralExpression(node.parent) && isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === 2 /* ModuleExports */ || isCommonJsExportPropertyAssignment(node.parent); -} -function isCommonJsExportPropertyAssignment(node) { - if (!isInJSFile(node)) return false; - return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 1 /* ExportsProperty */; -} -function isValidESSymbolDeclaration(node) { - return (isVariableDeclaration(node) ? isVarConst(node) && isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) : isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) : isPropertySignature(node) && hasEffectiveReadonlyModifier(node)) || isCommonJsExportPropertyAssignment(node); -} -function introducesArgumentsExoticObject(node) { - switch (node.kind) { - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - return true; - } - return false; -} -function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { - while (true) { - if (beforeUnwrapLabelCallback) { - beforeUnwrapLabelCallback(node); - } - if (node.statement.kind !== 257 /* LabeledStatement */) { - return node.statement; - } - node = node.statement; - } -} -function isFunctionBlock(node) { - return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent); -} -function isObjectLiteralMethod(node) { - return node && node.kind === 175 /* MethodDeclaration */ && node.parent.kind === 211 /* ObjectLiteralExpression */; -} -function isObjectLiteralOrClassExpressionMethodOrAccessor(node) { - return (node.kind === 175 /* MethodDeclaration */ || node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */) && (node.parent.kind === 211 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */); -} -function isIdentifierTypePredicate(predicate) { - return predicate && predicate.kind === 1 /* Identifier */; -} -function isThisTypePredicate(predicate) { - return predicate && predicate.kind === 0 /* This */; -} -function forEachPropertyAssignment(objectLiteral, key, callback, key2) { - return forEach(objectLiteral == null ? void 0 : objectLiteral.properties, (property) => { - if (!isPropertyAssignment(property)) return void 0; - const propName = tryGetTextOfPropertyName(property.name); - return key === propName || key2 && key2 === propName ? callback(property) : void 0; - }); -} -function getTsConfigObjectLiteralExpression(tsConfigSourceFile) { - if (tsConfigSourceFile && tsConfigSourceFile.statements.length) { - const expression = tsConfigSourceFile.statements[0].expression; - return tryCast(expression, isObjectLiteralExpression); - } -} -function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) { - return forEachTsConfigPropArray(tsConfigSourceFile, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0); -} -function forEachTsConfigPropArray(tsConfigSourceFile, propKey, callback) { - return forEachPropertyAssignment(getTsConfigObjectLiteralExpression(tsConfigSourceFile), propKey, callback); -} -function getContainingFunction(node) { - return findAncestor(node.parent, isFunctionLike); -} -function getContainingFunctionDeclaration(node) { - return findAncestor(node.parent, isFunctionLikeDeclaration); -} -function getContainingClass(node) { - return findAncestor(node.parent, isClassLike); -} -function getContainingClassStaticBlock(node) { - return findAncestor(node.parent, (n) => { - if (isClassLike(n) || isFunctionLike(n)) { - return "quit"; - } - return isClassStaticBlockDeclaration(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 !== 308 /* SourceFile */); - while (true) { - node = node.parent; - if (!node) { - return Debug.fail(); - } - switch (node.kind) { - case 168 /* ComputedPropertyName */: - if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) { - return node; - } - node = node.parent.parent; - break; - case 171 /* Decorator */: - if (node.parent.kind === 170 /* Parameter */ && isClassElement(node.parent.parent)) { - node = node.parent.parent; - } else if (isClassElement(node.parent)) { - node = node.parent; - } - break; - case 220 /* ArrowFunction */: - if (!includeArrowFunctions) { - continue; - } - // falls through - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 268 /* ModuleDeclaration */: - case 176 /* ClassStaticBlockDeclaration */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 182 /* IndexSignature */: - case 267 /* EnumDeclaration */: - case 308 /* SourceFile */: - return node; - } - } -} -function isThisContainerOrFunctionBlock(node) { - switch (node.kind) { - // Arrow functions use the same scope, but may do so in a "delayed" manner - // For example, `const getThis = () => this` may be before a super() call in a derived constructor - case 220 /* ArrowFunction */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 173 /* PropertyDeclaration */: - return true; - case 242 /* Block */: - switch (node.parent.kind) { - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return true; - default: - return false; - } - default: - return false; - } -} -function isInTopLevelContext(node) { - if (isIdentifier(node) && (isClassDeclaration(node.parent) || isFunctionDeclaration(node.parent)) && node.parent.name === node) { - node = node.parent; - } - const container = getThisContainer( - node, - /*includeArrowFunctions*/ - true, - /*includeClassComputedPropertyName*/ - false - ); - return isSourceFile(container); -} -function getNewTargetContainer(node) { - const container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (container) { - switch (container.kind) { - case 177 /* Constructor */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - return container; - } - } - return void 0; -} -function getSuperContainer(node, stopOnFunctions) { - while (true) { - node = node.parent; - if (!node) { - return void 0; - } - switch (node.kind) { - case 168 /* ComputedPropertyName */: - node = node.parent; - break; - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - if (!stopOnFunctions) { - continue; - } - // falls through - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 176 /* ClassStaticBlockDeclaration */: - return node; - case 171 /* Decorator */: - if (node.parent.kind === 170 /* Parameter */ && isClassElement(node.parent.parent)) { - node = node.parent.parent; - } else if (isClassElement(node.parent)) { - node = node.parent; - } - break; - } - } -} -function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 219 /* FunctionExpression */ || func.kind === 220 /* ArrowFunction */) { - let prev = func; - let parent2 = func.parent; - while (parent2.kind === 218 /* ParenthesizedExpression */) { - prev = parent2; - parent2 = parent2.parent; - } - if (parent2.kind === 214 /* CallExpression */ && parent2.expression === prev) { - return parent2; - } - } -} -function isSuperProperty(node) { - const kind = node.kind; - return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && node.expression.kind === 108 /* SuperKeyword */; -} -function isThisProperty(node) { - const kind = node.kind; - return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && node.expression.kind === 110 /* ThisKeyword */; -} -function isThisInitializedDeclaration(node) { - var _a; - return !!node && isVariableDeclaration(node) && ((_a = node.initializer) == null ? void 0 : _a.kind) === 110 /* ThisKeyword */; -} -function isThisInitializedObjectBindingExpression(node) { - return !!node && (isShorthandPropertyAssignment(node) || isPropertyAssignment(node)) && isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 64 /* EqualsToken */ && node.parent.parent.right.kind === 110 /* ThisKeyword */; -} -function getEntityNameFromTypeNode(node) { - switch (node.kind) { - case 184 /* TypeReference */: - return node.typeName; - case 234 /* ExpressionWithTypeArguments */: - return isEntityNameExpression(node.expression) ? node.expression : void 0; - // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. - case 80 /* Identifier */: - case 167 /* QualifiedName */: - return node; - } - return void 0; -} -function getInvokedExpression(node) { - switch (node.kind) { - case 216 /* TaggedTemplateExpression */: - return node.tag; - case 287 /* JsxOpeningElement */: - case 286 /* JsxSelfClosingElement */: - return node.tagName; - case 227 /* BinaryExpression */: - return node.right; - case 290 /* JsxOpeningFragment */: - return node; - default: - return node.expression; - } -} -function nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent) { - if (useLegacyDecorators && isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { - return false; - } - switch (node.kind) { - case 264 /* ClassDeclaration */: - return true; - case 232 /* ClassExpression */: - return !useLegacyDecorators; - case 173 /* PropertyDeclaration */: - return parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - return node.body !== void 0 && parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2)); - case 170 /* Parameter */: - if (!useLegacyDecorators) return false; - return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 177 /* Constructor */ || parent2.kind === 175 /* MethodDeclaration */ || parent2.kind === 179 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 264 /* ClassDeclaration */; - } - return false; -} -function nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) { - return hasDecorators(node) && nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent); -} -function nodeOrChildIsDecorated(useLegacyDecorators, node, parent2, grandparent) { - return nodeIsDecorated(useLegacyDecorators, node, parent2, grandparent) || childIsDecorated(useLegacyDecorators, node, parent2); -} -function childIsDecorated(useLegacyDecorators, node, parent2) { - switch (node.kind) { - case 264 /* ClassDeclaration */: - return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 232 /* ClassExpression */: - return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 175 /* MethodDeclaration */: - case 179 /* SetAccessor */: - case 177 /* Constructor */: - return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent2)); - default: - return false; - } -} -function classOrConstructorParameterIsDecorated(useLegacyDecorators, node) { - if (nodeIsDecorated(useLegacyDecorators, node)) return true; - const constructor = getFirstConstructorWithBody(node); - return !!constructor && childIsDecorated(useLegacyDecorators, constructor, node); -} -function classElementOrClassElementParameterIsDecorated(useLegacyDecorators, node, parent2) { - let parameters; - if (isAccessor(node)) { - const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(parent2.members, node); - const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; - if (!firstAccessorWithDecorators || node !== firstAccessorWithDecorators) { - return false; - } - parameters = setAccessor == null ? void 0 : setAccessor.parameters; - } else if (isMethodDeclaration(node)) { - parameters = node.parameters; - } - if (nodeIsDecorated(useLegacyDecorators, node, parent2)) { - return true; - } - if (parameters) { - for (const parameter of parameters) { - if (parameterIsThisKeyword(parameter)) continue; - if (nodeIsDecorated(useLegacyDecorators, parameter, node, parent2)) return true; - } - } - return false; -} -function isEmptyStringLiteral(node) { - if (node.textSourceNode) { - switch (node.textSourceNode.kind) { - case 11 /* StringLiteral */: - return isEmptyStringLiteral(node.textSourceNode); - case 15 /* NoSubstitutionTemplateLiteral */: - return node.text === ""; - } - return false; - } - return node.text === ""; -} -function isJSXTagName(node) { - const { parent: parent2 } = node; - if (parent2.kind === 287 /* JsxOpeningElement */ || parent2.kind === 286 /* JsxSelfClosingElement */ || parent2.kind === 288 /* JsxClosingElement */) { - return parent2.tagName === node; - } - return false; -} -function isExpressionNode(node) { - switch (node.kind) { - case 108 /* SuperKeyword */: - case 106 /* NullKeyword */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 14 /* RegularExpressionLiteral */: - case 210 /* ArrayLiteralExpression */: - case 211 /* ObjectLiteralExpression */: - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 216 /* TaggedTemplateExpression */: - case 235 /* AsExpression */: - case 217 /* TypeAssertionExpression */: - case 239 /* SatisfiesExpression */: - case 236 /* NonNullExpression */: - case 218 /* ParenthesizedExpression */: - case 219 /* FunctionExpression */: - case 232 /* ClassExpression */: - case 220 /* ArrowFunction */: - case 223 /* VoidExpression */: - case 221 /* DeleteExpression */: - case 222 /* TypeOfExpression */: - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - case 227 /* BinaryExpression */: - case 228 /* ConditionalExpression */: - case 231 /* SpreadElement */: - case 229 /* TemplateExpression */: - case 233 /* OmittedExpression */: - case 285 /* JsxElement */: - case 286 /* JsxSelfClosingElement */: - case 289 /* JsxFragment */: - case 230 /* YieldExpression */: - case 224 /* AwaitExpression */: - return true; - case 237 /* MetaProperty */: - return !isImportCall(node.parent) || node.parent.expression !== node; - case 234 /* ExpressionWithTypeArguments */: - return !isHeritageClause(node.parent) && !isJSDocAugmentsTag(node.parent); - case 167 /* QualifiedName */: - while (node.parent.kind === 167 /* QualifiedName */) { - node = node.parent; - } - return node.parent.kind === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); - case 312 /* JSDocMemberName */: - while (isJSDocMemberName(node.parent)) { - node = node.parent; - } - return node.parent.kind === 187 /* 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 === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { - return true; - } - // falls through - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 110 /* ThisKeyword */: - return isInExpressionContext(node); - default: - return false; - } -} -function isInExpressionContext(node) { - const { parent: parent2 } = node; - switch (parent2.kind) { - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 307 /* EnumMember */: - case 304 /* PropertyAssignment */: - case 209 /* BindingElement */: - return parent2.initializer === node; - case 245 /* ExpressionStatement */: - case 246 /* IfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 254 /* ReturnStatement */: - case 255 /* WithStatement */: - case 256 /* SwitchStatement */: - case 297 /* CaseClause */: - case 258 /* ThrowStatement */: - return parent2.expression === node; - case 249 /* ForStatement */: - const forStatement = parent2; - return forStatement.initializer === node && forStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node; - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - const forInOrOfStatement = parent2; - return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forInOrOfStatement.expression === node; - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - return node === parent2.expression; - case 240 /* TemplateSpan */: - return node === parent2.expression; - case 168 /* ComputedPropertyName */: - return node === parent2.expression; - case 171 /* Decorator */: - case 295 /* JsxExpression */: - case 294 /* JsxSpreadAttribute */: - case 306 /* SpreadAssignment */: - return true; - case 234 /* ExpressionWithTypeArguments */: - return parent2.expression === node && !isPartOfTypeNode(parent2); - case 305 /* ShorthandPropertyAssignment */: - return parent2.objectAssignmentInitializer === node; - case 239 /* SatisfiesExpression */: - return node === parent2.expression; - default: - return isExpressionNode(parent2); - } -} -function isPartOfTypeQuery(node) { - while (node.kind === 167 /* QualifiedName */ || node.kind === 80 /* Identifier */) { - node = node.parent; - } - return node.kind === 187 /* TypeQuery */; -} -function isNamespaceReexportDeclaration(node) { - return isNamespaceExport(node) && !!node.parent.moduleSpecifier; -} -function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 284 /* ExternalModuleReference */; -} -function getExternalModuleImportEqualsDeclarationExpression(node) { - Debug.assert(isExternalModuleImportEqualsDeclaration(node)); - return node.moduleReference.expression; -} -function getExternalModuleRequireArgument(node) { - return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0]; -} -function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 284 /* ExternalModuleReference */; -} -function isFullSourceFile(sourceFile) { - return (sourceFile == null ? void 0 : sourceFile.kind) === 308 /* SourceFile */; -} -function isSourceFileJS(file) { - return isInJSFile(file); -} -function isInJSFile(node) { - return !!node && !!(node.flags & 524288 /* JavaScriptFile */); -} -function isInJsonFile(node) { - return !!node && !!(node.flags & 134217728 /* JsonFile */); -} -function isSourceFileNotJson(file) { - return !isJsonSourceFile(file); -} -function isInJSDoc(node) { - 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 !== 214 /* CallExpression */) { - return false; - } - const { expression, arguments: args } = callExpression; - if (expression.kind !== 80 /* Identifier */ || expression.escapedText !== "require") { - return false; - } - if (args.length !== 1) { - return false; - } - const arg = args[0]; - return !requireStringLiteralLikeArgument || isStringLiteralLike(arg); -} -function isVariableDeclarationInitializedToRequire(node) { - return isVariableDeclarationInitializedWithRequireHelper( - node, - /*allowAccessedRequire*/ - false - ); -} -function isVariableDeclarationInitializedToBareOrAccessedRequire(node) { - return isVariableDeclarationInitializedWithRequireHelper( - node, - /*allowAccessedRequire*/ - true - ); -} -function isBindingElementOfBareOrAccessedRequire(node) { - return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); -} -function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { - return isVariableDeclaration(node) && !!node.initializer && isRequireCall( - allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, - /*requireStringLiteralLikeArgument*/ - true - ); -} -function isRequireVariableStatement(node) { - return isVariableStatement(node) && node.declarationList.declarations.length > 0 && every(node.declarationList.declarations, (decl) => isVariableDeclarationInitializedToRequire(decl)); -} -function isSingleOrDoubleQuote(charCode) { - return charCode === 39 /* singleQuote */ || charCode === 34 /* doubleQuote */; -} -function isStringDoubleQuoted(str, sourceFile) { - return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */; -} -function isAssignmentDeclaration(decl) { - return isBinaryExpression(decl) || isAccessExpression(decl) || isIdentifier(decl) || isCallExpression(decl); -} -function getEffectiveInitializer(node) { - if (isInJSFile(node) && node.initializer && isBinaryExpression(node.initializer) && (node.initializer.operatorToken.kind === 57 /* BarBarToken */ || node.initializer.operatorToken.kind === 61 /* QuestionQuestionToken */) && node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) { - return node.initializer.right; - } - return node.initializer; -} -function getDeclaredExpandoInitializer(node) { - const init = getEffectiveInitializer(node); - return init && getExpandoInitializer(init, isPrototypeAccess(node.name)); -} -function hasExpandoValueProperty(node, isPrototypeAssignment) { - return forEach(node.properties, (p) => isPropertyAssignment(p) && isIdentifier(p.name) && p.name.escapedText === "value" && p.initializer && getExpandoInitializer(p.initializer, isPrototypeAssignment)); -} -function getAssignedExpandoInitializer(node) { - if (node && node.parent && isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 64 /* EqualsToken */) { - const isPrototypeAssignment = isPrototypeAccess(node.parent.left); - return getExpandoInitializer(node.parent.right, isPrototypeAssignment) || getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment); - } - if (node && isCallExpression(node) && isBindableObjectDefinePropertyCall(node)) { - const result = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === "prototype"); - if (result) { - return result; - } - } -} -function getExpandoInitializer(initializer, isPrototypeAssignment) { - if (isCallExpression(initializer)) { - const e = skipParentheses(initializer.expression); - return e.kind === 219 /* FunctionExpression */ || e.kind === 220 /* ArrowFunction */ ? initializer : void 0; - } - if (initializer.kind === 219 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 220 /* ArrowFunction */) { - return initializer; - } - if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { - return initializer; - } -} -function getDefaultedExpandoInitializer(name, initializer, isPrototypeAssignment) { - const e = isBinaryExpression(initializer) && (initializer.operatorToken.kind === 57 /* BarBarToken */ || initializer.operatorToken.kind === 61 /* QuestionQuestionToken */) && getExpandoInitializer(initializer.right, isPrototypeAssignment); - if (e && isSameEntityName(name, initializer.left)) { - return e; - } -} -function isDefaultedExpandoInitializer(node) { - const name = isVariableDeclaration(node.parent) ? node.parent.name : isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 64 /* EqualsToken */ ? node.parent.left : void 0; - return name && getExpandoInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left); -} -function getNameOfExpando(node) { - if (isBinaryExpression(node.parent)) { - const parent2 = (node.parent.operatorToken.kind === 57 /* BarBarToken */ || node.parent.operatorToken.kind === 61 /* QuestionQuestionToken */) && isBinaryExpression(node.parent.parent) ? node.parent.parent : node.parent; - if (parent2.operatorToken.kind === 64 /* EqualsToken */ && isIdentifier(parent2.left)) { - return parent2.left; - } - } else if (isVariableDeclaration(node.parent)) { - return node.parent.name; - } -} -function isSameEntityName(name, initializer) { - if (isPropertyNameLiteral(name) && isPropertyNameLiteral(initializer)) { - return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer); - } - if (isMemberName(name) && isLiteralLikeAccess(initializer) && (initializer.expression.kind === 110 /* ThisKeyword */ || isIdentifier(initializer.expression) && (initializer.expression.escapedText === "window" || initializer.expression.escapedText === "self" || initializer.expression.escapedText === "global"))) { - return isSameEntityName(name, getNameOrArgument(initializer)); - } - if (isLiteralLikeAccess(name) && isLiteralLikeAccess(initializer)) { - return getElementOrPropertyAccessName(name) === getElementOrPropertyAccessName(initializer) && isSameEntityName(name.expression, initializer.expression); - } - return false; -} -function getRightMostAssignedExpression(node) { - while (isAssignmentExpression( - node, - /*excludeCompoundAssignment*/ - true - )) { - node = node.right; - } - return node; -} -function isExportsIdentifier(node) { - return isIdentifier(node) && node.escapedText === "exports"; -} -function isModuleIdentifier(node) { - return isIdentifier(node) && node.escapedText === "module"; -} -function isModuleExportsAccessExpression(node) { - return (isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node)) && isModuleIdentifier(node.expression) && getElementOrPropertyAccessName(node) === "exports"; -} -function getAssignmentDeclarationKind(expr) { - const special = getAssignmentDeclarationKindWorker(expr); - return special === 5 /* Property */ || isInJSFile(expr) ? special : 0 /* None */; -} -function isBindableObjectDefinePropertyCall(expr) { - return length(expr.arguments) === 3 && isPropertyAccessExpression(expr.expression) && isIdentifier(expr.expression.expression) && idText(expr.expression.expression) === "Object" && idText(expr.expression.name) === "defineProperty" && isStringOrNumericLiteralLike(expr.arguments[1]) && isBindableStaticNameExpression( - expr.arguments[0], - /*excludeThisKeyword*/ - true - ); -} -function isLiteralLikeAccess(node) { - return isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node); -} -function isLiteralLikeElementAccess(node) { - return isElementAccessExpression(node) && isStringOrNumericLiteralLike(node.argumentExpression); -} -function isBindableStaticAccessExpression(node, excludeThisKeyword) { - return isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 110 /* ThisKeyword */ || isIdentifier(node.name) && isBindableStaticNameExpression( - node.expression, - /*excludeThisKeyword*/ - true - )) || isBindableStaticElementAccessExpression(node, excludeThisKeyword); -} -function isBindableStaticElementAccessExpression(node, excludeThisKeyword) { - return isLiteralLikeElementAccess(node) && (!excludeThisKeyword && node.expression.kind === 110 /* ThisKeyword */ || isEntityNameExpression(node.expression) || isBindableStaticAccessExpression( - node.expression, - /*excludeThisKeyword*/ - true - )); -} -function isBindableStaticNameExpression(node, excludeThisKeyword) { - return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword); -} -function getNameOrArgument(expr) { - if (isPropertyAccessExpression(expr)) { - return expr.name; - } - return expr.argumentExpression; -} -function getAssignmentDeclarationKindWorker(expr) { - if (isCallExpression(expr)) { - if (!isBindableObjectDefinePropertyCall(expr)) { - return 0 /* None */; - } - const entityName = expr.arguments[0]; - if (isExportsIdentifier(entityName) || isModuleExportsAccessExpression(entityName)) { - return 8 /* ObjectDefinePropertyExports */; - } - if (isBindableStaticAccessExpression(entityName) && getElementOrPropertyAccessName(entityName) === "prototype") { - return 9 /* ObjectDefinePrototypeProperty */; - } - return 7 /* ObjectDefinePropertyValue */; - } - if (expr.operatorToken.kind !== 64 /* EqualsToken */ || !isAccessExpression(expr.left) || isVoidZero(getRightMostAssignedExpression(expr))) { - return 0 /* None */; - } - if (isBindableStaticNameExpression( - expr.left.expression, - /*excludeThisKeyword*/ - true - ) && getElementOrPropertyAccessName(expr.left) === "prototype" && isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) { - return 6 /* Prototype */; - } - return getAssignmentDeclarationPropertyAccessKind(expr.left); -} -function isVoidZero(node) { - return isVoidExpression(node) && isNumericLiteral(node.expression) && node.expression.text === "0"; -} -function getElementOrPropertyAccessArgumentExpressionOrName(node) { - if (isPropertyAccessExpression(node)) { - return node.name; - } - const arg = skipParentheses(node.argumentExpression); - if (isNumericLiteral(arg) || isStringLiteralLike(arg)) { - return arg; - } - return node; -} -function getElementOrPropertyAccessName(node) { - const name = getElementOrPropertyAccessArgumentExpressionOrName(node); - if (name) { - if (isIdentifier(name)) { - return name.escapedText; - } - if (isStringLiteralLike(name) || isNumericLiteral(name)) { - return escapeLeadingUnderscores(name.text); - } - } - return void 0; -} -function getAssignmentDeclarationPropertyAccessKind(lhs) { - if (lhs.expression.kind === 110 /* ThisKeyword */) { - return 4 /* ThisProperty */; - } else if (isModuleExportsAccessExpression(lhs)) { - return 2 /* ModuleExports */; - } else if (isBindableStaticNameExpression( - lhs.expression, - /*excludeThisKeyword*/ - true - )) { - if (isPrototypeAccess(lhs.expression)) { - return 3 /* PrototypeProperty */; - } - let nextToLast = lhs; - while (!isIdentifier(nextToLast.expression)) { - nextToLast = nextToLast.expression; - } - const id = nextToLast.expression; - if ((id.escapedText === "exports" || id.escapedText === "module" && getElementOrPropertyAccessName(nextToLast) === "exports") && // ExportsProperty does not support binding with computed names - isBindableStaticAccessExpression(lhs)) { - return 1 /* ExportsProperty */; - } - if (isBindableStaticNameExpression( - lhs, - /*excludeThisKeyword*/ - true - ) || isElementAccessExpression(lhs) && isDynamicName(lhs)) { - return 5 /* Property */; - } - } - return 0 /* None */; -} -function getInitializerOfBinaryExpression(expr) { - while (isBinaryExpression(expr.right)) { - expr = expr.right; - } - return expr.right; -} -function isPrototypePropertyAssignment(node) { - return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */; -} -function isSpecialPropertyDeclaration(expr) { - return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); -} -function setValueDeclaration(symbol, node) { - const { valueDeclaration } = symbol; - 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; - } -} -function isFunctionSymbol(symbol) { - if (!symbol || !symbol.valueDeclaration) { - return false; - } - const decl = symbol.valueDeclaration; - return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); -} -function canHaveModuleSpecifier(node) { - switch (node == null ? void 0 : node.kind) { - case 261 /* VariableDeclaration */: - case 209 /* BindingElement */: - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 274 /* ImportClause */: - case 281 /* NamespaceExport */: - case 275 /* NamespaceImport */: - case 282 /* ExportSpecifier */: - case 277 /* ImportSpecifier */: - case 206 /* ImportType */: - return true; - } - return false; -} -function tryGetModuleSpecifierFromDeclaration(node) { - var _a, _b; - switch (node.kind) { - case 261 /* VariableDeclaration */: - case 209 /* BindingElement */: - return (_a = findAncestor(node.initializer, (node2) => isRequireCall( - node2, - /*requireStringLiteralLikeArgument*/ - true - ))) == null ? void 0 : _a.arguments[0]; - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 352 /* JSDocImportTag */: - return tryCast(node.moduleSpecifier, isStringLiteralLike); - case 272 /* ImportEqualsDeclaration */: - return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); - case 274 /* ImportClause */: - case 281 /* NamespaceExport */: - return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); - case 275 /* NamespaceImport */: - case 282 /* ExportSpecifier */: - return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); - case 277 /* ImportSpecifier */: - return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); - case 206 /* ImportType */: - return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; - default: - Debug.assertNever(node); - } -} -function importFromModuleSpecifier(node) { - return tryGetImportFromModuleSpecifier(node) || Debug.failBadSyntaxKind(node.parent); -} -function tryGetImportFromModuleSpecifier(node) { - switch (node.parent.kind) { - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 352 /* JSDocImportTag */: - return node.parent; - case 284 /* ExternalModuleReference */: - return node.parent.parent; - case 214 /* CallExpression */: - return isImportCall(node.parent) || isRequireCall( - node.parent, - /*requireStringLiteralLikeArgument*/ - false - ) ? node.parent : void 0; - case 202 /* LiteralType */: - if (!isStringLiteral(node)) { - break; - } - return tryCast(node.parent.parent, isImportTypeNode); - default: - return void 0; - } -} -function shouldRewriteModuleSpecifier(specifier, compilerOptions) { - return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier) && hasTSFileExtension(specifier); -} -function getExternalModuleName(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 352 /* JSDocImportTag */: - return node.moduleSpecifier; - case 272 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 284 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; - case 206 /* ImportType */: - return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; - case 214 /* CallExpression */: - return node.arguments[0]; - case 268 /* ModuleDeclaration */: - return node.name.kind === 11 /* StringLiteral */ ? node.name : void 0; - default: - return Debug.assertNever(node); - } -} -function getNamespaceDeclarationNode(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport); - case 272 /* ImportEqualsDeclaration */: - return node; - case 279 /* ExportDeclaration */: - return node.exportClause && tryCast(node.exportClause, isNamespaceExport); - default: - return Debug.assertNever(node); - } -} -function isDefaultImport(node) { - return (node.kind === 273 /* ImportDeclaration */ || node.kind === 352 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name; -} -function forEachImportClauseDeclaration(node, action) { - if (node.name) { - const result = action(node); - if (result) return result; - } - if (node.namedBindings) { - const result = isNamespaceImport(node.namedBindings) ? action(node.namedBindings) : forEach(node.namedBindings.elements, action); - if (result) return result; - } -} -function hasQuestionToken(node) { - switch (node.kind) { - case 170 /* Parameter */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 305 /* ShorthandPropertyAssignment */: - case 304 /* PropertyAssignment */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - return node.questionToken !== void 0; - } - return false; -} -function isJSDocConstructSignature(node) { - const param = isJSDocFunctionType(node) ? firstOrUndefined(node.parameters) : void 0; - const name = tryCast(param && param.name, isIdentifier); - return !!name && name.escapedText === "new"; -} -function isJSDocTypeAlias(node) { - return node.kind === 347 /* JSDocTypedefTag */ || node.kind === 339 /* JSDocCallbackTag */ || node.kind === 341 /* JSDocEnumTag */; -} -function isTypeAlias(node) { - return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node); -} -function getSourceOfAssignment(node) { - return isExpressionStatement(node) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 64 /* EqualsToken */ ? getRightMostAssignedExpression(node.expression) : void 0; -} -function getSourceOfDefaultedAssignment(node) { - return isExpressionStatement(node) && isBinaryExpression(node.expression) && getAssignmentDeclarationKind(node.expression) !== 0 /* None */ && isBinaryExpression(node.expression.right) && (node.expression.right.operatorToken.kind === 57 /* BarBarToken */ || node.expression.right.operatorToken.kind === 61 /* QuestionQuestionToken */) ? node.expression.right.right : void 0; -} -function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { - switch (node.kind) { - case 244 /* VariableStatement */: - const v = getSingleVariableOfVariableStatement(node); - return v && v.initializer; - case 173 /* PropertyDeclaration */: - return node.initializer; - case 304 /* PropertyAssignment */: - return node.initializer; - } -} -function getSingleVariableOfVariableStatement(node) { - return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0; -} -function getNestedModuleDeclaration(node) { - return isModuleDeclaration(node) && node.body && node.body.kind === 268 /* ModuleDeclaration */ ? node.body : void 0; -} -function canHaveFlowNode(node) { - if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */) { - return true; - } - switch (node.kind) { - case 80 /* Identifier */: - case 110 /* ThisKeyword */: - case 108 /* SuperKeyword */: - case 167 /* QualifiedName */: - case 237 /* MetaProperty */: - case 213 /* ElementAccessExpression */: - case 212 /* PropertyAccessExpression */: - case 209 /* BindingElement */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return true; - default: - return false; - } -} -function canHaveJSDoc(node) { - switch (node.kind) { - case 220 /* ArrowFunction */: - case 227 /* BinaryExpression */: - case 242 /* Block */: - case 253 /* BreakStatement */: - case 180 /* CallSignature */: - case 297 /* CaseClause */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 176 /* ClassStaticBlockDeclaration */: - case 177 /* Constructor */: - case 186 /* ConstructorType */: - case 181 /* ConstructSignature */: - case 252 /* ContinueStatement */: - case 260 /* DebuggerStatement */: - case 247 /* DoStatement */: - case 213 /* ElementAccessExpression */: - case 243 /* EmptyStatement */: - case 1 /* EndOfFileToken */: - case 267 /* EnumDeclaration */: - case 307 /* EnumMember */: - case 278 /* ExportAssignment */: - case 279 /* ExportDeclaration */: - case 282 /* ExportSpecifier */: - case 245 /* ExpressionStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 249 /* ForStatement */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 185 /* FunctionType */: - case 178 /* GetAccessor */: - case 80 /* Identifier */: - case 246 /* IfStatement */: - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 182 /* IndexSignature */: - case 265 /* InterfaceDeclaration */: - case 318 /* JSDocFunctionType */: - case 324 /* JSDocSignature */: - case 257 /* LabeledStatement */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 268 /* ModuleDeclaration */: - case 203 /* NamedTupleMember */: - case 271 /* NamespaceExportDeclaration */: - case 211 /* ObjectLiteralExpression */: - case 170 /* Parameter */: - case 218 /* ParenthesizedExpression */: - case 212 /* PropertyAccessExpression */: - case 304 /* PropertyAssignment */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 254 /* ReturnStatement */: - case 241 /* SemicolonClassElement */: - case 179 /* SetAccessor */: - case 305 /* ShorthandPropertyAssignment */: - case 306 /* SpreadAssignment */: - case 256 /* SwitchStatement */: - case 258 /* ThrowStatement */: - case 259 /* TryStatement */: - case 266 /* TypeAliasDeclaration */: - case 169 /* TypeParameter */: - case 261 /* VariableDeclaration */: - case 244 /* VariableStatement */: - case 248 /* WhileStatement */: - case 255 /* WithStatement */: - return true; - default: - return false; - } -} -function getJSDocCommentsAndTags(hostNode, noCache) { - let result; - if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) { - result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc)); - } - let node = hostNode; - while (node && node.parent) { - if (hasJSDocNodes(node)) { - result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc)); - } - if (node.kind === 170 /* Parameter */) { - result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node)); - break; - } - if (node.kind === 169 /* TypeParameter */) { - result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node)); - break; - } - node = getNextJSDocCommentLocation(node); - } - return result || emptyArray; -} -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 === 304 /* PropertyAssignment */ || parent2.kind === 278 /* ExportAssignment */ || parent2.kind === 173 /* PropertyDeclaration */ || parent2.kind === 245 /* ExpressionStatement */ && node.kind === 212 /* PropertyAccessExpression */ || parent2.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isAssignmentExpression(node)) { - return parent2; - } 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; - } -} -function getParameterSymbolFromJSDoc(node) { - if (node.symbol) { - return node.symbol; - } - if (!isIdentifier(node.name)) { - return void 0; - } - const name = node.name.escapedText; - const decl = getHostSignatureFromJSDoc(node); - if (!decl) { - return void 0; - } - const parameter = find(decl.parameters, (p) => p.name.kind === 80 /* Identifier */ && p.name.escapedText === name); - return parameter && parameter.symbol; -} -function getEffectiveContainerForJSDocTemplateTag(node) { - if (isJSDoc(node.parent) && node.parent.tags) { - const typeAlias = find(node.parent.tags, isJSDocTypeAlias); - if (typeAlias) { - return typeAlias; - } - } - return getHostSignatureFromJSDoc(node); -} -function getJSDocOverloadTags(node) { - return getAllJSDocTags(node, isJSDocOverloadTag); -} -function getHostSignatureFromJSDoc(node) { - const host = getEffectiveJSDocHost(node); - if (host) { - return isPropertySignature(host) && host.type && isFunctionLike(host.type) ? host.type : isFunctionLike(host) ? host : void 0; - } - return void 0; -} -function getEffectiveJSDocHost(node) { - const host = getJSDocHost(node); - if (host) { - return getSourceOfDefaultedAssignment(host) || getSourceOfAssignment(host) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; - } -} -function getJSDocHost(node) { - const jsDoc = getJSDocRoot(node); - if (!jsDoc) { - return void 0; - } - const host = jsDoc.parent; - if (host && host.jsDoc && jsDoc === lastOrUndefined(host.jsDoc)) { - return host; - } -} -function getJSDocRoot(node) { - return findAncestor(node.parent, isJSDoc); -} -function getTypeParameterFromJsDoc(node) { - const name = node.name.escapedText; - const { typeParameters } = node.parent.parent.parent; - return typeParameters && find(typeParameters, (p) => p.name.escapedText === name); -} -function hasTypeArguments(node) { - return !!node.typeArguments; -} -var AssignmentKind = /* @__PURE__ */ ((AssignmentKind2) => { - AssignmentKind2[AssignmentKind2["None"] = 0] = "None"; - AssignmentKind2[AssignmentKind2["Definite"] = 1] = "Definite"; - AssignmentKind2[AssignmentKind2["Compound"] = 2] = "Compound"; - return AssignmentKind2; -})(AssignmentKind || {}); -function getAssignmentTarget(node) { - let parent2 = node.parent; - while (true) { - switch (parent2.kind) { - case 227 /* BinaryExpression */: - const binaryExpression = parent2; - const binaryOperator = binaryExpression.operatorToken.kind; - return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0; - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - const unaryExpression = parent2; - const unaryOperator = unaryExpression.operator; - return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0; - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - const forInOrOfStatement = parent2; - return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0; - case 218 /* ParenthesizedExpression */: - case 210 /* ArrayLiteralExpression */: - case 231 /* SpreadElement */: - case 236 /* NonNullExpression */: - node = parent2; - break; - case 306 /* SpreadAssignment */: - node = parent2.parent; - break; - case 305 /* ShorthandPropertyAssignment */: - if (parent2.name !== node) { - return void 0; - } - node = parent2.parent; - break; - case 304 /* PropertyAssignment */: - if (parent2.name === node) { - return void 0; - } - node = parent2.parent; - break; - default: - return void 0; - } - parent2 = node.parent; - } -} -function getAssignmentTargetKind(node) { - const target = getAssignmentTarget(node); - if (!target) { - return 0 /* None */; - } - switch (target.kind) { - case 227 /* BinaryExpression */: - const binaryOperator = target.operatorToken.kind; - return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */; - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - return 2 /* Compound */; - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - return 1 /* Definite */; - } -} -function isAssignmentTarget(node) { - return !!getAssignmentTarget(node); -} -function isCompoundLikeAssignment(assignment) { - const right = skipParentheses(assignment.right); - return right.kind === 227 /* 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 242 /* Block */: - case 244 /* VariableStatement */: - case 255 /* WithStatement */: - case 246 /* IfStatement */: - case 256 /* SwitchStatement */: - case 270 /* CaseBlock */: - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - case 257 /* LabeledStatement */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 259 /* TryStatement */: - case 300 /* CatchClause */: - return true; - } - return false; -} -function isValueSignatureDeclaration(node) { - return isFunctionExpression(node) || isArrowFunction(node) || isMethodOrAccessor(node) || isFunctionDeclaration(node) || isConstructorDeclaration(node); -} -function walkUp(node, kind) { - while (node && node.kind === kind) { - node = node.parent; - } - return node; -} -function walkUpParenthesizedTypes(node) { - return walkUp(node, 197 /* ParenthesizedType */); -} -function walkUpParenthesizedExpressions(node) { - return walkUp(node, 218 /* ParenthesizedExpression */); -} -function walkUpParenthesizedTypesAndGetParentAndChild(node) { - let child; - while (node && node.kind === 197 /* ParenthesizedType */) { - child = node; - node = node.parent; - } - return [child, node]; -} -function skipTypeParentheses(node) { - while (isParenthesizedTypeNode(node)) node = node.type; - return node; -} -function skipParentheses(node, excludeJSDocTypeAssertions) { - const flags = excludeJSDocTypeAssertions ? 1 /* Parentheses */ | -2147483648 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */; - return skipOuterExpressions(node, flags); -} -function isDeleteTarget(node) { - if (node.kind !== 212 /* PropertyAccessExpression */ && node.kind !== 213 /* ElementAccessExpression */) { - return false; - } - node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 221 /* DeleteExpression */; -} -function isNodeDescendantOf(node, ancestor) { - while (node) { - if (node === ancestor) return true; - node = node.parent; - } - return false; -} -function isDeclarationName(name) { - return !isSourceFile(name) && !isBindingPattern(name) && isDeclaration(name.parent) && name.parent.name === name; -} -function getDeclarationFromName(name) { - const parent2 = name.parent; - switch (name.kind) { - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 9 /* NumericLiteral */: - if (isComputedPropertyName(parent2)) return parent2.parent; - // falls through - case 80 /* Identifier */: - if (isDeclaration(parent2)) { - return parent2.name === name ? parent2 : void 0; - } else if (isQualifiedName(parent2)) { - const tag = parent2.parent; - return isJSDocParameterTag(tag) && tag.name === parent2 ? tag : void 0; - } else { - const binExp = parent2.parent; - return isBinaryExpression(binExp) && getAssignmentDeclarationKind(binExp) !== 0 /* None */ && (binExp.left.symbol || binExp.symbol) && getNameOfDeclaration(binExp) === name ? binExp : void 0; - } - case 81 /* PrivateIdentifier */: - return isDeclaration(parent2) && parent2.name === name ? parent2 : void 0; - default: - return void 0; - } -} -function isLiteralComputedPropertyDeclarationName(node) { - return isStringOrNumericLiteralLike(node) && node.parent.kind === 168 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); -} -function isIdentifierName(node) { - const parent2 = node.parent; - switch (parent2.kind) { - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 307 /* EnumMember */: - case 304 /* PropertyAssignment */: - case 212 /* PropertyAccessExpression */: - return parent2.name === node; - case 167 /* QualifiedName */: - return parent2.right === node; - case 209 /* BindingElement */: - case 277 /* ImportSpecifier */: - return parent2.propertyName === node; - case 282 /* ExportSpecifier */: - case 292 /* JsxAttribute */: - case 286 /* JsxSelfClosingElement */: - case 287 /* JsxOpeningElement */: - case 288 /* JsxClosingElement */: - return true; - } - return false; -} -function getAliasDeclarationFromName(node) { - switch (node.parent.kind) { - case 274 /* ImportClause */: - case 277 /* ImportSpecifier */: - case 275 /* NamespaceImport */: - case 282 /* ExportSpecifier */: - case 278 /* ExportAssignment */: - case 272 /* ImportEqualsDeclaration */: - case 281 /* NamespaceExport */: - return node.parent; - case 167 /* QualifiedName */: - do { - node = node.parent; - } while (node.parent.kind === 167 /* QualifiedName */); - return getAliasDeclarationFromName(node); - } -} -function isAliasableExpression(e) { - return isEntityNameExpression(e) || isClassExpression(e); -} -function exportAssignmentIsAlias(node) { - const e = getExportAssignmentExpression(node); - return isAliasableExpression(e); -} -function getExportAssignmentExpression(node) { - return isExportAssignment(node) ? node.expression : node.right; -} -function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 305 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 304 /* PropertyAssignment */ ? node.initializer : node.parent.right; -} -function getEffectiveBaseTypeNode(node) { - const baseType = getClassExtendsHeritageElement(node); - if (baseType && isInJSFile(node)) { - const tag = getJSDocAugmentsTag(node); - if (tag) { - return tag.class; - } - } - return baseType; -} -function getClassExtendsHeritageElement(node) { - const heritageClause = getHeritageClause(node.heritageClauses, 96 /* ExtendsKeyword */); - return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : void 0; -} -function getEffectiveImplementsTypeNodes(node) { - if (isInJSFile(node)) { - return getJSDocImplementsTags(node).map((n) => n.class); - } else { - const heritageClause = getHeritageClause(node.heritageClauses, 119 /* ImplementsKeyword */); - return heritageClause == null ? void 0 : heritageClause.types; - } -} -function getAllSuperTypeNodes(node) { - return isInterfaceDeclaration(node) ? getInterfaceBaseTypeNodes(node) || emptyArray : isClassLike(node) ? concatenate(singleElementArray(getEffectiveBaseTypeNode(node)), getEffectiveImplementsTypeNodes(node)) || emptyArray : emptyArray; -} -function getInterfaceBaseTypeNodes(node) { - const heritageClause = getHeritageClause(node.heritageClauses, 96 /* ExtendsKeyword */); - return heritageClause ? heritageClause.types : void 0; -} -function getHeritageClause(clauses, kind) { - if (clauses) { - for (const clause of clauses) { - if (clause.token === kind) { - return clause; - } - } - } - return void 0; -} -function getAncestor(node, kind) { - while (node) { - if (node.kind === kind) { - return node; - } - node = node.parent; - } - return void 0; -} -function isKeyword(token) { - return 83 /* FirstKeyword */ <= token && token <= 166 /* LastKeyword */; -} -function isPunctuation(token) { - return 19 /* FirstPunctuation */ <= token && token <= 79 /* LastPunctuation */; -} -function isKeywordOrPunctuation(token) { - return isKeyword(token) || isPunctuation(token); -} -function isContextualKeyword(token) { - return 128 /* FirstContextualKeyword */ <= token && token <= 166 /* LastContextualKeyword */; -} -function isNonContextualKeyword(token) { - return isKeyword(token) && !isContextualKeyword(token); -} -function isStringANonContextualKeyword(name) { - const token = stringToToken(name); - return token !== void 0 && isNonContextualKeyword(token); -} -function isIdentifierANonContextualKeyword(node) { - const originalKeywordKind = identifierToKeywordKind(node); - return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); -} -function isTrivia(token) { - return 2 /* FirstTriviaToken */ <= token && token <= 7 /* LastTriviaToken */; -} -var FunctionFlags = /* @__PURE__ */ ((FunctionFlags2) => { - FunctionFlags2[FunctionFlags2["Normal"] = 0] = "Normal"; - FunctionFlags2[FunctionFlags2["Generator"] = 1] = "Generator"; - FunctionFlags2[FunctionFlags2["Async"] = 2] = "Async"; - FunctionFlags2[FunctionFlags2["Invalid"] = 4] = "Invalid"; - FunctionFlags2[FunctionFlags2["AsyncGenerator"] = 3] = "AsyncGenerator"; - return FunctionFlags2; -})(FunctionFlags || {}); -function getFunctionFlags(node) { - if (!node) { - return 4 /* Invalid */; - } - let flags = 0 /* Normal */; - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - if (node.asteriskToken) { - flags |= 1 /* Generator */; - } - // falls through - case 220 /* ArrowFunction */: - if (hasSyntacticModifier(node, 1024 /* Async */)) { - flags |= 2 /* Async */; - } - break; - } - if (!node.body) { - flags |= 4 /* Invalid */; - } - return flags; -} -function isAsyncFunction(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */); - } - return false; -} -function isStringOrNumericLiteralLike(node) { - return isStringLiteralLike(node) || isNumericLiteral(node); -} -function isSignedNumericLiteral(node) { - return isPrefixUnaryExpression(node) && (node.operator === 40 /* PlusToken */ || node.operator === 41 /* MinusToken */) && isNumericLiteral(node.operand); -} -function hasDynamicName(declaration) { - const name = getNameOfDeclaration(declaration); - return !!name && isDynamicName(name); -} -function isDynamicName(name) { - if (!(name.kind === 168 /* ComputedPropertyName */ || name.kind === 213 /* ElementAccessExpression */)) { - return false; - } - const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; - return !isStringOrNumericLiteralLike(expr) && !isSignedNumericLiteral(expr); -} -function getPropertyNameForPropertyNameNode(name) { - switch (name.kind) { - case 80 /* Identifier */: - case 81 /* PrivateIdentifier */: - return name.escapedText; - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - return escapeLeadingUnderscores(name.text); - case 168 /* ComputedPropertyName */: - const nameExpression = name.expression; - if (isStringOrNumericLiteralLike(nameExpression)) { - return escapeLeadingUnderscores(nameExpression.text); - } else if (isSignedNumericLiteral(nameExpression)) { - if (nameExpression.operator === 41 /* MinusToken */) { - return tokenToString(nameExpression.operator) + nameExpression.operand.text; - } - return nameExpression.operand.text; - } - return void 0; - case 296 /* JsxNamespacedName */: - return getEscapedTextOfJsxNamespacedName(name); - default: - return Debug.assertNever(name); - } -} -function isPropertyNameLiteral(node) { - switch (node.kind) { - case 80 /* Identifier */: - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 9 /* NumericLiteral */: - return true; - default: - return false; - } -} -function getTextOfIdentifierOrLiteral(node) { - return isMemberName(node) ? idText(node) : isJsxNamespacedName(node) ? getTextOfJsxNamespacedName(node) : node.text; -} -function getEscapedTextOfIdentifierOrLiteral(node) { - return isMemberName(node) ? node.escapedText : isJsxNamespacedName(node) ? getEscapedTextOfJsxNamespacedName(node) : escapeLeadingUnderscores(node.text); -} -function getSymbolNameForPrivateIdentifier(containingClassSymbol, description3) { - return `__#${getSymbolId(containingClassSymbol)}@${description3}`; -} -function isKnownSymbol(symbol) { - return startsWith(symbol.escapedName, "__@"); -} -function isPrivateIdentifierSymbol(symbol) { - return startsWith(symbol.escapedName, "__#"); -} -function isProtoSetter(node) { - return isIdentifier(node) ? idText(node) === "__proto__" : isStringLiteral(node) && node.text === "__proto__"; -} -function isAnonymousFunctionDefinition(node, cb) { - node = skipOuterExpressions(node); - switch (node.kind) { - case 232 /* ClassExpression */: - if (classHasDeclaredOrExplicitlyAssignedName(node)) { - return false; - } - break; - case 219 /* FunctionExpression */: - if (node.name) { - return false; - } - break; - case 220 /* ArrowFunction */: - break; - default: - return false; - } - return typeof cb === "function" ? cb(node) : true; -} -function isNamedEvaluationSource(node) { - switch (node.kind) { - case 304 /* PropertyAssignment */: - return !isProtoSetter(node.name); - case 305 /* ShorthandPropertyAssignment */: - return !!node.objectAssignmentInitializer; - case 261 /* VariableDeclaration */: - return isIdentifier(node.name) && !!node.initializer; - case 170 /* Parameter */: - return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 209 /* BindingElement */: - return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 173 /* PropertyDeclaration */: - return !!node.initializer; - case 227 /* BinaryExpression */: - switch (node.operatorToken.kind) { - case 64 /* EqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 76 /* BarBarEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return isIdentifier(node.left); - } - break; - case 278 /* ExportAssignment */: - return true; - } - return false; -} -function isNamedEvaluation(node, cb) { - if (!isNamedEvaluationSource(node)) return false; - switch (node.kind) { - case 304 /* PropertyAssignment */: - return isAnonymousFunctionDefinition(node.initializer, cb); - case 305 /* ShorthandPropertyAssignment */: - return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 209 /* BindingElement */: - case 173 /* PropertyDeclaration */: - return isAnonymousFunctionDefinition(node.initializer, cb); - case 227 /* BinaryExpression */: - return isAnonymousFunctionDefinition(node.right, cb); - case 278 /* ExportAssignment */: - return isAnonymousFunctionDefinition(node.expression, cb); - } -} -function isPushOrUnshiftIdentifier(node) { - return node.escapedText === "push" || node.escapedText === "unshift"; -} -function isPartOfParameterDeclaration(node) { - const root = getRootDeclaration(node); - return root.kind === 170 /* Parameter */; -} -function getRootDeclaration(node) { - while (node.kind === 209 /* BindingElement */) { - node = node.parent.parent; - } - return node; -} -function nodeStartsNewLexicalEnvironment(node) { - const kind = node.kind; - return kind === 177 /* Constructor */ || kind === 219 /* FunctionExpression */ || kind === 263 /* FunctionDeclaration */ || kind === 220 /* ArrowFunction */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 268 /* ModuleDeclaration */ || kind === 308 /* SourceFile */; -} -function nodeIsSynthesized(range) { - return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end); -} -var Associativity = /* @__PURE__ */ ((Associativity2) => { - Associativity2[Associativity2["Left"] = 0] = "Left"; - Associativity2[Associativity2["Right"] = 1] = "Right"; - return Associativity2; -})(Associativity || {}); -function getExpressionAssociativity(expression) { - const operator = getOperator(expression); - const hasArguments = expression.kind === 215 /* NewExpression */ && expression.arguments !== void 0; - return getOperatorAssociativity(expression.kind, operator, hasArguments); -} -function getOperatorAssociativity(kind, operator, hasArguments) { - switch (kind) { - case 215 /* NewExpression */: - return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 225 /* PrefixUnaryExpression */: - case 222 /* TypeOfExpression */: - case 223 /* VoidExpression */: - case 221 /* DeleteExpression */: - case 224 /* AwaitExpression */: - case 228 /* ConditionalExpression */: - case 230 /* YieldExpression */: - return 1 /* Right */; - case 227 /* BinaryExpression */: - switch (operator) { - case 43 /* AsteriskAsteriskToken */: - case 64 /* EqualsToken */: - case 65 /* PlusEqualsToken */: - case 66 /* MinusEqualsToken */: - case 68 /* AsteriskAsteriskEqualsToken */: - case 67 /* AsteriskEqualsToken */: - case 69 /* SlashEqualsToken */: - case 70 /* PercentEqualsToken */: - case 71 /* LessThanLessThanEqualsToken */: - case 72 /* GreaterThanGreaterThanEqualsToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 74 /* AmpersandEqualsToken */: - case 79 /* CaretEqualsToken */: - case 75 /* BarEqualsToken */: - case 76 /* BarBarEqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return 1 /* Right */; - } - } - return 0 /* Left */; -} -function getExpressionPrecedence(expression) { - const operator = getOperator(expression); - const hasArguments = expression.kind === 215 /* NewExpression */ && expression.arguments !== void 0; - return getOperatorPrecedence(expression.kind, operator, hasArguments); -} -function getOperator(expression) { - if (expression.kind === 227 /* BinaryExpression */) { - return expression.operatorToken.kind; - } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) { - return expression.operator; - } else { - return expression.kind; - } -} -var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => { - OperatorPrecedence2[OperatorPrecedence2["Comma"] = 0] = "Comma"; - OperatorPrecedence2[OperatorPrecedence2["Spread"] = 1] = "Spread"; - OperatorPrecedence2[OperatorPrecedence2["Yield"] = 2] = "Yield"; - OperatorPrecedence2[OperatorPrecedence2["Assignment"] = 3] = "Assignment"; - OperatorPrecedence2[OperatorPrecedence2["Conditional"] = 4] = "Conditional"; - OperatorPrecedence2[OperatorPrecedence2["LogicalOR"] = 5] = "LogicalOR"; - OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 5 /* LogicalOR */] = "Coalesce"; - OperatorPrecedence2[OperatorPrecedence2["LogicalAND"] = 6] = "LogicalAND"; - OperatorPrecedence2[OperatorPrecedence2["BitwiseOR"] = 7] = "BitwiseOR"; - OperatorPrecedence2[OperatorPrecedence2["BitwiseXOR"] = 8] = "BitwiseXOR"; - OperatorPrecedence2[OperatorPrecedence2["BitwiseAND"] = 9] = "BitwiseAND"; - OperatorPrecedence2[OperatorPrecedence2["Equality"] = 10] = "Equality"; - OperatorPrecedence2[OperatorPrecedence2["Relational"] = 11] = "Relational"; - OperatorPrecedence2[OperatorPrecedence2["Shift"] = 12] = "Shift"; - OperatorPrecedence2[OperatorPrecedence2["Additive"] = 13] = "Additive"; - OperatorPrecedence2[OperatorPrecedence2["Multiplicative"] = 14] = "Multiplicative"; - OperatorPrecedence2[OperatorPrecedence2["Exponentiation"] = 15] = "Exponentiation"; - OperatorPrecedence2[OperatorPrecedence2["Unary"] = 16] = "Unary"; - OperatorPrecedence2[OperatorPrecedence2["Update"] = 17] = "Update"; - OperatorPrecedence2[OperatorPrecedence2["LeftHandSide"] = 18] = "LeftHandSide"; - OperatorPrecedence2[OperatorPrecedence2["Member"] = 19] = "Member"; - OperatorPrecedence2[OperatorPrecedence2["Primary"] = 20] = "Primary"; - OperatorPrecedence2[OperatorPrecedence2["Highest"] = 20 /* Primary */] = "Highest"; - OperatorPrecedence2[OperatorPrecedence2["Lowest"] = 0 /* Comma */] = "Lowest"; - OperatorPrecedence2[OperatorPrecedence2["Invalid"] = -1] = "Invalid"; - return OperatorPrecedence2; -})(OperatorPrecedence || {}); -function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { - switch (nodeKind) { - case 357 /* CommaListExpression */: - return 0 /* Comma */; - case 231 /* SpreadElement */: - return 1 /* Spread */; - case 230 /* YieldExpression */: - return 2 /* Yield */; - case 228 /* ConditionalExpression */: - return 4 /* Conditional */; - case 227 /* BinaryExpression */: - switch (operatorKind) { - case 28 /* CommaToken */: - return 0 /* Comma */; - case 64 /* EqualsToken */: - case 65 /* PlusEqualsToken */: - case 66 /* MinusEqualsToken */: - case 68 /* AsteriskAsteriskEqualsToken */: - case 67 /* AsteriskEqualsToken */: - case 69 /* SlashEqualsToken */: - case 70 /* PercentEqualsToken */: - case 71 /* LessThanLessThanEqualsToken */: - case 72 /* GreaterThanGreaterThanEqualsToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 74 /* AmpersandEqualsToken */: - case 79 /* CaretEqualsToken */: - case 75 /* BarEqualsToken */: - case 76 /* BarBarEqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return 3 /* Assignment */; - default: - return getBinaryOperatorPrecedence(operatorKind); - } - // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? - case 217 /* TypeAssertionExpression */: - case 236 /* NonNullExpression */: - case 225 /* PrefixUnaryExpression */: - case 222 /* TypeOfExpression */: - case 223 /* VoidExpression */: - case 221 /* DeleteExpression */: - case 224 /* AwaitExpression */: - return 16 /* Unary */; - case 226 /* PostfixUnaryExpression */: - return 17 /* Update */; - case 214 /* CallExpression */: - return 18 /* LeftHandSide */; - case 215 /* NewExpression */: - return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 216 /* TaggedTemplateExpression */: - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - case 237 /* MetaProperty */: - return 19 /* Member */; - case 235 /* AsExpression */: - case 239 /* SatisfiesExpression */: - return 11 /* Relational */; - case 110 /* ThisKeyword */: - case 108 /* SuperKeyword */: - case 80 /* Identifier */: - case 81 /* PrivateIdentifier */: - case 106 /* NullKeyword */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 11 /* StringLiteral */: - case 210 /* ArrayLiteralExpression */: - case 211 /* ObjectLiteralExpression */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 232 /* ClassExpression */: - case 14 /* RegularExpressionLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 229 /* TemplateExpression */: - case 218 /* ParenthesizedExpression */: - case 233 /* OmittedExpression */: - case 285 /* JsxElement */: - case 286 /* JsxSelfClosingElement */: - case 289 /* JsxFragment */: - return 20 /* Primary */; - default: - return -1 /* Invalid */; - } -} -function getBinaryOperatorPrecedence(kind) { - switch (kind) { - case 61 /* QuestionQuestionToken */: - return 5 /* Coalesce */; - case 57 /* BarBarToken */: - return 5 /* LogicalOR */; - case 56 /* AmpersandAmpersandToken */: - return 6 /* LogicalAND */; - case 52 /* BarToken */: - return 7 /* BitwiseOR */; - case 53 /* CaretToken */: - return 8 /* BitwiseXOR */; - case 51 /* AmpersandToken */: - return 9 /* BitwiseAND */; - case 35 /* EqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - case 37 /* EqualsEqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - return 10 /* Equality */; - case 30 /* LessThanToken */: - case 32 /* GreaterThanToken */: - case 33 /* LessThanEqualsToken */: - case 34 /* GreaterThanEqualsToken */: - case 104 /* InstanceOfKeyword */: - case 103 /* InKeyword */: - case 130 /* AsKeyword */: - case 152 /* SatisfiesKeyword */: - return 11 /* Relational */; - case 48 /* LessThanLessThanToken */: - case 49 /* GreaterThanGreaterThanToken */: - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - return 12 /* Shift */; - case 40 /* PlusToken */: - case 41 /* MinusToken */: - return 13 /* Additive */; - case 42 /* AsteriskToken */: - case 44 /* SlashToken */: - case 45 /* PercentToken */: - return 14 /* Multiplicative */; - case 43 /* AsteriskAsteriskToken */: - return 15 /* Exponentiation */; - } - return -1; -} -function getSemanticJsxChildren(children) { - return filter(children, (i) => { - switch (i.kind) { - case 295 /* JsxExpression */: - return !!i.expression; - case 12 /* JsxText */: - return !i.containsOnlyTriviaWhiteSpaces; - default: - return true; - } - }); -} -function createDiagnosticCollection() { - let nonFileDiagnostics = []; - const filesWithDiagnostics = []; - const fileDiagnostics = /* @__PURE__ */ new Map(); - let hasReadNonFileDiagnostics = false; - return { - add, - lookup, - getGlobalDiagnostics, - getDiagnostics: getDiagnostics2 - }; - function lookup(diagnostic) { - let diagnostics; - if (diagnostic.file) { - diagnostics = fileDiagnostics.get(diagnostic.file.fileName); - } else { - diagnostics = nonFileDiagnostics; - } - if (!diagnostics) { - return void 0; - } - const result = binarySearch(diagnostics, diagnostic, identity, compareDiagnosticsSkipRelatedInformation); - if (result >= 0) { - return diagnostics[result]; - } - if (~result > 0 && diagnosticsEqualityComparer(diagnostic, diagnostics[~result - 1])) { - return diagnostics[~result - 1]; - } - return void 0; - } - function add(diagnostic) { - let diagnostics; - if (diagnostic.file) { - diagnostics = fileDiagnostics.get(diagnostic.file.fileName); - if (!diagnostics) { - diagnostics = []; - fileDiagnostics.set(diagnostic.file.fileName, diagnostics); - insertSorted(filesWithDiagnostics, diagnostic.file.fileName, compareStringsCaseSensitive); - } - } else { - if (hasReadNonFileDiagnostics) { - hasReadNonFileDiagnostics = false; - nonFileDiagnostics = nonFileDiagnostics.slice(); - } - diagnostics = nonFileDiagnostics; - } - insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation, diagnosticsEqualityComparer); - } - function getGlobalDiagnostics() { - hasReadNonFileDiagnostics = true; - return nonFileDiagnostics; - } - function getDiagnostics2(fileName) { - if (fileName) { - return fileDiagnostics.get(fileName) || []; - } - const fileDiags = flatMapToMutable(filesWithDiagnostics, (f) => fileDiagnostics.get(f)); - if (!nonFileDiagnostics.length) { - return fileDiags; - } - fileDiags.unshift(...nonFileDiagnostics); - return fileDiags; - } -} -var templateSubstitutionRegExp = /\$\{/g; -function escapeTemplateSubstitution(str) { - return str.replace(templateSubstitutionRegExp, "\\${"); -} -function containsInvalidEscapeFlag(node) { - return !!((node.templateFlags || 0) & 2048 /* ContainsInvalidEscape */); -} -function hasInvalidEscape(template) { - return template && !!(isNoSubstitutionTemplateLiteral(template) ? containsInvalidEscapeFlag(template) : containsInvalidEscapeFlag(template.head) || some(template.templateSpans, (span) => containsInvalidEscapeFlag(span.literal))); -} -var doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\u2028\u2029\u0085]/g; -var singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\u2028\u2029\u0085]/g; -var backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u0009\u000b-\u001f\u2028\u2029\u0085]/g; -var escapedCharsMap = new Map(Object.entries({ - " ": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - '"': '\\"', - "'": "\\'", - "`": "\\`", - "\u2028": "\\u2028", - // lineSeparator - "\u2029": "\\u2029", - // paragraphSeparator - "\x85": "\\u0085", - // nextLine - "\r\n": "\\r\\n" - // special case for CRLFs in backticks -})); -function encodeUtf16EscapeSequence(charCode) { - const hexCharCode = charCode.toString(16).toUpperCase(); - const paddedHexCode = ("0000" + hexCharCode).slice(-4); - return "\\u" + paddedHexCode; -} -function getReplacement(c, offset, input) { - if (c.charCodeAt(0) === 0 /* nullCharacter */) { - const lookAhead = input.charCodeAt(offset + c.length); - if (lookAhead >= 48 /* _0 */ && lookAhead <= 57 /* _9 */) { - return "\\x00"; - } - return "\\0"; - } - return escapedCharsMap.get(c) || encodeUtf16EscapeSequence(c.charCodeAt(0)); -} -function escapeString(s, quoteChar) { - const escapedCharsRegExp = quoteChar === 96 /* backtick */ ? backtickQuoteEscapedCharsRegExp : quoteChar === 39 /* singleQuote */ ? singleQuoteEscapedCharsRegExp : doubleQuoteEscapedCharsRegExp; - return s.replace(escapedCharsRegExp, getReplacement); -} -var nonAsciiCharacters = /[^\u0000-\u007F]/g; -function escapeNonAsciiString(s, quoteChar) { - s = escapeString(s, quoteChar); - return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s; -} -var jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g; -var jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g; -var jsxEscapedCharsMap = new Map(Object.entries({ - '"': """, - "'": "'" -})); -function encodeJsxCharacterEntity(charCode) { - const hexCharCode = charCode.toString(16).toUpperCase(); - return "&#x" + hexCharCode + ";"; -} -function getJsxAttributeStringReplacement(c) { - if (c.charCodeAt(0) === 0 /* nullCharacter */) { - return "�"; - } - return jsxEscapedCharsMap.get(c) || encodeJsxCharacterEntity(c.charCodeAt(0)); -} -function escapeJsxAttributeString(s, quoteChar) { - const escapedCharsRegExp = quoteChar === 39 /* singleQuote */ ? jsxSingleQuoteEscapedCharsRegExp : jsxDoubleQuoteEscapedCharsRegExp; - return s.replace(escapedCharsRegExp, getJsxAttributeStringReplacement); -} -function stripQuotes(name) { - const length2 = name.length; - if (length2 >= 2 && name.charCodeAt(0) === name.charCodeAt(length2 - 1) && isQuoteOrBacktick(name.charCodeAt(0))) { - return name.substring(1, length2 - 1); - } - return name; -} -function isQuoteOrBacktick(charCode) { - return charCode === 39 /* singleQuote */ || charCode === 34 /* doubleQuote */ || charCode === 96 /* backtick */; -} -function isIntrinsicJsxName(name) { - const ch = name.charCodeAt(0); - return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-"); -} -var indentStrings = ["", " "]; -function getIndentString(level) { - const singleLevel = indentStrings[1]; - for (let current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); - } - return indentStrings[level]; -} -function getIndentSize() { - return indentStrings[1].length; -} -function createTextWriter(newLine) { - var output; - var indent3; - var lineStart; - var lineCount; - var linePos; - var hasTrailingComment = false; - function updateLineCountAndPosFor(s) { - const lineStartsOfS = computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + last(lineStartsOfS); - lineStart = linePos - output.length === 0; - } else { - lineStart = false; - } - } - function writeText(s) { - if (s && s.length) { - if (lineStart) { - s = getIndentString(indent3) + s; - lineStart = false; - } - output += s; - updateLineCountAndPosFor(s); - } - } - function write(s) { - if (s) hasTrailingComment = false; - writeText(s); - } - function writeComment(s) { - if (s) hasTrailingComment = true; - writeText(s); - } - function reset2() { - output = ""; - indent3 = 0; - lineStart = true; - lineCount = 0; - linePos = 0; - hasTrailingComment = false; - } - function rawWrite(s) { - if (s !== void 0) { - output += s; - updateLineCountAndPosFor(s); - hasTrailingComment = false; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - } - } - function writeLine(force) { - if (!lineStart || force) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - hasTrailingComment = false; - } - } - reset2(); - return { - write, - rawWrite, - writeLiteral, - writeLine, - increaseIndent: () => { - indent3++; - }, - decreaseIndent: () => { - indent3--; - }, - getIndent: () => indent3, - getTextPos: () => output.length, - getLine: () => lineCount, - getColumn: () => lineStart ? indent3 * getIndentSize() : output.length - linePos, - getText: () => output, - isAtStartOfLine: () => lineStart, - hasTrailingComment: () => hasTrailingComment, - hasTrailingWhitespace: () => !!output.length && isWhiteSpaceLike(output.charCodeAt(output.length - 1)), - clear: reset2, - writeKeyword: write, - writeOperator: write, - writeParameter: write, - writeProperty: write, - writePunctuation: write, - writeSpace: write, - writeStringLiteral: write, - writeSymbol: (s, _) => write(s), - writeTrailingSemicolon: write, - writeComment - }; -} -function getTrailingSemicolonDeferringWriter(writer) { - let pendingTrailingSemicolon = false; - function commitPendingTrailingSemicolon() { - if (pendingTrailingSemicolon) { - writer.writeTrailingSemicolon(";"); - pendingTrailingSemicolon = false; - } - } - return { - ...writer, - writeTrailingSemicolon() { - pendingTrailingSemicolon = true; - }, - writeLiteral(s) { - commitPendingTrailingSemicolon(); - writer.writeLiteral(s); - }, - writeStringLiteral(s) { - commitPendingTrailingSemicolon(); - writer.writeStringLiteral(s); - }, - writeSymbol(s, sym) { - commitPendingTrailingSemicolon(); - writer.writeSymbol(s, sym); - }, - writePunctuation(s) { - commitPendingTrailingSemicolon(); - writer.writePunctuation(s); - }, - writeKeyword(s) { - commitPendingTrailingSemicolon(); - writer.writeKeyword(s); - }, - writeOperator(s) { - commitPendingTrailingSemicolon(); - writer.writeOperator(s); - }, - writeParameter(s) { - commitPendingTrailingSemicolon(); - writer.writeParameter(s); - }, - writeSpace(s) { - commitPendingTrailingSemicolon(); - writer.writeSpace(s); - }, - writeProperty(s) { - commitPendingTrailingSemicolon(); - writer.writeProperty(s); - }, - writeComment(s) { - commitPendingTrailingSemicolon(); - writer.writeComment(s); - }, - writeLine() { - commitPendingTrailingSemicolon(); - writer.writeLine(); - }, - increaseIndent() { - commitPendingTrailingSemicolon(); - writer.increaseIndent(); - }, - decreaseIndent() { - commitPendingTrailingSemicolon(); - writer.decreaseIndent(); - } - }; -} -function hostUsesCaseSensitiveFileNames(host) { - return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false; -} -function hostGetCanonicalFileName(host) { - return createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(host)); -} -function getResolvedExternalModuleName(host, file, referenceFile) { - return file.moduleName || getExternalModuleNameFromPath(host, file.fileName, referenceFile && referenceFile.fileName); -} -function getCanonicalAbsolutePath(host, path) { - return host.getCanonicalFileName(getNormalizedAbsolutePath(path, host.getCurrentDirectory())); -} -function getExternalModuleNameFromDeclaration(host, resolver, declaration) { - const file = resolver.getExternalModuleFileFromDeclaration(declaration); - if (!file || file.isDeclarationFile) { - return void 0; - } - const specifier = getExternalModuleName(declaration); - if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) { - return void 0; - } - return getResolvedExternalModuleName(host, file); -} -function getExternalModuleNameFromPath(host, fileName, referencePath) { - const getCanonicalFileName = (f) => host.getCanonicalFileName(f); - const dir = toPath(referencePath ? getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); - const filePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); - const relativePath = getRelativePathToDirectoryOrUrl( - dir, - filePath, - dir, - getCanonicalFileName, - /*isAbsolutePathAnUrl*/ - false - ); - const extensionless = removeFileExtension(relativePath); - return referencePath ? ensurePathIsNonModuleName(extensionless) : extensionless; -} -function getOwnEmitOutputFilePath(fileName, host, extension) { - const compilerOptions = host.getCompilerOptions(); - let emitOutputFilePathWithoutExtension; - if (compilerOptions.outDir) { - emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(fileName, host, compilerOptions.outDir)); - } else { - emitOutputFilePathWithoutExtension = removeFileExtension(fileName); - } - return emitOutputFilePathWithoutExtension + extension; -} -function getDeclarationEmitOutputFilePath(fileName, host) { - return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host); -} -function getDeclarationEmitOutputFilePathWorker(fileName, options, host) { - const outputDir = options.declarationDir || options.outDir; - const path = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir, host.getCurrentDirectory(), host.getCommonSourceDirectory(), (f) => host.getCanonicalFileName(f)) : fileName; - const declarationExtension = getDeclarationEmitExtensionForPath(path); - return removeFileExtension(path) + declarationExtension; -} -function getDeclarationEmitExtensionForPath(path) { - return fileExtensionIsOneOf(path, [".mjs" /* Mjs */, ".mts" /* Mts */]) ? ".d.mts" /* Dmts */ : fileExtensionIsOneOf(path, [".cjs" /* Cjs */, ".cts" /* Cts */]) ? ".d.cts" /* Dcts */ : fileExtensionIsOneOf(path, [".json" /* Json */]) ? `.d.json.ts` : ( - // Drive-by redefinition of json declaration file output name so if it's ever enabled, it behaves well - ".d.ts" /* Dts */ - ); -} -function getPossibleOriginalInputExtensionForExtension(path) { - return fileExtensionIsOneOf(path, [".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".mts" /* Mts */]) ? [".mts" /* Mts */, ".mjs" /* Mjs */] : fileExtensionIsOneOf(path, [".d.cts" /* Dcts */, ".cjs" /* Cjs */, ".cts" /* Cts */]) ? [".cts" /* Cts */, ".cjs" /* Cjs */] : fileExtensionIsOneOf(path, [`.d.json.ts`]) ? [".json" /* Json */] : [".tsx" /* Tsx */, ".ts" /* Ts */, ".jsx" /* Jsx */, ".js" /* Js */]; -} -function getPossibleOriginalInputPathWithoutChangingExt(filePath, ignoreCase, outputDir, getCommonSourceDirectory2) { - return outputDir ? resolvePath( - getCommonSourceDirectory2(), - getRelativePathFromDirectory(outputDir, filePath, ignoreCase) - ) : filePath; -} -function getPathsBasePath(options, host) { - var _a; - if (!options.paths) return void 0; - return options.baseUrl ?? Debug.checkDefined(options.pathsBasePath || ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); -} -function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) { - const options = host.getCompilerOptions(); - if (options.outFile) { - const moduleKind = getEmitModuleKind(options); - const moduleEmitEnabled = options.emitDeclarationOnly || moduleKind === 2 /* AMD */ || moduleKind === 4 /* System */; - return filter( - host.getSourceFiles(), - (sourceFile) => (moduleEmitEnabled || !isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) - ); - } else { - const sourceFiles = targetSourceFile === void 0 ? host.getSourceFiles() : [targetSourceFile]; - return filter( - sourceFiles, - (sourceFile) => sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) - ); - } -} -function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) { - const options = host.getCompilerOptions(); - 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.getRedirectFromSourceFile(sourceFile.fileName)) return false; - if (options.outFile) 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)); -} -function getSourceFilePathInNewDirWorker(fileName, newDirPath, currentDirectory, commonSourceDirectory, getCanonicalFileName) { - let sourceFilePath = getNormalizedAbsolutePath(fileName, currentDirectory); - const isSourceFileInCommonSourceDirectory = getCanonicalFileName(sourceFilePath).indexOf(getCanonicalFileName(commonSourceDirectory)) === 0; - sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath; - 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 - ); -} -function ensureDirectoriesExist(directoryPath, createDirectory, directoryExists) { - if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { - const parentDirectory = getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory, createDirectory, directoryExists); - createDirectory(directoryPath); - } -} -function writeFileEnsuringDirectories(path, data, writeByteOrderMark, writeFile2, createDirectory, directoryExists) { - try { - writeFile2(path, data, writeByteOrderMark); - } catch { - ensureDirectoriesExist(getDirectoryPath(normalizePath(path)), createDirectory, directoryExists); - writeFile2(path, data, writeByteOrderMark); - } -} -function getLineOfLocalPosition(sourceFile, pos) { - const lineStarts = getLineStarts(sourceFile); - return computeLineOfPosition(lineStarts, pos); -} -function getLineOfLocalPositionFromLineMap(lineMap, pos) { - return computeLineOfPosition(lineMap, pos); -} -function getFirstConstructorWithBody(node) { - return find(node.members, (member) => isConstructorDeclaration(member) && nodeIsPresent(member.body)); -} -function getSetAccessorValueParameter(accessor) { - if (accessor && accessor.parameters.length > 0) { - const hasThis = accessor.parameters.length === 2 && parameterIsThisKeyword(accessor.parameters[0]); - return accessor.parameters[hasThis ? 1 : 0]; - } -} -function getSetAccessorTypeAnnotationNode(accessor) { - const parameter = getSetAccessorValueParameter(accessor); - return parameter && parameter.type; -} -function getThisParameter(signature) { - if (signature.parameters.length && !isJSDocSignature(signature)) { - const thisParameter = signature.parameters[0]; - if (parameterIsThisKeyword(thisParameter)) { - return thisParameter; - } - } -} -function parameterIsThisKeyword(parameter) { - return isThisIdentifier(parameter.name); -} -function isThisIdentifier(node) { - return !!node && node.kind === 80 /* Identifier */ && identifierIsThisKeyword(node); -} -function isInTypeQuery(node) { - return !!findAncestor( - node, - (n) => n.kind === 187 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 167 /* QualifiedName */ ? false : "quit" - ); -} -function isThisInTypeQuery(node) { - if (!isThisIdentifier(node)) { - return false; - } - while (isQualifiedName(node.parent) && node.parent.left === node) { - node = node.parent; - } - return node.parent.kind === 187 /* TypeQuery */; -} -function identifierIsThisKeyword(id) { - return id.escapedText === "this"; -} -function getAllAccessorDeclarations(declarations, accessor) { - let firstAccessor; - let secondAccessor; - let getAccessor; - let setAccessor; - if (hasDynamicName(accessor)) { - firstAccessor = accessor; - if (accessor.kind === 178 /* GetAccessor */) { - getAccessor = accessor; - } else if (accessor.kind === 179 /* SetAccessor */) { - setAccessor = accessor; - } else { - Debug.fail("Accessor has wrong kind"); - } - } else { - forEach(declarations, (member) => { - if (isAccessor(member) && isStatic(member) === isStatic(accessor)) { - const memberName = getPropertyNameForPropertyNameNode(member.name); - const accessorName = getPropertyNameForPropertyNameNode(accessor.name); - if (memberName === accessorName) { - if (!firstAccessor) { - firstAccessor = member; - } else if (!secondAccessor) { - secondAccessor = member; - } - if (member.kind === 178 /* GetAccessor */ && !getAccessor) { - getAccessor = member; - } - if (member.kind === 179 /* SetAccessor */ && !setAccessor) { - setAccessor = member; - } - } - } - }); - } - return { - firstAccessor, - secondAccessor, - getAccessor, - setAccessor - }; -} -function getEffectiveTypeAnnotationNode(node) { - if (!isInJSFile(node) && isFunctionDeclaration(node)) return void 0; - if (isTypeAliasDeclaration(node)) return void 0; - const type = node.type; - if (type || !isInJSFile(node)) return type; - return isJSDocPropertyLikeTag(node) ? node.typeExpression && node.typeExpression.type : getJSDocType(node); -} -function getTypeAnnotationNode(node) { - return node.type; -} -function getEffectiveReturnTypeNode(node) { - return isJSDocSignature(node) ? node.type && node.type.typeExpression && node.type.typeExpression.type : node.type || (isInJSFile(node) ? getJSDocReturnType(node) : void 0); -} -function getJSDocTypeParameterDeclarations(node) { - return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0); -} -function isNonTypeAliasTemplate(tag) { - return isJSDocTemplateTag(tag) && !(tag.parent.kind === 321 /* JSDoc */ && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); -} -function getEffectiveSetAccessorTypeAnnotationNode(node) { - const parameter = getSetAccessorValueParameter(node); - return parameter && getEffectiveTypeAnnotationNode(parameter); -} -function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { - emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); -} -function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { - if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { - writer.writeLine(); - } -} -function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { - if (pos !== commentPos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { - writer.writeLine(); - } -} -function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { - if (comments && comments.length > 0) { - if (leadingSeparator) { - writer.writeSpace(" "); - } - let emitInterveningSeparator = false; - for (const comment of comments) { - if (emitInterveningSeparator) { - writer.writeSpace(" "); - emitInterveningSeparator = false; - } - writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } else { - emitInterveningSeparator = true; - } - } - if (emitInterveningSeparator && trailingSeparator) { - writer.writeSpace(" "); - } - } -} -function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { - let leadingComments; - let currentDetachedCommentInfo; - if (removeComments) { - if (node.pos === 0) { - leadingComments = filter(getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); - } - } else { - leadingComments = getLeadingCommentRanges(text, node.pos); - } - if (leadingComments) { - const detachedComments = []; - let lastComment; - for (const comment of leadingComments) { - if (lastComment) { - const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); - const commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); - if (commentLine >= lastCommentLine + 2) { - break; - } - } - detachedComments.push(comment); - lastComment = comment; - } - if (detachedComments.length) { - const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, last(detachedComments).end); - const nodeLine = getLineOfLocalPositionFromLineMap(lineMap, skipTrivia(text, node.pos)); - if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); - emitComments( - text, - lineMap, - writer, - detachedComments, - /*leadingSeparator*/ - false, - /*trailingSeparator*/ - true, - newLine, - writeComment - ); - currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: last(detachedComments).end }; - } - } - } - return currentDetachedCommentInfo; - function isPinnedCommentLocal(comment) { - return isPinnedComment(text, comment.pos); - } -} -function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { - if (text.charCodeAt(commentPos + 1) === 42 /* asterisk */) { - const firstCommentLineAndCharacter = computeLineAndCharacterOfPosition(lineMap, commentPos); - const lineCount = lineMap.length; - let firstCommentLineIndent; - for (let pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { - const nextLineStart = currentLine + 1 === lineCount ? text.length + 1 : lineMap[currentLine + 1]; - if (pos !== commentPos) { - if (firstCommentLineIndent === void 0) { - firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); - } - const currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - const spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); - if (spacesToEmit > 0) { - let numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - const indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); - pos = nextLineStart; - } - } else { - writer.writeComment(text.substring(commentPos, commentEnd)); - } -} -function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { - const end = Math.min(commentEnd, nextLineStart - 1); - const currentLineText = text.substring(pos, end).trim(); - if (currentLineText) { - writer.writeComment(currentLineText); - if (end !== commentEnd) { - writer.writeLine(); - } - } else { - writer.rawWrite(newLine); - } -} -function calculateIndent(text, pos, end) { - let currentLineIndent = 0; - for (; pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { - if (text.charCodeAt(pos) === 9 /* tab */) { - currentLineIndent += getIndentSize() - currentLineIndent % getIndentSize(); - } else { - currentLineIndent++; - } - } - return currentLineIndent; -} -function hasEffectiveModifiers(node) { - return getEffectiveModifierFlags(node) !== 0 /* None */; -} -function hasSyntacticModifiers(node) { - return getSyntacticModifierFlags(node) !== 0 /* None */; -} -function hasEffectiveModifier(node, flags) { - return !!getSelectedEffectiveModifierFlags(node, flags); -} -function hasSyntacticModifier(node, flags) { - return !!getSelectedSyntacticModifierFlags(node, flags); -} -function isStatic(node) { - return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node); -} -function hasStaticModifier(node) { - return hasSyntacticModifier(node, 256 /* Static */); -} -function hasOverrideModifier(node) { - return hasEffectiveModifier(node, 16 /* Override */); -} -function hasAbstractModifier(node) { - return hasSyntacticModifier(node, 64 /* Abstract */); -} -function hasAmbientModifier(node) { - return hasSyntacticModifier(node, 128 /* Ambient */); -} -function hasAccessorModifier(node) { - return hasSyntacticModifier(node, 512 /* Accessor */); -} -function hasEffectiveReadonlyModifier(node) { - return hasEffectiveModifier(node, 8 /* Readonly */); -} -function hasDecorators(node) { - return hasSyntacticModifier(node, 32768 /* Decorator */); -} -function getSelectedEffectiveModifierFlags(node, flags) { - return getEffectiveModifierFlags(node) & flags; -} -function getSelectedSyntacticModifierFlags(node, flags) { - return getSyntacticModifierFlags(node) & flags; -} -function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 166 /* LastToken */) { - return 0 /* None */; - } - if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { - node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */; - } - if (alwaysIncludeJSDoc || includeJSDoc && isInJSFile(node)) { - if (!(node.modifierFlagsCache & 268435456 /* HasComputedJSDocModifiers */) && node.parent) { - node.modifierFlagsCache |= getRawJSDocModifierFlagsNoCache(node) | 268435456 /* HasComputedJSDocModifiers */; - } - return selectEffectiveModifierFlags(node.modifierFlagsCache); - } - return selectSyntacticModifierFlags(node.modifierFlagsCache); -} -function getEffectiveModifierFlags(node) { - return getModifierFlagsWorker( - node, - /*includeJSDoc*/ - true - ); -} -function getEffectiveModifierFlagsAlwaysIncludeJSDoc(node) { - return getModifierFlagsWorker( - node, - /*includeJSDoc*/ - true, - /*alwaysIncludeJSDoc*/ - true - ); -} -function getSyntacticModifierFlags(node) { - return getModifierFlagsWorker( - node, - /*includeJSDoc*/ - false - ); -} -function getRawJSDocModifierFlagsNoCache(node) { - let flags = 0 /* None */; - if (!!node.parent && !isParameter(node)) { - if (isInJSFile(node)) { - if (getJSDocPublicTagNoCache(node)) flags |= 8388608 /* JSDocPublic */; - if (getJSDocPrivateTagNoCache(node)) flags |= 16777216 /* JSDocPrivate */; - if (getJSDocProtectedTagNoCache(node)) flags |= 33554432 /* JSDocProtected */; - if (getJSDocReadonlyTagNoCache(node)) flags |= 67108864 /* JSDocReadonly */; - if (getJSDocOverrideTagNoCache(node)) flags |= 134217728 /* JSDocOverride */; - } - if (getJSDocDeprecatedTagNoCache(node)) 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 & 8 /* NestedNamespace */ || node.kind === 80 /* Identifier */ && node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { - flags |= 32 /* Export */; - } - return flags; -} -function modifiersToFlags(modifiers) { - let flags = 0 /* None */; - if (modifiers) { - for (const modifier of modifiers) { - flags |= modifierToFlag(modifier.kind); - } - } - return flags; -} -function modifierToFlag(token) { - switch (token) { - case 126 /* StaticKeyword */: - return 256 /* Static */; - case 125 /* PublicKeyword */: - return 1 /* Public */; - case 124 /* ProtectedKeyword */: - return 4 /* Protected */; - case 123 /* PrivateKeyword */: - return 2 /* Private */; - case 128 /* AbstractKeyword */: - return 64 /* Abstract */; - case 129 /* AccessorKeyword */: - return 512 /* Accessor */; - case 95 /* ExportKeyword */: - return 32 /* Export */; - case 138 /* DeclareKeyword */: - return 128 /* Ambient */; - case 87 /* ConstKeyword */: - return 4096 /* Const */; - case 90 /* DefaultKeyword */: - return 2048 /* Default */; - case 134 /* AsyncKeyword */: - return 1024 /* Async */; - case 148 /* ReadonlyKeyword */: - return 8 /* Readonly */; - case 164 /* OverrideKeyword */: - return 16 /* Override */; - case 103 /* InKeyword */: - return 8192 /* In */; - case 147 /* OutKeyword */: - return 16384 /* Out */; - case 171 /* Decorator */: - return 32768 /* Decorator */; - } - return 0 /* None */; -} -function isBinaryLogicalOperator(token) { - return token === 57 /* BarBarToken */ || token === 56 /* AmpersandAmpersandToken */; -} -function isLogicalOperator(token) { - return isBinaryLogicalOperator(token) || token === 54 /* ExclamationToken */; -} -function isLogicalOrCoalescingAssignmentOperator(token) { - return token === 76 /* BarBarEqualsToken */ || token === 77 /* AmpersandAmpersandEqualsToken */ || token === 78 /* QuestionQuestionEqualsToken */; -} -function isLogicalOrCoalescingAssignmentExpression(expr) { - return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); -} -function isLogicalOrCoalescingBinaryOperator(token) { - return isBinaryLogicalOperator(token) || token === 61 /* QuestionQuestionToken */; -} -function isLogicalOrCoalescingBinaryExpression(expr) { - return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind); -} -function isAssignmentOperator(token) { - return token >= 64 /* FirstAssignment */ && token <= 79 /* LastAssignment */; -} -function tryGetClassExtendingExpressionWithTypeArguments(node) { - const cls = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); - return cls && !cls.isImplements ? cls.class : void 0; -} -function tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node) { - if (isExpressionWithTypeArguments(node)) { - if (isHeritageClause(node.parent) && isClassLike(node.parent.parent)) { - return { class: node.parent.parent, isImplements: node.parent.token === 119 /* ImplementsKeyword */ }; - } - if (isJSDocAugmentsTag(node.parent)) { - const host = getEffectiveJSDocHost(node.parent); - if (host && isClassLike(host)) { - return { class: host, isImplements: false }; - } - } - } - return void 0; -} -function isAssignmentExpression(node, excludeCompoundAssignment) { - return isBinaryExpression(node) && (excludeCompoundAssignment ? node.operatorToken.kind === 64 /* EqualsToken */ : isAssignmentOperator(node.operatorToken.kind)) && isLeftHandSideExpression(node.left); -} -function isDestructuringAssignment(node) { - if (isAssignmentExpression( - node, - /*excludeCompoundAssignment*/ - true - )) { - const kind = node.left.kind; - return kind === 211 /* ObjectLiteralExpression */ || kind === 210 /* ArrayLiteralExpression */; - } - return false; -} -function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return tryGetClassExtendingExpressionWithTypeArguments(node) !== void 0; -} -function isEntityNameExpression(node) { - return node.kind === 80 /* Identifier */ || isPropertyAccessEntityNameExpression(node); -} -function getFirstIdentifier(node) { - switch (node.kind) { - case 80 /* Identifier */: - return node; - case 167 /* QualifiedName */: - do { - node = node.left; - } while (node.kind !== 80 /* Identifier */); - return node; - case 212 /* PropertyAccessExpression */: - do { - node = node.expression; - } while (node.kind !== 80 /* Identifier */); - return node; - } -} -function isDottedName(node) { - return node.kind === 80 /* Identifier */ || node.kind === 110 /* ThisKeyword */ || node.kind === 108 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 212 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 218 /* ParenthesizedExpression */ && isDottedName(node.expression); -} -function isPropertyAccessEntityNameExpression(node) { - return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression); -} -function tryGetPropertyAccessOrIdentifierToString(expr) { - if (isPropertyAccessExpression(expr)) { - const baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); - if (baseStr !== void 0) { - return baseStr + "." + entityNameToString(expr.name); - } - } else if (isElementAccessExpression(expr)) { - const baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); - if (baseStr !== void 0 && isPropertyName(expr.argumentExpression)) { - return baseStr + "." + getPropertyNameForPropertyNameNode(expr.argumentExpression); - } - } else if (isIdentifier(expr)) { - return unescapeLeadingUnderscores(expr.escapedText); - } else if (isJsxNamespacedName(expr)) { - return getTextOfJsxNamespacedName(expr); - } - return void 0; -} -function isPrototypeAccess(node) { - return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype"; -} -function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return node.parent.kind === 167 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 237 /* MetaProperty */ && node.parent.name === node; -} -function isRightSideOfAccessExpression(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 === 211 /* ObjectLiteralExpression */ && expression.properties.length === 0; -} -function isEmptyArrayLiteral(expression) { - return expression.kind === 210 /* ArrayLiteralExpression */ && expression.elements.length === 0; -} -function getLocalSymbolForExportDefault(symbol) { - if (!isExportDefaultSymbol(symbol) || !symbol.declarations) return void 0; - for (const decl of symbol.declarations) { - if (decl.localSymbol) return decl.localSymbol; - } - return void 0; -} -function isExportDefaultSymbol(symbol) { - return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 2048 /* Default */); -} -function tryExtractTSExtension(fileName) { - return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension)); -} -function getExpandedCharCodes(input) { - const output = []; - const length2 = input.length; - for (let i = 0; i < length2; i++) { - const charCode = input.charCodeAt(i); - if (charCode < 128) { - output.push(charCode); - } else if (charCode < 2048) { - output.push(charCode >> 6 | 192); - output.push(charCode & 63 | 128); - } else if (charCode < 65536) { - output.push(charCode >> 12 | 224); - output.push(charCode >> 6 & 63 | 128); - output.push(charCode & 63 | 128); - } else if (charCode < 131072) { - output.push(charCode >> 18 | 240); - output.push(charCode >> 12 & 63 | 128); - output.push(charCode >> 6 & 63 | 128); - output.push(charCode & 63 | 128); - } else { - Debug.assert(false, "Unexpected code point"); - } - } - return output; -} -var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; -function convertToBase64(input) { - let result = ""; - const charCodes = getExpandedCharCodes(input); - let i = 0; - const length2 = charCodes.length; - let byte1, byte2, byte3, byte4; - while (i < length2) { - byte1 = charCodes[i] >> 2; - byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; - byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; - byte4 = charCodes[i + 2] & 63; - if (i + 1 >= length2) { - byte3 = byte4 = 64; - } else if (i + 2 >= length2) { - byte4 = 64; - } - result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); - i += 3; - } - return result; -} -function getStringFromExpandedCharCodes(codes) { - let output = ""; - let i = 0; - const length2 = codes.length; - while (i < length2) { - const charCode = codes[i]; - if (charCode < 128) { - output += String.fromCharCode(charCode); - i++; - } else if ((charCode & 192) === 192) { - let value = charCode & 63; - i++; - let nextCode = codes[i]; - while ((nextCode & 192) === 128) { - value = value << 6 | nextCode & 63; - i++; - nextCode = codes[i]; - } - output += String.fromCharCode(value); - } else { - output += String.fromCharCode(charCode); - i++; - } - } - return output; -} -function base64encode(host, input) { - if (host && host.base64encode) { - return host.base64encode(input); - } - return convertToBase64(input); -} -function base64decode(host, input) { - if (host && host.base64decode) { - return host.base64decode(input); - } - const length2 = input.length; - const expandedCharCodes = []; - let i = 0; - while (i < length2) { - if (input.charCodeAt(i) === base64Digits.charCodeAt(64)) { - break; - } - const ch1 = base64Digits.indexOf(input[i]); - const ch2 = base64Digits.indexOf(input[i + 1]); - const ch3 = base64Digits.indexOf(input[i + 2]); - const ch4 = base64Digits.indexOf(input[i + 3]); - const code1 = (ch1 & 63) << 2 | ch2 >> 4 & 3; - const code2 = (ch2 & 15) << 4 | ch3 >> 2 & 15; - const code3 = (ch3 & 3) << 6 | ch4 & 63; - if (code2 === 0 && ch3 !== 0) { - expandedCharCodes.push(code1); - } else if (code3 === 0 && ch4 !== 0) { - expandedCharCodes.push(code1, code2); - } else { - expandedCharCodes.push(code1, code2, code3); - } - i += 4; - } - return getStringFromExpandedCharCodes(expandedCharCodes); -} -function readJsonOrUndefined(path, hostOrText) { - const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path); - if (!jsonText) return void 0; - let result = tryParseJson(jsonText); - if (result === void 0) { - const looseResult = parseConfigFileTextToJson(path, jsonText); - if (!looseResult.error) { - result = looseResult.config; - } - } - return result; -} -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); -} -var carriageReturnLineFeed = "\r\n"; -var lineFeed = "\n"; -function getNewLineCharacter(options) { - switch (options.newLine) { - case 0 /* CarriageReturnLineFeed */: - return carriageReturnLineFeed; - case 1 /* LineFeed */: - case void 0: - return lineFeed; - } -} -function createRange(pos, end = pos) { - Debug.assert(end >= pos || end === -1); - return { pos, end }; -} -function moveRangeEnd(range, end) { - return createRange(range.pos, end); -} -function moveRangePos(range, pos) { - return createRange(pos, range.end); -} -function moveRangePastDecorators(node) { - const lastDecorator = canHaveModifiers(node) ? findLast(node.modifiers, isDecorator) : void 0; - return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; -} -function moveRangePastModifiers(node) { - if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { - return moveRangePos(node, node.name.pos); - } - const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; - return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); -} -function createTokenRange(pos, token) { - return createRange(pos, pos + tokenToString(token).length); -} -function rangeIsOnSingleLine(range, sourceFile) { - return rangeStartIsOnSameLineAsRangeEnd(range, range, sourceFile); -} -function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { - return positionsAreOnSameLine( - getStartPositionOfRange( - range1, - sourceFile, - /*includeComments*/ - false - ), - getStartPositionOfRange( - range2, - sourceFile, - /*includeComments*/ - false - ), - sourceFile - ); -} -function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { - return positionsAreOnSameLine(range1.end, range2.end, sourceFile); -} -function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { - return positionsAreOnSameLine(getStartPositionOfRange( - range1, - sourceFile, - /*includeComments*/ - false - ), range2.end, sourceFile); -} -function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { - return positionsAreOnSameLine(range1.end, getStartPositionOfRange( - range2, - sourceFile, - /*includeComments*/ - false - ), sourceFile); -} -function getLinesBetweenRangeEndAndRangeStart(range1, range2, sourceFile, includeSecondRangeComments) { - const range2Start = getStartPositionOfRange(range2, sourceFile, includeSecondRangeComments); - return getLinesBetweenPositions(sourceFile, range1.end, range2Start); -} -function getLinesBetweenRangeEndPositions(range1, range2, sourceFile) { - return getLinesBetweenPositions(sourceFile, range1.end, range2.end); -} -function isNodeArrayMultiLine(list, sourceFile) { - return !positionsAreOnSameLine(list.pos, list.end, sourceFile); -} -function positionsAreOnSameLine(pos1, pos2, sourceFile) { - return getLinesBetweenPositions(sourceFile, pos1, pos2) === 0; -} -function getStartPositionOfRange(range, sourceFile, includeComments) { - return positionIsSynthesized(range.pos) ? -1 : skipTrivia( - sourceFile.text, - range.pos, - /*stopAfterLineBreak*/ - false, - includeComments - ); -} -function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { - const startPos = skipTrivia( - sourceFile.text, - pos, - /*stopAfterLineBreak*/ - false, - includeComments - ); - const prevPos = getPreviousNonWhitespacePosition(startPos, stopPos, sourceFile); - return getLinesBetweenPositions(sourceFile, prevPos ?? stopPos, startPos); -} -function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { - const nextPos = skipTrivia( - sourceFile.text, - pos, - /*stopAfterLineBreak*/ - false, - includeComments - ); - return getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos)); -} -function rangeContainsRange(r1, r2) { - return startEndContainsRange(r1.pos, r1.end, r2); -} -function startEndContainsRange(start, end, range) { - return start <= range.pos && end >= range.end; -} -function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) { - while (pos-- > stopPos) { - if (!isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) { - return pos; - } - } -} -function isDeclarationNameOfEnumOrNamespace(node) { - const parseNode = getParseTreeNode(node); - if (parseNode) { - switch (parseNode.parent.kind) { - case 267 /* EnumDeclaration */: - case 268 /* ModuleDeclaration */: - return parseNode === parseNode.parent.name; - } - } - return false; -} -function getInitializedVariables(node) { - return filter(node.declarations, isInitializedVariable); -} -function isInitializedVariable(node) { - return isVariableDeclaration(node) && node.initializer !== void 0; -} -function isWatchSet(options) { - return options.watch && hasProperty(options, "watch"); -} -function closeFileWatcher(watcher) { - watcher.close(); -} -function getCheckFlags(symbol) { - return symbol.flags & 33554432 /* Transient */ ? symbol.links.checkFlags : 0; -} -function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) { - 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 & ~7 /* AccessibilityModifier */; - } - if (getCheckFlags(s) & 6 /* Synthetic */) { - const checkFlags = s.links.checkFlags; - 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 1 /* Public */ | 256 /* Static */; - } - return 0; -} -function skipAlias(symbol, checker) { - return symbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(symbol) : symbol; -} -function getCombinedLocalAndExportSymbolFlags(symbol) { - return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags; -} -function isWriteOnlyAccess(node) { - return accessKind(node) === 1 /* Write */; -} -function isWriteAccess(node) { - return accessKind(node) !== 0 /* Read */; -} -function accessKind(node) { - const { parent: parent2 } = node; - switch (parent2 == null ? void 0 : parent2.kind) { - case 218 /* ParenthesizedExpression */: - return accessKind(parent2); - case 226 /* PostfixUnaryExpression */: - case 225 /* PrefixUnaryExpression */: - const { operator } = parent2; - return operator === 46 /* PlusPlusToken */ || operator === 47 /* MinusMinusToken */ ? 2 /* ReadWrite */ : 0 /* Read */; - case 227 /* BinaryExpression */: - const { left, operatorToken } = parent2; - return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 64 /* EqualsToken */ ? 1 /* Write */ : 2 /* ReadWrite */ : 0 /* Read */; - case 212 /* PropertyAccessExpression */: - return parent2.name !== node ? 0 /* Read */ : accessKind(parent2); - case 304 /* PropertyAssignment */: { - const parentAccess = accessKind(parent2.parent); - return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess; - } - case 305 /* ShorthandPropertyAssignment */: - return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent); - case 210 /* ArrayLiteralExpression */: - return accessKind(parent2); - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - return node === parent2.initializer ? 1 /* Write */ : 0 /* Read */; - default: - return 0 /* Read */; - } -} -function reverseAccessKind(a) { - switch (a) { - case 0 /* Read */: - return 1 /* Write */; - case 1 /* Write */: - return 0 /* Read */; - case 2 /* ReadWrite */: - return 2 /* ReadWrite */; - default: - return Debug.assertNever(a); - } -} -function compareDataObjects(dst, src) { - if (!dst || !src || Object.keys(dst).length !== Object.keys(src).length) { - return false; - } - for (const e in dst) { - if (typeof dst[e] === "object") { - if (!compareDataObjects(dst[e], src[e])) { - return false; - } - } else if (typeof dst[e] !== "function") { - if (dst[e] !== src[e]) { - return false; - } - } - } - return true; -} -function clearMap(map2, onDeleteValue) { - map2.forEach(onDeleteValue); - map2.clear(); -} -function mutateMapSkippingNewValues(map2, newMap, options) { - const { onDeleteValue, onExistingValue } = options; - map2.forEach((existingValue, key) => { - var _a; - if (!(newMap == null ? void 0 : newMap.has(key))) { - map2.delete(key); - onDeleteValue(existingValue, key); - } else if (onExistingValue) { - 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 == null ? void 0 : newMap.forEach((valueInNewMap, key) => { - if (!map2.has(key)) { - map2.set(key, createNewValue(key, valueInNewMap)); - } - }); -} -function isAbstractConstructorSymbol(symbol) { - if (symbol.flags & 32 /* Class */) { - const declaration = getClassLikeDeclarationOfSymbol(symbol); - return !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */); - } - return false; -} -function getClassLikeDeclarationOfSymbol(symbol) { - var _a; - return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike); -} -function getObjectFlags(type) { - return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0; -} -function isUMDExportSymbol(symbol) { - return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]); -} -function showModuleSpecifier({ moduleSpecifier }) { - return isStringLiteral(moduleSpecifier) ? moduleSpecifier.text : getTextOfNode(moduleSpecifier); -} -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; - } - } - }); - return lastChild; -} -function addToSeen(seen, key) { - if (seen.has(key)) { - return false; - } - seen.add(key); - return true; -} -function isObjectTypeDeclaration(node) { - return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); -} -function isTypeNodeKind(kind) { - return kind >= 183 /* FirstTypeNode */ && kind <= 206 /* 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 === 234 /* ExpressionWithTypeArguments */ || kind === 313 /* JSDocAllType */ || kind === 314 /* JSDocUnknownType */ || kind === 315 /* JSDocNullableType */ || kind === 316 /* JSDocNonNullableType */ || kind === 317 /* JSDocOptionalType */ || kind === 318 /* JSDocFunctionType */ || kind === 319 /* JSDocVariadicType */; -} -function isAccessExpression(node) { - return node.kind === 212 /* PropertyAccessExpression */ || node.kind === 213 /* ElementAccessExpression */; -} -function getNameOfAccessExpression(node) { - if (node.kind === 212 /* PropertyAccessExpression */) { - return node.name; - } - Debug.assert(node.kind === 213 /* ElementAccessExpression */); - return node.argumentExpression; -} -function isNamedImportsOrExports(node) { - return node.kind === 276 /* NamedImports */ || node.kind === 280 /* NamedExports */; -} -function getLeftmostAccessExpression(expr) { - while (isAccessExpression(expr)) { - expr = expr.expression; - } - return expr; -} -function forEachNameInAccessChainWalkingLeft(name, action) { - if (isAccessExpression(name.parent) && isRightSideOfAccessExpression(name)) { - return walkAccessExpression(name.parent); - } - function walkAccessExpression(access) { - if (access.kind === 212 /* PropertyAccessExpression */) { - const res = action(access.name); - if (res !== void 0) { - return res; - } - } else if (access.kind === 213 /* ElementAccessExpression */) { - if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) { - const res = action(access.argumentExpression); - if (res !== void 0) { - return res; - } - } else { - return void 0; - } - } - if (isAccessExpression(access.expression)) { - return walkAccessExpression(access.expression); - } - if (isIdentifier(access.expression)) { - return action(access.expression); - } - return void 0; - } -} -function getLeftmostExpression(node, stopAtCallExpressions) { - while (true) { - switch (node.kind) { - case 226 /* PostfixUnaryExpression */: - node = node.operand; - continue; - case 227 /* BinaryExpression */: - node = node.left; - continue; - case 228 /* ConditionalExpression */: - node = node.condition; - continue; - case 216 /* TaggedTemplateExpression */: - node = node.tag; - continue; - case 214 /* CallExpression */: - if (stopAtCallExpressions) { - return node; - } - // falls through - case 235 /* AsExpression */: - case 213 /* ElementAccessExpression */: - case 212 /* PropertyAccessExpression */: - case 236 /* NonNullExpression */: - case 356 /* PartiallyEmittedExpression */: - case 239 /* SatisfiesExpression */: - node = node.expression; - continue; - } - return node; - } -} -function Symbol4(flags, name) { - this.flags = flags; - this.escapedName = name; - this.declarations = void 0; - this.valueDeclaration = void 0; - this.id = 0; - this.mergeId = 0; - this.parent = void 0; - this.members = void 0; - this.exports = void 0; - this.exportSymbol = void 0; - this.constEnumOnlyModule = void 0; - this.isReferenced = void 0; - this.lastAssignmentPos = void 0; - this.links = void 0; -} -function Type3(checker, flags) { - this.flags = flags; - if (Debug.isDebugging || tracing) { - this.checker = checker; - } -} -function Signature2(checker, flags) { - this.flags = flags; - if (Debug.isDebugging) { - this.checker = checker; - } -} -function Node4(kind, pos, end) { - this.pos = pos; - this.end = end; - this.kind = kind; - this.id = 0; - this.flags = 0 /* None */; - this.modifierFlagsCache = 0 /* None */; - this.transformFlags = 0 /* None */; - this.parent = void 0; - this.original = void 0; - this.emitNode = void 0; -} -function Token(kind, pos, end) { - this.pos = pos; - this.end = end; - this.kind = kind; - this.id = 0; - this.flags = 0 /* None */; - this.transformFlags = 0 /* None */; - this.parent = void 0; - this.emitNode = void 0; -} -function Identifier2(kind, pos, end) { - this.pos = pos; - this.end = end; - this.kind = kind; - this.id = 0; - this.flags = 0 /* None */; - this.transformFlags = 0 /* None */; - this.parent = void 0; - this.original = void 0; - this.emitNode = void 0; -} -function SourceMapSource(fileName, text, skipTrivia2) { - this.fileName = fileName; - this.text = text; - this.skipTrivia = skipTrivia2 || ((pos) => pos); -} -var objectAllocator = { - getNodeConstructor: () => Node4, - getTokenConstructor: () => Token, - getIdentifierConstructor: () => Identifier2, - getPrivateIdentifierConstructor: () => Node4, - getSourceFileConstructor: () => Node4, - getSymbolConstructor: () => Symbol4, - getTypeConstructor: () => Type3, - getSignatureConstructor: () => Signature2, - getSourceMapSourceConstructor: () => SourceMapSource -}; -var objectAllocatorPatchers = []; -function addObjectAllocatorPatcher(fn) { - objectAllocatorPatchers.push(fn); - fn(objectAllocator); -} -function setObjectAllocator(alloc) { - Object.assign(objectAllocator, alloc); - forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator)); -} -function formatStringFromArgs(text, args) { - return text.replace(/\{(\d+)\}/g, (_match, index) => "" + Debug.checkDefined(args[+index])); -} -var localizedDiagnosticMessages; -function setLocalizedDiagnosticMessages(messages) { - localizedDiagnosticMessages = messages; -} -function maybeSetLocalizedDiagnosticMessages(getMessages) { - if (!localizedDiagnosticMessages && getMessages) { - localizedDiagnosticMessages = getMessages(); - } -} -function getLocaleSpecificMessage(message) { - return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message; -} -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 (some(args)) { - text = formatStringFromArgs(text, args); - } - return { - file: void 0, - start, - length: length2, - messageText: text, - category: message.category, - code: message.code, - reportsUnnecessary: message.reportsUnnecessary, - fileName - }; -} -function isDiagnosticWithDetachedLocation(diagnostic) { - return diagnostic.file === void 0 && diagnostic.start !== void 0 && diagnostic.length !== void 0 && typeof diagnostic.fileName === "string"; -} -function attachFileToDiagnostic(diagnostic, file) { - const fileName = file.fileName || ""; - const length2 = file.text.length; - Debug.assertEqual(diagnostic.fileName, fileName); - Debug.assertLessThanOrEqual(diagnostic.start, length2); - Debug.assertLessThanOrEqual(diagnostic.start + diagnostic.length, length2); - const diagnosticWithLocation = { - file, - start: diagnostic.start, - length: diagnostic.length, - messageText: diagnostic.messageText, - category: diagnostic.category, - code: diagnostic.code, - reportsUnnecessary: diagnostic.reportsUnnecessary - }; - if (diagnostic.relatedInformation) { - diagnosticWithLocation.relatedInformation = []; - for (const related of diagnostic.relatedInformation) { - if (isDiagnosticWithDetachedLocation(related) && related.fileName === fileName) { - Debug.assertLessThanOrEqual(related.start, length2); - Debug.assertLessThanOrEqual(related.start + related.length, length2); - diagnosticWithLocation.relatedInformation.push(attachFileToDiagnostic(related, file)); - } else { - diagnosticWithLocation.relatedInformation.push(related); - } - } - } - return diagnosticWithLocation; -} -function attachFileToDiagnostics(diagnostics, file) { - const diagnosticsWithLocation = []; - for (const diagnostic of diagnostics) { - diagnosticsWithLocation.push(attachFileToDiagnostic(diagnostic, file)); - } - return diagnosticsWithLocation; -} -function createFileDiagnostic(file, start, length2, message, ...args) { - assertDiagnosticLocation(file.text, start, length2); - let text = getLocaleSpecificMessage(message); - if (some(args)) { - text = formatStringFromArgs(text, args); - } - return { - file, - start, - length: length2, - messageText: text, - category: message.category, - code: message.code, - reportsUnnecessary: message.reportsUnnecessary, - reportsDeprecated: message.reportsDeprecated - }; -} -function formatMessage(message, ...args) { - let text = getLocaleSpecificMessage(message); - if (some(args)) { - text = formatStringFromArgs(text, args); - } - return text; -} -function createCompilerDiagnostic(message, ...args) { - let text = getLocaleSpecificMessage(message); - if (some(args)) { - text = formatStringFromArgs(text, args); - } - return { - file: void 0, - start: void 0, - length: void 0, - messageText: text, - category: message.category, - code: message.code, - reportsUnnecessary: message.reportsUnnecessary, - reportsDeprecated: message.reportsDeprecated - }; -} -function createCompilerDiagnosticFromMessageChain(chain, relatedInformation) { - return { - file: void 0, - start: void 0, - length: void 0, - code: chain.code, - category: chain.category, - messageText: chain.next ? chain : chain.messageText, - relatedInformation - }; -} -function chainDiagnosticMessages(details, message, ...args) { - let text = getLocaleSpecificMessage(message); - if (some(args)) { - text = formatStringFromArgs(text, args); - } - return { - messageText: text, - category: message.category, - code: message.code, - next: details === void 0 || Array.isArray(details) ? details : [details] - }; -} -function concatenateDiagnosticMessageChains(headChain, tailChain) { - let lastChain = headChain; - while (lastChain.next) { - lastChain = lastChain.next[0]; - } - lastChain.next = [tailChain]; -} -function getDiagnosticFilePath(diagnostic) { - return diagnostic.file ? diagnostic.file.path : void 0; -} -function compareDiagnostics(d1, d2) { - return compareDiagnosticsSkipRelatedInformation(d1, d2) || compareRelatedInformation(d1, d2) || 0 /* EqualTo */; -} -function compareDiagnosticsSkipRelatedInformation(d1, d2) { - const code1 = getDiagnosticCode(d1); - const code2 = getDiagnosticCode(d2); - return compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(code1, code2) || compareMessageText(d1, d2) || 0 /* EqualTo */; -} -function compareRelatedInformation(d1, d2) { - if (!d1.relatedInformation && !d2.relatedInformation) { - return 0 /* EqualTo */; - } - if (d1.relatedInformation && d2.relatedInformation) { - return compareValues(d2.relatedInformation.length, d1.relatedInformation.length) || forEach(d1.relatedInformation, (d1i, index) => { - const d2i = d2.relatedInformation[index]; - return compareDiagnostics(d1i, d2i); - }) || 0 /* EqualTo */; - } - return d1.relatedInformation ? -1 /* LessThan */ : 1 /* GreaterThan */; -} -function compareMessageText(d1, d2) { - let headMsg1 = getDiagnosticMessage(d1); - let headMsg2 = getDiagnosticMessage(d2); - if (typeof headMsg1 !== "string") { - headMsg1 = headMsg1.messageText; - } - if (typeof headMsg2 !== "string") { - headMsg2 = headMsg2.messageText; - } - const chain1 = typeof d1.messageText !== "string" ? d1.messageText.next : void 0; - const chain2 = typeof d2.messageText !== "string" ? d2.messageText.next : void 0; - let res = compareStringsCaseSensitive(headMsg1, headMsg2); - if (res) { - return res; - } - res = compareMessageChain(chain1, chain2); - if (res) { - return res; - } - if (d1.canonicalHead && !d2.canonicalHead) { - return -1 /* LessThan */; - } - if (d2.canonicalHead && !d1.canonicalHead) { - return 1 /* GreaterThan */; - } - return 0 /* EqualTo */; -} -function compareMessageChain(c1, c2) { - if (c1 === void 0 && c2 === void 0) { - return 0 /* EqualTo */; - } - if (c1 === void 0) { - return 1 /* GreaterThan */; - } - if (c2 === void 0) { - return -1 /* LessThan */; - } - return compareMessageChainSize(c1, c2) || compareMessageChainContent(c1, c2); -} -function compareMessageChainSize(c1, c2) { - if (c1 === void 0 && c2 === void 0) { - return 0 /* EqualTo */; - } - if (c1 === void 0) { - return 1 /* GreaterThan */; - } - if (c2 === void 0) { - return -1 /* LessThan */; - } - let res = compareValues(c2.length, c1.length); - if (res) { - return res; - } - for (let i = 0; i < c2.length; i++) { - res = compareMessageChainSize(c1[i].next, c2[i].next); - if (res) { - return res; - } - } - return 0 /* EqualTo */; -} -function compareMessageChainContent(c1, c2) { - let res; - for (let i = 0; i < c2.length; i++) { - res = compareStringsCaseSensitive(c1[i].messageText, c2[i].messageText); - if (res) { - return res; - } - if (c1[i].next === void 0) { - continue; - } - res = compareMessageChainContent(c1[i].next, c2[i].next); - if (res) { - return res; - } - } - return 0 /* EqualTo */; -} -function diagnosticsEqualityComparer(d1, d2) { - const code1 = getDiagnosticCode(d1); - const code2 = getDiagnosticCode(d2); - const msg1 = getDiagnosticMessage(d1); - const msg2 = getDiagnosticMessage(d2); - return compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) === 0 /* EqualTo */ && compareValues(d1.start, d2.start) === 0 /* EqualTo */ && compareValues(d1.length, d2.length) === 0 /* EqualTo */ && compareValues(code1, code2) === 0 /* EqualTo */ && messageTextEqualityComparer(msg1, msg2); -} -function getDiagnosticCode(d) { - var _a; - return ((_a = d.canonicalHead) == null ? void 0 : _a.code) || d.code; -} -function getDiagnosticMessage(d) { - var _a; - return ((_a = d.canonicalHead) == null ? void 0 : _a.messageText) || d.messageText; -} -function messageTextEqualityComparer(m1, m2) { - const t1 = typeof m1 === "string" ? m1 : m1.messageText; - const t2 = typeof m2 === "string" ? m2 : m2.messageText; - return compareStringsCaseSensitive(t1, t2) === 0 /* EqualTo */; -} -function getLanguageVariant(scriptKind) { - return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */; -} -function walkTreeForJSXTags(node) { - if (!(node.transformFlags & 2 /* ContainsJsx */)) return void 0; - return isJsxOpeningLikeElement(node) || isJsxFragment(node) ? node : forEachChild(node, walkTreeForJSXTags); -} -function isFileModuleFromUsingJSXTag(file) { - return !file.isDeclarationFile ? walkTreeForJSXTags(file) : void 0; -} -function isFileForcedToBeModuleByFormat(file, options) { - return (getImpliedNodeFormatForEmitWorker(file, options) === 99 /* ESNext */ || fileExtensionIsOneOf(file.fileName, [".cjs" /* Cjs */, ".cts" /* Cts */, ".mjs" /* Mjs */, ".mts" /* Mts */])) && !file.isDeclarationFile ? true : void 0; -} -function getSetExternalModuleIndicator(options) { - switch (getEmitModuleDetectionKind(options)) { - case 3 /* Force */: - return (file) => { - file.externalModuleIndicator = isFileProbablyExternalModule(file) || !file.isDeclarationFile || void 0; - }; - case 1 /* Legacy */: - return (file) => { - file.externalModuleIndicator = isFileProbablyExternalModule(file); - }; - case 2 /* Auto */: - const checks = [isFileProbablyExternalModule]; - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - checks.push(isFileModuleFromUsingJSXTag); - } - checks.push(isFileForcedToBeModuleByFormat); - const combined = or(...checks); - const callback = (file) => void (file.externalModuleIndicator = combined(file, options)); - return callback; - } -} -function importSyntaxAffectsModuleResolution(options) { - const moduleResolution = getEmitModuleResolutionKind(options); - return 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */ || getResolvePackageJsonExports(options) || getResolvePackageJsonImports(options); -} -function createComputedCompilerOptions(options) { - return options; -} -var _computedOptions = createComputedCompilerOptions({ - allowImportingTsExtensions: { - dependencies: ["rewriteRelativeImportExtensions"], - computeValue: (compilerOptions) => { - return !!(compilerOptions.allowImportingTsExtensions || compilerOptions.rewriteRelativeImportExtensions); - } - }, - target: { - dependencies: ["module"], - computeValue: (compilerOptions) => { - const target = compilerOptions.target === 0 /* ES3 */ ? void 0 : compilerOptions.target; - return target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 101 /* Node18 */ && 9 /* ES2022 */ || compilerOptions.module === 102 /* Node20 */ && 10 /* ES2023 */ || 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 */: - case 101 /* Node18 */: - case 102 /* Node20 */: - 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) => { - if (compilerOptions.moduleDetection !== void 0) { - return compilerOptions.moduleDetection; - } - const moduleKind = _computedOptions.module.computeValue(compilerOptions); - return 100 /* Node16 */ <= moduleKind && moduleKind <= 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 101 /* Node18 */: - case 102 /* Node20 */: - 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.resolvePackageJsonImports !== void 0) { - return compilerOptions.resolvePackageJsonImports; - } - 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; - } - switch (_computedOptions.module.computeValue(compilerOptions)) { - // TODO in 6.0: uncomment - // case ModuleKind.Node16: - // case ModuleKind.Node18: - case 102 /* Node20 */: - case 199 /* NodeNext */: - return true; - } - 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"); - } - }, - strictBuiltinIteratorReturn: { - dependencies: ["strict"], - computeValue: (compilerOptions) => { - return getStrictOptionValue(compilerOptions, "strictBuiltinIteratorReturn"); - } - }, - alwaysStrict: { - dependencies: ["strict"], - computeValue: (compilerOptions) => { - return getStrictOptionValue(compilerOptions, "alwaysStrict"); - } - }, - useUnknownInCatchVariables: { - dependencies: ["strict"], - computeValue: (compilerOptions) => { - return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); - } - } -}); -var computedOptions = _computedOptions; -var getAllowImportingTsExtensions = _computedOptions.allowImportingTsExtensions.computeValue; -var getEmitScriptTarget = _computedOptions.target.computeValue; -var getEmitModuleKind = _computedOptions.module.computeValue; -var getEmitModuleResolutionKind = _computedOptions.moduleResolution.computeValue; -var getEmitModuleDetectionKind = _computedOptions.moduleDetection.computeValue; -var getIsolatedModules = _computedOptions.isolatedModules.computeValue; -var getESModuleInterop = _computedOptions.esModuleInterop.computeValue; -var getAllowSyntheticDefaultImports = _computedOptions.allowSyntheticDefaultImports.computeValue; -var getResolvePackageJsonExports = _computedOptions.resolvePackageJsonExports.computeValue; -var getResolvePackageJsonImports = _computedOptions.resolvePackageJsonImports.computeValue; -var getResolveJsonModule = _computedOptions.resolveJsonModule.computeValue; -var getEmitDeclarations = _computedOptions.declaration.computeValue; -var shouldPreserveConstEnums = _computedOptions.preserveConstEnums.computeValue; -var isIncrementalCompilation = _computedOptions.incremental.computeValue; -var getAreDeclarationMapsEnabled = _computedOptions.declarationMap.computeValue; -var getAllowJSCompilerOption = _computedOptions.allowJs.computeValue; -var getUseDefineForClassFields = _computedOptions.useDefineForClassFields.computeValue; -function emitModuleKindIsNonNodeESM(moduleKind) { - return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */; -} -function hasJsonModuleEmitEnabled(options) { - switch (getEmitModuleKind(options)) { - case 0 /* None */: - case 4 /* System */: - case 3 /* UMD */: - return false; - } - return true; -} -function unreachableCodeIsError(options) { - return options.allowUnreachableCode === false; -} -function unusedLabelIsError(options) { - return options.allowUnusedLabels === false; -} -function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { - return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; -} -function moduleSupportsImportAttributes(moduleKind) { - return 101 /* Node18 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ || moduleKind === 200 /* Preserve */ || moduleKind === 99 /* ESNext */; -} -function getStrictOptionValue(compilerOptions, flag) { - return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag]; -} -function getNameOfScriptTarget(scriptTarget) { - return forEachEntry(targetOptionDeclaration.type, (value, key) => value === scriptTarget ? key : void 0); -} -function getEmitStandardClassFields(compilerOptions) { - return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */; -} -function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { - return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations); -} -function compilerOptionsAffectEmit(newOptions, oldOptions) { - return optionsHaveChanges(oldOptions, newOptions, affectsEmitOptionDeclarations); -} -function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) { - return optionsHaveChanges(oldOptions, newOptions, affectsDeclarationPathOptionDeclarations); -} -function getCompilerOptionValue(options, option) { - return option.strictFlag ? getStrictOptionValue(options, option.name) : option.allowJsFlag ? getAllowJSCompilerOption(options) : options[option.name]; -} -function getJSXTransformEnabled(options) { - const jsx = options.jsx; - return jsx === 2 /* React */ || jsx === 4 /* ReactJSX */ || jsx === 5 /* ReactJSXDev */; -} -function getJSXImplicitImportBase(compilerOptions, file) { - const jsxImportSourcePragmas = file == null ? void 0 : file.pragmas.get("jsximportsource"); - const jsxImportSourcePragma = isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[jsxImportSourcePragmas.length - 1] : jsxImportSourcePragmas; - const jsxRuntimePragmas = file == null ? void 0 : file.pragmas.get("jsxruntime"); - const jsxRuntimePragma = isArray(jsxRuntimePragmas) ? jsxRuntimePragmas[jsxRuntimePragmas.length - 1] : jsxRuntimePragmas; - if ((jsxRuntimePragma == null ? void 0 : jsxRuntimePragma.arguments.factory) === "classic") { - return void 0; - } - return compilerOptions.jsx === 4 /* ReactJSX */ || compilerOptions.jsx === 5 /* ReactJSXDev */ || compilerOptions.jsxImportSource || jsxImportSourcePragma || (jsxRuntimePragma == null ? void 0 : jsxRuntimePragma.arguments.factory) === "automatic" ? (jsxImportSourcePragma == null ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : void 0; -} -function getJSXRuntimeImport(base, options) { - return base ? `${base}/${options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime"}` : void 0; -} -function hasZeroOrOneAsteriskCharacter(str) { - let seenAsterisk = false; - for (let i = 0; i < str.length; i++) { - if (str.charCodeAt(i) === 42 /* asterisk */) { - if (!seenAsterisk) { - seenAsterisk = true; - } else { - return false; - } - } - } - return true; -} -function createSymlinkCache(cwd, getCanonicalFileName) { - let symlinkedDirectories; - let symlinkedDirectoriesByRealpath; - let symlinkedFiles; - let hasProcessedResolutions = false; - return { - getSymlinkedFiles: () => symlinkedFiles, - getSymlinkedDirectories: () => symlinkedDirectories, - getSymlinkedDirectoriesByRealpath: () => symlinkedDirectoriesByRealpath, - setSymlinkedFile: (path, real) => (symlinkedFiles || (symlinkedFiles = /* @__PURE__ */ new Map())).set(path, real), - setSymlinkedDirectory: (symlink, real) => { - let symlinkPath = toPath(symlink, cwd, getCanonicalFileName); - if (!containsIgnoredPath(symlinkPath)) { - symlinkPath = ensureTrailingDirectorySeparator(symlinkPath); - if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) { - (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink); - } - (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real); - } - }, - setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) { - Debug.assert(!hasProcessedResolutions); - hasProcessedResolutions = true; - forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule)); - forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)); - typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)); - }, - hasProcessedResolutions: () => hasProcessedResolutions, - setSymlinksFromResolution(resolution) { - processResolution(this, resolution); - }, - hasAnySymlinks - }; - function hasAnySymlinks() { - return !!(symlinkedFiles == null ? void 0 : symlinkedFiles.size) || !!symlinkedDirectories && !!forEachEntry(symlinkedDirectories, (value) => !!value); - } - function processResolution(cache, resolution) { - if (!resolution || !resolution.originalPath || !resolution.resolvedFileName) return; - const { resolvedFileName, originalPath } = resolution; - cache.setSymlinkedFile(toPath(originalPath, cwd, getCanonicalFileName), resolvedFileName); - const [commonResolved, commonOriginal] = guessDirectorySymlink(resolvedFileName, originalPath, cwd, getCanonicalFileName) || emptyArray; - if (commonResolved && commonOriginal) { - cache.setSymlinkedDirectory( - commonOriginal, - { - real: ensureTrailingDirectorySeparator(commonResolved), - realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName)) - } - ); - } - } -} -function guessDirectorySymlink(a, b, cwd, getCanonicalFileName) { - const aParts = getPathComponents(getNormalizedAbsolutePath(a, cwd)); - const bParts = getPathComponents(getNormalizedAbsolutePath(b, cwd)); - let isDirectory = false; - while (aParts.length >= 2 && bParts.length >= 2 && !isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) && !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) && getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) { - aParts.pop(); - bParts.pop(); - isDirectory = true; - } - return isDirectory ? [getPathFromPathComponents(aParts), getPathFromPathComponents(bParts)] : void 0; -} -function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) { - return s !== void 0 && (getCanonicalFileName(s) === "node_modules" || startsWith(s, "@")); -} -function stripLeadingDirectorySeparator(s) { - return isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : void 0; -} -function tryRemoveDirectoryPrefix(path, dirPath, getCanonicalFileName) { - const withoutPrefix = tryRemovePrefix(path, dirPath, getCanonicalFileName); - return withoutPrefix === void 0 ? void 0 : stripLeadingDirectorySeparator(withoutPrefix); -} -var reservedCharacterPattern = /[^\w\s/]/g; -function regExpEscape(text) { - return text.replace(reservedCharacterPattern, escapeRegExpCharacter); -} -function escapeRegExpCharacter(match) { - return "\\" + match; -} -var wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; -var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; -var implicitExcludePathRegexPattern = `(?!(?:${commonPackageFolders.join("|")})(?:/|$))`; -var filesMatcher = { - /** - * Matches any single directory segment unless it is the last segment and a .min.js file - * Breakdown: - * [^./] # matches everything up to the first . character (excluding directory separators) - * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension - */ - singleAsteriskRegexFragment: "(?:[^./]|(?:\\.(?!min\\.js$))?)*", - /** - * Regex for the ** wildcard. Matches any number of subdirectories. When used for including - * files or directories, does not match subdirectories that start with a . character - */ - doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, - replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment) -}; -var directoriesMatcher = { - singleAsteriskRegexFragment: "[^/]*", - /** - * Regex for the ** wildcard. Matches any number of subdirectories. When used for including - * files or directories, does not match subdirectories that start with a . character - */ - doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, - replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment) -}; -var excludeMatcher = { - singleAsteriskRegexFragment: "[^/]*", - doubleAsteriskRegexFragment: "(?:/.+?)?", - replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) -}; -var wildcardMatchers = { - files: filesMatcher, - directories: directoriesMatcher, - exclude: excludeMatcher -}; -function getRegularExpressionForWildcard(specs, basePath, usage) { - const patterns = getRegularExpressionsForWildcards(specs, basePath, usage); - if (!patterns || !patterns.length) { - return void 0; - } - const pattern = patterns.map((pattern2) => `(?:${pattern2})`).join("|"); - const terminator = usage === "exclude" ? "(?:$|/)" : "$"; - return `^(?:${pattern})${terminator}`; -} -function getRegularExpressionsForWildcards(specs, basePath, usage) { - if (specs === void 0 || specs.length === 0) { - return void 0; - } - return flatMap(specs, (spec) => spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage])); -} -function isImplicitGlob(lastPathComponent) { - return !/[.*?]/.test(lastPathComponent); -} -function getPatternFromSpec(spec, basePath, usage) { - const pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); - return pattern && `^(?:${pattern})${usage === "exclude" ? "(?:$|/)" : "$"}`; -} -function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) { - let subpattern = ""; - let hasWrittenComponent = false; - const components = getNormalizedPathComponents(spec, basePath); - const lastComponent = last(components); - if (usage !== "exclude" && lastComponent === "**") { - return void 0; - } - components[0] = removeTrailingDirectorySeparator(components[0]); - if (isImplicitGlob(lastComponent)) { - components.push("**", "*"); - } - let optionalCount = 0; - for (let component of components) { - if (component === "**") { - subpattern += doubleAsteriskRegexFragment; - } else { - if (usage === "directories") { - subpattern += "(?:"; - optionalCount++; - } - if (hasWrittenComponent) { - subpattern += directorySeparator; - } - if (usage !== "exclude") { - let componentPattern = ""; - if (component.charCodeAt(0) === 42 /* asterisk */) { - componentPattern += "(?:[^./]" + singleAsteriskRegexFragment + ")?"; - component = component.substr(1); - } else if (component.charCodeAt(0) === 63 /* question */) { - componentPattern += "[^./]"; - component = component.substr(1); - } - componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); - if (componentPattern !== component) { - subpattern += implicitExcludePathRegexPattern; - } - subpattern += componentPattern; - } else { - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); - } - } - hasWrittenComponent = true; - } - while (optionalCount > 0) { - subpattern += ")?"; - optionalCount--; - } - return subpattern; -} -function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { - return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; -} -function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) { - path = normalizePath(path); - currentDirectory = normalizePath(currentDirectory); - const absolutePath = combinePaths(currentDirectory, path); - return { - includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), (pattern) => `^${pattern}$`), - includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), - includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), - excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), - basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2) - }; -} -function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) { - return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i"); -} -function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) { - path = normalizePath(path); - currentDirectory = normalizePath(currentDirectory); - 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(useCaseSensitiveFileNames2); - for (const basePath of patterns.basePaths) { - visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth); - } - return flatten(results); - function visitDirectory(path2, absolutePath, depth2) { - const canonicalPath = toCanonical(realpath(absolutePath)); - if (visited.has(canonicalPath)) return; - visited.set(canonicalPath, true); - const { files, directories } = getFileSystemEntries(path2); - for (const current of toSorted(files, compareStringsCaseSensitive)) { - const name = combinePaths(path2, current); - const absoluteName = combinePaths(absolutePath, current); - if (extensions && !fileExtensionIsOneOf(name, extensions)) continue; - if (excludeRegex && excludeRegex.test(absoluteName)) continue; - if (!includeFileRegexes) { - results[0].push(name); - } else { - const includeIndex = findIndex(includeFileRegexes, (re) => re.test(absoluteName)); - if (includeIndex !== -1) { - results[includeIndex].push(name); - } - } - } - if (depth2 !== void 0) { - depth2--; - if (depth2 === 0) { - return; - } - } - for (const current of toSorted(directories, compareStringsCaseSensitive)) { - const name = combinePaths(path2, current); - const absoluteName = combinePaths(absolutePath, current); - if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name, absoluteName, depth2); - } - } - } -} -function getBasePaths(path, includes, useCaseSensitiveFileNames2) { - const basePaths = [path]; - if (includes) { - const includeBasePaths = []; - for (const include of includes) { - const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include)); - includeBasePaths.push(getIncludeBasePath(absolute)); - } - includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2)); - for (const includeBasePath of includeBasePaths) { - if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) { - basePaths.push(includeBasePath); - } - } - } - return basePaths; -} -function getIncludeBasePath(absolute) { - const wildcardOffset = indexOfAnyCharCode(absolute, wildcardCharCodes); - if (wildcardOffset < 0) { - return !hasExtension(absolute) ? absolute : removeTrailingDirectorySeparator(getDirectoryPath(absolute)); - } - return absolute.substring(0, absolute.lastIndexOf(directorySeparator, wildcardOffset)); -} -function ensureScriptKind(fileName, scriptKind) { - return scriptKind || getScriptKindFromFileName(fileName) || 3 /* TS */; -} -function getScriptKindFromFileName(fileName) { - const ext = fileName.substr(fileName.lastIndexOf(".")); - switch (ext.toLowerCase()) { - case ".js" /* Js */: - case ".cjs" /* Cjs */: - case ".mjs" /* Mjs */: - return 1 /* JS */; - case ".jsx" /* Jsx */: - return 2 /* JSX */; - case ".ts" /* Ts */: - case ".cts" /* Cts */: - case ".mts" /* Mts */: - return 3 /* TS */; - case ".tsx" /* Tsx */: - return 4 /* TSX */; - case ".json" /* Json */: - return 6 /* JSON */; - default: - return 0 /* Unknown */; - } -} -var supportedTSExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */], [".cts" /* Cts */, ".d.cts" /* Dcts */], [".mts" /* Mts */, ".d.mts" /* Dmts */]]; -var supportedTSExtensionsFlat = flatten(supportedTSExtensions); -var supportedTSExtensionsWithJson = [...supportedTSExtensions, [".json" /* Json */]]; -var supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */, ".cts" /* Cts */, ".mts" /* Mts */, ".ts" /* Ts */, ".tsx" /* Tsx */]; -var supportedJSExtensions = [[".js" /* Js */, ".jsx" /* Jsx */], [".mjs" /* Mjs */], [".cjs" /* Cjs */]]; -var supportedJSExtensionsFlat = flatten(supportedJSExtensions); -var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */, ".js" /* Js */, ".jsx" /* Jsx */], [".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */], [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */]]; -var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]]; -var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */]; -var supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */]; -var extensionsNotSupportingExtensionlessResolution = [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */]; -function getSupportedExtensions(options, extraFileExtensions) { - const needJsExtensions = options && getAllowJSCompilerOption(options); - if (!extraFileExtensions || extraFileExtensions.length === 0) { - return needJsExtensions ? allSupportedExtensions : supportedTSExtensions; - } - const builtins = needJsExtensions ? allSupportedExtensions : supportedTSExtensions; - const flatBuiltins = flatten(builtins); - const extensions = [ - ...builtins, - ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0) - ]; - return extensions; -} -function getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions) { - if (!options || !getResolveJsonModule(options)) return supportedExtensions; - if (supportedExtensions === allSupportedExtensions) return allSupportedExtensionsWithJson; - if (supportedExtensions === supportedTSExtensions) return supportedTSExtensionsWithJson; - return [...supportedExtensions, [".json" /* Json */]]; -} -function isJSLike(scriptKind) { - return scriptKind === 1 /* JS */ || scriptKind === 2 /* JSX */; -} -function hasJSFileExtension(fileName) { - return some(supportedJSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension)); -} -function hasTSFileExtension(fileName) { - return some(supportedTSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension)); -} -function hasImplementationTSFileExtension(fileName) { - return some(supportedTSImplementationExtensions, (extension) => fileExtensionIs(fileName, extension)) && !isDeclarationFileName(fileName); -} -var ModuleSpecifierEnding = /* @__PURE__ */ ((ModuleSpecifierEnding2) => { - ModuleSpecifierEnding2[ModuleSpecifierEnding2["Minimal"] = 0] = "Minimal"; - ModuleSpecifierEnding2[ModuleSpecifierEnding2["Index"] = 1] = "Index"; - ModuleSpecifierEnding2[ModuleSpecifierEnding2["JsExtension"] = 2] = "JsExtension"; - ModuleSpecifierEnding2[ModuleSpecifierEnding2["TsExtension"] = 3] = "TsExtension"; - return ModuleSpecifierEnding2; -})(ModuleSpecifierEnding || {}); -function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtension, hasTSFileExtension)) { - return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false; -} -function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) { - 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 */; - } - return inferPreference() !== 2 /* JsExtension */ ? 3 /* TsExtension */ : 2 /* JsExtension */; - } - if (preference === "minimal") { - return 0 /* Minimal */; - } - if (preference === "index") { - return 1 /* Index */; - } - if (!shouldAllowImportingTsExtension(compilerOptions)) { - return sourceFile && usesExtensionsOnImports(sourceFile) ? 2 /* JsExtension */ : 0 /* Minimal */; - } - return inferPreference(); - function inferPreference() { - let usesJsExtensions = false; - const specifiers = (sourceFile == null ? void 0 : sourceFile.imports.length) ? sourceFile.imports : sourceFile && isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0]) : emptyArray; - for (const specifier of specifiers) { - 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.text)) { - return 3 /* TsExtension */; - } - if (hasJSFileExtension(specifier.text)) { - usesJsExtensions = true; - } - } - } - return usesJsExtensions ? 2 /* JsExtension */ : 0 /* Minimal */; - } -} -function getRequiresAtTopOfFile(sourceFile) { - let nonRequireStatementCount = 0; - let requires; - for (const statement of sourceFile.statements) { - if (nonRequireStatementCount > 3) { - break; - } - if (isRequireVariableStatement(statement)) { - requires = concatenate(requires, statement.declarationList.declarations.map((d) => d.initializer)); - } else if (isExpressionStatement(statement) && isRequireCall( - statement.expression, - /*requireStringLiteralLikeArgument*/ - true - )) { - requires = append(requires, statement.expression); - } else { - nonRequireStatementCount++; - } - } - return requires || emptyArray; -} -function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { - if (!fileName) return false; - const supportedExtensions = getSupportedExtensions(compilerOptions, extraFileExtensions); - for (const extension of flatten(getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, supportedExtensions))) { - if (fileExtensionIs(fileName, extension)) { - return true; - } - } - return false; -} -function numberOfDirectorySeparators(str) { - const match = str.match(/\//g); - return match ? match.length : 0; -} -function compareNumberOfDirectorySeparators(path1, path2) { - return compareValues( - numberOfDirectorySeparators(path1), - numberOfDirectorySeparators(path2) - ); -} -var extensionsToRemove = [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".mjs" /* Mjs */, ".mts" /* Mts */, ".cjs" /* Cjs */, ".cts" /* Cts */, ".ts" /* Ts */, ".js" /* Js */, ".tsx" /* Tsx */, ".jsx" /* Jsx */, ".json" /* Json */]; -function removeFileExtension(path) { - for (const ext of extensionsToRemove) { - const extensionless = tryRemoveExtension(path, ext); - if (extensionless !== void 0) { - return extensionless; - } - } - return path; -} -function tryRemoveExtension(path, extension) { - return fileExtensionIs(path, extension) ? removeExtension(path, extension) : void 0; -} -function removeExtension(path, extension) { - return path.substring(0, path.length - extension.length); -} -function changeExtension(path, newExtension) { - return changeAnyExtension( - path, - newExtension, - extensionsToRemove, - /*ignoreCase*/ - false - ); -} -function tryParsePattern(pattern) { - const indexOfStar = pattern.indexOf("*"); - if (indexOfStar === -1) { - return pattern; - } - return pattern.indexOf("*", indexOfStar + 1) !== -1 ? void 0 : { - prefix: pattern.substr(0, indexOfStar), - suffix: pattern.substr(indexOfStar + 1) - }; -} -var parsedPatternsCache = /* @__PURE__ */ new WeakMap(); -function tryParsePatterns(paths) { - let result = parsedPatternsCache.get(paths); - if (result !== void 0) { - return result; - } - let matchableStringSet; - let patterns; - const pathList = getOwnKeys(paths); - for (const path of pathList) { - const patternOrStr = tryParsePattern(path); - if (patternOrStr === void 0) { - continue; - } else if (typeof patternOrStr === "string") { - (matchableStringSet ?? (matchableStringSet = /* @__PURE__ */ new Set())).add(patternOrStr); - } else { - (patterns ?? (patterns = [])).push(patternOrStr); - } - } - parsedPatternsCache.set( - paths, - result = { - matchableStringSet, - patterns - } - ); - return result; -} -function positionIsSynthesized(pos) { - return !(pos >= 0); -} -function extensionIsTS(ext) { - return ext === ".ts" /* Ts */ || ext === ".tsx" /* Tsx */ || ext === ".d.ts" /* Dts */ || ext === ".cts" /* Cts */ || ext === ".mts" /* Mts */ || ext === ".d.mts" /* Dmts */ || ext === ".d.cts" /* Dcts */ || startsWith(ext, ".d.") && endsWith(ext, ".ts"); -} -function resolutionExtensionIsTSOrJson(ext) { - return extensionIsTS(ext) || ext === ".json" /* Json */; -} -function extensionFromPath(path) { - const ext = tryGetExtensionFromPath2(path); - return ext !== void 0 ? ext : Debug.fail(`File ${path} has unknown extension.`); -} -function isAnySupportedFileExtension(path) { - return tryGetExtensionFromPath2(path) !== void 0; -} -function tryGetExtensionFromPath2(path) { - return find(extensionsToRemove, (e) => fileExtensionIs(path, e)); -} -function isCheckJsEnabledForFile(sourceFile, compilerOptions) { - return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; -} -var emptyFileSystemEntries = { - files: emptyArray, - directories: emptyArray -}; -function matchPatternOrExact(parsedPatterns, candidate) { - const { matchableStringSet, patterns } = parsedPatterns; - if (matchableStringSet == null ? void 0 : matchableStringSet.has(candidate)) { - return candidate; - } - if (patterns === void 0 || patterns.length === 0) { - return void 0; - } - return findBestPatternMatch(patterns, (_) => _, candidate); -} -function sliceAfter(arr, value) { - const index = arr.indexOf(value); - Debug.assert(index !== -1); - return arr.slice(index); -} -function addRelatedInfo(diagnostic, ...relatedInformation) { - if (!relatedInformation.length) { - return diagnostic; - } - if (!diagnostic.relatedInformation) { - diagnostic.relatedInformation = []; - } - Debug.assert(diagnostic.relatedInformation !== emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); - diagnostic.relatedInformation.push(...relatedInformation); - return diagnostic; -} -function minAndMax(arr, getValue) { - Debug.assert(arr.length !== 0); - let min2 = getValue(arr[0]); - let max = min2; - for (let i = 1; i < arr.length; i++) { - const value = getValue(arr[i]); - if (value < min2) { - min2 = value; - } else if (value > max) { - max = value; - } - } - return { min: min2, max }; -} -function rangeOfNode(node) { - return { pos: getTokenPosOfNode(node), end: node.end }; -} -function rangeOfTypeParameters(sourceFile, typeParameters) { - const pos = typeParameters.pos - 1; - const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1); - return { pos, end }; -} -function skipTypeChecking(sourceFile, options, host) { - return skipTypeCheckingWorker( - sourceFile, - options, - host, - /*ignoreNoCheck*/ - false - ); -} -function skipTypeCheckingIgnoringNoCheck(sourceFile, options, host) { - return skipTypeCheckingWorker( - sourceFile, - options, - host, - /*ignoreNoCheck*/ - true - ); -} -function skipTypeCheckingWorker(sourceFile, options, host, ignoreNoCheck) { - return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || !ignoreNoCheck && options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) || !canIncludeBindAndCheckDiagnostics(sourceFile, options); -} -function canIncludeBindAndCheckDiagnostics(sourceFile, options) { - if (!!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false) return false; - if (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */ || sourceFile.scriptKind === 5 /* External */) return true; - const isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */; - const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options); - const isPlainJs = isPlainJsFile(sourceFile, options.checkJs); - return isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */; -} -function isJsonEqual(a, b) { - return a === b || typeof a === "object" && a !== null && typeof b === "object" && b !== null && equalOwnProperties(a, b, isJsonEqual); -} -function parsePseudoBigInt(stringValue) { - let log2Base; - switch (stringValue.charCodeAt(1)) { - // "x" in "0x123" - case 98 /* b */: - case 66 /* B */: - log2Base = 1; - break; - case 111 /* o */: - case 79 /* O */: - log2Base = 3; - break; - case 120 /* x */: - case 88 /* X */: - log2Base = 4; - break; - default: - const nIndex = stringValue.length - 1; - let nonZeroStart = 0; - while (stringValue.charCodeAt(nonZeroStart) === 48 /* _0 */) { - nonZeroStart++; - } - return stringValue.slice(nonZeroStart, nIndex) || "0"; - } - const startIndex = 2, endIndex = stringValue.length - 1; - const bitsNeeded = (endIndex - startIndex) * log2Base; - const segments = new Uint16Array((bitsNeeded >>> 4) + (bitsNeeded & 15 ? 1 : 0)); - for (let i = endIndex - 1, bitOffset = 0; i >= startIndex; i--, bitOffset += log2Base) { - const segment = bitOffset >>> 4; - const digitChar = stringValue.charCodeAt(i); - const digit = digitChar <= 57 /* _9 */ ? digitChar - 48 /* _0 */ : 10 + digitChar - (digitChar <= 70 /* F */ ? 65 /* A */ : 97 /* a */); - const shiftedDigit = digit << (bitOffset & 15); - segments[segment] |= shiftedDigit; - const residual = shiftedDigit >>> 16; - if (residual) segments[segment + 1] |= residual; - } - let base10Value = ""; - let firstNonzeroSegment = segments.length - 1; - let segmentsRemaining = true; - while (segmentsRemaining) { - let mod10 = 0; - segmentsRemaining = false; - for (let segment = firstNonzeroSegment; segment >= 0; segment--) { - const newSegment = mod10 << 16 | segments[segment]; - const segmentValue = newSegment / 10 | 0; - segments[segment] = segmentValue; - mod10 = newSegment - segmentValue * 10; - if (segmentValue && !segmentsRemaining) { - firstNonzeroSegment = segment; - segmentsRemaining = true; - } - } - base10Value = mod10 + base10Value; - } - return base10Value; -} -function pseudoBigIntToString({ negative, base10Value }) { - return (negative && base10Value !== "0" ? "-" : "") + base10Value; -} -function parseBigInt(text) { - if (!isValidBigIntString( - text, - /*roundTripOnly*/ - false - )) { - return void 0; - } - return parseValidBigInt(text); -} -function parseValidBigInt(text) { - const negative = text.startsWith("-"); - const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`); - return { negative, base10Value }; -} -function isValidBigIntString(s, roundTripOnly) { - if (s === "") return false; - const scanner2 = createScanner( - 99 /* ESNext */, - /*skipTrivia*/ - false - ); - let success = true; - scanner2.setOnError(() => success = false); - scanner2.setText(s + "n"); - let result = scanner2.scan(); - const negative = result === 41 /* MinusToken */; - if (negative) { - result = scanner2.scan(); - } - const flags = scanner2.getTokenFlags(); - 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 & 33554432 /* Ambient */) || isInJSDoc(useSite) || 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 === 212 /* PropertyAccessExpression */) { - node = node.parent; - } - if (node.kind !== 168 /* ComputedPropertyName */) { - return false; - } - if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) { - return true; - } - const containerKind = node.parent.parent.kind; - return containerKind === 265 /* InterfaceDeclaration */ || containerKind === 188 /* TypeLiteral */; -} -function isIdentifierInNonEmittingHeritageClause(node) { - if (node.kind !== 80 /* Identifier */) return false; - const heritageClause = findAncestor(node.parent, (parent2) => { - switch (parent2.kind) { - case 299 /* HeritageClause */: - return true; - case 212 /* PropertyAccessExpression */: - case 234 /* ExpressionWithTypeArguments */: - return false; - default: - return "quit"; - } - }); - return (heritageClause == null ? void 0 : heritageClause.token) === 119 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 265 /* InterfaceDeclaration */; -} -function isIdentifierTypeReference(node) { - return isTypeReferenceNode(node) && isIdentifier(node.typeName); -} -function arrayIsHomogeneous(array, comparer = equateValues) { - if (array.length < 2) return true; - const first2 = array[0]; - for (let i = 1, length2 = array.length; i < length2; i++) { - const target = array[i]; - if (!comparer(first2, target)) return false; - } - return true; -} -function setTextRangePos(range, pos) { - range.pos = pos; - return range; -} -function setTextRangeEnd(range, end) { - range.end = end; - return range; -} -function setTextRangePosEnd(range, pos, end) { - return setTextRangeEnd(setTextRangePos(range, pos), end); -} -function setTextRangePosWidth(range, pos, width) { - return setTextRangePosEnd(range, pos, pos + width); -} -function setNodeFlags(node, newFlags) { - if (node) { - node.flags = newFlags; - } - return node; -} -function setParent(child, parent2) { - if (child && parent2) { - child.parent = parent2; - } - return child; -} -function setParentRecursive(rootNode, incremental) { - if (!rootNode) return rootNode; - forEachChildRecursively(rootNode, isJSDocNode(rootNode) ? bindParentToChildIgnoringJSDoc : bindParentToChild); - return rootNode; - function bindParentToChildIgnoringJSDoc(child, parent2) { - if (incremental && child.parent === parent2) { - return "skip"; - } - setParent(child, parent2); - } - function bindJSDoc(child) { - if (hasJSDocNodes(child)) { - for (const doc of child.jsDoc) { - bindParentToChildIgnoringJSDoc(doc, child); - forEachChildRecursively(doc, bindParentToChildIgnoringJSDoc); - } - } - } - function bindParentToChild(child, parent2) { - return bindParentToChildIgnoringJSDoc(child, parent2) || bindJSDoc(child); - } -} -function isPackedElement(node) { - return !isOmittedExpression(node); -} -function isPackedArrayLiteral(node) { - return isArrayLiteralExpression(node) && every(node.elements, isPackedElement); -} -function expressionResultIsUnused(node) { - Debug.assertIsDefined(node.parent); - while (true) { - const parent2 = node.parent; - if (isParenthesizedExpression(parent2)) { - node = parent2; - continue; - } - if (isExpressionStatement(parent2) || isVoidExpression(parent2) || isForStatement(parent2) && (parent2.initializer === node || parent2.incrementor === node)) { - return true; - } - if (isCommaListExpression(parent2)) { - if (node !== last(parent2.elements)) return true; - node = parent2; - continue; - } - if (isBinaryExpression(parent2) && parent2.operatorToken.kind === 28 /* CommaToken */) { - if (node === parent2.left) return true; - node = parent2; - continue; - } - return false; - } -} -function containsIgnoredPath(path) { - return some(ignoredPaths, (p) => path.includes(p)); -} -function getContainingNodeArray(node) { - if (!node.parent) return void 0; - switch (node.kind) { - case 169 /* TypeParameter */: - const { parent: parent3 } = node; - return parent3.kind === 196 /* InferType */ ? void 0 : parent3.typeParameters; - case 170 /* Parameter */: - return node.parent.parameters; - case 205 /* TemplateLiteralTypeSpan */: - return node.parent.templateSpans; - case 240 /* TemplateSpan */: - return node.parent.templateSpans; - case 171 /* Decorator */: { - const { parent: parent4 } = node; - return canHaveDecorators(parent4) ? parent4.modifiers : void 0; - } - case 299 /* HeritageClause */: - return node.parent.heritageClauses; - } - const { parent: parent2 } = node; - if (isJSDocTag(node)) { - return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; - } - switch (parent2.kind) { - case 188 /* TypeLiteral */: - case 265 /* InterfaceDeclaration */: - return isTypeElement(node) ? parent2.members : void 0; - case 193 /* UnionType */: - case 194 /* IntersectionType */: - return parent2.types; - case 190 /* TupleType */: - case 210 /* ArrayLiteralExpression */: - case 357 /* CommaListExpression */: - case 276 /* NamedImports */: - case 280 /* NamedExports */: - return parent2.elements; - case 211 /* ObjectLiteralExpression */: - case 293 /* JsxAttributes */: - return parent2.properties; - case 214 /* CallExpression */: - case 215 /* NewExpression */: - return isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments; - case 285 /* JsxElement */: - case 289 /* JsxFragment */: - return isJsxChild(node) ? parent2.children : void 0; - case 287 /* JsxOpeningElement */: - case 286 /* JsxSelfClosingElement */: - return isTypeNode(node) ? parent2.typeArguments : void 0; - case 242 /* Block */: - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - case 269 /* ModuleBlock */: - return parent2.statements; - case 270 /* CaseBlock */: - return parent2.clauses; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return isClassElement(node) ? parent2.members : void 0; - case 267 /* EnumDeclaration */: - return isEnumMember(node) ? parent2.members : void 0; - case 308 /* SourceFile */: - return parent2.statements; - } -} -function hasContextSensitiveParameters(node) { - if (!node.typeParameters) { - if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) { - return true; - } - if (node.kind !== 220 /* ArrowFunction */) { - const parameter = firstOrUndefined(node.parameters); - if (!(parameter && parameterIsThisKeyword(parameter))) { - return true; - } - } - } - return false; -} -function isInfinityOrNaNString(name) { - return name === "Infinity" || name === "-Infinity" || name === "NaN"; -} -function isCatchClauseVariableDeclaration(node) { - return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 300 /* CatchClause */; -} -function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 219 /* FunctionExpression */ || node.kind === 220 /* ArrowFunction */; -} -function escapeSnippetText(text) { - return text.replace(/\$/g, () => "\\$"); -} -function isNumericLiteralName(name) { - return (+name).toString() === name; -} -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); -} -function getNodeModulePathParts(fullPath) { - let topLevelNodeModulesIndex = 0; - let topLevelPackageNameIndex = 0; - let packageRootIndex = 0; - let fileNameIndex = 0; - let States; - ((States2) => { - States2[States2["BeforeNodeModules"] = 0] = "BeforeNodeModules"; - States2[States2["NodeModules"] = 1] = "NodeModules"; - States2[States2["Scope"] = 2] = "Scope"; - States2[States2["PackageContent"] = 3] = "PackageContent"; - })(States || (States = {})); - let partStart = 0; - let partEnd = 0; - let state = 0 /* BeforeNodeModules */; - while (partEnd >= 0) { - partStart = partEnd; - partEnd = fullPath.indexOf("/", partStart + 1); - switch (state) { - case 0 /* BeforeNodeModules */: - if (fullPath.indexOf(nodeModulesPathPart, partStart) === partStart) { - topLevelNodeModulesIndex = partStart; - topLevelPackageNameIndex = partEnd; - state = 1 /* NodeModules */; - } - break; - case 1 /* NodeModules */: - case 2 /* Scope */: - if (state === 1 /* NodeModules */ && fullPath.charAt(partStart + 1) === "@") { - state = 2 /* Scope */; - } else { - packageRootIndex = partEnd; - state = 3 /* PackageContent */; - } - break; - case 3 /* PackageContent */: - if (fullPath.indexOf(nodeModulesPathPart, partStart) === partStart) { - state = 1 /* NodeModules */; - } else { - state = 3 /* PackageContent */; - } - break; - } - } - fileNameIndex = partStart; - return state > 1 /* NodeModules */ ? { topLevelNodeModulesIndex, topLevelPackageNameIndex, packageRootIndex, fileNameIndex } : void 0; -} -function isTypeDeclaration(node) { - switch (node.kind) { - case 169 /* TypeParameter */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 267 /* EnumDeclaration */: - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - return true; - case 274 /* ImportClause */: - return node.phaseModifier === 156 /* TypeKeyword */; - case 277 /* ImportSpecifier */: - return node.parent.parent.phaseModifier === 156 /* TypeKeyword */; - case 282 /* ExportSpecifier */: - return node.parent.parent.isTypeOnly; - default: - return false; - } -} -function canHaveExportModifier(node) { - return isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isTypeDeclaration(node) || isModuleDeclaration(node) && !isExternalModuleAugmentation(node) && !isGlobalScopeAugmentation(node); -} -function isOptionalJSDocPropertyLikeTag(node) { - if (!isJSDocPropertyLikeTag(node)) { - return false; - } - const { isBracketed, typeExpression } = node; - return isBracketed || !!typeExpression && typeExpression.type.kind === 317 /* JSDocOptionalType */; -} -function canUsePropertyAccess(name, languageVersion) { - if (name.length === 0) { - return false; - } - const firstChar = name.charCodeAt(0); - return firstChar === 35 /* hash */ ? name.length > 1 && isIdentifierStart(name.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion); -} -function hasTabstop(node) { - var _a; - return ((_a = getSnippetElement(node)) == null ? void 0 : _a.kind) === 0 /* TabStop */; -} -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 === 317 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag)); -} -function isOptionalDeclaration(declaration) { - switch (declaration.kind) { - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - return !!declaration.questionToken; - case 170 /* Parameter */: - return !!declaration.questionToken || isJSDocOptionalParameter(declaration); - case 349 /* JSDocPropertyTag */: - case 342 /* JSDocParameterTag */: - return isOptionalJSDocPropertyLikeTag(declaration); - default: - return false; - } -} -function isNonNullAccess(node) { - const kind = node.kind; - return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && isNonNullExpression(node.expression); -} -function isJSDocSatisfiesExpression(node) { - return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); -} -function getJSDocSatisfiesExpressionType(node) { - return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node)); -} -function tryGetJSDocSatisfiesTypeNode(node) { - const tag = getJSDocSatisfiesTag(node); - return tag && tag.typeExpression && tag.typeExpression.type; -} -function getEscapedTextOfJsxAttributeName(node) { - return isIdentifier(node) ? node.escapedText : getEscapedTextOfJsxNamespacedName(node); -} -function getTextOfJsxAttributeName(node) { - return isIdentifier(node) ? idText(node) : getTextOfJsxNamespacedName(node); -} -function isJsxAttributeName(node) { - const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 296 /* JsxNamespacedName */; -} -function getEscapedTextOfJsxNamespacedName(node) { - return `${node.namespace.escapedText}:${idText(node.name)}`; -} -function getTextOfJsxNamespacedName(node) { - return `${idText(node.namespace)}:${idText(node.name)}`; -} -function intrinsicTagNameToString(node) { - return isIdentifier(node) ? idText(node) : getTextOfJsxNamespacedName(node); -} -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); -} -var stringReplace = String.prototype.replace; -function replaceFirstStar(s, replacement) { - return stringReplace.call(s, "*", replacement); -} -function getNameFromImportAttribute(node) { - return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text); -} -function isSourceElement(node) { - switch (node.kind) { - case 169 /* TypeParameter */: - case 170 /* Parameter */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 186 /* ConstructorType */: - case 185 /* FunctionType */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 182 /* IndexSignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 176 /* ClassStaticBlockDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 184 /* TypeReference */: - case 183 /* TypePredicate */: - case 187 /* TypeQuery */: - case 188 /* TypeLiteral */: - case 189 /* ArrayType */: - case 190 /* TupleType */: - case 193 /* UnionType */: - case 194 /* IntersectionType */: - case 197 /* ParenthesizedType */: - case 191 /* OptionalType */: - case 192 /* RestType */: - case 198 /* ThisType */: - case 199 /* TypeOperator */: - case 195 /* ConditionalType */: - case 196 /* InferType */: - case 204 /* TemplateLiteralType */: - case 206 /* ImportType */: - case 203 /* NamedTupleMember */: - case 329 /* JSDocAugmentsTag */: - case 330 /* JSDocImplementsTag */: - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - case 346 /* JSDocTemplateTag */: - case 345 /* JSDocTypeTag */: - case 325 /* JSDocLink */: - case 326 /* JSDocLinkCode */: - case 327 /* JSDocLinkPlain */: - case 342 /* JSDocParameterTag */: - case 349 /* JSDocPropertyTag */: - case 318 /* JSDocFunctionType */: - case 316 /* JSDocNonNullableType */: - case 315 /* JSDocNullableType */: - case 313 /* JSDocAllType */: - case 314 /* JSDocUnknownType */: - case 323 /* JSDocTypeLiteral */: - case 319 /* JSDocVariadicType */: - case 310 /* JSDocTypeExpression */: - case 334 /* JSDocPublicTag */: - case 336 /* JSDocProtectedTag */: - case 335 /* JSDocPrivateTag */: - case 351 /* JSDocSatisfiesTag */: - case 344 /* JSDocThisTag */: - case 200 /* IndexedAccessType */: - case 201 /* MappedType */: - case 263 /* FunctionDeclaration */: - case 242 /* Block */: - case 269 /* ModuleBlock */: - case 244 /* VariableStatement */: - case 245 /* ExpressionStatement */: - case 246 /* IfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 252 /* ContinueStatement */: - case 253 /* BreakStatement */: - case 254 /* ReturnStatement */: - case 255 /* WithStatement */: - case 256 /* SwitchStatement */: - case 257 /* LabeledStatement */: - case 258 /* ThrowStatement */: - case 259 /* TryStatement */: - case 261 /* VariableDeclaration */: - case 209 /* BindingElement */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 267 /* EnumDeclaration */: - case 268 /* ModuleDeclaration */: - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 279 /* ExportDeclaration */: - case 278 /* ExportAssignment */: - case 243 /* EmptyStatement */: - case 260 /* DebuggerStatement */: - case 283 /* MissingDeclaration */: - return true; - } - return false; -} -function evaluatorResult(value, isSyntacticallyString = false, resolvedOtherFiles = false, hasExternalReferences = false) { - return { value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences }; -} -function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameExpression }) { - function evaluate(expr, location) { - let isSyntacticallyString = false; - let resolvedOtherFiles = false; - let hasExternalReferences = false; - expr = skipParentheses(expr); - switch (expr.kind) { - case 225 /* PrefixUnaryExpression */: - const result = evaluate(expr.operand, location); - resolvedOtherFiles = result.resolvedOtherFiles; - hasExternalReferences = result.hasExternalReferences; - if (typeof result.value === "number") { - switch (expr.operator) { - case 40 /* PlusToken */: - return evaluatorResult(result.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 41 /* MinusToken */: - return evaluatorResult(-result.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 55 /* TildeToken */: - return evaluatorResult(~result.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - } - } - break; - case 227 /* BinaryExpression */: { - const left = evaluate(expr.left, location); - const right = evaluate(expr.right, location); - isSyntacticallyString = (left.isSyntacticallyString || right.isSyntacticallyString) && expr.operatorToken.kind === 40 /* PlusToken */; - resolvedOtherFiles = left.resolvedOtherFiles || right.resolvedOtherFiles; - hasExternalReferences = left.hasExternalReferences || right.hasExternalReferences; - if (typeof left.value === "number" && typeof right.value === "number") { - switch (expr.operatorToken.kind) { - case 52 /* BarToken */: - return evaluatorResult(left.value | right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 51 /* AmpersandToken */: - return evaluatorResult(left.value & right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 49 /* GreaterThanGreaterThanToken */: - return evaluatorResult(left.value >> right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - return evaluatorResult(left.value >>> right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 48 /* LessThanLessThanToken */: - return evaluatorResult(left.value << right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 53 /* CaretToken */: - return evaluatorResult(left.value ^ right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 42 /* AsteriskToken */: - return evaluatorResult(left.value * right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 44 /* SlashToken */: - return evaluatorResult(left.value / right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 40 /* PlusToken */: - return evaluatorResult(left.value + right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 41 /* MinusToken */: - return evaluatorResult(left.value - right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 45 /* PercentToken */: - return evaluatorResult(left.value % right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - case 43 /* AsteriskAsteriskToken */: - return evaluatorResult(left.value ** right.value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences); - } - } else if ((typeof left.value === "string" || typeof left.value === "number") && (typeof right.value === "string" || typeof right.value === "number") && expr.operatorToken.kind === 40 /* PlusToken */) { - return evaluatorResult( - "" + left.value + right.value, - isSyntacticallyString, - resolvedOtherFiles, - hasExternalReferences - ); - } - break; - } - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - return evaluatorResult( - expr.text, - /*isSyntacticallyString*/ - true - ); - case 229 /* TemplateExpression */: - return evaluateTemplateExpression(expr, location); - case 9 /* NumericLiteral */: - return evaluatorResult(+expr.text); - case 80 /* Identifier */: - return evaluateEntityNameExpression(expr, location); - case 212 /* PropertyAccessExpression */: - if (isEntityNameExpression(expr)) { - return evaluateEntityNameExpression(expr, location); - } - break; - case 213 /* ElementAccessExpression */: - return evaluateElementAccessExpression(expr, location); - } - return evaluatorResult( - /*value*/ - void 0, - isSyntacticallyString, - resolvedOtherFiles, - hasExternalReferences - ); - } - function evaluateTemplateExpression(expr, location) { - let result = expr.head.text; - let resolvedOtherFiles = false; - let hasExternalReferences = false; - for (const span of expr.templateSpans) { - const spanResult = evaluate(span.expression, location); - if (spanResult.value === void 0) { - return evaluatorResult( - /*value*/ - void 0, - /*isSyntacticallyString*/ - true - ); - } - result += spanResult.value; - result += span.literal.text; - resolvedOtherFiles || (resolvedOtherFiles = spanResult.resolvedOtherFiles); - hasExternalReferences || (hasExternalReferences = spanResult.hasExternalReferences); - } - return evaluatorResult( - result, - /*isSyntacticallyString*/ - true, - resolvedOtherFiles, - hasExternalReferences - ); - } - return evaluate; -} -function isConstAssertion(location) { - return isAssertionExpression(location) && isConstTypeReference(location.type) || isJSDocTypeTag(location) && isConstTypeReference(location.typeExpression); -} -function findConstructorDeclaration(node) { - const members = node.members; - for (const member of members) { - if (member.kind === 177 /* Constructor */ && nodeIsPresent(member.body)) { - return member; - } - } -} -function createNameResolver({ - compilerOptions, - requireSymbol, - argumentsSymbol, - error: error2, - getSymbolOfDeclaration, - globals, - lookup, - setRequiresScopeChangeCache = returnUndefined, - getRequiresScopeChangeCache = returnUndefined, - onPropertyWithInvalidInitializer = returnFalse, - onFailedToResolveSymbol = returnUndefined, - onSuccessfullyResolvedSymbol = returnUndefined -}) { - var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; - var emitStandardClassFields = getEmitStandardClassFields(compilerOptions); - var emptySymbols = createSymbolTable(); - return resolveNameHelper; - function resolveNameHelper(location, nameArg, meaning, nameNotFoundMessage, isUse, excludeGlobals) { - var _a, _b, _c; - const originalLocation = location; - let result; - let lastLocation; - let lastSelfReferenceLocation; - let propertyWithInvalidInitializer; - let associatedDeclarationForContainingInitializerOrBindingName; - let withinDeferredContext = false; - let grandparent; - const name = isString(nameArg) ? nameArg : nameArg.escapedText; - loop: - while (location) { - if (name === "const" && isConstAssertion(location)) { - return void 0; - } - if (isModuleOrEnumDeclaration(location) && lastLocation && location.name === lastLocation) { - lastLocation = location; - location = location.parent; - } - if (canHaveLocals(location) && location.locals && !isGlobalSourceFile(location)) { - 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 !== 321 /* JSDoc */) { - useResult = result.flags & 262144 /* TypeParameter */ ? !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so type parameters are accessible from them - lastLocation === location.type || lastLocation.kind === 170 /* Parameter */ || lastLocation.kind === 342 /* JSDocParameterTag */ || lastLocation.kind === 343 /* JSDocReturnTag */ || lastLocation.kind === 169 /* TypeParameter */ : false; - } - if (meaning & result.flags & 3 /* Variable */) { - if (useOuterVariableScopeInParameter(result, location, lastLocation)) { - useResult = false; - } else if (result.flags & 1 /* FunctionScopedVariable */) { - useResult = lastLocation.kind === 170 /* Parameter */ || !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so parameters are accessible from them - lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter); - } - } - } else if (location.kind === 195 /* ConditionalType */) { - useResult = lastLocation === location.trueType; - } - if (useResult) { - break loop; - } else { - result = void 0; - } - } - } - withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); - switch (location.kind) { - case 308 /* SourceFile */: - if (!isExternalOrCommonJsModule(location)) break; - // falls through - case 268 /* ModuleDeclaration */: - const moduleExports = ((_a = getSymbolOfDeclaration(location)) == null ? void 0 : _a.exports) || emptySymbols; - if (location.kind === 308 /* 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) { - break loop; - } - result = void 0; - } - const moduleExport = moduleExports.get(name); - if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 282 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 281 /* NamespaceExport */))) { - break; - } - } - if (name !== "default" /* Default */ && (result = lookup(moduleExports, name, meaning & 2623475 /* ModuleMember */))) { - if (isSourceFile(location) && location.commonJsModuleIndicator && !((_b = result.declarations) == null ? void 0 : _b.some(isJSDocTypeAlias))) { - result = void 0; - } else { - break loop; - } - } - break; - case 267 /* EnumDeclaration */: - if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { - if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 33554432 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { - error2( - originalLocation, - Diagnostics.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead, - unescapeLeadingUnderscores(name), - isolatedModulesLikeFlagName, - `${unescapeLeadingUnderscores(getSymbolOfDeclaration(location).escapedName)}.${unescapeLeadingUnderscores(name)}` - ); - } - break loop; - } - break; - case 173 /* PropertyDeclaration */: - if (!isStatic(location)) { - const ctor = findConstructorDeclaration(location.parent); - if (ctor && ctor.locals) { - if (lookup(ctor.locals, name, meaning & 111551 /* Value */)) { - Debug.assertNode(location, isPropertyDeclaration); - propertyWithInvalidInitializer = location; - } - } - } - break; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - if (result = lookup(getSymbolOfDeclaration(location).members || emptySymbols, name, meaning & 788968 /* Type */)) { - if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { - result = void 0; - break; - } - if (lastLocation && isStatic(lastLocation)) { - if (nameNotFoundMessage) { - error2(originalLocation, Diagnostics.Static_members_cannot_reference_class_type_parameters); - } - return void 0; - } - break loop; - } - if (isClassExpression(location) && meaning & 32 /* Class */) { - const className = location.name; - if (className && name === className.escapedText) { - result = location.symbol; - break loop; - } - } - break; - case 234 /* 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) { - error2(originalLocation, Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); - } - return void 0; - } - } - break; - // It is not legal to reference a class's own type parameters from a computed property name that - // belongs to the class. For example: - // - // function foo() { return '' } - // class C { // <-- Class's own type parameter T - // [foo()]() { } // <-- Reference to T from class's own computed property - // } - // - case 168 /* ComputedPropertyName */: - grandparent = location.parent.parent; - if (isClassLike(grandparent) || grandparent.kind === 265 /* InterfaceDeclaration */) { - if (result = lookup(getSymbolOfDeclaration(grandparent).members, name, meaning & 788968 /* Type */)) { - if (nameNotFoundMessage) { - error2(originalLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); - } - return void 0; - } - } - break; - case 220 /* ArrowFunction */: - if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) { - break; - } - // falls through - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 263 /* FunctionDeclaration */: - if (meaning & 3 /* Variable */ && name === "arguments") { - result = argumentsSymbol; - break loop; - } - break; - case 219 /* FunctionExpression */: - if (meaning & 3 /* Variable */ && name === "arguments") { - result = argumentsSymbol; - break loop; - } - if (meaning & 16 /* Function */) { - const functionName = location.name; - if (functionName && name === functionName.escapedText) { - result = location.symbol; - break loop; - } - } - break; - case 171 /* Decorator */: - if (location.parent && location.parent.kind === 170 /* Parameter */) { - location = location.parent; - } - if (location.parent && (isClassElement(location.parent) || location.parent.kind === 264 /* ClassDeclaration */)) { - location = location.parent; - } - break; - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - case 352 /* JSDocImportTag */: - const root = getJSDocRoot(location); - if (root) { - location = root.parent; - } - break; - case 170 /* Parameter */: - if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { - if (!associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 209 /* BindingElement */: - if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { - if (isPartOfParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 196 /* InferType */: - if (meaning & 262144 /* TypeParameter */) { - const parameterName = location.typeParameter.name; - if (parameterName && name === parameterName.escapedText) { - result = location.typeParameter.symbol; - break loop; - } - } - break; - case 282 /* ExportSpecifier */: - if (lastLocation && lastLocation === location.propertyName && location.parent.parent.moduleSpecifier) { - location = location.parent.parent.parent; - } - break; - } - if (isSelfReferenceLocation(location, lastLocation)) { - lastSelfReferenceLocation = location; - } - lastLocation = location; - location = isJSDocTemplateTag(location) ? getEffectiveContainerForJSDocTemplateTag(location) || location.parent : isJSDocParameterTag(location) || isJSDocReturnTag(location) ? getHostSignatureFromJSDoc(location) || location.parent : location.parent; - } - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { - result.isReferenced |= meaning; - } - if (!result) { - if (lastLocation) { - Debug.assertNode(lastLocation, isSourceFile); - if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { - return lastLocation.symbol; - } - } - if (!excludeGlobals) { - result = lookup(globals, name, meaning); - } - } - if (!result) { - if (originalLocation && isInJSFile(originalLocation) && originalLocation.parent) { - if (isRequireCall( - originalLocation.parent, - /*requireStringLiteralLikeArgument*/ - false - )) { - return requireSymbol; - } - } - } - if (nameNotFoundMessage) { - if (propertyWithInvalidInitializer && onPropertyWithInvalidInitializer(originalLocation, name, propertyWithInvalidInitializer, result)) { - return void 0; - } - if (!result) { - onFailedToResolveSymbol(originalLocation, nameArg, meaning, nameNotFoundMessage); - } else { - onSuccessfullyResolvedSymbol(originalLocation, result, meaning, lastLocation, associatedDeclarationForContainingInitializerOrBindingName, withinDeferredContext); - } - } - return result; - } - function useOuterVariableScopeInParameter(result, location, lastLocation) { - const target = getEmitScriptTarget(compilerOptions); - const functionLocation = location; - if (isParameter(lastLocation) && functionLocation.body && result.valueDeclaration && result.valueDeclaration.pos >= functionLocation.body.pos && result.valueDeclaration.end <= functionLocation.body.end) { - if (target >= 2 /* ES2015 */) { - let declarationRequiresScopeChange = getRequiresScopeChangeCache(functionLocation); - if (declarationRequiresScopeChange === void 0) { - declarationRequiresScopeChange = forEach(functionLocation.parameters, requiresScopeChange) || false; - setRequiresScopeChangeCache(functionLocation, declarationRequiresScopeChange); - } - return !declarationRequiresScopeChange; - } - } - return false; - function requiresScopeChange(node) { - return requiresScopeChangeWorker(node.name) || !!node.initializer && requiresScopeChangeWorker(node.initializer); - } - function requiresScopeChangeWorker(node) { - switch (node.kind) { - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 177 /* Constructor */: - return false; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 304 /* PropertyAssignment */: - return requiresScopeChangeWorker(node.name); - case 173 /* PropertyDeclaration */: - if (hasStaticModifier(node)) { - return !emitStandardClassFields; - } - return requiresScopeChangeWorker(node.name); - default: - if (isNullishCoalesce(node) || isOptionalChain(node)) { - return target < 7 /* ES2020 */; - } - if (isBindingElement(node) && node.dotDotDotToken && isObjectBindingPattern(node.parent)) { - return target < 4 /* ES2017 */; - } - if (isTypeNode(node)) return false; - return forEachChild(node, requiresScopeChangeWorker) || false; - } - } - } - function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 220 /* ArrowFunction */ && location.kind !== 219 /* FunctionExpression */) { - return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 173 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name); - } - if (lastLocation && lastLocation === location.name) { - return false; - } - if (location.asteriskToken || hasSyntacticModifier(location, 1024 /* Async */)) { - return true; - } - return !getImmediatelyInvokedFunctionExpression(location); - } - function isSelfReferenceLocation(node, lastLocation) { - switch (node.kind) { - case 170 /* Parameter */: - return !!lastLocation && lastLocation === node.name; - case 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 268 /* ModuleDeclaration */: - return true; - default: - return false; - } - } - function isTypeParameterSymbolDeclaredInContainer(symbol, container) { - if (symbol.declarations) { - for (const decl of symbol.declarations) { - if (decl.kind === 169 /* TypeParameter */) { - const parent2 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent; - if (parent2 === container) { - return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias)); - } - } - } - } - return false; - } -} -function isPrimitiveLiteralValue(node, includeBigInt = true) { - Debug.type(node); - switch (node.kind) { - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 9 /* NumericLiteral */: - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - return true; - case 10 /* BigIntLiteral */: - return includeBigInt; - case 225 /* PrefixUnaryExpression */: - if (node.operator === 41 /* MinusToken */) { - return isNumericLiteral(node.operand) || includeBigInt && isBigIntLiteral(node.operand); - } - if (node.operator === 40 /* PlusToken */) { - return isNumericLiteral(node.operand); - } - return false; - default: - assertType(node); - return false; - } -} -function unwrapParenthesizedExpression(o) { - while (o.kind === 218 /* ParenthesizedExpression */) { - o = o.expression; - } - return o; -} -function hasInferredType(node) { - Debug.type(node); - switch (node.kind) { - case 170 /* Parameter */: - case 172 /* PropertySignature */: - case 173 /* PropertyDeclaration */: - case 209 /* BindingElement */: - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - case 227 /* BinaryExpression */: - case 261 /* VariableDeclaration */: - case 278 /* ExportAssignment */: - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - case 342 /* JSDocParameterTag */: - case 349 /* JSDocPropertyTag */: - return true; - default: - assertType(node); - return false; - } -} -function isSideEffectImport(node) { - const ancestor = findAncestor(node, isImportDeclaration); - return !!ancestor && !ancestor.importClause; -} -var unprefixedNodeCoreModulesList = [ - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "inspector/promises", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "readline/promises", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "test/mock_loader", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "wasi", - "worker_threads", - "zlib" -]; -var unprefixedNodeCoreModules = new Set(unprefixedNodeCoreModulesList); -var exclusivelyPrefixedNodeCoreModules = /* @__PURE__ */ new Set([ - "node:sea", - "node:sqlite", - "node:test", - "node:test/reporters" -]); -var nodeCoreModules = /* @__PURE__ */ new Set([ - ...unprefixedNodeCoreModulesList, - ...unprefixedNodeCoreModulesList.map((name) => `node:${name}`), - ...exclusivelyPrefixedNodeCoreModules -]); -function forEachDynamicImportOrRequireCall(file, includeTypeSpaceImports, requireStringLiteralLikeArgument, cb) { - const isJavaScriptFile = isInJSFile(file); - const r = /import|require/g; - while (r.exec(file.text) !== null) { - const node = getNodeAtPosition( - file, - r.lastIndex, - /*includeJSDoc*/ - includeTypeSpaceImports - ); - if (isJavaScriptFile && isRequireCall(node, requireStringLiteralLikeArgument)) { - cb(node, node.arguments[0]); - } else if (isImportCall(node) && node.arguments.length >= 1 && (!requireStringLiteralLikeArgument || isStringLiteralLike(node.arguments[0]))) { - cb(node, node.arguments[0]); - } else if (includeTypeSpaceImports && isLiteralImportTypeNode(node)) { - cb(node, node.argument.literal); - } else if (includeTypeSpaceImports && isJSDocImportTag(node)) { - const moduleNameExpr = getExternalModuleName(node); - if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) { - cb(node, moduleNameExpr); - } - } - } -} -function getNodeAtPosition(sourceFile, position, includeJSDoc) { - const isJavaScriptFile = isInJSFile(sourceFile); - let current = sourceFile; - const getContainingChild = (child) => { - if (child.pos <= position && (position < child.end || position === child.end && child.kind === 1 /* EndOfFileToken */)) { - return child; - } - }; - while (true) { - const child = isJavaScriptFile && includeJSDoc && hasJSDocNodes(current) && forEach(current.jsDoc, getContainingChild) || forEachChild(current, getContainingChild); - if (!child || isMetaProperty(child)) { - return current; - } - current = child; - } -} -function isNewScopeNode(node) { - return isFunctionLike(node) || isJSDocSignature(node) || isMappedTypeNode(node); -} -function getLibNameFromLibReference(libReference) { - return toFileNameLowerCase(libReference.fileName); -} -function getLibFileNameFromLibReference(libReference) { - const libName = getLibNameFromLibReference(libReference); - return libMap.get(libName); -} -function forEachResolvedProjectReference(resolvedProjectReferences, cb) { - return forEachProjectReference( - /*projectReferences*/ - void 0, - resolvedProjectReferences, - (resolvedRef) => resolvedRef && cb(resolvedRef) - ); -} -function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { - let seenResolvedRefs; - return worker( - projectReferences, - resolvedProjectReferences, - /*parent*/ - void 0 - ); - function worker(projectReferences2, resolvedProjectReferences2, parent2) { - if (cbRef) { - const result = cbRef(projectReferences2, parent2); - if (result) return result; - } - let skipChildren; - return forEach( - resolvedProjectReferences2, - (resolvedRef, index) => { - if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { - (skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef); - return void 0; - } - const result = cbResolvedRef(resolvedRef, parent2, index); - if (result || !resolvedRef) return result; - (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path); - } - ) || forEach( - resolvedProjectReferences2, - (resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0 - ); - } -} -function getOptionsSyntaxByArrayElementValue(optionsObject, name, value) { - return optionsObject && getPropertyArrayElementValue(optionsObject, name, value); -} -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); -} -function getOptionsSyntaxByValue(optionsObject, name, value) { - return forEachOptionsSyntaxByName(optionsObject, name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value ? property.initializer : void 0); -} -function forEachOptionsSyntaxByName(optionsObject, name, callback) { - return forEachPropertyAssignment(optionsObject, name, callback); -} -function getSynthesizedDeepClone(node, includeTrivia = true) { - const clone2 = node && getSynthesizedDeepCloneWorker(node); - if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); - return setParentRecursive( - clone2, - /*incremental*/ - false - ); -} -function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { - let clone2 = replaceNode(node); - if (clone2) { - setOriginalNode(clone2, node); - } else { - clone2 = getSynthesizedDeepCloneWorker(node, replaceNode); - } - if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); - return clone2; -} -function getSynthesizedDeepCloneWorker(node, replaceNode) { - const nodeClone = replaceNode ? (n) => getSynthesizedDeepCloneWithReplacements( - n, - /*includeTrivia*/ - true, - replaceNode - ) : getSynthesizedDeepClone; - const nodesClone = replaceNode ? (ns) => ns && getSynthesizedDeepClonesWithReplacements( - ns, - /*includeTrivia*/ - true, - replaceNode - ) : (ns) => ns && getSynthesizedDeepClones(ns); - 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); - } - visited.parent = void 0; - return visited; -} -function getSynthesizedDeepClones(nodes, includeTrivia = true) { - if (nodes) { - const cloned = factory.createNodeArray(nodes.map((n) => getSynthesizedDeepClone(n, includeTrivia)), nodes.hasTrailingComma); - setTextRange(cloned, nodes); - return cloned; - } - return nodes; -} -function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { - return factory.createNodeArray(nodes.map((n) => getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode)), nodes.hasTrailingComma); -} -function suppressLeadingAndTrailingTrivia(node) { - suppressLeadingTrivia(node); - suppressTrailingTrivia(node); -} -function suppressLeadingTrivia(node) { - addEmitFlagsRecursively(node, 1024 /* NoLeadingComments */, getFirstChild); -} -function suppressTrailingTrivia(node) { - addEmitFlagsRecursively(node, 2048 /* NoTrailingComments */, getLastChild); -} -function addEmitFlagsRecursively(node, flag, getChild) { - addEmitFlags(node, flag); - const child = getChild(node); - if (child) addEmitFlagsRecursively(child, flag, getChild); -} -function getFirstChild(node) { - return forEachChild(node, (child) => child); -} - -// src/compiler/factory/baseNodeFactory.ts -function createBaseNodeFactory() { - let NodeConstructor2; - let TokenConstructor2; - let IdentifierConstructor2; - let PrivateIdentifierConstructor2; - let SourceFileConstructor2; - return { - createBaseSourceFileNode, - createBaseIdentifierNode, - createBasePrivateIdentifierNode, - createBaseTokenNode, - createBaseNode - }; - function createBaseSourceFileNode(kind) { - return new (SourceFileConstructor2 || (SourceFileConstructor2 = objectAllocator.getSourceFileConstructor()))( - kind, - /*pos*/ - -1, - /*end*/ - -1 - ); - } - function createBaseIdentifierNode(kind) { - return new (IdentifierConstructor2 || (IdentifierConstructor2 = objectAllocator.getIdentifierConstructor()))( - kind, - /*pos*/ - -1, - /*end*/ - -1 - ); - } - function createBasePrivateIdentifierNode(kind) { - return new (PrivateIdentifierConstructor2 || (PrivateIdentifierConstructor2 = objectAllocator.getPrivateIdentifierConstructor()))( - kind, - /*pos*/ - -1, - /*end*/ - -1 - ); - } - function createBaseTokenNode(kind) { - return new (TokenConstructor2 || (TokenConstructor2 = objectAllocator.getTokenConstructor()))( - kind, - /*pos*/ - -1, - /*end*/ - -1 - ); - } - function createBaseNode(kind) { - return new (NodeConstructor2 || (NodeConstructor2 = objectAllocator.getNodeConstructor()))( - kind, - /*pos*/ - -1, - /*end*/ - -1 - ); - } -} - -// src/compiler/factory/parenthesizerRules.ts -function createParenthesizerRules(factory2) { - let binaryLeftOperandParenthesizerCache; - let binaryRightOperandParenthesizerCache; - return { - getParenthesizeLeftSideOfBinaryForOperator, - getParenthesizeRightSideOfBinaryForOperator, - parenthesizeLeftSideOfBinary, - parenthesizeRightSideOfBinary, - parenthesizeExpressionOfComputedPropertyName, - parenthesizeConditionOfConditionalExpression, - parenthesizeBranchOfConditionalExpression, - parenthesizeExpressionOfExportDefault, - parenthesizeExpressionOfNew, - parenthesizeLeftSideOfAccess, - parenthesizeOperandOfPostfixUnary, - parenthesizeOperandOfPrefixUnary, - parenthesizeExpressionsOfCommaDelimitedList, - parenthesizeExpressionForDisallowedComma, - parenthesizeExpressionOfExpressionStatement, - parenthesizeConciseBodyOfArrowFunction, - parenthesizeCheckTypeOfConditionalType, - parenthesizeExtendsTypeOfConditionalType, - parenthesizeConstituentTypesOfUnionType, - parenthesizeConstituentTypeOfUnionType, - parenthesizeConstituentTypesOfIntersectionType, - parenthesizeConstituentTypeOfIntersectionType, - parenthesizeOperandOfTypeOperator, - parenthesizeOperandOfReadonlyTypeOperator, - parenthesizeNonArrayTypeOfPostfixType, - parenthesizeElementTypesOfTupleType, - parenthesizeElementTypeOfTupleType, - parenthesizeTypeOfOptionalType, - parenthesizeTypeArguments, - parenthesizeLeadingTypeArgument - }; - function getParenthesizeLeftSideOfBinaryForOperator(operatorKind) { - binaryLeftOperandParenthesizerCache || (binaryLeftOperandParenthesizerCache = /* @__PURE__ */ new Map()); - let parenthesizerRule = binaryLeftOperandParenthesizerCache.get(operatorKind); - if (!parenthesizerRule) { - parenthesizerRule = (node) => parenthesizeLeftSideOfBinary(operatorKind, node); - binaryLeftOperandParenthesizerCache.set(operatorKind, parenthesizerRule); - } - return parenthesizerRule; - } - function getParenthesizeRightSideOfBinaryForOperator(operatorKind) { - binaryRightOperandParenthesizerCache || (binaryRightOperandParenthesizerCache = /* @__PURE__ */ new Map()); - let parenthesizerRule = binaryRightOperandParenthesizerCache.get(operatorKind); - if (!parenthesizerRule) { - parenthesizerRule = (node) => parenthesizeRightSideOfBinary( - operatorKind, - /*leftSide*/ - void 0, - node - ); - binaryRightOperandParenthesizerCache.set(operatorKind, parenthesizerRule); - } - return parenthesizerRule; - } - function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator); - const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator); - const emittedOperand = skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 220 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { - return true; - } - const operandPrecedence = getExpressionPrecedence(emittedOperand); - switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) { - case -1 /* LessThan */: - if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) { - return false; - } - return true; - case 1 /* GreaterThan */: - return false; - case 0 /* EqualTo */: - if (isLeftSideOfBinary) { - return binaryOperatorAssociativity === 1 /* Right */; - } else { - if (isBinaryExpression(emittedOperand) && emittedOperand.operatorToken.kind === binaryOperator) { - if (operatorHasAssociativeProperty(binaryOperator)) { - return false; - } - if (binaryOperator === 40 /* PlusToken */) { - const leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0 /* Unknown */; - if (isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { - return false; - } - } - } - const operandAssociativity = getExpressionAssociativity(emittedOperand); - return operandAssociativity === 0 /* Left */; - } - } - } - function operatorHasAssociativeProperty(binaryOperator) { - return binaryOperator === 42 /* AsteriskToken */ || binaryOperator === 52 /* BarToken */ || binaryOperator === 51 /* AmpersandToken */ || binaryOperator === 53 /* CaretToken */ || binaryOperator === 28 /* CommaToken */; - } - function getLiteralKindOfBinaryPlusOperand(node) { - node = skipPartiallyEmittedExpressions(node); - if (isLiteralKind(node.kind)) { - return node.kind; - } - if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 40 /* PlusToken */) { - if (node.cachedLiteralKind !== void 0) { - return node.cachedLiteralKind; - } - const leftKind = getLiteralKindOfBinaryPlusOperand(node.left); - const literalKind = isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) ? leftKind : 0 /* Unknown */; - node.cachedLiteralKind = literalKind; - return literalKind; - } - return 0 /* Unknown */; - } - function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - const skipped = skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 218 /* ParenthesizedExpression */) { - return operand; - } - return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand; - } - function parenthesizeLeftSideOfBinary(binaryOperator, leftSide) { - return parenthesizeBinaryOperand( - binaryOperator, - leftSide, - /*isLeftSideOfBinary*/ - true - ); - } - function parenthesizeRightSideOfBinary(binaryOperator, leftSide, rightSide) { - return parenthesizeBinaryOperand( - binaryOperator, - rightSide, - /*isLeftSideOfBinary*/ - false, - leftSide - ); - } - function parenthesizeExpressionOfComputedPropertyName(expression) { - return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression; - } - function parenthesizeConditionOfConditionalExpression(condition) { - const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 58 /* QuestionToken */); - const emittedCondition = skipPartiallyEmittedExpressions(condition); - const conditionPrecedence = getExpressionPrecedence(emittedCondition); - if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { - return factory2.createParenthesizedExpression(condition); - } - return condition; - } - function parenthesizeBranchOfConditionalExpression(branch) { - const emittedExpression = skipPartiallyEmittedExpressions(branch); - return isCommaSequence(emittedExpression) ? factory2.createParenthesizedExpression(branch) : branch; - } - function parenthesizeExpressionOfExportDefault(expression) { - const check = skipPartiallyEmittedExpressions(expression); - let needsParens = isCommaSequence(check); - if (!needsParens) { - switch (getLeftmostExpression( - check, - /*stopAtCallExpressions*/ - false - ).kind) { - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - needsParens = true; - } - } - return needsParens ? factory2.createParenthesizedExpression(expression) : expression; - } - function parenthesizeExpressionOfNew(expression) { - const leftmostExpr = getLeftmostExpression( - expression, - /*stopAtCallExpressions*/ - true - ); - switch (leftmostExpr.kind) { - case 214 /* CallExpression */: - return factory2.createParenthesizedExpression(expression); - case 215 /* NewExpression */: - return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression; - } - return parenthesizeLeftSideOfAccess(expression); - } - function parenthesizeLeftSideOfAccess(expression, optionalChain) { - const emittedExpression = skipPartiallyEmittedExpressions(expression); - if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 215 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { - return expression; - } - return setTextRange(factory2.createParenthesizedExpression(expression), expression); - } - function parenthesizeOperandOfPostfixUnary(operand) { - return isLeftHandSideExpression(operand) ? operand : setTextRange(factory2.createParenthesizedExpression(operand), operand); - } - function parenthesizeOperandOfPrefixUnary(operand) { - return isUnaryExpression(operand) ? operand : setTextRange(factory2.createParenthesizedExpression(operand), operand); - } - function parenthesizeExpressionsOfCommaDelimitedList(elements) { - const result = sameMap(elements, parenthesizeExpressionForDisallowedComma); - return setTextRange(factory2.createNodeArray(result, elements.hasTrailingComma), elements); - } - function parenthesizeExpressionForDisallowedComma(expression) { - const emittedExpression = skipPartiallyEmittedExpressions(expression); - const expressionPrecedence = getExpressionPrecedence(emittedExpression); - const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 28 /* CommaToken */); - return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression); - } - function parenthesizeExpressionOfExpressionStatement(expression) { - const emittedExpression = skipPartiallyEmittedExpressions(expression); - if (isCallExpression(emittedExpression)) { - const callee = emittedExpression.expression; - const kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */) { - const updated = factory2.updateCallExpression( - emittedExpression, - setTextRange(factory2.createParenthesizedExpression(callee), callee), - emittedExpression.typeArguments, - emittedExpression.arguments - ); - return factory2.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */); - } - } - const leftmostExpressionKind = getLeftmostExpression( - emittedExpression, - /*stopAtCallExpressions*/ - false - ).kind; - if (leftmostExpressionKind === 211 /* ObjectLiteralExpression */ || leftmostExpressionKind === 219 /* FunctionExpression */) { - return setTextRange(factory2.createParenthesizedExpression(expression), expression); - } - return expression; - } - function parenthesizeConciseBodyOfArrowFunction(body) { - if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression( - body, - /*stopAtCallExpressions*/ - false - ).kind === 211 /* ObjectLiteralExpression */)) { - return setTextRange(factory2.createParenthesizedExpression(body), body); - } - return body; - } - function parenthesizeCheckTypeOfConditionalType(checkType) { - switch (checkType.kind) { - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 195 /* ConditionalType */: - return factory2.createParenthesizedType(checkType); - } - return checkType; - } - function parenthesizeExtendsTypeOfConditionalType(extendsType) { - switch (extendsType.kind) { - case 195 /* ConditionalType */: - return factory2.createParenthesizedType(extendsType); - } - return extendsType; - } - function parenthesizeConstituentTypeOfUnionType(type) { - switch (type.kind) { - case 193 /* UnionType */: - // Not strictly necessary, but a union containing a union should have been flattened - case 194 /* IntersectionType */: - return factory2.createParenthesizedType(type); - } - return parenthesizeCheckTypeOfConditionalType(type); - } - function parenthesizeConstituentTypesOfUnionType(members) { - return factory2.createNodeArray(sameMap(members, parenthesizeConstituentTypeOfUnionType)); - } - function parenthesizeConstituentTypeOfIntersectionType(type) { - switch (type.kind) { - case 193 /* UnionType */: - case 194 /* IntersectionType */: - return factory2.createParenthesizedType(type); - } - return parenthesizeConstituentTypeOfUnionType(type); - } - function parenthesizeConstituentTypesOfIntersectionType(members) { - return factory2.createNodeArray(sameMap(members, parenthesizeConstituentTypeOfIntersectionType)); - } - function parenthesizeOperandOfTypeOperator(type) { - switch (type.kind) { - case 194 /* IntersectionType */: - return factory2.createParenthesizedType(type); - } - return parenthesizeConstituentTypeOfIntersectionType(type); - } - function parenthesizeOperandOfReadonlyTypeOperator(type) { - switch (type.kind) { - case 199 /* TypeOperator */: - return factory2.createParenthesizedType(type); - } - return parenthesizeOperandOfTypeOperator(type); - } - function parenthesizeNonArrayTypeOfPostfixType(type) { - switch (type.kind) { - case 196 /* InferType */: - case 199 /* TypeOperator */: - case 187 /* TypeQuery */: - return factory2.createParenthesizedType(type); - } - return parenthesizeOperandOfTypeOperator(type); - } - function parenthesizeElementTypesOfTupleType(types) { - return factory2.createNodeArray(sameMap(types, parenthesizeElementTypeOfTupleType)); - } - function parenthesizeElementTypeOfTupleType(type) { - if (hasJSDocPostfixQuestion(type)) return factory2.createParenthesizedType(type); - return type; - } - function hasJSDocPostfixQuestion(type) { - if (isJSDocNullableType(type)) return type.postfix; - if (isNamedTupleMember(type)) return hasJSDocPostfixQuestion(type.type); - if (isFunctionTypeNode(type) || isConstructorTypeNode(type) || isTypeOperatorNode(type)) return hasJSDocPostfixQuestion(type.type); - if (isConditionalTypeNode(type)) return hasJSDocPostfixQuestion(type.falseType); - if (isUnionTypeNode(type)) return hasJSDocPostfixQuestion(last(type.types)); - if (isIntersectionTypeNode(type)) return hasJSDocPostfixQuestion(last(type.types)); - if (isInferTypeNode(type)) return !!type.typeParameter.constraint && hasJSDocPostfixQuestion(type.typeParameter.constraint); - return false; - } - function parenthesizeTypeOfOptionalType(type) { - if (hasJSDocPostfixQuestion(type)) return factory2.createParenthesizedType(type); - return parenthesizeNonArrayTypeOfPostfixType(type); - } - function parenthesizeLeadingTypeArgument(node) { - return isFunctionOrConstructorTypeNode(node) && node.typeParameters ? factory2.createParenthesizedType(node) : node; - } - function parenthesizeOrdinalTypeArgument(node, i) { - return i === 0 ? parenthesizeLeadingTypeArgument(node) : node; - } - function parenthesizeTypeArguments(typeArguments) { - if (some(typeArguments)) { - return factory2.createNodeArray(sameMap(typeArguments, parenthesizeOrdinalTypeArgument)); - } - } -} -var nullParenthesizerRules = { - getParenthesizeLeftSideOfBinaryForOperator: (_) => identity, - getParenthesizeRightSideOfBinaryForOperator: (_) => identity, - parenthesizeLeftSideOfBinary: (_binaryOperator, leftSide) => leftSide, - parenthesizeRightSideOfBinary: (_binaryOperator, _leftSide, rightSide) => rightSide, - parenthesizeExpressionOfComputedPropertyName: identity, - parenthesizeConditionOfConditionalExpression: identity, - parenthesizeBranchOfConditionalExpression: identity, - parenthesizeExpressionOfExportDefault: identity, - parenthesizeExpressionOfNew: (expression) => cast(expression, isLeftHandSideExpression), - parenthesizeLeftSideOfAccess: (expression) => cast(expression, isLeftHandSideExpression), - parenthesizeOperandOfPostfixUnary: (operand) => cast(operand, isLeftHandSideExpression), - parenthesizeOperandOfPrefixUnary: (operand) => cast(operand, isUnaryExpression), - parenthesizeExpressionsOfCommaDelimitedList: (nodes) => cast(nodes, isNodeArray), - parenthesizeExpressionForDisallowedComma: identity, - parenthesizeExpressionOfExpressionStatement: identity, - parenthesizeConciseBodyOfArrowFunction: identity, - parenthesizeCheckTypeOfConditionalType: identity, - parenthesizeExtendsTypeOfConditionalType: identity, - parenthesizeConstituentTypesOfUnionType: (nodes) => cast(nodes, isNodeArray), - parenthesizeConstituentTypeOfUnionType: identity, - parenthesizeConstituentTypesOfIntersectionType: (nodes) => cast(nodes, isNodeArray), - parenthesizeConstituentTypeOfIntersectionType: identity, - parenthesizeOperandOfTypeOperator: identity, - parenthesizeOperandOfReadonlyTypeOperator: identity, - parenthesizeNonArrayTypeOfPostfixType: identity, - parenthesizeElementTypesOfTupleType: (nodes) => cast(nodes, isNodeArray), - parenthesizeElementTypeOfTupleType: identity, - parenthesizeTypeOfOptionalType: identity, - parenthesizeTypeArguments: (nodes) => nodes && cast(nodes, isNodeArray), - parenthesizeLeadingTypeArgument: identity -}; - -// src/compiler/factory/nodeConverters.ts -function createNodeConverters(factory2) { - return { - convertToFunctionBlock, - convertToFunctionExpression, - convertToClassExpression, - convertToArrayAssignmentElement, - convertToObjectAssignmentElement, - convertToAssignmentPattern, - convertToObjectAssignmentPattern, - convertToArrayAssignmentPattern, - convertToAssignmentElementTarget - }; - function convertToFunctionBlock(node, multiLine) { - if (isBlock(node)) return node; - const returnStatement = factory2.createReturnStatement(node); - setTextRange(returnStatement, node); - const body = factory2.createBlock([returnStatement], multiLine); - setTextRange(body, node); - return body; - } - function convertToFunctionExpression(node) { - var _a; - if (!node.body) return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); - const updated = factory2.createFunctionExpression( - (_a = getModifiers(node)) == null ? void 0 : _a.filter((modifier) => !isExportModifier(modifier) && !isDefaultModifier(modifier)), - node.asteriskToken, - node.name, - node.typeParameters, - node.parameters, - node.type, - node.body - ); - setOriginalNode(updated, node); - setTextRange(updated, node); - if (getStartsOnNewLine(node)) { - setStartsOnNewLine( - updated, - /*newLine*/ - true - ); - } - 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) { - Debug.assertNode(element.name, isIdentifier); - return setOriginalNode(setTextRange(factory2.createSpreadElement(element.name), element), element); - } - const expression = convertToAssignmentElementTarget(element.name); - return element.initializer ? setOriginalNode( - setTextRange( - factory2.createAssignment(expression, element.initializer), - element - ), - element - ) : expression; - } - return cast(element, isExpression); - } - function convertToObjectAssignmentElement(element) { - if (isBindingElement(element)) { - if (element.dotDotDotToken) { - Debug.assertNode(element.name, isIdentifier); - return setOriginalNode(setTextRange(factory2.createSpreadAssignment(element.name), element), element); - } - if (element.propertyName) { - const expression = convertToAssignmentElementTarget(element.name); - return setOriginalNode(setTextRange(factory2.createPropertyAssignment(element.propertyName, element.initializer ? factory2.createAssignment(expression, element.initializer) : expression), element), element); - } - Debug.assertNode(element.name, isIdentifier); - return setOriginalNode(setTextRange(factory2.createShorthandPropertyAssignment(element.name, element.initializer), element), element); - } - return cast(element, isObjectLiteralElementLike); - } - function convertToAssignmentPattern(node) { - switch (node.kind) { - case 208 /* ArrayBindingPattern */: - case 210 /* ArrayLiteralExpression */: - return convertToArrayAssignmentPattern(node); - case 207 /* ObjectBindingPattern */: - case 211 /* ObjectLiteralExpression */: - return convertToObjectAssignmentPattern(node); - } - } - function convertToObjectAssignmentPattern(node) { - if (isObjectBindingPattern(node)) { - return setOriginalNode( - setTextRange( - factory2.createObjectLiteralExpression(map(node.elements, convertToObjectAssignmentElement)), - node - ), - node - ); - } - return cast(node, isObjectLiteralExpression); - } - function convertToArrayAssignmentPattern(node) { - if (isArrayBindingPattern(node)) { - return setOriginalNode( - setTextRange( - factory2.createArrayLiteralExpression(map(node.elements, convertToArrayAssignmentElement)), - node - ), - node - ); - } - return cast(node, isArrayLiteralExpression); - } - function convertToAssignmentElementTarget(node) { - if (isBindingPattern(node)) { - return convertToAssignmentPattern(node); - } - return cast(node, isExpression); - } -} -var nullNodeConverters = { - convertToFunctionBlock: notImplemented, - convertToFunctionExpression: notImplemented, - convertToClassExpression: notImplemented, - convertToArrayAssignmentElement: notImplemented, - convertToObjectAssignmentElement: notImplemented, - convertToAssignmentPattern: notImplemented, - convertToObjectAssignmentPattern: notImplemented, - convertToArrayAssignmentPattern: notImplemented, - convertToAssignmentElementTarget: notImplemented -}; - -// src/compiler/factory/nodeFactory.ts -var nextAutoGenerateId = 0; -var NodeFactoryFlags = /* @__PURE__ */ ((NodeFactoryFlags2) => { - NodeFactoryFlags2[NodeFactoryFlags2["None"] = 0] = "None"; - NodeFactoryFlags2[NodeFactoryFlags2["NoParenthesizerRules"] = 1] = "NoParenthesizerRules"; - NodeFactoryFlags2[NodeFactoryFlags2["NoNodeConverters"] = 2] = "NoNodeConverters"; - NodeFactoryFlags2[NodeFactoryFlags2["NoIndentationOnFreshPropertyAccess"] = 4] = "NoIndentationOnFreshPropertyAccess"; - NodeFactoryFlags2[NodeFactoryFlags2["NoOriginalNode"] = 8] = "NoOriginalNode"; - return NodeFactoryFlags2; -})(NodeFactoryFlags || {}); -var nodeFactoryPatchers = []; -function addNodeFactoryPatcher(fn) { - nodeFactoryPatchers.push(fn); -} -function createNodeFactory(flags, baseFactory2) { - 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)); - const getPrefixUnaryCreateFunction = memoizeOne((operator) => (operand) => createPrefixUnaryExpression(operator, operand)); - const getPostfixUnaryCreateFunction = memoizeOne((operator) => (operand) => createPostfixUnaryExpression(operand, operator)); - const getJSDocPrimaryTypeCreateFunction = memoizeOne((kind) => () => createJSDocPrimaryTypeWorker(kind)); - const getJSDocUnaryTypeCreateFunction = memoizeOne((kind) => (type) => createJSDocUnaryTypeWorker(kind, type)); - const getJSDocUnaryTypeUpdateFunction = memoizeOne((kind) => (node, type) => updateJSDocUnaryTypeWorker(kind, node, type)); - const getJSDocPrePostfixUnaryTypeCreateFunction = memoizeOne((kind) => (type, postfix) => createJSDocPrePostfixUnaryTypeWorker(kind, type, postfix)); - const getJSDocPrePostfixUnaryTypeUpdateFunction = memoizeOne((kind) => (node, type) => updateJSDocPrePostfixUnaryTypeWorker(kind, node, type)); - const getJSDocSimpleTagCreateFunction = memoizeOne((kind) => (tagName, comment) => createJSDocSimpleTagWorker(kind, tagName, comment)); - const getJSDocSimpleTagUpdateFunction = memoizeOne((kind) => (node, tagName, comment) => updateJSDocSimpleTagWorker(kind, node, tagName, comment)); - const getJSDocTypeLikeTagCreateFunction = memoizeOne((kind) => (tagName, typeExpression, comment) => createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment)); - const getJSDocTypeLikeTagUpdateFunction = memoizeOne((kind) => (node, tagName, typeExpression, comment) => updateJSDocTypeLikeTagWorker(kind, node, tagName, typeExpression, comment)); - const factory2 = { - get parenthesizer() { - return parenthesizerRules(); - }, - get converters() { - return converters(); - }, - baseFactory: baseFactory2, - flags, - createNodeArray, - createNumericLiteral, - createBigIntLiteral, - createStringLiteral, - createStringLiteralFromNode, - createRegularExpressionLiteral, - createLiteralLikeNode, - createIdentifier, - createTempVariable, - createLoopVariable, - createUniqueName, - getGeneratedNameForNode, - createPrivateIdentifier, - createUniquePrivateName, - getGeneratedPrivateNameForNode, - createToken, - createSuper, - createThis, - createNull, - createTrue, - createFalse, - createModifier, - createModifiersFromModifierFlags, - createQualifiedName, - updateQualifiedName, - createComputedPropertyName, - updateComputedPropertyName, - createTypeParameterDeclaration, - updateTypeParameterDeclaration, - createParameterDeclaration, - updateParameterDeclaration, - createDecorator, - updateDecorator, - createPropertySignature, - updatePropertySignature, - createPropertyDeclaration, - updatePropertyDeclaration: updatePropertyDeclaration2, - createMethodSignature, - updateMethodSignature, - createMethodDeclaration, - updateMethodDeclaration, - createConstructorDeclaration, - updateConstructorDeclaration, - createGetAccessorDeclaration, - updateGetAccessorDeclaration, - createSetAccessorDeclaration, - updateSetAccessorDeclaration, - createCallSignature, - updateCallSignature, - createConstructSignature, - updateConstructSignature, - createIndexSignature, - updateIndexSignature, - createClassStaticBlockDeclaration, - updateClassStaticBlockDeclaration, - createTemplateLiteralTypeSpan, - updateTemplateLiteralTypeSpan, - createKeywordTypeNode, - createTypePredicateNode, - updateTypePredicateNode, - createTypeReferenceNode, - updateTypeReferenceNode, - createFunctionTypeNode, - updateFunctionTypeNode, - createConstructorTypeNode, - updateConstructorTypeNode, - createTypeQueryNode, - updateTypeQueryNode, - createTypeLiteralNode, - updateTypeLiteralNode, - createArrayTypeNode, - updateArrayTypeNode, - createTupleTypeNode, - updateTupleTypeNode, - createNamedTupleMember, - updateNamedTupleMember, - createOptionalTypeNode, - updateOptionalTypeNode, - createRestTypeNode, - updateRestTypeNode, - createUnionTypeNode, - updateUnionTypeNode, - createIntersectionTypeNode, - updateIntersectionTypeNode, - createConditionalTypeNode, - updateConditionalTypeNode, - createInferTypeNode, - updateInferTypeNode, - createImportTypeNode, - updateImportTypeNode, - createParenthesizedType, - updateParenthesizedType, - createThisTypeNode, - createTypeOperatorNode, - updateTypeOperatorNode, - createIndexedAccessTypeNode, - updateIndexedAccessTypeNode, - createMappedTypeNode, - updateMappedTypeNode, - createLiteralTypeNode, - updateLiteralTypeNode, - createTemplateLiteralType, - updateTemplateLiteralType, - createObjectBindingPattern, - updateObjectBindingPattern, - createArrayBindingPattern, - updateArrayBindingPattern, - createBindingElement, - updateBindingElement, - createArrayLiteralExpression, - updateArrayLiteralExpression, - createObjectLiteralExpression, - updateObjectLiteralExpression, - createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, name) => setEmitFlags(createPropertyAccessExpression(expression, name), 262144 /* NoIndentation */) : createPropertyAccessExpression, - updatePropertyAccessExpression, - createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain, - updatePropertyAccessChain, - createElementAccessExpression, - updateElementAccessExpression, - createElementAccessChain, - updateElementAccessChain, - createCallExpression, - updateCallExpression, - createCallChain, - updateCallChain, - createNewExpression, - updateNewExpression, - createTaggedTemplateExpression, - updateTaggedTemplateExpression, - createTypeAssertion, - updateTypeAssertion, - createParenthesizedExpression, - updateParenthesizedExpression, - createFunctionExpression, - updateFunctionExpression, - createArrowFunction, - updateArrowFunction, - createDeleteExpression, - updateDeleteExpression, - createTypeOfExpression, - updateTypeOfExpression, - createVoidExpression, - updateVoidExpression, - createAwaitExpression, - updateAwaitExpression, - createPrefixUnaryExpression, - updatePrefixUnaryExpression, - createPostfixUnaryExpression, - updatePostfixUnaryExpression, - createBinaryExpression, - updateBinaryExpression, - createConditionalExpression, - updateConditionalExpression, - createTemplateExpression, - updateTemplateExpression, - createTemplateHead, - createTemplateMiddle, - createTemplateTail, - createNoSubstitutionTemplateLiteral, - createTemplateLiteralLikeNode, - createYieldExpression, - updateYieldExpression, - createSpreadElement, - updateSpreadElement, - createClassExpression, - updateClassExpression, - createOmittedExpression, - createExpressionWithTypeArguments, - updateExpressionWithTypeArguments, - createAsExpression, - updateAsExpression, - createNonNullExpression, - updateNonNullExpression, - createSatisfiesExpression, - updateSatisfiesExpression, - createNonNullChain, - updateNonNullChain, - createMetaProperty, - updateMetaProperty, - createTemplateSpan, - updateTemplateSpan, - createSemicolonClassElement, - createBlock, - updateBlock, - createVariableStatement, - updateVariableStatement, - createEmptyStatement, - createExpressionStatement, - updateExpressionStatement, - createIfStatement, - updateIfStatement, - createDoStatement, - updateDoStatement, - createWhileStatement, - updateWhileStatement, - createForStatement, - updateForStatement, - createForInStatement, - updateForInStatement, - createForOfStatement, - updateForOfStatement, - createContinueStatement, - updateContinueStatement, - createBreakStatement, - updateBreakStatement, - createReturnStatement, - updateReturnStatement, - createWithStatement, - updateWithStatement, - createSwitchStatement, - updateSwitchStatement, - createLabeledStatement, - updateLabeledStatement, - createThrowStatement, - updateThrowStatement, - createTryStatement, - updateTryStatement, - createDebuggerStatement, - createVariableDeclaration, - updateVariableDeclaration, - createVariableDeclarationList, - updateVariableDeclarationList, - createFunctionDeclaration, - updateFunctionDeclaration, - createClassDeclaration, - updateClassDeclaration, - createInterfaceDeclaration, - updateInterfaceDeclaration, - createTypeAliasDeclaration, - updateTypeAliasDeclaration, - createEnumDeclaration, - updateEnumDeclaration, - createModuleDeclaration, - updateModuleDeclaration, - createModuleBlock, - updateModuleBlock, - createCaseBlock, - updateCaseBlock, - createNamespaceExportDeclaration, - updateNamespaceExportDeclaration, - createImportEqualsDeclaration, - updateImportEqualsDeclaration, - createImportDeclaration, - updateImportDeclaration, - createImportClause: createImportClause2, - updateImportClause, - createAssertClause, - updateAssertClause, - createAssertEntry, - updateAssertEntry, - createImportTypeAssertionContainer, - updateImportTypeAssertionContainer, - createImportAttributes, - updateImportAttributes, - createImportAttribute, - updateImportAttribute, - createNamespaceImport, - updateNamespaceImport, - createNamespaceExport, - updateNamespaceExport, - createNamedImports, - updateNamedImports, - createImportSpecifier, - updateImportSpecifier, - createExportAssignment: createExportAssignment2, - updateExportAssignment, - createExportDeclaration, - updateExportDeclaration, - createNamedExports, - updateNamedExports, - createExportSpecifier, - updateExportSpecifier, - createMissingDeclaration, - createExternalModuleReference, - updateExternalModuleReference, - // lazily load factory members for JSDoc types with similar structure - get createJSDocAllType() { - return getJSDocPrimaryTypeCreateFunction(313 /* JSDocAllType */); - }, - get createJSDocUnknownType() { - return getJSDocPrimaryTypeCreateFunction(314 /* JSDocUnknownType */); - }, - get createJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(316 /* JSDocNonNullableType */); - }, - get updateJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(316 /* JSDocNonNullableType */); - }, - get createJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(315 /* JSDocNullableType */); - }, - get updateJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(315 /* JSDocNullableType */); - }, - get createJSDocOptionalType() { - return getJSDocUnaryTypeCreateFunction(317 /* JSDocOptionalType */); - }, - get updateJSDocOptionalType() { - return getJSDocUnaryTypeUpdateFunction(317 /* JSDocOptionalType */); - }, - get createJSDocVariadicType() { - return getJSDocUnaryTypeCreateFunction(319 /* JSDocVariadicType */); - }, - get updateJSDocVariadicType() { - return getJSDocUnaryTypeUpdateFunction(319 /* JSDocVariadicType */); - }, - get createJSDocNamepathType() { - return getJSDocUnaryTypeCreateFunction(320 /* JSDocNamepathType */); - }, - get updateJSDocNamepathType() { - return getJSDocUnaryTypeUpdateFunction(320 /* JSDocNamepathType */); - }, - createJSDocFunctionType, - updateJSDocFunctionType, - createJSDocTypeLiteral, - updateJSDocTypeLiteral, - createJSDocTypeExpression, - updateJSDocTypeExpression, - createJSDocSignature, - updateJSDocSignature, - createJSDocTemplateTag, - updateJSDocTemplateTag, - createJSDocTypedefTag, - updateJSDocTypedefTag, - createJSDocParameterTag, - updateJSDocParameterTag, - createJSDocPropertyTag, - updateJSDocPropertyTag, - createJSDocCallbackTag, - updateJSDocCallbackTag, - createJSDocOverloadTag, - updateJSDocOverloadTag, - createJSDocAugmentsTag, - updateJSDocAugmentsTag, - createJSDocImplementsTag, - updateJSDocImplementsTag, - createJSDocSeeTag, - updateJSDocSeeTag, - createJSDocImportTag, - updateJSDocImportTag, - createJSDocNameReference, - updateJSDocNameReference, - createJSDocMemberName, - updateJSDocMemberName, - createJSDocLink, - updateJSDocLink, - createJSDocLinkCode, - updateJSDocLinkCode, - createJSDocLinkPlain, - updateJSDocLinkPlain, - // lazily load factory members for JSDoc tags with similar structure - get createJSDocTypeTag() { - return getJSDocTypeLikeTagCreateFunction(345 /* JSDocTypeTag */); - }, - get updateJSDocTypeTag() { - return getJSDocTypeLikeTagUpdateFunction(345 /* JSDocTypeTag */); - }, - get createJSDocReturnTag() { - return getJSDocTypeLikeTagCreateFunction(343 /* JSDocReturnTag */); - }, - get updateJSDocReturnTag() { - return getJSDocTypeLikeTagUpdateFunction(343 /* JSDocReturnTag */); - }, - get createJSDocThisTag() { - return getJSDocTypeLikeTagCreateFunction(344 /* JSDocThisTag */); - }, - get updateJSDocThisTag() { - return getJSDocTypeLikeTagUpdateFunction(344 /* JSDocThisTag */); - }, - get createJSDocAuthorTag() { - return getJSDocSimpleTagCreateFunction(331 /* JSDocAuthorTag */); - }, - get updateJSDocAuthorTag() { - return getJSDocSimpleTagUpdateFunction(331 /* JSDocAuthorTag */); - }, - get createJSDocClassTag() { - return getJSDocSimpleTagCreateFunction(333 /* JSDocClassTag */); - }, - get updateJSDocClassTag() { - return getJSDocSimpleTagUpdateFunction(333 /* JSDocClassTag */); - }, - get createJSDocPublicTag() { - return getJSDocSimpleTagCreateFunction(334 /* JSDocPublicTag */); - }, - get updateJSDocPublicTag() { - return getJSDocSimpleTagUpdateFunction(334 /* JSDocPublicTag */); - }, - get createJSDocPrivateTag() { - return getJSDocSimpleTagCreateFunction(335 /* JSDocPrivateTag */); - }, - get updateJSDocPrivateTag() { - return getJSDocSimpleTagUpdateFunction(335 /* JSDocPrivateTag */); - }, - get createJSDocProtectedTag() { - return getJSDocSimpleTagCreateFunction(336 /* JSDocProtectedTag */); - }, - get updateJSDocProtectedTag() { - return getJSDocSimpleTagUpdateFunction(336 /* JSDocProtectedTag */); - }, - get createJSDocReadonlyTag() { - return getJSDocSimpleTagCreateFunction(337 /* JSDocReadonlyTag */); - }, - get updateJSDocReadonlyTag() { - return getJSDocSimpleTagUpdateFunction(337 /* JSDocReadonlyTag */); - }, - get createJSDocOverrideTag() { - return getJSDocSimpleTagCreateFunction(338 /* JSDocOverrideTag */); - }, - get updateJSDocOverrideTag() { - return getJSDocSimpleTagUpdateFunction(338 /* JSDocOverrideTag */); - }, - get createJSDocDeprecatedTag() { - return getJSDocSimpleTagCreateFunction(332 /* JSDocDeprecatedTag */); - }, - get updateJSDocDeprecatedTag() { - return getJSDocSimpleTagUpdateFunction(332 /* JSDocDeprecatedTag */); - }, - get createJSDocThrowsTag() { - return getJSDocTypeLikeTagCreateFunction(350 /* JSDocThrowsTag */); - }, - get updateJSDocThrowsTag() { - return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocThrowsTag */); - }, - get createJSDocSatisfiesTag() { - return getJSDocTypeLikeTagCreateFunction(351 /* JSDocSatisfiesTag */); - }, - get updateJSDocSatisfiesTag() { - return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocSatisfiesTag */); - }, - createJSDocEnumTag, - updateJSDocEnumTag, - createJSDocUnknownTag, - updateJSDocUnknownTag, - createJSDocText, - updateJSDocText, - createJSDocComment, - updateJSDocComment, - createJsxElement, - updateJsxElement, - createJsxSelfClosingElement, - updateJsxSelfClosingElement, - createJsxOpeningElement, - updateJsxOpeningElement, - createJsxClosingElement, - updateJsxClosingElement, - createJsxFragment, - createJsxText, - updateJsxText, - createJsxOpeningFragment, - createJsxJsxClosingFragment, - updateJsxFragment, - createJsxAttribute, - updateJsxAttribute, - createJsxAttributes, - updateJsxAttributes, - createJsxSpreadAttribute, - updateJsxSpreadAttribute, - createJsxExpression, - updateJsxExpression, - createJsxNamespacedName, - updateJsxNamespacedName, - createCaseClause, - updateCaseClause, - createDefaultClause, - updateDefaultClause, - createHeritageClause, - updateHeritageClause, - createCatchClause, - updateCatchClause, - createPropertyAssignment, - updatePropertyAssignment, - createShorthandPropertyAssignment, - updateShorthandPropertyAssignment, - createSpreadAssignment, - updateSpreadAssignment, - createEnumMember, - updateEnumMember, - createSourceFile: createSourceFile2, - updateSourceFile: updateSourceFile2, - createRedirectedSourceFile, - createBundle, - updateBundle, - createSyntheticExpression, - createSyntaxList: createSyntaxList3, - createNotEmittedStatement, - createNotEmittedTypeElement, - createPartiallyEmittedExpression, - updatePartiallyEmittedExpression, - createCommaListExpression, - updateCommaListExpression, - createSyntheticReferenceExpression, - updateSyntheticReferenceExpression, - cloneNode, - // Lazily load factory methods for common operator factories and utilities - get createComma() { - return getBinaryCreateFunction(28 /* CommaToken */); - }, - get createAssignment() { - return getBinaryCreateFunction(64 /* EqualsToken */); - }, - get createLogicalOr() { - return getBinaryCreateFunction(57 /* BarBarToken */); - }, - get createLogicalAnd() { - return getBinaryCreateFunction(56 /* AmpersandAmpersandToken */); - }, - get createBitwiseOr() { - return getBinaryCreateFunction(52 /* BarToken */); - }, - get createBitwiseXor() { - return getBinaryCreateFunction(53 /* CaretToken */); - }, - get createBitwiseAnd() { - return getBinaryCreateFunction(51 /* AmpersandToken */); - }, - get createStrictEquality() { - return getBinaryCreateFunction(37 /* EqualsEqualsEqualsToken */); - }, - get createStrictInequality() { - return getBinaryCreateFunction(38 /* ExclamationEqualsEqualsToken */); - }, - get createEquality() { - return getBinaryCreateFunction(35 /* EqualsEqualsToken */); - }, - get createInequality() { - return getBinaryCreateFunction(36 /* ExclamationEqualsToken */); - }, - get createLessThan() { - return getBinaryCreateFunction(30 /* LessThanToken */); - }, - get createLessThanEquals() { - return getBinaryCreateFunction(33 /* LessThanEqualsToken */); - }, - get createGreaterThan() { - return getBinaryCreateFunction(32 /* GreaterThanToken */); - }, - get createGreaterThanEquals() { - return getBinaryCreateFunction(34 /* GreaterThanEqualsToken */); - }, - get createLeftShift() { - return getBinaryCreateFunction(48 /* LessThanLessThanToken */); - }, - get createRightShift() { - return getBinaryCreateFunction(49 /* GreaterThanGreaterThanToken */); - }, - get createUnsignedRightShift() { - return getBinaryCreateFunction(50 /* GreaterThanGreaterThanGreaterThanToken */); - }, - get createAdd() { - return getBinaryCreateFunction(40 /* PlusToken */); - }, - get createSubtract() { - return getBinaryCreateFunction(41 /* MinusToken */); - }, - get createMultiply() { - return getBinaryCreateFunction(42 /* AsteriskToken */); - }, - get createDivide() { - return getBinaryCreateFunction(44 /* SlashToken */); - }, - get createModulo() { - return getBinaryCreateFunction(45 /* PercentToken */); - }, - get createExponent() { - return getBinaryCreateFunction(43 /* AsteriskAsteriskToken */); - }, - get createPrefixPlus() { - return getPrefixUnaryCreateFunction(40 /* PlusToken */); - }, - get createPrefixMinus() { - return getPrefixUnaryCreateFunction(41 /* MinusToken */); - }, - get createPrefixIncrement() { - return getPrefixUnaryCreateFunction(46 /* PlusPlusToken */); - }, - get createPrefixDecrement() { - return getPrefixUnaryCreateFunction(47 /* MinusMinusToken */); - }, - get createBitwiseNot() { - return getPrefixUnaryCreateFunction(55 /* TildeToken */); - }, - get createLogicalNot() { - return getPrefixUnaryCreateFunction(54 /* ExclamationToken */); - }, - get createPostfixIncrement() { - return getPostfixUnaryCreateFunction(46 /* PlusPlusToken */); - }, - get createPostfixDecrement() { - return getPostfixUnaryCreateFunction(47 /* MinusMinusToken */); - }, - // Compound nodes - createImmediatelyInvokedFunctionExpression, - createImmediatelyInvokedArrowFunction, - createVoidZero, - createExportDefault, - createExternalModuleExport, - createTypeCheck, - createIsNotTypeCheck, - createMethodCall, - createGlobalMethodCall, - createFunctionBindCall, - createFunctionCallCall, - createFunctionApplyCall, - createArraySliceCall, - createArrayConcatCall, - createObjectDefinePropertyCall, - createObjectGetOwnPropertyDescriptorCall, - createReflectGetCall, - createReflectSetCall, - createPropertyDescriptor, - createCallBinding, - createAssignmentTargetWrapper, - // Utilities - inlineExpressions, - getInternalName, - getLocalName, - getExportName, - getDeclarationName, - getNamespaceMemberName, - getExternalModuleOrNamespaceExportName, - restoreOuterExpressions, - restoreEnclosingLabel, - createUseStrictPrologue, - copyPrologue, - copyStandardPrologue, - copyCustomPrologue, - ensureUseStrict, - liftToBlock, - mergeLexicalEnvironment, - replaceModifiers, - replaceDecoratorsAndModifiers, - replacePropertyName - }; - forEach(nodeFactoryPatchers, (fn) => fn(factory2)); - return factory2; - function createNodeArray(elements, hasTrailingComma) { - if (elements === void 0 || elements === emptyArray) { - elements = []; - } else if (isNodeArray(elements)) { - if (hasTrailingComma === void 0 || elements.hasTrailingComma === hasTrailingComma) { - if (elements.transformFlags === void 0) { - aggregateChildrenFlags(elements); - } - Debug.attachNodeArrayDebugInfo(elements); - return elements; - } - const array2 = elements.slice(); - array2.pos = elements.pos; - array2.end = elements.end; - array2.hasTrailingComma = hasTrailingComma; - array2.transformFlags = elements.transformFlags; - Debug.attachNodeArrayDebugInfo(array2); - return array2; - } - const length2 = elements.length; - const array = length2 >= 1 && length2 <= 4 ? elements.slice() : elements; - array.pos = -1; - array.end = -1; - array.hasTrailingComma = !!hasTrailingComma; - array.transformFlags = 0 /* None */; - aggregateChildrenFlags(array); - Debug.attachNodeArrayDebugInfo(array); - return array; - } - function createBaseNode(kind) { - return baseFactory2.createBaseNode(kind); - } - function createBaseDeclaration(kind) { - const node = createBaseNode(kind); - node.symbol = void 0; - node.localSymbol = void 0; - return node; - } - function finishUpdateBaseSignatureDeclaration(updated, original) { - if (updated !== original) { - updated.typeArguments = original.typeArguments; - } - 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 = text; - node.numericLiteralFlags = numericLiteralFlags; - if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */) node.transformFlags |= 1024 /* ContainsES2015 */; - return node; - } - function createBigIntLiteral(value) { - const node = createBaseToken(10 /* BigIntLiteral */); - node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n"; - node.transformFlags |= 32 /* ContainsES2020 */; - return node; - } - function createBaseStringLiteral(text, isSingleQuote) { - const node = createBaseDeclaration(11 /* StringLiteral */); - node.text = text; - node.singleQuote = isSingleQuote; - return node; - } - function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) { - const node = createBaseStringLiteral(text, isSingleQuote); - node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; - if (hasExtendedUnicodeEscape) node.transformFlags |= 1024 /* ContainsES2015 */; - return node; - } - function createStringLiteralFromNode(sourceNode) { - const node = createBaseStringLiteral( - getTextOfIdentifierOrLiteral(sourceNode), - /*isSingleQuote*/ - void 0 - ); - node.textSourceNode = sourceNode; - return node; - } - function createRegularExpressionLiteral(text) { - const node = createBaseToken(14 /* RegularExpressionLiteral */); - node.text = text; - return node; - } - function createLiteralLikeNode(kind, text) { - switch (kind) { - case 9 /* NumericLiteral */: - return createNumericLiteral( - text, - /*numericLiteralFlags*/ - 0 - ); - case 10 /* BigIntLiteral */: - return createBigIntLiteral(text); - case 11 /* StringLiteral */: - return createStringLiteral( - text, - /*isSingleQuote*/ - void 0 - ); - case 12 /* JsxText */: - return createJsxText( - text, - /*containsOnlyTriviaWhiteSpaces*/ - false - ); - case 13 /* JsxTextAllWhiteSpaces */: - return createJsxText( - text, - /*containsOnlyTriviaWhiteSpaces*/ - true - ); - case 14 /* RegularExpressionLiteral */: - return createRegularExpressionLiteral(text); - case 15 /* NoSubstitutionTemplateLiteral */: - return createTemplateLiteralLikeNode( - kind, - text, - /*rawText*/ - void 0, - /*templateFlags*/ - 0 - ); - } - } - function createBaseIdentifier(escapedText) { - const node = baseFactory2.createBaseIdentifierNode(80 /* Identifier */); - node.escapedText = escapedText; - node.jsDoc = void 0; - node.flowNode = void 0; - node.symbol = void 0; - return node; - } - function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { - const node = createBaseIdentifier(escapeLeadingUnderscores(text)); - setIdentifierAutoGenerate(node, { - flags: autoGenerateFlags, - id: nextAutoGenerateId, - prefix, - suffix - }); - nextAutoGenerateId++; - return node; - } - function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) { - if (originalKeywordKind === void 0 && text) { - originalKeywordKind = stringToToken(text); - } - if (originalKeywordKind === 80 /* Identifier */) { - originalKeywordKind = void 0; - } - const node = createBaseIdentifier(escapeLeadingUnderscores(text)); - if (hasExtendedUnicodeEscape) node.flags |= 256 /* IdentifierHasExtendedUnicodeEscape */; - if (node.escapedText === "await") { - node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; - } - if (node.flags & 256 /* IdentifierHasExtendedUnicodeEscape */) { - node.transformFlags |= 1024 /* ContainsES2015 */; - } - return node; - } - function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { - let flags2 = 1 /* Auto */; - if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; - const name = createBaseGeneratedIdentifier("", flags2, prefix, suffix); - if (recordTempVariable) { - recordTempVariable(name); - } - return name; - } - function createLoopVariable(reservedInNestedScopes) { - let flags2 = 2 /* Loop */; - if (reservedInNestedScopes) flags2 |= 8 /* ReservedInNestedScopes */; - return createBaseGeneratedIdentifier( - "", - flags2, - /*prefix*/ - void 0, - /*suffix*/ - void 0 - ); - } - function createUniqueName(text, flags2 = 0 /* None */, prefix, suffix) { - Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); - Debug.assert((flags2 & (16 /* Optimistic */ | 32 /* FileLevel */)) !== 32 /* FileLevel */, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"); - return createBaseGeneratedIdentifier(text, 3 /* Unique */ | flags2, prefix, suffix); - } - function getGeneratedNameForNode(node, flags2 = 0, prefix, suffix) { - Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); - const text = !node ? "" : isMemberName(node) ? formatGeneratedName( - /*privateName*/ - false, - prefix, - node, - suffix, - idText - ) : `generated@${getNodeId(node)}`; - if (prefix || suffix) flags2 |= 16 /* Optimistic */; - const name = createBaseGeneratedIdentifier(text, 4 /* Node */ | flags2, prefix, suffix); - name.original = node; - return name; - } - function createBasePrivateIdentifier(escapedText) { - const node = baseFactory2.createBasePrivateIdentifierNode(81 /* PrivateIdentifier */); - node.escapedText = escapedText; - node.transformFlags |= 16777216 /* ContainsClassFields */; - return node; - } - function createPrivateIdentifier(text) { - if (!startsWith(text, "#")) Debug.fail("First character of private identifier must be #: " + text); - return createBasePrivateIdentifier(escapeLeadingUnderscores(text)); - } - function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { - const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text)); - setIdentifierAutoGenerate(node, { - flags: autoGenerateFlags, - id: nextAutoGenerateId, - prefix, - suffix - }); - nextAutoGenerateId++; - return node; - } - function createUniquePrivateName(text, prefix, suffix) { - if (text && !startsWith(text, "#")) Debug.fail("First character of private identifier must be #: " + text); - const autoGenerateFlags = 8 /* ReservedInNestedScopes */ | (text ? 3 /* Unique */ : 1 /* Auto */); - return createBaseGeneratedPrivateIdentifier(text ?? "", autoGenerateFlags, prefix, suffix); - } - function getGeneratedPrivateNameForNode(node, prefix, suffix) { - const text = isMemberName(node) ? formatGeneratedName( - /*privateName*/ - true, - prefix, - node, - suffix, - idText - ) : `#generated@${getNodeId(node)}`; - const flags2 = prefix || suffix ? 16 /* Optimistic */ : 0 /* None */; - const name = createBaseGeneratedPrivateIdentifier(text, 4 /* Node */ | flags2, prefix, suffix); - name.original = node; - return name; - } - function createBaseToken(kind) { - return baseFactory2.createBaseTokenNode(kind); - } - function createToken(token) { - Debug.assert(token >= 0 /* FirstToken */ && token <= 166 /* 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"); - const node = createBaseToken(token); - let transformFlags = 0 /* None */; - switch (token) { - 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 */: - case 148 /* ReadonlyKeyword */: - case 128 /* AbstractKeyword */: - case 138 /* DeclareKeyword */: - case 87 /* ConstKeyword */: - case 133 /* AnyKeyword */: - case 150 /* NumberKeyword */: - case 163 /* BigIntKeyword */: - case 146 /* NeverKeyword */: - case 151 /* ObjectKeyword */: - case 103 /* InKeyword */: - case 147 /* OutKeyword */: - case 164 /* OverrideKeyword */: - case 154 /* StringKeyword */: - case 136 /* BooleanKeyword */: - case 155 /* SymbolKeyword */: - case 116 /* VoidKeyword */: - case 159 /* UnknownKeyword */: - case 157 /* UndefinedKeyword */: - transformFlags = 1 /* ContainsTypeScript */; - break; - case 108 /* SuperKeyword */: - transformFlags = 1024 /* ContainsES2015 */ | 134217728 /* ContainsLexicalSuper */; - node.flowNode = void 0; - break; - case 126 /* StaticKeyword */: - transformFlags = 1024 /* ContainsES2015 */; - break; - case 129 /* AccessorKeyword */: - transformFlags = 16777216 /* ContainsClassFields */; - break; - case 110 /* ThisKeyword */: - transformFlags = 16384 /* ContainsLexicalThis */; - node.flowNode = void 0; - break; - } - if (transformFlags) { - node.transformFlags |= transformFlags; - } - return node; - } - function createSuper() { - return createToken(108 /* SuperKeyword */); - } - function createThis() { - return createToken(110 /* ThisKeyword */); - } - function createNull() { - return createToken(106 /* NullKeyword */); - } - function createTrue() { - return createToken(112 /* TrueKeyword */); - } - function createFalse() { - return createToken(97 /* FalseKeyword */); - } - function createModifier(kind) { - return createToken(kind); - } - function createModifiersFromModifierFlags(flags2) { - const result = []; - if (flags2 & 32 /* Export */) result.push(createModifier(95 /* ExportKeyword */)); - if (flags2 & 128 /* Ambient */) result.push(createModifier(138 /* DeclareKeyword */)); - if (flags2 & 2048 /* Default */) result.push(createModifier(90 /* DefaultKeyword */)); - if (flags2 & 4096 /* Const */) result.push(createModifier(87 /* ConstKeyword */)); - if (flags2 & 1 /* Public */) result.push(createModifier(125 /* PublicKeyword */)); - if (flags2 & 2 /* Private */) result.push(createModifier(123 /* PrivateKeyword */)); - if (flags2 & 4 /* Protected */) result.push(createModifier(124 /* ProtectedKeyword */)); - if (flags2 & 64 /* Abstract */) result.push(createModifier(128 /* AbstractKeyword */)); - if (flags2 & 256 /* Static */) result.push(createModifier(126 /* StaticKeyword */)); - if (flags2 & 16 /* Override */) result.push(createModifier(164 /* OverrideKeyword */)); - if (flags2 & 8 /* Readonly */) result.push(createModifier(148 /* ReadonlyKeyword */)); - if (flags2 & 512 /* Accessor */) result.push(createModifier(129 /* AccessorKeyword */)); - if (flags2 & 1024 /* Async */) result.push(createModifier(134 /* AsyncKeyword */)); - if (flags2 & 8192 /* In */) result.push(createModifier(103 /* InKeyword */)); - if (flags2 & 16384 /* Out */) result.push(createModifier(147 /* OutKeyword */)); - return result.length ? result : void 0; - } - function createQualifiedName(left, right) { - const node = createBaseNode(167 /* QualifiedName */); - node.left = left; - node.right = asName(right); - node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right); - node.flowNode = void 0; - return node; - } - function updateQualifiedName(node, left, right) { - return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; - } - function createComputedPropertyName(expression) { - const node = createBaseNode(168 /* ComputedPropertyName */); - node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); - node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; - return node; - } - function updateComputedPropertyName(node, expression) { - return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; - } - function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { - const node = createBaseDeclaration(169 /* TypeParameter */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.constraint = constraint; - node.default = defaultType; - node.transformFlags = 1 /* ContainsTypeScript */; - node.expression = void 0; - node.jsDoc = void 0; - return node; - } - function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) { - 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(170 /* Parameter */); - node.modifiers = asNodeArray(modifiers); - node.dotDotDotToken = dotDotDotToken; - node.name = asName(name); - node.questionToken = questionToken; - node.type = type; - node.initializer = asInitializer(initializer); - 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) & 31 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); - } - node.jsDoc = void 0; - return node; - } - function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - 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(171 /* Decorator */); - node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - false - ); - node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */; - return node; - } - function updateDecorator(node, expression) { - return node.expression !== expression ? update(createDecorator(expression), node) : node; - } - function createPropertySignature(modifiers, name, questionToken, type) { - const node = createBaseDeclaration(172 /* PropertySignature */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.type = type; - node.questionToken = questionToken; - node.transformFlags = 1 /* ContainsTypeScript */; - node.initializer = void 0; - node.jsDoc = void 0; - return node; - } - function updatePropertySignature(node, modifiers, name, questionToken, type) { - return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature(modifiers, name, questionToken, type), node) : node; - } - function finishUpdatePropertySignature(updated, original) { - if (updated !== original) { - updated.initializer = original.initializer; - } - return update(updated, original); - } - function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) { - const node = createBaseDeclaration(173 /* 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 & 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; - } - function updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer) { - 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(174 /* MethodSignature */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.questionToken = questionToken; - node.typeParameters = asNodeArray(typeParameters); - node.parameters = asNodeArray(parameters); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.typeArguments = void 0; - return node; - } - function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) { - 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(175 /* MethodDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.asteriskToken = asteriskToken; - node.name = asName(name); - node.questionToken = questionToken; - node.exclamationToken = void 0; - node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray(parameters); - node.type = type; - node.body = body; - if (!node.body) { - node.transformFlags = 1 /* ContainsTypeScript */; - } else { - 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 */; - } - node.typeArguments = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateMethodDeclaration(createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) : node; - } - function finishUpdateMethodDeclaration(updated, original) { - if (updated !== original) { - updated.exclamationToken = original.exclamationToken; - } - return update(updated, original); - } - function createClassStaticBlockDeclaration(body) { - const node = createBaseDeclaration(176 /* ClassStaticBlockDeclaration */); - node.body = body; - node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; - node.modifiers = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateClassStaticBlockDeclaration(node, body) { - return node.body !== body ? finishUpdateClassStaticBlockDeclaration(createClassStaticBlockDeclaration(body), node) : node; - } - function finishUpdateClassStaticBlockDeclaration(updated, original) { - if (updated !== original) { - updated.modifiers = original.modifiers; - } - return update(updated, original); - } - function createConstructorDeclaration(modifiers, parameters, body) { - const node = createBaseDeclaration(177 /* Constructor */); - node.modifiers = asNodeArray(modifiers); - node.parameters = createNodeArray(parameters); - node.body = body; - if (!node.body) { - node.transformFlags = 1 /* ContainsTypeScript */; - } else { - node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */; - } - node.typeParameters = void 0; - node.type = void 0; - node.typeArguments = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateConstructorDeclaration(node, modifiers, parameters, body) { - return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node; - } - function finishUpdateConstructorDeclaration(updated, original) { - if (updated !== original) { - updated.typeParameters = original.typeParameters; - updated.type = original.type; - } - return finishUpdateBaseSignatureDeclaration(updated, original); - } - function createGetAccessorDeclaration(modifiers, name, parameters, type, body) { - const node = createBaseDeclaration(178 /* GetAccessor */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.parameters = createNodeArray(parameters); - node.type = type; - node.body = body; - if (!node.body) { - node.transformFlags = 1 /* ContainsTypeScript */; - } else { - node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); - } - node.typeArguments = void 0; - node.typeParameters = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body) { - return node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateGetAccessorDeclaration(createGetAccessorDeclaration(modifiers, name, parameters, type, body), node) : node; - } - function finishUpdateGetAccessorDeclaration(updated, original) { - if (updated !== original) { - updated.typeParameters = original.typeParameters; - } - return finishUpdateBaseSignatureDeclaration(updated, original); - } - function createSetAccessorDeclaration(modifiers, name, parameters, body) { - const node = createBaseDeclaration(179 /* SetAccessor */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.parameters = createNodeArray(parameters); - node.body = body; - if (!node.body) { - node.transformFlags = 1 /* ContainsTypeScript */; - } else { - node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); - } - node.typeArguments = void 0; - node.typeParameters = void 0; - node.type = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateSetAccessorDeclaration(node, modifiers, name, parameters, body) { - return node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body ? finishUpdateSetAccessorDeclaration(createSetAccessorDeclaration(modifiers, name, parameters, body), node) : node; - } - function finishUpdateSetAccessorDeclaration(updated, original) { - if (updated !== original) { - updated.typeParameters = original.typeParameters; - updated.type = original.type; - } - return finishUpdateBaseSignatureDeclaration(updated, original); - } - function createCallSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(180 /* CallSignature */); - node.typeParameters = asNodeArray(typeParameters); - node.parameters = asNodeArray(parameters); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.typeArguments = void 0; - return node; - } - function updateCallSignature(node, typeParameters, parameters, type) { - 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(181 /* ConstructSignature */); - node.typeParameters = asNodeArray(typeParameters); - node.parameters = asNodeArray(parameters); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.typeArguments = void 0; - return node; - } - function updateConstructSignature(node, typeParameters, parameters, type) { - 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(182 /* IndexSignature */); - node.modifiers = asNodeArray(modifiers); - node.parameters = asNodeArray(parameters); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.typeArguments = void 0; - return node; - } - function updateIndexSignature(node, modifiers, parameters, type) { - return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; - } - function createTemplateLiteralTypeSpan(type, literal) { - const node = createBaseNode(205 /* TemplateLiteralTypeSpan */); - node.type = type; - node.literal = literal; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTemplateLiteralTypeSpan(node, type, literal) { - return node.type !== type || node.literal !== literal ? update(createTemplateLiteralTypeSpan(type, literal), node) : node; - } - function createKeywordTypeNode(kind) { - return createToken(kind); - } - function createTypePredicateNode(assertsModifier, parameterName, type) { - const node = createBaseNode(183 /* TypePredicate */); - node.assertsModifier = assertsModifier; - node.parameterName = asName(parameterName); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTypePredicateNode(node, assertsModifier, parameterName, type) { - return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; - } - function createTypeReferenceNode(typeName, typeArguments) { - const node = createBaseNode(184 /* TypeReference */); - node.typeName = asName(typeName); - node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTypeReferenceNode(node, typeName, typeArguments) { - return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; - } - function createFunctionTypeNode(typeParameters, parameters, type) { - const node = createBaseDeclaration(185 /* FunctionType */); - node.typeParameters = asNodeArray(typeParameters); - node.parameters = asNodeArray(parameters); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.modifiers = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.typeArguments = void 0; - return node; - } - function updateFunctionTypeNode(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node) : node; - } - function finishUpdateFunctionTypeNode(updated, original) { - if (updated !== original) { - updated.modifiers = original.modifiers; - } - return finishUpdateBaseSignatureDeclaration(updated, original); - } - function createConstructorTypeNode(...args) { - 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(186 /* ConstructorType */); - node.modifiers = asNodeArray(modifiers); - node.typeParameters = asNodeArray(typeParameters); - node.parameters = asNodeArray(parameters); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.typeArguments = void 0; - return node; - } - function createConstructorTypeNode2(typeParameters, parameters, type) { - return createConstructorTypeNode1( - /*modifiers*/ - void 0, - typeParameters, - parameters, - type - ); - } - function updateConstructorTypeNode(...args) { - return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); - } - function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type) { - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type), node) : node; - } - function updateConstructorTypeNode2(node, typeParameters, parameters, type) { - return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); - } - function createTypeQueryNode(exprName, typeArguments) { - const node = createBaseNode(187 /* TypeQuery */); - node.exprName = exprName; - node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTypeQueryNode(node, exprName, typeArguments) { - return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; - } - function createTypeLiteralNode(members) { - const node = createBaseDeclaration(188 /* TypeLiteral */); - node.members = createNodeArray(members); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTypeLiteralNode(node, members) { - return node.members !== members ? update(createTypeLiteralNode(members), node) : node; - } - function createArrayTypeNode(elementType) { - const node = createBaseNode(189 /* ArrayType */); - node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateArrayTypeNode(node, elementType) { - return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; - } - function createTupleTypeNode(elements) { - const node = createBaseNode(190 /* TupleType */); - node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTupleTypeNode(node, elements) { - return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; - } - function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - const node = createBaseDeclaration(203 /* NamedTupleMember */); - node.dotDotDotToken = dotDotDotToken; - node.name = name; - node.questionToken = questionToken; - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - return node; - } - function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) { - 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(191 /* OptionalType */); - node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateOptionalTypeNode(node, type) { - return node.type !== type ? update(createOptionalTypeNode(type), node) : node; - } - function createRestTypeNode(type) { - const node = createBaseNode(192 /* RestType */); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateRestTypeNode(node, type) { - return node.type !== type ? update(createRestTypeNode(type), node) : node; - } - function createUnionOrIntersectionTypeNode(kind, types, parenthesize) { - const node = createBaseNode(kind); - node.types = factory2.createNodeArray(parenthesize(types)); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateUnionOrIntersectionTypeNode(node, types, parenthesize) { - return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; - } - function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(193 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); - } - function updateUnionTypeNode(node, types) { - return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); - } - function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(194 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); - } - function updateIntersectionTypeNode(node, types) { - return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); - } - function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - const node = createBaseNode(195 /* ConditionalType */); - node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); - node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); - node.trueType = trueType; - node.falseType = falseType; - node.transformFlags = 1 /* ContainsTypeScript */; - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { - 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(196 /* InferType */); - node.typeParameter = typeParameter; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateInferTypeNode(node, typeParameter) { - return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; - } - function createTemplateLiteralType(head, templateSpans) { - const node = createBaseNode(204 /* TemplateLiteralType */); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTemplateLiteralType(node, head, templateSpans) { - return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; - } - function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) { - const node = createBaseNode(206 /* ImportType */); - node.argument = argument; - 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, 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(197 /* ParenthesizedType */); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateParenthesizedType(node, type) { - return node.type !== type ? update(createParenthesizedType(type), node) : node; - } - function createThisTypeNode() { - const node = createBaseNode(198 /* ThisType */); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function createTypeOperatorNode(operator, type) { - const node = createBaseNode(199 /* TypeOperator */); - node.operator = operator; - node.type = operator === 148 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateTypeOperatorNode(node, type) { - return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; - } - function createIndexedAccessTypeNode(objectType, indexType) { - const node = createBaseNode(200 /* IndexedAccessType */); - node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); - node.indexType = indexType; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateIndexedAccessTypeNode(node, objectType, indexType) { - return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; - } - function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { - const node = createBaseDeclaration(201 /* MappedType */); - node.readonlyToken = readonlyToken; - node.typeParameter = typeParameter; - node.nameType = nameType; - node.questionToken = questionToken; - node.type = type; - node.members = members && createNodeArray(members); - node.transformFlags = 1 /* ContainsTypeScript */; - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { - 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(202 /* LiteralType */); - node.literal = literal; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - function updateLiteralTypeNode(node, literal) { - return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; - } - function createObjectBindingPattern(elements) { - const node = createBaseNode(207 /* ObjectBindingPattern */); - node.elements = createNodeArray(elements); - node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; - if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { - node.transformFlags |= 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; - } - return node; - } - function updateObjectBindingPattern(node, elements) { - return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; - } - function createArrayBindingPattern(elements) { - const node = createBaseNode(208 /* ArrayBindingPattern */); - node.elements = createNodeArray(elements); - node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; - return node; - } - function updateArrayBindingPattern(node, elements) { - return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; - } - function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - const node = createBaseDeclaration(209 /* BindingElement */); - node.dotDotDotToken = dotDotDotToken; - node.propertyName = asName(propertyName); - node.name = asName(name); - node.initializer = asInitializer(initializer); - node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.propertyName) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (node.dotDotDotToken ? 32768 /* ContainsRestOrSpread */ : 0 /* None */) | 1024 /* ContainsES2015 */; - node.flowNode = void 0; - return node; - } - function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { - 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(210 /* ArrayLiteralExpression */); - const lastElement = elements && lastOrUndefined(elements); - const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); - node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); - node.multiLine = multiLine; - node.transformFlags |= propagateChildrenFlags(node.elements); - return node; - } - function updateArrayLiteralExpression(node, elements) { - return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node; - } - function createObjectLiteralExpression(properties, multiLine) { - const node = createBaseDeclaration(211 /* ObjectLiteralExpression */); - node.properties = createNodeArray(properties); - node.multiLine = multiLine; - node.transformFlags |= propagateChildrenFlags(node.properties); - node.jsDoc = void 0; - return node; - } - function updateObjectLiteralExpression(node, properties) { - return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node; - } - function createBasePropertyAccessExpression(expression, questionDotToken, name) { - const node = createBaseDeclaration(212 /* PropertyAccessExpression */); - node.expression = expression; - node.questionDotToken = questionDotToken; - node.name = name; - node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function createPropertyAccessExpression(expression, name) { - const node = createBasePropertyAccessExpression( - parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - false - ), - /*questionDotToken*/ - void 0, - asName(name) - ); - if (isSuperKeyword(expression)) { - node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */; - } - return node; - } - function updatePropertyAccessExpression(node, expression, name) { - if (isPropertyAccessChain(node)) { - return updatePropertyAccessChain(node, expression, node.questionDotToken, cast(name, isIdentifier)); - } - return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node; - } - function createPropertyAccessChain(expression, questionDotToken, name) { - const node = createBasePropertyAccessExpression( - parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - true - ), - questionDotToken, - asName(name) - ); - node.flags |= 64 /* OptionalChain */; - node.transformFlags |= 32 /* ContainsES2020 */; - return node; - } - function updatePropertyAccessChain(node, expression, questionDotToken, name) { - 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(213 /* ElementAccessExpression */); - node.expression = expression; - node.questionDotToken = questionDotToken; - node.argumentExpression = argumentExpression; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function createElementAccessExpression(expression, index) { - const node = createBaseElementAccessExpression( - parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - false - ), - /*questionDotToken*/ - void 0, - asExpression(index) - ); - if (isSuperKeyword(expression)) { - node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */; - } - return node; - } - function updateElementAccessExpression(node, expression, argumentExpression) { - if (isElementAccessChain(node)) { - return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression); - } - return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node; - } - function createElementAccessChain(expression, questionDotToken, index) { - const node = createBaseElementAccessExpression( - parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - true - ), - questionDotToken, - asExpression(index) - ); - node.flags |= 64 /* OptionalChain */; - node.transformFlags |= 32 /* ContainsES2020 */; - return node; - } - function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { - 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(214 /* CallExpression */); - node.expression = expression; - node.questionDotToken = questionDotToken; - node.typeArguments = typeArguments; - node.arguments = argumentsArray; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments); - if (node.typeArguments) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - if (isSuperProperty(node.expression)) { - node.transformFlags |= 16384 /* ContainsLexicalThis */; - } - return node; - } - function createCallExpression(expression, typeArguments, argumentsArray) { - const node = createBaseCallExpression( - parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - false - ), - /*questionDotToken*/ - void 0, - asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) - ); - if (isImportKeyword(node.expression)) { - node.transformFlags |= 8388608 /* ContainsDynamicImport */; - } - return node; - } - function updateCallExpression(node, expression, typeArguments, argumentsArray) { - if (isCallChain(node)) { - return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray); - } - return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node; - } - function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - const node = createBaseCallExpression( - parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - true - ), - questionDotToken, - asNodeArray(typeArguments), - parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) - ); - node.flags |= 64 /* OptionalChain */; - node.transformFlags |= 32 /* ContainsES2020 */; - return node; - } - function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { - 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(215 /* NewExpression */); - node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); - node.typeArguments = asNodeArray(typeArguments); - node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32 /* ContainsES2020 */; - if (node.typeArguments) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - return node; - } - function updateNewExpression(node, expression, typeArguments, argumentsArray) { - 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(216 /* TaggedTemplateExpression */); - node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess( - tag, - /*optionalChain*/ - false - ); - node.typeArguments = asNodeArray(typeArguments); - node.template = template; - node.transformFlags |= propagateChildFlags(node.tag) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.template) | 1024 /* ContainsES2015 */; - if (node.typeArguments) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - if (hasInvalidEscape(node.template)) { - node.transformFlags |= 128 /* ContainsES2018 */; - } - return node; - } - function updateTaggedTemplateExpression(node, tag, typeArguments, template) { - return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; - } - function createTypeAssertion(type, expression) { - const node = createBaseNode(217 /* TypeAssertionExpression */); - node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); - node.type = type; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; - return node; - } - function updateTypeAssertion(node, type, expression) { - return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; - } - function createParenthesizedExpression(expression) { - const node = createBaseNode(218 /* ParenthesizedExpression */); - node.expression = expression; - node.transformFlags = propagateChildFlags(node.expression); - node.jsDoc = void 0; - return node; - } - function updateParenthesizedExpression(node, expression) { - return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; - } - function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(219 /* FunctionExpression */); - node.modifiers = asNodeArray(modifiers); - node.asteriskToken = asteriskToken; - node.name = asName(name); - node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray(parameters); - node.type = type; - node.body = body; - 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 */; - node.typeArguments = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - 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(220 /* 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) & 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; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - 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(221 /* DeleteExpression */); - node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); - node.transformFlags |= propagateChildFlags(node.expression); - return node; - } - function updateDeleteExpression(node, expression) { - return node.expression !== expression ? update(createDeleteExpression(expression), node) : node; - } - function createTypeOfExpression(expression) { - const node = createBaseNode(222 /* TypeOfExpression */); - node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); - node.transformFlags |= propagateChildFlags(node.expression); - return node; - } - function updateTypeOfExpression(node, expression) { - return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node; - } - function createVoidExpression(expression) { - const node = createBaseNode(223 /* VoidExpression */); - node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); - node.transformFlags |= propagateChildFlags(node.expression); - return node; - } - function updateVoidExpression(node, expression) { - return node.expression !== expression ? update(createVoidExpression(expression), node) : node; - } - function createAwaitExpression(expression) { - const node = createBaseNode(224 /* AwaitExpression */); - node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); - node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */; - return node; - } - function updateAwaitExpression(node, expression) { - return node.expression !== expression ? update(createAwaitExpression(expression), node) : node; - } - function createPrefixUnaryExpression(operator, operand) { - const node = createBaseNode(225 /* PrefixUnaryExpression */); - node.operator = operator; - node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); - node.transformFlags |= propagateChildFlags(node.operand); - if ((operator === 46 /* PlusPlusToken */ || operator === 47 /* MinusMinusToken */) && isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand)) { - node.transformFlags |= 268435456 /* ContainsUpdateExpressionForIdentifier */; - } - return node; - } - function updatePrefixUnaryExpression(node, operand) { - return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node; - } - function createPostfixUnaryExpression(operand, operator) { - const node = createBaseNode(226 /* PostfixUnaryExpression */); - node.operator = operator; - node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); - node.transformFlags |= propagateChildFlags(node.operand); - if (isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand)) { - node.transformFlags |= 268435456 /* ContainsUpdateExpressionForIdentifier */; - } - return node; - } - function updatePostfixUnaryExpression(node, operand) { - return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node; - } - function createBinaryExpression(left, operator, right) { - const node = createBaseDeclaration(227 /* BinaryExpression */); - const operatorToken = asToken(operator); - const operatorKind = operatorToken.kind; - node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); - node.operatorToken = operatorToken; - node.right = parenthesizerRules().parenthesizeRightSideOfBinary(operatorKind, node.left, right); - node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.operatorToken) | propagateChildFlags(node.right); - if (operatorKind === 61 /* QuestionQuestionToken */) { - node.transformFlags |= 32 /* ContainsES2020 */; - } else if (operatorKind === 64 /* EqualsToken */) { - if (isObjectLiteralExpression(node.left)) { - node.transformFlags |= 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 4096 /* ContainsDestructuringAssignment */ | propagateAssignmentPatternFlags(node.left); - } else if (isArrayLiteralExpression(node.left)) { - node.transformFlags |= 1024 /* ContainsES2015 */ | 4096 /* ContainsDestructuringAssignment */ | propagateAssignmentPatternFlags(node.left); - } - } else if (operatorKind === 43 /* AsteriskAsteriskToken */ || operatorKind === 68 /* AsteriskAsteriskEqualsToken */) { - node.transformFlags |= 512 /* ContainsES2016 */; - } else if (isLogicalOrCoalescingAssignmentOperator(operatorKind)) { - node.transformFlags |= 16 /* ContainsES2021 */; - } - if (operatorKind === 103 /* InKeyword */ && isPrivateIdentifier(node.left)) { - node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */; - } - node.jsDoc = void 0; - return node; - } - function propagateAssignmentPatternFlags(node) { - return containsObjectRestOrSpread(node) ? 65536 /* ContainsObjectRestOrSpread */ : 0 /* None */; - } - function updateBinaryExpression(node, left, operator, right) { - 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(228 /* ConditionalExpression */); - node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); - node.questionToken = questionToken ?? createToken(58 /* QuestionToken */); - node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); - node.colonToken = colonToken ?? createToken(59 /* ColonToken */); - node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse); - node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse); - node.flowNodeWhenFalse = void 0; - node.flowNodeWhenTrue = void 0; - return node; - } - function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) { - 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(229 /* TemplateExpression */); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; - return node; - } - function updateTemplateExpression(node, head, templateSpans) { - return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node; - } - function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0 /* None */) { - Debug.assert(!(templateFlags & ~7176 /* TemplateLiteralLikeFlags */), "Unsupported template flags."); - let cooked = void 0; - if (rawText !== void 0 && rawText !== text) { - cooked = getCookedText(kind, rawText); - if (typeof cooked === "object") { - return Debug.fail("Invalid raw text"); - } - } - if (text === void 0) { - if (cooked === void 0) { - return Debug.fail("Arguments 'text' and 'rawText' may not both be undefined."); - } - text = cooked; - } else if (cooked !== void 0) { - Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'."); - } - return text; - } - function getTransformFlagsOfTemplateLiteralLike(templateFlags) { - let transformFlags = 1024 /* ContainsES2015 */; - if (templateFlags) { - transformFlags |= 128 /* ContainsES2018 */; - } - return transformFlags; - } - function createTemplateLiteralLikeToken(kind, text, rawText, templateFlags) { - const node = createBaseToken(kind); - node.text = text; - node.rawText = rawText; - node.templateFlags = templateFlags & 7176 /* TemplateLiteralLikeFlags */; - node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags); - return node; - } - function createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags) { - const node = createBaseDeclaration(kind); - node.text = text; - node.rawText = rawText; - node.templateFlags = templateFlags & 7176 /* TemplateLiteralLikeFlags */; - node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags); - return node; - } - function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) { - if (kind === 15 /* NoSubstitutionTemplateLiteral */) { - return createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags); - } - return createTemplateLiteralLikeToken(kind, text, rawText, templateFlags); - } - function createTemplateHead(text, rawText, templateFlags) { - text = checkTemplateLiteralLikeNode(16 /* TemplateHead */, text, rawText, templateFlags); - return createTemplateLiteralLikeNode(16 /* TemplateHead */, text, rawText, templateFlags); - } - function createTemplateMiddle(text, rawText, templateFlags) { - text = checkTemplateLiteralLikeNode(16 /* TemplateHead */, text, rawText, templateFlags); - return createTemplateLiteralLikeNode(17 /* TemplateMiddle */, text, rawText, templateFlags); - } - function createTemplateTail(text, rawText, templateFlags) { - text = checkTemplateLiteralLikeNode(16 /* TemplateHead */, text, rawText, templateFlags); - return createTemplateLiteralLikeNode(18 /* TemplateTail */, text, rawText, templateFlags); - } - function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) { - text = checkTemplateLiteralLikeNode(16 /* TemplateHead */, text, rawText, templateFlags); - return createTemplateLiteralLikeDeclaration(15 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags); - } - function createYieldExpression(asteriskToken, expression) { - Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - const node = createBaseNode(230 /* YieldExpression */); - node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.asteriskToken = asteriskToken; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */; - return node; - } - function updateYieldExpression(node, asteriskToken, expression) { - return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node; - } - function createSpreadElement(expression) { - const node = createBaseNode(231 /* SpreadElement */); - node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */; - return node; - } - function updateSpreadElement(node, expression) { - return node.expression !== expression ? update(createSpreadElement(expression), node) : node; - } - function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(232 /* ClassExpression */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.typeParameters = asNodeArray(typeParameters); - node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray(members); - 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 */; - node.jsDoc = void 0; - return node; - } - function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { - 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(233 /* OmittedExpression */); - } - function createExpressionWithTypeArguments(expression, typeArguments) { - const node = createBaseNode(234 /* ExpressionWithTypeArguments */); - node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - false - ); - node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */; - return node; - } - function updateExpressionWithTypeArguments(node, expression, typeArguments) { - return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; - } - function createAsExpression(expression, type) { - const node = createBaseNode(235 /* AsExpression */); - node.expression = expression; - node.type = type; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; - return node; - } - function updateAsExpression(node, expression, type) { - return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; - } - function createNonNullExpression(expression) { - const node = createBaseNode(236 /* NonNullExpression */); - node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - false - ); - node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; - return node; - } - function updateNonNullExpression(node, expression) { - if (isNonNullChain(node)) { - return updateNonNullChain(node, expression); - } - return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; - } - function createSatisfiesExpression(expression, type) { - const node = createBaseNode(239 /* SatisfiesExpression */); - node.expression = expression; - node.type = type; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; - return node; - } - function updateSatisfiesExpression(node, expression, type) { - return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; - } - function createNonNullChain(expression) { - const node = createBaseNode(236 /* NonNullExpression */); - node.flags |= 64 /* OptionalChain */; - node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - true - ); - node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; - return node; - } - function updateNonNullChain(node, expression) { - 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(237 /* MetaProperty */); - node.keywordToken = keywordToken; - node.name = name; - node.transformFlags |= propagateChildFlags(node.name); - switch (keywordToken) { - case 105 /* NewKeyword */: - node.transformFlags |= 1024 /* ContainsES2015 */; - break; - case 102 /* ImportKeyword */: - node.transformFlags |= 32 /* ContainsES2020 */; - break; - default: - return Debug.assertNever(keywordToken); - } - node.flowNode = void 0; - return node; - } - function updateMetaProperty(node, name) { - return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; - } - function createTemplateSpan(expression, literal) { - const node = createBaseNode(240 /* TemplateSpan */); - node.expression = expression; - node.literal = literal; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; - return node; - } - function updateTemplateSpan(node, expression, literal) { - return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; - } - function createSemicolonClassElement() { - const node = createBaseNode(241 /* SemicolonClassElement */); - node.transformFlags |= 1024 /* ContainsES2015 */; - return node; - } - function createBlock(statements, multiLine) { - const node = createBaseNode(242 /* Block */); - node.statements = createNodeArray(statements); - node.multiLine = multiLine; - node.transformFlags |= propagateChildrenFlags(node.statements); - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateBlock(node, statements) { - return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; - } - function createVariableStatement(modifiers, declarationList) { - const node = createBaseNode(244 /* VariableStatement */); - node.modifiers = asNodeArray(modifiers); - node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; - node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); - if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) { - node.transformFlags = 1 /* ContainsTypeScript */; - } - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateVariableStatement(node, modifiers, declarationList) { - return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; - } - function createEmptyStatement() { - const node = createBaseNode(243 /* EmptyStatement */); - node.jsDoc = void 0; - return node; - } - function createExpressionStatement(expression) { - const node = createBaseNode(245 /* ExpressionStatement */); - node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); - node.transformFlags |= propagateChildFlags(node.expression); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateExpressionStatement(node, expression) { - return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; - } - function createIfStatement(expression, thenStatement, elseStatement) { - const node = createBaseNode(246 /* IfStatement */); - node.expression = expression; - node.thenStatement = asEmbeddedStatement(thenStatement); - node.elseStatement = asEmbeddedStatement(elseStatement); - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateIfStatement(node, expression, thenStatement, elseStatement) { - return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node; - } - function createDoStatement(statement, expression) { - const node = createBaseNode(247 /* DoStatement */); - node.statement = asEmbeddedStatement(statement); - node.expression = expression; - node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateDoStatement(node, statement, expression) { - return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node; - } - function createWhileStatement(expression, statement) { - const node = createBaseNode(248 /* WhileStatement */); - node.expression = expression; - node.statement = asEmbeddedStatement(statement); - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateWhileStatement(node, expression, statement) { - return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node; - } - function createForStatement(initializer, condition, incrementor, statement) { - const node = createBaseNode(249 /* ForStatement */); - node.initializer = initializer; - node.condition = condition; - node.incrementor = incrementor; - node.statement = asEmbeddedStatement(statement); - node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - return node; - } - function updateForStatement(node, initializer, condition, incrementor, statement) { - 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(250 /* ForInStatement */); - node.initializer = initializer; - node.expression = expression; - node.statement = asEmbeddedStatement(statement); - node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - return node; - } - function updateForInStatement(node, initializer, expression, statement) { - 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(251 /* ForOfStatement */); - node.awaitModifier = awaitModifier; - node.initializer = initializer; - node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.statement = asEmbeddedStatement(statement); - node.transformFlags |= propagateChildFlags(node.awaitModifier) | propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement) | 1024 /* ContainsES2015 */; - if (awaitModifier) node.transformFlags |= 128 /* ContainsES2018 */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.flowNode = void 0; - return node; - } - function updateForOfStatement(node, awaitModifier, initializer, expression, statement) { - 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(252 /* ContinueStatement */); - node.label = asName(label); - node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateContinueStatement(node, label) { - return node.label !== label ? update(createContinueStatement(label), node) : node; - } - function createBreakStatement(label) { - const node = createBaseNode(253 /* BreakStatement */); - node.label = asName(label); - node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateBreakStatement(node, label) { - return node.label !== label ? update(createBreakStatement(label), node) : node; - } - function createReturnStatement(expression) { - const node = createBaseNode(254 /* ReturnStatement */); - node.expression = expression; - node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateReturnStatement(node, expression) { - return node.expression !== expression ? update(createReturnStatement(expression), node) : node; - } - function createWithStatement(expression, statement) { - const node = createBaseNode(255 /* WithStatement */); - node.expression = expression; - node.statement = asEmbeddedStatement(statement); - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateWithStatement(node, expression, statement) { - return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node; - } - function createSwitchStatement(expression, caseBlock) { - const node = createBaseNode(256 /* SwitchStatement */); - node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.caseBlock = caseBlock; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); - node.jsDoc = void 0; - node.flowNode = void 0; - node.possiblyExhaustive = false; - return node; - } - function updateSwitchStatement(node, expression, caseBlock) { - return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node; - } - function createLabeledStatement(label, statement) { - const node = createBaseNode(257 /* LabeledStatement */); - node.label = asName(label); - node.statement = asEmbeddedStatement(statement); - node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateLabeledStatement(node, label, statement) { - return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node; - } - function createThrowStatement(expression) { - const node = createBaseNode(258 /* ThrowStatement */); - node.expression = expression; - node.transformFlags |= propagateChildFlags(node.expression); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateThrowStatement(node, expression) { - return node.expression !== expression ? update(createThrowStatement(expression), node) : node; - } - function createTryStatement(tryBlock, catchClause, finallyBlock) { - const node = createBaseNode(259 /* TryStatement */); - node.tryBlock = tryBlock; - node.catchClause = catchClause; - node.finallyBlock = finallyBlock; - node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function updateTryStatement(node, tryBlock, catchClause, finallyBlock) { - return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; - } - function createDebuggerStatement() { - const node = createBaseNode(260 /* DebuggerStatement */); - node.jsDoc = void 0; - node.flowNode = void 0; - return node; - } - function createVariableDeclaration(name, exclamationToken, type, initializer) { - const node = createBaseDeclaration(261 /* VariableDeclaration */); - node.name = asName(name); - node.exclamationToken = exclamationToken; - node.type = type; - node.initializer = asInitializer(initializer); - node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (node.exclamationToken ?? node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); - node.jsDoc = void 0; - return node; - } - function updateVariableDeclaration(node, name, exclamationToken, type, initializer) { - 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(262 /* VariableDeclarationList */); - node.flags |= flags2 & 7 /* BlockScoped */; - node.declarations = createNodeArray(declarations); - node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; - 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(263 /* FunctionDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.asteriskToken = asteriskToken; - node.name = asName(name); - node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray(parameters); - node.type = type; - node.body = body; - if (!node.body || modifiersToFlags(node.modifiers) & 128 /* Ambient */) { - node.transformFlags = 1 /* ContainsTypeScript */; - } else { - 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 */; - } - node.typeArguments = void 0; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.endFlowNode = void 0; - node.returnFlowNode = void 0; - return node; - } - function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; - } - function finishUpdateFunctionDeclaration(updated, original) { - if (updated !== original) { - if (updated.modifiers === original.modifiers) { - updated.modifiers = original.modifiers; - } - } - return finishUpdateBaseSignatureDeclaration(updated, original); - } - function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(264 /* 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) & 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 */; - if (node.transformFlags & 8192 /* ContainsTypeScriptClassSyntax */) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - } - node.jsDoc = void 0; - return node; - } - function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { - 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(265 /* InterfaceDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.typeParameters = asNodeArray(typeParameters); - node.heritageClauses = asNodeArray(heritageClauses); - node.members = createNodeArray(members); - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - return node; - } - function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { - 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(266 /* TypeAliasDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.typeParameters = asNodeArray(typeParameters); - node.type = type; - node.transformFlags = 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) { - 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(267 /* EnumDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.members = createNodeArray(members); - node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */; - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.jsDoc = void 0; - return node; - } - function updateEnumDeclaration(node, modifiers, name, members) { - 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(268 /* ModuleDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */); - node.name = name; - node.body = body; - if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) { - node.transformFlags = 1 /* ContainsTypeScript */; - } else { - node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; - } - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateModuleDeclaration(node, modifiers, name, body) { - 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(269 /* ModuleBlock */); - node.statements = createNodeArray(statements); - node.transformFlags |= propagateChildrenFlags(node.statements); - node.jsDoc = void 0; - return node; - } - function updateModuleBlock(node, statements) { - return node.statements !== statements ? update(createModuleBlock(statements), node) : node; - } - function createCaseBlock(clauses) { - const node = createBaseNode(270 /* CaseBlock */); - node.clauses = createNodeArray(clauses); - node.transformFlags |= propagateChildrenFlags(node.clauses); - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateCaseBlock(node, clauses) { - return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; - } - function createNamespaceExportDeclaration(name) { - const node = createBaseDeclaration(271 /* NamespaceExportDeclaration */); - node.name = asName(name); - node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; - node.modifiers = void 0; - node.jsDoc = void 0; - return node; - } - function updateNamespaceExportDeclaration(node, name) { - return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(name), node) : node; - } - function finishUpdateNamespaceExportDeclaration(updated, original) { - if (updated !== original) { - updated.modifiers = original.modifiers; - } - return update(updated, original); - } - function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { - const node = createBaseDeclaration(272 /* ImportEqualsDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.name = asName(name); - node.isTypeOnly = isTypeOnly; - node.moduleReference = moduleReference; - node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.moduleReference); - if (!isExternalModuleReference(node.moduleReference)) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.jsDoc = void 0; - return node; - } - 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, attributes) { - const node = createBaseNode(273 /* ImportDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.importClause = importClause; - node.moduleSpecifier = moduleSpecifier; - 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, attributes) { - return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node; - } - function createImportClause2(phaseModifier, name, namedBindings) { - const node = createBaseDeclaration(274 /* ImportClause */); - if (typeof phaseModifier === "boolean") { - phaseModifier = phaseModifier ? 156 /* TypeKeyword */ : void 0; - } - node.isTypeOnly = phaseModifier === 156 /* TypeKeyword */; - node.phaseModifier = phaseModifier; - node.name = name; - node.namedBindings = namedBindings; - node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.namedBindings); - if (phaseModifier === 156 /* TypeKeyword */) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - return node; - } - function updateImportClause(node, phaseModifier, name, namedBindings) { - if (typeof phaseModifier === "boolean") { - phaseModifier = phaseModifier ? 156 /* TypeKeyword */ : void 0; - } - return node.phaseModifier !== phaseModifier || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause2(phaseModifier, name, namedBindings), node) : node; - } - function createAssertClause(elements, multiLine) { - const node = createBaseNode(301 /* AssertClause */); - node.elements = createNodeArray(elements); - node.multiLine = multiLine; - node.token = 132 /* AssertKeyword */; - node.transformFlags |= 4 /* ContainsESNext */; - return node; - } - function updateAssertClause(node, elements, multiLine) { - return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node; - } - function createAssertEntry(name, value) { - const node = createBaseNode(302 /* AssertEntry */); - node.name = name; - node.value = value; - node.transformFlags |= 4 /* ContainsESNext */; - return node; - } - function updateAssertEntry(node, name, value) { - return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node; - } - function createImportTypeAssertionContainer(clause, multiLine) { - const node = createBaseNode(303 /* ImportTypeAssertionContainer */); - node.assertClause = clause; - node.multiLine = multiLine; - return node; - } - 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(301 /* 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(302 /* 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(275 /* NamespaceImport */); - node.name = name; - node.transformFlags |= propagateChildFlags(node.name); - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - return node; - } - function updateNamespaceImport(node, name) { - return node.name !== name ? update(createNamespaceImport(name), node) : node; - } - function createNamespaceExport(name) { - const node = createBaseDeclaration(281 /* NamespaceExport */); - node.name = name; - node.transformFlags |= propagateChildFlags(node.name) | 32 /* ContainsES2020 */; - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - return node; - } - function updateNamespaceExport(node, name) { - return node.name !== name ? update(createNamespaceExport(name), node) : node; - } - function createNamedImports(elements) { - const node = createBaseNode(276 /* NamedImports */); - node.elements = createNodeArray(elements); - node.transformFlags |= propagateChildrenFlags(node.elements); - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - return node; - } - function updateNamedImports(node, elements) { - return node.elements !== elements ? update(createNamedImports(elements), node) : node; - } - function createImportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseDeclaration(277 /* ImportSpecifier */); - node.isTypeOnly = isTypeOnly; - node.propertyName = propertyName; - node.name = name; - node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - return node; - } - function updateImportSpecifier(node, isTypeOnly, propertyName, name) { - 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(278 /* ExportAssignment */); - node.modifiers = asNodeArray(modifiers); - node.isExportEquals = isExportEquals; - node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary( - 64 /* EqualsToken */, - /*leftSide*/ - void 0, - expression - ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); - node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.jsDoc = void 0; - return node; - } - 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, attributes) { - const node = createBaseDeclaration(279 /* ExportDeclaration */); - node.modifiers = asNodeArray(modifiers); - node.isTypeOnly = isTypeOnly; - node.exportClause = exportClause; - node.moduleSpecifier = moduleSpecifier; - 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, 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) { - if (updated.modifiers === original.modifiers) { - updated.modifiers = original.modifiers; - } - } - return update(updated, original); - } - function createNamedExports(elements) { - const node = createBaseNode(280 /* NamedExports */); - node.elements = createNodeArray(elements); - node.transformFlags |= propagateChildrenFlags(node.elements); - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - return node; - } - function updateNamedExports(node, elements) { - return node.elements !== elements ? update(createNamedExports(elements), node) : node; - } - function createExportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseNode(282 /* ExportSpecifier */); - node.isTypeOnly = isTypeOnly; - node.propertyName = asName(propertyName); - node.name = asName(name); - node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - node.jsDoc = void 0; - return node; - } - function updateExportSpecifier(node, isTypeOnly, propertyName, name) { - return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; - } - function createMissingDeclaration() { - const node = createBaseDeclaration(283 /* MissingDeclaration */); - node.jsDoc = void 0; - return node; - } - function createExternalModuleReference(expression) { - const node = createBaseNode(284 /* ExternalModuleReference */); - node.expression = expression; - node.transformFlags |= propagateChildFlags(node.expression); - node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; - return node; - } - function updateExternalModuleReference(node, expression) { - return node.expression !== expression ? update(createExternalModuleReference(expression), node) : node; - } - function createJSDocPrimaryTypeWorker(kind) { - return createBaseNode(kind); - } - function createJSDocPrePostfixUnaryTypeWorker(kind, type, postfix = false) { - const node = createJSDocUnaryTypeWorker( - kind, - postfix ? type && parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(type) : type - ); - node.postfix = postfix; - return node; - } - function createJSDocUnaryTypeWorker(kind, type) { - const node = createBaseNode(kind); - node.type = type; - return node; - } - function updateJSDocPrePostfixUnaryTypeWorker(kind, node, type) { - return node.type !== type ? update(createJSDocPrePostfixUnaryTypeWorker(kind, type, node.postfix), node) : node; - } - function updateJSDocUnaryTypeWorker(kind, node, type) { - return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node; - } - function createJSDocFunctionType(parameters, type) { - const node = createBaseDeclaration(318 /* JSDocFunctionType */); - node.parameters = asNodeArray(parameters); - node.type = type; - node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - node.typeArguments = void 0; - return node; - } - function updateJSDocFunctionType(node, parameters, type) { - return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; - } - function createJSDocTypeLiteral(propertyTags, isArrayType = false) { - const node = createBaseDeclaration(323 /* JSDocTypeLiteral */); - node.jsDocPropertyTags = asNodeArray(propertyTags); - node.isArrayType = isArrayType; - return node; - } - function updateJSDocTypeLiteral(node, propertyTags, isArrayType) { - return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; - } - function createJSDocTypeExpression(type) { - const node = createBaseNode(310 /* JSDocTypeExpression */); - node.type = type; - return node; - } - function updateJSDocTypeExpression(node, type) { - return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; - } - function createJSDocSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(324 /* JSDocSignature */); - node.typeParameters = asNodeArray(typeParameters); - node.parameters = createNodeArray(parameters); - node.type = type; - node.jsDoc = void 0; - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateJSDocSignature(node, typeParameters, parameters, type) { - return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature(typeParameters, parameters, type), node) : node; - } - function getDefaultTagName(node) { - const defaultTagName = getDefaultTagNameForKind(node.kind); - return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName); - } - function createBaseJSDocTag(kind, tagName, comment) { - const node = createBaseNode(kind); - node.tagName = tagName; - node.comment = comment; - return node; - } - function createBaseJSDocTagDeclaration(kind, tagName, comment) { - const node = createBaseDeclaration(kind); - node.tagName = tagName; - node.comment = comment; - return node; - } - function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - const node = createBaseJSDocTag(346 /* JSDocTemplateTag */, tagName ?? createIdentifier("template"), comment); - node.constraint = constraint; - node.typeParameters = createNodeArray(typeParameters); - return node; - } - function updateJSDocTemplateTag(node, tagName = getDefaultTagName(node), constraint, typeParameters, comment) { - 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(347 /* JSDocTypedefTag */, tagName ?? createIdentifier("typedef"), comment); - node.typeExpression = typeExpression; - node.fullName = fullName; - node.name = getJSDocTypeAliasName(fullName); - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - 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(342 /* JSDocParameterTag */, tagName ?? createIdentifier("param"), comment); - node.typeExpression = typeExpression; - node.name = name; - node.isNameFirst = !!isNameFirst; - node.isBracketed = isBracketed; - return node; - } - function updateJSDocParameterTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - 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(349 /* JSDocPropertyTag */, tagName ?? createIdentifier("prop"), comment); - node.typeExpression = typeExpression; - node.name = name; - node.isNameFirst = !!isNameFirst; - node.isBracketed = isBracketed; - return node; - } - function updateJSDocPropertyTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { - 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(339 /* JSDocCallbackTag */, tagName ?? createIdentifier("callback"), comment); - node.typeExpression = typeExpression; - node.fullName = fullName; - node.name = getJSDocTypeAliasName(fullName); - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { - 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(340 /* JSDocOverloadTag */, tagName ?? createIdentifier("overload"), comment); - node.typeExpression = typeExpression; - return node; - } - function updateJSDocOverloadTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { - 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(329 /* JSDocAugmentsTag */, tagName ?? createIdentifier("augments"), comment); - node.class = className; - return node; - } - function updateJSDocAugmentsTag(node, tagName = getDefaultTagName(node), className, comment) { - 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(330 /* JSDocImplementsTag */, tagName ?? createIdentifier("implements"), comment); - node.class = className; - return node; - } - function createJSDocSeeTag(tagName, name, comment) { - const node = createBaseJSDocTag(348 /* JSDocSeeTag */, tagName ?? createIdentifier("see"), comment); - node.name = name; - return node; - } - function updateJSDocSeeTag(node, tagName, name, comment) { - return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node; - } - function createJSDocNameReference(name) { - const node = createBaseNode(311 /* JSDocNameReference */); - node.name = name; - return node; - } - function updateJSDocNameReference(node, name) { - return node.name !== name ? update(createJSDocNameReference(name), node) : node; - } - function createJSDocMemberName(left, right) { - const node = createBaseNode(312 /* JSDocMemberName */); - node.left = left; - node.right = right; - node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right); - return node; - } - function updateJSDocMemberName(node, left, right) { - return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node; - } - function createJSDocLink(name, text) { - const node = createBaseNode(325 /* JSDocLink */); - node.name = name; - node.text = text; - return node; - } - function updateJSDocLink(node, name, text) { - return node.name !== name ? update(createJSDocLink(name, text), node) : node; - } - function createJSDocLinkCode(name, text) { - const node = createBaseNode(326 /* JSDocLinkCode */); - node.name = name; - node.text = text; - return node; - } - function updateJSDocLinkCode(node, name, text) { - return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node; - } - function createJSDocLinkPlain(name, text) { - const node = createBaseNode(327 /* JSDocLinkPlain */); - node.name = name; - node.text = text; - return node; - } - function updateJSDocLinkPlain(node, name, text) { - return node.name !== name ? update(createJSDocLinkPlain(name, text), node) : node; - } - function updateJSDocImplementsTag(node, tagName = getDefaultTagName(node), className, comment) { - return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag(tagName, className, comment), node) : node; - } - function createJSDocSimpleTagWorker(kind, tagName, comment) { - const node = createBaseJSDocTag(kind, tagName ?? createIdentifier(getDefaultTagNameForKind(kind)), comment); - return node; - } - function updateJSDocSimpleTagWorker(kind, node, tagName = getDefaultTagName(node), comment) { - return node.tagName !== tagName || node.comment !== comment ? update(createJSDocSimpleTagWorker(kind, tagName, comment), node) : node; - } - function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) { - const node = createBaseJSDocTag(kind, tagName ?? createIdentifier(getDefaultTagNameForKind(kind)), comment); - node.typeExpression = typeExpression; - return node; - } - function updateJSDocTypeLikeTagWorker(kind, node, tagName = getDefaultTagName(node), typeExpression, comment) { - 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(328 /* 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(341 /* JSDocEnumTag */, tagName ?? createIdentifier(getDefaultTagNameForKind(341 /* JSDocEnumTag */)), comment); - node.typeExpression = typeExpression; - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { - return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; - } - function createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) { - const node = createBaseJSDocTag(352 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment); - node.importClause = importClause; - node.moduleSpecifier = moduleSpecifier; - node.attributes = attributes; - node.comment = comment; - return node; - } - function updateJSDocImportTag(node, tagName, importClause, moduleSpecifier, attributes, comment) { - return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment), node) : node; - } - function createJSDocText(text) { - const node = createBaseNode(322 /* JSDocText */); - node.text = text; - return node; - } - function updateJSDocText(node, text) { - return node.text !== text ? update(createJSDocText(text), node) : node; - } - function createJSDocComment(comment, tags) { - const node = createBaseNode(321 /* JSDoc */); - node.comment = comment; - node.tags = asNodeArray(tags); - return node; - } - function updateJSDocComment(node, comment, tags) { - return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; - } - function createJsxElement(openingElement, children, closingElement) { - const node = createBaseNode(285 /* JsxElement */); - node.openingElement = openingElement; - node.children = createNodeArray(children); - node.closingElement = closingElement; - node.transformFlags |= propagateChildFlags(node.openingElement) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingElement) | 2 /* ContainsJsx */; - return node; - } - function updateJsxElement(node, openingElement, children, closingElement) { - 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(286 /* JsxSelfClosingElement */); - node.tagName = tagName; - node.typeArguments = asNodeArray(typeArguments); - node.attributes = attributes; - node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2 /* ContainsJsx */; - if (node.typeArguments) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - return node; - } - function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) { - 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(287 /* JsxOpeningElement */); - node.tagName = tagName; - node.typeArguments = asNodeArray(typeArguments); - node.attributes = attributes; - node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2 /* ContainsJsx */; - if (typeArguments) { - node.transformFlags |= 1 /* ContainsTypeScript */; - } - return node; - } - function updateJsxOpeningElement(node, tagName, typeArguments, attributes) { - return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; - } - function createJsxClosingElement(tagName) { - const node = createBaseNode(288 /* JsxClosingElement */); - node.tagName = tagName; - node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; - return node; - } - function updateJsxClosingElement(node, tagName) { - return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; - } - function createJsxFragment(openingFragment, children, closingFragment) { - const node = createBaseNode(289 /* JsxFragment */); - node.openingFragment = openingFragment; - node.children = createNodeArray(children); - node.closingFragment = closingFragment; - node.transformFlags |= propagateChildFlags(node.openingFragment) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingFragment) | 2 /* ContainsJsx */; - return node; - } - function updateJsxFragment(node, openingFragment, children, closingFragment) { - return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment(openingFragment, children, closingFragment), node) : node; - } - function createJsxText(text, containsOnlyTriviaWhiteSpaces) { - const node = createBaseNode(12 /* JsxText */); - node.text = text; - node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces; - node.transformFlags |= 2 /* ContainsJsx */; - return node; - } - function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) { - return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; - } - function createJsxOpeningFragment() { - const node = createBaseNode(290 /* JsxOpeningFragment */); - node.transformFlags |= 2 /* ContainsJsx */; - return node; - } - function createJsxJsxClosingFragment() { - const node = createBaseNode(291 /* JsxClosingFragment */); - node.transformFlags |= 2 /* ContainsJsx */; - return node; - } - function createJsxAttribute(name, initializer) { - const node = createBaseDeclaration(292 /* JsxAttribute */); - node.name = name; - node.initializer = initializer; - node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; - return node; - } - function updateJsxAttribute(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; - } - function createJsxAttributes(properties) { - const node = createBaseDeclaration(293 /* JsxAttributes */); - node.properties = createNodeArray(properties); - node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; - return node; - } - function updateJsxAttributes(node, properties) { - return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; - } - function createJsxSpreadAttribute(expression) { - const node = createBaseNode(294 /* JsxSpreadAttribute */); - node.expression = expression; - node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; - return node; - } - function updateJsxSpreadAttribute(node, expression) { - return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; - } - function createJsxExpression(dotDotDotToken, expression) { - const node = createBaseNode(295 /* JsxExpression */); - node.dotDotDotToken = dotDotDotToken; - node.expression = expression; - node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; - return node; - } - function updateJsxExpression(node, expression) { - return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; - } - function createJsxNamespacedName(namespace, name) { - const node = createBaseNode(296 /* JsxNamespacedName */); - node.namespace = namespace; - node.name = name; - node.transformFlags |= propagateChildFlags(node.namespace) | propagateChildFlags(node.name) | 2 /* ContainsJsx */; - return node; - } - function updateJsxNamespacedName(node, namespace, name) { - return node.namespace !== namespace || node.name !== name ? update(createJsxNamespacedName(namespace, name), node) : node; - } - function createCaseClause(expression, statements) { - const node = createBaseNode(297 /* CaseClause */); - node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.statements = createNodeArray(statements); - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); - node.jsDoc = void 0; - return node; - } - function updateCaseClause(node, expression, statements) { - return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; - } - function createDefaultClause(statements) { - const node = createBaseNode(298 /* DefaultClause */); - node.statements = createNodeArray(statements); - node.transformFlags = propagateChildrenFlags(node.statements); - return node; - } - function updateDefaultClause(node, statements) { - return node.statements !== statements ? update(createDefaultClause(statements), node) : node; - } - function createHeritageClause(token, types) { - const node = createBaseNode(299 /* HeritageClause */); - node.token = token; - node.types = createNodeArray(types); - node.transformFlags |= propagateChildrenFlags(node.types); - switch (token) { - case 96 /* ExtendsKeyword */: - node.transformFlags |= 1024 /* ContainsES2015 */; - break; - case 119 /* ImplementsKeyword */: - node.transformFlags |= 1 /* ContainsTypeScript */; - break; - default: - return Debug.assertNever(token); - } - return node; - } - function updateHeritageClause(node, types) { - return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; - } - function createCatchClause(variableDeclaration, block) { - const node = createBaseNode(300 /* CatchClause */); - node.variableDeclaration = asVariableDeclaration(variableDeclaration); - node.block = block; - node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 /* ContainsES2019 */ : 0 /* None */); - node.locals = void 0; - node.nextContainer = void 0; - return node; - } - function updateCatchClause(node, variableDeclaration, block) { - return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; - } - function createPropertyAssignment(name, initializer) { - const node = createBaseDeclaration(304 /* PropertyAssignment */); - node.name = asName(name); - node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); - node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); - node.modifiers = void 0; - node.questionToken = void 0; - node.exclamationToken = void 0; - node.jsDoc = void 0; - return node; - } - function updatePropertyAssignment(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment(name, initializer), node) : node; - } - function finishUpdatePropertyAssignment(updated, original) { - if (updated !== original) { - updated.modifiers = original.modifiers; - updated.questionToken = original.questionToken; - updated.exclamationToken = original.exclamationToken; - } - return update(updated, original); - } - function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - const node = createBaseDeclaration(305 /* ShorthandPropertyAssignment */); - node.name = asName(name); - node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); - node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; - node.equalsToken = void 0; - node.modifiers = void 0; - node.questionToken = void 0; - node.exclamationToken = void 0; - node.jsDoc = void 0; - return node; - } - function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { - return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node) : node; - } - function finishUpdateShorthandPropertyAssignment(updated, original) { - if (updated !== original) { - updated.modifiers = original.modifiers; - updated.questionToken = original.questionToken; - updated.exclamationToken = original.exclamationToken; - updated.equalsToken = original.equalsToken; - } - return update(updated, original); - } - function createSpreadAssignment(expression) { - const node = createBaseDeclaration(306 /* SpreadAssignment */); - node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); - node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; - node.jsDoc = void 0; - return node; - } - function updateSpreadAssignment(node, expression) { - return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; - } - function createEnumMember(name, initializer) { - const node = createBaseDeclaration(307 /* EnumMember */); - node.name = asName(name); - node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); - node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; - node.jsDoc = void 0; - return node; - } - function updateEnumMember(node, name, initializer) { - return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; - } - function createSourceFile2(statements, endOfFileToken, flags2) { - const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); - node.statements = createNodeArray(statements); - node.endOfFileToken = endOfFileToken; - node.flags |= flags2; - node.text = ""; - node.fileName = ""; - node.path = ""; - node.resolvedPath = ""; - node.originalFileName = ""; - node.languageVersion = 1 /* ES5 */; - node.languageVariant = 0; - node.scriptKind = 0; - node.isDeclarationFile = false; - node.hasNoDefaultLib = false; - node.transformFlags |= propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); - node.locals = void 0; - node.nextContainer = void 0; - node.endFlowNode = void 0; - node.nodeCount = 0; - node.identifierCount = 0; - node.symbolCount = 0; - node.parseDiagnostics = void 0; - node.bindDiagnostics = void 0; - node.bindSuggestionDiagnostics = void 0; - node.lineMap = void 0; - node.externalModuleIndicator = void 0; - node.setExternalModuleIndicator = void 0; - node.pragmas = void 0; - node.checkJsDirective = void 0; - node.referencedFiles = void 0; - node.typeReferenceDirectives = void 0; - node.libReferenceDirectives = void 0; - node.amdDependencies = void 0; - node.commentDirectives = void 0; - node.identifiers = void 0; - node.packageJsonLocations = void 0; - node.packageJsonScope = void 0; - node.imports = void 0; - node.moduleAugmentations = void 0; - node.ambientModuleNames = void 0; - node.classifiableNames = void 0; - node.impliedNodeFormat = void 0; - return node; - } - function createRedirectedSourceFile(redirectInfo) { - const node = Object.create(redirectInfo.redirectTarget); - Object.defineProperties(node, { - id: { - get() { - return this.redirectInfo.redirectTarget.id; - }, - set(value) { - this.redirectInfo.redirectTarget.id = value; - } - }, - symbol: { - get() { - return this.redirectInfo.redirectTarget.symbol; - }, - set(value) { - this.redirectInfo.redirectTarget.symbol = value; - } - } - }); - node.redirectInfo = redirectInfo; - return node; - } - function cloneRedirectedSourceFile(source) { - const node = createRedirectedSourceFile(source.redirectInfo); - node.flags |= source.flags & ~16 /* Synthesized */; - node.fileName = source.fileName; - node.path = source.path; - node.resolvedPath = source.resolvedPath; - node.originalFileName = source.originalFileName; - node.packageJsonLocations = source.packageJsonLocations; - node.packageJsonScope = source.packageJsonScope; - node.emitNode = void 0; - return node; - } - function cloneSourceFileWorker(source) { - const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); - node.flags |= source.flags & ~16 /* Synthesized */; - for (const p in source) { - if (hasProperty(node, p) || !hasProperty(source, p)) { - continue; - } - if (p === "emitNode") { - node.emitNode = void 0; - continue; - } - node[p] = source[p]; - } - return node; - } - function cloneSourceFile(source) { - const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source); - setOriginal(node, source); - return node; - } - function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { - const node = cloneSourceFile(source); - node.statements = createNodeArray(statements); - node.isDeclarationFile = isDeclarationFile; - node.referencedFiles = referencedFiles; - node.typeReferenceDirectives = typeReferences; - node.hasNoDefaultLib = hasNoDefaultLib; - node.libReferenceDirectives = libReferences; - node.transformFlags = propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); - return node; - } - function updateSourceFile2(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) { - 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) { - const node = createBaseNode(309 /* Bundle */); - node.sourceFiles = sourceFiles; - node.syntheticFileReferences = void 0; - node.syntheticTypeReferences = void 0; - node.syntheticLibReferences = void 0; - node.hasNoDefaultLib = void 0; - return node; - } - function updateBundle(node, sourceFiles) { - return node.sourceFiles !== sourceFiles ? update(createBundle(sourceFiles), node) : node; - } - function createSyntheticExpression(type, isSpread = false, tupleNameSource) { - const node = createBaseNode(238 /* SyntheticExpression */); - node.type = type; - node.isSpread = isSpread; - node.tupleNameSource = tupleNameSource; - return node; - } - function createSyntaxList3(children) { - const node = createBaseNode(353 /* SyntaxList */); - node._children = children; - return node; - } - function createNotEmittedStatement(original) { - const node = createBaseNode(354 /* NotEmittedStatement */); - node.original = original; - setTextRange(node, original); - return node; - } - function createPartiallyEmittedExpression(expression, original) { - const node = createBaseNode(356 /* PartiallyEmittedExpression */); - node.expression = expression; - node.original = original; - node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; - setTextRange(node, original); - return node; - } - function updatePartiallyEmittedExpression(node, expression) { - return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node; - } - function createNotEmittedTypeElement() { - return createBaseNode(355 /* NotEmittedTypeElement */); - } - function flattenCommaElements(node) { - if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (isCommaListExpression(node)) { - return node.elements; - } - if (isBinaryExpression(node) && isCommaToken(node.operatorToken)) { - return [node.left, node.right]; - } - } - return node; - } - function createCommaListExpression(elements) { - const node = createBaseNode(357 /* CommaListExpression */); - node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); - node.transformFlags |= propagateChildrenFlags(node.elements); - return node; - } - function updateCommaListExpression(node, elements) { - return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; - } - function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(358 /* SyntheticReferenceExpression */); - node.expression = expression; - node.thisArg = thisArg; - node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); - return node; - } - function updateSyntheticReferenceExpression(node, expression, thisArg) { - return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node; - } - function cloneGeneratedIdentifier(node) { - const clone2 = createBaseIdentifier(node.escapedText); - clone2.flags |= node.flags & ~16 /* Synthesized */; - clone2.transformFlags = node.transformFlags; - setOriginal(clone2, node); - setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); - return clone2; - } - function cloneIdentifier(node) { - const clone2 = createBaseIdentifier(node.escapedText); - clone2.flags |= node.flags & ~16 /* Synthesized */; - clone2.jsDoc = node.jsDoc; - clone2.flowNode = node.flowNode; - clone2.symbol = node.symbol; - clone2.transformFlags = node.transformFlags; - setOriginal(clone2, node); - const typeArguments = getIdentifierTypeArguments(node); - if (typeArguments) setIdentifierTypeArguments(clone2, typeArguments); - return clone2; - } - function cloneGeneratedPrivateIdentifier(node) { - const clone2 = createBasePrivateIdentifier(node.escapedText); - clone2.flags |= node.flags & ~16 /* Synthesized */; - clone2.transformFlags = node.transformFlags; - setOriginal(clone2, node); - setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); - return clone2; - } - function clonePrivateIdentifier(node) { - const clone2 = createBasePrivateIdentifier(node.escapedText); - clone2.flags |= node.flags & ~16 /* Synthesized */; - clone2.transformFlags = node.transformFlags; - setOriginal(clone2, node); - return clone2; - } - function cloneNode(node) { - if (node === void 0) { - return node; - } - if (isSourceFile(node)) { - return cloneSourceFile(node); - } - if (isGeneratedIdentifier(node)) { - return cloneGeneratedIdentifier(node); - } - if (isIdentifier(node)) { - return cloneIdentifier(node); - } - if (isGeneratedPrivateIdentifier(node)) { - return cloneGeneratedPrivateIdentifier(node); - } - if (isPrivateIdentifier(node)) { - return clonePrivateIdentifier(node); - } - const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind); - clone2.flags |= node.flags & ~16 /* Synthesized */; - clone2.transformFlags = node.transformFlags; - setOriginal(clone2, node); - for (const key in node) { - if (hasProperty(clone2, key) || !hasProperty(node, key)) { - continue; - } - clone2[key] = node[key]; - } - return clone2; - } - function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) { - return createCallExpression( - createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - param ? [param] : [], - /*type*/ - void 0, - createBlock( - statements, - /*multiLine*/ - true - ) - ), - /*typeArguments*/ - void 0, - /*argumentsArray*/ - paramValue ? [paramValue] : [] - ); - } - function createImmediatelyInvokedArrowFunction(statements, param, paramValue) { - return createCallExpression( - createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - param ? [param] : [], - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - createBlock( - statements, - /*multiLine*/ - true - ) - ), - /*typeArguments*/ - void 0, - /*argumentsArray*/ - paramValue ? [paramValue] : [] - ); - } - function createVoidZero() { - return createVoidExpression(createNumericLiteral("0")); - } - function createExportDefault(expression) { - return createExportAssignment2( - /*modifiers*/ - void 0, - /*isExportEquals*/ - false, - expression - ); - } - function createExternalModuleExport(exportName) { - return createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - createNamedExports([ - createExportSpecifier( - /*isTypeOnly*/ - false, - /*propertyName*/ - void 0, - exportName - ) - ]) - ); - } - function createTypeCheck(value, 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)) { - return createCallChain( - createPropertyAccessChain( - object, - /*questionDotToken*/ - void 0, - methodName - ), - /*questionDotToken*/ - void 0, - /*typeArguments*/ - void 0, - argumentsList - ); - } - return createCallExpression( - createPropertyAccessExpression(object, methodName), - /*typeArguments*/ - void 0, - argumentsList - ); - } - function createFunctionBindCall(target, thisArg, argumentsList) { - return createMethodCall(target, "bind", [thisArg, ...argumentsList]); - } - function createFunctionCallCall(target, thisArg, argumentsList) { - return createMethodCall(target, "call", [thisArg, ...argumentsList]); - } - function createFunctionApplyCall(target, thisArg, argumentsExpression) { - return createMethodCall(target, "apply", [thisArg, argumentsExpression]); - } - function createGlobalMethodCall(globalObjectName, methodName, argumentsList) { - return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList); - } - function createArraySliceCall(array, start) { - return createMethodCall(array, "slice", start === void 0 ? [] : [asExpression(start)]); - } - function createArrayConcatCall(array, argumentsList) { - return createMethodCall(array, "concat", argumentsList); - } - function createObjectDefinePropertyCall(target, propertyName, attributes) { - return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); - } - function createObjectGetOwnPropertyDescriptorCall(target, propertyName) { - return createGlobalMethodCall("Object", "getOwnPropertyDescriptor", [target, asExpression(propertyName)]); - } - function createReflectGetCall(target, propertyKey, receiver) { - return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); - } - function createReflectSetCall(target, propertyKey, value, receiver) { - return createGlobalMethodCall("Reflect", "set", receiver ? [target, propertyKey, value, receiver] : [target, propertyKey, value]); - } - function tryAddPropertyAssignment(properties, propertyName, expression) { - if (expression) { - properties.push(createPropertyAssignment(propertyName, expression)); - return true; - } - return false; - } - function createPropertyDescriptor(attributes, singleLine) { - const properties = []; - tryAddPropertyAssignment(properties, "enumerable", asExpression(attributes.enumerable)); - tryAddPropertyAssignment(properties, "configurable", asExpression(attributes.configurable)); - let isData = tryAddPropertyAssignment(properties, "writable", asExpression(attributes.writable)); - isData = tryAddPropertyAssignment(properties, "value", attributes.value) || isData; - let isAccessor2 = tryAddPropertyAssignment(properties, "get", attributes.get); - isAccessor2 = tryAddPropertyAssignment(properties, "set", attributes.set) || isAccessor2; - Debug.assert(!(isData && isAccessor2), "A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."); - return createObjectLiteralExpression(properties, !singleLine); - } - function updateOuterExpression(outerExpression, expression) { - switch (outerExpression.kind) { - case 218 /* ParenthesizedExpression */: - return updateParenthesizedExpression(outerExpression, expression); - case 217 /* TypeAssertionExpression */: - return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 235 /* AsExpression */: - return updateAsExpression(outerExpression, expression, outerExpression.type); - case 239 /* SatisfiesExpression */: - return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); - case 236 /* NonNullExpression */: - return updateNonNullExpression(outerExpression, expression); - case 234 /* ExpressionWithTypeArguments */: - return updateExpressionWithTypeArguments(outerExpression, expression, outerExpression.typeArguments); - case 356 /* PartiallyEmittedExpression */: - return updatePartiallyEmittedExpression(outerExpression, expression); - } - } - function isIgnorableParen(node) { - return isParenthesizedExpression(node) && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node)); - } - function restoreOuterExpressions(outerExpression, innerExpression, kinds = 63 /* All */) { - if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { - return updateOuterExpression( - outerExpression, - restoreOuterExpressions(outerExpression.expression, innerExpression) - ); - } - return innerExpression; - } - function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { - if (!outermostLabeledStatement) { - return node; - } - const updated = updateLabeledStatement( - outermostLabeledStatement, - outermostLabeledStatement.label, - isLabeledStatement(outermostLabeledStatement.statement) ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node - ); - if (afterRestoreLabelCallback) { - afterRestoreLabelCallback(outermostLabeledStatement); - } - return updated; - } - function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { - const target = skipParentheses(node); - switch (target.kind) { - case 80 /* Identifier */: - return cacheIdentifiers; - case 110 /* ThisKeyword */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 11 /* StringLiteral */: - return false; - case 210 /* ArrayLiteralExpression */: - const elements = target.elements; - if (elements.length === 0) { - return false; - } - return true; - case 211 /* ObjectLiteralExpression */: - return target.properties.length > 0; - default: - return true; - } - } - function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers = false) { - const callee = skipOuterExpressions(expression, 63 /* All */); - let thisArg; - let target; - if (isSuperProperty(callee)) { - thisArg = createThis(); - target = callee; - } else if (isSuperKeyword(callee)) { - thisArg = createThis(); - target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier("_super"), callee) : callee; - } else if (getEmitFlags(callee) & 8192 /* HelperName */) { - thisArg = createVoidZero(); - target = parenthesizerRules().parenthesizeLeftSideOfAccess( - callee, - /*optionalChain*/ - false - ); - } else if (isPropertyAccessExpression(callee)) { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createPropertyAccessExpression( - setTextRange( - factory2.createAssignment( - thisArg, - callee.expression - ), - callee.expression - ), - callee.name - ); - setTextRange(target, callee); - } else { - thisArg = callee.expression; - target = callee; - } - } else if (isElementAccessExpression(callee)) { - if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { - thisArg = createTempVariable(recordTempVariable); - target = createElementAccessExpression( - setTextRange( - factory2.createAssignment( - thisArg, - callee.expression - ), - callee.expression - ), - callee.argumentExpression - ); - setTextRange(target, callee); - } else { - thisArg = callee.expression; - target = callee; - } - } else { - thisArg = createVoidZero(); - target = parenthesizerRules().parenthesizeLeftSideOfAccess( - expression, - /*optionalChain*/ - false - ); - } - return { target, thisArg }; - } - function createAssignmentTargetWrapper(paramName, expression) { - return createPropertyAccessExpression( - // Explicit parens required because of v8 regression (https://bugs.chromium.org/p/v8/issues/detail?id=9560) - createParenthesizedExpression( - createObjectLiteralExpression([ - createSetAccessorDeclaration( - /*modifiers*/ - void 0, - "value", - [createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - paramName, - /*questionToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - )], - createBlock([ - createExpressionStatement(expression) - ]) - ) - ]) - ), - "value" - ); - } - function inlineExpressions(expressions) { - return expressions.length > 10 ? createCommaListExpression(expressions) : reduceLeft(expressions, factory2.createComma); - } - function getName(node, allowComments, allowSourceMaps, emitFlags = 0, ignoreAssignedName) { - const nodeName = ignoreAssignedName ? node && getNonAssignedNameOfDeclaration(node) : getNameOfDeclaration(node); - if (nodeName && isIdentifier(nodeName) && !isGeneratedIdentifier(nodeName)) { - const name = setParent(setTextRange(cloneNode(nodeName), nodeName), nodeName.parent); - emitFlags |= getEmitFlags(nodeName); - if (!allowSourceMaps) emitFlags |= 96 /* NoSourceMap */; - if (!allowComments) emitFlags |= 3072 /* NoComments */; - if (emitFlags) setEmitFlags(name, emitFlags); - return name; - } - return getGeneratedNameForNode(node); - } - function getInternalName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 32768 /* LocalName */ | 65536 /* InternalName */); - } - function getLocalName(node, allowComments, allowSourceMaps, ignoreAssignedName) { - return getName(node, allowComments, allowSourceMaps, 32768 /* LocalName */, ignoreAssignedName); - } - function getExportName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps, 16384 /* ExportName */); - } - function getDeclarationName(node, allowComments, allowSourceMaps) { - return getName(node, allowComments, allowSourceMaps); - } - function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { - const qualifiedName = createPropertyAccessExpression(ns, nodeIsSynthesized(name) ? name : cloneNode(name)); - setTextRange(qualifiedName, name); - let emitFlags = 0; - if (!allowSourceMaps) emitFlags |= 96 /* NoSourceMap */; - if (!allowComments) emitFlags |= 3072 /* NoComments */; - if (emitFlags) setEmitFlags(qualifiedName, emitFlags); - return qualifiedName; - } - function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { - if (ns && hasSyntacticModifier(node, 32 /* Export */)) { - return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); - } - return getExportName(node, allowComments, allowSourceMaps); - } - function copyPrologue(source, target, ensureUseStrict2, visitor) { - const offset = copyStandardPrologue(source, target, 0, ensureUseStrict2); - return copyCustomPrologue(source, target, offset, visitor); - } - function isUseStrictPrologue2(node) { - return isStringLiteral(node.expression) && node.expression.text === "use strict"; - } - function createUseStrictPrologue() { - return startOnNewLine(createExpressionStatement(createStringLiteral("use strict"))); - } - function copyStandardPrologue(source, target, statementOffset = 0, ensureUseStrict2) { - Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); - let foundUseStrict = false; - const numStatements = source.length; - while (statementOffset < numStatements) { - const statement = source[statementOffset]; - if (isPrologueDirective(statement)) { - if (isUseStrictPrologue2(statement)) { - foundUseStrict = true; - } - target.push(statement); - } else { - break; - } - statementOffset++; - } - if (ensureUseStrict2 && !foundUseStrict) { - target.push(createUseStrictPrologue()); - } - return statementOffset; - } - function copyCustomPrologue(source, target, statementOffset, visitor, filter2 = returnTrue) { - const numStatements = source.length; - while (statementOffset !== void 0 && statementOffset < numStatements) { - const statement = source[statementOffset]; - if (getEmitFlags(statement) & 2097152 /* CustomPrologue */ && filter2(statement)) { - append(target, visitor ? visitNode(statement, visitor, isStatement) : statement); - } else { - break; - } - statementOffset++; - } - return statementOffset; - } - function ensureUseStrict(statements) { - const foundUseStrict = findUseStrictPrologue(statements); - if (!foundUseStrict) { - return setTextRange(createNodeArray([createUseStrictPrologue(), ...statements]), statements); - } - return statements; - } - function liftToBlock(nodes) { - Debug.assert(every(nodes, isStatementOrBlock), "Cannot lift nodes to a Block."); - return singleOrUndefined(nodes) || createBlock(nodes); - } - function findSpanEnd(array, test, start) { - let i = start; - while (i < array.length && test(array[i])) { - i++; - } - return i; - } - function mergeLexicalEnvironment(statements, declarations) { - if (!some(declarations)) { - return statements; - } - const leftStandardPrologueEnd = findSpanEnd(statements, isPrologueDirective, 0); - const leftHoistedFunctionsEnd = findSpanEnd(statements, isHoistedFunction, leftStandardPrologueEnd); - const leftHoistedVariablesEnd = findSpanEnd(statements, isHoistedVariableStatement, leftHoistedFunctionsEnd); - const rightStandardPrologueEnd = findSpanEnd(declarations, isPrologueDirective, 0); - const rightHoistedFunctionsEnd = findSpanEnd(declarations, isHoistedFunction, rightStandardPrologueEnd); - const rightHoistedVariablesEnd = findSpanEnd(declarations, isHoistedVariableStatement, rightHoistedFunctionsEnd); - const rightCustomPrologueEnd = findSpanEnd(declarations, isCustomPrologue, rightHoistedVariablesEnd); - Debug.assert(rightCustomPrologueEnd === declarations.length, "Expected declarations to be valid standard or custom prologues"); - const left = isNodeArray(statements) ? statements.slice() : statements; - if (rightCustomPrologueEnd > rightHoistedVariablesEnd) { - left.splice(leftHoistedVariablesEnd, 0, ...declarations.slice(rightHoistedVariablesEnd, rightCustomPrologueEnd)); - } - if (rightHoistedVariablesEnd > rightHoistedFunctionsEnd) { - left.splice(leftHoistedFunctionsEnd, 0, ...declarations.slice(rightHoistedFunctionsEnd, rightHoistedVariablesEnd)); - } - if (rightHoistedFunctionsEnd > rightStandardPrologueEnd) { - left.splice(leftStandardPrologueEnd, 0, ...declarations.slice(rightStandardPrologueEnd, rightHoistedFunctionsEnd)); - } - if (rightStandardPrologueEnd > 0) { - if (leftStandardPrologueEnd === 0) { - left.splice(0, 0, ...declarations.slice(0, rightStandardPrologueEnd)); - } else { - const leftPrologues = /* @__PURE__ */ new Map(); - for (let i = 0; i < leftStandardPrologueEnd; i++) { - const leftPrologue = statements[i]; - leftPrologues.set(leftPrologue.expression.text, true); - } - for (let i = rightStandardPrologueEnd - 1; i >= 0; i--) { - const rightPrologue = declarations[i]; - if (!leftPrologues.has(rightPrologue.expression.text)) { - left.unshift(rightPrologue); - } - } - } - } - if (isNodeArray(statements)) { - return setTextRange(createNodeArray(left, statements.hasTrailingComma), statements); - } - return statements; - } - 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.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 178 /* GetAccessor */: - return updateGetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.type, node.body); - case 179 /* SetAccessor */: - return updateSetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.body); - case 175 /* MethodDeclaration */: - return updateMethodDeclaration(node, node.modifiers, node.asteriskToken, name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body); - case 174 /* MethodSignature */: - return updateMethodSignature(node, node.modifiers, name, node.questionToken, node.typeParameters, node.parameters, node.type); - case 173 /* PropertyDeclaration */: - return updatePropertyDeclaration2(node, node.modifiers, name, node.questionToken ?? node.exclamationToken, node.type, node.initializer); - case 172 /* PropertySignature */: - return updatePropertySignature(node, node.modifiers, name, node.questionToken, node.type); - case 304 /* PropertyAssignment */: - return updatePropertyAssignment(node, name, node.initializer); - } - } - function asNodeArray(array) { - return array ? createNodeArray(array) : void 0; - } - function asName(name) { - return typeof name === "string" ? createIdentifier(name) : name; - } - function asExpression(value) { - return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value; - } - function asInitializer(node) { - return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node); - } - function asToken(value) { - return typeof value === "number" ? createToken(value) : value; - } - function asEmbeddedStatement(statement) { - return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginal(createEmptyStatement(), statement), statement) : statement; - } - function asVariableDeclaration(variableDeclaration) { - if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) { - return createVariableDeclaration( - variableDeclaration, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ); - } - return variableDeclaration; - } - function update(updated, original) { - if (updated !== original) { - setOriginal(updated, original); - setTextRange(updated, original); - } - return updated; - } -} -function getDefaultTagNameForKind(kind) { - switch (kind) { - case 345 /* JSDocTypeTag */: - return "type"; - case 343 /* JSDocReturnTag */: - return "returns"; - case 344 /* JSDocThisTag */: - return "this"; - case 341 /* JSDocEnumTag */: - return "enum"; - case 331 /* JSDocAuthorTag */: - return "author"; - case 333 /* JSDocClassTag */: - return "class"; - case 334 /* JSDocPublicTag */: - return "public"; - case 335 /* JSDocPrivateTag */: - return "private"; - case 336 /* JSDocProtectedTag */: - return "protected"; - case 337 /* JSDocReadonlyTag */: - return "readonly"; - case 338 /* JSDocOverrideTag */: - return "override"; - case 346 /* JSDocTemplateTag */: - return "template"; - case 347 /* JSDocTypedefTag */: - return "typedef"; - case 342 /* JSDocParameterTag */: - return "param"; - case 349 /* JSDocPropertyTag */: - return "prop"; - case 339 /* JSDocCallbackTag */: - return "callback"; - case 340 /* JSDocOverloadTag */: - return "overload"; - case 329 /* JSDocAugmentsTag */: - return "augments"; - case 330 /* JSDocImplementsTag */: - return "implements"; - case 352 /* JSDocImportTag */: - return "import"; - default: - return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`); - } -} -var rawTextScanner; -var invalidValueSentinel = {}; -function getCookedText(kind, rawText) { - if (!rawTextScanner) { - rawTextScanner = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - false, - 0 /* Standard */ - ); - } - switch (kind) { - case 15 /* NoSubstitutionTemplateLiteral */: - rawTextScanner.setText("`" + rawText + "`"); - break; - case 16 /* TemplateHead */: - rawTextScanner.setText("`" + rawText + "${"); - break; - case 17 /* TemplateMiddle */: - rawTextScanner.setText("}" + rawText + "${"); - break; - case 18 /* TemplateTail */: - rawTextScanner.setText("}" + rawText + "`"); - break; - } - let token = rawTextScanner.scan(); - if (token === 20 /* CloseBraceToken */) { - token = rawTextScanner.reScanTemplateToken( - /*isTaggedTemplate*/ - false - ); - } - if (rawTextScanner.isUnterminated()) { - rawTextScanner.setText(void 0); - return invalidValueSentinel; - } - let tokenValue; - switch (token) { - case 15 /* NoSubstitutionTemplateLiteral */: - case 16 /* TemplateHead */: - case 17 /* TemplateMiddle */: - case 18 /* TemplateTail */: - tokenValue = rawTextScanner.getTokenValue(); - break; - } - if (tokenValue === void 0 || rawTextScanner.scan() !== 1 /* EndOfFileToken */) { - rawTextScanner.setText(void 0); - return invalidValueSentinel; - } - rawTextScanner.setText(void 0); - return tokenValue; -} -function propagateNameFlags(node) { - return node && isIdentifier(node) ? propagateIdentifierNameFlags(node) : propagateChildFlags(node); -} -function propagateIdentifierNameFlags(node) { - return propagateChildFlags(node) & ~67108864 /* ContainsPossibleTopLevelAwait */; -} -function propagatePropertyNameFlagsOfChild(node, transformFlags) { - return transformFlags | node.transformFlags & 134234112 /* PropertyNamePropagatingFlags */; -} -function propagateChildFlags(child) { - if (!child) return 0 /* None */; - const childFlags = child.transformFlags & ~getTransformFlagsSubtreeExclusions(child.kind); - return isNamedDeclaration(child) && isPropertyName(child.name) ? propagatePropertyNameFlagsOfChild(child.name, childFlags) : childFlags; -} -function propagateChildrenFlags(children) { - return children ? children.transformFlags : 0 /* None */; -} -function aggregateChildrenFlags(children) { - let subtreeFlags = 0 /* None */; - for (const child of children) { - subtreeFlags |= propagateChildFlags(child); - } - children.transformFlags = subtreeFlags; -} -function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 183 /* FirstTypeNode */ && kind <= 206 /* LastTypeNode */) { - return -2 /* TypeExcludes */; - } - switch (kind) { - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 210 /* ArrayLiteralExpression */: - return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */; - case 268 /* ModuleDeclaration */: - return -1941676032 /* ModuleExcludes */; - case 170 /* Parameter */: - return -2147483648 /* ParameterExcludes */; - case 220 /* ArrowFunction */: - return -2072174592 /* ArrowFunctionExcludes */; - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - return -1937940480 /* FunctionExcludes */; - case 262 /* VariableDeclarationList */: - return -2146893824 /* VariableDeclarationListExcludes */; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return -2147344384 /* ClassExcludes */; - case 177 /* Constructor */: - return -1937948672 /* ConstructorExcludes */; - case 173 /* PropertyDeclaration */: - return -2013249536 /* PropertyExcludes */; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return -2005057536 /* MethodOrAccessorExcludes */; - case 133 /* AnyKeyword */: - case 150 /* NumberKeyword */: - case 163 /* BigIntKeyword */: - case 146 /* NeverKeyword */: - case 154 /* StringKeyword */: - case 151 /* ObjectKeyword */: - case 136 /* BooleanKeyword */: - case 155 /* SymbolKeyword */: - case 116 /* VoidKeyword */: - case 169 /* TypeParameter */: - case 172 /* PropertySignature */: - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 182 /* IndexSignature */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - return -2 /* TypeExcludes */; - case 211 /* ObjectLiteralExpression */: - return -2147278848 /* ObjectLiteralExcludes */; - case 300 /* CatchClause */: - return -2147418112 /* CatchClauseExcludes */; - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - return -2147450880 /* BindingPatternExcludes */; - case 217 /* TypeAssertionExpression */: - case 239 /* SatisfiesExpression */: - case 235 /* AsExpression */: - case 356 /* PartiallyEmittedExpression */: - case 218 /* ParenthesizedExpression */: - case 108 /* SuperKeyword */: - return -2147483648 /* OuterExpressionExcludes */; - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return -2147483648 /* PropertyAccessExcludes */; - default: - return -2147483648 /* NodeExcludes */; - } -} -var baseFactory = createBaseNodeFactory(); -function makeSynthetic(node) { - node.flags |= 16 /* Synthesized */; - return node; -} -var syntheticFactory = { - createBaseSourceFileNode: (kind) => makeSynthetic(baseFactory.createBaseSourceFileNode(kind)), - createBaseIdentifierNode: (kind) => makeSynthetic(baseFactory.createBaseIdentifierNode(kind)), - createBasePrivateIdentifierNode: (kind) => makeSynthetic(baseFactory.createBasePrivateIdentifierNode(kind)), - createBaseTokenNode: (kind) => makeSynthetic(baseFactory.createBaseTokenNode(kind)), - createBaseNode: (kind) => makeSynthetic(baseFactory.createBaseNode(kind)) -}; -var factory = createNodeFactory(4 /* NoIndentationOnFreshPropertyAccess */, syntheticFactory); -var SourceMapSource2; -function createSourceMapSource(fileName, text, skipTrivia2) { - return new (SourceMapSource2 || (SourceMapSource2 = objectAllocator.getSourceMapSourceConstructor()))(fileName, text, skipTrivia2); -} -function setOriginalNode(node, original) { - if (node.original !== original) { - node.original = original; - if (original) { - const emitNode = original.emitNode; - if (emitNode) node.emitNode = mergeEmitNode(emitNode, node.emitNode); - } - } - return node; -} -function mergeEmitNode(sourceEmitNode, destEmitNode) { - const { - flags, - internalFlags, - leadingComments, - trailingComments, - commentRange, - sourceMapRange, - tokenSourceMapRanges, - constantValue, - helpers, - startsOnNewLine, - snippetElement, - classThis, - assignedName - } = sourceEmitNode; - if (!destEmitNode) destEmitNode = {}; - if (flags) { - destEmitNode.flags = flags; - } - if (internalFlags) { - destEmitNode.internalFlags = internalFlags & ~8 /* Immutable */; - } - 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) { - destEmitNode.sourceMapRange = sourceMapRange; - } - if (tokenSourceMapRanges) { - destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - } - if (constantValue !== void 0) { - destEmitNode.constantValue = constantValue; - } - if (helpers) { - for (const helper of helpers) { - destEmitNode.helpers = appendIfUnique(destEmitNode.helpers, helper); - } - } - if (startsOnNewLine !== void 0) { - destEmitNode.startsOnNewLine = startsOnNewLine; - } - if (snippetElement !== void 0) { - destEmitNode.snippetElement = snippetElement; - } - if (classThis) { - destEmitNode.classThis = classThis; - } - if (assignedName) { - destEmitNode.assignedName = assignedName; - } - return destEmitNode; -} -function mergeTokenSourceMapRanges(sourceRanges, destRanges) { - if (!destRanges) destRanges = []; - for (const key in sourceRanges) { - destRanges[key] = sourceRanges[key]; - } - return destRanges; -} - -// src/compiler/factory/emitNode.ts -function getOrCreateEmitNode(node) { - if (!node.emitNode) { - if (isParseTreeNode(node)) { - if (node.kind === 308 /* SourceFile */) { - return node.emitNode = { annotatedNodes: [node] }; - } - const sourceFile = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node))) ?? Debug.fail("Could not determine parsed source file."); - getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); - } - node.emitNode = {}; - } else { - Debug.assert(!(node.emitNode.internalFlags & 8 /* Immutable */), "Invalid attempt to mutate an immutable node."); - } - return node.emitNode; -} -function disposeEmitNodes(sourceFile) { - var _a, _b; - const annotatedNodes = (_b = (_a = getSourceFileOfNode(getParseTreeNode(sourceFile))) == null ? void 0 : _a.emitNode) == null ? void 0 : _b.annotatedNodes; - if (annotatedNodes) { - for (const node of annotatedNodes) { - node.emitNode = void 0; - } - } -} -function removeAllComments(node) { - const emitNode = getOrCreateEmitNode(node); - emitNode.flags |= 3072 /* NoComments */; - emitNode.leadingComments = void 0; - emitNode.trailingComments = void 0; - return node; -} -function setEmitFlags(node, emitFlags) { - getOrCreateEmitNode(node).flags = emitFlags; - return node; -} -function addEmitFlags(node, emitFlags) { - const emitNode = getOrCreateEmitNode(node); - emitNode.flags = emitNode.flags | emitFlags; - return node; -} -function setInternalEmitFlags(node, emitFlags) { - getOrCreateEmitNode(node).internalFlags = emitFlags; - return node; -} -function addInternalEmitFlags(node, emitFlags) { - const emitNode = getOrCreateEmitNode(node); - emitNode.internalFlags = emitNode.internalFlags | emitFlags; - return node; -} -function getSourceMapRange(node) { - var _a; - return ((_a = node.emitNode) == null ? void 0 : _a.sourceMapRange) ?? node; -} -function setSourceMapRange(node, range) { - getOrCreateEmitNode(node).sourceMapRange = range; - return node; -} -function getTokenSourceMapRange(node, token) { - var _a, _b; - return (_b = (_a = node.emitNode) == null ? void 0 : _a.tokenSourceMapRanges) == null ? void 0 : _b[token]; -} -function setTokenSourceMapRange(node, token, range) { - const emitNode = getOrCreateEmitNode(node); - const tokenSourceMapRanges = emitNode.tokenSourceMapRanges ?? (emitNode.tokenSourceMapRanges = []); - tokenSourceMapRanges[token] = range; - return node; -} -function getStartsOnNewLine(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.startsOnNewLine; -} -function setStartsOnNewLine(node, newLine) { - getOrCreateEmitNode(node).startsOnNewLine = newLine; - return node; -} -function getCommentRange(node) { - var _a; - return ((_a = node.emitNode) == null ? void 0 : _a.commentRange) ?? node; -} -function setCommentRange(node, range) { - getOrCreateEmitNode(node).commentRange = range; - return node; -} -function getSyntheticLeadingComments(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.leadingComments; -} -function setSyntheticLeadingComments(node, comments) { - getOrCreateEmitNode(node).leadingComments = comments; - return node; -} -function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { - return setSyntheticLeadingComments(node, append(getSyntheticLeadingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); -} -function getSyntheticTrailingComments(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.trailingComments; -} -function setSyntheticTrailingComments(node, comments) { - getOrCreateEmitNode(node).trailingComments = comments; - return node; -} -function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { - return setSyntheticTrailingComments(node, append(getSyntheticTrailingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); -} -function moveSyntheticComments(node, original) { - setSyntheticLeadingComments(node, getSyntheticLeadingComments(original)); - setSyntheticTrailingComments(node, getSyntheticTrailingComments(original)); - const emit = getOrCreateEmitNode(original); - emit.leadingComments = void 0; - emit.trailingComments = void 0; - return node; -} -function getConstantValue(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.constantValue; -} -function setConstantValue(node, value) { - const emitNode = getOrCreateEmitNode(node); - emitNode.constantValue = value; - return node; -} -function addEmitHelper(node, helper) { - const emitNode = getOrCreateEmitNode(node); - emitNode.helpers = append(emitNode.helpers, helper); - return node; -} -function addEmitHelpers(node, helpers) { - if (some(helpers)) { - const emitNode = getOrCreateEmitNode(node); - for (const helper of helpers) { - emitNode.helpers = appendIfUnique(emitNode.helpers, helper); - } - } - return node; -} -function removeEmitHelper(node, helper) { - var _a; - const helpers = (_a = node.emitNode) == null ? void 0 : _a.helpers; - if (helpers) { - return orderedRemoveItem(helpers, helper); - } - return false; -} -function getEmitHelpers(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.helpers; -} -function moveEmitHelpers(source, target, predicate) { - const sourceEmitNode = source.emitNode; - const sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers; - if (!some(sourceEmitHelpers)) return; - const targetEmitNode = getOrCreateEmitNode(target); - let helpersRemoved = 0; - for (let i = 0; i < sourceEmitHelpers.length; i++) { - const helper = sourceEmitHelpers[i]; - if (predicate(helper)) { - helpersRemoved++; - targetEmitNode.helpers = appendIfUnique(targetEmitNode.helpers, helper); - } else if (helpersRemoved > 0) { - sourceEmitHelpers[i - helpersRemoved] = helper; - } - } - if (helpersRemoved > 0) { - sourceEmitHelpers.length -= helpersRemoved; - } -} -function getSnippetElement(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.snippetElement; -} -function setSnippetElement(node, snippet) { - const emitNode = getOrCreateEmitNode(node); - emitNode.snippetElement = snippet; - return node; -} -function ignoreSourceNewlines(node) { - getOrCreateEmitNode(node).internalFlags |= 4 /* IgnoreSourceNewlines */; - return node; -} -function setTypeNode(node, type) { - const emitNode = getOrCreateEmitNode(node); - emitNode.typeNode = type; - return node; -} -function getTypeNode(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.typeNode; -} -function setIdentifierTypeArguments(node, typeArguments) { - getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; - return node; -} -function getIdentifierTypeArguments(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.identifierTypeArguments; -} -function setIdentifierAutoGenerate(node, autoGenerate) { - getOrCreateEmitNode(node).autoGenerate = autoGenerate; - return node; -} -function getIdentifierAutoGenerate(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.autoGenerate; -} -function setIdentifierGeneratedImportReference(node, value) { - getOrCreateEmitNode(node).generatedImportReference = value; - return node; -} -function getIdentifierGeneratedImportReference(node) { - var _a; - return (_a = node.emitNode) == null ? void 0 : _a.generatedImportReference; -} - -// src/compiler/factory/emitHelpers.ts -var PrivateIdentifierKind = /* @__PURE__ */ ((PrivateIdentifierKind2) => { - PrivateIdentifierKind2["Field"] = "f"; - PrivateIdentifierKind2["Method"] = "m"; - PrivateIdentifierKind2["Accessor"] = "a"; - return PrivateIdentifierKind2; -})(PrivateIdentifierKind || {}); -function createEmitHelperFactory(context) { - const factory2 = context.factory; - const immutableTrue = memoize(() => setInternalEmitFlags(factory2.createTrue(), 8 /* Immutable */)); - const immutableFalse = memoize(() => setInternalEmitFlags(factory2.createFalse(), 8 /* Immutable */)); - return { - getUnscopedHelperName, - // TypeScript Helpers - createDecorateHelper, - createMetadataHelper, - createParamHelper, - // ES Decorators Helpers - createESDecorateHelper, - createRunInitializersHelper, - // ES2018 Helpers - createAssignHelper, - createAwaitHelper, - createAsyncGeneratorHelper, - createAsyncDelegatorHelper, - createAsyncValuesHelper, - // ES2018 Destructuring Helpers - createRestHelper, - // ES2017 Helpers - createAwaiterHelper, - // ES2015 Helpers - createExtendsHelper, - createTemplateObjectHelper, - createSpreadArrayHelper, - createPropKeyHelper, - createSetFunctionNameHelper, - // ES2015 Destructuring Helpers - createValuesHelper, - createReadHelper, - // ES2015 Generator Helpers - createGeneratorHelper, - // ES Module Helpers - createImportStarHelper, - createImportStarCallbackHelper, - createImportDefaultHelper, - createExportStarHelper, - // Class Fields Helpers - createClassPrivateFieldGetHelper, - createClassPrivateFieldSetHelper, - createClassPrivateFieldInHelper, - // 'using' helpers - createAddDisposableResourceHelper, - createDisposeResourcesHelper, - // --rewriteRelativeImportExtensions helpers - createRewriteRelativeImportExtensionsHelper - }; - function getUnscopedHelperName(name) { - return setEmitFlags(factory2.createIdentifier(name), 8192 /* HelperName */ | 4 /* AdviseOnEmitNode */); - } - function createDecorateHelper(decoratorExpressions, target, memberName, descriptor) { - context.requestEmitHelper(decorateHelper); - const argumentsArray = []; - argumentsArray.push(factory2.createArrayLiteralExpression( - decoratorExpressions, - /*multiLine*/ - true - )); - argumentsArray.push(target); - if (memberName) { - argumentsArray.push(memberName); - if (descriptor) { - argumentsArray.push(descriptor); - } - } - return factory2.createCallExpression( - getUnscopedHelperName("__decorate"), - /*typeArguments*/ - void 0, - argumentsArray - ); - } - function createMetadataHelper(metadataKey, metadataValue) { - context.requestEmitHelper(metadataHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__metadata"), - /*typeArguments*/ - void 0, - [ - factory2.createStringLiteral(metadataKey), - metadataValue - ] - ); - } - function createParamHelper(expression, parameterOffset, location) { - context.requestEmitHelper(paramHelper); - return setTextRange( - factory2.createCallExpression( - getUnscopedHelperName("__param"), - /*typeArguments*/ - void 0, - [ - factory2.createNumericLiteral(parameterOffset + ""), - expression - ] - ), - location - ); - } - function createESDecorateClassContextObject(contextIn) { - const properties = [ - factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral("class")), - 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); - return factory2.createPropertyAssignment( - "get", - factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - factory2.createIdentifier("obj") - )], - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - accessor - ) - ); - } - function createESDecorateClassElementAccessSetMethod(elementName) { - const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); - return factory2.createPropertyAssignment( - "set", - factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - [ - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - factory2.createIdentifier("obj") - ), - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - factory2.createIdentifier("value") - ) - ], - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createAssignment( - accessor, - factory2.createIdentifier("value") - ) - ) - ]) - ) - ); - } - function createESDecorateClassElementAccessHasMethod(elementName) { - const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name; - return factory2.createPropertyAssignment( - "has", - factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - factory2.createIdentifier("obj") - )], - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - factory2.createBinaryExpression( - propertyName, - 103 /* InKeyword */, - factory2.createIdentifier("obj") - ) - ) - ); - } - function createESDecorateClassElementAccessObject(name, access) { - const properties = []; - properties.push(createESDecorateClassElementAccessHasMethod(name)); - if (access.get) properties.push(createESDecorateClassElementAccessGetMethod(name)); - if (access.set) properties.push(createESDecorateClassElementAccessSetMethod(name)); - return factory2.createObjectLiteralExpression(properties); - } - function createESDecorateClassElementContextObject(contextIn) { - 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("metadata"), contextIn.metadata) - ]; - return factory2.createObjectLiteralExpression(properties); - } - function createESDecorateContextObject(contextIn) { - return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn); - } - function createESDecorateHelper(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - context.requestEmitHelper(esDecorateHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__esDecorate"), - /*typeArguments*/ - void 0, - [ - ctor ?? factory2.createNull(), - descriptorIn ?? factory2.createNull(), - decorators, - createESDecorateContextObject(contextIn), - initializers, - extraInitializers - ] - ); - } - function createRunInitializersHelper(thisArg, initializers, value) { - context.requestEmitHelper(runInitializersHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__runInitializers"), - /*typeArguments*/ - void 0, - value ? [thisArg, initializers, value] : [thisArg, initializers] - ); - } - function createAssignHelper(attributesSegments) { - if (getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { - return factory2.createCallExpression( - factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "assign"), - /*typeArguments*/ - void 0, - attributesSegments - ); - } - context.requestEmitHelper(assignHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__assign"), - /*typeArguments*/ - void 0, - attributesSegments - ); - } - function createAwaitHelper(expression) { - context.requestEmitHelper(awaitHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__await"), - /*typeArguments*/ - void 0, - [expression] - ); - } - function createAsyncGeneratorHelper(generatorFunc, hasLexicalThis) { - context.requestEmitHelper(awaitHelper); - context.requestEmitHelper(asyncGeneratorHelper); - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 524288 /* AsyncFunctionBody */ | 1048576 /* ReuseTempVariableScope */; - return factory2.createCallExpression( - getUnscopedHelperName("__asyncGenerator"), - /*typeArguments*/ - void 0, - [ - hasLexicalThis ? factory2.createThis() : factory2.createVoidZero(), - factory2.createIdentifier("arguments"), - generatorFunc - ] - ); - } - function createAsyncDelegatorHelper(expression) { - context.requestEmitHelper(awaitHelper); - context.requestEmitHelper(asyncDelegator); - return factory2.createCallExpression( - getUnscopedHelperName("__asyncDelegator"), - /*typeArguments*/ - void 0, - [expression] - ); - } - function createAsyncValuesHelper(expression) { - context.requestEmitHelper(asyncValues); - return factory2.createCallExpression( - getUnscopedHelperName("__asyncValues"), - /*typeArguments*/ - void 0, - [expression] - ); - } - function createRestHelper(value, elements, computedTempVariables, location) { - context.requestEmitHelper(restHelper); - const propertyNames = []; - let computedTempVariableOffset = 0; - for (let i = 0; i < elements.length - 1; i++) { - const propertyName = getPropertyNameOfBindingOrAssignmentElement(elements[i]); - if (propertyName) { - if (isComputedPropertyName(propertyName)) { - Debug.assertIsDefined(computedTempVariables, "Encountered computed property name but 'computedTempVariables' argument was not provided."); - const temp = computedTempVariables[computedTempVariableOffset]; - computedTempVariableOffset++; - propertyNames.push( - factory2.createConditionalExpression( - factory2.createTypeCheck(temp, "symbol"), - /*questionToken*/ - void 0, - temp, - /*colonToken*/ - void 0, - factory2.createAdd(temp, factory2.createStringLiteral("")) - ) - ); - } else { - propertyNames.push(factory2.createStringLiteralFromNode(propertyName)); - } - } - } - return factory2.createCallExpression( - getUnscopedHelperName("__rest"), - /*typeArguments*/ - void 0, - [ - value, - setTextRange( - factory2.createArrayLiteralExpression(propertyNames), - location - ) - ] - ); - } - function createAwaiterHelper(hasLexicalThis, argumentsExpression, promiseConstructor, parameters, body) { - context.requestEmitHelper(awaiterHelper); - const generatorFunc = factory2.createFunctionExpression( - /*modifiers*/ - void 0, - factory2.createToken(42 /* AsteriskToken */), - /*name*/ - void 0, - /*typeParameters*/ - void 0, - parameters ?? [], - /*type*/ - void 0, - body - ); - (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 524288 /* AsyncFunctionBody */ | 1048576 /* ReuseTempVariableScope */; - return factory2.createCallExpression( - getUnscopedHelperName("__awaiter"), - /*typeArguments*/ - void 0, - [ - hasLexicalThis ? factory2.createThis() : factory2.createVoidZero(), - argumentsExpression ?? factory2.createVoidZero(), - promiseConstructor ? createExpressionFromEntityName(factory2, promiseConstructor) : factory2.createVoidZero(), - generatorFunc - ] - ); - } - function createExtendsHelper(name) { - context.requestEmitHelper(extendsHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__extends"), - /*typeArguments*/ - void 0, - [name, factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */)] - ); - } - function createTemplateObjectHelper(cooked, raw) { - context.requestEmitHelper(templateObjectHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__makeTemplateObject"), - /*typeArguments*/ - void 0, - [cooked, raw] - ); - } - function createSpreadArrayHelper(to, from, packFrom) { - context.requestEmitHelper(spreadArrayHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__spreadArray"), - /*typeArguments*/ - void 0, - [to, from, packFrom ? immutableTrue() : immutableFalse()] - ); - } - function createPropKeyHelper(expr) { - context.requestEmitHelper(propKeyHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__propKey"), - /*typeArguments*/ - void 0, - [expr] - ); - } - function createSetFunctionNameHelper(f, name, prefix) { - context.requestEmitHelper(setFunctionNameHelper); - return context.factory.createCallExpression( - getUnscopedHelperName("__setFunctionName"), - /*typeArguments*/ - void 0, - prefix ? [f, name, context.factory.createStringLiteral(prefix)] : [f, name] - ); - } - function createValuesHelper(expression) { - context.requestEmitHelper(valuesHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__values"), - /*typeArguments*/ - void 0, - [expression] - ); - } - function createReadHelper(iteratorRecord, count) { - context.requestEmitHelper(readHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__read"), - /*typeArguments*/ - void 0, - count !== void 0 ? [iteratorRecord, factory2.createNumericLiteral(count + "")] : [iteratorRecord] - ); - } - function createGeneratorHelper(body) { - context.requestEmitHelper(generatorHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__generator"), - /*typeArguments*/ - void 0, - [factory2.createThis(), body] - ); - } - function createImportStarHelper(expression) { - context.requestEmitHelper(importStarHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__importStar"), - /*typeArguments*/ - void 0, - [expression] - ); - } - function createImportStarCallbackHelper() { - context.requestEmitHelper(importStarHelper); - return getUnscopedHelperName("__importStar"); - } - function createImportDefaultHelper(expression) { - context.requestEmitHelper(importDefaultHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__importDefault"), - /*typeArguments*/ - void 0, - [expression] - ); - } - function createExportStarHelper(moduleExpression, exportsExpression = factory2.createIdentifier("exports")) { - context.requestEmitHelper(exportStarHelper); - context.requestEmitHelper(createBindingHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__exportStar"), - /*typeArguments*/ - void 0, - [moduleExpression, exportsExpression] - ); - } - function createClassPrivateFieldGetHelper(receiver, state, kind, f) { - context.requestEmitHelper(classPrivateFieldGetHelper); - let args; - if (!f) { - args = [receiver, state, factory2.createStringLiteral(kind)]; - } else { - args = [receiver, state, factory2.createStringLiteral(kind), f]; - } - return factory2.createCallExpression( - getUnscopedHelperName("__classPrivateFieldGet"), - /*typeArguments*/ - void 0, - args - ); - } - function createClassPrivateFieldSetHelper(receiver, state, value, kind, f) { - context.requestEmitHelper(classPrivateFieldSetHelper); - let args; - if (!f) { - args = [receiver, state, value, factory2.createStringLiteral(kind)]; - } else { - args = [receiver, state, value, factory2.createStringLiteral(kind), f]; - } - return factory2.createCallExpression( - getUnscopedHelperName("__classPrivateFieldSet"), - /*typeArguments*/ - void 0, - args - ); - } - function createClassPrivateFieldInHelper(state, receiver) { - context.requestEmitHelper(classPrivateFieldInHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__classPrivateFieldIn"), - /*typeArguments*/ - void 0, - [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 createRewriteRelativeImportExtensionsHelper(expression) { - context.requestEmitHelper(rewriteRelativeImportExtensionsHelper); - return factory2.createCallExpression( - getUnscopedHelperName("__rewriteRelativeImportExtension"), - /*typeArguments*/ - void 0, - context.getCompilerOptions().jsx === 1 /* Preserve */ ? [expression, factory2.createTrue()] : [expression] - ); - } -} -function compareEmitHelpers(x, y) { - if (x === y) return 0 /* EqualTo */; - if (x.priority === y.priority) return 0 /* EqualTo */; - if (x.priority === void 0) return 1 /* GreaterThan */; - if (y.priority === void 0) return -1 /* LessThan */; - return compareValues(x.priority, y.priority); -} -function helperString(input, ...args) { - return (uniqueName) => { - let result = ""; - for (let i = 0; i < args.length; i++) { - result += input[i]; - result += uniqueName(args[i]); - } - result += input[input.length - 1]; - return result; - }; -} -var decorateHelper = { - name: "typescript:decorate", - importName: "__decorate", - scoped: false, - priority: 2, - text: ` - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - };` -}; -var metadataHelper = { - name: "typescript:metadata", - importName: "__metadata", - scoped: false, - priority: 3, - text: ` - var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); - };` -}; -var paramHelper = { - name: "typescript:param", - importName: "__param", - scoped: false, - priority: 4, - text: ` - var __param = (this && this.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - };` -}; -var esDecorateHelper = { - name: "typescript:esDecorate", - importName: "__esDecorate", - scoped: false, - priority: 2, - text: ` - var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - };` -}; -var runInitializersHelper = { - name: "typescript:runInitializers", - importName: "__runInitializers", - scoped: false, - priority: 2, - text: ` - var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - };` -}; -var assignHelper = { - name: "typescript:assign", - importName: "__assign", - scoped: false, - priority: 1, - text: ` - var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - };` -}; -var awaitHelper = { - name: "typescript:await", - importName: "__await", - scoped: false, - text: ` - var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }` -}; -var asyncGeneratorHelper = { - name: "typescript:asyncGenerator", - importName: "__asyncGenerator", - 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 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), 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]); } - };` -}; -var asyncDelegator = { - name: "typescript:asyncDelegator", - importName: "__asyncDelegator", - scoped: false, - dependencies: [awaitHelper], - text: ` - var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - };` -}; -var asyncValues = { - name: "typescript:asyncValues", - importName: "__asyncValues", - scoped: false, - text: ` - var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - };` -}; -var restHelper = { - name: "typescript:rest", - importName: "__rest", - scoped: false, - text: ` - var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - };` -}; -var awaiterHelper = { - name: "typescript:awaiter", - importName: "__awaiter", - scoped: false, - priority: 5, - text: ` - var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - };` -}; -var extendsHelper = { - name: "typescript:extends", - importName: "__extends", - scoped: false, - priority: 0, - text: ` - var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })();` -}; -var templateObjectHelper = { - name: "typescript:makeTemplateObject", - importName: "__makeTemplateObject", - scoped: false, - priority: 0, - text: ` - var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - };` -}; -var readHelper = { - name: "typescript:read", - importName: "__read", - scoped: false, - text: ` - var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - };` -}; -var spreadArrayHelper = { - name: "typescript:spreadArray", - importName: "__spreadArray", - scoped: false, - text: ` - var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - };` -}; -var propKeyHelper = { - name: "typescript:propKey", - importName: "__propKey", - scoped: false, - text: ` - var __propKey = (this && this.__propKey) || function (x) { - return typeof x === "symbol" ? x : "".concat(x); - };` -}; -var setFunctionNameHelper = { - name: "typescript:setFunctionName", - importName: "__setFunctionName", - scoped: false, - text: ` - var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - };` -}; -var valuesHelper = { - name: "typescript:values", - importName: "__values", - scoped: false, - text: ` - var __values = (this && this.__values) || function(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - };` -}; -var generatorHelper = { - name: "typescript:generator", - importName: "__generator", - scoped: false, - priority: 6, - text: ` - var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - };` -}; -var createBindingHelper = { - name: "typescript:commonjscreatebinding", - importName: "__createBinding", - scoped: false, - priority: 1, - text: ` - var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }));` -}; -var setModuleDefaultHelper = { - name: "typescript:commonjscreatevalue", - importName: "__setModuleDefault", - scoped: false, - priority: 1, - text: ` - var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - });` -}; -var importStarHelper = { - name: "typescript:commonjsimportstar", - importName: "__importStar", - scoped: false, - dependencies: [createBindingHelper, setModuleDefaultHelper], - priority: 2, - text: ` - var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; - })();` -}; -var importDefaultHelper = { - name: "typescript:commonjsimportdefault", - importName: "__importDefault", - scoped: false, - text: ` - var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - };` -}; -var exportStarHelper = { - name: "typescript:export-star", - importName: "__exportStar", - scoped: false, - dependencies: [createBindingHelper], - priority: 2, - text: ` - var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); - };` -}; -var classPrivateFieldGetHelper = { - name: "typescript:classPrivateFieldGet", - importName: "__classPrivateFieldGet", - scoped: false, - text: ` - var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - };` -}; -var classPrivateFieldSetHelper = { - name: "typescript:classPrivateFieldSet", - importName: "__classPrivateFieldSet", - scoped: false, - text: ` - var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - };` -}; -var classPrivateFieldInHelper = { - name: "typescript:classPrivateFieldIn", - importName: "__classPrivateFieldIn", - scoped: false, - text: ` - var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - };` -}; -var 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, inner; - 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 (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - };` -}; -var 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; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - 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; - });` -}; -var rewriteRelativeImportExtensionsHelper = { - name: "typescript:rewriteRelativeImportExtensions", - importName: "__rewriteRelativeImportExtension", - scoped: false, - text: ` - var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) { - if (typeof path === "string" && /^\\.\\.?\\//.test(path)) { - return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); - }); - } - return path; - };` -}; -var asyncSuperHelper = { - name: "typescript:async-super", - scoped: true, - text: helperString` - const ${"_superIndex"} = name => super[name];` -}; -var advancedAsyncSuperHelper = { - name: "typescript:advanced-async-super", - scoped: true, - text: helperString` - const ${"_superIndex"} = (function (geti, seti) { - const cache = Object.create(null); - return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); - })(name => super[name], (name, value) => super[name] = value);` -}; -function isCallToHelper(firstSegment, helperName) { - return isCallExpression(firstSegment) && isIdentifier(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192 /* HelperName */) !== 0 && firstSegment.expression.escapedText === helperName; -} - -// src/compiler/factory/nodeTests.ts -function isNumericLiteral(node) { - return node.kind === 9 /* NumericLiteral */; -} -function isBigIntLiteral(node) { - return node.kind === 10 /* BigIntLiteral */; -} -function isStringLiteral(node) { - return node.kind === 11 /* StringLiteral */; -} -function isJsxText(node) { - return node.kind === 12 /* JsxText */; -} -function isRegularExpressionLiteral(node) { - return node.kind === 14 /* RegularExpressionLiteral */; -} -function isNoSubstitutionTemplateLiteral(node) { - return node.kind === 15 /* NoSubstitutionTemplateLiteral */; -} -function isTemplateHead(node) { - return node.kind === 16 /* TemplateHead */; -} -function isTemplateMiddle(node) { - return node.kind === 17 /* TemplateMiddle */; -} -function isTemplateTail(node) { - return node.kind === 18 /* TemplateTail */; -} -function isDotDotDotToken(node) { - return node.kind === 26 /* DotDotDotToken */; -} -function isCommaToken(node) { - return node.kind === 28 /* CommaToken */; -} -function isPlusToken(node) { - return node.kind === 40 /* PlusToken */; -} -function isMinusToken(node) { - return node.kind === 41 /* MinusToken */; -} -function isAsteriskToken(node) { - return node.kind === 42 /* AsteriskToken */; -} -function isExclamationToken(node) { - return node.kind === 54 /* ExclamationToken */; -} -function isQuestionToken(node) { - return node.kind === 58 /* QuestionToken */; -} -function isColonToken(node) { - return node.kind === 59 /* ColonToken */; -} -function isQuestionDotToken(node) { - return node.kind === 29 /* QuestionDotToken */; -} -function isEqualsGreaterThanToken(node) { - return node.kind === 39 /* EqualsGreaterThanToken */; -} -function isIdentifier(node) { - return node.kind === 80 /* Identifier */; -} -function isPrivateIdentifier(node) { - return node.kind === 81 /* PrivateIdentifier */; -} -function isExportModifier(node) { - return node.kind === 95 /* ExportKeyword */; -} -function isDefaultModifier(node) { - return node.kind === 90 /* DefaultKeyword */; -} -function isAsyncModifier(node) { - return node.kind === 134 /* AsyncKeyword */; -} -function isAssertsKeyword(node) { - return node.kind === 131 /* AssertsKeyword */; -} -function isAwaitKeyword(node) { - return node.kind === 135 /* AwaitKeyword */; -} -function isReadonlyKeyword(node) { - return node.kind === 148 /* ReadonlyKeyword */; -} -function isStaticModifier(node) { - return node.kind === 126 /* StaticKeyword */; -} -function isAbstractModifier(node) { - return node.kind === 128 /* AbstractKeyword */; -} -function isOverrideModifier(node) { - return node.kind === 164 /* OverrideKeyword */; -} -function isAccessorModifier(node) { - return node.kind === 129 /* AccessorKeyword */; -} -function isSuperKeyword(node) { - return node.kind === 108 /* SuperKeyword */; -} -function isImportKeyword(node) { - return node.kind === 102 /* ImportKeyword */; -} -function isCaseKeyword(node) { - return node.kind === 84 /* CaseKeyword */; -} -function isQualifiedName(node) { - return node.kind === 167 /* QualifiedName */; -} -function isComputedPropertyName(node) { - return node.kind === 168 /* ComputedPropertyName */; -} -function isTypeParameterDeclaration(node) { - return node.kind === 169 /* TypeParameter */; -} -function isParameter(node) { - return node.kind === 170 /* Parameter */; -} -function isDecorator(node) { - return node.kind === 171 /* Decorator */; -} -function isPropertySignature(node) { - return node.kind === 172 /* PropertySignature */; -} -function isPropertyDeclaration(node) { - return node.kind === 173 /* PropertyDeclaration */; -} -function isMethodSignature(node) { - return node.kind === 174 /* MethodSignature */; -} -function isMethodDeclaration(node) { - return node.kind === 175 /* MethodDeclaration */; -} -function isClassStaticBlockDeclaration(node) { - return node.kind === 176 /* ClassStaticBlockDeclaration */; -} -function isConstructorDeclaration(node) { - return node.kind === 177 /* Constructor */; -} -function isGetAccessorDeclaration(node) { - return node.kind === 178 /* GetAccessor */; -} -function isSetAccessorDeclaration(node) { - return node.kind === 179 /* SetAccessor */; -} -function isCallSignatureDeclaration(node) { - return node.kind === 180 /* CallSignature */; -} -function isConstructSignatureDeclaration(node) { - return node.kind === 181 /* ConstructSignature */; -} -function isIndexSignatureDeclaration(node) { - return node.kind === 182 /* IndexSignature */; -} -function isTypePredicateNode(node) { - return node.kind === 183 /* TypePredicate */; -} -function isTypeReferenceNode(node) { - return node.kind === 184 /* TypeReference */; -} -function isFunctionTypeNode(node) { - return node.kind === 185 /* FunctionType */; -} -function isConstructorTypeNode(node) { - return node.kind === 186 /* ConstructorType */; -} -function isTypeQueryNode(node) { - return node.kind === 187 /* TypeQuery */; -} -function isTypeLiteralNode(node) { - return node.kind === 188 /* TypeLiteral */; -} -function isArrayTypeNode(node) { - return node.kind === 189 /* ArrayType */; -} -function isTupleTypeNode(node) { - return node.kind === 190 /* TupleType */; -} -function isNamedTupleMember(node) { - return node.kind === 203 /* NamedTupleMember */; -} -function isOptionalTypeNode(node) { - return node.kind === 191 /* OptionalType */; -} -function isRestTypeNode(node) { - return node.kind === 192 /* RestType */; -} -function isUnionTypeNode(node) { - return node.kind === 193 /* UnionType */; -} -function isIntersectionTypeNode(node) { - return node.kind === 194 /* IntersectionType */; -} -function isConditionalTypeNode(node) { - return node.kind === 195 /* ConditionalType */; -} -function isInferTypeNode(node) { - return node.kind === 196 /* InferType */; -} -function isParenthesizedTypeNode(node) { - return node.kind === 197 /* ParenthesizedType */; -} -function isThisTypeNode(node) { - return node.kind === 198 /* ThisType */; -} -function isTypeOperatorNode(node) { - return node.kind === 199 /* TypeOperator */; -} -function isIndexedAccessTypeNode(node) { - return node.kind === 200 /* IndexedAccessType */; -} -function isMappedTypeNode(node) { - return node.kind === 201 /* MappedType */; -} -function isLiteralTypeNode(node) { - return node.kind === 202 /* LiteralType */; -} -function isImportTypeNode(node) { - return node.kind === 206 /* ImportType */; -} -function isTemplateLiteralTypeSpan(node) { - return node.kind === 205 /* TemplateLiteralTypeSpan */; -} -function isTemplateLiteralTypeNode(node) { - return node.kind === 204 /* TemplateLiteralType */; -} -function isObjectBindingPattern(node) { - return node.kind === 207 /* ObjectBindingPattern */; -} -function isArrayBindingPattern(node) { - return node.kind === 208 /* ArrayBindingPattern */; -} -function isBindingElement(node) { - return node.kind === 209 /* BindingElement */; -} -function isArrayLiteralExpression(node) { - return node.kind === 210 /* ArrayLiteralExpression */; -} -function isObjectLiteralExpression(node) { - return node.kind === 211 /* ObjectLiteralExpression */; -} -function isPropertyAccessExpression(node) { - return node.kind === 212 /* PropertyAccessExpression */; -} -function isElementAccessExpression(node) { - return node.kind === 213 /* ElementAccessExpression */; -} -function isCallExpression(node) { - return node.kind === 214 /* CallExpression */; -} -function isNewExpression(node) { - return node.kind === 215 /* NewExpression */; -} -function isTaggedTemplateExpression(node) { - return node.kind === 216 /* TaggedTemplateExpression */; -} -function isTypeAssertionExpression(node) { - return node.kind === 217 /* TypeAssertionExpression */; -} -function isParenthesizedExpression(node) { - return node.kind === 218 /* ParenthesizedExpression */; -} -function isFunctionExpression(node) { - return node.kind === 219 /* FunctionExpression */; -} -function isArrowFunction(node) { - return node.kind === 220 /* ArrowFunction */; -} -function isDeleteExpression(node) { - return node.kind === 221 /* DeleteExpression */; -} -function isTypeOfExpression(node) { - return node.kind === 222 /* TypeOfExpression */; -} -function isVoidExpression(node) { - return node.kind === 223 /* VoidExpression */; -} -function isAwaitExpression(node) { - return node.kind === 224 /* AwaitExpression */; -} -function isPrefixUnaryExpression(node) { - return node.kind === 225 /* PrefixUnaryExpression */; -} -function isPostfixUnaryExpression(node) { - return node.kind === 226 /* PostfixUnaryExpression */; -} -function isBinaryExpression(node) { - return node.kind === 227 /* BinaryExpression */; -} -function isConditionalExpression(node) { - return node.kind === 228 /* ConditionalExpression */; -} -function isTemplateExpression(node) { - return node.kind === 229 /* TemplateExpression */; -} -function isYieldExpression(node) { - return node.kind === 230 /* YieldExpression */; -} -function isSpreadElement(node) { - return node.kind === 231 /* SpreadElement */; -} -function isClassExpression(node) { - return node.kind === 232 /* ClassExpression */; -} -function isOmittedExpression(node) { - return node.kind === 233 /* OmittedExpression */; -} -function isExpressionWithTypeArguments(node) { - return node.kind === 234 /* ExpressionWithTypeArguments */; -} -function isAsExpression(node) { - return node.kind === 235 /* AsExpression */; -} -function isSatisfiesExpression(node) { - return node.kind === 239 /* SatisfiesExpression */; -} -function isNonNullExpression(node) { - return node.kind === 236 /* NonNullExpression */; -} -function isMetaProperty(node) { - return node.kind === 237 /* MetaProperty */; -} -function isSyntheticExpression(node) { - return node.kind === 238 /* SyntheticExpression */; -} -function isPartiallyEmittedExpression(node) { - return node.kind === 356 /* PartiallyEmittedExpression */; -} -function isCommaListExpression(node) { - return node.kind === 357 /* CommaListExpression */; -} -function isTemplateSpan(node) { - return node.kind === 240 /* TemplateSpan */; -} -function isSemicolonClassElement(node) { - return node.kind === 241 /* SemicolonClassElement */; -} -function isBlock(node) { - return node.kind === 242 /* Block */; -} -function isVariableStatement(node) { - return node.kind === 244 /* VariableStatement */; -} -function isEmptyStatement(node) { - return node.kind === 243 /* EmptyStatement */; -} -function isExpressionStatement(node) { - return node.kind === 245 /* ExpressionStatement */; -} -function isIfStatement(node) { - return node.kind === 246 /* IfStatement */; -} -function isDoStatement(node) { - return node.kind === 247 /* DoStatement */; -} -function isWhileStatement(node) { - return node.kind === 248 /* WhileStatement */; -} -function isForStatement(node) { - return node.kind === 249 /* ForStatement */; -} -function isForInStatement(node) { - return node.kind === 250 /* ForInStatement */; -} -function isForOfStatement(node) { - return node.kind === 251 /* ForOfStatement */; -} -function isContinueStatement(node) { - return node.kind === 252 /* ContinueStatement */; -} -function isBreakStatement(node) { - return node.kind === 253 /* BreakStatement */; -} -function isReturnStatement(node) { - return node.kind === 254 /* ReturnStatement */; -} -function isWithStatement(node) { - return node.kind === 255 /* WithStatement */; -} -function isSwitchStatement(node) { - return node.kind === 256 /* SwitchStatement */; -} -function isLabeledStatement(node) { - return node.kind === 257 /* LabeledStatement */; -} -function isThrowStatement(node) { - return node.kind === 258 /* ThrowStatement */; -} -function isTryStatement(node) { - return node.kind === 259 /* TryStatement */; -} -function isDebuggerStatement(node) { - return node.kind === 260 /* DebuggerStatement */; -} -function isVariableDeclaration(node) { - return node.kind === 261 /* VariableDeclaration */; -} -function isVariableDeclarationList(node) { - return node.kind === 262 /* VariableDeclarationList */; -} -function isFunctionDeclaration(node) { - return node.kind === 263 /* FunctionDeclaration */; -} -function isClassDeclaration(node) { - return node.kind === 264 /* ClassDeclaration */; -} -function isInterfaceDeclaration(node) { - return node.kind === 265 /* InterfaceDeclaration */; -} -function isTypeAliasDeclaration(node) { - return node.kind === 266 /* TypeAliasDeclaration */; -} -function isEnumDeclaration(node) { - return node.kind === 267 /* EnumDeclaration */; -} -function isModuleDeclaration(node) { - return node.kind === 268 /* ModuleDeclaration */; -} -function isModuleBlock(node) { - return node.kind === 269 /* ModuleBlock */; -} -function isCaseBlock(node) { - return node.kind === 270 /* CaseBlock */; -} -function isNamespaceExportDeclaration(node) { - return node.kind === 271 /* NamespaceExportDeclaration */; -} -function isImportEqualsDeclaration(node) { - return node.kind === 272 /* ImportEqualsDeclaration */; -} -function isImportDeclaration(node) { - return node.kind === 273 /* ImportDeclaration */; -} -function isImportClause(node) { - return node.kind === 274 /* ImportClause */; -} -function isImportTypeAssertionContainer(node) { - return node.kind === 303 /* ImportTypeAssertionContainer */; -} -function isAssertClause(node) { - return node.kind === 301 /* AssertClause */; -} -function isAssertEntry(node) { - return node.kind === 302 /* AssertEntry */; -} -function isImportAttributes(node) { - return node.kind === 301 /* ImportAttributes */; -} -function isImportAttribute(node) { - return node.kind === 302 /* ImportAttribute */; -} -function isNamespaceImport(node) { - return node.kind === 275 /* NamespaceImport */; -} -function isNamespaceExport(node) { - return node.kind === 281 /* NamespaceExport */; -} -function isNamedImports(node) { - return node.kind === 276 /* NamedImports */; -} -function isImportSpecifier(node) { - return node.kind === 277 /* ImportSpecifier */; -} -function isExportAssignment(node) { - return node.kind === 278 /* ExportAssignment */; -} -function isExportDeclaration(node) { - return node.kind === 279 /* ExportDeclaration */; -} -function isNamedExports(node) { - return node.kind === 280 /* NamedExports */; -} -function isExportSpecifier(node) { - return node.kind === 282 /* ExportSpecifier */; -} -function isModuleExportName(node) { - return node.kind === 80 /* Identifier */ || node.kind === 11 /* StringLiteral */; -} -function isMissingDeclaration(node) { - return node.kind === 283 /* MissingDeclaration */; -} -function isNotEmittedStatement(node) { - return node.kind === 354 /* NotEmittedStatement */; -} -function isSyntheticReference(node) { - return node.kind === 358 /* SyntheticReferenceExpression */; -} -function isExternalModuleReference(node) { - return node.kind === 284 /* ExternalModuleReference */; -} -function isJsxElement(node) { - return node.kind === 285 /* JsxElement */; -} -function isJsxSelfClosingElement(node) { - return node.kind === 286 /* JsxSelfClosingElement */; -} -function isJsxOpeningElement(node) { - return node.kind === 287 /* JsxOpeningElement */; -} -function isJsxClosingElement(node) { - return node.kind === 288 /* JsxClosingElement */; -} -function isJsxFragment(node) { - return node.kind === 289 /* JsxFragment */; -} -function isJsxOpeningFragment(node) { - return node.kind === 290 /* JsxOpeningFragment */; -} -function isJsxClosingFragment(node) { - return node.kind === 291 /* JsxClosingFragment */; -} -function isJsxAttribute(node) { - return node.kind === 292 /* JsxAttribute */; -} -function isJsxAttributes(node) { - return node.kind === 293 /* JsxAttributes */; -} -function isJsxSpreadAttribute(node) { - return node.kind === 294 /* JsxSpreadAttribute */; -} -function isJsxExpression(node) { - return node.kind === 295 /* JsxExpression */; -} -function isJsxNamespacedName(node) { - return node.kind === 296 /* JsxNamespacedName */; -} -function isCaseClause(node) { - return node.kind === 297 /* CaseClause */; -} -function isDefaultClause(node) { - return node.kind === 298 /* DefaultClause */; -} -function isHeritageClause(node) { - return node.kind === 299 /* HeritageClause */; -} -function isCatchClause(node) { - return node.kind === 300 /* CatchClause */; -} -function isPropertyAssignment(node) { - return node.kind === 304 /* PropertyAssignment */; -} -function isShorthandPropertyAssignment(node) { - return node.kind === 305 /* ShorthandPropertyAssignment */; -} -function isSpreadAssignment(node) { - return node.kind === 306 /* SpreadAssignment */; -} -function isEnumMember(node) { - return node.kind === 307 /* EnumMember */; -} -function isSourceFile(node) { - return node.kind === 308 /* SourceFile */; -} -function isBundle(node) { - return node.kind === 309 /* Bundle */; -} -function isJSDocTypeExpression(node) { - return node.kind === 310 /* JSDocTypeExpression */; -} -function isJSDocNameReference(node) { - return node.kind === 311 /* JSDocNameReference */; -} -function isJSDocMemberName(node) { - return node.kind === 312 /* JSDocMemberName */; -} -function isJSDocLink(node) { - return node.kind === 325 /* JSDocLink */; -} -function isJSDocLinkCode(node) { - return node.kind === 326 /* JSDocLinkCode */; -} -function isJSDocLinkPlain(node) { - return node.kind === 327 /* JSDocLinkPlain */; -} -function isJSDocAllType(node) { - return node.kind === 313 /* JSDocAllType */; -} -function isJSDocUnknownType(node) { - return node.kind === 314 /* JSDocUnknownType */; -} -function isJSDocNullableType(node) { - return node.kind === 315 /* JSDocNullableType */; -} -function isJSDocNonNullableType(node) { - return node.kind === 316 /* JSDocNonNullableType */; -} -function isJSDocOptionalType(node) { - return node.kind === 317 /* JSDocOptionalType */; -} -function isJSDocFunctionType(node) { - return node.kind === 318 /* JSDocFunctionType */; -} -function isJSDocVariadicType(node) { - return node.kind === 319 /* JSDocVariadicType */; -} -function isJSDocNamepathType(node) { - return node.kind === 320 /* JSDocNamepathType */; -} -function isJSDoc(node) { - return node.kind === 321 /* JSDoc */; -} -function isJSDocTypeLiteral(node) { - return node.kind === 323 /* JSDocTypeLiteral */; -} -function isJSDocSignature(node) { - return node.kind === 324 /* JSDocSignature */; -} -function isJSDocAugmentsTag(node) { - return node.kind === 329 /* JSDocAugmentsTag */; -} -function isJSDocAuthorTag(node) { - return node.kind === 331 /* JSDocAuthorTag */; -} -function isJSDocClassTag(node) { - return node.kind === 333 /* JSDocClassTag */; -} -function isJSDocCallbackTag(node) { - return node.kind === 339 /* JSDocCallbackTag */; -} -function isJSDocPublicTag(node) { - return node.kind === 334 /* JSDocPublicTag */; -} -function isJSDocPrivateTag(node) { - return node.kind === 335 /* JSDocPrivateTag */; -} -function isJSDocProtectedTag(node) { - return node.kind === 336 /* JSDocProtectedTag */; -} -function isJSDocReadonlyTag(node) { - return node.kind === 337 /* JSDocReadonlyTag */; -} -function isJSDocOverrideTag(node) { - return node.kind === 338 /* JSDocOverrideTag */; -} -function isJSDocOverloadTag(node) { - return node.kind === 340 /* JSDocOverloadTag */; -} -function isJSDocDeprecatedTag(node) { - return node.kind === 332 /* JSDocDeprecatedTag */; -} -function isJSDocSeeTag(node) { - return node.kind === 348 /* JSDocSeeTag */; -} -function isJSDocEnumTag(node) { - return node.kind === 341 /* JSDocEnumTag */; -} -function isJSDocParameterTag(node) { - return node.kind === 342 /* JSDocParameterTag */; -} -function isJSDocReturnTag(node) { - return node.kind === 343 /* JSDocReturnTag */; -} -function isJSDocThisTag(node) { - return node.kind === 344 /* JSDocThisTag */; -} -function isJSDocTypeTag(node) { - return node.kind === 345 /* JSDocTypeTag */; -} -function isJSDocTemplateTag(node) { - return node.kind === 346 /* JSDocTemplateTag */; -} -function isJSDocTypedefTag(node) { - return node.kind === 347 /* JSDocTypedefTag */; -} -function isJSDocUnknownTag(node) { - return node.kind === 328 /* JSDocTag */; -} -function isJSDocPropertyTag(node) { - return node.kind === 349 /* JSDocPropertyTag */; -} -function isJSDocImplementsTag(node) { - return node.kind === 330 /* JSDocImplementsTag */; -} -function isJSDocSatisfiesTag(node) { - return node.kind === 351 /* JSDocSatisfiesTag */; -} -function isJSDocThrowsTag(node) { - return node.kind === 350 /* JSDocThrowsTag */; -} -function isJSDocImportTag(node) { - return node.kind === 352 /* JSDocImportTag */; -} -function isSyntaxList(n) { - return n.kind === 353 /* SyntaxList */; -} - -// src/compiler/factory/nodeChildren.ts -var sourceFileToNodeChildren = /* @__PURE__ */ new WeakMap(); -function getNodeChildren(node, sourceFile) { - var _a; - const kind = node.kind; - if (!isNodeKind(kind)) { - return emptyArray; - } - if (kind === 353 /* SyntaxList */) { - return node._children; - } - return (_a = sourceFileToNodeChildren.get(sourceFile)) == null ? void 0 : _a.get(node); -} -function setNodeChildren(node, sourceFile, children) { - if (node.kind === 353 /* SyntaxList */) { - Debug.fail("Should not need to re-set the children of a SyntaxList."); - } - let map2 = sourceFileToNodeChildren.get(sourceFile); - if (map2 === void 0) { - map2 = /* @__PURE__ */ new WeakMap(); - sourceFileToNodeChildren.set(sourceFile, map2); - } - map2.set(node, children); - return children; -} -function unsetNodeChildren(node, origSourceFile) { - var _a; - if (node.kind === 353 /* SyntaxList */) { - Debug.fail("Did not expect to unset the children of a SyntaxList."); - } - (_a = sourceFileToNodeChildren.get(origSourceFile)) == null ? void 0 : _a.delete(node); -} -function transferSourceFileChildren(sourceFile, targetSourceFile) { - const map2 = sourceFileToNodeChildren.get(sourceFile); - if (map2 !== void 0) { - sourceFileToNodeChildren.delete(sourceFile); - sourceFileToNodeChildren.set(targetSourceFile, map2); - } -} - -// src/compiler/factory/utilities.ts -function createEmptyExports(factory2) { - return factory2.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory2.createNamedExports([]), - /*moduleSpecifier*/ - void 0 - ); -} -function createMemberAccessForPropertyName(factory2, target, memberName, location) { - if (isComputedPropertyName(memberName)) { - return setTextRange(factory2.createElementAccessExpression(target, memberName.expression), location); - } else { - const expression = setTextRange( - isMemberName(memberName) ? factory2.createPropertyAccessExpression(target, memberName) : factory2.createElementAccessExpression(target, memberName), - memberName - ); - addEmitFlags(expression, 128 /* NoNestedSourceMaps */); - return expression; - } -} -function createReactNamespace(reactNamespace, parent2) { - const react = parseNodeFactory.createIdentifier(reactNamespace || "React"); - setParent(react, getParseTreeNode(parent2)); - return react; -} -function createJsxFactoryExpressionFromEntityName(factory2, jsxFactory, parent2) { - if (isQualifiedName(jsxFactory)) { - const left = createJsxFactoryExpressionFromEntityName(factory2, jsxFactory.left, parent2); - const right = factory2.createIdentifier(idText(jsxFactory.right)); - right.escapedText = jsxFactory.right.escapedText; - return factory2.createPropertyAccessExpression(left, right); - } else { - return createReactNamespace(idText(jsxFactory), parent2); - } -} -function createJsxFactoryExpression(factory2, jsxFactoryEntity, reactNamespace, parent2) { - return jsxFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory2, jsxFactoryEntity, parent2) : factory2.createPropertyAccessExpression( - createReactNamespace(reactNamespace, parent2), - "createElement" - ); -} -function createJsxFragmentFactoryExpression(factory2, jsxFragmentFactoryEntity, reactNamespace, parent2) { - return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory2, jsxFragmentFactoryEntity, parent2) : factory2.createPropertyAccessExpression( - createReactNamespace(reactNamespace, parent2), - "Fragment" - ); -} -function createExpressionForJsxElement(factory2, callee, tagName, props, children, location) { - const argumentsList = [tagName]; - if (props) { - argumentsList.push(props); - } - if (children && children.length > 0) { - if (!props) { - argumentsList.push(factory2.createNull()); - } - if (children.length > 1) { - for (const child of children) { - startOnNewLine(child); - argumentsList.push(child); - } - } else { - argumentsList.push(children[0]); - } - } - return setTextRange( - factory2.createCallExpression( - callee, - /*typeArguments*/ - void 0, - argumentsList - ), - location - ); -} -function createExpressionForJsxFragment(factory2, jsxFactoryEntity, jsxFragmentFactoryEntity, reactNamespace, children, parentElement, location) { - const tagName = createJsxFragmentFactoryExpression(factory2, jsxFragmentFactoryEntity, reactNamespace, parentElement); - const argumentsList = [tagName, factory2.createNull()]; - if (children && children.length > 0) { - if (children.length > 1) { - for (const child of children) { - startOnNewLine(child); - argumentsList.push(child); - } - } else { - argumentsList.push(children[0]); - } - } - return setTextRange( - factory2.createCallExpression( - createJsxFactoryExpression(factory2, jsxFactoryEntity, reactNamespace, parentElement), - /*typeArguments*/ - void 0, - argumentsList - ), - location - ); -} -function createForOfBindingStatement(factory2, node, boundValue) { - if (isVariableDeclarationList(node)) { - const firstDeclaration = first(node.declarations); - const updatedDeclaration = factory2.updateVariableDeclaration( - firstDeclaration, - firstDeclaration.name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - boundValue - ); - return setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.updateVariableDeclarationList(node, [updatedDeclaration]) - ), - /*location*/ - node - ); - } else { - const updatedExpression = setTextRange( - factory2.createAssignment(node, boundValue), - /*location*/ - node - ); - return setTextRange( - factory2.createExpressionStatement(updatedExpression), - /*location*/ - node - ); - } -} -function createExpressionFromEntityName(factory2, node) { - if (isQualifiedName(node)) { - const left = createExpressionFromEntityName(factory2, node.left); - const right = setParent(setTextRange(factory2.cloneNode(node.right), node.right), node.right.parent); - return setTextRange(factory2.createPropertyAccessExpression(left, right), node); - } else { - return setParent(setTextRange(factory2.cloneNode(node), node), node.parent); - } -} -function createExpressionForPropertyName(factory2, memberName) { - if (isIdentifier(memberName)) { - return factory2.createStringLiteralFromNode(memberName); - } else if (isComputedPropertyName(memberName)) { - return setParent(setTextRange(factory2.cloneNode(memberName.expression), memberName.expression), memberName.expression.parent); - } else { - return setParent(setTextRange(factory2.cloneNode(memberName), memberName), memberName.parent); - } -} -function createExpressionForAccessorDeclaration(factory2, properties, property, receiver, multiLine) { - const { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(properties, property); - if (property === firstAccessor) { - return setTextRange( - factory2.createObjectDefinePropertyCall( - receiver, - createExpressionForPropertyName(factory2, property.name), - factory2.createPropertyDescriptor({ - enumerable: factory2.createFalse(), - configurable: true, - get: getAccessor && setTextRange( - setOriginalNode( - factory2.createFunctionExpression( - getModifiers(getAccessor), - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - getAccessor.parameters, - /*type*/ - void 0, - getAccessor.body - // TODO: GH#18217 - ), - getAccessor - ), - getAccessor - ), - set: setAccessor && setTextRange( - setOriginalNode( - factory2.createFunctionExpression( - getModifiers(setAccessor), - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - setAccessor.parameters, - /*type*/ - void 0, - setAccessor.body - // TODO: GH#18217 - ), - setAccessor - ), - setAccessor - ) - }, !multiLine) - ), - firstAccessor - ); - } - return void 0; -} -function createExpressionForPropertyAssignment(factory2, property, receiver) { - return setOriginalNode( - setTextRange( - factory2.createAssignment( - createMemberAccessForPropertyName( - factory2, - receiver, - property.name, - /*location*/ - property.name - ), - property.initializer - ), - property - ), - property - ); -} -function createExpressionForShorthandPropertyAssignment(factory2, property, receiver) { - return setOriginalNode( - setTextRange( - factory2.createAssignment( - createMemberAccessForPropertyName( - factory2, - receiver, - property.name, - /*location*/ - property.name - ), - factory2.cloneNode(property.name) - ), - /*location*/ - property - ), - /*original*/ - property - ); -} -function createExpressionForMethodDeclaration(factory2, method, receiver) { - return setOriginalNode( - setTextRange( - factory2.createAssignment( - createMemberAccessForPropertyName( - factory2, - receiver, - method.name, - /*location*/ - method.name - ), - setOriginalNode( - setTextRange( - factory2.createFunctionExpression( - getModifiers(method), - method.asteriskToken, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - method.parameters, - /*type*/ - void 0, - method.body - // TODO: GH#18217 - ), - /*location*/ - method - ), - /*original*/ - method - ) - ), - /*location*/ - method - ), - /*original*/ - method - ); -} -function createExpressionForObjectLiteralElementLike(factory2, node, property, receiver) { - if (property.name && isPrivateIdentifier(property.name)) { - Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); - } - switch (property.kind) { - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine); - case 304 /* PropertyAssignment */: - return createExpressionForPropertyAssignment(factory2, property, receiver); - case 305 /* ShorthandPropertyAssignment */: - return createExpressionForShorthandPropertyAssignment(factory2, property, receiver); - case 175 /* MethodDeclaration */: - return createExpressionForMethodDeclaration(factory2, property, receiver); - } -} -function expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, recordTempVariable, resultVariable) { - const operator = node.operator; - Debug.assert(operator === 46 /* PlusPlusToken */ || operator === 47 /* MinusMinusToken */, "Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression"); - const temp = factory2.createTempVariable(recordTempVariable); - expression = factory2.createAssignment(temp, expression); - setTextRange(expression, node.operand); - let operation = isPrefixUnaryExpression(node) ? factory2.createPrefixUnaryExpression(operator, temp) : factory2.createPostfixUnaryExpression(temp, operator); - setTextRange(operation, node); - if (resultVariable) { - operation = factory2.createAssignment(resultVariable, operation); - setTextRange(operation, node); - } - expression = factory2.createComma(expression, operation); - setTextRange(expression, node); - if (isPostfixUnaryExpression(node)) { - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; -} -function isInternalName(node) { - return (getEmitFlags(node) & 65536 /* InternalName */) !== 0; -} -function isLocalName(node) { - return (getEmitFlags(node) & 32768 /* LocalName */) !== 0; -} -function isExportName(node) { - return (getEmitFlags(node) & 16384 /* ExportName */) !== 0; -} -function isUseStrictPrologue(node) { - return isStringLiteral(node.expression) && node.expression.text === "use strict"; -} -function findUseStrictPrologue(statements) { - for (const statement of statements) { - if (isPrologueDirective(statement)) { - if (isUseStrictPrologue(statement)) { - return statement; - } - } else { - break; - } - } - return void 0; -} -function startsWithUseStrict(statements) { - const firstStatement = firstOrUndefined(statements); - return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); -} -function isCommaExpression(node) { - return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 28 /* CommaToken */; -} -function isCommaSequence(node) { - return isCommaExpression(node) || isCommaListExpression(node); -} -function isJSDocTypeAssertion(node) { - return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); -} -function getJSDocTypeAssertionType(node) { - const type = getJSDocType(node); - Debug.assertIsDefined(type); - return type; -} -function isOuterExpression(node, kinds = 63 /* All */) { - switch (node.kind) { - case 218 /* ParenthesizedExpression */: - if (kinds & -2147483648 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) { - return false; - } - return (kinds & 1 /* Parentheses */) !== 0; - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - return (kinds & 2 /* TypeAssertions */) !== 0; - case 239 /* SatisfiesExpression */: - return (kinds & (2 /* TypeAssertions */ | 32 /* Satisfies */)) !== 0; - case 234 /* ExpressionWithTypeArguments */: - return (kinds & 16 /* ExpressionsWithTypeArguments */) !== 0; - case 236 /* NonNullExpression */: - return (kinds & 4 /* NonNullAssertions */) !== 0; - case 356 /* PartiallyEmittedExpression */: - return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; - } - return false; -} -function skipOuterExpressions(node, kinds = 63 /* All */) { - while (isOuterExpression(node, kinds)) { - node = node.expression; - } - return node; -} -function walkUpOuterExpressions(node, kinds = 63 /* All */) { - let parent2 = node.parent; - while (isOuterExpression(parent2, kinds)) { - parent2 = parent2.parent; - Debug.assert(parent2); - } - return parent2; -} -function startOnNewLine(node) { - return setStartsOnNewLine( - node, - /*newLine*/ - true - ); -} -function getExternalHelpersModuleName(node) { - const parseNode = getOriginalNode(node, isSourceFile); - const emitNode = parseNode && parseNode.emitNode; - return emitNode && emitNode.externalHelpersModuleName; -} -function hasRecordedExternalHelpers(sourceFile) { - const parseNode = getOriginalNode(sourceFile, isSourceFile); - const emitNode = parseNode && parseNode.emitNode; - return !!emitNode && (!!emitNode.externalHelpersModuleName || !!emitNode.externalHelpers); -} -function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault) { - if (compilerOptions.importHelpers && isEffectiveExternalModule(sourceFile, compilerOptions)) { - const moduleKind = getEmitModuleKind(compilerOptions); - const impliedModuleKind = getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions); - const helpers = getImportedHelpers(sourceFile); - if (impliedModuleKind !== 1 /* CommonJS */ && (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */)) { - if (helpers) { - const helperNames = []; - for (const helper of helpers) { - const importName = helper.importName; - if (importName) { - pushIfUnique(helperNames, importName); - } - } - if (some(helperNames)) { - helperNames.sort(compareStringsCaseSensitive); - const 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) - )) - ); - const parseNode = getOriginalNode(sourceFile, isSourceFile); - const emitNode = getOrCreateEmitNode(parseNode); - emitNode.externalHelpers = true; - const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration( - /*modifiers*/ - void 0, - nodeFactory.createImportClause( - /*phaseModifier*/ - void 0, - /*name*/ - void 0, - namedBindings - ), - nodeFactory.createStringLiteral(externalHelpersModuleNameText), - /*attributes*/ - void 0 - ); - addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */); - return externalHelpersImportDeclaration; - } - } - } else { - const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStar || hasImportDefault); - if (externalHelpersModuleName) { - const externalHelpersImportDeclaration = nodeFactory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - externalHelpersModuleName, - nodeFactory.createExternalModuleReference(nodeFactory.createStringLiteral(externalHelpersModuleNameText)) - ); - addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */); - return externalHelpersImportDeclaration; - } - } - } -} -function getImportedHelpers(sourceFile) { - return filter(getEmitHelpers(sourceFile), (helper) => !helper.scoped); -} -function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStarOrImportDefault) { - const externalHelpersModuleName = getExternalHelpersModuleName(node); - if (externalHelpersModuleName) { - return externalHelpersModuleName; - } - const create = some(helpers) || (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && getEmitModuleFormatOfFileWorker(node, compilerOptions) < 4 /* System */; - if (create) { - const parseNode = getOriginalNode(node, isSourceFile); - const emitNode = getOrCreateEmitNode(parseNode); - return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText)); - } -} -function getLocalNameForExternalImport(factory2, node, sourceFile) { - const namespaceDeclaration = getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !isDefaultImport(node) && !isExportNamespaceAsDefaultDeclaration(node)) { - const name = namespaceDeclaration.name; - if (name.kind === 11 /* StringLiteral */) { - return factory2.getGeneratedNameForNode(node); - } - return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name)); - } - if (node.kind === 273 /* ImportDeclaration */ && node.importClause) { - return factory2.getGeneratedNameForNode(node); - } - if (node.kind === 279 /* ExportDeclaration */ && node.moduleSpecifier) { - return factory2.getGeneratedNameForNode(node); - } - return void 0; -} -function getExternalModuleNameLiteral(factory2, importNode, sourceFile, host, resolver, compilerOptions) { - const moduleName = getExternalModuleName(importNode); - if (moduleName && isStringLiteral(moduleName)) { - return tryGetModuleNameFromDeclaration(importNode, host, factory2, resolver, compilerOptions) || tryRenameExternalModule(factory2, moduleName, sourceFile) || factory2.cloneNode(moduleName); - } - return void 0; -} -function tryRenameExternalModule(factory2, moduleName, sourceFile) { - const rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text); - return rename ? factory2.createStringLiteral(rename) : void 0; -} -function tryGetModuleNameFromFile(factory2, file, host, options) { - if (!file) { - return void 0; - } - if (file.moduleName) { - return factory2.createStringLiteral(file.moduleName); - } - if (!file.isDeclarationFile && options.outFile) { - return factory2.createStringLiteral(getExternalModuleNameFromPath(host, file.fileName)); - } - return void 0; -} -function tryGetModuleNameFromDeclaration(declaration, host, factory2, resolver, compilerOptions) { - return tryGetModuleNameFromFile(factory2, resolver.getExternalModuleFileFromDeclaration(declaration), host, compilerOptions); -} -function getInitializerOfBindingOrAssignmentElement(bindingElement) { - if (isDeclarationBindingElement(bindingElement)) { - return bindingElement.initializer; - } - if (isPropertyAssignment(bindingElement)) { - const initializer = bindingElement.initializer; - return isAssignmentExpression( - initializer, - /*excludeCompoundAssignment*/ - true - ) ? initializer.right : void 0; - } - if (isShorthandPropertyAssignment(bindingElement)) { - return bindingElement.objectAssignmentInitializer; - } - if (isAssignmentExpression( - bindingElement, - /*excludeCompoundAssignment*/ - true - )) { - return bindingElement.right; - } - if (isSpreadElement(bindingElement)) { - return getInitializerOfBindingOrAssignmentElement(bindingElement.expression); - } -} -function getTargetOfBindingOrAssignmentElement(bindingElement) { - if (isDeclarationBindingElement(bindingElement)) { - return bindingElement.name; - } - if (isObjectLiteralElementLike(bindingElement)) { - switch (bindingElement.kind) { - case 304 /* PropertyAssignment */: - return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 305 /* ShorthandPropertyAssignment */: - return bindingElement.name; - case 306 /* SpreadAssignment */: - return getTargetOfBindingOrAssignmentElement(bindingElement.expression); - } - return void 0; - } - if (isAssignmentExpression( - bindingElement, - /*excludeCompoundAssignment*/ - true - )) { - return getTargetOfBindingOrAssignmentElement(bindingElement.left); - } - if (isSpreadElement(bindingElement)) { - return getTargetOfBindingOrAssignmentElement(bindingElement.expression); - } - return bindingElement; -} -function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { - switch (bindingElement.kind) { - case 170 /* Parameter */: - case 209 /* BindingElement */: - return bindingElement.dotDotDotToken; - case 231 /* SpreadElement */: - case 306 /* SpreadAssignment */: - return bindingElement; - } - return void 0; -} -function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { - const propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement); - Debug.assert(!!propertyName || isSpreadAssignment(bindingElement), "Invalid property name for binding element."); - return propertyName; -} -function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { - switch (bindingElement.kind) { - case 209 /* BindingElement */: - if (bindingElement.propertyName) { - const propertyName = bindingElement.propertyName; - if (isPrivateIdentifier(propertyName)) { - return Debug.failBadSyntaxKind(propertyName); - } - return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; - } - break; - case 304 /* PropertyAssignment */: - if (bindingElement.name) { - const propertyName = bindingElement.name; - if (isPrivateIdentifier(propertyName)) { - return Debug.failBadSyntaxKind(propertyName); - } - return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; - } - break; - case 306 /* SpreadAssignment */: - if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) { - return Debug.failBadSyntaxKind(bindingElement.name); - } - return bindingElement.name; - } - const target = getTargetOfBindingOrAssignmentElement(bindingElement); - if (target && isPropertyName(target)) { - return target; - } -} -function isStringOrNumericLiteral(node) { - const kind = node.kind; - return kind === 11 /* StringLiteral */ || kind === 9 /* NumericLiteral */; -} -function getElementsOfBindingOrAssignmentPattern(name) { - switch (name.kind) { - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - case 210 /* ArrayLiteralExpression */: - return name.elements; - case 211 /* ObjectLiteralExpression */: - return name.properties; - } -} -function getJSDocTypeAliasName(fullName) { - if (fullName) { - let rightNode = fullName; - while (true) { - if (isIdentifier(rightNode) || !rightNode.body) { - return isIdentifier(rightNode) ? rightNode : rightNode.name; - } - rightNode = rightNode.body; - } - } -} -function canHaveIllegalType(node) { - const kind = node.kind; - return kind === 177 /* Constructor */ || kind === 179 /* SetAccessor */; -} -function canHaveIllegalTypeParameters(node) { - const kind = node.kind; - return kind === 177 /* Constructor */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; -} -function canHaveIllegalDecorators(node) { - const kind = node.kind; - return kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 177 /* Constructor */ || kind === 182 /* IndexSignature */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 283 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 278 /* ExportAssignment */; -} -function canHaveIllegalModifiers(node) { - const kind = node.kind; - return kind === 176 /* ClassStaticBlockDeclaration */ || kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 283 /* MissingDeclaration */ || kind === 271 /* NamespaceExportDeclaration */; -} -function isQuestionOrExclamationToken(node) { - return isQuestionToken(node) || isExclamationToken(node); -} -function isIdentifierOrThisTypeNode(node) { - return isIdentifier(node) || isThisTypeNode(node); -} -function isReadonlyKeywordOrPlusOrMinusToken(node) { - return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node); -} -function isQuestionOrPlusOrMinusToken(node) { - return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node); -} -function isModuleName(node) { - return isIdentifier(node) || isStringLiteral(node); -} -function isExponentiationOperator(kind) { - return kind === 43 /* AsteriskAsteriskToken */; -} -function isMultiplicativeOperator(kind) { - return kind === 42 /* AsteriskToken */ || kind === 44 /* SlashToken */ || kind === 45 /* PercentToken */; -} -function isMultiplicativeOperatorOrHigher(kind) { - return isExponentiationOperator(kind) || isMultiplicativeOperator(kind); -} -function isAdditiveOperator(kind) { - return kind === 40 /* PlusToken */ || kind === 41 /* MinusToken */; -} -function isAdditiveOperatorOrHigher(kind) { - return isAdditiveOperator(kind) || isMultiplicativeOperatorOrHigher(kind); -} -function isShiftOperator(kind) { - return kind === 48 /* LessThanLessThanToken */ || kind === 49 /* GreaterThanGreaterThanToken */ || kind === 50 /* GreaterThanGreaterThanGreaterThanToken */; -} -function isShiftOperatorOrHigher(kind) { - return isShiftOperator(kind) || isAdditiveOperatorOrHigher(kind); -} -function isRelationalOperator(kind) { - return kind === 30 /* LessThanToken */ || kind === 33 /* LessThanEqualsToken */ || kind === 32 /* GreaterThanToken */ || kind === 34 /* GreaterThanEqualsToken */ || kind === 104 /* InstanceOfKeyword */ || kind === 103 /* InKeyword */; -} -function isRelationalOperatorOrHigher(kind) { - return isRelationalOperator(kind) || isShiftOperatorOrHigher(kind); -} -function isEqualityOperator(kind) { - return kind === 35 /* EqualsEqualsToken */ || kind === 37 /* EqualsEqualsEqualsToken */ || kind === 36 /* ExclamationEqualsToken */ || kind === 38 /* ExclamationEqualsEqualsToken */; -} -function isEqualityOperatorOrHigher(kind) { - return isEqualityOperator(kind) || isRelationalOperatorOrHigher(kind); -} -function isBitwiseOperator(kind) { - return kind === 51 /* AmpersandToken */ || kind === 52 /* BarToken */ || kind === 53 /* CaretToken */; -} -function isBitwiseOperatorOrHigher(kind) { - return isBitwiseOperator(kind) || isEqualityOperatorOrHigher(kind); -} -function isLogicalOperator2(kind) { - return kind === 56 /* AmpersandAmpersandToken */ || kind === 57 /* BarBarToken */; -} -function isLogicalOperatorOrHigher(kind) { - return isLogicalOperator2(kind) || isBitwiseOperatorOrHigher(kind); -} -function isAssignmentOperatorOrHigher(kind) { - return kind === 61 /* QuestionQuestionToken */ || isLogicalOperatorOrHigher(kind) || isAssignmentOperator(kind); -} -function isBinaryOperator(kind) { - return isAssignmentOperatorOrHigher(kind) || kind === 28 /* CommaToken */; -} -function isBinaryOperatorToken(node) { - return isBinaryOperator(node.kind); -} -var BinaryExpressionState; -((BinaryExpressionState2) => { - function enter(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, outerState) { - const prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : void 0; - Debug.assertEqual(stateStack[stackIndex], enter); - userStateStack[stackIndex] = machine.onEnter(nodeStack[stackIndex], prevUserState, outerState); - stateStack[stackIndex] = nextState(machine, enter); - return stackIndex; - } - BinaryExpressionState2.enter = enter; - function left(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { - Debug.assertEqual(stateStack[stackIndex], left); - Debug.assertIsDefined(machine.onLeft); - stateStack[stackIndex] = nextState(machine, left); - const nextNode = machine.onLeft(nodeStack[stackIndex].left, userStateStack[stackIndex], nodeStack[stackIndex]); - if (nextNode) { - checkCircularity(stackIndex, nodeStack, nextNode); - return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); - } - return stackIndex; - } - BinaryExpressionState2.left = left; - function operator(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { - Debug.assertEqual(stateStack[stackIndex], operator); - Debug.assertIsDefined(machine.onOperator); - stateStack[stackIndex] = nextState(machine, operator); - machine.onOperator(nodeStack[stackIndex].operatorToken, userStateStack[stackIndex], nodeStack[stackIndex]); - return stackIndex; - } - BinaryExpressionState2.operator = operator; - function right(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { - Debug.assertEqual(stateStack[stackIndex], right); - Debug.assertIsDefined(machine.onRight); - stateStack[stackIndex] = nextState(machine, right); - const nextNode = machine.onRight(nodeStack[stackIndex].right, userStateStack[stackIndex], nodeStack[stackIndex]); - if (nextNode) { - checkCircularity(stackIndex, nodeStack, nextNode); - return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); - } - return stackIndex; - } - BinaryExpressionState2.right = right; - function exit(machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, _outerState) { - Debug.assertEqual(stateStack[stackIndex], exit); - stateStack[stackIndex] = nextState(machine, exit); - const result = machine.onExit(nodeStack[stackIndex], userStateStack[stackIndex]); - if (stackIndex > 0) { - stackIndex--; - if (machine.foldState) { - const side = stateStack[stackIndex] === exit ? "right" : "left"; - userStateStack[stackIndex] = machine.foldState(userStateStack[stackIndex], result, side); - } - } else { - resultHolder.value = result; - } - return stackIndex; - } - BinaryExpressionState2.exit = exit; - function done(_machine, stackIndex, stateStack, _nodeStack, _userStateStack, _resultHolder, _outerState) { - Debug.assertEqual(stateStack[stackIndex], done); - return stackIndex; - } - BinaryExpressionState2.done = done; - function nextState(machine, currentState) { - switch (currentState) { - case enter: - if (machine.onLeft) return left; - // falls through - case left: - if (machine.onOperator) return operator; - // falls through - case operator: - if (machine.onRight) return right; - // falls through - case right: - return exit; - case exit: - return done; - case done: - return done; - default: - Debug.fail("Invalid state"); - } - } - BinaryExpressionState2.nextState = nextState; - function pushStack(stackIndex, stateStack, nodeStack, userStateStack, node) { - stackIndex++; - stateStack[stackIndex] = enter; - nodeStack[stackIndex] = node; - userStateStack[stackIndex] = void 0; - return stackIndex; - } - function checkCircularity(stackIndex, nodeStack, node) { - if (Debug.shouldAssert(2 /* Aggressive */)) { - while (stackIndex >= 0) { - Debug.assert(nodeStack[stackIndex] !== node, "Circular traversal detected."); - stackIndex--; - } - } - } -})(BinaryExpressionState || (BinaryExpressionState = {})); -var BinaryExpressionStateMachine = class { - constructor(onEnter, onLeft, onOperator, onRight, onExit, foldState) { - this.onEnter = onEnter; - this.onLeft = onLeft; - this.onOperator = onOperator; - this.onRight = onRight; - this.onExit = onExit; - this.foldState = foldState; - } -}; -function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState) { - const machine = new BinaryExpressionStateMachine(onEnter, onLeft, onOperator, onRight, onExit, foldState); - return trampoline; - function trampoline(node, outerState) { - const resultHolder = { value: void 0 }; - const stateStack = [BinaryExpressionState.enter]; - const nodeStack = [node]; - const userStateStack = [void 0]; - let stackIndex = 0; - while (stateStack[stackIndex] !== BinaryExpressionState.done) { - stackIndex = stateStack[stackIndex](machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, outerState); - } - Debug.assertEqual(stackIndex, 0); - return resultHolder.value; - } -} -function isExportOrDefaultKeywordKind(kind) { - return kind === 95 /* ExportKeyword */ || kind === 90 /* DefaultKeyword */; -} -function isExportOrDefaultModifier(node) { - const kind = node.kind; - return isExportOrDefaultKeywordKind(kind); -} -function elideNodes(factory2, nodes) { - if (nodes === void 0) return void 0; - if (nodes.length === 0) return nodes; - return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes); -} -function getNodeForGeneratedName(name) { - var _a; - const autoGenerate = name.emitNode.autoGenerate; - if (autoGenerate.flags & 4 /* Node */) { - const autoGenerateId = autoGenerate.id; - let node = name; - let original = node.original; - while (original) { - node = original; - const autoGenerate2 = (_a = node.emitNode) == null ? void 0 : _a.autoGenerate; - if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) { - break; - } - original = node.original; - } - return node; - } - return name; -} -function formatGeneratedNamePart(part, generateName) { - return typeof part === "object" ? formatGeneratedName( - /*privateName*/ - false, - part.prefix, - part.node, - part.suffix, - generateName - ) : typeof part === "string" ? part.length > 0 && part.charCodeAt(0) === 35 /* hash */ ? part.slice(1) : part : ""; -} -function formatIdentifier(name, generateName) { - return typeof name === "string" ? name : formatIdentifierWorker(name, Debug.checkDefined(generateName)); -} -function formatIdentifierWorker(node, generateName) { - return isGeneratedPrivateIdentifier(node) ? generateName(node).slice(1) : isGeneratedIdentifier(node) ? generateName(node) : isPrivateIdentifier(node) ? node.escapedText.slice(1) : idText(node); -} -function formatGeneratedName(privateName, prefix, baseName, suffix, generateName) { - prefix = formatGeneratedNamePart(prefix, generateName); - suffix = formatGeneratedNamePart(suffix, generateName); - baseName = formatIdentifier(baseName, generateName); - return `${privateName ? "#" : ""}${prefix}${baseName}${suffix}`; -} -function createAccessorPropertyBackingField(factory2, node, modifiers, initializer) { - return factory2.updatePropertyDeclaration( - node, - modifiers, - factory2.getGeneratedPrivateNameForNode( - node.name, - /*prefix*/ - void 0, - "_accessor_storage" - ), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ); -} -function createAccessorPropertyGetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) { - return factory2.createGetAccessorDeclaration( - modifiers, - name, - [], - /*type*/ - void 0, - factory2.createBlock([ - factory2.createReturnStatement( - factory2.createPropertyAccessExpression( - receiver, - factory2.getGeneratedPrivateNameForNode( - node.name, - /*prefix*/ - void 0, - "_accessor_storage" - ) - ) - ) - ]) - ); -} -function createAccessorPropertySetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) { - return factory2.createSetAccessorDeclaration( - modifiers, - name, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "value" - )], - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.createPropertyAccessExpression( - receiver, - factory2.getGeneratedPrivateNameForNode( - node.name, - /*prefix*/ - void 0, - "_accessor_storage" - ) - ), - factory2.createIdentifier("value") - ) - ) - ]) - ); -} -function findComputedPropertyNameCacheAssignment(name) { - let node = name.expression; - while (true) { - node = skipOuterExpressions(node); - if (isCommaListExpression(node)) { - node = last(node.elements); - continue; - } - if (isCommaExpression(node)) { - node = node.right; - continue; - } - if (isAssignmentExpression( - node, - /*excludeCompoundAssignment*/ - true - ) && isGeneratedIdentifier(node.left)) { - return node; - } - break; - } -} -function isSyntheticParenthesizedExpression(node) { - return isParenthesizedExpression(node) && nodeIsSynthesized(node) && !node.emitNode; -} -function flattenCommaListWorker(node, expressions) { - if (isSyntheticParenthesizedExpression(node)) { - flattenCommaListWorker(node.expression, expressions); - } else if (isCommaExpression(node)) { - flattenCommaListWorker(node.left, expressions); - flattenCommaListWorker(node.right, expressions); - } else if (isCommaListExpression(node)) { - for (const child of node.elements) { - flattenCommaListWorker(child, expressions); - } - } else { - expressions.push(node); - } -} -function flattenCommaList(node) { - const expressions = []; - flattenCommaListWorker(node, expressions); - return expressions; -} -function containsObjectRestOrSpread(node) { - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) return true; - if (node.transformFlags & 128 /* ContainsES2018 */) { - for (const element of getElementsOfBindingOrAssignmentPattern(node)) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (target && isAssignmentPattern(target)) { - if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return true; - } - if (target.transformFlags & 128 /* ContainsES2018 */) { - if (containsObjectRestOrSpread(target)) return true; - } - } - } - } - return false; -} - -// src/compiler/factory/utilitiesPublic.ts -function setTextRange(range, location) { - return location ? setTextRangePosEnd(range, location.pos, location.end) : range; -} -function canHaveModifiers(node) { - const kind = node.kind; - return kind === 169 /* TypeParameter */ || kind === 170 /* Parameter */ || kind === 172 /* PropertySignature */ || kind === 173 /* PropertyDeclaration */ || kind === 174 /* MethodSignature */ || kind === 175 /* MethodDeclaration */ || kind === 177 /* Constructor */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 182 /* IndexSignature */ || kind === 186 /* ConstructorType */ || kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 278 /* ExportAssignment */ || kind === 279 /* ExportDeclaration */; -} -function canHaveDecorators(node) { - const kind = node.kind; - return kind === 170 /* Parameter */ || kind === 173 /* PropertyDeclaration */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */; -} - -// src/compiler/parser.ts -var NodeConstructor; -var TokenConstructor; -var IdentifierConstructor; -var PrivateIdentifierConstructor; -var SourceFileConstructor; -var parseBaseNodeFactory = { - createBaseSourceFileNode: (kind) => new (SourceFileConstructor || (SourceFileConstructor = objectAllocator.getSourceFileConstructor()))(kind, -1, -1), - createBaseIdentifierNode: (kind) => new (IdentifierConstructor || (IdentifierConstructor = objectAllocator.getIdentifierConstructor()))(kind, -1, -1), - createBasePrivateIdentifierNode: (kind) => new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = objectAllocator.getPrivateIdentifierConstructor()))(kind, -1, -1), - createBaseTokenNode: (kind) => new (TokenConstructor || (TokenConstructor = objectAllocator.getTokenConstructor()))(kind, -1, -1), - createBaseNode: (kind) => new (NodeConstructor || (NodeConstructor = objectAllocator.getNodeConstructor()))(kind, -1, -1) -}; -var parseNodeFactory = createNodeFactory(1 /* NoParenthesizerRules */, parseBaseNodeFactory); -function visitNode2(cbNode, node) { - return node && cbNode(node); -} -function visitNodes(cbNode, cbNodes, nodes) { - if (nodes) { - if (cbNodes) { - return cbNodes(nodes); - } - for (const node of nodes) { - const result = cbNode(node); - if (result) { - return result; - } - } - } -} -function isJSDocLikeText(text, start) { - return text.charCodeAt(start + 1) === 42 /* asterisk */ && text.charCodeAt(start + 2) === 42 /* asterisk */ && text.charCodeAt(start + 3) !== 47 /* slash */; -} -function isFileProbablyExternalModule(sourceFile) { - return forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) || getImportMetaIfNecessary(sourceFile); -} -function isAnExternalModuleIndicatorNode(node) { - 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 & 8388608 /* PossiblyContainsImportMeta */ ? walkTreeForImportMeta(sourceFile) : void 0; -} -function walkTreeForImportMeta(node) { - return isImportMeta2(node) ? node : forEachChild(node, walkTreeForImportMeta); -} -function hasModifierOfKind(node, kind) { - return some(node.modifiers, (m) => m.kind === kind); -} -function isImportMeta2(node) { - return isMetaProperty(node) && node.keywordToken === 102 /* ImportKeyword */ && node.name.escapedText === "meta"; -} -var forEachChildTable = { - [167 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); - }, - [169 /* 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); - }, - [305 /* 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); - }, - [306 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [170 /* 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); - }, - [173 /* 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); - }, - [172 /* 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); - }, - [304 /* 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); - }, - [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); - }, - [209 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); - }, - [182 /* 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); - }, - [186 /* 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); - }, - [185 /* 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); - }, - [180 /* CallSignature */]: forEachChildInCallOrConstructSignature, - [181 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, - [175 /* 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); - }, - [174 /* 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); - }, - [177 /* 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); - }, - [178 /* 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); - }, - [179 /* 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); - }, - [263 /* 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); - }, - [219 /* 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); - }, - [220 /* 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); - }, - [176 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); - }, - [184 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - }, - [183 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type); - }, - [187 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments); - }, - [188 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.members); - }, - [189 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.elementType); - }, - [190 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.elements); - }, - [193 /* UnionType */]: forEachChildInUnionOrIntersectionType, - [194 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, - [195 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType); - }, - [196 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.typeParameter); - }, - [206 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - }, - [303 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.assertClause); - }, - [197 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, - [199 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, - [200 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType); - }, - [201 /* 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); - }, - [202 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.literal); - }, - [203 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type); - }, - [207 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [208 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [210 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.elements); - }, - [211 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.properties); - }, - [212 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name); - }, - [213 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression); - }, - [214 /* CallExpression */]: forEachChildInCallOrNewExpression, - [215 /* NewExpression */]: forEachChildInCallOrNewExpression, - [216 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template); - }, - [217 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression); - }, - [218 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.operand); - }, - [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression); - }, - [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.operand); - }, - [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right); - }, - [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); - }, - [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); - }, - [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name); - }, - [228 /* 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); - }, - [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [242 /* Block */]: forEachChildInBlock, - [269 /* ModuleBlock */]: forEachChildInBlock, - [308 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); - }, - [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); - }, - [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.declarations); - }, - [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement); - }, - [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression); - }, - [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); - }, - [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement); - }, - [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); - }, - [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); - }, - [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, - [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, - [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); - }, - [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock); - }, - [270 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.clauses); - }, - [297 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - }, - [298 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.statements); - }, - [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement); - }, - [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock); - }, - [300 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block); - }, - [171 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, - [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, - [265 /* 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); - }, - [266 /* 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); - }, - [267 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - }, - [307 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); - }, - [268 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); - }, - [272 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); - }, - [273 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); - }, - [274 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); - }, - [301 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.elements); - }, - [302 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); - }, - [271 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); - }, - [275 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name); - }, - [281 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name); - }, - [276 /* NamedImports */]: forEachChildInNamedImportsOrExports, - [280 /* NamedExports */]: forEachChildInNamedImportsOrExports, - [279 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); - }, - [277 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, - [282 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, - [278 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); - }, - [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - }, - [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal); - }, - [204 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - }, - [205 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal); - }, - [168 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [299 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.types); - }, - [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - }, - [284 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [283 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers); - }, - [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.elements); - }, - [285 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement); - }, - [289 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment); - }, - [286 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [287 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [293 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.properties); - }, - [292 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); - }, - [294 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); - }, - [295 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression); - }, - [288 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.tagName); - }, - [296 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.namespace) || visitNode2(cbNode, node.name); - }, - [191 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [192 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [310 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [316 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [315 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [317 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [319 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [318 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); - }, - [321 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { - return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags); - }, - [348 /* 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)); - }, - [311 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name); - }, - [312 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); - }, - [342 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, - [349 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, - [331 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); - }, - [330 /* 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)); - }, - [329 /* 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)); - }, - [346 /* 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)); - }, - [347 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 310 /* 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))); - }, - [339 /* 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)); - }, - [343 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag, - [345 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, - [344 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, - [341 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, - [351 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, - [350 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, - [340 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, - [324 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { - return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type); - }, - [325 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, - [326 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, - [327 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, - [323 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { - return forEach(node.jsDocPropertyTags, cbNode); - }, - [328 /* JSDocTag */]: forEachChildInJSDocTag, - [333 /* JSDocClassTag */]: forEachChildInJSDocTag, - [334 /* JSDocPublicTag */]: forEachChildInJSDocTag, - [335 /* JSDocPrivateTag */]: forEachChildInJSDocTag, - [336 /* JSDocProtectedTag */]: forEachChildInJSDocTag, - [337 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, - [332 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, - [338 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [352 /* JSDocImportTag */]: forEachChildInJSDocImportTag, - [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression -}; -function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); -} -function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.types); -} -function forEachChildInParenthesizedTypeOrTypeOperator(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.type); -} -function forEachChildInObjectOrArrayBindingPattern(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.elements); -} -function forEachChildInCallOrNewExpression(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.expression) || // TODO: should we separate these branches out? - visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); -} -function forEachChildInBlock(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.statements); -} -function forEachChildInContinueOrBreakStatement(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.label); -} -function forEachChildInClassDeclarationOrExpression(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); -} -function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.elements); -} -function forEachChildInImportOrExportSpecifier(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name); -} -function forEachChildInJsxOpeningOrSelfClosingElement(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.attributes); -} -function forEachChildInOptionalRestOrJSDocParameterModifier(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.type); -} -function forEachChildInJSDocParameterOrPropertyTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || (node.isNameFirst ? visitNode2(cbNode, node.name) || visitNode2(cbNode, node.typeExpression) : visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.name)) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); -} -function forEachChildInJSDocTypeLikeTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); -} -function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.name); -} -function forEachChildInJSDocTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); -} -function forEachChildInJSDocImportTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); -} -function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) { - return visitNode2(cbNode, node.expression); -} -function forEachChild(node, cbNode, cbNodes) { - if (node === void 0 || node.kind <= 166 /* LastToken */) { - return; - } - const fn = forEachChildTable[node.kind]; - return fn === void 0 ? void 0 : fn(node, cbNode, cbNodes); -} -function forEachChildRecursively(rootNode, cbNode, cbNodes) { - const queue = gatherPossibleChildren(rootNode); - const parents = []; - while (parents.length < queue.length) { - parents.push(rootNode); - } - while (queue.length !== 0) { - const current = queue.pop(); - const parent2 = parents.pop(); - if (isArray(current)) { - if (cbNodes) { - const res = cbNodes(current, parent2); - if (res) { - if (res === "skip") continue; - return res; - } - } - for (let i = current.length - 1; i >= 0; --i) { - queue.push(current[i]); - parents.push(parent2); - } - } else { - const res = cbNode(current, parent2); - if (res) { - if (res === "skip") continue; - return res; - } - if (current.kind >= 167 /* FirstNode */) { - for (const child of gatherPossibleChildren(current)) { - queue.push(child); - parents.push(current); - } - } - } - } -} -function gatherPossibleChildren(node) { - const children = []; - forEachChild(node, addWorkItem, addWorkItem); - return children; - function addWorkItem(n) { - children.unshift(n); - } -} -function setExternalModuleIndicator(sourceFile) { - sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile); -} -function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) { - var _a, _b; - (_a = tracing) == null ? void 0 : _a.push( - tracing.Phase.Parse, - "createSourceFile", - { path: fileName }, - /*separateBeginAndEnd*/ - true - ); - mark("beforeParse"); - let result; - const { - languageVersion, - setExternalModuleIndicator: overrideSetExternalModuleIndicator, - impliedNodeFormat: format, - jsDocParsingMode - } = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }; - if (languageVersion === 100 /* JSON */) { - result = Parser.parseSourceFile( - fileName, - sourceText, - languageVersion, - /*syntaxCursor*/ - void 0, - setParentNodes, - 6 /* JSON */, - noop, - jsDocParsingMode - ); - } else { - const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => { - file.impliedNodeFormat = format; - return (overrideSetExternalModuleIndicator || setExternalModuleIndicator)(file); - }; - result = Parser.parseSourceFile( - fileName, - sourceText, - languageVersion, - /*syntaxCursor*/ - void 0, - setParentNodes, - scriptKind, - setIndicator, - jsDocParsingMode - ); - } - mark("afterParse"); - measure("Parse", "beforeParse", "afterParse"); - (_b = tracing) == null ? void 0 : _b.pop(); - return result; -} -function parseIsolatedEntityName(text, languageVersion) { - return Parser.parseIsolatedEntityName(text, languageVersion); -} -function parseJsonText(fileName, sourceText) { - return Parser.parseJsonText(fileName, sourceText); -} -function isExternalModule(file) { - return file.externalModuleIndicator !== void 0; -} -function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks = false) { - const newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); - newSourceFile.flags |= sourceFile.flags & 12582912 /* PermanentlySetIncrementalFlags */; - return newSourceFile; -} -function parseIsolatedJSDocComment(content, start, length2) { - const result = Parser.JSDocParser.parseIsolatedJSDocComment(content, start, length2); - if (result && result.jsDoc) { - Parser.fixupParentReferences(result.jsDoc); - } - return result; -} -function parseJSDocTypeExpressionForTests(content, start, length2) { - return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2); -} -var Parser; -((Parser2) => { - var scanner2 = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - true - ); - var disallowInAndDecoratorContext = 8192 /* DisallowInContext */ | 32768 /* DecoratorContext */; - var NodeConstructor2; - var TokenConstructor2; - var IdentifierConstructor2; - var PrivateIdentifierConstructor2; - var SourceFileConstructor2; - function countNode(node) { - nodeCount++; - return node; - } - var baseNodeFactory = { - createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2( - kind, - /*pos*/ - 0, - /*end*/ - 0 - )), - createBaseIdentifierNode: (kind) => countNode(new IdentifierConstructor2( - kind, - /*pos*/ - 0, - /*end*/ - 0 - )), - createBasePrivateIdentifierNode: (kind) => countNode(new PrivateIdentifierConstructor2( - kind, - /*pos*/ - 0, - /*end*/ - 0 - )), - createBaseTokenNode: (kind) => countNode(new TokenConstructor2( - kind, - /*pos*/ - 0, - /*end*/ - 0 - )), - createBaseNode: (kind) => countNode(new NodeConstructor2( - kind, - /*pos*/ - 0, - /*end*/ - 0 - )) - }; - var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); - var { - createNodeArray: factoryCreateNodeArray, - createNumericLiteral: factoryCreateNumericLiteral, - createStringLiteral: factoryCreateStringLiteral, - createLiteralLikeNode: factoryCreateLiteralLikeNode, - createIdentifier: factoryCreateIdentifier, - createPrivateIdentifier: factoryCreatePrivateIdentifier, - createToken: factoryCreateToken, - createArrayLiteralExpression: factoryCreateArrayLiteralExpression, - createObjectLiteralExpression: factoryCreateObjectLiteralExpression, - createPropertyAccessExpression: factoryCreatePropertyAccessExpression, - createPropertyAccessChain: factoryCreatePropertyAccessChain, - createElementAccessExpression: factoryCreateElementAccessExpression, - createElementAccessChain: factoryCreateElementAccessChain, - createCallExpression: factoryCreateCallExpression, - createCallChain: factoryCreateCallChain, - createNewExpression: factoryCreateNewExpression, - createParenthesizedExpression: factoryCreateParenthesizedExpression, - createBlock: factoryCreateBlock, - createVariableStatement: factoryCreateVariableStatement, - createExpressionStatement: factoryCreateExpressionStatement, - createIfStatement: factoryCreateIfStatement, - createWhileStatement: factoryCreateWhileStatement, - createForStatement: factoryCreateForStatement, - createForOfStatement: factoryCreateForOfStatement, - createVariableDeclaration: factoryCreateVariableDeclaration, - createVariableDeclarationList: factoryCreateVariableDeclarationList - } = factory2; - var fileName; - var sourceFlags; - var sourceText; - var languageVersion; - var scriptKind; - var languageVariant; - var parseDiagnostics; - var jsDocDiagnostics; - var syntaxCursor; - var currentToken; - var nodeCount; - var identifiers; - var identifierCount; - var parsingContext; - var notParenthesizedArrow; - var contextFlags; - var topLevel = true; - var parseErrorBeforeNextFinishedNode = false; - function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) { - var _a; - scriptKind2 = ensureScriptKind(fileName2, scriptKind2); - if (scriptKind2 === 6 /* JSON */) { - const result2 = parseJsonText2(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes); - convertToJson( - result2, - (_a = result2.statements[0]) == null ? void 0 : _a.expression, - result2.parseDiagnostics, - /*returnValue*/ - false, - /*jsonConversionNotifier*/ - void 0 - ); - result2.referencedFiles = emptyArray; - result2.typeReferenceDirectives = emptyArray; - result2.libReferenceDirectives = emptyArray; - result2.amdDependencies = emptyArray; - result2.hasNoDefaultLib = false; - result2.pragmas = emptyMap; - return result2; - } - initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode); - const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode); - clearState(); - return result; - } - Parser2.parseSourceFile = parseSourceFile; - function parseIsolatedEntityName2(content, languageVersion2) { - initializeState( - "", - content, - languageVersion2, - /*syntaxCursor*/ - void 0, - 1 /* JS */, - 0 /* ParseAll */ - ); - nextToken(); - const entityName = parseEntityName( - /*allowReservedWords*/ - true - ); - const isValid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length; - clearState(); - 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 */, 0 /* ParseAll */); - sourceFlags = contextFlags; - nextToken(); - const pos = getNodePos(); - let statements, endOfFileToken; - if (token() === 1 /* EndOfFileToken */) { - statements = createNodeArray([], pos, pos); - endOfFileToken = parseTokenNode(); - } else { - let expressions; - while (token() !== 1 /* EndOfFileToken */) { - let expression2; - switch (token()) { - case 23 /* OpenBracketToken */: - expression2 = parseArrayLiteralExpression(); - break; - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 106 /* NullKeyword */: - expression2 = parseTokenNode(); - break; - case 41 /* MinusToken */: - if (lookAhead(() => nextToken() === 9 /* NumericLiteral */ && nextToken() !== 59 /* ColonToken */)) { - expression2 = parsePrefixUnaryExpression(); - } else { - expression2 = parseObjectLiteralExpression(); - } - break; - case 9 /* NumericLiteral */: - case 11 /* StringLiteral */: - if (lookAhead(() => nextToken() !== 59 /* ColonToken */)) { - expression2 = parseLiteralNode(); - break; - } - // falls through - default: - expression2 = parseObjectLiteralExpression(); - break; - } - if (expressions && isArray(expressions)) { - expressions.push(expression2); - } else if (expressions) { - expressions = [expressions, expression2]; - } else { - expressions = expression2; - if (token() !== 1 /* EndOfFileToken */) { - parseErrorAtCurrentToken(Diagnostics.Unexpected_token); - } - } - } - const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); - const statement = factoryCreateExpressionStatement(expression); - finishNode(statement, pos); - statements = createNodeArray([statement], pos); - endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); - } - const sourceFile = createSourceFile2( - fileName2, - 2 /* ES2015 */, - 6 /* JSON */, - /*isDeclarationFile*/ - false, - statements, - endOfFileToken, - sourceFlags, - noop - ); - if (setParentNodes) { - fixupParentReferences(sourceFile); - } - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; - sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); - if (jsDocDiagnostics) { - sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); - } - const result = sourceFile; - clearState(); - return result; - } - Parser2.parseJsonText = parseJsonText2; - function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) { - NodeConstructor2 = objectAllocator.getNodeConstructor(); - TokenConstructor2 = objectAllocator.getTokenConstructor(); - IdentifierConstructor2 = objectAllocator.getIdentifierConstructor(); - PrivateIdentifierConstructor2 = objectAllocator.getPrivateIdentifierConstructor(); - SourceFileConstructor2 = objectAllocator.getSourceFileConstructor(); - fileName = normalizePath(_fileName); - sourceText = _sourceText; - languageVersion = _languageVersion; - syntaxCursor = _syntaxCursor; - scriptKind = _scriptKind; - languageVariant = getLanguageVariant(_scriptKind); - parseDiagnostics = []; - parsingContext = 0; - identifiers = /* @__PURE__ */ new Map(); - identifierCount = 0; - nodeCount = 0; - sourceFlags = 0; - topLevel = true; - switch (scriptKind) { - case 1 /* JS */: - case 2 /* JSX */: - contextFlags = 524288 /* JavaScriptFile */; - break; - case 6 /* JSON */: - contextFlags = 524288 /* JavaScriptFile */ | 134217728 /* JsonFile */; - break; - default: - contextFlags = 0 /* None */; - break; - } - parseErrorBeforeNextFinishedNode = false; - scanner2.setText(sourceText); - 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; - scriptKind = void 0; - languageVariant = void 0; - sourceFlags = 0; - parseDiagnostics = void 0; - jsDocDiagnostics = void 0; - parsingContext = 0; - identifiers = void 0; - notParenthesizedArrow = void 0; - topLevel = true; - } - function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) { - const isDeclarationFile = isDeclarationFileName(fileName); - if (isDeclarationFile) { - contextFlags |= 33554432 /* Ambient */; - } - sourceFlags = contextFlags; - nextToken(); - const statements = parseList(0 /* SourceElements */, parseStatement); - Debug.assert(token() === 1 /* EndOfFileToken */); - 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); - sourceFile.commentDirectives = scanner2.getCommentDirectives(); - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; - sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); - sourceFile.jsDocParsingMode = jsDocParsingMode; - if (jsDocDiagnostics) { - sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); - } - if (setParentNodes) { - fixupParentReferences(sourceFile); - } - return sourceFile; - function reportPragmaDiagnostic(pos, end, diagnostic) { - parseDiagnostics.push(createDetachedDiagnostic(fileName, sourceText, pos, end, diagnostic)); - } - } - let hasDeprecatedTag = false; - 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 |= 536870912 /* Deprecated */; - } - return node; - } - function reparseTopLevelAwait(sourceFile) { - const savedSyntaxCursor = syntaxCursor; - const baseSyntaxCursor = IncrementalParser.createSyntaxCursor(sourceFile); - syntaxCursor = { currentNode: currentNode2 }; - const statements = []; - const savedParseDiagnostics = parseDiagnostics; - parseDiagnostics = []; - let pos = 0; - let start = findNextStatementWithAwait(sourceFile.statements, 0); - while (start !== -1) { - const prevStatement = sourceFile.statements[pos]; - const nextStatement = sourceFile.statements[start]; - addRange(statements, sourceFile.statements, pos, start); - pos = findNextStatementWithoutAwait(sourceFile.statements, start); - const diagnosticStart = findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= prevStatement.pos); - const diagnosticEnd = diagnosticStart >= 0 ? findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= nextStatement.pos, diagnosticStart) : -1; - if (diagnosticStart >= 0) { - addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart, diagnosticEnd >= 0 ? diagnosticEnd : void 0); - } - speculationHelper(() => { - const savedContextFlags = contextFlags; - contextFlags |= 65536 /* AwaitContext */; - scanner2.resetTokenState(nextStatement.pos); - nextToken(); - while (token() !== 1 /* EndOfFileToken */) { - const startPos = scanner2.getTokenFullStart(); - const statement = parseListElement(0 /* SourceElements */, parseStatement); - statements.push(statement); - if (startPos === scanner2.getTokenFullStart()) { - nextToken(); - } - if (pos >= 0) { - const nonAwaitStatement = sourceFile.statements[pos]; - if (statement.end === nonAwaitStatement.pos) { - break; - } - if (statement.end > nonAwaitStatement.pos) { - pos = findNextStatementWithoutAwait(sourceFile.statements, pos + 1); - } - } - } - contextFlags = savedContextFlags; - }, 2 /* Reparse */); - start = pos >= 0 ? findNextStatementWithAwait(sourceFile.statements, pos) : -1; - } - if (pos >= 0) { - const prevStatement = sourceFile.statements[pos]; - addRange(statements, sourceFile.statements, pos); - const diagnosticStart = findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= prevStatement.pos); - if (diagnosticStart >= 0) { - addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart); - } - } - syntaxCursor = savedSyntaxCursor; - return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); - function containsPossibleTopLevelAwait(node) { - return !(node.flags & 65536 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); - } - function findNextStatementWithAwait(statements2, start2) { - for (let i = start2; i < statements2.length; i++) { - if (containsPossibleTopLevelAwait(statements2[i])) { - return i; - } - } - return -1; - } - function findNextStatementWithoutAwait(statements2, start2) { - for (let i = start2; i < statements2.length; i++) { - if (!containsPossibleTopLevelAwait(statements2[i])) { - return i; - } - } - return -1; - } - function currentNode2(position) { - const node = baseSyntaxCursor.currentNode(position); - if (topLevel && node && containsPossibleTopLevelAwait(node)) { - markAsIntersectingIncrementalChange(node); - } - return node; - } - } - function fixupParentReferences(rootNode) { - setParentRecursive( - rootNode, - /*incremental*/ - true - ); - } - Parser2.fixupParentReferences = fixupParentReferences; - function createSourceFile2(fileName2, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator2) { - let sourceFile = factory2.createSourceFile(statements, endOfFileToken, flags); - setTextRangePosWidth(sourceFile, 0, sourceText.length); - setFields(sourceFile); - if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */) { - const oldSourceFile = sourceFile; - sourceFile = reparseTopLevelAwait(sourceFile); - if (oldSourceFile !== sourceFile) setFields(sourceFile); - } - return sourceFile; - function setFields(sourceFile2) { - sourceFile2.text = sourceText; - sourceFile2.bindDiagnostics = []; - sourceFile2.bindSuggestionDiagnostics = void 0; - sourceFile2.languageVersion = languageVersion2; - sourceFile2.fileName = fileName2; - sourceFile2.languageVariant = getLanguageVariant(scriptKind2); - sourceFile2.isDeclarationFile = isDeclarationFile; - sourceFile2.scriptKind = scriptKind2; - setExternalModuleIndicator2(sourceFile2); - sourceFile2.setExternalModuleIndicator = setExternalModuleIndicator2; - } - } - function setContextFlag(val, flag) { - if (val) { - contextFlags |= flag; - } else { - contextFlags &= ~flag; - } - } - function setDisallowInContext(val) { - setContextFlag(val, 8192 /* DisallowInContext */); - } - function setYieldContext(val) { - setContextFlag(val, 16384 /* YieldContext */); - } - function setDecoratorContext(val) { - setContextFlag(val, 32768 /* DecoratorContext */); - } - function setAwaitContext(val) { - setContextFlag(val, 65536 /* AwaitContext */); - } - function doOutsideOfContext(context, func) { - const contextFlagsToClear = context & contextFlags; - if (contextFlagsToClear) { - setContextFlag( - /*val*/ - false, - contextFlagsToClear - ); - const result = func(); - setContextFlag( - /*val*/ - true, - contextFlagsToClear - ); - return result; - } - return func(); - } - function doInsideOfContext(context, func) { - const contextFlagsToSet = context & ~contextFlags; - if (contextFlagsToSet) { - setContextFlag( - /*val*/ - true, - contextFlagsToSet - ); - const result = func(); - setContextFlag( - /*val*/ - false, - contextFlagsToSet - ); - return result; - } - return func(); - } - function allowInAnd(func) { - return doOutsideOfContext(8192 /* DisallowInContext */, func); - } - function disallowInAnd(func) { - return doInsideOfContext(8192 /* DisallowInContext */, func); - } - function allowConditionalTypesAnd(func) { - return doOutsideOfContext(131072 /* DisallowConditionalTypesContext */, func); - } - function disallowConditionalTypesAnd(func) { - return doInsideOfContext(131072 /* DisallowConditionalTypesContext */, func); - } - function doInYieldContext(func) { - return doInsideOfContext(16384 /* YieldContext */, func); - } - function doInDecoratorContext(func) { - return doInsideOfContext(32768 /* DecoratorContext */, func); - } - function doInAwaitContext(func) { - return doInsideOfContext(65536 /* AwaitContext */, func); - } - function doOutsideOfAwaitContext(func) { - return doOutsideOfContext(65536 /* AwaitContext */, func); - } - function doInYieldAndAwaitContext(func) { - return doInsideOfContext(16384 /* YieldContext */ | 65536 /* AwaitContext */, func); - } - function doOutsideOfYieldAndAwaitContext(func) { - return doOutsideOfContext(16384 /* YieldContext */ | 65536 /* AwaitContext */, func); - } - function inContext(flags) { - return (contextFlags & flags) !== 0; - } - function inYieldContext() { - return inContext(16384 /* YieldContext */); - } - function inDisallowInContext() { - return inContext(8192 /* DisallowInContext */); - } - function inDisallowConditionalTypesContext() { - return inContext(131072 /* DisallowConditionalTypesContext */); - } - function inDecoratorContext() { - return inContext(32768 /* DecoratorContext */); - } - function inAwaitContext() { - return inContext(65536 /* AwaitContext */); - } - function parseErrorAtCurrentToken(message, ...args) { - return parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), message, ...args); - } - function parseErrorAtPosition(start, length2, message, ...args) { - const lastError = lastOrUndefined(parseDiagnostics); - let result; - if (!lastError || start !== lastError.start) { - result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args); - parseDiagnostics.push(result); - } - parseErrorBeforeNextFinishedNode = true; - return result; - } - function parseErrorAt(start, end, message, ...args) { - return parseErrorAtPosition(start, end - start, message, ...args); - } - function parseErrorAtRange(range, message, ...args) { - parseErrorAt(range.pos, range.end, message, ...args); - } - function scanError(message, length2, arg0) { - parseErrorAtPosition(scanner2.getTokenEnd(), length2, message, arg0); - } - function getNodePos() { - return scanner2.getTokenFullStart(); - } - function hasPrecedingJSDocComment() { - return scanner2.hasPrecedingJSDocComment(); - } - function token() { - return currentToken; - } - function nextTokenWithoutCheck() { - return currentToken = scanner2.scan(); - } - function nextTokenAnd(func) { - nextToken(); - return func(); - } - function nextToken() { - if (isKeyword(currentToken) && (scanner2.hasUnicodeEscape() || scanner2.hasExtendedUnicodeEscape())) { - parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), Diagnostics.Keywords_cannot_contain_escape_characters); - } - return nextTokenWithoutCheck(); - } - function nextTokenJSDoc() { - return currentToken = scanner2.scanJsDocToken(); - } - function nextJSDocCommentTextToken(inBackticks) { - return currentToken = scanner2.scanJSDocCommentTextToken(inBackticks); - } - function reScanGreaterToken() { - return currentToken = scanner2.reScanGreaterToken(); - } - function reScanSlashToken() { - return currentToken = scanner2.reScanSlashToken(); - } - function reScanTemplateToken(isTaggedTemplate) { - return currentToken = scanner2.reScanTemplateToken(isTaggedTemplate); - } - function reScanLessThanToken() { - return currentToken = scanner2.reScanLessThanToken(); - } - function reScanHashToken() { - return currentToken = scanner2.reScanHashToken(); - } - function scanJsxIdentifier() { - return currentToken = scanner2.scanJsxIdentifier(); - } - function scanJsxText() { - return currentToken = scanner2.scanJsxToken(); - } - function scanJsxAttributeValue() { - return currentToken = scanner2.scanJsxAttributeValue(); - } - function speculationHelper(callback, speculationKind) { - const saveToken = currentToken; - const saveParseDiagnosticsLength = parseDiagnostics.length; - const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; - const saveContextFlags = contextFlags; - const result = speculationKind !== 0 /* TryParse */ ? scanner2.lookAhead(callback) : scanner2.tryScan(callback); - Debug.assert(saveContextFlags === contextFlags); - if (!result || speculationKind !== 0 /* TryParse */) { - currentToken = saveToken; - if (speculationKind !== 2 /* Reparse */) { - parseDiagnostics.length = saveParseDiagnosticsLength; - } - parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; - } - return result; - } - function lookAhead(callback) { - return speculationHelper(callback, 1 /* Lookahead */); - } - function tryParse(callback) { - return speculationHelper(callback, 0 /* TryParse */); - } - function isBindingIdentifier() { - if (token() === 80 /* Identifier */) { - return true; - } - return token() > 118 /* LastReservedWord */; - } - function isIdentifier2() { - if (token() === 80 /* Identifier */) { - return true; - } - if (token() === 127 /* YieldKeyword */ && inYieldContext()) { - return false; - } - if (token() === 135 /* AwaitKeyword */ && inAwaitContext()) { - return false; - } - return token() > 118 /* LastReservedWord */; - } - function parseExpected(kind, diagnosticMessage, shouldAdvance = true) { - if (token() === kind) { - if (shouldAdvance) { - nextToken(); - } - return true; - } - if (diagnosticMessage) { - parseErrorAtCurrentToken(diagnosticMessage); - } else { - parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(kind)); - } - return false; - } - const viableKeywordSuggestions = Object.keys(textToKeywordObj).filter((keyword) => keyword.length > 2); - function parseErrorForMissingSemicolonAfter(node) { - if (isTaggedTemplateExpression(node)) { - parseErrorAt(skipTrivia(sourceText, node.template.pos), node.template.end, Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings); - return; - } - const expressionText = isIdentifier(node) ? idText(node) : void 0; - if (!expressionText || !isIdentifierText(expressionText, languageVersion)) { - parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(27 /* SemicolonToken */)); - return; - } - const pos = skipTrivia(sourceText, node.pos); - switch (expressionText) { - case "const": - case "let": - case "var": - parseErrorAt(pos, node.end, Diagnostics.Variable_declaration_not_allowed_at_this_location); - return; - case "declare": - return; - case "interface": - parseErrorForInvalidName(Diagnostics.Interface_name_cannot_be_0, Diagnostics.Interface_must_be_given_a_name, 19 /* OpenBraceToken */); - return; - case "is": - parseErrorAt(pos, scanner2.getTokenStart(), Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - return; - case "module": - case "namespace": - parseErrorForInvalidName(Diagnostics.Namespace_name_cannot_be_0, Diagnostics.Namespace_must_be_given_a_name, 19 /* OpenBraceToken */); - return; - case "type": - parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */); - return; - } - const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, identity) ?? getSpaceSuggestion(expressionText); - if (suggestion) { - parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion); - return; - } - if (token() === 0 /* Unknown */) { - return; - } - parseErrorAt(pos, node.end, Diagnostics.Unexpected_keyword_or_identifier); - } - function parseErrorForInvalidName(nameDiagnostic, blankDiagnostic, tokenIfBlankName) { - if (token() === tokenIfBlankName) { - parseErrorAtCurrentToken(blankDiagnostic); - } else { - parseErrorAtCurrentToken(nameDiagnostic, scanner2.getTokenValue()); - } - } - function getSpaceSuggestion(expressionText) { - for (const keyword of viableKeywordSuggestions) { - if (expressionText.length > keyword.length + 2 && startsWith(expressionText, keyword)) { - return `${keyword} ${expressionText.slice(keyword.length)}`; - } - } - return void 0; - } - function parseSemicolonAfterPropertyName(name, type, initializer) { - if (token() === 60 /* AtToken */ && !scanner2.hasPrecedingLineBreak()) { - parseErrorAtCurrentToken(Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations); - return; - } - if (token() === 21 /* OpenParenToken */) { - parseErrorAtCurrentToken(Diagnostics.Cannot_start_a_function_call_in_a_type_annotation); - nextToken(); - return; - } - if (type && !canParseSemicolon()) { - if (initializer) { - parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(27 /* SemicolonToken */)); - } else { - parseErrorAtCurrentToken(Diagnostics.Expected_for_property_initializer); - } - return; - } - if (tryParseSemicolon()) { - return; - } - if (initializer) { - parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(27 /* SemicolonToken */)); - return; - } - parseErrorForMissingSemicolonAfter(name); - } - function parseExpectedJSDoc(kind) { - if (token() === kind) { - nextTokenJSDoc(); - return true; - } - Debug.assert(isKeywordOrPunctuation(kind)); - parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(kind)); - return false; - } - function parseExpectedMatchingBrackets(openKind, closeKind, openParsed, openPosition) { - if (token() === closeKind) { - nextToken(); - return; - } - const lastError = parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(closeKind)); - if (!openParsed) { - return; - } - if (lastError) { - addRelatedInfo( - lastError, - createDetachedDiagnostic(fileName, sourceText, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind)) - ); - } - } - function parseOptional(t) { - if (token() === t) { - nextToken(); - return true; - } - return false; - } - function parseOptionalToken(t) { - if (token() === t) { - return parseTokenNode(); - } - return void 0; - } - function parseOptionalTokenJSDoc(t) { - if (token() === t) { - return parseTokenNodeJSDoc(); - } - return void 0; - } - function parseExpectedToken(t, diagnosticMessage, arg0) { - return parseOptionalToken(t) || createMissingNode( - t, - /*reportAtCurrentPosition*/ - false, - diagnosticMessage || Diagnostics._0_expected, - arg0 || tokenToString(t) - ); - } - function parseExpectedTokenJSDoc(t) { - const optional = parseOptionalTokenJSDoc(t); - if (optional) return optional; - Debug.assert(isKeywordOrPunctuation(t)); - return createMissingNode( - t, - /*reportAtCurrentPosition*/ - false, - Diagnostics._0_expected, - tokenToString(t) - ); - } - function parseTokenNode() { - const pos = getNodePos(); - const kind = token(); - nextToken(); - return finishNode(factoryCreateToken(kind), pos); - } - function parseTokenNodeJSDoc() { - const pos = getNodePos(); - const kind = token(); - nextTokenJSDoc(); - return finishNode(factoryCreateToken(kind), pos); - } - function canParseSemicolon() { - if (token() === 27 /* SemicolonToken */) { - return true; - } - return token() === 20 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner2.hasPrecedingLineBreak(); - } - function tryParseSemicolon() { - if (!canParseSemicolon()) { - return false; - } - if (token() === 27 /* SemicolonToken */) { - nextToken(); - } - return true; - } - function parseSemicolon() { - return tryParseSemicolon() || parseExpected(27 /* SemicolonToken */); - } - function createNodeArray(elements, pos, end, hasTrailingComma) { - const array = factoryCreateNodeArray(elements, hasTrailingComma); - setTextRangePosEnd(array, pos, end ?? scanner2.getTokenFullStart()); - return array; - } - function finishNode(node, pos, end) { - setTextRangePosEnd(node, pos, end ?? scanner2.getTokenFullStart()); - if (contextFlags) { - node.flags |= contextFlags; - } - if (parseErrorBeforeNextFinishedNode) { - parseErrorBeforeNextFinishedNode = false; - node.flags |= 262144 /* ThisNodeHasError */; - } - return node; - } - function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, ...args) { - if (reportAtCurrentPosition) { - parseErrorAtPosition(scanner2.getTokenFullStart(), 0, diagnosticMessage, ...args); - } else if (diagnosticMessage) { - parseErrorAtCurrentToken(diagnosticMessage, ...args); - } - const pos = getNodePos(); - const result = kind === 80 /* Identifier */ ? factoryCreateIdentifier( - "", - /*originalKeywordKind*/ - void 0 - ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( - kind, - "", - "", - /*templateFlags*/ - void 0 - ) : kind === 9 /* NumericLiteral */ ? factoryCreateNumericLiteral( - "", - /*numericLiteralFlags*/ - void 0 - ) : kind === 11 /* StringLiteral */ ? factoryCreateStringLiteral( - "", - /*isSingleQuote*/ - void 0 - ) : kind === 283 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); - return finishNode(result, pos); - } - function internIdentifier(text) { - let identifier = identifiers.get(text); - if (identifier === void 0) { - identifiers.set(text, identifier = text); - } - return identifier; - } - function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { - if (isIdentifier3) { - identifierCount++; - const pos = scanner2.hasPrecedingJSDocLeadingAsterisks() ? scanner2.getTokenStart() : getNodePos(); - const originalKeywordKind = token(); - const text = internIdentifier(scanner2.getTokenValue()); - const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); - nextTokenWithoutCheck(); - return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); - } - if (token() === 81 /* PrivateIdentifier */) { - parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - return createIdentifier( - /*isIdentifier*/ - true - ); - } - if (token() === 0 /* Unknown */ && scanner2.tryScan(() => scanner2.reScanInvalidIdentifier() === 80 /* Identifier */)) { - return createIdentifier( - /*isIdentifier*/ - true - ); - } - identifierCount++; - const reportAtCurrentPosition = token() === 1 /* EndOfFileToken */; - const isReservedWord = scanner2.isReservedWord(); - const msgArg = scanner2.getTokenText(); - const defaultMessage = isReservedWord ? Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here : Diagnostics.Identifier_expected; - return createMissingNode(80 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg); - } - function parseBindingIdentifier(privateIdentifierDiagnosticMessage) { - return createIdentifier( - isBindingIdentifier(), - /*diagnosticMessage*/ - void 0, - privateIdentifierDiagnosticMessage - ); - } - function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) { - return createIdentifier(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); - } - 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 */ || token() === 10 /* BigIntLiteral */; - } - function isImportAttributeName2() { - return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */; - } - function parsePropertyNameWorker(allowComputedPropertyNames) { - if (token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */ || token() === 10 /* BigIntLiteral */) { - const node = parseLiteralNode(); - node.text = internIdentifier(node.text); - return node; - } - if (allowComputedPropertyNames && token() === 23 /* OpenBracketToken */) { - return parseComputedPropertyName(); - } - if (token() === 81 /* PrivateIdentifier */) { - return parsePrivateIdentifier(); - } - return parseIdentifierName(); - } - function parsePropertyName() { - return parsePropertyNameWorker( - /*allowComputedPropertyNames*/ - true - ); - } - function parseComputedPropertyName() { - const pos = getNodePos(); - parseExpected(23 /* OpenBracketToken */); - const expression = allowInAnd(parseExpression); - parseExpected(24 /* CloseBracketToken */); - return finishNode(factory2.createComputedPropertyName(expression), pos); - } - function parsePrivateIdentifier() { - const pos = getNodePos(); - const node = factoryCreatePrivateIdentifier(internIdentifier(scanner2.getTokenValue())); - nextToken(); - return finishNode(node, pos); - } - function parseContextualModifier(t) { - return token() === t && tryParse(nextTokenCanFollowModifier); - } - function nextTokenIsOnSameLineAndCanFollowModifier() { - nextToken(); - if (scanner2.hasPrecedingLineBreak()) { - return false; - } - return canFollowModifier(); - } - function nextTokenCanFollowModifier() { - switch (token()) { - case 87 /* ConstKeyword */: - return nextToken() === 94 /* EnumKeyword */; - case 95 /* ExportKeyword */: - nextToken(); - if (token() === 90 /* DefaultKeyword */) { - return lookAhead(nextTokenCanFollowDefaultKeyword); - } - if (token() === 156 /* TypeKeyword */) { - return lookAhead(nextTokenCanFollowExportModifier); - } - return canFollowExportModifier(); - case 90 /* DefaultKeyword */: - return nextTokenCanFollowDefaultKeyword(); - case 126 /* StaticKeyword */: - nextToken(); - return canFollowModifier(); - case 139 /* GetKeyword */: - case 153 /* SetKeyword */: - nextToken(); - return canFollowGetOrSetKeyword(); - default: - return nextTokenIsOnSameLineAndCanFollowModifier(); - } - } - function canFollowExportModifier() { - return token() === 60 /* AtToken */ || token() !== 42 /* AsteriskToken */ && token() !== 130 /* AsKeyword */ && token() !== 19 /* OpenBraceToken */ && canFollowModifier(); - } - function nextTokenCanFollowExportModifier() { - nextToken(); - return canFollowExportModifier(); - } - function parseAnyContextualModifier() { - return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier); - } - function canFollowModifier() { - return token() === 23 /* OpenBracketToken */ || token() === 19 /* OpenBraceToken */ || token() === 42 /* AsteriskToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName(); - } - function canFollowGetOrSetKeyword() { - return token() === 23 /* OpenBracketToken */ || isLiteralPropertyName(); - } - function nextTokenCanFollowDefaultKeyword() { - nextToken(); - return token() === 86 /* ClassKeyword */ || token() === 100 /* FunctionKeyword */ || token() === 120 /* InterfaceKeyword */ || token() === 60 /* AtToken */ || token() === 128 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 134 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); - } - function isListElement2(parsingContext2, inErrorRecovery) { - const node = currentNode(parsingContext2); - if (node) { - return true; - } - switch (parsingContext2) { - case 0 /* SourceElements */: - case 1 /* BlockStatements */: - case 3 /* SwitchClauseStatements */: - return !(token() === 27 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); - case 2 /* SwitchClauses */: - return token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */; - case 4 /* TypeMembers */: - return lookAhead(isTypeMemberStart); - case 5 /* ClassMembers */: - return lookAhead(isClassMemberStart) || token() === 27 /* SemicolonToken */ && !inErrorRecovery; - case 6 /* EnumMembers */: - return token() === 23 /* OpenBracketToken */ || isLiteralPropertyName(); - case 12 /* ObjectLiteralMembers */: - switch (token()) { - case 23 /* OpenBracketToken */: - case 42 /* AsteriskToken */: - case 26 /* DotDotDotToken */: - case 25 /* DotToken */: - return true; - default: - return isLiteralPropertyName(); - } - case 18 /* RestProperties */: - return isLiteralPropertyName(); - case 9 /* ObjectBindingElements */: - return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName(); - case 24 /* ImportAttributes */: - return isImportAttributeName2(); - case 7 /* HeritageClauseElement */: - if (token() === 19 /* OpenBraceToken */) { - return lookAhead(isValidHeritageClauseObjectLiteral); - } - if (!inErrorRecovery) { - return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); - } else { - return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); - } - case 8 /* VariableDeclarations */: - return isBindingIdentifierOrPrivateIdentifierOrPattern(); - case 10 /* ArrayBindingElements */: - return token() === 28 /* CommaToken */ || token() === 26 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern(); - case 19 /* TypeParameters */: - return token() === 103 /* InKeyword */ || token() === 87 /* ConstKeyword */ || isIdentifier2(); - case 15 /* ArrayLiteralMembers */: - switch (token()) { - case 28 /* CommaToken */: - case 25 /* DotToken */: - return true; - } - // falls through - case 11 /* ArgumentExpressions */: - return token() === 26 /* DotDotDotToken */ || isStartOfExpression(); - case 16 /* Parameters */: - return isStartOfParameter( - /*isJSDocParameter*/ - false - ); - case 17 /* JSDocParameters */: - return isStartOfParameter( - /*isJSDocParameter*/ - true - ); - case 20 /* TypeArguments */: - case 21 /* TupleElementTypes */: - return token() === 28 /* CommaToken */ || isStartOfType(); - case 22 /* HeritageClauses */: - return isHeritageClause2(); - case 23 /* ImportOrExportSpecifiers */: - if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) { - return false; - } - if (token() === 11 /* StringLiteral */) { - return true; - } - return tokenIsIdentifierOrKeyword(token()); - case 13 /* JsxAttributes */: - return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */; - case 14 /* JsxChildren */: - return true; - case 25 /* JSDocComment */: - return true; - case 26 /* Count */: - return Debug.fail("ParsingContext.Count used as a context"); - // Not a real context, only a marker. - default: - Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'."); - } - } - function isValidHeritageClauseObjectLiteral() { - Debug.assert(token() === 19 /* OpenBraceToken */); - if (nextToken() === 20 /* CloseBraceToken */) { - const next = nextToken(); - return next === 28 /* CommaToken */ || next === 19 /* OpenBraceToken */ || next === 96 /* ExtendsKeyword */ || next === 119 /* ImplementsKeyword */; - } - return true; - } - function nextTokenIsIdentifier() { - nextToken(); - return isIdentifier2(); - } - function nextTokenIsIdentifierOrKeyword() { - nextToken(); - return tokenIsIdentifierOrKeyword(token()); - } - function nextTokenIsIdentifierOrKeywordOrGreaterThan() { - nextToken(); - return tokenIsIdentifierOrKeywordOrGreaterThan(token()); - } - function isHeritageClauseExtendsOrImplementsKeyword() { - if (token() === 119 /* ImplementsKeyword */ || token() === 96 /* ExtendsKeyword */) { - return lookAhead(nextTokenIsStartOfExpression); - } - return false; - } - function nextTokenIsStartOfExpression() { - nextToken(); - return isStartOfExpression(); - } - function nextTokenIsStartOfType() { - nextToken(); - return isStartOfType(); - } - function isListTerminator(kind) { - if (token() === 1 /* EndOfFileToken */) { - return true; - } - switch (kind) { - case 1 /* BlockStatements */: - case 2 /* SwitchClauses */: - case 4 /* TypeMembers */: - case 5 /* ClassMembers */: - case 6 /* EnumMembers */: - case 12 /* ObjectLiteralMembers */: - case 9 /* ObjectBindingElements */: - case 23 /* ImportOrExportSpecifiers */: - case 24 /* ImportAttributes */: - return token() === 20 /* CloseBraceToken */; - case 3 /* SwitchClauseStatements */: - return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */; - case 7 /* HeritageClauseElement */: - return token() === 19 /* OpenBraceToken */ || token() === 96 /* ExtendsKeyword */ || token() === 119 /* ImplementsKeyword */; - case 8 /* VariableDeclarations */: - return isVariableDeclaratorListTerminator(); - case 19 /* TypeParameters */: - return token() === 32 /* GreaterThanToken */ || token() === 21 /* OpenParenToken */ || token() === 19 /* OpenBraceToken */ || token() === 96 /* ExtendsKeyword */ || token() === 119 /* ImplementsKeyword */; - case 11 /* ArgumentExpressions */: - return token() === 22 /* CloseParenToken */ || token() === 27 /* SemicolonToken */; - case 15 /* ArrayLiteralMembers */: - case 21 /* TupleElementTypes */: - case 10 /* ArrayBindingElements */: - return token() === 24 /* CloseBracketToken */; - case 17 /* JSDocParameters */: - case 16 /* Parameters */: - case 18 /* RestProperties */: - return token() === 22 /* CloseParenToken */ || token() === 24 /* CloseBracketToken */; - case 20 /* TypeArguments */: - return token() !== 28 /* CommaToken */; - case 22 /* HeritageClauses */: - return token() === 19 /* OpenBraceToken */ || token() === 20 /* CloseBraceToken */; - case 13 /* JsxAttributes */: - return token() === 32 /* GreaterThanToken */ || token() === 44 /* SlashToken */; - case 14 /* JsxChildren */: - return token() === 30 /* LessThanToken */ && lookAhead(nextTokenIsSlash); - default: - return false; - } - } - function isVariableDeclaratorListTerminator() { - if (canParseSemicolon()) { - return true; - } - if (isInOrOfKeyword(token())) { - return true; - } - if (token() === 39 /* EqualsGreaterThanToken */) { - return true; - } - return false; - } - function isInSomeParsingContext() { - Debug.assert(parsingContext, "Missing parsing context"); - for (let kind = 0; kind < 26 /* Count */; kind++) { - if (parsingContext & 1 << kind) { - if (isListElement2( - kind, - /*inErrorRecovery*/ - true - ) || isListTerminator(kind)) { - return true; - } - } - } - return false; - } - function parseList(kind, parseElement) { - const saveParsingContext = parsingContext; - parsingContext |= 1 << kind; - const list = []; - const listPos = getNodePos(); - while (!isListTerminator(kind)) { - if (isListElement2( - kind, - /*inErrorRecovery*/ - false - )) { - list.push(parseListElement(kind, parseElement)); - continue; - } - if (abortParsingListOrMoveToNextToken(kind)) { - break; - } - } - parsingContext = saveParsingContext; - return createNodeArray(list, listPos); - } - function parseListElement(parsingContext2, parseElement) { - const node = currentNode(parsingContext2); - if (node) { - return consumeNode(node); - } - return parseElement(); - } - function currentNode(parsingContext2, pos) { - var _a; - if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { - return void 0; - } - const node = syntaxCursor.currentNode(pos ?? scanner2.getTokenFullStart()); - if (nodeIsMissing(node) || intersectsIncrementalChange(node) || containsParseError(node)) { - return void 0; - } - const nodeContextFlags = node.flags & 101441536 /* ContextFlags */; - if (nodeContextFlags !== contextFlags) { - return void 0; - } - if (!canReuseNode(node, parsingContext2)) { - return void 0; - } - if (canHaveJSDoc(node) && ((_a = node.jsDoc) == null ? void 0 : _a.jsDocCache)) { - node.jsDoc.jsDocCache = void 0; - } - return node; - } - function consumeNode(node) { - scanner2.resetTokenState(node.end); - nextToken(); - return node; - } - function isReusableParsingContext(parsingContext2) { - switch (parsingContext2) { - case 5 /* ClassMembers */: - case 2 /* SwitchClauses */: - case 0 /* SourceElements */: - case 1 /* BlockStatements */: - case 3 /* SwitchClauseStatements */: - case 6 /* EnumMembers */: - case 4 /* TypeMembers */: - case 8 /* VariableDeclarations */: - case 17 /* JSDocParameters */: - case 16 /* Parameters */: - return true; - } - return false; - } - function canReuseNode(node, parsingContext2) { - switch (parsingContext2) { - case 5 /* ClassMembers */: - return isReusableClassMember(node); - case 2 /* SwitchClauses */: - return isReusableSwitchClause(node); - case 0 /* SourceElements */: - case 1 /* BlockStatements */: - case 3 /* SwitchClauseStatements */: - return isReusableStatement(node); - case 6 /* EnumMembers */: - return isReusableEnumMember(node); - case 4 /* TypeMembers */: - return isReusableTypeMember(node); - case 8 /* VariableDeclarations */: - return isReusableVariableDeclaration(node); - case 17 /* JSDocParameters */: - case 16 /* Parameters */: - return isReusableParameter(node); - } - return false; - } - function isReusableClassMember(node) { - if (node) { - switch (node.kind) { - case 177 /* Constructor */: - case 182 /* IndexSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 173 /* PropertyDeclaration */: - case 241 /* SemicolonClassElement */: - return true; - case 175 /* MethodDeclaration */: - const methodDeclaration = node; - const nameIsConstructor = methodDeclaration.name.kind === 80 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; - return !nameIsConstructor; - } - } - return false; - } - function isReusableSwitchClause(node) { - if (node) { - switch (node.kind) { - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - return true; - } - } - return false; - } - function isReusableStatement(node) { - if (node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 244 /* VariableStatement */: - case 242 /* Block */: - case 246 /* IfStatement */: - case 245 /* ExpressionStatement */: - case 258 /* ThrowStatement */: - case 254 /* ReturnStatement */: - case 256 /* SwitchStatement */: - case 253 /* BreakStatement */: - case 252 /* ContinueStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 249 /* ForStatement */: - case 248 /* WhileStatement */: - case 255 /* WithStatement */: - case 243 /* EmptyStatement */: - case 259 /* TryStatement */: - case 257 /* LabeledStatement */: - case 247 /* DoStatement */: - case 260 /* DebuggerStatement */: - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 279 /* ExportDeclaration */: - case 278 /* ExportAssignment */: - case 268 /* ModuleDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - return true; - } - } - return false; - } - function isReusableEnumMember(node) { - return node.kind === 307 /* EnumMember */; - } - function isReusableTypeMember(node) { - if (node) { - switch (node.kind) { - case 181 /* ConstructSignature */: - case 174 /* MethodSignature */: - case 182 /* IndexSignature */: - case 172 /* PropertySignature */: - case 180 /* CallSignature */: - return true; - } - } - return false; - } - function isReusableVariableDeclaration(node) { - if (node.kind !== 261 /* VariableDeclaration */) { - return false; - } - const variableDeclarator = node; - return variableDeclarator.initializer === void 0; - } - function isReusableParameter(node) { - if (node.kind !== 170 /* Parameter */) { - return false; - } - const parameter = node; - return parameter.initializer === void 0; - } - function abortParsingListOrMoveToNextToken(kind) { - parsingContextErrors(kind); - if (isInSomeParsingContext()) { - return true; - } - nextToken(); - return false; - } - function parsingContextErrors(context) { - switch (context) { - case 0 /* SourceElements */: - return token() === 90 /* DefaultKeyword */ ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(95 /* ExportKeyword */)) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case 1 /* BlockStatements */: - return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); - case 2 /* SwitchClauses */: - return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); - case 3 /* SwitchClauseStatements */: - return parseErrorAtCurrentToken(Diagnostics.Statement_expected); - case 18 /* RestProperties */: - // fallthrough - case 4 /* TypeMembers */: - return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); - case 5 /* ClassMembers */: - return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case 6 /* EnumMembers */: - return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); - case 7 /* HeritageClauseElement */: - return parseErrorAtCurrentToken(Diagnostics.Expression_expected); - case 8 /* VariableDeclarations */: - return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); - case 9 /* ObjectBindingElements */: - return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); - case 10 /* ArrayBindingElements */: - return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); - case 11 /* ArgumentExpressions */: - return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); - case 12 /* ObjectLiteralMembers */: - return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); - case 15 /* ArrayLiteralMembers */: - return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); - case 17 /* JSDocParameters */: - return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case 16 /* Parameters */: - return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); - case 19 /* TypeParameters */: - return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); - case 20 /* TypeArguments */: - return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); - case 21 /* TupleElementTypes */: - return parseErrorAtCurrentToken(Diagnostics.Type_expected); - 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 /* ImportAttributes */: - return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); - case 25 /* JSDocComment */: - return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case 26 /* Count */: - return Debug.fail("ParsingContext.Count used as a context"); - // Not a real context, only a marker. - default: - Debug.assertNever(context); - } - } - function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { - const saveParsingContext = parsingContext; - parsingContext |= 1 << kind; - const list = []; - const listPos = getNodePos(); - let commaStart = -1; - while (true) { - if (isListElement2( - kind, - /*inErrorRecovery*/ - false - )) { - const startPos = scanner2.getTokenFullStart(); - const result = parseListElement(kind, parseElement); - if (!result) { - parsingContext = saveParsingContext; - return void 0; - } - list.push(result); - commaStart = scanner2.getTokenStart(); - if (parseOptional(28 /* CommaToken */)) { - continue; - } - commaStart = -1; - if (isListTerminator(kind)) { - break; - } - parseExpected(28 /* CommaToken */, getExpectedCommaDiagnostic(kind)); - if (considerSemicolonAsDelimiter && token() === 27 /* SemicolonToken */ && !scanner2.hasPrecedingLineBreak()) { - nextToken(); - } - if (startPos === scanner2.getTokenFullStart()) { - nextToken(); - } - continue; - } - if (isListTerminator(kind)) { - break; - } - if (abortParsingListOrMoveToNextToken(kind)) { - break; - } - } - parsingContext = saveParsingContext; - return createNodeArray( - list, - listPos, - /*end*/ - void 0, - commaStart >= 0 - ); - } - function getExpectedCommaDiagnostic(kind) { - return kind === 6 /* EnumMembers */ ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; - } - function createMissingList() { - const list = createNodeArray([], getNodePos()); - list.isMissingList = true; - return list; - } - function isMissingList(arr) { - return !!arr.isMissingList; - } - function parseBracketedList(kind, parseElement, open, close) { - if (parseExpected(open)) { - const result = parseDelimitedList(kind, parseElement); - parseExpected(close); - return result; - } - return createMissingList(); - } - function parseEntityName(allowReservedWords, diagnosticMessage) { - const pos = getNodePos(); - let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); - while (parseOptional(25 /* DotToken */)) { - if (token() === 30 /* LessThanToken */) { - break; - } - entity = finishNode( - factory2.createQualifiedName( - entity, - parseRightSideOfDot( - allowReservedWords, - /*allowPrivateIdentifiers*/ - false, - /*allowUnicodeEscapeSequenceInIdentifierName*/ - true - ) - ), - pos - ); - } - return entity; - } - function createQualifiedName(entity, name) { - return finishNode(factory2.createQualifiedName(entity, name), entity.pos); - } - function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers, allowUnicodeEscapeSequenceInIdentifierName) { - if (scanner2.hasPrecedingLineBreak() && tokenIsIdentifierOrKeyword(token())) { - const matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); - if (matchesPattern) { - return createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - true, - Diagnostics.Identifier_expected - ); - } - } - if (token() === 81 /* PrivateIdentifier */) { - const node = parsePrivateIdentifier(); - return allowPrivateIdentifiers ? node : createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - true, - Diagnostics.Identifier_expected - ); - } - if (allowIdentifierNames) { - return allowUnicodeEscapeSequenceInIdentifierName ? parseIdentifierName() : parseIdentifierNameErrorOnUnicodeEscapeSequence(); - } - return parseIdentifier(); - } - function parseTemplateSpans(isTaggedTemplate) { - const pos = getNodePos(); - const list = []; - let node; - do { - node = parseTemplateSpan(isTaggedTemplate); - list.push(node); - } while (node.literal.kind === 17 /* TemplateMiddle */); - return createNodeArray(list, pos); - } - function parseTemplateExpression(isTaggedTemplate) { - const pos = getNodePos(); - return finishNode( - factory2.createTemplateExpression( - parseTemplateHead(isTaggedTemplate), - parseTemplateSpans(isTaggedTemplate) - ), - pos - ); - } - function parseTemplateType() { - const pos = getNodePos(); - return finishNode( - factory2.createTemplateLiteralType( - parseTemplateHead( - /*isTaggedTemplate*/ - false - ), - parseTemplateTypeSpans() - ), - pos - ); - } - function parseTemplateTypeSpans() { - const pos = getNodePos(); - const list = []; - let node; - do { - node = parseTemplateTypeSpan(); - list.push(node); - } while (node.literal.kind === 17 /* TemplateMiddle */); - return createNodeArray(list, pos); - } - function parseTemplateTypeSpan() { - const pos = getNodePos(); - return finishNode( - factory2.createTemplateLiteralTypeSpan( - parseType(), - parseLiteralOfTemplateSpan( - /*isTaggedTemplate*/ - false - ) - ), - pos - ); - } - function parseLiteralOfTemplateSpan(isTaggedTemplate) { - if (token() === 20 /* CloseBraceToken */) { - reScanTemplateToken(isTaggedTemplate); - return parseTemplateMiddleOrTemplateTail(); - } else { - return parseExpectedToken(18 /* TemplateTail */, Diagnostics._0_expected, tokenToString(20 /* CloseBraceToken */)); - } - } - function parseTemplateSpan(isTaggedTemplate) { - const pos = getNodePos(); - return finishNode( - factory2.createTemplateSpan( - allowInAnd(parseExpression), - parseLiteralOfTemplateSpan(isTaggedTemplate) - ), - pos - ); - } - function parseLiteralNode() { - return parseLiteralLikeNode(token()); - } - function parseTemplateHead(isTaggedTemplate) { - if (!isTaggedTemplate && scanner2.getTokenFlags() & 26656 /* IsInvalid */) { - reScanTemplateToken( - /*isTaggedTemplate*/ - false - ); - } - const fragment = parseLiteralLikeNode(token()); - Debug.assert(fragment.kind === 16 /* TemplateHead */, "Template head has wrong token kind"); - return fragment; - } - function parseTemplateMiddleOrTemplateTail() { - const fragment = parseLiteralLikeNode(token()); - Debug.assert(fragment.kind === 17 /* TemplateMiddle */ || fragment.kind === 18 /* TemplateTail */, "Template fragment has wrong token kind"); - return fragment; - } - function getTemplateLiteralRawText(kind) { - const isLast = kind === 15 /* NoSubstitutionTemplateLiteral */ || kind === 18 /* TemplateTail */; - const tokenText = scanner2.getTokenText(); - return tokenText.substring(1, tokenText.length - (scanner2.isUnterminated() ? 0 : isLast ? 1 : 2)); - } - function parseLiteralLikeNode(kind) { - const pos = getNodePos(); - const node = isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, scanner2.getTokenValue(), getTemplateLiteralRawText(kind), scanner2.getTokenFlags() & 7176 /* TemplateLiteralLikeFlags */) : ( - // Note that theoretically the following condition would hold true literals like 009, - // which is not octal. But because of how the scanner separates the tokens, we would - // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. - // We also do not need to check for negatives because any prefix operator would be part of a - // parent unary expression. - kind === 9 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 11 /* StringLiteral */ ? factoryCreateStringLiteral( - scanner2.getTokenValue(), - /*isSingleQuote*/ - void 0, - scanner2.hasExtendedUnicodeEscape() - ) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() - ); - if (scanner2.hasExtendedUnicodeEscape()) { - node.hasExtendedUnicodeEscape = true; - } - if (scanner2.isUnterminated()) { - node.isUnterminated = true; - } - nextToken(); - return finishNode(node, pos); - } - function parseEntityNameOfTypeReference() { - return parseEntityName( - /*allowReservedWords*/ - true, - Diagnostics.Type_expected - ); - } - function parseTypeArgumentsOfTypeReference() { - if (!scanner2.hasPrecedingLineBreak() && reScanLessThanToken() === 30 /* LessThanToken */) { - return parseBracketedList(20 /* TypeArguments */, parseType, 30 /* LessThanToken */, 32 /* GreaterThanToken */); - } - } - function parseTypeReference() { - const pos = getNodePos(); - return finishNode( - factory2.createTypeReferenceNode( - parseEntityNameOfTypeReference(), - parseTypeArgumentsOfTypeReference() - ), - pos - ); - } - function typeHasArrowFunctionBlockingParseError(node) { - switch (node.kind) { - case 184 /* TypeReference */: - return nodeIsMissing(node.typeName); - case 185 /* FunctionType */: - case 186 /* ConstructorType */: { - const { parameters, type } = node; - return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); - } - case 197 /* ParenthesizedType */: - return typeHasArrowFunctionBlockingParseError(node.type); - default: - return false; - } - } - function parseThisTypePredicate(lhs) { - nextToken(); - return finishNode(factory2.createTypePredicateNode( - /*assertsModifier*/ - void 0, - lhs, - parseType() - ), lhs.pos); - } - function parseThisTypeNode() { - const pos = getNodePos(); - nextToken(); - return finishNode(factory2.createThisTypeNode(), pos); - } - function parseJSDocAllType() { - const pos = getNodePos(); - nextToken(); - return finishNode(factory2.createJSDocAllType(), pos); - } - function parseJSDocNonNullableType() { - const pos = getNodePos(); - nextToken(); - return finishNode(factory2.createJSDocNonNullableType( - parseNonArrayType(), - /*postfix*/ - false - ), pos); - } - function parseJSDocUnknownOrNullableType() { - const pos = getNodePos(); - nextToken(); - if (token() === 28 /* CommaToken */ || token() === 20 /* CloseBraceToken */ || token() === 22 /* CloseParenToken */ || token() === 32 /* GreaterThanToken */ || token() === 64 /* EqualsToken */ || token() === 52 /* BarToken */) { - return finishNode(factory2.createJSDocUnknownType(), pos); - } else { - return finishNode(factory2.createJSDocNullableType( - parseType(), - /*postfix*/ - false - ), pos); - } - } - function parseJSDocFunctionType() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - if (tryParse(nextTokenIsOpenParen)) { - const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - false - ); - return withJSDoc(finishNode(factory2.createJSDocFunctionType(parameters, type), pos), hasJSDoc); - } - return finishNode(factory2.createTypeReferenceNode( - parseIdentifierName(), - /*typeArguments*/ - void 0 - ), pos); - } - function parseJSDocParameter() { - const pos = getNodePos(); - let name; - if (token() === 110 /* ThisKeyword */ || token() === 105 /* NewKeyword */) { - name = parseIdentifierName(); - parseExpected(59 /* ColonToken */); - } - return finishNode( - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - // TODO(rbuckton): JSDoc parameters don't have names (except `this`/`new`), should we manufacture an empty identifier? - name, - /*questionToken*/ - void 0, - parseJSDocType(), - /*initializer*/ - void 0 - ), - pos - ); - } - function parseJSDocType() { - scanner2.setSkipJsDocLeadingAsterisks(true); - const pos = getNodePos(); - if (parseOptional(144 /* ModuleKeyword */)) { - const moduleTag = factory2.createJSDocNamepathType( - /*type*/ - void 0 - ); - terminate: - while (true) { - switch (token()) { - case 20 /* CloseBraceToken */: - case 1 /* EndOfFileToken */: - case 28 /* CommaToken */: - case 5 /* WhitespaceTrivia */: - break terminate; - default: - nextTokenJSDoc(); - } - } - scanner2.setSkipJsDocLeadingAsterisks(false); - return finishNode(moduleTag, pos); - } - const hasDotDotDot = parseOptional(26 /* DotDotDotToken */); - let type = parseTypeOrTypePredicate(); - scanner2.setSkipJsDocLeadingAsterisks(false); - if (hasDotDotDot) { - type = finishNode(factory2.createJSDocVariadicType(type), pos); - } - if (token() === 64 /* EqualsToken */) { - nextToken(); - return finishNode(factory2.createJSDocOptionalType(type), pos); - } - return type; - } - function parseTypeQuery() { - const pos = getNodePos(); - parseExpected(114 /* TypeOfKeyword */); - const entityName = parseEntityName( - /*allowReservedWords*/ - true - ); - const typeArguments = !scanner2.hasPrecedingLineBreak() ? tryParseTypeArguments() : void 0; - return finishNode(factory2.createTypeQueryNode(entityName, typeArguments), pos); - } - function parseTypeParameter() { - const pos = getNodePos(); - const modifiers = parseModifiers( - /*allowDecorators*/ - false, - /*permitConstAsModifier*/ - true - ); - const name = parseIdentifier(); - let constraint; - let expression; - if (parseOptional(96 /* ExtendsKeyword */)) { - if (isStartOfType() || !isStartOfExpression()) { - constraint = parseType(); - } else { - expression = parseUnaryExpressionOrHigher(); - } - } - const defaultType = parseOptional(64 /* EqualsToken */) ? parseType() : void 0; - const node = factory2.createTypeParameterDeclaration(modifiers, name, constraint, defaultType); - node.expression = expression; - return finishNode(node, pos); - } - function parseTypeParameters() { - if (token() === 30 /* LessThanToken */) { - return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 30 /* LessThanToken */, 32 /* GreaterThanToken */); - } - } - function isStartOfParameter(isJSDocParameter) { - return token() === 26 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern() || isModifierKind(token()) || token() === 60 /* AtToken */ || isStartOfType( - /*inStartOfParameter*/ - !isJSDocParameter - ); - } - function parseNameOfParameter(modifiers) { - const name = parseIdentifierOrPattern(Diagnostics.Private_identifiers_cannot_be_used_as_parameters); - if (getFullWidth(name) === 0 && !some(modifiers) && isModifierKind(token())) { - nextToken(); - } - return name; - } - function isParameterNameStart() { - return isBindingIdentifier() || token() === 23 /* OpenBracketToken */ || token() === 19 /* OpenBraceToken */; - } - function parseParameter(inOuterAwaitContext) { - return parseParameterWorker(inOuterAwaitContext); - } - function parseParameterForSpeculation(inOuterAwaitContext) { - return parseParameterWorker( - inOuterAwaitContext, - /*allowAmbiguity*/ - false - ); - } - function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = inOuterAwaitContext ? doInAwaitContext(() => parseModifiers( - /*allowDecorators*/ - true - )) : doOutsideOfAwaitContext(() => parseModifiers( - /*allowDecorators*/ - true - )); - if (token() === 110 /* ThisKeyword */) { - const node2 = factory2.createParameterDeclaration( - modifiers, - /*dotDotDotToken*/ - void 0, - createIdentifier( - /*isIdentifier*/ - true - ), - /*questionToken*/ - void 0, - parseTypeAnnotation(), - /*initializer*/ - void 0 - ); - const modifier = firstOrUndefined(modifiers); - if (modifier) { - parseErrorAtRange(modifier, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); - } - return withJSDoc(finishNode(node2, pos), hasJSDoc); - } - const savedTopLevel = topLevel; - topLevel = false; - const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */); - if (!allowAmbiguity && !isParameterNameStart()) { - return void 0; - } - const node = withJSDoc( - finishNode( - factory2.createParameterDeclaration( - modifiers, - dotDotDotToken, - parseNameOfParameter(modifiers), - parseOptionalToken(58 /* QuestionToken */), - parseTypeAnnotation(), - parseInitializer() - ), - pos - ), - hasJSDoc - ); - topLevel = savedTopLevel; - return node; - } - function parseReturnType(returnToken, isType) { - if (shouldParseReturnType(returnToken, isType)) { - return allowConditionalTypesAnd(parseTypeOrTypePredicate); - } - } - function shouldParseReturnType(returnToken, isType) { - if (returnToken === 39 /* EqualsGreaterThanToken */) { - parseExpected(returnToken); - return true; - } else if (parseOptional(59 /* ColonToken */)) { - return true; - } else if (isType && token() === 39 /* EqualsGreaterThanToken */) { - parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(59 /* ColonToken */)); - nextToken(); - return true; - } - return false; - } - function parseParametersWorker(flags, allowAmbiguity) { - const savedYieldContext = inYieldContext(); - const savedAwaitContext = inAwaitContext(); - setYieldContext(!!(flags & 1 /* Yield */)); - setAwaitContext(!!(flags & 2 /* Await */)); - const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(17 /* JSDocParameters */, parseJSDocParameter) : parseDelimitedList(16 /* Parameters */, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); - setYieldContext(savedYieldContext); - setAwaitContext(savedAwaitContext); - return parameters; - } - function parseParameters(flags) { - if (!parseExpected(21 /* OpenParenToken */)) { - return createMissingList(); - } - const parameters = parseParametersWorker( - flags, - /*allowAmbiguity*/ - true - ); - parseExpected(22 /* CloseParenToken */); - return parameters; - } - function parseTypeMemberSemicolon() { - if (parseOptional(28 /* CommaToken */)) { - return; - } - parseSemicolon(); - } - function parseSignatureMember(kind) { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 181 /* ConstructSignature */) { - parseExpected(105 /* NewKeyword */); - } - const typeParameters = parseTypeParameters(); - const parameters = parseParameters(4 /* Type */); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - true - ); - parseTypeMemberSemicolon(); - const node = kind === 180 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function isIndexSignature() { - return token() === 23 /* OpenBracketToken */ && lookAhead(isUnambiguouslyIndexSignature); - } - function isUnambiguouslyIndexSignature() { - nextToken(); - if (token() === 26 /* DotDotDotToken */ || token() === 24 /* CloseBracketToken */) { - return true; - } - if (isModifierKind(token())) { - nextToken(); - if (isIdentifier2()) { - return true; - } - } else if (!isIdentifier2()) { - return false; - } else { - nextToken(); - } - if (token() === 59 /* ColonToken */ || token() === 28 /* CommaToken */) { - return true; - } - if (token() !== 58 /* QuestionToken */) { - return false; - } - nextToken(); - return token() === 59 /* ColonToken */ || token() === 28 /* CommaToken */ || token() === 24 /* CloseBracketToken */; - } - function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { - const parameters = parseBracketedList(16 /* Parameters */, () => parseParameter( - /*inOuterAwaitContext*/ - false - ), 23 /* OpenBracketToken */, 24 /* CloseBracketToken */); - const type = parseTypeAnnotation(); - parseTypeMemberSemicolon(); - const node = factory2.createIndexSignature(modifiers, parameters, type); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { - const name = parsePropertyName(); - const questionToken = parseOptionalToken(58 /* QuestionToken */); - let node; - if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - const typeParameters = parseTypeParameters(); - const parameters = parseParameters(4 /* Type */); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - true - ); - node = factory2.createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type); - } else { - const type = parseTypeAnnotation(); - node = factory2.createPropertySignature(modifiers, name, questionToken, type); - if (token() === 64 /* EqualsToken */) node.initializer = parseInitializer(); - } - parseTypeMemberSemicolon(); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function isTypeMemberStart() { - if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */ || token() === 139 /* GetKeyword */ || token() === 153 /* SetKeyword */) { - return true; - } - let idToken = false; - while (isModifierKind(token())) { - idToken = true; - nextToken(); - } - if (token() === 23 /* OpenBracketToken */) { - return true; - } - if (isLiteralPropertyName()) { - idToken = true; - nextToken(); - } - if (idToken) { - return token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */ || token() === 58 /* QuestionToken */ || token() === 59 /* ColonToken */ || token() === 28 /* CommaToken */ || canParseSemicolon(); - } - return false; - } - function parseTypeMember() { - if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - return parseSignatureMember(180 /* CallSignature */); - } - if (token() === 105 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(181 /* ConstructSignature */); - } - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers( - /*allowDecorators*/ - false - ); - if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 4 /* Type */); - } - if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 4 /* Type */); - } - if (isIndexSignature()) { - return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); - } - return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); - } - function nextTokenIsOpenParenOrLessThan() { - nextToken(); - return token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */; - } - function nextTokenIsDot() { - return nextToken() === 25 /* DotToken */; - } - function nextTokenIsOpenParenOrLessThanOrDot() { - switch (nextToken()) { - case 21 /* OpenParenToken */: - case 30 /* LessThanToken */: - case 25 /* DotToken */: - return true; - } - return false; - } - function parseTypeLiteral() { - const pos = getNodePos(); - return finishNode(factory2.createTypeLiteralNode(parseObjectTypeMembers()), pos); - } - function parseObjectTypeMembers() { - let members; - if (parseExpected(19 /* OpenBraceToken */)) { - members = parseList(4 /* TypeMembers */, parseTypeMember); - parseExpected(20 /* CloseBraceToken */); - } else { - members = createMissingList(); - } - return members; - } - function isStartOfMappedType() { - nextToken(); - if (token() === 40 /* PlusToken */ || token() === 41 /* MinusToken */) { - return nextToken() === 148 /* ReadonlyKeyword */; - } - if (token() === 148 /* ReadonlyKeyword */) { - nextToken(); - } - return token() === 23 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 103 /* InKeyword */; - } - function parseMappedTypeParameter() { - const pos = getNodePos(); - const name = parseIdentifierName(); - parseExpected(103 /* InKeyword */); - const type = parseType(); - return finishNode(factory2.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - name, - type, - /*defaultType*/ - void 0 - ), pos); - } - function parseMappedType() { - const pos = getNodePos(); - parseExpected(19 /* OpenBraceToken */); - let readonlyToken; - if (token() === 148 /* ReadonlyKeyword */ || token() === 40 /* PlusToken */ || token() === 41 /* MinusToken */) { - readonlyToken = parseTokenNode(); - if (readonlyToken.kind !== 148 /* ReadonlyKeyword */) { - parseExpected(148 /* ReadonlyKeyword */); - } - } - parseExpected(23 /* OpenBracketToken */); - const typeParameter = parseMappedTypeParameter(); - const nameType = parseOptional(130 /* AsKeyword */) ? parseType() : void 0; - parseExpected(24 /* CloseBracketToken */); - let questionToken; - if (token() === 58 /* QuestionToken */ || token() === 40 /* PlusToken */ || token() === 41 /* MinusToken */) { - questionToken = parseTokenNode(); - if (questionToken.kind !== 58 /* QuestionToken */) { - parseExpected(58 /* QuestionToken */); - } - } - const type = parseTypeAnnotation(); - parseSemicolon(); - const members = parseList(4 /* TypeMembers */, parseTypeMember); - parseExpected(20 /* CloseBraceToken */); - return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos); - } - function parseTupleElementType() { - const pos = getNodePos(); - if (parseOptional(26 /* DotDotDotToken */)) { - return finishNode(factory2.createRestTypeNode(parseType()), pos); - } - const type = parseType(); - if (isJSDocNullableType(type) && type.pos === type.type.pos) { - const node = factory2.createOptionalTypeNode(type.type); - setTextRange(node, type); - node.flags = type.flags; - return node; - } - return type; - } - function isNextTokenColonOrQuestionColon() { - return nextToken() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */; - } - function isTupleElementName() { - if (token() === 26 /* DotDotDotToken */) { - return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon(); - } - return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon(); - } - function parseTupleElementNameOrTupleElementType() { - if (lookAhead(isTupleElementName)) { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */); - const name = parseIdentifierName(); - const questionToken = parseOptionalToken(58 /* QuestionToken */); - parseExpected(59 /* ColonToken */); - const type = parseTupleElementType(); - const node = factory2.createNamedTupleMember(dotDotDotToken, name, questionToken, type); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - return parseTupleElementType(); - } - function parseTupleType() { - const pos = getNodePos(); - return finishNode( - factory2.createTupleTypeNode( - parseBracketedList(21 /* TupleElementTypes */, parseTupleElementNameOrTupleElementType, 23 /* OpenBracketToken */, 24 /* CloseBracketToken */) - ), - pos - ); - } - function parseParenthesizedType() { - const pos = getNodePos(); - parseExpected(21 /* OpenParenToken */); - const type = parseType(); - parseExpected(22 /* CloseParenToken */); - return finishNode(factory2.createParenthesizedType(type), pos); - } - function parseModifiersForConstructorType() { - let modifiers; - if (token() === 128 /* AbstractKeyword */) { - const pos = getNodePos(); - nextToken(); - const modifier = finishNode(factoryCreateToken(128 /* AbstractKeyword */), pos); - modifiers = createNodeArray([modifier], pos); - } - return modifiers; - } - function parseFunctionOrConstructorType() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiersForConstructorType(); - const isConstructorType = parseOptional(105 /* NewKeyword */); - Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers."); - const typeParameters = parseTypeParameters(); - const parameters = parseParameters(4 /* Type */); - const type = parseReturnType( - 39 /* EqualsGreaterThanToken */, - /*isType*/ - false - ); - const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseKeywordAndNoDot() { - const node = parseTokenNode(); - return token() === 25 /* DotToken */ ? void 0 : node; - } - function parseLiteralTypeNode(negative) { - const pos = getNodePos(); - if (negative) { - nextToken(); - } - let expression = token() === 112 /* TrueKeyword */ || token() === 97 /* FalseKeyword */ || token() === 106 /* NullKeyword */ ? parseTokenNode() : parseLiteralLikeNode(token()); - if (negative) { - expression = finishNode(factory2.createPrefixUnaryExpression(41 /* MinusToken */, expression), pos); - } - return finishNode(factory2.createLiteralTypeNode(expression), pos); - } - function isStartOfTypeOfImportType() { - nextToken(); - return token() === 102 /* ImportKeyword */; - } - function parseImportType() { - sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */; - const pos = getNodePos(); - const isTypeOf = parseOptional(114 /* TypeOfKeyword */); - parseExpected(102 /* ImportKeyword */); - parseExpected(21 /* OpenParenToken */); - const type = parseType(); - let attributes; - if (parseOptional(28 /* CommaToken */)) { - 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 - ); - parseOptional(28 /* CommaToken */); - 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, attributes, qualifier, typeArguments, isTypeOf), pos); - } - function nextTokenIsNumericOrBigIntLiteral() { - nextToken(); - return token() === 9 /* NumericLiteral */ || token() === 10 /* BigIntLiteral */; - } - function parseNonArrayType() { - switch (token()) { - case 133 /* AnyKeyword */: - case 159 /* UnknownKeyword */: - case 154 /* StringKeyword */: - case 150 /* NumberKeyword */: - case 163 /* BigIntKeyword */: - case 155 /* SymbolKeyword */: - case 136 /* BooleanKeyword */: - case 157 /* UndefinedKeyword */: - case 146 /* NeverKeyword */: - case 151 /* ObjectKeyword */: - return tryParse(parseKeywordAndNoDot) || parseTypeReference(); - case 67 /* AsteriskEqualsToken */: - scanner2.reScanAsteriskEqualsToken(); - // falls through - case 42 /* AsteriskToken */: - return parseJSDocAllType(); - case 61 /* QuestionQuestionToken */: - scanner2.reScanQuestionToken(); - // falls through - case 58 /* QuestionToken */: - return parseJSDocUnknownOrNullableType(); - case 100 /* FunctionKeyword */: - return parseJSDocFunctionType(); - case 54 /* ExclamationToken */: - return parseJSDocNonNullableType(); - case 15 /* NoSubstitutionTemplateLiteral */: - case 11 /* StringLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 106 /* NullKeyword */: - return parseLiteralTypeNode(); - case 41 /* MinusToken */: - return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode( - /*negative*/ - true - ) : parseTypeReference(); - case 116 /* VoidKeyword */: - return parseTokenNode(); - case 110 /* ThisKeyword */: { - const thisKeyword = parseThisTypeNode(); - if (token() === 142 /* IsKeyword */ && !scanner2.hasPrecedingLineBreak()) { - return parseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } - case 114 /* TypeOfKeyword */: - return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery(); - case 19 /* OpenBraceToken */: - return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral(); - case 23 /* OpenBracketToken */: - return parseTupleType(); - case 21 /* OpenParenToken */: - return parseParenthesizedType(); - case 102 /* ImportKeyword */: - return parseImportType(); - case 131 /* AssertsKeyword */: - return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); - case 16 /* TemplateHead */: - return parseTemplateType(); - default: - return parseTypeReference(); - } - } - function isStartOfType(inStartOfParameter) { - switch (token()) { - case 133 /* AnyKeyword */: - case 159 /* UnknownKeyword */: - case 154 /* StringKeyword */: - case 150 /* NumberKeyword */: - case 163 /* BigIntKeyword */: - case 136 /* BooleanKeyword */: - case 148 /* ReadonlyKeyword */: - case 155 /* SymbolKeyword */: - case 158 /* UniqueKeyword */: - case 116 /* VoidKeyword */: - case 157 /* UndefinedKeyword */: - case 106 /* NullKeyword */: - case 110 /* ThisKeyword */: - case 114 /* TypeOfKeyword */: - case 146 /* NeverKeyword */: - case 19 /* OpenBraceToken */: - case 23 /* OpenBracketToken */: - case 30 /* LessThanToken */: - case 52 /* BarToken */: - case 51 /* AmpersandToken */: - case 105 /* NewKeyword */: - case 11 /* StringLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 151 /* ObjectKeyword */: - case 42 /* AsteriskToken */: - case 58 /* QuestionToken */: - case 54 /* ExclamationToken */: - case 26 /* DotDotDotToken */: - case 140 /* InferKeyword */: - case 102 /* ImportKeyword */: - case 131 /* AssertsKeyword */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 16 /* TemplateHead */: - return true; - case 100 /* FunctionKeyword */: - return !inStartOfParameter; - case 41 /* MinusToken */: - return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral); - case 21 /* OpenParenToken */: - return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType); - default: - return isIdentifier2(); - } - } - function isStartOfParenthesizedOrFunctionType() { - nextToken(); - return token() === 22 /* CloseParenToken */ || isStartOfParameter( - /*isJSDocParameter*/ - false - ) || isStartOfType(); - } - function parsePostfixTypeOrHigher() { - const pos = getNodePos(); - let type = parseNonArrayType(); - while (!scanner2.hasPrecedingLineBreak()) { - switch (token()) { - case 54 /* ExclamationToken */: - nextToken(); - type = finishNode(factory2.createJSDocNonNullableType( - type, - /*postfix*/ - true - ), pos); - break; - case 58 /* QuestionToken */: - if (lookAhead(nextTokenIsStartOfType)) { - return type; - } - nextToken(); - type = finishNode(factory2.createJSDocNullableType( - type, - /*postfix*/ - true - ), pos); - break; - case 23 /* OpenBracketToken */: - parseExpected(23 /* OpenBracketToken */); - if (isStartOfType()) { - const indexType = parseType(); - parseExpected(24 /* CloseBracketToken */); - type = finishNode(factory2.createIndexedAccessTypeNode(type, indexType), pos); - } else { - parseExpected(24 /* CloseBracketToken */); - type = finishNode(factory2.createArrayTypeNode(type), pos); - } - break; - default: - return type; - } - } - return type; - } - function parseTypeOperator(operator) { - const pos = getNodePos(); - parseExpected(operator); - return finishNode(factory2.createTypeOperatorNode(operator, parseTypeOperatorOrHigher()), pos); - } - function tryParseConstraintOfInferType() { - if (parseOptional(96 /* ExtendsKeyword */)) { - const constraint = disallowConditionalTypesAnd(parseType); - if (inDisallowConditionalTypesContext() || token() !== 58 /* QuestionToken */) { - return constraint; - } - } - } - function parseTypeParameterOfInferType() { - const pos = getNodePos(); - const name = parseIdentifier(); - const constraint = tryParse(tryParseConstraintOfInferType); - const node = factory2.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - name, - constraint - ); - return finishNode(node, pos); - } - function parseInferType() { - const pos = getNodePos(); - parseExpected(140 /* InferKeyword */); - return finishNode(factory2.createInferTypeNode(parseTypeParameterOfInferType()), pos); - } - function parseTypeOperatorOrHigher() { - const operator = token(); - switch (operator) { - case 143 /* KeyOfKeyword */: - case 158 /* UniqueKeyword */: - case 148 /* ReadonlyKeyword */: - return parseTypeOperator(operator); - case 140 /* InferKeyword */: - return parseInferType(); - } - return allowConditionalTypesAnd(parsePostfixTypeOrHigher); - } - function parseFunctionOrConstructorTypeToError(isInUnionType) { - if (isStartOfFunctionTypeOrConstructorType()) { - const type = parseFunctionOrConstructorType(); - let diagnostic; - if (isFunctionTypeNode(type)) { - diagnostic = isInUnionType ? Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type : Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; - } else { - diagnostic = isInUnionType ? Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type : Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; - } - parseErrorAtRange(type, diagnostic); - return type; - } - return void 0; - } - function parseUnionOrIntersectionType(operator, parseConstituentType, createTypeNode) { - const pos = getNodePos(); - const isUnionType = operator === 52 /* BarToken */; - const hasLeadingOperator = parseOptional(operator); - let type = hasLeadingOperator && parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType(); - if (token() === operator || hasLeadingOperator) { - const types = [type]; - while (parseOptional(operator)) { - types.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType()); - } - type = finishNode(createTypeNode(createNodeArray(types, pos)), pos); - } - return type; - } - function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(51 /* AmpersandToken */, parseTypeOperatorOrHigher, factory2.createIntersectionTypeNode); - } - function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(52 /* BarToken */, parseIntersectionTypeOrHigher, factory2.createUnionTypeNode); - } - function nextTokenIsNewKeyword() { - nextToken(); - return token() === 105 /* NewKeyword */; - } - function isStartOfFunctionTypeOrConstructorType() { - if (token() === 30 /* LessThanToken */) { - return true; - } - if (token() === 21 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType)) { - return true; - } - return token() === 105 /* NewKeyword */ || token() === 128 /* AbstractKeyword */ && lookAhead(nextTokenIsNewKeyword); - } - function skipParameterStart() { - if (isModifierKind(token())) { - parseModifiers( - /*allowDecorators*/ - false - ); - } - if (isIdentifier2() || token() === 110 /* ThisKeyword */) { - nextToken(); - return true; - } - if (token() === 23 /* OpenBracketToken */ || token() === 19 /* OpenBraceToken */) { - const previousErrorCount = parseDiagnostics.length; - parseIdentifierOrPattern(); - return previousErrorCount === parseDiagnostics.length; - } - return false; - } - function isUnambiguouslyStartOfFunctionType() { - nextToken(); - if (token() === 22 /* CloseParenToken */ || token() === 26 /* DotDotDotToken */) { - return true; - } - if (skipParameterStart()) { - if (token() === 59 /* ColonToken */ || token() === 28 /* CommaToken */ || token() === 58 /* QuestionToken */ || token() === 64 /* EqualsToken */) { - return true; - } - if (token() === 22 /* CloseParenToken */) { - nextToken(); - if (token() === 39 /* EqualsGreaterThanToken */) { - return true; - } - } - } - return false; - } - function parseTypeOrTypePredicate() { - const pos = getNodePos(); - const typePredicateVariable = isIdentifier2() && tryParse(parseTypePredicatePrefix); - const type = parseType(); - if (typePredicateVariable) { - return finishNode(factory2.createTypePredicateNode( - /*assertsModifier*/ - void 0, - typePredicateVariable, - type - ), pos); - } else { - return type; - } - } - function parseTypePredicatePrefix() { - const id = parseIdentifier(); - if (token() === 142 /* IsKeyword */ && !scanner2.hasPrecedingLineBreak()) { - nextToken(); - return id; - } - } - function parseAssertsTypePredicate() { - const pos = getNodePos(); - const assertsModifier = parseExpectedToken(131 /* AssertsKeyword */); - const parameterName = token() === 110 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - const type = parseOptional(142 /* IsKeyword */) ? parseType() : void 0; - return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos); - } - function parseType() { - if (contextFlags & 81920 /* TypeExcludesFlags */) { - return doOutsideOfContext(81920 /* TypeExcludesFlags */, parseType); - } - if (isStartOfFunctionTypeOrConstructorType()) { - return parseFunctionOrConstructorType(); - } - const pos = getNodePos(); - const type = parseUnionTypeOrHigher(); - if (!inDisallowConditionalTypesContext() && !scanner2.hasPrecedingLineBreak() && parseOptional(96 /* ExtendsKeyword */)) { - const extendsType = disallowConditionalTypesAnd(parseType); - parseExpected(58 /* QuestionToken */); - const trueType = allowConditionalTypesAnd(parseType); - parseExpected(59 /* ColonToken */); - const falseType = allowConditionalTypesAnd(parseType); - return finishNode(factory2.createConditionalTypeNode(type, extendsType, trueType, falseType), pos); - } - return type; - } - function parseTypeAnnotation() { - return parseOptional(59 /* ColonToken */) ? parseType() : void 0; - } - function isStartOfLeftHandSideExpression() { - switch (token()) { - case 110 /* ThisKeyword */: - case 108 /* SuperKeyword */: - case 106 /* NullKeyword */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 16 /* TemplateHead */: - case 21 /* OpenParenToken */: - case 23 /* OpenBracketToken */: - case 19 /* OpenBraceToken */: - case 100 /* FunctionKeyword */: - case 86 /* ClassKeyword */: - case 105 /* NewKeyword */: - case 44 /* SlashToken */: - case 69 /* SlashEqualsToken */: - case 80 /* Identifier */: - return true; - case 102 /* ImportKeyword */: - return lookAhead(nextTokenIsOpenParenOrLessThanOrDot); - default: - return isIdentifier2(); - } - } - function isStartOfExpression() { - if (isStartOfLeftHandSideExpression()) { - return true; - } - switch (token()) { - case 40 /* PlusToken */: - case 41 /* MinusToken */: - case 55 /* TildeToken */: - case 54 /* ExclamationToken */: - case 91 /* DeleteKeyword */: - case 114 /* TypeOfKeyword */: - case 116 /* VoidKeyword */: - case 46 /* PlusPlusToken */: - case 47 /* MinusMinusToken */: - case 30 /* LessThanToken */: - case 135 /* AwaitKeyword */: - case 127 /* YieldKeyword */: - case 81 /* PrivateIdentifier */: - case 60 /* AtToken */: - return true; - default: - if (isBinaryOperator2()) { - return true; - } - return isIdentifier2(); - } - } - function isStartOfExpressionStatement() { - return token() !== 19 /* OpenBraceToken */ && token() !== 100 /* FunctionKeyword */ && token() !== 86 /* ClassKeyword */ && token() !== 60 /* AtToken */ && isStartOfExpression(); - } - function parseExpression() { - const saveDecoratorContext = inDecoratorContext(); - if (saveDecoratorContext) { - setDecoratorContext( - /*val*/ - false - ); - } - const pos = getNodePos(); - let expr = parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ); - let operatorToken; - while (operatorToken = parseOptionalToken(28 /* CommaToken */)) { - expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ), pos); - } - if (saveDecoratorContext) { - setDecoratorContext( - /*val*/ - true - ); - } - return expr; - } - function parseInitializer() { - return parseOptional(64 /* EqualsToken */) ? parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ) : void 0; - } - function parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) { - if (isYieldExpression2()) { - return parseYieldExpression(); - } - const arrowExpression = tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction); - if (arrowExpression) { - 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 - ); - } - if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { - return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction), pos); - } - return parseConditionalExpressionRest(expr, pos, allowReturnTypeInArrowFunction); - } - function isYieldExpression2() { - if (token() === 127 /* YieldKeyword */) { - if (inYieldContext()) { - return true; - } - return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); - } - return false; - } - function nextTokenIsIdentifierOnSameLine() { - nextToken(); - return !scanner2.hasPrecedingLineBreak() && isIdentifier2(); - } - function parseYieldExpression() { - const pos = getNodePos(); - nextToken(); - if (!scanner2.hasPrecedingLineBreak() && (token() === 42 /* AsteriskToken */ || isStartOfExpression())) { - return finishNode( - factory2.createYieldExpression( - parseOptionalToken(42 /* AsteriskToken */), - parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ) - ), - pos - ); - } else { - return finishNode(factory2.createYieldExpression( - /*asteriskToken*/ - void 0, - /*expression*/ - void 0 - ), pos); - } - } - 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*/ - void 0, - /*dotDotDotToken*/ - void 0, - identifier, - /*questionToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ); - finishNode(parameter, identifier.pos); - const parameters = createNodeArray([parameter], parameter.pos, parameter.end); - const equalsGreaterThanToken = parseExpectedToken(39 /* EqualsGreaterThanToken */); - const body = parseArrowFunctionExpressionBody( - /*isAsync*/ - !!asyncModifier, - allowReturnTypeInArrowFunction - ); - const node = factory2.createArrowFunction( - asyncModifier, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - equalsGreaterThanToken, - body - ); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { - const triState = isParenthesizedArrowFunctionExpression(); - if (triState === 0 /* False */) { - return void 0; - } - return triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpression( - /*allowAmbiguity*/ - true, - /*allowReturnTypeInArrowFunction*/ - true - ) : tryParse(() => parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction)); - } - function isParenthesizedArrowFunctionExpression() { - if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */ || token() === 134 /* AsyncKeyword */) { - return lookAhead(isParenthesizedArrowFunctionExpressionWorker); - } - if (token() === 39 /* EqualsGreaterThanToken */) { - return 1 /* True */; - } - return 0 /* False */; - } - function isParenthesizedArrowFunctionExpressionWorker() { - if (token() === 134 /* AsyncKeyword */) { - nextToken(); - if (scanner2.hasPrecedingLineBreak()) { - return 0 /* False */; - } - if (token() !== 21 /* OpenParenToken */ && token() !== 30 /* LessThanToken */) { - return 0 /* False */; - } - } - const first2 = token(); - const second = nextToken(); - if (first2 === 21 /* OpenParenToken */) { - if (second === 22 /* CloseParenToken */) { - const third = nextToken(); - switch (third) { - case 39 /* EqualsGreaterThanToken */: - case 59 /* ColonToken */: - case 19 /* OpenBraceToken */: - return 1 /* True */; - default: - return 0 /* False */; - } - } - if (second === 23 /* OpenBracketToken */ || second === 19 /* OpenBraceToken */) { - return 2 /* Unknown */; - } - if (second === 26 /* DotDotDotToken */) { - return 1 /* True */; - } - if (isModifierKind(second) && second !== 134 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { - if (nextToken() === 130 /* AsKeyword */) { - return 0 /* False */; - } - return 1 /* True */; - } - if (!isIdentifier2() && second !== 110 /* ThisKeyword */) { - return 0 /* False */; - } - switch (nextToken()) { - case 59 /* ColonToken */: - return 1 /* True */; - case 58 /* QuestionToken */: - nextToken(); - if (token() === 59 /* ColonToken */ || token() === 28 /* CommaToken */ || token() === 64 /* EqualsToken */ || token() === 22 /* CloseParenToken */) { - return 1 /* True */; - } - return 0 /* False */; - case 28 /* CommaToken */: - case 64 /* EqualsToken */: - case 22 /* CloseParenToken */: - return 2 /* Unknown */; - } - return 0 /* False */; - } else { - Debug.assert(first2 === 30 /* LessThanToken */); - if (!isIdentifier2() && token() !== 87 /* ConstKeyword */) { - return 0 /* False */; - } - if (languageVariant === 1 /* JSX */) { - const isArrowFunctionInJsx = lookAhead(() => { - parseOptional(87 /* ConstKeyword */); - const third = nextToken(); - if (third === 96 /* ExtendsKeyword */) { - const fourth = nextToken(); - switch (fourth) { - case 64 /* EqualsToken */: - case 32 /* GreaterThanToken */: - case 44 /* SlashToken */: - return false; - default: - return true; - } - } else if (third === 28 /* CommaToken */ || third === 64 /* EqualsToken */) { - return true; - } - return false; - }); - if (isArrowFunctionInJsx) { - return 1 /* True */; - } - return 0 /* False */; - } - return 2 /* Unknown */; - } - } - function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { - const tokenPos = scanner2.getTokenStart(); - if (notParenthesizedArrow == null ? void 0 : notParenthesizedArrow.has(tokenPos)) { - return void 0; - } - const result = parseParenthesizedArrowFunctionExpression( - /*allowAmbiguity*/ - false, - allowReturnTypeInArrowFunction - ); - if (!result) { - (notParenthesizedArrow || (notParenthesizedArrow = /* @__PURE__ */ new Set())).add(tokenPos); - } - return result; - } - function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { - 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, hasJSDoc, asyncModifier); - } - } - return void 0; - } - function isUnParenthesizedAsyncArrowFunctionWorker() { - if (token() === 134 /* AsyncKeyword */) { - nextToken(); - if (scanner2.hasPrecedingLineBreak() || token() === 39 /* EqualsGreaterThanToken */) { - return 0 /* False */; - } - const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); - if (!scanner2.hasPrecedingLineBreak() && expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) { - return 1 /* True */; - } - } - return 0 /* False */; - } - function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiersForArrowFunction(); - const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; - const typeParameters = parseTypeParameters(); - let parameters; - if (!parseExpected(21 /* OpenParenToken */)) { - if (!allowAmbiguity) { - return void 0; - } - parameters = createMissingList(); - } else { - if (!allowAmbiguity) { - const maybeParameters = parseParametersWorker(isAsync, allowAmbiguity); - if (!maybeParameters) { - return void 0; - } - parameters = maybeParameters; - } else { - parameters = parseParametersWorker(isAsync, allowAmbiguity); - } - if (!parseExpected(22 /* CloseParenToken */) && !allowAmbiguity) { - return void 0; - } - } - const hasReturnColon = token() === 59 /* ColonToken */; - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - false - ); - if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) { - return void 0; - } - let unwrappedType = type; - while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 197 /* ParenthesizedType */) { - unwrappedType = unwrappedType.type; - } - const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType); - if (!allowAmbiguity && token() !== 39 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 19 /* OpenBraceToken */)) { - return void 0; - } - const lastToken = token(); - const equalsGreaterThanToken = parseExpectedToken(39 /* EqualsGreaterThanToken */); - const body = lastToken === 39 /* EqualsGreaterThanToken */ || lastToken === 19 /* OpenBraceToken */ ? parseArrowFunctionExpressionBody(some(modifiers, isAsyncModifier), allowReturnTypeInArrowFunction) : parseIdentifier(); - if (!allowReturnTypeInArrowFunction && hasReturnColon) { - if (token() !== 59 /* ColonToken */) { - return void 0; - } - } - const node = factory2.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseArrowFunctionExpressionBody(isAsync, allowReturnTypeInArrowFunction) { - if (token() === 19 /* OpenBraceToken */) { - return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */); - } - if (token() !== 27 /* SemicolonToken */ && token() !== 100 /* FunctionKeyword */ && token() !== 86 /* ClassKeyword */ && isStartOfStatement() && !isStartOfExpressionStatement()) { - return parseFunctionBlock(16 /* IgnoreMissingOpenBrace */ | (isAsync ? 2 /* Await */ : 0 /* None */)); - } - const savedYieldContext = inYieldContext(); - setYieldContext(false); - const savedTopLevel = topLevel; - topLevel = false; - const node = isAsync ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)) : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)); - topLevel = savedTopLevel; - setYieldContext(savedYieldContext); - return node; - } - function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) { - const questionToken = parseOptionalToken(58 /* QuestionToken */); - if (!questionToken) { - return leftOperand; - } - let colonToken; - return finishNode( - factory2.createConditionalExpression( - leftOperand, - questionToken, - doOutsideOfContext(disallowInAndDecoratorContext, () => parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - false - )), - colonToken = parseExpectedToken(59 /* ColonToken */), - nodeIsPresent(colonToken) ? parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) : createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - false, - Diagnostics._0_expected, - tokenToString(59 /* ColonToken */) - ) - ), - pos - ); - } - function parseBinaryExpressionOrHigher(precedence) { - const pos = getNodePos(); - const leftOperand = parseUnaryExpressionOrHigher(); - return parseBinaryExpressionRest(precedence, leftOperand, pos); - } - function isInOrOfKeyword(t) { - return t === 103 /* InKeyword */ || t === 165 /* OfKeyword */; - } - function parseBinaryExpressionRest(precedence, leftOperand, pos) { - while (true) { - reScanGreaterToken(); - const newPrecedence = getBinaryOperatorPrecedence(token()); - const consumeCurrentOperator = token() === 43 /* AsteriskAsteriskToken */ ? newPrecedence >= precedence : newPrecedence > precedence; - if (!consumeCurrentOperator) { - break; - } - if (token() === 103 /* InKeyword */ && inDisallowInContext()) { - break; - } - if (token() === 130 /* AsKeyword */ || token() === 152 /* SatisfiesKeyword */) { - if (scanner2.hasPrecedingLineBreak()) { - break; - } else { - const keywordKind = token(); - nextToken(); - leftOperand = keywordKind === 152 /* SatisfiesKeyword */ ? makeSatisfiesExpression(leftOperand, parseType()) : makeAsExpression(leftOperand, parseType()); - } - } else { - leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence), pos); - } - } - return leftOperand; - } - function isBinaryOperator2() { - if (inDisallowInContext() && token() === 103 /* InKeyword */) { - return false; - } - return getBinaryOperatorPrecedence(token()) > 0; - } - function makeSatisfiesExpression(left, right) { - return finishNode(factory2.createSatisfiesExpression(left, right), left.pos); - } - function makeBinaryExpression(left, operatorToken, right, pos) { - return finishNode(factory2.createBinaryExpression(left, operatorToken, right), pos); - } - function makeAsExpression(left, right) { - return finishNode(factory2.createAsExpression(left, right), left.pos); - } - function parsePrefixUnaryExpression() { - const pos = getNodePos(); - return finishNode(factory2.createPrefixUnaryExpression(token(), nextTokenAnd(parseSimpleUnaryExpression)), pos); - } - function parseDeleteExpression() { - const pos = getNodePos(); - return finishNode(factory2.createDeleteExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); - } - function parseTypeOfExpression() { - const pos = getNodePos(); - return finishNode(factory2.createTypeOfExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); - } - function parseVoidExpression() { - const pos = getNodePos(); - return finishNode(factory2.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); - } - function isAwaitExpression2() { - if (token() === 135 /* AwaitKeyword */) { - if (inAwaitContext()) { - return true; - } - return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); - } - return false; - } - function parseAwaitExpression() { - const pos = getNodePos(); - return finishNode(factory2.createAwaitExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); - } - function parseUnaryExpressionOrHigher() { - if (isUpdateExpression()) { - const pos = getNodePos(); - const updateExpression = parseUpdateExpression(); - return token() === 43 /* AsteriskAsteriskToken */ ? parseBinaryExpressionRest(getBinaryOperatorPrecedence(token()), updateExpression, pos) : updateExpression; - } - const unaryOperator = token(); - const simpleUnaryExpression = parseSimpleUnaryExpression(); - if (token() === 43 /* AsteriskAsteriskToken */) { - const pos = skipTrivia(sourceText, simpleUnaryExpression.pos); - const { end } = simpleUnaryExpression; - if (simpleUnaryExpression.kind === 217 /* 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)); - parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator)); - } - } - return simpleUnaryExpression; - } - function parseSimpleUnaryExpression() { - switch (token()) { - case 40 /* PlusToken */: - case 41 /* MinusToken */: - case 55 /* TildeToken */: - case 54 /* ExclamationToken */: - return parsePrefixUnaryExpression(); - case 91 /* DeleteKeyword */: - return parseDeleteExpression(); - case 114 /* TypeOfKeyword */: - return parseTypeOfExpression(); - case 116 /* VoidKeyword */: - return parseVoidExpression(); - case 30 /* LessThanToken */: - if (languageVariant === 1 /* JSX */) { - return parseJsxElementOrSelfClosingElementOrFragment( - /*inExpressionContext*/ - true, - /*topInvalidNodePosition*/ - void 0, - /*openingTag*/ - void 0, - /*mustBeUnary*/ - true - ); - } - return parseTypeAssertion(); - case 135 /* AwaitKeyword */: - if (isAwaitExpression2()) { - return parseAwaitExpression(); - } - // falls through - default: - return parseUpdateExpression(); - } - } - function isUpdateExpression() { - switch (token()) { - case 40 /* PlusToken */: - case 41 /* MinusToken */: - case 55 /* TildeToken */: - case 54 /* ExclamationToken */: - case 91 /* DeleteKeyword */: - case 114 /* TypeOfKeyword */: - case 116 /* VoidKeyword */: - case 135 /* AwaitKeyword */: - return false; - case 30 /* LessThanToken */: - if (languageVariant !== 1 /* JSX */) { - return false; - } - // We are in JSX context and the token is part of JSXElement. - // falls through - default: - return true; - } - } - function parseUpdateExpression() { - if (token() === 46 /* PlusPlusToken */ || token() === 47 /* MinusMinusToken */) { - const pos = getNodePos(); - return finishNode(factory2.createPrefixUnaryExpression(token(), nextTokenAnd(parseLeftHandSideExpressionOrHigher)), pos); - } else if (languageVariant === 1 /* JSX */ && token() === 30 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) { - return parseJsxElementOrSelfClosingElementOrFragment( - /*inExpressionContext*/ - true - ); - } - const expression = parseLeftHandSideExpressionOrHigher(); - Debug.assert(isLeftHandSideExpression(expression)); - if ((token() === 46 /* PlusPlusToken */ || token() === 47 /* MinusMinusToken */) && !scanner2.hasPrecedingLineBreak()) { - const operator = token(); - nextToken(); - return finishNode(factory2.createPostfixUnaryExpression(expression, operator), expression.pos); - } - return expression; - } - function parseLeftHandSideExpressionOrHigher() { - const pos = getNodePos(); - let expression; - if (token() === 102 /* ImportKeyword */) { - if (lookAhead(nextTokenIsOpenParenOrLessThan)) { - sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */; - expression = parseTokenNode(); - } else if (lookAhead(nextTokenIsDot)) { - nextToken(); - nextToken(); - expression = finishNode(factory2.createMetaProperty(102 /* ImportKeyword */, parseIdentifierName()), pos); - if (expression.name.escapedText === "defer") { - if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */; - } - } else { - sourceFlags |= 8388608 /* PossiblyContainsImportMeta */; - } - } else { - expression = parseMemberExpressionOrHigher(); - } - } else { - expression = token() === 108 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher(); - } - return parseCallExpressionRest(pos, expression); - } - function parseMemberExpressionOrHigher() { - const pos = getNodePos(); - const expression = parsePrimaryExpression(); - return parseMemberExpressionRest( - pos, - expression, - /*allowOptionalChain*/ - true - ); - } - function parseSuperExpression() { - const pos = getNodePos(); - let expression = parseTokenNode(); - if (token() === 30 /* LessThanToken */) { - const startPos = getNodePos(); - const typeArguments = tryParse(parseTypeArgumentsInExpression); - if (typeArguments !== void 0) { - parseErrorAt(startPos, getNodePos(), Diagnostics.super_may_not_use_type_arguments); - if (!isTemplateStartOfTaggedTemplate()) { - expression = factory2.createExpressionWithTypeArguments(expression, typeArguments); - } - } - } - if (token() === 21 /* OpenParenToken */ || token() === 25 /* DotToken */ || token() === 23 /* OpenBracketToken */) { - return expression; - } - parseExpectedToken(25 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( - /*allowIdentifierNames*/ - true, - /*allowPrivateIdentifiers*/ - true, - /*allowUnicodeEscapeSequenceInIdentifierName*/ - true - )), pos); - } - function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag, mustBeUnary = false) { - const pos = getNodePos(); - const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); - let result; - if (opening.kind === 287 /* JsxOpeningElement */) { - let children = parseJsxChildren(opening); - let closingElement; - const lastChild = children[children.length - 1]; - if ((lastChild == null ? void 0 : lastChild.kind) === 285 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { - const end = lastChild.children.end; - const newLast = finishNode( - factory2.createJsxElement( - lastChild.openingElement, - lastChild.children, - finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end) - ), - lastChild.openingElement.pos, - end - ); - children = createNodeArray([...children.slice(0, children.length - 1), newLast], children.pos, end); - closingElement = lastChild.closingElement; - } else { - closingElement = parseJsxClosingElement(opening, inExpressionContext); - if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { - if (openingTag && isJsxOpeningElement(openingTag) && tagNamesAreEquivalent(closingElement.tagName, openingTag.tagName)) { - parseErrorAtRange(opening.tagName, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, opening.tagName)); - } else { - parseErrorAtRange(closingElement.tagName, Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNodeFromSourceText(sourceText, opening.tagName)); - } - } - } - result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos); - } else if (opening.kind === 290 /* JsxOpeningFragment */) { - result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); - } else { - Debug.assert(opening.kind === 286 /* JsxSelfClosingElement */); - result = opening; - } - if (!mustBeUnary && inExpressionContext && token() === 30 /* LessThanToken */) { - const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; - const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment( - /*inExpressionContext*/ - true, - topBadPos - )); - if (invalidElement) { - const operatorToken = createMissingNode( - 28 /* CommaToken */, - /*reportAtCurrentPosition*/ - false - ); - setTextRangePosWidth(operatorToken, invalidElement.pos, 0); - parseErrorAt(skipTrivia(sourceText, topBadPos), invalidElement.end, Diagnostics.JSX_expressions_must_have_one_parent_element); - return finishNode(factory2.createBinaryExpression(result, operatorToken, invalidElement), pos); - } - } - return result; - } - function parseJsxText() { - const pos = getNodePos(); - const node = factory2.createJsxText(scanner2.getTokenValue(), currentToken === 13 /* JsxTextAllWhiteSpaces */); - currentToken = scanner2.scanJsxToken(); - return finishNode(node, pos); - } - function parseJsxChild(openingTag, token2) { - switch (token2) { - case 1 /* EndOfFileToken */: - if (isJsxOpeningFragment(openingTag)) { - parseErrorAtRange(openingTag, Diagnostics.JSX_fragment_has_no_corresponding_closing_tag); - } else { - const tag = openingTag.tagName; - const start = Math.min(skipTrivia(sourceText, tag.pos), tag.end); - parseErrorAt(start, tag.end, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, openingTag.tagName)); - } - return void 0; - case 31 /* LessThanSlashToken */: - case 7 /* ConflictMarkerTrivia */: - return void 0; - case 12 /* JsxText */: - case 13 /* JsxTextAllWhiteSpaces */: - return parseJsxText(); - case 19 /* OpenBraceToken */: - return parseJsxExpression( - /*inExpressionContext*/ - false - ); - case 30 /* LessThanToken */: - return parseJsxElementOrSelfClosingElementOrFragment( - /*inExpressionContext*/ - false, - /*topInvalidNodePosition*/ - void 0, - openingTag - ); - default: - return Debug.assertNever(token2); - } - } - function parseJsxChildren(openingTag) { - const list = []; - const listPos = getNodePos(); - const saveParsingContext = parsingContext; - parsingContext |= 1 << 14 /* JsxChildren */; - while (true) { - const child = parseJsxChild(openingTag, currentToken = scanner2.reScanJsxToken()); - if (!child) break; - list.push(child); - if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 285 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { - break; - } - } - parsingContext = saveParsingContext; - return createNodeArray(list, listPos); - } - function parseJsxAttributes() { - const pos = getNodePos(); - return finishNode(factory2.createJsxAttributes(parseList(13 /* JsxAttributes */, parseJsxAttribute)), pos); - } - function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { - const pos = getNodePos(); - parseExpected(30 /* LessThanToken */); - if (token() === 32 /* GreaterThanToken */) { - scanJsxText(); - return finishNode(factory2.createJsxOpeningFragment(), pos); - } - const tagName = parseJsxElementName(); - const typeArguments = (contextFlags & 524288 /* JavaScriptFile */) === 0 ? tryParseTypeArguments() : void 0; - const attributes = parseJsxAttributes(); - let node; - if (token() === 32 /* GreaterThanToken */) { - scanJsxText(); - node = factory2.createJsxOpeningElement(tagName, typeArguments, attributes); - } else { - parseExpected(44 /* SlashToken */); - if (parseExpected( - 32 /* GreaterThanToken */, - /*diagnosticMessage*/ - void 0, - /*shouldAdvance*/ - false - )) { - if (inExpressionContext) { - nextToken(); - } else { - scanJsxText(); - } - } - node = factory2.createJsxSelfClosingElement(tagName, typeArguments, attributes); - } - return finishNode(node, pos); - } - function parseJsxElementName() { - const pos = getNodePos(); - const initialExpression = parseJsxTagName(); - if (isJsxNamespacedName(initialExpression)) { - return initialExpression; - } - let expression = initialExpression; - while (parseOptional(25 /* DotToken */)) { - expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( - /*allowIdentifierNames*/ - true, - /*allowPrivateIdentifiers*/ - false, - /*allowUnicodeEscapeSequenceInIdentifierName*/ - false - )), pos); - } - return expression; - } - function parseJsxTagName() { - const pos = getNodePos(); - scanJsxIdentifier(); - const isThis2 = token() === 110 /* ThisKeyword */; - const tagName = parseIdentifierNameErrorOnUnicodeEscapeSequence(); - if (parseOptional(59 /* ColonToken */)) { - scanJsxIdentifier(); - return finishNode(factory2.createJsxNamespacedName(tagName, parseIdentifierNameErrorOnUnicodeEscapeSequence()), pos); - } - return isThis2 ? finishNode(factory2.createToken(110 /* ThisKeyword */), pos) : tagName; - } - function parseJsxExpression(inExpressionContext) { - const pos = getNodePos(); - if (!parseExpected(19 /* OpenBraceToken */)) { - return void 0; - } - let dotDotDotToken; - let expression; - if (token() !== 20 /* CloseBraceToken */) { - if (!inExpressionContext) { - dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */); - } - expression = parseExpression(); - } - if (inExpressionContext) { - parseExpected(20 /* CloseBraceToken */); - } else { - if (parseExpected( - 20 /* CloseBraceToken */, - /*diagnosticMessage*/ - void 0, - /*shouldAdvance*/ - false - )) { - scanJsxText(); - } - } - return finishNode(factory2.createJsxExpression(dotDotDotToken, expression), pos); - } - function parseJsxAttribute() { - if (token() === 19 /* OpenBraceToken */) { - return parseJsxSpreadAttribute(); - } - const pos = getNodePos(); - return finishNode(factory2.createJsxAttribute(parseJsxAttributeName(), parseJsxAttributeValue()), pos); - } - function parseJsxAttributeValue() { - if (token() === 64 /* EqualsToken */) { - if (scanJsxAttributeValue() === 11 /* StringLiteral */) { - return parseLiteralNode(); - } - if (token() === 19 /* OpenBraceToken */) { - return parseJsxExpression( - /*inExpressionContext*/ - true - ); - } - if (token() === 30 /* LessThanToken */) { - return parseJsxElementOrSelfClosingElementOrFragment( - /*inExpressionContext*/ - true - ); - } - parseErrorAtCurrentToken(Diagnostics.or_JSX_element_expected); - } - return void 0; - } - function parseJsxAttributeName() { - const pos = getNodePos(); - scanJsxIdentifier(); - const attrName = parseIdentifierNameErrorOnUnicodeEscapeSequence(); - if (parseOptional(59 /* ColonToken */)) { - scanJsxIdentifier(); - return finishNode(factory2.createJsxNamespacedName(attrName, parseIdentifierNameErrorOnUnicodeEscapeSequence()), pos); - } - return attrName; - } - function parseJsxSpreadAttribute() { - const pos = getNodePos(); - parseExpected(19 /* OpenBraceToken */); - parseExpected(26 /* DotDotDotToken */); - const expression = parseExpression(); - parseExpected(20 /* CloseBraceToken */); - return finishNode(factory2.createJsxSpreadAttribute(expression), pos); - } - function parseJsxClosingElement(open, inExpressionContext) { - const pos = getNodePos(); - parseExpected(31 /* LessThanSlashToken */); - const tagName = parseJsxElementName(); - if (parseExpected( - 32 /* GreaterThanToken */, - /*diagnosticMessage*/ - void 0, - /*shouldAdvance*/ - false - )) { - if (inExpressionContext || !tagNamesAreEquivalent(open.tagName, tagName)) { - nextToken(); - } else { - scanJsxText(); - } - } - return finishNode(factory2.createJsxClosingElement(tagName), pos); - } - function parseJsxClosingFragment(inExpressionContext) { - const pos = getNodePos(); - parseExpected(31 /* LessThanSlashToken */); - if (parseExpected( - 32 /* GreaterThanToken */, - Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, - /*shouldAdvance*/ - false - )) { - if (inExpressionContext) { - nextToken(); - } else { - scanJsxText(); - } - } - return finishNode(factory2.createJsxJsxClosingFragment(), pos); - } - function parseTypeAssertion() { - Debug.assert(languageVariant !== 1 /* JSX */, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments."); - const pos = getNodePos(); - parseExpected(30 /* LessThanToken */); - const type = parseType(); - parseExpected(32 /* GreaterThanToken */); - const expression = parseSimpleUnaryExpression(); - return finishNode(factory2.createTypeAssertion(type, expression), pos); - } - function nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate() { - nextToken(); - return tokenIsIdentifierOrKeyword(token()) || token() === 23 /* OpenBracketToken */ || isTemplateStartOfTaggedTemplate(); - } - function isStartOfOptionalPropertyOrElementAccessChain() { - return token() === 29 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); - } - function tryReparseOptionalChain(node) { - if (node.flags & 64 /* OptionalChain */) { - return true; - } - if (isNonNullExpression(node)) { - let expr = node.expression; - while (isNonNullExpression(expr) && !(expr.flags & 64 /* OptionalChain */)) { - expr = expr.expression; - } - if (expr.flags & 64 /* OptionalChain */) { - while (isNonNullExpression(node)) { - node.flags |= 64 /* OptionalChain */; - node = node.expression; - } - return true; - } - } - return false; - } - function parsePropertyAccessExpressionRest(pos, expression, questionDotToken) { - const name = parseRightSideOfDot( - /*allowIdentifierNames*/ - true, - /*allowPrivateIdentifiers*/ - true, - /*allowUnicodeEscapeSequenceInIdentifierName*/ - true - ); - const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); - const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name); - if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { - parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); - } - if (isExpressionWithTypeArguments(expression) && expression.typeArguments) { - const pos2 = expression.typeArguments.pos - 1; - const end = skipTrivia(sourceText, expression.typeArguments.end) + 1; - parseErrorAt(pos2, end, Diagnostics.An_instantiation_expression_cannot_be_followed_by_a_property_access); - } - return finishNode(propertyAccess, pos); - } - function parseElementAccessExpressionRest(pos, expression, questionDotToken) { - let argumentExpression; - if (token() === 24 /* CloseBracketToken */) { - argumentExpression = createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - true, - Diagnostics.An_element_access_expression_should_take_an_argument - ); - } else { - const argument = allowInAnd(parseExpression); - if (isStringOrNumericLiteralLike(argument)) { - argument.text = internIdentifier(argument.text); - } - argumentExpression = argument; - } - parseExpected(24 /* CloseBracketToken */); - const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression); - return finishNode(indexedAccess, pos); - } - function parseMemberExpressionRest(pos, expression, allowOptionalChain) { - while (true) { - let questionDotToken; - let isPropertyAccess = false; - if (allowOptionalChain && isStartOfOptionalPropertyOrElementAccessChain()) { - questionDotToken = parseExpectedToken(29 /* QuestionDotToken */); - isPropertyAccess = tokenIsIdentifierOrKeyword(token()); - } else { - isPropertyAccess = parseOptional(25 /* DotToken */); - } - if (isPropertyAccess) { - expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken); - continue; - } - if ((questionDotToken || !inDecoratorContext()) && parseOptional(23 /* OpenBracketToken */)) { - expression = parseElementAccessExpressionRest(pos, expression, questionDotToken); - continue; - } - if (isTemplateStartOfTaggedTemplate()) { - expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( - pos, - expression, - questionDotToken, - /*typeArguments*/ - void 0 - ); - continue; - } - if (!questionDotToken) { - if (token() === 54 /* ExclamationToken */ && !scanner2.hasPrecedingLineBreak()) { - nextToken(); - expression = finishNode(factory2.createNonNullExpression(expression), pos); - continue; - } - const typeArguments = tryParse(parseTypeArgumentsInExpression); - if (typeArguments) { - expression = finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); - continue; - } - } - return expression; - } - } - function isTemplateStartOfTaggedTemplate() { - return token() === 15 /* NoSubstitutionTemplateLiteral */ || token() === 16 /* TemplateHead */; - } - function parseTaggedTemplateRest(pos, tag, questionDotToken, typeArguments) { - const tagExpression = factory2.createTaggedTemplateExpression( - tag, - typeArguments, - token() === 15 /* NoSubstitutionTemplateLiteral */ ? (reScanTemplateToken( - /*isTaggedTemplate*/ - true - ), parseLiteralNode()) : parseTemplateExpression( - /*isTaggedTemplate*/ - true - ) - ); - if (questionDotToken || tag.flags & 64 /* OptionalChain */) { - tagExpression.flags |= 64 /* OptionalChain */; - } - tagExpression.questionDotToken = questionDotToken; - return finishNode(tagExpression, pos); - } - function parseCallExpressionRest(pos, expression) { - while (true) { - expression = parseMemberExpressionRest( - pos, - expression, - /*allowOptionalChain*/ - true - ); - let typeArguments; - const questionDotToken = parseOptionalToken(29 /* QuestionDotToken */); - if (questionDotToken) { - typeArguments = tryParse(parseTypeArgumentsInExpression); - if (isTemplateStartOfTaggedTemplate()) { - expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments); - continue; - } - } - if (typeArguments || token() === 21 /* OpenParenToken */) { - if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) { - typeArguments = expression.typeArguments; - expression = expression.expression; - } - const argumentList = parseArgumentList(); - const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList); - expression = finishNode(callExpr, pos); - continue; - } - if (questionDotToken) { - const name = createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - false, - Diagnostics.Identifier_expected - ); - expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos); - } - break; - } - return expression; - } - function parseArgumentList() { - parseExpected(21 /* OpenParenToken */); - const result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); - parseExpected(22 /* CloseParenToken */); - return result; - } - function parseTypeArgumentsInExpression() { - if ((contextFlags & 524288 /* JavaScriptFile */) !== 0) { - return void 0; - } - if (reScanLessThanToken() !== 30 /* LessThanToken */) { - return void 0; - } - nextToken(); - const typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); - if (reScanGreaterToken() !== 32 /* GreaterThanToken */) { - return void 0; - } - nextToken(); - return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : void 0; - } - function canFollowTypeArgumentsInExpression() { - switch (token()) { - // These tokens can follow a type argument list in a call expression. - case 21 /* OpenParenToken */: - // foo( - case 15 /* NoSubstitutionTemplateLiteral */: - // foo `...` - case 16 /* TemplateHead */: - return true; - // A type argument list followed by `<` never makes sense, and a type argument list followed - // by `>` is ambiguous with a (re-scanned) `>>` operator, so we disqualify both. Also, in - // this context, `+` and `-` are unary operators, not binary operators. - case 30 /* LessThanToken */: - case 32 /* GreaterThanToken */: - case 40 /* PlusToken */: - case 41 /* MinusToken */: - return false; - } - return scanner2.hasPrecedingLineBreak() || isBinaryOperator2() || !isStartOfExpression(); - } - function parsePrimaryExpression() { - switch (token()) { - case 15 /* NoSubstitutionTemplateLiteral */: - if (scanner2.getTokenFlags() & 26656 /* IsInvalid */) { - reScanTemplateToken( - /*isTaggedTemplate*/ - false - ); - } - // falls through - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 11 /* StringLiteral */: - return parseLiteralNode(); - case 110 /* ThisKeyword */: - case 108 /* SuperKeyword */: - case 106 /* NullKeyword */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - return parseTokenNode(); - case 21 /* OpenParenToken */: - return parseParenthesizedExpression(); - case 23 /* OpenBracketToken */: - return parseArrayLiteralExpression(); - case 19 /* OpenBraceToken */: - return parseObjectLiteralExpression(); - case 134 /* AsyncKeyword */: - if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) { - break; - } - return parseFunctionExpression(); - case 60 /* AtToken */: - return parseDecoratedExpression(); - case 86 /* ClassKeyword */: - return parseClassExpression(); - case 100 /* FunctionKeyword */: - return parseFunctionExpression(); - case 105 /* NewKeyword */: - return parseNewExpressionOrNewDotTarget(); - case 44 /* SlashToken */: - case 69 /* SlashEqualsToken */: - if (reScanSlashToken() === 14 /* RegularExpressionLiteral */) { - return parseLiteralNode(); - } - break; - case 16 /* TemplateHead */: - return parseTemplateExpression( - /*isTaggedTemplate*/ - false - ); - case 81 /* PrivateIdentifier */: - return parsePrivateIdentifier(); - } - return parseIdentifier(Diagnostics.Expression_expected); - } - function parseParenthesizedExpression() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(21 /* OpenParenToken */); - const expression = allowInAnd(parseExpression); - parseExpected(22 /* CloseParenToken */); - return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc); - } - function parseSpreadElement() { - const pos = getNodePos(); - parseExpected(26 /* DotDotDotToken */); - const expression = parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ); - return finishNode(factory2.createSpreadElement(expression), pos); - } - function parseArgumentOrArrayLiteralElement() { - return token() === 26 /* DotDotDotToken */ ? parseSpreadElement() : token() === 28 /* CommaToken */ ? finishNode(factory2.createOmittedExpression(), getNodePos()) : parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ); - } - function parseArgumentExpression() { - return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); - } - function parseArrayLiteralExpression() { - const pos = getNodePos(); - const openBracketPosition = scanner2.getTokenStart(); - const openBracketParsed = parseExpected(23 /* OpenBracketToken */); - const multiLine = scanner2.hasPrecedingLineBreak(); - const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); - parseExpectedMatchingBrackets(23 /* OpenBracketToken */, 24 /* CloseBracketToken */, openBracketParsed, openBracketPosition); - return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos); - } - function parseObjectLiteralElement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - if (parseOptionalToken(26 /* DotDotDotToken */)) { - const expression = parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ); - return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); - } - const modifiers = parseModifiers( - /*allowDecorators*/ - true - ); - if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 0 /* None */); - } - if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 0 /* None */); - } - const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); - const tokenIsIdentifier = isIdentifier2(); - const name = parsePropertyName(); - const questionToken = parseOptionalToken(58 /* QuestionToken */); - const exclamationToken = parseOptionalToken(54 /* ExclamationToken */); - if (asteriskToken || token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - return parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken); - } - let node; - const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 59 /* ColonToken */; - if (isShorthandPropertyAssignment2) { - const equalsToken = parseOptionalToken(64 /* EqualsToken */); - const objectAssignmentInitializer = equalsToken ? allowInAnd(() => parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - )) : void 0; - node = factory2.createShorthandPropertyAssignment(name, objectAssignmentInitializer); - node.equalsToken = equalsToken; - } else { - parseExpected(59 /* ColonToken */); - const initializer = allowInAnd(() => parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - )); - node = factory2.createPropertyAssignment(name, initializer); - } - node.modifiers = modifiers; - node.questionToken = questionToken; - node.exclamationToken = exclamationToken; - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseObjectLiteralExpression() { - const pos = getNodePos(); - const openBracePosition = scanner2.getTokenStart(); - const openBraceParsed = parseExpected(19 /* OpenBraceToken */); - const multiLine = scanner2.hasPrecedingLineBreak(); - const properties = parseDelimitedList( - 12 /* ObjectLiteralMembers */, - parseObjectLiteralElement, - /*considerSemicolonAsDelimiter*/ - true - ); - parseExpectedMatchingBrackets(19 /* OpenBraceToken */, 20 /* CloseBraceToken */, openBraceParsed, openBracePosition); - return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos); - } - function parseFunctionExpression() { - const savedDecoratorContext = inDecoratorContext(); - setDecoratorContext( - /*val*/ - false - ); - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers( - /*allowDecorators*/ - false - ); - parseExpected(100 /* FunctionKeyword */); - const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); - const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; - const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; - const name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalBindingIdentifier) : isGenerator ? doInYieldContext(parseOptionalBindingIdentifier) : isAsync ? doInAwaitContext(parseOptionalBindingIdentifier) : parseOptionalBindingIdentifier(); - const typeParameters = parseTypeParameters(); - const parameters = parseParameters(isGenerator | isAsync); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - false - ); - const body = parseFunctionBlock(isGenerator | isAsync); - setDecoratorContext(savedDecoratorContext); - const node = factory2.createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseOptionalBindingIdentifier() { - return isBindingIdentifier() ? parseBindingIdentifier() : void 0; - } - function parseNewExpressionOrNewDotTarget() { - const pos = getNodePos(); - parseExpected(105 /* NewKeyword */); - if (parseOptional(25 /* DotToken */)) { - const name = parseIdentifierName(); - return finishNode(factory2.createMetaProperty(105 /* NewKeyword */, name), pos); - } - const expressionPos = getNodePos(); - let expression = parseMemberExpressionRest( - expressionPos, - parsePrimaryExpression(), - /*allowOptionalChain*/ - false - ); - let typeArguments; - if (expression.kind === 234 /* ExpressionWithTypeArguments */) { - typeArguments = expression.typeArguments; - expression = expression.expression; - } - if (token() === 29 /* QuestionDotToken */) { - parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); - } - const argumentList = token() === 21 /* OpenParenToken */ ? parseArgumentList() : void 0; - return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos); - } - function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const openBracePosition = scanner2.getTokenStart(); - const openBraceParsed = parseExpected(19 /* OpenBraceToken */, diagnosticMessage); - if (openBraceParsed || ignoreMissingOpenBrace) { - const multiLine = scanner2.hasPrecedingLineBreak(); - const statements = parseList(1 /* BlockStatements */, parseStatement); - parseExpectedMatchingBrackets(19 /* OpenBraceToken */, 20 /* CloseBraceToken */, openBraceParsed, openBracePosition); - const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc); - if (token() === 64 /* EqualsToken */) { - parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses); - nextToken(); - } - return result; - } else { - const statements = createMissingList(); - return withJSDoc(finishNode(factoryCreateBlock( - statements, - /*multiLine*/ - void 0 - ), pos), hasJSDoc); - } - } - function parseFunctionBlock(flags, diagnosticMessage) { - const savedYieldContext = inYieldContext(); - setYieldContext(!!(flags & 1 /* Yield */)); - const savedAwaitContext = inAwaitContext(); - setAwaitContext(!!(flags & 2 /* Await */)); - const savedTopLevel = topLevel; - topLevel = false; - const saveDecoratorContext = inDecoratorContext(); - if (saveDecoratorContext) { - setDecoratorContext( - /*val*/ - false - ); - } - const block = parseBlock(!!(flags & 16 /* IgnoreMissingOpenBrace */), diagnosticMessage); - if (saveDecoratorContext) { - setDecoratorContext( - /*val*/ - true - ); - } - topLevel = savedTopLevel; - setYieldContext(savedYieldContext); - setAwaitContext(savedAwaitContext); - return block; - } - function parseEmptyStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(27 /* SemicolonToken */); - return withJSDoc(finishNode(factory2.createEmptyStatement(), pos), hasJSDoc); - } - function parseIfStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(101 /* IfKeyword */); - const openParenPosition = scanner2.getTokenStart(); - const openParenParsed = parseExpected(21 /* OpenParenToken */); - const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(21 /* OpenParenToken */, 22 /* CloseParenToken */, openParenParsed, openParenPosition); - const thenStatement = parseStatement(); - const elseStatement = parseOptional(93 /* ElseKeyword */) ? parseStatement() : void 0; - return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); - } - function parseDoStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(92 /* DoKeyword */); - const statement = parseStatement(); - parseExpected(117 /* WhileKeyword */); - const openParenPosition = scanner2.getTokenStart(); - const openParenParsed = parseExpected(21 /* OpenParenToken */); - const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(21 /* OpenParenToken */, 22 /* CloseParenToken */, openParenParsed, openParenPosition); - parseOptional(27 /* SemicolonToken */); - return withJSDoc(finishNode(factory2.createDoStatement(statement, expression), pos), hasJSDoc); - } - function parseWhileStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(117 /* WhileKeyword */); - const openParenPosition = scanner2.getTokenStart(); - const openParenParsed = parseExpected(21 /* OpenParenToken */); - const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(21 /* OpenParenToken */, 22 /* CloseParenToken */, openParenParsed, openParenPosition); - const statement = parseStatement(); - return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc); - } - function parseForOrForInOrForOfStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(99 /* ForKeyword */); - const awaitToken = parseOptionalToken(135 /* AwaitKeyword */); - parseExpected(21 /* OpenParenToken */); - let initializer; - if (token() !== 27 /* SemicolonToken */) { - 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 - ); - } else { - initializer = disallowInAnd(parseExpression); - } - } - let node; - if (awaitToken ? parseExpected(165 /* OfKeyword */) : parseOptional(165 /* OfKeyword */)) { - const expression = allowInAnd(() => parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - )); - parseExpected(22 /* CloseParenToken */); - node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement()); - } else if (parseOptional(103 /* InKeyword */)) { - const expression = allowInAnd(parseExpression); - parseExpected(22 /* CloseParenToken */); - node = factory2.createForInStatement(initializer, expression, parseStatement()); - } else { - parseExpected(27 /* SemicolonToken */); - const condition = token() !== 27 /* SemicolonToken */ && token() !== 22 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; - parseExpected(27 /* SemicolonToken */); - const incrementor = token() !== 22 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; - parseExpected(22 /* CloseParenToken */); - node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement()); - } - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseBreakOrContinueStatement(kind) { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(kind === 253 /* BreakStatement */ ? 83 /* BreakKeyword */ : 88 /* ContinueKeyword */); - const label = canParseSemicolon() ? void 0 : parseIdentifier(); - parseSemicolon(); - const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseReturnStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(107 /* ReturnKeyword */); - const expression = canParseSemicolon() ? void 0 : allowInAnd(parseExpression); - parseSemicolon(); - return withJSDoc(finishNode(factory2.createReturnStatement(expression), pos), hasJSDoc); - } - function parseWithStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(118 /* WithKeyword */); - const openParenPosition = scanner2.getTokenStart(); - const openParenParsed = parseExpected(21 /* OpenParenToken */); - const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(21 /* OpenParenToken */, 22 /* CloseParenToken */, openParenParsed, openParenPosition); - const statement = doInsideOfContext(67108864 /* InWithStatement */, parseStatement); - return withJSDoc(finishNode(factory2.createWithStatement(expression, statement), pos), hasJSDoc); - } - function parseCaseClause() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(84 /* CaseKeyword */); - const expression = allowInAnd(parseExpression); - parseExpected(59 /* ColonToken */); - const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); - return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); - } - function parseDefaultClause() { - const pos = getNodePos(); - parseExpected(90 /* DefaultKeyword */); - parseExpected(59 /* ColonToken */); - const statements = parseList(3 /* SwitchClauseStatements */, parseStatement); - return finishNode(factory2.createDefaultClause(statements), pos); - } - function parseCaseOrDefaultClause() { - return token() === 84 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); - } - function parseCaseBlock() { - const pos = getNodePos(); - parseExpected(19 /* OpenBraceToken */); - const clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); - parseExpected(20 /* CloseBraceToken */); - return finishNode(factory2.createCaseBlock(clauses), pos); - } - function parseSwitchStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(109 /* SwitchKeyword */); - parseExpected(21 /* OpenParenToken */); - const expression = allowInAnd(parseExpression); - parseExpected(22 /* CloseParenToken */); - const caseBlock = parseCaseBlock(); - return withJSDoc(finishNode(factory2.createSwitchStatement(expression, caseBlock), pos), hasJSDoc); - } - function parseThrowStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(111 /* ThrowKeyword */); - let expression = scanner2.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); - if (expression === void 0) { - identifierCount++; - expression = finishNode(factoryCreateIdentifier(""), getNodePos()); - } - if (!tryParseSemicolon()) { - parseErrorForMissingSemicolonAfter(expression); - } - return withJSDoc(finishNode(factory2.createThrowStatement(expression), pos), hasJSDoc); - } - function parseTryStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(113 /* TryKeyword */); - const tryBlock = parseBlock( - /*ignoreMissingOpenBrace*/ - false - ); - const catchClause = token() === 85 /* CatchKeyword */ ? parseCatchClause() : void 0; - let finallyBlock; - if (!catchClause || token() === 98 /* FinallyKeyword */) { - parseExpected(98 /* FinallyKeyword */, Diagnostics.catch_or_finally_expected); - finallyBlock = parseBlock( - /*ignoreMissingOpenBrace*/ - false - ); - } - return withJSDoc(finishNode(factory2.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc); - } - function parseCatchClause() { - const pos = getNodePos(); - parseExpected(85 /* CatchKeyword */); - let variableDeclaration; - if (parseOptional(21 /* OpenParenToken */)) { - variableDeclaration = parseVariableDeclaration(); - parseExpected(22 /* CloseParenToken */); - } else { - variableDeclaration = void 0; - } - const block = parseBlock( - /*ignoreMissingOpenBrace*/ - false - ); - return finishNode(factory2.createCatchClause(variableDeclaration, block), pos); - } - function parseDebuggerStatement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(89 /* DebuggerKeyword */); - parseSemicolon(); - return withJSDoc(finishNode(factory2.createDebuggerStatement(), pos), hasJSDoc); - } - function parseExpressionOrLabeledStatement() { - const pos = getNodePos(); - let hasJSDoc = hasPrecedingJSDocComment(); - let node; - const hasParen = token() === 21 /* OpenParenToken */; - const expression = allowInAnd(parseExpression); - if (isIdentifier(expression) && parseOptional(59 /* ColonToken */)) { - node = factory2.createLabeledStatement(expression, parseStatement()); - } else { - if (!tryParseSemicolon()) { - parseErrorForMissingSemicolonAfter(expression); - } - node = factoryCreateExpressionStatement(expression); - if (hasParen) { - hasJSDoc = false; - } - } - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function nextTokenIsIdentifierOrKeywordOnSameLine() { - nextToken(); - return tokenIsIdentifierOrKeyword(token()) && !scanner2.hasPrecedingLineBreak(); - } - function nextTokenIsClassKeywordOnSameLine() { - nextToken(); - return token() === 86 /* ClassKeyword */ && !scanner2.hasPrecedingLineBreak(); - } - function nextTokenIsFunctionKeywordOnSameLine() { - nextToken(); - return token() === 100 /* FunctionKeyword */ && !scanner2.hasPrecedingLineBreak(); - } - function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() { - nextToken(); - return (tokenIsIdentifierOrKeyword(token()) || token() === 9 /* NumericLiteral */ || token() === 10 /* BigIntLiteral */ || token() === 11 /* StringLiteral */) && !scanner2.hasPrecedingLineBreak(); - } - function isDeclaration2() { - while (true) { - switch (token()) { - case 115 /* VarKeyword */: - case 121 /* LetKeyword */: - case 87 /* ConstKeyword */: - case 100 /* FunctionKeyword */: - case 86 /* ClassKeyword */: - case 94 /* EnumKeyword */: - return true; - case 160 /* UsingKeyword */: - return isUsingDeclaration(); - case 135 /* AwaitKeyword */: - return isAwaitUsingDeclaration(); - // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers; - // however, an identifier cannot be followed by another identifier on the same line. This is what we - // count on to parse out the respective declarations. For instance, we exploit this to say that - // - // namespace n - // - // can be none other than the beginning of a namespace declaration, but need to respect that JavaScript sees - // - // namespace - // n - // - // as the identifier 'namespace' on one line followed by the identifier 'n' on another. - // We need to look one token ahead to see if it permissible to try parsing a declaration. - // - // *Note*: 'interface' is actually a strict mode reserved word. So while - // - // "use strict" - // interface - // I {} - // - // could be legal, it would add complexity for very little gain. - case 120 /* InterfaceKeyword */: - case 156 /* TypeKeyword */: - case 166 /* DeferKeyword */: - return nextTokenIsIdentifierOnSameLine(); - case 144 /* ModuleKeyword */: - case 145 /* NamespaceKeyword */: - return nextTokenIsIdentifierOrStringLiteralOnSameLine(); - case 128 /* AbstractKeyword */: - case 129 /* AccessorKeyword */: - case 134 /* AsyncKeyword */: - case 138 /* DeclareKeyword */: - case 123 /* PrivateKeyword */: - 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 162 /* GlobalKeyword */: - nextToken(); - return token() === 19 /* OpenBraceToken */ || token() === 80 /* Identifier */ || token() === 95 /* ExportKeyword */; - case 102 /* ImportKeyword */: - nextToken(); - return token() === 166 /* DeferKeyword */ || token() === 11 /* StringLiteral */ || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */ || tokenIsIdentifierOrKeyword(token()); - case 95 /* ExportKeyword */: - let currentToken2 = nextToken(); - if (currentToken2 === 156 /* TypeKeyword */) { - currentToken2 = lookAhead(nextToken); - } - if (currentToken2 === 64 /* EqualsToken */ || currentToken2 === 42 /* AsteriskToken */ || currentToken2 === 19 /* OpenBraceToken */ || currentToken2 === 90 /* DefaultKeyword */ || currentToken2 === 130 /* AsKeyword */ || currentToken2 === 60 /* AtToken */) { - return true; - } - continue; - case 126 /* StaticKeyword */: - nextToken(); - continue; - default: - return false; - } - } - } - function isStartOfDeclaration() { - return lookAhead(isDeclaration2); - } - function isStartOfStatement() { - switch (token()) { - case 60 /* AtToken */: - case 27 /* SemicolonToken */: - case 19 /* OpenBraceToken */: - case 115 /* VarKeyword */: - case 121 /* LetKeyword */: - case 160 /* UsingKeyword */: - case 100 /* FunctionKeyword */: - case 86 /* ClassKeyword */: - case 94 /* EnumKeyword */: - case 101 /* IfKeyword */: - case 92 /* DoKeyword */: - case 117 /* WhileKeyword */: - case 99 /* ForKeyword */: - case 88 /* ContinueKeyword */: - case 83 /* BreakKeyword */: - case 107 /* ReturnKeyword */: - case 118 /* WithKeyword */: - case 109 /* SwitchKeyword */: - case 111 /* ThrowKeyword */: - case 113 /* TryKeyword */: - case 89 /* DebuggerKeyword */: - // 'catch' and 'finally' do not actually indicate that the code is part of a statement, - // however, we say they are here so that we may gracefully parse them and error later. - // falls through - case 85 /* CatchKeyword */: - case 98 /* FinallyKeyword */: - return true; - case 102 /* ImportKeyword */: - return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot); - case 87 /* ConstKeyword */: - case 95 /* ExportKeyword */: - return isStartOfDeclaration(); - case 134 /* AsyncKeyword */: - case 138 /* DeclareKeyword */: - case 120 /* InterfaceKeyword */: - case 144 /* ModuleKeyword */: - case 145 /* NamespaceKeyword */: - case 156 /* TypeKeyword */: - case 162 /* GlobalKeyword */: - case 166 /* DeferKeyword */: - return true; - case 129 /* AccessorKeyword */: - case 125 /* PublicKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - case 126 /* StaticKeyword */: - case 148 /* ReadonlyKeyword */: - return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); - default: - return isStartOfExpression(); - } - } - function nextTokenIsBindingIdentifierOrStartOfDestructuring() { - nextToken(); - return isBindingIdentifier() || token() === 19 /* OpenBraceToken */ || token() === 23 /* OpenBracketToken */; - } - function isLetDeclaration() { - return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuring); - } - function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLineDisallowOf() { - return nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine( - /*disallowOf*/ - true - ); - } - function nextTokenIsEqualsOrSemicolonOrColonToken() { - nextToken(); - return token() === 64 /* EqualsToken */ || token() === 27 /* SemicolonToken */ || token() === 59 /* ColonToken */; - } - function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf) { - nextToken(); - if (disallowOf && token() === 165 /* OfKeyword */) { - return lookAhead(nextTokenIsEqualsOrSemicolonOrColonToken); - } - 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 */: - return parseEmptyStatement(); - case 19 /* OpenBraceToken */: - return parseBlock( - /*ignoreMissingOpenBrace*/ - false - ); - case 115 /* VarKeyword */: - return parseVariableStatement( - getNodePos(), - hasPrecedingJSDocComment(), - /*modifiers*/ - void 0 - ); - case 121 /* LetKeyword */: - if (isLetDeclaration()) { - return parseVariableStatement( - getNodePos(), - hasPrecedingJSDocComment(), - /*modifiers*/ - void 0 - ); - } - 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(), - hasPrecedingJSDocComment(), - /*modifiers*/ - void 0 - ); - case 86 /* ClassKeyword */: - return parseClassDeclaration( - getNodePos(), - hasPrecedingJSDocComment(), - /*modifiers*/ - void 0 - ); - case 101 /* IfKeyword */: - return parseIfStatement(); - case 92 /* DoKeyword */: - return parseDoStatement(); - case 117 /* WhileKeyword */: - return parseWhileStatement(); - case 99 /* ForKeyword */: - return parseForOrForInOrForOfStatement(); - case 88 /* ContinueKeyword */: - return parseBreakOrContinueStatement(252 /* ContinueStatement */); - case 83 /* BreakKeyword */: - return parseBreakOrContinueStatement(253 /* BreakStatement */); - case 107 /* ReturnKeyword */: - return parseReturnStatement(); - case 118 /* WithKeyword */: - return parseWithStatement(); - case 109 /* SwitchKeyword */: - return parseSwitchStatement(); - case 111 /* ThrowKeyword */: - return parseThrowStatement(); - case 113 /* TryKeyword */: - // Include 'catch' and 'finally' for error recovery. - // falls through - case 85 /* CatchKeyword */: - case 98 /* FinallyKeyword */: - return parseTryStatement(); - case 89 /* DebuggerKeyword */: - return parseDebuggerStatement(); - case 60 /* AtToken */: - return parseDeclaration(); - case 134 /* AsyncKeyword */: - case 120 /* InterfaceKeyword */: - case 156 /* TypeKeyword */: - case 144 /* ModuleKeyword */: - case 145 /* NamespaceKeyword */: - case 138 /* DeclareKeyword */: - case 87 /* ConstKeyword */: - case 94 /* EnumKeyword */: - case 95 /* ExportKeyword */: - case 102 /* ImportKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - case 125 /* PublicKeyword */: - case 128 /* AbstractKeyword */: - case 129 /* AccessorKeyword */: - case 126 /* StaticKeyword */: - case 148 /* ReadonlyKeyword */: - case 162 /* GlobalKeyword */: - if (isStartOfDeclaration()) { - return parseDeclaration(); - } - break; - } - return parseExpressionOrLabeledStatement(); - } - function isDeclareModifier(modifier) { - return modifier.kind === 138 /* DeclareKeyword */; - } - function parseDeclaration() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers( - /*allowDecorators*/ - true - ); - const isAmbient = some(modifiers, isDeclareModifier); - if (isAmbient) { - const node = tryReuseAmbientDeclaration(pos); - if (node) { - return node; - } - for (const m of modifiers) { - m.flags |= 33554432 /* Ambient */; - } - return doInsideOfContext(33554432 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); - } else { - return parseDeclarationWorker(pos, hasJSDoc, modifiers); - } - } - function tryReuseAmbientDeclaration(pos) { - return doInsideOfContext(33554432 /* Ambient */, () => { - const node = currentNode(parsingContext, pos); - if (node) { - return consumeNode(node); - } - }); - } - function parseDeclarationWorker(pos, hasJSDoc, modifiersIn) { - switch (token()) { - 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); - case 86 /* ClassKeyword */: - return parseClassDeclaration(pos, hasJSDoc, modifiersIn); - case 120 /* InterfaceKeyword */: - return parseInterfaceDeclaration(pos, hasJSDoc, modifiersIn); - case 156 /* TypeKeyword */: - return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); - case 94 /* EnumKeyword */: - return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); - case 162 /* GlobalKeyword */: - case 144 /* ModuleKeyword */: - case 145 /* NamespaceKeyword */: - return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); - case 102 /* ImportKeyword */: - return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiersIn); - case 95 /* ExportKeyword */: - nextToken(); - switch (token()) { - case 90 /* DefaultKeyword */: - case 64 /* EqualsToken */: - return parseExportAssignment(pos, hasJSDoc, modifiersIn); - case 130 /* AsKeyword */: - return parseNamespaceExportDeclaration(pos, hasJSDoc, modifiersIn); - default: - return parseExportDeclaration(pos, hasJSDoc, modifiersIn); - } - default: - if (modifiersIn) { - const missing = createMissingNode( - 283 /* MissingDeclaration */, - /*reportAtCurrentPosition*/ - true, - Diagnostics.Declaration_expected - ); - setTextRangePos(missing, pos); - missing.modifiers = modifiersIn; - return missing; - } - 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 */); - } - function parseFunctionBlockOrSemicolon(flags, diagnosticMessage) { - if (token() !== 19 /* OpenBraceToken */) { - if (flags & 4 /* Type */) { - parseTypeMemberSemicolon(); - return; - } - if (canParseSemicolon()) { - parseSemicolon(); - return; - } - } - return parseFunctionBlock(flags, diagnosticMessage); - } - function parseArrayBindingElement() { - const pos = getNodePos(); - if (token() === 28 /* CommaToken */) { - return finishNode(factory2.createOmittedExpression(), pos); - } - const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */); - const name = parseIdentifierOrPattern(); - const initializer = parseInitializer(); - return finishNode(factory2.createBindingElement( - dotDotDotToken, - /*propertyName*/ - void 0, - name, - initializer - ), pos); - } - function parseObjectBindingElement() { - const pos = getNodePos(); - const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */); - const tokenIsIdentifier = isBindingIdentifier(); - let propertyName = parsePropertyName(); - let name; - if (tokenIsIdentifier && token() !== 59 /* ColonToken */) { - name = propertyName; - propertyName = void 0; - } else { - parseExpected(59 /* ColonToken */); - name = parseIdentifierOrPattern(); - } - const initializer = parseInitializer(); - return finishNode(factory2.createBindingElement(dotDotDotToken, propertyName, name, initializer), pos); - } - function parseObjectBindingPattern() { - const pos = getNodePos(); - parseExpected(19 /* OpenBraceToken */); - 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 = allowInAnd(() => parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement)); - parseExpected(24 /* CloseBracketToken */); - return finishNode(factory2.createArrayBindingPattern(elements), pos); - } - function isBindingIdentifierOrPrivateIdentifierOrPattern() { - return token() === 19 /* OpenBraceToken */ || token() === 23 /* OpenBracketToken */ || token() === 81 /* PrivateIdentifier */ || isBindingIdentifier(); - } - function parseIdentifierOrPattern(privateIdentifierDiagnosticMessage) { - if (token() === 23 /* OpenBracketToken */) { - return parseArrayBindingPattern(); - } - if (token() === 19 /* OpenBraceToken */) { - return parseObjectBindingPattern(); - } - return parseBindingIdentifier(privateIdentifierDiagnosticMessage); - } - function parseVariableDeclarationAllowExclamation() { - return parseVariableDeclaration( - /*allowExclamation*/ - true - ); - } - function parseVariableDeclaration(allowExclamation) { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const name = parseIdentifierOrPattern(Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); - let exclamationToken; - if (allowExclamation && name.kind === 80 /* Identifier */ && token() === 54 /* ExclamationToken */ && !scanner2.hasPrecedingLineBreak()) { - exclamationToken = parseTokenNode(); - } - const type = parseTypeAnnotation(); - const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); - const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseVariableDeclarationList(inForStatementInitializer) { - const pos = getNodePos(); - let flags = 0; - switch (token()) { - case 115 /* VarKeyword */: - break; - case 121 /* LetKeyword */: - flags |= 1 /* Let */; - break; - 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() === 165 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { - declarations = createMissingList(); - } else { - const savedDisallowIn = inDisallowInContext(); - setDisallowInContext(inForStatementInitializer); - declarations = parseDelimitedList( - 8 /* VariableDeclarations */, - inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation - ); - setDisallowInContext(savedDisallowIn); - } - return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos); - } - function canFollowContextualOfKeyword() { - return nextTokenIsIdentifier() && nextToken() === 22 /* CloseParenToken */; - } - function parseVariableStatement(pos, hasJSDoc, modifiers) { - const declarationList = parseVariableDeclarationList( - /*inForStatementInitializer*/ - false - ); - parseSemicolon(); - const node = factoryCreateVariableStatement(modifiers, declarationList); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { - const savedAwaitContext = inAwaitContext(); - const modifierFlags = modifiersToFlags(modifiers); - parseExpected(100 /* FunctionKeyword */); - const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); - const name = modifierFlags & 2048 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier(); - const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; - const isAsync = modifierFlags & 1024 /* Async */ ? 2 /* Await */ : 0 /* None */; - const typeParameters = parseTypeParameters(); - if (modifierFlags & 32 /* Export */) setAwaitContext( - /*value*/ - true - ); - const parameters = parseParameters(isGenerator | isAsync); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - false - ); - const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected); - setAwaitContext(savedAwaitContext); - const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseConstructorName() { - if (token() === 137 /* ConstructorKeyword */) { - return parseExpected(137 /* ConstructorKeyword */); - } - if (token() === 11 /* StringLiteral */ && lookAhead(nextToken) === 21 /* OpenParenToken */) { - return tryParse(() => { - const literalNode = parseLiteralNode(); - return literalNode.text === "constructor" ? literalNode : void 0; - }); - } - } - function tryParseConstructorDeclaration(pos, hasJSDoc, modifiers) { - return tryParse(() => { - if (parseConstructorName()) { - const typeParameters = parseTypeParameters(); - const parameters = parseParameters(0 /* None */); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - false - ); - const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected); - const node = factory2.createConstructorDeclaration(modifiers, parameters, body); - node.typeParameters = typeParameters; - node.type = type; - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - }); - } - function parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { - const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; - const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; - const typeParameters = parseTypeParameters(); - const parameters = parseParameters(isGenerator | isAsync); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - false - ); - const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage); - const node = factory2.createMethodDeclaration( - modifiers, - asteriskToken, - name, - questionToken, - typeParameters, - parameters, - type, - body - ); - node.exclamationToken = exclamationToken; - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken) { - const exclamationToken = !questionToken && !scanner2.hasPrecedingLineBreak() ? parseOptionalToken(54 /* ExclamationToken */) : void 0; - const type = parseTypeAnnotation(); - const initializer = doOutsideOfContext(16384 /* YieldContext */ | 65536 /* AwaitContext */ | 8192 /* DisallowInContext */, parseInitializer); - parseSemicolonAfterPropertyName(name, type, initializer); - const node = factory2.createPropertyDeclaration( - modifiers, - name, - questionToken || exclamationToken, - type, - initializer - ); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers) { - const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); - const name = parsePropertyName(); - const questionToken = parseOptionalToken(58 /* QuestionToken */); - if (asteriskToken || token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - return parseMethodDeclaration( - pos, - hasJSDoc, - modifiers, - asteriskToken, - name, - questionToken, - /*exclamationToken*/ - void 0, - Diagnostics.or_expected - ); - } - return parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken); - } - function parseAccessorDeclaration(pos, hasJSDoc, modifiers, kind, flags) { - const name = parsePropertyName(); - const typeParameters = parseTypeParameters(); - const parameters = parseParameters(0 /* None */); - const type = parseReturnType( - 59 /* ColonToken */, - /*isType*/ - false - ); - const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 178 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); - node.typeParameters = typeParameters; - if (isSetAccessorDeclaration(node)) node.type = type; - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function isClassMemberStart() { - let idToken; - if (token() === 60 /* AtToken */) { - return true; - } - while (isModifierKind(token())) { - idToken = token(); - if (isClassMemberModifier(idToken)) { - return true; - } - nextToken(); - } - if (token() === 42 /* AsteriskToken */) { - return true; - } - if (isLiteralPropertyName()) { - idToken = token(); - nextToken(); - } - if (token() === 23 /* OpenBracketToken */) { - return true; - } - if (idToken !== void 0) { - if (!isKeyword(idToken) || idToken === 153 /* SetKeyword */ || idToken === 139 /* GetKeyword */) { - return true; - } - switch (token()) { - case 21 /* OpenParenToken */: - // Method declaration - case 30 /* LessThanToken */: - // Generic Method declaration - case 54 /* ExclamationToken */: - // Non-null assertion on property name - case 59 /* ColonToken */: - // Type Annotation for declaration - case 64 /* EqualsToken */: - // Initializer for declaration - case 58 /* QuestionToken */: - return true; - default: - return canParseSemicolon(); - } - } - return false; - } - function parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers) { - parseExpectedToken(126 /* StaticKeyword */); - const body = parseClassStaticBlockBody(); - const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); - node.modifiers = modifiers; - return node; - } - function parseClassStaticBlockBody() { - const savedYieldContext = inYieldContext(); - const savedAwaitContext = inAwaitContext(); - setYieldContext(false); - setAwaitContext(true); - const body = parseBlock( - /*ignoreMissingOpenBrace*/ - false - ); - setYieldContext(savedYieldContext); - setAwaitContext(savedAwaitContext); - return body; - } - function parseDecoratorExpression() { - if (inAwaitContext() && token() === 135 /* AwaitKeyword */) { - const pos = getNodePos(); - const awaitExpression = parseIdentifier(Diagnostics.Expression_expected); - nextToken(); - const memberExpression = parseMemberExpressionRest( - pos, - awaitExpression, - /*allowOptionalChain*/ - true - ); - return parseCallExpressionRest(pos, memberExpression); - } - return parseLeftHandSideExpressionOrHigher(); - } - function tryParseDecorator() { - const pos = getNodePos(); - if (!parseOptional(60 /* AtToken */)) { - return void 0; - } - const expression = doInDecoratorContext(parseDecoratorExpression); - return finishNode(factory2.createDecorator(expression), pos); - } - function tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock) { - const pos = getNodePos(); - const kind = token(); - if (token() === 87 /* ConstKeyword */ && permitConstAsModifier) { - if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { - return void 0; - } - } else if (stopOnStartOfClassStaticBlock && token() === 126 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { - return void 0; - } else if (hasSeenStaticModifier && token() === 126 /* StaticKeyword */) { - return void 0; - } else { - if (!parseAnyContextualModifier()) { - return void 0; - } - } - return finishNode(factoryCreateToken(kind), pos); - } - function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { - const pos = getNodePos(); - let list; - let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false; - if (allowDecorators && token() === 60 /* AtToken */) { - while (decorator = tryParseDecorator()) { - list = append(list, decorator); - } - } - while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { - if (modifier.kind === 126 /* StaticKeyword */) hasSeenStaticModifier = true; - list = append(list, modifier); - hasLeadingModifier = true; - } - if (hasLeadingModifier && allowDecorators && token() === 60 /* AtToken */) { - while (decorator = tryParseDecorator()) { - list = append(list, decorator); - hasTrailingDecorator = true; - } - } - if (hasTrailingDecorator) { - while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { - if (modifier.kind === 126 /* StaticKeyword */) hasSeenStaticModifier = true; - list = append(list, modifier); - } - } - return list && createNodeArray(list, pos); - } - function parseModifiersForArrowFunction() { - let modifiers; - if (token() === 134 /* AsyncKeyword */) { - const pos = getNodePos(); - nextToken(); - const modifier = finishNode(factoryCreateToken(134 /* AsyncKeyword */), pos); - modifiers = createNodeArray([modifier], pos); - } - return modifiers; - } - function parseClassElement() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - if (token() === 27 /* SemicolonToken */) { - nextToken(); - return withJSDoc(finishNode(factory2.createSemicolonClassElement(), pos), hasJSDoc); - } - const modifiers = parseModifiers( - /*allowDecorators*/ - true, - /*permitConstAsModifier*/ - true, - /*stopOnStartOfClassStaticBlock*/ - true - ); - if (token() === 126 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { - return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); - } - if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 0 /* None */); - } - if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 0 /* None */); - } - if (token() === 137 /* ConstructorKeyword */ || token() === 11 /* StringLiteral */) { - const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); - if (constructorDeclaration) { - return constructorDeclaration; - } - } - if (isIndexSignature()) { - return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); - } - if (tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */ || token() === 10 /* BigIntLiteral */ || token() === 42 /* AsteriskToken */ || token() === 23 /* OpenBracketToken */) { - const isAmbient = some(modifiers, isDeclareModifier); - if (isAmbient) { - for (const m of modifiers) { - m.flags |= 33554432 /* Ambient */; - } - return doInsideOfContext(33554432 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); - } else { - return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); - } - } - if (modifiers) { - const name = createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - true, - Diagnostics.Declaration_expected - ); - return parsePropertyDeclaration( - pos, - hasJSDoc, - modifiers, - name, - /*questionToken*/ - void 0 - ); - } - return Debug.fail("Should not have attempted to parse class member declaration."); - } - function parseDecoratedExpression() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const modifiers = parseModifiers( - /*allowDecorators*/ - true - ); - if (token() === 86 /* ClassKeyword */) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 232 /* ClassExpression */); - } - const missing = createMissingNode( - 283 /* MissingDeclaration */, - /*reportAtCurrentPosition*/ - true, - Diagnostics.Expression_expected - ); - setTextRangePos(missing, pos); - missing.modifiers = modifiers; - return missing; - } - function parseClassExpression() { - return parseClassDeclarationOrExpression( - getNodePos(), - hasPrecedingJSDocComment(), - /*modifiers*/ - void 0, - 232 /* ClassExpression */ - ); - } - function parseClassDeclaration(pos, hasJSDoc, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 264 /* ClassDeclaration */); - } - function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { - const savedAwaitContext = inAwaitContext(); - parseExpected(86 /* ClassKeyword */); - const name = parseNameOfClassDeclarationOrExpression(); - const typeParameters = parseTypeParameters(); - if (some(modifiers, isExportModifier)) setAwaitContext( - /*value*/ - true - ); - const heritageClauses = parseHeritageClauses(); - let members; - if (parseExpected(19 /* OpenBraceToken */)) { - members = parseClassMembers(); - parseExpected(20 /* CloseBraceToken */); - } else { - members = createMissingList(); - } - setAwaitContext(savedAwaitContext); - const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseNameOfClassDeclarationOrExpression() { - return isBindingIdentifier() && !isImplementsClause() ? createIdentifier(isBindingIdentifier()) : void 0; - } - function isImplementsClause() { - return token() === 119 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); - } - function parseHeritageClauses() { - if (isHeritageClause2()) { - return parseList(22 /* HeritageClauses */, parseHeritageClause); - } - return void 0; - } - function parseHeritageClause() { - const pos = getNodePos(); - const tok = token(); - Debug.assert(tok === 96 /* ExtendsKeyword */ || tok === 119 /* ImplementsKeyword */); - nextToken(); - const types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); - return finishNode(factory2.createHeritageClause(tok, types), pos); - } - function parseExpressionWithTypeArguments() { - const pos = getNodePos(); - const expression = parseLeftHandSideExpressionOrHigher(); - if (expression.kind === 234 /* ExpressionWithTypeArguments */) { - return expression; - } - const typeArguments = tryParseTypeArguments(); - return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); - } - function tryParseTypeArguments() { - return token() === 30 /* LessThanToken */ ? parseBracketedList(20 /* TypeArguments */, parseType, 30 /* LessThanToken */, 32 /* GreaterThanToken */) : void 0; - } - function isHeritageClause2() { - return token() === 96 /* ExtendsKeyword */ || token() === 119 /* ImplementsKeyword */; - } - function parseClassMembers() { - return parseList(5 /* ClassMembers */, parseClassElement); - } - function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { - parseExpected(120 /* InterfaceKeyword */); - const name = parseIdentifier(); - const typeParameters = parseTypeParameters(); - const heritageClauses = parseHeritageClauses(); - const members = parseObjectTypeMembers(); - const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - 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 */); - const type = token() === 141 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); - parseSemicolon(); - const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseEnumMember() { - const pos = getNodePos(); - const hasJSDoc = hasPrecedingJSDocComment(); - const name = parsePropertyName(); - const initializer = allowInAnd(parseInitializer); - return withJSDoc(finishNode(factory2.createEnumMember(name, initializer), pos), hasJSDoc); - } - function parseEnumDeclaration(pos, hasJSDoc, modifiers) { - parseExpected(94 /* EnumKeyword */); - const name = parseIdentifier(); - let members; - if (parseExpected(19 /* OpenBraceToken */)) { - members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(6 /* EnumMembers */, parseEnumMember)); - parseExpected(20 /* CloseBraceToken */); - } else { - members = createMissingList(); - } - const node = factory2.createEnumDeclaration(modifiers, name, members); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseModuleBlock() { - const pos = getNodePos(); - let statements; - if (parseExpected(19 /* OpenBraceToken */)) { - statements = parseList(1 /* BlockStatements */, parseStatement); - parseExpected(20 /* CloseBraceToken */); - } else { - statements = createMissingList(); - } - return finishNode(factory2.createModuleBlock(statements), pos); - } - function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { - const namespaceFlag = flags & 32 /* Namespace */; - const name = flags & 8 /* NestedNamespace */ ? parseIdentifierName() : parseIdentifier(); - const body = parseOptional(25 /* DotToken */) ? parseModuleOrNamespaceDeclaration( - getNodePos(), - /*hasJSDoc*/ - false, - /*modifiers*/ - void 0, - 8 /* NestedNamespace */ | namespaceFlag - ) : parseModuleBlock(); - const node = factory2.createModuleDeclaration(modifiers, name, body, flags); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { - let flags = 0; - let name; - if (token() === 162 /* GlobalKeyword */) { - name = parseIdentifier(); - flags |= 2048 /* GlobalAugmentation */; - } else { - name = parseLiteralNode(); - name.text = internIdentifier(name.text); - } - let body; - if (token() === 19 /* OpenBraceToken */) { - body = parseModuleBlock(); - } else { - parseSemicolon(); - } - const node = factory2.createModuleDeclaration(modifiersIn, name, body, flags); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { - let flags = 0; - if (token() === 162 /* GlobalKeyword */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); - } else if (parseOptional(145 /* NamespaceKeyword */)) { - flags |= 32 /* Namespace */; - } else { - parseExpected(144 /* ModuleKeyword */); - if (token() === 11 /* StringLiteral */) { - return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); - } - } - return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiersIn, flags); - } - function isExternalModuleReference2() { - return token() === 149 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); - } - function nextTokenIsOpenParen() { - return nextToken() === 21 /* OpenParenToken */; - } - function nextTokenIsOpenBrace() { - return nextToken() === 19 /* OpenBraceToken */; - } - function nextTokenIsSlash() { - return nextToken() === 44 /* SlashToken */; - } - function parseNamespaceExportDeclaration(pos, hasJSDoc, modifiers) { - parseExpected(130 /* AsKeyword */); - parseExpected(145 /* NamespaceKeyword */); - const name = parseIdentifier(); - parseSemicolon(); - const node = factory2.createNamespaceExportDeclaration(name); - node.modifiers = modifiers; - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) { - parseExpected(102 /* ImportKeyword */); - const afterImportPos = scanner2.getTokenFullStart(); - let identifier; - if (isIdentifier2()) { - identifier = parseIdentifier(); - } - let phaseModifier; - if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 /* FromKeyword */ || isIdentifier2() && lookAhead(nextTokenIsFromKeywordOrEqualsToken)) && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) { - phaseModifier = 156 /* TypeKeyword */; - identifier = isIdentifier2() ? parseIdentifier() : void 0; - } else if ((identifier == null ? void 0 : identifier.escapedText) === "defer" && (token() === 161 /* FromKeyword */ ? !lookAhead(nextTokenIsStringLiteral) : token() !== 28 /* CommaToken */ && token() !== 64 /* EqualsToken */)) { - phaseModifier = 166 /* DeferKeyword */; - identifier = isIdentifier2() ? parseIdentifier() : void 0; - } - if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() && phaseModifier !== 166 /* DeferKeyword */) { - return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, phaseModifier === 156 /* TypeKeyword */); - } - const importClause = tryParseImportClause( - identifier, - afterImportPos, - phaseModifier, - /*skipJsDocLeadingAsterisks*/ - void 0 - ); - const moduleSpecifier = parseModuleSpecifier(); - const attributes = tryParseImportAttributes(); - parseSemicolon(); - const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function tryParseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks = false) { - let importClause; - if (identifier || // import id - token() === 42 /* AsteriskToken */ || // import * - token() === 19 /* OpenBraceToken */) { - importClause = parseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks); - parseExpected(161 /* FromKeyword */); - } - return importClause; - } - function tryParseImportAttributes() { - const currentToken2 = token(); - if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) { - return parseImportAttributes(currentToken2); - } - } - function parseImportAttribute() { - const pos = getNodePos(); - const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */); - parseExpected(59 /* ColonToken */); - const value = parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ); - return finishNode(factory2.createImportAttribute(name, value), pos); - } - function parseImportAttributes(token2, skipKeyword) { - const pos = getNodePos(); - if (!skipKeyword) { - parseExpected(token2); - } - const openBracePosition = scanner2.getTokenStart(); - if (parseExpected(19 /* OpenBraceToken */)) { - const multiLine = scanner2.hasPrecedingLineBreak(); - const elements = parseDelimitedList( - 24 /* ImportAttributes */, - parseImportAttribute, - /*considerSemicolonAsDelimiter*/ - 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, "{", "}") - ); - } - } - return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos); - } else { - const elements = createNodeArray( - [], - getNodePos(), - /*end*/ - void 0, - /*hasTrailingComma*/ - false - ); - return finishNode(factory2.createImportAttributes( - elements, - /*multiLine*/ - false, - token2 - ), pos); - } - } - function tokenAfterImportDefinitelyProducesImportDeclaration() { - return token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */; - } - function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { - return token() === 28 /* CommaToken */ || token() === 161 /* FromKeyword */; - } - function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { - parseExpected(64 /* EqualsToken */); - const moduleReference = parseModuleReference(); - parseSemicolon(); - const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); - const finished = withJSDoc(finishNode(node, pos), hasJSDoc); - return finished; - } - function parseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks) { - let namedBindings; - if (!identifier || parseOptional(28 /* CommaToken */)) { - if (skipJsDocLeadingAsterisks) scanner2.setSkipJsDocLeadingAsterisks(true); - if (token() === 42 /* AsteriskToken */) { - namedBindings = parseNamespaceImport(); - } else { - namedBindings = parseNamedImportsOrExports(276 /* NamedImports */); - } - if (skipJsDocLeadingAsterisks) scanner2.setSkipJsDocLeadingAsterisks(false); - } - return finishNode(factory2.createImportClause(phaseModifier, identifier, namedBindings), pos); - } - function parseModuleReference() { - return isExternalModuleReference2() ? parseExternalModuleReference() : parseEntityName( - /*allowReservedWords*/ - false - ); - } - function parseExternalModuleReference() { - const pos = getNodePos(); - parseExpected(149 /* RequireKeyword */); - parseExpected(21 /* OpenParenToken */); - const expression = parseModuleSpecifier(); - parseExpected(22 /* CloseParenToken */); - return finishNode(factory2.createExternalModuleReference(expression), pos); - } - function parseModuleSpecifier() { - if (token() === 11 /* StringLiteral */) { - const result = parseLiteralNode(); - result.text = internIdentifier(result.text); - return result; - } else { - return parseExpression(); - } - } - function parseNamespaceImport() { - const pos = getNodePos(); - parseExpected(42 /* AsteriskToken */); - parseExpected(130 /* AsKeyword */); - const name = parseIdentifier(); - return finishNode(factory2.createNamespaceImport(name), pos); - } - function canParseModuleExportName() { - return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */; - } - function parseModuleExportName(parseName) { - return token() === 11 /* StringLiteral */ ? parseLiteralNode() : parseName(); - } - function parseNamedImportsOrExports(kind) { - const pos = getNodePos(); - const node = kind === 276 /* 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(282 /* ExportSpecifier */), hasJSDoc); - } - function parseImportSpecifier() { - return parseImportOrExportSpecifier(277 /* ImportSpecifier */); - } - function parseImportOrExportSpecifier(kind) { - const pos = getNodePos(); - let checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); - let checkIdentifierStart = scanner2.getTokenStart(); - let checkIdentifierEnd = scanner2.getTokenEnd(); - let isTypeOnly = false; - let propertyName; - let canParseAsKeyword = true; - let name = parseModuleExportName(parseIdentifierName); - if (name.kind === 80 /* Identifier */ && name.escapedText === "type") { - if (token() === 130 /* AsKeyword */) { - const firstAs = parseIdentifierName(); - if (token() === 130 /* AsKeyword */) { - const secondAs = parseIdentifierName(); - if (canParseModuleExportName()) { - isTypeOnly = true; - propertyName = firstAs; - name = parseModuleExportName(parseNameWithKeywordCheck); - canParseAsKeyword = false; - } else { - propertyName = name; - name = secondAs; - canParseAsKeyword = false; - } - } else if (canParseModuleExportName()) { - propertyName = name; - canParseAsKeyword = false; - name = parseModuleExportName(parseNameWithKeywordCheck); - } else { - isTypeOnly = true; - name = firstAs; - } - } else if (canParseModuleExportName()) { - isTypeOnly = true; - name = parseModuleExportName(parseNameWithKeywordCheck); - } - } - if (canParseAsKeyword && token() === 130 /* AsKeyword */) { - propertyName = name; - parseExpected(130 /* AsKeyword */); - name = parseModuleExportName(parseNameWithKeywordCheck); - } - if (kind === 277 /* ImportSpecifier */) { - if (name.kind !== 80 /* Identifier */) { - parseErrorAt(skipTrivia(sourceText, name.pos), name.end, Diagnostics.Identifier_expected); - name = setTextRangePosEnd(createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - false - ), name.pos, name.pos); - } else if (checkIdentifierIsKeyword) { - parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected); - } - } - const node = kind === 277 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); - return finishNode(node, pos); - function parseNameWithKeywordCheck() { - checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); - checkIdentifierStart = scanner2.getTokenStart(); - checkIdentifierEnd = scanner2.getTokenEnd(); - return parseIdentifierName(); - } - } - function parseNamespaceExport(pos) { - return finishNode(factory2.createNamespaceExport(parseModuleExportName(parseIdentifierName)), pos); - } - function parseExportDeclaration(pos, hasJSDoc, modifiers) { - const savedAwaitContext = inAwaitContext(); - setAwaitContext( - /*value*/ - true - ); - let exportClause; - let moduleSpecifier; - let attributes; - const isTypeOnly = parseOptional(156 /* TypeKeyword */); - const namespaceExportPos = getNodePos(); - if (parseOptional(42 /* AsteriskToken */)) { - if (parseOptional(130 /* AsKeyword */)) { - exportClause = parseNamespaceExport(namespaceExportPos); - } - parseExpected(161 /* FromKeyword */); - moduleSpecifier = parseModuleSpecifier(); - } else { - exportClause = parseNamedImportsOrExports(280 /* NamedExports */); - if (token() === 161 /* FromKeyword */ || token() === 11 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) { - parseExpected(161 /* FromKeyword */); - moduleSpecifier = parseModuleSpecifier(); - } - } - 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, attributes); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - function parseExportAssignment(pos, hasJSDoc, modifiers) { - const savedAwaitContext = inAwaitContext(); - setAwaitContext( - /*value*/ - true - ); - let isExportEquals; - if (parseOptional(64 /* EqualsToken */)) { - isExportEquals = true; - } else { - parseExpected(90 /* DefaultKeyword */); - } - const expression = parseAssignmentExpressionOrHigher( - /*allowReturnTypeInArrowFunction*/ - true - ); - parseSemicolon(); - setAwaitContext(savedAwaitContext); - const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); - return withJSDoc(finishNode(node, pos), hasJSDoc); - } - let ParsingContext; - ((ParsingContext2) => { - ParsingContext2[ParsingContext2["SourceElements"] = 0] = "SourceElements"; - ParsingContext2[ParsingContext2["BlockStatements"] = 1] = "BlockStatements"; - ParsingContext2[ParsingContext2["SwitchClauses"] = 2] = "SwitchClauses"; - ParsingContext2[ParsingContext2["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; - ParsingContext2[ParsingContext2["TypeMembers"] = 4] = "TypeMembers"; - ParsingContext2[ParsingContext2["ClassMembers"] = 5] = "ClassMembers"; - ParsingContext2[ParsingContext2["EnumMembers"] = 6] = "EnumMembers"; - ParsingContext2[ParsingContext2["HeritageClauseElement"] = 7] = "HeritageClauseElement"; - ParsingContext2[ParsingContext2["VariableDeclarations"] = 8] = "VariableDeclarations"; - ParsingContext2[ParsingContext2["ObjectBindingElements"] = 9] = "ObjectBindingElements"; - ParsingContext2[ParsingContext2["ArrayBindingElements"] = 10] = "ArrayBindingElements"; - ParsingContext2[ParsingContext2["ArgumentExpressions"] = 11] = "ArgumentExpressions"; - ParsingContext2[ParsingContext2["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers"; - ParsingContext2[ParsingContext2["JsxAttributes"] = 13] = "JsxAttributes"; - ParsingContext2[ParsingContext2["JsxChildren"] = 14] = "JsxChildren"; - ParsingContext2[ParsingContext2["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers"; - ParsingContext2[ParsingContext2["Parameters"] = 16] = "Parameters"; - ParsingContext2[ParsingContext2["JSDocParameters"] = 17] = "JSDocParameters"; - ParsingContext2[ParsingContext2["RestProperties"] = 18] = "RestProperties"; - ParsingContext2[ParsingContext2["TypeParameters"] = 19] = "TypeParameters"; - ParsingContext2[ParsingContext2["TypeArguments"] = 20] = "TypeArguments"; - ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes"; - ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses"; - ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers"; - ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes"; - ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment"; - ParsingContext2[ParsingContext2["Count"] = 26] = "Count"; - })(ParsingContext || (ParsingContext = {})); - let Tristate; - ((Tristate2) => { - Tristate2[Tristate2["False"] = 0] = "False"; - Tristate2[Tristate2["True"] = 1] = "True"; - Tristate2[Tristate2["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); - let JSDocParser; - ((JSDocParser2) => { - function parseJSDocTypeExpressionForTests2(content, start, length2) { - initializeState( - "file.js", - content, - 99 /* Latest */, - /*syntaxCursor*/ - void 0, - 1 /* JS */, - 0 /* ParseAll */ - ); - scanner2.setText(content, start, length2); - currentToken = scanner2.scan(); - const jsDocTypeExpression = parseJSDocTypeExpression(); - const sourceFile = createSourceFile2( - "file.js", - 99 /* Latest */, - 1 /* JS */, - /*isDeclarationFile*/ - false, - [], - factoryCreateToken(1 /* EndOfFileToken */), - 0 /* None */, - noop - ); - const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); - if (jsDocDiagnostics) { - sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); - } - clearState(); - return jsDocTypeExpression ? { jsDocTypeExpression, diagnostics } : void 0; - } - JSDocParser2.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests2; - function parseJSDocTypeExpression(mayOmitBraces) { - const pos = getNodePos(); - const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(19 /* OpenBraceToken */); - const type = doInsideOfContext(16777216 /* JSDoc */, parseJSDocType); - if (!mayOmitBraces || hasBrace) { - parseExpectedJSDoc(20 /* CloseBraceToken */); - } - const result = factory2.createJSDocTypeExpression(type); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser2.parseJSDocTypeExpression = parseJSDocTypeExpression; - function parseJSDocNameReference() { - const pos = getNodePos(); - const hasBrace = parseOptional(19 /* OpenBraceToken */); - const p2 = getNodePos(); - let entityName = parseEntityName( - /*allowReservedWords*/ - false - ); - while (token() === 81 /* PrivateIdentifier */) { - reScanHashToken(); - nextTokenJSDoc(); - entityName = finishNode(factory2.createJSDocMemberName(entityName, parseIdentifier()), p2); - } - if (hasBrace) { - parseExpectedJSDoc(20 /* CloseBraceToken */); - } - const result = factory2.createJSDocNameReference(entityName); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser2.parseJSDocNameReference = parseJSDocNameReference; - function parseIsolatedJSDocComment2(content, start, length2) { - initializeState( - "", - content, - 99 /* Latest */, - /*syntaxCursor*/ - void 0, - 1 /* JS */, - 0 /* ParseAll */ - ); - const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); - const sourceFile = { languageVariant: 0 /* Standard */, text: content }; - const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); - clearState(); - return jsDoc ? { jsDoc, diagnostics } : void 0; - } - JSDocParser2.parseIsolatedJSDocComment = parseIsolatedJSDocComment2; - function parseJSDocComment(parent2, start, length2) { - const saveToken = currentToken; - const saveParseDiagnosticsLength = parseDiagnostics.length; - const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; - const comment = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); - setParent(comment, parent2); - if (contextFlags & 524288 /* JavaScriptFile */) { - if (!jsDocDiagnostics) { - jsDocDiagnostics = []; - } - addRange(jsDocDiagnostics, parseDiagnostics, saveParseDiagnosticsLength); - } - currentToken = saveToken; - parseDiagnostics.length = saveParseDiagnosticsLength; - parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; - return comment; - } - JSDocParser2.parseJSDocComment = parseJSDocComment; - let JSDocState; - ((JSDocState2) => { - JSDocState2[JSDocState2["BeginningOfLine"] = 0] = "BeginningOfLine"; - JSDocState2[JSDocState2["SawAsterisk"] = 1] = "SawAsterisk"; - JSDocState2[JSDocState2["SavingComments"] = 2] = "SavingComments"; - JSDocState2[JSDocState2["SavingBackticks"] = 3] = "SavingBackticks"; - })(JSDocState || (JSDocState = {})); - let PropertyLikeParse; - ((PropertyLikeParse2) => { - PropertyLikeParse2[PropertyLikeParse2["Property"] = 1] = "Property"; - PropertyLikeParse2[PropertyLikeParse2["Parameter"] = 2] = "Parameter"; - PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter"; - })(PropertyLikeParse || (PropertyLikeParse = {})); - function parseJSDocCommentWorker(start = 0, length2) { - const content = sourceText; - const end = length2 === void 0 ? content.length : start + length2; - length2 = end - start; - Debug.assert(start >= 0); - Debug.assert(start <= end); - Debug.assert(end <= content.length); - if (!isJSDocLikeText(content, start)) { - return void 0; - } - let tags; - let tagsPos; - let tagsEnd; - let linkEnd; - 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 indent3 = start - (content.lastIndexOf("\n", start) + 1) + 4; - function pushComment(text) { - if (!margin) { - margin = indent3; - } - comments.push(text); - indent3 += text.length; - } - nextTokenJSDoc(); - while (parseOptionalJsdoc(5 /* WhitespaceTrivia */)) ; - if (parseOptionalJsdoc(4 /* NewLineTrivia */)) { - state = 0 /* BeginningOfLine */; - indent3 = 0; - } - loop: - while (true) { - switch (token()) { - case 60 /* AtToken */: - removeTrailingWhitespace(comments); - if (!commentsPos) commentsPos = getNodePos(); - addTag(parseTag(indent3)); - state = 0 /* BeginningOfLine */; - margin = void 0; - break; - case 4 /* NewLineTrivia */: - comments.push(scanner2.getTokenText()); - state = 0 /* BeginningOfLine */; - indent3 = 0; - break; - case 42 /* AsteriskToken */: - const asterisk = scanner2.getTokenText(); - if (state === 1 /* SawAsterisk */) { - state = 2 /* SavingComments */; - pushComment(asterisk); - } else { - Debug.assert(state === 0 /* BeginningOfLine */); - state = 1 /* SawAsterisk */; - 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 && indent3 + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent3)); - } - indent3 += whitespace.length; - break; - case 1 /* EndOfFileToken */: - break loop; - case 82 /* JSDocCommentTextToken */: - state = 2 /* SavingComments */; - pushComment(scanner2.getTokenValue()); - break; - case 19 /* OpenBraceToken */: - state = 2 /* SavingComments */; - const commentEnd = scanner2.getTokenFullStart(); - const linkStart = scanner2.getTokenEnd() - 1; - const link = parseJSDocLink(linkStart); - if (link) { - if (!linkEnd) { - removeLeadingNewlines(comments); - } - parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd ?? start, commentEnd)); - parts.push(link); - comments = []; - linkEnd = scanner2.getTokenEnd(); - break; - } - // fallthrough if it's not a {@link sequence - default: - state = 2 /* SavingComments */; - pushComment(scanner2.getTokenText()); - break; - } - if (state === 2 /* SavingComments */) { - nextJSDocCommentTextToken( - /*inBackticks*/ - false - ); - } else { - nextTokenJSDoc(); - } - } - const trimmedComments = comments.join("").trimEnd(); - if (parts.length && trimmedComments.length) { - parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start, commentsPos)); - } - if (parts.length && tags) Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); - const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd); - return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start, end); - } - function removeLeadingNewlines(comments2) { - while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) { - comments2.shift(); - } - } - function removeTrailingWhitespace(comments2) { - while (comments2.length) { - const trimmed = comments2[comments2.length - 1].trimEnd(); - if (trimmed === "") { - comments2.pop(); - } else if (trimmed.length < comments2[comments2.length - 1].length) { - comments2[comments2.length - 1] = trimmed; - break; - } else { - break; - } - } - } - function isNextNonwhitespaceTokenEndOfFile() { - while (true) { - nextTokenJSDoc(); - if (token() === 1 /* EndOfFileToken */) { - return true; - } - if (!(token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */)) { - return false; - } - } - } - function skipWhitespace() { - if (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { - if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { - return; - } - } - while (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { - nextTokenJSDoc(); - } - } - function skipWhitespaceOrAsterisk() { - if (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { - if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { - return ""; - } - } - let precedingLineBreak = scanner2.hasPrecedingLineBreak(); - let seenLineBreak = false; - let indentText = ""; - while (precedingLineBreak && token() === 42 /* AsteriskToken */ || token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { - indentText += scanner2.getTokenText(); - if (token() === 4 /* NewLineTrivia */) { - precedingLineBreak = true; - seenLineBreak = true; - indentText = ""; - } else if (token() === 42 /* AsteriskToken */) { - precedingLineBreak = false; - } - nextTokenJSDoc(); - } - return seenLineBreak ? indentText : ""; - } - function parseTag(margin) { - Debug.assert(token() === 60 /* AtToken */); - const start2 = scanner2.getTokenStart(); - nextTokenJSDoc(); - const tagName = parseJSDocIdentifierName( - /*message*/ - void 0 - ); - const indentText = skipWhitespaceOrAsterisk(); - let tag; - switch (tagName.escapedText) { - case "author": - tag = parseAuthorTag(start2, tagName, margin, indentText); - break; - case "implements": - tag = parseImplementsTag(start2, tagName, margin, indentText); - break; - case "augments": - case "extends": - tag = parseAugmentsTag(start2, tagName, margin, indentText); - break; - case "class": - case "constructor": - tag = parseSimpleTag(start2, factory2.createJSDocClassTag, tagName, margin, indentText); - break; - case "public": - tag = parseSimpleTag(start2, factory2.createJSDocPublicTag, tagName, margin, indentText); - break; - case "private": - tag = parseSimpleTag(start2, factory2.createJSDocPrivateTag, tagName, margin, indentText); - break; - case "protected": - tag = parseSimpleTag(start2, factory2.createJSDocProtectedTag, tagName, margin, indentText); - break; - case "readonly": - tag = parseSimpleTag(start2, factory2.createJSDocReadonlyTag, tagName, margin, indentText); - break; - case "override": - tag = parseSimpleTag(start2, factory2.createJSDocOverrideTag, tagName, margin, indentText); - break; - case "deprecated": - hasDeprecatedTag = true; - tag = parseSimpleTag(start2, factory2.createJSDocDeprecatedTag, tagName, margin, indentText); - break; - case "this": - tag = parseThisTag(start2, tagName, margin, indentText); - break; - case "enum": - tag = parseEnumTag(start2, tagName, margin, indentText); - break; - case "arg": - case "argument": - case "param": - return parseParameterOrPropertyTag(start2, tagName, 2 /* Parameter */, margin); - case "return": - case "returns": - tag = parseReturnTag(start2, tagName, margin, indentText); - break; - case "template": - tag = parseTemplateTag(start2, tagName, margin, indentText); - break; - case "type": - tag = parseTypeTag(start2, tagName, margin, indentText); - break; - case "typedef": - tag = parseTypedefTag(start2, tagName, margin, indentText); - break; - case "callback": - tag = parseCallbackTag(start2, tagName, margin, indentText); - break; - case "overload": - tag = parseOverloadTag(start2, tagName, margin, indentText); - break; - case "satisfies": - tag = parseSatisfiesTag(start2, tagName, margin, indentText); - break; - case "see": - tag = parseSeeTag(start2, tagName, margin, indentText); - break; - case "exception": - case "throws": - tag = parseThrowsTag(start2, tagName, margin, indentText); - break; - case "import": - tag = parseImportTag(start2, tagName, margin, indentText); - break; - default: - tag = parseUnknownTag(start2, tagName, margin, indentText); - break; - } - return tag; - } - function parseTrailingTagComments(pos, end2, margin, indentText) { - if (!indentText) { - margin += end2 - pos; - } - return parseTagComments(margin, indentText.slice(margin)); - } - function parseTagComments(indent3, initialMargin) { - const commentsPos2 = getNodePos(); - let comments2 = []; - const parts2 = []; - let linkEnd2; - let state = 0 /* BeginningOfLine */; - let margin; - function pushComment(text) { - if (!margin) { - margin = indent3; - } - comments2.push(text); - indent3 += text.length; - } - if (initialMargin !== void 0) { - if (initialMargin !== "") { - pushComment(initialMargin); - } - state = 1 /* SawAsterisk */; - } - let tok = token(); - loop: - while (true) { - switch (tok) { - case 4 /* NewLineTrivia */: - state = 0 /* BeginningOfLine */; - comments2.push(scanner2.getTokenText()); - indent3 = 0; - break; - case 60 /* AtToken */: - scanner2.resetTokenState(scanner2.getTokenEnd() - 1); - break loop; - case 1 /* EndOfFileToken */: - break loop; - 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 && indent3 + whitespace.length > margin) { - comments2.push(whitespace.slice(margin - indent3)); - state = 2 /* SavingComments */; - } - indent3 += whitespace.length; - break; - case 19 /* OpenBraceToken */: - state = 2 /* SavingComments */; - const commentEnd = scanner2.getTokenFullStart(); - const linkStart = scanner2.getTokenEnd() - 1; - const link = parseJSDocLink(linkStart); - if (link) { - parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 ?? commentsPos2, commentEnd)); - parts2.push(link); - comments2 = []; - linkEnd2 = scanner2.getTokenEnd(); - } else { - pushComment(scanner2.getTokenText()); - } - break; - case 62 /* BacktickToken */: - if (state === 3 /* SavingBackticks */) { - state = 2 /* SavingComments */; - } else { - state = 3 /* SavingBackticks */; - } - pushComment(scanner2.getTokenText()); - break; - case 82 /* JSDocCommentTextToken */: - if (state !== 3 /* SavingBackticks */) { - state = 2 /* SavingComments */; - } - pushComment(scanner2.getTokenValue()); - break; - case 42 /* AsteriskToken */: - if (state === 0 /* BeginningOfLine */) { - state = 1 /* SawAsterisk */; - indent3 += 1; - break; - } - // record the * as a comment - // falls through - default: - if (state !== 3 /* SavingBackticks */) { - state = 2 /* SavingComments */; - } - pushComment(scanner2.getTokenText()); - break; - } - if (state === 2 /* SavingComments */ || state === 3 /* SavingBackticks */) { - tok = nextJSDocCommentTextToken(state === 3 /* SavingBackticks */); - } else { - tok = nextTokenJSDoc(); - } - } - removeLeadingNewlines(comments2); - const trimmedComments = comments2.join("").trimEnd(); - if (parts2.length) { - if (trimmedComments.length) { - parts2.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd2 ?? commentsPos2)); - } - return createNodeArray(parts2, commentsPos2, scanner2.getTokenEnd()); - } else if (trimmedComments.length) { - return trimmedComments; - } - } - function parseJSDocLink(start2) { - const linkType = tryParse(parseJSDocLinkPrefix); - if (!linkType) { - return void 0; - } - nextTokenJSDoc(); - skipWhitespace(); - const name = parseJSDocLinkName(); - const text = []; - while (token() !== 20 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) { - text.push(scanner2.getTokenText()); - nextTokenJSDoc(); - } - 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 - ) : parseIdentifierName()), 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())) { - const kind = scanner2.getTokenValue(); - if (isJSDocLinkTag(kind)) return kind; - } - } - function isJSDocLinkTag(kind) { - return kind === "link" || kind === "linkcode" || kind === "linkplain"; - } - function parseUnknownTag(start2, tagName, indent3, indentText) { - return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2); - } - function addTag(tag) { - if (!tag) { - return; - } - if (!tags) { - tags = [tag]; - tagsPos = tag.pos; - } else { - tags.push(tag); - } - tagsEnd = tag.end; - } - function tryParseTypeExpression() { - skipWhitespaceOrAsterisk(); - return token() === 19 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0; - } - function parseBracketNameInPropertyAndParamTag() { - const isBracketed = parseOptionalJsdoc(23 /* OpenBracketToken */); - if (isBracketed) { - skipWhitespace(); - } - const isBackquoted = parseOptionalJsdoc(62 /* BacktickToken */); - const name = parseJSDocEntityName(); - if (isBackquoted) { - parseExpectedTokenJSDoc(62 /* BacktickToken */); - } - if (isBracketed) { - skipWhitespace(); - if (parseOptionalToken(64 /* EqualsToken */)) { - parseExpression(); - } - parseExpected(24 /* CloseBracketToken */); - } - return { name, isBracketed }; - } - function isObjectOrObjectArrayTypeReference(node) { - switch (node.kind) { - case 151 /* ObjectKeyword */: - return true; - case 189 /* ArrayType */: - return isObjectOrObjectArrayTypeReference(node.elementType); - default: - return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; - } - } - function parseParameterOrPropertyTag(start2, tagName, target, indent3) { - let typeExpression = tryParseTypeExpression(); - let isNameFirst = !typeExpression; - skipWhitespaceOrAsterisk(); - const { name, isBracketed } = parseBracketNameInPropertyAndParamTag(); - const indentText = skipWhitespaceOrAsterisk(); - if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) { - typeExpression = tryParseTypeExpression(); - } - const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); - const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent3); - if (nestedTypeLiteral) { - typeExpression = nestedTypeLiteral; - isNameFirst = true; - } - 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, indent3) { - if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - const pos = getNodePos(); - let child; - let children; - while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) { - if (child.kind === 342 /* JSDocParameterTag */ || child.kind === 349 /* JSDocPropertyTag */) { - children = append(children, child); - } else if (child.kind === 346 /* 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 === 189 /* ArrayType */), pos); - return finishNode(factory2.createJSDocTypeExpression(literal), pos); - } - } - } - 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(), indent3, indentText)), start2); - } - function parseTypeTag(start2, tagName, indent3, indentText) { - if (some(tags, isJSDocTypeTag)) { - parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText)); - } - const typeExpression = parseJSDocTypeExpression( - /*mayOmitBraces*/ - true - ); - 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, indent3, indentText) { - const isMarkdownOrJSDocLink = token() === 23 /* OpenBracketToken */ || lookAhead(() => nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner2.getTokenValue())); - const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference(); - 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, indent3, indentText) { - const typeExpression = tryParseTypeExpression(); - const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); - return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2); - } - function parseAuthorTag(start2, tagName, indent3, indentText) { - const commentStart = getNodePos(); - const textOnly = parseAuthorNameAndEmail(); - let commentEnd = scanner2.getTokenFullStart(); - const comments2 = parseTrailingTagComments(start2, commentEnd, indent3, indentText); - if (!comments2) { - commentEnd = scanner2.getTokenFullStart(); - } - const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; - return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start2); - } - function parseAuthorNameAndEmail() { - const comments2 = []; - let inEmail = false; - let token2 = scanner2.getToken(); - while (token2 !== 1 /* EndOfFileToken */ && token2 !== 4 /* NewLineTrivia */) { - if (token2 === 30 /* LessThanToken */) { - inEmail = true; - } else if (token2 === 60 /* AtToken */ && !inEmail) { - break; - } else if (token2 === 32 /* GreaterThanToken */ && inEmail) { - comments2.push(scanner2.getTokenText()); - scanner2.resetTokenState(scanner2.getTokenEnd()); - break; - } - comments2.push(scanner2.getTokenText()); - token2 = nextTokenJSDoc(); - } - return factory2.createJSDocText(comments2.join("")); - } - function parseImplementsTag(start2, tagName, margin, indentText) { - const className = parseExpressionWithTypeArgumentsForAugments(); - return finishNode(factory2.createJSDocImplementsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); - } - function parseAugmentsTag(start2, tagName, margin, indentText) { - const className = parseExpressionWithTypeArgumentsForAugments(); - return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); - } - function parseSatisfiesTag(start2, tagName, margin, indentText) { - const typeExpression = parseJSDocTypeExpression( - /*mayOmitBraces*/ - false - ); - const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0; - return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2); - } - function parseImportTag(start2, tagName, margin, indentText) { - const afterImportTagPos = scanner2.getTokenFullStart(); - let identifier; - if (isIdentifier2()) { - identifier = parseIdentifier(); - } - const importClause = tryParseImportClause( - identifier, - afterImportTagPos, - 156 /* TypeKeyword */, - /*skipJsDocLeadingAsterisks*/ - true - ); - const moduleSpecifier = parseModuleSpecifier(); - const attributes = tryParseImportAttributes(); - const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0; - return finishNode(factory2.createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comments2), start2); - } - function parseExpressionWithTypeArgumentsForAugments() { - const usedBrace = parseOptional(19 /* OpenBraceToken */); - const pos = getNodePos(); - const expression = parsePropertyAccessEntityNameExpression(); - scanner2.setSkipJsDocLeadingAsterisks(true); - const typeArguments = tryParseTypeArguments(); - scanner2.setSkipJsDocLeadingAsterisks(false); - const node = factory2.createExpressionWithTypeArguments(expression, typeArguments); - const res = finishNode(node, pos); - if (usedBrace) { - skipWhitespace(); - parseExpected(20 /* CloseBraceToken */); - } - return res; - } - function parsePropertyAccessEntityNameExpression() { - const pos = getNodePos(); - let node = parseJSDocIdentifierName(); - while (parseOptional(25 /* DotToken */)) { - const name = parseJSDocIdentifierName(); - node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos); - } - return node; - } - function parseSimpleTag(start2, createTag, tagName, margin, indentText) { - return finishNode(createTag(tagName, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); - } - function parseThisTag(start2, tagName, margin, indentText) { - const typeExpression = parseJSDocTypeExpression( - /*mayOmitBraces*/ - true - ); - skipWhitespace(); - return finishNode(factory2.createJSDocThisTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); - } - function parseEnumTag(start2, tagName, margin, indentText) { - const typeExpression = parseJSDocTypeExpression( - /*mayOmitBraces*/ - true - ); - skipWhitespace(); - return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); - } - function parseTypedefTag(start2, tagName, indent3, indentText) { - let typeExpression = tryParseTypeExpression(); - skipWhitespaceOrAsterisk(); - const fullName = parseJSDocTypeNameWithNamespace(); - skipWhitespace(); - let comment = parseTagComments(indent3); - let end2; - if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) { - let child; - let childTypeTag; - let jsDocPropertyTags; - let hasChildren = false; - while (child = tryParse(() => parseChildPropertyTag(indent3))) { - if (child.kind === 346 /* JSDocTemplateTag */) { - break; - } - hasChildren = true; - if (child.kind === 345 /* JSDocTypeTag */) { - if (childTypeTag) { - const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); - if (lastError) { - addRelatedInfo(lastError, createDetachedDiagnostic(fileName, sourceText, 0, 0, Diagnostics.The_tag_was_first_specified_here)); - } - break; - } else { - childTypeTag = child; - } - } else { - jsDocPropertyTags = append(jsDocPropertyTags, child); - } - } - if (hasChildren) { - const isArrayType = typeExpression && typeExpression.type.kind === 189 /* ArrayType */; - const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); - typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2); - end2 = typeExpression.end; - } - } - end2 = end2 || comment !== void 0 ? getNodePos() : (fullName ?? typeExpression ?? tagName).end; - if (!comment) { - comment = parseTrailingTagComments(start2, end2, indent3, indentText); - } - const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment); - return finishNode(typedefTag, start2, end2); - } - function parseJSDocTypeNameWithNamespace(nested) { - const start2 = scanner2.getTokenStart(); - if (!tokenIsIdentifierOrKeyword(token())) { - return void 0; - } - const typeNameOrNamespaceName = parseJSDocIdentifierName(); - if (parseOptional(25 /* DotToken */)) { - const body = parseJSDocTypeNameWithNamespace( - /*nested*/ - true - ); - const jsDocNamespaceNode = factory2.createModuleDeclaration( - /*modifiers*/ - void 0, - typeNameOrNamespaceName, - body, - nested ? 8 /* NestedNamespace */ : void 0 - ); - return finishNode(jsDocNamespaceNode, start2); - } - if (nested) { - typeNameOrNamespaceName.flags |= 4096 /* IdentifierIsInJSDocNamespace */; - } - return typeNameOrNamespaceName; - } - function parseCallbackTagParameters(indent3) { - const pos = getNodePos(); - let child; - let parameters; - while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) { - if (child.kind === 346 /* JSDocTemplateTag */) { - parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); - break; - } - parameters = append(parameters, child); - } - return createNodeArray(parameters || [], pos); - } - function parseJSDocSignature(start2, indent3) { - const parameters = parseCallbackTagParameters(indent3); - const returnTag = tryParse(() => { - if (parseOptionalJsdoc(60 /* AtToken */)) { - const tag = parseTag(indent3); - if (tag && tag.kind === 343 /* JSDocReturnTag */) { - return tag; - } - } - }); - return finishNode(factory2.createJSDocSignature( - /*typeParameters*/ - void 0, - parameters, - returnTag - ), start2); - } - function parseCallbackTag(start2, tagName, indent3, indentText) { - const fullName = parseJSDocTypeNameWithNamespace(); - skipWhitespace(); - let comment = parseTagComments(indent3); - const typeExpression = parseJSDocSignature(start2, indent3); - if (!comment) { - 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, indent3, indentText) { - skipWhitespace(); - let comment = parseTagComments(indent3); - const typeExpression = parseJSDocSignature(start2, indent3); - if (!comment) { - comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); - } - const end2 = comment !== void 0 ? getNodePos() : typeExpression.end; - return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2); - } - function escapedTextsEqual(a, b) { - while (!isIdentifier(a) || !isIdentifier(b)) { - if (!isIdentifier(a) && !isIdentifier(b) && a.right.escapedText === b.right.escapedText) { - a = a.left; - b = b.left; - } else { - return false; - } - } - return a.escapedText === b.escapedText; - } - function parseChildPropertyTag(indent3) { - return parseChildParameterOrPropertyTag(1 /* Property */, indent3); - } - function parseChildParameterOrPropertyTag(target, indent3, name) { - let canParseTag = true; - let seenAsterisk = false; - while (true) { - switch (nextTokenJSDoc()) { - case 60 /* AtToken */: - if (canParseTag) { - const child = tryParseChildTag(target, indent3); - if (child && (child.kind === 342 /* JSDocParameterTag */ || child.kind === 349 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { - return false; - } - return child; - } - seenAsterisk = false; - break; - case 4 /* NewLineTrivia */: - canParseTag = true; - seenAsterisk = false; - break; - case 42 /* AsteriskToken */: - if (seenAsterisk) { - canParseTag = false; - } - seenAsterisk = true; - break; - case 80 /* Identifier */: - canParseTag = false; - break; - case 1 /* EndOfFileToken */: - return false; - } - } - } - function tryParseChildTag(target, indent3) { - Debug.assert(token() === 60 /* AtToken */); - const start2 = scanner2.getTokenFullStart(); - nextTokenJSDoc(); - const tagName = parseJSDocIdentifierName(); - const indentText = skipWhitespaceOrAsterisk(); - let t; - switch (tagName.escapedText) { - case "type": - return target === 1 /* Property */ && parseTypeTag(start2, tagName); - case "prop": - case "property": - t = 1 /* Property */; - break; - case "arg": - case "argument": - case "param": - t = 2 /* Parameter */ | 4 /* CallbackParameter */; - break; - case "template": - 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, indent3); - } - function parseTemplateTagTypeParameter() { - const typeParameterPos = getNodePos(); - const isBracketed = parseOptionalJsdoc(23 /* OpenBracketToken */); - 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(16777216 /* JSDoc */, parseJSDocType); - parseExpected(24 /* CloseBracketToken */); - } - if (nodeIsMissing(name)) { - return void 0; - } - return finishNode(factory2.createTypeParameterDeclaration( - modifiers, - name, - /*constraint*/ - void 0, - defaultType - ), typeParameterPos); - } - function parseTemplateTagTypeParameters() { - const pos = getNodePos(); - const typeParameters = []; - do { - skipWhitespace(); - const node = parseTemplateTagTypeParameter(); - if (node !== void 0) { - typeParameters.push(node); - } - skipWhitespaceOrAsterisk(); - } while (parseOptionalJsdoc(28 /* CommaToken */)); - return createNodeArray(typeParameters, pos); - } - 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(), indent3, indentText)), start2); - } - function parseOptionalJsdoc(t) { - if (token() === t) { - nextTokenJSDoc(); - return true; - } - return false; - } - function parseJSDocEntityName() { - let entity = parseJSDocIdentifierName(); - if (parseOptional(23 /* OpenBracketToken */)) { - parseExpected(24 /* CloseBracketToken */); - } - while (parseOptional(25 /* DotToken */)) { - const name = parseJSDocIdentifierName(); - if (parseOptional(23 /* OpenBracketToken */)) { - parseExpected(24 /* CloseBracketToken */); - } - entity = createQualifiedName(entity, name); - } - return entity; - } - function parseJSDocIdentifierName(message) { - if (!tokenIsIdentifierOrKeyword(token())) { - return createMissingNode( - 80 /* Identifier */, - /*reportAtCurrentPosition*/ - !message, - message || Diagnostics.Identifier_expected - ); - } - identifierCount++; - const start2 = scanner2.getTokenStart(); - const end2 = scanner2.getTokenEnd(); - const originalKeywordKind = token(); - const text = internIdentifier(scanner2.getTokenValue()); - const result2 = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2); - nextTokenJSDoc(); - return result2; - } - } - })(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {})); -})(Parser || (Parser = {})); -var incrementallyParsedFiles = /* @__PURE__ */ new WeakSet(); -function markAsIncrementallyParsed(sourceFile) { - if (incrementallyParsedFiles.has(sourceFile)) { - Debug.fail("Source file has already been incrementally parsed"); - } - incrementallyParsedFiles.add(sourceFile); -} -var intersectingChangeSet = /* @__PURE__ */ new WeakSet(); -function intersectsIncrementalChange(node) { - return intersectingChangeSet.has(node); -} -function markAsIntersectingIncrementalChange(node) { - intersectingChangeSet.add(node); -} -var IncrementalParser; -((IncrementalParser2) => { - function updateSourceFile2(sourceFile, newText, textChangeRange, aggressiveChecks) { - aggressiveChecks = aggressiveChecks || Debug.shouldAssert(2 /* Aggressive */); - checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); - if (textChangeRangeIsUnchanged(textChangeRange)) { - return sourceFile; - } - if (sourceFile.statements.length === 0) { - return Parser.parseSourceFile( - sourceFile.fileName, - newText, - sourceFile.languageVersion, - /*syntaxCursor*/ - void 0, - /*setParentNodes*/ - true, - sourceFile.scriptKind, - sourceFile.setExternalModuleIndicator, - sourceFile.jsDocParsingMode - ); - } - markAsIncrementallyParsed(sourceFile); - Parser.fixupParentReferences(sourceFile); - const oldText = sourceFile.text; - const syntaxCursor = createSyntaxCursor(sourceFile); - const changeRange = extendToAffectedRange(sourceFile, textChangeRange); - checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - Debug.assert(changeRange.span.start <= textChangeRange.span.start); - 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(sourceFile, changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); - const result = Parser.parseSourceFile( - sourceFile.fileName, - newText, - sourceFile.languageVersion, - syntaxCursor, - /*setParentNodes*/ - true, - sourceFile.scriptKind, - sourceFile.setExternalModuleIndicator, - sourceFile.jsDocParsingMode - ); - result.commentDirectives = getNewCommentDirectives( - sourceFile.commentDirectives, - result.commentDirectives, - changeRange.span.start, - textSpanEnd(changeRange.span), - delta, - oldText, - newText, - aggressiveChecks - ); - result.impliedNodeFormat = sourceFile.impliedNodeFormat; - transferSourceFileChildren(sourceFile, result); - return result; - } - IncrementalParser2.updateSourceFile = updateSourceFile2; - function getNewCommentDirectives(oldDirectives, newDirectives, changeStart, changeRangeOldEnd, delta, oldText, newText, aggressiveChecks) { - if (!oldDirectives) return newDirectives; - let commentDirectives; - let addedNewlyScannedDirectives = false; - for (const directive of oldDirectives) { - const { range, type } = directive; - if (range.end < changeStart) { - commentDirectives = append(commentDirectives, directive); - } else if (range.pos > changeRangeOldEnd) { - addNewlyScannedDirectives(); - const updatedDirective = { - range: { pos: range.pos + delta, end: range.end + delta }, - type - }; - commentDirectives = append(commentDirectives, updatedDirective); - if (aggressiveChecks) { - Debug.assert(oldText.substring(range.pos, range.end) === newText.substring(updatedDirective.range.pos, updatedDirective.range.end)); - } - } - } - addNewlyScannedDirectives(); - return commentDirectives; - function addNewlyScannedDirectives() { - if (addedNewlyScannedDirectives) return; - addedNewlyScannedDirectives = true; - if (!commentDirectives) { - commentDirectives = newDirectives; - } else if (newDirectives) { - commentDirectives.push(...newDirectives); - } - } - } - function moveElementEntirelyPastChangeRange(element, origSourceFile, isArray2, delta, oldText, newText, aggressiveChecks) { - if (isArray2) { - visitArray2(element); - } else { - visitNode3(element); - } - return; - function visitNode3(node) { - let text = ""; - if (aggressiveChecks && shouldCheckNode(node)) { - text = oldText.substring(node.pos, node.end); - } - unsetNodeChildren(node, origSourceFile); - setTextRangePosEnd(node, node.pos + delta, node.end + delta); - if (aggressiveChecks && shouldCheckNode(node)) { - Debug.assert(text === newText.substring(node.pos, node.end)); - } - forEachChild(node, visitNode3, visitArray2); - if (hasJSDocNodes(node)) { - for (const jsDocComment of node.jsDoc) { - visitNode3(jsDocComment); - } - } - checkNodePositions(node, aggressiveChecks); - } - function visitArray2(array) { - setTextRangePosEnd(array, array.pos + delta, array.end + delta); - for (const node of array) { - visitNode3(node); - } - } - } - function shouldCheckNode(node) { - switch (node.kind) { - case 11 /* StringLiteral */: - case 9 /* NumericLiteral */: - case 80 /* Identifier */: - return true; - } - return false; - } - function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { - Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); - Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); - Debug.assert(element.pos <= element.end); - const pos = Math.min(element.pos, changeRangeNewEnd); - const end = element.end >= changeRangeOldEnd ? ( - // Element ends after the change range. Always adjust the end pos. - element.end + delta - ) : ( - // Element ends in the change range. The element will keep its position if - // possible. Or Move backward to the new-end if it's in the 'Y' range. - Math.min(element.end, changeRangeNewEnd) - ); - Debug.assert(pos <= end); - if (element.parent) { - const parent2 = element.parent; - Debug.assertGreaterThanOrEqual(pos, parent2.pos); - Debug.assertLessThanOrEqual(end, parent2.end); - } - setTextRangePosEnd(element, pos, end); - } - function checkNodePositions(node, aggressiveChecks) { - if (aggressiveChecks) { - let pos = node.pos; - const visitNode3 = (child) => { - Debug.assert(child.pos >= pos); - pos = child.end; - }; - if (hasJSDocNodes(node)) { - for (const jsDocComment of node.jsDoc) { - visitNode3(jsDocComment); - } - } - forEachChild(node, visitNode3); - Debug.assert(pos <= node.end); - } - } - function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { - visitNode3(sourceFile); - return; - function visitNode3(child) { - Debug.assert(child.pos <= child.end); - if (child.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange( - child, - sourceFile, - /*isArray*/ - false, - delta, - oldText, - newText, - aggressiveChecks - ); - return; - } - const fullEnd = child.end; - if (fullEnd >= changeStart) { - markAsIntersectingIncrementalChange(child); - unsetNodeChildren(child, sourceFile); - adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - forEachChild(child, visitNode3, visitArray2); - if (hasJSDocNodes(child)) { - for (const jsDocComment of child.jsDoc) { - visitNode3(jsDocComment); - } - } - checkNodePositions(child, aggressiveChecks); - return; - } - Debug.assert(fullEnd < changeStart); - } - function visitArray2(array) { - Debug.assert(array.pos <= array.end); - if (array.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange( - array, - sourceFile, - /*isArray*/ - true, - delta, - oldText, - newText, - aggressiveChecks - ); - return; - } - const fullEnd = array.end; - if (fullEnd >= changeStart) { - markAsIntersectingIncrementalChange(array); - adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (const node of array) { - visitNode3(node); - } - return; - } - Debug.assert(fullEnd < changeStart); - } - } - function extendToAffectedRange(sourceFile, changeRange) { - const maxLookahead = 1; - let start = changeRange.span.start; - for (let i = 0; start > 0 && i <= maxLookahead; i++) { - const nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); - Debug.assert(nearestNode.pos <= start); - const position = nearestNode.pos; - start = Math.max(0, position - 1); - } - const finalSpan = createTextSpanFromBounds(start, textSpanEnd(changeRange.span)); - const finalLength = changeRange.newLength + (changeRange.span.start - start); - return createTextChangeRange(finalSpan, finalLength); - } - function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { - let bestResult = sourceFile; - let lastNodeEntirelyBeforePosition; - forEachChild(sourceFile, visit); - if (lastNodeEntirelyBeforePosition) { - const lastChildOfLastEntireNodeBeforePosition = getLastDescendant(lastNodeEntirelyBeforePosition); - if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { - bestResult = lastChildOfLastEntireNodeBeforePosition; - } - } - return bestResult; - function getLastDescendant(node) { - while (true) { - const lastChild = getLastChild(node); - if (lastChild) { - node = lastChild; - } else { - return node; - } - } - } - function visit(child) { - if (nodeIsMissing(child)) { - return; - } - if (child.pos <= position) { - if (child.pos >= bestResult.pos) { - bestResult = child; - } - if (position < child.end) { - forEachChild(child, visit); - return true; - } else { - Debug.assert(child.end <= position); - lastNodeEntirelyBeforePosition = child; - } - } else { - Debug.assert(child.pos > position); - return true; - } - } - } - function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { - const oldText = sourceFile.text; - if (textChangeRange) { - Debug.assert(oldText.length - textChangeRange.span.length + textChangeRange.newLength === newText.length); - if (aggressiveChecks || Debug.shouldAssert(3 /* VeryAggressive */)) { - const oldTextPrefix = oldText.substr(0, textChangeRange.span.start); - const newTextPrefix = newText.substr(0, textChangeRange.span.start); - Debug.assert(oldTextPrefix === newTextPrefix); - const oldTextSuffix = oldText.substring(textSpanEnd(textChangeRange.span), oldText.length); - const newTextSuffix = newText.substring(textSpanEnd(textChangeRangeNewSpan(textChangeRange)), newText.length); - Debug.assert(oldTextSuffix === newTextSuffix); - } - } - } - function createSyntaxCursor(sourceFile) { - let currentArray = sourceFile.statements; - let currentArrayIndex = 0; - Debug.assert(currentArrayIndex < currentArray.length); - let current = currentArray[currentArrayIndex]; - let lastQueriedPosition = -1 /* Value */; - return { - currentNode(position) { - if (position !== lastQueriedPosition) { - if (current && current.end === position && currentArrayIndex < currentArray.length - 1) { - currentArrayIndex++; - current = currentArray[currentArrayIndex]; - } - if (!current || current.pos !== position) { - findHighestListElementThatStartsAtPosition(position); - } - } - lastQueriedPosition = position; - Debug.assert(!current || current.pos === position); - return current; - } - }; - function findHighestListElementThatStartsAtPosition(position) { - currentArray = void 0; - currentArrayIndex = -1 /* Value */; - current = void 0; - forEachChild(sourceFile, visitNode3, visitArray2); - return; - function visitNode3(node) { - if (position >= node.pos && position < node.end) { - forEachChild(node, visitNode3, visitArray2); - return true; - } - return false; - } - function visitArray2(array) { - if (position >= array.pos && position < array.end) { - for (let i = 0; i < array.length; i++) { - const child = array[i]; - if (child) { - if (child.pos === position) { - currentArray = array; - currentArrayIndex = i; - current = child; - return true; - } else { - if (child.pos < position && position < child.end) { - forEachChild(child, visitNode3, visitArray2); - return true; - } - } - } - } - } - return false; - } - } - } - IncrementalParser2.createSyntaxCursor = createSyntaxCursor; - let InvalidPosition; - ((InvalidPosition2) => { - InvalidPosition2[InvalidPosition2["Value"] = -1] = "Value"; - })(InvalidPosition || (InvalidPosition = {})); -})(IncrementalParser || (IncrementalParser = {})); -function isDeclarationFileName(fileName) { - 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 baseName = getBaseFileName(fileName); - const index = baseName.lastIndexOf(".d."); - if (index >= 0) { - return baseName.substring(index); - } - } - return void 0; -} -function parseResolutionMode(mode, pos, end, reportDiagnostic) { - if (!mode) { - return void 0; - } - if (mode === "import") { - return 99 /* ESNext */; - } - if (mode === "require") { - return 1 /* CommonJS */; - } - reportDiagnostic(pos, end - pos, Diagnostics.resolution_mode_should_be_either_require_or_import); - return void 0; -} -function processCommentPragmas(context, sourceText) { - const pragmas = []; - for (const range of getLeadingCommentRanges(sourceText, 0) || emptyArray) { - const comment = sourceText.substring(range.pos, range.end); - extractPragmas(pragmas, range, comment); - } - context.pragmas = /* @__PURE__ */ new Map(); - for (const pragma of pragmas) { - if (context.pragmas.has(pragma.name)) { - const currentValue = context.pragmas.get(pragma.name); - if (currentValue instanceof Array) { - currentValue.push(pragma.args); - } else { - context.pragmas.set(pragma.name, [currentValue, pragma.args]); - } - continue; - } - context.pragmas.set(pragma.name, pragma.args); - } -} -function processPragmasIntoFields(context, reportDiagnostic) { - context.checkJsDirective = void 0; - context.referencedFiles = []; - context.typeReferenceDirectives = []; - context.libReferenceDirectives = []; - context.amdDependencies = []; - context.hasNoDefaultLib = false; - context.pragmas.forEach((entryOrList, key) => { - switch (key) { - case "reference": { - const referencedFiles = context.referencedFiles; - const typeReferenceDirectives = context.typeReferenceDirectives; - const libReferenceDirectives = context.libReferenceDirectives; - forEach(toArray(entryOrList), (arg) => { - const { types, lib, path, ["resolution-mode"]: res, preserve: _preserve } = arg.arguments; - const preserve = _preserve === "true" ? true : void 0; - if (arg.arguments["no-default-lib"] === "true") { - context.hasNoDefaultLib = true; - } else if (types) { - const parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic); - typeReferenceDirectives.push({ pos: types.pos, end: types.end, fileName: types.value, ...parsed ? { resolutionMode: parsed } : {}, ...preserve ? { preserve } : {} }); - } else if (lib) { - libReferenceDirectives.push({ pos: lib.pos, end: lib.end, fileName: lib.value, ...preserve ? { preserve } : {} }); - } else if (path) { - referencedFiles.push({ pos: path.pos, end: path.end, fileName: path.value, ...preserve ? { preserve } : {} }); - } else { - reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, Diagnostics.Invalid_reference_directive_syntax); - } - }); - break; - } - case "amd-dependency": { - context.amdDependencies = map( - toArray(entryOrList), - (x) => ({ name: x.arguments.name, path: x.arguments.path }) - ); - break; - } - case "amd-module": { - if (entryOrList instanceof Array) { - for (const entry of entryOrList) { - if (context.moduleName) { - reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments); - } - context.moduleName = entry.arguments.name; - } - } else { - context.moduleName = entryOrList.arguments.name; - } - break; - } - case "ts-nocheck": - case "ts-check": { - forEach(toArray(entryOrList), (entry) => { - if (!context.checkJsDirective || entry.range.pos > context.checkJsDirective.pos) { - context.checkJsDirective = { - enabled: key === "ts-check", - end: entry.range.end, - pos: entry.range.pos - }; - } - }); - break; - } - case "jsx": - case "jsxfrag": - case "jsximportsource": - case "jsxruntime": - return; - // Accessed directly - default: - Debug.fail("Unhandled pragma kind"); - } - }); -} -var namedArgRegExCache = /* @__PURE__ */ new Map(); -function getNamedArgRegEx(name) { - if (namedArgRegExCache.has(name)) { - return namedArgRegExCache.get(name); - } - const result = new RegExp(`(\\s${name}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`, "im"); - namedArgRegExCache.set(name, result); - return result; -} -var tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/m; -var singleLinePragmaRegEx = /^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m; -function extractPragmas(pragmas, range, text) { - const tripleSlash = range.kind === 2 /* SingleLineCommentTrivia */ && tripleSlashXMLCommentStartRegEx.exec(text); - if (tripleSlash) { - const name = tripleSlash[1].toLowerCase(); - const pragma = commentPragmas[name]; - if (!pragma || !(pragma.kind & 1 /* TripleSlashXML */)) { - return; - } - if (pragma.args) { - const argument = {}; - for (const arg of pragma.args) { - const matcher = getNamedArgRegEx(arg.name); - const matchResult = matcher.exec(text); - if (!matchResult && !arg.optional) { - return; - } else if (matchResult) { - const value = matchResult[2] || matchResult[3]; - if (arg.captureSpan) { - const startPos = range.pos + matchResult.index + matchResult[1].length + 1; - argument[arg.name] = { - value, - pos: startPos, - end: startPos + value.length - }; - } else { - argument[arg.name] = value; - } - } - } - pragmas.push({ name, args: { arguments: argument, range } }); - } else { - pragmas.push({ name, args: { arguments: {}, range } }); - } - return; - } - const singleLine = range.kind === 2 /* SingleLineCommentTrivia */ && singleLinePragmaRegEx.exec(text); - if (singleLine) { - return addPragmaForMatch(pragmas, range, 2 /* SingleLine */, singleLine); - } - if (range.kind === 3 /* MultiLineCommentTrivia */) { - const multiLinePragmaRegEx = /@(\S+)(\s+(?:\S.*)?)?$/gm; - let multiLineMatch; - while (multiLineMatch = multiLinePragmaRegEx.exec(text)) { - addPragmaForMatch(pragmas, range, 4 /* MultiLine */, multiLineMatch); - } - } -} -function addPragmaForMatch(pragmas, range, kind, match) { - if (!match) return; - const name = match[1].toLowerCase(); - const pragma = commentPragmas[name]; - if (!pragma || !(pragma.kind & kind)) { - return; - } - const args = match[2]; - const argument = getNamedPragmaArguments(pragma, args); - if (argument === "fail") return; - pragmas.push({ name, args: { arguments: argument, range } }); - return; -} -function getNamedPragmaArguments(pragma, text) { - if (!text) return {}; - if (!pragma.args) return {}; - const args = text.trim().split(/\s+/); - const argMap = {}; - for (let i = 0; i < pragma.args.length; i++) { - const argument = pragma.args[i]; - if (!args[i] && !argument.optional) { - return "fail"; - } - if (argument.captureSpan) { - return Debug.fail("Capture spans not yet implemented for non-xml pragmas"); - } - argMap[argument.name] = args[i]; - } - return argMap; -} -function tagNamesAreEquivalent(lhs, rhs) { - if (lhs.kind !== rhs.kind) { - return false; - } - if (lhs.kind === 80 /* Identifier */) { - return lhs.escapedText === rhs.escapedText; - } - if (lhs.kind === 110 /* ThisKeyword */) { - return true; - } - if (lhs.kind === 296 /* 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); -} - -// src/compiler/commandLineParser.ts -var compileOnSaveCommandLineOption = { - name: "compileOnSave", - type: "boolean", - defaultValueDescription: false -}; -var jsxOptionMap = new Map(Object.entries({ - "preserve": 1 /* Preserve */, - "react-native": 3 /* ReactNative */, - "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */, - "react": 2 /* React */ -})); -var inverseJsxOptionMap = new Map(mapIterator(jsxOptionMap.entries(), ([key, value]) => ["" + value, key])); -var libEntries = [ - // JavaScript only - ["es5", "lib.es5.d.ts"], - ["es6", "lib.es2015.d.ts"], - ["es2015", "lib.es2015.d.ts"], - ["es7", "lib.es2016.d.ts"], - ["es2016", "lib.es2016.d.ts"], - ["es2017", "lib.es2017.d.ts"], - ["es2018", "lib.es2018.d.ts"], - ["es2019", "lib.es2019.d.ts"], - ["es2020", "lib.es2020.d.ts"], - ["es2021", "lib.es2021.d.ts"], - ["es2022", "lib.es2022.d.ts"], - ["es2023", "lib.es2023.d.ts"], - ["es2024", "lib.es2024.d.ts"], - ["esnext", "lib.esnext.d.ts"], - // 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"], - ["es2015.collection", "lib.es2015.collection.d.ts"], - ["es2015.generator", "lib.es2015.generator.d.ts"], - ["es2015.iterable", "lib.es2015.iterable.d.ts"], - ["es2015.promise", "lib.es2015.promise.d.ts"], - ["es2015.proxy", "lib.es2015.proxy.d.ts"], - ["es2015.reflect", "lib.es2015.reflect.d.ts"], - ["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.arraybuffer", "lib.es2017.arraybuffer.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"], - ["es2017.intl", "lib.es2017.intl.d.ts"], - ["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"], - ["es2018.asyncgenerator", "lib.es2018.asyncgenerator.d.ts"], - ["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"], - ["es2018.intl", "lib.es2018.intl.d.ts"], - ["es2018.promise", "lib.es2018.promise.d.ts"], - ["es2018.regexp", "lib.es2018.regexp.d.ts"], - ["es2019.array", "lib.es2019.array.d.ts"], - ["es2019.object", "lib.es2019.object.d.ts"], - ["es2019.string", "lib.es2019.string.d.ts"], - ["es2019.symbol", "lib.es2019.symbol.d.ts"], - ["es2019.intl", "lib.es2019.intl.d.ts"], - ["es2020.bigint", "lib.es2020.bigint.d.ts"], - ["es2020.date", "lib.es2020.date.d.ts"], - ["es2020.promise", "lib.es2020.promise.d.ts"], - ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], - ["es2020.string", "lib.es2020.string.d.ts"], - ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], - ["es2020.intl", "lib.es2020.intl.d.ts"], - ["es2020.number", "lib.es2020.number.d.ts"], - ["es2021.promise", "lib.es2021.promise.d.ts"], - ["es2021.string", "lib.es2021.string.d.ts"], - ["es2021.weakref", "lib.es2021.weakref.d.ts"], - ["es2021.intl", "lib.es2021.intl.d.ts"], - ["es2022.array", "lib.es2022.array.d.ts"], - ["es2022.error", "lib.es2022.error.d.ts"], - ["es2022.intl", "lib.es2022.intl.d.ts"], - ["es2022.object", "lib.es2022.object.d.ts"], - ["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"], - ["es2023.intl", "lib.es2023.intl.d.ts"], - ["es2024.arraybuffer", "lib.es2024.arraybuffer.d.ts"], - ["es2024.collection", "lib.es2024.collection.d.ts"], - ["es2024.object", "lib.es2024.object.d.ts"], - ["es2024.promise", "lib.es2024.promise.d.ts"], - ["es2024.regexp", "lib.es2024.regexp.d.ts"], - ["es2024.sharedmemory", "lib.es2024.sharedmemory.d.ts"], - ["es2024.string", "lib.es2024.string.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.es2024.promise.d.ts"], - ["esnext.weakref", "lib.es2021.weakref.d.ts"], - ["esnext.decorators", "lib.esnext.decorators.d.ts"], - ["esnext.object", "lib.es2024.object.d.ts"], - ["esnext.array", "lib.esnext.array.d.ts"], - ["esnext.regexp", "lib.es2024.regexp.d.ts"], - ["esnext.string", "lib.es2024.string.d.ts"], - ["esnext.iterator", "lib.esnext.iterator.d.ts"], - ["esnext.promise", "lib.esnext.promise.d.ts"], - ["esnext.float16", "lib.esnext.float16.d.ts"], - ["esnext.error", "lib.esnext.error.d.ts"], - ["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"], - ["decorators", "lib.decorators.d.ts"], - ["decorators.legacy", "lib.decorators.legacy.d.ts"] -]; -var libs = libEntries.map((entry) => entry[0]); -var libMap = new Map(libEntries); -var optionsForWatch = [ - { - name: "watchFile", - type: new Map(Object.entries({ - fixedpollinginterval: 0 /* FixedPollingInterval */, - prioritypollinginterval: 1 /* PriorityPollingInterval */, - dynamicprioritypolling: 2 /* DynamicPriorityPolling */, - fixedchunksizepolling: 3 /* FixedChunkSizePolling */, - usefsevents: 4 /* UseFsEvents */, - usefseventsonparentdirectory: 5 /* UseFsEventsOnParentDirectory */ - })), - category: Diagnostics.Watch_and_Build_Modes, - description: Diagnostics.Specify_how_the_TypeScript_watch_mode_works, - defaultValueDescription: 4 /* UseFsEvents */ - }, - { - name: "watchDirectory", - type: new Map(Object.entries({ - usefsevents: 0 /* UseFsEvents */, - fixedpollinginterval: 1 /* FixedPollingInterval */, - dynamicprioritypolling: 2 /* DynamicPriorityPolling */, - fixedchunksizepolling: 3 /* FixedChunkSizePolling */ - })), - category: Diagnostics.Watch_and_Build_Modes, - description: Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality, - defaultValueDescription: 0 /* UseFsEvents */ - }, - { - name: "fallbackPolling", - type: new Map(Object.entries({ - fixedinterval: 0 /* FixedInterval */, - priorityinterval: 1 /* PriorityInterval */, - dynamicpriority: 2 /* DynamicPriority */, - fixedchunksize: 3 /* FixedChunkSize */ - })), - category: Diagnostics.Watch_and_Build_Modes, - description: Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers, - defaultValueDescription: 1 /* PriorityInterval */ - }, - { - name: "synchronousWatchDirectory", - type: "boolean", - category: Diagnostics.Watch_and_Build_Modes, - description: Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively, - defaultValueDescription: false - }, - { - name: "excludeDirectories", - type: "list", - element: { - name: "excludeDirectory", - type: "string", - isFilePath: true, - extraValidation: specToDiagnostic - }, - allowConfigDirTemplateSubstitution: true, - category: Diagnostics.Watch_and_Build_Modes, - description: Diagnostics.Remove_a_list_of_directories_from_the_watch_process - }, - { - name: "excludeFiles", - type: "list", - element: { - name: "excludeFile", - type: "string", - isFilePath: true, - extraValidation: specToDiagnostic - }, - allowConfigDirTemplateSubstitution: true, - category: Diagnostics.Watch_and_Build_Modes, - description: Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing - } -]; -var commonOptionsWithBuild = [ - { - name: "help", - shortName: "h", - type: "boolean", - showInSimplifiedHelpView: true, - isCommandLineOnly: true, - category: Diagnostics.Command_line_Options, - description: Diagnostics.Print_this_message, - defaultValueDescription: false - }, - { - name: "help", - shortName: "?", - type: "boolean", - isCommandLineOnly: true, - category: Diagnostics.Command_line_Options, - defaultValueDescription: false - }, - { - name: "watch", - shortName: "w", - type: "boolean", - showInSimplifiedHelpView: true, - isCommandLineOnly: true, - category: Diagnostics.Command_line_Options, - description: Diagnostics.Watch_input_files, - defaultValueDescription: false - }, - { - name: "preserveWatchOutput", - type: "boolean", - showInSimplifiedHelpView: false, - category: Diagnostics.Output_Formatting, - description: Diagnostics.Disable_wiping_the_console_in_watch_mode, - defaultValueDescription: false - }, - { - name: "listFiles", - type: "boolean", - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Print_all_of_the_files_read_during_the_compilation, - defaultValueDescription: false - }, - { - name: "explainFiles", - type: "boolean", - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included, - defaultValueDescription: false - }, - { - name: "listEmittedFiles", - type: "boolean", - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Print_the_names_of_emitted_files_after_a_compilation, - defaultValueDescription: false - }, - { - name: "pretty", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Output_Formatting, - description: Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read, - defaultValueDescription: true - }, - { - name: "traceResolution", - type: "boolean", - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Log_paths_used_during_the_moduleResolution_process, - defaultValueDescription: false - }, - { - name: "diagnostics", - type: "boolean", - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Output_compiler_performance_information_after_building, - defaultValueDescription: false - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Output_more_detailed_compiler_performance_information_after_building, - defaultValueDescription: false - }, - { - name: "generateCpuProfile", - type: "string", - isFilePath: true, - paramType: Diagnostics.FILE_OR_DIRECTORY, - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging, - defaultValueDescription: "profile.cpuprofile" - }, - { - name: "generateTrace", - type: "string", - isFilePath: true, - paramType: Diagnostics.DIRECTORY, - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Generates_an_event_trace_and_a_list_of_types - }, - { - name: "incremental", - shortName: "i", - type: "boolean", - category: Diagnostics.Projects, - description: Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects, - transpileOptionValue: void 0, - defaultValueDescription: Diagnostics.false_unless_composite_is_set - }, - { - name: "declaration", - shortName: "d", - type: "boolean", - // Not setting affectsEmit because we calculate this flag might not affect full emit - affectsBuildInfo: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - transpileOptionValue: void 0, - description: Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project, - defaultValueDescription: Diagnostics.false_unless_composite_is_set - }, - { - name: "declarationMap", - type: "boolean", - // Not setting affectsEmit because we calculate this flag might not affect full emit - affectsBuildInfo: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - defaultValueDescription: false, - description: Diagnostics.Create_sourcemaps_for_d_ts_files - }, - { - name: "emitDeclarationOnly", - type: "boolean", - // Not setting affectsEmit because we calculate this flag might not affect full emit - affectsBuildInfo: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - description: Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files, - transpileOptionValue: void 0, - defaultValueDescription: false - }, - { - name: "sourceMap", - type: "boolean", - // Not setting affectsEmit because we calculate this flag might not affect full emit - affectsBuildInfo: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - defaultValueDescription: false, - description: Diagnostics.Create_source_map_files_for_emitted_JavaScript_files - }, - { - name: "inlineSourceMap", - type: "boolean", - // Not setting affectsEmit because we calculate this flag might not affect full emit - affectsBuildInfo: true, - category: Diagnostics.Emit, - description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript, - defaultValueDescription: false - }, - { - name: "noCheck", - type: "boolean", - showInSimplifiedHelpView: false, - category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported, - transpileOptionValue: true, - defaultValueDescription: false - // Not setting affectsSemanticDiagnostics or affectsBuildInfo because we dont want all diagnostics to go away, its handled in builder - }, - { - name: "noEmit", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - description: Diagnostics.Disable_emitting_files_from_a_compilation, - transpileOptionValue: void 0, - defaultValueDescription: false - }, - { - name: "assumeChangesOnlyAffectDirectDependencies", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Watch_and_Build_Modes, - description: Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it, - defaultValueDescription: false - }, - { - name: "locale", - type: "string", - category: Diagnostics.Command_line_Options, - isCommandLineOnly: true, - description: Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit, - defaultValueDescription: Diagnostics.Platform_specific - } -]; -var targetOptionDeclaration = { - name: "target", - shortName: "t", - type: new Map(Object.entries({ - es3: 0 /* ES3 */, - es5: 1 /* ES5 */, - es6: 2 /* ES2015 */, - es2015: 2 /* ES2015 */, - es2016: 3 /* ES2016 */, - es2017: 4 /* ES2017 */, - es2018: 5 /* ES2018 */, - es2019: 6 /* ES2019 */, - es2020: 7 /* ES2020 */, - es2021: 8 /* ES2021 */, - es2022: 9 /* ES2022 */, - es2023: 10 /* ES2023 */, - es2024: 11 /* ES2024 */, - esnext: 99 /* ESNext */ - })), - affectsSourceFile: true, - affectsModuleResolution: true, - affectsEmit: true, - affectsBuildInfo: true, - deprecatedKeys: /* @__PURE__ */ new Set(["es3"]), - paramType: Diagnostics.VERSION, - showInSimplifiedHelpView: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations, - defaultValueDescription: 1 /* ES5 */ -}; -var moduleOptionDeclaration = { - name: "module", - shortName: "m", - type: new Map(Object.entries({ - none: 0 /* None */, - commonjs: 1 /* CommonJS */, - amd: 2 /* AMD */, - system: 4 /* System */, - umd: 3 /* UMD */, - es6: 5 /* ES2015 */, - es2015: 5 /* ES2015 */, - es2020: 6 /* ES2020 */, - es2022: 7 /* ES2022 */, - esnext: 99 /* ESNext */, - node16: 100 /* Node16 */, - node18: 101 /* Node18 */, - node20: 102 /* Node20 */, - nodenext: 199 /* NodeNext */, - preserve: 200 /* Preserve */ - })), - affectsSourceFile: true, - affectsModuleResolution: true, - affectsEmit: true, - affectsBuildInfo: true, - paramType: Diagnostics.KIND, - showInSimplifiedHelpView: true, - category: Diagnostics.Modules, - description: Diagnostics.Specify_what_module_code_is_generated, - defaultValueDescription: void 0 -}; -var commandOptionsWithoutBuild = [ - // CommandLine only options - { - name: "all", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Command_line_Options, - description: Diagnostics.Show_all_compiler_options, - defaultValueDescription: false - }, - { - name: "version", - shortName: "v", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Command_line_Options, - description: Diagnostics.Print_the_compiler_s_version, - defaultValueDescription: false - }, - { - name: "init", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Command_line_Options, - description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, - defaultValueDescription: false - }, - { - name: "project", - shortName: "p", - type: "string", - isFilePath: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Command_line_Options, - paramType: Diagnostics.FILE_OR_DIRECTORY, - description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json - }, - { - name: "showConfig", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Command_line_Options, - isCommandLineOnly: true, - description: Diagnostics.Print_the_final_configuration_instead_of_building, - defaultValueDescription: false - }, - { - name: "listFilesOnly", - type: "boolean", - category: Diagnostics.Command_line_Options, - isCommandLineOnly: true, - description: Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing, - defaultValueDescription: false - }, - // Basic - targetOptionDeclaration, - moduleOptionDeclaration, - { - name: "lib", - type: "list", - element: { - name: "lib", - type: libMap, - defaultValueDescription: void 0 - }, - affectsProgramStructure: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment, - transpileOptionValue: void 0 - }, - { - name: "allowJs", - type: "boolean", - 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, - defaultValueDescription: false - }, - { - 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, - defaultValueDescription: false - }, - { - name: "jsx", - type: jsxOptionMap, - affectsSourceFile: true, - 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, - description: Diagnostics.Specify_what_JSX_code_is_generated, - defaultValueDescription: void 0 - }, - { - name: "outFile", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - affectsDeclarationPath: true, - isFilePath: true, - paramType: Diagnostics.FILE, - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - description: Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output, - transpileOptionValue: void 0 - }, - { - name: "outDir", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - affectsDeclarationPath: true, - isFilePath: true, - paramType: Diagnostics.DIRECTORY, - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - description: Diagnostics.Specify_an_output_folder_for_all_emitted_files - }, - { - name: "rootDir", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - affectsDeclarationPath: true, - isFilePath: true, - paramType: Diagnostics.LOCATION, - category: Diagnostics.Modules, - description: Diagnostics.Specify_the_root_folder_within_your_source_files, - defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files - }, - { - name: "composite", - type: "boolean", - // Not setting affectsEmit because we calculate this flag might not affect full emit - affectsBuildInfo: true, - isTSConfigOnly: true, - category: Diagnostics.Projects, - transpileOptionValue: void 0, - defaultValueDescription: false, - description: Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references - }, - { - name: "tsBuildInfoFile", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - isFilePath: true, - paramType: Diagnostics.FILE, - category: Diagnostics.Projects, - transpileOptionValue: void 0, - defaultValueDescription: ".tsbuildinfo", - description: Diagnostics.Specify_the_path_to_tsbuildinfo_incremental_compilation_file - }, - { - name: "removeComments", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Emit, - defaultValueDescription: false, - description: Diagnostics.Disable_emitting_comments - }, - { - name: "importHelpers", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - affectsSourceFile: true, - category: Diagnostics.Emit, - description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file, - defaultValueDescription: false - }, - { - name: "importsNotUsedAsValues", - type: new Map(Object.entries({ - remove: 0 /* Remove */, - preserve: 1 /* Preserve */, - error: 2 /* Error */ - })), - affectsEmit: true, - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types, - defaultValueDescription: 0 /* Remove */ - }, - { - name: "downlevelIteration", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Emit, - description: Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration, - defaultValueDescription: false - }, - { - name: "isolatedModules", - type: "boolean", - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports, - transpileOptionValue: true, - defaultValueDescription: false - }, - { - name: "verbatimModuleSyntax", - type: "boolean", - affectsEmit: true, - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting, - defaultValueDescription: false - }, - { - name: "isolatedDeclarations", - type: "boolean", - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files, - defaultValueDescription: false, - affectsBuildInfo: true, - affectsSemanticDiagnostics: true - }, - { - name: "erasableSyntaxOnly", - type: "boolean", - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript, - defaultValueDescription: false, - affectsBuildInfo: true, - affectsSemanticDiagnostics: true - }, - { - name: "libReplacement", - type: "boolean", - affectsProgramStructure: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Enable_lib_replacement, - defaultValueDescription: true - }, - // Strict Type Checks - { - name: "strict", - type: "boolean", - // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here - // The value of each strictFlag depends on own strictFlag value or this and never accessed directly. - // But we need to store `strict` in builf info, even though it won't be examined directly, so that the - // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly - affectsBuildInfo: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_all_strict_type_checking_options, - defaultValueDescription: false - }, - { - name: "noImplicitAny", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "strictNullChecks", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.When_type_checking_take_into_account_null_and_undefined, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "strictFunctionTypes", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "strictBindCallApply", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "strictPropertyInitialization", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "strictBuiltinIteratorReturn", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "noImplicitThis", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "useUnknownInCatchVariables", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - { - name: "alwaysStrict", - type: "boolean", - affectsSourceFile: true, - affectsEmit: true, - affectsBuildInfo: true, - strictFlag: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Ensure_use_strict_is_always_emitted, - defaultValueDescription: Diagnostics.false_unless_strict_is_set - }, - // Additional Checks - { - name: "noUnusedLocals", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read, - defaultValueDescription: false - }, - { - name: "noUnusedParameters", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read, - defaultValueDescription: false - }, - { - name: "exactOptionalPropertyTypes", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined, - defaultValueDescription: false - }, - { - name: "noImplicitReturns", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function, - defaultValueDescription: false - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - affectsBindDiagnostics: true, - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements, - defaultValueDescription: false - }, - { - name: "noUncheckedIndexedAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index, - defaultValueDescription: false - }, - { - name: "noImplicitOverride", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier, - defaultValueDescription: false - }, - { - name: "noPropertyAccessFromIndexSignature", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - showInSimplifiedHelpView: false, - category: Diagnostics.Type_Checking, - description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type, - defaultValueDescription: false - }, - // Module Resolution - { - name: "moduleResolution", - type: new Map(Object.entries({ - // N.B. The first entry specifies the value shown in `tsc --init` - node10: 2 /* Node10 */, - node: 2 /* Node10 */, - classic: 1 /* Classic */, - node16: 3 /* Node16 */, - nodenext: 99 /* NodeNext */, - bundler: 100 /* Bundler */ - })), - deprecatedKeys: /* @__PURE__ */ new Set(["node"]), - affectsSourceFile: true, - affectsModuleResolution: true, - paramType: Diagnostics.STRATEGY, - category: Diagnostics.Modules, - description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier, - defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node - }, - { - name: "baseUrl", - type: "string", - affectsModuleResolution: true, - isFilePath: true, - category: Diagnostics.Modules, - description: Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "paths", - type: "object", - affectsModuleResolution: true, - allowConfigDirTemplateSubstitution: true, - isTSConfigOnly: true, - category: Diagnostics.Modules, - description: Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations, - transpileOptionValue: void 0 - }, - { - // this option can only be specified in tsconfig.json - // use type = object to copy the value as-is - name: "rootDirs", - type: "list", - isTSConfigOnly: true, - element: { - name: "rootDirs", - type: "string", - isFilePath: true - }, - affectsModuleResolution: true, - allowConfigDirTemplateSubstitution: true, - category: Diagnostics.Modules, - description: Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules, - transpileOptionValue: void 0, - defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files - }, - { - name: "typeRoots", - type: "list", - element: { - name: "typeRoots", - type: "string", - isFilePath: true - }, - affectsModuleResolution: true, - allowConfigDirTemplateSubstitution: true, - category: Diagnostics.Modules, - description: Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types - }, - { - name: "types", - type: "list", - element: { - name: "types", - type: "string" - }, - affectsProgramStructure: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Modules, - description: Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file, - transpileOptionValue: void 0 - }, - { - name: "allowSyntheticDefaultImports", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export, - defaultValueDescription: Diagnostics.module_system_or_esModuleInterop - }, - { - name: "esModuleInterop", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsBuildInfo: true, - showInSimplifiedHelpView: true, - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility, - defaultValueDescription: false - }, - { - name: "preserveSymlinks", - type: "boolean", - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node, - defaultValueDescription: false - }, - { - name: "allowUmdGlobalAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Modules, - description: Diagnostics.Allow_accessing_UMD_globals_from_modules, - defaultValueDescription: false - }, - { - name: "moduleSuffixes", - type: "list", - element: { - name: "suffix", - type: "string" - }, - listPreserveFalsyValues: true, - affectsModuleResolution: true, - category: Diagnostics.Modules, - description: Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module - }, - { - name: "allowImportingTsExtensions", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Modules, - description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, - defaultValueDescription: false, - transpileOptionValue: void 0 - }, - { - name: "rewriteRelativeImportExtensions", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Modules, - description: Diagnostics.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files, - defaultValueDescription: false - }, - { - name: "resolvePackageJsonExports", - type: "boolean", - affectsModuleResolution: true, - category: Diagnostics.Modules, - description: Diagnostics.Use_the_package_json_exports_field_when_resolving_package_imports, - defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false - }, - { - name: "resolvePackageJsonImports", - type: "boolean", - affectsModuleResolution: true, - category: Diagnostics.Modules, - description: Diagnostics.Use_the_package_json_imports_field_when_resolving_imports, - defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false - }, - { - name: "customConditions", - type: "list", - element: { - name: "condition", - type: "string" - }, - affectsModuleResolution: true, - category: Diagnostics.Modules, - description: Diagnostics.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports - }, - { - name: "noUncheckedSideEffectImports", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Modules, - description: Diagnostics.Check_side_effect_imports, - defaultValueDescription: false - }, - // Source Maps - { - name: "sourceRoot", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - paramType: Diagnostics.LOCATION, - category: Diagnostics.Emit, - description: Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code - }, - { - name: "mapRoot", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - paramType: Diagnostics.LOCATION, - category: Diagnostics.Emit, - description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations - }, - { - name: "inlineSources", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Emit, - description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript, - defaultValueDescription: false - }, - // Experimental - { - name: "experimentalDecorators", - type: "boolean", - affectsEmit: true, - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Enable_experimental_support_for_legacy_experimental_decorators, - defaultValueDescription: false - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files, - defaultValueDescription: false - }, - // Advanced - { - name: "jsxFactory", - type: "string", - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h, - defaultValueDescription: "`React.createElement`" - }, - { - name: "jsxFragmentFactory", - type: "string", - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment, - defaultValueDescription: "React.Fragment" - }, - { - name: "jsxImportSource", - type: "string", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsBuildInfo: true, - affectsModuleResolution: true, - affectsSourceFile: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk, - defaultValueDescription: "react" - }, - { - name: "resolveJsonModule", - type: "boolean", - affectsModuleResolution: true, - category: Diagnostics.Modules, - description: Diagnostics.Enable_importing_json_files, - defaultValueDescription: false - }, - { - name: "allowArbitraryExtensions", - type: "boolean", - affectsProgramStructure: true, - category: Diagnostics.Modules, - description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present, - defaultValueDescription: false - }, - { - name: "out", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - affectsDeclarationPath: true, - isFilePath: false, - // This is intentionally broken to support compatibility with existing tsconfig files - // for correct behaviour, please use outFile - category: Diagnostics.Backwards_Compatibility, - paramType: Diagnostics.FILE, - transpileOptionValue: void 0, - description: Diagnostics.Deprecated_setting_Use_outFile_instead - }, - { - name: "reactNamespace", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit, - defaultValueDescription: "`React`" - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - // We need to store these to determine whether `lib` files need to be rechecked - affectsBuildInfo: true, - category: Diagnostics.Completeness, - description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript, - defaultValueDescription: false - }, - { - name: "charset", - type: "string", - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files, - defaultValueDescription: "utf8" - }, - { - name: "emitBOM", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Emit, - description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files, - defaultValueDescription: false - }, - { - name: "newLine", - type: new Map(Object.entries({ - crlf: 0 /* CarriageReturnLineFeed */, - lf: 1 /* LineFeed */ - })), - affectsEmit: true, - affectsBuildInfo: true, - paramType: Diagnostics.NEWLINE, - category: Diagnostics.Emit, - description: Diagnostics.Set_the_newline_character_for_emitting_files, - defaultValueDescription: "lf" - }, - { - name: "noErrorTruncation", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Output_Formatting, - description: Diagnostics.Disable_truncating_types_in_error_messages, - defaultValueDescription: false - }, - { - name: "noLib", - type: "boolean", - category: Diagnostics.Language_and_Environment, - affectsProgramStructure: true, - description: Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts, - // We are not returning a sourceFile for lib file when asked by the program, - // so pass --noLib to avoid reporting a file not found error. - transpileOptionValue: true, - defaultValueDescription: false - }, - { - name: "noResolve", - type: "boolean", - affectsModuleResolution: true, - category: Diagnostics.Modules, - description: Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project, - // We are not doing a full typecheck, we are not resolving the whole context, - // so pass --noResolve to avoid reporting missing file errors. - transpileOptionValue: true, - defaultValueDescription: false - }, - { - name: "stripInternal", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Emit, - description: Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments, - defaultValueDescription: false - }, - { - name: "disableSizeLimit", - type: "boolean", - affectsProgramStructure: true, - category: Diagnostics.Editor_Support, - description: Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server, - defaultValueDescription: false - }, - { - name: "disableSourceOfProjectReferenceRedirect", - type: "boolean", - isTSConfigOnly: true, - category: Diagnostics.Projects, - description: Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects, - defaultValueDescription: false - }, - { - name: "disableSolutionSearching", - type: "boolean", - isTSConfigOnly: true, - category: Diagnostics.Projects, - description: Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing, - defaultValueDescription: false - }, - { - name: "disableReferencedProjectLoad", - type: "boolean", - isTSConfigOnly: true, - category: Diagnostics.Projects, - description: Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript, - defaultValueDescription: false - }, - { - name: "noImplicitUseStrict", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files, - defaultValueDescription: false - }, - { - name: "noEmitHelpers", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Emit, - description: Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output, - defaultValueDescription: false - }, - { - name: "noEmitOnError", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Emit, - transpileOptionValue: void 0, - description: Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported, - defaultValueDescription: false - }, - { - name: "preserveConstEnums", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Emit, - description: Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code, - defaultValueDescription: false - }, - { - name: "declarationDir", - type: "string", - affectsEmit: true, - affectsBuildInfo: true, - affectsDeclarationPath: true, - isFilePath: true, - paramType: Diagnostics.DIRECTORY, - category: Diagnostics.Emit, - transpileOptionValue: void 0, - description: Diagnostics.Specify_the_output_directory_for_generated_declaration_files - }, - { - name: "skipLibCheck", - type: "boolean", - // We need to store these to determine whether `lib` files need to be rechecked - affectsBuildInfo: true, - category: Diagnostics.Completeness, - description: Diagnostics.Skip_type_checking_all_d_ts_files, - defaultValueDescription: false - }, - { - name: "allowUnusedLabels", - type: "boolean", - affectsBindDiagnostics: true, - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Disable_error_reporting_for_unused_labels, - defaultValueDescription: void 0 - }, - { - name: "allowUnreachableCode", - type: "boolean", - affectsBindDiagnostics: true, - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Type_Checking, - description: Diagnostics.Disable_error_reporting_for_unreachable_code, - defaultValueDescription: void 0 - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals, - defaultValueDescription: false - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures, - defaultValueDescription: false - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - affectsModuleResolution: true, - category: Diagnostics.Interop_Constraints, - description: Diagnostics.Ensure_that_casing_is_correct_in_imports, - defaultValueDescription: true - }, - { - name: "maxNodeModuleJsDepth", - type: "number", - affectsModuleResolution: true, - category: Diagnostics.JavaScript_Support, - description: Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs, - defaultValueDescription: 0 - }, - { - name: "noStrictGenericChecks", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsBuildInfo: true, - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types, - defaultValueDescription: false - }, - { - name: "useDefineForClassFields", - type: "boolean", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Language_and_Environment, - description: Diagnostics.Emit_ECMAScript_standard_compliant_class_fields, - defaultValueDescription: Diagnostics.true_for_ES2022_and_above_including_ESNext - }, - { - name: "preserveValueImports", - type: "boolean", - affectsEmit: true, - affectsBuildInfo: true, - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed, - defaultValueDescription: false - }, - { - name: "keyofStringsOnly", - type: "boolean", - category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option, - defaultValueDescription: false - }, - { - // A list of plugins to load in the language service - name: "plugins", - type: "list", - isTSConfigOnly: true, - element: { - name: "plugin", - type: "object" - }, - description: Diagnostics.Specify_a_list_of_language_service_plugins_to_include, - category: Diagnostics.Editor_Support - }, - { - name: "moduleDetection", - type: new Map(Object.entries({ - auto: 2 /* Auto */, - 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, - defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules - }, - { - name: "ignoreDeprecations", - type: "string", - defaultValueDescription: void 0 - } -]; -var optionDeclarations = [ - ...commonOptionsWithBuild, - ...commandOptionsWithoutBuild -]; -var semanticDiagnosticsOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsSemanticDiagnostics); -var affectsEmitOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsEmit); -var affectsDeclarationPathOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsDeclarationPath); -var moduleResolutionOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsModuleResolution); -var sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsBindDiagnostics); -var optionsAffectingProgramStructure = optionDeclarations.filter((option) => !!option.affectsProgramStructure); -var transpileOptionValueCompilerOptions = optionDeclarations.filter((option) => hasProperty(option, "transpileOptionValue")); -var configDirTemplateSubstitutionOptions = optionDeclarations.filter( - (option) => option.allowConfigDirTemplateSubstitution || !option.isCommandLineOnly && option.isFilePath -); -var configDirTemplateSubstitutionWatchOptions = optionsForWatch.filter( - (option) => option.allowConfigDirTemplateSubstitution || !option.isCommandLineOnly && option.isFilePath -); -var commandLineOptionOfCustomType = optionDeclarations.filter(isCommandLineOptionOfCustomType); -function isCommandLineOptionOfCustomType(option) { - return !isString(option.type); -} -var tscBuildOption = { - name: "build", - type: "boolean", - shortName: "b", - showInSimplifiedHelpView: true, - category: Diagnostics.Command_line_Options, - description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date, - defaultValueDescription: false -}; -var optionsForBuild = [ - tscBuildOption, - { - name: "verbose", - shortName: "v", - category: Diagnostics.Command_line_Options, - description: Diagnostics.Enable_verbose_logging, - type: "boolean", - defaultValueDescription: false - }, - { - name: "dry", - shortName: "d", - category: Diagnostics.Command_line_Options, - description: Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean, - type: "boolean", - defaultValueDescription: false - }, - { - name: "force", - shortName: "f", - category: Diagnostics.Command_line_Options, - description: Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date, - type: "boolean", - defaultValueDescription: false - }, - { - name: "clean", - category: Diagnostics.Command_line_Options, - description: Diagnostics.Delete_the_outputs_of_all_projects, - type: "boolean", - defaultValueDescription: false - }, - { - name: "stopBuildOnErrors", - category: Diagnostics.Command_line_Options, - description: Diagnostics.Skip_building_downstream_projects_on_error_in_upstream_project, - type: "boolean", - defaultValueDescription: false - } -]; -var buildOpts = [ - ...commonOptionsWithBuild, - ...optionsForBuild -]; -var typeAcquisitionDeclarations = [ - { - name: "enable", - type: "boolean", - defaultValueDescription: false - }, - { - name: "include", - type: "list", - element: { - name: "include", - type: "string" - } - }, - { - name: "exclude", - type: "list", - element: { - name: "exclude", - type: "string" - } - }, - { - name: "disableFilenameBasedTypeAcquisition", - type: "boolean", - defaultValueDescription: false - } -]; -function createOptionNameMap(optionDeclarations2) { - const optionsNameMap = /* @__PURE__ */ new Map(); - const shortOptionNames = /* @__PURE__ */ new Map(); - forEach(optionDeclarations2, (option) => { - optionsNameMap.set(option.name.toLowerCase(), option); - if (option.shortName) { - shortOptionNames.set(option.shortName, option.name); - } - }); - return { optionsNameMap, shortOptionNames }; -} -var optionsNameMapCache; -function getOptionsNameMap() { - return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(optionDeclarations)); -} -var compilerOptionsAlternateMode = { - diagnostic: Diagnostics.Compiler_option_0_may_only_be_used_with_build, - getOptionsNameMap: getBuildOptionsNameMap -}; -var defaultInitCompilerOptions = { - module: 1 /* CommonJS */, - target: 3 /* ES2016 */, - strict: true, - esModuleInterop: true, - forceConsistentCasingInFileNames: true, - skipLibCheck: true -}; -function createCompilerDiagnosticForInvalidCustomType(opt) { - return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic); -} -function createDiagnosticForInvalidCustomType(opt, createDiagnostic) { - const namesOfType = arrayFrom(opt.type.keys()); - const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", "); - return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames); -} -function parseCustomTypeOption(opt, value, errors) { - return convertJsonOptionOfCustomType(opt, (value ?? "").trim(), errors); -} -function parseListTypeOption(opt, value = "", errors) { - value = value.trim(); - if (startsWith(value, "-")) { - return void 0; - } - if (opt.type === "listOrElement" && !value.includes(",")) { - return validateJsonOptionValue(opt, value, errors); - } - if (value === "") { - return []; - } - const values = value.split(","); - switch (opt.element.type) { - case "number": - return mapDefined(values, (v) => validateJsonOptionValue(opt.element, parseInt(v), errors)); - case "string": - return mapDefined(values, (v) => validateJsonOptionValue(opt.element, v || "", errors)); - case "boolean": - case "object": - return Debug.fail(`List of ${opt.element.type} is not yet supported.`); - default: - return mapDefined(values, (v) => parseCustomTypeOption(opt.element, v, errors)); - } -} -function getOptionName(option) { - return option.name; -} -function createUnknownOptionError(unknownOption, diagnostics, unknownOptionErrorText, node, sourceFile) { - var _a; - const otherOption = (_a = diagnostics.alternateMode) == null ? void 0 : _a.getOptionsNameMap().optionsNameMap.get(unknownOption.toLowerCase()); - if (otherOption) { - return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic( - sourceFile, - node, - otherOption !== tscBuildOption ? diagnostics.alternateMode.diagnostic : Diagnostics.Option_build_must_be_the_first_command_line_argument, - unknownOption - ); - } - const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName); - return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption); -} -function parseCommandLineWorker(diagnostics, commandLine, readFile) { - const options = {}; - let watchOptions; - const fileNames = []; - const errors = []; - parseStrings(commandLine); - return { - options, - watchOptions, - fileNames, - errors - }; - function parseStrings(args) { - let i = 0; - while (i < args.length) { - const s = args[i]; - i++; - if (s.charCodeAt(0) === 64 /* at */) { - parseResponseFile(s.slice(1)); - } else if (s.charCodeAt(0) === 45 /* minus */) { - const inputOptionName = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1); - const opt = getOptionDeclarationFromName( - diagnostics.getOptionsNameMap, - inputOptionName, - /*allowShort*/ - true - ); - if (opt) { - i = parseOptionValue(args, i, diagnostics, opt, options, errors); - } else { - const watchOpt = getOptionDeclarationFromName( - watchOptionsDidYouMeanDiagnostics.getOptionsNameMap, - inputOptionName, - /*allowShort*/ - true - ); - if (watchOpt) { - i = parseOptionValue(args, i, watchOptionsDidYouMeanDiagnostics, watchOpt, watchOptions || (watchOptions = {}), errors); - } else { - errors.push(createUnknownOptionError(inputOptionName, diagnostics, s)); - } - } - } else { - fileNames.push(s); - } - } - } - function parseResponseFile(fileName) { - const text = tryReadFile(fileName, readFile || ((fileName2) => sys.readFile(fileName2))); - if (!isString(text)) { - errors.push(text); - return; - } - const args = []; - let pos = 0; - while (true) { - while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */) pos++; - if (pos >= text.length) break; - const start = pos; - if (text.charCodeAt(start) === 34 /* doubleQuote */) { - pos++; - while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */) pos++; - if (pos < text.length) { - args.push(text.substring(start + 1, pos)); - pos++; - } else { - errors.push(createCompilerDiagnostic(Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName)); - } - } else { - while (text.charCodeAt(pos) > 32 /* space */) pos++; - args.push(text.substring(start, pos)); - } - } - parseStrings(args); - } -} -function parseOptionValue(args, i, diagnostics, opt, options, errors) { - if (opt.isTSConfigOnly) { - const optValue = args[i]; - if (optValue === "null") { - options[opt.name] = void 0; - i++; - } else if (opt.type === "boolean") { - if (optValue === "false") { - options[opt.name] = validateJsonOptionValue( - opt, - /*value*/ - false, - errors - ); - i++; - } else { - if (optValue === "true") i++; - errors.push(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line, opt.name)); - } - } else { - errors.push(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line, opt.name)); - if (optValue && !startsWith(optValue, "-")) i++; - } - } else { - if (!args[i] && opt.type !== "boolean") { - errors.push(createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt))); - } - if (args[i] !== "null") { - switch (opt.type) { - case "number": - options[opt.name] = validateJsonOptionValue(opt, parseInt(args[i]), errors); - i++; - break; - case "boolean": - const optValue = args[i]; - options[opt.name] = validateJsonOptionValue(opt, optValue !== "false", errors); - if (optValue === "false" || optValue === "true") { - i++; - } - break; - case "string": - options[opt.name] = validateJsonOptionValue(opt, args[i] || "", errors); - i++; - break; - case "list": - const result = parseListTypeOption(opt, args[i], errors); - options[opt.name] = result || []; - if (result) { - i++; - } - break; - case "listOrElement": - Debug.fail("listOrElement not supported here"); - break; - // If not a primitive, the possible types are specified in what is effectively a map of options. - default: - options[opt.name] = parseCustomTypeOption(opt, args[i], errors); - i++; - break; - } - } else { - options[opt.name] = void 0; - i++; - } - } - return i; -} -var compilerOptionsDidYouMeanDiagnostics = { - alternateMode: compilerOptionsAlternateMode, - getOptionsNameMap, - optionDeclarations, - unknownOptionDiagnostic: Diagnostics.Unknown_compiler_option_0, - unknownDidYouMeanDiagnostic: Diagnostics.Unknown_compiler_option_0_Did_you_mean_1, - optionTypeMismatchDiagnostic: Diagnostics.Compiler_option_0_expects_an_argument -}; -function parseCommandLine(commandLine, readFile) { - return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine, readFile); -} -function getOptionFromName(optionName, allowShort) { - return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort); -} -function getOptionDeclarationFromName(getOptionNameMap, optionName, allowShort = false) { - optionName = optionName.toLowerCase(); - const { optionsNameMap, shortOptionNames } = getOptionNameMap(); - if (allowShort) { - const short = shortOptionNames.get(optionName); - if (short !== void 0) { - optionName = short; - } - } - return optionsNameMap.get(optionName); -} -var buildOptionsNameMapCache; -function getBuildOptionsNameMap() { - return buildOptionsNameMapCache || (buildOptionsNameMapCache = createOptionNameMap(buildOpts)); -} -var buildOptionsAlternateMode = { - diagnostic: Diagnostics.Compiler_option_0_may_not_be_used_with_build, - getOptionsNameMap -}; -var buildOptionsDidYouMeanDiagnostics = { - alternateMode: buildOptionsAlternateMode, - getOptionsNameMap: getBuildOptionsNameMap, - optionDeclarations: buildOpts, - unknownOptionDiagnostic: Diagnostics.Unknown_build_option_0, - unknownDidYouMeanDiagnostic: Diagnostics.Unknown_build_option_0_Did_you_mean_1, - optionTypeMismatchDiagnostic: Diagnostics.Build_option_0_requires_a_value_of_type_1 -}; -function parseBuildCommand(commandLine) { - const { options, watchOptions, fileNames: projects, errors } = parseCommandLineWorker( - buildOptionsDidYouMeanDiagnostics, - commandLine - ); - const buildOptions = options; - if (projects.length === 0) { - projects.push("."); - } - if (buildOptions.clean && buildOptions.force) { - errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force")); - } - if (buildOptions.clean && buildOptions.verbose) { - errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose")); - } - if (buildOptions.clean && buildOptions.watch) { - errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch")); - } - if (buildOptions.watch && buildOptions.dry) { - errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry")); - } - return { buildOptions, watchOptions, projects, errors }; -} -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)); - if (!isString(configFileText)) { - host.onUnRecoverableConfigFileDiagnostic(configFileText); - return void 0; - } - const result = parseJsonText(configFileName, configFileText); - const cwd = host.getCurrentDirectory(); - result.path = toPath(configFileName, cwd, createGetCanonicalFileName(host.useCaseSensitiveFileNames)); - result.resolvedPath = result.path; - result.originalFileName = result.fileName; - return parseJsonSourceFileConfigFileContent( - result, - host, - getNormalizedAbsolutePath(getDirectoryPath(configFileName), cwd), - optionsToExtend, - getNormalizedAbsolutePath(configFileName, cwd), - /*resolutionStack*/ - void 0, - extraFileExtensions, - extendedConfigCache, - watchOptionsToExtend - ); -} -function readConfigFile(fileName, readFile) { - const textOrDiagnostic = tryReadFile(fileName, readFile); - return isString(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic }; -} -function parseConfigFileTextToJson(fileName, jsonText) { - const jsonSourceFile = parseJsonText(fileName, jsonText); - return { - config: convertConfigFileToObject( - jsonSourceFile, - jsonSourceFile.parseDiagnostics, - /*jsonConversionNotifier*/ - void 0 - ), - error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0 - }; -} -function readJsonConfigFile(fileName, readFile) { - const textOrDiagnostic = tryReadFile(fileName, readFile); - return isString(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] }; -} -function tryReadFile(fileName, readFile) { - let text; - try { - text = readFile(fileName); - } catch (e) { - return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message); - } - return text === void 0 ? createCompilerDiagnostic(Diagnostics.Cannot_read_file_0, fileName) : text; -} -function commandLineOptionsToMap(options) { - return arrayToMap(options, getOptionName); -} -var typeAcquisitionDidYouMeanDiagnostics = { - optionDeclarations: typeAcquisitionDeclarations, - unknownOptionDiagnostic: Diagnostics.Unknown_type_acquisition_option_0, - unknownDidYouMeanDiagnostic: Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1 -}; -var watchOptionsNameMapCache; -function getWatchOptionsNameMap() { - return watchOptionsNameMapCache || (watchOptionsNameMapCache = createOptionNameMap(optionsForWatch)); -} -var watchOptionsDidYouMeanDiagnostics = { - getOptionsNameMap: getWatchOptionsNameMap, - optionDeclarations: optionsForWatch, - unknownOptionDiagnostic: Diagnostics.Unknown_watch_option_0, - unknownDidYouMeanDiagnostic: Diagnostics.Unknown_watch_option_0_Did_you_mean_1, - optionTypeMismatchDiagnostic: Diagnostics.Watch_option_0_requires_a_value_of_type_1 -}; -var commandLineCompilerOptionsMapCache; -function getCommandLineCompilerOptionsMap() { - return commandLineCompilerOptionsMapCache || (commandLineCompilerOptionsMapCache = commandLineOptionsToMap(optionDeclarations)); -} -var commandLineWatchOptionsMapCache; -function getCommandLineWatchOptionsMap() { - return commandLineWatchOptionsMapCache || (commandLineWatchOptionsMapCache = commandLineOptionsToMap(optionsForWatch)); -} -var commandLineTypeAcquisitionMapCache; -function getCommandLineTypeAcquisitionMap() { - return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations)); -} -var extendsOptionDeclaration = { - name: "extends", - type: "listOrElement", - element: { - name: "extends", - type: "string" - }, - category: Diagnostics.File_Management, - disallowNullOrUndefined: true -}; -var compilerOptionsDeclaration = { - name: "compilerOptions", - type: "object", - elementOptions: getCommandLineCompilerOptionsMap(), - extraKeyDiagnostics: compilerOptionsDidYouMeanDiagnostics -}; -var watchOptionsDeclaration = { - name: "watchOptions", - type: "object", - elementOptions: getCommandLineWatchOptionsMap(), - extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics -}; -var typeAcquisitionDeclaration = { - name: "typeAcquisition", - type: "object", - elementOptions: getCommandLineTypeAcquisitionMap(), - extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics -}; -var _tsconfigRootOptions; -function getTsconfigRootOptionsMap() { - if (_tsconfigRootOptions === void 0) { - _tsconfigRootOptions = { - name: void 0, - // should never be needed since this is root - type: "object", - elementOptions: commandLineOptionsToMap([ - compilerOptionsDeclaration, - watchOptionsDeclaration, - typeAcquisitionDeclaration, - extendsOptionDeclaration, - { - name: "references", - type: "list", - element: { - name: "references", - type: "object" - }, - category: Diagnostics.Projects - }, - { - name: "files", - type: "list", - element: { - name: "files", - type: "string" - }, - category: Diagnostics.File_Management - }, - { - name: "include", - type: "list", - element: { - name: "include", - type: "string" - }, - category: Diagnostics.File_Management, - defaultValueDescription: Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk - }, - { - name: "exclude", - type: "list", - element: { - name: "exclude", - type: "string" - }, - category: Diagnostics.File_Management, - defaultValueDescription: Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified - }, - compileOnSaveCommandLineOption - ]) - }; - } - return _tsconfigRootOptions; -} -function convertConfigFileToObject(sourceFile, errors, jsonConversionNotifier) { - var _a; - const rootExpression = (_a = sourceFile.statements[0]) == null ? void 0 : _a.expression; - if (rootExpression && rootExpression.kind !== 211 /* ObjectLiteralExpression */) { - errors.push(createDiagnosticForNodeInSourceFile( - sourceFile, - rootExpression, - Diagnostics.The_root_value_of_a_0_file_must_be_an_object, - getBaseFileName(sourceFile.fileName) === "jsconfig.json" ? "jsconfig.json" : "tsconfig.json" - )); - if (isArrayLiteralExpression(rootExpression)) { - const firstObject = find(rootExpression.elements, isObjectLiteralExpression); - if (firstObject) { - return convertToJson( - sourceFile, - firstObject, - errors, - /*returnValue*/ - true, - jsonConversionNotifier - ); - } - } - return {}; - } - return convertToJson( - sourceFile, - rootExpression, - errors, - /*returnValue*/ - true, - jsonConversionNotifier - ); -} -function convertToObject(sourceFile, errors) { - var _a; - return convertToJson( - sourceFile, - (_a = sourceFile.statements[0]) == null ? void 0 : _a.expression, - errors, - /*returnValue*/ - true, - /*jsonConversionNotifier*/ - void 0 - ); -} -function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConversionNotifier) { - if (!rootExpression) { - return returnValue ? {} : void 0; - } - return convertPropertyValueToJson(rootExpression, jsonConversionNotifier == null ? void 0 : jsonConversionNotifier.rootOptions); - function convertObjectLiteralExpressionToJson(node, objectOption) { - var _a; - const result = returnValue ? {} : void 0; - for (const element of node.properties) { - if (element.kind !== 304 /* PropertyAssignment */) { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected)); - continue; - } - if (element.questionToken) { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.questionToken, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); - } - if (!isDoubleQuotedString(element.name)) { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.name, Diagnostics.String_literal_with_double_quotes_expected)); - } - const textOfKey = isComputedNonLiteralName(element.name) ? void 0 : getTextOfPropertyName(element.name); - const keyText = textOfKey && unescapeLeadingUnderscores(textOfKey); - const option = keyText ? (_a = objectOption == null ? void 0 : objectOption.elementOptions) == null ? void 0 : _a.get(keyText) : void 0; - const value = convertPropertyValueToJson(element.initializer, option); - if (typeof keyText !== "undefined") { - if (returnValue) { - result[keyText] = value; - } - jsonConversionNotifier == null ? void 0 : jsonConversionNotifier.onPropertySet(keyText, value, element, objectOption, option); - } - } - return result; - } - function convertArrayLiteralExpressionToJson(elements, elementOption) { - if (!returnValue) { - elements.forEach((element) => convertPropertyValueToJson(element, elementOption)); - return void 0; - } - return filter(elements.map((element) => convertPropertyValueToJson(element, elementOption)), (v) => v !== void 0); - } - function convertPropertyValueToJson(valueExpression, option) { - switch (valueExpression.kind) { - case 112 /* TrueKeyword */: - return true; - case 97 /* FalseKeyword */: - return false; - case 106 /* NullKeyword */: - return null; - // eslint-disable-line no-restricted-syntax - case 11 /* StringLiteral */: - if (!isDoubleQuotedString(valueExpression)) { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected)); - } - return valueExpression.text; - case 9 /* NumericLiteral */: - return Number(valueExpression.text); - case 225 /* PrefixUnaryExpression */: - if (valueExpression.operator !== 41 /* MinusToken */ || valueExpression.operand.kind !== 9 /* NumericLiteral */) { - break; - } - return -Number(valueExpression.operand.text); - case 211 /* ObjectLiteralExpression */: - const objectLiteralExpression = valueExpression; - return convertObjectLiteralExpressionToJson(objectLiteralExpression, option); - case 210 /* ArrayLiteralExpression */: - return convertArrayLiteralExpressionToJson( - valueExpression.elements, - option && option.element - ); - } - if (option) { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.Compiler_option_0_requires_a_value_of_type_1, option.name, getCompilerOptionValueTypeString(option))); - } else { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)); - } - return void 0; - } - function isDoubleQuotedString(node) { - return isStringLiteral(node) && isStringDoubleQuoted(node, sourceFile); - } -} -function getCompilerOptionValueTypeString(option) { - return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString(option.type) ? option.type : "string"; -} -function isCompilerOptionsValue(option, value) { - if (option) { - if (isNullOrUndefined(value)) return !option.disallowNullOrUndefined; - if (option.type === "list") { - return isArray(value); - } - if (option.type === "listOrElement") { - return isArray(value) || isCompilerOptionsValue(option.element, value); - } - const expectedType = isString(option.type) ? option.type : "string"; - return typeof value === expectedType; - } - return false; -} -function convertToTSConfig(configParseResult, configFileName, host) { - var _a, _b, _c; - const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - const files = map( - filter( - configParseResult.fileNames, - !((_b = (_a = configParseResult.options.configFile) == null ? void 0 : _a.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs) ? returnTrue : matchesSpecs( - configFileName, - configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs, - configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs, - host - ) - ), - (f) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName) - ); - 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: { - ...optionMapToObject(optionMap), - showConfig: void 0, - configFile: void 0, - configFilePath: void 0, - help: void 0, - init: void 0, - listFiles: void 0, - listEmittedFiles: void 0, - project: void 0, - build: void 0, - version: void 0 - }, - watchOptions: watchOptionMap && optionMapToObject(watchOptionMap), - references: map(configParseResult.projectReferences, (r) => ({ ...r, path: r.originalPath ? r.originalPath : "", originalPath: void 0 })), - files: length(files) ? files : void 0, - ...((_c = configParseResult.options.configFile) == null ? void 0 : _c.configFileSpecs) ? { - include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs), - exclude: configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs - } : {}, - compileOnSave: !!configParseResult.compileOnSave ? true : void 0 - }; - const providedKeys = new Set(optionMap.keys()); - const impliedCompilerOptions = {}; - for (const option in computedOptions) { - if (!providedKeys.has(option) && optionDependsOn(option, providedKeys)) { - 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 optionDependsOn(option, dependsOn) { - const seen = /* @__PURE__ */ new Set(); - return optionDependsOnRecursive(option); - function optionDependsOnRecursive(option2) { - var _a; - if (addToSeen(seen, option2)) { - return some((_a = computedOptions[option2]) == null ? void 0 : _a.dependencies, (dep) => dependsOn.has(dep) || optionDependsOnRecursive(dep)); - } - return false; - } -} -function optionMapToObject(optionMap) { - return Object.fromEntries(optionMap); -} -function filterSameAsDefaultInclude(specs) { - if (!length(specs)) return void 0; - if (length(specs) !== 1) return specs; - if (specs[0] === defaultIncludeSpec) return void 0; - return specs; -} -function matchesSpecs(path, includeSpecs, excludeSpecs, host) { - if (!includeSpecs) return returnTrue; - const patterns = getFileMatcherPatterns(path, excludeSpecs, includeSpecs, host.useCaseSensitiveFileNames, host.getCurrentDirectory()); - const excludeRe = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, host.useCaseSensitiveFileNames); - const includeRe = patterns.includeFilePattern && getRegexFromPattern(patterns.includeFilePattern, host.useCaseSensitiveFileNames); - if (includeRe) { - if (excludeRe) { - return (path2) => !(includeRe.test(path2) && !excludeRe.test(path2)); - } - return (path2) => !includeRe.test(path2); - } - if (excludeRe) { - return (path2) => excludeRe.test(path2); - } - return returnTrue; -} -function getCustomTypeMapOfCommandLineOption(optionDefinition) { - switch (optionDefinition.type) { - case "string": - case "number": - case "boolean": - case "object": - return void 0; - case "list": - case "listOrElement": - return getCustomTypeMapOfCommandLineOption(optionDefinition.element); - default: - return optionDefinition.type; - } -} -function getNameOfCompilerOptionValue(value, customTypeMap) { - return forEachEntry(customTypeMap, (mapValue, key) => { - if (mapValue === value) { - return key; - } - }); -} -function serializeCompilerOptions(options, pathOptions) { - return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions); -} -function serializeWatchOptions(options) { - return serializeOptionBaseObject(options, getWatchOptionsNameMap()); -} -function serializeOptionBaseObject(options, { optionsNameMap }, pathOptions) { - const result = /* @__PURE__ */ new Map(); - const getCanonicalFileName = pathOptions && createGetCanonicalFileName(pathOptions.useCaseSensitiveFileNames); - for (const name in options) { - if (hasProperty(options, name)) { - if (optionsNameMap.has(name) && (optionsNameMap.get(name).category === Diagnostics.Command_line_Options || optionsNameMap.get(name).category === Diagnostics.Output_Formatting)) { - continue; - } - const value = options[name]; - const optionDefinition = optionsNameMap.get(name.toLowerCase()); - if (optionDefinition) { - Debug.assert(optionDefinition.type !== "listOrElement"); - const customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - if (pathOptions && optionDefinition.isFilePath) { - result.set(name, getRelativePathFromFile(pathOptions.configFilePath, getNormalizedAbsolutePath(value, getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName)); - } else if (pathOptions && optionDefinition.type === "list" && optionDefinition.element.isFilePath) { - result.set(name, value.map((v) => getRelativePathFromFile(pathOptions.configFilePath, getNormalizedAbsolutePath(v, getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName))); - } else { - result.set(name, value); - } - } else { - if (optionDefinition.type === "list") { - result.set(name, value.map((element) => getNameOfCompilerOptionValue(element, customTypeMap))); - } else { - result.set(name, getNameOfCompilerOptionValue(value, customTypeMap)); - } - } - } - } - } - return result; -} -function generateTSConfig(options, newLine) { - const tab = " "; - const result = []; - const allSetOptions = Object.keys(options).filter((k) => k !== "init" && k !== "help" && k !== "watch"); - result.push(`{`); - result.push(`${tab}// ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)}`); - result.push(`${tab}"compilerOptions": {`); - emitHeader(Diagnostics.File_Layout); - emitOption("rootDir", "./src", "optional"); - emitOption("outDir", "./dist", "optional"); - newline(); - emitHeader(Diagnostics.Environment_Settings); - emitHeader(Diagnostics.See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule); - emitOption("module", 199 /* NodeNext */); - emitOption("target", 99 /* ESNext */); - emitOption("types", []); - if (options.lib) { - emitOption("lib", options.lib); - } - emitHeader(Diagnostics.For_nodejs_Colon); - result.push(`${tab}${tab}// "lib": ["esnext"],`); - result.push(`${tab}${tab}// "types": ["node"],`); - emitHeader(Diagnostics.and_npm_install_D_types_Slashnode); - newline(); - emitHeader(Diagnostics.Other_Outputs); - emitOption( - "sourceMap", - /*defaultValue*/ - true - ); - emitOption( - "declaration", - /*defaultValue*/ - true - ); - emitOption( - "declarationMap", - /*defaultValue*/ - true - ); - newline(); - emitHeader(Diagnostics.Stricter_Typechecking_Options); - emitOption( - "noUncheckedIndexedAccess", - /*defaultValue*/ - true - ); - emitOption( - "exactOptionalPropertyTypes", - /*defaultValue*/ - true - ); - newline(); - emitHeader(Diagnostics.Style_Options); - emitOption( - "noImplicitReturns", - /*defaultValue*/ - true, - "optional" - ); - emitOption( - "noImplicitOverride", - /*defaultValue*/ - true, - "optional" - ); - emitOption( - "noUnusedLocals", - /*defaultValue*/ - true, - "optional" - ); - emitOption( - "noUnusedParameters", - /*defaultValue*/ - true, - "optional" - ); - emitOption( - "noFallthroughCasesInSwitch", - /*defaultValue*/ - true, - "optional" - ); - emitOption( - "noPropertyAccessFromIndexSignature", - /*defaultValue*/ - true, - "optional" - ); - newline(); - emitHeader(Diagnostics.Recommended_Options); - emitOption( - "strict", - /*defaultValue*/ - true - ); - emitOption("jsx", 4 /* ReactJSX */); - emitOption( - "verbatimModuleSyntax", - /*defaultValue*/ - true - ); - emitOption( - "isolatedModules", - /*defaultValue*/ - true - ); - emitOption( - "noUncheckedSideEffectImports", - /*defaultValue*/ - true - ); - emitOption("moduleDetection", 3 /* Force */); - emitOption( - "skipLibCheck", - /*defaultValue*/ - true - ); - if (allSetOptions.length > 0) { - newline(); - while (allSetOptions.length > 0) { - emitOption(allSetOptions[0], options[allSetOptions[0]]); - } - } - function newline() { - result.push(""); - } - function emitHeader(header) { - result.push(`${tab}${tab}// ${getLocaleSpecificMessage(header)}`); - } - function emitOption(setting, defaultValue, commented = "never") { - const existingOptionIndex = allSetOptions.indexOf(setting); - if (existingOptionIndex >= 0) { - allSetOptions.splice(existingOptionIndex, 1); - } - let comment; - if (commented === "always") { - comment = true; - } else if (commented === "never") { - comment = false; - } else { - comment = !hasProperty(options, setting); - } - const value = options[setting] ?? defaultValue; - if (comment) { - result.push(`${tab}${tab}// "${setting}": ${formatValueOrArray(setting, value)},`); - } else { - result.push(`${tab}${tab}"${setting}": ${formatValueOrArray(setting, value)},`); - } - } - function formatValueOrArray(settingName, value) { - const option = optionDeclarations.filter((c) => c.name === settingName)[0]; - if (!option) Debug.fail(`No option named ${settingName}?`); - const map2 = option.type instanceof Map ? option.type : void 0; - if (isArray(value)) { - const map3 = "element" in option && option.element.type instanceof Map ? option.element.type : void 0; - return `[${value.map((v) => formatSingleValue(v, map3)).join(", ")}]`; - } else { - return formatSingleValue(value, map2); - } - } - function formatSingleValue(value, map2) { - if (map2) { - value = getNameOfCompilerOptionValue(value, map2) ?? Debug.fail(`No matching value of ${value}`); - } - return JSON.stringify(value); - } - result.push(`${tab}}`); - result.push(`}`); - result.push(``); - return result.join(newLine); -} -function convertToOptionsWithAbsolutePaths(options, toAbsolutePath) { - const result = {}; - const optionsNameMap = getOptionsNameMap().optionsNameMap; - for (const name in options) { - if (hasProperty(options, name)) { - result[name] = convertToOptionValueWithAbsolutePaths( - optionsNameMap.get(name.toLowerCase()), - options[name], - toAbsolutePath - ); - } - } - if (result.configFilePath) { - result.configFilePath = toAbsolutePath(result.configFilePath); - } - return result; -} -function convertToOptionValueWithAbsolutePaths(option, value, toAbsolutePath) { - if (option && !isNullOrUndefined(value)) { - if (option.type === "list") { - const values = value; - if (option.element.isFilePath && values.length) { - return values.map(toAbsolutePath); - } - } else if (option.isFilePath) { - return toAbsolutePath(value); - } - Debug.assert(option.type !== "listOrElement"); - } - return value; -} -function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) { - return parseJsonConfigFileContentWorker( - json, - /*sourceFile*/ - void 0, - host, - basePath, - existingOptions, - existingWatchOptions, - configFileName, - resolutionStack, - extraFileExtensions, - extendedConfigCache - ); -} -function parseJsonSourceFileConfigFileContent(sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) { - var _a, _b; - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Parse, "parseJsonSourceFileConfigFileContent", { path: sourceFile.fileName }); - const result = parseJsonConfigFileContentWorker( - /*json*/ - void 0, - sourceFile, - host, - basePath, - existingOptions, - existingWatchOptions, - configFileName, - resolutionStack, - extraFileExtensions, - extendedConfigCache - ); - (_b = tracing) == null ? void 0 : _b.pop(); - return result; -} -function setConfigFileInOptions(options, configFile) { - if (configFile) { - Object.defineProperty(options, "configFile", { enumerable: false, writable: false, value: configFile }); - } -} -function isNullOrUndefined(x) { - return x === void 0 || x === null; -} -function directoryOfCombinedPath(fileName, basePath) { - return getDirectoryPath(getNormalizedAbsolutePath(fileName, basePath)); -} -var defaultIncludeSpec = "**/*"; -function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, existingOptions = {}, existingWatchOptions, configFileName, resolutionStack = [], extraFileExtensions = [], extendedConfigCache) { - Debug.assert(json === void 0 && sourceFile !== void 0 || json !== void 0 && sourceFile === void 0); - const errors = []; - const parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache); - const { raw } = parsedConfig; - const options = handleOptionConfigDirTemplateSubstitution( - extend(existingOptions, parsedConfig.options || {}), - configDirTemplateSubstitutionOptions, - basePath - ); - const watchOptions = handleWatchOptionsConfigDirTemplateSubstitution( - existingWatchOptions && parsedConfig.watchOptions ? extend(existingWatchOptions, parsedConfig.watchOptions) : parsedConfig.watchOptions || existingWatchOptions, - basePath - ); - options.configFilePath = configFileName && normalizeSlashes(configFileName); - const basePathForFileNames = normalizePath(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath); - const configFileSpecs = getConfigFileSpecs(); - if (sourceFile) sourceFile.configFileSpecs = configFileSpecs; - setConfigFileInOptions(options, sourceFile); - return { - options, - watchOptions, - fileNames: getFileNames(basePathForFileNames), - projectReferences: getProjectReferences(basePathForFileNames), - typeAcquisition: parsedConfig.typeAcquisition || getDefaultTypeAcquisition(), - raw, - errors, - // Wildcard directories (provided as part of a wildcard path) are stored in a - // file map that marks whether it was a regular wildcard match (with a `*` or `?` token), - // or a recursive directory. This information is used by filesystem watchers to monitor for - // new entries in these paths. - wildcardDirectories: getWildcardDirectories(configFileSpecs, basePathForFileNames, host.useCaseSensitiveFileNames), - compileOnSave: !!raw.compileOnSave - }; - function getConfigFileSpecs() { - const referencesOfRaw = getPropFromRaw("references", (element) => typeof element === "object", "object"); - const filesSpecs = toPropValue(getSpecsFromRaw("files")); - if (filesSpecs) { - const hasZeroOrNoReferences = referencesOfRaw === "no-prop" || isArray(referencesOfRaw) && referencesOfRaw.length === 0; - const hasExtends = hasProperty(raw, "extends"); - if (filesSpecs.length === 0 && hasZeroOrNoReferences && !hasExtends) { - if (sourceFile) { - 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 error2 = createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, nodeValue, diagnosticMessage, fileName); - errors.push(error2); - } else { - createCompilerDiagnosticOnlyIfJson(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json"); - } - } - } - let includeSpecs = toPropValue(getSpecsFromRaw("include")); - const excludeOfRaw = getSpecsFromRaw("exclude"); - let isDefaultIncludeSpec = false; - let excludeSpecs = toPropValue(excludeOfRaw); - if (excludeOfRaw === "no-prop") { - const outDir = options.outDir; - const declarationDir = options.declarationDir; - if (outDir || declarationDir) { - excludeSpecs = filter([outDir, declarationDir], (d) => !!d); - } - } - if (filesSpecs === void 0 && includeSpecs === void 0) { - includeSpecs = [defaultIncludeSpec]; - isDefaultIncludeSpec = true; - } - let validatedIncludeSpecsBeforeSubstitution, validatedExcludeSpecsBeforeSubstitution; - let validatedIncludeSpecs, validatedExcludeSpecs; - if (includeSpecs) { - validatedIncludeSpecsBeforeSubstitution = validateSpecs( - includeSpecs, - errors, - /*disallowTrailingRecursion*/ - true, - sourceFile, - "include" - ); - validatedIncludeSpecs = getSubstitutedStringArrayWithConfigDirTemplate( - validatedIncludeSpecsBeforeSubstitution, - basePathForFileNames - ) || validatedIncludeSpecsBeforeSubstitution; - } - if (excludeSpecs) { - validatedExcludeSpecsBeforeSubstitution = validateSpecs( - excludeSpecs, - errors, - /*disallowTrailingRecursion*/ - false, - sourceFile, - "exclude" - ); - validatedExcludeSpecs = getSubstitutedStringArrayWithConfigDirTemplate( - validatedExcludeSpecsBeforeSubstitution, - basePathForFileNames - ) || validatedExcludeSpecsBeforeSubstitution; - } - const validatedFilesSpecBeforeSubstitution = filter(filesSpecs, isString); - const validatedFilesSpec = getSubstitutedStringArrayWithConfigDirTemplate( - validatedFilesSpecBeforeSubstitution, - basePathForFileNames - ) || validatedFilesSpecBeforeSubstitution; - return { - filesSpecs, - includeSpecs, - excludeSpecs, - validatedFilesSpec, - validatedIncludeSpecs, - validatedExcludeSpecs, - validatedFilesSpecBeforeSubstitution, - validatedIncludeSpecsBeforeSubstitution, - validatedExcludeSpecsBeforeSubstitution, - isDefaultIncludeSpec - }; - } - function getFileNames(basePath2) { - const fileNames = getFileNamesFromConfigSpecs(configFileSpecs, basePath2, options, host, extraFileExtensions); - if (shouldReportNoInputFiles(fileNames, canJsonReportNoInputFiles(raw), resolutionStack)) { - errors.push(getErrorForNoInputFiles(configFileSpecs, configFileName)); - } - return fileNames; - } - function getProjectReferences(basePath2) { - let projectReferences; - const referencesOfRaw = getPropFromRaw("references", (element) => typeof element === "object", "object"); - if (isArray(referencesOfRaw)) { - for (const ref of referencesOfRaw) { - if (typeof ref.path !== "string") { - createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "reference.path", "string"); - } else { - (projectReferences || (projectReferences = [])).push({ - path: getNormalizedAbsolutePath(ref.path, basePath2), - originalPath: ref.path, - prepend: ref.prepend, - circular: ref.circular - }); - } - } - } - return projectReferences; - } - function toPropValue(specResult) { - return isArray(specResult) ? specResult : void 0; - } - function getSpecsFromRaw(prop) { - return getPropFromRaw(prop, isString, "string"); - } - function getPropFromRaw(prop, validateElement, elementTypeName) { - if (hasProperty(raw, prop) && !isNullOrUndefined(raw[prop])) { - if (isArray(raw[prop])) { - const result = raw[prop]; - if (!sourceFile && !every(result, validateElement)) { - errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, elementTypeName)); - } - return result; - } else { - createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, "Array"); - return "not-array"; - } - } - return "no-prop"; - } - function createCompilerDiagnosticOnlyIfJson(message, ...args) { - if (!sourceFile) { - errors.push(createCompilerDiagnostic(message, ...args)); - } - } -} -function handleWatchOptionsConfigDirTemplateSubstitution(watchOptions, basePath) { - return handleOptionConfigDirTemplateSubstitution(watchOptions, configDirTemplateSubstitutionWatchOptions, basePath); -} -function handleOptionConfigDirTemplateSubstitution(options, optionDeclarations2, basePath) { - if (!options) return options; - let result; - for (const option of optionDeclarations2) { - if (options[option.name] !== void 0) { - const value = options[option.name]; - switch (option.type) { - case "string": - Debug.assert(option.isFilePath); - if (startsWithConfigDirTemplate(value)) { - setOptionValue(option, getSubstitutedPathWithConfigDirTemplate(value, basePath)); - } - break; - case "list": - Debug.assert(option.element.isFilePath); - const listResult = getSubstitutedStringArrayWithConfigDirTemplate(value, basePath); - if (listResult) setOptionValue(option, listResult); - break; - case "object": - Debug.assert(option.name === "paths"); - const objectResult = getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(value, basePath); - if (objectResult) setOptionValue(option, objectResult); - break; - default: - Debug.fail("option type not supported"); - } - } - } - return result || options; - function setOptionValue(option, value) { - (result ?? (result = assign({}, options)))[option.name] = value; - } -} -var configDirTemplate = `\${configDir}`; -function startsWithConfigDirTemplate(value) { - return isString(value) && startsWith( - value, - configDirTemplate, - /*ignoreCase*/ - true - ); -} -function getSubstitutedPathWithConfigDirTemplate(value, basePath) { - return getNormalizedAbsolutePath(value.replace(configDirTemplate, "./"), basePath); -} -function getSubstitutedStringArrayWithConfigDirTemplate(list, basePath) { - if (!list) return list; - let result; - list.forEach((element, index) => { - if (!startsWithConfigDirTemplate(element)) return; - (result ?? (result = list.slice()))[index] = getSubstitutedPathWithConfigDirTemplate(element, basePath); - }); - return result; -} -function getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(mapLike, basePath) { - let result; - const ownKeys = getOwnKeys(mapLike); - ownKeys.forEach((key) => { - if (!isArray(mapLike[key])) return; - const subStitution = getSubstitutedStringArrayWithConfigDirTemplate(mapLike[key], basePath); - if (!subStitution) return; - (result ?? (result = assign({}, mapLike)))[key] = subStitution; - }); - return result; -} -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( - Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - configFileName || "tsconfig.json", - JSON.stringify(includeSpecs || []), - JSON.stringify(excludeSpecs || []) - ); -} -function shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles, resolutionStack) { - return fileNames.length === 0 && canJsonReportNoInutFiles && (!resolutionStack || resolutionStack.length === 0); -} -function isSolutionConfig(config) { - return !config.fileNames.length && hasProperty(config.raw, "references"); -} -function canJsonReportNoInputFiles(raw) { - return !hasProperty(raw, "files") && !hasProperty(raw, "references"); -} -function updateErrorForNoInputFiles(fileNames, configFileName, configFileSpecs, configParseDiagnostics, canJsonReportNoInutFiles) { - const existingErrors = configParseDiagnostics.length; - if (shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles)) { - configParseDiagnostics.push(getErrorForNoInputFiles(configFileSpecs, configFileName)); - } else { - filterMutate(configParseDiagnostics, (error2) => !isErrorNoInputFiles(error2)); - } - return existingErrors !== configParseDiagnostics.length; -} -function isSuccessfulParsedTsconfig(value) { - return !!value.options; -} -function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { - var _a; - basePath = normalizeSlashes(basePath); - const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath); - if (resolutionStack.includes(resolvedPath)) { - errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> "))); - return { raw: json || convertToObject(sourceFile, errors) }; - } - const ownConfig = json ? parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); - if ((_a = ownConfig.options) == null ? void 0 : _a.paths) { - ownConfig.options.pathsBasePath = basePath; - } - if (ownConfig.extendedConfigPath) { - resolutionStack = resolutionStack.concat([resolvedPath]); - const result = { options: {} }; - if (isString(ownConfig.extendedConfigPath)) { - applyExtendedConfig(result, ownConfig.extendedConfigPath); - } else { - ownConfig.extendedConfigPath.forEach((extendedConfigPath) => applyExtendedConfig(result, extendedConfigPath)); - } - if (result.include) ownConfig.raw.include = result.include; - if (result.exclude) ownConfig.raw.exclude = result.exclude; - if (result.files) ownConfig.raw.files = result.files; - if (ownConfig.raw.compileOnSave === void 0 && result.compileOnSave) ownConfig.raw.compileOnSave = result.compileOnSave; - if (sourceFile && result.extendedSourceFiles) sourceFile.extendedSourceFiles = arrayFrom(result.extendedSourceFiles.keys()); - ownConfig.options = assign(result.options, ownConfig.options); - ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assignWatchOptions(result, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions; - } - return ownConfig; - function applyExtendedConfig(result, extendedConfigPath) { - const extendedConfig = getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result); - if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { - const extendsRaw = extendedConfig.raw; - let relativeDifference; - const setPropertyInResultIfNotUndefined = (propertyName) => { - if (ownConfig.raw[propertyName]) return; - if (extendsRaw[propertyName]) { - result[propertyName] = map(extendsRaw[propertyName], (path) => startsWithConfigDirTemplate(path) || isRootedDiskPath(path) ? path : combinePaths( - relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames))), - path - )); - } - }; - setPropertyInResultIfNotUndefined("include"); - setPropertyInResultIfNotUndefined("exclude"); - setPropertyInResultIfNotUndefined("files"); - if (extendsRaw.compileOnSave !== void 0) { - result.compileOnSave = extendsRaw.compileOnSave; - } - assign(result.options, extendedConfig.options); - result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assignWatchOptions(result, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions; - } - } - function assignWatchOptions(result, watchOptions) { - if (result.watchOptionsCopied) return assign(result.watchOptions, watchOptions); - result.watchOptionsCopied = true; - return assign({}, result.watchOptions, watchOptions); - } -} -function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { - if (hasProperty(json, "excludes")) { - errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); - } - const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName); - const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName); - const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors); - json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors); - const extendedConfigPath = json.extends || json.extends === "" ? getExtendsConfigPathOrArray(json.extends, host, basePath, configFileName, errors) : void 0; - return { raw: json, options, watchOptions, typeAcquisition, extendedConfigPath }; -} -function getExtendsConfigPathOrArray(value, host, basePath, configFileName, errors, propertyAssignment, valueExpression, sourceFile) { - let extendedConfigPath; - const newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - if (isString(value)) { - extendedConfigPath = getExtendsConfigPath( - value, - host, - newBase, - errors, - valueExpression, - sourceFile - ); - } else if (isArray(value)) { - extendedConfigPath = []; - 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 - ) - ); - } else { - convertJsonOption(extendsOptionDeclaration.element, value, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index], sourceFile); - } - } - } else { - convertJsonOption(extendsOptionDeclaration, value, basePath, errors, propertyAssignment, valueExpression, sourceFile); - } - return extendedConfigPath; -} -function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { - const options = getDefaultCompilerOptions(configFileName); - let typeAcquisition; - let watchOptions; - let extendedConfigPath; - let rootCompilerOptions; - const rootOptions = getTsconfigRootOptionsMap(); - const json = convertConfigFileToObject( - sourceFile, - errors, - { rootOptions, onPropertySet } - ); - if (!typeAcquisition) { - typeAcquisition = getDefaultTypeAcquisition(configFileName); - } - if (rootCompilerOptions && json && json.compilerOptions === void 0) { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, getTextOfPropertyName(rootCompilerOptions[0]))); - } - return { raw: json, options, watchOptions, typeAcquisition, extendedConfigPath }; - function onPropertySet(keyText, value, propertyAssignment, parentOption, option) { - if (option && option !== extendsOptionDeclaration) value = convertJsonOption(option, value, basePath, errors, propertyAssignment, propertyAssignment.initializer, sourceFile); - if (parentOption == null ? void 0 : parentOption.name) { - if (option) { - let currentOption; - if (parentOption === compilerOptionsDeclaration) currentOption = options; - else if (parentOption === watchOptionsDeclaration) currentOption = watchOptions ?? (watchOptions = {}); - else if (parentOption === typeAcquisitionDeclaration) currentOption = typeAcquisition ?? (typeAcquisition = getDefaultTypeAcquisition(configFileName)); - else Debug.fail("Unknown option"); - currentOption[option.name] = value; - } else if (keyText && (parentOption == null ? void 0 : parentOption.extraKeyDiagnostics)) { - if (parentOption.elementOptions) { - errors.push(createUnknownOptionError( - keyText, - parentOption.extraKeyDiagnostics, - /*unknownOptionErrorText*/ - void 0, - propertyAssignment.name, - sourceFile - )); - } else { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, propertyAssignment.name, parentOption.extraKeyDiagnostics.unknownOptionDiagnostic, keyText)); - } - } - } else if (parentOption === rootOptions) { - if (option === extendsOptionDeclaration) { - extendedConfigPath = getExtendsConfigPathOrArray(value, host, basePath, configFileName, errors, propertyAssignment, propertyAssignment.initializer, sourceFile); - } else if (!option) { - if (keyText === "excludes") { - errors.push(createDiagnosticForNodeInSourceFile(sourceFile, propertyAssignment.name, Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); - } - if (find(commandOptionsWithoutBuild, (opt) => opt.name === keyText)) { - rootCompilerOptions = append(rootCompilerOptions, propertyAssignment.name); - } - } - } - } -} -function getExtendsConfigPath(extendedConfig, host, basePath, errors, valueExpression, sourceFile) { - extendedConfig = normalizeSlashes(extendedConfig); - if (isRootedDiskPath(extendedConfig) || startsWith(extendedConfig, "./") || startsWith(extendedConfig, "../")) { - let extendedConfigPath = getNormalizedAbsolutePath(extendedConfig, basePath); - if (!host.fileExists(extendedConfigPath) && !endsWith(extendedConfigPath, ".json" /* Json */)) { - extendedConfigPath = `${extendedConfigPath}.json`; - if (!host.fileExists(extendedConfigPath)) { - errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.File_0_not_found, extendedConfig)); - return void 0; - } - } - return extendedConfigPath; - } - const resolved = nodeNextJsonConfigResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), host); - if (resolved.resolvedModule) { - return resolved.resolvedModule.resolvedFileName; - } - if (extendedConfig === "") { - errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends")); - } else { - errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.File_0_not_found, extendedConfig)); - } - return void 0; -} -function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) { - const path = host.useCaseSensitiveFileNames ? extendedConfigPath : toFileNameLowerCase(extendedConfigPath); - let value; - let extendedResult; - let extendedConfig; - if (extendedConfigCache && (value = extendedConfigCache.get(path))) { - ({ extendedResult, extendedConfig } = value); - } else { - extendedResult = readJsonConfigFile(extendedConfigPath, (path2) => host.readFile(path2)); - if (!extendedResult.parseDiagnostics.length) { - extendedConfig = parseConfig( - /*json*/ - void 0, - extendedResult, - host, - getDirectoryPath(extendedConfigPath), - getBaseFileName(extendedConfigPath), - resolutionStack, - errors, - extendedConfigCache - ); - } - if (extendedConfigCache) { - extendedConfigCache.set(path, { extendedResult, extendedConfig }); - } - } - if (sourceFile) { - (result.extendedSourceFiles ?? (result.extendedSourceFiles = /* @__PURE__ */ new Set())).add(extendedResult.fileName); - if (extendedResult.extendedSourceFiles) { - for (const extenedSourceFile of extendedResult.extendedSourceFiles) { - result.extendedSourceFiles.add(extenedSourceFile); - } - } - } - if (extendedResult.parseDiagnostics.length) { - errors.push(...extendedResult.parseDiagnostics); - return void 0; - } - return extendedConfig; -} -function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) { - if (!hasProperty(jsonOption, compileOnSaveCommandLineOption.name)) { - return false; - } - const result = convertJsonOption(compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors); - return typeof result === "boolean" && result; -} -function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) { - const errors = []; - const options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName); - return { options, errors }; -} -function convertTypeAcquisitionFromJson(jsonOptions, basePath, configFileName) { - const errors = []; - const options = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); - return { options, errors }; -} -function getDefaultCompilerOptions(configFileName) { - const options = configFileName && getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; - return options; -} -function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) { - const options = getDefaultCompilerOptions(configFileName); - convertOptionsFromJson(getCommandLineCompilerOptionsMap(), jsonOptions, basePath, options, compilerOptionsDidYouMeanDiagnostics, errors); - if (configFileName) { - options.configFilePath = normalizeSlashes(configFileName); - } - return options; -} -function getDefaultTypeAcquisition(configFileName) { - return { enable: !!configFileName && getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; -} -function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { - const options = getDefaultTypeAcquisition(configFileName); - convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); - return options; -} -function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) { - return convertOptionsFromJson( - getCommandLineWatchOptionsMap(), - jsonOptions, - basePath, - /*defaultOptions*/ - void 0, - watchOptionsDidYouMeanDiagnostics, - errors - ); -} -function convertOptionsFromJson(optionsNameMap, jsonOptions, basePath, defaultOptions, diagnostics, errors) { - if (!jsonOptions) { - return; - } - for (const id in jsonOptions) { - const opt = optionsNameMap.get(id); - if (opt) { - (defaultOptions || (defaultOptions = {}))[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); - } else { - errors.push(createUnknownOptionError(id, diagnostics)); - } - } - return defaultOptions; -} -function createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, message, ...args) { - return sourceFile && node ? createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args) : createCompilerDiagnostic(message, ...args); -} -function convertJsonOption(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile) { - if (opt.isCommandLineOnly) { - errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, propertyAssignment == null ? void 0 : propertyAssignment.name, Diagnostics.Option_0_can_only_be_specified_on_command_line, opt.name)); - return void 0; - } - if (isCompilerOptionsValue(opt, value)) { - const optType = opt.type; - if (optType === "list" && isArray(value)) { - return convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile); - } else if (optType === "listOrElement") { - return isArray(value) ? convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile) : convertJsonOption(opt.element, value, basePath, errors, propertyAssignment, valueExpression, sourceFile); - } else if (!isString(opt.type)) { - return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile); - } - const validatedValue = validateJsonOptionValue(opt, value, errors, valueExpression, sourceFile); - return isNullOrUndefined(validatedValue) ? validatedValue : normalizeNonListOptionValue(opt, basePath, validatedValue); - } else { - errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, getCompilerOptionValueTypeString(opt))); - } -} -function normalizeNonListOptionValue(option, basePath, value) { - if (option.isFilePath) { - value = normalizeSlashes(value); - value = !startsWithConfigDirTemplate(value) ? getNormalizedAbsolutePath(value, basePath) : value; - if (value === "") { - value = "."; - } - } - return value; -} -function validateJsonOptionValue(opt, value, errors, valueExpression, sourceFile) { - var _a; - if (isNullOrUndefined(value)) return void 0; - const d = (_a = opt.extraValidation) == null ? void 0 : _a.call(opt, value); - if (!d) return value; - errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, ...d)); - return void 0; -} -function convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile) { - if (isNullOrUndefined(value)) return void 0; - const key = value.toLowerCase(); - const val = opt.type.get(key); - if (val !== void 0) { - return validateJsonOptionValue(opt, val, errors, valueExpression, sourceFile); - } else { - errors.push(createDiagnosticForInvalidCustomType(opt, (message, ...args) => createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, message, ...args))); - } -} -function convertJsonOptionOfListType(option, values, basePath, errors, propertyAssignment, valueExpression, sourceFile) { - return filter(map(values, (v, index) => convertJsonOption(option.element, v, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index], sourceFile)), (v) => option.listPreserveFalsyValues ? true : !!v); -} -var invalidTrailingRecursionPattern = /(?:^|\/)\*\*\/?$/; -var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; -function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, extraFileExtensions = emptyArray) { - basePath = normalizePath(basePath); - const keyMapper = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - const literalFileMap = /* @__PURE__ */ new Map(); - const wildcardFileMap = /* @__PURE__ */ new Map(); - const wildCardJsonFileMap = /* @__PURE__ */ new Map(); - const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = configFileSpecs; - const supportedExtensions = getSupportedExtensions(options, extraFileExtensions); - const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions); - if (validatedFilesSpec) { - for (const fileName of validatedFilesSpec) { - const file = getNormalizedAbsolutePath(fileName, basePath); - literalFileMap.set(keyMapper(file), file); - } - } - let jsonOnlyIncludeRegexes; - if (validatedIncludeSpecs && validatedIncludeSpecs.length > 0) { - for (const file of host.readDirectory( - basePath, - flatten(supportedExtensionsWithJsonIfResolveJsonModule), - validatedExcludeSpecs, - validatedIncludeSpecs, - /*depth*/ - void 0 - )) { - if (fileExtensionIs(file, ".json" /* Json */)) { - if (!jsonOnlyIncludeRegexes) { - const includes = validatedIncludeSpecs.filter((s) => endsWith(s, ".json" /* Json */)); - const includeFilePatterns = map(getRegularExpressionsForWildcards(includes, basePath, "files"), (pattern) => `^${pattern}$`); - jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, host.useCaseSensitiveFileNames)) : emptyArray; - } - const includeIndex = findIndex(jsonOnlyIncludeRegexes, (re) => re.test(file)); - if (includeIndex !== -1) { - const key2 = keyMapper(file); - if (!literalFileMap.has(key2) && !wildCardJsonFileMap.has(key2)) { - wildCardJsonFileMap.set(key2, file); - } - } - continue; - } - if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) { - continue; - } - removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); - const key = keyMapper(file); - if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { - wildcardFileMap.set(key, file); - } - } - } - const literalFiles = arrayFrom(literalFileMap.values()); - const wildcardFiles = arrayFrom(wildcardFileMap.values()); - return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values())); -} -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(useCaseSensitiveFileNames2); - if (validatedFilesSpec) { - for (const fileName of validatedFilesSpec) { - if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck) return false; - } - } - return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath); -} -function invalidDotDotAfterRecursiveWildcard(s) { - const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/"); - if (wildcardIndex === -1) { - return false; - } - const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../"); - return lastDotIndex > wildcardIndex; -} -function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) { - return matchesExcludeWorker( - pathToCheck, - filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)), - useCaseSensitiveFileNames2, - currentDirectory - ); -} -function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) { - const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude"); - const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2); - if (!excludeRegex) return false; - if (excludeRegex.test(pathToCheck)) return true; - return !hasExtension(pathToCheck) && excludeRegex.test(ensureTrailingDirectorySeparator(pathToCheck)); -} -function validateSpecs(specs, errors, disallowTrailingRecursion, jsonSourceFile, specKey) { - return specs.filter((spec) => { - if (!isString(spec)) return false; - const diag2 = specToDiagnostic(spec, disallowTrailingRecursion); - if (diag2 !== void 0) { - errors.push(createDiagnostic(...diag2)); - } - return diag2 === void 0; - }); - function createDiagnostic(message, spec) { - const element = getTsConfigPropArrayElementValue(jsonSourceFile, specKey, spec); - return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(jsonSourceFile, element, message, spec); - } -} -function specToDiagnostic(spec, disallowTrailingRecursion) { - Debug.assert(typeof spec === "string"); - if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; - } else if (invalidDotDotAfterRecursiveWildcard(spec)) { - 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 }, 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(basePath, file)); - if (excludeRegex && excludeRegex.test(spec)) { - continue; - } - const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2); - if (match) { - 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[existingPath !== void 0 ? existingPath : path] = flags; - if (existingPath === void 0) wildCardKeyToPath.set(key, path); - if (flags === 1 /* Recursive */) { - recursiveKeys.push(key); - } - } - } - } - for (const path in wildcardDirectories) { - if (hasProperty(wildcardDirectories, path)) { - for (const recursiveKey of recursiveKeys) { - const key = toCanonicalKey(path, useCaseSensitiveFileNames2); - if (key !== recursiveKey && containsPath(recursiveKey, key, basePath, !useCaseSensitiveFileNames2)) { - delete wildcardDirectories[path]; - } - } - } - } - } - return wildcardDirectories; -} -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: 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: toCanonicalKey(path, useCaseSensitiveFileNames2), - path, - flags: 1 /* Recursive */ - }; - } - return void 0; -} -function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { - const extensionGroup = forEach(extensions, (group2) => fileExtensionIsOneOf(file, group2) ? group2 : void 0); - if (!extensionGroup) { - return false; - } - for (const ext of extensionGroup) { - if (fileExtensionIs(file, ext) && (ext !== ".ts" /* Ts */ || !fileExtensionIs(file, ".d.ts" /* Dts */))) { - return false; - } - const higherPriorityPath = keyMapper(changeExtension(file, ext)); - if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { - if (ext === ".d.ts" /* Dts */ && (fileExtensionIs(file, ".js" /* Js */) || fileExtensionIs(file, ".jsx" /* Jsx */))) { - continue; - } - return true; - } - } - return false; -} -function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { - const extensionGroup = forEach(extensions, (group2) => fileExtensionIsOneOf(file, group2) ? group2 : void 0); - if (!extensionGroup) { - return; - } - for (let i = extensionGroup.length - 1; i >= 0; i--) { - const ext = extensionGroup[i]; - if (fileExtensionIs(file, ext)) { - return; - } - const lowerPriorityPath = keyMapper(changeExtension(file, ext)); - wildcardFiles.delete(lowerPriorityPath); - } -} -function convertCompilerOptionsForTelemetry(opts) { - const out = {}; - for (const key in opts) { - if (hasProperty(opts, key)) { - const type = getOptionFromName(key); - if (type !== void 0) { - out[key] = getOptionValueWithEmptyStrings(opts[key], type); - } - } - } - return out; -} -function getOptionValueWithEmptyStrings(value, option) { - if (value === void 0) return value; - switch (option.type) { - case "object": - return ""; - case "string": - return ""; - case "number": - return typeof value === "number" ? value : ""; - case "boolean": - return typeof value === "boolean" ? value : ""; - case "listOrElement": - if (!isArray(value)) return getOptionValueWithEmptyStrings(value, option.element); - // fall through to list - case "list": - const elementType = option.element; - return isArray(value) ? mapDefined(value, (v) => getOptionValueWithEmptyStrings(v, elementType)) : ""; - default: - return forEachEntry(option.type, (optionEnumValue, optionStringValue) => { - if (optionEnumValue === value) { - return optionStringValue; - } - }); - } -} - -// src/compiler/moduleNameResolver.ts -function trace(host, message, ...args) { - host.trace(formatMessage(message, ...args)); -} -function isTraceEnabled(compilerOptions, host) { - return !!compilerOptions.traceResolution && host.trace !== void 0; -} -function withPackageId(packageInfo, r, state) { - let packageId; - if (r && packageInfo) { - const packageJsonContent = packageInfo.contents.packageJsonContent; - if (typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string") { - packageId = { - name: packageJsonContent.name, - subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length), - version: packageJsonContent.version, - peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state) - }; - } - } - return r && { path: r.path, extension: r.ext, packageId, resolvedUsingTsExtension: r.resolvedUsingTsExtension }; -} -function noPackageId(r) { - return withPackageId( - /*packageInfo*/ - void 0, - r, - /*state*/ - void 0 - ); -} -function removeIgnoredPackageId(r) { - if (r) { - Debug.assert(r.packageId === void 0); - return { path: r.path, ext: r.extension, resolvedUsingTsExtension: r.resolvedUsingTsExtension }; - } -} -function formatExtensions(extensions) { - const result = []; - if (extensions & 1 /* TypeScript */) result.push("TypeScript"); - if (extensions & 2 /* JavaScript */) result.push("JavaScript"); - if (extensions & 4 /* Declaration */) result.push("Declaration"); - if (extensions & 8 /* Json */) 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; - } - Debug.assert(extensionIsTS(resolved.extension)); - return { fileName: resolved.path, packageId: resolved.packageId }; -} -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) resolved = { ...resolved, path: resolvedFileName, originalPath }; - } - return createResolvedModuleWithFailedLookupLocations( - resolved, - isExternalLibraryImport, - failedLookupLocations, - affectingLocations, - diagnostics, - state.resultFromCache, - cache, - alternateResult - ); -} -function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, alternateResult) { - if (resultFromCache) { - if (!(cache == null ? void 0 : cache.isReadonly)) { - resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); - 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 && { - resolvedFileName: resolved.path, - originalPath: resolved.originalPath === true ? void 0 : resolved.originalPath, - extension: resolved.extension, - isExternalLibraryImport, - packageId: resolved.packageId, - resolvedUsingTsExtension: !!resolved.resolvedUsingTsExtension - }, - failedLookupLocations: initializeResolutionField(failedLookupLocations), - affectingLocations: initializeResolutionField(affectingLocations), - resolutionDiagnostics: initializeResolutionField(diagnostics), - alternateResult - }; -} -function initializeResolutionField(value) { - return value.length ? value : void 0; -} -function updateResolutionField(to, value) { - if (!(value == null ? void 0 : value.length)) return to; - if (!(to == null ? void 0 : to.length)) return value; - 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) { - trace(state.host, Diagnostics.package_json_does_not_have_a_0_field, fieldName); - } - return; - } - const value = jsonContent[fieldName]; - if (typeof value !== typeOfTag || value === null) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, fieldName, typeOfTag, value === null ? "null" : typeof value); - } - return; - } - return value; -} -function readPackageJsonPathField(jsonContent, fieldName, baseDirectory, state) { - const fileName = readPackageJsonField(jsonContent, fieldName, "string", state); - if (fileName === void 0) { - return; - } - if (!fileName) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_had_a_falsy_0_field, fieldName); - } - return; - } - const path = normalizePath(combinePaths(baseDirectory, fileName)); - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); - } - return path; -} -function readPackageJsonTypesFields(jsonContent, baseDirectory, state) { - return readPackageJsonPathField(jsonContent, "typings", baseDirectory, state) || readPackageJsonPathField(jsonContent, "types", baseDirectory, state); -} -function readPackageJsonTSConfigField(jsonContent, baseDirectory, state) { - return readPackageJsonPathField(jsonContent, "tsconfig", baseDirectory, state); -} -function readPackageJsonMainField(jsonContent, baseDirectory, state) { - return readPackageJsonPathField(jsonContent, "main", baseDirectory, state); -} -function readPackageJsonTypesVersionsField(jsonContent, state) { - const typesVersions = readPackageJsonField(jsonContent, "typesVersions", "object", state); - if (typesVersions === void 0) return; - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings); - } - return typesVersions; -} -function readPackageJsonTypesVersionPaths(jsonContent, state) { - const typesVersions = readPackageJsonTypesVersionsField(jsonContent, state); - if (typesVersions === void 0) return; - if (state.traceEnabled) { - for (const key in typesVersions) { - if (hasProperty(typesVersions, key) && !VersionRange.tryParse(key)) { - trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range, key); - } - } - } - const result = getPackageJsonTypesVersionsPaths(typesVersions); - if (!result) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0, versionMajorMinor); - } - return; - } - const { version: bestVersionKey, paths: bestVersionPaths } = result; - if (typeof bestVersionPaths !== "object") { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, `typesVersions['${bestVersionKey}']`, "object", typeof bestVersionPaths); - } - return; - } - return result; -} -var typeScriptVersion; -function getPackageJsonTypesVersionsPaths(typesVersions) { - if (!typeScriptVersion) typeScriptVersion = new Version(version); - for (const key in typesVersions) { - if (!hasProperty(typesVersions, key)) continue; - const keyRange = VersionRange.tryParse(key); - if (keyRange === void 0) { - continue; - } - if (keyRange.test(typeScriptVersion)) { - return { version: key, paths: typesVersions[key] }; - } - } -} -function getEffectiveTypeRoots(options, host) { - if (options.typeRoots) { - return options.typeRoots; - } - let currentDirectory; - if (options.configFilePath) { - currentDirectory = getDirectoryPath(options.configFilePath); - } else if (host.getCurrentDirectory) { - currentDirectory = host.getCurrentDirectory(); - } - if (currentDirectory !== void 0) { - return getDefaultTypeRoots(currentDirectory); - } -} -function getDefaultTypeRoots(currentDirectory) { - let typeRoots; - forEachAncestorDirectory(normalizePath(currentDirectory), (directory) => { - const atTypes = combinePaths(directory, nodeModulesAtTypes); - (typeRoots ?? (typeRoots = [])).push(atTypes); - }); - return typeRoots; -} -var nodeModulesAtTypes = combinePaths("node_modules", "@types"); -function arePathsEqual(path1, path2, host) { - 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); - const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); - return { - // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames - resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, - originalPath: pathsAreEqual ? void 0 : fileName - }; -} -function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) { - const nameForLookup = endsWith(typeRoot, "/node_modules/@types") || endsWith(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName; - return combinePaths(typeRoot, nameForLookup); -} -function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) { - Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself."); - const traceEnabled = isTraceEnabled(options, host); - if (redirectedReference) { - options = redirectedReference.commandLine.options; - } - const containingDirectory = containingFile ? getDirectoryPath(containingFile) : void 0; - let result = containingDirectory ? cache == null ? void 0 : cache.getFromDirectoryCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference) : void 0; - if (!result && containingDirectory && !isExternalModuleNameRelative(typeReferenceDirectiveName)) { - result = cache == null ? void 0 : cache.getFromNonRelativeNameCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference); - } - if (result) { - if (traceEnabled) { - trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile); - if (redirectedReference) trace(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); - trace(host, Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1, typeReferenceDirectiveName, containingDirectory); - traceResult(result); - } - return result; - } - const typeRoots = getEffectiveTypeRoots(options, host); - if (traceEnabled) { - if (containingFile === void 0) { - if (typeRoots === void 0) { - trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set, typeReferenceDirectiveName); - } else { - trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1, typeReferenceDirectiveName, typeRoots); - } - } else { - if (typeRoots === void 0) { - trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set, typeReferenceDirectiveName, containingFile); - } else { - trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, typeRoots); - } - } - if (redirectedReference) { - trace(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); - } - } - const failedLookupLocations = []; - const affectingLocations = []; - let features = getNodeResolutionFeatures(options); - 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, resolutionMode) : []; - const diagnostics = []; - const moduleResolutionState = { - compilerOptions: options, - host, - traceEnabled, - failedLookupLocations, - affectingLocations, - packageJsonInfoCache: cache, - features, - conditions, - requestContainingDirectory: containingDirectory, - reportDiagnostic: (diag2) => void diagnostics.push(diag2), - isConfigLookup: false, - candidateIsFromPackageJsonField: false, - resolvedPackageDirectory: false - }; - let resolved = primaryLookup(); - let primary = true; - if (!resolved) { - resolved = secondaryLookup(); - primary = false; - } - let resolvedTypeReferenceDirective; - if (resolved) { - const { fileName, packageId } = resolved; - let resolvedFileName = fileName, originalPath; - if (!options.preserveSymlinks) ({ resolvedFileName, originalPath } = getOriginalAndResolvedFileName(fileName, host, traceEnabled)); - resolvedTypeReferenceDirective = { - primary, - resolvedFileName, - originalPath, - packageId, - isExternalLibraryImport: pathContainsNodeModules(fileName) - }; - } - result = { - resolvedTypeReferenceDirective, - failedLookupLocations: initializeResolutionField(failedLookupLocations), - affectingLocations: initializeResolutionField(affectingLocations), - resolutionDiagnostics: initializeResolutionField(diagnostics) - }; - if (containingDirectory && cache && !cache.isReadonly) { - cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set( - typeReferenceDirectiveName, - /*mode*/ - resolutionMode, - result - ); - if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) { - cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result); - } - } - if (traceEnabled) traceResult(result); - return result; - function traceResult(result2) { - var _a; - if (!((_a = result2.resolvedTypeReferenceDirective) == null ? void 0 : _a.resolvedFileName)) { - trace(host, Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); - } else if (result2.resolvedTypeReferenceDirective.packageId) { - trace(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, result2.resolvedTypeReferenceDirective.resolvedFileName, packageIdToString(result2.resolvedTypeReferenceDirective.packageId), result2.resolvedTypeReferenceDirective.primary); - } else { - trace(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, result2.resolvedTypeReferenceDirective.resolvedFileName, result2.resolvedTypeReferenceDirective.primary); - } - } - function primaryLookup() { - if (typeRoots && typeRoots.length) { - if (traceEnabled) { - trace(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", ")); - } - return firstDefined(typeRoots, (typeRoot) => { - const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState); - const directoryExists = directoryProbablyExists(typeRoot, host); - if (!directoryExists && traceEnabled) { - trace(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot); - } - if (options.typeRoots) { - const resolvedFromFile = loadModuleFromFile(4 /* Declaration */, candidate, !directoryExists, moduleResolutionState); - if (resolvedFromFile) { - const packageDirectory = parseNodeModuleFromPath(resolvedFromFile.path); - const packageInfo = packageDirectory ? getPackageJsonInfo( - packageDirectory, - /*onlyRecordFailures*/ - false, - moduleResolutionState - ) : void 0; - return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile, moduleResolutionState)); - } - } - return resolvedTypeScriptOnly( - loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, moduleResolutionState) - ); - }); - } else { - if (traceEnabled) { - trace(host, Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths); - } - } - } - function secondaryLookup() { - const initialLocationForSecondaryLookup = containingFile && getDirectoryPath(containingFile); - if (initialLocationForSecondaryLookup !== void 0) { - let result2; - if (!options.typeRoots || !endsWith(containingFile, inferredTypesContainingFile)) { - if (traceEnabled) { - trace(host, Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); - } - if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) { - const searchResult = loadModuleFromNearestNodeModulesDirectory( - 4 /* Declaration */, - typeReferenceDirectiveName, - initialLocationForSecondaryLookup, - moduleResolutionState, - /*cache*/ - void 0, - /*redirectedReference*/ - void 0 - ); - result2 = searchResult && searchResult.value; - } else { - const { path: candidate } = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName); - result2 = nodeLoadModuleByRelativeName( - 4 /* Declaration */, - candidate, - /*onlyRecordFailures*/ - false, - moduleResolutionState, - /*considerPackageJson*/ - true - ); - } - } else if (traceEnabled) { - trace(host, Diagnostics.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder); - } - return resolvedTypeScriptOnly(result2); - } else { - if (traceEnabled) { - trace(host, Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder); - } - } - } -} -function getNodeResolutionFeatures(options) { - let features = 0 /* None */; - switch (getEmitModuleResolutionKind(options)) { - case 3 /* Node16 */: - features = 30 /* Node16Default */; - break; - case 99 /* NodeNext */: - features = 30 /* NodeNextDefault */; - break; - case 100 /* Bundler */: - features = 30 /* BundlerDefault */; - break; - } - if (options.resolvePackageJsonExports) { - features |= 8 /* Exports */; - } else if (options.resolvePackageJsonExports === false) { - features &= ~8 /* Exports */; - } - if (options.resolvePackageJsonImports) { - features |= 2 /* Imports */; - } else if (options.resolvePackageJsonImports === false) { - features &= ~2 /* Imports */; - } - return features; -} -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 (moduleResolution !== 100 /* Bundler */) { - conditions.push("node"); - } - return concatenate(conditions, options.customConditions); -} -function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) { - const moduleResolutionState = getTemporaryModuleResolutionState(cache == null ? void 0 : cache.getPackageJsonInfoCache(), host, options); - return forEachAncestorDirectoryStoppingAtGlobalCache(host, containingDirectory, (ancestorDirectory) => { - if (getBaseFileName(ancestorDirectory) !== "node_modules") { - const nodeModulesFolder = combinePaths(ancestorDirectory, "node_modules"); - const candidate = combinePaths(nodeModulesFolder, packageName); - return getPackageJsonInfo( - candidate, - /*onlyRecordFailures*/ - false, - moduleResolutionState - ); - } - }); -} -function getAutomaticTypeDirectiveNames(options, host) { - if (options.types) { - return options.types; - } - const result = []; - if (host.directoryExists && host.getDirectories) { - const typeRoots = getEffectiveTypeRoots(options, host); - if (typeRoots) { - for (const root of typeRoots) { - if (host.directoryExists(root)) { - for (const typeDirectivePath of host.getDirectories(root)) { - const normalized = normalizePath(typeDirectivePath); - const packageJsonPath = combinePaths(root, normalized, "package.json"); - const isNotNeededPackage = host.fileExists(packageJsonPath) && readJson(packageJsonPath, host).typings === null; - if (!isNotNeededPackage) { - const baseFileName = getBaseFileName(normalized); - if (baseFileName.charCodeAt(0) !== 46 /* dot */) { - result.push(baseFileName); - } - } - } - } - } - } - } - 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") { - return "" + value; - } - if (isArray(value)) { - return `[${(_a = value.map((e) => compilerOptionValueToString(e))) == null ? void 0 : _a.join(",")}]`; - } - let str = "{"; - for (const key in value) { - if (hasProperty(value, key)) { - str += `${key}: ${compilerOptionValueToString(value[key])}`; - } - } - return str + "}"; -} -function getKeyForCompilerOptions(options, affectingOptionDeclarations) { - return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + `|${options.pathsBasePath}`; -} -function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) { - const redirectsMap = /* @__PURE__ */ new Map(); - const redirectsKeyToMap = /* @__PURE__ */ new Map(); - let ownMap = /* @__PURE__ */ new Map(); - if (ownOptions) redirectsMap.set(ownOptions, ownMap); - return { - getMapOfCacheRedirects, - getOrCreateMapOfCacheRedirects, - update, - clear: clear2, - getOwnMap: () => ownMap - }; - function getMapOfCacheRedirects(redirectedReference) { - return redirectedReference ? getOrCreateMap( - redirectedReference.commandLine.options, - /*create*/ - false - ) : ownMap; - } - function getOrCreateMapOfCacheRedirects(redirectedReference) { - return redirectedReference ? getOrCreateMap( - redirectedReference.commandLine.options, - /*create*/ - true - ) : ownMap; - } - function update(newOptions) { - if (ownOptions !== newOptions) { - if (ownOptions) ownMap = getOrCreateMap( - newOptions, - /*create*/ - true - ); - else redirectsMap.set(newOptions, ownMap); - ownOptions = newOptions; - } - } - function getOrCreateMap(redirectOptions, create) { - let result = redirectsMap.get(redirectOptions); - if (result) return result; - const key = getRedirectsCacheKey(redirectOptions); - result = redirectsKeyToMap.get(key); - if (!result) { - if (ownOptions) { - const ownKey = getRedirectsCacheKey(ownOptions); - if (ownKey === key) result = ownMap; - else if (!redirectsKeyToMap.has(ownKey)) redirectsKeyToMap.set(ownKey, ownMap); - } - if (create) result ?? (result = /* @__PURE__ */ new Map()); - if (result) redirectsKeyToMap.set(key, result); - } - if (result) redirectsMap.set(redirectOptions, result); - return result; - } - function clear2() { - const ownKey = ownOptions && optionsToRedirectsKey.get(ownOptions); - ownMap.clear(); - redirectsMap.clear(); - optionsToRedirectsKey.clear(); - redirectsKeyToMap.clear(); - if (ownOptions) { - if (ownKey) optionsToRedirectsKey.set(ownOptions, ownKey); - redirectsMap.set(ownOptions, ownMap); - } - } - function getRedirectsCacheKey(options) { - let result = optionsToRedirectsKey.get(options); - if (!result) { - optionsToRedirectsKey.set(options, result = getKeyForCompilerOptions(options, moduleResolutionOptionDeclarations)); - } - return result; - } -} -function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) { - let cache; - return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear2, getInternalMap }; - function getPackageJsonInfo2(packageJsonPath) { - return cache == null ? void 0 : cache.get(toPath(packageJsonPath, currentDirectory, getCanonicalFileName)); - } - function setPackageJsonInfo(packageJsonPath, info) { - (cache || (cache = /* @__PURE__ */ new Map())).set(toPath(packageJsonPath, currentDirectory, getCanonicalFileName), info); - } - function clear2() { - cache = void 0; - } - function getInternalMap() { - return cache; - } -} -function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create) { - const cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference); - let result = cache.get(key); - if (!result) { - result = create(); - cache.set(key, result); - } - return result; -} -function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options, optionsToRedirectsKey) { - const directoryToModuleNameMap = createCacheWithRedirects(options, optionsToRedirectsKey); - return { - getFromDirectoryCache, - getOrCreateCacheForDirectory, - clear: clear2, - update, - directoryToModuleNameMap - }; - function clear2() { - directoryToModuleNameMap.clear(); - } - function update(options2) { - directoryToModuleNameMap.update(options2); - } - function getOrCreateCacheForDirectory(directoryName, redirectedReference) { - const path = toPath(directoryName, currentDirectory, getCanonicalFileName); - return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache()); - } - function getFromDirectoryCache(name, mode, directoryName, redirectedReference) { - var _a, _b; - const path = toPath(directoryName, currentDirectory, getCanonicalFileName); - return (_b = (_a = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a.get(path)) == null ? void 0 : _b.get(name, mode); - } -} -function createModeAwareCacheKey(specifier, mode) { - return mode === void 0 ? specifier : `${mode}|${specifier}`; -} -function createModeAwareCache() { - const underlying = /* @__PURE__ */ new Map(); - const memoizedReverseKeys = /* @__PURE__ */ new Map(); - const cache = { - get(specifier, mode) { - return underlying.get(getUnderlyingCacheKey(specifier, mode)); - }, - set(specifier, mode, value) { - underlying.set(getUnderlyingCacheKey(specifier, mode), value); - return cache; - }, - delete(specifier, mode) { - underlying.delete(getUnderlyingCacheKey(specifier, mode)); - return cache; - }, - has(specifier, mode) { - return underlying.has(getUnderlyingCacheKey(specifier, mode)); - }, - forEach(cb) { - return underlying.forEach((elem, key) => { - const [specifier, mode] = memoizedReverseKeys.get(key); - return cb(elem, specifier, mode); - }); - }, - size() { - return underlying.size; - } - }; - return cache; - function getUnderlyingCacheKey(specifier, mode) { - const result = createModeAwareCacheKey(specifier, mode); - memoizedReverseKeys.set(result, [specifier, mode]); - return result; - } -} -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, optionsToRedirectsKey) { - const moduleNameToDirectoryMap = createCacheWithRedirects(options, optionsToRedirectsKey); - return { - getFromNonRelativeNameCache, - getOrCreateCacheForNonRelativeName, - clear: clear2, - update - }; - function clear2() { - moduleNameToDirectoryMap.clear(); - } - function update(options2) { - moduleNameToDirectoryMap.update(options2); - } - function getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference) { - var _a, _b; - Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName)); - return (_b = (_a = moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a.get(createModeAwareCacheKey(nonRelativeModuleName, mode))) == null ? void 0 : _b.get(directoryName); - } - function getOrCreateCacheForNonRelativeName(nonRelativeModuleName, mode, redirectedReference) { - Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName)); - return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache); - } - function createPerModuleNameCache() { - const directoryPathMap = /* @__PURE__ */ new Map(); - return { get, set }; - function get(directory) { - return directoryPathMap.get(toPath(directory, currentDirectory, getCanonicalFileName)); - } - function set(directory, result) { - const path = toPath(directory, currentDirectory, getCanonicalFileName); - if (directoryPathMap.has(path)) { - return; - } - directoryPathMap.set(path, result); - const resolvedFileName = getResolvedFileName(result); - const commonPrefix = resolvedFileName && getCommonPrefix(path, resolvedFileName); - let current = path; - while (current !== commonPrefix) { - const parent2 = getDirectoryPath(current); - if (parent2 === current || directoryPathMap.has(parent2)) { - break; - } - directoryPathMap.set(parent2, result); - current = parent2; - } - } - function getCommonPrefix(directory, resolution) { - const resolutionDirectory = toPath(getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); - let i = 0; - const limit = Math.min(directory.length, resolutionDirectory.length); - while (i < limit && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) { - i++; - } - if (i === directory.length && (resolutionDirectory.length === i || resolutionDirectory[i] === directorySeparator)) { - return directory; - } - const rootLength = getRootLength(directory); - if (i < rootLength) { - return void 0; - } - const sep = directory.lastIndexOf(directorySeparator, i - 1); - if (sep === -1) { - return void 0; - } - return directory.substr(0, Math.max(sep, rootLength)); - } - } -} -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, - optionsToRedirectsKey - ); - packageJsonInfoCache ?? (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName)); - return { - ...packageJsonInfoCache, - ...perDirectoryResolutionCache, - ...nonRelativeNameResolutionCache, - clear: clear2, - update, - getPackageJsonInfoCache: () => packageJsonInfoCache, - clearAllExceptPackageJsonInfoCache, - optionsToRedirectsKey - }; - function clear2() { - clearAllExceptPackageJsonInfoCache(); - packageJsonInfoCache.clear(); - } - function clearAllExceptPackageJsonInfoCache() { - perDirectoryResolutionCache.clear(); - nonRelativeNameResolutionCache.clear(); - } - function update(options2) { - perDirectoryResolutionCache.update(options2); - nonRelativeNameResolutionCache.update(options2); - } -} -function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) { - const result = createModuleOrTypeReferenceResolutionCache( - currentDirectory, - getCanonicalFileName, - options, - packageJsonInfoCache, - getOriginalOrResolvedModuleFileName, - optionsToRedirectsKey - ); - result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference); - return result; -} -function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) { - return createModuleOrTypeReferenceResolutionCache( - currentDirectory, - getCanonicalFileName, - options, - packageJsonInfoCache, - getOriginalOrResolvedTypeReferenceFileName, - optionsToRedirectsKey - ); -} -function getOptionsForLibraryResolution(options) { - return { moduleResolution: 2 /* Node10 */, traceResolution: options.traceResolution }; -} -function resolveLibrary(libraryName, resolveFrom, compilerOptions, host, cache) { - return resolveModuleName(libraryName, resolveFrom, getOptionsForLibraryResolution(compilerOptions), host, cache); -} -function resolveModuleNameFromCache(moduleName, containingFile, cache, mode) { - const containingDirectory = getDirectoryPath(containingFile); - return cache.getFromDirectoryCache( - moduleName, - mode, - containingDirectory, - /*redirectedReference*/ - void 0 - ); -} -function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - const traceEnabled = isTraceEnabled(compilerOptions, host); - if (redirectedReference) { - compilerOptions = redirectedReference.commandLine.options; - } - if (traceEnabled) { - trace(host, Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); - if (redirectedReference) { - trace(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); - } - } - const containingDirectory = getDirectoryPath(containingFile); - let result = cache == null ? void 0 : cache.getFromDirectoryCache(moduleName, resolutionMode, containingDirectory, redirectedReference); - if (result) { - if (traceEnabled) { - trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); - } - } else { - let moduleResolution = compilerOptions.moduleResolution; - if (moduleResolution === void 0) { - moduleResolution = getEmitModuleResolutionKind(compilerOptions); - if (traceEnabled) { - trace(host, Diagnostics.Module_resolution_kind_is_not_specified_using_0, ModuleResolutionKind[moduleResolution]); - } - } else { - if (traceEnabled) { - trace(host, Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ModuleResolutionKind[moduleResolution]); - } - } - switch (moduleResolution) { - case 3 /* Node16 */: - result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); - break; - case 99 /* NodeNext */: - result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); - break; - case 2 /* Node10 */: - 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, resolutionMode ? getConditions(compilerOptions, resolutionMode) : void 0); - break; - default: - return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`); - } - 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) { - if (result.resolvedModule) { - if (result.resolvedModule.packageId) { - trace(host, Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, moduleName, result.resolvedModule.resolvedFileName, packageIdToString(result.resolvedModule.packageId)); - } else { - trace(host, Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.resolvedModule.resolvedFileName); - } - } else { - trace(host, Diagnostics.Module_name_0_was_not_resolved, moduleName); - } - } - return result; -} -function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state) { - const resolved = tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state); - if (resolved) return resolved.value; - if (!isExternalModuleNameRelative(moduleName)) { - return tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state); - } else { - return tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state); - } -} -function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { - const { baseUrl, paths } = state.compilerOptions; - if (paths && !pathIsRelative(moduleName)) { - if (state.traceEnabled) { - if (baseUrl) { - trace(state.host, Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } - trace(state.host, Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); - } - const baseDirectory = getPathsBasePath(state.compilerOptions, state.host); - const pathPatterns = tryParsePatterns(paths); - return tryLoadModuleUsingPaths( - extensions, - moduleName, - baseDirectory, - paths, - pathPatterns, - loader, - /*onlyRecordFailures*/ - false, - state - ); - } -} -function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { - if (!state.compilerOptions.rootDirs) { - return void 0; - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName); - } - const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); - let matchedRootDir; - let matchedNormalizedPrefix; - for (const rootDir of state.compilerOptions.rootDirs) { - let normalizedRoot = normalizePath(rootDir); - if (!endsWith(normalizedRoot, directorySeparator)) { - normalizedRoot += directorySeparator; - } - const isLongestMatchingPrefix = startsWith(candidate, normalizedRoot) && (matchedNormalizedPrefix === void 0 || matchedNormalizedPrefix.length < normalizedRoot.length); - if (state.traceEnabled) { - trace(state.host, Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix); - } - if (isLongestMatchingPrefix) { - matchedNormalizedPrefix = normalizedRoot; - matchedRootDir = rootDir; - } - } - if (matchedNormalizedPrefix) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix); - } - const suffix = candidate.substr(matchedNormalizedPrefix.length); - if (state.traceEnabled) { - trace(state.host, Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate); - } - const resolvedFileName = loader(extensions, candidate, !directoryProbablyExists(containingDirectory, state.host), state); - if (resolvedFileName) { - return resolvedFileName; - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.Trying_other_entries_in_rootDirs); - } - for (const rootDir of state.compilerOptions.rootDirs) { - if (rootDir === matchedRootDir) { - continue; - } - const candidate2 = combinePaths(normalizePath(rootDir), suffix); - if (state.traceEnabled) { - trace(state.host, Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate2); - } - const baseDirectory = getDirectoryPath(candidate2); - const resolvedFileName2 = loader(extensions, candidate2, !directoryProbablyExists(baseDirectory, state.host), state); - if (resolvedFileName2) { - return resolvedFileName2; - } - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.Module_resolution_using_rootDirs_has_failed); - } - } - return void 0; -} -function tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state) { - const { baseUrl } = state.compilerOptions; - if (!baseUrl) { - return void 0; - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } - const candidate = normalizePath(combinePaths(baseUrl, moduleName)); - if (state.traceEnabled) { - trace(state.host, Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, baseUrl, candidate); - } - return loader(extensions, candidate, !directoryProbablyExists(getDirectoryPath(candidate), state.host), state); -} -function resolveJSModule(moduleName, initialDir, host) { - const { resolvedModule, failedLookupLocations } = tryResolveJSModuleWorker(moduleName, initialDir, host); - if (!resolvedModule) { - throw new Error(`Could not resolve JS module '${moduleName}' starting at '${initialDir}'. Looked in: ${failedLookupLocations == null ? void 0 : failedLookupLocations.join(", ")}`); - } - return resolvedModule.resolvedFileName; -} -var NodeResolutionFeatures = /* @__PURE__ */ ((NodeResolutionFeatures2) => { - NodeResolutionFeatures2[NodeResolutionFeatures2["None"] = 0] = "None"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Imports"] = 2] = "Imports"; - NodeResolutionFeatures2[NodeResolutionFeatures2["SelfName"] = 4] = "SelfName"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Exports"] = 8] = "Exports"; - NodeResolutionFeatures2[NodeResolutionFeatures2["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; - NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 30] = "AllFeatures"; - NodeResolutionFeatures2[NodeResolutionFeatures2["Node16Default"] = 30] = "Node16Default"; - NodeResolutionFeatures2[NodeResolutionFeatures2["NodeNextDefault"] = 30 /* AllFeatures */] = "NodeNextDefault"; - NodeResolutionFeatures2[NodeResolutionFeatures2["BundlerDefault"] = 30] = "BundlerDefault"; - NodeResolutionFeatures2[NodeResolutionFeatures2["EsmMode"] = 32] = "EsmMode"; - return NodeResolutionFeatures2; -})(NodeResolutionFeatures || {}); -function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker( - 30 /* Node16Default */, - moduleName, - containingFile, - compilerOptions, - host, - cache, - redirectedReference, - resolutionMode - ); -} -function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker( - 30 /* NodeNextDefault */, - 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 */; - if (getResolveJsonModule(compilerOptions)) { - extensions |= 8 /* Json */; - } - return nodeModuleNameResolverWorker( - features | esmMode, - moduleName, - containingDirectory, - compilerOptions, - host, - cache, - extensions, - /*isConfigLookup*/ - false, - redirectedReference, - conditions - ); -} -function tryResolveJSModuleWorker(moduleName, initialDir, host) { - return nodeModuleNameResolverWorker( - 0 /* None */, - moduleName, - initialDir, - { moduleResolution: 2 /* Node10 */, allowJs: true }, - host, - /*cache*/ - void 0, - 2 /* JavaScript */, - /*isConfigLookup*/ - false, - /*redirectedReference*/ - void 0, - /*conditions*/ - void 0 - ); -} -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)) { - extensions |= 8 /* Json */; - } - return nodeModuleNameResolverWorker( - getNodeResolutionFeatures(compilerOptions), - moduleName, - containingDirectory, - compilerOptions, - host, - cache, - extensions, - /*isConfigLookup*/ - false, - redirectedReference, - conditions - ); -} -function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) { - let extensions; - if (isConfigLookup) { - extensions = 8 /* Json */; - } else if (compilerOptions.noDtsResolution) { - extensions = 3 /* ImplementationFiles */; - if (getResolveJsonModule(compilerOptions)) extensions |= 8 /* Json */; - } else { - extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */; - } - return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions); -} -function nodeNextJsonConfigResolver(moduleName, containingFile, host) { - return nodeModuleNameResolverWorker( - 30 /* NodeNextDefault */, - moduleName, - getDirectoryPath(containingFile), - { moduleResolution: 99 /* NodeNext */ }, - host, - /*cache*/ - void 0, - 8 /* Json */, - /*isConfigLookup*/ - true, - /*redirectedReference*/ - void 0, - /*conditions*/ - void 0 - ); -} -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 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, - host, - traceEnabled, - failedLookupLocations, - affectingLocations, - packageJsonInfoCache: cache, - features, - conditions: conditions ?? emptyArray, - requestContainingDirectory: containingDirectory, - reportDiagnostic: (diag2) => void diagnostics.push(diag2), - isConfigLookup, - candidateIsFromPackageJsonField: false, - resolvedPackageDirectory: false - }; - if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", ")); - } - let result; - 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 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, - (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.resolved, - (_e = result == null ? void 0 : result.value) == null ? void 0 : _e.isExternalLibraryImport, - failedLookupLocations, - affectingLocations, - diagnostics, - state, - cache, - alternateResult - ); - function tryResolve(extensions2, state2) { - const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( - extensions3, - candidate, - onlyRecordFailures, - state3, - /*considerPackageJson*/ - true - ); - const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2); - if (resolved) { - return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); - } - if (!isExternalModuleNameRelative(moduleName)) { - if (features & 2 /* Imports */ && startsWith(moduleName, "#")) { - const resolved3 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); - if (resolved3) { - return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } }; - } - } - if (features & 4 /* SelfName */) { - const resolved3 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); - if (resolved3) { - return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } }; - } - } - 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)); - } - return void 0; - } - if (traceEnabled) { - trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2)); - } - let resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); - if (extensions2 & 4 /* Declaration */) { - resolved2 ?? (resolved2 = resolveFromTypeRoot(moduleName, state2)); - } - return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } }; - } else { - const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName); - const resolved2 = nodeLoadModuleByRelativeName( - extensions2, - candidate, - /*onlyRecordFailures*/ - false, - state2, - /*considerPackageJson*/ - true - ); - return resolved2 && toSearchResult({ resolved: resolved2, isExternalLibraryImport: contains(parts, "node_modules") }); - } - } -} -function normalizePathForCJSResolution(containingDirectory, moduleName) { - const combined = combinePaths(containingDirectory, moduleName); - const parts = getPathComponents(combined); - const lastPart = lastOrUndefined(parts); - const path = lastPart === "." || lastPart === ".." ? ensureTrailingDirectorySeparator(normalizePath(combined)) : normalizePath(combined); - return { path, parts }; -} -function realPath(path, host, traceEnabled) { - if (!host.realpath) { - return path; - } - const real = normalizePath(host.realpath(path)); - if (traceEnabled) { - trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path, real); - } - return real; -} -function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, candidate, formatExtensions(extensions)); - } - if (!hasTrailingDirectorySeparator(candidate)) { - if (!onlyRecordFailures) { - const parentOfCandidate = getDirectoryPath(candidate); - if (!directoryProbablyExists(parentOfCandidate, state.host)) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); - } - onlyRecordFailures = true; - } - } - const resolvedFromFile = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state); - if (resolvedFromFile) { - const packageDirectory = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile.path) : void 0; - const packageInfo = packageDirectory ? getPackageJsonInfo( - packageDirectory, - /*onlyRecordFailures*/ - false, - state - ) : void 0; - return withPackageId(packageInfo, resolvedFromFile, state); - } - } - if (!onlyRecordFailures) { - const candidateExists = directoryProbablyExists(candidate, state.host); - if (!candidateExists) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); - } - onlyRecordFailures = true; - } - } - if (!(state.features & 32 /* EsmMode */)) { - return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson); - } - return void 0; -} -var nodeModulesPathPart = "/node_modules/"; -function pathContainsNodeModules(path) { - return path.includes(nodeModulesPathPart); -} -function parseNodeModuleFromPath(resolved, isFolder) { - const path = normalizePath(resolved); - const idx = path.lastIndexOf(nodeModulesPathPart); - if (idx === -1) { - return void 0; - } - const indexAfterNodeModules = idx + nodeModulesPathPart.length; - let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules, isFolder); - if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) { - indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName, isFolder); - } - return path.slice(0, indexAfterPackageName); -} -function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex, isFolder) { - const nextSeparatorIndex = path.indexOf(directorySeparator, prevSeparatorIndex + 1); - return nextSeparatorIndex === -1 ? isFolder ? path.length : prevSeparatorIndex : nextSeparatorIndex; -} -function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) { - return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state)); -} -function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) { - const resolvedByReplacingExtension = loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); - if (resolvedByReplacingExtension) { - return resolvedByReplacingExtension; - } - if (!(state.features & 32 /* EsmMode */)) { - const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state); - if (resolvedByAddingExtension) { - return resolvedByAddingExtension; - } - } -} -function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) { - const filename = getBaseFileName(candidate); - if (!filename.includes(".")) { - return void 0; - } - let extensionless = removeFileExtension(candidate); - if (extensionless === candidate) { - extensionless = candidate.substring(0, candidate.lastIndexOf(".")); - } - const extension = candidate.substring(extensionless.length); - if (state.traceEnabled) { - trace(state.host, Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension); - } - return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state); -} -function loadFileNameFromPackageJsonField(extensions, candidate, packageJsonValue, onlyRecordFailures, state) { - if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) { - const result = tryFile(candidate, onlyRecordFailures, state); - const ext = tryExtractTSExtension(candidate); - return result !== void 0 ? { path: candidate, ext, resolvedUsingTsExtension: packageJsonValue ? !endsWith(packageJsonValue, ext) : void 0 } : void 0; - } - if (state.isConfigLookup && extensions === 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) { - const result = tryFile(candidate, onlyRecordFailures, state); - return result !== void 0 ? { path: candidate, ext: ".json" /* Json */, resolvedUsingTsExtension: void 0 } : void 0; - } - return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); -} -function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) { - if (!onlyRecordFailures) { - const directory = getDirectoryPath(candidate); - if (directory) { - onlyRecordFailures = !directoryProbablyExists(directory, state.host); - } - } - switch (originalExtension) { - case ".mjs" /* Mjs */: - case ".mts" /* Mts */: - case ".d.mts" /* Dmts */: - return extensions & 1 /* TypeScript */ && tryExtension(".mts" /* Mts */, originalExtension === ".mts" /* Mts */ || originalExtension === ".d.mts" /* Dmts */) || extensions & 4 /* Declaration */ && tryExtension(".d.mts" /* Dmts */, originalExtension === ".mts" /* Mts */ || originalExtension === ".d.mts" /* Dmts */) || extensions & 2 /* JavaScript */ && tryExtension(".mjs" /* Mjs */) || void 0; - case ".cjs" /* Cjs */: - case ".cts" /* Cts */: - case ".d.cts" /* Dcts */: - return extensions & 1 /* TypeScript */ && tryExtension(".cts" /* Cts */, originalExtension === ".cts" /* Cts */ || originalExtension === ".d.cts" /* Dcts */) || extensions & 4 /* Declaration */ && tryExtension(".d.cts" /* Dcts */, originalExtension === ".cts" /* Cts */ || originalExtension === ".d.cts" /* Dcts */) || extensions & 2 /* JavaScript */ && tryExtension(".cjs" /* Cjs */) || void 0; - case ".json" /* Json */: - return extensions & 4 /* Declaration */ && tryExtension(".d.json.ts") || extensions & 8 /* Json */ && tryExtension(".json" /* Json */) || void 0; - case ".tsx" /* Tsx */: - case ".jsx" /* Jsx */: - return extensions & 1 /* TypeScript */ && (tryExtension(".tsx" /* Tsx */, originalExtension === ".tsx" /* Tsx */) || tryExtension(".ts" /* Ts */, originalExtension === ".tsx" /* Tsx */)) || extensions & 4 /* Declaration */ && tryExtension(".d.ts" /* Dts */, originalExtension === ".tsx" /* Tsx */) || extensions & 2 /* JavaScript */ && (tryExtension(".jsx" /* Jsx */) || tryExtension(".js" /* Js */)) || void 0; - case ".ts" /* Ts */: - case ".d.ts" /* Dts */: - case ".js" /* Js */: - case "": - return extensions & 1 /* TypeScript */ && (tryExtension(".ts" /* Ts */, originalExtension === ".ts" /* Ts */ || originalExtension === ".d.ts" /* Dts */) || tryExtension(".tsx" /* Tsx */, originalExtension === ".ts" /* Ts */ || originalExtension === ".d.ts" /* Dts */)) || extensions & 4 /* Declaration */ && tryExtension(".d.ts" /* Dts */, originalExtension === ".ts" /* Ts */ || originalExtension === ".d.ts" /* Dts */) || extensions & 2 /* JavaScript */ && (tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */)) || state.isConfigLookup && tryExtension(".json" /* Json */) || void 0; - default: - return extensions & 4 /* Declaration */ && !isDeclarationFileName(candidate + originalExtension) && tryExtension(`.d${originalExtension}.ts`) || void 0; - } - function tryExtension(ext, resolvedUsingTsExtension) { - const path = tryFile(candidate + ext, onlyRecordFailures, state); - return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension }; - } -} -function tryFile(fileName, onlyRecordFailures, state) { - var _a; - if (!((_a = state.compilerOptions.moduleSuffixes) == null ? void 0 : _a.length)) { - return tryFileLookup(fileName, onlyRecordFailures, state); - } - const ext = tryGetExtensionFromPath2(fileName) ?? ""; - const fileNameNoExtension = ext ? removeExtension(fileName, ext) : fileName; - return forEach(state.compilerOptions.moduleSuffixes, (suffix) => tryFileLookup(fileNameNoExtension + suffix + ext, onlyRecordFailures, state)); -} -function tryFileLookup(fileName, onlyRecordFailures, state) { - var _a; - if (!onlyRecordFailures) { - if (state.host.fileExists(fileName)) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName); - } - return fileName; - } else { - if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_does_not_exist, fileName); - } - } - } - (_a = state.failedLookupLocations) == null ? void 0 : _a.push(fileName); - return void 0; -} -function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) { - const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0; - return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state); -} -function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) { - if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) { - return packageJsonInfo.contents.resolvedEntrypoints; - } - let entrypoints; - const extensions = 1 /* TypeScript */ | 4 /* Declaration */ | (resolveJs ? 2 /* JavaScript */ : 0); - const features = getNodeResolutionFeatures(options); - const loadPackageJsonMainState = getTemporaryModuleResolutionState(cache == null ? void 0 : cache.getPackageJsonInfoCache(), host, options); - loadPackageJsonMainState.conditions = getConditions(options); - loadPackageJsonMainState.requestContainingDirectory = packageJsonInfo.packageDirectory; - const mainResolution = loadNodeModuleFromDirectoryWorker( - extensions, - packageJsonInfo.packageDirectory, - /*onlyRecordFailures*/ - false, - loadPackageJsonMainState, - packageJsonInfo - ); - entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path); - if (features & 8 /* Exports */ && packageJsonInfo.contents.packageJsonContent.exports) { - const conditionSets = deduplicate( - [getConditions(options, 99 /* ESNext */), getConditions(options, 1 /* CommonJS */)], - arrayIsEqualTo - ); - for (const conditions of conditionSets) { - const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host }; - const exportResolutions = loadEntrypointsFromExportMap( - packageJsonInfo, - packageJsonInfo.contents.packageJsonContent.exports, - loadPackageJsonExportsState, - extensions - ); - if (exportResolutions) { - for (const resolution of exportResolutions) { - entrypoints = appendIfUnique(entrypoints, resolution.path); - } - } - } - } - return packageJsonInfo.contents.resolvedEntrypoints = entrypoints || false; -} -function loadEntrypointsFromExportMap(scope, exports2, state, extensions) { - let entrypoints; - if (isArray(exports2)) { - for (const target of exports2) { - loadEntrypointsFromTargetExports(target); - } - } else if (typeof exports2 === "object" && exports2 !== null && allKeysStartWithDot(exports2)) { - for (const key in exports2) { - loadEntrypointsFromTargetExports(exports2[key]); - } - } else { - loadEntrypointsFromTargetExports(exports2); - } - return entrypoints; - function loadEntrypointsFromTargetExports(target) { - var _a, _b; - 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, - target, - /*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) { - const success = loadEntrypointsFromTargetExports(t); - if (success) { - return true; - } - } - } else if (typeof target === "object" && target !== null) { - return forEach(getOwnKeys(target), (key) => { - if (key === "default" || contains(state.conditions, key) || isApplicableVersionedTypesKey(state.conditions, key)) { - loadEntrypointsFromTargetExports(target[key]); - return true; - } - }); - } - } -} -function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) { - return { - host, - compilerOptions: options, - traceEnabled: isTraceEnabled(options, host), - failedLookupLocations: void 0, - affectingLocations: void 0, - packageJsonInfoCache, - features: 0 /* None */, - conditions: emptyArray, - requestContainingDirectory: void 0, - reportDiagnostic: noop, - isConfigLookup: false, - candidateIsFromPackageJsonField: false, - resolvedPackageDirectory: false - }; -} -function getPackageScopeForPath(directory, state) { - return forEachAncestorDirectoryStoppingAtGlobalCache( - state.host, - directory, - (dir) => getPackageJsonInfo( - dir, - /*onlyRecordFailures*/ - false, - state - ) - ); -} -function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) { - if (packageJsonInfo.contents.versionPaths === void 0) { - packageJsonInfo.contents.versionPaths = readPackageJsonTypesVersionPaths(packageJsonInfo.contents.packageJsonContent, state) || false; - } - return packageJsonInfo.contents.versionPaths || void 0; -} -function getPeerDependenciesOfPackageJsonInfo(packageJsonInfo, state) { - if (packageJsonInfo.contents.peerDependencies === void 0) { - packageJsonInfo.contents.peerDependencies = readPackageJsonPeerDependencies(packageJsonInfo, state) || false; - } - return packageJsonInfo.contents.peerDependencies || void 0; -} -function readPackageJsonPeerDependencies(packageJsonInfo, state) { - const peerDependencies = readPackageJsonField(packageJsonInfo.contents.packageJsonContent, "peerDependencies", "object", state); - if (peerDependencies === void 0) return void 0; - if (state.traceEnabled) trace(state.host, Diagnostics.package_json_has_a_peerDependencies_field); - const packageDirectory = realPath(packageJsonInfo.packageDirectory, state.host, state.traceEnabled); - const nodeModules = packageDirectory.substring(0, packageDirectory.lastIndexOf("node_modules") + "node_modules".length) + directorySeparator; - let result = ""; - for (const key in peerDependencies) { - if (hasProperty(peerDependencies, key)) { - const peerPackageJson = getPackageJsonInfo( - nodeModules + key, - /*onlyRecordFailures*/ - false, - state - ); - if (peerPackageJson) { - const version2 = peerPackageJson.contents.packageJsonContent.version; - result += `+${key}@${version2}`; - if (state.traceEnabled) trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2); - } else { - if (state.traceEnabled) trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key); - } - } - } - return result; -} -function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) { - var _a, _b, _c, _d, _e, _f; - const { host, traceEnabled } = state; - const packageJsonPath = combinePaths(packageDirectory, "package.json"); - if (onlyRecordFailures) { - (_a = state.failedLookupLocations) == null ? void 0 : _a.push(packageJsonPath); - return void 0; - } - const existing = (_b = state.packageJsonInfoCache) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath); - if (existing !== void 0) { - 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.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; - } - } - const directoryExists = directoryProbablyExists(packageDirectory, host); - if (directoryExists && host.fileExists(packageJsonPath)) { - const packageJsonContent = readJson(packageJsonPath, host); - if (traceEnabled) { - trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath); - } - const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } }; - 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); - } - 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, packageJson) { - const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state); - let packageFile; - if (packageJson && arePathsEqual(packageJson == null ? void 0 : packageJson.packageDirectory, candidate, state.host)) { - if (state.isConfigLookup) { - packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state); - } else { - packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || void 0; - } - } - const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => { - const fromFile = loadFileNameFromPackageJsonField( - extensions2, - candidate2, - /*packageJsonValue*/ - void 0, - onlyRecordFailures2, - state2 - ); - if (fromFile) { - return noPackageId(fromFile); - } - const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2; - const features = state2.features; - const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField; - state2.candidateIsFromPackageJsonField = true; - if ((packageJson == null ? void 0 : packageJson.contents.packageJsonContent.type) !== "module") { - state2.features &= ~32 /* EsmMode */; - } - const result = nodeLoadModuleByRelativeName( - expandedExtensions, - candidate2, - onlyRecordFailures2, - state2, - /*considerPackageJson*/ - false - ); - state2.features = features; - state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField; - return result; - }; - const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0; - const onlyRecordFailuresForIndex = onlyRecordFailures || !directoryProbablyExists(candidate, state.host); - const indexPath = combinePaths(candidate, state.isConfigLookup ? "tsconfig" : "index"); - if (versionPaths && (!packageFile || containsPath(candidate, packageFile))) { - const moduleName = getRelativePathFromDirectory( - candidate, - packageFile || indexPath, - /*ignoreCase*/ - false - ); - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, moduleName); - } - const pathPatterns = tryParsePatterns(versionPaths.paths); - const result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, pathPatterns, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state); - if (result) { - return removeIgnoredPackageId(result.value); - } - } - const packageFileResult = packageFile && removeIgnoredPackageId(loader(extensions, packageFile, onlyRecordFailuresForPackageFile, state)); - if (packageFileResult) return packageFileResult; - if (!(state.features & 32 /* EsmMode */)) { - return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state); - } -} -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; -} -function parsePackageName(moduleName) { - let idx = moduleName.indexOf(directorySeparator); - if (moduleName[0] === "@") { - idx = moduleName.indexOf(directorySeparator, idx + 1); - } - return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) }; -} -function allKeysStartWithDot(obj) { - return every(getOwnKeys(obj), (k) => startsWith(k, ".")); -} -function noKeyStartsWithDot(obj) { - return !some(getOwnKeys(obj), (k) => startsWith(k, ".")); -} -function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) { - var _a, _b; - const directoryPath = getNormalizedAbsolutePath(directory, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)); - const scope = getPackageScopeForPath(directoryPath, state); - if (!scope || !scope.contents.packageJsonContent.exports) { - return void 0; - } - if (typeof scope.contents.packageJsonContent.name !== "string") { - return void 0; - } - const parts = getPathComponents(moduleName); - const nameParts = getPathComponents(scope.contents.packageJsonContent.name); - if (!every(nameParts, (p, i) => parts[i] === p)) { - return void 0; - } - 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); -} -function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) { - if (!scope.contents.packageJsonContent.exports) { - return void 0; - } - if (subpath === ".") { - let mainExport; - if (typeof scope.contents.packageJsonContent.exports === "string" || Array.isArray(scope.contents.packageJsonContent.exports) || typeof scope.contents.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.contents.packageJsonContent.exports)) { - mainExport = scope.contents.packageJsonContent.exports; - } else if (hasProperty(scope.contents.packageJsonContent.exports, ".")) { - mainExport = scope.contents.packageJsonContent.exports["."]; - } - if (mainExport) { - const loadModuleFromTargetExportOrImport = getLoadModuleFromTargetExportOrImport( - extensions, - state, - cache, - redirectedReference, - subpath, - scope, - /*isImports*/ - false - ); - return loadModuleFromTargetExportOrImport( - mainExport, - "", - /*pattern*/ - false, - "." - ); - } - } else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) { - if (typeof scope.contents.packageJsonContent.exports !== "object") { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - const result = loadModuleFromExportsOrImports( - extensions, - state, - cache, - redirectedReference, - subpath, - scope.contents.packageJsonContent.exports, - scope, - /*isImports*/ - false - ); - if (result) { - return result; - } - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); - } - return toSearchResult( - /*value*/ - void 0 - ); -} -function loadModuleFromImports(extensions, moduleName, directory, state, cache, redirectedReference) { - var _a, _b; - if (moduleName === "#" || startsWith(moduleName, "#/")) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - const directoryPath = getNormalizedAbsolutePath(directory, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)); - const scope = getPackageScopeForPath(directoryPath, state); - if (!scope) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - if (!scope.contents.packageJsonContent.imports) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - const result = loadModuleFromExportsOrImports( - extensions, - state, - cache, - redirectedReference, - moduleName, - scope.contents.packageJsonContent.imports, - scope, - /*isImports*/ - true - ); - if (result) { - return result; - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, moduleName, scope.packageDirectory); - } - return toSearchResult( - /*value*/ - void 0 - ); -} -function comparePatternKeys(a, b) { - const aPatternIndex = a.indexOf("*"); - const bPatternIndex = b.indexOf("*"); - const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; - const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - if (baseLenA > baseLenB) return -1 /* LessThan */; - if (baseLenB > baseLenA) return 1 /* GreaterThan */; - if (aPatternIndex === -1) return 1 /* GreaterThan */; - if (bPatternIndex === -1) return -1 /* LessThan */; - if (a.length > b.length) return -1 /* LessThan */; - if (b.length > a.length) return 1 /* GreaterThan */; - return 0 /* EqualTo */; -} -function loadModuleFromExportsOrImports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) { - const loadModuleFromTargetExportOrImport = getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirectedReference, moduleName, scope, isImports); - if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) { - const target = lookupTable[moduleName]; - return loadModuleFromTargetExportOrImport( - target, - /*subpath*/ - "", - /*pattern*/ - false, - moduleName - ); - } - const expandingKeys = toSorted(filter(getOwnKeys(lookupTable), (k) => hasOneAsterisk(k) || endsWith(k, "/")), comparePatternKeys); - for (const potentialTarget of expandingKeys) { - if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) { - const target = lookupTable[potentialTarget]; - const starPos = potentialTarget.indexOf("*"); - const subpath = moduleName.substring(potentialTarget.substring(0, starPos).length, moduleName.length - (potentialTarget.length - 1 - starPos)); - return loadModuleFromTargetExportOrImport( - target, - subpath, - /*pattern*/ - true, - potentialTarget - ); - } else if (endsWith(potentialTarget, "*") && startsWith(moduleName, potentialTarget.substring(0, potentialTarget.length - 1))) { - const target = lookupTable[potentialTarget]; - const subpath = moduleName.substring(potentialTarget.length - 1); - return loadModuleFromTargetExportOrImport( - target, - subpath, - /*pattern*/ - true, - potentialTarget - ); - } else if (startsWith(moduleName, potentialTarget)) { - const target = lookupTable[potentialTarget]; - const subpath = moduleName.substring(potentialTarget.length); - return loadModuleFromTargetExportOrImport( - target, - subpath, - /*pattern*/ - false, - potentialTarget - ); - } - } - function matchesPatternWithTrailer(target, name) { - if (endsWith(target, "*")) return false; - const starPos = target.indexOf("*"); - if (starPos === -1) return false; - return startsWith(name, target.substring(0, starPos)) && endsWith(name, target.substring(starPos + 1)); - } -} -function hasOneAsterisk(patternKey) { - const firstStar = patternKey.indexOf("*"); - return firstStar !== -1 && firstStar === patternKey.lastIndexOf("*"); -} -function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) { - return loadModuleFromTargetExportOrImport; - function loadModuleFromTargetExportOrImport(target, subpath, pattern, key) { - var _a, _b; - if (typeof target === "string") { - if (!pattern && subpath.length > 0 && !endsWith(target, "/")) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - if (!startsWith(target, "./")) { - if (isImports && !startsWith(target, "../") && !startsWith(target, "/") && !isRootedDiskPath(target)) { - const combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath; - traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup); - traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/"); - const result = nodeModuleNameResolverWorker( - state.features, - combinedLookup, - scope.packageDirectory + "/", - state.compilerOptions, - state.host, - cache, - extensions, - /*isConfigLookup*/ - false, - redirectedReference, - state.conditions - ); - (_a = state.failedLookupLocations) == null ? void 0 : _a.push(...result.failedLookupLocations ?? emptyArray); - (_b = state.affectingLocations) == null ? void 0 : _b.push(...result.affectingLocations ?? emptyArray); - 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); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target); - const partsAfterFirst = parts.slice(1); - 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); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - const resolvedTarget = combinePaths(scope.packageDirectory, target); - const subpathParts = getPathComponents(subpath); - 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); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - 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); - } - const finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath); - const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports); - if (inputLink) return inputLink; - return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField( - extensions, - finalPath, - target, - /*onlyRecordFailures*/ - false, - state - ), state)); - } else if (typeof target === "object" && target !== null) { - if (!Array.isArray(target)) { - traceIfEnabled(state, Diagnostics.Entering_conditional_exports); - for (const condition of getOwnKeys(target)) { - 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 = loadModuleFromTargetExportOrImport(subTarget, subpath, pattern, key); - if (result) { - traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); - traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); - return result; - } else { - traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition); - } - } else { - traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); - } - } - traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); - return void 0; - } else { - if (!length(target)) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - for (const elem of target) { - const result = loadModuleFromTargetExportOrImport(elem, subpath, pattern, key); - if (result) { - return result; - } - } - } - } else if (target === null) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.packageDirectory, moduleName); - } - return toSearchResult( - /*value*/ - void 0 - ); - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); - } - return toSearchResult( - /*value*/ - void 0 - ); - function toAbsolutePath(path) { - var _a2, _b2; - if (path === void 0) return path; - return getNormalizedAbsolutePath(path, (_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)); - } - function combineDirectoryPath(root, dir) { - return ensureTrailingDirectorySeparator(combinePaths(root, dir)); - } - function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) { - var _a2, _b2, _c, _d; - 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, () => [], ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "", getCanonicalFileName)); - commonSourceDirGuesses.push(commonDir); - } else if (state.requestContainingDirectory) { - const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts")); - const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [requestingFile, toAbsolutePath(packagePath)], ((_d = (_c = state.host).getCurrentDirectory) == null ? void 0 : _d.call(_c)) || "", getCanonicalFileName)); - commonSourceDirGuesses.push(commonDir); - let fragment = ensureTrailingDirectorySeparator(commonDir); - while (fragment && fragment.length > 1) { - const parts = getPathComponents(fragment); - parts.pop(); - const commonDir2 = getPathFromPathComponents(parts); - commonSourceDirGuesses.unshift(commonDir2); - fragment = ensureTrailingDirectorySeparator(commonDir2); - } - } - if (commonSourceDirGuesses.length > 1) { - state.reportDiagnostic(createCompilerDiagnostic( - isImports2 ? Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate : Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, - entry === "" ? "." : entry, - // replace empty string with `.` - the reverse of the operation done when entries are built - so main entrypoint errors don't look weird - packagePath - )); - } - for (const commonSourceDirGuess of commonSourceDirGuesses) { - const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess); - for (const candidateDir of candidateDirectories) { - 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 */]; - for (const ext of jsAndDtsExtensions) { - if (fileExtensionIs(possibleInputBase, ext)) { - const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase); - for (const possibleExt of inputExts) { - if (!extensionIsOk(extensions, possibleExt)) continue; - const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state)); - if (state.host.fileExists(possibleInputWithInputExtension)) { - return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField( - extensions, - possibleInputWithInputExtension, - /*packageJsonValue*/ - void 0, - /*onlyRecordFailures*/ - false, - state - ), state)); - } - } - } - } - } - } - } - } - return void 0; - function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) { - var _a3, _b3; - const currentDir = state.compilerOptions.configFile ? ((_b3 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b3.call(_a3)) || "" : commonSourceDirGuess; - const candidateDirectories = []; - if (state.compilerOptions.declarationDir) { - candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir))); - } - if (state.compilerOptions.outDir && state.compilerOptions.outDir !== state.compilerOptions.declarationDir) { - candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.outDir))); - } - return candidateDirectories; - } - } - } -} -function isApplicableVersionedTypesKey(conditions, key) { - if (!conditions.includes("types")) return false; - if (!startsWith(key, "types@")) return false; - const range = VersionRange.tryParse(key.substring("types@".length)); - if (!range) return false; - return range.test(version); -} -function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) { - return loadModuleFromNearestNodeModulesDirectoryWorker( - extensions, - moduleName, - directory, - state, - /*typesScopeOnly*/ - false, - cache, - redirectedReference - ); -} -function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directory, state) { - return loadModuleFromNearestNodeModulesDirectoryWorker( - 4 /* Declaration */, - moduleName, - directory, - state, - /*typesScopeOnly*/ - true, - /*cache*/ - void 0, - /*redirectedReference*/ - void 0 - ); -} -function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) { - const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */; - 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) { - return forEachAncestorDirectoryStoppingAtGlobalCache( - state.host, - normalizeSlashes(directory), - (ancestorDirectory) => { - if (getBaseFileName(ancestorDirectory) !== "node_modules") { - const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state); - if (resolutionFromCache) { - return resolutionFromCache; - } - return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference)); - } - } - ); - } -} -function forEachAncestorDirectoryStoppingAtGlobalCache(host, directory, callback) { - var _a; - const globalCache = (_a = host == null ? void 0 : host.getGlobalTypingsCacheLocation) == null ? void 0 : _a.call(host); - return forEachAncestorDirectory(directory, (ancestorDirectory) => { - const result = callback(ancestorDirectory); - if (result !== void 0) return result; - if (ancestorDirectory === globalCache) return false; - }) || void 0; -} -function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) { - const nodeModulesFolder = combinePaths(directory, "node_modules"); - const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); - if (!nodeModulesFolderExists && state.traceEnabled) { - trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); - } - if (!typesScopeOnly) { - const packageResult = loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference); - if (packageResult) { - return packageResult; - } - } - if (extensions & 4 /* Declaration */) { - const nodeModulesAtTypes2 = combinePaths(nodeModulesFolder, "@types"); - let nodeModulesAtTypesExists = nodeModulesFolderExists; - if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes2, state.host)) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes2); - } - nodeModulesAtTypesExists = false; - } - return loadModuleFromSpecificNodeModulesDirectory(4 /* Declaration */, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes2, nodeModulesAtTypesExists, state, cache, redirectedReference); - } -} -function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) { - var _a, _b; - const candidate = normalizePath(combinePaths(nodeModulesDirectory, moduleName)); - const { packageName, rest } = parsePackageName(moduleName); - const packageDirectory = combinePaths(nodeModulesDirectory, packageName); - let rootPackageInfo; - let packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state); - if (rest !== "" && packageInfo && (!(state.features & 8 /* Exports */) || !hasProperty(((_a = rootPackageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state)) == null ? void 0 : _a.contents.packageJsonContent) ?? emptyArray, "exports"))) { - const fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state); - if (fromFile) { - return noPackageId(fromFile); - } - const fromDirectory = loadNodeModuleFromDirectoryWorker( - extensions, - candidate, - !nodeModulesDirectoryExists, - state, - packageInfo - ); - return withPackageId(packageInfo, fromDirectory, state); - } - const loader = (extensions2, candidate2, onlyRecordFailures, state2) => { - let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker( - extensions2, - candidate2, - onlyRecordFailures, - state2, - packageInfo - ); - if (!pathAndExtension && !rest && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) { - pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2); - } - return withPackageId(packageInfo, pathAndExtension, state2); - }; - 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; - } - const versionPaths = rest !== "" && packageInfo ? getVersionPathsOfPackageJsonInfo(packageInfo, state) : void 0; - if (versionPaths) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, rest); - } - const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host); - const pathPatterns = tryParsePatterns(versionPaths.paths); - const fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, versionPaths.paths, pathPatterns, loader, !packageDirectoryExists, state); - if (fromPaths) { - return fromPaths.value; - } - } - return loader(extensions, candidate, !nodeModulesDirectoryExists, state); -} -function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, onlyRecordFailures, state) { - const matchedPattern = matchPatternOrExact(pathPatterns, moduleName); - if (matchedPattern) { - const matchedStar = isString(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName); - const matchedPatternText = isString(matchedPattern) ? matchedPattern : patternText(matchedPattern); - if (state.traceEnabled) { - trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText); - } - const resolved = forEach(paths[matchedPatternText], (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); - } - const extension = tryGetExtensionFromPath2(subst); - if (extension !== void 0) { - const path2 = tryFile(candidate, onlyRecordFailures, state); - if (path2 !== void 0) { - return noPackageId({ path: path2, ext: extension, resolvedUsingTsExtension: void 0 }); - } - } - return loader(extensions, candidate, onlyRecordFailures || !directoryProbablyExists(getDirectoryPath(candidate), state.host), state); - }); - return { value: resolved }; - } -} -var mangledScopedPackageSeparator = "__"; -function mangleScopedPackageNameWithTrace(packageName, state) { - const mangled = mangleScopedPackageName(packageName); - if (state.traceEnabled && mangled !== packageName) { - trace(state.host, Diagnostics.Scoped_package_detected_looking_in_0, mangled); - } - return mangled; -} -function getTypesPackageName(packageName) { - return `@types/${mangleScopedPackageName(packageName)}`; -} -function mangleScopedPackageName(packageName) { - if (startsWith(packageName, "@")) { - const replaceSlash = packageName.replace(directorySeparator, mangledScopedPackageSeparator); - if (replaceSlash !== packageName) { - return replaceSlash.slice(1); - } - } - return packageName; -} -function getPackageNameFromTypesPackageName(mangledName) { - const withoutAtTypePrefix = removePrefix(mangledName, "@types/"); - if (withoutAtTypePrefix !== mangledName) { - return unmangleScopedPackageName(withoutAtTypePrefix); - } - return mangledName; -} -function unmangleScopedPackageName(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); - if (result) { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); - } - state.resultFromCache = result; - return { - value: result.resolvedModule && { - path: result.resolvedModule.resolvedFileName, - originalPath: result.resolvedModule.originalPath || true, - extension: result.resolvedModule.extension, - packageId: result.resolvedModule.packageId, - resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension - } - }; - } -} -function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) { - const traceEnabled = isTraceEnabled(compilerOptions, host); - const failedLookupLocations = []; - const affectingLocations = []; - const containingDirectory = getDirectoryPath(containingFile); - const diagnostics = []; - const state = { - compilerOptions, - host, - traceEnabled, - failedLookupLocations, - affectingLocations, - packageJsonInfoCache: cache, - features: 0 /* None */, - conditions: [], - requestContainingDirectory: containingDirectory, - reportDiagnostic: (diag2) => void diagnostics.push(diag2), - isConfigLookup: false, - candidateIsFromPackageJsonField: false, - resolvedPackageDirectory: false - }; - const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0)); - return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( - moduleName, - resolved && resolved.value, - (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path), - failedLookupLocations, - affectingLocations, - diagnostics, - state, - cache - ); - function tryResolve(extensions) { - const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); - if (resolvedUsingSettings) { - return { value: resolvedUsingSettings }; - } - if (!isExternalModuleNameRelative(moduleName)) { - const resolved2 = forEachAncestorDirectoryStoppingAtGlobalCache( - state.host, - containingDirectory, - (directory) => { - const resolutionFromCache = tryFindNonRelativeModuleNameInCache( - cache, - moduleName, - /*mode*/ - void 0, - directory, - redirectedReference, - state - ); - if (resolutionFromCache) { - return resolutionFromCache; - } - const searchName = normalizePath(combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFileNoPackageId( - extensions, - searchName, - /*onlyRecordFailures*/ - false, - state - )); - } - ); - if (resolved2) return resolved2; - if (extensions & (1 /* TypeScript */ | 4 /* Declaration */)) { - let resolved3 = loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state); - if (extensions & 4 /* Declaration */) resolved3 ?? (resolved3 = resolveFromTypeRoot(moduleName, state)); - return resolved3; - } - } else { - const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFileNoPackageId( - extensions, - candidate, - /*onlyRecordFailures*/ - false, - state - )); - } - } -} -function resolveFromTypeRoot(moduleName, state) { - if (!state.compilerOptions.typeRoots) return; - for (const typeRoot of state.compilerOptions.typeRoots) { - const candidate = getCandidateFromTypeRoot(typeRoot, moduleName, state); - const directoryExists = directoryProbablyExists(typeRoot, state.host); - if (!directoryExists && state.traceEnabled) { - trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot); - } - const resolvedFromFile = loadModuleFromFile(4 /* Declaration */, candidate, !directoryExists, state); - if (resolvedFromFile) { - const packageDirectory = parseNodeModuleFromPath(resolvedFromFile.path); - const packageInfo = packageDirectory ? getPackageJsonInfo( - packageDirectory, - /*onlyRecordFailures*/ - false, - state - ) : void 0; - return toSearchResult(withPackageId(packageInfo, resolvedFromFile, state)); - } - const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state); - if (resolved) return toSearchResult(resolved); - } -} -function shouldAllowImportingTsExtension(compilerOptions, fromFileName) { - return getAllowImportingTsExtensions(compilerOptions) || !!fromFileName && isDeclarationFileName(fromFileName); -} -function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) { - const traceEnabled = isTraceEnabled(compilerOptions, host); - if (traceEnabled) { - trace(host, Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache); - } - const failedLookupLocations = []; - const affectingLocations = []; - const diagnostics = []; - const state = { - compilerOptions, - host, - traceEnabled, - failedLookupLocations, - affectingLocations, - packageJsonInfoCache, - features: 0 /* None */, - conditions: [], - requestContainingDirectory: void 0, - reportDiagnostic: (diag2) => void diagnostics.push(diag2), - isConfigLookup: false, - candidateIsFromPackageJsonField: false, - resolvedPackageDirectory: false - }; - const resolved = loadModuleFromImmediateNodeModulesDirectory( - 4 /* Declaration */, - moduleName, - globalCache, - state, - /*typesScopeOnly*/ - false, - /*cache*/ - void 0, - /*redirectedReference*/ - void 0 - ); - return createResolvedModuleWithFailedLookupLocations( - resolved, - /*isExternalLibraryImport*/ - true, - failedLookupLocations, - affectingLocations, - diagnostics, - state.resultFromCache, - /*cache*/ - void 0 - ); -} -function toSearchResult(value) { - return value !== void 0 ? { value } : void 0; -} -function traceIfEnabled(state, diagnostic, ...args) { - if (state.traceEnabled) { - trace(state.host, diagnostic, ...args); - } -} -function useCaseSensitiveFileNames(state) { - return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames(); -} - -// src/compiler/binder.ts -var ModuleInstanceState = /* @__PURE__ */ ((ModuleInstanceState2) => { - ModuleInstanceState2[ModuleInstanceState2["NonInstantiated"] = 0] = "NonInstantiated"; - ModuleInstanceState2[ModuleInstanceState2["Instantiated"] = 1] = "Instantiated"; - ModuleInstanceState2[ModuleInstanceState2["ConstEnumOnly"] = 2] = "ConstEnumOnly"; - return ModuleInstanceState2; -})(ModuleInstanceState || {}); -function getModuleInstanceState(node, visited) { - if (node.body && !node.body.parent) { - setParent(node.body, node); - setParentRecursive( - node.body, - /*incremental*/ - false - ); - } - return node.body ? getModuleInstanceStateCached(node.body, visited) : 1 /* Instantiated */; -} -function getModuleInstanceStateCached(node, visited = /* @__PURE__ */ new Map()) { - const nodeId = getNodeId(node); - if (visited.has(nodeId)) { - return visited.get(nodeId) || 0 /* NonInstantiated */; - } - visited.set(nodeId, void 0); - const result = getModuleInstanceStateWorker(node, visited); - visited.set(nodeId, result); - return result; -} -function getModuleInstanceStateWorker(node, visited) { - switch (node.kind) { - // 1. interface declarations, type alias declarations - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - return 0 /* NonInstantiated */; - // 2. const enum declarations - case 267 /* EnumDeclaration */: - if (isEnumConst(node)) { - return 2 /* ConstEnumOnly */; - } - break; - // 3. non-exported import declarations - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - if (!hasSyntacticModifier(node, 32 /* Export */)) { - return 0 /* NonInstantiated */; - } - break; - // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 279 /* ExportDeclaration */: - const exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 280 /* NamedExports */) { - let state = 0 /* NonInstantiated */; - for (const specifier of exportDeclaration.exportClause.elements) { - const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited); - if (specifierState > state) { - state = specifierState; - } - if (state === 1 /* Instantiated */) { - return state; - } - } - return state; - } - break; - // 5. other uninstantiated module declarations. - case 269 /* ModuleBlock */: { - let state = 0 /* NonInstantiated */; - forEachChild(node, (n) => { - const childState = getModuleInstanceStateCached(n, visited); - switch (childState) { - case 0 /* NonInstantiated */: - return; - case 2 /* ConstEnumOnly */: - state = 2 /* ConstEnumOnly */; - return; - case 1 /* Instantiated */: - state = 1 /* Instantiated */; - return true; - default: - Debug.assertNever(childState); - } - }); - return state; - } - case 268 /* ModuleDeclaration */: - return getModuleInstanceState(node, visited); - case 80 /* Identifier */: - if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { - return 0 /* NonInstantiated */; - } - } - return 1 /* Instantiated */; -} -function getModuleInstanceStateForAliasTarget(specifier, visited) { - const name = specifier.propertyName || specifier.name; - if (name.kind !== 80 /* Identifier */) { - return 1 /* Instantiated */; - } - let p = specifier.parent; - while (p) { - if (isBlock(p) || isModuleBlock(p) || isSourceFile(p)) { - const statements = p.statements; - let found; - for (const statement of statements) { - if (nodeHasName(statement, name)) { - if (!statement.parent) { - setParent(statement, p); - setParentRecursive( - statement, - /*incremental*/ - false - ); - } - const state = getModuleInstanceStateCached(statement, visited); - if (found === void 0 || state > found) { - found = state; - } - if (found === 1 /* Instantiated */) { - return found; - } - if (statement.kind === 272 /* ImportEqualsDeclaration */) { - found = 1 /* Instantiated */; - } - } - } - if (found !== void 0) { - return found; - } - } - p = p.parent; - } - return 1 /* Instantiated */; -} -var 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 || {}); -function createFlowNode(flags, node, antecedent) { - return Debug.attachFlowNodeDebugInfo({ flags, id: 0, node, antecedent }); -} -var binder = /* @__PURE__ */ createBinder(); -function bindSourceFile(file, options) { - mark("beforeBind"); - binder(file, options); - mark("afterBind"); - measure("Bind", "beforeBind", "afterBind"); -} -function createBinder() { - var file; - var options; - var languageVersion; - var parent2; - var container; - var thisParentContainer; - var blockScopeContainer; - var lastContainer; - var delayedTypeAliases; - var seenThisKeyword; - var jsDocImports; - var currentFlow; - var currentBreakTarget; - var currentContinueTarget; - var currentReturnTarget; - var currentTrueTarget; - var currentFalseTarget; - var currentExceptionTarget; - var preSwitchCaseFlow; - var activeLabelList; - var hasExplicitReturn; - var inReturnPosition; - var hasFlowEffects; - var emitFlags; - var inStrictMode; - var inAssignmentPattern = false; - var symbolCount = 0; - var Symbol48; - var classifiableNames; - var unreachableFlow = createFlowNode( - 1 /* Unreachable */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - var reportedUnreachableFlow = createFlowNode( - 1 /* Unreachable */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); - return bindSourceFile2; - function createDiagnosticForNode2(node, message, ...args) { - return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, ...args); - } - function bindSourceFile2(f, opts) { - var _a, _b; - file = f; - options = opts; - languageVersion = getEmitScriptTarget(options); - inStrictMode = bindInStrictMode(file, opts); - classifiableNames = /* @__PURE__ */ new Set(); - symbolCount = 0; - Symbol48 = objectAllocator.getSymbolConstructor(); - Debug.attachFlowNodeDebugInfo(unreachableFlow); - Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow); - if (!file.locals) { - (_a = tracing) == null ? void 0 : _a.push( - tracing.Phase.Bind, - "bindSourceFile", - { path: file.path }, - /*separateBeginAndEnd*/ - true - ); - bind(file); - (_b = tracing) == null ? void 0 : _b.pop(); - file.symbolCount = symbolCount; - file.classifiableNames = classifiableNames; - delayedBindJSDocTypedefTag(); - bindJSDocImports(); - } - file = void 0; - options = void 0; - languageVersion = void 0; - parent2 = void 0; - container = void 0; - thisParentContainer = void 0; - blockScopeContainer = void 0; - lastContainer = void 0; - delayedTypeAliases = void 0; - jsDocImports = void 0; - seenThisKeyword = false; - currentFlow = void 0; - currentBreakTarget = void 0; - currentContinueTarget = void 0; - currentReturnTarget = void 0; - currentTrueTarget = void 0; - currentFalseTarget = void 0; - currentExceptionTarget = void 0; - activeLabelList = void 0; - hasExplicitReturn = false; - inReturnPosition = false; - hasFlowEffects = false; - inAssignmentPattern = false; - emitFlags = 0 /* None */; - } - function bindInStrictMode(file2, opts) { - if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { - return true; - } else { - return !!file2.externalModuleIndicator; - } - } - function createSymbol(flags, name) { - symbolCount++; - return new Symbol48(flags, name); - } - function addDeclarationToSymbol(symbol, node, symbolFlags) { - symbol.flags |= symbolFlags; - node.symbol = symbol; - symbol.declarations = appendIfUnique(symbol.declarations, node); - if (symbolFlags & (32 /* Class */ | 384 /* Enum */ | 1536 /* Module */ | 3 /* Variable */) && !symbol.exports) { - symbol.exports = createSymbolTable(); - } - if (symbolFlags & (32 /* Class */ | 64 /* Interface */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && !symbol.members) { - symbol.members = createSymbolTable(); - } - if (symbol.constEnumOnlyModule && symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { - symbol.constEnumOnlyModule = false; - } - if (symbolFlags & 111551 /* Value */) { - setValueDeclaration(symbol, node); - } - } - function getDeclarationName(node) { - if (node.kind === 278 /* ExportAssignment */) { - return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - } - const name = getNameOfDeclaration(node); - if (name) { - if (isAmbientModule(node)) { - const moduleName = getTextOfIdentifierOrLiteral(name); - return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`; - } - if (name.kind === 168 /* ComputedPropertyName */) { - const nameExpression = name.expression; - if (isStringOrNumericLiteralLike(nameExpression)) { - return escapeLeadingUnderscores(nameExpression.text); - } - if (isSignedNumericLiteral(nameExpression)) { - return tokenToString(nameExpression.operator) + nameExpression.operand.text; - } else { - Debug.fail("Only computed properties with literal names have declaration names"); - } - } - if (isPrivateIdentifier(name)) { - const containingClass = getContainingClass(node); - if (!containingClass) { - return void 0; - } - const containingClassSymbol = containingClass.symbol; - return getSymbolNameForPrivateIdentifier(containingClassSymbol, name.escapedText); - } - if (isJsxNamespacedName(name)) { - return getEscapedTextOfJsxNamespacedName(name); - } - return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0; - } - switch (node.kind) { - case 177 /* Constructor */: - return "__constructor" /* Constructor */; - case 185 /* FunctionType */: - case 180 /* CallSignature */: - case 324 /* JSDocSignature */: - return "__call" /* Call */; - case 186 /* ConstructorType */: - case 181 /* ConstructSignature */: - return "__new" /* New */; - case 182 /* IndexSignature */: - return "__index" /* Index */; - case 279 /* ExportDeclaration */: - return "__export" /* ExportStar */; - case 308 /* SourceFile */: - return "export=" /* ExportEquals */; - case 227 /* BinaryExpression */: - if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { - return "export=" /* ExportEquals */; - } - Debug.fail("Unknown binary declaration kind"); - break; - case 318 /* JSDocFunctionType */: - return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */; - case 170 /* Parameter */: - Debug.assert(node.parent.kind === 318 /* 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; - } - } - function getDisplayName(node) { - return isNamedDeclaration(node) ? declarationNameToString(node.name) : unescapeLeadingUnderscores(Debug.checkDefined(getDeclarationName(node))); - } - function declareSymbol(symbolTable, parent3, node, includes, excludes, isReplaceableByMethod, isComputedName) { - Debug.assert(isComputedName || !hasDynamicName(node)); - const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && moduleExportNameIsDefault(node.name); - const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent3 ? "default" /* Default */ : getDeclarationName(node); - let symbol; - if (name === void 0) { - symbol = createSymbol(0 /* None */, "__missing" /* Missing */); - } else { - symbol = symbolTable.get(name); - if (includes & 2885600 /* Classifiable */) { - classifiableNames.add(name); - } - if (!symbol) { - symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); - if (isReplaceableByMethod) symbol.isReplaceableByMethod = true; - } else if (isReplaceableByMethod && !symbol.isReplaceableByMethod) { - return symbol; - } else if (symbol.flags & excludes) { - if (symbol.isReplaceableByMethod) { - symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); - } else if (!(includes & 3 /* Variable */ && symbol.flags & 67108864 /* Assignment */)) { - if (isNamedDeclaration(node)) { - setParent(node.name, node); - } - let message = symbol.flags & 2 /* BlockScopedVariable */ ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; - let messageNeedsName = true; - if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) { - message = Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; - messageNeedsName = false; - } - let multipleDefaultExports = false; - if (length(symbol.declarations)) { - if (isDefaultExport) { - message = Diagnostics.A_module_cannot_have_multiple_default_exports; - messageNeedsName = false; - multipleDefaultExports = true; - } else { - if (symbol.declarations && symbol.declarations.length && (node.kind === 278 /* ExportAssignment */ && !node.isExportEquals)) { - message = Diagnostics.A_module_cannot_have_multiple_default_exports; - messageNeedsName = false; - multipleDefaultExports = true; - } - } - } - const relatedInformation = []; - 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; - forEach(symbol.declarations, (declaration, index) => { - const decl = getNameOfDeclaration(declaration) || declaration; - const diag3 = messageNeedsName ? createDiagnosticForNode2(decl, message, getDisplayName(declaration)) : createDiagnosticForNode2(decl, message); - file.bindDiagnostics.push( - multipleDefaultExports ? addRelatedInfo(diag3, createDiagnosticForNode2(declarationName, index === 0 ? Diagnostics.Another_export_default_is_here : Diagnostics.and_here)) : diag3 - ); - if (multipleDefaultExports) { - relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.The_first_export_default_is_here)); - } - }); - const diag2 = messageNeedsName ? createDiagnosticForNode2(declarationName, message, getDisplayName(node)) : createDiagnosticForNode2(declarationName, message); - file.bindDiagnostics.push(addRelatedInfo(diag2, ...relatedInformation)); - symbol = createSymbol(0 /* None */, name); - } - } - } - addDeclarationToSymbol(symbol, node, includes); - if (symbol.parent) { - Debug.assert(symbol.parent === parent3, "Existing symbol parent should match new one"); - } else { - symbol.parent = parent3; - } - return symbol; - } - function declareModuleMember(node, symbolFlags, symbolExcludes) { - const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node); - if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 282 /* ExportSpecifier */ || node.kind === 272 /* ImportEqualsDeclaration */ && hasExportModifier) { - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - } else { - Debug.assertNode(container, canHaveLocals); - return declareSymbol( - container.locals, - /*parent*/ - void 0, - node, - symbolFlags, - symbolExcludes - ); - } - } else { - if (isJSDocTypeAlias(node)) Debug.assert(isInJSFile(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; - const local = declareSymbol( - container.locals, - /*parent*/ - void 0, - node, - exportKind, - symbolExcludes - ); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - node.localSymbol = local; - return local; - } else { - Debug.assertNode(container, canHaveLocals); - return declareSymbol( - container.locals, - /*parent*/ - void 0, - node, - symbolFlags, - symbolExcludes - ); - } - } - } - function jsdocTreatAsExported(node) { - if (node.parent && isModuleDeclaration(node)) { - node = node.parent; - } - if (!isJSDocTypeAlias(node)) return false; - if (!isJSDocEnumTag(node) && !!node.fullName) return true; - const declName = getNameOfDeclaration(node); - if (!declName) return false; - if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) return true; - if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 32 /* Export */) return true; - return false; - } - function bindContainer(node, containerFlags) { - const saveContainer = container; - const saveThisParentContainer = thisParentContainer; - const savedBlockScopeContainer = blockScopeContainer; - const savedInReturnPosition = inReturnPosition; - if (node.kind === 220 /* ArrowFunction */ && node.body.kind !== 242 /* Block */) inReturnPosition = true; - if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 220 /* ArrowFunction */) { - thisParentContainer = container; - } - container = blockScopeContainer = node; - if (containerFlags & 32 /* HasLocals */) { - container.locals = createSymbolTable(); - addToContainerChain(container); - } - } else if (containerFlags & 2 /* IsBlockScopedContainer */) { - blockScopeContainer = node; - if (containerFlags & 32 /* HasLocals */) { - blockScopeContainer.locals = void 0; - } - } - if (containerFlags & 4 /* IsControlFlowContainer */) { - const saveCurrentFlow = currentFlow; - const saveBreakTarget = currentBreakTarget; - const saveContinueTarget = currentContinueTarget; - const saveReturnTarget = currentReturnTarget; - const saveExceptionTarget = currentExceptionTarget; - const saveActiveLabelList = activeLabelList; - const saveHasExplicitReturn = hasExplicitReturn; - const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */; - if (!isImmediatelyInvoked) { - currentFlow = createFlowNode( - 2 /* Start */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) { - currentFlow.node = node; - } - } - currentReturnTarget = isImmediatelyInvoked || node.kind === 177 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */) ? createBranchLabel() : void 0; - currentExceptionTarget = void 0; - currentBreakTarget = void 0; - currentContinueTarget = void 0; - activeLabelList = void 0; - hasExplicitReturn = false; - bindChildren(node); - node.flags &= ~5632 /* ReachabilityAndEmitFlags */; - if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) { - node.flags |= 512 /* HasImplicitReturn */; - if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */; - node.endFlowNode = currentFlow; - } - if (node.kind === 308 /* SourceFile */) { - node.flags |= emitFlags; - node.endFlowNode = currentFlow; - } - if (currentReturnTarget) { - addAntecedent(currentReturnTarget, currentFlow); - currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 177 /* Constructor */ || node.kind === 176 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */)) { - node.returnFlowNode = currentFlow; - } - } - if (!isImmediatelyInvoked) { - currentFlow = saveCurrentFlow; - } - currentBreakTarget = saveBreakTarget; - currentContinueTarget = saveContinueTarget; - currentReturnTarget = saveReturnTarget; - currentExceptionTarget = saveExceptionTarget; - activeLabelList = saveActiveLabelList; - hasExplicitReturn = saveHasExplicitReturn; - } else if (containerFlags & 64 /* IsInterface */) { - seenThisKeyword = false; - bindChildren(node); - Debug.assertNotNode(node, isIdentifier); - node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */; - } else { - bindChildren(node); - } - inReturnPosition = savedInReturnPosition; - container = saveContainer; - thisParentContainer = saveThisParentContainer; - blockScopeContainer = savedBlockScopeContainer; - } - function bindEachFunctionsFirst(nodes) { - bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0); - bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0); - } - function bindEach(nodes, bindFunction = bind) { - if (nodes === void 0) { - return; - } - forEach(nodes, bindFunction); - } - function bindEachChild(node) { - forEachChild(node, bind, bindEach); - } - function bindChildren(node) { - const saveInAssignmentPattern = inAssignmentPattern; - inAssignmentPattern = false; - if (checkUnreachable(node)) { - if (canHaveFlowNode(node) && node.flowNode) { - node.flowNode = void 0; - } - bindEachChild(node); - bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; - return; - } - if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && (!options.allowUnreachableCode || node.kind === 254 /* ReturnStatement */)) { - node.flowNode = currentFlow; - } - switch (node.kind) { - case 248 /* WhileStatement */: - bindWhileStatement(node); - break; - case 247 /* DoStatement */: - bindDoStatement(node); - break; - case 249 /* ForStatement */: - bindForStatement(node); - break; - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - bindForInOrForOfStatement(node); - break; - case 246 /* IfStatement */: - bindIfStatement(node); - break; - case 254 /* ReturnStatement */: - case 258 /* ThrowStatement */: - bindReturnOrThrow(node); - break; - case 253 /* BreakStatement */: - case 252 /* ContinueStatement */: - bindBreakOrContinueStatement(node); - break; - case 259 /* TryStatement */: - bindTryStatement(node); - break; - case 256 /* SwitchStatement */: - bindSwitchStatement(node); - break; - case 270 /* CaseBlock */: - bindCaseBlock(node); - break; - case 297 /* CaseClause */: - bindCaseClause(node); - break; - case 245 /* ExpressionStatement */: - bindExpressionStatement(node); - break; - case 257 /* LabeledStatement */: - bindLabeledStatement(node); - break; - case 225 /* PrefixUnaryExpression */: - bindPrefixUnaryExpressionFlow(node); - break; - case 226 /* PostfixUnaryExpression */: - bindPostfixUnaryExpressionFlow(node); - break; - case 227 /* BinaryExpression */: - if (isDestructuringAssignment(node)) { - inAssignmentPattern = saveInAssignmentPattern; - bindDestructuringAssignmentFlow(node); - return; - } - bindBinaryExpressionFlow(node); - break; - case 221 /* DeleteExpression */: - bindDeleteExpressionFlow(node); - break; - case 228 /* ConditionalExpression */: - bindConditionalExpressionFlow(node); - break; - case 261 /* VariableDeclaration */: - bindVariableDeclarationFlow(node); - break; - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - bindAccessExpressionFlow(node); - break; - case 214 /* CallExpression */: - bindCallExpressionFlow(node); - break; - case 236 /* NonNullExpression */: - bindNonNullExpressionFlow(node); - break; - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - bindJSDocTypeAlias(node); - break; - case 352 /* JSDocImportTag */: - bindJSDocImportTag(node); - break; - // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 308 /* SourceFile */: { - bindEachFunctionsFirst(node.statements); - bind(node.endOfFileToken); - break; - } - case 242 /* Block */: - case 269 /* ModuleBlock */: - bindEachFunctionsFirst(node.statements); - break; - case 209 /* BindingElement */: - bindBindingElementFlow(node); - break; - case 170 /* Parameter */: - bindParameterFlow(node); - break; - case 211 /* ObjectLiteralExpression */: - case 210 /* ArrayLiteralExpression */: - case 304 /* PropertyAssignment */: - case 231 /* SpreadElement */: - inAssignmentPattern = saveInAssignmentPattern; - // falls through - default: - bindEachChild(node); - break; - } - bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; - } - function isNarrowingExpression(expr) { - switch (expr.kind) { - case 80 /* Identifier */: - case 110 /* ThisKeyword */: - return true; - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return containsNarrowableReference(expr); - case 214 /* CallExpression */: - return hasNarrowableArgument(expr); - case 218 /* ParenthesizedExpression */: - if (isJSDocTypeAssertion(expr)) { - return false; - } - // fallthrough - case 236 /* NonNullExpression */: - return isNarrowingExpression(expr.expression); - case 227 /* BinaryExpression */: - return isNarrowingBinaryExpression(expr); - case 225 /* PrefixUnaryExpression */: - return expr.operator === 54 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 222 /* TypeOfExpression */: - return isNarrowingExpression(expr.expression); - } - return false; - } - function isNarrowableReference(expr) { - switch (expr.kind) { - case 80 /* Identifier */: - case 110 /* ThisKeyword */: - case 108 /* SuperKeyword */: - case 237 /* MetaProperty */: - return true; - case 212 /* PropertyAccessExpression */: - case 218 /* ParenthesizedExpression */: - case 236 /* NonNullExpression */: - return isNarrowableReference(expr.expression); - case 213 /* ElementAccessExpression */: - return (isStringOrNumericLiteralLike(expr.argumentExpression) || isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression); - case 227 /* BinaryExpression */: - return expr.operatorToken.kind === 28 /* CommaToken */ && isNarrowableReference(expr.right) || isAssignmentOperator(expr.operatorToken.kind) && isLeftHandSideExpression(expr.left); - } - return false; - } - function containsNarrowableReference(expr) { - return isNarrowableReference(expr) || isOptionalChain(expr) && containsNarrowableReference(expr.expression); - } - function hasNarrowableArgument(expr) { - if (expr.arguments) { - for (const argument of expr.arguments) { - if (containsNarrowableReference(argument)) { - return true; - } - } - } - if (expr.expression.kind === 212 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { - return true; - } - return false; - } - function isNarrowingTypeofOperands(expr1, expr2) { - return isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && isStringLiteralLike(expr2); - } - function isNarrowingBinaryExpression(expr) { - switch (expr.operatorToken.kind) { - case 64 /* EqualsToken */: - case 76 /* BarBarEqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return containsNarrowableReference(expr.left); - case 35 /* EqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - case 37 /* EqualsEqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - const left = skipParentheses(expr.left); - const right = skipParentheses(expr.right); - return isNarrowableOperand(left) || isNarrowableOperand(right) || isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right)); - case 104 /* InstanceOfKeyword */: - return isNarrowableOperand(expr.left); - case 103 /* InKeyword */: - return isNarrowingExpression(expr.right); - case 28 /* CommaToken */: - return isNarrowingExpression(expr.right); - } - return false; - } - function isNarrowableOperand(expr) { - switch (expr.kind) { - case 218 /* ParenthesizedExpression */: - return isNarrowableOperand(expr.expression); - case 227 /* BinaryExpression */: - switch (expr.operatorToken.kind) { - case 64 /* EqualsToken */: - return isNarrowableOperand(expr.left); - case 28 /* CommaToken */: - return isNarrowableOperand(expr.right); - } - } - return containsNarrowableReference(expr); - } - function createBranchLabel() { - return createFlowNode( - 4 /* BranchLabel */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - } - function createLoopLabel() { - return createFlowNode( - 8 /* LoopLabel */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - } - function createReduceLabel(target, antecedents, antecedent) { - return createFlowNode(1024 /* ReduceLabel */, { target, antecedents }, antecedent); - } - function setFlowNodeReferenced(flow) { - flow.flags |= flow.flags & 2048 /* Referenced */ ? 4096 /* Shared */ : 2048 /* Referenced */; - } - function addAntecedent(label, antecedent) { - if (!(antecedent.flags & 1 /* Unreachable */) && !contains(label.antecedent, antecedent)) { - (label.antecedent || (label.antecedent = [])).push(antecedent); - setFlowNodeReferenced(antecedent); - } - } - function createFlowCondition(flags, antecedent, expression) { - if (antecedent.flags & 1 /* Unreachable */) { - return antecedent; - } - if (!expression) { - return flags & 32 /* TrueCondition */ ? antecedent : unreachableFlow; - } - if ((expression.kind === 112 /* TrueKeyword */ && flags & 64 /* FalseCondition */ || expression.kind === 97 /* FalseKeyword */ && flags & 32 /* TrueCondition */) && !isExpressionOfOptionalChainRoot(expression) && !isNullishCoalesce(expression.parent)) { - return unreachableFlow; - } - if (!isNarrowingExpression(expression)) { - return antecedent; - } - setFlowNodeReferenced(antecedent); - return createFlowNode(flags, expression, antecedent); - } - function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { - setFlowNodeReferenced(antecedent); - return createFlowNode(128 /* SwitchClause */, { switchStatement, clauseStart, clauseEnd }, antecedent); - } - function createFlowMutation(flags, antecedent, node) { - setFlowNodeReferenced(antecedent); - hasFlowEffects = true; - const result = createFlowNode(flags, node, antecedent); - if (currentExceptionTarget) { - addAntecedent(currentExceptionTarget, result); - } - return result; - } - function createFlowCall(antecedent, node) { - setFlowNodeReferenced(antecedent); - hasFlowEffects = true; - return createFlowNode(512 /* Call */, node, antecedent); - } - function finishFlowLabel(flow) { - const antecedents = flow.antecedent; - if (!antecedents) { - return unreachableFlow; - } - if (antecedents.length === 1) { - return antecedents[0]; - } - return flow; - } - function isStatementCondition(node) { - const parent3 = node.parent; - switch (parent3.kind) { - case 246 /* IfStatement */: - case 248 /* WhileStatement */: - case 247 /* DoStatement */: - return parent3.expression === node; - case 249 /* ForStatement */: - case 228 /* ConditionalExpression */: - return parent3.condition === node; - } - return false; - } - function isLogicalExpression(node) { - while (true) { - if (node.kind === 218 /* ParenthesizedExpression */) { - node = node.expression; - } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 54 /* ExclamationToken */) { - node = node.operand; - } else { - return isLogicalOrCoalescingBinaryExpression(node); - } - } - } - function isLogicalAssignmentExpression(node) { - return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node)); - } - function isTopLevelLogicalExpression(node) { - while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 54 /* ExclamationToken */) { - node = node.parent; - } - return !isStatementCondition(node) && !isLogicalExpression(node.parent) && !(isOptionalChain(node.parent) && node.parent.expression === node); - } - function doWithConditionalBranches(action, value, trueTarget, falseTarget) { - const savedTrueTarget = currentTrueTarget; - const savedFalseTarget = currentFalseTarget; - currentTrueTarget = trueTarget; - currentFalseTarget = falseTarget; - action(value); - currentTrueTarget = savedTrueTarget; - currentFalseTarget = savedFalseTarget; - } - function bindCondition(node, trueTarget, falseTarget) { - doWithConditionalBranches(bind, node, trueTarget, falseTarget); - if (!node || !isLogicalAssignmentExpression(node) && !isLogicalExpression(node) && !(isOptionalChain(node) && isOutermostOptionalChain(node))) { - addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); - addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); - } - } - function bindIterativeStatement(node, breakTarget, continueTarget) { - const saveBreakTarget = currentBreakTarget; - const saveContinueTarget = currentContinueTarget; - currentBreakTarget = breakTarget; - currentContinueTarget = continueTarget; - bind(node); - currentBreakTarget = saveBreakTarget; - currentContinueTarget = saveContinueTarget; - } - function setContinueTarget(node, target) { - let label = activeLabelList; - while (label && node.parent.kind === 257 /* LabeledStatement */) { - label.continueTarget = target; - label = label.next; - node = node.parent; - } - return target; - } - function bindWhileStatement(node) { - const preWhileLabel = setContinueTarget(node, createLoopLabel()); - const preBodyLabel = createBranchLabel(); - const postWhileLabel = createBranchLabel(); - addAntecedent(preWhileLabel, currentFlow); - currentFlow = preWhileLabel; - bindCondition(node.expression, preBodyLabel, postWhileLabel); - currentFlow = finishFlowLabel(preBodyLabel); - bindIterativeStatement(node.statement, postWhileLabel, preWhileLabel); - addAntecedent(preWhileLabel, currentFlow); - currentFlow = finishFlowLabel(postWhileLabel); - } - function bindDoStatement(node) { - const preDoLabel = createLoopLabel(); - const preConditionLabel = setContinueTarget(node, createBranchLabel()); - const postDoLabel = createBranchLabel(); - addAntecedent(preDoLabel, currentFlow); - currentFlow = preDoLabel; - bindIterativeStatement(node.statement, postDoLabel, preConditionLabel); - addAntecedent(preConditionLabel, currentFlow); - currentFlow = finishFlowLabel(preConditionLabel); - bindCondition(node.expression, preDoLabel, postDoLabel); - currentFlow = finishFlowLabel(postDoLabel); - } - function bindForStatement(node) { - const preLoopLabel = setContinueTarget(node, createLoopLabel()); - const preBodyLabel = createBranchLabel(); - const preIncrementorLabel = createBranchLabel(); - const postLoopLabel = createBranchLabel(); - bind(node.initializer); - addAntecedent(preLoopLabel, currentFlow); - currentFlow = preLoopLabel; - bindCondition(node.condition, preBodyLabel, postLoopLabel); - currentFlow = finishFlowLabel(preBodyLabel); - bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel); - addAntecedent(preIncrementorLabel, currentFlow); - currentFlow = finishFlowLabel(preIncrementorLabel); - bind(node.incrementor); - addAntecedent(preLoopLabel, currentFlow); - currentFlow = finishFlowLabel(postLoopLabel); - } - function bindForInOrForOfStatement(node) { - const preLoopLabel = setContinueTarget(node, createLoopLabel()); - const postLoopLabel = createBranchLabel(); - bind(node.expression); - addAntecedent(preLoopLabel, currentFlow); - currentFlow = preLoopLabel; - if (node.kind === 251 /* ForOfStatement */) { - bind(node.awaitModifier); - } - addAntecedent(postLoopLabel, currentFlow); - bind(node.initializer); - if (node.initializer.kind !== 262 /* VariableDeclarationList */) { - bindAssignmentTargetFlow(node.initializer); - } - bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); - addAntecedent(preLoopLabel, currentFlow); - currentFlow = finishFlowLabel(postLoopLabel); - } - function bindIfStatement(node) { - const thenLabel = createBranchLabel(); - const elseLabel = createBranchLabel(); - const postIfLabel = createBranchLabel(); - bindCondition(node.expression, thenLabel, elseLabel); - currentFlow = finishFlowLabel(thenLabel); - bind(node.thenStatement); - addAntecedent(postIfLabel, currentFlow); - currentFlow = finishFlowLabel(elseLabel); - bind(node.elseStatement); - addAntecedent(postIfLabel, currentFlow); - currentFlow = finishFlowLabel(postIfLabel); - } - function bindReturnOrThrow(node) { - const savedInReturnPosition = inReturnPosition; - inReturnPosition = true; - bind(node.expression); - inReturnPosition = savedInReturnPosition; - if (node.kind === 254 /* ReturnStatement */) { - hasExplicitReturn = true; - if (currentReturnTarget) { - addAntecedent(currentReturnTarget, currentFlow); - } - } - currentFlow = unreachableFlow; - hasFlowEffects = true; - } - function findActiveLabel(name) { - for (let label = activeLabelList; label; label = label.next) { - if (label.name === name) { - return label; - } - } - return void 0; - } - function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget; - if (flowLabel) { - addAntecedent(flowLabel, currentFlow); - currentFlow = unreachableFlow; - hasFlowEffects = true; - } - } - function bindBreakOrContinueStatement(node) { - bind(node.label); - if (node.label) { - const activeLabel = findActiveLabel(node.label.escapedText); - if (activeLabel) { - activeLabel.referenced = true; - bindBreakOrContinueFlow(node, activeLabel.breakTarget, activeLabel.continueTarget); - } - } else { - bindBreakOrContinueFlow(node, currentBreakTarget, currentContinueTarget); - } - } - function bindTryStatement(node) { - const saveReturnTarget = currentReturnTarget; - const saveExceptionTarget = currentExceptionTarget; - const normalExitLabel = createBranchLabel(); - const returnLabel = createBranchLabel(); - let exceptionLabel = createBranchLabel(); - if (node.finallyBlock) { - currentReturnTarget = returnLabel; - } - addAntecedent(exceptionLabel, currentFlow); - currentExceptionTarget = exceptionLabel; - bind(node.tryBlock); - addAntecedent(normalExitLabel, currentFlow); - if (node.catchClause) { - currentFlow = finishFlowLabel(exceptionLabel); - exceptionLabel = createBranchLabel(); - addAntecedent(exceptionLabel, currentFlow); - currentExceptionTarget = exceptionLabel; - bind(node.catchClause); - addAntecedent(normalExitLabel, currentFlow); - } - currentReturnTarget = saveReturnTarget; - currentExceptionTarget = saveExceptionTarget; - if (node.finallyBlock) { - const finallyLabel = createBranchLabel(); - finallyLabel.antecedent = concatenate(concatenate(normalExitLabel.antecedent, exceptionLabel.antecedent), returnLabel.antecedent); - currentFlow = finallyLabel; - bind(node.finallyBlock); - if (currentFlow.flags & 1 /* Unreachable */) { - currentFlow = unreachableFlow; - } else { - if (currentReturnTarget && returnLabel.antecedent) { - addAntecedent(currentReturnTarget, createReduceLabel(finallyLabel, returnLabel.antecedent, currentFlow)); - } - if (currentExceptionTarget && exceptionLabel.antecedent) { - addAntecedent(currentExceptionTarget, createReduceLabel(finallyLabel, exceptionLabel.antecedent, currentFlow)); - } - currentFlow = normalExitLabel.antecedent ? createReduceLabel(finallyLabel, normalExitLabel.antecedent, currentFlow) : unreachableFlow; - } - } else { - currentFlow = finishFlowLabel(normalExitLabel); - } - } - function bindSwitchStatement(node) { - const postSwitchLabel = createBranchLabel(); - bind(node.expression); - const saveBreakTarget = currentBreakTarget; - const savePreSwitchCaseFlow = preSwitchCaseFlow; - currentBreakTarget = postSwitchLabel; - preSwitchCaseFlow = currentFlow; - bind(node.caseBlock); - addAntecedent(postSwitchLabel, currentFlow); - const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 298 /* DefaultClause */); - node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedent; - if (!hasDefault) { - addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); - } - currentBreakTarget = saveBreakTarget; - preSwitchCaseFlow = savePreSwitchCaseFlow; - currentFlow = finishFlowLabel(postSwitchLabel); - } - function bindCaseBlock(node) { - const clauses = node.clauses; - 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++; - } - const preCaseLabel = createBranchLabel(); - addAntecedent(preCaseLabel, isNarrowingSwitch ? createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1) : preSwitchCaseFlow); - addAntecedent(preCaseLabel, fallthroughFlow); - currentFlow = finishFlowLabel(preCaseLabel); - const clause = clauses[i]; - bind(clause); - fallthroughFlow = currentFlow; - if (!(currentFlow.flags & 1 /* Unreachable */) && i !== clauses.length - 1 && options.noFallthroughCasesInSwitch) { - clause.fallthroughFlowNode = currentFlow; - } - } - } - function bindCaseClause(node) { - const saveCurrentFlow = currentFlow; - currentFlow = preSwitchCaseFlow; - bind(node.expression); - currentFlow = saveCurrentFlow; - bindEach(node.statements); - } - function bindExpressionStatement(node) { - bind(node.expression); - maybeBindExpressionFlowIfCall(node.expression); - } - function maybeBindExpressionFlowIfCall(node) { - if (node.kind === 214 /* CallExpression */) { - const call = node; - if (call.expression.kind !== 108 /* SuperKeyword */ && isDottedName(call.expression)) { - currentFlow = createFlowCall(currentFlow, call); - } - } - } - function bindLabeledStatement(node) { - const postStatementLabel = createBranchLabel(); - activeLabelList = { - next: activeLabelList, - name: node.label.escapedText, - breakTarget: postStatementLabel, - continueTarget: void 0, - referenced: false - }; - bind(node.label); - bind(node.statement); - if (!activeLabelList.referenced && !options.allowUnusedLabels) { - errorOrSuggestionOnNode(unusedLabelIsError(options), node.label, Diagnostics.Unused_label); - } - activeLabelList = activeLabelList.next; - addAntecedent(postStatementLabel, currentFlow); - currentFlow = finishFlowLabel(postStatementLabel); - } - function bindDestructuringTargetFlow(node) { - if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */) { - bindAssignmentTargetFlow(node.left); - } else { - bindAssignmentTargetFlow(node); - } - } - function bindAssignmentTargetFlow(node) { - if (isNarrowableReference(node)) { - currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); - } else if (node.kind === 210 /* ArrayLiteralExpression */) { - for (const e of node.elements) { - if (e.kind === 231 /* SpreadElement */) { - bindAssignmentTargetFlow(e.expression); - } else { - bindDestructuringTargetFlow(e); - } - } - } else if (node.kind === 211 /* ObjectLiteralExpression */) { - for (const p of node.properties) { - if (p.kind === 304 /* PropertyAssignment */) { - bindDestructuringTargetFlow(p.initializer); - } else if (p.kind === 305 /* ShorthandPropertyAssignment */) { - bindAssignmentTargetFlow(p.name); - } else if (p.kind === 306 /* SpreadAssignment */) { - bindAssignmentTargetFlow(p.expression); - } - } - } - } - function bindLogicalLikeExpression(node, trueTarget, falseTarget) { - const preRightLabel = createBranchLabel(); - if (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 77 /* AmpersandAmpersandEqualsToken */) { - bindCondition(node.left, preRightLabel, falseTarget); - } else { - bindCondition(node.left, trueTarget, preRightLabel); - } - currentFlow = finishFlowLabel(preRightLabel); - bind(node.operatorToken); - if (isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind)) { - doWithConditionalBranches(bind, node.right, trueTarget, falseTarget); - bindAssignmentTargetFlow(node.left); - addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); - addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); - } else { - bindCondition(node.right, trueTarget, falseTarget); - } - } - function bindPrefixUnaryExpressionFlow(node) { - if (node.operator === 54 /* ExclamationToken */) { - const saveTrueTarget = currentTrueTarget; - currentTrueTarget = currentFalseTarget; - currentFalseTarget = saveTrueTarget; - bindEachChild(node); - currentFalseTarget = currentTrueTarget; - currentTrueTarget = saveTrueTarget; - } else { - bindEachChild(node); - if (node.operator === 46 /* PlusPlusToken */ || node.operator === 47 /* MinusMinusToken */) { - bindAssignmentTargetFlow(node.operand); - } - } - } - function bindPostfixUnaryExpressionFlow(node) { - bindEachChild(node); - if (node.operator === 46 /* PlusPlusToken */ || node.operator === 47 /* MinusMinusToken */) { - bindAssignmentTargetFlow(node.operand); - } - } - function bindDestructuringAssignmentFlow(node) { - if (inAssignmentPattern) { - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - inAssignmentPattern = true; - bind(node.left); - } else { - inAssignmentPattern = true; - bind(node.left); - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - } - bindAssignmentTargetFlow(node.left); - } - function createBindBinaryExpressionFlow() { - return createBinaryExpressionTrampoline( - onEnter, - onLeft, - onOperator, - onRight, - onExit, - /*foldState*/ - void 0 - ); - function onEnter(node, state) { - if (state) { - state.stackIndex++; - setParent(node, parent2); - const saveInStrictMode = inStrictMode; - bindWorker(node); - const saveParent = parent2; - parent2 = node; - state.skip = false; - state.inStrictModeStack[state.stackIndex] = saveInStrictMode; - state.parentStack[state.stackIndex] = saveParent; - } else { - state = { - stackIndex: 0, - skip: false, - inStrictModeStack: [void 0], - parentStack: [void 0] - }; - } - const operator = node.operatorToken.kind; - if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) { - if (isTopLevelLogicalExpression(node)) { - const postExpressionLabel = createBranchLabel(); - const saveCurrentFlow = currentFlow; - const saveHasFlowEffects = hasFlowEffects; - hasFlowEffects = false; - bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); - currentFlow = hasFlowEffects ? finishFlowLabel(postExpressionLabel) : saveCurrentFlow; - hasFlowEffects || (hasFlowEffects = saveHasFlowEffects); - } else { - bindLogicalLikeExpression(node, currentTrueTarget, currentFalseTarget); - } - state.skip = true; - } - return state; - } - function onLeft(left, state, node) { - if (!state.skip) { - const maybeBound = maybeBind2(left); - if (node.operatorToken.kind === 28 /* CommaToken */) { - maybeBindExpressionFlowIfCall(left); - } - return maybeBound; - } - } - function onOperator(operatorToken, state, _node) { - if (!state.skip) { - bind(operatorToken); - } - } - function onRight(right, state, node) { - if (!state.skip) { - const maybeBound = maybeBind2(right); - if (node.operatorToken.kind === 28 /* CommaToken */) { - maybeBindExpressionFlowIfCall(right); - } - return maybeBound; - } - } - function onExit(node, state) { - if (!state.skip) { - const operator = node.operatorToken.kind; - if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) { - bindAssignmentTargetFlow(node.left); - if (operator === 64 /* EqualsToken */ && node.left.kind === 213 /* ElementAccessExpression */) { - const elementAccess = node.left; - if (isNarrowableOperand(elementAccess.expression)) { - currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); - } - } - } - } - const savedInStrictMode = state.inStrictModeStack[state.stackIndex]; - const savedParent = state.parentStack[state.stackIndex]; - if (savedInStrictMode !== void 0) { - inStrictMode = savedInStrictMode; - } - if (savedParent !== void 0) { - parent2 = savedParent; - } - state.skip = false; - state.stackIndex--; - } - function maybeBind2(node) { - if (node && isBinaryExpression(node) && !isDestructuringAssignment(node)) { - return node; - } - bind(node); - } - } - function bindDeleteExpressionFlow(node) { - bindEachChild(node); - if (node.expression.kind === 212 /* PropertyAccessExpression */) { - bindAssignmentTargetFlow(node.expression); - } - } - function bindConditionalExpressionFlow(node) { - const trueLabel = createBranchLabel(); - const falseLabel = createBranchLabel(); - const postExpressionLabel = createBranchLabel(); - const saveCurrentFlow = currentFlow; - const saveHasFlowEffects = hasFlowEffects; - hasFlowEffects = false; - bindCondition(node.condition, trueLabel, falseLabel); - currentFlow = finishFlowLabel(trueLabel); - if (inReturnPosition) { - node.flowNodeWhenTrue = currentFlow; - } - bind(node.questionToken); - bind(node.whenTrue); - addAntecedent(postExpressionLabel, currentFlow); - currentFlow = finishFlowLabel(falseLabel); - if (inReturnPosition) { - node.flowNodeWhenFalse = currentFlow; - } - bind(node.colonToken); - bind(node.whenFalse); - addAntecedent(postExpressionLabel, currentFlow); - currentFlow = hasFlowEffects ? finishFlowLabel(postExpressionLabel) : saveCurrentFlow; - hasFlowEffects || (hasFlowEffects = saveHasFlowEffects); - } - function bindInitializedVariableFlow(node) { - const name = !isOmittedExpression(node) ? node.name : void 0; - if (isBindingPattern(name)) { - for (const child of name.elements) { - bindInitializedVariableFlow(child); - } - } else { - currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); - } - } - function bindVariableDeclarationFlow(node) { - bindEachChild(node); - if (node.initializer || isForInOrOfStatement(node.parent.parent)) { - bindInitializedVariableFlow(node); - } - } - function bindBindingElementFlow(node) { - bind(node.dotDotDotToken); - bind(node.propertyName); - bindInitializer(node.initializer); - bind(node.name); - } - function bindParameterFlow(node) { - bindEach(node.modifiers); - bind(node.dotDotDotToken); - bind(node.questionToken); - bind(node.type); - bindInitializer(node.initializer); - bind(node.name); - } - function bindInitializer(node) { - if (!node) { - return; - } - const entryFlow = currentFlow; - bind(node); - if (entryFlow === unreachableFlow || entryFlow === currentFlow) { - return; - } - const exitFlow = createBranchLabel(); - addAntecedent(exitFlow, entryFlow); - addAntecedent(exitFlow, currentFlow); - currentFlow = finishFlowLabel(exitFlow); - } - function bindJSDocTypeAlias(node) { - bind(node.tagName); - if (node.kind !== 341 /* JSDocEnumTag */ && node.fullName) { - setParent(node.fullName, node); - setParentRecursive( - node.fullName, - /*incremental*/ - false - ); - } - if (typeof node.comment !== "string") { - bindEach(node.comment); - } - } - function bindJSDocClassTag(node) { - bindEachChild(node); - const host = getHostSignatureFromJSDoc(node); - if (host && host.kind !== 175 /* MethodDeclaration */) { - addDeclarationToSymbol(host.symbol, host, 32 /* Class */); - } - } - function bindJSDocImportTag(node) { - bind(node.tagName); - bind(node.moduleSpecifier); - bind(node.attributes); - if (typeof node.comment !== "string") { - bindEach(node.comment); - } - } - function bindOptionalExpression(node, trueTarget, falseTarget) { - doWithConditionalBranches(bind, node, trueTarget, falseTarget); - if (!isOptionalChain(node) || isOutermostOptionalChain(node)) { - addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); - addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); - } - } - function bindOptionalChainRest(node) { - switch (node.kind) { - case 212 /* PropertyAccessExpression */: - bind(node.questionDotToken); - bind(node.name); - break; - case 213 /* ElementAccessExpression */: - bind(node.questionDotToken); - bind(node.argumentExpression); - break; - case 214 /* CallExpression */: - bind(node.questionDotToken); - bindEach(node.typeArguments); - bindEach(node.arguments); - break; - } - } - function bindOptionalChain(node, trueTarget, falseTarget) { - const preChainLabel = isOptionalChainRoot(node) ? createBranchLabel() : void 0; - bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); - if (preChainLabel) { - currentFlow = finishFlowLabel(preChainLabel); - } - doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget); - if (isOutermostOptionalChain(node)) { - addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); - addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); - } - } - function bindOptionalChainFlow(node) { - if (isTopLevelLogicalExpression(node)) { - const postExpressionLabel = createBranchLabel(); - const saveCurrentFlow = currentFlow; - const saveHasFlowEffects = hasFlowEffects; - bindOptionalChain(node, postExpressionLabel, postExpressionLabel); - currentFlow = hasFlowEffects ? finishFlowLabel(postExpressionLabel) : saveCurrentFlow; - hasFlowEffects || (hasFlowEffects = saveHasFlowEffects); - } else { - bindOptionalChain(node, currentTrueTarget, currentFalseTarget); - } - } - function bindNonNullExpressionFlow(node) { - if (isOptionalChain(node)) { - bindOptionalChainFlow(node); - } else { - bindEachChild(node); - } - } - function bindAccessExpressionFlow(node) { - if (isOptionalChain(node)) { - bindOptionalChainFlow(node); - } else { - bindEachChild(node); - } - } - function bindCallExpressionFlow(node) { - if (isOptionalChain(node)) { - bindOptionalChainFlow(node); - } else { - const expr = skipParentheses(node.expression); - if (expr.kind === 219 /* FunctionExpression */ || expr.kind === 220 /* ArrowFunction */) { - bindEach(node.typeArguments); - bindEach(node.arguments); - bind(node.expression); - } else { - bindEachChild(node); - if (node.expression.kind === 108 /* SuperKeyword */) { - currentFlow = createFlowCall(currentFlow, node); - } - } - } - if (node.expression.kind === 212 /* PropertyAccessExpression */) { - const propertyAccess = node.expression; - if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) { - currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); - } - } - } - function addToContainerChain(next) { - if (lastContainer) { - lastContainer.nextContainer = next; - } - lastContainer = next; - } - function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { - switch (container.kind) { - // Modules, source files, and classes need specialized handling for how their - // members are declared (for example, a member of a class will go into a specific - // symbol table depending on if it is static or not). We defer to specialized - // handlers to take care of declaring these child members. - case 268 /* ModuleDeclaration */: - return declareModuleMember(node, symbolFlags, symbolExcludes); - case 308 /* SourceFile */: - return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 232 /* ClassExpression */: - case 264 /* ClassDeclaration */: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 267 /* EnumDeclaration */: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 188 /* TypeLiteral */: - case 323 /* JSDocTypeLiteral */: - case 211 /* ObjectLiteralExpression */: - case 265 /* InterfaceDeclaration */: - case 293 /* JsxAttributes */: - return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 324 /* JSDocSignature */: - case 182 /* IndexSignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 318 /* JSDocFunctionType */: - case 176 /* ClassStaticBlockDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 201 /* MappedType */: - if (container.locals) Debug.assertNode(container, canHaveLocals); - return declareSymbol( - container.locals, - /*parent*/ - void 0, - node, - symbolFlags, - symbolExcludes - ); - } - } - function declareClassMember(node, symbolFlags, symbolExcludes) { - return isStatic(node) ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - } - function declareSourceFileMember(node, symbolFlags, symbolExcludes) { - return isExternalModule(file) ? declareModuleMember(node, symbolFlags, symbolExcludes) : declareSymbol( - file.locals, - /*parent*/ - void 0, - node, - symbolFlags, - symbolExcludes - ); - } - function hasExportDeclarations(node) { - const body = isSourceFile(node) ? node : tryCast(node.body, isModuleBlock); - return !!body && body.statements.some((s) => isExportDeclaration(s) || isExportAssignment(s)); - } - function setExportContextFlag(node) { - if (node.flags & 33554432 /* Ambient */ && !hasExportDeclarations(node)) { - node.flags |= 128 /* ExportContext */; - } else { - node.flags &= ~128 /* ExportContext */; - } - } - function bindModuleDeclaration(node) { - setExportContextFlag(node); - if (isAmbientModule(node)) { - 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)) { - declareModuleSymbol(node); - } else { - let pattern; - if (node.name.kind === 11 /* StringLiteral */) { - const { text } = node.name; - pattern = tryParsePattern(text); - if (pattern === void 0) { - errorOnFirstToken(node.name, Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text); - } - } - const symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 110735 /* ValueModuleExcludes */); - file.patternAmbientModules = append(file.patternAmbientModules, pattern && !isString(pattern) ? { pattern, symbol } : void 0); - } - } else { - const state = declareModuleSymbol(node); - if (state !== 0 /* NonInstantiated */) { - const { symbol } = node; - symbol.constEnumOnlyModule = !(symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) && state === 2 /* ConstEnumOnly */ && symbol.constEnumOnlyModule !== false; - } - } - } - function declareModuleSymbol(node) { - const state = getModuleInstanceState(node); - const instantiated = state !== 0 /* NonInstantiated */; - declareSymbolAndAddToSymbolTable( - node, - instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, - instantiated ? 110735 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */ - ); - return state; - } - function bindFunctionOrConstructorType(node) { - const symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072 /* Signature */); - const typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); - typeLiteralSymbol.members = createSymbolTable(); - typeLiteralSymbol.members.set(symbol.escapedName, symbol); - } - function bindObjectLiteralExpression(node) { - return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */); - } - function bindJsxAttributes(node) { - return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__jsxAttributes" /* JSXAttributes */); - } - function bindJsxAttribute(node, symbolFlags, symbolExcludes) { - return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); - } - function bindAnonymousDeclaration(node, symbolFlags, name) { - const symbol = createSymbol(symbolFlags, name); - if (symbolFlags & (8 /* EnumMember */ | 106500 /* ClassMember */)) { - symbol.parent = container.symbol; - } - addDeclarationToSymbol(symbol, node, symbolFlags); - return symbol; - } - function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { - switch (blockScopeContainer.kind) { - case 268 /* ModuleDeclaration */: - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - case 308 /* SourceFile */: - if (isExternalOrCommonJsModule(container)) { - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - } - // falls through - default: - Debug.assertNode(blockScopeContainer, canHaveLocals); - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = createSymbolTable(); - addToContainerChain(blockScopeContainer); - } - declareSymbol( - blockScopeContainer.locals, - /*parent*/ - void 0, - node, - symbolFlags, - symbolExcludes - ); - } - } - function delayedBindJSDocTypedefTag() { - if (!delayedTypeAliases) { - return; - } - const saveContainer = container; - const saveLastContainer = lastContainer; - const saveBlockScopeContainer = blockScopeContainer; - const saveParent = parent2; - const saveCurrentFlow = currentFlow; - for (const typeAlias of delayedTypeAliases) { - const host = typeAlias.parent.parent; - container = getEnclosingContainer(host) || file; - blockScopeContainer = getEnclosingBlockScopeContainer(host) || file; - currentFlow = createFlowNode( - 2 /* Start */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - parent2 = typeAlias; - bind(typeAlias.typeExpression); - const declName = getNameOfDeclaration(typeAlias); - if ((isJSDocEnumTag(typeAlias) || !typeAlias.fullName) && declName && isPropertyAccessEntityNameExpression(declName.parent)) { - const isTopLevel = isTopLevelNamespaceAssignment(declName.parent); - if (isTopLevel) { - bindPotentiallyMissingNamespaces( - file.symbol, - declName.parent, - isTopLevel, - !!findAncestor(declName, (d) => isPropertyAccessExpression(d) && d.name.escapedText === "prototype"), - /*containerIsClass*/ - false - ); - const oldContainer = container; - switch (getAssignmentDeclarationPropertyAccessKind(declName.parent)) { - case 1 /* ExportsProperty */: - case 2 /* ModuleExports */: - if (!isExternalOrCommonJsModule(file)) { - container = void 0; - } else { - container = file; - } - break; - case 4 /* ThisProperty */: - container = declName.parent.expression; - break; - case 3 /* PrototypeProperty */: - container = declName.parent.expression.name; - break; - case 5 /* Property */: - container = isExportsOrModuleExportsOrAlias(file, declName.parent.expression) ? file : isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression; - break; - case 0 /* None */: - return Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration"); - } - if (container) { - declareModuleMember(typeAlias, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - } - container = oldContainer; - } - } else if (isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === 80 /* Identifier */) { - parent2 = typeAlias.parent; - bindBlockScopedDeclaration(typeAlias, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - } else { - bind(typeAlias.fullName); - } - } - container = saveContainer; - lastContainer = saveLastContainer; - blockScopeContainer = saveBlockScopeContainer; - parent2 = saveParent; - currentFlow = saveCurrentFlow; - } - function bindJSDocImports() { - if (jsDocImports === void 0) { - return; - } - const saveContainer = container; - const saveLastContainer = lastContainer; - const saveBlockScopeContainer = blockScopeContainer; - const saveParent = parent2; - const saveCurrentFlow = currentFlow; - for (const jsDocImportTag of jsDocImports) { - const host = getJSDocHost(jsDocImportTag); - const enclosingContainer = host ? getEnclosingContainer(host) : void 0; - const enclosingBlockScopeContainer = host ? getEnclosingBlockScopeContainer(host) : void 0; - container = enclosingContainer || file; - blockScopeContainer = enclosingBlockScopeContainer || file; - currentFlow = createFlowNode( - 2 /* Start */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - parent2 = jsDocImportTag; - bind(jsDocImportTag.importClause); - } - container = saveContainer; - lastContainer = saveLastContainer; - blockScopeContainer = saveBlockScopeContainer; - parent2 = saveParent; - currentFlow = saveCurrentFlow; - } - function checkContextualIdentifier(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))); - } 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 & 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 & 16384 /* YieldContext */) { - file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node))); - } - } - } - function getStrictModeIdentifierMessage(node) { - if (getContainingClass(node)) { - return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; - } - return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; - } - function checkPrivateIdentifier(node) { - if (node.escapedText === "#constructor") { - if (!file.parseDiagnostics.length) { - file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.constructor_is_a_reserved_word, declarationNameToString(node))); - } - } - } - function checkStrictModeBinaryExpression(node) { - if (inStrictMode && isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operatorToken.kind)) { - checkStrictModeEvalOrArguments(node, node.left); - } - } - function checkStrictModeCatchClause(node) { - if (inStrictMode && node.variableDeclaration) { - checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); - } - } - function checkStrictModeDeleteExpression(node) { - if (inStrictMode && node.expression.kind === 80 /* Identifier */) { - const span = getErrorSpanForNode(file, node.expression); - file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); - } - } - function isEvalOrArgumentsIdentifier(node) { - return isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments"); - } - function checkStrictModeEvalOrArguments(contextNode, name) { - if (name && name.kind === 80 /* Identifier */) { - const identifier = name; - if (isEvalOrArgumentsIdentifier(identifier)) { - const span = getErrorSpanForNode(file, name); - file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), idText(identifier))); - } - } - } - function getStrictModeEvalOrArgumentsMessage(node) { - if (getContainingClass(node)) { - return Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode; - } - if (file.externalModuleIndicator) { - return Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; - } - return Diagnostics.Invalid_use_of_0_in_strict_mode; - } - function checkStrictModeFunctionName(node) { - if (inStrictMode && !(node.flags & 33554432 /* Ambient */)) { - checkStrictModeEvalOrArguments(node, node.name); - } - } - function getStrictModeBlockScopeFunctionDeclarationMessage(node) { - if (getContainingClass(node)) { - return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode; - } - return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5; - } - function checkStrictModeFunctionDeclaration(node) { - if (languageVersion < 2 /* ES2015 */) { - if (blockScopeContainer.kind !== 308 /* SourceFile */ && blockScopeContainer.kind !== 268 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { - const errorSpan = getErrorSpanForNode(file, node); - file.bindDiagnostics.push(createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); - } - } - } - function checkStrictModePostfixUnaryExpression(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - function checkStrictModePrefixUnaryExpression(node) { - if (inStrictMode) { - if (node.operator === 46 /* PlusPlusToken */ || node.operator === 47 /* MinusMinusToken */) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - } - function checkStrictModeWithStatement(node) { - if (inStrictMode) { - errorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - } - function checkStrictModeLabeledStatement(node) { - if (inStrictMode && getEmitScriptTarget(options) >= 2 /* ES2015 */) { - if (isDeclarationStatement(node.statement) || isVariableStatement(node.statement)) { - errorOnFirstToken(node.label, Diagnostics.A_label_is_not_allowed_here); - } - } - } - function errorOnFirstToken(node, message, ...args) { - const span = getSpanOfTokenAtPosition(file, node.pos); - file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, message, ...args)); - } - function errorOrSuggestionOnNode(isError, node, message) { - errorOrSuggestionOnRange(isError, node, node, message); - } - function errorOrSuggestionOnRange(isError, startNode2, endNode2, message) { - addErrorOrSuggestionDiagnostic(isError, { pos: getTokenPosOfNode(startNode2, file), end: endNode2.end }, message); - } - function addErrorOrSuggestionDiagnostic(isError, range, message) { - const diag2 = createFileDiagnostic(file, range.pos, range.end - range.pos, message); - if (isError) { - file.bindDiagnostics.push(diag2); - } else { - file.bindSuggestionDiagnostics = append(file.bindSuggestionDiagnostics, { ...diag2, category: 2 /* Suggestion */ }); - } - } - function bind(node) { - if (!node) { - return; - } - setParent(node, parent2); - if (tracing) node.tracingPath = file.path; - const saveInStrictMode = inStrictMode; - bindWorker(node); - if (node.kind > 166 /* LastToken */) { - const saveParent = parent2; - parent2 = node; - const containerFlags = getContainerFlags(node); - if (containerFlags === 0 /* None */) { - bindChildren(node); - } else { - bindContainer(node, containerFlags); - } - parent2 = saveParent; - } else { - const saveParent = parent2; - if (node.kind === 1 /* EndOfFileToken */) parent2 = node; - bindJSDoc(node); - parent2 = saveParent; - } - inStrictMode = saveInStrictMode; - } - function bindJSDoc(node) { - if (hasJSDocNodes(node)) { - if (isInJSFile(node)) { - for (const j of node.jsDoc) { - bind(j); - } - } else { - for (const j of node.jsDoc) { - setParent(j, node); - setParentRecursive( - j, - /*incremental*/ - false - ); - } - } - } - } - function updateStrictModeStatementList(statements) { - if (!inStrictMode) { - for (const statement of statements) { - if (!isPrologueDirective(statement)) { - return; - } - if (isUseStrictPrologueDirective(statement)) { - inStrictMode = true; - return; - } - } - } - } - function isUseStrictPrologueDirective(node) { - const nodeText2 = getSourceTextOfNodeFromSourceFile(file, node.expression); - return nodeText2 === '"use strict"' || nodeText2 === "'use strict'"; - } - function bindWorker(node) { - switch (node.kind) { - /* Strict mode checks */ - case 80 /* Identifier */: - if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { - let parentNode = node.parent; - while (parentNode && !isJSDocTypeAlias(parentNode)) { - parentNode = parentNode.parent; - } - bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - break; - } - // falls through - case 110 /* ThisKeyword */: - if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) { - node.flowNode = currentFlow; - } - return checkContextualIdentifier(node); - case 167 /* QualifiedName */: - if (currentFlow && isPartOfTypeQuery(node)) { - node.flowNode = currentFlow; - } - break; - case 237 /* MetaProperty */: - case 108 /* SuperKeyword */: - node.flowNode = currentFlow; - break; - case 81 /* PrivateIdentifier */: - return checkPrivateIdentifier(node); - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - const expr = node; - if (currentFlow && isNarrowableReference(expr)) { - expr.flowNode = currentFlow; - } - if (isSpecialPropertyDeclaration(expr)) { - bindSpecialPropertyDeclaration(expr); - } - if (isInJSFile(expr) && file.commonJsModuleIndicator && isModuleExportsAccessExpression(expr) && !lookupSymbolForName(blockScopeContainer, "module")) { - declareSymbol( - file.locals, - /*parent*/ - void 0, - expr.expression, - 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, - 111550 /* FunctionScopedVariableExcludes */ - ); - } - break; - case 227 /* BinaryExpression */: - const specialKind = getAssignmentDeclarationKind(node); - switch (specialKind) { - case 1 /* ExportsProperty */: - bindExportsPropertyAssignment(node); - break; - case 2 /* ModuleExports */: - bindModuleExportsAssignment(node); - break; - case 3 /* PrototypeProperty */: - bindPrototypePropertyAssignment(node.left, node); - break; - case 6 /* Prototype */: - bindPrototypeAssignment(node); - break; - case 4 /* ThisProperty */: - bindThisPropertyAssignment(node); - break; - case 5 /* Property */: - const expression = node.left.expression; - if (isInJSFile(node) && isIdentifier(expression)) { - const symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); - if (isThisInitializedDeclaration(symbol == null ? void 0 : symbol.valueDeclaration)) { - bindThisPropertyAssignment(node); - break; - } - } - bindSpecialPropertyAssignment(node); - break; - case 0 /* None */: - break; - default: - Debug.fail("Unknown binary expression special property assignment kind"); - } - return checkStrictModeBinaryExpression(node); - case 300 /* CatchClause */: - return checkStrictModeCatchClause(node); - case 221 /* DeleteExpression */: - return checkStrictModeDeleteExpression(node); - case 226 /* PostfixUnaryExpression */: - return checkStrictModePostfixUnaryExpression(node); - case 225 /* PrefixUnaryExpression */: - return checkStrictModePrefixUnaryExpression(node); - case 255 /* WithStatement */: - return checkStrictModeWithStatement(node); - case 257 /* LabeledStatement */: - return checkStrictModeLabeledStatement(node); - case 198 /* ThisType */: - seenThisKeyword = true; - return; - case 183 /* TypePredicate */: - break; - // Binding the children will handle everything - case 169 /* TypeParameter */: - return bindTypeParameter(node); - case 170 /* Parameter */: - return bindParameter(node); - case 261 /* VariableDeclaration */: - return bindVariableDeclarationOrBindingElement(node); - case 209 /* BindingElement */: - node.flowNode = currentFlow; - return bindVariableDeclarationOrBindingElement(node); - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - return bindPropertyWorker(node); - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 307 /* EnumMember */: - return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 182 /* IndexSignature */: - return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 263 /* FunctionDeclaration */: - return bindFunctionDeclaration(node); - case 177 /* Constructor */: - return declareSymbolAndAddToSymbolTable( - node, - 16384 /* Constructor */, - /*symbolExcludes:*/ - 0 /* None */ - ); - case 178 /* GetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 179 /* SetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 185 /* FunctionType */: - case 318 /* JSDocFunctionType */: - case 324 /* JSDocSignature */: - case 186 /* ConstructorType */: - return bindFunctionOrConstructorType(node); - case 188 /* TypeLiteral */: - case 323 /* JSDocTypeLiteral */: - case 201 /* MappedType */: - return bindAnonymousTypeWorker(node); - case 333 /* JSDocClassTag */: - return bindJSDocClassTag(node); - case 211 /* ObjectLiteralExpression */: - return bindObjectLiteralExpression(node); - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return bindFunctionExpression(node); - case 214 /* CallExpression */: - const assignmentKind = getAssignmentDeclarationKind(node); - switch (assignmentKind) { - case 7 /* ObjectDefinePropertyValue */: - return bindObjectDefinePropertyAssignment(node); - case 8 /* ObjectDefinePropertyExports */: - return bindObjectDefinePropertyExport(node); - case 9 /* ObjectDefinePrototypeProperty */: - return bindObjectDefinePrototypeProperty(node); - case 0 /* None */: - break; - // Nothing to do - default: - return Debug.fail("Unknown call expression assignment declaration kind"); - } - if (isInJSFile(node)) { - bindCallExpression(node); - } - break; - // Members of classes, interfaces, and modules - case 232 /* ClassExpression */: - case 264 /* ClassDeclaration */: - inStrictMode = true; - return bindClassLikeDeclaration(node); - case 265 /* InterfaceDeclaration */: - return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 266 /* TypeAliasDeclaration */: - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 267 /* EnumDeclaration */: - return bindEnumDeclaration(node); - case 268 /* ModuleDeclaration */: - return bindModuleDeclaration(node); - // Jsx-attributes - case 293 /* JsxAttributes */: - return bindJsxAttributes(node); - case 292 /* JsxAttribute */: - return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); - // Imports and exports - case 272 /* ImportEqualsDeclaration */: - case 275 /* NamespaceImport */: - case 277 /* ImportSpecifier */: - case 282 /* ExportSpecifier */: - return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 271 /* NamespaceExportDeclaration */: - return bindNamespaceExportDeclaration(node); - case 274 /* ImportClause */: - return bindImportClause(node); - case 279 /* ExportDeclaration */: - return bindExportDeclaration(node); - case 278 /* ExportAssignment */: - return bindExportAssignment(node); - case 308 /* SourceFile */: - updateStrictModeStatementList(node.statements); - return bindSourceFileIfExternalModule(); - case 242 /* Block */: - if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) { - return; - } - // falls through - case 269 /* ModuleBlock */: - return updateStrictModeStatementList(node.statements); - case 342 /* JSDocParameterTag */: - if (node.parent.kind === 324 /* JSDocSignature */) { - return bindParameter(node); - } - if (node.parent.kind !== 323 /* JSDocTypeLiteral */) { - break; - } - // falls through - case 349 /* JSDocPropertyTag */: - const propTag = node; - const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 317 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; - return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); - case 340 /* JSDocOverloadTag */: - return bind(node.typeExpression); - case 352 /* JSDocImportTag */: - return (jsDocImports || (jsDocImports = [])).push(node); - } - } - function bindPropertyWorker(node) { - const isAutoAccessor = isAutoAccessorPropertyDeclaration(node); - const includes = isAutoAccessor ? 98304 /* Accessor */ : 4 /* Property */; - const excludes = isAutoAccessor ? 13247 /* AccessorExcludes */ : 0 /* PropertyExcludes */; - return bindPropertyOrMethodOrAccessor(node, includes | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), excludes); - } - function bindAnonymousTypeWorker(node) { - return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type" /* Type */); - } - function bindSourceFileIfExternalModule() { - setExportContextFlag(file); - if (isExternalModule(file)) { - bindSourceFileAsExternalModule(); - } else if (isJsonSourceFile(file)) { - bindSourceFileAsExternalModule(); - const originalSymbol = file.symbol; - declareSymbol(file.symbol.exports, file.symbol, file, 4 /* Property */, -1 /* All */); - file.symbol = originalSymbol; - } - } - function bindSourceFileAsExternalModule() { - bindAnonymousDeclaration(file, 512 /* ValueModule */, `"${removeFileExtension(file.fileName)}"`); - } - function bindExportAssignment(node) { - if (!container.symbol || !container.symbol.exports) { - 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, -1 /* All */); - if (node.isExportEquals) { - setValueDeclaration(symbol, node); - } - } - } - function bindNamespaceExportDeclaration(node) { - if (some(node.modifiers)) { - file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Modifiers_cannot_appear_here)); - } - const diag2 = !isSourceFile(node.parent) ? Diagnostics.Global_module_exports_may_only_appear_at_top_level : !isExternalModule(node.parent) ? Diagnostics.Global_module_exports_may_only_appear_in_module_files : !node.parent.isDeclarationFile ? Diagnostics.Global_module_exports_may_only_appear_in_declaration_files : void 0; - if (diag2) { - file.bindDiagnostics.push(createDiagnosticForNode2(node, diag2)); - } else { - file.symbol.globalExports = file.symbol.globalExports || createSymbolTable(); - declareSymbol(file.symbol.globalExports, file.symbol, node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - } - function bindExportDeclaration(node) { - if (!container.symbol || !container.symbol.exports) { - bindAnonymousDeclaration(node, 8388608 /* ExportStar */, getDeclarationName(node)); - } else if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* ExportStar */, 0 /* None */); - } else if (isNamespaceExport(node.exportClause)) { - setParent(node.exportClause, node); - declareSymbol(container.symbol.exports, container.symbol, node.exportClause, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - } - function bindImportClause(node) { - if (node.name) { - declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - } - function setCommonJsModuleIndicator(node) { - if (file.externalModuleIndicator && file.externalModuleIndicator !== true) { - return false; - } - if (!file.commonJsModuleIndicator) { - file.commonJsModuleIndicator = node; - if (!file.externalModuleIndicator) { - bindSourceFileAsExternalModule(); - } - } - return true; - } - function bindObjectDefinePropertyExport(node) { - if (!setCommonJsModuleIndicator(node)) { - return; - } - const symbol = forEachIdentifierInEntityName( - node.arguments[0], - /*parent*/ - void 0, - (id, symbol2) => { - if (symbol2) { - addDeclarationToSymbol(symbol2, id, 1536 /* Module */ | 67108864 /* Assignment */); - } - return symbol2; - } - ); - if (symbol) { - const flags = 4 /* Property */ | 1048576 /* ExportValue */; - declareSymbol(symbol.exports, symbol, node, flags, 0 /* None */); - } - } - function bindExportsPropertyAssignment(node) { - if (!setCommonJsModuleIndicator(node)) { - return; - } - const symbol = forEachIdentifierInEntityName( - node.left.expression, - /*parent*/ - void 0, - (id, symbol2) => { - if (symbol2) { - addDeclarationToSymbol(symbol2, id, 1536 /* Module */ | 67108864 /* Assignment */); - } - return symbol2; - } - ); - if (symbol) { - const isAlias = isAliasableExpression(node.right) && (isExportsIdentifier(node.left.expression) || isModuleExportsAccessExpression(node.left.expression)); - const flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */; - setParent(node.left, node); - declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */); - } - } - function bindModuleExportsAssignment(node) { - if (!setCommonJsModuleIndicator(node)) { - return; - } - const assignedExpression = getRightMostAssignedExpression(node.right); - if (isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { - return; - } - if (isObjectLiteralExpression(assignedExpression) && every(assignedExpression.properties, isShorthandPropertyAssignment)) { - forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); - return; - } - const flags = exportAssignmentIsAlias(node) ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */ | 512 /* ValueModule */; - const symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */); - setValueDeclaration(symbol, node); - } - function bindExportAssignedObjectMemberAlias(node) { - declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */); - } - function bindThisPropertyAssignment(node) { - Debug.assert(isInJSFile(node)); - const hasPrivateIdentifier = isBinaryExpression(node) && isPropertyAccessExpression(node.left) && isPrivateIdentifier(node.left.name) || isPropertyAccessExpression(node) && isPrivateIdentifier(node.name); - if (hasPrivateIdentifier) { - return; - } - const thisContainer = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - switch (thisContainer.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - let constructorSymbol = thisContainer.symbol; - if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 64 /* EqualsToken */) { - const l = thisContainer.parent.left; - if (isBindableStaticAccessExpression(l) && isPrototypeAccess(l.expression)) { - constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer); - } - } - if (constructorSymbol && constructorSymbol.valueDeclaration) { - constructorSymbol.members = constructorSymbol.members || createSymbolTable(); - if (hasDynamicName(node)) { - bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol, constructorSymbol.members); - } else { - declareSymbol(constructorSymbol.members, constructorSymbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* PropertyExcludes */ & ~4 /* Property */); - } - addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); - } - break; - case 177 /* Constructor */: - case 173 /* PropertyDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 176 /* ClassStaticBlockDeclaration */: - const containingClass = thisContainer.parent; - const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members; - if (hasDynamicName(node)) { - bindDynamicallyNamedThisPropertyAssignment(node, containingClass.symbol, symbolTable); - } else { - declareSymbol( - symbolTable, - containingClass.symbol, - node, - 4 /* Property */ | 67108864 /* Assignment */, - 0 /* None */, - /*isReplaceableByMethod*/ - true - ); - } - break; - case 308 /* SourceFile */: - if (hasDynamicName(node)) { - break; - } else if (thisContainer.commonJsModuleIndicator) { - declareSymbol(thisContainer.symbol.exports, thisContainer.symbol, node, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); - } else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */); - } - break; - // Namespaces are not allowed in javascript files, so do nothing here - case 268 /* ModuleDeclaration */: - break; - default: - Debug.failBadSyntaxKind(thisContainer); - } - } - function bindDynamicallyNamedThisPropertyAssignment(node, symbol, symbolTable) { - declareSymbol( - symbolTable, - symbol, - node, - 4 /* Property */, - 0 /* None */, - /*isReplaceableByMethod*/ - true, - /*isComputedName*/ - true - ); - addLateBoundAssignmentDeclarationToSymbol(node, symbol); - } - function addLateBoundAssignmentDeclarationToSymbol(node, symbol) { - if (symbol) { - (symbol.assignmentDeclarationMembers || (symbol.assignmentDeclarationMembers = /* @__PURE__ */ new Map())).set(getNodeId(node), node); - } - } - function bindSpecialPropertyDeclaration(node) { - if (node.expression.kind === 110 /* ThisKeyword */) { - bindThisPropertyAssignment(node); - } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 308 /* SourceFile */) { - if (isPrototypeAccess(node.expression)) { - bindPrototypePropertyAssignment(node, node.parent); - } else { - bindStaticPropertyAssignment(node); - } - } - } - function bindPrototypeAssignment(node) { - setParent(node.left, node); - setParent(node.right, node); - bindPropertyAssignment( - node.left.expression, - node.left, - /*isPrototypeProperty*/ - false, - /*containerIsClass*/ - true - ); - } - function bindObjectDefinePrototypeProperty(node) { - const namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression); - if (namespaceSymbol && namespaceSymbol.valueDeclaration) { - addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */); - } - bindPotentiallyNewExpandoMemberToNamespace( - node, - namespaceSymbol, - /*isPrototypeProperty*/ - true - ); - } - function bindPrototypePropertyAssignment(lhs, parent3) { - const classPrototype = lhs.expression; - const constructorFunction = classPrototype.expression; - setParent(constructorFunction, classPrototype); - setParent(classPrototype, lhs); - setParent(lhs, parent3); - bindPropertyAssignment( - constructorFunction, - lhs, - /*isPrototypeProperty*/ - true, - /*containerIsClass*/ - true - ); - } - function bindObjectDefinePropertyAssignment(node) { - let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - const isToplevel = node.parent.parent.kind === 308 /* SourceFile */; - namespaceSymbol = bindPotentiallyMissingNamespaces( - namespaceSymbol, - node.arguments[0], - isToplevel, - /*isPrototypeProperty*/ - false, - /*containerIsClass*/ - false - ); - bindPotentiallyNewExpandoMemberToNamespace( - node, - namespaceSymbol, - /*isPrototypeProperty*/ - false - ); - } - function bindSpecialPropertyAssignment(node) { - var _a; - const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer) || lookupSymbolForPropertyAccess(node.left.expression, container); - if (!isInJSFile(node) && !isFunctionSymbol(parentSymbol)) { - return; - } - const rootExpr = getLeftmostAccessExpression(node.left); - if (isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) == null ? void 0 : _a.flags) & 2097152 /* Alias */) { - return; - } - setParent(node.left, node); - setParent(node.right, node); - if (isIdentifier(node.left.expression) && container === file && isExportsOrModuleExportsOrAlias(file, node.left.expression)) { - bindExportsPropertyAssignment(node); - } else if (hasDynamicName(node)) { - bindAnonymousDeclaration(node, 4 /* Property */ | 67108864 /* Assignment */, "__computed" /* Computed */); - const sym = bindPotentiallyMissingNamespaces( - parentSymbol, - node.left.expression, - isTopLevelNamespaceAssignment(node.left), - /*isPrototypeProperty*/ - false, - /*containerIsClass*/ - false - ); - addLateBoundAssignmentDeclarationToSymbol(node, sym); - } else { - bindStaticPropertyAssignment(cast(node.left, isBindableStaticNameExpression)); - } - } - function bindStaticPropertyAssignment(node) { - Debug.assert(!isIdentifier(node)); - setParent(node.expression, node); - bindPropertyAssignment( - node.expression, - node, - /*isPrototypeProperty*/ - false, - /*containerIsClass*/ - false - ); - } - function bindPotentiallyMissingNamespaces(namespaceSymbol, entityName, isToplevel, isPrototypeProperty, containerIsClass) { - if ((namespaceSymbol == null ? void 0 : namespaceSymbol.flags) & 2097152 /* Alias */) { - return namespaceSymbol; - } - if (isToplevel && !isPrototypeProperty) { - const flags = 1536 /* Module */ | 67108864 /* Assignment */; - const excludeFlags = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */; - namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, (id, symbol, parent3) => { - if (symbol) { - addDeclarationToSymbol(symbol, id, flags); - return symbol; - } else { - const table = parent3 ? parent3.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = createSymbolTable()); - return declareSymbol(table, parent3, id, flags, excludeFlags); - } - }); - } - if (containerIsClass && namespaceSymbol && namespaceSymbol.valueDeclaration) { - addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */); - } - return namespaceSymbol; - } - function bindPotentiallyNewExpandoMemberToNamespace(declaration, namespaceSymbol, isPrototypeProperty) { - if (!namespaceSymbol || !isExpandoSymbol(namespaceSymbol)) { - return; - } - const symbolTable = isPrototypeProperty ? namespaceSymbol.members || (namespaceSymbol.members = createSymbolTable()) : namespaceSymbol.exports || (namespaceSymbol.exports = createSymbolTable()); - let includes = 0 /* None */; - let excludes = 0 /* None */; - if (isFunctionLikeDeclaration(getAssignedExpandoInitializer(declaration))) { - includes = 8192 /* Method */; - excludes = 103359 /* MethodExcludes */; - } else if (isCallExpression(declaration) && isBindableObjectDefinePropertyCall(declaration)) { - if (some(declaration.arguments[2].properties, (p) => { - const id = getNameOfDeclaration(p); - return !!id && isIdentifier(id) && idText(id) === "set"; - })) { - includes |= 65536 /* SetAccessor */ | 4 /* Property */; - excludes |= 78783 /* SetAccessorExcludes */; - } - if (some(declaration.arguments[2].properties, (p) => { - const id = getNameOfDeclaration(p); - return !!id && isIdentifier(id) && idText(id) === "get"; - })) { - includes |= 32768 /* GetAccessor */ | 4 /* Property */; - excludes |= 46015 /* GetAccessorExcludes */; - } - } - if (includes === 0 /* None */) { - includes = 4 /* Property */; - excludes = 0 /* PropertyExcludes */; - } - declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */); - } - function isTopLevelNamespaceAssignment(propertyAccess) { - return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 308 /* SourceFile */ : propertyAccess.parent.parent.kind === 308 /* SourceFile */; - } - function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { - let namespaceSymbol = lookupSymbolForPropertyAccess(name, blockScopeContainer) || lookupSymbolForPropertyAccess(name, container); - const isToplevel = isTopLevelNamespaceAssignment(propertyAccess); - namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass); - bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty); - } - function isExpandoSymbol(symbol) { - if (symbol.flags & (16 /* Function */ | 32 /* Class */ | 1024 /* NamespaceModule */)) { - return true; - } - const node = symbol.valueDeclaration; - if (node && isCallExpression(node)) { - return !!getAssignedExpandoInitializer(node); - } - let init = !node ? void 0 : isVariableDeclaration(node) ? node.initializer : isBinaryExpression(node) ? node.right : isPropertyAccessExpression(node) && isBinaryExpression(node.parent) ? node.parent.right : void 0; - init = init && getRightMostAssignedExpression(init); - if (init) { - const isPrototypeAssignment = isPrototypeAccess(isVariableDeclaration(node) ? node.name : isBinaryExpression(node) ? node.left : node); - return !!getExpandoInitializer(isBinaryExpression(init) && (init.operatorToken.kind === 57 /* BarBarToken */ || init.operatorToken.kind === 61 /* QuestionQuestionToken */) ? init.right : init, isPrototypeAssignment); - } - return false; - } - function getParentOfBinaryExpression(expr) { - while (isBinaryExpression(expr.parent)) { - expr = expr.parent; - } - return expr.parent; - } - function lookupSymbolForPropertyAccess(node, lookupContainer = container) { - if (isIdentifier(node)) { - return lookupSymbolForName(lookupContainer, node.escapedText); - } else { - const symbol = lookupSymbolForPropertyAccess(node.expression); - return symbol && symbol.exports && symbol.exports.get(getElementOrPropertyAccessName(node)); - } - } - function forEachIdentifierInEntityName(e, parent3, action) { - if (isExportsOrModuleExportsOrAlias(file, e)) { - return file.symbol; - } else if (isIdentifier(e)) { - return action(e, lookupSymbolForPropertyAccess(e), parent3); - } else { - const s = forEachIdentifierInEntityName(e.expression, parent3, action); - const name = getNameOrArgument(e); - if (isPrivateIdentifier(name)) { - Debug.fail("unexpected PrivateIdentifier"); - } - return action(name, s && s.exports && s.exports.get(getElementOrPropertyAccessName(e)), s); - } - } - function bindCallExpression(node) { - if (!file.commonJsModuleIndicator && isRequireCall( - node, - /*requireStringLiteralLikeArgument*/ - false - )) { - setCommonJsModuleIndicator(node); - } - } - function bindClassLikeDeclaration(node) { - if (node.kind === 264 /* ClassDeclaration */) { - bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); - } else { - const bindingName = node.name ? node.name.escapedText : "__class" /* Class */; - bindAnonymousDeclaration(node, 32 /* Class */, bindingName); - if (node.name) { - classifiableNames.add(node.name.escapedText); - } - } - const { symbol } = node; - const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype"); - const symbolExport = symbol.exports.get(prototypeSymbol.escapedName); - if (symbolExport) { - if (node.name) { - setParent(node.name, node); - } - file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol))); - } - symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol); - prototypeSymbol.parent = symbol; - } - function bindEnumDeclaration(node) { - return isEnumConst(node) ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); - } - function bindVariableDeclarationOrBindingElement(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.name); - } - if (!isBindingPattern(node.name)) { - const possibleVariableDecl = node.kind === 261 /* 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 */); - } else if (isPartOfParameterDeclaration(node)) { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111551 /* ParameterExcludes */); - } else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */); - } - } - } - function bindParameter(node) { - if (node.kind === 342 /* JSDocParameterTag */ && container.kind !== 324 /* JSDocSignature */) { - return; - } - if (inStrictMode && !(node.flags & 33554432 /* Ambient */)) { - checkStrictModeEvalOrArguments(node, node.name); - } - if (isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + node.parent.parameters.indexOf(node)); - } else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111551 /* ParameterExcludes */); - } - if (isParameterPropertyDeclaration(node, node.parent)) { - const classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); - } - } - function bindFunctionDeclaration(node) { - if (!file.isDeclarationFile && !(node.flags & 33554432 /* Ambient */)) { - if (isAsyncFunction(node)) { - emitFlags |= 4096 /* HasAsyncFunctions */; - } - } - checkStrictModeFunctionName(node); - if (inStrictMode) { - checkStrictModeFunctionDeclaration(node); - bindBlockScopedDeclaration(node, 16 /* Function */, 110991 /* FunctionExcludes */); - } else { - declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 110991 /* FunctionExcludes */); - } - } - function bindFunctionExpression(node) { - if (!file.isDeclarationFile && !(node.flags & 33554432 /* Ambient */)) { - if (isAsyncFunction(node)) { - emitFlags |= 4096 /* HasAsyncFunctions */; - } - } - if (currentFlow) { - node.flowNode = currentFlow; - } - checkStrictModeFunctionName(node); - const bindingName = node.name ? node.name.escapedText : "__function" /* Function */; - return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); - } - function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { - if (!file.isDeclarationFile && !(node.flags & 33554432 /* Ambient */) && isAsyncFunction(node)) { - emitFlags |= 4096 /* HasAsyncFunctions */; - } - if (currentFlow && isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { - node.flowNode = currentFlow; - } - return hasDynamicName(node) ? bindAnonymousDeclaration(node, symbolFlags, "__computed" /* Computed */) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); - } - function getInferTypeContainer(node) { - const extendsType = findAncestor(node, (n) => n.parent && isConditionalTypeNode(n.parent) && n.parent.extendsType === n); - return extendsType && extendsType.parent; - } - function bindTypeParameter(node) { - if (isJSDocTemplateTag(node.parent)) { - const container2 = getEffectiveContainerForJSDocTemplateTag(node.parent); - if (container2) { - Debug.assertNode(container2, canHaveLocals); - container2.locals ?? (container2.locals = createSymbolTable()); - declareSymbol( - container2.locals, - /*parent*/ - void 0, - node, - 262144 /* TypeParameter */, - 526824 /* TypeParameterExcludes */ - ); - } else { - declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); - } - } else if (node.parent.kind === 196 /* InferType */) { - const container2 = getInferTypeContainer(node.parent); - if (container2) { - Debug.assertNode(container2, canHaveLocals); - container2.locals ?? (container2.locals = createSymbolTable()); - declareSymbol( - container2.locals, - /*parent*/ - void 0, - node, - 262144 /* TypeParameter */, - 526824 /* TypeParameterExcludes */ - ); - } else { - bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); - } - } else { - declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); - } - } - function shouldReportErrorOnModuleDeclaration(node) { - const instanceState = getModuleInstanceState(node); - return instanceState === 1 /* Instantiated */ || instanceState === 2 /* ConstEnumOnly */ && shouldPreserveConstEnums(options); - } - function checkUnreachable(node) { - if (!(currentFlow.flags & 1 /* Unreachable */)) { - return false; - } - if (currentFlow === unreachableFlow) { - const reportError = ( - // report error on all statements except empty ones - isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || // report error on class declarations - node.kind === 264 /* ClassDeclaration */ || // report errors on enums with preserved emit - isEnumDeclarationWithPreservedEmit(node, options) || // report error on instantiated modules - node.kind === 268 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node) - ); - if (reportError) { - currentFlow = reportedUnreachableFlow; - if (!options.allowUnreachableCode) { - const isError = unreachableCodeIsError(options) && !(node.flags & 33554432 /* Ambient */) && (!isVariableStatement(node) || !!(getCombinedNodeFlags(node.declarationList) & 7 /* BlockScoped */) || node.declarationList.declarations.some((d) => !!d.initializer)); - eachUnreachableRange(node, options, (start, end) => errorOrSuggestionOnRange(isError, start, end, Diagnostics.Unreachable_code_detected)); - } - } - } - return true; - } -} -function isEnumDeclarationWithPreservedEmit(node, options) { - return node.kind === 267 /* EnumDeclaration */ && (!isEnumConst(node) || shouldPreserveConstEnums(options)); -} -function eachUnreachableRange(node, options, cb) { - if (isStatement(node) && isExecutableStatement(node) && isBlock(node.parent)) { - const { statements } = node.parent; - const slice = sliceAfter(statements, node); - getRangesWhere(slice, isExecutableStatement, (start, afterEnd) => cb(slice[start], slice[afterEnd - 1])); - } else { - cb(node, node); - } - function isExecutableStatement(s) { - return !isFunctionDeclaration(s) && !isPurelyTypeDeclaration(s) && // `var x;` may declare a variable used above - !(isVariableStatement(s) && !(getCombinedNodeFlags(s) & 7 /* BlockScoped */) && s.declarationList.declarations.some((d) => !d.initializer)); - } - function isPurelyTypeDeclaration(s) { - switch (s.kind) { - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - return true; - case 268 /* ModuleDeclaration */: - return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 267 /* EnumDeclaration */: - return !isEnumDeclarationWithPreservedEmit(s, options); - default: - return false; - } - } -} -function isExportsOrModuleExportsOrAlias(sourceFile, node) { - let i = 0; - const q = createQueue(); - q.enqueue(node); - while (!q.isEmpty() && i < 100) { - i++; - node = q.dequeue(); - if (isExportsIdentifier(node) || isModuleExportsAccessExpression(node)) { - return true; - } else if (isIdentifier(node)) { - const symbol = lookupSymbolForName(sourceFile, node.escapedText); - if (!!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { - const init = symbol.valueDeclaration.initializer; - q.enqueue(init); - if (isAssignmentExpression( - init, - /*excludeCompoundAssignment*/ - true - )) { - q.enqueue(init.left); - q.enqueue(init.right); - } - } - } - } - return false; -} -function getContainerFlags(node) { - switch (node.kind) { - case 232 /* ClassExpression */: - case 264 /* ClassDeclaration */: - case 267 /* EnumDeclaration */: - case 211 /* ObjectLiteralExpression */: - case 188 /* TypeLiteral */: - case 323 /* JSDocTypeLiteral */: - case 293 /* JsxAttributes */: - return 1 /* IsContainer */; - case 265 /* InterfaceDeclaration */: - return 1 /* IsContainer */ | 64 /* IsInterface */; - case 268 /* ModuleDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 201 /* MappedType */: - case 182 /* IndexSignature */: - return 1 /* IsContainer */ | 32 /* HasLocals */; - case 308 /* SourceFile */: - return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { - return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */; - } - // falls through - case 177 /* Constructor */: - case 263 /* FunctionDeclaration */: - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 324 /* JSDocSignature */: - case 318 /* JSDocFunctionType */: - case 185 /* FunctionType */: - case 181 /* ConstructSignature */: - case 186 /* ConstructorType */: - case 176 /* ClassStaticBlockDeclaration */: - return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 352 /* JSDocImportTag */: - return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 269 /* ModuleBlock */: - return 4 /* IsControlFlowContainer */; - case 173 /* PropertyDeclaration */: - return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 300 /* CatchClause */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 270 /* CaseBlock */: - return 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; - case 242 /* Block */: - return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; - } - return 0 /* None */; -} -function lookupSymbolForName(container, name) { - var _a, _b, _c, _d; - const local = (_b = (_a = tryCast(container, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name); - if (local) { - return local.exportSymbol ?? local; - } - if (isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name)) { - return container.jsGlobalAugmentations.get(name); - } - if (canHaveSymbol(container)) { - return (_d = (_c = container.symbol) == null ? void 0 : _c.exports) == null ? void 0 : _d.get(name); - } -} - -// src/compiler/symbolWalker.ts -function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getConstraintOfTypeParameter, getFirstIdentifier2, getTypeArguments) { - return getSymbolWalker; - function getSymbolWalker(accept = () => true) { - const visitedTypes = []; - const visitedSymbols = []; - return { - walkType: (type) => { - try { - visitType(type); - return { visitedTypes: getOwnValues(visitedTypes), visitedSymbols: getOwnValues(visitedSymbols) }; - } finally { - clear(visitedTypes); - clear(visitedSymbols); - } - }, - walkSymbol: (symbol) => { - try { - visitSymbol(symbol); - return { visitedTypes: getOwnValues(visitedTypes), visitedSymbols: getOwnValues(visitedSymbols) }; - } finally { - clear(visitedTypes); - clear(visitedSymbols); - } - } - }; - function visitType(type) { - if (!type) { - return; - } - if (visitedTypes[type.id]) { - return; - } - visitedTypes[type.id] = type; - const shouldBail = visitSymbol(type.symbol); - if (shouldBail) return; - if (type.flags & 524288 /* Object */) { - const objectType = type; - const objectFlags = objectType.objectFlags; - if (objectFlags & 4 /* Reference */) { - visitTypeReference(type); - } - if (objectFlags & 32 /* Mapped */) { - visitMappedType(type); - } - if (objectFlags & (1 /* Class */ | 2 /* Interface */)) { - visitInterfaceType(type); - } - if (objectFlags & (8 /* Tuple */ | 16 /* Anonymous */)) { - visitObjectType(objectType); - } - } - if (type.flags & 262144 /* TypeParameter */) { - visitTypeParameter(type); - } - if (type.flags & 3145728 /* UnionOrIntersection */) { - visitUnionOrIntersectionType(type); - } - if (type.flags & 4194304 /* Index */) { - visitIndexType(type); - } - if (type.flags & 8388608 /* IndexedAccess */) { - visitIndexedAccessType(type); - } - } - function visitTypeReference(type) { - visitType(type.target); - forEach(getTypeArguments(type), visitType); - } - function visitTypeParameter(type) { - visitType(getConstraintOfTypeParameter(type)); - } - function visitUnionOrIntersectionType(type) { - forEach(type.types, visitType); - } - function visitIndexType(type) { - visitType(type.type); - } - function visitIndexedAccessType(type) { - visitType(type.objectType); - visitType(type.indexType); - visitType(type.constraint); - } - function visitMappedType(type) { - visitType(type.typeParameter); - visitType(type.constraintType); - visitType(type.templateType); - visitType(type.modifiersType); - } - function visitSignature(signature) { - const typePredicate = getTypePredicateOfSignature(signature); - if (typePredicate) { - visitType(typePredicate.type); - } - forEach(signature.typeParameters, visitType); - for (const parameter of signature.parameters) { - visitSymbol(parameter); - } - visitType(getRestTypeOfSignature(signature)); - visitType(getReturnTypeOfSignature(signature)); - } - function visitInterfaceType(interfaceT) { - visitObjectType(interfaceT); - forEach(interfaceT.typeParameters, visitType); - forEach(getBaseTypes(interfaceT), visitType); - visitType(interfaceT.thisType); - } - function visitObjectType(type) { - const resolved = resolveStructuredTypeMembers(type); - for (const info of resolved.indexInfos) { - visitType(info.keyType); - visitType(info.type); - } - for (const signature of resolved.callSignatures) { - visitSignature(signature); - } - for (const signature of resolved.constructSignatures) { - visitSignature(signature); - } - for (const p of resolved.properties) { - visitSymbol(p); - } - } - function visitSymbol(symbol) { - if (!symbol) { - return false; - } - const symbolId = getSymbolId(symbol); - if (visitedSymbols[symbolId]) { - return false; - } - visitedSymbols[symbolId] = symbol; - if (!accept(symbol)) { - return true; - } - const t = getTypeOfSymbol(symbol); - visitType(t); - if (symbol.exports) { - symbol.exports.forEach(visitSymbol); - } - forEach(symbol.declarations, (d) => { - if (d.type && d.type.kind === 187 /* TypeQuery */) { - const query = d.type; - const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName)); - visitSymbol(entity); - } - }); - return false; - } - } -} - -// src/compiler/_namespaces/ts.moduleSpecifiers.ts -var ts_moduleSpecifiers_exports = {}; -__export(ts_moduleSpecifiers_exports, { - RelativePreference: () => RelativePreference, - countPathComponents: () => countPathComponents, - forEachFileNameOfModule: () => forEachFileNameOfModule, - getLocalModuleSpecifierBetweenFileNames: () => getLocalModuleSpecifierBetweenFileNames, - getModuleSpecifier: () => getModuleSpecifier, - getModuleSpecifierPreferences: () => getModuleSpecifierPreferences, - getModuleSpecifiers: () => getModuleSpecifiers, - getModuleSpecifiersWithCacheInfo: () => getModuleSpecifiersWithCacheInfo, - getNodeModulesPackageName: () => getNodeModulesPackageName, - tryGetJSExtensionForFile: () => tryGetJSExtensionForFile, - tryGetModuleSpecifiersFromCache: () => tryGetModuleSpecifiersFromCache, - tryGetRealFileNameForNonJsDeclarationFileName: () => tryGetRealFileNameForNonJsDeclarationFileName, - updateModuleSpecifier: () => updateModuleSpecifier -}); - -// src/compiler/moduleSpecifiers.ts -var stringToRegex = memoizeOne((pattern) => { - try { - let slash = pattern.indexOf("/"); - if (slash !== 0) { - return new RegExp(pattern); - } - const lastSlash = pattern.lastIndexOf("/"); - if (slash === lastSlash) { - return new RegExp(pattern); - } - while ((slash = pattern.indexOf("/", slash + 1)) !== lastSlash) { - if (pattern[slash - 1] !== "\\") { - return new RegExp(pattern); - } - } - const flags = pattern.substring(lastSlash + 1).replace(/[^iu]/g, ""); - pattern = pattern.substring(1, lastSlash); - return new RegExp(pattern, flags); - } catch { - return void 0; - } -}); -var 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 || {}); -function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding, autoImportSpecifierExcludeRegexes }, host, compilerOptions, importingSourceFile, oldImportSpecifier) { - const filePreferredEnding = getPreferredEnding(); - return { - excludeRegexes: autoImportSpecifierExcludeRegexes, - 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 impliedNodeFormat = getDefaultResolutionModeForFile(importingSourceFile, host, compilerOptions); - const preferredEnding = syntaxImpliedNodeFormat !== impliedNodeFormat ? getPreferredEnding(syntaxImpliedNodeFormat) : filePreferredEnding; - const moduleResolution = getEmitModuleResolutionKind(compilerOptions); - if ((syntaxImpliedNodeFormat ?? impliedNodeFormat) === 99 /* ESNext */ && 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */) { - if (shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName)) { - return [3 /* TsExtension */, 2 /* JsExtension */]; - } - return [2 /* JsExtension */]; - } - if (getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */) { - return preferredEnding === 2 /* JsExtension */ ? [2 /* JsExtension */, 1 /* Index */] : [1 /* Index */, 2 /* JsExtension */]; - } - const allowImportingTsExtension = shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName); - switch (preferredEnding) { - case 2 /* JsExtension */: - return allowImportingTsExtension ? [2 /* JsExtension */, 3 /* TsExtension */, 0 /* Minimal */, 1 /* Index */] : [2 /* JsExtension */, 0 /* Minimal */, 1 /* Index */]; - case 3 /* TsExtension */: - return [3 /* TsExtension */, 0 /* Minimal */, 2 /* JsExtension */, 1 /* Index */]; - case 1 /* Index */: - return allowImportingTsExtension ? [1 /* Index */, 0 /* Minimal */, 3 /* TsExtension */, 2 /* JsExtension */] : [1 /* Index */, 0 /* Minimal */, 2 /* JsExtension */]; - case 0 /* Minimal */: - return allowImportingTsExtension ? [0 /* Minimal */, 1 /* Index */, 3 /* TsExtension */, 2 /* JsExtension */] : [0 /* Minimal */, 1 /* Index */, 2 /* JsExtension */]; - default: - Debug.assertNever(preferredEnding); - } - } - }; - function getPreferredEnding(resolutionMode) { - if (oldImportSpecifier !== void 0) { - if (hasJSFileExtension(oldImportSpecifier)) return 2 /* JsExtension */; - if (endsWith(oldImportSpecifier, "/index")) return 1 /* Index */; - } - return getModuleSpecifierEndingPreference( - importModuleSpecifierEnding, - resolutionMode ?? getDefaultResolutionModeForFile(importingSourceFile, host, compilerOptions), - compilerOptions, - isFullSourceFile(importingSourceFile) ? importingSourceFile : void 0 - ); - } -} -function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, oldImportSpecifier, options = {}) { - const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, host, 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, getModuleSpecifierPreferences({}, host, compilerOptions, importingSourceFile), {}, options); -} -function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) { - const info = getInfo(importingSourceFile.fileName, host); - const modulePaths = getAllModulePaths(info, nodeModulesFileName, host, preferences, compilerOptions, 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(info, toFileName2, host, userPreferences, compilerOptions, options); - return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule( - modulePath, - info, - importingSourceFile, - host, - compilerOptions, - userPreferences, - /*packageNameOnly*/ - void 0, - options.overrideImportMode - )) || getLocalModuleSpecifier(toFileName2, info, compilerOptions, host, options.overrideImportMode || getDefaultResolutionModeForFile(importingSourceFile, host, compilerOptions), preferences); -} -function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options = {}) { - const result = tryGetModuleSpecifiersFromCacheWorker( - moduleSymbol, - importingSourceFile, - host, - userPreferences, - options - ); - return result[1] && { kind: result[0], moduleSpecifiers: result[1], computedWithoutCache: false }; -} -function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options = {}) { - var _a; - const moduleSourceFile = getSourceFileOfModule(moduleSymbol); - if (!moduleSourceFile) { - return emptyArray; - } - const cache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host); - const cached = cache == null ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options); - return [cached == null ? void 0 : cached.kind, cached == null ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached == null ? void 0 : cached.modulePaths, cache]; -} -function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}) { - return getModuleSpecifiersWithCacheInfo( - moduleSymbol, - checker, - compilerOptions, - importingSourceFile, - host, - userPreferences, - options, - /*forAutoImport*/ - false - ).moduleSpecifiers; -} -function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) { - let computedWithoutCache = false; - const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker); - if (ambient) { - return { - kind: "ambient", - moduleSpecifiers: !(forAutoImport && isExcludedByRegex(ambient, userPreferences.autoImportSpecifierExcludeRegexes)) ? [ambient] : emptyArray, - computedWithoutCache - }; - } - let [kind, specifiers, moduleSourceFile, modulePaths, cache] = tryGetModuleSpecifiersFromCacheWorker( - moduleSymbol, - importingSourceFile, - host, - userPreferences, - options - ); - if (specifiers) return { kind, moduleSpecifiers: specifiers, computedWithoutCache }; - if (!moduleSourceFile) return { kind: void 0, moduleSpecifiers: emptyArray, computedWithoutCache }; - computedWithoutCache = true; - modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host, compilerOptions, options)); - const result = computeModuleSpecifiers( - modulePaths, - compilerOptions, - importingSourceFile, - host, - userPreferences, - options, - forAutoImport - ); - cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, result.kind, modulePaths, result.moduleSpecifiers); - return result; -} -function getLocalModuleSpecifierBetweenFileNames(importingFile, targetFileName, compilerOptions, host, preferences, options = {}) { - const info = getInfo(importingFile.fileName, host); - const importMode = options.overrideImportMode ?? importingFile.impliedNodeFormat; - return getLocalModuleSpecifier( - targetFileName, - info, - compilerOptions, - host, - importMode, - getModuleSpecifierPreferences(preferences, host, compilerOptions, importingFile) - ); -} -function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) { - const info = getInfo(importingSourceFile.fileName, host); - const preferences = getModuleSpecifierPreferences(userPreferences, host, compilerOptions, importingSourceFile); - const existingSpecifier = isFullSourceFile(importingSourceFile) && 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; - const existingMode = host.getModeForResolutionAtIndex(importingSourceFile, reason.index); - const targetMode = options.overrideImportMode ?? host.getDefaultResolutionModeForFile(importingSourceFile); - if (existingMode !== targetMode && existingMode !== void 0 && targetMode !== void 0) { - return void 0; - } - const specifier = getModuleNameStringLiteralAt(importingSourceFile, reason.index).text; - return preferences.relativePreference !== 1 /* NonRelative */ || !pathIsRelative(specifier) ? specifier : void 0; - } - )); - if (existingSpecifier) { - return { kind: void 0, moduleSpecifiers: [existingSpecifier], computedWithoutCache: true }; - } - const importedFileIsInNodeModules = some(modulePaths, (p) => p.isInNodeModules); - let nodeModulesSpecifiers; - let pathsSpecifiers; - let redirectPathsSpecifiers; - let relativeSpecifiers; - for (const modulePath of modulePaths) { - const specifier = modulePath.isInNodeModules ? tryGetModuleNameAsNodeModule( - modulePath, - info, - importingSourceFile, - host, - compilerOptions, - userPreferences, - /*packageNameOnly*/ - void 0, - options.overrideImportMode - ) : void 0; - if (specifier && !(forAutoImport && isExcludedByRegex(specifier, preferences.excludeRegexes))) { - nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier); - if (modulePath.isRedirect) { - return { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true }; - } - } - const local = getLocalModuleSpecifier( - modulePath.path, - info, - compilerOptions, - host, - options.overrideImportMode || importingSourceFile.impliedNodeFormat, - preferences, - /*pathsOnly*/ - modulePath.isRedirect || !!specifier - ); - if (!local || forAutoImport && isExcludedByRegex(local, preferences.excludeRegexes)) { - continue; - } - if (modulePath.isRedirect) { - redirectPathsSpecifiers = append(redirectPathsSpecifiers, local); - } else if (pathIsBareSpecifier(local)) { - if (pathContainsNodeModules(local)) { - relativeSpecifiers = append(relativeSpecifiers, local); - } else { - pathsSpecifiers = append(pathsSpecifiers, local); - } - } else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) { - relativeSpecifiers = append(relativeSpecifiers, local); - } - } - return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? { kind: "paths", moduleSpecifiers: pathsSpecifiers, computedWithoutCache: true } : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? { kind: "redirect", moduleSpecifiers: redirectPathsSpecifiers, computedWithoutCache: true } : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true } : { kind: "relative", moduleSpecifiers: relativeSpecifiers ?? emptyArray, computedWithoutCache: true }; -} -function isExcludedByRegex(moduleSpecifier, excludeRegexes) { - return some(excludeRegexes, (pattern) => { - var _a; - return !!((_a = stringToRegex(pattern)) == null ? void 0 : _a.test(moduleSpecifier)); - }); -} -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, - canonicalSourceDirectory: getCanonicalFileName(sourceDirectory) - }; -} -function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { getAllowedEndingsInPreferredOrder: getAllowedEndingsInPrefererredOrder, relativePreference, excludeRegexes }, pathsOnly) { - const { baseUrl, paths, rootDirs } = compilerOptions; - if (pathsOnly && !paths) { - return void 0; - } - 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 && !getResolvePackageJsonImports(compilerOptions) || relativePreference === 0 /* Relative */) { - return pathsOnly ? void 0 : relativePath; - } - const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory()); - const relativeToBaseUrl = getRelativePathIfInSameVolume(moduleFileName, baseDirectory, getCanonicalFileName); - if (!relativeToBaseUrl) { - return pathsOnly ? void 0 : relativePath; - } - const fromPackageJsonImports = pathsOnly ? void 0 : tryGetModuleNameFromPackageJsonImports( - moduleFileName, - sourceDirectory, - compilerOptions, - host, - importMode, - prefersTsExtension(allowedEndings) - ); - const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) : void 0; - if (pathsOnly) { - return fromPaths; - } - const maybeNonRelative = fromPackageJsonImports ?? (fromPaths === void 0 && baseUrl !== void 0 ? processEnding(relativeToBaseUrl, allowedEndings, compilerOptions) : fromPaths); - if (!maybeNonRelative) { - return relativePath; - } - const relativeIsExcluded = isExcludedByRegex(relativePath, excludeRegexes); - const nonRelativeIsExcluded = isExcludedByRegex(maybeNonRelative, excludeRegexes); - if (!relativeIsExcluded && nonRelativeIsExcluded) { - return relativePath; - } - if (relativeIsExcluded && !nonRelativeIsExcluded) { - return maybeNonRelative; - } - if (relativePreference === 1 /* NonRelative */ && !pathIsRelative(maybeNonRelative)) { - return maybeNonRelative; - } - 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(canonicalSourceDirectory, projectDirectory); - const targetIsInternal = startsWith(modulePath, projectDirectory); - if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) { - return maybeNonRelative; - } - const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath)); - const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory); - const ignoreCase = !hostUsesCaseSensitiveFileNames(host); - if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) { - return maybeNonRelative; - } - return relativePath; - } - return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative; -} -function packageJsonPathsAreEqual(a, b, ignoreCase) { - if (a === b) return true; - if (a === void 0 || b === void 0) return false; - return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */; -} -function countPathComponents(path) { - let count = 0; - for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) { - if (path.charCodeAt(i) === 47 /* slash */) count++; - } - return count; -} -function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) { - return compareBooleans(b.isRedirect, a.isRedirect) || compareNumberOfDirectorySeparators(a.path, b.path); -} -function getNearestAncestorDirectoryWithPackageJson(host, fileName) { - if (host.getNearestAncestorDirectoryWithPackageJson) { - return host.getNearestAncestorDirectoryWithPackageJson(fileName); - } - return forEachAncestorDirectoryStoppingAtGlobalCache( - host, - fileName, - (directory) => host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0 - ); -} -function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { - var _a, _b; - const getCanonicalFileName = hostGetCanonicalFileName(host); - const cwd = host.getCurrentDirectory(); - const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? (_a = host.getRedirectFromSourceFile(importedFileName)) == null ? void 0 : _a.outputDts : void 0; - const importedPath = toPath(importedFileName, cwd, getCanonicalFileName); - const redirects = host.redirectTargetsMap.get(importedPath) || emptyArray; - const importedFileNames = [...referenceRedirect ? [referenceRedirect] : emptyArray, importedFileName, ...redirects]; - const targets = importedFileNames.map((f) => getNormalizedAbsolutePath(f, cwd)); - let shouldFilterIgnoredPaths = !every(targets, containsIgnoredPath); - if (!preferSymlinks) { - const result2 = forEach(targets, (p) => !(shouldFilterIgnoredPaths && containsIgnoredPath(p)) && cb(p, referenceRedirect === p)); - if (result2) return result2; - } - const symlinkedDirectories = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host).getSymlinkedDirectoriesByRealpath(); - const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd); - const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache( - host, - getDirectoryPath(fullImportedFileName), - (realPathDirectory) => { - const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName))); - if (!symlinkDirectories) return void 0; - if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) { - return false; - } - return forEach(targets, (target) => { - if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) { - return; - } - const relative = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName); - for (const symlinkDirectory of symlinkDirectories) { - const option = resolvePath(symlinkDirectory, relative); - const result2 = cb(option, target === referenceRedirect); - shouldFilterIgnoredPaths = true; - if (result2) return result2; - } - }); - } - ); - return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0); -} -function getAllModulePaths(info, importedFileName, host, preferences, compilerOptions, 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) { - const cached = cache.get(importingFilePath, importedFilePath, preferences, options); - if (cached == null ? void 0 : cached.modulePaths) return cached.modulePaths; - } - const modulePaths = getAllModulePathsWorker(info, importedFileName, host, compilerOptions, options); - if (cache) { - cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths); - } - return modulePaths; -} -var runtimeDependencyFields = ["dependencies", "peerDependencies", "optionalDependencies"]; -function getAllRuntimeDependencies(packageJson) { - let result; - for (const field of runtimeDependencyFields) { - const deps = packageJson[field]; - if (deps && typeof deps === "object") { - result = concatenate(result, getOwnKeys(deps)); - } - } - return result; -} -function getAllModulePathsWorker(info, importedFileName, host, compilerOptions, options) { - var _a, _b; - const cache = (_a = host.getModuleResolutionCache) == null ? void 0 : _a.call(host); - const links = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host); - if (cache && links && host.readFile && !pathContainsNodeModules(info.importingSourceFileName)) { - Debug.type(host); - const state = getTemporaryModuleResolutionState(cache.getPackageJsonInfoCache(), host, {}); - const packageJson = getPackageScopeForPath(getDirectoryPath(info.importingSourceFileName), state); - if (packageJson) { - const toResolve = getAllRuntimeDependencies(packageJson.contents.packageJsonContent); - for (const depName of toResolve || emptyArray) { - const resolved = resolveModuleName( - depName, - combinePaths(packageJson.packageDirectory, "package.json"), - compilerOptions, - host, - cache, - /*redirectedReference*/ - void 0, - options.overrideImportMode - ); - links.setSymlinksFromResolution(resolved.resolvedModule); - } - } - } - const allFileNames = /* @__PURE__ */ new Map(); - let importedFileFromNodeModules = false; - forEachFileNameOfModule( - info.importingSourceFileName, - importedFileName, - host, - /*preferSymlinks*/ - true, - (path, isRedirect) => { - const isInNodeModules = pathContainsNodeModules(path); - allFileNames.set(path, { path: info.getCanonicalFileName(path), isRedirect, isInNodeModules }); - importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; - } - ); - const sortedPaths = []; - for (let directory = info.canonicalSourceDirectory; allFileNames.size !== 0; ) { - const directoryStart = ensureTrailingDirectorySeparator(directory); - let pathsInDirectory; - allFileNames.forEach(({ path, isRedirect, isInNodeModules }, fileName) => { - if (startsWith(path, directoryStart)) { - (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect, isInNodeModules }); - allFileNames.delete(fileName); - } - }); - if (pathsInDirectory) { - if (pathsInDirectory.length > 1) { - pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); - } - sortedPaths.push(...pathsInDirectory); - } - const newDirectory = getDirectoryPath(directory); - if (newDirectory === directory) break; - directory = newDirectory; - } - if (allFileNames.size) { - const remainingPaths = arrayFrom( - allFileNames.entries(), - ([fileName, { isRedirect, isInNodeModules }]) => ({ path: fileName, isRedirect, isInNodeModules }) - ); - if (remainingPaths.length > 1) remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); - sortedPaths.push(...remainingPaths); - } - return sortedPaths; -} -function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) { - var _a; - const decl = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find( - (d) => isNonGlobalAmbientModule(d) && (!isExternalModuleAugmentation(d) || !isExternalModuleNameRelative(getTextOfIdentifierOrLiteral(d.name))) - ); - 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 & 8 /* NestedNamespace */) { - namespaceDeclaration = namespaceDeclaration.parent; - } - return namespaceDeclaration; - } - }); - const ambientModuleDeclare = ambientModuleDeclareCandidates[0]; - if (ambientModuleDeclare) { - return ambientModuleDeclare.name.text; - } -} -function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) { - for (const key in paths) { - for (const patternText2 of paths[key]) { - const normalized = normalizePath(patternText2); - const pattern = getRelativePathIfInSameVolume(normalized, baseDirectory, getCanonicalFileName) ?? normalized; - const indexOfStar = pattern.indexOf("*"); - const candidates = allowedEndings.map((ending) => ({ - ending, - value: processEnding(relativeToBaseUrl, [ending], compilerOptions) - })); - if (tryGetExtensionFromPath2(pattern)) { - candidates.push({ ending: void 0, value: relativeToBaseUrl }); - } - if (indexOfStar !== -1) { - const prefix = pattern.substring(0, indexOfStar); - const suffix = pattern.substring(indexOfStar + 1); - 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); - 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))) { - return key; - } - } - } - function validateEnding({ ending, value }) { - return ending !== 0 /* Minimal */ || value === processEnding(relativeToBaseUrl, [ending], compilerOptions, host); - } -} -function tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, exports2, conditions, mode, isImports, preferTsExtension) { - if (typeof exports2 === "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, exports2), - /*currentDirectory*/ - void 0 - ); - const extensionSwappedTarget = hasTSFileExtension(targetFilePath) ? removeFileExtension(targetFilePath) + tryGetJSExtensionForFile(targetFilePath, options) : void 0; - const canTryTsExtension = preferTsExtension && hasImplementationTSFileExtension(targetFilePath); - switch (mode) { - case 0 /* Exact */: - 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 (canTryTsExtension && containsPath(targetFilePath, pathOrPattern, ignoreCase)) { - const fragment = getRelativePathFromDirectory( - pathOrPattern, - targetFilePath, - /*ignoreCase*/ - false - ); - return { moduleFileToTry: getNormalizedAbsolutePath( - combinePaths(combinePaths(packageName, exports2), fragment), - /*currentDirectory*/ - void 0 - ) }; - } - if (extensionSwappedTarget && containsPath(pathOrPattern, extensionSwappedTarget, ignoreCase)) { - const fragment = getRelativePathFromDirectory( - pathOrPattern, - extensionSwappedTarget, - /*ignoreCase*/ - false - ); - return { moduleFileToTry: getNormalizedAbsolutePath( - combinePaths(combinePaths(packageName, exports2), fragment), - /*currentDirectory*/ - void 0 - ) }; - } - if (!canTryTsExtension && containsPath(pathOrPattern, targetFilePath, ignoreCase)) { - const fragment = getRelativePathFromDirectory( - pathOrPattern, - targetFilePath, - /*ignoreCase*/ - false - ); - return { moduleFileToTry: getNormalizedAbsolutePath( - combinePaths(combinePaths(packageName, exports2), fragment), - /*currentDirectory*/ - 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 = changeFullExtension(getRelativePathFromDirectory( - pathOrPattern, - declarationFile, - /*ignoreCase*/ - false - ), getJSExtensionForFile(declarationFile, options)); - 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 (canTryTsExtension && startsWith(targetFilePath, leadingSlice, ignoreCase) && endsWith(targetFilePath, trailingSlice, ignoreCase)) { - const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length); - return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) }; - } - 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 (!canTryTsExtension && startsWith(targetFilePath, leadingSlice, ignoreCase) && endsWith(targetFilePath, trailingSlice, ignoreCase)) { - const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length); - return { moduleFileToTry: replaceFirstStar(packageName, 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); - const substituted = replaceFirstStar(packageName, starReplacement); - const jsExtension = tryGetJSExtensionForFile(declarationFile, options); - return jsExtension ? { moduleFileToTry: changeFullExtension(substituted, jsExtension) } : void 0; - } - break; - } - } else if (Array.isArray(exports2)) { - return forEach(exports2, (e) => tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, e, conditions, mode, isImports, preferTsExtension)); - } else if (typeof exports2 === "object" && exports2 !== null) { - for (const key of getOwnKeys(exports2)) { - if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) { - const subTarget = exports2[key]; - const result = tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode, isImports, preferTsExtension); - if (result) { - return result; - } - } - } - } - return void 0; -} -function tryGetModuleNameFromExports(options, host, targetFilePath, packageDirectory, packageName, exports2, conditions) { - if (typeof exports2 === "object" && exports2 !== null && !Array.isArray(exports2) && allKeysStartWithDot(exports2)) { - return forEach(getOwnKeys(exports2), (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, - exports2[k], - conditions, - mode, - /*isImports*/ - false, - /*preferTsExtension*/ - false - ); - }); - } - return tryGetModuleNameFromExportsOrImports( - options, - host, - targetFilePath, - packageDirectory, - packageName, - exports2, - conditions, - 0 /* Exact */, - /*isImports*/ - false, - /*preferTsExtension*/ - false - ); -} -function tryGetModuleNameFromPackageJsonImports(moduleFileName, sourceDirectory, options, host, importMode, preferTsExtension) { - 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, - preferTsExtension - ); - })) == null ? void 0 : _c.moduleFileToTry; -} -function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, allowedEndings, compilerOptions) { - const normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName); - if (normalizedTargetPaths === void 0) { - return void 0; - } - const normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName); - const relativePaths = flatMap(normalizedSourcePaths, (sourcePath) => { - return map(normalizedTargetPaths, (targetPath) => ensurePathIsNonModuleName(getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName))); - }); - const shortest = min(relativePaths, compareNumberOfDirectorySeparators); - if (!shortest) { - return void 0; - } - return processEnding(shortest, allowedEndings, compilerOptions); -} -function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) { - if (!host.fileExists || !host.readFile) { - return void 0; - } - const parts = getNodeModulePathParts(path); - if (!parts) { - return void 0; - } - const preferences = getModuleSpecifierPreferences(userPreferences, host, options, importingSourceFile); - const allowedEndings = preferences.getAllowedEndingsInPreferredOrder(); - let moduleSpecifier = path; - let isPackageRootPath = false; - if (!packageNameOnly) { - let packageRootIndex = parts.packageRootIndex; - let moduleFileName; - while (true) { - const { moduleFileToTry, packageRootPath, blockedByExports, verbatimFromExports } = tryDirectoryWithPackageJson(packageRootIndex); - if (getEmitModuleResolutionKind(options) !== 1 /* Classic */) { - if (blockedByExports) { - return void 0; - } - if (verbatimFromExports) { - return moduleFileToTry; - } - } - if (packageRootPath) { - moduleSpecifier = packageRootPath; - isPackageRootPath = true; - break; - } - if (!moduleFileName) moduleFileName = moduleFileToTry; - packageRootIndex = path.indexOf(directorySeparator, packageRootIndex + 1); - if (packageRootIndex === -1) { - moduleSpecifier = processEnding(moduleFileName, allowedEndings, options, host); - break; - } - } - } - if (isRedirect && !isPackageRootPath) { - return void 0; - } - const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); - const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex)); - if (!(startsWith(canonicalSourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) { - return void 0; - } - const nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1); - const packageName = getPackageNameFromTypesPackageName(nodeModulesDirectoryName); - return getEmitModuleResolutionKind(options) === 1 /* Classic */ && packageName === nodeModulesDirectoryName ? void 0 : packageName; - function tryDirectoryWithPackageJson(packageRootIndex) { - var _a, _b; - const packageRootPath = path.substring(0, packageRootIndex); - const packageJsonPath = combinePaths(packageRootPath, "package.json"); - 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 (isPackageJsonInfo(cachedPackageJson) || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) { - const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || tryParseJson(host.readFile(packageJsonPath)); - const importMode = overrideMode || getDefaultResolutionModeForFile(importingSourceFile, host, options); - if (getResolvePackageJsonExports(options)) { - const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1); - const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2); - 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) { - return { ...fromExports, verbatimFromExports: true }; - } - if (packageJsonContent == null ? void 0 : packageJsonContent.exports) { - return { moduleFileToTry: path, blockedByExports: true }; - } - } - 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( - subModuleName, - versionPaths.paths, - allowedEndings, - packageRootPath, - getCanonicalFileName, - host, - options - ); - if (fromPaths === void 0) { - maybeBlockedByTypesVersions = true; - } else { - moduleFileToTry = combinePaths(packageRootPath, fromPaths); - } - } - 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 == null ? void 0 : packageJsonContent.type) !== "module" && !fileExtensionIsOneOf(canonicalModuleFileToTry, extensionsNotSupportingExtensionlessResolution) && startsWith(canonicalModuleFileToTry, mainExportFile) && getDirectoryPath(canonicalModuleFileToTry) === removeTrailingDirectorySeparator(mainExportFile) && removeFileExtension(getBaseFileName(canonicalModuleFileToTry)) === "index") { - return { packageRootPath, moduleFileToTry }; - } - } - } else { - const fileName = getCanonicalFileName(moduleFileToTry.substring(parts.packageRootIndex + 1)); - if (fileName === "index.d.ts" || fileName === "index.js" || fileName === "index.ts" || fileName === "index.tsx") { - return { moduleFileToTry, packageRootPath }; - } - } - return { moduleFileToTry }; - } -} -function tryGetAnyFileFromPath(host, path) { - if (!host.fileExists) return; - const extensions = flatten(getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }])); - for (const e of extensions) { - const fullPath = path + e; - if (host.fileExists(fullPath)) { - return fullPath; - } - } -} -function getPathsRelativeToRootDirs(path, rootDirs, getCanonicalFileName) { - return mapDefined(rootDirs, (rootDir) => { - const relativePath = getRelativePathIfInSameVolume(path, rootDir, getCanonicalFileName); - return relativePath !== void 0 && isPathRelativeToParent(relativePath) ? void 0 : relativePath; - }); -} -function processEnding(fileName, allowedEndings, options, host) { - if (fileExtensionIsOneOf(fileName, [".json" /* Json */, ".mjs" /* Mjs */, ".cjs" /* Cjs */])) { - return fileName; - } - const noExtension = removeFileExtension(fileName); - if (fileName === noExtension) { - return fileName; - } - const jsPriority = allowedEndings.indexOf(2 /* JsExtension */); - const tsPriority = allowedEndings.indexOf(3 /* TsExtension */); - if (fileExtensionIsOneOf(fileName, [".mts" /* Mts */, ".cts" /* Cts */]) && tsPriority !== -1 && tsPriority < jsPriority) { - 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 */]) && fileName.includes(".d.")) { - return tryGetRealFileNameForNonJsDeclarationFileName(fileName); - } - switch (allowedEndings[0]) { - case 0 /* Minimal */: - const withoutIndex = removeSuffix(noExtension, "/index"); - if (host && withoutIndex !== noExtension && tryGetAnyFileFromPath(host, withoutIndex)) { - return noExtension; - } - return withoutIndex; - case 1 /* Index */: - return noExtension; - case 2 /* JsExtension */: - return noExtension + getJSExtensionForFile(fileName, options); - case 3 /* TsExtension */: - if (isDeclarationFileName(fileName)) { - const extensionlessPriority = allowedEndings.findIndex((e) => e === 0 /* Minimal */ || e === 1 /* Index */); - return extensionlessPriority !== -1 && extensionlessPriority < jsPriority ? noExtension : noExtension + getJSExtensionForFile(fileName, options); - } - return fileName; - default: - return Debug.assertNever(allowedEndings[0]); - } -} -function tryGetRealFileNameForNonJsDeclarationFileName(fileName) { - const baseName = getBaseFileName(fileName); - 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(".")); - return noExtension.substring(0, noExtension.indexOf(".d.")) + ext; -} -function getJSExtensionForFile(fileName, options) { - return tryGetJSExtensionForFile(fileName, options) ?? Debug.fail(`Extension ${extensionFromPath(fileName)} is unsupported:: FileName:: ${fileName}`); -} -function tryGetJSExtensionForFile(fileName, options) { - const ext = tryGetExtensionFromPath2(fileName); - switch (ext) { - case ".ts" /* Ts */: - case ".d.ts" /* Dts */: - return ".js" /* Js */; - case ".tsx" /* Tsx */: - return options.jsx === 1 /* Preserve */ ? ".jsx" /* Jsx */ : ".js" /* Js */; - case ".js" /* Js */: - case ".jsx" /* Jsx */: - case ".json" /* Json */: - return ext; - case ".d.mts" /* Dmts */: - case ".mts" /* Mts */: - case ".mjs" /* Mjs */: - return ".mjs" /* Mjs */; - case ".d.cts" /* Dcts */: - case ".cts" /* Cts */: - case ".cjs" /* Cjs */: - return ".cjs" /* Cjs */; - default: - return void 0; - } -} -function getRelativePathIfInSameVolume(path, directoryPath, getCanonicalFileName) { - const relativePath = getRelativePathToDirectoryOrUrl( - directoryPath, - path, - directoryPath, - getCanonicalFileName, - /*isAbsolutePathAnUrl*/ - false - ); - return isRootedDiskPath(relativePath) ? void 0 : relativePath; -} -function isPathRelativeToParent(path) { - return startsWith(path, ".."); -} -function getDefaultResolutionModeForFile(file, host, compilerOptions) { - return isFullSourceFile(file) ? host.getDefaultResolutionModeForFile(file) : getDefaultResolutionModeForFileWorker(file, compilerOptions); -} -function prefersTsExtension(allowedEndings) { - const tsPriority = allowedEndings.indexOf(3 /* TsExtension */); - return tsPriority > -1 && tsPriority < allowedEndings.indexOf(2 /* JsExtension */); -} - -// src/compiler/checker.ts -var ambientModuleSymbolRegex = /^".+"$/; -var anon = "(anonymous)"; -var nextSymbolId = 1; -var nextNodeId = 1; -var nextMergeId = 1; -var nextFlowId = 1; -var TypeFacts = /* @__PURE__ */ ((TypeFacts3) => { - TypeFacts3[TypeFacts3["None"] = 0] = "None"; - TypeFacts3[TypeFacts3["TypeofEQString"] = 1] = "TypeofEQString"; - TypeFacts3[TypeFacts3["TypeofEQNumber"] = 2] = "TypeofEQNumber"; - TypeFacts3[TypeFacts3["TypeofEQBigInt"] = 4] = "TypeofEQBigInt"; - TypeFacts3[TypeFacts3["TypeofEQBoolean"] = 8] = "TypeofEQBoolean"; - TypeFacts3[TypeFacts3["TypeofEQSymbol"] = 16] = "TypeofEQSymbol"; - TypeFacts3[TypeFacts3["TypeofEQObject"] = 32] = "TypeofEQObject"; - TypeFacts3[TypeFacts3["TypeofEQFunction"] = 64] = "TypeofEQFunction"; - TypeFacts3[TypeFacts3["TypeofEQHostObject"] = 128] = "TypeofEQHostObject"; - TypeFacts3[TypeFacts3["TypeofNEString"] = 256] = "TypeofNEString"; - TypeFacts3[TypeFacts3["TypeofNENumber"] = 512] = "TypeofNENumber"; - TypeFacts3[TypeFacts3["TypeofNEBigInt"] = 1024] = "TypeofNEBigInt"; - TypeFacts3[TypeFacts3["TypeofNEBoolean"] = 2048] = "TypeofNEBoolean"; - TypeFacts3[TypeFacts3["TypeofNESymbol"] = 4096] = "TypeofNESymbol"; - TypeFacts3[TypeFacts3["TypeofNEObject"] = 8192] = "TypeofNEObject"; - TypeFacts3[TypeFacts3["TypeofNEFunction"] = 16384] = "TypeofNEFunction"; - TypeFacts3[TypeFacts3["TypeofNEHostObject"] = 32768] = "TypeofNEHostObject"; - TypeFacts3[TypeFacts3["EQUndefined"] = 65536] = "EQUndefined"; - TypeFacts3[TypeFacts3["EQNull"] = 131072] = "EQNull"; - TypeFacts3[TypeFacts3["EQUndefinedOrNull"] = 262144] = "EQUndefinedOrNull"; - TypeFacts3[TypeFacts3["NEUndefined"] = 524288] = "NEUndefined"; - TypeFacts3[TypeFacts3["NENull"] = 1048576] = "NENull"; - TypeFacts3[TypeFacts3["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull"; - TypeFacts3[TypeFacts3["Truthy"] = 4194304] = "Truthy"; - TypeFacts3[TypeFacts3["Falsy"] = 8388608] = "Falsy"; - TypeFacts3[TypeFacts3["IsUndefined"] = 16777216] = "IsUndefined"; - TypeFacts3[TypeFacts3["IsNull"] = 33554432] = "IsNull"; - TypeFacts3[TypeFacts3["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull"; - TypeFacts3[TypeFacts3["All"] = 134217727] = "All"; - TypeFacts3[TypeFacts3["BaseStringStrictFacts"] = 3735041] = "BaseStringStrictFacts"; - TypeFacts3[TypeFacts3["BaseStringFacts"] = 12582401] = "BaseStringFacts"; - TypeFacts3[TypeFacts3["StringStrictFacts"] = 16317953] = "StringStrictFacts"; - TypeFacts3[TypeFacts3["StringFacts"] = 16776705] = "StringFacts"; - TypeFacts3[TypeFacts3["EmptyStringStrictFacts"] = 12123649] = "EmptyStringStrictFacts"; - TypeFacts3[TypeFacts3["EmptyStringFacts"] = 12582401 /* BaseStringFacts */] = "EmptyStringFacts"; - TypeFacts3[TypeFacts3["NonEmptyStringStrictFacts"] = 7929345] = "NonEmptyStringStrictFacts"; - TypeFacts3[TypeFacts3["NonEmptyStringFacts"] = 16776705] = "NonEmptyStringFacts"; - TypeFacts3[TypeFacts3["BaseNumberStrictFacts"] = 3734786] = "BaseNumberStrictFacts"; - TypeFacts3[TypeFacts3["BaseNumberFacts"] = 12582146] = "BaseNumberFacts"; - TypeFacts3[TypeFacts3["NumberStrictFacts"] = 16317698] = "NumberStrictFacts"; - TypeFacts3[TypeFacts3["NumberFacts"] = 16776450] = "NumberFacts"; - TypeFacts3[TypeFacts3["ZeroNumberStrictFacts"] = 12123394] = "ZeroNumberStrictFacts"; - TypeFacts3[TypeFacts3["ZeroNumberFacts"] = 12582146 /* BaseNumberFacts */] = "ZeroNumberFacts"; - TypeFacts3[TypeFacts3["NonZeroNumberStrictFacts"] = 7929090] = "NonZeroNumberStrictFacts"; - TypeFacts3[TypeFacts3["NonZeroNumberFacts"] = 16776450] = "NonZeroNumberFacts"; - TypeFacts3[TypeFacts3["BaseBigIntStrictFacts"] = 3734276] = "BaseBigIntStrictFacts"; - TypeFacts3[TypeFacts3["BaseBigIntFacts"] = 12581636] = "BaseBigIntFacts"; - TypeFacts3[TypeFacts3["BigIntStrictFacts"] = 16317188] = "BigIntStrictFacts"; - TypeFacts3[TypeFacts3["BigIntFacts"] = 16775940] = "BigIntFacts"; - TypeFacts3[TypeFacts3["ZeroBigIntStrictFacts"] = 12122884] = "ZeroBigIntStrictFacts"; - TypeFacts3[TypeFacts3["ZeroBigIntFacts"] = 12581636 /* BaseBigIntFacts */] = "ZeroBigIntFacts"; - TypeFacts3[TypeFacts3["NonZeroBigIntStrictFacts"] = 7928580] = "NonZeroBigIntStrictFacts"; - TypeFacts3[TypeFacts3["NonZeroBigIntFacts"] = 16775940] = "NonZeroBigIntFacts"; - TypeFacts3[TypeFacts3["BaseBooleanStrictFacts"] = 3733256] = "BaseBooleanStrictFacts"; - TypeFacts3[TypeFacts3["BaseBooleanFacts"] = 12580616] = "BaseBooleanFacts"; - TypeFacts3[TypeFacts3["BooleanStrictFacts"] = 16316168] = "BooleanStrictFacts"; - TypeFacts3[TypeFacts3["BooleanFacts"] = 16774920] = "BooleanFacts"; - TypeFacts3[TypeFacts3["FalseStrictFacts"] = 12121864] = "FalseStrictFacts"; - TypeFacts3[TypeFacts3["FalseFacts"] = 12580616 /* BaseBooleanFacts */] = "FalseFacts"; - TypeFacts3[TypeFacts3["TrueStrictFacts"] = 7927560] = "TrueStrictFacts"; - TypeFacts3[TypeFacts3["TrueFacts"] = 16774920] = "TrueFacts"; - TypeFacts3[TypeFacts3["SymbolStrictFacts"] = 7925520] = "SymbolStrictFacts"; - TypeFacts3[TypeFacts3["SymbolFacts"] = 16772880] = "SymbolFacts"; - TypeFacts3[TypeFacts3["ObjectStrictFacts"] = 7888800] = "ObjectStrictFacts"; - TypeFacts3[TypeFacts3["ObjectFacts"] = 16736160] = "ObjectFacts"; - TypeFacts3[TypeFacts3["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts"; - TypeFacts3[TypeFacts3["FunctionFacts"] = 16728e3] = "FunctionFacts"; - TypeFacts3[TypeFacts3["VoidFacts"] = 9830144] = "VoidFacts"; - TypeFacts3[TypeFacts3["UndefinedFacts"] = 26607360] = "UndefinedFacts"; - TypeFacts3[TypeFacts3["NullFacts"] = 42917664] = "NullFacts"; - TypeFacts3[TypeFacts3["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts"; - TypeFacts3[TypeFacts3["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts"; - TypeFacts3[TypeFacts3["UnknownFacts"] = 83886079] = "UnknownFacts"; - TypeFacts3[TypeFacts3["AllTypeofNE"] = 556800] = "AllTypeofNE"; - TypeFacts3[TypeFacts3["OrFactsMask"] = 8256] = "OrFactsMask"; - TypeFacts3[TypeFacts3["AndFactsMask"] = 134209471] = "AndFactsMask"; - return TypeFacts3; -})(TypeFacts || {}); -var typeofNEFacts = new Map(Object.entries({ - string: 256 /* TypeofNEString */, - number: 512 /* TypeofNENumber */, - bigint: 1024 /* TypeofNEBigInt */, - boolean: 2048 /* TypeofNEBoolean */, - symbol: 4096 /* TypeofNESymbol */, - undefined: 524288 /* NEUndefined */, - object: 8192 /* TypeofNEObject */, - function: 16384 /* TypeofNEFunction */ -})); -var CheckMode = /* @__PURE__ */ ((CheckMode3) => { - CheckMode3[CheckMode3["Normal"] = 0] = "Normal"; - CheckMode3[CheckMode3["Contextual"] = 1] = "Contextual"; - CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential"; - CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive"; - CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions"; - CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp"; - CheckMode3[CheckMode3["RestBindingElement"] = 32] = "RestBindingElement"; - CheckMode3[CheckMode3["TypeOnly"] = 64] = "TypeOnly"; - return CheckMode3; -})(CheckMode || {}); -var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => { - SignatureCheckMode3[SignatureCheckMode3["None"] = 0] = "None"; - SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback"; - SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; - SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; - SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; - SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature"; - SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; - return SignatureCheckMode3; -})(SignatureCheckMode || {}); -var isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor); -var intrinsicTypeKinds = new Map(Object.entries({ - Uppercase: 0 /* Uppercase */, - Lowercase: 1 /* Lowercase */, - Capitalize: 2 /* Capitalize */, - Uncapitalize: 3 /* Uncapitalize */, - NoInfer: 4 /* NoInfer */ -})); -var SymbolLinks = class { -}; -function NodeLinks() { - this.flags = 0 /* None */; -} -function getNodeId(node) { - if (!node.id) { - node.id = nextNodeId; - nextNodeId++; - } - return node.id; -} -function getSymbolId(symbol) { - if (!symbol.id) { - symbol.id = nextSymbolId; - nextSymbolId++; - } - return symbol.id; -} -function isInstantiatedModule(node, preserveConstEnums) { - const moduleState = getModuleInstanceState(node); - return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */; -} -function createTypeChecker(host) { - var deferredDiagnosticsCallbacks = []; - var addLazyDiagnostic = (arg) => { - deferredDiagnosticsCallbacks.push(arg); - }; - var cancellationToken; - var scanner2; - var Symbol48 = objectAllocator.getSymbolConstructor(); - var Type29 = objectAllocator.getTypeConstructor(); - var Signature13 = objectAllocator.getSignatureConstructor(); - var typeCount = 0; - var symbolCount = 0; - var totalInstantiationCount = 0; - var instantiationCount = 0; - var instantiationDepth = 0; - var inlineLevel = 0; - var currentNode; - var varianceTypeParameter; - var isInferencePartiallyBlocked = false; - var emptySymbols = createSymbolTable(); - var arrayVariances = [1 /* Covariant */]; - var compilerOptions = host.getCompilerOptions(); - var languageVersion = getEmitScriptTarget(compilerOptions); - 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"); - var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); - var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); - var strictBuiltinIteratorReturn = getStrictOptionValue(compilerOptions, "strictBuiltinIteratorReturn"); - var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); - var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); - var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); - var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; - var noUncheckedSideEffectImports = !!compilerOptions.noUncheckedSideEffectImports; - var checkBinaryExpression = createCheckBinaryExpression(); - var emitResolver = createResolver(); - var nodeBuilder = createNodeBuilder(); - var syntacticNodeBuilder = createSyntacticTypeNodeBuilder(compilerOptions, nodeBuilder.syntacticBuilderResolver); - var evaluate = createEvaluator({ - evaluateElementAccessExpression, - evaluateEntityNameExpression - }); - var globals = createSymbolTable(); - var undefinedSymbol = createSymbol(4 /* Property */, "undefined"); - undefinedSymbol.declarations = []; - var globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); - globalThisSymbol.exports = globals; - globalThisSymbol.declarations = []; - globals.set(globalThisSymbol.escapedName, globalThisSymbol); - var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); - var requireSymbol = createSymbol(4 /* Property */, "require"); - var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; - var canCollectSymbolAliasAccessabilityData = !compilerOptions.verbatimModuleSyntax; - var apparentArgumentCount; - var lastGetCombinedNodeFlagsNode; - var lastGetCombinedNodeFlagsResult = 0 /* None */; - var lastGetCombinedModifierFlagsNode; - var lastGetCombinedModifierFlagsResult = 0 /* None */; - var resolveName = createNameResolver({ - compilerOptions, - requireSymbol, - argumentsSymbol, - globals, - getSymbolOfDeclaration, - error: error2, - getRequiresScopeChangeCache, - setRequiresScopeChangeCache, - lookup: getSymbol2, - onPropertyWithInvalidInitializer: checkAndReportErrorForInvalidInitializer, - onFailedToResolveSymbol, - onSuccessfullyResolvedSymbol - }); - var resolveNameForSymbolSuggestion = createNameResolver({ - compilerOptions, - requireSymbol, - argumentsSymbol, - globals, - getSymbolOfDeclaration, - error: error2, - getRequiresScopeChangeCache, - setRequiresScopeChangeCache, - lookup: getSuggestionForSymbolNameLookup - }); - const checker = { - getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), - getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0), - getSymbolCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.symbolCount, symbolCount), - getTypeCount: () => typeCount, - getInstantiationCount: () => totalInstantiationCount, - getRelationCacheSizes: () => ({ - assignable: assignableRelation.size, - identity: identityRelation.size, - subtype: subtypeRelation.size, - strictSubtype: strictSubtypeRelation.size - }), - isUndefinedSymbol: (symbol) => symbol === undefinedSymbol, - isArgumentsSymbol: (symbol) => symbol === argumentsSymbol, - isUnknownSymbol: (symbol) => symbol === unknownSymbol, - getMergedSymbol, - symbolIsValue, - getDiagnostics: getDiagnostics2, - getGlobalDiagnostics, - getRecursionIdentity, - getUnmatchedProperties, - getTypeOfSymbolAtLocation: (symbol, locationIn) => { - const location = getParseTreeNode(locationIn); - return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; - }, - getTypeOfSymbol, - getSymbolsOfParameterPropertyDeclaration: (parameterIn, parameterName) => { - const parameter = getParseTreeNode(parameterIn, isParameter); - if (parameter === void 0) return Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); - Debug.assert(isParameterPropertyDeclaration(parameter, parameter.parent)); - return getSymbolsOfParameterPropertyDeclaration(parameter, escapeLeadingUnderscores(parameterName)); - }, - getDeclaredTypeOfSymbol, - getPropertiesOfType, - getPropertyOfType: (type, name) => getPropertyOfType(type, escapeLeadingUnderscores(name)), - getPrivateIdentifierPropertyOfType: (leftType, name, location) => { - const node = getParseTreeNode(location); - if (!node) { - return void 0; - } - const propName = escapeLeadingUnderscores(name); - const lexicallyScopedIdentifier = lookupSymbolForPrivateIdentifierDeclaration(propName, node); - return lexicallyScopedIdentifier ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) : void 0; - }, - getTypeOfPropertyOfType: (type, name) => getTypeOfPropertyOfType(type, escapeLeadingUnderscores(name)), - getIndexInfoOfType: (type, kind) => getIndexInfoOfType(type, kind === 0 /* String */ ? stringType : numberType), - getIndexInfosOfType, - getIndexInfosOfIndexSymbol, - getSignaturesOfType, - getIndexTypeOfType: (type, kind) => getIndexTypeOfType(type, kind === 0 /* String */ ? stringType : numberType), - getIndexType: (type) => getIndexType(type), - getBaseTypes, - getBaseTypeOfLiteralType, - getWidenedType, - getWidenedLiteralType, - fillMissingTypeArguments, - getTypeFromTypeNode: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isTypeNode); - return node ? getTypeFromTypeNode(node) : errorType; - }, - getParameterType: getTypeAtPosition, - getParameterIdentifierInfoAtPosition, - getPromisedTypeOfPromise, - getAwaitedType: (type) => getAwaitedType(type), - getReturnTypeOfSignature, - isNullableType, - getNullableType, - getNonNullableType, - getNonOptionalType: removeOptionalTypeMarker, - getTypeArguments, - typeToTypeNode: nodeBuilder.typeToTypeNode, - typePredicateToTypePredicateNode: nodeBuilder.typePredicateToTypePredicateNode, - indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, - signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, - symbolToEntityName: nodeBuilder.symbolToEntityName, - symbolToExpression: nodeBuilder.symbolToExpression, - symbolToNode: nodeBuilder.symbolToNode, - symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, - symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, - typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, - getSymbolsInScope: (locationIn, meaning) => { - const location = getParseTreeNode(locationIn); - return location ? getSymbolsInScope(location, meaning) : []; - }, - getSymbolAtLocation: (nodeIn) => { - const node = getParseTreeNode(nodeIn); - return node ? getSymbolAtLocation( - node, - /*ignoreErrors*/ - true - ) : void 0; - }, - getIndexInfosAtLocation: (nodeIn) => { - const node = getParseTreeNode(nodeIn); - return node ? getIndexInfosAtLocation(node) : void 0; - }, - getShorthandAssignmentValueSymbol: (nodeIn) => { - const node = getParseTreeNode(nodeIn); - return node ? getShorthandAssignmentValueSymbol(node) : void 0; - }, - getExportSpecifierLocalTargetSymbol: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isExportSpecifier); - return node ? getExportSpecifierLocalTargetSymbol(node) : void 0; - }, - getExportSymbolOfSymbol(symbol) { - return getMergedSymbol(symbol.exportSymbol || symbol); - }, - getTypeAtLocation: (nodeIn) => { - const node = getParseTreeNode(nodeIn); - return node ? getTypeOfNode(node) : errorType; - }, - getTypeOfAssignmentPattern: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isAssignmentPattern); - return node && getTypeOfAssignmentPattern(node) || errorType; - }, - getPropertySymbolOfDestructuringAssignment: (locationIn) => { - const location = getParseTreeNode(locationIn, isIdentifier); - return location ? getPropertySymbolOfDestructuringAssignment(location) : void 0; - }, - signatureToString: (signature, enclosingDeclaration, flags, kind) => { - return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind); - }, - typeToString: (type, enclosingDeclaration, flags) => { - return typeToString(type, getParseTreeNode(enclosingDeclaration), flags); - }, - symbolToString: (symbol, enclosingDeclaration, meaning, flags) => { - return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags); - }, - typePredicateToString: (predicate, enclosingDeclaration, flags) => { - return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags); - }, - writeSignature: (signature, enclosingDeclaration, flags, kind, writer, maximumLength, verbosityLevel, out) => { - return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer, maximumLength, verbosityLevel, out); - }, - writeType: (type, enclosingDeclaration, flags, writer, maximumLength, verbosityLevel, out) => { - return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer, maximumLength, verbosityLevel, out); - }, - writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => { - return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer); - }, - writeTypePredicate: (predicate, enclosingDeclaration, flags, writer) => { - return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags, writer); - }, - getAugmentedPropertiesOfType, - getRootSymbols, - getSymbolOfExpando, - getContextualType: (nodeIn, contextFlags) => { - const node = getParseTreeNode(nodeIn, isExpression); - if (!node) { - return void 0; - } - if (contextFlags & 4 /* Completions */) { - return runWithInferenceBlockedFromSourceNode(node, () => getContextualType2(node, contextFlags)); - } - return getContextualType2(node, contextFlags); - }, - getContextualTypeForObjectLiteralElement: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isObjectLiteralElementLike); - return node ? getContextualTypeForObjectLiteralElement( - node, - /*contextFlags*/ - void 0 - ) : void 0; - }, - getContextualTypeForArgumentAtIndex: (nodeIn, argIndex) => { - const node = getParseTreeNode(nodeIn, isCallLikeExpression); - return node && getContextualTypeForArgumentAtIndex(node, argIndex); - }, - getContextualTypeForJsxAttribute: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isJsxAttributeLike); - return node && getContextualTypeForJsxAttribute( - node, - /*contextFlags*/ - void 0 - ); - }, - isContextSensitive, - getTypeOfPropertyOfContextualType, - getFullyQualifiedName, - getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */), - getCandidateSignaturesForStringLiteralCompletions, - getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)), - getExpandedParameters, - hasEffectiveRestParameter, - containsArgumentsReference, - getConstantValue: (nodeIn) => { - const node = getParseTreeNode(nodeIn, canHaveConstantValue); - return node ? getConstantValue2(node) : void 0; - }, - isValidPropertyAccess: (nodeIn, propertyName) => { - const node = getParseTreeNode(nodeIn, isPropertyAccessOrQualifiedNameOrImportTypeNode); - return !!node && isValidPropertyAccess(node, escapeLeadingUnderscores(propertyName)); - }, - isValidPropertyAccessForCompletions: (nodeIn, type, property) => { - const node = getParseTreeNode(nodeIn, isPropertyAccessExpression); - return !!node && isValidPropertyAccessForCompletions(node, type, property); - }, - getSignatureFromDeclaration: (declarationIn) => { - const declaration = getParseTreeNode(declarationIn, isFunctionLike); - return declaration ? getSignatureFromDeclaration(declaration) : void 0; - }, - isImplementationOfOverload: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isFunctionLike); - return node ? isImplementationOfOverload(node) : void 0; - }, - getImmediateAliasedSymbol, - getAliasedSymbol: resolveAlias, - getEmitResolver, - requiresAddingImplicitUndefined, - getExportsOfModule: getExportsOfModuleAsArray, - getExportsAndPropertiesOfModule, - forEachExportAndPropertyOfModule, - getSymbolWalker: createGetSymbolWalker( - getRestTypeOfSignature, - getTypePredicateOfSignature, - getReturnTypeOfSignature, - getBaseTypes, - resolveStructuredTypeMembers, - getTypeOfSymbol, - getResolvedSymbol, - getConstraintOfTypeParameter, - getFirstIdentifier, - getTypeArguments - ), - getAmbientModules, - getJsxIntrinsicTagNamesAt, - isOptionalParameter: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isParameter); - return node ? isOptionalParameter(node) : false; - }, - tryGetMemberInModuleExports: (name, symbol) => tryGetMemberInModuleExports(escapeLeadingUnderscores(name), symbol), - tryGetMemberInModuleExportsAndProperties: (name, symbol) => tryGetMemberInModuleExportsAndProperties(escapeLeadingUnderscores(name), symbol), - tryFindAmbientModule: (moduleName) => tryFindAmbientModule( - moduleName, - /*withAugmentations*/ - true - ), - getApparentType, - getUnionType, - isTypeAssignableTo, - createAnonymousType, - createSignature, - createSymbol, - createIndexInfo, - getAnyType: () => anyType, - getStringType: () => stringType, - getStringLiteralType, - getNumberType: () => numberType, - getNumberLiteralType, - getBigIntType: () => bigintType, - getBigIntLiteralType, - getUnknownType: () => unknownType, - createPromiseType, - createArrayType, - getElementTypeOfArrayType, - getBooleanType: () => booleanType, - getFalseType: (fresh) => fresh ? falseType : regularFalseType, - getTrueType: (fresh) => fresh ? trueType : regularTrueType, - getVoidType: () => voidType, - getUndefinedType: () => undefinedType, - getNullType: () => nullType, - getESSymbolType: () => esSymbolType, - getNeverType: () => neverType, - getNonPrimitiveType: () => nonPrimitiveType, - getOptionalType: () => optionalType, - getPromiseType: () => getGlobalPromiseType( - /*reportErrors*/ - false - ), - getPromiseLikeType: () => getGlobalPromiseLikeType( - /*reportErrors*/ - false - ), - getAnyAsyncIterableType: () => { - const type = getGlobalAsyncIterableType( - /*reportErrors*/ - false - ); - if (type === emptyGenericType) return void 0; - return createTypeReference(type, [anyType, anyType, anyType]); - }, - isSymbolAccessible, - isArrayType, - isTupleType, - isArrayLikeType, - isEmptyAnonymousObjectType, - isTypeInvalidDueToUnionDiscriminant, - getExactOptionalProperties, - getAllPossiblePropertiesOfTypes, - getSuggestedSymbolForNonexistentProperty, - getSuggestedSymbolForNonexistentJSXAttribute, - getSuggestedSymbolForNonexistentSymbol: (location, name, meaning) => getSuggestedSymbolForNonexistentSymbol(location, escapeLeadingUnderscores(name), meaning), - getSuggestedSymbolForNonexistentModule, - getSuggestedSymbolForNonexistentClassMember, - getBaseConstraintOfType, - getDefaultFromTypeParameter: (type) => type && type.flags & 262144 /* TypeParameter */ ? getDefaultFromTypeParameter(type) : void 0, - resolveName(name, location, meaning, excludeGlobals) { - return resolveName( - location, - escapeLeadingUnderscores(name), - meaning, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false, - excludeGlobals - ); - }, - getJsxNamespace: (n) => unescapeLeadingUnderscores(getJsxNamespace(n)), - getJsxFragmentFactory: (n) => { - const jsxFragmentFactory = getJsxFragmentFactoryEntity(n); - return jsxFragmentFactory && unescapeLeadingUnderscores(getFirstIdentifier(jsxFragmentFactory).escapedText); - }, - getAccessibleSymbolChain, - getTypePredicateOfSignature, - resolveExternalModuleName: (moduleSpecifierIn) => { - const moduleSpecifier = getParseTreeNode(moduleSpecifierIn, isExpression); - return moduleSpecifier && resolveExternalModuleName( - moduleSpecifier, - moduleSpecifier, - /*ignoreErrors*/ - true - ); - }, - resolveExternalModuleSymbol, - tryGetThisTypeAt: (nodeIn, includeGlobalThis, container) => { - const node = getParseTreeNode(nodeIn); - return node && tryGetThisTypeAt(node, includeGlobalThis, container); - }, - getTypeArgumentConstraint: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isTypeNode); - return node && getTypeArgumentConstraint(node); - }, - getSuggestionDiagnostics: (fileIn, ct) => { - const file = getParseTreeNode(fileIn, isSourceFile) || Debug.fail("Could not determine parsed source file."); - if (skipTypeChecking(file, compilerOptions, host)) { - return emptyArray; - } - let diagnostics2; - try { - cancellationToken = ct; - checkSourceFileWithEagerDiagnostics(file); - 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 & 33554432 /* Ambient */))) { - (diagnostics2 || (diagnostics2 = [])).push({ ...diag2, category: 2 /* Suggestion */ }); - } - }); - return diagnostics2 || emptyArray; - } finally { - cancellationToken = void 0; - } - }, - runWithCancellationToken: (token, callback) => { - try { - cancellationToken = token; - return callback(checker); - } finally { - cancellationToken = void 0; - } - }, - getLocalTypeParametersOfClassOrInterfaceOrTypeAlias, - isDeclarationVisible, - isPropertyAccessible, - getTypeOnlyAliasDeclaration, - getMemberOverrideModifierStatus, - isTypeParameterPossiblyReferenced, - typeHasCallOrConstructSignatures, - getSymbolFlags, - getTypeArgumentsForResolvedSignature, - isLibType - }; - function getTypeArgumentsForResolvedSignature(signature) { - if (signature.mapper === void 0) return void 0; - return instantiateTypes((signature.target || signature).typeParameters, signature.mapper); - } - 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); - } - candidates.length = 0; - runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker( - call, - candidates, - /*argumentCount*/ - void 0, - 0 /* Normal */ - )); - for (const candidate of candidates) { - candidatesSet.add(candidate); - } - 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); - if (containingCall) { - let toMarkSkip = node; - do { - getNodeLinks(toMarkSkip).skipDirectInference = true; - toMarkSkip = toMarkSkip.parent; - } while (toMarkSkip && toMarkSkip !== containingCall); - } - isInferencePartiallyBlocked = true; - const result = runWithoutResolvedSignatureCaching(node, fn); - isInferencePartiallyBlocked = false; - if (containingCall) { - let toMarkSkip = node; - do { - getNodeLinks(toMarkSkip).skipDirectInference = void 0; - toMarkSkip = toMarkSkip.parent; - } while (toMarkSkip && toMarkSkip !== containingCall); - } - return result; - } - function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) { - const node = getParseTreeNode(nodeIn, isCallLikeExpression); - apparentArgumentCount = argumentCount; - const res = !node ? void 0 : getResolvedSignature(node, candidatesOutArray, checkMode); - apparentArgumentCount = void 0; - return res; - } - var tupleTypes = /* @__PURE__ */ new Map(); - var unionTypes = /* @__PURE__ */ new Map(); - var unionOfUnionTypes = /* @__PURE__ */ new Map(); - var intersectionTypes = /* @__PURE__ */ new Map(); - var stringLiteralTypes = /* @__PURE__ */ new Map(); - var numberLiteralTypes = /* @__PURE__ */ new Map(); - var bigIntLiteralTypes = /* @__PURE__ */ new Map(); - var enumLiteralTypes = /* @__PURE__ */ new Map(); - var indexedAccessTypes = /* @__PURE__ */ new Map(); - var templateLiteralTypes = /* @__PURE__ */ new Map(); - var stringMappingTypes = /* @__PURE__ */ new Map(); - var substitutionTypes = /* @__PURE__ */ new Map(); - var subtypeReductionCache = /* @__PURE__ */ new Map(); - var decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); - var cachedTypes = /* @__PURE__ */ new Map(); - var evolvingArrayTypes = []; - var undefinedProperties = /* @__PURE__ */ new Map(); - var markerTypes = /* @__PURE__ */ new Set(); - var unknownSymbol = createSymbol(4 /* Property */, "unknown"); - 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 */, "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 */, "non-inferrable"); - var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); - var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - var undefinedType = 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", - /*objectFlags*/ - void 0, - "optional" - ); - var nullType = createIntrinsicType(65536 /* Null */, "null"); - 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", - /*objectFlags*/ - void 0, - "fresh" - ); - var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - var trueType = createIntrinsicType( - 512 /* BooleanLiteral */, - "true", - /*objectFlags*/ - void 0, - "fresh" - ); - var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); - trueType.regularType = regularTrueType; - trueType.freshType = trueType; - regularTrueType.regularType = regularTrueType; - regularTrueType.freshType = trueType; - falseType.regularType = regularFalseType; - falseType.freshType = falseType; - regularFalseType.regularType = regularFalseType; - regularFalseType.freshType = falseType; - var booleanType = getUnionType([regularFalseType, regularTrueType]); - 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 */, "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]); - var numberOrBigIntType = getUnionType([numberType, bigintType]); - var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); - 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", - /*objectFlags*/ - void 0, - "unique literal" - ); - var uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); - var outofbandVarianceMarkerHandler; - var reportUnreliableMapper = makeFunctionTypeMapper((t) => { - if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { - outofbandVarianceMarkerHandler( - /*onlyUnreliable*/ - true - ); - } - return t; - }, () => "(unmeasurable reporter)"); - var reportUnmeasurableMapper = makeFunctionTypeMapper((t) => { - if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) { - outofbandVarianceMarkerHandler( - /*onlyUnreliable*/ - false - ); - } - return t; - }, () => "(unreliable reporter)"); - var emptyObjectType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - var emptyJsxObjectType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */; - var emptyFreshJsxObjectType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - emptyFreshJsxObjectType.objectFlags |= 2048 /* JsxAttributes */ | 8192 /* FreshLiteral */ | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */; - var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); - emptyTypeLiteralSymbol.members = createSymbolTable(); - var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); - var unknownEmptyObjectType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType; - var emptyGenericType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - emptyGenericType.instantiations = /* @__PURE__ */ new Map(); - var anyFunctionType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - anyFunctionType.objectFlags |= 262144 /* NonInferrableType */; - var noConstraintType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - var circularConstraintType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - var resolvingDefaultType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - var markerSuperType = createTypeParameter(); - var markerSubType = createTypeParameter(); - markerSubType.constraint = markerSuperType; - var markerOtherType = createTypeParameter(); - var markerSuperTypeForCheck = createTypeParameter(); - var markerSubTypeForCheck = createTypeParameter(); - markerSubTypeForCheck.constraint = markerSuperTypeForCheck; - var noTypePredicate = createTypePredicate(1 /* Identifier */, "<>", 0, anyType); - var anySignature = createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - emptyArray, - anyType, - /*resolvedTypePredicate*/ - void 0, - 0, - 0 /* None */ - ); - var unknownSignature = createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - emptyArray, - errorType, - /*resolvedTypePredicate*/ - void 0, - 0, - 0 /* None */ - ); - var resolvingSignature = createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - emptyArray, - anyType, - /*resolvedTypePredicate*/ - void 0, - 0, - 0 /* None */ - ); - var silentNeverSignature = createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - emptyArray, - silentNeverType, - /*resolvedTypePredicate*/ - void 0, - 0, - 0 /* None */ - ); - var enumNumberIndexInfo = createIndexInfo( - numberType, - stringType, - /*isReadonly*/ - true - ); - var anyBaseTypeIndexInfo = createIndexInfo( - stringType, - anyType, - /*isReadonly*/ - false - ); - var iterationTypesCache = /* @__PURE__ */ new Map(); - var noIterationTypes = { - get yieldType() { - return Debug.fail("Not supported"); - }, - get returnType() { - return Debug.fail("Not supported"); - }, - get nextType() { - return Debug.fail("Not supported"); - } - }; - var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); - var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType); - var asyncIterationTypesResolver = { - iterableCacheKey: "iterationTypesOfAsyncIterable", - iteratorCacheKey: "iterationTypesOfAsyncIterator", - iteratorSymbolName: "asyncIterator", - getGlobalIteratorType: getGlobalAsyncIteratorType, - getGlobalIterableType: getGlobalAsyncIterableType, - getGlobalIterableIteratorType: getGlobalAsyncIterableIteratorType, - getGlobalIteratorObjectType: getGlobalAsyncIteratorObjectType, - getGlobalGeneratorType: getGlobalAsyncGeneratorType, - getGlobalBuiltinIteratorTypes: getGlobalBuiltinAsyncIteratorTypes, - resolveIterationType: (type, errorNode) => getAwaitedType(type, errorNode, Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member), - mustHaveANextMethodDiagnostic: Diagnostics.An_async_iterator_must_have_a_next_method, - mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, - mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property - }; - var syncIterationTypesResolver = { - iterableCacheKey: "iterationTypesOfIterable", - iteratorCacheKey: "iterationTypesOfIterator", - iteratorSymbolName: "iterator", - getGlobalIteratorType, - getGlobalIterableType, - getGlobalIterableIteratorType, - getGlobalIteratorObjectType, - getGlobalGeneratorType, - getGlobalBuiltinIteratorTypes, - resolveIterationType: (type, _errorNode) => type, - mustHaveANextMethodDiagnostic: Diagnostics.An_iterator_must_have_a_next_method, - mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_iterator_must_be_a_method, - mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property - }; - var amalgamatedDuplicates; - var reverseMappedCache = /* @__PURE__ */ new Map(); - var reverseHomomorphicMappedCache = /* @__PURE__ */ new Map(); - var ambientModulesCache; - var patternAmbientModules; - var patternAmbientModuleAugmentations; - var globalObjectType; - var globalFunctionType; - var globalCallableFunctionType; - var globalNewableFunctionType; - var globalArrayType; - var globalReadonlyArrayType; - var globalStringType; - var globalNumberType; - var globalBooleanType; - var globalRegExpType; - var globalThisType; - var anyArrayType; - var autoArrayType; - var anyReadonlyArrayType; - var deferredGlobalNonNullableTypeAlias; - var deferredGlobalESSymbolConstructorSymbol; - var deferredGlobalESSymbolConstructorTypeSymbol; - var deferredGlobalESSymbolType; - var deferredGlobalTypedPropertyDescriptorType; - var deferredGlobalPromiseType; - var deferredGlobalPromiseLikeType; - var deferredGlobalPromiseConstructorSymbol; - var deferredGlobalPromiseConstructorLikeType; - var deferredGlobalIterableType; - var deferredGlobalIteratorType; - var deferredGlobalIterableIteratorType; - var deferredGlobalIteratorObjectType; - var deferredGlobalGeneratorType; - var deferredGlobalIteratorYieldResultType; - var deferredGlobalIteratorReturnResultType; - var deferredGlobalAsyncIterableType; - var deferredGlobalAsyncIteratorType; - var deferredGlobalAsyncIterableIteratorType; - var deferredGlobalBuiltinIteratorTypes; - var deferredGlobalBuiltinAsyncIteratorTypes; - var deferredGlobalAsyncIteratorObjectType; - var deferredGlobalAsyncGeneratorType; - var deferredGlobalTemplateStringsArrayType; - var deferredGlobalImportMetaType; - var deferredGlobalImportMetaExpressionType; - var deferredGlobalImportCallOptionsType; - var deferredGlobalImportAttributesType; - var deferredGlobalDisposableType; - var deferredGlobalAsyncDisposableType; - var deferredGlobalExtractSymbol; - var deferredGlobalOmitSymbol; - var deferredGlobalAwaitedSymbol; - var deferredGlobalBigIntType; - var deferredGlobalNaNSymbol; - var deferredGlobalRecordSymbol; - var deferredGlobalClassDecoratorContextType; - var deferredGlobalClassMethodDecoratorContextType; - var deferredGlobalClassGetterDecoratorContextType; - var deferredGlobalClassSetterDecoratorContextType; - var deferredGlobalClassAccessorDecoratorContextType; - var deferredGlobalClassAccessorDecoratorTargetType; - var deferredGlobalClassAccessorDecoratorResultType; - var deferredGlobalClassFieldDecoratorContextType; - var allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); - var flowLoopStart = 0; - var flowLoopCount = 0; - var sharedFlowCount = 0; - var flowAnalysisDisabled = false; - var flowInvocationCount = 0; - var lastFlowNode; - var lastFlowNodeReachable; - var flowTypeCache; - var contextualTypeNodes = []; - var contextualTypes = []; - var contextualIsCache = []; - var contextualTypeCount = 0; - var contextualBindingPatterns = []; - var inferenceContextNodes = []; - var inferenceContexts = []; - var inferenceContextCount = 0; - var activeTypeMappers = []; - var activeTypeMappersCaches = []; - var activeTypeMappersCount = 0; - var emptyStringType = getStringLiteralType(""); - var zeroType = getNumberLiteralType(0); - var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); - var resolutionTargets = []; - var resolutionResults = []; - var resolutionPropertyNames = []; - var resolutionStart = 0; - var inVarianceComputation = false; - var suggestionCount = 0; - var maximumSuggestionCount = 10; - var mergedSymbols = []; - var symbolLinks = []; - var nodeLinks = []; - var flowLoopCaches = []; - var flowLoopNodes = []; - var flowLoopKeys = []; - var flowLoopTypes = []; - var sharedFlowNodes = []; - var sharedFlowTypes = []; - var flowNodeReachable = []; - var flowNodePostSuper = []; - var potentialThisCollisions = []; - var potentialNewTargetCollisions = []; - var potentialWeakMapSetCollisions = []; - var potentialReflectCollisions = []; - var potentialUnusedRenamedBindingElementsInTypes = []; - var awaitedTypeStack = []; - var reverseMappedSourceStack = []; - var reverseMappedTargetStack = []; - var reverseExpandingFlags = 0 /* None */; - var diagnostics = createDiagnosticCollection(); - var suggestionDiagnostics = createDiagnosticCollection(); - var typeofType = createTypeofType(); - var _jsxNamespace; - var _jsxFactoryEntity; - var subtypeRelation = /* @__PURE__ */ new Map(); - var strictSubtypeRelation = /* @__PURE__ */ new Map(); - var assignableRelation = /* @__PURE__ */ new Map(); - var comparableRelation = /* @__PURE__ */ new Map(); - var identityRelation = /* @__PURE__ */ new Map(); - var enumRelation = /* @__PURE__ */ new Map(); - var suggestedExtensions = [ - [".mts", ".mjs"], - [".ts", ".js"], - [".cts", ".cjs"], - [".mjs", ".mjs"], - [".js", ".js"], - [".cjs", ".cjs"], - [".tsx", compilerOptions.jsx === 1 /* Preserve */ ? ".jsx" : ".js"], - [".jsx", ".jsx"], - [".json", ".json"] - ]; - initializeTypeChecker(); - return checker; - function isDefinitelyReferenceToGlobalSymbolObject(node) { - if (!isPropertyAccessExpression(node)) return false; - if (!isIdentifier(node.name)) return false; - if (!isPropertyAccessExpression(node.expression) && !isIdentifier(node.expression)) return false; - if (isIdentifier(node.expression)) { - return idText(node.expression) === "Symbol" && getResolvedSymbol(node.expression) === (getGlobalSymbol( - "Symbol", - 111551 /* Value */ | 1048576 /* ExportValue */, - /*diagnostic*/ - void 0 - ) || unknownSymbol); - } - if (!isIdentifier(node.expression.expression)) return false; - return idText(node.expression.name) === "Symbol" && idText(node.expression.expression) === "globalThis" && getResolvedSymbol(node.expression.expression) === globalThisSymbol; - } - function getCachedType(key) { - return key ? cachedTypes.get(key) : void 0; - } - function setCachedType(key, type) { - if (key) cachedTypes.set(key, type); - return type; - } - function getJsxNamespace(location) { - if (location) { - const file = getSourceFileOfNode(location); - if (file) { - if (isJsxOpeningFragment(location)) { - if (file.localJsxFragmentNamespace) { - return file.localJsxFragmentNamespace; - } - const jsxFragmentPragma = file.pragmas.get("jsxfrag"); - if (jsxFragmentPragma) { - const chosenPragma = isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma; - file.localJsxFragmentFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFragmentFactory, markAsSynthetic, isEntityName); - if (file.localJsxFragmentFactory) { - return file.localJsxFragmentNamespace = getFirstIdentifier(file.localJsxFragmentFactory).escapedText; - } - } - const entity = getJsxFragmentFactoryEntity(location); - if (entity) { - file.localJsxFragmentFactory = entity; - return file.localJsxFragmentNamespace = getFirstIdentifier(entity).escapedText; - } - } else { - const localJsxNamespace = getLocalJsxNamespace(file); - if (localJsxNamespace) { - return file.localJsxNamespace = localJsxNamespace; - } - } - } - } - if (!_jsxNamespace) { - _jsxNamespace = "React"; - if (compilerOptions.jsxFactory) { - _jsxFactoryEntity = parseIsolatedEntityName(compilerOptions.jsxFactory, languageVersion); - visitNode(_jsxFactoryEntity, markAsSynthetic); - if (_jsxFactoryEntity) { - _jsxNamespace = getFirstIdentifier(_jsxFactoryEntity).escapedText; - } - } else if (compilerOptions.reactNamespace) { - _jsxNamespace = escapeLeadingUnderscores(compilerOptions.reactNamespace); - } - } - if (!_jsxFactoryEntity) { - _jsxFactoryEntity = factory.createQualifiedName(factory.createIdentifier(unescapeLeadingUnderscores(_jsxNamespace)), "createElement"); - } - return _jsxNamespace; - } - function getLocalJsxNamespace(file) { - if (file.localJsxNamespace) { - return file.localJsxNamespace; - } - const jsxPragma = file.pragmas.get("jsx"); - if (jsxPragma) { - const chosenPragma = isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; - file.localJsxFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); - visitNode(file.localJsxFactory, markAsSynthetic, isEntityName); - if (file.localJsxFactory) { - return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; - } - } - } - function markAsSynthetic(node) { - setTextRangePosEnd(node, -1, -1); - return visitEachChild( - node, - markAsSynthetic, - /*context*/ - void 0 - ); - } - function getEmitResolver(sourceFile, cancellationToken2, skipDiagnostics) { - if (!skipDiagnostics) getDiagnostics2(sourceFile, cancellationToken2); - return emitResolver; - } - function lookupOrIssueError(location, message, ...args) { - const diagnostic = location ? createDiagnosticForNode(location, message, ...args) : createCompilerDiagnostic(message, ...args); - const existing = diagnostics.lookup(diagnostic); - if (existing) { - return existing; - } else { - diagnostics.add(diagnostic); - return diagnostic; - } - } - function errorSkippedOn(key, 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 error2(location, message, ...args) { - const diagnostic = createError(location, message, ...args); - diagnostics.add(diagnostic); - return diagnostic; - } - function getVerbatimModuleSyntaxErrorMessage(node) { - const sourceFile = getSourceFileOfNode(node); - const fileName = sourceFile.fileName; - if (fileExtensionIsOneOf(fileName, [".cts" /* Cts */, ".cjs" /* Cjs */])) { - return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax; - } else { - return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript; - } - } - function addErrorOrSuggestion(isError, diagnostic) { - if (isError) { - diagnostics.add(diagnostic); - } else { - suggestionDiagnostics.add({ ...diagnostic, category: 2 /* Suggestion */ }); - } - } - function errorOrSuggestion(isError, location, message, ...args) { - if (location.pos < 0 || location.end < 0) { - if (!isError) { - return; - } - const file = getSourceFileOfNode(location); - addErrorOrSuggestion(isError, "message" in message ? createFileDiagnostic(file, 0, 0, message, ...args) : createDiagnosticForFileFromMessageChain(file, message)); - return; - } - addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, ...args) : createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(location), location, message)); - } - function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, ...args) { - const diagnostic = error2(location, message, ...args); - if (maybeMissingAwait) { - const related = createDiagnosticForNode(location, Diagnostics.Did_you_forget_to_use_await); - addRelatedInfo(diagnostic, related); - } - return diagnostic; - } - function addDeprecatedSuggestionWorker(declarations, diagnostic) { - const deprecatedTag = Array.isArray(declarations) ? forEach(declarations, getJSDocDeprecatedTag) : getJSDocDeprecatedTag(declarations); - if (deprecatedTag) { - addRelatedInfo( - diagnostic, - createDiagnosticForNode(deprecatedTag, Diagnostics.The_declaration_was_marked_as_deprecated_here) - ); - } - suggestionDiagnostics.add(diagnostic); - return diagnostic; - } - function isDeprecatedSymbol(symbol) { - const parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol && length(symbol.declarations) > 1) { - return parentSymbol.flags & 64 /* Interface */ ? some(symbol.declarations, isDeprecatedDeclaration2) : every(symbol.declarations, isDeprecatedDeclaration2); - } - return !!symbol.valueDeclaration && isDeprecatedDeclaration2(symbol.valueDeclaration) || length(symbol.declarations) && every(symbol.declarations, isDeprecatedDeclaration2); - } - function isDeprecatedDeclaration2(declaration) { - return !!(getCombinedNodeFlagsCached(declaration) & 536870912 /* Deprecated */); - } - function addDeprecatedSuggestion(location, declarations, deprecatedEntity) { - const diagnostic = createDiagnosticForNode(location, Diagnostics._0_is_deprecated, deprecatedEntity); - return addDeprecatedSuggestionWorker(declarations, diagnostic); - } - function addDeprecatedSuggestionWithSignature(location, declaration, deprecatedEntity, signatureString) { - const diagnostic = deprecatedEntity ? createDiagnosticForNode(location, Diagnostics.The_signature_0_of_1_is_deprecated, signatureString, deprecatedEntity) : createDiagnosticForNode(location, Diagnostics._0_is_deprecated, signatureString); - return addDeprecatedSuggestionWorker(declaration, diagnostic); - } - function createSymbol(flags, name, checkFlags) { - symbolCount++; - const symbol = new Symbol48(flags | 33554432 /* Transient */, name); - symbol.links = new SymbolLinks(); - symbol.links.checkFlags = checkFlags || 0 /* None */; - return symbol; - } - function createParameter2(name, type) { - const symbol = createSymbol(1 /* FunctionScopedVariable */, name); - symbol.links.type = type; - return symbol; - } - function createProperty(name, type) { - const symbol = createSymbol(4 /* Property */, name); - symbol.links.type = type; - return symbol; - } - function getExcludedSymbolFlags(flags) { - let result = 0; - if (flags & 2 /* BlockScopedVariable */) result |= 111551 /* BlockScopedVariableExcludes */; - if (flags & 1 /* FunctionScopedVariable */) result |= 111550 /* FunctionScopedVariableExcludes */; - if (flags & 4 /* Property */) result |= 0 /* PropertyExcludes */; - if (flags & 8 /* EnumMember */) result |= 900095 /* EnumMemberExcludes */; - if (flags & 16 /* Function */) result |= 110991 /* FunctionExcludes */; - if (flags & 32 /* Class */) result |= 899503 /* ClassExcludes */; - if (flags & 64 /* Interface */) result |= 788872 /* InterfaceExcludes */; - if (flags & 256 /* RegularEnum */) result |= 899327 /* RegularEnumExcludes */; - if (flags & 128 /* ConstEnum */) result |= 899967 /* ConstEnumExcludes */; - if (flags & 512 /* ValueModule */) result |= 110735 /* ValueModuleExcludes */; - if (flags & 8192 /* Method */) result |= 103359 /* MethodExcludes */; - if (flags & 32768 /* GetAccessor */) result |= 46015 /* GetAccessorExcludes */; - if (flags & 65536 /* SetAccessor */) result |= 78783 /* SetAccessorExcludes */; - if (flags & 262144 /* TypeParameter */) result |= 526824 /* TypeParameterExcludes */; - if (flags & 524288 /* TypeAlias */) result |= 788968 /* TypeAliasExcludes */; - if (flags & 2097152 /* Alias */) result |= 2097152 /* AliasExcludes */; - return result; - } - function recordMergedSymbol(target, source) { - if (!source.mergeId) { - source.mergeId = nextMergeId; - nextMergeId++; - } - mergedSymbols[source.mergeId] = target; - } - function cloneSymbol(symbol) { - const result = createSymbol(symbol.flags, symbol.escapedName); - result.declarations = symbol.declarations ? symbol.declarations.slice() : []; - result.parent = symbol.parent; - if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; - if (symbol.constEnumOnlyModule) result.constEnumOnlyModule = true; - if (symbol.members) result.members = new Map(symbol.members); - if (symbol.exports) result.exports = new Map(symbol.exports); - recordMergedSymbol(result, symbol); - return result; - } - function mergeSymbol(target, source, unidirectional = false) { - if (!(target.flags & getExcludedSymbolFlags(source.flags)) || (source.flags | target.flags) & 67108864 /* Assignment */) { - if (source === target) { - return target; - } - if (!(target.flags & 33554432 /* Transient */)) { - const resolvedTarget = resolveSymbol(target); - if (resolvedTarget === unknownSymbol) { - return source; - } - if (!(resolvedTarget.flags & getExcludedSymbolFlags(source.flags)) || (source.flags | resolvedTarget.flags) & 67108864 /* Assignment */) { - target = cloneSymbol(resolvedTarget); - } else { - reportMergeSymbolError(target, source); - return source; - } - } - if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { - target.constEnumOnlyModule = false; - } - target.flags |= source.flags; - if (source.valueDeclaration) { - setValueDeclaration(target, source.valueDeclaration); - } - addRange(target.declarations, source.declarations); - if (source.members) { - if (!target.members) target.members = createSymbolTable(); - mergeSymbolTable(target.members, source.members, unidirectional); - } - if (source.exports) { - if (!target.exports) target.exports = createSymbolTable(); - mergeSymbolTable(target.exports, source.exports, unidirectional, target); - } - if (!unidirectional) { - recordMergedSymbol(target, source); - } - } else if (target.flags & 1024 /* NamespaceModule */) { - if (target !== globalThisSymbol) { - 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) - ); - } - } else { - reportMergeSymbolError(target, source); - } - return target; - function reportMergeSymbolError(target2, source2) { - const isEitherEnum = !!(target2.flags & 384 /* Enum */ || source2.flags & 384 /* Enum */); - const isEitherBlockScoped = !!(target2.flags & 2 /* BlockScopedVariable */ || source2.flags & 2 /* BlockScopedVariable */); - const message = isEitherEnum ? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations : isEitherBlockScoped ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; - const sourceSymbolFile = source2.declarations && getSourceFileOfNode(source2.declarations[0]); - const targetSymbolFile = target2.declarations && getSourceFileOfNode(target2.declarations[0]); - const isSourcePlainJs = isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs); - const isTargetPlainJs = isPlainJsFile(targetSymbolFile, compilerOptions.checkJs); - const symbolName2 = symbolToString(source2); - if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) { - const firstFile = comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile; - const secondFile = firstFile === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile; - const filesDuplicates = getOrUpdate(amalgamatedDuplicates, `${firstFile.path}|${secondFile.path}`, () => ({ firstFile, secondFile, conflictingSymbols: /* @__PURE__ */ new Map() })); - const conflictingSymbolInfo = getOrUpdate(filesDuplicates.conflictingSymbols, symbolName2, () => ({ isBlockScoped: isEitherBlockScoped, firstFileLocations: [], secondFileLocations: [] })); - if (!isSourcePlainJs) addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source2); - if (!isTargetPlainJs) addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target2); - } else { - if (!isSourcePlainJs) addDuplicateDeclarationErrorsForSymbols(source2, message, symbolName2, target2); - if (!isTargetPlainJs) addDuplicateDeclarationErrorsForSymbols(target2, message, symbolName2, source2); - } - } - function addDuplicateLocations(locs, symbol) { - if (symbol.declarations) { - for (const decl of symbol.declarations) { - pushIfUnique(locs, decl); - } - } - } - } - function addDuplicateDeclarationErrorsForSymbols(target, message, symbolName2, source) { - forEach(target.declarations, (node) => { - addDuplicateDeclarationError(node, message, symbolName2, source.declarations); - }); - } - function addDuplicateDeclarationError(node, message, symbolName2, relatedNodes) { - const errorNode = (getExpandoInitializer( - node, - /*isPrototypeAssignment*/ - false - ) ? getNameOfExpando(node) : getNameOfDeclaration(node)) || node; - const err = lookupOrIssueError(errorNode, message, symbolName2); - for (const relatedNode of relatedNodes || emptyArray) { - const adjustedNode = (getExpandoInitializer( - relatedNode, - /*isPrototypeAssignment*/ - false - ) ? getNameOfExpando(relatedNode) : getNameOfDeclaration(relatedNode)) || relatedNode; - if (adjustedNode === errorNode) continue; - err.relatedInformation = err.relatedInformation || []; - const leadingMessage = createDiagnosticForNode(adjustedNode, Diagnostics._0_was_also_declared_here, symbolName2); - const followOnMessage = createDiagnosticForNode(adjustedNode, Diagnostics.and_here); - if (length(err.relatedInformation) >= 5 || some(err.relatedInformation, (r) => compareDiagnostics(r, followOnMessage) === 0 /* EqualTo */ || compareDiagnostics(r, leadingMessage) === 0 /* EqualTo */)) continue; - addRelatedInfo(err, !length(err.relatedInformation) ? leadingMessage : followOnMessage); - } - } - function combineSymbolTables(first2, second) { - if (!(first2 == null ? void 0 : first2.size)) return second; - if (!(second == null ? void 0 : second.size)) return first2; - const combined = createSymbolTable(); - mergeSymbolTable(combined, first2); - mergeSymbolTable(combined, second); - return combined; - } - function mergeSymbolTable(target, source, unidirectional = false, mergedParent) { - source.forEach((sourceSymbol, id) => { - const targetSymbol = target.get(id); - const merged = targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : getMergedSymbol(sourceSymbol); - if (mergedParent && targetSymbol) { - merged.parent = mergedParent; - } - target.set(id, merged); - }); - } - function mergeModuleAugmentation(moduleName) { - var _a, _b, _c; - const moduleAugmentation = moduleName.parent; - if (((_a = moduleAugmentation.symbol.declarations) == null ? void 0 : _a[0]) !== moduleAugmentation) { - Debug.assert(moduleAugmentation.symbol.declarations.length > 1); - return; - } - if (isGlobalScopeAugmentation(moduleAugmentation)) { - mergeSymbolTable(globals, moduleAugmentation.symbol.exports); - } else { - 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, - moduleNotFoundError, - /*ignoreErrors*/ - false, - /*isForAugmentation*/ - true - ); - if (!mainModule) { - return; - } - mainModule = resolveExternalModuleSymbol(mainModule); - if (mainModule.flags & 1920 /* Namespace */) { - if (some(patternAmbientModules, (module2) => mainModule === module2.symbol)) { - const merged = mergeSymbol( - moduleAugmentation.symbol, - mainModule, - /*unidirectional*/ - true - ); - if (!patternAmbientModuleAugmentations) { - patternAmbientModuleAugmentations = /* @__PURE__ */ new Map(); - } - patternAmbientModuleAugmentations.set(moduleName.text, merged); - } else { - if (((_b = mainModule.exports) == null ? void 0 : _b.get("__export" /* ExportStar */)) && ((_c = moduleAugmentation.symbol.exports) == null ? void 0 : _c.size)) { - const resolvedExports = getResolvedMembersOrExportsOfSymbol(mainModule, "resolvedExports" /* resolvedExports */); - for (const [key, value] of arrayFrom(moduleAugmentation.symbol.exports.entries())) { - if (resolvedExports.has(key) && !mainModule.exports.has(key)) { - mergeSymbol(resolvedExports.get(key), value); - } - } - } - mergeSymbol(mainModule, moduleAugmentation.symbol); - } - } else { - error2(moduleName, Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName.text); - } - } - } - function addUndefinedToGlobalsOrErrorOnRedeclaration() { - const name = undefinedSymbol.escapedName; - const targetSymbol = globals.get(name); - if (targetSymbol) { - forEach(targetSymbol.declarations, (declaration) => { - if (!isTypeDeclaration(declaration)) { - diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, unescapeLeadingUnderscores(name))); - } - }); - } else { - globals.set(name, undefinedSymbol); - } - } - function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) return symbol.links; - const id = getSymbolId(symbol); - return symbolLinks[id] ?? (symbolLinks[id] = new SymbolLinks()); - } - function getNodeLinks(node) { - const nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); - } - function getSymbol2(symbols, name, meaning) { - if (meaning) { - const symbol = getMergedSymbol(symbols.get(name)); - if (symbol) { - if (symbol.flags & meaning) { - return symbol; - } - if (symbol.flags & 2097152 /* Alias */) { - const targetFlags = getSymbolFlags(symbol); - if (targetFlags & meaning) { - return symbol; - } - } - } - } - } - function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { - const constructorDeclaration = parameter.parent; - const classDeclaration = parameter.parent.parent; - const parameterSymbol = getSymbol2(constructorDeclaration.locals, parameterName, 111551 /* Value */); - const propertySymbol = getSymbol2(getMembersOfSymbol(classDeclaration.symbol), parameterName, 111551 /* Value */); - if (parameterSymbol && propertySymbol) { - return [parameterSymbol, propertySymbol]; - } - return Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration"); - } - function isBlockScopedNameDeclaredBeforeUse(declaration, usage) { - const declarationFile = getSourceFileOfNode(declaration); - const useFile = getSourceFileOfNode(usage); - const declContainer = getEnclosingBlockScopeContainer(declaration); - if (declarationFile !== useFile) { - if (moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator) || !compilerOptions.outFile || isInTypeQuery(usage) || declaration.flags & 33554432 /* Ambient */) { - return true; - } - if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { - return true; - } - 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 === 209 /* BindingElement */) { - const errorBindingElement = getAncestor(usage, 209 /* BindingElement */); - if (errorBindingElement) { - return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos; - } - return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 261 /* VariableDeclaration */), usage); - } else if (declaration.kind === 261 /* VariableDeclaration */) { - return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); - } else if (isClassLike(declaration)) { - const container = findAncestor(usage, (n) => n === declaration ? "quit" : isComputedPropertyName(n) ? n.parent.parent === declaration : !legacyDecorators && isDecorator(n) && (n.parent === declaration || isMethodDeclaration(n.parent) && n.parent.parent === declaration || isGetOrSetAccessorDeclaration(n.parent) && n.parent.parent === declaration || isPropertyDeclaration(n.parent) && n.parent.parent === declaration || isParameter(n.parent) && n.parent.parent.parent === declaration)); - if (!container) { - return true; - } - if (!legacyDecorators && isDecorator(container)) { - return !!findAncestor(usage, (n) => n === container ? "quit" : isFunctionLike(n) && !getImmediatelyInvokedFunctionExpression(n)); - } - return false; - } else if (isPropertyDeclaration(declaration)) { - return !isPropertyImmediatelyReferencedWithinDeclaration( - declaration, - usage, - /*stopAtAnyPropertyDeclaration*/ - false - ); - } else if (isParameterPropertyDeclaration(declaration, declaration.parent)) { - return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration)); - } - return true; - } - if (usage.parent.kind === 282 /* ExportSpecifier */ || usage.parent.kind === 278 /* ExportAssignment */ && usage.parent.isExportEquals) { - return true; - } - if (usage.kind === 278 /* ExportAssignment */ && usage.isExportEquals) { - return true; - } - if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { - if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) { - return !isPropertyImmediatelyReferencedWithinDeclaration( - declaration, - usage, - /*stopAtAnyPropertyDeclaration*/ - true - ); - } else { - return true; - } - } - return false; - function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) { - switch (declaration2.parent.parent.kind) { - case 244 /* VariableStatement */: - case 249 /* ForStatement */: - case 251 /* ForOfStatement */: - if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) { - return true; - } - break; - } - const grandparent = declaration2.parent.parent; - return isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage2, grandparent.expression, declContainer); - } - function isUsedInFunctionOrInstanceProperty(usage2, declaration2) { - return isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2); - } - function isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2) { - return !!findAncestor(usage2, (current) => { - if (current === declContainer) { - return "quit"; - } - if (isFunctionLike(current)) { - return !getImmediatelyInvokedFunctionExpression(current); - } - if (isClassStaticBlockDeclaration(current)) { - return declaration2.pos < usage2.pos; - } - const propertyDeclaration = tryCast(current.parent, isPropertyDeclaration); - if (propertyDeclaration) { - const initializerOfProperty = propertyDeclaration.initializer === current; - if (initializerOfProperty) { - if (isStatic(current.parent)) { - if (declaration2.kind === 175 /* MethodDeclaration */) { - return true; - } - if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) { - const propName = declaration2.name; - if (isIdentifier(propName) || isPrivateIdentifier(propName)) { - const type = getTypeOfSymbol(getSymbolOfDeclaration(declaration2)); - const staticBlocks = filter(declaration2.parent.members, isClassStaticBlockDeclaration); - if (isPropertyInitializedInStaticBlocks(propName, type, staticBlocks, declaration2.parent.pos, current.pos)) { - return true; - } - } - } - } else { - const isDeclarationInstanceProperty = declaration2.kind === 173 /* PropertyDeclaration */ && !isStatic(declaration2); - if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) { - return true; - } - } - } - } - const decorator = tryCast(current.parent, isDecorator); - if (decorator && decorator.expression === current) { - if (isParameter(decorator.parent)) { - return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent.parent, declaration2) ? true : "quit"; - } - if (isMethodDeclaration(decorator.parent)) { - return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent, declaration2) ? true : "quit"; - } - } - return false; - }); - } - function isPropertyImmediatelyReferencedWithinDeclaration(declaration2, usage2, stopAtAnyPropertyDeclaration) { - if (usage2.end > declaration2.end) { - return false; - } - const ancestorChangingReferenceScope = findAncestor(usage2, (node) => { - if (node === declaration2) { - return "quit"; - } - switch (node.kind) { - case 220 /* ArrowFunction */: - return true; - case 173 /* PropertyDeclaration */: - return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true; - case 242 /* Block */: - switch (node.parent.kind) { - case 178 /* GetAccessor */: - case 175 /* MethodDeclaration */: - case 179 /* SetAccessor */: - return true; - default: - return false; - } - default: - return false; - } - }); - return ancestorChangingReferenceScope === void 0; - } - } - function getRequiresScopeChangeCache(node) { - return getNodeLinks(node).declarationRequiresScopeChange; - } - function setRequiresScopeChangeCache(node, value) { - getNodeLinks(node).declarationRequiresScopeChange = value; - } - function checkAndReportErrorForInvalidInitializer(errorLocation, name, propertyWithInvalidInitializer, result) { - if (!emitStandardClassFields) { - if (errorLocation && !result && checkAndReportErrorForMissingPrefix(errorLocation, name, name)) { - return true; - } - 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), - diagnosticName(name) - ); - return true; - } - return false; - } - function onFailedToResolveSymbol(errorLocation, nameArg, meaning, nameNotFoundMessage) { - const name = isString(nameArg) ? nameArg : nameArg.escapedText; - addLazyDiagnostic(() => { - if (!errorLocation || errorLocation.parent.kind !== 325 /* JSDocLink */ && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !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) { - error2(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), suggestedLib); - } - } - if (!suggestedLib && suggestionCount < maximumSuggestionCount) { - suggestion = getSuggestedSymbolForNonexistentSymbol(errorLocation, name, meaning); - const isGlobalScopeAugmentationDeclaration = (suggestion == null ? void 0 : suggestion.valueDeclaration) && isAmbientModule(suggestion.valueDeclaration) && isGlobalScopeAugmentation(suggestion.valueDeclaration); - if (isGlobalScopeAugmentationDeclaration) { - suggestion = void 0; - } - if (suggestion) { - const suggestionName = symbolToString(suggestion); - const isUncheckedJS = isUncheckedJSSuggestion( - errorLocation, - suggestion, - /*excludeClasses*/ - false - ); - const message = meaning === 1920 /* Namespace */ || nameArg && typeof nameArg !== "string" && nodeIsSynthesized(nameArg) ? Diagnostics.Cannot_find_namespace_0_Did_you_mean_1 : isUncheckedJS ? Diagnostics.Could_not_find_name_0_Did_you_mean_1 : Diagnostics.Cannot_find_name_0_Did_you_mean_1; - const diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName); - diagnostic.canonicalHead = getCanonicalDiagnostic(nameNotFoundMessage, diagnosticName(nameArg)); - addErrorOrSuggestion(!isUncheckedJS, diagnostic); - if (suggestion.valueDeclaration) { - addRelatedInfo( - diagnostic, - createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName) - ); - } - } - } - if (!suggestion && !suggestedLib && nameArg) { - error2(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); - } - suggestionCount++; - } - }); - } - function onSuccessfullyResolvedSymbol(errorLocation, result, meaning, lastLocation, associatedDeclarationForContainingInitializerOrBindingName, withinDeferredContext) { - addLazyDiagnostic(() => { - var _a; - const name = result.escapedName; - const isInExternalModule = lastLocation && isSourceFile(lastLocation) && isExternalOrCommonJsModule(lastLocation); - 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 (isInExternalModule && (meaning & 111551 /* Value */) === 111551 /* Value */ && !(errorLocation.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)); - } - } - if (associatedDeclarationForContainingInitializerOrBindingName && !withinDeferredContext && (meaning & 111551 /* Value */) === 111551 /* Value */) { - const candidate = getMergedSymbol(getLateBoundSymbol(result)); - const root = getRootDeclaration(associatedDeclarationForContainingInitializerOrBindingName); - if (candidate === getSymbolOfDeclaration(associatedDeclarationForContainingInitializerOrBindingName)) { - error2(errorLocation, Diagnostics.Parameter_0_cannot_reference_itself, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name)); - } else if (candidate.valueDeclaration && candidate.valueDeclaration.pos > associatedDeclarationForContainingInitializerOrBindingName.pos && root.parent.locals && getSymbol2(root.parent.locals, candidate.escapedName, meaning) === candidate) { - error2(errorLocation, Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), declarationNameToString(errorLocation)); - } - } - if (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 === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 281 /* 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( - error2(errorLocation, message, unescapedName), - typeOnlyDeclaration, - unescapedName - ); - } - } - if (compilerOptions.isolatedModules && result && isInExternalModule && (meaning & 111551 /* Value */) === 111551 /* Value */) { - const isGlobal = getSymbol2(globals, name, meaning) === result; - const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && getSymbol2(lastLocation.locals, name, ~111551 /* Value */); - if (nonValueSymbol) { - const importDecl = (_a = nonValueSymbol.declarations) == null ? void 0 : _a.find((d) => d.kind === 277 /* ImportSpecifier */ || d.kind === 274 /* ImportClause */ || d.kind === 275 /* NamespaceImport */ || d.kind === 272 /* 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)); - } - } - } - }); - } - function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) { - if (!typeOnlyDeclaration) return diagnostic; - return addRelatedInfo( - diagnostic, - createDiagnosticForNode( - typeOnlyDeclaration, - typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 281 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, - unescapedName - ) - ); - } - function diagnosticName(nameArg) { - return isString(nameArg) ? unescapeLeadingUnderscores(nameArg) : declarationNameToString(nameArg); - } - function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if (!isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { - return false; - } - const container = getThisContainer( - errorLocation, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - let location = container; - while (location) { - if (isClassLike(location.parent)) { - const classSymbol = getSymbolOfDeclaration(location.parent); - if (!classSymbol) { - break; - } - const constructorType = getTypeOfSymbol(classSymbol); - if (getPropertyOfType(constructorType, name)) { - 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)) { - error2(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); - return true; - } - } - } - location = location.parent; - } - return false; - } - function checkAndReportErrorForExtendingInterface(errorLocation) { - const expression = getEntityNameForExtendingInterface(errorLocation); - if (expression && resolveEntityName( - expression, - 64 /* Interface */, - /*ignoreErrors*/ - true - )) { - error2(errorLocation, Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, getTextOfNode(expression)); - return true; - } - return false; - } - function getEntityNameForExtendingInterface(node) { - switch (node.kind) { - case 80 /* Identifier */: - case 212 /* PropertyAccessExpression */: - return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0; - case 234 /* ExpressionWithTypeArguments */: - if (isEntityNameExpression(node.expression)) { - return node.expression; - } - // falls through - default: - return void 0; - } - } - function checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) { - const namespaceMeaning = 1920 /* Namespace */ | (isInJSFile(errorLocation) ? 111551 /* Value */ : 0); - if (meaning === namespaceMeaning) { - const symbol = resolveSymbol(resolveName( - errorLocation, - name, - 788968 /* Type */ & ~namespaceMeaning, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - )); - const parent2 = errorLocation.parent; - if (symbol) { - if (isQualifiedName(parent2)) { - Debug.assert(parent2.left === errorLocation, "Should only be resolving left side of qualified name as a namespace"); - const propName = parent2.right.escapedText; - const propType = getPropertyOfType(getDeclaredTypeOfSymbol(symbol), propName); - if (propType) { - 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), - unescapeLeadingUnderscores(propName) - ); - return true; - } - } - error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, unescapeLeadingUnderscores(name)); - return true; - } - } - return false; - } - function checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning) { - if (meaning & (788968 /* Type */ & ~1920 /* Namespace */)) { - const symbol = resolveSymbol(resolveName( - errorLocation, - name, - ~788968 /* Type */ & 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - )); - if (symbol && !(symbol.flags & 1920 /* Namespace */)) { - 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; - } - } - return false; - } - function isPrimitiveTypeName(name) { - return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; - } - function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 282 /* ExportSpecifier */) { - error2(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); - return true; - } - return false; - } - function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) { - if (meaning & 111551 /* Value */) { - if (isPrimitiveTypeName(name)) { - const grandparent = errorLocation.parent.parent; - if (grandparent && grandparent.parent && isHeritageClause(grandparent)) { - const heritageKind = grandparent.token; - const containerKind = grandparent.parent.kind; - if (containerKind === 265 /* 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 (isClassLike(grandparent.parent) && 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 (isClassLike(grandparent.parent) && 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 { - error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, unescapeLeadingUnderscores(name)); - } - return true; - } - const symbol = resolveSymbol(resolveName( - errorLocation, - name, - 788968 /* Type */ & ~111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - )); - const allFlags = symbol && getSymbolFlags(symbol); - if (symbol && allFlags !== void 0 && !(allFlags & 111551 /* Value */)) { - const rawName = unescapeLeadingUnderscores(name); - if (isES2015OrLaterConstructorName(name)) { - 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)) { - 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 { - error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); - } - return true; - } - } - 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) { - const type = getDeclaredTypeOfSymbol(symbol); - return !!(type.flags & 1048576 /* Union */) && allTypesAssignableToKind( - type, - 384 /* StringOrNumberLiteral */, - /*strict*/ - true - ); - } - return false; - } - function isES2015OrLaterConstructorName(n) { - switch (n) { - case "Promise": - case "Symbol": - case "Map": - case "WeakMap": - case "Set": - case "WeakSet": - return true; - } - return false; - } - function checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) { - if (meaning & (111551 /* Value */ & ~788968 /* Type */)) { - const symbol = resolveSymbol(resolveName( - errorLocation, - name, - 1024 /* NamespaceModule */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - )); - if (symbol) { - error2( - errorLocation, - Diagnostics.Cannot_use_namespace_0_as_a_value, - unescapeLeadingUnderscores(name) - ); - return true; - } - } else if (meaning & (788968 /* Type */ & ~111551 /* Value */)) { - const symbol = resolveSymbol(resolveName( - errorLocation, - name, - 1536 /* Module */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - )); - if (symbol) { - error2(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_type, unescapeLeadingUnderscores(name)); - return true; - } - } - return false; - } - function checkResolvedBlockScopedVariable(result, errorLocation) { - var _a; - Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); - if (result.flags & (16 /* Function */ | 1 /* FunctionScopedVariable */ | 67108864 /* Assignment */) && result.flags & 32 /* Class */) { - return; - } - const declaration = (_a = result.declarations) == null ? void 0 : _a.find( - (d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 267 /* EnumDeclaration */ - ); - if (declaration === void 0) return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); - if (!(declaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { - let diagnosticMessage; - const declarationName = declarationNameToString(getNameOfDeclaration(declaration)); - if (result.flags & 2 /* BlockScopedVariable */) { - diagnosticMessage = error2(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName); - } else if (result.flags & 32 /* Class */) { - diagnosticMessage = error2(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName); - } else if (result.flags & 256 /* RegularEnum */) { - diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName); - } else { - Debug.assert(!!(result.flags & 128 /* ConstEnum */)); - if (getIsolatedModules(compilerOptions)) { - diagnosticMessage = error2(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName); - } - } - if (diagnosticMessage) { - addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName)); - } - } - } - function isSameScopeDescendentOf(initial, parent2, stopAt) { - 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 272 /* ImportEqualsDeclaration */: - return node; - case 274 /* ImportClause */: - return node.parent; - case 275 /* NamespaceImport */: - return node.parent.parent; - case 277 /* ImportSpecifier */: - return node.parent.parent.parent; - default: - return void 0; - } - } - function getDeclarationOfAliasSymbol(symbol) { - return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration); - } - function isAliasSymbolDeclaration(node) { - return node.kind === 272 /* ImportEqualsDeclaration */ || node.kind === 271 /* NamespaceExportDeclaration */ || node.kind === 274 /* ImportClause */ && !!node.name || node.kind === 275 /* NamespaceImport */ || node.kind === 281 /* NamespaceExport */ || node.kind === 277 /* ImportSpecifier */ || node.kind === 282 /* ExportSpecifier */ || node.kind === 278 /* 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 === 305 /* ShorthandPropertyAssignment */ || node.kind === 304 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 261 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 209 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); - } - function isAliasableOrJsExpression(e) { - return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e); - } - function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - const commonJSPropertyAccess = getCommonJSPropertyAccess(node); - if (commonJSPropertyAccess) { - 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 === 284 /* ExternalModuleReference */) { - const immediate = resolveExternalModuleName( - node, - getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node) - ); - const resolved2 = resolveExternalModuleSymbol(immediate); - if (resolved2 && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) { - const moduleExports = getExportOfModule(resolved2, "module.exports", node, dontResolveAlias); - if (moduleExports) { - return moduleExports; - } - } - markSymbolOfAliasDeclarationIfTypeOnly( - node, - immediate, - resolved2, - /*overwriteEmpty*/ - false - ); - return resolved2; - } - const resolved = getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); - checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved); - return resolved; - } - function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) { - if (markSymbolOfAliasDeclarationIfTypeOnly( - node, - /*immediateTarget*/ - void 0, - resolved, - /*overwriteEmpty*/ - false - ) && !node.isTypeOnly) { - const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* 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 === 279 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name); - addRelatedInfo(error2(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); - } - } - function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { - const exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - const exportSymbol = exportValue ? getPropertyOfType( - getTypeOfSymbol(exportValue), - name, - /*skipObjectFunctionPropertyAugment*/ - true - ) : moduleSymbol.exports.get(name); - const resolved = resolveSymbol(exportSymbol, dontResolveAlias); - markSymbolOfAliasDeclarationIfTypeOnly( - sourceNode, - exportSymbol, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - function isSyntacticDefault(node) { - return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node); - } - function getEmitSyntaxForModuleSpecifierExpression(usage) { - return isStringLiteralLike(usage) ? host.getEmitSyntaxForUsageLocation(getSourceFileOfNode(usage), usage) : void 0; - } - function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) { - return usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */; - } - function isOnlyImportableAsDefault(usage, resolvedModule) { - if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) { - const usageMode = getEmitSyntaxForModuleSpecifierExpression(usage); - if (usageMode === 99 /* ESNext */) { - resolvedModule ?? (resolvedModule = resolveExternalModuleName( - usage, - usage, - /*ignoreErrors*/ - true - )); - const targetFile = resolvedModule && getSourceFileOfModule(resolvedModule); - return targetFile && (isJsonSourceFile(targetFile) || getDeclarationFileExtension(targetFile.fileName) === ".d.json.ts"); - } - } - return false; - } - function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) { - const usageMode = file && getEmitSyntaxForModuleSpecifierExpression(usage); - if (file && usageMode !== void 0) { - const targetMode = host.getImpliedNodeFormatForEmit(file); - if (usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */ && 100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) { - return true; - } - if (usageMode === 99 /* ESNext */ && targetMode === 99 /* ESNext */) { - return false; - } - } - if (!allowSyntheticDefaultImports) { - return false; - } - if (!file || file.isDeclarationFile) { - const defaultExportSymbol = resolveExportByName( - moduleSymbol, - "default" /* Default */, - /*sourceNode*/ - void 0, - /*dontResolveAlias*/ - true - ); - if (defaultExportSymbol && some(defaultExportSymbol.declarations, isSyntacticDefault)) { - return false; - } - if (resolveExportByName( - moduleSymbol, - escapeLeadingUnderscores("__esModule"), - /*sourceNode*/ - void 0, - dontResolveAlias - )) { - return false; - } - return true; - } - if (!isSourceFileJS(file)) { - return hasExportAssignmentSymbol(moduleSymbol); - } - return typeof file.externalModuleIndicator !== "object" && !resolveExportByName( - moduleSymbol, - escapeLeadingUnderscores("__esModule"), - /*sourceNode*/ - void 0, - dontResolveAlias - ); - } - function getTargetOfImportClause(node, dontResolveAlias) { - const moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); - if (moduleSymbol) { - return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias); - } - } - function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) { - var _a; - const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - const specifier = getModuleSpecifierForImportOrExport(node); - let exportDefaultSymbol; - let exportModuleDotExportsSymbol; - if (isShorthandAmbientModuleSymbol(moduleSymbol)) { - exportDefaultSymbol = moduleSymbol; - } else if (file && specifier && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && getEmitSyntaxForModuleSpecifierExpression(specifier) === 1 /* CommonJS */ && host.getImpliedNodeFormatForEmit(file) === 99 /* ESNext */ && (exportModuleDotExportsSymbol = resolveExportByName(moduleSymbol, "module.exports", node, dontResolveAlias))) { - if (!getESModuleInterop(compilerOptions)) { - error2(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), "esModuleInterop"); - return void 0; - } - markSymbolOfAliasDeclarationIfTypeOnly( - node, - exportModuleDotExportsSymbol, - /*finalTarget*/ - void 0, - /*overwriteEmpty*/ - false - ); - return exportModuleDotExportsSymbol; - } else { - exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias); - } - if (!specifier) { - return exportDefaultSymbol; - } - const hasDefaultOnly = isOnlyImportableAsDefault(specifier, moduleSymbol); - const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); - if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { - if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) { - const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; - const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */); - const exportAssignment = exportEqualsSymbol.valueDeclaration; - 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 - ) - ); - } - } else if (isImportClause(node)) { - reportNonDefaultExport(moduleSymbol, node); - } else { - errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, isImportOrExportSpecifier(node) && node.propertyName || node.name); - } - } else if (hasSyntheticDefault || hasDefaultOnly) { - const resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); - markSymbolOfAliasDeclarationIfTypeOnly( - node, - moduleSymbol, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - markSymbolOfAliasDeclarationIfTypeOnly( - node, - exportDefaultSymbol, - /*finalTarget*/ - void 0, - /*overwriteEmpty*/ - false - ); - return exportDefaultSymbol; - } - function getModuleSpecifierForImportOrExport(node) { - switch (node.kind) { - case 274 /* ImportClause */: - return node.parent.moduleSpecifier; - case 272 /* ImportEqualsDeclaration */: - return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0; - case 275 /* NamespaceImport */: - return node.parent.parent.moduleSpecifier; - case 277 /* ImportSpecifier */: - return node.parent.parent.parent.moduleSpecifier; - case 282 /* ExportSpecifier */: - return node.parent.parent.moduleSpecifier; - default: - return Debug.assertNever(node); - } - } - function reportNonDefaultExport(moduleSymbol, node) { - var _a, _b, _c; - if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has(node.symbol.escapedName)) { - 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 = 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 */))); - } - ); - if (defaultExport) { - addRelatedInfo(diagnostic, createDiagnosticForNode(defaultExport, Diagnostics.export_Asterisk_does_not_re_export_a_default)); - } - } - } - } - function getTargetOfNamespaceImport(node, dontResolveAlias) { - const moduleSpecifier = node.parent.parent.moduleSpecifier; - const immediate = resolveExternalModuleName(node, moduleSpecifier); - const resolved = resolveESModuleSymbol( - immediate, - moduleSpecifier, - dontResolveAlias, - /*suppressInteropError*/ - false - ); - markSymbolOfAliasDeclarationIfTypeOnly( - node, - immediate, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - function getTargetOfNamespaceExport(node, dontResolveAlias) { - const moduleSpecifier = node.parent.moduleSpecifier; - const immediate = moduleSpecifier && resolveExternalModuleName(node, moduleSpecifier); - const resolved = moduleSpecifier && resolveESModuleSymbol( - immediate, - moduleSpecifier, - dontResolveAlias, - /*suppressInteropError*/ - false - ); - markSymbolOfAliasDeclarationIfTypeOnly( - node, - immediate, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { - if (valueSymbol === unknownSymbol && typeSymbol === unknownSymbol) { - return unknownSymbol; - } - if (valueSymbol.flags & (788968 /* Type */ | 1920 /* Namespace */)) { - return valueSymbol; - } - const result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); - Debug.assert(valueSymbol.declarations || typeSymbol.declarations); - result.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues); - result.parent = valueSymbol.parent || typeSymbol.parent; - if (valueSymbol.valueDeclaration) result.valueDeclaration = valueSymbol.valueDeclaration; - if (typeSymbol.members) result.members = new Map(typeSymbol.members); - if (valueSymbol.exports) result.exports = new Map(valueSymbol.exports); - return result; - } - function getExportOfModule(symbol, nameText, specifier, dontResolveAlias) { - var _a; - if (symbol.flags & 1536 /* Module */) { - const exportSymbol = getExportsOfSymbol(symbol).get(nameText); - const resolved = resolveSymbol(exportSymbol, dontResolveAlias); - const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(nameText); - markSymbolOfAliasDeclarationIfTypeOnly( - specifier, - exportSymbol, - resolved, - /*overwriteEmpty*/ - false, - exportStarDeclaration, - nameText - ); - return resolved; - } - } - function getPropertyOfVariable(symbol, name) { - if (symbol.flags & 3 /* Variable */) { - const typeAnnotation = symbol.valueDeclaration.type; - if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); - } - } - } - function getExternalModuleMember(node, specifier, dontResolveAlias = false) { - var _a; - const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier; - const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); - const name = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; - if (!isIdentifier(name) && name.kind !== 11 /* StringLiteral */) { - return void 0; - } - const nameText = moduleExportNameTextEscaped(name); - const suppressInteropError = nameText === "default" /* Default */ && allowSyntheticDefaultImports; - const targetSymbol = resolveESModuleSymbol( - moduleSymbol, - moduleSpecifier, - /*dontResolveAlias*/ - false, - suppressInteropError - ); - if (targetSymbol) { - if (nameText || name.kind === 11 /* StringLiteral */) { - if (isShorthandAmbientModuleSymbol(moduleSymbol)) { - return moduleSymbol; - } - let symbolFromVariable; - if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=" /* ExportEquals */)) { - symbolFromVariable = getPropertyOfType( - getTypeOfSymbol(targetSymbol), - nameText, - /*skipObjectFunctionPropertyAugment*/ - true - ); - } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, nameText); - } - symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - let symbolFromModule = getExportOfModule(targetSymbol, nameText, specifier, dontResolveAlias); - if (symbolFromModule === void 0 && nameText === "default" /* Default */) { - const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - if (isOnlyImportableAsDefault(moduleSpecifier, moduleSymbol) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) { - symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); - } - } - const symbol = symbolFromModule && symbolFromVariable && symbolFromModule !== symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; - if (isImportOrExportSpecifier(specifier) && isOnlyImportableAsDefault(moduleSpecifier, moduleSymbol) && nameText !== "default" /* Default */) { - error2(name, Diagnostics.Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0, ModuleKind[moduleKind]); - } else if (!symbol) { - errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name); - } - return symbol; - } - } - } - function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) { - var _a; - const moduleName = getFullyQualifiedName(moduleSymbol, node); - const declarationName = declarationNameToString(name); - const suggestion = isIdentifier(name) ? getSuggestedSymbolForNonexistentModule(name, targetSymbol) : void 0; - if (suggestion !== void 0) { - const suggestionName = symbolToString(suggestion); - 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)); - } - } else { - if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has("default" /* Default */)) { - error2( - name, - Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, - moduleName, - declarationName - ); - } else { - reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName); - } - } - } - function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) { - var _a, _b; - const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(moduleExportNameTextEscaped(name)); - const exports2 = moduleSymbol.exports; - if (localSymbol) { - const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */); - if (exportedEqualsSymbol) { - getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) : error2(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); - } else { - const exportedSymbol = exports2 ? find(symbolsToArray(exports2), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0; - 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))); - } - } - } else { - 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; - 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; - 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; - error2(name, message, declarationName, declarationName, moduleName); - } - } - } - function getTargetOfImportSpecifier(node, dontResolveAlias) { - if (isImportSpecifier(node) && moduleExportNameIsDefault(node.propertyName || node.name)) { - const specifier = getModuleSpecifierForImportOrExport(node); - const moduleSymbol = specifier && resolveExternalModuleName(node, specifier); - if (moduleSymbol) { - return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias); - } - } - const root = isBindingElement(node) ? getRootDeclaration(node) : node.parent.parent.parent; - const commonJSPropertyAccess = getCommonJSPropertyAccess(root); - const resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias); - const name = node.propertyName || node.name; - if (commonJSPropertyAccess && resolved && isIdentifier(name)) { - return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias); - } - markSymbolOfAliasDeclarationIfTypeOnly( - node, - /*immediateTarget*/ - void 0, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - function getCommonJSPropertyAccess(node) { - if (isVariableDeclaration(node) && node.initializer && isPropertyAccessExpression(node.initializer)) { - return node.initializer; - } - } - function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { - if (canHaveSymbol(node.parent)) { - const resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); - markSymbolOfAliasDeclarationIfTypeOnly( - node, - /*immediateTarget*/ - void 0, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - } - function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) { - const name = node.propertyName || node.name; - if (moduleExportNameIsDefault(name)) { - const specifier = getModuleSpecifierForImportOrExport(node); - const moduleSymbol = specifier && resolveExternalModuleName(node, specifier); - if (moduleSymbol) { - return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias); - } - } - const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : name.kind === 11 /* StringLiteral */ ? void 0 : ( - // Skip for invalid syntax like this: export { "x" } - resolveEntityName( - name, - meaning, - /*ignoreErrors*/ - false, - dontResolveAlias - ) - ); - markSymbolOfAliasDeclarationIfTypeOnly( - node, - /*immediateTarget*/ - void 0, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - function getTargetOfExportAssignment(node, dontResolveAlias) { - const expression = isExportAssignment(node) ? node.expression : node.right; - const resolved = getTargetOfAliasLikeExpression(expression, dontResolveAlias); - markSymbolOfAliasDeclarationIfTypeOnly( - node, - /*immediateTarget*/ - void 0, - resolved, - /*overwriteEmpty*/ - false - ); - return resolved; - } - function getTargetOfAliasLikeExpression(expression, dontResolveAlias) { - if (isClassExpression(expression)) { - return checkExpressionCached(expression).symbol; - } - if (!isEntityName(expression) && !isEntityNameExpression(expression)) { - return void 0; - } - const aliasLike = resolveEntityName( - expression, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, - /*ignoreErrors*/ - true, - dontResolveAlias - ); - if (aliasLike) { - return aliasLike; - } - checkExpressionCached(expression); - return getNodeLinks(expression).resolvedSymbol; - } - function getTargetOfAccessExpression(node, dontRecursivelyResolve) { - if (!(isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */)) { - return void 0; - } - return getTargetOfAliasLikeExpression(node.parent.right, dontRecursivelyResolve); - } - function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) { - switch (node.kind) { - case 272 /* ImportEqualsDeclaration */: - case 261 /* VariableDeclaration */: - return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 274 /* ImportClause */: - return getTargetOfImportClause(node, dontRecursivelyResolve); - case 275 /* NamespaceImport */: - return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 281 /* NamespaceExport */: - return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 277 /* ImportSpecifier */: - case 209 /* BindingElement */: - return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 282 /* ExportSpecifier */: - return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 278 /* ExportAssignment */: - case 227 /* BinaryExpression */: - return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 271 /* NamespaceExportDeclaration */: - return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 305 /* ShorthandPropertyAssignment */: - return resolveEntityName( - node.name, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, - /*ignoreErrors*/ - true, - dontRecursivelyResolve - ); - case 304 /* PropertyAssignment */: - return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve); - case 213 /* ElementAccessExpression */: - case 212 /* PropertyAccessExpression */: - return getTargetOfAccessExpression(node, dontRecursivelyResolve); - default: - return Debug.fail(); - } - } - function isNonLocalAlias(symbol, excludes = 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */) { - if (!symbol) return false; - return (symbol.flags & (2097152 /* Alias */ | excludes)) === 2097152 /* Alias */ || !!(symbol.flags & 2097152 /* Alias */ && symbol.flags & 67108864 /* Assignment */); - } - function resolveSymbol(symbol, dontResolveAlias) { - return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol; - } - function resolveAlias(symbol) { - Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); - const links = getSymbolLinks(symbol); - if (!links.aliasTarget) { - links.aliasTarget = resolvingSymbol; - const node = getDeclarationOfAliasSymbol(symbol); - if (!node) return Debug.fail(); - const target = getTargetOfAliasDeclaration(node); - if (links.aliasTarget === resolvingSymbol) { - links.aliasTarget = target || unknownSymbol; - } else { - error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); - } - } else if (links.aliasTarget === resolvingSymbol) { - links.aliasTarget = unknownSymbol; - } - return links.aliasTarget; - } - function tryResolveAlias(symbol) { - const links = getSymbolLinks(symbol); - if (links.aliasTarget !== resolvingSymbol) { - return resolveAlias(symbol); - } - return void 0; - } - 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 = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol)); - if (!typeOnlyDeclarationIsExportStar && target === typeOnlyResolution || (typeOnlyExportStarTargets == null ? void 0 : typeOnlyExportStarTargets.get(target.escapedName)) === target) { - break; - } - if (target === unknownSymbol) { - return -1 /* All */; - } - if (target === symbol || (seenSymbols == null ? void 0 : seenSymbols.has(target))) { - break; - } - if (target.flags & 2097152 /* Alias */) { - if (seenSymbols) { - seenSymbols.add(target); - } else { - seenSymbols = /* @__PURE__ */ new Set([symbol, target]); - } - } - flags |= target.flags; - symbol = target; - } - return flags; - } - function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) { - if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration)) return false; - const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration); - if (isTypeOnlyImportOrExportDeclaration(aliasDeclaration)) { - const links2 = getSymbolLinks(sourceSymbol); - links2.typeOnlyDeclaration = aliasDeclaration; - return true; - } - if (exportStarDeclaration) { - const links2 = getSymbolLinks(sourceSymbol); - links2.typeOnlyDeclaration = exportStarDeclaration; - if (sourceSymbol.escapedName !== exportStarName) { - links2.typeOnlyExportStarName = exportStarName; - } - return true; - } - const links = getSymbolLinks(sourceSymbol); - return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty); - } - function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) { - var _a; - if (target && (aliasDeclarationLinks.typeOnlyDeclaration === void 0 || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) { - const exportSymbol = ((_a = target.exports) == null ? void 0 : _a.get("export=" /* ExportEquals */)) ?? target; - const typeOnly = exportSymbol.declarations && find(exportSymbol.declarations, isTypeOnlyImportOrExportDeclaration); - aliasDeclarationLinks.typeOnlyDeclaration = typeOnly ?? getSymbolLinks(exportSymbol).typeOnlyDeclaration ?? false; - } - return !!aliasDeclarationLinks.typeOnlyDeclaration; - } - function getTypeOnlyAliasDeclaration(symbol, include) { - var _a; - if (!(symbol.flags & 2097152 /* Alias */)) { - return void 0; - } - const links = getSymbolLinks(symbol); - if (links.typeOnlyDeclaration === void 0) { - links.typeOnlyDeclaration = false; - const resolved = resolveSymbol(symbol); - markSymbolOfAliasDeclarationIfTypeOnly( - (_a = symbol.declarations) == null ? void 0 : _a[0], - getDeclarationOfAliasSymbol(symbol) && getImmediateAliasedSymbol(symbol), - resolved, - /*overwriteEmpty*/ - true - ); - } - if (include === void 0) { - return links.typeOnlyDeclaration || void 0; - } - if (links.typeOnlyDeclaration) { - const resolved = links.typeOnlyDeclaration.kind === 279 /* 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; - } - function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) { - if (entityName.kind === 80 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; - } - if (entityName.kind === 80 /* Identifier */ || entityName.parent.kind === 167 /* QualifiedName */) { - return resolveEntityName( - entityName, - 1920 /* Namespace */, - /*ignoreErrors*/ - false, - dontResolveAlias - ); - } else { - Debug.assert(entityName.parent.kind === 272 /* ImportEqualsDeclaration */); - return resolveEntityName( - entityName, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, - /*ignoreErrors*/ - false, - dontResolveAlias - ); - } - } - function getFullyQualifiedName(symbol, containingLocation) { - return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString( - symbol, - containingLocation, - /*meaning*/ - void 0, - 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */ - ); - } - function getContainingQualifiedNameNode(node) { - while (isQualifiedName(node.parent)) { - node = node.parent; - } - return node; - } - function tryGetQualifiedNameAsValue(node) { - let left = getFirstIdentifier(node); - let symbol = resolveName( - left, - left, - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (!symbol) { - return void 0; - } - while (isQualifiedName(left.parent)) { - const type = getTypeOfSymbol(symbol); - symbol = getPropertyOfType(type, left.parent.right.escapedText); - if (!symbol) { - return void 0; - } - left = left.parent; - } - return symbol; - } - function resolveEntityName(name, meaning, ignoreErrors, dontResolveAlias, location) { - if (nodeIsMissing(name)) { - return void 0; - } - const namespaceMeaning = 1920 /* Namespace */ | (isInJSFile(name) ? meaning & 111551 /* Value */ : 0); - let symbol; - if (name.kind === 80 /* Identifier */) { - const message = meaning === namespaceMeaning || nodeIsSynthesized(name) ? Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(getFirstIdentifier(name)); - const symbolFromJSPrototype = isInJSFile(name) && !nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : void 0; - symbol = getMergedSymbol(resolveName( - location || name, - name, - meaning, - ignoreErrors || symbolFromJSPrototype ? void 0 : message, - /*isUse*/ - true, - /*excludeGlobals*/ - false - )); - if (!symbol) { - return getMergedSymbol(symbolFromJSPrototype); - } - } else if (name.kind === 167 /* QualifiedName */ || name.kind === 212 /* PropertyAccessExpression */) { - const left = name.kind === 167 /* QualifiedName */ ? name.left : name.expression; - const right = name.kind === 167 /* QualifiedName */ ? name.right : name.name; - let namespace = resolveEntityName( - left, - namespaceMeaning, - ignoreErrors, - /*dontResolveAlias*/ - false, - location - ); - if (!namespace || nodeIsMissing(right)) { - return void 0; - } else if (namespace === unknownSymbol) { - return namespace; - } - if (namespace.valueDeclaration && isInJSFile(namespace.valueDeclaration) && getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */ && isVariableDeclaration(namespace.valueDeclaration) && namespace.valueDeclaration.initializer && isCommonJsRequire(namespace.valueDeclaration.initializer)) { - const moduleName = namespace.valueDeclaration.initializer.arguments[0]; - const moduleSym = resolveExternalModuleName(moduleName, moduleName); - if (moduleSym) { - const resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); - if (resolvedModuleSymbol) { - namespace = resolvedModuleSymbol; - } - } - } - symbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(namespace), right.escapedText, meaning)); - if (!symbol && namespace.flags & 2097152 /* Alias */) { - symbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(resolveAlias(namespace)), right.escapedText, meaning)); - } - if (!symbol) { - if (!ignoreErrors) { - const namespaceName = getFullyQualifiedName(namespace); - const declarationName = declarationNameToString(right); - const suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace); - if (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) { - error2( - containingQualifiedName, - Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, - entityNameToString(containingQualifiedName) - ); - return void 0; - } - if (meaning & 1920 /* Namespace */ && isQualifiedName(name.parent)) { - const exportedTypeSymbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(namespace), right.escapedText, 788968 /* Type */)); - if (exportedTypeSymbol) { - 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), - unescapeLeadingUnderscores(name.parent.right.escapedText) - ); - return void 0; - } - } - error2(right, Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); - } - return void 0; - } - } else { - Debug.assertNever(name, "Unknown entity name kind."); - } - if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 278 /* ExportAssignment */)) { - markSymbolOfAliasDeclarationIfTypeOnly( - getAliasDeclarationFromName(name), - symbol, - /*finalTarget*/ - void 0, - /*overwriteEmpty*/ - true - ); - } - return symbol.flags & meaning || dontResolveAlias ? symbol : resolveAlias(symbol); - } - function resolveEntityNameFromAssignmentDeclaration(name, meaning) { - if (isJSDocTypeReference(name.parent)) { - const secondaryLocation = getAssignmentDeclarationLocation(name.parent); - if (secondaryLocation) { - return resolveName( - secondaryLocation, - name, - meaning, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - } - } - } - function getAssignmentDeclarationLocation(node) { - const typeAlias = findAncestor(node, (node2) => !(isJSDocNode(node2) || node2.flags & 16777216 /* JSDoc */) ? "quit" : isJSDocTypeAlias(node2)); - if (typeAlias) { - return; - } - const host2 = getJSDocHost(node); - if (host2 && isExpressionStatement(host2) && isPrototypePropertyAssignment(host2.expression)) { - const symbol = getSymbolOfDeclaration(host2.expression.left); - if (symbol) { - return getDeclarationOfJSPrototypeContainer(symbol); - } - } - if (host2 && isFunctionExpression(host2) && isPrototypePropertyAssignment(host2.parent) && isExpressionStatement(host2.parent.parent)) { - const symbol = getSymbolOfDeclaration(host2.parent.left); - if (symbol) { - return getDeclarationOfJSPrototypeContainer(symbol); - } - } - if (host2 && (isObjectLiteralMethod(host2) || isPropertyAssignment(host2)) && isBinaryExpression(host2.parent.parent) && getAssignmentDeclarationKind(host2.parent.parent) === 6 /* Prototype */) { - const symbol = getSymbolOfDeclaration(host2.parent.parent.left); - if (symbol) { - return getDeclarationOfJSPrototypeContainer(symbol); - } - } - const sig = getEffectiveJSDocHost(node); - if (sig && isFunctionLike(sig)) { - const symbol = getSymbolOfDeclaration(sig); - return symbol && symbol.valueDeclaration; - } - } - function getDeclarationOfJSPrototypeContainer(symbol) { - const decl = symbol.parent.valueDeclaration; - if (!decl) { - return void 0; - } - const initializer = isAssignmentDeclaration(decl) ? getAssignedExpandoInitializer(decl) : hasOnlyExpressionInitializer(decl) ? getDeclaredExpandoInitializer(decl) : void 0; - return initializer || decl; - } - function getExpandoSymbol(symbol) { - const decl = symbol.valueDeclaration; - if (!decl || !isInJSFile(decl) || symbol.flags & 524288 /* TypeAlias */ || getExpandoInitializer( - decl, - /*isPrototypeAssignment*/ - false - )) { - return void 0; - } - const init = isVariableDeclaration(decl) ? getDeclaredExpandoInitializer(decl) : getAssignedExpandoInitializer(decl); - if (init) { - const initSymbol = getSymbolOfNode(init); - if (initSymbol) { - return mergeJSSymbols(initSymbol, symbol); - } - } - } - function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { - 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; - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage, ignoreErrors); - } - function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, ignoreErrors = false, isForAugmentation = false) { - return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0; - } - function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; - if (errorNode && startsWith(moduleReference, "@types/")) { - const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1; - const withoutAtTypePrefix = removePrefix(moduleReference, "@types/"); - error2(errorNode, diag2, withoutAtTypePrefix, moduleReference); - } - const ambientModule = tryFindAmbientModule( - moduleReference, - /*withAugmentations*/ - true - ); - if (ambientModule) { - return ambientModule; - } - const currentSourceFile = getSourceFileOfNode(location); - 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, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression); - const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile); - const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions); - const resolvedModule = (_f = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _f.resolvedModule; - const resolutionDiagnostic = errorNode && 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) { - 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)); - if (errorNode && importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) { - 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 importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration)); - if (errorNode && !((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); - } - } else if (compilerOptions.rewriteRelativeImportExtensions && !(location.flags & 33554432 /* Ambient */) && !isDeclarationFileName(moduleReference) && !isLiteralImportTypeNode(location) && !isPartOfTypeOnlyImportOrExportDeclaration(location)) { - const shouldRewrite = shouldRewriteModuleSpecifier(moduleReference, compilerOptions); - if (!resolvedModule.resolvedUsingTsExtension && shouldRewrite) { - error2( - errorNode, - Diagnostics.This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0, - getRelativePathFromFile(getNormalizedAbsolutePath(currentSourceFile.fileName, host.getCurrentDirectory()), resolvedModule.resolvedFileName, hostGetCanonicalFileName(host)) - ); - } else if (resolvedModule.resolvedUsingTsExtension && !shouldRewrite && sourceFileMayBeEmitted(sourceFile, host)) { - error2( - errorNode, - Diagnostics.This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path, - getAnyExtensionFromPath(moduleReference) - ); - } else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) { - const redirect = (_i = host.getRedirectFromSourceFile(sourceFile.path)) == null ? void 0 : _i.resolvedRef; - if (redirect) { - const ignoreCase = !host.useCaseSensitiveFileNames(); - const ownRootDir = host.getCommonSourceDirectory(); - const otherRootDir = getCommonSourceDirectoryOfConfig(redirect.commandLine, ignoreCase); - const rootDirPath = getRelativePathFromDirectory(ownRootDir, otherRootDir, ignoreCase); - const outDirPath = getRelativePathFromDirectory(compilerOptions.outDir || ownRootDir, redirect.commandLine.options.outDir || otherRootDir, ignoreCase); - if (rootDirPath !== outDirPath) { - error2( - errorNode, - Diagnostics.This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files - ); - } - } - } - } - if (sourceFile.symbol) { - if (errorNode && resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) { - errorOnImplicitAnyModule( - /*isError*/ - false, - errorNode, - currentSourceFile, - mode, - resolvedModule, - moduleReference - ); - } - if (errorNode && (moduleKind === 100 /* Node16 */ || moduleKind === 101 /* Node18 */)) { - const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration); - const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l)); - if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) { - if (findAncestor(location, isImportEqualsDeclaration)) { - 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); - if (ext === ".ts" /* Ts */ || ext === ".js" /* Js */ || ext === ".tsx" /* Tsx */ || ext === ".jsx" /* Jsx */) { - diagnosticDetails = createModeMismatchDetails(currentSourceFile); - } - const message = (overrideHost == null ? void 0 : overrideHost.kind) === 273 /* ImportDeclaration */ && ((_j = overrideHost.importClause) == null ? void 0 : _j.isTypeOnly) ? Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : (overrideHost == null ? void 0 : overrideHost.kind) === 206 /* ImportType */ ? Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : 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; - diagnostics.add(createDiagnosticForNodeFromMessageChain( - getSourceFileOfNode(errorNode), - errorNode, - chainDiagnosticMessages(diagnosticDetails, message, moduleReference) - )); - } - } - } - return getMergedSymbol(sourceFile.symbol); - } - if (errorNode && moduleNotFoundError && !isSideEffectImport(errorNode)) { - error2(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName); - } - return void 0; - } - if (patternAmbientModules) { - const pattern = findBestPatternMatch(patternAmbientModules, (_) => _.pattern, moduleReference); - if (pattern) { - const augmentation = patternAmbientModuleAugmentations && patternAmbientModuleAugmentations.get(moduleReference); - if (augmentation) { - return getMergedSymbol(augmentation); - } - return getMergedSymbol(pattern.symbol); - } - } - if (!errorNode) { - return void 0; - } - 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; - error2(errorNode, diag2, moduleReference, resolvedModule.resolvedFileName); - } else { - errorOnImplicitAnyModule( - /*isError*/ - noImplicitAny && !!moduleNotFoundError, - errorNode, - currentSourceFile, - mode, - resolvedModule, - moduleReference - ); - } - return void 0; - } - if (moduleNotFoundError) { - if (resolvedModule) { - const redirect = host.getRedirectFromSourceFile(resolvedModule.resolvedFileName); - if (redirect == null ? void 0 : redirect.outputDts) { - error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, resolvedModule.resolvedFileName); - return void 0; - } - } - if (resolutionDiagnostic) { - 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)) { - 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 = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1]; - if (suggestedExt) { - 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 ((_l = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _l.alternateResult) { - const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference); - errorOrSuggestion( - /*isError*/ - true, - errorNode, - chainDiagnosticMessages(errorInfo, moduleNotFoundError, moduleReference) - ); - } else { - error2(errorNode, moduleNotFoundError, moduleReference); - } - } - } - } - return void 0; - function getSuggestedImportSource(tsExtension) { - const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); - if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99 /* ESNext */) { - const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions); - const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js"; - return importSourceWithoutExtension + ext; - } - return importSourceWithoutExtension; - } - } - function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) { - if (isSideEffectImport(errorNode)) { - return; - } - let errorInfo; - 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 - ) - ); - } - function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { - if (moduleSymbol == null ? void 0 : moduleSymbol.exports) { - const exportEquals = resolveSymbol(moduleSymbol.exports.get("export=" /* ExportEquals */), dontResolveAlias); - const exported = getCommonJsExportEquals(getMergedSymbol(exportEquals), getMergedSymbol(moduleSymbol)); - return getMergedSymbol(exported) || moduleSymbol; - } - return void 0; - } - function getCommonJsExportEquals(exported, moduleSymbol) { - if (!exported || exported === unknownSymbol || exported === moduleSymbol || moduleSymbol.exports.size === 1 || exported.flags & 2097152 /* Alias */) { - return exported; - } - const links = getSymbolLinks(exported); - if (links.cjsExportMerged) { - return links.cjsExportMerged; - } - const merged = exported.flags & 33554432 /* Transient */ ? exported : cloneSymbol(exported); - merged.flags = merged.flags | 512 /* ValueModule */; - if (merged.exports === void 0) { - merged.exports = createSymbolTable(); - } - moduleSymbol.exports.forEach((s, name) => { - if (name === "export=" /* ExportEquals */) return; - merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s); - }); - if (merged === exported) { - getSymbolLinks(merged).resolvedExports = void 0; - getSymbolLinks(merged).resolvedMembers = void 0; - } - getSymbolLinks(merged).cjsExportMerged = merged; - return links.cjsExportMerged = merged; - } - function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { - var _a; - const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); - if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 308 /* SourceFile */)) { - const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; - 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; - const namespaceImport = isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent); - if (namespaceImport || isImportCall(referenceParent)) { - const reference = isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier; - const type = getTypeOfSymbol(symbol); - const defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol, reference); - if (defaultOnlyType) { - return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent); - } - const targetFile = (_a = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - const usageMode = getEmitSyntaxForModuleSpecifierExpression(reference); - let exportModuleDotExportsSymbol; - if (namespaceImport && targetFile && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && usageMode === 1 /* CommonJS */ && host.getImpliedNodeFormatForEmit(targetFile) === 99 /* ESNext */ && (exportModuleDotExportsSymbol = resolveExportByName(symbol, "module.exports", namespaceImport, dontResolveAlias))) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { - error2(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, "esModuleInterop"); - } - if (getESModuleInterop(compilerOptions) && hasSignatures(type)) { - return cloneTypeAsModuleType(exportModuleDotExportsSymbol, type, referenceParent); - } - return exportModuleDotExportsSymbol; - } - const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(usageMode, host.getImpliedNodeFormatForEmit(targetFile)); - if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { - if (hasSignatures(type) || getPropertyOfType( - type, - "default" /* Default */, - /*skipObjectFunctionPropertyAugment*/ - true - ) || isEsmCjsRef) { - const moduleType = type.flags & 3670016 /* StructuredType */ ? getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference) : createDefaultPropertyWrapperForModule(symbol, symbol.parent); - return cloneTypeAsModuleType(symbol, moduleType, referenceParent); - } - } - } - } - return symbol; - } - function hasSignatures(type) { - return some(getSignaturesOfStructuredType(type, 0 /* Call */)) || some(getSignaturesOfStructuredType(type, 1 /* Construct */)); - } - function cloneTypeAsModuleType(symbol, moduleType, referenceParent) { - const result = createSymbol(symbol.flags, symbol.escapedName); - result.declarations = symbol.declarations ? symbol.declarations.slice() : []; - result.parent = symbol.parent; - result.links.target = symbol; - result.links.originatingImport = referenceParent; - if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; - if (symbol.constEnumOnlyModule) result.constEnumOnlyModule = true; - if (symbol.members) result.members = new Map(symbol.members); - if (symbol.exports) result.exports = new Map(symbol.exports); - const resolvedModuleType = resolveStructuredTypeMembers(moduleType); - result.links.type = createAnonymousType(result, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos); - return result; - } - function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports.get("export=" /* ExportEquals */) !== void 0; - } - function getExportsOfModuleAsArray(moduleSymbol) { - return symbolsToArray(getExportsOfModule(moduleSymbol)); - } - function getExportsAndPropertiesOfModule(moduleSymbol) { - const exports2 = getExportsOfModuleAsArray(moduleSymbol); - const exportEquals = resolveExternalModuleSymbol(moduleSymbol); - if (exportEquals !== moduleSymbol) { - const type = getTypeOfSymbol(exportEquals); - if (shouldTreatPropertiesOfExternalModuleAsExports(type)) { - addRange(exports2, getPropertiesOfType(type)); - } - } - return exports2; - } - function forEachExportAndPropertyOfModule(moduleSymbol, cb) { - const exports2 = getExportsOfModule(moduleSymbol); - exports2.forEach((symbol, key) => { - if (!isReservedMemberName(key)) { - cb(symbol, key); - } - }); - const exportEquals = resolveExternalModuleSymbol(moduleSymbol); - if (exportEquals !== moduleSymbol) { - const type = getTypeOfSymbol(exportEquals); - if (shouldTreatPropertiesOfExternalModuleAsExports(type)) { - forEachPropertyOfType(type, (symbol, escapedName) => { - cb(symbol, escapedName); - }); - } - } - } - function tryGetMemberInModuleExports(memberName, moduleSymbol) { - const symbolTable = getExportsOfModule(moduleSymbol); - if (symbolTable) { - return symbolTable.get(memberName); - } - } - function tryGetMemberInModuleExportsAndProperties(memberName, moduleSymbol) { - const symbol = tryGetMemberInModuleExports(memberName, moduleSymbol); - if (symbol) { - return symbol; - } - const exportEquals = resolveExternalModuleSymbol(moduleSymbol); - if (exportEquals === moduleSymbol) { - return void 0; - } - const type = getTypeOfSymbol(exportEquals); - return shouldTreatPropertiesOfExternalModuleAsExports(type) ? getPropertyOfType(type, memberName) : void 0; - } - function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) { - return !(resolvedExternalModuleType.flags & 402784252 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path - isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType)); - } - function getExportsOfSymbol(symbol) { - return symbol.flags & 6256 /* LateBindingContainer */ ? getResolvedMembersOrExportsOfSymbol(symbol, "resolvedExports" /* resolvedExports */) : symbol.flags & 1536 /* Module */ ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; - } - function getExportsOfModule(moduleSymbol) { - const links = getSymbolLinks(moduleSymbol); - if (!links.resolvedExports) { - const { exports: exports2, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol); - links.resolvedExports = exports2; - links.typeOnlyExportStarMap = typeOnlyExportStarMap; - } - return links.resolvedExports; - } - function extendExportSymbols(target, source, lookupTable, exportNode) { - if (!source) return; - source.forEach((sourceSymbol, id) => { - if (id === "default" /* Default */) return; - const targetSymbol = target.get(id); - if (!targetSymbol) { - target.set(id, sourceSymbol); - if (lookupTable && exportNode) { - lookupTable.set(id, { - specifierText: getTextOfNode(exportNode.moduleSpecifier) - }); - } - } else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { - const collisionTracker = lookupTable.get(id); - if (!collisionTracker.exportsWithDuplicate) { - collisionTracker.exportsWithDuplicate = [exportNode]; - } else { - collisionTracker.exportsWithDuplicate.push(exportNode); - } - } - }); - } - function getExportsOfModuleWorker(moduleSymbol) { - const visitedSymbols = []; - let typeOnlyExportStarMap; - const nonTypeOnlyNames = /* @__PURE__ */ new Set(); - moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); - const exports2 = visit(moduleSymbol) || emptySymbols; - if (typeOnlyExportStarMap) { - nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name)); - } - return { - exports: exports2, - typeOnlyExportStarMap - }; - function visit(symbol, exportStar, isTypeOnly) { - if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) { - symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name)); - } - if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) { - return; - } - const symbols = new Map(symbol.exports); - const exportStars = symbol.exports.get("__export" /* ExportStar */); - if (exportStars) { - const nestedSymbols = createSymbolTable(); - const lookupTable = /* @__PURE__ */ new Map(); - if (exportStars.declarations) { - for (const node of exportStars.declarations) { - const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); - const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly); - extendExportSymbols( - nestedSymbols, - exportedSymbols, - lookupTable, - node - ); - } - } - lookupTable.forEach(({ exportsWithDuplicate }, id) => { - if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { - return; - } - for (const node of exportsWithDuplicate) { - diagnostics.add(createDiagnosticForNode( - node, - Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, - lookupTable.get(id).specifierText, - unescapeLeadingUnderscores(id) - )); - } - }); - extendExportSymbols(symbols, nestedSymbols); - } - if (exportStar == null ? void 0 : exportStar.isTypeOnly) { - typeOnlyExportStarMap ?? (typeOnlyExportStarMap = /* @__PURE__ */ new Map()); - symbols.forEach( - (_, escapedName) => typeOnlyExportStarMap.set( - escapedName, - exportStar - ) - ); - } - return symbols; - } - } - function getMergedSymbol(symbol) { - let merged; - return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; - } - function getSymbolOfDeclaration(node) { - return getMergedSymbol(node.symbol && getLateBoundSymbol(node.symbol)); - } - function getSymbolOfNode(node) { - return canHaveSymbol(node) ? getSymbolOfDeclaration(node) : void 0; - } - 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) === 220 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 219 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol; - } - function getAlternativeContainingModules(symbol, enclosingDeclaration) { - const containingFile = getSourceFileOfNode(enclosingDeclaration); - const id = getNodeId(containingFile); - const links = getSymbolLinks(symbol); - let results; - if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { - return results; - } - if (containingFile && containingFile.imports) { - for (const importRef of containingFile.imports) { - if (nodeIsSynthesized(importRef)) continue; - const resolvedModule = resolveExternalModuleName( - enclosingDeclaration, - importRef, - /*ignoreErrors*/ - true - ); - if (!resolvedModule) continue; - const ref = getAliasForSymbolInContainer(resolvedModule, symbol); - if (!ref) continue; - results = append(results, resolvedModule); - } - if (length(results)) { - (links.extendedContainersByFile || (links.extendedContainersByFile = /* @__PURE__ */ new Map())).set(id, results); - return results; - } - } - if (links.extendedContainers) { - return links.extendedContainers; - } - const otherFiles = host.getSourceFiles(); - for (const file of otherFiles) { - if (!isExternalModule(file)) continue; - const sym = getSymbolOfDeclaration(file); - const ref = getAliasForSymbolInContainer(sym, symbol); - if (!ref) continue; - results = append(results, sym); - } - return links.extendedContainers = results || emptyArray; - } - function getContainersOfSymbol(symbol, enclosingDeclaration, meaning) { - const container = getParentOfSymbol(symbol); - if (container && !(symbol.flags & 262144 /* TypeParameter */)) { - return getWithAlternativeContainers(container); - } - const candidates = mapDefined(symbol.declarations, (d) => { - if (!isAmbientModule(d) && d.parent) { - if (hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) { - return getSymbolOfDeclaration(d.parent); - } - if (isModuleBlock(d.parent) && d.parent.parent && resolveExternalModuleSymbol(getSymbolOfDeclaration(d.parent.parent)) === symbol) { - return getSymbolOfDeclaration(d.parent.parent); - } - } - if (isClassExpression(d) && isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 64 /* EqualsToken */ && isAccessExpression(d.parent.left) && isEntityNameExpression(d.parent.left.expression)) { - if (isModuleExportsAccessExpression(d.parent.left) || isExportsIdentifier(d.parent.left.expression)) { - return getSymbolOfDeclaration(getSourceFileOfNode(d)); - } - checkExpressionCached(d.parent.left.expression); - return getNodeLinks(d.parent.left.expression).resolvedSymbol; - } - }); - if (!length(candidates)) { - return 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); - } - } - function getVariableDeclarationOfObjectLiteral(symbol, meaning) { - const firstDecl = !!length(symbol.declarations) && first(symbol.declarations); - if (meaning & 111551 /* Value */ && firstDecl && firstDecl.parent && isVariableDeclaration(firstDecl.parent)) { - if (isObjectLiteralExpression(firstDecl) && firstDecl === firstDecl.parent.initializer || isTypeLiteralNode(firstDecl) && firstDecl === firstDecl.parent.type) { - return getSymbolOfDeclaration(firstDecl.parent); - } - } - } - function getFileSymbolIfFileSymbolExportEqualsContainer(d, container) { - const fileSymbol = getExternalModuleContainer(d); - const exported = fileSymbol && fileSymbol.exports && fileSymbol.exports.get("export=" /* ExportEquals */); - return exported && getSymbolIfSameReference(exported, container) ? fileSymbol : void 0; - } - function getAliasForSymbolInContainer(container, symbol) { - if (container === getParentOfSymbol(symbol)) { - return symbol; - } - const exportEquals = container.exports && container.exports.get("export=" /* ExportEquals */); - if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) { - return container; - } - const exports2 = getExportsOfSymbol(container); - const quick = exports2.get(symbol.escapedName); - if (quick && getSymbolIfSameReference(quick, symbol)) { - return quick; - } - return forEachEntry(exports2, (exported) => { - if (getSymbolIfSameReference(exported, symbol)) { - return exported; - } - }); - } - function getSymbolIfSameReference(s1, s2) { - if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s2)))) { - return s1; - } - } - function getExportSymbolOfValueSymbolIfExported(symbol) { - return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 && symbol.exportSymbol || symbol); - } - function symbolIsValue(symbol, includeTypeOnlyMembers) { - return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */); - } - function createType(flags) { - var _a; - const result = new Type29(checker, flags); - typeCount++; - result.id = typeCount; - (_a = tracing) == null ? void 0 : _a.recordType(result); - return result; - } - function createTypeWithSymbol(flags, symbol) { - const result = createType(flags); - result.symbol = symbol; - return result; - } - function createOriginType(flags) { - return new Type29(checker, flags); - } - function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */, debugIntrinsicName) { - checkIntrinsicName(intrinsicName, debugIntrinsicName); - const type = createType(kind); - type.intrinsicName = intrinsicName; - 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; - type.members = void 0; - type.properties = void 0; - type.callSignatures = void 0; - type.constructSignatures = void 0; - type.indexInfos = void 0; - return type; - } - function createTypeofType() { - return getUnionType(arrayFrom(typeofNEFacts.keys(), getStringLiteralType)); - } - function createTypeParameter(symbol) { - return createTypeWithSymbol(262144 /* TypeParameter */, symbol); - } - function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) !== 95 /* _ */ && name.charCodeAt(2) !== 64 /* at */ && name.charCodeAt(2) !== 35 /* hash */; - } - function getNamedMembers(members) { - let result; - members.forEach((symbol, id) => { - if (isNamedMember(symbol, id)) { - (result || (result = [])).push(symbol); - } - }); - return result || emptyArray; - } - function isNamedMember(member, escapedName) { - return !isReservedMemberName(escapedName) && symbolIsValue(member); - } - function getNamedOrIndexSignatureMembers(members) { - const result = getNamedMembers(members); - const index = getIndexSymbolFromSymbolTable(members); - return index ? concatenate(result, [index]) : result; - } - function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos) { - const resolved = type; - resolved.members = members; - resolved.properties = emptyArray; - resolved.callSignatures = callSignatures; - resolved.constructSignatures = constructSignatures; - resolved.indexInfos = indexInfos; - if (members !== emptySymbols) resolved.properties = getNamedMembers(members); - return resolved; - } - function createAnonymousType(symbol, members, callSignatures, constructSignatures, indexInfos) { - return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, indexInfos); - } - function getResolvedTypeWithoutAbstractConstructSignatures(type) { - if (type.constructSignatures.length === 0) return type; - if (type.objectTypeWithoutAbstractConstructSignatures) return type.objectTypeWithoutAbstractConstructSignatures; - const constructSignatures = filter(type.constructSignatures, (signature) => !(signature.flags & 4 /* Abstract */)); - if (type.constructSignatures === constructSignatures) return type; - const typeCopy = createAnonymousType( - type.symbol, - type.members, - type.callSignatures, - some(constructSignatures) ? constructSignatures : emptyArray, - type.indexInfos - ); - type.objectTypeWithoutAbstractConstructSignatures = typeCopy; - typeCopy.objectTypeWithoutAbstractConstructSignatures = typeCopy; - return typeCopy; - } - function forEachSymbolTableInScope(enclosingDeclaration, callback) { - let result; - for (let location = enclosingDeclaration; location; location = location.parent) { - if (canHaveLocals(location) && location.locals && !isGlobalSourceFile(location)) { - if (result = callback( - location.locals, - /*ignoreQualification*/ - void 0, - /*isLocalNameLookup*/ - true, - location - )) { - return result; - } - } - switch (location.kind) { - case 308 /* SourceFile */: - if (!isExternalOrCommonJsModule(location)) { - break; - } - // falls through - case 268 /* ModuleDeclaration */: - const sym = getSymbolOfDeclaration(location); - if (result = callback( - (sym == null ? void 0 : sym.exports) || emptySymbols, - /*ignoreQualification*/ - void 0, - /*isLocalNameLookup*/ - true, - location - )) { - return result; - } - break; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - let table; - (getSymbolOfDeclaration(location).members || emptySymbols).forEach((memberSymbol, key) => { - if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) { - (table || (table = createSymbolTable())).set(key, memberSymbol); - } - }); - if (table && (result = callback( - table, - /*ignoreQualification*/ - void 0, - /*isLocalNameLookup*/ - false, - location - ))) { - return result; - } - break; - } - } - return callback( - globals, - /*ignoreQualification*/ - void 0, - /*isLocalNameLookup*/ - true - ); - } - function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === 111551 /* Value */ ? 111551 /* Value */ : 1920 /* Namespace */; - } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing, visitedSymbolTablesMap = /* @__PURE__ */ new Map()) { - if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) { - return void 0; - } - const links = getSymbolLinks(symbol); - const cache = links.accessibleChainCache || (links.accessibleChainCache = /* @__PURE__ */ new Map()); - const firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, (_, __, ___, node) => node); - const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation ? getNodeId(firstRelevantLocation) : 0}|${meaning}`; - if (cache.has(key)) { - return cache.get(key); - } - const id = getSymbolId(symbol); - let visitedSymbolTables = visitedSymbolTablesMap.get(id); - if (!visitedSymbolTables) { - visitedSymbolTablesMap.set(id, visitedSymbolTables = []); - } - const result = forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - cache.set(key, result); - return result; - function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification, isLocalNameLookup) { - if (!pushIfUnique(visitedSymbolTables, symbols)) { - return void 0; - } - const result2 = trySymbolTable(symbols, ignoreQualification, isLocalNameLookup); - visitedSymbolTables.pop(); - return result2; - } - function canQualifySymbol(symbolFromSymbolTable, meaning2) { - return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning2) || // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too - !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning2), useOnlyExternalAliasing, visitedSymbolTablesMap); - } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { - return (symbol === (resolvedAliasSymbol || symbolFromSymbolTable) || getMergedSymbol(symbol) === getMergedSymbol(resolvedAliasSymbol || symbolFromSymbolTable)) && // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) - // and if symbolFromSymbolTable or alias resolution matches the symbol, - // check the symbol can be qualified, it is only then this symbol is accessible - !some(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) && (ignoreQualification || canQualifySymbol(getMergedSymbol(symbolFromSymbolTable), meaning)); - } - function trySymbolTable(symbols, ignoreQualification, isLocalNameLookup) { - if (isAccessible( - symbols.get(symbol.escapedName), - /*resolvedAliasSymbol*/ - void 0, - ignoreQualification - )) { - 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, 282 /* ExportSpecifier */))) { - const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); - if (candidate) { - return candidate; - } - } - if (symbolFromSymbolTable.escapedName === symbol.escapedName && symbolFromSymbolTable.exportSymbol) { - if (isAccessible( - getMergedSymbol(symbolFromSymbolTable.exportSymbol), - /*resolvedAliasSymbol*/ - void 0, - ignoreQualification - )) { - return [symbol]; - } - } - }); - return result2 || (symbols === globals ? getCandidateListForSymbol(globalThisSymbol, globalThisSymbol, ignoreQualification) : void 0); - } - function getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification) { - if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { - return [symbolFromSymbolTable]; - } - const candidateTable = getExportsOfSymbol(resolvedImportedSymbol); - const accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable( - candidateTable, - /*ignoreQualification*/ - true - ); - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); - } - } - } - function needsQualification(symbol, enclosingDeclaration, meaning) { - let qualify = false; - forEachSymbolTableInScope(enclosingDeclaration, (symbolTable) => { - let symbolFromSymbolTable = getMergedSymbol(symbolTable.get(symbol.escapedName)); - if (!symbolFromSymbolTable) { - return false; - } - if (symbolFromSymbolTable === symbol) { - return true; - } - const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 282 /* ExportSpecifier */); - symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; - const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags; - if (flags & meaning) { - qualify = true; - return true; - } - return false; - }); - return qualify; - } - function isPropertyOrMethodDeclarationSymbol(symbol) { - if (symbol.declarations && symbol.declarations.length) { - for (const declaration of symbol.declarations) { - switch (declaration.kind) { - case 173 /* PropertyDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - continue; - default: - return false; - } - } - return true; - } - return false; - } - function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { - const access = isSymbolAccessibleWorker( - typeSymbol, - enclosingDeclaration, - 788968 /* Type */, - /*shouldComputeAliasesToMakeVisible*/ - false, - /*allowModules*/ - true - ); - return access.accessibility === 0 /* Accessible */; - } - function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { - const access = isSymbolAccessibleWorker( - typeSymbol, - enclosingDeclaration, - 111551 /* Value */, - /*shouldComputeAliasesToMakeVisible*/ - false, - /*allowModules*/ - true - ); - return access.accessibility === 0 /* Accessible */; - } - function isSymbolAccessibleByFlags(typeSymbol, enclosingDeclaration, flags) { - const access = isSymbolAccessibleWorker( - typeSymbol, - enclosingDeclaration, - flags, - /*shouldComputeAliasesToMakeVisible*/ - false, - /*allowModules*/ - false - ); - return access.accessibility === 0 /* Accessible */; - } - function isAnySymbolAccessible(symbols, enclosingDeclaration, initialSymbol, meaning, shouldComputeAliasesToMakeVisible, allowModules) { - if (!length(symbols)) return; - let hadAccessibleChain; - let earlyModuleBail = false; - for (const symbol of symbols) { - const accessibleSymbolChain = getAccessibleSymbolChain( - symbol, - enclosingDeclaration, - meaning, - /*useOnlyExternalAliasing*/ - false - ); - if (accessibleSymbolChain) { - hadAccessibleChain = symbol; - const hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0], shouldComputeAliasesToMakeVisible); - if (hasAccessibleDeclarations) { - return hasAccessibleDeclarations; - } - } - if (allowModules) { - if (some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { - if (shouldComputeAliasesToMakeVisible) { - earlyModuleBail = true; - continue; - } - return { - accessibility: 0 /* Accessible */ - }; - } - } - const containers = getContainersOfSymbol(symbol, enclosingDeclaration, meaning); - const parentResult = isAnySymbolAccessible(containers, enclosingDeclaration, initialSymbol, initialSymbol === symbol ? getQualifiedLeftMeaning(meaning) : meaning, shouldComputeAliasesToMakeVisible, allowModules); - if (parentResult) { - return parentResult; - } - } - if (earlyModuleBail) { - return { - accessibility: 0 /* Accessible */ - }; - } - if (hadAccessibleChain) { - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: hadAccessibleChain !== initialSymbol ? symbolToString(hadAccessibleChain, enclosingDeclaration, 1920 /* Namespace */) : void 0 - }; - } - } - function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { - return isSymbolAccessibleWorker( - symbol, - enclosingDeclaration, - meaning, - shouldComputeAliasesToMakeVisible, - /*allowModules*/ - true - ); - } - function isSymbolAccessibleWorker(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible, allowModules) { - if (symbol && enclosingDeclaration) { - const result = isAnySymbolAccessible([symbol], enclosingDeclaration, symbol, meaning, shouldComputeAliasesToMakeVisible, allowModules); - if (result) { - return result; - } - const symbolExternalModule = forEach(symbol.declarations, getExternalModuleContainer); - if (symbolExternalModule) { - const enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); - if (symbolExternalModule !== enclosingExternalModule) { - return { - accessibility: 2 /* CannotBeNamed */, - errorSymbolName: symbolToString(symbol, enclosingDeclaration, meaning), - errorModuleName: symbolToString(symbolExternalModule), - errorNode: isInJSFile(enclosingDeclaration) ? enclosingDeclaration : void 0 - }; - } - } - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(symbol, enclosingDeclaration, meaning) - }; - } - return { accessibility: 0 /* Accessible */ }; - } - function getExternalModuleContainer(declaration) { - const node = findAncestor(declaration, hasExternalModuleSymbol); - return node && getSymbolOfDeclaration(node); - } - function hasExternalModuleSymbol(declaration) { - return isAmbientModule(declaration) || declaration.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(declaration); - } - function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return isModuleWithStringLiteralName(declaration) || declaration.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(declaration); - } - function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { - let aliasesToMakeVisible; - if (!every(filter(symbol.declarations, (d) => d.kind !== 80 /* Identifier */), getIsDeclarationVisible)) { - return void 0; - } - return { accessibility: 0 /* Accessible */, aliasesToMakeVisible }; - function getIsDeclarationVisible(declaration) { - var _a, _b; - if (!isDeclarationVisible(declaration)) { - const anyImportSyntax = getAnyImportSyntax(declaration); - 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, 32 /* Export */) && // unexported variable statement - isDeclarationVisible(declaration.parent.parent.parent)) { - return addVisibleAlias(declaration, declaration.parent.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, 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 rootDeclaration = walkUpBindingElementsAndPatterns(declaration); - if (rootDeclaration.kind === 170 /* Parameter */) { - return false; - } - const variableStatement = rootDeclaration.parent.parent; - if (variableStatement.kind !== 244 /* VariableStatement */) { - return false; - } - if (hasSyntacticModifier(variableStatement, 32 /* Export */)) { - return true; - } - if (!isDeclarationVisible(variableStatement.parent)) { - return false; - } - return addVisibleAlias(declaration, variableStatement); - } - } - return false; - } - return true; - } - function addVisibleAlias(declaration, aliasingStatement) { - if (shouldComputeAliasToMakeVisible) { - getNodeLinks(declaration).isVisible = true; - aliasesToMakeVisible = appendIfUnique(aliasesToMakeVisible, aliasingStatement); - } - return true; - } - } - function getMeaningOfEntityNameReference(entityName) { - let meaning; - if (entityName.parent.kind === 187 /* TypeQuery */ || entityName.parent.kind === 234 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 168 /* ComputedPropertyName */ || entityName.parent.kind === 183 /* TypePredicate */ && entityName.parent.parameterName === entityName) { - meaning = 111551 /* Value */ | 1048576 /* ExportValue */; - } else if (entityName.kind === 167 /* QualifiedName */ || entityName.kind === 212 /* PropertyAccessExpression */ || entityName.parent.kind === 272 /* ImportEqualsDeclaration */ || entityName.parent.kind === 167 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 212 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 213 /* ElementAccessExpression */ && entityName.parent.expression === entityName) { - meaning = 1920 /* Namespace */; - } else { - meaning = 788968 /* Type */; - } - return meaning; - } - function isEntityNameVisible(entityName, enclosingDeclaration, shouldComputeAliasToMakeVisible = true) { - const meaning = getMeaningOfEntityNameReference(entityName); - const firstIdentifier = getFirstIdentifier(entityName); - const symbol = resolveName( - enclosingDeclaration, - firstIdentifier.escapedText, - meaning, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - if (symbol && symbol.flags & 262144 /* TypeParameter */ && meaning & 788968 /* Type */) { - return { accessibility: 0 /* Accessible */ }; - } - if (!symbol && isThisIdentifier(firstIdentifier) && isSymbolAccessible( - getSymbolOfDeclaration(getThisContainer( - firstIdentifier, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - )), - firstIdentifier, - meaning, - /*shouldComputeAliasesToMakeVisible*/ - false - ).accessibility === 0 /* Accessible */) { - return { accessibility: 0 /* Accessible */ }; - } - if (!symbol) { - return { - accessibility: 3 /* NotResolved */, - errorSymbolName: getTextOfNode(firstIdentifier), - errorNode: firstIdentifier - }; - } - return hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) || { - accessibility: 1 /* NotAccessible */, - errorSymbolName: getTextOfNode(firstIdentifier), - errorNode: firstIdentifier - }; - } - function symbolToString(symbol, enclosingDeclaration, meaning, flags = 4 /* AllowAnyNodeKind */, writer) { - let nodeFlags = 70221824 /* IgnoreErrors */; - let internalNodeFlags = 0 /* None */; - if (flags & 2 /* UseOnlyExternalAliasing */) { - nodeFlags |= 128 /* UseOnlyExternalAliasing */; - } - if (flags & 1 /* WriteTypeParametersOrArguments */) { - nodeFlags |= 512 /* WriteTypeParametersInQualifiedName */; - } - if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) { - nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; - } - if (flags & 32 /* DoNotIncludeSymbolChain */) { - internalNodeFlags |= 4 /* DoNotIncludeSymbolChain */; - } - if (flags & 16 /* WriteComputedProps */) { - internalNodeFlags |= 1 /* WriteComputedProps */; - } - const builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName; - return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); - function symbolToStringWorker(writer2) { - const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags, internalNodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); - const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); - printer.writeNode( - 4 /* Unspecified */, - entity, - /*sourceFile*/ - sourceFile, - writer2 - ); - return writer2; - } - } - function signatureToString(signature, enclosingDeclaration, flags = 0 /* None */, kind, writer, maximumLength, verbosityLevel, out) { - return writer ? signatureToStringWorker(writer).getText() : usingSingleLineStringWriter(signatureToStringWorker); - function signatureToStringWorker(writer2) { - let sigOutput; - if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 186 /* ConstructorType */ : 185 /* FunctionType */; - } else { - sigOutput = kind === 1 /* Construct */ ? 181 /* ConstructSignature */ : 180 /* CallSignature */; - } - const sig = nodeBuilder.signatureToSignatureDeclaration( - signature, - sigOutput, - enclosingDeclaration, - toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */, - /*internalFlags*/ - void 0, - /*tracker*/ - void 0, - maximumLength, - verbosityLevel, - out - ); - const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); - const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); - printer.writeNode( - 4 /* Unspecified */, - sig, - /*sourceFile*/ - sourceFile, - getTrailingSemicolonDeferringWriter(writer2) - ); - return writer2; - } - } - function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), maximumLength, verbosityLevel, out) { - const noTruncation = !maximumLength && compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; - const typeNode = nodeBuilder.typeToTypeNode( - type, - enclosingDeclaration, - toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), - /*internalFlags*/ - void 0, - /*tracker*/ - void 0, - maximumLength, - verbosityLevel, - out - ); - if (typeNode === void 0) return Debug.fail("should always get typenode"); - const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); - const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); - printer.writeNode( - 4 /* Unspecified */, - typeNode, - /*sourceFile*/ - sourceFile, - writer - ); - const result = writer.getText(); - const maxLength2 = maximumLength || (noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2); - if (maxLength2 && result && result.length >= maxLength2) { - return result.substr(0, maxLength2 - "...".length) + "..."; - } - return result; - } - function getTypeNamesForErrorDisplay(left, right) { - let leftStr = symbolValueDeclarationIsContextSensitive(left.symbol) ? typeToString(left, left.symbol.valueDeclaration) : typeToString(left); - let rightStr = symbolValueDeclarationIsContextSensitive(right.symbol) ? typeToString(right, right.symbol.valueDeclaration) : typeToString(right); - if (leftStr === rightStr) { - leftStr = getTypeNameForErrorDisplay(left); - rightStr = getTypeNameForErrorDisplay(right); - } - return [leftStr, rightStr]; - } - function getTypeNameForErrorDisplay(type) { - return typeToString( - type, - /*enclosingDeclaration*/ - void 0, - 64 /* UseFullyQualifiedType */ - ); - } - function symbolValueDeclarationIsContextSensitive(symbol) { - return symbol && !!symbol.valueDeclaration && isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration); - } - function toNodeBuilderFlags(flags = 0 /* None */) { - 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 */)); - } - function getTypeFromTypeNodeWithoutContext(node) { - return getTypeFromTypeNode(node); - } - function createNodeBuilder() { - const syntacticBuilderResolver = { - evaluateEntityNameExpression, - isExpandoFunctionDeclaration, - hasLateBindableName, - shouldRemoveDeclaration(context, node) { - return !(context.internalFlags & 8 /* AllowUnresolvedNames */ && isEntityNameExpression(node.name.expression) && checkComputedPropertyName(node.name).flags & 1 /* Any */); - }, - createRecoveryBoundary(context) { - return createRecoveryBoundary(context); - }, - isDefinitelyReferenceToGlobalSymbolObject, - getAllAccessorDeclarations: getAllAccessorDeclarationsForDeclaration, - requiresAddingImplicitUndefined(declaration, symbol, enclosingDeclaration) { - var _a; - switch (declaration.kind) { - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 349 /* JSDocPropertyTag */: - symbol ?? (symbol = getSymbolOfDeclaration(declaration)); - const type = getTypeOfSymbol(symbol); - return !!(symbol.flags & 4 /* Property */ && symbol.flags & 16777216 /* Optional */ && isOptionalDeclaration(declaration) && ((_a = symbol.links) == null ? void 0 : _a.mappedType) && containsNonMissingUndefinedType(type)); - case 170 /* Parameter */: - case 342 /* JSDocParameterTag */: - return requiresAddingImplicitUndefined(declaration, enclosingDeclaration); - default: - Debug.assertNever(declaration); - } - }, - isOptionalParameter, - isUndefinedIdentifierExpression(node) { - return getSymbolAtLocation(node) === undefinedSymbol; - }, - isEntityNameVisible(context, entityName, shouldComputeAliasToMakeVisible) { - return isEntityNameVisible(entityName, context.enclosingDeclaration, shouldComputeAliasToMakeVisible); - }, - serializeExistingTypeNode(context, typeNode, addUndefined) { - return serializeExistingTypeNode(context, typeNode, !!addUndefined); - }, - serializeReturnTypeForSignature(syntacticContext, signatureDeclaration, symbol) { - const context = syntacticContext; - const signature = getSignatureFromDeclaration(signatureDeclaration); - symbol ?? (symbol = getSymbolOfDeclaration(signatureDeclaration)); - const returnType = context.enclosingSymbolTypes.get(getSymbolId(symbol)) ?? instantiateType(getReturnTypeOfSignature(signature), context.mapper); - return serializeInferredReturnTypeForSignature(context, signature, returnType); - }, - serializeTypeOfExpression(syntacticContext, expr) { - const context = syntacticContext; - const type = instantiateType(getWidenedType(getRegularTypeOfExpression(expr)), context.mapper); - return typeToTypeNodeHelper(type, context); - }, - serializeTypeOfDeclaration(syntacticContext, declaration, symbol) { - var _a; - const context = syntacticContext; - symbol ?? (symbol = getSymbolOfDeclaration(declaration)); - let type = (_a = context.enclosingSymbolTypes) == null ? void 0 : _a.get(getSymbolId(symbol)); - if (type === void 0) { - type = symbol.flags & 98304 /* Accessor */ && declaration.kind === 179 /* SetAccessor */ ? instantiateType(getWriteTypeOfSymbol(symbol), context.mapper) : symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType; - } - const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration); - if (addUndefinedForParameter) { - type = getOptionalType(type); - } - return serializeInferredTypeForDeclaration(symbol, context, type); - }, - serializeNameOfParameter(context, parameter) { - return parameterToParameterDeclarationName(getSymbolOfDeclaration(parameter), parameter, context); - }, - serializeEntityName(syntacticContext, node) { - const context = syntacticContext; - const symbol = getSymbolAtLocation( - node, - /*ignoreErrors*/ - true - ); - if (!symbol) return void 0; - if (!isValueSymbolAccessible(symbol, context.enclosingDeclaration)) return void 0; - return symbolToExpression(symbol, context, 111551 /* Value */ | 1048576 /* ExportValue */); - }, - serializeTypeName(context, node, isTypeOf, typeArguments) { - return serializeTypeName(context, node, isTypeOf, typeArguments); - }, - getJsDocPropertyOverride(syntacticContext, jsDocTypeLiteral, jsDocProperty) { - const context = syntacticContext; - const name = isIdentifier(jsDocProperty.name) ? jsDocProperty.name : jsDocProperty.name.right; - const typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode2(context, jsDocTypeLiteral), name.escapedText); - const overrideTypeNode = typeViaParent && jsDocProperty.typeExpression && getTypeFromTypeNode2(context, jsDocProperty.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : void 0; - return overrideTypeNode; - }, - enterNewScope(context, node) { - if (isFunctionLike(node) || isJSDocSignature(node)) { - const signature = getSignatureFromDeclaration(node); - return enterNewScope(context, node, signature.parameters, signature.typeParameters); - } else { - const typeParameters = isConditionalTypeNode(node) ? getInferTypeParameters(node) : [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))]; - return enterNewScope( - context, - node, - /*expandedParams*/ - void 0, - typeParameters - ); - } - }, - markNodeReuse(context, range, location) { - return setTextRange2(context, range, location); - }, - trackExistingEntityName(context, node) { - return trackExistingEntityName(node, context); - }, - trackComputedName(context, accessExpression) { - trackComputedName(accessExpression, context.enclosingDeclaration, context); - }, - getModuleSpecifierOverride(syntacticContext, parent2, lit) { - const context = syntacticContext; - if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) { - let name = lit.text; - const originalName = name; - const nodeSymbol = getNodeLinks(parent2).resolvedSymbol; - const meaning = parent2.isTypeOf ? 111551 /* Value */ : 788968 /* Type */; - const parentSymbol = nodeSymbol && isSymbolAccessible( - nodeSymbol, - context.enclosingDeclaration, - meaning, - /*shouldComputeAliasesToMakeVisible*/ - false - ).accessibility === 0 /* Accessible */ && lookupSymbolChain( - nodeSymbol, - context, - meaning, - /*yieldModuleSymbol*/ - true - )[0]; - if (parentSymbol && isExternalModuleSymbol(parentSymbol)) { - name = getSpecifierForModuleSymbol(parentSymbol, context); - } else { - const targetFile = getExternalModuleFileFromDeclaration(parent2); - if (targetFile) { - name = getSpecifierForModuleSymbol(targetFile.symbol, context); - } - } - if (name.includes("/node_modules/")) { - context.encounteredError = true; - if (context.tracker.reportLikelyUnsafeImportRequiredError) { - context.tracker.reportLikelyUnsafeImportRequiredError(name); - } - } - if (name !== originalName) { - return name; - } - } - }, - canReuseTypeNode(context, typeNode) { - return canReuseTypeNode(context, typeNode); - }, - canReuseTypeNodeAnnotation(syntacticContext, node, existing, symbol, requiresAddingUndefined) { - var _a; - const context = syntacticContext; - if (context.enclosingDeclaration === void 0) return false; - symbol ?? (symbol = getSymbolOfDeclaration(node)); - let type = (_a = context.enclosingSymbolTypes) == null ? void 0 : _a.get(getSymbolId(symbol)); - if (type === void 0) { - if (symbol.flags & 98304 /* Accessor */) { - type = node.kind === 179 /* SetAccessor */ ? getWriteTypeOfSymbol(symbol) : getTypeOfAccessors(symbol); - } else if (isValueSignatureDeclaration(node)) { - type = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - } else { - type = getTypeOfSymbol(symbol); - } - } - let annotationType = getTypeFromTypeNodeWithoutContext(existing); - if (isErrorType(annotationType)) { - return true; - } - if (requiresAddingUndefined && annotationType) { - annotationType = addOptionality(annotationType, !isParameter(node)); - } - return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type); - } - }; - return { - syntacticBuilderResolver, - typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeToTypeNodeHelper(type, context), out), - typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context) - ), - serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context) - ), - serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context) - ), - serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context) - ), - indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => indexInfoToIndexSignatureDeclarationHelper( - indexInfo, - context, - /*typeNode*/ - void 0 - ) - ), - signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => signatureToSignatureDeclarationHelper(signature, kind, context), out), - symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => symbolToName( - symbol, - context, - meaning, - /*expectsIdentifier*/ - false - ) - ), - symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => symbolToExpression(symbol, context, meaning) - ), - symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => typeParametersToTypeParameterDeclarations(symbol, context) - ), - symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => symbolToParameterDeclaration(symbol, context) - ), - typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeParameterToDeclaration(parameter, context), out), - symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => symbolTableToDeclarationStatements(symbolTable, context) - ), - symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( - enclosingDeclaration, - flags, - internalFlags, - tracker, - /*maximumLength*/ - void 0, - /*verbosityLevel*/ - void 0, - (context) => symbolToNode(symbol, context, meaning) - ), - symbolToDeclarations - }; - function getTypeFromTypeNode2(context, node, noMappedTypes) { - const type = getTypeFromTypeNodeWithoutContext(node); - if (!context.mapper) return type; - const mappedType = instantiateType(type, context.mapper); - return noMappedTypes && mappedType !== type ? void 0 : mappedType; - } - function setTextRange2(context, range, location) { - if (!nodeIsSynthesized(range) || !(range.flags & 16 /* Synthesized */) || !context.enclosingFile || context.enclosingFile !== getSourceFileOfNode(getOriginalNode(range))) { - range = factory.cloneNode(range); - } - if (range === location) return range; - if (!location) { - return range; - } - let original = range.original; - while (original && original !== location) { - original = original.original; - } - if (!original) { - setOriginalNode(range, location); - } - if (context.enclosingFile && context.enclosingFile === getSourceFileOfNode(getOriginalNode(location))) { - return setTextRange(range, location); - } - return range; - } - function symbolToNode(symbol, context, meaning) { - if (context.internalFlags & 1 /* WriteComputedProps */) { - if (symbol.valueDeclaration) { - const name = getNameOfDeclaration(symbol.valueDeclaration); - if (name && isComputedPropertyName(name)) return name; - } - const nameType = getSymbolLinks(symbol).nameType; - if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) { - context.enclosingDeclaration = nameType.symbol.valueDeclaration; - return factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning)); - } - } - return symbolToExpression(symbol, context, meaning); - } - function symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out) { - const nodes = withContext2( - /*enclosingDeclaration*/ - void 0, - flags, - /*internalFlags*/ - void 0, - /*tracker*/ - void 0, - maximumLength, - verbosityLevel, - (context) => symbolToDeclarationsWorker(symbol, context), - out - ); - return mapDefined(nodes, (node) => { - switch (node.kind) { - case 264 /* ClassDeclaration */: - return simplifyClassDeclaration(node, symbol); - case 267 /* EnumDeclaration */: - return simplifyModifiers(node, isEnumDeclaration, symbol); - case 265 /* InterfaceDeclaration */: - return simplifyInterfaceDeclaration(node, symbol, meaning); - case 268 /* ModuleDeclaration */: - return simplifyModifiers(node, isModuleDeclaration, symbol); - default: - return void 0; - } - }); - } - function simplifyClassDeclaration(classDecl, symbol) { - const classDeclarations = filter(symbol.declarations, isClassLike); - const originalClassDecl = classDeclarations && classDeclarations.length > 0 ? classDeclarations[0] : classDecl; - const modifiers = getEffectiveModifierFlags(originalClassDecl) & ~(32 /* Export */ | 128 /* Ambient */); - const isAnonymous = isClassExpression(originalClassDecl); - if (isAnonymous) { - classDecl = factory.updateClassDeclaration( - classDecl, - classDecl.modifiers, - /*name*/ - void 0, - classDecl.typeParameters, - classDecl.heritageClauses, - classDecl.members - ); - } - return factory.replaceModifiers(classDecl, modifiers); - } - function simplifyModifiers(newDecl, isDeclKind, symbol) { - const decls = filter(symbol.declarations, isDeclKind); - const declWithModifiers = decls && decls.length > 0 ? decls[0] : newDecl; - const modifiers = getEffectiveModifierFlags(declWithModifiers) & ~(32 /* Export */ | 128 /* Ambient */); - return factory.replaceModifiers(newDecl, modifiers); - } - function simplifyInterfaceDeclaration(interfaceDecl, symbol, meaning) { - if (!(meaning & 64 /* Interface */)) { - return void 0; - } - return simplifyModifiers(interfaceDecl, isInterfaceDeclaration, symbol); - } - function symbolToDeclarationsWorker(symbol, context) { - const type = getDeclaredTypeOfSymbol(symbol); - context.typeStack.push(type.id); - context.typeStack.push(-1); - const table = createSymbolTable([symbol]); - const statements = symbolTableToDeclarationStatements(table, context); - context.typeStack.pop(); - context.typeStack.pop(); - return statements; - } - function withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, cb, out) { - const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : (internalFlags || 0 /* None */) & 4 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0; - flags = flags || 0 /* None */; - const maxTruncationLength = maximumLength || (flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength); - const context = { - enclosingDeclaration, - enclosingFile: enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration), - flags, - internalFlags: internalFlags || 0 /* None */, - tracker: void 0, - maxTruncationLength, - maxExpansionDepth: verbosityLevel ?? -1, - encounteredError: false, - suppressReportInferenceFallback: false, - reportedDiagnostic: false, - visitedTypes: void 0, - symbolDepth: void 0, - inferTypeParameters: void 0, - approximateLength: 0, - trackedSymbols: void 0, - bundled: !!compilerOptions.outFile && !!enclosingDeclaration && isExternalOrCommonJsModule(getSourceFileOfNode(enclosingDeclaration)), - truncating: false, - usedSymbolNames: void 0, - remappedSymbolNames: void 0, - remappedSymbolReferences: void 0, - reverseMappedStack: void 0, - mustCreateTypeParameterSymbolList: true, - typeParameterSymbolList: void 0, - mustCreateTypeParametersNamesLookups: true, - typeParameterNames: void 0, - typeParameterNamesByText: void 0, - typeParameterNamesByTextNextNameCount: void 0, - enclosingSymbolTypes: /* @__PURE__ */ new Map(), - mapper: void 0, - depth: 0, - typeStack: [], - out: { - canIncreaseExpansionDepth: false, - truncated: false - } - }; - context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost); - const resultingNode = cb(context); - if (context.truncating && context.flags & 1 /* NoTruncation */) { - context.tracker.reportTruncationError(); - } - if (out) { - out.canIncreaseExpansionDepth = context.out.canIncreaseExpansionDepth; - out.truncated = context.out.truncated; - } - return context.encounteredError ? void 0 : resultingNode; - } - function addSymbolTypeToContext(context, symbol, type) { - const id = getSymbolId(symbol); - const oldType = context.enclosingSymbolTypes.get(id); - context.enclosingSymbolTypes.set(id, type); - return restore; - function restore() { - if (oldType) { - context.enclosingSymbolTypes.set(id, oldType); - } else { - context.enclosingSymbolTypes.delete(id); - } - } - } - function saveRestoreFlags(context) { - const flags = context.flags; - const internalFlags = context.internalFlags; - const depth = context.depth; - return restore; - function restore() { - context.flags = flags; - context.internalFlags = internalFlags; - context.depth = depth; - } - } - function checkTruncationLengthIfExpanding(context) { - return context.maxExpansionDepth >= 0 && checkTruncationLength(context); - } - function checkTruncationLength(context) { - if (context.truncating) return context.truncating; - return context.truncating = context.approximateLength > context.maxTruncationLength; - } - function canPossiblyExpandType(type, context) { - for (let i = 0; i < context.typeStack.length - 1; i++) { - if (context.typeStack[i] === type.id) { - return false; - } - } - return context.depth < context.maxExpansionDepth || context.depth === context.maxExpansionDepth && !context.out.canIncreaseExpansionDepth; - } - function shouldExpandType(type, context, isAlias = false) { - if (!isAlias && isLibType(type)) { - return false; - } - for (let i = 0; i < context.typeStack.length - 1; i++) { - if (context.typeStack[i] === type.id) { - return false; - } - } - const result = context.depth < context.maxExpansionDepth; - if (!result) { - context.out.canIncreaseExpansionDepth = true; - } - return result; - } - function typeToTypeNodeHelper(type, context) { - const restoreFlags = saveRestoreFlags(context); - if (type) context.typeStack.push(type.id); - const typeNode = typeToTypeNodeWorker(type, context); - if (type) context.typeStack.pop(); - restoreFlags(); - return typeNode; - } - function typeToTypeNodeWorker(type, context) { - var _a, _b; - if (cancellationToken && cancellationToken.throwIfCancellationRequested) { - cancellationToken.throwIfCancellationRequested(); - } - const inTypeAlias = context.flags & 8388608 /* InTypeAlias */; - context.flags &= ~8388608 /* InTypeAlias */; - let expandingEnum = false; - if (!type) { - if (!(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) { - context.encounteredError = true; - return void 0; - } - context.approximateLength += 3; - return factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - if (!(context.flags & 536870912 /* NoTypeReduction */)) { - type = getReducedType(type); - } - if (type.flags & 1 /* Any */) { - if (type.aliasSymbol) { - return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context)); - } - if (type === unresolvedType) { - return addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "unresolved"); - } - context.approximateLength += 3; - return factory.createKeywordTypeNode(type === intrinsicMarkerType ? 141 /* IntrinsicKeyword */ : 133 /* AnyKeyword */); - } - if (type.flags & 2 /* Unknown */) { - return factory.createKeywordTypeNode(159 /* UnknownKeyword */); - } - if (type.flags & 4 /* String */) { - context.approximateLength += 6; - return factory.createKeywordTypeNode(154 /* StringKeyword */); - } - if (type.flags & 8 /* Number */) { - context.approximateLength += 6; - return factory.createKeywordTypeNode(150 /* NumberKeyword */); - } - if (type.flags & 64 /* BigInt */) { - context.approximateLength += 6; - return factory.createKeywordTypeNode(163 /* BigIntKeyword */); - } - if (type.flags & 16 /* Boolean */ && !type.aliasSymbol) { - context.approximateLength += 7; - return factory.createKeywordTypeNode(136 /* BooleanKeyword */); - } - if (type.flags & 1056 /* EnumLike */) { - if (type.symbol.flags & 8 /* EnumMember */) { - const parentSymbol = getParentOfSymbol(type.symbol); - const parentName = symbolToTypeNode(parentSymbol, context, 788968 /* Type */); - if (getDeclaredTypeOfSymbol(parentSymbol) === type) { - return parentName; - } - const memberName = symbolName(type.symbol); - if (isIdentifierText(memberName, 1 /* ES5 */)) { - return appendReferenceToType( - parentName, - factory.createTypeReferenceNode( - memberName, - /*typeArguments*/ - void 0 - ) - ); - } - if (isImportTypeNode(parentName)) { - parentName.isTypeOf = true; - return factory.createIndexedAccessTypeNode(parentName, factory.createLiteralTypeNode(factory.createStringLiteral(memberName))); - } else if (isTypeReferenceNode(parentName)) { - return factory.createIndexedAccessTypeNode(factory.createTypeQueryNode(parentName.typeName), factory.createLiteralTypeNode(factory.createStringLiteral(memberName))); - } else { - return Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); - } - } - if (!shouldExpandType(type, context)) { - return symbolToTypeNode(type.symbol, context, 788968 /* Type */); - } else { - expandingEnum = true; - } - } - if (type.flags & 128 /* StringLiteral */) { - context.approximateLength += type.value.length + 2; - return factory.createLiteralTypeNode(setEmitFlags(factory.createStringLiteral(type.value, !!(context.flags & 268435456 /* UseSingleQuotesForStringLiteralType */)), 16777216 /* NoAsciiEscaping */)); - } - if (type.flags & 256 /* NumberLiteral */) { - const value = type.value; - context.approximateLength += ("" + value).length; - return factory.createLiteralTypeNode(value < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-value)) : factory.createNumericLiteral(value)); - } - if (type.flags & 2048 /* BigIntLiteral */) { - context.approximateLength += pseudoBigIntToString(type.value).length + 1; - return factory.createLiteralTypeNode(factory.createBigIntLiteral(type.value)); - } - if (type.flags & 512 /* BooleanLiteral */) { - context.approximateLength += type.intrinsicName.length; - return factory.createLiteralTypeNode(type.intrinsicName === "true" ? factory.createTrue() : factory.createFalse()); - } - if (type.flags & 8192 /* UniqueESSymbol */) { - if (!(context.flags & 1048576 /* AllowUniqueESSymbolType */)) { - if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) { - context.approximateLength += 6; - return symbolToTypeNode(type.symbol, context, 111551 /* Value */); - } - if (context.tracker.reportInaccessibleUniqueSymbolError) { - context.tracker.reportInaccessibleUniqueSymbolError(); - } - } - context.approximateLength += 13; - return factory.createTypeOperatorNode(158 /* UniqueKeyword */, factory.createKeywordTypeNode(155 /* SymbolKeyword */)); - } - if (type.flags & 16384 /* Void */) { - context.approximateLength += 4; - return factory.createKeywordTypeNode(116 /* VoidKeyword */); - } - if (type.flags & 32768 /* Undefined */) { - context.approximateLength += 9; - return factory.createKeywordTypeNode(157 /* UndefinedKeyword */); - } - if (type.flags & 65536 /* Null */) { - context.approximateLength += 4; - return factory.createLiteralTypeNode(factory.createNull()); - } - if (type.flags & 131072 /* Never */) { - context.approximateLength += 5; - return factory.createKeywordTypeNode(146 /* NeverKeyword */); - } - if (type.flags & 4096 /* ESSymbol */) { - context.approximateLength += 6; - return factory.createKeywordTypeNode(155 /* SymbolKeyword */); - } - if (type.flags & 67108864 /* NonPrimitive */) { - context.approximateLength += 6; - return factory.createKeywordTypeNode(151 /* ObjectKeyword */); - } - if (isThisTypeParameter(type)) { - if (context.flags & 4194304 /* InObjectTypeLiteral */) { - if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) { - context.encounteredError = true; - } - (_b = (_a = context.tracker).reportInaccessibleThisError) == null ? void 0 : _b.call(_a); - } - context.approximateLength += 4; - return factory.createThisTypeNode(); - } - if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { - if (!shouldExpandType( - type, - context, - /*isAlias*/ - true - )) { - const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); - if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes); - if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) { - return factory.createArrayTypeNode(typeArgumentNodes[0]); - } - return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes); - } - context.depth += 1; - } - const objectFlags = getObjectFlags(type); - if (objectFlags & 4 /* Reference */) { - Debug.assert(!!(type.flags & 524288 /* Object */)); - if (shouldExpandType(type, context)) { - context.depth += 1; - return createAnonymousTypeNode( - type, - /*forceClassExpansion*/ - true, - /*forceExpansion*/ - true - ); - } - return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type); - } - if (type.flags & 262144 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) { - if (type.flags & 262144 /* TypeParameter */ && contains(context.inferTypeParameters, type)) { - context.approximateLength += symbolName(type.symbol).length + 6; - let constraintNode; - const constraint = getConstraintOfTypeParameter(type); - if (constraint) { - const inferredConstraint = getInferredTypeParameterConstraint( - type, - /*omitTypeReferences*/ - true - ); - if (!(inferredConstraint && isTypeIdenticalTo(constraint, inferredConstraint))) { - context.approximateLength += 9; - constraintNode = constraint && typeToTypeNodeHelper(constraint, context); - } - } - return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode)); - } - if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */) { - const name2 = typeParameterToName(type, context); - context.approximateLength += idText(name2).length; - return factory.createTypeReferenceNode( - factory.createIdentifier(idText(name2)), - /*typeArguments*/ - void 0 - ); - } - if (objectFlags & 3 /* ClassOrInterface */ && shouldExpandType(type, context)) { - context.depth += 1; - return createAnonymousTypeNode( - type, - /*forceClassExpansion*/ - true, - /*forceExpansion*/ - true - ); - } - if (type.symbol) { - return symbolToTypeNode(type.symbol, context, 788968 /* Type */); - } - const name = (type === markerSuperTypeForCheck || type === markerSubTypeForCheck) && varianceTypeParameter && varianceTypeParameter.symbol ? (type === markerSubTypeForCheck ? "sub-" : "super-") + symbolName(varianceTypeParameter.symbol) : "?"; - return factory.createTypeReferenceNode( - factory.createIdentifier(name), - /*typeArguments*/ - void 0 - ); - } - if (type.flags & 1048576 /* Union */ && type.origin) { - type = type.origin; - } - if (type.flags & (1048576 /* Union */ | 2097152 /* Intersection */)) { - const types = type.flags & 1048576 /* Union */ ? formatUnionTypes(type.types, expandingEnum) : type.types; - if (length(types) === 1) { - return typeToTypeNodeHelper(types[0], context); - } - const typeNodes = mapToTypeNodes( - types, - context, - /*isBareList*/ - true - ); - if (typeNodes && typeNodes.length > 0) { - return type.flags & 1048576 /* Union */ ? factory.createUnionTypeNode(typeNodes) : factory.createIntersectionTypeNode(typeNodes); - } else { - if (!context.encounteredError && !(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) { - context.encounteredError = true; - } - return void 0; - } - } - if (objectFlags & (16 /* Anonymous */ | 32 /* Mapped */)) { - Debug.assert(!!(type.flags & 524288 /* Object */)); - return createAnonymousTypeNode(type); - } - if (type.flags & 4194304 /* Index */) { - const indexedType = type.type; - context.approximateLength += 6; - const indexTypeNode = typeToTypeNodeHelper(indexedType, context); - return factory.createTypeOperatorNode(143 /* KeyOfKeyword */, indexTypeNode); - } - if (type.flags & 134217728 /* TemplateLiteral */) { - const texts = type.texts; - const types = type.types; - const templateHead = factory.createTemplateHead(texts[0]); - const templateSpans = factory.createNodeArray( - map(types, (t, i) => factory.createTemplateLiteralTypeSpan( - typeToTypeNodeHelper(t, context), - (i < types.length - 1 ? factory.createTemplateMiddle : factory.createTemplateTail)(texts[i + 1]) - )) - ); - context.approximateLength += 2; - return factory.createTemplateLiteralType(templateHead, templateSpans); - } - if (type.flags & 268435456 /* StringMapping */) { - const typeNode = typeToTypeNodeHelper(type.type, context); - return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]); - } - if (type.flags & 8388608 /* IndexedAccess */) { - const objectTypeNode = typeToTypeNodeHelper(type.objectType, context); - const indexTypeNode = typeToTypeNodeHelper(type.indexType, context); - context.approximateLength += 2; - return factory.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); - } - if (type.flags & 16777216 /* Conditional */) { - return visitAndTransformType(type, (type2) => conditionalTypeToTypeNode(type2)); - } - if (type.flags & 33554432 /* Substitution */) { - 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) { - const checkTypeNode = typeToTypeNodeHelper(type2.checkType, context); - context.approximateLength += 15; - if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type2.root.isDistributive && !(type2.checkType.flags & 262144 /* TypeParameter */)) { - const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); - const name = typeParameterToName(newParam, context); - const newTypeVariable = factory.createTypeReferenceNode(name); - context.approximateLength += 37; - const newMapper = prependTypeMapping(type2.root.checkType, newParam, type2.mapper); - const saveInferTypeParameters2 = context.inferTypeParameters; - context.inferTypeParameters = type2.root.inferTypeParameters; - const extendsTypeNode2 = typeToTypeNodeHelper(instantiateType(type2.root.extendsType, newMapper), context); - context.inferTypeParameters = saveInferTypeParameters2; - const trueTypeNode2 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode2(context, type2.root.node.trueType), newMapper)); - const falseTypeNode2 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode2(context, type2.root.node.falseType), newMapper)); - return factory.createConditionalTypeNode( - checkTypeNode, - factory.createInferTypeNode(factory.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - factory.cloneNode(newTypeVariable.typeName) - )), - factory.createConditionalTypeNode( - factory.createTypeReferenceNode(factory.cloneNode(name)), - typeToTypeNodeHelper(type2.checkType, context), - factory.createConditionalTypeNode(newTypeVariable, extendsTypeNode2, trueTypeNode2, falseTypeNode2), - factory.createKeywordTypeNode(146 /* NeverKeyword */) - ), - factory.createKeywordTypeNode(146 /* NeverKeyword */) - ); - } - const saveInferTypeParameters = context.inferTypeParameters; - context.inferTypeParameters = type2.root.inferTypeParameters; - const extendsTypeNode = typeToTypeNodeHelper(type2.extendsType, context); - context.inferTypeParameters = saveInferTypeParameters; - const trueTypeNode = typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(type2)); - const falseTypeNode = typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(type2)); - return factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); - } - function typeToTypeNodeOrCircularityElision(type2) { - var _a2, _b2, _c; - if (type2.flags & 1048576 /* Union */) { - if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(getTypeId(type2))) { - if (!(context.flags & 131072 /* AllowAnonymousIdentifier */)) { - context.encounteredError = true; - (_c = (_b2 = context.tracker) == null ? void 0 : _b2.reportCyclicStructureError) == null ? void 0 : _c.call(_b2); - } - return createElidedInformationPlaceholder(context); - } - return visitAndTransformType(type2, (type3) => typeToTypeNodeHelper(type3, context)); - } - return typeToTypeNodeHelper(type2, context); - } - function isMappedTypeHomomorphic(type2) { - return !!getHomomorphicTypeVariable(type2); - } - function isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) { - 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; - let templateType = getTemplateTypeFromMappedType(type2); - const typeParameter = getTypeParameterFromMappedType(type2); - 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 newConstraintParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); - const name = typeParameterToName(newConstraintParam, context); - const target = type2.target; - newTypeVariable = factory.createTypeReferenceNode(name); - templateType = instantiateType( - getTemplateTypeFromMappedType(target), - makeArrayTypeMapper([getTypeParameterFromMappedType(target), getModifiersTypeFromMappedType(target)], [typeParameter, newConstraintParam]) - ); - } - 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); - } - const typeParameterNode = typeParameterToDeclarationWithConstraint(typeParameter, context, appropriateConstraintTypeNode); - const cleanup = enterNewScope( - context, - type2.declaration, - /*expandedParams*/ - void 0, - [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type2.declaration.typeParameter))] - ); - const nameTypeNode = type2.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type2), context) : void 0; - const templateTypeNode = typeToTypeNodeHelper(removeMissingType(templateType, !!(getMappedTypeModifiers(type2) & 4 /* IncludeOptional */)), context); - cleanup(); - const mappedTypeNode = factory.createMappedTypeNode( - readonlyToken, - typeParameterNode, - nameTypeNode, - questionToken, - templateTypeNode, - /*members*/ - void 0 - ); - context.approximateLength += 10; - const result = setEmitFlags(mappedTypeNode, 1 /* SingleLine */); - if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) { - const originalConstraint = instantiateType(getConstraintOfTypeParameter(getTypeFromTypeNode2(context, type2.declaration.typeParameter.constraint.type)) || unknownType, type2.mapper); - return factory.createConditionalTypeNode( - typeToTypeNodeHelper(getModifiersTypeFromMappedType(type2), context), - factory.createInferTypeNode(factory.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - factory.cloneNode(newTypeVariable.typeName), - originalConstraint.flags & 2 /* Unknown */ ? void 0 : typeToTypeNodeHelper(originalConstraint, context) - )), - 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; - } - function createAnonymousTypeNode(type2, forceClassExpansion = false, forceExpansion = false) { - var _a2, _b2; - 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) && getTypeFromTypeNode2(context, existing) === type2) { - const typeNode = syntacticNodeBuilder.tryReuseExistingTypeNode(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); - } else if (!forceExpansion && (symbol.flags & 32 /* Class */ && !forceClassExpansion && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible( - symbol, - context.enclosingDeclaration, - isInstanceType, - /*shouldComputeAliasesToMakeVisible*/ - false - ).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol())) { - if (shouldExpandType(type2, context)) { - context.depth += 1; - } else { - return symbolToTypeNode(symbol, context, isInstanceType); - } - } - if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { - const typeAlias = getTypeAliasForTypeLiteral(type2); - if (typeAlias) { - return symbolToTypeNode(typeAlias, context, 788968 /* Type */); - } else { - return createElidedInformationPlaceholder(context); - } - } else { - return visitAndTransformType(type2, createTypeNodeFromObjectType); - } - } else { - return createTypeNodeFromObjectType(type2); - } - function shouldWriteTypeOfFunctionSymbol() { - var _a3; - const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method - some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration))); - const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol - forEach(symbol.declarations, (declaration) => declaration.parent.kind === 308 /* SourceFile */ || declaration.parent.kind === 269 /* 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)); - } - } - } - function visitAndTransformType(type2, transform2) { - 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; - if (!context.visitedTypes) { - context.visitedTypes = /* @__PURE__ */ new Set(); - } - if (id && !context.symbolDepth) { - context.symbolDepth = /* @__PURE__ */ new Map(); - } - const links = context.maxExpansionDepth >= 0 ? void 0 : context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration); - const key = `${getTypeId(type2)}|${context.flags}|${context.internalFlags}`; - if (links) { - links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map()); - } - 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; - } - context.approximateLength += cachedResult.addedLength; - return deepCloneOrReuseNode(cachedResult.node); - } - let depth; - if (id) { - depth = context.symbolDepth.get(id) || 0; - if (depth > 10) { - return createElidedInformationPlaceholder(context); - } - 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) { - (_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 setTextRange2(context, factory.cloneNode(visitEachChild( - node, - deepCloneOrReuseNode, - /*context*/ - void 0, - deepCloneOrReuseNodes, - deepCloneOrReuseNode - )), node); - } - function deepCloneOrReuseNodes(nodes, visitor, test, start, count) { - if (nodes && nodes.length === 0) { - return setTextRange(factory.createNodeArray( - /*elements*/ - void 0, - nodes.hasTrailingComma - ), nodes); - } - return visitNodes2(nodes, visitor, test, start, count); - } - } - function createTypeNodeFromObjectType(type2) { - if (isGenericMappedType(type2) || type2.containsError) { - return createMappedTypeNodeFromType(type2); - } - const resolved = resolveStructuredTypeMembers(type2); - if (!resolved.properties.length && !resolved.indexInfos.length) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - context.approximateLength += 2; - return setEmitFlags(factory.createTypeLiteralNode( - /*members*/ - void 0 - ), 1 /* SingleLine */); - } - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - const signature = resolved.callSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* FunctionType */, context); - return signatureNode; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - const signature = resolved.constructSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 186 /* ConstructorType */, context); - return signatureNode; - } - } - const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */)); - if (some(abstractSignatures)) { - const types = map(abstractSignatures, getOrCreateTypeFromSignature); - const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per - // the logic in `createTypeNodesFromResolvedType`. - (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties)); - if (typeElementCount) { - types.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved)); - } - return typeToTypeNodeHelper(getIntersectionType(types), context); - } - const restoreFlags = saveRestoreFlags(context); - context.flags |= 4194304 /* InObjectTypeLiteral */; - const members = createTypeNodesFromResolvedType(resolved); - restoreFlags(); - const typeLiteralNode = factory.createTypeLiteralNode(members); - context.approximateLength += 2; - setEmitFlags(typeLiteralNode, context.flags & 1024 /* MultilineObjectLiterals */ ? 0 : 1 /* SingleLine */); - return typeLiteralNode; - } - function typeReferenceToTypeNode(type2) { - let typeArguments = getTypeArguments(type2); - if (type2.target === globalArrayType || type2.target === globalReadonlyArrayType) { - if (context.flags & 2 /* WriteArrayAsGenericType */) { - const typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context); - return factory.createTypeReferenceNode(type2.target === globalArrayType ? "Array" : "ReadonlyArray", [typeArgumentNode]); - } - const elementType = typeToTypeNodeHelper(typeArguments[0], context); - const arrayType = factory.createArrayTypeNode(elementType); - return type2.target === globalArrayType ? arrayType : factory.createTypeOperatorNode(148 /* ReadonlyKeyword */, arrayType); - } else if (type2.target.objectFlags & 8 /* Tuple */) { - typeArguments = sameMap(typeArguments, (t, i) => removeMissingType(t, !!(type2.target.elementFlags[i] & 2 /* Optional */))); - if (typeArguments.length > 0) { - const arity = getTypeReferenceArity(type2); - const tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context); - if (tupleConstituentNodes) { - 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(labeledElementDeclaration))), - flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[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]; - } - } - const tupleTypeNode = setEmitFlags(factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */); - return type2.target.readonly ? factory.createTypeOperatorNode(148 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; - } - } - if (context.encounteredError || context.flags & 524288 /* AllowEmptyTuple */) { - const tupleTypeNode = setEmitFlags(factory.createTupleTypeNode([]), 1 /* SingleLine */); - return type2.target.readonly ? factory.createTypeOperatorNode(148 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; - } - context.encounteredError = true; - return void 0; - } else if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && type2.symbol.valueDeclaration && isClassLike(type2.symbol.valueDeclaration) && !isValueSymbolAccessible(type2.symbol, context.enclosingDeclaration)) { - return createAnonymousTypeNode(type2); - } else { - const outerTypeParameters = type2.target.outerTypeParameters; - let i = 0; - let resultType; - if (outerTypeParameters) { - const length2 = outerTypeParameters.length; - while (i < length2) { - const start = i; - const parent2 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); - do { - i++; - } while (i < length2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent2); - if (!rangeEquals(outerTypeParameters, typeArguments, start, i)) { - const typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); - const restoreFlags2 = saveRestoreFlags(context); - context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */; - const ref = symbolToTypeNode(parent2, context, 788968 /* Type */, typeArgumentSlice); - restoreFlags2(); - resultType = !resultType ? ref : appendReferenceToType(resultType, ref); - } - } - } - let typeArgumentNodes; - if (typeArguments.length > 0) { - let typeParameterCount = 0; - if (type2.target.typeParameters) { - typeParameterCount = Math.min(type2.target.typeParameters.length, typeArguments.length); - if (isReferenceToType2(type2, getGlobalIterableType( - /*reportErrors*/ - false - )) || isReferenceToType2(type2, getGlobalIterableIteratorType( - /*reportErrors*/ - false - )) || isReferenceToType2(type2, getGlobalAsyncIterableType( - /*reportErrors*/ - false - )) || isReferenceToType2(type2, getGlobalAsyncIterableIteratorType( - /*reportErrors*/ - false - ))) { - if (!type2.node || !isTypeReferenceNode(type2.node) || !type2.node.typeArguments || type2.node.typeArguments.length < typeParameterCount) { - while (typeParameterCount > 0) { - const typeArgument = typeArguments[typeParameterCount - 1]; - const typeParameter = type2.target.typeParameters[typeParameterCount - 1]; - const defaultType = getDefaultFromTypeParameter(typeParameter); - if (!defaultType || !isTypeIdenticalTo(typeArgument, defaultType)) { - break; - } - typeParameterCount--; - } - } - } - } - typeArgumentNodes = mapToTypeNodes(typeArguments.slice(i, typeParameterCount), context); - } - const restoreFlags = saveRestoreFlags(context); - context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */; - const finalRef = symbolToTypeNode(type2.symbol, context, 788968 /* Type */, typeArgumentNodes); - restoreFlags(); - return !resultType ? finalRef : appendReferenceToType(resultType, finalRef); - } - } - function appendReferenceToType(root, ref) { - if (isImportTypeNode(root)) { - let typeArguments = root.typeArguments; - let qualifier = root.qualifier; - if (qualifier) { - if (isIdentifier(qualifier)) { - if (typeArguments !== getIdentifierTypeArguments(qualifier)) { - qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments); - } - } else { - if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) { - qualifier = factory.updateQualifiedName(qualifier, qualifier.left, setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)); - } - } - } - typeArguments = ref.typeArguments; - const ids = getAccessStack(ref); - for (const id of ids) { - qualifier = qualifier ? factory.createQualifiedName(qualifier, id) : id; - } - return factory.updateImportTypeNode( - root, - root.argument, - root.attributes, - qualifier, - typeArguments, - root.isTypeOf - ); - } else { - let typeArguments = root.typeArguments; - let typeName = root.typeName; - if (isIdentifier(typeName)) { - if (typeArguments !== getIdentifierTypeArguments(typeName)) { - typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments); - } - } else { - if (typeArguments !== getIdentifierTypeArguments(typeName.right)) { - typeName = factory.updateQualifiedName(typeName, typeName.left, setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)); - } - } - typeArguments = ref.typeArguments; - const ids = getAccessStack(ref); - for (const id of ids) { - typeName = factory.createQualifiedName(typeName, id); - } - return factory.updateTypeReferenceNode( - root, - typeName, - typeArguments - ); - } - } - function getAccessStack(ref) { - let state = ref.typeName; - const ids = []; - while (!isIdentifier(state)) { - ids.unshift(state.right); - state = state.left; - } - ids.unshift(state); - return ids; - } - function indexInfoToObjectComputedNamesOrSignatureDeclaration(indexInfo, context2, typeNode) { - if (indexInfo.components) { - const allComponentComputedNamesSerializable = every(indexInfo.components, (e) => { - var _a2; - return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && context2.enclosingDeclaration && ((_a2 = isEntityNameVisible( - e.name.expression, - context2.enclosingDeclaration, - /*shouldComputeAliasToMakeVisible*/ - false - )) == null ? void 0 : _a2.accessibility) === 0 /* Accessible */); - }); - if (allComponentComputedNamesSerializable) { - const newComponents = filter(indexInfo.components, (e) => { - return !hasLateBindableName(e); - }); - return map(newComponents, (e) => { - trackComputedName(e.name.expression, context2.enclosingDeclaration, context2); - return setTextRange2( - context2, - factory.createPropertySignature( - indexInfo.isReadonly ? [factory.createModifier(148 /* ReadonlyKeyword */)] : void 0, - e.name, - (isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(58 /* QuestionToken */) : void 0, - typeNode || typeToTypeNodeHelper(getTypeOfSymbol(e.symbol), context2) - ), - e - ); - }); - } - } - return [indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode)]; - } - function createTypeNodesFromResolvedType(resolvedType) { - if (checkTruncationLength(context)) { - context.out.truncated = true; - if (context.flags & 1 /* NoTruncation */) { - return [addSyntheticTrailingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, "elided")]; - } - return [factory.createPropertySignature( - /*modifiers*/ - void 0, - "...", - /*questionToken*/ - void 0, - /*type*/ - void 0 - )]; - } - context.typeStack.push(-1); - const typeElements = []; - for (const signature of resolvedType.callSignatures) { - typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* CallSignature */, context)); - } - for (const signature of resolvedType.constructSignatures) { - if (signature.flags & 4 /* Abstract */) continue; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 181 /* ConstructSignature */, context)); - } - for (const info of resolvedType.indexInfos) { - typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0)); - } - const properties = resolvedType.properties; - if (!properties) { - context.typeStack.pop(); - return typeElements; - } - let i = 0; - for (const propertySymbol of properties) { - if (isExpanding(context) && propertySymbol.flags & 4194304 /* Prototype */) { - continue; - } - i++; - if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) { - if (propertySymbol.flags & 4194304 /* Prototype */) { - continue; - } - if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 /* Private */ | 4 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) { - context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName)); - } - } - if (checkTruncationLength(context) && i + 2 < properties.length - 1) { - context.out.truncated = true; - if (context.flags & 1 /* NoTruncation */) { - const typeElement = typeElements.pop(); - typeElements.push(addSyntheticTrailingComment(typeElement, 3 /* MultiLineCommentTrivia */, `... ${properties.length - i} more elided ...`)); - } else { - typeElements.push(factory.createPropertySignature( - /*modifiers*/ - void 0, - `... ${properties.length - i} more ...`, - /*questionToken*/ - void 0, - /*type*/ - void 0 - )); - } - addPropertyToElementList(properties[properties.length - 1], context, typeElements); - break; - } - addPropertyToElementList(propertySymbol, context, typeElements); - } - context.typeStack.pop(); - return typeElements.length ? typeElements : void 0; - } - } - function createElidedInformationPlaceholder(context) { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return factory.createTypeReferenceNode( - factory.createIdentifier("..."), - /*typeArguments*/ - void 0 - ); - } - return addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided"); - } - function shouldUsePlaceholderForProperty(propertySymbol, context) { - var _a; - const depth = 3; - return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a = context.reverseMappedStack) == null ? void 0 : _a[0]) && !(getObjectFlags(last(context.reverseMappedStack).links.propertyType) & 16 /* Anonymous */) || isDeeplyNestedReverseMappedTypeProperty()); - function isDeeplyNestedReverseMappedTypeProperty() { - var _a2; - if ((((_a2 = context.reverseMappedStack) == null ? void 0 : _a2.length) ?? 0) < depth) { - return false; - } - for (let i = 0; i < depth; i++) { - const prop = context.reverseMappedStack[context.reverseMappedStack.length - 1 - i]; - if (prop.links.mappedType.symbol !== propertySymbol.links.mappedType.symbol) { - return false; - } - } - return true; - } - } - function addPropertyToElementList(propertySymbol, context, typeElements) { - var _a; - const propertyIsReverseMapped = !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */); - const propertyType = shouldUsePlaceholderForProperty(propertySymbol, context) ? anyType : getNonMissingTypeOfSymbol(propertySymbol); - const saveEnclosingDeclaration = context.enclosingDeclaration; - context.enclosingDeclaration = void 0; - if (context.tracker.canTrackSymbol && isLateBoundName(propertySymbol.escapedName)) { - if (propertySymbol.declarations) { - const decl = first(propertySymbol.declarations); - if (hasLateBindableName(decl)) { - if (isBinaryExpression(decl)) { - const name = getNameOfDeclaration(decl); - if (name && isElementAccessExpression(name) && isPropertyAccessEntityNameExpression(name.argumentExpression)) { - trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context); - } - } else { - trackComputedName(decl.name.expression, saveEnclosingDeclaration, context); - } - } - } else { - context.tracker.reportNonSerializableProperty(symbolToString(propertySymbol)); - } - } - context.enclosingDeclaration = propertySymbol.valueDeclaration || ((_a = propertySymbol.declarations) == null ? void 0 : _a[0]) || saveEnclosingDeclaration; - const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context); - context.enclosingDeclaration = saveEnclosingDeclaration; - context.approximateLength += symbolName(propertySymbol).length + 1; - if (propertySymbol.flags & 98304 /* Accessor */) { - const writeType = getWriteTypeOfSymbol(propertySymbol); - if (!isErrorType(propertyType) && !isErrorType(writeType)) { - const symbolMapper = getSymbolLinks(propertySymbol).mapper; - const propDeclaration = getDeclarationOfKind(propertySymbol, 173 /* PropertyDeclaration */); - if (propertyType !== writeType || propertySymbol.parent.flags & 32 /* Class */ && !propDeclaration) { - const getterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* GetAccessor */); - if (getterDeclaration) { - const getterSignature = getSignatureFromDeclaration(getterDeclaration); - typeElements.push( - setCommentRange2( - context, - signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 178 /* GetAccessor */, context, { name: propertyName }), - getterDeclaration - ) - ); - } - const setterDeclaration = getDeclarationOfKind(propertySymbol, 179 /* SetAccessor */); - if (setterDeclaration) { - const setterSignature = getSignatureFromDeclaration(setterDeclaration); - typeElements.push( - setCommentRange2( - context, - signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 179 /* SetAccessor */, context, { name: propertyName }), - setterDeclaration - ) - ); - } - return; - } - if (propertySymbol.parent.flags & 32 /* Class */ && propDeclaration && find(propDeclaration.modifiers, isAccessorModifier)) { - const fakeGetterSignature = createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - emptyArray, - propertyType, - /*resolvedTypePredicate*/ - void 0, - 0, - 0 /* None */ - ); - typeElements.push( - setCommentRange2( - context, - signatureToSignatureDeclarationHelper(fakeGetterSignature, 178 /* GetAccessor */, context, { name: propertyName }), - propDeclaration - ) - ); - const setterParam = createSymbol(1 /* FunctionScopedVariable */, "arg"); - setterParam.links.type = writeType; - const fakeSetterSignature = createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [setterParam], - voidType, - /*resolvedTypePredicate*/ - void 0, - 0, - 0 /* None */ - ); - typeElements.push( - signatureToSignatureDeclarationHelper(fakeSetterSignature, 179 /* SetAccessor */, context, { name: propertyName }) - ); - 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, 174 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); - typeElements.push(preserveCommentsOn(methodDeclaration, signature.declaration || propertySymbol.valueDeclaration)); - } - if (signatures.length || !optionalToken) { - return; - } - } - let propertyTypeNode; - if (shouldUsePlaceholderForProperty(propertySymbol, context)) { - propertyTypeNode = createElidedInformationPlaceholder(context); - } else { - if (propertyIsReverseMapped) { - context.reverseMappedStack || (context.reverseMappedStack = []); - context.reverseMappedStack.push(propertySymbol); - } - propertyTypeNode = propertyType ? serializeTypeForDeclaration( - context, - /*declaration*/ - void 0, - propertyType, - propertySymbol - ) : factory.createKeywordTypeNode(133 /* AnyKeyword */); - if (propertyIsReverseMapped) { - context.reverseMappedStack.pop(); - } - } - 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, propertySymbol.valueDeclaration)); - function preserveCommentsOn(node, range) { - var _a2; - const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 349 /* 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 }]); - } - } else if (range) { - setCommentRange2(context, node, range); - } - return node; - } - } - function setCommentRange2(context, node, range) { - if (context.enclosingFile && context.enclosingFile === getSourceFileOfNode(range)) { - return setCommentRange(node, range); - } - return node; - } - function mapToTypeNodes(types, context, isBareList) { - if (some(types)) { - if (checkTruncationLength(context)) { - context.out.truncated = true; - if (!isBareList) { - return [ - context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided") : factory.createTypeReferenceNode( - "...", - /*typeArguments*/ - void 0 - ) - ]; - } else if (types.length > 2) { - return [ - typeToTypeNodeHelper(types[0], context), - context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - 2} more elided ...`) : factory.createTypeReferenceNode( - `... ${types.length - 2} more ...`, - /*typeArguments*/ - void 0 - ), - typeToTypeNodeHelper(types[types.length - 1], context) - ]; - } - } - const mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */); - const seenNames = mayHaveNameCollisions ? createMultiMap() : void 0; - const result = []; - let i = 0; - for (const type of types) { - i++; - if (checkTruncationLength(context) && i + 2 < types.length - 1) { - context.out.truncated = true; - result.push( - context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - i} more elided ...`) : factory.createTypeReferenceNode( - `... ${types.length - i} more ...`, - /*typeArguments*/ - void 0 - ) - ); - const typeNode2 = typeToTypeNodeHelper(types[types.length - 1], context); - if (typeNode2) { - result.push(typeNode2); - } - break; - } - context.approximateLength += 2; - const typeNode = typeToTypeNodeHelper(type, context); - if (typeNode) { - result.push(typeNode); - if (seenNames && isIdentifierTypeReference(typeNode)) { - seenNames.add(typeNode.typeName.escapedText, [type, result.length - 1]); - } - } - } - if (seenNames) { - const restoreFlags = saveRestoreFlags(context); - context.flags |= 64 /* UseFullyQualifiedType */; - seenNames.forEach((types2) => { - if (!arrayIsHomogeneous(types2, ([a], [b]) => typesAreSameReference(a, b))) { - for (const [type, resultIndex] of types2) { - result[resultIndex] = typeToTypeNodeHelper(type, context); - } - } - }); - restoreFlags(); - } - return result; - } - } - function typesAreSameReference(a, b) { - return a === b || !!a.symbol && a.symbol === b.symbol || !!a.aliasSymbol && a.aliasSymbol === b.aliasSymbol; - } - function indexInfoToIndexSignatureDeclarationHelper(indexInfo, context, typeNode) { - const name = getNameFromIndexInfo(indexInfo) || "x"; - const indexerTypeNode = typeToTypeNodeHelper(indexInfo.keyType, context); - const indexingParameter = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - name, - /*questionToken*/ - void 0, - indexerTypeNode, - /*initializer*/ - void 0 - ); - if (!typeNode) { - typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context); - } - if (!indexInfo.type && !(context.flags & 2097152 /* AllowEmptyIndexInfoType */)) { - context.encounteredError = true; - } - context.approximateLength += name.length + 4; - return factory.createIndexSignature( - indexInfo.isReadonly ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0, - [indexingParameter], - typeNode - ); - } - function signatureToSignatureDeclarationHelper(signature, kind, context, options) { - var _a; - let typeParameters; - let typeArguments; - const expandedParams = getExpandedParameters( - signature, - /*skipUnionExpanding*/ - true - )[0]; - const cleanup = enterNewScope(context, signature.declaration, expandedParams, signature.typeParameters, signature.parameters, signature.mapper); - context.approximateLength += 3; - if (context.flags & 32 /* WriteTypeArgumentsOfSignature */ && signature.target && signature.mapper && signature.target.typeParameters) { - typeArguments = signature.target.typeParameters.map((parameter) => typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context)); - } else { - typeParameters = signature.typeParameters && signature.typeParameters.map((parameter) => typeParameterToDeclaration(parameter, context)); - } - const restoreFlags = saveRestoreFlags(context); - context.flags &= ~256 /* SuppressAnyReturnType */; - const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 177 /* Constructor */)); - const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); - if (thisParameter) { - parameters.unshift(thisParameter); - } - restoreFlags(); - const returnTypeNode = serializeReturnTypeForSignature(context, signature); - let modifiers = options == null ? void 0 : options.modifiers; - if (kind === 186 /* ConstructorType */ && signature.flags & 4 /* Abstract */) { - const flags = modifiersToFlags(modifiers); - modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */); - } - const node = kind === 180 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 181 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodDeclaration */ ? factory.createMethodDeclaration( - modifiers, - /*asteriskToken*/ - void 0, - (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), - /*questionToken*/ - void 0, - typeParameters, - parameters, - returnTypeNode, - /*body*/ - void 0 - ) : kind === 177 /* Constructor */ ? factory.createConstructorDeclaration( - modifiers, - parameters, - /*body*/ - void 0 - ) : kind === 178 /* GetAccessor */ ? factory.createGetAccessorDeclaration( - modifiers, - (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), - parameters, - returnTypeNode, - /*body*/ - void 0 - ) : kind === 179 /* SetAccessor */ ? factory.createSetAccessorDeclaration( - modifiers, - (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), - parameters, - /*body*/ - void 0 - ) : kind === 182 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 318 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 185 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 186 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 263 /* FunctionDeclaration */ ? factory.createFunctionDeclaration( - modifiers, - /*asteriskToken*/ - void 0, - (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), - typeParameters, - parameters, - returnTypeNode, - /*body*/ - void 0 - ) : kind === 219 /* FunctionExpression */ ? factory.createFunctionExpression( - modifiers, - /*asteriskToken*/ - void 0, - (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), - typeParameters, - parameters, - returnTypeNode, - factory.createBlock([]) - ) : kind === 220 /* ArrowFunction */ ? factory.createArrowFunction( - modifiers, - typeParameters, - parameters, - returnTypeNode, - /*equalsGreaterThanToken*/ - void 0, - factory.createBlock([]) - ) : Debug.assertNever(kind); - if (typeArguments) { - node.typeArguments = factory.createNodeArray(typeArguments); - } - if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 324 /* JSDocSignature */ && signature.declaration.parent.kind === 340 /* 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; - } - function createRecoveryBoundary(context) { - if (cancellationToken && cancellationToken.throwIfCancellationRequested) { - cancellationToken.throwIfCancellationRequested(); - } - let trackedSymbols; - let unreportedErrors; - let hadError = false; - const oldTracker = context.tracker; - const oldTrackedSymbols = context.trackedSymbols; - context.trackedSymbols = void 0; - const oldEncounteredError = context.encounteredError; - context.tracker = new SymbolTrackerImpl(context, { - ...oldTracker.inner, - reportCyclicStructureError() { - markError(() => oldTracker.reportCyclicStructureError()); - }, - reportInaccessibleThisError() { - markError(() => oldTracker.reportInaccessibleThisError()); - }, - reportInaccessibleUniqueSymbolError() { - markError(() => oldTracker.reportInaccessibleUniqueSymbolError()); - }, - reportLikelyUnsafeImportRequiredError(specifier) { - markError(() => oldTracker.reportLikelyUnsafeImportRequiredError(specifier)); - }, - reportNonSerializableProperty(name) { - markError(() => oldTracker.reportNonSerializableProperty(name)); - }, - reportPrivateInBaseOfClassExpression(propertyName) { - markError(() => oldTracker.reportPrivateInBaseOfClassExpression(propertyName)); - }, - trackSymbol(sym, decl, meaning) { - (trackedSymbols ?? (trackedSymbols = [])).push([sym, decl, meaning]); - return false; - }, - moduleResolverHost: context.tracker.moduleResolverHost - }, context.tracker.moduleResolverHost); - return { - startRecoveryScope, - finalizeBoundary, - markError, - hadError: () => hadError - }; - function markError(unreportedError) { - hadError = true; - if (unreportedError) { - (unreportedErrors ?? (unreportedErrors = [])).push(unreportedError); - } - } - function startRecoveryScope() { - const trackedSymbolsTop = (trackedSymbols == null ? void 0 : trackedSymbols.length) ?? 0; - const unreportedErrorsTop = (unreportedErrors == null ? void 0 : unreportedErrors.length) ?? 0; - return () => { - hadError = false; - if (trackedSymbols) { - trackedSymbols.length = trackedSymbolsTop; - } - if (unreportedErrors) { - unreportedErrors.length = unreportedErrorsTop; - } - }; - } - function finalizeBoundary() { - context.tracker = oldTracker; - context.trackedSymbols = oldTrackedSymbols; - context.encounteredError = oldEncounteredError; - unreportedErrors == null ? void 0 : unreportedErrors.forEach((fn) => fn()); - if (hadError) { - return false; - } - trackedSymbols == null ? void 0 : trackedSymbols.forEach( - ([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol( - symbol, - enclosingDeclaration, - meaning - ) - ); - return true; - } - } - function enterNewScope(context, declaration, expandedParams, typeParameters, originalParameters, mapper) { - const cleanupContext = cloneNodeBuilderContext(context); - let cleanupParams; - let cleanupTypeParams; - const oldEnclosingDecl = context.enclosingDeclaration; - const oldMapper = context.mapper; - if (mapper) { - context.mapper = mapper; - } - if (context.enclosingDeclaration && declaration) { - let pushFakeScope2 = function(kind, addAll) { - Debug.assert(context.enclosingDeclaration); - let existingFakeScope; - if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind) { - existingFakeScope = context.enclosingDeclaration; - } else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind) { - existingFakeScope = context.enclosingDeclaration.parent; - } - Debug.assertOptionalNode(existingFakeScope, isBlock); - const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable(); - let newLocals; - let oldLocals; - addAll((name, symbol) => { - if (existingFakeScope) { - const oldSymbol = locals.get(name); - if (!oldSymbol) { - newLocals = append(newLocals, name); - } else { - oldLocals = append(oldLocals, { name, oldSymbol }); - } - } - locals.set(name, symbol); - }); - if (!existingFakeScope) { - const fakeScope = factory.createBlock(emptyArray); - getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind; - fakeScope.locals = locals; - setParent(fakeScope, context.enclosingDeclaration); - context.enclosingDeclaration = fakeScope; - } else { - return function undo() { - forEach(newLocals, (s) => locals.delete(s)); - forEach(oldLocals, (s) => locals.set(s.name, s.oldSymbol)); - }; - } - }; - var pushFakeScope = pushFakeScope2; - cleanupParams = !some(expandedParams) ? void 0 : pushFakeScope2( - "params", - (add) => { - if (!expandedParams) return; - for (let pIndex = 0; pIndex < expandedParams.length; pIndex++) { - const param = expandedParams[pIndex]; - const originalParam = originalParameters == null ? void 0 : originalParameters[pIndex]; - if (originalParameters && originalParam !== param) { - add(param.escapedName, unknownSymbol); - if (originalParam) { - add(originalParam.escapedName, unknownSymbol); - } - } else if (!forEach(param.declarations, (d) => { - if (isParameter(d) && isBindingPattern(d.name)) { - bindPattern(d.name); - return true; - } - return void 0; - function bindPattern(p) { - forEach(p.elements, (e) => { - switch (e.kind) { - case 233 /* OmittedExpression */: - return; - case 209 /* BindingElement */: - return bindElement(e); - default: - return Debug.assertNever(e); - } - }); - } - function bindElement(e) { - if (isBindingPattern(e.name)) { - return bindPattern(e.name); - } - const symbol = getSymbolOfDeclaration(e); - add(symbol.escapedName, symbol); - } - })) { - add(param.escapedName, param); - } - } - } - ); - if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && some(typeParameters)) { - cleanupTypeParams = pushFakeScope2( - "typeParams", - (add) => { - for (const typeParam of typeParameters ?? emptyArray) { - const typeParamName = typeParameterToName(typeParam, context).escapedText; - add(typeParamName, typeParam.symbol); - } - } - ); - } - } - return () => { - cleanupParams == null ? void 0 : cleanupParams(); - cleanupTypeParams == null ? void 0 : cleanupTypeParams(); - cleanupContext(); - context.enclosingDeclaration = oldEnclosingDecl; - context.mapper = oldMapper; - }; - } - function tryGetThisParameterDeclaration(signature, context) { - if (signature.thisParameter) { - return symbolToParameterDeclaration(signature.thisParameter, context); - } - if (signature.declaration && isInJSFile(signature.declaration)) { - const thisTag = getJSDocThisTag(signature.declaration); - if (thisTag && thisTag.typeExpression) { - return factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "this", - /*questionToken*/ - void 0, - typeToTypeNodeHelper(getTypeFromTypeNode2(context, thisTag.typeExpression), context) - ); - } - } - } - function typeParameterToDeclarationWithConstraint(type, context, constraintNode) { - const restoreFlags = saveRestoreFlags(context); - context.flags &= ~512 /* WriteTypeParametersInQualifiedName */; - const modifiers = factory.createModifiersFromModifierFlags(getTypeParameterModifiers(type)); - const name = typeParameterToName(type, context); - const defaultParameter = getDefaultFromTypeParameter(type); - const defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); - restoreFlags(); - return factory.createTypeParameterDeclaration(modifiers, name, constraintNode, defaultParameterNode); - } - function typeToTypeNodeHelperWithPossibleReusableTypeNode(type, typeNode, context) { - return !canPossiblyExpandType(type, context) && typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context); - } - function typeParameterToDeclaration(type, context, constraint = getConstraintOfTypeParameter(type)) { - const constraintNode = constraint && typeToTypeNodeHelperWithPossibleReusableTypeNode(constraint, getConstraintDeclaration(type), context); - return typeParameterToDeclarationWithConstraint(type, context, constraintNode); - } - function typePredicateToTypePredicateNodeHelper(typePredicate, context) { - const assertsModifier = typePredicate.kind === 2 /* AssertsThis */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? factory.createToken(131 /* AssertsKeyword */) : void 0; - const parameterName = typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? setEmitFlags(factory.createIdentifier(typePredicate.parameterName), 16777216 /* NoAsciiEscaping */) : factory.createThisTypeNode(); - const typeNode = typePredicate.type && typeToTypeNodeHelper(typePredicate.type, context); - return factory.createTypePredicateNode(assertsModifier, parameterName, typeNode); - } - function getEffectiveParameterDeclaration(parameterSymbol) { - const parameterDeclaration = getDeclarationOfKind(parameterSymbol, 170 /* Parameter */); - if (parameterDeclaration) { - return parameterDeclaration; - } - if (!isTransientSymbol(parameterSymbol)) { - return getDeclarationOfKind(parameterSymbol, 342 /* JSDocParameterTag */); - } - } - function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - const parameterDeclaration = getEffectiveParameterDeclaration(parameterSymbol); - const parameterType = getTypeOfSymbol(parameterSymbol); - const parameterTypeNode = serializeTypeForDeclaration(context, parameterDeclaration, parameterType, parameterSymbol); - 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 = 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( - modifiers, - dotDotDotToken, - name, - questionToken, - parameterTypeNode, - /*initializer*/ - void 0 - ); - 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 === 167 /* 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) { - if (context.tracker.canTrackSymbol && isComputedPropertyName(node2) && isLateBindableName(node2)) { - trackComputedName(node2.expression, context.enclosingDeclaration, context); - } - let visited = visitEachChild( - node2, - elideInitializerAndSetEmitFlags, - /*context*/ - void 0, - /*nodesVisitor*/ - void 0, - elideInitializerAndSetEmitFlags - ); - if (isBindingElement(visited)) { - visited = factory.updateBindingElement( - visited, - visited.dotDotDotToken, - visited.propertyName, - visited.name, - /*initializer*/ - void 0 - ); - } - if (!nodeIsSynthesized(visited)) { - visited = factory.cloneNode(visited); - } - return setEmitFlags(visited, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); - } - } - } - function trackComputedName(accessExpression, enclosingDeclaration, context) { - if (!context.tracker.canTrackSymbol) return; - const firstIdentifier = getFirstIdentifier(accessExpression); - const name = resolveName( - enclosingDeclaration, - firstIdentifier.escapedText, - 111551 /* Value */ | 1048576 /* ExportValue */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (name) { - context.tracker.trackSymbol(name, enclosingDeclaration, 111551 /* Value */); - } else { - const fallback = resolveName( - firstIdentifier, - firstIdentifier.escapedText, - 111551 /* Value */ | 1048576 /* ExportValue */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (fallback) { - context.tracker.trackSymbol(fallback, enclosingDeclaration, 111551 /* Value */); - } - } - } - function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) { - context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); - return lookupSymbolChainWorker(symbol, context, meaning, yieldModuleSymbol); - } - function lookupSymbolChainWorker(symbol, context, meaning, yieldModuleSymbol) { - let chain; - const isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.internalFlags & 4 /* DoNotIncludeSymbolChain */)) { - chain = Debug.checkDefined(getSymbolChain( - symbol, - meaning, - /*endOfChain*/ - true - )); - Debug.assert(chain && chain.length > 0); - } else { - chain = [symbol]; - } - return chain; - function getSymbolChain(symbol2, meaning2, endOfChain) { - let accessibleSymbolChain = getAccessibleSymbolChain(symbol2, context.enclosingDeclaration, meaning2, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); - let parentSpecifiers; - 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 - ); - const indices = parents.map((_, i) => i); - indices.sort(sortByBestName); - const sortedParents = indices.map((i) => parents[i]); - for (const parent2 of sortedParents) { - const parentChain = getSymbolChain( - parent2, - getQualifiedLeftMeaning(meaning2), - /*endOfChain*/ - false - ); - if (parentChain) { - if (parent2.exports && parent2.exports.get("export=" /* ExportEquals */) && getSymbolIfSameReference(parent2.exports.get("export=" /* ExportEquals */), symbol2)) { - accessibleSymbolChain = parentChain; - break; - } - accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent2, symbol2) || symbol2]); - break; - } - } - } - } - if (accessibleSymbolChain) { - return accessibleSymbolChain; - } - if ( - // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. - endOfChain || // If a parent symbol is an anonymous type, don't write it. - !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */)) - ) { - if (!endOfChain && !yieldModuleSymbol && !!forEach(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { - return; - } - return [symbol2]; - } - function sortByBestName(a, b) { - const specifierA = parentSpecifiers[a]; - const specifierB = parentSpecifiers[b]; - if (specifierA && specifierB) { - const isBRelative = pathIsRelative(specifierB); - if (pathIsRelative(specifierA) === isBRelative) { - return countPathComponents(specifierA) - countPathComponents(specifierB); - } - if (isBRelative) { - return -1; - } - return 1; - } - return 0; - } - } - } - function typeParametersToTypeParameterDeclarations(symbol, context) { - let typeParameterNodes; - const targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { - typeParameterNodes = factory.createNodeArray(map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), (tp) => typeParameterToDeclaration(tp, context))); - } - return typeParameterNodes; - } - function lookupTypeParameterNodes(chain, index, context) { - var _a; - Debug.assert(chain && 0 <= index && index < chain.length); - const symbol = chain[index]; - const symbolId = getSymbolId(symbol); - if ((_a = context.typeParameterSymbolList) == null ? void 0 : _a.has(symbolId)) { - return void 0; - } - if (context.mustCreateTypeParameterSymbolList) { - context.mustCreateTypeParameterSymbolList = false; - context.typeParameterSymbolList = new Set(context.typeParameterSymbolList); - } - context.typeParameterSymbolList.add(symbolId); - let typeParameterNodes; - if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < chain.length - 1) { - const parentSymbol = symbol; - const nextSymbol = chain[index + 1]; - if (getCheckFlags(nextSymbol) & 1 /* Instantiated */) { - const params = getTypeParametersOfClassOrInterface( - parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol - ); - typeParameterNodes = mapToTypeNodes(map(params, (t) => getMappedType(t, nextSymbol.links.mapper)), context); - } else { - typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); - } - } - return typeParameterNodes; - } - function getTopmostIndexedAccessType(top) { - if (isIndexedAccessTypeNode(top.objectType)) { - return getTopmostIndexedAccessType(top.objectType); - } - return top; - } - function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) { - let file = getDeclarationOfKind(symbol, 308 /* SourceFile */); - if (!file) { - const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol)); - if (equivalentFileSymbol) { - file = getDeclarationOfKind(equivalentFileSymbol, 308 /* SourceFile */); - } - } - if (file && file.moduleName !== void 0) { - return file.moduleName; - } - if (!file) { - if (ambientModuleSymbolRegex.test(symbol.escapedName)) { - return symbol.escapedName.substring(1, symbol.escapedName.length - 1); - } - } - if (!context.enclosingFile || !context.tracker.moduleResolverHost) { - if (ambientModuleSymbolRegex.test(symbol.escapedName)) { - return symbol.escapedName.substring(1, symbol.escapedName.length - 1); - } - return getSourceFileOfNode(getNonAugmentationDeclaration(symbol)).fileName; - } - const enclosingDeclaration = getOriginalNode(context.enclosingDeclaration); - const originalModuleSpecifier = canHaveModuleSpecifier(enclosingDeclaration) ? tryGetModuleSpecifierFromDeclaration(enclosingDeclaration) : void 0; - const contextFile = context.enclosingFile; - const resolutionMode = overrideImportMode || originalModuleSpecifier && host.getModeForUsageLocation(contextFile, originalModuleSpecifier) || contextFile && host.getDefaultResolutionModeForFile(contextFile); - const cacheKey = createModeAwareCacheKey(contextFile.path, resolutionMode); - const links = getSymbolLinks(symbol); - let specifier = links.specifierCache && links.specifierCache.get(cacheKey); - if (!specifier) { - const isBundle2 = !!compilerOptions.outFile; - const { moduleResolverHost } = context.tracker; - const specifierCompilerOptions = isBundle2 ? { ...compilerOptions, baseUrl: moduleResolverHost.getCommonSourceDirectory() } : compilerOptions; - specifier = first(getModuleSpecifiers( - symbol, - checker, - specifierCompilerOptions, - contextFile, - moduleResolverHost, - { - importModuleSpecifierPreference: isBundle2 ? "non-relative" : "project-relative", - importModuleSpecifierEnding: isBundle2 ? "minimal" : resolutionMode === 99 /* ESNext */ ? "js" : void 0 - }, - { overrideImportMode } - )); - links.specifierCache ?? (links.specifierCache = /* @__PURE__ */ new Map()); - links.specifierCache.set(cacheKey, specifier); - } - return specifier; - } - function symbolToEntityNameNode(symbol) { - const identifier = factory.createIdentifier(unescapeLeadingUnderscores(symbol.escapedName)); - return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier; - } - function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) { - const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */)); - const isTypeOf = meaning === 111551 /* Value */; - if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { - const nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : void 0; - const typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); - const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration)); - const targetFile = getSourceFileOfModule(chain[0]); - let specifier; - 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 */); - 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.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.includes("/node_modules/")) { - specifier = oldSpecifier; - } else { - attributes = factory.createImportAttributes( - factory.createNodeArray([ - factory.createImportAttribute( - factory.createStringLiteral("resolution-mode"), - factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require") - ) - ]) - ); - } - } - if (!attributes) { - context.encounteredError = true; - if (context.tracker.reportLikelyUnsafeImportRequiredError) { - context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier); - } - } - } - const lit = factory.createLiteralTypeNode(factory.createStringLiteral(specifier)); - context.approximateLength += specifier.length + 10; - if (!nonRootParts || isEntityName(nonRootParts)) { - if (nonRootParts) { - const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; - setIdentifierTypeArguments( - lastId, - /*typeArguments*/ - void 0 - ); - } - return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf); - } else { - const splitNode = getTopmostIndexedAccessType(nonRootParts); - const qualifier = splitNode.objectType.typeName; - return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType); - } - } - const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0); - if (isIndexedAccessTypeNode(entityName)) { - return entityName; - } - if (isTypeOf) { - return factory.createTypeQueryNode(entityName); - } else { - const lastId = isIdentifier(entityName) ? entityName : entityName.right; - const lastTypeArgs = getIdentifierTypeArguments(lastId); - setIdentifierTypeArguments( - lastId, - /*typeArguments*/ - void 0 - ); - return factory.createTypeReferenceNode(entityName, lastTypeArgs); - } - function createAccessFromSymbolChain(chain2, index, stopper) { - const typeParameterNodes = index === chain2.length - 1 ? overrideTypeArguments : lookupTypeParameterNodes(chain2, index, context); - const symbol2 = chain2[index]; - const parent2 = chain2[index - 1]; - let symbolName2; - if (index === 0) { - context.flags |= 16777216 /* InInitialEntityName */; - symbolName2 = getNameOfSymbolAsWritten(symbol2, context); - context.approximateLength += (symbolName2 ? symbolName2.length : 0) + 1; - context.flags ^= 16777216 /* InInitialEntityName */; - } else { - if (parent2 && getExportsOfSymbol(parent2)) { - const exports2 = getExportsOfSymbol(parent2); - forEachEntry(exports2, (ex, name) => { - if (getSymbolIfSameReference(ex, symbol2) && !isLateBoundName(name) && name !== "export=" /* ExportEquals */) { - symbolName2 = unescapeLeadingUnderscores(name); - return true; - } - }); - } - } - if (symbolName2 === void 0) { - const name = firstDefined(symbol2.declarations, getNameOfDeclaration); - if (name && isComputedPropertyName(name) && isEntityName(name.expression)) { - const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper); - if (isEntityName(LHS)) { - return factory.createIndexedAccessTypeNode(factory.createParenthesizedType(factory.createTypeQueryNode(LHS)), factory.createTypeQueryNode(name.expression)); - } - return LHS; - } - symbolName2 = getNameOfSymbolAsWritten(symbol2, context); - } - context.approximateLength += symbolName2.length + 1; - if (!(context.flags & 16 /* ForbidIndexedAccessSymbolReferences */) && parent2 && getMembersOfSymbol(parent2) && getMembersOfSymbol(parent2).get(symbol2.escapedName) && getSymbolIfSameReference(getMembersOfSymbol(parent2).get(symbol2.escapedName), symbol2)) { - const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper); - if (isIndexedAccessTypeNode(LHS)) { - return factory.createIndexedAccessTypeNode(LHS, factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); - } else { - return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); - } - } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); - if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); - identifier.symbol = symbol2; - if (index > stopper) { - const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper); - if (!isEntityName(LHS)) { - return Debug.fail("Impossible construct - an export of an indexed access cannot be reachable"); - } - return factory.createQualifiedName(LHS, identifier); - } - return identifier; - } - } - function typeParameterShadowsOtherTypeParameterInScope(escapedName, context, type) { - const result = resolveName( - context.enclosingDeclaration, - escapedName, - 788968 /* Type */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - if (result && result.flags & 262144 /* TypeParameter */) { - return result !== type.symbol; - } - return false; - } - function typeParameterToName(type, context) { - var _a, _b, _c, _d; - if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && context.typeParameterNames) { - const cached = context.typeParameterNames.get(getTypeId(type)); - if (cached) { - return cached; - } - } - let result = symbolToName( - type.symbol, - context, - 788968 /* Type */, - /*expectsIdentifier*/ - true - ); - if (!(result.kind & 80 /* Identifier */)) { - return factory.createIdentifier("(Missing type parameter)"); - } - const decl = (_b = (_a = type.symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b[0]; - if (decl && isTypeParameterDeclaration(decl)) { - result = setTextRange2(context, result, decl.name); - } - if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) { - const rawtext = result.escapedText; - let i = ((_c = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _c.get(rawtext)) || 0; - let text = rawtext; - while (((_d = context.typeParameterNamesByText) == null ? void 0 : _d.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) { - i++; - text = `${rawtext}_${i}`; - } - if (text !== rawtext) { - const typeArguments = getIdentifierTypeArguments(result); - result = factory.createIdentifier(text); - setIdentifierTypeArguments(result, typeArguments); - } - if (context.mustCreateTypeParametersNamesLookups) { - context.mustCreateTypeParametersNamesLookups = false; - context.typeParameterNames = new Map(context.typeParameterNames); - context.typeParameterNamesByTextNextNameCount = new Map(context.typeParameterNamesByTextNextNameCount); - context.typeParameterNamesByText = new Set(context.typeParameterNamesByText); - } - context.typeParameterNamesByTextNextNameCount.set(rawtext, i); - context.typeParameterNames.set(getTypeId(type), result); - context.typeParameterNamesByText.add(text); - } - return result; - } - function symbolToName(symbol, context, meaning, expectsIdentifier) { - const chain = lookupSymbolChain(symbol, context, meaning); - if (expectsIdentifier && chain.length !== 1 && !context.encounteredError && !(context.flags & 65536 /* AllowQualifiedNameInPlaceOfIdentifier */)) { - context.encounteredError = true; - } - return createEntityNameFromSymbolChain(chain, chain.length - 1); - function createEntityNameFromSymbolChain(chain2, index) { - const typeParameterNodes = lookupTypeParameterNodes(chain2, index, context); - const symbol2 = chain2[index]; - if (index === 0) { - context.flags |= 16777216 /* InInitialEntityName */; - } - const symbolName2 = getNameOfSymbolAsWritten(symbol2, context); - if (index === 0) { - context.flags ^= 16777216 /* InInitialEntityName */; - } - const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); - if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); - identifier.symbol = symbol2; - return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier; - } - } - function symbolToExpression(symbol, context, meaning) { - const chain = lookupSymbolChain(symbol, context, meaning); - return createExpressionFromSymbolChain(chain, chain.length - 1); - function createExpressionFromSymbolChain(chain2, index) { - const typeParameterNodes = lookupTypeParameterNodes(chain2, index, context); - const symbol2 = chain2[index]; - if (index === 0) { - context.flags |= 16777216 /* InInitialEntityName */; - } - let symbolName2 = getNameOfSymbolAsWritten(symbol2, context); - if (index === 0) { - context.flags ^= 16777216 /* InInitialEntityName */; - } - let firstChar = symbolName2.charCodeAt(0); - if (isSingleOrDoubleQuote(firstChar) && some(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { - const specifier = getSpecifierForModuleSymbol(symbol2, context); - context.approximateLength += 2 + specifier.length; - return factory.createStringLiteral(specifier); - } - if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { - const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); - if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); - identifier.symbol = symbol2; - context.approximateLength += 1 + symbolName2.length; - return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier; - } else { - if (firstChar === 91 /* openBracket */) { - symbolName2 = symbolName2.substring(1, symbolName2.length - 1); - firstChar = symbolName2.charCodeAt(0); - } - let expression; - if (isSingleOrDoubleQuote(firstChar) && !(symbol2.flags & 8 /* EnumMember */)) { - const literalText = stripQuotes(symbolName2).replace(/\\./g, (s) => s.substring(1)); - context.approximateLength += literalText.length + 2; - expression = factory.createStringLiteral(literalText, firstChar === 39 /* singleQuote */); - } else if ("" + +symbolName2 === symbolName2) { - context.approximateLength += symbolName2.length; - expression = factory.createNumericLiteral(+symbolName2); - } - if (!expression) { - const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); - if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); - identifier.symbol = symbol2; - context.approximateLength += symbolName2.length; - expression = identifier; - } - context.approximateLength += 2; - return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression); - } - } - } - function isStringNamed(d) { - const name = getNameOfDeclaration(d); - 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); - return !!(name && isStringLiteral(name) && (name.singleQuote || !nodeIsSynthesized(name) && startsWith(getTextOfNode( - name, - /*includeTrivia*/ - false - ), "'"))); - } - function getPropertyNameNodeForSymbol(symbol, context) { - const hashPrivateName = getClonedHashPrivateName(symbol); - if (hashPrivateName) { - return hashPrivateName; - } - const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed); - const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed); - 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, isMethod); - } - function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed, isMethod) { - const nameType = getSymbolLinks(symbol).nameType; - if (nameType) { - if (nameType.flags & 384 /* StringOrNumberLiteral */) { - const name = "" + nameType.value; - if (!isIdentifierText(name, getEmitScriptTarget(compilerOptions)) && (stringNamed || !isNumericLiteralName(name))) { - return factory.createStringLiteral(name, !!singleQuote); - } - if (isNumericLiteralName(name) && startsWith(name, "-")) { - return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-name))); - } - return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod); - } - if (nameType.flags & 8192 /* UniqueESSymbol */) { - return factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551 /* Value */)); - } - } - } - function cloneNodeBuilderContext(context) { - const oldMustCreateTypeParameterSymbolList = context.mustCreateTypeParameterSymbolList; - const oldMustCreateTypeParametersNamesLookups = context.mustCreateTypeParametersNamesLookups; - context.mustCreateTypeParameterSymbolList = true; - context.mustCreateTypeParametersNamesLookups = true; - const oldTypeParameterNames = context.typeParameterNames; - const oldTypeParameterNamesByText = context.typeParameterNamesByText; - const oldTypeParameterNamesByTextNextNameCount = context.typeParameterNamesByTextNextNameCount; - const oldTypeParameterSymbolList = context.typeParameterSymbolList; - return () => { - context.typeParameterNames = oldTypeParameterNames; - context.typeParameterNamesByText = oldTypeParameterNamesByText; - context.typeParameterNamesByTextNextNameCount = oldTypeParameterNamesByTextNextNameCount; - context.typeParameterSymbolList = oldTypeParameterSymbolList; - context.mustCreateTypeParameterSymbolList = oldMustCreateTypeParameterSymbolList; - context.mustCreateTypeParametersNamesLookups = oldMustCreateTypeParametersNamesLookups; - }; - } - function getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration) { - return symbol.declarations && find(symbol.declarations, (s) => !!getNonlocalEffectiveTypeAnnotationNode(s) && (!enclosingDeclaration || !!findAncestor(s, (n) => n === enclosingDeclaration))); - } - function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) { - if (!(getObjectFlags(type) & 4 /* Reference */)) return true; - if (!isTypeReferenceNode(existing)) return true; - void getTypeFromTypeReference(existing); - const symbol = getNodeLinks(existing).resolvedSymbol; - const existingTarget = symbol && getDeclaredTypeOfSymbol(symbol); - if (!existingTarget || existingTarget !== type.target) return true; - return length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters); - } - function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) { - while (getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration) { - enclosingDeclaration = enclosingDeclaration.parent; - } - return enclosingDeclaration; - } - function serializeInferredTypeForDeclaration(symbol, context, type) { - if (type.flags & 8192 /* UniqueESSymbol */ && type.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, (d) => getSourceFileOfNode(d) === context.enclosingFile))) { - context.flags |= 1048576 /* AllowUniqueESSymbolType */; - } - const result = typeToTypeNodeHelper(type, context); - return result; - } - function serializeTypeForDeclaration(context, declaration, type, symbol) { - var _a; - let result; - const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration); - const decl = declaration ?? symbol.valueDeclaration ?? getDeclarationWithTypeAnnotation(symbol) ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); - if (!canPossiblyExpandType(type, context) && decl) { - const restore = addSymbolTypeToContext(context, symbol, type); - if (isAccessor(decl)) { - result = syntacticNodeBuilder.serializeTypeOfAccessor(decl, symbol, context); - } else if (hasInferredType(decl) && !nodeIsSynthesized(decl) && !(getObjectFlags(type) & 196608 /* RequiresWidening */)) { - result = syntacticNodeBuilder.serializeTypeOfDeclaration(decl, symbol, context); - } - restore(); - } - if (!result) { - if (addUndefinedForParameter) { - type = getOptionalType(type); - } - result = serializeInferredTypeForDeclaration(symbol, context, type); - } - return result ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - function typeNodeIsEquivalentToType(annotatedDeclaration, type, typeFromTypeNode) { - if (typeFromTypeNode === type) { - return true; - } - if (!annotatedDeclaration) { - return false; - } - if ((isPropertySignature(annotatedDeclaration) || isPropertyDeclaration(annotatedDeclaration)) && annotatedDeclaration.questionToken) { - return getTypeWithFacts(type, 524288 /* NEUndefined */) === typeFromTypeNode; - } - if (isParameter(annotatedDeclaration) && hasEffectiveQuestionToken(annotatedDeclaration)) { - return getTypeWithFacts(type, 524288 /* NEUndefined */) === typeFromTypeNode; - } - return false; - } - function serializeReturnTypeForSignature(context, signature) { - const suppressAny = context.flags & 256 /* SuppressAnyReturnType */; - const restoreFlags = saveRestoreFlags(context); - if (suppressAny) context.flags &= ~256 /* SuppressAnyReturnType */; - let returnTypeNode; - const returnType = getReturnTypeOfSignature(signature); - if (!(suppressAny && isTypeAny(returnType))) { - if (signature.declaration && !nodeIsSynthesized(signature.declaration) && !canPossiblyExpandType(returnType, context)) { - const declarationSymbol = getSymbolOfDeclaration(signature.declaration); - const restore = addSymbolTypeToContext(context, declarationSymbol, returnType); - returnTypeNode = syntacticNodeBuilder.serializeReturnTypeForSignature(signature.declaration, declarationSymbol, context); - restore(); - } - if (!returnTypeNode) { - returnTypeNode = serializeInferredReturnTypeForSignature(context, signature, returnType); - } - } - if (!returnTypeNode && !suppressAny) { - returnTypeNode = factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - restoreFlags(); - return returnTypeNode; - } - function serializeInferredReturnTypeForSignature(context, signature, returnType) { - const oldSuppressReportInferenceFallback = context.suppressReportInferenceFallback; - context.suppressReportInferenceFallback = true; - const typePredicate = getTypePredicateOfSignature(signature); - const returnTypeNode = typePredicate ? typePredicateToTypePredicateNodeHelper(context.mapper ? instantiateTypePredicate(typePredicate, context.mapper) : typePredicate, context) : typeToTypeNodeHelper(returnType, context); - context.suppressReportInferenceFallback = oldSuppressReportInferenceFallback; - return returnTypeNode; - } - function trackExistingEntityName(node, context, enclosingDeclaration = context.enclosingDeclaration) { - let introducesError = false; - const leftmost = getFirstIdentifier(node); - if (isInJSFile(node) && (isExportsIdentifier(leftmost) || isModuleExportsAccessExpression(leftmost.parent) || isQualifiedName(leftmost.parent) && isModuleIdentifier(leftmost.parent.left) && isExportsIdentifier(leftmost.parent.right))) { - introducesError = true; - return { introducesError, node }; - } - const meaning = getMeaningOfEntityNameReference(node); - let sym; - if (isThisIdentifier(leftmost)) { - sym = getSymbolOfDeclaration(getThisContainer( - leftmost, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - )); - if (isSymbolAccessible( - sym, - leftmost, - meaning, - /*shouldComputeAliasesToMakeVisible*/ - false - ).accessibility !== 0 /* Accessible */) { - introducesError = true; - context.tracker.reportInaccessibleThisError(); - } - return { introducesError, node: attachSymbolToLeftmostIdentifier(node) }; - } - sym = resolveEntityName( - leftmost, - meaning, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true - ); - if (context.enclosingDeclaration && !(sym && sym.flags & 262144 /* TypeParameter */)) { - sym = getExportSymbolOfValueSymbolIfExported(sym); - const symAtLocation = resolveEntityName( - leftmost, - meaning, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - context.enclosingDeclaration - ); - if ( - // Check for unusable parameters symbols - symAtLocation === unknownSymbol || // If the symbol is not found, but was not found in the original scope either we probably have an error, don't reuse the node - symAtLocation === void 0 && sym !== void 0 || // If the symbol is found both in declaration scope and in current scope then it should point to the same reference - symAtLocation && sym && !getSymbolIfSameReference(getExportSymbolOfValueSymbolIfExported(symAtLocation), sym) - ) { - if (symAtLocation !== unknownSymbol) { - context.tracker.reportInferenceFallback(node); - } - introducesError = true; - return { introducesError, node, sym }; - } else { - sym = symAtLocation; - } - } - if (sym) { - if (sym.flags & 1 /* FunctionScopedVariable */ && sym.valueDeclaration) { - if (isPartOfParameterDeclaration(sym.valueDeclaration) || isJSDocParameterTag(sym.valueDeclaration)) { - return { introducesError, node: attachSymbolToLeftmostIdentifier(node) }; - } - } - if (!(sym.flags & 262144 /* TypeParameter */) && // Type parameters are visible in the current context if they are are resolvable - !isDeclarationName(node) && isSymbolAccessible( - sym, - enclosingDeclaration, - meaning, - /*shouldComputeAliasesToMakeVisible*/ - false - ).accessibility !== 0 /* Accessible */) { - context.tracker.reportInferenceFallback(node); - introducesError = true; - } else { - context.tracker.trackSymbol(sym, enclosingDeclaration, meaning); - } - return { introducesError, node: attachSymbolToLeftmostIdentifier(node) }; - } - return { introducesError, node }; - function attachSymbolToLeftmostIdentifier(node2) { - if (node2 === leftmost) { - const type = getDeclaredTypeOfSymbol(sym); - const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node2); - name.symbol = sym; - return setTextRange2(context, setEmitFlags(name, 16777216 /* NoAsciiEscaping */), node2); - } - const updated = visitEachChild( - node2, - (c) => attachSymbolToLeftmostIdentifier(c), - /*context*/ - void 0 - ); - return setTextRange2(context, updated, node2); - } - } - function serializeTypeName(context, node, isTypeOf, typeArguments) { - const meaning = isTypeOf ? 111551 /* Value */ : 788968 /* Type */; - const symbol = resolveEntityName( - node, - meaning, - /*ignoreErrors*/ - true - ); - if (!symbol) return void 0; - const resolvedSymbol = symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol; - if (isSymbolAccessible( - symbol, - context.enclosingDeclaration, - meaning, - /*shouldComputeAliasesToMakeVisible*/ - false - ).accessibility !== 0 /* Accessible */) return void 0; - return symbolToTypeNode(resolvedSymbol, context, meaning, typeArguments); - } - function canReuseTypeNode(context, existing) { - const type = getTypeFromTypeNode2( - context, - existing, - /*noMappedTypes*/ - true - ); - if (!type) { - return false; - } - if (isInJSFile(existing)) { - if (isLiteralImportTypeNode(existing)) { - void getTypeFromImportTypeNode(existing); - const nodeSymbol = getNodeLinks(existing).resolvedSymbol; - return !nodeSymbol || !// The import type resolved using jsdoc fallback logic - (!existing.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic - !(length(existing.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol)))); - } - } - if (isTypeReferenceNode(existing)) { - if (isConstTypeReference(existing)) return false; - const symbol = getNodeLinks(existing).resolvedSymbol; - if (!symbol) return false; - if (symbol.flags & 262144 /* TypeParameter */) { - const declaredType = getDeclaredTypeOfSymbol(symbol); - return !(context.mapper && getMappedType(declaredType, context.mapper) !== declaredType); - } - if (isInJSDoc(existing)) { - return existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) && !getIntendedTypeFromJSDocTypeReference(existing) && !!(symbol.flags & 788968 /* Type */); - } - } - if (isTypeOperatorNode(existing) && existing.operator === 158 /* UniqueKeyword */ && existing.type.kind === 155 /* SymbolKeyword */) { - const effectiveEnclosingContext = context.enclosingDeclaration && getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration); - return !!findAncestor(existing, (n) => n === effectiveEnclosingContext); - } - return true; - } - function serializeExistingTypeNode(context, typeNode, addUndefined) { - const type = getTypeFromTypeNode2(context, typeNode); - if (addUndefined && !someType(type, (t) => !!(t.flags & 32768 /* Undefined */)) && canReuseTypeNode(context, typeNode)) { - const clone2 = syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode); - if (clone2) { - return factory.createUnionTypeNode([clone2, factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]); - } - } - return typeToTypeNodeHelper(type, context); - } - function symbolTableToDeclarationStatements(symbolTable, context) { - var _a; - const serializePropertySymbolForClass = makeSerializePropertySymbol( - factory.createPropertyDeclaration, - 175 /* MethodDeclaration */, - /*useAccessors*/ - true - ); - const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol( - (mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), - 174 /* MethodSignature */, - /*useAccessors*/ - false - ); - const enclosingDeclaration = context.enclosingDeclaration; - let results = []; - const visitedSymbols = /* @__PURE__ */ new Set(); - const deferredPrivatesStack = []; - const oldcontext = context; - context = { - ...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 _a2, _b; - if ((_a2 = context.remappedSymbolNames) == null ? void 0 : _a2.has(getSymbolId(sym))) return false; - const accessibleResult = isSymbolAccessible( - sym, - decl, - meaning, - /*shouldComputeAliasesToMakeVisible*/ - false - ); - if (accessibleResult.accessibility === 0 /* Accessible */) { - const chain = lookupSymbolChainWorker(sym, context, meaning); - if (!(sym.flags & 4 /* Property */)) { - const root = chain[0]; - const contextFile = getSourceFileOfNode(oldcontext.enclosingDeclaration); - if (some(root.declarations, (d) => getSourceFileOfNode(d) === contextFile)) { - includePrivateSymbol(root); - } - } - } else if ((_b = oldcontext.tracker.inner) == null ? void 0 : _b.trackSymbol) { - return oldcontext.tracker.inner.trackSymbol(sym, decl, meaning); - } - return false; - } - }; - context.tracker = new SymbolTrackerImpl(context, tracker, oldcontext.tracker.moduleResolverHost); - forEachEntry(symbolTable, (symbol, name) => { - const baseName = unescapeLeadingUnderscores(name); - void getInternalSymbolName(symbol, baseName); - }); - let addingDeclare = !context.bundled; - const exportEquals = symbolTable.get("export=" /* ExportEquals */); - if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) { - symbolTable = createSymbolTable(); - symbolTable.set("export=" /* ExportEquals */, exportEquals); - } - visitSymbolTable(symbolTable); - return mergeRedundantStatements(results); - function isIdentifierAndNotUndefined(node) { - return !!node && node.kind === 80 /* Identifier */; - } - function getNamesOfDeclaration(statement) { - if (isVariableStatement(statement)) { - return filter(map(statement.declarationList.declarations, getNameOfDeclaration), isIdentifierAndNotUndefined); - } - return filter([getNameOfDeclaration(statement)], isIdentifierAndNotUndefined); - } - function flattenExportAssignedNamespace(statements) { - const exportAssignment = find(statements, isExportAssignment); - 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) & 32 /* Export */)); - const name = ns.name; - let body = ns.body; - if (length(excessExports)) { - ns = factory.updateModuleDeclaration( - ns, - ns.modifiers, - 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( - /*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, 32 /* Export */) || isExportAssignment(s) || isExportDeclaration(s)); - forEach(body.statements, (s) => { - addResult(s, mixinExportFlag ? 32 /* Export */ : 0 /* None */); - }); - statements = [...filter(statements, (s) => s !== ns && s !== exportAssignment), ...results]; - } - } - return statements; - } - function mergeExportDeclarations(statements) { - const exports2 = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause)); - if (length(exports2) > 1) { - const nonExports = filter(statements, (d) => !isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause); - statements = [ - ...nonExports, - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports(flatMap(exports2, (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) { - const groups = group(reexports, (decl) => isStringLiteral(decl.moduleSpecifier) ? ">" + decl.moduleSpecifier.text : ">"); - if (groups.length !== reexports.length) { - for (const group2 of groups) { - if (group2.length > 1) { - statements = [ - ...filter(statements, (s) => !group2.includes(s)), - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports(flatMap(group2, (e) => cast(e.exportClause, isNamedExports).elements)), - group2[0].moduleSpecifier - ) - ]; - } - } - } - } - return statements; - } - function inlineExportModifiers(statements) { - 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) => { - if (!e.propertyName && e.name.kind !== 11 /* StringLiteral */) { - const name = e.name; - const indices = indicesOf(statements); - const associatedIndices = filter(indices, (i) => nodeHasName(statements[i], name)); - if (length(associatedIndices) && every(associatedIndices, (i) => canHaveExportModifier(statements[i]))) { - for (const index2 of associatedIndices) { - statements[index2] = addExportModifier(statements[index2]); - } - return void 0; - } - } - return e; - }); - if (!length(replacements)) { - orderedRemoveItemAt(statements, index); - } else { - statements[index] = factory.updateExportDeclaration( - exportDecl, - exportDecl.modifiers, - exportDecl.isTypeOnly, - factory.updateNamedExports( - exportDecl.exportClause, - replacements - ), - exportDecl.moduleSpecifier, - exportDecl.attributes - ); - } - } - return statements; - } - function mergeRedundantStatements(statements) { - statements = flattenExportAssignedNamespace(statements); - statements = mergeExportDeclarations(statements); - statements = inlineExportModifiers(statements); - if (enclosingDeclaration && (isSourceFile(enclosingDeclaration) && isExternalOrCommonJsModule(enclosingDeclaration) || isModuleDeclaration(enclosingDeclaration)) && (!some(statements, isExternalModuleIndicator) || !hasScopeMarker(statements) && some(statements, needsScopeMarker))) { - statements.push(createEmptyExports(factory)); - } - return statements; - } - function addExportModifier(node) { - const flags = (getEffectiveModifierFlags(node) | 32 /* Export */) & ~128 /* Ambient */; - return factory.replaceModifiers(node, flags); - } - function removeExportModifier(node) { - const flags = getEffectiveModifierFlags(node) & ~32 /* Export */; - return factory.replaceModifiers(node, flags); - } - function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) { - if (!suppressNewPrivateContext) { - deferredPrivatesStack.push(/* @__PURE__ */ new Map()); - } - let i = 0; - const symbols = Array.from(symbolTable2.values()); - for (const symbol of symbols) { - i++; - if (checkTruncationLengthIfExpanding(context) && i + 2 < symbolTable2.size - 1) { - context.out.truncated = true; - results.push(createTruncationStatement(`... (${symbolTable2.size - i} more ...)`)); - serializeSymbol( - symbols[symbols.length - 1], - /*isPrivate*/ - false, - !!propertyAsAlias - ); - break; - } - serializeSymbol( - symbol, - /*isPrivate*/ - false, - !!propertyAsAlias - ); - } - if (!suppressNewPrivateContext) { - deferredPrivatesStack[deferredPrivatesStack.length - 1].forEach((symbol) => { - serializeSymbol( - symbol, - /*isPrivate*/ - true, - !!propertyAsAlias - ); - }); - deferredPrivatesStack.pop(); - } - } - function serializeSymbol(symbol, isPrivate, propertyAsAlias) { - void getPropertiesOfType(getTypeOfSymbol(symbol)); - const visitedSym = getMergedSymbol(symbol); - if (visitedSymbols.has(getSymbolId(visitedSym))) { - return; - } - visitedSymbols.add(getSymbolId(visitedSym)); - const skipMembershipCheck = !isPrivate; - if (skipMembershipCheck || !!length(symbol.declarations) && some(symbol.declarations, (d) => !!findAncestor(d, (n) => n === enclosingDeclaration))) { - const scopeCleanup = cloneNodeBuilderContext(context); - context.tracker.pushErrorFallbackNode(find(symbol.declarations, (d) => getSourceFileOfNode(d) === context.enclosingFile)); - serializeSymbolWorker(symbol, isPrivate, propertyAsAlias); - context.tracker.popErrorFallbackNode(); - scopeCleanup(); - } - } - function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) { - var _a2, _b, _c, _d, _e, _f, _g; - const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName); - const isDefault = escapedSymbolName === "default" /* Default */; - if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) { - context.encounteredError = true; - return; - } - let needsPostExportDefault = isDefault && !!(symbol.flags & -113 /* ExportDoesNotSupportDefaultModifier */ || symbol.flags & 16 /* Function */ && length(getPropertiesOfType(getTypeOfSymbol(symbol)))) && !(symbol.flags & 2097152 /* Alias */); - let needsExportDeclaration = !needsPostExportDefault && !isPrivate && isStringANonContextualKeyword(symbolName2) && !isDefault; - if (needsPostExportDefault || needsExportDeclaration) { - isPrivate = true; - } - 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); - } - if (symbol.flags & 524288 /* TypeAlias */) { - serializeTypeAlias(symbol, symbolName2, modifierFlags); - } - 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) { - needsExportDeclaration = false; - needsPostExportDefault = false; - } - } else { - const type = getTypeOfSymbol(symbol); - const localName = getInternalSymbolName(symbol, symbolName2); - 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 */) ? ((_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 = (_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; - context.approximateLength += 12 + (((_g = alias == null ? void 0 : alias.escapedText) == null ? void 0 : _g.length) ?? 0); - addResult( - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([factory.createExportSpecifier( - /*isTypeOnly*/ - false, - alias, - localName - )]) - ), - 0 /* None */ - ); - context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */); - } else { - const statement = setTextRange2( - context, - factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - serializeTypeForDeclaration( - context, - /*declaration*/ - void 0, - type, - symbol - ) - ) - ], flags) - ), - textRange - ); - context.approximateLength += 7 + name.length; - addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags); - if (name !== localName && !isPrivate) { - context.approximateLength += 16 + name.length + localName.length; - addResult( - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([factory.createExportSpecifier( - /*isTypeOnly*/ - false, - name, - localName - )]) - ), - 0 /* None */ - ); - needsExportDeclaration = false; - needsPostExportDefault = false; - } - } - } - } - } - if (symbol.flags & 384 /* Enum */) { - serializeEnum(symbol, symbolName2, modifierFlags); - } - if (symbol.flags & 32 /* Class */) { - if (symbol.flags & 4 /* Property */ && symbol.valueDeclaration && isBinaryExpression(symbol.valueDeclaration.parent) && isClassExpression(symbol.valueDeclaration.parent.right)) { - serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); - } else { - serializeAsClass(symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); - } - } - if (symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol)) || isConstMergedWithNSPrintableAsSignatureMerge) { - serializeModule(symbol, symbolName2, modifierFlags); - } - if (symbol.flags & 64 /* Interface */ && !(symbol.flags & 32 /* Class */)) { - serializeInterface(symbol, symbolName2, modifierFlags); - } - if (symbol.flags & 2097152 /* Alias */) { - serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); - } - if (symbol.flags & 4 /* Property */ && symbol.escapedName === "export=" /* ExportEquals */) { - serializeMaybeAliasAssignment(symbol); - } - if (symbol.flags & 8388608 /* ExportStar */) { - if (symbol.declarations) { - for (const node of symbol.declarations) { - const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); - if (!resolvedModule) continue; - const isTypeOnly = node.isTypeOnly; - const specifier = getSpecifierForModuleSymbol(resolvedModule, context); - context.approximateLength += 17 + specifier.length; - addResult(factory.createExportDeclaration( - /*modifiers*/ - void 0, - isTypeOnly, - /*exportClause*/ - void 0, - factory.createStringLiteral(specifier) - ), 0 /* None */); - } - } - } - if (needsPostExportDefault) { - const internalSymbolName = getInternalSymbolName(symbol, symbolName2); - context.approximateLength += 16 + internalSymbolName.length; - addResult(factory.createExportAssignment( - /*modifiers*/ - void 0, - /*isExportEquals*/ - false, - factory.createIdentifier(internalSymbolName) - ), 0 /* None */); - } else if (needsExportDeclaration) { - const internalSymbolName = getInternalSymbolName(symbol, symbolName2); - context.approximateLength += 22 + symbolName2.length + internalSymbolName.length; - addResult( - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([factory.createExportSpecifier( - /*isTypeOnly*/ - false, - internalSymbolName, - symbolName2 - )]) - ), - 0 /* None */ - ); - } - } - function includePrivateSymbol(symbol) { - if (some(symbol.declarations, isPartOfParameterDeclaration)) 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)); - deferredPrivatesStack[isExternalImportAlias ? 0 : deferredPrivatesStack.length - 1].set(getSymbolId(symbol), symbol); - } - function isExportingScope(enclosingDeclaration2) { - return isSourceFile(enclosingDeclaration2) && (isExternalOrCommonJsModule(enclosingDeclaration2) || isJsonSourceFile(enclosingDeclaration2)) || isAmbientModule(enclosingDeclaration2) && !isGlobalScopeAugmentation(enclosingDeclaration2); - } - function addResult(node, additionalModifierFlags) { - if (canHaveModifiers(node)) { - const oldModifierFlags = getEffectiveModifierFlags(node); - let newModifierFlags = 0 /* None */; - const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration); - if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) { - newModifierFlags |= 32 /* Export */; - } - 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 & 2048 /* Default */ && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) { - newModifierFlags |= 2048 /* Default */; - } - if (newModifierFlags) { - node = factory.replaceModifiers(node, newModifierFlags | oldModifierFlags); - } - context.approximateLength += modifiersLength(newModifierFlags | oldModifierFlags); - } - results.push(node); - } - function serializeTypeAlias(symbol, symbolName2, modifierFlags) { - var _a2; - const aliasType = getDeclaredTypeOfTypeAlias(symbol); - const typeParams = getSymbolLinks(symbol).typeParameters; - const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context)); - const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias); - const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0); - const restoreFlags = saveRestoreFlags(context); - context.flags |= 8388608 /* InTypeAlias */; - const oldEnclosingDecl = context.enclosingDeclaration; - context.enclosingDeclaration = jsdocAliasDecl; - const typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression && isJSDocTypeExpression(jsdocAliasDecl.typeExpression) && syntacticNodeBuilder.tryReuseExistingTypeNode(context, jsdocAliasDecl.typeExpression.type) || typeToTypeNodeHelper(aliasType, context); - const internalSymbolName = getInternalSymbolName(symbol, symbolName2); - context.approximateLength += 8 + ((commentText == null ? void 0 : commentText.length) ?? 0) + internalSymbolName.length; - addResult( - setSyntheticLeadingComments( - factory.createTypeAliasDeclaration( - /*modifiers*/ - void 0, - internalSymbolName, - typeParamDecls, - typeNode - ), - !commentText ? [] : [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }] - ), - modifierFlags - ); - restoreFlags(); - context.enclosingDeclaration = oldEnclosingDecl; - } - function serializeInterface(symbol, symbolName2, modifierFlags) { - const internalSymbolName = getInternalSymbolName(symbol, symbolName2); - context.approximateLength += 14 + internalSymbolName.length; - const interfaceType = getDeclaredTypeOfClassOrInterface(symbol); - const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - const typeParamDecls = map(localParams, (p) => typeParameterToDeclaration(p, context)); - const baseTypes = getBaseTypes(interfaceType); - const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0; - const members = serializePropertySymbolsForClassOrInterface( - getPropertiesOfType(interfaceType), - /*isClass*/ - false, - baseType - ); - const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 180 /* CallSignature */); - const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 181 /* 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, - internalSymbolName, - typeParamDecls, - heritageClauses, - [...indexSignatures, ...constructSignatures, ...callSignatures, ...members] - ), - modifierFlags - ); - } - function serializePropertySymbolsForClassOrInterface(props, isClass, baseType, isStatic2) { - const elements = []; - let i = 0; - for (const prop of props) { - i++; - if (checkTruncationLengthIfExpanding(context) && i + 2 < props.length - 1) { - context.out.truncated = true; - const placeholder = createTruncationProperty(`... ${props.length - i} more ... `, isClass); - elements.push(placeholder); - const result2 = isClass ? serializePropertySymbolForClass(props[props.length - 1], isStatic2, baseType) : serializePropertySymbolForInterface(props[props.length - 1], baseType); - if (isArray(result2)) { - elements.push(...result2); - } else { - elements.push(result2); - } - break; - } - context.approximateLength += 1; - const result = isClass ? serializePropertySymbolForClass(prop, isStatic2, baseType) : serializePropertySymbolForInterface(prop, baseType); - if (isArray(result)) { - elements.push(...result); - } else { - elements.push(result); - } - } - return elements; - } - function createTruncationProperty(dotDotDotText, isClass) { - if (context.flags & 1 /* NoTruncation */) { - return addSyntheticLeadingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, dotDotDotText); - } - return isClass ? factory.createPropertyDeclaration( - /*modifiers*/ - void 0, - dotDotDotText, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ) : factory.createPropertySignature( - /*modifiers*/ - void 0, - dotDotDotText, - /*questionToken*/ - void 0, - /*type*/ - void 0 - ); - } - function getNamespaceMembersForSerialization(symbol) { - let exports2 = arrayFrom(getExportsOfSymbol(symbol).values()); - const merged = getMergedSymbol(symbol); - if (merged !== symbol) { - const membersSet = new Set(exports2); - for (const exported of getExportsOfSymbol(merged).values()) { - if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) { - membersSet.add(exported); - } - } - exports2 = arrayFrom(membersSet); - } - return filter(exports2, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */)); - } - function isTypeOnlyNamespace(symbol) { - return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */)); - } - function serializeModule(symbol, symbolName2, modifierFlags) { - const members = getNamespaceMembersForSerialization(symbol); - const expanding = isExpanding(context); - const locationMap = arrayToMultiMap(members, (m) => m.parent && m.parent === symbol || expanding ? "real" : "merged"); - const realMembers = locationMap.get("real") || emptyArray; - const mergedMembers = locationMap.get("merged") || emptyArray; - if (length(realMembers) || expanding) { - let localName; - if (expanding) { - const oldFlags = context.flags; - context.flags |= 512 /* WriteTypeParametersInQualifiedName */ | 2 /* UseOnlyExternalAliasing */; - localName = symbolToNode( - symbol, - context, - /*meaning*/ - -1 /* All */ - ); - context.flags = oldFlags; - } else { - const localText = getInternalSymbolName(symbol, symbolName2); - localName = factory.createIdentifier(localText); - context.approximateLength += localText.length; - } - serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 /* Function */ | 67108864 /* Assignment */))); - } - if (length(mergedMembers)) { - const containingFile = getSourceFileOfNode(context.enclosingDeclaration); - const localName = getInternalSymbolName(symbol, symbolName2); - const nsBody = factory.createModuleBlock([factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => { - 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 = (_a2 = context.tracker) == null ? void 0 : _a2.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a2, containingFile, symbol, s); - return void 0; - } - const target = aliasDecl && getTargetOfAliasDeclaration( - aliasDecl, - /*dontRecursivelyResolve*/ - true - ); - includePrivateSymbol(target || s); - const targetName = target ? getInternalSymbolName(target, unescapeLeadingUnderscores(target.escapedName)) : localName2; - return factory.createExportSpecifier( - /*isTypeOnly*/ - false, - name === targetName ? void 0 : targetName, - name - ); - })) - )]); - addResult( - factory.createModuleDeclaration( - /*modifiers*/ - void 0, - factory.createIdentifier(localName), - nsBody, - 32 /* Namespace */ - ), - 0 /* None */ - ); - } - } - function serializeEnum(symbol, symbolName2, modifierFlags) { - const internalSymbolName = getInternalSymbolName(symbol, symbolName2); - context.approximateLength += 9 + internalSymbolName.length; - const members = []; - const memberProps = filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)); - let i = 0; - for (const p of memberProps) { - i++; - if (checkTruncationLengthIfExpanding(context) && i + 2 < memberProps.length - 1) { - context.out.truncated = true; - members.push(factory.createEnumMember(` ... ${memberProps.length - i} more ... `)); - const last2 = memberProps[memberProps.length - 1]; - const initializedValue = last2.declarations && last2.declarations[0] && isEnumMember(last2.declarations[0]) ? getConstantValue2(last2.declarations[0]) : void 0; - const initializer2 = initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue); - const memberName2 = unescapeLeadingUnderscores(last2.escapedName); - const member2 = factory.createEnumMember( - memberName2, - initializer2 - ); - members.push(member2); - break; - } - const memberDecl = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? p.declarations[0] : void 0; - let initializer; - let initializerLength; - if (isExpanding(context) && memberDecl && memberDecl.initializer) { - initializer = getSynthesizedDeepClone(memberDecl.initializer); - initializerLength = memberDecl.initializer.end - memberDecl.initializer.pos; - } else { - const initializedValue = memberDecl && getConstantValue2(memberDecl); - initializer = initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue); - initializerLength = (initializer == null ? void 0 : initializer.text.length) ?? 0; - } - const memberName = unescapeLeadingUnderscores(p.escapedName); - context.approximateLength += 4 + memberName.length + initializerLength; - const member = factory.createEnumMember( - memberName, - initializer - ); - members.push(member); - } - addResult( - factory.createEnumDeclaration( - factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0), - internalSymbolName, - members - ), - modifierFlags - ); - } - function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) { - const signatures = getSignaturesOfType(type, 0 /* Call */); - for (const sig of signatures) { - context.approximateLength += 1; - const decl = signatureToSignatureDeclarationHelper(sig, 263 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName) }); - addResult(setTextRange2(context, decl, getSignatureTextRangeLocation(sig)), modifierFlags); - } - if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) { - const props = filter(getPropertiesOfType(type), isNamespaceMember); - context.approximateLength += localName.length; - serializeAsNamespaceDeclaration( - props, - factory.createIdentifier(localName), - modifierFlags, - /*suppressNewPrivateContext*/ - true - ); - } - } - function createTruncationStatement(dotDotDotText) { - if (context.flags & 1 /* NoTruncation */) { - return addSyntheticLeadingComment(factory.createEmptyStatement(), 3 /* MultiLineCommentTrivia */, dotDotDotText); - } - return factory.createExpressionStatement(factory.createIdentifier(dotDotDotText)); - } - function getSignatureTextRangeLocation(signature) { - if (signature.declaration && signature.declaration.parent) { - if (isBinaryExpression(signature.declaration.parent) && getAssignmentDeclarationKind(signature.declaration.parent) === 5 /* Property */) { - return signature.declaration.parent; - } - if (isVariableDeclaration(signature.declaration.parent) && signature.declaration.parent.parent) { - return signature.declaration.parent.parent; - } - } - return signature.declaration; - } - function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) { - const nodeFlags = isIdentifier(localName) ? 32 /* Namespace */ : 0 /* None */; - const expanding = isExpanding(context); - if (length(props)) { - context.approximateLength += 14; - const localVsRemoteMap = arrayToMultiMap(props, (p) => !length(p.declarations) || some(p.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)) || expanding ? "local" : "remote"); - const localProps = localVsRemoteMap.get("local") || emptyArray; - let fakespace = parseNodeFactory.createModuleDeclaration( - /*modifiers*/ - void 0, - localName, - factory.createModuleBlock([]), - nodeFlags - ); - setParent(fakespace, enclosingDeclaration); - fakespace.locals = createSymbolTable(props); - fakespace.symbol = props[0].parent; - const oldResults = results; - results = []; - const oldAddingDeclare = addingDeclare; - addingDeclare = false; - const subcontext = { ...context, enclosingDeclaration: fakespace }; - const oldContext = context; - context = subcontext; - visitSymbolTable( - createSymbolTable(localProps), - suppressNewPrivateContext, - /*propertyAsAlias*/ - true - ); - context = oldContext; - addingDeclare = oldAddingDeclare; - const declarations = results; - results = oldResults; - const defaultReplaced = map(declarations, (d) => isExportAssignment(d) && !d.isExportEquals && isIdentifier(d.expression) ? factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([factory.createExportSpecifier( - /*isTypeOnly*/ - false, - d.expression, - factory.createIdentifier("default" /* Default */) - )]) - ) : d); - const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d, 32 /* Export */)) ? map(defaultReplaced, removeExportModifier) : defaultReplaced; - fakespace = factory.updateModuleDeclaration( - fakespace, - fakespace.modifiers, - fakespace.name, - factory.createModuleBlock(exportModifierStripped) - ); - addResult(fakespace, modifierFlags); - } else if (expanding) { - context.approximateLength += 14; - addResult( - factory.createModuleDeclaration( - /*modifiers*/ - void 0, - localName, - factory.createModuleBlock([]), - nodeFlags - ), - modifierFlags - ); - } - } - function isNamespaceMember(p) { - return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) || !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && isStatic(p.valueDeclaration) && isClassLike(p.valueDeclaration.parent)); - } - function sanitizeJSDocImplements(clauses) { - const result = mapDefined(clauses, (e) => { - const oldEnclosing = context.enclosingDeclaration; - context.enclosingDeclaration = e; - let expr = e.expression; - if (isEntityNameExpression(expr)) { - if (isIdentifier(expr) && idText(expr) === "") { - return cleanup( - /*result*/ - void 0 - ); - } - let introducesError; - ({ introducesError, node: expr } = trackExistingEntityName(expr, context)); - if (introducesError) { - return cleanup( - /*result*/ - void 0 - ); - } - } - return cleanup(factory.createExpressionWithTypeArguments( - expr, - map(e.typeArguments, (a) => syntacticNodeBuilder.tryReuseExistingTypeNode(context, a) || typeToTypeNodeHelper(getTypeFromTypeNode2(context, a), context)) - )); - function cleanup(result2) { - context.enclosingDeclaration = oldEnclosing; - return result2; - } - }); - if (result.length === clauses.length) { - return result; - } - return void 0; - } - function serializeAsClass(symbol, localName, modifierFlags) { - var _a2, _b; - context.approximateLength += 9 + localName.length; - const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike); - const oldEnclosing = context.enclosingDeclaration; - context.enclosingDeclaration = originalDecl || oldEnclosing; - const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - const typeParamDecls = map(localParams, (p) => typeParameterToDeclaration(p, context)); - forEach(localParams, (p) => context.approximateLength += symbolName(p.symbol).length); - const classType = getTypeWithThisArgument(getDeclaredTypeOfClassOrInterface(symbol)); - const baseTypes = getBaseTypes(classType); - const originalImplements = originalDecl && getEffectiveImplementsTypeNodes(originalDecl); - const implementsExpressions = originalImplements && sanitizeJSDocImplements(originalImplements) || mapDefined(getImplementsTypes(classType), serializeImplementedType); - const staticType = getTypeOfSymbol(symbol); - const isClass = !!((_b = staticType.symbol) == null ? void 0 : _b.valueDeclaration) && isClassLike(staticType.symbol.valueDeclaration); - const staticBaseType = isClass ? getBaseConstructorTypeOfClass(staticType) : anyType; - context.approximateLength += (length(baseTypes) ? 8 : 0) + (length(implementsExpressions) ? 11 : 0); - const heritageClauses = [ - ...!length(baseTypes) ? [] : [factory.createHeritageClause(96 /* ExtendsKeyword */, map(baseTypes, (b) => serializeBaseType(b, staticBaseType, localName)))], - ...!length(implementsExpressions) ? [] : [factory.createHeritageClause(119 /* ImplementsKeyword */, implementsExpressions)] - ]; - const symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType)); - const publicSymbolProps = filter(symbolProps, (s) => !isHashPrivate(s)); - const hasPrivateIdentifier = some(symbolProps, isHashPrivate); - const privateProperties = hasPrivateIdentifier ? isExpanding(context) ? serializePropertySymbolsForClassOrInterface( - filter(symbolProps, isHashPrivate), - /*isClass*/ - true, - baseTypes[0], - /*isStatic*/ - false - ) : [factory.createPropertyDeclaration( - /*modifiers*/ - void 0, - factory.createPrivateIdentifier("#private"), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - )] : emptyArray; - if (hasPrivateIdentifier && !isExpanding(context)) { - context.approximateLength += 9; - } - const publicProperties = serializePropertySymbolsForClassOrInterface( - publicSymbolProps, - /*isClass*/ - true, - baseTypes[0], - /*isStatic*/ - false - ); - const staticMembers = serializePropertySymbolsForClassOrInterface( - filter(getPropertiesOfType(staticType), (p) => !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype" && !isNamespaceMember(p)), - /*isClass*/ - true, - staticBaseType, - /*isStatic*/ - true - ); - const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */)); - if (isNonConstructableClassLikeInJsFile) context.approximateLength += 21; - const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration( - factory.createModifiersFromModifierFlags(2 /* Private */), - [], - /*body*/ - void 0 - )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 177 /* Constructor */); - const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); - context.enclosingDeclaration = oldEnclosing; - addResult( - setTextRange2( - context, - 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) => { - if (isImportSpecifier(d) || isExportSpecifier(d)) { - return moduleExportNameTextUnescaped(d.propertyName || d.name); - } - if (isBinaryExpression(d) || isExportAssignment(d)) { - const expression = isExportAssignment(d) ? d.expression : d.right; - if (isPropertyAccessExpression(expression)) { - return idText(expression.name); - } - } - if (isAliasSymbolDeclaration(d)) { - const name = getNameOfDeclaration(d); - if (name && isIdentifier(name)) { - return idText(name); - } - } - return void 0; - }); - } - function serializeAsAlias(symbol, localName, modifierFlags) { - var _a2, _b, _c, _d, _e; - const node = getDeclarationOfAliasSymbol(symbol); - if (!node) return Debug.fail(); - const target = getMergedSymbol(getTargetOfAliasDeclaration( - node, - /*dontRecursivelyResolve*/ - true - )); - if (!target) { - return; - } - let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName); - if (verbatimTargetName === "export=" /* ExportEquals */ && allowSyntheticDefaultImports) { - verbatimTargetName = "default" /* Default */; - } - const targetName = getInternalSymbolName(target, verbatimTargetName); - includePrivateSymbol(target); - switch (node.kind) { - case 209 /* BindingElement */: - if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 261 /* VariableDeclaration */) { - const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); - const { propertyName } = node; - const propertyNameText = propertyName && isIdentifier(propertyName) ? idText(propertyName) : void 0; - context.approximateLength += 24 + localName.length + specifier2.length + ((propertyNameText == null ? void 0 : propertyNameText.length) ?? 0); - addResult( - factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /*phaseModifier*/ - void 0, - /*name*/ - void 0, - factory.createNamedImports([factory.createImportSpecifier( - /*isTypeOnly*/ - false, - propertyNameText ? factory.createIdentifier(propertyNameText) : void 0, - factory.createIdentifier(localName) - )]) - ), - factory.createStringLiteral(specifier2), - /*attributes*/ - void 0 - ), - 0 /* None */ - ); - break; - } - Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); - break; - case 305 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 227 /* BinaryExpression */) { - serializeExportSpecifier( - unescapeLeadingUnderscores(symbol.escapedName), - targetName - ); - } - break; - case 261 /* VariableDeclaration */: - if (isPropertyAccessExpression(node.initializer)) { - const initializer = node.initializer; - const uniqueName = factory.createUniqueName(localName); - const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); - context.approximateLength += 22 + specifier2.length + idText(uniqueName).length; - addResult( - factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - uniqueName, - factory.createExternalModuleReference(factory.createStringLiteral(specifier2)) - ), - 0 /* None */ - ); - context.approximateLength += 12 + localName.length + idText(uniqueName).length + idText(initializer.name).length; - addResult( - factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createIdentifier(localName), - factory.createQualifiedName(uniqueName, initializer.name) - ), - modifierFlags - ); - break; - } - // else fall through and treat commonjs require just like import= - case 272 /* 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); - context.approximateLength += 11 + localName.length + unescapeLeadingUnderscores(target.escapedName).length; - 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 271 /* NamespaceExportDeclaration */: - addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */); - break; - case 274 /* ImportClause */: { - const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); - const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier; - const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0; - const isTypeOnly = isJSDocImportTag(node.parent); - context.approximateLength += 14 + localName.length + 3 + (isTypeOnly ? 4 : 0); - addResult( - factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /* phaseModifier */ - isTypeOnly ? 156 /* TypeKeyword */ : void 0, - factory.createIdentifier(localName), - /*namedBindings*/ - void 0 - ), - specifier2, - attributes - ), - 0 /* None */ - ); - break; - } - case 275 /* NamespaceImport */: { - const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); - const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier; - const isTypeOnly = isJSDocImportTag(node.parent.parent); - context.approximateLength += 19 + localName.length + 3 + (isTypeOnly ? 4 : 0); - addResult( - factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /* phaseModifier */ - isTypeOnly ? 156 /* TypeKeyword */ : void 0, - /*name*/ - void 0, - factory.createNamespaceImport(factory.createIdentifier(localName)) - ), - specifier2, - node.parent.attributes - ), - 0 /* None */ - ); - break; - } - case 281 /* NamespaceExport */: - context.approximateLength += 19 + localName.length + 3; - addResult( - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamespaceExport(factory.createIdentifier(localName)), - factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)) - ), - 0 /* None */ - ); - break; - case 277 /* ImportSpecifier */: { - const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); - const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier; - const isTypeOnly = isJSDocImportTag(node.parent.parent.parent); - context.approximateLength += 19 + localName.length + 3 + (isTypeOnly ? 4 : 0); - addResult( - factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /* phaseModifier */ - isTypeOnly ? 156 /* TypeKeyword */ : void 0, - /*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 - ), - 0 /* None */ - ); - break; - } - case 282 /* ExportSpecifier */: - const specifier = node.parent.parent.moduleSpecifier; - if (specifier) { - const propertyName = node.propertyName; - if (propertyName && moduleExportNameIsDefault(propertyName)) { - verbatimTargetName = "default" /* Default */; - } - } - serializeExportSpecifier( - unescapeLeadingUnderscores(symbol.escapedName), - specifier ? verbatimTargetName : targetName, - specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0 - ); - break; - case 278 /* ExportAssignment */: - serializeMaybeAliasAssignment(symbol); - break; - case 227 /* BinaryExpression */: - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) { - serializeMaybeAliasAssignment(symbol); - } else { - serializeExportSpecifier(localName, targetName); - } - break; - default: - return Debug.failBadSyntaxKind(node, "Unhandled alias declaration kind in symbol serializer!"); - } - } - function serializeExportSpecifier(localName, targetName, specifier) { - context.approximateLength += 16 + localName.length + (localName !== targetName ? targetName.length : 0); - addResult( - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([factory.createExportSpecifier( - /*isTypeOnly*/ - false, - localName !== targetName ? targetName : void 0, - localName - )]), - specifier - ), - 0 /* None */ - ); - } - function serializeMaybeAliasAssignment(symbol) { - var _a2; - if (symbol.flags & 4194304 /* Prototype */) { - return false; - } - const name = unescapeLeadingUnderscores(symbol.escapedName); - const isExportEquals = name === "export=" /* ExportEquals */; - const isDefault = name === "default" /* Default */; - const isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; - const aliasDecl = symbol.declarations && getDeclarationOfAliasSymbol(symbol); - const target = aliasDecl && getTargetOfAliasDeclaration( - aliasDecl, - /*dontRecursivelyResolve*/ - true - ); - if (target && length(target.declarations) && some(target.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(enclosingDeclaration))) { - const expr = aliasDecl && (isExportAssignment(aliasDecl) || isBinaryExpression(aliasDecl) ? getExportAssignmentExpression(aliasDecl) : getPropertyAssignmentAliasLikeExpression(aliasDecl)); - const first2 = expr && isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : void 0; - const referenced = first2 && resolveEntityName( - first2, - -1 /* All */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - enclosingDeclaration - ); - if (referenced || target) { - includePrivateSymbol(referenced || target); - } - const prevDisableTrackSymbol = context.tracker.disableTrackSymbol; - context.tracker.disableTrackSymbol = true; - if (isExportAssignmentCompatibleSymbolName) { - context.approximateLength += 10; - results.push(factory.createExportAssignment( - /*modifiers*/ - void 0, - isExportEquals, - symbolToExpression(target, context, -1 /* All */) - )); - } else { - if (first2 === expr && first2) { - serializeExportSpecifier(name, idText(first2)); - } else if (expr && isClassExpression(expr)) { - serializeExportSpecifier(name, getInternalSymbolName(target, symbolName(target))); - } else { - const varName = getUnusedName(name, symbol); - context.approximateLength += varName.length + 10; - addResult( - factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createIdentifier(varName), - symbolToName( - target, - context, - -1 /* All */, - /*expectsIdentifier*/ - false - ) - ), - 0 /* None */ - ); - serializeExportSpecifier(name, varName); - } - } - context.tracker.disableTrackSymbol = prevDisableTrackSymbol; - return true; - } else { - const varName = getUnusedName(name, symbol); - const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); - if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */); - } else { - const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 268 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */; - context.approximateLength += varName.length + 5; - const statement = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - varName, - /*exclamationToken*/ - void 0, - serializeTypeForDeclaration( - context, - /*declaration*/ - void 0, - typeToSerialize, - symbol - ) - ) - ], flags) - ); - addResult( - statement, - target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 128 /* Ambient */ : name === varName ? 32 /* Export */ : 0 /* None */ - ); - } - if (isExportAssignmentCompatibleSymbolName) { - context.approximateLength += varName.length + 10; - results.push(factory.createExportAssignment( - /*modifiers*/ - void 0, - isExportEquals, - factory.createIdentifier(varName) - )); - return true; - } else if (name !== varName) { - serializeExportSpecifier(name, varName); - return true; - } - return false; - } - } - function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) { - var _a2; - const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration); - return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !some((_a2 = typeToSerialize.symbol) == null ? void 0 : _a2.declarations, isTypeNode) && // If the type comes straight from a type node, we shouldn't try to break it up - !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) => { - 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 _a2, _b, _c, _d, _e, _f; - const modifierFlags = getDeclarationModifierFlagsFromSymbol(p); - const omitType = !!(modifierFlags & 2 /* Private */) && !isExpanding(context); - 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 & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0); - const name = getPropertyNameNodeForSymbol(p, context); - 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 */) { - const setter = p.declarations && forEach(p.declarations, (d) => { - if (d.kind === 179 /* 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; - const setterDeclaration = (_b = p.declarations) == null ? void 0 : _b.find(isSetAccessor); - context.approximateLength += modifiersLength(flag) + 7 + (paramSymbol ? symbolName(paramSymbol).length : 5) + (omitType ? 0 : 2); - result.push(setTextRange2( - context, - factory.createSetAccessorDeclaration( - factory.createModifiersFromModifierFlags(flag), - name, - [factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - paramSymbol ? parameterToParameterDeclarationName(paramSymbol, getEffectiveParameterDeclaration(paramSymbol), context) : "value", - /*questionToken*/ - void 0, - omitType ? void 0 : serializeTypeForDeclaration(context, setterDeclaration, getWriteTypeOfSymbol(p), p) - )], - /*body*/ - void 0 - ), - setterDeclaration ?? firstPropertyLikeDecl - )); - } - if (p.flags & 32768 /* GetAccessor */) { - const getterDeclaration = (_c = p.declarations) == null ? void 0 : _c.find(isGetAccessor); - context.approximateLength += modifiersLength(flag) + 8 + (omitType ? 0 : 2); - result.push(setTextRange2( - context, - factory.createGetAccessorDeclaration( - factory.createModifiersFromModifierFlags(flag), - name, - [], - omitType ? void 0 : serializeTypeForDeclaration(context, getterDeclaration, getTypeOfSymbol(p), p), - /*body*/ - void 0 - ), - getterDeclaration ?? firstPropertyLikeDecl - )); - } - return result; - } else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { - const modifierFlags2 = (isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag; - context.approximateLength += 2 + (omitType ? 0 : 2) + modifiersLength(modifierFlags2); - return setTextRange2( - context, - createProperty2( - factory.createModifiersFromModifierFlags(modifierFlags2), - name, - p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - omitType ? void 0 : serializeTypeForDeclaration(context, (_d = p.declarations) == null ? void 0 : _d.find(isSetAccessorDeclaration), getWriteTypeOfSymbol(p), p), - // 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(or(isPropertyDeclaration, isVariableDeclaration))) || firstPropertyLikeDecl - ); - } - if (p.flags & (8192 /* Method */ | 16 /* Function */)) { - const type = getTypeOfSymbol(p); - const signatures = getSignaturesOfType(type, 0 /* Call */); - if (omitType) { - const modifierFlags2 = (isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag; - context.approximateLength += 1 + modifiersLength(modifierFlags2); - return setTextRange2( - context, - createProperty2( - factory.createModifiersFromModifierFlags(modifierFlags2), - name, - p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), - ((_f = p.declarations) == null ? void 0 : _f.find(isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p.declarations && p.declarations[0] - ); - } - const results2 = []; - for (const sig of signatures) { - context.approximateLength += 1; - const decl = signatureToSignatureDeclarationHelper( - sig, - methodKind, - context, - { - name, - questionToken: p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - modifiers: flag ? factory.createModifiersFromModifierFlags(flag) : void 0 - } - ); - const location = sig.declaration && isPrototypePropertyAssignment(sig.declaration.parent) ? sig.declaration.parent : sig.declaration; - results2.push(setTextRange2(context, decl, location)); - } - return results2; - } - return Debug.fail(`Unhandled class member kind! ${p.__debugFlags || p.flags}`); - }; - } - function modifiersLength(flags) { - let result = 0; - if (flags & 32 /* Export */) result += 7; - if (flags & 128 /* Ambient */) result += 8; - if (flags & 2048 /* Default */) result += 8; - if (flags & 4096 /* Const */) result += 6; - if (flags & 1 /* Public */) result += 7; - if (flags & 2 /* Private */) result += 8; - if (flags & 4 /* Protected */) result += 10; - if (flags & 64 /* Abstract */) result += 9; - if (flags & 256 /* Static */) result += 7; - if (flags & 16 /* Override */) result += 9; - if (flags & 8 /* Readonly */) result += 9; - if (flags & 512 /* Accessor */) result += 9; - if (flags & 1024 /* Async */) result += 6; - if (flags & 8192 /* In */) result += 3; - if (flags & 16384 /* Out */) result += 4; - return result; - } - function serializePropertySymbolForInterface(p, baseType) { - return serializePropertySymbolForInterfaceWorker( - p, - /*isStatic*/ - false, - baseType - ); - } - function serializeSignatures(kind, input, baseType, outputKind) { - const signatures = getSignaturesOfType(input, kind); - if (kind === 1 /* Construct */) { - if (!baseType && every(signatures, (s) => length(s.parameters) === 0)) { - return []; - } - if (baseType) { - const baseSigs = getSignaturesOfType(baseType, 1 /* Construct */); - if (!length(baseSigs) && every(signatures, (s) => length(s.parameters) === 0)) { - return []; - } - if (baseSigs.length === signatures.length) { - let failed2 = false; - for (let i = 0; i < baseSigs.length; i++) { - if (!compareSignaturesIdentical( - signatures[i], - baseSigs[i], - /*partialMatch*/ - false, - /*ignoreThisTypes*/ - false, - /*ignoreReturnTypes*/ - true, - compareTypesIdentical - )) { - failed2 = true; - break; - } - } - if (!failed2) { - return []; - } - } - } - let privateProtected = 0; - for (const s of signatures) { - if (s.declaration) { - privateProtected |= getSelectedEffectiveModifierFlags(s.declaration, 2 /* Private */ | 4 /* Protected */); - } - } - if (privateProtected) { - return [setTextRange2( - context, - factory.createConstructorDeclaration( - factory.createModifiersFromModifierFlags(privateProtected), - /*parameters*/ - [], - /*body*/ - void 0 - ), - signatures[0].declaration - )]; - } - } - const results2 = []; - for (const sig of signatures) { - context.approximateLength += 1; - const decl = signatureToSignatureDeclarationHelper(sig, outputKind, context); - results2.push(setTextRange2(context, decl, sig.declaration)); - } - return results2; - } - function serializeIndexSignatures(input, baseType) { - const results2 = []; - for (const info of getIndexInfosOfType(input)) { - if (baseType) { - const baseInfo = getIndexInfoOfType(baseType, info.keyType); - if (baseInfo) { - if (isTypeIdenticalTo(info.type, baseInfo.type)) { - continue; - } - } - } - results2.push(indexInfoToIndexSignatureDeclarationHelper( - info, - context, - /*typeNode*/ - void 0 - )); - } - return results2; - } - function serializeBaseType(t, staticType, rootName) { - const ref = trySerializeAsTypeReference(t, 111551 /* Value */); - if (ref) { - return ref; - } - const tempName = getUnusedName(`${rootName}_base`); - const statement = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - tempName, - /*exclamationToken*/ - void 0, - typeToTypeNodeHelper(staticType, context) - ) - ], 2 /* Const */) - ); - addResult(statement, 0 /* None */); - return factory.createExpressionWithTypeArguments( - factory.createIdentifier(tempName), - /*typeArguments*/ - void 0 - ); - } - function trySerializeAsTypeReference(t, flags) { - let typeArgs; - let reference; - if (t.target && isSymbolAccessibleByFlags(t.target.symbol, enclosingDeclaration, flags)) { - typeArgs = map(getTypeArguments(t), (t2) => typeToTypeNodeHelper(t2, context)); - reference = symbolToExpression(t.target.symbol, context, 788968 /* Type */); - } else if (t.symbol && isSymbolAccessibleByFlags(t.symbol, enclosingDeclaration, flags)) { - reference = symbolToExpression(t.symbol, context, 788968 /* Type */); - } - if (reference) { - return factory.createExpressionWithTypeArguments(reference, typeArgs); - } - } - function serializeImplementedType(t) { - const ref = trySerializeAsTypeReference(t, 788968 /* Type */); - if (ref) { - return ref; - } - if (t.symbol) { - return factory.createExpressionWithTypeArguments( - symbolToExpression(t.symbol, context, 788968 /* Type */), - /*typeArguments*/ - void 0 - ); - } - } - function getUnusedName(input, symbol) { - var _a2, _b; - const id = symbol ? getSymbolId(symbol) : void 0; - if (id) { - if (context.remappedSymbolNames.has(id)) { - return context.remappedSymbolNames.get(id); - } - } - if (symbol) { - input = getNameCandidateWorker(symbol, input); - } - let i = 0; - const original = input; - while ((_a2 = context.usedSymbolNames) == null ? void 0 : _a2.has(input)) { - i++; - input = `${original}_${i}`; - } - (_b = context.usedSymbolNames) == null ? void 0 : _b.add(input); - if (id) { - context.remappedSymbolNames.set(id, input); - } - return input; - } - function getNameCandidateWorker(symbol, localName) { - if (localName === "default" /* Default */ || localName === "__class" /* Class */ || localName === "__function" /* Function */) { - const restoreFlags = saveRestoreFlags(context); - context.flags |= 16777216 /* InInitialEntityName */; - const nameCandidate = getNameOfSymbolAsWritten(symbol, context); - restoreFlags(); - localName = nameCandidate.length > 0 && isSingleOrDoubleQuote(nameCandidate.charCodeAt(0)) ? stripQuotes(nameCandidate) : nameCandidate; - } - if (localName === "default" /* Default */) { - localName = "_default"; - } else if (localName === "export=" /* ExportEquals */) { - localName = "_exports"; - } - localName = isIdentifierText(localName, languageVersion) && !isStringANonContextualKeyword(localName) ? localName : "_" + localName.replace(/[^a-z0-9]/gi, "_"); - return localName; - } - function getInternalSymbolName(symbol, localName) { - const id = getSymbolId(symbol); - if (context.remappedSymbolNames.has(id)) { - return context.remappedSymbolNames.get(id); - } - localName = getNameCandidateWorker(symbol, localName); - context.remappedSymbolNames.set(id, localName); - return localName; - } - } - function isExpanding(context) { - return context.maxExpansionDepth !== -1; - } - function isHashPrivate(s) { - return !!s.valueDeclaration && isNamedDeclaration(s.valueDeclaration) && isPrivateIdentifier(s.valueDeclaration.name); - } - function getClonedHashPrivateName(s) { - if (s.valueDeclaration && isNamedDeclaration(s.valueDeclaration) && isPrivateIdentifier(s.valueDeclaration.name)) { - return factory.cloneNode(s.valueDeclaration.name); - } - return void 0; - } - } - function isLibType(type) { - var _a; - const symbol = (getObjectFlags(type) & 4 /* Reference */) !== 0 ? type.target.symbol : type.symbol; - return isTupleType(type) || !!((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.some((decl) => host.isSourceFileDefaultLibrary(getSourceFileOfNode(decl)))); - } - function typePredicateToString(typePredicate, enclosingDeclaration, flags = 16384 /* UseAliasDefinedOutsideCurrentScope */, writer) { - return writer ? typePredicateToStringWorker(writer).getText() : usingSingleLineStringWriter(typePredicateToStringWorker); - function typePredicateToStringWorker(writer2) { - const nodeBuilderFlags = toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */; - const predicate = nodeBuilder.typePredicateToTypePredicateNode(typePredicate, enclosingDeclaration, nodeBuilderFlags); - const printer = createPrinterWithRemoveComments(); - const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); - printer.writeNode( - 4 /* Unspecified */, - predicate, - /*sourceFile*/ - sourceFile, - writer2 - ); - return writer2; - } - } - function formatUnionTypes(types, expandingEnum) { - const result = []; - let flags = 0; - for (let i = 0; i < types.length; i++) { - const t = types[i]; - flags |= t.flags; - if (!(t.flags & 98304 /* Nullable */)) { - if (t.flags & 512 /* BooleanLiteral */ || !expandingEnum && t.flags | 1056 /* EnumLike */) { - const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t); - if (baseType.flags & 1048576 /* Union */) { - const count = baseType.types.length; - if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) { - result.push(baseType); - i += count - 1; - continue; - } - } - } - result.push(t); - } - } - if (flags & 65536 /* Null */) result.push(nullType); - if (flags & 32768 /* Undefined */) result.push(undefinedType); - return result || types; - } - function visibilityToString(flags) { - if (flags === 2 /* Private */) { - return "private"; - } - if (flags === 4 /* Protected */) { - return "protected"; - } - return "public"; - } - function getTypeAliasForTypeLiteral(type) { - if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && type.symbol.declarations) { - const node = walkUpParenthesizedTypes(type.symbol.declarations[0].parent); - if (isTypeAliasDeclaration(node)) { - return getSymbolOfDeclaration(node); - } - } - return void 0; - } - function isTopLevelInExternalModuleAugmentation(node) { - return node && node.parent && node.parent.kind === 269 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent); - } - function isDefaultBindingContext(location) { - return location.kind === 308 /* SourceFile */ || isAmbientModule(location); - } - function getNameOfSymbolFromNameType(symbol, context) { - const nameType = getSymbolLinks(symbol).nameType; - if (nameType) { - if (nameType.flags & 384 /* StringOrNumberLiteral */) { - const name = "" + nameType.value; - if (!isIdentifierText(name, getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) { - return `"${escapeString(name, 34 /* doubleQuote */)}"`; - } - if (isNumericLiteralName(name) && startsWith(name, "-")) { - return `[${name}]`; - } - return name; - } - if (nameType.flags & 8192 /* UniqueESSymbol */) { - return `[${getNameOfSymbolAsWritten(nameType.symbol, context)}]`; - } - } - } - 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` - context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) { - return "default"; - } - if (symbol.declarations && symbol.declarations.length) { - let declaration = firstDefined(symbol.declarations, (d) => getNameOfDeclaration(d) ? d : void 0); - const name2 = declaration && getNameOfDeclaration(declaration); - if (declaration && name2) { - if (isCallExpression(declaration) && isBindableObjectDefinePropertyCall(declaration)) { - return symbolName(symbol); - } - if (isComputedPropertyName(name2) && !(getCheckFlags(symbol) & 4096 /* Late */)) { - const nameType = getSymbolLinks(symbol).nameType; - if (nameType && nameType.flags & 384 /* StringOrNumberLiteral */) { - const result = getNameOfSymbolFromNameType(symbol, context); - if (result !== void 0) { - return result; - } - } - } - return declarationNameToString(name2); - } - if (!declaration) { - declaration = symbol.declarations[0]; - } - if (declaration.parent && declaration.parent.kind === 261 /* VariableDeclaration */) { - return declarationNameToString(declaration.parent.name); - } - switch (declaration.kind) { - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { - context.encounteredError = true; - } - return declaration.kind === 232 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; - } - } - const name = getNameOfSymbolFromNameType(symbol, context); - return name !== void 0 ? name : symbolName(symbol); - } - function isDeclarationVisible(node) { - if (node) { - const links = getNodeLinks(node); - if (links.isVisible === void 0) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } - return false; - function determineIfDeclarationIsVisible() { - switch (node.kind) { - case 339 /* JSDocCallbackTag */: - case 347 /* JSDocTypedefTag */: - case 341 /* JSDocEnumTag */: - return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent)); - case 209 /* BindingElement */: - return isDeclarationVisible(node.parent.parent); - case 261 /* VariableDeclaration */: - if (isBindingPattern(node.name) && !node.name.elements.length) { - return false; - } - // falls through - case 268 /* ModuleDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 263 /* FunctionDeclaration */: - case 267 /* EnumDeclaration */: - case 272 /* ImportEqualsDeclaration */: - if (isExternalModuleAugmentation(node)) { - return true; - } - const parent2 = getDeclarationContainer(node); - if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 272 /* ImportEqualsDeclaration */ && parent2.kind !== 308 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) { - return isGlobalSourceFile(parent2); - } - return isDeclarationVisible(parent2); - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) { - return false; - } - // Public properties/methods are visible if its parents are visible, so: - // falls through - case 177 /* Constructor */: - case 181 /* ConstructSignature */: - case 180 /* CallSignature */: - case 182 /* IndexSignature */: - case 170 /* Parameter */: - case 269 /* ModuleBlock */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 188 /* TypeLiteral */: - case 184 /* TypeReference */: - case 189 /* ArrayType */: - case 190 /* TupleType */: - case 193 /* UnionType */: - case 194 /* IntersectionType */: - case 197 /* ParenthesizedType */: - case 203 /* NamedTupleMember */: - return isDeclarationVisible(node.parent); - // Default binding, import specifier and namespace import is visible - // only on demand so by default it is not visible - case 274 /* ImportClause */: - case 275 /* NamespaceImport */: - case 277 /* ImportSpecifier */: - return false; - // Type parameters are always visible - case 169 /* TypeParameter */: - // Source file and namespace export are always visible - // falls through - case 308 /* SourceFile */: - case 271 /* NamespaceExportDeclaration */: - return true; - // Export assignments do not create name bindings outside the module - case 278 /* ExportAssignment */: - return false; - default: - return false; - } - } - } - function collectLinkedAliases(node, setVisibility) { - let exportSymbol; - if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 278 /* ExportAssignment */) { - exportSymbol = resolveName( - node, - node, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - } else if (node.parent.kind === 282 /* ExportSpecifier */) { - exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } - let result; - let visited; - if (exportSymbol) { - visited = /* @__PURE__ */ new Set(); - visited.add(getSymbolId(exportSymbol)); - buildVisibleNodeList(exportSymbol.declarations); - } - return result; - function buildVisibleNodeList(declarations) { - forEach(declarations, (declaration) => { - const resultNode = getAnyImportSyntax(declaration) || declaration; - if (setVisibility) { - getNodeLinks(declaration).isVisible = true; - } else { - result = result || []; - pushIfUnique(result, resultNode); - } - if (isInternalModuleImportEqualsDeclaration(declaration)) { - const internalModuleReference = declaration.moduleReference; - const firstIdentifier = getFirstIdentifier(internalModuleReference); - const importSymbol = resolveName( - declaration, - firstIdentifier.escapedText, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - if (importSymbol && visited) { - if (tryAddToSet(visited, getSymbolId(importSymbol))) { - buildVisibleNodeList(importSymbol.declarations); - } - } - } - }); - } - } - function pushTypeResolution(target, propertyName) { - const resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); - if (resolutionCycleStartIndex >= 0) { - const { length: length2 } = resolutionTargets; - for (let i = resolutionCycleStartIndex; i < length2; i++) { - resolutionResults[i] = false; - } - return false; - } - resolutionTargets.push(target); - resolutionResults.push( - /*items*/ - true - ); - resolutionPropertyNames.push(propertyName); - return true; - } - function findResolutionCycleStartIndex(target, propertyName) { - for (let i = resolutionTargets.length - 1; i >= resolutionStart; i--) { - if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) { - return -1; - } - if (resolutionTargets[i] === target && resolutionPropertyNames[i] === propertyName) { - return i; - } - } - return -1; - } - function resolutionTargetHasProperty(target, propertyName) { - switch (propertyName) { - case 0 /* Type */: - return !!getSymbolLinks(target).type; - case 2 /* DeclaredType */: - return !!getSymbolLinks(target).declaredType; - case 1 /* ResolvedBaseConstructorType */: - return !!target.resolvedBaseConstructorType; - case 3 /* ResolvedReturnType */: - return !!target.resolvedReturnType; - case 4 /* ImmediateBaseConstraint */: - return !!target.immediateBaseConstraint; - case 5 /* ResolvedTypeArguments */: - return !!target.resolvedTypeArguments; - case 6 /* ResolvedBaseTypes */: - return !!target.baseTypesResolved; - case 7 /* WriteType */: - return !!getSymbolLinks(target).writeType; - case 8 /* ParameterInitializerContainsUndefined */: - return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0; - } - return Debug.assertNever(propertyName); - } - function popTypeResolution() { - resolutionTargets.pop(); - resolutionPropertyNames.pop(); - return resolutionResults.pop(); - } - function getDeclarationContainer(node) { - return findAncestor(getRootDeclaration(node), (node2) => { - switch (node2.kind) { - case 261 /* VariableDeclaration */: - case 262 /* VariableDeclarationList */: - case 277 /* ImportSpecifier */: - case 276 /* NamedImports */: - case 275 /* NamespaceImport */: - case 274 /* ImportClause */: - return false; - default: - return true; - } - }).parent; - } - function getTypeOfPrototypeProperty(prototype) { - const classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype)); - return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, (_) => anyType)) : classType; - } - function getTypeOfPropertyOfType(type, name) { - const prop = getPropertyOfType(type, name); - return prop ? getTypeOfSymbol(prop) : void 0; - } - function getTypeOfPropertyOrIndexSignatureOfType(type, name) { - var _a; - 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; - } - function isErrorType(type) { - return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol); - } - function getTypeForBindingElementParent(node, checkMode) { - if (checkMode !== 0 /* Normal */) { - return getTypeForVariableLikeDeclaration( - node, - /*includeOptionality*/ - false, - checkMode - ); - } - const symbol = getSymbolOfDeclaration(node); - return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration( - node, - /*includeOptionality*/ - false, - checkMode - ); - } - function getRestType(source, properties, symbol) { - source = filterType(source, (t) => !(t.flags & 98304 /* Nullable */)); - if (source.flags & 131072 /* Never */) { - return emptyObjectType; - } - if (source.flags & 1048576 /* Union */) { - return mapType(source, (t) => getRestType(t, properties, symbol)); - } - let omitKeyType = getUnionType(map(properties, getLiteralTypeFromPropertyName)); - const spreadableProperties = []; - const unspreadableToRestKeys = []; - for (const prop of getPropertiesOfType(source)) { - const literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */); - if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) && isSpreadableProperty(prop)) { - spreadableProperties.push(prop); - } else { - unspreadableToRestKeys.push(literalTypeFromProperty); - } - } - if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) { - if (unspreadableToRestKeys.length) { - omitKeyType = getUnionType([omitKeyType, ...unspreadableToRestKeys]); - } - if (omitKeyType.flags & 131072 /* Never */) { - return source; - } - const omitTypeAlias = getGlobalOmitSymbol(); - if (!omitTypeAlias) { - return errorType; - } - return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]); - } - const members = createSymbolTable(); - for (const prop of spreadableProperties) { - members.set(prop.escapedName, getSpreadSymbol( - prop, - /*readonly*/ - false - )); - } - const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source)); - result.objectFlags |= 4194304 /* ObjectRestType */; - return result; - } - function isGenericTypeWithUndefinedConstraint(type) { - return !!(type.flags & 465829888 /* Instantiable */) && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 32768 /* Undefined */); - } - function getNonUndefinedType(type) { - const typeOrConstraint = someType(type, isGenericTypeWithUndefinedConstraint) ? mapType(type, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t) : type; - return getTypeWithFacts(typeOrConstraint, 524288 /* NEUndefined */); - } - function getFlowTypeOfDestructuring(node, declaredType) { - const reference = getSyntheticElementAccess(node); - return reference ? getFlowTypeOfReference(reference, declaredType) : declaredType; - } - function getSyntheticElementAccess(node) { - const parentAccess = getParentElementAccess(node); - if (parentAccess && canHaveFlowNode(parentAccess) && parentAccess.flowNode) { - const propName = getDestructuringPropertyName(node); - if (propName) { - const literal = setTextRange(parseNodeFactory.createStringLiteral(propName), node); - const lhsExpr = isLeftHandSideExpression(parentAccess) ? parentAccess : parseNodeFactory.createParenthesizedExpression(parentAccess); - const result = setTextRange(parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); - setParent(literal, result); - setParent(result, node); - if (lhsExpr !== parentAccess) { - setParent(lhsExpr, result); - } - result.flowNode = parentAccess.flowNode; - return result; - } - } - } - function getParentElementAccess(node) { - const ancestor = node.parent.parent; - switch (ancestor.kind) { - case 209 /* BindingElement */: - case 304 /* PropertyAssignment */: - return getSyntheticElementAccess(ancestor); - case 210 /* ArrayLiteralExpression */: - return getSyntheticElementAccess(node.parent); - case 261 /* VariableDeclaration */: - return ancestor.initializer; - case 227 /* BinaryExpression */: - return ancestor.right; - } - } - function getDestructuringPropertyName(node) { - const parent2 = node.parent; - if (node.kind === 209 /* BindingElement */ && parent2.kind === 207 /* ObjectBindingPattern */) { - return getLiteralPropertyNameText(node.propertyName || node.name); - } - if (node.kind === 304 /* PropertyAssignment */ || node.kind === 305 /* ShorthandPropertyAssignment */) { - return getLiteralPropertyNameText(node.name); - } - return "" + parent2.elements.indexOf(node); - } - function getLiteralPropertyNameText(name) { - const type = getLiteralTypeFromPropertyName(name); - return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0; - } - function getTypeForBindingElement(declaration) { - const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */; - const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode); - return parentType && getBindingElementTypeFromParentType( - declaration, - parentType, - /*noTupleBoundsCheck*/ - false - ); - } - function getBindingElementTypeFromParentType(declaration, parentType, noTupleBoundsCheck) { - if (isTypeAny(parentType)) { - return parentType; - } - const pattern = declaration.parent; - if (strictNullChecks && declaration.flags & 33554432 /* Ambient */ && isPartOfParameterDeclaration(declaration)) { - parentType = getNonNullableType(parentType); - } else if (strictNullChecks && pattern.parent.initializer && !hasTypeFacts(getTypeOfInitializer(pattern.parent.initializer), 65536 /* EQUndefined */)) { - parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); - } - const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* AllowMissing */ : 0); - let type; - if (pattern.kind === 207 /* ObjectBindingPattern */) { - if (declaration.dotDotDotToken) { - parentType = getReducedType(parentType); - if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { - error2(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types); - return errorType; - } - const literalMembers = []; - for (const element of pattern.elements) { - if (!element.dotDotDotToken) { - literalMembers.push(element.propertyName || element.name); - } - } - type = getRestType(parentType, literalMembers, declaration.symbol); - } else { - const name = declaration.propertyName || declaration.name; - const indexType = getLiteralTypeFromPropertyName(name); - const declaredType = getIndexedAccessType(parentType, indexType, accessFlags, name); - type = getFlowTypeOfDestructuring(declaration, declaredType); - } - } else { - const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern); - const index = pattern.elements.indexOf(declaration); - if (declaration.dotDotDotToken) { - const baseConstraint = mapType(parentType, (t) => t.flags & 58982400 /* InstantiableNonPrimitive */ ? getBaseConstraintOrType(t) : t); - type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType); - } else if (isArrayLikeType(parentType)) { - const indexType = getNumberLiteralType(index); - const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType; - type = getFlowTypeOfDestructuring(declaration, declaredType); - } else { - type = elementType; - } - } - if (!declaration.initializer) { - return type; - } - if (getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration))) { - return strictNullChecks && !hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type; - } - return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */)); - } - function getTypeForDeclarationFromJSDocComment(declaration) { - const jsdocType = getJSDocType(declaration); - if (jsdocType) { - return getTypeFromTypeNode(jsdocType); - } - return void 0; - } - function isNullOrUndefined3(node) { - const expr = skipParentheses( - node, - /*excludeJSDocTypeAssertions*/ - true - ); - return expr.kind === 106 /* NullKeyword */ || expr.kind === 80 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol; - } - function isEmptyArrayLiteral2(node) { - const expr = skipParentheses( - node, - /*excludeJSDocTypeAssertions*/ - true - ); - return expr.kind === 210 /* 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 === 250 /* ForInStatement */) { - const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression( - declaration.parent.parent.expression, - /*checkMode*/ - checkMode - ))); - return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; - } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) { - const forOfStatement = declaration.parent.parent; - return checkRightHandSideOfForOf(forOfStatement) || anyType; - } - if (isBindingPattern(declaration.parent)) { - return getTypeForBindingElement(declaration); - } - const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration); - const isOptional = includeOptionality && isOptionalDeclaration(declaration); - const declaredType = tryGetTypeFromEffectiveTypeNode(declaration); - if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { - if (declaredType) { - return isTypeAny(declaredType) || declaredType === unknownType ? declaredType : errorType; - } - return useUnknownInCatchVariables ? unknownType : anyType; - } - if (declaredType) { - return addOptionality(declaredType, isProperty, isOptional); - } - 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)) { - return autoArrayType; - } - } - if (isParameter(declaration)) { - if (!declaration.symbol) { - return; - } - const func = declaration.parent; - if (func.kind === 179 /* SetAccessor */ && hasBindableName(func)) { - const getter = getDeclarationOfKind(getSymbolOfDeclaration(declaration.parent), 178 /* GetAccessor */); - if (getter) { - const getterSignature = getSignatureFromDeclaration(getter); - const thisParameter = getAccessorThisParameter(func); - if (thisParameter && declaration === thisParameter) { - Debug.assert(!thisParameter.type); - return getTypeOfSymbol(getterSignature.thisParameter); - } - return getReturnTypeOfSignature(getterSignature); - } - } - const parameterTypeOfTypeTag = getParameterTypeOfTypeTag(func, declaration); - if (parameterTypeOfTypeTag) return parameterTypeOfTypeTag; - const type = declaration.symbol.escapedName === "this" /* This */ ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration); - if (type) { - return addOptionality( - type, - /*isProperty*/ - false, - isOptional - ); - } - } - if (hasOnlyExpressionInitializer(declaration) && !!declaration.initializer) { - if (isInJSFile(declaration) && !isParameter(declaration)) { - const containerObjectType = getJSContainerObjectType(declaration, getSymbolOfDeclaration(declaration), getDeclaredExpandoInitializer(declaration)); - if (containerObjectType) { - return containerObjectType; - } - } - const type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode)); - return addOptionality(type, isProperty, isOptional); - } - if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) { - if (!hasStaticModifier(declaration)) { - const constructor = findConstructorDeclaration(declaration.parent); - const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; - return type && addOptionality( - type, - /*isProperty*/ - true, - isOptional - ); - } else { - const staticBlocks = filter(declaration.parent.members, isClassStaticBlockDeclaration); - const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; - return type && addOptionality( - type, - /*isProperty*/ - true, - isOptional - ); - } - } - if (isJsxAttribute(declaration)) { - return trueType; - } - if (isBindingPattern(declaration.name)) { - return getTypeFromBindingPattern( - declaration.name, - /*includePatternInType*/ - false, - /*reportErrors*/ - true - ); - } - return void 0; - } - function isConstructorDeclaredProperty(symbol) { - if (symbol.valueDeclaration && isBinaryExpression(symbol.valueDeclaration)) { - 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 !== 213 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( - /*declaredType*/ - void 0, - declaration, - symbol, - declaration - )); - } - return links.isConstructorDeclaredProperty; - } - return false; - } - function isAutoTypedProperty(symbol) { - const declaration = symbol.valueDeclaration; - return declaration && isPropertyDeclaration(declaration) && !getEffectiveTypeAnnotationNode(declaration) && !declaration.initializer && (noImplicitAny || isInJSFile(declaration)); - } - function getDeclaringConstructor(symbol) { - if (!symbol.declarations) { - return; - } - for (const declaration of symbol.declarations) { - const container = getThisContainer( - declaration, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (container && (container.kind === 177 /* Constructor */ || isJSConstructor(container))) { - return container; - } - } - } - function getFlowTypeFromCommonJSExport(symbol) { - const file = getSourceFileOfNode(symbol.declarations[0]); - const accessName = unescapeLeadingUnderscores(symbol.escapedName); - const areAllModuleExports = symbol.declarations.every((d) => isInJSFile(d) && isAccessExpression(d) && isModuleExportsAccessExpression(d.expression)); - const reference = areAllModuleExports ? factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createIdentifier("module"), factory.createIdentifier("exports")), accessName) : factory.createPropertyAccessExpression(factory.createIdentifier("exports"), accessName); - if (areAllModuleExports) { - setParent(reference.expression.expression, reference.expression); - } - setParent(reference.expression, reference); - setParent(reference, file); - reference.flowNode = file.endFlowNode; - return getFlowTypeOfReference(reference, autoType, undefinedType); - } - function getFlowTypeInStaticBlocks(symbol, staticBlocks) { - const accessName = startsWith(symbol.escapedName, "__#") ? factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) : unescapeLeadingUnderscores(symbol.escapedName); - for (const staticBlock of staticBlocks) { - const reference = factory.createPropertyAccessExpression(factory.createThis(), accessName); - setParent(reference.expression, reference); - setParent(reference, staticBlock); - reference.flowNode = staticBlock.returnFlowNode; - const flowType = getFlowTypeOfProperty(reference, symbol); - if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { - error2(symbol.valueDeclaration, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); - } - if (everyType(flowType, isNullableType)) { - continue; - } - return convertAutoToAny(flowType); - } - } - function getFlowTypeInConstructor(symbol, constructor) { - const accessName = startsWith(symbol.escapedName, "__#") ? factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) : unescapeLeadingUnderscores(symbol.escapedName); - const reference = factory.createPropertyAccessExpression(factory.createThis(), accessName); - setParent(reference.expression, reference); - setParent(reference, constructor); - reference.flowNode = constructor.returnFlowNode; - const flowType = getFlowTypeOfProperty(reference, symbol); - if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { - 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) & 128 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType; - return getFlowTypeOfReference(reference, autoType, initialType); - } - function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { - const container = getAssignedExpandoInitializer(symbol.valueDeclaration); - if (container) { - const tag = isInJSFile(container) ? getJSDocTypeTag(container) : void 0; - if (tag && tag.typeExpression) { - return getTypeFromTypeNode(tag.typeExpression); - } - const containerObjectType = symbol.valueDeclaration && getJSContainerObjectType(symbol.valueDeclaration, symbol, container); - return containerObjectType || getWidenedLiteralType(checkExpressionCached(container)); - } - let type; - let definedInConstructor = false; - let definedInMethod = false; - if (isConstructorDeclaredProperty(symbol)) { - type = getFlowTypeInConstructor(symbol, getDeclaringConstructor(symbol)); - } - if (!type) { - let types; - if (symbol.declarations) { - let jsdocType; - for (const declaration of symbol.declarations) { - const expression = isBinaryExpression(declaration) || isCallExpression(declaration) ? declaration : isAccessExpression(declaration) ? isBinaryExpression(declaration.parent) ? declaration.parent : declaration : void 0; - if (!expression) { - continue; - } - const kind = isAccessExpression(expression) ? getAssignmentDeclarationPropertyAccessKind(expression) : getAssignmentDeclarationKind(expression); - if (kind === 4 /* ThisProperty */ || isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { - if (isDeclarationInConstructor(expression)) { - definedInConstructor = true; - } else { - definedInMethod = true; - } - } - if (!isCallExpression(expression)) { - jsdocType = getAnnotatedTypeForAssignmentDeclaration(jsdocType, expression, symbol, declaration); - } - if (!jsdocType) { - (types || (types = [])).push(isBinaryExpression(expression) || isCallExpression(expression) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType); - } - } - type = jsdocType; - } - if (!type) { - if (!length(types)) { - return errorType; - } - let constructorTypes = definedInConstructor && symbol.declarations ? getConstructorDefinedThisAssignmentTypes(types, symbol.declarations) : void 0; - if (definedInMethod) { - const propType = getTypeOfPropertyInBaseClass(symbol); - if (propType) { - (constructorTypes || (constructorTypes = [])).push(propType); - definedInConstructor = true; - } - } - const sourceTypes = some(constructorTypes, (t) => !!(t.flags & ~98304 /* Nullable */)) ? constructorTypes : types; - type = getUnionType(sourceTypes); - } - } - const widened = getWidenedType(addOptionality( - type, - /*isProperty*/ - false, - definedInMethod && !definedInConstructor - )); - if (symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && filterType(widened, (t) => !!(t.flags & ~98304 /* Nullable */)) === neverType) { - reportImplicitAny(symbol.valueDeclaration, anyType); - return anyType; - } - return widened; - } - function getJSContainerObjectType(decl, symbol, init) { - var _a, _b; - if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) { - return void 0; - } - const exports2 = createSymbolTable(); - while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) { - const s2 = getSymbolOfNode(decl); - if ((_a = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a.size) { - mergeSymbolTable(exports2, s2.exports); - } - decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent; - } - const s = getSymbolOfNode(decl); - if ((_b = s == null ? void 0 : s.exports) == null ? void 0 : _b.size) { - mergeSymbolTable(exports2, s.exports); - } - const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray); - type.objectFlags |= 4096 /* JSLiteral */; - return type; - } - function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) { - var _a; - const typeNode = getEffectiveTypeAnnotationNode(expression.parent); - if (typeNode) { - const type = getWidenedType(getTypeFromTypeNode(typeNode)); - if (!declaredType) { - return type; - } else if (!isErrorType(declaredType) && !isErrorType(type) && !isTypeIdenticalTo(declaredType, type)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType( - /*firstDeclaration*/ - void 0, - declaredType, - declaration, - type - ); - } - } - if ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) { - 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); - } - } - } - } - return declaredType; - } - function getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) { - if (isCallExpression(expression)) { - if (resolvedSymbol) { - return getTypeOfSymbol(resolvedSymbol); - } - const objectLitType = checkExpressionCached(expression.arguments[2]); - const valueType = getTypeOfPropertyOfType(objectLitType, "value"); - if (valueType) { - return valueType; - } - const getFunc = getTypeOfPropertyOfType(objectLitType, "get"); - if (getFunc) { - const getSig = getSingleCallSignature(getFunc); - if (getSig) { - return getReturnTypeOfSignature(getSig); - } - } - const setFunc = getTypeOfPropertyOfType(objectLitType, "set"); - if (setFunc) { - const setSig = getSingleCallSignature(setFunc); - if (setSig) { - return getTypeOfFirstParameterOfSignature(setSig); - } - } - return anyType; - } - if (containsSameNamedThisProperty(expression.left, expression.right)) { - return anyType; - } - const isDirectExport = kind === 1 /* ExportsProperty */ && (isPropertyAccessExpression(expression.left) || isElementAccessExpression(expression.left)) && (isModuleExportsAccessExpression(expression.left.expression) || isIdentifier(expression.left.expression) && isExportsIdentifier(expression.left.expression)); - const type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right)) : getWidenedLiteralType(checkExpressionCached(expression.right)); - if (type.flags & 524288 /* Object */ && kind === 2 /* ModuleExports */ && symbol.escapedName === "export=" /* ExportEquals */) { - const exportedType = resolveStructuredTypeMembers(type); - const members = createSymbolTable(); - copyEntries(exportedType.members, members); - const initialSize = members.size; - if (resolvedSymbol && !resolvedSymbol.exports) { - resolvedSymbol.exports = createSymbolTable(); - } - (resolvedSymbol || symbol).exports.forEach((s, name) => { - var _a; - const exportedMember = members.get(name); - if (exportedMember && exportedMember !== s && !(s.flags & 2097152 /* Alias */)) { - if (s.flags & 111551 /* Value */ && exportedMember.flags & 111551 /* Value */) { - if (s.valueDeclaration && exportedMember.valueDeclaration && getSourceFileOfNode(s.valueDeclaration) !== getSourceFileOfNode(exportedMember.valueDeclaration)) { - const unescapedName = unescapeLeadingUnderscores(s.escapedName); - const exportedMemberName = ((_a = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a.name) || exportedMember.valueDeclaration; - addRelatedInfo( - error2(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName), - createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here, unescapedName) - ); - addRelatedInfo( - error2(exportedMemberName, Diagnostics.Duplicate_identifier_0, unescapedName), - createDiagnosticForNode(s.valueDeclaration, Diagnostics._0_was_also_declared_here, unescapedName) - ); - } - const union = createSymbol(s.flags | exportedMember.flags, name); - union.links.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]); - union.valueDeclaration = exportedMember.valueDeclaration; - union.declarations = concatenate(exportedMember.declarations, s.declarations); - members.set(name, union); - } else { - members.set(name, mergeSymbol(s, exportedMember)); - } - } else { - members.set(name, s); - } - }); - const result = createAnonymousType( - initialSize !== members.size ? void 0 : exportedType.symbol, - // Only set the type's symbol if it looks to be the same as the original type - members, - exportedType.callSignatures, - exportedType.constructSignatures, - exportedType.indexInfos - ); - if (initialSize === members.size) { - if (type.aliasSymbol) { - result.aliasSymbol = type.aliasSymbol; - result.aliasTypeArguments = type.aliasTypeArguments; - } - if (getObjectFlags(type) & 4 /* Reference */) { - result.aliasSymbol = type.symbol; - const args = getTypeArguments(type); - result.aliasTypeArguments = length(args) ? args : void 0; - } - } - result.objectFlags |= getPropagatingFlagsOfTypes([type]) | getObjectFlags(type) & (4096 /* JSLiteral */ | 16384 /* ArrayLiteral */ | 128 /* ObjectLiteral */); - if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) { - result.objectFlags |= 16777216 /* IsClassInstanceClone */; - } - return result; - } - if (isEmptyArrayLiteralType(type)) { - reportImplicitAny(expression, anyArrayType); - return anyArrayType; - } - return type; - } - function containsSameNamedThisProperty(thisProperty, expression) { - return isPropertyAccessExpression(thisProperty) && thisProperty.expression.kind === 110 /* ThisKeyword */ && forEachChildRecursively(expression, (n) => isMatchingReference(thisProperty, n)); - } - function isDeclarationInConstructor(expression) { - const thisContainer = getThisContainer( - expression, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - return thisContainer.kind === 177 /* Constructor */ || thisContainer.kind === 263 /* FunctionDeclaration */ || thisContainer.kind === 219 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent); - } - function getConstructorDefinedThisAssignmentTypes(types, declarations) { - Debug.assert(types.length === declarations.length); - return types.filter((_, i) => { - const declaration = declarations[i]; - const expression = isBinaryExpression(declaration) ? declaration : isBinaryExpression(declaration.parent) ? declaration.parent : void 0; - return expression && isDeclarationInConstructor(expression); - }); - } - function getTypeFromBindingElement(element, includePatternInType, reportErrors2) { - if (element.initializer) { - const contextualType = isBindingPattern(element.name) ? getTypeFromBindingPattern( - element.name, - /*includePatternInType*/ - true, - /*reportErrors*/ - false - ) : unknownType; - return addOptionality(getWidenedLiteralTypeForInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType))); - } - if (isBindingPattern(element.name)) { - return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors2); - } - if (reportErrors2 && !declarationBelongsToPrivateAmbientMember(element)) { - reportImplicitAny(element, anyType); - } - return includePatternInType ? nonInferrableAnyType : anyType; - } - function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) { - const members = createSymbolTable(); - let stringIndexInfo; - let objectFlags = 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */; - forEach(pattern.elements, (e) => { - const name = e.propertyName || e.name; - if (e.dotDotDotToken) { - stringIndexInfo = createIndexInfo( - stringType, - anyType, - /*isReadonly*/ - false - ); - return; - } - const exprType = getLiteralTypeFromPropertyName(name); - if (!isTypeUsableAsPropertyName(exprType)) { - objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; - return; - } - const text = getPropertyNameFromType(exprType); - const flags = 4 /* Property */ | (e.initializer ? 16777216 /* Optional */ : 0); - const symbol = createSymbol(flags, text); - symbol.links.type = getTypeFromBindingElement(e, includePatternInType, reportErrors2); - members.set(symbol.escapedName, symbol); - }); - const result = createAnonymousType( - /*symbol*/ - void 0, - members, - emptyArray, - emptyArray, - stringIndexInfo ? [stringIndexInfo] : emptyArray - ); - result.objectFlags |= objectFlags; - if (includePatternInType) { - result.pattern = pattern; - result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */; - } - return result; - } - function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) { - const elements = pattern.elements; - const lastElement = lastOrUndefined(elements); - const restElement = lastElement && lastElement.kind === 209 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0; - if (elements.length === 0 || elements.length === 1 && restElement) { - return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; - } - const elementTypes = map(elements, (e) => isOmittedExpression(e) ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors2)); - const minLength = findLastIndex(elements, (e) => !(e === restElement || isOmittedExpression(e) || hasDefaultValue(e)), elements.length - 1) + 1; - const elementFlags = map(elements, (e, i) => e === restElement ? 4 /* Rest */ : i >= minLength ? 2 /* Optional */ : 1 /* Required */); - let result = createTupleType(elementTypes, elementFlags); - if (includePatternInType) { - result = cloneTypeReference(result); - result.pattern = pattern; - result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */; - } - return result; - } - function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) { - if (includePatternInType) contextualBindingPatterns.push(pattern); - const result = pattern.kind === 207 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2); - if (includePatternInType) contextualBindingPatterns.pop(); - return result; - } - function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors2) { - return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration( - declaration, - /*includeOptionality*/ - true, - 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( - /*reportErrors*/ - false - ); - return globalSymbol && symbol && symbol === globalSymbol; - } - function widenTypeForVariableLikeDeclaration(type, declaration, reportErrors2) { - if (type) { - if (type.flags & 4096 /* ESSymbol */ && isGlobalSymbolConstructor(declaration.parent)) { - type = getESSymbolLikeTypeForNode(declaration); - } - if (reportErrors2) { - reportErrorsFromWidening(declaration, type); - } - if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !tryGetTypeFromEffectiveTypeNode(declaration)) && type.symbol !== getSymbolOfDeclaration(declaration)) { - type = esSymbolType; - } - return getWidenedType(type); - } - type = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType; - if (reportErrors2) { - if (!declarationBelongsToPrivateAmbientMember(declaration)) { - reportImplicitAny(declaration, type); - } - } - return type; - } - function declarationBelongsToPrivateAmbientMember(declaration) { - const root = getRootDeclaration(declaration); - const memberDeclaration = root.kind === 170 /* Parameter */ ? root.parent : root; - return isPrivateWithinAmbient(memberDeclaration); - } - function tryGetTypeFromEffectiveTypeNode(node) { - const typeNode = getEffectiveTypeAnnotationNode(node); - if (typeNode) { - return getTypeFromTypeNode(typeNode); - } - } - function isParameterOfContextSensitiveSignature(symbol) { - let decl = symbol.valueDeclaration; - if (!decl) { - return false; - } - if (isBindingElement(decl)) { - decl = walkUpBindingElementsAndPatterns(decl); - } - if (isParameter(decl)) { - return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent); - } - return false; - } - function getTypeOfVariableOrParameterOrProperty(symbol) { - const links = getSymbolLinks(symbol); - if (!links.type) { - const type = getTypeOfVariableOrParameterOrPropertyWorker(symbol); - if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) { - links.type = type; - } - return type; - } - return links.type; - } - function getTypeOfVariableOrParameterOrPropertyWorker(symbol) { - if (symbol.flags & 4194304 /* Prototype */) { - return getTypeOfPrototypeProperty(symbol); - } - if (symbol === requireSymbol) { - return anyType; - } - if (symbol.flags & 134217728 /* ModuleExports */ && symbol.valueDeclaration) { - const fileSymbol = getSymbolOfDeclaration(getSourceFileOfNode(symbol.valueDeclaration)); - const result = createSymbol(fileSymbol.flags, "exports"); - result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : []; - result.parent = symbol; - result.links.target = fileSymbol; - if (fileSymbol.valueDeclaration) result.valueDeclaration = fileSymbol.valueDeclaration; - if (fileSymbol.members) result.members = new Map(fileSymbol.members); - if (fileSymbol.exports) result.exports = new Map(fileSymbol.exports); - const members = createSymbolTable(); - members.set("exports", result); - return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray); - } - Debug.assertIsDefined(symbol.valueDeclaration); - const declaration = symbol.valueDeclaration; - if (isSourceFile(declaration) && isJsonSourceFile(declaration)) { - if (!declaration.statements.length) { - return emptyObjectType; - } - return getWidenedType(getWidenedLiteralType(checkExpression(declaration.statements[0].expression))); - } - if (isAccessor(declaration)) { - return getTypeOfAccessors(symbol); - } - if (!pushTypeResolution(symbol, 0 /* Type */)) { - if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) { - return getTypeOfFuncClassEnumModule(symbol); - } - return reportCircularityError(symbol); - } - let type; - if (declaration.kind === 278 /* 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); - } else if (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isIdentifier(declaration) || isStringLiteralLike(declaration) || isNumericLiteral(declaration) || isClassDeclaration(declaration) || isFunctionDeclaration(declaration) || isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration) || isMethodSignature(declaration) || isSourceFile(declaration)) { - if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { - return getTypeOfFuncClassEnumModule(symbol); - } - type = isBinaryExpression(declaration.parent) ? getWidenedTypeForAssignmentDeclaration(symbol) : tryGetTypeFromEffectiveTypeNode(declaration) || anyType; - } else if (isPropertyAssignment(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); - } else if (isJsxAttribute(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); - } else if (isShorthandPropertyAssignment(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */); - } else if (isObjectLiteralMethod(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */); - } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isJSDocPropertyLikeTag(declaration)) { - type = getWidenedTypeForVariableLikeDeclaration( - declaration, - /*reportErrors*/ - true - ); - } else if (isEnumDeclaration(declaration)) { - type = getTypeOfFuncClassEnumModule(symbol); - } else if (isEnumMember(declaration)) { - type = getTypeOfEnumMember(symbol); - } else { - return Debug.fail("Unhandled declaration kind! " + Debug.formatSyntaxKind(declaration.kind) + " for " + Debug.formatSymbol(symbol)); - } - if (!popTypeResolution()) { - if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) { - return getTypeOfFuncClassEnumModule(symbol); - } - return reportCircularityError(symbol); - } - return type; - } - function getAnnotatedAccessorTypeNode(accessor) { - if (accessor) { - switch (accessor.kind) { - case 178 /* GetAccessor */: - const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor); - return getterTypeAnnotation; - case 179 /* SetAccessor */: - const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation; - case 173 /* PropertyDeclaration */: - Debug.assert(hasAccessorModifier(accessor)); - const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor); - return accessorTypeAnnotation; - } - } - return void 0; - } - function getAnnotatedAccessorType(accessor) { - const node = getAnnotatedAccessorTypeNode(accessor); - return node && getTypeFromTypeNode(node); - } - function getAnnotatedAccessorThisParameter(accessor) { - const parameter = getAccessorThisParameter(accessor); - return parameter && parameter.symbol; - } - function getThisTypeOfDeclaration(declaration) { - return getThisTypeOfSignature(getSignatureFromDeclaration(declaration)); - } - function getTypeOfAccessors(symbol) { - const links = getSymbolLinks(symbol); - if (!links.type) { - if (!pushTypeResolution(symbol, 0 /* Type */)) { - return errorType; - } - const getter = getDeclarationOfKind(symbol, 178 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */); - const accessor = tryCast(getDeclarationOfKind(symbol, 173 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); - let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && getWidenedTypeForVariableLikeDeclaration( - accessor, - /*reportErrors*/ - true - ); - if (!type) { - if (setter && !isPrivateWithinAmbient(setter)) { - errorOrSuggestion(noImplicitAny, setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); - } else if (getter && !isPrivateWithinAmbient(getter)) { - errorOrSuggestion(noImplicitAny, getter, Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol)); - } else if (accessor && !isPrivateWithinAmbient(accessor)) { - errorOrSuggestion(noImplicitAny, accessor, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), "any"); - } - type = anyType; - } - if (!popTypeResolution()) { - if (getAnnotatedAccessorTypeNode(getter)) { - error2(getter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } else if (getAnnotatedAccessorTypeNode(setter)) { - error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } else if (getAnnotatedAccessorTypeNode(accessor)) { - error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } else if (getter && noImplicitAny) { - 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; - } - links.type ?? (links.type = type); - } - return links.type; - } - function getWriteTypeOfAccessors(symbol) { - const links = getSymbolLinks(symbol); - if (!links.writeType) { - if (!pushTypeResolution(symbol, 7 /* WriteType */)) { - return errorType; - } - const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */) ?? tryCast(getDeclarationOfKind(symbol, 173 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); - let writeType = getAnnotatedAccessorType(setter); - if (!popTypeResolution()) { - if (getAnnotatedAccessorTypeNode(setter)) { - error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } - writeType = anyType; - } - links.writeType ?? (links.writeType = writeType || getTypeOfAccessors(symbol)); - } - return links.writeType; - } - function getBaseTypeVariableOfClass(symbol) { - const baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); - return baseConstructorType.flags & 8650752 /* TypeVariable */ ? baseConstructorType : baseConstructorType.flags & 2097152 /* Intersection */ ? find(baseConstructorType.types, (t) => !!(t.flags & 8650752 /* TypeVariable */)) : void 0; - } - function getTypeOfFuncClassEnumModule(symbol) { - let links = getSymbolLinks(symbol); - const originalLinks = links; - if (!links.type) { - const expando = symbol.valueDeclaration && getSymbolOfExpando( - symbol.valueDeclaration, - /*allowDeclaration*/ - false - ); - if (expando) { - const merged = mergeJSSymbols(symbol, expando); - if (merged) { - symbol = merged; - links = merged.links; - } - } - originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol); - } - return links.type; - } - function getTypeOfFuncClassEnumModuleWorker(symbol) { - const declaration = symbol.valueDeclaration; - if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) { - return anyType; - } else if (declaration && (declaration.kind === 227 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 227 /* BinaryExpression */)) { - return getWidenedTypeForAssignmentDeclaration(symbol); - } else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) { - const resolvedModule = resolveExternalModuleSymbol(symbol); - if (resolvedModule !== symbol) { - if (!pushTypeResolution(symbol, 0 /* Type */)) { - return errorType; - } - const exportEquals = getMergedSymbol(symbol.exports.get("export=" /* ExportEquals */)); - const type2 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? void 0 : resolvedModule); - if (!popTypeResolution()) { - return reportCircularityError(symbol); - } - return type2; - } - } - const type = createObjectType(16 /* Anonymous */, symbol); - if (symbol.flags & 32 /* Class */) { - const baseTypeVariable = getBaseTypeVariableOfClass(symbol); - return baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; - } else { - return strictNullChecks && symbol.flags & 16777216 /* Optional */ ? getOptionalType( - type, - /*isProperty*/ - true - ) : type; - } - } - function getTypeOfEnumMember(symbol) { - const links = getSymbolLinks(symbol); - return links.type || (links.type = getDeclaredTypeOfEnumMember(symbol)); - } - 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), - /*dontRecursivelyResolve*/ - true - ); - const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0); - links.type ?? (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 ?? (links.type = errorType); - } - } - return links.type; - } - function getTypeOfInstantiatedSymbol(symbol) { - const links = getSymbolLinks(symbol); - return links.type || (links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper)); - } - function getWriteTypeOfInstantiatedSymbol(symbol) { - const links = getSymbolLinks(symbol); - return links.writeType || (links.writeType = instantiateType(getWriteTypeOfSymbol(links.target), links.mapper)); - } - function reportCircularityError(symbol) { - const declaration = symbol.valueDeclaration; - 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 !== 170 /* 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; - } - function getTypeOfSymbolWithDeferredType(symbol) { - const links = getSymbolLinks(symbol); - if (!links.type) { - Debug.assertIsDefined(links.deferralParent); - Debug.assertIsDefined(links.deferralConstituents); - links.type = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralConstituents) : getIntersectionType(links.deferralConstituents); - } - return links.type; - } - function getWriteTypeOfSymbolWithDeferredType(symbol) { - const links = getSymbolLinks(symbol); - if (!links.writeType && links.deferralWriteConstituents) { - Debug.assertIsDefined(links.deferralParent); - Debug.assertIsDefined(links.deferralConstituents); - links.writeType = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents); - } - return links.writeType; - } - function getWriteTypeOfSymbol(symbol) { - const checkFlags = getCheckFlags(symbol); - if (checkFlags & 2 /* SyntheticProperty */) { - return 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 - ); - } - if (symbol.flags & 4 /* Property */) { - return 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) { - const checkFlags = getCheckFlags(symbol); - if (checkFlags & 65536 /* DeferredType */) { - return getTypeOfSymbolWithDeferredType(symbol); - } - if (checkFlags & 1 /* Instantiated */) { - return getTypeOfInstantiatedSymbol(symbol); - } - if (checkFlags & 262144 /* Mapped */) { - return getTypeOfMappedSymbol(symbol); - } - if (checkFlags & 8192 /* ReverseMapped */) { - return getTypeOfReverseMappedSymbol(symbol); - } - if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - return getTypeOfVariableOrParameterOrProperty(symbol); - } - if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { - return getTypeOfFuncClassEnumModule(symbol); - } - if (symbol.flags & 8 /* EnumMember */) { - return getTypeOfEnumMember(symbol); - } - if (symbol.flags & 98304 /* Accessor */) { - return getTypeOfAccessors(symbol); - } - if (symbol.flags & 2097152 /* Alias */) { - return getTypeOfAlias(symbol); - } - return errorType; - } - function getNonMissingTypeOfSymbol(symbol) { - return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */)); - } - function isReferenceToSomeType(type, targets) { - if (type === void 0 || (getObjectFlags(type) & 4 /* Reference */) === 0) { - return false; - } - for (const target of targets) { - if (type.target === target) { - return true; - } - } - return false; - } - function isReferenceToType2(type, target) { - return type !== void 0 && target !== void 0 && (getObjectFlags(type) & 4 /* Reference */) !== 0 && type.target === target; - } - function getTargetType(type) { - return getObjectFlags(type) & 4 /* Reference */ ? type.target : type; - } - function hasBaseType(type, checkBase) { - return check(type); - function check(type2) { - if (getObjectFlags(type2) & (3 /* ClassOrInterface */ | 4 /* Reference */)) { - const target = getTargetType(type2); - return target === checkBase || some(getBaseTypes(target), check); - } else if (type2.flags & 2097152 /* Intersection */) { - return some(type2.types, check); - } - return false; - } - } - function appendTypeParameters(typeParameters, declarations) { - for (const declaration of declarations) { - typeParameters = appendIfUnique(typeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(declaration))); - } - return typeParameters; - } - function getOuterTypeParameters(node, includeThisTypes) { - while (true) { - node = node.parent; - if (node && isBinaryExpression(node)) { - const assignmentKind = getAssignmentDeclarationKind(node); - if (assignmentKind === 6 /* Prototype */ || assignmentKind === 3 /* PrototypeProperty */) { - const symbol = getSymbolOfDeclaration(node.left); - if (symbol && symbol.parent && !findAncestor(symbol.parent.valueDeclaration, (d) => node === d)) { - node = symbol.parent.valueDeclaration; - } - } - } - if (!node) { - return void 0; - } - const kind = node.kind; - switch (kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 174 /* MethodSignature */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 318 /* JSDocFunctionType */: - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 266 /* TypeAliasDeclaration */: - case 346 /* JSDocTemplateTag */: - case 347 /* JSDocTypedefTag */: - case 341 /* JSDocEnumTag */: - case 339 /* JSDocCallbackTag */: - case 201 /* MappedType */: - case 195 /* ConditionalType */: { - const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if ((kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */ || isObjectLiteralMethod(node)) && isContextSensitive(node)) { - const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(node)), 0 /* Call */)); - if (signature && signature.typeParameters) { - return [...outerTypeParameters || emptyArray, ...signature.typeParameters]; - } - } - if (kind === 201 /* MappedType */) { - return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))); - } else if (kind === 195 /* ConditionalType */) { - return concatenate(outerTypeParameters, getInferTypeParameters(node)); - } - const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node)); - const thisType = includeThisTypes && (kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 265 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; - return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; - } - case 342 /* JSDocParameterTag */: - const paramSymbol = getParameterSymbolFromJSDoc(node); - if (paramSymbol) { - node = paramSymbol.valueDeclaration; - } - break; - case 321 /* JSDoc */: { - const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters; - } - } - } - } - 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 === 265 /* InterfaceDeclaration */) { - return true; - } - if (decl.kind !== 261 /* VariableDeclaration */) { - return false; - } - const initializer = decl.initializer; - return !!initializer && (initializer.kind === 219 /* FunctionExpression */ || initializer.kind === 220 /* ArrowFunction */); - }); - Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); - return getOuterTypeParameters(declaration); - } - function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { - if (!symbol.declarations) { - return; - } - let result; - for (const node of symbol.declarations) { - if (node.kind === 265 /* InterfaceDeclaration */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) { - const declaration = node; - result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration)); - } - } - return result; - } - function getTypeParametersOfClassOrInterface(symbol) { - return concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); - } - function isMixinConstructorType(type) { - const signatures = getSignaturesOfType(type, 1 /* Construct */); - if (signatures.length === 1) { - const s = signatures[0]; - if (!s.typeParameters && s.parameters.length === 1 && signatureHasRestParameter(s)) { - const paramType = getTypeOfParameter(s.parameters[0]); - return isTypeAny(paramType) || getElementTypeOfArrayType(paramType) === anyType; - } - } - return false; - } - function isConstructorType(type) { - if (getSignaturesOfType(type, 1 /* Construct */).length > 0) { - return true; - } - if (type.flags & 8650752 /* TypeVariable */) { - const constraint = getBaseConstraintOfType(type); - return !!constraint && isMixinConstructorType(constraint); - } - return false; - } - function getBaseTypeNodeOfClass(type) { - const decl = getClassLikeDeclarationOfSymbol(type.symbol); - return decl && getEffectiveBaseTypeNode(decl); - } - 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)); - } - function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { - const signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); - const typeArguments = map(typeArgumentNodes, getTypeFromTypeNode); - return sameMap(signatures, (sig) => some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments, isInJSFile(location)) : sig); - } - function getBaseConstructorTypeOfClass(type) { - if (!type.resolvedBaseConstructorType) { - const decl = getClassLikeDeclarationOfSymbol(type.symbol); - const extended = decl && getEffectiveBaseTypeNode(decl); - const baseTypeNode = getBaseTypeNodeOfClass(type); - if (!baseTypeNode) { - return type.resolvedBaseConstructorType = undefinedType; - } - if (!pushTypeResolution(type, 1 /* ResolvedBaseConstructorType */)) { - return errorType; - } - const baseConstructorType = checkExpression(baseTypeNode.expression); - if (extended && baseTypeNode !== extended) { - Debug.assert(!extended.typeArguments); - checkExpression(extended.expression); - } - if (baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */)) { - resolveStructuredTypeMembers(baseConstructorType); - } - if (!popTypeResolution()) { - error2(type.symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); - return type.resolvedBaseConstructorType ?? (type.resolvedBaseConstructorType = errorType); - } - if (!(baseConstructorType.flags & 1 /* Any */) && baseConstructorType !== nullWideningType && !isConstructorType(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; - if (constraint) { - const ctorSig = getSignaturesOfType(constraint, 1 /* Construct */); - if (ctorSig[0]) { - ctorReturn = getReturnTypeOfSignature(ctorSig[0]); - } - } - if (baseConstructorType.symbol.declarations) { - addRelatedInfo(err, createDiagnosticForNode(baseConstructorType.symbol.declarations[0], Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString(baseConstructorType.symbol), typeToString(ctorReturn))); - } - } - return type.resolvedBaseConstructorType ?? (type.resolvedBaseConstructorType = errorType); - } - type.resolvedBaseConstructorType ?? (type.resolvedBaseConstructorType = baseConstructorType); - } - return type.resolvedBaseConstructorType; - } - function getImplementsTypes(type) { - let resolvedImplementsTypes = emptyArray; - if (type.symbol.declarations) { - for (const declaration of type.symbol.declarations) { - const implementsTypeNodes = getEffectiveImplementsTypeNodes(declaration); - if (!implementsTypeNodes) continue; - for (const node of implementsTypeNodes) { - const implementsType = getTypeFromTypeNode(node); - if (!isErrorType(implementsType)) { - if (resolvedImplementsTypes === emptyArray) { - resolvedImplementsTypes = [implementsType]; - } else { - resolvedImplementsTypes.push(implementsType); - } - } - } - } - } - return resolvedImplementsTypes; - } - function reportCircularBaseType(node, type) { - error2(node, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( - type, - /*enclosingDeclaration*/ - void 0, - 2 /* WriteArrayAsGenericType */ - )); - } - function getBaseTypes(type) { - if (!type.baseTypesResolved) { - if (pushTypeResolution(type, 6 /* ResolvedBaseTypes */)) { - if (type.objectFlags & 8 /* Tuple */) { - type.resolvedBaseTypes = [getTupleBaseType(type)]; - } else if (type.symbol.flags & (32 /* Class */ | 64 /* Interface */)) { - if (type.symbol.flags & 32 /* Class */) { - resolveBaseTypesOfClass(type); - } - if (type.symbol.flags & 64 /* Interface */) { - resolveBaseTypesOfInterface(type); - } - } else { - Debug.fail("type must be class or interface"); - } - if (!popTypeResolution() && type.symbol.declarations) { - for (const declaration of type.symbol.declarations) { - if (declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 265 /* InterfaceDeclaration */) { - reportCircularBaseType(declaration, type); - } - } - } - } - type.baseTypesResolved = true; - } - return type.resolvedBaseTypes; - } - function getTupleBaseType(type) { - const elementTypes = sameMap(type.typeParameters, (t, i) => type.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t); - return createArrayType(getUnionType(elementTypes || emptyArray), type.readonly); - } - function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = resolvingEmptyArray; - const baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); - if (!(baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 1 /* Any */))) { - return type.resolvedBaseTypes = emptyArray; - } - const baseTypeNode = getBaseTypeNodeOfClass(type); - let baseType; - const originalBaseType = baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : void 0; - if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 /* Class */ && areAllOuterTypeParametersApplied(originalBaseType)) { - baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); - } else if (baseConstructorType.flags & 1 /* Any */) { - baseType = baseConstructorType; - } else { - const constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); - if (!constructors.length) { - error2(baseTypeNode.expression, Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); - return type.resolvedBaseTypes = emptyArray; - } - baseType = getReturnTypeOfSignature(constructors[0]); - } - if (isErrorType(baseType)) { - return type.resolvedBaseTypes = emptyArray; - } - const reducedBaseType = getReducedType(baseType); - if (!isValidBaseType(reducedBaseType)) { - const elaboration = elaborateNeverIntersection( - /*errorInfo*/ - void 0, - baseType - ); - const diagnostic = chainDiagnosticMessages(elaboration, Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType)); - diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(baseTypeNode.expression), baseTypeNode.expression, diagnostic)); - return type.resolvedBaseTypes = emptyArray; - } - if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) { - 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) { - type.members = void 0; - } - return type.resolvedBaseTypes = [reducedBaseType]; - } - function areAllOuterTypeParametersApplied(type) { - const outerTypeParameters = type.outerTypeParameters; - if (outerTypeParameters) { - const last2 = outerTypeParameters.length - 1; - const typeArguments = getTypeArguments(type); - return outerTypeParameters[last2].symbol !== typeArguments[last2].symbol; - } - return true; - } - function isValidBaseType(type) { - if (type.flags & 262144 /* TypeParameter */) { - const constraint = getBaseConstraintOfType(type); - if (constraint) { - return isValidBaseType(constraint); - } - } - return !!(type.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || type.flags & 2097152 /* Intersection */ && every(type.types, isValidBaseType)); - } - function resolveBaseTypesOfInterface(type) { - type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - if (type.symbol.declarations) { - for (const declaration of type.symbol.declarations) { - if (declaration.kind === 265 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) { - for (const node of getInterfaceBaseTypeNodes(declaration)) { - const baseType = getReducedType(getTypeFromTypeNode(node)); - if (!isErrorType(baseType)) { - if (isValidBaseType(baseType)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - if (type.resolvedBaseTypes === emptyArray) { - type.resolvedBaseTypes = [baseType]; - } else { - type.resolvedBaseTypes.push(baseType); - } - } else { - reportCircularBaseType(declaration, type); - } - } else { - error2(node, Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); - } - } - } - } - } - } - } - function isThislessInterface(symbol) { - if (!symbol.declarations) { - return true; - } - for (const declaration of symbol.declarations) { - if (declaration.kind === 265 /* InterfaceDeclaration */) { - if (declaration.flags & 256 /* ContainsThis */) { - return false; - } - const baseTypeNodes = getInterfaceBaseTypeNodes(declaration); - if (baseTypeNodes) { - for (const node of baseTypeNodes) { - if (isEntityNameExpression(node.expression)) { - const baseSymbol = resolveEntityName( - node.expression, - 788968 /* Type */, - /*ignoreErrors*/ - true - ); - if (!baseSymbol || !(baseSymbol.flags & 64 /* Interface */) || getDeclaredTypeOfClassOrInterface(baseSymbol).thisType) { - return false; - } - } - } - } - } - } - return true; - } - function getDeclaredTypeOfClassOrInterface(symbol) { - let links = getSymbolLinks(symbol); - const originalLinks = links; - if (!links.declaredType) { - const kind = symbol.flags & 32 /* Class */ ? 1 /* Class */ : 2 /* Interface */; - const merged = mergeJSSymbols(symbol, symbol.valueDeclaration && getAssignedClassSymbol(symbol.valueDeclaration)); - if (merged) { - symbol = merged; - links = merged.links; - } - const type = originalLinks.declaredType = links.declaredType = createObjectType(kind, symbol); - const outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol); - const localTypeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - if (outerTypeParameters || localTypeParameters || kind === 1 /* Class */ || !isThislessInterface(symbol)) { - type.objectFlags |= 4 /* Reference */; - type.typeParameters = concatenate(outerTypeParameters, localTypeParameters); - type.outerTypeParameters = outerTypeParameters; - type.localTypeParameters = localTypeParameters; - type.instantiations = /* @__PURE__ */ new Map(); - type.instantiations.set(getTypeListId(type.typeParameters), type); - type.target = type; - type.resolvedTypeArguments = type.typeParameters; - type.thisType = createTypeParameter(symbol); - type.thisType.isThisType = true; - type.thisType.constraint = type; - } - } - return links.declaredType; - } - function getDeclaredTypeOfTypeAlias(symbol) { - var _a; - const links = getSymbolLinks(symbol); - if (!links.declaredType) { - if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { - return errorType; - } - const declaration = Debug.checkDefined((_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias), "Type alias symbol with no valid declaration found"); - const typeNode = isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type; - let type = typeNode ? getTypeFromTypeNode(typeNode) : errorType; - if (popTypeResolution()) { - const typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - if (typeParameters) { - links.typeParameters = typeParameters; - links.instantiations = /* @__PURE__ */ new Map(); - links.instantiations.set(getTypeListId(typeParameters), type); - } - if (type === intrinsicMarkerType && symbol.escapedName === "BuiltinIteratorReturn") { - type = getBuiltinIteratorReturnType(); - } - } else { - type = errorType; - if (declaration.kind === 341 /* JSDocEnumTag */) { - error2(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); - } else { - error2(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); - } - } - links.declaredType ?? (links.declaredType = type); - } - return links.declaredType; - } - function getBaseTypeOfEnumLikeType(type) { - return type.flags & 1056 /* EnumLike */ && type.symbol.flags & 8 /* EnumMember */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type; - } - function getDeclaredTypeOfEnum(symbol) { - const links = getSymbolLinks(symbol); - if (!links.declaredType) { - const memberTypeList = []; - if (symbol.declarations) { - for (const declaration of symbol.declarations) { - if (declaration.kind === 267 /* EnumDeclaration */) { - for (const member of declaration.members) { - if (hasBindableName(member)) { - const memberSymbol = getSymbolOfDeclaration(member); - const value = getEnumMemberValue(member).value; - const memberType = getFreshTypeOfLiteralType( - value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol) - ); - getSymbolLinks(memberSymbol).declaredType = memberType; - memberTypeList.push(getRegularTypeOfLiteralType(memberType)); - } - } - } - } - } - const enumType = memberTypeList.length ? getUnionType( - memberTypeList, - 1 /* Literal */, - symbol, - /*aliasTypeArguments*/ - void 0 - ) : createComputedEnumType(symbol); - if (enumType.flags & 1048576 /* Union */) { - enumType.flags |= 1024 /* EnumLiteral */; - enumType.symbol = symbol; - } - links.declaredType = enumType; - } - return links.declaredType; - } - function createComputedEnumType(symbol) { - const regularType = createTypeWithSymbol(32 /* Enum */, symbol); - const freshType = createTypeWithSymbol(32 /* Enum */, symbol); - regularType.regularType = regularType; - regularType.freshType = freshType; - freshType.regularType = regularType; - freshType.freshType = freshType; - return regularType; - } - function getDeclaredTypeOfEnumMember(symbol) { - const links = getSymbolLinks(symbol); - if (!links.declaredType) { - const enumType = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); - if (!links.declaredType) { - links.declaredType = enumType; - } - } - return links.declaredType; - } - function getDeclaredTypeOfTypeParameter(symbol) { - const links = getSymbolLinks(symbol); - return links.declaredType || (links.declaredType = createTypeParameter(symbol)); - } - function getDeclaredTypeOfAlias(symbol) { - const links = getSymbolLinks(symbol); - return links.declaredType || (links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol))); - } - function getDeclaredTypeOfSymbol(symbol) { - return tryGetDeclaredTypeOfSymbol(symbol) || errorType; - } - function tryGetDeclaredTypeOfSymbol(symbol) { - if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { - return getDeclaredTypeOfClassOrInterface(symbol); - } - if (symbol.flags & 524288 /* TypeAlias */) { - return getDeclaredTypeOfTypeAlias(symbol); - } - if (symbol.flags & 262144 /* TypeParameter */) { - return getDeclaredTypeOfTypeParameter(symbol); - } - if (symbol.flags & 384 /* Enum */) { - return getDeclaredTypeOfEnum(symbol); - } - if (symbol.flags & 8 /* EnumMember */) { - return getDeclaredTypeOfEnumMember(symbol); - } - if (symbol.flags & 2097152 /* Alias */) { - return getDeclaredTypeOfAlias(symbol); - } - return void 0; - } - function isThislessType(node) { - switch (node.kind) { - case 133 /* AnyKeyword */: - case 159 /* UnknownKeyword */: - case 154 /* StringKeyword */: - case 150 /* NumberKeyword */: - case 163 /* BigIntKeyword */: - case 136 /* BooleanKeyword */: - case 155 /* SymbolKeyword */: - case 151 /* ObjectKeyword */: - case 116 /* VoidKeyword */: - case 157 /* UndefinedKeyword */: - case 146 /* NeverKeyword */: - case 202 /* LiteralType */: - return true; - case 189 /* ArrayType */: - return isThislessType(node.elementType); - case 184 /* TypeReference */: - return !node.typeArguments || node.typeArguments.every(isThislessType); - } - return false; - } - function isThislessTypeParameter(node) { - const constraint = getEffectiveConstraintOfTypeParameter(node); - return !constraint || isThislessType(constraint); - } - function isThislessVariableLikeDeclaration(node) { - const typeNode = getEffectiveTypeAnnotationNode(node); - return typeNode ? isThislessType(typeNode) : !hasInitializer(node); - } - function isThislessFunctionLikeDeclaration(node) { - const returnType = getEffectiveReturnTypeNode(node); - const typeParameters = getEffectiveTypeParameterDeclarations(node); - return (node.kind === 177 /* 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 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - return isThislessVariableLikeDeclaration(declaration); - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return isThislessFunctionLikeDeclaration(declaration); - } - } - } - return false; - } - function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) { - const result = createSymbolTable(); - for (const symbol of symbols) { - result.set(symbol.escapedName, mappingThisOnly && isThisless(symbol) ? symbol : instantiateSymbol(symbol, mapper)); - } - return result; - } - function addInheritedMembers(symbols, baseSymbols) { - for (const base of baseSymbols) { - if (isStaticPrivateIdentifierProperty(base)) { - continue; - } - const derived = symbols.get(base.escapedName); - if (!derived || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration) && !isConstructorDeclaredProperty(derived) && !getContainingClassStaticBlock(derived.valueDeclaration)) { - symbols.set(base.escapedName, base); - symbols.set(base.escapedName, base); - } - } - } - function isStaticPrivateIdentifierProperty(s) { - return !!s.valueDeclaration && isPrivateIdentifierClassElementDeclaration(s.valueDeclaration) && isStatic(s.valueDeclaration); - } - function resolveDeclaredMembers(type) { - if (!type.declaredProperties) { - const symbol = type.symbol; - const members = getMembersOfSymbol(symbol); - type.declaredProperties = getNamedMembers(members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredIndexInfos = emptyArray; - type.declaredCallSignatures = getSignaturesOfSymbol(members.get("__call" /* Call */)); - type.declaredConstructSignatures = getSignaturesOfSymbol(members.get("__new" /* New */)); - type.declaredIndexInfos = getIndexInfosOfSymbol(symbol); - } - return type; - } - function isLateBindableName(node) { - return isLateBindableAST(node) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression)); - } - function isLateBindableIndexSignature(node) { - return isLateBindableAST(node) && isTypeUsableAsIndexSignature(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression)); - } - function isLateBindableAST(node) { - if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) { - return false; - } - const expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression; - return isEntityNameExpression(expr); - } - function isTypeUsableAsIndexSignature(type) { - return isTypeAssignableTo(type, stringNumberSymbolType); - } - function isLateBoundName(name) { - return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) === 64 /* at */; - } - function hasLateBindableName(node) { - const name = getNameOfDeclaration(node); - return !!name && isLateBindableName(name); - } - function hasLateBindableIndexSignature(node) { - const name = getNameOfDeclaration(node); - return !!name && isLateBindableIndexSignature(name); - } - function hasBindableName(node) { - return !hasDynamicName(node) || hasLateBindableName(node); - } - function isNonBindableDynamicName(node) { - return isDynamicName(node) && !isLateBindableName(node); - } - function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) { - Debug.assert(!!(getCheckFlags(symbol) & 4096 /* Late */), "Expected a late-bound symbol."); - symbol.flags |= symbolFlags; - getSymbolLinks(member.symbol).lateSymbol = symbol; - if (!symbol.declarations) { - symbol.declarations = [member]; - } else if (!member.symbol.isReplaceableByMethod) { - symbol.declarations.push(member); - } - if (symbolFlags & 111551 /* Value */) { - setValueDeclaration(symbol, member); - } - } - function lateBindMember(parent2, earlySymbols, lateSymbols, decl) { - Debug.assert(!!decl.symbol, "The member is expected to have a symbol."); - const links = getNodeLinks(decl); - if (!links.resolvedSymbol) { - links.resolvedSymbol = decl.symbol; - const declName = isBinaryExpression(decl) ? decl.left : decl.name; - const type = isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName); - if (isTypeUsableAsPropertyName(type)) { - const memberName = getPropertyNameFromType(type); - const symbolFlags = decl.symbol.flags; - let lateSymbol = lateSymbols.get(memberName); - if (!lateSymbol) lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */)); - const earlySymbol = earlySymbols && earlySymbols.get(memberName); - if (!(parent2.flags & 32 /* Class */) && lateSymbol.flags & getExcludedSymbolFlags(symbolFlags)) { - const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations; - const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName); - 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; - addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); - if (lateSymbol.parent) { - Debug.assert(lateSymbol.parent === parent2, "Existing symbol parent should match new one"); - } else { - lateSymbol.parent = parent2; - } - return links.resolvedSymbol = lateSymbol; - } - } - return links.resolvedSymbol; - } - function lateBindIndexSignature(parent2, earlySymbols, lateSymbols, decl) { - let indexSymbol = lateSymbols.get("__index" /* Index */); - if (!indexSymbol) { - const early = earlySymbols == null ? void 0 : earlySymbols.get("__index" /* Index */); - if (!early) { - indexSymbol = createSymbol(0 /* None */, "__index" /* Index */, 4096 /* Late */); - } else { - indexSymbol = cloneSymbol(early); - indexSymbol.links.checkFlags |= 4096 /* Late */; - } - lateSymbols.set("__index" /* Index */, indexSymbol); - } - if (!indexSymbol.declarations) { - indexSymbol.declarations = [decl]; - } else if (!decl.symbol.isReplaceableByMethod) { - indexSymbol.declarations.push(decl); - } - } - function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) { - const links = getSymbolLinks(symbol); - if (!links[resolutionKind]) { - const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */; - const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports; - links[resolutionKind] = earlySymbols || emptySymbols; - const lateSymbols = createSymbolTable(); - for (const decl of symbol.declarations || emptyArray) { - const members = getMembersOfDeclaration(decl); - if (members) { - for (const member of members) { - if (isStatic2 === hasStaticModifier(member)) { - if (hasLateBindableName(member)) { - lateBindMember(symbol, earlySymbols, lateSymbols, member); - } else if (hasLateBindableIndexSignature(member)) { - lateBindIndexSignature(symbol, earlySymbols, lateSymbols, member); - } - } - } - } - } - const assignments = getFunctionExpressionParentSymbolOrSymbol(symbol).assignmentDeclarationMembers; - if (assignments) { - const decls = arrayFrom(assignments.values()); - for (const member of decls) { - const assignmentKind = getAssignmentDeclarationKind(member); - const isInstanceMember = assignmentKind === 3 /* PrototypeProperty */ || isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) || assignmentKind === 9 /* ObjectDefinePrototypeProperty */ || assignmentKind === 6 /* Prototype */; - if (isStatic2 === !isInstanceMember) { - if (hasLateBindableName(member)) { - lateBindMember(symbol, earlySymbols, lateSymbols, member); - } - } - } - } - 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]; - } - function getMembersOfSymbol(symbol) { - return symbol.flags & 6256 /* LateBindingContainer */ ? getResolvedMembersOrExportsOfSymbol(symbol, "resolvedMembers" /* resolvedMembers */) : symbol.members || emptySymbols; - } - function getLateBoundSymbol(symbol) { - if (symbol.flags & 106500 /* ClassMember */ && symbol.escapedName === "__computed" /* Computed */) { - const links = getSymbolLinks(symbol); - if (!links.lateSymbol && some(symbol.declarations, hasLateBindableName)) { - const parent2 = getMergedSymbol(symbol.parent); - if (some(symbol.declarations, hasStaticModifier)) { - getExportsOfSymbol(parent2); - } else { - getMembersOfSymbol(parent2); - } - } - return links.lateSymbol || (links.lateSymbol = symbol); - } - return symbol; - } - function getTypeWithThisArgument(type, thisArgument, needApparentType) { - if (getObjectFlags(type) & 4 /* Reference */) { - const target = type.target; - const typeArguments = getTypeArguments(type); - return length(target.typeParameters) === length(typeArguments) ? createTypeReference(target, concatenate(typeArguments, [thisArgument || target.thisType])) : type; - } else if (type.flags & 2097152 /* Intersection */) { - const types = sameMap(type.types, (t) => getTypeWithThisArgument(t, thisArgument, needApparentType)); - return types !== type.types ? getIntersectionType(types) : type; - } - return needApparentType ? getApparentType(type) : type; - } - function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) { - let mapper; - let members; - let callSignatures; - let constructSignatures; - let indexInfos; - if (rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { - members = source.symbol ? getMembersOfSymbol(source.symbol) : createSymbolTable(source.declaredProperties); - callSignatures = source.declaredCallSignatures; - constructSignatures = source.declaredConstructSignatures; - indexInfos = source.declaredIndexInfos; - } else { - mapper = createTypeMapper(typeParameters, typeArguments); - members = createInstantiatedSymbolTable( - source.declaredProperties, - mapper, - /*mappingThisOnly*/ - typeParameters.length === 1 - ); - callSignatures = instantiateSignatures(source.declaredCallSignatures, mapper); - constructSignatures = instantiateSignatures(source.declaredConstructSignatures, mapper); - indexInfos = instantiateIndexInfos(source.declaredIndexInfos, mapper); - } - const baseTypes = getBaseTypes(source); - if (baseTypes.length) { - if (source.symbol && members === getMembersOfSymbol(source.symbol)) { - 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); - for (const baseType of baseTypes) { - const instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; - addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); - callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); - constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); - const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo]; - indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, (info) => !findIndexInfo(indexInfos, info.keyType))); - } - } - setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos); - } - function resolveClassOrInterfaceMembers(type) { - resolveObjectTypeMembers(type, resolveDeclaredMembers(type), emptyArray, emptyArray); - } - function resolveTypeReferenceMembers(type) { - const source = resolveDeclaredMembers(type.target); - const typeParameters = concatenate(source.typeParameters, [source.thisType]); - const typeArguments = getTypeArguments(type); - const paddedTypeArguments = typeArguments.length === typeParameters.length ? typeArguments : concatenate(typeArguments, [type]); - resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments); - } - function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) { - const sig = new Signature13(checker, flags); - sig.declaration = declaration; - sig.typeParameters = typeParameters; - sig.parameters = parameters; - sig.thisParameter = thisParameter; - sig.resolvedReturnType = resolvedReturnType; - sig.resolvedTypePredicate = resolvedTypePredicate; - sig.minArgumentCount = minArgumentCount; - sig.resolvedMinArgumentCount = void 0; - sig.target = void 0; - sig.mapper = void 0; - sig.compositeSignatures = void 0; - sig.compositeKind = void 0; - return sig; - } - function cloneSignature(sig) { - const result = createSignature( - sig.declaration, - sig.typeParameters, - sig.thisParameter, - sig.parameters, - /*resolvedReturnType*/ - void 0, - /*resolvedTypePredicate*/ - void 0, - sig.minArgumentCount, - sig.flags & 167 /* PropagatingFlags */ - ); - result.target = sig.target; - result.mapper = sig.mapper; - result.compositeSignatures = sig.compositeSignatures; - result.compositeKind = sig.compositeKind; - return result; - } - function createUnionSignature(signature, unionSignatures) { - const result = cloneSignature(signature); - result.compositeSignatures = unionSignatures; - result.compositeKind = 1048576 /* Union */; - result.target = void 0; - result.mapper = void 0; - return result; - } - function getOptionalCallSignature(signature, callChainFlags) { - if ((signature.flags & 24 /* CallChainFlags */) === callChainFlags) { - return signature; - } - if (!signature.optionalCallSignatureCache) { - signature.optionalCallSignatureCache = {}; - } - const key = callChainFlags === 8 /* IsInnerCallChain */ ? "inner" : "outer"; - 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."); - const result = cloneSignature(signature); - result.flags |= callChainFlags; - return result; - } - function getExpandedParameters(sig, skipUnionExpanding) { - if (signatureHasRestParameter(sig)) { - const restIndex = sig.parameters.length - 1; - const restSymbol = sig.parameters[restIndex]; - const restType = getTypeOfSymbol(restSymbol); - if (isTupleType(restType)) { - return [expandSignatureParametersWithTupleMembers(restType, restIndex, restSymbol)]; - } else if (!skipUnionExpanding && restType.flags & 1048576 /* Union */ && every(restType.types, isTupleType)) { - return map(restType.types, (t) => expandSignatureParametersWithTupleMembers(t, restIndex, restSymbol)); - } - } - return [sig.parameters]; - function expandSignatureParametersWithTupleMembers(restType, restIndex, restSymbol) { - const elementTypes = getTypeArguments(restType); - const associatedNames = getUniqAssociatedNamesFromTupleType(restType, restSymbol); - const restParams = map(elementTypes, (t, i) => { - const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType); - const flags = restType.target.elementFlags[i]; - const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0; - const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags); - symbol.links.type = flags & 4 /* Rest */ ? createArrayType(t) : t; - return symbol; - }); - return concatenate(sig.parameters.slice(0, restIndex), restParams); - } - function getUniqAssociatedNamesFromTupleType(type, restSymbol) { - const names = map(type.target.labeledElementDeclarations, (labeledElement, i) => getTupleElementLabel(labeledElement, i, type.target.elementFlags[i], restSymbol)); - if (names) { - const duplicates = []; - const uniqueNames = /* @__PURE__ */ new Set(); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - if (!tryAddToSet(uniqueNames, name)) { - duplicates.push(i); - } - } - const counters = /* @__PURE__ */ new Map(); - for (const i of duplicates) { - let counter = counters.get(names[i]) ?? 1; - let name; - while (!tryAddToSet(uniqueNames, name = `${names[i]}_${counter}`)) { - counter++; - } - names[i] = name; - counters.set(names[i], counter + 1); - } - } - return names; - } - } - function getDefaultConstructSignatures(classType) { - const baseConstructorType = getBaseConstructorTypeOfClass(classType); - const baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); - const declaration = getClassLikeDeclarationOfSymbol(classType.symbol); - const isAbstract = !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */); - if (baseSignatures.length === 0) { - return [createSignature( - /*declaration*/ - void 0, - classType.localTypeParameters, - /*thisParameter*/ - void 0, - emptyArray, - classType, - /*resolvedTypePredicate*/ - void 0, - 0, - isAbstract ? 4 /* Abstract */ : 0 /* None */ - )]; - } - const baseTypeNode = getBaseTypeNodeOfClass(classType); - const isJavaScript = isInJSFile(baseTypeNode); - const typeArguments = typeArgumentsFromTypeReferenceNode(baseTypeNode); - const typeArgCount = length(typeArguments); - const result = []; - for (const baseSig of baseSignatures) { - const minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); - const typeParamCount = length(baseSig.typeParameters); - if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { - const sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); - sig.typeParameters = classType.localTypeParameters; - sig.resolvedReturnType = classType; - sig.flags = isAbstract ? sig.flags | 4 /* Abstract */ : sig.flags & ~4 /* Abstract */; - result.push(sig); - } - } - return result; - } - function findMatchingSignature(signatureList, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes) { - for (const s of signatureList) { - if (compareSignaturesIdentical(s, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes, partialMatch ? compareTypesSubtypeOf : compareTypesIdentical)) { - return s; - } - } - } - function findMatchingSignatures(signatureLists, signature, listIndex) { - if (signature.typeParameters) { - if (listIndex > 0) { - return void 0; - } - for (let i = 1; i < signatureLists.length; i++) { - if (!findMatchingSignature( - signatureLists[i], - signature, - /*partialMatch*/ - false, - /*ignoreThisTypes*/ - false, - /*ignoreReturnTypes*/ - false - )) { - return void 0; - } - } - return [signature]; - } - 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*/ - true, - /*ignoreThisTypes*/ - false, - /*ignoreReturnTypes*/ - true - ); - if (!match) { - return void 0; - } - result = appendIfUnique(result, match); - } - return result; - } - function getUnionSignatures(signatureLists) { - let result; - let indexWithLengthOverOne; - for (let i = 0; i < signatureLists.length; i++) { - if (signatureLists[i].length === 0) return emptyArray; - if (signatureLists[i].length > 1) { - indexWithLengthOverOne = indexWithLengthOverOne === void 0 ? i : -1; - } - for (const signature of signatureLists[i]) { - if (!result || !findMatchingSignature( - result, - signature, - /*partialMatch*/ - false, - /*ignoreThisTypes*/ - false, - /*ignoreReturnTypes*/ - true - )) { - const unionSignatures = findMatchingSignatures(signatureLists, signature, i); - if (unionSignatures) { - let s = signature; - if (unionSignatures.length > 1) { - let thisParameter = signature.thisParameter; - const firstThisParameterOfUnionSignatures = forEach(unionSignatures, (sig) => sig.thisParameter); - if (firstThisParameterOfUnionSignatures) { - const thisType = getIntersectionType(mapDefined(unionSignatures, (sig) => sig.thisParameter && getTypeOfSymbol(sig.thisParameter))); - thisParameter = createSymbolWithType(firstThisParameterOfUnionSignatures, thisType); - } - s = createUnionSignature(signature, unionSignatures); - s.thisParameter = thisParameter; - } - (result || (result = [])).push(s); - } - } - } - } - if (!length(result) && indexWithLengthOverOne !== -1) { - const masterList = signatureLists[indexWithLengthOverOne !== void 0 ? indexWithLengthOverOne : 0]; - let results = masterList.slice(); - for (const signatures of signatureLists) { - if (signatures !== masterList) { - const signature = signatures[0]; - Debug.assert(!!signature, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"); - results = !!signature.typeParameters && some(results, (s) => !!s.typeParameters && !compareTypeParametersIdentical(signature.typeParameters, s.typeParameters)) ? void 0 : map(results, (sig) => combineSignaturesOfUnionMembers(sig, signature)); - if (!results) { - break; - } - } - } - result = results; - } - return result || emptyArray; - } - function compareTypeParametersIdentical(sourceParams, targetParams) { - if (length(sourceParams) !== length(targetParams)) { - return false; - } - if (!sourceParams || !targetParams) { - return true; - } - const mapper = createTypeMapper(targetParams, sourceParams); - for (let i = 0; i < sourceParams.length; i++) { - const source = sourceParams[i]; - const target = targetParams[i]; - if (source === target) continue; - if (!isTypeIdenticalTo(getConstraintFromTypeParameter(source) || unknownType, instantiateType(getConstraintFromTypeParameter(target) || unknownType, mapper))) return false; - } - return true; - } - function combineUnionThisParam(left, right, mapper) { - if (!left || !right) { - return left || right; - } - const thisType = getIntersectionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]); - return createSymbolWithType(left, thisType); - } - function combineUnionParameters(left, right, mapper) { - const leftCount = getParameterCount(left); - const rightCount = getParameterCount(right); - const longest = leftCount >= rightCount ? left : right; - const shorter = longest === left ? right : left; - const longestCount = longest === left ? leftCount : rightCount; - const eitherHasEffectiveRest = hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right); - const needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); - const params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); - for (let i = 0; i < longestCount; i++) { - let longestParamType = tryGetTypeAtPosition(longest, i); - if (longest === right) { - longestParamType = instantiateType(longestParamType, mapper); - } - let shorterParamType = tryGetTypeAtPosition(shorter, i) || unknownType; - if (shorter === right) { - shorterParamType = instantiateType(shorterParamType, mapper); - } - const unionParamType = getIntersectionType([longestParamType, shorterParamType]); - const isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === longestCount - 1; - const isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter); - const leftName = i >= leftCount ? void 0 : getParameterNameAtPosition(left, i); - const rightName = i >= rightCount ? void 0 : getParameterNameAtPosition(right, i); - const paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0; - const paramSymbol = createSymbol( - 1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), - 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", 32768 /* RestParameter */); - restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount)); - if (shorter === right) { - restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper); - } - params[longestCount] = restParamSymbol; - } - return params; - } - function combineSignaturesOfUnionMembers(left, right) { - const typeParams = left.typeParameters || right.typeParameters; - let paramMapper; - if (left.typeParameters && right.typeParameters) { - paramMapper = createTypeMapper(right.typeParameters, left.typeParameters); - } - let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */); - const declaration = left.declaration; - const params = combineUnionParameters(left, right, paramMapper); - const lastParam = lastOrUndefined(params); - if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) { - flags |= 1 /* HasRestParameter */; - } - const thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper); - const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); - const result = createSignature( - declaration, - typeParams, - thisParam, - params, - /*resolvedReturnType*/ - void 0, - /*resolvedTypePredicate*/ - void 0, - minArgCount, - flags - ); - 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; - } - function getUnionIndexInfos(types) { - const sourceInfos = getIndexInfosOfType(types[0]); - if (sourceInfos) { - const result = []; - 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))); - } - } - return result; - } - return emptyArray; - } - function resolveUnionTypeMembers(type) { - const callSignatures = getUnionSignatures(map(type.types, (t) => t === globalFunctionType ? [unknownSignature] : getSignaturesOfType(t, 0 /* Call */))); - const constructSignatures = getUnionSignatures(map(type.types, (t) => getSignaturesOfType(t, 1 /* Construct */))); - const indexInfos = getUnionIndexInfos(type.types); - setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, indexInfos); - } - function intersectTypes(type1, type2) { - return !type1 ? type2 : !type2 ? type1 : getIntersectionType([type1, type2]); - } - function findMixins(types) { - const constructorTypeCount = countWhere(types, (t) => getSignaturesOfType(t, 1 /* Construct */).length > 0); - const mixinFlags = map(types, isMixinConstructorType); - if (constructorTypeCount > 0 && constructorTypeCount === countWhere(mixinFlags, (b) => b)) { - const firstMixinIndex = mixinFlags.indexOf( - /*searchElement*/ - true - ); - mixinFlags[firstMixinIndex] = false; - } - return mixinFlags; - } - function includeMixinType(type, types, mixinFlags, index) { - const mixedTypes = []; - for (let i = 0; i < types.length; i++) { - if (i === index) { - mixedTypes.push(type); - } else if (mixinFlags[i]) { - mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1 /* Construct */)[0])); - } - } - return getIntersectionType(mixedTypes); - } - function resolveIntersectionTypeMembers(type) { - let callSignatures; - let constructSignatures; - let indexInfos; - const types = type.types; - const mixinFlags = findMixins(types); - const mixinCount = countWhere(mixinFlags, (b) => b); - for (let i = 0; i < types.length; i++) { - const t = type.types[i]; - if (!mixinFlags[i]) { - let signatures = getSignaturesOfType(t, 1 /* Construct */); - if (signatures.length && mixinCount > 0) { - signatures = map(signatures, (s) => { - const clone2 = cloneSignature(s); - clone2.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, mixinFlags, i); - return clone2; - }); - } - constructSignatures = appendSignatures(constructSignatures, signatures); - } - callSignatures = appendSignatures(callSignatures, getSignaturesOfType(t, 0 /* Call */)); - indexInfos = reduceLeft(getIndexInfosOfType(t), (infos, newInfo) => appendIndexInfo( - infos, - newInfo, - /*union*/ - false - ), indexInfos); - } - setStructuredTypeMembers(type, emptySymbols, callSignatures || emptyArray, constructSignatures || emptyArray, indexInfos || emptyArray); - } - function appendSignatures(signatures, newSignatures) { - for (const sig of newSignatures) { - if (!signatures || every(signatures, (s) => !compareSignaturesIdentical( - s, - sig, - /*partialMatch*/ - false, - /*ignoreThisTypes*/ - false, - /*ignoreReturnTypes*/ - false, - compareTypesIdentical - ))) { - signatures = append(signatures, sig); - } - } - return signatures; - } - function appendIndexInfo(indexInfos, newInfo, union) { - if (indexInfos) { - 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); - return indexInfos; - } - } - } - return append(indexInfos, newInfo); - } - function resolveAnonymousTypeMembers(type) { - if (type.target) { - setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray); - const members2 = createInstantiatedSymbolTable( - getPropertiesOfObjectType(type.target), - type.mapper, - /*mappingThisOnly*/ - false - ); - const callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper); - const constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper); - const indexInfos2 = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper); - setStructuredTypeMembers(type, members2, callSignatures, constructSignatures, indexInfos2); - return; - } - const symbol = getMergedSymbol(type.symbol); - if (symbol.flags & 2048 /* TypeLiteral */) { - setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray); - const members2 = getMembersOfSymbol(symbol); - const callSignatures = getSignaturesOfSymbol(members2.get("__call" /* Call */)); - const constructSignatures = getSignaturesOfSymbol(members2.get("__new" /* New */)); - const indexInfos2 = getIndexInfosOfSymbol(symbol); - setStructuredTypeMembers(type, members2, callSignatures, constructSignatures, indexInfos2); - return; - } - let members = getExportsOfSymbol(symbol); - let indexInfos; - 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); - if (symbol.flags & 32 /* Class */) { - const classType = getDeclaredTypeOfClassOrInterface(symbol); - const baseConstructorType = getBaseConstructorTypeOfClass(classType); - if (baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 8650752 /* TypeVariable */)) { - members = createSymbolTable(getNamedOrIndexSignatureMembers(members)); - addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); - } else if (baseConstructorType === anyType) { - baseConstructorIndexInfo = anyBaseTypeIndexInfo; - } - } - const indexSymbol = getIndexSymbolFromSymbolTable(members); - if (indexSymbol) { - indexInfos = getIndexInfosOfIndexSymbol(indexSymbol, arrayFrom(members.values())); - } else { - if (baseConstructorIndexInfo) { - indexInfos = append(indexInfos, baseConstructorIndexInfo); - } - if (symbol.flags & 384 /* Enum */ && (getDeclaredTypeOfSymbol(symbol).flags & 32 /* Enum */ || some(type.properties, (prop) => !!(getTypeOfSymbol(prop).flags & 296 /* NumberLike */)))) { - indexInfos = append(indexInfos, enumNumberIndexInfo); - } - } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, indexInfos || emptyArray); - if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { - type.callSignatures = getSignaturesOfSymbol(symbol); - } - if (symbol.flags & 32 /* Class */) { - 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 & 167 /* PropagatingFlags */ - ) : void 0 - ) - ); - } - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } - type.constructSignatures = constructSignatures; - } - } - 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); - const readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true; - const optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */; - const indexInfos = indexInfo ? [createIndexInfo(stringType, inferReverseMappedType(indexInfo.type, type.mappedType, type.constraintType) || unknownType, 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; - inferredProp.links.nameType = getSymbolLinks(prop).nameType; - inferredProp.links.propertyType = getTypeOfSymbol(prop); - if (type.constraintType.type.flags & 8388608 /* IndexedAccess */ && type.constraintType.type.objectType.flags & 262144 /* TypeParameter */ && type.constraintType.type.indexType.flags & 262144 /* TypeParameter */) { - const newTypeParam = type.constraintType.type.objectType; - const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type, newTypeParam); - inferredProp.links.mappedType = newMappedType; - inferredProp.links.constraintType = getIndexType(newTypeParam); - } else { - inferredProp.links.mappedType = type.mappedType; - inferredProp.links.constraintType = type.constraintType; - } - members.set(prop.escapedName, inferredProp); - } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, indexInfos); - } - function getLowerBoundOfKeyType(type) { - if (type.flags & 4194304 /* Index */) { - const t = getApparentType(type.type); - return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t); - } - if (type.flags & 16777216 /* Conditional */) { - if (type.root.isDistributive) { - const checkType = type.checkType; - const constraint = getLowerBoundOfKeyType(checkType); - if (constraint !== checkType) { - return getConditionalTypeInstantiation( - type, - prependTypeMapping(type.root.checkType, constraint, type.mapper), - /*forConstraint*/ - false - ); - } - } - return type; - } - if (type.flags & 1048576 /* Union */) { - return mapType( - type, - getLowerBoundOfKeyType, - /*noReductions*/ - true - ); - } - if (type.flags & 2097152 /* Intersection */) { - const types = type.types; - if (types.length === 2 && !!(types[0].flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && types[1] === emptyTypeLiteralType) { - return type; - } - return getIntersectionType(sameMap(type.types, getLowerBoundOfKeyType)); - } - return type; - } - function getIsLateCheckFlag(s) { - return getCheckFlags(s) & 4096 /* Late */; - } - function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) { - for (const prop of getPropertiesOfType(type)) { - cb(getLiteralTypeFromProperty(prop, include)); - } - if (type.flags & 1 /* Any */) { - cb(stringType); - } else { - for (const info of getIndexInfosOfType(type)) { - if (!stringsOnly || info.keyType.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) { - cb(info.keyType); - } - } - } - } - function resolveMappedTypeMembers(type) { - const members = createSymbolTable(); - let indexInfos; - setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray); - const typeParameter = getTypeParameterFromMappedType(type); - const constraintType = getConstraintTypeFromMappedType(type); - const mappedType = type.target || type; - const nameType = getNameTypeFromMappedType(mappedType); - const shouldLinkPropDeclarations = getMappedTypeNameTypeKind(mappedType) !== 2 /* Remapping */; - const templateType = getTemplateTypeFromMappedType(mappedType); - const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); - const templateModifiers = getMappedTypeModifiers(type); - const include = 8576 /* StringOrNumberLiteralOrUnique */; - if (isMappedTypeWithKeyofConstraintDeclaration(type)) { - forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType( - modifiersType, - include, - /*stringsOnly*/ - false, - addMemberForKeyType - ); - } else { - forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); - } - setStructuredTypeMembers(type, members, emptyArray, emptyArray, indexInfos || emptyArray); - function addMemberForKeyType(keyType) { - const propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - forEachType(propNameType, (t) => addMemberForKeyTypeWorker(keyType, t)); - } - function addMemberForKeyTypeWorker(keyType, propNameType) { - if (isTypeUsableAsPropertyName(propNameType)) { - const propName = getPropertyNameFromType(propNameType); - const existingProp = members.get(propName); - if (existingProp) { - existingProp.links.nameType = getUnionType([existingProp.links.nameType, propNameType]); - existingProp.links.keyType = getUnionType([existingProp.links.keyType, keyType]); - } else { - const modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : void 0; - const isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); - 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)); - prop.links.mappedType = type; - prop.links.nameType = propNameType; - prop.links.keyType = keyType; - if (modifiersProp) { - prop.links.syntheticOrigin = modifiersProp; - prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0; - } - members.set(propName, prop); - } - } 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 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, - /*union*/ - true - ); - } - } - } - function getTypeOfMappedSymbol(symbol) { - var _a; - if (!symbol.links.type) { - const mappedType = symbol.links.mappedType; - if (!pushTypeResolution(symbol, 0 /* Type */)) { - mappedType.containsError = true; - return errorType; - } - const templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); - const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.links.keyType); - const propType = instantiateType(templateType, mapper); - let type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType( - propType, - /*isProperty*/ - true - ) : symbol.links.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType; - if (!popTypeResolution()) { - error2(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); - type = errorType; - } - (_a = symbol.links).type ?? (_a.type = type); - } - return symbol.links.type; - } - function getTypeParameterFromMappedType(type) { - return type.typeParameter || (type.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type.declaration.typeParameter))); - } - function getConstraintTypeFromMappedType(type) { - return type.constraintType || (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType); - } - function getNameTypeFromMappedType(type) { - return type.declaration.nameType ? type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) : void 0; - } - function getTemplateTypeFromMappedType(type) { - return type.templateType || (type.templateType = type.declaration.type ? instantiateType(addOptionality( - getTypeFromTypeNode(type.declaration.type), - /*isProperty*/ - true, - !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */) - ), type.mapper) : errorType); - } - function getConstraintDeclarationForMappedType(type) { - return getEffectiveConstraintOfTypeParameter(type.declaration.typeParameter); - } - function isMappedTypeWithKeyofConstraintDeclaration(type) { - const constraintDeclaration = getConstraintDeclarationForMappedType(type); - return constraintDeclaration.kind === 199 /* TypeOperator */ && constraintDeclaration.operator === 143 /* KeyOfKeyword */; - } - function getModifiersTypeFromMappedType(type) { - if (!type.modifiersType) { - if (isMappedTypeWithKeyofConstraintDeclaration(type)) { - type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper); - } else { - const declaredType = getTypeFromMappedTypeNode(type.declaration); - const constraint = getConstraintTypeFromMappedType(declaredType); - const extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper) : unknownType; - } - } - return type.modifiersType; - } - function getMappedTypeModifiers(type) { - const declaration = type.declaration; - return (declaration.readonlyToken ? declaration.readonlyToken.kind === 41 /* MinusToken */ ? 2 /* ExcludeReadonly */ : 1 /* IncludeReadonly */ : 0) | (declaration.questionToken ? declaration.questionToken.kind === 41 /* MinusToken */ ? 8 /* ExcludeOptional */ : 4 /* IncludeOptional */ : 0); - } - function getMappedTypeOptionality(type) { - const modifiers = getMappedTypeModifiers(type); - return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0; - } - function getCombinedMappedTypeOptionality(type) { - if (getObjectFlags(type) & 32 /* Mapped */) { - return getMappedTypeOptionality(type) || getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(type)); - } - if (type.flags & 2097152 /* Intersection */) { - const optionality = getCombinedMappedTypeOptionality(type.types[0]); - return every(type.types, (t, i) => i === 0 || getCombinedMappedTypeOptionality(t) === optionality) ? optionality : 0; - } - return 0; - } - function isPartialMappedType(type) { - return !!(getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */); - } - function isGenericMappedType(type) { - if (getObjectFlags(type) & 32 /* Mapped */) { - const constraint = getConstraintTypeFromMappedType(type); - if (isGenericIndexType(constraint)) { - return true; - } - const nameType = getNameTypeFromMappedType(type); - if (nameType && isGenericIndexType(instantiateType(nameType, makeUnaryTypeMapper(getTypeParameterFromMappedType(type), constraint)))) { - return true; - } - } - return false; - } - function getMappedTypeNameTypeKind(type) { - const nameType = getNameTypeFromMappedType(type); - if (!nameType) { - return 0 /* None */; - } - return isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type)) ? 1 /* Filtering */ : 2 /* Remapping */; - } - function resolveStructuredTypeMembers(type) { - if (!type.members) { - if (type.flags & 524288 /* Object */) { - if (type.objectFlags & 4 /* Reference */) { - resolveTypeReferenceMembers(type); - } else if (type.objectFlags & 3 /* ClassOrInterface */) { - resolveClassOrInterfaceMembers(type); - } else if (type.objectFlags & 1024 /* ReverseMapped */) { - resolveReverseMappedTypeMembers(type); - } else if (type.objectFlags & 16 /* Anonymous */) { - resolveAnonymousTypeMembers(type); - } else if (type.objectFlags & 32 /* Mapped */) { - resolveMappedTypeMembers(type); - } else { - Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags)); - } - } else if (type.flags & 1048576 /* Union */) { - resolveUnionTypeMembers(type); - } else if (type.flags & 2097152 /* Intersection */) { - resolveIntersectionTypeMembers(type); - } else { - Debug.fail("Unhandled type " + Debug.formatTypeFlags(type.flags)); - } - } - return type; - } - function getPropertiesOfObjectType(type) { - if (type.flags & 524288 /* Object */) { - return resolveStructuredTypeMembers(type).properties; - } - return emptyArray; - } - function getPropertyOfObjectType(type, name) { - if (type.flags & 524288 /* Object */) { - const resolved = resolveStructuredTypeMembers(type); - const symbol = resolved.members.get(name); - if (symbol && symbolIsValue(symbol)) { - return symbol; - } - } - } - function getPropertiesOfUnionOrIntersectionType(type) { - if (!type.resolvedProperties) { - const members = createSymbolTable(); - for (const current of type.types) { - for (const prop of getPropertiesOfType(current)) { - if (!members.has(prop.escapedName)) { - const combinedProp = getPropertyOfUnionOrIntersectionType( - type, - prop.escapedName, - /*skipObjectFunctionPropertyAugment*/ - !!(type.flags & 2097152 /* Intersection */) - ); - if (combinedProp) { - members.set(prop.escapedName, combinedProp); - } - } - } - if (type.flags & 1048576 /* Union */ && getIndexInfosOfType(current).length === 0) { - break; - } - } - type.resolvedProperties = getNamedMembers(members); - } - return type.resolvedProperties; - } - function getPropertiesOfType(type) { - type = getReducedApparentType(type); - return type.flags & 3145728 /* UnionOrIntersection */ ? getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); - } - function forEachPropertyOfType(type, action) { - type = getReducedApparentType(type); - if (type.flags & 3670016 /* StructuredType */) { - resolveStructuredTypeMembers(type).members.forEach((symbol, escapedName) => { - if (isNamedMember(symbol, escapedName)) { - action(symbol, escapedName); - } - }); - } - } - function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) { - const list = obj.properties; - return list.some((property) => { - const nameType = property.name && (isJsxNamespacedName(property.name) ? getStringLiteralType(getTextOfJsxAttributeName(property.name)) : getLiteralTypeFromPropertyName(property.name)); - const name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0; - const expected = name === void 0 ? void 0 : getTypeOfPropertyOfType(contextualType, name); - return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property), expected); - }); - } - function getAllPossiblePropertiesOfTypes(types) { - const unionType = getUnionType(types); - if (!(unionType.flags & 1048576 /* Union */)) { - return getAugmentedPropertiesOfType(unionType); - } - const props = createSymbolTable(); - for (const memberType of types) { - for (const { escapedName } of getAugmentedPropertiesOfType(memberType)) { - if (!props.has(escapedName)) { - const prop = createUnionOrIntersectionProperty(unionType, escapedName); - if (prop) props.set(escapedName, prop); - } - } - } - return arrayFrom(props.values()); - } - function getConstraintOfType(type) { - return type.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : type.flags & 8388608 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : type.flags & 16777216 /* Conditional */ ? getConstraintOfConditionalType(type) : getBaseConstraintOfType(type); - } - function getConstraintOfTypeParameter(typeParameter) { - return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : void 0; - } - function isConstMappedType(type, depth) { - const typeVariable = getHomomorphicTypeVariable(type); - return !!typeVariable && isConstTypeVariable(typeVariable, depth); - } - function isConstTypeVariable(type, depth = 0) { - var _a; - return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || 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; - } - function getSimplifiedTypeOrConstraint(type) { - const simplified = getSimplifiedType( - type, - /*writing*/ - false - ); - return simplified !== type ? simplified : getConstraintOfType(type); - } - function getConstraintFromIndexedAccess(type) { - if (isMappedTypeGenericIndexedAccess(type)) { - return substituteIndexedMappedType(type.objectType, type.indexType); - } - const indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); - if (indexConstraint && indexConstraint !== type.indexType) { - const indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.accessFlags); - if (indexedAccess) { - return indexedAccess; - } - } - const objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); - if (objectConstraint && objectConstraint !== type.objectType) { - return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.accessFlags); - } - return void 0; - } - function getDefaultConstraintOfConditionalType(type) { - if (!type.resolvedDefaultConstraint) { - const trueConstraint = getInferredTrueTypeFromConditionalType(type); - const falseConstraint = getFalseTypeFromConditionalType(type); - type.resolvedDefaultConstraint = isTypeAny(trueConstraint) ? falseConstraint : isTypeAny(falseConstraint) ? trueConstraint : getUnionType([trueConstraint, falseConstraint]); - } - return type.resolvedDefaultConstraint; - } - function getConstraintOfDistributiveConditionalType(type) { - if (type.resolvedConstraintOfDistributive !== void 0) { - return type.resolvedConstraintOfDistributive || void 0; - } - if (type.root.isDistributive && type.restrictiveInstantiation !== type) { - const simplified = getSimplifiedType( - type.checkType, - /*writing*/ - false - ); - const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; - if (constraint && constraint !== type.checkType) { - const instantiated = getConditionalTypeInstantiation( - type, - prependTypeMapping(type.root.checkType, constraint, type.mapper), - /*forConstraint*/ - true - ); - if (!(instantiated.flags & 131072 /* Never */)) { - type.resolvedConstraintOfDistributive = instantiated; - return instantiated; - } - } - } - type.resolvedConstraintOfDistributive = false; - return void 0; - } - function getConstraintFromConditionalType(type) { - return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); - } - function getConstraintOfConditionalType(type) { - return hasNonCircularBaseConstraint(type) ? getConstraintFromConditionalType(type) : void 0; - } - function getEffectiveConstraintOfIntersection(types, targetIsUnion) { - let constraints; - let hasDisjointDomainType = false; - for (const t of types) { - if (t.flags & 465829888 /* Instantiable */) { - let constraint = getConstraintOfType(t); - while (constraint && constraint.flags & (262144 /* TypeParameter */ | 4194304 /* Index */ | 16777216 /* Conditional */)) { - constraint = getConstraintOfType(constraint); - } - if (constraint) { - constraints = append(constraints, constraint); - if (targetIsUnion) { - constraints = append(constraints, t); - } - } - } else if (t.flags & 469892092 /* DisjointDomains */ || isEmptyAnonymousObjectType(t)) { - hasDisjointDomainType = true; - } - } - if (constraints && (targetIsUnion || hasDisjointDomainType)) { - if (hasDisjointDomainType) { - for (const t of types) { - if (t.flags & 469892092 /* DisjointDomains */ || isEmptyAnonymousObjectType(t)) { - constraints = append(constraints, t); - } - } - } - return getNormalizedType( - getIntersectionType(constraints, 2 /* NoConstraintReduction */), - /*writing*/ - false - ); - } - return void 0; - } - function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || isGenericTupleType(type)) { - const constraint = getResolvedBaseConstraint(type); - return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : void 0; - } - return type.flags & 4194304 /* Index */ ? stringNumberSymbolType : void 0; - } - function getBaseConstraintOrType(type) { - return getBaseConstraintOfType(type) || type; - } - function hasNonCircularBaseConstraint(type) { - return getResolvedBaseConstraint(type) !== circularConstraintType; - } - function getResolvedBaseConstraint(type) { - if (type.resolvedBaseConstraint) { - return type.resolvedBaseConstraint; - } - const stack = []; - return type.resolvedBaseConstraint = getImmediateBaseConstraint(type); - function getImmediateBaseConstraint(t) { - if (!t.immediateBaseConstraint) { - if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) { - return circularConstraintType; - } - let result; - const identity2 = getRecursionIdentity(t); - if (stack.length < 10 || stack.length < 50 && !contains(stack, identity2)) { - stack.push(identity2); - result = computeBaseConstraint(getSimplifiedType( - t, - /*writing*/ - false - )); - stack.pop(); - } - if (!popTypeResolution()) { - if (t.flags & 262144 /* TypeParameter */) { - const errorNode = getConstraintDeclaration(t); - if (errorNode) { - 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)); - } - } - } - result = circularConstraintType; - } - t.immediateBaseConstraint ?? (t.immediateBaseConstraint = result || noConstraintType); - } - return t.immediateBaseConstraint; - } - function getBaseConstraint(t) { - const c = getImmediateBaseConstraint(t); - return c !== noConstraintType && c !== circularConstraintType ? c : void 0; - } - function computeBaseConstraint(t) { - if (t.flags & 262144 /* TypeParameter */) { - const constraint = getConstraintFromTypeParameter(t); - return t.isThisType || !constraint ? constraint : getBaseConstraint(constraint); - } - if (t.flags & 3145728 /* UnionOrIntersection */) { - const types = t.types; - const baseTypes = []; - let different = false; - for (const type2 of types) { - const baseType = getBaseConstraint(type2); - if (baseType) { - if (baseType !== type2) { - different = true; - } - baseTypes.push(baseType); - } else { - different = true; - } - } - if (!different) { - return t; - } - return t.flags & 1048576 /* Union */ && baseTypes.length === types.length ? getUnionType(baseTypes) : t.flags & 2097152 /* Intersection */ && baseTypes.length ? getIntersectionType(baseTypes) : void 0; - } - if (t.flags & 4194304 /* Index */) { - return stringNumberSymbolType; - } - if (t.flags & 134217728 /* TemplateLiteral */) { - const types = t.types; - const constraints = mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType; - } - if (t.flags & 268435456 /* StringMapping */) { - const constraint = getBaseConstraint(t.type); - return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType; - } - if (t.flags & 8388608 /* IndexedAccess */) { - if (isMappedTypeGenericIndexedAccess(t)) { - return getBaseConstraint(substituteIndexedMappedType(t.objectType, t.indexType)); - } - const baseObjectType = getBaseConstraint(t.objectType); - const baseIndexType = getBaseConstraint(t.indexType); - const baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.accessFlags); - return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); - } - if (t.flags & 16777216 /* Conditional */) { - const constraint = getConstraintFromConditionalType(t); - return constraint && getBaseConstraint(constraint); - } - if (t.flags & 33554432 /* Substitution */) { - return getBaseConstraint(getSubstitutionIntersection(t)); - } - if (isGenericTupleType(t)) { - const newElements = map(getElementTypes(t), (v, i) => { - const constraint = v.flags & 262144 /* TypeParameter */ && t.target.elementFlags[i] & 8 /* Variadic */ && getBaseConstraint(v) || v; - return constraint !== v && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v; - }); - return createTupleType(newElements, t.target.elementFlags, t.target.readonly, t.target.labeledElementDeclarations); - } - return t; - } - } - function getApparentTypeOfIntersectionType(type, thisArgument) { - if (type === thisArgument) { - return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument( - type, - thisArgument, - /*needApparentType*/ - true - )); - } - const key = `I${getTypeId(type)},${getTypeId(thisArgument)}`; - return getCachedType(key) ?? setCachedType(key, getTypeWithThisArgument( - type, - thisArgument, - /*needApparentType*/ - true - )); - } - function getResolvedTypeParameterDefault(typeParameter) { - if (!typeParameter.default) { - if (typeParameter.target) { - const targetDefault = getResolvedTypeParameterDefault(typeParameter.target); - typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; - } else { - typeParameter.default = resolvingDefaultType; - const defaultDeclaration = typeParameter.symbol && forEach(typeParameter.symbol.declarations, (decl) => isTypeParameterDeclaration(decl) && decl.default); - const defaultType = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; - if (typeParameter.default === resolvingDefaultType) { - typeParameter.default = defaultType; - } - } - } else if (typeParameter.default === resolvingDefaultType) { - typeParameter.default = circularConstraintType; - } - return typeParameter.default; - } - function getDefaultFromTypeParameter(typeParameter) { - const defaultType = getResolvedTypeParameterDefault(typeParameter); - return defaultType !== noConstraintType && defaultType !== circularConstraintType ? defaultType : void 0; - } - function hasNonCircularTypeParameterDefault(typeParameter) { - return getResolvedTypeParameterDefault(typeParameter) !== circularConstraintType; - } - function hasTypeParameterDefault(typeParameter) { - return !!(typeParameter.symbol && forEach(typeParameter.symbol.declarations, (decl) => isTypeParameterDeclaration(decl) && decl.default)); - } - function getApparentTypeOfMappedType(type) { - return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type)); - } - function getResolvedApparentTypeOfMappedType(type) { - const target = type.target ?? type; - const typeVariable = getHomomorphicTypeVariable(target); - if (typeVariable && !target.declaration.nameType) { - const modifiersType = getModifiersTypeFromMappedType(type); - const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType); - if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) { - return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper)); - } - } - return type; - } - function isArrayOrTupleOrIntersection(type) { - return !!(type.flags & 2097152 /* Intersection */) && every(type.types, isArrayOrTupleType); - } - function isMappedTypeGenericIndexedAccess(type) { - let objectType; - return !!(type.flags & 8388608 /* IndexedAccess */ && getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ && !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) && !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType); - } - function getApparentType(type) { - const t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; - const objectFlags = getObjectFlags(t); - return objectFlags & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : objectFlags & 4 /* Reference */ && t !== type ? getTypeWithThisArgument(t, type) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t, type) : t.flags & 402653316 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType() : t.flags & 528 /* BooleanLike */ ? globalBooleanType : t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType() : t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* Index */ ? stringNumberSymbolType : t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType : t; - } - function getReducedApparentType(type) { - return getReducedType(getApparentType(getReducedType(type))); - } - function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) { - var _a, _b, _c; - let propFlags = 0 /* None */; - let singleProp; - let propSet; - let indexTypes; - const isUnion = containingType.flags & 1048576 /* Union */; - let optionalFlag; - let syntheticFlag = 4 /* SyntheticMethod */; - let checkFlags = isUnion ? 0 : 8 /* Readonly */; - let mergedInstantiations = false; - for (const current of containingType.types) { - const type = getApparentType(current); - if (!(isErrorType(type) || type.flags & 131072 /* Never */)) { - const prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment); - const modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; - if (prop) { - if (prop.flags & 106500 /* ClassMember */) { - optionalFlag ?? (optionalFlag = isUnion ? 0 /* None */ : 16777216 /* Optional */); - if (isUnion) { - optionalFlag |= prop.flags & 16777216 /* Optional */; - } else { - optionalFlag &= prop.flags; - } - } - if (!singleProp) { - singleProp = prop; - propFlags = prop.flags & 98304 /* Accessor */ || 4 /* Property */; - } else if (prop !== singleProp) { - const isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp); - if (isInstantiation && compareProperties2(singleProp, prop, (a, b) => a === b ? -1 /* True */ : 0 /* False */) === -1 /* True */) { - mergedInstantiations = !!singleProp.parent && !!length(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(singleProp.parent)); - } else { - if (!propSet) { - propSet = /* @__PURE__ */ new Map(); - propSet.set(getSymbolId(singleProp), singleProp); - } - const id = getSymbolId(prop); - if (!propSet.has(id)) { - propSet.set(id, prop); - } - } - if (propFlags & 98304 /* Accessor */ && (prop.flags & 98304 /* Accessor */) !== (propFlags & 98304 /* Accessor */)) { - propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */; - } - } - if (isUnion && isReadonlySymbol(prop)) { - checkFlags |= 8 /* Readonly */; - } else if (!isUnion && !isReadonlySymbol(prop)) { - checkFlags &= ~8 /* Readonly */; - } - 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 */; - } - } else if (isUnion) { - const indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name); - if (indexInfo) { - propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */; - checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0); - indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type); - } else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 2097152 /* ContainsSpread */)) { - checkFlags |= 32 /* WritePartial */; - indexTypes = append(indexTypes, undefinedType); - } else { - checkFlags |= 16 /* ReadPartial */; - } - } - } - } - if (!singleProp || isUnion && (propSet || checkFlags & 48 /* Partial */) && checkFlags & (1024 /* ContainsPrivate */ | 512 /* ContainsProtected */) && !(propSet && getCommonDeclarationsOfSymbols(propSet.values()))) { - return void 0; - } - if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) { - if (mergedInstantiations) { - const links = (_a = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a.links; - const clone2 = createSymbolWithType(singleProp, links == null ? void 0 : links.type); - 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; - } - } - const props = propSet ? arrayFrom(propSet.values()) : [singleProp]; - let declarations; - let firstType; - let nameType; - const propTypes = []; - let writeTypes; - let firstValueDeclaration; - let hasNonUniformValueDeclaration = false; - for (const prop of props) { - if (!firstValueDeclaration) { - firstValueDeclaration = prop.valueDeclaration; - } else if (prop.valueDeclaration && prop.valueDeclaration !== firstValueDeclaration) { - hasNonUniformValueDeclaration = true; - } - declarations = addRange(declarations, prop.declarations); - const type = getTypeOfSymbol(prop); - if (!firstType) { - firstType = type; - nameType = getSymbolLinks(prop).nameType; - } - const writeType = getWriteTypeOfSymbol(prop); - if (writeTypes || writeType !== type) { - writeTypes = append(!writeTypes ? propTypes.slice() : writeTypes, writeType); - } - if (type !== firstType) { - checkFlags |= 64 /* HasNonUniformType */; - } - if (isLiteralType(type) || isPatternLiteralType(type)) { - checkFlags |= 128 /* HasLiteralType */; - } - if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) { - checkFlags |= 131072 /* HasNeverType */; - } - propTypes.push(type); - } - addRange(propTypes, indexTypes); - const result = createSymbol(propFlags | (optionalFlag ?? 0), name, syntheticFlag | checkFlags); - result.links.containingType = containingType; - if (!hasNonUniformValueDeclaration && firstValueDeclaration) { - result.valueDeclaration = firstValueDeclaration; - if (firstValueDeclaration.symbol.parent) { - result.parent = firstValueDeclaration.symbol.parent; - } - } - result.declarations = declarations; - result.links.nameType = nameType; - if (propTypes.length > 2) { - result.links.checkFlags |= 65536 /* DeferredType */; - result.links.deferralParent = containingType; - result.links.deferralConstituents = propTypes; - result.links.deferralWriteConstituents = writeTypes; - } else { - result.links.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); - if (writeTypes) { - result.links.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes); - } - } - return result; - } - function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) { - var _a, _b, _c; - let property = skipObjectFunctionPropertyAugment ? (_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name); - if (!property) { - property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment); - if (property) { - const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable()); - properties.set(name, property); - if (skipObjectFunctionPropertyAugment && !(getCheckFlags(property) & 48 /* Partial */) && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) { - const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable()); - properties2.set(name, property); - } - } - } - return property; - } - function getCommonDeclarationsOfSymbols(symbols) { - let commonDeclarations; - for (const symbol of symbols) { - if (!symbol.declarations) { - return void 0; - } - if (!commonDeclarations) { - commonDeclarations = new Set(symbol.declarations); - continue; - } - commonDeclarations.forEach((declaration) => { - if (!contains(symbol.declarations, declaration)) { - commonDeclarations.delete(declaration); - } - }); - if (commonDeclarations.size === 0) { - return void 0; - } - } - return commonDeclarations; - } - function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) { - const property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment); - return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0; - } - function getReducedType(type) { - if (type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */) { - return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type)); - } else if (type.flags & 2097152 /* Intersection */) { - if (!(type.objectFlags & 16777216 /* IsNeverIntersectionComputed */)) { - type.objectFlags |= 16777216 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 33554432 /* IsNeverIntersection */ : 0); - } - return type.objectFlags & 33554432 /* IsNeverIntersection */ ? neverType : type; - } - return type; - } - function getReducedUnionType(unionType) { - const reducedTypes = sameMap(unionType.types, getReducedType); - if (reducedTypes === unionType.types) { - return unionType; - } - const reduced = getUnionType(reducedTypes); - if (reduced.flags & 1048576 /* Union */) { - reduced.resolvedReducedType = reduced; - } - return reduced; - } - function isNeverReducedProperty(prop) { - return isDiscriminantWithNeverType(prop) || isConflictingPrivateProperty(prop); - } - function isDiscriminantWithNeverType(prop) { - return !(prop.flags & 16777216 /* Optional */) && (getCheckFlags(prop) & (192 /* Discriminant */ | 131072 /* HasNeverType */)) === 192 /* Discriminant */ && !!(getTypeOfSymbol(prop).flags & 131072 /* Never */); - } - function isConflictingPrivateProperty(prop) { - return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */); - } - function isGenericReducibleType(type) { - return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type)); - } - function isReducibleIntersection(type) { - const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper)); - return getReducedType(uniqueFilled) !== uniqueFilled; - } - function elaborateNeverIntersection(errorInfo, type) { - 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)); - } - 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 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; - } - if (skipObjectFunctionPropertyAugment) return void 0; - const functionType = resolved === anyFunctionType ? globalFunctionType : resolved.callSignatures.length ? globalCallableFunctionType : resolved.constructSignatures.length ? globalNewableFunctionType : void 0; - if (functionType) { - const symbol2 = getPropertyOfObjectType(functionType, name); - if (symbol2) { - return symbol2; - } - } - return getPropertyOfObjectType(globalObjectType, name); - } - 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; - } - function getSignaturesOfStructuredType(type, kind) { - if (type.flags & 3670016 /* StructuredType */) { - const resolved = resolveStructuredTypeMembers(type); - return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; - } - return emptyArray; - } - function getSignaturesOfType(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); - } - function findApplicableIndexInfo(indexInfos, keyType) { - let stringIndexInfo; - let applicableInfo; - let applicableInfos; - for (const info of indexInfos) { - if (info.keyType === stringType) { - stringIndexInfo = info; - } else if (isApplicableIndexType(keyType, info.keyType)) { - if (!applicableInfo) { - applicableInfo = info; - } else { - (applicableInfos || (applicableInfos = [applicableInfo])).push(info); - } - } - } - 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)); - } - function getIndexInfosOfStructuredType(type) { - if (type.flags & 3670016 /* StructuredType */) { - const resolved = resolveStructuredTypeMembers(type); - return resolved.indexInfos; - } - return emptyArray; - } - function getIndexInfosOfType(type) { - return getIndexInfosOfStructuredType(getReducedApparentType(type)); - } - function getIndexInfoOfType(type, keyType) { - return findIndexInfo(getIndexInfosOfType(type), keyType); - } - function getIndexTypeOfType(type, keyType) { - var _a; - return (_a = getIndexInfoOfType(type, keyType)) == null ? void 0 : _a.type; - } - function getApplicableIndexInfos(type, keyType) { - return getIndexInfosOfType(type).filter((info) => isApplicableIndexType(keyType, info.keyType)); - } - function getApplicableIndexInfo(type, keyType) { - return findApplicableIndexInfo(getIndexInfosOfType(type), keyType); - } - function getApplicableIndexInfoForName(type, name) { - return getApplicableIndexInfo(type, isLateBoundName(name) ? esSymbolType : getStringLiteralType(unescapeLeadingUnderscores(name))); - } - function getTypeParametersFromDeclaration(declaration) { - var _a; - let result; - for (const node of getEffectiveTypeParameterDeclarations(declaration)) { - result = appendIfUnique(result, getDeclaredTypeOfTypeParameter(node.symbol)); - } - return (result == null ? void 0 : result.length) ? result : isFunctionDeclaration(declaration) ? (_a = getSignatureOfTypeTag(declaration)) == null ? void 0 : _a.typeParameters : void 0; - } - function symbolsToArray(symbols) { - const result = []; - symbols.forEach((symbol, id) => { - if (!isReservedMemberName(id)) { - result.push(symbol); - } - }); - return result; - } - function tryFindAmbientModule(moduleName, withAugmentations) { - if (isExternalModuleNameRelative(moduleName)) { - return void 0; - } - const symbol = getSymbol2(globals, '"' + moduleName + '"', 512 /* ValueModule */); - return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol; - } - function hasEffectiveQuestionToken(node) { - return hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isParameter(node) && isJSDocOptionalParameter(node); - } - function isOptionalParameter(node) { - if (hasEffectiveQuestionToken(node)) { - return true; - } - if (!isParameter(node)) { - return false; - } - if (node.initializer) { - const signature = getSignatureFromDeclaration(node.parent); - const parameterIndex = node.parent.parameters.indexOf(node); - Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature, 1 /* StrongArityForUntypedJS */ | 2 /* VoidIsNonOptional */); - } - const iife = getImmediatelyInvokedFunctionExpression(node.parent); - if (iife) { - return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= getEffectiveCallArguments(iife).length; - } - return false; - } - function isOptionalPropertyDeclaration(node) { - return isPropertyDeclaration(node) && !hasAccessorModifier(node) && node.questionToken; - } - function createTypePredicate(kind, parameterName, parameterIndex, type) { - return { kind, parameterName, parameterIndex, type }; - } - function getMinTypeArgumentCount(typeParameters) { - let minTypeArgumentCount = 0; - if (typeParameters) { - for (let i = 0; i < typeParameters.length; i++) { - if (!hasTypeParameterDefault(typeParameters[i])) { - minTypeArgumentCount = i + 1; - } - } - } - return minTypeArgumentCount; - } - function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, isJavaScriptImplicitAny) { - const numTypeParameters = length(typeParameters); - if (!numTypeParameters) { - return []; - } - const numTypeArguments = length(typeArguments); - if (isJavaScriptImplicitAny || numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters) { - const result = typeArguments ? typeArguments.slice() : []; - for (let i = numTypeArguments; i < numTypeParameters; i++) { - result[i] = errorType; - } - const baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny); - for (let i = numTypeArguments; i < numTypeParameters; i++) { - let defaultType = getDefaultFromTypeParameter(typeParameters[i]); - if (isJavaScriptImplicitAny && defaultType && (isTypeIdenticalTo(defaultType, unknownType) || isTypeIdenticalTo(defaultType, emptyObjectType))) { - defaultType = anyType; - } - result[i] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters, result)) : baseDefaultType; - } - result.length = typeParameters.length; - return result; - } - return typeArguments && typeArguments.slice(); - } - function getSignatureFromDeclaration(declaration) { - const links = getNodeLinks(declaration); - if (!links.resolvedSignature) { - const parameters = []; - 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); - const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !some(declaration.parameters, (p) => !!getJSDocType(p)) && !getJSDocType(declaration) && !getContextualSignatureForFunctionLikeDeclaration(declaration); - if (isUntypedSignatureInJSFile) { - flags |= 32 /* IsUntypedSignatureInJSFile */; - } - 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)) { - const resolvedSymbol = resolveName( - param, - paramSymbol.escapedName, - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - paramSymbol = resolvedSymbol; - } - if (i === 0 && paramSymbol.escapedName === "this" /* This */) { - hasThisParameter2 = true; - thisParameter = param.symbol; - } else { - parameters.push(paramSymbol); - } - if (type && type.kind === 202 /* LiteralType */) { - flags |= 2 /* HasLiteralTypes */; - } - const isOptionalParameter2 = hasEffectiveQuestionToken(param) || isParameter(param) && param.initializer || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type; - if (!isOptionalParameter2) { - minArgumentCount = parameters.length; - } - } - if ((declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { - const otherKind = declaration.kind === 178 /* GetAccessor */ ? 179 /* SetAccessor */ : 178 /* GetAccessor */; - const other = getDeclarationOfKind(getSymbolOfDeclaration(declaration), otherKind); - if (other) { - thisParameter = getAnnotatedAccessorThisParameter(other); - } - } - 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; - const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); - if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { - flags |= 1 /* HasRestParameter */; - } - if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration, 64 /* Abstract */) || isConstructorDeclaration(declaration) && hasSyntacticModifier(declaration.parent, 64 /* Abstract */)) { - flags |= 4 /* Abstract */; - } - links.resolvedSignature = createSignature( - declaration, - typeParameters, - thisParameter, - parameters, - /*resolvedReturnType*/ - void 0, - /*resolvedTypePredicate*/ - void 0, - minArgumentCount, - flags - ); - } - return links.resolvedSignature; - } - function maybeAddJsSyntheticRestParameter(declaration, parameters) { - if (isJSDocSignature(declaration) || !containsArgumentsReference(declaration)) { - return false; - } - const lastParam = lastOrUndefined(declaration.parameters); - const lastParamTags = lastParam ? getJSDocParameterTags(lastParam) : getJSDocTags(declaration).filter(isJSDocParameterTag); - const lastParamVariadicType = firstDefined(lastParamTags, (p) => p.typeExpression && isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : void 0); - const syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */); - if (lastParamVariadicType) { - syntheticArgsSymbol.links.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)); - } else { - syntheticArgsSymbol.links.checkFlags |= 65536 /* DeferredType */; - syntheticArgsSymbol.links.deferralParent = neverType; - syntheticArgsSymbol.links.deferralConstituents = [anyArrayType]; - syntheticArgsSymbol.links.deferralWriteConstituents = [anyArrayType]; - } - if (lastParamVariadicType) { - parameters.pop(); - } - parameters.push(syntheticArgsSymbol); - return true; - } - function getSignatureOfTypeTag(node) { - if (!(isInJSFile(node) && isFunctionLikeDeclaration(node))) return void 0; - const typeTag = getJSDocTypeTag(node); - return (typeTag == null ? void 0 : typeTag.typeExpression) && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression)); - } - function getParameterTypeOfTypeTag(func, parameter) { - const signature = getSignatureOfTypeTag(func); - if (!signature) return void 0; - const pos = func.parameters.indexOf(parameter); - return parameter.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos); - } - function getReturnTypeOfTypeTag(node) { - const signature = getSignatureOfTypeTag(node); - return signature && getReturnTypeOfSignature(signature); - } - function containsArgumentsReference(declaration) { - const links = getNodeLinks(declaration); - if (links.containsArgumentsReference === void 0) { - if (links.flags & 512 /* CaptureArguments */) { - links.containsArgumentsReference = true; - } else { - links.containsArgumentsReference = traverse(declaration.body); - } - } - return links.containsArgumentsReference; - function traverse(node) { - if (!node) return false; - switch (node.kind) { - case 80 /* Identifier */: - return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol; - case 173 /* PropertyDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return node.name.kind === 168 /* ComputedPropertyName */ && traverse(node.name); - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return traverse(node.expression); - case 304 /* PropertyAssignment */: - return traverse(node.initializer); - default: - return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse); - } - } - } - function getSignaturesOfSymbol(symbol) { - if (!symbol || !symbol.declarations) return emptyArray; - const result = []; - for (let i = 0; i < symbol.declarations.length; i++) { - const decl = symbol.declarations[i]; - if (!isFunctionLike(decl)) continue; - if (i > 0 && decl.body) { - const previous = symbol.declarations[i - 1]; - if (decl.parent === previous.parent && decl.kind === previous.kind && decl.pos === previous.end) { - continue; - } - } - if (isInJSFile(decl) && decl.jsDoc) { - 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)); - } - continue; - } - } - result.push( - !isFunctionExpressionOrArrowFunction(decl) && !isObjectLiteralMethod(decl) && getSignatureOfTypeTag(decl) || getSignatureFromDeclaration(decl) - ); - } - return result; - } - function resolveExternalModuleTypeByLiteral(name) { - const moduleSym = resolveExternalModuleName(name, name); - if (moduleSym) { - const resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); - if (resolvedModuleSymbol) { - return getTypeOfSymbol(resolvedModuleSymbol); - } - } - return anyType; - } - function getThisTypeOfSignature(signature) { - if (signature.thisParameter) { - return getTypeOfSymbol(signature.thisParameter); - } - } - function getTypePredicateOfSignature(signature) { - if (!signature.resolvedTypePredicate) { - if (signature.target) { - const targetTypePredicate = getTypePredicateOfSignature(signature.target); - signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; - } else if (signature.compositeSignatures) { - signature.resolvedTypePredicate = getUnionOrIntersectionTypePredicate(signature.compositeSignatures, signature.compositeKind) || noTypePredicate; - } else { - const type = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); - let jsdocPredicate; - if (!type) { - const jsdocSignature = getSignatureOfTypeTag(signature.declaration); - if (jsdocSignature && signature !== jsdocSignature) { - jsdocPredicate = getTypePredicateOfSignature(jsdocSignature); - } - } - if (type || jsdocPredicate) { - signature.resolvedTypePredicate = type && isTypePredicateNode(type) ? createTypePredicateFromTypePredicateNode(type, signature) : jsdocPredicate || noTypePredicate; - } else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType.flags & 16 /* Boolean */) && getParameterCount(signature) > 0) { - const { declaration } = signature; - signature.resolvedTypePredicate = noTypePredicate; - signature.resolvedTypePredicate = getTypePredicateFromBody(declaration) || noTypePredicate; - } else { - signature.resolvedTypePredicate = noTypePredicate; - } - } - Debug.assert(!!signature.resolvedTypePredicate); - } - return signature.resolvedTypePredicate === noTypePredicate ? void 0 : signature.resolvedTypePredicate; - } - function createTypePredicateFromTypePredicateNode(node, signature) { - const parameterName = node.parameterName; - const type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 198 /* 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); - } - function getUnionOrIntersectionType(types, kind, unionReduction) { - return kind !== 2097152 /* Intersection */ ? getUnionType(types, unionReduction) : getIntersectionType(types); - } - function getReturnTypeOfSignature(signature) { - if (!signature.resolvedReturnType) { - if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) { - return errorType; - } - let type = signature.target ? instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper) : signature.compositeSignatures ? instantiateType(getUnionOrIntersectionType(map(signature.compositeSignatures, getReturnTypeOfSignature), signature.compositeKind, 2 /* Subtype */), signature.mapper) : getReturnTypeFromAnnotation(signature.declaration) || (nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration)); - if (signature.flags & 8 /* IsInnerCallChain */) { - type = addOptionalTypeMarker(type); - } else if (signature.flags & 16 /* IsOuterCallChain */) { - type = getOptionalType(type); - } - if (!popTypeResolution()) { - if (signature.declaration) { - const typeNode = getEffectiveReturnTypeNode(signature.declaration); - if (typeNode) { - error2(typeNode, Diagnostics.Return_type_annotation_circularly_references_itself); - } else if (noImplicitAny) { - const declaration = signature.declaration; - const name = getNameOfDeclaration(declaration); - if (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 { - 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); - } - } - } - type = anyType; - } - signature.resolvedReturnType ?? (signature.resolvedReturnType = type); - } - return signature.resolvedReturnType; - } - function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 177 /* Constructor */) { - return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); - } - const typeNode = getEffectiveReturnTypeNode(declaration); - if (isJSDocSignature(declaration)) { - const root = getJSDocRoot(declaration); - if (root && isConstructorDeclaration(root.parent) && !typeNode) { - return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root.parent.parent.symbol)); - } - } - if (isJSDocConstructSignature(declaration)) { - return getTypeFromTypeNode(declaration.parameters[0].type); - } - if (typeNode) { - return getTypeFromTypeNode(typeNode); - } - if (declaration.kind === 178 /* GetAccessor */ && hasBindableName(declaration)) { - const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); - if (jsDocType) { - return jsDocType; - } - const setter = getDeclarationOfKind(getSymbolOfDeclaration(declaration), 179 /* SetAccessor */); - const setterType = getAnnotatedAccessorType(setter); - if (setterType) { - return setterType; - } - } - return getReturnTypeOfTypeTag(declaration); - } - function isResolvingReturnTypeOfSignature(signature) { - return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0; - } - function getRestTypeOfSignature(signature) { - return tryGetRestTypeOfSignature(signature) || anyType; - } - function tryGetRestTypeOfSignature(signature) { - if (signatureHasRestParameter(signature)) { - const sigRestType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - const restType = isTupleType(sigRestType) ? getRestTypeOfTupleType(sigRestType) : sigRestType; - return restType && getIndexTypeOfType(restType, numberType); - } - return void 0; - } - function getSignatureInstantiation(signature, typeArguments, isJavascript, inferredTypeParameters) { - const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters), isJavascript)); - if (inferredTypeParameters) { - const returnSignature = getSingleCallOrConstructSignature(getReturnTypeOfSignature(instantiatedSignature)); - if (returnSignature) { - const newReturnSignature = cloneSignature(returnSignature); - newReturnSignature.typeParameters = inferredTypeParameters; - const newReturnType = getOrCreateTypeFromSignature(newReturnSignature); - newReturnType.mapper = instantiatedSignature.mapper; - const newInstantiatedSignature = cloneSignature(instantiatedSignature); - newInstantiatedSignature.resolvedReturnType = newReturnType; - return newInstantiatedSignature; - } - } - return instantiatedSignature; - } - function getSignatureInstantiationWithoutFillingInTypeArguments(signature, typeArguments) { - const instantiations = signature.instantiations || (signature.instantiations = /* @__PURE__ */ new Map()); - const id = getTypeListId(typeArguments); - let instantiation = instantiations.get(id); - if (!instantiation) { - instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); - } - return instantiation; - } - function createSignatureInstantiation(signature, typeArguments) { - return instantiateSignature( - signature, - createSignatureTypeMapper(signature, typeArguments), - /*eraseTypeParameters*/ - true - ); - } - function getTypeParametersForMapper(signature) { - return sameMap(signature.typeParameters, (tp) => tp.mapper ? instantiateType(tp, tp.mapper) : tp); - } - function createSignatureTypeMapper(signature, typeArguments) { - return createTypeMapper(getTypeParametersForMapper(signature), typeArguments); - } - function getErasedSignature(signature) { - return signature.typeParameters ? signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) : signature; - } - function createErasedSignature(signature) { - return instantiateSignature( - signature, - createTypeEraser(signature.typeParameters), - /*eraseTypeParameters*/ - true - ); - } - function getCanonicalSignature(signature) { - return signature.typeParameters ? signature.canonicalSignatureCache || (signature.canonicalSignatureCache = createCanonicalSignature(signature)) : signature; - } - function createCanonicalSignature(signature) { - return getSignatureInstantiation( - signature, - map(signature.typeParameters, (tp) => tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp), - isInJSFile(signature.declaration) - ); - } - function getBaseSignature(signature) { - const typeParameters = signature.typeParameters; - if (typeParameters) { - if (signature.baseSignatureCache) { - return signature.baseSignatureCache; - } - const typeEraser = createTypeEraser(typeParameters); - const baseConstraintMapper = createTypeMapper(typeParameters, map(typeParameters, (tp) => getConstraintOfTypeParameter(tp) || unknownType)); - let baseConstraints = map(typeParameters, (tp) => instantiateType(tp, baseConstraintMapper) || unknownType); - for (let i = 0; i < typeParameters.length - 1; i++) { - baseConstraints = instantiateTypes(baseConstraints, baseConstraintMapper); - } - baseConstraints = instantiateTypes(baseConstraints, typeEraser); - return signature.baseSignatureCache = instantiateSignature( - signature, - createTypeMapper(typeParameters, baseConstraints), - /*eraseTypeParameters*/ - true - ); - } - return signature; - } - function getOrCreateTypeFromSignature(signature) { - var _a, _b; - if (!signature.isolatedSignatureType) { - const kind = (_a = signature.declaration) == null ? void 0 : _a.kind; - const isConstructor = kind === void 0 || kind === 177 /* Constructor */ || kind === 181 /* ConstructSignature */ || kind === 186 /* ConstructorType */; - const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, (_b = signature.declaration) == null ? void 0 : _b.symbol); - type.members = emptySymbols; - type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; - type.indexInfos = emptyArray; - signature.isolatedSignatureType = type; - } - return signature.isolatedSignatureType; - } - function getIndexSymbol(symbol) { - return symbol.members ? getIndexSymbolFromSymbolTable(getMembersOfSymbol(symbol)) : void 0; - } - function getIndexSymbolFromSymbolTable(symbolTable) { - return symbolTable.get("__index" /* Index */); - } - function createIndexInfo(keyType, type, isReadonly, declaration, components) { - return { keyType, type, isReadonly, declaration, components }; - } - function getIndexInfosOfSymbol(symbol) { - const indexSymbol = getIndexSymbol(symbol); - return indexSymbol ? getIndexInfosOfIndexSymbol(indexSymbol, arrayFrom(getMembersOfSymbol(symbol).values())) : emptyArray; - } - function getIndexInfosOfIndexSymbol(indexSymbol, siblingSymbols = indexSymbol.parent ? arrayFrom(getMembersOfSymbol(indexSymbol.parent).values()) : void 0) { - if (indexSymbol.declarations) { - const indexInfos = []; - let hasComputedNumberProperty = false; - let readonlyComputedNumberProperty = true; - let hasComputedSymbolProperty = false; - let readonlyComputedSymbolProperty = true; - let hasComputedStringProperty = false; - let readonlyComputedStringProperty = true; - const computedPropertySymbols = []; - for (const declaration of indexSymbol.declarations) { - if (isIndexSignatureDeclaration(declaration)) { - if (declaration.parameters.length === 1) { - const parameter = declaration.parameters[0]; - 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, 8 /* Readonly */), declaration)); - } - }); - } - } - } else if (hasLateBindableIndexSignature(declaration)) { - const declName = isBinaryExpression(declaration) ? declaration.left : declaration.name; - const keyType = isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName); - if (findIndexInfo(indexInfos, keyType)) { - continue; - } - if (isTypeAssignableTo(keyType, stringNumberSymbolType)) { - if (isTypeAssignableTo(keyType, numberType)) { - hasComputedNumberProperty = true; - if (!hasEffectiveReadonlyModifier(declaration)) { - readonlyComputedNumberProperty = false; - } - } else if (isTypeAssignableTo(keyType, esSymbolType)) { - hasComputedSymbolProperty = true; - if (!hasEffectiveReadonlyModifier(declaration)) { - readonlyComputedSymbolProperty = false; - } - } else { - hasComputedStringProperty = true; - if (!hasEffectiveReadonlyModifier(declaration)) { - readonlyComputedStringProperty = false; - } - } - computedPropertySymbols.push(declaration.symbol); - } - } - } - const allPropertySymbols = concatenate(computedPropertySymbols, filter(siblingSymbols, (s) => s !== indexSymbol)); - if (hasComputedStringProperty && !findIndexInfo(indexInfos, stringType)) indexInfos.push(getObjectLiteralIndexInfo(readonlyComputedStringProperty, 0, allPropertySymbols, stringType)); - if (hasComputedNumberProperty && !findIndexInfo(indexInfos, numberType)) indexInfos.push(getObjectLiteralIndexInfo(readonlyComputedNumberProperty, 0, allPropertySymbols, numberType)); - if (hasComputedSymbolProperty && !findIndexInfo(indexInfos, esSymbolType)) indexInfos.push(getObjectLiteralIndexInfo(readonlyComputedSymbolProperty, 0, allPropertySymbols, esSymbolType)); - return indexInfos; - } - return emptyArray; - } - function isValidIndexKeyType(type) { - return !!(type.flags & (4 /* String */ | 8 /* Number */ | 4096 /* ESSymbol */)) || isPatternLiteralType(type) || !!(type.flags & 2097152 /* Intersection */) && !isGenericType(type) && some(type.types, isValidIndexKeyType); - } - function getConstraintDeclaration(type) { - return mapDefined(filter(type.symbol && type.symbol.declarations, isTypeParameterDeclaration), getEffectiveConstraintOfTypeParameter)[0]; - } - function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) { - var _a; - let inferences; - if ((_a = typeParameter.symbol) == null ? void 0 : _a.declarations) { - for (const declaration of typeParameter.symbol.declarations) { - if (declaration.parent.kind === 196 /* InferType */) { - const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); - if (grandParent.kind === 184 /* TypeReference */ && !omitTypeReferences) { - const typeReference = grandParent; - const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); - if (typeParameters) { - const index = typeReference.typeArguments.indexOf(childTypeParameter); - if (index < typeParameters.length) { - const declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); - if (declaredConstraint) { - const mapper = makeDeferredTypeMapper( - typeParameters, - typeParameters.map((_, index2) => () => { - return getEffectiveTypeArgumentAtIndex(typeReference, typeParameters, index2); - }) - ); - const constraint = instantiateType(declaredConstraint, mapper); - if (constraint !== typeParameter) { - inferences = append(inferences, constraint); - } - } - } - } - } else if (grandParent.kind === 170 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 192 /* RestType */ || grandParent.kind === 203 /* NamedTupleMember */ && grandParent.dotDotDotToken) { - inferences = append(inferences, createArrayType(unknownType)); - } else if (grandParent.kind === 205 /* TemplateLiteralTypeSpan */) { - inferences = append(inferences, stringType); - } else if (grandParent.kind === 169 /* TypeParameter */ && grandParent.parent.kind === 201 /* MappedType */) { - inferences = append(inferences, stringNumberSymbolType); - } else if (grandParent.kind === 201 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 195 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 201 /* 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) : stringNumberSymbolType))); - } - } - } - } - return inferences && getIntersectionType(inferences); - } - function getConstraintFromTypeParameter(typeParameter) { - if (!typeParameter.constraint) { - if (typeParameter.target) { - const targetConstraint = getConstraintOfTypeParameter(typeParameter.target); - typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; - } else { - const constraintDeclaration = getConstraintDeclaration(typeParameter); - if (!constraintDeclaration) { - typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; - } else { - let type = getTypeFromTypeNode(constraintDeclaration); - if (type.flags & 1 /* Any */ && !isErrorType(type)) { - type = constraintDeclaration.parent.parent.kind === 201 /* MappedType */ ? stringNumberSymbolType : unknownType; - } - typeParameter.constraint = type; - } - } - } - return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint; - } - function getParentSymbolOfTypeParameter(typeParameter) { - const tp = getDeclarationOfKind(typeParameter.symbol, 169 /* TypeParameter */); - const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent; - return host2 && getSymbolOfNode(host2); - } - function getTypeListId(types) { - let result = ""; - if (types) { - const length2 = types.length; - let i = 0; - while (i < length2) { - const startId = types[i].id; - let count = 1; - while (i + count < length2 && types[i + count].id === startId + count) { - count++; - } - if (result.length) { - result += ","; - } - result += startId; - if (count > 1) { - result += ":" + count; - } - i += count; - } - } - return result; - } - function getAliasId(aliasSymbol, aliasTypeArguments) { - return aliasSymbol ? `@${getSymbolId(aliasSymbol)}` + (aliasTypeArguments ? `:${getTypeListId(aliasTypeArguments)}` : "") : ""; - } - function getPropagatingFlagsOfTypes(types, excludeKinds) { - let result = 0; - for (const type of types) { - if (excludeKinds === void 0 || !(type.flags & excludeKinds)) { - result |= getObjectFlags(type); - } - } - return result & 458752 /* PropagatingFlags */; - } - function tryCreateTypeReference(target, typeArguments) { - if (some(typeArguments) && target === emptyGenericType) { - return unknownType; - } - return createTypeReference(target, typeArguments); - } - function createTypeReference(target, typeArguments) { - const id = getTypeListId(typeArguments); - let type = target.instantiations.get(id); - if (!type) { - type = createObjectType(4 /* Reference */, target.symbol); - target.instantiations.set(id, type); - type.objectFlags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments) : 0; - type.target = target; - type.resolvedTypeArguments = typeArguments; - } - return type; - } - function cloneTypeReference(source) { - const type = createTypeWithSymbol(source.flags, source.symbol); - type.objectFlags = source.objectFlags; - type.target = source.target; - type.resolvedTypeArguments = source.resolvedTypeArguments; - return type; - } - function createDeferredTypeReference(target, node, mapper, aliasSymbol, aliasTypeArguments) { - if (!aliasSymbol) { - aliasSymbol = getAliasSymbolForTypeNode(node); - const localAliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); - aliasTypeArguments = mapper ? instantiateTypes(localAliasTypeArguments, mapper) : localAliasTypeArguments; - } - const type = createObjectType(4 /* Reference */, target.symbol); - type.target = target; - type.node = node; - type.mapper = mapper; - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = aliasTypeArguments; - return type; - } - function getTypeArguments(type) { - var _a, _b; - if (!type.resolvedTypeArguments) { - if (!pushTypeResolution(type, 5 /* ResolvedTypeArguments */)) { - return concatenate(type.target.outerTypeParameters, (_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray; - } - const node = type.node; - const typeArguments = !node ? emptyArray : node.kind === 184 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 189 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); - if (popTypeResolution()) { - type.resolvedTypeArguments ?? (type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments); - } else { - type.resolvedTypeArguments ?? (type.resolvedTypeArguments = concatenate(type.target.outerTypeParameters, ((_b = type.target.localTypeParameters) == null ? void 0 : _b.map(() => errorType)) || emptyArray)); - 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) - ); - } - } - return type.resolvedTypeArguments; - } - function getTypeReferenceArity(type) { - return length(type.target.typeParameters); - } - function getTypeFromClassOrInterfaceReference(node, symbol) { - const type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); - const typeParameters = type.localTypeParameters; - if (typeParameters) { - const numTypeArguments = length(node.typeArguments); - const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - const isJs = isInJSFile(node); - const isJsImplicitAny = !noImplicitAny && isJs; - if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - const missingAugmentsTag = isJs && isExpressionWithTypeArguments(node) && !isJSDocAugmentsTag(node.parent); - const diag2 = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag : Diagnostics.Generic_type_0_requires_1_type_argument_s : missingAugmentsTag ? Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; - const typeStr = typeToString( - type, - /*enclosingDeclaration*/ - void 0, - 2 /* WriteArrayAsGenericType */ - ); - error2(node, diag2, typeStr, minTypeArgumentCount, typeParameters.length); - if (!isJs) { - return errorType; - } - } - if (node.kind === 184 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { - return createDeferredTypeReference( - type, - node, - /*mapper*/ - void 0 - ); - } - const typeArguments = concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs)); - return createTypeReference(type, typeArguments); - } - return checkNoTypeArguments(node, symbol) ? type : errorType; - } - function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) { - const type = getDeclaredTypeOfSymbol(symbol); - 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)); - } - return instantiation; - } - function getTypeFromTypeAliasReference(node, symbol) { - if (getCheckFlags(symbol) & 1048576 /* Unresolved */) { - const typeArguments = typeArgumentsFromTypeReferenceNode(node); - const id = getAliasId(symbol, typeArguments); - let errorType2 = errorTypes.get(id); - if (!errorType2) { - errorType2 = createIntrinsicType( - 1 /* Any */, - "error", - /*objectFlags*/ - void 0, - `alias ${id}` - ); - errorType2.aliasSymbol = symbol; - errorType2.aliasTypeArguments = typeArguments; - errorTypes.set(id, errorType2); - } - return errorType2; - } - const type = getDeclaredTypeOfSymbol(symbol); - const typeParameters = getSymbolLinks(symbol).typeParameters; - if (typeParameters) { - const numTypeArguments = length(node.typeArguments); - const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { - 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), - minTypeArgumentCount, - typeParameters.length - ); - return errorType; - } - const aliasSymbol = getAliasSymbolForTypeNode(node); - let newAliasSymbol = aliasSymbol && (isLocalTypeAlias(symbol) || !isLocalTypeAlias(aliasSymbol)) ? aliasSymbol : void 0; - let aliasTypeArguments; - if (newAliasSymbol) { - aliasTypeArguments = getTypeArgumentsForAliasSymbol(newAliasSymbol); - } else if (isTypeReferenceType(node)) { - const aliasSymbol2 = resolveTypeReferenceName( - node, - 2097152 /* Alias */, - /*ignoreErrors*/ - true - ); - if (aliasSymbol2 && aliasSymbol2 !== unknownSymbol) { - const resolved = resolveAlias(aliasSymbol2); - if (resolved && resolved.flags & 524288 /* TypeAlias */) { - newAliasSymbol = resolved; - aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) || (typeParameters ? [] : void 0); - } - } - } - return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments); - } - return checkNoTypeArguments(node, symbol) ? type : errorType; - } - function isLocalTypeAlias(symbol) { - var _a; - const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias); - return !!(declaration && getContainingFunction(declaration)); - } - function getTypeReferenceName(node) { - switch (node.kind) { - case 184 /* TypeReference */: - return node.typeName; - case 234 /* ExpressionWithTypeArguments */: - const expr = node.expression; - if (isEntityNameExpression(expr)) { - return expr; - } - } - return void 0; - } - function getSymbolPath(symbol) { - return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName; - } - function getUnresolvedSymbolForEntityName(name) { - const identifier = name.kind === 167 /* QualifiedName */ ? name.right : name.kind === 212 /* PropertyAccessExpression */ ? name.name : name; - const text = identifier.escapedText; - if (text) { - const parentSymbol = name.kind === 167 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 212 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0; - const path = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text; - let result = unresolvedSymbols.get(path); - if (!result) { - unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */)); - result.parent = parentSymbol; - result.links.declaredType = unresolvedType; - } - return result; - } - return unknownSymbol; - } - function resolveTypeReferenceName(typeReference, meaning, ignoreErrors) { - const name = getTypeReferenceName(typeReference); - if (!name) { - return unknownSymbol; - } - const symbol = resolveEntityName(name, meaning, ignoreErrors); - return symbol && symbol !== unknownSymbol ? symbol : ignoreErrors ? unknownSymbol : getUnresolvedSymbolForEntityName(name); - } - function getTypeReferenceType(node, symbol) { - if (symbol === unknownSymbol) { - return errorType; - } - symbol = getExpandoSymbol(symbol) || symbol; - if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { - return getTypeFromClassOrInterfaceReference(node, symbol); - } - if (symbol.flags & 524288 /* TypeAlias */) { - return getTypeFromTypeAliasReference(node, symbol); - } - const res = tryGetDeclaredTypeOfSymbol(symbol); - if (res) { - return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; - } - if (symbol.flags & 111551 /* Value */ && isJSDocTypeReference(node)) { - const jsdocType = getTypeFromJSDocValueReference(node, symbol); - if (jsdocType) { - return jsdocType; - } else { - resolveTypeReferenceName(node, 788968 /* Type */); - return getTypeOfSymbol(symbol); - } - } - return errorType; - } - function getTypeFromJSDocValueReference(node, symbol) { - const links = getNodeLinks(node); - if (!links.resolvedJSDocType) { - const valueType = getTypeOfSymbol(symbol); - let typeType = valueType; - if (symbol.valueDeclaration) { - const isImportTypeWithQualifier = node.kind === 206 /* ImportType */ && node.qualifier; - if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { - typeType = getTypeReferenceType(node, valueType.symbol); - } - } - links.resolvedJSDocType = typeType; - } - 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) { - 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) { - return cached; - } - const result = createType(33554432 /* Substitution */); - result.baseType = baseType; - result.constraint = constraint; - substitutionTypes.set(id, result); - return result; - } - function getSubstitutionIntersection(substitutionType) { - return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]); - } - function isUnaryTupleTypeNode(node) { - return node.kind === 190 /* 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; - } - function getConditionalFlowTypeOfType(type, node) { - let constraints; - let covariant = true; - while (node && !isStatement(node) && node.kind !== 321 /* JSDoc */) { - const parent2 = node.parent; - if (parent2.kind === 170 /* Parameter */) { - covariant = !covariant; - } - if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 195 /* 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 === 201 /* MappedType */ && !parent2.nameType && node === parent2.type) { - const mappedType = getTypeFromTypeNode(parent2); - if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) { - const typeParameter = getHomomorphicTypeVariable(mappedType); - if (typeParameter) { - const constraint = getConstraintOfTypeParameter(typeParameter); - if (constraint && everyType(constraint, isArrayOrTupleType)) { - constraints = append(constraints, getUnionType([numberType, numericStringType])); - } - } - } - } - node = parent2; - } - return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type; - } - function isJSDocTypeReference(node) { - return !!(node.flags & 16777216 /* JSDoc */) && (node.kind === 184 /* TypeReference */ || node.kind === 206 /* ImportType */); - } - function checkNoTypeArguments(node, symbol) { - if (node.typeArguments) { - error2(node, Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : node.typeName ? declarationNameToString(node.typeName) : anon); - return false; - } - return true; - } - function getIntendedTypeFromJSDocTypeReference(node) { - if (isIdentifier(node.typeName)) { - const typeArgs = node.typeArguments; - switch (node.typeName.escapedText) { - case "String": - checkNoTypeArguments(node); - return stringType; - case "Number": - checkNoTypeArguments(node); - return numberType; - case "BigInt": - checkNoTypeArguments(node); - return bigintType; - case "Boolean": - checkNoTypeArguments(node); - return booleanType; - case "Void": - checkNoTypeArguments(node); - return voidType; - case "Undefined": - checkNoTypeArguments(node); - return undefinedType; - case "Null": - checkNoTypeArguments(node); - return nullType; - case "Function": - case "function": - checkNoTypeArguments(node); - return globalFunctionType; - case "array": - return (!typeArgs || !typeArgs.length) && !noImplicitAny ? anyArrayType : void 0; - case "promise": - return (!typeArgs || !typeArgs.length) && !noImplicitAny ? createPromiseType(anyType) : void 0; - case "Object": - if (typeArgs && typeArgs.length === 2) { - if (isJSDocIndexSignature(node)) { - const indexed = getTypeFromTypeNode(typeArgs[0]); - const target = getTypeFromTypeNode(typeArgs[1]); - const indexInfo = indexed === stringType || indexed === numberType ? [createIndexInfo( - indexed, - target, - /*isReadonly*/ - false - )] : emptyArray; - return createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - indexInfo - ); - } - return anyType; - } - checkNoTypeArguments(node); - return !noImplicitAny ? anyType : void 0; - } - } - } - function getTypeFromJSDocNullableTypeNode(node) { - const type = getTypeFromTypeNode(node.type); - return strictNullChecks ? getNullableType(type, 65536 /* Null */) : type; - } - function getTypeFromTypeReference(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - if (isConstTypeReference(node) && isAssertionExpression(node.parent)) { - links.resolvedSymbol = unknownSymbol; - return links.resolvedType = checkExpressionCached(node.parent.expression); - } - let symbol; - let type; - const meaning = 788968 /* Type */; - if (isJSDocTypeReference(node)) { - type = getIntendedTypeFromJSDocTypeReference(node); - if (!type) { - symbol = resolveTypeReferenceName( - node, - meaning, - /*ignoreErrors*/ - true - ); - if (symbol === unknownSymbol) { - symbol = resolveTypeReferenceName(node, meaning | 111551 /* Value */); - } else { - resolveTypeReferenceName(node, meaning); - } - type = getTypeReferenceType(node, symbol); - } - } - if (!type) { - symbol = resolveTypeReferenceName(node, meaning); - type = getTypeReferenceType(node, symbol); - } - links.resolvedSymbol = symbol; - links.resolvedType = type; - } - return links.resolvedType; - } - function typeArgumentsFromTypeReferenceNode(node) { - return map(node.typeArguments, getTypeFromTypeNode); - } - function getTypeFromTypeQueryNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const type = checkExpressionWithTypeArguments(node); - links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type)); - } - return links.resolvedType; - } - function getTypeOfGlobalSymbol(symbol, arity) { - function getTypeDeclaration(symbol2) { - const declarations = symbol2.declarations; - if (declarations) { - for (const declaration of declarations) { - switch (declaration.kind) { - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - return declaration; - } - } - } - } - if (!symbol) { - return arity ? emptyGenericType : emptyObjectType; - } - const type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & 524288 /* Object */)) { - 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) { - error2(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); - return arity ? emptyGenericType : emptyObjectType; - } - return type; - } - function getGlobalValueSymbol(name, reportErrors2) { - return getGlobalSymbol(name, 111551 /* Value */, reportErrors2 ? Diagnostics.Cannot_find_global_value_0 : void 0); - } - function getGlobalTypeSymbol(name, reportErrors2) { - return getGlobalSymbol(name, 788968 /* Type */, reportErrors2 ? Diagnostics.Cannot_find_global_type_0 : void 0); - } - function getGlobalTypeAliasSymbol(name, arity, reportErrors2) { - const symbol = getGlobalSymbol(name, 788968 /* Type */, reportErrors2 ? Diagnostics.Cannot_find_global_type_0 : void 0); - if (symbol) { - getDeclaredTypeOfSymbol(symbol); - if (length(getSymbolLinks(symbol).typeParameters) !== arity) { - const decl = symbol.declarations && find(symbol.declarations, isTypeAliasDeclaration); - error2(decl, Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); - return void 0; - } - } - return symbol; - } - function getGlobalSymbol(name, meaning, diagnostic) { - return resolveName( - /*location*/ - void 0, - name, - meaning, - diagnostic, - /*isUse*/ - false, - /*excludeGlobals*/ - false - ); - } - function getGlobalType(name, arity, reportErrors2) { - const symbol = getGlobalTypeSymbol(name, reportErrors2); - return symbol || reportErrors2 ? getTypeOfGlobalSymbol(symbol, arity) : void 0; - } - function getGlobalBuiltinTypes(typeNames, arity) { - let types; - for (const typeName of typeNames) { - types = append(types, getGlobalType( - typeName, - arity, - /*reportErrors*/ - false - )); - } - return types ?? emptyArray; - } - function getGlobalTypedPropertyDescriptorType() { - return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType( - "TypedPropertyDescriptor", - /*arity*/ - 1, - /*reportErrors*/ - true - ) || emptyGenericType); - } - function getGlobalTemplateStringsArrayType() { - return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType( - "TemplateStringsArray", - /*arity*/ - 0, - /*reportErrors*/ - true - ) || emptyObjectType); - } - function getGlobalImportMetaType() { - return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType( - "ImportMeta", - /*arity*/ - 0, - /*reportErrors*/ - true - ) || emptyObjectType); - } - function getGlobalImportMetaExpressionType() { - if (!deferredGlobalImportMetaExpressionType) { - const symbol = createSymbol(0 /* None */, "ImportMetaExpression"); - const importMetaType = getGlobalImportMetaType(); - const metaPropertySymbol = createSymbol(4 /* Property */, "meta", 8 /* Readonly */); - metaPropertySymbol.parent = symbol; - metaPropertySymbol.links.type = importMetaType; - const members = createSymbolTable([metaPropertySymbol]); - symbol.members = members; - deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray); - } - return deferredGlobalImportMetaExpressionType; - } - function getGlobalImportCallOptionsType(reportErrors2) { - return deferredGlobalImportCallOptionsType || (deferredGlobalImportCallOptionsType = getGlobalType( - "ImportCallOptions", - /*arity*/ - 0, - reportErrors2 - )) || emptyObjectType; - } - function getGlobalImportAttributesType(reportErrors2) { - return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType( - "ImportAttributes", - /*arity*/ - 0, - reportErrors2 - )) || emptyObjectType; - } - function getGlobalESSymbolConstructorSymbol(reportErrors2) { - return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2)); - } - function getGlobalESSymbolConstructorTypeSymbol(reportErrors2) { - return deferredGlobalESSymbolConstructorTypeSymbol || (deferredGlobalESSymbolConstructorTypeSymbol = getGlobalTypeSymbol("SymbolConstructor", reportErrors2)); - } - function getGlobalESSymbolType() { - return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType( - "Symbol", - /*arity*/ - 0, - /*reportErrors*/ - false - )) || emptyObjectType; - } - function getGlobalPromiseType(reportErrors2) { - return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType( - "Promise", - /*arity*/ - 1, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalPromiseLikeType(reportErrors2) { - return deferredGlobalPromiseLikeType || (deferredGlobalPromiseLikeType = getGlobalType( - "PromiseLike", - /*arity*/ - 1, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalPromiseConstructorSymbol(reportErrors2) { - return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors2)); - } - function getGlobalPromiseConstructorLikeType(reportErrors2) { - return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType( - "PromiseConstructorLike", - /*arity*/ - 0, - reportErrors2 - )) || emptyObjectType; - } - function getGlobalAsyncIterableType(reportErrors2) { - return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType( - "AsyncIterable", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalAsyncIteratorType(reportErrors2) { - return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType( - "AsyncIterator", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalAsyncIterableIteratorType(reportErrors2) { - return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType( - "AsyncIterableIterator", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalBuiltinAsyncIteratorTypes() { - return deferredGlobalBuiltinAsyncIteratorTypes ?? (deferredGlobalBuiltinAsyncIteratorTypes = getGlobalBuiltinTypes(["ReadableStreamAsyncIterator"], 1)); - } - function getGlobalAsyncIteratorObjectType(reportErrors2) { - return deferredGlobalAsyncIteratorObjectType || (deferredGlobalAsyncIteratorObjectType = getGlobalType( - "AsyncIteratorObject", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalAsyncGeneratorType(reportErrors2) { - return deferredGlobalAsyncGeneratorType || (deferredGlobalAsyncGeneratorType = getGlobalType( - "AsyncGenerator", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalIterableType(reportErrors2) { - return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType( - "Iterable", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalIteratorType(reportErrors2) { - return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType( - "Iterator", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalIterableIteratorType(reportErrors2) { - return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType( - "IterableIterator", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getBuiltinIteratorReturnType() { - return strictBuiltinIteratorReturn ? undefinedType : anyType; - } - function getGlobalBuiltinIteratorTypes() { - return deferredGlobalBuiltinIteratorTypes ?? (deferredGlobalBuiltinIteratorTypes = getGlobalBuiltinTypes(["ArrayIterator", "MapIterator", "SetIterator", "StringIterator"], 1)); - } - function getGlobalIteratorObjectType(reportErrors2) { - return deferredGlobalIteratorObjectType || (deferredGlobalIteratorObjectType = getGlobalType( - "IteratorObject", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalGeneratorType(reportErrors2) { - return deferredGlobalGeneratorType || (deferredGlobalGeneratorType = getGlobalType( - "Generator", - /*arity*/ - 3, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalIteratorYieldResultType(reportErrors2) { - return deferredGlobalIteratorYieldResultType || (deferredGlobalIteratorYieldResultType = getGlobalType( - "IteratorYieldResult", - /*arity*/ - 1, - reportErrors2 - )) || emptyGenericType; - } - function getGlobalIteratorReturnResultType(reportErrors2) { - return deferredGlobalIteratorReturnResultType || (deferredGlobalIteratorReturnResultType = getGlobalType( - "IteratorReturnResult", - /*arity*/ - 1, - 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, - 788968 /* Type */, - /*diagnostic*/ - void 0 - ); - return symbol && getTypeOfGlobalSymbol(symbol, arity); - } - function getGlobalExtractSymbol() { - deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalTypeAliasSymbol( - "Extract", - /*arity*/ - 2, - /*reportErrors*/ - true - ) || unknownSymbol); - return deferredGlobalExtractSymbol === unknownSymbol ? void 0 : deferredGlobalExtractSymbol; - } - function getGlobalOmitSymbol() { - deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol( - "Omit", - /*arity*/ - 2, - /*reportErrors*/ - true - ) || unknownSymbol); - return deferredGlobalOmitSymbol === unknownSymbol ? void 0 : deferredGlobalOmitSymbol; - } - function getGlobalAwaitedSymbol(reportErrors2) { - deferredGlobalAwaitedSymbol || (deferredGlobalAwaitedSymbol = getGlobalTypeAliasSymbol( - "Awaited", - /*arity*/ - 1, - reportErrors2 - ) || (reportErrors2 ? unknownSymbol : void 0)); - return deferredGlobalAwaitedSymbol === unknownSymbol ? void 0 : deferredGlobalAwaitedSymbol; - } - function getGlobalBigIntType() { - return deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType( - "BigInt", - /*arity*/ - 0, - /*reportErrors*/ - false - )) || emptyObjectType; - } - function getGlobalClassDecoratorContextType(reportErrors2) { - return deferredGlobalClassDecoratorContextType ?? (deferredGlobalClassDecoratorContextType = getGlobalType( - "ClassDecoratorContext", - /*arity*/ - 1, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalClassMethodDecoratorContextType(reportErrors2) { - return deferredGlobalClassMethodDecoratorContextType ?? (deferredGlobalClassMethodDecoratorContextType = getGlobalType( - "ClassMethodDecoratorContext", - /*arity*/ - 2, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalClassGetterDecoratorContextType(reportErrors2) { - return deferredGlobalClassGetterDecoratorContextType ?? (deferredGlobalClassGetterDecoratorContextType = getGlobalType( - "ClassGetterDecoratorContext", - /*arity*/ - 2, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalClassSetterDecoratorContextType(reportErrors2) { - return deferredGlobalClassSetterDecoratorContextType ?? (deferredGlobalClassSetterDecoratorContextType = getGlobalType( - "ClassSetterDecoratorContext", - /*arity*/ - 2, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalClassAccessorDecoratorContextType(reportErrors2) { - return deferredGlobalClassAccessorDecoratorContextType ?? (deferredGlobalClassAccessorDecoratorContextType = getGlobalType( - "ClassAccessorDecoratorContext", - /*arity*/ - 2, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalClassAccessorDecoratorTargetType(reportErrors2) { - return deferredGlobalClassAccessorDecoratorTargetType ?? (deferredGlobalClassAccessorDecoratorTargetType = getGlobalType( - "ClassAccessorDecoratorTarget", - /*arity*/ - 2, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalClassAccessorDecoratorResultType(reportErrors2) { - return deferredGlobalClassAccessorDecoratorResultType ?? (deferredGlobalClassAccessorDecoratorResultType = getGlobalType( - "ClassAccessorDecoratorResult", - /*arity*/ - 2, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalClassFieldDecoratorContextType(reportErrors2) { - return deferredGlobalClassFieldDecoratorContextType ?? (deferredGlobalClassFieldDecoratorContextType = getGlobalType( - "ClassFieldDecoratorContext", - /*arity*/ - 2, - reportErrors2 - )) ?? emptyGenericType; - } - function getGlobalNaNSymbol() { - return deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol( - "NaN", - /*reportErrors*/ - false - )); - } - function getGlobalRecordSymbol() { - deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol( - "Record", - /*arity*/ - 2, - /*reportErrors*/ - true - ) || unknownSymbol); - return deferredGlobalRecordSymbol === unknownSymbol ? void 0 : deferredGlobalRecordSymbol; - } - function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { - return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; - } - function createTypedPropertyDescriptorType(propertyType) { - return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); - } - function createIterableType(iteratedType) { - return createTypeFromGenericGlobalType(getGlobalIterableType( - /*reportErrors*/ - true - ), [iteratedType, voidType, undefinedType]); - } - function createArrayType(elementType, readonly) { - return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]); - } - function getTupleElementFlags(node) { - switch (node.kind) { - case 191 /* OptionalType */: - return 2 /* Optional */; - case 192 /* RestType */: - return getRestTypeElementFlags(node); - case 203 /* NamedTupleMember */: - return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; - default: - return 1 /* Required */; - } - } - function getRestTypeElementFlags(node) { - return getArrayElementTypeNode(node.type) ? 4 /* Rest */ : 8 /* Variadic */; - } - function getArrayOrTupleTargetType(node) { - const readonly = isReadonlyTypeOperator(node.parent); - const elementType = getArrayElementTypeNode(node); - if (elementType) { - return readonly ? globalReadonlyArrayType : globalArrayType; - } - const elementFlags = map(node.elements, getTupleElementFlags); - 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 === 189 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 190 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); - } - function isResolvedByTypeAlias(node) { - const parent2 = node.parent; - switch (parent2.kind) { - case 197 /* ParenthesizedType */: - case 203 /* NamedTupleMember */: - case 184 /* TypeReference */: - case 193 /* UnionType */: - case 194 /* IntersectionType */: - case 200 /* IndexedAccessType */: - case 195 /* ConditionalType */: - case 199 /* TypeOperator */: - case 189 /* ArrayType */: - case 190 /* TupleType */: - return isResolvedByTypeAlias(parent2); - case 266 /* TypeAliasDeclaration */: - return true; - } - return false; - } - function mayResolveTypeAlias(node) { - switch (node.kind) { - case 184 /* TypeReference */: - return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 187 /* TypeQuery */: - return true; - case 199 /* TypeOperator */: - return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 197 /* ParenthesizedType */: - case 191 /* OptionalType */: - case 203 /* NamedTupleMember */: - case 317 /* JSDocOptionalType */: - case 315 /* JSDocNullableType */: - case 316 /* JSDocNonNullableType */: - case 310 /* JSDocTypeExpression */: - return mayResolveTypeAlias(node.type); - case 192 /* RestType */: - return node.type.kind !== 189 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 193 /* UnionType */: - case 194 /* IntersectionType */: - return some(node.types, mayResolveTypeAlias); - case 200 /* IndexedAccessType */: - return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 195 /* ConditionalType */: - return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); - } - return false; - } - function getTypeFromArrayOrTupleTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const target = getArrayOrTupleTargetType(node); - if (target === emptyGenericType) { - links.resolvedType = emptyObjectType; - } else if (!(node.kind === 190 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 190 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference( - target, - node, - /*mapper*/ - void 0 - ); - } else { - const elementTypes = node.kind === 189 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); - links.resolvedType = createNormalizedTypeReference(target, elementTypes); - } - } - return links.resolvedType; - } - function isReadonlyTypeOperator(node) { - return isTypeOperatorNode(node) && node.operator === 148 /* ReadonlyKeyword */; - } - 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; - } - function getTupleTargetType(elementFlags, readonly, namedMemberDeclarations) { - 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" : "") + (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)); - } - return type; - } - function createTupleTargetType(elementFlags, readonly, namedMemberDeclarations) { - const arity = elementFlags.length; - const minLength = countWhere(elementFlags, (f) => !!(f & (1 /* Required */ | 8 /* Variadic */))); - let typeParameters; - const properties = []; - let combinedFlags = 0; - if (arity) { - typeParameters = new Array(arity); - for (let i = 0; i < arity; i++) { - const typeParameter = typeParameters[i] = createTypeParameter(); - 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); - property.links.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i]; - property.links.type = typeParameter; - properties.push(property); - } - } - } - const fixedLength = properties.length; - const lengthSymbol = createSymbol(4 /* Property */, "length", readonly ? 8 /* Readonly */ : 0); - if (combinedFlags & 12 /* Variable */) { - lengthSymbol.links.type = numberType; - } else { - const literalTypes = []; - for (let i = minLength; i <= arity; i++) literalTypes.push(getNumberLiteralType(i)); - lengthSymbol.links.type = getUnionType(literalTypes); - } - properties.push(lengthSymbol); - const type = createObjectType(8 /* Tuple */ | 4 /* Reference */); - type.typeParameters = typeParameters; - type.outerTypeParameters = void 0; - type.localTypeParameters = typeParameters; - type.instantiations = /* @__PURE__ */ new Map(); - type.instantiations.set(getTypeListId(type.typeParameters), type); - type.target = type; - type.resolvedTypeArguments = type.typeParameters; - type.thisType = createTypeParameter(); - type.thisType.isThisType = true; - type.thisType.constraint = type; - type.declaredProperties = properties; - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredIndexInfos = emptyArray; - type.elementFlags = elementFlags; - type.minLength = minLength; - type.fixedLength = fixedLength; - type.hasRestElement = !!(combinedFlags & 12 /* Variable */); - type.combinedFlags = combinedFlags; - type.readonly = readonly; - type.labeledElementDeclarations = namedMemberDeclarations; - return type; - } - function createNormalizedTypeReference(target, typeArguments) { - return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments); - } - function createNormalizedTupleType(target, elementTypes) { - var _a, _b, _c, _d; - if (!(target.combinedFlags & 14 /* NonRequired */)) { - return createTypeReference(target, elementTypes); - } - if (target.combinedFlags & 8 /* Variadic */) { - const unionIndex = findIndex(elementTypes, (t, i) => !!(target.elementFlags[i] & 8 /* Variadic */ && t.flags & (131072 /* Never */ | 1048576 /* Union */))); - if (unionIndex >= 0) { - return checkCrossProductUnion(map(elementTypes, (t, i) => target.elementFlags[i] & 8 /* Variadic */ ? t : unknownType)) ? mapType(elementTypes[unionIndex], (t) => createNormalizedTupleType(target, replaceElement(elementTypes, unionIndex, t))) : errorType; - } - } - const expandedTypes = []; - const expandedFlags = []; - const expandedDeclarations = []; - let lastRequiredIndex = -1; - let firstRestIndex = -1; - let lastOptionalOrRestIndex = -1; - for (let i = 0; i < elementTypes.length; i++) { - const type = elementTypes[i]; - const flags = target.elementFlags[i]; - if (flags & 8 /* Variadic */) { - 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) { - 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) => { - var _a2; - 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 */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]); - } - } else { - addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]); - } - } - for (let i = 0; i < lastRequiredIndex; i++) { - if (expandedFlags[i] & 2 /* Optional */) 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.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); - expandedFlags.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; - function addElement(type, flags, declaration) { - if (flags & 1 /* Required */) { - lastRequiredIndex = expandedFlags.length; - } - if (flags & 4 /* Rest */ && firstRestIndex < 0) { - firstRestIndex = expandedFlags.length; - } - if (flags & (2 /* Optional */ | 4 /* Rest */)) { - lastOptionalOrRestIndex = expandedFlags.length; - } - expandedTypes.push(flags & 2 /* Optional */ ? addOptionality( - type, - /*isProperty*/ - true - ) : type); - expandedFlags.push(flags); - expandedDeclarations.push(declaration); - } - } - function sliceTupleType(type, index, endSkipCount = 0) { - const target = type.target; - const endIndex = getTypeReferenceArity(type) - endSkipCount; - return index > target.fixedLength ? getRestArrayTypeOfTupleType(type) || createTupleType(emptyArray) : createTupleType( - getTypeArguments(type).slice(index, endIndex), - target.elementFlags.slice(index, endIndex), - /*readonly*/ - false, - target.labeledElementDeclarations && target.labeledElementDeclarations.slice(index, endIndex) - ); - } - function getKnownKeysOfTupleType(type) { - 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)); - return index >= 0 ? index : type.elementFlags.length; - } - 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); - return typeArguments.length === arity ? typeArguments : typeArguments.slice(0, arity); - } - function getTypeFromOptionalTypeNode(node) { - return addOptionality( - getTypeFromTypeNode(node.type), - /*isProperty*/ - true - ); - } - function getTypeId(type) { - return type.id; - } - function containsType(types, type) { - return binarySearch(types, type, getTypeId, compareValues) >= 0; - } - function insertType(types, type) { - const index = binarySearch(types, type, getTypeId, compareValues); - if (index < 0) { - types.splice(~index, 0, type); - return true; - } - return false; - } - function addTypeToUnion(typeSet, includes, type) { - const flags = type.flags; - if (!(flags & 131072 /* Never */)) { - 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 (isErrorType(type)) includes |= 1073741824 /* IncludesError */; - if (!strictNullChecks && flags & 98304 /* Nullable */) { - if (!(getObjectFlags(type) & 65536 /* ContainsWideningType */)) includes |= 4194304 /* IncludesNonWideningType */; - } else { - const len = typeSet.length; - const index = len && type.id > typeSet[len - 1].id ? ~len : binarySearch(typeSet, type, getTypeId, compareValues); - if (index < 0) { - typeSet.splice(~index, 0, type); - } - } - } - return includes; - } - function addTypesToUnion(typeSet, includes, types) { - let lastType; - for (const type of types) { - if (type !== lastType) { - includes = type.flags & 1048576 /* Union */ ? addTypesToUnion(typeSet, includes | (isNamedUnionType(type) ? 1048576 /* Union */ : 0), type.types) : addTypeToUnion(typeSet, includes, type); - lastType = type; - } - } - return includes; - } - function removeSubtypes(types, hasObjectTypes) { - var _a; - if (types.length < 2) { - return types; - } - const id = getTypeListId(types); - const match = subtypeReductionCache.get(id); - if (match) { - return match; - } - const hasEmptyObject = hasObjectTypes && some(types, (t) => !!(t.flags & 524288 /* Object */) && !isGenericMappedType(t) && isEmptyResolvedType(resolveStructuredTypeMembers(t))); - const len = types.length; - let i = len; - let count = 0; - while (i > 0) { - i--; - const source = types[i]; - if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) { - if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) { - if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) { - orderedRemoveItemAt(types, i); - } - continue; - } - const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0; - const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty)); - for (const target of types) { - if (source !== target) { - if (count === 1e5) { - 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) }); - error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return void 0; - } - } - count++; - if (keyProperty && target.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) { - const t = getTypeOfPropertyOfType(target, keyProperty.escapedName); - if (t && isUnitType(t) && getRegularTypeOfLiteralType(t) !== keyPropertyType) { - continue; - } - } - if (isTypeRelatedTo(source, target, strictSubtypeRelation) && (!(getObjectFlags(getTargetType(source)) & 1 /* Class */) || !(getObjectFlags(getTargetType(target)) & 1 /* Class */) || isTypeDerivedFrom(source, target))) { - orderedRemoveItemAt(types, i); - break; - } - } - } - } - } - subtypeReductionCache.set(id, types); - return types; - } - function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) { - let i = types.length; - while (i > 0) { - i--; - const t = types[i]; - const flags = t.flags; - const remove = flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 4 /* String */ || flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ || flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ || flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ || reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ || isFreshLiteralType(t) && containsType(types, t.regularType); - if (remove) { - orderedRemoveItemAt(types, i); - } - } - } - function removeStringLiteralsMatchedByTemplateLiterals(types) { - 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) => 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)); - } - function addNamedUnions(namedUnions, types) { - for (const t of types) { - if (t.flags & 1048576 /* Union */) { - const origin = t.origin; - if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) { - pushIfUnique(namedUnions, t); - } else if (origin && origin.flags & 1048576 /* Union */) { - addNamedUnions(namedUnions, origin.types); - } - } - } - } - function createOriginUnionOrIntersectionType(flags, types) { - const result = createOriginType(flags); - result.types = types; - return result; - } - function getUnionType(types, unionReduction = 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin) { - if (types.length === 0) { - return neverType; - } - if (types.length === 1) { - return types[0]; - } - if (types.length === 2 && !origin && (types[0].flags & 1048576 /* Union */ || types[1].flags & 1048576 /* Union */)) { - const infix = unionReduction === 0 /* None */ ? "N" : unionReduction === 2 /* Subtype */ ? "S" : "L"; - const index = types[0].id < types[1].id ? 0 : 1; - const id = types[index].id + infix + types[1 - index].id + getAliasId(aliasSymbol, aliasTypeArguments); - let type = unionOfUnionTypes.get(id); - if (!type) { - type = getUnionTypeWorker( - types, - unionReduction, - aliasSymbol, - aliasTypeArguments, - /*origin*/ - void 0 - ); - unionOfUnionTypes.set(id, type); - } - return type; - } - return getUnionTypeWorker(types, unionReduction, aliasSymbol, aliasTypeArguments, origin); - } - function getUnionTypeWorker(types, unionReduction, aliasSymbol, aliasTypeArguments, origin) { - let typeSet = []; - const includes = addTypesToUnion(typeSet, 0, types); - if (unionReduction !== 0 /* None */) { - if (includes & 3 /* AnyOrUnknown */) { - return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : includes & 1073741824 /* IncludesError */ ? errorType : anyType : unknownType; - } - if (includes & 32768 /* Undefined */) { - if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) { - orderedRemoveItemAt(typeSet, 1); - } - } - 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 */ | 268435456 /* StringMapping */)) { - removeStringLiteralsMatchedByTemplateLiterals(typeSet); - } - if (includes & 536870912 /* IncludesConstrainedTypeVariable */) { - removeConstrainedTypeVariables(typeSet); - } - if (unionReduction === 2 /* Subtype */) { - typeSet = removeSubtypes(typeSet, !!(includes & 524288 /* Object */)); - if (!typeSet) { - return errorType; - } - } - if (typeSet.length === 0) { - return includes & 65536 /* Null */ ? includes & 4194304 /* IncludesNonWideningType */ ? nullType : nullWideningType : includes & 32768 /* Undefined */ ? includes & 4194304 /* IncludesNonWideningType */ ? undefinedType : undefinedWideningType : neverType; - } - } - if (!origin && includes & 1048576 /* Union */) { - const namedUnions = []; - addNamedUnions(namedUnions, types); - const reducedTypes = []; - for (const t of typeSet) { - if (!some(namedUnions, (union) => containsType(union.types, t))) { - reducedTypes.push(t); - } - } - if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) { - return namedUnions[0]; - } - const namedTypesCount = reduceLeft(namedUnions, (sum, union) => sum + union.types.length, 0); - if (namedTypesCount + reducedTypes.length === typeSet.length) { - for (const t of namedUnions) { - insertType(reducedTypes, t); - } - origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes); - } - } - const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0); - return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin); - } - function getUnionOrIntersectionTypePredicate(signatures, kind) { - let last2; - const types = []; - for (const sig of signatures) { - const pred = getTypePredicateOfSignature(sig); - if (pred) { - if (pred.kind !== 0 /* This */ && pred.kind !== 1 /* Identifier */ || last2 && !typePredicateKindsMatch(last2, pred)) { - return void 0; - } - last2 = pred; - types.push(pred.type); - } else { - const returnType = kind !== 2097152 /* Intersection */ ? getReturnTypeOfSignature(sig) : void 0; - if (returnType !== falseType && returnType !== regularFalseType) { - return void 0; - } - } - } - if (!last2) { - return void 0; - } - const compositeType = getUnionOrIntersectionType(types, kind); - return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType); - } - function typePredicateKindsMatch(a, b) { - return a.kind === b.kind && a.parameterIndex === b.parameterIndex; - } - function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) { - if (types.length === 0) { - return neverType; - } - if (types.length === 1) { - return types[0]; - } - const typeKey = !origin ? getTypeListId(types) : origin.flags & 1048576 /* Union */ ? `|${getTypeListId(origin.types)}` : origin.flags & 2097152 /* Intersection */ ? `&${getTypeListId(origin.types)}` : `#${origin.type.id}|${getTypeListId(types)}`; - const id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments); - let type = unionTypes.get(id); - if (!type) { - type = createType(1048576 /* Union */); - type.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes( - types, - /*excludeKinds*/ - 98304 /* Nullable */ - ); - type.types = types; - type.origin = origin; - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = aliasTypeArguments; - if (types.length === 2 && types[0].flags & 512 /* BooleanLiteral */ && types[1].flags & 512 /* BooleanLiteral */) { - type.flags |= 16 /* Boolean */; - type.intrinsicName = "boolean"; - } - unionTypes.set(id, type); - } - return type; - } - function getTypeFromUnionTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const aliasSymbol = getAliasSymbolForTypeNode(node); - links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), 1 /* Literal */, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)); - } - return links.resolvedType; - } - function addTypeToIntersection(typeSet, includes, type) { - const flags = type.flags; - if (flags & 2097152 /* Intersection */) { - return addTypesToIntersection(typeSet, includes, type.types); - } - if (isEmptyAnonymousObjectType(type)) { - if (!(includes & 16777216 /* IncludesEmptyObject */)) { - includes |= 16777216 /* IncludesEmptyObject */; - typeSet.set(type.id.toString(), type); - } - } else { - if (flags & 3 /* AnyOrUnknown */) { - if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; - if (isErrorType(type)) includes |= 1073741824 /* IncludesError */; - } else if (strictNullChecks || !(flags & 98304 /* Nullable */)) { - if (type === missingType) { - includes |= 262144 /* IncludesMissingType */; - type = undefinedType; - } - if (!typeSet.has(type.id.toString())) { - if (type.flags & 109472 /* Unit */ && includes & 109472 /* Unit */) { - includes |= 67108864 /* NonPrimitive */; - } - typeSet.set(type.id.toString(), type); - } - } - includes |= flags & 473694207 /* IncludesMask */; - } - return includes; - } - function addTypesToIntersection(typeSet, includes, types) { - for (const type of types) { - includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); - } - return includes; - } - function removeRedundantSupertypes(types, includes) { - let i = types.length; - while (i > 0) { - i--; - const t = types[i]; - const remove = t.flags & 4 /* String */ && includes & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || t.flags & 8 /* Number */ && includes & 256 /* NumberLiteral */ || t.flags & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ || t.flags & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */ || t.flags & 16384 /* Void */ && includes & 32768 /* Undefined */ || isEmptyAnonymousObjectType(t) && includes & 470302716 /* DefinitelyNonNullable */; - if (remove) { - orderedRemoveItemAt(types, i); - } - } - } - function eachUnionContains(unionTypes2, type) { - for (const u of unionTypes2) { - if (!containsType(u.types, type)) { - if (type === missingType) { - return containsType(u.types, undefinedType); - } - if (type === undefinedType) { - return containsType(u.types, missingType); - } - const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0; - if (!primitive || !containsType(u.types, primitive)) { - return false; - } - } - } - return true; - } - function extractRedundantTemplateLiterals(types) { - let i = types.length; - const literals = filter(types, (t) => !!(t.flags & 128 /* StringLiteral */)); - while (i > 0) { - i--; - const t = types[i]; - if (!(t.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */))) continue; - for (const t2 of literals) { - if (isTypeSubtypeOf(t2, t)) { - orderedRemoveItemAt(types, i); - break; - } else if (isPatternLiteralType(t)) { - return true; - } - } - } - return false; - } - function removeFromEach(types, flag) { - for (let i = 0; i < types.length; i++) { - types[i] = filterType(types[i], (t) => !(t.flags & flag)); - } - } - function intersectUnionsOfPrimitiveTypes(types) { - let unionTypes2; - const index = findIndex(types, (t) => !!(getObjectFlags(t) & 32768 /* PrimitiveUnion */)); - if (index < 0) { - return false; - } - let i = index + 1; - while (i < types.length) { - const t = types[i]; - if (getObjectFlags(t) & 32768 /* PrimitiveUnion */) { - (unionTypes2 || (unionTypes2 = [types[index]])).push(t); - orderedRemoveItemAt(types, i); - } else { - i++; - } - } - if (!unionTypes2) { - return false; - } - const checked = []; - const result = []; - for (const u of unionTypes2) { - for (const t of u.types) { - if (insertType(checked, t)) { - if (eachUnionContains(unionTypes2, t)) { - if (t === undefinedType && result.length && result[0] === missingType) { - continue; - } - if (t === missingType && result.length && result[0] === undefinedType) { - result[0] = missingType; - continue; - } - insertType(result, t); - } - } - } - } - types[index] = getUnionTypeFromSortedList(result, 32768 /* PrimitiveUnion */); - return true; - } - function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) { - const result = createType(2097152 /* Intersection */); - result.objectFlags = objectFlags | getPropagatingFlagsOfTypes( - types, - /*excludeKinds*/ - 98304 /* Nullable */ - ); - result.types = types; - result.aliasSymbol = aliasSymbol; - result.aliasTypeArguments = aliasTypeArguments; - return result; - } - function getIntersectionType(types, flags = 0 /* None */, aliasSymbol, aliasTypeArguments) { - 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 */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) { - return neverType; - } - if (includes & 1 /* Any */) { - return includes & 8388608 /* IncludesWildcard */ ? wildcardType : includes & 1073741824 /* IncludesError */ ? errorType : anyType; - } - if (!strictNullChecks && includes & 98304 /* Nullable */) { - return includes & 16777216 /* IncludesEmptyObject */ ? neverType : includes & 32768 /* Undefined */ ? undefinedType : nullType; - } - if (includes & 4 /* String */ && includes & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 8 /* Number */ && includes & 256 /* NumberLiteral */ || includes & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ || includes & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */ || includes & 16384 /* Void */ && includes & 32768 /* Undefined */ || includes & 16777216 /* IncludesEmptyObject */ && includes & 470302716 /* DefinitelyNonNullable */) { - if (!(flags & 1 /* NoSupertypeReduction */)) removeRedundantSupertypes(typeSet, includes); - } - if (includes & 262144 /* IncludesMissingType */) { - typeSet[typeSet.indexOf(undefinedType)] = missingType; - } - if (typeSet.length === 0) { - return unknownType; - } - if (typeSet.length === 1) { - return typeSet[0]; - } - if (typeSet.length === 2 && !(flags & 2 /* NoConstraintReduction */)) { - const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1; - const typeVariable = typeSet[typeVarIndex]; - const primitiveType = typeSet[1 - typeVarIndex]; - if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) && !isGenericStringLikeType(primitiveType) || includes & 16777216 /* IncludesEmptyObject */)) { - const constraint = getBaseConstraintOfType(typeVariable); - if (constraint && everyType(constraint, (t) => !!(t.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */)) || isEmptyAnonymousObjectType(t))) { - if (isTypeStrictSubtypeOf(constraint, primitiveType)) { - return typeVariable; - } - if (!(constraint.flags & 1048576 /* Union */ && someType(constraint, (c) => isTypeStrictSubtypeOf(c, primitiveType)))) { - if (!isTypeStrictSubtypeOf(primitiveType, constraint)) { - return neverType; - } - } - objectFlags = 67108864 /* IsConstrainedTypeVariable */; - } - } - } - const id = getTypeListId(typeSet) + (flags & 2 /* NoConstraintReduction */ ? "*" : getAliasId(aliasSymbol, aliasTypeArguments)); - let result = intersectionTypes.get(id); - if (!result) { - if (includes & 1048576 /* Union */) { - if (intersectUnionsOfPrimitiveTypes(typeSet)) { - result = getIntersectionType(typeSet, flags, aliasSymbol, aliasTypeArguments); - } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) { - const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType; - removeFromEach(typeSet, 32768 /* Undefined */); - result = getUnionType([getIntersectionType(typeSet, flags), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments); - } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) { - removeFromEach(typeSet, 65536 /* Null */); - result = getUnionType([getIntersectionType(typeSet, flags), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments); - } else if (typeSet.length >= 3 && types.length > 2) { - const middle = Math.floor(typeSet.length / 2); - result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle), flags), getIntersectionType(typeSet.slice(middle), flags)], flags, aliasSymbol, aliasTypeArguments); - } else { - if (!checkCrossProductUnion(typeSet)) { - return errorType; - } - const constituents = getCrossProductIntersections(typeSet, flags); - const origin = some(constituents, (t) => !!(t.flags & 2097152 /* Intersection */)) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152 /* Intersection */, typeSet) : void 0; - result = getUnionType(constituents, 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin); - } - } else { - result = createIntersectionType(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); - } - intersectionTypes.set(id, result); - } - return result; - } - function getCrossProductUnionSize(types) { - return reduceLeft(types, (n, t) => t.flags & 1048576 /* Union */ ? n * t.types.length : t.flags & 131072 /* Never */ ? 0 : n, 1); - } - function checkCrossProductUnion(types) { - var _a; - 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 }); - error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return false; - } - return true; - } - function getCrossProductIntersections(types, flags) { - const count = getCrossProductUnionSize(types); - const intersections = []; - for (let i = 0; i < count; i++) { - const constituents = types.slice(); - let n = i; - for (let j = types.length - 1; j >= 0; j--) { - if (types[j].flags & 1048576 /* Union */) { - const sourceTypes = types[j].types; - const length2 = sourceTypes.length; - constituents[j] = sourceTypes[n % length2]; - n = Math.floor(n / length2); - } - } - const t = getIntersectionType(constituents, flags); - if (!(t.flags & 131072 /* Never */)) intersections.push(t); - } - return intersections; - } - function getConstituentCount(type) { - return !(type.flags & 3145728 /* UnionOrIntersection */) || type.aliasSymbol ? 1 : type.flags & 1048576 /* Union */ && type.origin ? getConstituentCount(type.origin) : getConstituentCountOfTypes(type.types); - } - function getConstituentCountOfTypes(types) { - return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0); - } - function getTypeFromIntersectionTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const aliasSymbol = getAliasSymbolForTypeNode(node); - const types = map(node.types, getTypeFromTypeNode); - 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, noSupertypeReduction ? 1 /* NoSupertypeReduction */ : 0, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)); - } - return links.resolvedType; - } - function createIndexType(type, indexFlags) { - const result = createType(4194304 /* Index */); - result.type = type; - result.indexFlags = indexFlags; - return result; - } - function createOriginIndexType(type) { - const result = createOriginType(4194304 /* Index */); - result.type = type; - return result; - } - function getIndexTypeForGenericType(type, indexFlags) { - return indexFlags & 1 /* StringsOnly */ ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, 1 /* StringsOnly */)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, 0 /* None */)); - } - function getIndexTypeForMappedType(type, indexFlags) { - const typeParameter = getTypeParameterFromMappedType(type); - const constraintType = getConstraintTypeFromMappedType(type); - const nameType = getNameTypeFromMappedType(type.target || type); - if (!nameType && !(indexFlags & 2 /* NoIndexSignatures */)) { - return constraintType; - } - const keyTypes = []; - 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); - } - 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; - } - return result; - function addMemberForKeyType(keyType) { - const propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - keyTypes.push(propNameType === stringType ? stringOrNumberType : propNameType); - } - } - function hasDistributiveNameType(mappedType) { - const typeVariable = getTypeParameterFromMappedType(mappedType); - return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable); - function isDistributive(type) { - return type.flags & (3 /* AnyOrUnknown */ | 402784252 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false; - } - } - function getLiteralTypeFromPropertyName(name) { - if (isPrivateIdentifier(name)) { - return neverType; - } - if (isNumericLiteral(name)) { - return getRegularTypeOfLiteralType(checkExpression(name)); - } - if (isComputedPropertyName(name)) { - return getRegularTypeOfLiteralType(checkComputedPropertyName(name)); - } - const propertyName = getPropertyNameForPropertyNameNode(name); - if (propertyName !== void 0) { - return getStringLiteralType(unescapeLeadingUnderscores(propertyName)); - } - if (isExpression(name)) { - return getRegularTypeOfLiteralType(checkExpression(name)); - } - return neverType; - } - function getLiteralTypeFromProperty(prop, include, includeNonPublic) { - if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 6 /* NonPublicAccessibilityModifier */)) { - let type = getSymbolLinks(getLateBoundSymbol(prop)).nameType; - if (!type) { - const name = getNameOfDeclaration(prop.valueDeclaration); - type = prop.escapedName === "default" /* Default */ ? getStringLiteralType("default") : name && getLiteralTypeFromPropertyName(name) || (!isKnownSymbol(prop) ? getStringLiteralType(symbolName(prop)) : void 0); - } - if (type && type.flags & include) { - return type; - } - } - return neverType; - } - function isKeyTypeIncluded(keyType, include) { - return !!(keyType.flags & include || keyType.flags & 2097152 /* Intersection */ && some(keyType.types, (t) => isKeyTypeIncluded(t, include))); - } - function getLiteralTypeFromProperties(type, include, includeOrigin) { - const origin = includeOrigin && (getObjectFlags(type) & (3 /* ClassOrInterface */ | 4 /* Reference */) || type.aliasSymbol) ? createOriginIndexType(type) : void 0; - const propertyTypes = map(getPropertiesOfType(type), (prop) => getLiteralTypeFromProperty(prop, include)); - const indexKeyTypes = map(getIndexInfosOfType(type), (info) => info !== enumNumberIndexInfo && isKeyTypeIncluded(info.keyType, include) ? info.keyType === stringType && include & 8 /* Number */ ? stringOrNumberType : info.keyType : neverType); - return getUnionType( - concatenate(propertyTypes, indexKeyTypes), - 1 /* Literal */, - /*aliasSymbol*/ - void 0, - /*aliasTypeArguments*/ - void 0, - origin - ); - } - function shouldDeferIndexType(type, indexFlags = 0 /* None */) { - 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 = 0 /* None */) { - type = getReducedType(type); - 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 */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */); - } - function getExtractStringType(type) { - const extractTypeAlias = getGlobalExtractSymbol(); - return extractTypeAlias ? getTypeAliasInstantiation(extractTypeAlias, [type, stringType]) : stringType; - } - function getIndexTypeOrString(type) { - const indexType = getExtractStringType(getIndexType(type)); - return indexType.flags & 131072 /* Never */ ? stringType : indexType; - } - function getTypeFromTypeOperatorNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - switch (node.operator) { - case 143 /* KeyOfKeyword */: - links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); - break; - case 158 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 155 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(walkUpParenthesizedTypes(node.parent)) : errorType; - break; - case 148 /* ReadonlyKeyword */: - links.resolvedType = getTypeFromTypeNode(node.type); - break; - default: - Debug.assertNever(node.operator); - } - } - return links.resolvedType; - } - function getTypeFromTemplateTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getTemplateLiteralType( - [node.head.text, ...map(node.templateSpans, (span) => span.literal.text)], - map(node.templateSpans, (span) => getTypeFromTypeNode(span.type)) - ); - } - return links.resolvedType; - } - function getTemplateLiteralType(texts, types) { - const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */))); - if (unionIndex >= 0) { - return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType; - } - if (contains(types, wildcardType)) { - return wildcardType; - } - const newTypes = []; - const newTexts = []; - let text = texts[0]; - if (!addSpans(texts, types)) { - return stringType; - } - if (newTypes.length === 0) { - return getStringLiteralType(text); - } - newTexts.push(text); - if (every(newTexts, (t) => t === "")) { - if (every(newTypes, (t) => !!(t.flags & 4 /* String */))) { - return stringType; - } - if (newTypes.length === 1 && isPatternLiteralType(newTypes[0])) { - return newTypes[0]; - } - } - const id = `${getTypeListId(newTypes)}|${map(newTexts, (t) => t.length).join(",")}|${newTexts.join("")}`; - let type = templateLiteralTypes.get(id); - if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); - } - return type; - function addSpans(texts2, types2) { - for (let i = 0; i < types2.length; i++) { - const t = types2[i]; - if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) { - text += getTemplateStringForType(t) || ""; - text += texts2[i + 1]; - } else if (t.flags & 134217728 /* TemplateLiteral */) { - text += t.texts[0]; - if (!addSpans(t.texts, t.types)) return false; - text += texts2[i + 1]; - } else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { - newTypes.push(t); - newTexts.push(text); - text = texts2[i + 1]; - } else { - return false; - } - } - return true; - } - } - function getTemplateStringForType(type) { - return type.flags & 128 /* StringLiteral */ ? type.value : type.flags & 256 /* NumberLiteral */ ? "" + type.value : type.flags & 2048 /* BigIntLiteral */ ? pseudoBigIntToString(type.value) : type.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) ? type.intrinsicName : void 0; - } - function createTemplateLiteralType(texts, types) { - const type = createType(134217728 /* TemplateLiteral */); - type.texts = texts; - type.types = types; - return type; - } - function getStringMappingType(symbol, type) { - return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, (t) => getStringMappingType(symbol, t)) : type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) : type.flags & 134217728 /* TemplateLiteral */ ? getTemplateLiteralType(...applyTemplateStringMapping(symbol, type.texts, type.types)) : ( - // Mapping> === Mapping - type.flags & 268435456 /* StringMapping */ && symbol === type.symbol ? type : type.flags & (1 /* Any */ | 4 /* String */ | 268435456 /* StringMapping */) || isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : ( - // This handles Mapping<`${number}`> and Mapping<`${bigint}`> - isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, getTemplateLiteralType(["", ""], [type])) : type - ) - ); - } - function applyStringMapping(symbol, str) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0 /* Uppercase */: - return str.toUpperCase(); - case 1 /* Lowercase */: - return str.toLowerCase(); - case 2 /* Capitalize */: - return str.charAt(0).toUpperCase() + str.slice(1); - case 3 /* Uncapitalize */: - return str.charAt(0).toLowerCase() + str.slice(1); - } - return str; - } - function applyTemplateStringMapping(symbol, texts, types) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0 /* Uppercase */: - return [texts.map((t) => t.toUpperCase()), types.map((t) => getStringMappingType(symbol, t))]; - case 1 /* Lowercase */: - return [texts.map((t) => t.toLowerCase()), types.map((t) => getStringMappingType(symbol, t))]; - case 2 /* Capitalize */: - return [texts[0] === "" ? texts : [texts[0].charAt(0).toUpperCase() + texts[0].slice(1), ...texts.slice(1)], texts[0] === "" ? [getStringMappingType(symbol, types[0]), ...types.slice(1)] : types]; - case 3 /* Uncapitalize */: - return [texts[0] === "" ? texts : [texts[0].charAt(0).toLowerCase() + texts[0].slice(1), ...texts.slice(1)], texts[0] === "" ? [getStringMappingType(symbol, types[0]), ...types.slice(1)] : types]; - } - return [texts, types]; - } - function getStringMappingTypeForGenericType(symbol, type) { - const id = `${getSymbolId(symbol)},${getTypeId(type)}`; - let result = stringMappingTypes.get(id); - if (!result) { - stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); - } - return result; - } - function createStringMappingType(symbol, type) { - const result = createTypeWithSymbol(268435456 /* StringMapping */, symbol); - result.type = type; - return result; - } - function createIndexedAccessType(objectType, indexType, accessFlags, aliasSymbol, aliasTypeArguments) { - const type = createType(8388608 /* IndexedAccess */); - type.objectType = objectType; - type.indexType = indexType; - type.accessFlags = accessFlags; - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = aliasTypeArguments; - return type; - } - function isJSLiteralType(type) { - if (noImplicitAny) { - return false; - } - if (getObjectFlags(type) & 4096 /* JSLiteral */) { - return true; - } - if (type.flags & 1048576 /* Union */) { - return every(type.types, isJSLiteralType); - } - if (type.flags & 2097152 /* Intersection */) { - return some(type.types, isJSLiteralType); - } - if (type.flags & 465829888 /* Instantiable */) { - const constraint = getResolvedBaseConstraint(type); - return constraint !== type && isJSLiteralType(constraint); - } - return false; - } - function getPropertyNameFromIndex(indexType, accessNode) { - return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessNode && isPropertyName(accessNode) ? ( - // late bound names are handled in the first branch, so here we only need to handle normal names - getPropertyNameForPropertyNameNode(accessNode) - ) : void 0; - } - function isUncalledFunctionReference(node, symbol) { - if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { - const parent2 = findAncestor(node.parent, (n) => !isAccessExpression(n)) || node.parent; - if (isCallLikeExpression(parent2)) { - return isCallOrNewExpression(parent2) && isIdentifier(node) && hasMatchingArgument(parent2, node); - } - return every(symbol.declarations, (d) => !isFunctionLike(d) || isDeprecatedDeclaration2(d)); - } - return true; - } - function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) { - const accessExpression = accessNode && accessNode.kind === 213 /* ElementAccessExpression */ ? accessNode : void 0; - const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode); - if (propName !== void 0) { - if (accessFlags & 256 /* Contextual */) { - return getTypeOfPropertyOfContextualType(objectType, propName) || anyType; - } - const prop = getPropertyOfType(objectType, propName); - if (prop) { - if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) { - const deprecatedNode = (accessExpression == null ? void 0 : accessExpression.argumentExpression) ?? (isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); - addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName); - } - if (accessExpression) { - markPropertyAsReferenced(prop, accessExpression, isSelfTypeAccess(accessExpression.expression, objectType.symbol)); - if (isAssignmentToReadonlyEntity(accessExpression, prop, getAssignmentTargetKind(accessExpression))) { - error2(accessExpression.argumentExpression, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); - return void 0; - } - if (accessFlags & 8 /* CacheSymbol */) { - getNodeLinks(accessNode).resolvedSymbol = prop; - } - if (isThisPropertyAccessInConstructor(accessExpression, prop)) { - return autoType; - } - } - 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)) { - const index = +propName; - if (accessNode && everyType(objectType, (t) => !(t.target.combinedFlags & 12 /* Variable */)) && !(accessFlags & 16 /* AllowMissing */)) { - const indexNode = getIndexNodeForAccessExpression(accessNode); - if (isTupleType(objectType)) { - if (index < 0) { - error2(indexNode, Diagnostics.A_tuple_type_cannot_be_indexed_with_a_negative_value); - return undefinedType; - } - error2(indexNode, Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType), getTypeReferenceArity(objectType), unescapeLeadingUnderscores(propName)); - } else { - error2(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); - } - } - if (index >= 0) { - errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType)); - return getTupleElementTypeOutOfStartCount(objectType, index, accessFlags & 1 /* IncludeUndefined */ ? missingType : void 0); - } - } - } - if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { - if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) { - return objectType; - } - const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType); - if (indexInfo) { - if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) { - if (accessExpression) { - 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); - 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); - if (accessFlags & 1 /* IncludeUndefined */ && !(objectType.symbol && objectType.symbol.flags & (256 /* RegularEnum */ | 128 /* ConstEnum */) && (indexType.symbol && indexType.flags & 1024 /* EnumLiteral */ && getParentOfSymbol(indexType.symbol) === objectType.symbol))) { - return getUnionType([indexInfo.type, missingType]); - } - return indexInfo.type; - } - if (indexType.flags & 131072 /* Never */) { - return neverType; - } - if (isJSLiteralType(objectType)) { - return anyType; - } - if (accessExpression && !isConstEnumObjectType(objectType)) { - if (isObjectLiteralType2(objectType)) { - if (noImplicitAny && indexType.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) { - diagnostics.add(createDiagnosticForNode(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType))); - return undefinedType; - } else if (indexType.flags & (8 /* Number */ | 4 /* String */)) { - const types = map(objectType.properties, (property) => { - return getTypeOfSymbol(property); - }); - return getUnionType(append(types, undefinedType)); - } - } - if (objectType.symbol === globalThisSymbol && propName !== void 0 && globalThisSymbol.exports.has(propName) && globalThisSymbol.exports.get(propName).flags & 418 /* BlockScoped */) { - error2(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); - } else if (noImplicitAny && !(accessFlags & 128 /* SuppressNoImplicitAnyError */)) { - if (propName !== void 0 && typeHasStaticProperty(propName, objectType)) { - const typeName = typeToString(objectType); - 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)) { - 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) { - 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) { - 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 */) { - errorInfo = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Property_0_does_not_exist_on_type_1, - "[" + typeToString(indexType) + "]", - typeToString(objectType) - ); - } else if (indexType.flags & 8192 /* UniqueESSymbol */) { - const symbolName2 = getFullyQualifiedName(indexType.symbol, accessExpression); - errorInfo = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Property_0_does_not_exist_on_type_1, - "[" + symbolName2 + "]", - typeToString(objectType) - ); - } else if (indexType.flags & 128 /* StringLiteral */) { - errorInfo = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Property_0_does_not_exist_on_type_1, - indexType.value, - typeToString(objectType) - ); - } else if (indexType.flags & 256 /* NumberLiteral */) { - errorInfo = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Property_0_does_not_exist_on_type_1, - indexType.value, - typeToString(objectType) - ); - } else if (indexType.flags & (8 /* Number */ | 4 /* String */)) { - errorInfo = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1, - typeToString(indexType), - typeToString(objectType) - ); - } - errorInfo = chainDiagnosticMessages( - errorInfo, - Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1, - typeToString(fullIndexType), - typeToString(objectType) - ); - diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(accessExpression), accessExpression, errorInfo)); - } - } - } - } - return void 0; - } - } - if (accessFlags & 16 /* AllowMissing */ && isObjectLiteralType2(objectType)) { - return undefinedType; - } - if (isJSLiteralType(objectType)) { - return anyType; - } - if (accessNode) { - const indexNode = getIndexNodeForAccessExpression(accessNode); - if (indexNode.kind !== 10 /* BigIntLiteral */ && indexType.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) { - error2(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); - } else if (indexType.flags & (4 /* String */ | 8 /* Number */)) { - error2(indexNode, Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType), typeToString(indexType)); - } else { - const typeString = indexNode.kind === 10 /* BigIntLiteral */ ? "bigint" : typeToString(indexType); - error2(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeString); - } - } - if (isTypeAny(indexType)) { - return indexType; - } - return void 0; - function errorIfWritingToReadonlyIndex(indexInfo) { - if (indexInfo && indexInfo.isReadonly && accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) { - error2(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - } - } - } - function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 213 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 200 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 168 /* ComputedPropertyName */ ? accessNode.expression : accessNode; - } - function isPatternLiteralPlaceholderType(type) { - if (type.flags & 2097152 /* Intersection */) { - 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); - } - function isPatternLiteralType(type) { - return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type); - } - function isGenericStringLikeType(type) { - return !!(type.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type); - } - function isGenericType(type) { - return !!getGenericObjectFlags(type); - } - function isGenericObjectType(type) { - return !!(getGenericObjectFlags(type) & 4194304 /* IsGenericObjectType */); - } - function isGenericIndexType(type) { - return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */); - } - function getGenericObjectFlags(type) { - if (type.flags & 3145728 /* UnionOrIntersection */) { - if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) { - type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0); - } - return type.objectFlags & 12582912 /* IsGenericType */; - } - if (type.flags & 33554432 /* Substitution */) { - if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) { - type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint); - } - return type.objectFlags & 12582912 /* IsGenericType */; - } - return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */) || isGenericStringLikeType(type) ? 8388608 /* IsGenericIndexType */ : 0); - } - function getSimplifiedType(type, writing) { - return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type; - } - function distributeIndexOverObjectType(objectType, indexType, writing) { - if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) { - const types = map(objectType.types, (t) => getSimplifiedType(getIndexedAccessType(t, indexType), writing)); - return objectType.flags & 2097152 /* Intersection */ || writing ? getIntersectionType(types) : getUnionType(types); - } - } - function distributeObjectOverIndexType(objectType, indexType, writing) { - if (indexType.flags & 1048576 /* Union */) { - const types = map(indexType.types, (t) => getSimplifiedType(getIndexedAccessType(objectType, t), writing)); - return writing ? getIntersectionType(types) : getUnionType(types); - } - } - function getSimplifiedIndexedAccessType(type, writing) { - const cache = writing ? "simplifiedForWriting" : "simplifiedForReading"; - if (type[cache]) { - return type[cache] === circularConstraintType ? type : type[cache]; - } - type[cache] = circularConstraintType; - const objectType = getSimplifiedType(type.objectType, writing); - const indexType = getSimplifiedType(type.indexType, writing); - const distributedOverIndex = distributeObjectOverIndexType(objectType, indexType, writing); - if (distributedOverIndex) { - return type[cache] = distributedOverIndex; - } - if (!(indexType.flags & 465829888 /* Instantiable */)) { - const distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing); - if (distributedOverObject) { - return type[cache] = distributedOverObject; - } - } - if (isGenericTupleType(objectType) && indexType.flags & 296 /* NumberLike */) { - const elementType = getElementTypeOfSliceOfTupleType( - objectType, - indexType.flags & 8 /* Number */ ? 0 : objectType.target.fixedLength, - /*endSkipCount*/ - 0, - writing - ); - if (elementType) { - return type[cache] = elementType; - } - } - if (isGenericMappedType(objectType)) { - if (getMappedTypeNameTypeKind(objectType) !== 2 /* Remapping */) { - return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing)); - } - } - return type[cache] = type; - } - function getSimplifiedConditionalType(type, writing) { - const checkType = type.checkType; - const extendsType = type.extendsType; - const trueType2 = getTrueTypeFromConditionalType(type); - const falseType2 = getFalseTypeFromConditionalType(type); - if (falseType2.flags & 131072 /* Never */ && getActualTypeVariable(trueType2) === getActualTypeVariable(checkType)) { - if (checkType.flags & 1 /* Any */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { - return getSimplifiedType(trueType2, writing); - } else if (isIntersectionEmpty(checkType, extendsType)) { - return neverType; - } - } else if (trueType2.flags & 131072 /* Never */ && getActualTypeVariable(falseType2) === getActualTypeVariable(checkType)) { - if (!(checkType.flags & 1 /* Any */) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { - return neverType; - } else if (checkType.flags & 1 /* Any */ || isIntersectionEmpty(checkType, extendsType)) { - return getSimplifiedType(falseType2, writing); - } - } - return type; - } - function isIntersectionEmpty(type1, type2) { - return !!(getUnionType([intersectTypes(type1, type2), neverType]).flags & 131072 /* Never */); - } - function substituteIndexedMappedType(objectType, index) { - const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]); - const templateMapper = combineTypeMappers(objectType.mapper, mapper); - const instantiatedTemplateType = instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper); - const isOptional = getMappedTypeOptionality(objectType) > 0 || (isGenericType(objectType) ? getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(objectType)) > 0 : couldAccessOptionalProperty(objectType, index)); - return addOptionality( - instantiatedTemplateType, - /*isProperty*/ - true, - isOptional - ); - } - function couldAccessOptionalProperty(objectType, indexType) { - const indexConstraint = getBaseConstraintOfType(indexType); - return !!indexConstraint && some(getPropertiesOfType(objectType), (p) => !!(p.flags & 16777216 /* Optional */) && isTypeAssignableTo(getLiteralTypeFromProperty(p, 8576 /* StringOrNumberLiteralOrUnique */), indexConstraint)); - } - function getIndexedAccessType(objectType, indexType, accessFlags = 0 /* None */, accessNode, aliasSymbol, aliasTypeArguments) { - return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); - } - function indexTypeLessThan(indexType, limit) { - return everyType(indexType, (t) => { - if (t.flags & 384 /* StringOrNumberLiteral */) { - const propName = getPropertyNameFromType(t); - if (isNumericLiteralName(propName)) { - const index = +propName; - return index >= 0 && index < limit; - } - } - return false; - }); - } - function getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags = 0 /* None */, accessNode, aliasSymbol, aliasTypeArguments) { - if (objectType === wildcardType || indexType === wildcardType) { - return wildcardType; - } - objectType = getReducedType(objectType); - if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { - indexType = stringType; - } - if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */) accessFlags |= 1 /* IncludeUndefined */; - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 200 /* 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; - } - const persistentAccessFlags = accessFlags & 1 /* Persistent */; - const id = objectType.id + "," + indexType.id + "," + persistentAccessFlags + getAliasId(aliasSymbol, aliasTypeArguments); - let type = indexedAccessTypes.get(id); - if (!type) { - indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, persistentAccessFlags, aliasSymbol, aliasTypeArguments)); - } - return type; - } - const apparentObjectType = getReducedApparentType(objectType); - if (indexType.flags & 1048576 /* Union */ && !(indexType.flags & 16 /* Boolean */)) { - const propTypes = []; - let wasMissingProp = false; - for (const t of indexType.types) { - const propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, accessNode, accessFlags | (wasMissingProp ? 128 /* SuppressNoImplicitAnyError */ : 0)); - if (propType) { - propTypes.push(propType); - } else if (!accessNode) { - return void 0; - } else { - wasMissingProp = true; - } - } - if (wasMissingProp) { - return void 0; - } - return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, 0 /* None */, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); - } - return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, accessNode, accessFlags | 8 /* CacheSymbol */ | 64 /* ReportDeprecated */); - } - function getTypeFromIndexedAccessTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const objectType = getTypeFromTypeNode(node.objectType); - const indexType = getTypeFromTypeNode(node.indexType); - const potentialAlias = getAliasSymbolForTypeNode(node); - links.resolvedType = getIndexedAccessType(objectType, indexType, 0 /* None */, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); - } - return links.resolvedType; - } - function getTypeFromMappedTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const type = createObjectType(32 /* Mapped */, node.symbol); - type.declaration = node; - type.aliasSymbol = getAliasSymbolForTypeNode(node); - type.aliasTypeArguments = getTypeArgumentsForAliasSymbol(type.aliasSymbol); - links.resolvedType = type; - getConstraintTypeFromMappedType(type); - } - return links.resolvedType; - } - function getActualTypeVariable(type) { - if (type.flags & 33554432 /* Substitution */) { - return getActualTypeVariable(type.baseType); - } - if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || type.indexType.flags & 33554432 /* Substitution */)) { - return getIndexedAccessType(getActualTypeVariable(type.objectType), getActualTypeVariable(type.indexType)); - } - return type; - } - 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, forConstraint, aliasSymbol, aliasTypeArguments) { - let result; - let extraTypes; - let tailCount = 0; - while (true) { - if (tailCount === 1e3) { - error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); - return errorType; - } - const checkType = instantiateType(getActualTypeVariable(root.checkType), mapper); - const extendsType = instantiateType(root.extendsType, mapper); - if (checkType === errorType || extendsType === errorType) { - return errorType; - } - if (checkType === wildcardType || extendsType === wildcardType) { - return wildcardType; - } - 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 context = createInferenceContext( - root.inferTypeParameters, - /*signature*/ - void 0, - 0 /* None */ - ); - if (mapper) { - context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper); - } - if (!checkTypeDeferred) { - inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */); - } - 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 */ || 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); - if (falseType2.flags & 16777216 /* Conditional */) { - const newRoot = falseType2.root; - if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) { - root = newRoot; - continue; - } - if (canTailRecurse(falseType2, mapper)) { - continue; - } - } - result = instantiateType(falseType2, mapper); - break; - } - if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { - const trueType2 = getTypeFromTypeNode(root.node.trueType); - const trueMapper = combinedMapper || mapper; - if (canTailRecurse(trueType2, trueMapper)) { - continue; - } - result = instantiateType(trueType2, trueMapper); - break; - } - } - result = createType(16777216 /* Conditional */); - result.root = root; - result.checkType = instantiateType(root.checkType, mapper); - result.extendsType = instantiateType(root.extendsType, mapper); - result.mapper = mapper; - result.combinedMapper = combinedMapper; - result.aliasSymbol = aliasSymbol || root.aliasSymbol; - result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper); - break; - } - return extraTypes ? getUnionType(append(extraTypes, result)) : result; - function canTailRecurse(newType, newMapper) { - if (newType.flags & 16777216 /* Conditional */ && newMapper) { - const newRoot = newType.root; - if (newRoot.outerTypeParameters) { - const typeParamMapper = combineTypeMappers(newType.mapper, newMapper); - const typeArguments = map(newRoot.outerTypeParameters, (t) => getMappedType(t, typeParamMapper)); - const newRootMapper = createTypeMapper(newRoot.outerTypeParameters, typeArguments); - const newCheckType = newRoot.isDistributive ? getMappedType(newRoot.checkType, newRootMapper) : void 0; - if (!newCheckType || newCheckType === newRoot.checkType || !(newCheckType.flags & (1048576 /* Union */ | 131072 /* Never */))) { - root = newRoot; - mapper = newRootMapper; - aliasSymbol = void 0; - aliasTypeArguments = void 0; - if (newRoot.aliasSymbol) { - tailCount++; - } - return true; - } - } - } - return false; - } - } - function getTrueTypeFromConditionalType(type) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper)); - } - function getFalseTypeFromConditionalType(type) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper)); - } - function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type)); - } - function getInferTypeParameters(node) { - let result; - if (node.locals) { - node.locals.forEach((symbol) => { - if (symbol.flags & 262144 /* TypeParameter */) { - result = append(result, getDeclaredTypeOfSymbol(symbol)); - } - }); - } - return result; - } - function isDistributionDependent(root) { - return root.isDistributive && (isTypeParameterPossiblyReferenced(root.checkType, root.node.trueType) || isTypeParameterPossiblyReferenced(root.checkType, root.node.falseType)); - } - function getTypeFromConditionalTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const checkType = getTypeFromTypeNode(node.checkType); - const aliasSymbol = getAliasSymbolForTypeNode(node); - const aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); - const allOuterTypeParameters = getOuterTypeParameters( - node, - /*includeThisTypes*/ - true - ); - const outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : filter(allOuterTypeParameters, (tp) => isTypeParameterPossiblyReferenced(tp, node)); - const root = { - node, - checkType, - extendsType: getTypeFromTypeNode(node.extendsType), - isDistributive: !!(checkType.flags & 262144 /* TypeParameter */), - inferTypeParameters: getInferTypeParameters(node), - outerTypeParameters, - instantiations: void 0, - aliasSymbol, - aliasTypeArguments - }; - links.resolvedType = getConditionalType( - root, - /*mapper*/ - void 0, - /*forConstraint*/ - false - ); - if (outerTypeParameters) { - root.instantiations = /* @__PURE__ */ new Map(); - root.instantiations.set(getTypeListId(outerTypeParameters), links.resolvedType); - } - } - return links.resolvedType; - } - function getTypeFromInferTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter)); - } - return links.resolvedType; - } - function getIdentifierChain(node) { - if (isIdentifier(node)) { - return [node]; - } else { - return append(getIdentifierChain(node.left), node.right); - } - } - function getTypeFromImportTypeNode(node) { - var _a; - const links = getNodeLinks(node); - if (!links.resolvedType) { - if (!isLiteralImportTypeNode(node)) { - error2(node.argument, Diagnostics.String_literal_expected); - links.resolvedSymbol = unknownSymbol; - return links.resolvedType = errorType; - } - 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; - return links.resolvedType = errorType; - } - const isExportEquals = !!((_a = innerModuleSymbol.exports) == null ? void 0 : _a.get("export=" /* ExportEquals */)); - const moduleSymbol = resolveExternalModuleSymbol( - innerModuleSymbol, - /*dontResolveAlias*/ - false - ); - if (!nodeIsMissing(node.qualifier)) { - const nameStack = getIdentifierChain(node.qualifier); - let currentNamespace = moduleSymbol; - let current; - while (current = nameStack.shift()) { - const meaning = nameStack.length ? 1920 /* Namespace */ : targetMeaning; - const mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); - const symbolFromVariable = node.isTypeOf || isInJSFile(node) && isExportEquals ? getPropertyOfType( - getTypeOfSymbol(mergedResolvedSymbol), - current.escapedText, - /*skipObjectFunctionPropertyAugment*/ - false, - /*includeTypeOnlyMembers*/ - true - ) : void 0; - const symbolFromModule = node.isTypeOf ? void 0 : getSymbol2(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); - const next = symbolFromModule ?? symbolFromVariable; - if (!next) { - error2(current, Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), declarationNameToString(current)); - return links.resolvedType = errorType; - } - getNodeLinks(current).resolvedSymbol = next; - getNodeLinks(current.parent).resolvedSymbol = next; - currentNamespace = next; - } - links.resolvedType = resolveImportSymbolType(node, links, currentNamespace, targetMeaning); - } else { - if (moduleSymbol.flags & targetMeaning) { - 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; - error2(node, errorMessage, node.argument.literal.text); - links.resolvedSymbol = unknownSymbol; - links.resolvedType = errorType; - } - } - } - return links.resolvedType; - } - function resolveImportSymbolType(node, links, symbol, meaning) { - const resolvedSymbol = resolveSymbol(symbol); - links.resolvedSymbol = resolvedSymbol; - if (meaning === 111551 /* Value */) { - return getInstantiationExpressionType(getTypeOfSymbol(symbol), node); - } else { - return getTypeReferenceType(node, resolvedSymbol); - } - } - function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - const aliasSymbol = getAliasSymbolForTypeNode(node); - if (!node.symbol || getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) { - links.resolvedType = emptyTypeLiteralType; - } else { - let type = createObjectType(16 /* Anonymous */, node.symbol); - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); - if (isJSDocTypeLiteral(node) && node.isArrayType) { - type = createArrayType(type); - } - links.resolvedType = type; - } - } - return links.resolvedType; - } - function getAliasSymbolForTypeNode(node) { - let host2 = node.parent; - while (isParenthesizedTypeNode(host2) || isJSDocTypeExpression(host2) || isTypeOperatorNode(host2) && host2.operator === 148 /* ReadonlyKeyword */) { - host2 = host2.parent; - } - return isTypeAlias(host2) ? getSymbolOfDeclaration(host2) : void 0; - } - function getTypeArgumentsForAliasSymbol(symbol) { - return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : void 0; - } - function isNonGenericObjectType(type) { - return !!(type.flags & 524288 /* Object */) && !isGenericMappedType(type); - } - function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) { - return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); - } - function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) { - if (!(type.flags & 1048576 /* Union */)) { - return type; - } - if (every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { - return find(type.types, isEmptyObjectType) || emptyObjectType; - } - const firstType = find(type.types, (t) => !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t)); - if (!firstType) { - return type; - } - const secondType = find(type.types, (t) => t !== firstType && !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t)); - if (secondType) { - return type; - } - return getAnonymousPartialType(firstType); - function getAnonymousPartialType(type2) { - const members = createSymbolTable(); - for (const prop of getPropertiesOfType(type2)) { - 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 */; - const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0)); - result.links.type = isSetonlyAccessor ? undefinedType : addOptionality( - getTypeOfSymbol(prop), - /*isProperty*/ - true - ); - result.declarations = prop.declarations; - result.links.nameType = getSymbolLinks(prop).nameType; - result.links.syntheticOrigin = prop; - members.set(prop.escapedName, result); - } - } - const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2)); - spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */; - return spread; - } - } - function getSpreadType(left, right, symbol, objectFlags, readonly) { - if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { - return anyType; - } - if (left.flags & 2 /* Unknown */ || right.flags & 2 /* Unknown */) { - return unknownType; - } - if (left.flags & 131072 /* Never */) { - return right; - } - if (right.flags & 131072 /* Never */) { - return left; - } - left = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); - if (left.flags & 1048576 /* Union */) { - return checkCrossProductUnion([left, right]) ? mapType(left, (t) => getSpreadType(t, right, symbol, objectFlags, readonly)) : errorType; - } - right = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); - if (right.flags & 1048576 /* Union */) { - return checkCrossProductUnion([left, right]) ? mapType(right, (t) => getSpreadType(left, t, symbol, objectFlags, readonly)) : errorType; - } - if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { - return left; - } - if (isGenericObjectType(left) || isGenericObjectType(right)) { - if (isEmptyObjectType(left)) { - return right; - } - if (left.flags & 2097152 /* Intersection */) { - const types = left.types; - const lastLeft = types[types.length - 1]; - if (isNonGenericObjectType(lastLeft) && isNonGenericObjectType(right)) { - return getIntersectionType(concatenate(types.slice(0, types.length - 1), [getSpreadType(lastLeft, right, symbol, objectFlags, readonly)])); - } - } - return getIntersectionType([left, right]); - } - const members = createSymbolTable(); - const skippedPrivateMembers = /* @__PURE__ */ new Set(); - const indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]); - for (const rightProp of getPropertiesOfType(right)) { - if (getDeclarationModifierFlagsFromSymbol(rightProp) & (2 /* Private */ | 4 /* Protected */)) { - skippedPrivateMembers.add(rightProp.escapedName); - } else if (isSpreadableProperty(rightProp)) { - members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly)); - } - } - for (const leftProp of getPropertiesOfType(left)) { - if (skippedPrivateMembers.has(leftProp.escapedName) || !isSpreadableProperty(leftProp)) { - continue; - } - if (members.has(leftProp.escapedName)) { - const rightProp = members.get(leftProp.escapedName); - const rightType = getTypeOfSymbol(rightProp); - if (rightProp.flags & 16777216 /* Optional */) { - const declarations = concatenate(leftProp.declarations, rightProp.declarations); - const flags = 4 /* Property */ | leftProp.flags & 16777216 /* Optional */; - const result = createSymbol(flags, leftProp.escapedName); - const leftType = getTypeOfSymbol(leftProp); - const leftTypeWithoutUndefined = removeMissingOrUndefinedType(leftType); - const rightTypeWithoutUndefined = removeMissingOrUndefinedType(rightType); - result.links.type = leftTypeWithoutUndefined === rightTypeWithoutUndefined ? leftType : getUnionType([leftType, rightTypeWithoutUndefined], 2 /* Subtype */); - result.links.leftSpread = leftProp; - result.links.rightSpread = rightProp; - result.declarations = declarations; - result.links.nameType = getSymbolLinks(leftProp).nameType; - members.set(leftProp.escapedName, result); - } - } else { - members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); - } - } - const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly))); - spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */ | 2097152 /* ContainsSpread */ | objectFlags; - return spread; - } - function isSpreadableProperty(prop) { - var _a; - return !some(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) || !((_a = prop.declarations) == null ? void 0 : _a.some((decl) => isClassLike(decl.parent)))); - } - function getSpreadSymbol(prop, readonly) { - const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); - if (!isSetonlyAccessor && readonly === isReadonlySymbol(prop)) { - return prop; - } - const flags = 4 /* Property */ | prop.flags & 16777216 /* Optional */; - const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0)); - result.links.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop); - result.declarations = prop.declarations; - result.links.nameType = getSymbolLinks(prop).nameType; - result.links.syntheticOrigin = prop; - return result; - } - function getIndexInfoWithReadonly(info, readonly) { - return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info; - } - function createLiteralType(flags, value, symbol, regularType) { - const type = createTypeWithSymbol(flags, symbol); - type.value = value; - type.regularType = regularType || type; - return type; - } - function getFreshTypeOfLiteralType(type) { - if (type.flags & 2976 /* Freshable */) { - if (!type.freshType) { - const freshType = createLiteralType(type.flags, type.value, type.symbol, type); - freshType.freshType = freshType; - type.freshType = freshType; - } - return type.freshType; - } - return type; - } - function getRegularTypeOfLiteralType(type) { - return type.flags & 2976 /* Freshable */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type; - } - function isFreshLiteralType(type) { - return !!(type.flags & 2976 /* Freshable */) && type.freshType === type; - } - function getStringLiteralType(value) { - let type; - return stringLiteralTypes.get(value) || (stringLiteralTypes.set(value, type = createLiteralType(128 /* StringLiteral */, value)), type); - } - function getNumberLiteralType(value) { - let type; - return numberLiteralTypes.get(value) || (numberLiteralTypes.set(value, type = createLiteralType(256 /* NumberLiteral */, value)), type); - } - function getBigIntLiteralType(value) { - let type; - const key = pseudoBigIntToString(value); - return bigIntLiteralTypes.get(key) || (bigIntLiteralTypes.set(key, type = createLiteralType(2048 /* BigIntLiteral */, value)), type); - } - function getEnumLiteralType(value, enumId, symbol) { - let type; - const key = `${enumId}${typeof value === "string" ? "@" : "#"}${value}`; - const flags = 1024 /* EnumLiteral */ | (typeof value === "string" ? 128 /* StringLiteral */ : 256 /* NumberLiteral */); - return enumLiteralTypes.get(key) || (enumLiteralTypes.set(key, type = createLiteralType(flags, value, symbol)), type); - } - function getTypeFromLiteralTypeNode(node) { - if (node.literal.kind === 106 /* NullKeyword */) { - return nullType; - } - const links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getRegularTypeOfLiteralType(checkExpression(node.literal)); - } - return links.resolvedType; - } - function createUniqueESSymbolType(symbol) { - const type = createTypeWithSymbol(8192 /* UniqueESSymbol */, symbol); - type.escapedName = `__@${type.symbol.escapedName}@${getSymbolId(type.symbol)}`; - 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) { - const links = getSymbolLinks(symbol); - return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); - } - } - return esSymbolType; - } - function getThisType(node) { - const container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - const parent2 = container && container.parent; - if (parent2 && (isClassLike(parent2) || parent2.kind === 265 /* InterfaceDeclaration */)) { - if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) { - return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(parent2)).thisType; - } - } - if (parent2 && isObjectLiteralExpression(parent2) && isBinaryExpression(parent2.parent) && getAssignmentDeclarationKind(parent2.parent) === 6 /* Prototype */) { - return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent2.parent.left).parent).thisType; - } - 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; - } - error2(node, Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface); - return errorType; - } - function getTypeFromThisTypeNode(node) { - const links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getThisType(node); - } - return links.resolvedType; - } - function getTypeFromRestTypeNode(node) { - return getTypeFromTypeNode(getArrayElementTypeNode(node.type) || node.type); - } - function getArrayElementTypeNode(node) { - switch (node.kind) { - case 197 /* ParenthesizedType */: - return getArrayElementTypeNode(node.type); - case 190 /* TupleType */: - if (node.elements.length === 1) { - node = node.elements[0]; - if (node.kind === 192 /* RestType */ || node.kind === 203 /* NamedTupleMember */ && node.dotDotDotToken) { - return getArrayElementTypeNode(node.type); - } - } - break; - case 189 /* ArrayType */: - return node.elementType; - } - return void 0; - } - function getTypeFromNamedTupleTypeNode(node) { - const links = getNodeLinks(node); - return links.resolvedType || (links.resolvedType = node.dotDotDotToken ? getTypeFromRestTypeNode(node) : addOptionality( - getTypeFromTypeNode(node.type), - /*isProperty*/ - true, - !!node.questionToken - )); - } - function getTypeFromTypeNode(node) { - return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); - } - function getTypeFromTypeNodeWorker(node) { - switch (node.kind) { - case 133 /* AnyKeyword */: - case 313 /* JSDocAllType */: - case 314 /* JSDocUnknownType */: - return anyType; - case 159 /* UnknownKeyword */: - return unknownType; - case 154 /* StringKeyword */: - return stringType; - case 150 /* NumberKeyword */: - return numberType; - case 163 /* BigIntKeyword */: - return bigintType; - case 136 /* BooleanKeyword */: - return booleanType; - case 155 /* SymbolKeyword */: - return esSymbolType; - case 116 /* VoidKeyword */: - return voidType; - case 157 /* UndefinedKeyword */: - return undefinedType; - case 106 /* NullKeyword */: - return nullType; - case 146 /* NeverKeyword */: - return neverType; - case 151 /* ObjectKeyword */: - return node.flags & 524288 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 141 /* IntrinsicKeyword */: - return intrinsicMarkerType; - case 198 /* ThisType */: - case 110 /* ThisKeyword */: - return getTypeFromThisTypeNode(node); - case 202 /* LiteralType */: - return getTypeFromLiteralTypeNode(node); - case 184 /* TypeReference */: - return getTypeFromTypeReference(node); - case 183 /* TypePredicate */: - return node.assertsModifier ? voidType : booleanType; - case 234 /* ExpressionWithTypeArguments */: - return getTypeFromTypeReference(node); - case 187 /* TypeQuery */: - return getTypeFromTypeQueryNode(node); - case 189 /* ArrayType */: - case 190 /* TupleType */: - return getTypeFromArrayOrTupleTypeNode(node); - case 191 /* OptionalType */: - return getTypeFromOptionalTypeNode(node); - case 193 /* UnionType */: - return getTypeFromUnionTypeNode(node); - case 194 /* IntersectionType */: - return getTypeFromIntersectionTypeNode(node); - case 315 /* JSDocNullableType */: - return getTypeFromJSDocNullableTypeNode(node); - case 317 /* JSDocOptionalType */: - return addOptionality(getTypeFromTypeNode(node.type)); - case 203 /* NamedTupleMember */: - return getTypeFromNamedTupleTypeNode(node); - case 197 /* ParenthesizedType */: - case 316 /* JSDocNonNullableType */: - case 310 /* JSDocTypeExpression */: - return getTypeFromTypeNode(node.type); - case 192 /* RestType */: - return getTypeFromRestTypeNode(node); - case 319 /* JSDocVariadicType */: - return getTypeFromJSDocVariadicType(node); - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 188 /* TypeLiteral */: - case 323 /* JSDocTypeLiteral */: - case 318 /* JSDocFunctionType */: - case 324 /* JSDocSignature */: - return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 199 /* TypeOperator */: - return getTypeFromTypeOperatorNode(node); - case 200 /* IndexedAccessType */: - return getTypeFromIndexedAccessTypeNode(node); - case 201 /* MappedType */: - return getTypeFromMappedTypeNode(node); - case 195 /* ConditionalType */: - return getTypeFromConditionalTypeNode(node); - case 196 /* InferType */: - return getTypeFromInferTypeNode(node); - case 204 /* TemplateLiteralType */: - return getTypeFromTemplateTypeNode(node); - case 206 /* ImportType */: - return getTypeFromImportTypeNode(node); - // This function assumes that an identifier, qualified name, or property access expression is a type expression - // Callers should first ensure this by calling `isPartOfTypeNode` - // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. - case 80 /* Identifier */: - case 167 /* QualifiedName */: - case 212 /* PropertyAccessExpression */: - const symbol = getSymbolAtLocation(node); - return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; - default: - return errorType; - } - } - function instantiateList(items, mapper, instantiator) { - if (items && items.length) { - for (let i = 0; i < items.length; i++) { - const item = items[i]; - const mapped = instantiator(item, mapper); - if (item !== mapped) { - const result = i === 0 ? [] : items.slice(0, i); - result.push(mapped); - for (i++; i < items.length; i++) { - result.push(instantiator(items[i], mapper)); - } - return result; - } - } - } - return items; - } - function instantiateTypes(types, mapper) { - return instantiateList(types, mapper, instantiateType); - } - function instantiateSignatures(signatures, mapper) { - return instantiateList(signatures, mapper, instantiateSignature); - } - function instantiateIndexInfos(indexInfos, mapper) { - return instantiateList(indexInfos, mapper, instantiateIndexInfo); - } - function createTypeMapper(sources, targets) { - return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets); - } - function getMappedType(type, mapper) { - switch (mapper.kind) { - case 0 /* Simple */: - return type === mapper.source ? mapper.target : type; - case 1 /* Array */: { - const sources = mapper.sources; - const targets = mapper.targets; - for (let i = 0; i < sources.length; i++) { - if (type === sources[i]) { - return targets ? targets[i] : anyType; - } - } - return type; - } - case 2 /* Deferred */: { - const sources = mapper.sources; - const targets = mapper.targets; - for (let i = 0; i < sources.length; i++) { - if (type === sources[i]) { - return targets[i](); - } - } - return type; - } - case 3 /* Function */: - return mapper.func(type); - case 4 /* Composite */: - case 5 /* Merged */: - const t1 = getMappedType(type, mapper.mapper1); - return t1 !== type && mapper.kind === 4 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); - } - } - function makeUnaryTypeMapper(source, target) { - return Debug.attachDebugPrototypeIfDebug({ kind: 0 /* Simple */, source, target }); - } - function makeArrayTypeMapper(sources, targets) { - return Debug.attachDebugPrototypeIfDebug({ kind: 1 /* Array */, sources, targets }); - } - function makeFunctionTypeMapper(func, debugInfo) { - return Debug.attachDebugPrototypeIfDebug({ kind: 3 /* Function */, func, debugInfo: Debug.isDebugging ? debugInfo : void 0 }); - } - function makeDeferredTypeMapper(sources, targets) { - return Debug.attachDebugPrototypeIfDebug({ kind: 2 /* Deferred */, sources, targets }); - } - function makeCompositeTypeMapper(kind, mapper1, mapper2) { - return Debug.attachDebugPrototypeIfDebug({ kind, mapper1, mapper2 }); - } - function createTypeEraser(sources) { - return createTypeMapper( - sources, - /*targets*/ - void 0 - ); - } - function createBackreferenceMapper(context, index) { - const forwardInferences = context.inferences.slice(index); - return createTypeMapper(map(forwardInferences, (i) => i.typeParameter), map(forwardInferences, () => unknownType)); - } - function createOuterReturnMapper(context) { - return context.outerReturnMapper ?? (context.outerReturnMapper = mergeTypeMappers(context.returnMapper, cloneInferenceContext(context).mapper)); - } - function combineTypeMappers(mapper1, mapper2) { - return mapper1 ? makeCompositeTypeMapper(4 /* Composite */, mapper1, mapper2) : mapper2; - } - function mergeTypeMappers(mapper1, mapper2) { - return mapper1 ? makeCompositeTypeMapper(5 /* Merged */, mapper1, mapper2) : mapper2; - } - function prependTypeMapping(source, target, mapper) { - return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5 /* Merged */, makeUnaryTypeMapper(source, target), mapper); - } - function appendTypeMapping(mapper, source, target) { - return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5 /* Merged */, mapper, makeUnaryTypeMapper(source, target)); - } - function getRestrictiveTypeParameter(tp) { - return !tp.constraint && !getConstraintDeclaration(tp) || tp.constraint === noConstraintType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = noConstraintType, tp.restrictiveInstantiation); - } - function cloneTypeParameter(typeParameter) { - const result = createTypeParameter(typeParameter.symbol); - result.target = typeParameter; - return result; - } - function instantiateTypePredicate(predicate, mapper) { - return createTypePredicate(predicate.kind, predicate.parameterName, predicate.parameterIndex, instantiateType(predicate.type, mapper)); - } - function instantiateSignature(signature, mapper, eraseTypeParameters) { - let freshTypeParameters; - if (signature.typeParameters && !eraseTypeParameters) { - freshTypeParameters = map(signature.typeParameters, cloneTypeParameter); - mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); - for (const tp of freshTypeParameters) { - tp.mapper = mapper; - } - } - const result = createSignature( - signature.declaration, - freshTypeParameters, - signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), - instantiateList(signature.parameters, mapper, instantiateSymbol), - /*resolvedReturnType*/ - void 0, - /*resolvedTypePredicate*/ - void 0, - signature.minArgumentCount, - signature.flags & 167 /* PropagatingFlags */ - ); - result.target = signature; - result.mapper = mapper; - return result; - } - function instantiateSymbol(symbol, mapper) { - const links = getSymbolLinks(symbol); - if (links.type && !couldContainTypeVariables(links.type)) { - if (!(symbol.flags & 65536 /* SetAccessor */)) { - return symbol; - } - if (links.writeType && !couldContainTypeVariables(links.writeType)) { - return symbol; - } - } - if (getCheckFlags(symbol) & 1 /* Instantiated */) { - symbol = links.target; - mapper = combineTypeMappers(links.mapper, mapper); - } - const result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | getCheckFlags(symbol) & (8 /* Readonly */ | 4096 /* Late */ | 16384 /* OptionalParameter */ | 32768 /* RestParameter */)); - result.declarations = symbol.declarations; - result.parent = symbol.parent; - result.links.target = symbol; - result.links.mapper = mapper; - if (symbol.valueDeclaration) { - result.valueDeclaration = symbol.valueDeclaration; - } - if (links.nameType) { - result.links.nameType = links.nameType; - } - return result; - } - function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) { - const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0]; - const links = getNodeLinks(declaration); - const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type; - let typeParameters = links.outerTypeParameters; - if (!typeParameters) { - let outerTypeParameters = getOuterTypeParameters( - declaration, - /*includeThisTypes*/ - true - ); - if (isJSConstructor(declaration)) { - const templateTagParameters = getTypeParametersFromDeclaration(declaration); - outerTypeParameters = addRange(outerTypeParameters, templateTagParameters); - } - typeParameters = outerTypeParameters || emptyArray; - const allDeclarations = type.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations; - typeParameters = (target.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ? filter(typeParameters, (tp) => some(allDeclarations, (d) => isTypeParameterPossiblyReferenced(tp, d))) : typeParameters; - links.outerTypeParameters = typeParameters; - } - if (typeParameters.length) { - const combinedMapper = combineTypeMappers(type.mapper, mapper); - const typeArguments = map(typeParameters, (t) => getMappedType(t, combinedMapper)); - const newAliasSymbol = aliasSymbol || type.aliasSymbol; - const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper); - const id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments); - if (!target.instantiations) { - target.instantiations = /* @__PURE__ */ new Map(); - target.instantiations.set(getTypeListId(typeParameters) + getAliasId(target.aliasSymbol, target.aliasTypeArguments), target); - } - let result = target.instantiations.get(id); - if (!result) { - let newMapper = createTypeMapper(typeParameters, typeArguments); - if (target.objectFlags & 134217728 /* SingleSignatureType */ && mapper) { - newMapper = combineTypeMappers(newMapper, mapper); - } - 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); - target.instantiations.set(id, result); - const resultObjectFlags = getObjectFlags(result); - if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) { - const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables); - 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; - } - } - } - } - return result; - } - return type; - } - function maybeTypeParameterReference(node) { - return !(node.parent.kind === 184 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 206 /* 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 === 242 /* Block */ || n.kind === 195 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) { - return true; - } - } - return containsReference(node); - } - return true; - function containsReference(node2) { - switch (node2.kind) { - case 198 /* ThisType */: - return !!tp.isThisType; - case 80 /* Identifier */: - return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp; - // use worker because we're looking for === equality - case 187 /* 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 === 169 /* 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. - void 0 - ) - ); - if (firstIdentifierSymbol.declarations && tpScope) { - return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference); - } - } - return true; - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type); - } - return !!forEachChild(node2, containsReference); - } - } - function getHomomorphicTypeVariable(type) { - const constraintType = getConstraintTypeFromMappedType(type); - if (constraintType.flags & 4194304 /* Index */) { - const typeVariable = getActualTypeVariable(constraintType.type); - if (typeVariable.flags & 262144 /* TypeParameter */) { - return typeVariable; - } - } - return void 0; - } - function instantiateMappedType(type, mapper, aliasSymbol, aliasTypeArguments) { - const typeVariable = getHomomorphicTypeVariable(type); - if (typeVariable) { - const mappedTypeVariable = instantiateType(typeVariable, mapper); - if (typeVariable !== mappedTypeVariable) { - return mapTypeWithAlias(getReducedType(mappedTypeVariable), instantiateConstituent, aliasSymbol, aliasTypeArguments); - } - } - return instantiateType(getConstraintTypeFromMappedType(type), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments); - function instantiateConstituent(t) { - if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) { - if (!type.declaration.nameType) { - let constraint; - if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) { - return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } - if (isTupleType(t)) { - return instantiateMappedTupleType(t, type, typeVariable, mapper); - } - if (isArrayOrTupleOrIntersection(t)) { - return getIntersectionType(map(t.types, instantiateConstituent)); - } - } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); - } - return t; - } - } - function getModifiedReadonlyState(state, modifiers) { - return modifiers & 1 /* IncludeReadonly */ ? true : modifiers & 2 /* ExcludeReadonly */ ? false : state; - } - function instantiateMappedTupleType(tupleType, mappedType, typeVariable, mapper) { - const elementFlags = tupleType.target.elementFlags; - 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 contains(newElementTypes, errorType) ? errorType : createTupleType(newElementTypes, newElementFlags, newReadonly, tupleType.target.labeledElementDeclarations); - } - function instantiateMappedArrayType(arrayType, mappedType, mapper) { - const elementType = instantiateMappedTypeTemplate( - mappedType, - numberType, - /*isOptional*/ - true, - mapper - ); - return isErrorType(elementType) ? errorType : createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType))); - } - function instantiateMappedTypeTemplate(type, key, isOptional, mapper) { - const templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key); - const propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); - const modifiers = getMappedTypeModifiers(type); - return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType( - propType, - /*isProperty*/ - true - ) : 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; - const origTypeParameter = getTypeParameterFromMappedType(type); - const freshTypeParameter = cloneTypeParameter(origTypeParameter); - result.typeParameter = freshTypeParameter; - mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper); - freshTypeParameter.mapper = mapper; - } - if (type.objectFlags & 8388608 /* InstantiationExpressionType */) { - result.node = type.node; - } - result.target = type; - result.mapper = mapper; - result.aliasSymbol = aliasSymbol || type.aliasSymbol; - result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper); - result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0; - return result; - } - 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 = (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 ? 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; - } - return type; - } - function instantiateType(type, mapper) { - return type && mapper ? instantiateTypeWithAlias( - type, - mapper, - /*aliasSymbol*/ - void 0, - /*aliasTypeArguments*/ - void 0 - ) : type; - } - function instantiateTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) { - var _a; - if (!couldContainTypeVariables(type)) { - return type; - } - if (instantiationDepth === 100 || instantiationCount >= 5e6) { - (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth, instantiationCount }); - error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); - return errorType; - } - const index = findActiveMapper(mapper); - if (index === -1) { - pushActiveMapper(mapper); - } - const key = type.id + getAliasId(aliasSymbol, aliasTypeArguments); - const mapperCache = activeTypeMappersCaches[index !== -1 ? index : activeTypeMappersCount - 1]; - const cached = mapperCache.get(key); - if (cached) { - return cached; - } - totalInstantiationCount++; - instantiationCount++; - instantiationDepth++; - const result = instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments); - if (index === -1) { - popActiveMapper(); - } else { - mapperCache.set(key, result); - } - instantiationDepth--; - return result; - } - function instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments) { - const flags = type.flags; - if (flags & 262144 /* TypeParameter */) { - return getMappedType(type, mapper); - } - if (flags & 524288 /* Object */) { - const objectFlags = type.objectFlags; - if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) { - if (objectFlags & 4 /* Reference */ && !type.node) { - const resolvedTypeArguments = type.resolvedTypeArguments; - const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper); - return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type; - } - if (objectFlags & 1024 /* ReverseMapped */) { - return instantiateReverseMappedType(type, mapper); - } - return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments); - } - return type; - } - if (flags & 3145728 /* UnionOrIntersection */) { - const origin = type.flags & 1048576 /* Union */ ? type.origin : void 0; - const types = origin && origin.flags & 3145728 /* UnionOrIntersection */ ? origin.types : type.types; - const newTypes = instantiateTypes(types, mapper); - if (newTypes === types && aliasSymbol === type.aliasSymbol) { - return type; - } - const newAliasSymbol = aliasSymbol || type.aliasSymbol; - const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper); - return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, 0 /* None */, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments); - } - if (flags & 4194304 /* Index */) { - return getIndexType(instantiateType(type.type, mapper)); - } - if (flags & 134217728 /* TemplateLiteral */) { - return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper)); - } - if (flags & 268435456 /* StringMapping */) { - return getStringMappingType(type.symbol, instantiateType(type.type, mapper)); - } - if (flags & 8388608 /* IndexedAccess */) { - const newAliasSymbol = aliasSymbol || type.aliasSymbol; - const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper); - return getIndexedAccessType( - instantiateType(type.objectType, mapper), - instantiateType(type.indexType, mapper), - type.accessFlags, - /*accessNode*/ - void 0, - newAliasSymbol, - newAliasTypeArguments - ); - } - if (flags & 16777216 /* Conditional */) { - 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); - } - if (newConstraint.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) { - return newBaseType; - } - return newBaseType.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]); - } - return type; - } - function instantiateReverseMappedType(type, mapper) { - const innerMappedType = instantiateType(type.mappedType, mapper); - if (!(getObjectFlags(innerMappedType) & 32 /* Mapped */)) { - return type; - } - const innerIndexType = instantiateType(type.constraintType, mapper); - if (!(innerIndexType.flags & 4194304 /* Index */)) { - return type; - } - const instantiated = inferTypeForHomomorphicMappedType( - instantiateType(type.source, mapper), - innerMappedType, - innerIndexType - ); - if (instantiated) { - return instantiated; - } - return type; - } - function getPermissiveInstantiation(type) { - return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); - } - function getRestrictiveInstantiation(type) { - if (type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) { - return type; - } - if (type.restrictiveInstantiation) { - return type.restrictiveInstantiation; - } - type.restrictiveInstantiation = instantiateType(type, restrictiveMapper); - type.restrictiveInstantiation.restrictiveInstantiation = type.restrictiveInstantiation; - return type.restrictiveInstantiation; - } - function instantiateIndexInfo(info, mapper) { - return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components); - } - function isContextSensitive(node) { - Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); - switch (node.kind) { - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 263 /* FunctionDeclaration */: - return isContextSensitiveFunctionLikeDeclaration(node); - case 211 /* ObjectLiteralExpression */: - return some(node.properties, isContextSensitive); - case 210 /* ArrayLiteralExpression */: - return some(node.elements, isContextSensitive); - case 228 /* ConditionalExpression */: - return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 227 /* BinaryExpression */: - return (node.operatorToken.kind === 57 /* BarBarToken */ || node.operatorToken.kind === 61 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 304 /* PropertyAssignment */: - return isContextSensitive(node.initializer); - case 218 /* ParenthesizedExpression */: - return isContextSensitive(node.expression); - case 293 /* JsxAttributes */: - return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive); - case 292 /* JsxAttribute */: { - const { initializer } = node; - return !!initializer && isContextSensitive(initializer); - } - case 295 /* JsxExpression */: { - const { expression } = node; - return !!expression && isContextSensitive(expression); - } - } - return false; - } - function isContextSensitiveFunctionLikeDeclaration(node) { - return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node); - } - function hasContextSensitiveReturnExpression(node) { - if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) { - return false; - } - if (node.body.kind !== 242 /* Block */) { - return isContextSensitive(node.body); - } - return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression)); - } - function isContextSensitiveFunctionOrObjectLiteralMethod(func) { - return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); - } - function getTypeWithoutSignatures(type) { - if (type.flags & 524288 /* Object */) { - const resolved = resolveStructuredTypeMembers(type); - if (resolved.constructSignatures.length || resolved.callSignatures.length) { - const result = createObjectType(16 /* Anonymous */, type.symbol); - result.members = resolved.members; - result.properties = resolved.properties; - result.callSignatures = emptyArray; - result.constructSignatures = emptyArray; - result.indexInfos = emptyArray; - return result; - } - } else if (type.flags & 2097152 /* Intersection */) { - return getIntersectionType(map(type.types, getTypeWithoutSignatures)); - } - return type; - } - function isTypeIdenticalTo(source, target) { - return isTypeRelatedTo(source, target, identityRelation); - } - function compareTypesIdentical(source, target) { - return isTypeRelatedTo(source, target, identityRelation) ? -1 /* True */ : 0 /* False */; - } - function compareTypesAssignable(source, target) { - return isTypeRelatedTo(source, target, assignableRelation) ? -1 /* True */ : 0 /* False */; - } - function compareTypesSubtypeOf(source, target) { - return isTypeRelatedTo(source, target, subtypeRelation) ? -1 /* True */ : 0 /* False */; - } - function isTypeSubtypeOf(source, target) { - return isTypeRelatedTo(source, target, subtypeRelation); - } - function isTypeStrictSubtypeOf(source, target) { - return isTypeRelatedTo(source, target, strictSubtypeRelation); - } - function isTypeAssignableTo(source, target) { - return isTypeRelatedTo(source, target, assignableRelation); - } - function isTypeDerivedFrom(source, target) { - return source.flags & 1048576 /* Union */ ? every(source.types, (t) => isTypeDerivedFrom(t, target)) : target.flags & 1048576 /* Union */ ? some(target.types, (t) => isTypeDerivedFrom(source, t)) : source.flags & 2097152 /* Intersection */ ? some(source.types, (t) => isTypeDerivedFrom(t, target)) : source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : isEmptyAnonymousObjectType(target) ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) && !isEmptyAnonymousObjectType(source) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)) || isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType); - } - function isTypeComparableTo(source, target) { - return isTypeRelatedTo(source, target, comparableRelation); - } - function areTypesComparable(type1, type2) { - return isTypeComparableTo(type1, type2) || isTypeComparableTo(type2, type1); - } - function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain, errorOutputObject) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject); - } - function checkTypeAssignableToAndOptionallyElaborate(source, target, errorNode, expr, headMessage, containingMessageChain) { - return checkTypeRelatedToAndOptionallyElaborate( - source, - target, - assignableRelation, - errorNode, - expr, - headMessage, - containingMessageChain, - /*errorOutputContainer*/ - void 0 - ); - } - function checkTypeRelatedToAndOptionallyElaborate(source, target, relation, errorNode, expr, headMessage, containingMessageChain, errorOutputContainer) { - if (isTypeRelatedTo(source, target, relation)) return true; - if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { - return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); - } - return false; - } - function isOrHasGenericConditional(type) { - return !!(type.flags & 16777216 /* Conditional */ || type.flags & 2097152 /* Intersection */ && some(type.types, isOrHasGenericConditional)); - } - function elaborateError(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) { - if (!node || isOrHasGenericConditional(target)) return false; - if (!checkTypeRelatedTo( - source, - target, - relation, - /*errorNode*/ - void 0 - ) && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { - return true; - } - switch (node.kind) { - case 235 /* AsExpression */: - if (!isConstAssertion(node)) { - break; - } - // fallthrough - case 295 /* JsxExpression */: - case 218 /* ParenthesizedExpression */: - return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 227 /* BinaryExpression */: - switch (node.operatorToken.kind) { - case 64 /* EqualsToken */: - case 28 /* CommaToken */: - return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - } - break; - case 211 /* ObjectLiteralExpression */: - return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 210 /* ArrayLiteralExpression */: - return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 293 /* JsxAttributes */: - return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 220 /* ArrowFunction */: - return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); - } - return false; - } - function elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) { - const callSignatures = getSignaturesOfType(source, 0 /* Call */); - const constructSignatures = getSignaturesOfType(source, 1 /* Construct */); - for (const signatures of [constructSignatures, callSignatures]) { - if (some(signatures, (s) => { - const returnType = getReturnTypeOfSignature(s); - return !(returnType.flags & (1 /* Any */ | 131072 /* Never */)) && checkTypeRelatedTo( - returnType, - target, - relation, - /*errorNode*/ - void 0 - ); - })) { - 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 - ) - ); - return true; - } - } - return false; - } - function elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (isBlock(node.body)) { - return false; - } - if (some(node.parameters, hasType)) { - return false; - } - const sourceSig = getSingleCallSignature(source); - if (!sourceSig) { - return false; - } - const targetSignatures = getSignaturesOfType(target, 0 /* Call */); - if (!length(targetSignatures)) { - return false; - } - const returnExpression = node.body; - const sourceReturn = getReturnTypeOfSignature(sourceSig); - const targetReturn = getUnionType(map(targetSignatures, getReturnTypeOfSignature)); - if (!checkTypeRelatedTo( - sourceReturn, - targetReturn, - relation, - /*errorNode*/ - void 0 - )) { - const elaborated = returnExpression && elaborateError( - returnExpression, - sourceReturn, - targetReturn, - relation, - /*headMessage*/ - void 0, - containingMessageChain, - errorOutputContainer - ); - if (elaborated) { - return elaborated; - } - const resultObj = errorOutputContainer || {}; - checkTypeRelatedTo( - sourceReturn, - targetReturn, - relation, - returnExpression, - /*headMessage*/ - void 0, - containingMessageChain, - resultObj - ); - 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 - ) - ); - } - if ((getFunctionFlags(node) & 2 /* Async */) === 0 && !getTypeOfPropertyOfType(sourceReturn, "then") && checkTypeRelatedTo( - createPromiseType(sourceReturn), - targetReturn, - relation, - /*errorNode*/ - void 0 - )) { - addRelatedInfo( - resultObj.errors[resultObj.errors.length - 1], - createDiagnosticForNode( - node, - Diagnostics.Did_you_mean_to_mark_this_function_as_async - ) - ); - } - return true; - } - } - return false; - } - function getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType) { - const idx = getIndexedAccessTypeOrUndefined(target, nameType); - if (idx) { - return idx; - } - if (target.flags & 1048576 /* Union */) { - const best = getBestMatchingType(source, target); - if (best) { - return getIndexedAccessTypeOrUndefined(best, nameType); - } - } - } - function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) { - pushContextualType( - next, - sourcePropType, - /*isCache*/ - false - ); - const result = checkExpressionForMutableLocation(next, 1 /* Contextual */); - popContextualType(); - return result; - } - function elaborateElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) { - let reportedError = false; - for (const value of iterator) { - const { errorNode: prop, innerExpression: next, nameType, errorMessage } = value; - let targetPropType = getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType); - if (!targetPropType || targetPropType.flags & 8388608 /* IndexedAccess */) continue; - let sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); - if (!sourcePropType) continue; - const propName = getPropertyNameFromIndex( - nameType, - /*accessNode*/ - void 0 - ); - if (!checkTypeRelatedTo( - sourcePropType, - targetPropType, - relation, - /*errorNode*/ - void 0 - )) { - const elaborated = next && elaborateError( - next, - sourcePropType, - targetPropType, - relation, - /*headMessage*/ - void 0, - containingMessageChain, - errorOutputContainer - ); - reportedError = true; - if (!elaborated) { - const resultObj = errorOutputContainer || {}; - const specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType; - if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) { - const diag2 = createDiagnosticForNode(prop, Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType)); - diagnostics.add(diag2); - resultObj.errors = [diag2]; - } else { - const targetIsOptional = !!(propName && (getPropertyOfType(target, propName) || unknownSymbol).flags & 16777216 /* Optional */); - const sourceIsOptional = !!(propName && (getPropertyOfType(source, propName) || unknownSymbol).flags & 16777216 /* Optional */); - targetPropType = removeMissingType(targetPropType, targetIsOptional); - sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional); - const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); - if (result && specificSource !== sourcePropType) { - checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); - } - } - if (resultObj.errors) { - const reportedDiag = resultObj.errors[resultObj.errors.length - 1]; - const propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0; - const targetProp = propertyName !== void 0 ? getPropertyOfType(target, propertyName) : void 0; - let issuedElaboration = false; - if (!targetProp) { - const indexInfo = getApplicableIndexInfo(target, nameType); - if (indexInfo && indexInfo.declaration && !getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) { - issuedElaboration = true; - addRelatedInfo(reportedDiag, createDiagnosticForNode(indexInfo.declaration, Diagnostics.The_expected_type_comes_from_this_index_signature)); - } - } - 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) - ) - ); - } - } - } - } - } - } - return reportedError; - } - function elaborateIterableOrArrayLikeTargetElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) { - const tupleOrArrayLikeTargetParts = filterType(target, isArrayOrTupleLikeType); - const nonTupleOrArrayLikeTargetParts = filterType(target, (t) => !isArrayOrTupleLikeType(t)); - const iterationType = nonTupleOrArrayLikeTargetParts !== neverType ? getIterationTypeOfIterable( - 13 /* ForOf */, - 0 /* Yield */, - nonTupleOrArrayLikeTargetParts, - /*errorNode*/ - void 0 - ) : void 0; - let reportedError = false; - for (let status = iterator.next(); !status.done; status = iterator.next()) { - const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status.value; - let targetPropType = iterationType; - const targetIndexedPropType = tupleOrArrayLikeTargetParts !== neverType ? getBestMatchIndexedAccessTypeOrUndefined(source, tupleOrArrayLikeTargetParts, nameType) : void 0; - if (targetIndexedPropType && !(targetIndexedPropType.flags & 8388608 /* IndexedAccess */)) { - targetPropType = iterationType ? getUnionType([iterationType, targetIndexedPropType]) : targetIndexedPropType; - } - if (!targetPropType) continue; - let sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); - if (!sourcePropType) continue; - const propName = getPropertyNameFromIndex( - nameType, - /*accessNode*/ - void 0 - ); - if (!checkTypeRelatedTo( - sourcePropType, - targetPropType, - relation, - /*errorNode*/ - void 0 - )) { - const elaborated = next && elaborateError( - next, - sourcePropType, - targetPropType, - relation, - /*headMessage*/ - void 0, - containingMessageChain, - errorOutputContainer - ); - reportedError = true; - if (!elaborated) { - const resultObj = errorOutputContainer || {}; - const specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType; - if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) { - const diag2 = createDiagnosticForNode(prop, Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType)); - diagnostics.add(diag2); - resultObj.errors = [diag2]; - } else { - const targetIsOptional = !!(propName && (getPropertyOfType(tupleOrArrayLikeTargetParts, propName) || unknownSymbol).flags & 16777216 /* Optional */); - const sourceIsOptional = !!(propName && (getPropertyOfType(source, propName) || unknownSymbol).flags & 16777216 /* Optional */); - targetPropType = removeMissingType(targetPropType, targetIsOptional); - sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional); - const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); - if (result && specificSource !== sourcePropType) { - checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); - } - } - } - } - } - return reportedError; - } - function* generateJsxAttributes(node) { - if (!length(node.properties)) return; - for (const prop of node.properties) { - if (isJsxSpreadAttribute(prop) || isHyphenatedJsxName(getTextOfJsxAttributeName(prop.name))) continue; - yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: getStringLiteralType(getTextOfJsxAttributeName(prop.name)) }; - } - } - function* generateJsxChildren(node, getInvalidTextDiagnostic) { - if (!length(node.children)) return; - let memberOffset = 0; - for (let i = 0; i < node.children.length; i++) { - const child = node.children[i]; - const nameType = getNumberLiteralType(i - memberOffset); - const elem = getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic); - if (elem) { - yield elem; - } else { - memberOffset++; - } - } - } - function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { - switch (child.kind) { - case 295 /* 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 285 /* JsxElement */: - case 286 /* JsxSelfClosingElement */: - case 289 /* JsxFragment */: - return { errorNode: child, innerExpression: child, nameType }; - default: - return Debug.assertNever(child, "Found invalid jsx child"); - } - } - function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { - let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); - let invalidTextDiagnostic; - if (isJsxOpeningElement(node.parent) && isJsxElement(node.parent.parent)) { - const containingElement = node.parent.parent; - const childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); - const childrenPropName = childPropName === void 0 ? "children" : unescapeLeadingUnderscores(childPropName); - const childrenNameType = getStringLiteralType(childrenPropName); - const childrenTargetType = getIndexedAccessType(target, childrenNameType); - const validChildren = getSemanticJsxChildren(containingElement.children); - if (!length(validChildren)) { - return result; - } - const moreThanOneRealChildren = length(validChildren) > 1; - let arrayLikeTargetParts; - let nonArrayLikeTargetParts; - const iterableType = getGlobalIterableType( - /*reportErrors*/ - false - ); - if (iterableType !== emptyGenericType) { - const anyIterable = createIterableType(anyType); - arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable)); - nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable)); - } else { - arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType); - nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t)); - } - if (moreThanOneRealChildren) { - if (arrayLikeTargetParts !== neverType) { - const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */)); - const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic); - result = elaborateIterableOrArrayLikeTargetElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result; - } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { - result = true; - 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, - typeToString(childrenTargetType) - ); - if (errorOutputContainer && errorOutputContainer.skipLogging) { - (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); - } - } - } else { - if (nonArrayLikeTargetParts !== neverType) { - const child = validChildren[0]; - const elem = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic); - if (elem) { - result = elaborateElementwise( - function* () { - yield elem; - }(), - source, - target, - relation, - containingMessageChain, - errorOutputContainer - ) || result; - } - } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { - result = true; - 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, - typeToString(childrenTargetType) - ); - if (errorOutputContainer && errorOutputContainer.skipLogging) { - (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); - } - } - } - } - return result; - function getInvalidTextualChildDiagnostic() { - if (!invalidTextDiagnostic) { - const tagNameText = getTextOfNode(node.parent.tagName); - const childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); - 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(diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) }; - } - return invalidTextDiagnostic; - } - } - function* generateLimitedTupleElements(node, target) { - const len = length(node.elements); - if (!len) return; - for (let i = 0; i < len; i++) { - if (isTupleLikeType(target) && !getPropertyOfType(target, "" + i)) continue; - const elem = node.elements[i]; - if (isOmittedExpression(elem)) continue; - const nameType = getNumberLiteralType(i); - const checkNode = getEffectiveCheckNode(elem); - yield { errorNode: checkNode, innerExpression: checkNode, nameType }; - } - } - function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (402784252 /* Primitive */ | 131072 /* Never */)) return false; - if (isTupleLikeType(source)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); - } - pushContextualType( - node, - target, - /*isCache*/ - false - ); - const tupleizedType = checkArrayLiteral( - node, - 1 /* Contextual */, - /*forceTuple*/ - true - ); - popContextualType(); - if (isTupleLikeType(tupleizedType)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, containingMessageChain, errorOutputContainer); - } - return false; - } - function* generateObjectLiteralElements(node) { - if (!length(node.properties)) return; - for (const prop of node.properties) { - if (isSpreadAssignment(prop)) continue; - const type = getLiteralTypeFromProperty(getSymbolOfDeclaration(prop), 8576 /* StringOrNumberLiteralOrUnique */); - if (!type || type.flags & 131072 /* Never */) { - continue; - } - switch (prop.kind) { - case 179 /* SetAccessor */: - case 178 /* GetAccessor */: - case 175 /* MethodDeclaration */: - case 305 /* ShorthandPropertyAssignment */: - yield { errorNode: prop.name, innerExpression: void 0, nameType: type }; - break; - case 304 /* 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: - Debug.assertNever(prop); - } - } - } - function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { - if (target.flags & (402784252 /* Primitive */ | 131072 /* Never */)) return false; - return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); - } - function checkTypeComparableTo(source, target, errorNode, headMessage, containingMessageChain) { - return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); - } - function isSignatureAssignableTo(source, target, ignoreReturnTypes) { - return compareSignaturesRelated( - source, - target, - ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0 /* None */, - /*reportErrors*/ - false, - /*errorReporter*/ - void 0, - /*incompatibleErrorReporter*/ - void 0, - compareTypesAssignable, - /*reportUnreliableMarkers*/ - void 0 - ) !== 0 /* False */; - } - function isTopSignature(s) { - if (!s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s)) { - const paramType = getTypeOfParameter(s.parameters[0]); - const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType; - return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */); - } - return false; - } - function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) { - if (source === target) { - return -1 /* True */; - } - if (!(checkMode & 16 /* StrictTopSignature */ && isTopSignature(source)) && isTopSignature(target)) { - return -1 /* True */; - } - if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) { - return 0 /* False */; - } - const targetCount = getParameterCount(target); - const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); - if (sourceHasMoreParameters) { - if (reportErrors2 && !(checkMode & 8 /* StrictArity */)) { - errorReporter(Diagnostics.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1, getMinArgumentCount(source), targetCount); - } - return 0 /* False */; - } - if (source.typeParameters && source.typeParameters !== target.typeParameters) { - target = getCanonicalSignature(target); - source = instantiateSignatureInContextOf( - source, - target, - /*inferenceContext*/ - void 0, - compareTypes - ); - } - const sourceCount = getParameterCount(source); - const sourceRestType = getNonArrayRestType(source); - const targetRestType = getNonArrayRestType(target); - if (sourceRestType || targetRestType) { - void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers); - } - const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 175 /* MethodDeclaration */ && kind !== 174 /* MethodSignature */ && kind !== 177 /* Constructor */; - let result = -1 /* True */; - const sourceThisType = getThisTypeOfSignature(source); - if (sourceThisType && sourceThisType !== voidType) { - const targetThisType = getThisTypeOfSignature(target); - if (targetThisType) { - const related = !strictVariance && compareTypes( - sourceThisType, - targetThisType, - /*reportErrors*/ - false - ) || compareTypes(targetThisType, sourceThisType, reportErrors2); - if (!related) { - if (reportErrors2) { - errorReporter(Diagnostics.The_this_types_of_each_signature_are_incompatible); - } - return 0 /* False */; - } - result &= related; - } - } - 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 ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i); - const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i); - if (sourceType && targetType && (sourceType !== targetType || checkMode & 8 /* StrictArity */)) { - 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, - /*reportErrors*/ - false - ) || compareTypes(targetType, sourceType, reportErrors2); - if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes( - sourceType, - targetType, - /*reportErrors*/ - false - )) { - related = 0 /* False */; - } - if (!related) { - if (reportErrors2) { - errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); - } - return 0 /* False */; - } - result &= related; - } - } - if (!(checkMode & 4 /* IgnoreReturnTypes */)) { - const targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType : target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(target.declaration.symbol)) : getReturnTypeOfSignature(target); - if (targetReturnType === voidType || targetReturnType === anyType) { - return result; - } - const sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType : source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(source.declaration.symbol)) : getReturnTypeOfSignature(source); - const targetTypePredicate = getTypePredicateOfSignature(target); - if (targetTypePredicate) { - const sourceTypePredicate = getTypePredicateOfSignature(source); - if (sourceTypePredicate) { - result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, reportErrors2, errorReporter, compareTypes); - } else if (isIdentifierTypePredicate(targetTypePredicate) || isThisTypePredicate(targetTypePredicate)) { - if (reportErrors2) { - errorReporter(Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); - } - return 0 /* False */; - } - } else { - result &= checkMode & 1 /* BivariantCallback */ && compareTypes( - targetReturnType, - sourceReturnType, - /*reportErrors*/ - false - ) || compareTypes(sourceReturnType, targetReturnType, reportErrors2); - if (!result && reportErrors2 && incompatibleErrorReporter) { - incompatibleErrorReporter(sourceReturnType, targetReturnType); - } - } - } - return result; - } - function compareTypePredicateRelatedTo(source, target, reportErrors2, errorReporter, compareTypes) { - if (source.kind !== target.kind) { - if (reportErrors2) { - errorReporter(Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); - errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); - } - return 0 /* False */; - } - if (source.kind === 1 /* Identifier */ || source.kind === 3 /* AssertsIdentifier */) { - if (source.parameterIndex !== target.parameterIndex) { - if (reportErrors2) { - errorReporter(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, target.parameterName); - errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); - } - return 0 /* False */; - } - } - const related = source.type === target.type ? -1 /* True */ : source.type && target.type ? compareTypes(source.type, target.type, reportErrors2) : 0 /* False */; - if (related === 0 /* False */ && reportErrors2) { - errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); - } - return related; - } - function isImplementationCompatibleWithOverload(implementation, overload) { - const erasedSource = getErasedSignature(implementation); - const erasedTarget = getErasedSignature(overload); - const sourceReturnType = getReturnTypeOfSignature(erasedSource); - const targetReturnType = getReturnTypeOfSignature(erasedTarget); - if (targetReturnType === voidType || isTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation) || isTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation)) { - return isSignatureAssignableTo( - erasedSource, - erasedTarget, - /*ignoreReturnTypes*/ - true - ); - } - return false; - } - function isEmptyResolvedType(t) { - return t !== anyFunctionType && t.properties.length === 0 && t.callSignatures.length === 0 && t.constructSignatures.length === 0 && t.indexInfos.length === 0; - } - function isEmptyObjectType(type) { - return type.flags & 524288 /* Object */ ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(type)) : type.flags & 67108864 /* NonPrimitive */ ? true : type.flags & 1048576 /* Union */ ? some(type.types, isEmptyObjectType) : type.flags & 2097152 /* Intersection */ ? every(type.types, isEmptyObjectType) : false; - } - function isEmptyAnonymousObjectType(type) { - return !!(getObjectFlags(type) & 16 /* Anonymous */ && (type.members && isEmptyResolvedType(type) || type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && getMembersOfSymbol(type.symbol).size === 0)); - } - function isUnknownLikeUnionType(type) { - if (strictNullChecks && type.flags & 1048576 /* Union */) { - if (!(type.objectFlags & 33554432 /* IsUnknownLikeUnionComputed */)) { - const types = type.types; - type.objectFlags |= 33554432 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 67108864 /* IsUnknownLikeUnion */ : 0); - } - return !!(type.objectFlags & 67108864 /* IsUnknownLikeUnion */); - } - return false; - } - function containsUndefinedType(type) { - return !!((type.flags & 1048576 /* Union */ ? type.types[0] : type).flags & 32768 /* Undefined */); - } - function containsNonMissingUndefinedType(type) { - const candidate = type.flags & 1048576 /* Union */ ? type.types[0] : type; - return !!(candidate.flags & 32768 /* Undefined */) && candidate !== missingType; - } - function isStringIndexSignatureOnlyType(type) { - return type.flags & 524288 /* Object */ && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, stringType) || type.flags & 3145728 /* UnionOrIntersection */ && every(type.types, isStringIndexSignatureOnlyType) || false; - } - function isEnumTypeRelatedTo(source, target, errorReporter) { - const sourceSymbol = source.flags & 8 /* EnumMember */ ? getParentOfSymbol(source) : source; - const targetSymbol = target.flags & 8 /* EnumMember */ ? getParentOfSymbol(target) : target; - if (sourceSymbol === targetSymbol) { - return true; - } - if (sourceSymbol.escapedName !== targetSymbol.escapedName || !(sourceSymbol.flags & 256 /* RegularEnum */) || !(targetSymbol.flags & 256 /* RegularEnum */)) { - return false; - } - const id = getSymbolId(sourceSymbol) + "," + getSymbolId(targetSymbol); - const entry = enumRelation.get(id); - if (entry !== void 0 && !(entry & 2 /* Failed */ && errorReporter)) { - return !!(entry & 1 /* Succeeded */); - } - const targetEnumType = getTypeOfSymbol(targetSymbol); - 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(sourceProperty), typeToString( - getDeclaredTypeOfSymbol(targetSymbol), - /*enclosingDeclaration*/ - void 0, - 64 /* UseFullyQualifiedType */ - )); - } - enumRelation.set(id, 2 /* Failed */); - return false; - } - const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 307 /* EnumMember */)).value; - const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 307 /* EnumMember */)).value; - if (sourceValue !== targetValue) { - const sourceIsString = typeof sourceValue === "string"; - const targetIsString = typeof targetValue === "string"; - if (sourceValue !== void 0 && targetValue !== void 0) { - if (errorReporter) { - 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 */); - return false; - } - if (sourceIsString || targetIsString) { - if (errorReporter) { - 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 */); - return false; - } - } - } - } - enumRelation.set(id, 1 /* Succeeded */); - return true; - } - function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { - const s = source.flags; - const t = target.flags; - if (t & 1 /* Any */ || s & 131072 /* Never */ || source === wildcardType) return true; - if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */)) return true; - if (t & 131072 /* Never */) return false; - if (s & 402653316 /* StringLike */ && t & 4 /* String */) return true; - if (s & 128 /* StringLiteral */ && s & 1024 /* EnumLiteral */ && t & 128 /* StringLiteral */ && !(t & 1024 /* EnumLiteral */) && source.value === target.value) return true; - if (s & 296 /* NumberLike */ && t & 8 /* Number */) return true; - if (s & 256 /* NumberLiteral */ && s & 1024 /* EnumLiteral */ && t & 256 /* NumberLiteral */ && !(t & 1024 /* EnumLiteral */) && source.value === target.value) return true; - if (s & 2112 /* BigIntLike */ && t & 64 /* BigInt */) return true; - if (s & 528 /* BooleanLike */ && t & 16 /* Boolean */) return true; - if (s & 12288 /* ESSymbolLike */ && t & 4096 /* ESSymbol */) return true; - if (s & 32 /* Enum */ && t & 32 /* Enum */ && source.symbol.escapedName === target.symbol.escapedName && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) return true; - if (s & 1024 /* EnumLiteral */ && t & 1024 /* EnumLiteral */) { - if (s & 1048576 /* Union */ && t & 1048576 /* Union */ && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) return true; - if (s & 2944 /* Literal */ && t & 2944 /* Literal */ && source.value === target.value && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) return true; - } - if (s & 32768 /* Undefined */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & (32768 /* Undefined */ | 16384 /* Void */))) return true; - if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */)) return true; - if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 8192 /* FreshLiteral */))) return true; - if (relation === assignableRelation || relation === comparableRelation) { - if (s & 1 /* Any */) return true; - if (s & 8 /* Number */ && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */)) return true; - if (s & 256 /* NumberLiteral */ && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */ && source.value === target.value)) return true; - if (isUnknownLikeUnionType(target)) return true; - } - return false; - } - function isTypeRelatedTo(source, target, relation) { - if (isFreshLiteralType(source)) { - source = source.regularType; - } - if (isFreshLiteralType(target)) { - target = target.regularType; - } - if (source === target) { - return true; - } - if (relation !== identityRelation) { - if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation)) { - return true; - } - } else if (!((source.flags | target.flags) & (3145728 /* UnionOrIntersection */ | 8388608 /* IndexedAccess */ | 16777216 /* Conditional */ | 33554432 /* Substitution */))) { - if (source.flags !== target.flags) return false; - if (source.flags & 67358815 /* Singleton */) return true; - } - if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { - const related = relation.get(getRelationKey( - source, - target, - 0 /* None */, - relation, - /*ignoreConstraints*/ - false - )); - if (related !== void 0) { - return !!(related & 1 /* Succeeded */); - } - } - if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) { - return checkTypeRelatedTo( - source, - target, - relation, - /*errorNode*/ - void 0 - ); - } - return false; - } - function isIgnoredJsxProperty(source, sourceProp) { - return getObjectFlags(source) & 2048 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName); - } - function getNormalizedType(type, writing) { - while (true) { - const t = isFreshLiteralType(type) ? type.regularType : isGenericTupleType(type) ? getNormalizedTupleType(type, writing) : getObjectFlags(type) & 4 /* Reference */ ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type : type.flags & 3145728 /* UnionOrIntersection */ ? getNormalizedUnionOrIntersectionType(type, writing) : type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : getSubstitutionIntersection(type) : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type; - if (t === type) return t; - type = t; - } - } - function getNormalizedUnionOrIntersectionType(type, writing) { - const reduced = getReducedType(type); - if (reduced !== type) { - return reduced; - } - if (type.flags & 2097152 /* Intersection */ && shouldNormalizeIntersection(type)) { - const normalizedTypes = sameMap(type.types, (t) => getNormalizedType(t, writing)); - if (normalizedTypes !== type.types) { - return getIntersectionType(normalizedTypes); - } - } - return type; - } - function shouldNormalizeIntersection(type) { - let hasInstantiable = false; - let hasNullableOrEmpty = false; - for (const t of type.types) { - hasInstantiable || (hasInstantiable = !!(t.flags & 465829888 /* Instantiable */)); - hasNullableOrEmpty || (hasNullableOrEmpty = !!(t.flags & 98304 /* Nullable */) || isEmptyAnonymousObjectType(t)); - if (hasInstantiable && hasNullableOrEmpty) return true; - } - return false; - } - function getNormalizedTupleType(type, writing) { - const elements = getElementTypes(type); - const normalizedElements = sameMap(elements, (t) => t.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(t, writing) : t); - return elements !== normalizedElements ? createNormalizedTupleType(type.target, normalizedElements) : type; - } - function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) { - var _a; - let errorInfo; - let relatedInfo; - let maybeKeys; - let maybeKeysSet; - let sourceStack; - let targetStack; - let maybeCount = 0; - let sourceDepth = 0; - let targetDepth = 0; - 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, - target, - 3 /* Both */, - /*reportErrors*/ - !!errorNode, - headMessage - ); - if (incompatibleStack) { - reportIncompatibleStack(); - } - if (overflow) { - const id = getRelationKey( - source, - target, - /*intersectionState*/ - 0 /* None */, - relation, - /*ignoreConstraints*/ - false - ); - relation.set(id, 2 /* Failed */ | (relationCount <= 0 ? 32 /* ComplexityOverflow */ : 64 /* StackDepthOverflow */)); - (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth }); - 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); - } - } else if (errorInfo) { - if (containingMessageChain) { - const chain = containingMessageChain(); - if (chain) { - concatenateDiagnosticMessageChains(chain, errorInfo); - errorInfo = chain; - } - } - let relatedInformation; - if (headMessage && errorNode && !result && source.symbol) { - const links = getSymbolLinks(source.symbol); - if (links.originatingImport && !isImportCall(links.originatingImport)) { - const helpfulRetry = checkTypeRelatedTo( - getTypeOfSymbol(links.target), - target, - relation, - /*errorNode*/ - void 0 - ); - if (helpfulRetry) { - const diag3 = createDiagnosticForNode(links.originatingImport, 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); - relatedInformation = append(relatedInformation, diag3); - } - } - } - const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, errorInfo, relatedInformation); - if (relatedInfo) { - addRelatedInfo(diag2, ...relatedInfo); - } - if (errorOutputContainer) { - (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); - } - if (!errorOutputContainer || !errorOutputContainer.skipLogging) { - diagnostics.add(diag2); - } - } - if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === 0 /* False */) { - Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error."); - } - return result !== 0 /* False */; - function resetErrorInfo(saved) { - errorInfo = saved.errorInfo; - lastSkippedInfo = saved.lastSkippedInfo; - incompatibleStack = saved.incompatibleStack; - overrideNextErrorInfo = saved.overrideNextErrorInfo; - skipParentCounter = saved.skipParentCounter; - relatedInfo = saved.relatedInfo; - } - function captureErrorCalculationState() { - return { - errorInfo, - lastSkippedInfo, - incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(), - overrideNextErrorInfo, - skipParentCounter, - relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice() - }; - } - function reportIncompatibleError(message, ...args) { - overrideNextErrorInfo++; - lastSkippedInfo = void 0; - (incompatibleStack || (incompatibleStack = [])).push([message, ...args]); - } - function reportIncompatibleStack() { - const stack = incompatibleStack || []; - incompatibleStack = void 0; - const info = lastSkippedInfo; - lastSkippedInfo = void 0; - if (stack.length === 1) { - reportError(...stack[0]); - if (info) { - reportRelationError( - /*message*/ - void 0, - ...info - ); - } - return; - } - let path = ""; - const secondaryRootErrors = []; - while (stack.length) { - const [msg, ...args] = stack.pop(); - switch (msg.code) { - case Diagnostics.Types_of_property_0_are_incompatible.code: { - if (path.indexOf("new ") === 0) { - path = `(${path})`; - } - const str = "" + args[0]; - if (path.length === 0) { - path = `${str}`; - } else if (isIdentifierText(str, getEmitScriptTarget(compilerOptions))) { - path = `${path}.${str}`; - } else if (str[0] === "[" && str[str.length - 1] === "]") { - path = `${path}${str}`; - } else { - path = `${path}[${str}]`; - } - break; - } - case Diagnostics.Call_signature_return_types_0_and_1_are_incompatible.code: - case Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code: - case Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: - case Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: { - if (path.length === 0) { - let mappedMsg = msg; - if (msg.code === Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) { - mappedMsg = Diagnostics.Call_signature_return_types_0_and_1_are_incompatible; - } else if (msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) { - mappedMsg = Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible; - } - secondaryRootErrors.unshift([mappedMsg, args[0], args[1]]); - } else { - const prefix = msg.code === Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code || msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "new " : ""; - const params = msg.code === Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code || msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "" : "..."; - path = `${prefix}${path}(${params})`; - } - break; - } - case Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code: { - secondaryRootErrors.unshift([Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, args[0], args[1]]); - break; - } - case Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code: { - secondaryRootErrors.unshift([Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, args[0], args[1], args[2]]); - break; - } - default: - return Debug.fail(`Unhandled Diagnostic: ${msg.code}`); - } - } - if (path) { - reportError( - path[path.length - 1] === ")" ? Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types : Diagnostics.The_types_of_0_are_incompatible_between_these_types, - path - ); - } else { - secondaryRootErrors.shift(); - } - for (const [msg, ...args] of secondaryRootErrors) { - const originalValue = msg.elidedInCompatabilityPyramid; - msg.elidedInCompatabilityPyramid = false; - reportError(msg, ...args); - msg.elidedInCompatabilityPyramid = originalValue; - } - if (info) { - reportRelationError( - /*message*/ - void 0, - ...info - ); - } - } - function reportError(message, ...args) { - Debug.assert(!!errorNode); - if (incompatibleStack) reportIncompatibleStack(); - if (message.elidedInCompatabilityPyramid) return; - if (skipParentCounter === 0) { - errorInfo = chainDiagnosticMessages(errorInfo, message, ...args); - } else { - skipParentCounter--; - } - } - function reportParentSkippedError(message, ...args) { - reportError(message, ...args); - skipParentCounter++; - } - function associateRelatedInfo(info) { - Debug.assert(!!errorInfo); - if (!relatedInfo) { - relatedInfo = [info]; - } else { - relatedInfo.push(info); - } - } - function reportRelationError(message, source2, target2) { - if (incompatibleStack) reportIncompatibleStack(); - const [sourceType, targetType] = getTypeNamesForErrorDisplay(source2, target2); - let generalizedSource = source2; - let generalizedSourceType = sourceType; - if (!(target2.flags & 131072 /* Never */) && isLiteralType(source2) && !typeCouldHaveTopLevelSingletonTypes(target2)) { - generalizedSource = getBaseTypeOfLiteralType(source2); - Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable"); - generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource); - } - const targetFlags = target2.flags & 8388608 /* IndexedAccess */ && !(source2.flags & 8388608 /* IndexedAccess */) ? target2.objectType.flags : target2.flags; - if (targetFlags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { - const constraint = getBaseConstraintOfType(target2); - let needsOriginalSource; - if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) { - reportError( - Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, - needsOriginalSource ? sourceType : generalizedSourceType, - targetType, - typeToString(constraint) - ); - } else { - errorInfo = void 0; - reportError( - Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, - targetType, - generalizedSourceType - ); - } - } - if (!message) { - if (relation === comparableRelation) { - message = Diagnostics.Type_0_is_not_comparable_to_type_1; - } else if (sourceType === targetType) { - message = Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated; - } else if (exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source2, target2).length) { - message = Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties; - } else { - if (source2.flags & 128 /* StringLiteral */ && target2.flags & 1048576 /* Union */) { - const suggestedType = getSuggestedTypeForNonexistentStringLiteralType(source2, target2); - if (suggestedType) { - reportError(Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, generalizedSourceType, targetType, typeToString(suggestedType)); - return; - } - } - message = Diagnostics.Type_0_is_not_assignable_to_type_1; - } - } else if (message === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1 && exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source2, target2).length) { - message = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties; - } - reportError(message, generalizedSourceType, targetType); - } - function tryElaborateErrorsForPrimitivesAndObjects(source2, target2) { - const sourceType = symbolValueDeclarationIsContextSensitive(source2.symbol) ? typeToString(source2, source2.symbol.valueDeclaration) : typeToString(source2); - const targetType = symbolValueDeclarationIsContextSensitive(target2.symbol) ? typeToString(target2, target2.symbol.valueDeclaration) : typeToString(target2); - if (globalStringType === source2 && stringType === target2 || globalNumberType === source2 && numberType === target2 || globalBooleanType === source2 && booleanType === target2 || getGlobalESSymbolType() === source2 && esSymbolType === target2) { - reportError(Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); - } - } - function tryElaborateArrayLikeErrors(source2, target2, reportErrors2) { - if (isTupleType(source2)) { - if (source2.target.readonly && isMutableArrayOrTuple(target2)) { - if (reportErrors2) { - reportError(Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source2), typeToString(target2)); - } - return false; - } - return isArrayOrTupleType(target2); - } - if (isReadonlyArrayType(source2) && isMutableArrayOrTuple(target2)) { - if (reportErrors2) { - reportError(Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source2), typeToString(target2)); - } - return false; - } - if (isTupleType(target2)) { - return isArrayType(source2); - } - return true; - } - function isRelatedToWorker(source2, target2, reportErrors2) { - return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2); - } - function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) { - if (originalSource === originalTarget) return -1 /* True */; - if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 402784252 /* Primitive */) { - if (relation === comparableRelation && !(originalTarget.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(originalTarget, originalSource, relation) || isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors2 ? reportError : void 0)) { - return -1 /* True */; - } - if (reportErrors2) { - reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage2); - } - return 0 /* False */; - } - const source2 = getNormalizedType( - originalSource, - /*writing*/ - false - ); - let target2 = getNormalizedType( - originalTarget, - /*writing*/ - true - ); - if (source2 === target2) return -1 /* True */; - if (relation === identityRelation) { - if (source2.flags !== target2.flags) return 0 /* False */; - if (source2.flags & 67358815 /* Singleton */) return -1 /* True */; - traceUnionsOrIntersectionsTooLarge(source2, target2); - return recursiveTypeRelatedTo( - source2, - target2, - /*reportErrors*/ - false, - 0 /* None */, - recursionFlags - ); - } - if (source2.flags & 262144 /* TypeParameter */ && getConstraintOfType(source2) === target2) { - return -1 /* True */; - } - if (source2.flags & 470302716 /* DefinitelyNonNullable */ && target2.flags & 1048576 /* Union */) { - const types = target2.types; - const candidate = types.length === 2 && types[0].flags & 98304 /* Nullable */ ? types[1] : types.length === 3 && types[0].flags & 98304 /* Nullable */ && types[1].flags & 98304 /* Nullable */ ? types[2] : void 0; - if (candidate && !(candidate.flags & 98304 /* Nullable */)) { - target2 = getNormalizedType( - candidate, - /*writing*/ - true - ); - if (source2 === target2) return -1 /* True */; - } - } - if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0)) return -1 /* True */; - if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) { - const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */); - if (isPerformingExcessPropertyChecks) { - if (hasExcessProperties(source2, target2, reportErrors2)) { - if (reportErrors2) { - reportRelationError(headMessage2, source2, originalTarget.aliasSymbol ? originalTarget : target2); - } - return 0 /* False */; - } - } - const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (402784252 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2)); - const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */); - if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) { - if (reportErrors2) { - const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2); - const targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target2); - const calls = getSignaturesOfType(source2, 0 /* Call */); - const constructs = getSignaturesOfType(source2, 1 /* Construct */); - if (calls.length > 0 && isRelatedTo( - getReturnTypeOfSignature(calls[0]), - target2, - 1 /* Source */, - /*reportErrors*/ - false - ) || constructs.length > 0 && isRelatedTo( - getReturnTypeOfSignature(constructs[0]), - target2, - 1 /* Source */, - /*reportErrors*/ - false - )) { - reportError(Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString); - } else { - reportError(Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString); - } - } - return 0 /* False */; - } - traceUnionsOrIntersectionsTooLarge(source2, target2); - const skipCaching = source2.flags & 1048576 /* Union */ && source2.types.length < 4 && !(target2.flags & 1048576 /* Union */) || target2.flags & 1048576 /* Union */ && target2.types.length < 4 && !(source2.flags & 469499904 /* StructuredOrInstantiable */); - const result2 = skipCaching ? unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) : recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags); - if (result2) { - return result2; - } - } - if (reportErrors2) { - reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2); - } - return 0 /* False */; - } - function reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2) { - var _a2, _b; - const sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource); - const targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget); - source2 = originalSource.aliasSymbol || sourceHasBase ? originalSource : source2; - target2 = originalTarget.aliasSymbol || targetHasBase ? originalTarget : target2; - let maybeSuppress = overrideNextErrorInfo > 0; - if (maybeSuppress) { - overrideNextErrorInfo--; - } - if (source2.flags & 524288 /* Object */ && target2.flags & 524288 /* Object */) { - const currentError = errorInfo; - tryElaborateArrayLikeErrors( - source2, - target2, - /*reportErrors*/ - true - ); - if (errorInfo !== currentError) { - maybeSuppress = !!errorInfo; - } - } - if (source2.flags & 524288 /* Object */ && target2.flags & 402784252 /* Primitive */) { - tryElaborateErrorsForPrimitivesAndObjects(source2, target2); - } else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) { - reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); - } else if (getObjectFlags(source2) & 2048 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) { - const targetTypes = target2.types; - const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode); - const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode); - if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) && (contains(targetTypes, intrinsicAttributes) || contains(targetTypes, intrinsicClassAttributes))) { - return; - } - } else { - errorInfo = elaborateNeverIntersection(errorInfo, originalTarget); - } - if (!headMessage2 && maybeSuppress) { - const savedErrorState = captureErrorCalculationState(); - reportRelationError(headMessage2, source2, target2); - let canonical; - if (errorInfo && errorInfo !== savedErrorState.errorInfo) { - canonical = { code: errorInfo.code, messageText: errorInfo.messageText }; - } - resetErrorInfo(savedErrorState); - if (canonical && errorInfo) { - errorInfo.canonicalHead = canonical; - } - lastSkippedInfo = [source2, target2]; - return; - } - reportRelationError(headMessage2, source2, target2); - if (source2.flags & 262144 /* TypeParameter */ && ((_b = (_a2 = source2.symbol) == null ? void 0 : _a2.declarations) == null ? void 0 : _b[0]) && !getConstraintOfType(source2)) { - const syntheticParam = cloneTypeParameter(source2); - syntheticParam.constraint = instantiateType(target2, makeUnaryTypeMapper(source2, syntheticParam)); - if (hasNonCircularBaseConstraint(syntheticParam)) { - const targetConstraintString = typeToString(target2, source2.symbol.declarations[0]); - associateRelatedInfo(createDiagnosticForNode(source2.symbol.declarations[0], Diagnostics.This_type_parameter_might_need_an_extends_0_constraint, targetConstraintString)); - } - } - } - function traceUnionsOrIntersectionsTooLarge(source2, target2) { - if (!tracing) { - return; - } - if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) { - const sourceUnionOrIntersection = source2; - const targetUnionOrIntersection = target2; - if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768 /* PrimitiveUnion */) { - return; - } - const sourceSize = sourceUnionOrIntersection.types.length; - const targetSize = targetUnionOrIntersection.types.length; - if (sourceSize * targetSize > 1e6) { - tracing.instant(tracing.Phase.CheckTypes, "traceUnionsOrIntersectionsTooLarge_DepthLimit", { - sourceId: source2.id, - sourceSize, - targetId: target2.id, - targetSize, - pos: errorNode == null ? void 0 : errorNode.pos, - end: errorNode == null ? void 0 : errorNode.end - }); - } - } - } - function getTypeOfPropertyInTypes(types, name) { - const appendPropType = (propTypes, type) => { - var _a2; - type = getApparentType(type); - const prop = type.flags & 3145728 /* UnionOrIntersection */ ? getPropertyOfUnionOrIntersectionType(type, name) : getPropertyOfObjectType(type, name); - const propType = prop && getTypeOfSymbol(prop) || ((_a2 = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a2.type) || undefinedType; - return append(propTypes, propType); - }; - return getUnionType(reduceLeft( - types, - appendPropType, - /*initial*/ - void 0 - ) || emptyArray); - } - function hasExcessProperties(source2, target2, reportErrors2) { - var _a2; - if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) { - return false; - } - const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */); - if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) { - return false; - } - let reducedTarget = target2; - let checkTypes; - if (target2.flags & 1048576 /* Union */) { - reducedTarget = findMatchingDiscriminantType(source2, target2, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target2); - checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget]; - } - for (const prop of getPropertiesOfType(source2)) { - if (shouldCheckAsExcessProperty(prop, source2.symbol) && !isIgnoredJsxProperty(source2, prop)) { - if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { - if (reportErrors2) { - const errorTarget = filterType(reducedTarget, isExcessPropertyCheckTarget); - if (!errorNode) return Debug.fail(); - if (isJsxAttributes(errorNode) || isJsxOpeningLikeElement(errorNode) || isJsxOpeningLikeElement(errorNode.parent)) { - if (prop.valueDeclaration && isJsxAttribute(prop.valueDeclaration) && getSourceFileOfNode(errorNode) === getSourceFileOfNode(prop.valueDeclaration.name)) { - errorNode = prop.valueDeclaration.name; - } - const propName = symbolToString(prop); - const suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName, errorTarget); - const suggestion = suggestionSymbol ? symbolToString(suggestionSymbol) : void 0; - if (suggestion) { - reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion); - } else { - reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget)); - } - } else { - const objectLiteralDeclaration = ((_a2 = source2.symbol) == null ? void 0 : _a2.declarations) && firstOrUndefined(source2.symbol.declarations); - let suggestion; - if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, (d) => d === objectLiteralDeclaration) && getSourceFileOfNode(objectLiteralDeclaration) === getSourceFileOfNode(errorNode)) { - const propDeclaration = prop.valueDeclaration; - Debug.assertNode(propDeclaration, isObjectLiteralElementLike); - const name = propDeclaration.name; - errorNode = name; - if (isIdentifier(name)) { - suggestion = getSuggestionForNonexistentProperty(name, errorTarget); - } - } - if (suggestion !== void 0) { - 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 { - reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget)); - } - } - } - return true; - } - if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), 3 /* Both */, reportErrors2)) { - if (reportErrors2) { - reportIncompatibleError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(prop)); - } - return true; - } - } - } - return false; - } - function shouldCheckAsExcessProperty(prop, container) { - return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration; - } - 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 */), intersectionState); - } - if (target2.flags & 2097152 /* Intersection */) { - return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */); - } - if (relation === comparableRelation && target2.flags & 402784252 /* Primitive */) { - const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t); - if (constraints !== source2.types) { - source2 = getIntersectionType(constraints); - if (source2.flags & 131072 /* Never */) { - return 0 /* False */; - } - if (!(source2.flags & 2097152 /* Intersection */)) { - return isRelatedTo( - source2, - target2, - 1 /* Source */, - /*reportErrors*/ - false - ) || isRelatedTo( - target2, - source2, - 1 /* Source */, - /*reportErrors*/ - false - ); - } - } - } - return someTypeRelatedToType( - source2, - target2, - /*reportErrors*/ - false, - 1 /* Source */ - ); - } - function eachTypeRelatedToSomeType(source2, target2) { - let result2 = -1 /* True */; - const sourceTypes = source2.types; - for (const sourceType of sourceTypes) { - const related = typeRelatedToSomeType( - sourceType, - target2, - /*reportErrors*/ - false, - 0 /* None */ - ); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - return result2; - } - function typeRelatedToSomeType(source2, target2, reportErrors2, intersectionState) { - const targetTypes = target2.types; - if (target2.flags & 1048576 /* Union */) { - if (containsType(targetTypes, source2)) { - return -1 /* True */; - } - if (relation !== comparableRelation && getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) { - const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType; - const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0; - return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */; - } - const match = getMatchingUnionConstituentForType(target2, source2); - if (match) { - const related = isRelatedTo( - source2, - match, - 2 /* Target */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - ); - if (related) { - return related; - } - } - } - for (const type of targetTypes) { - const related = isRelatedTo( - source2, - type, - 2 /* Target */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - ); - if (related) { - return related; - } - } - if (reportErrors2) { - const bestMatchingType = getBestMatchingType(source2, target2, isRelatedTo); - if (bestMatchingType) { - isRelatedTo( - source2, - bestMatchingType, - 2 /* Target */, - /*reportErrors*/ - true, - /*headMessage*/ - void 0, - intersectionState - ); - } - } - return 0 /* False */; - } - function typeRelatedToEachType(source2, target2, reportErrors2, intersectionState) { - let result2 = -1 /* True */; - const targetTypes = target2.types; - for (const targetType of targetTypes) { - const related = isRelatedTo( - source2, - targetType, - 2 /* Target */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - return result2; - } - function someTypeRelatedToType(source2, target2, reportErrors2, intersectionState) { - const sourceTypes = source2.types; - if (source2.flags & 1048576 /* Union */ && containsType(sourceTypes, target2)) { - return -1 /* True */; - } - const len = sourceTypes.length; - for (let i = 0; i < len; i++) { - const related = isRelatedTo( - sourceTypes[i], - target2, - 1 /* Source */, - reportErrors2 && i === len - 1, - /*headMessage*/ - void 0, - intersectionState - ); - if (related) { - return related; - } - } - return 0 /* False */; - } - function getUndefinedStrippedTargetIfNeeded(source2, target2) { - if (source2.flags & 1048576 /* Union */ && target2.flags & 1048576 /* Union */ && !(source2.types[0].flags & 32768 /* Undefined */) && target2.types[0].flags & 32768 /* Undefined */) { - return extractTypesOfKind(target2, ~32768 /* Undefined */); - } - return target2; - } - function eachTypeRelatedToType(source2, target2, reportErrors2, intersectionState) { - let result2 = -1 /* True */; - const sourceTypes = source2.types; - const undefinedStrippedTarget = getUndefinedStrippedTargetIfNeeded(source2, target2); - for (let i = 0; i < sourceTypes.length; i++) { - const sourceType = sourceTypes[i]; - if (undefinedStrippedTarget.flags & 1048576 /* Union */ && sourceTypes.length >= undefinedStrippedTarget.types.length && sourceTypes.length % undefinedStrippedTarget.types.length === 0) { - const related2 = isRelatedTo( - sourceType, - undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], - 3 /* Both */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - ); - if (related2) { - result2 &= related2; - continue; - } - } - const related = isRelatedTo( - sourceType, - target2, - 1 /* Source */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - return result2; - } - function typeArgumentsRelatedTo(sources = emptyArray, targets = emptyArray, variances = emptyArray, reportErrors2, intersectionState) { - if (sources.length !== targets.length && relation === identityRelation) { - return 0 /* False */; - } - const length2 = sources.length <= targets.length ? sources.length : targets.length; - let result2 = -1 /* True */; - for (let i = 0; i < length2; i++) { - const varianceFlags = i < variances.length ? variances[i] : 1 /* Covariant */; - const variance = varianceFlags & 7 /* VarianceMask */; - if (variance !== 4 /* Independent */) { - const s = sources[i]; - const t = targets[i]; - let related = -1 /* True */; - if (varianceFlags & 8 /* Unmeasurable */) { - related = relation === identityRelation ? isRelatedTo( - s, - t, - 3 /* Both */, - /*reportErrors*/ - false - ) : compareTypesIdentical(s, t); - } else if (variance === 1 /* Covariant */) { - related = isRelatedTo( - s, - t, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - } else if (variance === 2 /* Contravariant */) { - related = isRelatedTo( - t, - s, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - } else if (variance === 3 /* Bivariant */) { - related = isRelatedTo( - t, - s, - 3 /* Both */, - /*reportErrors*/ - false - ); - if (!related) { - related = isRelatedTo( - s, - t, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - } - } else { - related = isRelatedTo( - s, - t, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - if (related) { - related &= isRelatedTo( - t, - s, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - } - } - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - } - return result2; - } - function recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags) { - var _a2, _b, _c; - if (overflow) { - return 0 /* False */; - } - const id = getRelationKey( - source2, - target2, - intersectionState, - relation, - /*ignoreConstraints*/ - false - ); - const entry = relation.get(id); - if (entry !== void 0) { - if (reportErrors2 && entry & 2 /* Failed */ && !(entry & 96 /* Overflow */)) { - } else { - if (outofbandVarianceMarkerHandler) { - const saved = entry & 24 /* ReportsMask */; - if (saved & 8 /* ReportsUnmeasurable */) { - instantiateType(source2, reportUnmeasurableMapper); - } - if (saved & 16 /* ReportsUnreliable */) { - instantiateType(source2, reportUnreliableMapper); - } - } - if (reportErrors2 && entry & 96 /* Overflow */) { - const message = entry & 32 /* ComplexityOverflow */ ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1; - reportError(message, typeToString(source2), typeToString(target2)); - overrideNextErrorInfo++; - } - 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, - intersectionState, - relation, - /*ignoreConstraints*/ - true - ) : void 0; - if (broadestEquivalentId && maybeKeysSet.has(broadestEquivalentId)) { - return 3 /* Maybe */; - } - if (sourceDepth === 100 || targetDepth === 100) { - overflow = true; - return 0 /* False */; - } - } - const maybeStart = maybeCount; - maybeKeys[maybeCount] = id; - maybeKeysSet.add(id); - maybeCount++; - const saveExpandingFlags = expandingFlags; - if (recursionFlags & 1 /* Source */) { - sourceStack[sourceDepth] = source2; - sourceDepth++; - if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source2, sourceStack, sourceDepth)) expandingFlags |= 1 /* Source */; - } - if (recursionFlags & 2 /* Target */) { - targetStack[targetDepth] = target2; - targetDepth++; - if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target2, targetStack, targetDepth)) expandingFlags |= 2 /* Target */; - } - let originalHandler; - let propagatingVarianceFlags = 0; - if (outofbandVarianceMarkerHandler) { - originalHandler = outofbandVarianceMarkerHandler; - outofbandVarianceMarkerHandler = (onlyUnreliable) => { - propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; - return originalHandler(onlyUnreliable); - }; - } - let result2; - if (expandingFlags === 3 /* Both */) { - (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "recursiveTypeRelatedTo_DepthLimit", { - sourceId: source2.id, - sourceIdStack: sourceStack.map((t) => t.id), - targetId: target2.id, - targetIdStack: targetStack.map((t) => t.id), - depth: sourceDepth, - targetDepth - }); - result2 = 3 /* Maybe */; - } else { - (_b = tracing) == null ? void 0 : _b.push(tracing.Phase.CheckTypes, "structuredTypeRelatedTo", { sourceId: source2.id, targetId: target2.id }); - result2 = structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState); - (_c = tracing) == null ? void 0 : _c.pop(); - } - if (outofbandVarianceMarkerHandler) { - outofbandVarianceMarkerHandler = originalHandler; - } - if (recursionFlags & 1 /* Source */) { - sourceDepth--; - } - if (recursionFlags & 2 /* Target */) { - targetDepth--; - } - expandingFlags = saveExpandingFlags; - if (result2) { - if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) { - if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) { - resetMaybeStack( - /*markAllAsSucceeded*/ - true - ); - } else { - resetMaybeStack( - /*markAllAsSucceeded*/ - false - ); - } - } - } else { - relation.set(id, 2 /* Failed */ | propagatingVarianceFlags); - 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(); - let result2 = structuredTypeRelatedToWorker(source2, target2, reportErrors2, intersectionState, saveErrorInfo); - if (relation !== identityRelation) { - if (!result2 && (source2.flags & 2097152 /* Intersection */ || source2.flags & 262144 /* TypeParameter */ && target2.flags & 1048576 /* Union */)) { - const constraint = getEffectiveConstraintOfIntersection(source2.flags & 2097152 /* Intersection */ ? source2.types : [source2], !!(target2.flags & 1048576 /* Union */)); - if (constraint && everyType(constraint, (c) => c !== source2)) { - result2 = isRelatedTo( - constraint, - target2, - 1 /* Source */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - ); - } - } - if (result2 && !(intersectionState & 2 /* Target */) && target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */)) { - result2 &= propertiesRelatedTo( - source2, - target2, - reportErrors2, - /*excludedProperties*/ - void 0, - /*optionalsOnly*/ - false, - 0 /* None */ - ); - if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) { - result2 &= indexSignaturesRelatedTo( - source2, - target2, - /*sourceIsPrimitive*/ - false, - reportErrors2, - 0 /* None */ - ); - } - } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) { - result2 &= propertiesRelatedTo( - source2, - target2, - reportErrors2, - /*excludedProperties*/ - void 0, - /*optionalsOnly*/ - true, - intersectionState - ); - } - } - if (result2) { - resetErrorInfo(saveErrorInfo); - } - 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; - let varianceCheckFailed = false; - let sourceFlags = source2.flags; - const targetFlags = target2.flags; - if (relation === identityRelation) { - if (sourceFlags & 3145728 /* UnionOrIntersection */) { - let result3 = eachTypeRelatedToSomeType(source2, target2); - if (result3) { - result3 &= eachTypeRelatedToSomeType(target2, source2); - } - return result3; - } - if (sourceFlags & 4194304 /* Index */) { - return isRelatedTo( - source2.type, - target2.type, - 3 /* Both */, - /*reportErrors*/ - false - ); - } - if (sourceFlags & 8388608 /* IndexedAccess */) { - if (result2 = isRelatedTo( - source2.objectType, - target2.objectType, - 3 /* Both */, - /*reportErrors*/ - false - )) { - if (result2 &= isRelatedTo( - source2.indexType, - target2.indexType, - 3 /* Both */, - /*reportErrors*/ - false - )) { - return result2; - } - } - } - if (sourceFlags & 16777216 /* Conditional */) { - if (source2.root.isDistributive === target2.root.isDistributive) { - if (result2 = isRelatedTo( - source2.checkType, - target2.checkType, - 3 /* Both */, - /*reportErrors*/ - false - )) { - if (result2 &= isRelatedTo( - source2.extendsType, - target2.extendsType, - 3 /* Both */, - /*reportErrors*/ - false - )) { - if (result2 &= isRelatedTo( - getTrueTypeFromConditionalType(source2), - getTrueTypeFromConditionalType(target2), - 3 /* Both */, - /*reportErrors*/ - false - )) { - if (result2 &= isRelatedTo( - getFalseTypeFromConditionalType(source2), - getFalseTypeFromConditionalType(target2), - 3 /* Both */, - /*reportErrors*/ - false - )) { - return result2; - } - } - } - } - } - } - if (sourceFlags & 33554432 /* Substitution */) { - if (result2 = isRelatedTo( - source2.baseType, - target2.baseType, - 3 /* Both */, - /*reportErrors*/ - false - )) { - if (result2 &= isRelatedTo( - source2.constraint, - target2.constraint, - 3 /* Both */, - /*reportErrors*/ - false - )) { - return result2; - } - } - } - if (sourceFlags & 134217728 /* TemplateLiteral */) { - if (arrayIsEqualTo(source2.texts, target2.texts)) { - const sourceTypes = source2.types; - const targetTypes = target2.types; - result2 = -1 /* True */; - for (let i = 0; i < sourceTypes.length; i++) { - if (!(result2 &= isRelatedTo( - sourceTypes[i], - targetTypes[i], - 3 /* Both */, - /*reportErrors*/ - false - ))) { - break; - } - } - return result2; - } - } - if (sourceFlags & 268435456 /* StringMapping */) { - if (source2.symbol === target2.symbol) { - return isRelatedTo( - source2.type, - target2.type, - 3 /* Both */, - /*reportErrors*/ - false - ); - } - } - if (!(sourceFlags & 524288 /* Object */)) { - return 0 /* False */; - } - } else if (sourceFlags & 3145728 /* UnionOrIntersection */ || targetFlags & 3145728 /* UnionOrIntersection */) { - if (result2 = unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState)) { - return result2; - } - if (!(sourceFlags & 465829888 /* Instantiable */ || sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ || sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) { - return 0 /* False */; - } - } - if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source2.aliasSymbol && source2.aliasTypeArguments && source2.aliasSymbol === target2.aliasSymbol && !(isMarkerType(source2) || isMarkerType(target2))) { - const variances = getAliasVariances(source2.aliasSymbol); - if (variances === emptyArray) { - return 1 /* Unknown */; - } - const params = getSymbolLinks(source2.aliasSymbol).typeParameters; - const minParams = getMinTypeArgumentCount(params); - const sourceTypes = fillMissingTypeArguments(source2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration)); - const targetTypes = fillMissingTypeArguments(target2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration)); - const varianceResult = relateVariances(sourceTypes, targetTypes, variances, intersectionState); - if (varianceResult !== void 0) { - return varianceResult; - } - } - if (isSingleElementGenericTupleType(source2) && !source2.target.readonly && (result2 = isRelatedTo(getTypeArguments(source2)[0], target2, 1 /* Source */)) || isSingleElementGenericTupleType(target2) && (target2.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source2) || source2)) && (result2 = isRelatedTo(source2, getTypeArguments(target2)[0], 2 /* Target */))) { - return result2; - } - if (targetFlags & 262144 /* TypeParameter */) { - if (getObjectFlags(source2) & 32 /* Mapped */ && !source2.declaration.nameType && isRelatedTo(getIndexType(target2), getConstraintTypeFromMappedType(source2), 3 /* Both */)) { - if (!(getMappedTypeModifiers(source2) & 4 /* IncludeOptional */)) { - const templateType = getTemplateTypeFromMappedType(source2); - const indexedAccessType = getIndexedAccessType(target2, getTypeParameterFromMappedType(source2)); - if (result2 = isRelatedTo(templateType, indexedAccessType, 3 /* Both */, reportErrors2)) { - return result2; - } - } - } - if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) { - let constraint = getConstraintOfTypeParameter(source2); - if (constraint) { - while (constraint && someType(constraint, (c) => !!(c.flags & 262144 /* TypeParameter */))) { - if (result2 = isRelatedTo( - constraint, - target2, - 1 /* Source */, - /*reportErrors*/ - false - )) { - return result2; - } - constraint = getConstraintOfTypeParameter(constraint); - } - } - return 0 /* False */; - } - } else if (targetFlags & 4194304 /* Index */) { - const targetType = target2.type; - if (sourceFlags & 4194304 /* Index */) { - if (result2 = isRelatedTo( - targetType, - source2.type, - 3 /* Both */, - /*reportErrors*/ - false - )) { - return result2; - } - } - if (isTupleType(targetType)) { - if (result2 = isRelatedTo(source2, getKnownKeysOfTupleType(targetType), 2 /* Target */, reportErrors2)) { - return result2; - } - } else { - const constraint = getSimplifiedTypeOrConstraint(targetType); - if (constraint) { - if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) { - return -1 /* True */; - } - } else if (isGenericMappedType(targetType)) { - const nameType = getNameTypeFromMappedType(targetType); - const constraintType = getConstraintTypeFromMappedType(targetType); - let targetKeys; - if (nameType && isMappedTypeWithKeyofConstraintDeclaration(targetType)) { - const mappedKeys = getApparentMappedTypeKeys(nameType, targetType); - targetKeys = getUnionType([mappedKeys, nameType]); - } else { - targetKeys = nameType || constraintType; - } - if (isRelatedTo(source2, targetKeys, 2 /* Target */, reportErrors2) === -1 /* True */) { - return -1 /* True */; - } - } - } - } else if (targetFlags & 8388608 /* IndexedAccess */) { - if (sourceFlags & 8388608 /* IndexedAccess */) { - if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) { - result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2); - } - if (result2) { - return result2; - } - if (reportErrors2) { - originalErrorInfo = errorInfo; - } - } - if (relation === assignableRelation || relation === comparableRelation) { - const objectType = target2.objectType; - const indexType = target2.indexType; - const baseObjectType = getBaseConstraintOfType(objectType) || objectType; - const baseIndexType = getBaseConstraintOfType(indexType) || indexType; - if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { - const accessFlags = 4 /* Writing */ | (baseObjectType !== objectType ? 2 /* NoIndexSignatures */ : 0); - const constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, accessFlags); - if (constraint) { - if (reportErrors2 && originalErrorInfo) { - resetErrorInfo(saveErrorInfo); - } - if (result2 = isRelatedTo( - source2, - constraint, - 2 /* Target */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - )) { - return result2; - } - if (reportErrors2 && originalErrorInfo && errorInfo) { - errorInfo = countMessageChainBreadth([originalErrorInfo]) <= countMessageChainBreadth([errorInfo]) ? originalErrorInfo : errorInfo; - } - } - } - } - if (reportErrors2) { - originalErrorInfo = void 0; - } - } else if (isGenericMappedType(target2) && relation !== identityRelation) { - const keysRemapped = !!target2.declaration.nameType; - const templateType = getTemplateTypeFromMappedType(target2); - const modifiers = getMappedTypeModifiers(target2); - if (!(modifiers & 8 /* ExcludeOptional */)) { - if (!keysRemapped && templateType.flags & 8388608 /* IndexedAccess */ && templateType.objectType === source2 && templateType.indexType === getTypeParameterFromMappedType(target2)) { - return -1 /* True */; - } - if (!isGenericMappedType(source2)) { - const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2); - const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */); - const includeOptional = modifiers & 4 /* IncludeOptional */; - const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0; - if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) { - const templateType2 = getTemplateTypeFromMappedType(target2); - const typeParameter = getTypeParameterFromMappedType(target2); - const nonNullComponent = extractTypesOfKind(templateType2, ~98304 /* Nullable */); - if (!keysRemapped && nonNullComponent.flags & 8388608 /* IndexedAccess */ && nonNullComponent.indexType === typeParameter) { - if (result2 = isRelatedTo(source2, nonNullComponent.objectType, 2 /* Target */, reportErrors2)) { - return result2; - } - } else { - const indexingType = keysRemapped ? filteredByApplicability || targetKeys : filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter; - const indexedAccessType = getIndexedAccessType(source2, indexingType); - if (result2 = isRelatedTo(indexedAccessType, templateType2, 3 /* Both */, reportErrors2)) { - return result2; - } - } - } - originalErrorInfo = errorInfo; - resetErrorInfo(saveErrorInfo); - } - } - } else if (targetFlags & 16777216 /* Conditional */) { - if (isDeeplyNestedType(target2, targetStack, targetDepth, 10)) { - return 3 /* Maybe */; - } - const c = target2; - if (!c.root.inferTypeParameters && !isDistributionDependent(c.root) && !(source2.flags & 16777216 /* Conditional */ && source2.root === c.root)) { - const skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType)); - const skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType)); - if (result2 = skipTrue ? -1 /* True */ : isRelatedTo( - source2, - getTrueTypeFromConditionalType(c), - 2 /* Target */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - )) { - result2 &= skipFalse ? -1 /* True */ : isRelatedTo( - source2, - getFalseTypeFromConditionalType(c), - 2 /* Target */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - ); - if (result2) { - return result2; - } - } - } - } else if (targetFlags & 134217728 /* TemplateLiteral */) { - if (sourceFlags & 134217728 /* TemplateLiteral */) { - if (relation === comparableRelation) { - return templateLiteralTypesDefinitelyUnrelated(source2, target2) ? 0 /* False */ : -1 /* True */; - } - instantiateType(source2, reportUnreliableMapper); - } - if (isTypeMatchedByTemplateLiteralType(source2, target2)) { - return -1 /* True */; - } - } else if (target2.flags & 268435456 /* StringMapping */) { - if (!(source2.flags & 268435456 /* StringMapping */)) { - if (isMemberOfStringMapping(source2, target2)) { - return -1 /* True */; - } - } - } - if (sourceFlags & 8650752 /* TypeVariable */) { - if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) { - const constraint = getConstraintOfType(source2) || unknownType; - if (result2 = isRelatedTo( - constraint, - target2, - 1 /* Source */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - )) { - return result2; - } else if (result2 = isRelatedTo( - getTypeWithThisArgument(constraint, source2), - target2, - 1 /* Source */, - reportErrors2 && constraint !== unknownType && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), - /*headMessage*/ - void 0, - intersectionState - )) { - return result2; - } - if (isMappedTypeGenericIndexedAccess(source2)) { - const indexConstraint = getConstraintOfType(source2.indexType); - if (indexConstraint) { - if (result2 = isRelatedTo(getIndexedAccessType(source2.objectType, indexConstraint), target2, 1 /* Source */, reportErrors2)) { - return result2; - } - } - } - } - } else if (sourceFlags & 4194304 /* Index */) { - const isDeferredMappedIndex = shouldDeferIndexType(source2.type, source2.indexFlags) && getObjectFlags(source2.type) & 32 /* Mapped */; - if (result2 = isRelatedTo(stringNumberSymbolType, 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); - if (constraint && constraint !== source2 && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) { - return result2; - } - } - } else if (sourceFlags & 268435456 /* StringMapping */) { - if (targetFlags & 268435456 /* StringMapping */) { - if (source2.symbol !== target2.symbol) { - return 0 /* False */; - } - if (result2 = isRelatedTo(source2.type, target2.type, 3 /* Both */, reportErrors2)) { - return result2; - } - } else { - const constraint = getBaseConstraintOfType(source2); - if (constraint && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) { - return result2; - } - } - } else if (sourceFlags & 16777216 /* Conditional */) { - if (isDeeplyNestedType(source2, sourceStack, sourceDepth, 10)) { - return 3 /* Maybe */; - } - if (targetFlags & 16777216 /* Conditional */) { - const sourceParams = source2.root.inferTypeParameters; - let sourceExtends = source2.extendsType; - let mapper; - if (sourceParams) { - const ctx = createInferenceContext( - sourceParams, - /*signature*/ - void 0, - 0 /* None */, - isRelatedToWorker - ); - inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */); - sourceExtends = instantiateType(sourceExtends, ctx.mapper); - mapper = ctx.mapper; - } - if (isTypeIdenticalTo(sourceExtends, target2.extendsType) && (isRelatedTo(source2.checkType, target2.checkType, 3 /* Both */) || isRelatedTo(target2.checkType, source2.checkType, 3 /* Both */))) { - if (result2 = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source2), mapper), getTrueTypeFromConditionalType(target2), 3 /* Both */, reportErrors2)) { - result2 &= isRelatedTo(getFalseTypeFromConditionalType(source2), getFalseTypeFromConditionalType(target2), 3 /* Both */, reportErrors2); - } - if (result2) { - return result2; - } - } - } - const defaultConstraint = getDefaultConstraintOfConditionalType(source2); - if (defaultConstraint) { - if (result2 = isRelatedTo(defaultConstraint, target2, 1 /* Source */, reportErrors2)) { - 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 */; - } - if (isGenericMappedType(target2)) { - if (isGenericMappedType(source2)) { - if (result2 = mappedTypeRelatedTo(source2, target2, reportErrors2)) { - return result2; - } - } - return 0 /* False */; - } - const sourceIsPrimitive = !!(sourceFlags & 402784252 /* Primitive */); - if (relation !== identityRelation) { - source2 = getApparentType(source2); - sourceFlags = source2.flags; - } else if (isGenericMappedType(source2)) { - return 0 /* False */; - } - if (getObjectFlags(source2) & 4 /* Reference */ && getObjectFlags(target2) & 4 /* Reference */ && source2.target === target2.target && !isTupleType(source2) && !(isMarkerType(source2) || isMarkerType(target2))) { - if (isEmptyArrayLiteralType(source2)) { - return -1 /* True */; - } - const variances = getVariances(source2.target); - if (variances === emptyArray) { - return 1 /* Unknown */; - } - const varianceResult = relateVariances(getTypeArguments(source2), getTypeArguments(target2), variances, intersectionState); - if (varianceResult !== void 0) { - return varianceResult; - } - } else if (isReadonlyArrayType(target2) ? everyType(source2, isArrayOrTupleType) : isArrayType(target2) && everyType(source2, (t) => isTupleType(t) && !t.target.readonly)) { - if (relation !== identityRelation) { - return isRelatedTo(getIndexTypeOfType(source2, numberType) || anyType, getIndexTypeOfType(target2, numberType) || anyType, 3 /* Both */, reportErrors2); - } else { - return 0 /* False */; - } - } else if (isGenericTupleType(source2) && isTupleType(target2) && !isGenericTupleType(target2)) { - const constraint = getBaseConstraintOrType(source2); - if (constraint !== source2) { - return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2); - } - } else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 8192 /* FreshLiteral */ && !isEmptyObjectType(source2)) { - return 0 /* False */; - } - if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) { - const reportStructuralErrors = reportErrors2 && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive; - result2 = propertiesRelatedTo( - source2, - target2, - reportStructuralErrors, - /*excludedProperties*/ - void 0, - /*optionalsOnly*/ - false, - intersectionState - ); - if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors, intersectionState); - if (result2) { - result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors, intersectionState); - if (result2) { - result2 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState); - } - } - } - if (varianceCheckFailed && result2) { - errorInfo = originalErrorInfo || errorInfo || saveErrorInfo.errorInfo; - } else if (result2) { - return result2; - } - } - if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) { - const objectOnlyTarget = extractTypesOfKind(target2, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */); - if (objectOnlyTarget.flags & 1048576 /* Union */) { - const result3 = typeRelatedToDiscriminatedType(source2, objectOnlyTarget); - if (result3) { - return result3; - } - } - } - } - return 0 /* False */; - function countMessageChainBreadth(info) { - if (!info) return 0; - return reduceLeft(info, (value, chain) => value + 1 + countMessageChainBreadth(chain.next), 0); - } - function relateVariances(sourceTypeArguments, targetTypeArguments, variances, intersectionState2) { - if (result2 = typeArgumentsRelatedTo(sourceTypeArguments, targetTypeArguments, variances, reportErrors2, intersectionState2)) { - return result2; - } - if (some(variances, (v) => !!(v & 24 /* AllowsStructuralFallback */))) { - originalErrorInfo = void 0; - resetErrorInfo(saveErrorInfo); - return void 0; - } - const allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances); - varianceCheckFailed = !allowStructuralFallback; - if (variances !== emptyArray && !allowStructuralFallback) { - if (varianceCheckFailed && !(reportErrors2 && some(variances, (v) => (v & 7 /* VarianceMask */) === 0 /* Invariant */))) { - return 0 /* False */; - } - originalErrorInfo = errorInfo; - resetErrorInfo(saveErrorInfo); - } - } - } - function mappedTypeRelatedTo(source2, target2, reportErrors2) { - const modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source2) === getMappedTypeModifiers(target2) : getCombinedMappedTypeOptionality(source2) <= getCombinedMappedTypeOptionality(target2)); - if (modifiersRelated) { - let result2; - const targetConstraint = getConstraintTypeFromMappedType(target2); - const sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source2), getCombinedMappedTypeOptionality(source2) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper); - if (result2 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors2)) { - const mapper = createTypeMapper([getTypeParameterFromMappedType(source2)], [getTypeParameterFromMappedType(target2)]); - if (instantiateType(getNameTypeFromMappedType(source2), mapper) === instantiateType(getNameTypeFromMappedType(target2), mapper)) { - return result2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source2), mapper), getTemplateTypeFromMappedType(target2), 3 /* Both */, reportErrors2); - } - } - } - return 0 /* False */; - } - function typeRelatedToDiscriminatedType(source2, target2) { - var _a2; - const sourceProperties = getPropertiesOfType(source2); - const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target2); - if (!sourcePropertiesFiltered) return 0 /* False */; - let numCombinations = 1; - for (const sourceProperty of sourcePropertiesFiltered) { - numCombinations *= countTypes(getNonMissingTypeOfSymbol(sourceProperty)); - if (numCombinations > 25) { - (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source2.id, targetId: target2.id, numCombinations }); - return 0 /* False */; - } - } - const sourceDiscriminantTypes = new Array(sourcePropertiesFiltered.length); - const excludedProperties = /* @__PURE__ */ new Set(); - for (let i = 0; i < sourcePropertiesFiltered.length; i++) { - const sourceProperty = sourcePropertiesFiltered[i]; - const sourcePropertyType = getNonMissingTypeOfSymbol(sourceProperty); - sourceDiscriminantTypes[i] = sourcePropertyType.flags & 1048576 /* Union */ ? sourcePropertyType.types : [sourcePropertyType]; - excludedProperties.add(sourceProperty.escapedName); - } - const discriminantCombinations = cartesianProduct(sourceDiscriminantTypes); - const matchingTypes = []; - for (const combination of discriminantCombinations) { - let hasMatch = false; - outer: - for (const type of target2.types) { - for (let i = 0; i < sourcePropertiesFiltered.length; i++) { - const sourceProperty = sourcePropertiesFiltered[i]; - const targetProperty = getPropertyOfType(type, sourceProperty.escapedName); - if (!targetProperty) continue outer; - if (sourceProperty === targetProperty) continue; - const related = propertyRelatedTo( - source2, - target2, - sourceProperty, - targetProperty, - (_) => combination[i], - /*reportErrors*/ - false, - 0 /* None */, - /*skipOptional*/ - strictNullChecks || relation === comparableRelation - ); - if (!related) { - continue outer; - } - } - pushIfUnique(matchingTypes, type, equateValues); - hasMatch = true; - } - if (!hasMatch) { - return 0 /* False */; - } - } - let result2 = -1 /* True */; - for (const type of matchingTypes) { - result2 &= propertiesRelatedTo( - source2, - type, - /*reportErrors*/ - false, - excludedProperties, - /*optionalsOnly*/ - false, - 0 /* None */ - ); - if (result2) { - result2 &= signaturesRelatedTo( - source2, - type, - 0 /* Call */, - /*reportErrors*/ - false, - 0 /* None */ - ); - if (result2) { - result2 &= signaturesRelatedTo( - source2, - type, - 1 /* Construct */, - /*reportErrors*/ - false, - 0 /* None */ - ); - if (result2 && !(isTupleType(source2) && isTupleType(type))) { - result2 &= indexSignaturesRelatedTo( - source2, - type, - /*sourceIsPrimitive*/ - false, - /*reportErrors*/ - false, - 0 /* None */ - ); - } - } - } - if (!result2) { - return result2; - } - } - return result2; - } - function excludeProperties(properties, excludedProperties) { - if (!excludedProperties || properties.length === 0) return properties; - let result2; - for (let i = 0; i < properties.length; i++) { - if (!excludedProperties.has(properties[i].escapedName)) { - if (result2) { - result2.push(properties[i]); - } - } else if (!result2) { - result2 = properties.slice(0, i); - } - } - return result2 || properties; - } - function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState) { - const targetIsOptional = strictNullChecks && !!(getCheckFlags(targetProp) & 48 /* Partial */); - const effectiveTarget = addOptionality( - getNonMissingTypeOfSymbol(targetProp), - /*isProperty*/ - false, - targetIsOptional - ); - if (effectiveTarget.flags & (relation === strictSubtypeRelation ? 1 /* Any */ : 3 /* AnyOrUnknown */)) { - return -1 /* True */; - } - const effectiveSource = getTypeOfSourceProperty(sourceProp); - return isRelatedTo( - effectiveSource, - effectiveTarget, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - } - function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) { - const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); - const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); - if (sourcePropFlags & 2 /* Private */ || targetPropFlags & 2 /* Private */) { - if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { - if (reportErrors2) { - 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 & 2 /* Private */ ? source2 : target2), typeToString(sourcePropFlags & 2 /* Private */ ? target2 : source2)); - } - } - return 0 /* False */; - } - } 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)); - } - return 0 /* False */; - } - } 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)); - } - return 0 /* False */; - } - if (relation === strictSubtypeRelation && isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp)) { - return 0 /* False */; - } - const related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState); - if (!related) { - if (reportErrors2) { - reportIncompatibleError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); - } - return 0 /* False */; - } - 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)); - } - return 0 /* False */; - } - return related; - } - function reportUnmatchedProperty(source2, target2, unmatchedProperty, requireOptionalProperties) { - let shouldSkipElaboration = false; - if (unmatchedProperty.valueDeclaration && isNamedDeclaration(unmatchedProperty.valueDeclaration) && isPrivateIdentifier(unmatchedProperty.valueDeclaration.name) && source2.symbol && source2.symbol.flags & 32 /* Class */) { - const privateIdentifierDescription = unmatchedProperty.valueDeclaration.name.escapedText; - const symbolTableKey = getSymbolNameForPrivateIdentifier(source2.symbol, privateIdentifierDescription); - if (symbolTableKey && getPropertyOfType(source2, symbolTableKey)) { - const sourceName = factory.getDeclarationName(source2.symbol.valueDeclaration); - const targetName = factory.getDeclarationName(target2.symbol.valueDeclaration); - reportError( - Diagnostics.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2, - diagnosticName(privateIdentifierDescription), - diagnosticName(sourceName.escapedText === "" ? anon : sourceName), - diagnosticName(targetName.escapedText === "" ? anon : targetName) - ); - return; - } - } - const props = arrayFrom(getUnmatchedProperties( - source2, - target2, - requireOptionalProperties, - /*matchDiscriminantProperties*/ - false - )); - if (!headMessage || headMessage.code !== Diagnostics.Class_0_incorrectly_implements_interface_1.code && headMessage.code !== Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code) { - shouldSkipElaboration = true; - } - if (props.length === 1) { - const propName = symbolToString( - unmatchedProperty, - /*enclosingDeclaration*/ - void 0, - 0 /* None */, - 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */ - ); - reportError(Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName, ...getTypeNamesForErrorDisplay(source2, target2)); - if (length(unmatchedProperty.declarations)) { - associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics._0_is_declared_here, propName)); - } - if (shouldSkipElaboration && errorInfo) { - overrideNextErrorInfo++; - } - } else if (tryElaborateArrayLikeErrors( - source2, - target2, - /*reportErrors*/ - false - )) { - if (props.length > 5) { - reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source2), typeToString(target2), map(props.slice(0, 4), (p) => symbolToString(p)).join(", "), props.length - 4); - } else { - reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source2), typeToString(target2), map(props, (p) => symbolToString(p)).join(", ")); - } - if (shouldSkipElaboration && errorInfo) { - overrideNextErrorInfo++; - } - } - } - function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) { - if (relation === identityRelation) { - return propertiesIdenticalTo(source2, target2, excludedProperties); - } - let result2 = -1 /* True */; - if (isTupleType(target2)) { - if (isArrayOrTupleType(source2)) { - if (!target2.target.readonly && (isReadonlyArrayType(source2) || isTupleType(source2) && source2.target.readonly)) { - return 0 /* False */; - } - const sourceArity = getTypeReferenceArity(source2); - const targetArity = getTypeReferenceArity(target2); - const sourceRestFlag = isTupleType(source2) ? source2.target.combinedFlags & 4 /* Rest */ : 4 /* Rest */; - const targetHasRestElement = !!(target2.target.combinedFlags & 12 /* Variable */); - const sourceMinLength = isTupleType(source2) ? source2.target.minLength : 0; - const targetMinLength = target2.target.minLength; - if (!sourceRestFlag && sourceArity < targetMinLength) { - if (reportErrors2) { - reportError(Diagnostics.Source_has_0_element_s_but_target_requires_1, sourceArity, targetMinLength); - } - return 0 /* False */; - } - if (!targetHasRestElement && targetArity < sourceMinLength) { - if (reportErrors2) { - reportError(Diagnostics.Source_has_0_element_s_but_target_allows_only_1, sourceMinLength, targetArity); - } - return 0 /* False */; - } - if (!targetHasRestElement && (sourceRestFlag || targetArity < sourceArity)) { - if (reportErrors2) { - if (sourceMinLength < targetMinLength) { - reportError(Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer, targetMinLength); - } else { - reportError(Diagnostics.Target_allows_only_0_element_s_but_source_may_have_more, targetArity); - } - } - return 0 /* False */; - } - const sourceTypeArguments = getTypeArguments(source2); - const targetTypeArguments = getTypeArguments(target2); - const targetStartCount = getStartElementCount(target2.target, 11 /* NonRest */); - const targetEndCount = getEndElementCount(target2.target, 11 /* NonRest */); - let canExcludeDiscriminants = !!excludedProperties; - for (let sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) { - const sourceFlags = isTupleType(source2) ? source2.target.elementFlags[sourcePosition] : 4 /* Rest */; - const sourcePositionFromEnd = sourceArity - 1 - sourcePosition; - const targetPosition = targetHasRestElement && sourcePosition >= targetStartCount ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount) : sourcePosition; - const targetFlags = target2.target.elementFlags[targetPosition]; - if (targetFlags & 8 /* Variadic */ && !(sourceFlags & 8 /* Variadic */)) { - if (reportErrors2) { - reportError(Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition); - } - return 0 /* False */; - } - if (sourceFlags & 8 /* Variadic */ && !(targetFlags & 12 /* Variable */)) { - if (reportErrors2) { - reportError(Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition); - } - return 0 /* False */; - } - if (targetFlags & 1 /* Required */ && !(sourceFlags & 1 /* Required */)) { - if (reportErrors2) { - reportError(Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition); - } - return 0 /* False */; - } - if (canExcludeDiscriminants) { - if (sourceFlags & 12 /* Variable */ || targetFlags & 12 /* Variable */) { - canExcludeDiscriminants = false; - } - if (canExcludeDiscriminants && (excludedProperties == null ? void 0 : excludedProperties.has("" + sourcePosition))) { - continue; - } - } - const sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2 /* Optional */)); - const targetType = targetTypeArguments[targetPosition]; - const targetCheckType = sourceFlags & 8 /* Variadic */ && targetFlags & 4 /* Rest */ ? createArrayType(targetType) : removeMissingType(targetType, !!(targetFlags & 2 /* Optional */)); - const related = isRelatedTo( - sourceType, - targetCheckType, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - if (!related) { - if (reportErrors2 && (targetArity > 1 || sourceArity > 1)) { - if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) { - reportIncompatibleError(Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition); - } else { - reportIncompatibleError(Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition); - } - } - return 0 /* False */; - } - result2 &= related; - } - return result2; - } - if (target2.target.combinedFlags & 12 /* Variable */) { - return 0 /* False */; - } - } - const requireOptionalProperties = (relation === subtypeRelation || relation === strictSubtypeRelation) && !isObjectLiteralType2(source2) && !isEmptyArrayLiteralType(source2) && !isTupleType(source2); - const unmatchedProperty = getUnmatchedProperty( - source2, - target2, - requireOptionalProperties, - /*matchDiscriminantProperties*/ - false - ); - if (unmatchedProperty) { - if (reportErrors2 && shouldReportUnmatchedPropertyError(source2, target2)) { - reportUnmatchedProperty(source2, target2, unmatchedProperty, requireOptionalProperties); - } - return 0 /* False */; - } - if (isObjectLiteralType2(target2)) { - for (const sourceProp of excludeProperties(getPropertiesOfType(source2), excludedProperties)) { - if (!getPropertyOfObjectType(target2, sourceProp.escapedName)) { - const sourceType = getTypeOfSymbol(sourceProp); - if (!(sourceType.flags & 32768 /* Undefined */)) { - if (reportErrors2) { - reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(sourceProp), typeToString(target2)); - } - return 0 /* False */; - } - } - } - } - const properties = getPropertiesOfType(target2); - const numericNamesOnly = isTupleType(source2) && isTupleType(target2); - for (const targetProp of excludeProperties(properties, excludedProperties)) { - const name = targetProp.escapedName; - if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length") && (!optionalsOnly || targetProp.flags & 16777216 /* Optional */)) { - const sourceProp = getPropertyOfType(source2, name); - if (sourceProp && sourceProp !== targetProp) { - const related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors2, intersectionState, relation === comparableRelation); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - } - } - return result2; - } - function propertiesIdenticalTo(source2, target2, excludedProperties) { - if (!(source2.flags & 524288 /* Object */ && target2.flags & 524288 /* Object */)) { - return 0 /* False */; - } - const sourceProperties = excludeProperties(getPropertiesOfObjectType(source2), excludedProperties); - const targetProperties = excludeProperties(getPropertiesOfObjectType(target2), excludedProperties); - if (sourceProperties.length !== targetProperties.length) { - return 0 /* False */; - } - let result2 = -1 /* True */; - for (const sourceProp of sourceProperties) { - const targetProp = getPropertyOfObjectType(target2, sourceProp.escapedName); - if (!targetProp) { - return 0 /* False */; - } - const related = compareProperties2(sourceProp, targetProp, isRelatedTo); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - return result2; - } - function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) { - var _a2, _b; - if (relation === identityRelation) { - return signaturesIdenticalTo(source2, target2, kind); - } - if (target2 === anyFunctionType || source2 === anyFunctionType) { - return -1 /* True */; - } - 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 - ); - if (kind === 1 /* Construct */ && sourceSignatures.length && targetSignatures.length) { - const sourceIsAbstract = !!(sourceSignatures[0].flags & 4 /* Abstract */); - const targetIsAbstract = !!(targetSignatures[0].flags & 4 /* Abstract */); - if (sourceIsAbstract && !targetIsAbstract) { - if (reportErrors2) { - reportError(Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); - } - return 0 /* False */; - } - if (!constructorVisibilitiesAreCompatible(sourceSignatures[0], targetSignatures[0], reportErrors2)) { - return 0 /* False */; - } - } - let result2 = -1 /* True */; - const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; - 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], - targetSignatures[i], - /*erase*/ - true, - reportErrors2, - intersectionState, - incompatibleReporter(sourceSignatures[i], targetSignatures[i]) - ); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - } else if (sourceSignatures.length === 1 && targetSignatures.length === 1) { - const eraseGenerics = relation === comparableRelation; - 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) === 177 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 177 /* Constructor */)) { - const constructSignatureToString = (signature) => signatureToString( - signature, - /*enclosingDeclaration*/ - void 0, - 262144 /* WriteArrowStyleSignature */, - kind - ); - reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); - reportError(Diagnostics.Types_of_construct_signatures_are_incompatible); - return result2; - } - } else { - outer: - for (const t of targetSignatures) { - const saveErrorInfo = captureErrorCalculationState(); - let shouldElaborateErrors = reportErrors2; - for (const s of sourceSignatures) { - const related = signatureRelatedTo( - s, - t, - /*erase*/ - true, - shouldElaborateErrors, - intersectionState, - incompatibleReporter(s, t) - ); - if (related) { - result2 &= related; - resetErrorInfo(saveErrorInfo); - continue outer; - } - 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 - )); - } - return 0 /* False */; - } - } - return result2; - } - function shouldReportUnmatchedPropertyError(source2, target2) { - const typeCallSignatures = getSignaturesOfStructuredType(source2, 0 /* Call */); - const typeConstructSignatures = getSignaturesOfStructuredType(source2, 1 /* Construct */); - const typeProperties = getPropertiesOfObjectType(source2); - if ((typeCallSignatures.length || typeConstructSignatures.length) && !typeProperties.length) { - if (getSignaturesOfType(target2, 0 /* Call */).length && typeCallSignatures.length || getSignaturesOfType(target2, 1 /* Construct */).length && typeConstructSignatures.length) { - return true; - } - return false; - } - return true; - } - function reportIncompatibleCallSignatureReturn(siga, sigb) { - if (siga.parameters.length === 0 && sigb.parameters.length === 0) { - return (source2, target2) => reportIncompatibleError(Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source2), typeToString(target2)); - } - return (source2, target2) => reportIncompatibleError(Diagnostics.Call_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); - } - function reportIncompatibleConstructSignatureReturn(siga, sigb) { - if (siga.parameters.length === 0 && sigb.parameters.length === 0) { - return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source2), typeToString(target2)); - } - return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); - } - 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); - function isRelatedToWorker2(source3, target3, reportErrors3) { - return isRelatedTo( - source3, - target3, - 3 /* Both */, - reportErrors3, - /*headMessage*/ - void 0, - intersectionState - ); - } - } - function signaturesIdenticalTo(source2, target2, kind) { - const sourceSignatures = getSignaturesOfType(source2, kind); - const targetSignatures = getSignaturesOfType(target2, kind); - if (sourceSignatures.length !== targetSignatures.length) { - return 0 /* False */; - } - let result2 = -1 /* True */; - for (let i = 0; i < sourceSignatures.length; i++) { - const related = compareSignaturesIdentical( - sourceSignatures[i], - targetSignatures[i], - /*partialMatch*/ - false, - /*ignoreThisTypes*/ - false, - /*ignoreReturnTypes*/ - false, - isRelatedTo - ); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - return result2; - } - function membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { - let result2 = -1 /* True */; - const keyType = targetInfo.keyType; - const props = source2.flags & 2097152 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(source2) : getPropertiesOfObjectType(source2); - for (const prop of props) { - if (isIgnoredJsxProperty(source2, prop)) { - continue; - } - if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), keyType)) { - const propType = getNonMissingTypeOfSymbol(prop); - const type = exactOptionalPropertyTypes || propType.flags & 32768 /* Undefined */ || keyType === numberType || !(prop.flags & 16777216 /* Optional */) ? propType : getTypeWithFacts(propType, 524288 /* NEUndefined */); - const related = isRelatedTo( - type, - targetInfo.type, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - if (!related) { - if (reportErrors2) { - reportError(Diagnostics.Property_0_is_incompatible_with_index_signature, symbolToString(prop)); - } - return 0 /* False */; - } - result2 &= related; - } - } - for (const info of getIndexInfosOfType(source2)) { - if (isApplicableIndexType(info.keyType, keyType)) { - const related = indexInfoRelatedTo(info, targetInfo, reportErrors2, intersectionState); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - } - return result2; - } - function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState) { - const related = isRelatedTo( - sourceInfo.type, - targetInfo.type, - 3 /* Both */, - reportErrors2, - /*headMessage*/ - void 0, - intersectionState - ); - if (!related && reportErrors2) { - if (sourceInfo.keyType === targetInfo.keyType) { - reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType)); - } else { - reportError(Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType)); - } - } - return related; - } - function indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportErrors2, intersectionState) { - if (relation === identityRelation) { - return indexSignaturesIdenticalTo(source2, target2); - } - const indexInfos = getIndexInfosOfType(target2); - const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType); - let result2 = -1 /* True */; - for (const targetInfo of indexInfos) { - const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); - if (!related) { - return 0 /* False */; - } - result2 &= related; - } - return result2; - } - function typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { - const sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType); - if (sourceInfo) { - return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState); - } - if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) { - return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); - } - if (reportErrors2) { - reportError(Diagnostics.Index_signature_for_type_0_is_missing_in_type_1, typeToString(targetInfo.keyType), typeToString(source2)); - } - return 0 /* False */; - } - function indexSignaturesIdenticalTo(source2, target2) { - const sourceInfos = getIndexInfosOfType(source2); - const targetInfos = getIndexInfosOfType(target2); - if (sourceInfos.length !== targetInfos.length) { - return 0 /* False */; - } - for (const targetInfo of targetInfos) { - const sourceInfo = getIndexInfoOfType(source2, targetInfo.keyType); - if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */) && sourceInfo.isReadonly === targetInfo.isReadonly)) { - return 0 /* False */; - } - } - return -1 /* True */; - } - function constructorVisibilitiesAreCompatible(sourceSignature, targetSignature, reportErrors2) { - if (!sourceSignature.declaration || !targetSignature.declaration) { - return true; - } - const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration, 6 /* NonPublicAccessibilityModifier */); - const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration, 6 /* NonPublicAccessibilityModifier */); - if (targetAccessibility === 2 /* Private */) { - return true; - } - if (targetAccessibility === 4 /* Protected */ && sourceAccessibility !== 2 /* Private */) { - return true; - } - if (targetAccessibility !== 4 /* Protected */ && !sourceAccessibility) { - return true; - } - if (reportErrors2) { - reportError(Diagnostics.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type, visibilityToString(sourceAccessibility), visibilityToString(targetAccessibility)); - } - return false; - } - } - function typeCouldHaveTopLevelSingletonTypes(type) { - if (type.flags & 16 /* Boolean */) { - return false; - } - if (type.flags & 3145728 /* UnionOrIntersection */) { - return !!forEach(type.types, typeCouldHaveTopLevelSingletonTypes); - } - if (type.flags & 465829888 /* Instantiable */) { - const constraint = getConstraintOfType(type); - if (constraint && constraint !== type) { - return typeCouldHaveTopLevelSingletonTypes(constraint); - } - } - return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */) || !!(type.flags & 268435456 /* StringMapping */); - } - function getExactOptionalUnassignableProperties(source, target) { - if (isTupleType(source) && isTupleType(target)) return emptyArray; - return getPropertiesOfType(target).filter((targetProp) => isExactOptionalPropertyMismatch(getTypeOfPropertyOfType(source, targetProp.escapedName), getTypeOfSymbol(targetProp))); - } - function isExactOptionalPropertyMismatch(source, target) { - return !!source && !!target && maybeTypeOfKind(source, 32768 /* Undefined */) && !!containsMissingType(target); - } - function getExactOptionalProperties(type) { - return getPropertiesOfType(type).filter((targetProp) => containsMissingType(getTypeOfSymbol(targetProp))); - } - function getBestMatchingType(source, target, isRelatedTo = compareTypesAssignable) { - return findMatchingDiscriminantType(source, target, isRelatedTo) || findMatchingTypeReferenceOrTypeAliasReference(source, target) || findBestTypeForObjectLiteral(source, target) || findBestTypeForInvokable(source, target) || findMostOverlappyType(source, target); - } - function discriminateTypeByDiscriminableItems(target, discriminators, related) { - const types = target.types; - const include = types.map((t) => t.flags & 402784252 /* Primitive */ ? 0 /* False */ : -1 /* True */); - for (const [getDiscriminatingType, propertyName] of discriminators) { - let matched = false; - for (let i = 0; i < types.length; i++) { - if (include[i]) { - const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName); - if (targetType) { - if (someType(getDiscriminatingType(), (t) => !!related(t, targetType))) { - matched = true; - } else { - include[i] = 3 /* Maybe */; - } - } - } - } - for (let i = 0; i < types.length; i++) { - if (include[i] === 3 /* Maybe */) { - include[i] = matched ? 0 /* False */ : -1 /* True */; - } - } - } - 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) { - if (type.flags & 524288 /* Object */) { - const resolved = resolveStructuredTypeMembers(type); - return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 && resolved.indexInfos.length === 0 && resolved.properties.length > 0 && every(resolved.properties, (p) => !!(p.flags & 16777216 /* Optional */)); - } - if (type.flags & 33554432 /* Substitution */) { - return isWeakType(type.baseType); - } - if (type.flags & 2097152 /* Intersection */) { - return every(type.types, isWeakType); - } - return false; - } - function hasCommonProperties(source, target, isComparingJsxAttributes) { - for (const prop of getPropertiesOfType(source)) { - if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { - return true; - } - } - return false; - } - function getVariances(type) { - return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */ ? arrayVariances : getVariancesWorker(type.symbol, type.typeParameters); - } - function getAliasVariances(symbol) { - return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters); - } - function getVariancesWorker(symbol, typeParameters = emptyArray) { - var _a, _b; - const links = getSymbolLinks(symbol); - if (!links.variances) { - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) }); - const oldVarianceComputation = inVarianceComputation; - const saveResolutionStart = resolutionStart; - if (!inVarianceComputation) { - inVarianceComputation = true; - resolutionStart = resolutionTargets.length; - } - links.variances = emptyArray; - const variances = []; - for (const tp of typeParameters) { - const modifiers = getTypeParameterModifiers(tp); - 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; - const oldHandler = outofbandVarianceMarkerHandler; - outofbandVarianceMarkerHandler = (onlyUnreliable) => onlyUnreliable ? unreliable = true : unmeasurable = true; - const typeWithSuper = createMarkerType(symbol, tp, markerSuperType); - const typeWithSub = createMarkerType(symbol, tp, markerSubType); - variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 /* Covariant */ : 0) | (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 /* Contravariant */ : 0); - if (variance === 3 /* Bivariant */ && isTypeAssignableTo(createMarkerType(symbol, tp, markerOtherType), typeWithSuper)) { - variance = 4 /* Independent */; - } - outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable || unreliable) { - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; - } - } - } - variances.push(variance); - } - if (!oldVarianceComputation) { - inVarianceComputation = false; - resolutionStart = saveResolutionStart; - } - links.variances = variances; - (_b = tracing) == null ? void 0 : _b.pop({ variances: variances.map(Debug.formatVariance) }); - } - return links.variances; - } - function createMarkerType(symbol, source, target) { - const mapper = makeUnaryTypeMapper(source, target); - const type = getDeclaredTypeOfSymbol(symbol); - if (isErrorType(type)) { - return type; - } - const result = symbol.flags & 524288 /* TypeAlias */ ? getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters, mapper)) : createTypeReference(type, instantiateTypes(type.typeParameters, mapper)); - markerTypes.add(getTypeId(result)); - return result; - } - function isMarkerType(type) { - return markerTypes.has(getTypeId(type)); - } - function getTypeParameterModifiers(tp) { - var _a; - 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++) { - if ((variances[i] & 7 /* VarianceMask */) === 1 /* Covariant */ && typeArguments[i].flags & 16384 /* Void */) { - return true; - } - } - return false; - } - function isUnconstrainedTypeParameter(type) { - return type.flags & 262144 /* TypeParameter */ && !getConstraintOfTypeParameter(type); - } - function isNonDeferredTypeReference(type) { - return !!(getObjectFlags(type) & 4 /* Reference */) && !type.node; - } - function isTypeReferenceWithGenericArguments(type) { - return isNonDeferredTypeReference(type) && some(getTypeArguments(type), (t) => !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t)); - } - function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { - const typeParameters = []; - let constraintMarker = ""; - const sourceId = getTypeReferenceId(source, 0); - const targetId = getTypeReferenceId(target, 0); - return `${constraintMarker}${sourceId},${targetId}${postFix}`; - function getTypeReferenceId(type, depth = 0) { - let result = "" + type.target.id; - for (const t of getTypeArguments(type)) { - if (t.flags & 262144 /* TypeParameter */) { - if (ignoreConstraints || isUnconstrainedTypeParameter(t)) { - let index = typeParameters.indexOf(t); - if (index < 0) { - index = typeParameters.length; - typeParameters.push(t); - } - result += "=" + index; - continue; - } - constraintMarker = "*"; - } else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { - result += "<" + getTypeReferenceId(t, depth + 1) + ">"; - continue; - } - result += "-" + t.id; - } - return result; - } - } - function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { - if (relation === identityRelation && source.id > target.id) { - const temp = source; - source = target; - target = temp; - } - const postFix = intersectionState ? ":" + intersectionState : ""; - return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : `${source.id},${target.id}${postFix}`; - } - function forEachProperty2(prop, callback) { - if (getCheckFlags(prop) & 6 /* Synthetic */) { - for (const t of prop.links.containingType.types) { - const p = getPropertyOfType(t, prop.escapedName); - const result = p && forEachProperty2(p, callback); - if (result) { - return result; - } - } - return void 0; - } - return callback(prop); - } - function getDeclaringClass(prop) { - return prop.parent && prop.parent.flags & 32 /* Class */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : void 0; - } - function getTypeOfPropertyInBaseClass(property) { - const classType = getDeclaringClass(property); - const baseClassType = classType && getBaseTypes(classType)[0]; - return baseClassType && getTypeOfPropertyOfType(baseClassType, property.escapedName); - } - function isPropertyInClassDerivedFrom(prop, baseClass) { - return forEachProperty2(prop, (sp) => { - const sourceClass = getDeclaringClass(sp); - return sourceClass ? hasBaseType(sourceClass, baseClass) : false; - }); - } - function isValidOverrideOf(sourceProp, targetProp) { - 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) & 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)); - } - const identity2 = getRecursionIdentity(type); - let count = 0; - let lastTypeId = 0; - for (let i = 0; i < depth; i++) { - const t = stack[i]; - if (hasMatchingRecursionIdentity(t, identity2)) { - if (t.id >= lastTypeId) { - count++; - if (count >= maxDepth) { - return true; - } - } - lastTypeId = t.id; - } - } - } - 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) { - return type.node; - } - if (type.symbol && !(getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) { - return type.symbol; - } - if (isTupleType(type)) { - return type.target; - } - } - if (type.flags & 262144 /* TypeParameter */) { - return type.symbol; - } - if (type.flags & 8388608 /* IndexedAccess */) { - do { - type = type.objectType; - } while (type.flags & 8388608 /* IndexedAccess */); - return type; - } - if (type.flags & 16777216 /* Conditional */) { - return type.root; - } - return type; - } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties2(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; - } - function compareProperties2(sourceProp, targetProp, compareTypes) { - if (sourceProp === targetProp) { - return -1 /* True */; - } - const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 6 /* NonPublicAccessibilityModifier */; - const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 6 /* NonPublicAccessibilityModifier */; - if (sourcePropAccessibility !== targetPropAccessibility) { - return 0 /* False */; - } - if (sourcePropAccessibility) { - if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { - return 0 /* False */; - } - } else { - if ((sourceProp.flags & 16777216 /* Optional */) !== (targetProp.flags & 16777216 /* Optional */)) { - return 0 /* False */; - } - } - if (isReadonlySymbol(sourceProp) !== isReadonlySymbol(targetProp)) { - return 0 /* False */; - } - return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); - } - function isMatchingSignature(source, target, partialMatch) { - const sourceParameterCount = getParameterCount(source); - const targetParameterCount = getParameterCount(target); - const sourceMinArgumentCount = getMinArgumentCount(source); - const targetMinArgumentCount = getMinArgumentCount(target); - const sourceHasRestParameter = hasEffectiveRestParameter(source); - const targetHasRestParameter = hasEffectiveRestParameter(target); - if (sourceParameterCount === targetParameterCount && sourceMinArgumentCount === targetMinArgumentCount && sourceHasRestParameter === targetHasRestParameter) { - return true; - } - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { - return true; - } - return false; - } - function compareSignaturesIdentical(source, target, partialMatch, ignoreThisTypes, ignoreReturnTypes, compareTypes) { - if (source === target) { - return -1 /* True */; - } - if (!isMatchingSignature(source, target, partialMatch)) { - return 0 /* False */; - } - if (length(source.typeParameters) !== length(target.typeParameters)) { - return 0 /* False */; - } - if (target.typeParameters) { - const mapper = createTypeMapper(source.typeParameters, target.typeParameters); - for (let i = 0; i < target.typeParameters.length; i++) { - const s = source.typeParameters[i]; - const t = target.typeParameters[i]; - if (!(s === t || compareTypes(instantiateType(getConstraintFromTypeParameter(s), mapper) || unknownType, getConstraintFromTypeParameter(t) || unknownType) && compareTypes(instantiateType(getDefaultFromTypeParameter(s), mapper) || unknownType, getDefaultFromTypeParameter(t) || unknownType))) { - return 0 /* False */; - } - } - source = instantiateSignature( - source, - mapper, - /*eraseTypeParameters*/ - true - ); - } - let result = -1 /* True */; - if (!ignoreThisTypes) { - const sourceThisType = getThisTypeOfSignature(source); - if (sourceThisType) { - const targetThisType = getThisTypeOfSignature(target); - if (targetThisType) { - const related = compareTypes(sourceThisType, targetThisType); - if (!related) { - return 0 /* False */; - } - result &= related; - } - } - } - const targetLen = getParameterCount(target); - for (let i = 0; i < targetLen; i++) { - const s = getTypeAtPosition(source, i); - const t = getTypeAtPosition(target, i); - const related = compareTypes(t, s); - if (!related) { - return 0 /* False */; - } - result &= related; - } - if (!ignoreReturnTypes) { - const sourceTypePredicate = getTypePredicateOfSignature(source); - const targetTypePredicate = getTypePredicateOfSignature(target); - result &= sourceTypePredicate || targetTypePredicate ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } - return result; - } - function compareTypePredicatesIdentical(source, target, compareTypes) { - return !(source && target && typePredicateKindsMatch(source, target)) ? 0 /* False */ : source.type === target.type ? -1 /* True */ : source.type && target.type ? compareTypes(source.type, target.type) : 0 /* False */; - } - function literalTypesWithSameBaseType(types) { - let commonBaseType; - for (const t of types) { - if (!(t.flags & 131072 /* Never */)) { - const baseType = getBaseTypeOfLiteralType(t); - commonBaseType ?? (commonBaseType = baseType); - if (baseType === t || baseType !== commonBaseType) { - return false; - } - } - } - return true; - } - function getCombinedTypeFlags(types) { - return reduceLeft(types, (flags, t) => flags | (t.flags & 1048576 /* Union */ ? getCombinedTypeFlags(t.types) : t.flags), 0); - } - function getCommonSupertype(types) { - if (types.length === 1) { - return types[0]; - } - const primaryTypes = strictNullChecks ? sameMap(types, (t) => filterType(t, (u) => !(u.flags & 98304 /* Nullable */))) : types; - const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : getSingleCommonSupertype(primaryTypes); - return primaryTypes === types ? superTypeOrUnion : getNullableType(superTypeOrUnion, getCombinedTypeFlags(types) & 98304 /* Nullable */); - } - function getSingleCommonSupertype(types) { - const candidate = reduceLeft(types, (s, t) => isTypeStrictSubtypeOf(s, t) ? t : s); - return every(types, (t) => t === candidate || isTypeStrictSubtypeOf(t, candidate)) ? candidate : reduceLeft(types, (s, t) => isTypeSubtypeOf(s, t) ? t : s); - } - function getCommonSubtype(types) { - return reduceLeft(types, (s, t) => isTypeSubtypeOf(t, s) ? t : s); - } - function isArrayType(type) { - return !!(getObjectFlags(type) & 4 /* Reference */) && (type.target === globalArrayType || type.target === globalReadonlyArrayType); - } - function isReadonlyArrayType(type) { - return !!(getObjectFlags(type) & 4 /* Reference */) && type.target === globalReadonlyArrayType; - } - function isArrayOrTupleType(type) { - return isArrayType(type) || isTupleType(type); - } - function isMutableArrayOrTuple(type) { - return isArrayType(type) && !isReadonlyArrayType(type) || isTupleType(type) && !type.target.readonly; - } - function getElementTypeOfArrayType(type) { - return isArrayType(type) ? getTypeArguments(type)[0] : void 0; - } - 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; - } - if (getObjectFlags(type) & 33554432 /* IdenticalBaseTypeCalculated */) { - return getObjectFlags(type) & 67108864 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0; - } - type.objectFlags |= 33554432 /* IdenticalBaseTypeCalculated */; - const target = type.target; - if (getObjectFlags(target) & 1 /* Class */) { - const baseTypeNode = getBaseTypeNodeOfClass(target); - if (baseTypeNode && baseTypeNode.expression.kind !== 80 /* Identifier */ && baseTypeNode.expression.kind !== 212 /* PropertyAccessExpression */) { - return void 0; - } - } - const bases = getBaseTypes(target); - if (bases.length !== 1) { - return void 0; - } - if (getMembersOfSymbol(type.symbol).size) { - return void 0; - } - let instantiatedBase = !length(target.typeParameters) ? bases[0] : instantiateType(bases[0], createTypeMapper(target.typeParameters, getTypeArguments(type).slice(0, target.typeParameters.length))); - if (length(getTypeArguments(type)) > length(target.typeParameters)) { - instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type))); - } - type.objectFlags |= 67108864 /* IdenticalBaseTypeExists */; - return type.cachedEquivalentBaseType = instantiatedBase; - } - function isEmptyLiteralType(type) { - return strictNullChecks ? type === implicitNeverType : type === undefinedWideningType; - } - function isEmptyArrayLiteralType(type) { - const elementType = getElementTypeOfArrayType(type); - return !!elementType && isEmptyLiteralType(elementType); - } - function isTupleLikeType(type) { - 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); - } - function getTupleElementType(type, index) { - const propType = getTypeOfPropertyOfType(type, "" + index); - if (propType) { - return propType; - } - if (everyType(type, isTupleType)) { - return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0); - } - return void 0; - } - function isNeitherUnitTypeNorNever(type) { - return !(type.flags & (109472 /* Unit */ | 131072 /* Never */)); - } - function isUnitType(type) { - return !!(type.flags & 109472 /* Unit */); - } - function isUnitLikeType(type) { - const t = getBaseConstraintOrType(type); - return t.flags & 2097152 /* Intersection */ ? some(t.types, isUnitType) : isUnitType(t); - } - function extractUnitType(type) { - return type.flags & 2097152 /* Intersection */ ? find(type.types, isUnitType) || type : type; - } - function isLiteralType(type) { - return type.flags & 16 /* Boolean */ ? true : type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : every(type.types, isUnitType) : isUnitType(type); - } - function getBaseTypeOfLiteralType(type) { - return type.flags & 1056 /* EnumLike */ ? getBaseTypeOfEnumLikeType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type; - } - function getBaseTypeOfLiteralTypeUnion(type) { - const key = `B${getTypeId(type)}`; - return getCachedType(key) ?? setCachedType(key, mapType(type, getBaseTypeOfLiteralType)); - } - function getBaseTypeOfLiteralTypeForComparison(type) { - return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type; - } - function getWidenedLiteralType(type) { - return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type; - } - function getWidenedUniqueESSymbolType(type) { - return type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedUniqueESSymbolType) : type; - } - function getWidenedLiteralLikeTypeForContextualType(type, contextualType) { - if (!isLiteralOfContextualType(type, contextualType)) { - type = getWidenedUniqueESSymbolType(getWidenedLiteralType(type)); - } - return getRegularTypeOfLiteralType(type); - } - function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(type, contextualSignatureReturnType, isAsync) { - if (type && isUnitType(type)) { - const contextualType = !contextualSignatureReturnType ? void 0 : isAsync ? getPromisedTypeOfPromise(contextualSignatureReturnType) : contextualSignatureReturnType; - type = getWidenedLiteralLikeTypeForContextualType(type, contextualType); - } - return type; - } - function getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(type, contextualSignatureReturnType, kind, isAsyncGenerator) { - if (type && isUnitType(type)) { - const contextualType = !contextualSignatureReturnType ? void 0 : getIterationTypeOfGeneratorFunctionReturnType(kind, contextualSignatureReturnType, isAsyncGenerator); - type = getWidenedLiteralLikeTypeForContextualType(type, contextualType); - } - return type; - } - function isTupleType(type) { - return !!(getObjectFlags(type) & 4 /* Reference */ && type.target.objectFlags & 8 /* Tuple */); - } - function isGenericTupleType(type) { - return isTupleType(type) && !!(type.target.combinedFlags & 8 /* Variadic */); - } - function isSingleElementGenericTupleType(type) { - return isGenericTupleType(type) && type.target.elementFlags.length === 1; - } - 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); - } - function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false, noReductions = false) { - const length2 = getTypeReferenceArity(type) - endSkipCount; - if (index < length2) { - const typeArguments = getTypeArguments(type); - const elementTypes = []; - for (let i = index; i < length2; i++) { - const t = typeArguments[i]; - elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t); - } - return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes, noReductions ? 0 /* None */ : 1 /* Literal */); - } - return void 0; - } - function isTupleTypeStructureMatching(t1, t2) { - return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f, i) => (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */)); - } - function isZeroBigInt({ value }) { - return value.base10Value === "0"; - } - function removeDefinitelyFalsyTypes(type) { - return filterType(type, (t) => hasTypeFacts(t, 4194304 /* Truthy */)); - } - function extractDefinitelyFalsyTypes(type) { - return mapType(type, getDefinitelyFalsyPartOfType); - } - function getDefinitelyFalsyPartOfType(type) { - return type.flags & 4 /* String */ ? emptyStringType : type.flags & 8 /* Number */ ? zeroType : type.flags & 64 /* BigInt */ ? zeroBigIntType : type === regularFalseType || type === falseType || type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */ | 3 /* AnyOrUnknown */) || type.flags & 128 /* StringLiteral */ && type.value === "" || type.flags & 256 /* NumberLiteral */ && type.value === 0 || type.flags & 2048 /* BigIntLiteral */ && isZeroBigInt(type) ? type : neverType; - } - function getNullableType(type, flags) { - const missing = flags & ~type.flags & (32768 /* Undefined */ | 65536 /* Null */); - return missing === 0 ? type : missing === 32768 /* Undefined */ ? getUnionType([type, undefinedType]) : missing === 65536 /* Null */ ? getUnionType([type, nullType]) : getUnionType([type, undefinedType, nullType]); - } - function getOptionalType(type, isProperty = false) { - Debug.assert(strictNullChecks); - const missingOrUndefined = isProperty ? undefinedOrMissingType : undefinedType; - return type === missingOrUndefined || type.flags & 1048576 /* Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]); - } - function getGlobalNonNullableTypeInstantiation(type) { - if (!deferredGlobalNonNullableTypeAlias) { - deferredGlobalNonNullableTypeAlias = getGlobalSymbol( - "NonNullable", - 524288 /* TypeAlias */, - /*diagnostic*/ - void 0 - ) || unknownSymbol; - } - return deferredGlobalNonNullableTypeAlias !== unknownSymbol ? getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]) : getIntersectionType([type, emptyObjectType]); - } - function getNonNullableType(type) { - return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type; - } - function addOptionalTypeMarker(type) { - return strictNullChecks ? getUnionType([type, optionalType]) : type; - } - function removeOptionalTypeMarker(type) { - return strictNullChecks ? removeType(type, optionalType) : type; - } - function propagateOptionalTypeMarker(type, node, wasOptional) { - return wasOptional ? isOutermostOptionalChain(node) ? getOptionalType(type) : addOptionalTypeMarker(type) : type; - } - function getOptionalExpressionType(exprType, expression) { - return isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) : isOptionalChain(expression) ? removeOptionalTypeMarker(exprType) : exprType; - } - function removeMissingType(type, isOptional) { - return exactOptionalPropertyTypes && isOptional ? removeType(type, missingType) : type; - } - function containsMissingType(type) { - return type === missingType || !!(type.flags & 1048576 /* Union */) && type.types[0] === missingType; - } - function removeMissingOrUndefinedType(type) { - return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288 /* NEUndefined */); - } - function isCoercibleUnderDoubleEquals(source, target) { - return (source.flags & (8 /* Number */ | 4 /* String */ | 512 /* BooleanLiteral */)) !== 0 && (target.flags & (8 /* Number */ | 4 /* String */ | 16 /* Boolean */)) !== 0; - } - function isObjectTypeWithInferableIndex(type) { - const objectFlags = getObjectFlags(type); - return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source)); - } - function createSymbolWithType(source, type) { - const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */); - symbol.declarations = source.declarations; - symbol.parent = source.parent; - symbol.links.type = type; - symbol.links.target = source; - if (source.valueDeclaration) { - symbol.valueDeclaration = source.valueDeclaration; - } - const nameType = getSymbolLinks(source).nameType; - if (nameType) { - symbol.links.nameType = nameType; - } - return symbol; - } - function transformTypeOfMembers(type, f) { - const members = createSymbolTable(); - for (const property of getPropertiesOfObjectType(type)) { - const original = getTypeOfSymbol(property); - const updated = f(original); - members.set(property.escapedName, updated === original ? property : createSymbolWithType(property, updated)); - } - return members; - } - function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType2(type) && getObjectFlags(type) & 8192 /* FreshLiteral */)) { - return type; - } - const regularType = type.regularType; - if (regularType) { - return regularType; - } - const resolved = type; - const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); - const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos); - regularNew.flags = resolved.flags; - regularNew.objectFlags |= resolved.objectFlags & ~8192 /* FreshLiteral */; - type.regularType = regularNew; - return regularNew; - } - function createWideningContext(parent2, propertyName, siblings) { - return { parent: parent2, propertyName, siblings, resolvedProperties: void 0 }; - } - function getSiblingsOfContext(context) { - if (!context.siblings) { - const siblings = []; - for (const type of getSiblingsOfContext(context.parent)) { - if (isObjectLiteralType2(type)) { - const prop = getPropertyOfObjectType(type, context.propertyName); - if (prop) { - forEachType(getTypeOfSymbol(prop), (t) => { - siblings.push(t); - }); - } - } - } - context.siblings = siblings; - } - return context.siblings; - } - function getPropertiesOfContext(context) { - if (!context.resolvedProperties) { - const names = /* @__PURE__ */ new Map(); - for (const t of getSiblingsOfContext(context)) { - if (isObjectLiteralType2(t) && !(getObjectFlags(t) & 2097152 /* ContainsSpread */)) { - for (const prop of getPropertiesOfType(t)) { - names.set(prop.escapedName, prop); - } - } - } - context.resolvedProperties = arrayFrom(names.values()); - } - return context.resolvedProperties; - } - function getWidenedProperty(prop, context) { - if (!(prop.flags & 4 /* Property */)) { - return prop; - } - const original = getTypeOfSymbol(prop); - const propContext = context && createWideningContext( - context, - prop.escapedName, - /*siblings*/ - void 0 - ); - const widened = getWidenedTypeWithContext(original, propContext); - return widened === original ? prop : createSymbolWithType(prop, widened); - } - function getUndefinedProperty(prop) { - const cached = undefinedProperties.get(prop.escapedName); - if (cached) { - return cached; - } - const result = createSymbolWithType(prop, undefinedOrMissingType); - result.flags |= 16777216 /* Optional */; - undefinedProperties.set(prop.escapedName, result); - return result; - } - function getWidenedTypeOfObjectLiteral(type, context) { - const members = createSymbolTable(); - for (const prop of getPropertiesOfObjectType(type)) { - members.set(prop.escapedName, getWidenedProperty(prop, context)); - } - if (context) { - for (const prop of getPropertiesOfContext(context)) { - if (!members.has(prop.escapedName)) { - members.set(prop.escapedName, getUndefinedProperty(prop)); - } - } - } - const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly, info.declaration, info.components))); - result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */); - return result; - } - function getWidenedType(type) { - return getWidenedTypeWithContext( - type, - /*context*/ - void 0 - ); - } - function getWidenedTypeWithContext(type, context) { - if (getObjectFlags(type) & 196608 /* RequiresWidening */) { - if (context === void 0 && type.widened) { - return type.widened; - } - let result; - if (type.flags & (1 /* Any */ | 98304 /* Nullable */)) { - result = anyType; - } else if (isObjectLiteralType2(type)) { - result = getWidenedTypeOfObjectLiteral(type, context); - } else if (type.flags & 1048576 /* Union */) { - const unionContext = context || createWideningContext( - /*parent*/ - void 0, - /*propertyName*/ - void 0, - type.types - ); - const widenedTypes = sameMap(type.types, (t) => t.flags & 98304 /* Nullable */ ? t : getWidenedTypeWithContext(t, unionContext)); - result = getUnionType(widenedTypes, some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); - } else if (type.flags & 2097152 /* Intersection */) { - result = getIntersectionType(sameMap(type.types, getWidenedType)); - } else if (isArrayOrTupleType(type)) { - result = createTypeReference(type.target, sameMap(getTypeArguments(type), getWidenedType)); - } - if (result && context === void 0) { - type.widened = result; - } - return result || type; - } - return type; - } - function reportWideningErrorsInType(type) { - var _a; - let errorReported = false; - if (getObjectFlags(type) & 65536 /* ContainsWideningType */) { - if (type.flags & 1048576 /* Union */) { - if (some(type.types, isEmptyObjectType)) { - errorReported = true; - } else { - for (const t of type.types) { - errorReported || (errorReported = reportWideningErrorsInType(t)); - } - } - } else if (isArrayOrTupleType(type)) { - for (const t of getTypeArguments(type)) { - errorReported || (errorReported = reportWideningErrorsInType(t)); - } - } else if (isObjectLiteralType2(type)) { - for (const p of getPropertiesOfObjectType(type)) { - const t = getTypeOfSymbol(p); - if (getObjectFlags(t) & 65536 /* ContainsWideningType */) { - errorReported = reportWideningErrorsInType(t); - if (!errorReported) { - const valueDeclaration = (_a = p.declarations) == null ? void 0 : _a.find((d) => { - var _a2; - return ((_a2 = d.symbol.valueDeclaration) == null ? void 0 : _a2.parent) === type.symbol.valueDeclaration; - }); - if (valueDeclaration) { - error2(valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); - errorReported = true; - } - } - } - } - } - } - return errorReported; - } - function reportImplicitAny(declaration, type, wideningKind) { - const typeAsString = typeToString(getWidenedType(type)); - if (isInJSFile(declaration) && !isCheckJsEnabledForFile(getSourceFileOfNode(declaration), compilerOptions)) { - return; - } - let diagnostic; - switch (declaration.kind) { - case 227 /* BinaryExpression */: - case 173 /* PropertyDeclaration */: - case 172 /* 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 170 /* 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.includes(param) && (resolveName( - param, - param.name.escapedText, - 788968 /* Type */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) { - const newName = "arg" + param.parent.parameters.indexOf(param); - const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); - errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); - return; - } - } - 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 209 /* BindingElement */: - diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type; - if (!noImplicitAny) { - return; - } - break; - case 318 /* JSDocFunctionType */: - error2(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); - return; - case 324 /* JSDocSignature */: - if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { - error2(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); - } - return; - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - if (noImplicitAny && !declaration.name) { - if (wideningKind === 3 /* GeneratorYield */) { - error2(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation, typeAsString); - } else { - 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 201 /* MappedType */: - if (noImplicitAny) { - error2(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); - } - return; - default: - diagnostic = noImplicitAny ? Diagnostics.Variable_0_implicitly_has_an_1_type : Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; - } - errorOrSuggestion(noImplicitAny, declaration, diagnostic, declarationNameToString(getNameOfDeclaration(declaration)), typeAsString); - } - function shouldReportErrorsFromWideningWithContextualSignature(declaration, wideningKind) { - const signature = getContextualSignatureForFunctionLikeDeclaration(declaration); - if (!signature) { - return true; - } - let returnType = getReturnTypeOfSignature(signature); - const flags = getFunctionFlags(declaration); - switch (wideningKind) { - case 1 /* FunctionReturn */: - if (flags & 1 /* Generator */) { - returnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, !!(flags & 2 /* Async */)) ?? returnType; - } else if (flags & 2 /* Async */) { - returnType = getAwaitedTypeNoAlias(returnType) ?? returnType; - } - return isGenericType(returnType); - case 3 /* GeneratorYield */: - const yieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, !!(flags & 2 /* Async */)); - return !!yieldType && isGenericType(yieldType); - case 2 /* GeneratorNext */: - const nextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, !!(flags & 2 /* Async */)); - return !!nextType && isGenericType(nextType); - } - return false; - } - function reportErrorsFromWidening(declaration, type, wideningKind) { - addLazyDiagnostic(() => { - if (noImplicitAny && getObjectFlags(type) & 65536 /* ContainsWideningType */) { - if (!wideningKind || isFunctionLikeDeclaration(declaration) && shouldReportErrorsFromWideningWithContextualSignature(declaration, wideningKind)) { - if (!reportWideningErrorsInType(type)) { - reportImplicitAny(declaration, type, wideningKind); - } - } - } - }); - } - function applyToParameterTypes(source, target, callback) { - const sourceCount = getParameterCount(source); - const targetCount = getParameterCount(target); - const sourceRestType = getEffectiveRestType(source); - const targetRestType = getEffectiveRestType(target); - const targetNonRestCount = targetRestType ? targetCount - 1 : targetCount; - const paramCount = sourceRestType ? targetNonRestCount : Math.min(sourceCount, targetNonRestCount); - const sourceThisType = getThisTypeOfSignature(source); - if (sourceThisType) { - const targetThisType = getThisTypeOfSignature(target); - if (targetThisType) { - callback(sourceThisType, targetThisType); - } - } - for (let i = 0; i < paramCount; i++) { - callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); - } - if (targetRestType) { - callback(getRestTypeAtPosition( - source, - paramCount, - /*readonly*/ - isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType) - ), targetRestType); - } - } - function applyToReturnTypes(source, target, callback) { - const targetTypePredicate = getTypePredicateOfSignature(target); - if (targetTypePredicate) { - const sourceTypePredicate = getTypePredicateOfSignature(source); - if (sourceTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) { - callback(sourceTypePredicate.type, targetTypePredicate.type); - return; - } - } - const targetReturnType = getReturnTypeOfSignature(target); - if (couldContainTypeVariables(targetReturnType)) { - callback(getReturnTypeOfSignature(source), targetReturnType); - } - } - function createInferenceContext(typeParameters, signature, flags, compareTypes) { - return createInferenceContextWorker(typeParameters.map(createInferenceInfo), signature, flags, compareTypes || compareTypesAssignable); - } - function cloneInferenceContext(context, extraFlags = 0) { - return context && createInferenceContextWorker(map(context.inferences, cloneInferenceInfo), context.signature, context.flags | extraFlags, context.compareTypes); - } - function createInferenceContextWorker(inferences, signature, flags, compareTypes) { - const context = { - inferences, - signature, - flags, - compareTypes, - mapper: reportUnmeasurableMapper, - // initialize to a noop mapper so the context object is available, but the underlying object shape is right upon construction - nonFixingMapper: reportUnmeasurableMapper - }; - context.mapper = makeFixingMapperForContext(context); - context.nonFixingMapper = makeNonFixingMapperForContext(context); - 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); - }) - ); - } - function makeNonFixingMapperForContext(context) { - return makeDeferredTypeMapper( - map(context.inferences, (i) => i.typeParameter), - map(context.inferences, (_, i) => () => { - return getInferredType(context, i); - }) - ); - } - function clearCachedInferences(inferences) { - for (const inference of inferences) { - if (!inference.isFixed) { - inference.inferredType = void 0; - } - } - } - function addIntraExpressionInferenceSite(context, node, type) { - (context.intraExpressionInferenceSites ?? (context.intraExpressionInferenceSites = [])).push({ node, type }); - } - function inferFromIntraExpressionSites(context) { - if (context.intraExpressionInferenceSites) { - for (const { node, type } of context.intraExpressionInferenceSites) { - const contextualType = node.kind === 175 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */); - if (contextualType) { - inferTypes(context.inferences, type, contextualType); - } - } - context.intraExpressionInferenceSites = void 0; - } - } - function createInferenceInfo(typeParameter) { - return { - typeParameter, - candidates: void 0, - contraCandidates: void 0, - inferredType: void 0, - priority: void 0, - topLevel: true, - isFixed: false, - impliedArity: void 0 - }; - } - function cloneInferenceInfo(inference) { - return { - typeParameter: inference.typeParameter, - candidates: inference.candidates && inference.candidates.slice(), - contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), - inferredType: inference.inferredType, - priority: inference.priority, - topLevel: inference.topLevel, - isFixed: inference.isFixed, - impliedArity: inference.impliedArity - }; - } - function cloneInferredPartOfContext(context) { - const inferences = filter(context.inferences, hasInferenceCandidates); - return inferences.length ? createInferenceContextWorker(map(inferences, cloneInferenceInfo), context.signature, context.flags, context.compareTypes) : void 0; - } - function getMapperFromContext(context) { - return context && context.mapper; - } - function couldContainTypeVariables(type) { - const objectFlags = getObjectFlags(type); - 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 */ && !(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, 266 /* TypeAliasDeclaration */); - return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 308 /* SourceFile */ ? true : n.kind === 268 /* ModuleDeclaration */ ? false : "quit")); - } - return false; - } - function isTypeParameterAtTopLevel(type, tp, depth = 0) { - return !!(type === tp || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, tp, depth)) || depth < 3 && type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), tp, depth + 1) || isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), tp, depth + 1))); - } - function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { - const typePredicate = getTypePredicateOfSignature(signature); - return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter); - } - function createEmptyObjectTypeFromStringLiteral(type) { - const members = createSymbolTable(); - forEachType(type, (t) => { - if (!(t.flags & 128 /* StringLiteral */)) { - return; - } - const name = escapeLeadingUnderscores(t.value); - const literalProp = createSymbol(4 /* Property */, name); - literalProp.links.type = anyType; - if (t.symbol) { - literalProp.declarations = t.symbol.declarations; - literalProp.valueDeclaration = t.symbol.valueDeclaration; - } - members.set(name, literalProp); - }); - const indexInfos = type.flags & 4 /* String */ ? [createIndexInfo( - stringType, - emptyObjectType, - /*isReadonly*/ - false - )] : emptyArray; - return createAnonymousType( - /*symbol*/ - void 0, - members, - emptyArray, - emptyArray, - indexInfos - ); - } - function inferTypeForHomomorphicMappedType(source, target, constraint) { - const cacheKey = source.id + "," + target.id + "," + constraint.id; - if (reverseHomomorphicMappedCache.has(cacheKey)) { - return reverseHomomorphicMappedCache.get(cacheKey); - } - const type = createReverseMappedType(source, target, constraint); - reverseHomomorphicMappedCache.set(cacheKey, type); - return type; - } - function isPartiallyInferableType(type) { - return !(getObjectFlags(type) & 262144 /* NonInferrableType */) || isObjectLiteralType2(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType); - } - function createReverseMappedType(source, target, constraint) { - if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) { - return void 0; - } - if (isArrayType(source)) { - const elementType = inferReverseMappedType(getTypeArguments(source)[0], target, constraint); - if (!elementType) { - return void 0; - } - return createArrayType(elementType, isReadonlyArrayType(source)); - } - if (isTupleType(source)) { - const elementTypes = map(getElementTypes(source), (t) => inferReverseMappedType(t, target, constraint)); - if (!every(elementTypes, (t) => !!t)) { - return void 0; - } - const elementFlags = getMappedTypeModifiers(target) & 4 /* IncludeOptional */ ? sameMap(source.target.elementFlags, (f) => f & 2 /* Optional */ ? 1 /* Required */ : f) : source.target.elementFlags; - return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations); - } - const reversed = createObjectType( - 1024 /* ReverseMapped */ | 16 /* Anonymous */, - /*symbol*/ - void 0 - ); - reversed.source = source; - reversed.mappedType = target; - reversed.constraintType = constraint; - return reversed; - } - function getTypeOfReverseMappedSymbol(symbol) { - const links = getSymbolLinks(symbol); - if (!links.type) { - links.type = inferReverseMappedType(symbol.links.propertyType, symbol.links.mappedType, symbol.links.constraintType) || unknownType; - } - return links.type; - } - function inferReverseMappedTypeWorker(sourceType, target, constraint) { - const typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target)); - const templateType = getTemplateTypeFromMappedType(target); - const inference = createInferenceInfo(typeParameter); - inferTypes([inference], sourceType, templateType); - return getTypeFromInference(inference) || unknownType; - } - function inferReverseMappedType(source, target, constraint) { - const cacheKey = source.id + "," + target.id + "," + constraint.id; - if (reverseMappedCache.has(cacheKey)) { - return reverseMappedCache.get(cacheKey) || unknownType; - } - reverseMappedSourceStack.push(source); - reverseMappedTargetStack.push(target); - const saveExpandingFlags = reverseExpandingFlags; - if (isDeeplyNestedType(source, reverseMappedSourceStack, reverseMappedSourceStack.length, 2)) reverseExpandingFlags |= 1 /* Source */; - if (isDeeplyNestedType(target, reverseMappedTargetStack, reverseMappedTargetStack.length, 2)) reverseExpandingFlags |= 2 /* Target */; - let type; - if (reverseExpandingFlags !== 3 /* Both */) { - type = inferReverseMappedTypeWorker(source, target, constraint); - } - reverseMappedSourceStack.pop(); - reverseMappedTargetStack.pop(); - reverseExpandingFlags = saveExpandingFlags; - reverseMappedCache.set(cacheKey, type); - return type; - } - function* getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) { - const properties = getPropertiesOfType(target); - for (const targetProp of properties) { - if (isStaticPrivateIdentifierProperty(targetProp)) { - continue; - } - if (requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */ || getCheckFlags(targetProp) & 48 /* Partial */)) { - const sourceProp = getPropertyOfType(source, targetProp.escapedName); - if (!sourceProp) { - yield targetProp; - } else if (matchDiscriminantProperties) { - const targetType = getTypeOfSymbol(targetProp); - if (targetType.flags & 109472 /* Unit */) { - const sourceType = getTypeOfSymbol(sourceProp); - if (!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) { - yield targetProp; - } - } - } - } - } - } - function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) { - return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties)); - } - function tupleTypesDefinitelyUnrelated(source, target) { - return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !(target.target.combinedFlags & 12 /* Variable */) && (!!(source.target.combinedFlags & 12 /* Variable */) || target.target.fixedLength < source.target.fixedLength); - } - function typesDefinitelyUnrelated(source, target) { - return isTupleType(source) && isTupleType(target) ? tupleTypesDefinitelyUnrelated(source, target) : !!getUnmatchedProperty( - source, - target, - /*requireOptionalProperties*/ - false, - /*matchDiscriminantProperties*/ - true - ) && !!getUnmatchedProperty( - target, - source, - /*requireOptionalProperties*/ - false, - /*matchDiscriminantProperties*/ - false - ); - } - function getTypeFromInference(inference) { - return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : void 0; - } - function hasSkipDirectInferenceFlag(node) { - return !!getNodeLinks(node).skipDirectInference; - } - function isFromInferenceBlockedSource(type) { - return !!(type.symbol && some(type.symbol.declarations, hasSkipDirectInferenceFlag)); - } - function templateLiteralTypesDefinitelyUnrelated(source, target) { - const sourceStart = source.texts[0]; - const targetStart = target.texts[0]; - const sourceEnd = source.texts[source.texts.length - 1]; - const targetEnd = target.texts[target.texts.length - 1]; - const startLen = Math.min(sourceStart.length, targetStart.length); - const endLen = Math.min(sourceEnd.length, targetEnd.length); - return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) || sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen); - } - function isValidNumberString(s, roundTripOnly) { - if (s === "") return false; - const n = +s; - return isFinite(n) && (!roundTripOnly || "" + n === s); - } - function parseBigIntLiteralType(text) { - return getBigIntLiteralType(parseValidBigInt(text)); - } - function isMemberOfStringMapping(source, target) { - if (target.flags & 1 /* Any */) { - return true; - } - if (target.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) { - return isTypeAssignableTo(source, target); - } - if (target.flags & 268435456 /* StringMapping */) { - const mappingStack = []; - while (target.flags & 268435456 /* StringMapping */) { - mappingStack.unshift(target.symbol); - target = target.type; - } - const mappedSource = reduceLeft(mappingStack, (memo, value) => getStringMappingType(value, memo), source); - return mappedSource === source && isMemberOfStringMapping(source, target); - } - return false; - } - function isValidTypeForTemplateLiteralPlaceholder(source, target) { - if (target.flags & 2097152 /* Intersection */) { - return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t)); - } - if (target.flags & 4 /* String */ || isTypeAssignableTo(source, target)) { - return true; - } - if (source.flags & 128 /* StringLiteral */) { - const value = source.value; - return !!(target.flags & 8 /* Number */ && isValidNumberString( - value, - /*roundTripOnly*/ - false - ) || target.flags & 64 /* BigInt */ && isValidBigIntString( - value, - /*roundTripOnly*/ - false - ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(source, 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 false; - } - function inferTypesFromTemplateLiteralType(source, target) { - return source.flags & 128 /* StringLiteral */ ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 /* TemplateLiteral */ ? arrayIsEqualTo(source.texts, target.texts) ? map(source.types, (s, i) => { - return isTypeAssignableTo(getBaseConstraintOrType(s), getBaseConstraintOrType(target.types[i])) ? s : getStringLikeTypeForType(s); - }) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0; - } - function isTypeMatchedByTemplateLiteralType(source, target) { - const inferences = inferTypesFromTemplateLiteralType(source, target); - return !!inferences && every(inferences, (r, i) => isValidTypeForTemplateLiteralPlaceholder(r, target.types[i])); - } - function getStringLikeTypeForType(type) { - return type.flags & (1 /* Any */ | 402653316 /* StringLike */) ? type : getTemplateLiteralType(["", ""], [type]); - } - function inferFromLiteralPartsToTemplateLiteral(sourceTexts, sourceTypes, target) { - const lastSourceIndex = sourceTexts.length - 1; - const sourceStartText = sourceTexts[0]; - const sourceEndText = sourceTexts[lastSourceIndex]; - const targetTexts = target.texts; - const lastTargetIndex = targetTexts.length - 1; - const targetStartText = targetTexts[0]; - const targetEndText = targetTexts[lastTargetIndex]; - if (lastSourceIndex === 0 && sourceStartText.length < targetStartText.length + targetEndText.length || !sourceStartText.startsWith(targetStartText) || !sourceEndText.endsWith(targetEndText)) return void 0; - const remainingEndText = sourceEndText.slice(0, sourceEndText.length - targetEndText.length); - const matches = []; - let seg = 0; - let pos = targetStartText.length; - for (let i = 1; i < lastTargetIndex; i++) { - const delim = targetTexts[i]; - if (delim.length > 0) { - let s = seg; - let p = pos; - while (true) { - p = getSourceText(s).indexOf(delim, p); - if (p >= 0) break; - s++; - if (s === sourceTexts.length) return void 0; - p = 0; - } - addMatch(s, p); - pos += delim.length; - } else if (pos < getSourceText(seg).length) { - addMatch(seg, pos + 1); - } else if (seg < lastSourceIndex) { - addMatch(seg + 1, 0); - } else { - return void 0; - } - } - addMatch(lastSourceIndex, getSourceText(lastSourceIndex).length); - return matches; - function getSourceText(index) { - return index < lastSourceIndex ? sourceTexts[index] : remainingEndText; - } - function addMatch(s, p) { - const matchType = s === seg ? getStringLiteralType(getSourceText(s).slice(pos, p)) : getTemplateLiteralType( - [sourceTexts[seg].slice(pos), ...sourceTexts.slice(seg + 1, s), getSourceText(s).slice(0, p)], - sourceTypes.slice(seg, s) - ); - matches.push(matchType); - seg = s; - pos = p; - } - } - function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) { - let bivariant = false; - let propagationType; - let inferencePriority = 2048 /* MaxValue */; - let visited; - let sourceStack; - let targetStack; - let expandingFlags = 0 /* None */; - inferFromTypes(originalSource, originalTarget); - function inferFromTypes(source, target) { - if (!couldContainTypeVariables(target) || isNoInferType(target)) { - return; - } - if (source === wildcardType || source === blockedStringType) { - const savePropagationType = propagationType; - propagationType = source; - inferFromTypes(target, target); - propagationType = savePropagationType; - return; - } - if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) { - if (source.aliasTypeArguments) { - const params = getSymbolLinks(source.aliasSymbol).typeParameters; - const minParams = getMinTypeArgumentCount(params); - const sourceTypes = fillMissingTypeArguments(source.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration)); - const targetTypes = fillMissingTypeArguments(target.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration)); - inferFromTypeArguments(sourceTypes, targetTypes, getAliasVariances(source.aliasSymbol)); - } - return; - } - if (source === target && source.flags & 3145728 /* UnionOrIntersection */) { - for (const t of source.types) { - inferFromTypes(t, t); - } - return; - } - if (target.flags & 1048576 /* Union */) { - const [tempSources, tempTargets] = inferFromMatchingTypes(source.flags & 1048576 /* Union */ ? source.types : [source], target.types, isTypeOrBaseIdenticalTo); - const [sources, targets] = inferFromMatchingTypes(tempSources, tempTargets, isTypeCloselyMatchedBy); - if (targets.length === 0) { - return; - } - target = getUnionType(targets); - if (sources.length === 0) { - inferWithPriority(source, target, 1 /* NakedTypeVariable */); - return; - } - source = getUnionType(sources); - } else if (target.flags & 2097152 /* Intersection */ && !every(target.types, isNonGenericObjectType)) { - if (!(source.flags & 1048576 /* Union */)) { - const [sources, targets] = inferFromMatchingTypes(source.flags & 2097152 /* Intersection */ ? source.types : [source], target.types, isTypeIdenticalTo); - if (sources.length === 0 || targets.length === 0) { - return; - } - source = getIntersectionType(sources); - target = getIntersectionType(targets); - } - } - if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) { - if (isNoInferType(target)) { - return; - } - target = getActualTypeVariable(target); - } - if (target.flags & 8650752 /* TypeVariable */) { - if (isFromInferenceBlockedSource(source)) { - return; - } - const inference = getInferenceInfoForType(target); - if (inference) { - if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) { - 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; - inference.topLevel = true; - inference.priority = priority; - } - if (priority === inference.priority) { - if (contravariant && !bivariant) { - if (!contains(inference.contraCandidates, candidate)) { - inference.contraCandidates = append(inference.contraCandidates, candidate); - clearCachedInferences(inferences); - } - } else if (!contains(inference.candidates, candidate)) { - inference.candidates = append(inference.candidates, candidate); - clearCachedInferences(inferences); - } - } - if (!(priority & 128 /* ReturnType */) && target.flags & 262144 /* TypeParameter */ && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) { - inference.topLevel = false; - clearCachedInferences(inferences); - } - } - inferencePriority = Math.min(inferencePriority, priority); - return; - } - const simplified = getSimplifiedType( - target, - /*writing*/ - false - ); - if (simplified !== target) { - inferFromTypes(source, simplified); - } else if (target.flags & 8388608 /* IndexedAccess */) { - const indexType = getSimplifiedType( - target.indexType, - /*writing*/ - false - ); - if (indexType.flags & 465829888 /* Instantiable */) { - const simplified2 = distributeIndexOverObjectType( - getSimplifiedType( - target.objectType, - /*writing*/ - false - ), - indexType, - /*writing*/ - false - ); - if (simplified2 && simplified2 !== target) { - inferFromTypes(source, simplified2); - } - } - } - } - if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target)) && !(source.node && target.node)) { - inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); - } else if (source.flags & 4194304 /* Index */ && target.flags & 4194304 /* Index */) { - inferFromContravariantTypes(source.type, target.type); - } else if ((isLiteralType(source) || source.flags & 4 /* String */) && target.flags & 4194304 /* Index */) { - const empty = createEmptyObjectTypeFromStringLiteral(source); - inferFromContravariantTypesWithPriority(empty, target.type, 256 /* LiteralKeyof */); - } else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) { - inferFromTypes(source.objectType, target.objectType); - inferFromTypes(source.indexType, target.indexType); - } else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) { - if (source.symbol === target.symbol) { - inferFromTypes(source.type, target.type); - } - } else if (source.flags & 33554432 /* Substitution */) { - inferFromTypes(source.baseType, target); - inferWithPriority(getSubstitutionIntersection(source), target, 4 /* SubstituteSource */); - } else if (target.flags & 16777216 /* Conditional */) { - invokeOnce(source, target, inferToConditionalType); - } else if (target.flags & 3145728 /* UnionOrIntersection */) { - inferToMultipleTypes(source, target.types, target.flags); - } else if (source.flags & 1048576 /* Union */) { - const sourceTypes = source.types; - for (const sourceType of sourceTypes) { - inferFromTypes(sourceType, target); - } - } else if (target.flags & 134217728 /* TemplateLiteral */) { - inferToTemplateLiteralType(source, target); - } else { - source = getReducedType(source); - if (isGenericMappedType(source) && isGenericMappedType(target)) { - invokeOnce(source, target, inferFromGenericMappedTypes); - } - if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) { - const apparentSource = getApparentType(source); - if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) { - return inferFromTypes(apparentSource, target); - } - source = apparentSource; - } - if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */)) { - invokeOnce(source, target, inferFromObjectTypes); - } - } - } - function inferWithPriority(source, target, newPriority) { - const savePriority = priority; - priority |= newPriority; - inferFromTypes(source, target); - priority = savePriority; - } - function inferFromContravariantTypesWithPriority(source, target, newPriority) { - const savePriority = priority; - priority |= newPriority; - inferFromContravariantTypes(source, target); - priority = savePriority; - } - function inferToMultipleTypesWithPriority(source, targets, targetFlags, newPriority) { - const savePriority = priority; - priority |= newPriority; - inferToMultipleTypes(source, targets, targetFlags); - priority = savePriority; - } - function invokeOnce(source, target, action) { - const key = source.id + "," + target.id; - const status = visited && visited.get(key); - if (status !== void 0) { - inferencePriority = Math.min(inferencePriority, status); - return; - } - (visited || (visited = /* @__PURE__ */ new Map())).set(key, -1 /* Circularity */); - const saveInferencePriority = inferencePriority; - inferencePriority = 2048 /* MaxValue */; - const saveExpandingFlags = expandingFlags; - (sourceStack ?? (sourceStack = [])).push(source); - (targetStack ?? (targetStack = [])).push(target); - if (isDeeplyNestedType(source, sourceStack, sourceStack.length, 2)) expandingFlags |= 1 /* Source */; - if (isDeeplyNestedType(target, targetStack, targetStack.length, 2)) expandingFlags |= 2 /* Target */; - if (expandingFlags !== 3 /* Both */) { - action(source, target); - } else { - inferencePriority = -1 /* Circularity */; - } - targetStack.pop(); - sourceStack.pop(); - expandingFlags = saveExpandingFlags; - visited.set(key, inferencePriority); - inferencePriority = Math.min(inferencePriority, saveInferencePriority); - } - function inferFromMatchingTypes(sources, targets, matches) { - let matchedSources; - let matchedTargets; - for (const t of targets) { - for (const s of sources) { - if (matches(s, t)) { - inferFromTypes(s, t); - matchedSources = appendIfUnique(matchedSources, s); - matchedTargets = appendIfUnique(matchedTargets, t); - } - } - } - return [ - matchedSources ? filter(sources, (t) => !contains(matchedSources, t)) : sources, - matchedTargets ? filter(targets, (t) => !contains(matchedTargets, t)) : targets - ]; - } - function inferFromTypeArguments(sourceTypes, targetTypes, variances) { - const count = sourceTypes.length < targetTypes.length ? sourceTypes.length : targetTypes.length; - for (let i = 0; i < count; i++) { - if (i < variances.length && (variances[i] & 7 /* VarianceMask */) === 2 /* Contravariant */) { - inferFromContravariantTypes(sourceTypes[i], targetTypes[i]); - } else { - inferFromTypes(sourceTypes[i], targetTypes[i]); - } - } - } - function inferFromContravariantTypes(source, target) { - contravariant = !contravariant; - inferFromTypes(source, target); - contravariant = !contravariant; - } - function inferFromContravariantTypesIfStrictFunctionTypes(source, target) { - if (strictFunctionTypes || priority & 1024 /* AlwaysStrict */) { - inferFromContravariantTypes(source, target); - } else { - inferFromTypes(source, target); - } - } - function getInferenceInfoForType(type) { - if (type.flags & 8650752 /* TypeVariable */) { - for (const inference of inferences) { - if (type === inference.typeParameter) { - return inference; - } - } - } - return void 0; - } - function getSingleTypeVariableFromIntersectionTypes(types) { - let typeVariable; - for (const type of types) { - const t = type.flags & 2097152 /* Intersection */ && find(type.types, (t2) => !!getInferenceInfoForType(t2)); - if (!t || typeVariable && t !== typeVariable) { - return void 0; - } - typeVariable = t; - } - return typeVariable; - } - function inferToMultipleTypes(source, targets, targetFlags) { - let typeVariableCount = 0; - if (targetFlags & 1048576 /* Union */) { - let nakedTypeVariable; - const sources = source.flags & 1048576 /* Union */ ? source.types : [source]; - const matched = new Array(sources.length); - let inferenceCircularity = false; - for (const t of targets) { - if (getInferenceInfoForType(t)) { - nakedTypeVariable = t; - typeVariableCount++; - } else { - for (let i = 0; i < sources.length; i++) { - const saveInferencePriority = inferencePriority; - inferencePriority = 2048 /* MaxValue */; - inferFromTypes(sources[i], t); - if (inferencePriority === priority) matched[i] = true; - inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */; - inferencePriority = Math.min(inferencePriority, saveInferencePriority); - } - } - } - if (typeVariableCount === 0) { - const intersectionTypeVariable = getSingleTypeVariableFromIntersectionTypes(targets); - if (intersectionTypeVariable) { - inferWithPriority(source, intersectionTypeVariable, 1 /* NakedTypeVariable */); - } - return; - } - if (typeVariableCount === 1 && !inferenceCircularity) { - const unmatched = flatMap(sources, (s, i) => matched[i] ? void 0 : s); - if (unmatched.length) { - inferFromTypes(getUnionType(unmatched), nakedTypeVariable); - return; - } - } - } else { - for (const t of targets) { - if (getInferenceInfoForType(t)) { - typeVariableCount++; - } else { - inferFromTypes(source, t); - } - } - } - if (targetFlags & 2097152 /* Intersection */ ? typeVariableCount === 1 : typeVariableCount > 0) { - for (const t of targets) { - if (getInferenceInfoForType(t)) { - inferWithPriority(source, t, 1 /* NakedTypeVariable */); - } - } - } - } - function inferToMappedType(source, target, constraintType) { - if (constraintType.flags & 1048576 /* Union */ || constraintType.flags & 2097152 /* Intersection */) { - let result = false; - for (const type of constraintType.types) { - result = inferToMappedType(source, target, type) || result; - } - return result; - } - if (constraintType.flags & 4194304 /* Index */) { - const inference = getInferenceInfoForType(constraintType.type); - if (inference && !inference.isFixed && !isFromInferenceBlockedSource(source)) { - const inferredType = inferTypeForHomomorphicMappedType(source, target, constraintType); - if (inferredType) { - inferWithPriority( - inferredType, - inference.typeParameter, - getObjectFlags(source) & 262144 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */ - ); - } - } - return true; - } - if (constraintType.flags & 262144 /* TypeParameter */) { - inferWithPriority(getIndexType( - source, - /*indexFlags*/ - !!source.pattern ? 2 /* NoIndexSignatures */ : 0 /* None */ - ), constraintType, 32 /* MappedTypeConstraint */); - const extendedConstraint = getConstraintOfType(constraintType); - if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) { - return true; - } - const propTypes = map(getPropertiesOfType(source), getTypeOfSymbol); - const indexTypes = map(getIndexInfosOfType(source), (info) => info !== enumNumberIndexInfo ? info.type : neverType); - inferFromTypes(getUnionType(concatenate(propTypes, indexTypes)), getTemplateTypeFromMappedType(target)); - return true; - } - return false; - } - function inferToConditionalType(source, target) { - if (source.flags & 16777216 /* Conditional */) { - inferFromTypes(source.checkType, target.checkType); - inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); - inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); - } else { - const targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; - inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 /* ContravariantConditional */ : 0); - } - } - function inferToTemplateLiteralType(source, target) { - const matches = inferTypesFromTemplateLiteralType(source, target); - const types = target.types; - if (matches || every(target.texts, (s) => s.length === 0)) { - for (let i = 0; i < types.length; i++) { - const source2 = matches ? matches[i] : neverType; - const target2 = types[i]; - if (source2.flags & 128 /* StringLiteral */ && target2.flags & 8650752 /* TypeVariable */) { - const inferenceContext = getInferenceInfoForType(target2); - const constraint = inferenceContext ? getBaseConstraintOfType(inferenceContext.typeParameter) : void 0; - if (constraint && !isTypeAny(constraint)) { - const constraintTypes = constraint.flags & 1048576 /* Union */ ? constraint.types : [constraint]; - let allTypeFlags = reduceLeft(constraintTypes, (flags, t) => flags | t.flags, 0); - if (!(allTypeFlags & 4 /* String */)) { - const str = source2.value; - if (allTypeFlags & 296 /* NumberLike */ && !isValidNumberString( - str, - /*roundTripOnly*/ - true - )) { - allTypeFlags &= ~296 /* NumberLike */; - } - if (allTypeFlags & 2112 /* BigIntLike */ && !isValidBigIntString( - str, - /*roundTripOnly*/ - true - )) { - 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); - if (!(matchingType.flags & 131072 /* Never */)) { - inferFromTypes(matchingType, target2); - continue; - } - } - } - } - inferFromTypes(source2, target2); - } - } - } - 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))) { - inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); - return; - } - if (isGenericMappedType(source) && isGenericMappedType(target)) { - inferFromGenericMappedTypes(source, target); - } - if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) { - const constraintType = getConstraintTypeFromMappedType(target); - if (inferToMappedType(source, target, constraintType)) { - return; - } - } - if (!typesDefinitelyUnrelated(source, target)) { - if (isArrayOrTupleType(source)) { - if (isTupleType(target)) { - const sourceArity = getTypeReferenceArity(source); - const targetArity = getTypeReferenceArity(target); - const elementTypes = getTypeArguments(target); - const elementFlags = target.target.elementFlags; - if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) { - for (let i = 0; i < targetArity; i++) { - inferFromTypes(getTypeArguments(source)[i], elementTypes[i]); - } - 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.combinedFlags & 12 /* Variable */ ? getEndElementCount(target.target, 3 /* Fixed */) : 0); - for (let i = 0; i < startLength; i++) { - inferFromTypes(getTypeArguments(source)[i], elementTypes[i]); - } - if (!isTupleType(source) || sourceArity - startLength - endLength === 1 && source.target.elementFlags[startLength] & 4 /* Rest */) { - const restType = getTypeArguments(source)[startLength]; - for (let i = startLength; i < targetArity - endLength; i++) { - inferFromTypes(elementFlags[i] & 8 /* Variadic */ ? createArrayType(restType) : restType, elementTypes[i]); - } - } else { - const middleLength = targetArity - startLength - endLength; - if (middleLength === 2) { - if (elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */) { - const targetInfo = getInferenceInfoForType(elementTypes[startLength]); - if (targetInfo && targetInfo.impliedArity !== void 0) { - inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); - inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]); - } - } else if (elementFlags[startLength] & 8 /* Variadic */ && elementFlags[startLength + 1] & 4 /* Rest */) { - const param = (_a = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a.typeParameter; - const constraint = param && getBaseConstraintOfType(param); - if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) { - const impliedArity = constraint.target.fixedLength; - inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]); - inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]); - } - } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) { - const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter; - const constraint = param && getBaseConstraintOfType(param); - if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) { - const impliedArity = constraint.target.fixedLength; - const endIndex = sourceArity - getEndElementCount(target.target, 3 /* Fixed */); - const startIndex = endIndex - impliedArity; - const trailingSlice = createTupleType( - getTypeArguments(source).slice(startIndex, endIndex), - source.target.elementFlags.slice(startIndex, endIndex), - /*readonly*/ - false, - source.target.labeledElementDeclarations && source.target.labeledElementDeclarations.slice(startIndex, endIndex) - ); - inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength, endLength + impliedArity), elementTypes[startLength]); - inferFromTypes(trailingSlice, elementTypes[startLength + 1]); - } - } - } else if (middleLength === 1 && elementFlags[startLength] & 8 /* Variadic */) { - const endsInOptional = target.target.elementFlags[targetArity - 1] & 2 /* Optional */; - const sourceSlice = sliceTupleType(source, startLength, endLength); - inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 /* SpeculativeTuple */ : 0); - } else if (middleLength === 1 && elementFlags[startLength] & 4 /* Rest */) { - const restType = getElementTypeOfSliceOfTupleType(source, startLength, endLength); - if (restType) { - inferFromTypes(restType, elementTypes[startLength]); - } - } - } - for (let i = 0; i < endLength; i++) { - inferFromTypes(getTypeArguments(source)[sourceArity - i - 1], elementTypes[targetArity - i - 1]); - } - return; - } - if (isArrayType(target)) { - inferFromIndexTypes(source, target); - return; - } - } - inferFromProperties(source, target); - inferFromSignatures(source, target, 0 /* Call */); - inferFromSignatures(source, target, 1 /* Construct */); - inferFromIndexTypes(source, target); - } - } - function inferFromProperties(source, target) { - const properties = getPropertiesOfObjectType(target); - for (const targetProp of properties) { - const sourceProp = getPropertyOfType(source, targetProp.escapedName); - if (sourceProp && !some(sourceProp.declarations, hasSkipDirectInferenceFlag)) { - inferFromTypes( - removeMissingType(getTypeOfSymbol(sourceProp), !!(sourceProp.flags & 16777216 /* Optional */)), - removeMissingType(getTypeOfSymbol(targetProp), !!(targetProp.flags & 16777216 /* Optional */)) - ); - } - } - } - function inferFromSignatures(source, target, kind) { - const sourceSignatures = getSignaturesOfType(source, kind); - const sourceLen = sourceSignatures.length; - 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 === 175 /* MethodDeclaration */ || kind === 174 /* MethodSignature */ || kind === 177 /* Constructor */; - applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes); - bivariant = saveBivariant; - } - applyToReturnTypes(source, target, inferFromTypes); - } - function inferFromIndexTypes(source, target) { - const priority2 = getObjectFlags(source) & getObjectFlags(target) & 32 /* Mapped */ ? 8 /* HomomorphicMappedType */ : 0; - const indexInfos = getIndexInfosOfType(target); - if (isObjectTypeWithInferableIndex(source)) { - for (const targetInfo of indexInfos) { - const propTypes = []; - for (const prop of getPropertiesOfType(source)) { - if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), targetInfo.keyType)) { - const propType = getTypeOfSymbol(prop); - propTypes.push(prop.flags & 16777216 /* Optional */ ? removeMissingOrUndefinedType(propType) : propType); - } - } - for (const info of getIndexInfosOfType(source)) { - if (isApplicableIndexType(info.keyType, targetInfo.keyType)) { - propTypes.push(info.type); - } - } - if (propTypes.length) { - inferWithPriority(getUnionType(propTypes), targetInfo.type, priority2); - } - } - } - for (const targetInfo of indexInfos) { - const sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType); - if (sourceInfo) { - inferWithPriority(sourceInfo.type, targetInfo.type, priority2); - } - } - } - } - function isTypeOrBaseIdenticalTo(s, t) { - return t === missingType ? s === t : isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */); - } - function isTypeCloselyMatchedBy(s, t) { - return !!(s.flags & 524288 /* Object */ && t.flags & 524288 /* Object */ && s.symbol && s.symbol === t.symbol || s.aliasSymbol && s.aliasTypeArguments && s.aliasSymbol === t.aliasSymbol); - } - function hasPrimitiveConstraint(type) { - const constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); - } - function isObjectLiteralType2(type) { - return !!(getObjectFlags(type) & 128 /* ObjectLiteral */); - } - function isObjectOrArrayLiteralType(type) { - return !!(getObjectFlags(type) & (128 /* ObjectLiteral */ | 16384 /* ArrayLiteral */)); - } - function unionObjectAndArrayLiteralCandidates(candidates) { - if (candidates.length > 1) { - const objectLiterals = filter(candidates, isObjectOrArrayLiteralType); - if (objectLiterals.length) { - const literalsType = getUnionType(objectLiterals, 2 /* Subtype */); - return concatenate(filter(candidates, (t) => !isObjectOrArrayLiteralType(t)), [literalsType]); - } - } - return candidates; - } - function getContravariantInference(inference) { - return inference.priority & 416 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates); - } - function getCovariantInference(inference, signature) { - const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates); - const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter); - const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter)); - const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; - const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates); - return getWidenedType(unwidenedType); - } - function getInferredType(context, index) { - const inference = context.inferences[index]; - if (!inference.inferredType) { - let inferredType; - let fallbackType; - if (context.signature) { - const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context.signature) : void 0; - const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0; - if (inferredCovariantType || inferredContravariantType) { - const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType)))); - inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType; - fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType; - } else if (context.flags & 1 /* NoDefault */) { - inferredType = silentNeverType; - } else { - const defaultType = getDefaultFromTypeParameter(inference.typeParameter); - if (defaultType) { - inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); - } - } - } else { - inferredType = getTypeFromInference(inference); - } - inference.inferredType = inferredType || getDefaultTypeArgumentType(!!(context.flags & 2 /* AnyDefault */)); - const constraint = getConstraintOfTypeParameter(inference.typeParameter); - if (constraint) { - const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper); - if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { - inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint; - } - } - clearActiveMapperCaches(); - } - return inference.inferredType; - } - function getDefaultTypeArgumentType(isInJavaScriptFile) { - return isInJavaScriptFile ? anyType : unknownType; - } - function getInferredTypes(context) { - const result = []; - for (let i = 0; i < context.inferences.length; i++) { - result.push(getInferredType(context, i)); - } - return result; - } - function getCannotFindNameDiagnosticForName(node) { - switch (node.escapedText) { - case "document": - case "console": - return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; - case "$": - return compilerOptions.types ? 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 : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; - case "describe": - case "suite": - case "it": - case "test": - return compilerOptions.types ? 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 : 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; - case "process": - case "require": - 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": - case "Symbol": - case "WeakMap": - case "WeakSet": - case "Iterator": - case "AsyncIterator": - case "SharedArrayBuffer": - case "Atomics": - case "AsyncIterable": - case "AsyncIterableIterator": - case "AsyncGenerator": - case "AsyncGeneratorFunction": - case "BigInt": - case "Reflect": - case "BigInt64Array": - case "BigUint64Array": - return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; - case "await": - if (isCallExpression(node.parent)) { - return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function; - } - // falls through - default: - if (node.parent.kind === 305 /* 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; - } - } - } - function getResolvedSymbol(node) { - const links = getNodeLinks(node); - if (!links.resolvedSymbol) { - links.resolvedSymbol = !nodeIsMissing(node) && resolveName( - node, - node, - 111551 /* Value */ | 1048576 /* ExportValue */, - getCannotFindNameDiagnosticForName(node), - !isWriteOnlyAccess(node), - /*excludeGlobals*/ - false - ) || unknownSymbol; - } - return links.resolvedSymbol; - } - function isInAmbientOrTypeNode(node) { - return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n))); - } - function getFlowCacheKey(node, declaredType, initialType, flowContainer) { - switch (node.kind) { - case 80 /* Identifier */: - if (!isThisInTypeQuery(node)) { - const symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? `${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}|${getSymbolId(symbol)}` : void 0; - } - // falls through - case 110 /* ThisKeyword */: - return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`; - case 236 /* NonNullExpression */: - case 218 /* ParenthesizedExpression */: - return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 167 /* QualifiedName */: - const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer); - return left && `${left}.${node.right.escapedText}`; - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - const propName = getAccessedPropertyName(node); - if (propName !== void 0) { - const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - return key && `${key}.${propName}`; - } - if (isElementAccessExpression(node) && isIdentifier(node.argumentExpression)) { - const symbol = getResolvedSymbol(node.argumentExpression); - if (isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol)) { - const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - return key && `${key}.@${getSymbolId(symbol)}`; - } - } - break; - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - return `${getNodeId(node)}#${getTypeId(declaredType)}`; - } - return void 0; - } - function isMatchingReference(source, target) { - switch (target.kind) { - case 218 /* ParenthesizedExpression */: - case 236 /* NonNullExpression */: - return isMatchingReference(source, target.expression); - case 227 /* BinaryExpression */: - return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source, target.right); - } - switch (source.kind) { - case 237 /* MetaProperty */: - return target.kind === 237 /* 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); - case 110 /* ThisKeyword */: - return target.kind === 110 /* ThisKeyword */; - case 108 /* SuperKeyword */: - return target.kind === 108 /* SuperKeyword */; - case 236 /* NonNullExpression */: - case 218 /* ParenthesizedExpression */: - case 239 /* SatisfiesExpression */: - return isMatchingReference(source.expression, target); - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - const sourcePropertyName = getAccessedPropertyName(source); - if (sourcePropertyName !== void 0) { - const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0; - if (targetPropertyName !== void 0) { - return targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression); - } - } - if (isElementAccessExpression(source) && isElementAccessExpression(target) && isIdentifier(source.argumentExpression) && isIdentifier(target.argumentExpression)) { - const symbol = getResolvedSymbol(source.argumentExpression); - if (symbol === getResolvedSymbol(target.argumentExpression) && (isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol))) { - return isMatchingReference(source.expression, target.expression); - } - } - break; - case 167 /* QualifiedName */: - return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression); - case 227 /* BinaryExpression */: - return isBinaryExpression(source) && source.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source.right, target); - } - return false; - } - function getAccessedPropertyName(access) { - if (isPropertyAccessExpression(access)) { - return access.name.escapedText; - } - if (isElementAccessExpression(access)) { - return tryGetElementAccessExpressionName(access); - } - if (isBindingElement(access)) { - const name = getDestructuringPropertyName(access); - return name ? escapeLeadingUnderscores(name) : void 0; - } - if (isParameter(access)) { - return "" + access.parent.parameters.indexOf(access); - } - return void 0; - } - function tryGetNameFromType(type) { - return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName : type.flags & 384 /* StringOrNumberLiteral */ ? escapeLeadingUnderscores("" + type.value) : void 0; - } - function tryGetElementAccessExpressionName(node) { - return isStringOrNumericLiteralLike(node.argumentExpression) ? escapeLeadingUnderscores(node.argumentExpression.text) : isEntityNameExpression(node.argumentExpression) ? tryGetNameFromEntityNameExpression(node.argumentExpression) : void 0; - } - function tryGetNameFromEntityNameExpression(node) { - const symbol = resolveEntityName( - node, - 111551 /* Value */, - /*ignoreErrors*/ - true - ); - if (!symbol || !(isConstantVariable(symbol) || symbol.flags & 8 /* EnumMember */)) return void 0; - const declaration = symbol.valueDeclaration; - if (declaration === void 0) return void 0; - const type = tryGetTypeFromEffectiveTypeNode(declaration); - if (type) { - const name = tryGetNameFromType(type); - if (name !== void 0) { - return name; - } - } - if (hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node)) { - const initializer = getEffectiveInitializer(declaration); - if (initializer) { - const initializerType = isBindingPattern(declaration.parent) ? getTypeForBindingElement(declaration) : getTypeOfExpression(initializer); - return initializerType && tryGetNameFromType(initializerType); - } - if (isEnumMember(declaration)) { - return getTextOfPropertyName(declaration.name); - } - } - return void 0; - } - function containsMatchingReference(source, target) { - while (isAccessExpression(source)) { - source = source.expression; - if (isMatchingReference(source, target)) { - return true; - } - } - return false; - } - function optionalChainContainsReference(source, target) { - while (isOptionalChain(source)) { - source = source.expression; - if (isMatchingReference(source, target)) { - return true; - } - } - return false; - } - function isDiscriminantProperty(type, name) { - if (type && type.flags & 1048576 /* Union */) { - const prop = getUnionOrIntersectionProperty(type, name); - if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) { - if (prop.links.isDiscriminantProperty === void 0) { - prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop)); - } - return !!prop.links.isDiscriminantProperty; - } - } - return false; - } - function findDiscriminantProperties(sourceProperties, target) { - let result; - for (const sourceProperty of sourceProperties) { - if (isDiscriminantProperty(target, sourceProperty.escapedName)) { - if (result) { - result.push(sourceProperty); - continue; - } - result = [sourceProperty]; - } - } - return result; - } - function mapTypesByKeyProperty(types, name) { - const map2 = /* @__PURE__ */ new Map(); - let count = 0; - for (const type of types) { - if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) { - const discriminant = getTypeOfPropertyOfType(type, name); - if (discriminant) { - if (!isLiteralType(discriminant)) { - return void 0; - } - let duplicate = false; - forEachType(discriminant, (t) => { - const id = getTypeId(getRegularTypeOfLiteralType(t)); - const existing = map2.get(id); - if (!existing) { - map2.set(id, type); - } else if (existing !== unknownType) { - map2.set(id, unknownType); - duplicate = true; - } - }); - if (!duplicate) count++; - } - } - } - return count >= 10 && count * 2 >= types.length ? map2 : void 0; - } - function getKeyPropertyName(unionType) { - const types = unionType.types; - if (types.length < 10 || getObjectFlags(unionType) & 32768 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) { - return void 0; - } - if (unionType.keyPropertyName === void 0) { - const keyPropertyName = forEach(types, (t) => t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ? forEach(getPropertiesOfType(t), (p) => isUnitType(getTypeOfSymbol(p)) ? p.escapedName : void 0) : void 0); - const mapByKeyProperty = keyPropertyName && mapTypesByKeyProperty(types, keyPropertyName); - unionType.keyPropertyName = mapByKeyProperty ? keyPropertyName : ""; - unionType.constituentMap = mapByKeyProperty; - } - return unionType.keyPropertyName.length ? unionType.keyPropertyName : void 0; - } - function getConstituentTypeForKeyType(unionType, keyType) { - var _a; - const result = (_a = unionType.constituentMap) == null ? void 0 : _a.get(getTypeId(getRegularTypeOfLiteralType(keyType))); - return result !== unknownType ? result : void 0; - } - function getMatchingUnionConstituentForType(unionType, type) { - const keyPropertyName = getKeyPropertyName(unionType); - const propType = keyPropertyName && getTypeOfPropertyOfType(type, keyPropertyName); - return propType && getConstituentTypeForKeyType(unionType, propType); - } - function getMatchingUnionConstituentForObjectLiteral(unionType, node) { - const keyPropertyName = getKeyPropertyName(unionType); - const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 304 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer)); - const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer); - return propType && getConstituentTypeForKeyType(unionType, propType); - } - function isOrContainsMatchingReference(source, target) { - return isMatchingReference(source, target) || containsMatchingReference(source, target); - } - function hasMatchingArgument(expression, reference) { - if (expression.arguments) { - for (const argument of expression.arguments) { - if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) { - return true; - } - } - } - if (expression.expression.kind === 212 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) { - return true; - } - return false; - } - function getFlowNodeId(flow) { - if (flow.id <= 0) { - flow.id = nextFlowId; - nextFlowId++; - } - return flow.id; - } - function typeMaybeAssignableTo(source, target) { - if (!(source.flags & 1048576 /* Union */)) { - return isTypeAssignableTo(source, target); - } - for (const t of source.types) { - if (isTypeAssignableTo(t, target)) { - return true; - } - } - return false; - } - function getAssignmentReducedType(declaredType, assignedType) { - if (declaredType === assignedType) { - return declaredType; - } - if (assignedType.flags & 131072 /* Never */) { - return assignedType; - } - const key = `A${getTypeId(declaredType)},${getTypeId(assignedType)}`; - return getCachedType(key) ?? setCachedType(key, getAssignmentReducedTypeWorker(declaredType, assignedType)); - } - function getAssignmentReducedTypeWorker(declaredType, assignedType) { - const filteredType = filterType(declaredType, (t) => typeMaybeAssignableTo(assignedType, t)); - const reducedType = assignedType.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(assignedType) ? mapType(filteredType, getFreshTypeOfLiteralType) : filteredType; - return isTypeAssignableTo(assignedType, reducedType) ? reducedType : declaredType; - } - function isFunctionObjectType(type) { - if (getObjectFlags(type) & 256 /* EvolvingArray */) { - return false; - } - const resolved = resolveStructuredTypeMembers(type); - return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); - } - 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; - } - const flags = type.flags; - if (flags & (4 /* String */ | 268435456 /* StringMapping */)) { - return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */; - } - if (flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */)) { - const isEmpty = flags & 128 /* StringLiteral */ && type.value === ""; - return strictNullChecks ? isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ : isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */; - } - if (flags & (8 /* Number */ | 32 /* Enum */)) { - return strictNullChecks ? 16317698 /* NumberStrictFacts */ : 16776450 /* NumberFacts */; - } - if (flags & 256 /* NumberLiteral */) { - const isZero = type.value === 0; - return strictNullChecks ? isZero ? 12123394 /* ZeroNumberStrictFacts */ : 7929090 /* NonZeroNumberStrictFacts */ : isZero ? 12582146 /* ZeroNumberFacts */ : 16776450 /* NonZeroNumberFacts */; - } - if (flags & 64 /* BigInt */) { - return strictNullChecks ? 16317188 /* BigIntStrictFacts */ : 16775940 /* BigIntFacts */; - } - if (flags & 2048 /* BigIntLiteral */) { - const isZero = isZeroBigInt(type); - return strictNullChecks ? isZero ? 12122884 /* ZeroBigIntStrictFacts */ : 7928580 /* NonZeroBigIntStrictFacts */ : isZero ? 12581636 /* ZeroBigIntFacts */ : 16775940 /* NonZeroBigIntFacts */; - } - if (flags & 16 /* Boolean */) { - return strictNullChecks ? 16316168 /* BooleanStrictFacts */ : 16774920 /* BooleanFacts */; - } - if (flags & 528 /* BooleanLike */) { - 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 */) { - return 9830144 /* VoidFacts */; - } - if (flags & 32768 /* Undefined */) { - return 26607360 /* UndefinedFacts */; - } - if (flags & 65536 /* Null */) { - return 42917664 /* NullFacts */; - } - if (flags & 12288 /* ESSymbolLike */) { - return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */; - } - if (flags & 67108864 /* NonPrimitive */) { - return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; - } - if (flags & 131072 /* Never */) { - return 0 /* None */; - } - if (flags & 1048576 /* Union */) { - return reduceLeft(type.types, (facts, t) => facts | getTypeFactsWorker(t, callerOnlyNeeds), 0 /* None */); - } - if (flags & 2097152 /* Intersection */) { - return getIntersectionTypeFacts(type, callerOnlyNeeds); - } - return 83886079 /* UnknownFacts */; - } - 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 = getTypeFactsWorker(t, callerOnlyNeeds); - oredFacts |= f; - andedFacts &= f; - } - } - return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */; - } - function getTypeWithFacts(type, include) { - 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 removeNullableByIntersection(reduced, 65536 /* EQUndefined */, 131072 /* EQNull */, 33554432 /* IsNull */, nullType); - case 1048576 /* NENull */: - return removeNullableByIntersection(reduced, 131072 /* EQNull */, 65536 /* EQUndefined */, 16777216 /* IsUndefined */, undefinedType); - case 2097152 /* NEUndefinedOrNull */: - case 4194304 /* Truthy */: - return mapType(reduced, (t) => hasTypeFacts(t, 262144 /* EQUndefinedOrNull */) ? getGlobalNonNullableTypeInstantiation(t) : t); - } - } - return reduced; - } - function removeNullableByIntersection(type, targetFacts, otherFacts, otherIncludesFacts, otherType) { - const facts = getTypeFacts(type, 65536 /* EQUndefined */ | 131072 /* EQNull */ | 16777216 /* IsUndefined */ | 33554432 /* IsNull */); - if (!(facts & targetFacts)) { - return type; - } - const emptyAndOtherUnion = getUnionType([emptyObjectType, otherType]); - return mapType(type, (t) => hasTypeFacts(t, targetFacts) ? getIntersectionType([t, !(facts & otherIncludesFacts) && hasTypeFacts(t, otherFacts) ? emptyAndOtherUnion : emptyObjectType]) : t); - } - function recombineUnknownType(type) { - return type === unknownUnionType ? unknownType : type; - } - function getTypeWithDefault(type, defaultExpression) { - return defaultExpression ? getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) : type; - } - function getTypeOfDestructuredProperty(type, name) { - var _a; - const nameType = getLiteralTypeFromPropertyName(name); - if (!isTypeUsableAsPropertyName(nameType)) return errorType; - const text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) == null ? void 0 : _a.type) || errorType; - } - function getTypeOfDestructuredArrayElement(type, index) { - return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || includeUndefinedInIndexSignature(checkIteratedTypeOrElementType( - 65 /* Destructuring */, - type, - undefinedType, - /*errorNode*/ - void 0 - )) || errorType; - } - function includeUndefinedInIndexSignature(type) { - if (!type) return type; - return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type; - } - function getTypeOfDestructuredSpreadExpression(type) { - return createArrayType(checkIteratedTypeOrElementType( - 65 /* Destructuring */, - type, - undefinedType, - /*errorNode*/ - void 0 - ) || errorType); - } - function getAssignedTypeOfBinaryExpression(node) { - const isDestructuringDefaultAssignment = node.parent.kind === 210 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 304 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); - return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); - } - function isDestructuringAssignmentTarget(parent2) { - return parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 251 /* ForOfStatement */ && parent2.parent.initializer === parent2; - } - function getAssignedTypeOfArrayLiteralElement(node, element) { - return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); - } - function getAssignedTypeOfSpreadExpression(node) { - return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); - } - function getAssignedTypeOfPropertyAssignment(node) { - return getTypeOfDestructuredProperty(getAssignedType(node.parent), node.name); - } - function getAssignedTypeOfShorthandPropertyAssignment(node) { - return getTypeWithDefault(getAssignedTypeOfPropertyAssignment(node), node.objectAssignmentInitializer); - } - function getAssignedType(node) { - const { parent: parent2 } = node; - switch (parent2.kind) { - case 250 /* ForInStatement */: - return stringType; - case 251 /* ForOfStatement */: - return checkRightHandSideOfForOf(parent2) || errorType; - case 227 /* BinaryExpression */: - return getAssignedTypeOfBinaryExpression(parent2); - case 221 /* DeleteExpression */: - return undefinedType; - case 210 /* ArrayLiteralExpression */: - return getAssignedTypeOfArrayLiteralElement(parent2, node); - case 231 /* SpreadElement */: - return getAssignedTypeOfSpreadExpression(parent2); - case 304 /* PropertyAssignment */: - return getAssignedTypeOfPropertyAssignment(parent2); - case 305 /* ShorthandPropertyAssignment */: - return getAssignedTypeOfShorthandPropertyAssignment(parent2); - } - return errorType; - } - function getInitialTypeOfBindingElement(node) { - const pattern = node.parent; - const parentType = getInitialType(pattern.parent); - const type = pattern.kind === 207 /* 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) { - const links = getNodeLinks(node); - return links.resolvedType || getTypeOfExpression(node); - } - function getInitialTypeOfVariableDeclaration(node) { - if (node.initializer) { - return getTypeOfInitializer(node.initializer); - } - if (node.parent.parent.kind === 250 /* ForInStatement */) { - return stringType; - } - if (node.parent.parent.kind === 251 /* ForOfStatement */) { - return checkRightHandSideOfForOf(node.parent.parent) || errorType; - } - return errorType; - } - function getInitialType(node) { - return node.kind === 261 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); - } - function isEmptyArrayAssignment(node) { - return node.kind === 261 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 209 /* BindingElement */ && node.parent.kind === 227 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right); - } - function getReferenceCandidate(node) { - switch (node.kind) { - case 218 /* ParenthesizedExpression */: - return getReferenceCandidate(node.expression); - case 227 /* BinaryExpression */: - switch (node.operatorToken.kind) { - case 64 /* EqualsToken */: - case 76 /* BarBarEqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return getReferenceCandidate(node.left); - case 28 /* CommaToken */: - return getReferenceCandidate(node.right); - } - } - return node; - } - function getReferenceRoot(node) { - const { parent: parent2 } = node; - return parent2.kind === 218 /* ParenthesizedExpression */ || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */ && parent2.left === node || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 28 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node; - } - function getTypeOfSwitchClause(clause) { - if (clause.kind === 297 /* CaseClause */) { - return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); - } - return neverType; - } - function getSwitchClauseTypes(switchStatement) { - const links = getNodeLinks(switchStatement); - if (!links.switchTypes) { - links.switchTypes = []; - for (const clause of switchStatement.caseBlock.clauses) { - links.switchTypes.push(getTypeOfSwitchClause(clause)); - } - } - return links.switchTypes; - } - function getSwitchClauseTypeOfWitnesses(switchStatement) { - if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* CaseClause */ && !isStringLiteralLike(clause.expression))) { - return void 0; - } - const witnesses = []; - for (const clause of switchStatement.caseBlock.clauses) { - const text = clause.kind === 297 /* CaseClause */ ? clause.expression.text : void 0; - witnesses.push(text && !contains(witnesses, text) ? text : void 0); - } - return witnesses; - } - function eachTypeContainedIn(source, types) { - return source.flags & 1048576 /* Union */ ? !forEach(source.types, (t) => !contains(types, t)) : contains(types, source); - } - function isTypeSubsetOf(source, target) { - return !!(source === target || source.flags & 131072 /* Never */ || target.flags & 1048576 /* Union */ && isTypeSubsetOfUnion(source, target)); - } - function isTypeSubsetOfUnion(source, target) { - if (source.flags & 1048576 /* Union */) { - for (const t of source.types) { - if (!containsType(target.types, t)) { - return false; - } - } - return true; - } - if (source.flags & 1056 /* EnumLike */ && getBaseTypeOfEnumLikeType(source) === target) { - return true; - } - return containsType(target.types, source); - } - function forEachType(type, f) { - return type.flags & 1048576 /* Union */ ? forEach(type.types, f) : f(type); - } - function someType(type, f) { - return type.flags & 1048576 /* Union */ ? some(type.types, f) : f(type); - } - function everyType(type, f) { - return type.flags & 1048576 /* Union */ ? every(type.types, f) : f(type); - } - function everyContainedType(type, f) { - return type.flags & 3145728 /* UnionOrIntersection */ ? every(type.types, f) : f(type); - } - function filterType(type, f) { - if (type.flags & 1048576 /* Union */) { - const types = type.types; - const filtered = filter(types, f); - if (filtered === types) { - return type; - } - const origin = type.origin; - let newOrigin; - if (origin && origin.flags & 1048576 /* Union */) { - const originTypes = origin.types; - const originFiltered = filter(originTypes, (t) => !!(t.flags & 1048576 /* Union */) || f(t)); - if (originTypes.length - originFiltered.length === types.length - filtered.length) { - if (originFiltered.length === 1) { - return originFiltered[0]; - } - newOrigin = createOriginUnionOrIntersectionType(1048576 /* Union */, originFiltered); - } - } - return getUnionTypeFromSortedList( - filtered, - type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */), - /*aliasSymbol*/ - void 0, - /*aliasTypeArguments*/ - void 0, - newOrigin - ); - } - return type.flags & 131072 /* Never */ || f(type) ? type : neverType; - } - function removeType(type, targetType) { - return filterType(type, (t) => t !== targetType); - } - function countTypes(type) { - return type.flags & 1048576 /* Union */ ? type.types.length : 1; - } - function mapType(type, mapper, noReductions) { - if (type.flags & 131072 /* Never */) { - return type; - } - if (!(type.flags & 1048576 /* Union */)) { - return mapper(type); - } - const origin = type.origin; - const types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types; - let mappedTypes; - let changed = false; - for (const t of types) { - const mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t); - changed || (changed = t !== mapped); - if (mapped) { - if (!mappedTypes) { - mappedTypes = [mapped]; - } else { - mappedTypes.push(mapped); - } - } - } - return changed ? mappedTypes && getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : type; - } - function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) { - return type.flags & 1048576 /* Union */ && aliasSymbol ? getUnionType(map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) : mapType(type, mapper); - } - function extractTypesOfKind(type, kind) { - return filterType(type, (t) => (t.flags & kind) !== 0); - } - function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) { - if (maybeTypeOfKind(typeWithPrimitives, 4 /* String */ | 134217728 /* TemplateLiteral */ | 8 /* Number */ | 64 /* BigInt */) && maybeTypeOfKind(typeWithLiterals, 128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 256 /* NumberLiteral */ | 2048 /* BigIntLiteral */)) { - return mapType(typeWithPrimitives, (t) => t.flags & 4 /* String */ ? extractTypesOfKind(typeWithLiterals, 4 /* String */ | 128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) : isPatternLiteralType(t) && !maybeTypeOfKind(typeWithLiterals, 4 /* String */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? extractTypesOfKind(typeWithLiterals, 128 /* StringLiteral */) : t.flags & 8 /* Number */ ? extractTypesOfKind(typeWithLiterals, 8 /* Number */ | 256 /* NumberLiteral */) : t.flags & 64 /* BigInt */ ? extractTypesOfKind(typeWithLiterals, 64 /* BigInt */ | 2048 /* BigIntLiteral */) : t); - } - return typeWithPrimitives; - } - function isIncomplete(flowType) { - return flowType.flags === 0; - } - function getTypeFromFlowType(flowType) { - return flowType.flags === 0 ? flowType.type : flowType; - } - function createFlowType(type, incomplete) { - return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type; - } - function createEvolvingArrayType(elementType) { - const result = createObjectType(256 /* EvolvingArray */); - result.elementType = elementType; - return result; - } - function getEvolvingArrayType(elementType) { - return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType)); - } - function addEvolvingArrayElementType(evolvingArrayType, node) { - const elementType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node))); - 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 - ); - } - function getFinalArrayType(evolvingArrayType) { - return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType)); - } - function finalizeEvolvingArrayType(type) { - return getObjectFlags(type) & 256 /* EvolvingArray */ ? getFinalArrayType(type) : type; - } - function getElementTypeOfEvolvingArrayType(type) { - return getObjectFlags(type) & 256 /* EvolvingArray */ ? type.elementType : neverType; - } - function isEvolvingArrayTypeList(types) { - let hasEvolvingArrayType = false; - for (const t of types) { - if (!(t.flags & 131072 /* Never */)) { - if (!(getObjectFlags(t) & 256 /* EvolvingArray */)) { - return false; - } - hasEvolvingArrayType = true; - } - } - return hasEvolvingArrayType; - } - function isEvolvingArrayOperationTarget(node) { - const root = getReferenceRoot(node); - const parent2 = root.parent; - const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 214 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name)); - const isElementAssignment = parent2.kind === 213 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 227 /* 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) { - return (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isParameter(node)) && !!(getEffectiveTypeAnnotationNode(node) || isInJSFile(node) && hasInitializer(node) && node.initializer && isFunctionExpressionOrArrowFunction(node.initializer) && getEffectiveReturnTypeNode(node.initializer)); - } - function getExplicitTypeOfSymbol(symbol, diagnostic) { - symbol = resolveSymbol(symbol); - if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 512 /* ValueModule */)) { - return getTypeOfSymbol(symbol); - } - if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - if (getCheckFlags(symbol) & 262144 /* Mapped */) { - const origin = symbol.links.syntheticOrigin; - if (origin && getExplicitTypeOfSymbol(origin)) { - return getTypeOfSymbol(symbol); - } - } - const declaration = symbol.valueDeclaration; - if (declaration) { - if (isDeclarationWithExplicitTypeAnnotation(declaration)) { - return getTypeOfSymbol(symbol); - } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) { - const statement = declaration.parent.parent; - const expressionType = getTypeOfDottedName( - statement.expression, - /*diagnostic*/ - void 0 - ); - if (expressionType) { - const use = statement.awaitModifier ? 15 /* ForAwaitOf */ : 13 /* ForOf */; - return checkIteratedTypeOrElementType( - use, - expressionType, - undefinedType, - /*errorNode*/ - void 0 - ); - } - } - if (diagnostic) { - addRelatedInfo(diagnostic, createDiagnosticForNode(declaration, Diagnostics._0_needs_an_explicit_type_annotation, symbolToString(symbol))); - } - } - } - } - function getTypeOfDottedName(node, diagnostic) { - if (!(node.flags & 67108864 /* InWithStatement */)) { - switch (node.kind) { - case 80 /* Identifier */: - const symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node)); - return getExplicitTypeOfSymbol(symbol, diagnostic); - case 110 /* ThisKeyword */: - return getExplicitThisType(node); - case 108 /* SuperKeyword */: - return checkSuperExpression(node); - case 212 /* PropertyAccessExpression */: { - const type = getTypeOfDottedName(node.expression, diagnostic); - if (type) { - const name = node.name; - let prop; - if (isPrivateIdentifier(name)) { - if (!type.symbol) { - return void 0; - } - prop = getPropertyOfType(type, getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText)); - } else { - prop = getPropertyOfType(type, name.escapedText); - } - return prop && getExplicitTypeOfSymbol(prop, diagnostic); - } - return void 0; - } - case 218 /* ParenthesizedExpression */: - return getTypeOfDottedName(node.expression, diagnostic); - } - } - } - function getEffectsSignature(node) { - const links = getNodeLinks(node); - let signature = links.effectsSignature; - if (signature === void 0) { - let funcType; - if (isBinaryExpression(node)) { - const rightType = checkNonNullExpression(node.right); - funcType = getSymbolHasInstanceMethodOfObjectType(rightType); - } else if (node.parent.kind === 245 /* ExpressionStatement */) { - funcType = getTypeOfDottedName( - node.expression, - /*diagnostic*/ - void 0 - ); - } else if (node.expression.kind !== 108 /* SuperKeyword */) { - if (isOptionalChain(node)) { - funcType = checkNonNullType( - getOptionalExpressionType(checkExpression(node.expression), node.expression), - node.expression - ); - } else { - funcType = checkNonNullExpression(node.expression); - } - } - const signatures = getSignaturesOfType(funcType && getApparentType(funcType) || unknownType, 0 /* Call */); - const candidate = signatures.length === 1 && !signatures[0].typeParameters ? signatures[0] : some(signatures, hasTypePredicateOrNeverReturnType) ? getResolvedSignature(node) : void 0; - signature = links.effectsSignature = candidate && hasTypePredicateOrNeverReturnType(candidate) ? candidate : unknownSignature; - } - return signature === unknownSignature ? void 0 : signature; - } - function hasTypePredicateOrNeverReturnType(signature) { - return !!(getTypePredicateOfSignature(signature) || signature.declaration && (getReturnTypeFromAnnotation(signature.declaration) || unknownType).flags & 131072 /* Never */); - } - function getTypePredicateArgument(predicate, callExpression) { - if (predicate.kind === 1 /* Identifier */ || predicate.kind === 3 /* AssertsIdentifier */) { - return callExpression.arguments[predicate.parameterIndex]; - } - const invokedExpression = skipParentheses(callExpression.expression); - return isAccessExpression(invokedExpression) ? skipParentheses(invokedExpression.expression) : void 0; - } - function reportFlowControlError(node) { - const block = findAncestor(node, isFunctionOrModuleBlock); - const sourceFile = getSourceFileOfNode(node); - const span = getSpanOfTokenAtPosition(sourceFile, block.statements.pos); - diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis)); - } - function isReachableFlowNode(flow) { - const result = isReachableFlowNodeWorker( - flow, - /*noCacheCheck*/ - false - ); - lastFlowNode = flow; - lastFlowNodeReachable = result; - return result; - } - function isFalseExpression(expr) { - const node = skipParentheses( - expr, - /*excludeJSDocTypeAssertions*/ - true - ); - return node.kind === 97 /* FalseKeyword */ || node.kind === 227 /* 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) { - if (flow === lastFlowNode) { - return lastFlowNodeReachable; - } - const flags = flow.flags; - if (flags & 4096 /* Shared */) { - if (!noCacheCheck) { - const id = getFlowNodeId(flow); - const reachable = flowNodeReachable[id]; - return reachable !== void 0 ? reachable : flowNodeReachable[id] = isReachableFlowNodeWorker( - flow, - /*noCacheCheck*/ - true - ); - } - noCacheCheck = false; - } - if (flags & (16 /* Assignment */ | 96 /* Condition */ | 256 /* ArrayMutation */)) { - flow = flow.antecedent; - } else if (flags & 512 /* Call */) { - const signature = getEffectsSignature(flow.node); - if (signature) { - const predicate = getTypePredicateOfSignature(signature); - if (predicate && predicate.kind === 3 /* AssertsIdentifier */ && !predicate.type) { - const predicateArgument = flow.node.arguments[predicate.parameterIndex]; - if (predicateArgument && isFalseExpression(predicateArgument)) { - return false; - } - } - if (getReturnTypeOfSignature(signature).flags & 131072 /* Never */) { - return false; - } - } - flow = flow.antecedent; - } else if (flags & 4 /* BranchLabel */) { - return some(flow.antecedent, (f) => isReachableFlowNodeWorker( - f, - /*noCacheCheck*/ - false - )); - } else if (flags & 8 /* LoopLabel */) { - const antecedents = flow.antecedent; - if (antecedents === void 0 || antecedents.length === 0) { - return false; - } - flow = antecedents[0]; - } else if (flags & 128 /* SwitchClause */) { - const data = flow.node; - if (data.clauseStart === data.clauseEnd && isExhaustiveSwitchStatement(data.switchStatement)) { - return false; - } - flow = flow.antecedent; - } else if (flags & 1024 /* ReduceLabel */) { - lastFlowNode = void 0; - const target = flow.node.target; - const saveAntecedents = target.antecedent; - target.antecedent = flow.node.antecedents; - const result = isReachableFlowNodeWorker( - flow.antecedent, - /*noCacheCheck*/ - false - ); - target.antecedent = saveAntecedents; - return result; - } else { - return !(flags & 1 /* Unreachable */); - } - } - } - function isPostSuperFlowNode(flow, noCacheCheck) { - while (true) { - const flags = flow.flags; - if (flags & 4096 /* Shared */) { - if (!noCacheCheck) { - const id = getFlowNodeId(flow); - const postSuper = flowNodePostSuper[id]; - return postSuper !== void 0 ? postSuper : flowNodePostSuper[id] = isPostSuperFlowNode( - flow, - /*noCacheCheck*/ - true - ); - } - noCacheCheck = false; - } - if (flags & (16 /* Assignment */ | 96 /* Condition */ | 256 /* ArrayMutation */ | 128 /* SwitchClause */)) { - flow = flow.antecedent; - } else if (flags & 512 /* Call */) { - if (flow.node.expression.kind === 108 /* SuperKeyword */) { - return true; - } - flow = flow.antecedent; - } else if (flags & 4 /* BranchLabel */) { - return every(flow.antecedent, (f) => isPostSuperFlowNode( - f, - /*noCacheCheck*/ - false - )); - } else if (flags & 8 /* LoopLabel */) { - flow = flow.antecedent[0]; - } else if (flags & 1024 /* ReduceLabel */) { - const target = flow.node.target; - const saveAntecedents = target.antecedent; - target.antecedent = flow.node.antecedents; - const result = isPostSuperFlowNode( - flow.antecedent, - /*noCacheCheck*/ - false - ); - target.antecedent = saveAntecedents; - return result; - } else { - return !!(flags & 1 /* Unreachable */); - } - } - } - function isConstantReference(node) { - switch (node.kind) { - case 110 /* ThisKeyword */: - return true; - case 80 /* Identifier */: - if (!isThisInTypeQuery(node)) { - const symbol = getResolvedSymbol(node); - return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol) || !!symbol.valueDeclaration && isFunctionExpression(symbol.valueDeclaration); - } - break; - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - const rootDeclaration = getRootDeclaration(node.parent); - return isParameter(rootDeclaration) || isCatchClauseVariableDeclaration(rootDeclaration) ? !isSomeSymbolAssigned(rootDeclaration) : isVariableDeclaration(rootDeclaration) && isVarConstLike2(rootDeclaration); - } - return false; - } - function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((_a) => (_a = tryCast(reference, canHaveFlowNode)) == null ? void 0 : _a.flowNode)()) { - let key; - let isKeySet = false; - let flowDepth = 0; - if (flowAnalysisDisabled) { - return errorType; - } - if (!flowNode) { - return declaredType; - } - flowInvocationCount++; - const sharedFlowStart = sharedFlowCount; - 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 === 236 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { - return declaredType; - } - return resultType; - function getOrSetCacheKey() { - if (isKeySet) { - return key; - } - isKeySet = true; - return key = getFlowCacheKey(reference, declaredType, initialType, flowContainer); - } - function getTypeAtFlowNode(flow) { - var _a2; - if (flowDepth === 2e3) { - (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "getTypeAtFlowNode_DepthLimit", { flowId: flow.id }); - flowAnalysisDisabled = true; - reportFlowControlError(reference); - return errorType; - } - flowDepth++; - let sharedFlow; - while (true) { - const flags = flow.flags; - if (flags & 4096 /* Shared */) { - for (let i = sharedFlowStart; i < sharedFlowCount; i++) { - if (sharedFlowNodes[i] === flow) { - flowDepth--; - return sharedFlowTypes[i]; - } - } - sharedFlow = flow; - } - let type; - if (flags & 16 /* Assignment */) { - type = getTypeAtFlowAssignment(flow); - if (!type) { - flow = flow.antecedent; - continue; - } - } else if (flags & 512 /* Call */) { - type = getTypeAtFlowCall(flow); - if (!type) { - flow = flow.antecedent; - continue; - } - } else if (flags & 96 /* Condition */) { - type = getTypeAtFlowCondition(flow); - } else if (flags & 128 /* SwitchClause */) { - type = getTypeAtSwitchClause(flow); - } else if (flags & 12 /* Label */) { - if (flow.antecedent.length === 1) { - flow = flow.antecedent[0]; - continue; - } - type = flags & 4 /* BranchLabel */ ? getTypeAtFlowBranchLabel(flow) : getTypeAtFlowLoopLabel(flow); - } else if (flags & 256 /* ArrayMutation */) { - type = getTypeAtFlowArrayMutation(flow); - if (!type) { - flow = flow.antecedent; - continue; - } - } else if (flags & 1024 /* ReduceLabel */) { - const target = flow.node.target; - const saveAntecedents = target.antecedent; - target.antecedent = flow.node.antecedents; - type = getTypeAtFlowNode(flow.antecedent); - target.antecedent = saveAntecedents; - } else if (flags & 2 /* Start */) { - const container = flow.node; - if (container && container !== flowContainer && reference.kind !== 212 /* PropertyAccessExpression */ && reference.kind !== 213 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 220 /* ArrowFunction */)) { - flow = container.flowNode; - continue; - } - type = initialType; - } else { - type = convertAutoToAny(declaredType); - } - if (sharedFlow) { - sharedFlowNodes[sharedFlowCount] = sharedFlow; - sharedFlowTypes[sharedFlowCount] = type; - sharedFlowCount++; - } - flowDepth--; - return type; - } - } - function getInitialOrAssignedType(flow) { - const node = flow.node; - return getNarrowableTypeForReference( - node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), - reference - ); - } - function getTypeAtFlowAssignment(flow) { - const node = flow.node; - if (isMatchingReference(reference, node)) { - if (!isReachableFlowNode(flow)) { - return unreachableNeverType; - } - if (getAssignmentTargetKind(node) === 2 /* Compound */) { - const flowType = getTypeAtFlowNode(flow.antecedent); - return createFlowType(getBaseTypeOfLiteralType(getTypeFromFlowType(flowType)), isIncomplete(flowType)); - } - if (declaredType === autoType || declaredType === autoArrayType) { - if (isEmptyArrayAssignment(node)) { - return getEvolvingArrayType(neverType); - } - const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow)); - return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType; - } - const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType; - if (t.flags & 1048576 /* Union */) { - return getAssignmentReducedType(t, getInitialOrAssignedType(flow)); - } - return t; - } - if (containsMatchingReference(reference, node)) { - if (!isReachableFlowNode(flow)) { - return unreachableNeverType; - } - if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConstLike2(node))) { - const init = getDeclaredExpandoInitializer(node); - if (init && (init.kind === 219 /* FunctionExpression */ || init.kind === 220 /* ArrowFunction */)) { - return getTypeAtFlowNode(flow.antecedent); - } - } - return declaredType; - } - if (isVariableDeclaration(node) && node.parent.parent.kind === 250 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { - return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); - } - return void 0; - } - function narrowTypeByAssertion(type, expr) { - const node = skipParentheses( - expr, - /*excludeJSDocTypeAssertions*/ - true - ); - if (node.kind === 97 /* FalseKeyword */) { - return unreachableNeverType; - } - if (node.kind === 227 /* BinaryExpression */) { - if (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */) { - return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); - } - if (node.operatorToken.kind === 57 /* BarBarToken */) { - return getUnionType([narrowTypeByAssertion(type, node.left), narrowTypeByAssertion(type, node.right)]); - } - } - return narrowType( - type, - node, - /*assumeTrue*/ - true - ); - } - function getTypeAtFlowCall(flow) { - const signature = getEffectsSignature(flow.node); - if (signature) { - const predicate = getTypePredicateOfSignature(signature); - if (predicate && (predicate.kind === 2 /* AssertsThis */ || predicate.kind === 3 /* AssertsIdentifier */)) { - const flowType = getTypeAtFlowNode(flow.antecedent); - const type = finalizeEvolvingArrayType(getTypeFromFlowType(flowType)); - const narrowedType = predicate.type ? narrowTypeByTypePredicate( - type, - predicate, - flow.node, - /*assumeTrue*/ - true - ) : predicate.kind === 3 /* AssertsIdentifier */ && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate.parameterIndex]) : type; - return narrowedType === type ? flowType : createFlowType(narrowedType, isIncomplete(flowType)); - } - if (getReturnTypeOfSignature(signature).flags & 131072 /* Never */) { - return unreachableNeverType; - } - } - return void 0; - } - function getTypeAtFlowArrayMutation(flow) { - if (declaredType === autoType || declaredType === autoArrayType) { - const node = flow.node; - const expr = node.kind === 214 /* 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 === 214 /* CallExpression */) { - for (const arg of node.arguments) { - evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg); - } - } else { - const indexType = getContextFreeTypeOfExpression(node.left.argumentExpression); - if (isTypeAssignableToKind(indexType, 296 /* NumberLike */)) { - evolvedType2 = addEvolvingArrayElementType(evolvedType2, node.right); - } - } - return evolvedType2 === type ? flowType : createFlowType(evolvedType2, isIncomplete(flowType)); - } - return flowType; - } - } - return void 0; - } - function getTypeAtFlowCondition(flow) { - const flowType = getTypeAtFlowNode(flow.antecedent); - const type = getTypeFromFlowType(flowType); - if (type.flags & 131072 /* Never */) { - return flowType; - } - const assumeTrue = (flow.flags & 32 /* TrueCondition */) !== 0; - const nonEvolvingType = finalizeEvolvingArrayType(type); - const narrowedType = narrowType(nonEvolvingType, flow.node, assumeTrue); - if (narrowedType === nonEvolvingType) { - return flowType; - } - return createFlowType(narrowedType, isIncomplete(flowType)); - } - function getTypeAtSwitchClause(flow) { - const expr = skipParentheses(flow.node.switchStatement.expression); - const flowType = getTypeAtFlowNode(flow.antecedent); - let type = getTypeFromFlowType(flowType); - if (isMatchingReference(reference, expr)) { - type = narrowTypeBySwitchOnDiscriminant(type, flow.node); - } else if (expr.kind === 222 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { - type = narrowTypeBySwitchOnTypeOf(type, flow.node); - } else if (expr.kind === 112 /* TrueKeyword */) { - type = narrowTypeBySwitchOnTrue(type, flow.node); - } else { - if (strictNullChecks) { - if (optionalChainContainsReference(expr, reference)) { - type = narrowTypeBySwitchOptionalChainContainment(type, flow.node, (t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))); - } else if (expr.kind === 222 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { - type = narrowTypeBySwitchOptionalChainContainment(type, flow.node, (t) => !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined")); - } - } - const access = getDiscriminantPropertyAccess(expr, type); - if (access) { - type = narrowTypeBySwitchOnDiscriminantProperty(type, access, flow.node); - } - } - return createFlowType(type, isIncomplete(flowType)); - } - function getTypeAtFlowBranchLabel(flow) { - const antecedentTypes = []; - let subtypeReduction = false; - let seenIncomplete = false; - let bypassFlow; - for (const antecedent of flow.antecedent) { - if (!bypassFlow && antecedent.flags & 128 /* SwitchClause */ && antecedent.node.clauseStart === antecedent.node.clauseEnd) { - bypassFlow = antecedent; - continue; - } - const flowType = getTypeAtFlowNode(antecedent); - const type = getTypeFromFlowType(flowType); - if (type === declaredType && declaredType === initialType) { - return type; - } - pushIfUnique(antecedentTypes, type); - if (!isTypeSubsetOf(type, initialType)) { - subtypeReduction = true; - } - if (isIncomplete(flowType)) { - seenIncomplete = true; - } - } - if (bypassFlow) { - const flowType = getTypeAtFlowNode(bypassFlow); - const type = getTypeFromFlowType(flowType); - if (!(type.flags & 131072 /* Never */) && !contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.node.switchStatement)) { - if (type === declaredType && declaredType === initialType) { - return type; - } - antecedentTypes.push(type); - if (!isTypeSubsetOf(type, initialType)) { - subtypeReduction = true; - } - if (isIncomplete(flowType)) { - seenIncomplete = true; - } - } - } - return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */), seenIncomplete); - } - function getTypeAtFlowLoopLabel(flow) { - const id = getFlowNodeId(flow); - const cache = flowLoopCaches[id] || (flowLoopCaches[id] = /* @__PURE__ */ new Map()); - const key2 = getOrSetCacheKey(); - if (!key2) { - return declaredType; - } - const cached = cache.get(key2); - if (cached) { - return cached; - } - for (let i = flowLoopStart; i < flowLoopCount; i++) { - if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key2 && flowLoopTypes[i].length) { - return createFlowType( - getUnionOrEvolvingArrayType(flowLoopTypes[i], 1 /* Literal */), - /*incomplete*/ - true - ); - } - } - const antecedentTypes = []; - let subtypeReduction = false; - let firstAntecedentType; - for (const antecedent of flow.antecedent) { - let flowType; - if (!firstAntecedentType) { - flowType = firstAntecedentType = getTypeAtFlowNode(antecedent); - } else { - flowLoopNodes[flowLoopCount] = flow; - flowLoopKeys[flowLoopCount] = key2; - flowLoopTypes[flowLoopCount] = antecedentTypes; - flowLoopCount++; - const saveFlowTypeCache = flowTypeCache; - flowTypeCache = void 0; - flowType = getTypeAtFlowNode(antecedent); - flowTypeCache = saveFlowTypeCache; - flowLoopCount--; - const cached2 = cache.get(key2); - if (cached2) { - return cached2; - } - } - const type = getTypeFromFlowType(flowType); - pushIfUnique(antecedentTypes, type); - if (!isTypeSubsetOf(type, initialType)) { - subtypeReduction = true; - } - if (type === declaredType) { - break; - } - } - const result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */); - if (isIncomplete(firstAntecedentType)) { - return createFlowType( - result, - /*incomplete*/ - true - ); - } - cache.set(key2, result); - return result; - } - function getUnionOrEvolvingArrayType(types, subtypeReduction) { - if (isEvolvingArrayTypeList(types)) { - return getEvolvingArrayType(getUnionType(map(types, getElementTypeOfEvolvingArrayType))); - } - const result = recombineUnknownType(getUnionType(sameMap(types, finalizeEvolvingArrayType), subtypeReduction)); - if (result !== declaredType && result.flags & declaredType.flags & 1048576 /* Union */ && arrayIsEqualTo(result.types, declaredType.types)) { - return declaredType; - } - return result; - } - function getCandidateDiscriminantPropertyAccess(expr) { - if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) { - if (isIdentifier(expr)) { - const symbol = getResolvedSymbol(expr); - const declaration = getExportSymbolOfValueSymbolIfExported(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 getDiscriminantPropertyAccess(expr, computedType) { - if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) { - const access = getCandidateDiscriminantPropertyAccess(expr); - if (access) { - const name = getAccessedPropertyName(access); - if (name) { - const type = declaredType.flags & 1048576 /* Union */ && isTypeSubsetOf(computedType, declaredType) ? declaredType : computedType; - if (isDiscriminantProperty(type, name)) { - return access; - } - } - } - } - return void 0; - } - function narrowTypeByDiscriminant(type, access, narrowType2) { - const propName = getAccessedPropertyName(access); - if (propName === void 0) { - return type; - } - const optionalChain = isOptionalChain(access); - const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */); - let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName); - if (!propType) { - return type; - } - propType = removeNullable && optionalChain ? getOptionalType(propType) : propType; - const narrowedPropType = narrowType2(propType); - return filterType(type, (t) => { - const discriminantType = getTypeOfPropertyOrIndexSignatureOfType(t, propName) || unknownType; - return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType); - }); - } - function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) { - if ((operator === 37 /* EqualsEqualsEqualsToken */ || operator === 38 /* ExclamationEqualsEqualsToken */) && type.flags & 1048576 /* Union */) { - const keyPropertyName = getKeyPropertyName(type); - if (keyPropertyName && keyPropertyName === getAccessedPropertyName(access)) { - const candidate = getConstituentTypeForKeyType(type, getTypeOfExpression(value)); - if (candidate) { - return operator === (assumeTrue ? 37 /* EqualsEqualsEqualsToken */ : 38 /* ExclamationEqualsEqualsToken */) ? candidate : isUnitType(getTypeOfPropertyOfType(candidate, keyPropertyName) || unknownType) ? removeType(type, candidate) : type; - } - } - } - return narrowTypeByDiscriminant(type, access, (t) => narrowTypeByEquality(t, operator, value, assumeTrue)); - } - function narrowTypeBySwitchOnDiscriminantProperty(type, access, data) { - if (data.clauseStart < data.clauseEnd && type.flags & 1048576 /* Union */ && getKeyPropertyName(type) === getAccessedPropertyName(access)) { - const clauseTypes = getSwitchClauseTypes(data.switchStatement).slice(data.clauseStart, data.clauseEnd); - const candidate = getUnionType(map(clauseTypes, (t) => getConstituentTypeForKeyType(type, t) || unknownType)); - if (candidate !== unknownType) { - return candidate; - } - } - return narrowTypeByDiscriminant(type, access, (t) => narrowTypeBySwitchOnDiscriminant(t, data)); - } - function narrowTypeByTruthiness(type, expr, assumeTrue) { - if (isMatchingReference(reference, expr)) { - return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */); - } - if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) { - type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */); - } - const access = getDiscriminantPropertyAccess(expr, type); - if (access) { - return narrowTypeByDiscriminant(type, access, (t) => getTypeWithFacts(t, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */)); - } - return type; - } - function isTypePresencePossible(type, propName, assumeTrue) { - const prop = getPropertyOfType(type, propName); - return prop ? !!(prop.flags & 16777216 /* Optional */ || getCheckFlags(prop) & 48 /* Partial */) || assumeTrue : !!getApplicableIndexInfoForName(type, propName) || !assumeTrue; - } - function narrowTypeByInKeyword(type, nameType, assumeTrue) { - const name = getPropertyNameFromType(nameType); - const isKnownProperty2 = someType(type, (t) => isTypePresencePossible( - t, - name, - /*assumeTrue*/ - true - )); - if (isKnownProperty2) { - return filterType(type, (t) => isTypePresencePossible(t, name, assumeTrue)); - } - if (assumeTrue) { - const recordSymbol = getGlobalRecordSymbol(); - if (recordSymbol) { - return getIntersectionType([type, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType])]); - } - } - 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 */: - case 76 /* BarBarEqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return narrowTypeByTruthiness(narrowType(type, expr.right, assumeTrue), expr.left, assumeTrue); - case 35 /* EqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - case 37 /* EqualsEqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - const operator = expr.operatorToken.kind; - const left = getReferenceCandidate(expr.left); - const right = getReferenceCandidate(expr.right); - if (left.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(right)) { - return narrowTypeByTypeof(type, left, operator, right, assumeTrue); - } - if (right.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(left)) { - return narrowTypeByTypeof(type, right, operator, left, assumeTrue); - } - if (isMatchingReference(reference, left)) { - return narrowTypeByEquality(type, operator, right, assumeTrue); - } - if (isMatchingReference(reference, right)) { - return narrowTypeByEquality(type, operator, left, assumeTrue); - } - if (strictNullChecks) { - if (optionalChainContainsReference(left, reference)) { - type = narrowTypeByOptionalChainContainment(type, operator, right, assumeTrue); - } else if (optionalChainContainsReference(right, reference)) { - type = narrowTypeByOptionalChainContainment(type, operator, left, assumeTrue); - } - } - const leftAccess = getDiscriminantPropertyAccess(left, type); - if (leftAccess) { - return narrowTypeByDiscriminantProperty(type, leftAccess, operator, right, assumeTrue); - } - const rightAccess = getDiscriminantPropertyAccess(right, type); - if (rightAccess) { - return narrowTypeByDiscriminantProperty(type, rightAccess, operator, left, assumeTrue); - } - if (isMatchingConstructorReference(left)) { - return narrowTypeByConstructor(type, operator, right, assumeTrue); - } - 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); - case 103 /* InKeyword */: - if (isPrivateIdentifier(expr.left)) { - return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue); - } - const target = getReferenceCandidate(expr.right); - 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)) { - const leftType = getTypeOfExpression(expr.left); - if (isTypeUsableAsPropertyName(leftType)) { - return narrowTypeByInKeyword(type, leftType, assumeTrue); - } - } - break; - case 28 /* CommaToken */: - return narrowType(type, expr.right, assumeTrue); - // Ordinarily we won't see && and || expressions in control flow analysis because the Binder breaks those - // expressions down to individual conditional control flows. However, we may encounter them when analyzing - // aliased conditional expressions. - case 56 /* AmpersandAmpersandToken */: - return assumeTrue ? narrowType( - narrowType( - type, - expr.left, - /*assumeTrue*/ - true - ), - expr.right, - /*assumeTrue*/ - true - ) : getUnionType([narrowType( - type, - expr.left, - /*assumeTrue*/ - false - ), narrowType( - type, - expr.right, - /*assumeTrue*/ - false - )]); - case 57 /* BarBarToken */: - return assumeTrue ? getUnionType([narrowType( - type, - expr.left, - /*assumeTrue*/ - true - ), narrowType( - type, - expr.right, - /*assumeTrue*/ - true - )]) : narrowType( - narrowType( - type, - expr.left, - /*assumeTrue*/ - false - ), - expr.right, - /*assumeTrue*/ - false - ); - } - return type; - } - function narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue) { - const target = getReferenceCandidate(expr.right); - if (!isMatchingReference(reference, target)) { - return type; - } - Debug.assertNode(expr.left, isPrivateIdentifier); - const symbol = getSymbolForPrivateIdentifierExpression(expr.left); - if (symbol === void 0) { - return type; - } - const classSymbol = symbol.parent; - const targetType = hasStaticModifier(Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration")) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); - return getNarrowedType( - type, - targetType, - assumeTrue, - /*checkDerived*/ - true - ); - } - function narrowTypeByOptionalChainContainment(type, operator, value, assumeTrue) { - const equalsOperator = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */; - const nullableFlags = operator === 35 /* EqualsEqualsToken */ || operator === 36 /* ExclamationEqualsToken */ ? 98304 /* Nullable */ : 32768 /* Undefined */; - const valueType = getTypeOfExpression(value); - const removeNullable = equalsOperator !== assumeTrue && everyType(valueType, (t) => !!(t.flags & nullableFlags)) || equalsOperator === assumeTrue && everyType(valueType, (t) => !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags))); - return removeNullable ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type; - } - function narrowTypeByEquality(type, operator, value, assumeTrue) { - if (type.flags & 1 /* Any */) { - return type; - } - if (operator === 36 /* ExclamationEqualsToken */ || operator === 38 /* ExclamationEqualsEqualsToken */) { - assumeTrue = !assumeTrue; - } - const valueType = getTypeOfExpression(value); - const doubleEquals = operator === 35 /* EqualsEqualsToken */ || operator === 36 /* ExclamationEqualsToken */; - if (valueType.flags & 98304 /* Nullable */) { - if (!strictNullChecks) { - return type; - } - const facts = doubleEquals ? assumeTrue ? 262144 /* EQUndefinedOrNull */ : 2097152 /* NEUndefinedOrNull */ : valueType.flags & 65536 /* Null */ ? assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ : assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */; - return getAdjustedTypeWithFacts(type, facts); - } - if (assumeTrue) { - if (!doubleEquals && (type.flags & 2 /* Unknown */ || someType(type, isEmptyAnonymousObjectType))) { - if (valueType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) { - return valueType; - } - if (valueType.flags & 524288 /* Object */) { - return nonPrimitiveType; - } - } - const filteredType = filterType(type, (t) => areTypesComparable(t, valueType) || doubleEquals && isCoercibleUnderDoubleEquals(t, valueType)); - return replacePrimitivesWithLiterals(filteredType, valueType); - } - if (isUnitType(valueType)) { - return filterType(type, (t) => !(isUnitLikeType(t) && areTypesComparable(t, valueType))); - } - return type; - } - function narrowTypeByTypeof(type, typeOfExpr, operator, literal, assumeTrue) { - if (operator === 36 /* ExclamationEqualsToken */ || operator === 38 /* ExclamationEqualsEqualsToken */) { - assumeTrue = !assumeTrue; - } - const target = getReferenceCandidate(typeOfExpr.expression); - if (!isMatchingReference(reference, target)) { - if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) { - type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */); - } - const propertyAccess = getDiscriminantPropertyAccess(target, type); - if (propertyAccess) { - return narrowTypeByDiscriminant(type, propertyAccess, (t) => narrowTypeByLiteralExpression(t, literal, assumeTrue)); - } - return type; - } - return narrowTypeByLiteralExpression(type, literal, assumeTrue); - } - function narrowTypeByLiteralExpression(type, literal, assumeTrue) { - return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */); - } - function narrowTypeBySwitchOptionalChainContainment(type, { switchStatement, clauseStart, clauseEnd }, clauseCheck) { - const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck); - return everyClauseChecks ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type; - } - function narrowTypeBySwitchOnDiscriminant(type, { switchStatement, clauseStart, clauseEnd }) { - const switchTypes = getSwitchClauseTypes(switchStatement); - if (!switchTypes.length) { - return type; - } - const clauseTypes = switchTypes.slice(clauseStart, clauseEnd); - const hasDefaultClause = clauseStart === clauseEnd || contains(clauseTypes, neverType); - if (type.flags & 2 /* Unknown */ && !hasDefaultClause) { - let groundClauseTypes; - for (let i = 0; i < clauseTypes.length; i += 1) { - const t = clauseTypes[i]; - if (t.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */)) { - if (groundClauseTypes !== void 0) { - groundClauseTypes.push(t); - } - } else if (t.flags & 524288 /* Object */) { - if (groundClauseTypes === void 0) { - groundClauseTypes = clauseTypes.slice(0, i); - } - groundClauseTypes.push(nonPrimitiveType); - } else { - return type; - } - } - return getUnionType(groundClauseTypes === void 0 ? clauseTypes : groundClauseTypes); - } - const discriminantType = getUnionType(clauseTypes); - const caseType = discriminantType.flags & 131072 /* Never */ ? neverType : replacePrimitivesWithLiterals(filterType(type, (t) => areTypesComparable(discriminantType, t)), discriminantType); - if (!hasDefaultClause) { - return caseType; - } - const defaultType = filterType(type, (t) => !(isUnitLikeType(t) && contains(switchTypes, t.flags & 32768 /* Undefined */ ? undefinedType : getRegularTypeOfLiteralType(extractUnitType(t))))); - return caseType.flags & 131072 /* Never */ ? defaultType : getUnionType([caseType, defaultType]); - } - function narrowTypeByTypeName(type, typeName) { - switch (typeName) { - case "string": - return narrowTypeByTypeFacts(type, stringType, 1 /* TypeofEQString */); - case "number": - return narrowTypeByTypeFacts(type, numberType, 2 /* TypeofEQNumber */); - case "bigint": - return narrowTypeByTypeFacts(type, bigintType, 4 /* TypeofEQBigInt */); - case "boolean": - return narrowTypeByTypeFacts(type, booleanType, 8 /* TypeofEQBoolean */); - case "symbol": - return narrowTypeByTypeFacts(type, esSymbolType, 16 /* TypeofEQSymbol */); - case "object": - return type.flags & 1 /* Any */ ? type : getUnionType([narrowTypeByTypeFacts(type, nonPrimitiveType, 32 /* TypeofEQObject */), narrowTypeByTypeFacts(type, nullType, 131072 /* EQNull */)]); - case "function": - return type.flags & 1 /* Any */ ? type : narrowTypeByTypeFacts(type, globalFunctionType, 64 /* TypeofEQFunction */); - case "undefined": - return narrowTypeByTypeFacts(type, undefinedType, 65536 /* EQUndefined */); - } - return narrowTypeByTypeFacts(type, nonPrimitiveType, 128 /* TypeofEQHostObject */); - } - function narrowTypeByTypeFacts(type, impliedType, facts) { - return mapType(type, (t) => ( - // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate - // 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) ? 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. - hasTypeFacts(t, facts) ? getIntersectionType([t, impliedType]) : neverType - ) - ) - )); - } - function narrowTypeBySwitchOnTypeOf(type, { switchStatement, clauseStart, clauseEnd }) { - const witnesses = getSwitchClauseTypeOfWitnesses(switchStatement); - if (!witnesses) { - return type; - } - const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* 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); - } - 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 === 298 /* 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 === 297 /* 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 === 297 /* 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 === 297 /* 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); - } - function narrowTypeByConstructor(type, operator, identifier, assumeTrue) { - if (assumeTrue ? operator !== 35 /* EqualsEqualsToken */ && operator !== 37 /* EqualsEqualsEqualsToken */ : operator !== 36 /* ExclamationEqualsToken */ && operator !== 38 /* ExclamationEqualsEqualsToken */) { - return type; - } - const identifierType = getTypeOfExpression(identifier); - if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { - return type; - } - const prototypeProperty = getPropertyOfType(identifierType, "prototype"); - if (!prototypeProperty) { - return type; - } - const prototypeType = getTypeOfSymbol(prototypeProperty); - const candidate = !isTypeAny(prototypeType) ? prototypeType : void 0; - if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { - return type; - } - if (isTypeAny(type)) { - return candidate; - } - return filterType(type, (t) => isConstructedBy(t, candidate)); - function isConstructedBy(source, target) { - if (source.flags & 524288 /* Object */ && getObjectFlags(source) & 1 /* Class */ || target.flags & 524288 /* Object */ && getObjectFlags(target) & 1 /* Class */) { - return source.symbol === target.symbol; - } - return isTypeSubtypeOf(source, target); - } - } - function narrowTypeByInstanceof(type, expr, assumeTrue) { - const left = getReferenceCandidate(expr.left); - if (!isMatchingReference(reference, left)) { - if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) { - return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */); - } - return type; - } - 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; - } - const instanceType = mapType(rightType, getInstanceType); - if (isTypeAny(type) && (instanceType === globalObjectType || instanceType === globalFunctionType) || !assumeTrue && !(instanceType.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(instanceType))) { - return type; - } - return getNarrowedType( - type, - instanceType, - assumeTrue, - /*checkDerived*/ - true - ); - } - function getInstanceType(constructorType) { - const prototypePropertyType = getTypeOfPropertyOfType(constructorType, "prototype"); - if (prototypePropertyType && !isTypeAny(prototypePropertyType)) { - return prototypePropertyType; - } - const constructSignatures = getSignaturesOfType(constructorType, 1 /* Construct */); - if (constructSignatures.length) { - return getUnionType(map(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))); - } - return emptyObjectType; - } - function getNarrowedType(type, candidate, assumeTrue, checkDerived) { - const key2 = type.flags & 1048576 /* Union */ ? `N${getTypeId(type)},${getTypeId(candidate)},${(assumeTrue ? 1 : 0) | (checkDerived ? 2 : 0)}` : void 0; - return getCachedType(key2) ?? setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived)); - } - function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) { - if (!assumeTrue) { - if (type === candidate) { - return neverType; - } - if (checkDerived) { - return filterType(type, (t) => !isTypeDerivedFrom(t, candidate)); - } - type = type.flags & 2 /* Unknown */ ? unknownUnionType : type; - const trueType2 = getNarrowedType( - type, - candidate, - /*assumeTrue*/ - true, - /*checkDerived*/ - false - ); - return recombineUnknownType(filterType(type, (t) => !isTypeSubsetOf(t, trueType2))); - } - 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 - ); - 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]); - } - function narrowTypeByCallExpression(type, callExpression, assumeTrue) { - if (hasMatchingArgument(callExpression, reference)) { - const signature = assumeTrue || !isCallChain(callExpression) ? getEffectsSignature(callExpression) : void 0; - const predicate = signature && getTypePredicateOfSignature(signature); - if (predicate && (predicate.kind === 0 /* This */ || predicate.kind === 1 /* Identifier */)) { - return narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue); - } - } - if (containsMissingType(type) && isAccessExpression(reference) && isPropertyAccessExpression(callExpression.expression)) { - const callAccess = callExpression.expression; - if (isMatchingReference(reference.expression, getReferenceCandidate(callAccess.expression)) && isIdentifier(callAccess.name) && callAccess.name.escapedText === "hasOwnProperty" && callExpression.arguments.length === 1) { - const argument = callExpression.arguments[0]; - if (isStringLiteralLike(argument) && getAccessedPropertyName(reference) === escapeLeadingUnderscores(argument.text)) { - return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */); - } - } - } - return type; - } - function narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue) { - if (predicate.type && !(isTypeAny(type) && (predicate.type === globalObjectType || predicate.type === globalFunctionType))) { - const predicateArgument = getTypePredicateArgument(predicate, callExpression); - if (predicateArgument) { - if (isMatchingReference(reference, predicateArgument)) { - return getNarrowedType( - type, - predicate.type, - assumeTrue, - /*checkDerived*/ - false - ); - } - 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); - if (access) { - return narrowTypeByDiscriminant(type, access, (t) => getNarrowedType( - t, - predicate.type, - assumeTrue, - /*checkDerived*/ - false - )); - } - } - } - return type; - } - function narrowType(type, expr, assumeTrue) { - if (isExpressionOfOptionalChainRoot(expr) || isBinaryExpression(expr.parent) && (expr.parent.operatorToken.kind === 61 /* QuestionQuestionToken */ || expr.parent.operatorToken.kind === 78 /* QuestionQuestionEqualsToken */) && expr.parent.left === expr) { - return narrowTypeByOptionality(type, expr, assumeTrue); - } - switch (expr.kind) { - case 80 /* Identifier */: - if (!isMatchingReference(reference, expr) && inlineLevel < 5) { - const symbol = getResolvedSymbol(expr); - if (isConstantVariable(symbol)) { - const declaration = symbol.valueDeclaration; - if (declaration && isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isConstantReference(reference)) { - inlineLevel++; - const result = narrowType(type, declaration.initializer, assumeTrue); - inlineLevel--; - return result; - } - } - } - // falls through - case 110 /* ThisKeyword */: - case 108 /* SuperKeyword */: - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return narrowTypeByTruthiness(type, expr, assumeTrue); - case 214 /* CallExpression */: - return narrowTypeByCallExpression(type, expr, assumeTrue); - case 218 /* ParenthesizedExpression */: - case 236 /* NonNullExpression */: - case 239 /* SatisfiesExpression */: - return narrowType(type, expr.expression, assumeTrue); - case 227 /* BinaryExpression */: - return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 225 /* PrefixUnaryExpression */: - if (expr.operator === 54 /* ExclamationToken */) { - return narrowType(type, expr.operand, !assumeTrue); - } - break; - } - return type; - } - function narrowTypeByOptionality(type, expr, assumePresent) { - if (isMatchingReference(reference, expr)) { - return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */); - } - const access = getDiscriminantPropertyAccess(expr, type); - if (access) { - return narrowTypeByDiscriminant(type, access, (t) => getTypeWithFacts(t, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */)); - } - return type; - } - } - function getTypeOfSymbolAtLocation(symbol, location) { - symbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (location.kind === 80 /* Identifier */ || location.kind === 81 /* PrivateIdentifier */) { - if (isRightSideOfQualifiedNameOrPropertyAccess(location)) { - location = location.parent; - } - if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) { - const type = removeOptionalTypeMarker( - isWriteAccess(location) && location.kind === 212 /* PropertyAccessExpression */ ? checkPropertyAccessExpression( - location, - /*checkMode*/ - void 0, - /*writeOnly*/ - true - ) : getTypeOfExpression(location) - ); - if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) { - return type; - } - } - } - if (isDeclarationName(location) && isSetAccessor(location.parent) && getAnnotatedAccessorTypeNode(location.parent)) { - return getWriteTypeOfAccessors(location.parent.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 === 269 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 173 /* PropertyDeclaration */); - } - function isSymbolAssignedDefinitely(symbol) { - if (symbol.lastAssignmentPos !== void 0) { - return symbol.lastAssignmentPos < 0; - } - return isSymbolAssigned(symbol) && symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0; - } - function isSymbolAssigned(symbol) { - return !isPastLastAssignment( - symbol, - /*location*/ - void 0 - ); - } - function isPastLastAssignment(symbol, location) { - const parent2 = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile); - if (!parent2) { - return false; - } - const links = getNodeLinks(parent2); - if (!(links.flags & 131072 /* AssignmentsMarked */)) { - links.flags |= 131072 /* AssignmentsMarked */; - if (!hasParentWithAssignmentsMarked(parent2)) { - markNodeAssignments(parent2); - } - } - return !symbol.lastAssignmentPos || location && Math.abs(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 !== 233 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name)); - } - function hasParentWithAssignmentsMarked(node) { - return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */)); - } - function isFunctionOrSourceFile(node) { - return isFunctionLikeDeclaration(node) || isSourceFile(node); - } - function markNodeAssignments(node) { - switch (node.kind) { - case 80 /* Identifier */: - const assigmentTarget = getAssignmentTargetKind(node); - if (assigmentTarget !== 0 /* None */) { - const symbol = getResolvedSymbol(node); - const hasDefiniteAssignment = assigmentTarget === 1 /* Definite */ || symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0; - if (isParameterOrMutableLocalVariable(symbol)) { - if (symbol.lastAssignmentPos === void 0 || Math.abs(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; - } - if (hasDefiniteAssignment && symbol.lastAssignmentPos > 0) { - symbol.lastAssignmentPos *= -1; - } - } - } - return; - case 282 /* ExportSpecifier */: - const exportDeclaration = node.parent.parent; - const name = node.propertyName || node.name; - if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier && name.kind !== 11 /* StringLiteral */) { - const symbol = resolveEntityName( - name, - 111551 /* Value */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true - ); - if (symbol && isParameterOrMutableLocalVariable(symbol)) { - const sign = symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0 ? -1 : 1; - symbol.lastAssignmentPos = sign * Number.MAX_VALUE; - } - } - return; - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 267 /* 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 244 /* VariableStatement */: - case 245 /* ExpressionStatement */: - case 246 /* IfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 255 /* WithStatement */: - case 256 /* SwitchStatement */: - case 259 /* TryStatement */: - case 264 /* ClassDeclaration */: - pos = node.end; - } - node = node.parent; - } - return pos; - } - function isConstantVariable(symbol) { - return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */) !== 0; - } - function isParameterOrMutableLocalVariable(symbol) { - const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration); - return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration))); - } - function isMutableLocalVariableDeclaration(declaration) { - return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 244 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent)); - } - function parameterInitializerContainsUndefined(declaration) { - const links = getNodeLinks(declaration); - if (links.parameterInitializerContainsUndefined === void 0) { - if (!pushTypeResolution(declaration, 8 /* ParameterInitializerContainsUndefined */)) { - reportCircularityError(declaration.symbol); - return true; - } - const containsUndefined = !!hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */); - if (!popTypeResolution()) { - reportCircularityError(declaration.symbol); - return true; - } - links.parameterInitializerContainsUndefined ?? (links.parameterInitializerContainsUndefined = containsUndefined); - } - return links.parameterInitializerContainsUndefined; - } - function removeOptionalityFromDeclaredType(declaredType, declaration) { - const removeUndefined = strictNullChecks && declaration.kind === 170 /* 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 === 212 /* PropertyAccessExpression */ || parent2.kind === 167 /* QualifiedName */ || parent2.kind === 214 /* CallExpression */ && parent2.expression === node || parent2.kind === 215 /* NewExpression */ && parent2.expression === node || parent2.kind === 213 /* 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 */)); - } - function isGenericTypeWithoutNullableConstraint(type) { - 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 & 32 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2( - node, - /*contextFlags*/ - void 0 - )); - return contextualType && !isGenericType(contextualType); - } - function getNarrowableTypeForReference(type, reference, checkMode) { - if (isNoInferType(type)) { - type = type.baseType; - } - const substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) && someType(type, isGenericTypeWithUnionConstraint) && (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode)); - return substituteConstraints ? mapType(type, getBaseConstraintOrType) : type; - } - function isExportOrExportExpression(location) { - return !!findAncestor(location, (n) => { - const parent2 = n.parent; - if (parent2 === void 0) { - return "quit"; - } - if (isExportAssignment(parent2)) { - return parent2.expression === n && isEntityNameExpression(n); - } - if (isExportSpecifier(parent2)) { - return parent2.name === n || parent2.propertyName === n; - } - return false; - }); - } - function markLinkedReferences(location, hint, propSymbol, parentType) { - if (!canCollectSymbolAliasAccessabilityData) { - return; - } - if (location.flags & 33554432 /* Ambient */ && !isPropertySignature(location) && !isPropertyDeclaration(location)) { - return; - } - switch (hint) { - case 1 /* Identifier */: - return markIdentifierAliasReferenced(location); - case 2 /* Property */: - return markPropertyAliasReferenced(location, propSymbol, parentType); - case 3 /* ExportAssignment */: - return markExportAssignmentAliasReferenced(location); - case 4 /* Jsx */: - return markJsxAliasReferenced(location); - case 5 /* AsyncFunction */: - return markAsyncFunctionAliasReferenced(location); - case 6 /* ExportImportEquals */: - return markImportEqualsAliasReferenced(location); - case 7 /* ExportSpecifier */: - return markExportSpecifierAliasReferenced(location); - case 8 /* Decorator */: - return markDecoratorAliasReferenced(location); - case 0 /* Unspecified */: { - if (isIdentifier(location) && (isExpressionNode(location) || isShorthandPropertyAssignment(location.parent) || isImportEqualsDeclaration(location.parent) && location.parent.moduleReference === location) && shouldMarkIdentifierAliasReferenced(location)) { - if (isPropertyAccessOrQualifiedName(location.parent)) { - const left = isPropertyAccessExpression(location.parent) ? location.parent.expression : location.parent.left; - if (left !== location) return; - } - markIdentifierAliasReferenced(location); - return; - } - if (isPropertyAccessOrQualifiedName(location)) { - let topProp = location; - while (isPropertyAccessOrQualifiedName(topProp)) { - if (isPartOfTypeNode(topProp)) return; - topProp = topProp.parent; - } - return markPropertyAliasReferenced(location); - } - if (isExportAssignment(location)) { - return markExportAssignmentAliasReferenced(location); - } - if (isJsxOpeningLikeElement(location) || isJsxOpeningFragment(location)) { - return markJsxAliasReferenced(location); - } - if (isImportEqualsDeclaration(location)) { - if (isInternalModuleImportEqualsDeclaration(location) || checkExternalImportOrExportDeclaration(location)) { - return markImportEqualsAliasReferenced(location); - } - return; - } - if (isExportSpecifier(location)) { - return markExportSpecifierAliasReferenced(location); - } - if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) { - markAsyncFunctionAliasReferenced(location); - } - if (!compilerOptions.emitDecoratorMetadata) { - return; - } - if (!canHaveDecorators(location) || !hasDecorators(location) || !location.modifiers || !nodeCanBeDecorated(legacyDecorators, location, location.parent, location.parent.parent)) { - return; - } - return markDecoratorAliasReferenced(location); - } - default: - Debug.assertNever(hint, `Unhandled reference hint: ${hint}`); - } - } - function markIdentifierAliasReferenced(location) { - const symbol = getResolvedSymbol(location); - if (symbol && symbol !== argumentsSymbol && symbol !== unknownSymbol && !isThisInTypeQuery(location)) { - markAliasReferenced(symbol, location); - } - } - function markPropertyAliasReferenced(location, propSymbol, parentType) { - const left = isPropertyAccessExpression(location) ? location.expression : location.left; - if (isThisIdentifier(left) || !isIdentifier(left)) { - return; - } - const parentSymbol = getResolvedSymbol(left); - if (!parentSymbol || parentSymbol === unknownSymbol) { - return; - } - if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location)) { - markAliasReferenced(parentSymbol, location); - return; - } - const leftType = parentType || checkExpressionCached(left); - if (isTypeAny(leftType) || leftType === silentNeverType) { - markAliasReferenced(parentSymbol, location); - return; - } - let prop = propSymbol; - if (!prop && !parentType) { - const right = isPropertyAccessExpression(location) ? location.name : location.right; - const lexicallyScopedSymbol = isPrivateIdentifier(right) && lookupSymbolForPrivateIdentifierDeclaration(right.escapedText, right); - const assignmentKind = getAssignmentTargetKind(location); - const apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(location) ? getWidenedType(leftType) : leftType); - prop = isPrivateIdentifier(right) ? lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(apparentType, lexicallyScopedSymbol) || void 0 : getPropertyOfType(apparentType, right.escapedText); - } - if (!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && location.parent.kind === 307 /* EnumMember */))) { - markAliasReferenced(parentSymbol, location); - } - return; - } - function markExportAssignmentAliasReferenced(location) { - if (isIdentifier(location.expression)) { - const id = location.expression; - const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( - id, - -1 /* All */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - location - )); - if (sym) { - markAliasReferenced(sym, id); - } - } - } - function markJsxAliasReferenced(node) { - if (!getJsxNamespaceContainerForImplicitImport(node)) { - const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found : void 0; - const jsxFactoryNamespace = getJsxNamespace(node); - const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node; - const shouldFactoryRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */; - let jsxFactorySym; - if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName( - jsxFactoryLocation, - jsxFactoryNamespace, - shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */, - jsxFactoryRefErr, - /*isUse*/ - true - ); - } - if (jsxFactorySym) { - jsxFactorySym.isReferenced = -1 /* All */; - if (canCollectSymbolAliasAccessabilityData && jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); - } - } - if (isJsxOpeningFragment(node)) { - const file = getSourceFileOfNode(node); - const entity = getJsxFactoryEntity(file); - if (entity) { - const localJsxNamespace = getFirstIdentifier(entity).escapedText; - resolveName( - jsxFactoryLocation, - localJsxNamespace, - shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */, - jsxFactoryRefErr, - /*isUse*/ - true - ); - } - } - } - return; - } - function markAsyncFunctionAliasReferenced(location) { - if (languageVersion < 2 /* ES2015 */) { - if (getFunctionFlags(location) & 2 /* Async */) { - const returnTypeNode = getEffectiveReturnTypeNode(location); - markTypeNodeAsReferenced(returnTypeNode); - } - } - } - function markImportEqualsAliasReferenced(location) { - if (hasSyntacticModifier(location, 32 /* Export */)) { - markExportAsReferenced(location); - } - } - function markExportSpecifierAliasReferenced(location) { - if (!location.parent.parent.moduleSpecifier && !location.isTypeOnly && !location.parent.parent.isTypeOnly) { - const exportedName = location.propertyName || location.name; - if (exportedName.kind === 11 /* StringLiteral */) { - return; - } - const symbol = resolveName( - exportedName, - exportedName.escapedText, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || symbol.declarations && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { - } else { - const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol); - if (!target || getSymbolFlags(target) & 111551 /* Value */) { - markExportAsReferenced(location); - markIdentifierAliasReferenced(exportedName); - } - } - return; - } - } - function markDecoratorAliasReferenced(node) { - if (compilerOptions.emitDecoratorMetadata) { - const firstDecorator = find(node.modifiers, isDecorator); - if (!firstDecorator) { - return; - } - checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); - switch (node.kind) { - case 264 /* ClassDeclaration */: - const constructor = getFirstConstructorWithBody(node); - if (constructor) { - for (const parameter of constructor.parameters) { - markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); - } - } - break; - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - const otherKind = node.kind === 178 /* GetAccessor */ ? 179 /* SetAccessor */ : 178 /* GetAccessor */; - const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(node), otherKind); - markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); - break; - case 175 /* MethodDeclaration */: - for (const parameter of node.parameters) { - markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); - } - markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node)); - break; - case 173 /* PropertyDeclaration */: - markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node)); - break; - case 170 /* Parameter */: - markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); - const containingSignature = node.parent; - for (const parameter of containingSignature.parameters) { - markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); - } - markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(containingSignature)); - break; - } - } - } - function markAliasReferenced(symbol, location) { - if (!canCollectSymbolAliasAccessabilityData) { - return; - } - if (isNonLocalAlias( - symbol, - /*excludes*/ - 111551 /* Value */ - ) && !isInTypeQuery(location)) { - const target = resolveAlias(symbol); - if (getSymbolFlags( - symbol, - /*excludeTypeOnlyMeanings*/ - true - ) & (111551 /* Value */ | 1048576 /* ExportValue */)) { - if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { - markAliasSymbolAsReferenced(symbol); - } - } - } - } - function markAliasSymbolAsReferenced(symbol) { - Debug.assert(canCollectSymbolAliasAccessabilityData); - const links = getSymbolLinks(symbol); - if (!links.referenced) { - links.referenced = true; - const node = getDeclarationOfAliasSymbol(symbol); - if (!node) return Debug.fail(); - if (isInternalModuleImportEqualsDeclaration(node)) { - if (getSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) { - const left = getFirstIdentifier(node.moduleReference); - markIdentifierAliasReferenced(left); - } - } - } - } - function markExportAsReferenced(node) { - const symbol = getSymbolOfDeclaration(node); - const target = resolveAlias(symbol); - if (target) { - const markAlias = target === unknownSymbol || getSymbolFlags( - symbol, - /*excludeTypeOnlyMeanings*/ - true - ) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); - if (markAlias) { - markAliasSymbolAsReferenced(symbol); - } - } - } - function markEntityNameOrEntityExpressionAsReference(typeName, forDecoratorMetadata) { - if (!typeName) return; - const rootName = getFirstIdentifier(typeName); - const meaning = (typeName.kind === 80 /* Identifier */ ? 788968 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */; - const rootSymbol = resolveName( - rootName, - rootName.escapedText, - meaning, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */) { - 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 = 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, isAliasSymbolDeclaration); - if (aliasDeclaration) { - addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics._0_was_imported_here, idText(rootName))); - } - } - } - } - function markTypeNodeAsReferenced(node) { - markEntityNameOrEntityExpressionAsReference( - node && getEntityNameFromTypeNode(node), - /*forDecoratorMetadata*/ - false - ); - } - function markDecoratorMedataDataTypeNodeAsReferenced(node) { - const entityName = getEntityNameForDecoratorMetadata(node); - if (entityName && isEntityName(entityName)) { - markEntityNameOrEntityExpressionAsReference( - entityName, - /*forDecoratorMetadata*/ - true - ); - } - } - function getNarrowedTypeOfSymbol(symbol, location) { - var _a; - const type = getTypeOfSymbol(symbol); - const declaration = symbol.valueDeclaration; - if (declaration) { - if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) { - const parent2 = declaration.parent.parent; - const rootDeclaration = getRootDeclaration(parent2); - if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) { - const links = getNodeLinks(parent2); - if (!(links.flags & 4194304 /* InCheckIdentifier */)) { - links.flags |= 4194304 /* InCheckIdentifier */; - const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */); - const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType); - links.flags &= ~4194304 /* InCheckIdentifier */; - if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) { - const pattern = declaration.parent; - const narrowedType = getFlowTypeOfReference( - pattern, - parentTypeConstraint, - parentTypeConstraint, - /*flowContainer*/ - void 0, - location.flowNode - ); - if (narrowedType.flags & 131072 /* Never */) { - return neverType; - } - return getBindingElementTypeFromParentType( - declaration, - narrowedType, - /*noTupleBoundsCheck*/ - true - ); - } - } - } - } - if (isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) { - const func = declaration.parent; - if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) { - 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) && !some(func.parameters, isSomeSymbolAssigned)) { - const narrowedType = getFlowTypeOfReference( - func, - restType, - restType, - /*flowContainer*/ - void 0, - location.flowNode - ); - const index = func.parameters.indexOf(declaration) - (getThisParameter(func) ? 1 : 0); - return getIndexedAccessType(narrowedType, getNumberLiteralType(index)); - } - } - } - } - } - return type; - } - function checkIdentifierCalculateNodeCheckFlags(node, symbol) { - if (isThisInTypeQuery(node)) return; - if (symbol === argumentsSymbol) { - if (isInPropertyInitializerOrClassStaticBlock( - node, - /*ignoreArrowFunctions*/ - true - )) { - error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks); - return; - } - let container = getContainingFunction(node); - if (container) { - if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 220 /* ArrowFunction */) { - error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_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_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 */; - } - } - } - return; - } - const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - const targetSymbol = resolveAliasWithDeprecationCheck(localOrExportSymbol, node); - if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) { - addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText); - } - const declaration = localOrExportSymbol.valueDeclaration; - if (declaration && localOrExportSymbol.flags & 32 /* Class */) { - if (isClassLike(declaration) && declaration.name !== node) { - let container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - while (container.kind !== 308 /* SourceFile */ && container.parent !== declaration) { - container = getThisContainer( - container, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - } - if (container.kind !== 308 /* SourceFile */) { - getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */; - getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */; - getNodeLinks(node).flags |= 536870912 /* ConstructorReference */; - } - } - } - checkNestedBlockScopedBinding(node, symbol); - } - function checkIdentifier(node, checkMode) { - if (isThisInTypeQuery(node)) { - return checkThisExpression(node); - } - const symbol = getResolvedSymbol(node); - if (symbol === unknownSymbol) { - return errorType; - } - checkIdentifierCalculateNodeCheckFlags(node, symbol); - if (symbol === argumentsSymbol) { - if (isInPropertyInitializerOrClassStaticBlock(node)) { - return errorType; - } - return getTypeOfSymbol(symbol); - } - if (shouldMarkIdentifierAliasReferenced(node)) { - markLinkedReferences(node, 1 /* Identifier */); - } - const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - let declaration = localOrExportSymbol.valueDeclaration; - const immediateDeclaration = declaration; - if (declaration && declaration.kind === 209 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent2) => parent2 === declaration.parent)) { - return nonInferrableAnyType; - } - let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node); - 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; - error2(node, assignmentError, symbolToString(symbol)); - return errorType; - } - if (isReadonlySymbol(localOrExportSymbol)) { - if (localOrExportSymbol.flags & 3 /* Variable */) { - error2(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); - } else { - error2(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); - } - return errorType; - } - } - const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */; - if (localOrExportSymbol.flags & 3 /* Variable */) { - if (assignmentKind === 1 /* Definite */) { - return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type; - } - } else if (isAlias) { - declaration = getDeclarationOfAliasSymbol(symbol); - } else { - return type; - } - if (!declaration) { - return type; - } - type = getNarrowableTypeForReference(type, node, checkMode); - const isParameter2 = getRootDeclaration(declaration).kind === 170 /* 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 === 236 /* NonNullExpression */; - while (flowContainer !== declarationContainer && (flowContainer.kind === 219 /* FunctionExpression */ || flowContainer.kind === 220 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) { - flowContainer = getControlFlowContainer(flowContainer); - } - const isNeverInitialized = immediateDeclaration && isVariableDeclaration(immediateDeclaration) && !immediateDeclaration.initializer && !immediateDeclaration.exclamationToken && isMutableLocalVariableDeclaration(immediateDeclaration) && !isSymbolAssignedDefinitely(symbol); - const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 282 /* ExportSpecifier */) || node.parent.kind === 236 /* NonNullExpression */ || declaration.kind === 261 /* 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) { - 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)) { - error2(node, Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol)); - return type; - } - return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; - } - function isSameScopedBindingElement(node, declaration) { - if (isBindingElement(declaration)) { - const bindingElement = findAncestor(node, isBindingElement); - return bindingElement && getRootDeclaration(bindingElement) === getRootDeclaration(declaration); - } - } - function shouldMarkIdentifierAliasReferenced(node) { - var _a; - const parent2 = node.parent; - if (parent2) { - if (isPropertyAccessExpression(parent2) && parent2.expression === node) { - return false; - } - if (isExportSpecifier(parent2) && parent2.isTypeOnly) { - return false; - } - const greatGrandparent = (_a = parent2.parent) == null ? void 0 : _a.parent; - if (greatGrandparent && isExportDeclaration(greatGrandparent) && greatGrandparent.isTypeOnly) { - return false; - } - } - return true; - } - function isInsideFunctionOrInstancePropertyInitializer(node, threshold) { - return !!findAncestor(node, (n) => n === threshold ? "quit" : isFunctionLike(n) || n.parent && isPropertyDeclaration(n.parent) && !hasStaticModifier(n.parent) && n.parent.initializer === n); - } - function getPartOfForStatementContainingNode(node, container) { - return findAncestor(node, (n) => n === container ? "quit" : n === container.initializer || n === container.condition || n === container.incrementor || n === container.statement); - } - function getEnclosingIterationStatement(node) { - return findAncestor(node, (n) => !n || nodeStartsNewLexicalEnvironment(n) ? "quit" : isIterationStatement( - n, - /*lookInLabeledStatements*/ - false - )); - } - function checkNestedBlockScopedBinding(node, symbol) { - if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 300 /* CatchClause */) { - return; - } - const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); - const isCaptured = isInsideFunctionOrInstancePropertyInitializer(node, container); - const enclosingIterationStatement = getEnclosingIterationStatement(container); - if (enclosingIterationStatement) { - if (isCaptured) { - let capturesBlockScopeBindingInLoopBody = true; - if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */); - if (varDeclList && varDeclList.parent === container) { - const part = getPartOfForStatementContainingNode(node.parent, container); - if (part) { - const links = getNodeLinks(part); - links.flags |= 8192 /* ContainsCapturedBlockScopeBinding */; - const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []); - pushIfUnique(capturedBindings, symbol); - if (part === container.initializer) { - capturesBlockScopeBindingInLoopBody = false; - } - } - } - } - if (capturesBlockScopeBindingInLoopBody) { - getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */; - } - } - if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */); - if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { - getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */; - } - } - getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */; - } - if (isCaptured) { - getNodeLinks(symbol.valueDeclaration).flags |= 16384 /* CapturedBlockScopedBinding */; - } - } - function isBindingCapturedByNode(node, decl) { - const links = getNodeLinks(node); - return !!links && contains(links.capturedBlockScopeBindings, getSymbolOfDeclaration(decl)); - } - function isAssignedInBodyOfForStatement(node, container) { - let current = node; - while (current.parent.kind === 218 /* ParenthesizedExpression */) { - current = current.parent; - } - let isAssigned = false; - if (isAssignmentTarget(current)) { - isAssigned = true; - } else if (current.parent.kind === 225 /* PrefixUnaryExpression */ || current.parent.kind === 226 /* PostfixUnaryExpression */) { - const expr = current.parent; - isAssigned = expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; - } - if (!isAssigned) { - return false; - } - return !!findAncestor(current, (n) => n === container ? "quit" : n === container.statement); - } - function captureLexicalThis(node, container) { - getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 173 /* PropertyDeclaration */ || container.kind === 177 /* Constructor */) { - const classNode = container.parent; - getNodeLinks(classNode).flags |= 4 /* CaptureThis */; - } else { - getNodeLinks(container).flags |= 4 /* CaptureThis */; - } - } - function findFirstSuperCall(node) { - return isSuperCall(node) ? node : isFunctionLike(node) ? void 0 : forEachChild(node, findFirstSuperCall); - } - function classDeclarationExtendsNull(classDecl) { - const classSymbol = getSymbolOfDeclaration(classDecl); - const classInstanceType = getDeclaredTypeOfSymbol(classSymbol); - const baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); - return baseConstructorType === nullWideningType; - } - function checkThisBeforeSuper(node, container, diagnosticMessage) { - const containingClassDecl = container.parent; - const baseTypeNode = getClassExtendsHeritageElement(containingClassDecl); - if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { - if (canHaveFlowNode(node) && node.flowNode && !isPostSuperFlowNode( - node.flowNode, - /*noCacheCheck*/ - false - )) { - error2(node, diagnosticMessage); - } - } - } - function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { - if (isPropertyDeclaration(container) && hasStaticModifier(container) && legacyDecorators && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { - error2(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); - } - } - function checkThisExpression(node) { - const isNodeInTypeQuery = isInTypeQuery(node); - let container = getThisContainer( - node, - /*includeArrowFunctions*/ - true, - /*includeClassComputedPropertyName*/ - true - ); - let capturedByArrowFunction = false; - let thisInComputedPropertyName = false; - if (container.kind === 177 /* Constructor */) { - checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); - } - while (true) { - if (container.kind === 220 /* ArrowFunction */) { - container = getThisContainer( - container, - /*includeArrowFunctions*/ - false, - !thisInComputedPropertyName - ); - capturedByArrowFunction = true; - } - if (container.kind === 168 /* ComputedPropertyName */) { - container = getThisContainer( - container, - !capturedByArrowFunction, - /*includeClassComputedPropertyName*/ - false - ); - thisInComputedPropertyName = true; - continue; - } - break; - } - checkThisInStaticClassFieldInitializerInDecoratedClass(node, container); - if (thisInComputedPropertyName) { - error2(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); - } else { - switch (container.kind) { - case 268 /* ModuleDeclaration */: - error2(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); - break; - case 267 /* EnumDeclaration */: - error2(node, Diagnostics.this_cannot_be_referenced_in_current_location); - break; - } - } - if (!isNodeInTypeQuery && capturedByArrowFunction && languageVersion < 2 /* ES2015 */) { - captureLexicalThis(node, container); - } - const type = tryGetThisTypeAt( - node, - /*includeGlobalThis*/ - true, - container - ); - if (noImplicitThis) { - const globalThisType2 = getTypeOfSymbol(globalThisSymbol); - if (type === globalThisType2 && capturedByArrowFunction) { - error2(node, Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this); - } else if (!type) { - 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) { - addRelatedInfo(diag2, createDiagnosticForNode(container, Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container)); - } - } - } - } - return type || anyType; - } - function tryGetThisTypeAt(node, includeGlobalThis = true, container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - )) { - const isInJS = isInJSFile(node); - if (isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || getThisParameter(container))) { - let thisType = getThisTypeOfDeclaration(container) || isInJS && getTypeForThisExpressionFromJSDoc(container); - if (!thisType) { - const className = getClassNameFromPrototypeMethod(container); - if (isInJS && className) { - const classSymbol = checkExpression(className).symbol; - if (classSymbol && classSymbol.members && classSymbol.flags & 16 /* Function */) { - thisType = getDeclaredTypeOfSymbol(classSymbol).thisType; - } - } else if (isJSConstructor(container)) { - thisType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; - } - thisType || (thisType = getContextualThisParameterType(container)); - } - if (thisType) { - return getFlowTypeOfReference(node, thisType); - } - } - if (isClassLike(container.parent)) { - const symbol = getSymbolOfDeclaration(container.parent); - const type = isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - return getFlowTypeOfReference(node, type); - } - if (isSourceFile(container)) { - if (container.commonJsModuleIndicator) { - const fileSymbol = getSymbolOfDeclaration(container); - return fileSymbol && getTypeOfSymbol(fileSymbol); - } else if (container.externalModuleIndicator) { - return undefinedType; - } else if (includeGlobalThis) { - return getTypeOfSymbol(globalThisSymbol); - } - } - } - function getExplicitThisType(node) { - const container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (isFunctionLike(container)) { - const signature = getSignatureFromDeclaration(container); - if (signature.thisParameter) { - return getExplicitTypeOfSymbol(signature.thisParameter); - } - } - if (isClassLike(container.parent)) { - const symbol = getSymbolOfDeclaration(container.parent); - return isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; - } - } - function getClassNameFromPrototypeMethod(container) { - if (container.kind === 219 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { - return container.parent.left.expression.expression; - } else if (container.kind === 175 /* MethodDeclaration */ && container.parent.kind === 211 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { - return container.parent.parent.left.expression; - } else if (container.kind === 219 /* FunctionExpression */ && container.parent.kind === 304 /* PropertyAssignment */ && container.parent.parent.kind === 211 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { - return container.parent.parent.parent.left.expression; - } else if (container.kind === 219 /* 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 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 === 170 /* Parameter */ && n.parent === constructorDecl); - } - function checkSuperExpression(node) { - const isCallExpression2 = node.parent.kind === 214 /* CallExpression */ && node.parent.expression === node; - const immediateContainer = getSuperContainer( - node, - /*stopOnFunctions*/ - true - ); - let container = immediateContainer; - let needToCaptureLexicalThis = false; - let inAsyncFunction = false; - if (!isCallExpression2) { - while (container && container.kind === 220 /* ArrowFunction */) { - if (hasSyntacticModifier(container, 1024 /* Async */)) inAsyncFunction = true; - container = getSuperContainer( - container, - /*stopOnFunctions*/ - true - ); - needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; - } - 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 === 168 /* ComputedPropertyName */); - if (current && current.kind === 168 /* ComputedPropertyName */) { - error2(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); - } else if (isCallExpression2) { - 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 === 211 /* ObjectLiteralExpression */)) { - error2(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); - } else { - 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 === 177 /* 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) { - nodeCheckFlag = 32 /* SuperStatic */; - if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) { - forEachEnclosingBlockScopeContainer(node.parent, (current) => { - if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) { - getNodeLinks(current).flags |= 2097152 /* ContainsSuperPropertyInStaticInitializer */; - } - }); - } - } else { - nodeCheckFlag = 16 /* SuperInstance */; - } - getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 175 /* MethodDeclaration */ && inAsyncFunction) { - if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) { - getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */; - } else { - getNodeLinks(container).flags |= 128 /* MethodWithSuperPropertyAccessInAsync */; - } - } - if (needToCaptureLexicalThis) { - captureLexicalThis(node.parent, container); - } - if (container.parent.kind === 211 /* ObjectLiteralExpression */) { - if (languageVersion < 2 /* ES2015 */) { - 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; - } - } - const classLikeDeclaration = container.parent; - if (!getClassExtendsHeritageElement(classLikeDeclaration)) { - 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 === 177 /* 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 === 177 /* Constructor */; - } else { - if (isClassLike(container2.parent) || container2.parent.kind === 211 /* ObjectLiteralExpression */) { - if (isStatic(container2)) { - return container2.kind === 175 /* MethodDeclaration */ || container2.kind === 174 /* MethodSignature */ || container2.kind === 178 /* GetAccessor */ || container2.kind === 179 /* SetAccessor */ || container2.kind === 173 /* PropertyDeclaration */ || container2.kind === 176 /* ClassStaticBlockDeclaration */; - } else { - return container2.kind === 175 /* MethodDeclaration */ || container2.kind === 174 /* MethodSignature */ || container2.kind === 178 /* GetAccessor */ || container2.kind === 179 /* SetAccessor */ || container2.kind === 173 /* PropertyDeclaration */ || container2.kind === 172 /* PropertySignature */ || container2.kind === 177 /* Constructor */; - } - } - } - return false; - } - } - function getContainingObjectLiteral(func) { - return (func.kind === 175 /* MethodDeclaration */ || func.kind === 178 /* GetAccessor */ || func.kind === 179 /* SetAccessor */) && func.parent.kind === 211 /* ObjectLiteralExpression */ ? func.parent : func.kind === 219 /* FunctionExpression */ && func.parent.kind === 304 /* PropertyAssignment */ ? func.parent.parent : void 0; - } - function getThisTypeArgument(type) { - return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0; - } - function getThisTypeFromContextualType(type) { - return mapType(type, (t) => { - 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 !== 304 /* PropertyAssignment */) { - break; - } - literal = literal.parent.parent; - type = getApparentTypeOfContextualType( - literal, - /*contextFlags*/ - void 0 - ); - } - } - function getContextualThisParameterType(func) { - if (func.kind === 220 /* ArrowFunction */) { - return void 0; - } - if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { - const contextualSignature = getContextualSignature(func); - if (contextualSignature) { - const thisParameter = contextualSignature.thisParameter; - if (thisParameter) { - return getTypeOfSymbol(thisParameter); - } - } - } - const inJs = isInJSFile(func); - if (noImplicitThis || inJs) { - const containingLiteral = getContainingObjectLiteral(func); - if (containingLiteral) { - const contextualType = getApparentTypeOfContextualType( - containingLiteral, - /*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 (isAssignmentExpression(parent2)) { - const target = parent2.left; - if (isAccessExpression(target)) { - const { expression } = target; - if (inJs && isIdentifier(expression)) { - const sourceFile = getSourceFileOfNode(parent2); - if (sourceFile.commonJsModuleIndicator && getResolvedSymbol(expression) === sourceFile.symbol) { - return void 0; - } - } - return getWidenedType(checkExpressionCached(expression)); - } - } - } - return void 0; - } - function getContextuallyTypedParameterType(parameter) { - const func = parameter.parent; - if (!isContextSensitiveFunctionOrObjectLiteralMethod(func)) { - return void 0; - } - const iife = getImmediatelyInvokedFunctionExpression(func); - if (iife && iife.arguments) { - const args = getEffectiveCallArguments(iife); - const indexOfParameter = func.parameters.indexOf(parameter); - if (parameter.dotDotDotToken) { - return getSpreadArgumentType( - args, - indexOfParameter, - args.length, - anyType, - /*context*/ - void 0, - 0 /* Normal */ - ); - } - const links = getNodeLinks(iife); - const cached = links.resolvedSignature; - links.resolvedSignature = anySignature; - const type = indexOfParameter < args.length ? getWidenedLiteralType(checkExpression(args[indexOfParameter])) : parameter.initializer ? void 0 : undefinedWideningType; - links.resolvedSignature = cached; - return type; - } - const contextualSignature = getContextualSignature(func); - if (contextualSignature) { - const index = func.parameters.indexOf(parameter) - (getThisParameter(func) ? 1 : 0); - return parameter.dotDotDotToken && lastOrUndefined(func.parameters) === parameter ? getRestTypeAtPosition(contextualSignature, index) : tryGetTypeAtPosition(contextualSignature, index); - } - } - function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) { - const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0); - if (typeNode) { - return getTypeFromTypeNode(typeNode); - } - switch (declaration.kind) { - case 170 /* Parameter */: - return getContextuallyTypedParameterType(declaration); - case 209 /* BindingElement */: - return getContextualTypeForBindingElement(declaration, contextFlags); - case 173 /* PropertyDeclaration */: - if (isStatic(declaration)) { - return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags); - } - } - } - function getContextualTypeForBindingElement(declaration, contextFlags) { - const parent2 = declaration.parent.parent; - const name = declaration.propertyName || declaration.name; - const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 209 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */); - if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name)) return void 0; - if (parent2.name.kind === 208 /* ArrayBindingPattern */) { - const index = indexOfNode(declaration.parent.elements, declaration); - if (index < 0) return void 0; - return getContextualTypeForElementExpression(parentType, index); - } - const nameType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(nameType)) { - const text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(parentType, text); - } - } - function getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags) { - const parentType = isExpression(declaration.parent) && getContextualType2(declaration.parent, contextFlags); - if (!parentType) return void 0; - return getTypeOfPropertyOfContextualType(parentType, getSymbolOfDeclaration(declaration).escapedName); - } - function getContextualTypeForInitializerExpression(node, contextFlags) { - const declaration = node.parent; - if (hasInitializer(declaration) && node === declaration.initializer) { - const result = getContextualTypeForVariableLikeDeclaration(declaration, contextFlags); - if (result) { - return result; - } - if (!(contextFlags & 8 /* SkipBindingPatterns */) && isBindingPattern(declaration.name) && declaration.name.elements.length > 0) { - return getTypeFromBindingPattern( - declaration.name, - /*includePatternInType*/ - true, - /*reportErrors*/ - false - ); - } - } - return void 0; - } - function getContextualTypeForReturnExpression(node, contextFlags) { - const func = getContainingFunction(node); - if (func) { - let contextualReturnType = getContextualReturnType(func, contextFlags); - if (contextualReturnType) { - const functionFlags = getFunctionFlags(func); - if (functionFlags & 1 /* Generator */) { - const isAsyncGenerator = (functionFlags & 2 /* Async */) !== 0; - if (contextualReturnType.flags & 1048576 /* Union */) { - contextualReturnType = filterType(contextualReturnType, (type) => !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator)); - } - const iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0); - if (!iterationReturnType) { - return void 0; - } - contextualReturnType = iterationReturnType; - } - if (functionFlags & 2 /* Async */) { - const contextualAwaitedType = mapType(contextualReturnType, getAwaitedTypeNoAlias); - return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); - } - return contextualReturnType; - } - } - return void 0; - } - function getContextualTypeForAwaitOperand(node, contextFlags) { - const contextualType = getContextualType2(node, contextFlags); - if (contextualType) { - const contextualAwaitedType = getAwaitedTypeNoAlias(contextualType); - return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); - } - return void 0; - } - function getContextualTypeForYieldOperand(node, contextFlags) { - const func = getContainingFunction(node); - if (func) { - const functionFlags = getFunctionFlags(func); - let contextualReturnType = getContextualReturnType(func, contextFlags); - if (contextualReturnType) { - const isAsyncGenerator = (functionFlags & 2 /* Async */) !== 0; - if (!node.asteriskToken && contextualReturnType.flags & 1048576 /* Union */) { - contextualReturnType = filterType(contextualReturnType, (type) => !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator)); - } - if (node.asteriskToken) { - const iterationTypes = getIterationTypesOfGeneratorFunctionReturnType(contextualReturnType, isAsyncGenerator); - const yieldType = (iterationTypes == null ? void 0 : iterationTypes.yieldType) ?? silentNeverType; - const returnType = getContextualType2(node, contextFlags) ?? silentNeverType; - const nextType = (iterationTypes == null ? void 0 : iterationTypes.nextType) ?? unknownType; - const generatorType = createGeneratorType( - yieldType, - returnType, - nextType, - /*isAsyncGenerator*/ - false - ); - if (isAsyncGenerator) { - const asyncGeneratorType = createGeneratorType( - yieldType, - returnType, - nextType, - /*isAsyncGenerator*/ - true - ); - return getUnionType([generatorType, asyncGeneratorType]); - } - return generatorType; - } - return getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, isAsyncGenerator); - } - } - return void 0; - } - function isInParameterInitializerBeforeContainingFunction(node) { - let inBindingInitializer = false; - while (node.parent && !isFunctionLike(node.parent)) { - if (isParameter(node.parent) && (inBindingInitializer || node.parent.initializer === node)) { - return true; - } - if (isBindingElement(node.parent) && node.parent.initializer === node) { - inBindingInitializer = true; - } - node = node.parent; - } - return false; - } - function getContextualIterationType(kind, functionDecl) { - const isAsync = !!(getFunctionFlags(functionDecl) & 2 /* Async */); - const contextualReturnType = getContextualReturnType( - functionDecl, - /*contextFlags*/ - void 0 - ); - if (contextualReturnType) { - return getIterationTypeOfGeneratorFunctionReturnType(kind, contextualReturnType, isAsync) || void 0; - } - return void 0; - } - function getContextualReturnType(functionDecl, contextFlags) { - const returnType = getReturnTypeFromAnnotation(functionDecl); - if (returnType) { - return returnType; - } - const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature && !isResolvingReturnTypeOfSignature(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) { - return getContextualType2(iife, contextFlags); - } - return void 0; - } - function getContextualTypeForArgument(callTarget, arg) { - const args = getEffectiveCallArguments(callTarget); - const argIndex = args.indexOf(arg); - return argIndex === -1 ? void 0 : getContextualTypeForArgumentAtIndex(callTarget, argIndex); - } - function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { - if (isImportCall(callTarget)) { - return argIndex === 0 ? stringType : argIndex === 1 ? getGlobalImportCallOptionsType( - /*reportErrors*/ - false - ) : anyType; - } - const signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - if (isJsxOpeningLikeElement(callTarget) && argIndex === 0) { - return getEffectiveFirstArgumentForJsxSignature(signature, callTarget); - } - const restIndex = signature.parameters.length - 1; - return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex); - } - function getContextualTypeForDecorator(decorator) { - const signature = getDecoratorCallSignature(decorator); - return signature ? getOrCreateTypeFromSignature(signature) : void 0; - } - function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 216 /* TaggedTemplateExpression */) { - return getContextualTypeForArgument(template.parent, substitutionExpression); - } - return void 0; - } - function getContextualTypeForBinaryOperand(node, contextFlags) { - const binaryExpression = node.parent; - const { left, operatorToken, right } = binaryExpression; - switch (operatorToken.kind) { - case 64 /* EqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 76 /* BarBarEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : void 0; - case 57 /* BarBarToken */: - case 61 /* QuestionQuestionToken */: - const type = getContextualType2(binaryExpression, contextFlags); - return node === right && (type && type.pattern || !type && !isDefaultedExpandoInitializer(binaryExpression)) ? getTypeOfExpression(left) : type; - case 56 /* AmpersandAmpersandToken */: - case 28 /* CommaToken */: - return node === right ? getContextualType2(binaryExpression, contextFlags) : void 0; - default: - return void 0; - } - } - function getSymbolForExpression(e) { - if (canHaveSymbol(e) && e.symbol) { - return e.symbol; - } - if (isIdentifier(e)) { - return getResolvedSymbol(e); - } - if (isPropertyAccessExpression(e)) { - const lhsType = getTypeOfExpression(e.expression); - return isPrivateIdentifier(e.name) ? tryGetPrivateIdentifierPropertyOfType(lhsType, e.name) : getPropertyOfType(lhsType, e.name.escapedText); - } - if (isElementAccessExpression(e)) { - const propType = checkExpressionCached(e.argumentExpression); - if (!isTypeUsableAsPropertyName(propType)) { - return void 0; - } - const lhsType = getTypeOfExpression(e.expression); - return getPropertyOfType(lhsType, getPropertyNameFromType(propType)); - } - return void 0; - function tryGetPrivateIdentifierPropertyOfType(type, id) { - const lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(id.escapedText, id); - return lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(type, lexicallyScopedSymbol); - } - } - function getContextualTypeForAssignmentDeclaration(binaryExpression) { - var _a, _b; - const kind = getAssignmentDeclarationKind(binaryExpression); - switch (kind) { - case 0 /* None */: - case 4 /* ThisProperty */: - const lhsSymbol = getSymbolForExpression(binaryExpression.left); - const decl = lhsSymbol && lhsSymbol.valueDeclaration; - if (decl && (isPropertyDeclaration(decl) || isPropertySignature(decl))) { - const overallAnnotation = getEffectiveTypeAnnotationNode(decl); - return overallAnnotation && instantiateType(getTypeFromTypeNode(overallAnnotation), getSymbolLinks(lhsSymbol).mapper) || (isPropertyDeclaration(decl) ? decl.initializer && getTypeOfExpression(binaryExpression.left) : void 0); - } - if (kind === 0 /* None */) { - return getTypeOfExpression(binaryExpression.left); - } - return getContextualTypeForThisPropertyAssignment(binaryExpression); - case 5 /* Property */: - if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { - return getContextualTypeForThisPropertyAssignment(binaryExpression); - } else if (!canHaveSymbol(binaryExpression.left) || !binaryExpression.left.symbol) { - return getTypeOfExpression(binaryExpression.left); - } else { - const decl2 = binaryExpression.left.symbol.valueDeclaration; - if (!decl2) { - return void 0; - } - const lhs = cast(binaryExpression.left, isAccessExpression); - const overallAnnotation = getEffectiveTypeAnnotationNode(decl2); - if (overallAnnotation) { - return getTypeFromTypeNode(overallAnnotation); - } else if (isIdentifier(lhs.expression)) { - const id = lhs.expression; - const parentSymbol = resolveName( - id, - id.escapedText, - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (parentSymbol) { - const annotated2 = parentSymbol.valueDeclaration && getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); - if (annotated2) { - const nameStr = getElementOrPropertyAccessName(lhs); - if (nameStr !== void 0) { - return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated2), nameStr); - } - } - return void 0; - } - } - return isInJSFile(decl2) || decl2 === binaryExpression.left ? void 0 : getTypeOfExpression(binaryExpression.left); - } - case 1 /* ExportsProperty */: - case 6 /* Prototype */: - case 3 /* PrototypeProperty */: - case 2 /* ModuleExports */: - let valueDeclaration; - if (kind !== 2 /* ModuleExports */) { - valueDeclaration = canHaveSymbol(binaryExpression.left) ? (_a = binaryExpression.left.symbol) == null ? void 0 : _a.valueDeclaration : void 0; - } - valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) == null ? void 0 : _b.valueDeclaration); - const annotated = valueDeclaration && getEffectiveTypeAnnotationNode(valueDeclaration); - return annotated ? getTypeFromTypeNode(annotated) : void 0; - case 7 /* ObjectDefinePropertyValue */: - case 8 /* ObjectDefinePropertyExports */: - case 9 /* ObjectDefinePrototypeProperty */: - return Debug.fail("Does not apply"); - default: - return Debug.assertNever(kind); - } - } - function isPossiblyAliasedThisProperty(declaration, kind = getAssignmentDeclarationKind(declaration)) { - if (kind === 4 /* ThisProperty */) { - return true; - } - if (!isInJSFile(declaration) || kind !== 5 /* Property */ || !isIdentifier(declaration.left.expression)) { - return false; - } - const name = declaration.left.expression.escapedText; - const symbol = resolveName( - declaration.left, - name, - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true, - /*excludeGlobals*/ - true - ); - return isThisInitializedDeclaration(symbol == null ? void 0 : symbol.valueDeclaration); - } - function getContextualTypeForThisPropertyAssignment(binaryExpression) { - if (!binaryExpression.symbol) return getTypeOfExpression(binaryExpression.left); - if (binaryExpression.symbol.valueDeclaration) { - const annotated = getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); - if (annotated) { - const type = getTypeFromTypeNode(annotated); - if (type) { - return type; - } - } - } - const thisAccess = cast(binaryExpression.left, isAccessExpression); - if (!isObjectLiteralMethod(getThisContainer( - thisAccess.expression, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ))) { - return void 0; - } - const thisType = checkThisExpression(thisAccess.expression); - const nameStr = getElementOrPropertyAccessName(thisAccess); - return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0; - } - function isCircularMappedProperty(symbol) { - return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0); - } - function isExcludedMappedPropertyName(constraint, propertyNameType) { - if (constraint.flags & 16777216 /* Conditional */) { - const type = constraint; - return !!(getReducedType(getTrueTypeFromConditionalType(type)).flags & 131072 /* Never */) && getActualTypeVariable(getFalseTypeFromConditionalType(type)) === getActualTypeVariable(type.checkType) && isTypeAssignableTo(propertyNameType, type.extendsType); - } - if (constraint.flags & 2097152 /* Intersection */) { - return some(constraint.types, (t) => isExcludedMappedPropertyName(t, propertyNameType)); - } - return false; - } - function getTypeOfPropertyOfContextualType(type, name, nameType) { - return mapType( - type, - (t) => { - if (t.flags & 2097152 /* Intersection */) { - let types; - let indexInfoCandidates; - let ignoreIndexInfos = false; - for (const constituentType of t.types) { - if (!(constituentType.flags & 524288 /* Object */)) { - continue; - } - if (isGenericMappedType(constituentType) && getMappedTypeNameTypeKind(constituentType) !== 2 /* Remapping */) { - const substitutedType = getIndexedMappedTypeSubstitutedTypeOfContextualType(constituentType, name, nameType); - types = appendContextualPropertyTypeConstituent(types, substitutedType); - continue; - } - const propertyType = getTypeOfConcretePropertyOfContextualType(constituentType, name); - if (!propertyType) { - if (!ignoreIndexInfos) { - indexInfoCandidates = append(indexInfoCandidates, constituentType); - } - continue; - } - ignoreIndexInfos = true; - indexInfoCandidates = void 0; - types = appendContextualPropertyTypeConstituent(types, propertyType); - } - if (indexInfoCandidates) { - for (const candidate of indexInfoCandidates) { - const indexInfoType = getTypeFromIndexInfosOfContextualType(candidate, name, nameType); - types = appendContextualPropertyTypeConstituent(types, indexInfoType); - } - } - if (!types) { - return; - } - if (types.length === 1) { - return types[0]; - } - return getIntersectionType(types); - } - if (!(t.flags & 524288 /* Object */)) { - return; - } - return isGenericMappedType(t) && getMappedTypeNameTypeKind(t) !== 2 /* Remapping */ ? getIndexedMappedTypeSubstitutedTypeOfContextualType(t, name, nameType) : getTypeOfConcretePropertyOfContextualType(t, name) ?? getTypeFromIndexInfosOfContextualType(t, name, nameType); - }, - /*noReductions*/ - true - ); - } - function appendContextualPropertyTypeConstituent(types, type) { - return type ? append(types, type.flags & 1 /* Any */ ? unknownType : type) : types; - } - function getIndexedMappedTypeSubstitutedTypeOfContextualType(type, name, nameType) { - const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name)); - const constraint = getConstraintTypeFromMappedType(type); - if (type.nameType && isExcludedMappedPropertyName(type.nameType, propertyNameType) || isExcludedMappedPropertyName(constraint, propertyNameType)) { - return; - } - const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint; - if (!isTypeAssignableTo(propertyNameType, constraintOfConstraint)) { - return; - } - return substituteIndexedMappedType(type, propertyNameType); - } - function getTypeOfConcretePropertyOfContextualType(type, name) { - const prop = getPropertyOfType(type, name); - if (!prop || isCircularMappedProperty(prop)) { - return; - } - return removeMissingType(getTypeOfSymbol(prop), !!(prop.flags & 16777216 /* Optional */)); - } - function getTypeFromIndexInfosOfContextualType(type, name, nameType) { - var _a; - if (isTupleType(type) && isNumericLiteralName(name) && +name >= 0) { - const restType = getElementTypeOfSliceOfTupleType( - type, - type.target.fixedLength, - /*endSkipCount*/ - 0, - /*writing*/ - false, - /*noReductions*/ - true - ); - if (restType) { - return restType; - } - } - return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(type), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type; - } - function getContextualTypeForObjectLiteralMethod(node, contextFlags) { - Debug.assert(isObjectLiteralMethod(node)); - if (node.flags & 67108864 /* InWithStatement */) { - return void 0; - } - return getContextualTypeForObjectLiteralElement(node, contextFlags); - } - function getContextualTypeForObjectLiteralElement(element, contextFlags) { - const objectLiteral = element.parent; - const propertyAssignmentType = isPropertyAssignment(element) && getContextualTypeForVariableLikeDeclaration(element, contextFlags); - if (propertyAssignmentType) { - return propertyAssignmentType; - } - const type = getApparentTypeOfContextualType(objectLiteral, contextFlags); - if (type) { - if (hasBindableName(element)) { - const symbol = getSymbolOfDeclaration(element); - return getTypeOfPropertyOfContextualType(type, symbol.escapedName, getSymbolLinks(symbol).nameType); - } - if (hasDynamicName(element)) { - const name = getNameOfDeclaration(element); - if (name && isComputedPropertyName(name)) { - const exprType = checkExpression(name.expression); - const propType = isTypeUsableAsPropertyName(exprType) && getTypeOfPropertyOfContextualType(type, getPropertyNameFromType(exprType)); - if (propType) { - return propType; - } - } - } - if (element.name) { - const nameType = getLiteralTypeFromPropertyName(element.name); - return mapType( - type, - (t) => { - var _a; - return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType)) == null ? void 0 : _a.type; - }, - /*noReductions*/ - true - ); - } - } - return void 0; - } - function getSpreadIndices(elements) { - let first2, last2; - for (let i = 0; i < elements.length; i++) { - if (isSpreadElement(elements[i])) { - first2 ?? (first2 = i); - last2 = i; - } - } - return { first: first2, last: last2 }; - } - function getContextualTypeForElementExpression(type, index, length2, firstSpreadIndex, lastSpreadIndex) { - return type && mapType( - type, - (t) => { - if (isTupleType(t)) { - if ((firstSpreadIndex === void 0 || index < firstSpreadIndex) && index < t.target.fixedLength) { - 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.combinedFlags & 12 /* Variable */ ? getEndElementCount(t.target, 3 /* Fixed */) : 0; - if (offset > 0 && offset <= fixedEndLength) { - return getTypeArguments(t)[getTypeReferenceArity(t) - offset]; - } - return getElementTypeOfSliceOfTupleType( - t, - firstSpreadIndex === void 0 ? t.target.fixedLength : Math.min(t.target.fixedLength, firstSpreadIndex), - length2 === void 0 || lastSpreadIndex === void 0 ? fixedEndLength : Math.min(fixedEndLength, length2 - lastSpreadIndex), - /*writing*/ - false, - /*noReductions*/ - true - ); - } - return (!firstSpreadIndex || index < firstSpreadIndex) && getTypeOfPropertyOfContextualType(t, "" + index) || getIteratedTypeOrElementType( - 1 /* Element */, - t, - undefinedType, - /*errorNode*/ - void 0, - /*checkAssignability*/ - false - ); - }, - /*noReductions*/ - true - ); - } - function getContextualTypeForConditionalOperand(node, contextFlags) { - const conditional = node.parent; - return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0; - } - function getContextualTypeForChildJsxExpression(node, child, contextFlags) { - const attributesType = getApparentTypeOfContextualType(node.openingElement.attributes, contextFlags); - const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); - if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { - return void 0; - } - const realChildren = getSemanticJsxChildren(node.children); - const childIndex = realChildren.indexOf(child); - const childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); - return childFieldType && (realChildren.length === 1 ? childFieldType : mapType( - childFieldType, - (t) => { - if (isArrayLikeType(t)) { - return getIndexedAccessType(t, getNumberLiteralType(childIndex)); - } else { - return t; - } - }, - /*noReductions*/ - true - )); - } - function getContextualTypeForJsxExpression(node, contextFlags) { - const exprParent = node.parent; - return isJsxAttributeLike(exprParent) ? getContextualType2(node, contextFlags) : isJsxElement(exprParent) ? getContextualTypeForChildJsxExpression(exprParent, node, contextFlags) : void 0; - } - function getContextualTypeForJsxAttribute(attribute, contextFlags) { - if (isJsxAttribute(attribute)) { - const attributesType = getApparentTypeOfContextualType(attribute.parent, contextFlags); - if (!attributesType || isTypeAny(attributesType)) { - return void 0; - } - return getTypeOfPropertyOfContextualType(attributesType, getEscapedTextOfJsxAttributeName(attribute.name)); - } else { - return getContextualType2(attribute.parent, contextFlags); - } - } - function isPossiblyDiscriminantValue(node) { - switch (node.kind) { - case 11 /* StringLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 229 /* TemplateExpression */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 106 /* NullKeyword */: - case 80 /* Identifier */: - case 157 /* UndefinedKeyword */: - return true; - case 212 /* PropertyAccessExpression */: - case 218 /* ParenthesizedExpression */: - return isPossiblyDiscriminantValue(node.expression); - case 295 /* JsxExpression */: - return !node.expression || isPossiblyDiscriminantValue(node.expression); - } - return false; - } - function discriminateContextualTypeByObjectMembers(node, contextualType) { - const key = `D${getNodeId(node)},${getTypeId(contextualType)}`; - return getCachedType(key) ?? setCachedType( - key, - getMatchingUnionConstituentForObjectLiteral(contextualType, node) ?? discriminateTypeByDiscriminableItems( - contextualType, - concatenate( - map( - filter(node.properties, (p) => { - if (!p.symbol) { - return false; - } - if (p.kind === 304 /* PropertyAssignment */) { - return isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); - } - if (p.kind === 305 /* ShorthandPropertyAssignment */) { - return isDiscriminantProperty(contextualType, p.symbol.escapedName); - } - return false; - }), - (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 304 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName] - ), - map( - filter(getPropertiesOfType(contextualType), (s) => { - var _a; - return !!(s.flags & 16777216 /* Optional */) && !!((_a = node == null ? void 0 : node.symbol) == null ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); - }), - (s) => [() => undefinedType, s.escapedName] - ) - ), - isTypeAssignableTo - ) - ); - } - function discriminateContextualTypeByJSXAttributes(node, contextualType) { - const key = `D${getNodeId(node)},${getTypeId(contextualType)}`; - const cached = getCachedType(key); - if (cached) return cached; - const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); - return setCachedType( - key, - discriminateTypeByDiscriminableItems( - contextualType, - concatenate( - map( - filter(node.properties, (p) => !!p.symbol && p.kind === 292 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))), - (prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName] - ), - map( - filter(getPropertiesOfType(contextualType), (s) => { - var _a; - if (!(s.flags & 16777216 /* Optional */) || !((_a = node == null ? void 0 : node.symbol) == null ? void 0 : _a.members)) { - return false; - } - const element = node.parent.parent; - if (s.escapedName === jsxChildrenPropertyName && isJsxElement(element) && getSemanticJsxChildren(element.children).length) { - return false; - } - return !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); - }), - (s) => [() => undefinedType, s.escapedName] - ) - ), - isTypeAssignableTo - ) - ); - } - function getApparentTypeOfContextualType(node, contextFlags) { - const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType2(node, contextFlags); - const instantiatedType = instantiateContextualType(contextualType, node, contextFlags); - if (instantiatedType && !(contextFlags && contextFlags & 2 /* NoConstraints */ && instantiatedType.flags & 8650752 /* TypeVariable */)) { - const apparentType = mapType( - instantiatedType, - // When obtaining apparent type of *contextual* type we don't want to get apparent type of mapped types. - // That would evaluate mapped types with array or tuple type constraints too eagerly - // and thus it would prevent `getTypeOfPropertyOfContextualType` from obtaining per-position contextual type for elements of array literal expressions. - // Apparent type of other mapped types is already the mapped type itself so we can just avoid calling `getApparentType` here for all mapped types. - (t) => getObjectFlags(t) & 32 /* Mapped */ ? t : getApparentType(t), - /*noReductions*/ - true - ); - return apparentType.flags & 1048576 /* Union */ && isObjectLiteralExpression(node) ? discriminateContextualTypeByObjectMembers(node, apparentType) : apparentType.flags & 1048576 /* Union */ && isJsxAttributes(node) ? discriminateContextualTypeByJSXAttributes(node, apparentType) : apparentType; - } - } - function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) { - const inferenceContext = getInferenceContext(node); - if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) { - return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper); - } - if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) { - const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper); - return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type; - } - } - return contextualType; - } - function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 465829888 /* Instantiable */) { - return instantiateType(type, mapper); - } - if (type.flags & 1048576 /* Union */) { - return getUnionType(map(type.types, (t) => instantiateInstantiableTypes(t, mapper)), 0 /* None */); - } - if (type.flags & 2097152 /* Intersection */) { - return getIntersectionType(map(type.types, (t) => instantiateInstantiableTypes(t, mapper))); - } - return type; - } - function getContextualType2(node, contextFlags) { - var _a; - if (node.flags & 67108864 /* InWithStatement */) { - return void 0; - } - const index = findContextualNode( - node, - /*includeCaches*/ - !contextFlags - ); - if (index >= 0) { - return contextualTypes[index]; - } - const { parent: parent2 } = node; - switch (parent2.kind) { - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 209 /* BindingElement */: - return getContextualTypeForInitializerExpression(node, contextFlags); - case 220 /* ArrowFunction */: - case 254 /* ReturnStatement */: - return getContextualTypeForReturnExpression(node, contextFlags); - case 230 /* YieldExpression */: - return getContextualTypeForYieldOperand(parent2, contextFlags); - case 224 /* AwaitExpression */: - return getContextualTypeForAwaitOperand(parent2, contextFlags); - case 214 /* CallExpression */: - case 215 /* NewExpression */: - return getContextualTypeForArgument(parent2, node); - case 171 /* Decorator */: - return getContextualTypeForDecorator(parent2); - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - return isConstTypeReference(parent2.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(parent2.type); - case 227 /* BinaryExpression */: - return getContextualTypeForBinaryOperand(node, contextFlags); - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - return getContextualTypeForObjectLiteralElement(parent2, contextFlags); - case 306 /* SpreadAssignment */: - return getContextualType2(parent2.parent, contextFlags); - case 210 /* 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 228 /* ConditionalExpression */: - return getContextualTypeForConditionalOperand(node, contextFlags); - case 240 /* TemplateSpan */: - Debug.assert(parent2.parent.kind === 229 /* TemplateExpression */); - return getContextualTypeForSubstitutionExpression(parent2.parent, node); - case 218 /* ParenthesizedExpression */: { - if (isInJSFile(parent2)) { - if (isJSDocSatisfiesExpression(parent2)) { - return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2)); - } - const typeTag = getJSDocTypeTag(parent2); - if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) { - return getTypeFromTypeNode(typeTag.typeExpression.type); - } - } - return getContextualType2(parent2, contextFlags); - } - case 236 /* NonNullExpression */: - return getContextualType2(parent2, contextFlags); - case 239 /* SatisfiesExpression */: - return getTypeFromTypeNode(parent2.type); - case 278 /* ExportAssignment */: - return tryGetTypeFromEffectiveTypeNode(parent2); - case 295 /* JsxExpression */: - return getContextualTypeForJsxExpression(parent2, contextFlags); - case 292 /* JsxAttribute */: - case 294 /* JsxSpreadAttribute */: - return getContextualTypeForJsxAttribute(parent2, contextFlags); - case 287 /* JsxOpeningElement */: - case 286 /* JsxSelfClosingElement */: - return getContextualJsxElementAttributesType(parent2, contextFlags); - case 302 /* ImportAttribute */: - return getContextualImportAttributeType(parent2); - } - return void 0; - } - function pushCachedContextualType(node) { - pushContextualType( - node, - getContextualType2( - node, - /*contextFlags*/ - void 0 - ), - /*isCache*/ - true - ); - } - function pushContextualType(node, type, isCache) { - contextualTypeNodes[contextualTypeCount] = node; - contextualTypes[contextualTypeCount] = type; - contextualIsCache[contextualTypeCount] = isCache; - contextualTypeCount++; - } - function popContextualType() { - contextualTypeCount--; - contextualTypeNodes[contextualTypeCount] = void 0; - contextualTypes[contextualTypeCount] = void 0; - contextualIsCache[contextualTypeCount] = void 0; - } - function findContextualNode(node, includeCaches) { - for (let i = contextualTypeCount - 1; i >= 0; i--) { - if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) { - return i; - } - } - return -1; - } - function pushInferenceContext(node, inferenceContext) { - inferenceContextNodes[inferenceContextCount] = node; - inferenceContexts[inferenceContextCount] = inferenceContext; - inferenceContextCount++; - } - function popInferenceContext() { - inferenceContextCount--; - inferenceContextNodes[inferenceContextCount] = void 0; - inferenceContexts[inferenceContextCount] = void 0; - } - function getInferenceContext(node) { - for (let i = inferenceContextCount - 1; i >= 0; i--) { - if (isNodeDescendantOf(node, inferenceContextNodes[i])) { - return inferenceContexts[i]; - } - } - } - function pushActiveMapper(mapper) { - activeTypeMappers[activeTypeMappersCount] = mapper; - activeTypeMappersCaches[activeTypeMappersCount] ?? (activeTypeMappersCaches[activeTypeMappersCount] = /* @__PURE__ */ new Map()); - activeTypeMappersCount++; - } - function popActiveMapper() { - activeTypeMappersCount--; - activeTypeMappers[activeTypeMappersCount] = void 0; - activeTypeMappersCaches[activeTypeMappersCount].clear(); - } - function findActiveMapper(mapper) { - for (let i = activeTypeMappersCount - 1; i >= 0; i--) { - if (mapper === activeTypeMappers[i]) { - return i; - } - } - return -1; - } - function clearActiveMapperCaches() { - for (let i = activeTypeMappersCount - 1; i >= 0; i--) { - activeTypeMappersCaches[i].clear(); - } - } - function getContextualImportAttributeType(node) { - return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType( - /*reportErrors*/ - false - ), getNameFromImportAttribute(node)); - } - function getContextualJsxElementAttributesType(node, contextFlags) { - if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) { - const index = findContextualNode( - node.parent, - /*includeCaches*/ - !contextFlags - ); - if (index >= 0) { - return contextualTypes[index]; - } - } - return getContextualTypeForArgumentAtIndex(node, 0); - } - function getEffectiveFirstArgumentForJsxSignature(signature, node) { - return isJsxOpeningFragment(node) || getJsxReferenceKind(node) !== 0 /* Component */ ? getJsxPropsTypeFromCallSignature(signature, node) : getJsxPropsTypeFromClassType(signature, node); - } - function getJsxPropsTypeFromCallSignature(sig, context) { - let propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType); - propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType); - const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); - if (!isErrorType(intrinsicAttribs)) { - propsType = intersectTypes(intrinsicAttribs, propsType); - } - return propsType; - } - function getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation) { - if (sig.compositeSignatures) { - const results = []; - for (const signature of sig.compositeSignatures) { - const instance = getReturnTypeOfSignature(signature); - if (isTypeAny(instance)) { - return instance; - } - const propType = getTypeOfPropertyOfType(instance, forcedLookupLocation); - if (!propType) { - return; - } - results.push(propType); - } - return getIntersectionType(results); - } - const instanceType = getReturnTypeOfSignature(sig); - return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation); - } - function getStaticTypeOfReferencedJsxConstructor(context) { - if (isJsxOpeningFragment(context)) return getJSXFragmentType(context); - if (isJsxIntrinsicTagName(context.tagName)) { - const result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(context); - const fakeSignature = createSignatureForJSXIntrinsic(context, result); - return getOrCreateTypeFromSignature(fakeSignature); - } - const tagType = checkExpressionCached(context.tagName); - if (tagType.flags & 128 /* StringLiteral */) { - const result = getIntrinsicAttributesTypeFromStringLiteralType(tagType, context); - if (!result) { - return errorType; - } - const fakeSignature = createSignatureForJSXIntrinsic(context, result); - return getOrCreateTypeFromSignature(fakeSignature); - } - return tagType; - } - function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) { - const managedSym = getJsxLibraryManagedAttributes(ns); - if (managedSym) { - const ctorType = getStaticTypeOfReferencedJsxConstructor(context); - const result = instantiateAliasOrInterfaceWithDefaults(managedSym, isInJSFile(context), ctorType, attributesType); - if (result) { - return result; - } - } - return attributesType; - } - function getJsxPropsTypeFromClassType(sig, context) { - const ns = getJsxNamespaceAt(context); - const forcedLookupLocation = getJsxElementPropertiesName(ns); - let attributesType = forcedLookupLocation === void 0 ? getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType) : forcedLookupLocation === "" ? getReturnTypeOfSignature(sig) : getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation); - if (!attributesType) { - if (!!forcedLookupLocation && !!length(context.attributes.properties)) { - error2(context, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(forcedLookupLocation)); - } - return unknownType; - } - attributesType = getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType); - if (isTypeAny(attributesType)) { - return attributesType; - } else { - let apparentAttributesType = attributesType; - const intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context); - if (!isErrorType(intrinsicClassAttribs)) { - const typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); - const hostClassType = getReturnTypeOfSignature(sig); - let libraryManagedAttributeType; - if (typeParams) { - const inferredArgs = fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isInJSFile(context)); - libraryManagedAttributeType = instantiateType(intrinsicClassAttribs, createTypeMapper(typeParams, inferredArgs)); - } else libraryManagedAttributeType = intrinsicClassAttribs; - apparentAttributesType = intersectTypes(libraryManagedAttributeType, apparentAttributesType); - } - const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); - if (!isErrorType(intrinsicAttribs)) { - apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); - } - return apparentAttributesType; - } - } - function getIntersectedSignatures(signatures) { - return getStrictOptionValue(compilerOptions, "noImplicitAny") ? reduceLeft( - signatures, - (left, right) => left === right || !left ? left : compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right) : void 0 - ) : void 0; - } - function combineIntersectionThisParam(left, right, mapper) { - if (!left || !right) { - return left || right; - } - const thisType = getUnionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]); - return createSymbolWithType(left, thisType); - } - function combineIntersectionParameters(left, right, mapper) { - const leftCount = getParameterCount(left); - const rightCount = getParameterCount(right); - const longest = leftCount >= rightCount ? left : right; - const shorter = longest === left ? right : left; - const longestCount = longest === left ? leftCount : rightCount; - const eitherHasEffectiveRest = hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right); - const needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); - const params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); - for (let i = 0; i < longestCount; i++) { - let longestParamType = tryGetTypeAtPosition(longest, i); - if (longest === right) { - longestParamType = instantiateType(longestParamType, mapper); - } - let shorterParamType = tryGetTypeAtPosition(shorter, i) || unknownType; - if (shorter === right) { - shorterParamType = instantiateType(shorterParamType, mapper); - } - const unionParamType = getUnionType([longestParamType, shorterParamType]); - const isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === longestCount - 1; - const isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter); - const leftName = i >= leftCount ? void 0 : getParameterNameAtPosition(left, i); - const rightName = i >= rightCount ? void 0 : getParameterNameAtPosition(right, i); - const paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0; - const paramSymbol = createSymbol( - 1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), - 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", 32768 /* RestParameter */); - restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount)); - if (shorter === right) { - restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper); - } - params[longestCount] = restParamSymbol; - } - return params; - } - function combineSignaturesOfIntersectionMembers(left, right) { - const typeParams = left.typeParameters || right.typeParameters; - let paramMapper; - if (left.typeParameters && right.typeParameters) { - paramMapper = createTypeMapper(right.typeParameters, left.typeParameters); - } - let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */); - const declaration = left.declaration; - const params = combineIntersectionParameters(left, right, paramMapper); - const lastParam = lastOrUndefined(params); - if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) { - flags |= 1 /* HasRestParameter */; - } - const thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper); - const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); - const result = createSignature( - declaration, - typeParams, - thisParam, - params, - /*resolvedReturnType*/ - void 0, - /*resolvedTypePredicate*/ - void 0, - minArgCount, - flags - ); - result.compositeKind = 2097152 /* Intersection */; - 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; - } - return result; - } - function getContextualCallSignature(type, node) { - const signatures = getSignaturesOfType(type, 0 /* Call */); - const applicableByArity = filter(signatures, (s) => !isAritySmaller(s, node)); - return applicableByArity.length === 1 ? applicableByArity[0] : getIntersectedSignatures(applicableByArity); - } - function isAritySmaller(signature, target) { - let targetParameterCount = 0; - for (; targetParameterCount < target.parameters.length; targetParameterCount++) { - const param = target.parameters[targetParameterCount]; - if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { - break; - } - } - if (target.parameters.length && parameterIsThisKeyword(target.parameters[0])) { - targetParameterCount--; - } - return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; - } - function getContextualSignatureForFunctionLikeDeclaration(node) { - return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0; - } - function getContextualSignature(node) { - Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); - const typeTagSignature = getSignatureOfTypeTag(node); - if (typeTagSignature) { - return typeTagSignature; - } - const type = getApparentTypeOfContextualType(node, 1 /* Signature */); - if (!type) { - return void 0; - } - if (!(type.flags & 1048576 /* Union */)) { - return getContextualCallSignature(type, node); - } - let signatureList; - const types = type.types; - for (const current of types) { - const signature = getContextualCallSignature(current, node); - if (signature) { - if (!signatureList) { - signatureList = [signature]; - } else if (!compareSignaturesIdentical( - signatureList[0], - signature, - /*partialMatch*/ - false, - /*ignoreThisTypes*/ - true, - /*ignoreReturnTypes*/ - true, - compareTypesIdentical - )) { - return void 0; - } else { - signatureList.push(signature); - } - } - } - if (signatureList) { - return signatureList.length === 1 ? signatureList[0] : createUnionSignature(signatureList[0], signatureList); - } - } - function checkGrammarRegularExpressionLiteral(node) { - const sourceFile = getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile) && !node.isUnterminated) { - let lastError; - scanner2 ?? (scanner2 = createScanner( - 99 /* ESNext */, - /*skipTrivia*/ - true - )); - scanner2.setScriptTarget(sourceFile.languageVersion); - scanner2.setLanguageVariant(sourceFile.languageVariant); - scanner2.setOnError((message, length2, arg0) => { - const start = scanner2.getTokenEnd(); - if (message.category === 3 /* Message */ && lastError && start === lastError.start && length2 === lastError.length) { - const error3 = createDetachedDiagnostic(sourceFile.fileName, sourceFile.text, start, length2, message, arg0); - addRelatedInfo(lastError, error3); - } else if (!lastError || start !== lastError.start) { - lastError = createFileDiagnostic(sourceFile, start, length2, message, arg0); - diagnostics.add(lastError); - } - }); - scanner2.setText(sourceFile.text, node.pos, node.end - node.pos); - try { - scanner2.scan(); - Debug.assert(scanner2.reScanSlashToken( - /*reportErrors*/ - true - ) === 14 /* RegularExpressionLiteral */, "Expected scanner to rescan RegularExpressionLiteral"); - return !!lastError; - } finally { - scanner2.setText(""); - scanner2.setOnError( - /*onError*/ - void 0 - ); - } - } - return false; - } - function checkRegularExpressionLiteral(node) { - const nodeLinks2 = getNodeLinks(node); - if (!(nodeLinks2.flags & 1 /* TypeChecked */)) { - nodeLinks2.flags |= 1 /* TypeChecked */; - addLazyDiagnostic(() => checkGrammarRegularExpressionLiteral(node)); - } - return globalRegExpType; - } - function checkSpreadExpression(node, checkMode) { - if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) { - checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */); - } - const arrayOrIterableType = checkExpression(node.expression, checkMode); - return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); - } - function checkSyntheticExpression(node) { - return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; - } - function hasDefaultValue(node) { - return node.kind === 209 /* BindingElement */ && !!node.initializer || node.kind === 304 /* PropertyAssignment */ && hasDefaultValue(node.initializer) || node.kind === 305 /* ShorthandPropertyAssignment */ && !!node.objectAssignmentInitializer || node.kind === 227 /* 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; - const elementCount = elements.length; - const elementTypes = []; - const elementFlags = []; - pushCachedContextualType(node); - const inDestructuringPattern = isAssignmentTarget(node); - const inConstContext = isConstContext(node); - const contextualType = getApparentTypeOfContextualType( - node, - /*contextFlags*/ - void 0 - ); - 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 === 231 /* SpreadElement */) { - if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) { - checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */); - } - const spreadType = checkExpression(e.expression, checkMode, forceTuple); - if (isArrayLikeType(spreadType)) { - elementTypes.push(spreadType); - elementFlags.push(8 /* Variadic */); - } else if (inDestructuringPattern) { - const restElementType = getIndexTypeOfType(spreadType, numberType) || getIteratedTypeOrElementType( - 65 /* Destructuring */, - spreadType, - undefinedType, - /*errorNode*/ - void 0, - /*checkAssignability*/ - false - ) || unknownType; - elementTypes.push(restElementType); - elementFlags.push(4 /* Rest */); - } else { - elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression)); - elementFlags.push(4 /* Rest */); - } - } else if (exactOptionalPropertyTypes && e.kind === 233 /* OmittedExpression */) { - hasOmittedExpression = true; - elementTypes.push(undefinedOrMissingType); - elementFlags.push(2 /* Optional */); - } else { - const type = checkExpressionForMutableLocation(e, checkMode, forceTuple); - elementTypes.push(addOptionality( - type, - /*isProperty*/ - true, - hasOmittedExpression - )); - elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */); - if (inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(e)) { - const inferenceContext = getInferenceContext(node); - Debug.assert(inferenceContext); - addIntraExpressionInferenceSite(inferenceContext, e, type); - } - } - } - popContextualType(); - if (inDestructuringPattern) { - return createTupleType(elementTypes, elementFlags); - } - if (forceTuple || inConstContext || inTupleContext) { - return createArrayLiteralType(createTupleType( - elementTypes, - elementFlags, - /*readonly*/ - 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 - )); - } - function createArrayLiteralType(type) { - if (!(getObjectFlags(type) & 4 /* Reference */)) { - return type; - } - let literalType = type.literalType; - if (!literalType) { - literalType = type.literalType = cloneTypeReference(type); - literalType.objectFlags |= 16384 /* ArrayLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */; - } - return literalType; - } - function isNumericName(name) { - switch (name.kind) { - case 168 /* ComputedPropertyName */: - return isNumericComputedName(name); - case 80 /* Identifier */: - return isNumericLiteralName(name.escapedText); - case 9 /* NumericLiteral */: - case 11 /* StringLiteral */: - return isNumericLiteralName(name.text); - default: - return false; - } - } - function isNumericComputedName(name) { - return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */); - } - 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 !== 178 /* GetAccessor */ && node.parent.kind !== 179 /* SetAccessor */) { - return links.resolvedType = errorType; - } - links.resolvedType = checkExpression(node.expression); - if (isPropertyDeclaration(node.parent) && !hasStaticModifier(node.parent) && isClassExpression(node.parent.parent)) { - const container = getEnclosingBlockScopeContainer(node.parent.parent); - const enclosingIterationStatement = getEnclosingIterationStatement(container); - if (enclosingIterationStatement) { - getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */; - getNodeLinks(node).flags |= 32768 /* BlockScopedBindingInLoop */; - getNodeLinks(node.parent.parent).flags |= 32768 /* BlockScopedBindingInLoop */; - } - } - if (links.resolvedType.flags & 98304 /* Nullable */ || !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { - error2(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); - } - } - return links.resolvedType; - } - function isSymbolWithNumericName(symbol) { - var _a; - const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0]; - return isNumericLiteralName(symbol.escapedName) || firstDecl && isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name); - } - function isSymbolWithSymbolName(symbol) { - var _a; - const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0]; - return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */); - } - function isSymbolWithComputedName(symbol) { - var _a; - const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0]; - return firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name); - } - function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) { - var _a; - const propTypes = []; - let components; - for (let i = offset; i < properties.length; i++) { - const prop = properties[i]; - if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) { - propTypes.push(getTypeOfSymbol(properties[i])); - if (isSymbolWithComputedName(properties[i])) { - components = append(components, (_a = properties[i].declarations) == null ? void 0 : _a[0]); - } - } - } - const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; - return createIndexInfo( - keyType, - unionType, - isReadonly, - /*declaration*/ - void 0, - components - ); - } - function getImmediateAliasedSymbol(symbol) { - Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); - const links = getSymbolLinks(symbol); - if (!links.immediateTarget) { - const node = getDeclarationOfAliasSymbol(symbol); - if (!node) return Debug.fail(); - links.immediateTarget = getTargetOfAliasDeclaration( - node, - /*dontRecursivelyResolve*/ - true - ); - } - return links.immediateTarget; - } - function checkObjectLiteral(node, checkMode = 0 /* Normal */) { - const inDestructuringPattern = isAssignmentTarget(node); - checkGrammarObjectLiteralExpression(node, inDestructuringPattern); - const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0; - let propertiesTable = createSymbolTable(); - let propertiesArray = []; - let spread = emptyObjectType; - pushCachedContextualType(node); - const contextualType = getApparentTypeOfContextualType( - node, - /*contextFlags*/ - void 0 - ); - const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 207 /* ObjectBindingPattern */ || contextualType.pattern.kind === 211 /* ObjectLiteralExpression */); - const inConstContext = isConstContext(node); - const checkFlags = inConstContext ? 8 /* Readonly */ : 0; - const isInJavascript = isInJSFile(node) && !isInJsonFile(node); - const enumTag = isInJavascript ? getJSDocEnumTag(node) : void 0; - const isJSObjectLiteral = !contextualType && isInJavascript && !enumTag; - let objectFlags = 8192 /* FreshLiteral */; - let patternWithComputedProperties = false; - let hasComputedStringProperty = false; - let hasComputedNumberProperty = false; - let hasComputedSymbolProperty = false; - for (const elem of node.properties) { - if (elem.name && isComputedPropertyName(elem.name)) { - checkComputedPropertyName(elem.name); - } - } - let offset = 0; - for (const memberDecl of node.properties) { - let member = getSymbolOfDeclaration(memberDecl); - const computedNameType = memberDecl.name && memberDecl.name.kind === 168 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0; - if (memberDecl.kind === 304 /* PropertyAssignment */ || memberDecl.kind === 305 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) { - let type = memberDecl.kind === 304 /* 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 === 305 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) - ); - if (isInJavascript) { - const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); - if (jsDocType) { - checkTypeAssignableTo(type, jsDocType, memberDecl); - type = jsDocType; - } else if (enumTag && enumTag.typeExpression) { - checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl); - } - } - objectFlags |= getObjectFlags(type) & 458752 /* PropagatingFlags */; - const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0; - const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags); - if (nameType) { - prop.links.nameType = nameType; - } - if (inDestructuringPattern && hasDefaultValue(memberDecl)) { - prop.flags |= 16777216 /* Optional */; - } else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { - const impliedProp = getPropertyOfType(contextualType, member.escapedName); - if (impliedProp) { - prop.flags |= impliedProp.flags & 16777216 /* Optional */; - } else if (!getIndexInfoOfType(contextualType, stringType)) { - 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; - prop.parent = member.parent; - if (member.valueDeclaration) { - prop.valueDeclaration = member.valueDeclaration; - } - prop.links.type = type; - 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 === 304 /* PropertyAssignment */ || memberDecl.kind === 175 /* MethodDeclaration */) && isContextSensitive(memberDecl)) { - const inferenceContext = getInferenceContext(node); - Debug.assert(inferenceContext); - const inferenceNode = memberDecl.kind === 304 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl; - addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type); - } - } else if (memberDecl.kind === 306 /* SpreadAssignment */) { - if (languageVersion < LanguageFeatureMinimumTarget.ObjectAssign) { - checkExternalEmitHelpers(memberDecl, 2 /* Assign */); - } - if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext); - propertiesArray = []; - propertiesTable = createSymbolTable(); - hasComputedStringProperty = false; - hasComputedNumberProperty = false; - hasComputedSymbolProperty = false; - } - const type = getReducedType(checkExpression(memberDecl.expression, checkMode & 2 /* Inferential */)); - if (isValidSpreadType(type)) { - const mergedType = tryMergeUnionOfObjectTypeAndEmptyObject(type, inConstContext); - if (allPropertiesTable) { - checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl); - } - offset = propertiesArray.length; - if (isErrorType(spread)) { - continue; - } - spread = getSpreadType(spread, mergedType, node.symbol, objectFlags, inConstContext); - } else { - error2(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types); - spread = errorType; - } - continue; - } else { - Debug.assert(memberDecl.kind === 178 /* GetAccessor */ || memberDecl.kind === 179 /* SetAccessor */); - checkNodeDeferred(memberDecl); - } - if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { - if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) { - if (isTypeAssignableTo(computedNameType, numberType)) { - hasComputedNumberProperty = true; - } else if (isTypeAssignableTo(computedNameType, esSymbolType)) { - hasComputedSymbolProperty = true; - } else { - hasComputedStringProperty = true; - } - if (inDestructuringPattern) { - patternWithComputedProperties = true; - } - } - } else { - propertiesTable.set(member.escapedName, member); - } - propertiesArray.push(member); - } - popContextualType(); - if (isErrorType(spread)) { - return errorType; - } - if (spread !== emptyObjectType) { - if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext); - propertiesArray = []; - propertiesTable = createSymbolTable(); - hasComputedStringProperty = false; - hasComputedNumberProperty = false; - } - return mapType(spread, (t) => t === emptyObjectType ? createObjectLiteralType() : t); - } - return createObjectLiteralType(); - function createObjectLiteralType() { - const indexInfos = []; - const isReadonly = isConstContext(node); - if (hasComputedStringProperty) indexInfos.push(getObjectLiteralIndexInfo(isReadonly, offset, propertiesArray, stringType)); - if (hasComputedNumberProperty) indexInfos.push(getObjectLiteralIndexInfo(isReadonly, offset, propertiesArray, numberType)); - if (hasComputedSymbolProperty) indexInfos.push(getObjectLiteralIndexInfo(isReadonly, offset, propertiesArray, esSymbolType)); - const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos); - result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */; - if (isJSObjectLiteral) { - result.objectFlags |= 4096 /* JSLiteral */; - } - if (patternWithComputedProperties) { - result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; - } - if (inDestructuringPattern) { - result.pattern = node; - } - return result; - } - } - function isValidSpreadType(type) { - const t = removeDefinitelyFalsyTypes(mapType(type, getBaseConstraintOrType)); - return !!(t.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || t.flags & 3145728 /* UnionOrIntersection */ && every(t.types, isValidSpreadType)); - } - function checkJsxSelfClosingElementDeferred(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node); - } - function checkJsxSelfClosingElement(node, _checkMode) { - checkNodeDeferred(node); - return getJsxElementTypeAt(node) || anyType; - } - function checkJsxElementDeferred(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); - if (isJsxIntrinsicTagName(node.closingElement.tagName)) { - getIntrinsicTagSymbol(node.closingElement); - } else { - checkExpression(node.closingElement.tagName); - } - checkJsxChildren(node); - } - function checkJsxElement(node, _checkMode) { - checkNodeDeferred(node); - return getJsxElementTypeAt(node) || anyType; - } - function checkJsxFragment(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); - const nodeSourceFile = getSourceFileOfNode(node); - if (getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { - 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); - const jsxElementType = getJsxElementTypeAt(node); - return isErrorType(jsxElementType) ? anyType : jsxElementType; - } - function isHyphenatedJsxName(name) { - return name.includes("-"); - } - function isJsxIntrinsicTagName(tagName) { - return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName); - } - function checkJsxAttribute(node, checkMode) { - return node.initializer ? checkExpressionForMutableLocation(node.initializer, checkMode) : trueType; - } - function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode = 0 /* Normal */) { - const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0; - let attributesTable = createSymbolTable(); - let spread = emptyJsxObjectType; - let hasSpreadAnyType = false; - let typeToIntersect; - let explicitlySpecifyChildrenAttribute = false; - let objectFlags = 2048 /* JsxAttributes */; - const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement)); - const isJsxOpenFragment = isJsxOpeningFragment(openingLikeElement); - let attributesSymbol; - let attributeParent = openingLikeElement; - if (!isJsxOpenFragment) { - const attributes = openingLikeElement.attributes; - attributesSymbol = attributes.symbol; - attributeParent = attributes; - const contextualType = getContextualType2(attributes, 0 /* None */); - for (const attributeDecl of attributes.properties) { - const member = attributeDecl.symbol; - if (isJsxAttribute(attributeDecl)) { - const exprType = checkJsxAttribute(attributeDecl, checkMode); - objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */; - const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName); - attributeSymbol.declarations = member.declarations; - attributeSymbol.parent = member.parent; - if (member.valueDeclaration) { - attributeSymbol.valueDeclaration = member.valueDeclaration; - } - attributeSymbol.links.type = exprType; - attributeSymbol.links.target = member; - attributesTable.set(attributeSymbol.escapedName, attributeSymbol); - allAttributesTable == null ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol); - if (getEscapedTextOfJsxAttributeName(attributeDecl.name) === jsxChildrenPropertyName) { - explicitlySpecifyChildrenAttribute = true; - } - if (contextualType) { - const prop = getPropertyOfType(contextualType, member.escapedName); - if (prop && prop.declarations && isDeprecatedSymbol(prop) && isIdentifier(attributeDecl.name)) { - addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText); - } - } - if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) { - const inferenceContext = getInferenceContext(attributes); - Debug.assert(inferenceContext); - const inferenceNode = attributeDecl.initializer.expression; - addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType); - } - } else { - Debug.assert(attributeDecl.kind === 294 /* JsxSpreadAttribute */); - if (attributesTable.size > 0) { - spread = getSpreadType( - spread, - createJsxAttributesTypeHelper(), - attributes.symbol, - objectFlags, - /*readonly*/ - false - ); - attributesTable = createSymbolTable(); - } - const exprType = getReducedType(checkExpression(attributeDecl.expression, checkMode & 2 /* Inferential */)); - if (isTypeAny(exprType)) { - hasSpreadAnyType = true; - } - if (isValidSpreadType(exprType)) { - spread = getSpreadType( - spread, - exprType, - attributes.symbol, - objectFlags, - /*readonly*/ - false - ); - if (allAttributesTable) { - checkSpreadPropOverrides(exprType, allAttributesTable, attributeDecl); - } - } else { - error2(attributeDecl.expression, Diagnostics.Spread_types_may_only_be_created_from_object_types); - typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; - } - } - } - if (!hasSpreadAnyType) { - if (attributesTable.size > 0) { - spread = getSpreadType( - spread, - createJsxAttributesTypeHelper(), - attributes.symbol, - objectFlags, - /*readonly*/ - false - ); - } - } - } - const parent2 = openingLikeElement.parent; - if ((isJsxElement(parent2) && parent2.openingElement === openingLikeElement || isJsxFragment(parent2) && parent2.openingFragment === openingLikeElement) && getSemanticJsxChildren(parent2.children).length > 0) { - const childrenTypes = checkJsxChildren(parent2, checkMode); - if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { - if (explicitlySpecifyChildrenAttribute) { - error2(attributeParent, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName)); - } - const contextualType = isJsxOpeningElement(openingLikeElement) ? getApparentTypeOfContextualType( - openingLikeElement.attributes, - /*contextFlags*/ - void 0 - ) : void 0; - const childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); - const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName); - childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); - childrenPropSymbol.valueDeclaration = factory.createPropertySignature( - /*modifiers*/ - void 0, - unescapeLeadingUnderscores(jsxChildrenPropertyName), - /*questionToken*/ - void 0, - /*type*/ - void 0 - ); - setParent(childrenPropSymbol.valueDeclaration, attributeParent); - childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol; - const childPropMap = createSymbolTable(); - childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); - spread = getSpreadType( - spread, - createAnonymousType(attributesSymbol, childPropMap, emptyArray, emptyArray, emptyArray), - attributesSymbol, - objectFlags, - /*readonly*/ - false - ); - } - } - if (hasSpreadAnyType) { - return anyType; - } - if (typeToIntersect && spread !== emptyJsxObjectType) { - return getIntersectionType([typeToIntersect, spread]); - } - return typeToIntersect || (spread === emptyJsxObjectType ? createJsxAttributesTypeHelper() : spread); - function createJsxAttributesTypeHelper() { - objectFlags |= 8192 /* FreshLiteral */; - return createJsxAttributesType(objectFlags, attributesSymbol, attributesTable); - } - } - function createJsxAttributesType(objectFlags, attributesSymbol, attributesTable) { - const result = createAnonymousType(attributesSymbol, attributesTable, emptyArray, emptyArray, emptyArray); - result.objectFlags |= objectFlags | 8192 /* FreshLiteral */ | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */; - return result; - } - function checkJsxChildren(node, checkMode) { - const childrenTypes = []; - for (const child of node.children) { - if (child.kind === 12 /* JsxText */) { - if (!child.containsOnlyTriviaWhiteSpaces) { - childrenTypes.push(stringType); - } - } else if (child.kind === 295 /* JsxExpression */ && !child.expression) { - continue; - } else { - childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); - } - } - return childrenTypes; - } - function checkSpreadPropOverrides(type, props, spread) { - for (const right of getPropertiesOfType(type)) { - if (!(right.flags & 16777216 /* Optional */)) { - const left = props.get(right.escapedName); - if (left) { - 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)); - } - } - } - } - function checkJsxAttributes(node, checkMode) { - return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); - } - function getJsxType(name, location) { - const namespace = getJsxNamespaceAt(location); - const exports2 = namespace && getExportsOfSymbol(namespace); - const typeSymbol = exports2 && getSymbol2(exports2, name, 788968 /* Type */); - return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType; - } - function getIntrinsicTagSymbol(node) { - const links = getNodeLinks(node); - if (!links.resolvedSymbol) { - const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node); - if (!isErrorType(intrinsicElementsType)) { - if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName)) return Debug.fail(); - 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 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; - } - error2(node, Diagnostics.Property_0_does_not_exist_on_type_1, intrinsicTagNameToString(node.tagName), "JSX." + JsxNames.IntrinsicElements); - return links.resolvedSymbol = unknownSymbol; - } else { - if (noImplicitAny) { - error2(node, Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, unescapeLeadingUnderscores(JsxNames.IntrinsicElements)); - } - return links.resolvedSymbol = unknownSymbol; - } - } - return links.resolvedSymbol; - } - function getJsxNamespaceContainerForImplicitImport(location) { - const file = location && getSourceFileOfNode(location); - const links = file && getNodeLinks(file); - if (links && links.jsxImplicitImportContainer === false) { - return void 0; - } - if (links && links.jsxImplicitImportContainer) { - return links.jsxImplicitImportContainer; - } - const runtimeImportSpecifier = getJSXRuntimeImport(getJSXImplicitImportBase(compilerOptions, file), compilerOptions); - if (!runtimeImportSpecifier) { - return void 0; - } - 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.This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed; - const specifier = getJSXRuntimeImportSpecifier(file, runtimeImportSpecifier); - const mod = resolveExternalModule(specifier || location, runtimeImportSpecifier, errorMessage, location); - const result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : void 0; - if (links) { - links.jsxImplicitImportContainer = result || false; - } - return result; - } - function getJsxNamespaceAt(location) { - const links = location && getNodeLinks(location); - if (links && links.jsxNamespace) { - return links.jsxNamespace; - } - if (!links || links.jsxNamespace !== false) { - let resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); - if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - const namespaceName = getJsxNamespace(location); - resolvedNamespace = resolveName( - location, - namespaceName, - 1920 /* Namespace */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - } - if (resolvedNamespace) { - const candidate = resolveSymbol(getSymbol2(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); - if (candidate && candidate !== unknownSymbol) { - if (links) { - links.jsxNamespace = candidate; - } - return candidate; - } - } - if (links) { - links.jsxNamespace = false; - } - } - const s = resolveSymbol(getGlobalSymbol( - JsxNames.JSX, - 1920 /* Namespace */, - /*diagnostic*/ - void 0 - )); - if (s === unknownSymbol) { - return void 0; - } - return s; - } - function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer, jsxNamespace) { - const jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol2(jsxNamespace.exports, nameOfAttribPropContainer, 788968 /* Type */); - const jsxElementAttribPropInterfaceType = jsxElementAttribPropInterfaceSym && getDeclaredTypeOfSymbol(jsxElementAttribPropInterfaceSym); - const propertiesOfJsxElementAttribPropInterface = jsxElementAttribPropInterfaceType && getPropertiesOfType(jsxElementAttribPropInterfaceType); - if (propertiesOfJsxElementAttribPropInterface) { - if (propertiesOfJsxElementAttribPropInterface.length === 0) { - return ""; - } else if (propertiesOfJsxElementAttribPropInterface.length === 1) { - return propertiesOfJsxElementAttribPropInterface[0].escapedName; - } else if (propertiesOfJsxElementAttribPropInterface.length > 1 && jsxElementAttribPropInterfaceSym.declarations) { - error2(jsxElementAttribPropInterfaceSym.declarations[0], Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, unescapeLeadingUnderscores(nameOfAttribPropContainer)); - } - } - return void 0; - } - function getJsxLibraryManagedAttributes(jsxNamespace) { - return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.LibraryManagedAttributes, 788968 /* Type */); - } - function getJsxElementTypeSymbol(jsxNamespace) { - return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.ElementType, 788968 /* Type */); - } - function getJsxElementPropertiesName(jsxNamespace) { - return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace); - } - function getJsxElementChildrenPropertyName(jsxNamespace) { - if (compilerOptions.jsx === 4 /* ReactJSX */ || compilerOptions.jsx === 5 /* ReactJSXDev */) { - return "children"; - } - return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); - } - function getUninstantiatedJsxSignaturesOfType(elementType, caller) { - if (elementType.flags & 4 /* String */) { - return [anySignature]; - } else if (elementType.flags & 128 /* StringLiteral */) { - const intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); - if (!intrinsicType) { - error2(caller, Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); - return emptyArray; - } else { - const fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); - return [fakeSignature]; - } - } - const apparentElemType = getApparentType(elementType); - let signatures = getSignaturesOfType(apparentElemType, 1 /* Construct */); - if (signatures.length === 0) { - signatures = getSignaturesOfType(apparentElemType, 0 /* Call */); - } - if (signatures.length === 0 && apparentElemType.flags & 1048576 /* Union */) { - signatures = getUnionSignatures(map(apparentElemType.types, (t) => getUninstantiatedJsxSignaturesOfType(t, caller))); - } - return signatures; - } - function getIntrinsicAttributesTypeFromStringLiteralType(type, location) { - const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location); - if (!isErrorType(intrinsicElementsType)) { - const stringLiteralTypeName = type.value; - const intrinsicProp = getPropertyOfType(intrinsicElementsType, escapeLeadingUnderscores(stringLiteralTypeName)); - if (intrinsicProp) { - return getTypeOfSymbol(intrinsicProp); - } - const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType); - if (indexSignatureType) { - return indexSignatureType; - } - return void 0; - } - return anyType; - } - function checkJsxReturnAssignableToAppropriateBound(refKind, elemInstanceType, openingLikeElement) { - if (refKind === 1 /* Function */) { - const sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement); - if (sfcReturnConstraint) { - checkTypeRelatedTo(elemInstanceType, sfcReturnConstraint, assignableRelation, openingLikeElement.tagName, Diagnostics.Its_return_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); - } - } else if (refKind === 0 /* Component */) { - const classConstraint = getJsxElementClassTypeAt(openingLikeElement); - if (classConstraint) { - checkTypeRelatedTo(elemInstanceType, classConstraint, assignableRelation, openingLikeElement.tagName, Diagnostics.Its_instance_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); - } - } else { - const sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement); - const classConstraint = getJsxElementClassTypeAt(openingLikeElement); - if (!sfcReturnConstraint || !classConstraint) { - return; - } - const combined = getUnionType([sfcReturnConstraint, classConstraint]); - checkTypeRelatedTo(elemInstanceType, combined, assignableRelation, openingLikeElement.tagName, Diagnostics.Its_element_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); - } - function generateInitialErrorChain() { - const componentName = getTextOfNode(openingLikeElement.tagName); - return chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics._0_cannot_be_used_as_a_JSX_component, - componentName - ); - } - } - function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { - var _a; - Debug.assert(isJsxIntrinsicTagName(node.tagName)); - const links = getNodeLinks(node); - if (!links.resolvedJsxElementAttributesType) { - const symbol = getIntrinsicTagSymbol(node); - if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { - return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType; - } else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { - 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; - } - } - return links.resolvedJsxElementAttributesType; - } - function getJsxElementClassTypeAt(location) { - const type = getJsxType(JsxNames.ElementClass, location); - if (isErrorType(type)) return void 0; - return type; - } - function getJsxElementTypeAt(location) { - return getJsxType(JsxNames.Element, location); - } - function getJsxStatelessElementTypeAt(location) { - const jsxElementType = getJsxElementTypeAt(location); - if (jsxElementType) { - return getUnionType([jsxElementType, nullType]); - } - } - function getJsxElementTypeTypeAt(location) { - const ns = getJsxNamespaceAt(location); - if (!ns) return void 0; - const sym = getJsxElementTypeSymbol(ns); - if (!sym) return void 0; - const type = instantiateAliasOrInterfaceWithDefaults(sym, isInJSFile(location)); - if (!type || isErrorType(type)) return void 0; - return type; - } - function instantiateAliasOrInterfaceWithDefaults(managedSym, inJs, ...typeArguments) { - const declaredManagedType = getDeclaredTypeOfSymbol(managedSym); - if (managedSym.flags & 524288 /* TypeAlias */) { - const params = getSymbolLinks(managedSym).typeParameters; - if (length(params) >= typeArguments.length) { - const args = fillMissingTypeArguments(typeArguments, params, typeArguments.length, inJs); - return length(args) === 0 ? declaredManagedType : getTypeAliasInstantiation(managedSym, args); - } - } - if (length(declaredManagedType.typeParameters) >= typeArguments.length) { - const args = fillMissingTypeArguments(typeArguments, declaredManagedType.typeParameters, typeArguments.length, inJs); - return createTypeReference(declaredManagedType, args); - } - return void 0; - } - function getJsxIntrinsicTagNamesAt(location) { - const intrinsics = getJsxType(JsxNames.IntrinsicElements, location); - return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; - } - function checkJsxPreconditions(errorNode) { - if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) { - error2(errorNode, Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); - } - if (getJsxElementTypeAt(errorNode) === void 0) { - if (noImplicitAny) { - error2(errorNode, Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); - } - } - } - function checkJsxOpeningLikeElementOrOpeningFragment(node) { - const isNodeOpeningLikeElement = isJsxOpeningLikeElement(node); - if (isNodeOpeningLikeElement) { - checkGrammarJsxElement(node); - } - checkJsxPreconditions(node); - markJsxAliasReferenced(node); - const sig = getResolvedSignature(node); - checkDeprecatedSignature(sig, node); - if (isNodeOpeningLikeElement) { - const jsxOpeningLikeNode = node; - const elementTypeConstraint = getJsxElementTypeTypeAt(jsxOpeningLikeNode); - if (elementTypeConstraint !== void 0) { - const tagName = jsxOpeningLikeNode.tagName; - const tagType = isJsxIntrinsicTagName(tagName) ? getStringLiteralType(intrinsicTagNameToString(tagName)) : checkExpression(tagName); - checkTypeRelatedTo(tagType, elementTypeConstraint, assignableRelation, tagName, Diagnostics.Its_type_0_is_not_a_valid_JSX_element_type, () => { - const componentName = getTextOfNode(tagName); - return chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics._0_cannot_be_used_as_a_JSX_component, - componentName - ); - }); - } else { - checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(jsxOpeningLikeNode), getReturnTypeOfSignature(sig), jsxOpeningLikeNode); - } - } - } - function isKnownProperty(targetType, name, isComparingJsxAttributes) { - if (targetType.flags & 524288 /* Object */) { - if (getPropertyOfObjectType(targetType, name) || getApplicableIndexInfoForName(targetType, name) || isLateBoundName(name) && getIndexInfoOfType(targetType, stringType) || isComparingJsxAttributes && isHyphenatedJsxName(name)) { - return true; - } - } - if (targetType.flags & 33554432 /* Substitution */) { - return isKnownProperty(targetType.baseType, name, isComparingJsxAttributes); - } - if (targetType.flags & 3145728 /* UnionOrIntersection */ && isExcessPropertyCheckTarget(targetType)) { - for (const t of targetType.types) { - if (isKnownProperty(t, name, isComparingJsxAttributes)) { - return true; - } - } - } - return false; - } - function isExcessPropertyCheckTarget(type) { - return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) & 512 /* ObjectLiteralPatternWithComputedProperties */) || type.flags & 67108864 /* NonPrimitive */ || type.flags & 33554432 /* Substitution */ && isExcessPropertyCheckTarget(type.baseType) || type.flags & 1048576 /* Union */ && some(type.types, isExcessPropertyCheckTarget) || type.flags & 2097152 /* Intersection */ && every(type.types, isExcessPropertyCheckTarget)); - } - function checkJsxExpression(node, checkMode) { - checkGrammarJsxExpression(node); - if (node.expression) { - const type = checkExpression(node.expression, checkMode); - if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { - error2(node, Diagnostics.JSX_spread_child_must_be_an_array_type); - } - return type; - } else { - return errorType; - } - } - function getDeclarationNodeFlagsFromSymbol(s) { - return s.valueDeclaration ? getCombinedNodeFlagsCached(s.valueDeclaration) : 0; - } - function isPrototypeProperty(symbol) { - if (symbol.flags & 8192 /* Method */ || getCheckFlags(symbol) & 4 /* SyntheticMethod */) { - return true; - } - if (isInJSFile(symbol.valueDeclaration)) { - const parent2 = symbol.valueDeclaration.parent; - return parent2 && isBinaryExpression(parent2) && getAssignmentDeclarationKind(parent2) === 3 /* PrototypeProperty */; - } - } - function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) { - const errorNode = !reportError ? void 0 : node.kind === 167 /* QualifiedName */ ? node.right : node.kind === 206 /* ImportType */ ? node : node.kind === 209 /* 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) { - error2(errorNode, Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - } - return false; - } - } - if (flags & 64 /* Abstract */) { - if (errorNode) { - 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 & 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) { - error2(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)); - } - return false; - } - } - if (!(flags & 6 /* NonPublicAccessibilityModifier */)) { - return true; - } - if (flags & 2 /* Private */) { - const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); - if (!isNodeWithinClass(location, declaringClassDeclaration)) { - if (errorNode) { - error2(errorNode, Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); - } - return false; - } - return true; - } - if (isSuper) { - return true; - } - let enclosingClass = forEachEnclosingClass(location, (enclosingDeclaration) => { - const enclosingClass2 = getDeclaredTypeOfSymbol(getSymbolOfDeclaration(enclosingDeclaration)); - return isClassDerivedFromDeclaringClasses(enclosingClass2, prop, writing); - }); - if (!enclosingClass) { - enclosingClass = getEnclosingClassFromThisParameter(location); - enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing); - if (flags & 256 /* Static */ || !enclosingClass) { - if (errorNode) { - 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 & 256 /* Static */) { - return true; - } - if (containingType.flags & 262144 /* TypeParameter */) { - containingType = containingType.isThisType ? getConstraintOfTypeParameter(containingType) : getBaseConstraintOfType(containingType); - } - if (!containingType || !hasBaseType(containingType, enclosingClass)) { - if (errorNode) { - 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; - } - return true; - } - function getEnclosingClassFromThisParameter(node) { - const thisParameter = getThisParameterFromNodeContext(node); - let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type); - if (thisType) { - if (thisType.flags & 262144 /* TypeParameter */) { - thisType = getConstraintOfTypeParameter(thisType); - } - } else { - const thisContainer = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (isFunctionLike(thisContainer)) { - thisType = getContextualThisParameterType(thisContainer); - } - } - if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) { - return getTargetType(thisType); - } - return void 0; - } - function getThisParameterFromNodeContext(node) { - const thisContainer = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - return thisContainer && isFunctionLike(thisContainer) ? getThisParameter(thisContainer) : void 0; - } - function symbolHasNonMethodDeclaration(symbol) { - return !!forEachProperty2(symbol, (prop) => !(prop.flags & 8192 /* Method */)); - } - function checkNonNullExpression(node) { - return checkNonNullType(checkExpression(node), node); - } - function isNullableType(type) { - return hasTypeFacts(type, 50331648 /* IsUndefinedOrNull */); - } - function getNonNullableTypeIfNeeded(type) { - return isNullableType(type) ? getNonNullableType(type) : type; - } - function reportObjectPossiblyNullOrUndefinedError(node, facts) { - const nodeText2 = isEntityNameExpression(node) ? entityNameToString(node) : void 0; - if (node.kind === 106 /* NullKeyword */) { - error2(node, Diagnostics.The_value_0_cannot_be_used_here, "null"); - return; - } - if (nodeText2 !== void 0 && nodeText2.length < 100) { - if (isIdentifier(node) && nodeText2 === "undefined") { - error2(node, Diagnostics.The_value_0_cannot_be_used_here, "undefined"); - return; - } - 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 { - 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) { - 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 - ); - } - function checkNonNullTypeWithReporter(type, node, reportError) { - if (strictNullChecks && type.flags & 2 /* Unknown */) { - if (isEntityNameExpression(node)) { - const nodeText2 = entityNameToString(node); - if (nodeText2.length < 100) { - error2(node, Diagnostics._0_is_of_type_unknown, nodeText2); - return errorType; - } - } - error2(node, Diagnostics.Object_is_of_type_unknown); - return errorType; - } - const facts = getTypeFacts(type, 50331648 /* IsUndefinedOrNull */); - if (facts & 50331648 /* IsUndefinedOrNull */) { - reportError(node, facts); - const t = getNonNullableType(type); - return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t; - } - return type; - } - function checkNonNullType(type, node) { - return checkNonNullTypeWithReporter(type, node, reportObjectPossiblyNullOrUndefinedError); - } - function checkNonNullNonVoidType(type, node) { - const nonNullType = checkNonNullType(type, node); - if (nonNullType.flags & 16384 /* Void */) { - if (isEntityNameExpression(node)) { - const nodeText2 = entityNameToString(node); - if (isIdentifier(node) && nodeText2 === "undefined") { - error2(node, Diagnostics.The_value_0_cannot_be_used_here, nodeText2); - return nonNullType; - } - if (nodeText2.length < 100) { - error2(node, Diagnostics._0_is_possibly_undefined, nodeText2); - return nonNullType; - } - } - error2(node, Diagnostics.Object_is_possibly_undefined); - } - return nonNullType; - } - function checkPropertyAccessExpression(node, 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); - const nonOptionalType = getOptionalExpressionType(leftType, node.expression); - return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name, checkMode), node, nonOptionalType !== leftType); - } - function checkQualifiedName(node, checkMode) { - const leftType = isPartOfTypeQuery(node) && isThisIdentifier(node.left) ? checkNonNullType(checkThisExpression(node.left), node.left) : checkNonNullExpression(node.left); - return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode); - } - function isMethodAccessForCall(node) { - while (node.parent.kind === 218 /* ParenthesizedExpression */) { - node = node.parent; - } - return isCallOrNewExpression(node.parent) && node.parent.expression === node; - } - function lookupSymbolForPrivateIdentifierDeclaration(propName, location) { - 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); - if (prop) { - return prop; - } - } - } - function checkGrammarPrivateIdentifierExpression(privId) { - if (!getContainingClass(privId)) { - return grammarErrorOnNode(privId, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - } - if (!isForInStatement(privId.parent)) { - if (!isExpressionNode(privId)) { - return grammarErrorOnNode(privId, 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); - } - const isInOperation = isBinaryExpression(privId.parent) && privId.parent.operatorToken.kind === 103 /* InKeyword */; - if (!getSymbolForPrivateIdentifierExpression(privId) && !isInOperation) { - return grammarErrorOnNode(privId, Diagnostics.Cannot_find_name_0, idText(privId)); - } - } - return false; - } - function checkPrivateIdentifierExpression(privId) { - checkGrammarPrivateIdentifierExpression(privId); - const symbol = getSymbolForPrivateIdentifierExpression(privId); - if (symbol) { - markPropertyAsReferenced( - symbol, - /*nodeForCheckWriteOnly*/ - void 0, - /*isSelfTypeAccess*/ - false - ); - } - return anyType; - } - function getSymbolForPrivateIdentifierExpression(privId) { - if (!isExpressionNode(privId)) { - return void 0; - } - const links = getNodeLinks(privId); - if (links.resolvedSymbol === void 0) { - links.resolvedSymbol = lookupSymbolForPrivateIdentifierDeclaration(privId.escapedText, privId); - } - return links.resolvedSymbol; - } - function getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) { - return getPropertyOfType(leftType, lexicallyScopedIdentifier.escapedName); - } - function checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedIdentifier) { - let propertyOnType; - const properties = getPropertiesOfType(leftType); - if (properties) { - forEach(properties, (symbol) => { - const decl = symbol.valueDeclaration; - if (decl && isNamedDeclaration(decl) && isPrivateIdentifier(decl.name) && decl.name.escapedText === right.escapedText) { - propertyOnType = symbol; - return true; - } - }); - } - const diagName = diagnosticName(right); - if (propertyOnType) { - const typeValueDecl = Debug.checkDefined(propertyOnType.valueDeclaration); - const typeClass = Debug.checkDefined(getContainingClass(typeValueDecl)); - if (lexicallyScopedIdentifier == null ? void 0 : lexicallyScopedIdentifier.valueDeclaration) { - const lexicalValueDecl = lexicallyScopedIdentifier.valueDeclaration; - const lexicalClass = getContainingClass(lexicalValueDecl); - Debug.assert(!!lexicalClass); - if (findAncestor(lexicalClass, (n) => typeClass === n)) { - 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, - typeToString(leftType) - ); - addRelatedInfo( - diagnostic, - createDiagnosticForNode( - lexicalValueDecl, - Diagnostics.The_shadowing_declaration_of_0_is_defined_here, - diagName - ), - createDiagnosticForNode( - typeValueDecl, - Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here, - diagName - ) - ); - return true; - } - } - error2( - right, - Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier, - diagName, - diagnosticName(typeClass.name || anon) - ); - return true; - } - return false; - } - function isThisPropertyAccessInConstructor(node, prop) { - return (isConstructorDeclaredProperty(prop) || isThisProperty(node) && isAutoTypedProperty(prop)) && getThisContainer( - node, - /*includeArrowFunctions*/ - true, - /*includeClassComputedPropertyName*/ - false - ) === getDeclaringConstructor(prop); - } - function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode, writeOnly) { - const parentSymbol = getNodeLinks(left).resolvedSymbol; - const assignmentKind = getAssignmentTargetKind(node); - const apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); - const isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType; - let prop; - if (isPrivateIdentifier(right)) { - if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) { - if (assignmentKind !== 0 /* None */) { - checkExternalEmitHelpers(node, 1048576 /* ClassPrivateFieldSet */); - } - if (assignmentKind !== 1 /* Definite */) { - checkExternalEmitHelpers(node, 524288 /* ClassPrivateFieldGet */); - } - } - const lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(right.escapedText, right); - if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) { - grammarErrorOnNode(right, Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, idText(right)); - } - if (isAnyLike) { - if (lexicallyScopedSymbol) { - return isErrorType(apparentType) ? errorType : apparentType; - } - if (getContainingClassExcludingClassDecorators(right) === void 0) { - grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - return anyType; - } - } - 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.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); - if (isSetonlyAccessor && assignmentKind !== 1 /* Definite */) { - error2(node, Diagnostics.Private_accessor_was_defined_without_a_getter); - } - } - } else { - if (isAnyLike) { - if (isIdentifier(left) && parentSymbol) { - markLinkedReferences( - node, - 2 /* Property */, - /*propSymbol*/ - void 0, - leftType - ); - } - return isErrorType(apparentType) ? errorType : apparentType; - } - prop = getPropertyOfType( - apparentType, - right.escapedText, - /*skipObjectFunctionPropertyAugment*/ - isConstEnumObjectType(apparentType), - /*includeTypeOnlyMembers*/ - node.kind === 167 /* QualifiedName */ - ); - } - markLinkedReferences(node, 2 /* Property */, prop, leftType); - let propType; - if (!prop) { - const indexInfo = !isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || isThisTypeParameter(leftType)) ? getApplicableIndexInfoForName(apparentType, right.escapedText) : void 0; - if (!(indexInfo && indexInfo.type)) { - const isUncheckedJS = isUncheckedJSSuggestion( - node, - leftType.symbol, - /*excludeClasses*/ - true - ); - if (!isUncheckedJS && isJSLiteralType(leftType)) { - return anyType; - } - if (leftType.symbol === globalThisSymbol) { - if (globalThisSymbol.exports.has(right.escapedText) && globalThisSymbol.exports.get(right.escapedText).flags & 418 /* BlockScoped */) { - error2(right, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(right.escapedText), typeToString(leftType)); - } else if (noImplicitAny) { - error2(right, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType)); - } - return anyType; - } - if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { - reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS); - } - return errorType; - } - if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) { - error2(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); - } - propType = indexInfo.type; - if (compilerOptions.noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) { - propType = getUnionType([propType, missingType]); - } - if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) { - error2(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText)); - } - if (indexInfo.declaration && isDeprecatedDeclaration2(indexInfo.declaration)) { - addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText); - } - } else { - const targetPropSymbol = resolveAliasWithDeprecationCheck(prop, right); - if (isDeprecatedSymbol(targetPropSymbol) && isUncalledFunctionReference(node, targetPropSymbol) && targetPropSymbol.declarations) { - addDeprecatedSuggestion(right, targetPropSymbol.declarations, right.escapedText); - } - checkPropertyNotUsedBeforeDeclaration(prop, node, right); - markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol)); - getNodeLinks(node).resolvedSymbol = prop; - checkPropertyAccessibility(node, left.kind === 108 /* SuperKeyword */, isWriteAccess(node), apparentType, prop); - if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) { - 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); - } - 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); - 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; - } - function getFlowTypeOfAccessExpression(node, prop, propType, errorNode, checkMode) { - const assignmentKind = getAssignmentTargetKind(node); - if (assignmentKind === 1 /* Definite */) { - return removeMissingType(propType, !!(prop && prop.flags & 16777216 /* Optional */)); - } - if (prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */) && !isDuplicatedCommonJSExport(prop.declarations)) { - return propType; - } - if (propType === autoType) { - return getFlowTypeOfProperty(node, prop); - } - propType = getNarrowableTypeForReference(propType, node, checkMode); - let assumeUninitialized = false; - if (strictNullChecks && strictPropertyInitialization && isAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */) { - const declaration = prop && prop.valueDeclaration; - if (declaration && isPropertyWithoutInitializer(declaration)) { - if (!isStatic(declaration)) { - const flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 177 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 33554432 /* Ambient */)) { - assumeUninitialized = true; - } - } - } - } else if (strictNullChecks && prop && prop.valueDeclaration && isPropertyAccessExpression(prop.valueDeclaration) && getAssignmentDeclarationPropertyAccessKind(prop.valueDeclaration) && getControlFlowContainer(node) === getControlFlowContainer(prop.valueDeclaration)) { - assumeUninitialized = true; - } - const flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType); - if (assumeUninitialized && !containsUndefinedType(propType) && containsUndefinedType(flowType)) { - error2(errorNode, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); - return propType; - } - return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; - } - function checkPropertyNotUsedBeforeDeclaration(prop, node, right) { - const { valueDeclaration } = prop; - if (!valueDeclaration || getSourceFileOfNode(node).isDeclarationFile) { - return; - } - let diagnosticMessage; - const declarationName = idText(right); - 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 === 264 /* ClassDeclaration */ && node.parent.kind !== 184 /* 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)); - } - } - function isInPropertyInitializerOrClassStaticBlock(node, ignoreArrowFunctions) { - return !!findAncestor(node, (node2) => { - switch (node2.kind) { - case 173 /* PropertyDeclaration */: - case 176 /* ClassStaticBlockDeclaration */: - return true; - case 187 /* TypeQuery */: - case 288 /* JsxClosingElement */: - return "quit"; - case 220 /* ArrowFunction */: - return ignoreArrowFunctions ? false : "quit"; - case 242 /* Block */: - return isFunctionLikeDeclaration(node2.parent) && node2.parent.kind !== 220 /* ArrowFunction */ ? "quit" : false; - default: - return false; - } - }); - } - function isPropertyDeclaredInAncestorClass(prop) { - if (!(prop.parent.flags & 32 /* Class */)) { - return false; - } - let classType = getTypeOfSymbol(prop.parent); - while (true) { - classType = classType.symbol && getSuperClass(classType); - if (!classType) { - return false; - } - const superProperty = getPropertyOfType(classType, prop.escapedName); - if (superProperty && superProperty.valueDeclaration) { - return true; - } - } - } - function getSuperClass(classType) { - const x = getBaseTypes(classType); - if (x.length === 0) { - return void 0; - } - return getIntersectionType(x); - } - function reportNonexistentProperty(propNode, containingType, isUncheckedJS) { - const links = getNodeLinks(propNode); - const cache = links.nonExistentPropCheckCache || (links.nonExistentPropCheckCache = /* @__PURE__ */ new Set()); - const key = `${getTypeId(containingType)}|${isUncheckedJS}`; - if (cache.has(key)) { - return; - } - cache.add(key); - let errorInfo; - let relatedInfo; - if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 402784252 /* Primitive */)) { - for (const subtype of containingType.types) { - if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) { - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype)); - break; - } - } - } - if (typeHasStaticProperty(propNode.escapedText, containingType)) { - const propName = declarationNameToString(propNode); - const typeName = typeToString(containingType); - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName, typeName, typeName + "." + propName); - } else { - const promisedType = getPromisedTypeOfPromise(containingType); - if (promisedType && getPropertyOfType(promisedType, propNode.escapedText)) { - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType)); - relatedInfo = createDiagnosticForNode(propNode, Diagnostics.Did_you_forget_to_use_await); - } else { - const missingProperty = declarationNameToString(propNode); - const container = typeToString(containingType); - const libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); - if (libSuggestion !== void 0) { - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); - } else { - const suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); - if (suggestion !== void 0) { - const suggestedName = symbolName(suggestion); - const message = isUncheckedJS ? Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2; - errorInfo = chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName); - relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestedName); - } else { - const diagnostic = containerSeemsToBeEmptyDomElement(containingType) ? Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom : Diagnostics.Property_0_does_not_exist_on_type_1; - errorInfo = chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), diagnostic, missingProperty, container); - } - } - } - } - const resultDiagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(propNode), propNode, errorInfo); - if (relatedInfo) { - addRelatedInfo(resultDiagnostic, relatedInfo); - } - addErrorOrSuggestion(!isUncheckedJS || errorInfo.code !== Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, resultDiagnostic); - } - function containerSeemsToBeEmptyDomElement(containingType) { - return compilerOptions.lib && !compilerOptions.lib.includes("lib.dom.d.ts") && everyContainedType(containingType, (type) => type.symbol && /^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(unescapeLeadingUnderscores(type.symbol.escapedName))) && isEmptyObjectType(containingType); - } - function typeHasStaticProperty(propName, containingType) { - const prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); - return prop !== void 0 && !!prop.valueDeclaration && isStatic(prop.valueDeclaration); - } - function getSuggestedLibForNonExistentName(name) { - const missingName = diagnosticName(name); - const allFeatures = getScriptTargetFeatures(); - const typeFeatures = allFeatures.get(missingName); - return typeFeatures && firstIterator(typeFeatures.keys()); - } - function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { - const container = getApparentType(containingType).symbol; - if (!container) { - return void 0; - } - const containingTypeName = symbolName(container); - const allFeatures = getScriptTargetFeatures(); - const typeFeatures = allFeatures.get(containingTypeName); - if (typeFeatures) { - for (const [libTarget, featuresOfType] of typeFeatures) { - if (contains(featuresOfType, missingProperty)) { - return libTarget; - } - } - } - } - function getSuggestedSymbolForNonexistentClassMember(name, baseType) { - return getSpellingSuggestionForName(name, getPropertiesOfType(baseType), 106500 /* ClassMember */); - } - function getSuggestedSymbolForNonexistentProperty(name, containingType) { - let props = getPropertiesOfType(containingType); - if (typeof name !== "string") { - const parent2 = name.parent; - if (isPropertyAccessExpression(parent2)) { - props = filter(props, (prop) => isValidPropertyAccessForCompletions(parent2, containingType, prop)); - } - name = idText(name); - } - return getSpellingSuggestionForName(name, props, 111551 /* Value */); - } - function getSuggestedSymbolForNonexistentJSXAttribute(name, containingType) { - const strName = isString(name) ? name : idText(name); - const properties = getPropertiesOfType(containingType); - const jsxSpecific = strName === "for" ? find(properties, (x) => symbolName(x) === "htmlFor") : strName === "class" ? find(properties, (x) => symbolName(x) === "className") : void 0; - return jsxSpecific ?? getSpellingSuggestionForName(strName, properties, 111551 /* Value */); - } - function getSuggestionForNonexistentProperty(name, containingType) { - const suggestion = getSuggestedSymbolForNonexistentProperty(name, containingType); - return suggestion && symbolName(suggestion); - } - function getSuggestionForSymbolNameLookup(symbols, name, meaning) { - const symbol = getSymbol2(symbols, name, meaning); - if (symbol) return symbol; - let candidates; - if (symbols === globals) { - const primitives = mapDefined( - ["string", "number", "boolean", "object", "bigint", "symbol"], - (s) => symbols.has(s.charAt(0).toUpperCase() + s.slice(1)) ? createSymbol(524288 /* TypeAlias */, s) : void 0 - ); - candidates = primitives.concat(arrayFrom(symbols.values())); - } else { - candidates = arrayFrom(symbols.values()); - } - return getSpellingSuggestionForName(unescapeLeadingUnderscores(name), candidates, meaning); - } - function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { - Debug.assert(outerName !== void 0, "outername should always be defined"); - const result = resolveNameForSymbolSuggestion( - location, - outerName, - meaning, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false, - /*excludeGlobals*/ - false - ); - return result; - } - function getSuggestedSymbolForNonexistentModule(name, targetModule) { - return targetModule.exports && getSpellingSuggestionForName(idText(name), getExportsOfModuleAsArray(targetModule), 2623475 /* ModuleMember */); - } - function getSuggestionForNonexistentIndexSignature(objectType, expr, keyedType) { - function hasProp(name) { - const prop = getPropertyOfObjectType(objectType, name); - if (prop) { - const s = getSingleCallSignature(getTypeOfSymbol(prop)); - return !!s && getMinArgumentCount(s) >= 1 && isTypeAssignableTo(keyedType, getTypeAtPosition(s, 0)); - } - return false; - } - const suggestedMethod = isAssignmentTarget(expr) ? "set" : "get"; - if (!hasProp(suggestedMethod)) { - return void 0; - } - let suggestion = tryGetPropertyAccessOrIdentifierToString(expr.expression); - if (suggestion === void 0) { - suggestion = suggestedMethod; - } else { - suggestion += "." + suggestedMethod; - } - return suggestion; - } - function getSuggestedTypeForNonexistentStringLiteralType(source, target) { - const candidates = target.types.filter((type) => !!(type.flags & 128 /* StringLiteral */)); - return getSpellingSuggestion(source.value, candidates, (type) => type.value); - } - function getSpellingSuggestionForName(name, symbols, meaning) { - return getSpellingSuggestion(name, symbols, getCandidateName); - function getCandidateName(candidate) { - const candidateName = symbolName(candidate); - if (startsWith(candidateName, '"')) { - return void 0; - } - if (candidate.flags & meaning) { - return candidateName; - } - if (candidate.flags & 2097152 /* Alias */) { - const alias = tryResolveAlias(candidate); - if (alias && alias.flags & meaning) { - return candidateName; - } - } - return void 0; - } - } - function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isSelfTypeAccess2) { - const valueDeclaration = prop && prop.flags & 106500 /* ClassMember */ && prop.valueDeclaration; - if (!valueDeclaration) { - return; - } - const hasPrivateModifier = hasEffectiveModifier(valueDeclaration, 2 /* Private */); - const hasPrivateIdentifier = prop.valueDeclaration && isNamedDeclaration(prop.valueDeclaration) && isPrivateIdentifier(prop.valueDeclaration.name); - if (!hasPrivateModifier && !hasPrivateIdentifier) { - return; - } - if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) { - return; - } - if (isSelfTypeAccess2) { - const containingMethod = findAncestor(nodeForCheckWriteOnly, isFunctionLikeDeclaration); - if (containingMethod && containingMethod.symbol === prop) { - return; - } - } - (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 212 /* PropertyAccessExpression */: - return isValidPropertyAccessWithType(node, node.expression.kind === 108 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 167 /* QualifiedName */: - return isValidPropertyAccessWithType( - node, - /*isSuper*/ - false, - propertyName, - getWidenedType(checkExpression(node.left)) - ); - case 206 /* ImportType */: - return isValidPropertyAccessWithType( - node, - /*isSuper*/ - false, - propertyName, - getTypeFromTypeNode(node) - ); - } - } - function isValidPropertyAccessForCompletions(node, type, property) { - return isPropertyAccessible( - node, - node.kind === 212 /* PropertyAccessExpression */ && node.expression.kind === 108 /* SuperKeyword */, - /*isWrite*/ - false, - type, - property - ); - } - function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { - if (isTypeAny(type)) { - return true; - } - const prop = getPropertyOfType(type, propertyName); - return !!prop && isPropertyAccessible( - node, - isSuper, - /*isWrite*/ - false, - type, - prop - ); - } - function isPropertyAccessible(node, isSuper, isWrite, containingType, property) { - if (isTypeAny(containingType)) { - return true; - } - if (property.valueDeclaration && isPrivateIdentifierClassElementDeclaration(property.valueDeclaration)) { - const declClass = getContainingClass(property.valueDeclaration); - return !isOptionalChain(node) && !!findAncestor(node, (parent2) => parent2 === declClass); - } - return checkPropertyAccessibilityAtLocation(node, isSuper, isWrite, containingType, property); - } - function getForInVariableSymbol(node) { - const initializer = node.initializer; - if (initializer.kind === 262 /* VariableDeclarationList */) { - const variable = initializer.declarations[0]; - if (variable && !isBindingPattern(variable.name)) { - return getSymbolOfDeclaration(variable); - } - } else if (initializer.kind === 80 /* Identifier */) { - return getResolvedSymbol(initializer); - } - return void 0; - } - function hasNumericPropertyNames(type) { - return getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, numberType); - } - function isForInVariableForNumericPropertyNames(expr) { - const e = skipParentheses(expr); - if (e.kind === 80 /* Identifier */) { - const symbol = getResolvedSymbol(e); - if (symbol.flags & 3 /* Variable */) { - let child = expr; - let node = expr.parent; - while (node) { - if (node.kind === 250 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { - return true; - } - child = node; - node = node.parent; - } - } - } - return false; - } - function checkIndexedAccess(node, checkMode) { - return node.flags & 64 /* OptionalChain */ ? checkElementAccessChain(node, checkMode) : checkElementAccessExpression(node, checkNonNullExpression(node.expression), checkMode); - } - function checkElementAccessChain(node, checkMode) { - const exprType = checkExpression(node.expression); - const nonOptionalType = getOptionalExpressionType(exprType, node.expression); - return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression), checkMode), node, nonOptionalType !== exprType); - } - function checkElementAccessExpression(node, exprType, checkMode) { - const objectType = getAssignmentTargetKind(node) !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType; - const indexExpression = node.argumentExpression; - const indexType = checkExpression(indexExpression); - if (isErrorType(objectType) || objectType === silentNeverType) { - return objectType; - } - if (isConstEnumObjectType(objectType) && !isStringLiteralLike(indexExpression)) { - error2(indexExpression, Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); - return errorType; - } - const effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType; - const assignmentTargetKind = getAssignmentTargetKind(node); - let accessFlags; - if (assignmentTargetKind === 0 /* None */) { - accessFlags = 32 /* ExpressionPosition */; - } else { - accessFlags = 4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0); - if (assignmentTargetKind === 2 /* Compound */) { - accessFlags |= 32 /* ExpressionPosition */; - } - } - const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType; - return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node); - } - function callLikeExpressionMayHaveTypeArguments(node) { - return isCallOrNewExpression(node) || isTaggedTemplateExpression(node) || isJsxOpeningLikeElement(node); - } - function resolveUntypedCall(node) { - if (callLikeExpressionMayHaveTypeArguments(node)) { - forEach(node.typeArguments, checkSourceElement); - } - if (node.kind === 216 /* TaggedTemplateExpression */) { - checkExpression(node.template); - } else if (isJsxOpeningLikeElement(node)) { - checkExpression(node.attributes); - } else if (isBinaryExpression(node)) { - checkExpression(node.left); - } else if (isCallOrNewExpression(node)) { - forEach(node.arguments, (argument) => { - checkExpression(argument); - }); - } - return anySignature; - } - function resolveErrorCall(node) { - resolveUntypedCall(node); - return unknownSignature; - } - function reorderCandidates(signatures, result, callChainFlags) { - let lastParent; - let lastSymbol; - let cutoffIndex = 0; - let index; - let specializedIndex = -1; - let spliceIndex; - Debug.assert(!result.length); - for (const signature of signatures) { - const symbol = signature.declaration && getSymbolOfDeclaration(signature.declaration); - const parent2 = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent2 === lastParent) { - index = index + 1; - } else { - lastParent = parent2; - index = cutoffIndex; - } - } else { - index = cutoffIndex = result.length; - lastParent = parent2; - } - lastSymbol = symbol; - if (signatureHasLiteralTypes(signature)) { - specializedIndex++; - spliceIndex = specializedIndex; - cutoffIndex++; - } else { - spliceIndex = index; - } - result.splice(spliceIndex, 0, callChainFlags ? getOptionalCallSignature(signature, callChainFlags) : signature); - } - } - function isSpreadArgument(arg) { - return !!arg && (arg.kind === 231 /* SpreadElement */ || arg.kind === 238 /* SyntheticExpression */ && arg.isSpread); - } - function getSpreadArgumentIndex(args) { - return findIndex(args, isSpreadArgument); - } - function acceptsVoid(t) { - return !!(t.flags & 16384 /* Void */); - } - function acceptsVoidUndefinedUnknownOrAny(t) { - return !!(t.flags & (16384 /* Void */ | 32768 /* Undefined */ | 2 /* Unknown */ | 1 /* Any */)); - } - function hasCorrectArity(node, args, signature, signatureHelpTrailingComma = false) { - if (isJsxOpeningFragment(node)) return true; - let argCount; - let callIsIncomplete = false; - let effectiveParameterCount = getParameterCount(signature); - let effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 216 /* TaggedTemplateExpression */) { - argCount = args.length; - if (node.template.kind === 229 /* TemplateExpression */) { - const lastSpan = last(node.template.templateSpans); - callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; - } else { - const templateLiteral = node.template; - Debug.assert(templateLiteral.kind === 15 /* NoSubstitutionTemplateLiteral */); - callIsIncomplete = !!templateLiteral.isUnterminated; - } - } else if (node.kind === 171 /* Decorator */) { - argCount = getDecoratorArgumentCount(node, signature); - } else if (node.kind === 227 /* BinaryExpression */) { - argCount = 1; - } else if (isJsxOpeningLikeElement(node)) { - callIsIncomplete = node.attributes.end === node.end; - if (callIsIncomplete) { - return true; - } - argCount = effectiveMinimumArguments === 0 ? args.length : 1; - effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1; - effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); - } else if (!node.arguments) { - Debug.assert(node.kind === 215 /* NewExpression */); - return getMinArgumentCount(signature) === 0; - } else { - argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; - callIsIncomplete = node.arguments.end === node.end; - const spreadArgIndex = getSpreadArgumentIndex(args); - if (spreadArgIndex >= 0) { - return spreadArgIndex >= getMinArgumentCount(signature) && (hasEffectiveRestParameter(signature) || spreadArgIndex < getParameterCount(signature)); - } - } - if (!hasEffectiveRestParameter(signature) && argCount > effectiveParameterCount) { - return false; - } - if (callIsIncomplete || argCount >= effectiveMinimumArguments) { - return true; - } - for (let i = argCount; i < effectiveMinimumArguments; i++) { - const type = getTypeAtPosition(signature, i); - if (filterType(type, isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072 /* Never */) { - return false; - } - } - return true; - } - function hasCorrectTypeArgumentArity(signature, typeArguments) { - const numTypeParameters = length(signature.typeParameters); - 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, - 0 /* Call */, - /*allowMembers*/ - false - ); - } - function getSingleCallOrConstructSignature(type) { - return getSingleSignature( - type, - 0 /* Call */, - /*allowMembers*/ - false - ) || getSingleSignature( - type, - 1 /* Construct */, - /*allowMembers*/ - false - ); - } - function getSingleSignature(type, kind, allowMembers) { - if (type.flags & 524288 /* Object */) { - const resolved = resolveStructuredTypeMembers(type); - if (allowMembers || resolved.properties.length === 0 && resolved.indexInfos.length === 0) { - if (kind === 0 /* Call */ && resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0) { - return resolved.callSignatures[0]; - } - if (kind === 1 /* Construct */ && resolved.constructSignatures.length === 1 && resolved.callSignatures.length === 0) { - return resolved.constructSignatures[0]; - } - } - } - return void 0; - } - function instantiateSignatureInContextOf(signature, contextualSignature, inferenceContext, compareTypes) { - const context = createInferenceContext(getTypeParametersForMapper(signature), signature, 0 /* None */, compareTypes); - const restType = getEffectiveRestType(contextualSignature); - const mapper = inferenceContext && (restType && restType.flags & 262144 /* TypeParameter */ ? inferenceContext.nonFixingMapper : inferenceContext.mapper); - const sourceSignature = mapper ? instantiateSignature(contextualSignature, mapper) : contextualSignature; - applyToParameterTypes(sourceSignature, signature, (source, target) => { - inferTypes(context.inferences, source, target); - }); - if (!inferenceContext) { - applyToReturnTypes(contextualSignature, signature, (source, target) => { - inferTypes(context.inferences, source, target, 128 /* ReturnType */); - }); - } - return getSignatureInstantiation(signature, getInferredTypes(context), isInJSFile(contextualSignature.declaration)); - } - function inferJsxTypeArguments(node, signature, checkMode, context) { - const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); - const checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context, checkMode); - inferTypes(context.inferences, checkAttrType, paramType); - return getInferredTypes(context); - } - function getThisArgumentType(thisArgumentNode) { - if (!thisArgumentNode) { - return voidType; - } - const thisArgumentType = checkExpression(thisArgumentNode); - 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 !== 171 /* Decorator */ && node.kind !== 227 /* BinaryExpression */) { - const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p)); - const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */); - if (contextualType) { - const inferenceTargetType = getReturnTypeOfSignature(signature); - if (couldContainTypeVariables(inferenceTargetType)) { - const outerContext = getInferenceContext(node); - const isFromBindingPattern = !skipBindingPatterns && getContextualType2(node, 8 /* SkipBindingPatterns */) !== contextualType; - if (!isFromBindingPattern) { - const outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1 /* NoDefault */)); - const instantiatedType = instantiateType(contextualType, outerMapper); - const contextualSignature = getSingleCallSignature(instantiatedType); - const inferenceSourceType = contextualSignature && contextualSignature.typeParameters ? getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) : instantiatedType; - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128 /* ReturnType */); - } - const returnContext = createInferenceContext(signature.typeParameters, signature, context.flags); - const returnSourceType = instantiateType(contextualType, outerContext && createOuterReturnMapper(outerContext)); - inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType); - context.returnMapper = some(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : void 0; - } - } - } - const restType = getNonArrayRestType(signature); - const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; - if (restType && restType.flags & 262144 /* TypeParameter */) { - const info = find(context.inferences, (info2) => info2.typeParameter === restType); - if (info) { - info.impliedArity = findIndex(args, isSpreadArgument, argCount) < 0 ? args.length - argCount : void 0; - } - } - const thisType = getThisTypeOfSignature(signature); - if (thisType && couldContainTypeVariables(thisType)) { - const thisArgumentNode = getThisArgumentOfCall(node); - inferTypes(context.inferences, getThisArgumentType(thisArgumentNode), thisType); - } - for (let i = 0; i < argCount; i++) { - const arg = args[i]; - if (arg.kind !== 233 /* OmittedExpression */) { - const paramType = getTypeAtPosition(signature, i); - if (couldContainTypeVariables(paramType)) { - const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); - inferTypes(context.inferences, argType, paramType); - } - } - } - if (restType && couldContainTypeVariables(restType)) { - const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, context, checkMode); - inferTypes(context.inferences, spreadType, restType); - } - return getInferredTypes(context); - } - function getMutableArrayOrTupleType(type) { - return type.flags & 1048576 /* Union */ ? mapType(type, getMutableArrayOrTupleType) : type.flags & 1 /* Any */ || isMutableArrayOrTuple(getBaseConstraintOfType(type) || type) ? type : isTupleType(type) ? createTupleType( - getElementTypes(type), - type.target.elementFlags, - /*readonly*/ - false, - type.target.labeledElementDeclarations - ) : createTupleType([type], [8 /* Variadic */]); - } - function getSpreadArgumentType(args, index, argCount, restType, context, checkMode) { - const inConstContext = isConstTypeVariable(restType); - if (index >= argCount - 1) { - const arg = args[argCount - 1]; - if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode); - if (isArrayLikeType(spreadType)) { - return getMutableArrayOrTupleType(spreadType); - } - return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg), inConstContext); - } - } - const types = []; - const flags = []; - const names = []; - for (let i = index; i < argCount; i++) { - const arg = args[i]; - if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 238 /* 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 === 231 /* SpreadElement */ ? arg.expression : arg)); - flags.push(4 /* Rest */); - } - } else { - const contextualType = isTupleType(restType) ? getContextualTypeForElementExpression(restType, i - index, argCount - index) || unknownType : getIndexedAccessType(restType, getNumberLiteralType(i - index), 256 /* Contextual */); - const argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); - types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); - flags.push(1 /* Required */); - } - if (arg.kind === 238 /* SyntheticExpression */ && arg.tupleNameSource) { - names.push(arg.tupleNameSource); - } else { - names.push(void 0); - } - } - return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names); - } - function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) { - const isJavascript = isInJSFile(signature.declaration); - const typeParameters = signature.typeParameters; - const typeArgumentTypes = fillMissingTypeArguments(map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript); - let mapper; - for (let i = 0; i < typeArgumentNodes.length; i++) { - Debug.assert(typeParameters[i] !== void 0, "Should not call checkTypeArguments with too many type arguments"); - const constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { - const errorInfo = reportErrors2 && headMessage ? () => chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Type_0_does_not_satisfy_the_constraint_1 - ) : void 0; - const typeArgumentHeadMessage = headMessage || Diagnostics.Type_0_does_not_satisfy_the_constraint_1; - if (!mapper) { - mapper = createTypeMapper(typeParameters, typeArgumentTypes); - } - const typeArgument = typeArgumentTypes[i]; - if (!checkTypeAssignableTo( - typeArgument, - getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), - reportErrors2 ? typeArgumentNodes[i] : void 0, - typeArgumentHeadMessage, - errorInfo - )) { - return void 0; - } - } - } - return typeArgumentTypes; - } - function getJsxReferenceKind(node) { - if (isJsxIntrinsicTagName(node.tagName)) { - return 2 /* Mixed */; - } - const tagType = getApparentType(checkExpression(node.tagName)); - if (length(getSignaturesOfType(tagType, 1 /* Construct */))) { - return 0 /* Component */; - } - if (length(getSignaturesOfType(tagType, 0 /* Call */))) { - return 1 /* Function */; - } - return 2 /* Mixed */; - } - function checkApplicableSignatureForJsxCallLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer) { - const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); - const attributesType = isJsxOpeningFragment(node) ? createJsxAttributesTypeFromAttributesProperty(node) : checkExpressionWithContextualType( - node.attributes, - paramType, - /*inferenceContext*/ - void 0, - checkMode - ); - const checkAttributesType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(attributesType) : attributesType; - return checkTagNameDoesNotExpectTooManyArguments() && checkTypeRelatedToAndOptionallyElaborate( - checkAttributesType, - paramType, - relation, - reportErrors2 ? isJsxOpeningFragment(node) ? node : node.tagName : void 0, - isJsxOpeningFragment(node) ? void 0 : node.attributes, - /*headMessage*/ - void 0, - containingMessageChain, - errorOutputContainer - ); - function checkTagNameDoesNotExpectTooManyArguments() { - var _a; - if (getJsxNamespaceContainerForImplicitImport(node)) { - return true; - } - const tagType = (isJsxOpeningElement(node) || isJsxSelfClosingElement(node)) && !(isJsxIntrinsicTagName(node.tagName) || isJsxNamespacedName(node.tagName)) ? checkExpression(node.tagName) : void 0; - if (!tagType) { - return true; - } - const tagCallSignatures = getSignaturesOfType(tagType, 0 /* Call */); - if (!length(tagCallSignatures)) { - return true; - } - const factory2 = getJsxFactoryEntity(node); - if (!factory2) { - return true; - } - const factorySymbol = resolveEntityName( - factory2, - 111551 /* Value */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - false, - node - ); - if (!factorySymbol) { - return true; - } - const factoryType = getTypeOfSymbol(factorySymbol); - const callSignatures = getSignaturesOfType(factoryType, 0 /* Call */); - if (!length(callSignatures)) { - return true; - } - let hasFirstParamSignatures = false; - let maxParamCount = 0; - for (const sig of callSignatures) { - const firstparam = getTypeAtPosition(sig, 0); - const signaturesOfParam = getSignaturesOfType(firstparam, 0 /* Call */); - if (!length(signaturesOfParam)) continue; - for (const paramSig of signaturesOfParam) { - hasFirstParamSignatures = true; - if (hasEffectiveRestParameter(paramSig)) { - return true; - } - const paramCount = getParameterCount(paramSig); - if (paramCount > maxParamCount) { - maxParamCount = paramCount; - } - } - } - if (!hasFirstParamSignatures) { - return true; - } - let absoluteMinArgCount = Infinity; - for (const tagSig of tagCallSignatures) { - const tagRequiredArgCount = getMinArgumentCount(tagSig); - if (tagRequiredArgCount < absoluteMinArgCount) { - absoluteMinArgCount = tagRequiredArgCount; - } - } - if (absoluteMinArgCount <= maxParamCount) { - return true; - } - if (reportErrors2) { - const tagName = node.tagName; - const diag2 = createDiagnosticForNode(tagName, Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, entityNameToString(tagName), absoluteMinArgCount, entityNameToString(factory2), maxParamCount); - const tagNameDeclaration = (_a = getSymbolAtLocation(tagName)) == null ? void 0 : _a.valueDeclaration; - if (tagNameDeclaration) { - addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here, entityNameToString(tagName))); - } - if (errorOutputContainer && errorOutputContainer.skipLogging) { - (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); - } - if (!errorOutputContainer.skipLogging) { - diagnostics.add(diag2); - } - } - return false; - } - } - function getEffectiveCheckNode(argument) { - const flags = isInJSFile(argument) ? 1 /* Parentheses */ | 32 /* Satisfies */ | -2147483648 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */ | 32 /* Satisfies */; - return skipOuterExpressions(argument, flags); - } - function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) { - const errorOutputContainer = { errors: void 0, skipLogging: true }; - if (isJsxCallLike(node)) { - if (!checkApplicableSignatureForJsxCallLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer)) { - Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "jsx should have errors when reporting errors"); - return errorOutputContainer.errors || emptyArray; - } - return void 0; - } - const thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && !(isNewExpression(node) || isCallExpression(node) && isSuperProperty(node.expression))) { - const thisArgumentNode = getThisArgumentOfCall(node); - const thisArgumentType = getThisArgumentType(thisArgumentNode); - const errorNode = reportErrors2 ? thisArgumentNode || node : void 0; - const headMessage2 = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; - if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage2, containingMessageChain, errorOutputContainer)) { - Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors"); - return errorOutputContainer.errors || emptyArray; - } - } - const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; - const restType = getNonArrayRestType(signature); - 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 !== 233 /* OmittedExpression */) { - const paramType = getTypeAtPosition(signature, i); - const argType = checkExpressionWithContextualType( - arg, - paramType, - /*inferenceContext*/ - void 0, - checkMode - ); - const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType; - 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; - } - } - } - if (restType) { - const spreadType = getSpreadArgumentType( - args, - argCount, - args.length, - restType, - /*context*/ - void 0, - checkMode - ); - const restArgCount = args.length - argCount; - 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, - relation, - errorNode, - headMessage, - /*containingMessageChain*/ - void 0, - errorOutputContainer - )) { - Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); - maybeAddMissingAwaitInfo(errorNode, spreadType, restType); - return errorOutputContainer.errors || emptyArray; - } - } - return void 0; - function maybeAddMissingAwaitInfo(errorNode, source, target) { - if (errorNode && reportErrors2 && errorOutputContainer.errors && errorOutputContainer.errors.length) { - if (getAwaitedTypeOfPromise(target)) { - return; - } - const awaitedTypeOfSource = getAwaitedTypeOfPromise(source); - if (awaitedTypeOfSource && isTypeRelatedTo(awaitedTypeOfSource, target, relation)) { - addRelatedInfo(errorOutputContainer.errors[0], createDiagnosticForNode(errorNode, Diagnostics.Did_you_forget_to_use_await)); - } - } - } - } - function getThisArgumentOfCall(node) { - if (node.kind === 227 /* BinaryExpression */) { - return node.right; - } - const expression = node.kind === 214 /* CallExpression */ ? node.expression : node.kind === 216 /* TaggedTemplateExpression */ ? node.tag : node.kind === 171 /* Decorator */ && !legacyDecorators ? node.expression : void 0; - if (expression) { - const callee = skipOuterExpressions(expression); - if (isAccessExpression(callee)) { - return callee.expression; - } - } - } - function createSyntheticExpression(parent2, type, isSpread, tupleNameSource) { - const result = parseNodeFactory.createSyntheticExpression(type, isSpread, tupleNameSource); - setTextRange(result, parent2); - setParent(result, parent2); - return result; - } - function getEffectiveCallArguments(node) { - if (isJsxOpeningFragment(node)) { - return [createSyntheticExpression(node, emptyFreshJsxObjectType)]; - } - if (node.kind === 216 /* TaggedTemplateExpression */) { - const template = node.template; - const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 229 /* TemplateExpression */) { - forEach(template.templateSpans, (span) => { - args2.push(span.expression); - }); - } - return args2; - } - if (node.kind === 171 /* Decorator */) { - return getEffectiveDecoratorArguments(node); - } - if (node.kind === 227 /* BinaryExpression */) { - return [node.left]; - } - if (isJsxOpeningLikeElement(node)) { - return node.attributes.properties.length > 0 || isJsxOpeningElement(node) && node.parent.children.length > 0 ? [node.attributes] : emptyArray; - } - const args = node.arguments || emptyArray; - const spreadIndex = getSpreadArgumentIndex(args); - if (spreadIndex >= 0) { - const effectiveArgs = args.slice(0, spreadIndex); - for (let i = spreadIndex; i < args.length; i++) { - const arg = args[i]; - const spreadType = arg.kind === 231 /* 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]); - effectiveArgs.push(syntheticArg); - }); - } else { - effectiveArgs.push(arg); - } - } - return effectiveArgs; - } - return args; - } - function getEffectiveDecoratorArguments(node) { - const expr = node.expression; - const signature = getDecoratorCallSignature(node); - if (signature) { - const args = []; - for (const param of signature.parameters) { - const type = getTypeOfSymbol(param); - args.push(createSyntheticExpression(expr, type)); - } - return args; - } - return Debug.fail(); - } - function getDecoratorArgumentCount(node, signature) { - return compilerOptions.experimentalDecorators ? getLegacyDecoratorArgumentCount(node, signature) : ( - // Allow the runtime to oversupply arguments to an ES decorator as long as there's at least one parameter. - Math.min(Math.max(getParameterCount(signature), 1), 2) - ); - } - function getLegacyDecoratorArgumentCount(node, signature) { - switch (node.parent.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return 1; - case 173 /* PropertyDeclaration */: - return hasAccessorModifier(node.parent) ? 3 : 2; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return signature.parameters.length <= 2 ? 2 : 3; - case 170 /* Parameter */: - return 3; - default: - return Debug.fail(); - } - } - function getDiagnosticSpanForCallNode(node) { - const sourceFile = getSourceFileOfNode(node); - const { start, length: length2 } = getErrorSpanForNode(sourceFile, isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression); - return { start, length: length2, sourceFile }; - } - function getDiagnosticForCallNode(node, message, ...args) { - if (isCallExpression(node)) { - const { sourceFile, start, length: length2 } = getDiagnosticSpanForCallNode(node); - if ("message" in message) { - return createFileDiagnostic(sourceFile, start, length2, message, ...args); - } - return createDiagnosticForFileFromMessageChain(sourceFile, message); - } else { - if ("message" in message) { - return createDiagnosticForNode(node, message, ...args); - } - 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; - const symbol = resolveName( - node.expression, - node.expression.escapedText, - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - const decl = symbol == null ? void 0 : symbol.valueDeclaration; - if (!decl || !isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !isNewExpression(decl.parent.parent) || !isIdentifier(decl.parent.parent.expression)) { - return false; - } - const globalPromiseSymbol = getGlobalPromiseConstructorSymbol( - /*reportErrors*/ - false - ); - if (!globalPromiseSymbol) return false; - const constructorSymbol = getSymbolAtLocation( - decl.parent.parent.expression, - /*ignoreErrors*/ - true - ); - return constructorSymbol === globalPromiseSymbol; - } - function getArgumentArityError(node, signatures, args, headMessage) { - var _a; - const spreadIndex = getSpreadArgumentIndex(args); - if (spreadIndex > -1) { - return createDiagnosticForNode(args[spreadIndex], Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter); - } - let min2 = Number.POSITIVE_INFINITY; - let max = Number.NEGATIVE_INFINITY; - let maxBelow = Number.NEGATIVE_INFINITY; - let minAbove = Number.POSITIVE_INFINITY; - let closestSignature; - for (const sig of signatures) { - const minParameter = getMinArgumentCount(sig); - const maxParameter = getParameterCount(sig); - if (minParameter < min2) { - min2 = minParameter; - closestSignature = sig; - } - max = Math.max(max, maxParameter); - if (minParameter < args.length && minParameter > maxBelow) maxBelow = minParameter; - if (args.length < maxParameter && maxParameter < minAbove) minAbove = maxParameter; - } - const hasRestParameter2 = some(signatures, hasEffectiveRestParameter); - const parameterRange = hasRestParameter2 ? min2 : min2 < max ? min2 + "-" + max : min2; - const isVoidPromiseError = !hasRestParameter2 && parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node); - 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 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( - /*details*/ - void 0, - Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, - args.length, - maxBelow, - minAbove - ); - chain = chainDiagnosticMessages(chain, headMessage); - return getDiagnosticForCallNode(node, chain); - } - return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); - } else if (args.length < min2) { - let diagnostic; - if (headMessage) { - let chain = chainDiagnosticMessages( - /*details*/ - void 0, - error3, - parameterRange, - args.length - ); - chain = chainDiagnosticMessages(chain, headMessage); - diagnostic = getDiagnosticForCallNode(node, chain); - } else { - 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) { - const messageAndArgs = isBindingPattern(parameter.name) ? [Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided] : isRestParameter(parameter) ? [Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided, idText(getFirstIdentifier(parameter.name))] : [Diagnostics.An_argument_for_0_was_not_provided, !parameter.name ? args.length : idText(getFirstIdentifier(parameter.name))]; - const parameterError = createDiagnosticForNode(parameter, ...messageAndArgs); - return addRelatedInfo(diagnostic, parameterError); - } - return diagnostic; - } else { - const errorSpan = factory.createNodeArray(args.slice(max)); - const pos = first(errorSpan).pos; - let end = last(errorSpan).end; - if (end === pos) { - end++; - } - setTextRangePosEnd(errorSpan, pos, end); - if (headMessage) { - let chain = chainDiagnosticMessages( - /*details*/ - void 0, - error3, - parameterRange, - args.length - ); - chain = chainDiagnosticMessages(chain, headMessage); - return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), errorSpan, chain); - } - return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error3, parameterRange, args.length); - } - } - function getTypeArgumentArityError(node, signatures, typeArguments, headMessage) { - const argCount = typeArguments.length; - if (signatures.length === 1) { - const sig = signatures[0]; - const min2 = getMinTypeArgumentCount(sig.typeParameters); - const max = length(sig.typeParameters); - if (headMessage) { - let chain = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Expected_0_type_arguments_but_got_1, - min2 < max ? min2 + "-" + max : min2, - argCount - ); - chain = chainDiagnosticMessages(chain, headMessage); - return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); - } - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min2 < max ? min2 + "-" + max : min2, argCount); - } - let belowArgCount = -Infinity; - let aboveArgCount = Infinity; - for (const sig of signatures) { - const min2 = getMinTypeArgumentCount(sig.typeParameters); - const max = length(sig.typeParameters); - if (min2 > argCount) { - aboveArgCount = Math.min(aboveArgCount, min2); - } else if (max < argCount) { - belowArgCount = Math.max(belowArgCount, max); - } - } - if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { - if (headMessage) { - let chain = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, - argCount, - belowArgCount, - aboveArgCount - ); - chain = chainDiagnosticMessages(chain, headMessage); - return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); - } - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); - } - if (headMessage) { - let chain = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Expected_0_type_arguments_but_got_1, - belowArgCount === -Infinity ? aboveArgCount : belowArgCount, - argCount - ); - chain = chainDiagnosticMessages(chain, headMessage); - return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain); - } - 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 === 216 /* TaggedTemplateExpression */; - const isDecorator2 = node.kind === 171 /* Decorator */; - const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); - const isJsxOpenFragment = isJsxOpeningFragment(node); - const isInstanceof = node.kind === 227 /* BinaryExpression */; - const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; - let candidatesForArgumentError; - let candidateForArgumentArityError; - let candidateForTypeArgumentError; - let result; - let argCheckMode = 0 /* Normal */; - let candidates = []; - let typeArguments; - if (!isDecorator2 && !isInstanceof && !isSuperCall(node) && !isJsxOpenFragment) { - typeArguments = node.typeArguments; - if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 108 /* SuperKeyword */) { - forEach(typeArguments, checkSourceElement); - } - } - candidates = candidatesOutArray || []; - reorderCandidates(signatures, candidates, callChainFlags); - if (!isJsxOpenFragment) { - if (!candidates.length) { - if (reportErrors2) { - diagnostics.add(getDiagnosticForCallNode(node, Diagnostics.Call_target_does_not_contain_any_signatures)); - } - return resolveErrorCall(node); - } - } - const args = getEffectiveCallArguments(node); - const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; - if (!isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive)) { - argCheckMode = 4 /* SkipContextSensitive */; - } - const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 214 /* CallExpression */ && node.arguments.hasTrailingComma; - if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); - } - if (!result) { - result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); - } - const links = getNodeLinks(node); - if (links.resolvedSignature !== resolvingSignature && !candidatesOutArray) { - Debug.assert(links.resolvedSignature); - return links.resolvedSignature; - } - if (result) { - return result; - } - result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode); - links.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]; - let chain; - if (candidatesForArgumentError.length > 3) { - chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); - chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call); - } - if (headMessage) { - chain = chainDiagnosticMessages(chain, headMessage); - } - const diags = getSignatureApplicabilityError( - node, - args, - last2, - assignableRelation, - 0 /* Normal */, - /*reportErrors*/ - true, - () => chain - ); - if (diags) { - for (const d of diags) { - if (last2.declaration && candidatesForArgumentError.length > 3) { - addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.The_last_overload_is_declared_here)); - } - addImplementationSuccessElaboration(last2, d); - diagnostics.add(d); - } - } else { - Debug.fail("No error for last overload signature"); - } - } else { - const allDiagnostics = []; - let max = 0; - let min2 = Number.MAX_VALUE; - let minIndex = 0; - let i = 0; - for (const c of candidatesForArgumentError) { - const chain2 = () => chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Overload_0_of_1_2_gave_the_following_error, - i + 1, - candidates.length, - signatureToString(c) - ); - const diags2 = getSignatureApplicabilityError( - node, - args, - c, - assignableRelation, - 0 /* Normal */, - /*reportErrors*/ - true, - chain2 - ); - if (diags2) { - if (diags2.length <= min2) { - min2 = diags2.length; - minIndex = i; - } - max = Math.max(max, diags2.length); - allDiagnostics.push(diags2); - } else { - Debug.fail("No error for 3 or fewer overload signatures"); - } - i++; - } - const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); - Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures"); - let chain = chainDiagnosticMessages( - map(diags, createDiagnosticMessageChainFromDiagnostic), - Diagnostics.No_overload_matches_this_call - ); - if (headMessage) { - chain = chainDiagnosticMessages(chain, headMessage); - } - const related = [...flatMap(diags, (d) => d.relatedInformation)]; - let diag2; - if (every(diags, (d) => d.start === diags[0].start && d.length === diags[0].length && d.file === diags[0].file)) { - 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), getErrorNodeForCallNode(node), chain, related); - } - addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2); - diagnostics.add(diag2); - } - } else if (candidateForArgumentArityError) { - diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args, headMessage)); - } else if (candidateForTypeArgumentError) { - checkTypeArguments( - candidateForTypeArgumentError, - node.typeArguments, - /*reportErrors*/ - true, - headMessage - ); - } else if (!isJsxOpenFragment) { - const signaturesWithCorrectTypeArgumentArity = filter(signatures, (s) => hasCorrectTypeArgumentArity(s, typeArguments)); - if (signaturesWithCorrectTypeArgumentArity.length === 0) { - diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments, headMessage)); - } else { - diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args, headMessage)); - } - } - } - return result; - function addImplementationSuccessElaboration(failed2, diagnostic) { - var _a, _b; - const oldCandidatesForArgumentError = candidatesForArgumentError; - const oldCandidateForArgumentArityError = candidateForArgumentArityError; - const oldCandidateForTypeArgumentError = candidateForTypeArgumentError; - const failedSignatureDeclarations = ((_b = (_a = failed2.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.declarations) || emptyArray; - 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; - if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate2)) { - addRelatedInfo(diagnostic, createDiagnosticForNode(implDecl, Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); - } - } - candidatesForArgumentError = oldCandidatesForArgumentError; - candidateForArgumentArityError = oldCandidateForArgumentArityError; - candidateForTypeArgumentError = oldCandidateForTypeArgumentError; - } - function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) { - candidatesForArgumentError = void 0; - candidateForArgumentArityError = void 0; - candidateForTypeArgumentError = void 0; - if (isSingleNonGenericCandidate2) { - const candidate = candidates2[0]; - if (some(typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { - return void 0; - } - if (getSignatureApplicabilityError( - node, - args, - candidate, - relation, - 0 /* Normal */, - /*reportErrors*/ - false, - /*containingMessageChain*/ - void 0 - )) { - candidatesForArgumentError = [candidate]; - return void 0; - } - return candidate; - } - for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) { - const candidate = candidates2[candidateIndex]; - if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { - continue; - } - let checkCandidate; - let inferenceContext; - if (candidate.typeParameters) { - let typeArgumentTypes; - if (some(typeArguments)) { - typeArgumentTypes = checkTypeArguments( - candidate, - typeArguments, - /*reportErrors*/ - false - ); - if (!typeArgumentTypes) { - candidateForTypeArgumentError = candidate; - continue; - } - } else { - inferenceContext = createInferenceContext( - candidate.typeParameters, - candidate, - /*flags*/ - isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */ - ); - typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext); - argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */; - } - checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters); - if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { - candidateForArgumentArityError = checkCandidate; - continue; - } - } else { - checkCandidate = candidate; - } - if (getSignatureApplicabilityError( - node, - args, - checkCandidate, - relation, - argCheckMode, - /*reportErrors*/ - false, - /*containingMessageChain*/ - void 0 - )) { - (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); - continue; - } - if (argCheckMode) { - argCheckMode = 0 /* Normal */; - if (inferenceContext) { - const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext); - checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters); - if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { - candidateForArgumentArityError = checkCandidate; - continue; - } - } - if (getSignatureApplicabilityError( - node, - args, - checkCandidate, - relation, - argCheckMode, - /*reportErrors*/ - false, - /*containingMessageChain*/ - void 0 - )) { - (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); - continue; - } - } - candidates2[candidateIndex] = checkCandidate; - return checkCandidate; - } - return void 0; - } - } - function getCandidateForOverloadFailure(node, candidates, args, hasCandidatesOutArray, checkMode) { - Debug.assert(candidates.length > 0); - checkNodeDeferred(node); - return hasCandidatesOutArray || candidates.length === 1 || candidates.some((c) => !!c.typeParameters) ? pickLongestCandidateSignature(node, candidates, args, checkMode) : createUnionOfSignaturesForOverloadFailure(candidates); - } - function createUnionOfSignaturesForOverloadFailure(candidates) { - const thisParameters = mapDefined(candidates, (c) => c.thisParameter); - let thisParameter; - if (thisParameters.length) { - thisParameter = createCombinedSymbolFromTypes(thisParameters, thisParameters.map(getTypeOfParameter)); - } - const { min: minArgumentCount, max: maxNonRestParam } = minAndMax(candidates, getNumNonRestParameters); - const parameters = []; - for (let i = 0; i < maxNonRestParam; i++) { - const symbols = mapDefined(candidates, (s) => signatureHasRestParameter(s) ? i < s.parameters.length - 1 ? s.parameters[i] : last(s.parameters) : i < s.parameters.length ? s.parameters[i] : void 0); - Debug.assert(symbols.length !== 0); - parameters.push(createCombinedSymbolFromTypes(symbols, mapDefined(candidates, (candidate) => tryGetTypeAtPosition(candidate, i)))); - } - const restParameterSymbols = mapDefined(candidates, (c) => signatureHasRestParameter(c) ? last(c.parameters) : void 0); - let flags = 128 /* IsSignatureCandidateForOverloadFailure */; - if (restParameterSymbols.length !== 0) { - const type = createArrayType(getUnionType(mapDefined(candidates, tryGetRestTypeOfSignature), 2 /* Subtype */)); - parameters.push(createCombinedSymbolForOverloadFailure(restParameterSymbols, type)); - flags |= 1 /* HasRestParameter */; - } - if (candidates.some(signatureHasLiteralTypes)) { - flags |= 2 /* HasLiteralTypes */; - } - return createSignature( - candidates[0].declaration, - /*typeParameters*/ - void 0, - // Before calling this we tested for `!candidates.some(c => !!c.typeParameters)`. - thisParameter, - parameters, - /*resolvedReturnType*/ - getIntersectionType(candidates.map(getReturnTypeOfSignature)), - /*resolvedTypePredicate*/ - void 0, - minArgumentCount, - flags - ); - } - function getNumNonRestParameters(signature) { - const numParams = signature.parameters.length; - return signatureHasRestParameter(signature) ? numParams - 1 : numParams; - } - function createCombinedSymbolFromTypes(sources, types) { - return createCombinedSymbolForOverloadFailure(sources, getUnionType(types, 2 /* Subtype */)); - } - function createCombinedSymbolForOverloadFailure(sources, type) { - return createSymbolWithType(first(sources), type); - } - function pickLongestCandidateSignature(node, candidates, args, checkMode) { - const bestIndex = getLongestCandidateIndex(candidates, apparentArgumentCount === void 0 ? args.length : apparentArgumentCount); - const candidate = candidates[bestIndex]; - const { typeParameters } = candidate; - if (!typeParameters) { - return candidate; - } - const typeArgumentNodes = callLikeExpressionMayHaveTypeArguments(node) ? node.typeArguments : void 0; - const instantiated = typeArgumentNodes ? createSignatureInstantiation(candidate, getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, isInJSFile(node))) : inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode); - candidates[bestIndex] = instantiated; - return instantiated; - } - function getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, isJs) { - const typeArguments = typeArgumentNodes.map(getTypeOfNode); - while (typeArguments.length > typeParameters.length) { - typeArguments.pop(); - } - while (typeArguments.length < typeParameters.length) { - typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs)); - } - return typeArguments; - } - function inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode) { - const inferenceContext = createInferenceContext( - typeParameters, - candidate, - /*flags*/ - isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */ - ); - const typeArgumentTypes = inferTypeArguments(node, candidate, args, checkMode | 4 /* SkipContextSensitive */ | 8 /* SkipGenericFunctions */, inferenceContext); - return createSignatureInstantiation(candidate, typeArgumentTypes); - } - function getLongestCandidateIndex(candidates, argsCount) { - let maxParamsIndex = -1; - let maxParams = -1; - for (let i = 0; i < candidates.length; i++) { - const candidate = candidates[i]; - const paramCount = getParameterCount(candidate); - if (hasEffectiveRestParameter(candidate) || paramCount >= argsCount) { - return i; - } - if (paramCount > maxParams) { - maxParams = paramCount; - maxParamsIndex = i; - } - } - return maxParamsIndex; - } - function resolveCallExpression(node, candidatesOutArray, checkMode) { - if (node.expression.kind === 108 /* SuperKeyword */) { - const superType = checkSuperExpression(node.expression); - if (isTypeAny(superType)) { - for (const arg of node.arguments) { - checkExpression(arg); - } - return anySignature; - } - if (!isErrorType(superType)) { - const baseTypeNode = getEffectiveBaseTypeNode(getContainingClass(node)); - if (baseTypeNode) { - const baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); - return resolveCall(node, baseConstructors, candidatesOutArray, checkMode, 0 /* None */); - } - } - return resolveUntypedCall(node); - } - let callChainFlags; - let funcType = checkExpression(node.expression); - if (isCallChain(node)) { - const nonOptionalType = getOptionalExpressionType(funcType, node.expression); - callChainFlags = nonOptionalType === funcType ? 0 /* None */ : isOutermostOptionalChain(node) ? 16 /* IsOuterCallChain */ : 8 /* IsInnerCallChain */; - funcType = nonOptionalType; - } else { - callChainFlags = 0 /* None */; - } - funcType = checkNonNullTypeWithReporter( - funcType, - node.expression, - reportCannotInvokePossiblyNullOrUndefinedError - ); - if (funcType === silentNeverType) { - return silentNeverSignature; - } - const apparentType = getApparentType(funcType); - if (isErrorType(apparentType)) { - return resolveErrorCall(node); - } - const callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - const numConstructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */).length; - if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { - if (!isErrorType(funcType) && node.typeArguments) { - error2(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - if (!callSignatures.length) { - if (numConstructSignatures) { - 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) { - const text = getSourceFileOfNode(node).text; - if (isLineBreak(text.charCodeAt(skipTrivia( - text, - node.expression.end, - /*stopAfterLineBreak*/ - true - ) - 1))) { - relatedInformation = createDiagnosticForNode(node.expression, Diagnostics.Are_you_missing_a_semicolon); - } - } - invocationError(node.expression, apparentType, 0 /* Call */, relatedInformation); - } - return resolveErrorCall(node); - } - if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) { - skippedGenericFunction(node, checkMode); - return resolvingSignature; - } - if (callSignatures.some((sig) => isInJSFile(sig.declaration) && !!getJSDocClassTag(sig.declaration))) { - 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 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); - } - function resolveNewExpression(node, candidatesOutArray, checkMode) { - let expressionType = checkNonNullExpression(node.expression); - if (expressionType === silentNeverType) { - return silentNeverSignature; - } - expressionType = getApparentType(expressionType); - if (isErrorType(expressionType)) { - return resolveErrorCall(node); - } - if (isTypeAny(expressionType)) { - if (node.typeArguments) { - error2(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - const constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); - if (constructSignatures.length) { - if (!isConstructorAccessible(node, constructSignatures[0])) { - return resolveErrorCall(node); - } - if (someSignature(constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */))) { - 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, 64 /* Abstract */)) { - error2(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class); - return resolveErrorCall(node); - } - return resolveCall(node, constructSignatures, candidatesOutArray, checkMode, 0 /* None */); - } - const callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); - if (callSignatures.length) { - const signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */); - if (!noImplicitAny) { - if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) { - error2(node, Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); - } - if (getThisTypeOfSignature(signature) === voidType) { - error2(node, Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void); - } - } - return signature; - } - invocationError(node.expression, expressionType, 1 /* Construct */); - return resolveErrorCall(node); - } - function someSignature(signatures, f) { - if (isArray(signatures)) { - return some(signatures, (signature) => someSignature(signature, f)); - } - return signatures.compositeKind === 1048576 /* Union */ ? some(signatures.compositeSignatures, f) : f(signatures); - } - function typeHasProtectedAccessibleBase(target, type) { - const baseTypes = getBaseTypes(type); - if (!length(baseTypes)) { - return false; - } - const firstBase = baseTypes[0]; - if (firstBase.flags & 2097152 /* Intersection */) { - const types = firstBase.types; - const mixinFlags = findMixins(types); - let i = 0; - for (const intersectionMember of firstBase.types) { - if (!mixinFlags[i]) { - if (getObjectFlags(intersectionMember) & (1 /* Class */ | 2 /* Interface */)) { - if (intersectionMember.symbol === target) { - return true; - } - if (typeHasProtectedAccessibleBase(target, intersectionMember)) { - return true; - } - } - } - i++; - } - return false; - } - if (firstBase.symbol === target) { - return true; - } - return typeHasProtectedAccessibleBase(target, firstBase); - } - function isConstructorAccessible(node, signature) { - if (!signature || !signature.declaration) { - return true; - } - const declaration = signature.declaration; - const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */); - if (!modifiers || declaration.kind !== 177 /* 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 & 4 /* Protected */) { - const containingType = getTypeOfNode(containingClass); - if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) { - return true; - } - } - if (modifiers & 2 /* Private */) { - error2(node, Diagnostics.Constructor_of_class_0_is_private_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; - } - return true; - } - function invocationErrorDetails(errorTarget, apparentType, kind) { - let errorInfo; - const isCall = kind === 0 /* Call */; - const awaitedType = getAwaitedType(apparentType); - const maybeMissingAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; - if (apparentType.flags & 1048576 /* Union */) { - const types = apparentType.types; - let hasSignatures2 = false; - for (const constituent of types) { - const signatures = getSignaturesOfType(constituent, kind); - if (signatures.length !== 0) { - hasSignatures2 = true; - if (errorInfo) { - break; - } - } else { - if (!errorInfo) { - errorInfo = chainDiagnosticMessages( - errorInfo, - isCall ? Diagnostics.Type_0_has_no_call_signatures : Diagnostics.Type_0_has_no_construct_signatures, - typeToString(constituent) - ); - errorInfo = chainDiagnosticMessages( - errorInfo, - isCall ? Diagnostics.Not_all_constituents_of_type_0_are_callable : Diagnostics.Not_all_constituents_of_type_0_are_constructable, - typeToString(apparentType) - ); - } - if (hasSignatures2) { - break; - } - } - } - if (!hasSignatures2) { - errorInfo = chainDiagnosticMessages( - /*details*/ - void 0, - isCall ? Diagnostics.No_constituent_of_type_0_is_callable : Diagnostics.No_constituent_of_type_0_is_constructable, - typeToString(apparentType) - ); - } - if (!errorInfo) { - errorInfo = chainDiagnosticMessages( - errorInfo, - isCall ? Diagnostics.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other : Diagnostics.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other, - typeToString(apparentType) - ); - } - } else { - errorInfo = chainDiagnosticMessages( - errorInfo, - isCall ? Diagnostics.Type_0_has_no_call_signatures : Diagnostics.Type_0_has_no_construct_signatures, - typeToString(apparentType) - ); - } - let headMessage = isCall ? Diagnostics.This_expression_is_not_callable : Diagnostics.This_expression_is_not_constructable; - if (isCallExpression(errorTarget.parent) && errorTarget.parent.arguments.length === 0) { - const { resolvedSymbol } = getNodeLinks(errorTarget); - if (resolvedSymbol && resolvedSymbol.flags & 32768 /* GetAccessor */) { - headMessage = Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without; - } - } - return { - messageChain: chainDiagnosticMessages(errorInfo, headMessage), - relatedMessage: maybeMissingAwait ? Diagnostics.Did_you_forget_to_use_await : void 0 - }; - } - function invocationError(errorTarget, apparentType, kind, relatedInformation) { - const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(errorTarget, apparentType, kind); - const diagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorTarget), errorTarget, messageChain); - if (relatedInfo) { - addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); - } - if (isCallExpression(errorTarget.parent)) { - const { start, length: length2 } = getDiagnosticSpanForCallNode(errorTarget.parent); - diagnostic.start = start; - diagnostic.length = length2; - } - diagnostics.add(diagnostic); - invocationErrorRecovery(apparentType, kind, relatedInformation ? addRelatedInfo(diagnostic, relatedInformation) : diagnostic); - } - function invocationErrorRecovery(apparentType, kind, diagnostic) { - if (!apparentType.symbol) { - return; - } - const importNode = getSymbolLinks(apparentType.symbol).originatingImport; - if (importNode && !isImportCall(importNode)) { - 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)); - } - } - function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) { - const tagType = checkExpression(node.tag); - const apparentType = getApparentType(tagType); - if (isErrorType(apparentType)) { - return resolveErrorCall(node); - } - const callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - const numConstructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */).length; - if (isUntypedFunctionCall(tagType, apparentType, callSignatures.length, numConstructSignatures)) { - return resolveUntypedCall(node); - } - if (!callSignatures.length) { - if (isArrayLiteralExpression(node.parent)) { - const diagnostic = createDiagnosticForNode(node.tag, Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); - diagnostics.add(diagnostic); - return resolveErrorCall(node); - } - invocationError(node.tag, apparentType, 0 /* Call */); - return resolveErrorCall(node); - } - return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */); - } - function getDiagnosticHeadMessageForDecoratorResolution(node) { - switch (node.parent.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 170 /* Parameter */: - return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 173 /* PropertyDeclaration */: - return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; - default: - return Debug.fail(); - } - } - function resolveDecorator(node, candidatesOutArray, checkMode) { - const funcType = checkExpression(node.expression); - const apparentType = getApparentType(funcType); - if (isErrorType(apparentType)) { - return resolveErrorCall(node); - } - const callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - const numConstructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */).length; - if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { - return resolveUntypedCall(node); - } - if (isPotentiallyUncalledDecorator(node, callSignatures) && !isParenthesizedExpression(node.expression)) { - const nodeStr = getTextOfNode( - node.expression, - /*includeTrivia*/ - false - ); - 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); - if (!callSignatures.length) { - const errorDetails = invocationErrorDetails(node.expression, apparentType, 0 /* Call */); - const messageChain = chainDiagnosticMessages(errorDetails.messageChain, headMessage); - const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node.expression), node.expression, messageChain); - if (errorDetails.relatedMessage) { - addRelatedInfo(diag2, createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); - } - diagnostics.add(diag2); - invocationErrorRecovery(apparentType, 0 /* Call */, diag2); - return resolveErrorCall(node); - } - return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */, headMessage); - } - function createSignatureForJSXIntrinsic(node, result) { - const namespace = getJsxNamespaceAt(node); - const exports2 = namespace && getExportsOfSymbol(namespace); - const typeSymbol = exports2 && getSymbol2(exports2, JsxNames.Element, 788968 /* Type */); - const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node); - const declaration = factory.createFunctionTypeNode( - /*typeParameters*/ - void 0, - [factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "props", - /*questionToken*/ - void 0, - nodeBuilder.typeToTypeNode(result, node) - )], - returnNode ? factory.createTypeReferenceNode( - returnNode, - /*typeArguments*/ - void 0 - ) : factory.createKeywordTypeNode(133 /* AnyKeyword */) - ); - const parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, "props"); - parameterSymbol.links.type = result; - return createSignature( - declaration, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [parameterSymbol], - typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType, - /*resolvedTypePredicate*/ - void 0, - 1, - 0 /* None */ - ); - } - function getJSXFragmentType(node) { - const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node)); - if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType; - const jsxFragmentFactoryName = getJsxNamespace(node); - const shouldResolveFactoryReference = (compilerOptions.jsx === 2 /* React */ || compilerOptions.jsxFragmentFactory !== void 0) && jsxFragmentFactoryName !== "null"; - if (!shouldResolveFactoryReference) return sourceFileLinks.jsxFragmentType = anyType; - const shouldModuleRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */; - const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0; - const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName( - node, - jsxFragmentFactoryName, - shouldModuleRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */, - /*nameNotFoundMessage*/ - jsxFactoryRefErr, - /*isUse*/ - true - ); - if (jsxFactorySymbol === void 0) return sourceFileLinks.jsxFragmentType = errorType; - if (jsxFactorySymbol.escapedName === ReactNames.Fragment) return sourceFileLinks.jsxFragmentType = getTypeOfSymbol(jsxFactorySymbol); - const resolvedAlias = (jsxFactorySymbol.flags & 2097152 /* Alias */) === 0 ? jsxFactorySymbol : resolveAlias(jsxFactorySymbol); - const reactExports = jsxFactorySymbol && getExportsOfSymbol(resolvedAlias); - const typeSymbol = reactExports && getSymbol2(reactExports, ReactNames.Fragment, 2 /* BlockScopedVariable */); - const type = typeSymbol && getTypeOfSymbol(typeSymbol); - return sourceFileLinks.jsxFragmentType = type === void 0 ? errorType : type; - } - function resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode) { - const isJsxOpenFragment = isJsxOpeningFragment(node); - let exprTypes; - if (!isJsxOpenFragment) { - if (isJsxIntrinsicTagName(node.tagName)) { - const result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); - const fakeSignature = createSignatureForJSXIntrinsic(node, result); - checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType( - node.attributes, - getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), - /*inferenceContext*/ - void 0, - 0 /* Normal */ - ), result, node.tagName, node.attributes); - if (length(node.typeArguments)) { - forEach(node.typeArguments, checkSourceElement); - diagnostics.add(createDiagnosticForNodeArray(getSourceFileOfNode(node), node.typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, 0, length(node.typeArguments))); - } - return fakeSignature; - } - exprTypes = checkExpression(node.tagName); - } else { - exprTypes = getJSXFragmentType(node); - } - const apparentType = getApparentType(exprTypes); - if (isErrorType(apparentType)) { - return resolveErrorCall(node); - } - const signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); - if (isUntypedFunctionCall( - exprTypes, - apparentType, - signatures.length, - /*constructSignatures*/ - 0 - )) { - return resolveUntypedCall(node); - } - if (signatures.length === 0) { - if (isJsxOpenFragment) { - error2(node, Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, getTextOfNode(node)); - } else { - 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 214 /* CallExpression */: - return resolveCallExpression(node, candidatesOutArray, checkMode); - case 215 /* NewExpression */: - return resolveNewExpression(node, candidatesOutArray, checkMode); - case 216 /* TaggedTemplateExpression */: - return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 171 /* Decorator */: - return resolveDecorator(node, candidatesOutArray, checkMode); - case 290 /* JsxOpeningFragment */: - case 287 /* JsxOpeningElement */: - case 286 /* JsxSelfClosingElement */: - return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); - case 227 /* BinaryExpression */: - return resolveInstanceofExpression(node, candidatesOutArray, checkMode); - } - Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); - } - function getResolvedSignature(node, candidatesOutArray, checkMode) { - const links = getNodeLinks(node); - const cached = links.resolvedSignature; - if (cached && cached !== resolvingSignature && !candidatesOutArray) { - return cached; - } - const saveResolutionStart = resolutionStart; - if (!cached) { - resolutionStart = resolutionTargets.length; - } - links.resolvedSignature = resolvingSignature; - const result = resolveSignature(node, candidatesOutArray, checkMode || 0 /* Normal */); - resolutionStart = saveResolutionStart; - if (result !== resolvingSignature) { - links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached; - } - return result; - } - function isJSConstructor(node) { - var _a; - if (!node || !isInJSFile(node)) { - return false; - } - const func = isFunctionDeclaration(node) || isFunctionExpression(node) ? node : (isVariableDeclaration(node) || isPropertyAssignment(node)) && node.initializer && isFunctionExpression(node.initializer) ? node.initializer : void 0; - if (func) { - if (getJSDocClassTag(node)) return true; - if (isPropertyAssignment(walkUpParenthesizedExpressions(func.parent))) return false; - const symbol = getSymbolOfDeclaration(func); - return !!((_a = symbol == null ? void 0 : symbol.members) == null ? void 0 : _a.size); - } - return false; - } - function mergeJSSymbols(target, source) { - var _a, _b; - if (source) { - const links = getSymbolLinks(source); - if (!links.inferredClassSymbol || !links.inferredClassSymbol.has(getSymbolId(target))) { - const inferred = isTransientSymbol(target) ? target : cloneSymbol(target); - inferred.exports = inferred.exports || createSymbolTable(); - inferred.members = inferred.members || createSymbolTable(); - inferred.flags |= source.flags & 32 /* Class */; - if ((_a = source.exports) == null ? void 0 : _a.size) { - mergeSymbolTable(inferred.exports, source.exports); - } - if ((_b = source.members) == null ? void 0 : _b.size) { - mergeSymbolTable(inferred.members, source.members); - } - (links.inferredClassSymbol || (links.inferredClassSymbol = /* @__PURE__ */ new Map())).set(getSymbolId(inferred), inferred); - return inferred; - } - return links.inferredClassSymbol.get(getSymbolId(target)); - } - } - function getAssignedClassSymbol(decl) { - var _a; - const assignmentSymbol = decl && getSymbolOfExpando( - decl, - /*allowDeclaration*/ - true - ); - const prototype = (_a = assignmentSymbol == null ? void 0 : assignmentSymbol.exports) == null ? void 0 : _a.get("prototype"); - const init = (prototype == null ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); - return init ? getSymbolOfDeclaration(init) : void 0; - } - function getSymbolOfExpando(node, allowDeclaration) { - if (!node.parent) { - return void 0; - } - let name; - let decl; - if (isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!isInJSFile(node) && !(isVarConstLike2(node.parent) && isFunctionLikeDeclaration(node))) { - return void 0; - } - name = node.parent.name; - decl = node.parent; - } else if (isBinaryExpression(node.parent)) { - const parentNode = node.parent; - const parentNodeOperator = node.parent.operatorToken.kind; - if (parentNodeOperator === 64 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) { - name = parentNode.left; - decl = name; - } else if (parentNodeOperator === 57 /* BarBarToken */ || parentNodeOperator === 61 /* QuestionQuestionToken */) { - if (isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { - name = parentNode.parent.name; - decl = parentNode.parent; - } else if (isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 64 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) { - name = parentNode.parent.left; - decl = name; - } - if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) { - return void 0; - } - } - } else if (allowDeclaration && isFunctionDeclaration(node)) { - name = node.name; - decl = node; - } - if (!decl || !name || !allowDeclaration && !getExpandoInitializer(node, isPrototypeAccess(name))) { - return void 0; - } - return getSymbolOfNode(decl); - } - function getAssignedJSPrototype(node) { - if (!node.parent) { - return false; - } - let parent2 = node.parent; - while (parent2 && parent2.kind === 212 /* PropertyAccessExpression */) { - parent2 = parent2.parent; - } - if (parent2 && isBinaryExpression(parent2) && isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 64 /* EqualsToken */) { - const right = getInitializerOfBinaryExpression(parent2); - return isObjectLiteralExpression(right) && right; - } - } - function checkCallExpression(node, checkMode) { - var _a, _b, _c; - checkGrammarTypeArguments(node, node.typeArguments); - const signature = getResolvedSignature( - node, - /*candidatesOutArray*/ - void 0, - checkMode - ); - if (signature === resolvingSignature) { - return silentNeverType; - } - checkDeprecatedSignature(signature, node); - if (node.expression.kind === 108 /* SuperKeyword */) { - return voidType; - } - if (node.kind === 215 /* NewExpression */) { - const declaration = signature.declaration; - if (declaration && declaration.kind !== 177 /* Constructor */ && declaration.kind !== 181 /* ConstructSignature */ && declaration.kind !== 186 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 177 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { - if (noImplicitAny) { - error2(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); - } - return anyType; - } - } - 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 === 214 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 245 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { - if (!isDottedName(node.expression)) { - error2(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); - } else if (!getEffectsSignature(node)) { - 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); - } - } - if (isInJSFile(node)) { - const jsSymbol = getSymbolOfExpando( - node, - /*allowDeclaration*/ - false - ); - if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) { - const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray); - jsAssignmentType.objectFlags |= 4096 /* JSLiteral */; - return getIntersectionType([returnType, jsAssignmentType]); - } - } - return returnType; - } - function checkDeprecatedSignature(signature, node) { - 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)); - } - } - function getDeprecatedSuggestionNode(node) { - node = skipParentheses(node); - switch (node.kind) { - case 214 /* CallExpression */: - case 171 /* Decorator */: - case 215 /* NewExpression */: - return getDeprecatedSuggestionNode(node.expression); - case 216 /* TaggedTemplateExpression */: - return getDeprecatedSuggestionNode(node.tag); - case 287 /* JsxOpeningElement */: - case 286 /* JsxSelfClosingElement */: - return getDeprecatedSuggestionNode(node.tagName); - case 213 /* ElementAccessExpression */: - return node.argumentExpression; - case 212 /* PropertyAccessExpression */: - return node.name; - case 184 /* TypeReference */: - const typeReference = node; - return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; - default: - return node; - } - } - function isSymbolOrSymbolForCall(node) { - if (!isCallExpression(node)) return false; - let left = node.expression; - if (isPropertyAccessExpression(left) && left.name.escapedText === "for") { - left = left.expression; - } - if (!isIdentifier(left) || left.escapedText !== "Symbol") { - return false; - } - const globalESSymbol = getGlobalESSymbolConstructorSymbol( - /*reportErrors*/ - false - ); - if (!globalESSymbol) { - return false; - } - return globalESSymbol === resolveName( - left, - "Symbol", - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - } - function checkImportCallExpression(node) { - checkGrammarImportCallExpression(node); - if (node.arguments.length === 0) { - return createPromiseReturnType(node, anyType); - } - const specifier = node.arguments[0]; - const specifierType = checkExpressionCached(specifier); - const optionsType = node.arguments.length > 1 ? checkExpressionCached(node.arguments[1]) : void 0; - for (let i = 2; i < node.arguments.length; ++i) { - checkExpressionCached(node.arguments[i]); - } - if (specifierType.flags & 32768 /* Undefined */ || specifierType.flags & 65536 /* Null */ || !isTypeAssignableTo(specifierType, stringType)) { - error2(specifier, Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType)); - } - if (optionsType) { - const importCallOptionsType = getGlobalImportCallOptionsType( - /*reportErrors*/ - true - ); - if (importCallOptionsType !== emptyObjectType) { - checkTypeAssignableTo(optionsType, getNullableType(importCallOptionsType, 32768 /* Undefined */), node.arguments[1]); - } - } - const moduleSymbol = resolveExternalModuleName(node, specifier); - if (moduleSymbol) { - const esModuleSymbol = resolveESModuleSymbol( - moduleSymbol, - specifier, - /*dontResolveAlias*/ - true, - /*suppressInteropError*/ - false - ); - if (esModuleSymbol) { - return createPromiseReturnType( - node, - getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) || getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) - ); - } - } - return createPromiseReturnType(node, anyType); - } - function createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol) { - const memberTable = createSymbolTable(); - const newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); - newSymbol.parent = originalSymbol; - newSymbol.links.nameType = getStringLiteralType("default"); - newSymbol.links.aliasTarget = resolveSymbol(symbol); - memberTable.set("default" /* Default */, newSymbol); - return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray); - } - function getTypeWithSyntheticDefaultOnly(type, symbol, originalSymbol, moduleSpecifier) { - const hasDefaultOnly = isOnlyImportableAsDefault(moduleSpecifier); - if (hasDefaultOnly && type && !isErrorType(type)) { - const synthType = type; - if (!synthType.defaultOnlyType) { - const type2 = createDefaultPropertyWrapperForModule(symbol, originalSymbol); - synthType.defaultOnlyType = type2; - } - return synthType.defaultOnlyType; - } - return void 0; - } - function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) { - var _a; - if (allowSyntheticDefaultImports && type && !isErrorType(type)) { - const synthType = type; - if (!synthType.syntheticType) { - const file = (_a = originalSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - const hasSyntheticDefault = canHaveSyntheticDefault( - file, - originalSymbol, - /*dontResolveAlias*/ - false, - moduleSpecifier - ); - if (hasSyntheticDefault) { - const anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); - const defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol); - anonymousSymbol.links.type = defaultContainingObject; - synthType.syntheticType = isValidSpreadType(type) ? getSpreadType( - type, - defaultContainingObject, - anonymousSymbol, - /*objectFlags*/ - 0, - /*readonly*/ - false - ) : defaultContainingObject; - } else { - synthType.syntheticType = type; - } - } - return synthType.syntheticType; - } - return type; - } - function isCommonJsRequire(node) { - if (!isRequireCall( - node, - /*requireStringLiteralLikeArgument*/ - true - )) { - return false; - } - if (!isIdentifier(node.expression)) return Debug.fail(); - const resolvedRequire = resolveName( - node.expression, - node.expression.escapedText, - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (resolvedRequire === requireSymbol) { - return true; - } - if (resolvedRequire.flags & 2097152 /* Alias */) { - return false; - } - const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 263 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 261 /* VariableDeclaration */ : 0 /* Unknown */; - if (targetDeclarationKind !== 0 /* Unknown */) { - const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind); - return !!decl && !!(decl.flags & 33554432 /* Ambient */); - } - return false; - } - function checkTaggedTemplateExpression(node) { - if (!checkGrammarTaggedTemplateChain(node)) checkGrammarTypeArguments(node, node.typeArguments); - if (languageVersion < LanguageFeatureMinimumTarget.TaggedTemplates) { - checkExternalEmitHelpers(node, 262144 /* MakeTemplateObject */); - } - const signature = getResolvedSignature(node); - checkDeprecatedSignature(signature, node); - return getReturnTypeOfSignature(signature); - } - function checkAssertion(node, checkMode) { - if (node.kind === 217 /* 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); - } - if (compilerOptions.erasableSyntaxOnly) { - const start = skipTrivia(file.text, node.pos); - const end = node.expression.pos; - diagnostics.add(createFileDiagnostic(file, start, end - start, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)); - } - } - return checkAssertionWorker(node, checkMode); - } - function isValidConstAssertionArgument(node) { - switch (node.kind) { - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 210 /* ArrayLiteralExpression */: - case 211 /* ObjectLiteralExpression */: - case 229 /* TemplateExpression */: - return true; - case 218 /* ParenthesizedExpression */: - return isValidConstAssertionArgument(node.expression); - case 225 /* 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 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - const expr = skipParentheses(node.expression); - const symbol = isEntityNameExpression(expr) ? resolveEntityName( - expr, - 111551 /* Value */, - /*ignoreErrors*/ - true - ) : void 0; - return !!(symbol && symbol.flags & 384 /* Enum */); - } - return false; - } - function checkAssertionWorker(node, checkMode) { - const { type, expression } = getAssertionTypeAndExpression(node); - const exprType = checkExpression(expression, checkMode); - if (isConstTypeReference(type)) { - if (!isValidConstAssertionArgument(expression)) { - 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); - } - const links = getNodeLinks(node); - links.assertionExpressionType = exprType; - checkSourceElement(type); - checkNodeDeferred(node); - return getTypeFromTypeNode(type); - } - function getAssertionTypeAndExpression(node) { - let type; - let expression; - switch (node.kind) { - case 235 /* AsExpression */: - case 217 /* TypeAssertionExpression */: - type = node.type; - expression = node.expression; - break; - case 218 /* ParenthesizedExpression */: - type = getJSDocTypeAssertionType(node); - expression = node.expression; - break; - } - return { type, expression }; - } - function checkAssertionDeferred(node) { - const { type } = getAssertionTypeAndExpression(node); - const errNode = isParenthesizedExpression(node) ? type : node; - const links = getNodeLinks(node); - Debug.assertIsDefined(links.assertionExpressionType); - const exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(links.assertionExpressionType)); - const targetType = getTypeFromTypeNode(type); - if (!isErrorType(targetType)) { - 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); - } - }); - } - } - function checkNonNullChain(node) { - const leftType = checkExpression(node.expression); - const nonOptionalType = getOptionalExpressionType(leftType, node.expression); - return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); - } - function checkNonNullAssertion(node) { - return node.flags & 64 /* OptionalChain */ ? checkNonNullChain(node) : getNonNullableType(checkExpression(node.expression)); - } - function checkExpressionWithTypeArguments(node) { - checkGrammarExpressionWithTypeArguments(node); - forEach(node.typeArguments, checkSourceElement); - if (node.kind === 234 /* ExpressionWithTypeArguments */) { - const parent2 = walkUpParenthesizedExpressions(node.parent); - if (parent2.kind === 227 /* 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 === 234 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); - return getInstantiationExpressionType(exprType, node); - } - function getInstantiationExpressionType(exprType, node) { - const typeArguments = node.typeArguments; - if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) { - return exprType; - } - const links = getNodeLinks(node); - if (!links.instantiationExpressionTypes) { - links.instantiationExpressionTypes = /* @__PURE__ */ new Map(); - } - if (links.instantiationExpressionTypes.has(exprType.id)) { - return links.instantiationExpressionTypes.get(exprType.id); - } - let hasSomeApplicableSignature = false; - let nonApplicableType; - const result = getInstantiatedType(exprType); - links.instantiationExpressionTypes.set(exprType.id, result); - const errorType2 = hasSomeApplicableSignature ? nonApplicableType : exprType; - if (errorType2) { - diagnostics.add(createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType2))); - } - return result; - function getInstantiatedType(type) { - let hasSignatures2 = false; - let hasApplicableSignature = false; - const result2 = getInstantiatedTypePart(type); - hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature); - if (hasSignatures2 && !hasApplicableSignature) { - nonApplicableType ?? (nonApplicableType = type); - } - return result2; - function getInstantiatedTypePart(type2) { - if (type2.flags & 524288 /* Object */) { - const resolved = resolveStructuredTypeMembers(type2); - const callSignatures = getInstantiatedSignatures(resolved.callSignatures); - const constructSignatures = getInstantiatedSignatures(resolved.constructSignatures); - hasSignatures2 || (hasSignatures2 = 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(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos); - result3.objectFlags |= 8388608 /* InstantiationExpressionType */; - result3.node = node; - return result3; - } - } else if (type2.flags & 58982400 /* InstantiableNonPrimitive */) { - const constraint = getBaseConstraintOfType(type2); - if (constraint) { - const instantiated = getInstantiatedTypePart(constraint); - if (instantiated !== constraint) { - return instantiated; - } - } - } else if (type2.flags & 1048576 /* Union */) { - return mapType(type2, getInstantiatedType); - } else if (type2.flags & 2097152 /* Intersection */) { - return getIntersectionType(sameMap(type2.types, getInstantiatedTypePart)); - } - return type2; - } - } - function getInstantiatedSignatures(signatures) { - const applicableSignatures = filter(signatures, (sig) => !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments)); - return sameMap(applicableSignatures, (sig) => { - const typeArgumentTypes = checkTypeArguments( - sig, - typeArguments, - /*reportErrors*/ - true - ); - return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, isInJSFile(sig.declaration)) : sig; - }); - } - } - function checkSatisfiesExpression(node) { - checkSourceElement(node.type); - return checkSatisfiesExpressionWorker(node.expression, node.type); - } - function checkSatisfiesExpressionWorker(expression, target, checkMode) { - const exprType = checkExpression(expression, checkMode); - const targetType = getTypeFromTypeNode(target); - if (isErrorType(targetType)) { - return targetType; - } - const errorNode = findAncestor(target.parent, (n) => n.kind === 239 /* SatisfiesExpression */ || n.kind === 351 /* JSDocSatisfiesTag */); - checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, errorNode, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); - return exprType; - } - function checkMetaProperty(node) { - checkGrammarMetaProperty(node); - if (node.keywordToken === 105 /* NewKeyword */) { - return checkNewTargetMetaProperty(node); - } - if (node.keywordToken === 102 /* ImportKeyword */) { - if (node.name.escapedText === "defer") { - Debug.assert(!isCallExpression(node.parent) || node.parent.expression !== node, "Trying to get the type of `import.defer` in `import.defer(...)`"); - return errorType; - } - return checkImportMetaProperty(node); - } - return Debug.assertNever(node.keywordToken); - } - function checkMetaPropertyKeyword(node) { - switch (node.keywordToken) { - case 102 /* ImportKeyword */: - return getGlobalImportMetaExpressionType(); - case 105 /* NewKeyword */: - const type = checkNewTargetMetaProperty(node); - return isErrorType(type) ? errorType : createNewTargetExpressionType(type); - default: - Debug.assertNever(node.keywordToken); - } - } - function checkNewTargetMetaProperty(node) { - const container = getNewTargetContainer(node); - if (!container) { - 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 === 177 /* Constructor */) { - const symbol = getSymbolOfDeclaration(container.parent); - return getTypeOfSymbol(symbol); - } else { - const symbol = getSymbolOfDeclaration(container); - return getTypeOfSymbol(symbol); - } - } - function checkImportMetaProperty(node) { - if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) { - if (getSourceFileOfNode(node).impliedNodeFormat !== 99 /* ESNext */) { - 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 */) { - error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext); - } - const file = getSourceFileOfNode(node); - 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 declaration = symbol.valueDeclaration; - return addOptionality( - getTypeOfSymbol(symbol), - /*isProperty*/ - false, - /*isOptional*/ - !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration)) - ); - } - function getTupleElementLabelFromBindingElement(node, index, elementFlags) { - switch (node.name.kind) { - case 80 /* Identifier */: { - const name = node.name.escapedText; - if (node.dotDotDotToken) { - return elementFlags & 12 /* Variable */ ? name : `${name}_${index}`; - } else { - return elementFlags & 3 /* Fixed */ ? name : `${name}_n`; - } - } - case 208 /* ArrayBindingPattern */: { - if (node.dotDotDotToken) { - const elements = node.name.elements; - const lastElement = tryCast(lastOrUndefined(elements), isBindingElement); - const elementCount = elements.length - ((lastElement == null ? void 0 : lastElement.dotDotDotToken) ? 1 : 0); - if (index < elementCount) { - const element = elements[index]; - if (isBindingElement(element)) { - return getTupleElementLabelFromBindingElement(element, index, elementFlags); - } - } else if (lastElement == null ? void 0 : lastElement.dotDotDotToken) { - return getTupleElementLabelFromBindingElement(lastElement, index - elementCount, elementFlags); - } - } - break; - } - } - return `arg_${index}`; - } - function getTupleElementLabel(d, index = 0, elementFlags = 3 /* Fixed */, restSymbol) { - if (!d) { - const restParameter = tryCast(restSymbol == null ? void 0 : restSymbol.valueDeclaration, isParameter); - return restParameter ? getTupleElementLabelFromBindingElement(restParameter, index, elementFlags) : `${(restSymbol == null ? void 0 : restSymbol.escapedName) ?? "arg"}_${index}`; - } - Debug.assert(isIdentifier(d.name)); - return d.name.escapedText; - } - function getParameterNameAtPosition(signature, pos, overrideRestType) { - var _a; - const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); - if (pos < paramCount) { - return signature.parameters[pos].escapedName; - } - const restParameter = signature.parameters[paramCount] || unknownSymbol; - const restType = overrideRestType || getTypeOfSymbol(restParameter); - if (isTupleType(restType)) { - const tupleType = restType.target; - const index = pos - paramCount; - const associatedName = (_a = tupleType.labeledElementDeclarations) == null ? void 0 : _a[index]; - const elementFlags = tupleType.elementFlags[index]; - return getTupleElementLabel(associatedName, index, elementFlags, restParameter); - } - return restParameter.escapedName; - } - function getParameterIdentifierInfoAtPosition(signature, pos) { - var _a; - if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 318 /* JSDocFunctionType */) { - return void 0; - } - const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); - if (pos < paramCount) { - const param = signature.parameters[pos]; - const paramIdent = getParameterDeclarationIdentifier(param); - return paramIdent ? { - parameter: paramIdent, - parameterName: param.escapedName, - isRestParameter: false - } : void 0; - } - const restParameter = signature.parameters[paramCount] || unknownSymbol; - const restIdent = getParameterDeclarationIdentifier(restParameter); - if (!restIdent) { - return void 0; - } - const restType = getTypeOfSymbol(restParameter); - if (isTupleType(restType)) { - const associatedNames = restType.target.labeledElementDeclarations; - const index = pos - paramCount; - const associatedName = associatedNames == null ? void 0 : associatedNames[index]; - const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken); - if (associatedName) { - Debug.assert(isIdentifier(associatedName.name)); - return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement }; - } - return void 0; - } - if (pos === paramCount) { - return { parameter: restIdent, parameterName: restParameter.escapedName, isRestParameter: true }; - } - return void 0; - } - function getParameterDeclarationIdentifier(symbol) { - return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name) && symbol.valueDeclaration.name; - } - function isValidDeclarationForTupleLabel(d) { - return d.kind === 203 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name); - } - function getNameableDeclarationAtPosition(signature, pos) { - const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); - if (pos < paramCount) { - const decl = signature.parameters[pos].valueDeclaration; - return decl && isValidDeclarationForTupleLabel(decl) ? decl : void 0; - } - const restParameter = signature.parameters[paramCount] || unknownSymbol; - const restType = getTypeOfSymbol(restParameter); - if (isTupleType(restType)) { - const associatedNames = restType.target.labeledElementDeclarations; - const index = pos - paramCount; - return associatedNames && associatedNames[index]; - } - return restParameter.valueDeclaration && isValidDeclarationForTupleLabel(restParameter.valueDeclaration) ? restParameter.valueDeclaration : void 0; - } - function getTypeAtPosition(signature, pos) { - return tryGetTypeAtPosition(signature, pos) || anyType; - } - function tryGetTypeAtPosition(signature, pos) { - const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); - if (pos < paramCount) { - return getTypeOfParameter(signature.parameters[pos]); - } - if (signatureHasRestParameter(signature)) { - const restType = getTypeOfSymbol(signature.parameters[paramCount]); - const index = pos - paramCount; - if (!isTupleType(restType) || restType.target.combinedFlags & 12 /* Variable */ || index < restType.target.fixedLength) { - return getIndexedAccessType(restType, getNumberLiteralType(index)); - } - } - return void 0; - } - function getRestTypeAtPosition(source, pos, readonly) { - const parameterCount = getParameterCount(source); - const minArgumentCount = getMinArgumentCount(source); - const restType = getEffectiveRestType(source); - if (restType && pos >= parameterCount - 1) { - return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType)); - } - const types = []; - const flags = []; - const names = []; - for (let i = pos; i < parameterCount; i++) { - if (!restType || i < parameterCount - 1) { - types.push(getTypeAtPosition(source, i)); - flags.push(i < minArgumentCount ? 1 /* Required */ : 2 /* Optional */); - } else { - types.push(restType); - flags.push(8 /* Variadic */); - } - names.push(getNameableDeclarationAtPosition(source, i)); - } - return createTupleType(types, flags, readonly, names); - } - function getRestOrAnyTypeAtPosition(source, pos) { - const restType = getRestTypeAtPosition(source, pos); - const elementType = restType && getElementTypeOfArrayType(restType); - return elementType && isTypeAny(elementType) ? anyType : restType; - } - function getParameterCount(signature) { - const length2 = signature.parameters.length; - if (signatureHasRestParameter(signature)) { - const restType = getTypeOfSymbol(signature.parameters[length2 - 1]); - if (isTupleType(restType)) { - return length2 + restType.target.fixedLength - (restType.target.combinedFlags & 12 /* Variable */ ? 0 : 1); - } - } - return length2; - } - function getMinArgumentCount(signature, flags) { - const strongArityForUntypedJS = flags & 1 /* StrongArityForUntypedJS */; - const voidIsNonOptional = flags & 2 /* VoidIsNonOptional */; - if (voidIsNonOptional || signature.resolvedMinArgumentCount === void 0) { - let minArgumentCount; - if (signatureHasRestParameter(signature)) { - const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (isTupleType(restType)) { - const firstOptionalIndex = findIndex(restType.target.elementFlags, (f) => !(f & 1 /* Required */)); - const requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; - if (requiredCount > 0) { - minArgumentCount = signature.parameters.length - 1 + requiredCount; - } - } - } - if (minArgumentCount === void 0) { - if (!strongArityForUntypedJS && signature.flags & 32 /* IsUntypedSignatureInJSFile */) { - return 0; - } - minArgumentCount = signature.minArgumentCount; - } - if (voidIsNonOptional) { - return minArgumentCount; - } - for (let i = minArgumentCount - 1; i >= 0; i--) { - const type = getTypeAtPosition(signature, i); - if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { - break; - } - minArgumentCount = i; - } - signature.resolvedMinArgumentCount = minArgumentCount; - } - return signature.resolvedMinArgumentCount; - } - function hasEffectiveRestParameter(signature) { - if (signatureHasRestParameter(signature)) { - const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - return !isTupleType(restType) || !!(restType.target.combinedFlags & 12 /* Variable */); - } - return false; - } - function getEffectiveRestType(signature) { - if (signatureHasRestParameter(signature)) { - const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (!isTupleType(restType)) { - return isTypeAny(restType) ? anyArrayType : restType; - } - if (restType.target.combinedFlags & 12 /* Variable */) { - return sliceTupleType(restType, restType.target.fixedLength); - } - } - return void 0; - } - function getNonArrayRestType(signature) { - const restType = getEffectiveRestType(signature); - return restType && !isArrayType(restType) && !isTypeAny(restType) ? restType : void 0; - } - function getTypeOfFirstParameterOfSignature(signature) { - return getTypeOfFirstParameterOfSignatureWithFallback(signature, neverType); - } - function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) { - return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType; - } - function inferFromAnnotatedParametersAndReturn(signature, context, inferenceContext) { - const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); - for (let i = 0; i < len; i++) { - const declaration = signature.parameters[i].valueDeclaration; - const typeNode2 = getEffectiveTypeAnnotationNode(declaration); - if (typeNode2) { - const source = addOptionality( - getTypeFromTypeNode(typeNode2), - /*isProperty*/ - false, - isOptionalDeclaration(declaration) - ); - const target = getTypeAtPosition(context, i); - inferTypes(inferenceContext.inferences, source, target); - } - } - const typeNode = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); - if (typeNode) { - const source = getTypeFromTypeNode(typeNode); - const target = getReturnTypeOfSignature(context); - inferTypes(inferenceContext.inferences, source, target); - } - } - function assignContextualParameterTypes(signature, context) { - if (context.typeParameters) { - if (!signature.typeParameters) { - signature.typeParameters = context.typeParameters; - } else { - return; - } - } - if (context.thisParameter) { - const parameter = signature.thisParameter; - if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { - if (!parameter) { - signature.thisParameter = createSymbolWithType( - context.thisParameter, - /*type*/ - void 0 - ); - } - assignParameterType(signature.thisParameter, getTypeOfSymbol(context.thisParameter)); - } - } - const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); - for (let i = 0; i < len; i++) { - const parameter = signature.parameters[i]; - 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)) { - const parameter = last(signature.parameters); - if (parameter.valueDeclaration ? !getEffectiveTypeAnnotationNode(parameter.valueDeclaration) : !!(getCheckFlags(parameter) & 65536 /* DeferredType */)) { - const contextualParameterType = getRestTypeAtPosition(context, len); - assignParameterType(parameter, contextualParameterType); - } - } - } - function assignNonContextualParameterTypes(signature) { - if (signature.thisParameter) { - assignParameterType(signature.thisParameter); - } - for (const parameter of signature.parameters) { - assignParameterType(parameter); - } - } - function assignParameterType(parameter, contextualType) { - const links = getSymbolLinks(parameter); - if (!links.type) { - const declaration = parameter.valueDeclaration; - 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 (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, - /*noTupleBoundsCheck*/ - false - ); - if (element.name.kind === 80 /* Identifier */) { - getSymbolLinks(getSymbolOfDeclaration(element)).type = type; - } else { - assignBindingElementTypes(element.name, type); - } - } - } - } - function createClassDecoratorContextType(classType) { - return tryCreateTypeReference(getGlobalClassDecoratorContextType( - /*reportErrors*/ - true - ), [classType]); - } - function createClassMethodDecoratorContextType(thisType, valueType) { - return tryCreateTypeReference(getGlobalClassMethodDecoratorContextType( - /*reportErrors*/ - true - ), [thisType, valueType]); - } - function createClassGetterDecoratorContextType(thisType, valueType) { - return tryCreateTypeReference(getGlobalClassGetterDecoratorContextType( - /*reportErrors*/ - true - ), [thisType, valueType]); - } - function createClassSetterDecoratorContextType(thisType, valueType) { - return tryCreateTypeReference(getGlobalClassSetterDecoratorContextType( - /*reportErrors*/ - true - ), [thisType, valueType]); - } - function createClassAccessorDecoratorContextType(thisType, valueType) { - return tryCreateTypeReference(getGlobalClassAccessorDecoratorContextType( - /*reportErrors*/ - true - ), [thisType, valueType]); - } - function createClassFieldDecoratorContextType(thisType, valueType) { - return tryCreateTypeReference(getGlobalClassFieldDecoratorContextType( - /*reportErrors*/ - true - ), [thisType, valueType]); - } - function getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2) { - const key = `${isPrivate ? "p" : "P"}${isStatic2 ? "s" : "S"}${nameType.id}`; - let overrideType = decoratorContextOverrideTypeCache.get(key); - if (!overrideType) { - const members = createSymbolTable(); - members.set("name", createProperty("name", nameType)); - members.set("private", createProperty("private", isPrivate ? trueType : falseType)); - members.set("static", createProperty("static", isStatic2 ? trueType : falseType)); - overrideType = createAnonymousType( - /*symbol*/ - void 0, - members, - emptyArray, - emptyArray, - emptyArray - ); - decoratorContextOverrideTypeCache.set(key, overrideType); - } - return overrideType; - } - function createClassMemberDecoratorContextTypeForNode(node, thisType, valueType) { - const isStatic2 = hasStaticModifier(node); - const isPrivate = isPrivateIdentifier(node.name); - const nameType = isPrivate ? getStringLiteralType(idText(node.name)) : getLiteralTypeFromPropertyName(node.name); - const contextType = isMethodDeclaration(node) ? createClassMethodDecoratorContextType(thisType, valueType) : isGetAccessorDeclaration(node) ? createClassGetterDecoratorContextType(thisType, valueType) : isSetAccessorDeclaration(node) ? createClassSetterDecoratorContextType(thisType, valueType) : isAutoAccessorPropertyDeclaration(node) ? createClassAccessorDecoratorContextType(thisType, valueType) : isPropertyDeclaration(node) ? createClassFieldDecoratorContextType(thisType, valueType) : Debug.failBadSyntaxKind(node); - const overrideType = getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2); - return getIntersectionType([contextType, overrideType]); - } - function createClassAccessorDecoratorTargetType(thisType, valueType) { - return tryCreateTypeReference(getGlobalClassAccessorDecoratorTargetType( - /*reportErrors*/ - true - ), [thisType, valueType]); - } - function createClassAccessorDecoratorResultType(thisType, valueType) { - return tryCreateTypeReference(getGlobalClassAccessorDecoratorResultType( - /*reportErrors*/ - true - ), [thisType, valueType]); - } - function createClassFieldDecoratorInitializerMutatorType(thisType, valueType) { - const thisParam = createParameter2("this", thisType); - const valueParam = createParameter2("value", valueType); - return createFunctionType( - /*typeParameters*/ - void 0, - thisParam, - [valueParam], - valueType, - /*typePredicate*/ - void 0, - 1 - ); - } - function createESDecoratorCallSignature(targetType, contextType, nonOptionalReturnType) { - const targetParam = createParameter2("target", targetType); - const contextParam = createParameter2("context", contextType); - const returnType = getUnionType([nonOptionalReturnType, voidType]); - return createCallSignature( - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [targetParam, contextParam], - returnType - ); - } - function getESDecoratorCallSignature(decorator) { - const { parent: parent2 } = decorator; - const links = getNodeLinks(parent2); - if (!links.decoratorSignature) { - links.decoratorSignature = anySignature; - switch (parent2.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: { - const node = parent2; - const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); - const contextType = createClassDecoratorContextType(targetType); - links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); - break; - } - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: { - const node = parent2; - if (!isClassLike(node.parent)) break; - const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); - const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); - const targetType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; - const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); - const returnType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; - links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); - break; - } - case 173 /* PropertyDeclaration */: { - const node = parent2; - if (!isClassLike(node.parent)) break; - const valueType = getTypeOfNode(node); - const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); - const targetType = hasAccessorModifier(node) ? createClassAccessorDecoratorTargetType(thisType, valueType) : undefinedType; - const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); - const returnType = hasAccessorModifier(node) ? createClassAccessorDecoratorResultType(thisType, valueType) : createClassFieldDecoratorInitializerMutatorType(thisType, valueType); - links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); - break; - } - } - } - return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; - } - function getLegacyDecoratorCallSignature(decorator) { - const { parent: parent2 } = decorator; - const links = getNodeLinks(parent2); - if (!links.decoratorSignature) { - links.decoratorSignature = anySignature; - switch (parent2.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: { - const node = parent2; - const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); - const targetParam = createParameter2("target", targetType); - links.decoratorSignature = createCallSignature( - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [targetParam], - getUnionType([targetType, voidType]) - ); - break; - } - case 170 /* Parameter */: { - const node = parent2; - if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { - break; - } - if (getThisParameter(node.parent) === node) { - break; - } - const index = getThisParameter(node.parent) ? node.parent.parameters.indexOf(node) - 1 : node.parent.parameters.indexOf(node); - Debug.assert(index >= 0); - 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 = createParameter2("target", targetType); - const keyParam = createParameter2("propertyKey", keyType); - const indexParam = createParameter2("parameterIndex", indexType); - links.decoratorSignature = createCallSignature( - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [targetParam, keyParam, indexParam], - voidType - ); - break; - } - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 173 /* PropertyDeclaration */: { - const node = parent2; - if (!isClassLike(node.parent)) break; - const targetType = getParentTypeOfClassElement(node); - const targetParam = createParameter2("target", targetType); - const keyType = getClassElementPropertyKeyType(node); - const keyParam = createParameter2("propertyKey", keyType); - const returnType = isPropertyDeclaration(node) ? voidType : createTypedPropertyDescriptorType(getTypeOfNode(node)); - const hasPropDesc = !isPropertyDeclaration(parent2) || hasAccessorModifier(parent2); - if (hasPropDesc) { - const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node)); - const descriptorParam = createParameter2("descriptor", descriptorType); - links.decoratorSignature = createCallSignature( - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [targetParam, keyParam, descriptorParam], - getUnionType([returnType, voidType]) - ); - } else { - links.decoratorSignature = createCallSignature( - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [targetParam, keyParam], - getUnionType([returnType, voidType]) - ); - } - break; - } - } - } - return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; - } - function getDecoratorCallSignature(decorator) { - return legacyDecorators ? getLegacyDecoratorCallSignature(decorator) : getESDecoratorCallSignature(decorator); - } - function createPromiseType(promisedType) { - const globalPromiseType = getGlobalPromiseType( - /*reportErrors*/ - true - ); - if (globalPromiseType !== emptyGenericType) { - promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType; - return createTypeReference(globalPromiseType, [promisedType]); - } - return unknownType; - } - function createPromiseLikeType(promisedType) { - const globalPromiseLikeType = getGlobalPromiseLikeType( - /*reportErrors*/ - true - ); - if (globalPromiseLikeType !== emptyGenericType) { - promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType; - return createTypeReference(globalPromiseLikeType, [promisedType]); - } - return unknownType; - } - function createPromiseReturnType(func, promisedType) { - const promiseType = createPromiseType(promisedType); - if (promiseType === unknownType) { - 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 - )) { - error2( - func, - isImportCall(func) ? Diagnostics.A_dynamic_import_call_in_ES5_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_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option - ); - } - return promiseType; - } - function createNewTargetExpressionType(targetType) { - const symbol = createSymbol(0 /* None */, "NewTargetExpression"); - const targetPropertySymbol = createSymbol(4 /* Property */, "target", 8 /* Readonly */); - targetPropertySymbol.parent = symbol; - targetPropertySymbol.links.type = targetType; - const members = createSymbolTable([targetPropertySymbol]); - symbol.members = members; - return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray); - } - function getReturnTypeFromBody(func, checkMode) { - if (!func.body) { - return errorType; - } - const functionFlags = getFunctionFlags(func); - const isAsync = (functionFlags & 2 /* Async */) !== 0; - const isGenerator = (functionFlags & 1 /* Generator */) !== 0; - let returnType; - let yieldType; - let nextType; - let fallbackReturnType = voidType; - if (func.body.kind !== 242 /* Block */) { - returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); - if (isAsync) { - returnType = unwrapAwaitedType(checkAwaitedType( - returnType, - /*withAlias*/ - false, - /*errorNode*/ - func, - Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member - )); - } - } else if (isGenerator) { - const returnTypes = checkAndAggregateReturnExpressionTypes(func, checkMode); - if (!returnTypes) { - fallbackReturnType = neverType; - } else if (returnTypes.length > 0) { - returnType = getUnionType(returnTypes, 2 /* Subtype */); - } - const { yieldTypes, nextTypes } = checkAndAggregateYieldOperandTypes(func, checkMode); - yieldType = some(yieldTypes) ? getUnionType(yieldTypes, 2 /* Subtype */) : void 0; - nextType = some(nextTypes) ? getIntersectionType(nextTypes) : void 0; - } else { - const types = checkAndAggregateReturnExpressionTypes(func, checkMode); - if (!types) { - return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, neverType) : neverType; - } - if (types.length === 0) { - const contextualReturnType = getContextualReturnType( - func, - /*contextFlags*/ - void 0 - ); - const returnType2 = contextualReturnType && (unwrapReturnType(contextualReturnType, functionFlags) || voidType).flags & 32768 /* Undefined */ ? undefinedType : voidType; - return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, returnType2) : ( - // Async function - returnType2 - ); - } - returnType = getUnionType(types, 2 /* Subtype */); - } - if (returnType || yieldType || nextType) { - if (yieldType) reportErrorsFromWidening(func, yieldType, 3 /* GeneratorYield */); - if (returnType) reportErrorsFromWidening(func, returnType, 1 /* FunctionReturn */); - if (nextType) reportErrorsFromWidening(func, nextType, 2 /* GeneratorNext */); - if (returnType && isUnitType(returnType) || yieldType && isUnitType(yieldType) || nextType && isUnitType(nextType)) { - const contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); - const contextualType = !contextualSignature ? void 0 : contextualSignature === getSignatureFromDeclaration(func) ? isGenerator ? void 0 : returnType : instantiateContextualType( - getReturnTypeOfSignature(contextualSignature), - func, - /*contextFlags*/ - void 0 - ); - if (isGenerator) { - yieldType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(yieldType, contextualType, 0 /* Yield */, isAsync); - returnType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(returnType, contextualType, 1 /* Return */, isAsync); - nextType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(nextType, contextualType, 2 /* Next */, isAsync); - } else { - returnType = getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(returnType, contextualType, isAsync); - } - } - if (yieldType) yieldType = getWidenedType(yieldType); - if (returnType) returnType = getWidenedType(returnType); - if (nextType) nextType = getWidenedType(nextType); - } - if (isGenerator) { - return createGeneratorType( - yieldType || neverType, - returnType || fallbackReturnType, - nextType || getContextualIterationType(2 /* Next */, func) || unknownType, - isAsync - ); - } else { - return isAsync ? createPromiseType(returnType || fallbackReturnType) : returnType || fallbackReturnType; - } - } - function createGeneratorType(yieldType, returnType, nextType, isAsyncGenerator) { - const resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver; - const globalGeneratorType = resolver.getGlobalGeneratorType( - /*reportErrors*/ - false - ); - yieldType = resolver.resolveIterationType( - yieldType, - /*errorNode*/ - void 0 - ) || unknownType; - returnType = resolver.resolveIterationType( - returnType, - /*errorNode*/ - void 0 - ) || unknownType; - if (globalGeneratorType === emptyGenericType) { - const globalIterableIteratorType = resolver.getGlobalIterableIteratorType( - /*reportErrors*/ - false - ); - if (globalIterableIteratorType !== emptyGenericType) { - return createTypeFromGenericGlobalType(globalIterableIteratorType, [yieldType, returnType, nextType]); - } - resolver.getGlobalIterableIteratorType( - /*reportErrors*/ - true - ); - return emptyObjectType; - } - return createTypeFromGenericGlobalType(globalGeneratorType, [yieldType, returnType, nextType]); - } - function checkAndAggregateYieldOperandTypes(func, checkMode) { - const yieldTypes = []; - const nextTypes = []; - const isAsync = (getFunctionFlags(func) & 2 /* Async */) !== 0; - forEachYieldExpression(func.body, (yieldExpression) => { - const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType; - pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync)); - let nextType; - if (yieldExpression.asteriskToken) { - const iterationTypes = getIterationTypesOfIterable( - yieldExpressionType, - isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, - yieldExpression.expression - ); - nextType = iterationTypes && iterationTypes.nextType; - } else { - nextType = getContextualType2( - yieldExpression, - /*contextFlags*/ - void 0 - ); - } - if (nextType) pushIfUnique(nextTypes, nextType); - }); - return { yieldTypes, nextTypes }; - } - function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) { - if (expressionType === silentNeverType) { - return silentNeverType; - } - 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 - ); - } - function getNotEqualFactsFromTypeofSwitch(start, end, witnesses) { - let facts = 0 /* None */; - for (let i = 0; i < witnesses.length; i++) { - const witness = i < start || i >= end ? witnesses[i] : void 0; - facts |= witness !== void 0 ? typeofNEFacts.get(witness) || 32768 /* TypeofNEHostObject */ : 0; - } - return facts; - } - function isExhaustiveSwitchStatement(node) { - const links = getNodeLinks(node); - if (links.isExhaustive === void 0) { - links.isExhaustive = 0; - const exhaustive = computeExhaustiveSwitchStatement(node); - if (links.isExhaustive === 0) { - links.isExhaustive = exhaustive; - } - } else if (links.isExhaustive === 0) { - links.isExhaustive = false; - } - return links.isExhaustive; - } - function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 222 /* TypeOfExpression */) { - const witnesses = getSwitchClauseTypeOfWitnesses(node); - if (!witnesses) { - return false; - } - const operandConstraint = getBaseConstraintOrType(checkExpressionCached(node.expression.expression)); - const notEqualFacts = getNotEqualFactsFromTypeofSwitch(0, 0, witnesses); - if (operandConstraint.flags & 3 /* AnyOrUnknown */) { - return (556800 /* AllTypeofNE */ & notEqualFacts) === 556800 /* AllTypeofNE */; - } - return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts); - } - const type = getBaseConstraintOrType(checkExpressionCached(node.expression)); - if (!isLiteralType(type)) { - return false; - } - const switchTypes = getSwitchClauseTypes(node); - if (!switchTypes.length || some(switchTypes, isNeitherUnitTypeNorNever)) { - return false; - } - return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes); - } - function functionHasImplicitReturn(func) { - return func.endFlowNode && isReachableFlowNode(func.endFlowNode); - } - function checkAndAggregateReturnExpressionTypes(func, checkMode) { - const functionFlags = getFunctionFlags(func); - const aggregatedTypes = []; - let hasReturnWithNoExpression = functionHasImplicitReturn(func); - let hasReturnOfTypeNever = false; - forEachReturnStatement(func.body, (returnStatement) => { - let expr = returnStatement.expression; - if (expr) { - expr = skipParentheses( - expr, - /*excludeJSDocTypeAssertions*/ - true - ); - if (functionFlags & 2 /* Async */ && expr.kind === 224 /* AwaitExpression */) { - expr = skipParentheses( - expr.expression, - /*excludeJSDocTypeAssertions*/ - true - ); - } - if (expr.kind === 214 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === getMergedSymbol(func.symbol) && (!isFunctionExpressionOrArrowFunction(func.symbol.valueDeclaration) || isConstantReference(expr.expression))) { - hasReturnOfTypeNever = true; - return; - } - let type = checkExpressionCached(expr, checkMode && checkMode & ~8 /* SkipGenericFunctions */); - if (functionFlags & 2 /* Async */) { - type = unwrapAwaitedType(checkAwaitedType( - type, - /*withAlias*/ - false, - func, - Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member - )); - } - if (type.flags & 131072 /* Never */) { - hasReturnOfTypeNever = true; - } - pushIfUnique(aggregatedTypes, type); - } else { - hasReturnWithNoExpression = true; - } - }); - if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { - return void 0; - } - if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression && !(isJSConstructor(func) && aggregatedTypes.some((t) => t.symbol === func.symbol))) { - pushIfUnique(aggregatedTypes, undefinedType); - } - return aggregatedTypes; - } - function mayReturnNever(func) { - switch (func.kind) { - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return true; - case 175 /* MethodDeclaration */: - return func.parent.kind === 211 /* ObjectLiteralExpression */; - default: - return false; - } - } - function getTypePredicateFromBody(func) { - switch (func.kind) { - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return void 0; - } - const functionFlags = getFunctionFlags(func); - if (functionFlags !== 0 /* Normal */) return void 0; - let singleReturn; - if (func.body && func.body.kind !== 242 /* Block */) { - singleReturn = func.body; - } else { - const bailedEarly = forEachReturnStatement(func.body, (returnStatement) => { - if (singleReturn || !returnStatement.expression) return true; - singleReturn = returnStatement.expression; - }); - if (bailedEarly || !singleReturn || functionHasImplicitReturn(func)) return void 0; - } - return checkIfExpressionRefinesAnyParameter(func, singleReturn); - } - function checkIfExpressionRefinesAnyParameter(func, expr) { - expr = skipParentheses( - expr, - /*excludeJSDocTypeAssertions*/ - true - ); - const returnType = checkExpressionCached(expr); - if (!(returnType.flags & 16 /* Boolean */)) return void 0; - return forEach(func.parameters, (param, i) => { - const initType = getTypeOfSymbol(param.symbol); - if (!initType || initType.flags & 16 /* Boolean */ || !isIdentifier(param.name) || isSymbolAssigned(param.symbol) || isRestParameter(param)) { - return; - } - const trueType2 = checkIfExpressionRefinesParameter(func, expr, param, initType); - if (trueType2) { - return createTypePredicate(1 /* Identifier */, unescapeLeadingUnderscores(param.name.escapedText), i, trueType2); - } - }); - } - function checkIfExpressionRefinesParameter(func, expr, param, initType) { - const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === 254 /* ReturnStatement */ && expr.parent.flowNode || createFlowNode( - 2 /* Start */, - /*node*/ - void 0, - /*antecedent*/ - void 0 - ); - const trueCondition = createFlowNode(32 /* TrueCondition */, expr, antecedent); - const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition); - if (trueType2 === initType) return void 0; - const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent); - const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition)); - return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0; - } - function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { - addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics); - return; - function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() { - const functionFlags = getFunctionFlags(func); - const type = returnType && unwrapReturnType(returnType, functionFlags); - if (type && (maybeTypeOfKind(type, 16384 /* Void */) || type.flags & (1 /* Any */ | 32768 /* Undefined */))) { - return; - } - if (func.kind === 174 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 242 /* Block */ || !functionHasImplicitReturn(func)) { - return; - } - const hasExplicitReturn = func.flags & 1024 /* HasExplicitReturn */; - const errorNode = getEffectiveReturnTypeNode(func) || func; - if (type && type.flags & 131072 /* Never */) { - error2(errorNode, Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point); - } else if (type && !hasExplicitReturn) { - 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)) { - error2(errorNode, Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined); - } else if (compilerOptions.noImplicitReturns) { - if (!type) { - if (!hasExplicitReturn) { - return; - } - const inferredReturnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - if (isUnwrappedReturnTypeUndefinedVoidOrAny(func, inferredReturnType)) { - return; - } - } - error2(errorNode, Diagnostics.Not_all_code_paths_return_a_value); - } - } - } - function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); - checkNodeDeferred(node); - if (isFunctionExpression(node)) { - checkCollisionsForDeclarationName(node, node.name); - } - if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { - if (!getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) { - const contextualSignature = getContextualSignature(node); - if (contextualSignature && couldContainTypeVariables(getReturnTypeOfSignature(contextualSignature))) { - const links = getNodeLinks(node); - if (links.contextFreeType) { - return links.contextFreeType; - } - const returnType = getReturnTypeFromBody(node, checkMode); - const returnOnlySignature = createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - emptyArray, - returnType, - /*resolvedTypePredicate*/ - void 0, - 0, - 64 /* IsNonInferrable */ - ); - const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray); - returnOnlyType.objectFlags |= 262144 /* NonInferrableType */; - return links.contextFreeType = returnOnlyType; - } - } - return anyFunctionType; - } - const hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 219 /* FunctionExpression */) { - checkGrammarForGenerator(node); - } - contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); - return getTypeOfSymbol(getSymbolOfDeclaration(node)); - } - function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - const links = getNodeLinks(node); - if (!(links.flags & 64 /* ContextChecked */)) { - const contextualSignature = getContextualSignature(node); - if (!(links.flags & 64 /* ContextChecked */)) { - links.flags |= 64 /* ContextChecked */; - const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(node)), 0 /* Call */)); - if (!signature) { - return; - } - if (isContextSensitive(node)) { - if (contextualSignature) { - const inferenceContext = getInferenceContext(node); - let instantiatedContextualSignature; - if (checkMode && checkMode & 2 /* Inferential */) { - inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext); - const restType = getEffectiveRestType(contextualSignature); - if (restType && restType.flags & 262144 /* TypeParameter */) { - instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper); - } - } - instantiatedContextualSignature || (instantiatedContextualSignature = inferenceContext ? instantiateSignature(contextualSignature, inferenceContext.mapper) : contextualSignature); - assignContextualParameterTypes(signature, instantiatedContextualSignature); - } else { - assignNonContextualParameterTypes(signature); - } - } else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) { - const inferenceContext = getInferenceContext(node); - if (checkMode && checkMode & 2 /* Inferential */) { - inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext); - } - } - if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) { - const returnType = getReturnTypeFromBody(node, checkMode); - if (!signature.resolvedReturnType) { - signature.resolvedReturnType = returnType; - } - } - checkSignatureDeclaration(node); - } - } - } - function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); - const functionFlags = getFunctionFlags(node); - const returnType = getReturnTypeFromAnnotation(node); - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); - if (node.body) { - if (!getEffectiveReturnTypeNode(node)) { - getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - } - if (node.body.kind === 242 /* Block */) { - checkSourceElement(node.body); - } else { - const exprType = checkExpression(node.body); - const returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags); - if (returnOrPromisedType) { - checkReturnExpression(node, returnOrPromisedType, node.body, node.body, exprType); - } - } - } - } - function checkArithmeticOperandType(operand, type, diagnostic, isAwaitValid = false) { - if (!isTypeAssignableTo(type, numberOrBigIntType)) { - const awaitedType = isAwaitValid && getAwaitedTypeOfPromise(type); - errorAndMaybeSuggestAwait( - operand, - !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), - diagnostic - ); - return false; - } - return true; - } - function isReadonlyAssignmentDeclaration(d) { - if (!isCallExpression(d)) { - return false; - } - if (!isBindableObjectDefinePropertyCall(d)) { - return false; - } - const objectLitType = checkExpressionCached(d.arguments[2]); - const valueType = getTypeOfPropertyOfType(objectLitType, "value"); - if (valueType) { - const writableProp = getPropertyOfType(objectLitType, "writable"); - const writableType = writableProp && getTypeOfSymbol(writableProp); - if (!writableType || writableType === falseType || writableType === regularFalseType) { - return true; - } - if (writableProp && writableProp.valueDeclaration && isPropertyAssignment(writableProp.valueDeclaration)) { - const initializer = writableProp.valueDeclaration.initializer; - const rawOriginalType = checkExpression(initializer); - if (rawOriginalType === falseType || rawOriginalType === regularFalseType) { - return true; - } - } - return false; - } - const setProp = getPropertyOfType(objectLitType, "set"); - return !setProp; - } - function isReadonlySymbol(symbol) { - 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; - if (assignmentKind === 0 /* None */) { - return false; - } - if (isReadonlySymbol(symbol)) { - if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 110 /* ThisKeyword */) { - const ctor = getControlFlowContainer(expr); - if (!(ctor && (ctor.kind === 177 /* Constructor */ || isJSConstructor(ctor)))) { - return true; - } - if (symbol.valueDeclaration) { - const isAssignmentDeclaration2 = isBinaryExpression(symbol.valueDeclaration); - const isLocalPropertyDeclaration = ctor.parent === symbol.valueDeclaration.parent; - const isLocalParameterProperty = ctor === symbol.valueDeclaration.parent; - const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) === ctor.parent; - const isLocalThisPropertyAssignmentConstructorFunction = isAssignmentDeclaration2 && ((_b = symbol.parent) == null ? void 0 : _b.valueDeclaration) === ctor; - const isWriteableSymbol = isLocalPropertyDeclaration || isLocalParameterProperty || isLocalThisPropertyAssignment || isLocalThisPropertyAssignmentConstructorFunction; - return !isWriteableSymbol; - } - } - return true; - } - if (isAccessExpression(expr)) { - const node = skipParentheses(expr.expression); - if (node.kind === 80 /* Identifier */) { - const symbol2 = getNodeLinks(node).resolvedSymbol; - if (symbol2.flags & 2097152 /* Alias */) { - const declaration = getDeclarationOfAliasSymbol(symbol2); - return !!declaration && declaration.kind === 275 /* NamespaceImport */; - } - } - } - return false; - } - function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { - const node = skipOuterExpressions(expr, 38 /* Assertions */ | 1 /* Parentheses */); - if (node.kind !== 80 /* Identifier */ && !isAccessExpression(node)) { - error2(expr, invalidReferenceMessage); - return false; - } - if (node.flags & 64 /* OptionalChain */) { - error2(expr, invalidOptionalChainMessage); - return false; - } - return true; - } - function checkDeleteExpression(node) { - checkExpression(node.expression); - const expr = skipParentheses(node.expression); - if (!isAccessExpression(expr)) { - error2(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); - return booleanType; - } - if (isPropertyAccessExpression(expr) && isPrivateIdentifier(expr.name)) { - 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)) { - error2(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); - } else { - 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 */ : hasTypeFacts(type, 16777216 /* IsUndefined */))) { - error2(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_optional); - } - } - function checkTypeOfExpression(node) { - checkExpression(node.expression); - return typeofType; - } - function checkVoidExpression(node) { - checkNodeDeferred(node); - return undefinedWideningType; - } - function checkAwaitGrammar(node) { - let hasError = false; - const container = getContainingFunctionOrClassStaticBlock(node); - if (container && isClassStaticBlockDeclaration(container)) { - 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 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 */: - case 101 /* Node18 */: - case 102 /* Node20 */: - case 199 /* NodeNext */: - if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) { - span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); - 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; - } - // fallthrough - case 7 /* ES2022 */: - case 99 /* ESNext */: - case 200 /* Preserve */: - case 4 /* System */: - if (languageVersion >= 4 /* ES2017 */) { - break; - } - // fallthrough - default: - span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); - const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_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_node18_node20_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; - } - } - } else { - const sourceFile = getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - const span = getSpanOfTokenAtPosition(sourceFile, node.pos); - 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 !== 177 /* 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 (isAwaitExpression(node) && isInParameterInitializerBeforeContainingFunction(node)) { - error2(node, Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer); - hasError = true; - } - return hasError; - } - function checkAwaitExpression(node) { - addLazyDiagnostic(() => checkAwaitGrammar(node)); - const operandType = checkExpression(node.expression); - const awaitedType = checkAwaitedType( - operandType, - /*withAlias*/ - true, - node, - Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member - ); - if (awaitedType === operandType && !isErrorType(awaitedType) && !(operandType.flags & 3 /* AnyOrUnknown */)) { - addErrorOrSuggestion( - /*isError*/ - false, - createDiagnosticForNode(node, Diagnostics.await_has_no_effect_on_the_type_of_this_expression) - ); - } - return awaitedType; - } - function checkPrefixUnaryExpression(node) { - const operandType = checkExpression(node.operand); - if (operandType === silentNeverType) { - return silentNeverType; - } - switch (node.operand.kind) { - case 9 /* NumericLiteral */: - switch (node.operator) { - case 41 /* MinusToken */: - return getFreshTypeOfLiteralType(getNumberLiteralType(-node.operand.text)); - case 40 /* PlusToken */: - return getFreshTypeOfLiteralType(getNumberLiteralType(+node.operand.text)); - } - break; - case 10 /* BigIntLiteral */: - if (node.operator === 41 /* MinusToken */) { - return getFreshTypeOfLiteralType(getBigIntLiteralType({ - negative: true, - base10Value: parsePseudoBigInt(node.operand.text) - })); - } - } - switch (node.operator) { - case 40 /* PlusToken */: - case 41 /* MinusToken */: - case 55 /* TildeToken */: - checkNonNullType(operandType, node.operand); - if (maybeTypeOfKindConsideringBaseConstraint(operandType, 12288 /* ESSymbolLike */)) { - 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 */)) { - 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 */); - 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); - if (ok) { - checkReferenceExpression( - node.operand, - Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, - Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access - ); - } - return getUnaryResultType(operandType); - } - return errorType; - } - function checkPostfixUnaryExpression(node) { - const operandType = checkExpression(node.operand); - if (operandType === silentNeverType) { - return silentNeverType; - } - 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, - Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, - Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access - ); - } - return getUnaryResultType(operandType); - } - function getUnaryResultType(operandType) { - if (maybeTypeOfKind(operandType, 2112 /* BigIntLike */)) { - return isTypeAssignableToKind(operandType, 3 /* AnyOrUnknown */) || maybeTypeOfKind(operandType, 296 /* NumberLike */) ? numberOrBigIntType : bigintType; - } - return numberType; - } - function maybeTypeOfKindConsideringBaseConstraint(type, kind) { - if (maybeTypeOfKind(type, kind)) { - return true; - } - const baseConstraint = getBaseConstraintOrType(type); - return !!baseConstraint && maybeTypeOfKind(baseConstraint, kind); - } - function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { - return true; - } - if (type.flags & 3145728 /* UnionOrIntersection */) { - const types = type.types; - for (const t of types) { - if (maybeTypeOfKind(t, kind)) { - return true; - } - } - } - return false; - } - function isTypeAssignableToKind(source, kind, strict) { - if (source.flags & kind) { - return true; - } - if (strict && source.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */)) { - return false; - } - return !!(kind & 296 /* NumberLike */) && isTypeAssignableTo(source, numberType) || !!(kind & 2112 /* BigIntLike */) && isTypeAssignableTo(source, bigintType) || !!(kind & 402653316 /* StringLike */) && isTypeAssignableTo(source, stringType) || !!(kind & 528 /* BooleanLike */) && isTypeAssignableTo(source, booleanType) || !!(kind & 16384 /* Void */) && isTypeAssignableTo(source, voidType) || !!(kind & 131072 /* Never */) && isTypeAssignableTo(source, neverType) || !!(kind & 65536 /* Null */) && isTypeAssignableTo(source, nullType) || !!(kind & 32768 /* Undefined */) && isTypeAssignableTo(source, undefinedType) || !!(kind & 4096 /* ESSymbol */) && isTypeAssignableTo(source, esSymbolType) || !!(kind & 67108864 /* NonPrimitive */) && isTypeAssignableTo(source, nonPrimitiveType); - } - function allTypesAssignableToKind(source, kind, strict) { - return source.flags & 1048576 /* Union */ ? every(source.types, (subType) => allTypesAssignableToKind(subType, kind, strict)) : isTypeAssignableToKind(source, kind, strict); - } - function isConstEnumObjectType(type) { - return !!(getObjectFlags(type) & 16 /* Anonymous */) && !!type.symbol && isConstEnumSymbol(type.symbol); - } - function isConstEnumSymbol(symbol) { - return (symbol.flags & 128 /* ConstEnum */) !== 0; - } - function getSymbolHasInstanceMethodOfObjectType(type) { - const hasInstancePropertyName = getPropertyNameForKnownSymbolName("hasInstance"); - if (allTypesAssignableToKind(type, 67108864 /* NonPrimitive */)) { - const hasInstanceProperty = getPropertyOfType(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 */)) { - error2(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - 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) { - return someType(type, (t) => t === unknownEmptyObjectType || !!(t.flags & 2097152 /* Intersection */) && isEmptyAnonymousObjectType(getBaseConstraintOrType(t))); - } - function checkInExpression(left, right, leftType, rightType) { - if (leftType === silentNeverType || rightType === silentNeverType) { - return silentNeverType; - } - if (isPrivateIdentifier(left)) { - if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) { - checkExternalEmitHelpers(left, 2097152 /* ClassPrivateFieldIn */); - } - if (!getNodeLinks(left).resolvedSymbol && getContainingClass(left)) { - const isUncheckedJS = isUncheckedJSSuggestion( - left, - rightType.symbol, - /*excludeClasses*/ - true - ); - reportNonexistentProperty(left, rightType, isUncheckedJS); - } - } else { - checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left); - } - if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) { - if (hasEmptyObjectIntersection(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; - } - function checkObjectLiteralAssignment(node, sourceType, rightIsThis) { - const properties = node.properties; - if (strictNullChecks && properties.length === 0) { - return checkNonNullType(sourceType, node); - } - for (let i = 0; i < properties.length; i++) { - checkObjectLiteralDestructuringPropertyAssignment(node, sourceType, i, properties, rightIsThis); - } - return sourceType; - } - function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) { - const properties = node.properties; - const property = properties[propertyIndex]; - if (property.kind === 304 /* PropertyAssignment */ || property.kind === 305 /* ShorthandPropertyAssignment */) { - const name = property.name; - const exprType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(exprType)) { - const text = getPropertyNameFromType(exprType); - const prop = getPropertyOfType(objectLiteralType, text); - if (prop) { - markPropertyAsReferenced(prop, property, rightIsThis); - checkPropertyAccessibility( - property, - /*isSuper*/ - false, - /*writing*/ - true, - objectLiteralType, - prop - ); - } - } - const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */ | (hasDefaultValue(property) ? 16 /* AllowMissing */ : 0), name); - const type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 305 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); - } else if (property.kind === 306 /* SpreadAssignment */) { - if (propertyIndex < properties.length - 1) { - error2(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); - } else { - if (languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) { - checkExternalEmitHelpers(property, 4 /* Rest */); - } - const nonRestNames = []; - if (allProperties) { - for (const otherProperty of allProperties) { - if (!isSpreadAssignment(otherProperty)) { - nonRestNames.push(otherProperty.name); - } - } - } - const type = getRestType(objectLiteralType, nonRestNames, objectLiteralType.symbol); - checkGrammarForDisallowedTrailingComma(allProperties, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - return checkDestructuringAssignment(property.expression, type); - } - } else { - error2(property, Diagnostics.Property_assignment_expected); - } - } - function checkArrayLiteralAssignment(node, sourceType, checkMode) { - const elements = node.elements; - if (languageVersion < LanguageFeatureMinimumTarget.DestructuringAssignment && compilerOptions.downlevelIteration) { - checkExternalEmitHelpers(node, 512 /* Read */); - } - const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType; - let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType; - for (let i = 0; i < elements.length; i++) { - let type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 231 /* SpreadElement */) { - type = inBoundsType = inBoundsType ?? (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); - } - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); - } - return sourceType; - } - function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { - const elements = node.elements; - const element = elements[elementIndex]; - if (element.kind !== 233 /* OmittedExpression */) { - if (element.kind !== 231 /* SpreadElement */) { - const indexType = getNumberLiteralType(elementIndex); - if (isArrayLikeType(sourceType)) { - const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* AllowMissing */ : 0); - const elementType2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, accessFlags, createSyntheticExpression(element, indexType)) || errorType; - const assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType2, 524288 /* NEUndefined */) : elementType2; - const type = getFlowTypeOfDestructuring(element, assignedType); - return checkDestructuringAssignment(element, type, checkMode); - } - return checkDestructuringAssignment(element, elementType, checkMode); - } - if (elementIndex < elements.length - 1) { - error2(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); - } else { - const restExpression = element.expression; - if (restExpression.kind === 227 /* 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); - return checkDestructuringAssignment(restExpression, type, checkMode); - } - } - } - return void 0; - } - function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { - let target; - if (exprOrAssignment.kind === 305 /* ShorthandPropertyAssignment */) { - const prop = exprOrAssignment; - if (prop.objectAssignmentInitializer) { - if (strictNullChecks && !hasTypeFacts(checkExpression(prop.objectAssignmentInitializer), 16777216 /* IsUndefined */)) { - sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */); - } - checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); - } - target = exprOrAssignment.name; - } else { - target = exprOrAssignment; - } - if (target.kind === 227 /* BinaryExpression */ && target.operatorToken.kind === 64 /* EqualsToken */) { - checkBinaryExpression(target, checkMode); - target = target.left; - if (strictNullChecks) { - sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */); - } - } - if (target.kind === 211 /* ObjectLiteralExpression */) { - return checkObjectLiteralAssignment(target, sourceType, rightIsThis); - } - if (target.kind === 210 /* ArrayLiteralExpression */) { - return checkArrayLiteralAssignment(target, sourceType, checkMode); - } - return checkReferenceAssignment(target, sourceType, checkMode); - } - function checkReferenceAssignment(target, sourceType, checkMode) { - const targetType = checkExpression(target, checkMode); - const error3 = target.parent.kind === 306 /* 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 === 306 /* 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)) { - checkExternalEmitHelpers(target.parent, 1048576 /* ClassPrivateFieldSet */); - } - return sourceType; - } - function isSideEffectFree(node) { - node = skipParentheses(node); - switch (node.kind) { - case 80 /* Identifier */: - case 11 /* StringLiteral */: - case 14 /* RegularExpressionLiteral */: - case 216 /* TaggedTemplateExpression */: - case 229 /* TemplateExpression */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 106 /* NullKeyword */: - case 157 /* UndefinedKeyword */: - case 219 /* FunctionExpression */: - case 232 /* ClassExpression */: - case 220 /* ArrowFunction */: - case 210 /* ArrayLiteralExpression */: - case 211 /* ObjectLiteralExpression */: - case 222 /* TypeOfExpression */: - case 236 /* NonNullExpression */: - case 286 /* JsxSelfClosingElement */: - case 285 /* JsxElement */: - return true; - case 228 /* ConditionalExpression */: - return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 227 /* BinaryExpression */: - if (isAssignmentOperator(node.operatorToken.kind)) { - return false; - } - return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - switch (node.operator) { - case 54 /* ExclamationToken */: - case 40 /* PlusToken */: - case 41 /* MinusToken */: - case 55 /* TildeToken */: - return true; - } - return false; - // Some forms listed here for clarity - case 223 /* VoidExpression */: - // Explicit opt-out - case 217 /* TypeAssertionExpression */: - // Not SEF, but can produce useful type warnings - case 235 /* AsExpression */: - // Not SEF, but can produce useful type warnings - default: - return false; - } - } - function isTypeEqualityComparableTo(source, target) { - return (target.flags & 98304 /* Nullable */) !== 0 || isTypeComparableTo(source, target); - } - function createCheckBinaryExpression() { - const trampoline = createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState); - return (node, checkMode) => { - const result = trampoline(node, checkMode); - Debug.assertIsDefined(result); - return result; - }; - function onEnter(node, state, checkMode) { - if (state) { - state.stackIndex++; - state.skip = false; - setLeftType( - state, - /*type*/ - void 0 - ); - setLastResult( - state, - /*type*/ - void 0 - ); - } else { - state = { - checkMode, - skip: false, - stackIndex: 0, - typeStack: [void 0, void 0] - }; - } - if (isInJSFile(node) && getAssignedExpandoInitializer(node)) { - state.skip = true; - setLastResult(state, checkExpression(node.right, checkMode)); - return state; - } - checkNullishCoalesceOperands(node); - const operator = node.operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (node.left.kind === 211 /* ObjectLiteralExpression */ || node.left.kind === 210 /* ArrayLiteralExpression */)) { - state.skip = true; - setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 110 /* ThisKeyword */)); - return state; - } - return state; - } - function onLeft(left, state, _node) { - if (!state.skip) { - return maybeCheckExpression(state, left); - } - } - function onOperator(operatorToken, state, node) { - if (!state.skip) { - const leftType = getLastResult(state); - Debug.assertIsDefined(leftType); - setLeftType(state, leftType); - setLastResult( - state, - /*type*/ - void 0 - ); - const operator = operatorToken.kind; - if (isLogicalOrCoalescingBinaryOperator(operator)) { - let parent2 = node.parent; - while (parent2.kind === 218 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { - parent2 = parent2.parent; - } - if (operator === 56 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) { - checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0); - } - if (isBinaryLogicalOperator(operator)) { - checkTruthinessOfType(leftType, node.left); - } - } - } - } - function onRight(right, state, _node) { - if (!state.skip) { - return maybeCheckExpression(state, right); - } - } - function onExit(node, state) { - let result; - if (state.skip) { - result = getLastResult(state); - } else { - const leftType = getLeftType(state); - Debug.assertIsDefined(leftType); - const rightType = getLastResult(state); - Debug.assertIsDefined(rightType); - result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node); - } - state.skip = false; - setLeftType( - state, - /*type*/ - void 0 - ); - setLastResult( - state, - /*type*/ - void 0 - ); - state.stackIndex--; - return result; - } - function foldState(state, result, _side) { - setLastResult(state, result); - return state; - } - function maybeCheckExpression(state, node) { - if (isBinaryExpression(node)) { - return node; - } - setLastResult(state, checkExpression(node, state.checkMode)); - } - function getLeftType(state) { - return state.typeStack[state.stackIndex]; - } - function setLeftType(state, type) { - state.typeStack[state.stackIndex] = type; - } - function getLastResult(state) { - return state.typeStack[state.stackIndex + 1]; - } - function setLastResult(state, type) { - state.typeStack[state.stackIndex + 1] = type; - } - } - function checkNullishCoalesceOperands(node) { - if (node.operatorToken.kind !== 61 /* QuestionQuestionToken */) { - return; - } - if (isBinaryExpression(node.parent)) { - const { left, operatorToken } = node.parent; - if (isBinaryExpression(left) && operatorToken.kind === 57 /* BarBarToken */) { - grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind)); - } - } else if (isBinaryExpression(node.left)) { - const { operatorToken } = node.left; - if (operatorToken.kind === 57 /* BarBarToken */ || operatorToken.kind === 56 /* AmpersandAmpersandToken */) { - grammarErrorOnNode(node.left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(operatorToken.kind), tokenToString(61 /* QuestionQuestionToken */)); - } - } else if (isBinaryExpression(node.right)) { - const { operatorToken } = node.right; - if (operatorToken.kind === 56 /* AmpersandAmpersandToken */) { - grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind)); - } - } - checkNullishCoalesceOperandLeft(node); - checkNullishCoalesceOperandRight(node); - } - function checkNullishCoalesceOperandLeft(node) { - const leftTarget = skipOuterExpressions(node.left, 63 /* All */); - const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget); - if (nullishSemantics !== 3 /* Sometimes */) { - if (nullishSemantics === 1 /* Always */) { - error2(leftTarget, Diagnostics.This_expression_is_always_nullish); - } else { - error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish); - } - } - } - function checkNullishCoalesceOperandRight(node) { - const rightTarget = skipOuterExpressions(node.right, 63 /* All */); - const nullishSemantics = getSyntacticNullishnessSemantics(rightTarget); - if (isNotWithinNullishCoalesceExpression(node)) { - return; - } - if (nullishSemantics === 1 /* Always */) { - error2(rightTarget, Diagnostics.This_expression_is_always_nullish); - } else if (nullishSemantics === 2 /* Never */) { - error2(rightTarget, Diagnostics.This_expression_is_never_nullish); - } - } - function isNotWithinNullishCoalesceExpression(node) { - return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */; - } - function getSyntacticNullishnessSemantics(node) { - node = skipOuterExpressions(node); - switch (node.kind) { - case 224 /* AwaitExpression */: - case 214 /* CallExpression */: - case 216 /* TaggedTemplateExpression */: - case 213 /* ElementAccessExpression */: - case 237 /* MetaProperty */: - case 215 /* NewExpression */: - case 212 /* PropertyAccessExpression */: - case 230 /* YieldExpression */: - case 110 /* ThisKeyword */: - return 3 /* Sometimes */; - case 227 /* BinaryExpression */: - switch (node.operatorToken.kind) { - case 64 /* EqualsToken */: - case 61 /* QuestionQuestionToken */: - case 78 /* QuestionQuestionEqualsToken */: - case 57 /* BarBarToken */: - case 76 /* BarBarEqualsToken */: - case 56 /* AmpersandAmpersandToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - return 3 /* Sometimes */; - case 28 /* CommaToken */: - return getSyntacticNullishnessSemantics(node.right); - } - return 2 /* Never */; - case 228 /* ConditionalExpression */: - return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse); - case 106 /* NullKeyword */: - return 1 /* Always */; - case 80 /* Identifier */: - if (getResolvedSymbol(node) === undefinedSymbol) { - return 1 /* Always */; - } - return 3 /* Sometimes */; - } - return 2 /* Never */; - } - function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { - const operator = operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (left.kind === 211 /* ObjectLiteralExpression */ || left.kind === 210 /* ArrayLiteralExpression */)) { - return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 110 /* ThisKeyword */); - } - let leftType; - if (isBinaryLogicalOperator(operator)) { - leftType = checkTruthinessExpression(left, checkMode); - } else { - leftType = checkExpression(left, checkMode); - } - const rightType = checkExpression(right, checkMode); - return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode); - } - function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) { - const operator = operatorToken.kind; - switch (operator) { - case 42 /* AsteriskToken */: - case 43 /* AsteriskAsteriskToken */: - case 67 /* AsteriskEqualsToken */: - case 68 /* AsteriskAsteriskEqualsToken */: - case 44 /* SlashToken */: - case 69 /* SlashEqualsToken */: - case 45 /* PercentToken */: - case 70 /* PercentEqualsToken */: - case 41 /* MinusToken */: - case 66 /* MinusEqualsToken */: - case 48 /* LessThanLessThanToken */: - case 71 /* LessThanLessThanEqualsToken */: - case 49 /* GreaterThanGreaterThanToken */: - case 72 /* GreaterThanGreaterThanEqualsToken */: - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 52 /* BarToken */: - case 75 /* BarEqualsToken */: - case 53 /* CaretToken */: - case 79 /* CaretEqualsToken */: - case 51 /* AmpersandToken */: - case 74 /* AmpersandEqualsToken */: - if (leftType === silentNeverType || rightType === silentNeverType) { - return silentNeverType; - } - leftType = checkNonNullType(leftType, left); - rightType = checkNonNullType(rightType, right); - let suggestedOperator; - if (leftType.flags & 528 /* BooleanLike */ && rightType.flags & 528 /* BooleanLike */ && (suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== void 0) { - 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( - left, - leftType, - Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, - /*isAwaitValid*/ - true - ); - const rightOk = checkArithmeticOperandType( - right, - rightType, - Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, - /*isAwaitValid*/ - true - ); - let resultType2; - if (isTypeAssignableToKind(leftType, 3 /* AnyOrUnknown */) && isTypeAssignableToKind(rightType, 3 /* AnyOrUnknown */) || // Or, if neither could be bigint, implicit coercion results in a number result - !(maybeTypeOfKind(leftType, 2112 /* BigIntLike */) || maybeTypeOfKind(rightType, 2112 /* BigIntLike */))) { - resultType2 = numberType; - } else if (bothAreBigIntLike(leftType, rightType)) { - switch (operator) { - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - reportOperatorError(); - break; - case 43 /* AsteriskAsteriskToken */: - case 68 /* AsteriskAsteriskEqualsToken */: - if (languageVersion < 3 /* ES2016 */) { - error2(errorNode, Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later); - } - } - resultType2 = bigintType; - } else { - reportOperatorError(bothAreBigIntLike); - resultType2 = errorType; - } - if (leftOk && rightOk) { - checkAssignmentOperator(resultType2); - switch (operator) { - case 48 /* LessThanLessThanToken */: - case 71 /* LessThanLessThanEqualsToken */: - case 49 /* GreaterThanGreaterThanToken */: - case 72 /* GreaterThanGreaterThanEqualsToken */: - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - const rhsEval = evaluate(right); - if (typeof rhsEval.value === "number" && Math.abs(rhsEval.value) >= 32) { - errorOrSuggestion( - isEnumMember(walkUpParenthesizedExpressions(right.parent.parent)), - // elevate from suggestion to error within an enum member - errorNode || operatorToken, - Diagnostics.This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2, - getTextOfNode(left), - tokenToString(operator), - rhsEval.value % 32 - ); - } - break; - default: - break; - } - } - return resultType2; - } - case 40 /* PlusToken */: - case 65 /* PlusEqualsToken */: - if (leftType === silentNeverType || rightType === silentNeverType) { - return silentNeverType; - } - if (!isTypeAssignableToKind(leftType, 402653316 /* StringLike */) && !isTypeAssignableToKind(rightType, 402653316 /* StringLike */)) { - leftType = checkNonNullType(leftType, left); - rightType = checkNonNullType(rightType, right); - } - let resultType; - if (isTypeAssignableToKind( - leftType, - 296 /* NumberLike */, - /*strict*/ - true - ) && isTypeAssignableToKind( - rightType, - 296 /* NumberLike */, - /*strict*/ - true - )) { - resultType = numberType; - } else if (isTypeAssignableToKind( - leftType, - 2112 /* BigIntLike */, - /*strict*/ - true - ) && isTypeAssignableToKind( - rightType, - 2112 /* BigIntLike */, - /*strict*/ - true - )) { - resultType = bigintType; - } else if (isTypeAssignableToKind( - leftType, - 402653316 /* StringLike */, - /*strict*/ - true - ) || isTypeAssignableToKind( - rightType, - 402653316 /* StringLike */, - /*strict*/ - true - )) { - resultType = stringType; - } else if (isTypeAny(leftType) || isTypeAny(rightType)) { - resultType = isErrorType(leftType) || isErrorType(rightType) ? errorType : anyType; - } - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } - if (!resultType) { - const closeEnoughKind = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */; - reportOperatorError( - (left2, right2) => isTypeAssignableToKind(left2, closeEnoughKind) && isTypeAssignableToKind(right2, closeEnoughKind) - ); - return anyType; - } - if (operator === 65 /* PlusEqualsToken */) { - checkAssignmentOperator(resultType); - } - return resultType; - case 30 /* LessThanToken */: - case 32 /* GreaterThanToken */: - case 33 /* LessThanEqualsToken */: - case 34 /* GreaterThanEqualsToken */: - if (checkForDisallowedESSymbolOperand(operator)) { - leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left)); - rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right)); - reportOperatorErrorUnless((left2, right2) => { - if (isTypeAny(left2) || isTypeAny(right2)) { - return true; - } - const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType); - const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType); - return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2); - }); - } - return booleanType; - case 35 /* EqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - case 37 /* EqualsEqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - 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)); - } - return booleanType; - case 104 /* InstanceOfKeyword */: - return checkInstanceOfExpression(left, right, leftType, rightType, checkMode); - case 103 /* InKeyword */: - return checkInExpression(left, right, leftType, rightType); - case 56 /* AmpersandAmpersandToken */: - case 77 /* AmpersandAmpersandEqualsToken */: { - const resultType2 = hasTypeFacts(leftType, 4194304 /* Truthy */) ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType; - if (operator === 77 /* AmpersandAmpersandEqualsToken */) { - checkAssignmentOperator(rightType); - } - return resultType2; - } - case 57 /* BarBarToken */: - case 76 /* BarBarEqualsToken */: { - const resultType2 = hasTypeFacts(leftType, 8388608 /* Falsy */) ? getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) : leftType; - if (operator === 76 /* BarBarEqualsToken */) { - checkAssignmentOperator(rightType); - } - return resultType2; - } - case 61 /* QuestionQuestionToken */: - case 78 /* QuestionQuestionEqualsToken */: { - const resultType2 = hasTypeFacts(leftType, 262144 /* EQUndefinedOrNull */) ? getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) : leftType; - if (operator === 78 /* QuestionQuestionEqualsToken */) { - checkAssignmentOperator(rightType); - } - return resultType2; - } - case 64 /* EqualsToken */: - const declKind = isBinaryExpression(left.parent) ? getAssignmentDeclarationKind(left.parent) : 0 /* None */; - checkAssignmentDeclaration(declKind, rightType); - if (isAssignmentDeclaration2(declKind)) { - if (!(rightType.flags & 524288 /* Object */) || declKind !== 2 /* ModuleExports */ && declKind !== 6 /* Prototype */ && !isEmptyObjectType(rightType) && !isFunctionObjectType(rightType) && !(getObjectFlags(rightType) & 1 /* Class */)) { - checkAssignmentOperator(rightType); - } - return leftType; - } else { - checkAssignmentOperator(rightType); - return rightType; - } - case 28 /* CommaToken */: - if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) { - const sf = getSourceFileOfNode(left); - const sourceText = sf.text; - const start = skipTrivia(sourceText, left.pos); - const isInDiag2657 = sf.parseDiagnostics.some((diag2) => { - if (diag2.code !== Diagnostics.JSX_expressions_must_have_one_parent_element.code) return false; - return textSpanContainsPosition(diag2, start); - }); - if (!isInDiag2657) error2(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); - } - return rightType; - default: - return Debug.fail(); - } - function bothAreBigIntLike(left2, right2) { - return isTypeAssignableToKind(left2, 2112 /* BigIntLike */) && isTypeAssignableToKind(right2, 2112 /* BigIntLike */); - } - function checkAssignmentDeclaration(kind, rightType2) { - if (kind === 2 /* ModuleExports */) { - for (const prop of getPropertiesOfObjectType(rightType2)) { - const propType = getTypeOfSymbol(prop); - if (propType.symbol && propType.symbol.flags & 32 /* Class */) { - const name = prop.escapedName; - const symbol = resolveName( - prop.valueDeclaration, - name, - 788968 /* Type */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - if ((symbol == null ? void 0 : symbol.declarations) && symbol.declarations.some(isJSDocTypedefTag)) { - addDuplicateDeclarationErrorsForSymbols(symbol, Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name), prop); - addDuplicateDeclarationErrorsForSymbols(prop, Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name), symbol); - } - } - } - } - } - function isIndirectCall(node) { - return node.parent.kind === 218 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 216 /* 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) { - error2(offendingSymbolOperand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(operator2)); - return false; - } - return true; - } - function getSuggestedBooleanOperator(operator2) { - switch (operator2) { - case 52 /* BarToken */: - case 75 /* BarEqualsToken */: - return 57 /* BarBarToken */; - case 53 /* CaretToken */: - case 79 /* CaretEqualsToken */: - return 38 /* ExclamationEqualsEqualsToken */; - case 51 /* AmpersandToken */: - case 74 /* AmpersandEqualsToken */: - return 56 /* AmpersandAmpersandToken */; - default: - return void 0; - } - } - function checkAssignmentOperator(valueType) { - if (isAssignmentOperator(operator)) { - addLazyDiagnostic(checkAssignmentOperatorWorker); - } - function checkAssignmentOperatorWorker() { - let assigneeType = leftType; - if (isCompoundAssignment(operatorToken.kind) && left.kind === 212 /* PropertyAccessExpression */) { - assigneeType = checkPropertyAccessExpression( - left, - /*checkMode*/ - void 0, - /*writeOnly*/ - 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)) { - let headMessage; - if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) { - const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); - if (isExactOptionalPropertyMismatch(valueType, target)) { - headMessage = Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target; - } - } - checkTypeAssignableToAndOptionallyElaborate(valueType, assigneeType, left, right, headMessage); - } - } - } - function isAssignmentDeclaration2(kind) { - var _a; - switch (kind) { - case 2 /* ModuleExports */: - return true; - case 1 /* ExportsProperty */: - case 5 /* Property */: - case 6 /* Prototype */: - case 3 /* PrototypeProperty */: - case 4 /* ThisProperty */: - const symbol = getSymbolOfNode(left); - const init = getAssignedExpandoInitializer(right); - return !!init && isObjectLiteralExpression(init) && !!((_a = symbol == null ? void 0 : symbol.exports) == null ? void 0 : _a.size); - default: - return false; - } - } - function reportOperatorErrorUnless(typesAreCompatible) { - if (!typesAreCompatible(leftType, rightType)) { - reportOperatorError(typesAreCompatible); - return true; - } - return false; - } - function reportOperatorError(isRelated) { - let wouldWorkWithAwait = false; - const errNode = errorNode || operatorToken; - if (isRelated) { - const awaitedLeftType = getAwaitedTypeNoAlias(leftType); - const awaitedRightType = getAwaitedTypeNoAlias(rightType); - wouldWorkWithAwait = !(awaitedLeftType === leftType && awaitedRightType === rightType) && !!(awaitedLeftType && awaitedRightType) && isRelated(awaitedLeftType, awaitedRightType); - } - let effectiveLeft = leftType; - let effectiveRight = rightType; - if (!wouldWorkWithAwait && isRelated) { - [effectiveLeft, effectiveRight] = getBaseTypesIfUnrelated(leftType, rightType, isRelated); - } - const [leftStr, rightStr] = getTypeNamesForErrorDisplay(effectiveLeft, effectiveRight); - if (!tryGiveBetterPrimaryError(errNode, wouldWorkWithAwait, leftStr, rightStr)) { - errorAndMaybeSuggestAwait( - errNode, - wouldWorkWithAwait, - Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, - tokenToString(operatorToken.kind), - leftStr, - rightStr - ); - } - } - function tryGiveBetterPrimaryError(errNode, maybeMissingAwait, leftStr, rightStr) { - switch (operatorToken.kind) { - case 37 /* EqualsEqualsEqualsToken */: - case 35 /* EqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - return errorAndMaybeSuggestAwait( - errNode, - maybeMissingAwait, - Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap, - leftStr, - rightStr - ); - default: - return void 0; - } - } - function checkNaNEquality(errorNode2, operator2, left2, right2) { - const isLeftNaN = isGlobalNaN(skipParentheses(left2)); - const isRightNaN = isGlobalNaN(skipParentheses(right2)); - if (isLeftNaN || isRightNaN) { - 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) : "..."})`)); - } - } - function isGlobalNaN(expr) { - if (isIdentifier(expr) && expr.escapedText === "NaN") { - const globalNaNSymbol = getGlobalNaNSymbol(); - return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr); - } - return false; - } - } - function getBaseTypesIfUnrelated(leftType, rightType, isRelated) { - let effectiveLeft = leftType; - let effectiveRight = rightType; - const leftBase = getBaseTypeOfLiteralType(leftType); - const rightBase = getBaseTypeOfLiteralType(rightType); - if (!isRelated(leftBase, rightBase)) { - effectiveLeft = leftBase; - effectiveRight = rightBase; - } - return [effectiveLeft, effectiveRight]; - } - function checkYieldExpression(node) { - addLazyDiagnostic(checkYieldExpressionGrammar); - const func = getContainingFunction(node); - if (!func) return anyType; - const functionFlags = getFunctionFlags(func); - if (!(functionFlags & 1 /* Generator */)) { - return anyType; - } - const isAsync = (functionFlags & 2 /* Async */) !== 0; - if (node.asteriskToken) { - if (isAsync && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) { - checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */); - } - if (!isAsync && languageVersion < LanguageFeatureMinimumTarget.Generators && compilerOptions.downlevelIteration) { - checkExternalEmitHelpers(node, 256 /* Values */); - } - } - 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; - const yieldExpressionType = node.expression ? checkExpression(node.expression) : undefinedWideningType; - const yieldedType = getYieldedTypeOfYieldExpression(node, yieldExpressionType, signatureNextType, isAsync); - if (returnType && yieldedType) { - checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureYieldType, node.expression || node, node.expression); - } - if (node.asteriskToken) { - const use = isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */; - return getIterationTypeOfIterable(use, 1 /* Return */, yieldExpressionType, node.expression) || anyType; - } else if (returnType) { - return getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, isAsync) || anyType; - } - let type = getContextualIterationType(2 /* Next */, func); - if (!type) { - type = anyType; - addLazyDiagnostic(() => { - if (noImplicitAny && !expressionResultIsUnused(node)) { - const contextualType = getContextualType2( - node, - /*contextFlags*/ - void 0 - ); - if (!contextualType || isTypeAny(contextualType)) { - 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 & 16384 /* YieldContext */)) { - grammarErrorOnFirstToken(node, Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); - } - if (isInParameterInitializerBeforeContainingFunction(node)) { - error2(node, Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer); - } - } - } - function checkConditionalExpression(node, checkMode) { - const type = checkTruthinessExpression(node.condition, checkMode); - checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.condition, type, node.whenTrue); - const type1 = checkExpression(node.whenTrue, checkMode); - const type2 = checkExpression(node.whenFalse, checkMode); - return getUnionType([type1, type2], 2 /* Subtype */); - } - function isTemplateLiteralContext(node) { - const parent2 = node.parent; - return isParenthesizedExpression(parent2) && isTemplateLiteralContext(parent2) || isElementAccessExpression(parent2) && parent2.argumentExpression === node; - } - function checkTemplateExpression(node) { - const texts = [node.head.text]; - const types = []; - for (const span of node.templateSpans) { - const type = checkExpression(span.expression); - if (maybeTypeOfKindConsideringBaseConstraint(type, 12288 /* ESSymbolLike */)) { - 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); - } - const evaluated = node.parent.kind !== 216 /* TaggedTemplateExpression */ && evaluate(node).value; - if (evaluated) { - return getFreshTypeOfLiteralType(getStringLiteralType(evaluated)); - } - if (isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType2( - node, - /*contextFlags*/ - void 0 - ) || unknownType, isTemplateLiteralContextualType)) { - return getTemplateLiteralType(texts, types); - } - return stringType; - } - function isTemplateLiteralContextualType(type) { - return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */)); - } - function getContextNode2(node) { - if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) { - return node.parent.parent; - } - return node; - } - function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) { - const contextNode = getContextNode2(node); - pushContextualType( - contextNode, - contextualType, - /*isCache*/ - false - ); - pushInferenceContext(contextNode, inferenceContext); - const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0)); - if (inferenceContext && inferenceContext.intraExpressionInferenceSites) { - inferenceContext.intraExpressionInferenceSites = void 0; - } - const result = maybeTypeOfKind(type, 2944 /* Literal */) && isLiteralOfContextualType(type, instantiateContextualType( - contextualType, - node, - /*contextFlags*/ - void 0 - )) ? getRegularTypeOfLiteralType(type) : type; - popInferenceContext(); - popContextualType(); - return result; - } - function checkExpressionCached(node, checkMode) { - if (checkMode) { - return checkExpression(node, checkMode); - } - const links = getNodeLinks(node); - if (!links.resolvedType) { - const saveFlowLoopStart = flowLoopStart; - const saveFlowTypeCache = flowTypeCache; - flowLoopStart = flowLoopCount; - flowTypeCache = void 0; - links.resolvedType = checkExpression(node, checkMode); - flowTypeCache = saveFlowTypeCache; - flowLoopStart = saveFlowLoopStart; - } - return links.resolvedType; - } - function isTypeAssertion(node) { - node = skipParentheses( - node, - /*excludeJSDocTypeAssertions*/ - true - ); - return node.kind === 217 /* TypeAssertionExpression */ || node.kind === 235 /* AsExpression */ || isJSDocTypeAssertion(node); - } - function checkDeclarationInitializer(declaration, checkMode, contextualType) { - const initializer = getEffectiveInitializer(declaration); - if (isInJSFile(declaration)) { - const typeNode = tryGetJSDocSatisfiesTypeNode(declaration); - if (typeNode) { - return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode); - } - } - const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType( - initializer, - contextualType, - /*inferenceContext*/ - void 0, - checkMode || 0 /* Normal */ - ) : checkExpressionCached(initializer, checkMode)); - if (isParameter(isBindingElement(declaration) ? walkUpBindingElementsAndPatterns(declaration) : declaration)) { - if (declaration.name.kind === 207 /* ObjectBindingPattern */ && isObjectLiteralType2(type)) { - return padObjectLiteralType(type, declaration.name); - } - if (declaration.name.kind === 208 /* ArrayBindingPattern */ && isTupleType(type)) { - return padTupleType(type, declaration.name); - } - } - return type; - } - function padObjectLiteralType(type, pattern) { - let missingElements; - for (const e of pattern.elements) { - if (e.initializer) { - const name = getPropertyNameFromBindingElement(e); - if (name && !getPropertyOfType(type, name)) { - missingElements = append(missingElements, e); - } - } - } - if (!missingElements) { - return type; - } - const members = createSymbolTable(); - for (const prop of getPropertiesOfObjectType(type)) { - members.set(prop.escapedName, prop); - } - for (const e of missingElements) { - const symbol = createSymbol(4 /* Property */ | 16777216 /* Optional */, getPropertyNameFromBindingElement(e)); - symbol.links.type = getTypeFromBindingElement( - e, - /*includePatternInType*/ - false, - /*reportErrors*/ - false - ); - members.set(symbol.escapedName, symbol); - } - const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type)); - result.objectFlags = type.objectFlags; - return result; - } - function getPropertyNameFromBindingElement(e) { - const exprType = getLiteralTypeFromPropertyName(e.propertyName || e.name); - return isTypeUsableAsPropertyName(exprType) ? getPropertyNameFromType(exprType) : void 0; - } - function padTupleType(type, pattern) { - if (type.target.combinedFlags & 12 /* Variable */ || getTypeReferenceArity(type) >= pattern.elements.length) { - return type; - } - const patternElements = pattern.elements; - const elementTypes = getElementTypes(type).slice(); - 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 === 209 /* BindingElement */ && e.dotDotDotToken)) { - elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement( - e, - /*includePatternInType*/ - false, - /*reportErrors*/ - false - ) : anyType); - elementFlags.push(2 /* Optional */); - if (!isOmittedExpression(e) && !hasDefaultValue(e)) { - reportImplicitAny(e, anyType); - } - } - } - return createTupleType(elementTypes, elementFlags, type.target.readonly); - } - function widenTypeInferredFromInitializer(declaration, type) { - const widened = getWidenedLiteralTypeForInitializer(declaration, type); - if (isInJSFile(declaration)) { - if (isEmptyLiteralType(widened)) { - reportImplicitAny(declaration, anyType); - return anyType; - } else if (isEmptyArrayLiteralType(widened)) { - reportImplicitAny(declaration, anyArrayType); - return anyArrayType; - } - } - return widened; - } - function getWidenedLiteralTypeForInitializer(declaration, type) { - return getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type); - } - function isLiteralOfContextualType(candidateType, contextualType) { - if (contextualType) { - if (contextualType.flags & 3145728 /* UnionOrIntersection */) { - const types = contextualType.types; - return some(types, (t) => isLiteralOfContextualType(candidateType, t)); - } - if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { - const constraint = getBaseConstraintOfType(contextualType) || unknownType; - return maybeTypeOfKind(constraint, 4 /* String */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || maybeTypeOfKind(constraint, 8 /* Number */) && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || maybeTypeOfKind(constraint, 64 /* BigInt */) && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || maybeTypeOfKind(constraint, 4096 /* ESSymbol */) && maybeTypeOfKind(candidateType, 8192 /* UniqueESSymbol */) || isLiteralOfContextualType(candidateType, constraint); - } - return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || contextualType.flags & 256 /* NumberLiteral */ && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || contextualType.flags & 2048 /* BigIntLiteral */ && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || contextualType.flags & 512 /* BooleanLiteral */ && maybeTypeOfKind(candidateType, 512 /* BooleanLiteral */) || contextualType.flags & 8192 /* UniqueESSymbol */ && maybeTypeOfKind(candidateType, 8192 /* UniqueESSymbol */)); - } - return false; - } - function isConstContext(node) { - const parent2 = node.parent; - return isAssertionExpression(parent2) && isConstTypeReference(parent2.type) || isJSDocTypeAssertion(parent2) && isConstTypeReference(getJSDocTypeAssertionType(parent2)) || isValidConstAssertionArgument(node) && isConstTypeVariable(getContextualType2(node, 0 /* None */)) || (isParenthesizedExpression(parent2) || isArrayLiteralExpression(parent2) || isSpreadElement(parent2)) && isConstContext(parent2) || (isPropertyAssignment(parent2) || isShorthandPropertyAssignment(parent2) || isTemplateSpan(parent2)) && isConstContext(parent2.parent); - } - function checkExpressionForMutableLocation(node, checkMode, forceTuple) { - const type = checkExpression(node, checkMode, forceTuple); - return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType( - getContextualType2( - node, - /*contextFlags*/ - void 0 - ), - node, - /*contextFlags*/ - void 0 - )); - } - function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 168 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - } - return checkExpressionForMutableLocation(node.initializer, checkMode); - } - function checkObjectLiteralMethod(node, checkMode) { - checkGrammarMethod(node); - if (node.name.kind === 168 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - } - const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); - } - function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { - if (checkMode && checkMode & (2 /* Inferential */ | 8 /* SkipGenericFunctions */)) { - const callSignature = getSingleSignature( - type, - 0 /* Call */, - /*allowMembers*/ - true - ); - const constructSignature = getSingleSignature( - type, - 1 /* Construct */, - /*allowMembers*/ - true - ); - const signature = callSignature || constructSignature; - if (signature && signature.typeParameters) { - const contextualType = getApparentTypeOfContextualType(node, 2 /* NoConstraints */); - if (contextualType) { - const contextualSignature = getSingleSignature( - getNonNullableType(contextualType), - callSignature ? 0 /* Call */ : 1 /* Construct */, - /*allowMembers*/ - false - ); - if (contextualSignature && !contextualSignature.typeParameters) { - if (checkMode & 8 /* SkipGenericFunctions */) { - skippedGenericFunction(node, checkMode); - return anyFunctionType; - } - const context = getInferenceContext(node); - const returnType = context.signature && getReturnTypeOfSignature(context.signature); - const returnSignature = returnType && getSingleCallOrConstructSignature(returnType); - if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, hasInferenceCandidates)) { - const uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters); - const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters); - const inferences = map(context.inferences, (info) => createInferenceInfo(info.typeParameter)); - applyToParameterTypes(instantiatedSignature, contextualSignature, (source, target) => { - inferTypes( - inferences, - source, - target, - /*priority*/ - 0, - /*contravariant*/ - true - ); - }); - if (some(inferences, hasInferenceCandidates)) { - applyToReturnTypes(instantiatedSignature, contextualSignature, (source, target) => { - inferTypes(inferences, source, target); - }); - if (!hasOverlappingInferences(context.inferences, inferences)) { - mergeInferences(context.inferences, inferences); - context.inferredTypeParameters = concatenate(context.inferredTypeParameters, uniqueTypeParameters); - return getOrCreateTypeFromSignature(instantiatedSignature); - } - } - } - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context)); - } - } - } - } - return type; - } - function skippedGenericFunction(node, checkMode) { - if (checkMode & 2 /* Inferential */) { - const context = getInferenceContext(node); - context.flags |= 4 /* SkippedGenericFunction */; - } - } - function hasInferenceCandidates(info) { - return !!(info.candidates || info.contraCandidates); - } - function hasInferenceCandidatesOrDefault(info) { - return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter)); - } - function hasOverlappingInferences(a, b) { - for (let i = 0; i < a.length; i++) { - if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) { - return true; - } - } - return false; - } - function mergeInferences(target, source) { - for (let i = 0; i < target.length; i++) { - if (!hasInferenceCandidates(target[i]) && hasInferenceCandidates(source[i])) { - target[i] = source[i]; - } - } - } - function getUniqueTypeParameters(context, typeParameters) { - const result = []; - let oldTypeParameters; - let newTypeParameters; - for (const tp of typeParameters) { - const name = tp.symbol.escapedName; - if (hasTypeParameterByName(context.inferredTypeParameters, name) || hasTypeParameterByName(result, name)) { - const newName = getUniqueTypeParameterName(concatenate(context.inferredTypeParameters, result), name); - const symbol = createSymbol(262144 /* TypeParameter */, newName); - const newTypeParameter = createTypeParameter(symbol); - newTypeParameter.target = tp; - oldTypeParameters = append(oldTypeParameters, tp); - newTypeParameters = append(newTypeParameters, newTypeParameter); - result.push(newTypeParameter); - } else { - result.push(tp); - } - } - if (newTypeParameters) { - const mapper = createTypeMapper(oldTypeParameters, newTypeParameters); - for (const tp of newTypeParameters) { - tp.mapper = mapper; - } - } - return result; - } - function hasTypeParameterByName(typeParameters, name) { - return some(typeParameters, (tp) => tp.symbol.escapedName === name); - } - function getUniqueTypeParameterName(typeParameters, baseName) { - let len = baseName.length; - while (len > 1 && baseName.charCodeAt(len - 1) >= 48 /* _0 */ && baseName.charCodeAt(len - 1) <= 57 /* _9 */) len--; - const s = baseName.slice(0, len); - for (let index = 1; true; index++) { - const augmentedName = s + index; - if (!hasTypeParameterByName(typeParameters, augmentedName)) { - return augmentedName; - } - } - } - function getReturnTypeOfSingleNonGenericCallSignature(funcType) { - const signature = getSingleCallSignature(funcType); - if (signature && !signature.typeParameters) { - return getReturnTypeOfSignature(signature); - } - } - function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) { - const funcType = checkExpression(expr.expression); - const nonOptionalType = getOptionalExpressionType(funcType, expr.expression); - const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType); - return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType); - } - function getTypeOfExpression(node) { - const quickType = getQuickTypeOfExpression(node); - if (quickType) { - return quickType; - } - if (node.flags & 268435456 /* TypeCached */ && flowTypeCache) { - const cachedType = flowTypeCache[getNodeId(node)]; - if (cachedType) { - return cachedType; - } - } - const startInvocationCount = flowInvocationCount; - const type = checkExpression(node, 64 /* TypeOnly */); - if (flowInvocationCount !== startInvocationCount) { - const cache = flowTypeCache || (flowTypeCache = []); - cache[getNodeId(node)] = type; - setNodeFlags(node, node.flags | 268435456 /* TypeCached */); - } - return type; - } - function getQuickTypeOfExpression(node) { - let expr = skipParentheses( - node, - /*excludeJSDocTypeAssertions*/ - true - ); - if (isJSDocTypeAssertion(expr)) { - const type = getJSDocTypeAssertionType(expr); - if (!isConstTypeReference(type)) { - return getTypeFromTypeNode(type); - } - } - expr = skipParentheses(node); - if (isAwaitExpression(expr)) { - const type = getQuickTypeOfExpression(expr.expression); - return type ? getAwaitedType(type) : void 0; - } - if (isCallExpression(expr) && expr.expression.kind !== 108 /* SuperKeyword */ && !isRequireCall( - expr, - /*requireStringLiteralLikeArgument*/ - true - ) && !isSymbolOrSymbolForCall(expr) && !isImportCall(expr)) { - return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); - } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { - return getTypeFromTypeNode(expr.type); - } else if (isLiteralExpression(node) || isBooleanLiteral(node)) { - return checkExpression(node); - } - return void 0; - } - function getContextFreeTypeOfExpression(node) { - const links = getNodeLinks(node); - if (links.contextFreeType) { - return links.contextFreeType; - } - pushContextualType( - node, - anyType, - /*isCache*/ - false - ); - const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */); - popContextualType(); - return type; - } - function checkExpression(node, checkMode, forceTuple) { - var _a, _b; - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); - const saveCurrentNode = currentNode; - currentNode = node; - instantiationCount = 0; - const uninstantiatedType = checkExpressionWorker(node, checkMode, forceTuple); - const type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); - if (isConstEnumObjectType(type)) { - checkConstEnumAccess(node, type); - } - currentNode = saveCurrentNode; - (_b = tracing) == null ? void 0 : _b.pop(); - return type; - } - function checkConstEnumAccess(node, type) { - var _a; - const ok = node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 213 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 167 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 187 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 282 /* ExportSpecifier */; - if (!ok) { - 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 (compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax && ok && !resolveName( - node, - getFirstIdentifier(node), - 2097152 /* Alias */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false, - /*excludeGlobals*/ - true - )) { - Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); - const constEnumDeclaration = type.symbol.valueDeclaration; - const redirect = (_a = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _a.resolvedRef; - if (constEnumDeclaration.flags & 33554432 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) { - error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); - } - } - } - function checkParenthesizedExpression(node, checkMode) { - if (hasJSDocNodes(node)) { - if (isJSDocSatisfiesExpression(node)) { - return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode); - } - if (isJSDocTypeAssertion(node)) { - return checkAssertionWorker(node, checkMode); - } - } - return checkExpression(node.expression, checkMode); - } - function checkExpressionWorker(node, checkMode, forceTuple) { - const kind = node.kind; - if (cancellationToken) { - switch (kind) { - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } - } - switch (kind) { - case 80 /* Identifier */: - return checkIdentifier(node, checkMode); - case 81 /* PrivateIdentifier */: - return checkPrivateIdentifierExpression(node); - case 110 /* ThisKeyword */: - return checkThisExpression(node); - case 108 /* SuperKeyword */: - return checkSuperExpression(node); - case 106 /* NullKeyword */: - return nullWideningType; - case 15 /* NoSubstitutionTemplateLiteral */: - case 11 /* StringLiteral */: - return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text)); - case 9 /* NumericLiteral */: - checkGrammarNumericLiteral(node); - return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text)); - case 10 /* BigIntLiteral */: - checkGrammarBigIntLiteral(node); - return getFreshTypeOfLiteralType(getBigIntLiteralType({ - negative: false, - base10Value: parsePseudoBigInt(node.text) - })); - case 112 /* TrueKeyword */: - return trueType; - case 97 /* FalseKeyword */: - return falseType; - case 229 /* TemplateExpression */: - return checkTemplateExpression(node); - case 14 /* RegularExpressionLiteral */: - return checkRegularExpressionLiteral(node); - case 210 /* ArrayLiteralExpression */: - return checkArrayLiteral(node, checkMode, forceTuple); - case 211 /* ObjectLiteralExpression */: - return checkObjectLiteral(node, checkMode); - case 212 /* PropertyAccessExpression */: - return checkPropertyAccessExpression(node, checkMode); - case 167 /* QualifiedName */: - return checkQualifiedName(node, checkMode); - case 213 /* ElementAccessExpression */: - return checkIndexedAccess(node, checkMode); - case 214 /* CallExpression */: - if (isImportCall(node)) { - return checkImportCallExpression(node); - } - // falls through - case 215 /* NewExpression */: - return checkCallExpression(node, checkMode); - case 216 /* TaggedTemplateExpression */: - return checkTaggedTemplateExpression(node); - case 218 /* ParenthesizedExpression */: - return checkParenthesizedExpression(node, checkMode); - case 232 /* ClassExpression */: - return checkClassExpression(node); - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 222 /* TypeOfExpression */: - return checkTypeOfExpression(node); - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - return checkAssertion(node, checkMode); - case 236 /* NonNullExpression */: - return checkNonNullAssertion(node); - case 234 /* ExpressionWithTypeArguments */: - return checkExpressionWithTypeArguments(node); - case 239 /* SatisfiesExpression */: - return checkSatisfiesExpression(node); - case 237 /* MetaProperty */: - return checkMetaProperty(node); - case 221 /* DeleteExpression */: - return checkDeleteExpression(node); - case 223 /* VoidExpression */: - return checkVoidExpression(node); - case 224 /* AwaitExpression */: - return checkAwaitExpression(node); - case 225 /* PrefixUnaryExpression */: - return checkPrefixUnaryExpression(node); - case 226 /* PostfixUnaryExpression */: - return checkPostfixUnaryExpression(node); - case 227 /* BinaryExpression */: - return checkBinaryExpression(node, checkMode); - case 228 /* ConditionalExpression */: - return checkConditionalExpression(node, checkMode); - case 231 /* SpreadElement */: - return checkSpreadExpression(node, checkMode); - case 233 /* OmittedExpression */: - return undefinedWideningType; - case 230 /* YieldExpression */: - return checkYieldExpression(node); - case 238 /* SyntheticExpression */: - return checkSyntheticExpression(node); - case 295 /* JsxExpression */: - return checkJsxExpression(node, checkMode); - case 285 /* JsxElement */: - return checkJsxElement(node, checkMode); - case 286 /* JsxSelfClosingElement */: - return checkJsxSelfClosingElement(node, checkMode); - case 289 /* JsxFragment */: - return checkJsxFragment(node); - case 293 /* JsxAttributes */: - return checkJsxAttributes(node, checkMode); - case 287 /* JsxOpeningElement */: - Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); - } - return errorType; - } - function checkTypeParameter(node) { - checkGrammarModifiers(node); - if (node.expression) { - grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); - } - checkSourceElement(node.constraint); - checkSourceElement(node.default); - const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node)); - getBaseConstraintOfType(typeParameter); - if (!hasNonCircularTypeParameterDefault(typeParameter)) { - error2(node.default, Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter)); - } - const constraintType = getConstraintOfTypeParameter(typeParameter); - const defaultType = getDefaultFromTypeParameter(typeParameter); - if (constraintType && defaultType) { - checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - checkNodeDeferred(node); - addLazyDiagnostic(() => checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0)); - } - function checkTypeParameterDeferred(node) { - var _a, _b; - if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) { - const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node)); - 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 */))) { - 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 === 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); - varianceTypeParameter = saveVarianceTypeParameter; - (_b = tracing) == null ? void 0 : _b.pop(); - } - } - } - } - function checkParameter(node) { - checkGrammarModifiers(node); - checkVariableLikeDeclaration(node); - const func = getContainingFunction(node); - if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) { - if (compilerOptions.erasableSyntaxOnly) { - error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); - } - if (!(func.kind === 177 /* Constructor */ && nodeIsPresent(func.body))) { - error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - if (func.kind === 177 /* 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) { - 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) { - error2(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); - } - if (func.kind === 177 /* Constructor */ || func.kind === 181 /* ConstructSignature */ || func.kind === 186 /* ConstructorType */) { - error2(node, Diagnostics.A_constructor_cannot_have_a_this_parameter); - } - if (func.kind === 220 /* ArrowFunction */) { - error2(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); - } - if (func.kind === 178 /* GetAccessor */ || func.kind === 179 /* SetAccessor */) { - error2(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); - } - } - if (node.dotDotDotToken && !isBindingPattern(node.name) && !isTypeAssignableTo(getReducedType(getTypeOfSymbol(node.symbol)), anyReadonlyArrayType)) { - error2(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } - } - function checkTypePredicate(node) { - const parent2 = getTypePredicateParent(node); - if (!parent2) { - error2(node, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - return; - } - const signature = getSignatureFromDeclaration(parent2); - const typePredicate = getTypePredicateOfSignature(signature); - if (!typePredicate) { - return; - } - checkSourceElement(node.type); - const { parameterName } = node; - if (typePredicate.kind !== 0 /* This */ && typePredicate.kind !== 2 /* AssertsThis */) { - if (typePredicate.parameterIndex >= 0) { - if (signatureHasRestParameter(signature) && typePredicate.parameterIndex === signature.parameters.length - 1) { - error2(parameterName, Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); - } else { - if (typePredicate.type) { - const leadingError = () => chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type - ); - checkTypeAssignableTo( - typePredicate.type, - getTypeOfSymbol(signature.parameters[typePredicate.parameterIndex]), - node.type, - /*headMessage*/ - void 0, - leadingError - ); - } - } - } else if (parameterName) { - let hasReportedError = false; - for (const { name } of parent2.parameters) { - if (isBindingPattern(name) && checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { - hasReportedError = true; - break; - } - } - if (!hasReportedError) { - error2(node.parameterName, Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); - } - } - } - } - function getTypePredicateParent(node) { - switch (node.parent.kind) { - case 220 /* ArrowFunction */: - case 180 /* CallSignature */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 185 /* FunctionType */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - const parent2 = node.parent; - if (node === parent2.type) { - return parent2; - } - } - } - function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern, predicateVariableNode, predicateVariableName) { - for (const element of pattern.elements) { - if (isOmittedExpression(element)) { - continue; - } - const name = element.name; - if (name.kind === 80 /* Identifier */ && name.escapedText === predicateVariableName) { - error2(predicateVariableNode, Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); - return true; - } else if (name.kind === 208 /* ArrayBindingPattern */ || name.kind === 207 /* ObjectBindingPattern */) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern( - name, - predicateVariableNode, - predicateVariableName - )) { - return true; - } - } - } - } - function checkSignatureDeclaration(node) { - if (node.kind === 182 /* IndexSignature */) { - checkGrammarIndexSignature(node); - } else if (node.kind === 185 /* FunctionType */ || node.kind === 263 /* FunctionDeclaration */ || node.kind === 186 /* ConstructorType */ || node.kind === 180 /* CallSignature */ || node.kind === 177 /* Constructor */ || node.kind === 181 /* ConstructSignature */) { - checkGrammarFunctionLikeDeclaration(node); - } - const functionFlags = getFunctionFlags(node); - if (!(functionFlags & 4 /* Invalid */)) { - if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) { - checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */); - } - if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.AsyncFunctions) { - checkExternalEmitHelpers(node, 64 /* Awaiter */); - } - if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < LanguageFeatureMinimumTarget.Generators) { - checkExternalEmitHelpers(node, 128 /* Generator */); - } - } - checkTypeParameters(getEffectiveTypeParameterDeclarations(node)); - checkUnmatchedJSDocParameters(node); - forEach(node.parameters, checkParameter); - if (node.type) { - checkSourceElement(node.type); - } - addLazyDiagnostic(checkSignatureDeclarationDiagnostics); - function checkSignatureDeclarationDiagnostics() { - checkCollisionWithArgumentsInGeneratedCode(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 181 /* ConstructSignature */: - error2(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - case 180 /* CallSignature */: - error2(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - } - } - if (returnTypeNode && returnTypeErrorLocation) { - const functionFlags2 = getFunctionFlags(node); - if ((functionFlags2 & (4 /* Invalid */ | 1 /* Generator */)) === 1 /* Generator */) { - const returnType = getTypeFromTypeNode(returnTypeNode); - if (returnType === voidType) { - error2(returnTypeErrorLocation, Diagnostics.A_generator_cannot_have_a_void_type_annotation); - } else { - checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags2, returnTypeErrorLocation); - } - } else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) { - checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation); - } - } - if (node.kind !== 182 /* IndexSignature */ && node.kind !== 318 /* 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 = createGeneratorType(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 === 177 /* Constructor */) { - for (const param of member.parameters) { - if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) { - addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */); - } - } - } else { - const isStaticMember = isStatic(member); - const name = member.name; - if (!name) { - continue; - } - const isPrivate = isPrivateIdentifier(name); - const privateStaticFlags = isPrivate && isStaticMember ? 16 /* PrivateStatic */ : 0; - const names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames; - const memberName = name && getEffectivePropertyNameForPropertyNameNode(name); - if (memberName) { - switch (member.kind) { - case 178 /* GetAccessor */: - addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags); - break; - case 179 /* SetAccessor */: - addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags); - break; - case 173 /* PropertyDeclaration */: - addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags); - break; - case 175 /* MethodDeclaration */: - addName(names, name, memberName, 8 /* Method */ | privateStaticFlags); - break; - } - } - } - } - function addName(names, location, name, meaning) { - const prev = names.get(name); - if (prev) { - if ((prev & 16 /* PrivateStatic */) !== (meaning & 16 /* PrivateStatic */)) { - 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) { - error2(location, Diagnostics.Duplicate_identifier_0, getTextOfNode(location)); - } - } else if (prev & meaning & ~16 /* PrivateStatic */) { - error2(location, Diagnostics.Duplicate_identifier_0, getTextOfNode(location)); - } else { - names.set(name, prev | meaning); - } - } - } else { - names.set(name, meaning); - } - } - } - function checkClassForStaticPropertyNameConflicts(node) { - for (const member of node.members) { - const memberNameNode = member.name; - const isStaticMember = isStatic(member); - if (isStaticMember && memberNameNode) { - const memberName = getEffectivePropertyNameForPropertyNameNode(memberNameNode); - switch (memberName) { - case "name": - case "length": - case "caller": - case "arguments": - if (useDefineForClassFields) { - break; - } - // fall through - case "prototype": - const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; - const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node)); - error2(memberNameNode, message, memberName, className); - break; - } - } - } - } - function checkObjectTypeForDuplicateDeclarations(node) { - const names = /* @__PURE__ */ new Map(); - for (const member of node.members) { - if (member.kind === 172 /* PropertySignature */) { - let memberName; - const name = member.name; - switch (name.kind) { - case 11 /* StringLiteral */: - case 9 /* NumericLiteral */: - memberName = name.text; - break; - case 80 /* Identifier */: - memberName = idText(name); - break; - default: - continue; - } - if (names.get(memberName)) { - error2(getNameOfDeclaration(member.symbol.valueDeclaration), Diagnostics.Duplicate_identifier_0, memberName); - error2(member.name, Diagnostics.Duplicate_identifier_0, memberName); - } else { - names.set(memberName, true); - } - } - } - } - function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 265 /* InterfaceDeclaration */) { - const nodeSymbol = getSymbolOfDeclaration(node); - if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { - return; - } - } - const indexSymbol = getIndexSymbol(getSymbolOfDeclaration(node)); - if (indexSymbol == null ? void 0 : indexSymbol.declarations) { - const indexSignatureMap = /* @__PURE__ */ new Map(); - for (const declaration of indexSymbol.declarations) { - if (isIndexSignatureDeclaration(declaration)) { - if (declaration.parameters.length === 1 && declaration.parameters[0].type) { - forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => { - const entry = indexSignatureMap.get(getTypeId(type)); - if (entry) { - entry.declarations.push(declaration); - } else { - indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] }); - } - }); - } - } - } - indexSignatureMap.forEach((entry) => { - if (entry.declarations.length > 1) { - for (const declaration of entry.declarations) { - error2(declaration, Diagnostics.Duplicate_index_signature_for_type_0, typeToString(entry.type)); - } - } - }); - } - } - function checkPropertyDeclaration(node) { - if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) checkGrammarComputedPropertyName(node.name); - checkVariableLikeDeclaration(node); - setNodeLinksForPrivateIdentifierScope(node); - if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 173 /* 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)) { - error2(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - } - return checkPropertyDeclaration(node); - } - function checkMethodDeclaration(node) { - if (!checkGrammarMethod(node)) checkGrammarComputedPropertyName(node.name); - if (isMethodDeclaration(node) && node.asteriskToken && isIdentifier(node.name) && idText(node.name) === "constructor") { - error2(node.name, Diagnostics.Class_constructor_may_not_be_a_generator); - } - checkFunctionOrMethodDeclaration(node); - if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 175 /* 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)) { - error2(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - } - setNodeLinksForPrivateIdentifierScope(node); - } - function setNodeLinksForPrivateIdentifierScope(node) { - if (isPrivateIdentifier(node.name)) { - if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) { - for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) { - getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */; - } - if (isClassExpression(node.parent)) { - const enclosingIterationStatement = getEnclosingIterationStatement(node.parent); - if (enclosingIterationStatement) { - getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */; - getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */; - } - } - } - } - } - function checkClassStaticBlockDeclaration(node) { - checkGrammarModifiers(node); - forEachChild(node, checkSourceElement); - } - function checkConstructorDeclaration(node) { - checkSignatureDeclaration(node); - if (!checkGrammarConstructorTypeParameters(node)) checkGrammarConstructorTypeAnnotation(node); - checkSourceElement(node.body); - const symbol = getSymbolOfDeclaration(node); - const firstDeclaration = getDeclarationOfKind(symbol, node.kind); - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(symbol); - } - if (nodeIsMissing(node.body)) { - return; - } - addLazyDiagnostic(checkConstructorDeclarationDiagnostics); - return; - function isInstancePropertyWithInitializerOrPrivateIdentifierProperty(n) { - if (isPrivateIdentifierClassElementDeclaration(n)) { - return true; - } - return n.kind === 173 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer; - } - function checkConstructorDeclarationDiagnostics() { - const containingClassDecl = node.parent; - if (getClassExtendsHeritageElement(containingClassDecl)) { - captureLexicalThis(node.parent, containingClassDecl); - const classExtendsNull = classDeclarationExtendsNull(containingClassDecl); - const superCall = findFirstSuperCall(node.body); - if (superCall) { - if (classExtendsNull) { - error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); - } - const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 31 /* ParameterPropertyModifier */))); - if (superCallShouldBeRootLevel) { - if (!superCallIsRootLevelInConstructor(superCall, node.body)) { - 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) { - if (isExpressionStatement(statement) && isSuperCall(skipOuterExpressions(statement.expression))) { - superCallStatement = statement; - break; - } - if (nodeImmediatelyReferencesSuperOrThis(statement)) { - break; - } - } - if (superCallStatement === void 0) { - 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) { - error2(node, Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); - } - } - } - } - function superCallIsRootLevelInConstructor(superCall, body) { - const superCallParent = walkUpParenthesizedExpressions(superCall.parent); - return isExpressionStatement(superCallParent) && superCallParent.parent === body; - } - function nodeImmediatelyReferencesSuperOrThis(node) { - if (node.kind === 108 /* SuperKeyword */ || node.kind === 110 /* ThisKeyword */) { - return true; - } - if (isThisContainerOrFunctionBlock(node)) { - return false; - } - return !!forEachChild(node, nodeImmediatelyReferencesSuperOrThis); - } - function checkAccessorDeclaration(node) { - if (isIdentifier(node.name) && idText(node.name) === "constructor" && isClassLike(node.parent)) { - error2(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor); - } - addLazyDiagnostic(checkAccessorDeclarationDiagnostics); - checkSourceElement(node.body); - setNodeLinksForPrivateIdentifierScope(node); - function checkAccessorDeclarationDiagnostics() { - if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node)) checkGrammarComputedPropertyName(node.name); - checkDecorators(node); - checkSignatureDeclaration(node); - if (node.kind === 178 /* 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 === 168 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - } - if (hasBindableName(node)) { - const symbol = getSymbolOfDeclaration(node); - const getter = getDeclarationOfKind(symbol, 178 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */); - if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) { - getNodeLinks(getter).flags |= 1 /* TypeChecked */; - const getterFlags = getEffectiveModifierFlags(getter); - const setterFlags = getEffectiveModifierFlags(setter); - 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 & 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 === 178 /* GetAccessor */) { - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); - } - } - } - function checkMissingDeclaration(node) { - checkDecorators(node); - } - function getEffectiveTypeArgumentAtIndex(node, typeParameters, index) { - if (node.typeArguments && index < node.typeArguments.length) { - return getTypeFromTypeNode(node.typeArguments[index]); - } - return getEffectiveTypeArguments2(node, typeParameters)[index]; - } - function getEffectiveTypeArguments2(node, typeParameters) { - return fillMissingTypeArguments(map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(node)); - } - function checkTypeArgumentConstraints(node, typeParameters) { - let typeArguments; - let mapper; - let result = true; - for (let i = 0; i < typeParameters.length; i++) { - const constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { - if (!typeArguments) { - typeArguments = getEffectiveTypeArguments2(node, typeParameters); - mapper = createTypeMapper(typeParameters, typeArguments); - } - result = result && checkTypeAssignableTo( - typeArguments[i], - instantiateType(constraint, mapper), - node.typeArguments[i], - Diagnostics.Type_0_does_not_satisfy_the_constraint_1 - ); - } - } - return result; - } - function getTypeParametersForTypeAndSymbol(type, symbol) { - if (!isErrorType(type)) { - return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || (getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : void 0); - } - return void 0; - } - function getTypeParametersForTypeReferenceOrImport(node) { - const type = getTypeFromTypeNode(node); - if (!isErrorType(type)) { - const symbol = getNodeLinks(node).resolvedSymbol; - if (symbol) { - return getTypeParametersForTypeAndSymbol(type, symbol); - } - } - return void 0; - } - function checkTypeReferenceNode(node) { - checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 184 /* 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); - } - } - forEach(node.typeArguments, checkSourceElement); - checkTypeReferenceOrImport(node); - } - function checkTypeReferenceOrImport(node) { - const type = getTypeFromTypeNode(node); - if (!isErrorType(type)) { - if (node.typeArguments) { - addLazyDiagnostic(() => { - const typeParameters = getTypeParametersForTypeReferenceOrImport(node); - if (typeParameters) { - checkTypeArgumentConstraints(node, typeParameters); - } - }); - } - const symbol = getNodeLinks(node).resolvedSymbol; - if (symbol) { - if (some(symbol.declarations, (d) => isTypeDeclaration(d) && !!(d.flags & 536870912 /* Deprecated */))) { - addDeprecatedSuggestion( - getDeprecatedSuggestionNode(node), - symbol.declarations, - symbol.escapedName - ); - } - } - } - } - function getTypeArgumentConstraint(node) { - const typeReferenceNode = tryCast(node.parent, isTypeReferenceType); - if (!typeReferenceNode) return void 0; - const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReferenceNode); - if (!typeParameters) return void 0; - const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); - return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments2(typeReferenceNode, typeParameters))); - } - function checkTypeQuery(node) { - getTypeFromTypeQueryNode(node); - } - function checkTypeLiteral(node) { - forEach(node.members, checkSourceElement); - addLazyDiagnostic(checkTypeLiteralDiagnostics); - function checkTypeLiteralDiagnostics() { - const type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - checkIndexConstraints(type, type.symbol); - checkTypeForDuplicateIndexSignatures(node); - checkObjectTypeForDuplicateDeclarations(node); - } - } - function checkArrayType(node) { - checkSourceElement(node.elementType); - } - function checkTupleType(node) { - let seenOptionalElement = false; - let seenRestElement = false; - for (const e of node.elements) { - let flags = getTupleElementFlags(e); - if (flags & 8 /* Variadic */) { - const type = getTypeFromTypeNode(e.type); - if (!isArrayLikeType(type)) { - error2(e, Diagnostics.A_rest_element_type_must_be_an_array_type); - break; - } - if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) { - flags |= 4 /* Rest */; - } - } - if (flags & 4 /* Rest */) { - if (seenRestElement) { - grammarErrorOnNode(e, Diagnostics.A_rest_element_cannot_follow_another_rest_element); - break; - } - seenRestElement = true; - } else if (flags & 2 /* Optional */) { - if (seenRestElement) { - grammarErrorOnNode(e, Diagnostics.An_optional_element_cannot_follow_a_rest_element); - break; - } - seenOptionalElement = true; - } else if (flags & 1 /* Required */ && seenOptionalElement) { - grammarErrorOnNode(e, Diagnostics.A_required_element_cannot_follow_an_optional_element); - break; - } - } - forEach(node.elements, checkSourceElement); - getTypeFromTypeNode(node); - } - function checkUnionOrIntersectionType(node) { - forEach(node.types, checkSourceElement); - getTypeFromTypeNode(node); - } - function checkIndexedAccessIndexType(type, accessNode) { - if (!(type.flags & 8388608 /* IndexedAccess */)) { - return type; - } - const objectType = type.objectType; - const indexType = type.indexType; - 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 === 213 /* 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; - } - if (isGenericObjectType(objectType)) { - const propertyName = getPropertyNameFromIndex(indexType, accessNode); - if (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; - } - } - } - error2(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return errorType; - } - function checkIndexedAccessType(node) { - checkSourceElement(node.objectType); - checkSourceElement(node.indexType); - checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); - } - function checkMappedType(node) { - checkGrammarMappedType(node); - checkSourceElement(node.typeParameter); - checkSourceElement(node.nameType); - checkSourceElement(node.type); - if (!node.type) { - reportImplicitAny(node, anyType); - } - const type = getTypeFromMappedTypeNode(node); - const nameType = getNameTypeFromMappedType(type); - if (nameType) { - checkTypeAssignableTo(nameType, stringNumberSymbolType, node.nameType); - } else { - const constraintType = getConstraintTypeFromMappedType(type); - checkTypeAssignableTo(constraintType, stringNumberSymbolType, getEffectiveConstraintOfTypeParameter(node.typeParameter)); - } - } - function checkGrammarMappedType(node) { - var _a; - if ((_a = node.members) == null ? void 0 : _a.length) { - return grammarErrorOnNode(node.members[0], Diagnostics.A_mapped_type_may_not_declare_properties_or_methods); - } - } - function checkThisType(node) { - getTypeFromThisTypeNode(node); - } - function checkTypeOperator(node) { - checkGrammarTypeOperatorNode(node); - checkSourceElement(node.type); - } - function checkConditionalType(node) { - forEachChild(node, checkSourceElement); - } - function checkInferType(node) { - if (!findAncestor(node, (n) => n.parent && n.parent.kind === 195 /* ConditionalType */ && n.parent.extendsType === n)) { - grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); - } - checkSourceElement(node.typeParameter); - const symbol = getSymbolOfDeclaration(node.typeParameter); - if (symbol.declarations && symbol.declarations.length > 1) { - const links = getSymbolLinks(symbol); - if (!links.typeParametersChecked) { - links.typeParametersChecked = true; - const typeParameter = getDeclaredTypeOfTypeParameter(symbol); - const declarations = getDeclarationsOfKind(symbol, 169 /* TypeParameter */); - if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) { - const name = symbolToString(symbol); - for (const declaration of declarations) { - error2(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_constraints, name); - } - } - } - } - registerForUnusedIdentifiersCheck(node); - } - function checkTemplateLiteralType(node) { - for (const span of node.templateSpans) { - checkSourceElement(span.type); - const type = getTypeFromTypeNode(span.type); - checkTypeAssignableTo(type, templateConstraintType, span.type); - } - getTypeFromTypeNode(node); - } - function checkImportType(node) { - checkSourceElement(node.argument); - if (node.attributes) { - getResolutionModeOverride(node.attributes, grammarErrorOnNode); - } - checkTypeReferenceOrImport(node); - } - function checkNamedTupleMember(node) { - if (node.dotDotDotToken && node.questionToken) { - grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); - } - if (node.type.kind === 191 /* 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 === 192 /* 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, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 33554432 /* Ambient */); - } - function getEffectiveDeclarationFlags(n, flagsToCheck) { - let flags = getCombinedModifierFlagsCached(n); - if (n.parent.kind !== 265 /* InterfaceDeclaration */ && n.parent.kind !== 264 /* ClassDeclaration */ && n.parent.kind !== 232 /* 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 |= 128 /* Ambient */; - } - return flags & flagsToCheck; - } - function checkFunctionOrConstructorSymbol(symbol) { - addLazyDiagnostic(() => checkFunctionOrConstructorSymbolWorker(symbol)); - } - function checkFunctionOrConstructorSymbolWorker(symbol) { - function getCanonicalOverload(overloads, implementation) { - const implementationSharesContainerWithFirstOverload = implementation !== void 0 && implementation.parent === overloads[0].parent; - return implementationSharesContainerWithFirstOverload ? implementation : overloads[0]; - } - function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck2, someOverloadFlags, allOverloadFlags) { - const someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; - if (someButNotAllOverloadFlags !== 0) { - const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2); - group(overloads, (o) => getSourceFileOfNode(o).fileName).forEach((overloadsInFile) => { - const canonicalFlagsForFile = getEffectiveDeclarationFlags(getCanonicalOverload(overloadsInFile, implementation), flagsToCheck2); - for (const o of overloadsInFile) { - const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags; - const deviationInFile = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlagsForFile; - if (deviationInFile & 32 /* Export */) { - error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported); - } else if (deviationInFile & 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); - } - } - }); - } - } - function checkQuestionTokenAgreementBetweenOverloads(overloads, implementation, someHaveQuestionToken2, allHaveQuestionToken2) { - if (someHaveQuestionToken2 !== allHaveQuestionToken2) { - const canonicalHasQuestionToken = hasQuestionToken(getCanonicalOverload(overloads, implementation)); - forEach(overloads, (o) => { - const deviation = hasQuestionToken(o) !== canonicalHasQuestionToken; - if (deviation) { - error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_optional_or_required); - } - }); - } - } - const flagsToCheck = 32 /* Export */ | 128 /* Ambient */ | 2 /* Private */ | 4 /* Protected */ | 64 /* Abstract */; - let someNodeFlags = 0 /* None */; - let allNodeFlags = flagsToCheck; - let someHaveQuestionToken = false; - let allHaveQuestionToken = true; - let hasOverloads = false; - let bodyDeclaration; - let lastSeenNonAmbientDeclaration; - let previousDeclaration; - const declarations = symbol.declarations; - const isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; - function reportImplementationExpectedError(node) { - if (node.name && nodeIsMissing(node.name)) { - return; - } - let seen = false; - const subsequentNode = forEachChild(node.parent, (c) => { - if (seen) { - return c; - } else { - seen = c === node; - } - }); - if (subsequentNode && subsequentNode.pos === node.end) { - if (subsequentNode.kind === node.kind) { - const errorNode2 = subsequentNode.name || subsequentNode; - const subsequentName = subsequentNode.name; - if (node.name && subsequentName && // both are private identifiers - (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 === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode); - if (reportError) { - const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; - error2(errorNode2, diagnostic); - } - return; - } - if (nodeIsPresent(subsequentNode.body)) { - error2(errorNode2, Diagnostics.Function_implementation_name_must_be_0, declarationNameToString(node.name)); - return; - } - } - } - const errorNode = node.name || node; - if (isConstructor) { - error2(errorNode, Diagnostics.Constructor_implementation_is_missing); - } else { - if (hasSyntacticModifier(node, 64 /* Abstract */)) { - error2(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); - } else { - error2(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); - } - } - } - let duplicateFunctionDeclaration = false; - let multipleConstructorImplementation = false; - let hasNonAmbientClass = false; - const functionDeclarations = []; - if (declarations) { - for (const current of declarations) { - const node = current; - const inAmbientContext = node.flags & 33554432 /* Ambient */; - const inAmbientContextOrInterface = node.parent && (node.parent.kind === 265 /* InterfaceDeclaration */ || node.parent.kind === 188 /* TypeLiteral */) || inAmbientContext; - if (inAmbientContextOrInterface) { - previousDeclaration = void 0; - } - if ((node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */) && !inAmbientContext) { - hasNonAmbientClass = true; - } - if (node.kind === 263 /* FunctionDeclaration */ || node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */ || node.kind === 177 /* Constructor */) { - functionDeclarations.push(node); - const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); - someNodeFlags |= currentNodeFlags; - allNodeFlags &= currentNodeFlags; - someHaveQuestionToken = someHaveQuestionToken || hasQuestionToken(node); - allHaveQuestionToken = allHaveQuestionToken && hasQuestionToken(node); - const bodyIsPresent = nodeIsPresent(node.body); - if (bodyIsPresent && bodyDeclaration) { - if (isConstructor) { - multipleConstructorImplementation = true; - } else { - duplicateFunctionDeclaration = true; - } - } else if ((previousDeclaration == null ? void 0 : previousDeclaration.parent) === node.parent && previousDeclaration.end !== node.pos) { - reportImplementationExpectedError(previousDeclaration); - } - if (bodyIsPresent) { - if (!bodyDeclaration) { - bodyDeclaration = node; - } - } else { - hasOverloads = true; - } - previousDeclaration = node; - if (!inAmbientContextOrInterface) { - lastSeenNonAmbientDeclaration = node; - } - } - if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) { - hasOverloads = length(getJSDocOverloadTags(current)) > 0; - } - } - } - if (multipleConstructorImplementation) { - forEach(functionDeclarations, (declaration) => { - error2(declaration, Diagnostics.Multiple_constructor_implementations_are_not_allowed); - }); - } - if (duplicateFunctionDeclaration) { - forEach(functionDeclarations, (declaration) => { - error2(getNameOfDeclaration(declaration) || declaration, Diagnostics.Duplicate_function_implementation); - }); - } - if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) { - const relatedDiagnostics = filter(declarations, (d) => d.kind === 264 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); - forEach(declarations, (declaration) => { - const diagnostic = declaration.kind === 264 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 263 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; - if (diagnostic) { - addRelatedInfo( - error2(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)), - ...relatedDiagnostics - ); - } - }); - } - if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration, 64 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) { - reportImplementationExpectedError(lastSeenNonAmbientDeclaration); - } - if (hasOverloads) { - if (declarations) { - checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); - checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken); - } - if (bodyDeclaration) { - const signatures = getSignaturesOfSymbol(symbol); - const bodySignature = getSignatureFromDeclaration(bodyDeclaration); - for (const signature of signatures) { - if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { - const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration; - addRelatedInfo( - error2(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), - createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here) - ); - break; - } - } - } - } - } - function checkExportsOnMergedDeclarations(node) { - addLazyDiagnostic(() => checkExportsOnMergedDeclarationsWorker(node)); - } - function checkExportsOnMergedDeclarationsWorker(node) { - let symbol = node.localSymbol; - if (!symbol) { - symbol = getSymbolOfDeclaration(node); - if (!symbol.exportSymbol) { - return; - } - } - if (getDeclarationOfKind(symbol, node.kind) !== node) { - return; - } - let exportedDeclarationSpaces = 0 /* None */; - let nonExportedDeclarationSpaces = 0 /* None */; - let defaultExportedDeclarationSpaces = 0 /* None */; - for (const d of symbol.declarations) { - const declarationSpaces = getDeclarationSpaces(d); - const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 32 /* Export */ | 2048 /* Default */); - if (effectiveDeclarationFlags & 32 /* Export */) { - if (effectiveDeclarationFlags & 2048 /* Default */) { - defaultExportedDeclarationSpaces |= declarationSpaces; - } else { - exportedDeclarationSpaces |= declarationSpaces; - } - } else { - nonExportedDeclarationSpaces |= declarationSpaces; - } - } - const nonDefaultExportedDeclarationSpaces = exportedDeclarationSpaces | nonExportedDeclarationSpaces; - const commonDeclarationSpacesForExportsAndLocals = exportedDeclarationSpaces & nonExportedDeclarationSpaces; - const commonDeclarationSpacesForDefaultAndNonDefault = defaultExportedDeclarationSpaces & nonDefaultExportedDeclarationSpaces; - if (commonDeclarationSpacesForExportsAndLocals || commonDeclarationSpacesForDefaultAndNonDefault) { - for (const d of symbol.declarations) { - const declarationSpaces = getDeclarationSpaces(d); - const name = getNameOfDeclaration(d); - if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) { - 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) { - 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 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - // A jsdoc typedef and callback are, by definition, type aliases. - // falls through - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - return 2 /* ExportType */; - case 268 /* ModuleDeclaration */: - return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 264 /* ClassDeclaration */: - case 267 /* EnumDeclaration */: - case 307 /* EnumMember */: - return 2 /* ExportType */ | 1 /* ExportValue */; - case 308 /* SourceFile */: - return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 278 /* ExportAssignment */: - case 227 /* BinaryExpression */: - const node2 = d; - const expression = isExportAssignment(node2) ? node2.expression : node2.right; - if (!isEntityNameExpression(expression)) { - return 1 /* ExportValue */; - } - d = expression; - // The below options all declare an Alias, which is allowed to merge with other values within the importing module. - // falls through - case 272 /* ImportEqualsDeclaration */: - case 275 /* NamespaceImport */: - case 274 /* ImportClause */: - let result = 0 /* None */; - const target = resolveAlias(getSymbolOfDeclaration(d)); - forEach(target.declarations, (d2) => { - result |= getDeclarationSpaces(d2); - }); - return result; - case 261 /* VariableDeclaration */: - case 209 /* BindingElement */: - case 263 /* FunctionDeclaration */: - case 277 /* ImportSpecifier */: - // https://github.com/Microsoft/TypeScript/pull/7591 - case 80 /* Identifier */: - return 1 /* ExportValue */; - case 174 /* MethodSignature */: - case 172 /* PropertySignature */: - return 2 /* ExportType */; - default: - return Debug.failBadSyntaxKind(d); - } - } - } - function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage, ...args) { - const promisedType = getPromisedTypeOfPromise(type, errorNode); - return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage, ...args); - } - function getPromisedTypeOfPromise(type, errorNode, thisTypeForErrorOut) { - if (isTypeAny(type)) { - return void 0; - } - const typeAsPromise = type; - if (typeAsPromise.promisedTypeOfPromise) { - return typeAsPromise.promisedTypeOfPromise; - } - if (isReferenceToType2(type, getGlobalPromiseType( - /*reportErrors*/ - false - ))) { - return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; - } - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 402784252 /* Primitive */ | 131072 /* Never */)) { - return void 0; - } - const thenFunction = getTypeOfPropertyOfType(type, "then"); - if (isTypeAny(thenFunction)) { - return void 0; - } - const thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0 /* Call */) : emptyArray; - if (thenSignatures.length === 0) { - if (errorNode) { - error2(errorNode, Diagnostics.A_promise_must_have_a_then_method); - } - return void 0; - } - let thisTypeForError; - let candidates; - for (const thenSignature of thenSignatures) { - const thisType = getThisTypeOfSignature(thenSignature); - if (thisType && thisType !== voidType && !isTypeRelatedTo(type, thisType, subtypeRelation)) { - thisTypeForError = thisType; - } else { - candidates = append(candidates, thenSignature); - } - } - if (!candidates) { - Debug.assertIsDefined(thisTypeForError); - if (thisTypeForErrorOut) { - thisTypeForErrorOut.value = thisTypeForError; - } - if (errorNode) { - 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; - } - const onfulfilledParameterType = getTypeWithFacts(getUnionType(map(candidates, getTypeOfFirstParameterOfSignature)), 2097152 /* NEUndefinedOrNull */); - if (isTypeAny(onfulfilledParameterType)) { - return void 0; - } - const onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0 /* Call */); - if (onfulfilledParameterSignatures.length === 0) { - if (errorNode) { - error2(errorNode, Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); - } - return void 0; - } - return typeAsPromise.promisedTypeOfPromise = getUnionType(map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2 /* Subtype */); - } - function checkAwaitedType(type, withAlias, errorNode, diagnosticMessage, ...args) { - const awaitedType = withAlias ? getAwaitedType(type, errorNode, diagnosticMessage, ...args) : getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, ...args); - return awaitedType || errorType; - } - function isThenableType(type) { - if (allTypesAssignableToKind(getBaseConstraintOrType(type), 402784252 /* Primitive */ | 131072 /* Never */)) { - return false; - } - const thenFunction = getTypeOfPropertyOfType(type, "then"); - return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; - } - function isAwaitedTypeInstantiation(type) { - var _a; - if (type.flags & 16777216 /* Conditional */) { - const awaitedSymbol = getGlobalAwaitedSymbol( - /*reportErrors*/ - false - ); - return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((_a = type.aliasTypeArguments) == null ? void 0 : _a.length) === 1; - } - return false; - } - function unwrapAwaitedType(type) { - return type.flags & 1048576 /* Union */ ? mapType(type, unwrapAwaitedType) : isAwaitedTypeInstantiation(type) ? type.aliasTypeArguments[0] : type; - } - function isAwaitedTypeNeeded(type) { - if (isTypeAny(type) || isAwaitedTypeInstantiation(type)) { - return false; - } - if (isGenericObjectType(type)) { - const baseConstraint = getBaseConstraintOfType(type); - if (baseConstraint ? baseConstraint.flags & 3 /* AnyOrUnknown */ || isEmptyObjectType(baseConstraint) || someType(baseConstraint, isThenableType) : maybeTypeOfKind(type, 8650752 /* TypeVariable */)) { - return true; - } - } - return false; - } - function tryCreateAwaitedType(type) { - const awaitedSymbol = getGlobalAwaitedSymbol( - /*reportErrors*/ - true - ); - if (awaitedSymbol) { - return getTypeAliasInstantiation(awaitedSymbol, [unwrapAwaitedType(type)]); - } - return void 0; - } - function createAwaitedTypeIfNeeded(type) { - if (isAwaitedTypeNeeded(type)) { - return tryCreateAwaitedType(type) ?? type; - } - Debug.assert(isAwaitedTypeInstantiation(type) || getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like."); - return type; - } - function getAwaitedType(type, errorNode, diagnosticMessage, ...args) { - const awaitedType = getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, ...args); - return awaitedType && createAwaitedTypeIfNeeded(awaitedType); - } - function getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, ...args) { - if (isTypeAny(type)) { - return type; - } - if (isAwaitedTypeInstantiation(type)) { - return type; - } - const typeAsAwaitable = type; - if (typeAsAwaitable.awaitedTypeOfType) { - return typeAsAwaitable.awaitedTypeOfType; - } - if (type.flags & 1048576 /* Union */) { - if (awaitedTypeStack.lastIndexOf(type.id) >= 0) { - if (errorNode) { - error2(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); - } - return void 0; - } - const mapper = errorNode ? (constituentType) => getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, ...args) : getAwaitedTypeNoAlias; - awaitedTypeStack.push(type.id); - const mapped = mapType(type, mapper); - awaitedTypeStack.pop(); - return typeAsAwaitable.awaitedTypeOfType = mapped; - } - if (isAwaitedTypeNeeded(type)) { - return typeAsAwaitable.awaitedTypeOfType = type; - } - const thisTypeForErrorOut = { value: void 0 }; - const promisedType = getPromisedTypeOfPromise( - type, - /*errorNode*/ - void 0, - thisTypeForErrorOut - ); - if (promisedType) { - if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { - if (errorNode) { - error2(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); - } - return void 0; - } - awaitedTypeStack.push(type.id); - const awaitedType = getAwaitedTypeNoAlias(promisedType, errorNode, diagnosticMessage, ...args); - awaitedTypeStack.pop(); - if (!awaitedType) { - return void 0; - } - return typeAsAwaitable.awaitedTypeOfType = awaitedType; - } - if (isThenableType(type)) { - if (errorNode) { - Debug.assertIsDefined(diagnosticMessage); - let chain; - if (thisTypeForErrorOut.value) { - chain = chainDiagnosticMessages(chain, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value)); - } - chain = chainDiagnosticMessages(chain, diagnosticMessage, ...args); - diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chain)); - } - return void 0; - } - return typeAsAwaitable.awaitedTypeOfType = type; - } - function checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation) { - const returnType = getTypeFromTypeNode(returnTypeNode); - if (languageVersion >= 2 /* ES2015 */) { - if (isErrorType(returnType)) { - return; - } - const globalPromiseType = getGlobalPromiseType( - /*reportErrors*/ - true - ); - if (globalPromiseType !== emptyGenericType && !isReferenceToType2(returnType, globalPromiseType)) { - 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 { - markLinkedReferences(node, 5 /* AsyncFunction */); - if (isErrorType(returnType)) { - return; - } - const promiseConstructorName = getEntityNameFromTypeNode(returnTypeNode); - if (promiseConstructorName === void 0) { - reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, typeToString(returnType)); - return; - } - const promiseConstructorSymbol = resolveEntityName( - promiseConstructorName, - 111551 /* Value */, - /*ignoreErrors*/ - true - ); - const promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType; - if (isErrorType(promiseConstructorType)) { - if (promiseConstructorName.kind === 80 /* Identifier */ && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType( - /*reportErrors*/ - false - )) { - error2(returnTypeErrorLocation, Diagnostics.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); - } else { - reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName)); - } - return; - } - const globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType( - /*reportErrors*/ - true - ); - if (globalPromiseConstructorLikeType === emptyObjectType) { - reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName)); - return; - } - const headMessage = Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_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) { - error2(collidingSymbol.valueDeclaration, Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, idText(rootName), entityNameToString(promiseConstructorName)); - return; - } - } - checkAwaitedType( - returnType, - /*withAlias*/ - false, - 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 checkGrammarDecorator(decorator) { - const sourceFile = getSourceFileOfNode(decorator); - if (!hasParseDiagnostics(sourceFile)) { - let node = decorator.expression; - if (isParenthesizedExpression(node)) { - return false; - } - let canHaveCallExpression = true; - let errorNode; - while (true) { - if (isExpressionWithTypeArguments(node) || isNonNullExpression(node)) { - node = node.expression; - continue; - } - if (isCallExpression(node)) { - if (!canHaveCallExpression) { - errorNode = node; - } - if (node.questionDotToken) { - errorNode = node.questionDotToken; - } - node = node.expression; - canHaveCallExpression = false; - continue; - } - if (isPropertyAccessExpression(node)) { - if (node.questionDotToken) { - errorNode = node.questionDotToken; - } - node = node.expression; - canHaveCallExpression = false; - continue; - } - if (!isIdentifier(node)) { - errorNode = node; - } - break; - } - if (errorNode) { - addRelatedInfo( - error2(decorator.expression, Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator), - createDiagnosticForNode(errorNode, Diagnostics.Invalid_syntax_in_decorator) - ); - return true; - } - } - return false; - } - function checkDecorator(node) { - checkGrammarDecorator(node); - const signature = getResolvedSignature(node); - checkDeprecatedSignature(signature, node); - const returnType = getReturnTypeOfSignature(signature); - if (returnType.flags & 1 /* Any */) { - return; - } - const decoratorSignature = getDecoratorCallSignature(node); - if (!(decoratorSignature == null ? void 0 : decoratorSignature.resolvedReturnType)) return; - let headMessage; - const expectedReturnType = decoratorSignature.resolvedReturnType; - switch (node.parent.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - break; - case 173 /* PropertyDeclaration */: - if (!legacyDecorators) { - headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - break; - } - // falls through - case 170 /* Parameter */: - headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; - break; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; - break; - default: - return Debug.failBadSyntaxKind(node.parent); - } - checkTypeAssignableTo(returnType, expectedReturnType, node.expression, headMessage); - } - function createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount = parameters.length, flags = 0 /* None */) { - const decl = factory.createFunctionTypeNode( - /*typeParameters*/ - void 0, - emptyArray, - factory.createKeywordTypeNode(133 /* AnyKeyword */) - ); - return createSignature(decl, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); - } - function createFunctionType(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags) { - const signature = createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); - return getOrCreateTypeFromSignature(signature); - } - function createGetterFunctionType(type) { - return createFunctionType( - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - emptyArray, - type - ); - } - function createSetterFunctionType(type) { - const valueParam = createParameter2("value", type); - return createFunctionType( - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - [valueParam], - voidType - ); - } - function getEntityNameForDecoratorMetadata(node) { - if (node) { - switch (node.kind) { - case 194 /* IntersectionType */: - case 193 /* UnionType */: - return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 195 /* ConditionalType */: - return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 197 /* ParenthesizedType */: - case 203 /* NamedTupleMember */: - return getEntityNameForDecoratorMetadata(node.type); - case 184 /* TypeReference */: - return node.typeName; - } - } - } - function getEntityNameForDecoratorMetadataFromTypeList(types) { - let commonEntityName; - for (let typeNode of types) { - while (typeNode.kind === 197 /* ParenthesizedType */ || typeNode.kind === 203 /* NamedTupleMember */) { - typeNode = typeNode.type; - } - if (typeNode.kind === 146 /* NeverKeyword */) { - continue; - } - if (!strictNullChecks && (typeNode.kind === 202 /* LiteralType */ && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { - continue; - } - const individualEntityName = getEntityNameForDecoratorMetadata(typeNode); - if (!individualEntityName) { - return void 0; - } - if (commonEntityName) { - if (!isIdentifier(commonEntityName) || !isIdentifier(individualEntityName) || commonEntityName.escapedText !== individualEntityName.escapedText) { - return void 0; - } - } else { - commonEntityName = individualEntityName; - } - } - return commonEntityName; - } - function getParameterTypeNodeForDecoratorCheck(node) { - const typeNode = getEffectiveTypeAnnotationNode(node); - return isRestParameter(node) ? getRestParameterElementType(typeNode) : typeNode; - } - function checkDecorators(node) { - if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { - return; - } - const firstDecorator = find(node.modifiers, isDecorator); - if (!firstDecorator) { - return; - } - if (legacyDecorators) { - checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 170 /* Parameter */) { - checkExternalEmitHelpers(firstDecorator, 32 /* Param */); - } - } else if (languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators) { - checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */); - if (isClassDeclaration(node)) { - if (!node.name) { - checkExternalEmitHelpers(firstDecorator, 4194304 /* SetFunctionName */); - } else { - const member = getFirstTransformableStaticClassElement(node); - if (member) { - checkExternalEmitHelpers(firstDecorator, 4194304 /* SetFunctionName */); - } - } - } else if (!isClassExpression(node)) { - if (isPrivateIdentifier(node.name) && (isMethodDeclaration(node) || isAccessor(node) || isAutoAccessorPropertyDeclaration(node))) { - checkExternalEmitHelpers(firstDecorator, 4194304 /* SetFunctionName */); - } - if (isComputedPropertyName(node.name)) { - checkExternalEmitHelpers(firstDecorator, 8388608 /* PropKey */); - } - } - } - markLinkedReferences(node, 8 /* Decorator */); - for (const modifier of node.modifiers) { - if (isDecorator(modifier)) { - checkDecorator(modifier); - } - } - } - function checkFunctionDeclaration(node) { - addLazyDiagnostic(checkFunctionDeclarationDiagnostics); - function checkFunctionDeclarationDiagnostics() { - checkFunctionOrMethodDeclaration(node); - checkGrammarForGenerator(node); - checkCollisionsForDeclarationName(node, node.name); - } - } - function checkJSDocTypeAliasTag(node) { - if (!node.typeExpression) { - 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); - } - checkSourceElement(node.typeExpression); - checkTypeParameters(getEffectiveTypeParameterDeclarations(node)); - } - function checkJSDocTemplateTag(node) { - checkSourceElement(node.constraint); - for (const tp of node.typeParameters) { - checkSourceElement(tp); - } - } - function checkJSDocTypeTag(node) { - checkSourceElement(node.typeExpression); - } - function checkJSDocSatisfiesTag(node) { - checkSourceElement(node.typeExpression); - const host2 = getEffectiveJSDocHost(node); - if (host2) { - const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag); - if (length(tags) > 1) { - for (let i = 1; i < length(tags); i++) { - const tagName = tags[i].tagName; - error2(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); - } - } - } - } - function checkJSDocLinkLikeTag(node) { - if (node.name) { - resolveJSDocMemberName( - node.name, - /*ignoreErrors*/ - true - ); - } - } - function checkJSDocParameterTag(node) { - checkSourceElement(node.typeExpression); - } - function checkJSDocPropertyTag(node) { - checkSourceElement(node.typeExpression); - } - function checkJSDocFunctionType(node) { - addLazyDiagnostic(checkJSDocFunctionTypeImplicitAny); - checkSignatureDeclaration(node); - function checkJSDocFunctionTypeImplicitAny() { - if (!node.type && !isJSDocConstructSignature(node)) { - reportImplicitAny(node, anyType); - } - } - } - function checkJSDocThisTag(node) { - const host2 = getEffectiveJSDocHost(node); - if (host2 && isArrowFunction(host2)) { - error2(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); - } - } - function checkJSDocImportTag(node) { - checkImportAttributes(node); - } - function checkJSDocImplementsTag(node) { - const classLike = getEffectiveJSDocHost(node); - if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) { - 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)) { - 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) { - 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) { - 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)) { - 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 212 /* PropertyAccessExpression */: - return node.name; - default: - return void 0; - } - } - function checkFunctionOrMethodDeclaration(node) { - var _a; - checkDecorators(node); - checkSignatureDeclaration(node); - const functionFlags = getFunctionFlags(node); - if (node.name && node.name.kind === 168 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - } - if (hasBindableName(node)) { - const symbol = getSymbolOfDeclaration(node); - 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 & 524288 /* JavaScriptFile */) - ); - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(localSymbol); - } - if (symbol.parent) { - checkFunctionOrConstructorSymbol(symbol); - } - } - const body = node.kind === 174 /* 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)) { - error2(typeTag.typeExpression.type, Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature); - } - } - function checkFunctionOrMethodDeclarationDiagnostics() { - if (!getEffectiveReturnTypeNode(node)) { - if (nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { - reportImplicitAny(node, anyType); - } - if (functionFlags & 1 /* Generator */ && nodeIsPresent(body)) { - getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - } - } - } - } - function registerForUnusedIdentifiersCheck(node) { - addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics); - function registerForUnusedIdentifiersCheckDiagnostics() { - const sourceFile = getSourceFileOfNode(node); - let potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); - if (!potentiallyUnusedIdentifiers) { - potentiallyUnusedIdentifiers = []; - allPotentiallyUnusedIdentifiers.set(sourceFile.path, potentiallyUnusedIdentifiers); - } - potentiallyUnusedIdentifiers.push(node); - } - } - function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) { - for (const node of potentiallyUnusedIdentifiers) { - switch (node.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - checkUnusedClassMembers(node, addDiagnostic); - checkUnusedTypeParameters(node, addDiagnostic); - break; - case 308 /* SourceFile */: - case 268 /* ModuleDeclaration */: - case 242 /* Block */: - case 270 /* CaseBlock */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - checkUnusedLocalsAndParameters(node, addDiagnostic); - break; - case 177 /* Constructor */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - if (node.body) { - checkUnusedLocalsAndParameters(node, addDiagnostic); - } - checkUnusedTypeParameters(node, addDiagnostic); - break; - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 266 /* TypeAliasDeclaration */: - case 265 /* InterfaceDeclaration */: - checkUnusedTypeParameters(node, addDiagnostic); - break; - case 196 /* InferType */: - checkUnusedInferTypeParameter(node, addDiagnostic); - break; - default: - Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); - } - } - } - function errorUnusedLocal(declaration, name, addDiagnostic) { - const node = getNameOfDeclaration(declaration) || declaration; - const message = isTypeDeclaration(declaration) ? Diagnostics._0_is_declared_but_never_used : Diagnostics._0_is_declared_but_its_value_is_never_read; - addDiagnostic(declaration, 0 /* Local */, createDiagnosticForNode(node, message, name)); - } - function isIdentifierThatStartsWithUnderscore(node) { - return isIdentifier(node) && idText(node).charCodeAt(0) === 95 /* _ */; - } - function checkUnusedClassMembers(node, addDiagnostic) { - for (const member of node.members) { - switch (member.kind) { - case 175 /* MethodDeclaration */: - case 173 /* PropertyDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - if (member.kind === 179 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { - break; - } - const symbol = getSymbolOfDeclaration(member); - 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 177 /* Constructor */: - for (const parameter of member.parameters) { - 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 182 /* IndexSignature */: - case 241 /* SemicolonClassElement */: - case 176 /* ClassStaticBlockDeclaration */: - break; - default: - Debug.fail("Unexpected class member"); - } - } - } - function checkUnusedInferTypeParameter(node, addDiagnostic) { - const { typeParameter } = node; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, 1 /* Parameter */, createDiagnosticForNode(node, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(typeParameter.name))); - } - } - function checkUnusedTypeParameters(node, addDiagnostic) { - const declarations = getSymbolOfDeclaration(node).declarations; - if (!declarations || last(declarations) !== node) return; - const typeParameters = getEffectiveTypeParameterDeclarations(node); - const seenParentsWithEveryUnused = /* @__PURE__ */ new Set(); - for (const typeParameter of typeParameters) { - if (!isTypeParameterUnused(typeParameter)) continue; - const name = idText(typeParameter.name); - const { parent: parent2 } = typeParameter; - if (parent2.kind !== 196 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) { - if (tryAddToSet(seenParentsWithEveryUnused, parent2)) { - const sourceFile = getSourceFileOfNode(parent2); - const range = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters); - const only = parent2.typeParameters.length === 1; - const messageAndArg = only ? [Diagnostics._0_is_declared_but_its_value_is_never_read, name] : [Diagnostics.All_type_parameters_are_unused]; - addDiagnostic(typeParameter, 1 /* Parameter */, createFileDiagnostic(sourceFile, range.pos, range.end - range.pos, ...messageAndArg)); - } - } else { - addDiagnostic(typeParameter, 1 /* Parameter */, createDiagnosticForNode(typeParameter, Diagnostics._0_is_declared_but_its_value_is_never_read, name)); - } - } - } - function isTypeParameterUnused(typeParameter) { - return !(getMergedSymbol(typeParameter.symbol).isReferenced & 262144 /* TypeParameter */) && !isIdentifierThatStartsWithUnderscore(typeParameter.name); - } - function addToGroup(map2, key, value, getKey) { - const keyString = String(getKey(key)); - const group2 = map2.get(keyString); - if (group2) { - group2[1].push(value); - } else { - map2.set(keyString, [key, [value]]); - } - } - function tryGetRootParameterDeclaration(node) { - return tryCast(getRootDeclaration(node), isParameter); - } - function isValidUnusedLocalDeclaration(declaration) { - if (isBindingElement(declaration)) { - if (isObjectBindingPattern(declaration.parent)) { - return !!(declaration.propertyName && isIdentifierThatStartsWithUnderscore(declaration.name)); - } - return isIdentifierThatStartsWithUnderscore(declaration.name); - } - return isAmbientModule(declaration) || (isVariableDeclaration(declaration) && isForInOrOfStatement(declaration.parent.parent) || isImportedDeclaration(declaration)) && isIdentifierThatStartsWithUnderscore(declaration.name); - } - function checkUnusedLocalsAndParameters(nodeWithLocals, addDiagnostic) { - const unusedImports = /* @__PURE__ */ new Map(); - const unusedDestructures = /* @__PURE__ */ new Map(); - const unusedVariables = /* @__PURE__ */ new Map(); - nodeWithLocals.locals.forEach((local) => { - if (local.flags & 262144 /* TypeParameter */ ? !(local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : local.isReferenced || local.exportSymbol) { - return; - } - if (local.declarations) { - for (const declaration of local.declarations) { - if (isValidUnusedLocalDeclaration(declaration)) { - continue; - } - if (isImportedDeclaration(declaration)) { - addToGroup(unusedImports, importClauseFromImported(declaration), declaration, getNodeId); - } else if (isBindingElement(declaration) && isObjectBindingPattern(declaration.parent)) { - const lastElement = last(declaration.parent.elements); - if (declaration === lastElement || !last(declaration.parent.elements).dotDotDotToken) { - addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId); - } - } else if (isVariableDeclaration(declaration)) { - 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); - if (parameter && name) { - if (!isParameterPropertyDeclaration(parameter, parameter.parent) && !parameterIsThisKeyword(parameter) && !isIdentifierThatStartsWithUnderscore(name)) { - if (isBindingElement(declaration) && isArrayBindingPattern(declaration.parent)) { - addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId); - } else { - addDiagnostic(parameter, 1 /* Parameter */, createDiagnosticForNode(name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolName(local))); - } - } - } else { - errorUnusedLocal(declaration, symbolName(local), addDiagnostic); - } - } - } - } - }); - unusedImports.forEach(([importClause, unuseds]) => { - const importDecl = importClause.parent; - const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 275 /* 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) - ); - } else { - for (const unused of unuseds) errorUnusedLocal(unused, idText(unused.name), addDiagnostic); - } - }); - 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 === 261 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 262 /* 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) - ); - } - } else { - for (const e of bindingElements) { - addDiagnostic(e, kind, createDiagnosticForNode(e, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(e.name))); - } - } - }); - 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 === 244 /* 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))); - } - } - }); - } - function checkPotentialUncheckedRenamedBindingElementsInTypes() { - var _a; - for (const node of potentialUnusedRenamedBindingElementsInTypes) { - if (!((_a = getSymbolOfDeclaration(node)) == null ? void 0 : _a.isReferenced)) { - const wrappingDeclaration = walkUpBindingElementsAndPatterns(node); - Debug.assert(isPartOfParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here"); - const diagnostic = createDiagnosticForNode(node.name, Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, declarationNameToString(node.name), declarationNameToString(node.propertyName)); - if (!wrappingDeclaration.type) { - addRelatedInfo( - diagnostic, - createFileDiagnostic(getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 0, Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, declarationNameToString(node.propertyName)) - ); - } - diagnostics.add(diagnostic); - } - } - } - function bindingNameText(name) { - switch (name.kind) { - case 80 /* Identifier */: - return idText(name); - case 208 /* ArrayBindingPattern */: - case 207 /* ObjectBindingPattern */: - return bindingNameText(cast(first(name.elements), isBindingElement).name); - default: - return Debug.assertNever(name); - } - } - function isImportedDeclaration(node) { - return node.kind === 274 /* ImportClause */ || node.kind === 277 /* ImportSpecifier */ || node.kind === 275 /* NamespaceImport */; - } - function importClauseFromImported(decl) { - return decl.kind === 274 /* ImportClause */ ? decl : decl.kind === 275 /* NamespaceImport */ ? decl.parent : decl.parent.parent; - } - function checkBlock(node) { - if (node.kind === 242 /* Block */) { - checkGrammarStatementInAmbientContext(node); - } - if (isFunctionOrModuleBlock(node)) { - const saveFlowAnalysisDisabled = flowAnalysisDisabled; - forEach(node.statements, checkSourceElement); - flowAnalysisDisabled = saveFlowAnalysisDisabled; - } else { - forEach(node.statements, checkSourceElement); - } - if (node.locals) { - registerForUnusedIdentifiersCheck(node); - } - } - function checkCollisionWithArgumentsInGeneratedCode(node) { - if (languageVersion >= 2 /* ES2015 */ || !hasRestParameter(node) || node.flags & 33554432 /* Ambient */ || nodeIsMissing(node.body)) { - return; - } - forEach(node.parameters, (p) => { - if (p.name && !isBindingPattern(p.name) && p.name.escapedText === argumentsSymbol.escapedName) { - errorSkippedOn("noEmit", p, Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); - } - }); - } - function needCollisionCheckForIdentifier(node, identifier, name) { - if ((identifier == null ? void 0 : identifier.escapedText) !== name) { - return false; - } - if (node.kind === 173 /* PropertyDeclaration */ || node.kind === 172 /* PropertySignature */ || node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */ || node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */ || node.kind === 304 /* PropertyAssignment */) { - return false; - } - if (node.flags & 33554432 /* Ambient */) { - return false; - } - if (isImportClause(node) || isImportEqualsDeclaration(node) || isImportSpecifier(node)) { - if (isTypeOnlyImportOrExportDeclaration(node)) { - return false; - } - } - const root = getRootDeclaration(node); - if (isParameter(root) && nodeIsMissing(root.parent.body)) { - return false; - } - return true; - } - function checkIfThisIsCapturedInEnclosingScope(node) { - findAncestor(node, (current) => { - if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - const isDeclaration2 = node.kind !== 80 /* Identifier */; - if (isDeclaration2) { - error2(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); - } else { - error2(node, Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); - } - return true; - } - return false; - }); - } - function checkIfNewTargetIsCapturedInEnclosingScope(node) { - findAncestor(node, (current) => { - if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) { - const isDeclaration2 = node.kind !== 80 /* Identifier */; - if (isDeclaration2) { - error2(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); - } else { - error2(node, Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); - } - return true; - } - return false; - }); - } - function checkCollisionWithRequireExportsInGeneratedCode(node, name) { - if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) >= 5 /* ES2015 */) { - return; - } - if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { - return; - } - if (isModuleDeclaration(node) && getModuleInstanceState(node) !== 1 /* Instantiated */) { - return; - } - const parent2 = getDeclarationContainer(node); - if (parent2.kind === 308 /* 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) { - if (!name || languageVersion >= 4 /* ES2017 */ || !needCollisionCheckForIdentifier(node, name, "Promise")) { - return; - } - if (isModuleDeclaration(node) && getModuleInstanceState(node) !== 1 /* Instantiated */) { - return; - } - const parent2 = getDeclarationContainer(node); - if (parent2.kind === 308 /* 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) { - if (languageVersion <= 8 /* ES2021 */ && (needCollisionCheckForIdentifier(node, name, "WeakMap") || needCollisionCheckForIdentifier(node, name, "WeakSet"))) { - potentialWeakMapSetCollisions.push(node); - } - } - function checkWeakMapSetCollision(node) { - const enclosingBlockScope = getEnclosingBlockScopeContainer(node); - 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); - } - } - function recordPotentialCollisionWithReflectInGeneratedCode(node, name) { - if (name && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && needCollisionCheckForIdentifier(node, name, "Reflect")) { - potentialReflectCollisions.push(node); - } - } - function checkReflectCollision(node) { - let hasCollision = false; - if (isClassExpression(node)) { - for (const member of node.members) { - if (getNodeCheckFlags(member) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) { - hasCollision = true; - break; - } - } - } else if (isFunctionExpression(node)) { - if (getNodeCheckFlags(node) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) { - hasCollision = true; - } - } else { - const container = getEnclosingBlockScopeContainer(node); - 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"); - } - } - function checkCollisionsForDeclarationName(node, name) { - if (!name) return; - checkCollisionWithRequireExportsInGeneratedCode(node, name); - checkCollisionWithGlobalPromiseInGeneratedCode(node, name); - recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name); - recordPotentialCollisionWithReflectInGeneratedCode(node, name); - if (isClassLike(node)) { - checkTypeNameIsReserved(name, Diagnostics.Class_name_cannot_be_0); - if (!(node.flags & 33554432 /* Ambient */)) { - checkClassNameCollisionWithObject(name); - } - } else if (isEnumDeclaration(node)) { - checkTypeNameIsReserved(name, Diagnostics.Enum_name_cannot_be_0); - } - } - function checkVarDeclaredNamesNotShadowed(node) { - if ((getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */) !== 0 || isPartOfParameterDeclaration(node)) { - return; - } - const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 1 /* FunctionScopedVariable */) { - if (!isIdentifier(node.name)) return Debug.fail(); - const localDeclarationSymbol = resolveName( - node, - node.name.escapedText, - 3 /* Variable */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - ); - if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { - if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 7 /* BlockScoped */) { - const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 262 /* VariableDeclarationList */); - const container = varDeclList.parent.kind === 244 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; - const namesShareScope = container && (container.kind === 242 /* Block */ && isFunctionLike(container.parent) || container.kind === 269 /* ModuleBlock */ || container.kind === 268 /* ModuleDeclaration */ || container.kind === 308 /* SourceFile */); - if (!namesShareScope) { - const name = symbolToString(localDeclarationSymbol); - error2(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); - } - } - } - } - } - function convertAutoToAny(type) { - return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type; - } - function checkVariableLikeDeclaration(node) { - var _a; - checkDecorators(node); - if (!isBindingElement(node)) { - checkSourceElement(node.type); - } - if (!node.name) { - return; - } - if (node.name.kind === 168 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - if (hasOnlyExpressionInitializer(node) && node.initializer) { - checkExpressionCached(node.initializer); - } - } - if (isBindingElement(node)) { - if (node.propertyName && isIdentifier(node.name) && isPartOfParameterDeclaration(node) && nodeIsMissing(getContainingFunction(node).body)) { - potentialUnusedRenamedBindingElementsInTypes.push(node); - return; - } - if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) { - checkExternalEmitHelpers(node, 4 /* Rest */); - } - if (node.propertyName && node.propertyName.kind === 168 /* ComputedPropertyName */) { - checkComputedPropertyName(node.propertyName); - } - const parent2 = node.parent.parent; - const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */; - const parentType = getTypeForBindingElementParent(parent2, parentCheckMode); - const name = node.propertyName || node.name; - if (parentType && !isBindingPattern(name)) { - const exprType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(exprType)) { - const nameText = getPropertyNameFromType(exprType); - const property = getPropertyOfType(parentType, nameText); - if (property) { - markPropertyAsReferenced( - property, - /*nodeForCheckWriteOnly*/ - void 0, - /*isSelfTypeAccess*/ - false - ); - checkPropertyAccessibility( - node, - !!parent2.initializer && parent2.initializer.kind === 108 /* SuperKeyword */, - /*writing*/ - false, - parentType, - property - ); - } - } - } - } - if (isBindingPattern(node.name)) { - if (node.name.kind === 208 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) { - checkExternalEmitHelpers(node, 512 /* Read */); - } - forEach(node.name.elements, checkSourceElement); - } - if (node.initializer && isPartOfParameterDeclaration(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 !== 250 /* ForInStatement */; - const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression)); - if (needCheckInitializer || needCheckWidenedType) { - const widenedType = getWidenedTypeForVariableLikeDeclaration(node); - if (needCheckInitializer) { - const initializerType = checkExpressionCached(node.initializer); - if (strictNullChecks && needCheckWidenedType) { - checkNonNullNonVoidType(initializerType, node); - } else { - checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer); - } - } - if (needCheckWidenedType) { - if (isArrayBindingPattern(node.name)) { - checkIteratedTypeOrElementType(65 /* Destructuring */, widenedType, undefinedType, node); - } else if (strictNullChecks) { - checkNonNullNonVoidType(widenedType, node); - } - } - } - return; - } - const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 2097152 /* Alias */ && (isVariableDeclarationInitializedToBareOrAccessedRequire(node) || isBindingElementOfBareOrAccessedRequire(node))) { - checkAliasSymbol(node); - return; - } - if (node.name.kind === 10 /* BigIntLiteral */) { - error2(node.name, Diagnostics.A_bigint_literal_cannot_be_used_as_a_property_name); - } - const type = convertAutoToAny(getTypeOfSymbol(symbol)); - if (node === symbol.valueDeclaration) { - 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 !== 250 /* ForInStatement */) { - const initializerType = checkExpressionCached(initializer); - checkTypeAssignableToAndOptionallyElaborate( - 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(widenTypeForVariableLikeDeclaration(initializerType, node), 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(widenTypeForVariableLikeDeclaration(initializerType, node), 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))) { - error2(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); - } - } - } else { - const declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node)); - if (!isErrorType(type) && !isErrorType(declarationType) && !isTypeIdenticalTo(type, declarationType) && !(symbol.flags & 67108864 /* Assignment */)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType); - } - if (hasOnlyExpressionInitializer(node) && node.initializer) { - checkTypeAssignableToAndOptionallyElaborate( - checkExpressionCached(node.initializer), - declarationType, - node, - node.initializer, - /*headMessage*/ - void 0 - ); - } - if (symbol.valueDeclaration && !areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) { - error2(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); - } - } - if (node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 172 /* PropertySignature */) { - checkExportsOnMergedDeclarations(node); - if (node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */) { - checkVarDeclaredNamesNotShadowed(node); - } - checkCollisionsForDeclarationName(node, node.name); - } - } - function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { - const nextDeclarationName = getNameOfDeclaration(nextDeclaration); - const message = nextDeclaration.kind === 173 /* PropertyDeclaration */ || nextDeclaration.kind === 172 /* 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 = error2( - nextDeclarationName, - message, - declName, - typeToString(firstType), - typeToString(nextType) - ); - if (firstDeclaration) { - addRelatedInfo(err, createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName)); - } - } - function areDeclarationFlagsIdentical(left, right) { - if (left.kind === 170 /* Parameter */ && right.kind === 261 /* VariableDeclaration */ || left.kind === 261 /* VariableDeclaration */ && right.kind === 170 /* Parameter */) { - return true; - } - if (hasQuestionToken(left) !== hasQuestionToken(right)) { - return false; - } - const interestingFlags = 2 /* Private */ | 4 /* Protected */ | 1024 /* Async */ | 64 /* Abstract */ | 8 /* Readonly */ | 256 /* Static */; - return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags); - } - function checkVariableDeclaration(node) { - var _a, _b; - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); - checkGrammarVariableDeclaration(node); - checkVariableLikeDeclaration(node); - (_b = tracing) == null ? void 0 : _b.pop(); - } - function checkBindingElement(node) { - checkGrammarBindingElement(node); - return checkVariableLikeDeclaration(node); - } - function checkVariableDeclarationList(node) { - const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */; - if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < LanguageFeatureMinimumTarget.UsingAndAwaitUsing) { - checkExternalEmitHelpers(node, 16777216 /* AddDisposableResourceAndDisposeResources */); - } - forEach(node.declarations, checkSourceElement); - } - function checkVariableStatement(node) { - if (!checkGrammarModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) checkGrammarForDisallowedBlockScopedVariableStatement(node); - checkVariableDeclarationList(node.declarationList); - } - function checkExpressionStatement(node) { - checkGrammarStatementInAmbientContext(node); - checkExpression(node.expression); - } - function checkIfStatement(node) { - checkGrammarStatementInAmbientContext(node); - const type = checkTruthinessExpression(node.expression); - checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.expression, type, node.thenStatement); - checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 243 /* EmptyStatement */) { - error2(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); - } - checkSourceElement(node.elseStatement); - } - function checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(condExpr, condType, body) { - if (!strictNullChecks) return; - bothHelper(condExpr, body); - function bothHelper(condExpr2, body2) { - condExpr2 = skipParentheses(condExpr2); - helper(condExpr2, body2); - while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 57 /* BarBarToken */ || condExpr2.operatorToken.kind === 61 /* QuestionQuestionToken */)) { - condExpr2 = skipParentheses(condExpr2.left); - helper(condExpr2, body2); - } - } - function helper(condExpr2, body2) { - const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2; - if (isModuleExportsAccessExpression(location)) { - return; - } - if (isLogicalOrCoalescingBinaryExpression(location)) { - bothHelper(location, body2); - return; - } - const type = location === condExpr2 ? condType : checkExpression(location); - if (type.flags & 1024 /* EnumLiteral */ && isPropertyAccessExpression(location) && (getNodeLinks(location.expression).resolvedSymbol ?? unknownSymbol).flags & 384 /* Enum */) { - error2(location, Diagnostics.This_condition_will_always_return_0, !!type.value ? "true" : "false"); - return; - } - const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression); - if (!hasTypeFacts(type, 4194304 /* Truthy */) || isPropertyExpressionCast) return; - const callSignatures = getSignaturesOfType(type, 0 /* Call */); - const isPromise = !!getAwaitedTypeOfPromise(type); - if (callSignatures.length === 0 && !isPromise) { - return; - } - const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0; - const testedSymbol = testedNode && getSymbolAtLocation(testedNode); - if (!testedSymbol && !isPromise) { - return; - } - const isUsed = testedSymbol && isBinaryExpression(condExpr2.parent) && isSymbolUsedInBinaryExpressionChain(condExpr2.parent, testedSymbol) || testedSymbol && body2 && isSymbolUsedInConditionBody(condExpr2, body2, testedNode, testedSymbol); - if (!isUsed) { - if (isPromise) { - errorAndMaybeSuggestAwait( - location, - /*maybeMissingAwait*/ - true, - Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, - getTypeNameForErrorDisplay(type) - ); - } else { - error2(location, Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead); - } - } - } - } - function isSymbolUsedInConditionBody(expr, body, testedNode, testedSymbol) { - return !!forEachChild(body, function check(childNode) { - if (isIdentifier(childNode)) { - const childSymbol = getSymbolAtLocation(childNode); - if (childSymbol && childSymbol === testedSymbol) { - if (isIdentifier(expr) || isIdentifier(testedNode) && isBinaryExpression(testedNode.parent)) { - return true; - } - let testedExpression = testedNode.parent; - let childExpression = childNode.parent; - while (testedExpression && childExpression) { - if (isIdentifier(testedExpression) && isIdentifier(childExpression) || testedExpression.kind === 110 /* ThisKeyword */ && childExpression.kind === 110 /* ThisKeyword */) { - return getSymbolAtLocation(testedExpression) === getSymbolAtLocation(childExpression); - } else if (isPropertyAccessExpression(testedExpression) && isPropertyAccessExpression(childExpression)) { - if (getSymbolAtLocation(testedExpression.name) !== getSymbolAtLocation(childExpression.name)) { - return false; - } - childExpression = childExpression.expression; - testedExpression = testedExpression.expression; - } else if (isCallExpression(testedExpression) && isCallExpression(childExpression)) { - childExpression = childExpression.expression; - testedExpression = testedExpression.expression; - } else { - return false; - } - } - } - } - return forEachChild(childNode, check); - }); - } - function isSymbolUsedInBinaryExpressionChain(node, testedSymbol) { - while (isBinaryExpression(node) && node.operatorToken.kind === 56 /* AmpersandAmpersandToken */) { - const isUsed = forEachChild(node.right, function visit(child) { - if (isIdentifier(child)) { - const symbol = getSymbolAtLocation(child); - if (symbol && symbol === testedSymbol) { - return true; - } - } - return forEachChild(child, visit); - }); - if (isUsed) { - return true; - } - node = node.parent; - } - return false; - } - function checkDoStatement(node) { - checkGrammarStatementInAmbientContext(node); - checkSourceElement(node.statement); - checkTruthinessExpression(node.expression); - } - function checkWhileStatement(node) { - checkGrammarStatementInAmbientContext(node); - checkTruthinessExpression(node.expression); - checkSourceElement(node.statement); - } - function checkTruthinessOfType(type, node) { - if (type.flags & 16384 /* Void */) { - error2(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness); - } else { - const semantics = getSyntacticTruthySemantics(node); - if (semantics !== 3 /* Sometimes */) { - error2( - node, - semantics === 1 /* Always */ ? Diagnostics.This_kind_of_expression_is_always_truthy : Diagnostics.This_kind_of_expression_is_always_falsy - ); - } - } - return type; - } - function getSyntacticTruthySemantics(node) { - node = skipOuterExpressions(node); - switch (node.kind) { - case 9 /* NumericLiteral */: - if (node.text === "0" || node.text === "1") { - return 3 /* Sometimes */; - } - return 1 /* Always */; - case 210 /* ArrayLiteralExpression */: - case 220 /* ArrowFunction */: - case 10 /* BigIntLiteral */: - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 285 /* JsxElement */: - case 286 /* JsxSelfClosingElement */: - case 211 /* ObjectLiteralExpression */: - case 14 /* RegularExpressionLiteral */: - return 1 /* Always */; - case 223 /* VoidExpression */: - case 106 /* NullKeyword */: - return 2 /* Never */; - case 15 /* NoSubstitutionTemplateLiteral */: - case 11 /* StringLiteral */: - return !!node.text ? 1 /* Always */ : 2 /* Never */; - case 228 /* ConditionalExpression */: - return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse); - case 80 /* Identifier */: - if (getResolvedSymbol(node) === undefinedSymbol) { - return 2 /* Never */; - } - return 3 /* Sometimes */; - } - return 3 /* Sometimes */; - } - function checkTruthinessExpression(node, checkMode) { - return checkTruthinessOfType(checkExpression(node, checkMode), node); - } - function checkForStatement(node) { - if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 262 /* VariableDeclarationList */) { - checkGrammarVariableDeclarationList(node.initializer); - } - } - if (node.initializer) { - if (node.initializer.kind === 262 /* VariableDeclarationList */) { - checkVariableDeclarationList(node.initializer); - } else { - checkExpression(node.initializer); - } - } - if (node.condition) checkTruthinessExpression(node.condition); - if (node.incrementor) checkExpression(node.incrementor); - checkSourceElement(node.statement); - if (node.locals) { - registerForUnusedIdentifiersCheck(node); - } - } - function checkForOfStatement(node) { - checkGrammarForInOrForOfStatement(node); - 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); - } else { - const functionFlags = getFunctionFlags(container); - if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.ForAwaitOf) { - checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */); - } - } - } else if (compilerOptions.downlevelIteration && languageVersion < LanguageFeatureMinimumTarget.ForOf) { - checkExternalEmitHelpers(node, 256 /* ForOfIncludes */); - } - if (node.initializer.kind === 262 /* VariableDeclarationList */) { - checkVariableDeclarationList(node.initializer); - } else { - const varExpr = node.initializer; - const iteratedType = checkRightHandSideOfForOf(node); - if (varExpr.kind === 210 /* ArrayLiteralExpression */ || varExpr.kind === 211 /* ObjectLiteralExpression */) { - checkDestructuringAssignment(varExpr, iteratedType || errorType); - } else { - const leftType = checkExpression(varExpr); - checkReferenceExpression( - varExpr, - Diagnostics.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access, - Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access - ); - if (iteratedType) { - checkTypeAssignableToAndOptionallyElaborate(iteratedType, leftType, varExpr, node.expression); - } - } - } - checkSourceElement(node.statement); - if (node.locals) { - registerForUnusedIdentifiersCheck(node); - } - } - function checkForInStatement(node) { - checkGrammarForInOrForOfStatement(node); - const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); - if (node.initializer.kind === 262 /* VariableDeclarationList */) { - const variable = node.initializer.declarations[0]; - if (variable && isBindingPattern(variable.name)) { - error2(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); - } - checkVariableDeclarationList(node.initializer); - } else { - const varExpr = node.initializer; - const leftType = checkExpression(varExpr); - if (varExpr.kind === 210 /* ArrayLiteralExpression */ || varExpr.kind === 211 /* ObjectLiteralExpression */) { - error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); - } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { - error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); - } else { - checkReferenceExpression( - varExpr, - Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, - Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access - ); - } - } - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { - 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 checkRightHandSideOfForOf(statement) { - const use = statement.awaitModifier ? 15 /* ForAwaitOf */ : 13 /* ForOf */; - return checkIteratedTypeOrElementType(use, checkNonNullExpression(statement.expression), undefinedType, statement.expression); - } - function checkIteratedTypeOrElementType(use, inputType, sentType, errorNode) { - if (isTypeAny(inputType)) { - return inputType; - } - return getIteratedTypeOrElementType( - use, - inputType, - sentType, - errorNode, - /*checkAssignability*/ - true - ) || anyType; - } - function getIteratedTypeOrElementType(use, inputType, sentType, errorNode, checkAssignability) { - const allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0; - if (inputType === neverType) { - if (errorNode) { - reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables); - } - return void 0; - } - const uplevelIteration = languageVersion >= 2 /* ES2015 */; - const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; - const possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */); - if (uplevelIteration || downlevelIteration || allowAsyncIterables) { - const iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : void 0); - if (checkAssignability) { - if (iterationTypes) { - const diagnostic = use & 8 /* ForOfFlag */ ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0 : use & 32 /* SpreadFlag */ ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0 : use & 64 /* DestructuringFlag */ ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0 : use & 16 /* YieldStarFlag */ ? Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0 : void 0; - if (diagnostic) { - checkTypeAssignableTo(sentType, iterationTypes.nextType, errorNode, diagnostic); - } - } - } - if (iterationTypes || uplevelIteration) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : iterationTypes && iterationTypes.yieldType; - } - } - let arrayType = inputType; - let hasStringConstituent = false; - if (use & 4 /* AllowsStringInputFlag */) { - if (arrayType.flags & 1048576 /* Union */) { - const arrayTypes = inputType.types; - const filteredTypes = filter(arrayTypes, (t) => !(t.flags & 402653316 /* StringLike */)); - if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, 2 /* Subtype */); - } - } else if (arrayType.flags & 402653316 /* StringLike */) { - arrayType = neverType; - } - hasStringConstituent = arrayType !== inputType; - if (hasStringConstituent) { - if (arrayType.flags & 131072 /* Never */) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType; - } - } - } - if (!isArrayLikeType(arrayType)) { - if (errorNode) { - const allowsStrings = !!(use & 4 /* AllowsStringInputFlag */) && !hasStringConstituent; - const [defaultDiagnostic, maybeMissingAwait] = getIterationDiagnosticDetails(allowsStrings, downlevelIteration); - errorAndMaybeSuggestAwait( - errorNode, - maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), - defaultDiagnostic, - typeToString(arrayType) - ); - } - return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : void 0; - } - const arrayElementType = getIndexTypeOfType(arrayType, numberType); - if (hasStringConstituent && arrayElementType) { - if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) { - return stringType; - } - return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */); - } - return use & 128 /* PossiblyOutOfBounds */ ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; - function getIterationDiagnosticDetails(allowsStrings, downlevelIteration2) { - var _a; - if (downlevelIteration2) { - return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] : [Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]; - } - const yieldType = getIterationTypeOfIterable( - use, - 0 /* Yield */, - inputType, - /*errorNode*/ - void 0 - ); - if (yieldType) { - return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false]; - } - if (isES2015OrLaterIterable((_a = inputType.symbol) == null ? void 0 : _a.escapedName)) { - return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true]; - } - return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true] : [Diagnostics.Type_0_is_not_an_array_type, true]; - } - } - function isES2015OrLaterIterable(n) { - switch (n) { - case "Float32Array": - case "Float64Array": - case "Int16Array": - case "Int32Array": - case "Int8Array": - case "NodeList": - case "Uint16Array": - case "Uint32Array": - case "Uint8Array": - case "Uint8ClampedArray": - return true; - } - return false; - } - function getIterationTypeOfIterable(use, typeKind, inputType, errorNode) { - if (isTypeAny(inputType)) { - return void 0; - } - const iterationTypes = getIterationTypesOfIterable(inputType, use, errorNode); - return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(typeKind)]; - } - function createIterationTypes(yieldType = neverType, returnType = neverType, nextType = unknownType) { - if (yieldType.flags & 67359327 /* Intrinsic */ && returnType.flags & (1 /* Any */ | 131072 /* Never */ | 2 /* Unknown */ | 16384 /* Void */ | 32768 /* Undefined */) && nextType.flags & (1 /* Any */ | 131072 /* Never */ | 2 /* Unknown */ | 16384 /* Void */ | 32768 /* Undefined */)) { - const id = getTypeListId([yieldType, returnType, nextType]); - let iterationTypes = iterationTypesCache.get(id); - if (!iterationTypes) { - iterationTypes = { yieldType, returnType, nextType }; - iterationTypesCache.set(id, iterationTypes); - } - return iterationTypes; - } - return { yieldType, returnType, nextType }; - } - function combineIterationTypes(array) { - let yieldTypes; - let returnTypes; - let nextTypes; - for (const iterationTypes of array) { - if (iterationTypes === void 0 || iterationTypes === noIterationTypes) { - continue; - } - if (iterationTypes === anyIterationTypes) { - return anyIterationTypes; - } - yieldTypes = append(yieldTypes, iterationTypes.yieldType); - returnTypes = append(returnTypes, iterationTypes.returnType); - nextTypes = append(nextTypes, iterationTypes.nextType); - } - if (yieldTypes || returnTypes || nextTypes) { - return createIterationTypes( - yieldTypes && getUnionType(yieldTypes), - returnTypes && getUnionType(returnTypes), - nextTypes && getIntersectionType(nextTypes) - ); - } - return noIterationTypes; - } - function getCachedIterationTypes(type, cacheKey) { - return type[cacheKey]; - } - function setCachedIterationTypes(type, cacheKey, cachedTypes2) { - return type[cacheKey] = cachedTypes2; - } - function getIterationTypesOfIterable(type, use, errorNode) { - var _a, _b; - if (type === silentNeverType) { - return silentNeverIterationTypes; - } - if (isTypeAny(type)) { - return anyIterationTypes; - } - if (!(type.flags & 1048576 /* Union */)) { - const errorOutputContainer = errorNode ? { errors: void 0, skipLogging: true } : void 0; - const iterationTypes2 = getIterationTypesOfIterableWorker(type, use, errorNode, errorOutputContainer); - if (iterationTypes2 === noIterationTypes) { - if (errorNode) { - const rootDiag = reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */)); - if (errorOutputContainer == null ? void 0 : errorOutputContainer.errors) { - addRelatedInfo(rootDiag, ...errorOutputContainer.errors); - } - } - return void 0; - } else if ((_a = errorOutputContainer == null ? void 0 : errorOutputContainer.errors) == null ? void 0 : _a.length) { - for (const diag2 of errorOutputContainer.errors) { - diagnostics.add(diag2); - } - } - return iterationTypes2; - } - const cacheKey = use & 2 /* AllowsAsyncIterablesFlag */ ? "iterationTypesOfAsyncIterable" : "iterationTypesOfIterable"; - const cachedTypes2 = getCachedIterationTypes(type, cacheKey); - if (cachedTypes2) return cachedTypes2 === noIterationTypes ? void 0 : cachedTypes2; - let allIterationTypes; - for (const constituent of type.types) { - const errorOutputContainer = errorNode ? { errors: void 0 } : void 0; - const iterationTypes2 = getIterationTypesOfIterableWorker(constituent, use, errorNode, errorOutputContainer); - if (iterationTypes2 === noIterationTypes) { - if (errorNode) { - const rootDiag = reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */)); - if (errorOutputContainer == null ? void 0 : errorOutputContainer.errors) { - addRelatedInfo(rootDiag, ...errorOutputContainer.errors); - } - } - setCachedIterationTypes(type, cacheKey, noIterationTypes); - return void 0; - } else if ((_b = errorOutputContainer == null ? void 0 : errorOutputContainer.errors) == null ? void 0 : _b.length) { - for (const diag2 of errorOutputContainer.errors) { - diagnostics.add(diag2); - } - } - allIterationTypes = append(allIterationTypes, iterationTypes2); - } - const iterationTypes = allIterationTypes ? combineIterationTypes(allIterationTypes) : noIterationTypes; - setCachedIterationTypes(type, cacheKey, iterationTypes); - return iterationTypes === noIterationTypes ? void 0 : iterationTypes; - } - function getAsyncFromSyncIterationTypes(iterationTypes, errorNode) { - if (iterationTypes === noIterationTypes) return noIterationTypes; - if (iterationTypes === anyIterationTypes) return anyIterationTypes; - const { yieldType, returnType, nextType } = iterationTypes; - if (errorNode) { - getGlobalAwaitedSymbol( - /*reportErrors*/ - true - ); - } - return createIterationTypes( - getAwaitedType(yieldType, errorNode) || anyType, - getAwaitedType(returnType, errorNode) || anyType, - nextType - ); - } - function getIterationTypesOfIterableWorker(type, use, errorNode, errorOutputContainer) { - if (isTypeAny(type)) { - return anyIterationTypes; - } - let noCache = false; - if (use & 2 /* AllowsAsyncIterablesFlag */) { - const iterationTypes = getIterationTypesOfIterableCached(type, asyncIterationTypesResolver) || getIterationTypesOfIterableFast(type, asyncIterationTypesResolver); - if (iterationTypes) { - if (iterationTypes === noIterationTypes && errorNode) { - noCache = true; - } else { - return use & 8 /* ForOfFlag */ ? getAsyncFromSyncIterationTypes(iterationTypes, errorNode) : iterationTypes; - } - } - } - if (use & 1 /* AllowsSyncIterablesFlag */) { - let iterationTypes = getIterationTypesOfIterableCached(type, syncIterationTypesResolver) || getIterationTypesOfIterableFast(type, syncIterationTypesResolver); - if (iterationTypes) { - if (iterationTypes === noIterationTypes && errorNode) { - noCache = true; - } else { - if (use & 2 /* AllowsAsyncIterablesFlag */) { - if (iterationTypes !== noIterationTypes) { - iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode); - return noCache ? iterationTypes : setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", iterationTypes); - } - } else { - return iterationTypes; - } - } - } - } - if (use & 2 /* AllowsAsyncIterablesFlag */) { - const iterationTypes = getIterationTypesOfIterableSlow(type, asyncIterationTypesResolver, errorNode, errorOutputContainer, noCache); - if (iterationTypes !== noIterationTypes) { - return iterationTypes; - } - } - if (use & 1 /* AllowsSyncIterablesFlag */) { - let iterationTypes = getIterationTypesOfIterableSlow(type, syncIterationTypesResolver, errorNode, errorOutputContainer, noCache); - if (iterationTypes !== noIterationTypes) { - if (use & 2 /* AllowsAsyncIterablesFlag */) { - iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode); - return noCache ? iterationTypes : setCachedIterationTypes(type, "iterationTypesOfAsyncIterable", iterationTypes); - } else { - return iterationTypes; - } - } - } - return noIterationTypes; - } - function getIterationTypesOfIterableCached(type, resolver) { - return getCachedIterationTypes(type, resolver.iterableCacheKey); - } - function getIterationTypesOfIterableFast(type, resolver) { - if (isReferenceToType2(type, resolver.getGlobalIterableType( - /*reportErrors*/ - false - )) || isReferenceToType2(type, resolver.getGlobalIteratorObjectType( - /*reportErrors*/ - false - )) || isReferenceToType2(type, resolver.getGlobalIterableIteratorType( - /*reportErrors*/ - false - )) || isReferenceToType2(type, resolver.getGlobalGeneratorType( - /*reportErrors*/ - false - ))) { - const [yieldType, returnType, nextType] = getTypeArguments(type); - return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType( - yieldType, - /*errorNode*/ - void 0 - ) || yieldType, resolver.resolveIterationType( - returnType, - /*errorNode*/ - void 0 - ) || returnType, nextType)); - } - if (isReferenceToSomeType(type, resolver.getGlobalBuiltinIteratorTypes())) { - const [yieldType] = getTypeArguments(type); - const returnType = getBuiltinIteratorReturnType(); - const nextType = unknownType; - return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType( - yieldType, - /*errorNode*/ - void 0 - ) || yieldType, resolver.resolveIterationType( - returnType, - /*errorNode*/ - void 0 - ) || returnType, nextType)); - } - } - function getPropertyNameForKnownSymbolName(symbolName2) { - const ctorType = getGlobalESSymbolConstructorSymbol( - /*reportErrors*/ - false - ); - const uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), escapeLeadingUnderscores(symbolName2)); - return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : `__@${symbolName2}`; - } - function getIterationTypesOfIterableSlow(type, resolver, errorNode, errorOutputContainer, noCache) { - const method = getPropertyOfType(type, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName)); - const methodType = method && !(method.flags & 16777216 /* Optional */) ? getTypeOfSymbol(method) : void 0; - if (isTypeAny(methodType)) { - return noCache ? anyIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes); - } - const allSignatures = methodType ? getSignaturesOfType(methodType, 0 /* Call */) : void 0; - const validSignatures = filter(allSignatures, (sig) => getMinArgumentCount(sig) === 0); - if (!some(validSignatures)) { - if (errorNode && some(allSignatures)) { - checkTypeAssignableTo( - type, - resolver.getGlobalIterableType( - /*reportErrors*/ - true - ), - errorNode, - /*headMessage*/ - void 0, - /*containingMessageChain*/ - void 0, - errorOutputContainer - ); - } - return noCache ? noIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes); - } - const iteratorType = getIntersectionType(map(validSignatures, getReturnTypeOfSignature)); - const iterationTypes = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache) ?? noIterationTypes; - return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes); - } - function reportTypeNotIterableError(errorNode, type, allowAsyncIterables) { - const message = allowAsyncIterables ? Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator : Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator; - const suggestAwait = ( - // for (const x of Promise<...>) or [...Promise<...>] - !!getAwaitedTypeOfPromise(type) || !allowAsyncIterables && isForOfStatement(errorNode.parent) && errorNode.parent.expression === errorNode && getGlobalAsyncIterableType( - /*reportErrors*/ - false - ) !== emptyGenericType && isTypeAssignableTo(type, createTypeFromGenericGlobalType(getGlobalAsyncIterableType( - /*reportErrors*/ - false - ), [anyType, anyType, anyType])) - ); - return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type)); - } - function getIterationTypesOfIterator(type, resolver, errorNode, errorOutputContainer) { - return getIterationTypesOfIteratorWorker( - type, - resolver, - errorNode, - errorOutputContainer, - /*noCache*/ - false - ); - } - function getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, noCache) { - if (isTypeAny(type)) { - return anyIterationTypes; - } - let iterationTypes = getIterationTypesOfIteratorCached(type, resolver) || getIterationTypesOfIteratorFast(type, resolver); - if (iterationTypes === noIterationTypes && errorNode) { - iterationTypes = void 0; - noCache = true; - } - iterationTypes ?? (iterationTypes = getIterationTypesOfIteratorSlow(type, resolver, errorNode, errorOutputContainer, noCache)); - return iterationTypes === noIterationTypes ? void 0 : iterationTypes; - } - function getIterationTypesOfIteratorCached(type, resolver) { - return getCachedIterationTypes(type, resolver.iteratorCacheKey); - } - function getIterationTypesOfIteratorFast(type, resolver) { - if (isReferenceToType2(type, resolver.getGlobalIterableIteratorType( - /*reportErrors*/ - false - )) || isReferenceToType2(type, resolver.getGlobalIteratorType( - /*reportErrors*/ - false - )) || isReferenceToType2(type, resolver.getGlobalIteratorObjectType( - /*reportErrors*/ - false - )) || isReferenceToType2(type, resolver.getGlobalGeneratorType( - /*reportErrors*/ - false - ))) { - const [yieldType, returnType, nextType] = getTypeArguments(type); - return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType)); - } - if (isReferenceToSomeType(type, resolver.getGlobalBuiltinIteratorTypes())) { - const [yieldType] = getTypeArguments(type); - const returnType = getBuiltinIteratorReturnType(); - const nextType = unknownType; - return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType)); - } - } - function isIteratorResult(type, kind) { - const doneType = getTypeOfPropertyOfType(type, "done") || falseType; - return isTypeAssignableTo(kind === 0 /* Yield */ ? falseType : trueType, doneType); - } - function isYieldIteratorResult(type) { - return isIteratorResult(type, 0 /* Yield */); - } - function isReturnIteratorResult(type) { - return isIteratorResult(type, 1 /* Return */); - } - function getIterationTypesOfIteratorResult(type) { - if (isTypeAny(type)) { - return anyIterationTypes; - } - const cachedTypes2 = getCachedIterationTypes(type, "iterationTypesOfIteratorResult"); - if (cachedTypes2) { - return cachedTypes2; - } - if (isReferenceToType2(type, getGlobalIteratorYieldResultType( - /*reportErrors*/ - false - ))) { - const yieldType2 = getTypeArguments(type)[0]; - return setCachedIterationTypes(type, "iterationTypesOfIteratorResult", createIterationTypes( - yieldType2, - /*returnType*/ - void 0, - /*nextType*/ - void 0 - )); - } - if (isReferenceToType2(type, getGlobalIteratorReturnResultType( - /*reportErrors*/ - false - ))) { - const returnType2 = getTypeArguments(type)[0]; - return setCachedIterationTypes(type, "iterationTypesOfIteratorResult", createIterationTypes( - /*yieldType*/ - void 0, - returnType2, - /*nextType*/ - void 0 - )); - } - const yieldIteratorResult = filterType(type, isYieldIteratorResult); - const yieldType = yieldIteratorResult !== neverType ? getTypeOfPropertyOfType(yieldIteratorResult, "value") : void 0; - const returnIteratorResult = filterType(type, isReturnIteratorResult); - const returnType = returnIteratorResult !== neverType ? getTypeOfPropertyOfType(returnIteratorResult, "value") : void 0; - if (!yieldType && !returnType) { - return setCachedIterationTypes(type, "iterationTypesOfIteratorResult", noIterationTypes); - } - return setCachedIterationTypes(type, "iterationTypesOfIteratorResult", createIterationTypes( - yieldType, - returnType || voidType, - /*nextType*/ - void 0 - )); - } - function getIterationTypesOfMethod(type, resolver, methodName, errorNode, errorOutputContainer) { - var _a, _b, _c, _d; - const method = getPropertyOfType(type, methodName); - if (!method && methodName !== "next") { - return void 0; - } - const methodType = method && !(methodName === "next" && method.flags & 16777216 /* Optional */) ? methodName === "next" ? getTypeOfSymbol(method) : getTypeWithFacts(getTypeOfSymbol(method), 2097152 /* NEUndefinedOrNull */) : void 0; - if (isTypeAny(methodType)) { - return anyIterationTypes; - } - const methodSignatures = methodType ? getSignaturesOfType(methodType, 0 /* Call */) : emptyArray; - if (methodSignatures.length === 0) { - if (errorNode) { - const diagnostic = methodName === "next" ? resolver.mustHaveANextMethodDiagnostic : resolver.mustBeAMethodDiagnostic; - if (errorOutputContainer) { - errorOutputContainer.errors ?? (errorOutputContainer.errors = []); - errorOutputContainer.errors.push(createDiagnosticForNode(errorNode, diagnostic, methodName)); - } else { - error2(errorNode, diagnostic, methodName); - } - } - return methodName === "next" ? noIterationTypes : void 0; - } - if ((methodType == null ? void 0 : methodType.symbol) && methodSignatures.length === 1) { - const globalGeneratorType = resolver.getGlobalGeneratorType( - /*reportErrors*/ - false - ); - const globalIteratorType = resolver.getGlobalIteratorType( - /*reportErrors*/ - false - ); - const isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) == null ? void 0 : _a.members) == null ? void 0 : _b.get(methodName)) === methodType.symbol; - const isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) == null ? void 0 : _c.members) == null ? void 0 : _d.get(methodName)) === methodType.symbol; - if (isGeneratorMethod || isIteratorMethod) { - const globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; - const { mapper } = methodType; - return createIterationTypes( - getMappedType(globalType.typeParameters[0], mapper), - getMappedType(globalType.typeParameters[1], mapper), - methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : void 0 - ); - } - } - let methodParameterTypes; - let methodReturnTypes; - for (const signature of methodSignatures) { - if (methodName !== "throw" && some(signature.parameters)) { - methodParameterTypes = append(methodParameterTypes, getTypeAtPosition(signature, 0)); - } - methodReturnTypes = append(methodReturnTypes, getReturnTypeOfSignature(signature)); - } - let returnTypes; - let nextType; - if (methodName !== "throw") { - const methodParameterType = methodParameterTypes ? getUnionType(methodParameterTypes) : unknownType; - if (methodName === "next") { - nextType = methodParameterType; - } else if (methodName === "return") { - const resolvedMethodParameterType = resolver.resolveIterationType(methodParameterType, errorNode) || anyType; - returnTypes = append(returnTypes, resolvedMethodParameterType); - } - } - let yieldType; - const methodReturnType = methodReturnTypes ? getIntersectionType(methodReturnTypes) : neverType; - const resolvedMethodReturnType = resolver.resolveIterationType(methodReturnType, errorNode) || anyType; - const iterationTypes = getIterationTypesOfIteratorResult(resolvedMethodReturnType); - if (iterationTypes === noIterationTypes) { - if (errorNode) { - if (errorOutputContainer) { - errorOutputContainer.errors ?? (errorOutputContainer.errors = []); - errorOutputContainer.errors.push(createDiagnosticForNode(errorNode, resolver.mustHaveAValueDiagnostic, methodName)); - } else { - error2(errorNode, resolver.mustHaveAValueDiagnostic, methodName); - } - } - yieldType = anyType; - returnTypes = append(returnTypes, anyType); - } else { - yieldType = iterationTypes.yieldType; - returnTypes = append(returnTypes, iterationTypes.returnType); - } - return createIterationTypes(yieldType, getUnionType(returnTypes), nextType); - } - function getIterationTypesOfIteratorSlow(type, resolver, errorNode, errorOutputContainer, noCache) { - const iterationTypes = combineIterationTypes([ - getIterationTypesOfMethod(type, resolver, "next", errorNode, errorOutputContainer), - getIterationTypesOfMethod(type, resolver, "return", errorNode, errorOutputContainer), - getIterationTypesOfMethod(type, resolver, "throw", errorNode, errorOutputContainer) - ]); - return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iteratorCacheKey, iterationTypes); - } - function getIterationTypeOfGeneratorFunctionReturnType(kind, returnType, isAsyncGenerator) { - if (isTypeAny(returnType)) { - return void 0; - } - const iterationTypes = getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsyncGenerator); - return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(kind)]; - } - function getIterationTypesOfGeneratorFunctionReturnType(type, isAsyncGenerator) { - if (isTypeAny(type)) { - return anyIterationTypes; - } - const use = isAsyncGenerator ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */; - const resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver; - return getIterationTypesOfIterable( - type, - use, - /*errorNode*/ - void 0 - ) || getIterationTypesOfIterator( - type, - resolver, - /*errorNode*/ - void 0, - /*errorOutputContainer*/ - void 0 - ); - } - function checkBreakOrContinueStatement(node) { - if (!checkGrammarStatementInAmbientContext(node)) checkGrammarBreakOrContinueStatement(node); - } - function unwrapReturnType(returnType, functionFlags) { - const isGenerator = !!(functionFlags & 1 /* Generator */); - const isAsync = !!(functionFlags & 2 /* Async */); - if (isGenerator) { - const returnIterationType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync); - if (!returnIterationType) { - return errorType; - } - return isAsync ? getAwaitedTypeNoAlias(unwrapAwaitedType(returnIterationType)) : returnIterationType; - } - return isAsync ? getAwaitedTypeNoAlias(returnType) || errorType : returnType; - } - function isUnwrappedReturnTypeUndefinedVoidOrAny(func, returnType) { - const type = unwrapReturnType(returnType, getFunctionFlags(func)); - return !!(type && (maybeTypeOfKind(type, 16384 /* Void */) || type.flags & (1 /* Any */ | 32768 /* Undefined */))); - } - function checkReturnStatement(node) { - if (checkGrammarStatementInAmbientContext(node)) { - return; - } - const container = getContainingFunctionOrClassStaticBlock(node); - if (container && isClassStaticBlockDeclaration(container)) { - grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block); - return; - } - if (!container) { - grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - return; - } - const signature = getSignatureFromDeclaration(container); - const returnType = getReturnTypeOfSignature(signature); - if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { - const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (container.kind === 179 /* SetAccessor */) { - if (node.expression) { - error2(node, Diagnostics.Setters_cannot_return_a_value); - } - } else if (container.kind === 177 /* Constructor */) { - const exprType2 = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType2, returnType, node, node.expression)) { - 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, getFunctionFlags(container)) ?? returnType; - checkReturnExpression(container, unwrappedReturnType, node, node.expression, exprType); - } - } else if (container.kind !== 177 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { - error2(node, Diagnostics.Not_all_code_paths_return_a_value); - } - } - function checkReturnExpression(container, unwrappedReturnType, node, expr, exprType, inConditionalExpression = false) { - const excludeJSDocTypeAssertions = isInJSFile(node); - const functionFlags = getFunctionFlags(container); - if (expr) { - const unwrappedExpr = skipParentheses(expr, excludeJSDocTypeAssertions); - if (isConditionalExpression(unwrappedExpr)) { - checkReturnExpression( - container, - unwrappedReturnType, - node, - unwrappedExpr.whenTrue, - checkExpression(unwrappedExpr.whenTrue), - /*inConditionalExpression*/ - true - ); - checkReturnExpression( - container, - unwrappedReturnType, - node, - unwrappedExpr.whenFalse, - checkExpression(unwrappedExpr.whenFalse), - /*inConditionalExpression*/ - true - ); - return; - } - } - const inReturnStatement = node.kind === 254 /* ReturnStatement */; - const unwrappedExprType = functionFlags & 2 /* Async */ ? checkAwaitedType( - exprType, - /*withAlias*/ - false, - node, - Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member - ) : exprType; - const effectiveExpr = expr && getEffectiveCheckNode(expr); - const errorNode = inReturnStatement && !inConditionalExpression ? node : effectiveExpr; - checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr); - } - function checkWithStatement(node) { - if (!checkGrammarStatementInAmbientContext(node)) { - if (node.flags & 65536 /* AwaitContext */) { - grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); - } - } - checkExpression(node.expression); - const sourceFile = getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - const start = getSpanOfTokenAtPosition(sourceFile, node.pos).start; - const end = node.statement.pos; - grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any); - } - } - function checkSwitchStatement(node) { - checkGrammarStatementInAmbientContext(node); - let firstDefaultClause; - let hasDuplicateDefaultClause = false; - const expressionType = checkExpression(node.expression); - forEach(node.caseBlock.clauses, (clause) => { - if (clause.kind === 298 /* DefaultClause */ && !hasDuplicateDefaultClause) { - if (firstDefaultClause === void 0) { - firstDefaultClause = clause; - } else { - grammarErrorOnNode(clause, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - hasDuplicateDefaultClause = true; - } - } - if (clause.kind === 297 /* CaseClause */) { - addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause)); - } - forEach(clause.statements, checkSourceElement); - if (compilerOptions.noFallthroughCasesInSwitch && clause.fallthroughFlowNode && isReachableFlowNode(clause.fallthroughFlowNode)) { - error2(clause, Diagnostics.Fallthrough_case_in_switch); - } - function createLazyCaseClauseDiagnostics(clause2) { - return () => { - const caseType = checkExpression(clause2.expression); - if (!isTypeEqualityComparableTo(expressionType, caseType)) { - checkTypeComparableTo( - caseType, - expressionType, - clause2.expression, - /*headMessage*/ - void 0 - ); - } - }; - } - }); - if (node.caseBlock.locals) { - registerForUnusedIdentifiersCheck(node.caseBlock); - } - } - function checkLabeledStatement(node) { - if (!checkGrammarStatementInAmbientContext(node)) { - findAncestor(node.parent, (current) => { - if (isFunctionLike(current)) { - return "quit"; - } - if (current.kind === 257 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { - grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label)); - return true; - } - return false; - }); - } - checkSourceElement(node.statement); - } - function checkThrowStatement(node) { - if (!checkGrammarStatementInAmbientContext(node)) { - if (isIdentifier(node.expression) && !node.expression.escapedText) { - grammarErrorAfterFirstToken(node, Diagnostics.Line_break_not_permitted_here); - } - } - if (node.expression) { - checkExpression(node.expression); - } - } - function checkTryStatement(node) { - checkGrammarStatementInAmbientContext(node); - checkBlock(node.tryBlock); - const catchClause = node.catchClause; - if (catchClause) { - if (catchClause.variableDeclaration) { - const declaration = catchClause.variableDeclaration; - checkVariableLikeDeclaration(declaration); - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - const type = getTypeFromTypeNode(typeNode); - if (type && !(type.flags & 3 /* AnyOrUnknown */)) { - grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); - } - } else if (declaration.initializer) { - grammarErrorOnFirstToken(declaration.initializer, Diagnostics.Catch_clause_variable_cannot_have_an_initializer); - } else { - const blockLocals = catchClause.block.locals; - if (blockLocals) { - forEachKey(catchClause.locals, (caughtName) => { - const blockLocal = blockLocals.get(caughtName); - if ((blockLocal == null ? void 0 : blockLocal.valueDeclaration) && (blockLocal.flags & 2 /* BlockScopedVariable */) !== 0) { - grammarErrorOnNode(blockLocal.valueDeclaration, Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, unescapeLeadingUnderscores(caughtName)); - } - }); - } - } - } - checkBlock(catchClause.block); - } - if (node.finallyBlock) { - checkBlock(node.finallyBlock); - } - } - function checkIndexConstraints(type, symbol, isStaticIndex) { - const indexInfos = getIndexInfosOfType(type); - if (indexInfos.length === 0) { - return; - } - for (const prop of getPropertiesOfObjectType(type)) { - if (!(isStaticIndex && prop.flags & 4194304 /* Prototype */)) { - checkIndexConstraintForProperty(type, prop, getLiteralTypeFromProperty( - prop, - 8576 /* StringOrNumberLiteralOrUnique */, - /*includeNonPublic*/ - true - ), getNonMissingTypeOfSymbol(prop)); - } - } - const typeDeclaration = symbol.valueDeclaration; - if (typeDeclaration && isClassLike(typeDeclaration)) { - for (const member of typeDeclaration.members) { - if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) { - const symbol2 = getSymbolOfDeclaration(member); - checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2)); - } - } - } - if (indexInfos.length > 1) { - for (const info of indexInfos) { - checkIndexConstraintForIndexSignature(type, info); - } - } - } - function checkIndexConstraintForProperty(type, prop, propNameType, propType) { - const declaration = prop.valueDeclaration; - const name = getNameOfDeclaration(declaration); - if (name && isPrivateIdentifier(name)) { - return; - } - const indexInfos = getApplicableIndexInfos(type, propNameType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 265 /* InterfaceDeclaration */) : void 0; - const propDeclaration = declaration && declaration.kind === 227 /* BinaryExpression */ || name && name.kind === 168 /* 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)); - if (propDeclaration && errorNode !== propDeclaration) { - addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here, symbolToString(prop))); - } - diagnostics.add(diagnostic); - } - } - } - function checkIndexConstraintForIndexSignature(type, checkInfo) { - const declaration = checkInfo.declaration; - const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 265 /* InterfaceDeclaration */) : void 0; - const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfDeclaration(declaration)) === type.symbol ? declaration : void 0; - for (const info of indexInfos) { - if (info === checkInfo) continue; - 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)) { - 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)); - } - } - } - function checkTypeNameIsReserved(name, message) { - switch (name.escapedText) { - case "any": - case "unknown": - case "never": - case "number": - case "bigint": - case "boolean": - case "string": - case "symbol": - case "void": - case "object": - case "undefined": - error2(name, message, name.escapedText); - } - } - function checkClassNameCollisionWithObject(name) { - if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" && host.getEmitModuleFormatOfFile(getSourceFileOfNode(name)) < 5 /* ES2015 */) { - error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0, ModuleKind[moduleKind]); - } - } - function checkUnmatchedJSDocParameters(node) { - const jsdocParameters = filter(getJSDocTags(node), isJSDocParameterTag); - if (!length(jsdocParameters)) return; - const isJs = isInJSFile(node); - const parameters = /* @__PURE__ */ new Set(); - const excludedParameters = /* @__PURE__ */ new Set(); - forEach(node.parameters, ({ name }, index) => { - if (isIdentifier(name)) { - parameters.add(name.escapedText); - } - if (isBindingPattern(name)) { - excludedParameters.add(index); - } - }); - const containsArguments = containsArgumentsReference(node); - if (containsArguments) { - 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))) { - 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) => { - if (excludedParameters.has(index) || isIdentifier(name) && parameters.has(name.escapedText)) { - return; - } - if (isQualifiedName(name)) { - if (isJs) { - error2(name, Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, entityNameToString(name), entityNameToString(name.left)); - } - } else { - if (!isNameFirst) { - errorOrSuggestion(isJs, name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, idText(name)); - } - } - }); - } - } - function checkTypeParameters(typeParameterDeclarations) { - let seenDefault = false; - if (typeParameterDeclarations) { - for (let i = 0; i < typeParameterDeclarations.length; i++) { - const node = typeParameterDeclarations[i]; - checkTypeParameter(node); - addLazyDiagnostic(createCheckTypeParameterDiagnostic(node, i)); - } - } - function createCheckTypeParameterDiagnostic(node, i) { - return () => { - if (node.default) { - seenDefault = true; - checkTypeParametersNotReferenced(node.default, typeParameterDeclarations, i); - } else if (seenDefault) { - 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) { - error2(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name)); - } - } - }; - } - } - function checkTypeParametersNotReferenced(root, typeParameters, index) { - visit(root); - function visit(node) { - if (node.kind === 184 /* TypeReference */) { - const type = getTypeFromTypeReference(node); - if (type.flags & 262144 /* TypeParameter */) { - for (let i = index; i < typeParameters.length; i++) { - if (type.symbol === getSymbolOfDeclaration(typeParameters[i])) { - error2(node, Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters); - } - } - } - } - forEachChild(node, visit); - } - } - function checkTypeParameterListsIdentical(symbol) { - if (symbol.declarations && symbol.declarations.length === 1) { - return; - } - const links = getSymbolLinks(symbol); - if (!links.typeParametersChecked) { - links.typeParametersChecked = true; - const declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); - if (!declarations || declarations.length <= 1) { - return; - } - const type = getDeclaredTypeOfSymbol(symbol); - if (!areTypeParametersIdentical(declarations, type.localTypeParameters, getEffectiveTypeParameterDeclarations)) { - const name = symbolToString(symbol); - for (const declaration of declarations) { - error2(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); - } - } - } - } - function areTypeParametersIdentical(declarations, targetParameters, getTypeParameterDeclarations) { - const maxTypeArgumentCount = length(targetParameters); - const minTypeArgumentCount = getMinTypeArgumentCount(targetParameters); - for (const declaration of declarations) { - const sourceParameters = getTypeParameterDeclarations(declaration); - const numTypeParameters = sourceParameters.length; - if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { - return false; - } - for (let i = 0; i < numTypeParameters; i++) { - const source = sourceParameters[i]; - const target = targetParameters[i]; - if (source.name.escapedText !== target.symbol.escapedName) { - return false; - } - const constraint = getEffectiveConstraintOfTypeParameter(source); - const sourceConstraint = constraint && getTypeFromTypeNode(constraint); - const targetConstraint = getConstraintOfTypeParameter(target); - if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { - return false; - } - const sourceDefault = source.default && getTypeFromTypeNode(source.default); - const targetDefault = getDefaultFromTypeParameter(target); - if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { - return false; - } - } - } - return true; - } - function getFirstTransformableStaticClassElement(node) { - const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators && classOrConstructorParameterIsDecorated( - /*useLegacyDecorators*/ - false, - node - ); - const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators; - const willTransformInitializers = !emitStandardClassFields; - if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) { - for (const member of node.members) { - if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated( - /*useLegacyDecorators*/ - false, - member, - node - )) { - return firstOrUndefined(getDecorators(node)) ?? node; - } else if (willTransformPrivateElementsOrClassStaticBlocks) { - if (isClassStaticBlockDeclaration(member)) { - return member; - } else if (isStatic(member)) { - if (isPrivateIdentifierClassElementDeclaration(member) || willTransformInitializers && isInitializedProperty(member)) { - return member; - } - } - } - } - } - } - function checkClassExpressionExternalHelpers(node) { - if (node.name) return; - const parent2 = walkUpOuterExpressions(node); - if (!isNamedEvaluationSource(parent2)) return; - const willTransformESDecorators = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators; - let location; - if (willTransformESDecorators && classOrConstructorParameterIsDecorated( - /*useLegacyDecorators*/ - false, - node - )) { - location = firstOrUndefined(getDecorators(node)) ?? node; - } else { - location = getFirstTransformableStaticClassElement(node); - } - if (location) { - checkExternalEmitHelpers(location, 4194304 /* SetFunctionName */); - if ((isPropertyAssignment(parent2) || isPropertyDeclaration(parent2) || isBindingElement(parent2)) && isComputedPropertyName(parent2.name)) { - checkExternalEmitHelpers(location, 8388608 /* PropKey */); - } - } - } - function checkClassExpression(node) { - checkClassLikeDeclaration(node); - checkNodeDeferred(node); - checkClassExpressionExternalHelpers(node); - return getTypeOfSymbol(getSymbolOfDeclaration(node)); - } - function checkClassExpressionDeferred(node) { - forEach(node.members, checkSourceElement); - registerForUnusedIdentifiersCheck(node); - } - function checkClassDeclaration(node) { - const firstDecorator = find(node.modifiers, isDecorator); - 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, 2048 /* Default */)) { - grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); - } - checkClassLikeDeclaration(node); - forEach(node.members, checkSourceElement); - registerForUnusedIdentifiersCheck(node); - } - function checkClassLikeDeclaration(node) { - checkGrammarClassLikeDeclaration(node); - checkDecorators(node); - checkCollisionsForDeclarationName(node, node.name); - checkTypeParameters(getEffectiveTypeParameterDeclarations(node)); - checkExportsOnMergedDeclarations(node); - const symbol = getSymbolOfDeclaration(node); - const type = getDeclaredTypeOfSymbol(symbol); - const typeWithThis = getTypeWithThisArgument(type); - const staticType = getTypeOfSymbol(symbol); - checkTypeParameterListsIdentical(symbol); - checkFunctionOrConstructorSymbol(symbol); - checkClassForDuplicateDeclarations(node); - const nodeInAmbientContext = !!(node.flags & 33554432 /* Ambient */); - if (!nodeInAmbientContext) { - checkClassForStaticPropertyNameConflicts(node); - } - const baseTypeNode = getEffectiveBaseTypeNode(node); - if (baseTypeNode) { - forEach(baseTypeNode.typeArguments, checkSourceElement); - if (languageVersion < LanguageFeatureMinimumTarget.Classes) { - checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */); - } - const extendsNode = getClassExtendsHeritageElement(node); - if (extendsNode && extendsNode !== baseTypeNode) { - checkExpression(extendsNode.expression); - } - const baseTypes = getBaseTypes(type); - if (baseTypes.length) { - addLazyDiagnostic(() => { - const baseType = baseTypes[0]; - const baseConstructorType = getBaseConstructorTypeOfClass(type); - const staticBaseType = getApparentType(baseConstructorType); - checkBaseTypeAccessibility(staticBaseType, baseTypeNode); - checkSourceElement(baseTypeNode.expression); - if (some(baseTypeNode.typeArguments)) { - forEach(baseTypeNode.typeArguments, checkSourceElement); - for (const constructor of getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode)) { - if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { - break; - } - } - } - const baseWithThis = getTypeWithThisArgument(baseType, type.thisType); - if (!checkTypeAssignableTo( - typeWithThis, - baseWithThis, - /*errorNode*/ - void 0 - )) { - 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); - } - if (baseConstructorType.flags & 8650752 /* TypeVariable */) { - if (!isMixinConstructorType(staticType)) { - 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, 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))) { - error2(baseTypeNode.expression, Diagnostics.Base_constructors_must_all_have_the_same_return_type); - } - } - checkKindsOfPropertyMemberOverrides(type, baseType); - }); - } - } - checkMembersForOverrideModifier(node, type, typeWithThis, staticType); - const implementedTypeNodes = getEffectiveImplementsTypeNodes(node); - if (implementedTypeNodes) { - for (const typeRefNode of implementedTypeNodes) { - if (!isEntityNameExpression(typeRefNode.expression) || isOptionalChain(typeRefNode.expression)) { - error2(typeRefNode.expression, Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); - } - checkTypeReferenceNode(typeRefNode); - addLazyDiagnostic(createImplementsDiagnostics(typeRefNode)); - } - } - addLazyDiagnostic(() => { - checkIndexConstraints(type, symbol); - checkIndexConstraints( - staticType, - symbol, - /*isStaticIndex*/ - true - ); - checkTypeForDuplicateIndexSignatures(node); - checkPropertyInitialization(node); - }); - function createImplementsDiagnostics(typeRefNode) { - return () => { - const t = getReducedType(getTypeFromTypeNode(typeRefNode)); - if (!isErrorType(t)) { - if (isValidBaseType(t)) { - const genericDiag = t.symbol && t.symbol.flags & 32 /* Class */ ? Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : Diagnostics.Class_0_incorrectly_implements_interface_1; - const baseWithThis = getTypeWithThisArgument(t, type.thisType); - if (!checkTypeAssignableTo( - typeWithThis, - baseWithThis, - /*errorNode*/ - void 0 - )) { - issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); - } - } else { - error2(typeRefNode, Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); - } - } - }; - } - } - function checkMembersForOverrideModifier(node, type, typeWithThis, staticType) { - const baseTypeNode = getEffectiveBaseTypeNode(node); - const baseTypes = baseTypeNode && getBaseTypes(type); - const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0; - const baseStaticType = getBaseConstructorTypeOfClass(type); - for (const member of node.members) { - if (hasAmbientModifier(member)) { - continue; - } - if (isConstructorDeclaration(member)) { - forEach(member.parameters, (param) => { - if (isParameterPropertyDeclaration(param, member)) { - checkExistingMemberForOverrideModifier( - node, - staticType, - baseStaticType, - baseWithThis, - type, - typeWithThis, - param, - /*memberIsParameterProperty*/ - true - ); - } - }); - } - checkExistingMemberForOverrideModifier( - node, - staticType, - baseStaticType, - baseWithThis, - type, - typeWithThis, - member, - /*memberIsParameterProperty*/ - false - ); - } - } - function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors2 = true) { - const declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); - if (!declaredProp) { - return 0 /* Ok */; - } - return checkMemberForOverrideModifier( - node, - staticType, - baseStaticType, - baseWithThis, - type, - typeWithThis, - hasOverrideModifier(member), - hasAbstractModifier(member), - isStatic(member), - memberIsParameterProperty, - declaredProp, - reportErrors2 ? member : void 0 - ); - } - function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member, errorNode) { - const isJs = isInJSFile(node); - const nodeInAmbientContext = !!(node.flags & 33554432 /* Ambient */); - if (memberHasOverrideModifier && (member == null ? void 0 : member.valueDeclaration) && isClassElement(member.valueDeclaration) && member.valueDeclaration.name && isNonBindableDynamicName(member.valueDeclaration.name)) { - error2( - errorNode, - isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic - ); - return 2 /* HasInvalidOverride */; - } - if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) { - const thisType = memberIsStatic ? staticType : typeWithThis; - const baseType = memberIsStatic ? baseStaticType : baseWithThis; - const prop = getPropertyOfType(thisType, member.escapedName); - const baseProp = getPropertyOfType(baseType, member.escapedName); - const baseClassName = typeToString(baseWithThis); - if (prop && !baseProp && memberHasOverrideModifier) { - if (errorNode) { - const suggestion = getSuggestedSymbolForNonexistentClassMember(symbolName(member), baseType); - 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) - ) : 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 - ); - } - return 2 /* HasInvalidOverride */; - } else if (prop && (baseProp == null ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) { - const baseHasAbstract = some(baseProp.declarations, hasAbstractModifier); - if (memberHasOverrideModifier) { - return 0 /* Ok */; - } - 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; - error2(errorNode, diag2, baseClassName); - } - return 1 /* NeedsOverride */; - } else if (memberHasAbstractModifier && baseHasAbstract) { - if (errorNode) { - 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 */; - } - } - } else if (memberHasOverrideModifier) { - if (errorNode) { - const className = typeToString(type); - 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 - ); - } - return 2 /* HasInvalidOverride */; - } - return 0 /* Ok */; - } - function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { - let issuedMemberError = false; - for (const member of node.members) { - if (isStatic(member)) { - continue; - } - const declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); - if (declaredProp) { - const prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); - const baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); - if (prop && baseProp) { - const rootChain = () => chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, - symbolToString(declaredProp), - typeToString(typeWithThis), - typeToString(baseWithThis) - ); - if (!checkTypeAssignableTo( - getTypeOfSymbol(prop), - getTypeOfSymbol(baseProp), - member.name || member, - /*headMessage*/ - void 0, - rootChain - )) { - issuedMemberError = true; - } - } - } - } - if (!issuedMemberError) { - checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); - } - } - function checkBaseTypeAccessibility(type, node) { - const signatures = getSignaturesOfType(type, 1 /* Construct */); - if (signatures.length) { - const declaration = signatures[0].declaration; - if (declaration && hasEffectiveModifier(declaration, 2 /* Private */)) { - const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); - if (!isNodeWithinClass(node, typeClassDeclaration)) { - error2(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); - } - } - } - } - function getMemberOverrideModifierStatus(node, member, memberSymbol) { - if (!member.name) { - return 0 /* Ok */; - } - const classSymbol = getSymbolOfDeclaration(node); - const type = getDeclaredTypeOfSymbol(classSymbol); - const typeWithThis = getTypeWithThisArgument(type); - const staticType = getTypeOfSymbol(classSymbol); - const baseTypeNode = getEffectiveBaseTypeNode(node); - 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, 16 /* Override */); - return checkMemberForOverrideModifier( - node, - staticType, - baseStaticType, - baseWithThis, - type, - typeWithThis, - memberHasOverrideModifier, - hasAbstractModifier(member), - isStatic(member), - /*memberIsParameterProperty*/ - false, - memberSymbol - ); - } - function getTargetSymbol(s) { - return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s; - } - function getClassOrInterfaceDeclarationsOfSymbol(symbol) { - return filter(symbol.declarations, (d) => d.kind === 264 /* ClassDeclaration */ || d.kind === 265 /* InterfaceDeclaration */); - } - function checkKindsOfPropertyMemberOverrides(type, baseType) { - var _a, _b, _c, _d, _e; - const baseProperties = getPropertiesOfType(baseType); - const notImplementedInfo = /* @__PURE__ */ new Map(); - basePropertyCheck: for (const baseProperty of baseProperties) { - const base = getTargetSymbol(baseProperty); - if (base.flags & 4194304 /* Prototype */) { - continue; - } - const baseSymbol = getPropertyOfObjectType(type, base.escapedName); - if (!baseSymbol) { - continue; - } - const derived = getTargetSymbol(baseSymbol); - const baseDeclarationFlags = getDeclarationModifierFlagsFromSymbol(base); - 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 & 64 /* Abstract */ && (!derivedClassDecl || !hasSyntacticModifier(derivedClassDecl, 64 /* Abstract */))) { - for (const otherBaseType of getBaseTypes(type)) { - if (otherBaseType === baseType) continue; - const baseSymbol2 = getPropertyOfObjectType(otherBaseType, base.escapedName); - const derivedElsewhere = baseSymbol2 && getTargetSymbol(baseSymbol2); - if (derivedElsewhere && derivedElsewhere !== base) { - continue basePropertyCheck; - } - } - const baseTypeName = typeToString(baseType); - const typeName = typeToString(type); - const basePropertyName = symbolToString(baseProperty); - const missedProperties = append((_a = notImplementedInfo.get(derivedClassDecl)) == null ? void 0 : _a.missedProperties, basePropertyName); - notImplementedInfo.set(derivedClassDecl, { baseTypeName, typeName, missedProperties }); - } - } else { - const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if (baseDeclarationFlags & 2 /* Private */ || derivedDeclarationFlags & 2 /* Private */) { - continue; - } - let errorMessage; - const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */; - const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */; - if (basePropertyFlags && derivedPropertyFlags) { - if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_b = base.declarations) == null ? void 0 : _b.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_c = base.declarations) == null ? void 0 : _c.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) { - continue; - } - const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */; - 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; - error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type)); - } else if (useDefineForClassFields) { - const uninitialized = (_d = derived.declarations) == null ? void 0 : _d.find((d) => d.kind === 173 /* PropertyDeclaration */ && !d.initializer); - if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_e = derived.declarations) == null ? void 0 : _e.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; - error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType)); - } - } - } - continue; - } else if (isPrototypeProperty(base)) { - if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) { - continue; - } else { - Debug.assert(!!(derived.flags & 98304 /* Accessor */)); - errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; - } - } else if (base.flags & 98304 /* Accessor */) { - errorMessage = Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; - } else { - errorMessage = Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; - } - error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); - } - } - for (const [errorNode, memberInfo] of notImplementedInfo) { - if (length(memberInfo.missedProperties) === 1) { - if (isClassExpression(errorNode)) { - error2(errorNode, Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, first(memberInfo.missedProperties), memberInfo.baseTypeName); - } else { - error2(errorNode, Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, memberInfo.typeName, first(memberInfo.missedProperties), memberInfo.baseTypeName); - } - } else if (length(memberInfo.missedProperties) > 5) { - const missedProperties = map(memberInfo.missedProperties.slice(0, 4), (prop) => `'${prop}'`).join(", "); - const remainingMissedProperties = length(memberInfo.missedProperties) - 4; - if (isClassExpression(errorNode)) { - error2(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more, memberInfo.baseTypeName, missedProperties, remainingMissedProperties); - } else { - error2(errorNode, Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more, memberInfo.typeName, memberInfo.baseTypeName, missedProperties, remainingMissedProperties); - } - } else { - const missedProperties = map(memberInfo.missedProperties, (prop) => `'${prop}'`).join(", "); - if (isClassExpression(errorNode)) { - error2(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1, memberInfo.baseTypeName, missedProperties); - } else { - error2(errorNode, Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2, memberInfo.typeName, memberInfo.baseTypeName, missedProperties); - } - } - } - } - function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) { - return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent); - } - function getNonInheritedProperties(type, baseTypes, properties) { - if (!length(baseTypes)) { - return properties; - } - const seen = /* @__PURE__ */ new Map(); - forEach(properties, (p) => { - seen.set(p.escapedName, p); - }); - for (const base of baseTypes) { - const properties2 = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (const prop of properties2) { - const existing = seen.get(prop.escapedName); - if (existing && prop.parent === existing.parent) { - seen.delete(prop.escapedName); - } - } - } - return arrayFrom(seen.values()); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - const baseTypes = getBaseTypes(type); - if (baseTypes.length < 2) { - return true; - } - const seen = /* @__PURE__ */ new Map(); - forEach(resolveDeclaredMembers(type).declaredProperties, (p) => { - seen.set(p.escapedName, { prop: p, containingType: type }); - }); - let ok = true; - for (const base of baseTypes) { - const properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (const prop of properties) { - const existing = seen.get(prop.escapedName); - if (!existing) { - seen.set(prop.escapedName, { prop, containingType: base }); - } else { - const isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - const typeName1 = typeToString(existing.containingType); - const typeName2 = typeToString(base); - let errorInfo = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, - symbolToString(prop), - typeName1, - typeName2 - ); - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(typeNode), typeNode, errorInfo)); - } - } - } - } - return ok; - } - function checkPropertyInitialization(node) { - if (!strictNullChecks || !strictPropertyInitialization || node.flags & 33554432 /* Ambient */) { - return; - } - const constructor = findConstructorDeclaration(node); - for (const member of node.members) { - if (getEffectiveModifierFlags(member) & 128 /* Ambient */) { - continue; - } - if (!isStatic(member) && isPropertyWithoutInitializer(member)) { - const propName = member.name; - if (isIdentifier(propName) || isPrivateIdentifier(propName) || isComputedPropertyName(propName)) { - const type = getTypeOfSymbol(getSymbolOfDeclaration(member)); - if (!(type.flags & 3 /* AnyOrUnknown */ || containsUndefinedType(type))) { - if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) { - error2(member.name, Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, declarationNameToString(propName)); - } - } - } - } - } - } - function isPropertyWithoutInitializer(node) { - return node.kind === 173 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; - } - function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) { - for (const staticBlock of staticBlocks) { - if (staticBlock.pos >= startPos && staticBlock.pos <= endPos) { - const reference = factory.createPropertyAccessExpression(factory.createThis(), propName); - setParent(reference.expression, reference); - setParent(reference, staticBlock); - reference.flowNode = staticBlock.returnFlowNode; - const flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType)); - if (!containsUndefinedType(flowType)) { - return true; - } - } - } - return false; - } - function isPropertyInitializedInConstructor(propName, propType, constructor) { - const reference = isComputedPropertyName(propName) ? factory.createElementAccessExpression(factory.createThis(), propName.expression) : factory.createPropertyAccessExpression(factory.createThis(), propName); - setParent(reference.expression, reference); - setParent(reference, constructor); - reference.flowNode = constructor.returnFlowNode; - const flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType)); - return !containsUndefinedType(flowType); - } - function checkInterfaceDeclaration(node) { - if (!checkGrammarModifiers(node)) checkGrammarInterfaceDeclaration(node); - if (!allowBlockDeclarations(node.parent)) { - grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, "interface"); - } - checkTypeParameters(node.typeParameters); - addLazyDiagnostic(() => { - checkTypeNameIsReserved(node.name, Diagnostics.Interface_name_cannot_be_0); - checkExportsOnMergedDeclarations(node); - const symbol = getSymbolOfDeclaration(node); - checkTypeParameterListsIdentical(symbol); - const firstInterfaceDecl = getDeclarationOfKind(symbol, 265 /* InterfaceDeclaration */); - if (node === firstInterfaceDecl) { - const type = getDeclaredTypeOfSymbol(symbol); - const typeWithThis = getTypeWithThisArgument(type); - if (checkInheritedPropertiesAreIdentical(type, node.name)) { - for (const baseType of getBaseTypes(type)) { - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType, type.thisType), node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1); - } - checkIndexConstraints(type, symbol); - } - } - checkObjectTypeForDuplicateDeclarations(node); - }); - forEach(getInterfaceBaseTypeNodes(node), (heritageElement) => { - if (!isEntityNameExpression(heritageElement.expression) || isOptionalChain(heritageElement.expression)) { - error2(heritageElement.expression, Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); - } - checkTypeReferenceNode(heritageElement); - }); - forEach(node.members, checkSourceElement); - addLazyDiagnostic(() => { - checkTypeForDuplicateIndexSignatures(node); - registerForUnusedIdentifiersCheck(node); - }); - } - function checkTypeAliasDeclaration(node) { - checkGrammarModifiers(node); - checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); - if (!allowBlockDeclarations(node.parent)) { - grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, "type"); - } - checkExportsOnMergedDeclarations(node); - checkTypeParameters(node.typeParameters); - if (node.type.kind === 141 /* IntrinsicKeyword */) { - const typeParameterCount = length(node.typeParameters); - const valid = typeParameterCount === 0 ? node.name.escapedText === "BuiltinIteratorReturn" : typeParameterCount === 1 && intrinsicTypeKinds.has(node.name.escapedText); - if (!valid) { - error2(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); - } - } else { - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); - } - } - function computeEnumMemberValues(node) { - const nodeLinks2 = getNodeLinks(node); - if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) { - nodeLinks2.flags |= 1024 /* EnumValuesComputed */; - let autoValue = 0; - let previous; - for (const member of node.members) { - const result = computeEnumMemberValue(member, autoValue, previous); - getNodeLinks(member).enumMemberValue = result; - autoValue = typeof result.value === "number" ? result.value + 1 : void 0; - previous = member; - } - } - } - function computeEnumMemberValue(member, autoValue, previous) { - if (isComputedNonLiteralName(member.name)) { - error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); - } else if (isBigIntLiteral(member.name)) { - error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); - } else { - const text = getTextOfPropertyName(member.name); - if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) { - error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); - } - } - if (member.initializer) { - return computeConstantEnumMemberValue(member); - } - if (member.parent.flags & 33554432 /* Ambient */ && !isEnumConst(member.parent)) { - return evaluatorResult( - /*value*/ - void 0 - ); - } - if (autoValue === void 0) { - error2(member.name, Diagnostics.Enum_member_must_have_initializer); - return evaluatorResult( - /*value*/ - void 0 - ); - } - if (getIsolatedModules(compilerOptions) && (previous == null ? void 0 : previous.initializer)) { - const prevValue = getEnumMemberValue(previous); - if (!(typeof prevValue.value === "number" && !prevValue.resolvedOtherFiles)) { - error2( - member.name, - Diagnostics.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled - ); - } - } - return evaluatorResult(autoValue); - } - function computeConstantEnumMemberValue(member) { - const isConstEnum = isEnumConst(member.parent); - const initializer = member.initializer; - const result = evaluate(initializer, member); - if (result.value !== void 0) { - if (isConstEnum && typeof result.value === "number" && !isFinite(result.value)) { - error2( - initializer, - isNaN(result.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 (getIsolatedModules(compilerOptions) && typeof result.value === "string" && !result.isSyntacticallyString) { - error2( - initializer, - Diagnostics._0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled, - `${idText(member.parent.name)}.${getTextOfPropertyName(member.name)}` - ); - } - } else if (isConstEnum) { - 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); - } - return result; - } - function evaluateEntityNameExpression(expr, location) { - const symbol = resolveEntityName( - expr, - 111551 /* Value */, - /*ignoreErrors*/ - true - ); - if (!symbol) return evaluatorResult( - /*value*/ - void 0 - ); - if (expr.kind === 80 /* Identifier */) { - const identifier = expr; - if (isInfinityOrNaNString(identifier.escapedText) && symbol === getGlobalSymbol( - identifier.escapedText, - 111551 /* Value */, - /*diagnostic*/ - void 0 - )) { - return evaluatorResult( - +identifier.escapedText, - /*isSyntacticallyString*/ - false - ); - } - } - if (symbol.flags & 8 /* EnumMember */) { - return location ? evaluateEnumMember(expr, symbol, location) : getEnumMemberValue(symbol.valueDeclaration); - } - if (isConstantVariable(symbol)) { - const declaration = symbol.valueDeclaration; - if (declaration && isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && (!location || declaration !== location && isBlockScopedNameDeclaredBeforeUse(declaration, location))) { - const result = evaluate(declaration.initializer, declaration); - if (location && getSourceFileOfNode(location) !== getSourceFileOfNode(declaration)) { - return evaluatorResult( - result.value, - /*isSyntacticallyString*/ - false, - /*resolvedOtherFiles*/ - true, - /*hasExternalReferences*/ - true - ); - } - return evaluatorResult( - result.value, - result.isSyntacticallyString, - result.resolvedOtherFiles, - /*hasExternalReferences*/ - true - ); - } - } - return evaluatorResult( - /*value*/ - void 0 - ); - } - function evaluateElementAccessExpression(expr, location) { - const root = expr.expression; - if (isEntityNameExpression(root) && isStringLiteralLike(expr.argumentExpression)) { - const rootSymbol = resolveEntityName( - root, - 111551 /* Value */, - /*ignoreErrors*/ - true - ); - if (rootSymbol && rootSymbol.flags & 384 /* Enum */) { - const name = escapeLeadingUnderscores(expr.argumentExpression.text); - const member = rootSymbol.exports.get(name); - if (member) { - Debug.assert(getSourceFileOfNode(member.valueDeclaration) === getSourceFileOfNode(rootSymbol.valueDeclaration)); - return location ? evaluateEnumMember(expr, member, location) : getEnumMemberValue(member.valueDeclaration); - } - } - } - return evaluatorResult( - /*value*/ - void 0 - ); - } - function evaluateEnumMember(expr, symbol, location) { - const declaration = symbol.valueDeclaration; - if (!declaration || declaration === location) { - error2(expr, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(symbol)); - return evaluatorResult( - /*value*/ - void 0 - ); - } - if (!isBlockScopedNameDeclaredBeforeUse(declaration, location)) { - error2(expr, Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums); - return evaluatorResult( - /*value*/ - 0 - ); - } - const value = getEnumMemberValue(declaration); - if (location.parent !== declaration.parent) { - return evaluatorResult( - value.value, - value.isSyntacticallyString, - value.resolvedOtherFiles, - /*hasExternalReferences*/ - true - ); - } - return value; - } - function checkEnumDeclaration(node) { - addLazyDiagnostic(() => checkEnumDeclarationWorker(node)); - } - function checkEnumDeclarationWorker(node) { - checkGrammarModifiers(node); - checkCollisionsForDeclarationName(node, node.name); - checkExportsOnMergedDeclarations(node); - node.members.forEach(checkSourceElement); - if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) { - error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); - } - computeEnumMemberValues(node); - const enumSymbol = getSymbolOfDeclaration(node); - const firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); - if (node === firstDeclaration) { - if (enumSymbol.declarations && enumSymbol.declarations.length > 1) { - const enumIsConst = isEnumConst(node); - forEach(enumSymbol.declarations, (decl) => { - if (isEnumDeclaration(decl) && isEnumConst(decl) !== enumIsConst) { - error2(getNameOfDeclaration(decl), Diagnostics.Enum_declarations_must_all_be_const_or_non_const); - } - }); - } - let seenEnumMissingInitialInitializer = false; - forEach(enumSymbol.declarations, (declaration) => { - if (declaration.kind !== 267 /* EnumDeclaration */) { - return false; - } - const enumDeclaration = declaration; - if (!enumDeclaration.members.length) { - return false; - } - const firstEnumMember = enumDeclaration.members[0]; - if (!firstEnumMember.initializer) { - if (seenEnumMissingInitialInitializer) { - 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; - } - } - }); - } - } - function checkEnumMember(node) { - if (isPrivateIdentifier(node.name)) { - error2(node, Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier); - } - if (node.initializer) { - checkExpression(node.initializer); - } - } - function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { - const declarations = symbol.declarations; - if (declarations) { - for (const declaration of declarations) { - if ((declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 263 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 33554432 /* Ambient */)) { - return declaration; - } - } - } - return void 0; - } - function inSameLexicalScope(node1, node2) { - const container1 = getEnclosingBlockScopeContainer(node1); - const container2 = getEnclosingBlockScopeContainer(node2); - if (isGlobalSourceFile(container1)) { - return isGlobalSourceFile(container2); - } else if (isGlobalSourceFile(container2)) { - return false; - } else { - return container1 === container2; - } - } - function checkModuleDeclaration(node) { - if (node.body) { - checkSourceElement(node.body); - if (!isGlobalScopeAugmentation(node)) { - registerForUnusedIdentifiersCheck(node); - } - } - addLazyDiagnostic(checkModuleDeclarationDiagnostics); - function checkModuleDeclarationDiagnostics() { - var _a, _b; - const isGlobalAugmentation = isGlobalScopeAugmentation(node); - const inAmbientContext = node.flags & 33554432 /* Ambient */; - if (isGlobalAugmentation && !inAmbientContext) { - 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; - if (checkGrammarModuleElementContext(node, contextErrorMessage)) { - return; - } - if (!checkGrammarModifiers(node)) { - if (!inAmbientContext && node.name.kind === 11 /* StringLiteral */) { - grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - if (isIdentifier(node.name)) { - checkCollisionsForDeclarationName(node, node.name); - if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) { - const sourceFile = getSourceFileOfNode(node); - const pos = getNonModifierTokenPosOfNode(node); - const span = getSpanOfTokenAtPosition(sourceFile, pos); - suggestionDiagnostics.add( - createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead) - ); - } - } - checkExportsOnMergedDeclarations(node); - const symbol = getSymbolOfDeclaration(node); - if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { - if (compilerOptions.erasableSyntaxOnly) { - error2(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); - } - if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { - 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)) { - 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) { - 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, 264 /* ClassDeclaration */); - if (mergedClass && inSameLexicalScope(node, mergedClass)) { - getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; - } - } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */ && host.getEmitModuleFormatOfFile(node.parent) === 1 /* CommonJS */) { - const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 95 /* ExportKeyword */); - if (exportModifier) { - error2(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); - } - } - } - if (isAmbientExternalModule) { - if (isExternalModuleAugmentation(node)) { - const checkBody = isGlobalAugmentation || getSymbolOfDeclaration(node).flags & 33554432 /* Transient */; - if (checkBody && node.body) { - for (const statement of node.body.statements) { - checkModuleAugmentationElement(statement, isGlobalAugmentation); - } - } - } else if (isGlobalSourceFile(node.parent)) { - if (isGlobalAugmentation) { - 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))) { - error2(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); - } - } else { - if (isGlobalAugmentation) { - error2(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); - } else { - error2(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); - } - } - } - } - } - function checkModuleAugmentationElement(node, isGlobalAugmentation) { - switch (node.kind) { - case 244 /* VariableStatement */: - for (const decl of node.declarationList.declarations) { - checkModuleAugmentationElement(decl, isGlobalAugmentation); - } - break; - case 278 /* ExportAssignment */: - case 279 /* ExportDeclaration */: - grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); - break; - case 272 /* ImportEqualsDeclaration */: - if (isInternalModuleImportEqualsDeclaration(node)) break; - // falls through - case 273 /* ImportDeclaration */: - grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); - break; - case 209 /* BindingElement */: - case 261 /* VariableDeclaration */: - const name = node.name; - if (isBindingPattern(name)) { - for (const el of name.elements) { - checkModuleAugmentationElement(el, isGlobalAugmentation); - } - break; - } - // falls through - case 264 /* ClassDeclaration */: - case 267 /* EnumDeclaration */: - case 263 /* FunctionDeclaration */: - case 265 /* InterfaceDeclaration */: - case 268 /* ModuleDeclaration */: - case 266 /* TypeAliasDeclaration */: - if (isGlobalAugmentation) { - return; - } - break; - } - } - function getFirstNonModuleExportsIdentifier(node) { - switch (node.kind) { - case 80 /* Identifier */: - return node; - case 167 /* QualifiedName */: - do { - node = node.left; - } while (node.kind !== 80 /* Identifier */); - return node; - case 212 /* PropertyAccessExpression */: - do { - if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) { - return node.name; - } - node = node.expression; - } while (node.kind !== 80 /* Identifier */); - return node; - } - } - function checkExternalImportOrExportDeclaration(node) { - const moduleName = getExternalModuleName(node); - if (!moduleName || nodeIsMissing(moduleName)) { - return false; - } - if (!isStringLiteral(moduleName)) { - error2(moduleName, Diagnostics.String_literal_expected); - return false; - } - const inAmbientExternalModule = node.parent.kind === 269 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - if (node.parent.kind !== 308 /* SourceFile */ && !inAmbientExternalModule) { - error2( - moduleName, - node.kind === 279 /* 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)) { - 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.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 attr of node.attributes.elements) { - if (!isStringLiteral(attr.value)) { - hasError = true; - error2(attr.value, diagnostic); - } - } - return !hasError; - } - return true; - } - function checkModuleExportName(name, allowStringLiteral = true) { - if (name === void 0 || name.kind !== 11 /* StringLiteral */) { - return; - } - if (!allowStringLiteral) { - grammarErrorOnNode(name, Diagnostics.Identifier_expected); - } else if (moduleKind === 5 /* ES2015 */ || moduleKind === 6 /* ES2020 */) { - grammarErrorOnNode(name, Diagnostics.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020); - } - } - function checkAliasSymbol(node) { - var _a, _b, _c, _d, _e; - let symbol = getSymbolOfDeclaration(node); - const target = resolveAlias(symbol); - if (target !== unknownSymbol) { - 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 !== 281 /* NamespaceExport */); - if (node.kind === 282 /* 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(moduleExportNameTextEscaped(node.propertyName || node.name)); - 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) - ) - ); - } - } - } else { - Debug.assert(node.kind !== 261 /* 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); - error2( - errorNode, - Diagnostics._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation, - importedIdentifier, - `import("${moduleSpecifier}").${importedIdentifier}` - ); - } - return; - } - 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 === 282 /* 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 !== 282 /* ExportSpecifier */) { - const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration); - if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) { - error2( - node, - Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, - symbolToString(symbol), - isolatedModulesLikeFlagName - ); - } - } - if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) { - const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); - const isType = !(targetFlags & 111551 /* Value */); - if (isType || typeOnlyAlias) { - switch (node.kind) { - case 274 /* ImportClause */: - case 277 /* ImportSpecifier */: - case 272 /* ImportEqualsDeclaration */: { - if (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 ? Diagnostics._0_is_a_type_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_verbatimModuleSyntax_is_enabled; - const name = moduleExportNameTextUnescaped(node.kind === 277 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); - addTypeOnlyDeclarationRelatedInfo( - error2(node, message, name), - isType ? void 0 : typeOnlyAlias, - name - ); - } - if (isType && node.kind === 272 /* 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 282 /* ExportSpecifier */: { - if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { - const name = moduleExportNameTextUnescaped(node.propertyName || node.name); - 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 !== 272 /* ImportEqualsDeclaration */ && !isInJSFile(node) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { - error2(node, getVerbatimModuleSyntaxErrorMessage(node)); - } else if (moduleKind === 200 /* Preserve */ && node.kind !== 272 /* ImportEqualsDeclaration */ && node.kind !== 261 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { - error2(node, Diagnostics.ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve); - } - if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) { - const constEnumDeclaration = target.valueDeclaration; - const redirect = (_e = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _e.resolvedRef; - if (constEnumDeclaration.flags & 33554432 /* Ambient */ && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) { - error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); - } - } - } - if (isImportSpecifier(node)) { - const targetSymbol = resolveAliasWithDeprecationCheck(symbol, node); - if (isDeprecatedSymbol(targetSymbol) && targetSymbol.declarations) { - addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName); - } - } - } - } - function resolveAliasWithDeprecationCheck(symbol, location) { - if (!(symbol.flags & 2097152 /* Alias */) || isDeprecatedSymbol(symbol) || !getDeclarationOfAliasSymbol(symbol)) { - return symbol; - } - const targetSymbol = resolveAlias(symbol); - if (targetSymbol === unknownSymbol) return targetSymbol; - while (symbol.flags & 2097152 /* Alias */) { - const target = getImmediateAliasedSymbol(symbol); - if (target) { - if (target === targetSymbol) break; - if (target.declarations && length(target.declarations)) { - if (isDeprecatedSymbol(target)) { - addDeprecatedSuggestion(location, target.declarations, target.escapedName); - break; - } else { - if (symbol === targetSymbol) break; - symbol = target; - } - } - } else { - break; - } - } - return targetSymbol; - } - function checkImportBinding(node) { - checkCollisionsForDeclarationName(node, node.name); - checkAliasSymbol(node); - if (node.kind === 277 /* ImportSpecifier */) { - checkModuleExportName(node.propertyName); - if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) { - checkExternalEmitHelpers(node, 131072 /* ImportDefault */); - } - } - } - function checkImportAttributes(declaration) { - var _a; - const node = declaration.attributes; - if (node) { - const importAttributesType = getGlobalImportAttributesType( - /*reportErrors*/ - true - ); - if (importAttributesType !== emptyObjectType) { - checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType(importAttributesType, 32768 /* Undefined */), node); - } - const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration); - const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0); - const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */; - if (validForTypeAttributes && override) { - return; - } - if (!moduleSupportsImportAttributes(moduleKind)) { - return grammarErrorOnNode( - node, - isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve - ); - } - if (102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && !isImportAttributes2) { - return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert); - } - if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) { - return grammarErrorOnNode( - node, - isImportAttributes2 ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls - ); - } - const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly); - if (isTypeOnly) { - 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(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; - } - if (!checkGrammarModifiers(node) && node.modifiers) { - grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); - } - if (checkExternalImportOrExportDeclaration(node)) { - let resolvedModule; - const importClause = node.importClause; - if (importClause && !checkGrammarImportClause(importClause)) { - if (importClause.name) { - checkImportBinding(importClause); - } - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { - checkImportBinding(importClause.namedBindings); - if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && getESModuleInterop(compilerOptions)) { - checkExternalEmitHelpers(node, 65536 /* ImportStar */); - } - } else { - resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); - if (resolvedModule) { - forEach(importClause.namedBindings.elements, checkImportBinding); - } - } - } - if (!importClause.isTypeOnly && 101 /* Node18 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) { - error2(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]); - } - } else if (noUncheckedSideEffectImports && !importClause) { - void resolveExternalModuleName(node, node.moduleSpecifier); - } - } - checkImportAttributes(node); - } - function hasTypeJsonImportAttribute(node) { - return !!node.attributes && node.attributes.elements.some((attr) => { - var _a; - return getTextOfIdentifierOrLiteral(attr.name) === "type" && ((_a = tryCast(attr.value, isStringLiteralLike)) == null ? void 0 : _a.text) === "json"; - }); - } - 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)) { - return; - } - checkGrammarModifiers(node); - if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) { - error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); - } - if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { - checkImportBinding(node); - markLinkedReferences(node, 6 /* ExportImportEquals */); - if (node.moduleReference.kind !== 284 /* ExternalModuleReference */) { - const target = resolveAlias(getSymbolOfDeclaration(node)); - if (target !== unknownSymbol) { - const targetFlags = getSymbolFlags(target); - if (targetFlags & 111551 /* Value */) { - const moduleName = getFirstIdentifier(node.moduleReference); - if (!(resolveEntityName(moduleName, 111551 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) { - error2(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); - } - } - if (targetFlags & 788968 /* Type */) { - checkTypeNameIsReserved(node.name, Diagnostics.Import_name_cannot_be_0); - } - } - if (node.isTypeOnly) { - grammarErrorOnNode(node, Diagnostics.An_import_alias_cannot_use_import_type); - } - } else { - if (5 /* ES2015 */ <= moduleKind && moduleKind <= 99 /* ESNext */ && !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); - } - } - } - } - function checkExportDeclaration(node) { - if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { - return; - } - if (!checkGrammarModifiers(node) && hasSyntacticModifiers(node)) { - grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); - } - checkGrammarExportDeclaration(node); - if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { - if (node.exportClause && !isNamespaceExport(node.exportClause)) { - forEach(node.exportClause.elements, checkExportSpecifier); - const inAmbientExternalModule = node.parent.kind === 269 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 269 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 33554432 /* Ambient */; - if (node.parent.kind !== 308 /* 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)) { - error2(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); - } else if (node.exportClause) { - checkAliasSymbol(node.exportClause); - checkModuleExportName(node.exportClause.name); - } - if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) { - if (node.exportClause) { - if (getESModuleInterop(compilerOptions)) { - checkExternalEmitHelpers(node, 65536 /* ImportStar */); - } - } else { - checkExternalEmitHelpers(node, 32768 /* ExportStar */); - } - } - } - } - checkImportAttributes(node); - } - function checkGrammarExportDeclaration(node) { - var _a; - if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 280 /* NamedExports */) { - return checkGrammarNamedImportsOrExports(node.exportClause); - } - return false; - } - function checkGrammarModuleElementContext(node, errorMessage) { - const isInAppropriateContext = node.parent.kind === 308 /* SourceFile */ || node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 268 /* ModuleDeclaration */; - if (!isInAppropriateContext) { - grammarErrorOnFirstToken(node, errorMessage); - } - return !isInAppropriateContext; - } - function checkExportSpecifier(node) { - checkAliasSymbol(node); - const hasModuleSpecifier = node.parent.parent.moduleSpecifier !== void 0; - checkModuleExportName(node.propertyName, hasModuleSpecifier); - checkModuleExportName(node.name); - if (getEmitDeclarations(compilerOptions)) { - collectLinkedAliases( - node.propertyName || node.name, - /*setVisibility*/ - true - ); - } - if (!hasModuleSpecifier) { - const exportedName = node.propertyName || node.name; - if (exportedName.kind === 11 /* StringLiteral */) { - return; - } - const symbol = resolveName( - exportedName, - exportedName.escapedText, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || symbol.declarations && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { - error2(exportedName, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, idText(exportedName)); - } else { - markLinkedReferences(node, 7 /* ExportSpecifier */); - } - } else { - if (getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && moduleExportNameIsDefault(node.propertyName || node.name)) { - checkExternalEmitHelpers(node, 131072 /* ImportDefault */); - } - } - } - function checkExportAssignment(node) { - const illegalContextMessage = node.isExportEquals ? Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration : Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration; - if (checkGrammarModuleElementContext(node, illegalContextMessage)) { - return; - } - if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432 /* Ambient */)) { - error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); - } - const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 268 /* ModuleDeclaration */ && !isAmbientModule(container)) { - if (node.isExportEquals) { - error2(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); - } else { - error2(node, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); - } - return; - } - if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { - grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); - } - const typeAnnotationNode = getEffectiveTypeAnnotationNode(node); - if (typeAnnotationNode) { - checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); - } - const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */; - if (node.expression.kind === 80 /* Identifier */) { - const id = node.expression; - const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( - id, - -1 /* All */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - node - )); - if (sym) { - markLinkedReferences(node, 3 /* ExportAssignment */); - const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(sym, 111551 /* Value */); - if (getSymbolFlags(sym) & 111551 /* Value */) { - checkExpressionCached(id); - 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 & 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); - } - if (getEmitDeclarations(compilerOptions)) { - collectLinkedAliases( - id, - /*setVisibility*/ - true - ); - } - } else { - checkExpressionCached(node.expression); - } - if (isIllegalExportDefaultInCJS) { - error2(node, getVerbatimModuleSyntaxErrorMessage(node)); - } - checkExternalModuleExports(container); - 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 */ && moduleKind !== 200 /* Preserve */ && (node.flags & 33554432 /* Ambient */ && host.getImpliedNodeFormatForEmit(getSourceFileOfNode(node)) === 99 /* ESNext */ || !(node.flags & 33554432 /* Ambient */) && host.getImpliedNodeFormatForEmit(getSourceFileOfNode(node)) !== 1 /* CommonJS */)) { - grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead); - } else if (moduleKind === 4 /* System */ && !(node.flags & 33554432 /* Ambient */)) { - grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); - } - } - } - function hasExportedMembers(moduleSymbol) { - return forEachEntry(moduleSymbol.exports, (_, id) => id !== "export="); - } - function checkExternalModuleExports(node) { - const moduleSymbol = getSymbolOfDeclaration(node); - const links = getSymbolLinks(moduleSymbol); - if (!links.exportsChecked) { - const exportEqualsSymbol = moduleSymbol.exports.get("export="); - if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { - const declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; - if (declaration && !isTopLevelInExternalModuleAugmentation(declaration) && !isInJSFile(declaration)) { - error2(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } - } - const exports2 = getExportsOfModule(moduleSymbol); - if (exports2) { - exports2.forEach(({ declarations, flags }, id) => { - if (id === "__export") { - return; - } - if (flags & (1920 /* Namespace */ | 384 /* Enum */)) { - return; - } - const exportedDeclarationsCount = countWhere(declarations, and(isNotOverloadAndNotAccessor, not(isInterfaceDeclaration))); - if (flags & 524288 /* TypeAlias */ && exportedDeclarationsCount <= 2) { - return; - } - if (exportedDeclarationsCount > 1) { - if (!isDuplicatedCommonJSExport(declarations)) { - for (const declaration of declarations) { - if (isNotOverload(declaration)) { - diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Cannot_redeclare_exported_variable_0, unescapeLeadingUnderscores(id))); - } - } - } - } - }); - } - links.exportsChecked = true; - } - } - function isDuplicatedCommonJSExport(declarations) { - return declarations && declarations.length > 1 && declarations.every((d) => isInJSFile(d) && isAccessExpression(d) && (isExportsIdentifier(d.expression) || isModuleExportsAccessExpression(d.expression))); - } - function checkSourceElement(node) { - if (node) { - const saveCurrentNode = currentNode; - currentNode = node; - instantiationCount = 0; - checkSourceElementWorker(node); - currentNode = saveCurrentNode; - } - } - function checkSourceElementWorker(node) { - if (getNodeCheckFlags(node) & 8388608 /* PartiallyTypeChecked */) { - return; - } - if (canHaveJSDoc(node)) { - forEach(node.jsDoc, ({ comment, tags }) => { - checkJSDocCommentWorker(comment); - forEach(tags, (tag) => { - checkJSDocCommentWorker(tag.comment); - if (isInJSFile(node)) { - checkSourceElement(tag); - } - }); - }); - } - const kind = node.kind; - if (cancellationToken) { - switch (kind) { - case 268 /* ModuleDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 263 /* FunctionDeclaration */: - cancellationToken.throwIfCancellationRequested(); - } - } - if (kind >= 244 /* FirstStatement */ && kind <= 260 /* LastStatement */ && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { - errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected); - } - switch (kind) { - case 169 /* TypeParameter */: - return checkTypeParameter(node); - case 170 /* Parameter */: - return checkParameter(node); - case 173 /* PropertyDeclaration */: - return checkPropertyDeclaration(node); - case 172 /* PropertySignature */: - return checkPropertySignature(node); - case 186 /* ConstructorType */: - case 185 /* FunctionType */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 182 /* IndexSignature */: - return checkSignatureDeclaration(node); - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - return checkMethodDeclaration(node); - case 176 /* ClassStaticBlockDeclaration */: - return checkClassStaticBlockDeclaration(node); - case 177 /* Constructor */: - return checkConstructorDeclaration(node); - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return checkAccessorDeclaration(node); - case 184 /* TypeReference */: - return checkTypeReferenceNode(node); - case 183 /* TypePredicate */: - return checkTypePredicate(node); - case 187 /* TypeQuery */: - return checkTypeQuery(node); - case 188 /* TypeLiteral */: - return checkTypeLiteral(node); - case 189 /* ArrayType */: - return checkArrayType(node); - case 190 /* TupleType */: - return checkTupleType(node); - case 193 /* UnionType */: - case 194 /* IntersectionType */: - return checkUnionOrIntersectionType(node); - case 197 /* ParenthesizedType */: - case 191 /* OptionalType */: - case 192 /* RestType */: - return checkSourceElement(node.type); - case 198 /* ThisType */: - return checkThisType(node); - case 199 /* TypeOperator */: - return checkTypeOperator(node); - case 195 /* ConditionalType */: - return checkConditionalType(node); - case 196 /* InferType */: - return checkInferType(node); - case 204 /* TemplateLiteralType */: - return checkTemplateLiteralType(node); - case 206 /* ImportType */: - return checkImportType(node); - case 203 /* NamedTupleMember */: - return checkNamedTupleMember(node); - case 329 /* JSDocAugmentsTag */: - return checkJSDocAugmentsTag(node); - case 330 /* JSDocImplementsTag */: - return checkJSDocImplementsTag(node); - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 341 /* JSDocEnumTag */: - return checkJSDocTypeAliasTag(node); - case 346 /* JSDocTemplateTag */: - return checkJSDocTemplateTag(node); - case 345 /* JSDocTypeTag */: - return checkJSDocTypeTag(node); - case 325 /* JSDocLink */: - case 326 /* JSDocLinkCode */: - case 327 /* JSDocLinkPlain */: - return checkJSDocLinkLikeTag(node); - case 342 /* JSDocParameterTag */: - return checkJSDocParameterTag(node); - case 349 /* JSDocPropertyTag */: - return checkJSDocPropertyTag(node); - case 318 /* JSDocFunctionType */: - checkJSDocFunctionType(node); - // falls through - case 316 /* JSDocNonNullableType */: - case 315 /* JSDocNullableType */: - case 313 /* JSDocAllType */: - case 314 /* JSDocUnknownType */: - case 323 /* JSDocTypeLiteral */: - checkJSDocTypeIsInJsFile(node); - forEachChild(node, checkSourceElement); - return; - case 319 /* JSDocVariadicType */: - checkJSDocVariadicType(node); - return; - case 310 /* JSDocTypeExpression */: - return checkSourceElement(node.type); - case 334 /* JSDocPublicTag */: - case 336 /* JSDocProtectedTag */: - case 335 /* JSDocPrivateTag */: - return checkJSDocAccessibilityModifiers(node); - case 351 /* JSDocSatisfiesTag */: - return checkJSDocSatisfiesTag(node); - case 344 /* JSDocThisTag */: - return checkJSDocThisTag(node); - case 352 /* JSDocImportTag */: - return checkJSDocImportTag(node); - case 200 /* IndexedAccessType */: - return checkIndexedAccessType(node); - case 201 /* MappedType */: - return checkMappedType(node); - case 263 /* FunctionDeclaration */: - return checkFunctionDeclaration(node); - case 242 /* Block */: - case 269 /* ModuleBlock */: - return checkBlock(node); - case 244 /* VariableStatement */: - return checkVariableStatement(node); - case 245 /* ExpressionStatement */: - return checkExpressionStatement(node); - case 246 /* IfStatement */: - return checkIfStatement(node); - case 247 /* DoStatement */: - return checkDoStatement(node); - case 248 /* WhileStatement */: - return checkWhileStatement(node); - case 249 /* ForStatement */: - return checkForStatement(node); - case 250 /* ForInStatement */: - return checkForInStatement(node); - case 251 /* ForOfStatement */: - return checkForOfStatement(node); - case 252 /* ContinueStatement */: - case 253 /* BreakStatement */: - return checkBreakOrContinueStatement(node); - case 254 /* ReturnStatement */: - return checkReturnStatement(node); - case 255 /* WithStatement */: - return checkWithStatement(node); - case 256 /* SwitchStatement */: - return checkSwitchStatement(node); - case 257 /* LabeledStatement */: - return checkLabeledStatement(node); - case 258 /* ThrowStatement */: - return checkThrowStatement(node); - case 259 /* TryStatement */: - return checkTryStatement(node); - case 261 /* VariableDeclaration */: - return checkVariableDeclaration(node); - case 209 /* BindingElement */: - return checkBindingElement(node); - case 264 /* ClassDeclaration */: - return checkClassDeclaration(node); - case 265 /* InterfaceDeclaration */: - return checkInterfaceDeclaration(node); - case 266 /* TypeAliasDeclaration */: - return checkTypeAliasDeclaration(node); - case 267 /* EnumDeclaration */: - return checkEnumDeclaration(node); - case 307 /* EnumMember */: - return checkEnumMember(node); - case 268 /* ModuleDeclaration */: - return checkModuleDeclaration(node); - case 273 /* ImportDeclaration */: - return checkImportDeclaration(node); - case 272 /* ImportEqualsDeclaration */: - return checkImportEqualsDeclaration(node); - case 279 /* ExportDeclaration */: - return checkExportDeclaration(node); - case 278 /* ExportAssignment */: - return checkExportAssignment(node); - case 243 /* EmptyStatement */: - case 260 /* DebuggerStatement */: - checkGrammarStatementInAmbientContext(node); - return; - case 283 /* MissingDeclaration */: - return checkMissingDeclaration(node); - } - } - function checkJSDocCommentWorker(node) { - if (isArray(node)) { - forEach(node, (tag) => { - if (isJSDocLinkLike(tag)) { - checkSourceElement(tag); - } - }); - } - } - function checkJSDocTypeIsInJsFile(node) { - if (!isInJSFile(node)) { - if (isJSDocNonNullableType(node) || isJSDocNullableType(node)) { - const token = tokenToString(isJSDocNonNullableType(node) ? 54 /* ExclamationToken */ : 58 /* QuestionToken */); - 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 - ) - ); - } else { - grammarErrorOnNode(node, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); - } - } - } - function checkJSDocVariadicType(node) { - checkJSDocTypeIsInJsFile(node); - checkSourceElement(node.type); - const { parent: parent2 } = node; - if (isParameter(parent2) && isJSDocFunctionType(parent2.parent)) { - if (last(parent2.parent.parameters) !== parent2) { - error2(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - } - return; - } - if (!isJSDocTypeExpression(parent2)) { - error2(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); - } - const paramTag = node.parent.parent; - if (!isJSDocParameterTag(paramTag)) { - error2(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); - return; - } - const param = getParameterSymbolFromJSDoc(paramTag); - if (!param) { - return; - } - const host2 = getHostSignatureFromJSDoc(paramTag); - if (!host2 || last(host2.parameters).symbol !== param) { - error2(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - } - } - function getTypeFromJSDocVariadicType(node) { - const type = getTypeFromTypeNode(node.type); - const { parent: parent2 } = node; - const paramTag = node.parent.parent; - if (isJSDocTypeExpression(node.parent) && isJSDocParameterTag(paramTag)) { - const host2 = getHostSignatureFromJSDoc(paramTag); - const isCallbackTag = isJSDocCallbackTag(paramTag.parent.parent); - if (host2 || isCallbackTag) { - const lastParamDeclaration = isCallbackTag ? lastOrUndefined(paramTag.parent.parent.typeExpression.parameters) : lastOrUndefined(host2.parameters); - const symbol = getParameterSymbolFromJSDoc(paramTag); - if (!lastParamDeclaration || symbol && lastParamDeclaration.symbol === symbol && isRestParameter(lastParamDeclaration)) { - return createArrayType(type); - } - } - } - if (isParameter(parent2) && isJSDocFunctionType(parent2.parent)) { - return createArrayType(type); - } - return addOptionality(type); - } - function checkNodeDeferred(node) { - const enclosingFile = getSourceFileOfNode(node); - const links = getNodeLinks(enclosingFile); - if (!(links.flags & 1 /* TypeChecked */)) { - links.deferredNodes || (links.deferredNodes = /* @__PURE__ */ new Set()); - links.deferredNodes.add(node); - } else { - Debug.assert(!links.deferredNodes, "A type-checked file should have no deferred nodes."); - } - } - function checkDeferredNodes(context) { - const links = getNodeLinks(context); - if (links.deferredNodes) { - links.deferredNodes.forEach(checkDeferredNode); - } - links.deferredNodes = void 0; - } - function checkDeferredNode(node) { - var _a, _b; - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); - const saveCurrentNode = currentNode; - currentNode = node; - instantiationCount = 0; - switch (node.kind) { - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 216 /* TaggedTemplateExpression */: - case 171 /* Decorator */: - case 287 /* JsxOpeningElement */: - resolveUntypedCall(node); - break; - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - checkFunctionExpressionOrObjectLiteralMethodDeferred(node); - break; - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - checkAccessorDeclaration(node); - break; - case 232 /* ClassExpression */: - checkClassExpressionDeferred(node); - break; - case 169 /* TypeParameter */: - checkTypeParameterDeferred(node); - break; - case 286 /* JsxSelfClosingElement */: - checkJsxSelfClosingElementDeferred(node); - break; - case 285 /* JsxElement */: - checkJsxElementDeferred(node); - break; - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - case 218 /* ParenthesizedExpression */: - checkAssertionDeferred(node); - break; - case 223 /* VoidExpression */: - checkExpression(node.expression); - break; - case 227 /* BinaryExpression */: - if (isInstanceOfExpression(node)) { - resolveUntypedCall(node); - } - break; - } - currentNode = saveCurrentNode; - (_b = tracing) == null ? void 0 : _b.pop(); - } - function checkSourceFile(node, nodesToCheck) { - var _a, _b; - (_a = tracing) == null ? void 0 : _a.push( - tracing.Phase.Check, - nodesToCheck ? "checkSourceFileNodes" : "checkSourceFile", - { path: node.path }, - /*separateBeginAndEnd*/ - true - ); - const beforeMark = nodesToCheck ? "beforeCheckNodes" : "beforeCheck"; - const afterMark = nodesToCheck ? "afterCheckNodes" : "afterCheck"; - mark(beforeMark); - nodesToCheck ? checkSourceFileNodesWorker(node, nodesToCheck) : checkSourceFileWorker(node); - mark(afterMark); - measure("Check", beforeMark, afterMark); - (_b = tracing) == null ? void 0 : _b.pop(); - } - function unusedIsError(kind, isAmbient) { - if (isAmbient) { - return false; - } - switch (kind) { - case 0 /* Local */: - return !!compilerOptions.noUnusedLocals; - case 1 /* Parameter */: - return !!compilerOptions.noUnusedParameters; - default: - return Debug.assertNever(kind); - } - } - function getPotentiallyUnusedIdentifiers(sourceFile) { - return allPotentiallyUnusedIdentifiers.get(sourceFile.path) || emptyArray; - } - function checkSourceFileWorker(node) { - const links = getNodeLinks(node); - if (!(links.flags & 1 /* TypeChecked */)) { - if (skipTypeChecking(node, compilerOptions, host)) { - return; - } - checkGrammarSourceFile(node); - clear(potentialThisCollisions); - clear(potentialNewTargetCollisions); - clear(potentialWeakMapSetCollisions); - clear(potentialReflectCollisions); - clear(potentialUnusedRenamedBindingElementsInTypes); - if (links.flags & 8388608 /* PartiallyTypeChecked */) { - potentialThisCollisions = links.potentialThisCollisions; - potentialNewTargetCollisions = links.potentialNewTargetCollisions; - potentialWeakMapSetCollisions = links.potentialWeakMapSetCollisions; - potentialReflectCollisions = links.potentialReflectCollisions; - potentialUnusedRenamedBindingElementsInTypes = links.potentialUnusedRenamedBindingElementsInTypes; - } - forEach(node.statements, checkSourceElement); - checkSourceElement(node.endOfFileToken); - checkDeferredNodes(node); - if (isExternalOrCommonJsModule(node)) { - registerForUnusedIdentifiersCheck(node); - } - addLazyDiagnostic(() => { - if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) { - checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), (containingNode, kind, diag2) => { - if (!containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 33554432 /* Ambient */))) { - diagnostics.add(diag2); - } - }); - } - if (!node.isDeclarationFile) { - checkPotentialUncheckedRenamedBindingElementsInTypes(); - } - }); - if (isExternalOrCommonJsModule(node)) { - checkExternalModuleExports(node); - } - if (potentialThisCollisions.length) { - forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); - clear(potentialThisCollisions); - } - if (potentialNewTargetCollisions.length) { - forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); - clear(potentialNewTargetCollisions); - } - if (potentialWeakMapSetCollisions.length) { - forEach(potentialWeakMapSetCollisions, checkWeakMapSetCollision); - clear(potentialWeakMapSetCollisions); - } - if (potentialReflectCollisions.length) { - forEach(potentialReflectCollisions, checkReflectCollision); - clear(potentialReflectCollisions); - } - links.flags |= 1 /* TypeChecked */; - } - } - function checkSourceFileNodesWorker(file, nodes) { - const links = getNodeLinks(file); - if (!(links.flags & 1 /* TypeChecked */)) { - if (skipTypeChecking(file, compilerOptions, host)) { - return; - } - checkGrammarSourceFile(file); - clear(potentialThisCollisions); - clear(potentialNewTargetCollisions); - clear(potentialWeakMapSetCollisions); - clear(potentialReflectCollisions); - clear(potentialUnusedRenamedBindingElementsInTypes); - forEach(nodes, checkSourceElement); - checkDeferredNodes(file); - (links.potentialThisCollisions || (links.potentialThisCollisions = [])).push(...potentialThisCollisions); - (links.potentialNewTargetCollisions || (links.potentialNewTargetCollisions = [])).push(...potentialNewTargetCollisions); - (links.potentialWeakMapSetCollisions || (links.potentialWeakMapSetCollisions = [])).push(...potentialWeakMapSetCollisions); - (links.potentialReflectCollisions || (links.potentialReflectCollisions = [])).push(...potentialReflectCollisions); - (links.potentialUnusedRenamedBindingElementsInTypes || (links.potentialUnusedRenamedBindingElementsInTypes = [])).push( - ...potentialUnusedRenamedBindingElementsInTypes - ); - links.flags |= 8388608 /* PartiallyTypeChecked */; - for (const node of nodes) { - const nodeLinks2 = getNodeLinks(node); - nodeLinks2.flags |= 8388608 /* PartiallyTypeChecked */; - } - } - } - function getDiagnostics2(sourceFile, ct, nodesToCheck) { - try { - cancellationToken = ct; - return getDiagnosticsWorker(sourceFile, nodesToCheck); - } finally { - cancellationToken = void 0; - } - } - function ensurePendingDiagnosticWorkComplete() { - for (const cb of deferredDiagnosticsCallbacks) { - cb(); - } - deferredDiagnosticsCallbacks = []; - } - function checkSourceFileWithEagerDiagnostics(sourceFile, nodesToCheck) { - ensurePendingDiagnosticWorkComplete(); - const oldAddLazyDiagnostics = addLazyDiagnostic; - addLazyDiagnostic = (cb) => cb(); - checkSourceFile(sourceFile, nodesToCheck); - addLazyDiagnostic = oldAddLazyDiagnostics; - } - function getDiagnosticsWorker(sourceFile, nodesToCheck) { - if (sourceFile) { - ensurePendingDiagnosticWorkComplete(); - const previousGlobalDiagnostics = diagnostics.getGlobalDiagnostics(); - const previousGlobalDiagnosticsSize = previousGlobalDiagnostics.length; - checkSourceFileWithEagerDiagnostics(sourceFile, nodesToCheck); - const semanticDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); - if (nodesToCheck) { - return semanticDiagnostics; - } - const currentGlobalDiagnostics = diagnostics.getGlobalDiagnostics(); - if (currentGlobalDiagnostics !== previousGlobalDiagnostics) { - const deferredGlobalDiagnostics = relativeComplement(previousGlobalDiagnostics, currentGlobalDiagnostics, compareDiagnostics); - return concatenate(deferredGlobalDiagnostics, semanticDiagnostics); - } else if (previousGlobalDiagnosticsSize === 0 && currentGlobalDiagnostics.length > 0) { - return concatenate(currentGlobalDiagnostics, semanticDiagnostics); - } - return semanticDiagnostics; - } - forEach(host.getSourceFiles(), (file) => checkSourceFileWithEagerDiagnostics(file)); - return diagnostics.getDiagnostics(); - } - function getGlobalDiagnostics() { - ensurePendingDiagnosticWorkComplete(); - return diagnostics.getGlobalDiagnostics(); - } - function getSymbolsInScope(location, meaning) { - if (location.flags & 67108864 /* InWithStatement */) { - return []; - } - const symbols = createSymbolTable(); - let isStaticSymbol = false; - populateSymbols(); - symbols.delete("this" /* This */); - return symbolsToArray(symbols); - function populateSymbols() { - while (location) { - if (canHaveLocals(location) && location.locals && !isGlobalSourceFile(location)) { - copySymbols(location.locals, meaning); - } - switch (location.kind) { - case 308 /* SourceFile */: - if (!isExternalModule(location)) break; - // falls through - case 268 /* ModuleDeclaration */: - copyLocallyVisibleExportSymbols(getSymbolOfDeclaration(location).exports, meaning & 2623475 /* ModuleMember */); - break; - case 267 /* EnumDeclaration */: - copySymbols(getSymbolOfDeclaration(location).exports, meaning & 8 /* EnumMember */); - break; - case 232 /* ClassExpression */: - const className = location.name; - if (className) { - copySymbol(location.symbol, meaning); - } - // this fall-through is necessary because we would like to handle - // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. - // falls through - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - if (!isStaticSymbol) { - copySymbols(getMembersOfSymbol(getSymbolOfDeclaration(location)), meaning & 788968 /* Type */); - } - break; - case 219 /* FunctionExpression */: - const funcName = location.name; - if (funcName) { - copySymbol(location.symbol, meaning); - } - break; - } - if (introducesArgumentsExoticObject(location)) { - copySymbol(argumentsSymbol, meaning); - } - isStaticSymbol = isStatic(location); - location = location.parent; - } - copySymbols(globals, meaning); - } - function copySymbol(symbol, meaning2) { - if (getCombinedLocalAndExportSymbolFlags(symbol) & meaning2) { - const id = symbol.escapedName; - if (!symbols.has(id)) { - symbols.set(id, symbol); - } - } - } - function copySymbols(source, meaning2) { - if (meaning2) { - source.forEach((symbol) => { - copySymbol(symbol, meaning2); - }); - } - } - function copyLocallyVisibleExportSymbols(source, meaning2) { - if (meaning2) { - source.forEach((symbol) => { - if (!getDeclarationOfKind(symbol, 282 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 281 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) { - copySymbol(symbol, meaning2); - } - }); - } - } - } - function isTypeDeclarationName(name) { - return name.kind === 80 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name; - } - function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 167 /* QualifiedName */) { - node = node.parent; - } - return node.parent.kind === 184 /* TypeReference */; - } - function isInNameOfExpressionWithTypeArguments(node) { - while (node.parent.kind === 212 /* PropertyAccessExpression */) { - node = node.parent; - } - return node.parent.kind === 234 /* ExpressionWithTypeArguments */; - } - function forEachEnclosingClass(node, callback) { - let result; - let containingClass = getContainingClass(node); - while (containingClass) { - if (result = callback(containingClass)) break; - containingClass = getContainingClass(containingClass); - } - return result; - } - function isNodeUsedDuringClassInitialization(node) { - return !!findAncestor(node, (element) => { - if (isConstructorDeclaration(element) && nodeIsPresent(element.body) || isPropertyDeclaration(element)) { - return true; - } else if (isClassLike(element) || isFunctionLikeDeclaration(element)) { - return "quit"; - } - return false; - }); - } - function isNodeWithinClass(node, classDeclaration) { - return !!forEachEnclosingClass(node, (n) => n === classDeclaration); - } - function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 167 /* QualifiedName */) { - nodeOnRightSide = nodeOnRightSide.parent; - } - if (nodeOnRightSide.parent.kind === 272 /* ImportEqualsDeclaration */) { - return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0; - } - if (nodeOnRightSide.parent.kind === 278 /* ExportAssignment */) { - return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0; - } - return void 0; - } - function isInRightSideOfImportOrExportAssignment(node) { - return getLeftSideOfImportEqualsOrExportAssignment(node) !== void 0; - } - function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { - const specialPropertyAssignmentKind = getAssignmentDeclarationKind(entityName.parent.parent); - switch (specialPropertyAssignmentKind) { - case 1 /* ExportsProperty */: - case 3 /* PrototypeProperty */: - return getSymbolOfNode(entityName.parent); - case 5 /* Property */: - if (isPropertyAccessExpression(entityName.parent) && getLeftmostAccessExpression(entityName.parent) === entityName) { - return void 0; - } - // falls through - case 4 /* ThisProperty */: - case 2 /* ModuleExports */: - return getSymbolOfDeclaration(entityName.parent.parent); - } - } - function isImportTypeQualifierPart(node) { - let parent2 = node.parent; - while (isQualifiedName(parent2)) { - node = parent2; - parent2 = parent2.parent; - } - if (parent2 && parent2.kind === 206 /* ImportType */ && parent2.qualifier === node) { - return parent2; - } - return void 0; - } - function isThisPropertyAndThisTyped(node) { - if (node.expression.kind === 110 /* ThisKeyword */) { - const container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (isFunctionLike(container)) { - const containingLiteral = getContainingObjectLiteral(container); - if (containingLiteral) { - const contextualType = getApparentTypeOfContextualType( - containingLiteral, - /*contextFlags*/ - void 0 - ); - const type = getThisTypeOfObjectLiteralFromContextualType(containingLiteral, contextualType); - return type && !isTypeAny(type); - } - } - } - } - function getSymbolOfNameOrPropertyAccessExpression(name) { - if (isDeclarationName(name)) { - return getSymbolOfNode(name.parent); - } - if (isInJSFile(name) && name.parent.kind === 212 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { - if (!isPrivateIdentifier(name) && !isJSDocMemberName(name) && !isThisPropertyAndThisTyped(name.parent)) { - const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name); - if (specialPropertyAssignmentSymbol) { - return specialPropertyAssignmentSymbol; - } - } - } - if (name.parent.kind === 278 /* ExportAssignment */ && isEntityNameExpression(name)) { - const success = resolveEntityName( - name, - /*all meanings*/ - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, - /*ignoreErrors*/ - true - ); - if (success && success !== unknownSymbol) { - return success; - } - } else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) { - const importEqualsDeclaration = getAncestor(name, 272 /* ImportEqualsDeclaration */); - Debug.assert(importEqualsDeclaration !== void 0); - return getSymbolOfPartOfRightHandSideOfImportEquals( - name, - /*dontResolveAlias*/ - true - ); - } - if (isEntityName(name)) { - const possibleImportNode = isImportTypeQualifierPart(name); - if (possibleImportNode) { - getTypeFromTypeNode(possibleImportNode); - const sym = getNodeLinks(name).resolvedSymbol; - return sym === unknownSymbol ? void 0 : sym; - } - } - while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) { - name = name.parent; - } - if (isInNameOfExpressionWithTypeArguments(name)) { - let meaning = 0 /* None */; - if (name.parent.kind === 234 /* ExpressionWithTypeArguments */) { - meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; - if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { - meaning |= 111551 /* Value */; - } - } else { - meaning = 1920 /* Namespace */; - } - meaning |= 2097152 /* Alias */; - const entityNameSymbol = isEntityNameExpression(name) ? resolveEntityName( - name, - meaning, - /*ignoreErrors*/ - true - ) : void 0; - if (entityNameSymbol) { - return entityNameSymbol; - } - } - if (name.parent.kind === 342 /* JSDocParameterTag */) { - return getParameterSymbolFromJSDoc(name.parent); - } - if (name.parent.kind === 169 /* TypeParameter */ && name.parent.parent.kind === 346 /* JSDocTemplateTag */) { - Debug.assert(!isInJSFile(name)); - const typeParameter = getTypeParameterFromJsDoc(name.parent); - return typeParameter && typeParameter.symbol; - } - if (isExpressionNode(name)) { - if (nodeIsMissing(name)) { - return void 0; - } - const isJSDoc2 = findAncestor(name, or(isJSDocLinkLike, isJSDocNameReference, isJSDocMemberName)); - const meaning = isJSDoc2 ? 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */ : 111551 /* Value */; - if (name.kind === 80 /* Identifier */) { - if (isJSXTagName(name) && isJsxIntrinsicTagName(name)) { - const symbol = getIntrinsicTagSymbol(name.parent); - return symbol === unknownSymbol ? void 0 : symbol; - } - const result = resolveEntityName( - name, - meaning, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - getHostSignatureFromJSDoc(name) - ); - if (!result && isJSDoc2) { - const container = findAncestor(name, or(isClassLike, isInterfaceDeclaration)); - if (container) { - return resolveJSDocMemberName( - name, - /*ignoreErrors*/ - true, - getSymbolOfDeclaration(container) - ); - } - } - if (result && isJSDoc2) { - const container = getJSDocHost(name); - if (container && isEnumMember(container) && container === result.valueDeclaration) { - return resolveEntityName( - name, - meaning, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - getSourceFileOfNode(container) - ) || result; - } - } - return result; - } else if (isPrivateIdentifier(name)) { - return getSymbolForPrivateIdentifierExpression(name); - } else if (name.kind === 212 /* PropertyAccessExpression */ || name.kind === 167 /* QualifiedName */) { - const links = getNodeLinks(name); - if (links.resolvedSymbol) { - return links.resolvedSymbol; - } - if (name.kind === 212 /* PropertyAccessExpression */) { - checkPropertyAccessExpression(name, 0 /* Normal */); - if (!links.resolvedSymbol) { - links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name)); - } - } else { - checkQualifiedName(name, 0 /* Normal */); - } - if (!links.resolvedSymbol && isJSDoc2 && isQualifiedName(name)) { - return resolveJSDocMemberName(name); - } - return links.resolvedSymbol; - } else if (isJSDocMemberName(name)) { - return resolveJSDocMemberName(name); - } - } else if (isEntityName(name) && isTypeReferenceIdentifier(name)) { - const meaning = name.parent.kind === 184 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; - const symbol = resolveEntityName( - name, - meaning, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true - ); - return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name); - } - if (name.parent.kind === 183 /* TypePredicate */) { - return resolveEntityName( - name, - /*meaning*/ - 1 /* FunctionScopedVariable */, - /*ignoreErrors*/ - true - ); - } - 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 */; - let symbol = resolveEntityName( - name, - meaning, - ignoreErrors, - /*dontResolveAlias*/ - true, - getHostSignatureFromJSDoc(name) - ); - if (!symbol && isIdentifier(name) && container) { - symbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(container), name.escapedText, meaning)); - } - if (symbol) { - return symbol; - } - } - const left = isIdentifier(name) ? container : resolveJSDocMemberName(name.left, ignoreErrors, container); - const right = isIdentifier(name) ? name.escapedText : name.right.escapedText; - if (left) { - const proto = left.flags & 111551 /* Value */ && getPropertyOfType(getTypeOfSymbol(left), "prototype"); - const t = proto ? getTypeOfSymbol(proto) : getDeclaredTypeOfSymbol(left); - return getPropertyOfType(t, right); - } - } - function getSymbolAtLocation(node, ignoreErrors) { - if (isSourceFile(node)) { - return isExternalModule(node) ? getMergedSymbol(node.symbol) : void 0; - } - const { parent: parent2 } = node; - const grandParent = parent2.parent; - if (node.flags & 67108864 /* InWithStatement */) { - return void 0; - } - if (isDeclarationNameOrImportPropertyName(node)) { - const parentSymbol = getSymbolOfDeclaration(parent2); - return isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node ? getImmediateAliasedSymbol(parentSymbol) : parentSymbol; - } else if (isLiteralComputedPropertyDeclarationName(node)) { - return getSymbolOfDeclaration(parent2.parent); - } - if (node.kind === 80 /* Identifier */) { - if (isInRightSideOfImportOrExportAssignment(node)) { - return getSymbolOfNameOrPropertyAccessExpression(node); - } else if (parent2.kind === 209 /* BindingElement */ && grandParent.kind === 207 /* ObjectBindingPattern */ && node === parent2.propertyName) { - const typeOfPattern = getTypeOfNode(grandParent); - const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); - if (propertyDeclaration) { - return propertyDeclaration; - } - } else if (isMetaProperty(parent2) && parent2.name === node) { - if (parent2.keywordToken === 105 /* NewKeyword */ && idText(node) === "target") { - return checkNewTargetMetaProperty(parent2).symbol; - } - if (parent2.keywordToken === 102 /* ImportKeyword */ && idText(node) === "meta") { - return getGlobalImportMetaExpressionType().members.get("meta"); - } - return void 0; - } - } - switch (node.kind) { - case 80 /* Identifier */: - case 81 /* PrivateIdentifier */: - case 212 /* PropertyAccessExpression */: - case 167 /* QualifiedName */: - if (!isThisInTypeQuery(node)) { - return getSymbolOfNameOrPropertyAccessExpression(node); - } - // falls through - case 110 /* ThisKeyword */: - const container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (isFunctionLike(container)) { - const sig = getSignatureFromDeclaration(container); - if (sig.thisParameter) { - return sig.thisParameter; - } - } - if (isInExpressionContext(node)) { - return checkExpression(node).symbol; - } - // falls through - case 198 /* ThisType */: - return getTypeFromThisTypeNode(node).symbol; - case 108 /* SuperKeyword */: - return checkExpression(node).symbol; - case 137 /* ConstructorKeyword */: - const constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 177 /* 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 === 273 /* ImportDeclaration */ || node.parent.kind === 279 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall( - node.parent, - /*requireStringLiteralLikeArgument*/ - false - ) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) { - return resolveExternalModuleName(node, node, ignoreErrors); - } - if (isCallExpression(parent2) && isBindableObjectDefinePropertyCall(parent2) && parent2.arguments[1] === node) { - return getSymbolOfDeclaration(parent2); - } - // falls through - case 9 /* NumericLiteral */: - const objectType = isElementAccessExpression(parent2) ? parent2.argumentExpression === node ? getTypeOfExpression(parent2.expression) : void 0 : isLiteralTypeNode(parent2) && isIndexedAccessTypeNode(grandParent) ? getTypeFromTypeNode(grandParent.objectType) : void 0; - return objectType && getPropertyOfType(objectType, escapeLeadingUnderscores(node.text)); - case 90 /* DefaultKeyword */: - case 100 /* FunctionKeyword */: - case 39 /* EqualsGreaterThanToken */: - case 86 /* ClassKeyword */: - return getSymbolOfNode(node.parent); - case 206 /* 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 */: - if (isMetaProperty(node.parent) && node.parent.name.escapedText === "defer") { - return void 0; - } - // falls through - case 105 /* NewKeyword */: - return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0; - 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 237 /* MetaProperty */: - return checkExpression(node).symbol; - case 296 /* JsxNamespacedName */: - if (isJSXTagName(node) && isJsxIntrinsicTagName(node)) { - const symbol = getIntrinsicTagSymbol(node.parent); - return symbol === unknownSymbol ? void 0 : symbol; - } - // falls through - default: - return void 0; - } - } - function getIndexInfosAtLocation(node) { - if (isIdentifier(node) && isPropertyAccessExpression(node.parent) && node.parent.name === node) { - const keyType = getLiteralTypeFromPropertyName(node); - const objectType = getTypeOfExpression(node.parent.expression); - const objectTypes = objectType.flags & 1048576 /* Union */ ? objectType.types : [objectType]; - return flatMap(objectTypes, (t) => filter(getIndexInfosOfType(t), (info) => isApplicableIndexType(keyType, info.keyType))); - } - return void 0; - } - function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 305 /* ShorthandPropertyAssignment */) { - return resolveEntityName( - location.name, - 111551 /* Value */ | 2097152 /* Alias */, - /*ignoreErrors*/ - true - ); - } - return void 0; - } - function getExportSpecifierLocalTargetSymbol(node) { - if (isExportSpecifier(node)) { - const name = node.propertyName || node.name; - return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : name.kind === 11 /* StringLiteral */ ? void 0 : ( - // Skip for invalid syntax like this: export { "x" } - resolveEntityName( - name, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, - /*ignoreErrors*/ - true - ) - ); - } else { - return resolveEntityName( - node, - 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, - /*ignoreErrors*/ - true - ); - } - } - function getTypeOfNode(node) { - if (isSourceFile(node) && !isExternalModule(node)) { - return errorType; - } - if (node.flags & 67108864 /* InWithStatement */) { - return errorType; - } - const classDecl = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); - const classType = classDecl && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(classDecl.class)); - if (isPartOfTypeNode(node)) { - const typeFromTypeNode = getTypeFromTypeNode(node); - return classType ? getTypeWithThisArgument(typeFromTypeNode, classType.thisType) : typeFromTypeNode; - } - if (isExpressionNode(node)) { - return getRegularTypeOfExpression(node); - } - if (classType && !classDecl.isImplements) { - const baseType = firstOrUndefined(getBaseTypes(classType)); - return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType; - } - if (isTypeDeclaration(node)) { - const symbol = getSymbolOfDeclaration(node); - return getDeclaredTypeOfSymbol(symbol); - } - if (isTypeDeclarationName(node)) { - const symbol = getSymbolAtLocation(node); - return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; - } - if (isBindingElement(node)) { - return getTypeForVariableLikeDeclaration( - node, - /*includeOptionality*/ - true, - 0 /* Normal */ - ) || errorType; - } - if (isDeclaration(node)) { - const symbol = getSymbolOfDeclaration(node); - return symbol ? getTypeOfSymbol(symbol) : errorType; - } - if (isDeclarationNameOrImportPropertyName(node)) { - const symbol = getSymbolAtLocation(node); - if (symbol) { - return getTypeOfSymbol(symbol); - } - return errorType; - } - if (isBindingPattern(node)) { - return getTypeForVariableLikeDeclaration( - node.parent, - /*includeOptionality*/ - true, - 0 /* Normal */ - ) || errorType; - } - if (isInRightSideOfImportOrExportAssignment(node)) { - const symbol = getSymbolAtLocation(node); - if (symbol) { - const declaredType = getDeclaredTypeOfSymbol(symbol); - return !isErrorType(declaredType) ? declaredType : getTypeOfSymbol(symbol); - } - } - 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 === 211 /* ObjectLiteralExpression */ || expr.kind === 210 /* ArrayLiteralExpression */); - if (expr.parent.kind === 251 /* ForOfStatement */) { - const iteratedType = checkRightHandSideOfForOf(expr.parent); - return checkDestructuringAssignment(expr, iteratedType || errorType); - } - if (expr.parent.kind === 227 /* BinaryExpression */) { - const iteratedType = getTypeOfExpression(expr.parent.right); - return checkDestructuringAssignment(expr, iteratedType || errorType); - } - if (expr.parent.kind === 304 /* PropertyAssignment */) { - const node2 = cast(expr.parent.parent, isObjectLiteralExpression); - const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType; - const propertyIndex = indexOfNode(node2.properties, expr.parent); - return checkObjectLiteralDestructuringPropertyAssignment(node2, typeOfParentObjectLiteral, propertyIndex); - } - const node = cast(expr.parent, isArrayLiteralExpression); - const typeOfArrayLiteral = getTypeOfAssignmentPattern(node) || errorType; - const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, typeOfArrayLiteral, undefinedType, expr.parent) || errorType; - return checkArrayLiteralDestructuringElementAssignment(node, typeOfArrayLiteral, node.elements.indexOf(expr), elementType); - } - function getPropertySymbolOfDestructuringAssignment(location) { - const typeOfObjectLiteral = getTypeOfAssignmentPattern(cast(location.parent.parent, isAssignmentPattern)); - return typeOfObjectLiteral && getPropertyOfType(typeOfObjectLiteral, location.escapedText); - } - function getRegularTypeOfExpression(expr) { - if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { - expr = expr.parent; - } - return getRegularTypeOfLiteralType(getTypeOfExpression(expr)); - } - function getParentTypeOfClassElement(node) { - const classSymbol = getSymbolOfNode(node.parent); - return isStatic(node) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); - } - function getClassElementPropertyKeyType(element) { - const name = element.name; - switch (name.kind) { - case 80 /* Identifier */: - return getStringLiteralType(idText(name)); - case 9 /* NumericLiteral */: - case 11 /* StringLiteral */: - return getStringLiteralType(name.text); - case 168 /* ComputedPropertyName */: - const nameType = checkComputedPropertyName(name); - return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; - default: - return Debug.fail("Unsupported property name."); - } - } - function getAugmentedPropertiesOfType(type) { - type = getApparentType(type); - const propsByName = createSymbolTable(getPropertiesOfType(type)); - const functionType = getSignaturesOfType(type, 0 /* Call */).length ? globalCallableFunctionType : getSignaturesOfType(type, 1 /* Construct */).length ? globalNewableFunctionType : void 0; - if (functionType) { - forEach(getPropertiesOfType(functionType), (p) => { - if (!propsByName.has(p.escapedName)) { - propsByName.set(p.escapedName, p); - } - }); - } - return getNamedMembers(propsByName); - } - function typeHasCallOrConstructSignatures(type) { - return getSignaturesOfType(type, 0 /* Call */).length !== 0 || getSignaturesOfType(type, 1 /* Construct */).length !== 0; - } - function getRootSymbols(symbol) { - const roots = getImmediateRootSymbols(symbol); - return roots ? flatMap(roots, getRootSymbols) : [symbol]; - } - function getImmediateRootSymbols(symbol) { - if (getCheckFlags(symbol) & 6 /* Synthetic */) { - return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName)); - } else if (symbol.flags & 33554432 /* Transient */) { - const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol; - return leftSpread ? [leftSpread, rightSpread] : syntheticOrigin ? [syntheticOrigin] : singleElementArray(tryGetTarget(symbol)); - } - return void 0; - } - function tryGetTarget(symbol) { - let target; - let next = symbol; - while (next = getSymbolLinks(next).target) { - target = next; - } - return target; - } - function isArgumentsLocalBinding(nodeIn) { - if (isGeneratedIdentifier(nodeIn)) return false; - const node = getParseTreeNode(nodeIn, isIdentifier); - if (!node) return false; - const parent2 = node.parent; - if (!parent2) return false; - const isPropertyName2 = (isPropertyAccessExpression(parent2) || isPropertyAssignment(parent2)) && parent2.name === node; - return !isPropertyName2 && getReferencedValueSymbol(node) === argumentsSymbol; - } - function isNameOfModuleOrEnumDeclaration(node) { - return isModuleOrEnumDeclaration(node.parent) && node === node.parent.name; - } - function getReferencedExportContainer(nodeIn, prefixLocals) { - var _a; - const node = getParseTreeNode(nodeIn, isIdentifier); - if (node) { - let symbol = getReferencedValueSymbol( - node, - /*startInDeclarationContainer*/ - isNameOfModuleOrEnumDeclaration(node) - ); - if (symbol) { - if (symbol.flags & 1048576 /* ExportValue */) { - const exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */ && !(exportSymbol.flags & 3 /* Variable */)) { - return void 0; - } - symbol = exportSymbol; - } - const parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 308 /* SourceFile */) { - const symbolFile = parentSymbol.valueDeclaration; - const referenceFile = getSourceFileOfNode(node); - const symbolIsUmdExport = symbolFile !== referenceFile; - return symbolIsUmdExport ? void 0 : symbolFile; - } - return findAncestor(node.parent, (n) => isModuleOrEnumDeclaration(n) && getSymbolOfDeclaration(n) === parentSymbol); - } - } - } - } - function getReferencedImportDeclaration(nodeIn) { - const specifier = getIdentifierGeneratedImportReference(nodeIn); - if (specifier) { - return specifier; - } - const node = getParseTreeNode(nodeIn, isIdentifier); - if (node) { - const symbol = getReferencedValueOrAliasSymbol(node); - if (isNonLocalAlias( - symbol, - /*excludes*/ - 111551 /* Value */ - ) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) { - return getDeclarationOfAliasSymbol(symbol); - } - } - return void 0; - } - function isSymbolOfDestructuredElementOfCatchBinding(symbol) { - return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 300 /* CatchClause */; - } - function isSymbolOfDeclarationWithCollidingName(symbol) { - if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) { - const links = getSymbolLinks(symbol); - if (links.isDeclarationWithCollidingName === void 0) { - const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); - if (isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) { - if (resolveName( - container.parent, - symbol.escapedName, - 111551 /* Value */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - false - )) { - links.isDeclarationWithCollidingName = true; - } else if (hasNodeCheckFlag(symbol.valueDeclaration, 16384 /* CapturedBlockScopedBinding */)) { - const isDeclaredInLoop = hasNodeCheckFlag(symbol.valueDeclaration, 32768 /* BlockScopedBindingInLoop */); - const inLoopInitializer = isIterationStatement( - container, - /*lookInLabeledStatements*/ - false - ); - const inLoopBodyBlock = container.kind === 242 /* Block */ && isIterationStatement( - container.parent, - /*lookInLabeledStatements*/ - false - ); - links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock); - } else { - links.isDeclarationWithCollidingName = false; - } - } - } - return links.isDeclarationWithCollidingName; - } - return false; - } - function getReferencedDeclarationWithCollidingName(nodeIn) { - if (!isGeneratedIdentifier(nodeIn)) { - const node = getParseTreeNode(nodeIn, isIdentifier); - if (node) { - const symbol = getReferencedValueSymbol(node); - if (symbol && isSymbolOfDeclarationWithCollidingName(symbol)) { - return symbol.valueDeclaration; - } - } - } - return void 0; - } - function isDeclarationWithCollidingName(nodeIn) { - const node = getParseTreeNode(nodeIn, isDeclaration); - if (node) { - const symbol = getSymbolOfDeclaration(node); - if (symbol) { - return isSymbolOfDeclarationWithCollidingName(symbol); - } - } - return false; - } - function isValueAliasDeclaration(node) { - Debug.assert(canCollectSymbolAliasAccessabilityData); - switch (node.kind) { - case 272 /* ImportEqualsDeclaration */: - return isAliasResolvedToValue(getSymbolOfDeclaration(node)); - case 274 /* ImportClause */: - case 275 /* NamespaceImport */: - case 277 /* ImportSpecifier */: - case 282 /* ExportSpecifier */: - const symbol = getSymbolOfDeclaration(node); - return !!symbol && isAliasResolvedToValue( - symbol, - /*excludeTypeOnlyValues*/ - true - ); - case 279 /* ExportDeclaration */: - const exportClause = node.exportClause; - return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration)); - case 278 /* 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 !== 308 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) { - return false; - } - const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node)); - return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference); - } - function isAliasResolvedToValue(symbol, excludeTypeOnlyValues) { - if (!symbol) { - return false; - } - const container = getSourceFileOfNode(symbol.valueDeclaration); - const fileSymbol = container && getSymbolOfDeclaration(container); - void resolveExternalModuleSymbol(fileSymbol); - const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol)); - if (target === unknownSymbol) { - return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol); - } - return !!(getSymbolFlags( - symbol, - excludeTypeOnlyValues, - /*excludeLocalMeanings*/ - true - ) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target)); - } - function isConstEnumOrConstEnumOnlyModule(s) { - return isConstEnumSymbol(s) || !!s.constEnumOnlyModule; - } - function isReferencedAliasDeclaration(node, checkChildren) { - Debug.assert(canCollectSymbolAliasAccessabilityData); - if (isAliasSymbolDeclaration(node)) { - const symbol = getSymbolOfDeclaration(node); - const links = symbol && getSymbolLinks(symbol); - if (links == null ? void 0 : links.referenced) { - return true; - } - const target = getSymbolLinks(symbol).aliasTarget; - if (target && getEffectiveModifierFlags(node) & 32 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) { - return true; - } - } - if (checkChildren) { - return !!forEachChild(node, (node2) => isReferencedAliasDeclaration(node2, checkChildren)); - } - return false; - } - function isImplementationOfOverload(node) { - if (nodeIsPresent(node.body)) { - if (isGetAccessor(node) || isSetAccessor(node)) return false; - const symbol = getSymbolOfDeclaration(node); - const signaturesOfSymbol = getSignaturesOfSymbol(symbol); - return signaturesOfSymbol.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node - // e.g.: function foo(a: string): string; - // function foo(a: any) { // This is implementation of the overloads - // return a; - // } - signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node; - } - return false; - } - function declaredParameterTypeContainsUndefined(parameter) { - const typeNode = getNonlocalEffectiveTypeAnnotationNode(parameter); - if (!typeNode) return false; - const type = getTypeFromTypeNode(typeNode); - return isErrorType(type) || containsUndefinedType(type); - } - function requiresAddingImplicitUndefined(parameter, enclosingDeclaration) { - return (isRequiredInitializedParameter(parameter, enclosingDeclaration) || isOptionalUninitializedParameterProperty(parameter)) && !declaredParameterTypeContainsUndefined(parameter); - } - function isRequiredInitializedParameter(parameter, enclosingDeclaration) { - if (!strictNullChecks || isOptionalParameter(parameter) || isJSDocParameterTag(parameter) || !parameter.initializer) { - return false; - } - if (hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */)) { - return !!enclosingDeclaration && isFunctionLikeDeclaration(enclosingDeclaration); - } - return true; - } - function isOptionalUninitializedParameterProperty(parameter) { - return strictNullChecks && isOptionalParameter(parameter) && (isJSDocParameterTag(parameter) || !parameter.initializer) && hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */); - } - function isExpandoFunctionDeclaration(node) { - const declaration = getParseTreeNode(node, (n) => isFunctionDeclaration(n) || isVariableDeclaration(n)); - if (!declaration) { - return false; - } - let symbol; - if (isVariableDeclaration(declaration)) { - if (declaration.type || !isInJSFile(declaration) && !isVarConstLike2(declaration)) { - return false; - } - const initializer = getDeclaredExpandoInitializer(declaration); - if (!initializer || !canHaveSymbol(initializer)) { - return false; - } - symbol = getSymbolOfDeclaration(initializer); - } else { - symbol = getSymbolOfDeclaration(declaration); - } - if (!symbol || !(symbol.flags & 16 /* Function */ | 3 /* Variable */)) { - return false; - } - return !!forEachEntry(getExportsOfSymbol(symbol), (p) => p.flags & 111551 /* Value */ && isExpandoPropertyDeclaration(p.valueDeclaration)); - } - function getPropertiesOfContainerFunction(node) { - const declaration = getParseTreeNode(node, isFunctionDeclaration); - if (!declaration) { - return emptyArray; - } - const symbol = getSymbolOfDeclaration(declaration); - return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || emptyArray; - } - function getNodeCheckFlags(node) { - var _a; - const nodeId = node.id || 0; - if (nodeId < 0 || nodeId >= nodeLinks.length) return 0; - return ((_a = nodeLinks[nodeId]) == null ? void 0 : _a.flags) || 0; - } - function hasNodeCheckFlag(node, flag) { - calculateNodeCheckFlagWorker(node, flag); - return !!(getNodeCheckFlags(node) & flag); - } - function calculateNodeCheckFlagWorker(node, flag) { - if (!compilerOptions.noCheck && canIncludeBindAndCheckDiagnostics(getSourceFileOfNode(node), compilerOptions)) { - return; - } - const links = getNodeLinks(node); - if (links.calculatedFlags & flag) { - return; - } - switch (flag) { - case 16 /* SuperInstance */: - case 32 /* SuperStatic */: - return checkSingleSuperExpression(node); - case 128 /* MethodWithSuperPropertyAccessInAsync */: - case 256 /* MethodWithSuperPropertyAssignmentInAsync */: - case 2097152 /* ContainsSuperPropertyInStaticInitializer */: - return checkChildSuperExpressions(node); - case 512 /* CaptureArguments */: - case 8192 /* ContainsCapturedBlockScopeBinding */: - case 65536 /* NeedsLoopOutParameter */: - case 262144 /* ContainsConstructorReference */: - return checkChildIdentifiers(node); - case 536870912 /* ConstructorReference */: - return checkSingleIdentifier(node); - case 4096 /* LoopWithCapturedBlockScopedBinding */: - case 32768 /* BlockScopedBindingInLoop */: - case 16384 /* CapturedBlockScopedBinding */: - return checkContainingBlockScopeBindingUses(node); - default: - return Debug.assertNever(flag, `Unhandled node check flag calculation: ${Debug.formatNodeCheckFlags(flag)}`); - } - function forEachNodeRecursively(root, cb) { - const rootResult = cb(root, root.parent); - if (rootResult === "skip") return void 0; - if (rootResult) return rootResult; - return forEachChildRecursively(root, cb); - } - function checkSuperExpressions(node2) { - const links2 = getNodeLinks(node2); - if (links2.calculatedFlags & flag) return "skip"; - links2.calculatedFlags |= 128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */ | 2097152 /* ContainsSuperPropertyInStaticInitializer */; - checkSingleSuperExpression(node2); - return void 0; - } - function checkChildSuperExpressions(node2) { - forEachNodeRecursively(node2, checkSuperExpressions); - } - function checkSingleSuperExpression(node2) { - const nodeLinks2 = getNodeLinks(node2); - nodeLinks2.calculatedFlags |= 16 /* SuperInstance */ | 32 /* SuperStatic */; - if (node2.kind === 108 /* SuperKeyword */) { - checkSuperExpression(node2); - } - } - function checkIdentifiers(node2) { - const links2 = getNodeLinks(node2); - if (links2.calculatedFlags & flag) return "skip"; - links2.calculatedFlags |= 512 /* CaptureArguments */ | 8192 /* ContainsCapturedBlockScopeBinding */ | 65536 /* NeedsLoopOutParameter */ | 262144 /* ContainsConstructorReference */; - checkSingleIdentifier(node2); - return void 0; - } - function checkChildIdentifiers(node2) { - forEachNodeRecursively(node2, checkIdentifiers); - } - function isExpressionNodeOrShorthandPropertyAssignmentName(node2) { - return isExpressionNode(node2) || isShorthandPropertyAssignment(node2.parent) && (node2.parent.objectAssignmentInitializer ?? node2.parent.name) === node2; - } - function checkSingleIdentifier(node2) { - const nodeLinks2 = getNodeLinks(node2); - nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */; - if (isIdentifier(node2)) { - nodeLinks2.calculatedFlags |= 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */; - if (isExpressionNodeOrShorthandPropertyAssignmentName(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) { - const s = getResolvedSymbol(node2); - if (s && s !== unknownSymbol) { - checkIdentifierCalculateNodeCheckFlags(node2, s); - } - } - } - } - function checkBlockScopeBindings(node2) { - const links2 = getNodeLinks(node2); - if (links2.calculatedFlags & flag) return "skip"; - links2.calculatedFlags |= 4096 /* LoopWithCapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */; - checkSingleBlockScopeBinding(node2); - return void 0; - } - function checkContainingBlockScopeBindingUses(node2) { - const scope = getEnclosingBlockScopeContainer(isDeclarationName(node2) ? node2.parent : node2); - forEachNodeRecursively(scope, checkBlockScopeBindings); - } - function checkSingleBlockScopeBinding(node2) { - checkSingleIdentifier(node2); - if (isComputedPropertyName(node2)) { - checkComputedPropertyName(node2); - } - if (isPrivateIdentifier(node2) && isClassElement(node2.parent)) { - setNodeLinksForPrivateIdentifierScope(node2.parent); - } - } - } - function getEnumMemberValue(node) { - computeEnumMemberValues(node.parent); - return getNodeLinks(node).enumMemberValue ?? evaluatorResult( - /*value*/ - void 0 - ); - } - function canHaveConstantValue(node) { - switch (node.kind) { - case 307 /* EnumMember */: - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return true; - } - return false; - } - function getConstantValue2(node) { - if (node.kind === 307 /* EnumMember */) { - return getEnumMemberValue(node).value; - } - if (!getNodeLinks(node).resolvedSymbol) { - void checkExpressionCached(node); - } - const symbol = getNodeLinks(node).resolvedSymbol || (isEntityNameExpression(node) ? resolveEntityName( - node, - 111551 /* Value */, - /*ignoreErrors*/ - true - ) : void 0); - if (symbol && symbol.flags & 8 /* EnumMember */) { - const member = symbol.valueDeclaration; - if (isEnumConst(member.parent)) { - return getEnumMemberValue(member).value; - } - } - return void 0; - } - function isFunctionType(type) { - return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0; - } - function getTypeReferenceSerializationKind(typeNameIn, location) { - var _a; - const typeName = getParseTreeNode(typeNameIn, isEntityName); - if (!typeName) return 0 /* Unknown */; - if (location) { - location = getParseTreeNode(location); - if (!location) return 0 /* Unknown */; - } - let isTypeOnly = false; - if (isQualifiedName(typeName)) { - const rootValueSymbol = resolveEntityName( - getFirstIdentifier(typeName), - 111551 /* Value */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - location - ); - isTypeOnly = !!((_a = rootValueSymbol == null ? void 0 : rootValueSymbol.declarations) == null ? void 0 : _a.every(isTypeOnlyImportOrExportDeclaration)); - } - const valueSymbol = resolveEntityName( - typeName, - 111551 /* Value */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - location - ); - const resolvedValueSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol; - isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */))); - const typeSymbol = resolveEntityName( - typeName, - 788968 /* Type */, - /*ignoreErrors*/ - true, - /*dontResolveAlias*/ - true, - location - ); - 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 && resolvedValueSymbol === globalPromiseSymbol) { - return 9 /* Promise */; - } - const constructorType = getTypeOfSymbol(resolvedValueSymbol); - if (constructorType && isConstructorType(constructorType)) { - return isTypeOnly ? 10 /* TypeWithCallSignature */ : 1 /* TypeWithConstructSignatureAndValue */; - } - } - if (!resolvedTypeSymbol) { - return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */; - } - const type = getDeclaredTypeOfSymbol(resolvedTypeSymbol); - if (isErrorType(type)) { - return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */; - } else if (type.flags & 3 /* AnyOrUnknown */) { - return 11 /* ObjectType */; - } else if (isTypeAssignableToKind(type, 16384 /* Void */ | 98304 /* Nullable */ | 131072 /* Never */)) { - return 2 /* VoidNullableOrNeverType */; - } else if (isTypeAssignableToKind(type, 528 /* BooleanLike */)) { - return 6 /* BooleanType */; - } else if (isTypeAssignableToKind(type, 296 /* NumberLike */)) { - return 3 /* NumberLikeType */; - } else if (isTypeAssignableToKind(type, 2112 /* BigIntLike */)) { - return 4 /* BigIntLikeType */; - } else if (isTypeAssignableToKind(type, 402653316 /* StringLike */)) { - return 5 /* StringLikeType */; - } else if (isTupleType(type)) { - return 7 /* ArrayLikeType */; - } else if (isTypeAssignableToKind(type, 12288 /* ESSymbolLike */)) { - return 8 /* ESSymbolType */; - } else if (isFunctionType(type)) { - return 10 /* TypeWithCallSignature */; - } else if (isArrayType(type)) { - return 7 /* ArrayLikeType */; - } else { - return 11 /* ObjectType */; - } - } - function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, internalFlags, tracker) { - const declaration = getParseTreeNode(declarationIn, hasInferredType); - if (!declaration) { - return factory.createToken(133 /* AnyKeyword */); - } - const symbol = getSymbolOfDeclaration(declaration); - return nodeBuilder.serializeTypeForDeclaration(declaration, symbol, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, internalFlags, tracker); - } - function getAllAccessorDeclarationsForDeclaration(accessor) { - accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration); - const otherKind = accessor.kind === 179 /* SetAccessor */ ? 178 /* GetAccessor */ : 179 /* 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 === 179 /* SetAccessor */ ? accessor : otherAccessor; - const getAccessor = accessor.kind === 178 /* GetAccessor */ ? accessor : otherAccessor; - return { - firstAccessor, - secondAccessor, - setAccessor, - getAccessor - }; - } - function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, internalFlags, tracker) { - const signatureDeclaration = getParseTreeNode(signatureDeclarationIn, isFunctionLike); - if (!signatureDeclaration) { - return factory.createToken(133 /* AnyKeyword */); - } - return nodeBuilder.serializeReturnTypeForSignature(signatureDeclaration, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, internalFlags, tracker); - } - function createTypeOfExpression(exprIn, enclosingDeclaration, flags, internalFlags, tracker) { - const expr = getParseTreeNode(exprIn, isExpression); - if (!expr) { - return factory.createToken(133 /* AnyKeyword */); - } - return nodeBuilder.serializeTypeForExpression(expr, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, internalFlags, tracker); - } - function hasGlobalName(name) { - return globals.has(escapeLeadingUnderscores(name)); - } - function getReferencedValueSymbol(reference, startInDeclarationContainer) { - const resolvedSymbol = getNodeLinks(reference).resolvedSymbol; - if (resolvedSymbol) { - return resolvedSymbol; - } - let location = reference; - if (startInDeclarationContainer) { - const parent2 = reference.parent; - if (isDeclaration(parent2) && reference === parent2.name) { - location = getDeclarationContainer(parent2); - } - } - return resolveName( - location, - reference.escapedText, - 111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - } - function getReferencedValueOrAliasSymbol(reference) { - const resolvedSymbol = getNodeLinks(reference).resolvedSymbol; - if (resolvedSymbol && resolvedSymbol !== unknownSymbol) { - return resolvedSymbol; - } - return resolveName( - reference, - reference.escapedText, - 111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true, - /*excludeGlobals*/ - void 0 - ); - } - function getReferencedValueDeclaration(referenceIn) { - if (!isGeneratedIdentifier(referenceIn)) { - const reference = getParseTreeNode(referenceIn, isIdentifier); - if (reference) { - const symbol = getReferencedValueSymbol(reference); - if (symbol) { - return getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; - } - } - } - return void 0; - } - function getReferencedValueDeclarations(referenceIn) { - if (!isGeneratedIdentifier(referenceIn)) { - const reference = getParseTreeNode(referenceIn, isIdentifier); - if (reference) { - const symbol = getReferencedValueSymbol(reference); - if (symbol) { - return filter(getExportSymbolOfValueSymbolIfExported(symbol).declarations, (declaration) => { - switch (declaration.kind) { - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 209 /* BindingElement */: - case 173 /* PropertyDeclaration */: - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - case 307 /* EnumMember */: - case 211 /* ObjectLiteralExpression */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 267 /* EnumDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 268 /* ModuleDeclaration */: - return true; - } - return false; - }); - } - } - } - return void 0; - } - function isLiteralConstDeclaration(node) { - if (isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConstLike2(node)) { - return isFreshLiteralType(getTypeOfSymbol(getSymbolOfDeclaration(node))); - } - return false; - } - function literalTypeToNode(type, enclosing, tracker) { - const enumResult = type.flags & 1056 /* EnumLike */ ? nodeBuilder.symbolToExpression( - type.symbol, - 111551 /* Value */, - enclosing, - /*flags*/ - void 0, - /*internalFlags*/ - void 0, - tracker - ) : type === trueType ? factory.createTrue() : type === falseType && factory.createFalse(); - if (enumResult) return enumResult; - const literalValue = type.value; - 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)); - return literalTypeToNode(type, node, tracker); - } - function getJsxFactoryEntity(location) { - return location ? (getJsxNamespace(location), getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity) : _jsxFactoryEntity; - } - function getJsxFragmentFactoryEntity(location) { - if (location) { - const file = getSourceFileOfNode(location); - if (file) { - if (file.localJsxFragmentFactory) { - return file.localJsxFragmentFactory; - } - const jsxFragPragmas = file.pragmas.get("jsxfrag"); - const jsxFragPragma = isArray(jsxFragPragmas) ? jsxFragPragmas[0] : jsxFragPragmas; - if (jsxFragPragma) { - file.localJsxFragmentFactory = parseIsolatedEntityName(jsxFragPragma.arguments.factory, languageVersion); - return file.localJsxFragmentFactory; - } - } - } - if (compilerOptions.jsxFragmentFactory) { - return parseIsolatedEntityName(compilerOptions.jsxFragmentFactory, languageVersion); - } - } - function getNonlocalEffectiveTypeAnnotationNode(node) { - const direct = getEffectiveTypeAnnotationNode(node); - if (direct) { - return direct; - } - if (node.kind === 170 /* Parameter */ && node.parent.kind === 179 /* SetAccessor */) { - const other = getAllAccessorDeclarationsForDeclaration(node.parent).getAccessor; - if (other) { - return getEffectiveReturnTypeNode(other); - } - } - return void 0; - } - function createResolver() { - return { - getReferencedExportContainer, - getReferencedImportDeclaration, - getReferencedDeclarationWithCollidingName, - isDeclarationWithCollidingName, - isValueAliasDeclaration: (nodeIn) => { - const node = getParseTreeNode(nodeIn); - return node && canCollectSymbolAliasAccessabilityData ? isValueAliasDeclaration(node) : true; - }, - hasGlobalName, - isReferencedAliasDeclaration: (nodeIn, checkChildren) => { - const node = getParseTreeNode(nodeIn); - return node && canCollectSymbolAliasAccessabilityData ? isReferencedAliasDeclaration(node, checkChildren) : true; - }, - hasNodeCheckFlag: (nodeIn, flag) => { - const node = getParseTreeNode(nodeIn); - if (!node) return false; - return hasNodeCheckFlag(node, flag); - }, - isTopLevelValueImportEqualsWithEntityName, - isDeclarationVisible, - isImplementationOfOverload, - requiresAddingImplicitUndefined, - isExpandoFunctionDeclaration, - getPropertiesOfContainerFunction, - createTypeOfDeclaration, - createReturnTypeOfSignatureDeclaration, - createTypeOfExpression, - createLiteralConstValue, - isSymbolAccessible, - isEntityNameVisible, - getConstantValue: (nodeIn) => { - const node = getParseTreeNode(nodeIn, canHaveConstantValue); - return node ? getConstantValue2(node) : void 0; - }, - getEnumMemberValue: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isEnumMember); - return node ? getEnumMemberValue(node) : void 0; - }, - collectLinkedAliases, - markLinkedReferences: (nodeIn) => { - const node = getParseTreeNode(nodeIn); - return node && markLinkedReferences(node, 0 /* Unspecified */); - }, - getReferencedValueDeclaration, - getReferencedValueDeclarations, - getTypeReferenceSerializationKind, - isOptionalParameter, - isArgumentsLocalBinding, - getExternalModuleFileFromDeclaration: (nodeIn) => { - const node = getParseTreeNode(nodeIn, hasPossibleExternalModuleReference); - return node && getExternalModuleFileFromDeclaration(node); - }, - isLiteralConstDeclaration, - isLateBound: (nodeIn) => { - const node = getParseTreeNode(nodeIn, isDeclaration); - const symbol = node && getSymbolOfDeclaration(node); - return !!(symbol && getCheckFlags(symbol) & 4096 /* Late */); - }, - getJsxFactoryEntity, - getJsxFragmentFactoryEntity, - isBindingCapturedByNode: (node, decl) => { - const parseNode = getParseTreeNode(node); - const parseDecl = getParseTreeNode(decl); - return !!parseNode && !!parseDecl && (isVariableDeclaration(parseDecl) || isBindingElement(parseDecl)) && isBindingCapturedByNode(parseNode, parseDecl); - }, - getDeclarationStatementsForSourceFile: (node, flags, internalFlags, tracker) => { - const n = getParseTreeNode(node); - Debug.assert(n && n.kind === 308 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); - const sym = getSymbolOfDeclaration(node); - if (!sym) { - return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, internalFlags, tracker); - } - resolveExternalModuleSymbol(sym); - return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, internalFlags, tracker); - }, - isImportRequiredByAugmentation, - isDefinitelyReferenceToGlobalSymbolObject, - createLateBoundIndexSignatures: (cls, enclosing, flags, internalFlags, tracker) => { - const sym = cls.symbol; - const staticInfos = getIndexInfosOfType(getTypeOfSymbol(sym)); - const instanceIndexSymbol = getIndexSymbol(sym); - const instanceInfos = instanceIndexSymbol && getIndexInfosOfIndexSymbol(instanceIndexSymbol, arrayFrom(getMembersOfSymbol(sym).values())); - let result; - for (const infoList of [staticInfos, instanceInfos]) { - if (!length(infoList)) continue; - result || (result = []); - for (const info of infoList) { - if (info.declaration) continue; - if (info === anyBaseTypeIndexInfo) continue; - if (info.components) { - const allComponentComputedNamesSerializable = every(info.components, (e) => { - var _a; - return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && enclosing && ((_a = isEntityNameVisible( - e.name.expression, - enclosing, - /*shouldComputeAliasToMakeVisible*/ - false - )) == null ? void 0 : _a.accessibility) === 0 /* Accessible */); - }); - if (allComponentComputedNamesSerializable) { - const newComponents = filter(info.components, (e) => { - return !hasLateBindableName(e); - }); - result.push(...map(newComponents, (e) => { - trackComputedName(e.name.expression); - const mods = infoList === staticInfos ? [factory.createModifier(126 /* StaticKeyword */)] : void 0; - return factory.createPropertyDeclaration( - append(mods, info.isReadonly ? factory.createModifier(148 /* ReadonlyKeyword */) : void 0), - e.name, - (isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(58 /* QuestionToken */) : void 0, - nodeBuilder.typeToTypeNode(getTypeOfSymbol(e.symbol), enclosing, flags, internalFlags, tracker), - /*initializer*/ - void 0 - ); - })); - continue; - } - } - const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker); - if (node && infoList === staticInfos) { - (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */)); - } - if (node) { - result.push(node); - } - } - } - return result; - function trackComputedName(accessExpression) { - if (!tracker.trackSymbol) return; - const firstIdentifier = getFirstIdentifier(accessExpression); - const name = resolveName( - firstIdentifier, - firstIdentifier.escapedText, - 111551 /* Value */ | 1048576 /* ExportValue */, - /*nameNotFoundMessage*/ - void 0, - /*isUse*/ - true - ); - if (name) { - tracker.trackSymbol(name, enclosing, 111551 /* Value */); - } - } - }, - symbolToDeclarations: (symbol, meaning, flags, maximumLength, verbosityLevel, out) => { - return nodeBuilder.symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out); - } - }; - function isImportRequiredByAugmentation(node) { - const file = getSourceFileOfNode(node); - if (!file.symbol) return false; - const importTarget = getExternalModuleFileFromDeclaration(node); - if (!importTarget) return false; - if (importTarget === file) return false; - const exports2 = getExportsOfModule(file.symbol); - for (const s of arrayFrom(exports2.values())) { - if (s.mergeId) { - const merged = getMergedSymbol(s); - if (merged.declarations) { - for (const d of merged.declarations) { - const declFile = getSourceFileOfNode(d); - if (declFile === importTarget) { - return true; - } - } - } - } - } - return false; - } - } - function getExternalModuleFileFromDeclaration(declaration) { - const specifier = declaration.kind === 268 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); - const moduleSymbol = resolveExternalModuleNameWorker( - specifier, - specifier, - /*moduleNotFoundError*/ - void 0 - ); - if (!moduleSymbol) { - return void 0; - } - return getDeclarationOfKind(moduleSymbol, 308 /* SourceFile */); - } - function initializeTypeChecker() { - for (const file of host.getSourceFiles()) { - bindSourceFile(file, compilerOptions); - } - amalgamatedDuplicates = /* @__PURE__ */ new Map(); - let augmentations; - for (const file of host.getSourceFiles()) { - if (file.redirectInfo) { - continue; - } - if (!isExternalOrCommonJsModule(file)) { - const fileGlobalThisSymbol = file.locals.get("globalThis"); - if (fileGlobalThisSymbol == null ? void 0 : fileGlobalThisSymbol.declarations) { - for (const declaration of fileGlobalThisSymbol.declarations) { - diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, "globalThis")); - } - } - mergeSymbolTable(globals, file.locals); - } - if (file.jsGlobalAugmentations) { - mergeSymbolTable(globals, file.jsGlobalAugmentations); - } - if (file.patternAmbientModules && file.patternAmbientModules.length) { - patternAmbientModules = concatenate(patternAmbientModules, file.patternAmbientModules); - } - if (file.moduleAugmentations.length) { - (augmentations || (augmentations = [])).push(file.moduleAugmentations); - } - if (file.symbol && file.symbol.globalExports) { - const source = file.symbol.globalExports; - source.forEach((sourceSymbol, id) => { - if (!globals.has(id)) { - globals.set(id, sourceSymbol); - } - }); - } - } - if (augmentations) { - for (const list of augmentations) { - for (const augmentation of list) { - if (!isGlobalScopeAugmentation(augmentation.parent)) continue; - mergeModuleAugmentation(augmentation); - } - } - } - addUndefinedToGlobalsOrErrorOnRedeclaration(); - getSymbolLinks(undefinedSymbol).type = undefinedWideningType; - getSymbolLinks(argumentsSymbol).type = getGlobalType( - "IArguments", - /*arity*/ - 0, - /*reportErrors*/ - true - ); - getSymbolLinks(unknownSymbol).type = errorType; - getSymbolLinks(globalThisSymbol).type = createObjectType(16 /* Anonymous */, globalThisSymbol); - globalArrayType = getGlobalType( - "Array", - /*arity*/ - 1, - /*reportErrors*/ - true - ); - globalObjectType = getGlobalType( - "Object", - /*arity*/ - 0, - /*reportErrors*/ - true - ); - globalFunctionType = getGlobalType( - "Function", - /*arity*/ - 0, - /*reportErrors*/ - true - ); - globalCallableFunctionType = strictBindCallApply && getGlobalType( - "CallableFunction", - /*arity*/ - 0, - /*reportErrors*/ - true - ) || globalFunctionType; - globalNewableFunctionType = strictBindCallApply && getGlobalType( - "NewableFunction", - /*arity*/ - 0, - /*reportErrors*/ - true - ) || globalFunctionType; - globalStringType = getGlobalType( - "String", - /*arity*/ - 0, - /*reportErrors*/ - true - ); - globalNumberType = getGlobalType( - "Number", - /*arity*/ - 0, - /*reportErrors*/ - true - ); - globalBooleanType = getGlobalType( - "Boolean", - /*arity*/ - 0, - /*reportErrors*/ - true - ); - globalRegExpType = getGlobalType( - "RegExp", - /*arity*/ - 0, - /*reportErrors*/ - true - ); - anyArrayType = createArrayType(anyType); - autoArrayType = createArrayType(autoType); - if (autoArrayType === emptyObjectType) { - autoArrayType = createAnonymousType( - /*symbol*/ - void 0, - emptySymbols, - emptyArray, - emptyArray, - emptyArray - ); - } - globalReadonlyArrayType = getGlobalTypeOrUndefined( - "ReadonlyArray", - /*arity*/ - 1 - ) || globalArrayType; - anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; - globalThisType = getGlobalTypeOrUndefined( - "ThisType", - /*arity*/ - 1 - ); - if (augmentations) { - for (const list of augmentations) { - for (const augmentation of list) { - if (isGlobalScopeAugmentation(augmentation.parent)) continue; - mergeModuleAugmentation(augmentation); - } - } - } - amalgamatedDuplicates.forEach(({ firstFile, secondFile, conflictingSymbols }) => { - if (conflictingSymbols.size < 8) { - conflictingSymbols.forEach(({ isBlockScoped, firstFileLocations, secondFileLocations }, symbolName2) => { - const message = isBlockScoped ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; - for (const node of firstFileLocations) { - addDuplicateDeclarationError(node, message, symbolName2, secondFileLocations); - } - for (const node of secondFileLocations) { - addDuplicateDeclarationError(node, message, symbolName2, firstFileLocations); - } - }); - } else { - const list = arrayFrom(conflictingSymbols.keys()).join(", "); - diagnostics.add(addRelatedInfo( - createDiagnosticForNode(firstFile, Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list), - createDiagnosticForNode(secondFile, Diagnostics.Conflicts_are_in_this_file) - )); - diagnostics.add(addRelatedInfo( - createDiagnosticForNode(secondFile, Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list), - createDiagnosticForNode(firstFile, Diagnostics.Conflicts_are_in_this_file) - )); - } - }); - amalgamatedDuplicates = void 0; - } - function checkExternalEmitHelpers(location, helpers) { - if (compilerOptions.importHelpers) { - const sourceFile = getSourceFileOfNode(location); - if (isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 33554432 /* Ambient */)) { - const helpersModule = resolveHelpersModule(sourceFile, location); - if (helpersModule !== unknownSymbol) { - const links = getSymbolLinks(helpersModule); - links.requestedExternalEmitHelpers ?? (links.requestedExternalEmitHelpers = 0); - if ((links.requestedExternalEmitHelpers & helpers) !== helpers) { - const uncheckedHelpers = helpers & ~links.requestedExternalEmitHelpers; - for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) { - if (uncheckedHelpers & helper) { - for (const name of getHelperNames(helper)) { - const symbol = resolveSymbol(getSymbol2(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */)); - if (!symbol) { - 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)) { - 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)) { - 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)) { - 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); - } - } - } - } - } - } - links.requestedExternalEmitHelpers |= helpers; - } - } - } - } - function getHelperNames(helper) { - switch (helper) { - case 1 /* Extends */: - return ["__extends"]; - case 2 /* Assign */: - return ["__assign"]; - case 4 /* Rest */: - return ["__rest"]; - case 8 /* Decorate */: - return legacyDecorators ? ["__decorate"] : ["__esDecorate", "__runInitializers"]; - case 16 /* Metadata */: - return ["__metadata"]; - case 32 /* Param */: - return ["__param"]; - case 64 /* Awaiter */: - return ["__awaiter"]; - case 128 /* Generator */: - return ["__generator"]; - case 256 /* Values */: - return ["__values"]; - case 512 /* Read */: - return ["__read"]; - case 1024 /* SpreadArray */: - return ["__spreadArray"]; - case 2048 /* Await */: - return ["__await"]; - case 4096 /* AsyncGenerator */: - return ["__asyncGenerator"]; - case 8192 /* AsyncDelegator */: - return ["__asyncDelegator"]; - case 16384 /* AsyncValues */: - return ["__asyncValues"]; - case 32768 /* ExportStar */: - return ["__exportStar"]; - case 65536 /* ImportStar */: - return ["__importStar"]; - case 131072 /* ImportDefault */: - return ["__importDefault"]; - case 262144 /* MakeTemplateObject */: - return ["__makeTemplateObject"]; - case 524288 /* ClassPrivateFieldGet */: - return ["__classPrivateFieldGet"]; - case 1048576 /* ClassPrivateFieldSet */: - return ["__classPrivateFieldSet"]; - case 2097152 /* ClassPrivateFieldIn */: - return ["__classPrivateFieldIn"]; - case 4194304 /* SetFunctionName */: - return ["__setFunctionName"]; - case 8388608 /* PropKey */: - return ["__propKey"]; - case 16777216 /* AddDisposableResourceAndDisposeResources */: - return ["__addDisposableResource", "__disposeResources"]; - case 33554432 /* RewriteRelativeImportExtension */: - return ["__rewriteRelativeImportExtension"]; - default: - return Debug.fail("Unrecognized helper"); - } - } - function resolveHelpersModule(file, errorNode) { - const links = getNodeLinks(file); - if (!links.externalHelpersModule) { - links.externalHelpersModule = resolveExternalModule(getImportHelpersImportSpecifier(file), externalHelpersModuleNameText, Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; - } - return links.externalHelpersModule; - } - function checkGrammarModifiers(node) { - var _a; - const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node); - if (quickResult !== void 0) { - return quickResult; - } - 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; - let hasLeadingDecorators = false; - for (const modifier of node.modifiers) { - if (isDecorator(modifier)) { - if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { - if (node.kind === 175 /* 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 === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */)) { - const accessors = getAllAccessorDeclarationsForDeclaration(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 & ~(2080 /* ExportDefault */ | 32768 /* Decorator */)) { - return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); - } - if (hasLeadingDecorators && flags & 98303 /* Modifier */) { - Debug.assertIsDefined(firstDecorator); - const sourceFile = getSourceFileOfNode(modifier); - if (!hasParseDiagnostics(sourceFile)) { - addRelatedInfo( - 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 |= 32768 /* Decorator */; - if (!(flags & 98303 /* Modifier */)) { - hasLeadingDecorators = true; - } else if (flags & 32 /* Export */) { - sawExportBeforeDecorators = true; - } - firstDecorator ?? (firstDecorator = modifier); - } else { - if (modifier.kind !== 148 /* ReadonlyKeyword */) { - if (node.kind === 172 /* PropertySignature */ || node.kind === 174 /* MethodSignature */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); - } - if (node.kind === 182 /* 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 === 169 /* 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 !== 267 /* EnumDeclaration */ && node.kind !== 169 /* TypeParameter */) { - return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(87 /* ConstKeyword */)); - } - const parent2 = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent; - if (node.kind === 169 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); - } - break; - } - case 164 /* OverrideKeyword */: - if (flags & 16 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); - } else if (flags & 128 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); - } else if (flags & 8 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); - } else if (flags & 512 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); - } else if (flags & 1024 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); - } - flags |= 16 /* Override */; - lastOverride = modifier; - break; - case 125 /* PublicKeyword */: - case 124 /* ProtectedKeyword */: - case 123 /* PrivateKeyword */: - const text = visibilityToString(modifierToFlag(modifier.kind)); - if (flags & 7 /* AccessibilityModifier */) { - return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); - } else if (flags & 16 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); - } else if (flags & 256 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } else if (flags & 512 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); - } else if (flags & 8 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); - } else if (flags & 1024 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); - } 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 { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); - } - } else if (isPrivateIdentifierClassElementDeclaration(node)) { - return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); - } - flags |= modifierToFlag(modifier.kind); - break; - case 126 /* StaticKeyword */: - if (flags & 256 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); - } else if (flags & 8 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); - } else if (flags & 1024 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); - } else if (flags & 512 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 170 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } else if (flags & 64 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); - } else if (flags & 16 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); - } - flags |= 256 /* Static */; - lastStatic = modifier; - break; - case 129 /* AccessorKeyword */: - if (flags & 512 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); - } else if (flags & 8 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); - } else if (flags & 128 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 173 /* PropertyDeclaration */) { - return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); - } - flags |= 512 /* Accessor */; - break; - case 148 /* ReadonlyKeyword */: - if (flags & 8 /* Readonly */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 172 /* PropertySignature */ && node.kind !== 182 /* IndexSignature */ && node.kind !== 170 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); - } else if (flags & 512 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); - } - flags |= 8 /* Readonly */; - break; - case 95 /* ExportKeyword */: - if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 266 /* TypeAliasDeclaration */ && node.kind !== 265 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later - node.kind !== 268 /* ModuleDeclaration */ && node.parent.kind === 308 /* SourceFile */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 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 & 32 /* Export */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); - } else if (flags & 128 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } else if (flags & 64 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); - } 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 === 170 /* 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 |= 32 /* Export */; - break; - case 90 /* DefaultKeyword */: - const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 268 /* ModuleDeclaration */ && !isAmbientModule(container)) { - return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); - } 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 |= 2048 /* Default */; - break; - case 138 /* DeclareKeyword */: - if (flags & 128 /* Ambient */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); - } else if (flags & 1024 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } 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 === 170 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } 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 === 269 /* 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 & 512 /* Accessor */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); - } - flags |= 128 /* Ambient */; - lastDeclare = modifier; - break; - case 128 /* AbstractKeyword */: - if (flags & 64 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); - } - if (node.kind !== 264 /* ClassDeclaration */ && node.kind !== 186 /* ConstructorType */) { - if (node.kind !== 175 /* MethodDeclaration */ && node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 178 /* GetAccessor */ && node.kind !== 179 /* SetAccessor */) { - return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); - } - if (!(node.parent.kind === 264 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) { - const message = node.kind === 173 /* 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 & 256 /* Static */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); - } - if (flags & 2 /* Private */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); - } - if (flags & 1024 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } - if (flags & 16 /* Override */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); - } - 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 |= 64 /* Abstract */; - break; - case 134 /* AsyncKeyword */: - if (flags & 1024 /* Async */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); - } 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 === 170 /* Parameter */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); - } - if (flags & 64 /* Abstract */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } - flags |= 1024 /* Async */; - lastAsync = modifier; - break; - case 103 /* InKeyword */: - case 147 /* OutKeyword */: { - const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */; - const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out"; - const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent; - if (node.kind !== 169 /* 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 & 8192 /* In */ && flags & 16384 /* Out */) { - return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); - } - flags |= inOutFlag; - break; - } - } - } - } - if (node.kind === 177 /* Constructor */) { - if (flags & 256 /* Static */) { - return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); - } - if (flags & 16 /* Override */) { - return grammarErrorOnNode(lastOverride, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override"); - } - if (flags & 1024 /* Async */) { - return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async"); - } - return false; - } else if ((node.kind === 273 /* ImportDeclaration */ || node.kind === 272 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) { - return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } else if (node.kind === 170 /* 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 === 170 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) { - return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); - } - if (flags & 1024 /* Async */) { - return checkGrammarAsyncModifier(node, lastAsync); - } - return false; - } - function reportObviousModifierErrors(node) { - if (!node.modifiers) return false; - const modifier = findFirstIllegalModifier(node); - return modifier && grammarErrorOnFirstToken(modifier, Diagnostics.Modifiers_cannot_appear_here); - } - function findFirstModifierExcept(node, allowedModifier) { - const modifier = find(node.modifiers, isModifier); - return modifier && modifier.kind !== allowedModifier ? modifier : void 0; - } - function findFirstIllegalModifier(node) { - switch (node.kind) { - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 177 /* Constructor */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 182 /* IndexSignature */: - case 268 /* ModuleDeclaration */: - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 279 /* ExportDeclaration */: - case 278 /* ExportAssignment */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 170 /* Parameter */: - case 169 /* TypeParameter */: - return void 0; - case 176 /* ClassStaticBlockDeclaration */: - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - case 271 /* NamespaceExportDeclaration */: - case 283 /* MissingDeclaration */: - return find(node.modifiers, isModifier); - default: - if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - return void 0; - } - switch (node.kind) { - case 263 /* FunctionDeclaration */: - return findFirstModifierExcept(node, 134 /* AsyncKeyword */); - case 264 /* ClassDeclaration */: - case 186 /* ConstructorType */: - return findFirstModifierExcept(node, 128 /* AbstractKeyword */); - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - return find(node.modifiers, isModifier); - case 244 /* VariableStatement */: - return node.declarationList.flags & 4 /* Using */ ? findFirstModifierExcept(node, 135 /* AwaitKeyword */) : find(node.modifiers, isModifier); - case 267 /* EnumDeclaration */: - return findFirstModifierExcept(node, 87 /* ConstKeyword */); - default: - Debug.assertNever(node); - } - } - } - function reportObviousDecoratorErrors(node) { - const decorator = findFirstIllegalDecorator(node); - return decorator && grammarErrorOnFirstToken(decorator, Diagnostics.Decorators_are_not_valid_here); - } - function findFirstIllegalDecorator(node) { - return canHaveIllegalDecorators(node) ? find(node.modifiers, isDecorator) : void 0; - } - function checkGrammarAsyncModifier(node, asyncModifier) { - switch (node.kind) { - case 175 /* MethodDeclaration */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return false; - } - return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async"); - } - function checkGrammarForDisallowedTrailingComma(list, diag2 = Diagnostics.Trailing_comma_not_allowed) { - if (list && list.hasTrailingComma) { - return grammarErrorAtPos(list[0], list.end - ",".length, ",".length, diag2); - } - return false; - } - function checkGrammarTypeParameterList(typeParameters, file) { - if (typeParameters && typeParameters.length === 0) { - const start = typeParameters.pos - "<".length; - const end = skipTrivia(file.text, typeParameters.end) + ">".length; - return grammarErrorAtPos(file, start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); - } - return false; - } - function checkGrammarParameterList(parameters) { - let seenOptionalParameter = false; - const parameterCount = parameters.length; - for (let i = 0; i < parameterCount; i++) { - const parameter = parameters[i]; - if (parameter.dotDotDotToken) { - if (i !== parameterCount - 1) { - return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - } - if (!(parameter.flags & 33554432 /* Ambient */)) { - checkGrammarForDisallowedTrailingComma(parameters, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - } - if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_rest_parameter_cannot_be_optional); - } - if (parameter.initializer) { - return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); - } - } else if (hasEffectiveQuestionToken(parameter)) { - seenOptionalParameter = true; - if (parameter.questionToken && parameter.initializer) { - return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - } - } else if (seenOptionalParameter && !parameter.initializer) { - return grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - } - } - } - function getNonSimpleParameters(parameters) { - return filter(parameters, (parameter) => !!parameter.initializer || isBindingPattern(parameter.name) || isRestParameter(parameter)); - } - function checkGrammarForUseStrictSimpleParameterList(node) { - if (languageVersion >= 3 /* ES2016 */) { - const useStrictDirective = node.body && isBlock(node.body) && findUseStrictPrologue(node.body.statements); - if (useStrictDirective) { - const nonSimpleParameters = getNonSimpleParameters(node.parameters); - if (length(nonSimpleParameters)) { - forEach(nonSimpleParameters, (parameter) => { - addRelatedInfo( - 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(error2(useStrictDirective, Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...diagnostics2); - return true; - } - } - } - return false; - } - function checkGrammarFunctionLikeDeclaration(node) { - const file = getSourceFileOfNode(node); - return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); - } - function checkGrammarClassLikeDeclaration(node) { - const file = getSourceFileOfNode(node); - return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); - } - function checkGrammarArrowFunction(node, file) { - if (!isArrowFunction(node)) { - return false; - } - if (node.typeParameters && !(length(node.typeParameters) > 1 || node.typeParameters.hasTrailingComma || node.typeParameters[0].constraint)) { - if (file && fileExtensionIsOneOf(file.fileName, [".mts" /* Mts */, ".cts" /* Cts */])) { - grammarErrorOnNode(node.typeParameters[0], Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint); - } - } - const { equalsGreaterThanToken } = node; - const startLine = getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; - const endLine = getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; - return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, Diagnostics.Line_terminator_not_permitted_before_arrow); - } - function checkGrammarIndexSignatureParameters(node) { - const parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - if (parameter) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_must_have_exactly_one_parameter); - } else { - return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_exactly_one_parameter); - } - } - checkGrammarForDisallowedTrailingComma(node.parameters, Diagnostics.An_index_signature_cannot_have_a_trailing_comma); - if (parameter.dotDotDotToken) { - return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - } - if (hasEffectiveModifiers(parameter)) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - } - if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - } - if (parameter.initializer) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - } - if (!parameter.type) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - } - const type = getTypeFromTypeNode(parameter.type); - if (someType(type, (t) => !!(t.flags & 8576 /* StringOrNumberLiteralOrUnique */)) || isGenericType(type)) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead); - } - if (!everyType(type, isValidIndexKeyType)) { - return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type); - } - if (!node.type) { - return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation); - } - return false; - } - function checkGrammarIndexSignature(node) { - return checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node); - } - function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { - if (typeArguments && typeArguments.length === 0) { - const sourceFile = getSourceFileOfNode(node); - const start = typeArguments.pos - "<".length; - const end = skipTrivia(sourceFile.text, typeArguments.end) + ">".length; - return grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Type_argument_list_cannot_be_empty); - } - return false; - } - function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); - } - function checkGrammarTaggedTemplateChain(node) { - if (node.questionDotToken || node.flags & 64 /* OptionalChain */) { - return grammarErrorOnNode(node.template, Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain); - } - return false; - } - function checkGrammarHeritageClause(node) { - const types = node.types; - if (checkGrammarForDisallowedTrailingComma(types)) { - return true; - } - if (types && types.length === 0) { - const listType = tokenToString(node.token); - return grammarErrorAtPos(node, types.pos, 0, Diagnostics._0_list_cannot_be_empty, listType); - } - return some(types, checkGrammarExpressionWithTypeArguments); - } - function checkGrammarExpressionWithTypeArguments(node) { - if (isExpressionWithTypeArguments(node) && isImportKeyword(node.expression) && node.typeArguments) { - return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); - } - return checkGrammarTypeArguments(node, node.typeArguments); - } - function checkGrammarClassDeclarationHeritageClauses(node) { - let seenExtendsClause = false; - let seenImplementsClause = false; - if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (const heritageClause of node.heritageClauses) { - if (heritageClause.token === 96 /* ExtendsKeyword */) { - if (seenExtendsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen); - } - if (seenImplementsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_must_precede_implements_clause); - } - if (heritageClause.types.length > 1) { - return grammarErrorOnFirstToken(heritageClause.types[1], Diagnostics.Classes_can_only_extend_a_single_class); - } - seenExtendsClause = true; - } else { - Debug.assert(heritageClause.token === 119 /* ImplementsKeyword */); - if (seenImplementsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.implements_clause_already_seen); - } - seenImplementsClause = true; - } - checkGrammarHeritageClause(heritageClause); - } - } - } - function checkGrammarInterfaceDeclaration(node) { - let seenExtendsClause = false; - if (node.heritageClauses) { - for (const heritageClause of node.heritageClauses) { - if (heritageClause.token === 96 /* ExtendsKeyword */) { - if (seenExtendsClause) { - return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen); - } - seenExtendsClause = true; - } else { - Debug.assert(heritageClause.token === 119 /* ImplementsKeyword */); - return grammarErrorOnFirstToken(heritageClause, Diagnostics.Interface_declaration_cannot_have_implements_clause); - } - checkGrammarHeritageClause(heritageClause); - } - } - return false; - } - function checkGrammarComputedPropertyName(node) { - if (node.kind !== 168 /* ComputedPropertyName */) { - return false; - } - const computedPropertyName = node; - if (computedPropertyName.expression.kind === 227 /* 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; - } - function checkGrammarForGenerator(node) { - if (node.asteriskToken) { - Debug.assert( - node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */ || node.kind === 175 /* MethodDeclaration */ - ); - if (node.flags & 33554432 /* Ambient */) { - return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context); - } - if (!node.body) { - return grammarErrorOnNode(node.asteriskToken, Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); - } - } - } - function checkGrammarForInvalidQuestionMark(questionToken, message) { - return !!questionToken && grammarErrorOnNode(questionToken, message); - } - function checkGrammarForInvalidExclamationToken(exclamationToken, message) { - return !!exclamationToken && grammarErrorOnNode(exclamationToken, message); - } - function checkGrammarObjectLiteralExpression(node, inDestructuring) { - const seen = /* @__PURE__ */ new Map(); - for (const prop of node.properties) { - if (prop.kind === 306 /* SpreadAssignment */) { - if (inDestructuring) { - const expression = skipParentheses(prop.expression); - if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) { - return grammarErrorOnNode(prop.expression, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); - } - } - continue; - } - const name = prop.name; - if (name.kind === 168 /* ComputedPropertyName */) { - checkGrammarComputedPropertyName(name); - } - if (prop.kind === 305 /* 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 */) { - grammarErrorOnNode(name, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); - } - if (canHaveModifiers(prop) && prop.modifiers) { - for (const mod of prop.modifiers) { - if (isModifier(mod) && (mod.kind !== 134 /* AsyncKeyword */ || prop.kind !== 175 /* MethodDeclaration */)) { - grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); - } - } - } else if (canHaveIllegalModifiers(prop) && prop.modifiers) { - for (const mod of prop.modifiers) { - if (isModifier(mod)) { - grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); - } - } - } - let currentKind; - switch (prop.kind) { - case 305 /* ShorthandPropertyAssignment */: - case 304 /* 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 */) { - checkGrammarNumericLiteral(name); - } - if (name.kind === 10 /* BigIntLiteral */) { - addErrorOrSuggestion( - /*isError*/ - true, - createDiagnosticForNode(name, Diagnostics.A_bigint_literal_cannot_be_used_as_a_property_name) - ); - } - currentKind = 4 /* PropertyAssignment */; - break; - case 175 /* MethodDeclaration */: - currentKind = 8 /* Method */; - break; - case 178 /* GetAccessor */: - currentKind = 1 /* GetAccessor */; - break; - case 179 /* SetAccessor */: - currentKind = 2 /* SetAccessor */; - break; - default: - Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind); - } - if (!inDestructuring) { - const effectiveName = getEffectivePropertyNameForPropertyNameNode(name); - if (effectiveName === void 0) { - continue; - } - const existingKind = seen.get(effectiveName); - if (!existingKind) { - seen.set(effectiveName, currentKind); - } else { - if (currentKind & 8 /* Method */ && existingKind & 8 /* Method */) { - grammarErrorOnNode(name, Diagnostics.Duplicate_identifier_0, getTextOfNode(name)); - } else if (currentKind & 4 /* PropertyAssignment */ && existingKind & 4 /* PropertyAssignment */) { - grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, getTextOfNode(name)); - } else if (currentKind & 3 /* GetOrSetAccessor */ && existingKind & 3 /* GetOrSetAccessor */) { - if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) { - seen.set(effectiveName, currentKind | existingKind); - } else { - return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } else { - return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - } - } - } - function checkGrammarJsxElement(node) { - checkGrammarJsxName(node.tagName); - checkGrammarTypeArguments(node, node.typeArguments); - const seen = /* @__PURE__ */ new Map(); - for (const attr of node.attributes.properties) { - if (attr.kind === 294 /* JsxSpreadAttribute */) { - continue; - } - const { name, initializer } = attr; - const escapedText = getEscapedTextOfJsxAttributeName(name); - if (!seen.get(escapedText)) { - seen.set(escapedText, true); - } else { - return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); - } - if (initializer && initializer.kind === 295 /* JsxExpression */ && !initializer.expression) { - return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); - } - } - } - function checkGrammarJsxName(node) { - if (isPropertyAccessExpression(node) && isJsxNamespacedName(node.expression)) { - return grammarErrorOnNode(node.expression, Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names); - } - if (isJsxNamespacedName(node) && getJSXTransformEnabled(compilerOptions) && !isIntrinsicJsxName(node.namespace.escapedText)) { - return grammarErrorOnNode(node, Diagnostics.React_components_cannot_include_JSX_namespace_names); - } - } - function checkGrammarJsxExpression(node) { - if (node.expression && isCommaSequence(node.expression)) { - return grammarErrorOnNode(node.expression, Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array); - } - } - function checkGrammarForInOrForOfStatement(forInOrOfStatement) { - if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { - return true; - } - if (forInOrOfStatement.kind === 251 /* 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)); - } - switch (moduleKind) { - case 100 /* Node16 */: - case 101 /* Node18 */: - case 102 /* Node20 */: - case 199 /* NodeNext */: - if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) { - diagnostics.add( - createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level) - ); - break; - } - // fallthrough - case 7 /* ES2022 */: - case 99 /* ESNext */: - case 200 /* Preserve */: - case 4 /* System */: - if (languageVersion >= 4 /* ES2017 */) { - break; - } - // fallthrough - 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_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher) - ); - break; - } - } - } else { - 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 !== 177 /* 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); - } - diagnostics.add(diagnostic); - return true; - } - } - } - } - 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 === 262 /* VariableDeclarationList */) { - const variableList = forInOrOfStatement.initializer; - if (!checkGrammarVariableDeclarationList(variableList)) { - const declarations = variableList.declarations; - if (!declarations.length) { - return false; - } - if (declarations.length > 1) { - const diagnostic = forInOrOfStatement.kind === 250 /* 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 === 250 /* 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 === 250 /* 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); - } - } - } - return false; - } - function checkGrammarAccessor(accessor) { - if (!(accessor.flags & 33554432 /* Ambient */) && accessor.parent.kind !== 188 /* TypeLiteral */ && accessor.parent.kind !== 265 /* InterfaceDeclaration */) { - 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, 64 /* Abstract */)) { - return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); - } - } - if (accessor.body) { - if (hasSyntacticModifier(accessor, 64 /* Abstract */)) { - return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation); - } - if (accessor.parent.kind === 188 /* TypeLiteral */ || accessor.parent.kind === 265 /* InterfaceDeclaration */) { - return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); - } - } - if (accessor.typeParameters) { - return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); - } - if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode( - accessor.name, - accessor.kind === 178 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter - ); - } - if (accessor.kind === 179 /* SetAccessor */) { - if (accessor.type) { - return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - const parameter = Debug.checkDefined(getSetAccessorValueParameter(accessor), "Return value does not match parameter count assertion."); - if (parameter.dotDotDotToken) { - return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - if (parameter.initializer) { - return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - return false; - } - function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 178 /* GetAccessor */ ? 0 : 1); - } - function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 178 /* GetAccessor */ ? 1 : 2)) { - return getThisParameter(accessor); - } - } - function checkGrammarTypeOperatorNode(node) { - if (node.operator === 158 /* UniqueKeyword */) { - if (node.type.kind !== 155 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, Diagnostics._0_expected, tokenToString(155 /* SymbolKeyword */)); - } - let parent2 = walkUpParenthesizedTypes(node.parent); - if (isInJSFile(parent2) && isJSDocTypeExpression(parent2)) { - const host2 = getJSDocHost(parent2); - if (host2) { - parent2 = getSingleVariableOfVariableStatement(host2) || host2; - } - } - switch (parent2.kind) { - case 261 /* 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); - } - if (!isVariableDeclarationInVariableStatement(decl)) { - return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement); - } - if (!(decl.parent.flags & 2 /* Const */)) { - return grammarErrorOnNode(parent2.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); - } - break; - case 173 /* 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 172 /* 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; - default: - return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here); - } - } else if (node.operator === 148 /* ReadonlyKeyword */) { - if (node.type.kind !== 189 /* ArrayType */ && node.type.kind !== 190 /* TupleType */) { - return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(155 /* SymbolKeyword */)); - } - } - } - function checkGrammarForInvalidDynamicName(node, message) { - if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) { - return grammarErrorOnNode(node, message); - } - } - function checkGrammarMethod(node) { - if (checkGrammarFunctionLikeDeclaration(node)) { - return true; - } - if (node.kind === 175 /* MethodDeclaration */) { - if (node.parent.kind === 211 /* 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)) { - return true; - } else if (checkGrammarForInvalidExclamationToken(node.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context)) { - return true; - } else if (node.body === void 0) { - return grammarErrorAtPos(node, node.end - 1, ";".length, Diagnostics._0_expected, "{"); - } - } - if (checkGrammarForGenerator(node)) { - return true; - } - } - if (isClassLike(node.parent)) { - 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 & 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 === 175 /* 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 === 265 /* 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 === 188 /* 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); - } - } - function checkGrammarBreakOrContinueStatement(node) { - let current = node; - while (current) { - if (isFunctionLikeOrClassStaticBlockDeclaration(current)) { - return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); - } - switch (current.kind) { - case 257 /* LabeledStatement */: - if (node.label && current.label.escapedText === node.label.escapedText) { - const isMisplacedContinueLabel = node.kind === 252 /* ContinueStatement */ && !isIterationStatement( - current.statement, - /*lookInLabeledStatements*/ - true - ); - if (isMisplacedContinueLabel) { - return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - return false; - } - break; - case 256 /* SwitchStatement */: - if (node.kind === 253 /* BreakStatement */ && !node.label) { - return false; - } - break; - default: - if (isIterationStatement( - current, - /*lookInLabeledStatements*/ - false - ) && !node.label) { - return false; - } - break; - } - current = current.parent; - } - if (node.label) { - const message = node.kind === 253 /* 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 === 253 /* 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); - } - } - function checkGrammarBindingElement(node) { - if (node.dotDotDotToken) { - const elements = node.parent.elements; - if (node !== last(elements)) { - return grammarErrorOnNode(node, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); - } - checkGrammarForDisallowedTrailingComma(elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - if (node.propertyName) { - return grammarErrorOnNode(node.name, Diagnostics.A_rest_element_cannot_have_a_property_name); - } - } - if (node.dotDotDotToken && node.initializer) { - return grammarErrorAtPos(node, node.initializer.pos - 1, 1, Diagnostics.A_rest_element_cannot_have_an_initializer); - } - } - function isStringOrNumberLiteralExpression(expr) { - return isStringOrNumericLiteralLike(expr) || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 9 /* NumericLiteral */; - } - function isBigIntLiteralExpression(expr) { - return expr.kind === 10 /* BigIntLiteral */ || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 10 /* BigIntLiteral */; - } - function isSimpleLiteralEnumReference(expr) { - if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { - return !!(checkExpressionCached(expr).flags & 1056 /* EnumLike */); - } - } - function checkAmbientInitializer(node) { - 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) && isVarConstLike2(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); - } - } else { - return grammarErrorOnNode(initializer, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - } - } - function checkGrammarVariableDeclaration(node) { - 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 !== 250 /* ForInStatement */ && node.parent.parent.kind !== 251 /* 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); - } - 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 !== 244 /* 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 (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent, 32 /* Export */)) { - checkESModuleMarker(node.name); - } - return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name); - } - function checkESModuleMarker(name) { - if (name.kind === 80 /* Identifier */) { - if (idText(name) === "__esModule") { - return grammarErrorOnNodeSkippedOn("noEmit", name, Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); - } - } else { - const elements = name.elements; - for (const element of elements) { - if (!isOmittedExpression(element)) { - return checkESModuleMarker(element.name); - } - } - } - return false; - } - function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 80 /* Identifier */) { - if (name.escapedText === "let") { - return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); - } - } else { - const elements = name.elements; - for (const element of elements) { - if (!isOmittedExpression(element)) { - checkGrammarNameInLetOrConstDeclarations(element.name); - } - } - } - return false; - } - function checkGrammarVariableDeclarationList(declarationList) { - const declarations = declarationList.declarations; - if (checkGrammarForDisallowedTrailingComma(declarationList.declarations)) { - return true; - } - 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 */) { - if (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 (declarationList.flags & 33554432 /* Ambient */) { - return grammarErrorOnNode( - declarationList, - blockScopeFlags === 4 /* Using */ ? Diagnostics.using_declarations_are_not_allowed_in_ambient_contexts : Diagnostics.await_using_declarations_are_not_allowed_in_ambient_contexts - ); - } - if (blockScopeFlags === 6 /* AwaitUsing */) { - return checkAwaitGrammar(declarationList); - } - } - return false; - } - function allowBlockDeclarations(parent2) { - switch (parent2.kind) { - case 246 /* IfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 255 /* WithStatement */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - return false; - case 257 /* LabeledStatement */: - return allowBlockDeclarations(parent2.parent); - } - return true; - } - function checkGrammarForDisallowedBlockScopedVariableStatement(node) { - if (!allowBlockDeclarations(node.parent)) { - 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"); - error2(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, keyword); - } - } - } - function checkGrammarMetaProperty(node) { - const escapedText = node.name.escapedText; - switch (node.keywordToken) { - case 105 /* NewKeyword */: - if (escapedText !== "target") { - return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "target"); - } - break; - case 102 /* ImportKeyword */: - if (escapedText !== "meta") { - const isCallee = isCallExpression(node.parent) && node.parent.expression === node; - if (escapedText === "defer") { - if (!isCallee) { - return grammarErrorAtPos(node, node.end, 0, Diagnostics._0_expected, "("); - } - } else { - if (isCallee) { - return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer, unescapeLeadingUnderscores(node.name.escapedText)); - } - return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "meta"); - } - } - break; - } - } - function hasParseDiagnostics(sourceFile) { - return sourceFile.parseDiagnostics.length > 0; - } - function grammarErrorOnFirstToken(node, message, ...args) { - const sourceFile = getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - const span = getSpanOfTokenAtPosition(sourceFile, node.pos); - diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message, ...args)); - return true; - } - return false; - } - function grammarErrorAtPos(nodeForSourceFile, start, length2, message, ...args) { - const sourceFile = getSourceFileOfNode(nodeForSourceFile); - if (!hasParseDiagnostics(sourceFile)) { - diagnostics.add(createFileDiagnostic(sourceFile, start, length2, message, ...args)); - return true; - } - return false; - } - function grammarErrorOnNodeSkippedOn(key, node, message, ...args) { - const sourceFile = getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - errorSkippedOn(key, node, message, ...args); - return true; - } - return false; - } - function grammarErrorOnNode(node, message, ...args) { - const sourceFile = getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - error2(node, message, ...args); - return true; - } - return false; - } - function checkGrammarConstructorTypeParameters(node) { - const jsdocTypeParameters = isInJSFile(node) ? getJSDocTypeParameterDeclarations(node) : void 0; - const range = node.typeParameters || jsdocTypeParameters && firstOrUndefined(jsdocTypeParameters); - if (range) { - const pos = range.pos === range.end ? range.pos : skipTrivia(getSourceFileOfNode(node).text, range.pos); - return grammarErrorAtPos(node, pos, range.end - pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - } - function checkGrammarConstructorTypeAnnotation(node) { - const type = node.type || getEffectiveReturnTypeNode(node); - if (type) { - return grammarErrorOnNode(type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } - } - function checkGrammarProperty(node) { - if (isComputedPropertyName(node.name) && isBinaryExpression(node.name.expression) && node.name.expression.operatorToken.kind === 103 /* InKeyword */) { - return grammarErrorOnNode(node.parent.members[0], Diagnostics.A_mapped_type_may_not_declare_properties_or_methods); - } - if (isClassLike(node.parent)) { - if (isStringLiteral(node.name) && node.name.text === "constructor") { - return grammarErrorOnNode(node.name, Diagnostics.Classes_may_not_have_a_field_named_constructor); - } - if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type)) { - return true; - } - if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(node.name)) { - return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); - } - if (languageVersion < 2 /* ES2015 */ && isAutoAccessorPropertyDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) { - return grammarErrorOnNode(node.name, Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher); - } - if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) { - return true; - } - } else if (node.parent.kind === 265 /* 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; - } - Debug.assertNode(node, isPropertySignature); - if (node.initializer) { - return grammarErrorOnNode(node.initializer, Diagnostics.An_interface_property_cannot_have_an_initializer); - } - } else if (isTypeLiteralNode(node.parent)) { - if (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)) { - return true; - } - Debug.assertNode(node, isPropertySignature); - if (node.initializer) { - return grammarErrorOnNode(node.initializer, Diagnostics.A_type_literal_property_cannot_have_an_initializer); - } - } - if (node.flags & 33554432 /* Ambient */) { - checkAmbientInitializer(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 === 265 /* InterfaceDeclaration */ || node.kind === 266 /* TypeAliasDeclaration */ || node.kind === 273 /* ImportDeclaration */ || node.kind === 272 /* ImportEqualsDeclaration */ || node.kind === 279 /* ExportDeclaration */ || node.kind === 278 /* ExportAssignment */ || node.kind === 271 /* 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 === 244 /* VariableStatement */) { - if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { - return true; - } - } - } - return false; - } - function checkGrammarSourceFile(node) { - return !!(node.flags & 33554432 /* Ambient */) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); - } - function checkGrammarStatementInAmbientContext(node) { - 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 === 242 /* Block */ || node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { - const links2 = getNodeLinks(node.parent); - if (!links2.hasReportedStatementInAmbientContext) { - return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - } else { - } - } - return false; - } - function checkGrammarNumericLiteral(node) { - const isFractional = getTextOfNode(node).includes("."); - const isScientific = node.numericLiteralFlags & 16 /* Scientific */; - if (isFractional || isScientific) { - return; - } - const value = +node.text; - if (value <= 2 ** 53 - 1) { - return; - } - addErrorOrSuggestion( - /*isError*/ - false, - createDiagnosticForNode(node, Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers) - ); - } - function checkGrammarBigIntLiteral(node) { - const literalType = isLiteralTypeNode(node.parent) || isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent); - if (!literalType) { - if (!(node.flags & 33554432 /* Ambient */) && languageVersion < 7 /* ES2020 */) { - if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) { - return true; - } - } - } - return false; - } - function grammarErrorAfterFirstToken(node, message, ...args) { - const sourceFile = getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - const span = getSpanOfTokenAtPosition(sourceFile, node.pos); - diagnostics.add(createFileDiagnostic( - sourceFile, - textSpanEnd(span), - /*length*/ - 0, - message, - ...args - )); - return true; - } - return false; - } - function getAmbientModules() { - if (!ambientModulesCache) { - ambientModulesCache = []; - globals.forEach((global2, sym) => { - if (ambientModuleSymbolRegex.test(sym)) { - ambientModulesCache.push(global2); - } - }); - } - return ambientModulesCache; - } - function checkGrammarImportClause(node) { - var _a, _b; - if (node.phaseModifier === 156 /* TypeKeyword */) { - if (node.name && node.namedBindings) { - return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); - } - if (((_a = node.namedBindings) == null ? void 0 : _a.kind) === 276 /* NamedImports */) { - return checkGrammarNamedImportsOrExports(node.namedBindings); - } - } else if (node.phaseModifier === 166 /* DeferKeyword */) { - if (node.name) { - return grammarErrorOnNode(node, Diagnostics.Default_imports_are_not_allowed_in_a_deferred_import); - } - if (((_b = node.namedBindings) == null ? void 0 : _b.kind) === 276 /* NamedImports */) { - return grammarErrorOnNode(node, Diagnostics.Named_imports_are_not_allowed_in_a_deferred_import); - } - if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) { - return grammarErrorOnNode(node, Diagnostics.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve); - } - } - return false; - } - function checkGrammarNamedImportsOrExports(namedBindings) { - return !!forEach(namedBindings.elements, (specifier) => { - if (specifier.isTypeOnly) { - return grammarErrorOnFirstToken( - specifier, - specifier.kind === 277 /* 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 - ); - } - }); - } - function checkGrammarImportCallExpression(node) { - if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { - return grammarErrorOnNode(node, getVerbatimModuleSyntaxErrorMessage(node)); - } - if (node.expression.kind === 237 /* MetaProperty */) { - if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) { - return grammarErrorOnNode(node, Diagnostics.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve); - } - } else if (moduleKind === 5 /* ES2015 */) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext); - } - if (node.typeArguments) { - return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); - } - const nodeArguments = node.arguments; - if (!(100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) && moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) { - checkGrammarForDisallowedTrailingComma(nodeArguments); - if (nodeArguments.length > 1) { - const importAttributesArgument = nodeArguments[1]; - return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve); - } - } - if (nodeArguments.length === 0 || nodeArguments.length > 2) { - 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) { - return grammarErrorOnNode(spreadElement, Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element); - } - return false; - } - function findMatchingTypeReferenceOrTypeAliasReference(source, unionTarget) { - const sourceObjectFlags = getObjectFlags(source); - if (sourceObjectFlags & (4 /* Reference */ | 16 /* Anonymous */) && unionTarget.flags & 1048576 /* Union */) { - return find(unionTarget.types, (target) => { - if (target.flags & 524288 /* Object */) { - const overlapObjFlags = sourceObjectFlags & getObjectFlags(target); - if (overlapObjFlags & 4 /* Reference */) { - return source.target === target.target; - } - if (overlapObjFlags & 16 /* Anonymous */) { - return !!source.aliasSymbol && source.aliasSymbol === target.aliasSymbol; - } - } - return false; - }); - } - } - function findBestTypeForObjectLiteral(source, unionTarget) { - if (getObjectFlags(source) & 128 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) { - return find(unionTarget.types, (t) => !isArrayLikeType(t)); - } - } - function findBestTypeForInvokable(source, unionTarget) { - let signatureKind = 0 /* Call */; - const hasSignatures2 = getSignaturesOfType(source, signatureKind).length > 0 || (signatureKind = 1 /* Construct */, getSignaturesOfType(source, signatureKind).length > 0); - if (hasSignatures2) { - return find(unionTarget.types, (t) => getSignaturesOfType(t, signatureKind).length > 0); - } - } - function findMostOverlappyType(source, unionTarget) { - let bestMatch; - if (!(source.flags & (402784252 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { - let matchingCount = 0; - for (const target of unionTarget.types) { - if (!(target.flags & (402784252 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) { - const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); - if (overlap.flags & 4194304 /* Index */) { - return target; - } else if (isUnitType(overlap) || overlap.flags & 1048576 /* Union */) { - const len = overlap.flags & 1048576 /* Union */ ? countWhere(overlap.types, isUnitType) : 1; - if (len >= matchingCount) { - bestMatch = target; - matchingCount = len; - } - } - } - } - } - return bestMatch; - } - function filterPrimitivesIfContainsNonPrimitive(type) { - if (maybeTypeOfKind(type, 67108864 /* NonPrimitive */)) { - const result = filterType(type, (t) => !(t.flags & 402784252 /* Primitive */)); - if (!(result.flags & 131072 /* Never */)) { - return result; - } - } - return type; - } - function findMatchingDiscriminantType(source, target, isRelatedTo) { - if (target.flags & 1048576 /* Union */ && source.flags & (2097152 /* Intersection */ | 524288 /* Object */)) { - const match = getMatchingUnionConstituentForType(target, source); - if (match) { - return match; - } - const sourceProperties = getPropertiesOfType(source); - if (sourceProperties) { - const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target); - if (sourcePropertiesFiltered) { - const discriminated = discriminateTypeByDiscriminableItems(target, map(sourcePropertiesFiltered, (p) => [() => getTypeOfSymbol(p), p.escapedName]), isRelatedTo); - if (discriminated !== target) { - return discriminated; - } - } - } - } - return void 0; - } - function getEffectivePropertyNameForPropertyNameNode(node) { - const name = getPropertyNameForPropertyNameNode(node); - 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 isVarConstLike2(node) { - const blockScopeKind = getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */; - return blockScopeKind === 2 /* Const */ || blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */; - } - function getJSXRuntimeImportSpecifier(file, specifierText) { - const jsxImportIndex = compilerOptions.importHelpers ? 1 : 0; - const specifier = file == null ? void 0 : file.imports[jsxImportIndex]; - if (specifier) { - Debug.assert(nodeIsSynthesized(specifier) && specifier.text === specifierText, `Expected sourceFile.imports[${jsxImportIndex}] to be the synthesized JSX runtime import`); - } - return specifier; - } - function getImportHelpersImportSpecifier(file) { - Debug.assert(compilerOptions.importHelpers, "Expected importHelpers to be enabled"); - const specifier = file.imports[0]; - Debug.assert(specifier && nodeIsSynthesized(specifier) && specifier.text === "tslib", `Expected sourceFile.imports[0] to be the synthesized tslib import`); - return specifier; - } -} -function isNotAccessor(declaration) { - return !isAccessor(declaration); -} -function isNotOverload(declaration) { - return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 175 /* MethodDeclaration */ || !!declaration.body; -} -function isDeclarationNameOrImportPropertyName(name) { - switch (name.parent.kind) { - case 277 /* ImportSpecifier */: - case 282 /* ExportSpecifier */: - return isIdentifier(name) || name.kind === 11 /* StringLiteral */; - default: - return isDeclarationName(name); - } -} -var JsxNames; -((JsxNames2) => { - JsxNames2.JSX = "JSX"; - JsxNames2.IntrinsicElements = "IntrinsicElements"; - JsxNames2.ElementClass = "ElementClass"; - JsxNames2.ElementAttributesPropertyNameContainer = "ElementAttributesProperty"; - JsxNames2.ElementChildrenAttributeNameContainer = "ElementChildrenAttribute"; - JsxNames2.Element = "Element"; - JsxNames2.ElementType = "ElementType"; - JsxNames2.IntrinsicAttributes = "IntrinsicAttributes"; - JsxNames2.IntrinsicClassAttributes = "IntrinsicClassAttributes"; - JsxNames2.LibraryManagedAttributes = "LibraryManagedAttributes"; -})(JsxNames || (JsxNames = {})); -var ReactNames; -((ReactNames2) => { - ReactNames2.Fragment = "Fragment"; -})(ReactNames || (ReactNames = {})); -function getIterationTypesKeyFromIterationTypeKind(typeKind) { - switch (typeKind) { - case 0 /* Yield */: - return "yieldType"; - case 1 /* Return */: - return "returnType"; - case 2 /* Next */: - return "nextType"; - } -} -function signatureHasRestParameter(s) { - return !!(s.flags & 1 /* HasRestParameter */); -} -function signatureHasLiteralTypes(s) { - return !!(s.flags & 2 /* HasLiteralTypes */); -} -function createBasicNodeBuilderModuleSpecifierResolutionHost(host) { - return { - getCommonSourceDirectory: !!host.getCommonSourceDirectory ? () => host.getCommonSourceDirectory() : () => "", - getCurrentDirectory: () => host.getCurrentDirectory(), - getSymlinkCache: maybeBind(host, host.getSymlinkCache), - getPackageJsonInfoCache: () => { - var _a; - return (_a = host.getPackageJsonInfoCache) == null ? void 0 : _a.call(host); - }, - useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), - redirectTargetsMap: host.redirectTargetsMap, - getRedirectFromSourceFile: (fileName) => host.getRedirectFromSourceFile(fileName), - isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName), - fileExists: (fileName) => host.fileExists(fileName), - getFileIncludeReasons: () => host.getFileIncludeReasons(), - readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0, - getDefaultResolutionModeForFile: (file) => host.getDefaultResolutionModeForFile(file), - getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index), - getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation) - }; -} -var SymbolTrackerImpl = class _SymbolTrackerImpl { - constructor(context, tracker, moduleResolverHost) { - this.moduleResolverHost = void 0; - this.inner = void 0; - this.disableTrackSymbol = false; - var _a; - while (tracker instanceof _SymbolTrackerImpl) { - tracker = tracker.inner; - } - this.inner = tracker; - this.moduleResolverHost = moduleResolverHost; - this.context = context; - this.canTrackSymbol = !!((_a = this.inner) == null ? void 0 : _a.trackSymbol); - } - trackSymbol(symbol, enclosingDeclaration, meaning) { - 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; - } - reportInaccessibleThisError() { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportInaccessibleThisError) { - this.onDiagnosticReported(); - this.inner.reportInaccessibleThisError(); - } - } - reportPrivateInBaseOfClassExpression(propertyName) { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportPrivateInBaseOfClassExpression) { - this.onDiagnosticReported(); - this.inner.reportPrivateInBaseOfClassExpression(propertyName); - } - } - reportInaccessibleUniqueSymbolError() { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportInaccessibleUniqueSymbolError) { - this.onDiagnosticReported(); - this.inner.reportInaccessibleUniqueSymbolError(); - } - } - reportCyclicStructureError() { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportCyclicStructureError) { - this.onDiagnosticReported(); - this.inner.reportCyclicStructureError(); - } - } - reportLikelyUnsafeImportRequiredError(specifier) { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportLikelyUnsafeImportRequiredError) { - this.onDiagnosticReported(); - this.inner.reportLikelyUnsafeImportRequiredError(specifier); - } - } - reportTruncationError() { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportTruncationError) { - this.onDiagnosticReported(); - this.inner.reportTruncationError(); - } - } - reportNonlocalAugmentation(containingFile, parentSymbol, augmentingSymbol) { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportNonlocalAugmentation) { - this.onDiagnosticReported(); - this.inner.reportNonlocalAugmentation(containingFile, parentSymbol, augmentingSymbol); - } - } - reportNonSerializableProperty(propertyName) { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportNonSerializableProperty) { - this.onDiagnosticReported(); - this.inner.reportNonSerializableProperty(propertyName); - } - } - onDiagnosticReported() { - this.context.reportedDiagnostic = true; - } - reportInferenceFallback(node) { - var _a; - if (((_a = this.inner) == null ? void 0 : _a.reportInferenceFallback) && !this.context.suppressReportInferenceFallback) { - this.onDiagnosticReported(); - this.inner.reportInferenceFallback(node); - } - } - pushErrorFallbackNode(node) { - var _a, _b; - return (_b = (_a = this.inner) == null ? void 0 : _a.pushErrorFallbackNode) == null ? void 0 : _b.call(_a, node); - } - popErrorFallbackNode() { - var _a, _b; - return (_b = (_a = this.inner) == null ? void 0 : _a.popErrorFallbackNode) == null ? void 0 : _b.call(_a); - } -}; - -// src/compiler/visitorPublic.ts -function visitNode(node, visitor, test, lift) { - if (node === void 0) { - return node; - } - const visited = visitor(node); - let visitedNode; - if (visited === void 0) { - return void 0; - } else if (isArray(visited)) { - visitedNode = (lift || extractSingleNode)(visited); - } else { - visitedNode = visited; - } - Debug.assertNode(visitedNode, test); - return visitedNode; -} -function visitNodes2(nodes, visitor, test, start, count) { - if (nodes === void 0) { - return nodes; - } - const length2 = nodes.length; - if (start === void 0 || start < 0) { - start = 0; - } - if (count === void 0 || count > length2 - start) { - count = length2 - start; - } - let hasTrailingComma; - let pos = -1; - let end = -1; - if (start > 0 || count < length2) { - hasTrailingComma = nodes.hasTrailingComma && start + count === length2; - } else { - pos = nodes.pos; - end = nodes.end; - hasTrailingComma = nodes.hasTrailingComma; - } - const updated = visitArrayWorker(nodes, visitor, test, start, count); - if (updated !== nodes) { - const updatedArray = factory.createNodeArray(updated, hasTrailingComma); - setTextRangePosEnd(updatedArray, pos, end); - return updatedArray; - } - return nodes; -} -function visitArray(nodes, visitor, test, start, count) { - if (nodes === void 0) { - return nodes; - } - const length2 = nodes.length; - if (start === void 0 || start < 0) { - start = 0; - } - if (count === void 0 || count > length2 - start) { - count = length2 - start; - } - return visitArrayWorker(nodes, visitor, test, start, count); -} -function visitArrayWorker(nodes, visitor, test, start, count) { - let updated; - const length2 = nodes.length; - if (start > 0 || count < length2) { - updated = []; - } - for (let i = 0; i < count; i++) { - const node = nodes[i + start]; - const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0; - if (updated !== void 0 || visited === void 0 || visited !== node) { - if (updated === void 0) { - updated = nodes.slice(0, i); - Debug.assertEachNode(updated, test); - } - if (visited) { - if (isArray(visited)) { - for (const visitedNode of visited) { - Debug.assertNode(visitedNode, test); - updated.push(visitedNode); - } - } else { - Debug.assertNode(visited, test); - updated.push(visited); - } - } - } - } - if (updated) { - return updated; - } - Debug.assertEachNode(nodes, test); - return nodes; -} -function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict, nodesVisitor = visitNodes2) { - context.startLexicalEnvironment(); - statements = nodesVisitor(statements, visitor, isStatement, start); - if (ensureUseStrict) statements = context.factory.ensureUseStrict(statements); - return factory.mergeLexicalEnvironment(statements, context.endLexicalEnvironment()); -} -function visitParameterList(nodes, visitor, context, nodesVisitor = visitNodes2) { - let updated; - context.startLexicalEnvironment(); - if (nodes) { - context.setLexicalEnvironmentFlags(1 /* InParameters */, true); - updated = nodesVisitor(nodes, visitor, isParameter); - if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ && getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { - updated = addDefaultValueAssignmentsIfNeeded(updated, context); - } - context.setLexicalEnvironmentFlags(1 /* InParameters */, false); - } - context.suspendLexicalEnvironment(); - return updated; -} -function addDefaultValueAssignmentsIfNeeded(parameters, context) { - let result; - for (let i = 0; i < parameters.length; i++) { - const parameter = parameters[i]; - const updated = addDefaultValueAssignmentIfNeeded(parameter, context); - if (result || updated !== parameter) { - if (!result) result = parameters.slice(0, i); - result[i] = updated; - } - } - if (result) { - return setTextRange(context.factory.createNodeArray(result, parameters.hasTrailingComma), parameters); - } - return parameters; -} -function addDefaultValueAssignmentIfNeeded(parameter, context) { - return parameter.dotDotDotToken ? parameter : isBindingPattern(parameter.name) ? addDefaultValueAssignmentForBindingPattern(parameter, context) : parameter.initializer ? addDefaultValueAssignmentForInitializer(parameter, parameter.name, parameter.initializer, context) : parameter; -} -function addDefaultValueAssignmentForBindingPattern(parameter, context) { - const { factory: factory2 } = context; - context.addInitializationStatement( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - parameter.name, - /*exclamationToken*/ - void 0, - parameter.type, - parameter.initializer ? factory2.createConditionalExpression( - factory2.createStrictEquality( - factory2.getGeneratedNameForNode(parameter), - factory2.createVoidZero() - ), - /*questionToken*/ - void 0, - parameter.initializer, - /*colonToken*/ - void 0, - factory2.getGeneratedNameForNode(parameter) - ) : factory2.getGeneratedNameForNode(parameter) - ) - ]) - ) - ); - return factory2.updateParameterDeclaration( - parameter, - parameter.modifiers, - parameter.dotDotDotToken, - factory2.getGeneratedNameForNode(parameter), - parameter.questionToken, - parameter.type, - /*initializer*/ - void 0 - ); -} -function addDefaultValueAssignmentForInitializer(parameter, name, initializer, context) { - const factory2 = context.factory; - context.addInitializationStatement( - factory2.createIfStatement( - factory2.createTypeCheck(factory2.cloneNode(name), "undefined"), - setEmitFlags( - setTextRange( - factory2.createBlock([ - factory2.createExpressionStatement( - setEmitFlags( - setTextRange( - factory2.createAssignment( - setEmitFlags(factory2.cloneNode(name), 96 /* NoSourceMap */), - setEmitFlags(initializer, 96 /* NoSourceMap */ | getEmitFlags(initializer) | 3072 /* NoComments */) - ), - parameter - ), - 3072 /* NoComments */ - ) - ) - ]), - parameter - ), - 1 /* SingleLine */ | 64 /* NoTrailingSourceMap */ | 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */ - ) - ) - ); - return factory2.updateParameterDeclaration( - parameter, - parameter.modifiers, - parameter.dotDotDotToken, - parameter.name, - parameter.questionToken, - parameter.type, - /*initializer*/ - void 0 - ); -} -function visitFunctionBody(node, visitor, context, nodeVisitor = visitNode) { - context.resumeLexicalEnvironment(); - const updated = nodeVisitor(node, visitor, isConciseBody); - const declarations = context.endLexicalEnvironment(); - if (some(declarations)) { - if (!updated) { - return context.factory.createBlock(declarations); - } - const block = context.factory.converters.convertToFunctionBlock(updated); - const statements = factory.mergeLexicalEnvironment(block.statements, declarations); - return context.factory.updateBlock(block, statements); - } - return updated; -} -function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { - context.startBlockScope(); - const updated = nodeVisitor(body, visitor, isStatement, context.factory.liftToBlock); - Debug.assert(updated); - const declarations = context.endBlockScope(); - if (some(declarations)) { - if (isBlock(updated)) { - declarations.push(...updated.statements); - return context.factory.updateBlock(updated, declarations); - } - declarations.push(updated); - return context.factory.createBlock(declarations); - } - return updated; -} -function visitCommaListElements(elements, visitor, discardVisitor = visitor) { - if (discardVisitor === visitor || elements.length <= 1) { - return visitNodes2(elements, visitor, isExpression); - } - let i = 0; - const length2 = elements.length; - return visitNodes2(elements, (node) => { - const discarded = i < length2 - 1; - i++; - return discarded ? discardVisitor(node) : visitor(node); - }, isExpression); -} -function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) { - if (node === void 0) { - return void 0; - } - const fn = visitEachChildTable[node.kind]; - return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor); -} -var visitEachChildTable = { - [167 /* 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)) - ); - }, - [168 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateComputedPropertyName( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - // Signature elements - [169 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTypeParameterDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifier), - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), - nodeVisitor(node.constraint, visitor, isTypeNode), - nodeVisitor(node.default, visitor, isTypeNode) - ); - }, - [170 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateParameterDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, - Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), - tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.initializer, visitor, isExpression) - ); - }, - [171 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateDecorator( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - // Type elements - [172 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updatePropertySignature( - node, - nodesVisitor(node.modifiers, visitor, isModifier), - Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), - tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, - nodeVisitor(node.type, visitor, isTypeNode) - ); - }, - [173 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updatePropertyDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), - // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration - tokenVisitor ? nodeVisitor(node.questionToken ?? node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken) : node.questionToken ?? node.exclamationToken, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.initializer, visitor, isExpression) - ); - }, - [174 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateMethodSignature( - node, - nodesVisitor(node.modifiers, visitor, isModifier), - Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), - tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameter), - nodeVisitor(node.type, visitor, isTypeNode) - ); - }, - [175 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateMethodDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, - Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), - tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - visitParameterList(node.parameters, visitor, context, nodesVisitor), - nodeVisitor(node.type, visitor, isTypeNode), - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [177 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateConstructorDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - visitParameterList(node.parameters, visitor, context, nodesVisitor), - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [178 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateGetAccessorDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), - visitParameterList(node.parameters, visitor, context, nodesVisitor), - nodeVisitor(node.type, visitor, isTypeNode), - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [179 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateSetAccessorDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), - visitParameterList(node.parameters, visitor, context, nodesVisitor), - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [176 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - context.startLexicalEnvironment(); - context.suspendLexicalEnvironment(); - return context.factory.updateClassStaticBlockDeclaration( - node, - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [180 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateCallSignature( - node, - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameter), - nodeVisitor(node.type, visitor, isTypeNode) - ); - }, - [181 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateConstructSignature( - node, - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameter), - nodeVisitor(node.type, visitor, isTypeNode) - ); - }, - [182 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateIndexSignature( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - nodesVisitor(node.parameters, visitor, isParameter), - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - // Types - [183 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTypePredicateNode( - node, - nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), - Debug.checkDefined(nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode)), - nodeVisitor(node.type, visitor, isTypeNode) - ); - }, - [184 /* 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) - ); - }, - [185 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateFunctionTypeNode( - node, - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameter), - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [186 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateConstructorTypeNode( - node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.parameters, visitor, isParameter), - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [187 /* 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) - ); - }, - [188 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateTypeLiteralNode( - node, - nodesVisitor(node.members, visitor, isTypeElement) - ); - }, - [189 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateArrayTypeNode( - node, - Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) - ); - }, - [190 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateTupleTypeNode( - node, - nodesVisitor(node.elements, visitor, isTypeNode) - ); - }, - [191 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateOptionalTypeNode( - node, - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [192 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateRestTypeNode( - node, - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [193 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateUnionTypeNode( - node, - nodesVisitor(node.types, visitor, isTypeNode) - ); - }, - [194 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateIntersectionTypeNode( - node, - nodesVisitor(node.types, visitor, isTypeNode) - ); - }, - [195 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateConditionalTypeNode( - node, - Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), - Debug.checkDefined(nodeVisitor(node.extendsType, visitor, isTypeNode)), - Debug.checkDefined(nodeVisitor(node.trueType, visitor, isTypeNode)), - Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) - ); - }, - [196 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateInferTypeNode( - node, - Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) - ); - }, - [206 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateImportTypeNode( - node, - Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), - nodeVisitor(node.attributes, visitor, isImportAttributes), - nodeVisitor(node.qualifier, visitor, isEntityName), - nodesVisitor(node.typeArguments, visitor, isTypeNode), - node.isTypeOf - ); - }, - [303 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateImportTypeAssertionContainer( - node, - Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), - node.multiLine - ); - }, - [203 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateNamedTupleMember( - node, - tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), - tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [197 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateParenthesizedType( - node, - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [199 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTypeOperatorNode( - node, - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [200 /* 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)) - ); - }, - [201 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateMappedTypeNode( - node, - tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, - Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)), - nodeVisitor(node.nameType, visitor, isTypeNode), - tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken) : node.questionToken, - nodeVisitor(node.type, visitor, isTypeNode), - nodesVisitor(node.members, visitor, isTypeElement) - ); - }, - [202 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateLiteralTypeNode( - node, - Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) - ); - }, - [204 /* 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) - ); - }, - [205 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTemplateLiteralTypeSpan( - node, - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), - Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) - ); - }, - // Binding patterns - [207 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateObjectBindingPattern( - node, - nodesVisitor(node.elements, visitor, isBindingElement) - ); - }, - [208 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateArrayBindingPattern( - node, - nodesVisitor(node.elements, visitor, isArrayBindingElement) - ); - }, - [209 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateBindingElement( - node, - tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, - nodeVisitor(node.propertyName, visitor, isPropertyName), - Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), - nodeVisitor(node.initializer, visitor, isExpression) - ); - }, - // Expression - [210 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateArrayLiteralExpression( - node, - nodesVisitor(node.elements, visitor, isExpression) - ); - }, - [211 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateObjectLiteralExpression( - node, - nodesVisitor(node.properties, visitor, isObjectLiteralElementLike) - ); - }, - [212 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, - Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) - ) : context.factory.updatePropertyAccessExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) - ); - }, - [213 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return isElementAccessChain(node) ? context.factory.updateElementAccessChain( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, - Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) - ) : context.factory.updateElementAccessExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) - ); - }, - [214 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return isCallChain(node) ? context.factory.updateCallChain( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, - nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodesVisitor(node.arguments, visitor, isExpression) - ) : context.factory.updateCallExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodesVisitor(node.arguments, visitor, isExpression) - ); - }, - [215 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateNewExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - nodesVisitor(node.typeArguments, visitor, isTypeNode), - nodesVisitor(node.arguments, visitor, isExpression) - ); - }, - [216 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTaggedTemplateExpression( - node, - Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), - nodesVisitor(node.typeArguments, visitor, isTypeNode), - Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) - ); - }, - [217 /* 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)) - ); - }, - [218 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateParenthesizedExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [219 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateFunctionExpression( - node, - nodesVisitor(node.modifiers, visitor, isModifier), - tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, - nodeVisitor(node.name, visitor, isIdentifier), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - visitParameterList(node.parameters, visitor, context, nodesVisitor), - nodeVisitor(node.type, visitor, isTypeNode), - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [220 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateArrowFunction( - node, - nodesVisitor(node.modifiers, visitor, isModifier), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - visitParameterList(node.parameters, visitor, context, nodesVisitor), - nodeVisitor(node.type, visitor, isTypeNode), - tokenVisitor ? Debug.checkDefined(nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken)) : node.equalsGreaterThanToken, - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateDeleteExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTypeOfExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateVoidExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateAwaitExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updatePrefixUnaryExpression( - node, - Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) - ); - }, - [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updatePostfixUnaryExpression( - node, - Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) - ); - }, - [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateBinaryExpression( - node, - Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), - tokenVisitor ? Debug.checkDefined(nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken)) : node.operatorToken, - Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) - ); - }, - [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateConditionalExpression( - node, - Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), - tokenVisitor ? Debug.checkDefined(nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken)) : node.questionToken, - Debug.checkDefined(nodeVisitor(node.whenTrue, visitor, isExpression)), - tokenVisitor ? Debug.checkDefined(nodeVisitor(node.colonToken, tokenVisitor, isColonToken)) : node.colonToken, - Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) - ); - }, - [229 /* 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) - ); - }, - [230 /* 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) - ); - }, - [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateSpreadElement( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateClassExpression( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isIdentifier), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.heritageClauses, visitor, isHeritageClause), - nodesVisitor(node.members, visitor, isClassElement) - ); - }, - [234 /* 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) - ); - }, - [235 /* 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)) - ); - }, - [239 /* 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)) - ); - }, - [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return isOptionalChain(node) ? context.factory.updateNonNullChain( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ) : context.factory.updateNonNullExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateMetaProperty( - node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) - ); - }, - // Misc - [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTemplateSpan( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) - ); - }, - // Element - [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateBlock( - node, - nodesVisitor(node.statements, visitor, isStatement) - ); - }, - [244 /* 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)) - ); - }, - [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateExpressionStatement( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateIfStatement( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - Debug.checkDefined(nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock)), - nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) - ); - }, - [247 /* 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)) - ); - }, - [248 /* 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) - ); - }, - [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateForStatement( - node, - nodeVisitor(node.initializer, visitor, isForInitializer), - nodeVisitor(node.condition, visitor, isExpression), - nodeVisitor(node.incrementor, visitor, isExpression), - visitIterationBody(node.statement, visitor, context, nodeVisitor) - ); - }, - [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateForInStatement( - node, - Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - visitIterationBody(node.statement, visitor, context, nodeVisitor) - ); - }, - [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateForOfStatement( - node, - tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, - Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), - visitIterationBody(node.statement, visitor, context, nodeVisitor) - ); - }, - [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateContinueStatement( - node, - nodeVisitor(node.label, visitor, isIdentifier) - ); - }, - [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateBreakStatement( - node, - nodeVisitor(node.label, visitor, isIdentifier) - ); - }, - [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateReturnStatement( - node, - nodeVisitor(node.expression, visitor, isExpression) - ); - }, - [255 /* 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)) - ); - }, - [256 /* 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)) - ); - }, - [257 /* 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)) - ); - }, - [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateThrowStatement( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTryStatement( - node, - Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), - nodeVisitor(node.catchClause, visitor, isCatchClause), - nodeVisitor(node.finallyBlock, visitor, isBlock) - ); - }, - [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateVariableDeclaration( - node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), - tokenVisitor ? nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken) : node.exclamationToken, - nodeVisitor(node.type, visitor, isTypeNode), - nodeVisitor(node.initializer, visitor, isExpression) - ); - }, - [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateVariableDeclarationList( - node, - nodesVisitor(node.declarations, visitor, isVariableDeclaration) - ); - }, - [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { - return context.factory.updateFunctionDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifier), - tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, - nodeVisitor(node.name, visitor, isIdentifier), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - visitParameterList(node.parameters, visitor, context, nodesVisitor), - nodeVisitor(node.type, visitor, isTypeNode), - visitFunctionBody(node.body, visitor, context, nodeVisitor) - ); - }, - [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateClassDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - nodeVisitor(node.name, visitor, isIdentifier), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.heritageClauses, visitor, isHeritageClause), - nodesVisitor(node.members, visitor, isClassElement) - ); - }, - [265 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateInterfaceDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - nodesVisitor(node.heritageClauses, visitor, isHeritageClause), - nodesVisitor(node.members, visitor, isTypeElement) - ); - }, - [266 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateTypeAliasDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), - nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), - Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) - ); - }, - [267 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateEnumDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), - nodesVisitor(node.members, visitor, isEnumMember) - ); - }, - [268 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateModuleDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleName)), - nodeVisitor(node.body, visitor, isModuleBody) - ); - }, - [269 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateModuleBlock( - node, - nodesVisitor(node.statements, visitor, isStatement) - ); - }, - [270 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateCaseBlock( - node, - nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause) - ); - }, - [271 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateNamespaceExportDeclaration( - node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) - ); - }, - [272 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateImportEqualsDeclaration( - node, - nodesVisitor(node.modifiers, visitor, isModifierLike), - node.isTypeOnly, - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), - Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) - ); - }, - [273 /* 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.attributes, visitor, isImportAttributes) - ); - }, - [301 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateImportAttributes( - node, - nodesVisitor(node.elements, visitor, isImportAttribute), - node.multiLine - ); - }, - [302 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateImportAttribute( - node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)), - Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) - ); - }, - [274 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateImportClause( - node, - node.phaseModifier, - nodeVisitor(node.name, visitor, isIdentifier), - nodeVisitor(node.namedBindings, visitor, isNamedImportBindings) - ); - }, - [275 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateNamespaceImport( - node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) - ); - }, - [281 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateNamespaceExport( - node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) - ); - }, - [276 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateNamedImports( - node, - nodesVisitor(node.elements, visitor, isImportSpecifier) - ); - }, - [277 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateImportSpecifier( - node, - node.isTypeOnly, - nodeVisitor(node.propertyName, visitor, isModuleExportName), - Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) - ); - }, - [278 /* 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)) - ); - }, - [279 /* 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.attributes, visitor, isImportAttributes) - ); - }, - [280 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateNamedExports( - node, - nodesVisitor(node.elements, visitor, isExportSpecifier) - ); - }, - [282 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateExportSpecifier( - node, - node.isTypeOnly, - nodeVisitor(node.propertyName, visitor, isModuleExportName), - Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleExportName)) - ); - }, - // Module references - [284 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateExternalModuleReference( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - // JSX - [285 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxElement( - node, - Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), - nodesVisitor(node.children, visitor, isJsxChild), - Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) - ); - }, - [286 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxSelfClosingElement( - node, - Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), - nodesVisitor(node.typeArguments, visitor, isTypeNode), - Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) - ); - }, - [287 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxOpeningElement( - node, - Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), - nodesVisitor(node.typeArguments, visitor, isTypeNode), - Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) - ); - }, - [288 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxClosingElement( - node, - Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) - ); - }, - [296 /* 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)) - ); - }, - [289 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxFragment( - node, - Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), - nodesVisitor(node.children, visitor, isJsxChild), - Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) - ); - }, - [292 /* 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) - ); - }, - [293 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxAttributes( - node, - nodesVisitor(node.properties, visitor, isJsxAttributeLike) - ); - }, - [294 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxSpreadAttribute( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [295 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateJsxExpression( - node, - nodeVisitor(node.expression, visitor, isExpression) - ); - }, - // Clauses - [297 /* 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) - ); - }, - [298 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateDefaultClause( - node, - nodesVisitor(node.statements, visitor, isStatement) - ); - }, - [299 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateHeritageClause( - node, - nodesVisitor(node.types, visitor, isExpressionWithTypeArguments) - ); - }, - [300 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateCatchClause( - node, - nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), - Debug.checkDefined(nodeVisitor(node.block, visitor, isBlock)) - ); - }, - // Property assignments - [304 /* 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)) - ); - }, - [305 /* 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) - ); - }, - [306 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateSpreadAssignment( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - // Enum - [307 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateEnumMember( - node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), - nodeVisitor(node.initializer, visitor, isExpression) - ); - }, - // Top-level nodes - [308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateSourceFile( - node, - visitLexicalEnvironment(node.statements, visitor, context) - ); - }, - // Transformation nodes - [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updatePartiallyEmittedExpression( - node, - Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) - ); - }, - [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateCommaListExpression( - node, - nodesVisitor(node.elements, visitor, isExpression) - ); - } -}; -function extractSingleNode(nodes) { - Debug.assert(nodes.length <= 1, "Too many nodes written to output."); - return singleOrUndefined(nodes); -} - -// src/compiler/sourcemap.ts -function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) { - var { enter, exit } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; - var rawSources = []; - var sources = []; - var sourceToSourceIndexMap = /* @__PURE__ */ new Map(); - var sourcesContent; - var names = []; - var nameToNameIndexMap; - var mappingCharCodes = []; - var mappings = ""; - var lastGeneratedLine = 0; - var lastGeneratedCharacter = 0; - var lastSourceIndex = 0; - var lastSourceLine = 0; - var lastSourceCharacter = 0; - var lastNameIndex = 0; - var hasLast = false; - var pendingGeneratedLine = 0; - var pendingGeneratedCharacter = 0; - var pendingSourceIndex = 0; - var pendingSourceLine = 0; - var pendingSourceCharacter = 0; - var pendingNameIndex = 0; - var hasPending = false; - var hasPendingSource = false; - var hasPendingName = false; - return { - getSources: () => rawSources, - addSource, - setSourceContent, - addName, - addMapping, - appendSourceMap, - toJSON, - toString: () => JSON.stringify(toJSON()) - }; - function addSource(fileName) { - enter(); - const source = getRelativePathToDirectoryOrUrl( - sourcesDirectoryPath, - fileName, - host.getCurrentDirectory(), - host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ - true - ); - let sourceIndex = sourceToSourceIndexMap.get(source); - if (sourceIndex === void 0) { - sourceIndex = sources.length; - sources.push(source); - rawSources.push(fileName); - sourceToSourceIndexMap.set(source, sourceIndex); - } - exit(); - return sourceIndex; - } - function setSourceContent(sourceIndex, content) { - enter(); - if (content !== null) { - if (!sourcesContent) sourcesContent = []; - while (sourcesContent.length < sourceIndex) { - sourcesContent.push(null); - } - sourcesContent[sourceIndex] = content; - } - exit(); - } - function addName(name) { - enter(); - if (!nameToNameIndexMap) nameToNameIndexMap = /* @__PURE__ */ new Map(); - let nameIndex = nameToNameIndexMap.get(name); - if (nameIndex === void 0) { - nameIndex = names.length; - names.push(name); - nameToNameIndexMap.set(name, nameIndex); - } - exit(); - return nameIndex; - } - function isNewGeneratedPosition(generatedLine, generatedCharacter) { - return !hasPending || pendingGeneratedLine !== generatedLine || pendingGeneratedCharacter !== generatedCharacter; - } - function isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter) { - return sourceIndex !== void 0 && sourceLine !== void 0 && sourceCharacter !== void 0 && pendingSourceIndex === sourceIndex && (pendingSourceLine > sourceLine || pendingSourceLine === sourceLine && pendingSourceCharacter > sourceCharacter); - } - function addMapping(generatedLine, generatedCharacter, sourceIndex, sourceLine, sourceCharacter, nameIndex) { - Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack"); - Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative"); - Debug.assert(sourceIndex === void 0 || sourceIndex >= 0, "sourceIndex cannot be negative"); - Debug.assert(sourceLine === void 0 || sourceLine >= 0, "sourceLine cannot be negative"); - Debug.assert(sourceCharacter === void 0 || sourceCharacter >= 0, "sourceCharacter cannot be negative"); - enter(); - if (isNewGeneratedPosition(generatedLine, generatedCharacter) || isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter)) { - commitPendingMapping(); - pendingGeneratedLine = generatedLine; - pendingGeneratedCharacter = generatedCharacter; - hasPendingSource = false; - hasPendingName = false; - hasPending = true; - } - if (sourceIndex !== void 0 && sourceLine !== void 0 && sourceCharacter !== void 0) { - pendingSourceIndex = sourceIndex; - pendingSourceLine = sourceLine; - pendingSourceCharacter = sourceCharacter; - hasPendingSource = true; - if (nameIndex !== void 0) { - pendingNameIndex = nameIndex; - hasPendingName = true; - } - } - exit(); - } - function appendSourceMap(generatedLine, generatedCharacter, map2, sourceMapPath, start, end) { - Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack"); - Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative"); - enter(); - const sourceIndexToNewSourceIndexMap = []; - let nameIndexToNewNameIndexMap; - const mappingIterator = decodeMappings(map2.mappings); - for (const raw of mappingIterator) { - if (end && (raw.generatedLine > end.line || raw.generatedLine === end.line && raw.generatedCharacter > end.character)) { - break; - } - if (start && (raw.generatedLine < start.line || start.line === raw.generatedLine && raw.generatedCharacter < start.character)) { - continue; - } - let newSourceIndex; - let newSourceLine; - let newSourceCharacter; - let newNameIndex; - if (raw.sourceIndex !== void 0) { - newSourceIndex = sourceIndexToNewSourceIndexMap[raw.sourceIndex]; - if (newSourceIndex === void 0) { - const rawPath = map2.sources[raw.sourceIndex]; - const relativePath = map2.sourceRoot ? combinePaths(map2.sourceRoot, rawPath) : rawPath; - const combinedPath = combinePaths(getDirectoryPath(sourceMapPath), relativePath); - sourceIndexToNewSourceIndexMap[raw.sourceIndex] = newSourceIndex = addSource(combinedPath); - if (map2.sourcesContent && typeof map2.sourcesContent[raw.sourceIndex] === "string") { - setSourceContent(newSourceIndex, map2.sourcesContent[raw.sourceIndex]); - } - } - newSourceLine = raw.sourceLine; - newSourceCharacter = raw.sourceCharacter; - if (map2.names && raw.nameIndex !== void 0) { - if (!nameIndexToNewNameIndexMap) nameIndexToNewNameIndexMap = []; - newNameIndex = nameIndexToNewNameIndexMap[raw.nameIndex]; - if (newNameIndex === void 0) { - nameIndexToNewNameIndexMap[raw.nameIndex] = newNameIndex = addName(map2.names[raw.nameIndex]); - } - } - } - const rawGeneratedLine = raw.generatedLine - (start ? start.line : 0); - const newGeneratedLine = rawGeneratedLine + generatedLine; - const rawGeneratedCharacter = start && start.line === raw.generatedLine ? raw.generatedCharacter - start.character : raw.generatedCharacter; - const newGeneratedCharacter = rawGeneratedLine === 0 ? rawGeneratedCharacter + generatedCharacter : rawGeneratedCharacter; - addMapping(newGeneratedLine, newGeneratedCharacter, newSourceIndex, newSourceLine, newSourceCharacter, newNameIndex); - } - exit(); - } - function shouldCommitMapping() { - return !hasLast || lastGeneratedLine !== pendingGeneratedLine || lastGeneratedCharacter !== pendingGeneratedCharacter || lastSourceIndex !== pendingSourceIndex || lastSourceLine !== pendingSourceLine || lastSourceCharacter !== pendingSourceCharacter || lastNameIndex !== pendingNameIndex; - } - function appendMappingCharCode(charCode) { - mappingCharCodes.push(charCode); - if (mappingCharCodes.length >= 1024) { - flushMappingBuffer(); - } - } - function commitPendingMapping() { - if (!hasPending || !shouldCommitMapping()) { - return; - } - enter(); - if (lastGeneratedLine < pendingGeneratedLine) { - do { - appendMappingCharCode(59 /* semicolon */); - lastGeneratedLine++; - } while (lastGeneratedLine < pendingGeneratedLine); - lastGeneratedCharacter = 0; - } else { - Debug.assertEqual(lastGeneratedLine, pendingGeneratedLine, "generatedLine cannot backtrack"); - if (hasLast) { - appendMappingCharCode(44 /* comma */); - } - } - appendBase64VLQ(pendingGeneratedCharacter - lastGeneratedCharacter); - lastGeneratedCharacter = pendingGeneratedCharacter; - if (hasPendingSource) { - appendBase64VLQ(pendingSourceIndex - lastSourceIndex); - lastSourceIndex = pendingSourceIndex; - appendBase64VLQ(pendingSourceLine - lastSourceLine); - lastSourceLine = pendingSourceLine; - appendBase64VLQ(pendingSourceCharacter - lastSourceCharacter); - lastSourceCharacter = pendingSourceCharacter; - if (hasPendingName) { - appendBase64VLQ(pendingNameIndex - lastNameIndex); - lastNameIndex = pendingNameIndex; - } - } - hasLast = true; - exit(); - } - function flushMappingBuffer() { - if (mappingCharCodes.length > 0) { - mappings += String.fromCharCode.apply(void 0, mappingCharCodes); - mappingCharCodes.length = 0; - } - } - function toJSON() { - commitPendingMapping(); - flushMappingBuffer(); - return { - version: 3, - file, - sourceRoot, - sources, - names, - mappings, - sourcesContent - }; - } - function appendBase64VLQ(inValue) { - if (inValue < 0) { - inValue = (-inValue << 1) + 1; - } else { - inValue = inValue << 1; - } - do { - let currentDigit = inValue & 31; - inValue = inValue >> 5; - if (inValue > 0) { - currentDigit = currentDigit | 32; - } - appendMappingCharCode(base64FormatEncode(currentDigit)); - } while (inValue > 0); - } -} -var sourceMapCommentRegExpDontCareLineStart = /\/\/[@#] source[M]appingURL=(.+)\r?\n?$/; -var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/; -var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/; -function getLineInfo(text, lineStarts) { - return { - getLineCount: () => lineStarts.length, - getLineText: (line) => text.substring(lineStarts[line], lineStarts[line + 1]) - }; -} -function tryGetSourceMappingURL(lineInfo) { - for (let index = lineInfo.getLineCount() - 1; index >= 0; index--) { - const line = lineInfo.getLineText(index); - const comment = sourceMapCommentRegExp.exec(line); - if (comment) { - return comment[1].trimEnd(); - } else if (!line.match(whitespaceOrMapCommentRegExp)) { - break; - } - } -} -function isStringOrNull(x) { - return typeof x === "string" || x === null; -} -function isRawSourceMap(x) { - return x !== null && typeof x === "object" && x.version === 3 && typeof x.file === "string" && typeof x.mappings === "string" && isArray(x.sources) && every(x.sources, isString) && (x.sourceRoot === void 0 || x.sourceRoot === null || typeof x.sourceRoot === "string") && (x.sourcesContent === void 0 || x.sourcesContent === null || isArray(x.sourcesContent) && every(x.sourcesContent, isStringOrNull)) && (x.names === void 0 || x.names === null || isArray(x.names) && every(x.names, isString)); -} -function tryParseRawSourceMap(text) { - try { - const parsed = JSON.parse(text); - if (isRawSourceMap(parsed)) { - return parsed; - } - } catch { - } - return void 0; -} -function decodeMappings(mappings) { - let done = false; - let pos = 0; - let generatedLine = 0; - let generatedCharacter = 0; - let sourceIndex = 0; - let sourceLine = 0; - let sourceCharacter = 0; - let nameIndex = 0; - let error2; - return { - get pos() { - return pos; - }, - get error() { - return error2; - }, - get state() { - return captureMapping( - /*hasSource*/ - true, - /*hasName*/ - true - ); - }, - next() { - while (!done && pos < mappings.length) { - const ch = mappings.charCodeAt(pos); - if (ch === 59 /* semicolon */) { - generatedLine++; - generatedCharacter = 0; - pos++; - continue; - } - if (ch === 44 /* comma */) { - pos++; - continue; - } - let hasSource = false; - let hasName = false; - generatedCharacter += base64VLQFormatDecode(); - if (hasReportedError()) return stopIterating(); - if (generatedCharacter < 0) return setErrorAndStopIterating("Invalid generatedCharacter found"); - if (!isSourceMappingSegmentEnd()) { - hasSource = true; - sourceIndex += base64VLQFormatDecode(); - if (hasReportedError()) return stopIterating(); - if (sourceIndex < 0) return setErrorAndStopIterating("Invalid sourceIndex found"); - if (isSourceMappingSegmentEnd()) return setErrorAndStopIterating("Unsupported Format: No entries after sourceIndex"); - sourceLine += base64VLQFormatDecode(); - if (hasReportedError()) return stopIterating(); - if (sourceLine < 0) return setErrorAndStopIterating("Invalid sourceLine found"); - if (isSourceMappingSegmentEnd()) return setErrorAndStopIterating("Unsupported Format: No entries after sourceLine"); - sourceCharacter += base64VLQFormatDecode(); - if (hasReportedError()) return stopIterating(); - if (sourceCharacter < 0) return setErrorAndStopIterating("Invalid sourceCharacter found"); - if (!isSourceMappingSegmentEnd()) { - hasName = true; - nameIndex += base64VLQFormatDecode(); - if (hasReportedError()) return stopIterating(); - if (nameIndex < 0) return setErrorAndStopIterating("Invalid nameIndex found"); - if (!isSourceMappingSegmentEnd()) return setErrorAndStopIterating("Unsupported Error Format: Entries after nameIndex"); - } - } - return { value: captureMapping(hasSource, hasName), done }; - } - return stopIterating(); - }, - [Symbol.iterator]() { - return this; - } - }; - function captureMapping(hasSource, hasName) { - return { - generatedLine, - generatedCharacter, - sourceIndex: hasSource ? sourceIndex : void 0, - sourceLine: hasSource ? sourceLine : void 0, - sourceCharacter: hasSource ? sourceCharacter : void 0, - nameIndex: hasName ? nameIndex : void 0 - }; - } - function stopIterating() { - done = true; - return { value: void 0, done: true }; - } - function setError(message) { - if (error2 === void 0) { - error2 = message; - } - } - function setErrorAndStopIterating(message) { - setError(message); - return stopIterating(); - } - function hasReportedError() { - return error2 !== void 0; - } - function isSourceMappingSegmentEnd() { - return pos === mappings.length || mappings.charCodeAt(pos) === 44 /* comma */ || mappings.charCodeAt(pos) === 59 /* semicolon */; - } - function base64VLQFormatDecode() { - let moreDigits = true; - let shiftCount = 0; - let value = 0; - for (; moreDigits; pos++) { - if (pos >= mappings.length) return setError("Error in decoding base64VLQFormatDecode, past the mapping string"), -1; - const currentByte = base64FormatDecode(mappings.charCodeAt(pos)); - if (currentByte === -1) return setError("Invalid character in VLQ"), -1; - moreDigits = (currentByte & 32) !== 0; - value = value | (currentByte & 31) << shiftCount; - shiftCount += 5; - } - if ((value & 1) === 0) { - value = value >> 1; - } else { - value = value >> 1; - value = -value; - } - return value; - } -} -function sameMapping(left, right) { - return left === right || left.generatedLine === right.generatedLine && left.generatedCharacter === right.generatedCharacter && left.sourceIndex === right.sourceIndex && left.sourceLine === right.sourceLine && left.sourceCharacter === right.sourceCharacter && left.nameIndex === right.nameIndex; -} -function isSourceMapping(mapping) { - return mapping.sourceIndex !== void 0 && mapping.sourceLine !== void 0 && mapping.sourceCharacter !== void 0; -} -function base64FormatEncode(value) { - return value >= 0 && value < 26 ? 65 /* A */ + value : value >= 26 && value < 52 ? 97 /* a */ + value - 26 : value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 : value === 62 ? 43 /* plus */ : value === 63 ? 47 /* slash */ : Debug.fail(`${value}: not a base64 value`); -} -function base64FormatDecode(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ : ch >= 97 /* a */ && ch <= 122 /* z */ ? ch - 97 /* a */ + 26 : ch >= 48 /* _0 */ && ch <= 57 /* _9 */ ? ch - 48 /* _0 */ + 52 : ch === 43 /* plus */ ? 62 : ch === 47 /* slash */ ? 63 : -1; -} -function isSourceMappedPosition(value) { - return value.sourceIndex !== void 0 && value.sourcePosition !== void 0; -} -function sameMappedPosition(left, right) { - return left.generatedPosition === right.generatedPosition && left.sourceIndex === right.sourceIndex && left.sourcePosition === right.sourcePosition; -} -function compareSourcePositions(left, right) { - Debug.assert(left.sourceIndex === right.sourceIndex); - return compareValues(left.sourcePosition, right.sourcePosition); -} -function compareGeneratedPositions(left, right) { - return compareValues(left.generatedPosition, right.generatedPosition); -} -function getSourcePositionOfMapping(value) { - return value.sourcePosition; -} -function getGeneratedPositionOfMapping(value) { - return value.generatedPosition; -} -function createDocumentPositionMapper(host, map2, mapPath) { - const mapDirectory = getDirectoryPath(mapPath); - const sourceRoot = map2.sourceRoot ? getNormalizedAbsolutePath(map2.sourceRoot, mapDirectory) : mapDirectory; - const generatedAbsoluteFilePath = getNormalizedAbsolutePath(map2.file, mapDirectory); - const generatedFile = host.getSourceFileLike(generatedAbsoluteFilePath); - const sourceFileAbsolutePaths = map2.sources.map((source) => getNormalizedAbsolutePath(source, sourceRoot)); - const sourceToSourceIndexMap = new Map(sourceFileAbsolutePaths.map((source, i) => [host.getCanonicalFileName(source), i])); - let decodedMappings; - let generatedMappings; - let sourceMappings; - return { - getSourcePosition, - getGeneratedPosition - }; - function processMapping(mapping) { - const generatedPosition = generatedFile !== void 0 ? getPositionOfLineAndCharacter( - generatedFile, - mapping.generatedLine, - mapping.generatedCharacter, - /*allowEdits*/ - true - ) : -1; - let source; - let sourcePosition; - if (isSourceMapping(mapping)) { - const sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]); - source = map2.sources[mapping.sourceIndex]; - sourcePosition = sourceFile !== void 0 ? getPositionOfLineAndCharacter( - sourceFile, - mapping.sourceLine, - mapping.sourceCharacter, - /*allowEdits*/ - true - ) : -1; - } - return { - generatedPosition, - source, - sourceIndex: mapping.sourceIndex, - sourcePosition, - nameIndex: mapping.nameIndex - }; - } - function getDecodedMappings() { - if (decodedMappings === void 0) { - const decoder = decodeMappings(map2.mappings); - const mappings = arrayFrom(decoder, processMapping); - if (decoder.error !== void 0) { - if (host.log) { - host.log(`Encountered error while decoding sourcemap: ${decoder.error}`); - } - decodedMappings = emptyArray; - } else { - decodedMappings = mappings; - } - } - return decodedMappings; - } - function getSourceMappings(sourceIndex) { - if (sourceMappings === void 0) { - const lists = []; - for (const mapping of getDecodedMappings()) { - if (!isSourceMappedPosition(mapping)) continue; - let list = lists[mapping.sourceIndex]; - if (!list) lists[mapping.sourceIndex] = list = []; - list.push(mapping); - } - sourceMappings = lists.map((list) => sortAndDeduplicate(list, compareSourcePositions, sameMappedPosition)); - } - return sourceMappings[sourceIndex]; - } - function getGeneratedMappings() { - if (generatedMappings === void 0) { - const list = []; - for (const mapping of getDecodedMappings()) { - list.push(mapping); - } - generatedMappings = sortAndDeduplicate(list, compareGeneratedPositions, sameMappedPosition); - } - return generatedMappings; - } - function getGeneratedPosition(loc) { - const sourceIndex = sourceToSourceIndexMap.get(host.getCanonicalFileName(loc.fileName)); - if (sourceIndex === void 0) return loc; - const sourceMappings2 = getSourceMappings(sourceIndex); - if (!some(sourceMappings2)) return loc; - let targetIndex = binarySearchKey(sourceMappings2, loc.pos, getSourcePositionOfMapping, compareValues); - if (targetIndex < 0) { - targetIndex = ~targetIndex; - } - const mapping = sourceMappings2[targetIndex]; - if (mapping === void 0 || mapping.sourceIndex !== sourceIndex) { - return loc; - } - return { fileName: generatedAbsoluteFilePath, pos: mapping.generatedPosition }; - } - function getSourcePosition(loc) { - const generatedMappings2 = getGeneratedMappings(); - if (!some(generatedMappings2)) return loc; - let targetIndex = binarySearchKey(generatedMappings2, loc.pos, getGeneratedPositionOfMapping, compareValues); - if (targetIndex < 0) { - targetIndex = ~targetIndex; - } - const mapping = generatedMappings2[targetIndex]; - if (mapping === void 0 || !isSourceMappedPosition(mapping)) { - return loc; - } - return { fileName: sourceFileAbsolutePaths[mapping.sourceIndex], pos: mapping.sourcePosition }; - } -} -var identitySourceMapConsumer = { - getSourcePosition: identity, - getGeneratedPosition: identity -}; - -// src/compiler/transformers/utilities.ts -function getOriginalNodeId(node) { - node = getOriginalNode(node); - return node ? getNodeId(node) : 0; -} -function containsDefaultReference(node) { - if (!node) return false; - if (!isNamedImports(node) && !isNamedExports(node)) return false; - return some(node.elements, isNamedDefaultReference); -} -function isNamedDefaultReference(e) { - return moduleExportNameIsDefault(e.propertyName || e.name); -} -function chainBundle(context, transformSourceFile) { - return transformSourceFileOrBundle; - function transformSourceFileOrBundle(node) { - return node.kind === 308 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); - } - function transformBundle(node) { - return context.factory.createBundle(map(node.sourceFiles, transformSourceFile)); - } -} -function getExportNeedsImportStarHelper(node) { - return !!getNamespaceDeclarationNode(node); -} -function getImportNeedsImportStarHelper(node) { - if (!!getNamespaceDeclarationNode(node)) { - return true; - } - const bindings = node.importClause && node.importClause.namedBindings; - if (!bindings) { - return false; - } - if (!isNamedImports(bindings)) return false; - let defaultRefCount = 0; - for (const binding of bindings.elements) { - if (isNamedDefaultReference(binding)) { - defaultRefCount++; - } - } - return defaultRefCount > 0 && defaultRefCount !== bindings.elements.length || !!(bindings.elements.length - defaultRefCount) && isDefaultImport(node); -} -function getImportNeedsImportDefaultHelper(node) { - return !getImportNeedsImportStarHelper(node) && (isDefaultImport(node) || !!node.importClause && isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)); -} -function collectExternalModuleInfo(context, sourceFile) { - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const externalImports = []; - const exportSpecifiers = new IdentifierNameMultiMap(); - const exportedBindings = []; - const uniqueExports = /* @__PURE__ */ new Map(); - const exportedFunctions = /* @__PURE__ */ new Set(); - let exportedNames; - let hasExportDefault = false; - let exportEquals; - let hasExportStarsToExportValues = false; - let hasImportStar = false; - let hasImportDefault = false; - for (const node of sourceFile.statements) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - externalImports.push(node); - if (!hasImportStar && getImportNeedsImportStarHelper(node)) { - hasImportStar = true; - } - if (!hasImportDefault && getImportNeedsImportDefaultHelper(node)) { - hasImportDefault = true; - } - break; - case 272 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 284 /* ExternalModuleReference */) { - externalImports.push(node); - } - break; - case 279 /* ExportDeclaration */: - if (node.moduleSpecifier) { - if (!node.exportClause) { - externalImports.push(node); - hasExportStarsToExportValues = true; - } else { - externalImports.push(node); - if (isNamedExports(node.exportClause)) { - addExportedNamesForExportDeclaration(node); - hasImportDefault || (hasImportDefault = containsDefaultReference(node.exportClause)); - } else { - const name = node.exportClause.name; - const nameText = moduleExportNameTextUnescaped(name); - if (!uniqueExports.get(nameText)) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name); - uniqueExports.set(nameText, true); - exportedNames = append(exportedNames, name); - } - hasImportStar = true; - } - } - } else { - addExportedNamesForExportDeclaration(node); - } - break; - case 278 /* ExportAssignment */: - if (node.isExportEquals && !exportEquals) { - exportEquals = node; - } - break; - case 244 /* VariableStatement */: - if (hasSyntacticModifier(node, 32 /* Export */)) { - for (const decl of node.declarationList.declarations) { - exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings); - } - } - break; - case 263 /* FunctionDeclaration */: - if (hasSyntacticModifier(node, 32 /* Export */)) { - addExportedFunctionDeclaration( - node, - /*name*/ - void 0, - hasSyntacticModifier(node, 2048 /* Default */) - ); - } - break; - case 264 /* ClassDeclaration */: - if (hasSyntacticModifier(node, 32 /* Export */)) { - if (hasSyntacticModifier(node, 2048 /* Default */)) { - if (!hasExportDefault) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node)); - hasExportDefault = true; - } - } else { - const name = node.name; - if (name && !uniqueExports.get(idText(name))) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name); - uniqueExports.set(idText(name), true); - exportedNames = append(exportedNames, name); - } - } - } - break; - } - } - const externalHelpersImportDeclaration = createExternalHelpersImportDeclarationIfNeeded(context.factory, context.getEmitHelperFactory(), sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault); - if (externalHelpersImportDeclaration) { - externalImports.unshift(externalHelpersImportDeclaration); - } - return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration }; - function addExportedNamesForExportDeclaration(node) { - for (const specifier of cast(node.exportClause, isNamedExports).elements) { - const specifierNameText = moduleExportNameTextUnescaped(specifier.name); - if (!uniqueExports.get(specifierNameText)) { - const name = specifier.propertyName || specifier.name; - if (name.kind !== 11 /* StringLiteral */) { - if (!node.moduleSpecifier) { - exportSpecifiers.add(name, specifier); - } - const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); - if (decl) { - if (decl.kind === 263 /* FunctionDeclaration */) { - addExportedFunctionDeclaration(decl, specifier.name, moduleExportNameIsDefault(specifier.name)); - continue; - } - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name); - } - } - uniqueExports.set(specifierNameText, true); - exportedNames = append(exportedNames, specifier.name); - } - } - } - function addExportedFunctionDeclaration(node, name, isDefault) { - exportedFunctions.add(getOriginalNode(node, isFunctionDeclaration)); - if (isDefault) { - if (!hasExportDefault) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name ?? context.factory.getDeclarationName(node)); - hasExportDefault = true; - } - } else { - name ?? (name = node.name); - const nameText = moduleExportNameTextUnescaped(name); - if (!uniqueExports.get(nameText)) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name); - uniqueExports.set(nameText, true); - } - } - } -} -function collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings) { - if (isBindingPattern(decl.name)) { - for (const element of decl.name.elements) { - if (!isOmittedExpression(element)) { - exportedNames = collectExportedVariableInfo(element, uniqueExports, exportedNames, exportedBindings); - } - } - } else if (!isGeneratedIdentifier(decl.name)) { - const text = idText(decl.name); - if (!uniqueExports.get(text)) { - uniqueExports.set(text, true); - exportedNames = append(exportedNames, decl.name); - if (isLocalName(decl.name)) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), decl.name); - } - } - } - return exportedNames; -} -function multiMapSparseArrayAdd(map2, key, value) { - let values = map2[key]; - if (values) { - values.push(value); - } else { - map2[key] = values = [value]; - } - return values; -} -var 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); - } -}; -var 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); - } - } - } -}; -function isSimpleCopiableExpression(expression) { - return isStringLiteralLike(expression) || expression.kind === 9 /* NumericLiteral */ || isKeyword(expression.kind) || isIdentifier(expression); -} -function isSimpleInlineableExpression(expression) { - return !isIdentifier(expression) && isSimpleCopiableExpression(expression); -} -function isCompoundAssignment(kind) { - return kind >= 65 /* FirstCompoundAssignment */ && kind <= 79 /* LastCompoundAssignment */; -} -function getNonAssignmentOperatorForCompoundAssignment(kind) { - switch (kind) { - case 65 /* PlusEqualsToken */: - return 40 /* PlusToken */; - case 66 /* MinusEqualsToken */: - return 41 /* MinusToken */; - case 67 /* AsteriskEqualsToken */: - return 42 /* AsteriskToken */; - case 68 /* AsteriskAsteriskEqualsToken */: - return 43 /* AsteriskAsteriskToken */; - case 69 /* SlashEqualsToken */: - return 44 /* SlashToken */; - case 70 /* PercentEqualsToken */: - return 45 /* PercentToken */; - case 71 /* LessThanLessThanEqualsToken */: - return 48 /* LessThanLessThanToken */; - case 72 /* GreaterThanGreaterThanEqualsToken */: - return 49 /* GreaterThanGreaterThanToken */; - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return 50 /* GreaterThanGreaterThanGreaterThanToken */; - case 74 /* AmpersandEqualsToken */: - return 51 /* AmpersandToken */; - case 75 /* BarEqualsToken */: - return 52 /* BarToken */; - case 79 /* CaretEqualsToken */: - return 53 /* CaretToken */; - case 76 /* BarBarEqualsToken */: - return 57 /* BarBarToken */; - case 77 /* AmpersandAmpersandEqualsToken */: - return 56 /* AmpersandAmpersandToken */; - case 78 /* QuestionQuestionEqualsToken */: - return 61 /* QuestionQuestionToken */; - } -} -function getSuperCallFromStatement(statement) { - if (!isExpressionStatement(statement)) { - return void 0; - } - const expression = skipParentheses(statement.expression); - return isSuperCall(expression) ? expression : void 0; -} -function findSuperStatementIndexPathWorker(statements, start, indices) { - for (let i = start; i < statements.length; i += 1) { - const statement = statements[i]; - if (getSuperCallFromStatement(statement)) { - indices.unshift(i); - return true; - } else if (isTryStatement(statement) && findSuperStatementIndexPathWorker(statement.tryBlock.statements, 0, indices)) { - indices.unshift(i); - return true; - } - } - 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)); -} -function isStaticPropertyDeclarationOrClassStaticBlockDeclaration(element) { - return isStaticPropertyDeclaration(element) || isClassStaticBlockDeclaration(element); -} -function getStaticPropertiesAndClassStaticBlock(node) { - return filter(node.members, isStaticPropertyDeclarationOrClassStaticBlockDeclaration); -} -function isInitializedOrStaticProperty(member, requireInitializer, isStatic2) { - return isPropertyDeclaration(member) && (!!member.initializer || !requireInitializer) && hasStaticModifier(member) === isStatic2; -} -function isStaticPropertyDeclaration(member) { - return isPropertyDeclaration(member) && hasStaticModifier(member); -} -function isInitializedProperty(member) { - return member.kind === 173 /* PropertyDeclaration */ && member.initializer !== void 0; -} -function isNonStaticMethodOrAccessorWithPrivateName(member) { - return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name); -} -function getDecoratorsOfParameters(node) { - let decorators; - if (node) { - const parameters = node.parameters; - const firstParameterIsThis = parameters.length > 0 && parameterIsThisKeyword(parameters[0]); - const firstParameterOffset = firstParameterIsThis ? 1 : 0; - const numParameters = firstParameterIsThis ? parameters.length - 1 : parameters.length; - for (let i = 0; i < numParameters; i++) { - const parameter = parameters[i + firstParameterOffset]; - if (decorators || hasDecorators(parameter)) { - if (!decorators) { - decorators = new Array(numParameters); - } - decorators[i] = getDecorators(parameter); - } - } - } - return decorators; -} -function getAllDecoratorsOfClass(node, useLegacyDecorators) { - const decorators = getDecorators(node); - const parameters = useLegacyDecorators ? getDecoratorsOfParameters(getFirstConstructorWithBody(node)) : void 0; - if (!some(decorators) && !some(parameters)) { - return void 0; - } - return { - decorators, - parameters - }; -} -function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { - switch (member.kind) { - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - if (!useLegacyDecorators) { - return getAllDecoratorsOfMethod( - member, - /*useLegacyDecorators*/ - false - ); - } - return getAllDecoratorsOfAccessors( - member, - parent2, - /*useLegacyDecorators*/ - true - ); - case 175 /* MethodDeclaration */: - return getAllDecoratorsOfMethod(member, useLegacyDecorators); - case 173 /* PropertyDeclaration */: - return getAllDecoratorsOfProperty(member); - default: - return void 0; - } -} -function getAllDecoratorsOfAccessors(accessor, parent2, useLegacyDecorators) { - if (!accessor.body) { - return void 0; - } - const { firstAccessor, secondAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(parent2.members, accessor); - const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; - if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { - return void 0; - } - const decorators = getDecorators(firstAccessorWithDecorators); - const parameters = useLegacyDecorators ? getDecoratorsOfParameters(setAccessor) : void 0; - if (!some(decorators) && !some(parameters)) { - return void 0; - } - return { - decorators, - parameters, - getDecorators: getAccessor && getDecorators(getAccessor), - setDecorators: setAccessor && getDecorators(setAccessor) - }; -} -function getAllDecoratorsOfMethod(method, useLegacyDecorators) { - if (!method.body) { - return void 0; - } - const decorators = getDecorators(method); - const parameters = useLegacyDecorators ? getDecoratorsOfParameters(method) : void 0; - if (!some(decorators) && !some(parameters)) { - return void 0; - } - return { decorators, parameters }; -} -function getAllDecoratorsOfProperty(property) { - const decorators = getDecorators(property); - if (!some(decorators)) { - return void 0; - } - return { decorators }; -} -function walkUpLexicalEnvironments(env, cb) { - while (env) { - const result = cb(env); - if (result !== void 0) return result; - env = env.previous; - } -} -function newPrivateEnvironment(data) { - return { data }; -} -function getPrivateIdentifier(privateEnv, name) { - var _a, _b; - return isGeneratedPrivateIdentifier(name) ? (_a = privateEnv == null ? void 0 : privateEnv.generatedIdentifiers) == null ? void 0 : _a.get(getNodeForGeneratedName(name)) : (_b = privateEnv == null ? void 0 : privateEnv.identifiers) == null ? void 0 : _b.get(name.escapedText); -} -function setPrivateIdentifier(privateEnv, name, entry) { - if (isGeneratedPrivateIdentifier(name)) { - privateEnv.generatedIdentifiers ?? (privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map()); - privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name), entry); - } else { - privateEnv.identifiers ?? (privateEnv.identifiers = /* @__PURE__ */ new Map()); - privateEnv.identifiers.set(name.escapedText, entry); - } -} -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); -} -function rewriteModuleSpecifier(node, compilerOptions) { - if (!node || !isStringLiteral(node) || !shouldRewriteModuleSpecifier(node.text, compilerOptions)) { - return node; - } - const updatedText = changeExtension(node.text, getOutputExtension(node.text, compilerOptions)); - return updatedText !== node.text ? setOriginalNode(setTextRange(factory.createStringLiteral(updatedText, node.singleQuote), node), node) : node; -} - -// src/compiler/transformers/destructuring.ts -var FlattenLevel = /* @__PURE__ */ ((FlattenLevel2) => { - FlattenLevel2[FlattenLevel2["All"] = 0] = "All"; - FlattenLevel2[FlattenLevel2["ObjectRest"] = 1] = "ObjectRest"; - return FlattenLevel2; -})(FlattenLevel || {}); -function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) { - let location = node; - let value; - if (isDestructuringAssignment(node)) { - value = node.right; - while (isEmptyArrayLiteral(node.left) || isEmptyObjectLiteral(node.left)) { - if (isDestructuringAssignment(value)) { - location = node = value; - value = node.right; - } else { - return Debug.checkDefined(visitNode(value, visitor, isExpression)); - } - } - } - let expressions; - const flattenContext = { - context, - level, - downlevelIteration: !!context.getCompilerOptions().downlevelIteration, - hoistTempVariables: true, - emitExpression, - emitBindingOrAssignment, - createArrayBindingOrAssignmentPattern: (elements) => makeArrayAssignmentPattern(context.factory, elements), - createObjectBindingOrAssignmentPattern: (elements) => makeObjectAssignmentPattern(context.factory, elements), - createArrayBindingOrAssignmentElement: makeAssignmentElement, - visitor - }; - if (value) { - value = visitNode(value, visitor, isExpression); - Debug.assert(value); - if (isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node)) { - value = ensureIdentifier( - flattenContext, - value, - /*reuseIdentifierExpressions*/ - false, - location - ); - } else if (needsValue) { - value = ensureIdentifier( - flattenContext, - value, - /*reuseIdentifierExpressions*/ - true, - location - ); - } else if (nodeIsSynthesized(node)) { - location = value; - } - } - flattenBindingOrAssignmentElement( - flattenContext, - node, - value, - location, - /*skipInitializer*/ - isDestructuringAssignment(node) - ); - if (value && needsValue) { - if (!some(expressions)) { - return value; - } - expressions.push(value); - } - return context.factory.inlineExpressions(expressions) || context.factory.createOmittedExpression(); - function emitExpression(expression) { - expressions = append(expressions, expression); - } - function emitBindingOrAssignment(target, value2, location2, original) { - Debug.assertNode(target, createAssignmentCallback ? isIdentifier : isExpression); - const expression = createAssignmentCallback ? createAssignmentCallback(target, value2, location2) : setTextRange( - context.factory.createAssignment(Debug.checkDefined(visitNode(target, visitor, isExpression)), value2), - location2 - ); - expression.original = original; - emitExpression(expression); - } -} -function bindingOrAssignmentElementAssignsToName(element, escapedName) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (isBindingOrAssignmentPattern(target)) { - return bindingOrAssignmentPatternAssignsToName(target, escapedName); - } else if (isIdentifier(target)) { - return target.escapedText === escapedName; - } - return false; -} -function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) { - const elements = getElementsOfBindingOrAssignmentPattern(pattern); - for (const element of elements) { - if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { - return true; - } - } - return false; -} -function bindingOrAssignmentElementContainsNonLiteralComputedName(element) { - const propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && isComputedPropertyName(propertyName) && !isLiteralExpression(propertyName.expression)) { - return true; - } - const target = getTargetOfBindingOrAssignmentElement(element); - return !!target && isBindingOrAssignmentPattern(target) && bindingOrAssignmentPatternContainsNonLiteralComputedName(target); -} -function bindingOrAssignmentPatternContainsNonLiteralComputedName(pattern) { - return !!forEach(getElementsOfBindingOrAssignmentPattern(pattern), bindingOrAssignmentElementContainsNonLiteralComputedName); -} -function flattenDestructuringBinding(node, visitor, context, level, rval, hoistTempVariables = false, skipInitializer) { - let pendingExpressions; - const pendingDeclarations = []; - const declarations = []; - const flattenContext = { - context, - level, - downlevelIteration: !!context.getCompilerOptions().downlevelIteration, - hoistTempVariables, - emitExpression, - emitBindingOrAssignment, - createArrayBindingOrAssignmentPattern: (elements) => makeArrayBindingPattern(context.factory, elements), - createObjectBindingOrAssignmentPattern: (elements) => makeObjectBindingPattern(context.factory, elements), - createArrayBindingOrAssignmentElement: (name) => makeBindingElement(context.factory, name), - visitor - }; - if (isVariableDeclaration(node)) { - let initializer = getInitializerOfBindingOrAssignmentElement(node); - if (initializer && (isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node))) { - initializer = ensureIdentifier( - flattenContext, - Debug.checkDefined(visitNode(initializer, flattenContext.visitor, isExpression)), - /*reuseIdentifierExpressions*/ - false, - initializer - ); - node = context.factory.updateVariableDeclaration( - node, - node.name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ); - } - } - flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); - if (pendingExpressions) { - const temp = context.factory.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - if (hoistTempVariables) { - const value = context.factory.inlineExpressions(pendingExpressions); - pendingExpressions = void 0; - emitBindingOrAssignment( - temp, - value, - /*location*/ - void 0, - /*original*/ - void 0 - ); - } else { - context.hoistVariableDeclaration(temp); - const pendingDeclaration = last(pendingDeclarations); - pendingDeclaration.pendingExpressions = append( - pendingDeclaration.pendingExpressions, - context.factory.createAssignment(temp, pendingDeclaration.value) - ); - addRange(pendingDeclaration.pendingExpressions, pendingExpressions); - pendingDeclaration.value = temp; - } - } - for (const { pendingExpressions: pendingExpressions2, name, value, location, original } of pendingDeclarations) { - const variable = context.factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - pendingExpressions2 ? context.factory.inlineExpressions(append(pendingExpressions2, value)) : value - ); - variable.original = original; - setTextRange(variable, location); - declarations.push(variable); - } - return declarations; - function emitExpression(value) { - pendingExpressions = append(pendingExpressions, value); - } - function emitBindingOrAssignment(target, value, location, original) { - Debug.assertNode(target, isBindingName); - if (pendingExpressions) { - value = context.factory.inlineExpressions(append(pendingExpressions, value)); - pendingExpressions = void 0; - } - pendingDeclarations.push({ pendingExpressions, name: target, value, location, original }); - } -} -function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) { - const bindingTarget = getTargetOfBindingOrAssignmentElement(element); - if (!skipInitializer) { - const initializer = visitNode(getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, isExpression); - if (initializer) { - if (value) { - value = createDefaultValueCheck(flattenContext, value, initializer, location); - if (!isSimpleInlineableExpression(initializer) && isBindingOrAssignmentPattern(bindingTarget)) { - value = ensureIdentifier( - flattenContext, - value, - /*reuseIdentifierExpressions*/ - true, - location - ); - } - } else { - value = initializer; - } - } else if (!value) { - value = flattenContext.context.factory.createVoidZero(); - } - } - if (isObjectBindingOrAssignmentPattern(bindingTarget)) { - flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); - } else if (isArrayBindingOrAssignmentPattern(bindingTarget)) { - flattenArrayBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); - } else { - flattenContext.emitBindingOrAssignment( - bindingTarget, - value, - location, - /*original*/ - element - ); - } -} -function flattenObjectBindingOrAssignmentPattern(flattenContext, parent2, pattern, value, location) { - const elements = getElementsOfBindingOrAssignmentPattern(pattern); - const numElements = elements.length; - if (numElements !== 1) { - const reuseIdentifierExpressions = !isDeclarationBindingElement(parent2) || numElements !== 0; - value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); - } - let bindingElements; - let computedTempVariables; - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { - const propertyName = getPropertyNameOfBindingOrAssignmentElement(element); - if (flattenContext.level >= 1 /* ObjectRest */ && !(element.transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !(getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* ContainsRestOrSpread */ | 65536 /* ContainsObjectRestOrSpread */)) && !isComputedPropertyName(propertyName)) { - bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor, isBindingOrAssignmentElement)); - } else { - if (bindingElements) { - flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern); - bindingElements = void 0; - } - const rhsValue = createDestructuringPropertyAccess(flattenContext, value, propertyName); - if (isComputedPropertyName(propertyName)) { - computedTempVariables = append(computedTempVariables, rhsValue.argumentExpression); - } - flattenBindingOrAssignmentElement( - flattenContext, - element, - rhsValue, - /*location*/ - element - ); - } - } else if (i === numElements - 1) { - if (bindingElements) { - flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern); - bindingElements = void 0; - } - const rhsValue = flattenContext.context.getEmitHelperFactory().createRestHelper(value, elements, computedTempVariables, pattern); - flattenBindingOrAssignmentElement(flattenContext, element, rhsValue, element); - } - } - if (bindingElements) { - flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern); - } -} -function flattenArrayBindingOrAssignmentPattern(flattenContext, parent2, pattern, value, location) { - const elements = getElementsOfBindingOrAssignmentPattern(pattern); - const numElements = elements.length; - if (flattenContext.level < 1 /* ObjectRest */ && flattenContext.downlevelIteration) { - value = ensureIdentifier( - flattenContext, - setTextRange( - flattenContext.context.getEmitHelperFactory().createReadHelper( - value, - numElements > 0 && getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) ? void 0 : numElements - ), - location - ), - /*reuseIdentifierExpressions*/ - false, - location - ); - } else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0) || every(elements, isOmittedExpression)) { - const reuseIdentifierExpressions = !isDeclarationBindingElement(parent2) || numElements !== 0; - value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); - } - let bindingElements; - let restContainingElements; - for (let i = 0; i < numElements; i++) { - const element = elements[i]; - if (flattenContext.level >= 1 /* ObjectRest */) { - if (element.transformFlags & 65536 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { - flattenContext.hasTransformedPriorElement = true; - const temp = flattenContext.context.factory.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - if (flattenContext.hoistTempVariables) { - flattenContext.context.hoistVariableDeclaration(temp); - } - restContainingElements = append(restContainingElements, [temp, element]); - bindingElements = append(bindingElements, flattenContext.createArrayBindingOrAssignmentElement(temp)); - } else { - bindingElements = append(bindingElements, element); - } - } else if (isOmittedExpression(element)) { - continue; - } else if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { - const rhsValue = flattenContext.context.factory.createElementAccessExpression(value, i); - flattenBindingOrAssignmentElement( - flattenContext, - element, - rhsValue, - /*location*/ - element - ); - } else if (i === numElements - 1) { - const rhsValue = flattenContext.context.factory.createArraySliceCall(value, i); - flattenBindingOrAssignmentElement( - flattenContext, - element, - rhsValue, - /*location*/ - element - ); - } - } - if (bindingElements) { - flattenContext.emitBindingOrAssignment(flattenContext.createArrayBindingOrAssignmentPattern(bindingElements), value, location, pattern); - } - if (restContainingElements) { - for (const [id, element] of restContainingElements) { - flattenBindingOrAssignmentElement(flattenContext, element, id, element); - } - } -} -function isSimpleBindingOrAssignmentElement(element) { - const target = getTargetOfBindingOrAssignmentElement(element); - if (!target || isOmittedExpression(target)) return true; - const propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && !isPropertyNameLiteral(propertyName)) return false; - const initializer = getInitializerOfBindingOrAssignmentElement(element); - if (initializer && !isSimpleInlineableExpression(initializer)) return false; - if (isBindingOrAssignmentPattern(target)) return every(getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); - return isIdentifier(target); -} -function createDefaultValueCheck(flattenContext, value, defaultValue, location) { - value = ensureIdentifier( - flattenContext, - value, - /*reuseIdentifierExpressions*/ - true, - location - ); - return flattenContext.context.factory.createConditionalExpression( - flattenContext.context.factory.createTypeCheck(value, "undefined"), - /*questionToken*/ - void 0, - defaultValue, - /*colonToken*/ - void 0, - value - ); -} -function createDestructuringPropertyAccess(flattenContext, value, propertyName) { - const { factory: factory2 } = flattenContext.context; - if (isComputedPropertyName(propertyName)) { - const argumentExpression = ensureIdentifier( - flattenContext, - Debug.checkDefined(visitNode(propertyName.expression, flattenContext.visitor, isExpression)), - /*reuseIdentifierExpressions*/ - false, - /*location*/ - propertyName - ); - return flattenContext.context.factory.createElementAccessExpression(value, argumentExpression); - } else if (isStringOrNumericLiteralLike(propertyName) || isBigIntLiteral(propertyName)) { - const argumentExpression = factory2.cloneNode(propertyName); - return flattenContext.context.factory.createElementAccessExpression(value, argumentExpression); - } else { - const name = flattenContext.context.factory.createIdentifier(idText(propertyName)); - return flattenContext.context.factory.createPropertyAccessExpression(value, name); - } -} -function ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location) { - if (isIdentifier(value) && reuseIdentifierExpressions) { - return value; - } else { - const temp = flattenContext.context.factory.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - if (flattenContext.hoistTempVariables) { - flattenContext.context.hoistVariableDeclaration(temp); - flattenContext.emitExpression(setTextRange(flattenContext.context.factory.createAssignment(temp, value), location)); - } else { - flattenContext.emitBindingOrAssignment( - temp, - value, - location, - /*original*/ - void 0 - ); - } - return temp; - } -} -function makeArrayBindingPattern(factory2, elements) { - Debug.assertEachNode(elements, isArrayBindingElement); - return factory2.createArrayBindingPattern(elements); -} -function makeArrayAssignmentPattern(factory2, elements) { - Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement); - return factory2.createArrayLiteralExpression(map(elements, factory2.converters.convertToArrayAssignmentElement)); -} -function makeObjectBindingPattern(factory2, elements) { - Debug.assertEachNode(elements, isBindingElement); - return factory2.createObjectBindingPattern(elements); -} -function makeObjectAssignmentPattern(factory2, elements) { - Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement); - return factory2.createObjectLiteralExpression(map(elements, factory2.converters.convertToObjectAssignmentElement)); -} -function makeBindingElement(factory2, name) { - return factory2.createBindingElement( - /*dotDotDotToken*/ - void 0, - /*propertyName*/ - void 0, - name - ); -} -function makeAssignmentElement(name) { - return name; -} - -// 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; -} - -// 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 304 /* PropertyAssignment */: - return transformNamedEvaluationOfPropertyAssignment(context, node, ignoreEmptyStringLiteral, assignedName); - case 305 /* ShorthandPropertyAssignment */: - return transformNamedEvaluationOfShorthandAssignmentProperty(context, node, ignoreEmptyStringLiteral, assignedName); - case 261 /* VariableDeclaration */: - return transformNamedEvaluationOfVariableDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 170 /* Parameter */: - return transformNamedEvaluationOfParameterDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 209 /* BindingElement */: - return transformNamedEvaluationOfBindingElement(context, node, ignoreEmptyStringLiteral, assignedName); - case 173 /* PropertyDeclaration */: - return transformNamedEvaluationOfPropertyDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 227 /* BinaryExpression */: - return transformNamedEvaluationOfAssignmentExpression(context, node, ignoreEmptyStringLiteral, assignedName); - case 278 /* ExportAssignment */: - return transformNamedEvaluationOfExportAssignment(context, node, ignoreEmptyStringLiteral, assignedName); - } -} - -// src/compiler/transformers/taggedTemplate.ts -var ProcessLevel = /* @__PURE__ */ ((ProcessLevel2) => { - ProcessLevel2[ProcessLevel2["LiftRestriction"] = 0] = "LiftRestriction"; - ProcessLevel2[ProcessLevel2["All"] = 1] = "All"; - return ProcessLevel2; -})(ProcessLevel || {}); -function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { - const tag = visitNode(node.tag, visitor, isExpression); - Debug.assert(tag); - const templateArguments = [void 0]; - const cookedStrings = []; - const rawStrings = []; - const template = node.template; - if (level === 0 /* LiftRestriction */ && !hasInvalidEscape(template)) { - return visitEachChild(node, visitor, context); - } - const { factory: factory2 } = context; - if (isNoSubstitutionTemplateLiteral(template)) { - cookedStrings.push(createTemplateCooked(factory2, template)); - rawStrings.push(getRawLiteral(factory2, template, currentSourceFile)); - } else { - cookedStrings.push(createTemplateCooked(factory2, template.head)); - rawStrings.push(getRawLiteral(factory2, template.head, currentSourceFile)); - for (const templateSpan of template.templateSpans) { - cookedStrings.push(createTemplateCooked(factory2, templateSpan.literal)); - rawStrings.push(getRawLiteral(factory2, templateSpan.literal, currentSourceFile)); - templateArguments.push(Debug.checkDefined(visitNode(templateSpan.expression, visitor, isExpression))); - } - } - const helperCall = context.getEmitHelperFactory().createTemplateObjectHelper( - factory2.createArrayLiteralExpression(cookedStrings), - factory2.createArrayLiteralExpression(rawStrings) - ); - if (isExternalModule(currentSourceFile)) { - const tempVar = factory2.createUniqueName("templateObject"); - recordTaggedTemplateString(tempVar); - templateArguments[0] = factory2.createLogicalOr( - tempVar, - factory2.createAssignment( - tempVar, - helperCall - ) - ); - } else { - templateArguments[0] = helperCall; - } - return factory2.createCallExpression( - tag, - /*typeArguments*/ - void 0, - templateArguments - ); -} -function createTemplateCooked(factory2, template) { - return template.templateFlags & 26656 /* IsInvalid */ ? factory2.createVoidZero() : factory2.createStringLiteral(template.text); -} -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."); - text = getSourceTextOfNodeFromSourceFile(currentSourceFile, node); - const isLast = node.kind === 15 /* NoSubstitutionTemplateLiteral */ || node.kind === 18 /* TemplateTail */; - text = text.substring(1, text.length - (isLast ? 1 : 2)); - } - text = text.replace(/\r\n?/g, "\n"); - return setTextRange(factory2.createStringLiteral(text), node); -} - -// src/compiler/transformers/ts.ts -var USE_NEW_TYPE_METADATA_FORMAT = false; -function transformTypeScript(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - startLexicalEnvironment, - resumeLexicalEnvironment, - endLexicalEnvironment, - hoistVariableDeclaration - } = context; - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); - const legacyDecorators = !!compilerOptions.experimentalDecorators; - const typeSerializer = compilerOptions.emitDecoratorMetadata ? createRuntimeTypeSerializer(context) : void 0; - const previousOnEmitNode = context.onEmitNode; - const previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(212 /* PropertyAccessExpression */); - context.enableSubstitution(213 /* ElementAccessExpression */); - let currentSourceFile; - let currentNamespace; - let currentNamespaceContainerName; - let currentLexicalScope; - let currentScopeFirstDeclarationsOfName; - let enabledSubstitutions = 0 /* None */; - let applicableSubstitutions; - return transformSourceFileOrBundle; - function transformSourceFileOrBundle(node) { - if (node.kind === 309 /* Bundle */) { - return transformBundle(node); - } - return transformSourceFile(node); - } - function transformBundle(node) { - return factory2.createBundle( - node.sourceFiles.map(transformSourceFile) - ); - } - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - currentSourceFile = node; - const visited = saveStateAndInvoke(node, visitSourceFile); - addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = void 0; - return visited; - } - function saveStateAndInvoke(node, f) { - const savedCurrentScope = currentLexicalScope; - const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; - onBeforeVisitNode(node); - const visited = f(node); - if (currentLexicalScope !== savedCurrentScope) { - currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - } - currentLexicalScope = savedCurrentScope; - return visited; - } - function onBeforeVisitNode(node) { - switch (node.kind) { - case 308 /* SourceFile */: - case 270 /* CaseBlock */: - case 269 /* ModuleBlock */: - case 242 /* Block */: - currentLexicalScope = node; - currentScopeFirstDeclarationsOfName = void 0; - break; - case 264 /* ClassDeclaration */: - case 263 /* FunctionDeclaration */: - if (hasSyntacticModifier(node, 128 /* Ambient */)) { - break; - } - if (node.name) { - recordEmittedDeclarationInScope(node); - } else { - Debug.assert(node.kind === 264 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */)); - } - break; - } - } - function visitor(node) { - return saveStateAndInvoke(node, visitorWorker); - } - function visitorWorker(node) { - if (node.transformFlags & 1 /* ContainsTypeScript */) { - return visitTypeScript(node); - } - return node; - } - function sourceElementVisitor(node) { - return saveStateAndInvoke(node, sourceElementVisitorWorker); - } - function sourceElementVisitorWorker(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 278 /* ExportAssignment */: - case 279 /* ExportDeclaration */: - return visitElidableStatement(node); - default: - return visitorWorker(node); - } - } - function isElisionBlocked(node) { - const parsed = getParseTreeNode(node); - if (parsed === node || isExportAssignment(node)) { - return false; - } - if (!parsed || parsed.kind !== node.kind) { - return true; - } - switch (node.kind) { - case 273 /* ImportDeclaration */: - Debug.assertNode(parsed, isImportDeclaration); - if (node.importClause !== parsed.importClause) { - return true; - } - if (node.attributes !== parsed.attributes) { - return true; - } - break; - case 272 /* 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 279 /* 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 273 /* ImportDeclaration */: - return visitImportDeclaration(node); - case 272 /* ImportEqualsDeclaration */: - return visitImportEqualsDeclaration(node); - case 278 /* ExportAssignment */: - return visitExportAssignment(node); - case 279 /* ExportDeclaration */: - return visitExportDeclaration(node); - default: - Debug.fail("Unhandled ellided statement"); - } - } - function namespaceElementVisitor(node) { - return saveStateAndInvoke(node, namespaceElementVisitorWorker); - } - function namespaceElementVisitorWorker(node) { - if (node.kind === 279 /* ExportDeclaration */ || node.kind === 273 /* ImportDeclaration */ || node.kind === 274 /* ImportClause */ || node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 284 /* ExternalModuleReference */) { - return void 0; - } else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) { - return visitTypeScript(node); - } - return node; - } - function getClassElementVisitor(parent2) { - return (node) => saveStateAndInvoke(node, (n) => classElementVisitorWorker(n, parent2)); - } - function classElementVisitorWorker(node, parent2) { - switch (node.kind) { - case 177 /* Constructor */: - return visitConstructor(node); - case 173 /* PropertyDeclaration */: - return visitPropertyDeclaration(node, parent2); - case 178 /* GetAccessor */: - return visitGetAccessor(node, parent2); - case 179 /* SetAccessor */: - return visitSetAccessor(node, parent2); - case 175 /* MethodDeclaration */: - return visitMethodDeclaration(node, parent2); - case 176 /* ClassStaticBlockDeclaration */: - return visitEachChild(node, visitor, context); - case 241 /* SemicolonClassElement */: - return node; - case 182 /* IndexSignature */: - return; - default: - return Debug.failBadSyntaxKind(node); - } - } - function getObjectLiteralElementVisitor(parent2) { - return (node) => saveStateAndInvoke(node, (n) => objectLiteralElementVisitorWorker(n, parent2)); - } - function objectLiteralElementVisitorWorker(node, parent2) { - switch (node.kind) { - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - case 306 /* SpreadAssignment */: - return visitor(node); - case 178 /* GetAccessor */: - return visitGetAccessor(node, parent2); - case 179 /* SetAccessor */: - return visitSetAccessor(node, parent2); - case 175 /* MethodDeclaration */: - return visitMethodDeclaration(node, parent2); - default: - return Debug.failBadSyntaxKind(node); - } - } - function decoratorElidingVisitor(node) { - return isDecorator(node) ? void 0 : visitor(node); - } - function modifierElidingVisitor(node) { - return isModifier(node) ? void 0 : visitor(node); - } - function modifierVisitor(node) { - if (isDecorator(node)) return void 0; - if (modifierToFlag(node.kind) & 28895 /* TypeScriptModifier */) { - return void 0; - } else if (currentNamespace && node.kind === 95 /* ExportKeyword */) { - return void 0; - } - return node; - } - function visitTypeScript(node) { - if (isStatement(node) && hasSyntacticModifier(node, 128 /* Ambient */)) { - return factory2.createNotEmittedStatement(node); - } - switch (node.kind) { - case 95 /* ExportKeyword */: - case 90 /* DefaultKeyword */: - return currentNamespace ? void 0 : node; - case 125 /* PublicKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - case 128 /* AbstractKeyword */: - case 164 /* OverrideKeyword */: - case 87 /* ConstKeyword */: - case 138 /* DeclareKeyword */: - case 148 /* ReadonlyKeyword */: - case 103 /* InKeyword */: - case 147 /* OutKeyword */: - // TypeScript accessibility and readonly modifiers are elided - // falls through - case 189 /* ArrayType */: - case 190 /* TupleType */: - case 191 /* OptionalType */: - case 192 /* RestType */: - case 188 /* TypeLiteral */: - case 183 /* TypePredicate */: - case 169 /* TypeParameter */: - case 133 /* AnyKeyword */: - case 159 /* UnknownKeyword */: - case 136 /* BooleanKeyword */: - case 154 /* StringKeyword */: - case 150 /* NumberKeyword */: - case 146 /* NeverKeyword */: - case 116 /* VoidKeyword */: - case 155 /* SymbolKeyword */: - case 186 /* ConstructorType */: - case 185 /* FunctionType */: - case 187 /* TypeQuery */: - case 184 /* TypeReference */: - case 193 /* UnionType */: - case 194 /* IntersectionType */: - case 195 /* ConditionalType */: - case 197 /* ParenthesizedType */: - case 198 /* ThisType */: - case 199 /* TypeOperator */: - case 200 /* IndexedAccessType */: - case 201 /* MappedType */: - case 202 /* LiteralType */: - // TypeScript type nodes are elided. - // falls through - case 182 /* IndexSignature */: - return void 0; - case 266 /* TypeAliasDeclaration */: - return factory2.createNotEmittedStatement(node); - case 271 /* NamespaceExportDeclaration */: - return void 0; - case 265 /* InterfaceDeclaration */: - return factory2.createNotEmittedStatement(node); - case 264 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 232 /* ClassExpression */: - return visitClassExpression(node); - case 299 /* HeritageClause */: - return visitHeritageClause(node); - case 234 /* ExpressionWithTypeArguments */: - return visitExpressionWithTypeArguments(node); - case 211 /* ObjectLiteralExpression */: - return visitObjectLiteralExpression(node); - case 177 /* Constructor */: - case 173 /* PropertyDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 176 /* ClassStaticBlockDeclaration */: - return Debug.fail("Class and object literal elements must be visited with their respective visitors"); - case 263 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 219 /* FunctionExpression */: - return visitFunctionExpression(node); - case 220 /* ArrowFunction */: - return visitArrowFunction(node); - case 170 /* Parameter */: - return visitParameter(node); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node); - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - return visitAssertionExpression(node); - case 239 /* SatisfiesExpression */: - return visitSatisfiesExpression(node); - case 214 /* CallExpression */: - return visitCallExpression(node); - case 215 /* NewExpression */: - return visitNewExpression(node); - case 216 /* TaggedTemplateExpression */: - return visitTaggedTemplateExpression(node); - case 236 /* NonNullExpression */: - return visitNonNullExpression(node); - case 267 /* EnumDeclaration */: - return visitEnumDeclaration(node); - case 244 /* VariableStatement */: - return visitVariableStatement(node); - case 261 /* VariableDeclaration */: - return visitVariableDeclaration(node); - case 268 /* ModuleDeclaration */: - return visitModuleDeclaration(node); - case 272 /* ImportEqualsDeclaration */: - return visitImportEqualsDeclaration(node); - case 286 /* JsxSelfClosingElement */: - return visitJsxSelfClosingElement(node); - case 287 /* JsxOpeningElement */: - return visitJsxJsxOpeningElement(node); - default: - return visitEachChild(node, visitor, context); - } - } - function visitSourceFile(node) { - const alwaysStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") && !(isExternalModule(node) && moduleKind >= 5 /* ES2015 */) && !isJsonSourceFile(node); - return factory2.updateSourceFile( - node, - visitLexicalEnvironment( - node.statements, - sourceElementVisitor, - context, - /*start*/ - 0, - alwaysStrict - ) - ); - } - function visitObjectLiteralExpression(node) { - return factory2.updateObjectLiteralExpression( - node, - visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElementLike) - ); - } - function getClassFacts(node) { - let facts = 0 /* None */; - if (some(getProperties( - node, - /*requireInitializer*/ - true, - /*isStatic*/ - true - ))) facts |= 1 /* HasStaticInitializedProperties */; - const extendsClauseElement = getEffectiveBaseTypeNode(node); - if (extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106 /* NullKeyword */) facts |= 64 /* IsDerivedClass */; - if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) facts |= 2 /* HasClassOrConstructorParameterDecorators */; - if (childIsDecorated(legacyDecorators, node)) facts |= 4 /* HasMemberDecorators */; - if (isExportOfNamespace(node)) facts |= 8 /* IsExportOfNamespace */; - else if (isDefaultExternalModuleExport(node)) facts |= 32 /* IsDefaultExternalExport */; - else if (isNamedExternalModuleExport(node)) facts |= 16 /* IsNamedExternalExport */; - return facts; - } - function hasTypeScriptClassSyntax(node) { - return !!(node.transformFlags & 8192 /* ContainsTypeScriptClassSyntax */); - } - function isClassLikeDeclarationWithTypeScriptSyntax(node) { - return hasDecorators(node) || some(node.typeParameters) || some(node.heritageClauses, hasTypeScriptClassSyntax) || some(node.members, hasTypeScriptClassSyntax); - } - function visitClassDeclaration(node) { - const facts = getClassFacts(node); - const promoteToIIFE = languageVersion <= 1 /* ES5 */ && !!(facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */); - if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !classOrConstructorParameterIsDecorated(legacyDecorators, node) && !isExportOfNamespace(node)) { - return factory2.updateClassDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - node.name, - /*typeParameters*/ - void 0, - visitNodes2(node.heritageClauses, visitor, isHeritageClause), - visitNodes2(node.members, getClassElementVisitor(node), isClassElement) - ); - } - if (promoteToIIFE) { - context.startLexicalEnvironment(); - } - const moveModifiers = promoteToIIFE || facts & 8 /* IsExportOfNamespace */; - let modifiers = moveModifiers ? visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, visitor, isModifierLike); - if (facts & 2 /* HasClassOrConstructorParameterDecorators */) { - modifiers = injectClassTypeMetadata(modifiers, node); - } - const needsName = moveModifiers && !node.name || facts & 4 /* HasMemberDecorators */ || facts & 1 /* HasStaticInitializedProperties */; - const name = needsName ? node.name ?? factory2.getGeneratedNameForNode(node) : node.name; - const classDeclaration = factory2.updateClassDeclaration( - node, - modifiers, - name, - /*typeParameters*/ - void 0, - visitNodes2(node.heritageClauses, visitor, isHeritageClause), - transformClassMembers(node) - ); - let emitFlags = getEmitFlags(node); - if (facts & 1 /* HasStaticInitializedProperties */) { - emitFlags |= 64 /* NoTrailingSourceMap */; - } - setEmitFlags(classDeclaration, emitFlags); - let statement; - if (promoteToIIFE) { - const statements = [classDeclaration]; - const closingBraceLocation = createTokenRange(skipTrivia(currentSourceFile.text, node.members.end), 20 /* CloseBraceToken */); - const localName = factory2.getInternalName(node); - const outer = factory2.createPartiallyEmittedExpression(localName); - setTextRangeEnd(outer, closingBraceLocation.end); - setEmitFlags(outer, 3072 /* NoComments */); - const returnStatement = factory2.createReturnStatement(outer); - setTextRangePos(returnStatement, closingBraceLocation.pos); - setEmitFlags(returnStatement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); - statements.push(returnStatement); - insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment()); - const iife = factory2.createImmediatelyInvokedArrowFunction(statements); - setInternalEmitFlags(iife, 1 /* TypeScriptClassWrapper */); - 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( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([varDecl], 1 /* Let */) - ); - setOriginalNode(varStatement, node); - setCommentRange(varStatement, node); - setSourceMapRange(varStatement, moveRangePastDecorators(node)); - startOnNewLine(varStatement); - statement = varStatement; - } else { - statement = classDeclaration; - } - if (moveModifiers) { - if (facts & 8 /* IsExportOfNamespace */) { - return [ - statement, - createExportMemberAssignmentStatement(node) - ]; - } - if (facts & 32 /* IsDefaultExternalExport */) { - return [ - statement, - factory2.createExportDefault(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - )) - ]; - } - if (facts & 16 /* IsNamedExternalExport */) { - return [ - statement, - factory2.createExternalModuleExport(factory2.getDeclarationName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - )) - ]; - } - } - return statement; - } - function visitClassExpression(node) { - let modifiers = visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike); - if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) { - modifiers = injectClassTypeMetadata(modifiers, node); - } - return factory2.updateClassExpression( - node, - modifiers, - node.name, - /*typeParameters*/ - void 0, - visitNodes2(node.heritageClauses, visitor, isHeritageClause), - transformClassMembers(node) - ); - } - function transformClassMembers(node) { - const members = visitNodes2(node.members, getClassElementVisitor(node), isClassElement); - let newMembers; - const constructor = getFirstConstructorWithBody(node); - const parametersWithPropertyAssignments = constructor && filter(constructor.parameters, (p) => isParameterPropertyDeclaration(p, constructor)); - if (parametersWithPropertyAssignments) { - for (const parameter of parametersWithPropertyAssignments) { - const parameterProperty = factory2.createPropertyDeclaration( - /*modifiers*/ - void 0, - parameter.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ); - setOriginalNode(parameterProperty, parameter); - newMembers = append(newMembers, parameterProperty); - } - } - if (newMembers) { - newMembers = addRange(newMembers, members); - return setTextRange( - factory2.createNodeArray(newMembers), - /*location*/ - node.members - ); - } - return members; - } - function injectClassTypeMetadata(modifiers, node) { - const metadata = getTypeMetadata(node, node); - if (some(metadata)) { - const modifiersArray = []; - addRange(modifiersArray, takeWhile(modifiers, isExportOrDefaultModifier)); - addRange(modifiersArray, filter(modifiers, isDecorator)); - addRange(modifiersArray, metadata); - addRange(modifiersArray, filter(skipWhile(modifiers, isExportOrDefaultModifier), isModifier)); - modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); - } - return modifiers; - } - function injectClassElementTypeMetadata(modifiers, node, container) { - if (isClassLike(container) && classElementOrClassElementParameterIsDecorated(legacyDecorators, node, container)) { - const metadata = getTypeMetadata(node, container); - if (some(metadata)) { - const modifiersArray = []; - addRange(modifiersArray, filter(modifiers, isDecorator)); - addRange(modifiersArray, metadata); - addRange(modifiersArray, filter(modifiers, isModifier)); - modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); - } - } - return modifiers; - } - function getTypeMetadata(node, container) { - if (!legacyDecorators) return void 0; - return USE_NEW_TYPE_METADATA_FORMAT ? getNewTypeMetadata(node, container) : getOldTypeMetadata(node, container); - } - function getOldTypeMetadata(node, container) { - if (typeSerializer) { - let decorators; - if (shouldAddTypeMetadata(node)) { - const typeMetadata = emitHelpers().createMetadataHelper("design:type", typeSerializer.serializeTypeOfNode({ currentLexicalScope, currentNameScope: container }, node, container)); - decorators = append(decorators, factory2.createDecorator(typeMetadata)); - } - if (shouldAddParamTypesMetadata(node)) { - const paramTypesMetadata = emitHelpers().createMetadataHelper("design:paramtypes", typeSerializer.serializeParameterTypesOfNode({ currentLexicalScope, currentNameScope: container }, node, container)); - decorators = append(decorators, factory2.createDecorator(paramTypesMetadata)); - } - if (shouldAddReturnTypeMetadata(node)) { - const returnTypeMetadata = emitHelpers().createMetadataHelper("design:returntype", typeSerializer.serializeReturnTypeOfNode({ currentLexicalScope, currentNameScope: container }, node)); - decorators = append(decorators, factory2.createDecorator(returnTypeMetadata)); - } - return decorators; - } - } - function getNewTypeMetadata(node, container) { - if (typeSerializer) { - let properties; - if (shouldAddTypeMetadata(node)) { - const typeProperty = factory2.createPropertyAssignment("type", factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - [], - /*type*/ - void 0, - factory2.createToken(39 /* EqualsGreaterThanToken */), - typeSerializer.serializeTypeOfNode({ currentLexicalScope, currentNameScope: container }, node, container) - )); - properties = append(properties, typeProperty); - } - if (shouldAddParamTypesMetadata(node)) { - const paramTypeProperty = factory2.createPropertyAssignment("paramTypes", factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - [], - /*type*/ - void 0, - factory2.createToken(39 /* EqualsGreaterThanToken */), - typeSerializer.serializeParameterTypesOfNode({ currentLexicalScope, currentNameScope: container }, node, container) - )); - properties = append(properties, paramTypeProperty); - } - if (shouldAddReturnTypeMetadata(node)) { - const returnTypeProperty = factory2.createPropertyAssignment("returnType", factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - [], - /*type*/ - void 0, - factory2.createToken(39 /* EqualsGreaterThanToken */), - typeSerializer.serializeReturnTypeOfNode({ currentLexicalScope, currentNameScope: container }, node) - )); - properties = append(properties, returnTypeProperty); - } - if (properties) { - const typeInfoMetadata = emitHelpers().createMetadataHelper("design:typeinfo", factory2.createObjectLiteralExpression( - properties, - /*multiLine*/ - true - )); - return [factory2.createDecorator(typeInfoMetadata)]; - } - } - } - function shouldAddTypeMetadata(node) { - const kind = node.kind; - return kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 173 /* PropertyDeclaration */; - } - function shouldAddReturnTypeMetadata(node) { - return node.kind === 175 /* MethodDeclaration */; - } - function shouldAddParamTypesMetadata(node) { - switch (node.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return getFirstConstructorWithBody(node) !== void 0; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return true; - } - return false; - } - function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { - const name = member.name; - if (isPrivateIdentifier(name)) { - return factory2.createIdentifier(""); - } else if (isComputedPropertyName(name)) { - return generateNameForComputedPropertyName && !isSimpleInlineableExpression(name.expression) ? factory2.getGeneratedNameForNode(name) : name.expression; - } else if (isIdentifier(name)) { - return factory2.createStringLiteral(idText(name)); - } else { - return factory2.cloneNode(name); - } - } - function visitPropertyNameOfClassElement(member) { - const name = member.name; - if (legacyDecorators && isComputedPropertyName(name) && hasDecorators(member)) { - const expression = visitNode(name.expression, visitor, isExpression); - Debug.assert(expression); - const innerExpression = skipPartiallyEmittedExpressions(expression); - if (!isSimpleInlineableExpression(innerExpression)) { - const generatedName = factory2.getGeneratedNameForNode(name); - hoistVariableDeclaration(generatedName); - return factory2.updateComputedPropertyName(name, factory2.createAssignment(generatedName, expression)); - } - } - return Debug.checkDefined(visitNode(name, visitor, isPropertyName)); - } - function visitHeritageClause(node) { - if (node.token === 119 /* ImplementsKeyword */) { - return void 0; - } - return visitEachChild(node, visitor, context); - } - function visitExpressionWithTypeArguments(node) { - return factory2.updateExpressionWithTypeArguments( - node, - Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression)), - /*typeArguments*/ - void 0 - ); - } - function shouldEmitFunctionLikeDeclaration(node) { - return !nodeIsMissing(node.body); - } - function visitPropertyDeclaration(node, parent2) { - const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 64 /* Abstract */); - if (isAmbient && !(legacyDecorators && hasDecorators(node))) { - return void 0; - } - let modifiers = isClassLike(parent2) ? !isAmbient ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); - modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); - if (isAmbient) { - return factory2.updatePropertyDeclaration( - node, - concatenate(modifiers, factory2.createModifiersFromModifierFlags(128 /* Ambient */)), - Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ); - } - return factory2.updatePropertyDeclaration( - node, - modifiers, - visitPropertyNameOfClassElement(node), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, visitor, isExpression) - ); - } - function visitConstructor(node) { - if (!shouldEmitFunctionLikeDeclaration(node)) { - return void 0; - } - return factory2.updateConstructorDeclaration( - node, - /*modifiers*/ - void 0, - visitParameterList(node.parameters, visitor, context), - 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)) { - return visitFunctionBody(body, visitor, context); - } - let statements = []; - resumeLexicalEnvironment(); - const prologueStatementCount = factory2.copyPrologue( - body.statements, - statements, - /*ensureUseStrict*/ - false, - visitor - ); - const superPath = findSuperStatementIndexPath(body.statements, prologueStatementCount); - const parameterPropertyAssignments = mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment); - if (superPath.length) { - transformConstructorBodyWorker( - statements, - body.statements, - prologueStatementCount, - superPath, - /*superPathDepth*/ - 0, - parameterPropertyAssignments - ); - } else { - addRange(statements, parameterPropertyAssignments); - addRange(statements, visitNodes2(body.statements, visitor, isStatement, prologueStatementCount)); - } - statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); - const block = factory2.createBlock( - setTextRange(factory2.createNodeArray(statements), body.statements), - /*multiLine*/ - true - ); - setTextRange( - block, - /*location*/ - body - ); - setOriginalNode(block, body); - return block; - } - function transformParameterWithPropertyAssignment(node) { - const name = node.name; - if (!isIdentifier(name)) { - return void 0; - } - const propertyName = setParent(setTextRange(factory2.cloneNode(name), name), name.parent); - setEmitFlags(propertyName, 3072 /* NoComments */ | 96 /* NoSourceMap */); - const localName = setParent(setTextRange(factory2.cloneNode(name), name), name.parent); - setEmitFlags(localName, 3072 /* NoComments */); - return startOnNewLine( - removeAllComments( - setTextRange( - setOriginalNode( - factory2.createExpressionStatement( - factory2.createAssignment( - setTextRange( - factory2.createPropertyAccessExpression( - factory2.createThis(), - propertyName - ), - node.name - ), - localName - ) - ), - node - ), - moveRangePos(node, -1) - ) - ) - ); - } - function visitMethodDeclaration(node, parent2) { - if (!(node.transformFlags & 1 /* ContainsTypeScript */)) { - return node; - } - if (!shouldEmitFunctionLikeDeclaration(node)) { - return void 0; - } - let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); - modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); - return factory2.updateMethodDeclaration( - node, - modifiers, - node.asteriskToken, - visitPropertyNameOfClassElement(node), - /*questionToken*/ - void 0, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - visitFunctionBody(node.body, visitor, context) - ); - } - function shouldEmitAccessorDeclaration(node) { - return !(nodeIsMissing(node.body) && hasSyntacticModifier(node, 64 /* Abstract */)); - } - function visitGetAccessor(node, parent2) { - if (!(node.transformFlags & 1 /* ContainsTypeScript */)) { - return node; - } - if (!shouldEmitAccessorDeclaration(node)) { - return void 0; - } - let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); - modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); - return factory2.updateGetAccessorDeclaration( - node, - modifiers, - visitPropertyNameOfClassElement(node), - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) - ); - } - function visitSetAccessor(node, parent2) { - if (!(node.transformFlags & 1 /* ContainsTypeScript */)) { - return node; - } - if (!shouldEmitAccessorDeclaration(node)) { - return void 0; - } - let modifiers = isClassLike(parent2) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); - modifiers = injectClassElementTypeMetadata(modifiers, node, parent2); - return factory2.updateSetAccessorDeclaration( - node, - modifiers, - visitPropertyNameOfClassElement(node), - visitParameterList(node.parameters, visitor, context), - visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) - ); - } - function visitFunctionDeclaration(node) { - if (!shouldEmitFunctionLikeDeclaration(node)) { - return factory2.createNotEmittedStatement(node); - } - const updated = factory2.updateFunctionDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - node.asteriskToken, - node.name, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) - ); - if (isExportOfNamespace(node)) { - const statements = [updated]; - addExportMemberAssignment(statements, node); - return statements; - } - return updated; - } - function visitFunctionExpression(node) { - if (!shouldEmitFunctionLikeDeclaration(node)) { - return factory2.createOmittedExpression(); - } - const updated = factory2.updateFunctionExpression( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - node.asteriskToken, - node.name, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - visitFunctionBody(node.body, visitor, context) || factory2.createBlock([]) - ); - return updated; - } - function visitArrowFunction(node) { - const updated = factory2.updateArrowFunction( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - node.equalsGreaterThanToken, - visitFunctionBody(node.body, visitor, context) - ); - return updated; - } - function visitParameter(node) { - if (parameterIsThisKeyword(node)) { - return void 0; - } - const updated = factory2.updateParameterDeclaration( - node, - visitNodes2(node.modifiers, (node2) => isDecorator(node2) ? visitor(node2) : void 0, isModifierLike), - node.dotDotDotToken, - Debug.checkDefined(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)); - setSourceMapRange(updated, moveRangePastModifiers(node)); - setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); - } - return updated; - } - function visitVariableStatement(node) { - if (isExportOfNamespace(node)) { - const variables = getInitializedVariables(node.declarationList); - if (variables.length === 0) { - return void 0; - } - return setTextRange( - factory2.createExpressionStatement( - factory2.inlineExpressions( - map(variables, transformInitializedVariable) - ) - ), - node - ); - } else { - return visitEachChild(node, visitor, context); - } - } - function transformInitializedVariable(node) { - const name = node.name; - if (isBindingPattern(name)) { - return flattenDestructuringAssignment( - node, - visitor, - context, - 0 /* All */, - /*needsValue*/ - false, - createNamespaceExportExpression - ); - } else { - return setTextRange( - factory2.createAssignment( - getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), - Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) - ), - /*location*/ - node - ); - } - } - function visitVariableDeclaration(node) { - const updated = factory2.updateVariableDeclaration( - node, - Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, visitor, isExpression) - ); - if (node.type) { - setTypeNode(updated.name, node.type); - } - return updated; - } - function visitParenthesizedExpression(node) { - const innerExpression = skipOuterExpressions(node.expression, ~(38 /* Assertions */ | 16 /* ExpressionsWithTypeArguments */)); - if (isAssertionExpression(innerExpression) || isSatisfiesExpression(innerExpression)) { - const expression = visitNode(node.expression, visitor, isExpression); - Debug.assert(expression); - return factory2.createPartiallyEmittedExpression(expression, node); - } - return visitEachChild(node, visitor, context); - } - function visitAssertionExpression(node) { - const expression = visitNode(node.expression, visitor, isExpression); - Debug.assert(expression); - return factory2.createPartiallyEmittedExpression(expression, node); - } - function visitNonNullExpression(node) { - const expression = visitNode(node.expression, visitor, isLeftHandSideExpression); - Debug.assert(expression); - return factory2.createPartiallyEmittedExpression(expression, node); - } - function visitSatisfiesExpression(node) { - const expression = visitNode(node.expression, visitor, isExpression); - Debug.assert(expression); - return factory2.createPartiallyEmittedExpression(expression, node); - } - function visitCallExpression(node) { - return factory2.updateCallExpression( - node, - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - /*typeArguments*/ - void 0, - visitNodes2(node.arguments, visitor, isExpression) - ); - } - function visitNewExpression(node) { - return factory2.updateNewExpression( - node, - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - /*typeArguments*/ - void 0, - visitNodes2(node.arguments, visitor, isExpression) - ); - } - function visitTaggedTemplateExpression(node) { - return factory2.updateTaggedTemplateExpression( - node, - Debug.checkDefined(visitNode(node.tag, visitor, isExpression)), - /*typeArguments*/ - void 0, - Debug.checkDefined(visitNode(node.template, visitor, isTemplateLiteral)) - ); - } - function visitJsxSelfClosingElement(node) { - return factory2.updateJsxSelfClosingElement( - node, - Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), - /*typeArguments*/ - void 0, - Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) - ); - } - function visitJsxJsxOpeningElement(node) { - return factory2.updateJsxOpeningElement( - node, - Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), - /*typeArguments*/ - void 0, - Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) - ); - } - function shouldEmitEnumDeclaration(node) { - return !isEnumConst(node) || shouldPreserveConstEnums(compilerOptions); - } - function visitEnumDeclaration(node) { - if (!shouldEmitEnumDeclaration(node)) { - return factory2.createNotEmittedStatement(node); - } - const statements = []; - let emitFlags = 4 /* AdviseOnEmitNode */; - const varAdded = addVarForEnumOrModuleDeclaration(statements, node); - if (varAdded) { - if (moduleKind !== 4 /* System */ || currentLexicalScope !== currentSourceFile) { - emitFlags |= 1024 /* NoLeadingComments */; - } - } - const parameterName = getNamespaceParameterName(node); - const containerName = getNamespaceContainerName(node); - const exportName = isExportOfNamespace(node) ? factory2.getExternalModuleOrNamespaceExportName( - currentNamespaceContainerName, - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ) : factory2.getDeclarationName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - let moduleArg = factory2.createLogicalOr( - exportName, - factory2.createAssignment( - exportName, - factory2.createObjectLiteralExpression() - ) - ); - if (isExportOfNamespace(node)) { - const localName = factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - moduleArg = factory2.createAssignment(localName, moduleArg); - } - const enumStatement = factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - parameterName - )], - /*type*/ - void 0, - transformEnumBody(node, containerName) - ), - /*typeArguments*/ - void 0, - [moduleArg] - ) - ); - setOriginalNode(enumStatement, node); - if (varAdded) { - setSyntheticLeadingComments(enumStatement, void 0); - setSyntheticTrailingComments(enumStatement, void 0); - } - setTextRange(enumStatement, node); - addEmitFlags(enumStatement, emitFlags); - statements.push(enumStatement); - return statements; - } - function transformEnumBody(node, localName) { - const savedCurrentNamespaceLocalName = currentNamespaceContainerName; - currentNamespaceContainerName = localName; - const statements = []; - startLexicalEnvironment(); - const members = map(node.members, transformEnumMember); - insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); - addRange(statements, members); - currentNamespaceContainerName = savedCurrentNamespaceLocalName; - return factory2.createBlock( - setTextRange( - factory2.createNodeArray(statements), - /*location*/ - node.members - ), - /*multiLine*/ - true - ); - } - function transformEnumMember(member) { - const name = getExpressionForPropertyName( - member, - /*generateNameForComputedPropertyName*/ - false - ); - const evaluated = resolver.getEnumMemberValue(member); - const valueExpression = transformEnumMemberDeclarationValue(member, evaluated == null ? void 0 : evaluated.value); - const innerAssignment = factory2.createAssignment( - factory2.createElementAccessExpression( - currentNamespaceContainerName, - name - ), - valueExpression - ); - const outerAssignment = typeof (evaluated == null ? void 0 : evaluated.value) === "string" || (evaluated == null ? void 0 : evaluated.isSyntacticallyString) ? innerAssignment : factory2.createAssignment( - factory2.createElementAccessExpression( - currentNamespaceContainerName, - innerAssignment - ), - name - ); - return setTextRange( - factory2.createExpressionStatement( - setTextRange( - outerAssignment, - member - ) - ), - member - ); - } - function transformEnumMemberDeclarationValue(member, constantValue) { - if (constantValue !== void 0) { - return typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue); - } else { - enableSubstitutionForNonQualifiedEnumMembers(); - if (member.initializer) { - return Debug.checkDefined(visitNode(member.initializer, visitor, isExpression)); - } else { - return factory2.createVoidZero(); - } - } - } - function shouldEmitModuleDeclaration(nodeIn) { - const node = getParseTreeNode(nodeIn, isModuleDeclaration); - if (!node) { - return true; - } - return isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions)); - } - function recordEmittedDeclarationInScope(node) { - if (!currentScopeFirstDeclarationsOfName) { - currentScopeFirstDeclarationsOfName = /* @__PURE__ */ new Map(); - } - const name = declaredNameInScope(node); - if (!currentScopeFirstDeclarationsOfName.has(name)) { - currentScopeFirstDeclarationsOfName.set(name, node); - } - } - function isFirstEmittedDeclarationInScope(node) { - if (currentScopeFirstDeclarationsOfName) { - const name = declaredNameInScope(node); - return currentScopeFirstDeclarationsOfName.get(name) === node; - } - return true; - } - function declaredNameInScope(node) { - Debug.assertNode(node.name, isIdentifier); - return node.name.escapedText; - } - function addVarForEnumOrModuleDeclaration(statements, node) { - const varDecl = factory2.createVariableDeclaration(factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - )); - const varFlags = currentLexicalScope.kind === 308 /* SourceFile */ ? 0 /* None */ : 1 /* Let */; - const statement = factory2.createVariableStatement( - visitNodes2(node.modifiers, modifierVisitor, isModifier), - factory2.createVariableDeclarationList([varDecl], varFlags) - ); - setOriginalNode(varDecl, node); - setSyntheticLeadingComments(varDecl, void 0); - setSyntheticTrailingComments(varDecl, void 0); - setOriginalNode(statement, node); - recordEmittedDeclarationInScope(node); - if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 267 /* EnumDeclaration */) { - setSourceMapRange(statement.declarationList, node); - } else { - setSourceMapRange(statement, node); - } - setCommentRange(statement, node); - addEmitFlags(statement, 2048 /* NoTrailingComments */); - statements.push(statement); - return true; - } - return false; - } - function visitModuleDeclaration(node) { - if (!shouldEmitModuleDeclaration(node)) { - return factory2.createNotEmittedStatement(node); - } - Debug.assertNode(node.name, isIdentifier, "A TypeScript namespace should have an Identifier name."); - enableSubstitutionForNamespaceExports(); - const statements = []; - let emitFlags = 4 /* AdviseOnEmitNode */; - const varAdded = addVarForEnumOrModuleDeclaration(statements, node); - if (varAdded) { - if (moduleKind !== 4 /* System */ || currentLexicalScope !== currentSourceFile) { - emitFlags |= 1024 /* NoLeadingComments */; - } - } - const parameterName = getNamespaceParameterName(node); - const containerName = getNamespaceContainerName(node); - const exportName = isExportOfNamespace(node) ? factory2.getExternalModuleOrNamespaceExportName( - currentNamespaceContainerName, - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ) : factory2.getDeclarationName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - let moduleArg = factory2.createLogicalOr( - exportName, - factory2.createAssignment( - exportName, - factory2.createObjectLiteralExpression() - ) - ); - if (isExportOfNamespace(node)) { - const localName = factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - moduleArg = factory2.createAssignment(localName, moduleArg); - } - const moduleStatement = factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - parameterName - )], - /*type*/ - void 0, - transformModuleBody(node, containerName) - ), - /*typeArguments*/ - void 0, - [moduleArg] - ) - ); - setOriginalNode(moduleStatement, node); - if (varAdded) { - setSyntheticLeadingComments(moduleStatement, void 0); - setSyntheticTrailingComments(moduleStatement, void 0); - } - setTextRange(moduleStatement, node); - addEmitFlags(moduleStatement, emitFlags); - statements.push(moduleStatement); - return statements; - } - function transformModuleBody(node, namespaceLocalName) { - const savedCurrentNamespaceContainerName = currentNamespaceContainerName; - const savedCurrentNamespace = currentNamespace; - const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; - currentNamespaceContainerName = namespaceLocalName; - currentNamespace = node; - currentScopeFirstDeclarationsOfName = void 0; - const statements = []; - startLexicalEnvironment(); - let statementsLocation; - let blockLocation; - if (node.body) { - if (node.body.kind === 269 /* ModuleBlock */) { - saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement))); - statementsLocation = node.body.statements; - blockLocation = node.body; - } else { - const result = visitModuleDeclaration(node.body); - if (result) { - if (isArray(result)) { - addRange(statements, result); - } else { - statements.push(result); - } - } - const moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - statementsLocation = moveRangePos(moduleBlock.statements, -1); - } - } - insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); - currentNamespaceContainerName = savedCurrentNamespaceContainerName; - currentNamespace = savedCurrentNamespace; - currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; - const block = factory2.createBlock( - setTextRange( - factory2.createNodeArray(statements), - /*location*/ - statementsLocation - ), - /*multiLine*/ - true - ); - setTextRange(block, blockLocation); - if (!node.body || node.body.kind !== 269 /* ModuleBlock */) { - setEmitFlags(block, getEmitFlags(block) | 3072 /* NoComments */); - } - return block; - } - function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 268 /* ModuleDeclaration */) { - const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); - return recursiveInnerModule || moduleDeclaration.body; - } - } - function visitImportDeclaration(node) { - if (!node.importClause) { - return node; - } - if (node.importClause.isTypeOnly) { - return void 0; - } - const importClause = visitNode(node.importClause, visitImportClause, isImportClause); - return importClause ? factory2.updateImportDeclaration( - node, - /*modifiers*/ - void 0, - importClause, - node.moduleSpecifier, - node.attributes - ) : void 0; - } - function visitImportClause(node) { - Debug.assert(node.phaseModifier !== 156 /* TypeKeyword */); - const name = shouldEmitAliasDeclaration(node) ? node.name : void 0; - const namedBindings = visitNode(node.namedBindings, visitNamedImportBindings, isNamedImportBindings); - return name || namedBindings ? factory2.updateImportClause(node, node.phaseModifier, name, namedBindings) : void 0; - } - function visitNamedImportBindings(node) { - if (node.kind === 275 /* NamespaceImport */) { - return shouldEmitAliasDeclaration(node) ? node : void 0; - } else { - const allowEmpty = compilerOptions.verbatimModuleSyntax; - const elements = visitNodes2(node.elements, visitImportSpecifier, isImportSpecifier); - return allowEmpty || some(elements) ? factory2.updateNamedImports(node, elements) : void 0; - } - } - function visitImportSpecifier(node) { - return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : void 0; - } - function visitExportAssignment(node) { - return compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context) : void 0; - } - function visitExportDeclaration(node) { - if (node.isTypeOnly) { - return void 0; - } - if (!node.exportClause || isNamespaceExport(node.exportClause)) { - return factory2.updateExportDeclaration( - node, - node.modifiers, - node.isTypeOnly, - node.exportClause, - node.moduleSpecifier, - node.attributes - ); - } - const allowEmpty = !!compilerOptions.verbatimModuleSyntax; - const exportClause = visitNode( - node.exportClause, - (bindings) => visitNamedExportBindings(bindings, allowEmpty), - isNamedExportBindings - ); - return exportClause ? factory2.updateExportDeclaration( - node, - /*modifiers*/ - void 0, - node.isTypeOnly, - exportClause, - node.moduleSpecifier, - node.attributes - ) : void 0; - } - function visitNamedExports(node, allowEmpty) { - const elements = visitNodes2(node.elements, visitExportSpecifier, isExportSpecifier); - return allowEmpty || some(elements) ? factory2.updateNamedExports(node, elements) : void 0; - } - function visitNamespaceExports(node) { - return factory2.updateNamespaceExport(node, Debug.checkDefined(visitNode(node.name, visitor, isIdentifier))); - } - function visitNamedExportBindings(node, allowEmpty) { - return isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty); - } - function visitExportSpecifier(node) { - return !node.isTypeOnly && (compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node)) ? node : void 0; - } - function shouldEmitImportEqualsDeclaration(node) { - return shouldEmitAliasDeclaration(node) || !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node); - } - function visitImportEqualsDeclaration(node) { - if (node.isTypeOnly) { - return void 0; - } - if (isExternalModuleImportEqualsDeclaration(node)) { - if (!shouldEmitAliasDeclaration(node)) { - return void 0; - } - return visitEachChild(node, visitor, context); - } - if (!shouldEmitImportEqualsDeclaration(node)) { - return void 0; - } - const moduleReference = createExpressionFromEntityName(factory2, node.moduleReference); - setEmitFlags(moduleReference, 3072 /* NoComments */ | 4096 /* NoNestedComments */); - if (isNamedExternalModuleExport(node) || !isExportOfNamespace(node)) { - return setOriginalNode( - setTextRange( - factory2.createVariableStatement( - visitNodes2(node.modifiers, modifierVisitor, isModifier), - factory2.createVariableDeclarationList([ - setOriginalNode( - factory2.createVariableDeclaration( - node.name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - moduleReference - ), - node - ) - ]) - ), - node - ), - node - ); - } else { - return setOriginalNode( - createNamespaceExport( - node.name, - moduleReference, - node - ), - node - ); - } - } - function isExportOfNamespace(node) { - return currentNamespace !== void 0 && hasSyntacticModifier(node, 32 /* Export */); - } - function isExternalModuleExport(node) { - return currentNamespace === void 0 && hasSyntacticModifier(node, 32 /* Export */); - } - function isNamedExternalModuleExport(node) { - return isExternalModuleExport(node) && !hasSyntacticModifier(node, 2048 /* Default */); - } - function isDefaultExternalModuleExport(node) { - return isExternalModuleExport(node) && hasSyntacticModifier(node, 2048 /* Default */); - } - function createExportMemberAssignmentStatement(node) { - const expression = factory2.createAssignment( - factory2.getExternalModuleOrNamespaceExportName( - currentNamespaceContainerName, - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ), - factory2.getLocalName(node) - ); - setSourceMapRange(expression, createRange(node.name ? node.name.pos : node.pos, node.end)); - const statement = factory2.createExpressionStatement(expression); - setSourceMapRange(statement, createRange(-1, node.end)); - return statement; - } - function addExportMemberAssignment(statements, node) { - statements.push(createExportMemberAssignmentStatement(node)); - } - function createNamespaceExport(exportName, exportValue, location) { - return setTextRange( - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.getNamespaceMemberName( - currentNamespaceContainerName, - exportName, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ), - exportValue - ) - ), - location - ); - } - function createNamespaceExportExpression(exportName, exportValue, location) { - return setTextRange(factory2.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location); - } - function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) { - return factory2.getNamespaceMemberName( - currentNamespaceContainerName, - name, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - } - function getNamespaceParameterName(node) { - const name = factory2.getGeneratedNameForNode(node); - setSourceMapRange(name, node.name); - return name; - } - function getNamespaceContainerName(node) { - return factory2.getGeneratedNameForNode(node); - } - function enableSubstitutionForNonQualifiedEnumMembers() { - if ((enabledSubstitutions & 8 /* NonQualifiedEnumMembers */) === 0) { - enabledSubstitutions |= 8 /* NonQualifiedEnumMembers */; - context.enableSubstitution(80 /* Identifier */); - } - } - function enableSubstitutionForNamespaceExports() { - if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) { - enabledSubstitutions |= 2 /* NamespaceExports */; - context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(305 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(268 /* ModuleDeclaration */); - } - } - function isTransformedModuleDeclaration(node) { - return getOriginalNode(node).kind === 268 /* ModuleDeclaration */; - } - function isTransformedEnumDeclaration(node) { - return getOriginalNode(node).kind === 267 /* EnumDeclaration */; - } - function onEmitNode(hint, node, emitCallback) { - const savedApplicableSubstitutions = applicableSubstitutions; - const savedCurrentSourceFile = currentSourceFile; - if (isSourceFile(node)) { - currentSourceFile = node; - } - if (enabledSubstitutions & 2 /* NamespaceExports */ && isTransformedModuleDeclaration(node)) { - applicableSubstitutions |= 2 /* NamespaceExports */; - } - if (enabledSubstitutions & 8 /* NonQualifiedEnumMembers */ && isTransformedEnumDeclaration(node)) { - applicableSubstitutions |= 8 /* NonQualifiedEnumMembers */; - } - previousOnEmitNode(hint, node, emitCallback); - applicableSubstitutions = savedApplicableSubstitutions; - currentSourceFile = savedCurrentSourceFile; - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } else if (isShorthandPropertyAssignment(node)) { - return substituteShorthandPropertyAssignment(node); - } - return node; - } - function substituteShorthandPropertyAssignment(node) { - if (enabledSubstitutions & 2 /* NamespaceExports */) { - const name = node.name; - const exportedName = trySubstituteNamespaceExportedName(name); - if (exportedName) { - if (node.objectAssignmentInitializer) { - const initializer = factory2.createAssignment(exportedName, node.objectAssignmentInitializer); - return setTextRange(factory2.createPropertyAssignment(name, initializer), node); - } - return setTextRange(factory2.createPropertyAssignment(name, exportedName), node); - } - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 80 /* Identifier */: - return substituteExpressionIdentifier(node); - case 212 /* PropertyAccessExpression */: - return substitutePropertyAccessExpression(node); - case 213 /* ElementAccessExpression */: - return substituteElementAccessExpression(node); - } - return node; - } - function substituteExpressionIdentifier(node) { - return trySubstituteNamespaceExportedName(node) || node; - } - function trySubstituteNamespaceExportedName(node) { - if (enabledSubstitutions & applicableSubstitutions && !isGeneratedIdentifier(node) && !isLocalName(node)) { - const container = resolver.getReferencedExportContainer( - node, - /*prefixLocals*/ - false - ); - if (container && container.kind !== 308 /* SourceFile */) { - const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 268 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 267 /* EnumDeclaration */; - if (substitute) { - return setTextRange( - factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node), - /*location*/ - node - ); - } - } - } - return void 0; - } - function substitutePropertyAccessExpression(node) { - return substituteConstantValue(node); - } - function substituteElementAccessExpression(node) { - return substituteConstantValue(node); - } - function safeMultiLineComment(value) { - return value.replace(/\*\//g, "*_/"); - } - function substituteConstantValue(node) { - const constantValue = tryGetConstEnumValue(node); - if (constantValue !== void 0) { - setConstantValue(node, constantValue); - const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue); - if (!compilerOptions.removeComments) { - const originalNode = getOriginalNode(node, isAccessExpression); - addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `); - } - return substitute; - } - return node; - } - function tryGetConstEnumValue(node) { - if (getIsolatedModules(compilerOptions)) { - return void 0; - } - return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; - } - function shouldEmitAliasDeclaration(node) { - return compilerOptions.verbatimModuleSyntax || isInJSFile(node) || resolver.isReferencedAliasDeclaration(node); - } -} - -// src/compiler/transformers/classFields.ts -function transformClassFields(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - hoistVariableDeclaration, - endLexicalEnvironment, - startLexicalEnvironment, - resumeLexicalEnvironment, - addBlockScopedVariable - } = context; - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); - const legacyDecorators = !!compilerOptions.experimentalDecorators; - const shouldTransformInitializersUsingSet = !useDefineForClassFields; - const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9 /* ES2022 */; - const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine; - const shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* ES2022 */; - const shouldTransformAutoAccessors = languageVersion < 99 /* ESNext */ ? -1 /* True */ : !useDefineForClassFields ? 3 /* Maybe */ : 0 /* False */; - const shouldTransformThisInStaticInitializers = languageVersion < 9 /* ES2022 */; - const shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2 /* ES2015 */; - const shouldTransformAnything = shouldTransformInitializers || shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformAutoAccessors === -1 /* True */; - const previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - const previousOnEmitNode = context.onEmitNode; - context.onEmitNode = onEmitNode; - let shouldTransformPrivateStaticElementsInFile = false; - let enabledSubstitutions = 0 /* None */; - let classAliases; - let pendingExpressions; - let pendingStatements; - let lexicalEnvironment; - const lexicalEnvironmentMap = /* @__PURE__ */ new Map(); - const noSubstitution = /* @__PURE__ */ new Set(); - let currentClassContainer; - let currentClassElement; - let shouldSubstituteThisWithClassThis = false; - let previousShouldSubstituteThisWithClassThis = false; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - lexicalEnvironment = void 0; - shouldTransformPrivateStaticElementsInFile = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); - if (!shouldTransformAnything && !shouldTransformPrivateStaticElementsInFile) { - return node; - } - const visited = visitEachChild(node, visitor, context); - addEmitHelpers(visited, context.readEmitHelpers()); - return visited; - } - function modifierVisitor(node) { - switch (node.kind) { - case 129 /* AccessorKeyword */: - return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; - default: - return tryCast(node, isModifier); - } - } - function visitor(node) { - if (!(node.transformFlags & 16777216 /* ContainsClassFields */) && !(node.transformFlags & 134234112 /* ContainsLexicalThisOrSuper */)) { - return node; - } - switch (node.kind) { - case 264 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 232 /* ClassExpression */: - return visitClassExpression(node); - case 176 /* ClassStaticBlockDeclaration */: - case 173 /* PropertyDeclaration */: - return Debug.fail("Use `classElementVisitor` instead."); - case 304 /* PropertyAssignment */: - return visitPropertyAssignment(node); - case 244 /* VariableStatement */: - return visitVariableStatement(node); - case 261 /* VariableDeclaration */: - return visitVariableDeclaration(node); - case 170 /* Parameter */: - return visitParameterDeclaration(node); - case 209 /* BindingElement */: - return visitBindingElement(node); - case 278 /* ExportAssignment */: - return visitExportAssignment(node); - case 81 /* PrivateIdentifier */: - return visitPrivateIdentifier(node); - case 212 /* PropertyAccessExpression */: - return visitPropertyAccessExpression(node); - case 213 /* ElementAccessExpression */: - return visitElementAccessExpression(node); - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - return visitPreOrPostfixUnaryExpression( - node, - /*discarded*/ - false - ); - case 227 /* BinaryExpression */: - return visitBinaryExpression( - node, - /*discarded*/ - false - ); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression( - node, - /*discarded*/ - false - ); - case 214 /* CallExpression */: - return visitCallExpression(node); - case 245 /* ExpressionStatement */: - return visitExpressionStatement(node); - case 216 /* TaggedTemplateExpression */: - return visitTaggedTemplateExpression(node); - case 249 /* ForStatement */: - return visitForStatement(node); - case 110 /* ThisKeyword */: - return visitThisExpression(node); - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - return setCurrentClassElementAnd( - /*classElement*/ - void 0, - fallbackVisitor, - node - ); - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: { - return setCurrentClassElementAnd( - node, - fallbackVisitor, - node - ); - } - default: - return fallbackVisitor(node); - } - } - function fallbackVisitor(node) { - return visitEachChild(node, visitor, context); - } - function discardedValueVisitor(node) { - switch (node.kind) { - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - return visitPreOrPostfixUnaryExpression( - node, - /*discarded*/ - true - ); - case 227 /* BinaryExpression */: - return visitBinaryExpression( - node, - /*discarded*/ - true - ); - case 357 /* CommaListExpression */: - return visitCommaListExpression( - node, - /*discarded*/ - true - ); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression( - node, - /*discarded*/ - true - ); - default: - return visitor(node); - } - } - function heritageClauseVisitor(node) { - switch (node.kind) { - case 299 /* HeritageClause */: - return visitEachChild(node, heritageClauseVisitor, context); - case 234 /* ExpressionWithTypeArguments */: - return visitExpressionWithTypeArgumentsInHeritageClause(node); - default: - return visitor(node); - } - } - function assignmentTargetVisitor(node) { - switch (node.kind) { - case 211 /* ObjectLiteralExpression */: - case 210 /* ArrayLiteralExpression */: - return visitAssignmentPattern(node); - default: - return visitor(node); - } - } - function classElementVisitor(node) { - switch (node.kind) { - case 177 /* Constructor */: - return setCurrentClassElementAnd( - node, - visitConstructorDeclaration, - node - ); - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - return setCurrentClassElementAnd( - node, - visitMethodOrAccessorDeclaration, - node - ); - case 173 /* PropertyDeclaration */: - return setCurrentClassElementAnd( - node, - visitPropertyDeclaration, - node - ); - case 176 /* ClassStaticBlockDeclaration */: - return setCurrentClassElementAnd( - node, - visitClassStaticBlockDeclaration, - node - ); - case 168 /* ComputedPropertyName */: - return visitComputedPropertyName(node); - case 241 /* SemicolonClassElement */: - return node; - default: - return isModifierLike(node) ? modifierVisitor(node) : visitor(node); - } - } - function propertyNameVisitor(node) { - switch (node.kind) { - case 168 /* ComputedPropertyName */: - return visitComputedPropertyName(node); - default: - return visitor(node); - } - } - function accessorFieldResultVisitor(node) { - switch (node.kind) { - case 173 /* PropertyDeclaration */: - return transformFieldInitializer(node); - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return classElementVisitor(node); - default: - Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration"); - break; - } - } - function visitPrivateIdentifier(node) { - if (!shouldTransformPrivateElementsOrClassStaticBlocks) { - return node; - } - if (isStatement(node.parent)) { - return node; - } - return setOriginalNode(factory2.createIdentifier(""), node); - } - function transformPrivateIdentifierInInExpression(node) { - const info = accessPrivateIdentifier2(node.left); - if (info) { - const receiver = visitNode(node.right, visitor, isExpression); - return setOriginalNode( - emitHelpers().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), - node - ); - } - return visitEachChild(node, visitor, context); - } - function visitPropertyAssignment(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - } - return visitEachChild(node, visitor, context); - } - function visitVariableStatement(node) { - const savedPendingStatements = pendingStatements; - pendingStatements = []; - const visitedNode = visitEachChild(node, visitor, context); - const statement = some(pendingStatements) ? [visitedNode, ...pendingStatements] : visitedNode; - pendingStatements = savedPendingStatements; - return statement; - } - function visitVariableDeclaration(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - } - return visitEachChild(node, visitor, context); - } - function visitParameterDeclaration(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - } - return visitEachChild(node, visitor, context); - } - function visitBindingElement(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - } - return visitEachChild(node, visitor, context); - } - function visitExportAssignment(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation( - context, - node, - /*ignoreEmptyStringLiteral*/ - true, - node.isExportEquals ? "" : "default" - ); - } - return visitEachChild(node, visitor, context); - } - function injectPendingExpressions(expression) { - if (some(pendingExpressions)) { - if (isParenthesizedExpression(expression)) { - pendingExpressions.push(expression.expression); - expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); - } else { - pendingExpressions.push(expression); - expression = factory2.inlineExpressions(pendingExpressions); - } - pendingExpressions = void 0; - } - return expression; - } - function visitComputedPropertyName(node) { - const expression = visitNode(node.expression, visitor, isExpression); - return factory2.updateComputedPropertyName(node, injectPendingExpressions(expression)); - } - function visitConstructorDeclaration(node) { - if (currentClassContainer) { - return transformConstructor(node, currentClassContainer); - } - return fallbackVisitor(node); - } - function shouldTransformClassElementToWeakMap(node) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) return true; - if (hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) return true; - return false; - } - function visitMethodOrAccessorDeclaration(node) { - Debug.assert(!hasDecorators(node)); - if (!isPrivateIdentifierClassElementDeclaration(node) || !shouldTransformClassElementToWeakMap(node)) { - return visitEachChild(node, classElementVisitor, context); - } - const info = accessPrivateIdentifier2(node.name); - Debug.assert(info, "Undeclared private name for property declaration."); - if (!info.isValid) { - return node; - } - const functionName = getHoistedFunctionName(node); - if (functionName) { - getPendingExpressions().push( - factory2.createAssignment( - functionName, - factory2.createFunctionExpression( - filter(node.modifiers, (m) => isModifier(m) && !isStaticModifier(m) && !isAccessorModifier(m)), - node.asteriskToken, - functionName, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - visitFunctionBody(node.body, visitor, context) - ) - ) - ); - } - return void 0; - } - 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)); - const info = accessPrivateIdentifier2(node.name); - Debug.assert(info, "Undeclared private name for property declaration."); - if (info.kind === "m" /* Method */) { - return info.methodName; - } - if (info.kind === "a" /* Accessor */) { - if (isGetAccessor(node)) { - return info.getterName; - } - if (isSetAccessor(node)) { - return info.setterName; - } - } - } - function tryGetClassThis() { - const lex = getClassLexicalEnvironment(); - return lex.classThis ?? lex.classConstructor ?? (currentClassContainer == null ? void 0 : currentClassContainer.name); - } - function transformAutoAccessor(node) { - const commentRange = getCommentRange(node); - const sourceMapRange = getSourceMapRange(node); - const name = node.name; - let getterName = name; - let setterName = name; - if (isComputedPropertyName(name) && !isSimpleInlineableExpression(name.expression)) { - const cacheAssignment = findComputedPropertyNameCacheAssignment(name); - if (cacheAssignment) { - getterName = factory2.updateComputedPropertyName(name, visitNode(name.expression, visitor, isExpression)); - setterName = factory2.updateComputedPropertyName(name, cacheAssignment.left); - } else { - const temp = factory2.createTempVariable(hoistVariableDeclaration); - setSourceMapRange(temp, name.expression); - const expression = visitNode(name.expression, visitor, isExpression); - const assignment = factory2.createAssignment(temp, expression); - setSourceMapRange(assignment, name.expression); - getterName = factory2.updateComputedPropertyName(name, assignment); - setterName = factory2.updateComputedPropertyName(name, temp); - } - } - const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - const backingField = createAccessorPropertyBackingField(factory2, node, modifiers, node.initializer); - setOriginalNode(backingField, node); - setEmitFlags(backingField, 3072 /* NoComments */); - setSourceMapRange(backingField, sourceMapRange); - const receiver = isStatic(node) ? tryGetClassThis() ?? factory2.createThis() : factory2.createThis(); - const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver); - setOriginalNode(getter, node); - setCommentRange(getter, commentRange); - setSourceMapRange(getter, sourceMapRange); - const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers)); - const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver); - setOriginalNode(setter, node); - setEmitFlags(setter, 3072 /* NoComments */); - setSourceMapRange(setter, sourceMapRange); - return visitArray([backingField, getter, setter], accessorFieldResultVisitor, isClassElement); - } - function transformPrivateFieldInitializer(node) { - if (shouldTransformClassElementToWeakMap(node)) { - const info = accessPrivateIdentifier2(node.name); - Debug.assert(info, "Undeclared private name for property declaration."); - if (!info.isValid) { - return node; - } - if (info.isStatic && !shouldTransformPrivateElementsOrClassStaticBlocks) { - const statement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); - if (statement) { - return factory2.createClassStaticBlockDeclaration(factory2.createBlock( - [statement], - /*multiLine*/ - true - )); - } - } - return void 0; - } - if (shouldTransformInitializersUsingSet && !isStatic(node) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */) { - return factory2.updatePropertyDeclaration( - node, - visitNodes2(node.modifiers, visitor, isModifierLike), - node.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ); - } - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - } - return factory2.updatePropertyDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, propertyNameVisitor, isPropertyName), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, visitor, isExpression) - ); - } - function transformPublicFieldInitializer(node) { - if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) { - const expr = getPropertyNameExpressionIfNeeded( - node.name, - /*shouldHoist*/ - !!node.initializer || useDefineForClassFields - ); - if (expr) { - getPendingExpressions().push(...flattenCommaList(expr)); - } - if (isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks) { - const initializerStatement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); - if (initializerStatement) { - const staticBlock = factory2.createClassStaticBlockDeclaration( - factory2.createBlock([initializerStatement]) - ); - setOriginalNode(staticBlock, node); - setCommentRange(staticBlock, node); - setCommentRange(initializerStatement, { pos: -1, end: -1 }); - setSyntheticLeadingComments(initializerStatement, void 0); - setSyntheticTrailingComments(initializerStatement, void 0); - return staticBlock; - } - } - return void 0; - } - return factory2.updatePropertyDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNode(node.name, propertyNameVisitor, isPropertyName), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, visitor, isExpression) - ); - } - function transformFieldInitializer(node) { - Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided."); - return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node); - } - function shouldTransformAutoAccessorsInCurrentClass() { - return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !!(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */); - } - function visitPropertyDeclaration(node) { - if (isAutoAccessorPropertyDeclaration(node) && (shouldTransformAutoAccessorsInCurrentClass() || hasStaticModifier(node) && getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */)) { - return transformAutoAccessor(node); - } - 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) { - receiver = visitNode(receiver, visitor, isExpression); - ensureDynamicThisIfNeeded(receiver); - return createPrivateIdentifierAccessHelper(info, receiver); - } - function createPrivateIdentifierAccessHelper(info, receiver) { - setCommentRange(receiver, moveRangePos(receiver, -1)); - switch (info.kind) { - case "a" /* Accessor */: - return emitHelpers().createClassPrivateFieldGetHelper( - receiver, - info.brandCheckIdentifier, - info.kind, - info.getterName - ); - case "m" /* Method */: - return emitHelpers().createClassPrivateFieldGetHelper( - receiver, - info.brandCheckIdentifier, - info.kind, - info.methodName - ); - case "f" /* Field */: - return emitHelpers().createClassPrivateFieldGetHelper( - receiver, - info.brandCheckIdentifier, - info.kind, - info.isStatic ? info.variableName : void 0 - ); - case "untransformed": - return Debug.fail("Access helpers should not be created for untransformed private elements"); - default: - Debug.assertNever(info, "Unknown private element type"); - } - } - function visitPropertyAccessExpression(node) { - if (isPrivateIdentifier(node.name)) { - const privateIdentifierInfo = accessPrivateIdentifier2(node.name); - if (privateIdentifierInfo) { - return setTextRange( - setOriginalNode( - createPrivateIdentifierAccess(privateIdentifierInfo, node.expression), - node - ), - node - ); - } - } - 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); - } - if (classConstructor && superClassReference) { - const superProperty = factory2.createReflectGetCall( - superClassReference, - factory2.createStringLiteralFromNode(node.name), - classConstructor - ); - setOriginalNode(superProperty, node.expression); - setTextRange(superProperty, node.expression); - return superProperty; - } - } - return visitEachChild(node, visitor, context); - } - function visitElementAccessExpression(node) { - 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); - } - if (classConstructor && superClassReference) { - const superProperty = factory2.createReflectGetCall( - superClassReference, - visitNode(node.argumentExpression, visitor, isExpression), - classConstructor - ); - setOriginalNode(superProperty, node.expression); - setTextRange(superProperty, node.expression); - return superProperty; - } - } - return visitEachChild(node, visitor, context); - } - function visitPreOrPostfixUnaryExpression(node, discarded) { - if (node.operator === 46 /* PlusPlusToken */ || node.operator === 47 /* MinusMinusToken */) { - const operand = skipParentheses(node.operand); - if (isPrivateIdentifierPropertyAccessExpression(operand)) { - 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); - expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); - expression = createPrivateIdentifierAssignment( - info, - initializeExpression || readExpression, - expression, - 64 /* EqualsToken */ - ); - setOriginalNode(expression, node); - setTextRange(expression, node); - if (temp) { - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; - } - } 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); - return isPrefixUnaryExpression(node) ? factory2.updatePrefixUnaryExpression(node, expression) : factory2.updatePostfixUnaryExpression(node, expression); - } - if (classConstructor && superClassReference) { - let setterName; - let getterName; - if (isPropertyAccessExpression(operand)) { - if (isIdentifier(operand.name)) { - getterName = setterName = factory2.createStringLiteralFromNode(operand.name); - } - } else { - if (isSimpleInlineableExpression(operand.argumentExpression)) { - getterName = setterName = operand.argumentExpression; - } else { - getterName = factory2.createTempVariable(hoistVariableDeclaration); - setterName = factory2.createAssignment(getterName, visitNode(operand.argumentExpression, visitor, isExpression)); - } - } - if (setterName && getterName) { - let expression = factory2.createReflectGetCall(superClassReference, getterName, classConstructor); - setTextRange(expression, operand); - const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); - expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); - expression = factory2.createReflectSetCall(superClassReference, setterName, expression, classConstructor); - setOriginalNode(expression, node); - setTextRange(expression, node); - if (temp) { - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; - } - } - } - } - return visitEachChild(node, visitor, context); - } - function visitForStatement(node) { - return factory2.updateForStatement( - node, - visitNode(node.initializer, discardedValueVisitor, isForInitializer), - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, discardedValueVisitor, isExpression), - visitIterationBody(node.statement, visitor, context) - ); - } - function visitExpressionStatement(node) { - return factory2.updateExpressionStatement( - node, - visitNode(node.expression, discardedValueVisitor, isExpression) - ); - } - 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 }; - } - const readExpression = factory2.createTempVariable(hoistVariableDeclaration); - const initializeExpression = factory2.createAssignment(readExpression, clone2); - return { readExpression, initializeExpression }; - } - function visitCallExpression(node) { - var _a; - if (isPrivateIdentifierPropertyAccessExpression(node.expression) && accessPrivateIdentifier2(node.expression.name)) { - const { thisArg, target } = factory2.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion); - if (isCallChain(node)) { - return factory2.updateCallChain( - node, - factory2.createPropertyAccessChain(visitNode(target, visitor, isExpression), node.questionDotToken, "call"), - /*questionDotToken*/ - void 0, - /*typeArguments*/ - void 0, - [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] - ); - } - return factory2.updateCallExpression( - node, - factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "call"), - /*typeArguments*/ - void 0, - [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] - ); - } - 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, - visitNodes2(node.arguments, visitor, isExpression) - ); - setOriginalNode(invocation, node); - setTextRange(invocation, node); - return invocation; - } - return visitEachChild(node, visitor, context); - } - function visitTaggedTemplateExpression(node) { - var _a; - if (isPrivateIdentifierPropertyAccessExpression(node.tag) && accessPrivateIdentifier2(node.tag.name)) { - const { thisArg, target } = factory2.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion); - return factory2.updateTaggedTemplateExpression( - node, - factory2.createCallExpression( - factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "bind"), - /*typeArguments*/ - void 0, - [visitNode(thisArg, visitor, isExpression)] - ), - /*typeArguments*/ - void 0, - visitNode(node.template, visitor, isTemplateLiteral) - ); - } - 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, - [] - ); - setOriginalNode(invocation, node); - setTextRange(invocation, node); - return factory2.updateTaggedTemplateExpression( - node, - invocation, - /*typeArguments*/ - void 0, - visitNode(node.template, visitor, isTemplateLiteral) - ); - } - return visitEachChild(node, visitor, context); - } - function transformClassStaticBlockDeclaration(node) { - if (lexicalEnvironment) { - 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 = 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); - return iife; - } - } - function isAnonymousClassNeedingAssignedName(node) { - if (isClassExpression(node) && !node.name) { - const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); - 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; - } - return false; - } - function visitBinaryExpression(node, discarded) { - if (isDestructuringAssignment(node)) { - const savedPendingExpressions = pendingExpressions; - pendingExpressions = void 0; - node = factory2.updateBinaryExpression( - node, - visitNode(node.left, assignmentTargetVisitor, isExpression), - node.operatorToken, - visitNode(node.right, visitor, isExpression) - ); - const expr = some(pendingExpressions) ? factory2.inlineExpressions(compact([...pendingExpressions, node])) : node; - pendingExpressions = savedPendingExpressions; - return expr; - } - if (isAssignmentExpression(node)) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - Debug.assertNode(node, isAssignmentExpression); - } - const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */); - if (isPrivateIdentifierPropertyAccessExpression(left)) { - const info = accessPrivateIdentifier2(left.name); - if (info) { - return setTextRange( - setOriginalNode( - createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind), - node - ), - node - ); - } - } 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( - node, - visitInvalidSuperProperty(node.left), - node.operatorToken, - visitNode(node.right, visitor, isExpression) - ); - } - if (classConstructor && superClassReference) { - let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; - if (setterName) { - let expression = visitNode(node.right, visitor, isExpression); - if (isCompoundAssignment(node.operatorToken.kind)) { - let getterName = setterName; - if (!isSimpleInlineableExpression(setterName)) { - getterName = factory2.createTempVariable(hoistVariableDeclaration); - setterName = factory2.createAssignment(getterName, setterName); - } - const superPropertyGet = factory2.createReflectGetCall( - superClassReference, - getterName, - classConstructor - ); - setOriginalNode(superPropertyGet, node.left); - setTextRange(superPropertyGet, node.left); - expression = factory2.createBinaryExpression( - superPropertyGet, - getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), - expression - ); - setTextRange(expression, node); - } - const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); - if (temp) { - expression = factory2.createAssignment(temp, expression); - setTextRange(temp, node); - } - expression = factory2.createReflectSetCall( - superClassReference, - setterName, - expression, - classConstructor - ); - setOriginalNode(expression, node); - setTextRange(expression, node); - if (temp) { - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; - } - } - } - } - if (isPrivateIdentifierInExpression(node)) { - return transformPrivateIdentifierInInExpression(node); - } - return visitEachChild(node, visitor, context); - } - function visitCommaListExpression(node, discarded) { - const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); - return factory2.updateCommaListExpression(node, elements); - } - function visitParenthesizedExpression(node, discarded) { - const visitorFunc = discarded ? discardedValueVisitor : visitor; - const expression = visitNode(node.expression, visitorFunc, isExpression); - return factory2.updateParenthesizedExpression(node, expression); - } - 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; - right = factory2.createBinaryExpression( - createPrivateIdentifierAccessHelper(info, readExpression), - getNonAssignmentOperatorForCompoundAssignment(operator), - right - ); - } - setCommentRange(receiver, moveRangePos(receiver, -1)); - switch (info.kind) { - case "a" /* Accessor */: - return emitHelpers().createClassPrivateFieldSetHelper( - receiver, - info.brandCheckIdentifier, - right, - info.kind, - info.setterName - ); - case "m" /* Method */: - return emitHelpers().createClassPrivateFieldSetHelper( - receiver, - info.brandCheckIdentifier, - right, - info.kind, - /*f*/ - void 0 - ); - case "f" /* Field */: - return emitHelpers().createClassPrivateFieldSetHelper( - receiver, - info.brandCheckIdentifier, - right, - info.kind, - info.isStatic ? info.variableName : void 0 - ); - case "untransformed": - return Debug.fail("Access helpers should not be created for untransformed private elements"); - default: - Debug.assertNever(info, "Unknown private element type"); - } - } - function getPrivateInstanceMethodsAndAccessors(node) { - return filter(node.members, isNonStaticMethodOrAccessorWithPrivateName); - } - function getClassFacts(node) { - var _a; - let facts = 0 /* None */; - const original = getOriginalNode(node); - if (isClassLike(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; - let containsInstanceAutoAccessors = false; - for (const member of node.members) { - 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 */) { - facts |= 8 /* NeedsSubstitutionForThisInClassStaticField */; - if (!(facts & 1 /* ClassWasDecorated */)) { - facts |= 2 /* NeedsClassConstructorReference */; - } - } - if (shouldTransformSuperInStaticInitializers && member.transformFlags & 134217728 /* ContainsLexicalSuper */) { - if (!(facts & 1 /* ClassWasDecorated */)) { - facts |= 2 /* NeedsClassConstructorReference */ | 4 /* NeedsClassSuperReference */; - } - } - } - } else if (!hasAbstractModifier(getOriginalNode(member))) { - if (isAutoAccessorPropertyDeclaration(member)) { - containsInstanceAutoAccessors = true; - containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member)); - } else if (isPrivateIdentifierClassElementDeclaration(member)) { - containsInstancePrivateElements = true; - if (resolver.hasNodeCheckFlag(member, 262144 /* ContainsConstructorReference */)) { - facts |= 2 /* NeedsClassConstructorReference */; - } - } else if (isPropertyDeclaration(member)) { - containsPublicInstanceFields = true; - containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer); - } - } - } - const willHoistInitializersToConstructor = shouldTransformInitializersUsingDefine && containsPublicInstanceFields || shouldTransformInitializersUsingSet && containsInitializedPublicInstanceFields || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstancePrivateElements || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstanceAutoAccessors && shouldTransformAutoAccessors === -1 /* True */; - if (willHoistInitializersToConstructor) { - facts |= 16 /* WillHoistInitializersToConstructor */; - } - return facts; - } - function visitExpressionWithTypeArgumentsInHeritageClause(node) { - var _a; - const facts = ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.facts) || 0 /* None */; - if (facts & 4 /* NeedsClassSuperReference */) { - const temp = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getClassLexicalEnvironment().superClassReference = temp; - return factory2.updateExpressionWithTypeArguments( - node, - factory2.createAssignment( - temp, - visitNode(node.expression, visitor, isExpression) - ), - /*typeArguments*/ - void 0 - ); - } - return visitEachChild(node, visitor, context); - } - function visitInNewClassLexicalEnvironment(node, visitor2) { - var _a; - const savedCurrentClassContainer = currentClassContainer; - const savedPendingExpressions = pendingExpressions; - const savedLexicalEnvironment = lexicalEnvironment; - currentClassContainer = node; - pendingExpressions = void 0; - startClassLexicalEnvironment(); - const shouldAlwaysTransformPrivateStaticElements = getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */; - if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldAlwaysTransformPrivateStaticElements) { - 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) { - const privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); - if (some(privateInstanceMethodsAndAccessors)) { - getPrivateIdentifierEnvironment().data.weakSetName = createHoistedVariableForClass( - "instances", - privateInstanceMethodsAndAccessors[0].name - ); - } - } - const facts = getClassFacts(node); - if (facts) { - getClassLexicalEnvironment().facts = facts; - } - if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) { - enableSubstitutionForClassStaticThisOrSuperReference(); - } - const result = visitor2(node, facts); - endClassLexicalEnvironment(); - Debug.assert(lexicalEnvironment === savedLexicalEnvironment); - currentClassContainer = savedCurrentClassContainer; - pendingExpressions = savedPendingExpressions; - return result; - } - function visitClassDeclaration(node) { - return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); - } - function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { - var _a, _b; - let pendingClassReferenceAssignment; - if (facts & 2 /* NeedsClassConstructorReference */) { - if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a = node.emitNode) == null ? void 0 : _a.classThis)) { - getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; - pendingClassReferenceAssignment = factory2.createAssignment(node.emitNode.classThis, factory2.getInternalName(node)); - } else { - const temp = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - 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 isClassWithConstructorReference = resolver.hasNodeCheckFlag(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); - const statements = []; - if (pendingClassReferenceAssignment) { - getPendingExpressions().unshift(pendingClassReferenceAssignment); - } - if (some(pendingExpressions)) { - statements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); - } - if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) { - const staticProperties = getStaticPropertiesAndClassStaticBlock(node); - if (some(staticProperties)) { - addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory2.getInternalName(node)); - } - } - if (statements.length > 0 && isExport && isDefault) { - modifiers = visitNodes2(modifiers, (node2) => isExportOrDefaultModifier(node2) ? void 0 : node2, isModifier); - statements.push(factory2.createExportAssignment( - /*modifiers*/ - void 0, - /*isExportEquals*/ - false, - factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ) - )); - } - const alias = getClassLexicalEnvironment().classConstructor; - if (isClassWithConstructorReference && alias) { - enableSubstitutionForClassAliases(); - classAliases[getOriginalNodeId(node)] = alias; - } - const classDecl = factory2.updateClassDeclaration( - node, - modifiers, - node.name, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - statements.unshift(classDecl); - if (prologue) { - statements.unshift(factory2.createExpressionStatement(prologue)); - } - return statements; - } - function visitClassExpression(node) { - return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); - } - function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { - var _a, _b, _c; - const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */); - const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); - const isClassWithConstructorReference = resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */); - const requiresBlockScopedVar = resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */); - let temp; - function createClassTempVar() { - var _a2; - if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { - return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; - } - const temp2 = factory2.createTempVariable( - requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2); - return temp2; - } - if ((_a = node.emitNode) == null ? void 0 : _a.classThis) { - getClassLexicalEnvironment().classThis = node.emitNode.classThis; - } - if (facts & 2 /* NeedsClassConstructorReference */) { - temp ?? (temp = createClassTempVar()); - } - const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); - const { members, prologue } = transformClassMembers(node); - const classExpression = factory2.updateClassExpression( - node, - modifiers, - node.name, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - const expressions = []; - if (prologue) { - expressions.push(prologue); - } - const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); - 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 (some(staticPropertiesOrClassStaticBlocks)) { - 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 && ((_c = node.emitNode) == null ? void 0 : _c.classThis)) { - expressions.push(factory2.createAssignment(node.emitNode.classThis, classExpression)); - } else { - expressions.push(classExpression); - } - } else { - temp ?? (temp = createClassTempVar()); - if (isClassWithConstructorReference) { - enableSubstitutionForClassAliases(); - const alias = factory2.cloneNode(temp); - alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */; - classAliases[getOriginalNodeId(node)] = alias; - } - expressions.push(factory2.createAssignment(temp, classExpression)); - addRange(expressions, pendingExpressions); - addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); - expressions.push(factory2.cloneNode(temp)); - } - } else { - expressions.push(classExpression); - } - if (expressions.length > 1) { - addEmitFlags(classExpression, 131072 /* Indented */); - expressions.forEach(startOnNewLine); - } - return factory2.inlineExpressions(expressions); - } - function visitClassStaticBlockDeclaration(node) { - if (!shouldTransformPrivateElementsOrClassStaticBlocks) { - return visitEachChild(node, visitor, context); - } - 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) { - for (const member of node.members) { - if (isPrivateIdentifierClassElementDeclaration(member)) { - if (shouldTransformClassElementToWeakMap(member)) { - addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); - } else { - const privateEnv = getPrivateIdentifierEnvironment(); - setPrivateIdentifier(privateEnv, member.name, { kind: "untransformed" }); - } - } - } - if (shouldTransformPrivateElementsOrClassStaticBlocks) { - if (some(getPrivateInstanceMethodsAndAccessors(node))) { - createBrandCheckWeakSetForPrivateMethods(); - } - } - if (shouldTransformAutoAccessorsInCurrentClass()) { - for (const member of node.members) { - if (isAutoAccessorPropertyDeclaration(member)) { - const storageName = factory2.getGeneratedPrivateNameForNode( - member.name, - /*prefix*/ - void 0, - "_accessor_storage" - ); - if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(member)) { - addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); - } else { - const privateEnv = getPrivateIdentifierEnvironment(); - setPrivateIdentifier(privateEnv, storageName, { kind: "untransformed" }); - } - } - } - } - } - let members = visitNodes2(node.members, classElementVisitor, isClassElement); - let syntheticConstructor; - if (!some(members, isConstructorDeclaration)) { - syntheticConstructor = transformConstructor( - /*constructor*/ - void 0, - node - ); - } - let prologue; - let syntheticStaticBlock; - if (!shouldTransformPrivateElementsOrClassStaticBlocks && some(pendingExpressions)) { - let statement = factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions)); - if (statement.transformFlags & 134234112 /* ContainsLexicalThisOrSuper */) { - const temp = factory2.createTempVariable(hoistVariableDeclaration); - const arrow = factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - [], - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - factory2.createBlock([statement]) - ); - prologue = factory2.createAssignment(temp, arrow); - statement = factory2.createExpressionStatement(factory2.createCallExpression( - temp, - /*typeArguments*/ - void 0, - [] - )); - } - const block = factory2.createBlock([statement]); - syntheticStaticBlock = factory2.createClassStaticBlockDeclaration(block); - pendingExpressions = void 0; - } - 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); - const remainingMembers = classThisAssignmentBlock || classNamedEvaluationHelperBlock ? filter(members, (member) => member !== classThisAssignmentBlock && member !== classNamedEvaluationHelperBlock) : members; - membersArray = addRange(membersArray, remainingMembers); - members = setTextRange( - factory2.createNodeArray(membersArray), - /*location*/ - node.members - ); - } - return { members, prologue }; - } - function createBrandCheckWeakSetForPrivateMethods() { - const { weakSetName } = getPrivateIdentifierEnvironment().data; - Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); - getPendingExpressions().push( - factory2.createAssignment( - weakSetName, - factory2.createNewExpression( - factory2.createIdentifier("WeakSet"), - /*typeArguments*/ - void 0, - [] - ) - ) - ); - } - function transformConstructor(constructor, container) { - constructor = visitNode(constructor, visitor, isConstructorDeclaration); - if (!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) || !(lexicalEnvironment.data.facts & 16 /* WillHoistInitializersToConstructor */)) { - return constructor; - } - const extendsClauseElement = getEffectiveBaseTypeNode(container); - const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106 /* NullKeyword */); - const parameters = visitParameterList(constructor ? constructor.parameters : void 0, visitor, context); - const body = transformConstructorBody(container, constructor, isDerivedClass); - if (!body) { - return constructor; - } - if (constructor) { - Debug.assert(parameters); - return factory2.updateConstructorDeclaration( - constructor, - /*modifiers*/ - void 0, - parameters, - body - ); - } - return startOnNewLine( - setOriginalNode( - setTextRange( - factory2.createConstructorDeclaration( - /*modifiers*/ - void 0, - parameters ?? [], - body - ), - constructor || container - ), - constructor - ) - ); - } - 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*/ - false, - /*isStatic*/ - false - ); - let properties = instanceProperties; - if (!useDefineForClassFields) { - properties = filter(properties, (property) => !!property.initializer || isPrivateIdentifier(property.name) || hasAccessorModifier(property)); - } - const privateMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); - const needsConstructorBody = some(properties) || some(privateMethodsAndAccessors); - if (!constructor && !needsConstructorBody) { - return visitFunctionBody( - /*node*/ - void 0, - visitor, - context - ); - } - resumeLexicalEnvironment(); - const needsSyntheticConstructor = !constructor && isDerivedClass; - let statementOffset = 0; - let statements = []; - 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 - ); - 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)); - } - } else { - 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) { - return void 0; - } - const multiLine = (constructor == null ? void 0 : constructor.body) && constructor.body.statements.length >= statements.length ? constructor.body.multiLine ?? statements.length > 0 : statements.length > 0; - return setTextRange( - factory2.createBlock( - setTextRange( - factory2.createNodeArray(statements), - /*location*/ - ((_a = constructor == null ? void 0 : constructor.body) == null ? void 0 : _a.statements) ?? node.members - ), - multiLine - ), - /*location*/ - constructor == null ? void 0 : constructor.body - ); - } - function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) { - for (const property of properties) { - if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks) { - continue; - } - const statement = transformPropertyOrClassStaticBlock(property, receiver); - if (!statement) { - continue; - } - statements.push(statement); - } - } - function transformPropertyOrClassStaticBlock(property, receiver) { - const expression = isClassStaticBlockDeclaration(property) ? setCurrentClassElementAnd(property, transformClassStaticBlockDeclaration, property) : transformProperty(property, receiver); - if (!expression) { - return void 0; - } - const statement = factory2.createExpressionStatement(expression); - setOriginalNode(statement, property); - addEmitFlags(statement, getEmitFlags(property) & 3072 /* NoComments */); - setCommentRange(statement, property); - const propertyOriginalNode = getOriginalNode(property); - if (isParameter(propertyOriginalNode)) { - setSourceMapRange(statement, propertyOriginalNode); - removeAllComments(statement); - } else { - setSourceMapRange(statement, moveRangePastModifiers(property)); - } - setSyntheticLeadingComments(expression, void 0); - setSyntheticTrailingComments(expression, void 0); - if (hasAccessorModifier(propertyOriginalNode)) { - addEmitFlags(statement, 3072 /* NoComments */); - } - return statement; - } - function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { - const expressions = []; - for (const property of propertiesOrClassStaticBlocks) { - const expression = isClassStaticBlockDeclaration(property) ? setCurrentClassElementAnd(property, transformClassStaticBlockDeclaration, property) : setCurrentClassElementAnd( - property, - () => transformProperty(property, receiver), - /*arg*/ - void 0 - ); - if (!expression) { - continue; - } - startOnNewLine(expression); - setOriginalNode(expression, property); - addEmitFlags(expression, getEmitFlags(property) & 3072 /* NoComments */); - setSourceMapRange(expression, moveRangePastModifiers(property)); - setCommentRange(expression, property); - expressions.push(expression); - } - return expressions; - } - function transformProperty(property, receiver) { - var _a; - 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); - addEmitFlags(transformed, 4 /* AdviseOnEmitNode */); - setSourceMapRange(transformed, getSourceMapRange(property.name)); - lexicalEnvironmentMap.set(getOriginalNode(property), lexicalEnvironment); - } - currentClassElement = savedCurrentClassElement; - return transformed; - } - function transformPropertyWorker(property, receiver) { - const emitAssignment = !useDefineForClassFields; - if (isNamedEvaluation(property, isAnonymousClassNeedingAssignedName)) { - 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)) { - currentClassElement = property; - } - if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property)) { - const privateIdentifierInfo = accessPrivateIdentifier2(propertyName); - if (privateIdentifierInfo) { - if (privateIdentifierInfo.kind === "f" /* Field */) { - if (!privateIdentifierInfo.isStatic) { - return createPrivateInstanceFieldInitializer( - factory2, - receiver, - visitNode(property.initializer, visitor, isExpression), - privateIdentifierInfo.brandCheckIdentifier - ); - } else { - return createPrivateStaticFieldInitializer( - factory2, - privateIdentifierInfo.variableName, - visitNode(property.initializer, visitor, isExpression) - ); - } - } else { - return void 0; - } - } else { - Debug.fail("Undeclared private name for property declaration."); - } - } - if ((isPrivateIdentifier(propertyName) || hasStaticModifier(property)) && !property.initializer) { - return void 0; - } - const propertyOriginalNode = getOriginalNode(property); - if (hasSyntacticModifier(propertyOriginalNode, 64 /* Abstract */)) { - return void 0; - } - let initializer = visitNode(property.initializer, visitor, isExpression); - if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) { - const localName = factory2.cloneNode(propertyName); - if (initializer) { - if (isParenthesizedExpression(initializer) && isCommaExpression(initializer.expression) && isCallToHelper(initializer.expression.left, "___runInitializers") && isVoidExpression(initializer.expression.right) && isNumericLiteral(initializer.expression.right.expression)) { - initializer = initializer.expression.left; - } - initializer = factory2.inlineExpressions([initializer, localName]); - } else { - initializer = localName; - } - setEmitFlags(propertyName, 3072 /* NoComments */ | 96 /* NoSourceMap */); - setSourceMapRange(localName, propertyOriginalNode.name); - setEmitFlags(localName, 3072 /* NoComments */); - } else { - initializer ?? (initializer = factory2.createVoidZero()); - } - if (emitAssignment || isPrivateIdentifier(propertyName)) { - const memberAccess = createMemberAccessForPropertyName( - factory2, - receiver, - propertyName, - /*location*/ - propertyName - ); - addEmitFlags(memberAccess, 1024 /* NoLeadingComments */); - const expression = factory2.createAssignment(memberAccess, initializer); - return expression; - } else { - const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; - const descriptor = factory2.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true }); - return factory2.createObjectDefinePropertyCall(receiver, name, descriptor); - } - } - function enableSubstitutionForClassAliases() { - if ((enabledSubstitutions & 1 /* ClassAliases */) === 0) { - enabledSubstitutions |= 1 /* ClassAliases */; - context.enableSubstitution(80 /* Identifier */); - classAliases = []; - } - } - function enableSubstitutionForClassStaticThisOrSuperReference() { - if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) { - enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */; - context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(263 /* FunctionDeclaration */); - context.enableEmitNotification(219 /* FunctionExpression */); - context.enableEmitNotification(177 /* Constructor */); - context.enableEmitNotification(178 /* GetAccessor */); - context.enableEmitNotification(179 /* SetAccessor */); - context.enableEmitNotification(175 /* MethodDeclaration */); - context.enableEmitNotification(173 /* PropertyDeclaration */); - context.enableEmitNotification(168 /* ComputedPropertyName */); - } - } - function addInstanceMethodStatements(statements, methods, receiver) { - if (!shouldTransformPrivateElementsOrClassStaticBlocks || !some(methods)) { - return; - } - const { weakSetName } = getPrivateIdentifierEnvironment().data; - Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); - statements.push( - factory2.createExpressionStatement( - createPrivateInstanceMethodInitializer(factory2, receiver, weakSetName) - ) - ); - } - function visitInvalidSuperProperty(node) { - return isPropertyAccessExpression(node) ? factory2.updatePropertyAccessExpression( - node, - factory2.createVoidZero(), - node.name - ) : factory2.updateElementAccessExpression( - node, - factory2.createVoidZero(), - visitNode(node.argumentExpression, visitor, isExpression) - ); - } - function getPropertyNameExpressionIfNeeded(name, shouldHoist) { - if (isComputedPropertyName(name)) { - const cacheAssignment = findComputedPropertyNameCacheAssignment(name); - const expression = visitNode(name.expression, visitor, isExpression); - const innerExpression = skipPartiallyEmittedExpressions(expression); - const inlinable = isSimpleInlineableExpression(innerExpression); - const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); - if (!alreadyTransformed && !inlinable && shouldHoist) { - const generatedName = factory2.getGeneratedNameForNode(name); - if (resolver.hasNodeCheckFlag(name, 32768 /* BlockScopedBindingInLoop */)) { - addBlockScopedVariable(generatedName); - } else { - hoistVariableDeclaration(generatedName); - } - return factory2.createAssignment(generatedName, expression); - } - return inlinable || isIdentifier(innerExpression) ? void 0 : expression; - } - } - function startClassLexicalEnvironment() { - lexicalEnvironment = { previous: lexicalEnvironment, data: void 0 }; - } - function endClassLexicalEnvironment() { - lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; - } - function getClassLexicalEnvironment() { - Debug.assert(lexicalEnvironment); - return lexicalEnvironment.data ?? (lexicalEnvironment.data = { - facts: 0 /* None */, - classConstructor: void 0, - classThis: void 0, - superClassReference: void 0 - // privateIdentifierEnvironment: undefined, - }); - } - function getPrivateIdentifierEnvironment() { - Debug.assert(lexicalEnvironment); - return lexicalEnvironment.privateEnv ?? (lexicalEnvironment.privateEnv = newPrivateEnvironment({ - className: void 0, - weakSetName: void 0 - })); - } - function getPendingExpressions() { - return pendingExpressions ?? (pendingExpressions = []); - } - function addPrivateIdentifierClassElementToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - if (isAutoAccessorPropertyDeclaration(node)) { - addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isPropertyDeclaration(node)) { - addPrivateIdentifierPropertyDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isMethodDeclaration(node)) { - addPrivateIdentifierMethodDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isGetAccessorDeclaration(node)) { - addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } else if (isSetAccessorDeclaration(node)) { - addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - } - function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - if (isStatic2) { - const brandCheckIdentifier = Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment"); - const variableName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - isStatic: true, - brandCheckIdentifier, - variableName, - isValid - }); - } else { - const weakMapName = createHoistedVariableForPrivateName(name); - setPrivateIdentifier(privateEnv, name, { - kind: "f" /* Field */, - isStatic: false, - brandCheckIdentifier: weakMapName, - isValid - }); - getPendingExpressions().push(factory2.createAssignment( - weakMapName, - factory2.createNewExpression( - factory2.createIdentifier("WeakMap"), - /*typeArguments*/ - void 0, - [] - ) - )); - } - } - function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const methodName = createHoistedVariableForPrivateName(name); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "m" /* Method */, - methodName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { - previousInfo.getterName = getterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName: void 0, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, previousInfo) { - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); - if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" /* Accessor */ && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { - previousInfo.setterName = setterName; - } else { - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName: void 0, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - } - function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name, lex, privateEnv, isStatic2, isValid, _previousInfo) { - const getterName = createHoistedVariableForPrivateName(name, "_get"); - const setterName = createHoistedVariableForPrivateName(name, "_set"); - const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); - setPrivateIdentifier(privateEnv, name, { - kind: "a" /* Accessor */, - getterName, - setterName, - brandCheckIdentifier, - isStatic: isStatic2, - isValid - }); - } - function addPrivateIdentifierToEnvironment(node, name, addDeclaration) { - const lex = getClassLexicalEnvironment(); - const privateEnv = getPrivateIdentifierEnvironment(); - const previousInfo = getPrivateIdentifier(privateEnv, name); - const isStatic2 = hasStaticModifier(node); - const isValid = !isReservedPrivateName(name) && previousInfo === void 0; - addDeclaration(node, name, lex, privateEnv, isStatic2, isValid, previousInfo); - } - function createHoistedVariableForClass(name, node, suffix) { - const { className } = getPrivateIdentifierEnvironment().data; - const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; - const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0, - /*reservedInNestedScopes*/ - true, - prefix, - suffix - ); - if (resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */)) { - addBlockScopedVariable(identifier); - } else { - hoistVariableDeclaration(identifier); - } - return identifier; - } - function createHoistedVariableForPrivateName(name, suffix) { - const text = tryGetTextOfPropertyName(name); - return createHoistedVariableForClass((text == null ? void 0 : text.substring(1)) ?? name, name, suffix); - } - function accessPrivateIdentifier2(name) { - const info = accessPrivateIdentifier(lexicalEnvironment, name); - return (info == null ? void 0 : info.kind) === "untransformed" ? void 0 : info; - } - function wrapPrivateIdentifierForDestructuringTarget(node) { - const parameter = factory2.getGeneratedNameForNode(node); - const info = accessPrivateIdentifier2(node.name); - if (!info) { - return visitEachChild(node, visitor, context); - } - let receiver = node.expression; - if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { - receiver = factory2.createTempVariable( - hoistVariableDeclaration, - /*reservedInNestedScopes*/ - true - ); - getPendingExpressions().push(factory2.createBinaryExpression(receiver, 64 /* EqualsToken */, visitNode(node.expression, visitor, isExpression))); - } - return factory2.createAssignmentTargetWrapper( - parameter, - createPrivateIdentifierAssignment( - info, - receiver, - parameter, - 64 /* EqualsToken */ - ) - ); - } - function visitDestructuringAssignmentTarget(node) { - if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { - return visitAssignmentPattern(node); - } - if (isPrivateIdentifierPropertyAccessExpression(node)) { - return wrapPrivateIdentifierForDestructuringTarget(node); - } 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); - } else if (classConstructor && superClassReference) { - const name = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; - if (name) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - return factory2.createAssignmentTargetWrapper( - temp, - factory2.createReflectSetCall( - superClassReference, - name, - temp, - classConstructor - ) - ); - } - } - } - return visitEachChild(node, visitor, context); - } - function visitAssignmentElement(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - } - if (isAssignmentExpression( - node, - /*excludeCompoundAssignment*/ - true - )) { - const left = visitDestructuringAssignmentTarget(node.left); - const right = visitNode(node.right, visitor, isExpression); - return factory2.updateBinaryExpression(node, left, node.operatorToken, right); - } - return visitDestructuringAssignmentTarget(node); - } - function visitAssignmentRestElement(node) { - if (isLeftHandSideExpression(node.expression)) { - const expression = visitDestructuringAssignmentTarget(node.expression); - return factory2.updateSpreadElement(node, expression); - } - return visitEachChild(node, visitor, context); - } - function visitArrayAssignmentElement(node) { - if (isArrayBindingOrAssignmentElement(node)) { - if (isSpreadElement(node)) return visitAssignmentRestElement(node); - if (!isOmittedExpression(node)) return visitAssignmentElement(node); - } - return visitEachChild(node, visitor, context); - } - function visitAssignmentProperty(node) { - const name = visitNode(node.name, visitor, isPropertyName); - if (isAssignmentExpression( - node.initializer, - /*excludeCompoundAssignment*/ - true - )) { - const assignmentElement = visitAssignmentElement(node.initializer); - return factory2.updatePropertyAssignment(node, name, assignmentElement); - } - if (isLeftHandSideExpression(node.initializer)) { - const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); - return factory2.updatePropertyAssignment(node, name, assignmentElement); - } - return visitEachChild(node, visitor, context); - } - function visitShorthandAssignmentProperty(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node); - } - return visitEachChild(node, visitor, context); - } - function visitAssignmentRestProperty(node) { - if (isLeftHandSideExpression(node.expression)) { - const expression = visitDestructuringAssignmentTarget(node.expression); - return factory2.updateSpreadAssignment(node, expression); - } - return visitEachChild(node, visitor, context); - } - function visitObjectAssignmentElement(node) { - Debug.assertNode(node, isObjectBindingOrAssignmentElement); - if (isSpreadAssignment(node)) return visitAssignmentRestProperty(node); - if (isShorthandPropertyAssignment(node)) return visitShorthandAssignmentProperty(node); - if (isPropertyAssignment(node)) return visitAssignmentProperty(node); - return visitEachChild(node, visitor, context); - } - function visitAssignmentPattern(node) { - if (isArrayLiteralExpression(node)) { - return factory2.updateArrayLiteralExpression( - node, - visitNodes2(node.elements, visitArrayAssignmentElement, isExpression) - ); - } else { - return factory2.updateObjectLiteralExpression( - node, - visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike) - ); - } - } - function onEmitNode(hint, node, emitCallback) { - const original = getOriginalNode(node); - const lex = lexicalEnvironmentMap.get(original); - if (lex) { - const savedLexicalEnvironment = lexicalEnvironment; - const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; - lexicalEnvironment = lex; - previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; - shouldSubstituteThisWithClassThis = !isClassStaticBlockDeclaration(original) || !(getInternalEmitFlags(original) & 32 /* TransformPrivateStaticElements */); - previousOnEmitNode(hint, node, emitCallback); - shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; - previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; - lexicalEnvironment = savedLexicalEnvironment; - return; - } - switch (node.kind) { - case 219 /* FunctionExpression */: - if (isArrowFunction(original) || getEmitFlags(node) & 524288 /* AsyncFunctionBody */) { - break; - } - // falls through - case 263 /* FunctionDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - case 173 /* PropertyDeclaration */: { - const savedLexicalEnvironment = lexicalEnvironment; - const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; - lexicalEnvironment = void 0; - previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; - shouldSubstituteThisWithClassThis = false; - previousOnEmitNode(hint, node, emitCallback); - shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; - previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; - lexicalEnvironment = savedLexicalEnvironment; - return; - } - case 168 /* ComputedPropertyName */: { - const savedLexicalEnvironment = lexicalEnvironment; - const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; - lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; - shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; - previousOnEmitNode(hint, node, emitCallback); - shouldSubstituteThisWithClassThis = savedShouldSubstituteThisWithClassThis; - lexicalEnvironment = savedLexicalEnvironment; - return; - } - } - previousOnEmitNode(hint, node, emitCallback); - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 80 /* Identifier */: - return substituteExpressionIdentifier(node); - case 110 /* ThisKeyword */: - return substituteThisExpression(node); - } - return node; - } - function substituteThisExpression(node) { - if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !noSubstitution.has(node)) { - const { facts, classConstructor, classThis } = lexicalEnvironment.data; - const substituteThis = shouldSubstituteThisWithClassThis ? classThis ?? classConstructor : classConstructor; - if (substituteThis) { - return setTextRange( - setOriginalNode( - factory2.cloneNode(substituteThis), - node - ), - node - ); - } - if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) { - return factory2.createParenthesizedExpression(factory2.createVoidZero()); - } - } - return node; - } - function substituteExpressionIdentifier(node) { - return trySubstituteClassAlias(node) || node; - } - function trySubstituteClassAlias(node) { - if (enabledSubstitutions & 1 /* ClassAliases */) { - if (resolver.hasNodeCheckFlag(node, 536870912 /* ConstructorReference */)) { - const declaration = resolver.getReferencedValueDeclaration(node); - if (declaration) { - const classAlias = classAliases[declaration.id]; - if (classAlias) { - const clone2 = factory2.cloneNode(classAlias); - setSourceMapRange(clone2, node); - setCommentRange(clone2, node); - return clone2; - } - } - } - } - return void 0; - } -} -function createPrivateStaticFieldInitializer(factory2, variableName, initializer) { - return factory2.createAssignment( - variableName, - factory2.createObjectLiteralExpression([ - factory2.createPropertyAssignment("value", initializer || factory2.createVoidZero()) - ]) - ); -} -function createPrivateInstanceFieldInitializer(factory2, receiver, initializer, weakMapName) { - return factory2.createCallExpression( - factory2.createPropertyAccessExpression(weakMapName, "set"), - /*typeArguments*/ - void 0, - [receiver, initializer || factory2.createVoidZero()] - ); -} -function createPrivateInstanceMethodInitializer(factory2, receiver, weakSetName) { - return factory2.createCallExpression( - factory2.createPropertyAccessExpression(weakSetName, "add"), - /*typeArguments*/ - void 0, - [receiver] - ); -} -function isReservedPrivateName(node) { - return !isGeneratedPrivateIdentifier(node) && node.escapedText === "#constructor"; -} -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); -} - -// src/compiler/transformers/typeSerializer.ts -function createRuntimeTypeSerializer(context) { - const { - factory: factory2, - hoistVariableDeclaration - } = context; - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); - let currentLexicalScope; - let currentNameScope; - return { - serializeTypeNode: (serializerContext, node) => setSerializerContextAnd(serializerContext, serializeTypeNode, node), - serializeTypeOfNode: (serializerContext, node, container) => setSerializerContextAnd(serializerContext, serializeTypeOfNode, node, container), - serializeParameterTypesOfNode: (serializerContext, node, container) => setSerializerContextAnd(serializerContext, serializeParameterTypesOfNode, node, container), - serializeReturnTypeOfNode: (serializerContext, node) => setSerializerContextAnd(serializerContext, serializeReturnTypeOfNode, node) - }; - function setSerializerContextAnd(serializerContext, cb, node, arg) { - const savedCurrentLexicalScope = currentLexicalScope; - const savedCurrentNameScope = currentNameScope; - currentLexicalScope = serializerContext.currentLexicalScope; - currentNameScope = serializerContext.currentNameScope; - const result = arg === void 0 ? cb(node) : cb(node, arg); - currentLexicalScope = savedCurrentLexicalScope; - currentNameScope = savedCurrentNameScope; - return result; - } - function getAccessorTypeNode(node, container) { - const accessors = getAllAccessorDeclarations(container.members, node); - return accessors.setAccessor && getSetAccessorTypeAnnotationNode(accessors.setAccessor) || accessors.getAccessor && getEffectiveReturnTypeNode(accessors.getAccessor); - } - function serializeTypeOfNode(node, container) { - switch (node.kind) { - case 173 /* PropertyDeclaration */: - case 170 /* Parameter */: - return serializeTypeNode(node.type); - case 179 /* SetAccessor */: - case 178 /* GetAccessor */: - return serializeTypeNode(getAccessorTypeNode(node, container)); - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 175 /* MethodDeclaration */: - return factory2.createIdentifier("Function"); - default: - return factory2.createVoidZero(); - } - } - function serializeParameterTypesOfNode(node, container) { - const valueDeclaration = isClassLike(node) ? getFirstConstructorWithBody(node) : isFunctionLike(node) && nodeIsPresent(node.body) ? node : void 0; - const expressions = []; - if (valueDeclaration) { - const parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); - const numParameters = parameters.length; - for (let i = 0; i < numParameters; i++) { - const parameter = parameters[i]; - if (i === 0 && isIdentifier(parameter.name) && parameter.name.escapedText === "this") { - continue; - } - if (parameter.dotDotDotToken) { - expressions.push(serializeTypeNode(getRestParameterElementType(parameter.type))); - } else { - expressions.push(serializeTypeOfNode(parameter, container)); - } - } - } - return factory2.createArrayLiteralExpression(expressions); - } - function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 178 /* GetAccessor */) { - const { setAccessor } = getAllAccessorDeclarations(container.members, node); - if (setAccessor) { - return setAccessor.parameters; - } - } - return node.parameters; - } - function serializeReturnTypeOfNode(node) { - if (isFunctionLike(node) && node.type) { - return serializeTypeNode(node.type); - } else if (isAsyncFunction(node)) { - return factory2.createIdentifier("Promise"); - } - return factory2.createVoidZero(); - } - function serializeTypeNode(node) { - if (node === void 0) { - return factory2.createIdentifier("Object"); - } - node = skipTypeParentheses(node); - switch (node.kind) { - case 116 /* VoidKeyword */: - case 157 /* UndefinedKeyword */: - case 146 /* NeverKeyword */: - return factory2.createVoidZero(); - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - return factory2.createIdentifier("Function"); - case 189 /* ArrayType */: - case 190 /* TupleType */: - return factory2.createIdentifier("Array"); - case 183 /* TypePredicate */: - return node.assertsModifier ? factory2.createVoidZero() : factory2.createIdentifier("Boolean"); - case 136 /* BooleanKeyword */: - return factory2.createIdentifier("Boolean"); - case 204 /* TemplateLiteralType */: - case 154 /* StringKeyword */: - return factory2.createIdentifier("String"); - case 151 /* ObjectKeyword */: - return factory2.createIdentifier("Object"); - case 202 /* LiteralType */: - return serializeLiteralOfLiteralTypeNode(node.literal); - case 150 /* NumberKeyword */: - return factory2.createIdentifier("Number"); - case 163 /* BigIntKeyword */: - return getGlobalConstructor("BigInt", 7 /* ES2020 */); - case 155 /* SymbolKeyword */: - return getGlobalConstructor("Symbol", 2 /* ES2015 */); - case 184 /* TypeReference */: - return serializeTypeReferenceNode(node); - case 194 /* IntersectionType */: - return serializeUnionOrIntersectionConstituents( - node.types, - /*isIntersection*/ - true - ); - case 193 /* UnionType */: - return serializeUnionOrIntersectionConstituents( - node.types, - /*isIntersection*/ - false - ); - case 195 /* ConditionalType */: - return serializeUnionOrIntersectionConstituents( - [node.trueType, node.falseType], - /*isIntersection*/ - false - ); - case 199 /* TypeOperator */: - if (node.operator === 148 /* ReadonlyKeyword */) { - return serializeTypeNode(node.type); - } - break; - case 187 /* TypeQuery */: - case 200 /* IndexedAccessType */: - case 201 /* MappedType */: - case 188 /* TypeLiteral */: - case 133 /* AnyKeyword */: - case 159 /* UnknownKeyword */: - case 198 /* ThisType */: - case 206 /* ImportType */: - break; - // handle JSDoc types from an invalid parse - case 313 /* JSDocAllType */: - case 314 /* JSDocUnknownType */: - case 318 /* JSDocFunctionType */: - case 319 /* JSDocVariadicType */: - case 320 /* JSDocNamepathType */: - break; - case 315 /* JSDocNullableType */: - case 316 /* JSDocNonNullableType */: - case 317 /* JSDocOptionalType */: - return serializeTypeNode(node.type); - default: - return Debug.failBadSyntaxKind(node); - } - return factory2.createIdentifier("Object"); - } - function serializeLiteralOfLiteralTypeNode(node) { - switch (node.kind) { - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - return factory2.createIdentifier("String"); - case 225 /* PrefixUnaryExpression */: { - const operand = node.operand; - switch (operand.kind) { - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - return serializeLiteralOfLiteralTypeNode(operand); - default: - return Debug.failBadSyntaxKind(operand); - } - } - case 9 /* NumericLiteral */: - return factory2.createIdentifier("Number"); - case 10 /* BigIntLiteral */: - return getGlobalConstructor("BigInt", 7 /* ES2020 */); - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - return factory2.createIdentifier("Boolean"); - case 106 /* NullKeyword */: - return factory2.createVoidZero(); - default: - return Debug.failBadSyntaxKind(node); - } - } - function serializeUnionOrIntersectionConstituents(types, isIntersection) { - let serializedType; - for (let typeNode of types) { - typeNode = skipTypeParentheses(typeNode); - if (typeNode.kind === 146 /* NeverKeyword */) { - if (isIntersection) return factory2.createVoidZero(); - continue; - } - if (typeNode.kind === 159 /* UnknownKeyword */) { - if (!isIntersection) return factory2.createIdentifier("Object"); - continue; - } - if (typeNode.kind === 133 /* AnyKeyword */) { - return factory2.createIdentifier("Object"); - } - if (!strictNullChecks && (isLiteralTypeNode(typeNode) && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { - continue; - } - const serializedConstituent = serializeTypeNode(typeNode); - if (isIdentifier(serializedConstituent) && serializedConstituent.escapedText === "Object") { - return serializedConstituent; - } - if (serializedType) { - if (!equateSerializedTypeNodes(serializedType, serializedConstituent)) { - return factory2.createIdentifier("Object"); - } - } else { - serializedType = serializedConstituent; - } - } - return serializedType ?? factory2.createVoidZero(); - } - function equateSerializedTypeNodes(left, right) { - return ( - // temp vars used in fallback - isGeneratedIdentifier(left) ? isGeneratedIdentifier(right) : ( - // entity names - isIdentifier(left) ? isIdentifier(right) && left.escapedText === right.escapedText : isPropertyAccessExpression(left) ? isPropertyAccessExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) && equateSerializedTypeNodes(left.name, right.name) : ( - // `void 0` - isVoidExpression(left) ? isVoidExpression(right) && isNumericLiteral(left.expression) && left.expression.text === "0" && isNumericLiteral(right.expression) && right.expression.text === "0" : ( - // `"undefined"` or `"function"` in `typeof` checks - isStringLiteral(left) ? isStringLiteral(right) && left.text === right.text : ( - // used in `typeof` checks for fallback - isTypeOfExpression(left) ? isTypeOfExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) : ( - // parens in `typeof` checks with temps - isParenthesizedExpression(left) ? isParenthesizedExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) : ( - // conditionals used in fallback - isConditionalExpression(left) ? isConditionalExpression(right) && equateSerializedTypeNodes(left.condition, right.condition) && equateSerializedTypeNodes(left.whenTrue, right.whenTrue) && equateSerializedTypeNodes(left.whenFalse, right.whenFalse) : ( - // logical binary and assignments used in fallback - isBinaryExpression(left) ? isBinaryExpression(right) && left.operatorToken.kind === right.operatorToken.kind && equateSerializedTypeNodes(left.left, right.left) && equateSerializedTypeNodes(left.right, right.right) : false - ) - ) - ) - ) - ) - ) - ) - ); - } - function serializeTypeReferenceNode(node) { - const kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentNameScope ?? currentLexicalScope); - switch (kind) { - case 0 /* Unknown */: - if (findAncestor(node, (n) => n.parent && isConditionalTypeNode(n.parent) && (n.parent.trueType === n || n.parent.falseType === n))) { - return factory2.createIdentifier("Object"); - } - const serialized = serializeEntityNameAsExpressionFallback(node.typeName); - const temp = factory2.createTempVariable(hoistVariableDeclaration); - return factory2.createConditionalExpression( - factory2.createTypeCheck(factory2.createAssignment(temp, serialized), "function"), - /*questionToken*/ - void 0, - temp, - /*colonToken*/ - void 0, - factory2.createIdentifier("Object") - ); - case 1 /* TypeWithConstructSignatureAndValue */: - return serializeEntityNameAsExpression(node.typeName); - case 2 /* VoidNullableOrNeverType */: - return factory2.createVoidZero(); - case 4 /* BigIntLikeType */: - return getGlobalConstructor("BigInt", 7 /* ES2020 */); - case 6 /* BooleanType */: - return factory2.createIdentifier("Boolean"); - case 3 /* NumberLikeType */: - return factory2.createIdentifier("Number"); - case 5 /* StringLikeType */: - return factory2.createIdentifier("String"); - case 7 /* ArrayLikeType */: - return factory2.createIdentifier("Array"); - case 8 /* ESSymbolType */: - return getGlobalConstructor("Symbol", 2 /* ES2015 */); - case 10 /* TypeWithCallSignature */: - return factory2.createIdentifier("Function"); - case 9 /* Promise */: - return factory2.createIdentifier("Promise"); - case 11 /* ObjectType */: - return factory2.createIdentifier("Object"); - default: - return Debug.assertNever(kind); - } - } - function createCheckedValue(left, right) { - return factory2.createLogicalAnd( - factory2.createStrictInequality(factory2.createTypeOfExpression(left), factory2.createStringLiteral("undefined")), - right - ); - } - function serializeEntityNameAsExpressionFallback(node) { - if (node.kind === 80 /* Identifier */) { - const copied = serializeEntityNameAsExpression(node); - return createCheckedValue(copied, copied); - } - if (node.left.kind === 80 /* Identifier */) { - return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node)); - } - const left = serializeEntityNameAsExpressionFallback(node.left); - const temp = factory2.createTempVariable(hoistVariableDeclaration); - return factory2.createLogicalAnd( - factory2.createLogicalAnd( - left.left, - factory2.createStrictInequality(factory2.createAssignment(temp, left.right), factory2.createVoidZero()) - ), - factory2.createPropertyAccessExpression(temp, node.right) - ); - } - function serializeEntityNameAsExpression(node) { - switch (node.kind) { - case 80 /* Identifier */: - const name = setParent(setTextRange(parseNodeFactory.cloneNode(node), node), node.parent); - name.original = void 0; - setParent(name, getParseTreeNode(currentLexicalScope)); - return name; - case 167 /* QualifiedName */: - return serializeQualifiedNameAsExpression(node); - } - } - function serializeQualifiedNameAsExpression(node) { - return factory2.createPropertyAccessExpression(serializeEntityNameAsExpression(node.left), node.right); - } - function getGlobalConstructorWithFallback(name) { - return factory2.createConditionalExpression( - factory2.createTypeCheck(factory2.createIdentifier(name), "function"), - /*questionToken*/ - void 0, - factory2.createIdentifier(name), - /*colonToken*/ - void 0, - factory2.createIdentifier("Object") - ); - } - function getGlobalConstructor(name, minLanguageVersion) { - return languageVersion < minLanguageVersion ? getGlobalConstructorWithFallback(name) : factory2.createIdentifier(name); - } -} - -// src/compiler/transformers/legacyDecorators.ts -function transformLegacyDecorators(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - hoistVariableDeclaration - } = context; - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - let classAliases; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - const visited = visitEachChild(node, visitor, context); - addEmitHelpers(visited, context.readEmitHelpers()); - return visited; - } - function modifierVisitor(node) { - return isDecorator(node) ? void 0 : node; - } - function visitor(node) { - if (!(node.transformFlags & 33554432 /* ContainsDecorators */)) { - return node; - } - switch (node.kind) { - case 171 /* Decorator */: - return void 0; - case 264 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 232 /* ClassExpression */: - return visitClassExpression(node); - case 177 /* Constructor */: - return visitConstructorDeclaration(node); - case 175 /* MethodDeclaration */: - return visitMethodDeclaration(node); - case 179 /* SetAccessor */: - return visitSetAccessorDeclaration(node); - case 178 /* GetAccessor */: - return visitGetAccessorDeclaration(node); - case 173 /* PropertyDeclaration */: - return visitPropertyDeclaration(node); - case 170 /* Parameter */: - return visitParameterDeclaration(node); - default: - return visitEachChild(node, visitor, context); - } - } - function visitClassDeclaration(node) { - if (!(classOrConstructorParameterIsDecorated( - /*useLegacyDecorators*/ - true, - node - ) || childIsDecorated( - /*useLegacyDecorators*/ - true, - node - ))) { - return visitEachChild(node, visitor, context); - } - const statements = classOrConstructorParameterIsDecorated( - /*useLegacyDecorators*/ - true, - node - ) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); - return singleOrMany(statements); - } - function decoratorContainsPrivateIdentifierInExpression(decorator) { - return !!(decorator.transformFlags & 536870912 /* ContainsPrivateIdentifierInExpression */); - } - function parameterDecoratorsContainPrivateIdentifierInExpression(parameterDecorators) { - return some(parameterDecorators, decoratorContainsPrivateIdentifierInExpression); - } - function hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node) { - for (const member of node.members) { - if (!canHaveDecorators(member)) continue; - const allDecorators = getAllDecoratorsOfClassElement( - member, - node, - /*useLegacyDecorators*/ - true - ); - if (some(allDecorators == null ? void 0 : allDecorators.decorators, decoratorContainsPrivateIdentifierInExpression)) return true; - if (some(allDecorators == null ? void 0 : allDecorators.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) return true; - } - return false; - } - function transformDecoratorsOfClassElements(node, members) { - let decorationStatements = []; - addClassElementDecorationStatements( - decorationStatements, - node, - /*isStatic*/ - false - ); - addClassElementDecorationStatements( - decorationStatements, - node, - /*isStatic*/ - true - ); - if (hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node)) { - members = setTextRange( - factory2.createNodeArray([ - ...members, - factory2.createClassStaticBlockDeclaration( - factory2.createBlock( - decorationStatements, - /*multiLine*/ - true - ) - ) - ]), - members - ); - decorationStatements = void 0; - } - return { decorationStatements, members }; - } - function transformClassDeclarationWithoutClassDecorators(node, name) { - const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); - let members = visitNodes2(node.members, visitor, isClassElement); - let decorationStatements = []; - ({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members)); - const updated = factory2.updateClassDeclaration( - node, - modifiers, - name, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - return addRange([updated], decorationStatements); - } - function transformClassDeclarationWithClassDecorators(node, name) { - 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); - const declName = languageVersion < 2 /* ES2015 */ ? factory2.getInternalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ) : factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); - 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, 256 /* Static */) || isClassStaticBlockDeclaration(member)); - if (assignClassAliasInStaticBlock) { - members = setTextRange( - factory2.createNodeArray([ - factory2.createClassStaticBlockDeclaration( - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createAssignment(classAlias, factory2.createThis()) - ) - ]) - ), - ...members - ]), - members - ); - } - const classExpression = factory2.createClassExpression( - modifiers, - name && isGeneratedIdentifier(name) ? void 0 : name, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - 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, - varInitializer - ); - setOriginalNode(varDecl, node); - const varDeclList = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); - const varStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - varDeclList - ); - setOriginalNode(varStatement, node); - setTextRange(varStatement, location); - setCommentRange(varStatement, node); - const statements = [varStatement]; - addRange(statements, decorationStatements); - addConstructorDecorationStatement(statements, node); - 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; - } - function visitClassExpression(node) { - return factory2.updateClassExpression( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - node.name, - /*typeParameters*/ - void 0, - visitNodes2(node.heritageClauses, visitor, isHeritageClause), - visitNodes2(node.members, visitor, isClassElement) - ); - } - function visitConstructorDeclaration(node) { - return factory2.updateConstructorDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - visitNodes2(node.parameters, visitor, isParameter), - visitNode(node.body, visitor, isBlock) - ); - } - function finishClassElement(updated, original) { - if (updated !== original) { - setCommentRange(updated, original); - setSourceMapRange(updated, moveRangePastModifiers(original)); - } - 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 - ); - } - 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 - ); - } - 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 - ); - } - function visitPropertyDeclaration(node) { - 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 - ); - } - function visitParameterDeclaration(node) { - const updated = factory2.updateParameterDeclaration( - node, - elideNodes(factory2, node.modifiers), - node.dotDotDotToken, - Debug.checkDefined(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)); - setSourceMapRange(updated, moveRangePastModifiers(node)); - setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); - } - return updated; - } - function isSyntheticMetadataDecorator(node) { - return isCallToHelper(node.expression, "___metadata"); - } - function transformAllDecoratorsOfDeclaration(allDecorators) { - if (!allDecorators) { - return void 0; - } - const { false: decorators, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator); - const decoratorExpressions = []; - addRange(decoratorExpressions, map(decorators, transformDecorator)); - addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); - addRange(decoratorExpressions, map(metadata, transformDecorator)); - return decoratorExpressions; - } - function addClassElementDecorationStatements(statements, node, isStatic2) { - addRange(statements, map(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr))); - } - function isDecoratedClassElement(member, isStaticElement, parent2) { - return nodeOrChildIsDecorated( - /*useLegacyDecorators*/ - true, - member, - parent2 - ) && isStaticElement === isStatic(member); - } - function getDecoratedClassElements(node, isStatic2) { - return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node)); - } - function generateClassElementDecorationExpressions(node, isStatic2) { - const members = getDecoratedClassElements(node, isStatic2); - let expressions; - for (const member of members) { - expressions = append(expressions, generateClassElementDecorationExpression(node, member)); - } - return expressions; - } - function generateClassElementDecorationExpression(node, member) { - const allDecorators = getAllDecoratorsOfClassElement( - member, - node, - /*useLegacyDecorators*/ - true - ); - const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); - if (!decoratorExpressions) { - return void 0; - } - const prefix = getClassMemberPrefix(node, member); - const memberName = getExpressionForPropertyName( - member, - /*generateNameForComputedPropertyName*/ - !hasSyntacticModifier(member, 128 /* Ambient */) - ); - const descriptor = isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull(); - const helper = emitHelpers().createDecorateHelper( - decoratorExpressions, - prefix, - memberName, - descriptor - ); - setEmitFlags(helper, 3072 /* NoComments */); - setSourceMapRange(helper, moveRangePastModifiers(member)); - return helper; - } - function addConstructorDecorationStatement(statements, node) { - const expression = generateConstructorDecorationExpression(node); - if (expression) { - statements.push(setOriginalNode(factory2.createExpressionStatement(expression), node)); - } - } - function generateConstructorDecorationExpression(node) { - const allDecorators = getAllDecoratorsOfClass( - node, - /*useLegacyDecorators*/ - true - ); - const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); - if (!decoratorExpressions) { - return void 0; - } - const classAlias = classAliases && classAliases[getOriginalNodeId(node)]; - const localName = languageVersion < 2 /* ES2015 */ ? factory2.getInternalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ) : factory2.getDeclarationName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ); - const decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName); - const expression = factory2.createAssignment(localName, classAlias ? factory2.createAssignment(classAlias, decorate) : decorate); - setEmitFlags(expression, 3072 /* NoComments */); - setSourceMapRange(expression, moveRangePastModifiers(node)); - return expression; - } - function transformDecorator(decorator) { - return Debug.checkDefined(visitNode(decorator.expression, visitor, isExpression)); - } - function transformDecoratorsOfParameter(decorators, parameterOffset) { - let expressions; - if (decorators) { - expressions = []; - for (const decorator of decorators) { - const helper = emitHelpers().createParamHelper( - transformDecorator(decorator), - parameterOffset - ); - setTextRange(helper, decorator.expression); - setEmitFlags(helper, 3072 /* NoComments */); - expressions.push(helper); - } - } - return expressions; - } - function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { - const name = member.name; - if (isPrivateIdentifier(name)) { - return factory2.createIdentifier(""); - } else if (isComputedPropertyName(name)) { - return generateNameForComputedPropertyName && !isSimpleInlineableExpression(name.expression) ? factory2.getGeneratedNameForNode(name) : name.expression; - } else if (isIdentifier(name)) { - return factory2.createStringLiteral(idText(name)); - } else { - return factory2.cloneNode(name); - } - } - function enableSubstitutionForClassAliases() { - if (!classAliases) { - context.enableSubstitution(80 /* Identifier */); - classAliases = []; - } - } - function getClassAliasIfNeeded(node) { - if (resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */)) { - enableSubstitutionForClassAliases(); - const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default"); - classAliases[getOriginalNodeId(node)] = classAlias; - hoistVariableDeclaration(classAlias); - return classAlias; - } - } - function getClassPrototype(node) { - return factory2.createPropertyAccessExpression(factory2.getDeclarationName(node), "prototype"); - } - function getClassMemberPrefix(node, member) { - return isStatic(member) ? factory2.getDeclarationName(node) : getClassPrototype(node); - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 80 /* Identifier */: - return substituteExpressionIdentifier(node); - } - return node; - } - function substituteExpressionIdentifier(node) { - return trySubstituteClassAlias(node) ?? node; - } - function trySubstituteClassAlias(node) { - if (classAliases) { - if (resolver.hasNodeCheckFlag(node, 536870912 /* ConstructorReference */)) { - const declaration = resolver.getReferencedValueDeclaration(node); - if (declaration) { - const classAlias = classAliases[declaration.id]; - if (classAlias) { - const clone2 = factory2.cloneNode(classAlias); - setSourceMapRange(clone2, node); - setCommentRange(clone2, node); - return clone2; - } - } - } - } - return void 0; - } -} - -// src/compiler/transformers/esDecorators.ts -function transformESDecorators(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - startLexicalEnvironment, - endLexicalEnvironment, - hoistVariableDeclaration - } = context; - const languageVersion = getEmitScriptTarget(context.getCompilerOptions()); - let top; - let classInfo; - let classThis; - let classSuper; - let pendingExpressions; - let shouldTransformPrivateStaticElementsInFile; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - top = void 0; - shouldTransformPrivateStaticElementsInFile = false; - const visited = visitEachChild(node, visitor, context); - addEmitHelpers(visited, context.readEmitHelpers()); - if (shouldTransformPrivateStaticElementsInFile) { - addInternalEmitFlags(visited, 32 /* TransformPrivateStaticElements */); - shouldTransformPrivateStaticElementsInFile = false; - } - return visited; - } - function updateState() { - classInfo = void 0; - classThis = void 0; - classSuper = void 0; - switch (top == null ? void 0 : top.kind) { - case "class": - classInfo = top.classInfo; - break; - case "class-element": - classInfo = top.next.classInfo; - classThis = top.classThis; - classSuper = top.classSuper; - break; - case "name": - const grandparent = top.next.next.next; - if ((grandparent == null ? void 0 : grandparent.kind) === "class-element") { - classInfo = grandparent.next.classInfo; - classThis = grandparent.classThis; - classSuper = grandparent.classSuper; - } - break; - } - } - function enterClass(classInfo2) { - top = { kind: "class", next: top, classInfo: classInfo2, savedPendingExpressions: pendingExpressions }; - pendingExpressions = void 0; - updateState(); - } - function exitClass() { - Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); - pendingExpressions = top.savedPendingExpressions; - top = top.next; - updateState(); - } - function enterClassElement(node) { - var _a, _b; - Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); - top = { kind: "class-element", next: top }; - if (isClassStaticBlockDeclaration(node) || isPropertyDeclaration(node) && hasStaticModifier(node)) { - top.classThis = (_a = top.next.classInfo) == null ? void 0 : _a.classThis; - top.classSuper = (_b = top.next.classInfo) == null ? void 0 : _b.classSuper; - } - updateState(); - } - function exitClassElement() { - var _a; - Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); - Debug.assert(((_a = top.next) == null ? void 0 : _a.kind) === "class", "Incorrect value for top.next.kind.", () => { - var _a2; - return `Expected top.next.kind to be 'class' but got '${(_a2 = top.next) == null ? void 0 : _a2.kind}' instead.`; - }); - top = top.next; - updateState(); - } - function enterName() { - Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); - top = { kind: "name", next: top }; - updateState(); - } - function exitName() { - Debug.assert((top == null ? void 0 : top.kind) === "name", "Incorrect value for top.kind.", () => `Expected top.kind to be 'name' but got '${top == null ? void 0 : top.kind}' instead.`); - top = top.next; - updateState(); - } - function enterOther() { - if ((top == null ? void 0 : top.kind) === "other") { - Debug.assert(!pendingExpressions); - top.depth++; - } else { - top = { kind: "other", next: top, depth: 0, savedPendingExpressions: pendingExpressions }; - pendingExpressions = void 0; - updateState(); - } - } - function exitOther() { - Debug.assert((top == null ? void 0 : top.kind) === "other", "Incorrect value for top.kind.", () => `Expected top.kind to be 'other' but got '${top == null ? void 0 : top.kind}' instead.`); - if (top.depth > 0) { - Debug.assert(!pendingExpressions); - top.depth--; - } else { - pendingExpressions = top.savedPendingExpressions; - top = top.next; - updateState(); - } - } - function shouldVisitNode(node) { - return !!(node.transformFlags & 33554432 /* ContainsDecorators */) || !!classThis && !!(node.transformFlags & 16384 /* ContainsLexicalThis */) || !!classThis && !!classSuper && !!(node.transformFlags & 134217728 /* ContainsLexicalSuper */); - } - function visitor(node) { - if (!shouldVisitNode(node)) { - return node; - } - switch (node.kind) { - case 171 /* Decorator */: - return Debug.fail("Use `modifierVisitor` instead."); - case 264 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 232 /* ClassExpression */: - return visitClassExpression(node); - case 177 /* Constructor */: - case 173 /* PropertyDeclaration */: - case 176 /* ClassStaticBlockDeclaration */: - return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); - case 170 /* Parameter */: - return visitParameterDeclaration(node); - // Support NamedEvaluation to ensure the correct class name for class expressions. - case 227 /* BinaryExpression */: - return visitBinaryExpression( - node, - /*discarded*/ - false - ); - case 304 /* PropertyAssignment */: - return visitPropertyAssignment(node); - case 261 /* VariableDeclaration */: - return visitVariableDeclaration(node); - case 209 /* BindingElement */: - return visitBindingElement(node); - case 278 /* ExportAssignment */: - return visitExportAssignment(node); - case 110 /* ThisKeyword */: - return visitThisExpression(node); - case 249 /* ForStatement */: - return visitForStatement(node); - case 245 /* ExpressionStatement */: - return visitExpressionStatement(node); - case 357 /* CommaListExpression */: - return visitCommaListExpression( - node, - /*discarded*/ - false - ); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression( - node, - /*discarded*/ - false - ); - case 356 /* PartiallyEmittedExpression */: - return visitPartiallyEmittedExpression( - node, - /*discarded*/ - false - ); - case 214 /* CallExpression */: - return visitCallExpression(node); - case 216 /* TaggedTemplateExpression */: - return visitTaggedTemplateExpression(node); - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - return visitPreOrPostfixUnaryExpression( - node, - /*discarded*/ - false - ); - case 212 /* PropertyAccessExpression */: - return visitPropertyAccessExpression(node); - case 213 /* ElementAccessExpression */: - return visitElementAccessExpression(node); - case 168 /* ComputedPropertyName */: - return visitComputedPropertyName(node); - case 175 /* MethodDeclaration */: - // object literal methods and accessors - case 179 /* SetAccessor */: - case 178 /* GetAccessor */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: { - enterOther(); - const result = visitEachChild(node, fallbackVisitor, context); - exitOther(); - return result; - } - default: - return visitEachChild(node, fallbackVisitor, context); - } - } - function fallbackVisitor(node) { - switch (node.kind) { - case 171 /* Decorator */: - return void 0; - default: - return visitor(node); - } - } - function modifierVisitor(node) { - switch (node.kind) { - case 171 /* Decorator */: - return void 0; - default: - return node; - } - } - function classElementVisitor(node) { - switch (node.kind) { - case 177 /* Constructor */: - return visitConstructorDeclaration(node); - case 175 /* MethodDeclaration */: - return visitMethodDeclaration(node); - case 178 /* GetAccessor */: - return visitGetAccessorDeclaration(node); - case 179 /* SetAccessor */: - return visitSetAccessorDeclaration(node); - case 173 /* PropertyDeclaration */: - return visitPropertyDeclaration(node); - case 176 /* ClassStaticBlockDeclaration */: - return visitClassStaticBlockDeclaration(node); - default: - return visitor(node); - } - } - function discardedValueVisitor(node) { - switch (node.kind) { - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - return visitPreOrPostfixUnaryExpression( - node, - /*discarded*/ - true - ); - case 227 /* BinaryExpression */: - return visitBinaryExpression( - node, - /*discarded*/ - true - ); - case 357 /* CommaListExpression */: - return visitCommaListExpression( - node, - /*discarded*/ - true - ); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression( - node, - /*discarded*/ - true - ); - default: - return visitor(node); - } - } - function getHelperVariableName(node) { - let declarationName = node.name && isIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name) : node.name && isPrivateIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name).slice(1) : node.name && isStringLiteral(node.name) && isIdentifierText(node.name.text, 99 /* ESNext */) ? node.name.text : isClassLike(node) ? "class" : "member"; - if (isGetAccessor(node)) declarationName = `get_${declarationName}`; - if (isSetAccessor(node)) declarationName = `set_${declarationName}`; - if (node.name && isPrivateIdentifier(node.name)) declarationName = `private_${declarationName}`; - if (isStatic(node)) declarationName = `static_${declarationName}`; - return "_" + declarationName; - } - function createHelperVariable(node, suffix) { - return factory2.createUniqueName(`${getHelperVariableName(node)}_${suffix}`, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */); - } - function createLet(name, initializer) { - return factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ) - ], 1 /* Let */) - ); - } - function createClassInfo(node) { - 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 (isMethodOrAccessor(member) && nodeOrChildIsDecorated( - /*useLegacyDecorators*/ - false, - member, - node - )) { - if (hasStaticModifier(member)) { - 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 { - 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)) { - if (!isClassNamedEvaluationHelperBlock(member)) { - hasStaticInitializers = true; - } - } else if (isPropertyDeclaration(member)) { - if (hasStaticModifier(member)) { - hasStaticInitializers || (hasStaticInitializers = !!member.initializer || hasDecorators(member)); - } else { - hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(member)); - } - } - if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { - hasStaticPrivateClassElements = true; - } - if (staticMethodExtraInitializersName && instanceMethodExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) { - break; - } - } - return { - class: node, - classThis: classThis2, - metadataReference, - instanceMethodExtraInitializersName, - staticMethodExtraInitializersName, - hasStaticInitializers, - hasNonAmbientInstanceFields, - hasStaticPrivateClassElements, - pendingStaticInitializers, - pendingInstanceInitializers - }; - } - function transformClassLike(node) { - startLexicalEnvironment(); - if (!classHasDeclaredOrExplicitlyAssignedName(node) && classOrConstructorParameterIsDecorated( - /*useLegacyDecorators*/ - false, - node - )) { - node = injectClassNamedEvaluationHelperBlockIfMissing(context, node, factory2.createStringLiteral("")); - } - const classReference = factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - false, - /*ignoreAssignedName*/ - true - ); - const classInfo2 = createClassInfo(node); - const classDefinitionStatements = []; - let leadingBlockStatements; - let trailingBlockStatements; - let syntheticConstructor; - let heritageClauses; - let shouldTransformPrivateStaticElementsInClass = false; - const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass( - node, - /*useLegacyDecorators*/ - false - )); - if (classDecorators) { - 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), - createLet(classInfo2.classExtraInitializersName, factory2.createArrayLiteralExpression()), - createLet(classInfo2.classThis) - ); - if (classInfo2.hasStaticPrivateClassElements) { - shouldTransformPrivateStaticElementsInClass = true; - shouldTransformPrivateStaticElementsInFile = true; - } - } - 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(); - enterClass(classInfo2); - 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) { - expression = visitNode(expression, function thisVisitor(node2) { - if (!(node2.transformFlags & 16384 /* ContainsLexicalThis */)) { - return node2; - } - switch (node2.kind) { - case 110 /* ThisKeyword */: - if (!outerThis) { - outerThis = factory2.createUniqueName("_outerThis", 16 /* Optimistic */); - classDefinitionStatements.unshift(createLet(outerThis, factory2.createThis())); - } - return outerThis; - default: - return visitEachChild(node2, thisVisitor, context); - } - }, isExpression); - const statement = factory2.createExpressionStatement(expression); - leadingBlockStatements = append(leadingBlockStatements, statement); - } - pendingExpressions = void 0; - } - exitClass(); - if (some(classInfo2.pendingInstanceInitializers) && !getFirstConstructorWithBody(node)) { - const initializerStatements = prepareConstructor(node, classInfo2); - if (initializerStatements) { - const extendsClauseElement = getEffectiveBaseTypeNode(node); - const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106 /* NullKeyword */); - const constructorStatements = []; - if (isDerivedClass) { - const spreadArguments = factory2.createSpreadElement(factory2.createIdentifier("arguments")); - const superCall = factory2.createCallExpression( - factory2.createSuper(), - /*typeArguments*/ - void 0, - [spreadArguments] - ); - constructorStatements.push(factory2.createExpressionStatement(superCall)); - } - addRange(constructorStatements, initializerStatements); - const constructorBody = factory2.createBlock( - constructorStatements, - /*multiLine*/ - true - ); - syntheticConstructor = factory2.createConstructorDeclaration( - /*modifiers*/ - void 0, - [], - constructorBody - ); - } - } - if (classInfo2.staticMethodExtraInitializersName) { - classDefinitionStatements.push( - createLet(classInfo2.staticMethodExtraInitializersName, factory2.createArrayLiteralExpression()) - ); - } - if (classInfo2.instanceMethodExtraInitializersName) { - classDefinitionStatements.push( - createLet(classInfo2.instanceMethodExtraInitializersName, factory2.createArrayLiteralExpression()) - ); - } - if (classInfo2.memberInfos) { - forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { - if (isStatic(member)) { - classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); - 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)); - } - } - }); - } - if (classInfo2.memberInfos) { - forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { - if (!isStatic(member)) { - classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); - 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)); - } - } - }); - } - leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticNonFieldDecorationStatements); - leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticNonFieldDecorationStatements); - leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticFieldDecorationStatements); - leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticFieldDecorationStatements); - if (classInfo2.classDescriptorName && classInfo2.classDecoratorsName && classInfo2.classExtraInitializersName && classInfo2.classThis) { - leadingBlockStatements ?? (leadingBlockStatements = []); - const valueProperty = factory2.createPropertyAssignment("value", renamedClassThis); - const classDescriptor = factory2.createObjectLiteralExpression([valueProperty]); - const classDescriptorAssignment = factory2.createAssignment(classInfo2.classDescriptorName, classDescriptor); - const classNameReference = factory2.createPropertyAccessExpression(renamedClassThis, "name"); - const esDecorateHelper2 = emitHelpers().createESDecorateHelper( - factory2.createNull(), - classDescriptorAssignment, - classInfo2.classDecoratorsName, - { kind: "class", name: classNameReference, metadata: classInfo2.metadataReference }, - factory2.createNull(), - classInfo2.classExtraInitializersName - ); - const esDecorateStatement = factory2.createExpressionStatement(esDecorateHelper2); - setSourceMapRange(esDecorateStatement, moveRangePastDecorators(node)); - leadingBlockStatements.push(esDecorateStatement); - const classDescriptorValueReference = factory2.createPropertyAccessExpression(classInfo2.classDescriptorName, "value"); - const classThisAssignment = factory2.createAssignment(classInfo2.classThis, classDescriptorValueReference); - const classReferenceAssignment = factory2.createAssignment(classReference, classThisAssignment); - leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment)); - } - 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); - const runClassInitializersStatement = factory2.createExpressionStatement(runClassInitializersHelper); - setSourceMapRange(runClassInitializersStatement, node.name ?? moveRangePastDecorators(node)); - trailingBlockStatements = append(trailingBlockStatements, runClassInitializersStatement); - } - if (leadingBlockStatements && trailingBlockStatements && !classInfo2.hasStaticInitializers) { - addRange(leadingBlockStatements, trailingBlockStatements); - trailingBlockStatements = void 0; - } - const leadingStaticBlock = leadingBlockStatements && factory2.createClassStaticBlockDeclaration(factory2.createBlock( - leadingBlockStatements, - /*multiLine*/ - true - )); - if (leadingStaticBlock && shouldTransformPrivateStaticElementsInClass) { - setInternalEmitFlags(leadingStaticBlock, 32 /* TransformPrivateStaticElements */); - } - 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(); - let classExpression; - if (classDecorators) { - classExpression = factory2.createClassExpression( - /*modifiers*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - if (classInfo2.classThis) { - classExpression = injectClassThisAssignmentIfMissing(factory2, classExpression, classInfo2.classThis); - } - const classReferenceDeclaration = factory2.createVariableDeclaration( - classReference, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - classExpression - ); - const classReferenceVarDeclList = factory2.createVariableDeclarationList([classReferenceDeclaration]); - const returnExpr = classInfo2.classThis ? factory2.createAssignment(classReference, classInfo2.classThis) : classReference; - classDefinitionStatements.push( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - classReferenceVarDeclList - ), - factory2.createReturnStatement(returnExpr) - ); - } else { - classExpression = factory2.createClassExpression( - /*modifiers*/ - void 0, - node.name, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - classDefinitionStatements.push(factory2.createReturnStatement(classExpression)); - } - if (shouldTransformPrivateStaticElementsInClass) { - addInternalEmitFlags(classExpression, 32 /* TransformPrivateStaticElements */); - for (const member of classExpression.members) { - if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { - addInternalEmitFlags(member, 32 /* TransformPrivateStaticElements */); - } - } - } - setOriginalNode(classExpression, node); - return factory2.createImmediatelyInvokedArrowFunction(factory2.mergeLexicalEnvironment(classDefinitionStatements, lexicalEnvironment)); - } - function isDecoratedClassLike(node) { - return classOrConstructorParameterIsDecorated( - /*useLegacyDecorators*/ - false, - node - ) || childIsDecorated( - /*useLegacyDecorators*/ - false, - node - ); - } - function visitClassDeclaration(node) { - if (isDecoratedClassLike(node)) { - 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); - 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, - /*allowSourceMaps*/ - true - ); - const varDecl = factory2.createVariableDeclaration( - declName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - iife - ); - setOriginalNode(varDecl, node); - const varDecls = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); - 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); - enterClass( - /*classInfo*/ - void 0 - ); - const members = visitNodes2(node.members, classElementVisitor, isClassElement); - exitClass(); - return factory2.updateClassDeclaration( - node, - modifiers, - node.name, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - } - } - function visitClassExpression(node) { - if (isDecoratedClassLike(node)) { - const iife = transformClassLike(node); - setOriginalNode(iife, node); - return iife; - } else { - const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); - enterClass( - /*classInfo*/ - void 0 - ); - const members = visitNodes2(node.members, classElementVisitor, isClassElement); - exitClass(); - return factory2.updateClassExpression( - node, - modifiers, - node.name, - /*typeParameters*/ - void 0, - heritageClauses, - members - ); - } - } - function prepareConstructor(_parent, classInfo2) { - if (some(classInfo2.pendingInstanceInitializers)) { - const statements = []; - statements.push( - factory2.createExpressionStatement( - 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); - const parameters = visitNodes2(node.parameters, visitor, isParameter); - let body; - if (node.body && classInfo) { - const initializerStatements = prepareConstructor(classInfo.class, classInfo); - if (initializerStatements) { - const statements = []; - const nonPrologueStart = factory2.copyPrologue( - node.body.statements, - statements, - /*ensureUseStrict*/ - false, - visitor - ); - 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)); - } - body = factory2.createBlock( - statements, - /*multiLine*/ - true - ); - setOriginalNode(body, node.body); - setTextRange(body, node.body); - } - } - body ?? (body = visitNode(node.body, visitor, isBlock)); - exitClassElement(); - return factory2.updateConstructorDeclaration(node, modifiers, parameters, body); - } - function finishClassElement(updated, original) { - if (updated !== original) { - setCommentRange(updated, original); - setSourceMapRange(updated, moveRangePastDecorators(original)); - } - return updated; - } - 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(); - name = visitPropertyName(member.name); - exitName(); - return { modifiers: modifiers2, referencedName, name, initializersName, descriptorName, thisArg }; - } - const memberDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement( - member, - classInfo2.class, - /*useLegacyDecorators*/ - false - )); - const modifiers = visitNodes2(member.modifiers, modifierVisitor, isModifier); - if (memberDecorators) { - const memberDecoratorsName = createHelperVariable(member, "decorators"); - const memberDecoratorsArray = factory2.createArrayLiteralExpression(memberDecorators); - const memberDecoratorsAssignment = factory2.createAssignment(memberDecoratorsName, memberDecoratorsArray); - const memberInfo = { memberDecoratorsName }; - classInfo2.memberInfos ?? (classInfo2.memberInfos = /* @__PURE__ */ new Map()); - classInfo2.memberInfos.set(member, memberInfo); - pendingExpressions ?? (pendingExpressions = []); - pendingExpressions.push(memberDecoratorsAssignment); - const statements = isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? classInfo2.staticNonFieldDecorationStatements ?? (classInfo2.staticNonFieldDecorationStatements = []) : classInfo2.nonStaticNonFieldDecorationStatements ?? (classInfo2.nonStaticNonFieldDecorationStatements = []) : isPropertyDeclaration(member) && !isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? classInfo2.staticFieldDecorationStatements ?? (classInfo2.staticFieldDecorationStatements = []) : classInfo2.nonStaticFieldDecorationStatements ?? (classInfo2.nonStaticFieldDecorationStatements = []) : Debug.fail(); - const kind = isGetAccessorDeclaration(member) ? "getter" : isSetAccessorDeclaration(member) ? "setter" : isMethodDeclaration(member) ? "method" : isAutoAccessorPropertyDeclaration(member) ? "accessor" : isPropertyDeclaration(member) ? "field" : Debug.fail(); - let propertyName; - if (isIdentifier(member.name) || isPrivateIdentifier(member.name)) { - propertyName = { computed: false, name: member.name }; - } else if (isPropertyNameLiteral(member.name)) { - propertyName = { computed: true, name: factory2.createStringLiteralFromNode(member.name) }; - } else { - const expression = member.name.expression; - if (isPropertyNameLiteral(expression) && !isIdentifier(expression)) { - propertyName = { computed: true, name: factory2.createStringLiteralFromNode(expression) }; - } else { - enterName(); - ({ referencedName, name } = visitReferencedPropertyName(member.name)); - propertyName = { computed: true, name: referencedName }; - exitName(); - } - } - const context2 = { - kind, - name: propertyName, - static: isStatic(member), - private: isPrivateIdentifier(member.name), - access: { - // 15.7.3 CreateDecoratorAccessObject (kind, name) - // 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ... - get: isPropertyDeclaration(member) || isGetAccessorDeclaration(member) || isMethodDeclaration(member), - // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ... - set: isPropertyDeclaration(member) || isSetAccessorDeclaration(member) - }, - metadata: classInfo2.metadataReference - }; - 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(), 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; - } - let descriptor; - if (isPrivateIdentifierClassElementDeclaration(member) && hasAccessorModifier(member) && createDescriptor) { - descriptor = createDescriptor( - member, - /*modifiers*/ - void 0 - ); - memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); - descriptor = factory2.createAssignment(descriptorName, descriptor); - } - const esDecorateExpression = emitHelpers().createESDecorateHelper( - isAutoAccessorPropertyDeclaration(member) ? factory2.createThis() : factory2.createNull(), - descriptor ?? factory2.createNull(), - memberDecoratorsName, - context2, - initializersName, - extraInitializersName - ); - const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); - setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); - statements.push(esDecorateStatement); - } - } - if (name === void 0) { - enterName(); - name = visitPropertyName(member.name); - exitName(); - } - if (!some(modifiers) && (isMethodDeclaration(member) || isPropertyDeclaration(member))) { - setEmitFlags(name, 1024 /* NoLeadingComments */); - } - return { modifiers, referencedName, name, initializersName, extraInitializersName, descriptorName, thisArg }; - } - function visitMethodDeclaration(node) { - enterClassElement(node); - const { modifiers, name, descriptorName } = partialTransformClassElement(node, classInfo, createMethodDescriptorObject); - if (descriptorName) { - exitClassElement(); - return finishClassElement(createMethodDescriptorForwarder(modifiers, name, descriptorName), node); - } else { - const parameters = visitNodes2(node.parameters, visitor, isParameter); - const body = visitNode(node.body, visitor, isBlock); - exitClassElement(); - return finishClassElement(factory2.updateMethodDeclaration( - node, - modifiers, - node.asteriskToken, - name, - /*questionToken*/ - void 0, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - body - ), node); - } - } - function visitGetAccessorDeclaration(node) { - enterClassElement(node); - const { modifiers, name, descriptorName } = partialTransformClassElement(node, classInfo, createGetAccessorDescriptorObject); - if (descriptorName) { - exitClassElement(); - return finishClassElement(createGetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); - } else { - const parameters = visitNodes2(node.parameters, visitor, isParameter); - const body = visitNode(node.body, visitor, isBlock); - exitClassElement(); - return finishClassElement(factory2.updateGetAccessorDeclaration( - node, - modifiers, - name, - parameters, - /*type*/ - void 0, - body - ), node); - } - } - function visitSetAccessorDeclaration(node) { - enterClassElement(node); - const { modifiers, name, descriptorName } = partialTransformClassElement(node, classInfo, createSetAccessorDescriptorObject); - if (descriptorName) { - exitClassElement(); - return finishClassElement(createSetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); - } else { - const parameters = visitNodes2(node.parameters, visitor, isParameter); - const body = visitNode(node.body, visitor, isBlock); - exitClassElement(); - return finishClassElement(factory2.updateSetAccessorDeclaration(node, modifiers, name, parameters, body), node); - } - } - function visitClassStaticBlockDeclaration(node) { - enterClassElement(node); - 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 { modifiers, name, initializersName, extraInitializersName, descriptorName, thisArg } = partialTransformClassElement(node, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); - startLexicalEnvironment(); - let initializer = visitNode(node.initializer, visitor, isExpression); - if (initializersName) { - initializer = emitHelpers().createRunInitializersHelper( - thisArg ?? factory2.createThis(), - initializersName, - initializer ?? factory2.createVoidZero() - ); - } - if (isStatic(node) && classInfo && initializer) { - classInfo.hasStaticInitializers = true; - } - const declarations = endLexicalEnvironment(); - if (some(declarations)) { - initializer = factory2.createImmediatelyInvokedArrowFunction([ - ...declarations, - 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); - const sourceMapRange = getSourceMapRange(node); - const name2 = node.name; - let getterName = name2; - let setterName = name2; - if (isComputedPropertyName(name2) && !isSimpleInlineableExpression(name2.expression)) { - const cacheAssignment = findComputedPropertyNameCacheAssignment(name2); - if (cacheAssignment) { - getterName = factory2.updateComputedPropertyName(name2, visitNode(name2.expression, visitor, isExpression)); - setterName = factory2.updateComputedPropertyName(name2, cacheAssignment.left); - } else { - const temp = factory2.createTempVariable(hoistVariableDeclaration); - setSourceMapRange(temp, name2.expression); - const expression = visitNode(name2.expression, visitor, isExpression); - const assignment = factory2.createAssignment(temp, expression); - setSourceMapRange(assignment, name2.expression); - getterName = factory2.updateComputedPropertyName(name2, assignment); - setterName = factory2.updateComputedPropertyName(name2, temp); - } - } - const modifiersWithoutAccessor = visitNodes2(modifiers, (node2) => node2.kind !== 129 /* AccessorKeyword */ ? node2 : void 0, isModifier); - const backingField = createAccessorPropertyBackingField(factory2, node, modifiersWithoutAccessor, initializer); - setOriginalNode(backingField, node); - setEmitFlags(backingField, 3072 /* NoComments */); - setSourceMapRange(backingField, sourceMapRange); - setSourceMapRange(backingField.name, node.name); - const getter = createGetAccessorDescriptorForwarder(modifiersWithoutAccessor, getterName, descriptorName); - setOriginalNode(getter, node); - setCommentRange(getter, commentRange); - setSourceMapRange(getter, sourceMapRange); - const setter = createSetAccessorDescriptorForwarder(modifiersWithoutAccessor, setterName, descriptorName); - setOriginalNode(setter, node); - setEmitFlags(setter, 3072 /* NoComments */); - setSourceMapRange(setter, sourceMapRange); - return [backingField, getter, setter]; - } - return finishClassElement(factory2.updatePropertyDeclaration( - node, - modifiers, - name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ), node); - } - function visitThisExpression(node) { - return classThis ?? node; - } - function visitCallExpression(node) { - if (isSuperProperty(node.expression) && classThis) { - const expression = visitNode(node.expression, visitor, isExpression); - const argumentsList = visitNodes2(node.arguments, visitor, isExpression); - const invocation = factory2.createFunctionCallCall(expression, classThis, argumentsList); - setOriginalNode(invocation, node); - setTextRange(invocation, node); - return invocation; - } - return visitEachChild(node, visitor, context); - } - function visitTaggedTemplateExpression(node) { - if (isSuperProperty(node.tag) && classThis) { - const tag = visitNode(node.tag, visitor, isExpression); - const boundTag = factory2.createFunctionBindCall(tag, classThis, []); - setOriginalNode(boundTag, node); - setTextRange(boundTag, node); - const template = visitNode(node.template, visitor, isTemplateLiteral); - return factory2.updateTaggedTemplateExpression( - node, - boundTag, - /*typeArguments*/ - void 0, - template - ); - } - return visitEachChild(node, visitor, context); - } - function visitPropertyAccessExpression(node) { - if (isSuperProperty(node) && isIdentifier(node.name) && classThis && classSuper) { - const propertyName = factory2.createStringLiteralFromNode(node.name); - const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); - setOriginalNode(superProperty, node.expression); - setTextRange(superProperty, node.expression); - return superProperty; - } - return visitEachChild(node, visitor, context); - } - function visitElementAccessExpression(node) { - if (isSuperProperty(node) && classThis && classSuper) { - const propertyName = visitNode(node.argumentExpression, visitor, isExpression); - const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); - setOriginalNode(superProperty, node.expression); - setTextRange(superProperty, node.expression); - return superProperty; - } - return visitEachChild(node, visitor, context); - } - function visitParameterDeclaration(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - 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)); - setSourceMapRange(updated, moveRangePastModifiers(node)); - setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */); - } - return updated; - } - 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, - visitNode(node.initializer, discardedValueVisitor, isForInitializer), - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, discardedValueVisitor, isExpression), - visitIterationBody(node.statement, visitor, context) - ); - } - function visitExpressionStatement(node) { - return visitEachChild(node, discardedValueVisitor, context); - } - function visitBinaryExpression(node, discarded) { - if (isDestructuringAssignment(node)) { - const left = visitAssignmentPattern(node.left); - const right = visitNode(node.right, visitor, isExpression); - return factory2.updateBinaryExpression(node, left, node.operatorToken, right); - } - if (isAssignmentExpression(node)) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - 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; - if (setterName) { - let expression = visitNode(node.right, visitor, isExpression); - if (isCompoundAssignment(node.operatorToken.kind)) { - let getterName = setterName; - if (!isSimpleInlineableExpression(setterName)) { - getterName = factory2.createTempVariable(hoistVariableDeclaration); - setterName = factory2.createAssignment(getterName, setterName); - } - const superPropertyGet = factory2.createReflectGetCall( - classSuper, - getterName, - classThis - ); - setOriginalNode(superPropertyGet, node.left); - setTextRange(superPropertyGet, node.left); - expression = factory2.createBinaryExpression( - superPropertyGet, - getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), - expression - ); - setTextRange(expression, node); - } - const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); - if (temp) { - expression = factory2.createAssignment(temp, expression); - setTextRange(temp, node); - } - expression = factory2.createReflectSetCall( - classSuper, - setterName, - expression, - classThis - ); - setOriginalNode(expression, node); - setTextRange(expression, node); - if (temp) { - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; - } - } - } - if (node.operatorToken.kind === 28 /* CommaToken */) { - const left = visitNode(node.left, discardedValueVisitor, isExpression); - const right = visitNode(node.right, discarded ? discardedValueVisitor : visitor, isExpression); - return factory2.updateBinaryExpression(node, left, node.operatorToken, right); - } - return visitEachChild(node, visitor, context); - } - function visitPreOrPostfixUnaryExpression(node, discarded) { - if (node.operator === 46 /* PlusPlusToken */ || node.operator === 47 /* MinusMinusToken */) { - const operand = skipParentheses(node.operand); - if (isSuperProperty(operand) && classThis && classSuper) { - let setterName = isElementAccessExpression(operand) ? visitNode(operand.argumentExpression, visitor, isExpression) : isIdentifier(operand.name) ? factory2.createStringLiteralFromNode(operand.name) : void 0; - if (setterName) { - let getterName = setterName; - if (!isSimpleInlineableExpression(setterName)) { - getterName = factory2.createTempVariable(hoistVariableDeclaration); - setterName = factory2.createAssignment(getterName, setterName); - } - let expression = factory2.createReflectGetCall(classSuper, getterName, classThis); - setOriginalNode(expression, node); - setTextRange(expression, node); - const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); - expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); - expression = factory2.createReflectSetCall(classSuper, setterName, expression, classThis); - setOriginalNode(expression, node); - setTextRange(expression, node); - if (temp) { - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; - } - } - } - return visitEachChild(node, visitor, context); - } - function visitCommaListExpression(node, discarded) { - const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); - return factory2.updateCommaListExpression(node, elements); - } - 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.getGeneratedNameForNode(node); - hoistVariableDeclaration(referencedName); - 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 visitPropertyName(node) { - if (isComputedPropertyName(node)) { - return visitComputedPropertyName(node); - } - return visitNode(node, visitor, isPropertyName); - } - function visitComputedPropertyName(node) { - let expression = visitNode(node.expression, visitor, isExpression); - if (!isSimpleInlineableExpression(expression)) { - expression = injectPendingExpressions(expression); - } - return factory2.updateComputedPropertyName(node, expression); - } - function visitPropertyAssignment(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); - } - return visitEachChild(node, visitor, context); - } - function visitVariableDeclaration(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); - } - return visitEachChild(node, visitor, context); - } - function visitBindingElement(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); - } - return visitEachChild(node, visitor, context); - } - function visitDestructuringAssignmentTarget(node) { - if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { - return visitAssignmentPattern(node); - } - if (isSuperProperty(node) && classThis && classSuper) { - const propertyName = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; - if (propertyName) { - const paramName = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const expression = factory2.createAssignmentTargetWrapper( - paramName, - factory2.createReflectSetCall( - classSuper, - propertyName, - paramName, - classThis - ) - ); - setOriginalNode(expression, node); - setTextRange(expression, node); - return expression; - } - } - return visitEachChild(node, visitor, context); - } - function visitAssignmentElement(node) { - if (isAssignmentExpression( - node, - /*excludeCompoundAssignment*/ - true - )) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - 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); - } - } - function visitAssignmentRestElement(node) { - if (isLeftHandSideExpression(node.expression)) { - const expression = visitDestructuringAssignmentTarget(node.expression); - return factory2.updateSpreadElement(node, expression); - } - return visitEachChild(node, visitor, context); - } - function visitArrayAssignmentElement(node) { - Debug.assertNode(node, isArrayBindingOrAssignmentElement); - if (isSpreadElement(node)) return visitAssignmentRestElement(node); - if (!isOmittedExpression(node)) return visitAssignmentElement(node); - return visitEachChild(node, visitor, context); - } - function visitAssignmentProperty(node) { - const name = visitNode(node.name, visitor, isPropertyName); - if (isAssignmentExpression( - node.initializer, - /*excludeCompoundAssignment*/ - true - )) { - const assignmentElement = visitAssignmentElement(node.initializer); - return factory2.updatePropertyAssignment(node, name, assignmentElement); - } - if (isLeftHandSideExpression(node.initializer)) { - const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); - return factory2.updatePropertyAssignment(node, name, assignmentElement); - } - return visitEachChild(node, visitor, context); - } - function visitShorthandAssignmentProperty(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.objectAssignmentInitializer)); - } - return visitEachChild(node, visitor, context); - } - function visitAssignmentRestProperty(node) { - if (isLeftHandSideExpression(node.expression)) { - const expression = visitDestructuringAssignmentTarget(node.expression); - return factory2.updateSpreadAssignment(node, expression); - } - return visitEachChild(node, visitor, context); - } - function visitObjectAssignmentElement(node) { - Debug.assertNode(node, isObjectBindingOrAssignmentElement); - if (isSpreadAssignment(node)) return visitAssignmentRestProperty(node); - if (isShorthandPropertyAssignment(node)) return visitShorthandAssignmentProperty(node); - if (isPropertyAssignment(node)) return visitAssignmentProperty(node); - return visitEachChild(node, visitor, context); - } - function visitAssignmentPattern(node) { - if (isArrayLiteralExpression(node)) { - const elements = visitNodes2(node.elements, visitArrayAssignmentElement, isExpression); - return factory2.updateArrayLiteralExpression(node, elements); - } else { - const properties = visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike); - return factory2.updateObjectLiteralExpression(node, properties); - } - } - function visitExportAssignment(node) { - if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.expression)); - } - return visitEachChild(node, visitor, context); - } - 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) { - const visitorFunc = discarded ? discardedValueVisitor : visitor; - const expression = visitNode(node.expression, visitorFunc, isExpression); - return factory2.updatePartiallyEmittedExpression(node, expression); - } - 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 { - expression = factory2.inlineExpressions(pendingExpressions2); - } - } - 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; - } - const decoratorExpressions = []; - addRange(decoratorExpressions, map(allDecorators.decorators, transformDecorator)); - return decoratorExpressions; - } - 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) { - const func = factory2.createFunctionExpression( - modifiers, - asteriskToken, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - body ?? factory2.createBlock([]) - ); - setOriginalNode(func, original); - setSourceMapRange(func, moveRangePastDecorators(original)); - setEmitFlags(func, 3072 /* NoComments */); - const prefix = kind === "get" || kind === "set" ? kind : void 0; - const functionName = factory2.createStringLiteralFromNode( - name, - /*isSingleQuote*/ - void 0 - ); - const namedFunction = emitHelpers().createSetFunctionNameHelper(func, functionName, prefix); - const method = factory2.createPropertyAssignment(factory2.createIdentifier(kind), namedFunction); - setOriginalNode(method, original); - setSourceMapRange(method, moveRangePastDecorators(original)); - setEmitFlags(method, 3072 /* NoComments */); - return method; - } - function createMethodDescriptorObject(node, modifiers) { - return factory2.createObjectLiteralExpression([ - createDescriptorMethod( - node, - node.name, - modifiers, - node.asteriskToken, - "value", - visitNodes2(node.parameters, visitor, isParameter), - visitNode(node.body, visitor, isBlock) - ) - ]); - } - function createGetAccessorDescriptorObject(node, modifiers) { - return factory2.createObjectLiteralExpression([ - createDescriptorMethod( - node, - node.name, - modifiers, - /*asteriskToken*/ - void 0, - "get", - [], - visitNode(node.body, visitor, isBlock) - ) - ]); - } - function createSetAccessorDescriptorObject(node, modifiers) { - return factory2.createObjectLiteralExpression([ - createDescriptorMethod( - node, - node.name, - modifiers, - /*asteriskToken*/ - void 0, - "set", - visitNodes2(node.parameters, visitor, isParameter), - visitNode(node.body, visitor, isBlock) - ) - ]); - } - function createAccessorPropertyDescriptorObject(node, modifiers) { - return factory2.createObjectLiteralExpression([ - createDescriptorMethod( - node, - node.name, - modifiers, - /*asteriskToken*/ - void 0, - "get", - [], - factory2.createBlock([ - factory2.createReturnStatement( - factory2.createPropertyAccessExpression( - factory2.createThis(), - factory2.getGeneratedPrivateNameForNode(node.name) - ) - ) - ]) - ), - createDescriptorMethod( - node, - node.name, - modifiers, - /*asteriskToken*/ - void 0, - "set", - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "value" - )], - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.createPropertyAccessExpression( - factory2.createThis(), - factory2.getGeneratedPrivateNameForNode(node.name) - ), - factory2.createIdentifier("value") - ) - ) - ]) - ) - ]); - } - function createMethodDescriptorForwarder(modifiers, name, descriptorName) { - modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); - return factory2.createGetAccessorDeclaration( - modifiers, - name, - [], - /*type*/ - void 0, - factory2.createBlock([ - factory2.createReturnStatement( - factory2.createPropertyAccessExpression( - descriptorName, - factory2.createIdentifier("value") - ) - ) - ]) - ); - } - function createGetAccessorDescriptorForwarder(modifiers, name, descriptorName) { - modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); - return factory2.createGetAccessorDeclaration( - modifiers, - name, - [], - /*type*/ - void 0, - factory2.createBlock([ - factory2.createReturnStatement( - factory2.createFunctionCallCall( - factory2.createPropertyAccessExpression( - descriptorName, - factory2.createIdentifier("get") - ), - factory2.createThis(), - [] - ) - ) - ]) - ); - } - function createSetAccessorDescriptorForwarder(modifiers, name, descriptorName) { - modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); - return factory2.createSetAccessorDeclaration( - modifiers, - name, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "value" - )], - factory2.createBlock([ - factory2.createReturnStatement( - factory2.createFunctionCallCall( - factory2.createPropertyAccessExpression( - descriptorName, - factory2.createIdentifier("set") - ), - factory2.createThis(), - [factory2.createIdentifier("value")] - ) - ) - ]) - ); - } - 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() - ); - } -} - -// src/compiler/transformers/es2017.ts -function transformES2017(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - resumeLexicalEnvironment, - endLexicalEnvironment, - hoistVariableDeclaration - } = context; - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - let enabledSubstitutions = 0 /* None */; - let enclosingSuperContainerFlags = 0; - let enclosingFunctionParameterNames; - let capturedSuperProperties; - let hasSuperElementAccess; - let lexicalArgumentsBinding; - const substitutedSuperAccessors = []; - let contextFlags = 0 /* None */; - const previousOnEmitNode = context.onEmitNode; - const previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - setContextFlag(1 /* NonTopLevel */, false); - setContextFlag(2 /* HasLexicalThis */, !isEffectiveStrictModeSourceFile(node, compilerOptions)); - const visited = visitEachChild(node, visitor, context); - addEmitHelpers(visited, context.readEmitHelpers()); - return visited; - } - function setContextFlag(flag, val) { - contextFlags = val ? contextFlags | flag : contextFlags & ~flag; - } - function inContext(flags) { - return (contextFlags & flags) !== 0; - } - function inTopLevelContext() { - return !inContext(1 /* NonTopLevel */); - } - function inHasLexicalThisContext() { - return inContext(2 /* HasLexicalThis */); - } - function doWithContext(flags, cb, value) { - const contextFlagsToSet = flags & ~contextFlags; - if (contextFlagsToSet) { - setContextFlag( - contextFlagsToSet, - /*val*/ - true - ); - const result = cb(value); - setContextFlag( - contextFlagsToSet, - /*val*/ - false - ); - return result; - } - return cb(value); - } - function visitDefault(node) { - return visitEachChild(node, visitor, context); - } - function argumentsVisitor(node) { - switch (node.kind) { - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 177 /* Constructor */: - return node; - case 170 /* Parameter */: - case 209 /* BindingElement */: - case 261 /* 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 lexicalArgumentsBinding ? argumentsVisitor(node) : node; - } - switch (node.kind) { - case 134 /* AsyncKeyword */: - return void 0; - case 224 /* AwaitExpression */: - return visitAwaitExpression(node); - case 175 /* MethodDeclaration */: - return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 263 /* FunctionDeclaration */: - return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 219 /* FunctionExpression */: - return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 220 /* ArrowFunction */: - return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 212 /* PropertyAccessExpression */: - if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { - capturedSuperProperties.add(node.name.escapedText); - } - return visitEachChild(node, visitor, context); - case 213 /* ElementAccessExpression */: - if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { - hasSuperElementAccess = true; - } - return visitEachChild(node, visitor, context); - case 178 /* GetAccessor */: - return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node); - case 179 /* SetAccessor */: - return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node); - case 177 /* Constructor */: - return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node); - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); - default: - return visitEachChild(node, visitor, context); - } - } - function asyncBodyVisitor(node) { - if (isNodeWithPossibleHoistedDeclaration(node)) { - switch (node.kind) { - case 244 /* VariableStatement */: - return visitVariableStatementInAsyncBody(node); - case 249 /* ForStatement */: - return visitForStatementInAsyncBody(node); - case 250 /* ForInStatement */: - return visitForInStatementInAsyncBody(node); - case 251 /* ForOfStatement */: - return visitForOfStatementInAsyncBody(node); - case 300 /* CatchClause */: - return visitCatchClauseInAsyncBody(node); - case 242 /* Block */: - case 256 /* SwitchStatement */: - case 270 /* CaseBlock */: - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - case 259 /* TryStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 246 /* IfStatement */: - case 255 /* WithStatement */: - case 257 /* LabeledStatement */: - return visitEachChild(node, asyncBodyVisitor, context); - default: - return Debug.assertNever(node, "Unhandled node."); - } - } - return visitor(node); - } - function visitCatchClauseInAsyncBody(node) { - const catchClauseNames = /* @__PURE__ */ new Set(); - recordDeclarationName(node.variableDeclaration, catchClauseNames); - let catchClauseUnshadowedNames; - catchClauseNames.forEach((_, escapedName) => { - if (enclosingFunctionParameterNames.has(escapedName)) { - if (!catchClauseUnshadowedNames) { - catchClauseUnshadowedNames = new Set(enclosingFunctionParameterNames); - } - catchClauseUnshadowedNames.delete(escapedName); - } - }); - if (catchClauseUnshadowedNames) { - const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; - enclosingFunctionParameterNames = catchClauseUnshadowedNames; - const result = visitEachChild(node, asyncBodyVisitor, context); - enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; - return result; - } else { - return visitEachChild(node, asyncBodyVisitor, context); - } - } - function visitVariableStatementInAsyncBody(node) { - if (isVariableDeclarationListWithCollidingName(node.declarationList)) { - const expression = visitVariableDeclarationListWithCollidingNames( - node.declarationList, - /*hasReceiver*/ - false - ); - return expression ? factory2.createExpressionStatement(expression) : void 0; - } - return visitEachChild(node, visitor, context); - } - function visitForInStatementInAsyncBody(node) { - return factory2.updateForInStatement( - node, - isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( - node.initializer, - /*hasReceiver*/ - true - ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - visitIterationBody(node.statement, asyncBodyVisitor, context) - ); - } - function visitForOfStatementInAsyncBody(node) { - return factory2.updateForOfStatement( - node, - visitNode(node.awaitModifier, visitor, isAwaitKeyword), - isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( - node.initializer, - /*hasReceiver*/ - true - ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - visitIterationBody(node.statement, asyncBodyVisitor, context) - ); - } - function visitForStatementInAsyncBody(node) { - const initializer = node.initializer; - return factory2.updateForStatement( - node, - isVariableDeclarationListWithCollidingName(initializer) ? visitVariableDeclarationListWithCollidingNames( - initializer, - /*hasReceiver*/ - false - ) : visitNode(node.initializer, visitor, isForInitializer), - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, visitor, isExpression), - visitIterationBody(node.statement, asyncBodyVisitor, context) - ); - } - function visitAwaitExpression(node) { - if (inTopLevelContext()) { - return visitEachChild(node, visitor, context); - } - return setOriginalNode( - setTextRange( - factory2.createYieldExpression( - /*asteriskToken*/ - void 0, - visitNode(node.expression, visitor, isExpression) - ), - node - ), - node - ); - } - function visitConstructorDeclaration(node) { - 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) { - let parameters; - const functionFlags = getFunctionFlags(node); - const savedLexicalArgumentsBinding = lexicalArgumentsBinding; - lexicalArgumentsBinding = void 0; - const updated = factory2.updateMethodDeclaration( - node, - visitNodes2(node.modifiers, visitor, isModifierLike), - node.asteriskToken, - node.name, - /*questionToken*/ - void 0, - /*typeParameters*/ - void 0, - parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : transformMethodBody(node) - ); - lexicalArgumentsBinding = savedLexicalArgumentsBinding; - return updated; - } - function visitGetAccessorDeclaration(node) { - const savedLexicalArgumentsBinding = lexicalArgumentsBinding; - lexicalArgumentsBinding = void 0; - const updated = factory2.updateGetAccessorDeclaration( - node, - visitNodes2(node.modifiers, visitor, isModifierLike), - node.name, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - transformMethodBody(node) - ); - lexicalArgumentsBinding = savedLexicalArgumentsBinding; - return updated; - } - function visitSetAccessorDeclaration(node) { - 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) { - 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, - parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context) - ); - lexicalArgumentsBinding = savedLexicalArgumentsBinding; - return updated; - } - function visitFunctionExpression(node) { - 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, - parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - 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, - parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - node.equalsGreaterThanToken, - functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context) - ); - } - function recordDeclarationName({ name }, names) { - if (isIdentifier(name)) { - names.add(name.escapedText); - } else { - for (const element of name.elements) { - if (!isOmittedExpression(element)) { - recordDeclarationName(element, names); - } - } - } - } - function isVariableDeclarationListWithCollidingName(node) { - return !!node && isVariableDeclarationList(node) && !(node.flags & 7 /* BlockScoped */) && node.declarations.some(collidesWithParameterName); - } - function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { - hoistVariableDeclarationList(node); - const variables = getInitializedVariables(node); - if (variables.length === 0) { - if (hasReceiver) { - return visitNode(factory2.converters.convertToAssignmentElementTarget(node.declarations[0].name), visitor, isExpression); - } - return void 0; - } - return factory2.inlineExpressions(map(variables, transformInitializedVariable)); - } - function hoistVariableDeclarationList(node) { - forEach(node.declarations, hoistVariable); - } - function hoistVariable({ name }) { - if (isIdentifier(name)) { - hoistVariableDeclaration(name); - } else { - for (const element of name.elements) { - if (!isOmittedExpression(element)) { - hoistVariable(element); - } - } - } - } - function transformInitializedVariable(node) { - const converted = setSourceMapRange( - factory2.createAssignment( - factory2.converters.convertToAssignmentElementTarget(node.name), - node.initializer - ), - node - ); - return Debug.checkDefined(visitNode(converted, visitor, isExpression)); - } - function collidesWithParameterName({ name }) { - if (isIdentifier(name)) { - return enclosingFunctionParameterNames.has(name.escapedText); - } else { - for (const element of name.elements) { - if (!isOmittedExpression(element) && collidesWithParameterName(element)) { - return true; - } - } - } - return false; - } - function transformMethodBody(node) { - Debug.assertIsDefined(node.body); - const savedCapturedSuperProperties = capturedSuperProperties; - const savedHasSuperElementAccess = hasSuperElementAccess; - capturedSuperProperties = /* @__PURE__ */ new Set(); - hasSuperElementAccess = false; - let updated = visitFunctionBody(node.body, visitor, context); - const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration); - const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */; - if (emitSuperHelpers) { - enableSubstitutionForAsyncMethodsWithSuper(); - if (capturedSuperProperties.size) { - const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties); - substitutedSuperAccessors[getNodeId(variableStatement)] = true; - const statements = updated.statements.slice(); - insertStatementsAfterStandardPrologue(statements, [variableStatement]); - updated = factory2.updateBlock(updated, statements); - } - if (hasSuperElementAccess) { - if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) { - addEmitHelper(updated, advancedAsyncSuperHelper); - } else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) { - addEmitHelper(updated, asyncSuperHelper); - } - } - } - capturedSuperProperties = savedCapturedSuperProperties; - hasSuperElementAccess = savedHasSuperElementAccess; - return updated; - } - 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 === 220 /* 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 === 220 /* ArrowFunction */; - const savedLexicalArgumentsBinding = lexicalArgumentsBinding; - const hasLexicalArguments = resolver.hasNodeCheckFlag(node, 512 /* CaptureArguments */); - 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) { - recordDeclarationName(parameter, enclosingFunctionParameterNames); - } - const savedCapturedSuperProperties = capturedSuperProperties; - const savedHasSuperElementAccess = hasSuperElementAccess; - if (!isArrowFunction2) { - 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 = []; - statements.push( - factory2.createReturnStatement( - emitHelpers().createAwaiterHelper( - hasLexicalThis, - argumentsExpression, - promiseConstructor, - innerParameters, - asyncBody - ) - ) - ); - const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)); - if (emitSuperHelpers) { - enableSubstitutionForAsyncMethodsWithSuper(); - if (capturedSuperProperties.size) { - const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties); - substitutedSuperAccessors[getNodeId(variableStatement)] = true; - insertStatementsAfterStandardPrologue(statements, [variableStatement]); - } - } - if (captureLexicalArguments) { - insertStatementsAfterStandardPrologue(statements, [createCaptureArgumentsStatement()]); - } - const block = factory2.createBlock( - statements, - /*multiLine*/ - true - ); - setTextRange(block, node.body); - if (emitSuperHelpers && hasSuperElementAccess) { - if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) { - addEmitHelper(block, advancedAsyncSuperHelper); - } else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) { - addEmitHelper(block, asyncSuperHelper); - } - } - result = block; - } else { - result = emitHelpers().createAwaiterHelper( - hasLexicalThis, - argumentsExpression, - promiseConstructor, - innerParameters, - asyncBody - ); - 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; - } - function transformAsyncFunctionBodyWorker(body, start) { - if (isBlock(body)) { - return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement, start)); - } else { - return factory2.converters.convertToFunctionBlock(Debug.checkDefined(visitNode(body, asyncBodyVisitor, isConciseBody))); - } - } - function getPromiseConstructor(type) { - const typeName = type && getEntityNameFromTypeNode(type); - if (typeName && isEntityName(typeName)) { - const serializationKind = resolver.getTypeReferenceSerializationKind(typeName); - if (serializationKind === 1 /* TypeWithConstructSignatureAndValue */ || serializationKind === 0 /* Unknown */) { - return typeName; - } - } - return void 0; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { - enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(214 /* CallExpression */); - context.enableSubstitution(212 /* PropertyAccessExpression */); - context.enableSubstitution(213 /* ElementAccessExpression */); - context.enableEmitNotification(264 /* ClassDeclaration */); - context.enableEmitNotification(175 /* MethodDeclaration */); - context.enableEmitNotification(178 /* GetAccessor */); - context.enableEmitNotification(179 /* SetAccessor */); - context.enableEmitNotification(177 /* Constructor */); - context.enableEmitNotification(244 /* VariableStatement */); - } - } - function onEmitNode(hint, node, emitCallback) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { - const superContainerFlags = (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */) ? 128 /* MethodWithSuperPropertyAccessInAsync */ : 0) | (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) ? 256 /* MethodWithSuperPropertyAssignmentInAsync */ : 0); - if (superContainerFlags !== enclosingSuperContainerFlags) { - const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; - enclosingSuperContainerFlags = superContainerFlags; - previousOnEmitNode(hint, node, emitCallback); - enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; - return; - } - } else if (enabledSubstitutions && substitutedSuperAccessors[getNodeId(node)]) { - const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; - enclosingSuperContainerFlags = 0; - previousOnEmitNode(hint, node, emitCallback); - enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; - return; - } - previousOnEmitNode(hint, node, emitCallback); - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { - return substituteExpression(node); - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 212 /* PropertyAccessExpression */: - return substitutePropertyAccessExpression(node); - case 213 /* ElementAccessExpression */: - return substituteElementAccessExpression(node); - case 214 /* CallExpression */: - return substituteCallExpression(node); - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (node.expression.kind === 108 /* SuperKeyword */) { - return setTextRange( - factory2.createPropertyAccessExpression( - factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), - node.name - ), - node - ); - } - return node; - } - function substituteElementAccessExpression(node) { - if (node.expression.kind === 108 /* SuperKeyword */) { - return createSuperElementAccessInAsyncMethod( - node.argumentExpression, - node - ); - } - return node; - } - function substituteCallExpression(node) { - const expression = node.expression; - if (isSuperProperty(expression)) { - const argumentExpression = isPropertyAccessExpression(expression) ? substitutePropertyAccessExpression(expression) : substituteElementAccessExpression(expression); - return factory2.createCallExpression( - factory2.createPropertyAccessExpression(argumentExpression, "call"), - /*typeArguments*/ - void 0, - [ - factory2.createThis(), - ...node.arguments - ] - ); - } - return node; - } - function isSuperContainer(node) { - const kind = node.kind; - return kind === 264 /* ClassDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; - } - function createSuperElementAccessInAsyncMethod(argumentExpression, location) { - if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { - return setTextRange( - factory2.createPropertyAccessExpression( - factory2.createCallExpression( - factory2.createUniqueName("_superIndex", 16 /* Optimistic */ | 32 /* FileLevel */), - /*typeArguments*/ - void 0, - [argumentExpression] - ), - "value" - ), - location - ); - } else { - return setTextRange( - factory2.createCallExpression( - factory2.createUniqueName("_superIndex", 16 /* Optimistic */ | 32 /* FileLevel */), - /*typeArguments*/ - void 0, - [argumentExpression] - ), - location - ); - } - } -} -function createSuperAccessVariableStatement(factory2, resolver, node, names) { - const hasBinding = resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */); - const accessors = []; - names.forEach((_, key) => { - const name = unescapeLeadingUnderscores(key); - const getterAndSetter = []; - getterAndSetter.push(factory2.createPropertyAssignment( - "get", - factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - /* parameters */ - [], - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - setEmitFlags( - factory2.createPropertyAccessExpression( - setEmitFlags( - factory2.createSuper(), - 8 /* NoSubstitution */ - ), - name - ), - 8 /* NoSubstitution */ - ) - ) - )); - if (hasBinding) { - getterAndSetter.push( - factory2.createPropertyAssignment( - "set", - factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - /* parameters */ - [ - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "v", - /*questionToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ) - ], - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - factory2.createAssignment( - setEmitFlags( - factory2.createPropertyAccessExpression( - setEmitFlags( - factory2.createSuper(), - 8 /* NoSubstitution */ - ), - name - ), - 8 /* NoSubstitution */ - ), - factory2.createIdentifier("v") - ) - ) - ) - ); - } - accessors.push( - factory2.createPropertyAssignment( - name, - factory2.createObjectLiteralExpression(getterAndSetter) - ) - ); - }); - return factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - [ - factory2.createVariableDeclaration( - factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createCallExpression( - factory2.createPropertyAccessExpression( - factory2.createIdentifier("Object"), - "create" - ), - /*typeArguments*/ - void 0, - [ - factory2.createNull(), - factory2.createObjectLiteralExpression( - accessors, - /*multiLine*/ - true - ) - ] - ) - ) - ], - 2 /* Const */ - ) - ); -} - -// src/compiler/transformers/es2018.ts -function transformES2018(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - resumeLexicalEnvironment, - endLexicalEnvironment, - hoistVariableDeclaration - } = context; - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const previousOnEmitNode = context.onEmitNode; - context.onEmitNode = onEmitNode; - const previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - let exportedVariableStatement = false; - let enabledSubstitutions = 0 /* None */; - let enclosingFunctionFlags; - let parametersWithPrecedingObjectRestOrSpread; - let enclosingSuperContainerFlags = 0; - let hierarchyFacts = 0; - let currentSourceFile; - let taggedTemplateStringDeclarations; - let capturedSuperProperties; - let hasSuperElementAccess; - const substitutedSuperAccessors = []; - return chainBundle(context, transformSourceFile); - function affectsSubtree(excludeFacts, includeFacts) { - return hierarchyFacts !== (hierarchyFacts & ~excludeFacts | includeFacts); - } - function enterSubtree(excludeFacts, includeFacts) { - const ancestorFacts = hierarchyFacts; - hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 3 /* AncestorFactsMask */; - return ancestorFacts; - } - function exitSubtree(ancestorFacts) { - hierarchyFacts = ancestorFacts; - } - function recordTaggedTemplateString(temp) { - taggedTemplateStringDeclarations = append( - taggedTemplateStringDeclarations, - factory2.createVariableDeclaration(temp) - ); - } - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - currentSourceFile = node; - const visited = visitSourceFile(node); - addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = void 0; - taggedTemplateStringDeclarations = void 0; - return visited; - } - function visitor(node) { - return visitorWorker( - node, - /*expressionResultIsUnused*/ - false - ); - } - function visitorWithUnusedExpressionResult(node) { - return visitorWorker( - node, - /*expressionResultIsUnused*/ - true - ); - } - function visitorNoAsyncModifier(node) { - if (node.kind === 134 /* AsyncKeyword */) { - return void 0; - } - return node; - } - function doWithHierarchyFacts(cb, value, excludeFacts, includeFacts) { - if (affectsSubtree(excludeFacts, includeFacts)) { - const ancestorFacts = enterSubtree(excludeFacts, includeFacts); - const result = cb(value); - exitSubtree(ancestorFacts); - return result; - } - return cb(value); - } - function visitDefault(node) { - return visitEachChild(node, visitor, context); - } - function visitorWorker(node, expressionResultIsUnused2) { - if ((node.transformFlags & 128 /* ContainsES2018 */) === 0) { - return node; - } - switch (node.kind) { - case 224 /* AwaitExpression */: - return visitAwaitExpression(node); - case 230 /* YieldExpression */: - return visitYieldExpression(node); - case 254 /* ReturnStatement */: - return visitReturnStatement(node); - case 257 /* LabeledStatement */: - return visitLabeledStatement(node); - case 211 /* ObjectLiteralExpression */: - return visitObjectLiteralExpression(node); - case 227 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused2); - case 357 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused2); - case 300 /* CatchClause */: - return visitCatchClause(node); - case 244 /* VariableStatement */: - return visitVariableStatement(node); - case 261 /* VariableDeclaration */: - return visitVariableDeclaration(node); - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 250 /* ForInStatement */: - return doWithHierarchyFacts( - visitDefault, - node, - 0 /* IterationStatementExcludes */, - 2 /* IterationStatementIncludes */ - ); - case 251 /* ForOfStatement */: - return visitForOfStatement( - node, - /*outermostLabeledStatement*/ - void 0 - ); - case 249 /* ForStatement */: - return doWithHierarchyFacts( - visitForStatement, - node, - 0 /* IterationStatementExcludes */, - 2 /* IterationStatementIncludes */ - ); - case 223 /* VoidExpression */: - return visitVoidExpression(node); - case 177 /* Constructor */: - return doWithHierarchyFacts( - visitConstructorDeclaration, - node, - 2 /* ClassOrFunctionExcludes */, - 1 /* ClassOrFunctionIncludes */ - ); - case 175 /* MethodDeclaration */: - return doWithHierarchyFacts( - visitMethodDeclaration, - node, - 2 /* ClassOrFunctionExcludes */, - 1 /* ClassOrFunctionIncludes */ - ); - case 178 /* GetAccessor */: - return doWithHierarchyFacts( - visitGetAccessorDeclaration, - node, - 2 /* ClassOrFunctionExcludes */, - 1 /* ClassOrFunctionIncludes */ - ); - case 179 /* SetAccessor */: - return doWithHierarchyFacts( - visitSetAccessorDeclaration, - node, - 2 /* ClassOrFunctionExcludes */, - 1 /* ClassOrFunctionIncludes */ - ); - case 263 /* FunctionDeclaration */: - return doWithHierarchyFacts( - visitFunctionDeclaration, - node, - 2 /* ClassOrFunctionExcludes */, - 1 /* ClassOrFunctionIncludes */ - ); - case 219 /* FunctionExpression */: - return doWithHierarchyFacts( - visitFunctionExpression, - node, - 2 /* ClassOrFunctionExcludes */, - 1 /* ClassOrFunctionIncludes */ - ); - case 220 /* ArrowFunction */: - return doWithHierarchyFacts( - visitArrowFunction, - node, - 2 /* ArrowFunctionExcludes */, - 0 /* ArrowFunctionIncludes */ - ); - case 170 /* Parameter */: - return visitParameter(node); - case 245 /* ExpressionStatement */: - return visitExpressionStatement(node); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 216 /* TaggedTemplateExpression */: - return visitTaggedTemplateExpression(node); - case 212 /* PropertyAccessExpression */: - if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { - capturedSuperProperties.add(node.name.escapedText); - } - return visitEachChild(node, visitor, context); - case 213 /* ElementAccessExpression */: - if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { - hasSuperElementAccess = true; - } - return visitEachChild(node, visitor, context); - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return doWithHierarchyFacts( - visitDefault, - node, - 2 /* ClassOrFunctionExcludes */, - 1 /* ClassOrFunctionIncludes */ - ); - default: - return visitEachChild(node, visitor, context); - } - } - function visitAwaitExpression(node) { - if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { - return setOriginalNode( - setTextRange( - factory2.createYieldExpression( - /*asteriskToken*/ - void 0, - emitHelpers().createAwaitHelper(visitNode(node.expression, visitor, isExpression)) - ), - /*location*/ - node - ), - node - ); - } - return visitEachChild(node, visitor, context); - } - function visitYieldExpression(node) { - if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { - if (node.asteriskToken) { - const expression = visitNode(Debug.checkDefined(node.expression), visitor, isExpression); - return setOriginalNode( - setTextRange( - factory2.createYieldExpression( - /*asteriskToken*/ - void 0, - emitHelpers().createAwaitHelper( - factory2.updateYieldExpression( - node, - node.asteriskToken, - setTextRange( - emitHelpers().createAsyncDelegatorHelper( - setTextRange( - emitHelpers().createAsyncValuesHelper(expression), - expression - ) - ), - expression - ) - ) - ) - ), - node - ), - node - ); - } - return setOriginalNode( - setTextRange( - factory2.createYieldExpression( - /*asteriskToken*/ - void 0, - createDownlevelAwait( - node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() - ) - ), - node - ), - node - ); - } - return visitEachChild(node, visitor, context); - } - 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 visitEachChild(node, visitor, context); - } - function visitLabeledStatement(node) { - if (enclosingFunctionFlags & 2 /* Async */) { - const statement = unwrapInnermostStatementOfLabel(node); - if (statement.kind === 251 /* ForOfStatement */ && statement.awaitModifier) { - return visitForOfStatement(statement, node); - } - return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node); - } - return visitEachChild(node, visitor, context); - } - function chunkObjectLiteralElements(elements) { - let chunkObject; - const objects = []; - for (const e of elements) { - if (e.kind === 306 /* SpreadAssignment */) { - if (chunkObject) { - objects.push(factory2.createObjectLiteralExpression(chunkObject)); - chunkObject = void 0; - } - const target = e.expression; - objects.push(visitNode(target, visitor, isExpression)); - } else { - chunkObject = append( - chunkObject, - e.kind === 304 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike) - ); - } - } - if (chunkObject) { - objects.push(factory2.createObjectLiteralExpression(chunkObject)); - } - return objects; - } - function visitObjectLiteralExpression(node) { - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - const objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 211 /* ObjectLiteralExpression */) { - objects.unshift(factory2.createObjectLiteralExpression()); - } - let expression = objects[0]; - if (objects.length > 1) { - for (let i = 1; i < objects.length; i++) { - expression = emitHelpers().createAssignHelper([expression, objects[i]]); - } - return expression; - } else { - return emitHelpers().createAssignHelper(objects); - } - } - return visitEachChild(node, visitor, context); - } - function visitExpressionStatement(node) { - return visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - function visitParenthesizedExpression(node, expressionResultIsUnused2) { - return visitEachChild(node, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, context); - } - function visitSourceFile(node) { - const ancestorFacts = enterSubtree( - 2 /* SourceFileExcludes */, - isEffectiveStrictModeSourceFile(node, compilerOptions) ? 0 /* StrictModeSourceFileIncludes */ : 1 /* SourceFileIncludes */ - ); - exportedVariableStatement = false; - const visited = visitEachChild(node, visitor, context); - 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; - } - function visitTaggedTemplateExpression(node) { - return processTaggedTemplateExpression( - context, - node, - visitor, - currentSourceFile, - recordTaggedTemplateString, - 0 /* LiftRestriction */ - ); - } - function visitBinaryExpression(node, expressionResultIsUnused2) { - if (isDestructuringAssignment(node) && containsObjectRestOrSpread(node.left)) { - return flattenDestructuringAssignment( - node, - visitor, - context, - 1 /* ObjectRest */, - !expressionResultIsUnused2 - ); - } - if (node.operatorToken.kind === 28 /* CommaToken */) { - return factory2.updateBinaryExpression( - node, - visitNode(node.left, visitorWithUnusedExpressionResult, isExpression), - node.operatorToken, - visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression) - ); - } - return visitEachChild(node, visitor, context); - } - function visitCommaListExpression(node, expressionResultIsUnused2) { - if (expressionResultIsUnused2) { - return visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - let result; - for (let i = 0; i < node.elements.length; i++) { - const element = node.elements[i]; - const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - const elements = result ? setTextRange(factory2.createNodeArray(result), node.elements) : node.elements; - return factory2.updateCommaListExpression(node, elements); - } - function visitCatchClause(node) { - if (node.variableDeclaration && isBindingPattern(node.variableDeclaration.name) && node.variableDeclaration.name.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - const name = factory2.getGeneratedNameForNode(node.variableDeclaration.name); - const updatedDecl = factory2.updateVariableDeclaration( - node.variableDeclaration, - node.variableDeclaration.name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - name - ); - const visitedBindings = flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */); - let block = visitNode(node.block, visitor, isBlock); - if (some(visitedBindings)) { - block = factory2.updateBlock(block, [ - factory2.createVariableStatement( - /*modifiers*/ - void 0, - visitedBindings - ), - ...block.statements - ]); - } - return factory2.updateCatchClause( - node, - factory2.updateVariableDeclaration( - node.variableDeclaration, - name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), - block - ); - } - return visitEachChild(node, visitor, context); - } - function visitVariableStatement(node) { - if (hasSyntacticModifier(node, 32 /* Export */)) { - const savedExportedVariableStatement = exportedVariableStatement; - exportedVariableStatement = true; - const visited = visitEachChild(node, visitor, context); - exportedVariableStatement = savedExportedVariableStatement; - return visited; - } - return visitEachChild(node, visitor, context); - } - function visitVariableDeclaration(node) { - if (exportedVariableStatement) { - const savedExportedVariableStatement = exportedVariableStatement; - exportedVariableStatement = false; - const visited = visitVariableDeclarationWorker( - node, - /*exportedVariableStatement*/ - true - ); - exportedVariableStatement = savedExportedVariableStatement; - return visited; - } - return visitVariableDeclarationWorker( - node, - /*exportedVariableStatement*/ - false - ); - } - function visitVariableDeclarationWorker(node, exportedVariableStatement2) { - if (isBindingPattern(node.name) && node.name.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return flattenDestructuringBinding( - node, - visitor, - context, - 1 /* ObjectRest */, - /*rval*/ - void 0, - exportedVariableStatement2 - ); - } - return visitEachChild(node, visitor, context); - } - function visitForStatement(node) { - return factory2.updateForStatement( - node, - visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), - visitIterationBody(node.statement, visitor, context) - ); - } - function visitVoidExpression(node) { - return visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - function visitForOfStatement(node, outermostLabeledStatement) { - const ancestorFacts = enterSubtree(0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - if (node.initializer.transformFlags & 65536 /* ContainsObjectRestOrSpread */ || isAssignmentPattern(node.initializer) && containsObjectRestOrSpread(node.initializer)) { - node = transformForOfStatementWithObjectRest(node); - } - const result = node.awaitModifier ? transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) : factory2.restoreEnclosingLabel(visitEachChild(node, visitor, context), outermostLabeledStatement); - exitSubtree(ancestorFacts); - return result; - } - function transformForOfStatementWithObjectRest(node) { - const initializerWithoutParens = skipParentheses(node.initializer); - if (isVariableDeclarationList(initializerWithoutParens) || isAssignmentPattern(initializerWithoutParens)) { - let bodyLocation; - let statementsLocation; - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const statements = [createForOfBindingStatement(factory2, initializerWithoutParens, temp)]; - if (isBlock(node.statement)) { - addRange(statements, node.statement.statements); - bodyLocation = node.statement; - statementsLocation = node.statement.statements; - } else if (node.statement) { - append(statements, node.statement); - bodyLocation = node.statement; - statementsLocation = node.statement; - } - return factory2.updateForOfStatement( - node, - node.awaitModifier, - setTextRange( - factory2.createVariableDeclarationList( - [ - setTextRange(factory2.createVariableDeclaration(temp), node.initializer) - ], - 1 /* Let */ - ), - node.initializer - ), - node.expression, - setTextRange( - factory2.createBlock( - setTextRange(factory2.createNodeArray(statements), statementsLocation), - /*multiLine*/ - true - ), - bodyLocation - ) - ); - } - return node; - } - function convertForOfStatementHead(node, boundValue, nonUserCode) { - const value = factory2.createTempVariable(hoistVariableDeclaration); - const iteratorValueExpression = factory2.createAssignment(value, boundValue); - const iteratorValueStatement = factory2.createExpressionStatement(iteratorValueExpression); - setSourceMapRange(iteratorValueStatement, node.expression); - const exitNonUserCodeExpression = factory2.createAssignment(nonUserCode, factory2.createFalse()); - const exitNonUserCodeStatement = factory2.createExpressionStatement(exitNonUserCodeExpression); - setSourceMapRange(exitNonUserCodeStatement, node.expression); - const statements = [iteratorValueStatement, exitNonUserCodeStatement]; - const binding = createForOfBindingStatement(factory2, node.initializer, value); - statements.push(visitNode(binding, visitor, isStatement)); - let bodyLocation; - let statementsLocation; - const statement = visitIterationBody(node.statement, visitor, context); - if (isBlock(statement)) { - addRange(statements, statement.statements); - bodyLocation = statement; - statementsLocation = statement.statements; - } else { - statements.push(statement); - } - return setTextRange( - factory2.createBlock( - setTextRange(factory2.createNodeArray(statements), statementsLocation), - /*multiLine*/ - true - ), - bodyLocation - ); - } - function createDownlevelAwait(expression) { - return enclosingFunctionFlags & 1 /* Generator */ ? factory2.createYieldExpression( - /*asteriskToken*/ - void 0, - emitHelpers().createAwaitHelper(expression) - ) : factory2.createAwaitExpression(expression); - } - function transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) { - const expression = visitNode(node.expression, visitor, isExpression); - const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const result = isIdentifier(expression) ? factory2.getGeneratedNameForNode(iterator) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const nonUserCode = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const done = factory2.createTempVariable(hoistVariableDeclaration); - const errorRecord = factory2.createUniqueName("e"); - const catchVariable = factory2.getGeneratedNameForNode(errorRecord); - const returnMethod = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const callValues = setTextRange(emitHelpers().createAsyncValuesHelper(expression), node.expression); - const callNext = factory2.createCallExpression( - factory2.createPropertyAccessExpression(iterator, "next"), - /*typeArguments*/ - void 0, - [] - ); - const getDone = factory2.createPropertyAccessExpression(result, "done"); - const getValue = factory2.createPropertyAccessExpression(result, "value"); - const callReturn = factory2.createFunctionCallCall(returnMethod, iterator, []); - hoistVariableDeclaration(errorRecord); - hoistVariableDeclaration(returnMethod); - const initializer = ancestorFacts & 2 /* IterationContainer */ ? factory2.inlineExpressions([factory2.createAssignment(errorRecord, factory2.createVoidZero()), callValues]) : callValues; - const forStatement = setEmitFlags( - setTextRange( - factory2.createForStatement( - /*initializer*/ - setEmitFlags( - setTextRange( - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - nonUserCode, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createTrue() - ), - setTextRange(factory2.createVariableDeclaration( - iterator, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ), node.expression), - factory2.createVariableDeclaration(result) - ]), - node.expression - ), - 4194304 /* NoHoisting */ - ), - /*condition*/ - factory2.inlineExpressions([ - factory2.createAssignment(result, createDownlevelAwait(callNext)), - factory2.createAssignment(done, getDone), - factory2.createLogicalNot(done) - ]), - /*incrementor*/ - factory2.createAssignment(nonUserCode, factory2.createTrue()), - /*statement*/ - convertForOfStatementHead(node, getValue, nonUserCode) - ), - /*location*/ - node - ), - 512 /* NoTokenTrailingSourceMaps */ - ); - setOriginalNode(forStatement, node); - return factory2.createTryStatement( - factory2.createBlock([ - factory2.restoreEnclosingLabel( - forStatement, - outermostLabeledStatement - ) - ]), - factory2.createCatchClause( - factory2.createVariableDeclaration(catchVariable), - setEmitFlags( - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createAssignment( - errorRecord, - factory2.createObjectLiteralExpression([ - factory2.createPropertyAssignment("error", catchVariable) - ]) - ) - ) - ]), - 1 /* SingleLine */ - ) - ), - factory2.createBlock([ - factory2.createTryStatement( - /*tryBlock*/ - factory2.createBlock([ - setEmitFlags( - factory2.createIfStatement( - factory2.createLogicalAnd( - factory2.createLogicalAnd( - factory2.createLogicalNot(nonUserCode), - factory2.createLogicalNot(done) - ), - factory2.createAssignment( - returnMethod, - factory2.createPropertyAccessExpression(iterator, "return") - ) - ), - factory2.createExpressionStatement(createDownlevelAwait(callReturn)) - ), - 1 /* SingleLine */ - ) - ]), - /*catchClause*/ - void 0, - /*finallyBlock*/ - setEmitFlags( - factory2.createBlock([ - setEmitFlags( - factory2.createIfStatement( - errorRecord, - factory2.createThrowStatement( - factory2.createPropertyAccessExpression(errorRecord, "error") - ) - ), - 1 /* SingleLine */ - ) - ]), - 1 /* SingleLine */ - ) - ) - ]) - ); - } - function parameterVisitor(node) { - Debug.assertNode(node, isParameter); - return visitParameter(node); - } - function visitParameter(node) { - if (parametersWithPrecedingObjectRestOrSpread == null ? void 0 : parametersWithPrecedingObjectRestOrSpread.has(node)) { - return factory2.updateParameterDeclaration( - node, - /*modifiers*/ - void 0, - node.dotDotDotToken, - isBindingPattern(node.name) ? factory2.getGeneratedNameForNode(node) : node.name, - /*questionToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ); - } - if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - return factory2.updateParameterDeclaration( - node, - /*modifiers*/ - void 0, - node.dotDotDotToken, - factory2.getGeneratedNameForNode(node), - /*questionToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, visitor, isExpression) - ); - } - return visitEachChild(node, visitor, context); - } - function collectParametersWithPrecedingObjectRestOrSpread(node) { - let parameters; - for (const parameter of node.parameters) { - if (parameters) { - parameters.add(parameter); - } else if (parameter.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - parameters = /* @__PURE__ */ new Set(); - } - } - return parameters; - } - function visitConstructorDeclaration(node) { - const savedEnclosingFunctionFlags = enclosingFunctionFlags; - const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; - enclosingFunctionFlags = getFunctionFlags(node); - parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); - const updated = factory2.updateConstructorDeclaration( - node, - node.modifiers, - visitParameterList(node.parameters, parameterVisitor, context), - transformFunctionBody2(node) - ); - enclosingFunctionFlags = savedEnclosingFunctionFlags; - parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; - return updated; - } - function visitGetAccessorDeclaration(node) { - const savedEnclosingFunctionFlags = enclosingFunctionFlags; - const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; - enclosingFunctionFlags = getFunctionFlags(node); - parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); - const updated = factory2.updateGetAccessorDeclaration( - node, - node.modifiers, - visitNode(node.name, visitor, isPropertyName), - visitParameterList(node.parameters, parameterVisitor, context), - /*type*/ - void 0, - transformFunctionBody2(node) - ); - enclosingFunctionFlags = savedEnclosingFunctionFlags; - parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; - return updated; - } - function visitSetAccessorDeclaration(node) { - const savedEnclosingFunctionFlags = enclosingFunctionFlags; - const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; - enclosingFunctionFlags = getFunctionFlags(node); - parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); - const updated = factory2.updateSetAccessorDeclaration( - node, - node.modifiers, - visitNode(node.name, visitor, isPropertyName), - visitParameterList(node.parameters, parameterVisitor, context), - transformFunctionBody2(node) - ); - enclosingFunctionFlags = savedEnclosingFunctionFlags; - parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; - return updated; - } - function visitMethodDeclaration(node) { - const savedEnclosingFunctionFlags = enclosingFunctionFlags; - const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; - enclosingFunctionFlags = getFunctionFlags(node); - parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); - const updated = factory2.updateMethodDeclaration( - node, - enclosingFunctionFlags & 1 /* Generator */ ? visitNodes2(node.modifiers, visitorNoAsyncModifier, isModifierLike) : node.modifiers, - enclosingFunctionFlags & 2 /* Async */ ? void 0 : node.asteriskToken, - visitNode(node.name, visitor, isPropertyName), - visitNode( - /*node*/ - void 0, - visitor, - isQuestionToken - ), - /*typeParameters*/ - void 0, - 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) - ); - enclosingFunctionFlags = savedEnclosingFunctionFlags; - parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; - return updated; - } - function visitFunctionDeclaration(node) { - const savedEnclosingFunctionFlags = enclosingFunctionFlags; - const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; - enclosingFunctionFlags = getFunctionFlags(node); - parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); - const updated = factory2.updateFunctionDeclaration( - node, - enclosingFunctionFlags & 1 /* Generator */ ? visitNodes2(node.modifiers, visitorNoAsyncModifier, isModifier) : node.modifiers, - enclosingFunctionFlags & 2 /* Async */ ? void 0 : node.asteriskToken, - node.name, - /*typeParameters*/ - void 0, - 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) - ); - enclosingFunctionFlags = savedEnclosingFunctionFlags; - parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; - return updated; - } - function visitArrowFunction(node) { - const savedEnclosingFunctionFlags = enclosingFunctionFlags; - const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; - enclosingFunctionFlags = getFunctionFlags(node); - parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); - const updated = factory2.updateArrowFunction( - node, - node.modifiers, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, parameterVisitor, context), - /*type*/ - void 0, - node.equalsGreaterThanToken, - transformFunctionBody2(node) - ); - enclosingFunctionFlags = savedEnclosingFunctionFlags; - parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; - return updated; - } - function visitFunctionExpression(node) { - const savedEnclosingFunctionFlags = enclosingFunctionFlags; - const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; - enclosingFunctionFlags = getFunctionFlags(node); - parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); - const updated = factory2.updateFunctionExpression( - node, - enclosingFunctionFlags & 1 /* Generator */ ? visitNodes2(node.modifiers, visitorNoAsyncModifier, isModifier) : node.modifiers, - enclosingFunctionFlags & 2 /* Async */ ? void 0 : node.asteriskToken, - node.name, - /*typeParameters*/ - void 0, - 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) - ); - enclosingFunctionFlags = savedEnclosingFunctionFlags; - 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 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( - /*modifiers*/ - void 0, - factory2.createToken(42 /* AsteriskToken */), - node.name && factory2.getGeneratedNameForNode(node.name), - /*typeParameters*/ - void 0, - innerParameters ?? [], - /*type*/ - void 0, - asyncBody - ), - !!(hierarchyFacts & 1 /* HasLexicalThis */) - ) - ); - const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)); - if (emitSuperHelpers) { - enableSubstitutionForAsyncMethodsWithSuper(); - const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties); - substitutedSuperAccessors[getNodeId(variableStatement)] = true; - insertStatementsAfterStandardPrologue(outerStatements, [variableStatement]); - } - outerStatements.push(returnStatement); - const block = factory2.updateBlock(node.body, outerStatements); - if (emitSuperHelpers && hasSuperElementAccess) { - if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) { - addEmitHelper(block, advancedAsyncSuperHelper); - } else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) { - addEmitHelper(block, asyncSuperHelper); - } - } - capturedSuperProperties = savedCapturedSuperProperties; - hasSuperElementAccess = savedHasSuperElementAccess; - return block; - } - function transformFunctionBody2(node) { - resumeLexicalEnvironment(); - let statementOffset = 0; - const statements = []; - const body = visitNode(node.body, visitor, isConciseBody) ?? factory2.createBlock([]); - if (isBlock(body)) { - statementOffset = factory2.copyPrologue( - body.statements, - statements, - /*ensureUseStrict*/ - false, - visitor - ); - } - addRange(statements, appendObjectRestAssignmentsIfNeeded( - /*statements*/ - void 0, - node - )); - const leadingStatements = endLexicalEnvironment(); - if (statementOffset > 0 || some(statements) || some(leadingStatements)) { - const block = factory2.converters.convertToFunctionBlock( - body, - /*multiLine*/ - true - ); - insertStatementsAfterStandardPrologue(statements, leadingStatements); - addRange(statements, block.statements.slice(statementOffset)); - return factory2.updateBlock(block, setTextRange(factory2.createNodeArray(statements), block.statements)); - } - return body; - } - function appendObjectRestAssignmentsIfNeeded(statements, node) { - let containsPrecedingObjectRestOrSpread = false; - for (const parameter of node.parameters) { - if (containsPrecedingObjectRestOrSpread) { - if (isBindingPattern(parameter.name)) { - if (parameter.name.elements.length > 0) { - const declarations = flattenDestructuringBinding( - parameter, - visitor, - context, - 0 /* All */, - factory2.getGeneratedNameForNode(parameter) - ); - if (some(declarations)) { - const declarationList = factory2.createVariableDeclarationList(declarations); - const statement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - declarationList - ); - setEmitFlags(statement, 2097152 /* CustomPrologue */); - statements = append(statements, statement); - } - } else if (parameter.initializer) { - const name = factory2.getGeneratedNameForNode(parameter); - const initializer = visitNode(parameter.initializer, visitor, isExpression); - const assignment = factory2.createAssignment(name, initializer); - const statement = factory2.createExpressionStatement(assignment); - setEmitFlags(statement, 2097152 /* CustomPrologue */); - statements = append(statements, statement); - } - } else if (parameter.initializer) { - const name = factory2.cloneNode(parameter.name); - setTextRange(name, parameter.name); - setEmitFlags(name, 96 /* NoSourceMap */); - const initializer = visitNode(parameter.initializer, visitor, isExpression); - addEmitFlags(initializer, 96 /* NoSourceMap */ | 3072 /* NoComments */); - const assignment = factory2.createAssignment(name, initializer); - setTextRange(assignment, parameter); - setEmitFlags(assignment, 3072 /* NoComments */); - const block = factory2.createBlock([factory2.createExpressionStatement(assignment)]); - setTextRange(block, parameter); - setEmitFlags(block, 1 /* SingleLine */ | 64 /* NoTrailingSourceMap */ | 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */); - const typeCheck = factory2.createTypeCheck(factory2.cloneNode(parameter.name), "undefined"); - const statement = factory2.createIfStatement(typeCheck, block); - startOnNewLine(statement); - setTextRange(statement, parameter); - setEmitFlags(statement, 768 /* NoTokenSourceMaps */ | 64 /* NoTrailingSourceMap */ | 2097152 /* CustomPrologue */ | 3072 /* NoComments */); - statements = append(statements, statement); - } - } else if (parameter.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { - containsPrecedingObjectRestOrSpread = true; - const declarations = flattenDestructuringBinding( - parameter, - visitor, - context, - 1 /* ObjectRest */, - factory2.getGeneratedNameForNode(parameter), - /*hoistTempVariables*/ - false, - /*skipInitializer*/ - true - ); - if (some(declarations)) { - const declarationList = factory2.createVariableDeclarationList(declarations); - const statement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - declarationList - ); - setEmitFlags(statement, 2097152 /* CustomPrologue */); - statements = append(statements, statement); - } - } - } - return statements; - } - function enableSubstitutionForAsyncMethodsWithSuper() { - if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { - enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(214 /* CallExpression */); - context.enableSubstitution(212 /* PropertyAccessExpression */); - context.enableSubstitution(213 /* ElementAccessExpression */); - context.enableEmitNotification(264 /* ClassDeclaration */); - context.enableEmitNotification(175 /* MethodDeclaration */); - context.enableEmitNotification(178 /* GetAccessor */); - context.enableEmitNotification(179 /* SetAccessor */); - context.enableEmitNotification(177 /* Constructor */); - context.enableEmitNotification(244 /* VariableStatement */); - } - } - function onEmitNode(hint, node, emitCallback) { - if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) { - const superContainerFlags = (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */) ? 128 /* MethodWithSuperPropertyAccessInAsync */ : 0) | (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) ? 256 /* MethodWithSuperPropertyAssignmentInAsync */ : 0); - if (superContainerFlags !== enclosingSuperContainerFlags) { - const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; - enclosingSuperContainerFlags = superContainerFlags; - previousOnEmitNode(hint, node, emitCallback); - enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; - return; - } - } else if (enabledSubstitutions && substitutedSuperAccessors[getNodeId(node)]) { - const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; - enclosingSuperContainerFlags = 0; - previousOnEmitNode(hint, node, emitCallback); - enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; - return; - } - previousOnEmitNode(hint, node, emitCallback); - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) { - return substituteExpression(node); - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 212 /* PropertyAccessExpression */: - return substitutePropertyAccessExpression(node); - case 213 /* ElementAccessExpression */: - return substituteElementAccessExpression(node); - case 214 /* CallExpression */: - return substituteCallExpression(node); - } - return node; - } - function substitutePropertyAccessExpression(node) { - if (node.expression.kind === 108 /* SuperKeyword */) { - return setTextRange( - factory2.createPropertyAccessExpression( - factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), - node.name - ), - node - ); - } - return node; - } - function substituteElementAccessExpression(node) { - if (node.expression.kind === 108 /* SuperKeyword */) { - return createSuperElementAccessInAsyncMethod( - node.argumentExpression, - node - ); - } - return node; - } - function substituteCallExpression(node) { - const expression = node.expression; - if (isSuperProperty(expression)) { - const argumentExpression = isPropertyAccessExpression(expression) ? substitutePropertyAccessExpression(expression) : substituteElementAccessExpression(expression); - return factory2.createCallExpression( - factory2.createPropertyAccessExpression(argumentExpression, "call"), - /*typeArguments*/ - void 0, - [ - factory2.createThis(), - ...node.arguments - ] - ); - } - return node; - } - function isSuperContainer(node) { - const kind = node.kind; - return kind === 264 /* ClassDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; - } - function createSuperElementAccessInAsyncMethod(argumentExpression, location) { - if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { - return setTextRange( - factory2.createPropertyAccessExpression( - factory2.createCallExpression( - factory2.createIdentifier("_superIndex"), - /*typeArguments*/ - void 0, - [argumentExpression] - ), - "value" - ), - location - ); - } else { - return setTextRange( - factory2.createCallExpression( - factory2.createIdentifier("_superIndex"), - /*typeArguments*/ - void 0, - [argumentExpression] - ), - location - ); - } - } -} - -// src/compiler/transformers/es2019.ts -function transformES2019(context) { - const factory2 = context.factory; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - return visitEachChild(node, visitor, context); - } - function visitor(node) { - if ((node.transformFlags & 64 /* ContainsES2019 */) === 0) { - return node; - } - switch (node.kind) { - case 300 /* CatchClause */: - return visitCatchClause(node); - default: - return visitEachChild(node, visitor, context); - } - } - function visitCatchClause(node) { - if (!node.variableDeclaration) { - return factory2.updateCatchClause( - node, - factory2.createVariableDeclaration(factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - )), - visitNode(node.block, visitor, isBlock) - ); - } - return visitEachChild(node, visitor, context); - } -} - -// src/compiler/transformers/es2020.ts -function transformES2020(context) { - const { - factory: factory2, - hoistVariableDeclaration - } = context; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - return visitEachChild(node, visitor, context); - } - function visitor(node) { - if ((node.transformFlags & 32 /* ContainsES2020 */) === 0) { - return node; - } - switch (node.kind) { - case 214 /* CallExpression */: { - const updated = visitNonOptionalCallExpression( - node, - /*captureThisArg*/ - false - ); - Debug.assertNotNode(updated, isSyntheticReference); - return updated; - } - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - if (isOptionalChain(node)) { - const updated = visitOptionalExpression( - node, - /*captureThisArg*/ - false, - /*isDelete*/ - false - ); - Debug.assertNotNode(updated, isSyntheticReference); - return updated; - } - return visitEachChild(node, visitor, context); - case 227 /* BinaryExpression */: - if (node.operatorToken.kind === 61 /* QuestionQuestionToken */) { - return transformNullishCoalescingExpression(node); - } - return visitEachChild(node, visitor, context); - case 221 /* DeleteExpression */: - return visitDeleteExpression(node); - default: - return visitEachChild(node, visitor, context); - } - } - function flattenChain(chain) { - Debug.assertNotNode(chain, isNonNullChain); - const links = [chain]; - while (!chain.questionDotToken && !isTaggedTemplateExpression(chain)) { - chain = cast(skipPartiallyEmittedExpressions(chain.expression), isOptionalChain); - Debug.assertNotNode(chain, isNonNullChain); - links.unshift(chain); - } - return { expression: chain.expression, chain: links }; - } - function visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete) { - const expression = visitNonOptionalExpression(node.expression, captureThisArg, isDelete); - if (isSyntheticReference(expression)) { - return factory2.createSyntheticReferenceExpression(factory2.updateParenthesizedExpression(node, expression.expression), expression.thisArg); - } - return factory2.updateParenthesizedExpression(node, expression); - } - function visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete) { - if (isOptionalChain(node)) { - return visitOptionalExpression(node, captureThisArg, isDelete); - } - let expression = visitNode(node.expression, visitor, isExpression); - Debug.assertNotNode(expression, isSyntheticReference); - let thisArg; - if (captureThisArg) { - if (!isSimpleCopiableExpression(expression)) { - thisArg = factory2.createTempVariable(hoistVariableDeclaration); - expression = factory2.createAssignment(thisArg, expression); - } else { - thisArg = expression; - } - } - expression = node.kind === 212 /* 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) { - if (isOptionalChain(node)) { - return visitOptionalExpression( - node, - captureThisArg, - /*isDelete*/ - false - ); - } - if (isParenthesizedExpression(node.expression) && isOptionalChain(skipParentheses(node.expression))) { - const expression = visitNonOptionalParenthesizedExpression( - node.expression, - /*captureThisArg*/ - true, - /*isDelete*/ - false - ); - const args = visitNodes2(node.arguments, visitor, isExpression); - if (isSyntheticReference(expression)) { - return setTextRange(factory2.createFunctionCallCall(expression.expression, expression.thisArg, args), node); - } - return factory2.updateCallExpression( - node, - expression, - /*typeArguments*/ - void 0, - args - ); - } - return visitEachChild(node, visitor, context); - } - function visitNonOptionalExpression(node, captureThisArg, isDelete) { - switch (node.kind) { - case 218 /* ParenthesizedExpression */: - return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 214 /* CallExpression */: - return visitNonOptionalCallExpression(node, captureThisArg); - default: - return visitNode(node, visitor, isExpression); - } - } - function visitOptionalExpression(node, captureThisArg, isDelete) { - const { expression, chain } = flattenChain(node); - const left = visitNonOptionalExpression( - skipPartiallyEmittedExpressions(expression), - isCallChain(chain[0]), - /*isDelete*/ - false - ); - let leftThisArg = isSyntheticReference(left) ? left.thisArg : void 0; - let capturedLeft = isSyntheticReference(left) ? left.expression : left; - let leftExpression = factory2.restoreOuterExpressions(expression, capturedLeft, 8 /* PartiallyEmittedExpressions */); - if (!isSimpleCopiableExpression(capturedLeft)) { - capturedLeft = factory2.createTempVariable(hoistVariableDeclaration); - leftExpression = factory2.createAssignment(capturedLeft, leftExpression); - } - let rightExpression = capturedLeft; - let thisArg; - for (let i = 0; i < chain.length; i++) { - const segment = chain[i]; - switch (segment.kind) { - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - if (i === chain.length - 1 && captureThisArg) { - if (!isSimpleCopiableExpression(rightExpression)) { - thisArg = factory2.createTempVariable(hoistVariableDeclaration); - rightExpression = factory2.createAssignment(thisArg, rightExpression); - } else { - thisArg = rightExpression; - } - } - rightExpression = segment.kind === 212 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); - break; - case 214 /* CallExpression */: - if (i === 0 && leftThisArg) { - if (!isGeneratedIdentifier(leftThisArg)) { - leftThisArg = factory2.cloneNode(leftThisArg); - addEmitFlags(leftThisArg, 3072 /* NoComments */); - } - rightExpression = factory2.createFunctionCallCall( - rightExpression, - leftThisArg.kind === 108 /* SuperKeyword */ ? factory2.createThis() : leftThisArg, - visitNodes2(segment.arguments, visitor, isExpression) - ); - } else { - rightExpression = factory2.createCallExpression( - rightExpression, - /*typeArguments*/ - void 0, - visitNodes2(segment.arguments, visitor, isExpression) - ); - } - break; - } - setOriginalNode(rightExpression, segment); - } - const target = isDelete ? factory2.createConditionalExpression( - createNotNullCondition( - leftExpression, - capturedLeft, - /*invert*/ - true - ), - /*questionToken*/ - void 0, - factory2.createTrue(), - /*colonToken*/ - void 0, - factory2.createDeleteExpression(rightExpression) - ) : factory2.createConditionalExpression( - createNotNullCondition( - leftExpression, - capturedLeft, - /*invert*/ - true - ), - /*questionToken*/ - void 0, - factory2.createVoidZero(), - /*colonToken*/ - void 0, - rightExpression - ); - setTextRange(target, node); - return thisArg ? factory2.createSyntheticReferenceExpression(target, thisArg) : target; - } - function createNotNullCondition(left, right, invert) { - return factory2.createBinaryExpression( - factory2.createBinaryExpression( - left, - factory2.createToken(invert ? 37 /* EqualsEqualsEqualsToken */ : 38 /* ExclamationEqualsEqualsToken */), - factory2.createNull() - ), - factory2.createToken(invert ? 57 /* BarBarToken */ : 56 /* AmpersandAmpersandToken */), - factory2.createBinaryExpression( - right, - factory2.createToken(invert ? 37 /* EqualsEqualsEqualsToken */ : 38 /* ExclamationEqualsEqualsToken */), - factory2.createVoidZero() - ) - ); - } - function transformNullishCoalescingExpression(node) { - let left = visitNode(node.left, visitor, isExpression); - let right = left; - if (!isSimpleCopiableExpression(left)) { - 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 - ); - } - function visitDeleteExpression(node) { - return isOptionalChain(skipParentheses(node.expression)) ? setOriginalNode(visitNonOptionalExpression( - node.expression, - /*captureThisArg*/ - false, - /*isDelete*/ - true - ), node) : factory2.updateDeleteExpression(node, visitNode(node.expression, visitor, isExpression)); - } -} - -// src/compiler/transformers/es2021.ts -function transformES2021(context) { - const { - hoistVariableDeclaration, - factory: factory2 - } = context; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - return visitEachChild(node, visitor, context); - } - function visitor(node) { - if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) { - return node; - } - if (isLogicalOrCoalescingAssignmentExpression(node)) { - return transformLogicalAssignment(node); - } - return visitEachChild(node, visitor, context); - } - function transformLogicalAssignment(binaryExpression) { - const operator = binaryExpression.operatorToken; - const nonAssignmentOperator = getNonAssignmentOperatorForCompoundAssignment(operator.kind); - let left = skipParentheses(visitNode(binaryExpression.left, visitor, isLeftHandSideExpression)); - let assignmentTarget = left; - const right = skipParentheses(visitNode(binaryExpression.right, visitor, isExpression)); - if (isAccessExpression(left)) { - const propertyAccessTargetSimpleCopiable = isSimpleCopiableExpression(left.expression); - const propertyAccessTarget = propertyAccessTargetSimpleCopiable ? left.expression : factory2.createTempVariable(hoistVariableDeclaration); - const propertyAccessTargetAssignment = propertyAccessTargetSimpleCopiable ? left.expression : factory2.createAssignment( - propertyAccessTarget, - left.expression - ); - if (isPropertyAccessExpression(left)) { - assignmentTarget = factory2.createPropertyAccessExpression( - propertyAccessTarget, - left.name - ); - left = factory2.createPropertyAccessExpression( - propertyAccessTargetAssignment, - left.name - ); - } else { - const elementAccessArgumentSimpleCopiable = isSimpleCopiableExpression(left.argumentExpression); - const elementAccessArgument = elementAccessArgumentSimpleCopiable ? left.argumentExpression : factory2.createTempVariable(hoistVariableDeclaration); - assignmentTarget = factory2.createElementAccessExpression( - propertyAccessTarget, - elementAccessArgument - ); - left = factory2.createElementAccessExpression( - propertyAccessTargetAssignment, - elementAccessArgumentSimpleCopiable ? left.argumentExpression : factory2.createAssignment( - elementAccessArgument, - left.argumentExpression - ) - ); - } - } - return factory2.createBinaryExpression( - left, - nonAssignmentOperator, - factory2.createParenthesizedExpression( - factory2.createAssignment( - assignmentTarget, - right - ) - ) - ); - } -} - -// 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; - } - 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 308 /* SourceFile */: - return visitSourceFile(node); - case 242 /* Block */: - return visitBlock(node); - case 249 /* ForStatement */: - return visitForStatement(node); - case 251 /* ForOfStatement */: - return visitForOfStatement(node); - case 256 /* 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; - const forDecl = firstOrUndefined(forInitializer.declarations) || factory2.createVariableDeclaration(factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - )); - 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 273 /* ImportDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 279 /* ExportDeclaration */: - case 263 /* FunctionDeclaration */: - return hoistImportOrExportOrHoistedDeclaration(node, topLevelStatements); - case 278 /* ExportAssignment */: - return hoistExportAssignment(node); - case 264 /* ClassDeclaration */: - return hoistClassDeclaration(node); - case 244 /* 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; -} - -// src/compiler/transformers/jsx.ts -function transformJsx(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers - } = context; - const compilerOptions = context.getCompilerOptions(); - let currentSourceFile; - let currentFileState; - return chainBundle(context, transformSourceFile); - function getCurrentFileNameExpression() { - if (currentFileState.filenameDeclaration) { - return currentFileState.filenameDeclaration.name; - } - const declaration = factory2.createVariableDeclaration( - factory2.createUniqueName("_jsxFileName", 16 /* Optimistic */ | 32 /* FileLevel */), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createStringLiteral(currentSourceFile.fileName) - ); - currentFileState.filenameDeclaration = declaration; - return currentFileState.filenameDeclaration.name; - } - function getJsxFactoryCalleePrimitive(isStaticChildren) { - return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx"; - } - function getJsxFactoryCallee(isStaticChildren) { - const type = getJsxFactoryCalleePrimitive(isStaticChildren); - return getImplicitImportForName(type); - } - function getImplicitJsxFragmentReference() { - return getImplicitImportForName("Fragment"); - } - function getImplicitImportForName(name) { - var _a, _b; - const importSource = name === "createElement" ? currentFileState.importSpecifier : getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); - const existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) == null ? void 0 : _a.get(importSource)) == null ? void 0 : _b.get(name); - if (existing) { - return existing.name; - } - if (!currentFileState.utilizedImplicitRuntimeImports) { - currentFileState.utilizedImplicitRuntimeImports = /* @__PURE__ */ new Map(); - } - let specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); - if (!specifierSourceImports) { - specifierSourceImports = /* @__PURE__ */ new Map(); - currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); - } - const generatedName = factory2.createUniqueName(`_${name}`, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */); - const specifier = factory2.createImportSpecifier( - /*isTypeOnly*/ - false, - factory2.createIdentifier(name), - generatedName - ); - setIdentifierGeneratedImportReference(generatedName, specifier); - specifierSourceImports.set(name, specifier); - return generatedName; - } - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - currentSourceFile = node; - currentFileState = {}; - currentFileState.importSpecifier = getJSXImplicitImportBase(compilerOptions, node); - let visited = visitEachChild(node, visitor, context); - addEmitHelpers(visited, context.readEmitHelpers()); - let statements = visited.statements; - if (currentFileState.filenameDeclaration) { - statements = insertStatementAfterCustomPrologue(statements.slice(), factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([currentFileState.filenameDeclaration], 2 /* Const */) - )); - } - if (currentFileState.utilizedImplicitRuntimeImports) { - for (const [importSource, importSpecifiersMap] of arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries())) { - if (isExternalModule(node)) { - const importStatement = factory2.createImportDeclaration( - /*modifiers*/ - void 0, - factory2.createImportClause( - /*phaseModifier*/ - void 0, - /*name*/ - void 0, - factory2.createNamedImports(arrayFrom(importSpecifiersMap.values())) - ), - factory2.createStringLiteral(importSource), - /*attributes*/ - void 0 - ); - setParentRecursive( - importStatement, - /*incremental*/ - false - ); - statements = insertStatementAfterCustomPrologue(statements.slice(), importStatement); - } else if (isExternalOrCommonJsModule(node)) { - const requireStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - factory2.createObjectBindingPattern(arrayFrom(importSpecifiersMap.values(), (s) => factory2.createBindingElement( - /*dotDotDotToken*/ - void 0, - s.propertyName, - s.name - ))), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createCallExpression( - factory2.createIdentifier("require"), - /*typeArguments*/ - void 0, - [factory2.createStringLiteral(importSource)] - ) - ) - ], 2 /* Const */) - ); - setParentRecursive( - requireStatement, - /*incremental*/ - false - ); - statements = insertStatementAfterCustomPrologue(statements.slice(), requireStatement); - } else { - } - } - } - if (statements !== visited.statements) { - visited = factory2.updateSourceFile(visited, statements); - } - currentFileState = void 0; - return visited; - } - function visitor(node) { - if (node.transformFlags & 2 /* ContainsJsx */) { - return visitorWorker(node); - } else { - return node; - } - } - function visitorWorker(node) { - switch (node.kind) { - case 285 /* JsxElement */: - return visitJsxElement( - node, - /*isChild*/ - false - ); - case 286 /* JsxSelfClosingElement */: - return visitJsxSelfClosingElement( - node, - /*isChild*/ - false - ); - case 289 /* JsxFragment */: - return visitJsxFragment( - node, - /*isChild*/ - false - ); - case 295 /* JsxExpression */: - return visitJsxExpression(node); - default: - return visitEachChild(node, visitor, context); - } - } - function transformJsxChildToExpression(node) { - switch (node.kind) { - case 12 /* JsxText */: - return visitJsxText(node); - case 295 /* JsxExpression */: - return visitJsxExpression(node); - case 285 /* JsxElement */: - return visitJsxElement( - node, - /*isChild*/ - true - ); - case 286 /* JsxSelfClosingElement */: - return visitJsxSelfClosingElement( - node, - /*isChild*/ - true - ); - case 289 /* JsxFragment */: - return visitJsxFragment( - node, - /*isChild*/ - true - ); - default: - return Debug.failBadSyntaxKind(node); - } - } - function hasProto(obj) { - 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; - for (const elem of node.attributes.properties) { - if (isJsxSpreadAttribute(elem) && (!isObjectLiteralExpression(elem.expression) || elem.expression.properties.some(isSpreadAssignment))) { - spread = true; - } else if (spread && isJsxAttribute(elem) && isIdentifier(elem.name) && elem.name.escapedText === "key") { - return true; - } - } - return false; - } - function shouldUseCreateElement(node) { - return currentFileState.importSpecifier === void 0 || hasKeyAfterPropsSpread(node); - } - function visitJsxElement(node, isChild) { - const tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform( - node.openingElement, - node.children, - isChild, - /*location*/ - node - ); - } - function visitJsxSelfClosingElement(node, isChild) { - const tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform( - node, - /*children*/ - void 0, - isChild, - /*location*/ - node - ); - } - function visitJsxFragment(node, isChild) { - const tagTransform = currentFileState.importSpecifier === void 0 ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; - return tagTransform( - node.openingFragment, - node.children, - isChild, - /*location*/ - node - ); - } - function convertJsxChildrenToChildrenPropObject(children) { - const prop = convertJsxChildrenToChildrenPropAssignment(children); - return prop && factory2.createObjectLiteralExpression([prop]); - } - function convertJsxChildrenToChildrenPropAssignment(children) { - const nonWhitespaceChildren = getSemanticJsxChildren(children); - if (length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) { - const result2 = transformJsxChildToExpression(nonWhitespaceChildren[0]); - return result2 && factory2.createPropertyAssignment("children", result2); - } - const result = mapDefined(children, transformJsxChildToExpression); - return length(result) ? factory2.createPropertyAssignment("children", factory2.createArrayLiteralExpression(result)) : void 0; - } - function visitJsxOpeningLikeElementJSX(node, children, isChild, location) { - const tagName = getTagName(node); - const childrenProp = children && children.length ? convertJsxChildrenToChildrenPropAssignment(children) : void 0; - const keyAttr = find(node.attributes.properties, (p) => !!p.name && isIdentifier(p.name) && p.name.escapedText === "key"); - const attrs = keyAttr ? filter(node.attributes.properties, (p) => p !== keyAttr) : node.attributes.properties; - const objectProperties = length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) : factory2.createObjectLiteralExpression(childrenProp ? [childrenProp] : emptyArray); - return visitJsxOpeningLikeElementOrFragmentJSX( - tagName, - objectProperties, - keyAttr, - children || emptyArray, - isChild, - location - ); - } - function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location) { - var _a; - const nonWhitespaceChildren = getSemanticJsxChildren(children); - const isStaticChildren = length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) == null ? void 0 : _a.dotDotDotToken); - const args = [tagName, objectProperties]; - if (keyAttr) { - args.push(transformJsxAttributeInitializer(keyAttr.initializer)); - } - if (compilerOptions.jsx === 5 /* ReactJSXDev */) { - const originalFile = getOriginalNode(currentSourceFile); - if (originalFile && isSourceFile(originalFile)) { - if (keyAttr === void 0) { - args.push(factory2.createVoidZero()); - } - args.push(isStaticChildren ? factory2.createTrue() : factory2.createFalse()); - const lineCol = getLineAndCharacterOfPosition(originalFile, location.pos); - args.push(factory2.createObjectLiteralExpression([ - factory2.createPropertyAssignment("fileName", getCurrentFileNameExpression()), - factory2.createPropertyAssignment("lineNumber", factory2.createNumericLiteral(lineCol.line + 1)), - factory2.createPropertyAssignment("columnNumber", factory2.createNumericLiteral(lineCol.character + 1)) - ])); - args.push(factory2.createThis()); - } - } - const element = setTextRange( - factory2.createCallExpression( - getJsxFactoryCallee(isStaticChildren), - /*typeArguments*/ - void 0, - args - ), - location - ); - if (isChild) { - startOnNewLine(element); - } - return element; - } - function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) { - const tagName = getTagName(node); - const attrs = node.attributes.properties; - const objectProperties = length(attrs) ? transformJsxAttributesToObjectProps(attrs) : factory2.createNull(); - const callee = currentFileState.importSpecifier === void 0 ? createJsxFactoryExpression( - factory2, - context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), - compilerOptions.reactNamespace, - // TODO: GH#18217 - node - ) : getImplicitImportForName("createElement"); - const element = createExpressionForJsxElement( - factory2, - callee, - tagName, - objectProperties, - mapDefined(children, transformJsxChildToExpression), - location - ); - if (isChild) { - startOnNewLine(element); - } - return element; - } - function visitJsxOpeningFragmentJSX(_node, children, isChild, location) { - let childrenProps; - if (children && children.length) { - const result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - childrenProps = result; - } - } - return visitJsxOpeningLikeElementOrFragmentJSX( - getImplicitJsxFragmentReference(), - childrenProps || factory2.createObjectLiteralExpression([]), - /*keyAttr*/ - void 0, - children, - isChild, - location - ); - } - function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) { - const element = createExpressionForJsxFragment( - factory2, - context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), - context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), - compilerOptions.reactNamespace, - // TODO: GH#18217 - mapDefined(children, transformJsxChildToExpression), - node, - location - ); - if (isChild) { - startOnNewLine(element); - } - return element; - } - function transformJsxSpreadAttributeToProps(node) { - if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) { - return sameMap(node.expression.properties, (p) => Debug.checkDefined(visitNode(p, visitor, isObjectLiteralElementLike))); - } - return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); - } - function transformJsxAttributesToObjectProps(attrs, children) { - const target = getEmitScriptTarget(compilerOptions); - return target && target >= 5 /* ES2018 */ ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children); - } - function transformJsxAttributesToProps(attrs, children) { - const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr))))); - if (children) { - props.push(children); - } - return props; - } - function transformJsxAttributesToExpression(attrs, children) { - const expressions = []; - let properties = []; - for (const attr of attrs) { - if (isJsxSpreadAttribute(attr)) { - if (isObjectLiteralExpression(attr.expression) && !hasProto(attr.expression)) { - for (const prop of attr.expression.properties) { - if (isSpreadAssignment(prop)) { - finishObjectLiteralIfNeeded(); - expressions.push(Debug.checkDefined(visitNode(prop.expression, visitor, isExpression))); - continue; - } - properties.push(Debug.checkDefined(visitNode(prop, visitor))); - } - continue; - } - finishObjectLiteralIfNeeded(); - expressions.push(Debug.checkDefined(visitNode(attr.expression, visitor, isExpression))); - continue; - } - properties.push(transformJsxAttributeToObjectLiteralElement(attr)); - } - if (children) { - properties.push(children); - } - finishObjectLiteralIfNeeded(); - if (expressions.length && !isObjectLiteralExpression(expressions[0])) { - expressions.unshift(factory2.createObjectLiteralExpression()); - } - return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions); - function finishObjectLiteralIfNeeded() { - if (properties.length) { - expressions.push(factory2.createObjectLiteralExpression(properties)); - properties = []; - } - } - } - function transformJsxAttributeToObjectLiteralElement(node) { - const name = getAttributeName(node); - const expression = transformJsxAttributeInitializer(node.initializer); - return factory2.createPropertyAssignment(name, expression); - } - function transformJsxAttributeInitializer(node) { - if (node === void 0) { - return factory2.createTrue(); - } - if (node.kind === 11 /* StringLiteral */) { - const singleQuote = node.singleQuote !== void 0 ? node.singleQuote : !isStringDoubleQuoted(node, currentSourceFile); - const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); - return setTextRange(literal, node); - } - if (node.kind === 295 /* JsxExpression */) { - if (node.expression === void 0) { - return factory2.createTrue(); - } - return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); - } - if (isJsxElement(node)) { - return visitJsxElement( - node, - /*isChild*/ - false - ); - } - if (isJsxSelfClosingElement(node)) { - return visitJsxSelfClosingElement( - node, - /*isChild*/ - false - ); - } - if (isJsxFragment(node)) { - return visitJsxFragment( - node, - /*isChild*/ - false - ); - } - return Debug.failBadSyntaxKind(node); - } - function visitJsxText(node) { - const fixed = fixupWhitespaceAndDecodeEntities(node.text); - return fixed === void 0 ? void 0 : factory2.createStringLiteral(fixed); - } - function fixupWhitespaceAndDecodeEntities(text) { - let acc; - let firstNonWhitespace = 0; - let lastNonWhitespace = -1; - for (let i = 0; i < text.length; i++) { - const c = text.charCodeAt(i); - if (isLineBreak(c)) { - if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { - acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); - } - firstNonWhitespace = -1; - } else if (!isWhiteSpaceSingleLine(c)) { - lastNonWhitespace = i; - if (firstNonWhitespace === -1) { - firstNonWhitespace = i; - } - } - } - return firstNonWhitespace !== -1 ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) : acc; - } - function addLineOfJsxText(acc, trimmedLine) { - const decoded = decodeEntities(trimmedLine); - return acc === void 0 ? decoded : acc + " " + decoded; - } - function decodeEntities(text) { - return text.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, (match, _all, _number, _digits, decimal, hex, word) => { - if (decimal) { - return utf16EncodeAsString(parseInt(decimal, 10)); - } else if (hex) { - return utf16EncodeAsString(parseInt(hex, 16)); - } else { - const ch = entities.get(word); - return ch ? utf16EncodeAsString(ch) : match; - } - }); - } - function tryDecodeEntities(text) { - const decoded = decodeEntities(text); - return decoded === text ? void 0 : decoded; - } - function getTagName(node) { - if (node.kind === 285 /* JsxElement */) { - return getTagName(node.openingElement); - } else { - const tagName = node.tagName; - if (isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText)) { - return factory2.createStringLiteral(idText(tagName)); - } else if (isJsxNamespacedName(tagName)) { - return factory2.createStringLiteral(idText(tagName.namespace) + ":" + idText(tagName.name)); - } else { - return createExpressionFromEntityName(factory2, tagName); - } - } - } - function getAttributeName(node) { - const name = node.name; - if (isIdentifier(name)) { - const text = idText(name); - return /^[A-Z_]\w*$/i.test(text) ? name : factory2.createStringLiteral(text); - } - return factory2.createStringLiteral(idText(name.namespace) + ":" + idText(name.name)); - } - function visitJsxExpression(node) { - const expression = visitNode(node.expression, visitor, isExpression); - return node.dotDotDotToken ? factory2.createSpreadElement(expression) : expression; - } -} -var entities = new Map(Object.entries({ - quot: 34, - amp: 38, - apos: 39, - lt: 60, - gt: 62, - nbsp: 160, - iexcl: 161, - cent: 162, - pound: 163, - curren: 164, - yen: 165, - brvbar: 166, - sect: 167, - uml: 168, - copy: 169, - ordf: 170, - laquo: 171, - not: 172, - shy: 173, - reg: 174, - macr: 175, - deg: 176, - plusmn: 177, - sup2: 178, - sup3: 179, - acute: 180, - micro: 181, - para: 182, - middot: 183, - cedil: 184, - sup1: 185, - ordm: 186, - raquo: 187, - frac14: 188, - frac12: 189, - frac34: 190, - iquest: 191, - Agrave: 192, - Aacute: 193, - Acirc: 194, - Atilde: 195, - Auml: 196, - Aring: 197, - AElig: 198, - Ccedil: 199, - Egrave: 200, - Eacute: 201, - Ecirc: 202, - Euml: 203, - Igrave: 204, - Iacute: 205, - Icirc: 206, - Iuml: 207, - ETH: 208, - Ntilde: 209, - Ograve: 210, - Oacute: 211, - Ocirc: 212, - Otilde: 213, - Ouml: 214, - times: 215, - Oslash: 216, - Ugrave: 217, - Uacute: 218, - Ucirc: 219, - Uuml: 220, - Yacute: 221, - THORN: 222, - szlig: 223, - agrave: 224, - aacute: 225, - acirc: 226, - atilde: 227, - auml: 228, - aring: 229, - aelig: 230, - ccedil: 231, - egrave: 232, - eacute: 233, - ecirc: 234, - euml: 235, - igrave: 236, - iacute: 237, - icirc: 238, - iuml: 239, - eth: 240, - ntilde: 241, - ograve: 242, - oacute: 243, - ocirc: 244, - otilde: 245, - ouml: 246, - divide: 247, - oslash: 248, - ugrave: 249, - uacute: 250, - ucirc: 251, - uuml: 252, - yacute: 253, - thorn: 254, - yuml: 255, - OElig: 338, - oelig: 339, - Scaron: 352, - scaron: 353, - Yuml: 376, - fnof: 402, - circ: 710, - tilde: 732, - Alpha: 913, - Beta: 914, - Gamma: 915, - Delta: 916, - Epsilon: 917, - Zeta: 918, - Eta: 919, - Theta: 920, - Iota: 921, - Kappa: 922, - Lambda: 923, - Mu: 924, - Nu: 925, - Xi: 926, - Omicron: 927, - Pi: 928, - Rho: 929, - Sigma: 931, - Tau: 932, - Upsilon: 933, - Phi: 934, - Chi: 935, - Psi: 936, - Omega: 937, - alpha: 945, - beta: 946, - gamma: 947, - delta: 948, - epsilon: 949, - zeta: 950, - eta: 951, - theta: 952, - iota: 953, - kappa: 954, - lambda: 955, - mu: 956, - nu: 957, - xi: 958, - omicron: 959, - pi: 960, - rho: 961, - sigmaf: 962, - sigma: 963, - tau: 964, - upsilon: 965, - phi: 966, - chi: 967, - psi: 968, - omega: 969, - thetasym: 977, - upsih: 978, - piv: 982, - ensp: 8194, - emsp: 8195, - thinsp: 8201, - zwnj: 8204, - zwj: 8205, - lrm: 8206, - rlm: 8207, - ndash: 8211, - mdash: 8212, - lsquo: 8216, - rsquo: 8217, - sbquo: 8218, - ldquo: 8220, - rdquo: 8221, - bdquo: 8222, - dagger: 8224, - Dagger: 8225, - bull: 8226, - hellip: 8230, - permil: 8240, - prime: 8242, - Prime: 8243, - lsaquo: 8249, - rsaquo: 8250, - oline: 8254, - frasl: 8260, - euro: 8364, - image: 8465, - weierp: 8472, - real: 8476, - trade: 8482, - alefsym: 8501, - larr: 8592, - uarr: 8593, - rarr: 8594, - darr: 8595, - harr: 8596, - crarr: 8629, - lArr: 8656, - uArr: 8657, - rArr: 8658, - dArr: 8659, - hArr: 8660, - forall: 8704, - part: 8706, - exist: 8707, - empty: 8709, - nabla: 8711, - isin: 8712, - notin: 8713, - ni: 8715, - prod: 8719, - sum: 8721, - minus: 8722, - lowast: 8727, - radic: 8730, - prop: 8733, - infin: 8734, - ang: 8736, - and: 8743, - or: 8744, - cap: 8745, - cup: 8746, - int: 8747, - there4: 8756, - sim: 8764, - cong: 8773, - asymp: 8776, - ne: 8800, - equiv: 8801, - le: 8804, - ge: 8805, - sub: 8834, - sup: 8835, - nsub: 8836, - sube: 8838, - supe: 8839, - oplus: 8853, - otimes: 8855, - perp: 8869, - sdot: 8901, - lceil: 8968, - rceil: 8969, - lfloor: 8970, - rfloor: 8971, - lang: 9001, - rang: 9002, - loz: 9674, - spades: 9824, - clubs: 9827, - hearts: 9829, - diams: 9830 -})); - -// src/compiler/transformers/es2016.ts -function transformES2016(context) { - const { - factory: factory2, - hoistVariableDeclaration - } = context; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - return visitEachChild(node, visitor, context); - } - function visitor(node) { - if ((node.transformFlags & 512 /* ContainsES2016 */) === 0) { - return node; - } - switch (node.kind) { - case 227 /* BinaryExpression */: - return visitBinaryExpression(node); - default: - return visitEachChild(node, visitor, context); - } - } - function visitBinaryExpression(node) { - switch (node.operatorToken.kind) { - case 68 /* AsteriskAsteriskEqualsToken */: - return visitExponentiationAssignmentExpression(node); - case 43 /* AsteriskAsteriskToken */: - return visitExponentiationExpression(node); - default: - return visitEachChild(node, visitor, context); - } - } - function visitExponentiationAssignmentExpression(node) { - let target; - let value; - const left = visitNode(node.left, visitor, isExpression); - const right = visitNode(node.right, visitor, isExpression); - if (isElementAccessExpression(left)) { - const expressionTemp = factory2.createTempVariable(hoistVariableDeclaration); - const argumentExpressionTemp = factory2.createTempVariable(hoistVariableDeclaration); - target = setTextRange( - factory2.createElementAccessExpression( - setTextRange(factory2.createAssignment(expressionTemp, left.expression), left.expression), - setTextRange(factory2.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression) - ), - left - ); - value = setTextRange( - factory2.createElementAccessExpression( - expressionTemp, - argumentExpressionTemp - ), - left - ); - } else if (isPropertyAccessExpression(left)) { - const expressionTemp = factory2.createTempVariable(hoistVariableDeclaration); - target = setTextRange( - factory2.createPropertyAccessExpression( - setTextRange(factory2.createAssignment(expressionTemp, left.expression), left.expression), - left.name - ), - left - ); - value = setTextRange( - factory2.createPropertyAccessExpression( - expressionTemp, - left.name - ), - left - ); - } else { - target = left; - value = left; - } - return setTextRange( - factory2.createAssignment( - target, - setTextRange(factory2.createGlobalMethodCall("Math", "pow", [value, right]), node) - ), - node - ); - } - function visitExponentiationExpression(node) { - const left = visitNode(node.left, visitor, isExpression); - const right = visitNode(node.right, visitor, isExpression); - return setTextRange(factory2.createGlobalMethodCall("Math", "pow", [left, right]), node); - } -} - -// src/compiler/transformers/es2015.ts -function createSpreadSegment(kind, expression) { - return { kind, expression }; -} -function transformES2015(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - startLexicalEnvironment, - resumeLexicalEnvironment, - endLexicalEnvironment, - hoistVariableDeclaration - } = context; - const compilerOptions = context.getCompilerOptions(); - const resolver = context.getEmitResolver(); - const previousOnSubstituteNode = context.onSubstituteNode; - const previousOnEmitNode = context.onEmitNode; - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - let currentSourceFile; - let currentText; - let hierarchyFacts; - let taggedTemplateStringDeclarations; - function recordTaggedTemplateString(temp) { - taggedTemplateStringDeclarations = append( - taggedTemplateStringDeclarations, - factory2.createVariableDeclaration(temp) - ); - } - let convertedLoopState; - let enabledSubstitutions = 0 /* None */; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - currentSourceFile = node; - currentText = node.text; - const visited = visitSourceFile(node); - addEmitHelpers(visited, context.readEmitHelpers()); - currentSourceFile = void 0; - currentText = void 0; - taggedTemplateStringDeclarations = void 0; - hierarchyFacts = 0 /* None */; - return visited; - } - function enterSubtree(excludeFacts, includeFacts) { - const ancestorFacts = hierarchyFacts; - hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 32767 /* AncestorFactsMask */; - return ancestorFacts; - } - function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { - hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts; - } - function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return (hierarchyFacts & 8192 /* ConstructorWithSuperCall */) !== 0 && node.kind === 254 /* 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( - node, - /*lookInLabeledStatements*/ - false - ) || isBlock(node)); - } - function shouldVisitNode(node) { - return (node.transformFlags & 1024 /* ContainsES2015 */) !== 0 || convertedLoopState !== void 0 || hierarchyFacts & 8192 /* ConstructorWithSuperCall */ && isOrMayContainReturnCompletion(node) || isIterationStatement( - node, - /*lookInLabeledStatements*/ - false - ) && shouldConvertIterationStatement(node) || (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) !== 0; - } - function visitor(node) { - return shouldVisitNode(node) ? visitorWorker( - node, - /*expressionResultIsUnused*/ - false - ) : node; - } - function visitorWithUnusedExpressionResult(node) { - return shouldVisitNode(node) ? visitorWorker( - node, - /*expressionResultIsUnused*/ - true - ) : node; - } - function classWrapperStatementVisitor(node) { - if (shouldVisitNode(node)) { - const original = getOriginalNode(node); - if (isPropertyDeclaration(original) && hasStaticModifier(original)) { - const ancestorFacts = enterSubtree( - 32670 /* StaticInitializerExcludes */, - 16449 /* StaticInitializerIncludes */ - ); - const result = visitorWorker( - node, - /*expressionResultIsUnused*/ - false - ); - exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); - return result; - } - return visitorWorker( - node, - /*expressionResultIsUnused*/ - false - ); - } - return node; - } - function callExpressionVisitor(node) { - if (node.kind === 108 /* SuperKeyword */) { - return visitSuperKeyword( - node, - /*isExpressionOfCall*/ - true - ); - } - return visitor(node); - } - function visitorWorker(node, expressionResultIsUnused2) { - switch (node.kind) { - case 126 /* StaticKeyword */: - return void 0; - // elide static keyword - case 264 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 232 /* ClassExpression */: - return visitClassExpression(node); - case 170 /* Parameter */: - return visitParameter(node); - case 263 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 220 /* ArrowFunction */: - return visitArrowFunction(node); - case 219 /* FunctionExpression */: - return visitFunctionExpression(node); - case 261 /* VariableDeclaration */: - return visitVariableDeclaration(node); - case 80 /* Identifier */: - return visitIdentifier(node); - case 262 /* VariableDeclarationList */: - return visitVariableDeclarationList(node); - case 256 /* SwitchStatement */: - return visitSwitchStatement(node); - case 270 /* CaseBlock */: - return visitCaseBlock(node); - case 242 /* Block */: - return visitBlock( - node, - /*isFunctionBody*/ - false - ); - case 253 /* BreakStatement */: - case 252 /* ContinueStatement */: - return visitBreakOrContinueStatement(node); - case 257 /* LabeledStatement */: - return visitLabeledStatement(node); - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - return visitDoOrWhileStatement( - node, - /*outermostLabeledStatement*/ - void 0 - ); - case 249 /* ForStatement */: - return visitForStatement( - node, - /*outermostLabeledStatement*/ - void 0 - ); - case 250 /* ForInStatement */: - return visitForInStatement( - node, - /*outermostLabeledStatement*/ - void 0 - ); - case 251 /* ForOfStatement */: - return visitForOfStatement( - node, - /*outermostLabeledStatement*/ - void 0 - ); - case 245 /* ExpressionStatement */: - return visitExpressionStatement(node); - case 211 /* ObjectLiteralExpression */: - return visitObjectLiteralExpression(node); - case 300 /* CatchClause */: - return visitCatchClause(node); - case 305 /* ShorthandPropertyAssignment */: - return visitShorthandPropertyAssignment(node); - case 168 /* ComputedPropertyName */: - return visitComputedPropertyName(node); - case 210 /* ArrayLiteralExpression */: - return visitArrayLiteralExpression(node); - case 214 /* CallExpression */: - return visitCallExpression(node); - case 215 /* NewExpression */: - return visitNewExpression(node); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 227 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused2); - case 357 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused2); - case 15 /* NoSubstitutionTemplateLiteral */: - case 16 /* TemplateHead */: - case 17 /* TemplateMiddle */: - case 18 /* TemplateTail */: - return visitTemplateLiteral(node); - case 11 /* StringLiteral */: - return visitStringLiteral(node); - case 9 /* NumericLiteral */: - return visitNumericLiteral(node); - case 216 /* TaggedTemplateExpression */: - return visitTaggedTemplateExpression(node); - case 229 /* TemplateExpression */: - return visitTemplateExpression(node); - case 230 /* YieldExpression */: - return visitYieldExpression(node); - case 231 /* SpreadElement */: - return visitSpreadElement(node); - case 108 /* SuperKeyword */: - return visitSuperKeyword( - node, - /*isExpressionOfCall*/ - false - ); - case 110 /* ThisKeyword */: - return visitThisKeyword(node); - case 237 /* MetaProperty */: - return visitMetaProperty(node); - case 175 /* MethodDeclaration */: - return visitMethodDeclaration(node); - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return visitAccessorDeclaration(node); - case 244 /* VariableStatement */: - return visitVariableStatement(node); - case 254 /* ReturnStatement */: - return visitReturnStatement(node); - case 223 /* VoidExpression */: - return visitVoidExpression(node); - default: - return visitEachChild(node, visitor, context); - } - } - function visitSourceFile(node) { - const ancestorFacts = enterSubtree(8064 /* SourceFileExcludes */, 64 /* SourceFileIncludes */); - const prologue = []; - const statements = []; - startLexicalEnvironment(); - const statementOffset = factory2.copyPrologue( - node.statements, - prologue, - /*ensureUseStrict*/ - false, - visitor - ); - addRange(statements, visitNodes2(node.statements, visitor, isStatement, statementOffset)); - if (taggedTemplateStringDeclarations) { - statements.push( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList(taggedTemplateStringDeclarations) - ) - ); - } - factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); - insertCaptureThisForNodeIfNeeded(prologue, node); - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return factory2.updateSourceFile( - node, - setTextRange(factory2.createNodeArray(concatenate(prologue, statements)), node.statements) - ); - } - function visitSwitchStatement(node) { - if (convertedLoopState !== void 0) { - const savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */; - const result = visitEachChild(node, visitor, context); - convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; - return result; - } - return visitEachChild(node, visitor, context); - } - function visitCaseBlock(node) { - const ancestorFacts = enterSubtree(7104 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); - const updated = visitEachChild(node, visitor, context); - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return updated; - } - function returnCapturedThis(node) { - return setOriginalNode(factory2.createReturnStatement(createCapturedThis()), node); - } - function createCapturedThis() { - return factory2.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */); - } - function visitReturnStatement(node) { - if (convertedLoopState) { - convertedLoopState.nonLocalJumps |= 8 /* Return */; - if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - node = returnCapturedThis(node); - } - return factory2.createReturnStatement( - factory2.createObjectLiteralExpression( - [ - factory2.createPropertyAssignment( - factory2.createIdentifier("value"), - node.expression ? Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) : factory2.createVoidZero() - ) - ] - ) - ); - } else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { - return returnCapturedThis(node); - } - return visitEachChild(node, visitor, context); - } - function visitThisKeyword(node) { - hierarchyFacts |= 65536 /* LexicalThis */; - if (hierarchyFacts & 2 /* ArrowFunction */ && !(hierarchyFacts & 16384 /* StaticInitializer */)) { - hierarchyFacts |= 131072 /* CapturedLexicalThis */; - } - if (convertedLoopState) { - if (hierarchyFacts & 2 /* ArrowFunction */) { - convertedLoopState.containsLexicalThis = true; - return node; - } - return convertedLoopState.thisName || (convertedLoopState.thisName = factory2.createUniqueName("this")); - } - return node; - } - function visitVoidExpression(node) { - return visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - function visitIdentifier(node) { - if (convertedLoopState) { - if (resolver.isArgumentsLocalBinding(node)) { - return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments")); - } - } - if (node.flags & 256 /* IdentifierHasExtendedUnicodeEscape */) { - return setOriginalNode( - setTextRange( - factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), - node - ), - node - ); - } - return node; - } - function visitBreakOrContinueStatement(node) { - if (convertedLoopState) { - const jump = node.kind === 253 /* 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 === 253 /* BreakStatement */) { - convertedLoopState.nonLocalJumps |= 2 /* Break */; - labelMarker = "break"; - } else { - convertedLoopState.nonLocalJumps |= 4 /* Continue */; - labelMarker = "continue"; - } - } else { - if (node.kind === 253 /* BreakStatement */) { - labelMarker = `break-${label.escapedText}`; - setLabeledJump( - convertedLoopState, - /*isBreak*/ - true, - idText(label), - labelMarker - ); - } else { - labelMarker = `continue-${label.escapedText}`; - setLabeledJump( - convertedLoopState, - /*isBreak*/ - false, - idText(label), - labelMarker - ); - } - } - let returnExpression = factory2.createStringLiteral(labelMarker); - if (convertedLoopState.loopOutParameters.length) { - const outParams = convertedLoopState.loopOutParameters; - let expr; - for (let i = 0; i < outParams.length; i++) { - const copyExpr = copyOutParameter(outParams[i], 1 /* ToOutParameter */); - if (i === 0) { - expr = copyExpr; - } else { - expr = factory2.createBinaryExpression(expr, 28 /* CommaToken */, copyExpr); - } - } - returnExpression = factory2.createBinaryExpression(expr, 28 /* CommaToken */, returnExpression); - } - return factory2.createReturnStatement(returnExpression); - } - } - return visitEachChild(node, visitor, context); - } - function visitClassDeclaration(node) { - const variable = factory2.createVariableDeclaration( - factory2.getLocalName( - node, - /*allowComments*/ - true - ), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - transformClassLikeDeclarationToExpression(node) - ); - setOriginalNode(variable, node); - const statements = []; - const statement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([variable]) - ); - setOriginalNode(statement, node); - setTextRange(statement, node); - startOnNewLine(statement); - statements.push(statement); - 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); - } - return singleOrMany(statements); - } - function visitClassExpression(node) { - return transformClassLikeDeclarationToExpression(node); - } - function transformClassLikeDeclarationToExpression(node) { - if (node.name) { - enableSubstitutionsForBlockScopedBindings(); - } - const extendsClauseElement = getClassExtendsHeritageElement(node); - const classFunction = factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - extendsClauseElement ? [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - createSyntheticSuper() - )] : [], - /*type*/ - void 0, - transformClassBody(node, extendsClauseElement) - ); - setEmitFlags(classFunction, getEmitFlags(node) & 131072 /* Indented */ | 1048576 /* ReuseTempVariableScope */); - const inner = factory2.createPartiallyEmittedExpression(classFunction); - setTextRangeEnd(inner, node.end); - setEmitFlags(inner, 3072 /* NoComments */); - const outer = factory2.createPartiallyEmittedExpression(inner); - setTextRangeEnd(outer, skipTrivia(currentText, node.pos)); - setEmitFlags(outer, 3072 /* NoComments */); - const result = factory2.createParenthesizedExpression( - factory2.createCallExpression( - outer, - /*typeArguments*/ - void 0, - extendsClauseElement ? [Debug.checkDefined(visitNode(extendsClauseElement.expression, visitor, isExpression))] : [] - ) - ); - addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, "* @class "); - return result; - } - function transformClassBody(node, extendsClauseElement) { - const statements = []; - const name = factory2.getInternalName(node); - const constructorLikeName = isIdentifierANonContextualKeyword(name) ? factory2.getGeneratedNameForNode(name) : name; - startLexicalEnvironment(); - addExtendsHelperIfNeeded(statements, node, extendsClauseElement); - addConstructor(statements, node, constructorLikeName, extendsClauseElement); - addClassMembers(statements, node); - const closingBraceLocation = createTokenRange(skipTrivia(currentText, node.members.end), 20 /* CloseBraceToken */); - const outer = factory2.createPartiallyEmittedExpression(constructorLikeName); - setTextRangeEnd(outer, closingBraceLocation.end); - setEmitFlags(outer, 3072 /* NoComments */); - const statement = factory2.createReturnStatement(outer); - setTextRangePos(statement, closingBraceLocation.pos); - setEmitFlags(statement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */); - statements.push(statement); - insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); - const block = factory2.createBlock( - setTextRange( - factory2.createNodeArray(statements), - /*location*/ - node.members - ), - /*multiLine*/ - true - ); - setEmitFlags(block, 3072 /* NoComments */); - return block; - } - function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { - if (extendsClauseElement) { - statements.push( - setTextRange( - factory2.createExpressionStatement( - emitHelpers().createExtendsHelper(factory2.getInternalName(node)) - ), - /*location*/ - extendsClauseElement - ) - ); - } - } - function addConstructor(statements, node, name, extendsClauseElement) { - const savedConvertedLoopState = convertedLoopState; - convertedLoopState = void 0; - const ancestorFacts = enterSubtree(32662 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); - const constructor = getFirstConstructorWithBody(node); - const hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== void 0); - const constructorFunction = factory2.createFunctionDeclaration( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - name, - /*typeParameters*/ - void 0, - transformConstructorParameters(constructor, hasSynthesizedSuper), - /*type*/ - void 0, - transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) - ); - setTextRange(constructorFunction, constructor || node); - if (extendsClauseElement) { - setEmitFlags(constructorFunction, 16 /* CapturesThis */); - } - statements.push(constructorFunction); - exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); - convertedLoopState = savedConvertedLoopState; - } - function transformConstructorParameters(constructor, hasSynthesizedSuper) { - return visitParameterList(constructor && !hasSynthesizedSuper ? constructor.parameters : void 0, visitor, context) || []; - } - function createDefaultConstructorBody(node, isDerivedClass) { - const statements = []; - resumeLexicalEnvironment(); - factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); - if (isDerivedClass) { - statements.push(factory2.createReturnStatement(createDefaultSuperCallOrThis())); - } - const statementsArray = factory2.createNodeArray(statements); - setTextRange(statementsArray, node.members); - const block = factory2.createBlock( - statementsArray, - /*multiLine*/ - true - ); - setTextRange(block, node); - 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) { - // stop at function boundaries - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 177 /* Constructor */: - case 176 /* ClassStaticBlockDeclaration */: - return false; - // only step into computed property names for class and object literal elements - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - case 173 /* 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) return createDefaultConstructorBody(node, isDerivedClass); - const prologue = []; - const statements = []; - resumeLexicalEnvironment(); - const standardPrologueEnd = factory2.copyStandardPrologue( - constructor.body.statements, - prologue, - /*statementOffset*/ - 0 - ); - 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( - [ - ...prologue, - ...statements - ] - ), - /*location*/ - constructor.body.statements - ), - /*multiLine*/ - 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 simplifyConstructorInlineSuperReturn(body, original) { - for (const statement of original.statements) { - if (statement.transformFlags & 134217728 /* ContainsLexicalSuper */ && !getSuperCallFromStatement(statement)) { - return body; - } - } - 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) { - // stop at function boundaries - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 177 /* Constructor */: - case 176 /* ClassStaticBlockDeclaration */: - return node; - // only step into computed property names for class and object literal elements - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - case 173 /* 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) { - // stop at function boundaries - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 177 /* Constructor */: - case 176 /* ClassStaticBlockDeclaration */: - return node; - // only step into computed property names for class and object literal elements - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - case 173 /* 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 === 254 /* ReturnStatement */) { - return true; - } else if (statement.kind === 246 /* IfStatement */) { - const ifStatement = statement; - if (ifStatement.elseStatement) { - return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); - } - } else if (statement.kind === 242 /* Block */) { - const lastStatement = lastOrUndefined(statement.statements); - if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { - return true; - } - } - return false; - } - function createActualThis() { - return setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */); - } - function createDefaultSuperCallOrThis() { - return factory2.createLogicalOr( - factory2.createLogicalAnd( - factory2.createStrictInequality( - createSyntheticSuper(), - factory2.createNull() - ), - factory2.createFunctionApplyCall( - createSyntheticSuper(), - createActualThis(), - factory2.createIdentifier("arguments") - ) - ), - createActualThis() - ); - } - function visitParameter(node) { - if (node.dotDotDotToken) { - return void 0; - } else if (isBindingPattern(node.name)) { - return setOriginalNode( - setTextRange( - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - factory2.getGeneratedNameForNode(node), - /*questionToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), - /*location*/ - node - ), - /*original*/ - node - ); - } else if (node.initializer) { - return setOriginalNode( - setTextRange( - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - node.name, - /*questionToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ), - /*location*/ - node - ), - /*original*/ - node - ); - } else { - return node; - } - } - function hasDefaultValueOrBindingPattern(node) { - return node.initializer !== void 0 || isBindingPattern(node.name); - } - function addDefaultValueAssignmentsIfNeeded2(statements, node) { - if (!some(node.parameters, hasDefaultValueOrBindingPattern)) { - return false; - } - let added = false; - for (const parameter of node.parameters) { - const { name, initializer, dotDotDotToken } = parameter; - if (dotDotDotToken) { - continue; - } - if (isBindingPattern(name)) { - added = insertDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) || added; - } else if (initializer) { - insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); - added = true; - } - } - return added; - } - function insertDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) { - if (name.elements.length > 0) { - insertStatementAfterCustomPrologue( - statements, - setEmitFlags( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - flattenDestructuringBinding( - parameter, - visitor, - context, - 0 /* All */, - factory2.getGeneratedNameForNode(parameter) - ) - ) - ), - 2097152 /* CustomPrologue */ - ) - ); - return true; - } else if (initializer) { - insertStatementAfterCustomPrologue( - statements, - setEmitFlags( - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.getGeneratedNameForNode(parameter), - Debug.checkDefined(visitNode(initializer, visitor, isExpression)) - ) - ), - 2097152 /* CustomPrologue */ - ) - ); - return true; - } - return false; - } - function insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { - initializer = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); - const statement = factory2.createIfStatement( - factory2.createTypeCheck(factory2.cloneNode(name), "undefined"), - setEmitFlags( - setTextRange( - factory2.createBlock([ - factory2.createExpressionStatement( - setEmitFlags( - setTextRange( - factory2.createAssignment( - // TODO(rbuckton): Does this need to be parented? - setEmitFlags(setParent(setTextRange(factory2.cloneNode(name), name), name.parent), 96 /* NoSourceMap */), - setEmitFlags(initializer, 96 /* NoSourceMap */ | getEmitFlags(initializer) | 3072 /* NoComments */) - ), - parameter - ), - 3072 /* NoComments */ - ) - ) - ]), - parameter - ), - 1 /* SingleLine */ | 64 /* NoTrailingSourceMap */ | 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */ - ) - ); - startOnNewLine(statement); - setTextRange(statement, parameter); - setEmitFlags(statement, 768 /* NoTokenSourceMaps */ | 64 /* NoTrailingSourceMap */ | 2097152 /* CustomPrologue */ | 3072 /* NoComments */); - insertStatementAfterCustomPrologue(statements, statement); - } - function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) { - return !!(node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper); - } - function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) { - const prologueStatements = []; - const parameter = lastOrUndefined(node.parameters); - if (!shouldAddRestParameter(parameter, inConstructorWithSynthesizedSuper)) { - return false; - } - const declarationName = parameter.name.kind === 80 /* Identifier */ ? setParent(setTextRange(factory2.cloneNode(parameter.name), parameter.name), parameter.name.parent) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - setEmitFlags(declarationName, 96 /* NoSourceMap */); - const expressionName = parameter.name.kind === 80 /* Identifier */ ? factory2.cloneNode(parameter.name) : declarationName; - const restIndex = node.parameters.length - 1; - const temp = factory2.createLoopVariable(); - prologueStatements.push( - setEmitFlags( - setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - declarationName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createArrayLiteralExpression([]) - ) - ]) - ), - /*location*/ - parameter - ), - 2097152 /* CustomPrologue */ - ) - ); - const forStatement = factory2.createForStatement( - setTextRange( - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - temp, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createNumericLiteral(restIndex) - ) - ]), - parameter - ), - setTextRange( - factory2.createLessThan( - temp, - factory2.createPropertyAccessExpression(factory2.createIdentifier("arguments"), "length") - ), - parameter - ), - setTextRange(factory2.createPostfixIncrement(temp), parameter), - factory2.createBlock([ - startOnNewLine( - setTextRange( - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.createElementAccessExpression( - expressionName, - restIndex === 0 ? temp : factory2.createSubtract(temp, factory2.createNumericLiteral(restIndex)) - ), - factory2.createElementAccessExpression(factory2.createIdentifier("arguments"), temp) - ) - ), - /*location*/ - parameter - ) - ) - ]) - ); - setEmitFlags(forStatement, 2097152 /* CustomPrologue */); - startOnNewLine(forStatement); - prologueStatements.push(forStatement); - if (parameter.name.kind !== 80 /* Identifier */) { - prologueStatements.push( - setEmitFlags( - setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, expressionName) - ) - ), - parameter - ), - 2097152 /* CustomPrologue */ - ) - ); - } - insertStatementsAfterCustomPrologue(statements, prologueStatements); - return true; - } - function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 131072 /* CapturedLexicalThis */ && node.kind !== 220 /* ArrowFunction */) { - insertCaptureThisForNode(statements, node, factory2.createThis()); - return true; - } - return false; - } - function insertCaptureThisForNode(statements, node, initializer) { - enableSubstitutionsForCapturedThis(); - const captureThisStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - createCapturedThis(), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ) - ]) - ); - setEmitFlags(captureThisStatement, 3072 /* NoComments */ | 2097152 /* CustomPrologue */); - setSourceMapRange(captureThisStatement, node); - insertStatementAfterCustomPrologue(statements, captureThisStatement); - } - function insertCaptureNewTargetIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* NewTarget */) { - let newTarget; - switch (node.kind) { - case 220 /* ArrowFunction */: - return statements; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - newTarget = factory2.createVoidZero(); - break; - case 177 /* Constructor */: - newTarget = factory2.createPropertyAccessExpression( - setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), - "constructor" - ); - break; - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - newTarget = factory2.createConditionalExpression( - factory2.createLogicalAnd( - setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), - factory2.createBinaryExpression( - setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), - 104 /* InstanceOfKeyword */, - factory2.getLocalName(node) - ) - ), - /*questionToken*/ - void 0, - factory2.createPropertyAccessExpression( - setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), - "constructor" - ), - /*colonToken*/ - void 0, - factory2.createVoidZero() - ); - break; - default: - return Debug.failBadSyntaxKind(node); - } - const captureNewTargetStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - factory2.createUniqueName("_newTarget", 16 /* Optimistic */ | 32 /* FileLevel */), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - newTarget - ) - ]) - ); - setEmitFlags(captureNewTargetStatement, 3072 /* NoComments */ | 2097152 /* CustomPrologue */); - insertStatementAfterCustomPrologue(statements, captureNewTargetStatement); - } - return statements; - } - function addClassMembers(statements, node) { - for (const member of node.members) { - switch (member.kind) { - case 241 /* SemicolonClassElement */: - statements.push(transformSemicolonClassElementToStatement(member)); - break; - case 175 /* MethodDeclaration */: - statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); - break; - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - const accessors = getAllAccessorDeclarations(node.members, member); - if (member === accessors.firstAccessor) { - statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); - } - break; - case 177 /* Constructor */: - case 176 /* ClassStaticBlockDeclaration */: - break; - default: - Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); - break; - } - } - } - function transformSemicolonClassElementToStatement(member) { - return setTextRange(factory2.createEmptyStatement(), member); - } - function transformClassMethodDeclarationToStatement(receiver, member, container) { - const commentRange = getCommentRange(member); - const sourceMapRange = getSourceMapRange(member); - const memberFunction = transformFunctionLikeToExpression( - member, - /*location*/ - member, - /*name*/ - void 0, - container - ); - const propertyName = visitNode(member.name, visitor, isPropertyName); - Debug.assert(propertyName); - let e; - if (!isPrivateIdentifier(propertyName) && getUseDefineForClassFields(context.getCompilerOptions())) { - const name = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; - e = factory2.createObjectDefinePropertyCall(receiver, name, factory2.createPropertyDescriptor({ value: memberFunction, enumerable: false, writable: true, configurable: true })); - } else { - const memberName = createMemberAccessForPropertyName( - factory2, - receiver, - propertyName, - /*location*/ - member.name - ); - e = factory2.createAssignment(memberName, memberFunction); - } - setEmitFlags(memberFunction, 3072 /* NoComments */); - setSourceMapRange(memberFunction, sourceMapRange); - const statement = setTextRange( - factory2.createExpressionStatement(e), - /*location*/ - member - ); - setOriginalNode(statement, member); - setCommentRange(statement, commentRange); - setEmitFlags(statement, 96 /* NoSourceMap */); - return statement; - } - function transformAccessorsToStatement(receiver, accessors, container) { - const statement = factory2.createExpressionStatement(transformAccessorsToExpression( - receiver, - accessors, - container, - /*startsOnNewLine*/ - false - )); - setEmitFlags(statement, 3072 /* NoComments */); - setSourceMapRange(statement, getSourceMapRange(accessors.firstAccessor)); - return statement; - } - function transformAccessorsToExpression(receiver, { firstAccessor, getAccessor, setAccessor }, container, startsOnNewLine) { - const target = setParent(setTextRange(factory2.cloneNode(receiver), receiver), receiver.parent); - setEmitFlags(target, 3072 /* NoComments */ | 64 /* NoTrailingSourceMap */); - setSourceMapRange(target, firstAccessor.name); - const visitedAccessorName = visitNode(firstAccessor.name, visitor, isPropertyName); - Debug.assert(visitedAccessorName); - if (isPrivateIdentifier(visitedAccessorName)) { - return Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015."); - } - const propertyName = createExpressionForPropertyName(factory2, visitedAccessorName); - setEmitFlags(propertyName, 3072 /* NoComments */ | 32 /* NoLeadingSourceMap */); - setSourceMapRange(propertyName, firstAccessor.name); - const properties = []; - if (getAccessor) { - const getterFunction = transformFunctionLikeToExpression( - getAccessor, - /*location*/ - void 0, - /*name*/ - void 0, - container - ); - setSourceMapRange(getterFunction, getSourceMapRange(getAccessor)); - setEmitFlags(getterFunction, 1024 /* NoLeadingComments */); - const getter = factory2.createPropertyAssignment("get", getterFunction); - setCommentRange(getter, getCommentRange(getAccessor)); - properties.push(getter); - } - if (setAccessor) { - const setterFunction = transformFunctionLikeToExpression( - setAccessor, - /*location*/ - void 0, - /*name*/ - void 0, - container - ); - setSourceMapRange(setterFunction, getSourceMapRange(setAccessor)); - setEmitFlags(setterFunction, 1024 /* NoLeadingComments */); - const setter = factory2.createPropertyAssignment("set", setterFunction); - setCommentRange(setter, getCommentRange(setAccessor)); - properties.push(setter); - } - properties.push( - factory2.createPropertyAssignment("enumerable", getAccessor || setAccessor ? factory2.createFalse() : factory2.createTrue()), - factory2.createPropertyAssignment("configurable", factory2.createTrue()) - ); - const call = factory2.createCallExpression( - factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "defineProperty"), - /*typeArguments*/ - void 0, - [ - target, - propertyName, - factory2.createObjectLiteralExpression( - properties, - /*multiLine*/ - true - ) - ] - ); - if (startsOnNewLine) { - startOnNewLine(call); - } - return call; - } - function visitArrowFunction(node) { - if (node.transformFlags & 16384 /* ContainsLexicalThis */ && !(hierarchyFacts & 16384 /* StaticInitializer */)) { - hierarchyFacts |= 131072 /* CapturedLexicalThis */; - } - const savedConvertedLoopState = convertedLoopState; - convertedLoopState = void 0; - const ancestorFacts = enterSubtree(15232 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */); - const func = factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - transformFunctionBody2(node) - ); - setTextRange(func, node); - setOriginalNode(func, node); - setEmitFlags(func, 16 /* CapturesThis */); - exitSubtree(ancestorFacts, 0 /* ArrowFunctionSubtreeExcludes */, 0 /* None */); - convertedLoopState = savedConvertedLoopState; - return func; - } - function visitFunctionExpression(node) { - const ancestorFacts = getEmitFlags(node) & 524288 /* AsyncFunctionBody */ ? enterSubtree(32662 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */); - const savedConvertedLoopState = convertedLoopState; - convertedLoopState = void 0; - const parameters = visitParameterList(node.parameters, visitor, context); - const body = transformFunctionBody2(node); - const name = hierarchyFacts & 32768 /* NewTarget */ ? factory2.getLocalName(node) : node.name; - exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); - convertedLoopState = savedConvertedLoopState; - return factory2.updateFunctionExpression( - node, - /*modifiers*/ - void 0, - node.asteriskToken, - name, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - body - ); - } - function visitFunctionDeclaration(node) { - const savedConvertedLoopState = convertedLoopState; - convertedLoopState = void 0; - const ancestorFacts = enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */); - const parameters = visitParameterList(node.parameters, visitor, context); - const body = transformFunctionBody2(node); - const name = hierarchyFacts & 32768 /* NewTarget */ ? factory2.getLocalName(node) : node.name; - exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); - convertedLoopState = savedConvertedLoopState; - return factory2.updateFunctionDeclaration( - node, - visitNodes2(node.modifiers, visitor, isModifier), - node.asteriskToken, - name, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - body - ); - } - function transformFunctionLikeToExpression(node, location, name, container) { - const savedConvertedLoopState = convertedLoopState; - convertedLoopState = void 0; - 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 === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */)) { - name = factory2.getGeneratedNameForNode(node); - } - exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); - convertedLoopState = savedConvertedLoopState; - return setOriginalNode( - setTextRange( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - node.asteriskToken, - name, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - body - ), - location - ), - /*original*/ - node - ); - } - function transformFunctionBody2(node) { - let multiLine = false; - let singleLine = false; - let statementsLocation; - let closeBraceLocation; - const prologue = []; - const statements = []; - const body = node.body; - let statementOffset; - resumeLexicalEnvironment(); - if (isBlock(body)) { - statementOffset = factory2.copyStandardPrologue( - body.statements, - prologue, - 0, - /*ensureUseStrict*/ - false - ); - statementOffset = factory2.copyCustomPrologue(body.statements, statements, statementOffset, visitor, isHoistedFunction); - statementOffset = factory2.copyCustomPrologue(body.statements, statements, statementOffset, visitor, isHoistedVariableStatement); - } - multiLine = addDefaultValueAssignmentsIfNeeded2(statements, node) || multiLine; - multiLine = addRestParameterIfNeeded( - statements, - node, - /*inConstructorWithSynthesizedSuper*/ - false - ) || multiLine; - if (isBlock(body)) { - statementOffset = factory2.copyCustomPrologue(body.statements, statements, statementOffset, visitor); - statementsLocation = body.statements; - addRange(statements, visitNodes2(body.statements, visitor, isStatement, statementOffset)); - if (!multiLine && body.multiLine) { - multiLine = true; - } - } else { - Debug.assert(node.kind === 220 /* ArrowFunction */); - statementsLocation = moveRangeEnd(body, -1); - const equalsGreaterThanToken = node.equalsGreaterThanToken; - if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) { - if (rangeEndIsOnSameLineAsRangeStart(equalsGreaterThanToken, body, currentSourceFile)) { - singleLine = true; - } else { - multiLine = true; - } - } - const expression = visitNode(body, visitor, isExpression); - const returnStatement = factory2.createReturnStatement(expression); - setTextRange(returnStatement, body); - moveSyntheticComments(returnStatement, body); - setEmitFlags(returnStatement, 768 /* NoTokenSourceMaps */ | 64 /* NoTrailingSourceMap */ | 2048 /* NoTrailingComments */); - statements.push(returnStatement); - closeBraceLocation = body; - } - factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); - insertCaptureNewTargetIfNeeded(prologue, node); - insertCaptureThisForNodeIfNeeded(prologue, node); - if (some(prologue)) { - multiLine = true; - } - statements.unshift(...prologue); - if (isBlock(body) && arrayIsEqualTo(statements, body.statements)) { - return body; - } - const block = factory2.createBlock(setTextRange(factory2.createNodeArray(statements), statementsLocation), multiLine); - setTextRange(block, node.body); - if (!multiLine && singleLine) { - setEmitFlags(block, 1 /* SingleLine */); - } - if (closeBraceLocation) { - setTokenSourceMapRange(block, 20 /* CloseBraceToken */, closeBraceLocation); - } - setOriginalNode(block, node.body); - return block; - } - function visitBlock(node, isFunctionBody2) { - if (isFunctionBody2) { - return visitEachChild(node, visitor, context); - } - const ancestorFacts = hierarchyFacts & 256 /* IterationStatement */ ? enterSubtree(7104 /* IterationStatementBlockExcludes */, 512 /* IterationStatementBlockIncludes */) : enterSubtree(6976 /* BlockExcludes */, 128 /* BlockIncludes */); - const updated = visitEachChild(node, visitor, context); - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return updated; - } - function visitExpressionStatement(node) { - return visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - function visitParenthesizedExpression(node, expressionResultIsUnused2) { - return visitEachChild(node, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, context); - } - function visitBinaryExpression(node, expressionResultIsUnused2) { - if (isDestructuringAssignment(node)) { - return flattenDestructuringAssignment( - node, - visitor, - context, - 0 /* All */, - !expressionResultIsUnused2 - ); - } - if (node.operatorToken.kind === 28 /* CommaToken */) { - return factory2.updateBinaryExpression( - node, - Debug.checkDefined(visitNode(node.left, visitorWithUnusedExpressionResult, isExpression)), - node.operatorToken, - Debug.checkDefined(visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression)) - ); - } - return visitEachChild(node, visitor, context); - } - function visitCommaListExpression(node, expressionResultIsUnused2) { - if (expressionResultIsUnused2) { - return visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - let result; - for (let i = 0; i < node.elements.length; i++) { - const element = node.elements[i]; - const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - Debug.assert(visited); - result.push(visited); - } - } - const elements = result ? setTextRange(factory2.createNodeArray(result), node.elements) : node.elements; - return factory2.updateCommaListExpression(node, elements); - } - function isVariableStatementOfTypeScriptClassWrapper(node) { - 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, 32 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); - let updated; - if (convertedLoopState && (node.declarationList.flags & 7 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) { - let assignments; - for (const decl of node.declarationList.declarations) { - hoistVariableDeclarationDeclaredInConvertedLoop(convertedLoopState, decl); - if (decl.initializer) { - let assignment; - if (isBindingPattern(decl.name)) { - assignment = flattenDestructuringAssignment( - decl, - visitor, - context, - 0 /* All */ - ); - } else { - assignment = factory2.createBinaryExpression(decl.name, 64 /* EqualsToken */, Debug.checkDefined(visitNode(decl.initializer, visitor, isExpression))); - setTextRange(assignment, decl); - } - assignments = append(assignments, assignment); - } - } - if (assignments) { - updated = setTextRange(factory2.createExpressionStatement(factory2.inlineExpressions(assignments)), node); - } else { - updated = void 0; - } - } else { - updated = visitEachChild(node, visitor, context); - } - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return updated; - } - function visitVariableDeclarationList(node) { - 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 declarationList = factory2.createVariableDeclarationList(declarations); - setOriginalNode(declarationList, node); - setTextRange(declarationList, node); - setCommentRange(declarationList, node); - if (node.transformFlags & 524288 /* ContainsBindingPattern */ && (isBindingPattern(node.declarations[0].name) || isBindingPattern(last(node.declarations).name))) { - setSourceMapRange(declarationList, getRangeUnion(declarations)); - } - return declarationList; - } - return visitEachChild(node, visitor, context); - } - function getRangeUnion(declarations) { - let pos = -1, end = -1; - for (const node of declarations) { - pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos); - end = Math.max(end, node.end); - } - return createRange(pos, end); - } - function shouldEmitExplicitInitializerForLetDeclaration(node) { - const isCapturedInFunction = resolver.hasNodeCheckFlag(node, 16384 /* CapturedBlockScopedBinding */); - const isDeclaredInLoop = resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */); - const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0; - const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0); - return emitExplicitInitializer; - } - function visitVariableDeclarationInLetDeclarationList(node) { - const name = node.name; - if (isBindingPattern(name)) { - return visitVariableDeclaration(node); - } - if (!node.initializer && shouldEmitExplicitInitializerForLetDeclaration(node)) { - return factory2.updateVariableDeclaration( - node, - node.name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createVoidZero() - ); - } - return visitEachChild(node, visitor, context); - } - function visitVariableDeclaration(node) { - const ancestorFacts = enterSubtree(32 /* ExportedVariableStatement */, 0 /* None */); - let updated; - if (isBindingPattern(node.name)) { - updated = flattenDestructuringBinding( - node, - visitor, - context, - 0 /* All */, - /*rval*/ - void 0, - (ancestorFacts & 32 /* ExportedVariableStatement */) !== 0 - ); - } else { - updated = visitEachChild(node, visitor, context); - } - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return updated; - } - function recordLabel(node) { - convertedLoopState.labels.set(idText(node.label), true); - } - function resetLabel(node) { - convertedLoopState.labels.set(idText(node.label), false); - } - function visitLabeledStatement(node) { - if (convertedLoopState && !convertedLoopState.labels) { - convertedLoopState.labels = /* @__PURE__ */ new Map(); - } - const statement = unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); - return isIterationStatement( - statement, - /*lookInLabeledStatements*/ - false - ) ? visitIterationStatement( - statement, - /*outermostLabeledStatement*/ - node - ) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), statement), node, convertedLoopState && resetLabel); - } - function visitIterationStatement(node, outermostLabeledStatement) { - switch (node.kind) { - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 249 /* ForStatement */: - return visitForStatement(node, outermostLabeledStatement); - case 250 /* ForInStatement */: - return visitForInStatement(node, outermostLabeledStatement); - case 251 /* ForOfStatement */: - return visitForOfStatement(node, outermostLabeledStatement); - } - } - function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { - const ancestorFacts = enterSubtree(excludeFacts, includeFacts); - const updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert); - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return updated; - } - function visitDoOrWhileStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts( - 0 /* DoOrWhileStatementExcludes */, - 1280 /* DoOrWhileStatementIncludes */, - node, - outermostLabeledStatement - ); - } - function visitForStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts( - 5056 /* ForStatementExcludes */, - 3328 /* ForStatementIncludes */, - node, - outermostLabeledStatement - ); - } - function visitEachChildOfForStatement2(node) { - return factory2.updateForStatement( - node, - visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), - Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) - ); - } - function visitForInStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts( - 3008 /* ForInOrForOfStatementExcludes */, - 5376 /* ForInOrForOfStatementIncludes */, - node, - outermostLabeledStatement - ); - } - function visitForOfStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts( - 3008 /* ForInOrForOfStatementExcludes */, - 5376 /* ForInOrForOfStatementIncludes */, - node, - outermostLabeledStatement, - compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray - ); - } - function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { - const statements = []; - const initializer = node.initializer; - if (isVariableDeclarationList(initializer)) { - if (node.initializer.flags & 7 /* BlockScoped */) { - enableSubstitutionsForBlockScopedBindings(); - } - const firstOriginalDeclaration = firstOrUndefined(initializer.declarations); - if (firstOriginalDeclaration && isBindingPattern(firstOriginalDeclaration.name)) { - const declarations = flattenDestructuringBinding( - firstOriginalDeclaration, - visitor, - context, - 0 /* All */, - boundValue - ); - const declarationList = setTextRange(factory2.createVariableDeclarationList(declarations), node.initializer); - setOriginalNode(declarationList, node.initializer); - setSourceMapRange(declarationList, createRange(declarations[0].pos, last(declarations).end)); - statements.push( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - declarationList - ) - ); - } else { - statements.push( - setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - setOriginalNode( - setTextRange( - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - firstOriginalDeclaration ? firstOriginalDeclaration.name : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - boundValue - ) - ]), - moveRangePos(initializer, -1) - ), - initializer - ) - ), - moveRangeEnd(initializer, -1) - ) - ); - } - } else { - const assignment = factory2.createAssignment(initializer, boundValue); - if (isDestructuringAssignment(assignment)) { - statements.push(factory2.createExpressionStatement(visitBinaryExpression( - assignment, - /*expressionResultIsUnused*/ - true - ))); - } else { - setTextRangeEnd(assignment, initializer.end); - statements.push(setTextRange(factory2.createExpressionStatement(Debug.checkDefined(visitNode(assignment, visitor, isExpression))), moveRangeEnd(initializer, -1))); - } - } - if (convertedLoopBodyStatements) { - return createSyntheticBlockForConvertedStatements(addRange(statements, convertedLoopBodyStatements)); - } else { - const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); - Debug.assert(statement); - if (isBlock(statement)) { - return factory2.updateBlock(statement, setTextRange(factory2.createNodeArray(concatenate(statements, statement.statements)), statement.statements)); - } else { - statements.push(statement); - return createSyntheticBlockForConvertedStatements(statements); - } - } - } - function createSyntheticBlockForConvertedStatements(statements) { - return setEmitFlags( - factory2.createBlock( - factory2.createNodeArray(statements), - /*multiLine*/ - true - ), - 96 /* NoSourceMap */ | 768 /* NoTokenSourceMaps */ - ); - } - function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { - const expression = visitNode(node.expression, visitor, isExpression); - Debug.assert(expression); - const counter = factory2.createLoopVariable(); - const rhsReference = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - setEmitFlags(expression, 96 /* NoSourceMap */ | getEmitFlags(expression)); - const forStatement = setTextRange( - factory2.createForStatement( - /*initializer*/ - setEmitFlags( - setTextRange( - factory2.createVariableDeclarationList([ - setTextRange(factory2.createVariableDeclaration( - counter, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createNumericLiteral(0) - ), moveRangePos(node.expression, -1)), - setTextRange(factory2.createVariableDeclaration( - rhsReference, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - expression - ), node.expression) - ]), - node.expression - ), - 4194304 /* NoHoisting */ - ), - /*condition*/ - setTextRange( - factory2.createLessThan( - counter, - factory2.createPropertyAccessExpression(rhsReference, "length") - ), - node.expression - ), - /*incrementor*/ - setTextRange(factory2.createPostfixIncrement(counter), node.expression), - /*statement*/ - convertForOfStatementHead( - node, - factory2.createElementAccessExpression(rhsReference, counter), - convertedLoopBodyStatements - ) - ), - /*location*/ - node - ); - setEmitFlags(forStatement, 512 /* NoTokenTrailingSourceMaps */); - setTextRange(forStatement, node); - return factory2.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); - } - function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { - const expression = visitNode(node.expression, visitor, isExpression); - Debug.assert(expression); - const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const result = isIdentifier(expression) ? factory2.getGeneratedNameForNode(iterator) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const errorRecord = factory2.createUniqueName("e"); - const catchVariable = factory2.getGeneratedNameForNode(errorRecord); - const returnMethod = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const values = setTextRange(emitHelpers().createValuesHelper(expression), node.expression); - const next = factory2.createCallExpression( - factory2.createPropertyAccessExpression(iterator, "next"), - /*typeArguments*/ - void 0, - [] - ); - hoistVariableDeclaration(errorRecord); - hoistVariableDeclaration(returnMethod); - const initializer = ancestorFacts & 1024 /* IterationContainer */ ? factory2.inlineExpressions([factory2.createAssignment(errorRecord, factory2.createVoidZero()), values]) : values; - const forStatement = setEmitFlags( - setTextRange( - factory2.createForStatement( - /*initializer*/ - setEmitFlags( - setTextRange( - factory2.createVariableDeclarationList([ - setTextRange(factory2.createVariableDeclaration( - iterator, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ), node.expression), - factory2.createVariableDeclaration( - result, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - next - ) - ]), - node.expression - ), - 4194304 /* NoHoisting */ - ), - /*condition*/ - factory2.createLogicalNot(factory2.createPropertyAccessExpression(result, "done")), - /*incrementor*/ - factory2.createAssignment(result, next), - /*statement*/ - convertForOfStatementHead( - node, - factory2.createPropertyAccessExpression(result, "value"), - convertedLoopBodyStatements - ) - ), - /*location*/ - node - ), - 512 /* NoTokenTrailingSourceMaps */ - ); - return factory2.createTryStatement( - factory2.createBlock([ - factory2.restoreEnclosingLabel( - forStatement, - outermostLabeledStatement, - convertedLoopState && resetLabel - ) - ]), - factory2.createCatchClause( - factory2.createVariableDeclaration(catchVariable), - setEmitFlags( - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createAssignment( - errorRecord, - factory2.createObjectLiteralExpression([ - factory2.createPropertyAssignment("error", catchVariable) - ]) - ) - ) - ]), - 1 /* SingleLine */ - ) - ), - factory2.createBlock([ - factory2.createTryStatement( - /*tryBlock*/ - factory2.createBlock([ - setEmitFlags( - factory2.createIfStatement( - factory2.createLogicalAnd( - factory2.createLogicalAnd( - result, - factory2.createLogicalNot( - factory2.createPropertyAccessExpression(result, "done") - ) - ), - factory2.createAssignment( - returnMethod, - factory2.createPropertyAccessExpression(iterator, "return") - ) - ), - factory2.createExpressionStatement( - factory2.createFunctionCallCall(returnMethod, iterator, []) - ) - ), - 1 /* SingleLine */ - ) - ]), - /*catchClause*/ - void 0, - /*finallyBlock*/ - setEmitFlags( - factory2.createBlock([ - setEmitFlags( - factory2.createIfStatement( - errorRecord, - factory2.createThrowStatement( - factory2.createPropertyAccessExpression(errorRecord, "error") - ) - ), - 1 /* SingleLine */ - ) - ]), - 1 /* SingleLine */ - ) - ) - ]) - ); - } - function visitObjectLiteralExpression(node) { - const properties = node.properties; - 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 === 168 /* ComputedPropertyName */)) { - numInitialProperties = i; - break; - } - } - if (numInitialProperties < 0) { - return visitEachChild(node, visitor, context); - } - const temp = factory2.createTempVariable(hoistVariableDeclaration); - const expressions = []; - const assignment = factory2.createAssignment( - temp, - setEmitFlags( - factory2.createObjectLiteralExpression( - visitNodes2(properties, visitor, isObjectLiteralElementLike, 0, numInitialProperties), - node.multiLine - ), - hasComputed ? 131072 /* Indented */ : 0 - ) - ); - if (node.multiLine) { - startOnNewLine(assignment); - } - expressions.push(assignment); - addObjectLiteralMembers(expressions, node, temp, numInitialProperties); - expressions.push(node.multiLine ? startOnNewLine(setParent(setTextRange(factory2.cloneNode(temp), temp), temp.parent)) : temp); - return factory2.inlineExpressions(expressions); - } - function shouldConvertPartOfIterationStatement(node) { - return resolver.hasNodeCheckFlag(node, 8192 /* ContainsCapturedBlockScopeBinding */); - } - function shouldConvertInitializerOfForStatement(node) { - return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer); - } - function shouldConvertConditionOfForStatement(node) { - return isForStatement(node) && !!node.condition && shouldConvertPartOfIterationStatement(node.condition); - } - function shouldConvertIncrementorOfForStatement(node) { - return isForStatement(node) && !!node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - } - function shouldConvertIterationStatement(node) { - return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node); - } - function shouldConvertBodyOfIterationStatement(node) { - return resolver.hasNodeCheckFlag(node, 4096 /* LoopWithCapturedBlockScopedBinding */); - } - function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) { - if (!state.hoistedLocalVariables) { - state.hoistedLocalVariables = []; - } - visit(node.name); - function visit(node2) { - if (node2.kind === 80 /* Identifier */) { - state.hoistedLocalVariables.push(node2); - } else { - for (const element of node2.elements) { - if (!isOmittedExpression(element)) { - visit(element.name); - } - } - } - } - } - function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert) { - if (!shouldConvertIterationStatement(node)) { - let saveAllowedNonLabeledJumps; - if (convertedLoopState) { - saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; - convertedLoopState.allowedNonLabeledJumps = 2 /* Break */ | 4 /* Continue */; - } - const result = convert ? convert( - node, - outermostLabeledStatement, - /*convertedLoopBodyStatements*/ - void 0, - ancestorFacts - ) : factory2.restoreEnclosingLabel( - isForStatement(node) ? visitEachChildOfForStatement2(node) : visitEachChild(node, visitor, context), - outermostLabeledStatement, - convertedLoopState && resetLabel - ); - if (convertedLoopState) { - convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; - } - return result; - } - const currentState = createConvertedLoopState(node); - const statements = []; - const outerConvertedLoopState = convertedLoopState; - convertedLoopState = currentState; - const initializerFunction = shouldConvertInitializerOfForStatement(node) ? createFunctionForInitializerOfForStatement(node, currentState) : void 0; - const bodyFunction = shouldConvertBodyOfIterationStatement(node) ? createFunctionForBodyOfIterationStatement(node, currentState, outerConvertedLoopState) : void 0; - convertedLoopState = outerConvertedLoopState; - if (initializerFunction) statements.push(initializerFunction.functionDeclaration); - if (bodyFunction) statements.push(bodyFunction.functionDeclaration); - addExtraDeclarationsForConvertedLoop(statements, currentState, outerConvertedLoopState); - if (initializerFunction) { - statements.push(generateCallToConvertedLoopInitializer(initializerFunction.functionName, initializerFunction.containsYield)); - } - let loop; - if (bodyFunction) { - if (convert) { - loop = convert(node, outermostLabeledStatement, bodyFunction.part, ancestorFacts); - } else { - const clone2 = convertIterationStatementCore(node, initializerFunction, factory2.createBlock( - bodyFunction.part, - /*multiLine*/ - true - )); - loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); - } - } else { - const clone2 = convertIterationStatementCore(node, initializerFunction, Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); - loop = factory2.restoreEnclosingLabel(clone2, outermostLabeledStatement, convertedLoopState && resetLabel); - } - statements.push(loop); - return statements; - } - function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { - switch (node.kind) { - case 249 /* ForStatement */: - return convertForStatement(node, initializerFunction, convertedLoopBody); - case 250 /* ForInStatement */: - return convertForInStatement(node, convertedLoopBody); - case 251 /* ForOfStatement */: - return convertForOfStatement(node, convertedLoopBody); - case 247 /* DoStatement */: - return convertDoStatement(node, convertedLoopBody); - case 248 /* WhileStatement */: - return convertWhileStatement(node, convertedLoopBody); - default: - return Debug.failBadSyntaxKind(node, "IterationStatement expected"); - } - } - function convertForStatement(node, initializerFunction, convertedLoopBody) { - const shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); - const shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - return factory2.updateForStatement( - node, - visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, isForInitializer), - visitNode(shouldConvertCondition ? void 0 : node.condition, visitor, isExpression), - visitNode(shouldConvertIncrementor ? void 0 : node.incrementor, visitorWithUnusedExpressionResult, isExpression), - convertedLoopBody - ); - } - function convertForOfStatement(node, convertedLoopBody) { - return factory2.updateForOfStatement( - node, - /*awaitModifier*/ - void 0, - Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - convertedLoopBody - ); - } - function convertForInStatement(node, convertedLoopBody) { - return factory2.updateForInStatement( - node, - Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - convertedLoopBody - ); - } - function convertDoStatement(node, convertedLoopBody) { - return factory2.updateDoStatement( - node, - convertedLoopBody, - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) - ); - } - function convertWhileStatement(node, convertedLoopBody) { - return factory2.updateWhileStatement( - node, - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - convertedLoopBody - ); - } - function createConvertedLoopState(node) { - let loopInitializer; - switch (node.kind) { - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - const initializer = node.initializer; - if (initializer && initializer.kind === 262 /* VariableDeclarationList */) { - loopInitializer = initializer; - } - break; - } - const loopParameters = []; - const loopOutParameters = []; - 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); - } - } - const currentState = { loopParameters, loopOutParameters }; - if (convertedLoopState) { - if (convertedLoopState.argumentsName) { - currentState.argumentsName = convertedLoopState.argumentsName; - } - if (convertedLoopState.thisName) { - currentState.thisName = convertedLoopState.thisName; - } - if (convertedLoopState.hoistedLocalVariables) { - currentState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables; - } - } - return currentState; - } - function addExtraDeclarationsForConvertedLoop(statements, state, outerState) { - let extraVariableDeclarations; - if (state.argumentsName) { - if (outerState) { - outerState.argumentsName = state.argumentsName; - } else { - (extraVariableDeclarations || (extraVariableDeclarations = [])).push( - factory2.createVariableDeclaration( - state.argumentsName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createIdentifier("arguments") - ) - ); - } - } - if (state.thisName) { - if (outerState) { - outerState.thisName = state.thisName; - } else { - (extraVariableDeclarations || (extraVariableDeclarations = [])).push( - factory2.createVariableDeclaration( - state.thisName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createIdentifier("this") - ) - ); - } - } - if (state.hoistedLocalVariables) { - if (outerState) { - outerState.hoistedLocalVariables = state.hoistedLocalVariables; - } else { - if (!extraVariableDeclarations) { - extraVariableDeclarations = []; - } - for (const identifier of state.hoistedLocalVariables) { - extraVariableDeclarations.push(factory2.createVariableDeclaration(identifier)); - } - } - } - if (state.loopOutParameters.length) { - if (!extraVariableDeclarations) { - extraVariableDeclarations = []; - } - for (const outParam of state.loopOutParameters) { - extraVariableDeclarations.push(factory2.createVariableDeclaration(outParam.outParamName)); - } - } - if (state.conditionVariable) { - if (!extraVariableDeclarations) { - extraVariableDeclarations = []; - } - extraVariableDeclarations.push(factory2.createVariableDeclaration( - state.conditionVariable, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createFalse() - )); - } - if (extraVariableDeclarations) { - statements.push(factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList(extraVariableDeclarations) - )); - } - } - function createOutVariable(p) { - return factory2.createVariableDeclaration( - p.originalName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - p.outParamName - ); - } - function createFunctionForInitializerOfForStatement(node, currentState) { - const functionName = factory2.createUniqueName("_loop_init"); - const containsYield = (node.initializer.transformFlags & 1048576 /* ContainsYield */) !== 0; - let emitFlags = 0 /* None */; - if (currentState.containsLexicalThis) emitFlags |= 16 /* CapturesThis */; - if (containsYield && hierarchyFacts & 4 /* AsyncFunctionBody */) emitFlags |= 524288 /* AsyncFunctionBody */; - const statements = []; - statements.push(factory2.createVariableStatement( - /*modifiers*/ - void 0, - node.initializer - )); - copyOutParameters(currentState.loopOutParameters, 2 /* Initializer */, 1 /* ToOutParameter */, statements); - const functionDeclaration = factory2.createVariableStatement( - /*modifiers*/ - void 0, - setEmitFlags( - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - functionName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - setEmitFlags( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - containsYield ? factory2.createToken(42 /* AsteriskToken */) : void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - void 0, - /*type*/ - void 0, - Debug.checkDefined(visitNode( - factory2.createBlock( - statements, - /*multiLine*/ - true - ), - visitor, - isBlock - )) - ), - emitFlags - ) - ) - ]), - 4194304 /* NoHoisting */ - ) - ); - const part = factory2.createVariableDeclarationList(map(currentState.loopOutParameters, createOutVariable)); - return { functionName, containsYield, functionDeclaration, part }; - } - function createFunctionForBodyOfIterationStatement(node, currentState, outerState) { - const functionName = factory2.createUniqueName("_loop"); - startLexicalEnvironment(); - const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); - const lexicalEnvironment = endLexicalEnvironment(); - const statements = []; - if (shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node)) { - currentState.conditionVariable = factory2.createUniqueName("inc"); - if (node.incrementor) { - statements.push(factory2.createIfStatement( - currentState.conditionVariable, - factory2.createExpressionStatement(Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression))), - factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) - )); - } else { - statements.push(factory2.createIfStatement( - factory2.createLogicalNot(currentState.conditionVariable), - factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) - )); - } - if (shouldConvertConditionOfForStatement(node)) { - statements.push(factory2.createIfStatement( - factory2.createPrefixUnaryExpression(54 /* ExclamationToken */, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))), - Debug.checkDefined(visitNode(factory2.createBreakStatement(), visitor, isStatement)) - )); - } - } - Debug.assert(statement); - if (isBlock(statement)) { - addRange(statements, statement.statements); - } else { - statements.push(statement); - } - copyOutParameters(currentState.loopOutParameters, 1 /* Body */, 1 /* ToOutParameter */, statements); - insertStatementsAfterStandardPrologue(statements, lexicalEnvironment); - const loopBody = factory2.createBlock( - statements, - /*multiLine*/ - true - ); - if (isBlock(statement)) setOriginalNode(loopBody, statement); - const containsYield = (node.statement.transformFlags & 1048576 /* ContainsYield */) !== 0; - let emitFlags = 1048576 /* ReuseTempVariableScope */; - if (currentState.containsLexicalThis) emitFlags |= 16 /* CapturesThis */; - if (containsYield && (hierarchyFacts & 4 /* AsyncFunctionBody */) !== 0) emitFlags |= 524288 /* AsyncFunctionBody */; - const functionDeclaration = factory2.createVariableStatement( - /*modifiers*/ - void 0, - setEmitFlags( - factory2.createVariableDeclarationList( - [ - factory2.createVariableDeclaration( - functionName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - setEmitFlags( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - containsYield ? factory2.createToken(42 /* AsteriskToken */) : void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - currentState.loopParameters, - /*type*/ - void 0, - loopBody - ), - emitFlags - ) - ) - ] - ), - 4194304 /* NoHoisting */ - ) - ); - const part = generateCallToConvertedLoop(functionName, currentState, outerState, containsYield); - return { functionName, containsYield, functionDeclaration, part }; - } - function copyOutParameter(outParam, copyDirection) { - const source = copyDirection === 0 /* ToOriginal */ ? outParam.outParamName : outParam.originalName; - const target = copyDirection === 0 /* ToOriginal */ ? outParam.originalName : outParam.outParamName; - return factory2.createBinaryExpression(target, 64 /* EqualsToken */, source); - } - function copyOutParameters(outParams, partFlags, copyDirection, statements) { - for (const outParam of outParams) { - if (outParam.flags & partFlags) { - statements.push(factory2.createExpressionStatement(copyOutParameter(outParam, copyDirection))); - } - } - } - function generateCallToConvertedLoopInitializer(initFunctionExpressionName, containsYield) { - const call = factory2.createCallExpression( - initFunctionExpressionName, - /*typeArguments*/ - void 0, - [] - ); - const callResult = containsYield ? factory2.createYieldExpression( - factory2.createToken(42 /* AsteriskToken */), - setEmitFlags(call, 8388608 /* Iterator */) - ) : call; - return factory2.createExpressionStatement(callResult); - } - function generateCallToConvertedLoop(loopFunctionExpressionName, state, outerState, containsYield) { - const statements = []; - const isSimpleLoop = !(state.nonLocalJumps & ~4 /* Continue */) && !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; - const call = factory2.createCallExpression( - loopFunctionExpressionName, - /*typeArguments*/ - void 0, - map(state.loopParameters, (p) => p.name) - ); - const callResult = containsYield ? factory2.createYieldExpression( - factory2.createToken(42 /* AsteriskToken */), - setEmitFlags(call, 8388608 /* Iterator */) - ) : call; - if (isSimpleLoop) { - statements.push(factory2.createExpressionStatement(callResult)); - copyOutParameters(state.loopOutParameters, 1 /* Body */, 0 /* ToOriginal */, statements); - } else { - const loopResultName = factory2.createUniqueName("state"); - const stateVariable = factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - [factory2.createVariableDeclaration( - loopResultName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - callResult - )] - ) - ); - statements.push(stateVariable); - copyOutParameters(state.loopOutParameters, 1 /* Body */, 0 /* ToOriginal */, statements); - if (state.nonLocalJumps & 8 /* Return */) { - let returnStatement; - if (outerState) { - outerState.nonLocalJumps |= 8 /* Return */; - returnStatement = factory2.createReturnStatement(loopResultName); - } else { - returnStatement = factory2.createReturnStatement(factory2.createPropertyAccessExpression(loopResultName, "value")); - } - statements.push( - factory2.createIfStatement( - factory2.createTypeCheck(loopResultName, "object"), - returnStatement - ) - ); - } - if (state.nonLocalJumps & 2 /* Break */) { - statements.push( - factory2.createIfStatement( - factory2.createStrictEquality( - loopResultName, - factory2.createStringLiteral("break") - ), - factory2.createBreakStatement() - ) - ); - } - if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) { - const caseClauses = []; - processLabeledJumps( - state.labeledNonLocalBreaks, - /*isBreak*/ - true, - loopResultName, - outerState, - caseClauses - ); - processLabeledJumps( - state.labeledNonLocalContinues, - /*isBreak*/ - false, - loopResultName, - outerState, - caseClauses - ); - statements.push( - factory2.createSwitchStatement( - loopResultName, - factory2.createCaseBlock(caseClauses) - ) - ); - } - } - return statements; - } - function setLabeledJump(state, isBreak, labelText, labelMarker) { - if (isBreak) { - if (!state.labeledNonLocalBreaks) { - state.labeledNonLocalBreaks = /* @__PURE__ */ new Map(); - } - state.labeledNonLocalBreaks.set(labelText, labelMarker); - } else { - if (!state.labeledNonLocalContinues) { - state.labeledNonLocalContinues = /* @__PURE__ */ new Map(); - } - state.labeledNonLocalContinues.set(labelText, labelMarker); - } - } - function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) { - if (!table) { - return; - } - table.forEach((labelMarker, labelText) => { - const statements = []; - if (!outerLoop || outerLoop.labels && outerLoop.labels.get(labelText)) { - const label = factory2.createIdentifier(labelText); - statements.push(isBreak ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label)); - } else { - setLabeledJump(outerLoop, isBreak, labelText, labelMarker); - statements.push(factory2.createReturnStatement(loopResultName)); - } - caseClauses.push(factory2.createCaseClause(factory2.createStringLiteral(labelMarker), statements)); - }); - } - function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead) { - const name = decl.name; - if (isBindingPattern(name)) { - for (const element of name.elements) { - if (!isOmittedExpression(element)) { - processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForHead); - } - } - } else { - loopParameters.push(factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - name - )); - const needsOutParam = resolver.hasNodeCheckFlag(decl, 65536 /* NeedsLoopOutParameter */); - if (needsOutParam || hasCapturedBindingsInForHead) { - const outParamName = factory2.createUniqueName("out_" + idText(name)); - let flags = 0 /* None */; - if (needsOutParam) { - flags |= 1 /* Body */; - } - if (isForStatement(container)) { - if (container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) { - flags |= 2 /* Initializer */; - } - if (container.condition && resolver.isBindingCapturedByNode(container.condition, decl) || container.incrementor && resolver.isBindingCapturedByNode(container.incrementor, decl)) { - flags |= 1 /* Body */; - } - } - loopOutParameters.push({ flags, originalName: name, outParamName }); - } - } - } - function addObjectLiteralMembers(expressions, node, receiver, start) { - const properties = node.properties; - const numProperties = properties.length; - for (let i = start; i < numProperties; i++) { - const property = properties[i]; - switch (property.kind) { - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - const accessors = getAllAccessorDeclarations(node.properties, property); - if (property === accessors.firstAccessor) { - expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); - } - break; - case 175 /* MethodDeclaration */: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); - break; - case 304 /* PropertyAssignment */: - expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); - break; - case 305 /* ShorthandPropertyAssignment */: - expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); - break; - default: - Debug.failBadSyntaxKind(node); - break; - } - } - } - function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - const expression = factory2.createAssignment( - createMemberAccessForPropertyName( - factory2, - receiver, - Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) - ), - Debug.checkDefined(visitNode(property.initializer, visitor, isExpression)) - ); - setTextRange(expression, property); - if (startsOnNewLine) { - startOnNewLine(expression); - } - return expression; - } - function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) { - const expression = factory2.createAssignment( - createMemberAccessForPropertyName( - factory2, - receiver, - Debug.checkDefined(visitNode(property.name, visitor, isPropertyName)) - ), - factory2.cloneNode(property.name) - ); - setTextRange(expression, property); - if (startsOnNewLine) { - startOnNewLine(expression); - } - return expression; - } - function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) { - const expression = factory2.createAssignment( - createMemberAccessForPropertyName( - factory2, - receiver, - Debug.checkDefined(visitNode(method.name, visitor, isPropertyName)) - ), - transformFunctionLikeToExpression( - method, - /*location*/ - method, - /*name*/ - void 0, - container - ) - ); - setTextRange(expression, method); - if (startsOnNewLine) { - startOnNewLine(expression); - } - return expression; - } - function visitCatchClause(node) { - const ancestorFacts = enterSubtree(7104 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); - let updated; - Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); - if (isBindingPattern(node.variableDeclaration.name)) { - const temp = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - const newVariableDeclaration = factory2.createVariableDeclaration(temp); - setTextRange(newVariableDeclaration, node.variableDeclaration); - const vars = flattenDestructuringBinding( - node.variableDeclaration, - visitor, - context, - 0 /* All */, - temp - ); - const list = factory2.createVariableDeclarationList(vars); - setTextRange(list, node.variableDeclaration); - const destructure = factory2.createVariableStatement( - /*modifiers*/ - void 0, - list - ); - updated = factory2.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); - } else { - updated = visitEachChild(node, visitor, context); - } - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return updated; - } - function addStatementToStartOfBlock(block, statement) { - const transformedStatements = visitNodes2(block.statements, visitor, isStatement); - return factory2.updateBlock(block, [statement, ...transformedStatements]); - } - function visitMethodDeclaration(node) { - Debug.assert(!isComputedPropertyName(node.name)); - const functionExpression = transformFunctionLikeToExpression( - node, - /*location*/ - moveRangePos(node, -1), - /*name*/ - void 0, - /*container*/ - void 0 - ); - setEmitFlags(functionExpression, 1024 /* NoLeadingComments */ | getEmitFlags(functionExpression)); - return setTextRange( - factory2.createPropertyAssignment( - node.name, - functionExpression - ), - /*location*/ - node - ); - } - function visitAccessorDeclaration(node) { - Debug.assert(!isComputedPropertyName(node.name)); - const savedConvertedLoopState = convertedLoopState; - convertedLoopState = void 0; - const ancestorFacts = enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */); - let updated; - const parameters = visitParameterList(node.parameters, visitor, context); - const body = transformFunctionBody2(node); - if (node.kind === 178 /* 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, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); - convertedLoopState = savedConvertedLoopState; - return updated; - } - function visitShorthandPropertyAssignment(node) { - return setTextRange( - factory2.createPropertyAssignment( - node.name, - visitIdentifier(factory2.cloneNode(node.name)) - ), - /*location*/ - node - ); - } - function visitComputedPropertyName(node) { - return visitEachChild(node, visitor, context); - } - function visitYieldExpression(node) { - return visitEachChild(node, visitor, context); - } - function visitArrayLiteralExpression(node) { - if (some(node.elements, isSpreadElement)) { - return transformAndSpreadElements( - node.elements, - /*isArgumentList*/ - false, - !!node.multiLine, - /*hasTrailingComma*/ - !!node.elements.hasTrailingComma - ); - } - return visitEachChild(node, visitor, context); - } - function visitCallExpression(node) { - if (getInternalEmitFlags(node) & 1 /* TypeScriptClassWrapper */) { - return visitTypeScriptClassWrapper(node); - } - const expression = skipOuterExpressions(node.expression); - if (expression.kind === 108 /* SuperKeyword */ || isSuperProperty(expression) || some(node.arguments, isSpreadElement)) { - return visitCallExpressionWithPotentialCapturedThisAssignment( - node, - /*assignToCapturedThis*/ - true - ); - } - return factory2.updateCallExpression( - node, - Debug.checkDefined(visitNode(node.expression, callExpressionVisitor, isExpression)), - /*typeArguments*/ - void 0, - visitNodes2(node.arguments, visitor, isExpression) - ); - } - function visitTypeScriptClassWrapper(node) { - const body = cast(cast(skipOuterExpressions(node.expression), isArrowFunction).body, isBlock); - const isVariableStatementWithInitializer = (stmt) => isVariableStatement(stmt) && !!first(stmt.declarationList.declarations).initializer; - const savedConvertedLoopState = convertedLoopState; - convertedLoopState = void 0; - const bodyStatements = visitNodes2(body.statements, classWrapperStatementVisitor, isStatement); - convertedLoopState = savedConvertedLoopState; - const classStatements = filter(bodyStatements, isVariableStatementWithInitializer); - const remainingStatements = filter(bodyStatements, (stmt) => !isVariableStatementWithInitializer(stmt)); - const varStatement = cast(first(classStatements), isVariableStatement); - const variable = varStatement.declarationList.declarations[0]; - const initializer = skipOuterExpressions(variable.initializer); - let aliasAssignment = tryCast(initializer, isAssignmentExpression); - if (!aliasAssignment && isBinaryExpression(initializer) && initializer.operatorToken.kind === 28 /* CommaToken */) { - aliasAssignment = tryCast(initializer.left, isAssignmentExpression); - } - const call = cast(aliasAssignment ? skipOuterExpressions(aliasAssignment.right) : initializer, isCallExpression); - const func = cast(skipOuterExpressions(call.expression), isFunctionExpression); - const funcStatements = func.body.statements; - let classBodyStart = 0; - let classBodyEnd = -1; - const statements = []; - if (aliasAssignment) { - const extendsCall = tryCast(funcStatements[classBodyStart], isExpressionStatement); - if (extendsCall) { - statements.push(extendsCall); - classBodyStart++; - } - statements.push(funcStatements[classBodyStart]); - classBodyStart++; - statements.push( - factory2.createExpressionStatement( - factory2.createAssignment( - aliasAssignment.left, - cast(variable.name, isIdentifier) - ) - ) - ); - } - while (!isReturnStatement(elementAt(funcStatements, classBodyEnd))) { - classBodyEnd--; - } - addRange(statements, funcStatements, classBodyStart, classBodyEnd); - if (classBodyEnd < -1) { - addRange(statements, funcStatements, classBodyEnd + 1); - } - const returnStatement = tryCast(elementAt(funcStatements, classBodyEnd), isReturnStatement); - for (const statement of remainingStatements) { - if (isReturnStatement(statement) && (returnStatement == null ? void 0 : returnStatement.expression) && !isIdentifier(returnStatement.expression)) { - statements.push(returnStatement); - } else { - statements.push(statement); - } - } - addRange( - statements, - classStatements, - /*start*/ - 1 - ); - return factory2.restoreOuterExpressions( - node.expression, - factory2.restoreOuterExpressions( - variable.initializer, - factory2.restoreOuterExpressions( - aliasAssignment && aliasAssignment.right, - factory2.updateCallExpression( - call, - factory2.restoreOuterExpressions( - call.expression, - factory2.updateFunctionExpression( - func, - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - func.parameters, - /*type*/ - void 0, - factory2.updateBlock( - func.body, - statements - ) - ) - ), - /*typeArguments*/ - void 0, - call.arguments - ) - ) - ) - ); - } - 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); - if (node.expression.kind === 108 /* SuperKeyword */) { - setEmitFlags(thisArg, 8 /* NoSubstitution */); - } - let resultingCall; - if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { - resultingCall = factory2.createFunctionApplyCall( - Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), - node.expression.kind === 108 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), - transformAndSpreadElements( - node.arguments, - /*isArgumentList*/ - true, - /*multiLine*/ - false, - /*hasTrailingComma*/ - false - ) - ); - } else { - resultingCall = setTextRange( - factory2.createFunctionCallCall( - Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), - node.expression.kind === 108 /* SuperKeyword */ ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), - visitNodes2(node.arguments, visitor, isExpression) - ), - node - ); - } - if (node.expression.kind === 108 /* SuperKeyword */) { - const initializer = factory2.createLogicalOr( - resultingCall, - createActualThis() - ); - 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) { - if (some(node.arguments, isSpreadElement)) { - const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); - return factory2.createNewExpression( - factory2.createFunctionApplyCall( - Debug.checkDefined(visitNode(target, visitor, isExpression)), - thisArg, - transformAndSpreadElements( - factory2.createNodeArray([factory2.createVoidZero(), ...node.arguments]), - /*isArgumentList*/ - true, - /*multiLine*/ - false, - /*hasTrailingComma*/ - false - ) - ), - /*typeArguments*/ - void 0, - [] - ); - } - return visitEachChild(node, visitor, context); - } - function transformAndSpreadElements(elements, isArgumentList, multiLine, hasTrailingComma) { - const numElements = elements.length; - const segments = flatten( - // 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)) - ); - if (segments.length === 1) { - const firstSegment = segments[0]; - if (isArgumentList && !compilerOptions.downlevelIteration || isPackedArrayLiteral(firstSegment.expression) || isCallToHelper(firstSegment.expression, "___spreadArray")) { - return firstSegment.expression; - } - } - const helpers = emitHelpers(); - const startsWithSpread = segments[0].kind !== 0 /* None */; - let expression = startsWithSpread ? factory2.createArrayLiteralExpression() : segments[0].expression; - for (let i = startsWithSpread ? 0 : 1; i < segments.length; i++) { - const segment = segments[i]; - expression = helpers.createSpreadArrayHelper( - expression, - segment.expression, - segment.kind === 1 /* UnpackedSpread */ && !isArgumentList - ); - } - return expression; - } - function partitionSpread(node) { - return isSpreadElement(node) ? visitSpanOfSpreads : visitSpanOfNonSpreads; - } - function visitSpanOfSpreads(chunk) { - return map(chunk, visitExpressionOfSpread); - } - function visitExpressionOfSpread(node) { - Debug.assertNode(node, isSpreadElement); - let expression = visitNode(node.expression, visitor, isExpression); - Debug.assert(expression); - const isCallToReadHelper = isCallToHelper(expression, "___read"); - let kind = isCallToReadHelper || isPackedArrayLiteral(expression) ? 2 /* PackedSpread */ : 1 /* UnpackedSpread */; - if (compilerOptions.downlevelIteration && kind === 1 /* UnpackedSpread */ && !isArrayLiteralExpression(expression) && !isCallToReadHelper) { - expression = emitHelpers().createReadHelper( - expression, - /*count*/ - void 0 - ); - kind = 2 /* PackedSpread */; - } - return createSpreadSegment(kind, expression); - } - function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) { - const expression = factory2.createArrayLiteralExpression( - visitNodes2(factory2.createNodeArray(chunk, hasTrailingComma), visitor, isExpression), - multiLine - ); - return createSpreadSegment(0 /* None */, expression); - } - function visitSpreadElement(node) { - return visitNode(node.expression, visitor, isExpression); - } - function visitTemplateLiteral(node) { - return setTextRange(factory2.createStringLiteral(node.text), node); - } - function visitStringLiteral(node) { - if (node.hasExtendedUnicodeEscape) { - return setTextRange(factory2.createStringLiteral(node.text), node); - } - return node; - } - function visitNumericLiteral(node) { - if (node.numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */) { - return setTextRange(factory2.createNumericLiteral(node.text), node); - } - return node; - } - function visitTaggedTemplateExpression(node) { - return processTaggedTemplateExpression( - context, - node, - visitor, - currentSourceFile, - recordTaggedTemplateString, - 1 /* All */ - ); - } - function visitTemplateExpression(node) { - let expression = factory2.createStringLiteral(node.head.text); - for (const span of node.templateSpans) { - const args = [Debug.checkDefined(visitNode(span.expression, visitor, isExpression))]; - if (span.literal.text.length > 0) { - args.push(factory2.createStringLiteral(span.literal.text)); - } - expression = factory2.createCallExpression( - factory2.createPropertyAccessExpression(expression, "concat"), - /*typeArguments*/ - void 0, - args - ); - } - return setTextRange(expression, node); - } - 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") { - hierarchyFacts |= 32768 /* NewTarget */; - return factory2.createUniqueName("_newTarget", 16 /* Optimistic */ | 32 /* FileLevel */); - } - return node; - } - function onEmitNode(hint, node, emitCallback) { - if (enabledSubstitutions & 1 /* CapturedThis */ && isFunctionLike(node)) { - const ancestorFacts = enterSubtree( - 32670 /* FunctionExcludes */, - getEmitFlags(node) & 16 /* CapturesThis */ ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */ : 65 /* FunctionIncludes */ - ); - previousOnEmitNode(hint, node, emitCallback); - exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); - return; - } - previousOnEmitNode(hint, node, emitCallback); - } - function enableSubstitutionsForBlockScopedBindings() { - if ((enabledSubstitutions & 2 /* BlockScopedBindings */) === 0) { - enabledSubstitutions |= 2 /* BlockScopedBindings */; - context.enableSubstitution(80 /* Identifier */); - } - } - function enableSubstitutionsForCapturedThis() { - if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { - enabledSubstitutions |= 1 /* CapturedThis */; - context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(177 /* Constructor */); - context.enableEmitNotification(175 /* MethodDeclaration */); - context.enableEmitNotification(178 /* GetAccessor */); - context.enableEmitNotification(179 /* SetAccessor */); - context.enableEmitNotification(220 /* ArrowFunction */); - context.enableEmitNotification(219 /* FunctionExpression */); - context.enableEmitNotification(263 /* FunctionDeclaration */); - } - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } - if (isIdentifier(node)) { - return substituteIdentifier(node); - } - return node; - } - function substituteIdentifier(node) { - if (enabledSubstitutions & 2 /* BlockScopedBindings */ && !isInternalName(node)) { - const original = getParseTreeNode(node, isIdentifier); - if (original && isNameOfDeclarationWithCollidingName(original)) { - return setTextRange(factory2.getGeneratedNameForNode(original), node); - } - } - return node; - } - function isNameOfDeclarationWithCollidingName(node) { - switch (node.parent.kind) { - case 209 /* BindingElement */: - case 264 /* ClassDeclaration */: - case 267 /* EnumDeclaration */: - case 261 /* VariableDeclaration */: - return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); - } - return false; - } - function substituteExpression(node) { - switch (node.kind) { - case 80 /* Identifier */: - return substituteExpressionIdentifier(node); - case 110 /* ThisKeyword */: - return substituteThisKeyword(node); - } - return node; - } - function substituteExpressionIdentifier(node) { - if (enabledSubstitutions & 2 /* BlockScopedBindings */ && !isInternalName(node)) { - const declaration = resolver.getReferencedDeclarationWithCollidingName(node); - if (declaration && !(isClassLike(declaration) && isPartOfClassBody(declaration, node))) { - return setTextRange(factory2.getGeneratedNameForNode(getNameOfDeclaration(declaration)), node); - } - } - return node; - } - function isPartOfClassBody(declaration, node) { - let currentNode = getParseTreeNode(node); - if (!currentNode || currentNode === declaration || currentNode.end <= declaration.pos || currentNode.pos >= declaration.end) { - return false; - } - const blockScope = getEnclosingBlockScopeContainer(declaration); - while (currentNode) { - if (currentNode === blockScope || currentNode === declaration) { - return false; - } - if (isClassElement(currentNode) && currentNode.parent === declaration) { - return true; - } - currentNode = currentNode.parent; - } - return false; - } - function substituteThisKeyword(node) { - if (enabledSubstitutions & 1 /* CapturedThis */ && hierarchyFacts & 16 /* CapturesThis */) { - return setTextRange(createCapturedThis(), node); - } - return node; - } - function getClassMemberPrefix(node, member) { - return isStatic(member) ? factory2.getInternalName(node) : factory2.createPropertyAccessExpression(factory2.getInternalName(node), "prototype"); - } - function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) { - if (!constructor || !hasExtendsClause) { - return false; - } - if (some(constructor.parameters)) { - return false; - } - const statement = firstOrUndefined(constructor.body.statements); - if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 245 /* ExpressionStatement */) { - return false; - } - const statementExpression = statement.expression; - if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 214 /* CallExpression */) { - return false; - } - const callTarget = statementExpression.expression; - if (!nodeIsSynthesized(callTarget) || callTarget.kind !== 108 /* SuperKeyword */) { - return false; - } - const callArgument = singleOrUndefined(statementExpression.arguments); - if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 231 /* SpreadElement */) { - return false; - } - const expression = callArgument.expression; - return isIdentifier(expression) && expression.escapedText === "arguments"; - } -} - -// src/compiler/transformers/generators.ts -function getInstructionName(instruction) { - switch (instruction) { - case 2 /* Return */: - return "return"; - case 3 /* Break */: - return "break"; - case 4 /* Yield */: - return "yield"; - case 5 /* YieldStar */: - return "yield*"; - case 7 /* Endfinally */: - return "endfinally"; - default: - return void 0; - } -} -function transformGenerators(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - resumeLexicalEnvironment, - endLexicalEnvironment, - hoistFunctionDeclaration, - hoistVariableDeclaration - } = context; - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const resolver = context.getEmitResolver(); - const previousOnSubstituteNode = context.onSubstituteNode; - context.onSubstituteNode = onSubstituteNode; - let renamedCatchVariables; - let renamedCatchVariableDeclarations; - let inGeneratorFunctionBody; - let inStatementContainingYield; - let blocks; - let blockOffsets; - let blockActions; - let blockStack; - let labelOffsets; - let labelExpressions; - let nextLabelId = 1; - let operations; - let operationArguments; - let operationLocations; - let state; - let blockIndex = 0; - let labelNumber = 0; - let labelNumbers; - let lastOperationWasAbrupt; - let lastOperationWasCompletion; - let clauses; - let statements; - let exceptionBlockStack; - let currentExceptionBlock; - let withBlockStack; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile || (node.transformFlags & 2048 /* ContainsGenerator */) === 0) { - return node; - } - const visited = visitEachChild(node, visitor, context); - addEmitHelpers(visited, context.readEmitHelpers()); - return visited; - } - function visitor(node) { - const transformFlags = node.transformFlags; - if (inStatementContainingYield) { - return visitJavaScriptInStatementContainingYield(node); - } else if (inGeneratorFunctionBody) { - return visitJavaScriptInGeneratorFunctionBody(node); - } else if (isFunctionLikeDeclaration(node) && node.asteriskToken) { - return visitGenerator(node); - } else if (transformFlags & 2048 /* ContainsGenerator */) { - return visitEachChild(node, visitor, context); - } else { - return node; - } - } - function visitJavaScriptInStatementContainingYield(node) { - switch (node.kind) { - case 247 /* DoStatement */: - return visitDoStatement(node); - case 248 /* WhileStatement */: - return visitWhileStatement(node); - case 256 /* SwitchStatement */: - return visitSwitchStatement(node); - case 257 /* LabeledStatement */: - return visitLabeledStatement(node); - default: - return visitJavaScriptInGeneratorFunctionBody(node); - } - } - function visitJavaScriptInGeneratorFunctionBody(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 219 /* FunctionExpression */: - return visitFunctionExpression(node); - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return visitAccessorDeclaration(node); - case 244 /* VariableStatement */: - return visitVariableStatement(node); - case 249 /* ForStatement */: - return visitForStatement(node); - case 250 /* ForInStatement */: - return visitForInStatement(node); - case 253 /* BreakStatement */: - return visitBreakStatement(node); - case 252 /* ContinueStatement */: - return visitContinueStatement(node); - case 254 /* ReturnStatement */: - return visitReturnStatement(node); - default: - if (node.transformFlags & 1048576 /* ContainsYield */) { - return visitJavaScriptContainingYield(node); - } else if (node.transformFlags & (2048 /* ContainsGenerator */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */)) { - return visitEachChild(node, visitor, context); - } else { - return node; - } - } - } - function visitJavaScriptContainingYield(node) { - switch (node.kind) { - case 227 /* BinaryExpression */: - return visitBinaryExpression(node); - case 357 /* CommaListExpression */: - return visitCommaListExpression(node); - case 228 /* ConditionalExpression */: - return visitConditionalExpression(node); - case 230 /* YieldExpression */: - return visitYieldExpression(node); - case 210 /* ArrayLiteralExpression */: - return visitArrayLiteralExpression(node); - case 211 /* ObjectLiteralExpression */: - return visitObjectLiteralExpression(node); - case 213 /* ElementAccessExpression */: - return visitElementAccessExpression(node); - case 214 /* CallExpression */: - return visitCallExpression(node); - case 215 /* NewExpression */: - return visitNewExpression(node); - default: - return visitEachChild(node, visitor, context); - } - } - function visitGenerator(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 219 /* FunctionExpression */: - return visitFunctionExpression(node); - default: - return Debug.failBadSyntaxKind(node); - } - } - function visitFunctionDeclaration(node) { - if (node.asteriskToken) { - node = setOriginalNode( - setTextRange( - factory2.createFunctionDeclaration( - node.modifiers, - /*asteriskToken*/ - void 0, - node.name, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - transformGeneratorFunctionBody(node.body) - ), - /*location*/ - node - ), - node - ); - } else { - const savedInGeneratorFunctionBody = inGeneratorFunctionBody; - const savedInStatementContainingYield = inStatementContainingYield; - inGeneratorFunctionBody = false; - inStatementContainingYield = false; - node = visitEachChild(node, visitor, context); - inGeneratorFunctionBody = savedInGeneratorFunctionBody; - inStatementContainingYield = savedInStatementContainingYield; - } - if (inGeneratorFunctionBody) { - hoistFunctionDeclaration(node); - return void 0; - } else { - return node; - } - } - function visitFunctionExpression(node) { - if (node.asteriskToken) { - node = setOriginalNode( - setTextRange( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - node.name, - /*typeParameters*/ - void 0, - visitParameterList(node.parameters, visitor, context), - /*type*/ - void 0, - transformGeneratorFunctionBody(node.body) - ), - /*location*/ - node - ), - node - ); - } else { - const savedInGeneratorFunctionBody = inGeneratorFunctionBody; - const savedInStatementContainingYield = inStatementContainingYield; - inGeneratorFunctionBody = false; - inStatementContainingYield = false; - node = visitEachChild(node, visitor, context); - inGeneratorFunctionBody = savedInGeneratorFunctionBody; - inStatementContainingYield = savedInStatementContainingYield; - } - return node; - } - function visitAccessorDeclaration(node) { - const savedInGeneratorFunctionBody = inGeneratorFunctionBody; - const savedInStatementContainingYield = inStatementContainingYield; - inGeneratorFunctionBody = false; - inStatementContainingYield = false; - node = visitEachChild(node, visitor, context); - inGeneratorFunctionBody = savedInGeneratorFunctionBody; - inStatementContainingYield = savedInStatementContainingYield; - return node; - } - function transformGeneratorFunctionBody(body) { - const statements2 = []; - const savedInGeneratorFunctionBody = inGeneratorFunctionBody; - const savedInStatementContainingYield = inStatementContainingYield; - const savedBlocks = blocks; - const savedBlockOffsets = blockOffsets; - const savedBlockActions = blockActions; - const savedBlockStack = blockStack; - const savedLabelOffsets = labelOffsets; - const savedLabelExpressions = labelExpressions; - const savedNextLabelId = nextLabelId; - const savedOperations = operations; - const savedOperationArguments = operationArguments; - const savedOperationLocations = operationLocations; - const savedState = state; - inGeneratorFunctionBody = true; - inStatementContainingYield = false; - blocks = void 0; - blockOffsets = void 0; - blockActions = void 0; - blockStack = void 0; - labelOffsets = void 0; - labelExpressions = void 0; - nextLabelId = 1; - operations = void 0; - operationArguments = void 0; - operationLocations = void 0; - state = factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - resumeLexicalEnvironment(); - const statementOffset = factory2.copyPrologue( - body.statements, - statements2, - /*ensureUseStrict*/ - false, - visitor - ); - transformAndEmitStatements(body.statements, statementOffset); - const buildResult = build2(); - insertStatementsAfterStandardPrologue(statements2, endLexicalEnvironment()); - statements2.push(factory2.createReturnStatement(buildResult)); - inGeneratorFunctionBody = savedInGeneratorFunctionBody; - inStatementContainingYield = savedInStatementContainingYield; - blocks = savedBlocks; - blockOffsets = savedBlockOffsets; - blockActions = savedBlockActions; - blockStack = savedBlockStack; - labelOffsets = savedLabelOffsets; - labelExpressions = savedLabelExpressions; - nextLabelId = savedNextLabelId; - operations = savedOperations; - operationArguments = savedOperationArguments; - operationLocations = savedOperationLocations; - state = savedState; - return setTextRange(factory2.createBlock(statements2, body.multiLine), body); - } - function visitVariableStatement(node) { - if (node.transformFlags & 1048576 /* ContainsYield */) { - transformAndEmitVariableDeclarationList(node.declarationList); - return void 0; - } else { - if (getEmitFlags(node) & 2097152 /* CustomPrologue */) { - return node; - } - for (const variable of node.declarationList.declarations) { - hoistVariableDeclaration(variable.name); - } - const variables = getInitializedVariables(node.declarationList); - if (variables.length === 0) { - return void 0; - } - return setSourceMapRange( - factory2.createExpressionStatement( - factory2.inlineExpressions( - map(variables, transformInitializedVariable) - ) - ), - node - ); - } - } - function visitBinaryExpression(node) { - const assoc = getExpressionAssociativity(node); - switch (assoc) { - case 0 /* Left */: - return visitLeftAssociativeBinaryExpression(node); - case 1 /* Right */: - return visitRightAssociativeBinaryExpression(node); - default: - return Debug.assertNever(assoc); - } - } - function visitRightAssociativeBinaryExpression(node) { - const { left, right } = node; - if (containsYield(right)) { - let target; - switch (left.kind) { - case 212 /* PropertyAccessExpression */: - target = factory2.updatePropertyAccessExpression( - left, - cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), - left.name - ); - break; - case 213 /* 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)); - break; - } - const operator = node.operatorToken.kind; - if (isCompoundAssignment(operator)) { - return setTextRange( - factory2.createAssignment( - target, - setTextRange( - factory2.createBinaryExpression( - cacheExpression(target), - getNonAssignmentOperatorForCompoundAssignment(operator), - Debug.checkDefined(visitNode(right, visitor, isExpression)) - ), - node - ) - ), - node - ); - } else { - return factory2.updateBinaryExpression(node, target, node.operatorToken, Debug.checkDefined(visitNode(right, visitor, isExpression))); - } - } - return visitEachChild(node, visitor, context); - } - function visitLeftAssociativeBinaryExpression(node) { - if (containsYield(node.right)) { - if (isLogicalOperator(node.operatorToken.kind)) { - return visitLogicalBinaryExpression(node); - } 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 visitEachChild(node, visitor, context); - } - function visitCommaExpression(node) { - let pendingExpressions = []; - visit(node.left); - visit(node.right); - return factory2.inlineExpressions(pendingExpressions); - function visit(node2) { - if (isBinaryExpression(node2) && node2.operatorToken.kind === 28 /* CommaToken */) { - visit(node2.left); - visit(node2.right); - } else { - if (containsYield(node2) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(Debug.checkDefined(visitNode(node2, visitor, isExpression))); - } - } - } - function visitCommaListExpression(node) { - let pendingExpressions = []; - for (const elem of node.elements) { - if (isBinaryExpression(elem) && elem.operatorToken.kind === 28 /* CommaToken */) { - pendingExpressions.push(visitCommaExpression(elem)); - } else { - if (containsYield(elem) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(Debug.checkDefined(visitNode(elem, visitor, isExpression))); - } - } - return factory2.inlineExpressions(pendingExpressions); - } - function visitLogicalBinaryExpression(node) { - const resultLabel = defineLabel(); - const resultLocal = declareLocal(); - emitAssignment( - resultLocal, - Debug.checkDefined(visitNode(node.left, visitor, isExpression)), - /*location*/ - node.left - ); - if (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */) { - emitBreakWhenFalse( - resultLabel, - resultLocal, - /*location*/ - node.left - ); - } else { - emitBreakWhenTrue( - resultLabel, - resultLocal, - /*location*/ - node.left - ); - } - emitAssignment( - resultLocal, - Debug.checkDefined(visitNode(node.right, visitor, isExpression)), - /*location*/ - node.right - ); - markLabel(resultLabel); - return resultLocal; - } - function visitConditionalExpression(node) { - if (containsYield(node.whenTrue) || containsYield(node.whenFalse)) { - const whenFalseLabel = defineLabel(); - const resultLabel = defineLabel(); - const resultLocal = declareLocal(); - emitBreakWhenFalse( - whenFalseLabel, - Debug.checkDefined(visitNode(node.condition, visitor, isExpression)), - /*location*/ - node.condition - ); - emitAssignment( - resultLocal, - Debug.checkDefined(visitNode(node.whenTrue, visitor, isExpression)), - /*location*/ - node.whenTrue - ); - emitBreak(resultLabel); - markLabel(whenFalseLabel); - emitAssignment( - resultLocal, - Debug.checkDefined(visitNode(node.whenFalse, visitor, isExpression)), - /*location*/ - node.whenFalse - ); - markLabel(resultLabel); - return resultLocal; - } - return visitEachChild(node, visitor, context); - } - function visitYieldExpression(node) { - const resumeLabel = defineLabel(); - const expression = visitNode(node.expression, visitor, isExpression); - if (node.asteriskToken) { - const iterator = (getEmitFlags(node.expression) & 8388608 /* Iterator */) === 0 ? setTextRange(emitHelpers().createValuesHelper(expression), node) : expression; - emitYieldStar( - iterator, - /*location*/ - node - ); - } else { - emitYield( - expression, - /*location*/ - node - ); - } - markLabel(resumeLabel); - return createGeneratorResume( - /*location*/ - node - ); - } - function visitArrayLiteralExpression(node) { - return visitElements( - node.elements, - /*leadingElement*/ - void 0, - /*location*/ - void 0, - node.multiLine - ); - } - function visitElements(elements, leadingElement, location, multiLine) { - const numInitialElements = countInitialNodesWithoutYield(elements); - let temp; - if (numInitialElements > 0) { - temp = declareLocal(); - const initialElements = visitNodes2(elements, visitor, isExpression, 0, numInitialElements); - emitAssignment( - temp, - factory2.createArrayLiteralExpression( - leadingElement ? [leadingElement, ...initialElements] : initialElements - ) - ); - leadingElement = void 0; - } - const expressions = reduceLeft(elements, reduceElement, [], numInitialElements); - return temp ? factory2.createArrayConcatCall(temp, [factory2.createArrayLiteralExpression(expressions, multiLine)]) : setTextRange( - factory2.createArrayLiteralExpression(leadingElement ? [leadingElement, ...expressions] : expressions, multiLine), - location - ); - function reduceElement(expressions2, element) { - if (containsYield(element) && expressions2.length > 0) { - const hasAssignedTemp = temp !== void 0; - if (!temp) { - temp = declareLocal(); - } - emitAssignment( - temp, - hasAssignedTemp ? factory2.createArrayConcatCall( - temp, - [factory2.createArrayLiteralExpression(expressions2, multiLine)] - ) : factory2.createArrayLiteralExpression( - leadingElement ? [leadingElement, ...expressions2] : expressions2, - multiLine - ) - ); - leadingElement = void 0; - expressions2 = []; - } - expressions2.push(Debug.checkDefined(visitNode(element, visitor, isExpression))); - return expressions2; - } - } - function visitObjectLiteralExpression(node) { - const properties = node.properties; - const multiLine = node.multiLine; - const numInitialProperties = countInitialNodesWithoutYield(properties); - const temp = declareLocal(); - emitAssignment( - temp, - factory2.createObjectLiteralExpression( - visitNodes2(properties, visitor, isObjectLiteralElementLike, 0, numInitialProperties), - multiLine - ) - ); - const expressions = reduceLeft(properties, reduceProperty, [], numInitialProperties); - expressions.push(multiLine ? startOnNewLine(setParent(setTextRange(factory2.cloneNode(temp), temp), temp.parent)) : temp); - return factory2.inlineExpressions(expressions); - function reduceProperty(expressions2, property) { - if (containsYield(property) && expressions2.length > 0) { - emitStatement(factory2.createExpressionStatement(factory2.inlineExpressions(expressions2))); - expressions2 = []; - } - const expression = createExpressionForObjectLiteralElementLike(factory2, node, property, temp); - const visited = visitNode(expression, visitor, isExpression); - if (visited) { - if (multiLine) { - startOnNewLine(visited); - } - expressions2.push(visited); - } - return expressions2; - } - } - 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 visitEachChild(node, visitor, context); - } - function visitCallExpression(node) { - if (!isImportCall(node) && forEach(node.arguments, containsYield)) { - const { target, thisArg } = factory2.createCallBinding( - node.expression, - hoistVariableDeclaration, - languageVersion, - /*cacheIdentifiers*/ - true - ); - return setOriginalNode( - setTextRange( - factory2.createFunctionApplyCall( - cacheExpression(Debug.checkDefined(visitNode(target, visitor, isLeftHandSideExpression))), - thisArg, - visitElements(node.arguments) - ), - node - ), - node - ); - } - return visitEachChild(node, visitor, context); - } - function visitNewExpression(node) { - if (forEach(node.arguments, containsYield)) { - const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); - return setOriginalNode( - setTextRange( - factory2.createNewExpression( - factory2.createFunctionApplyCall( - cacheExpression(Debug.checkDefined(visitNode(target, visitor, isExpression))), - thisArg, - visitElements( - node.arguments, - /*leadingElement*/ - factory2.createVoidZero() - ) - ), - /*typeArguments*/ - void 0, - [] - ), - node - ), - node - ); - } - return visitEachChild(node, visitor, context); - } - function transformAndEmitStatements(statements2, start = 0) { - const numStatements = statements2.length; - for (let i = start; i < numStatements; i++) { - transformAndEmitStatement(statements2[i]); - } - } - function transformAndEmitEmbeddedStatement(node) { - if (isBlock(node)) { - transformAndEmitStatements(node.statements); - } else { - transformAndEmitStatement(node); - } - } - function transformAndEmitStatement(node) { - const savedInStatementContainingYield = inStatementContainingYield; - if (!inStatementContainingYield) { - inStatementContainingYield = containsYield(node); - } - transformAndEmitStatementWorker(node); - inStatementContainingYield = savedInStatementContainingYield; - } - function transformAndEmitStatementWorker(node) { - switch (node.kind) { - case 242 /* Block */: - return transformAndEmitBlock(node); - case 245 /* ExpressionStatement */: - return transformAndEmitExpressionStatement(node); - case 246 /* IfStatement */: - return transformAndEmitIfStatement(node); - case 247 /* DoStatement */: - return transformAndEmitDoStatement(node); - case 248 /* WhileStatement */: - return transformAndEmitWhileStatement(node); - case 249 /* ForStatement */: - return transformAndEmitForStatement(node); - case 250 /* ForInStatement */: - return transformAndEmitForInStatement(node); - case 252 /* ContinueStatement */: - return transformAndEmitContinueStatement(node); - case 253 /* BreakStatement */: - return transformAndEmitBreakStatement(node); - case 254 /* ReturnStatement */: - return transformAndEmitReturnStatement(node); - case 255 /* WithStatement */: - return transformAndEmitWithStatement(node); - case 256 /* SwitchStatement */: - return transformAndEmitSwitchStatement(node); - case 257 /* LabeledStatement */: - return transformAndEmitLabeledStatement(node); - case 258 /* ThrowStatement */: - return transformAndEmitThrowStatement(node); - case 259 /* TryStatement */: - return transformAndEmitTryStatement(node); - default: - return emitStatement(visitNode(node, visitor, isStatement)); - } - } - function transformAndEmitBlock(node) { - if (containsYield(node)) { - transformAndEmitStatements(node.statements); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function transformAndEmitExpressionStatement(node) { - emitStatement(visitNode(node, visitor, isStatement)); - } - function transformAndEmitVariableDeclarationList(node) { - for (const variable of node.declarations) { - const name = factory2.cloneNode(variable.name); - setCommentRange(name, variable.name); - hoistVariableDeclaration(name); - } - const variables = getInitializedVariables(node); - const numVariables = variables.length; - let variablesWritten = 0; - let pendingExpressions = []; - while (variablesWritten < numVariables) { - for (let i = variablesWritten; i < numVariables; i++) { - const variable = variables[i]; - if (containsYield(variable.initializer) && pendingExpressions.length > 0) { - break; - } - pendingExpressions.push(transformInitializedVariable(variable)); - } - if (pendingExpressions.length) { - emitStatement(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); - variablesWritten += pendingExpressions.length; - pendingExpressions = []; - } - } - return void 0; - } - function transformInitializedVariable(node) { - return setSourceMapRange( - factory2.createAssignment( - setSourceMapRange(factory2.cloneNode(node.name), node.name), - Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) - ), - node - ); - } - function transformAndEmitIfStatement(node) { - if (containsYield(node)) { - if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { - const endLabel = defineLabel(); - const elseLabel = node.elseStatement ? defineLabel() : void 0; - emitBreakWhenFalse( - node.elseStatement ? elseLabel : endLabel, - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - /*location*/ - node.expression - ); - transformAndEmitEmbeddedStatement(node.thenStatement); - if (node.elseStatement) { - emitBreak(endLabel); - markLabel(elseLabel); - transformAndEmitEmbeddedStatement(node.elseStatement); - } - markLabel(endLabel); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function transformAndEmitDoStatement(node) { - if (containsYield(node)) { - const conditionLabel = defineLabel(); - const loopLabel = defineLabel(); - beginLoopBlock( - /*continueLabel*/ - conditionLabel - ); - markLabel(loopLabel); - transformAndEmitEmbeddedStatement(node.statement); - markLabel(conditionLabel); - emitBreakWhenTrue(loopLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); - endLoopBlock(); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function visitDoStatement(node) { - if (inStatementContainingYield) { - beginScriptLoopBlock(); - node = visitEachChild(node, visitor, context); - endLoopBlock(); - return node; - } else { - return visitEachChild(node, visitor, context); - } - } - function transformAndEmitWhileStatement(node) { - if (containsYield(node)) { - const loopLabel = defineLabel(); - const endLabel = beginLoopBlock(loopLabel); - markLabel(loopLabel); - emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); - transformAndEmitEmbeddedStatement(node.statement); - emitBreak(loopLabel); - endLoopBlock(); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function visitWhileStatement(node) { - if (inStatementContainingYield) { - beginScriptLoopBlock(); - node = visitEachChild(node, visitor, context); - endLoopBlock(); - return node; - } else { - return visitEachChild(node, visitor, context); - } - } - function transformAndEmitForStatement(node) { - if (containsYield(node)) { - const conditionLabel = defineLabel(); - const incrementLabel = defineLabel(); - const endLabel = beginLoopBlock(incrementLabel); - if (node.initializer) { - const initializer = node.initializer; - if (isVariableDeclarationList(initializer)) { - transformAndEmitVariableDeclarationList(initializer); - } else { - emitStatement( - setTextRange( - factory2.createExpressionStatement( - Debug.checkDefined(visitNode(initializer, visitor, isExpression)) - ), - initializer - ) - ); - } - } - markLabel(conditionLabel); - if (node.condition) { - emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))); - } - transformAndEmitEmbeddedStatement(node.statement); - markLabel(incrementLabel); - if (node.incrementor) { - emitStatement( - setTextRange( - factory2.createExpressionStatement( - Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression)) - ), - node.incrementor - ) - ); - } - emitBreak(conditionLabel); - endLoopBlock(); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function visitForStatement(node) { - if (inStatementContainingYield) { - beginScriptLoopBlock(); - } - const initializer = node.initializer; - if (initializer && isVariableDeclarationList(initializer)) { - for (const variable of initializer.declarations) { - hoistVariableDeclaration(variable.name); - } - const variables = getInitializedVariables(initializer); - node = factory2.updateForStatement( - node, - variables.length > 0 ? factory2.inlineExpressions(map(variables, transformInitializedVariable)) : void 0, - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, visitor, isExpression), - visitIterationBody(node.statement, visitor, context) - ); - } else { - node = visitEachChild(node, visitor, context); - } - if (inStatementContainingYield) { - endLoopBlock(); - } - return node; - } - function transformAndEmitForInStatement(node) { - if (containsYield(node)) { - const obj = declareLocal(); - const keysArray = declareLocal(); - const key = declareLocal(); - const keysIndex = factory2.createLoopVariable(); - const initializer = node.initializer; - hoistVariableDeclaration(keysIndex); - emitAssignment(obj, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); - emitAssignment(keysArray, factory2.createArrayLiteralExpression()); - emitStatement( - factory2.createForInStatement( - key, - obj, - factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createPropertyAccessExpression(keysArray, "push"), - /*typeArguments*/ - void 0, - [key] - ) - ) - ) - ); - emitAssignment(keysIndex, factory2.createNumericLiteral(0)); - const conditionLabel = defineLabel(); - const incrementLabel = defineLabel(); - const endLoopLabel = beginLoopBlock(incrementLabel); - markLabel(conditionLabel); - emitBreakWhenFalse(endLoopLabel, factory2.createLessThan(keysIndex, factory2.createPropertyAccessExpression(keysArray, "length"))); - emitAssignment(key, factory2.createElementAccessExpression(keysArray, keysIndex)); - emitBreakWhenFalse(incrementLabel, factory2.createBinaryExpression(key, 103 /* InKeyword */, obj)); - let variable; - if (isVariableDeclarationList(initializer)) { - for (const variable2 of initializer.declarations) { - hoistVariableDeclaration(variable2.name); - } - variable = factory2.cloneNode(initializer.declarations[0].name); - } else { - variable = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); - Debug.assert(isLeftHandSideExpression(variable)); - } - emitAssignment(variable, key); - transformAndEmitEmbeddedStatement(node.statement); - markLabel(incrementLabel); - emitStatement(factory2.createExpressionStatement(factory2.createPostfixIncrement(keysIndex))); - emitBreak(conditionLabel); - endLoopBlock(); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function visitForInStatement(node) { - if (inStatementContainingYield) { - beginScriptLoopBlock(); - } - const initializer = node.initializer; - if (isVariableDeclarationList(initializer)) { - 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))); - } else { - node = visitEachChild(node, visitor, context); - } - if (inStatementContainingYield) { - endLoopBlock(); - } - return node; - } - function transformAndEmitContinueStatement(node) { - const label = findContinueTarget(node.label ? idText(node.label) : void 0); - if (label > 0) { - emitBreak( - label, - /*location*/ - node - ); - } else { - emitStatement(node); - } - } - function visitContinueStatement(node) { - if (inStatementContainingYield) { - const label = findContinueTarget(node.label && idText(node.label)); - if (label > 0) { - return createInlineBreak( - label, - /*location*/ - node - ); - } - } - return visitEachChild(node, visitor, context); - } - function transformAndEmitBreakStatement(node) { - const label = findBreakTarget(node.label ? idText(node.label) : void 0); - if (label > 0) { - emitBreak( - label, - /*location*/ - node - ); - } else { - emitStatement(node); - } - } - function visitBreakStatement(node) { - if (inStatementContainingYield) { - const label = findBreakTarget(node.label && idText(node.label)); - if (label > 0) { - return createInlineBreak( - label, - /*location*/ - node - ); - } - } - return visitEachChild(node, visitor, context); - } - function transformAndEmitReturnStatement(node) { - emitReturn( - visitNode(node.expression, visitor, isExpression), - /*location*/ - node - ); - } - function visitReturnStatement(node) { - return createInlineReturn( - visitNode(node.expression, visitor, isExpression), - /*location*/ - node - ); - } - function transformAndEmitWithStatement(node) { - if (containsYield(node)) { - beginWithBlock(cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)))); - transformAndEmitEmbeddedStatement(node.statement); - endWithBlock(); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function transformAndEmitSwitchStatement(node) { - if (containsYield(node.caseBlock)) { - const caseBlock = node.caseBlock; - const numClauses = caseBlock.clauses.length; - const endLabel = beginSwitchBlock(); - const expression = cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); - const clauseLabels = []; - let defaultClauseIndex = -1; - for (let i = 0; i < numClauses; i++) { - const clause = caseBlock.clauses[i]; - clauseLabels.push(defineLabel()); - if (clause.kind === 298 /* DefaultClause */ && defaultClauseIndex === -1) { - defaultClauseIndex = i; - } - } - let clausesWritten = 0; - let pendingClauses = []; - while (clausesWritten < numClauses) { - let defaultClausesSkipped = 0; - for (let i = clausesWritten; i < numClauses; i++) { - const clause = caseBlock.clauses[i]; - if (clause.kind === 297 /* CaseClause */) { - if (containsYield(clause.expression) && pendingClauses.length > 0) { - break; - } - pendingClauses.push( - factory2.createCaseClause( - Debug.checkDefined(visitNode(clause.expression, visitor, isExpression)), - [ - createInlineBreak( - clauseLabels[i], - /*location*/ - clause.expression - ) - ] - ) - ); - } else { - defaultClausesSkipped++; - } - } - if (pendingClauses.length) { - emitStatement(factory2.createSwitchStatement(expression, factory2.createCaseBlock(pendingClauses))); - clausesWritten += pendingClauses.length; - pendingClauses = []; - } - if (defaultClausesSkipped > 0) { - clausesWritten += defaultClausesSkipped; - defaultClausesSkipped = 0; - } - } - if (defaultClauseIndex >= 0) { - emitBreak(clauseLabels[defaultClauseIndex]); - } else { - emitBreak(endLabel); - } - for (let i = 0; i < numClauses; i++) { - markLabel(clauseLabels[i]); - transformAndEmitStatements(caseBlock.clauses[i].statements); - } - endSwitchBlock(); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function visitSwitchStatement(node) { - if (inStatementContainingYield) { - beginScriptSwitchBlock(); - } - node = visitEachChild(node, visitor, context); - if (inStatementContainingYield) { - endSwitchBlock(); - } - return node; - } - function transformAndEmitLabeledStatement(node) { - if (containsYield(node)) { - beginLabeledBlock(idText(node.label)); - transformAndEmitEmbeddedStatement(node.statement); - endLabeledBlock(); - } else { - emitStatement(visitNode(node, visitor, isStatement)); - } - } - function visitLabeledStatement(node) { - if (inStatementContainingYield) { - beginScriptLabeledBlock(idText(node.label)); - } - node = visitEachChild(node, visitor, context); - if (inStatementContainingYield) { - endLabeledBlock(); - } - return node; - } - function transformAndEmitThrowStatement(node) { - emitThrow( - Debug.checkDefined(visitNode(node.expression ?? factory2.createVoidZero(), visitor, isExpression)), - /*location*/ - node - ); - } - function transformAndEmitTryStatement(node) { - if (containsYield(node)) { - beginExceptionBlock(); - transformAndEmitEmbeddedStatement(node.tryBlock); - if (node.catchClause) { - beginCatchBlock(node.catchClause.variableDeclaration); - transformAndEmitEmbeddedStatement(node.catchClause.block); - } - if (node.finallyBlock) { - beginFinallyBlock(); - transformAndEmitEmbeddedStatement(node.finallyBlock); - } - endExceptionBlock(); - } else { - emitStatement(visitEachChild(node, visitor, context)); - } - } - function containsYield(node) { - return !!node && (node.transformFlags & 1048576 /* ContainsYield */) !== 0; - } - function countInitialNodesWithoutYield(nodes) { - const numNodes = nodes.length; - for (let i = 0; i < numNodes; i++) { - if (containsYield(nodes[i])) { - return i; - } - } - return -1; - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } - return node; - } - function substituteExpression(node) { - if (isIdentifier(node)) { - return substituteExpressionIdentifier(node); - } - return node; - } - function substituteExpressionIdentifier(node) { - if (!isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(idText(node))) { - const original = getOriginalNode(node); - if (isIdentifier(original) && original.parent) { - const declaration = resolver.getReferencedValueDeclaration(original); - if (declaration) { - const name = renamedCatchVariableDeclarations[getOriginalNodeId(declaration)]; - if (name) { - const clone2 = setParent(setTextRange(factory2.cloneNode(name), name), name.parent); - setSourceMapRange(clone2, node); - setCommentRange(clone2, node); - return clone2; - } - } - } - } - return node; - } - function cacheExpression(node) { - if (isGeneratedIdentifier(node) || getEmitFlags(node) & 8192 /* HelperName */) { - return node; - } - const temp = factory2.createTempVariable(hoistVariableDeclaration); - emitAssignment( - temp, - node, - /*location*/ - node - ); - return temp; - } - function declareLocal(name) { - const temp = name ? factory2.createUniqueName(name) : factory2.createTempVariable( - /*recordTempVariable*/ - void 0 - ); - hoistVariableDeclaration(temp); - return temp; - } - function defineLabel() { - if (!labelOffsets) { - labelOffsets = []; - } - const label = nextLabelId; - nextLabelId++; - labelOffsets[label] = -1; - return label; - } - function markLabel(label) { - Debug.assert(labelOffsets !== void 0, "No labels were defined."); - labelOffsets[label] = operations ? operations.length : 0; - } - function beginBlock(block) { - if (!blocks) { - blocks = []; - blockActions = []; - blockOffsets = []; - blockStack = []; - } - const index = blockActions.length; - blockActions[index] = 0 /* Open */; - blockOffsets[index] = operations ? operations.length : 0; - blocks[index] = block; - blockStack.push(block); - return index; - } - function endBlock() { - const block = peekBlock(); - if (block === void 0) return Debug.fail("beginBlock was never called."); - const index = blockActions.length; - blockActions[index] = 1 /* Close */; - blockOffsets[index] = operations ? operations.length : 0; - blocks[index] = block; - blockStack.pop(); - return block; - } - function peekBlock() { - return lastOrUndefined(blockStack); - } - function peekBlockKind() { - const block = peekBlock(); - return block && block.kind; - } - function beginWithBlock(expression) { - const startLabel = defineLabel(); - const endLabel = defineLabel(); - markLabel(startLabel); - beginBlock({ - kind: 1 /* With */, - expression, - startLabel, - endLabel - }); - } - function endWithBlock() { - Debug.assert(peekBlockKind() === 1 /* With */); - const block = endBlock(); - markLabel(block.endLabel); - } - function beginExceptionBlock() { - const startLabel = defineLabel(); - const endLabel = defineLabel(); - markLabel(startLabel); - beginBlock({ - kind: 0 /* Exception */, - state: 0 /* Try */, - startLabel, - endLabel - }); - emitNop(); - return endLabel; - } - function beginCatchBlock(variable) { - Debug.assert(peekBlockKind() === 0 /* Exception */); - let name; - if (isGeneratedIdentifier(variable.name)) { - name = variable.name; - hoistVariableDeclaration(variable.name); - } else { - const text = idText(variable.name); - name = declareLocal(text); - if (!renamedCatchVariables) { - renamedCatchVariables = /* @__PURE__ */ new Map(); - renamedCatchVariableDeclarations = []; - context.enableSubstitution(80 /* Identifier */); - } - renamedCatchVariables.set(text, true); - renamedCatchVariableDeclarations[getOriginalNodeId(variable)] = name; - } - const exception = peekBlock(); - Debug.assert(exception.state < 1 /* Catch */); - const endLabel = exception.endLabel; - emitBreak(endLabel); - const catchLabel = defineLabel(); - markLabel(catchLabel); - exception.state = 1 /* Catch */; - exception.catchVariable = name; - exception.catchLabel = catchLabel; - emitAssignment(name, factory2.createCallExpression( - factory2.createPropertyAccessExpression(state, "sent"), - /*typeArguments*/ - void 0, - [] - )); - emitNop(); - } - function beginFinallyBlock() { - Debug.assert(peekBlockKind() === 0 /* Exception */); - const exception = peekBlock(); - Debug.assert(exception.state < 2 /* Finally */); - const endLabel = exception.endLabel; - emitBreak(endLabel); - const finallyLabel = defineLabel(); - markLabel(finallyLabel); - exception.state = 2 /* Finally */; - exception.finallyLabel = finallyLabel; - } - function endExceptionBlock() { - Debug.assert(peekBlockKind() === 0 /* Exception */); - const exception = endBlock(); - const state2 = exception.state; - if (state2 < 2 /* Finally */) { - emitBreak(exception.endLabel); - } else { - emitEndfinally(); - } - markLabel(exception.endLabel); - emitNop(); - exception.state = 3 /* Done */; - } - function beginScriptLoopBlock() { - beginBlock({ - kind: 3 /* Loop */, - isScript: true, - breakLabel: -1, - continueLabel: -1 - }); - } - function beginLoopBlock(continueLabel) { - const breakLabel = defineLabel(); - beginBlock({ - kind: 3 /* Loop */, - isScript: false, - breakLabel, - continueLabel - }); - return breakLabel; - } - function endLoopBlock() { - Debug.assert(peekBlockKind() === 3 /* Loop */); - const block = endBlock(); - const breakLabel = block.breakLabel; - if (!block.isScript) { - markLabel(breakLabel); - } - } - function beginScriptSwitchBlock() { - beginBlock({ - kind: 2 /* Switch */, - isScript: true, - breakLabel: -1 - }); - } - function beginSwitchBlock() { - const breakLabel = defineLabel(); - beginBlock({ - kind: 2 /* Switch */, - isScript: false, - breakLabel - }); - return breakLabel; - } - function endSwitchBlock() { - Debug.assert(peekBlockKind() === 2 /* Switch */); - const block = endBlock(); - const breakLabel = block.breakLabel; - if (!block.isScript) { - markLabel(breakLabel); - } - } - function beginScriptLabeledBlock(labelText) { - beginBlock({ - kind: 4 /* Labeled */, - isScript: true, - labelText, - breakLabel: -1 - }); - } - function beginLabeledBlock(labelText) { - const breakLabel = defineLabel(); - beginBlock({ - kind: 4 /* Labeled */, - isScript: false, - labelText, - breakLabel - }); - } - function endLabeledBlock() { - Debug.assert(peekBlockKind() === 4 /* Labeled */); - const block = endBlock(); - if (!block.isScript) { - markLabel(block.breakLabel); - } - } - function supportsUnlabeledBreak(block) { - return block.kind === 2 /* Switch */ || block.kind === 3 /* Loop */; - } - function supportsLabeledBreakOrContinue(block) { - return block.kind === 4 /* Labeled */; - } - function supportsUnlabeledContinue(block) { - return block.kind === 3 /* Loop */; - } - function hasImmediateContainingLabeledBlock(labelText, start) { - for (let j = start; j >= 0; j--) { - const containingBlock = blockStack[j]; - if (supportsLabeledBreakOrContinue(containingBlock)) { - if (containingBlock.labelText === labelText) { - return true; - } - } else { - break; - } - } - return false; - } - function findBreakTarget(labelText) { - if (blockStack) { - if (labelText) { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { - return block.breakLabel; - } else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.breakLabel; - } - } - } else { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsUnlabeledBreak(block)) { - return block.breakLabel; - } - } - } - } - return 0; - } - function findContinueTarget(labelText) { - if (blockStack) { - if (labelText) { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.continueLabel; - } - } - } else { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsUnlabeledContinue(block)) { - return block.continueLabel; - } - } - } - } - return 0; - } - function createLabel(label) { - if (label !== void 0 && label > 0) { - if (labelExpressions === void 0) { - labelExpressions = []; - } - const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER); - if (labelExpressions[label] === void 0) { - labelExpressions[label] = [expression]; - } else { - labelExpressions[label].push(expression); - } - return expression; - } - return factory2.createOmittedExpression(); - } - function createInstruction(instruction) { - const literal = factory2.createNumericLiteral(instruction); - addSyntheticTrailingComment(literal, 3 /* MultiLineCommentTrivia */, getInstructionName(instruction)); - return literal; - } - function createInlineBreak(label, location) { - Debug.assertLessThan(0, label, "Invalid label"); - return setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression([ - createInstruction(3 /* Break */), - createLabel(label) - ]) - ), - location - ); - } - function createInlineReturn(expression, location) { - return setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression( - expression ? [createInstruction(2 /* Return */), expression] : [createInstruction(2 /* Return */)] - ) - ), - location - ); - } - function createGeneratorResume(location) { - return setTextRange( - factory2.createCallExpression( - factory2.createPropertyAccessExpression(state, "sent"), - /*typeArguments*/ - void 0, - [] - ), - location - ); - } - function emitNop() { - emitWorker(0 /* Nop */); - } - function emitStatement(node) { - if (node) { - emitWorker(1 /* Statement */, [node]); - } else { - emitNop(); - } - } - function emitAssignment(left, right, location) { - emitWorker(2 /* Assign */, [left, right], location); - } - function emitBreak(label, location) { - emitWorker(3 /* Break */, [label], location); - } - function emitBreakWhenTrue(label, condition, location) { - emitWorker(4 /* BreakWhenTrue */, [label, condition], location); - } - function emitBreakWhenFalse(label, condition, location) { - emitWorker(5 /* BreakWhenFalse */, [label, condition], location); - } - function emitYieldStar(expression, location) { - emitWorker(7 /* YieldStar */, [expression], location); - } - function emitYield(expression, location) { - emitWorker(6 /* Yield */, [expression], location); - } - function emitReturn(expression, location) { - emitWorker(8 /* Return */, [expression], location); - } - function emitThrow(expression, location) { - emitWorker(9 /* Throw */, [expression], location); - } - function emitEndfinally() { - emitWorker(10 /* Endfinally */); - } - function emitWorker(code, args, location) { - if (operations === void 0) { - operations = []; - operationArguments = []; - operationLocations = []; - } - if (labelOffsets === void 0) { - markLabel(defineLabel()); - } - const operationIndex = operations.length; - operations[operationIndex] = code; - operationArguments[operationIndex] = args; - operationLocations[operationIndex] = location; - } - function build2() { - blockIndex = 0; - labelNumber = 0; - labelNumbers = void 0; - lastOperationWasAbrupt = false; - lastOperationWasCompletion = false; - clauses = void 0; - statements = void 0; - exceptionBlockStack = void 0; - currentExceptionBlock = void 0; - withBlockStack = void 0; - const buildResult = buildStatements(); - return emitHelpers().createGeneratorHelper( - setEmitFlags( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - state - )], - /*type*/ - void 0, - factory2.createBlock( - buildResult, - /*multiLine*/ - buildResult.length > 0 - ) - ), - 1048576 /* ReuseTempVariableScope */ - ) - ); - } - function buildStatements() { - if (operations) { - for (let operationIndex = 0; operationIndex < operations.length; operationIndex++) { - writeOperation(operationIndex); - } - flushFinalLabel(operations.length); - } else { - flushFinalLabel(0); - } - if (clauses) { - const labelExpression = factory2.createPropertyAccessExpression(state, "label"); - const switchStatement = factory2.createSwitchStatement(labelExpression, factory2.createCaseBlock(clauses)); - return [startOnNewLine(switchStatement)]; - } - if (statements) { - return statements; - } - return []; - } - function flushLabel() { - if (!statements) { - return; - } - appendLabel( - /*markLabelEnd*/ - !lastOperationWasAbrupt - ); - lastOperationWasAbrupt = false; - lastOperationWasCompletion = false; - labelNumber++; - } - function flushFinalLabel(operationIndex) { - if (isFinalLabelReachable(operationIndex)) { - tryEnterLabel(operationIndex); - withBlockStack = void 0; - writeReturn( - /*expression*/ - void 0, - /*operationLocation*/ - void 0 - ); - } - if (statements && clauses) { - appendLabel( - /*markLabelEnd*/ - false - ); - } - updateLabelExpressions(); - } - function isFinalLabelReachable(operationIndex) { - if (!lastOperationWasCompletion) { - return true; - } - if (!labelOffsets || !labelExpressions) { - return false; - } - for (let label = 0; label < labelOffsets.length; label++) { - if (labelOffsets[label] === operationIndex && labelExpressions[label]) { - return true; - } - } - return false; - } - function appendLabel(markLabelEnd) { - if (!clauses) { - clauses = []; - } - if (statements) { - if (withBlockStack) { - for (let i = withBlockStack.length - 1; i >= 0; i--) { - const withBlock = withBlockStack[i]; - statements = [factory2.createWithStatement(withBlock.expression, factory2.createBlock(statements))]; - } - } - if (currentExceptionBlock) { - const { startLabel, catchLabel, finallyLabel, endLabel } = currentExceptionBlock; - statements.unshift( - factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createPropertyAccessExpression(factory2.createPropertyAccessExpression(state, "trys"), "push"), - /*typeArguments*/ - void 0, - [ - factory2.createArrayLiteralExpression([ - createLabel(startLabel), - createLabel(catchLabel), - createLabel(finallyLabel), - createLabel(endLabel) - ]) - ] - ) - ) - ); - currentExceptionBlock = void 0; - } - if (markLabelEnd) { - statements.push( - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.createPropertyAccessExpression(state, "label"), - factory2.createNumericLiteral(labelNumber + 1) - ) - ) - ); - } - } - clauses.push( - factory2.createCaseClause( - factory2.createNumericLiteral(labelNumber), - statements || [] - ) - ); - statements = void 0; - } - function tryEnterLabel(operationIndex) { - if (!labelOffsets) { - return; - } - for (let label = 0; label < labelOffsets.length; label++) { - if (labelOffsets[label] === operationIndex) { - flushLabel(); - if (labelNumbers === void 0) { - labelNumbers = []; - } - if (labelNumbers[labelNumber] === void 0) { - labelNumbers[labelNumber] = [label]; - } else { - labelNumbers[labelNumber].push(label); - } - } - } - } - function updateLabelExpressions() { - if (labelExpressions !== void 0 && labelNumbers !== void 0) { - for (let labelNumber2 = 0; labelNumber2 < labelNumbers.length; labelNumber2++) { - const labels = labelNumbers[labelNumber2]; - if (labels !== void 0) { - for (const label of labels) { - const expressions = labelExpressions[label]; - if (expressions !== void 0) { - for (const expression of expressions) { - expression.text = String(labelNumber2); - } - } - } - } - } - } - } - function tryEnterOrLeaveBlock(operationIndex) { - if (blocks) { - for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { - const block = blocks[blockIndex]; - const blockAction = blockActions[blockIndex]; - switch (block.kind) { - case 0 /* Exception */: - if (blockAction === 0 /* Open */) { - if (!exceptionBlockStack) { - exceptionBlockStack = []; - } - if (!statements) { - statements = []; - } - exceptionBlockStack.push(currentExceptionBlock); - currentExceptionBlock = block; - } else if (blockAction === 1 /* Close */) { - currentExceptionBlock = exceptionBlockStack.pop(); - } - break; - case 1 /* With */: - if (blockAction === 0 /* Open */) { - if (!withBlockStack) { - withBlockStack = []; - } - withBlockStack.push(block); - } else if (blockAction === 1 /* Close */) { - withBlockStack.pop(); - } - break; - } - } - } - } - function writeOperation(operationIndex) { - tryEnterLabel(operationIndex); - tryEnterOrLeaveBlock(operationIndex); - if (lastOperationWasAbrupt) { - return; - } - lastOperationWasAbrupt = false; - lastOperationWasCompletion = false; - const opcode = operations[operationIndex]; - if (opcode === 0 /* Nop */) { - return; - } else if (opcode === 10 /* Endfinally */) { - return writeEndfinally(); - } - const args = operationArguments[operationIndex]; - if (opcode === 1 /* Statement */) { - return writeStatement(args[0]); - } - const location = operationLocations[operationIndex]; - switch (opcode) { - case 2 /* Assign */: - return writeAssign(args[0], args[1], location); - case 3 /* Break */: - return writeBreak(args[0], location); - case 4 /* BreakWhenTrue */: - return writeBreakWhenTrue(args[0], args[1], location); - case 5 /* BreakWhenFalse */: - return writeBreakWhenFalse(args[0], args[1], location); - case 6 /* Yield */: - return writeYield(args[0], location); - case 7 /* YieldStar */: - return writeYieldStar(args[0], location); - case 8 /* Return */: - return writeReturn(args[0], location); - case 9 /* Throw */: - return writeThrow(args[0], location); - } - } - function writeStatement(statement) { - if (statement) { - if (!statements) { - statements = [statement]; - } else { - statements.push(statement); - } - } - } - function writeAssign(left, right, operationLocation) { - writeStatement(setTextRange(factory2.createExpressionStatement(factory2.createAssignment(left, right)), operationLocation)); - } - function writeThrow(expression, operationLocation) { - lastOperationWasAbrupt = true; - lastOperationWasCompletion = true; - writeStatement(setTextRange(factory2.createThrowStatement(expression), operationLocation)); - } - function writeReturn(expression, operationLocation) { - lastOperationWasAbrupt = true; - lastOperationWasCompletion = true; - writeStatement( - setEmitFlags( - setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression( - expression ? [createInstruction(2 /* Return */), expression] : [createInstruction(2 /* Return */)] - ) - ), - operationLocation - ), - 768 /* NoTokenSourceMaps */ - ) - ); - } - function writeBreak(label, operationLocation) { - lastOperationWasAbrupt = true; - writeStatement( - setEmitFlags( - setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression([ - createInstruction(3 /* Break */), - createLabel(label) - ]) - ), - operationLocation - ), - 768 /* NoTokenSourceMaps */ - ) - ); - } - function writeBreakWhenTrue(label, condition, operationLocation) { - writeStatement( - setEmitFlags( - factory2.createIfStatement( - condition, - setEmitFlags( - setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression([ - createInstruction(3 /* Break */), - createLabel(label) - ]) - ), - operationLocation - ), - 768 /* NoTokenSourceMaps */ - ) - ), - 1 /* SingleLine */ - ) - ); - } - function writeBreakWhenFalse(label, condition, operationLocation) { - writeStatement( - setEmitFlags( - factory2.createIfStatement( - factory2.createLogicalNot(condition), - setEmitFlags( - setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression([ - createInstruction(3 /* Break */), - createLabel(label) - ]) - ), - operationLocation - ), - 768 /* NoTokenSourceMaps */ - ) - ), - 1 /* SingleLine */ - ) - ); - } - function writeYield(expression, operationLocation) { - lastOperationWasAbrupt = true; - writeStatement( - setEmitFlags( - setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression( - expression ? [createInstruction(4 /* Yield */), expression] : [createInstruction(4 /* Yield */)] - ) - ), - operationLocation - ), - 768 /* NoTokenSourceMaps */ - ) - ); - } - function writeYieldStar(expression, operationLocation) { - lastOperationWasAbrupt = true; - writeStatement( - setEmitFlags( - setTextRange( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression([ - createInstruction(5 /* YieldStar */), - expression - ]) - ), - operationLocation - ), - 768 /* NoTokenSourceMaps */ - ) - ); - } - function writeEndfinally() { - lastOperationWasAbrupt = true; - writeStatement( - factory2.createReturnStatement( - factory2.createArrayLiteralExpression([ - createInstruction(7 /* Endfinally */) - ]) - ) - ); - } -} - -// src/compiler/transformers/module/module.ts -function transformModule(context) { - function getTransformModuleDelegate(moduleKind2) { - switch (moduleKind2) { - case 2 /* AMD */: - return transformAMDModule; - case 3 /* UMD */: - return transformUMDModule; - default: - return transformCommonJSModule; - } - } - const { - factory: factory2, - getEmitHelperFactory: emitHelpers, - startLexicalEnvironment, - endLexicalEnvironment, - hoistVariableDeclaration - } = context; - const compilerOptions = context.getCompilerOptions(); - const resolver = context.getEmitResolver(); - const host = context.getEmitHost(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); - const previousOnSubstituteNode = context.onSubstituteNode; - const previousOnEmitNode = context.onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.onEmitNode = onEmitNode; - context.enableSubstitution(214 /* CallExpression */); - context.enableSubstitution(216 /* TaggedTemplateExpression */); - context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(227 /* BinaryExpression */); - context.enableSubstitution(305 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(308 /* SourceFile */); - const moduleInfoMap = []; - let currentSourceFile; - let currentModuleInfo; - let importsAndRequiresToRewriteOrShim; - const noSubstitution = []; - let needUMDDynamicImportHelper; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile || !(isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 8388608 /* ContainsDynamicImport */ || isJsonSourceFile(node) && hasJsonModuleEmitEnabled(compilerOptions) && compilerOptions.outFile)) { - return node; - } - currentSourceFile = node; - currentModuleInfo = collectExternalModuleInfo(context, node); - moduleInfoMap[getOriginalNodeId(node)] = currentModuleInfo; - if (compilerOptions.rewriteRelativeImportExtensions) { - forEachDynamicImportOrRequireCall( - node, - /*includeTypeSpaceImports*/ - false, - /*requireStringLiteralLikeArgument*/ - false, - (node2) => { - if (!isStringLiteralLike(node2.arguments[0]) || shouldRewriteModuleSpecifier(node2.arguments[0].text, compilerOptions)) { - importsAndRequiresToRewriteOrShim = append(importsAndRequiresToRewriteOrShim, node2); - } - } - ); - } - const transformModule2 = getTransformModuleDelegate(moduleKind); - const updated = transformModule2(node); - currentSourceFile = void 0; - currentModuleInfo = void 0; - needUMDDynamicImportHelper = false; - return updated; - } - function shouldEmitUnderscoreUnderscoreESModule() { - if (hasJSFileExtension(currentSourceFile.fileName) && currentSourceFile.commonJsModuleIndicator && (!currentSourceFile.externalModuleIndicator || currentSourceFile.externalModuleIndicator === true)) { - return false; - } - if (!currentModuleInfo.exportEquals && isExternalModule(currentSourceFile)) { - return true; - } - return false; - } - function transformCommonJSModule(node) { - startLexicalEnvironment(); - const statements = []; - const ensureUseStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") || isExternalModule(currentSourceFile); - const statementOffset = factory2.copyPrologue(node.statements, statements, ensureUseStrict && !isJsonSourceFile(node), topLevelVisitor); - if (shouldEmitUnderscoreUnderscoreESModule()) { - append(statements, createUnderscoreUnderscoreESModule()); - } - if (some(currentModuleInfo.exportedNames)) { - const chunkSize = 50; - for (let i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) { - append( - statements, - factory2.createExpressionStatement( - reduceLeft( - currentModuleInfo.exportedNames.slice(i, i + chunkSize), - (prev, nextId) => nextId.kind === 11 /* StringLiteral */ ? factory2.createAssignment(factory2.createElementAccessExpression(factory2.createIdentifier("exports"), factory2.createStringLiteral(nextId.text)), prev) : factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), - factory2.createVoidZero() - ) - ) - ); - } - } - for (const f of currentModuleInfo.exportedFunctions) { - appendExportsOfHoistedDeclaration(statements, f); - } - append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement)); - addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset)); - addExportEqualsIfNeeded( - statements, - /*emitAsReturn*/ - false - ); - insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); - const updated = factory2.updateSourceFile(node, setTextRange(factory2.createNodeArray(statements), node.statements)); - addEmitHelpers(updated, context.readEmitHelpers()); - return updated; - } - function transformAMDModule(node) { - const define = factory2.createIdentifier("define"); - const moduleName = tryGetModuleNameFromFile(factory2, node, host, compilerOptions); - const jsonSourceFile = isJsonSourceFile(node) && node; - const { aliasedModuleNames, unaliasedModuleNames, importAliasNames } = collectAsynchronousDependencies( - node, - /*includeNonAmdDependencies*/ - true - ); - const updated = factory2.updateSourceFile( - node, - setTextRange( - factory2.createNodeArray([ - factory2.createExpressionStatement( - factory2.createCallExpression( - define, - /*typeArguments*/ - void 0, - [ - // Add the module name (if provided). - ...moduleName ? [moduleName] : [], - // Add the dependency array argument: - // - // ["require", "exports", module1", "module2", ...] - factory2.createArrayLiteralExpression( - jsonSourceFile ? emptyArray : [ - factory2.createStringLiteral("require"), - factory2.createStringLiteral("exports"), - ...aliasedModuleNames, - ...unaliasedModuleNames - ] - ), - // Add the module body function argument: - // - // function (require, exports, module1, module2) ... - jsonSourceFile ? jsonSourceFile.statements.length ? jsonSourceFile.statements[0].expression : factory2.createObjectLiteralExpression() : factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [ - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "require" - ), - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "exports" - ), - ...importAliasNames - ], - /*type*/ - void 0, - transformAsynchronousModuleBody(node) - ) - ] - ) - ) - ]), - /*location*/ - node.statements - ) - ); - addEmitHelpers(updated, context.readEmitHelpers()); - return updated; - } - function transformUMDModule(node) { - const { aliasedModuleNames, unaliasedModuleNames, importAliasNames } = collectAsynchronousDependencies( - node, - /*includeNonAmdDependencies*/ - false - ); - const moduleName = tryGetModuleNameFromFile(factory2, node, host, compilerOptions); - const umdHeader = factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "factory" - )], - /*type*/ - void 0, - setTextRange( - factory2.createBlock( - [ - factory2.createIfStatement( - factory2.createLogicalAnd( - factory2.createTypeCheck(factory2.createIdentifier("module"), "object"), - factory2.createTypeCheck(factory2.createPropertyAccessExpression(factory2.createIdentifier("module"), "exports"), "object") - ), - factory2.createBlock([ - factory2.createVariableStatement( - /*modifiers*/ - void 0, - [ - factory2.createVariableDeclaration( - "v", - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createCallExpression( - factory2.createIdentifier("factory"), - /*typeArguments*/ - void 0, - [ - factory2.createIdentifier("require"), - factory2.createIdentifier("exports") - ] - ) - ) - ] - ), - setEmitFlags( - factory2.createIfStatement( - factory2.createStrictInequality( - factory2.createIdentifier("v"), - factory2.createIdentifier("undefined") - ), - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.createPropertyAccessExpression(factory2.createIdentifier("module"), "exports"), - factory2.createIdentifier("v") - ) - ) - ), - 1 /* SingleLine */ - ) - ]), - factory2.createIfStatement( - factory2.createLogicalAnd( - factory2.createTypeCheck(factory2.createIdentifier("define"), "function"), - factory2.createPropertyAccessExpression(factory2.createIdentifier("define"), "amd") - ), - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createIdentifier("define"), - /*typeArguments*/ - void 0, - [ - // Add the module name (if provided). - ...moduleName ? [moduleName] : [], - factory2.createArrayLiteralExpression([ - factory2.createStringLiteral("require"), - factory2.createStringLiteral("exports"), - ...aliasedModuleNames, - ...unaliasedModuleNames - ]), - factory2.createIdentifier("factory") - ] - ) - ) - ]) - ) - ) - ], - /*multiLine*/ - true - ), - /*location*/ - void 0 - ) - ); - const updated = factory2.updateSourceFile( - node, - setTextRange( - factory2.createNodeArray([ - factory2.createExpressionStatement( - factory2.createCallExpression( - umdHeader, - /*typeArguments*/ - void 0, - [ - // Add the module body function argument: - // - // function (require, exports) ... - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [ - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "require" - ), - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "exports" - ), - ...importAliasNames - ], - /*type*/ - void 0, - transformAsynchronousModuleBody(node) - ) - ] - ) - ) - ]), - /*location*/ - node.statements - ) - ); - addEmitHelpers(updated, context.readEmitHelpers()); - return updated; - } - function collectAsynchronousDependencies(node, includeNonAmdDependencies) { - const aliasedModuleNames = []; - const unaliasedModuleNames = []; - const importAliasNames = []; - for (const amdDependency of node.amdDependencies) { - if (amdDependency.name) { - aliasedModuleNames.push(factory2.createStringLiteral(amdDependency.path)); - importAliasNames.push(factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - amdDependency.name - )); - } else { - unaliasedModuleNames.push(factory2.createStringLiteral(amdDependency.path)); - } - } - for (const importNode of currentModuleInfo.externalImports) { - const externalModuleName = getExternalModuleNameLiteral(factory2, importNode, currentSourceFile, host, resolver, compilerOptions); - const importAliasName = getLocalNameForExternalImport(factory2, importNode, currentSourceFile); - if (externalModuleName) { - if (includeNonAmdDependencies && importAliasName) { - setEmitFlags(importAliasName, 8 /* NoSubstitution */); - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - importAliasName - )); - } else { - unaliasedModuleNames.push(externalModuleName); - } - } - } - return { aliasedModuleNames, unaliasedModuleNames, importAliasNames }; - } - function getAMDImportExpressionForImport(node) { - if (isImportEqualsDeclaration(node) || isExportDeclaration(node) || !getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions)) { - return void 0; - } - const name = getLocalNameForExternalImport(factory2, node, currentSourceFile); - const expr = getHelperExpressionForImport(node, name); - if (expr === name) { - return void 0; - } - return factory2.createExpressionStatement(factory2.createAssignment(name, expr)); - } - function transformAsynchronousModuleBody(node) { - startLexicalEnvironment(); - const statements = []; - const statementOffset = factory2.copyPrologue( - node.statements, - statements, - /*ensureUseStrict*/ - true, - topLevelVisitor - ); - if (shouldEmitUnderscoreUnderscoreESModule()) { - append(statements, createUnderscoreUnderscoreESModule()); - } - if (some(currentModuleInfo.exportedNames)) { - append( - statements, - factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => nextId.kind === 11 /* StringLiteral */ ? factory2.createAssignment(factory2.createElementAccessExpression(factory2.createIdentifier("exports"), factory2.createStringLiteral(nextId.text)), prev) : factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())) - ); - } - for (const f of currentModuleInfo.exportedFunctions) { - appendExportsOfHoistedDeclaration(statements, f); - } - append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement)); - if (moduleKind === 2 /* AMD */) { - addRange(statements, mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); - } - addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset)); - addExportEqualsIfNeeded( - statements, - /*emitAsReturn*/ - true - ); - insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); - const body = factory2.createBlock( - statements, - /*multiLine*/ - true - ); - if (needUMDDynamicImportHelper) { - addEmitHelper(body, dynamicImportUMDHelper); - } - return body; - } - function addExportEqualsIfNeeded(statements, emitAsReturn) { - if (currentModuleInfo.exportEquals) { - const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor, isExpression); - if (expressionResult) { - if (emitAsReturn) { - const statement = factory2.createReturnStatement(expressionResult); - setTextRange(statement, currentModuleInfo.exportEquals); - setEmitFlags(statement, 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */); - statements.push(statement); - } else { - const statement = factory2.createExpressionStatement( - factory2.createAssignment( - factory2.createPropertyAccessExpression( - factory2.createIdentifier("module"), - "exports" - ), - expressionResult - ) - ); - setTextRange(statement, currentModuleInfo.exportEquals); - setEmitFlags(statement, 3072 /* NoComments */); - statements.push(statement); - } - } - } - } - function topLevelVisitor(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - return visitTopLevelImportDeclaration(node); - case 272 /* ImportEqualsDeclaration */: - return visitTopLevelImportEqualsDeclaration(node); - case 279 /* ExportDeclaration */: - return visitTopLevelExportDeclaration(node); - case 278 /* ExportAssignment */: - return visitTopLevelExportAssignment(node); - default: - return topLevelNestedVisitor(node); - } - } - function topLevelNestedVisitor(node) { - switch (node.kind) { - case 244 /* VariableStatement */: - return visitVariableStatement(node); - case 263 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 264 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 249 /* ForStatement */: - return visitForStatement( - node, - /*isTopLevel*/ - true - ); - case 250 /* ForInStatement */: - return visitForInStatement(node); - case 251 /* ForOfStatement */: - return visitForOfStatement(node); - case 247 /* DoStatement */: - return visitDoStatement(node); - case 248 /* WhileStatement */: - return visitWhileStatement(node); - case 257 /* LabeledStatement */: - return visitLabeledStatement(node); - case 255 /* WithStatement */: - return visitWithStatement(node); - case 246 /* IfStatement */: - return visitIfStatement(node); - case 256 /* SwitchStatement */: - return visitSwitchStatement(node); - case 270 /* CaseBlock */: - return visitCaseBlock(node); - case 297 /* CaseClause */: - return visitCaseClause(node); - case 298 /* DefaultClause */: - return visitDefaultClause(node); - case 259 /* TryStatement */: - return visitTryStatement(node); - case 300 /* CatchClause */: - return visitCatchClause(node); - case 242 /* Block */: - return visitBlock(node); - default: - return visitor(node); - } - } - function visitorWorker(node, valueIsDiscarded) { - if (!(node.transformFlags & (8388608 /* ContainsDynamicImport */ | 4096 /* ContainsDestructuringAssignment */ | 268435456 /* ContainsUpdateExpressionForIdentifier */)) && !(importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim.length)) { - return node; - } - switch (node.kind) { - case 249 /* ForStatement */: - return visitForStatement( - node, - /*isTopLevel*/ - false - ); - case 245 /* ExpressionStatement */: - return visitExpressionStatement(node); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, valueIsDiscarded); - case 356 /* PartiallyEmittedExpression */: - return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 214 /* CallExpression */: - const needsRewrite = node === firstOrUndefined(importsAndRequiresToRewriteOrShim); - if (needsRewrite) { - importsAndRequiresToRewriteOrShim.shift(); - } - if (isImportCall(node) && host.shouldTransformImportCall(currentSourceFile)) { - return visitImportCallExpression(node, needsRewrite); - } else if (needsRewrite) { - return shimOrRewriteImportOrRequireCall(node); - } - break; - case 227 /* BinaryExpression */: - if (isDestructuringAssignment(node)) { - return visitDestructuringAssignment(node, valueIsDiscarded); - } - break; - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded); - } - return visitEachChild(node, visitor, context); - } - function visitor(node) { - return visitorWorker( - node, - /*valueIsDiscarded*/ - false - ); - } - function discardedValueVisitor(node) { - return visitorWorker( - node, - /*valueIsDiscarded*/ - true - ); - } - function destructuringNeedsFlattening(node) { - if (isObjectLiteralExpression(node)) { - for (const elem of node.properties) { - switch (elem.kind) { - case 304 /* PropertyAssignment */: - if (destructuringNeedsFlattening(elem.initializer)) { - return true; - } - break; - case 305 /* ShorthandPropertyAssignment */: - if (destructuringNeedsFlattening(elem.name)) { - return true; - } - break; - case 306 /* SpreadAssignment */: - if (destructuringNeedsFlattening(elem.expression)) { - return true; - } - break; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return false; - default: - Debug.assertNever(elem, "Unhandled object member kind"); - } - } - } else if (isArrayLiteralExpression(node)) { - for (const elem of node.elements) { - if (isSpreadElement(elem)) { - if (destructuringNeedsFlattening(elem.expression)) { - return true; - } - } else if (destructuringNeedsFlattening(elem)) { - return true; - } - } - } else if (isIdentifier(node)) { - return length(getExports(node)) > (isExportName(node) ? 1 : 0); - } - return false; - } - function visitDestructuringAssignment(node, valueIsDiscarded) { - if (destructuringNeedsFlattening(node.left)) { - return flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !valueIsDiscarded, createAllExportExpressions); - } - return visitEachChild(node, visitor, context); - } - function visitForStatement(node, isTopLevel) { - if (isTopLevel && node.initializer && isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7 /* BlockScoped */)) { - const exportStatements = appendExportsOfVariableDeclarationList( - /*statements*/ - void 0, - node.initializer, - /*isForInOrOfInitializer*/ - false - ); - if (exportStatements) { - const statements = []; - const varDeclList = visitNode(node.initializer, discardedValueVisitor, isVariableDeclarationList); - const varStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - varDeclList - ); - statements.push(varStatement); - addRange(statements, exportStatements); - const condition = visitNode(node.condition, visitor, isExpression); - const incrementor = visitNode(node.incrementor, discardedValueVisitor, isExpression); - const body = visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context); - statements.push(factory2.updateForStatement( - node, - /*initializer*/ - void 0, - condition, - incrementor, - body - )); - return statements; - } - } - return factory2.updateForStatement( - node, - visitNode(node.initializer, discardedValueVisitor, isForInitializer), - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, discardedValueVisitor, isExpression), - visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context) - ); - } - function visitForInStatement(node) { - if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7 /* BlockScoped */)) { - const exportStatements = appendExportsOfVariableDeclarationList( - /*statements*/ - void 0, - node.initializer, - /*isForInOrOfInitializer*/ - true - ); - if (some(exportStatements)) { - const initializer = visitNode(node.initializer, discardedValueVisitor, isForInitializer); - const expression = visitNode(node.expression, visitor, isExpression); - const body = visitIterationBody(node.statement, topLevelNestedVisitor, context); - const mergedBody = isBlock(body) ? factory2.updateBlock(body, [...exportStatements, ...body.statements]) : factory2.createBlock( - [...exportStatements, body], - /*multiLine*/ - true - ); - return factory2.updateForInStatement(node, initializer, expression, mergedBody); - } - } - return factory2.updateForInStatement( - node, - visitNode(node.initializer, discardedValueVisitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), - visitIterationBody(node.statement, topLevelNestedVisitor, context) - ); - } - function visitForOfStatement(node) { - if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7 /* BlockScoped */)) { - const exportStatements = appendExportsOfVariableDeclarationList( - /*statements*/ - void 0, - node.initializer, - /*isForInOrOfInitializer*/ - true - ); - const initializer = visitNode(node.initializer, discardedValueVisitor, isForInitializer); - const expression = visitNode(node.expression, visitor, isExpression); - let body = visitIterationBody(node.statement, topLevelNestedVisitor, context); - if (some(exportStatements)) { - body = isBlock(body) ? factory2.updateBlock(body, [...exportStatements, ...body.statements]) : factory2.createBlock( - [...exportStatements, body], - /*multiLine*/ - true - ); - } - return factory2.updateForOfStatement(node, node.awaitModifier, initializer, expression, body); - } - return factory2.updateForOfStatement( - node, - node.awaitModifier, - visitNode(node.initializer, discardedValueVisitor, isForInitializer), - visitNode(node.expression, visitor, isExpression), - visitIterationBody(node.statement, topLevelNestedVisitor, context) - ); - } - function visitDoStatement(node) { - return factory2.updateDoStatement( - node, - visitIterationBody(node.statement, topLevelNestedVisitor, context), - visitNode(node.expression, visitor, isExpression) - ); - } - function visitWhileStatement(node) { - return factory2.updateWhileStatement( - node, - visitNode(node.expression, visitor, isExpression), - visitIterationBody(node.statement, topLevelNestedVisitor, context) - ); - } - function visitLabeledStatement(node) { - return factory2.updateLabeledStatement( - node, - node.label, - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), node.statement) - ); - } - function visitWithStatement(node) { - return factory2.updateWithStatement( - node, - visitNode(node.expression, visitor, isExpression), - Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) - ); - } - function visitIfStatement(node) { - return factory2.updateIfStatement( - node, - visitNode(node.expression, visitor, isExpression), - visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]), - visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) - ); - } - function visitSwitchStatement(node) { - return factory2.updateSwitchStatement( - node, - visitNode(node.expression, visitor, isExpression), - Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) - ); - } - function visitCaseBlock(node) { - return factory2.updateCaseBlock( - node, - visitNodes2(node.clauses, topLevelNestedVisitor, isCaseOrDefaultClause) - ); - } - function visitCaseClause(node) { - return factory2.updateCaseClause( - node, - visitNode(node.expression, visitor, isExpression), - visitNodes2(node.statements, topLevelNestedVisitor, isStatement) - ); - } - function visitDefaultClause(node) { - return visitEachChild(node, topLevelNestedVisitor, context); - } - function visitTryStatement(node) { - return visitEachChild(node, topLevelNestedVisitor, context); - } - function visitCatchClause(node) { - return factory2.updateCatchClause( - node, - node.variableDeclaration, - Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock)) - ); - } - function visitBlock(node) { - node = visitEachChild(node, topLevelNestedVisitor, context); - return node; - } - function visitExpressionStatement(node) { - return factory2.updateExpressionStatement( - node, - visitNode(node.expression, discardedValueVisitor, isExpression) - ); - } - function visitParenthesizedExpression(node, valueIsDiscarded) { - return factory2.updateParenthesizedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); - } - function visitPartiallyEmittedExpression(node, valueIsDiscarded) { - return factory2.updatePartiallyEmittedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); - } - function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { - if ((node.operator === 46 /* PlusPlusToken */ || node.operator === 47 /* MinusMinusToken */) && isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand) && !isDeclarationNameOfEnumOrNamespace(node.operand)) { - const exportedNames = getExports(node.operand); - if (exportedNames) { - let temp; - let expression = visitNode(node.operand, visitor, isExpression); - if (isPrefixUnaryExpression(node)) { - expression = factory2.updatePrefixUnaryExpression(node, expression); - } else { - expression = factory2.updatePostfixUnaryExpression(node, expression); - if (!valueIsDiscarded) { - temp = factory2.createTempVariable(hoistVariableDeclaration); - expression = factory2.createAssignment(temp, expression); - setTextRange(expression, node); - } - expression = factory2.createComma(expression, factory2.cloneNode(node.operand)); - setTextRange(expression, node); - } - for (const exportName of exportedNames) { - noSubstitution[getNodeId(expression)] = true; - expression = createExportExpression(exportName, expression); - setTextRange(expression, node); - } - if (temp) { - noSubstitution[getNodeId(expression)] = true; - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; - } - } - return visitEachChild(node, visitor, context); - } - function shimOrRewriteImportOrRequireCall(node) { - return factory2.updateCallExpression( - node, - node.expression, - /*typeArguments*/ - void 0, - visitNodes2(node.arguments, (arg) => { - if (arg === node.arguments[0]) { - return isStringLiteralLike(arg) ? rewriteModuleSpecifier(arg, compilerOptions) : emitHelpers().createRewriteRelativeImportExtensionsHelper(arg); - } - return visitor(arg); - }, isExpression) - ); - } - function visitImportCallExpression(node, rewriteOrShim) { - if (moduleKind === 0 /* None */ && languageVersion >= 7 /* ES2020 */) { - return visitEachChild(node, visitor, context); - } - const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); - const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument && rewriteOrShim ? isStringLiteral(firstArgument) ? rewriteModuleSpecifier(firstArgument, compilerOptions) : emitHelpers().createRewriteRelativeImportExtensionsHelper(firstArgument) : firstArgument; - const containsLexicalThis = !!(node.transformFlags & 16384 /* ContainsLexicalThis */); - switch (compilerOptions.module) { - case 2 /* AMD */: - return createImportCallExpressionAMD(argument, containsLexicalThis); - case 3 /* UMD */: - return createImportCallExpressionUMD(argument ?? factory2.createVoidZero(), containsLexicalThis); - case 1 /* CommonJS */: - default: - return createImportCallExpressionCommonJS(argument); - } - } - function createImportCallExpressionUMD(arg, containsLexicalThis) { - needUMDDynamicImportHelper = true; - if (isSimpleCopiableExpression(arg)) { - const argClone = isGeneratedIdentifier(arg) ? arg : isStringLiteral(arg) ? factory2.createStringLiteralFromNode(arg) : setEmitFlags(setTextRange(factory2.cloneNode(arg), arg), 3072 /* NoComments */); - return factory2.createConditionalExpression( - /*condition*/ - factory2.createIdentifier("__syncRequire"), - /*questionToken*/ - void 0, - /*whenTrue*/ - createImportCallExpressionCommonJS(arg), - /*colonToken*/ - void 0, - /*whenFalse*/ - createImportCallExpressionAMD(argClone, containsLexicalThis) - ); - } 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) - ) - ); - } - } - function createImportCallExpressionAMD(arg, containsLexicalThis) { - const resolve = factory2.createUniqueName("resolve"); - const reject = factory2.createUniqueName("reject"); - const parameters = [ - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - /*name*/ - resolve - ), - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - /*name*/ - reject - ) - ]; - const body = factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createIdentifier("require"), - /*typeArguments*/ - void 0, - [factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve, reject] - ) - ) - ]); - let func; - if (languageVersion >= 2 /* ES2015 */) { - func = factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - body - ); - } else { - func = factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - body - ); - if (containsLexicalThis) { - setEmitFlags(func, 16 /* CapturesThis */); - } - } - const promise = factory2.createNewExpression( - factory2.createIdentifier("Promise"), - /*typeArguments*/ - void 0, - [func] - ); - if (getESModuleInterop(compilerOptions)) { - return factory2.createCallExpression( - factory2.createPropertyAccessExpression(promise, factory2.createIdentifier("then")), - /*typeArguments*/ - void 0, - [emitHelpers().createImportStarCallbackHelper()] - ); - } - return promise; - } - function createImportCallExpressionCommonJS(arg, isInlineable) { - const needSyncEval = arg && !isSimpleInlineableExpression(arg) && !isInlineable; - const promiseResolveCall = factory2.createCallExpression( - factory2.createPropertyAccessExpression(factory2.createIdentifier("Promise"), "resolve"), - /*typeArguments*/ - void 0, - /*argumentsArray*/ - needSyncEval ? languageVersion >= 2 /* ES2015 */ ? [ - factory2.createTemplateExpression(factory2.createTemplateHead(""), [ - factory2.createTemplateSpan(arg, factory2.createTemplateTail("")) - ]) - ] : [ - factory2.createCallExpression( - factory2.createPropertyAccessExpression(factory2.createStringLiteral(""), "concat"), - /*typeArguments*/ - void 0, - [arg] - ) - ] : [] - ); - let requireCall = factory2.createCallExpression( - factory2.createIdentifier("require"), - /*typeArguments*/ - void 0, - needSyncEval ? [factory2.createIdentifier("s")] : arg ? [arg] : [] - ); - if (getESModuleInterop(compilerOptions)) { - requireCall = emitHelpers().createImportStarHelper(requireCall); - } - const parameters = needSyncEval ? [ - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - /*name*/ - "s" - ) - ] : []; - let func; - if (languageVersion >= 2 /* ES2015 */) { - func = factory2.createArrowFunction( - /*modifiers*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - parameters, - /*type*/ - void 0, - /*equalsGreaterThanToken*/ - void 0, - requireCall - ); - } else { - func = factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - parameters, - /*type*/ - void 0, - factory2.createBlock([factory2.createReturnStatement(requireCall)]) - ); - } - const downleveledImport = factory2.createCallExpression( - factory2.createPropertyAccessExpression(promiseResolveCall, "then"), - /*typeArguments*/ - void 0, - [func] - ); - return downleveledImport; - } - function getHelperExpressionForExport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { - return innerExpr; - } - if (getExportNeedsImportStarHelper(node)) { - return emitHelpers().createImportStarHelper(innerExpr); - } - return innerExpr; - } - function getHelperExpressionForImport(node, innerExpr) { - if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) { - return innerExpr; - } - if (getImportNeedsImportStarHelper(node)) { - return emitHelpers().createImportStarHelper(innerExpr); - } - if (getImportNeedsImportDefaultHelper(node)) { - return emitHelpers().createImportDefaultHelper(innerExpr); - } - return innerExpr; - } - function visitTopLevelImportDeclaration(node) { - let statements; - const namespaceDeclaration = getNamespaceDeclarationNode(node); - if (moduleKind !== 2 /* AMD */) { - if (!node.importClause) { - return setOriginalNode(setTextRange(factory2.createExpressionStatement(createRequireCall2(node)), node), node); - } else { - const variables = []; - if (namespaceDeclaration && !isDefaultImport(node)) { - variables.push( - factory2.createVariableDeclaration( - factory2.cloneNode(namespaceDeclaration.name), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - getHelperExpressionForImport(node, createRequireCall2(node)) - ) - ); - } else { - variables.push( - factory2.createVariableDeclaration( - factory2.getGeneratedNameForNode(node), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - getHelperExpressionForImport(node, createRequireCall2(node)) - ) - ); - if (namespaceDeclaration && isDefaultImport(node)) { - variables.push( - factory2.createVariableDeclaration( - factory2.cloneNode(namespaceDeclaration.name), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.getGeneratedNameForNode(node) - ) - ); - } - } - statements = append( - statements, - setOriginalNode( - setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - variables, - languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */ - ) - ), - /*location*/ - node - ), - /*original*/ - node - ) - ); - } - } else if (namespaceDeclaration && isDefaultImport(node)) { - statements = append( - statements, - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - [ - setOriginalNode( - setTextRange( - factory2.createVariableDeclaration( - factory2.cloneNode(namespaceDeclaration.name), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.getGeneratedNameForNode(node) - ), - /*location*/ - node - ), - /*original*/ - node - ) - ], - languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */ - ) - ) - ); - } - statements = appendExportsOfImportDeclaration(statements, node); - return singleOrMany(statements); - } - function createRequireCall2(importNode) { - const moduleName = getExternalModuleNameLiteral(factory2, importNode, currentSourceFile, host, resolver, compilerOptions); - const args = []; - if (moduleName) { - args.push(rewriteModuleSpecifier(moduleName, compilerOptions)); - } - return factory2.createCallExpression( - factory2.createIdentifier("require"), - /*typeArguments*/ - void 0, - args - ); - } - 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, 32 /* Export */)) { - statements = append( - statements, - setOriginalNode( - setTextRange( - factory2.createExpressionStatement( - createExportExpression( - node.name, - createRequireCall2(node) - ) - ), - node - ), - node - ) - ); - } else { - statements = append( - statements, - setOriginalNode( - setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - [ - factory2.createVariableDeclaration( - factory2.cloneNode(node.name), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - createRequireCall2(node) - ) - ], - /*flags*/ - languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */ - ) - ), - node - ), - node - ) - ); - } - } else { - if (hasSyntacticModifier(node, 32 /* Export */)) { - statements = append( - statements, - setOriginalNode( - setTextRange( - factory2.createExpressionStatement( - createExportExpression(factory2.getExportName(node), factory2.getLocalName(node)) - ), - node - ), - node - ) - ); - } - } - statements = appendExportsOfImportEqualsDeclaration(statements, node); - return singleOrMany(statements); - } - function visitTopLevelExportDeclaration(node) { - if (!node.moduleSpecifier) { - return void 0; - } - const generatedName = factory2.getGeneratedNameForNode(node); - if (node.exportClause && isNamedExports(node.exportClause)) { - const statements = []; - if (moduleKind !== 2 /* AMD */) { - statements.push( - setOriginalNode( - setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - generatedName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - createRequireCall2(node) - ) - ]) - ), - /*location*/ - node - ), - /* original */ - node - ) - ); - } - for (const specifier of node.exportClause.elements) { - const specifierName = specifier.propertyName || specifier.name; - const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && moduleExportNameIsDefault(specifierName); - const target = exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName; - const exportedValue = specifierName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, specifierName) : factory2.createPropertyAccessExpression(target, specifierName); - statements.push( - setOriginalNode( - setTextRange( - factory2.createExpressionStatement( - createExportExpression( - specifier.name.kind === 11 /* StringLiteral */ ? factory2.cloneNode(specifier.name) : factory2.getExportName(specifier), - exportedValue, - /*location*/ - void 0, - /*liveBinding*/ - true - ) - ), - specifier - ), - specifier - ) - ); - } - return singleOrMany(statements); - } else if (node.exportClause) { - const statements = []; - statements.push( - setOriginalNode( - setTextRange( - factory2.createExpressionStatement( - createExportExpression( - factory2.cloneNode(node.exportClause.name), - getHelperExpressionForExport( - node, - moduleKind !== 2 /* AMD */ ? createRequireCall2(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : node.exportClause.name.kind === 11 /* StringLiteral */ ? generatedName : factory2.createIdentifier(idText(node.exportClause.name)) - ) - ) - ), - node - ), - node - ) - ); - return singleOrMany(statements); - } else { - return setOriginalNode( - setTextRange( - factory2.createExpressionStatement( - emitHelpers().createExportStarHelper(moduleKind !== 2 /* AMD */ ? createRequireCall2(node) : generatedName) - ), - node - ), - node - ); - } - } - function visitTopLevelExportAssignment(node) { - if (node.isExportEquals) { - return void 0; - } - return createExportStatement( - factory2.createIdentifier("default"), - visitNode(node.expression, visitor, isExpression), - /*location*/ - node, - /*allowComments*/ - true - ); - } - function visitFunctionDeclaration(node) { - let statements; - if (hasSyntacticModifier(node, 32 /* Export */)) { - statements = append( - statements, - setOriginalNode( - setTextRange( - factory2.createFunctionDeclaration( - visitNodes2(node.modifiers, modifierVisitor, isModifier), - node.asteriskToken, - factory2.getDeclarationName( - node, - /*allowComments*/ - true, - /*allowSourceMaps*/ - true - ), - /*typeParameters*/ - void 0, - visitNodes2(node.parameters, visitor, isParameter), - /*type*/ - void 0, - visitEachChild(node.body, visitor, context) - ), - /*location*/ - node - ), - /*original*/ - node - ) - ); - } else { - statements = append(statements, visitEachChild(node, visitor, context)); - } - return singleOrMany(statements); - } - function visitClassDeclaration(node) { - let statements; - if (hasSyntacticModifier(node, 32 /* Export */)) { - statements = append( - statements, - setOriginalNode( - setTextRange( - factory2.createClassDeclaration( - visitNodes2(node.modifiers, modifierVisitor, isModifierLike), - factory2.getDeclarationName( - node, - /*allowComments*/ - true, - /*allowSourceMaps*/ - true - ), - /*typeParameters*/ - void 0, - visitNodes2(node.heritageClauses, visitor, isHeritageClause), - visitNodes2(node.members, visitor, isClassElement) - ), - node - ), - node - ) - ); - } else { - statements = append(statements, visitEachChild(node, visitor, context)); - } - statements = appendExportsOfHoistedDeclaration(statements, node); - return singleOrMany(statements); - } - function visitVariableStatement(node) { - let statements; - let variables; - let expressions; - if (hasSyntacticModifier(node, 32 /* Export */)) { - let modifiers; - let removeCommentsOnExpressions = false; - for (const variable of node.declarationList.declarations) { - if (isIdentifier(variable.name) && isLocalName(variable.name)) { - if (!modifiers) { - modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - } - if (variable.initializer) { - const updatedVariable = factory2.updateVariableDeclaration( - variable, - variable.name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - createExportExpression( - variable.name, - visitNode(variable.initializer, visitor, isExpression) - ) - ); - variables = append(variables, updatedVariable); - } else { - variables = append(variables, variable); - } - } else if (variable.initializer) { - if (!isBindingPattern(variable.name) && (isArrowFunction(variable.initializer) || isFunctionExpression(variable.initializer) || isClassExpression(variable.initializer))) { - const expression = factory2.createAssignment( - setTextRange( - factory2.createPropertyAccessExpression( - factory2.createIdentifier("exports"), - variable.name - ), - /*location*/ - variable.name - ), - factory2.createIdentifier(getTextOfIdentifierOrLiteral(variable.name)) - ); - const updatedVariable = factory2.createVariableDeclaration( - variable.name, - variable.exclamationToken, - variable.type, - visitNode(variable.initializer, visitor, isExpression) - ); - variables = append(variables, updatedVariable); - expressions = append(expressions, expression); - removeCommentsOnExpressions = true; - } else { - expressions = append(expressions, transformInitializedVariable(variable)); - } - } - } - if (variables) { - statements = append(statements, factory2.updateVariableStatement(node, modifiers, factory2.updateVariableDeclarationList(node.declarationList, variables))); - } - if (expressions) { - const statement = setOriginalNode(setTextRange(factory2.createExpressionStatement(factory2.inlineExpressions(expressions)), node), node); - if (removeCommentsOnExpressions) { - removeAllComments(statement); - } - statements = append(statements, statement); - } - } else { - statements = append(statements, visitEachChild(node, visitor, context)); - } - statements = appendExportsOfVariableStatement(statements, node); - return singleOrMany(statements); - } - function createAllExportExpressions(name, value, location) { - const exportedNames = getExports(name); - if (exportedNames) { - let expression = isExportName(name) ? value : factory2.createAssignment(name, value); - for (const exportName of exportedNames) { - setEmitFlags(expression, 8 /* NoSubstitution */); - expression = createExportExpression( - exportName, - expression, - /*location*/ - location - ); - } - return expression; - } - return factory2.createAssignment(name, value); - } - function transformInitializedVariable(node) { - if (isBindingPattern(node.name)) { - return flattenDestructuringAssignment( - visitNode(node, visitor, isInitializedVariable), - visitor, - context, - 0 /* All */, - /*needsValue*/ - false, - createAllExportExpressions - ); - } else { - return factory2.createAssignment( - setTextRange( - factory2.createPropertyAccessExpression( - factory2.createIdentifier("exports"), - node.name - ), - /*location*/ - node.name - ), - node.initializer ? visitNode(node.initializer, visitor, isExpression) : factory2.createVoidZero() - ); - } - } - function appendExportsOfImportDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - const importClause = decl.importClause; - if (!importClause) { - return statements; - } - const seen = new IdentifierNameMap(); - if (importClause.name) { - statements = appendExportsOfDeclaration(statements, seen, importClause); - } - const namedBindings = importClause.namedBindings; - if (namedBindings) { - switch (namedBindings.kind) { - case 275 /* NamespaceImport */: - statements = appendExportsOfDeclaration(statements, seen, namedBindings); - break; - case 276 /* NamedImports */: - for (const importBinding of namedBindings.elements) { - statements = appendExportsOfDeclaration( - statements, - seen, - importBinding, - /*liveBinding*/ - true - ); - } - break; - } - } - return statements; - } - function appendExportsOfImportEqualsDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - return appendExportsOfDeclaration(statements, new IdentifierNameMap(), decl); - } - function appendExportsOfVariableStatement(statements, node) { - return appendExportsOfVariableDeclarationList( - statements, - node.declarationList, - /*isForInOrOfInitializer*/ - false - ); - } - function appendExportsOfVariableDeclarationList(statements, node, isForInOrOfInitializer) { - if (currentModuleInfo.exportEquals) { - return statements; - } - for (const decl of node.declarations) { - statements = appendExportsOfBindingElement(statements, decl, isForInOrOfInitializer); - } - return statements; - } - function appendExportsOfBindingElement(statements, decl, isForInOrOfInitializer) { - if (currentModuleInfo.exportEquals) { - return statements; - } - if (isBindingPattern(decl.name)) { - for (const element of decl.name.elements) { - if (!isOmittedExpression(element)) { - statements = appendExportsOfBindingElement(statements, element, isForInOrOfInitializer); - } - } - } else if (!isGeneratedIdentifier(decl.name) && (!isVariableDeclaration(decl) || decl.initializer || isForInOrOfInitializer)) { - statements = appendExportsOfDeclaration(statements, new IdentifierNameMap(), decl); - } - return statements; - } - function appendExportsOfHoistedDeclaration(statements, decl) { - if (currentModuleInfo.exportEquals) { - return statements; - } - 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*/ - decl - ); - } - if (decl.name) { - statements = appendExportsOfDeclaration(statements, seen, decl); - } - return statements; - } - function appendExportsOfDeclaration(statements, seen, decl, liveBinding) { - const name = factory2.getDeclarationName(decl); - const exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name); - if (exportSpecifiers) { - for (const exportSpecifier of exportSpecifiers) { - statements = appendExportStatement( - statements, - seen, - exportSpecifier.name, - name, - /*location*/ - exportSpecifier.name, - /*allowComments*/ - void 0, - liveBinding - ); - } - } - return statements; - } - function appendExportStatement(statements, seen, exportName, expression, location, allowComments, liveBinding) { - if (exportName.kind !== 11 /* StringLiteral */) { - if (seen.has(exportName)) { - return statements; - } - seen.set(exportName, true); - } - statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding)); - return statements; - } - function createUnderscoreUnderscoreESModule() { - const statement = factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "defineProperty"), - /*typeArguments*/ - void 0, - [ - factory2.createIdentifier("exports"), - factory2.createStringLiteral("__esModule"), - factory2.createObjectLiteralExpression([ - factory2.createPropertyAssignment("value", factory2.createTrue()) - ]) - ] - ) - ); - setEmitFlags(statement, 2097152 /* CustomPrologue */); - return statement; - } - function createExportStatement(name, value, location, allowComments, liveBinding) { - const statement = setTextRange(factory2.createExpressionStatement(createExportExpression( - name, - value, - /*location*/ - void 0, - liveBinding - )), location); - startOnNewLine(statement); - if (!allowComments) { - setEmitFlags(statement, 3072 /* NoComments */); - } - return statement; - } - function createExportExpression(name, value, location, liveBinding) { - return setTextRange( - liveBinding ? factory2.createCallExpression( - factory2.createPropertyAccessExpression( - factory2.createIdentifier("Object"), - "defineProperty" - ), - /*typeArguments*/ - void 0, - [ - factory2.createIdentifier("exports"), - 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.createAssignment( - name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression( - factory2.createIdentifier("exports"), - factory2.cloneNode(name) - ) : factory2.createPropertyAccessExpression( - factory2.createIdentifier("exports"), - factory2.cloneNode(name) - ), - value - ), - location - ); - } - function modifierVisitor(node) { - switch (node.kind) { - case 95 /* ExportKeyword */: - case 90 /* DefaultKeyword */: - return void 0; - } - return node; - } - function onEmitNode(hint, node, emitCallback) { - if (node.kind === 308 /* SourceFile */) { - currentSourceFile = node; - currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)]; - previousOnEmitNode(hint, node, emitCallback); - currentSourceFile = void 0; - currentModuleInfo = void 0; - } else { - previousOnEmitNode(hint, node, emitCallback); - } - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (node.id && noSubstitution[node.id]) { - return node; - } - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } else if (isShorthandPropertyAssignment(node)) { - return substituteShorthandPropertyAssignment(node); - } - return node; - } - function substituteShorthandPropertyAssignment(node) { - const name = node.name; - const exportedOrImportedName = substituteExpressionIdentifier(name); - if (exportedOrImportedName !== name) { - if (node.objectAssignmentInitializer) { - const initializer = factory2.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); - return setTextRange(factory2.createPropertyAssignment(name, initializer), node); - } - return setTextRange(factory2.createPropertyAssignment(name, exportedOrImportedName), node); - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 80 /* Identifier */: - return substituteExpressionIdentifier(node); - case 214 /* CallExpression */: - return substituteCallExpression(node); - case 216 /* TaggedTemplateExpression */: - return substituteTaggedTemplateExpression(node); - case 227 /* BinaryExpression */: - return substituteBinaryExpression(node); - } - return node; - } - function substituteCallExpression(node) { - if (isIdentifier(node.expression)) { - const expression = substituteExpressionIdentifier(node.expression); - noSubstitution[getNodeId(expression)] = true; - if (!isIdentifier(expression) && !(getEmitFlags(node.expression) & 8192 /* HelperName */)) { - return addInternalEmitFlags( - factory2.updateCallExpression( - node, - expression, - /*typeArguments*/ - void 0, - node.arguments - ), - 16 /* IndirectCall */ - ); - } - } - return node; - } - function substituteTaggedTemplateExpression(node) { - if (isIdentifier(node.tag)) { - const tag = substituteExpressionIdentifier(node.tag); - noSubstitution[getNodeId(tag)] = true; - if (!isIdentifier(tag) && !(getEmitFlags(node.tag) & 8192 /* HelperName */)) { - return addInternalEmitFlags( - factory2.updateTaggedTemplateExpression( - node, - tag, - /*typeArguments*/ - void 0, - node.template - ), - 16 /* IndirectCall */ - ); - } - } - return node; - } - function substituteExpressionIdentifier(node) { - var _a, _b; - if (getEmitFlags(node) & 8192 /* HelperName */) { - const externalHelpersModuleName = getExternalHelpersModuleName(currentSourceFile); - if (externalHelpersModuleName) { - return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); - } - 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 === 308 /* SourceFile */) { - return setTextRange( - factory2.createPropertyAccessExpression( - factory2.createIdentifier("exports"), - factory2.cloneNode(node) - ), - /*location*/ - node - ); - } - const importDeclaration = resolver.getReferencedImportDeclaration(node); - if (importDeclaration) { - if (isImportClause(importDeclaration)) { - return setTextRange( - factory2.createPropertyAccessExpression( - factory2.getGeneratedNameForNode(importDeclaration.parent), - factory2.createIdentifier("default") - ), - /*location*/ - node - ); - } else if (isImportSpecifier(importDeclaration)) { - const name = importDeclaration.propertyName || importDeclaration.name; - const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration); - return setTextRange( - name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(name)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(name)), - /*location*/ - node - ); - } - } - } - return node; - } - function substituteBinaryExpression(node) { - 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; - for (const exportName of exportedNames) { - noSubstitution[getNodeId(expression)] = true; - expression = createExportExpression( - exportName, - expression, - /*location*/ - node - ); - } - return expression; - } - } - return node; - } - function getExports(name) { - if (!isGeneratedIdentifier(name)) { - const importDeclaration = resolver.getReferencedImportDeclaration(name); - if (importDeclaration) { - return currentModuleInfo == null ? void 0 : currentModuleInfo.exportedBindings[getOriginalNodeId(importDeclaration)]; - } - const bindingsSet = /* @__PURE__ */ new Set(); - const declarations = resolver.getReferencedValueDeclarations(name); - if (declarations) { - for (const declaration of declarations) { - const bindings = currentModuleInfo == null ? void 0 : currentModuleInfo.exportedBindings[getOriginalNodeId(declaration)]; - if (bindings) { - for (const binding of bindings) { - bindingsSet.add(binding); - } - } - } - if (bindingsSet.size) { - 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; - } - } - } -} -var dynamicImportUMDHelper = { - name: "typescript:dynamicimport-sync-require", - scoped: true, - text: ` - var __syncRequire = typeof module === "object" && typeof module.exports === "object";` -}; - -// src/compiler/transformers/module/system.ts -function transformSystemModule(context) { - const { - factory: factory2, - startLexicalEnvironment, - endLexicalEnvironment, - hoistVariableDeclaration - } = context; - const compilerOptions = context.getCompilerOptions(); - const resolver = context.getEmitResolver(); - const host = context.getEmitHost(); - const previousOnSubstituteNode = context.onSubstituteNode; - const previousOnEmitNode = context.onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.onEmitNode = onEmitNode; - context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(305 /* ShorthandPropertyAssignment */); - context.enableSubstitution(227 /* BinaryExpression */); - context.enableSubstitution(237 /* MetaProperty */); - context.enableEmitNotification(308 /* SourceFile */); - const moduleInfoMap = []; - const exportFunctionsMap = []; - const noSubstitutionMap = []; - const contextObjectMap = []; - let currentSourceFile; - let moduleInfo; - let exportFunction; - let contextObject; - let hoistedStatements; - let enclosingBlockScopedContainer; - let noSubstitution; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile || !(isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 8388608 /* ContainsDynamicImport */)) { - return node; - } - const id = getOriginalNodeId(node); - currentSourceFile = node; - enclosingBlockScopedContainer = node; - moduleInfo = moduleInfoMap[id] = collectExternalModuleInfo(context, node); - exportFunction = factory2.createUniqueName("exports"); - exportFunctionsMap[id] = exportFunction; - contextObject = contextObjectMap[id] = factory2.createUniqueName("context"); - const dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); - const moduleBodyBlock = createSystemModuleBody(node, dependencyGroups); - const moduleBodyFunction = factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [ - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - exportFunction - ), - factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - contextObject - ) - ], - /*type*/ - void 0, - moduleBodyBlock - ); - const moduleName = tryGetModuleNameFromFile(factory2, node, host, compilerOptions); - const dependencies = factory2.createArrayLiteralExpression(map(dependencyGroups, (dependencyGroup) => dependencyGroup.name)); - const updated = setEmitFlags( - factory2.updateSourceFile( - node, - setTextRange( - factory2.createNodeArray([ - factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createPropertyAccessExpression(factory2.createIdentifier("System"), "register"), - /*typeArguments*/ - void 0, - moduleName ? [moduleName, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction] - ) - ) - ]), - node.statements - ) - ), - 2048 /* NoTrailingComments */ - ); - if (!compilerOptions.outFile) { - moveEmitHelpers(updated, moduleBodyBlock, (helper) => !helper.scoped); - } - if (noSubstitution) { - noSubstitutionMap[id] = noSubstitution; - noSubstitution = void 0; - } - currentSourceFile = void 0; - moduleInfo = void 0; - exportFunction = void 0; - contextObject = void 0; - hoistedStatements = void 0; - enclosingBlockScopedContainer = void 0; - return updated; - } - function collectDependencyGroups(externalImports) { - const groupIndices = /* @__PURE__ */ new Map(); - const dependencyGroups = []; - for (const externalImport of externalImports) { - const externalModuleName = getExternalModuleNameLiteral(factory2, externalImport, currentSourceFile, host, resolver, compilerOptions); - if (externalModuleName) { - const text = externalModuleName.text; - const groupIndex = groupIndices.get(text); - if (groupIndex !== void 0) { - dependencyGroups[groupIndex].externalImports.push(externalImport); - } else { - groupIndices.set(text, dependencyGroups.length); - dependencyGroups.push({ - name: externalModuleName, - externalImports: [externalImport] - }); - } - } - } - return dependencyGroups; - } - function createSystemModuleBody(node, dependencyGroups) { - const statements = []; - startLexicalEnvironment(); - const ensureUseStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") || isExternalModule(currentSourceFile); - const statementOffset = factory2.copyPrologue(node.statements, statements, ensureUseStrict, topLevelVisitor); - statements.push( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - "__moduleName", - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createLogicalAnd( - contextObject, - factory2.createPropertyAccessExpression(contextObject, "id") - ) - ) - ]) - ) - ); - visitNode(moduleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement); - const executeStatements = visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset); - addRange(statements, hoistedStatements); - insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); - const exportStarFunction = addExportStarIfNeeded(statements); - const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(1024 /* Async */) : void 0; - const moduleObject = factory2.createObjectLiteralExpression( - [ - factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), - factory2.createPropertyAssignment( - "execute", - factory2.createFunctionExpression( - modifiers, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - [], - /*type*/ - void 0, - factory2.createBlock( - executeStatements, - /*multiLine*/ - true - ) - ) - ) - ], - /*multiLine*/ - true - ); - statements.push(factory2.createReturnStatement(moduleObject)); - return factory2.createBlock( - statements, - /*multiLine*/ - true - ); - } - function addExportStarIfNeeded(statements) { - if (!moduleInfo.hasExportStarsToExportValues) { - return; - } - if (!some(moduleInfo.exportedNames) && moduleInfo.exportedFunctions.size === 0 && moduleInfo.exportSpecifiers.size === 0) { - let hasExportDeclarationWithExportClause = false; - for (const externalImport of moduleInfo.externalImports) { - if (externalImport.kind === 279 /* ExportDeclaration */ && externalImport.exportClause) { - hasExportDeclarationWithExportClause = true; - break; - } - } - if (!hasExportDeclarationWithExportClause) { - const exportStarFunction2 = createExportStarFunction( - /*localNames*/ - void 0 - ); - statements.push(exportStarFunction2); - return exportStarFunction2.name; - } - } - const exportedNames = []; - if (moduleInfo.exportedNames) { - for (const exportedLocalName of moduleInfo.exportedNames) { - if (moduleExportNameIsDefault(exportedLocalName)) { - continue; - } - exportedNames.push( - factory2.createPropertyAssignment( - factory2.createStringLiteralFromNode(exportedLocalName), - factory2.createTrue() - ) - ); - } - } - for (const f of moduleInfo.exportedFunctions) { - if (hasSyntacticModifier(f, 2048 /* Default */)) { - continue; - } - Debug.assert(!!f.name); - exportedNames.push( - factory2.createPropertyAssignment( - factory2.createStringLiteralFromNode(f.name), - factory2.createTrue() - ) - ); - } - const exportedNamesStorageRef = factory2.createUniqueName("exportedNames"); - statements.push( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - exportedNamesStorageRef, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createObjectLiteralExpression( - exportedNames, - /*multiLine*/ - true - ) - ) - ]) - ) - ); - const exportStarFunction = createExportStarFunction(exportedNamesStorageRef); - statements.push(exportStarFunction); - return exportStarFunction.name; - } - function createExportStarFunction(localNames) { - const exportStarFunction = factory2.createUniqueName("exportStar"); - const m = factory2.createIdentifier("m"); - const n = factory2.createIdentifier("n"); - const exports2 = factory2.createIdentifier("exports"); - let condition = factory2.createStrictInequality(n, factory2.createStringLiteral("default")); - if (localNames) { - condition = factory2.createLogicalAnd( - condition, - factory2.createLogicalNot( - factory2.createCallExpression( - factory2.createPropertyAccessExpression(localNames, "hasOwnProperty"), - /*typeArguments*/ - void 0, - [n] - ) - ) - ); - } - return factory2.createFunctionDeclaration( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - exportStarFunction, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - m - )], - /*type*/ - void 0, - factory2.createBlock( - [ - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - exports2, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createObjectLiteralExpression([]) - ) - ]) - ), - factory2.createForInStatement( - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration(n) - ]), - m, - factory2.createBlock([ - setEmitFlags( - factory2.createIfStatement( - condition, - factory2.createExpressionStatement( - factory2.createAssignment( - factory2.createElementAccessExpression(exports2, n), - factory2.createElementAccessExpression(m, n) - ) - ) - ), - 1 /* SingleLine */ - ) - ]) - ), - factory2.createExpressionStatement( - factory2.createCallExpression( - exportFunction, - /*typeArguments*/ - void 0, - [exports2] - ) - ) - ], - /*multiLine*/ - true - ) - ); - } - function createSettersArray(exportStarFunction, dependencyGroups) { - const setters = []; - for (const group2 of dependencyGroups) { - const localName = forEach(group2.externalImports, (i) => getLocalNameForExternalImport(factory2, i, currentSourceFile)); - const parameterName = localName ? factory2.getGeneratedNameForNode(localName) : factory2.createUniqueName(""); - const statements = []; - for (const entry of group2.externalImports) { - const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile); - switch (entry.kind) { - case 273 /* ImportDeclaration */: - if (!entry.importClause) { - break; - } - // falls through - case 272 /* ImportEqualsDeclaration */: - Debug.assert(importVariableName !== void 0); - statements.push( - factory2.createExpressionStatement( - factory2.createAssignment(importVariableName, parameterName) - ) - ); - if (hasSyntacticModifier(entry, 32 /* Export */)) { - statements.push( - factory2.createExpressionStatement( - factory2.createCallExpression( - exportFunction, - /*typeArguments*/ - void 0, - [ - factory2.createStringLiteral(idText(importVariableName)), - parameterName - ] - ) - ) - ); - } - break; - case 279 /* ExportDeclaration */: - Debug.assert(importVariableName !== void 0); - if (entry.exportClause) { - if (isNamedExports(entry.exportClause)) { - const properties = []; - for (const e of entry.exportClause.elements) { - properties.push( - factory2.createPropertyAssignment( - factory2.createStringLiteral(moduleExportNameTextUnescaped(e.name)), - factory2.createElementAccessExpression( - parameterName, - factory2.createStringLiteral(moduleExportNameTextUnescaped(e.propertyName || e.name)) - ) - ) - ); - } - statements.push( - factory2.createExpressionStatement( - factory2.createCallExpression( - exportFunction, - /*typeArguments*/ - void 0, - [factory2.createObjectLiteralExpression( - properties, - /*multiLine*/ - true - )] - ) - ) - ); - } else { - statements.push( - factory2.createExpressionStatement( - factory2.createCallExpression( - exportFunction, - /*typeArguments*/ - void 0, - [ - factory2.createStringLiteral(moduleExportNameTextUnescaped(entry.exportClause.name)), - parameterName - ] - ) - ) - ); - } - } else { - statements.push( - factory2.createExpressionStatement( - factory2.createCallExpression( - exportStarFunction, - /*typeArguments*/ - void 0, - [parameterName] - ) - ) - ); - } - break; - } - } - setters.push( - factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - [factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - parameterName - )], - /*type*/ - void 0, - factory2.createBlock( - statements, - /*multiLine*/ - true - ) - ) - ); - } - return factory2.createArrayLiteralExpression( - setters, - /*multiLine*/ - true - ); - } - function topLevelVisitor(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - return visitImportDeclaration(node); - case 272 /* ImportEqualsDeclaration */: - return visitImportEqualsDeclaration(node); - case 279 /* ExportDeclaration */: - return visitExportDeclaration(node); - case 278 /* ExportAssignment */: - return visitExportAssignment(node); - default: - return topLevelNestedVisitor(node); - } - } - function visitImportDeclaration(node) { - let statements; - if (node.importClause) { - hoistVariableDeclaration(getLocalNameForExternalImport(factory2, node, currentSourceFile)); - } - return singleOrMany(appendExportsOfImportDeclaration(statements, node)); - } - function visitExportDeclaration(node) { - Debug.assertIsDefined(node); - return void 0; - } - function visitImportEqualsDeclaration(node) { - Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); - let statements; - hoistVariableDeclaration(getLocalNameForExternalImport(factory2, node, currentSourceFile)); - return singleOrMany(appendExportsOfImportEqualsDeclaration(statements, node)); - } - function visitExportAssignment(node) { - if (node.isExportEquals) { - return void 0; - } - const expression = visitNode(node.expression, visitor, isExpression); - return createExportStatement( - factory2.createIdentifier("default"), - expression, - /*allowComments*/ - true - ); - } - function visitFunctionDeclaration(node) { - if (hasSyntacticModifier(node, 32 /* Export */)) { - hoistedStatements = append( - hoistedStatements, - factory2.updateFunctionDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifierLike), - node.asteriskToken, - factory2.getDeclarationName( - node, - /*allowComments*/ - true, - /*allowSourceMaps*/ - true - ), - /*typeParameters*/ - void 0, - visitNodes2(node.parameters, visitor, isParameter), - /*type*/ - void 0, - visitNode(node.body, visitor, isBlock) - ) - ); - } else { - hoistedStatements = append(hoistedStatements, visitEachChild(node, visitor, context)); - } - hoistedStatements = appendExportsOfHoistedDeclaration(hoistedStatements, node); - return void 0; - } - function visitClassDeclaration(node) { - let statements; - const name = factory2.getLocalName(node); - hoistVariableDeclaration(name); - statements = append( - statements, - setTextRange( - factory2.createExpressionStatement( - factory2.createAssignment( - name, - setTextRange( - factory2.createClassExpression( - visitNodes2(node.modifiers, modifierVisitor, isModifierLike), - node.name, - /*typeParameters*/ - void 0, - visitNodes2(node.heritageClauses, visitor, isHeritageClause), - visitNodes2(node.members, visitor, isClassElement) - ), - node - ) - ) - ), - node - ) - ); - statements = appendExportsOfHoistedDeclaration(statements, node); - return singleOrMany(statements); - } - function visitVariableStatement(node) { - if (!shouldHoistVariableDeclarationList(node.declarationList)) { - return visitNode(node, visitor, isStatement); - } - let statements; - 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, - node, - /*exportSelf*/ - false - ); - return singleOrMany(statements); - } - function hoistBindingElement(node) { - if (isBindingPattern(node.name)) { - for (const element of node.name.elements) { - if (!isOmittedExpression(element)) { - hoistBindingElement(element); - } - } - } else { - hoistVariableDeclaration(factory2.cloneNode(node.name)); - } - } - function shouldHoistVariableDeclarationList(node) { - return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 308 /* SourceFile */ || (getOriginalNode(node).flags & 7 /* BlockScoped */) === 0); - } - function transformInitializedVariable(node, isExportedDeclaration) { - const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; - return isBindingPattern(node.name) ? flattenDestructuringAssignment( - node, - visitor, - context, - 0 /* All */, - /*needsValue*/ - false, - createAssignment - ) : node.initializer ? createAssignment(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; - } - function createExportedVariableAssignment(name, value, location) { - return createVariableAssignment( - name, - value, - location, - /*isExportedDeclaration*/ - true - ); - } - function createNonExportedVariableAssignment(name, value, location) { - return createVariableAssignment( - name, - value, - location, - /*isExportedDeclaration*/ - false - ); - } - function createVariableAssignment(name, value, location, isExportedDeclaration) { - hoistVariableDeclaration(factory2.cloneNode(name)); - return isExportedDeclaration ? createExportExpression(name, preventSubstitution(setTextRange(factory2.createAssignment(name, value), location))) : preventSubstitution(setTextRange(factory2.createAssignment(name, value), location)); - } - function appendExportsOfImportDeclaration(statements, decl) { - if (moduleInfo.exportEquals) { - return statements; - } - const importClause = decl.importClause; - if (!importClause) { - return statements; - } - if (importClause.name) { - statements = appendExportsOfDeclaration(statements, importClause); - } - const namedBindings = importClause.namedBindings; - if (namedBindings) { - switch (namedBindings.kind) { - case 275 /* NamespaceImport */: - statements = appendExportsOfDeclaration(statements, namedBindings); - break; - case 276 /* NamedImports */: - for (const importBinding of namedBindings.elements) { - statements = appendExportsOfDeclaration(statements, importBinding); - } - break; - } - } - return statements; - } - function appendExportsOfImportEqualsDeclaration(statements, decl) { - if (moduleInfo.exportEquals) { - return statements; - } - return appendExportsOfDeclaration(statements, decl); - } - function appendExportsOfVariableStatement(statements, node, exportSelf) { - if (moduleInfo.exportEquals) { - return statements; - } - for (const decl of node.declarationList.declarations) { - if (decl.initializer || exportSelf) { - statements = appendExportsOfBindingElement(statements, decl, exportSelf); - } - } - return statements; - } - function appendExportsOfBindingElement(statements, decl, exportSelf) { - if (moduleInfo.exportEquals) { - return statements; - } - if (isBindingPattern(decl.name)) { - for (const element of decl.name.elements) { - if (!isOmittedExpression(element)) { - statements = appendExportsOfBindingElement(statements, element, exportSelf); - } - } - } else if (!isGeneratedIdentifier(decl.name)) { - let excludeName; - if (exportSelf) { - statements = appendExportStatement(statements, decl.name, factory2.getLocalName(decl)); - excludeName = idText(decl.name); - } - statements = appendExportsOfDeclaration(statements, decl, excludeName); - } - return statements; - } - function appendExportsOfHoistedDeclaration(statements, decl) { - if (moduleInfo.exportEquals) { - return statements; - } - let excludeName; - 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); - } - if (decl.name) { - statements = appendExportsOfDeclaration(statements, decl, excludeName); - } - return statements; - } - function appendExportsOfDeclaration(statements, decl, excludeName) { - if (moduleInfo.exportEquals) { - return statements; - } - const name = factory2.getDeclarationName(decl); - const exportSpecifiers = moduleInfo.exportSpecifiers.get(name); - if (exportSpecifiers) { - for (const exportSpecifier of exportSpecifiers) { - if (moduleExportNameTextUnescaped(exportSpecifier.name) !== excludeName) { - statements = appendExportStatement(statements, exportSpecifier.name, name); - } - } - } - return statements; - } - function appendExportStatement(statements, exportName, expression, allowComments) { - statements = append(statements, createExportStatement(exportName, expression, allowComments)); - return statements; - } - function createExportStatement(name, value, allowComments) { - const statement = factory2.createExpressionStatement(createExportExpression(name, value)); - startOnNewLine(statement); - if (!allowComments) { - setEmitFlags(statement, 3072 /* NoComments */); - } - return statement; - } - function createExportExpression(name, value) { - const exportName = isIdentifier(name) ? factory2.createStringLiteralFromNode(name) : name; - setEmitFlags(value, getEmitFlags(value) | 3072 /* NoComments */); - return setCommentRange(factory2.createCallExpression( - exportFunction, - /*typeArguments*/ - void 0, - [exportName, value] - ), value); - } - function topLevelNestedVisitor(node) { - switch (node.kind) { - case 244 /* VariableStatement */: - return visitVariableStatement(node); - case 263 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 264 /* ClassDeclaration */: - return visitClassDeclaration(node); - case 249 /* ForStatement */: - return visitForStatement( - node, - /*isTopLevel*/ - true - ); - case 250 /* ForInStatement */: - return visitForInStatement(node); - case 251 /* ForOfStatement */: - return visitForOfStatement(node); - case 247 /* DoStatement */: - return visitDoStatement(node); - case 248 /* WhileStatement */: - return visitWhileStatement(node); - case 257 /* LabeledStatement */: - return visitLabeledStatement(node); - case 255 /* WithStatement */: - return visitWithStatement(node); - case 246 /* IfStatement */: - return visitIfStatement(node); - case 256 /* SwitchStatement */: - return visitSwitchStatement(node); - case 270 /* CaseBlock */: - return visitCaseBlock(node); - case 297 /* CaseClause */: - return visitCaseClause(node); - case 298 /* DefaultClause */: - return visitDefaultClause(node); - case 259 /* TryStatement */: - return visitTryStatement(node); - case 300 /* CatchClause */: - return visitCatchClause(node); - case 242 /* Block */: - return visitBlock(node); - default: - return visitor(node); - } - } - function visitForStatement(node, isTopLevel) { - const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; - enclosingBlockScopedContainer = node; - node = factory2.updateForStatement( - node, - visitNode(node.initializer, isTopLevel ? visitForInitializer : discardedValueVisitor, isForInitializer), - visitNode(node.condition, visitor, isExpression), - visitNode(node.incrementor, discardedValueVisitor, isExpression), - visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context) - ); - enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; - return node; - } - function visitForInStatement(node) { - const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; - enclosingBlockScopedContainer = node; - node = factory2.updateForInStatement( - node, - visitForInitializer(node.initializer), - visitNode(node.expression, visitor, isExpression), - visitIterationBody(node.statement, topLevelNestedVisitor, context) - ); - enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; - return node; - } - function visitForOfStatement(node) { - const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; - enclosingBlockScopedContainer = node; - node = factory2.updateForOfStatement( - node, - node.awaitModifier, - visitForInitializer(node.initializer), - visitNode(node.expression, visitor, isExpression), - visitIterationBody(node.statement, topLevelNestedVisitor, context) - ); - enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; - return node; - } - function shouldHoistForInitializer(node) { - return isVariableDeclarationList(node) && shouldHoistVariableDeclarationList(node); - } - function visitForInitializer(node) { - if (shouldHoistForInitializer(node)) { - let expressions; - for (const variable of node.declarations) { - expressions = append(expressions, transformInitializedVariable( - variable, - /*isExportedDeclaration*/ - false - )); - if (!variable.initializer) { - hoistBindingElement(variable); - } - } - return expressions ? factory2.inlineExpressions(expressions) : factory2.createOmittedExpression(); - } else { - return visitNode(node, discardedValueVisitor, isForInitializer); - } - } - function visitDoStatement(node) { - return factory2.updateDoStatement( - node, - visitIterationBody(node.statement, topLevelNestedVisitor, context), - visitNode(node.expression, visitor, isExpression) - ); - } - function visitWhileStatement(node) { - return factory2.updateWhileStatement( - node, - visitNode(node.expression, visitor, isExpression), - visitIterationBody(node.statement, topLevelNestedVisitor, context) - ); - } - function visitLabeledStatement(node) { - return factory2.updateLabeledStatement( - node, - node.label, - visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier("")) - ); - } - function visitWithStatement(node) { - return factory2.updateWithStatement( - node, - visitNode(node.expression, visitor, isExpression), - Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) - ); - } - function visitIfStatement(node) { - return factory2.updateIfStatement( - node, - visitNode(node.expression, visitor, isExpression), - visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]), - visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) - ); - } - function visitSwitchStatement(node) { - return factory2.updateSwitchStatement( - node, - visitNode(node.expression, visitor, isExpression), - Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) - ); - } - function visitCaseBlock(node) { - const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; - enclosingBlockScopedContainer = node; - node = factory2.updateCaseBlock( - node, - visitNodes2(node.clauses, topLevelNestedVisitor, isCaseOrDefaultClause) - ); - enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; - return node; - } - function visitCaseClause(node) { - return factory2.updateCaseClause( - node, - visitNode(node.expression, visitor, isExpression), - visitNodes2(node.statements, topLevelNestedVisitor, isStatement) - ); - } - function visitDefaultClause(node) { - return visitEachChild(node, topLevelNestedVisitor, context); - } - function visitTryStatement(node) { - return visitEachChild(node, topLevelNestedVisitor, context); - } - function visitCatchClause(node) { - const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; - enclosingBlockScopedContainer = node; - node = factory2.updateCatchClause( - node, - node.variableDeclaration, - Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock)) - ); - enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; - return node; - } - function visitBlock(node) { - const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; - enclosingBlockScopedContainer = node; - node = visitEachChild(node, topLevelNestedVisitor, context); - enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; - return node; - } - function visitorWorker(node, valueIsDiscarded) { - if (!(node.transformFlags & (4096 /* ContainsDestructuringAssignment */ | 8388608 /* ContainsDynamicImport */ | 268435456 /* ContainsUpdateExpressionForIdentifier */))) { - return node; - } - switch (node.kind) { - case 249 /* ForStatement */: - return visitForStatement( - node, - /*isTopLevel*/ - false - ); - case 245 /* ExpressionStatement */: - return visitExpressionStatement(node); - case 218 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, valueIsDiscarded); - case 356 /* PartiallyEmittedExpression */: - return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 227 /* BinaryExpression */: - if (isDestructuringAssignment(node)) { - return visitDestructuringAssignment(node, valueIsDiscarded); - } - break; - case 214 /* CallExpression */: - if (isImportCall(node)) { - return visitImportCallExpression(node); - } - break; - case 225 /* PrefixUnaryExpression */: - case 226 /* PostfixUnaryExpression */: - return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded); - } - return visitEachChild(node, visitor, context); - } - function visitor(node) { - return visitorWorker( - node, - /*valueIsDiscarded*/ - false - ); - } - function discardedValueVisitor(node) { - return visitorWorker( - node, - /*valueIsDiscarded*/ - true - ); - } - function visitExpressionStatement(node) { - return factory2.updateExpressionStatement(node, visitNode(node.expression, discardedValueVisitor, isExpression)); - } - function visitParenthesizedExpression(node, valueIsDiscarded) { - return factory2.updateParenthesizedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); - } - function visitPartiallyEmittedExpression(node, valueIsDiscarded) { - return factory2.updatePartiallyEmittedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); - } - function visitImportCallExpression(node) { - const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); - const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); - const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; - return factory2.createCallExpression( - factory2.createPropertyAccessExpression( - contextObject, - factory2.createIdentifier("import") - ), - /*typeArguments*/ - void 0, - argument ? [argument] : [] - ); - } - function visitDestructuringAssignment(node, valueIsDiscarded) { - if (hasExportedReferenceInDestructuringTarget(node.left)) { - return flattenDestructuringAssignment( - node, - visitor, - context, - 0 /* All */, - !valueIsDiscarded - ); - } - return visitEachChild(node, visitor, context); - } - function hasExportedReferenceInDestructuringTarget(node) { - if (isAssignmentExpression( - node, - /*excludeCompoundAssignment*/ - true - )) { - return hasExportedReferenceInDestructuringTarget(node.left); - } else if (isSpreadElement(node)) { - return hasExportedReferenceInDestructuringTarget(node.expression); - } else if (isObjectLiteralExpression(node)) { - return some(node.properties, hasExportedReferenceInDestructuringTarget); - } else if (isArrayLiteralExpression(node)) { - return some(node.elements, hasExportedReferenceInDestructuringTarget); - } else if (isShorthandPropertyAssignment(node)) { - return hasExportedReferenceInDestructuringTarget(node.name); - } else if (isPropertyAssignment(node)) { - return hasExportedReferenceInDestructuringTarget(node.initializer); - } else if (isIdentifier(node)) { - const container = resolver.getReferencedExportContainer(node); - return container !== void 0 && container.kind === 308 /* SourceFile */; - } else { - return false; - } - } - function visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded) { - if ((node.operator === 46 /* PlusPlusToken */ || node.operator === 47 /* MinusMinusToken */) && isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand) && !isDeclarationNameOfEnumOrNamespace(node.operand)) { - const exportedNames = getExports(node.operand); - if (exportedNames) { - let temp; - let expression = visitNode(node.operand, visitor, isExpression); - if (isPrefixUnaryExpression(node)) { - expression = factory2.updatePrefixUnaryExpression(node, expression); - } else { - expression = factory2.updatePostfixUnaryExpression(node, expression); - if (!valueIsDiscarded) { - temp = factory2.createTempVariable(hoistVariableDeclaration); - expression = factory2.createAssignment(temp, expression); - setTextRange(expression, node); - } - expression = factory2.createComma(expression, factory2.cloneNode(node.operand)); - setTextRange(expression, node); - } - for (const exportName of exportedNames) { - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - if (temp) { - expression = factory2.createComma(expression, temp); - setTextRange(expression, node); - } - return expression; - } - } - return visitEachChild(node, visitor, context); - } - function modifierVisitor(node) { - switch (node.kind) { - case 95 /* ExportKeyword */: - case 90 /* DefaultKeyword */: - return void 0; - } - return node; - } - function onEmitNode(hint, node, emitCallback) { - if (node.kind === 308 /* SourceFile */) { - const id = getOriginalNodeId(node); - currentSourceFile = node; - moduleInfo = moduleInfoMap[id]; - exportFunction = exportFunctionsMap[id]; - noSubstitution = noSubstitutionMap[id]; - contextObject = contextObjectMap[id]; - if (noSubstitution) { - delete noSubstitutionMap[id]; - } - previousOnEmitNode(hint, node, emitCallback); - currentSourceFile = void 0; - moduleInfo = void 0; - exportFunction = void 0; - contextObject = void 0; - noSubstitution = void 0; - } else { - previousOnEmitNode(hint, node, emitCallback); - } - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (isSubstitutionPrevented(node)) { - return node; - } - if (hint === 1 /* Expression */) { - return substituteExpression(node); - } else if (hint === 4 /* Unspecified */) { - return substituteUnspecified(node); - } - return node; - } - function substituteUnspecified(node) { - switch (node.kind) { - case 305 /* ShorthandPropertyAssignment */: - return substituteShorthandPropertyAssignment(node); - } - return node; - } - function substituteShorthandPropertyAssignment(node) { - var _a, _b; - const name = node.name; - if (!isGeneratedIdentifier(name) && !isLocalName(name)) { - const importDeclaration = resolver.getReferencedImportDeclaration(name); - if (importDeclaration) { - if (isImportClause(importDeclaration)) { - return setTextRange( - factory2.createPropertyAssignment( - factory2.cloneNode(name), - factory2.createPropertyAccessExpression( - factory2.getGeneratedNameForNode(importDeclaration.parent), - factory2.createIdentifier("default") - ) - ), - /*location*/ - node - ); - } else if (isImportSpecifier(importDeclaration)) { - const importedName = importDeclaration.propertyName || importDeclaration.name; - const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration); - return setTextRange( - factory2.createPropertyAssignment( - factory2.cloneNode(name), - importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName)) - ), - /*location*/ - node - ); - } - } - } - return node; - } - function substituteExpression(node) { - switch (node.kind) { - case 80 /* Identifier */: - return substituteExpressionIdentifier(node); - case 227 /* BinaryExpression */: - return substituteBinaryExpression(node); - case 237 /* MetaProperty */: - return substituteMetaProperty(node); - } - return node; - } - function substituteExpressionIdentifier(node) { - var _a, _b; - if (getEmitFlags(node) & 8192 /* HelperName */) { - const externalHelpersModuleName = getExternalHelpersModuleName(currentSourceFile); - if (externalHelpersModuleName) { - return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); - } - return node; - } - if (!isGeneratedIdentifier(node) && !isLocalName(node)) { - const importDeclaration = resolver.getReferencedImportDeclaration(node); - if (importDeclaration) { - if (isImportClause(importDeclaration)) { - return setTextRange( - factory2.createPropertyAccessExpression( - factory2.getGeneratedNameForNode(importDeclaration.parent), - factory2.createIdentifier("default") - ), - /*location*/ - node - ); - } else if (isImportSpecifier(importDeclaration)) { - const importedName = importDeclaration.propertyName || importDeclaration.name; - const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration); - return setTextRange( - importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName)), - /*location*/ - node - ); - } - } - } - return node; - } - function substituteBinaryExpression(node) { - 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; - for (const exportName of exportedNames) { - expression = createExportExpression(exportName, preventSubstitution(expression)); - } - return expression; - } - } - return node; - } - function substituteMetaProperty(node) { - if (isImportMeta(node)) { - return factory2.createPropertyAccessExpression(contextObject, factory2.createIdentifier("meta")); - } - return node; - } - function getExports(name) { - let exportedNames; - const valueDeclaration = getReferencedDeclaration(name); - if (valueDeclaration) { - const exportContainer = resolver.getReferencedExportContainer( - name, - /*prefixLocals*/ - false - ); - if (exportContainer && exportContainer.kind === 308 /* 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; - } - function getReferencedDeclaration(name) { - if (!isGeneratedIdentifier(name)) { - const importDeclaration = resolver.getReferencedImportDeclaration(name); - if (importDeclaration) return importDeclaration; - const valueDeclaration = resolver.getReferencedValueDeclaration(name); - if (valueDeclaration && (moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)])) return valueDeclaration; - const declarations = resolver.getReferencedValueDeclarations(name); - if (declarations) { - for (const declaration of declarations) { - if (declaration !== valueDeclaration && (moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(declaration)])) return declaration; - } - } - return valueDeclaration; - } - } - function preventSubstitution(node) { - if (noSubstitution === void 0) noSubstitution = []; - noSubstitution[getNodeId(node)] = true; - return node; - } - function isSubstitutionPrevented(node) { - return noSubstitution && node.id && noSubstitution[node.id]; - } -} - -// src/compiler/transformers/module/esnextAnd2015.ts -function transformECMAScriptModule(context) { - const { - factory: factory2, - getEmitHelperFactory: emitHelpers - } = context; - const host = context.getEmitHost(); - const resolver = context.getEmitResolver(); - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); - const previousOnEmitNode = context.onEmitNode; - const previousOnSubstituteNode = context.onSubstituteNode; - context.onEmitNode = onEmitNode; - context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(308 /* SourceFile */); - context.enableSubstitution(80 /* Identifier */); - const noSubstitution = /* @__PURE__ */ new Set(); - let importsAndRequiresToRewriteOrShim; - let helperNameSubstitutions; - let currentSourceFile; - let importRequireStatements; - return chainBundle(context, transformSourceFile); - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { - currentSourceFile = node; - importRequireStatements = void 0; - if (compilerOptions.rewriteRelativeImportExtensions && (currentSourceFile.flags & 4194304 /* PossiblyContainsDynamicImport */ || isInJSFile(node))) { - forEachDynamicImportOrRequireCall( - node, - /*includeTypeSpaceImports*/ - false, - /*requireStringLiteralLikeArgument*/ - false, - (node2) => { - if (!isStringLiteralLike(node2.arguments[0]) || shouldRewriteModuleSpecifier(node2.arguments[0].text, compilerOptions)) { - importsAndRequiresToRewriteOrShim = append(importsAndRequiresToRewriteOrShim, node2); - } - } - ); - } - let result = updateExternalModule(node); - addEmitHelpers(result, context.readEmitHelpers()); - currentSourceFile = void 0; - if (importRequireStatements) { - result = factory2.updateSourceFile( - result, - setTextRange(factory2.createNodeArray(insertStatementsAfterCustomPrologue(result.statements.slice(), importRequireStatements)), result.statements) - ); - } - if (!isExternalModule(node) || getEmitModuleKind(compilerOptions) === 200 /* Preserve */ || some(result.statements, isExternalModuleIndicator)) { - return result; - } - return factory2.updateSourceFile( - result, - setTextRange(factory2.createNodeArray([...result.statements, createEmptyExports(factory2)]), result.statements) - ); - } - return node; - } - function updateExternalModule(node) { - const externalHelpersImportDeclaration = createExternalHelpersImportDeclarationIfNeeded(factory2, emitHelpers(), node, compilerOptions); - if (externalHelpersImportDeclaration) { - const statements = []; - const statementOffset = factory2.copyPrologue(node.statements, statements); - addRange(statements, visitArray([externalHelpersImportDeclaration], visitor, isStatement)); - addRange(statements, visitNodes2(node.statements, visitor, isStatement, statementOffset)); - return factory2.updateSourceFile( - node, - setTextRange(factory2.createNodeArray(statements), node.statements) - ); - } else { - return visitEachChild(node, visitor, context); - } - } - function visitor(node) { - switch (node.kind) { - case 272 /* ImportEqualsDeclaration */: - return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0; - case 278 /* ExportAssignment */: - return visitExportAssignment(node); - case 279 /* ExportDeclaration */: - const exportDecl = node; - return visitExportDeclaration(exportDecl); - case 273 /* ImportDeclaration */: - return visitImportDeclaration(node); - case 214 /* CallExpression */: - if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) { - return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift()); - } - // fallthrough - default: - if ((importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim.length) && rangeContainsRange(node, importsAndRequiresToRewriteOrShim[0])) { - return visitEachChild(node, visitor, context); - } - } - return node; - } - function visitImportDeclaration(node) { - if (!compilerOptions.rewriteRelativeImportExtensions) { - return node; - } - const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleSpecifier, compilerOptions); - if (updatedModuleSpecifier === node.moduleSpecifier) { - return node; - } - return factory2.updateImportDeclaration( - node, - node.modifiers, - node.importClause, - updatedModuleSpecifier, - node.attributes - ); - } - function visitImportOrRequireCall(node) { - return factory2.updateCallExpression( - node, - node.expression, - node.typeArguments, - [ - isStringLiteralLike(node.arguments[0]) ? rewriteModuleSpecifier(node.arguments[0], compilerOptions) : emitHelpers().createRewriteRelativeImportExtensionsHelper(node.arguments[0]), - ...node.arguments.slice(1) - ] - ); - } - function createRequireCall2(importNode) { - const moduleName = getExternalModuleNameLiteral(factory2, importNode, Debug.checkDefined(currentSourceFile), host, resolver, compilerOptions); - const args = []; - if (moduleName) { - args.push(rewriteModuleSpecifier(moduleName, compilerOptions)); - } - 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( - /*modifiers*/ - void 0, - factory2.createImportClause( - /*phaseModifier*/ - void 0, - /*name*/ - void 0, - factory2.createNamedImports([ - factory2.createImportSpecifier( - /*isTypeOnly*/ - false, - factory2.createIdentifier("createRequire"), - createRequireName - ) - ]) - ), - factory2.createStringLiteral("module"), - /*attributes*/ - void 0 - ); - const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */); - const requireStatement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - [ - factory2.createVariableDeclaration( - requireHelperName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory2.createCallExpression( - factory2.cloneNode(createRequireName), - /*typeArguments*/ - void 0, - [ - factory2.createPropertyAccessExpression(factory2.createMetaProperty(102 /* ImportKeyword */, factory2.createIdentifier("meta")), factory2.createIdentifier("url")) - ] - ) - ) - ], - /*flags*/ - languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */ - ) - ); - importRequireStatements = [importStatement, requireStatement]; - } - const name = importRequireStatements[1].declarationList.declarations[0].name; - Debug.assertNode(name, isIdentifier); - return factory2.createCallExpression( - factory2.cloneNode(name), - /*typeArguments*/ - void 0, - args - ); - } - function visitImportEqualsDeclaration(node) { - Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); - let statements; - statements = append( - statements, - setOriginalNode( - setTextRange( - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - [ - factory2.createVariableDeclaration( - factory2.cloneNode(node.name), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - createRequireCall2(node) - ) - ], - /*flags*/ - languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */ - ) - ), - node - ), - node - ) - ); - statements = appendExportsOfImportEqualsDeclaration(statements, node); - return singleOrMany(statements); - } - function appendExportsOfImportEqualsDeclaration(statements, node) { - if (hasSyntacticModifier(node, 32 /* Export */)) { - statements = append( - statements, - factory2.createExportDeclaration( - /*modifiers*/ - void 0, - node.isTypeOnly, - factory2.createNamedExports([factory2.createExportSpecifier( - /*isTypeOnly*/ - false, - /*propertyName*/ - void 0, - idText(node.name) - )]) - ) - ); - } - return statements; - } - function visitExportAssignment(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) { - const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleSpecifier, compilerOptions); - if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */ || !node.exportClause || !isNamespaceExport(node.exportClause) || !node.moduleSpecifier) { - return !node.moduleSpecifier || updatedModuleSpecifier === node.moduleSpecifier ? node : factory2.updateExportDeclaration( - node, - node.modifiers, - node.isTypeOnly, - node.exportClause, - updatedModuleSpecifier, - node.attributes - ); - } - const oldIdentifier = node.exportClause.name; - const synthName = factory2.getGeneratedNameForNode(oldIdentifier); - const importDecl = factory2.createImportDeclaration( - /*modifiers*/ - void 0, - factory2.createImportClause( - /*phaseModifier*/ - void 0, - /*name*/ - void 0, - factory2.createNamespaceImport( - synthName - ) - ), - updatedModuleSpecifier, - node.attributes - ); - setOriginalNode(importDecl, node.exportClause); - const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory2.createNamedExports([factory2.createExportSpecifier( - /*isTypeOnly*/ - false, - synthName, - oldIdentifier - )]) - ); - setOriginalNode(exportDecl, node); - return [importDecl, exportDecl]; - } - function onEmitNode(hint, node, emitCallback) { - if (isSourceFile(node)) { - if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) { - helperNameSubstitutions = /* @__PURE__ */ new Map(); - } - currentSourceFile = node; - previousOnEmitNode(hint, node, emitCallback); - currentSourceFile = void 0; - helperNameSubstitutions = void 0; - } else { - previousOnEmitNode(hint, node, emitCallback); - } - } - function onSubstituteNode(hint, node) { - node = previousOnSubstituteNode(hint, node); - if (node.id && noSubstitution.has(node.id)) { - return node; - } - if (isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) { - return substituteHelperName(node); - } - return node; - } - function substituteHelperName(node) { - const externalHelpersModuleName = currentSourceFile && getExternalHelpersModuleName(currentSourceFile); - if (externalHelpersModuleName) { - noSubstitution.add(getNodeId(node)); - return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); - } - if (helperNameSubstitutions) { - const name = idText(node); - let substitution = helperNameSubstitutions.get(name); - if (!substitution) { - helperNameSubstitutions.set(name, substitution = factory2.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */)); - } - return substitution; - } - return node; - } -} - -// src/compiler/transformers/module/impliedNodeFormatDependent.ts -function transformImpliedNodeFormatDependentModule(context) { - const previousOnSubstituteNode = context.onSubstituteNode; - const previousOnEmitNode = context.onEmitNode; - const esmTransform = transformECMAScriptModule(context); - const esmOnSubstituteNode = context.onSubstituteNode; - const esmOnEmitNode = context.onEmitNode; - context.onSubstituteNode = previousOnSubstituteNode; - context.onEmitNode = previousOnEmitNode; - const cjsTransform = transformModule(context); - const cjsOnSubstituteNode = context.onSubstituteNode; - const cjsOnEmitNode = context.onEmitNode; - const getEmitModuleFormatOfFile2 = (file) => context.getEmitHost().getEmitModuleFormatOfFile(file); - context.onSubstituteNode = onSubstituteNode; - context.onEmitNode = onEmitNode; - context.enableSubstitution(308 /* SourceFile */); - context.enableEmitNotification(308 /* SourceFile */); - let currentSourceFile; - return transformSourceFileOrBundle; - function onSubstituteNode(hint, node) { - if (isSourceFile(node)) { - currentSourceFile = node; - return previousOnSubstituteNode(hint, node); - } else { - if (!currentSourceFile) { - return previousOnSubstituteNode(hint, node); - } - if (getEmitModuleFormatOfFile2(currentSourceFile) >= 5 /* ES2015 */) { - return esmOnSubstituteNode(hint, node); - } - return cjsOnSubstituteNode(hint, node); - } - } - function onEmitNode(hint, node, emitCallback) { - if (isSourceFile(node)) { - currentSourceFile = node; - } - if (!currentSourceFile) { - return previousOnEmitNode(hint, node, emitCallback); - } - if (getEmitModuleFormatOfFile2(currentSourceFile) >= 5 /* ES2015 */) { - return esmOnEmitNode(hint, node, emitCallback); - } - return cjsOnEmitNode(hint, node, emitCallback); - } - function getModuleTransformForFile(file) { - return getEmitModuleFormatOfFile2(file) >= 5 /* ES2015 */ ? esmTransform : cjsTransform; - } - function transformSourceFile(node) { - if (node.isDeclarationFile) { - return node; - } - currentSourceFile = node; - const result = getModuleTransformForFile(node)(node); - currentSourceFile = void 0; - Debug.assert(isSourceFile(result)); - return result; - } - function transformSourceFileOrBundle(node) { - return node.kind === 308 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); - } - function transformBundle(node) { - return context.factory.createBundle(map(node.sourceFiles, transformSourceFile)); - } -} - -// src/compiler/transformers/declarations/diagnostics.ts -function canProduceDiagnostics(node) { - return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node); -} -function createGetSymbolAccessibilityDiagnosticForNodeName(node) { - if (isSetAccessor(node) || isGetAccessor(node)) { - return getAccessorNameVisibilityError; - } else if (isMethodSignature(node) || isMethodDeclaration(node)) { - return getMethodNameVisibilityError; - } else { - return createGetSymbolAccessibilityDiagnosticForNode(node); - } - function getAccessorNameVisibilityError(symbolAccessibilityResult) { - const diagnosticMessage = getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult); - return diagnosticMessage !== void 0 ? { - diagnosticMessage, - errorNode: node, - typeName: node.name - } : void 0; - } - 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 === 264 /* 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; - } - } - function getMethodNameVisibilityError(symbolAccessibilityResult) { - const diagnosticMessage = getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult); - return diagnosticMessage !== void 0 ? { - diagnosticMessage, - errorNode: node, - typeName: node.name - } : void 0; - } - 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 === 264 /* 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; - } - } -} -function createGetSymbolAccessibilityDiagnosticForNode(node) { - if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) { - return getVariableDeclarationTypeVisibilityError; - } else if (isSetAccessor(node) || isGetAccessor(node)) { - return getAccessorDeclarationTypeVisibilityError; - } 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, 2 /* Private */)) { - return getVariableDeclarationTypeVisibilityError; - } - return getParameterDeclarationTypeVisibilityError; - } else if (isTypeParameterDeclaration(node)) { - return getTypeParameterConstraintVisibilityError; - } else if (isExpressionWithTypeArguments(node)) { - return getHeritageClauseVisibilityError; - } else if (isImportEqualsDeclaration(node)) { - return getImportEntityNameVisibilityError; - } else if (isTypeAliasDeclaration(node) || isJSDocTypeAlias(node)) { - return getTypeAliasDeclarationVisibilityError; - } else { - 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 === 261 /* VariableDeclaration */ || node.kind === 209 /* 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 === 173 /* PropertyDeclaration */ || node.kind === 212 /* PropertyAccessExpression */ || node.kind === 213 /* ElementAccessExpression */ || node.kind === 227 /* BinaryExpression */ || node.kind === 172 /* PropertySignature */ || node.kind === 170 /* 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 === 264 /* ClassDeclaration */ || node.kind === 170 /* 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; - } - } - } - function getVariableDeclarationTypeVisibilityError(symbolAccessibilityResult) { - const diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult); - return diagnosticMessage !== void 0 ? { - diagnosticMessage, - errorNode: node, - typeName: node.name - } : void 0; - } - function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { - let diagnosticMessage; - if (node.kind === 179 /* 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 { - diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1; - } - } else { - if (isStatic(node)) { - diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1; - } else { - diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1; - } - } - return { - diagnosticMessage, - errorNode: node.name, - typeName: node.name - }; - } - function getReturnTypeVisibilityError(symbolAccessibilityResult) { - let diagnosticMessage; - switch (node.kind) { - case 181 /* 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 180 /* 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 182 /* 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 175 /* MethodDeclaration */: - case 174 /* 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 === 264 /* 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 263 /* 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: - return Debug.fail("This is unknown kind for signature: " + node.kind); - } - return { - diagnosticMessage, - errorNode: node.name || node - }; - } - function getParameterDeclarationTypeVisibilityError(symbolAccessibilityResult) { - const diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult); - return diagnosticMessage !== void 0 ? { - diagnosticMessage, - errorNode: node, - typeName: node.name - } : void 0; - } - function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - switch (node.parent.kind) { - case 177 /* 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 181 /* ConstructSignature */: - case 186 /* 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 180 /* 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 182 /* 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 175 /* MethodDeclaration */: - case 174 /* 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 === 264 /* 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 263 /* FunctionDeclaration */: - case 185 /* 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 179 /* SetAccessor */: - case 178 /* 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)}`); - } - } - function getTypeParameterConstraintVisibilityError() { - let diagnosticMessage; - switch (node.parent.kind) { - case 264 /* ClassDeclaration */: - diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; - break; - case 265 /* InterfaceDeclaration */: - diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; - break; - case 201 /* MappedType */: - diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; - break; - case 186 /* ConstructorType */: - case 181 /* ConstructSignature */: - diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 180 /* CallSignature */: - diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 175 /* MethodDeclaration */: - case 174 /* 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 === 264 /* 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 185 /* FunctionType */: - case 263 /* FunctionDeclaration */: - diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - case 196 /* InferType */: - diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1; - break; - case 266 /* TypeAliasDeclaration */: - diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; - break; - default: - return Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); - } - return { - diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - function getHeritageClauseVisibilityError() { - let diagnosticMessage; - if (isClassDeclaration(node.parent.parent)) { - diagnosticMessage = isHeritageClause(node.parent) && node.parent.token === 119 /* ImplementsKeyword */ ? Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : node.parent.parent.name ? Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1 : Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0; - } else { - diagnosticMessage = Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } - return { - diagnosticMessage, - errorNode: node, - typeName: getNameOfDeclaration(node.parent.parent) - }; - } - function getImportEntityNameVisibilityError() { - return { - diagnosticMessage: Diagnostics.Import_declaration_0_is_using_private_name_1, - errorNode: node, - typeName: node.name - }; - } - function getTypeAliasDeclarationVisibilityError(symbolAccessibilityResult) { - return { - diagnosticMessage: symbolAccessibilityResult.errorModuleName ? Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2 : Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, - errorNode: isJSDocTypeAlias(node) ? Debug.checkDefined(node.typeExpression) : node.type, - typeName: isJSDocTypeAlias(node) ? getNameOfDeclaration(node) : node.name - }; - } -} -function createGetIsolatedDeclarationErrors(resolver) { - const relatedSuggestionByDeclarationKind = { - [220 /* ArrowFunction */]: Diagnostics.Add_a_return_type_to_the_function_expression, - [219 /* FunctionExpression */]: Diagnostics.Add_a_return_type_to_the_function_expression, - [175 /* MethodDeclaration */]: Diagnostics.Add_a_return_type_to_the_method, - [178 /* GetAccessor */]: Diagnostics.Add_a_return_type_to_the_get_accessor_declaration, - [179 /* SetAccessor */]: Diagnostics.Add_a_type_to_parameter_of_the_set_accessor_declaration, - [263 /* FunctionDeclaration */]: Diagnostics.Add_a_return_type_to_the_function_declaration, - [181 /* ConstructSignature */]: Diagnostics.Add_a_return_type_to_the_function_declaration, - [170 /* Parameter */]: Diagnostics.Add_a_type_annotation_to_the_parameter_0, - [261 /* VariableDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_variable_0, - [173 /* PropertyDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_property_0, - [172 /* PropertySignature */]: Diagnostics.Add_a_type_annotation_to_the_property_0, - [278 /* ExportAssignment */]: Diagnostics.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it - }; - const errorByDeclarationKind = { - [219 /* FunctionExpression */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [263 /* FunctionDeclaration */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [220 /* ArrowFunction */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [175 /* MethodDeclaration */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [181 /* ConstructSignature */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [178 /* GetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [179 /* SetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [170 /* Parameter */]: Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [261 /* VariableDeclaration */]: Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [173 /* PropertyDeclaration */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [172 /* PropertySignature */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [168 /* ComputedPropertyName */]: Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations, - [306 /* SpreadAssignment */]: Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations, - [305 /* ShorthandPropertyAssignment */]: Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations, - [210 /* ArrayLiteralExpression */]: Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations, - [278 /* ExportAssignment */]: Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations, - [231 /* SpreadElement */]: Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations - }; - return getDiagnostic2; - function getDiagnostic2(node) { - const heritageClause = findAncestor(node, isHeritageClause); - if (heritageClause) { - return createDiagnosticForNode(node, Diagnostics.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations); - } - if ((isPartOfTypeNode(node) || isTypeQueryNode(node.parent)) && (isEntityName(node) || isEntityNameExpression(node))) { - return createEntityInTypeNodeError(node); - } - Debug.type(node); - switch (node.kind) { - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return createAccessorTypeError(node); - case 168 /* ComputedPropertyName */: - case 305 /* ShorthandPropertyAssignment */: - case 306 /* SpreadAssignment */: - return createObjectLiteralError(node); - case 210 /* ArrayLiteralExpression */: - case 231 /* SpreadElement */: - return createArrayLiteralError(node); - case 175 /* MethodDeclaration */: - case 181 /* ConstructSignature */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 263 /* FunctionDeclaration */: - return createReturnTypeError(node); - case 209 /* BindingElement */: - return createBindingElementError(node); - case 173 /* PropertyDeclaration */: - case 261 /* VariableDeclaration */: - return createVariableOrPropertyError(node); - case 170 /* Parameter */: - return createParameterError(node); - case 304 /* PropertyAssignment */: - return createExpressionError(node.initializer); - case 232 /* ClassExpression */: - return createClassExpressionError(node); - default: - assertType(node); - return createExpressionError(node); - } - } - function findNearestDeclaration(node) { - const result = findAncestor(node, (n) => isExportAssignment(n) || isStatement(n) || isVariableDeclaration(n) || isPropertyDeclaration(n) || isParameter(n)); - if (!result) return void 0; - if (isExportAssignment(result)) return result; - if (isReturnStatement(result)) { - return findAncestor(result, (n) => isFunctionLikeDeclaration(n) && !isConstructorDeclaration(n)); - } - return isStatement(result) ? void 0 : result; - } - function createAccessorTypeError(node) { - const { getAccessor, setAccessor } = getAllAccessorDeclarations(node.symbol.declarations, node); - const targetNode = (isSetAccessor(node) ? node.parameters[0] : node) ?? node; - const diag2 = createDiagnosticForNode(targetNode, errorByDeclarationKind[node.kind]); - if (setAccessor) { - addRelatedInfo(diag2, createDiagnosticForNode(setAccessor, relatedSuggestionByDeclarationKind[setAccessor.kind])); - } - if (getAccessor) { - addRelatedInfo(diag2, createDiagnosticForNode(getAccessor, relatedSuggestionByDeclarationKind[getAccessor.kind])); - } - return diag2; - } - function addParentDeclarationRelatedInfo(node, diag2) { - const parentDeclaration = findNearestDeclaration(node); - if (parentDeclaration) { - const targetStr = isExportAssignment(parentDeclaration) || !parentDeclaration.name ? "" : getTextOfNode( - parentDeclaration.name, - /*includeTrivia*/ - false - ); - addRelatedInfo(diag2, createDiagnosticForNode(parentDeclaration, relatedSuggestionByDeclarationKind[parentDeclaration.kind], targetStr)); - } - return diag2; - } - function createObjectLiteralError(node) { - const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]); - addParentDeclarationRelatedInfo(node, diag2); - return diag2; - } - function createArrayLiteralError(node) { - const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]); - addParentDeclarationRelatedInfo(node, diag2); - return diag2; - } - function createReturnTypeError(node) { - const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]); - addParentDeclarationRelatedInfo(node, diag2); - addRelatedInfo(diag2, createDiagnosticForNode(node, relatedSuggestionByDeclarationKind[node.kind])); - return diag2; - } - function createBindingElementError(node) { - return createDiagnosticForNode(node, Diagnostics.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations); - } - function createVariableOrPropertyError(node) { - const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]); - const targetStr = getTextOfNode( - node.name, - /*includeTrivia*/ - false - ); - addRelatedInfo(diag2, createDiagnosticForNode(node, relatedSuggestionByDeclarationKind[node.kind], targetStr)); - return diag2; - } - function createParameterError(node) { - if (isSetAccessor(node.parent)) { - return createAccessorTypeError(node.parent); - } - const addUndefined = resolver.requiresAddingImplicitUndefined(node, node.parent); - if (!addUndefined && node.initializer) { - return createExpressionError(node.initializer); - } - const message = addUndefined ? Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations : errorByDeclarationKind[node.kind]; - const diag2 = createDiagnosticForNode(node, message); - const targetStr = getTextOfNode( - node.name, - /*includeTrivia*/ - false - ); - addRelatedInfo(diag2, createDiagnosticForNode(node, relatedSuggestionByDeclarationKind[node.kind], targetStr)); - return diag2; - } - function createClassExpressionError(node) { - return createExpressionError(node, Diagnostics.Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations); - } - function createEntityInTypeNodeError(node) { - const diag2 = createDiagnosticForNode(node, Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations, getTextOfNode( - node, - /*includeTrivia*/ - false - )); - addParentDeclarationRelatedInfo(node, diag2); - return diag2; - } - function createExpressionError(node, diagnosticMessage) { - const parentDeclaration = findNearestDeclaration(node); - let diag2; - if (parentDeclaration) { - const targetStr = isExportAssignment(parentDeclaration) || !parentDeclaration.name ? "" : getTextOfNode( - parentDeclaration.name, - /*includeTrivia*/ - false - ); - const parent2 = findAncestor(node.parent, (n) => isExportAssignment(n) || (isStatement(n) ? "quit" : !isParenthesizedExpression(n) && !isTypeAssertionExpression(n) && !isAsExpression(n))); - if (parentDeclaration === parent2) { - diag2 = createDiagnosticForNode(node, diagnosticMessage ?? errorByDeclarationKind[parentDeclaration.kind]); - addRelatedInfo(diag2, createDiagnosticForNode(parentDeclaration, relatedSuggestionByDeclarationKind[parentDeclaration.kind], targetStr)); - } else { - diag2 = createDiagnosticForNode(node, diagnosticMessage ?? Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations); - addRelatedInfo(diag2, createDiagnosticForNode(parentDeclaration, relatedSuggestionByDeclarationKind[parentDeclaration.kind], targetStr)); - addRelatedInfo(diag2, createDiagnosticForNode(node, Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit)); - } - } else { - diag2 = createDiagnosticForNode(node, diagnosticMessage ?? Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations); - } - return diag2; - } -} - -// src/compiler/transformers/declarations.ts -function getDeclarationDiagnostics(host, resolver, file) { - const compilerOptions = host.getCompilerOptions(); - const files = filter(getSourceFilesToEmit(host, file), isSourceFileNotJson); - return contains(files, file) ? transformNodes( - resolver, - host, - factory, - compilerOptions, - [file], - [transformDeclarations], - /*allowDtsFiles*/ - false - ).diagnostics : void 0; -} -var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */; -var declarationEmitInternalNodeBuilderFlags = 8 /* AllowUnresolvedNames */; -function transformDeclarations(context) { - const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context"); - let getSymbolAccessibilityDiagnostic = throwDiagnostic; - let needsDeclare = true; - let isBundledEmit = false; - let resultHasExternalModuleIndicator = false; - let needsScopeFixMarker = false; - let resultHasScopeMarker = false; - let enclosingDeclaration; - let lateMarkedStatements; - let lateStatementReplacementMap; - let suppressNewDiagnosticContexts; - const { factory: factory2 } = context; - const host = context.getEmitHost(); - let restoreFallbackNode = () => void 0; - const symbolTracker = { - trackSymbol, - reportInaccessibleThisError, - reportInaccessibleUniqueSymbolError, - reportCyclicStructureError, - reportPrivateInBaseOfClassExpression, - reportLikelyUnsafeImportRequiredError, - reportTruncationError, - moduleResolverHost: host, - reportNonlocalAugmentation, - reportNonSerializableProperty, - reportInferenceFallback, - pushErrorFallbackNode(node) { - const currentFallback = errorFallbackNode; - const currentRestore = restoreFallbackNode; - restoreFallbackNode = () => { - restoreFallbackNode = currentRestore; - errorFallbackNode = currentFallback; - }; - errorFallbackNode = node; - }, - popErrorFallbackNode() { - restoreFallbackNode(); - } - }; - let errorNameNode; - let errorFallbackNode; - let currentSourceFile; - let rawReferencedFiles; - let rawTypeReferenceDirectives; - let rawLibReferenceDirectives; - const resolver = context.getEmitResolver(); - const options = context.getCompilerOptions(); - const getIsolatedDeclarationError = createGetIsolatedDeclarationErrors(resolver); - const { stripInternal, isolatedDeclarations } = options; - return transformRoot; - function reportExpandoFunctionErrors(node) { - resolver.getPropertiesOfContainerFunction(node).forEach((p) => { - if (isExpandoPropertyDeclaration(p.valueDeclaration)) { - const errorTarget = isBinaryExpression(p.valueDeclaration) ? p.valueDeclaration.left : p.valueDeclaration; - context.addDiagnostic(createDiagnosticForNode( - errorTarget, - Diagnostics.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function - )); - } - }); - } - function reportInferenceFallback(node) { - if (!isolatedDeclarations || isSourceFileJS(currentSourceFile)) return; - if (getSourceFileOfNode(node) !== currentSourceFile) return; - if (isVariableDeclaration(node) && resolver.isExpandoFunctionDeclaration(node)) { - reportExpandoFunctionErrors(node); - } else { - context.addDiagnostic(getIsolatedDeclarationError(node)); - } - } - function handleSymbolAccessibilityError(symbolAccessibilityResult) { - if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) { - if (symbolAccessibilityResult.aliasesToMakeVisible) { - if (!lateMarkedStatements) { - lateMarkedStatements = symbolAccessibilityResult.aliasesToMakeVisible; - } else { - for (const ref of symbolAccessibilityResult.aliasesToMakeVisible) { - pushIfUnique(lateMarkedStatements, ref); - } - } - } - } else if (symbolAccessibilityResult.accessibility !== 3 /* NotResolved */) { - 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)); - } else { - context.addDiagnostic(createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName)); - } - return true; - } - } - return false; - } - function trackSymbol(symbol, enclosingDeclaration2, meaning) { - if (symbol.flags & 262144 /* TypeParameter */) return false; - const issuedDiagnostic = handleSymbolAccessibilityError(resolver.isSymbolAccessible( - symbol, - enclosingDeclaration2, - meaning, - /*shouldComputeAliasToMarkVisible*/ - true - )); - return issuedDiagnostic; - } - function reportPrivateInBaseOfClassExpression(propertyName) { - if (errorNameNode || errorFallbackNode) { - context.addDiagnostic( - addRelatedInfo( - createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected, propertyName), - ...isVariableDeclaration((errorNameNode || errorFallbackNode).parent) ? [createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Add_a_type_annotation_to_the_variable_0, errorDeclarationNameWithFallback())] : [] - ) - ); - } - } - function errorDeclarationNameWithFallback() { - return errorNameNode ? declarationNameToString(errorNameNode) : errorFallbackNode && getNameOfDeclaration(errorFallbackNode) ? declarationNameToString(getNameOfDeclaration(errorFallbackNode)) : errorFallbackNode && isExportAssignment(errorFallbackNode) ? errorFallbackNode.isExportEquals ? "export=" : "default" : "(Missing)"; - } - 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")); - } - } - 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())); - } - } - 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")); - } - } - 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)); - } - } - function reportTruncationError() { - if (errorNameNode || errorFallbackNode) { - context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); - } - } - function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { - var _a; - const primaryDeclaration = (_a = parentSymbol.declarations) == null ? void 0 : _a.find((d) => getSourceFileOfNode(d) === containingFile); - const augmentingDeclarations = filter(symbol.declarations, (d) => getSourceFileOfNode(d) !== containingFile); - if (primaryDeclaration && augmentingDeclarations) { - for (const augmentations of augmentingDeclarations) { - context.addDiagnostic(addRelatedInfo( - createDiagnosticForNode(augmentations, Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), - createDiagnosticForNode(primaryDeclaration, Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file) - )); - } - } - } - function reportNonSerializableProperty(propertyName) { - if (errorNameNode || errorFallbackNode) { - context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName)); - } - } - function transformDeclarationsForJS(sourceFile) { - const oldDiag = getSymbolAccessibilityDiagnostic; - getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : { - diagnosticMessage: s.errorModuleName ? Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit : Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit, - errorNode: s.errorNode || sourceFile - }; - const result = resolver.getDeclarationStatementsForSourceFile(sourceFile, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker); - getSymbolAccessibilityDiagnostic = oldDiag; - return result; - } - function transformRoot(node) { - if (node.kind === 308 /* SourceFile */ && node.isDeclarationFile) { - return node; - } - if (node.kind === 309 /* Bundle */) { - isBundledEmit = true; - rawReferencedFiles = []; - rawTypeReferenceDirectives = []; - rawLibReferenceDirectives = []; - let hasNoDefaultLib = false; - const bundle = factory2.createBundle( - map(node.sourceFiles, (sourceFile) => { - if (sourceFile.isDeclarationFile) return void 0; - hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib; - currentSourceFile = sourceFile; - enclosingDeclaration = sourceFile; - lateMarkedStatements = void 0; - suppressNewDiagnosticContexts = false; - lateStatementReplacementMap = /* @__PURE__ */ new Map(); - getSymbolAccessibilityDiagnostic = throwDiagnostic; - needsScopeFixMarker = false; - resultHasScopeMarker = false; - collectFileReferences(sourceFile); - if (isExternalOrCommonJsModule(sourceFile) || isJsonSourceFile(sourceFile)) { - resultHasExternalModuleIndicator = false; - needsDeclare = false; - const statements = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); - const newFile = factory2.updateSourceFile( - sourceFile, - [factory2.createModuleDeclaration( - [factory2.createModifier(138 /* DeclareKeyword */)], - factory2.createStringLiteral(getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), - factory2.createModuleBlock(setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)) - )], - /*isDeclarationFile*/ - true, - /*referencedFiles*/ - [], - /*typeReferences*/ - [], - /*hasNoDefaultLib*/ - false, - /*libReferences*/ - [] - ); - return newFile; - } - needsDeclare = true; - const updated = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); - return factory2.updateSourceFile( - sourceFile, - transformAndReplaceLatePaintedStatements(updated), - /*isDeclarationFile*/ - true, - /*referencedFiles*/ - [], - /*typeReferences*/ - [], - /*hasNoDefaultLib*/ - false, - /*libReferences*/ - [] - ); - }) - ); - const outputFilePath2 = getDirectoryPath(normalizeSlashes(getOutputPathsFor( - node, - host, - /*forceDtsPaths*/ - true - ).declarationFilePath)); - bundle.syntheticFileReferences = getReferencedFiles(outputFilePath2); - bundle.syntheticTypeReferences = getTypeReferences(); - bundle.syntheticLibReferences = getLibReferences(); - bundle.hasNoDefaultLib = hasNoDefaultLib; - return bundle; - } - needsDeclare = true; - needsScopeFixMarker = false; - resultHasScopeMarker = false; - enclosingDeclaration = node; - currentSourceFile = node; - getSymbolAccessibilityDiagnostic = throwDiagnostic; - isBundledEmit = false; - resultHasExternalModuleIndicator = false; - suppressNewDiagnosticContexts = false; - lateMarkedStatements = void 0; - lateStatementReplacementMap = /* @__PURE__ */ new Map(); - rawReferencedFiles = []; - rawTypeReferenceDirectives = []; - rawLibReferenceDirectives = []; - collectFileReferences(currentSourceFile); - let combinedStatements; - if (isSourceFileJS(currentSourceFile)) { - combinedStatements = factory2.createNodeArray(transformDeclarationsForJS(node)); - } else { - const statements = visitNodes2(node.statements, visitDeclarationStatements, isStatement); - combinedStatements = setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements); - if (isExternalModule(node) && (!resultHasExternalModuleIndicator || needsScopeFixMarker && !resultHasScopeMarker)) { - combinedStatements = setTextRange(factory2.createNodeArray([...combinedStatements, createEmptyExports(factory2)]), combinedStatements); - } - } - const outputFilePath = getDirectoryPath(normalizeSlashes(getOutputPathsFor( - node, - host, - /*forceDtsPaths*/ - true - ).declarationFilePath)); - return factory2.updateSourceFile( - node, - combinedStatements, - /*isDeclarationFile*/ - true, - getReferencedFiles(outputFilePath), - getTypeReferences(), - node.hasNoDefaultLib, - getLibReferences() - ); - function collectFileReferences(sourceFile) { - rawReferencedFiles = concatenate(rawReferencedFiles, map(sourceFile.referencedFiles, (f) => [sourceFile, f])); - rawTypeReferenceDirectives = concatenate(rawTypeReferenceDirectives, sourceFile.typeReferenceDirectives); - rawLibReferenceDirectives = concatenate(rawLibReferenceDirectives, sourceFile.libReferenceDirectives); - } - function copyFileReferenceAsSynthetic(ref) { - const newRef = { ...ref }; - newRef.pos = -1; - newRef.end = -1; - return newRef; - } - function getTypeReferences() { - return mapDefined(rawTypeReferenceDirectives, (ref) => { - if (!ref.preserve) return void 0; - return copyFileReferenceAsSynthetic(ref); - }); - } - function getLibReferences() { - return mapDefined(rawLibReferenceDirectives, (ref) => { - if (!ref.preserve) return void 0; - return copyFileReferenceAsSynthetic(ref); - }); - } - function getReferencedFiles(outputFilePath2) { - return mapDefined(rawReferencedFiles, ([sourceFile, ref]) => { - if (!ref.preserve) return void 0; - const file = host.getSourceFileFromReference(sourceFile, ref); - if (!file) { - return void 0; - } - let declFileName; - if (file.isDeclarationFile) { - declFileName = file.fileName; - } else { - if (isBundledEmit && contains(node.sourceFiles, file)) return; - const paths = getOutputPathsFor( - file, - host, - /*forceDtsPaths*/ - true - ); - declFileName = paths.declarationFilePath || paths.jsFilePath || file.fileName; - } - if (!declFileName) return void 0; - const fileName = getRelativePathToDirectoryOrUrl( - outputFilePath2, - declFileName, - host.getCurrentDirectory(), - host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ - false - ); - const newRef = copyFileReferenceAsSynthetic(ref); - newRef.fileName = fileName; - return newRef; - }); - } - } - function filterBindingPatternInitializers(name) { - if (name.kind === 80 /* Identifier */) { - return name; - } else { - if (name.kind === 208 /* 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 === 233 /* OmittedExpression */) { - return elem; - } - if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) { - checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration); - } - return factory2.updateBindingElement( - elem, - elem.dotDotDotToken, - elem.propertyName, - filterBindingPatternInitializers(elem.name), - /*initializer*/ - void 0 - ); - } - } - function ensureParameter(p, modifierMask) { - let oldDiag; - if (!suppressNewDiagnosticContexts) { - oldDiag = getSymbolAccessibilityDiagnostic; - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p); - } - const newParam = factory2.updateParameterDeclaration( - p, - maskModifiers(factory2, p, modifierMask), - p.dotDotDotToken, - filterBindingPatternInitializers(p.name), - resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(58 /* QuestionToken */) : void 0, - ensureType( - p, - /*ignorePrivate*/ - true - ), - // Ignore private param props, since this type is going straight back into a param - ensureNoInitializer(p) - ); - if (!suppressNewDiagnosticContexts) { - getSymbolAccessibilityDiagnostic = oldDiag; - } - return newParam; - } - function shouldPrintWithInitializer(node) { - return canHaveLiteralInitializer(node) && !!node.initializer && resolver.isLiteralConstDeclaration(getParseTreeNode(node)); - } - function ensureNoInitializer(node) { - if (shouldPrintWithInitializer(node)) { - const unwrappedInitializer = unwrapParenthesizedExpression(node.initializer); - if (!isPrimitiveLiteralValue(unwrappedInitializer)) { - reportInferenceFallback(node); - } - return resolver.createLiteralConstValue(getParseTreeNode(node, canHaveLiteralInitializer), symbolTracker); - } - return void 0; - } - function ensureType(node, ignorePrivate) { - if (!ignorePrivate && hasEffectiveModifier(node, 2 /* Private */)) { - return; - } - if (shouldPrintWithInitializer(node)) { - return; - } - if (!isExportAssignment(node) && !isBindingElement(node) && node.type && (!isParameter(node) || !resolver.requiresAddingImplicitUndefined(node, enclosingDeclaration))) { - return visitNode(node.type, visitDeclarationSubtree, isTypeNode); - } - const oldErrorNameNode = errorNameNode; - errorNameNode = node.name; - let oldDiag; - if (!suppressNewDiagnosticContexts) { - oldDiag = getSymbolAccessibilityDiagnostic; - if (canProduceDiagnostics(node)) { - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node); - } - } - let typeNode; - if (hasInferredType(node)) { - typeNode = resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker); - } else if (isFunctionLike(node)) { - typeNode = resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker); - } else { - Debug.assertNever(node); - } - errorNameNode = oldErrorNameNode; - if (!suppressNewDiagnosticContexts) { - getSymbolAccessibilityDiagnostic = oldDiag; - } - return typeNode ?? factory2.createKeywordTypeNode(133 /* AnyKeyword */); - } - function isDeclarationAndNotVisible(node) { - node = getParseTreeNode(node); - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 268 /* ModuleDeclaration */: - case 265 /* InterfaceDeclaration */: - case 264 /* ClassDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 267 /* EnumDeclaration */: - return !resolver.isDeclarationVisible(node); - // The following should be doing their own visibility checks based on filtering their members - case 261 /* VariableDeclaration */: - return !getBindingNameVisible(node); - case 272 /* ImportEqualsDeclaration */: - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 278 /* ExportAssignment */: - return false; - case 176 /* ClassStaticBlockDeclaration */: - return true; - } - return false; - } - function shouldEmitFunctionProperties(input) { - var _a; - if (input.body) { - return true; - } - const overloadSignatures = (_a = input.symbol.declarations) == null ? void 0 : _a.filter((decl) => isFunctionDeclaration(decl) && !decl.body); - return !overloadSignatures || overloadSignatures.indexOf(input) === overloadSignatures.length - 1; - } - function getBindingNameVisible(elem) { - if (isOmittedExpression(elem)) { - return false; - } - if (isBindingPattern(elem.name)) { - return some(elem.name.elements, getBindingNameVisible); - } else { - return resolver.isDeclarationVisible(elem); - } - } - function updateParamsList(node, params, modifierMask) { - if (hasEffectiveModifier(node, 2 /* Private */)) { - return factory2.createNodeArray(); - } - const newParams = map(params, (p) => ensureParameter(p, modifierMask)); - if (!newParams) { - return factory2.createNodeArray(); - } - return factory2.createNodeArray(newParams, params.hasTrailingComma); - } - function updateAccessorParamsList(input, isPrivate) { - let newParams; - if (!isPrivate) { - const thisParameter = getThisParameter(input); - if (thisParameter) { - newParams = [ensureParameter(thisParameter)]; - } - } - if (isSetAccessorDeclaration(input)) { - let newValueParameter; - if (!isPrivate) { - const valueParameter = getSetAccessorValueParameter(input); - if (valueParameter) { - newValueParameter = ensureParameter(valueParameter); - } - } - if (!newValueParameter) { - newValueParameter = factory2.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "value" - ); - } - newParams = append(newParams, newValueParameter); - } - return factory2.createNodeArray(newParams || emptyArray); - } - function ensureTypeParams(node, params) { - 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); - } - function checkEntityNameVisibility(entityName, enclosingDeclaration2) { - const visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2); - handleSymbolAccessibilityError(visibilityResult); - } - function preserveJsDoc(updated, original) { - if (hasJSDocNodes(updated) && hasJSDocNodes(original)) { - updated.jsDoc = original.jsDoc; - } - return setCommentRange(updated, getCommentRange(original)); - } - function rewriteModuleSpecifier2(parent2, input) { - if (!input) return void 0; - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 268 /* ModuleDeclaration */ && parent2.kind !== 206 /* ImportType */; - if (isStringLiteralLike(input)) { - if (isBundledEmit) { - const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent2); - if (newName) { - return factory2.createStringLiteral(newName); - } - } - } - return input; - } - function transformImportEqualsDeclaration(decl) { - if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 284 /* ExternalModuleReference */) { - const specifier = getExternalModuleImportEqualsDeclarationExpression(decl); - return factory2.updateImportEqualsDeclaration( - decl, - decl.modifiers, - decl.isTypeOnly, - decl.name, - factory2.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier2(decl, specifier)) - ); - } else { - const oldDiag = getSymbolAccessibilityDiagnostic; - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(decl); - checkEntityNameVisibility(decl.moduleReference, enclosingDeclaration); - getSymbolAccessibilityDiagnostic = oldDiag; - return decl; - } - } - function transformImportDeclaration(decl) { - if (!decl.importClause) { - return factory2.updateImportDeclaration( - decl, - decl.modifiers, - decl.importClause, - rewriteModuleSpecifier2(decl, decl.moduleSpecifier), - tryGetResolutionModeOverride(decl.attributes) - ); - } - const phaseModifier = decl.importClause.phaseModifier === 166 /* DeferKeyword */ ? void 0 : decl.importClause.phaseModifier; - 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, - phaseModifier, - visibleDefaultBinding, - /*namedBindings*/ - void 0 - ), - rewriteModuleSpecifier2(decl, decl.moduleSpecifier), - tryGetResolutionModeOverride(decl.attributes) - ); - } - if (decl.importClause.namedBindings.kind === 275 /* 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, - phaseModifier, - visibleDefaultBinding, - namedBindings - ), - rewriteModuleSpecifier2(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) { - return factory2.updateImportDeclaration( - decl, - decl.modifiers, - factory2.updateImportClause( - decl.importClause, - phaseModifier, - visibleDefaultBinding, - bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0 - ), - rewriteModuleSpecifier2(decl, decl.moduleSpecifier), - tryGetResolutionModeOverride(decl.attributes) - ); - } - if (resolver.isImportRequiredByAugmentation(decl)) { - if (isolatedDeclarations) { - context.addDiagnostic(createDiagnosticForNode(decl, Diagnostics.Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations)); - } - return factory2.updateImportDeclaration( - decl, - decl.modifiers, - /*importClause*/ - void 0, - rewriteModuleSpecifier2(decl, decl.moduleSpecifier), - tryGetResolutionModeOverride(decl.attributes) - ); - } - } - function tryGetResolutionModeOverride(node) { - const mode = getResolutionModeOverride(node); - return node && mode !== void 0 ? node : void 0; - } - function transformAndReplaceLatePaintedStatements(statements) { - while (length(lateMarkedStatements)) { - const i = lateMarkedStatements.shift(); - if (!isLateVisibilityPaintedStatement(i)) { - return Debug.fail(`Late replaced statement was found which is not handled by the declaration transformer!: ${Debug.formatSyntaxKind(i.kind)}`); - } - const priorNeedsDeclare = needsDeclare; - needsDeclare = i.parent && isSourceFile(i.parent) && !(isExternalModule(i.parent) && isBundledEmit); - const result = transformTopLevelDeclaration(i); - needsDeclare = priorNeedsDeclare; - lateStatementReplacementMap.set(getOriginalNodeId(i), result); - } - return visitNodes2(statements, visitLateVisibilityMarkedStatements, isStatement); - function visitLateVisibilityMarkedStatements(statement) { - if (isLateVisibilityPaintedStatement(statement)) { - const key = getOriginalNodeId(statement); - if (lateStatementReplacementMap.has(key)) { - const result = lateStatementReplacementMap.get(key); - lateStatementReplacementMap.delete(key); - if (result) { - if (isArray(result) ? some(result, needsScopeMarker) : needsScopeMarker(result)) { - needsScopeFixMarker = true; - } - if (isSourceFile(statement.parent) && (isArray(result) ? some(result, isExternalModuleIndicator) : isExternalModuleIndicator(result))) { - resultHasExternalModuleIndicator = true; - } - } - return result; - } - } - return statement; - } - } - function visitDeclarationSubtree(input) { - if (shouldStripInternal(input)) return; - if (isDeclaration(input)) { - if (isDeclarationAndNotVisible(input)) return; - if (hasDynamicName(input)) { - if (isolatedDeclarations) { - if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression)) { - if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) { - context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations)); - return; - } else if ( - // Type declarations just need to double-check that the input computed name is an entity name expression - (isInterfaceDeclaration(input.parent) || isTypeLiteralNode(input.parent)) && !isEntityNameExpression(input.name.expression) - ) { - context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations)); - return; - } - } - } else if (!resolver.isLateBound(getParseTreeNode(input)) || !isEntityNameExpression(input.name.expression)) { - return; - } - } - } - if (isFunctionLike(input) && resolver.isImplementationOfOverload(input)) return; - if (isSemicolonClassElement(input)) return; - let previousEnclosingDeclaration; - if (isEnclosingDeclaration(input)) { - previousEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = input; - } - const oldDiag = getSymbolAccessibilityDiagnostic; - const canProduceDiagnostic = canProduceDiagnostics(input); - const oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 188 /* TypeLiteral */ || input.kind === 201 /* MappedType */) && input.parent.kind !== 266 /* TypeAliasDeclaration */; - if (isMethodDeclaration(input) || isMethodSignature(input)) { - if (hasEffectiveModifier(input, 2 /* Private */)) { - if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) return; - return cleanup(factory2.createPropertyDeclaration( - ensureModifiers(input), - input.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - )); - } - } - if (canProduceDiagnostic && !suppressNewDiagnosticContexts) { - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(input); - } - if (isTypeQueryNode(input)) { - checkEntityNameVisibility(input.exprName, enclosingDeclaration); - } - if (shouldEnterSuppressNewDiagnosticsContextContext) { - suppressNewDiagnosticContexts = true; - } - if (isProcessedComponent(input)) { - switch (input.kind) { - case 234 /* 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 184 /* TypeReference */: { - checkEntityNameVisibility(input.typeName, enclosingDeclaration); - const node = visitEachChild(input, visitDeclarationSubtree, context); - return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); - } - case 181 /* ConstructSignature */: - return cleanup(factory2.updateConstructSignature( - input, - ensureTypeParams(input, input.typeParameters), - updateParamsList(input, input.parameters), - ensureType(input) - )); - case 177 /* Constructor */: { - const ctor = factory2.createConstructorDeclaration( - /*modifiers*/ - ensureModifiers(input), - updateParamsList(input, input.parameters, 0 /* None */), - /*body*/ - void 0 - ); - return cleanup(ctor); - } - case 175 /* MethodDeclaration */: { - if (isPrivateIdentifier(input.name)) { - return cleanup( - /*returnValue*/ - void 0 - ); - } - const sig = factory2.createMethodDeclaration( - ensureModifiers(input), - /*asteriskToken*/ - void 0, - input.name, - input.questionToken, - ensureTypeParams(input, input.typeParameters), - updateParamsList(input, input.parameters), - ensureType(input), - /*body*/ - void 0 - ); - return cleanup(sig); - } - case 178 /* GetAccessor */: { - if (isPrivateIdentifier(input.name)) { - return cleanup( - /*returnValue*/ - void 0 - ); - } - return cleanup(factory2.updateGetAccessorDeclaration( - input, - ensureModifiers(input), - input.name, - updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)), - ensureType(input), - /*body*/ - void 0 - )); - } - case 179 /* SetAccessor */: { - if (isPrivateIdentifier(input.name)) { - return cleanup( - /*returnValue*/ - void 0 - ); - } - return cleanup(factory2.updateSetAccessorDeclaration( - input, - ensureModifiers(input), - input.name, - updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)), - /*body*/ - void 0 - )); - } - case 173 /* PropertyDeclaration */: - if (isPrivateIdentifier(input.name)) { - return cleanup( - /*returnValue*/ - void 0 - ); - } - return cleanup(factory2.updatePropertyDeclaration( - input, - ensureModifiers(input), - input.name, - input.questionToken, - ensureType(input), - ensureNoInitializer(input) - )); - case 172 /* PropertySignature */: - if (isPrivateIdentifier(input.name)) { - return cleanup( - /*returnValue*/ - void 0 - ); - } - return cleanup(factory2.updatePropertySignature( - input, - ensureModifiers(input), - input.name, - input.questionToken, - ensureType(input) - )); - case 174 /* MethodSignature */: { - if (isPrivateIdentifier(input.name)) { - return cleanup( - /*returnValue*/ - void 0 - ); - } - return cleanup(factory2.updateMethodSignature( - input, - ensureModifiers(input), - input.name, - input.questionToken, - ensureTypeParams(input, input.typeParameters), - updateParamsList(input, input.parameters), - ensureType(input) - )); - } - case 180 /* CallSignature */: { - return cleanup( - factory2.updateCallSignature( - input, - ensureTypeParams(input, input.typeParameters), - updateParamsList(input, input.parameters), - ensureType(input) - ) - ); - } - case 182 /* IndexSignature */: { - return cleanup(factory2.updateIndexSignature( - input, - ensureModifiers(input), - updateParamsList(input, input.parameters), - visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(133 /* AnyKeyword */) - )); - } - case 261 /* VariableDeclaration */: { - if (isBindingPattern(input.name)) { - return recreateBindingPattern(input.name); - } - shouldEnterSuppressNewDiagnosticsContextContext = true; - suppressNewDiagnosticContexts = true; - return cleanup(factory2.updateVariableDeclaration( - input, - input.name, - /*exclamationToken*/ - void 0, - ensureType(input), - ensureNoInitializer(input) - )); - } - case 169 /* TypeParameter */: { - if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { - return cleanup(factory2.updateTypeParameterDeclaration( - input, - input.modifiers, - input.name, - /*constraint*/ - void 0, - /*defaultType*/ - void 0 - )); - } - return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); - } - case 195 /* ConditionalType */: { - const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); - const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); - const oldEnclosingDecl = enclosingDeclaration; - enclosingDeclaration = input.trueType; - const trueType = visitNode(input.trueType, visitDeclarationSubtree, isTypeNode); - enclosingDeclaration = oldEnclosingDecl; - const falseType = visitNode(input.falseType, visitDeclarationSubtree, isTypeNode); - Debug.assert(checkType); - Debug.assert(extendsType); - Debug.assert(trueType); - Debug.assert(falseType); - return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); - } - case 185 /* FunctionType */: { - return cleanup(factory2.updateFunctionTypeNode( - input, - visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), - updateParamsList(input, input.parameters), - Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) - )); - } - case 186 /* 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 206 /* ImportType */: { - if (!isLiteralImportTypeNode(input)) return cleanup(input); - return cleanup(factory2.updateImportTypeNode( - input, - factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier2(input, input.argument.literal)), - input.attributes, - input.qualifier, - visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode), - input.isTypeOf - )); - } - default: - Debug.assertNever(input, `Attempted to process unhandled node kind: ${Debug.formatSyntaxKind(input.kind)}`); - } - } - if (isTupleTypeNode(input) && getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === getLineAndCharacterOfPosition(currentSourceFile, input.end).line) { - setEmitFlags(input, 1 /* SingleLine */); - } - return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); - function cleanup(returnValue) { - if (returnValue && canProduceDiagnostic && hasDynamicName(input)) { - checkName(input); - } - if (isEnclosingDeclaration(input)) { - enclosingDeclaration = previousEnclosingDeclaration; - } - if (canProduceDiagnostic && !suppressNewDiagnosticContexts) { - getSymbolAccessibilityDiagnostic = oldDiag; - } - if (shouldEnterSuppressNewDiagnosticsContextContext) { - suppressNewDiagnosticContexts = oldWithinObjectLiteralType; - } - if (returnValue === input) { - return returnValue; - } - return returnValue && setOriginalNode(preserveJsDoc(returnValue, input), input); - } - } - function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 175 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */); - } - function visitDeclarationStatements(input) { - if (!isPreservedDeclarationStatement(input)) { - return; - } - if (shouldStripInternal(input)) return; - switch (input.kind) { - case 279 /* ExportDeclaration */: { - if (isSourceFile(input.parent)) { - resultHasExternalModuleIndicator = true; - } - resultHasScopeMarker = true; - return factory2.updateExportDeclaration( - input, - input.modifiers, - input.isTypeOnly, - input.exportClause, - rewriteModuleSpecifier2(input, input.moduleSpecifier), - tryGetResolutionModeOverride(input.attributes) - ); - } - case 278 /* ExportAssignment */: { - if (isSourceFile(input.parent)) { - resultHasExternalModuleIndicator = true; - } - resultHasScopeMarker = true; - if (input.expression.kind === 80 /* Identifier */) { - return input; - } else { - const newId = factory2.createUniqueName("_default", 16 /* Optimistic */); - getSymbolAccessibilityDiagnostic = () => ({ - diagnosticMessage: Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, - errorNode: input - }); - errorFallbackNode = input; - const type = ensureType(input); - const varDecl = factory2.createVariableDeclaration( - newId, - /*exclamationToken*/ - void 0, - type, - /*initializer*/ - void 0 - ); - errorFallbackNode = void 0; - const statement = factory2.createVariableStatement(needsDeclare ? [factory2.createModifier(138 /* DeclareKeyword */)] : [], factory2.createVariableDeclarationList([varDecl], 2 /* Const */)); - preserveJsDoc(statement, input); - removeAllComments(input); - return [statement, factory2.updateExportAssignment(input, input.modifiers, newId)]; - } - } - } - const result = transformTopLevelDeclaration(input); - lateStatementReplacementMap.set(getOriginalNodeId(input), result); - return input; - } - function stripExportModifiers(statement) { - if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement, 2048 /* Default */) || !canHaveModifiers(statement)) { - return statement; - } - 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) { - while (orderedRemoveItem(lateMarkedStatements, input)) ; - } - if (shouldStripInternal(input)) return; - switch (input.kind) { - case 272 /* ImportEqualsDeclaration */: { - return transformImportEqualsDeclaration(input); - } - case 273 /* ImportDeclaration */: { - return transformImportDeclaration(input); - } - } - if (isDeclaration(input) && isDeclarationAndNotVisible(input)) return; - if (isJSDocImportTag(input)) return; - if (isFunctionLike(input) && resolver.isImplementationOfOverload(input)) return; - let previousEnclosingDeclaration; - if (isEnclosingDeclaration(input)) { - previousEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = input; - } - const canProdiceDiagnostic = canProduceDiagnostics(input); - const oldDiag = getSymbolAccessibilityDiagnostic; - if (canProdiceDiagnostic) { - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(input); - } - const previousNeedsDeclare = needsDeclare; - switch (input.kind) { - case 266 /* TypeAliasDeclaration */: { - needsDeclare = false; - const clean2 = cleanup(factory2.updateTypeAliasDeclaration( - input, - ensureModifiers(input), - input.name, - visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), - Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) - )); - needsDeclare = previousNeedsDeclare; - return clean2; - } - case 265 /* InterfaceDeclaration */: { - return cleanup(factory2.updateInterfaceDeclaration( - input, - ensureModifiers(input), - input.name, - ensureTypeParams(input, input.typeParameters), - transformHeritageClauses(input.heritageClauses), - visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) - )); - } - case 263 /* FunctionDeclaration */: { - const clean2 = cleanup(factory2.updateFunctionDeclaration( - input, - ensureModifiers(input), - /*asteriskToken*/ - void 0, - input.name, - ensureTypeParams(input, input.typeParameters), - updateParamsList(input, input.parameters), - ensureType(input), - /*body*/ - void 0 - )); - if (clean2 && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) { - const props = resolver.getPropertiesOfContainerFunction(input); - if (isolatedDeclarations) { - reportExpandoFunctionErrors(input); - } - const fakespace = parseNodeFactory.createModuleDeclaration( - /*modifiers*/ - void 0, - clean2.name || factory2.createIdentifier("_default"), - factory2.createModuleBlock([]), - 32 /* Namespace */ - ); - setParent(fakespace, enclosingDeclaration); - fakespace.locals = createSymbolTable(props); - fakespace.symbol = props[0].parent; - const exportMappings = []; - let declarations = mapDefined(props, (p) => { - if (!isExpandoPropertyDeclaration(p.valueDeclaration)) { - return void 0; - } - const nameStr = unescapeLeadingUnderscores(p.escapedName); - if (!isIdentifierText(nameStr, 99 /* ESNext */)) { - return void 0; - } - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration); - const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags | 2 /* NoSyntacticPrinter */, symbolTracker); - getSymbolAccessibilityDiagnostic = oldDiag; - const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr); - const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr); - if (isNonContextualKeywordName) { - exportMappings.push([name, nameStr]); - } - const varDecl = factory2.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - type, - /*initializer*/ - void 0 - ); - return factory2.createVariableStatement(isNonContextualKeywordName ? void 0 : [factory2.createToken(95 /* ExportKeyword */)], factory2.createVariableDeclarationList([varDecl])); - }); - if (!exportMappings.length) { - declarations = mapDefined(declarations, (declaration) => factory2.replaceModifiers(declaration, 0 /* None */)); - } else { - declarations.push(factory2.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory2.createNamedExports(map(exportMappings, ([gen, exp]) => { - return factory2.createExportSpecifier( - /*isTypeOnly*/ - false, - gen, - exp - ); - })) - )); - } - 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) & ~2080 /* ExportDefault */ | 128 /* Ambient */); - const cleanDeclaration = factory2.updateFunctionDeclaration( - clean2, - modifiers, - /*asteriskToken*/ - void 0, - clean2.name, - clean2.typeParameters, - clean2.parameters, - clean2.type, - /*body*/ - void 0 - ); - const namespaceDeclaration = factory2.updateModuleDeclaration( - namespaceDecl, - modifiers, - namespaceDecl.name, - namespaceDecl.body - ); - const exportDefaultDeclaration = factory2.createExportAssignment( - /*modifiers*/ - void 0, - /*isExportEquals*/ - false, - namespaceDecl.name - ); - if (isSourceFile(input.parent)) { - resultHasExternalModuleIndicator = true; - } - resultHasScopeMarker = true; - return [cleanDeclaration, namespaceDeclaration, exportDefaultDeclaration]; - } else { - return clean2; - } - } - case 268 /* ModuleDeclaration */: { - needsDeclare = false; - const inner = input.body; - if (inner && inner.kind === 269 /* 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 & 33554432 /* Ambient */) { - needsScopeFixMarker = false; - } - if (!isGlobalScopeAugmentation(input) && !hasScopeMarker2(lateStatements) && !resultHasScopeMarker) { - if (needsScopeFixMarker) { - lateStatements = factory2.createNodeArray([...lateStatements, createEmptyExports(factory2)]); - } else { - lateStatements = visitNodes2(lateStatements, stripExportModifiers, isStatement); - } - } - const body = factory2.updateModuleBlock(inner, lateStatements); - needsDeclare = previousNeedsDeclare; - needsScopeFixMarker = oldNeedsScopeFix; - resultHasScopeMarker = oldHasScopeFix; - const mods = ensureModifiers(input); - return cleanup(updateModuleDeclarationAndKeyword( - input, - mods, - isExternalModuleAugmentation(input) ? rewriteModuleSpecifier2(input, input.name) : input.name, - body - )); - } else { - needsDeclare = previousNeedsDeclare; - const mods = ensureModifiers(input); - needsDeclare = false; - visitNode(inner, visitDeclarationStatements); - const id = getOriginalNodeId(inner); - const body = lateStatementReplacementMap.get(id); - lateStatementReplacementMap.delete(id); - return cleanup(updateModuleDeclarationAndKeyword( - input, - mods, - input.name, - body - )); - } - } - case 264 /* ClassDeclaration */: { - errorNameNode = input.name; - errorFallbackNode = input; - const modifiers = factory2.createNodeArray(ensureModifiers(input)); - const typeParameters = ensureTypeParams(input, input.typeParameters); - const ctor = getFirstConstructorWithBody(input); - let parameterProperties; - if (ctor) { - const oldDiag2 = getSymbolAccessibilityDiagnostic; - parameterProperties = compact(flatMap(ctor.parameters, (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), - ensureNoInitializer(param) - ), - param - ); - } else { - return walkBindingPattern(param.name); - } - function walkBindingPattern(pattern) { - let elems; - for (const elem of pattern.elements) { - if (isOmittedExpression(elem)) continue; - if (isBindingPattern(elem.name)) { - elems = concatenate(elems, walkBindingPattern(elem.name)); - } - elems = elems || []; - elems.push(factory2.createPropertyDeclaration( - ensureModifiers(param), - elem.name, - /*questionOrExclamationToken*/ - void 0, - ensureType(elem), - /*initializer*/ - void 0 - )); - } - return elems; - } - })); - getSymbolAccessibilityDiagnostic = oldDiag2; - } - const hasPrivateIdentifier = some(input.members, (member) => !!member.name && isPrivateIdentifier(member.name)); - const privateIdentifier = hasPrivateIdentifier ? [ - factory2.createPropertyDeclaration( - /*modifiers*/ - void 0, - factory2.createPrivateIdentifier("#private"), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ) - ] : void 0; - const lateIndexes = resolver.createLateBoundIndexSignatures(input, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker); - const memberNodes = concatenate(concatenate(concatenate(privateIdentifier, lateIndexes), parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement)); - const members = factory2.createNodeArray(memberNodes); - const extendsClause = getEffectiveBaseTypeNode(input); - if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 106 /* NullKeyword */) { - const oldId = input.name ? unescapeLeadingUnderscores(input.name.escapedText) : "default"; - const newId = factory2.createUniqueName(`${oldId}_base`, 16 /* Optimistic */); - getSymbolAccessibilityDiagnostic = () => ({ - diagnosticMessage: Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, - errorNode: extendsClause, - typeName: input.name - }); - const varDecl = factory2.createVariableDeclaration( - newId, - /*exclamationToken*/ - void 0, - resolver.createTypeOfExpression(extendsClause.expression, input, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker), - /*initializer*/ - void 0 - ); - const statement = factory2.createVariableStatement(needsDeclare ? [factory2.createModifier(138 /* DeclareKeyword */)] : [], factory2.createVariableDeclarationList([varDecl], 2 /* Const */)); - const heritageClauses = factory2.createNodeArray(map(input.heritageClauses, (clause) => { - if (clause.token === 96 /* ExtendsKeyword */) { - const oldDiag2 = getSymbolAccessibilityDiagnostic; - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); - const newClause = factory2.updateHeritageClause(clause, map(clause.types, (t) => factory2.updateExpressionWithTypeArguments(t, newId, visitNodes2(t.typeArguments, visitDeclarationSubtree, isTypeNode)))); - getSymbolAccessibilityDiagnostic = oldDiag2; - return newClause; - } - 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 - )) - ]; - } else { - const heritageClauses = transformHeritageClauses(input.heritageClauses); - return cleanup(factory2.updateClassDeclaration( - input, - modifiers, - input.name, - typeParameters, - heritageClauses, - members - )); - } - } - case 244 /* VariableStatement */: { - return cleanup(transformVariableStatement(input)); - } - case 267 /* EnumDeclaration */: { - return cleanup(factory2.updateEnumDeclaration( - input, - factory2.createNodeArray(ensureModifiers(input)), - input.name, - factory2.createNodeArray(mapDefined(input.members, (m) => { - if (shouldStripInternal(m)) return; - const enumValue = resolver.getEnumMemberValue(m); - const constValue = enumValue == null ? void 0 : enumValue.value; - if (isolatedDeclarations && m.initializer && (enumValue == null ? void 0 : enumValue.hasExternalReferences) && // This will be its own compiler error instead, so don't report. - !isComputedPropertyName(m.name)) { - context.addDiagnostic(createDiagnosticForNode(m, Diagnostics.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations)); - } - 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)}`); - function cleanup(node) { - if (isEnclosingDeclaration(input)) { - enclosingDeclaration = previousEnclosingDeclaration; - } - if (canProdiceDiagnostic) { - getSymbolAccessibilityDiagnostic = oldDiag; - } - if (input.kind === 268 /* ModuleDeclaration */) { - needsDeclare = previousNeedsDeclare; - } - if (node === input) { - return node; - } - errorFallbackNode = void 0; - errorNameNode = void 0; - return node && setOriginalNode(preserveJsDoc(node, input), input); - } - } - function transformVariableStatement(input) { - if (!forEach(input.declarationList.declarations, getBindingNameVisible)) return; - const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree, isVariableDeclaration); - if (!length(nodes)) return; - 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 === 233 /* OmittedExpression */) { - return; - } - if (e.name) { - if (!getBindingNameVisible(e)) return; - if (isBindingPattern(e.name)) { - return recreateBindingPattern(e.name); - } else { - return factory2.createVariableDeclaration( - e.name, - /*exclamationToken*/ - void 0, - ensureType(e), - /*initializer*/ - void 0 - ); - } - } - } - function checkName(node) { - let oldDiag; - if (!suppressNewDiagnosticContexts) { - oldDiag = getSymbolAccessibilityDiagnostic; - getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNodeName(node); - } - errorNameNode = node.name; - Debug.assert(hasDynamicName(node)); - const decl = node; - const entityName = decl.name.expression; - checkEntityNameVisibility(entityName, enclosingDeclaration); - if (!suppressNewDiagnosticContexts) { - getSymbolAccessibilityDiagnostic = oldDiag; - } - errorNameNode = void 0; - } - function shouldStripInternal(node) { - return !!stripInternal && !!node && isInternalDeclaration(node, currentSourceFile); - } - function isScopeMarker2(node) { - return isExportAssignment(node) || isExportDeclaration(node); - } - function hasScopeMarker2(statements) { - return some(statements, isScopeMarker2); - } - function ensureModifiers(node) { - const currentFlags = getEffectiveModifierFlags(node); - const newFlags = ensureModifierFlags(node); - if (currentFlags === newFlags) { - return visitArray(node.modifiers, (n) => tryCast(n, isModifier), isModifier); - } - return factory2.createModifiersFromModifierFlags(newFlags); - } - function ensureModifierFlags(node) { - let mask2 = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */); - let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */; - const parentIsFile = node.parent.kind === 308 /* SourceFile */; - if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) { - mask2 ^= 128 /* Ambient */; - additions = 0 /* None */; - } - return maskModifierFlags(node, mask2, additions); - } - 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 - )); - } -} -function isAlwaysType(node) { - if (node.kind === 265 /* InterfaceDeclaration */) { - return true; - } - return false; -} -function maskModifiers(factory2, node, modifierMask, modifierAdditions) { - return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions)); -} -function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public */, modifierAdditions = 0 /* None */) { - let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions; - if (flags & 2048 /* Default */ && !(flags & 32 /* Export */)) { - flags ^= 32 /* Export */; - } - if (flags & 2048 /* Default */ && flags & 128 /* Ambient */) { - flags ^= 128 /* Ambient */; - } - return flags; -} -function canHaveLiteralInitializer(node) { - switch (node.kind) { - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - return !hasEffectiveModifier(node, 2 /* Private */); - case 170 /* Parameter */: - case 261 /* VariableDeclaration */: - return true; - } - return false; -} -function isPreservedDeclarationStatement(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 268 /* ModuleDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 265 /* InterfaceDeclaration */: - case 264 /* ClassDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 267 /* EnumDeclaration */: - case 244 /* VariableStatement */: - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 278 /* ExportAssignment */: - return true; - } - return false; -} -function isProcessedComponent(node) { - switch (node.kind) { - case 181 /* ConstructSignature */: - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 182 /* IndexSignature */: - case 261 /* VariableDeclaration */: - case 169 /* TypeParameter */: - case 234 /* ExpressionWithTypeArguments */: - case 184 /* TypeReference */: - case 195 /* ConditionalType */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 206 /* ImportType */: - return true; - } - return false; -} - -// src/compiler/transformer.ts -function getModuleTransformer(moduleKind) { - switch (moduleKind) { - case 200 /* Preserve */: - return transformECMAScriptModule; - case 99 /* ESNext */: - case 7 /* ES2022 */: - case 6 /* ES2020 */: - case 5 /* ES2015 */: - case 100 /* Node16 */: - case 101 /* Node18 */: - case 102 /* Node20 */: - case 199 /* NodeNext */: - case 1 /* CommonJS */: - return transformImpliedNodeFormatDependentModule; - case 4 /* System */: - return transformSystemModule; - default: - return transformModule; - } -} -var noTransformers = { scriptTransformers: emptyArray, declarationTransformers: emptyArray }; -function getTransformers(compilerOptions, customTransformers, emitOnly) { - return { - scriptTransformers: getScriptTransformers(compilerOptions, customTransformers, emitOnly), - declarationTransformers: getDeclarationTransformers(customTransformers) - }; -} -function getScriptTransformers(compilerOptions, customTransformers, emitOnly) { - if (emitOnly) return emptyArray; - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); - const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); - const transformers = []; - addRange(transformers, customTransformers && map(customTransformers.before, wrapScriptTransformerFactory)); - transformers.push(transformTypeScript); - if (compilerOptions.experimentalDecorators) { - transformers.push(transformLegacyDecorators); - } - 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); - } - if (languageVersion < 7 /* ES2020 */) { - transformers.push(transformES2020); - } - if (languageVersion < 6 /* ES2019 */) { - transformers.push(transformES2019); - } - if (languageVersion < 5 /* ES2018 */) { - transformers.push(transformES2018); - } - if (languageVersion < 4 /* ES2017 */) { - transformers.push(transformES2017); - } - if (languageVersion < 3 /* ES2016 */) { - transformers.push(transformES2016); - } - if (languageVersion < 2 /* ES2015 */) { - transformers.push(transformES2015); - transformers.push(transformGenerators); - } - transformers.push(getModuleTransformer(moduleKind)); - addRange(transformers, customTransformers && map(customTransformers.after, wrapScriptTransformerFactory)); - return transformers; -} -function getDeclarationTransformers(customTransformers) { - const transformers = []; - transformers.push(transformDeclarations); - addRange(transformers, customTransformers && map(customTransformers.afterDeclarations, wrapDeclarationTransformerFactory)); - return transformers; -} -function wrapCustomTransformer(transformer) { - return (node) => isBundle(node) ? transformer.transformBundle(node) : transformer.transformSourceFile(node); -} -function wrapCustomTransformerFactory(transformer, handleDefault) { - return (context) => { - const customTransformer = transformer(context); - return typeof customTransformer === "function" ? handleDefault(context, customTransformer) : wrapCustomTransformer(customTransformer); - }; -} -function wrapScriptTransformerFactory(transformer) { - return wrapCustomTransformerFactory(transformer, chainBundle); -} -function wrapDeclarationTransformerFactory(transformer) { - return wrapCustomTransformerFactory(transformer, (_, node) => node); -} -function noEmitSubstitution(_hint, node) { - return node; -} -function noEmitNotification(hint, node, callback) { - callback(hint, node); -} -function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { - var _a, _b; - const enabledSyntaxKindFeatures = new Array(359 /* Count */); - let lexicalEnvironmentVariableDeclarations; - let lexicalEnvironmentFunctionDeclarations; - let lexicalEnvironmentStatements; - let lexicalEnvironmentFlags = 0 /* None */; - let lexicalEnvironmentVariableDeclarationsStack = []; - let lexicalEnvironmentFunctionDeclarationsStack = []; - let lexicalEnvironmentStatementsStack = []; - let lexicalEnvironmentFlagsStack = []; - let lexicalEnvironmentStackOffset = 0; - let lexicalEnvironmentSuspended = false; - let blockScopedVariableDeclarationsStack = []; - let blockScopeStackOffset = 0; - let blockScopedVariableDeclarations; - let emitHelpers; - let onSubstituteNode = noEmitSubstitution; - let onEmitNode = noEmitNotification; - let state = 0 /* Uninitialized */; - const diagnostics = []; - const context = { - factory: factory2, - getCompilerOptions: () => options, - getEmitResolver: () => resolver, - // TODO: GH#18217 - getEmitHost: () => host, - // TODO: GH#18217 - getEmitHelperFactory: memoize(() => createEmitHelperFactory(context)), - startLexicalEnvironment, - suspendLexicalEnvironment, - resumeLexicalEnvironment, - endLexicalEnvironment, - setLexicalEnvironmentFlags, - getLexicalEnvironmentFlags, - hoistVariableDeclaration, - hoistFunctionDeclaration, - addInitializationStatement, - startBlockScope, - endBlockScope, - addBlockScopedVariable, - requestEmitHelper, - readEmitHelpers, - enableSubstitution, - enableEmitNotification, - isSubstitutionEnabled, - isEmitNotificationEnabled, - get onSubstituteNode() { - return onSubstituteNode; - }, - set onSubstituteNode(value) { - Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); - Debug.assert(value !== void 0, "Value must not be 'undefined'"); - onSubstituteNode = value; - }, - get onEmitNode() { - return onEmitNode; - }, - set onEmitNode(value) { - Debug.assert(state < 1 /* Initialized */, "Cannot modify transformation hooks after initialization has completed."); - Debug.assert(value !== void 0, "Value must not be 'undefined'"); - onEmitNode = value; - }, - addDiagnostic(diag2) { - diagnostics.push(diag2); - } - }; - for (const node of nodes) { - disposeEmitNodes(getSourceFileOfNode(getParseTreeNode(node))); - } - mark("beforeTransform"); - const transformersWithContext = transformers.map((t) => t(context)); - const transformation = (node) => { - for (const transform2 of transformersWithContext) { - node = transform2(node); - } - return node; - }; - state = 1 /* Initialized */; - const transformed = []; - for (const node of nodes) { - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "transformNodes", node.kind === 308 /* 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(); - } - state = 2 /* Completed */; - mark("afterTransform"); - measure("transformTime", "beforeTransform", "afterTransform"); - return { - transformed, - substituteNode, - emitNodeWithNotification, - isEmitNotificationEnabled, - dispose, - diagnostics - }; - function transformRoot(node) { - return node && (!isSourceFile(node) || !node.isDeclarationFile) ? transformation(node) : node; - } - function enableSubstitution(kind) { - Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); - enabledSyntaxKindFeatures[kind] |= 1 /* Substitution */; - } - function isSubstitutionEnabled(node) { - return (enabledSyntaxKindFeatures[node.kind] & 1 /* Substitution */) !== 0 && (getEmitFlags(node) & 8 /* NoSubstitution */) === 0; - } - function substituteNode(hint, node) { - Debug.assert(state < 3 /* Disposed */, "Cannot substitute a node after the result is disposed."); - return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; - } - function enableEmitNotification(kind) { - Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); - enabledSyntaxKindFeatures[kind] |= 2 /* EmitNotifications */; - } - function isEmitNotificationEnabled(node) { - return (enabledSyntaxKindFeatures[node.kind] & 2 /* EmitNotifications */) !== 0 || (getEmitFlags(node) & 4 /* AdviseOnEmitNode */) !== 0; - } - function emitNodeWithNotification(hint, node, emitCallback) { - Debug.assert(state < 3 /* Disposed */, "Cannot invoke TransformationResult callbacks after the result is disposed."); - if (node) { - if (isEmitNotificationEnabled(node)) { - onEmitNode(hint, node, emitCallback); - } else { - emitCallback(hint, node); - } - } - } - function hoistVariableDeclaration(name) { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); - const decl = setEmitFlags(factory2.createVariableDeclaration(name), 128 /* NoNestedSourceMaps */); - if (!lexicalEnvironmentVariableDeclarations) { - lexicalEnvironmentVariableDeclarations = [decl]; - } else { - lexicalEnvironmentVariableDeclarations.push(decl); - } - if (lexicalEnvironmentFlags & 1 /* InParameters */) { - lexicalEnvironmentFlags |= 2 /* VariablesHoistedInParameters */; - } - } - function hoistFunctionDeclaration(func) { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); - setEmitFlags(func, 2097152 /* CustomPrologue */); - if (!lexicalEnvironmentFunctionDeclarations) { - lexicalEnvironmentFunctionDeclarations = [func]; - } else { - lexicalEnvironmentFunctionDeclarations.push(func); - } - } - function addInitializationStatement(node) { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); - setEmitFlags(node, 2097152 /* CustomPrologue */); - if (!lexicalEnvironmentStatements) { - lexicalEnvironmentStatements = [node]; - } else { - lexicalEnvironmentStatements.push(node); - } - } - function startLexicalEnvironment() { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); - Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); - lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentVariableDeclarations; - lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFunctionDeclarations; - lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentStatements; - lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFlags; - lexicalEnvironmentStackOffset++; - lexicalEnvironmentVariableDeclarations = void 0; - lexicalEnvironmentFunctionDeclarations = void 0; - lexicalEnvironmentStatements = void 0; - lexicalEnvironmentFlags = 0 /* None */; - } - function suspendLexicalEnvironment() { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); - Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); - lexicalEnvironmentSuspended = true; - } - function resumeLexicalEnvironment() { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); - Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); - lexicalEnvironmentSuspended = false; - } - function endLexicalEnvironment() { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed."); - Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); - let statements; - if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations || lexicalEnvironmentStatements) { - if (lexicalEnvironmentFunctionDeclarations) { - statements = [...lexicalEnvironmentFunctionDeclarations]; - } - if (lexicalEnvironmentVariableDeclarations) { - const statement = factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList(lexicalEnvironmentVariableDeclarations) - ); - setEmitFlags(statement, 2097152 /* CustomPrologue */); - if (!statements) { - statements = [statement]; - } else { - statements.push(statement); - } - } - if (lexicalEnvironmentStatements) { - if (!statements) { - statements = [...lexicalEnvironmentStatements]; - } else { - statements = [...statements, ...lexicalEnvironmentStatements]; - } - } - } - lexicalEnvironmentStackOffset--; - lexicalEnvironmentVariableDeclarations = lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset]; - lexicalEnvironmentFunctionDeclarations = lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset]; - lexicalEnvironmentStatements = lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset]; - lexicalEnvironmentFlags = lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset]; - if (lexicalEnvironmentStackOffset === 0) { - lexicalEnvironmentVariableDeclarationsStack = []; - lexicalEnvironmentFunctionDeclarationsStack = []; - lexicalEnvironmentStatementsStack = []; - lexicalEnvironmentFlagsStack = []; - } - return statements; - } - function setLexicalEnvironmentFlags(flags, value) { - lexicalEnvironmentFlags = value ? lexicalEnvironmentFlags | flags : lexicalEnvironmentFlags & ~flags; - } - function getLexicalEnvironmentFlags() { - return lexicalEnvironmentFlags; - } - function startBlockScope() { - Debug.assert(state > 0 /* Uninitialized */, "Cannot start a block scope during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot start a block scope after transformation has completed."); - blockScopedVariableDeclarationsStack[blockScopeStackOffset] = blockScopedVariableDeclarations; - blockScopeStackOffset++; - blockScopedVariableDeclarations = void 0; - } - function endBlockScope() { - Debug.assert(state > 0 /* Uninitialized */, "Cannot end a block scope during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot end a block scope after transformation has completed."); - const statements = some(blockScopedVariableDeclarations) ? [ - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList( - blockScopedVariableDeclarations.map((identifier) => factory2.createVariableDeclaration(identifier)), - 1 /* Let */ - ) - ) - ] : void 0; - blockScopeStackOffset--; - blockScopedVariableDeclarations = blockScopedVariableDeclarationsStack[blockScopeStackOffset]; - if (blockScopeStackOffset === 0) { - blockScopedVariableDeclarationsStack = []; - } - return statements; - } - function addBlockScopedVariable(name) { - Debug.assert(blockScopeStackOffset > 0, "Cannot add a block scoped variable outside of an iteration body."); - (blockScopedVariableDeclarations || (blockScopedVariableDeclarations = [])).push(name); - } - function requestEmitHelper(helper) { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); - Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); - if (helper.dependencies) { - for (const h of helper.dependencies) { - requestEmitHelper(h); - } - } - emitHelpers = append(emitHelpers, helper); - } - function readEmitHelpers() { - Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the transformation context during initialization."); - Debug.assert(state < 2 /* Completed */, "Cannot modify the transformation context after transformation has completed."); - const helpers = emitHelpers; - emitHelpers = void 0; - return helpers; - } - function dispose() { - if (state < 3 /* Disposed */) { - for (const node of nodes) { - disposeEmitNodes(getSourceFileOfNode(getParseTreeNode(node))); - } - lexicalEnvironmentVariableDeclarations = void 0; - lexicalEnvironmentVariableDeclarationsStack = void 0; - lexicalEnvironmentFunctionDeclarations = void 0; - lexicalEnvironmentFunctionDeclarationsStack = void 0; - onSubstituteNode = void 0; - onEmitNode = void 0; - emitHelpers = void 0; - state = 3 /* Disposed */; - } - } -} -var nullTransformationContext = { - factory, - // eslint-disable-line object-shorthand - getCompilerOptions: () => ({}), - getEmitResolver: notImplemented, - getEmitHost: notImplemented, - getEmitHelperFactory: notImplemented, - startLexicalEnvironment: noop, - resumeLexicalEnvironment: noop, - suspendLexicalEnvironment: noop, - endLexicalEnvironment: returnUndefined, - setLexicalEnvironmentFlags: noop, - getLexicalEnvironmentFlags: () => 0, - hoistVariableDeclaration: noop, - hoistFunctionDeclaration: noop, - addInitializationStatement: noop, - startBlockScope: noop, - endBlockScope: returnUndefined, - addBlockScopedVariable: noop, - requestEmitHelper: noop, - readEmitHelpers: notImplemented, - enableSubstitution: noop, - enableEmitNotification: noop, - isSubstitutionEnabled: notImplemented, - isEmitNotificationEnabled: notImplemented, - onSubstituteNode: noEmitSubstitution, - onEmitNode: noEmitNotification, - addDiagnostic: noop -}; - -// src/compiler/emitter.ts -var brackets = createBracketsMap(); -function isBuildInfoFile(file) { - return fileExtensionIs(file, ".tsbuildinfo" /* TsBuildInfo */); -} -function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit = false, onlyBuildInfo, includeBuildInfo) { - const sourceFiles = isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit); - const options = host.getCompilerOptions(); - if (!onlyBuildInfo) { - if (options.outFile) { - if (sourceFiles.length) { - const bundle = factory.createBundle(sourceFiles); - const result = action(getOutputPathsFor(bundle, host, forceDtsEmit), bundle); - if (result) { - return result; - } - } - } else { - for (const sourceFile of sourceFiles) { - const result = action(getOutputPathsFor(sourceFile, host, forceDtsEmit), sourceFile); - if (result) { - return result; - } - } - } - } - if (includeBuildInfo) { - const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); - if (buildInfoPath) return action( - { buildInfoPath }, - /*sourceFileOrBundle*/ - void 0 - ); - } -} -function getTsBuildInfoEmitOutputFilePath(options) { - const configFile = options.configFilePath; - if (!canEmitTsBuildInfo(options)) return void 0; - if (options.tsBuildInfoFile) return options.tsBuildInfoFile; - const outPath = options.outFile; - let buildInfoExtensionLess; - if (outPath) { - buildInfoExtensionLess = removeFileExtension(outPath); - } else { - if (!configFile) return void 0; - const configFileExtensionLess = removeFileExtension(configFile); - buildInfoExtensionLess = options.outDir ? options.rootDir ? resolvePath(options.outDir, getRelativePathFromDirectory( - options.rootDir, - configFileExtensionLess, - /*ignoreCase*/ - true - )) : combinePaths(options.outDir, getBaseFileName(configFileExtensionLess)) : configFileExtensionLess; - } - return buildInfoExtensionLess + ".tsbuildinfo" /* TsBuildInfo */; -} -function canEmitTsBuildInfo(options) { - return isIncrementalCompilation(options) || !!options.tscBuild; -} -function getOutputPathsForBundle(options, forceDtsPaths) { - const outPath = options.outFile; - const jsFilePath = options.emitDeclarationOnly ? void 0 : outPath; - const sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); - const declarationFilePath = forceDtsPaths || getEmitDeclarations(options) ? removeFileExtension(outPath) + ".d.ts" /* Dts */ : void 0; - const declarationMapPath = declarationFilePath && getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : void 0; - return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath }; -} -function getOutputPathsFor(sourceFile, host, forceDtsPaths) { - const options = host.getCompilerOptions(); - if (sourceFile.kind === 309 /* Bundle */) { - return getOutputPathsForBundle(options, forceDtsPaths); - } else { - const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options)); - const isJsonFile = isJsonSourceFile(sourceFile); - const isJsonEmittedToSameLocation = isJsonFile && comparePaths(sourceFile.fileName, ownOutputFilePath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */; - const jsFilePath = options.emitDeclarationOnly || isJsonEmittedToSameLocation ? void 0 : ownOutputFilePath; - const sourceMapFilePath = !jsFilePath || isJsonSourceFile(sourceFile) ? void 0 : getSourceMapFilePath(jsFilePath, options); - const declarationFilePath = forceDtsPaths || getEmitDeclarations(options) && !isJsonFile ? getDeclarationEmitOutputFilePath(sourceFile.fileName, host) : void 0; - const declarationMapPath = declarationFilePath && getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : void 0; - return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath }; - } -} -function getSourceMapFilePath(jsFilePath, options) { - return options.sourceMap && !options.inlineSourceMap ? jsFilePath + ".map" : void 0; -} -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, ignoreCase, outputDir, getCommonSourceDirectory2) { - return outputDir ? resolvePath( - outputDir, - getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase) - ) : inputFileName; -} -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, ignoreCase, options.declarationDir || options.outDir, getCommonSourceDirectory2), - getDeclarationEmitExtensionForPath(inputFileName) - ); -} -function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2 = () => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)) { - if (configFile.options.emitDeclarationOnly) return void 0; - const isJsonFile = fileExtensionIs(inputFileName, ".json" /* Json */); - 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 }; - function addOutput(path) { - if (path) { - (outputs || (outputs = [])).push(path); - } - } - function getOutputs() { - return outputs || emptyArray; - } -} -function getSingleOutputFileNames(configFile, addOutput) { - const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle( - configFile.options, - /*forceDtsPaths*/ - false - ); - addOutput(jsFilePath); - addOutput(sourceMapFilePath); - addOutput(declarationFilePath); - addOutput(declarationMapPath); -} -function getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory2) { - if (isDeclarationFileName(inputFileName)) return; - const js = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); - addOutput(js); - if (fileExtensionIs(inputFileName, ".json" /* Json */)) return; - if (js && configFile.options.sourceMap) { - addOutput(`${js}.map`); - } - if (getEmitDeclarations(configFile.options)) { - const dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); - addOutput(dts); - if (configFile.options.declarationMap) { - addOutput(`${dts}.map`); - } - } -} -function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCanonicalFileName, checkSourceFilesBelongToPath) { - let commonSourceDirectory; - if (options.rootDir) { - commonSourceDirectory = getNormalizedAbsolutePath(options.rootDir, currentDirectory); - checkSourceFilesBelongToPath == null ? void 0 : checkSourceFilesBelongToPath(options.rootDir); - } else if (options.composite && options.configFilePath) { - commonSourceDirectory = getDirectoryPath(normalizeSlashes(options.configFilePath)); - checkSourceFilesBelongToPath == null ? void 0 : checkSourceFilesBelongToPath(commonSourceDirectory); - } else { - commonSourceDirectory = computeCommonSourceDirectoryOfFilenames(emittedFiles(), currentDirectory, getCanonicalFileName); - } - if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== directorySeparator) { - commonSourceDirectory += directorySeparator; - } - return commonSourceDirectory; -} -function getCommonSourceDirectoryOfConfig({ options, fileNames }, ignoreCase) { - return getCommonSourceDirectory( - options, - () => filter(fileNames, (file) => !(options.noEmitForJsFiles && fileExtensionIsOneOf(file, supportedJSExtensionsFlat)) && !isDeclarationFileName(file)), - getDirectoryPath(normalizeSlashes(Debug.checkDefined(options.configFilePath))), - createGetCanonicalFileName(!ignoreCase) - ); -} -function getAllProjectOutputs(configFile, ignoreCase) { - const { addOutput, getOutputs } = createAddOutput(); - if (configFile.options.outFile) { - getSingleOutputFileNames(configFile, addOutput); - } else { - const getCommonSourceDirectory2 = memoize(() => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)); - for (const inputFileName of configFile.fileNames) { - getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory2); - } - } - addOutput(getTsBuildInfoEmitOutputFilePath(configFile.options)); - return getOutputs(); -} -function getOutputFileNames(commandLine, inputFileName, ignoreCase) { - inputFileName = normalizePath(inputFileName); - Debug.assert(contains(commandLine.fileNames, inputFileName), `Expected fileName to be present in command line`); - const { addOutput, getOutputs } = createAddOutput(); - if (commandLine.options.outFile) { - getSingleOutputFileNames(commandLine, addOutput); - } else { - getOwnOutputFileNames(commandLine, inputFileName, ignoreCase, addOutput); - } - return getOutputs(); -} -function getFirstProjectOutput(configFile, ignoreCase) { - if (configFile.options.outFile) { - const { jsFilePath, declarationFilePath } = getOutputPathsForBundle( - configFile.options, - /*forceDtsPaths*/ - false - ); - return Debug.checkDefined(jsFilePath || declarationFilePath, `project ${configFile.options.configFilePath} expected to have at least one output`); - } - const getCommonSourceDirectory2 = memoize(() => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)); - for (const inputFileName of configFile.fileNames) { - if (isDeclarationFileName(inputFileName)) continue; - const jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); - if (jsFilePath) return jsFilePath; - if (fileExtensionIs(inputFileName, ".json" /* Json */)) continue; - if (getEmitDeclarations(configFile.options)) { - return getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); - } - } - const buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options); - if (buildInfoPath) return buildInfoPath; - return Debug.fail(`project ${configFile.options.configFilePath} expected to have at least one output`); -} -function emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit) { - return !!forceDtsEmit && !!emitOnly; -} -function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, declarationTransformers }, emitOnly, onlyBuildInfo, forceDtsEmit, skipBuildInfo) { - var compilerOptions = host.getCompilerOptions(); - var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; - var emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; - var emitterDiagnostics = createDiagnosticCollection(); - var newLine = getNewLineCharacter(compilerOptions); - var writer = createTextWriter(newLine); - var { enter, exit } = createTimer("printTime", "beforePrint", "afterPrint"); - var emitSkipped = false; - enter(); - forEachEmittedFile( - host, - emitSourceFileOrBundle, - getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), - forceDtsEmit, - onlyBuildInfo, - !targetSourceFile && !skipBuildInfo - ); - exit(); - return { - emitSkipped, - diagnostics: emitterDiagnostics.getDiagnostics(), - emittedFiles: emittedFilesList, - sourceMaps: sourceMapDataList - }; - function emitSourceFileOrBundle({ jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath }, sourceFileOrBundle) { - var _a, _b, _c, _d, _e, _f; - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "emitJsFileOrBundle", { jsFilePath }); - emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath); - (_b = tracing) == null ? void 0 : _b.pop(); - (_c = tracing) == null ? void 0 : _c.push(tracing.Phase.Emit, "emitDeclarationFileOrBundle", { declarationFilePath }); - emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath); - (_d = tracing) == null ? void 0 : _d.pop(); - (_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Emit, "emitBuildInfo", { buildInfoPath }); - emitBuildInfo(buildInfoPath); - (_f = tracing) == null ? void 0 : _f.pop(); - } - function emitBuildInfo(buildInfoPath) { - if (!buildInfoPath || targetSourceFile) return; - if (host.isEmitBlocked(buildInfoPath)) { - emitSkipped = true; - return; - } - const buildInfo = host.getBuildInfo() || { version }; - writeFile( - host, - emitterDiagnostics, - buildInfoPath, - getBuildInfoText(buildInfo), - /*writeByteOrderMark*/ - false, - /*sourceFiles*/ - void 0, - { buildInfo } - ); - emittedFilesList == null ? void 0 : emittedFilesList.push(buildInfoPath); - } - function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath) { - if (!sourceFileOrBundle || emitOnly || !jsFilePath) { - return; - } - if (host.isEmitBlocked(jsFilePath) || compilerOptions.noEmit) { - emitSkipped = true; - return; - } - (isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : filter(sourceFileOrBundle.sourceFiles, isSourceFileNotJson)).forEach( - (sourceFile) => { - if (compilerOptions.noCheck || !canIncludeBindAndCheckDiagnostics(sourceFile, compilerOptions)) markLinkedReferences(sourceFile); - } - ); - const transform2 = transformNodes( - resolver, - host, - factory, - compilerOptions, - [sourceFileOrBundle], - scriptTransformers, - /*allowDtsFiles*/ - false - ); - const printerOptions = { - removeComments: compilerOptions.removeComments, - newLine: compilerOptions.newLine, - noEmitHelpers: compilerOptions.noEmitHelpers, - module: getEmitModuleKind(compilerOptions), - moduleResolution: getEmitModuleResolutionKind(compilerOptions), - target: getEmitScriptTarget(compilerOptions), - sourceMap: compilerOptions.sourceMap, - inlineSourceMap: compilerOptions.inlineSourceMap, - inlineSources: compilerOptions.inlineSources, - extendedDiagnostics: compilerOptions.extendedDiagnostics - }; - const printer = createPrinter(printerOptions, { - // resolver hooks - hasGlobalName: resolver.hasGlobalName, - // transform hooks - onEmitNode: transform2.emitNodeWithNotification, - isEmitNotificationEnabled: transform2.isEmitNotificationEnabled, - substituteNode: transform2.substituteNode - }); - Debug.assert(transform2.transformed.length === 1, "Should only see one output from the transform"); - printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, compilerOptions); - transform2.dispose(); - if (emittedFilesList) { - emittedFilesList.push(jsFilePath); - if (sourceMapFilePath) { - emittedFilesList.push(sourceMapFilePath); - } - } - } - function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath) { - if (!sourceFileOrBundle || emitOnly === 0 /* Js */) return; - if (!declarationFilePath) { - if (emitOnly || compilerOptions.emitDeclarationOnly) emitSkipped = true; - return; - } - const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles; - const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson); - const inputListOrBundle = compilerOptions.outFile ? [factory.createBundle(filesForEmit)] : filesForEmit; - filesForEmit.forEach((sourceFile) => { - if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck || emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit) || !canIncludeBindAndCheckDiagnostics(sourceFile, compilerOptions)) { - collectLinkedAliases(sourceFile); - } - }); - const declarationTransform = transformNodes( - resolver, - host, - factory, - compilerOptions, - inputListOrBundle, - declarationTransformers, - /*allowDtsFiles*/ - false - ); - if (length(declarationTransform.diagnostics)) { - for (const diagnostic of declarationTransform.diagnostics) { - emitterDiagnostics.add(diagnostic); - } - } - 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, - moduleResolution: compilerOptions.moduleResolution, - target: compilerOptions.target, - sourceMap: emitOnly !== 2 /* BuilderSignature */ && compilerOptions.declarationMap, - inlineSourceMap: compilerOptions.inlineSourceMap, - extendedDiagnostics: compilerOptions.extendedDiagnostics, - onlyPrintJsDocStyle: true, - omitBraceSourceMapPositions: true - }; - const declarationPrinter = createPrinter(printerOptions, { - // resolver hooks - hasGlobalName: resolver.hasGlobalName, - // transform hooks - onEmitNode: declarationTransform.emitNodeWithNotification, - isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled, - substituteNode: declarationTransform.substituteNode - }); - const dtsWritten = printSourceFileOrBundle( - declarationFilePath, - declarationMapPath, - declarationTransform, - declarationPrinter, - { - sourceMap: printerOptions.sourceMap, - sourceRoot: compilerOptions.sourceRoot, - mapRoot: compilerOptions.mapRoot, - extendedDiagnostics: compilerOptions.extendedDiagnostics - // Explicitly do not passthru either `inline` option - } - ); - if (emittedFilesList) { - if (dtsWritten) emittedFilesList.push(declarationFilePath); - if (declarationMapPath) { - emittedFilesList.push(declarationMapPath); - } - } - } - declarationTransform.dispose(); - } - function collectLinkedAliases(node) { - if (isExportAssignment(node)) { - if (node.expression.kind === 80 /* Identifier */) { - resolver.collectLinkedAliases( - node.expression, - /*setVisibility*/ - true - ); - } - return; - } else if (isExportSpecifier(node)) { - resolver.collectLinkedAliases( - node.propertyName || node.name, - /*setVisibility*/ - true - ); - return; - } - forEachChild(node, collectLinkedAliases); - } - function markLinkedReferences(file) { - if (isSourceFileJS(file)) return; - forEachChildRecursively(file, (n) => { - if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip"; - if (isImportDeclaration(n)) return "skip"; - resolver.markLinkedReferences(n); - }); - } - function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, mapOptions) { - const sourceFileOrBundle = transform2.transformed[0]; - const bundle = sourceFileOrBundle.kind === 309 /* Bundle */ ? sourceFileOrBundle : void 0; - const sourceFile = sourceFileOrBundle.kind === 308 /* SourceFile */ ? sourceFileOrBundle : void 0; - const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; - let sourceMapGenerator; - if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { - sourceMapGenerator = createSourceMapGenerator( - host, - getBaseFileName(normalizeSlashes(jsFilePath)), - getSourceRoot(mapOptions), - getSourceMapDirectory(mapOptions, jsFilePath, sourceFile), - mapOptions - ); - } - if (bundle) { - printer.writeBundle(bundle, writer, sourceMapGenerator); - } else { - printer.writeFile(sourceFile, writer, sourceMapGenerator); - } - let sourceMapUrlPos; - if (sourceMapGenerator) { - if (sourceMapDataList) { - sourceMapDataList.push({ - inputSourceFileNames: sourceMapGenerator.getSources(), - sourceMap: sourceMapGenerator.toJSON() - }); - } - const sourceMappingURL = getSourceMappingURL( - mapOptions, - sourceMapGenerator, - jsFilePath, - sourceMapFilePath, - sourceFile - ); - if (sourceMappingURL) { - if (!writer.isAtStartOfLine()) writer.rawWrite(newLine); - sourceMapUrlPos = writer.getTextPos(); - writer.writeComment(`//# ${"sourceMappingURL"}=${sourceMappingURL}`); - } - if (sourceMapFilePath) { - const sourceMap = sourceMapGenerator.toString(); - writeFile( - host, - emitterDiagnostics, - sourceMapFilePath, - sourceMap, - /*writeByteOrderMark*/ - false, - sourceFiles - ); - } - } else { - writer.writeLine(); - } - const text = writer.getText(); - const data = { sourceMapUrlPos, diagnostics: transform2.diagnostics }; - writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data); - writer.clear(); - return !data.skippedDtsWrite; - } - function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { - return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 308 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); - } - function getSourceRoot(mapOptions) { - const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || ""); - return sourceRoot ? ensureTrailingDirectorySeparator(sourceRoot) : sourceRoot; - } - function getSourceMapDirectory(mapOptions, filePath, sourceFile) { - if (mapOptions.sourceRoot) return host.getCommonSourceDirectory(); - if (mapOptions.mapRoot) { - let sourceMapDir = normalizeSlashes(mapOptions.mapRoot); - if (sourceFile) { - sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir)); - } - if (getRootLength(sourceMapDir) === 0) { - sourceMapDir = combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - } - return sourceMapDir; - } - return getDirectoryPath(normalizePath(filePath)); - } - function getSourceMappingURL(mapOptions, sourceMapGenerator, filePath, sourceMapFilePath, sourceFile) { - if (mapOptions.inlineSourceMap) { - const sourceMapText = sourceMapGenerator.toString(); - const base64SourceMapText = base64encode(sys, sourceMapText); - return `data:application/json;base64,${base64SourceMapText}`; - } - const sourceMapFile = getBaseFileName(normalizeSlashes(Debug.checkDefined(sourceMapFilePath))); - if (mapOptions.mapRoot) { - let sourceMapDir = normalizeSlashes(mapOptions.mapRoot); - if (sourceFile) { - sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir)); - } - if (getRootLength(sourceMapDir) === 0) { - sourceMapDir = combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - return encodeURI( - getRelativePathToDirectoryOrUrl( - getDirectoryPath(normalizePath(filePath)), - // get the relative sourceMapDir path based on jsFilePath - combinePaths(sourceMapDir, sourceMapFile), - // this is where user expects to see sourceMap - host.getCurrentDirectory(), - host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ - true - ) - ); - } else { - return encodeURI(combinePaths(sourceMapDir, sourceMapFile)); - } - } - return encodeURI(sourceMapFile); - } -} -function getBuildInfoText(buildInfo) { - return JSON.stringify(buildInfo); -} -function getBuildInfo(buildInfoFile, buildInfoText) { - return readJsonOrUndefined(buildInfoFile, buildInfoText); -} -var notImplementedResolver = { - hasGlobalName: notImplemented, - getReferencedExportContainer: notImplemented, - getReferencedImportDeclaration: notImplemented, - getReferencedDeclarationWithCollidingName: notImplemented, - isDeclarationWithCollidingName: notImplemented, - isValueAliasDeclaration: notImplemented, - isReferencedAliasDeclaration: notImplemented, - isTopLevelValueImportEqualsWithEntityName: notImplemented, - hasNodeCheckFlag: notImplemented, - isDeclarationVisible: notImplemented, - isLateBound: (_node) => false, - collectLinkedAliases: notImplemented, - markLinkedReferences: notImplemented, - isImplementationOfOverload: notImplemented, - requiresAddingImplicitUndefined: notImplemented, - isExpandoFunctionDeclaration: notImplemented, - getPropertiesOfContainerFunction: notImplemented, - createTypeOfDeclaration: notImplemented, - createReturnTypeOfSignatureDeclaration: notImplemented, - createTypeOfExpression: notImplemented, - createLiteralConstValue: notImplemented, - isSymbolAccessible: notImplemented, - isEntityNameVisible: notImplemented, - // Returns the constant value this property access resolves to: notImplemented, or 'undefined' for a non-constant - getConstantValue: notImplemented, - getEnumMemberValue: notImplemented, - getReferencedValueDeclaration: notImplemented, - getReferencedValueDeclarations: notImplemented, - getTypeReferenceSerializationKind: notImplemented, - isOptionalParameter: notImplemented, - isArgumentsLocalBinding: notImplemented, - getExternalModuleFileFromDeclaration: notImplemented, - isLiteralConstDeclaration: notImplemented, - getJsxFactoryEntity: notImplemented, - getJsxFragmentFactoryEntity: notImplemented, - isBindingCapturedByNode: notImplemented, - getDeclarationStatementsForSourceFile: notImplemented, - isImportRequiredByAugmentation: notImplemented, - isDefinitelyReferenceToGlobalSymbolObject: notImplemented, - createLateBoundIndexSignatures: notImplemented, - symbolToDeclarations: notImplemented -}; -var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); -var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); -var createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); -var createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); -function createPrinter(printerOptions = {}, handlers = {}) { - var { - hasGlobalName, - onEmitNode = noEmitNotification, - isEmitNotificationEnabled, - substituteNode = noEmitSubstitution, - onBeforeEmitNode, - onAfterEmitNode, - onBeforeEmitNodeArray, - onAfterEmitNodeArray, - onBeforeEmitToken, - onAfterEmitToken - } = handlers; - var extendedDiagnostics = !!printerOptions.extendedDiagnostics; - var omitBraceSourcePositions = !!printerOptions.omitBraceSourceMapPositions; - var newLine = getNewLineCharacter(printerOptions); - var moduleKind = getEmitModuleKind(printerOptions); - var bundledHelpers = /* @__PURE__ */ new Map(); - var currentSourceFile; - var nodeIdToGeneratedName; - var nodeIdToGeneratedPrivateName; - var autoGeneratedIdToGeneratedName; - var generatedNames; - var formattedNameTempFlagsStack; - var formattedNameTempFlags; - var privateNameTempFlagsStack; - var privateNameTempFlags; - var tempFlagsStack; - var tempFlags; - var reservedNamesStack; - var reservedNames; - var reservedPrivateNamesStack; - var reservedPrivateNames; - var preserveSourceNewlines = printerOptions.preserveSourceNewlines; - var nextListElementPos; - var writer; - var ownWriter; - var write = writeBase; - var isOwnFileEmit; - var sourceMapsDisabled = true; - var sourceMapGenerator; - var sourceMapSource; - var sourceMapSourceIndex = -1; - var mostRecentlyAddedSourceMapSource; - var mostRecentlyAddedSourceMapSourceIndex = -1; - var containerPos = -1; - var containerEnd = -1; - var declarationListContainerEnd = -1; - var currentLineMap; - var detachedCommentsInfo; - var hasWrittenComment = false; - var commentsDisabled = !!printerOptions.removeComments; - var lastSubstitution; - var currentParenthesizerRule; - var { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); - var parenthesizer = factory.parenthesizer; - var typeArgumentParenthesizerRuleSelector = { - select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 - }; - var emitBinaryExpression = createEmitBinaryExpression(); - reset2(); - return { - // public API - printNode, - printList, - printFile, - printBundle, - // internal API - writeNode, - writeList, - writeFile: writeFile2, - writeBundle - }; - function printNode(hint, node, sourceFile) { - switch (hint) { - case 0 /* SourceFile */: - Debug.assert(isSourceFile(node), "Expected a SourceFile node."); - break; - case 2 /* IdentifierName */: - Debug.assert(isIdentifier(node), "Expected an Identifier node."); - break; - case 1 /* Expression */: - Debug.assert(isExpression(node), "Expected an Expression node."); - break; - } - switch (node.kind) { - case 308 /* SourceFile */: - return printFile(node); - case 309 /* Bundle */: - return printBundle(node); - } - writeNode(hint, node, sourceFile, beginPrint()); - return endPrint(); - } - function printList(format, nodes, sourceFile) { - writeList(format, nodes, sourceFile, beginPrint()); - return endPrint(); - } - function printBundle(bundle) { - writeBundle( - bundle, - beginPrint(), - /*sourceMapGenerator*/ - void 0 - ); - return endPrint(); - } - function printFile(sourceFile) { - writeFile2( - sourceFile, - beginPrint(), - /*sourceMapGenerator*/ - void 0 - ); - return endPrint(); - } - function writeNode(hint, node, sourceFile, output) { - const previousWriter = writer; - setWriter( - output, - /*_sourceMapGenerator*/ - void 0 - ); - print(hint, node, sourceFile); - reset2(); - writer = previousWriter; - } - function writeList(format, nodes, sourceFile, output) { - const previousWriter = writer; - setWriter( - output, - /*_sourceMapGenerator*/ - void 0 - ); - if (sourceFile) { - setSourceFile(sourceFile); - } - emitList( - /*parentNode*/ - void 0, - nodes, - format - ); - reset2(); - writer = previousWriter; - } - function writeBundle(bundle, output, sourceMapGenerator2) { - isOwnFileEmit = false; - const previousWriter = writer; - setWriter(output, sourceMapGenerator2); - emitShebangIfNeeded(bundle); - emitPrologueDirectivesIfNeeded(bundle); - emitHelpers(bundle); - emitSyntheticTripleSlashReferencesIfNeeded(bundle); - for (const sourceFile of bundle.sourceFiles) { - print(0 /* SourceFile */, sourceFile, sourceFile); - } - reset2(); - writer = previousWriter; - } - function writeFile2(sourceFile, output, sourceMapGenerator2) { - isOwnFileEmit = true; - const previousWriter = writer; - setWriter(output, sourceMapGenerator2); - emitShebangIfNeeded(sourceFile); - emitPrologueDirectivesIfNeeded(sourceFile); - print(0 /* SourceFile */, sourceFile, sourceFile); - reset2(); - writer = previousWriter; - } - function beginPrint() { - return ownWriter || (ownWriter = createTextWriter(newLine)); - } - function endPrint() { - const text = ownWriter.getText(); - ownWriter.clear(); - return text; - } - function print(hint, node, sourceFile) { - if (sourceFile) { - setSourceFile(sourceFile); - } - pipelineEmit( - hint, - node, - /*parenthesizerRule*/ - void 0 - ); - } - function setSourceFile(sourceFile) { - currentSourceFile = sourceFile; - currentLineMap = void 0; - detachedCommentsInfo = void 0; - if (sourceFile) { - setSourceMapSource(sourceFile); - } - } - function setWriter(_writer, _sourceMapGenerator) { - if (_writer && printerOptions.omitTrailingSemicolon) { - _writer = getTrailingSemicolonDeferringWriter(_writer); - } - writer = _writer; - sourceMapGenerator = _sourceMapGenerator; - sourceMapsDisabled = !writer || !sourceMapGenerator; - } - function reset2() { - nodeIdToGeneratedName = []; - nodeIdToGeneratedPrivateName = []; - autoGeneratedIdToGeneratedName = []; - generatedNames = /* @__PURE__ */ new Set(); - formattedNameTempFlagsStack = []; - formattedNameTempFlags = /* @__PURE__ */ new Map(); - privateNameTempFlagsStack = []; - privateNameTempFlags = 0 /* Auto */; - tempFlagsStack = []; - tempFlags = 0 /* Auto */; - reservedNamesStack = []; - reservedNames = void 0; - reservedPrivateNamesStack = []; - reservedPrivateNames = void 0; - currentSourceFile = void 0; - currentLineMap = void 0; - detachedCommentsInfo = void 0; - setWriter( - /*output*/ - void 0, - /*_sourceMapGenerator*/ - void 0 - ); - } - function getCurrentLineMap() { - return currentLineMap || (currentLineMap = getLineStarts(Debug.checkDefined(currentSourceFile))); - } - function emit(node, parenthesizerRule) { - if (node === void 0) return; - pipelineEmit(4 /* Unspecified */, node, parenthesizerRule); - } - function emitIdentifierName(node) { - if (node === void 0) return; - pipelineEmit( - 2 /* IdentifierName */, - node, - /*parenthesizerRule*/ - void 0 - ); - } - function emitExpression(node, parenthesizerRule) { - if (node === void 0) return; - pipelineEmit(1 /* Expression */, node, parenthesizerRule); - } - function emitJsxAttributeValue(node) { - pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); - } - function beforeEmitNode(node) { - if (preserveSourceNewlines && getInternalEmitFlags(node) & 4 /* IgnoreSourceNewlines */) { - preserveSourceNewlines = false; - } - } - function afterEmitNode(savedPreserveSourceNewlines) { - preserveSourceNewlines = savedPreserveSourceNewlines; - } - function pipelineEmit(emitHint, node, parenthesizerRule) { - currentParenthesizerRule = parenthesizerRule; - const pipelinePhase = getPipelinePhase(0 /* Notification */, emitHint, node); - pipelinePhase(emitHint, node); - currentParenthesizerRule = void 0; - } - function shouldEmitComments(node) { - return !commentsDisabled && !isSourceFile(node); - } - function shouldEmitSourceMaps(node) { - return !sourceMapsDisabled && !isSourceFile(node) && !isInJsonFile(node); - } - function getPipelinePhase(phase, emitHint, node) { - switch (phase) { - case 0 /* Notification */: - if (onEmitNode !== noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) { - return pipelineEmitWithNotification; - } - // falls through - case 1 /* Substitution */: - if (substituteNode !== noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) { - if (currentParenthesizerRule) { - lastSubstitution = currentParenthesizerRule(lastSubstitution); - } - return pipelineEmitWithSubstitution; - } - // falls through - case 2 /* Comments */: - if (shouldEmitComments(node)) { - return pipelineEmitWithComments; - } - // falls through - case 3 /* SourceMaps */: - if (shouldEmitSourceMaps(node)) { - return pipelineEmitWithSourceMaps; - } - // falls through - case 4 /* Emit */: - return pipelineEmitWithHint; - default: - return Debug.assertNever(phase); - } - } - function getNextPipelinePhase(currentPhase, emitHint, node) { - return getPipelinePhase(currentPhase + 1, emitHint, node); - } - function pipelineEmitWithNotification(hint, node) { - const pipelinePhase = getNextPipelinePhase(0 /* Notification */, hint, node); - onEmitNode(hint, node, pipelinePhase); - } - function pipelineEmitWithHint(hint, node) { - onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); - if (preserveSourceNewlines) { - const savedPreserveSourceNewlines = preserveSourceNewlines; - beforeEmitNode(node); - pipelineEmitWithHintWorker(hint, node); - afterEmitNode(savedPreserveSourceNewlines); - } else { - pipelineEmitWithHintWorker(hint, node); - } - onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); - currentParenthesizerRule = void 0; - } - function pipelineEmitWithHintWorker(hint, node, allowSnippets = true) { - if (allowSnippets) { - const snippet = getSnippetElement(node); - if (snippet) { - return emitSnippetNode(hint, node, snippet); - } - } - if (hint === 0 /* SourceFile */) return emitSourceFile(cast(node, isSourceFile)); - if (hint === 2 /* IdentifierName */) return emitIdentifier(cast(node, isIdentifier)); - if (hint === 6 /* JsxAttributeValue */) return emitLiteral( - cast(node, isStringLiteral), - /*jsxAttributeEscape*/ - true - ); - 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( - /*isEmbeddedStatement*/ - true - ); - } - if (hint === 4 /* Unspecified */) { - switch (node.kind) { - // Pseudo-literals - case 16 /* TemplateHead */: - case 17 /* TemplateMiddle */: - case 18 /* TemplateTail */: - return emitLiteral( - node, - /*jsxAttributeEscape*/ - false - ); - // Identifiers - case 80 /* Identifier */: - return emitIdentifier(node); - // PrivateIdentifiers - case 81 /* PrivateIdentifier */: - return emitPrivateIdentifier(node); - // Parse tree nodes - // Names - case 167 /* QualifiedName */: - return emitQualifiedName(node); - case 168 /* ComputedPropertyName */: - return emitComputedPropertyName(node); - // Signature elements - case 169 /* TypeParameter */: - return emitTypeParameter(node); - case 170 /* Parameter */: - return emitParameter(node); - case 171 /* Decorator */: - return emitDecorator(node); - // Type members - case 172 /* PropertySignature */: - return emitPropertySignature(node); - case 173 /* PropertyDeclaration */: - return emitPropertyDeclaration(node); - case 174 /* MethodSignature */: - return emitMethodSignature(node); - case 175 /* MethodDeclaration */: - return emitMethodDeclaration(node); - case 176 /* ClassStaticBlockDeclaration */: - return emitClassStaticBlockDeclaration(node); - case 177 /* Constructor */: - return emitConstructor(node); - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return emitAccessorDeclaration(node); - case 180 /* CallSignature */: - return emitCallSignature(node); - case 181 /* ConstructSignature */: - return emitConstructSignature(node); - case 182 /* IndexSignature */: - return emitIndexSignature(node); - // Types - case 183 /* TypePredicate */: - return emitTypePredicate(node); - case 184 /* TypeReference */: - return emitTypeReference(node); - case 185 /* FunctionType */: - return emitFunctionType(node); - case 186 /* ConstructorType */: - return emitConstructorType(node); - case 187 /* TypeQuery */: - return emitTypeQuery(node); - case 188 /* TypeLiteral */: - return emitTypeLiteral(node); - case 189 /* ArrayType */: - return emitArrayType(node); - case 190 /* TupleType */: - return emitTupleType(node); - case 191 /* OptionalType */: - return emitOptionalType(node); - // SyntaxKind.RestType is handled below - case 193 /* UnionType */: - return emitUnionType(node); - case 194 /* IntersectionType */: - return emitIntersectionType(node); - case 195 /* ConditionalType */: - return emitConditionalType(node); - case 196 /* InferType */: - return emitInferType(node); - case 197 /* ParenthesizedType */: - return emitParenthesizedType(node); - case 234 /* ExpressionWithTypeArguments */: - return emitExpressionWithTypeArguments(node); - case 198 /* ThisType */: - return emitThisType(); - case 199 /* TypeOperator */: - return emitTypeOperator(node); - case 200 /* IndexedAccessType */: - return emitIndexedAccessType(node); - case 201 /* MappedType */: - return emitMappedType(node); - case 202 /* LiteralType */: - return emitLiteralType(node); - case 203 /* NamedTupleMember */: - return emitNamedTupleMember(node); - case 204 /* TemplateLiteralType */: - return emitTemplateType(node); - case 205 /* TemplateLiteralTypeSpan */: - return emitTemplateTypeSpan(node); - case 206 /* ImportType */: - return emitImportTypeNode(node); - // Binding patterns - case 207 /* ObjectBindingPattern */: - return emitObjectBindingPattern(node); - case 208 /* ArrayBindingPattern */: - return emitArrayBindingPattern(node); - case 209 /* BindingElement */: - return emitBindingElement(node); - // Misc - case 240 /* TemplateSpan */: - return emitTemplateSpan(node); - case 241 /* SemicolonClassElement */: - return emitSemicolonClassElement(); - // Statements - case 242 /* Block */: - return emitBlock(node); - case 244 /* VariableStatement */: - return emitVariableStatement(node); - case 243 /* EmptyStatement */: - return emitEmptyStatement( - /*isEmbeddedStatement*/ - false - ); - case 245 /* ExpressionStatement */: - return emitExpressionStatement(node); - case 246 /* IfStatement */: - return emitIfStatement(node); - case 247 /* DoStatement */: - return emitDoStatement(node); - case 248 /* WhileStatement */: - return emitWhileStatement(node); - case 249 /* ForStatement */: - return emitForStatement(node); - case 250 /* ForInStatement */: - return emitForInStatement(node); - case 251 /* ForOfStatement */: - return emitForOfStatement(node); - case 252 /* ContinueStatement */: - return emitContinueStatement(node); - case 253 /* BreakStatement */: - return emitBreakStatement(node); - case 254 /* ReturnStatement */: - return emitReturnStatement(node); - case 255 /* WithStatement */: - return emitWithStatement(node); - case 256 /* SwitchStatement */: - return emitSwitchStatement(node); - case 257 /* LabeledStatement */: - return emitLabeledStatement(node); - case 258 /* ThrowStatement */: - return emitThrowStatement(node); - case 259 /* TryStatement */: - return emitTryStatement(node); - case 260 /* DebuggerStatement */: - return emitDebuggerStatement(node); - // Declarations - case 261 /* VariableDeclaration */: - return emitVariableDeclaration(node); - case 262 /* VariableDeclarationList */: - return emitVariableDeclarationList(node); - case 263 /* FunctionDeclaration */: - return emitFunctionDeclaration(node); - case 264 /* ClassDeclaration */: - return emitClassDeclaration(node); - case 265 /* InterfaceDeclaration */: - return emitInterfaceDeclaration(node); - case 266 /* TypeAliasDeclaration */: - return emitTypeAliasDeclaration(node); - case 267 /* EnumDeclaration */: - return emitEnumDeclaration(node); - case 268 /* ModuleDeclaration */: - return emitModuleDeclaration(node); - case 269 /* ModuleBlock */: - return emitModuleBlock(node); - case 270 /* CaseBlock */: - return emitCaseBlock(node); - case 271 /* NamespaceExportDeclaration */: - return emitNamespaceExportDeclaration(node); - case 272 /* ImportEqualsDeclaration */: - return emitImportEqualsDeclaration(node); - case 273 /* ImportDeclaration */: - return emitImportDeclaration(node); - case 274 /* ImportClause */: - return emitImportClause(node); - case 275 /* NamespaceImport */: - return emitNamespaceImport(node); - case 281 /* NamespaceExport */: - return emitNamespaceExport(node); - case 276 /* NamedImports */: - return emitNamedImports(node); - case 277 /* ImportSpecifier */: - return emitImportSpecifier(node); - case 278 /* ExportAssignment */: - return emitExportAssignment(node); - case 279 /* ExportDeclaration */: - return emitExportDeclaration(node); - case 280 /* NamedExports */: - return emitNamedExports(node); - case 282 /* ExportSpecifier */: - return emitExportSpecifier(node); - case 301 /* ImportAttributes */: - return emitImportAttributes(node); - case 302 /* ImportAttribute */: - return emitImportAttribute(node); - case 283 /* MissingDeclaration */: - return; - // Module references - case 284 /* ExternalModuleReference */: - return emitExternalModuleReference(node); - // JSX (non-expression) - case 12 /* JsxText */: - return emitJsxText(node); - case 287 /* JsxOpeningElement */: - case 290 /* JsxOpeningFragment */: - return emitJsxOpeningElementOrFragment(node); - case 288 /* JsxClosingElement */: - case 291 /* JsxClosingFragment */: - return emitJsxClosingElementOrFragment(node); - case 292 /* JsxAttribute */: - return emitJsxAttribute(node); - case 293 /* JsxAttributes */: - return emitJsxAttributes(node); - case 294 /* JsxSpreadAttribute */: - return emitJsxSpreadAttribute(node); - case 295 /* JsxExpression */: - return emitJsxExpression(node); - case 296 /* JsxNamespacedName */: - return emitJsxNamespacedName(node); - // Clauses - case 297 /* CaseClause */: - return emitCaseClause(node); - case 298 /* DefaultClause */: - return emitDefaultClause(node); - case 299 /* HeritageClause */: - return emitHeritageClause(node); - case 300 /* CatchClause */: - return emitCatchClause(node); - // Property assignments - case 304 /* PropertyAssignment */: - return emitPropertyAssignment(node); - case 305 /* ShorthandPropertyAssignment */: - return emitShorthandPropertyAssignment(node); - case 306 /* SpreadAssignment */: - return emitSpreadAssignment(node); - // Enum - case 307 /* EnumMember */: - return emitEnumMember(node); - // Top-level nodes - case 308 /* SourceFile */: - return emitSourceFile(node); - case 309 /* Bundle */: - return Debug.fail("Bundles should be printed using printBundle"); - // JSDoc nodes (only used in codefixes currently) - case 310 /* JSDocTypeExpression */: - return emitJSDocTypeExpression(node); - case 311 /* JSDocNameReference */: - return emitJSDocNameReference(node); - case 313 /* JSDocAllType */: - return writePunctuation("*"); - case 314 /* JSDocUnknownType */: - return writePunctuation("?"); - case 315 /* JSDocNullableType */: - return emitJSDocNullableType(node); - case 316 /* JSDocNonNullableType */: - return emitJSDocNonNullableType(node); - case 317 /* JSDocOptionalType */: - return emitJSDocOptionalType(node); - case 318 /* JSDocFunctionType */: - return emitJSDocFunctionType(node); - case 192 /* RestType */: - case 319 /* JSDocVariadicType */: - return emitRestOrJSDocVariadicType(node); - case 320 /* JSDocNamepathType */: - return; - case 321 /* JSDoc */: - return emitJSDoc(node); - case 323 /* JSDocTypeLiteral */: - return emitJSDocTypeLiteral(node); - case 324 /* JSDocSignature */: - return emitJSDocSignature(node); - case 328 /* JSDocTag */: - case 333 /* JSDocClassTag */: - case 338 /* JSDocOverrideTag */: - return emitJSDocSimpleTag(node); - case 329 /* JSDocAugmentsTag */: - case 330 /* JSDocImplementsTag */: - return emitJSDocHeritageTag(node); - case 331 /* JSDocAuthorTag */: - case 332 /* JSDocDeprecatedTag */: - return; - // SyntaxKind.JSDocClassTag (see JSDocTag, above) - case 334 /* JSDocPublicTag */: - case 335 /* JSDocPrivateTag */: - case 336 /* JSDocProtectedTag */: - case 337 /* JSDocReadonlyTag */: - return; - case 339 /* JSDocCallbackTag */: - return emitJSDocCallbackTag(node); - case 340 /* JSDocOverloadTag */: - return emitJSDocOverloadTag(node); - // SyntaxKind.JSDocEnumTag (see below) - case 342 /* JSDocParameterTag */: - case 349 /* JSDocPropertyTag */: - return emitJSDocPropertyLikeTag(node); - case 341 /* JSDocEnumTag */: - case 343 /* JSDocReturnTag */: - case 344 /* JSDocThisTag */: - case 345 /* JSDocTypeTag */: - case 350 /* JSDocThrowsTag */: - case 351 /* JSDocSatisfiesTag */: - return emitJSDocSimpleTypedTag(node); - case 346 /* JSDocTemplateTag */: - return emitJSDocTemplateTag(node); - case 347 /* JSDocTypedefTag */: - return emitJSDocTypedefTag(node); - case 348 /* JSDocSeeTag */: - return emitJSDocSeeTag(node); - case 352 /* JSDocImportTag */: - return emitJSDocImportTag(node); - // SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above) - // Transformation nodes - case 354 /* NotEmittedStatement */: - case 355 /* NotEmittedTypeElement */: - return; - } - if (isExpression(node)) { - hint = 1 /* Expression */; - if (substituteNode !== noEmitSubstitution) { - const substitute = substituteNode(hint, node) || node; - if (substitute !== node) { - node = substitute; - if (currentParenthesizerRule) { - node = currentParenthesizerRule(node); - } - } - } - } - } - if (hint === 1 /* Expression */) { - switch (node.kind) { - // Literals - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - return emitNumericOrBigIntLiteral(node); - case 11 /* StringLiteral */: - case 14 /* RegularExpressionLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - return emitLiteral( - node, - /*jsxAttributeEscape*/ - false - ); - // Identifiers - case 80 /* Identifier */: - return emitIdentifier(node); - case 81 /* PrivateIdentifier */: - return emitPrivateIdentifier(node); - // Expressions - case 210 /* ArrayLiteralExpression */: - return emitArrayLiteralExpression(node); - case 211 /* ObjectLiteralExpression */: - return emitObjectLiteralExpression(node); - case 212 /* PropertyAccessExpression */: - return emitPropertyAccessExpression(node); - case 213 /* ElementAccessExpression */: - return emitElementAccessExpression(node); - case 214 /* CallExpression */: - return emitCallExpression(node); - case 215 /* NewExpression */: - return emitNewExpression(node); - case 216 /* TaggedTemplateExpression */: - return emitTaggedTemplateExpression(node); - case 217 /* TypeAssertionExpression */: - return emitTypeAssertionExpression(node); - case 218 /* ParenthesizedExpression */: - return emitParenthesizedExpression(node); - case 219 /* FunctionExpression */: - return emitFunctionExpression(node); - case 220 /* ArrowFunction */: - return emitArrowFunction(node); - case 221 /* DeleteExpression */: - return emitDeleteExpression(node); - case 222 /* TypeOfExpression */: - return emitTypeOfExpression(node); - case 223 /* VoidExpression */: - return emitVoidExpression(node); - case 224 /* AwaitExpression */: - return emitAwaitExpression(node); - case 225 /* PrefixUnaryExpression */: - return emitPrefixUnaryExpression(node); - case 226 /* PostfixUnaryExpression */: - return emitPostfixUnaryExpression(node); - case 227 /* BinaryExpression */: - return emitBinaryExpression(node); - case 228 /* ConditionalExpression */: - return emitConditionalExpression(node); - case 229 /* TemplateExpression */: - return emitTemplateExpression(node); - case 230 /* YieldExpression */: - return emitYieldExpression(node); - case 231 /* SpreadElement */: - return emitSpreadElement(node); - case 232 /* ClassExpression */: - return emitClassExpression(node); - case 233 /* OmittedExpression */: - return; - case 235 /* AsExpression */: - return emitAsExpression(node); - case 236 /* NonNullExpression */: - return emitNonNullExpression(node); - case 234 /* ExpressionWithTypeArguments */: - return emitExpressionWithTypeArguments(node); - case 239 /* SatisfiesExpression */: - return emitSatisfiesExpression(node); - case 237 /* MetaProperty */: - return emitMetaProperty(node); - case 238 /* SyntheticExpression */: - return Debug.fail("SyntheticExpression should never be printed."); - case 283 /* MissingDeclaration */: - return; - // JSX - case 285 /* JsxElement */: - return emitJsxElement(node); - case 286 /* JsxSelfClosingElement */: - return emitJsxSelfClosingElement(node); - case 289 /* JsxFragment */: - return emitJsxFragment(node); - // Synthesized list - case 353 /* SyntaxList */: - return Debug.fail("SyntaxList should not be printed"); - // Transformation nodes - case 354 /* NotEmittedStatement */: - return; - case 356 /* PartiallyEmittedExpression */: - return emitPartiallyEmittedExpression(node); - case 357 /* CommaListExpression */: - return emitCommaList(node); - case 358 /* SyntheticReferenceExpression */: - return Debug.fail("SyntheticReferenceExpression should not be printed"); - } - } - if (isKeyword(node.kind)) return writeTokenNode(node, writeKeyword); - if (isTokenKind(node.kind)) return writeTokenNode(node, writePunctuation); - Debug.fail(`Unhandled SyntaxKind: ${Debug.formatSyntaxKind(node.kind)}.`); - } - function emitMappedTypeParameter(node) { - emit(node.name); - writeSpace(); - writeKeyword("in"); - writeSpace(); - emit(node.constraint); - } - function pipelineEmitWithSubstitution(hint, node) { - const pipelinePhase = getNextPipelinePhase(1 /* Substitution */, hint, node); - Debug.assertIsDefined(lastSubstitution); - node = lastSubstitution; - lastSubstitution = void 0; - pipelinePhase(hint, node); - } - function emitHelpers(node) { - let helpersEmitted = false; - const bundle = node.kind === 309 /* Bundle */ ? node : void 0; - if (bundle && moduleKind === 0 /* None */) { - return; - } - const numNodes = bundle ? bundle.sourceFiles.length : 1; - for (let i = 0; i < numNodes; i++) { - const currentNode = bundle ? bundle.sourceFiles[i] : node; - const sourceFile = isSourceFile(currentNode) ? currentNode : currentSourceFile; - const shouldSkip = printerOptions.noEmitHelpers || !!sourceFile && hasRecordedExternalHelpers(sourceFile); - const shouldBundle = isSourceFile(currentNode) && !isOwnFileEmit; - const helpers = getSortedEmitHelpers(currentNode); - if (helpers) { - for (const helper of helpers) { - if (!helper.scoped) { - if (shouldSkip) continue; - if (shouldBundle) { - if (bundledHelpers.get(helper.name)) { - continue; - } - bundledHelpers.set(helper.name, true); - } - } else if (bundle) { - continue; - } - if (typeof helper.text === "string") { - writeLines(helper.text); - } else { - writeLines(helper.text(makeFileLevelOptimisticUniqueName)); - } - helpersEmitted = true; - } - } - } - return helpersEmitted; - } - function getSortedEmitHelpers(node) { - const helpers = getEmitHelpers(node); - return helpers && toSorted(helpers, compareEmitHelpers); - } - function emitNumericOrBigIntLiteral(node) { - emitLiteral( - node, - /*jsxAttributeEscape*/ - false - ); - } - function emitLiteral(node, jsxAttributeEscape) { - const text = getLiteralTextOfNode( - node, - /*sourceFile*/ - void 0, - printerOptions.neverAsciiEscape, - jsxAttributeEscape - ); - if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind))) { - writeLiteral(text); - } else { - writeStringLiteral(text); - } - } - function emitSnippetNode(hint, node, snippet) { - switch (snippet.kind) { - case 1 /* Placeholder */: - emitPlaceholder(hint, node, snippet); - break; - case 0 /* TabStop */: - emitTabStop(hint, node, snippet); - break; - } - } - function emitPlaceholder(hint, node, snippet) { - nonEscapingWrite(`\${${snippet.order}:`); - pipelineEmitWithHintWorker( - hint, - node, - /*allowSnippets*/ - false - ); - nonEscapingWrite(`}`); - } - function emitTabStop(hint, node, snippet) { - Debug.assert(node.kind === 243 /* 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) { - const writeText = node.symbol ? writeSymbol : write; - writeText(getTextOfNode2( - node, - /*includeTrivia*/ - false - ), node.symbol); - emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */); - } - function emitPrivateIdentifier(node) { - write(getTextOfNode2( - node, - /*includeTrivia*/ - false - )); - } - function emitQualifiedName(node) { - emitEntityName(node.left); - writePunctuation("."); - emit(node.right); - } - function emitEntityName(node) { - if (node.kind === 80 /* Identifier */) { - emitExpression(node); - } else { - emit(node); - } - } - function emitComputedPropertyName(node) { - writePunctuation("["); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName); - writePunctuation("]"); - } - function emitTypeParameter(node) { - emitModifierList(node, node.modifiers); - emit(node.name); - if (node.constraint) { - writeSpace(); - writeKeyword("extends"); - writeSpace(); - emit(node.constraint); - } - if (node.default) { - writeSpace(); - writeOperator("="); - writeSpace(); - emit(node.default); - } - } - function emitParameter(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emit(node.dotDotDotToken); - emitNodeWithWriter(node.name, writeParameter); - emit(node.questionToken); - if (node.parent && node.parent.kind === 318 /* JSDocFunctionType */ && !node.name) { - emit(node.type); - } else { - emitTypeAnnotation(node.type); - } - emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.pos, node, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitDecorator(decorator) { - writePunctuation("@"); - emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); - } - function emitPropertySignature(node) { - emitModifierList(node, node.modifiers); - emitNodeWithWriter(node.name, writeProperty); - emit(node.questionToken); - emitTypeAnnotation(node.type); - writeTrailingSemicolon(); - } - function emitPropertyDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emit(node.name); - emit(node.questionToken); - emit(node.exclamationToken); - emitTypeAnnotation(node.type); - emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); - writeTrailingSemicolon(); - } - function emitMethodSignature(node) { - emitModifierList(node, node.modifiers); - emit(node.name); - emit(node.questionToken); - emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody); - } - function emitMethodDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emit(node.asteriskToken); - emit(node.name); - emit(node.questionToken); - emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody); - } - function emitClassStaticBlockDeclaration(node) { - writeKeyword("static"); - pushNameGenerationScope(node); - emitBlockFunctionBody(node.body); - popNameGenerationScope(node); - } - function emitConstructor(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("constructor"); - emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody); - } - function emitAccessorDeclaration(node) { - const pos = emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - const token = node.kind === 178 /* GetAccessor */ ? 139 /* GetKeyword */ : 153 /* SetKeyword */; - emitTokenWithComment(token, pos, writeKeyword, node); - writeSpace(); - emit(node.name); - emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody); - } - function emitCallSignature(node) { - emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody); - } - function emitConstructSignature(node) { - writeKeyword("new"); - writeSpace(); - emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody); - } - function emitIndexSignature(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emitParametersForIndexSignature(node, node.parameters); - emitTypeAnnotation(node.type); - writeTrailingSemicolon(); - } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } - function emitSemicolonClassElement() { - writeTrailingSemicolon(); - } - function emitTypePredicate(node) { - if (node.assertsModifier) { - emit(node.assertsModifier); - writeSpace(); - } - emit(node.parameterName); - if (node.type) { - writeSpace(); - writeKeyword("is"); - writeSpace(); - emit(node.type); - } - } - function emitTypeReference(node) { - emit(node.typeName); - emitTypeArguments(node, node.typeArguments); - } - function emitFunctionType(node) { - emitSignatureAndBody(node, emitFunctionTypeHead, emitFunctionTypeBody); - } - function emitFunctionTypeHead(node) { - emitTypeParameters(node, node.typeParameters); - emitParametersForArrow(node, node.parameters); - writeSpace(); - writePunctuation("=>"); - } - function emitFunctionTypeBody(node) { - writeSpace(); - emit(node.type); - } - function emitJSDocFunctionType(node) { - writeKeyword("function"); - emitParameters(node, node.parameters); - writePunctuation(":"); - emit(node.type); - } - function emitJSDocNullableType(node) { - writePunctuation("?"); - emit(node.type); - } - function emitJSDocNonNullableType(node) { - writePunctuation("!"); - emit(node.type); - } - function emitJSDocOptionalType(node) { - emit(node.type); - writePunctuation("="); - } - function emitConstructorType(node) { - emitModifierList(node, node.modifiers); - writeKeyword("new"); - writeSpace(); - emitSignatureAndBody(node, emitFunctionTypeHead, emitFunctionTypeBody); - } - function emitTypeQuery(node) { - writeKeyword("typeof"); - writeSpace(); - emit(node.exprName); - emitTypeArguments(node, node.typeArguments); - } - function emitTypeLiteral(node) { - pushNameGenerationScope(node); - forEach(node.members, generateMemberNames); - writePunctuation("{"); - const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */; - emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */); - writePunctuation("}"); - popNameGenerationScope(node); - } - function emitArrayType(node) { - emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); - writePunctuation("["); - writePunctuation("]"); - } - function emitRestOrJSDocVariadicType(node) { - writePunctuation("..."); - emit(node.type); - } - function emitTupleType(node) { - emitTokenWithComment(23 /* OpenBracketToken */, node.pos, writePunctuation, node); - const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 528 /* SingleLineTupleTypeElements */ : 657 /* MultiLineTupleTypeElements */; - emitList(node, node.elements, flags | 524288 /* NoSpaceIfEmpty */, parenthesizer.parenthesizeElementTypeOfTupleType); - emitTokenWithComment(24 /* CloseBracketToken */, node.elements.end, writePunctuation, node); - } - function emitNamedTupleMember(node) { - emit(node.dotDotDotToken); - emit(node.name); - emit(node.questionToken); - emitTokenWithComment(59 /* ColonToken */, node.name.end, writePunctuation, node); - writeSpace(); - emit(node.type); - } - function emitOptionalType(node) { - emit(node.type, parenthesizer.parenthesizeTypeOfOptionalType); - writePunctuation("?"); - } - function emitUnionType(node) { - emitList(node, node.types, 516 /* UnionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfUnionType); - } - function emitIntersectionType(node) { - emitList(node, node.types, 520 /* IntersectionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfIntersectionType); - } - function emitConditionalType(node) { - emit(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType); - writeSpace(); - writeKeyword("extends"); - writeSpace(); - emit(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType); - writeSpace(); - writePunctuation("?"); - writeSpace(); - emit(node.trueType); - writeSpace(); - writePunctuation(":"); - writeSpace(); - emit(node.falseType); - } - function emitInferType(node) { - writeKeyword("infer"); - writeSpace(); - emit(node.typeParameter); - } - function emitParenthesizedType(node) { - writePunctuation("("); - emit(node.type); - writePunctuation(")"); - } - function emitThisType() { - writeKeyword("this"); - } - function emitTypeOperator(node) { - writeTokenText(node.operator, writeKeyword); - writeSpace(); - const parenthesizerRule = node.operator === 148 /* ReadonlyKeyword */ ? parenthesizer.parenthesizeOperandOfReadonlyTypeOperator : parenthesizer.parenthesizeOperandOfTypeOperator; - emit(node.type, parenthesizerRule); - } - function emitIndexedAccessType(node) { - emit(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); - writePunctuation("["); - emit(node.indexType); - writePunctuation("]"); - } - function emitMappedType(node) { - const emitFlags = getEmitFlags(node); - writePunctuation("{"); - if (emitFlags & 1 /* SingleLine */) { - writeSpace(); - } else { - writeLine(); - increaseIndent(); - } - if (node.readonlyToken) { - emit(node.readonlyToken); - if (node.readonlyToken.kind !== 148 /* ReadonlyKeyword */) { - writeKeyword("readonly"); - } - writeSpace(); - } - writePunctuation("["); - pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } - writePunctuation("]"); - if (node.questionToken) { - emit(node.questionToken); - if (node.questionToken.kind !== 58 /* QuestionToken */) { - writePunctuation("?"); - } - } - writePunctuation(":"); - writeSpace(); - emit(node.type); - writeTrailingSemicolon(); - if (emitFlags & 1 /* SingleLine */) { - writeSpace(); - } else { - writeLine(); - decreaseIndent(); - } - emitList(node, node.members, 2 /* PreserveLines */); - writePunctuation("}"); - } - function emitLiteralType(node) { - emitExpression(node.literal); - } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } - function emitImportTypeNode(node) { - if (node.isTypeOf) { - writeKeyword("typeof"); - writeSpace(); - } - writeKeyword("import"); - writePunctuation("("); - emit(node.argument); - if (node.attributes) { - writePunctuation(","); - writeSpace(); - pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes); - } - writePunctuation(")"); - if (node.qualifier) { - writePunctuation("."); - emit(node.qualifier); - } - emitTypeArguments(node, node.typeArguments); - } - function emitObjectBindingPattern(node) { - writePunctuation("{"); - emitList(node, node.elements, 525136 /* ObjectBindingPatternElements */); - writePunctuation("}"); - } - function emitArrayBindingPattern(node) { - writePunctuation("["); - emitList(node, node.elements, 524880 /* ArrayBindingPatternElements */); - writePunctuation("]"); - } - function emitBindingElement(node) { - emit(node.dotDotDotToken); - if (node.propertyName) { - emit(node.propertyName); - writePunctuation(":"); - writeSpace(); - } - emit(node.name); - emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitArrayLiteralExpression(node) { - const elements = node.elements; - const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; - emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitObjectLiteralExpression(node) { - pushNameGenerationScope(node); - forEach(node.properties, generateMemberNames); - const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; - if (indentedFlag) { - increaseIndent(); - } - const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; - const allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= 1 /* ES5 */ && !isJsonSourceFile(currentSourceFile) ? 64 /* AllowTrailingComma */ : 0 /* None */; - emitList(node, node.properties, 526226 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine); - if (indentedFlag) { - decreaseIndent(); - } - popNameGenerationScope(node); - } - function emitPropertyAccessExpression(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - const token = node.questionDotToken || setTextRangePosEnd(factory.createToken(25 /* DotToken */), node.expression.end, node.name.pos); - const linesBeforeDot = getLinesBetweenNodes(node, node.expression, token); - const linesAfterDot = getLinesBetweenNodes(node, token, node.name); - writeLinesAndIndent( - linesBeforeDot, - /*writeSpaceIfNotIndenting*/ - false - ); - const shouldEmitDotDot = token.kind !== 29 /* QuestionDotToken */ && mayNeedDotDotForPropertyAccess(node.expression) && !writer.hasTrailingComment() && !writer.hasTrailingWhitespace(); - if (shouldEmitDotDot) { - writePunctuation("."); - } - if (node.questionDotToken) { - emit(token); - } else { - emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); - } - writeLinesAndIndent( - linesAfterDot, - /*writeSpaceIfNotIndenting*/ - false - ); - emit(node.name); - decreaseIndentIf(linesBeforeDot, linesAfterDot); - } - function mayNeedDotDotForPropertyAccess(expression) { - expression = skipPartiallyEmittedExpressions(expression); - if (isNumericLiteral(expression)) { - const text = getLiteralTextOfNode( - expression, - /*sourceFile*/ - void 0, - /*neverAsciiEscape*/ - true, - /*jsxAttributeEscape*/ - false - ); - 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) && constantValue >= 0 && Math.floor(constantValue) === constantValue; - } - } - function emitElementAccessExpression(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - emit(node.questionDotToken); - emitTokenWithComment(23 /* OpenBracketToken */, node.expression.end, writePunctuation, node); - emitExpression(node.argumentExpression); - emitTokenWithComment(24 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); - } - function emitCallExpression(node) { - const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; - if (indirectCall) { - writePunctuation("("); - writeLiteral("0"); - writePunctuation(","); - writeSpace(); - } - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - if (indirectCall) { - writePunctuation(")"); - } - emit(node.questionDotToken); - emitTypeArguments(node, node.typeArguments); - emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitNewExpression(node) { - emitTokenWithComment(105 /* NewKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfNew); - emitTypeArguments(node, node.typeArguments); - emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitTaggedTemplateExpression(node) { - const indirectCall = getInternalEmitFlags(node) & 16 /* IndirectCall */; - if (indirectCall) { - writePunctuation("("); - writeLiteral("0"); - writePunctuation(","); - writeSpace(); - } - emitExpression(node.tag, parenthesizer.parenthesizeLeftSideOfAccess); - if (indirectCall) { - writePunctuation(")"); - } - emitTypeArguments(node, node.typeArguments); - writeSpace(); - emitExpression(node.template); - } - function emitTypeAssertionExpression(node) { - writePunctuation("<"); - emit(node.type); - writePunctuation(">"); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitParenthesizedExpression(node) { - const openParenPos = emitTokenWithComment(21 /* OpenParenToken */, node.pos, writePunctuation, node); - const indented = writeLineSeparatorsAndIndentBefore(node.expression, node); - emitExpression( - node.expression, - /*parenthesizerRule*/ - void 0 - ); - writeLineSeparatorsAfter(node.expression, node); - decreaseIndentIf(indented); - emitTokenWithComment(22 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node); - } - function emitFunctionExpression(node) { - generateNameIfNeeded(node.name); - emitFunctionDeclarationOrExpression(node); - } - function emitArrowFunction(node) { - emitModifierList(node, node.modifiers); - emitSignatureAndBody(node, emitArrowFunctionHead, emitArrowFunctionBody); - } - function emitArrowFunctionHead(node) { - emitTypeParameters(node, node.typeParameters); - emitParametersForArrow(node, node.parameters); - emitTypeAnnotation(node.type); - writeSpace(); - emit(node.equalsGreaterThanToken); - } - function emitArrowFunctionBody(node) { - if (isBlock(node.body)) { - emitBlockFunctionBody(node.body); - } else { - writeSpace(); - emitExpression(node.body, parenthesizer.parenthesizeConciseBodyOfArrowFunction); - } - } - function emitDeleteExpression(node) { - emitTokenWithComment(91 /* DeleteKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitTypeOfExpression(node) { - emitTokenWithComment(114 /* TypeOfKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitVoidExpression(node) { - emitTokenWithComment(116 /* VoidKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitAwaitExpression(node) { - emitTokenWithComment(135 /* AwaitKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function emitPrefixUnaryExpression(node) { - writeTokenText(node.operator, writeOperator); - if (shouldEmitWhitespaceBeforeOperand(node)) { - writeSpace(); - } - emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPrefixUnary); - } - function shouldEmitWhitespaceBeforeOperand(node) { - const operand = node.operand; - return operand.kind === 225 /* 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); - writeTokenText(node.operator, writeOperator); - } - function createEmitBinaryExpression() { - return createBinaryExpressionTrampoline( - onEnter, - onLeft, - onOperator, - onRight, - onExit, - /*foldState*/ - void 0 - ); - function onEnter(node, state) { - if (state) { - state.stackIndex++; - state.preserveSourceNewlinesStack[state.stackIndex] = preserveSourceNewlines; - state.containerPosStack[state.stackIndex] = containerPos; - state.containerEndStack[state.stackIndex] = containerEnd; - state.declarationListContainerEndStack[state.stackIndex] = declarationListContainerEnd; - const emitComments2 = state.shouldEmitCommentsStack[state.stackIndex] = shouldEmitComments(node); - const emitSourceMaps = state.shouldEmitSourceMapsStack[state.stackIndex] = shouldEmitSourceMaps(node); - onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); - if (emitComments2) emitCommentsBeforeNode(node); - if (emitSourceMaps) emitSourceMapsBeforeNode(node); - beforeEmitNode(node); - } else { - state = { - stackIndex: 0, - preserveSourceNewlinesStack: [void 0], - containerPosStack: [-1], - containerEndStack: [-1], - declarationListContainerEndStack: [-1], - shouldEmitCommentsStack: [false], - shouldEmitSourceMapsStack: [false] - }; - } - return state; - } - function onLeft(next, _workArea, parent2) { - return maybeEmitExpression(next, parent2, "left"); - } - function onOperator(operatorToken, _state, node) { - const isCommaOperator = operatorToken.kind !== 28 /* CommaToken */; - const linesBeforeOperator = getLinesBetweenNodes(node, node.left, operatorToken); - const linesAfterOperator = getLinesBetweenNodes(node, operatorToken, node.right); - writeLinesAndIndent(linesBeforeOperator, isCommaOperator); - emitLeadingCommentsOfPosition(operatorToken.pos); - writeTokenNode(operatorToken, operatorToken.kind === 103 /* InKeyword */ ? writeKeyword : writeOperator); - emitTrailingCommentsOfPosition( - operatorToken.end, - /*prefixSpace*/ - true - ); - writeLinesAndIndent( - linesAfterOperator, - /*writeSpaceIfNotIndenting*/ - true - ); - } - function onRight(next, _workArea, parent2) { - return maybeEmitExpression(next, parent2, "right"); - } - function onExit(node, state) { - const linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken); - const linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right); - decreaseIndentIf(linesBeforeOperator, linesAfterOperator); - if (state.stackIndex > 0) { - const savedPreserveSourceNewlines = state.preserveSourceNewlinesStack[state.stackIndex]; - const savedContainerPos = state.containerPosStack[state.stackIndex]; - const savedContainerEnd = state.containerEndStack[state.stackIndex]; - const savedDeclarationListContainerEnd = state.declarationListContainerEndStack[state.stackIndex]; - const shouldEmitComments2 = state.shouldEmitCommentsStack[state.stackIndex]; - const shouldEmitSourceMaps2 = state.shouldEmitSourceMapsStack[state.stackIndex]; - afterEmitNode(savedPreserveSourceNewlines); - if (shouldEmitSourceMaps2) emitSourceMapsAfterNode(node); - if (shouldEmitComments2) emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); - state.stackIndex--; - } - } - function maybeEmitExpression(next, parent2, side) { - const parenthesizerRule = side === "left" ? parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent2.operatorToken.kind) : parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent2.operatorToken.kind); - let pipelinePhase = getPipelinePhase(0 /* Notification */, 1 /* Expression */, next); - if (pipelinePhase === pipelineEmitWithSubstitution) { - Debug.assertIsDefined(lastSubstitution); - next = parenthesizerRule(cast(lastSubstitution, isExpression)); - pipelinePhase = getNextPipelinePhase(1 /* Substitution */, 1 /* Expression */, next); - lastSubstitution = void 0; - } - if (pipelinePhase === pipelineEmitWithComments || pipelinePhase === pipelineEmitWithSourceMaps || pipelinePhase === pipelineEmitWithHint) { - if (isBinaryExpression(next)) { - return next; - } - } - currentParenthesizerRule = parenthesizerRule; - pipelinePhase(1 /* Expression */, next); - } - } - function emitConditionalExpression(node) { - const linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken); - const linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue); - const linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken); - const linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse); - emitExpression(node.condition, parenthesizer.parenthesizeConditionOfConditionalExpression); - writeLinesAndIndent( - linesBeforeQuestion, - /*writeSpaceIfNotIndenting*/ - true - ); - emit(node.questionToken); - writeLinesAndIndent( - linesAfterQuestion, - /*writeSpaceIfNotIndenting*/ - true - ); - emitExpression(node.whenTrue, parenthesizer.parenthesizeBranchOfConditionalExpression); - decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion); - writeLinesAndIndent( - linesBeforeColon, - /*writeSpaceIfNotIndenting*/ - true - ); - emit(node.colonToken); - writeLinesAndIndent( - linesAfterColon, - /*writeSpaceIfNotIndenting*/ - true - ); - emitExpression(node.whenFalse, parenthesizer.parenthesizeBranchOfConditionalExpression); - decreaseIndentIf(linesBeforeColon, linesAfterColon); - } - function emitTemplateExpression(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } - function emitYieldExpression(node) { - emitTokenWithComment(127 /* YieldKeyword */, node.pos, writeKeyword, node); - emit(node.asteriskToken); - emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma); - } - function emitSpreadElement(node) { - emitTokenWithComment(26 /* DotDotDotToken */, node.pos, writePunctuation, node); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitClassExpression(node) { - generateNameIfNeeded(node.name); - emitClassDeclarationOrExpression(node); - } - function emitExpressionWithTypeArguments(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - emitTypeArguments(node, node.typeArguments); - } - function emitAsExpression(node) { - emitExpression( - node.expression, - /*parenthesizerRule*/ - void 0 - ); - if (node.type) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.type); - } - } - function emitNonNullExpression(node) { - emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); - writeOperator("!"); - } - function emitSatisfiesExpression(node) { - emitExpression( - node.expression, - /*parenthesizerRule*/ - void 0 - ); - if (node.type) { - writeSpace(); - writeKeyword("satisfies"); - writeSpace(); - emit(node.type); - } - } - function emitMetaProperty(node) { - writeToken(node.keywordToken, node.pos, writePunctuation); - writePunctuation("."); - emit(node.name); - } - function emitTemplateSpan(node) { - emitExpression(node.expression); - emit(node.literal); - } - function emitBlock(node) { - emitBlockStatements( - node, - /*forceSingleLine*/ - !node.multiLine && isEmptyBlock(node) - ); - } - function emitBlockStatements(node, forceSingleLine) { - emitTokenWithComment( - 19 /* OpenBraceToken */, - node.pos, - writePunctuation, - /*contextNode*/ - node - ); - const format = forceSingleLine || getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineBlockStatements */ : 129 /* MultiLineBlockStatements */; - emitList(node, node.statements, format); - emitTokenWithComment( - 20 /* CloseBraceToken */, - node.statements.end, - writePunctuation, - /*contextNode*/ - node, - /*indentLeading*/ - !!(format & 1 /* MultiLine */) - ); - } - function emitVariableStatement(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emit(node.declarationList); - writeTrailingSemicolon(); - } - function emitEmptyStatement(isEmbeddedStatement) { - if (isEmbeddedStatement) { - writePunctuation(";"); - } else { - writeTrailingSemicolon(); - } - } - function emitExpressionStatement(node) { - emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement); - if (!currentSourceFile || !isJsonSourceFile(currentSourceFile) || nodeIsSynthesized(node.expression)) { - writeTrailingSemicolon(); - } - } - function emitIfStatement(node) { - const openParenPos = emitTokenWithComment(101 /* IfKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(22 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.thenStatement); - if (node.elseStatement) { - writeLineOrSpace(node, node.thenStatement, node.elseStatement); - emitTokenWithComment(93 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 246 /* IfStatement */) { - writeSpace(); - emit(node.elseStatement); - } else { - emitEmbeddedStatement(node, node.elseStatement); - } - } - } - function emitWhileClause(node, startPos) { - const openParenPos = emitTokenWithComment(117 /* WhileKeyword */, startPos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(22 /* CloseParenToken */, node.expression.end, writePunctuation, node); - } - function emitDoStatement(node) { - emitTokenWithComment(92 /* DoKeyword */, node.pos, writeKeyword, node); - emitEmbeddedStatement(node, node.statement); - if (isBlock(node.statement) && !preserveSourceNewlines) { - writeSpace(); - } else { - writeLineOrSpace(node, node.statement, node.expression); - } - emitWhileClause(node, node.statement.end); - writeTrailingSemicolon(); - } - function emitWhileStatement(node) { - emitWhileClause(node, node.pos); - emitEmbeddedStatement(node, node.statement); - } - function emitForStatement(node) { - const openParenPos = emitTokenWithComment(99 /* ForKeyword */, node.pos, writeKeyword, node); - writeSpace(); - let pos = emitTokenWithComment( - 21 /* OpenParenToken */, - openParenPos, - writePunctuation, - /*contextNode*/ - node - ); - emitForBinding(node.initializer); - pos = emitTokenWithComment(27 /* SemicolonToken */, node.initializer ? node.initializer.end : pos, writePunctuation, node); - emitExpressionWithLeadingSpace(node.condition); - pos = emitTokenWithComment(27 /* SemicolonToken */, node.condition ? node.condition.end : pos, writePunctuation, node); - emitExpressionWithLeadingSpace(node.incrementor); - emitTokenWithComment(22 /* CloseParenToken */, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitForInStatement(node) { - const openParenPos = emitTokenWithComment(99 /* ForKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitForBinding(node.initializer); - writeSpace(); - emitTokenWithComment(103 /* InKeyword */, node.initializer.end, writeKeyword, node); - writeSpace(); - emitExpression(node.expression); - emitTokenWithComment(22 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitForOfStatement(node) { - const openParenPos = emitTokenWithComment(99 /* ForKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitWithTrailingSpace(node.awaitModifier); - emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitForBinding(node.initializer); - writeSpace(); - emitTokenWithComment(165 /* OfKeyword */, node.initializer.end, writeKeyword, node); - writeSpace(); - emitExpression(node.expression); - emitTokenWithComment(22 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitForBinding(node) { - if (node !== void 0) { - if (node.kind === 262 /* VariableDeclarationList */) { - emit(node); - } else { - emitExpression(node); - } - } - } - function emitContinueStatement(node) { - emitTokenWithComment(88 /* ContinueKeyword */, node.pos, writeKeyword, node); - emitWithLeadingSpace(node.label); - writeTrailingSemicolon(); - } - function emitBreakStatement(node) { - emitTokenWithComment(83 /* BreakKeyword */, node.pos, writeKeyword, node); - emitWithLeadingSpace(node.label); - writeTrailingSemicolon(); - } - function emitTokenWithComment(token, pos, writer2, contextNode, indentLeading) { - const node = getParseTreeNode(contextNode); - const isSimilarNode = node && node.kind === contextNode.kind; - const startPos = pos; - if (isSimilarNode && currentSourceFile) { - pos = skipTrivia(currentSourceFile.text, pos); - } - if (isSimilarNode && contextNode.pos !== startPos) { - const needsIndent = indentLeading && currentSourceFile && !positionsAreOnSameLine(startPos, pos, currentSourceFile); - if (needsIndent) { - increaseIndent(); - } - emitLeadingCommentsOfPosition(startPos); - if (needsIndent) { - decreaseIndent(); - } - } - 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 === 295 /* JsxExpression */; - emitTrailingCommentsOfPosition( - pos, - /*prefixSpace*/ - !isJsxExprContext, - /*forceNoNewline*/ - isJsxExprContext - ); - } - return pos; - } - function commentWillEmitNewLine(node) { - return node.kind === 2 /* SingleLineCommentTrivia */ || !!node.hasTrailingNewLine; - } - function willEmitLeadingNewLine(node) { - if (!currentSourceFile) return false; - 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; - if (isPartiallyEmittedExpression(node)) { - if (node.pos !== node.expression.pos) { - if (some(getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine)) return true; - } - return willEmitLeadingNewLine(node.expression); - } - return false; - } - function parenthesizeExpressionForNoAsi(node) { - if (!commentsDisabled) { - switch (node.kind) { - case 356 /* PartiallyEmittedExpression */: - if (willEmitLeadingNewLine(node)) { - const parseNode = getParseTreeNode(node); - if (parseNode && isParenthesizedExpression(parseNode)) { - const parens = factory.createParenthesizedExpression(node.expression); - setOriginalNode(parens, node); - setTextRange(parens, parseNode); - return parens; - } - return factory.createParenthesizedExpression(node); - } - return factory.updatePartiallyEmittedExpression( - node, - parenthesizeExpressionForNoAsi(node.expression) - ); - case 212 /* PropertyAccessExpression */: - return factory.updatePropertyAccessExpression( - node, - parenthesizeExpressionForNoAsi(node.expression), - node.name - ); - case 213 /* ElementAccessExpression */: - return factory.updateElementAccessExpression( - node, - parenthesizeExpressionForNoAsi(node.expression), - node.argumentExpression - ); - case 214 /* CallExpression */: - return factory.updateCallExpression( - node, - parenthesizeExpressionForNoAsi(node.expression), - node.typeArguments, - node.arguments - ); - case 216 /* TaggedTemplateExpression */: - return factory.updateTaggedTemplateExpression( - node, - parenthesizeExpressionForNoAsi(node.tag), - node.typeArguments, - node.template - ); - case 226 /* PostfixUnaryExpression */: - return factory.updatePostfixUnaryExpression( - node, - parenthesizeExpressionForNoAsi(node.operand) - ); - case 227 /* BinaryExpression */: - return factory.updateBinaryExpression( - node, - parenthesizeExpressionForNoAsi(node.left), - node.operatorToken, - node.right - ); - case 228 /* ConditionalExpression */: - return factory.updateConditionalExpression( - node, - parenthesizeExpressionForNoAsi(node.condition), - node.questionToken, - node.whenTrue, - node.colonToken, - node.whenFalse - ); - case 235 /* AsExpression */: - return factory.updateAsExpression( - node, - parenthesizeExpressionForNoAsi(node.expression), - node.type - ); - case 239 /* SatisfiesExpression */: - return factory.updateSatisfiesExpression( - node, - parenthesizeExpressionForNoAsi(node.expression), - node.type - ); - case 236 /* NonNullExpression */: - return factory.updateNonNullExpression( - node, - parenthesizeExpressionForNoAsi(node.expression) - ); - } - } - return node; - } - function parenthesizeExpressionForNoAsiAndDisallowedComma(node) { - return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node)); - } - function emitReturnStatement(node) { - emitTokenWithComment( - 107 /* ReturnKeyword */, - node.pos, - writeKeyword, - /*contextNode*/ - node - ); - emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); - writeTrailingSemicolon(); - } - function emitWithStatement(node) { - const openParenPos = emitTokenWithComment(118 /* WithKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(22 /* CloseParenToken */, node.expression.end, writePunctuation, node); - emitEmbeddedStatement(node, node.statement); - } - function emitSwitchStatement(node) { - const openParenPos = emitTokenWithComment(109 /* SwitchKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); - emitExpression(node.expression); - emitTokenWithComment(22 /* CloseParenToken */, node.expression.end, writePunctuation, node); - writeSpace(); - emit(node.caseBlock); - } - function emitLabeledStatement(node) { - emit(node.label); - emitTokenWithComment(59 /* ColonToken */, node.label.end, writePunctuation, node); - writeSpace(); - emit(node.statement); - } - function emitThrowStatement(node) { - emitTokenWithComment(111 /* ThrowKeyword */, node.pos, writeKeyword, node); - emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); - writeTrailingSemicolon(); - } - function emitTryStatement(node) { - emitTokenWithComment(113 /* TryKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emit(node.tryBlock); - if (node.catchClause) { - writeLineOrSpace(node, node.tryBlock, node.catchClause); - emit(node.catchClause); - } - if (node.finallyBlock) { - writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock); - emitTokenWithComment(98 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); - writeSpace(); - emit(node.finallyBlock); - } - } - function emitDebuggerStatement(node) { - writeToken(89 /* DebuggerKeyword */, node.pos, writeKeyword); - writeTrailingSemicolon(); - } - function emitVariableDeclaration(node) { - var _a, _b, _c; - emit(node.name); - emit(node.exclamationToken); - emitTypeAnnotation(node.type); - 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) { - 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 */); - } - function emitFunctionDeclaration(node) { - emitFunctionDeclarationOrExpression(node); - } - function emitFunctionDeclarationOrExpression(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("function"); - emit(node.asteriskToken); - writeSpace(); - emitIdentifierName(node.name); - emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody); - } - function emitSignatureAndBody(node, emitSignatureHead2, emitBody) { - const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; - if (indentedFlag) { - increaseIndent(); - } - pushNameGenerationScope(node); - forEach(node.parameters, generateNames); - emitSignatureHead2(node); - emitBody(node); - popNameGenerationScope(node); - if (indentedFlag) { - decreaseIndent(); - } - } - function emitFunctionBody(node) { - const body = node.body; - if (body) { - emitBlockFunctionBody(body); - } else { - writeTrailingSemicolon(); - } - } - function emitEmptyFunctionBody(_node) { - writeTrailingSemicolon(); - } - function emitSignatureHead(node) { - emitTypeParameters(node, node.typeParameters); - emitParameters(node, node.parameters); - emitTypeAnnotation(node.type); - } - function shouldEmitBlockFunctionBodyOnSingleLine(body) { - if (getEmitFlags(body) & 1 /* SingleLine */) { - return true; - } - if (body.multiLine) { - return false; - } - if (!nodeIsSynthesized(body) && currentSourceFile && !rangeIsOnSingleLine(body, currentSourceFile)) { - return false; - } - if (getLeadingLineTerminatorCount(body, firstOrUndefined(body.statements), 2 /* PreserveLines */) || getClosingLineTerminatorCount(body, lastOrUndefined(body.statements), 2 /* PreserveLines */, body.statements)) { - return false; - } - let previousStatement; - for (const statement of body.statements) { - if (getSeparatingLineTerminatorCount(previousStatement, statement, 2 /* PreserveLines */) > 0) { - return false; - } - previousStatement = statement; - } - return true; - } - function emitBlockFunctionBody(body) { - generateNames(body); - onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(body); - writeSpace(); - writePunctuation("{"); - increaseIndent(); - const emitBlockFunctionBody2 = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine : emitBlockFunctionBodyWorker; - emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody2); - decreaseIndent(); - writeToken(20 /* CloseBraceToken */, body.statements.end, writePunctuation, body); - onAfterEmitNode == null ? void 0 : onAfterEmitNode(body); - } - function emitBlockFunctionBodyOnSingleLine(body) { - emitBlockFunctionBodyWorker( - body, - /*emitBlockFunctionBodyOnSingleLine*/ - true - ); - } - function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine2) { - const statementOffset = emitPrologueDirectives(body.statements); - const pos = writer.getTextPos(); - emitHelpers(body); - if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine2) { - decreaseIndent(); - emitList(body, body.statements, 768 /* SingleLineFunctionBodyStatements */); - increaseIndent(); - } else { - emitList( - body, - body.statements, - 1 /* MultiLineFunctionBodyStatements */, - /*parenthesizerRule*/ - void 0, - statementOffset - ); - } - } - function emitClassDeclaration(node) { - emitClassDeclarationOrExpression(node); - } - function emitClassDeclarationOrExpression(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - true - ); - emitTokenWithComment(86 /* ClassKeyword */, moveRangePastModifiers(node).pos, writeKeyword, node); - if (node.name) { - writeSpace(); - emitIdentifierName(node.name); - } - const indentedFlag = getEmitFlags(node) & 131072 /* Indented */; - if (indentedFlag) { - increaseIndent(); - } - emitTypeParameters(node, node.typeParameters); - emitList(node, node.heritageClauses, 0 /* ClassHeritageClauses */); - writeSpace(); - writePunctuation("{"); - pushNameGenerationScope(node); - forEach(node.members, generateMemberNames); - emitList(node, node.members, 129 /* ClassMembers */); - popNameGenerationScope(node); - writePunctuation("}"); - if (indentedFlag) { - decreaseIndent(); - } - } - function emitInterfaceDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("interface"); - writeSpace(); - emit(node.name); - emitTypeParameters(node, node.typeParameters); - emitList(node, node.heritageClauses, 512 /* HeritageClauses */); - writeSpace(); - writePunctuation("{"); - pushNameGenerationScope(node); - forEach(node.members, generateMemberNames); - emitList(node, node.members, 129 /* InterfaceMembers */); - popNameGenerationScope(node); - writePunctuation("}"); - } - function emitTypeAliasDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("type"); - writeSpace(); - emit(node.name); - emitTypeParameters(node, node.typeParameters); - writeSpace(); - writePunctuation("="); - writeSpace(); - emit(node.type); - writeTrailingSemicolon(); - } - function emitEnumDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - writeKeyword("enum"); - writeSpace(); - emit(node.name); - writeSpace(); - writePunctuation("{"); - emitList(node, node.members, 145 /* EnumMembers */); - writePunctuation("}"); - } - function emitModuleDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - if (~node.flags & 2048 /* GlobalAugmentation */) { - writeKeyword(node.flags & 32 /* Namespace */ ? "namespace" : "module"); - writeSpace(); - } - emit(node.name); - let body = node.body; - if (!body) return writeTrailingSemicolon(); - while (body && isModuleDeclaration(body)) { - writePunctuation("."); - emit(body.name); - body = body.body; - } - writeSpace(); - emit(body); - } - function emitModuleBlock(node) { - pushNameGenerationScope(node); - forEach(node.statements, generateNames); - emitBlockStatements( - node, - /*forceSingleLine*/ - isEmptyBlock(node) - ); - popNameGenerationScope(node); - } - function emitCaseBlock(node) { - emitTokenWithComment(19 /* OpenBraceToken */, node.pos, writePunctuation, node); - emitList(node, node.clauses, 129 /* CaseBlockClauses */); - emitTokenWithComment( - 20 /* CloseBraceToken */, - node.clauses.end, - writePunctuation, - node, - /*indentLeading*/ - true - ); - } - function emitImportEqualsDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emitTokenWithComment(102 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); - writeSpace(); - if (node.isTypeOnly) { - emitTokenWithComment(156 /* TypeKeyword */, node.pos, writeKeyword, node); - writeSpace(); - } - emit(node.name); - writeSpace(); - emitTokenWithComment(64 /* EqualsToken */, node.name.end, writePunctuation, node); - writeSpace(); - emitModuleReference(node.moduleReference); - writeTrailingSemicolon(); - } - function emitModuleReference(node) { - if (node.kind === 80 /* Identifier */) { - emitExpression(node); - } else { - emit(node); - } - } - function emitImportDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - emitTokenWithComment(102 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); - writeSpace(); - if (node.importClause) { - emit(node.importClause); - writeSpace(); - emitTokenWithComment(161 /* FromKeyword */, node.importClause.end, writeKeyword, node); - writeSpace(); - } - emitExpression(node.moduleSpecifier); - if (node.attributes) { - emitWithLeadingSpace(node.attributes); - } - writeTrailingSemicolon(); - } - function emitImportClause(node) { - if (node.phaseModifier !== void 0) { - emitTokenWithComment(node.phaseModifier, node.pos, writeKeyword, node); - writeSpace(); - } - emit(node.name); - if (node.name && node.namedBindings) { - emitTokenWithComment(28 /* CommaToken */, node.name.end, writePunctuation, node); - writeSpace(); - } - emit(node.namedBindings); - } - function emitNamespaceImport(node) { - const asPos = emitTokenWithComment(42 /* AsteriskToken */, node.pos, writePunctuation, node); - writeSpace(); - emitTokenWithComment(130 /* AsKeyword */, asPos, writeKeyword, node); - writeSpace(); - emit(node.name); - } - function emitNamedImports(node) { - emitNamedImportsOrExports(node); - } - function emitImportSpecifier(node) { - emitImportOrExportSpecifier(node); - } - function emitExportAssignment(node) { - const nextPos = emitTokenWithComment(95 /* ExportKeyword */, node.pos, writeKeyword, node); - writeSpace(); - if (node.isExportEquals) { - emitTokenWithComment(64 /* EqualsToken */, nextPos, writeOperator, node); - } else { - emitTokenWithComment(90 /* DefaultKeyword */, nextPos, writeKeyword, node); - } - writeSpace(); - emitExpression( - node.expression, - node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(64 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault - ); - writeTrailingSemicolon(); - } - function emitExportDeclaration(node) { - emitDecoratorsAndModifiers( - node, - node.modifiers, - /*allowDecorators*/ - false - ); - let nextPos = emitTokenWithComment(95 /* ExportKeyword */, node.pos, writeKeyword, node); - writeSpace(); - if (node.isTypeOnly) { - nextPos = emitTokenWithComment(156 /* TypeKeyword */, nextPos, writeKeyword, node); - writeSpace(); - } - if (node.exportClause) { - emit(node.exportClause); - } else { - nextPos = emitTokenWithComment(42 /* AsteriskToken */, nextPos, writePunctuation, node); - } - if (node.moduleSpecifier) { - writeSpace(); - const fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(161 /* FromKeyword */, fromPos, writeKeyword, node); - writeSpace(); - emitExpression(node.moduleSpecifier); - } - if (node.attributes) { - emitWithLeadingSpace(node.attributes); - } - writeTrailingSemicolon(); - } - function emitImportTypeNodeAttributes(node) { - writePunctuation("{"); - writeSpace(); - writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with"); - writePunctuation(":"); - writeSpace(); - const elements = node.elements; - emitList(node, elements, 526226 /* ImportAttributes */); - writeSpace(); - writePunctuation("}"); - } - function emitImportAttributes(node) { - emitTokenWithComment(node.token, node.pos, writeKeyword, node); - writeSpace(); - const elements = node.elements; - emitList(node, elements, 526226 /* ImportAttributes */); - } - function emitImportAttribute(node) { - emit(node.name); - writePunctuation(":"); - writeSpace(); - const value = node.value; - if ((getEmitFlags(value) & 1024 /* NoLeadingComments */) === 0) { - const commentRange = getCommentRange(value); - emitTrailingCommentsOfPosition(commentRange.pos); - } - emit(value); - } - function emitNamespaceExportDeclaration(node) { - let nextPos = emitTokenWithComment(95 /* ExportKeyword */, node.pos, writeKeyword, node); - writeSpace(); - nextPos = emitTokenWithComment(130 /* AsKeyword */, nextPos, writeKeyword, node); - writeSpace(); - nextPos = emitTokenWithComment(145 /* NamespaceKeyword */, nextPos, writeKeyword, node); - writeSpace(); - emit(node.name); - writeTrailingSemicolon(); - } - function emitNamespaceExport(node) { - const asPos = emitTokenWithComment(42 /* AsteriskToken */, node.pos, writePunctuation, node); - writeSpace(); - emitTokenWithComment(130 /* AsKeyword */, asPos, writeKeyword, node); - writeSpace(); - emit(node.name); - } - function emitNamedExports(node) { - emitNamedImportsOrExports(node); - } - function emitExportSpecifier(node) { - emitImportOrExportSpecifier(node); - } - function emitNamedImportsOrExports(node) { - writePunctuation("{"); - emitList(node, node.elements, 525136 /* NamedImportsOrExportsElements */); - writePunctuation("}"); - } - function emitImportOrExportSpecifier(node) { - if (node.isTypeOnly) { - writeKeyword("type"); - writeSpace(); - } - if (node.propertyName) { - emit(node.propertyName); - writeSpace(); - emitTokenWithComment(130 /* AsKeyword */, node.propertyName.end, writeKeyword, node); - writeSpace(); - } - emit(node.name); - } - function emitExternalModuleReference(node) { - writeKeyword("require"); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(")"); - } - function emitJsxElement(node) { - emit(node.openingElement); - emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); - emit(node.closingElement); - } - function emitJsxSelfClosingElement(node) { - writePunctuation("<"); - emitJsxTagName(node.tagName); - emitTypeArguments(node, node.typeArguments); - writeSpace(); - emit(node.attributes); - writePunctuation("/>"); - } - function emitJsxFragment(node) { - emit(node.openingFragment); - emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); - emit(node.closingFragment); - } - function emitJsxOpeningElementOrFragment(node) { - writePunctuation("<"); - if (isJsxOpeningElement(node)) { - const indented = writeLineSeparatorsAndIndentBefore(node.tagName, node); - emitJsxTagName(node.tagName); - emitTypeArguments(node, node.typeArguments); - if (node.attributes.properties && node.attributes.properties.length > 0) { - writeSpace(); - } - emit(node.attributes); - writeLineSeparatorsAfter(node.attributes, node); - decreaseIndentIf(indented); - } - writePunctuation(">"); - } - function emitJsxText(node) { - writer.writeLiteral(node.text); - } - function emitJsxClosingElementOrFragment(node) { - writePunctuation(""); - } - function emitJsxAttributes(node) { - emitList(node, node.properties, 262656 /* JsxElementAttributes */); - } - function emitJsxAttribute(node) { - emit(node.name); - emitNodeWithPrefix("=", writePunctuation, node.initializer, emitJsxAttributeValue); - } - function emitJsxSpreadAttribute(node) { - writePunctuation("{..."); - emitExpression(node.expression); - writePunctuation("}"); - } - function hasTrailingCommentsAtPosition(pos) { - let result = false; - forEachTrailingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); - return result; - } - function hasLeadingCommentsAtPosition(pos) { - let result = false; - forEachLeadingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); - return result; - } - function hasCommentsAtPosition(pos) { - return hasTrailingCommentsAtPosition(pos) || hasLeadingCommentsAtPosition(pos); - } - function emitJsxExpression(node) { - var _a; - if (node.expression || !commentsDisabled && !nodeIsSynthesized(node) && hasCommentsAtPosition(node.pos)) { - const isMultiline = currentSourceFile && !nodeIsSynthesized(node) && getLineAndCharacterOfPosition(currentSourceFile, node.pos).line !== getLineAndCharacterOfPosition(currentSourceFile, node.end).line; - if (isMultiline) { - writer.increaseIndent(); - } - const end = emitTokenWithComment(19 /* OpenBraceToken */, node.pos, writePunctuation, node); - emit(node.dotDotDotToken); - emitExpression(node.expression); - emitTokenWithComment(20 /* CloseBraceToken */, ((_a = node.expression) == null ? void 0 : _a.end) || end, writePunctuation, node); - if (isMultiline) { - writer.decreaseIndent(); - } - } - } - function emitJsxNamespacedName(node) { - emitIdentifierName(node.namespace); - writePunctuation(":"); - emitIdentifierName(node.name); - } - function emitJsxTagName(node) { - if (node.kind === 80 /* Identifier */) { - emitExpression(node); - } else { - emit(node); - } - } - function emitCaseClause(node) { - emitTokenWithComment(84 /* CaseKeyword */, node.pos, writeKeyword, node); - writeSpace(); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); - emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); - } - function emitDefaultClause(node) { - const pos = emitTokenWithComment(90 /* DefaultKeyword */, node.pos, writeKeyword, node); - emitCaseOrDefaultClauseRest(node, node.statements, pos); - } - function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { - const emitAsSingleStatement = statements.length === 1 && // treat synthesized nodes as located on the same line for emit purposes - (!currentSourceFile || nodeIsSynthesized(parentNode) || nodeIsSynthesized(statements[0]) || rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); - let format = 163969 /* CaseOrDefaultClauseStatements */; - if (emitAsSingleStatement) { - writeToken(59 /* ColonToken */, colonPos, writePunctuation, parentNode); - writeSpace(); - format &= ~(1 /* MultiLine */ | 128 /* Indented */); - } else { - emitTokenWithComment(59 /* ColonToken */, colonPos, writePunctuation, parentNode); - } - emitList(parentNode, statements, format); - } - function emitHeritageClause(node) { - writeSpace(); - writeTokenText(node.token, writeKeyword); - writeSpace(); - emitList(node, node.types, 528 /* HeritageClauseTypes */); - } - function emitCatchClause(node) { - const openParenPos = emitTokenWithComment(85 /* CatchKeyword */, node.pos, writeKeyword, node); - writeSpace(); - if (node.variableDeclaration) { - emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); - emit(node.variableDeclaration); - emitTokenWithComment(22 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation, node); - writeSpace(); - } - emit(node.block); - } - function emitPropertyAssignment(node) { - emit(node.name); - writePunctuation(":"); - writeSpace(); - const initializer = node.initializer; - if ((getEmitFlags(initializer) & 1024 /* NoLeadingComments */) === 0) { - const commentRange = getCommentRange(initializer); - emitTrailingCommentsOfPosition(commentRange.pos); - } - emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitShorthandPropertyAssignment(node) { - emit(node.name); - if (node.objectAssignmentInitializer) { - writeSpace(); - writePunctuation("="); - writeSpace(); - emitExpression(node.objectAssignmentInitializer, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - } - function emitSpreadAssignment(node) { - if (node.expression) { - emitTokenWithComment(26 /* DotDotDotToken */, node.pos, writePunctuation, node); - emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - } - function emitEnumMember(node) { - emit(node.name); - emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); - } - function emitJSDoc(node) { - write("/**"); - if (node.comment) { - const text = getTextOfJSDocComment(node.comment); - if (text) { - const lines = text.split(/\r\n?|\n/); - for (const line of lines) { - writeLine(); - writeSpace(); - writePunctuation("*"); - writeSpace(); - write(line); - } - } - } - if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 345 /* JSDocTypeTag */ && !node.comment) { - writeSpace(); - emit(node.tags[0]); - } else { - emitList(node, node.tags, 33 /* JSDocComment */); - } - } - writeSpace(); - write("*/"); - } - function emitJSDocSimpleTypedTag(tag) { - emitJSDocTagName(tag.tagName); - emitJSDocTypeExpression(tag.typeExpression); - emitJSDocComment(tag.comment); - } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocImportTag(tag) { - emitJSDocTagName(tag.tagName); - writeSpace(); - if (tag.importClause) { - emit(tag.importClause); - writeSpace(); - emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag); - writeSpace(); - } - emitExpression(tag.moduleSpecifier); - if (tag.attributes) { - emitWithLeadingSpace(tag.attributes); - } - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } - function emitJSDocHeritageTag(tag) { - emitJSDocTagName(tag.tagName); - writeSpace(); - writePunctuation("{"); - emit(tag.class); - writePunctuation("}"); - emitJSDocComment(tag.comment); - } - function emitJSDocTemplateTag(tag) { - emitJSDocTagName(tag.tagName); - emitJSDocTypeExpression(tag.constraint); - writeSpace(); - emitList(tag, tag.typeParameters, 528 /* CommaListElements */); - emitJSDocComment(tag.comment); - } - function emitJSDocTypedefTag(tag) { - emitJSDocTagName(tag.tagName); - if (tag.typeExpression) { - if (tag.typeExpression.kind === 310 /* JSDocTypeExpression */) { - emitJSDocTypeExpression(tag.typeExpression); - } else { - writeSpace(); - writePunctuation("{"); - write("Object"); - if (tag.typeExpression.isArrayType) { - writePunctuation("["); - writePunctuation("]"); - } - writePunctuation("}"); - } - } - if (tag.fullName) { - writeSpace(); - emit(tag.fullName); - } - emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 323 /* JSDocTypeLiteral */) { - emitJSDocTypeLiteral(tag.typeExpression); - } - } - function emitJSDocCallbackTag(tag) { - emitJSDocTagName(tag.tagName); - if (tag.name) { - writeSpace(); - emit(tag.name); - } - emitJSDocComment(tag.comment); - emitJSDocSignature(tag.typeExpression); - } - function emitJSDocOverloadTag(tag) { - emitJSDocComment(tag.comment); - emitJSDocSignature(tag.typeExpression); - } - function emitJSDocSimpleTag(tag) { - emitJSDocTagName(tag.tagName); - emitJSDocComment(tag.comment); - } - function emitJSDocTypeLiteral(lit) { - emitList(lit, factory.createNodeArray(lit.jsDocPropertyTags), 33 /* JSDocComment */); - } - function emitJSDocSignature(sig) { - if (sig.typeParameters) { - emitList(sig, factory.createNodeArray(sig.typeParameters), 33 /* JSDocComment */); - } - if (sig.parameters) { - emitList(sig, factory.createNodeArray(sig.parameters), 33 /* JSDocComment */); - } - if (sig.type) { - writeLine(); - writeSpace(); - writePunctuation("*"); - writeSpace(); - emit(sig.type); - } - } - function emitJSDocPropertyLikeTag(param) { - emitJSDocTagName(param.tagName); - emitJSDocTypeExpression(param.typeExpression); - writeSpace(); - if (param.isBracketed) { - writePunctuation("["); - } - emit(param.name); - if (param.isBracketed) { - writePunctuation("]"); - } - emitJSDocComment(param.comment); - } - function emitJSDocTagName(tagName) { - writePunctuation("@"); - emit(tagName); - } - function emitJSDocComment(comment) { - const text = getTextOfJSDocComment(comment); - if (text) { - writeSpace(); - write(text); - } - } - function emitJSDocTypeExpression(typeExpression) { - if (typeExpression) { - writeSpace(); - writePunctuation("{"); - emit(typeExpression.type); - writePunctuation("}"); - } - } - function emitSourceFile(node) { - writeLine(); - const statements = node.statements; - const shouldEmitDetachedComment = statements.length === 0 || !isPrologueDirective(statements[0]) || nodeIsSynthesized(statements[0]); - if (shouldEmitDetachedComment) { - emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); - return; - } - emitSourceFileWorker(node); - } - function emitSyntheticTripleSlashReferencesIfNeeded(node) { - emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []); - } - function emitTripleSlashDirectivesIfNeeded(node) { - if (node.isDeclarationFile) emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives); - } - function emitTripleSlashDirectives(hasNoDefaultLib, files, types, libs2) { - if (hasNoDefaultLib) { - writeComment(`/// `); - writeLine(); - } - if (currentSourceFile && currentSourceFile.moduleName) { - writeComment(`/// `); - writeLine(); - } - if (currentSourceFile && currentSourceFile.amdDependencies) { - for (const dep of currentSourceFile.amdDependencies) { - if (dep.name) { - writeComment(`/// `); - } else { - writeComment(`/// `); - } - writeLine(); - } - } - function writeDirectives(kind, directives) { - for (const directive of directives) { - const resolutionMode = directive.resolutionMode ? `resolution-mode="${directive.resolutionMode === 99 /* ESNext */ ? "import" : "require"}" ` : ""; - const preserve = directive.preserve ? `preserve="true" ` : ""; - writeComment(`/// `); - writeLine(); - } - } - writeDirectives("path", files); - writeDirectives("types", types); - writeDirectives("lib", libs2); - } - function emitSourceFileWorker(node) { - const statements = node.statements; - pushNameGenerationScope(node); - forEach(node.statements, generateNames); - emitHelpers(node); - const index = findIndex(statements, (statement) => !isPrologueDirective(statement)); - emitTripleSlashDirectivesIfNeeded(node); - emitList( - node, - statements, - 1 /* MultiLine */, - /*parenthesizerRule*/ - void 0, - index === -1 ? statements.length : index - ); - popNameGenerationScope(node); - } - function emitPartiallyEmittedExpression(node) { - const emitFlags = getEmitFlags(node); - if (!(emitFlags & 1024 /* NoLeadingComments */) && node.pos !== node.expression.pos) { - emitTrailingCommentsOfPosition(node.expression.pos); - } - emitExpression(node.expression); - if (!(emitFlags & 2048 /* NoTrailingComments */) && node.end !== node.expression.end) { - emitLeadingCommentsOfPosition(node.expression.end); - } - } - function emitCommaList(node) { - emitExpressionList( - node, - node.elements, - 528 /* CommaListElements */, - /*parenthesizerRule*/ - void 0 - ); - } - function emitPrologueDirectives(statements, sourceFile, seenPrologueDirectives) { - let needsToSetSourceFile = !!sourceFile; - for (let i = 0; i < statements.length; i++) { - const statement = statements[i]; - if (isPrologueDirective(statement)) { - const shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; - if (shouldEmitPrologueDirective) { - if (needsToSetSourceFile) { - needsToSetSourceFile = false; - setSourceFile(sourceFile); - } - writeLine(); - emit(statement); - if (seenPrologueDirectives) { - seenPrologueDirectives.add(statement.expression.text); - } - } - } else { - return i; - } - } - return statements.length; - } - function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { - if (isSourceFile(sourceFileOrBundle)) { - emitPrologueDirectives(sourceFileOrBundle.statements, sourceFileOrBundle); - } else { - const seenPrologueDirectives = /* @__PURE__ */ new Set(); - for (const sourceFile of sourceFileOrBundle.sourceFiles) { - emitPrologueDirectives(sourceFile.statements, sourceFile, seenPrologueDirectives); - } - setSourceFile(void 0); - } - } - function emitShebangIfNeeded(sourceFileOrBundle) { - if (isSourceFile(sourceFileOrBundle)) { - const shebang = getShebang(sourceFileOrBundle.text); - if (shebang) { - writeComment(shebang); - writeLine(); - return true; - } - } else { - for (const sourceFile of sourceFileOrBundle.sourceFiles) { - if (emitShebangIfNeeded(sourceFile)) { - return true; - } - } - } - } - function emitNodeWithWriter(node, writer2) { - if (!node) return; - const savedWrite = write; - write = writer2; - emit(node); - write = savedWrite; - } - function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { - if (modifiers == null ? void 0 : modifiers.length) { - if (every(modifiers, isModifier)) { - return emitModifierList(node, modifiers); - } - if (every(modifiers, isDecorator)) { - if (allowDecorators) { - return emitDecoratorList(node, modifiers); - } - return node.pos; - } - onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); - let lastMode; - let mode; - let start = 0; - let pos = 0; - let lastModifier; - while (start < modifiers.length) { - while (pos < modifiers.length) { - lastModifier = modifiers[pos]; - mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; - if (lastMode === void 0) { - lastMode = mode; - } else if (mode !== lastMode) { - break; - } - pos++; - } - const textRange = { pos: -1, end: -1 }; - if (start === 0) textRange.pos = modifiers.pos; - if (pos === modifiers.length - 1) textRange.end = modifiers.end; - if (lastMode === "modifiers" || allowDecorators) { - emitNodeListItems( - emit, - node, - modifiers, - lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, - /*parenthesizerRule*/ - void 0, - start, - pos - start, - /*hasTrailingComma*/ - false, - textRange - ); - } - start = pos; - lastMode = mode; - pos++; - } - onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); - if (lastModifier && !positionIsSynthesized(lastModifier.end)) { - return lastModifier.end; - } - } - return node.pos; - } - function emitModifierList(node, modifiers) { - emitList(node, modifiers, 2359808 /* Modifiers */); - const lastModifier = lastOrUndefined(modifiers); - return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; - } - function emitTypeAnnotation(node) { - if (node) { - writePunctuation(":"); - writeSpace(); - emit(node); - } - } - function emitInitializer(node, equalCommentStartPos, container, parenthesizerRule) { - if (node) { - writeSpace(); - emitTokenWithComment(64 /* EqualsToken */, equalCommentStartPos, writeOperator, container); - writeSpace(); - emitExpression(node, parenthesizerRule); - } - } - function emitNodeWithPrefix(prefix, prefixWriter, node, emit2) { - if (node) { - prefixWriter(prefix); - emit2(node); - } - } - function emitWithLeadingSpace(node) { - if (node) { - writeSpace(); - emit(node); - } - } - function emitExpressionWithLeadingSpace(node, parenthesizerRule) { - if (node) { - writeSpace(); - emitExpression(node, parenthesizerRule); - } - } - function emitWithTrailingSpace(node) { - if (node) { - emit(node); - writeSpace(); - } - } - function emitEmbeddedStatement(parent2, node) { - if (isBlock(node) || getEmitFlags(parent2) & 1 /* SingleLine */ || preserveSourceNewlines && !getLeadingLineTerminatorCount(parent2, node, 0 /* None */)) { - writeSpace(); - emit(node); - } else { - writeLine(); - increaseIndent(); - if (isEmptyStatement(node)) { - pipelineEmit(5 /* EmbeddedStatement */, node); - } else { - emit(node); - } - decreaseIndent(); - } - } - function emitDecoratorList(parentNode, decorators) { - emitList(parentNode, decorators, 2146305 /* Decorators */); - const lastDecorator = lastOrUndefined(decorators); - return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; - } - function emitTypeArguments(parentNode, typeArguments) { - emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); - } - function emitTypeParameters(parentNode, typeParameters) { - if (isFunctionLike(parentNode) && parentNode.typeArguments) { - return emitTypeArguments(parentNode, parentNode.typeArguments); - } - emitList(parentNode, typeParameters, 53776 /* TypeParameters */ | (isArrowFunction(parentNode) ? 64 /* AllowTrailingComma */ : 0 /* None */)); - } - function emitParameters(parentNode, parameters) { - emitList(parentNode, parameters, 2576 /* Parameters */); - } - function canEmitSimpleArrowHead(parentNode, parameters) { - const parameter = singleOrUndefined(parameters); - return parameter && parameter.pos === parentNode.pos && isArrowFunction(parentNode) && !parentNode.type && !some(parentNode.modifiers) && !some(parentNode.typeParameters) && !some(parameter.modifiers) && !parameter.dotDotDotToken && !parameter.questionToken && !parameter.type && !parameter.initializer && isIdentifier(parameter.name); - } - function emitParametersForArrow(parentNode, parameters) { - if (canEmitSimpleArrowHead(parentNode, parameters)) { - emitList(parentNode, parameters, 2576 /* Parameters */ & ~2048 /* Parenthesis */); - } else { - emitParameters(parentNode, parameters); - } - } - function emitParametersForIndexSignature(parentNode, parameters) { - emitList(parentNode, parameters, 8848 /* IndexSignatureParameters */); - } - function writeDelimiter(format) { - switch (format & 60 /* DelimitersMask */) { - case 0 /* None */: - break; - case 16 /* CommaDelimited */: - writePunctuation(","); - break; - case 4 /* BarDelimited */: - writeSpace(); - writePunctuation("|"); - break; - case 32 /* AsteriskDelimited */: - writeSpace(); - writePunctuation("*"); - writeSpace(); - break; - case 8 /* AmpersandDelimited */: - writeSpace(); - writePunctuation("&"); - break; - } - } - function emitList(parentNode, children, format, parenthesizerRule, start, count) { - emitNodeList( - emit, - parentNode, - children, - format | (parentNode && getEmitFlags(parentNode) & 2 /* MultiLine */ ? 65536 /* PreferNewLine */ : 0), - parenthesizerRule, - start, - count - ); - } - function emitExpressionList(parentNode, children, format, parenthesizerRule, start, count) { - emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule, start, count); - } - function emitNodeList(emit2, parentNode, children, format, parenthesizerRule, start = 0, count = children ? children.length - start : 0) { - const isUndefined = children === void 0; - if (isUndefined && format & 16384 /* OptionalIfUndefined */) { - return; - } - const isEmpty = children === void 0 || start >= children.length || count === 0; - if (isEmpty && format & 32768 /* OptionalIfEmpty */) { - onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); - onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); - return; - } - if (format & 15360 /* BracketsMask */) { - writePunctuation(getOpeningBracket(format)); - if (isEmpty && children) { - emitTrailingCommentsOfPosition( - children.pos, - /*prefixSpace*/ - true - ); - } - } - onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); - if (isEmpty) { - if (format & 1 /* MultiLine */ && !(preserveSourceNewlines && (!parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile)))) { - writeLine(); - } else if (format & 256 /* SpaceBetweenBraces */ && !(format & 524288 /* NoSpaceIfEmpty */)) { - writeSpace(); - } - } else { - emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, children.hasTrailingComma, children); - } - onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); - if (format & 15360 /* BracketsMask */) { - if (isEmpty && children) { - emitLeadingCommentsOfPosition(children.end); - } - writePunctuation(getClosingBracket(format)); - } - } - function emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, hasTrailingComma, childrenTextRange) { - const mayEmitInterveningComments = (format & 262144 /* NoInterveningComments */) === 0; - let shouldEmitInterveningComments = mayEmitInterveningComments; - const leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[start], format); - if (leadingLineTerminatorCount) { - writeLine(leadingLineTerminatorCount); - shouldEmitInterveningComments = false; - } else if (format & 256 /* SpaceBetweenBraces */) { - writeSpace(); - } - if (format & 128 /* Indented */) { - increaseIndent(); - } - const emitListItem = getEmitListItem(emit2, parenthesizerRule); - let previousSibling; - let shouldDecreaseIndentAfterEmit = false; - for (let i = 0; i < count; i++) { - const child = children[start + i]; - if (format & 32 /* AsteriskDelimited */) { - writeLine(); - writeDelimiter(format); - } else if (previousSibling) { - if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { - const previousSiblingEmitFlags = getEmitFlags(previousSibling); - if (!(previousSiblingEmitFlags & 2048 /* NoTrailingComments */)) { - emitLeadingCommentsOfPosition(previousSibling.end); - } - } - writeDelimiter(format); - const separatingLineTerminatorCount = getSeparatingLineTerminatorCount(previousSibling, child, format); - if (separatingLineTerminatorCount > 0) { - if ((format & (3 /* LinesMask */ | 128 /* Indented */)) === 0 /* SingleLine */) { - 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 */) { - writeSpace(); - } - } - if (shouldEmitInterveningComments) { - const commentRange = getCommentRange(child); - emitTrailingCommentsOfPosition(commentRange.pos); - } else { - shouldEmitInterveningComments = mayEmitInterveningComments; - } - nextListElementPos = child.pos; - emitListItem(child, emit2, parenthesizerRule, i); - if (shouldDecreaseIndentAfterEmit) { - decreaseIndent(); - shouldDecreaseIndentAfterEmit = false; - } - previousSibling = child; - } - const emitFlags = previousSibling ? getEmitFlags(previousSibling) : 0; - const skipTrailingComments = commentsDisabled || !!(emitFlags & 2048 /* NoTrailingComments */); - const emitTrailingComma = hasTrailingComma && format & 64 /* AllowTrailingComma */ && format & 16 /* CommaDelimited */; - if (emitTrailingComma) { - if (previousSibling && !skipTrailingComments) { - emitTokenWithComment(28 /* CommaToken */, previousSibling.end, writePunctuation, previousSibling); - } else { - writePunctuation(","); - } - } - if (previousSibling && (parentNode ? parentNode.end : -1) !== previousSibling.end && format & 60 /* DelimitersMask */ && !skipTrailingComments) { - emitLeadingCommentsOfPosition(emitTrailingComma && (childrenTextRange == null ? void 0 : childrenTextRange.end) ? childrenTextRange.end : previousSibling.end); - } - if (format & 128 /* Indented */) { - decreaseIndent(); - } - const closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[start + count - 1], format, childrenTextRange); - if (closingLineTerminatorCount) { - writeLine(closingLineTerminatorCount); - } else if (format & (2097152 /* SpaceAfterList */ | 256 /* SpaceBetweenBraces */)) { - writeSpace(); - } - } - function writeLiteral(s) { - writer.writeLiteral(s); - } - function writeStringLiteral(s) { - writer.writeStringLiteral(s); - } - function writeBase(s) { - writer.write(s); - } - function writeSymbol(s, sym) { - writer.writeSymbol(s, sym); - } - function writePunctuation(s) { - writer.writePunctuation(s); - } - function writeTrailingSemicolon() { - writer.writeTrailingSemicolon(";"); - } - function writeKeyword(s) { - writer.writeKeyword(s); - } - function writeOperator(s) { - writer.writeOperator(s); - } - function writeParameter(s) { - writer.writeParameter(s); - } - function writeComment(s) { - writer.writeComment(s); - } - function writeSpace() { - writer.writeSpace(" "); - } - function writeProperty(s) { - writer.writeProperty(s); - } - function nonEscapingWrite(s) { - if (writer.nonEscapingWrite) { - writer.nonEscapingWrite(s); - } else { - writer.write(s); - } - } - function writeLine(count = 1) { - for (let i = 0; i < count; i++) { - writer.writeLine(i > 0); - } - } - function increaseIndent() { - writer.increaseIndent(); - } - function decreaseIndent() { - writer.decreaseIndent(); - } - function writeToken(token, pos, writer2, contextNode) { - return !sourceMapsDisabled ? emitTokenWithSourceMap(contextNode, token, writer2, pos, writeTokenText) : writeTokenText(token, writer2, pos); - } - function writeTokenNode(node, writer2) { - if (onBeforeEmitToken) { - onBeforeEmitToken(node); - } - writer2(tokenToString(node.kind)); - if (onAfterEmitToken) { - onAfterEmitToken(node); - } - } - function writeTokenText(token, writer2, pos) { - const tokenString = tokenToString(token); - writer2(tokenString); - return pos < 0 ? pos : pos + tokenString.length; - } - function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) { - if (getEmitFlags(parentNode) & 1 /* SingleLine */) { - writeSpace(); - } else if (preserveSourceNewlines) { - const lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode); - if (lines) { - writeLine(lines); - } else { - writeSpace(); - } - } else { - writeLine(); - } - } - function writeLines(text) { - const lines = text.split(/\r\n?|\n/); - const indentation = guessIndentation(lines); - for (const lineText of lines) { - const line = indentation ? lineText.slice(indentation) : lineText; - if (line.length) { - writeLine(); - write(line); - } - } - } - function writeLinesAndIndent(lineCount, writeSpaceIfNotIndenting) { - if (lineCount) { - increaseIndent(); - writeLine(lineCount); - } else if (writeSpaceIfNotIndenting) { - writeSpace(); - } - } - function decreaseIndentIf(value1, value2) { - if (value1) { - decreaseIndent(); - } - if (value2) { - decreaseIndent(); - } - } - function getLeadingLineTerminatorCount(parentNode, firstChild, format) { - if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { - if (format & 65536 /* PreferNewLine */) { - return 1; - } - if (firstChild === void 0) { - return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; - } - if (firstChild.pos === nextListElementPos) { - return 0; - } - if (firstChild.kind === 12 /* JsxText */) { - return 0; - } - if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(firstChild) && (!firstChild.parent || getOriginalNode(firstChild.parent) === getOriginalNode(parentNode))) { - if (preserveSourceNewlines) { - return getEffectiveLines( - (includeComments) => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter( - firstChild.pos, - parentNode.pos, - currentSourceFile, - includeComments - ) - ); - } - return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1; - } - if (synthesizedNodeStartsOnNewLine(firstChild, format)) { - return 1; - } - } - return format & 1 /* MultiLine */ ? 1 : 0; - } - function getSeparatingLineTerminatorCount(previousNode, nextNode, format) { - if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { - if (previousNode === void 0 || nextNode === void 0) { - return 0; - } - if (nextNode.kind === 12 /* JsxText */) { - return 0; - } else if (currentSourceFile && !nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) { - if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) { - return getEffectiveLines( - (includeComments) => getLinesBetweenRangeEndAndRangeStart( - previousNode, - nextNode, - currentSourceFile, - includeComments - ) - ); - } else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) { - return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1; - } - return format & 65536 /* PreferNewLine */ ? 1 : 0; - } else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) { - return 1; - } - } else if (getStartsOnNewLine(nextNode)) { - return 1; - } - return format & 1 /* MultiLine */ ? 1 : 0; - } - function getClosingLineTerminatorCount(parentNode, lastChild, format, childrenTextRange) { - if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { - if (format & 65536 /* PreferNewLine */) { - return 1; - } - if (lastChild === void 0) { - return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; - } - if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { - if (preserveSourceNewlines) { - const end = childrenTextRange && !positionIsSynthesized(childrenTextRange.end) ? childrenTextRange.end : lastChild.end; - return getEffectiveLines( - (includeComments) => getLinesBetweenPositionAndNextNonWhitespaceCharacter( - end, - parentNode.end, - currentSourceFile, - includeComments - ) - ); - } - return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1; - } - if (synthesizedNodeStartsOnNewLine(lastChild, format)) { - return 1; - } - } - if (format & 1 /* MultiLine */ && !(format & 131072 /* NoTrailingNewLine */)) { - return 1; - } - return 0; - } - function getEffectiveLines(getLineDifference) { - Debug.assert(!!preserveSourceNewlines); - const lines = getLineDifference( - /*includeComments*/ - true - ); - if (lines === 0) { - return getLineDifference( - /*includeComments*/ - false - ); - } - return lines; - } - function writeLineSeparatorsAndIndentBefore(node, parent2) { - const leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent2, node, 0 /* None */); - if (leadingNewlines) { - writeLinesAndIndent( - leadingNewlines, - /*writeSpaceIfNotIndenting*/ - false - ); - } - return !!leadingNewlines; - } - function writeLineSeparatorsAfter(node, parent2) { - const trailingNewlines = preserveSourceNewlines && getClosingLineTerminatorCount( - parent2, - node, - 0 /* None */, - /*childrenTextRange*/ - void 0 - ); - if (trailingNewlines) { - writeLine(trailingNewlines); - } - } - function synthesizedNodeStartsOnNewLine(node, format) { - if (nodeIsSynthesized(node)) { - const startsOnNewLine = getStartsOnNewLine(node); - if (startsOnNewLine === void 0) { - return (format & 65536 /* PreferNewLine */) !== 0; - } - return startsOnNewLine; - } - return (format & 65536 /* PreferNewLine */) !== 0; - } - function getLinesBetweenNodes(parent2, node1, node2) { - if (getEmitFlags(parent2) & 262144 /* NoIndentation */) { - return 0; - } - parent2 = skipSynthesizedParentheses(parent2); - node1 = skipSynthesizedParentheses(node1); - node2 = skipSynthesizedParentheses(node2); - if (getStartsOnNewLine(node2)) { - return 1; - } - if (currentSourceFile && !nodeIsSynthesized(parent2) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) { - if (preserveSourceNewlines) { - return getEffectiveLines( - (includeComments) => getLinesBetweenRangeEndAndRangeStart( - node1, - node2, - currentSourceFile, - includeComments - ) - ); - } - return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1; - } - return 0; - } - function isEmptyBlock(block) { - return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); - } - function skipSynthesizedParentheses(node) { - while (node.kind === 218 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { - node = node.expression; - } - return node; - } - function getTextOfNode2(node, includeTrivia) { - if (isGeneratedIdentifier(node) || isGeneratedPrivateIdentifier(node)) { - return generateName(node); - } - if (isStringLiteral(node) && node.textSourceNode) { - return getTextOfNode2(node.textSourceNode, includeTrivia); - } - const sourceFile = currentSourceFile; - const canUseSourceFile = !!sourceFile && !!node.parent && !nodeIsSynthesized(node); - if (isMemberName(node)) { - if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { - return idText(node); - } - } else if (isJsxNamespacedName(node)) { - if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { - return getTextOfJsxNamespacedName(node); - } - } else { - Debug.assertNode(node, isLiteralExpression); - if (!canUseSourceFile) { - return node.text; - } - } - return getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia); - } - function getLiteralTextOfNode(node, sourceFile = currentSourceFile, neverAsciiEscape, jsxAttributeEscape) { - if (node.kind === 11 /* StringLiteral */ && node.textSourceNode) { - const textSourceNode = node.textSourceNode; - if (isIdentifier(textSourceNode) || isPrivateIdentifier(textSourceNode) || isNumericLiteral(textSourceNode) || isJsxNamespacedName(textSourceNode)) { - const text = isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode2(textSourceNode); - return jsxAttributeEscape ? `"${escapeJsxAttributeString(text)}"` : neverAsciiEscape || getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? `"${escapeString(text)}"` : `"${escapeNonAsciiString(text)}"`; - } else { - return getLiteralTextOfNode(textSourceNode, getSourceFileOfNode(textSourceNode), neverAsciiEscape, jsxAttributeEscape); - } - } - 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, sourceFile, flags); - } - function pushNameGenerationScope(node) { - privateNameTempFlagsStack.push(privateNameTempFlags); - privateNameTempFlags = 0 /* Auto */; - reservedPrivateNamesStack.push(reservedPrivateNames); - if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { - return; - } - tempFlagsStack.push(tempFlags); - tempFlags = 0 /* Auto */; - formattedNameTempFlagsStack.push(formattedNameTempFlags); - formattedNameTempFlags = void 0; - reservedNamesStack.push(reservedNames); - } - function popNameGenerationScope(node) { - privateNameTempFlags = privateNameTempFlagsStack.pop(); - reservedPrivateNames = reservedPrivateNamesStack.pop(); - if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { - return; - } - tempFlags = tempFlagsStack.pop(); - formattedNameTempFlags = formattedNameTempFlagsStack.pop(); - reservedNames = reservedNamesStack.pop(); - } - function reserveNameInNestedScopes(name) { - if (!reservedNames || reservedNames === lastOrUndefined(reservedNamesStack)) { - reservedNames = /* @__PURE__ */ new Set(); - } - reservedNames.add(name); - } - function reservePrivateNameInNestedScopes(name) { - if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) { - reservedPrivateNames = /* @__PURE__ */ new Set(); - } - reservedPrivateNames.add(name); - } - function generateNames(node) { - if (!node) return; - switch (node.kind) { - case 242 /* Block */: - forEach(node.statements, generateNames); - break; - case 257 /* LabeledStatement */: - case 255 /* WithStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - generateNames(node.statement); - break; - case 246 /* IfStatement */: - generateNames(node.thenStatement); - generateNames(node.elseStatement); - break; - case 249 /* ForStatement */: - case 251 /* ForOfStatement */: - case 250 /* ForInStatement */: - generateNames(node.initializer); - generateNames(node.statement); - break; - case 256 /* SwitchStatement */: - generateNames(node.caseBlock); - break; - case 270 /* CaseBlock */: - forEach(node.clauses, generateNames); - break; - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - forEach(node.statements, generateNames); - break; - case 259 /* TryStatement */: - generateNames(node.tryBlock); - generateNames(node.catchClause); - generateNames(node.finallyBlock); - break; - case 300 /* CatchClause */: - generateNames(node.variableDeclaration); - generateNames(node.block); - break; - case 244 /* VariableStatement */: - generateNames(node.declarationList); - break; - case 262 /* VariableDeclarationList */: - forEach(node.declarations, generateNames); - break; - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 209 /* BindingElement */: - case 264 /* ClassDeclaration */: - generateNameIfNeeded(node.name); - break; - case 263 /* FunctionDeclaration */: - generateNameIfNeeded(node.name); - if (getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { - forEach(node.parameters, generateNames); - generateNames(node.body); - } - break; - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - forEach(node.elements, generateNames); - break; - case 273 /* ImportDeclaration */: - generateNames(node.importClause); - break; - case 274 /* ImportClause */: - generateNameIfNeeded(node.name); - generateNames(node.namedBindings); - break; - case 275 /* NamespaceImport */: - generateNameIfNeeded(node.name); - break; - case 281 /* NamespaceExport */: - generateNameIfNeeded(node.name); - break; - case 276 /* NamedImports */: - forEach(node.elements, generateNames); - break; - case 277 /* ImportSpecifier */: - generateNameIfNeeded(node.propertyName || node.name); - break; - } - } - function generateMemberNames(node) { - if (!node) return; - switch (node.kind) { - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - generateNameIfNeeded(node.name); - break; - } - } - function generateNameIfNeeded(name) { - if (name) { - if (isGeneratedIdentifier(name) || isGeneratedPrivateIdentifier(name)) { - generateName(name); - } else if (isBindingPattern(name)) { - generateNames(name); - } - } - } - function generateName(name) { - const autoGenerate = name.emitNode.autoGenerate; - if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { - return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); - } else { - const autoGenerateId = autoGenerate.id; - return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); - } - } - function generateNameCached(node, privateName, flags, prefix, suffix) { - const nodeId = getNodeId(node); - const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; - return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags ?? 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); - } - function isUniqueName(name, privateName) { - return isFileLevelUniqueNameInCurrentFile(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name); - } - function isReservedName(name, privateName) { - let set; - let stack; - if (privateName) { - set = reservedPrivateNames; - stack = reservedPrivateNamesStack; - } else { - set = reservedNames; - stack = reservedNamesStack; - } - if (set == null ? void 0 : set.has(name)) { - return true; - } - for (let i = stack.length - 1; i >= 0; i--) { - if (set === stack[i]) { - continue; - } - set = stack[i]; - if (set == null ? void 0 : set.has(name)) { - return true; - } - } - return false; - } - function isFileLevelUniqueNameInCurrentFile(name, _isPrivate) { - return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true; - } - function isUniqueLocalName(name, container) { - for (let node = container; node && isNodeDescendantOf(node, container); node = node.nextContainer) { - if (canHaveLocals(node) && node.locals) { - const local = node.locals.get(escapeLeadingUnderscores(name)); - if (local && local.flags & (111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { - return false; - } - } - } - return true; - } - function getTempFlags(formattedNameKey) { - switch (formattedNameKey) { - case "": - return tempFlags; - case "#": - return privateNameTempFlags; - default: - return (formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) ?? 0 /* Auto */; - } - } - function setTempFlags(formattedNameKey, flags) { - switch (formattedNameKey) { - case "": - tempFlags = flags; - break; - case "#": - privateNameTempFlags = flags; - break; - default: - formattedNameTempFlags ?? (formattedNameTempFlags = /* @__PURE__ */ new Map()); - formattedNameTempFlags.set(formattedNameKey, flags); - break; - } - } - function makeTempVariableName(flags, reservedInNestedScopes, privateName, prefix, suffix) { - if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { - prefix = prefix.slice(1); - } - const key = formatGeneratedName(privateName, prefix, "", suffix); - let tempFlags2 = getTempFlags(key); - if (flags && !(tempFlags2 & flags)) { - const name = flags === 268435456 /* _i */ ? "_i" : "_n"; - const fullName = formatGeneratedName(privateName, prefix, name, suffix); - if (isUniqueName(fullName, privateName)) { - tempFlags2 |= flags; - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (reservedInNestedScopes) { - reserveNameInNestedScopes(fullName); - } - setTempFlags(key, tempFlags2); - return fullName; - } - } - while (true) { - const count = tempFlags2 & 268435455 /* CountMask */; - tempFlags2++; - if (count !== 8 && count !== 13) { - const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - const fullName = formatGeneratedName(privateName, prefix, name, suffix); - if (isUniqueName(fullName, privateName)) { - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (reservedInNestedScopes) { - reserveNameInNestedScopes(fullName); - } - setTempFlags(key, tempFlags2); - return fullName; - } - } - } - } - function makeUniqueName2(baseName, checkFn = isUniqueName, optimistic, scoped, privateName, prefix, suffix) { - if (baseName.length > 0 && baseName.charCodeAt(0) === 35 /* hash */) { - baseName = baseName.slice(1); - } - if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { - prefix = prefix.slice(1); - } - if (optimistic) { - const fullName = formatGeneratedName(privateName, prefix, baseName, suffix); - if (checkFn(fullName, privateName)) { - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (scoped) { - reserveNameInNestedScopes(fullName); - } else { - generatedNames.add(fullName); - } - return fullName; - } - } - if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { - baseName += "_"; - } - let i = 1; - while (true) { - const fullName = formatGeneratedName(privateName, prefix, baseName + i, suffix); - if (checkFn(fullName, privateName)) { - if (privateName) { - reservePrivateNameInNestedScopes(fullName); - } else if (scoped) { - reserveNameInNestedScopes(fullName); - } else { - generatedNames.add(fullName); - } - return fullName; - } - i++; - } - } - function makeFileLevelOptimisticUniqueName(name) { - return makeUniqueName2( - name, - isFileLevelUniqueNameInCurrentFile, - /*optimistic*/ - true, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForModuleOrEnum(node) { - const name = getTextOfNode2(node.name); - return isUniqueLocalName(name, tryCast(node, canHaveLocals)) ? name : makeUniqueName2( - name, - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForImportOrExportDeclaration(node) { - const expr = getExternalModuleName(node); - const baseName = isStringLiteral(expr) ? makeIdentifierFromModuleName(expr.text) : "module"; - return makeUniqueName2( - baseName, - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForExportDefault() { - return makeUniqueName2( - "default", - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForClassExpression() { - return makeUniqueName2( - "class", - isUniqueName, - /*optimistic*/ - false, - /*scoped*/ - false, - /*privateName*/ - false, - /*prefix*/ - "", - /*suffix*/ - "" - ); - } - function generateNameForMethodOrAccessor(node, privateName, prefix, suffix) { - if (isIdentifier(node.name)) { - return generateNameCached(node.name, privateName); - } - return makeTempVariableName( - 0 /* Auto */, - /*reservedInNestedScopes*/ - false, - privateName, - prefix, - suffix - ); - } - function generateNameForNode(node, privateName, flags, prefix, suffix) { - switch (node.kind) { - case 80 /* Identifier */: - case 81 /* PrivateIdentifier */: - return makeUniqueName2( - getTextOfNode2(node), - isUniqueName, - !!(flags & 16 /* Optimistic */), - !!(flags & 8 /* ReservedInNestedScopes */), - privateName, - prefix, - suffix - ); - case 268 /* ModuleDeclaration */: - case 267 /* EnumDeclaration */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForModuleOrEnum(node); - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForImportOrExportDeclaration(node); - case 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: { - Debug.assert(!prefix && !suffix && !privateName); - const name = node.name; - if (name && !isGeneratedIdentifier(name)) { - return generateNameForNode( - name, - /*privateName*/ - false, - flags, - prefix, - suffix - ); - } - return generateNameForExportDefault(); - } - case 278 /* ExportAssignment */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForExportDefault(); - case 232 /* ClassExpression */: - Debug.assert(!prefix && !suffix && !privateName); - return generateNameForClassExpression(); - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); - case 168 /* ComputedPropertyName */: - return makeTempVariableName( - 0 /* Auto */, - /*reservedInNestedScopes*/ - true, - privateName, - prefix, - suffix - ); - default: - return makeTempVariableName( - 0 /* Auto */, - /*reservedInNestedScopes*/ - false, - privateName, - prefix, - suffix - ); - } - } - function makeName(name) { - const autoGenerate = name.emitNode.autoGenerate; - const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); - const suffix = formatGeneratedNamePart(autoGenerate.suffix); - switch (autoGenerate.flags & 7 /* KindMask */) { - case 1 /* Auto */: - return makeTempVariableName(0 /* Auto */, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); - case 2 /* Loop */: - Debug.assertNode(name, isIdentifier); - return makeTempVariableName( - 268435456 /* _i */, - !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), - /*privateName*/ - false, - prefix, - suffix - ); - case 3 /* Unique */: - return makeUniqueName2( - idText(name), - autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueNameInCurrentFile : isUniqueName, - !!(autoGenerate.flags & 16 /* Optimistic */), - !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), - isPrivateIdentifier(name), - prefix, - suffix - ); - } - return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( - autoGenerate.flags & 7 /* KindMask */, - GeneratedIdentifierFlags, - /*isFlags*/ - true - )}.`); - } - function pipelineEmitWithComments(hint, node) { - const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node); - const savedContainerPos = containerPos; - const savedContainerEnd = containerEnd; - const savedDeclarationListContainerEnd = declarationListContainerEnd; - emitCommentsBeforeNode(node); - pipelinePhase(hint, node); - emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - } - function emitCommentsBeforeNode(node) { - const emitFlags = getEmitFlags(node); - const commentRange = getCommentRange(node); - emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end); - if (emitFlags & 4096 /* NoNestedComments */) { - commentsDisabled = true; - } - } - function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { - const emitFlags = getEmitFlags(node); - const commentRange = getCommentRange(node); - if (emitFlags & 4096 /* NoNestedComments */) { - commentsDisabled = false; - } - emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - const typeNode = getTypeNode(node); - if (typeNode) { - emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); - } - } - function emitLeadingCommentsOfNode(node, emitFlags, pos, end) { - enterComment(); - hasWrittenComment = false; - const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0 || node.kind === 12 /* JsxText */; - const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 12 /* JsxText */; - if ((pos > 0 || end > 0) && pos !== end) { - if (!skipLeadingComments) { - emitLeadingComments( - pos, - /*isEmittedNode*/ - node.kind !== 354 /* NotEmittedStatement */ - ); - } - if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { - containerPos = pos; - } - if (!skipTrailingComments || end >= 0 && (emitFlags & 2048 /* NoTrailingComments */) !== 0) { - containerEnd = end; - if (node.kind === 262 /* VariableDeclarationList */) { - declarationListContainerEnd = end; - } - } - } - forEach(getSyntheticLeadingComments(node), emitLeadingSynthesizedComment); - exitComment(); - } - function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { - enterComment(); - const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 12 /* JsxText */; - forEach(getSyntheticTrailingComments(node), emitTrailingSynthesizedComment); - if ((pos > 0 || end > 0) && pos !== end) { - containerPos = savedContainerPos; - containerEnd = savedContainerEnd; - declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) { - emitTrailingComments(end); - } - } - exitComment(); - } - function emitLeadingSynthesizedComment(comment) { - if (comment.hasLeadingNewline || comment.kind === 2 /* SingleLineCommentTrivia */) { - writer.writeLine(); - } - writeSynthesizedComment(comment); - if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) { - writer.writeLine(); - } else { - writer.writeSpace(" "); - } - } - function emitTrailingSynthesizedComment(comment) { - if (!writer.isAtStartOfLine()) { - writer.writeSpace(" "); - } - writeSynthesizedComment(comment); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - } - function writeSynthesizedComment(comment) { - const text = formatSynthesizedComment(comment); - const lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? computeLineStarts(text) : void 0; - writeCommentRange(text, lineMap, writer, 0, text.length, newLine); - } - function formatSynthesizedComment(comment) { - return comment.kind === 3 /* MultiLineCommentTrivia */ ? `/*${comment.text}*/` : `//${comment.text}`; - } - function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { - enterComment(); - const { pos, end } = detachedRange; - const emitFlags = getEmitFlags(node); - const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0; - const skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0; - if (!skipLeadingComments) { - emitDetachedCommentsAndUpdateCommentsInfo(detachedRange); - } - exitComment(); - if (emitFlags & 4096 /* NoNestedComments */ && !commentsDisabled) { - commentsDisabled = true; - emitCallback(node); - commentsDisabled = false; - } else { - emitCallback(node); - } - enterComment(); - if (!skipTrailingComments) { - emitLeadingComments( - detachedRange.end, - /*isEmittedNode*/ - true - ); - if (hasWrittenComment && !writer.isAtStartOfLine()) { - writer.writeLine(); - } - } - exitComment(); - } - function originalNodesHaveSameParent(nodeA, nodeB) { - nodeA = getOriginalNode(nodeA); - return nodeA.parent && nodeA.parent === getOriginalNode(nodeB).parent; - } - function siblingNodePositionsAreComparable(previousNode, nextNode) { - if (nextNode.pos < previousNode.end) { - return false; - } - previousNode = getOriginalNode(previousNode); - nextNode = getOriginalNode(nextNode); - const parent2 = previousNode.parent; - if (!parent2 || parent2 !== nextNode.parent) { - return false; - } - const parentNodeArray = getContainingNodeArray(previousNode); - const prevNodeIndex = parentNodeArray == null ? void 0 : parentNodeArray.indexOf(previousNode); - return prevNodeIndex !== void 0 && prevNodeIndex > -1 && parentNodeArray.indexOf(nextNode) === prevNodeIndex + 1; - } - function emitLeadingComments(pos, isEmittedNode) { - hasWrittenComment = false; - if (isEmittedNode) { - if (pos === 0 && (currentSourceFile == null ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } - } else if (pos === 0) { - forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment); - } - } - function emitTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } - function shouldWriteComment(text, pos) { - if (printerOptions.onlyPrintJsDocStyle) { - return isJSDocLikeText(text, pos) || isPinnedComment(text, pos); - } - return true; - } - function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return; - if (!hasWrittenComment) { - emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos); - hasWrittenComment = true; - } - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (hasTrailingNewLine) { - writer.writeLine(); - } else if (kind === 3 /* MultiLineCommentTrivia */) { - writer.writeSpace(" "); - } - } - function emitLeadingCommentsOfPosition(pos) { - if (commentsDisabled || pos === -1) { - return; - } - emitLeadingComments( - pos, - /*isEmittedNode*/ - true - ); - } - function emitTrailingComments(pos) { - forEachTrailingCommentToEmit(pos, emitTrailingComment); - } - function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) { - if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return; - if (!writer.isAtStartOfLine()) { - writer.writeSpace(" "); - } - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (hasTrailingNewLine) { - writer.writeLine(); - } - } - function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) { - if (commentsDisabled) { - return; - } - enterComment(); - forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : forceNoNewline ? emitTrailingCommentOfPositionNoNewline : emitTrailingCommentOfPosition); - exitComment(); - } - function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) { - if (!currentSourceFile) return; - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (kind === 2 /* SingleLineCommentTrivia */) { - writer.writeLine(); - } - } - function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { - if (!currentSourceFile) return; - emitPos(commentPos); - writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); - emitPos(commentEnd); - if (hasTrailingNewLine) { - writer.writeLine(); - } else { - writer.writeSpace(" "); - } - } - function forEachLeadingCommentToEmit(pos, cb) { - if (currentSourceFile && (containerPos === -1 || pos !== containerPos)) { - if (hasDetachedComments(pos)) { - forEachLeadingCommentWithoutDetachedComments(cb); - } else { - forEachLeadingCommentRange( - currentSourceFile.text, - pos, - cb, - /*state*/ - pos - ); - } - } - } - function forEachTrailingCommentToEmit(end, cb) { - if (currentSourceFile && (containerEnd === -1 || end !== containerEnd && end !== declarationListContainerEnd)) { - forEachTrailingCommentRange(currentSourceFile.text, end, cb); - } - } - function hasDetachedComments(pos) { - return detachedCommentsInfo !== void 0 && last(detachedCommentsInfo).nodePos === pos; - } - function forEachLeadingCommentWithoutDetachedComments(cb) { - if (!currentSourceFile) return; - const pos = last(detachedCommentsInfo).detachedCommentEndPos; - if (detachedCommentsInfo.length - 1) { - detachedCommentsInfo.pop(); - } else { - detachedCommentsInfo = void 0; - } - forEachLeadingCommentRange( - currentSourceFile.text, - pos, - cb, - /*state*/ - pos - ); - } - function emitDetachedCommentsAndUpdateCommentsInfo(range) { - const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled); - if (currentDetachedCommentInfo) { - if (detachedCommentsInfo) { - detachedCommentsInfo.push(currentDetachedCommentInfo); - } else { - detachedCommentsInfo = [currentDetachedCommentInfo]; - } - } - } - function emitComment(text, lineMap, writer2, commentPos, commentEnd, newLine2) { - if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return; - emitPos(commentPos); - writeCommentRange(text, lineMap, writer2, commentPos, commentEnd, newLine2); - emitPos(commentEnd); - } - function isTripleSlashComment(commentPos, commentEnd) { - return !!currentSourceFile && isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd); - } - function pipelineEmitWithSourceMaps(hint, node) { - const pipelinePhase = getNextPipelinePhase(3 /* SourceMaps */, hint, node); - emitSourceMapsBeforeNode(node); - pipelinePhase(hint, node); - emitSourceMapsAfterNode(node); - } - function emitSourceMapsBeforeNode(node) { - const emitFlags = getEmitFlags(node); - const sourceMapRange = getSourceMapRange(node); - const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { - emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); - } - if (emitFlags & 128 /* NoNestedSourceMaps */) { - sourceMapsDisabled = true; - } - } - function emitSourceMapsAfterNode(node) { - const emitFlags = getEmitFlags(node); - const sourceMapRange = getSourceMapRange(node); - if (emitFlags & 128 /* NoNestedSourceMaps */) { - sourceMapsDisabled = false; - } - if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { - emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); - } - } - function skipSourceTrivia(source, pos) { - return source.skipTrivia ? source.skipTrivia(pos) : skipTrivia(source.text, pos); - } - function emitPos(pos) { - if (sourceMapsDisabled || positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { - return; - } - const { line: sourceLine, character: sourceCharacter } = getLineAndCharacterOfPosition(sourceMapSource, pos); - sourceMapGenerator.addMapping( - writer.getLine(), - writer.getColumn(), - sourceMapSourceIndex, - sourceLine, - sourceCharacter, - /*nameIndex*/ - void 0 - ); - } - function emitSourcePos(source, pos) { - if (source !== sourceMapSource) { - const savedSourceMapSource = sourceMapSource; - const savedSourceMapSourceIndex = sourceMapSourceIndex; - setSourceMapSource(source); - emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); - } else { - emitPos(pos); - } - } - function emitTokenWithSourceMap(node, token, writer2, tokenPos, emitCallback) { - if (sourceMapsDisabled || node && isInJsonFile(node)) { - return emitCallback(token, writer2, tokenPos); - } - const emitNode = node && node.emitNode; - const emitFlags = emitNode && emitNode.flags || 0 /* None */; - const range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token]; - const source = range && range.source || sourceMapSource; - tokenPos = skipSourceTrivia(source, range ? range.pos : tokenPos); - if ((emitFlags & 256 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) { - emitSourcePos(source, tokenPos); - } - tokenPos = emitCallback(token, writer2, tokenPos); - if (range) tokenPos = range.end; - if ((emitFlags & 512 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) { - emitSourcePos(source, tokenPos); - } - return tokenPos; - } - function setSourceMapSource(source) { - if (sourceMapsDisabled) { - return; - } - sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } - if (isJsonSourceMapSource(source)) { - return; - } - sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName); - if (printerOptions.inlineSources) { - sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); - } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; - } - function isJsonSourceMapSource(sourceFile) { - return fileExtensionIs(sourceFile.fileName, ".json" /* Json */); - } -} -function createBracketsMap() { - const brackets2 = []; - brackets2[1024 /* Braces */] = ["{", "}"]; - brackets2[2048 /* Parenthesis */] = ["(", ")"]; - brackets2[4096 /* AngleBrackets */] = ["<", ">"]; - brackets2[8192 /* SquareBrackets */] = ["[", "]"]; - return brackets2; -} -function getOpeningBracket(format) { - return brackets[format & 15360 /* BracketsMask */][0]; -} -function getClosingBracket(format) { - return brackets[format & 15360 /* BracketsMask */][1]; -} -function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) { - emit(node); -} -function emitListItemWithParenthesizerRuleSelector(node, emit, parenthesizerRuleSelector, index) { - emit(node, parenthesizerRuleSelector.select(index)); -} -function emitListItemWithParenthesizerRule(node, emit, parenthesizerRule, _index) { - emit(node, parenthesizerRule); -} -function getEmitListItem(emit, parenthesizerRule) { - return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; -} - -// src/compiler/watchUtilities.ts -function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) { - if (!host.getDirectories || !host.readDirectory) { - return void 0; - } - const cachedReadDirectoryResult = /* @__PURE__ */ new Map(); - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); - return { - useCaseSensitiveFileNames: useCaseSensitiveFileNames2, - fileExists, - readFile: (path, encoding) => host.readFile(path, encoding), - directoryExists: host.directoryExists && directoryExists, - getDirectories, - readDirectory, - createDirectory: host.createDirectory && createDirectory, - writeFile: host.writeFile && writeFile2, - addOrDeleteFileOrDirectory, - addOrDeleteFile, - clearCache, - realpath: host.realpath && realpath - }; - function toPath3(fileName) { - return toPath(fileName, currentDirectory, getCanonicalFileName); - } - function getCachedFileSystemEntries(rootDirPath) { - return cachedReadDirectoryResult.get(ensureTrailingDirectorySeparator(rootDirPath)); - } - function getCachedFileSystemEntriesForBaseDir(path) { - const entries = getCachedFileSystemEntries(getDirectoryPath(path)); - if (!entries) { - return entries; - } - if (!entries.sortedAndCanonicalizedFiles) { - entries.sortedAndCanonicalizedFiles = entries.files.map(getCanonicalFileName).sort(); - entries.sortedAndCanonicalizedDirectories = entries.directories.map(getCanonicalFileName).sort(); - } - return entries; - } - function getBaseNameOfFileName(fileName) { - return getBaseFileName(normalizePath(fileName)); - } - function createCachedFileSystemEntries(rootDir, rootDirPath) { - var _a; - if (!host.realpath || ensureTrailingDirectorySeparator(toPath3(host.realpath(rootDir))) === rootDirPath) { - const resultFromHost = { - files: map(host.readDirectory( - rootDir, - /*extensions*/ - void 0, - /*exclude*/ - void 0, - /*include*/ - ["*.*"] - ), getBaseNameOfFileName) || [], - directories: host.getDirectories(rootDir) || [] - }; - cachedReadDirectoryResult.set(ensureTrailingDirectorySeparator(rootDirPath), resultFromHost); - return resultFromHost; - } - if ((_a = host.directoryExists) == null ? void 0 : _a.call(host, rootDir)) { - cachedReadDirectoryResult.set(rootDirPath, false); - return false; - } - return void 0; - } - function tryReadDirectory2(rootDir, rootDirPath) { - rootDirPath = ensureTrailingDirectorySeparator(rootDirPath); - const cachedResult = getCachedFileSystemEntries(rootDirPath); - if (cachedResult) { - return cachedResult; - } - try { - return createCachedFileSystemEntries(rootDir, rootDirPath); - } catch { - Debug.assert(!cachedReadDirectoryResult.has(ensureTrailingDirectorySeparator(rootDirPath))); - return void 0; - } - } - function hasEntry(entries, name) { - const index = binarySearch(entries, name, identity, compareStringsCaseSensitive); - return index >= 0; - } - function writeFile2(fileName, data, writeByteOrderMark) { - const path = toPath3(fileName); - const result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - updateFilesOfFileSystemEntry( - result, - getBaseNameOfFileName(fileName), - /*fileExists*/ - true - ); - } - return host.writeFile(fileName, data, writeByteOrderMark); - } - function fileExists(fileName) { - const path = toPath3(fileName); - const result = getCachedFileSystemEntriesForBaseDir(path); - return result && hasEntry(result.sortedAndCanonicalizedFiles, getCanonicalFileName(getBaseNameOfFileName(fileName))) || host.fileExists(fileName); - } - function directoryExists(dirPath) { - const path = toPath3(dirPath); - return cachedReadDirectoryResult.has(ensureTrailingDirectorySeparator(path)) || host.directoryExists(dirPath); - } - function createDirectory(dirPath) { - const path = toPath3(dirPath); - const result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - const baseName = getBaseNameOfFileName(dirPath); - const canonicalizedBaseName = getCanonicalFileName(baseName); - const canonicalizedDirectories = result.sortedAndCanonicalizedDirectories; - if (insertSorted(canonicalizedDirectories, canonicalizedBaseName, compareStringsCaseSensitive)) { - result.directories.push(baseName); - } - } - host.createDirectory(dirPath); - } - function getDirectories(rootDir) { - const rootDirPath = toPath3(rootDir); - const result = tryReadDirectory2(rootDir, rootDirPath); - if (result) { - return result.directories.slice(); - } - return host.getDirectories(rootDir); - } - function readDirectory(rootDir, extensions, excludes, includes, depth) { - const rootDirPath = toPath3(rootDir); - const rootResult = tryReadDirectory2(rootDir, rootDirPath); - let rootSymLinkResult; - if (rootResult !== void 0) { - return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath); - } - return host.readDirectory(rootDir, extensions, excludes, includes, depth); - function getFileSystemEntries(dir) { - const path = toPath3(dir); - if (path === rootDirPath) { - return rootResult || getFileSystemEntriesFromHost(dir, path); - } - const result = tryReadDirectory2(dir, path); - return result !== void 0 ? result || getFileSystemEntriesFromHost(dir, path) : emptyFileSystemEntries; - } - function getFileSystemEntriesFromHost(dir, path) { - if (rootSymLinkResult && path === rootDirPath) return rootSymLinkResult; - const result = { - files: map(host.readDirectory( - dir, - /*extensions*/ - void 0, - /*exclude*/ - void 0, - /*include*/ - ["*.*"] - ), getBaseNameOfFileName) || emptyArray, - directories: host.getDirectories(dir) || emptyArray - }; - if (path === rootDirPath) rootSymLinkResult = result; - return result; - } - } - function realpath(s) { - return host.realpath ? host.realpath(s) : s; - } - function clearFirstAncestorEntry(fileOrDirectoryPath) { - forEachAncestorDirectory( - getDirectoryPath(fileOrDirectoryPath), - (ancestor) => cachedReadDirectoryResult.delete(ensureTrailingDirectorySeparator(ancestor)) ? true : void 0 - ); - } - function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { - const existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); - if (existingResult !== void 0) { - clearCache(); - return void 0; - } - const parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); - if (!parentResult) { - clearFirstAncestorEntry(fileOrDirectoryPath); - return void 0; - } - if (!host.directoryExists) { - clearCache(); - return void 0; - } - const baseName = getBaseNameOfFileName(fileOrDirectory); - const fsQueryResult = { - fileExists: host.fileExists(fileOrDirectory), - directoryExists: host.directoryExists(fileOrDirectory) - }; - if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) { - clearCache(); - } else { - updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); - } - return fsQueryResult; - } - function addOrDeleteFile(fileName, filePath, eventKind) { - if (eventKind === 1 /* Changed */) { - return; - } - const parentResult = getCachedFileSystemEntriesForBaseDir(filePath); - if (parentResult) { - updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === 0 /* Created */); - } else { - clearFirstAncestorEntry(filePath); - } - } - function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists2) { - const canonicalizedFiles = parentResult.sortedAndCanonicalizedFiles; - const canonicalizedBaseName = getCanonicalFileName(baseName); - if (fileExists2) { - if (insertSorted(canonicalizedFiles, canonicalizedBaseName, compareStringsCaseSensitive)) { - parentResult.files.push(baseName); - } - } else { - const sortedIndex = binarySearch(canonicalizedFiles, canonicalizedBaseName, identity, compareStringsCaseSensitive); - if (sortedIndex >= 0) { - canonicalizedFiles.splice(sortedIndex, 1); - const unsortedIndex = parentResult.files.findIndex((entry) => getCanonicalFileName(entry) === canonicalizedBaseName); - parentResult.files.splice(unsortedIndex, 1); - } - } - } - function clearCache() { - cachedReadDirectoryResult.clear(); - } -} -var ProgramUpdateLevel = /* @__PURE__ */ ((ProgramUpdateLevel2) => { - ProgramUpdateLevel2[ProgramUpdateLevel2["Update"] = 0] = "Update"; - ProgramUpdateLevel2[ProgramUpdateLevel2["RootNamesAndUpdate"] = 1] = "RootNamesAndUpdate"; - ProgramUpdateLevel2[ProgramUpdateLevel2["Full"] = 2] = "Full"; - return ProgramUpdateLevel2; -})(ProgramUpdateLevel || {}); -function updateSharedExtendedConfigFileWatcher(projectPath, options, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath3) { - var _a; - const extendedConfigs = arrayToMap(((_a = options == null ? void 0 : options.configFile) == null ? void 0 : _a.extendedSourceFiles) || emptyArray, toPath3); - extendedConfigFilesMap.forEach((watcher, extendedConfigFilePath) => { - if (!extendedConfigs.has(extendedConfigFilePath)) { - watcher.projects.delete(projectPath); - watcher.close(); - } - }); - extendedConfigs.forEach((extendedConfigFileName, extendedConfigFilePath) => { - const existing = extendedConfigFilesMap.get(extendedConfigFilePath); - if (existing) { - existing.projects.add(projectPath); - } else { - extendedConfigFilesMap.set(extendedConfigFilePath, { - projects: /* @__PURE__ */ new Set([projectPath]), - watcher: createExtendedConfigFileWatch(extendedConfigFileName, extendedConfigFilePath), - close: () => { - const existing2 = extendedConfigFilesMap.get(extendedConfigFilePath); - if (!existing2 || existing2.projects.size !== 0) return; - existing2.watcher.close(); - extendedConfigFilesMap.delete(extendedConfigFilePath); - } - }); - } - }); -} -function clearSharedExtendedConfigFileWatcher(projectPath, extendedConfigFilesMap) { - extendedConfigFilesMap.forEach((watcher) => { - if (watcher.projects.delete(projectPath)) watcher.close(); - }); -} -function cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath3) { - if (!extendedConfigCache.delete(extendedConfigFilePath)) return; - extendedConfigCache.forEach(({ extendedResult }, key) => { - var _a; - if ((_a = extendedResult.extendedSourceFiles) == null ? void 0 : _a.some((extendedFile) => toPath3(extendedFile) === extendedConfigFilePath)) { - cleanExtendedConfigCache(extendedConfigCache, key, toPath3); - } - }); -} -function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) { - mutateMap( - missingFileWatches, - program.getMissingFilePaths(), - { - // Watch the missing files - createNewValue: createMissingFileWatch, - // Files that are no longer missing (e.g. because they are no longer required) - // should no longer be watched. - onDeleteValue: closeFileWatcher - } - ); -} -function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) { - 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), - flags - }; - } - function updateWildcardDirectoryWatcher(existingWatcher, flags, directory) { - if (existingWatcher.flags === flags) { - return; - } - existingWatcher.watcher.close(); - existingWatchedForWildcards.set(directory, createWildcardDirectoryWatcher(directory, flags)); - } -} -function isIgnoredFileFromWildCardWatching({ - watchedDirPath, - fileOrDirectory, - fileOrDirectoryPath, - configFileName, - options, - program, - extraFileExtensions, - currentDirectory, - useCaseSensitiveFileNames: useCaseSensitiveFileNames2, - writeLog, - toPath: toPath3, - getScriptKind: getScriptKind2 -}) { - const newPath = removeIgnoredPath(fileOrDirectoryPath); - if (!newPath) { - writeLog(`Project: ${configFileName} Detected ignored path: ${fileOrDirectory}`); - return true; - } - fileOrDirectoryPath = newPath; - if (fileOrDirectoryPath === watchedDirPath) return false; - 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), useCaseSensitiveFileNames2, currentDirectory)) { - writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`); - return true; - } - if (!program) return false; - if (options.outFile || options.outDir) return false; - if (isDeclarationFileName(fileOrDirectoryPath)) { - if (options.declarationDir) return false; - } else if (!fileExtensionIsOneOf(fileOrDirectoryPath, supportedJSExtensionsFlat)) { - return false; - } - const filePathWithoutExtension = removeFileExtension(fileOrDirectoryPath); - const realProgram = isArray(program) ? void 0 : isBuilderProgram(program) ? program.getProgramOrUndefined() : program; - const builderProgram = !realProgram && !isArray(program) ? program : void 0; - if (hasSourceFile(filePathWithoutExtension + ".ts" /* Ts */) || hasSourceFile(filePathWithoutExtension + ".tsx" /* Tsx */)) { - writeLog(`Project: ${configFileName} Detected output file: ${fileOrDirectory}`); - return true; - } - return false; - function hasSourceFile(file) { - return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.state.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 isEmittedFileOfProgram(program, file) { - if (!program) { - return false; - } - return program.isEmittedFile(file); -} -var WatchLogLevel = /* @__PURE__ */ ((WatchLogLevel2) => { - WatchLogLevel2[WatchLogLevel2["None"] = 0] = "None"; - WatchLogLevel2[WatchLogLevel2["TriggerOnly"] = 1] = "TriggerOnly"; - WatchLogLevel2[WatchLogLevel2["Verbose"] = 2] = "Verbose"; - return WatchLogLevel2; -})(WatchLogLevel || {}); -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), - watchDirectory: (directory, callback, flags, options) => host.watchDirectory(directory, callback, (flags & 1 /* Recursive */) !== 0, options) - }; - const triggerInvokingFactory = watchLogLevel !== 0 /* None */ ? { - watchFile: createTriggerLoggingAddWatch("watchFile"), - watchDirectory: createTriggerLoggingAddWatch("watchDirectory") - } : void 0; - const factory2 = watchLogLevel === 2 /* Verbose */ ? { - watchFile: createFileWatcherWithLogging, - watchDirectory: createDirectoryWatcherWithLogging - } : triggerInvokingFactory || plainInvokeFactory; - const excludeWatcherFactory = watchLogLevel === 2 /* Verbose */ ? createExcludeWatcherWithLogging : returnNoopFileWatcher; - return { - watchFile: createExcludeHandlingAddWatch("watchFile"), - watchDirectory: createExcludeHandlingAddWatch("watchDirectory") - }; - 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, useCaseSensitiveFileNames2(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call( - /*thisArgs*/ - void 0, - file, - cb, - flags, - options, - detailInfo1, - detailInfo2 - ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2); - }; - } - 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, getDetailWatchInfo2)}`); - return { - 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, getDetailWatchInfo2)}`); - const watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2); - return { - close: () => { - 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, getDetailWatchInfo2)}`; - log(watchInfo); - const start = timestamp(); - const watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2); - const elapsed = timestamp() - start; - log(`Elapsed:: ${elapsed}ms ${watchInfo}`); - return { - close: () => { - const watchInfo2 = `DirectoryWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; - log(watchInfo2); - const start2 = timestamp(); - watcher.close(); - const elapsed2 = timestamp() - start2; - log(`Elapsed:: ${elapsed2}ms ${watchInfo2}`); - } - }; - } - function createTriggerLoggingAddWatch(key) { - return (file, cb, flags, options, detailInfo1, detailInfo2) => plainInvokeFactory[key].call( - /*thisArgs*/ - 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, getDetailWatchInfo2)}`; - log(triggerredInfo); - const start = timestamp(); - cb.call( - /*thisArg*/ - void 0, - ...args - ); - const elapsed = timestamp() - start; - log(`Elapsed:: ${elapsed}ms ${triggerredInfo}`); - }, - flags, - options, - 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) { - const fallbackPolling = options == null ? void 0 : options.fallbackPolling; - return { - watchFile: fallbackPolling !== void 0 ? fallbackPolling : 1 /* PriorityPollingInterval */ - }; -} -function closeFileWatcherOf(objWithWatcher) { - objWithWatcher.watcher.close(); -} - -// src/compiler/program.ts -function findConfigFile(searchPath, fileExists, configName = "tsconfig.json") { - return forEachAncestorDirectory(searchPath, (ancestor) => { - const fileName = combinePaths(ancestor, configName); - return fileExists(fileName) ? fileName : void 0; - }); -} -function resolveTripleslashReference(moduleName, containingFile) { - const basePath = getDirectoryPath(containingFile); - const referencedFileName = isRootedDiskPath(moduleName) ? moduleName : combinePaths(basePath, moduleName); - return normalizePath(referencedFileName); -} -function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) { - let commonPathComponents; - const failed2 = forEach(fileNames, (sourceFile) => { - const sourcePathComponents = getNormalizedPathComponents(sourceFile, currentDirectory); - sourcePathComponents.pop(); - if (!commonPathComponents) { - commonPathComponents = sourcePathComponents; - return; - } - const n = Math.min(commonPathComponents.length, sourcePathComponents.length); - for (let i = 0; i < n; i++) { - if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { - if (i === 0) { - return true; - } - commonPathComponents.length = i; - break; - } - } - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - }); - if (failed2) { - return ""; - } - if (!commonPathComponents) { - return currentDirectory; - } - return getPathFromPathComponents(commonPathComponents); -} -function createCompilerHost(options, setParentNodes) { - return createCompilerHostWorker(options, setParentNodes); -} -function createGetSourceFile(readFile, setParentNodes) { - return (fileName, languageVersionOrOptions, onError) => { - let text; - try { - mark("beforeIORead"); - text = readFile(fileName); - mark("afterIORead"); - measure("I/O Read", "beforeIORead", "afterIORead"); - } catch (e) { - if (onError) { - onError(e.message); - } - text = ""; - } - return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0; - }; -} -function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) { - return (fileName, data, writeByteOrderMark, onError) => { - try { - mark("beforeIOWrite"); - writeFileEnsuringDirectories( - fileName, - data, - writeByteOrderMark, - actualWriteFile, - createDirectory, - directoryExists - ); - mark("afterIOWrite"); - measure("I/O Write", "beforeIOWrite", "afterIOWrite"); - } catch (e) { - if (onError) { - onError(e.message); - } - } - }; -} -function createCompilerHostWorker(options, setParentNodes, system = sys) { - const existingDirectories = /* @__PURE__ */ new Map(); - const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames); - function directoryExists(directoryPath) { - if (existingDirectories.has(directoryPath)) { - return true; - } - if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) { - existingDirectories.set(directoryPath, true); - return true; - } - return false; - } - function getDefaultLibLocation() { - return getDirectoryPath(normalizePath(system.getExecutingFilePath())); - } - const newLine = getNewLineCharacter(options); - const realpath = system.realpath && ((path) => system.realpath(path)); - const compilerHost = { - getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), setParentNodes), - getDefaultLibLocation, - getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)), - writeFile: createWriteFileMeasuringIO( - (path, data, writeByteOrderMark) => system.writeFile(path, data, writeByteOrderMark), - (path) => (compilerHost.createDirectory || system.createDirectory)(path), - (path) => directoryExists(path) - ), - getCurrentDirectory: memoize(() => system.getCurrentDirectory()), - useCaseSensitiveFileNames: () => system.useCaseSensitiveFileNames, - getCanonicalFileName, - getNewLine: () => newLine, - fileExists: (fileName) => system.fileExists(fileName), - readFile: (fileName) => system.readFile(fileName), - trace: (s) => system.write(s + newLine), - directoryExists: (directoryName) => system.directoryExists(directoryName), - getEnvironmentVariable: (name) => system.getEnvironmentVariable ? system.getEnvironmentVariable(name) : "", - getDirectories: (path) => system.getDirectories(path), - realpath, - readDirectory: (path, extensions, include, exclude, depth) => system.readDirectory(path, extensions, include, exclude, depth), - createDirectory: (d) => system.createDirectory(d), - createHash: maybeBind(system, system.createHash) - }; - return compilerHost; -} -function changeCompilerHostLikeToUseCache(host, toPath3, getSourceFile) { - const originalReadFile = host.readFile; - const originalFileExists = host.fileExists; - const originalDirectoryExists = host.directoryExists; - const originalCreateDirectory = host.createDirectory; - const originalWriteFile = host.writeFile; - const readFileCache = /* @__PURE__ */ new Map(); - const fileExistsCache = /* @__PURE__ */ new Map(); - const directoryExistsCache = /* @__PURE__ */ new Map(); - const sourceFileCache = /* @__PURE__ */ new Map(); - const readFileWithCache = (fileName) => { - const key = toPath3(fileName); - const value = readFileCache.get(key); - if (value !== void 0) return value !== false ? value : void 0; - return setReadFileCache(key, fileName); - }; - const setReadFileCache = (key, fileName) => { - const newValue = originalReadFile.call(host, fileName); - readFileCache.set(key, newValue !== void 0 ? newValue : false); - return newValue; - }; - host.readFile = (fileName) => { - const key = toPath3(fileName); - const value = readFileCache.get(key); - if (value !== void 0) return value !== false ? value : void 0; - if (!fileExtensionIs(fileName, ".json" /* Json */) && !isBuildInfoFile(fileName)) { - return originalReadFile.call(host, fileName); - } - return setReadFileCache(key, fileName); - }; - const getSourceFileWithCache = getSourceFile ? (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => { - const key = toPath3(fileName); - const impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : void 0; - const forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat); - const value = forImpliedNodeFormat == null ? void 0 : forImpliedNodeFormat.get(key); - if (value) return value; - const sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile); - if (sourceFile && (isDeclarationFileName(fileName) || fileExtensionIs(fileName, ".json" /* Json */))) { - sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || /* @__PURE__ */ new Map()).set(key, sourceFile)); - } - return sourceFile; - } : void 0; - host.fileExists = (fileName) => { - const key = toPath3(fileName); - const value = fileExistsCache.get(key); - if (value !== void 0) return value; - const newValue = originalFileExists.call(host, fileName); - fileExistsCache.set(key, !!newValue); - return newValue; - }; - if (originalWriteFile) { - host.writeFile = (fileName, data, ...rest) => { - const key = toPath3(fileName); - fileExistsCache.delete(key); - const value = readFileCache.get(key); - if (value !== void 0 && value !== data) { - readFileCache.delete(key); - sourceFileCache.forEach((map2) => map2.delete(key)); - } else if (getSourceFileWithCache) { - sourceFileCache.forEach((map2) => { - const sourceFile = map2.get(key); - if (sourceFile && sourceFile.text !== data) { - map2.delete(key); - } - }); - } - originalWriteFile.call(host, fileName, data, ...rest); - }; - } - if (originalDirectoryExists) { - host.directoryExists = (directory) => { - const key = toPath3(directory); - const value = directoryExistsCache.get(key); - if (value !== void 0) return value; - const newValue = originalDirectoryExists.call(host, directory); - directoryExistsCache.set(key, !!newValue); - return newValue; - }; - if (originalCreateDirectory) { - host.createDirectory = (directory) => { - const key = toPath3(directory); - directoryExistsCache.delete(key); - originalCreateDirectory.call(host, directory); - }; - } - } - return { - originalReadFile, - originalFileExists, - originalDirectoryExists, - originalCreateDirectory, - originalWriteFile, - getSourceFileWithCache, - readFileWithCache - }; -} -function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { - let diagnostics; - diagnostics = addRange(diagnostics, program.getConfigFileParsingDiagnostics()); - diagnostics = addRange(diagnostics, program.getOptionsDiagnostics(cancellationToken)); - diagnostics = addRange(diagnostics, program.getSyntacticDiagnostics(sourceFile, cancellationToken)); - diagnostics = addRange(diagnostics, program.getGlobalDiagnostics(cancellationToken)); - diagnostics = addRange(diagnostics, program.getSemanticDiagnostics(sourceFile, cancellationToken)); - if (getEmitDeclarations(program.getCompilerOptions())) { - diagnostics = addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken)); - } - return sortAndDeduplicateDiagnostics(diagnostics || emptyArray); -} -function formatDiagnostics(diagnostics, host) { - let output = ""; - for (const diagnostic of diagnostics) { - output += formatDiagnostic(diagnostic, host); - } - return output; -} -function formatDiagnostic(diagnostic, host) { - const errorMessage = `${diagnosticCategoryName(diagnostic)} TS${diagnostic.code}: ${flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())}${host.getNewLine()}`; - if (diagnostic.file) { - const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); - const fileName = diagnostic.file.fileName; - const relativeFileName = convertToRelativePath(fileName, host.getCurrentDirectory(), (fileName2) => host.getCanonicalFileName(fileName2)); - return `${relativeFileName}(${line + 1},${character + 1}): ` + errorMessage; - } - return errorMessage; -} -var ForegroundColorEscapeSequences = /* @__PURE__ */ ((ForegroundColorEscapeSequences2) => { - ForegroundColorEscapeSequences2["Grey"] = "\x1B[90m"; - ForegroundColorEscapeSequences2["Red"] = "\x1B[91m"; - ForegroundColorEscapeSequences2["Yellow"] = "\x1B[93m"; - ForegroundColorEscapeSequences2["Blue"] = "\x1B[94m"; - ForegroundColorEscapeSequences2["Cyan"] = "\x1B[96m"; - return ForegroundColorEscapeSequences2; -})(ForegroundColorEscapeSequences || {}); -var gutterStyleSequence = "\x1B[7m"; -var gutterSeparator = " "; -var resetEscapeSequence = "\x1B[0m"; -var ellipsis = "..."; -var halfIndent = " "; -var indent = " "; -function getCategoryFormat(category) { - switch (category) { - case 1 /* Error */: - return "\x1B[91m" /* Red */; - case 0 /* Warning */: - return "\x1B[93m" /* Yellow */; - case 2 /* Suggestion */: - return Debug.fail("Should never get an Info diagnostic on the command line."); - case 3 /* Message */: - return "\x1B[94m" /* Blue */; - } -} -function formatColorAndReset(text, formatStyle) { - return formatStyle + text + resetEscapeSequence; -} -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; - const hasMoreThanFiveLines = lastLine - firstLine >= 4; - let gutterWidth = (lastLine + 1 + "").length; - if (hasMoreThanFiveLines) { - gutterWidth = Math.max(ellipsis.length, gutterWidth); - } - let context = ""; - for (let i = firstLine; i <= lastLine; i++) { - context += host.getNewLine(); - if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { - 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 = lineContent.trimEnd(); - lineContent = lineContent.replace(/\t/g, " "); - context += indent3 + formatColorAndReset((i + 1 + "").padStart(gutterWidth), gutterStyleSequence) + gutterSeparator; - context += lineContent + host.getNewLine(); - context += indent3 + formatColorAndReset("".padStart(gutterWidth), gutterStyleSequence) + gutterSeparator; - context += squiggleColor; - if (i === firstLine) { - const lastCharForLine = i === lastLine ? lastLineChar : void 0; - context += lineContent.slice(0, firstLineChar).replace(/\S/g, " "); - context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~"); - } else if (i === lastLine) { - context += lineContent.slice(0, lastLineChar).replace(/./g, "~"); - } else { - context += lineContent.replace(/./g, "~"); - } - context += resetEscapeSequence; - } - return context; -} -function formatLocation(file, start, host, color = formatColorAndReset) { - const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start); - const relativeFileName = host ? convertToRelativePath(file.fileName, host.getCurrentDirectory(), (fileName) => host.getCanonicalFileName(fileName)) : file.fileName; - let output = ""; - output += color(relativeFileName, "\x1B[96m" /* Cyan */); - output += ":"; - output += color(`${firstLine + 1}`, "\x1B[93m" /* Yellow */); - output += ":"; - output += color(`${firstLineChar + 1}`, "\x1B[93m" /* Yellow */); - return output; -} -function formatDiagnosticsWithColorAndContext(diagnostics, host) { - let output = ""; - for (const diagnostic of diagnostics) { - if (diagnostic.file) { - const { file, start } = diagnostic; - output += formatLocation(file, start, host); - output += " - "; - } - output += formatColorAndReset(diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category)); - output += formatColorAndReset(` TS${diagnostic.code}: `, "\x1B[90m" /* Grey */); - output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); - if (diagnostic.file && diagnostic.code !== Diagnostics.File_appears_to_be_binary.code) { - output += host.getNewLine(); - output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host); - } - if (diagnostic.relatedInformation) { - output += host.getNewLine(); - for (const { file, start, length: length2, messageText } of diagnostic.relatedInformation) { - if (file) { - output += host.getNewLine(); - output += halfIndent + formatLocation(file, start, host); - output += formatCodeSpan(file, start, length2, indent, "\x1B[96m" /* Cyan */, host); - } - output += host.getNewLine(); - output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine()); - } - } - output += host.getNewLine(); - } - return output; -} -function flattenDiagnosticMessageText(diag2, newLine, indent3 = 0) { - if (isString(diag2)) { - return diag2; - } else if (diag2 === void 0) { - return ""; - } - let result = ""; - if (indent3) { - result += newLine; - for (let i = 0; i < indent3; i++) { - result += " "; - } - } - result += diag2.messageText; - indent3++; - if (diag2.next) { - for (const kid of diag2.next) { - result += flattenDiagnosticMessageText(kid, newLine, indent3); - } - } - return result; -} -function getModeForFileReference(ref, containingFileMode) { - return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode; -} -function getModeForResolutionAtIndex(file, index, compilerOptions) { - return getModeForUsageLocationWorker(file, getModuleNameStringLiteralAt(file, index), compilerOptions); -} -function isExclusivelyTypeOnlyImportOrExport(decl) { - var _a; - if (isExportDeclaration(decl)) { - return decl.isTypeOnly; - } - if ((_a = decl.importClause) == null ? void 0 : _a.isTypeOnly) { - return true; - } - return false; -} -function getModeForUsageLocation(file, usage, compilerOptions) { - return getModeForUsageLocationWorker(file, usage, compilerOptions); -} -function getModeForUsageLocationWorker(file, usage, compilerOptions) { - if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent) || isJSDocImportTag(usage.parent)) { - const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent); - if (isTypeOnly) { - const override = getResolutionModeOverride(usage.parent.attributes); - if (override) { - return override; - } - } - } - if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) { - const override = getResolutionModeOverride(usage.parent.parent.attributes); - if (override) { - return override; - } - } - if (compilerOptions && importSyntaxAffectsModuleResolution(compilerOptions)) { - return getEmitSyntaxForUsageLocationWorker(file, usage, compilerOptions); - } -} -function getEmitSyntaxForUsageLocationWorker(file, usage, compilerOptions) { - var _a; - if (!compilerOptions) { - return void 0; - } - const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent; - if (exprParentParent && isImportEqualsDeclaration(exprParentParent) || isRequireCall( - usage.parent, - /*requireStringLiteralLikeArgument*/ - false - )) { - return 1 /* CommonJS */; - } - if (isImportCall(walkUpParenthesizedExpressions(usage.parent))) { - return shouldTransformImportCallWorker(file, compilerOptions) ? 1 /* CommonJS */ : 99 /* ESNext */; - } - const fileEmitMode = getEmitModuleFormatOfFileWorker(file, compilerOptions); - return fileEmitMode === 1 /* CommonJS */ ? 1 /* CommonJS */ : emitModuleKindIsNonNodeESM(fileEmitMode) || fileEmitMode === 200 /* Preserve */ ? 99 /* ESNext */ : void 0; -} -function getResolutionModeOverride(node, grammarErrorOnNode) { - if (!node) return void 0; - 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 = node.elements[0]; - if (!isStringLiteralLike(elem.name)) return void 0; - if (elem.name.text !== "resolution-mode") { - 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)) return void 0; - if (elem.value.text !== "import" && elem.value.text !== "require") { - grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(elem.value, Diagnostics.resolution_mode_should_be_either_require_or_import); - return void 0; - } - return elem.value.text === "import" ? 99 /* ESNext */ : 1 /* CommonJS */; -} -var emptyResolution = { - resolvedModule: void 0, - resolvedTypeReferenceDirective: void 0 -}; -function getModuleResolutionName(literal) { - return literal.text; -} -var moduleResolutionNameAndModeGetter = { - getName: getModuleResolutionName, - getMode: (entry, file, compilerOptions) => getModeForUsageLocation(file, entry, compilerOptions) -}; -function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) { - return { - nameAndMode: moduleResolutionNameAndModeGetter, - resolve: (moduleName, resolutionMode) => resolveModuleName( - moduleName, - containingFile, - options, - host, - cache, - redirectedReference, - resolutionMode - ) - }; -} -function getTypeReferenceResolutionName(entry) { - return !isString(entry) ? entry.fileName : entry; -} -var typeReferenceResolutionNameAndModeGetter = { - getName: getTypeReferenceResolutionName, - getMode: (entry, file, compilerOptions) => getModeForFileReference(entry, file && getDefaultResolutionModeForFileWorker(file, compilerOptions)) -}; -function createTypeReferenceResolutionLoader(containingFile, redirectedReference, options, host, cache) { - return { - nameAndMode: typeReferenceResolutionNameAndModeGetter, - resolve: (typeRef, resoluionMode) => resolveTypeReferenceDirective( - typeRef, - containingFile, - options, - host, - redirectedReference, - cache, - resoluionMode - ) - }; -} -function loadWithModeAwareCache(entries, containingFile, redirectedReference, options, containingSourceFile, host, resolutionCache, createLoader) { - if (entries.length === 0) return emptyArray; - const resolutions = []; - const cache = /* @__PURE__ */ new Map(); - 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, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options); - const key = createModeAwareCacheKey(name, mode); - let result = cache.get(key); - if (!result) { - cache.set(key, result = loader.resolve(name, mode)); - } - resolutions.push(result); - } - return resolutions; -} -var inferredTypesContainingFile = "__inferred type names__.ts"; -function getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName) { - const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : currentDirectory; - return combinePaths(containingDirectory, `__lib_node_modules_lookup_${libFileName}__.ts`); -} -function getLibraryNameFromLibFileName(libFileName) { - const components = libFileName.split("."); - let path = components[1]; - let i = 2; - while (components[i] && components[i] !== "d") { - path += (i === 2 ? "/" : "-") + components[i]; - i++; - } - return "@typescript/lib-" + path; -} -function isReferencedFile(reason) { - switch (reason == null ? void 0 : reason.kind) { - case 3 /* Import */: - case 4 /* ReferenceFile */: - case 5 /* TypeReferenceDirective */: - case 7 /* LibReferenceDirective */: - return true; - default: - return false; - } -} -function isReferenceFileLocation(location) { - return location.pos !== void 0; -} -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; - switch (kind) { - case 3 /* Import */: - const importLiteral = getModuleNameStringLiteralAt(file, index); - packageId = (_b = (_a = program.getResolvedModuleFromModuleSpecifier(importLiteral, file)) == 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); - end = importLiteral.end; - break; - case 4 /* ReferenceFile */: - ({ pos, end } = file.referencedFiles[index]); - break; - case 5 /* TypeReferenceDirective */: - ({ pos, end } = file.typeReferenceDirectives[index]); - packageId = (_d = (_c = program.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(file.typeReferenceDirectives[index], file)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId; - break; - case 7 /* LibReferenceDirective */: - ({ pos, end } = file.libReferenceDirectives[index]); - break; - default: - return Debug.assertNever(kind); - } - return { file, pos, end, packageId }; -} -function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) { - if (!program || (hasChangedAutomaticTypeDirectiveNames == null ? void 0 : hasChangedAutomaticTypeDirectiveNames())) return false; - if (!arrayIsEqualTo(program.getRootFileNames(), rootFileNames)) return false; - let seenResolvedRefs; - if (!arrayIsEqualTo(program.getProjectReferences(), projectReferences, projectReferenceUptoDate)) return false; - if (program.getSourceFiles().some(sourceFileNotUptoDate)) return false; - const missingPaths = program.getMissingFilePaths(); - if (missingPaths && forEachEntry(missingPaths, fileExists)) return false; - const currentOptions = program.getCompilerOptions(); - if (!compareDataObjects(currentOptions, newOptions)) return false; - if (program.resolvedLibReferences && forEachEntry(program.resolvedLibReferences, (_value, libFileName) => hasInvalidatedLibResolutions(libFileName))) return false; - if (currentOptions.configFile && newOptions.configFile) return currentOptions.configFile.text === newOptions.configFile.text; - return true; - function sourceFileNotUptoDate(sourceFile) { - return !sourceFileVersionUptoDate(sourceFile) || hasInvalidatedResolutions(sourceFile.path); - } - function sourceFileVersionUptoDate(sourceFile) { - return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName); - } - function projectReferenceUptoDate(oldRef, newRef, index) { - return projectReferenceIsEqualTo(oldRef, newRef) && resolvedProjectReferenceUptoDate(program.getResolvedProjectReferences()[index], oldRef); - } - function resolvedProjectReferenceUptoDate(oldResolvedRef, oldRef) { - if (oldResolvedRef) { - if (contains(seenResolvedRefs, oldResolvedRef)) return true; - const refPath2 = resolveProjectReferencePath(oldRef); - const newParsedCommandLine = getParsedCommandLine(refPath2); - if (!newParsedCommandLine) return false; - if (oldResolvedRef.commandLine.options.configFile !== newParsedCommandLine.options.configFile) return false; - if (!arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newParsedCommandLine.fileNames)) return false; - (seenResolvedRefs || (seenResolvedRefs = [])).push(oldResolvedRef); - return !forEach( - oldResolvedRef.references, - (childResolvedRef, index) => !resolvedProjectReferenceUptoDate( - childResolvedRef, - oldResolvedRef.commandLine.projectReferences[index] - ) - ); - } - const refPath = resolveProjectReferencePath(oldRef); - return !getParsedCommandLine(refPath); - } -} -function getConfigFileParsingDiagnostics(configFileParseResult) { - return configFileParseResult.options.configFile ? [...configFileParseResult.options.configFile.parseDiagnostics, ...configFileParseResult.errors] : configFileParseResult.errors; -} -function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) { - const result = getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options); - return typeof result === "object" ? result.impliedNodeFormat : result; -} -function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) { - const moduleResolution = getEmitModuleResolutionKind(options); - const shouldLookupFromPackageJson = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */ || pathContainsNodeModules(fileName); - return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : shouldLookupFromPackageJson && fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0; - function lookupFromPackageJson() { - const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options); - const packageJsonLocations = []; - state.failedLookupLocations = packageJsonLocations; - state.affectingLocations = packageJsonLocations; - const packageJsonScope = getPackageScopeForPath(getDirectoryPath(fileName), state); - const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 /* ESNext */ : 1 /* CommonJS */; - return { impliedNodeFormat, packageJsonLocations, packageJsonScope }; - } -} -var plainJSErrors = /* @__PURE__ */ new Set([ - // binder errors - Diagnostics.Cannot_redeclare_block_scoped_variable_0.code, - Diagnostics.A_module_cannot_have_multiple_default_exports.code, - Diagnostics.Another_export_default_is_here.code, - Diagnostics.The_first_export_default_is_here.code, - Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code, - Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code, - Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code, - Diagnostics.constructor_is_a_reserved_word.code, - Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code, - Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code, - Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code, - Diagnostics.Invalid_use_of_0_in_strict_mode.code, - Diagnostics.A_label_is_not_allowed_here.code, - Diagnostics.with_statements_are_not_allowed_in_strict_mode.code, - // grammar errors - Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code, - Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code, - Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code, - Diagnostics.A_class_member_cannot_have_the_0_keyword.code, - Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code, - Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code, - Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, - Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, - Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code, - Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code, - Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code, - Diagnostics.A_destructuring_declaration_must_have_an_initializer.code, - Diagnostics.A_get_accessor_cannot_have_parameters.code, - Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code, - Diagnostics.A_rest_element_cannot_have_a_property_name.code, - Diagnostics.A_rest_element_cannot_have_an_initializer.code, - Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code, - Diagnostics.A_rest_parameter_cannot_have_an_initializer.code, - Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code, - Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code, - Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code, - Diagnostics.A_set_accessor_cannot_have_rest_parameter.code, - Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code, - Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code, - Diagnostics.An_export_declaration_cannot_have_modifiers.code, - Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code, - Diagnostics.An_import_declaration_cannot_have_modifiers.code, - Diagnostics.An_object_member_cannot_be_declared_optional.code, - Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code, - Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code, - Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code, - Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code, - Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code, - Diagnostics.Classes_can_only_extend_a_single_class.code, - 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_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, - Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code, - Diagnostics.Jump_target_cannot_cross_function_boundary.code, - Diagnostics.Line_terminator_not_permitted_before_arrow.code, - Diagnostics.Modifiers_cannot_appear_here.code, - Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code, - Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code, - Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.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, - Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code, - Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code, - Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code, - Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code, - Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code, - Diagnostics.Trailing_comma_not_allowed.code, - Diagnostics.Variable_declaration_list_cannot_be_empty.code, - Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code, - Diagnostics._0_expected.code, - Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code, - Diagnostics._0_list_cannot_be_empty.code, - Diagnostics._0_modifier_already_seen.code, - Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code, - Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code, - Diagnostics._0_modifier_cannot_appear_on_a_parameter.code, - 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._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_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_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 -]); -function shouldProgramCreateNewSourceFiles(program, newOptions) { - if (!program) return false; - return optionsHaveChanges(program.getCompilerOptions(), newOptions, sourceFileAffectingCompilerOptions); -} -function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics, typeScriptVersion3) { - return { - rootNames, - options, - host, - oldProgram, - configFileParsingDiagnostics, - typeScriptVersion: typeScriptVersion3 - }; -} -function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; - let _createProgramOptions = isArray(_rootNamesOrOptions) ? createCreateProgramOptions(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : _rootNamesOrOptions; - const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3, host: createProgramOptionsHost } = _createProgramOptions; - let { oldProgram } = _createProgramOptions; - _createProgramOptions = void 0; - _rootNamesOrOptions = void 0; - for (const option of commandLineOptionOfCustomType) { - if (hasProperty(options, option.name)) { - if (typeof options[option.name] === "string") { - throw new Error(`${option.name} is a string value; tsconfig JSON must be parsed with parseJsonSourceFileConfigFileContent or getParsedCommandLineOfConfigFile before passing to createProgram`); - } - } - } - const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations)); - let processingDefaultLibFiles; - let processingOtherFiles; - let files; - let symlinks; - let typeChecker; - let classifiableNames; - let filesWithReferencesProcessed; - let cachedBindAndCheckDiagnosticsForFile; - let cachedDeclarationDiagnosticsForFile; - const programDiagnostics = createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax); - let automaticTypeDirectiveNames; - 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; - const modulesWithElidedImports = /* @__PURE__ */ new Map(); - const sourceFilesFoundSearchingNodeModules = /* @__PURE__ */ new Map(); - (_a = tracing) == null ? void 0 : _a.push( - tracing.Phase.Program, - "createProgram", - { configFilePath: options.configFilePath, rootDir: options.rootDir }, - /*separateBeginAndEnd*/ - true - ); - mark("beforeProgram"); - const host = createProgramOptionsHost || createCompilerHost(options); - const configParsingHost = parseConfigHostFromCompilerHostLike(host); - let skipDefaultLib = options.noLib; - const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options)); - const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName()); - let skipVerifyCompilerOptions = false; - const currentDirectory = host.getCurrentDirectory(); - const supportedExtensions = getSupportedExtensions(options); - const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions); - const hasEmitBlockingDiagnostics = /* @__PURE__ */ new Map(); - let _compilerOptionsObjectLiteralSyntax; - let _compilerOptionsPropertySyntax; - let moduleResolutionCache; - let actualResolveModuleNamesWorker; - const hasInvalidatedResolutions = host.hasInvalidatedResolutions || returnFalse; - if (host.resolveModuleNameLiterals) { - actualResolveModuleNamesWorker = host.resolveModuleNameLiterals.bind(host); - moduleResolutionCache = (_b = host.getModuleResolutionCache) == null ? void 0 : _b.call(host); - } else if (host.resolveModuleNames) { - actualResolveModuleNamesWorker = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile, reusedNames) => host.resolveModuleNames( - moduleNames.map(getModuleResolutionName), - containingFile, - reusedNames == null ? void 0 : reusedNames.map(getModuleResolutionName), - redirectedReference, - options2, - containingSourceFile - ).map( - (resolved) => resolved ? resolved.extension !== void 0 ? { resolvedModule: resolved } : ( - // An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName. - { resolvedModule: { ...resolved, extension: extensionFromPath(resolved.resolvedFileName) } } - ) : emptyResolution - ); - moduleResolutionCache = (_c = host.getModuleResolutionCache) == null ? void 0 : _c.call(host); - } else { - moduleResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName, options); - actualResolveModuleNamesWorker = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( - moduleNames, - containingFile, - redirectedReference, - options2, - containingSourceFile, - host, - moduleResolutionCache, - createModuleResolutionLoader - ); - } - let actualResolveTypeReferenceDirectiveNamesWorker; - if (host.resolveTypeReferenceDirectiveReferences) { - actualResolveTypeReferenceDirectiveNamesWorker = host.resolveTypeReferenceDirectiveReferences.bind(host); - } else if (host.resolveTypeReferenceDirectives) { - actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => host.resolveTypeReferenceDirectives( - typeDirectiveNames.map(getTypeReferenceResolutionName), - containingFile, - redirectedReference, - options2, - containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat - ).map((resolvedTypeReferenceDirective) => ({ resolvedTypeReferenceDirective })); - } else { - const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache( - currentDirectory, - getCanonicalFileName, - /*options*/ - void 0, - moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), - moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey - ); - actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( - typeDirectiveNames, - containingFile, - redirectedReference, - options2, - containingSourceFile, - host, - typeReferenceDirectiveResolutionCache, - createTypeReferenceResolutionLoader - ); - } - const hasInvalidatedLibResolutions = host.hasInvalidatedLibResolutions || returnFalse; - let actualResolveLibrary; - if (host.resolveLibrary) { - actualResolveLibrary = host.resolveLibrary.bind(host); - } else { - const libraryResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()); - actualResolveLibrary = (libraryName, resolveFrom, options2) => resolveLibrary(libraryName, resolveFrom, options2, host, libraryResolutionCache); - } - const packageIdToSourceFile = /* @__PURE__ */ new Map(); - let sourceFileToPackageName = /* @__PURE__ */ new Map(); - let redirectTargetsMap = createMultiMap(); - let usesUriStyleNodeCoreModules; - const filesByName = /* @__PURE__ */ new Map(); - let missingFileNames = /* @__PURE__ */ new Map(); - const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0; - let resolvedProjectReferences; - let projectReferenceRedirects; - let mapSourceFileToResolvedRef; - let mapOutputFileToResolvedRef; - const useSourceOfProjectReferenceRedirect = !!((_d = host.useSourceOfProjectReferenceRedirect) == null ? void 0 : _d.call(host)) && !options.disableSourceOfProjectReferenceRedirect; - const { onProgramCreateComplete, fileExists, directoryExists } = updateHostForUseSourceOfProjectReferenceRedirect({ - compilerHost: host, - getSymlinkCache, - useSourceOfProjectReferenceRedirect, - toPath: toPath3, - getResolvedProjectReferences, - getRedirectFromOutput, - forEachResolvedProjectReference: forEachResolvedProjectReference2 - }); - const readFile = host.readFile.bind(host); - (_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); - const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); - (_f = tracing) == null ? void 0 : _f.pop(); - let structureIsReused; - (_g = tracing) == null ? void 0 : _g.push(tracing.Phase.Program, "tryReuseStructureFromOldProgram", {}); - structureIsReused = tryReuseStructureFromOldProgram(); - (_h = tracing) == null ? void 0 : _h.pop(); - if (structureIsReused !== 2 /* Completely */) { - processingDefaultLibFiles = []; - processingOtherFiles = []; - if (projectReferences) { - if (!resolvedProjectReferences) { - resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - } - if (rootNames.length) { - resolvedProjectReferences == null ? void 0 : resolvedProjectReferences.forEach((parsedRef, index) => { - if (!parsedRef) return; - const out = parsedRef.commandLine.options.outFile; - if (useSourceOfProjectReferenceRedirect) { - if (out || getEmitModuleKind(parsedRef.commandLine.options) === 0 /* None */) { - for (const fileName of parsedRef.commandLine.fileNames) { - processProjectReferenceFile(fileName, { kind: 1 /* SourceFromProjectReference */, index }); - } - } - } else { - if (out) { - processProjectReferenceFile(changeExtension(out, ".d.ts"), { kind: 2 /* OutputFromProjectReference */, index }); - } else if (getEmitModuleKind(parsedRef.commandLine.options) === 0 /* None */) { - const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(parsedRef.commandLine, !host.useCaseSensitiveFileNames())); - for (const fileName of parsedRef.commandLine.fileNames) { - if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) { - processProjectReferenceFile(getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3), { kind: 2 /* OutputFromProjectReference */, index }); - } - } - } - } - }); - } - } - (_i = tracing) == null ? void 0 : _i.push(tracing.Phase.Program, "processRootFiles", { count: rootNames.length }); - forEach(rootNames, (name, index) => processRootFile( - name, - /*isDefaultLib*/ - false, - /*ignoreNoDefaultLib*/ - false, - { kind: 0 /* RootFile */, index } - )); - (_j = tracing) == null ? void 0 : _j.pop(); - automaticTypeDirectiveNames ?? (automaticTypeDirectiveNames = rootNames.length ? getAutomaticTypeDirectiveNames(options, host) : emptyArray); - automaticTypeDirectiveResolutions = createModeAwareCache(); - if (automaticTypeDirectiveNames.length) { - (_k = tracing) == null ? void 0 : _k.push(tracing.Phase.Program, "processTypeReferences", { count: automaticTypeDirectiveNames.length }); - const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : currentDirectory; - const containingFilename = combinePaths(containingDirectory, inferredTypesContainingFile); - const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState(automaticTypeDirectiveNames, containingFilename); - for (let i = 0; i < automaticTypeDirectiveNames.length; i++) { - automaticTypeDirectiveResolutions.set( - automaticTypeDirectiveNames[i], - /*mode*/ - void 0, - resolutions[i] - ); - processTypeReferenceDirective( - automaticTypeDirectiveNames[i], - /*mode*/ - void 0, - resolutions[i], - { - kind: 8 /* AutomaticTypeDirectiveFile */, - typeReference: automaticTypeDirectiveNames[i], - packageId: (_m = (_l = resolutions[i]) == null ? void 0 : _l.resolvedTypeReferenceDirective) == null ? void 0 : _m.packageId - } - ); - } - (_n = tracing) == null ? void 0 : _n.pop(); - } - if (rootNames.length && !skipDefaultLib) { - const defaultLibraryFileName = getDefaultLibraryFileName(); - if (!options.lib && defaultLibraryFileName) { - processRootFile( - defaultLibraryFileName, - /*isDefaultLib*/ - true, - /*ignoreNoDefaultLib*/ - false, - { kind: 6 /* LibFile */ } - ); - } else { - forEach(options.lib, (libFileName, index) => { - processRootFile( - pathForLibFile(libFileName), - /*isDefaultLib*/ - true, - /*ignoreNoDefaultLib*/ - false, - { kind: 6 /* LibFile */, index } - ); - }); - } - } - files = toSorted(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles); - processingDefaultLibFiles = void 0; - processingOtherFiles = void 0; - filesWithReferencesProcessed = void 0; - } - if (oldProgram && host.onReleaseOldSourceFile) { - const oldSourceFiles = oldProgram.getSourceFiles(); - for (const oldSourceFile of oldSourceFiles) { - const newFile = getSourceFileByPath(oldSourceFile.resolvedPath); - if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || // old file wasn't redirect but new file is - oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) { - host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path), newFile); - } - } - if (!host.getParsedCommandLine) { - oldProgram.forEachResolvedProjectReference((resolvedProjectReference) => { - if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { - host.onReleaseOldSourceFile( - resolvedProjectReference.sourceFile, - oldProgram.getCompilerOptions(), - /*hasSourceFileByPath*/ - false, - /*newSourceFileByResolvedPath*/ - void 0 - ); - } - }); - } - } - if (oldProgram && host.onReleaseParsedCommandLine) { - forEachProjectReference( - oldProgram.getProjectReferences(), - oldProgram.getResolvedProjectReferences(), - (oldResolvedRef, parent2, index) => { - const oldReference = (parent2 == null ? void 0 : parent2.commandLine.projectReferences[index]) || oldProgram.getProjectReferences()[index]; - const oldRefPath = resolveProjectReferencePath(oldReference); - if (!(projectReferenceRedirects == null ? void 0 : projectReferenceRedirects.has(toPath3(oldRefPath)))) { - host.onReleaseParsedCommandLine(oldRefPath, oldResolvedRef, oldProgram.getCompilerOptions()); - } - } - ); - } - oldProgram = void 0; - resolvedLibProcessing = void 0; - resolvedModulesProcessing = void 0; - resolvedTypeReferenceDirectiveNamesProcessing = void 0; - const program = { - getRootFileNames: () => rootNames, - getSourceFile, - getSourceFileByPath, - getSourceFiles: () => files, - getMissingFilePaths: () => missingFileNames, - getModuleResolutionCache: () => moduleResolutionCache, - getFilesByNameMap: () => filesByName, - getCompilerOptions: () => options, - getSyntacticDiagnostics, - getOptionsDiagnostics, - getGlobalDiagnostics, - getSemanticDiagnostics, - getCachedSemanticDiagnostics, - getSuggestionDiagnostics, - getDeclarationDiagnostics: getDeclarationDiagnostics2, - getBindAndCheckDiagnostics, - getProgramDiagnostics, - getTypeChecker, - getClassifiableNames, - getCommonSourceDirectory: getCommonSourceDirectory2, - emit, - getCurrentDirectory: () => currentDirectory, - getNodeCount: () => getTypeChecker().getNodeCount(), - getIdentifierCount: () => getTypeChecker().getIdentifierCount(), - getSymbolCount: () => getTypeChecker().getSymbolCount(), - getTypeCount: () => getTypeChecker().getTypeCount(), - getInstantiationCount: () => getTypeChecker().getInstantiationCount(), - getRelationCacheSizes: () => getTypeChecker().getRelationCacheSizes(), - getFileProcessingDiagnostics: () => programDiagnostics.getFileProcessingDiagnostics(), - getAutomaticTypeDirectiveNames: () => automaticTypeDirectiveNames, - getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions, - isSourceFileFromExternalLibrary, - isSourceFileDefaultLibrary, - getModeForUsageLocation: getModeForUsageLocation2, - getEmitSyntaxForUsageLocation, - getModeForResolutionAtIndex: getModeForResolutionAtIndex2, - getSourceFileFromReference, - getLibFileFromReference, - sourceFileToPackageName, - redirectTargetsMap, - usesUriStyleNodeCoreModules, - resolvedModules, - resolvedTypeReferenceDirectiveNames, - resolvedLibReferences, - getProgramDiagnosticsContainer: () => programDiagnostics, - getResolvedModule, - getResolvedModuleFromModuleSpecifier, - getResolvedTypeReferenceDirective, - getResolvedTypeReferenceDirectiveFromTypeReferenceDirective, - forEachResolvedModule, - forEachResolvedTypeReferenceDirective, - getCurrentPackagesMap: () => packageMap, - typesPackageExists, - packageBundlesTypes, - isEmittedFile, - getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2, - getProjectReferences, - getResolvedProjectReferences, - getRedirectFromSourceFile, - getResolvedProjectReferenceByPath, - forEachResolvedProjectReference: forEachResolvedProjectReference2, - isSourceOfProjectReferenceRedirect, - getRedirectFromOutput, - getCompilerOptionsForFile, - getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2, - getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2, - getImpliedNodeFormatForEmit: getImpliedNodeFormatForEmit2, - shouldTransformImportCall, - emitBuildInfo, - fileExists, - readFile, - directoryExists, - getSymlinkCache, - realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host), - useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), - getCanonicalFileName, - getFileIncludeReasons: () => programDiagnostics.getFileReasons(), - structureIsReused, - writeFile: writeFile2, - getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation) - }; - onProgramCreateComplete(); - if (!skipVerifyCompilerOptions) { - verifyCompilerOptions(); - } - mark("afterProgram"); - 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, sourceFile) { - sourceFile ?? (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 getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(typeRef, sourceFile) { - return getResolvedTypeReferenceDirective( - sourceFile, - typeRef.fileName, - getModeForTypeReferenceDirectiveInFile(typeRef, sourceFile) - ); - } - 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(); - 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; - } - function typesPackageExists(packageName) { - return getPackagesMap().has(getTypesPackageName(packageName)); - } - function packageBundlesTypes(packageName) { - return !!getPackagesMap().get(packageName); - } - function addResolutionDiagnostics(resolution) { - var _a2; - if (!((_a2 = resolution.resolutionDiagnostics) == null ? void 0 : _a2.length)) return; - programDiagnostics.addFileProcessingDiagnostic({ - kind: 2 /* ResolutionDiagnostics */, - diagnostics: resolution.resolutionDiagnostics - }); - } - function addResolutionDiagnosticsFromResolutionOrCache(containingFile, name, resolution, mode) { - if (host.resolveModuleNameLiterals || !host.resolveModuleNames) return addResolutionDiagnostics(resolution); - if (!moduleResolutionCache || isExternalModuleNameRelative(name)) return; - const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - const containingDir = getDirectoryPath(containingFileName); - const redirectedReference = getRedirectReferenceForResolution(containingFile); - const fromCache = moduleResolutionCache.getFromNonRelativeNameCache(name, mode, containingDir, redirectedReference); - if (fromCache) addResolutionDiagnostics(fromCache); - } - function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { - var _a2, _b2; - const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - const redirectedReference = getRedirectReferenceForResolution(containingFile); - (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Program, "resolveModuleNamesWorker", { containingFileName }); - mark("beforeResolveModule"); - const result = actualResolveModuleNamesWorker( - moduleNames, - containingFileName, - redirectedReference, - options, - containingFile, - reusedNames - ); - mark("afterResolveModule"); - measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); - (_b2 = tracing) == null ? void 0 : _b2.pop(); - return result; - } - function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, reusedNames) { - var _a2, _b2; - const containingSourceFile = !isString(containingFile) ? containingFile : void 0; - const containingFileName = !isString(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; - const redirectedReference = containingSourceFile && getRedirectReferenceForResolution(containingSourceFile); - (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Program, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName }); - mark("beforeResolveTypeReference"); - const result = actualResolveTypeReferenceDirectiveNamesWorker( - typeDirectiveNames, - containingFileName, - redirectedReference, - options, - containingSourceFile, - reusedNames - ); - mark("afterResolveTypeReference"); - measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); - (_b2 = tracing) == null ? void 0 : _b2.pop(); - return result; - } - function getRedirectReferenceForResolution(file) { - var _a2, _b2; - const redirect = getRedirectFromSourceFile(file.originalFileName); - if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect == null ? void 0 : redirect.resolvedRef; - const resultFromDts = (_a2 = getRedirectFromOutput(file.path)) == null ? void 0 : _a2.resolvedRef; - if (resultFromDts) return resultFromDts; - 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 : (_b2 = getRedirectFromOutput(realDeclarationPath)) == null ? void 0 : _b2.resolvedRef; - } - function compareDefaultLibFiles(a, b) { - return compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); - } - function getDefaultLibFilePriority(a) { - if (containsPath( - defaultLibraryPath, - a.fileName, - /*ignoreCase*/ - false - )) { - const basename = getBaseFileName(a.fileName); - if (basename === "lib.d.ts" || basename === "lib.es6.d.ts") return 0; - const name = removeSuffix(removePrefix(basename, "lib."), ".d.ts"); - const index = libs.indexOf(name); - if (index !== -1) return index + 1; - } - return libs.length + 2; - } - function toPath3(fileName) { - return toPath(fileName, currentDirectory, getCanonicalFileName); - } - function getCommonSourceDirectory2() { - let commonSourceDirectory = programDiagnostics.getCommonSourceDirectory(); - if (commonSourceDirectory !== void 0) { - return commonSourceDirectory; - } - const emittedFiles = filter(files, (file) => sourceFileMayBeEmitted(file, program)); - commonSourceDirectory = getCommonSourceDirectory( - options, - () => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName), - currentDirectory, - getCanonicalFileName, - (commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2) - ); - programDiagnostics.setCommonSourceDirectory(commonSourceDirectory); - return commonSourceDirectory; - } - function getClassifiableNames() { - var _a2; - if (!classifiableNames) { - getTypeChecker(); - classifiableNames = /* @__PURE__ */ new Set(); - for (const sourceFile of files) { - (_a2 = sourceFile.classifiableNames) == null ? void 0 : _a2.forEach((value) => classifiableNames.add(value)); - } - } - return classifiableNames; - } - function resolveModuleNamesReusingOldState(moduleNames, containingFile) { - return resolveNamesReusingOldState({ - entries: moduleNames, - containingFile, - containingSourceFile: containingFile, - redirectedReference: getRedirectReferenceForResolution(containingFile), - nameAndModeGetter: moduleResolutionNameAndModeGetter, - resolutionWorker: resolveModuleNamesWorker, - getResolutionFromOldProgram: (name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedModule(containingFile, name, mode), - getResolved: getResolvedModuleFromResolution, - canReuseResolutionsInFile: () => containingFile === (oldProgram == null ? void 0 : oldProgram.getSourceFile(containingFile.fileName)) && !hasInvalidatedResolutions(containingFile.path), - resolveToOwnAmbientModule: true - }); - } - function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) { - const containingSourceFile = !isString(containingFile) ? containingFile : void 0; - return resolveNamesReusingOldState({ - entries: typeDirectiveNames, - containingFile, - containingSourceFile, - redirectedReference: containingSourceFile && getRedirectReferenceForResolution(containingSourceFile), - nameAndModeGetter: typeReferenceResolutionNameAndModeGetter, - resolutionWorker: resolveTypeReferenceDirectiveNamesWorker, - getResolutionFromOldProgram: (name, mode) => { - var _a2; - return containingSourceFile ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingSourceFile, name, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(name, mode); - }, - getResolved: getResolvedTypeReferenceDirectiveFromResolution, - canReuseResolutionsInFile: () => containingSourceFile ? containingSourceFile === (oldProgram == null ? void 0 : oldProgram.getSourceFile(containingSourceFile.fileName)) && !hasInvalidatedResolutions(containingSourceFile.path) : !hasInvalidatedResolutions(toPath3(containingFile)) - }); - } - function resolveNamesReusingOldState({ - entries, - containingFile, - containingSourceFile, - redirectedReference, - nameAndModeGetter, - resolutionWorker, - getResolutionFromOldProgram, - getResolved, - canReuseResolutionsInFile, - resolveToOwnAmbientModule - }) { - if (!entries.length) return emptyArray; - if (structureIsReused === 0 /* Not */ && (!resolveToOwnAmbientModule || !containingSourceFile.ambientModuleNames.length)) { - return resolutionWorker( - entries, - containingFile, - /*reusedNames*/ - void 0 - ); - } - let unknownEntries; - let unknownEntryIndices; - let result; - let reusedNames; - const reuseResolutions = canReuseResolutionsInFile(); - for (let i = 0; i < entries.length; i++) { - const entry = entries[i]; - if (reuseResolutions) { - const name = nameAndModeGetter.getName(entry); - const mode = nameAndModeGetter.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) ?? options); - const oldResolution = getResolutionFromOldProgram(name, mode); - const oldResolved = oldResolution && getResolved(oldResolution); - if (oldResolved) { - if (isTraceEnabled(options, host)) { - trace( - host, - resolutionWorker === resolveModuleNamesWorker ? oldResolved.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 : oldResolved.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2, - name, - containingSourceFile ? getNormalizedAbsolutePath(containingSourceFile.originalFileName, currentDirectory) : containingFile, - oldResolved.resolvedFileName, - oldResolved.packageId && packageIdToString(oldResolved.packageId) - ); - } - (result ?? (result = new Array(entries.length)))[i] = oldResolution; - (reusedNames ?? (reusedNames = [])).push(entry); - continue; - } - } - if (resolveToOwnAmbientModule) { - const name = nameAndModeGetter.getName(entry); - if (contains(containingSourceFile.ambientModuleNames, name)) { - if (isTraceEnabled(options, host)) { - trace( - host, - Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, - name, - getNormalizedAbsolutePath(containingSourceFile.originalFileName, currentDirectory) - ); - } - (result ?? (result = new Array(entries.length)))[i] = emptyResolution; - continue; - } - } - (unknownEntries ?? (unknownEntries = [])).push(entry); - (unknownEntryIndices ?? (unknownEntryIndices = [])).push(i); - } - if (!unknownEntries) return result; - const resolutions = resolutionWorker(unknownEntries, containingFile, reusedNames); - if (!result) return resolutions; - resolutions.forEach((resolution, index) => result[unknownEntryIndices[index]] = resolution); - return result; - } - function canReuseProjectReferences() { - return !forEachProjectReference( - oldProgram.getProjectReferences(), - oldProgram.getResolvedProjectReferences(), - (oldResolvedRef, parent2, index) => { - const newRef = (parent2 ? parent2.commandLine.projectReferences : projectReferences)[index]; - const newResolvedRef = parseProjectReferenceConfigFile(newRef); - if (oldResolvedRef) { - return !newResolvedRef || newResolvedRef.sourceFile !== oldResolvedRef.sourceFile || !arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newResolvedRef.commandLine.fileNames); - } else { - return newResolvedRef !== void 0; - } - }, - (oldProjectReferences, parent2) => { - const newReferences = parent2 ? getResolvedProjectReferenceByPath(parent2.sourceFile.path).commandLine.projectReferences : projectReferences; - return !arrayIsEqualTo(oldProjectReferences, newReferences, projectReferenceIsEqualTo); - } - ); - } - function tryReuseStructureFromOldProgram() { - var _a2; - if (!oldProgram) { - return 0 /* Not */; - } - const oldOptions = oldProgram.getCompilerOptions(); - if (changesAffectModuleResolution(oldOptions, options)) { - return 0 /* Not */; - } - const oldRootNames = oldProgram.getRootFileNames(); - if (!arrayIsEqualTo(oldRootNames, rootNames)) { - return 0 /* Not */; - } - if (!canReuseProjectReferences()) { - return 0 /* Not */; - } - if (projectReferences) { - resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); - } - const newSourceFiles = []; - const modifiedSourceFiles = []; - structureIsReused = 2 /* Completely */; - if (forEachEntry(oldProgram.getMissingFilePaths(), (missingFileName) => host.fileExists(missingFileName))) { - return 0 /* Not */; - } - const oldSourceFiles = oldProgram.getSourceFiles(); - let SeenPackageName; - ((SeenPackageName2) => { - SeenPackageName2[SeenPackageName2["Exists"] = 0] = "Exists"; - SeenPackageName2[SeenPackageName2["Modified"] = 1] = "Modified"; - })(SeenPackageName || (SeenPackageName = {})); - const seenPackageNames = /* @__PURE__ */ new Map(); - for (const oldSourceFile of oldSourceFiles) { - const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options); - let newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath( - oldSourceFile.fileName, - oldSourceFile.resolvedPath, - sourceFileOptions, - /*onError*/ - void 0, - shouldCreateNewSourceFile - ) : host.getSourceFile( - oldSourceFile.fileName, - sourceFileOptions, - /*onError*/ - void 0, - shouldCreateNewSourceFile - ); - if (!newSourceFile) { - return 0 /* Not */; - } - newSourceFile.packageJsonLocations = ((_a2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a2.length) ? sourceFileOptions.packageJsonLocations : void 0; - newSourceFile.packageJsonScope = sourceFileOptions.packageJsonScope; - Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); - let fileChanged; - if (oldSourceFile.redirectInfo) { - if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { - return 0 /* Not */; - } - fileChanged = false; - newSourceFile = oldSourceFile; - } else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { - if (newSourceFile !== oldSourceFile) { - return 0 /* Not */; - } - fileChanged = false; - } else { - fileChanged = newSourceFile !== oldSourceFile; - } - newSourceFile.path = oldSourceFile.path; - newSourceFile.originalFileName = oldSourceFile.originalFileName; - newSourceFile.resolvedPath = oldSourceFile.resolvedPath; - newSourceFile.fileName = oldSourceFile.fileName; - const packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); - if (packageName !== void 0) { - const prevKind = seenPackageNames.get(packageName); - const newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; - if (prevKind !== void 0 && newKind === 1 /* Modified */ || prevKind === 1 /* Modified */) { - return 0 /* Not */; - } - seenPackageNames.set(packageName, newKind); - } - if (fileChanged) { - if (oldSourceFile.impliedNodeFormat !== newSourceFile.impliedNodeFormat) { - structureIsReused = 1 /* SafeModules */; - } else if (!arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { - structureIsReused = 1 /* SafeModules */; - } else if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { - structureIsReused = 1 /* SafeModules */; - } else if (!arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { - structureIsReused = 1 /* SafeModules */; - } else { - collectExternalModuleReferences(newSourceFile); - if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { - structureIsReused = 1 /* SafeModules */; - } else if (!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { - structureIsReused = 1 /* SafeModules */; - } 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(newSourceFile); - } else if (hasInvalidatedResolutions(oldSourceFile.path)) { - structureIsReused = 1 /* SafeModules */; - modifiedSourceFiles.push(newSourceFile); - } - newSourceFiles.push(newSourceFile); - } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; - } - for (const newSourceFile of modifiedSourceFiles) { - const moduleNames = getModuleNames(newSourceFile); - const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); - (resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions); - const optionsForFile = getCompilerOptionsForFile(newSourceFile); - const resolutionsChanged = hasChangesInResolutions( - moduleNames, - resolutions, - (name) => oldProgram.getResolvedModule(newSourceFile, name.text, getModeForUsageLocationWorker(newSourceFile, name, optionsForFile)), - moduleResolutionIsEqualTo - ); - if (resolutionsChanged) structureIsReused = 1 /* SafeModules */; - const typesReferenceDirectives = newSourceFile.typeReferenceDirectives; - const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile); - (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions); - const typeReferenceResolutionsChanged = hasChangesInResolutions( - typesReferenceDirectives, - typeReferenceResolutions, - (name) => oldProgram.getResolvedTypeReferenceDirective( - newSourceFile, - getTypeReferenceResolutionName(name), - getModeForTypeReferenceDirectiveInFile(name, newSourceFile) - ), - typeDirectiveIsEqualTo - ); - if (typeReferenceResolutionsChanged) structureIsReused = 1 /* SafeModules */; - } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; - } - if (changesAffectingProgramStructure(oldOptions, options)) { - return 1 /* SafeModules */; - } - if (oldProgram.resolvedLibReferences && forEachEntry(oldProgram.resolvedLibReferences, (resolution, libFileName) => pathForLibFileWorker(libFileName).actual !== resolution.actual)) { - return 1 /* SafeModules */; - } - if (host.hasChangedAutomaticTypeDirectiveNames) { - if (host.hasChangedAutomaticTypeDirectiveNames()) return 1 /* SafeModules */; - } else { - automaticTypeDirectiveNames = getAutomaticTypeDirectiveNames(options, host); - if (!arrayIsEqualTo(oldProgram.getAutomaticTypeDirectiveNames(), automaticTypeDirectiveNames)) return 1 /* SafeModules */; - } - missingFileNames = oldProgram.getMissingFilePaths(); - Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length); - for (const newSourceFile of newSourceFiles) { - filesByName.set(newSourceFile.path, newSourceFile); - } - const oldFilesByNameMap = oldProgram.getFilesByNameMap(); - oldFilesByNameMap.forEach((oldFile, path) => { - if (!oldFile) { - filesByName.set(path, oldFile); - return; - } - if (oldFile.path === path) { - if (oldProgram.isSourceFileFromExternalLibrary(oldFile)) { - sourceFilesFoundSearchingNodeModules.set(oldFile.path, true); - } - return; - } - filesByName.set(path, filesByName.get(oldFile.path)); - }); - const isConfigIdentical = oldOptions.configFile && oldOptions.configFile === options.configFile || !oldOptions.configFile && !options.configFile && !optionsHaveChanges(oldOptions, options, optionDeclarations); - programDiagnostics.reuseStateFromOldProgram(oldProgram.getProgramDiagnosticsContainer(), isConfigIdentical); - skipVerifyCompilerOptions = isConfigIdentical; - files = newSourceFiles; - automaticTypeDirectiveNames = oldProgram.getAutomaticTypeDirectiveNames(); - automaticTypeDirectiveResolutions = oldProgram.getAutomaticTypeDirectiveResolutions(); - sourceFileToPackageName = oldProgram.sourceFileToPackageName; - redirectTargetsMap = oldProgram.redirectTargetsMap; - usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules; - resolvedModules = oldProgram.resolvedModules; - resolvedTypeReferenceDirectiveNames = oldProgram.resolvedTypeReferenceDirectiveNames; - resolvedLibReferences = oldProgram.resolvedLibReferences; - packageMap = oldProgram.getCurrentPackagesMap(); - return 2 /* Completely */; - } - function getEmitHost(writeFileCallback) { - return { - getCanonicalFileName, - getCommonSourceDirectory: program.getCommonSourceDirectory, - getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: () => currentDirectory, - getSourceFile: program.getSourceFile, - getSourceFileByPath: program.getSourceFileByPath, - getSourceFiles: program.getSourceFiles, - isSourceFileFromExternalLibrary, - getRedirectFromSourceFile, - isSourceOfProjectReferenceRedirect, - getSymlinkCache, - writeFile: writeFileCallback || writeFile2, - isEmitBlocked, - shouldTransformImportCall, - getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2, - getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2, - getModeForResolutionAtIndex: getModeForResolutionAtIndex2, - readFile: (f) => host.readFile(f), - fileExists: (f) => { - const path = toPath3(f); - if (getSourceFileByPath(path)) return true; - if (missingFileNames.has(path)) return false; - return host.fileExists(f); - }, - realpath: maybeBind(host, host.realpath), - useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), - getBuildInfo: () => { - var _a2; - return (_a2 = program.getBuildInfo) == null ? void 0 : _a2.call(program); - }, - getSourceFileFromReference: (file, ref) => program.getSourceFileFromReference(file, ref), - redirectTargetsMap, - getFileIncludeReasons: program.getFileIncludeReasons, - createHash: maybeBind(host, host.createHash), - getModuleResolutionCache: () => program.getModuleResolutionCache(), - trace: maybeBind(host, host.trace), - getGlobalTypingsCacheLocation: program.getGlobalTypingsCacheLocation - }; - } - function writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data) { - host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); - } - function emitBuildInfo(writeFileCallback) { - var _a2, _b2; - (_a2 = tracing) == null ? void 0 : _a2.push( - tracing.Phase.Emit, - "emitBuildInfo", - {}, - /*separateBeginAndEnd*/ - true - ); - mark("beforeEmit"); - const emitResult = emitFiles( - notImplementedResolver, - getEmitHost(writeFileCallback), - /*targetSourceFile*/ - void 0, - /*transformers*/ - noTransformers, - /*emitOnly*/ - false, - /*onlyBuildInfo*/ - true - ); - mark("afterEmit"); - measure("Emit", "beforeEmit", "afterEmit"); - (_b2 = tracing) == null ? void 0 : _b2.pop(); - return emitResult; - } - function getResolvedProjectReferences() { - return resolvedProjectReferences; - } - function getProjectReferences() { - return projectReferences; - } - function isSourceFileFromExternalLibrary(file) { - return !!sourceFilesFoundSearchingNodeModules.get(file.path); - } - function isSourceFileDefaultLibrary(file) { - if (!file.isDeclarationFile) { - return false; - } - if (file.hasNoDefaultLib) { - return true; - } - if (options.noLib) { - return false; - } - const equalityComparer = host.useCaseSensitiveFileNames() ? equateStringsCaseSensitive : equateStringsCaseInsensitive; - if (!options.lib) { - return equalityComparer(file.fileName, getDefaultLibraryFileName()); - } else { - return some(options.lib, (libFileName) => { - const resolvedLib = resolvedLibReferences.get(libFileName); - return !!resolvedLib && equalityComparer(file.fileName, resolvedLib.actual); - }); - } - } - function getTypeChecker() { - return typeChecker || (typeChecker = createTypeChecker(program)); - } - function emit(sourceFile, writeFileCallback, cancellationToken, emitOnly, transformers, forceDtsEmit, skipBuildInfo) { - var _a2, _b2; - (_a2 = tracing) == null ? void 0 : _a2.push( - tracing.Phase.Emit, - "emit", - { path: sourceFile == null ? void 0 : sourceFile.path }, - /*separateBeginAndEnd*/ - true - ); - const result = runWithCancellationToken( - () => emitWorker( - program, - sourceFile, - writeFileCallback, - cancellationToken, - emitOnly, - transformers, - forceDtsEmit, - skipBuildInfo - ) - ); - (_b2 = tracing) == null ? void 0 : _b2.pop(); - return result; - } - function isEmitBlocked(emitFileName) { - return hasEmitBlockingDiagnostics.has(toPath3(emitFileName)); - } - function emitWorker(program2, sourceFile, writeFileCallback, cancellationToken, emitOnly, customTransformers, forceDtsEmit, skipBuildInfo) { - if (!forceDtsEmit) { - const result = handleNoEmitOptions(program2, sourceFile, writeFileCallback, cancellationToken); - if (result) return result; - } - const typeChecker2 = getTypeChecker(); - const emitResolver = typeChecker2.getEmitResolver( - options.outFile ? void 0 : sourceFile, - cancellationToken, - emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit) - ); - mark("beforeEmit"); - const emitResult = typeChecker2.runWithCancellationToken( - cancellationToken, - () => emitFiles( - emitResolver, - getEmitHost(writeFileCallback), - sourceFile, - getTransformers(options, customTransformers, emitOnly), - emitOnly, - /*onlyBuildInfo*/ - false, - forceDtsEmit, - skipBuildInfo - ) - ); - mark("afterEmit"); - measure("Emit", "beforeEmit", "afterEmit"); - return emitResult; - } - function getSourceFile(fileName) { - return getSourceFileByPath(toPath3(fileName)); - } - function getSourceFileByPath(path) { - return filesByName.get(path) || void 0; - } - function getDiagnosticsHelper(sourceFile, getDiagnostics2, cancellationToken) { - if (sourceFile) { - return sortAndDeduplicateDiagnostics(getDiagnostics2(sourceFile, cancellationToken)); - } - return sortAndDeduplicateDiagnostics(flatMap(program.getSourceFiles(), (sourceFile2) => { - if (cancellationToken) { - cancellationToken.throwIfCancellationRequested(); - } - return getDiagnostics2(sourceFile2, cancellationToken); - })); - } - function getSyntacticDiagnostics(sourceFile, cancellationToken) { - return getDiagnosticsHelper(sourceFile, getSyntacticDiagnosticsForFile, cancellationToken); - } - function getSemanticDiagnostics(sourceFile, cancellationToken, nodesToCheck) { - return getDiagnosticsHelper( - sourceFile, - (sourceFile2, cancellationToken2) => getSemanticDiagnosticsForFile(sourceFile2, cancellationToken2, nodesToCheck), - cancellationToken - ); - } - function getCachedSemanticDiagnostics(sourceFile) { - return cachedBindAndCheckDiagnosticsForFile == null ? void 0 : cachedBindAndCheckDiagnosticsForFile.get(sourceFile.path); - } - function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { - return getBindAndCheckDiagnosticsForFile( - sourceFile, - cancellationToken, - /*nodesToCheck*/ - void 0 - ); - } - function getProgramDiagnostics(sourceFile) { - var _a2; - if (skipTypeChecking(sourceFile, options, program)) { - return emptyArray; - } - const programDiagnosticsInFile = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(sourceFile.fileName); - if (!((_a2 = sourceFile.commentDirectives) == null ? void 0 : _a2.length)) { - return programDiagnosticsInFile; - } - return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, programDiagnosticsInFile).diagnostics; - } - function getDeclarationDiagnostics2(sourceFile, cancellationToken) { - return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken); - } - function getSyntacticDiagnosticsForFile(sourceFile) { - if (isSourceFileJS(sourceFile)) { - if (!sourceFile.additionalSyntacticDiagnostics) { - sourceFile.additionalSyntacticDiagnostics = getJSSyntacticDiagnosticsForFile(sourceFile); - } - return concatenate(sourceFile.additionalSyntacticDiagnostics, sourceFile.parseDiagnostics); - } - return sourceFile.parseDiagnostics; - } - function runWithCancellationToken(func) { - try { - return func(); - } catch (e) { - if (e instanceof OperationCanceledException) { - typeChecker = void 0; - } - throw e; - } - } - function getSemanticDiagnosticsForFile(sourceFile, cancellationToken, nodesToCheck) { - return concatenate( - filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken, nodesToCheck), options), - getProgramDiagnostics(sourceFile) - ); - } - function getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken, nodesToCheck) { - if (nodesToCheck) { - return getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck); - } - let result = cachedBindAndCheckDiagnosticsForFile == null ? void 0 : cachedBindAndCheckDiagnosticsForFile.get(sourceFile.path); - if (!result) { - (cachedBindAndCheckDiagnosticsForFile ?? (cachedBindAndCheckDiagnosticsForFile = /* @__PURE__ */ new Map())).set( - sourceFile.path, - result = getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken) - ); - } - return result; - } - function getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck) { - return runWithCancellationToken(() => { - if (skipTypeChecking(sourceFile, options, program)) { - return emptyArray; - } - const typeChecker2 = getTypeChecker(); - Debug.assert(!!sourceFile.bindDiagnostics); - const isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */; - const isPlainJs = isPlainJsFile(sourceFile, options.checkJs); - const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options); - let bindDiagnostics = sourceFile.bindDiagnostics; - let checkDiagnostics = typeChecker2.getDiagnostics(sourceFile, cancellationToken, nodesToCheck); - if (isPlainJs) { - bindDiagnostics = filter(bindDiagnostics, (d) => plainJSErrors.has(d.code)); - checkDiagnostics = filter(checkDiagnostics, (d) => plainJSErrors.has(d.code)); - } - return getMergedBindAndCheckDiagnostics( - sourceFile, - !isPlainJs, - !!nodesToCheck, - bindDiagnostics, - checkDiagnostics, - isCheckJs ? sourceFile.jsDocDiagnostics : void 0 - ); - }); - } - function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, partialCheck, ...allDiagnostics) { - var _a2; - const flatDiagnostics = flatten(allDiagnostics); - if (!includeBindAndCheckDiagnostics || !((_a2 = sourceFile.commentDirectives) == null ? void 0 : _a2.length)) { - return flatDiagnostics; - } - const { diagnostics, directives } = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics); - if (partialCheck) { - return diagnostics; - } - for (const errorExpectation of directives.getUnusedExpectations()) { - diagnostics.push(createDiagnosticForRange(sourceFile, errorExpectation.range, Diagnostics.Unused_ts_expect_error_directive)); - } - return diagnostics; - } - function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { - const directives = createCommentDirectivesMap(sourceFile, commentDirectives); - const diagnostics = flatDiagnostics.filter((diagnostic) => markPrecedingCommentDirectiveLine(diagnostic, directives) === -1); - return { diagnostics, directives }; - } - function getSuggestionDiagnostics(sourceFile, cancellationToken) { - return runWithCancellationToken(() => { - return getTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); - }); - } - function markPrecedingCommentDirectiveLine(diagnostic, directives) { - const { file, start } = diagnostic; - if (!file) { - return -1; - } - const lineStarts = getLineStarts(file); - let line = computeLineAndCharacterOfPosition(lineStarts, start).line - 1; - while (line >= 0) { - if (directives.markUsed(line)) { - return line; - } - const lineText = file.text.slice(lineStarts[line], lineStarts[line + 1]).trim(); - if (lineText !== "" && !/^\s*\/\/.*$/.test(lineText)) { - return -1; - } - line--; - } - return -1; - } - function getJSSyntacticDiagnosticsForFile(sourceFile) { - return runWithCancellationToken(() => { - const diagnostics = []; - walk(sourceFile, sourceFile); - forEachChildRecursively(sourceFile, walk, walkArray); - return diagnostics; - function walk(node, parent2) { - switch (parent2.kind) { - case 170 /* Parameter */: - case 173 /* PropertyDeclaration */: - case 175 /* MethodDeclaration */: - if (parent2.questionToken === node) { - diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); - return "skip"; - } - // falls through - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 220 /* ArrowFunction */: - case 261 /* 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 274 /* ImportClause */: - if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); - return "skip"; - } - break; - case 279 /* ExportDeclaration */: - if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); - return "skip"; - } - break; - case 277 /* ImportSpecifier */: - case 282 /* 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 272 /* ImportEqualsDeclaration */: - diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files)); - return "skip"; - case 278 /* ExportAssignment */: - if (node.isExportEquals) { - diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files)); - return "skip"; - } - break; - case 299 /* 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 265 /* 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 268 /* 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 266 /* TypeAliasDeclaration */: - diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); - return "skip"; - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 263 /* FunctionDeclaration */: - if (!node.body) { - diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files)); - return "skip"; - } - return; - case 267 /* 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 236 /* NonNullExpression */: - diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); - return "skip"; - case 235 /* AsExpression */: - diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); - return "skip"; - case 239 /* SatisfiesExpression */: - diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)); - return "skip"; - case 217 /* TypeAssertionExpression */: - Debug.fail(); - } - } - function walkArray(nodes, parent2) { - if (canHaveIllegalDecorators(parent2)) { - const decorator = find(parent2.modifiers, isDecorator); - if (decorator) { - diagnostics.push(createDiagnosticForNode2(decorator, Diagnostics.Decorators_are_not_valid_here)); - } - } else if (canHaveDecorators(parent2) && parent2.modifiers) { - const decoratorIndex = findIndex(parent2.modifiers, isDecorator); - if (decoratorIndex >= 0) { - if (isParameter(parent2) && !options.experimentalDecorators) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); - } else if (isClassDeclaration(parent2)) { - const exportIndex = findIndex(parent2.modifiers, isExportModifier); - if (exportIndex >= 0) { - const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier); - if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) { - diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); - } else if (exportIndex >= 0 && decoratorIndex < exportIndex) { - const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex); - if (trailingDecoratorIndex >= 0) { - diagnostics.push(addRelatedInfo( - createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), - createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here) - )); - } - } - } - } - } - } - switch (parent2.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 220 /* ArrowFunction */: - if (nodes === parent2.typeParameters) { - diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); - return "skip"; - } - // falls through - case 244 /* VariableStatement */: - if (nodes === parent2.modifiers) { - checkModifiers(parent2.modifiers, parent2.kind === 244 /* VariableStatement */); - return "skip"; - } - break; - case 173 /* PropertyDeclaration */: - if (nodes === parent2.modifiers) { - for (const modifier of nodes) { - if (isModifier(modifier) && modifier.kind !== 126 /* StaticKeyword */ && modifier.kind !== 129 /* AccessorKeyword */) { - diagnostics.push(createDiagnosticForNode2(modifier, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, tokenToString(modifier.kind))); - } - } - return "skip"; - } - break; - case 170 /* 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 214 /* CallExpression */: - case 215 /* NewExpression */: - case 234 /* ExpressionWithTypeArguments */: - case 286 /* JsxSelfClosingElement */: - case 287 /* JsxOpeningElement */: - case 216 /* TaggedTemplateExpression */: - if (nodes === parent2.typeArguments) { - diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); - return "skip"; - } - break; - } - } - function checkModifiers(modifiers, isConstValid) { - for (const modifier of modifiers) { - switch (modifier.kind) { - case 87 /* ConstKeyword */: - if (isConstValid) { - continue; - } - // to report error, - // falls through - case 125 /* PublicKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - case 148 /* ReadonlyKeyword */: - case 138 /* DeclareKeyword */: - case 128 /* AbstractKeyword */: - 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))); - break; - // These are all legal modifiers. - case 126 /* StaticKeyword */: - case 95 /* ExportKeyword */: - case 90 /* DefaultKeyword */: - case 129 /* AccessorKeyword */: - } - } - } - function createDiagnosticForNodeArray2(nodes, message, ...args) { - const start = nodes.pos; - return createFileDiagnostic(sourceFile, start, nodes.end - start, message, ...args); - } - function createDiagnosticForNode2(node, message, ...args) { - return createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args); - } - }); - } - function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { - let result = cachedDeclarationDiagnosticsForFile == null ? void 0 : cachedDeclarationDiagnosticsForFile.get(sourceFile.path); - if (!result) { - (cachedDeclarationDiagnosticsForFile ?? (cachedDeclarationDiagnosticsForFile = /* @__PURE__ */ new Map())).set( - sourceFile.path, - result = getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) - ); - } - return result; - } - function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { - return runWithCancellationToken(() => { - const resolver = getTypeChecker().getEmitResolver(sourceFile, cancellationToken); - return getDeclarationDiagnostics(getEmitHost(noop), resolver, sourceFile) || emptyArray; - }); - } - function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { - return sourceFile.isDeclarationFile ? emptyArray : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); - } - function getOptionsDiagnostics() { - return sortAndDeduplicateDiagnostics(concatenate( - programDiagnostics.getCombinedDiagnostics(program).getGlobalDiagnostics(), - getOptionsDiagnosticsOfConfigFile() - )); - } - function getOptionsDiagnosticsOfConfigFile() { - if (!options.configFile) return emptyArray; - let diagnostics = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(options.configFile.fileName); - forEachResolvedProjectReference2((resolvedRef) => { - diagnostics = concatenate(diagnostics, programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(resolvedRef.sourceFile.fileName)); - }); - return diagnostics; - } - function getGlobalDiagnostics() { - return rootNames.length ? sortAndDeduplicateDiagnostics(getTypeChecker().getGlobalDiagnostics().slice()) : emptyArray; - } - function getConfigFileParsingDiagnostics2() { - return configFileParsingDiagnostics || emptyArray; - } - function processRootFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason) { - processSourceFile( - normalizePath(fileName), - isDefaultLib, - ignoreNoDefaultLib, - /*packageId*/ - void 0, - reason - ); - } - function fileReferenceIsEqualTo(a, b) { - return a.fileName === b.fileName; - } - function moduleNameIsEqualTo(a, b) { - return a.kind === 80 /* Identifier */ ? b.kind === 80 /* Identifier */ && a.escapedText === b.escapedText : b.kind === 11 /* StringLiteral */ && a.text === b.text; - } - function createSyntheticImport(text, file) { - const externalHelpersModuleReference = factory.createStringLiteral(text); - const importDecl = factory.createImportDeclaration( - /*modifiers*/ - void 0, - /*importClause*/ - void 0, - externalHelpersModuleReference - ); - addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */); - setParent(externalHelpersModuleReference, importDecl); - setParent(importDecl, file); - externalHelpersModuleReference.flags &= ~16 /* Synthesized */; - importDecl.flags &= ~16 /* Synthesized */; - return externalHelpersModuleReference; - } - function collectExternalModuleReferences(file) { - if (file.imports) { - return; - } - const isJavaScriptFile = isSourceFileJS(file); - const isExternalModuleFile = isExternalModule(file); - let imports; - let moduleAugmentations; - let ambientModules; - if (isJavaScriptFile || !file.isDeclarationFile && (getIsolatedModules(options) || isExternalModule(file))) { - if (options.importHelpers) { - imports = [createSyntheticImport(externalHelpersModuleNameText, file)]; - } - const jsxImport = getJSXRuntimeImport(getJSXImplicitImportBase(options, file), options); - if (jsxImport) { - (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); - } - } - for (const node of file.statements) { - collectModuleReferences( - node, - /*inAmbientModule*/ - false - ); - } - if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) { - forEachDynamicImportOrRequireCall( - file, - /*includeTypeSpaceImports*/ - true, - /*requireStringLiteralLikeArgument*/ - true, - (node, moduleSpecifier) => { - setParentRecursive( - node, - /*incremental*/ - false - ); - imports = append(imports, moduleSpecifier); - } - ); - } - file.imports = imports || emptyArray; - file.moduleAugmentations = moduleAugmentations || emptyArray; - file.ambientModuleNames = ambientModules || emptyArray; - return; - function collectModuleReferences(node, inAmbientModule) { - if (isAnyImportOrReExport(node)) { - const moduleNameExpr = getExternalModuleName(node); - if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text && (!inAmbientModule || !isExternalModuleNameRelative(moduleNameExpr.text))) { - setParentRecursive( - node, - /*incremental*/ - false - ); - imports = append(imports, moduleNameExpr); - if (!usesUriStyleNodeCoreModules && currentNodeModulesDepth === 0 && !file.isDeclarationFile) { - if (startsWith(moduleNameExpr.text, "node:") && !exclusivelyPrefixedNodeCoreModules.has(moduleNameExpr.text)) { - usesUriStyleNodeCoreModules = true; - } else if (usesUriStyleNodeCoreModules === void 0 && unprefixedNodeCoreModules.has(moduleNameExpr.text)) { - usesUriStyleNodeCoreModules = false; - } - } - } - } else if (isModuleDeclaration(node)) { - if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node, 128 /* Ambient */) || file.isDeclarationFile)) { - node.name.parent = node; - const nameText = getTextOfIdentifierOrLiteral(node.name); - if (isExternalModuleFile || inAmbientModule && !isExternalModuleNameRelative(nameText)) { - (moduleAugmentations || (moduleAugmentations = [])).push(node.name); - } else if (!inAmbientModule) { - if (file.isDeclarationFile) { - (ambientModules || (ambientModules = [])).push(nameText); - } - const body = node.body; - if (body) { - for (const statement of body.statements) { - collectModuleReferences( - statement, - /*inAmbientModule*/ - true - ); - } - } - } - } - } - } - } - function getLibFileFromReference(ref) { - var _a2; - const libFileName = getLibFileNameFromLibReference(ref); - const actualFileName = libFileName && ((_a2 = resolvedLibReferences == null ? void 0 : resolvedLibReferences.get(libFileName)) == null ? void 0 : _a2.actual); - return actualFileName !== void 0 ? getSourceFile(actualFileName) : void 0; - } - function getSourceFileFromReference(referencingFile, ref) { - return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), getSourceFile); - } - function getSourceFileFromReferenceWorker(fileName, getSourceFile2, fail, reason) { - if (hasExtension(fileName)) { - const canonicalFileName = host.getCanonicalFileName(fileName); - if (!options.allowNonTsExtensions && !forEach(flatten(supportedExtensionsWithJsonIfResolveJsonModule), (extension) => fileExtensionIs(canonicalFileName, extension))) { - if (fail) { - if (hasJSFileExtension(canonicalFileName)) { - fail(Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, fileName); - } else { - fail(Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, "'" + flatten(supportedExtensions).join("', '") + "'"); - } - } - return void 0; - } - const sourceFile = getSourceFile2(fileName); - if (fail) { - if (!sourceFile) { - const redirect = getRedirectFromSourceFile(fileName); - if (redirect == null ? void 0 : redirect.outputDts) { - fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, fileName); - } else { - fail(Diagnostics.File_0_not_found, fileName); - } - } else if (isReferencedFile(reason) && canonicalFileName === host.getCanonicalFileName(getSourceFileByPath(reason.file).fileName)) { - fail(Diagnostics.A_file_cannot_have_a_reference_to_itself); - } - } - return sourceFile; - } else { - const sourceFileNoExtension = options.allowNonTsExtensions && getSourceFile2(fileName); - if (sourceFileNoExtension) return sourceFileNoExtension; - if (fail && options.allowNonTsExtensions) { - fail(Diagnostics.File_0_not_found, fileName); - return void 0; - } - const sourceFileWithAddedExtension = forEach(supportedExtensions[0], (extension) => getSourceFile2(fileName + extension)); - if (fail && !sourceFileWithAddedExtension) fail(Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + flatten(supportedExtensions).join("', '") + "'"); - return sourceFileWithAddedExtension; - } - } - function processSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, packageId, reason) { - getSourceFileFromReferenceWorker( - fileName, - (fileName2) => findSourceFile(fileName2, isDefaultLib, ignoreNoDefaultLib, reason, packageId), - // TODO: GH#18217 - (diagnostic, ...args) => addFilePreprocessingFileExplainingDiagnostic( - /*file*/ - void 0, - reason, - diagnostic, - args - ), - reason - ); - } - function processProjectReferenceFile(fileName, reason) { - return processSourceFile( - fileName, - /*isDefaultLib*/ - false, - /*ignoreNoDefaultLib*/ - false, - /*packageId*/ - void 0, - reason - ); - } - function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) { - const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(programDiagnostics.getFileReasons().get(existingFile.path), isReferencedFile); - if (hasExistingReasonToReportErrorOn) { - addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]); - } else { - addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, [fileName, existingFile.fileName]); - } - } - function createRedirectedSourceFile(redirectTarget, unredirected, fileName, path, resolvedPath, originalFileName, sourceFileOptions) { - var _a2; - const redirect = parseNodeFactory.createRedirectedSourceFile({ redirectTarget, unredirected }); - redirect.fileName = fileName; - redirect.path = path; - redirect.resolvedPath = resolvedPath; - redirect.originalFileName = originalFileName; - redirect.packageJsonLocations = ((_a2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a2.length) ? sourceFileOptions.packageJsonLocations : void 0; - redirect.packageJsonScope = sourceFileOptions.packageJsonScope; - sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); - return redirect; - } - function findSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { - var _a2, _b2; - (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Program, "findSourceFile", { - fileName, - isDefaultLib: isDefaultLib || void 0, - fileIncludeKind: FileIncludeKind[reason.kind] - }); - const result = findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId); - (_b2 = tracing) == null ? void 0 : _b2.pop(); - return result; - } - function getCreateSourceFileOptions(fileName, moduleResolutionCache2, host2, options2) { - 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, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode }; - } - function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { - var _a2, _b2; - const path = toPath3(fileName); - if (useSourceOfProjectReferenceRedirect) { - let source = getRedirectFromOutput(path); - if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) { - const realPath2 = toPath3(host.realpath(fileName)); - if (realPath2 !== path) source = getRedirectFromOutput(realPath2); - } - if (source == null ? void 0 : source.source) { - const file2 = findSourceFile(source.source, isDefaultLib, ignoreNoDefaultLib, reason, packageId); - if (file2) addFileToFilesByName( - file2, - path, - fileName, - /*redirectedPath*/ - void 0 - ); - return file2; - } - } - const originalFileName = fileName; - if (filesByName.has(path)) { - const file2 = filesByName.get(path); - const addedReason = addFileIncludeReason( - file2 || void 0, - reason, - /*checkExisting*/ - true - ); - if (file2 && addedReason && !(options.forceConsistentCasingInFileNames === false)) { - const checkedName = file2.fileName; - const isRedirect = toPath3(checkedName) !== toPath3(fileName); - if (isRedirect) { - fileName = ((_a2 = getRedirectFromSourceFile(fileName)) == null ? void 0 : _a2.outputDts) || fileName; - } - const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory); - const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory); - if (checkedAbsolutePath !== inputAbsolutePath) { - reportFileNamesDifferOnlyInCasingError(fileName, file2, reason); - } - } - if (file2 && sourceFilesFoundSearchingNodeModules.get(file2.path) && currentNodeModulesDepth === 0) { - sourceFilesFoundSearchingNodeModules.set(file2.path, false); - if (!options.noResolve) { - processReferencedFiles(file2, isDefaultLib); - processTypeReferenceDirectives(file2); - } - if (!options.noLib) { - processLibReferenceDirectives(file2); - } - modulesWithElidedImports.set(file2.path, false); - processImportedModules(file2); - } else if (file2 && modulesWithElidedImports.get(file2.path)) { - if (currentNodeModulesDepth < maxNodeModuleJsDepth) { - modulesWithElidedImports.set(file2.path, false); - processImportedModules(file2); - } - } - return file2 || void 0; - } - let redirectedPath; - if (!useSourceOfProjectReferenceRedirect) { - const redirectProject = getRedirectFromSourceFile(fileName); - if (redirectProject == null ? void 0 : redirectProject.outputDts) { - if (redirectProject.resolvedRef.commandLine.options.outFile) { - return void 0; - } - fileName = redirectProject.outputDts; - redirectedPath = toPath3(redirectProject.outputDts); - } - } - const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options); - const file = host.getSourceFile( - fileName, - sourceFileOptions, - (hostErrorMessage) => addFilePreprocessingFileExplainingDiagnostic( - /*file*/ - void 0, - reason, - Diagnostics.Cannot_read_file_0_Colon_1, - [fileName, hostErrorMessage] - ), - shouldCreateNewSourceFile - ); - if (packageId) { - const packageIdKey = packageIdToString(packageId); - const fileFromPackageId = packageIdToSourceFile.get(packageIdKey); - if (fileFromPackageId) { - const dupFile = createRedirectedSourceFile(fileFromPackageId, file, fileName, path, toPath3(fileName), originalFileName, sourceFileOptions); - redirectTargetsMap.add(fileFromPackageId.path, fileName); - addFileToFilesByName(dupFile, path, fileName, redirectedPath); - addFileIncludeReason( - dupFile, - reason, - /*checkExisting*/ - false - ); - sourceFileToPackageName.set(path, packageIdToPackageName(packageId)); - processingOtherFiles.push(dupFile); - return dupFile; - } else if (file) { - packageIdToSourceFile.set(packageIdKey, file); - sourceFileToPackageName.set(path, packageIdToPackageName(packageId)); - } - } - 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.packageJsonScope = sourceFileOptions.packageJsonScope; - addFileIncludeReason( - file, - reason, - /*checkExisting*/ - false - ); - if (host.useCaseSensitiveFileNames()) { - const pathLowerCase = toFileNameLowerCase(path); - const existingFile = filesByNameIgnoreCase.get(pathLowerCase); - if (existingFile) { - reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason); - } else { - filesByNameIgnoreCase.set(pathLowerCase, file); - } - } - skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib && !ignoreNoDefaultLib; - if (!options.noResolve) { - processReferencedFiles(file, isDefaultLib); - processTypeReferenceDirectives(file); - } - if (!options.noLib) { - processLibReferenceDirectives(file); - } - processImportedModules(file); - if (isDefaultLib) { - processingDefaultLibFiles.push(file); - } else { - processingOtherFiles.push(file); - } - (filesWithReferencesProcessed ?? (filesWithReferencesProcessed = /* @__PURE__ */ new Set())).add(file.path); - } - return file; - } - function addFileIncludeReason(file, reason, checkExisting) { - if (file && (!checkExisting || !isReferencedFile(reason) || !(filesWithReferencesProcessed == null ? void 0 : filesWithReferencesProcessed.has(reason.file)))) { - programDiagnostics.getFileReasons().add(file.path, reason); - return true; - } - return false; - } - function addFileToFilesByName(file, path, fileName, redirectedPath) { - if (redirectedPath) { - updateFilesByNameMap(fileName, redirectedPath, file); - updateFilesByNameMap(fileName, path, file || false); - } else { - 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 getRedirectFromSourceFile(fileName) { - return mapSourceFileToResolvedRef == null ? void 0 : mapSourceFileToResolvedRef.get(toPath3(fileName)); - } - function forEachResolvedProjectReference2(cb) { - return forEachResolvedProjectReference(resolvedProjectReferences, cb); - } - function getRedirectFromOutput(path) { - return mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.get(path); - } - function isSourceOfProjectReferenceRedirect(fileName) { - return useSourceOfProjectReferenceRedirect && !!getRedirectFromSourceFile(fileName); - } - function getResolvedProjectReferenceByPath(projectReferencePath) { - if (!projectReferenceRedirects) { - return void 0; - } - return projectReferenceRedirects.get(projectReferencePath) || void 0; - } - function processReferencedFiles(file, isDefaultLib) { - forEach(file.referencedFiles, (ref, index) => { - processSourceFile( - resolveTripleslashReference(ref.fileName, file.fileName), - isDefaultLib, - /*ignoreNoDefaultLib*/ - false, - /*packageId*/ - void 0, - { kind: 4 /* ReferenceFile */, file: file.path, index } - ); - }); - } - function processTypeReferenceDirectives(file) { - const typeDirectives = file.typeReferenceDirectives; - if (!typeDirectives.length) return; - 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 = ref.fileName; - const mode = getModeForTypeReferenceDirectiveInFile(ref, file); - resolutionsInFile.set(fileName, mode, resolvedTypeReferenceDirective); - processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index }); - } - } - function getCompilerOptionsForFile(file) { - var _a2; - return ((_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options) || options; - } - function processTypeReferenceDirective(typeReferenceDirective, mode, resolution, reason) { - var _a2, _b2; - (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Program, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolution.resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : void 0 }); - processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolution, reason); - (_b2 = tracing) == null ? void 0 : _b2.pop(); - } - function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolution, reason) { - addResolutionDiagnostics(resolution); - const { resolvedTypeReferenceDirective } = resolution; - if (resolvedTypeReferenceDirective) { - if (resolvedTypeReferenceDirective.isExternalLibraryImport) currentNodeModulesDepth++; - processSourceFile( - resolvedTypeReferenceDirective.resolvedFileName, - /*isDefaultLib*/ - false, - /*ignoreNoDefaultLib*/ - false, - resolvedTypeReferenceDirective.packageId, - reason - ); - if (resolvedTypeReferenceDirective.isExternalLibraryImport) currentNodeModulesDepth--; - } else { - addFilePreprocessingFileExplainingDiagnostic( - /*file*/ - void 0, - reason, - Diagnostics.Cannot_find_type_definition_file_for_0, - [typeReferenceDirective] - ); - } - } - function pathForLibFile(libFileName) { - const existing = resolvedLibReferences == null ? void 0 : resolvedLibReferences.get(libFileName); - if (existing) return existing.actual; - const result = pathForLibFileWorker(libFileName); - (resolvedLibReferences ?? (resolvedLibReferences = /* @__PURE__ */ new Map())).set(libFileName, result); - return result.actual; - } - function pathForLibFileWorker(libFileName) { - var _a2, _b2, _c2, _d2, _e2; - const existing = resolvedLibProcessing == null ? void 0 : resolvedLibProcessing.get(libFileName); - if (existing) return existing; - if (options.libReplacement === false) { - const result2 = { - resolution: { - resolvedModule: void 0 - }, - actual: combinePaths(defaultLibraryPath, libFileName) - }; - (resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result2); - return result2; - } - if (structureIsReused !== 0 /* Not */ && oldProgram && !hasInvalidatedLibResolutions(libFileName)) { - const oldResolution = (_a2 = oldProgram.resolvedLibReferences) == null ? void 0 : _a2.get(libFileName); - if (oldResolution) { - if (oldResolution.resolution && isTraceEnabled(options, host)) { - const libraryName2 = getLibraryNameFromLibFileName(libFileName); - const resolveFrom2 = getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName); - trace( - host, - oldResolution.resolution.resolvedModule ? oldResolution.resolution.resolvedModule.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, - libraryName2, - getNormalizedAbsolutePath(resolveFrom2, currentDirectory), - (_b2 = oldResolution.resolution.resolvedModule) == null ? void 0 : _b2.resolvedFileName, - ((_c2 = oldResolution.resolution.resolvedModule) == null ? void 0 : _c2.packageId) && packageIdToString(oldResolution.resolution.resolvedModule.packageId) - ); - } - (resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, oldResolution); - return oldResolution; - } - } - const libraryName = getLibraryNameFromLibFileName(libFileName); - const resolveFrom = getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName); - (_d2 = tracing) == null ? void 0 : _d2.push(tracing.Phase.Program, "resolveLibrary", { resolveFrom }); - mark("beforeResolveLibrary"); - const resolution = actualResolveLibrary(libraryName, resolveFrom, options, libFileName); - mark("afterResolveLibrary"); - measure("ResolveLibrary", "beforeResolveLibrary", "afterResolveLibrary"); - (_e2 = tracing) == null ? void 0 : _e2.pop(); - const result = { - resolution, - actual: resolution.resolvedModule ? resolution.resolvedModule.resolvedFileName : combinePaths(defaultLibraryPath, libFileName) - }; - (resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result); - return result; - } - function processLibReferenceDirectives(file) { - forEach(file.libReferenceDirectives, (libReference, index) => { - const libFileName = getLibFileNameFromLibReference(libReference); - if (libFileName) { - processRootFile( - pathForLibFile(libFileName), - /*isDefaultLib*/ - true, - /*ignoreNoDefaultLib*/ - true, - { kind: 7 /* LibReferenceDirective */, file: file.path, index } - ); - } else { - programDiagnostics.addFileProcessingDiagnostic({ - kind: 0 /* FilePreprocessingLibReferenceDiagnostic */, - reason: { kind: 7 /* LibReferenceDirective */, file: file.path, index } - }); - } - }); - } - function getCanonicalFileName(fileName) { - return host.getCanonicalFileName(fileName); - } - function processImportedModules(file) { - collectExternalModuleReferences(file); - if (file.imports.length || file.moduleAugmentations.length) { - const moduleNames = getModuleNames(file); - const resolutions = (resolvedModulesProcessing == null ? void 0 : resolvedModulesProcessing.get(file.path)) || resolveModuleNamesReusingOldState(moduleNames, file); - Debug.assert(resolutions.length === moduleNames.length); - const optionsForFile = getCompilerOptionsForFile(file); - 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 = 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) && !getRedirectFromSourceFile(resolution.resolvedFileName); - 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 & 16777216 /* JSDoc */)); - if (elideImport) { - modulesWithElidedImports.set(file.path, true); - } else if (shouldAddFile) { - findSourceFile( - resolvedFileName, - /*isDefaultLib*/ - false, - /*ignoreNoDefaultLib*/ - false, - { kind: 3 /* Import */, file: file.path, index }, - resolution.packageId - ); - } - if (isFromNodeModulesSearch) { - currentNodeModulesDepth--; - } - } - } - } - function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { - let allFilesBelongToPath = true; - const absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (const sourceFile of sourceFiles) { - if (!sourceFile.isDeclarationFile) { - const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); - if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { - programDiagnostics.addLazyConfigDiagnostic( - sourceFile, - Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, - sourceFile.fileName, - rootDirectory - ); - allFilesBelongToPath = false; - } - } - } - return allFilesBelongToPath; - } - function parseProjectReferenceConfigFile(ref) { - if (!projectReferenceRedirects) { - projectReferenceRedirects = /* @__PURE__ */ new Map(); - } - const refPath = resolveProjectReferencePath(ref); - const sourceFilePath = toPath3(refPath); - const fromCache = projectReferenceRedirects.get(sourceFilePath); - if (fromCache !== void 0) { - return fromCache || void 0; - } - let commandLine; - let sourceFile; - if (host.getParsedCommandLine) { - commandLine = host.getParsedCommandLine(refPath); - if (!commandLine) { - addFileToFilesByName( - /*file*/ - void 0, - sourceFilePath, - refPath, - /*redirectedPath*/ - void 0 - ); - projectReferenceRedirects.set(sourceFilePath, false); - return void 0; - } - sourceFile = Debug.checkDefined(commandLine.options.configFile); - Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath); - addFileToFilesByName( - sourceFile, - sourceFilePath, - refPath, - /*redirectedPath*/ - void 0 - ); - } else { - const basePath = getNormalizedAbsolutePath(getDirectoryPath(refPath), currentDirectory); - sourceFile = host.getSourceFile(refPath, 100 /* JSON */); - addFileToFilesByName( - sourceFile, - sourceFilePath, - refPath, - /*redirectedPath*/ - void 0 - ); - if (sourceFile === void 0) { - projectReferenceRedirects.set(sourceFilePath, false); - return void 0; - } - commandLine = parseJsonSourceFileConfigFileContent( - sourceFile, - configParsingHost, - basePath, - /*existingOptions*/ - void 0, - refPath - ); - } - sourceFile.fileName = refPath; - sourceFile.path = sourceFilePath; - sourceFile.resolvedPath = sourceFilePath; - sourceFile.originalFileName = refPath; - const resolvedRef = { commandLine, sourceFile }; - projectReferenceRedirects.set(sourceFilePath, resolvedRef); - if (options.configFile !== sourceFile) { - mapSourceFileToResolvedRef ?? (mapSourceFileToResolvedRef = /* @__PURE__ */ new Map()); - mapOutputFileToResolvedRef ?? (mapOutputFileToResolvedRef = /* @__PURE__ */ new Map()); - let outDts; - if (commandLine.options.outFile) { - outDts = changeExtension(commandLine.options.outFile, ".d.ts" /* Dts */); - mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.set(toPath3(outDts), { resolvedRef }); - } - const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); - commandLine.fileNames.forEach((fileName) => { - if (isDeclarationFileName(fileName)) return; - const path = toPath3(fileName); - let outputDts; - if (!fileExtensionIs(fileName, ".json" /* Json */)) { - if (!commandLine.options.outFile) { - outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); - mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName }); - } else { - outputDts = outDts; - } - } - mapSourceFileToResolvedRef.set(path, { resolvedRef, outputDts }); - }); - } - if (commandLine.projectReferences) { - resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile); - } - return resolvedRef; - } - function verifyCompilerOptions() { - if (options.strictPropertyInitialization && !getStrictOptionValue(options, "strictNullChecks")) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks"); - } - if (options.exactOptionalPropertyTypes && !getStrictOptionValue(options, "strictNullChecks")) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"); - } - if (options.isolatedModules || options.verbatimModuleSyntax) { - if (options.outFile) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); - } - } - if (options.isolatedDeclarations) { - if (getAllowJSCompilerOption(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "isolatedDeclarations"); - } - if (!getEmitDeclarations(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "isolatedDeclarations", "declaration", "composite"); - } - } - if (options.inlineSourceMap) { - if (options.sourceMap) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceMap", "inlineSourceMap"); - } - if (options.mapRoot) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); - } - } - if (options.composite) { - if (options.declaration === false) { - createDiagnosticForOptionName(Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); - } - if (options.incremental === false) { - createDiagnosticForOptionName(Diagnostics.Composite_projects_may_not_disable_incremental_compilation, "declaration"); - } - } - const outputFile = options.outFile; - if (!options.tsBuildInfoFile && options.incremental && !outputFile && !options.configFilePath) { - programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); - } - verifyDeprecatedCompilerOptions(); - verifyProjectReferences(); - if (options.composite) { - const rootPaths = new Set(rootNames.map(toPath3)); - for (const file of files) { - if (sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) { - programDiagnostics.addLazyConfigDiagnostic( - file, - Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, - file.fileName, - options.configFilePath || "" - ); - } - } - } - if (options.paths) { - for (const key in options.paths) { - if (!hasProperty(options.paths, key)) { - continue; - } - if (!hasZeroOrOneAsteriskCharacter(key)) { - createDiagnosticForOptionPaths( - /*onKey*/ - true, - key, - Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, - key - ); - } - if (isArray(options.paths[key])) { - const len = options.paths[key].length; - if (len === 0) { - createDiagnosticForOptionPaths( - /*onKey*/ - false, - key, - Diagnostics.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array, - key - ); - } - for (let i = 0; i < len; i++) { - const subst = options.paths[key][i]; - const typeOfSubst = typeof subst; - if (typeOfSubst === "string") { - if (!hasZeroOrOneAsteriskCharacter(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); - } - if (!options.baseUrl && !pathIsRelative(subst) && !pathIsAbsolute(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); - } - } else { - createDiagnosticForOptionPathKeyValue(key, i, Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); - } - } - } else { - createDiagnosticForOptionPaths( - /*onKey*/ - false, - key, - Diagnostics.Substitutions_for_pattern_0_should_be_an_array, - key - ); - } - } - } - if (!options.sourceMap && !options.inlineSourceMap) { - if (options.inlineSources) { - createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "inlineSources"); - } - if (options.sourceRoot) { - createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "sourceRoot"); - } - } - if (options.mapRoot && !(options.sourceMap || options.declarationMap)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "mapRoot", "sourceMap", "declarationMap"); - } - if (options.declarationDir) { - if (!getEmitDeclarations(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationDir", "declaration", "composite"); - } - if (outputFile) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "declarationDir", "outFile"); - } - } - if (options.declarationMap && !getEmitDeclarations(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationMap", "declaration", "composite"); - } - if (options.lib && options.noLib) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib"); - } - const languageVersion = getEmitScriptTarget(options); - const firstNonAmbientExternalModuleSourceFile = find(files, (f) => isExternalModule(f) && !f.isDeclarationFile); - if (options.isolatedModules || options.verbatimModuleSyntax) { - if (options.module === 0 /* None */ && languageVersion < 2 /* ES2015 */ && options.isolatedModules) { - createDiagnosticForOptionName(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); - } - if (options.preserveConstEnums === false) { - createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled, options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", "preserveConstEnums"); - } - } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === 0 /* None */) { - const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); - programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)); - } - if (outputFile && !options.emitDeclarationOnly) { - if (options.module && !(options.module === 2 /* AMD */ || options.module === 4 /* System */)) { - createDiagnosticForOptionName(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, "outFile", "module"); - } else if (options.module === void 0 && firstNonAmbientExternalModuleSourceFile) { - const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); - programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile")); - } - } - if (getResolveJsonModule(options)) { - 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_cannot_be_specified_when_module_is_set_to_none_system_or_umd, "resolveJsonModule", "module"); - } - } - if (options.outDir || // there is --outDir specified - options.rootDir || // there is --rootDir specified - options.sourceRoot || // there is --sourceRoot specified - options.mapRoot || // there is --mapRoot specified - getEmitDeclarations(options) && options.declarationDir) { - const dir = getCommonSourceDirectory2(); - if (options.outDir && dir === "" && files.some((file) => getRootLength(file.fileName) > 1)) { - createDiagnosticForOptionName(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir"); - } - } - if (options.checkJs && !getAllowJSCompilerOption(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs"); - } - if (options.emitDeclarationOnly) { - if (!getEmitDeclarations(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "emitDeclarationOnly", "declaration", "composite"); - } - } - if (options.emitDecoratorMetadata && !options.experimentalDecorators) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); - } - if (options.jsxFactory) { - if (options.reactNamespace) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); - } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", inverseJsxOptionMap.get("" + options.jsx)); - } - if (!parseIsolatedEntityName(options.jsxFactory, languageVersion)) { - createOptionValueDiagnostic("jsxFactory", Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); - } - } else if (options.reactNamespace && !isIdentifierText(options.reactNamespace, languageVersion)) { - createOptionValueDiagnostic("reactNamespace", Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace); - } - if (options.jsxFragmentFactory) { - if (!options.jsxFactory) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); - } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", inverseJsxOptionMap.get("" + options.jsx)); - } - if (!parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { - createOptionValueDiagnostic("jsxFragmentFactory", Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); - } - } - if (options.reactNamespace) { - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", inverseJsxOptionMap.get("" + options.jsx)); - } - } - if (options.jsxImportSource) { - if (options.jsx === 2 /* React */) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", inverseJsxOptionMap.get("" + options.jsx)); - } - } - const moduleKind = getEmitModuleKind(options); - if (options.verbatimModuleSyntax) { - if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) { - createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); - } - } - if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly || options.rewriteRelativeImportExtensions)) { - createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set); - } - const moduleResolution = getEmitModuleResolutionKind(options); - if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); - } - if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { - createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); - } - 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) && 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]; - const moduleResolutionName = ModuleResolutionKind[moduleKindName] ? moduleKindName : "Node16"; - createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleResolutionName, 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(); - const emitFilesSeen = /* @__PURE__ */ new Set(); - forEachEmittedFile(emitHost, (emitFileNames) => { - if (!options.emitDeclarationOnly) { - verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen); - } - verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen); - }); - } - function verifyEmitFilePath(emitFileName, emitFilesSeen) { - if (emitFileName) { - const emitFilePath = toPath3(emitFileName); - if (filesByName.has(emitFilePath)) { - let chain; - if (!options.configFilePath) { - chain = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.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 - ); - } - chain = chainDiagnosticMessages(chain, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); - blockEmittingOfFile(emitFileName, createCompilerDiagnosticFromMessageChain(chain)); - } - const emitFileKey = !host.useCaseSensitiveFileNames() ? toFileNameLowerCase(emitFilePath) : emitFilePath; - if (emitFilesSeen.has(emitFileKey)) { - blockEmittingOfFile(emitFileName, createCompilerDiagnostic(Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, emitFileName)); - } else { - emitFilesSeen.add(emitFileKey); - } - } - } - } - function getIgnoreDeprecationsVersion() { - const ignoreDeprecations = options.ignoreDeprecations; - if (ignoreDeprecations) { - if (ignoreDeprecations === "5.0") { - return new Version(ignoreDeprecations); - } - reportInvalidIgnoreDeprecations(); - } - return Version.zero; - } - function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) { - const deprecatedInVersion = new Version(deprecatedIn); - const removedInVersion = new Version(removedIn); - const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor); - const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion(); - const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */); - const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */; - if (mustBeRemoved || canBeSilenced) { - fn((name, value, useInstead) => { - if (mustBeRemoved) { - if (value === void 0) { - createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name); - } else { - createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value); - } - } else { - if (value === void 0) { - createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn); - } else { - createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn); - } - } - }); - } - } - function verifyDeprecatedCompilerOptions() { - function createDiagnostic(name, value, useInstead, message, ...args) { - if (useInstead) { - const details = chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Use_0_instead, - useInstead - ); - const chain = chainDiagnosticMessages(details, message, ...args); - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - chain - ); - } else { - createDiagnosticForOption( - /*onKey*/ - !value, - name, - /*option2*/ - void 0, - message, - ...args - ); - } - } - checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { - if (options.target === 0 /* ES3 */) { - createDeprecatedDiagnostic("target", "ES3"); - } - if (options.noImplicitUseStrict) { - createDeprecatedDiagnostic("noImplicitUseStrict"); - } - if (options.keyofStringsOnly) { - createDeprecatedDiagnostic("keyofStringsOnly"); - } - if (options.suppressExcessPropertyErrors) { - createDeprecatedDiagnostic("suppressExcessPropertyErrors"); - } - if (options.suppressImplicitAnyIndexErrors) { - createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors"); - } - if (options.noStrictGenericChecks) { - createDeprecatedDiagnostic("noStrictGenericChecks"); - } - if (options.charset) { - createDeprecatedDiagnostic("charset"); - } - if (options.out) { - createDeprecatedDiagnostic( - "out", - /*value*/ - void 0, - "outFile" - ); - } - if (options.importsNotUsedAsValues) { - createDeprecatedDiagnostic( - "importsNotUsedAsValues", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - if (options.preserveValueImports) { - createDeprecatedDiagnostic( - "preserveValueImports", - /*value*/ - void 0, - "verbatimModuleSyntax" - ); - } - }); - } - function verifyDeprecatedProjectReference(ref, parentFile, index) { - function createDiagnostic(_name, _value, _useInstead, message, ...args) { - createDiagnosticForReference(parentFile, index, message, ...args); - } - checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { - if (ref.prepend) { - createDeprecatedDiagnostic("prepend"); - } - }); - } - function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) { - programDiagnostics.addFileProcessingDiagnostic({ - kind: 1 /* FilePreprocessingFileExplainingDiagnostic */, - file: file && file.path, - fileProcessingReason, - diagnostic, - args - }); - } - function verifyProjectReferences() { - const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : void 0; - forEachProjectReference( - projectReferences, - resolvedProjectReferences, - (resolvedRef, parent2, index) => { - const ref = (parent2 ? parent2.commandLine.projectReferences : projectReferences)[index]; - const parentFile = parent2 && parent2.sourceFile; - verifyDeprecatedProjectReference(ref, parentFile, index); - if (!resolvedRef) { - createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path); - return; - } - const options2 = resolvedRef.commandLine.options; - if (!options2.composite || options2.noEmit) { - const inputs = parent2 ? parent2.commandLine.fileNames : rootNames; - if (inputs.length) { - if (!options2.composite) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path); - if (options2.noEmit) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_may_not_disable_emit, ref.path); - } - } - if (!parent2 && buildInfoPath && buildInfoPath === getTsBuildInfoEmitOutputFilePath(options2)) { - createDiagnosticForReference(parentFile, index, Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoPath, ref.path); - hasEmitBlockingDiagnostics.set(toPath3(buildInfoPath), true); - } - } - ); - } - function createDiagnosticForOptionPathKeyValue(key, valueIndex, message, ...args) { - let needCompilerDiagnostic = true; - forEachOptionPathsSyntax((pathProp) => { - if (isObjectLiteralExpression(pathProp.initializer)) { - forEachPropertyAssignment(pathProp.initializer, key, (keyProps) => { - const initializer = keyProps.initializer; - if (isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) { - programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, ...args)); - needCompilerDiagnostic = false; - } - }); - } - }); - if (needCompilerDiagnostic) { - createCompilerOptionsDiagnostic(message, ...args); - } - } - function createDiagnosticForOptionPaths(onKey, key, message, ...args) { - let needCompilerDiagnostic = true; - forEachOptionPathsSyntax((pathProp) => { - if (isObjectLiteralExpression(pathProp.initializer) && createOptionDiagnosticInObjectLiteralSyntax( - pathProp.initializer, - onKey, - key, - /*key2*/ - void 0, - message, - ...args - )) { - needCompilerDiagnostic = false; - } - }); - if (needCompilerDiagnostic) { - createCompilerOptionsDiagnostic(message, ...args); - } - } - function forEachOptionPathsSyntax(callback) { - return forEachOptionsSyntaxByName(getCompilerOptionsObjectLiteralSyntax(), "paths", callback); - } - function createDiagnosticForOptionName(message, option1, option2, option3) { - createDiagnosticForOption( - /*onKey*/ - true, - option1, - option2, - message, - option1, - option2, - option3 - ); - } - function createOptionValueDiagnostic(option1, message, ...args) { - createDiagnosticForOption( - /*onKey*/ - false, - option1, - /*option2*/ - void 0, - message, - ...args - ); - } - function createDiagnosticForReference(sourceFile, index, message, ...args) { - const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0); - if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, ...args)); - } else { - programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message, ...args)); - } - } - function createDiagnosticForOption(onKey, option1, option2, message, ...args) { - const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); - const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, ...args); - if (needCompilerDiagnostic) { - createCompilerOptionsDiagnostic(message, ...args); - } - } - function createCompilerOptionsDiagnostic(message, ...args) { - const compilerOptionsProperty = getCompilerOptionsPropertySyntax(); - if (compilerOptionsProperty) { - if ("messageText" in message) { - programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, compilerOptionsProperty.name, message)); - } else { - programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, compilerOptionsProperty.name, message, ...args)); - } - } else if ("messageText" in message) { - programDiagnostics.addConfigDiagnostic(createCompilerDiagnosticFromMessageChain(message)); - } else { - programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message, ...args)); - } - } - function getCompilerOptionsObjectLiteralSyntax() { - if (_compilerOptionsObjectLiteralSyntax === void 0) { - const compilerOptionsProperty = getCompilerOptionsPropertySyntax(); - _compilerOptionsObjectLiteralSyntax = compilerOptionsProperty ? tryCast(compilerOptionsProperty.initializer, isObjectLiteralExpression) || false : false; - } - return _compilerOptionsObjectLiteralSyntax || void 0; - } - function getCompilerOptionsPropertySyntax() { - if (_compilerOptionsPropertySyntax === void 0) { - _compilerOptionsPropertySyntax = forEachPropertyAssignment( - getTsConfigObjectLiteralExpression(options.configFile), - "compilerOptions", - identity - ) || false; - } - return _compilerOptionsPropertySyntax || void 0; - } - function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, ...args) { - let needsCompilerDiagnostic = false; - forEachPropertyAssignment(objectLiteral, key1, (prop) => { - if ("messageText" in message) { - programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); - } else { - programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, ...args)); - } - needsCompilerDiagnostic = true; - }, key2); - return needsCompilerDiagnostic; - } - function blockEmittingOfFile(emitFileName, diag2) { - hasEmitBlockingDiagnostics.set(toPath3(emitFileName), true); - programDiagnostics.addConfigDiagnostic(diag2); - } - function isEmittedFile(file) { - if (options.noEmit) { - return false; - } - const filePath = toPath3(file); - if (getSourceFileByPath(filePath)) { - return false; - } - const out = options.outFile; - if (out) { - return isSameFile(filePath, out) || isSameFile(filePath, removeFileExtension(out) + ".d.ts" /* Dts */); - } - if (options.declarationDir && containsPath(options.declarationDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames())) { - return true; - } - if (options.outDir) { - return containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); - } - if (fileExtensionIsOneOf(filePath, supportedJSExtensionsFlat) || isDeclarationFileName(filePath)) { - const filePathWithoutExtension = removeFileExtension(filePath); - return !!getSourceFileByPath(filePathWithoutExtension + ".ts" /* Ts */) || !!getSourceFileByPath(filePathWithoutExtension + ".tsx" /* Tsx */); - } - return false; - } - function isSameFile(file1, file2) { - return comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */; - } - function getSymlinkCache() { - if (host.getSymlinkCache) { - return host.getSymlinkCache(); - } - if (!symlinks) { - symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName); - } - if (files && !symlinks.hasProcessedResolutions()) { - symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions); - } - return symlinks; - } - function getModeForUsageLocation2(file, usage) { - return getModeForUsageLocationWorker(file, usage, getCompilerOptionsForFile(file)); - } - function getEmitSyntaxForUsageLocation(file, usage) { - return getEmitSyntaxForUsageLocationWorker(file, usage, getCompilerOptionsForFile(file)); - } - function getModeForResolutionAtIndex2(file, index) { - return getModeForUsageLocation2(file, getModuleNameStringLiteralAt(file, index)); - } - function getDefaultResolutionModeForFile2(sourceFile) { - return getDefaultResolutionModeForFileWorker(sourceFile, getCompilerOptionsForFile(sourceFile)); - } - function getImpliedNodeFormatForEmit2(sourceFile) { - return getImpliedNodeFormatForEmitWorker(sourceFile, getCompilerOptionsForFile(sourceFile)); - } - function getEmitModuleFormatOfFile2(sourceFile) { - return getEmitModuleFormatOfFileWorker(sourceFile, getCompilerOptionsForFile(sourceFile)); - } - function shouldTransformImportCall(sourceFile) { - return shouldTransformImportCallWorker(sourceFile, getCompilerOptionsForFile(sourceFile)); - } - function getModeForTypeReferenceDirectiveInFile(ref, sourceFile) { - return ref.resolutionMode || getDefaultResolutionModeForFile2(sourceFile); - } -} -function shouldTransformImportCallWorker(sourceFile, options) { - const moduleKind = getEmitModuleKind(options); - if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ || moduleKind === 200 /* Preserve */) { - return false; - } - return getEmitModuleFormatOfFileWorker(sourceFile, options) < 5 /* ES2015 */; -} -function getEmitModuleFormatOfFileWorker(sourceFile, options) { - return getImpliedNodeFormatForEmitWorker(sourceFile, options) ?? getEmitModuleKind(options); -} -function getImpliedNodeFormatForEmitWorker(sourceFile, options) { - var _a, _b; - const moduleKind = getEmitModuleKind(options); - if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) { - return sourceFile.impliedNodeFormat; - } - if (sourceFile.impliedNodeFormat === 1 /* CommonJS */ && (((_a = sourceFile.packageJsonScope) == null ? void 0 : _a.contents.packageJsonContent.type) === "commonjs" || fileExtensionIsOneOf(sourceFile.fileName, [".cjs" /* Cjs */, ".cts" /* Cts */]))) { - return 1 /* CommonJS */; - } - if (sourceFile.impliedNodeFormat === 99 /* ESNext */ && (((_b = sourceFile.packageJsonScope) == null ? void 0 : _b.contents.packageJsonContent.type) === "module" || fileExtensionIsOneOf(sourceFile.fileName, [".mjs" /* Mjs */, ".mts" /* Mts */]))) { - return 99 /* ESNext */; - } - return void 0; -} -function getDefaultResolutionModeForFileWorker(sourceFile, options) { - return importSyntaxAffectsModuleResolution(options) ? getImpliedNodeFormatForEmitWorker(sourceFile, options) : void 0; -} -function updateHostForUseSourceOfProjectReferenceRedirect(host) { - let setOfDeclarationDirectories; - const originalFileExists = host.compilerHost.fileExists; - const originalDirectoryExists = host.compilerHost.directoryExists; - const originalGetDirectories = host.compilerHost.getDirectories; - const originalRealpath = host.compilerHost.realpath; - if (!host.useSourceOfProjectReferenceRedirect) return { onProgramCreateComplete: noop, fileExists }; - host.compilerHost.fileExists = fileExists; - let directoryExists; - if (originalDirectoryExists) { - directoryExists = host.compilerHost.directoryExists = (path) => { - if (originalDirectoryExists.call(host.compilerHost, path)) { - handleDirectoryCouldBeSymlink(path); - return true; - } - if (!host.getResolvedProjectReferences()) return false; - if (!setOfDeclarationDirectories) { - setOfDeclarationDirectories = /* @__PURE__ */ new Set(); - host.forEachResolvedProjectReference((ref) => { - const out = ref.commandLine.options.outFile; - if (out) { - setOfDeclarationDirectories.add(getDirectoryPath(host.toPath(out))); - } else { - const declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; - if (declarationDir) { - setOfDeclarationDirectories.add(host.toPath(declarationDir)); - } - } - }); - } - return fileOrDirectoryExistsUsingSource( - path, - /*isFile*/ - false - ); - }; - } - if (originalGetDirectories) { - host.compilerHost.getDirectories = (path) => !host.getResolvedProjectReferences() || originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path) ? originalGetDirectories.call(host.compilerHost, path) : []; - } - if (originalRealpath) { - host.compilerHost.realpath = (s) => { - var _a; - return ((_a = host.getSymlinkCache().getSymlinkedFiles()) == null ? void 0 : _a.get(host.toPath(s))) || originalRealpath.call(host.compilerHost, s); - }; - } - return { onProgramCreateComplete, fileExists, directoryExists }; - function onProgramCreateComplete() { - host.compilerHost.fileExists = originalFileExists; - host.compilerHost.directoryExists = originalDirectoryExists; - host.compilerHost.getDirectories = originalGetDirectories; - } - function fileExists(file) { - if (originalFileExists.call(host.compilerHost, file)) return true; - if (!host.getResolvedProjectReferences()) return false; - if (!isDeclarationFileName(file)) return false; - return fileOrDirectoryExistsUsingSource( - file, - /*isFile*/ - true - ); - } - function fileExistsIfProjectReferenceDts(file) { - const source = host.getRedirectFromOutput(host.toPath(file)); - return source !== void 0 ? isString(source.source) ? originalFileExists.call(host.compilerHost, source.source) : true : void 0; - } - function directoryExistsIfProjectReferenceDeclDir(dir) { - const dirPath = host.toPath(dir); - const dirPathWithTrailingDirectorySeparator = `${dirPath}${directorySeparator}`; - return forEachKey( - setOfDeclarationDirectories, - (declDirPath) => dirPath === declDirPath || // Any parent directory of declaration dir - startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || // Any directory inside declaration dir - startsWith(dirPath, `${declDirPath}/`) - ); - } - function handleDirectoryCouldBeSymlink(directory) { - var _a; - if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory)) return; - if (!originalRealpath || !directory.includes(nodeModulesPathPart)) return; - const symlinkCache = host.getSymlinkCache(); - const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory)); - if ((_a = symlinkCache.getSymlinkedDirectories()) == null ? void 0 : _a.has(directoryPath)) return; - const real = normalizePath(originalRealpath.call(host.compilerHost, directory)); - let realPath2; - if (real === directory || (realPath2 = ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { - symlinkCache.setSymlinkedDirectory(directoryPath, false); - return; - } - symlinkCache.setSymlinkedDirectory(directory, { - real: ensureTrailingDirectorySeparator(real), - realPath: realPath2 - }); - } - function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { - var _a; - const fileOrDirectoryExistsUsingSource2 = isFile ? fileExistsIfProjectReferenceDts : directoryExistsIfProjectReferenceDeclDir; - const result = fileOrDirectoryExistsUsingSource2(fileOrDirectory); - if (result !== void 0) return result; - const symlinkCache = host.getSymlinkCache(); - const symlinkedDirectories = symlinkCache.getSymlinkedDirectories(); - if (!symlinkedDirectories) return false; - const fileOrDirectoryPath = host.toPath(fileOrDirectory); - if (!fileOrDirectoryPath.includes(nodeModulesPathPart)) return false; - if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath))) return true; - return firstDefinedIterator( - symlinkedDirectories.entries(), - ([directoryPath, symlinkedDirectory]) => { - if (!symlinkedDirectory || !startsWith(fileOrDirectoryPath, directoryPath)) return void 0; - const result2 = fileOrDirectoryExistsUsingSource2(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); - if (isFile && result2) { - const absolutePath = getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); - symlinkCache.setSymlinkedFile( - fileOrDirectoryPath, - `${symlinkedDirectory.real}${absolutePath.replace(new RegExp(directoryPath, "i"), "")}` - ); - } - return result2; - } - ) || false; - } -} -var emitSkippedWithNoDiagnostics = { diagnostics: emptyArray, sourceMaps: void 0, emittedFiles: void 0, emitSkipped: true }; -function handleNoEmitOptions(program, sourceFile, writeFile2, cancellationToken) { - const options = program.getCompilerOptions(); - if (options.noEmit) { - return sourceFile ? emitSkippedWithNoDiagnostics : program.emitBuildInfo(writeFile2, cancellationToken); - } - if (!options.noEmitOnError) return void 0; - let diagnostics = [ - ...program.getOptionsDiagnostics(cancellationToken), - ...program.getSyntacticDiagnostics(sourceFile, cancellationToken), - ...program.getGlobalDiagnostics(cancellationToken), - ...program.getSemanticDiagnostics(sourceFile, cancellationToken) - ]; - if (diagnostics.length === 0 && getEmitDeclarations(program.getCompilerOptions())) { - diagnostics = program.getDeclarationDiagnostics( - /*sourceFile*/ - void 0, - cancellationToken - ); - } - if (!diagnostics.length) return void 0; - let emittedFiles; - if (!sourceFile) { - const emitResult = program.emitBuildInfo(writeFile2, cancellationToken); - if (emitResult.diagnostics) diagnostics = [...diagnostics, ...emitResult.diagnostics]; - emittedFiles = emitResult.emittedFiles; - } - return { diagnostics, sourceMaps: void 0, emittedFiles, emitSkipped: true }; -} -function filterSemanticDiagnostics(diagnostic, option) { - return filter(diagnostic, (d) => !d.skippedOn || !option[d.skippedOn]); -} -function parseConfigHostFromCompilerHostLike(host, directoryStructureHost = host) { - return { - fileExists: (f) => directoryStructureHost.fileExists(f), - readDirectory(root, extensions, excludes, includes, depth) { - Debug.assertIsDefined(directoryStructureHost.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"); - 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, - trace: host.trace ? (s) => host.trace(s) : void 0 - }; -} -function resolveProjectReferencePath(ref) { - return resolveConfigFileProjectName(ref.path); -} -function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) { - switch (extension) { - case ".ts" /* Ts */: - case ".d.ts" /* Dts */: - case ".mts" /* Mts */: - case ".d.mts" /* Dmts */: - case ".cts" /* Cts */: - case ".d.cts" /* Dcts */: - return void 0; - case ".tsx" /* Tsx */: - return needJsx(); - case ".jsx" /* Jsx */: - return needJsx() || needAllowJs(); - case ".js" /* Js */: - case ".mjs" /* Mjs */: - case ".cjs" /* Cjs */: - return needAllowJs(); - case ".json" /* Json */: - return needResolveJsonModule(); - default: - return needAllowArbitraryExtensions(); - } - function needJsx() { - return options.jsx ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; - } - function needAllowJs() { - return getAllowJSCompilerOption(options) || !getStrictOptionValue(options, "noImplicitAny") ? void 0 : Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; - } - function needResolveJsonModule() { - return getResolveJsonModule(options) ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; - } - function needAllowArbitraryExtensions() { - return isDeclarationFile || options.allowArbitraryExtensions ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set; - } -} -function getModuleNames({ imports, moduleAugmentations }) { - const res = imports.map((i) => i); - for (const aug of moduleAugmentations) { - if (aug.kind === 11 /* StringLiteral */) { - res.push(aug); - } - } - return res; -} -function getModuleNameStringLiteralAt({ imports, moduleAugmentations }, index) { - if (index < imports.length) return imports[index]; - let augIndex = imports.length; - for (const aug of moduleAugmentations) { - if (aug.kind === 11 /* StringLiteral */) { - if (index === augIndex) return aug; - augIndex++; - } - } - Debug.fail("should never ask for module name at index higher than possible module name"); -} - -// src/compiler/programDiagnostics.ts -function createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax) { - let computedDiagnostics; - let fileReasons = createMultiMap(); - let fileProcessingDiagnostics; - let commonSourceDirectory; - let configDiagnostics; - let lazyConfigDiagnostics; - let fileReasonsToChain; - let reasonToRelatedInfo; - return { - addConfigDiagnostic(diag2) { - Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics"); - (configDiagnostics ?? (configDiagnostics = createDiagnosticCollection())).add(diag2); - }, - addLazyConfigDiagnostic(file, message, ...args) { - Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics"); - (lazyConfigDiagnostics ?? (lazyConfigDiagnostics = [])).push({ file, diagnostic: message, args }); - }, - addFileProcessingDiagnostic(diag2) { - Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics"); - (fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push(diag2); - }, - setCommonSourceDirectory(directory) { - commonSourceDirectory = directory; - }, - reuseStateFromOldProgram(oldProgramDiagnostics, isConfigIdentical) { - fileReasons = oldProgramDiagnostics.getFileReasons(); - fileProcessingDiagnostics = oldProgramDiagnostics.getFileProcessingDiagnostics(); - if (isConfigIdentical) { - commonSourceDirectory = oldProgramDiagnostics.getCommonSourceDirectory(); - configDiagnostics = oldProgramDiagnostics.getConfigDiagnostics(); - lazyConfigDiagnostics = oldProgramDiagnostics.getLazyConfigDiagnostics(); - } - }, - getFileProcessingDiagnostics() { - return fileProcessingDiagnostics; - }, - getFileReasons() { - return fileReasons; - }, - getCommonSourceDirectory() { - return commonSourceDirectory; - }, - getConfigDiagnostics() { - return configDiagnostics; - }, - getLazyConfigDiagnostics() { - return lazyConfigDiagnostics; - }, - getCombinedDiagnostics(program) { - if (computedDiagnostics) { - return computedDiagnostics; - } - computedDiagnostics = createDiagnosticCollection(); - configDiagnostics == null ? void 0 : configDiagnostics.getDiagnostics().forEach((d) => computedDiagnostics.add(d)); - fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => { - switch (diagnostic.kind) { - case 1 /* FilePreprocessingFileExplainingDiagnostic */: - return computedDiagnostics.add( - createDiagnosticExplainingFile( - program, - diagnostic.file && program.getSourceFileByPath(diagnostic.file), - diagnostic.fileProcessingReason, - diagnostic.diagnostic, - diagnostic.args || emptyArray - ) - ); - case 0 /* FilePreprocessingLibReferenceDiagnostic */: - return computedDiagnostics.add(filePreprocessingLibreferenceDiagnostic(program, diagnostic)); - case 2 /* ResolutionDiagnostics */: - return diagnostic.diagnostics.forEach((d) => computedDiagnostics.add(d)); - default: - Debug.assertNever(diagnostic); - } - }); - lazyConfigDiagnostics == null ? void 0 : lazyConfigDiagnostics.forEach( - ({ file, diagnostic, args }) => computedDiagnostics.add( - createDiagnosticExplainingFile( - program, - file, - /*fileProcessingReason*/ - void 0, - diagnostic, - args - ) - ) - ); - fileReasonsToChain = void 0; - reasonToRelatedInfo = void 0; - return computedDiagnostics; - } - }; - function filePreprocessingLibreferenceDiagnostic(program, { reason }) { - const { file, pos, end } = getReferencedFileLocation(program, reason); - const libReference = file.libReferenceDirectives[reason.index]; - const libName = getLibNameFromLibReference(libReference); - const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts"); - const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity); - return createFileDiagnostic( - file, - Debug.checkDefined(pos), - Debug.checkDefined(end) - pos, - suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0, - libName, - suggestion - ); - } - function createDiagnosticExplainingFile(program, file, fileProcessingReason, diagnostic, args) { - let seenReasons; - let fileIncludeReasons; - let relatedInfo; - let fileIncludeReasonDetails; - let redirectInfo; - let chain; - const reasons = file && fileReasons.get(file.path); - let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0; - let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path)); - if (cachedChain) { - if (cachedChain.fileIncludeReasonDetails) { - seenReasons = new Set(reasons); - reasons == null ? void 0 : reasons.forEach(populateRelatedInfo); - } else { - reasons == null ? void 0 : reasons.forEach(processReason); - } - redirectInfo = cachedChain.redirectInfo; - } else { - reasons == null ? void 0 : reasons.forEach(processReason); - redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, program.getCompilerOptionsForFile(file)); - } - if (fileProcessingReason) processReason(fileProcessingReason); - const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length); - if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1) seenReasons = void 0; - if (seenReasons && cachedChain) { - if (cachedChain.details && !processedExtraReason) { - chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args ?? emptyArray); - } else if (cachedChain.fileIncludeReasonDetails) { - if (!processedExtraReason) { - if (!cachedFileIncludeDetailsHasProcessedExtraReason()) { - fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails; - } else { - fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length); - } - } else { - if (!cachedFileIncludeDetailsHasProcessedExtraReason()) { - fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]]; - } else { - fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]); - } - } - } - } - if (!chain) { - if (!fileIncludeReasonDetails) fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon); - chain = chainDiagnosticMessages( - redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, - diagnostic, - ...args || emptyArray - ); - } - if (file) { - if (cachedChain) { - if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) { - cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails; - } - } else { - (fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo }); - } - if (!cachedChain.details && !processedExtraReason) cachedChain.details = chain.next; - } - const location = locationReason && getReferencedFileLocation(program, locationReason); - return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo); - function processReason(reason) { - if (seenReasons == null ? void 0 : seenReasons.has(reason)) return; - (seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason); - (fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason)); - populateRelatedInfo(reason); - } - function populateRelatedInfo(reason) { - if (!locationReason && isReferencedFile(reason)) { - locationReason = reason; - } else if (locationReason !== reason) { - relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(program, reason)); - } - } - function cachedFileIncludeDetailsHasProcessedExtraReason() { - var _a; - return ((_a = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a.length) !== (reasons == null ? void 0 : reasons.length); - } - } - function getFileIncludeReasonToRelatedInformation(program, reason) { - let relatedInfo = reasonToRelatedInfo == null ? void 0 : reasonToRelatedInfo.get(reason); - if (relatedInfo === void 0) (reasonToRelatedInfo ?? (reasonToRelatedInfo = /* @__PURE__ */ new Map())).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(program, reason) ?? false); - return relatedInfo || void 0; - } - function fileIncludeReasonToRelatedInformation(program, reason) { - if (isReferencedFile(reason)) { - const referenceLocation = getReferencedFileLocation(program, reason); - let message2; - switch (reason.kind) { - case 3 /* Import */: - message2 = Diagnostics.File_is_included_via_import_here; - break; - case 4 /* ReferenceFile */: - message2 = Diagnostics.File_is_included_via_reference_here; - break; - case 5 /* TypeReferenceDirective */: - message2 = Diagnostics.File_is_included_via_type_library_reference_here; - break; - case 7 /* LibReferenceDirective */: - message2 = Diagnostics.File_is_included_via_library_reference_here; - break; - default: - Debug.assertNever(reason); - } - return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic( - referenceLocation.file, - referenceLocation.pos, - referenceLocation.end - referenceLocation.pos, - message2 - ) : void 0; - } - const currentDirectory = program.getCurrentDirectory(); - const rootNames = program.getRootFileNames(); - const options = program.getCompilerOptions(); - if (!options.configFile) return void 0; - let configFileNode; - let message; - switch (reason.kind) { - case 0 /* RootFile */: - if (!options.configFile.configFileSpecs) return void 0; - const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory); - const matchedByFiles = getMatchedFileSpec(program, fileName); - if (matchedByFiles) { - configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles); - message = Diagnostics.File_is_matched_by_files_list_specified_here; - break; - } - const matchedByInclude = getMatchedIncludeSpec(program, fileName); - if (!matchedByInclude || !isString(matchedByInclude)) return void 0; - configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude); - message = Diagnostics.File_is_matched_by_include_pattern_specified_here; - break; - case 1 /* SourceFromProjectReference */: - case 2 /* OutputFromProjectReference */: - const resolvedProjectReferences = program.getResolvedProjectReferences(); - const projectReferences = program.getProjectReferences(); - 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 - ); - if (!referenceInfo) return void 0; - const { sourceFile, index } = referenceInfo; - const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0); - return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile( - sourceFile, - referencesSyntax.elements[index], - reason.kind === 2 /* OutputFromProjectReference */ ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here - ) : void 0; - case 8 /* AutomaticTypeDirectiveFile */: - if (!options.types) return void 0; - configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "types", reason.typeReference); - message = Diagnostics.File_is_entry_point_of_type_library_specified_here; - break; - case 6 /* LibFile */: - if (reason.index !== void 0) { - configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "lib", options.lib[reason.index]); - message = Diagnostics.File_is_library_specified_here; - break; - } - const target = getNameOfScriptTarget(getEmitScriptTarget(options)); - configFileNode = target ? getOptionsSyntaxByValue(getCompilerOptionsObjectLiteralSyntax(), "target", target) : void 0; - message = Diagnostics.File_is_default_library_for_target_specified_here; - break; - default: - Debug.assertNever(reason); - } - return configFileNode && createDiagnosticForNodeInSourceFile( - options.configFile, - configFileNode, - message - ); - } -} - -// src/compiler/builderState.ts -function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) { - const outputFiles = []; - const { emitSkipped, diagnostics } = program.emit(sourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit); - return { outputFiles, emitSkipped, diagnostics }; - function writeFile2(fileName, text, writeByteOrderMark) { - outputFiles.push({ name: fileName, writeByteOrderMark, text }); - } -} -var SignatureInfo = /* @__PURE__ */ ((SignatureInfo2) => { - SignatureInfo2[SignatureInfo2["ComputedDts"] = 0] = "ComputedDts"; - SignatureInfo2[SignatureInfo2["StoredSignatureAtEmit"] = 1] = "StoredSignatureAtEmit"; - SignatureInfo2[SignatureInfo2["UsedVersion"] = 2] = "UsedVersion"; - return SignatureInfo2; -})(SignatureInfo || {}); -var BuilderState; -((BuilderState2) => { - function createManyToManyPathMap() { - function create2(forward, reverse, deleted) { - const map2 = { - getKeys: (v) => reverse.get(v), - getValues: (k) => forward.get(k), - keys: () => forward.keys(), - size: () => forward.size, - deleteKey: (k) => { - (deleted || (deleted = /* @__PURE__ */ new Set())).add(k); - const set = forward.get(k); - if (!set) { - return false; - } - set.forEach((v) => deleteFromMultimap(reverse, v, k)); - forward.delete(k); - return true; - }, - set: (k, vSet) => { - deleted == null ? void 0 : deleted.delete(k); - const existingVSet = forward.get(k); - forward.set(k, vSet); - existingVSet == null ? void 0 : existingVSet.forEach((v) => { - if (!vSet.has(v)) { - deleteFromMultimap(reverse, v, k); - } - }); - vSet.forEach((v) => { - if (!(existingVSet == null ? void 0 : existingVSet.has(v))) { - addToMultimap(reverse, v, k); - } - }); - return map2; - } - }; - return map2; - } - return create2( - /* @__PURE__ */ new Map(), - /* @__PURE__ */ new Map(), - /*deleted*/ - void 0 - ); - } - BuilderState2.createManyToManyPathMap = createManyToManyPathMap; - function addToMultimap(map2, k, v) { - let set = map2.get(k); - if (!set) { - set = /* @__PURE__ */ new Set(); - map2.set(k, set); - } - set.add(v); - } - function deleteFromMultimap(map2, k, v) { - const set = map2.get(k); - if (set == null ? void 0 : set.delete(v)) { - if (!set.size) { - map2.delete(k); - } - return true; - } - return false; - } - function getReferencedFilesFromImportedModuleSymbol(symbol) { - return mapDefined(symbol.declarations, (declaration) => { - var _a; - return (_a = getSourceFileOfNode(declaration)) == null ? void 0 : _a.resolvedPath; - }); - } - function getReferencedFilesFromImportLiteral(checker, importName) { - const symbol = checker.getSymbolAtLocation(importName); - return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); - } - function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { - var _a; - return toPath(((_a = program.getRedirectFromSourceFile(fileName)) == null ? void 0 : _a.outputDts) || fileName, sourceFileDirectory, getCanonicalFileName); - } - function getReferencedFiles(program, sourceFile, getCanonicalFileName) { - let referencedFiles; - if (sourceFile.imports && sourceFile.imports.length > 0) { - const checker = program.getTypeChecker(); - for (const importName of sourceFile.imports) { - const declarationSourceFilePaths = getReferencedFilesFromImportLiteral(checker, importName); - declarationSourceFilePaths == null ? void 0 : declarationSourceFilePaths.forEach(addReferencedFile); - } - } - const sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath); - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (const referencedFile of sourceFile.referencedFiles) { - const referencedPath = getReferencedFileFromFileName(program, referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); - addReferencedFile(referencedPath); - } - } - 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) { - if (!isStringLiteral(moduleName)) continue; - const symbol = checker.getSymbolAtLocation(moduleName); - if (!symbol) continue; - addReferenceFromAmbientModule(symbol); - } - } - for (const ambientModule of program.getTypeChecker().getAmbientModules()) { - if (ambientModule.declarations && ambientModule.declarations.length > 1) { - addReferenceFromAmbientModule(ambientModule); - } - } - return referencedFiles; - function addReferenceFromAmbientModule(symbol) { - if (!symbol.declarations) { - return; - } - for (const declaration of symbol.declarations) { - const declarationSourceFile = getSourceFileOfNode(declaration); - if (declarationSourceFile && declarationSourceFile !== sourceFile) { - addReferencedFile(declarationSourceFile.resolvedPath); - } - } - } - function addReferencedFile(referencedPath) { - (referencedFiles || (referencedFiles = /* @__PURE__ */ new Set())).add(referencedPath); - } - } - function canReuseOldState(newReferencedMap, oldState) { - return oldState && !oldState.referencedMap === !newReferencedMap; - } - BuilderState2.canReuseOldState = canReuseOldState; - function createReferencedMap(options) { - return options.module !== 0 /* None */ && !options.outFile ? createManyToManyPathMap() : void 0; - } - BuilderState2.createReferencedMap = createReferencedMap; - function create(newProgram, oldState, disableUseFileVersionAsSignature) { - var _a, _b; - const fileInfos = /* @__PURE__ */ new Map(); - const options = newProgram.getCompilerOptions(); - const referencedMap = createReferencedMap(options); - const useOldState = canReuseOldState(referencedMap, oldState); - newProgram.getTypeChecker(); - for (const sourceFile of newProgram.getSourceFiles()) { - const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); - const oldUncommittedSignature = useOldState ? (_a = oldState.oldSignatures) == null ? void 0 : _a.get(sourceFile.resolvedPath) : void 0; - const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0; - if (referencedMap) { - const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName); - if (newReferences) { - referencedMap.set(sourceFile.resolvedPath, newReferences); - } - } - fileInfos.set(sourceFile.resolvedPath, { - version: version2, - signature, - // No need to calculate affectsGlobalScope with --out since its not used at all - affectsGlobalScope: !options.outFile ? isFileAffectingGlobalScope(sourceFile) || void 0 : void 0, - impliedFormat: sourceFile.impliedNodeFormat - }); - } - return { - fileInfos, - referencedMap, - useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState - }; - } - BuilderState2.create = create; - function releaseCache2(state) { - state.allFilesExcludingDefaultLibraryFile = void 0; - state.allFileNames = void 0; - } - BuilderState2.releaseCache = releaseCache2; - function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, host) { - var _a; - const result = getFilesAffectedByWithOldState( - state, - programOfThisState, - path, - cancellationToken, - host - ); - (_a = state.oldSignatures) == null ? void 0 : _a.clear(); - return result; - } - BuilderState2.getFilesAffectedBy = getFilesAffectedBy; - function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, host) { - const sourceFile = programOfThisState.getSourceFileByPath(path); - if (!sourceFile) { - return emptyArray; - } - if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host)) { - return [sourceFile]; - } - return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, host); - } - BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState; - function updateSignatureOfFile(state, signature, path) { - state.fileInfos.get(path).signature = signature; - (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path); - } - BuilderState2.updateSignatureOfFile = updateSignatureOfFile; - function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) { - programOfThisState.emit( - 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 - ); - }, - cancellationToken, - 2 /* BuilderSignature */, - /*customTransformers*/ - void 0, - /*forceDtsEmit*/ - true - ); - } - BuilderState2.computeDtsSignature = computeDtsSignature; - function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) { - var _a; - if ((_a = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a.has(sourceFile.resolvedPath)) return false; - const info = state.fileInfos.get(sourceFile.resolvedPath); - const prevSignature = info.signature; - let latestSignature; - if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) { - computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, (signature) => { - latestSignature = signature; - if (host.storeSignatureInfo) (state.signatureInfo ?? (state.signatureInfo = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, 0 /* ComputedDts */); - }); - } - if (latestSignature === void 0) { - latestSignature = sourceFile.version; - if (host.storeSignatureInfo) (state.signatureInfo ?? (state.signatureInfo = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, 2 /* UsedVersion */); - } - (state.oldSignatures || (state.oldSignatures = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, prevSignature || false); - (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(sourceFile.resolvedPath); - info.signature = latestSignature; - return latestSignature !== prevSignature; - } - BuilderState2.updateShapeSignature = updateShapeSignature; - function getAllDependencies(state, programOfThisState, sourceFile) { - const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions.outFile) { - return getAllFileNames(state, programOfThisState); - } - if (!state.referencedMap || isFileAffectingGlobalScope(sourceFile)) { - return getAllFileNames(state, programOfThisState); - } - const seenMap = /* @__PURE__ */ new Set(); - const queue = [sourceFile.resolvedPath]; - while (queue.length) { - const path = queue.pop(); - if (!seenMap.has(path)) { - seenMap.add(path); - const references = state.referencedMap.getValues(path); - if (references) { - for (const key of references.keys()) { - queue.push(key); - } - } - } - } - return arrayFrom(mapDefinedIterator(seenMap.keys(), (path) => { - var _a; - return ((_a = programOfThisState.getSourceFileByPath(path)) == null ? void 0 : _a.fileName) ?? path; - })); - } - BuilderState2.getAllDependencies = getAllDependencies; - function getAllFileNames(state, programOfThisState) { - if (!state.allFileNames) { - const sourceFiles = programOfThisState.getSourceFiles(); - state.allFileNames = sourceFiles === emptyArray ? emptyArray : sourceFiles.map((file) => file.fileName); - } - return state.allFileNames; - } - function getReferencedByPaths(state, referencedFilePath) { - const keys = state.referencedMap.getKeys(referencedFilePath); - return keys ? arrayFrom(keys.keys()) : []; - } - BuilderState2.getReferencedByPaths = getReferencedByPaths; - function containsOnlyAmbientModules(sourceFile) { - for (const statement of sourceFile.statements) { - if (!isModuleWithStringLiteralName(statement)) { - return false; - } - } - return true; - } - function containsGlobalScopeAugmentation(sourceFile) { - return some(sourceFile.moduleAugmentations, (augmentation) => isGlobalScopeAugmentation(augmentation.parent)); - } - function isFileAffectingGlobalScope(sourceFile) { - return containsGlobalScopeAugmentation(sourceFile) || !isExternalOrCommonJsModule(sourceFile) && !isJsonSourceFile(sourceFile) && !containsOnlyAmbientModules(sourceFile); - } - function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { - if (state.allFilesExcludingDefaultLibraryFile) { - return state.allFilesExcludingDefaultLibraryFile; - } - let result; - if (firstSourceFile) addSourceFile(firstSourceFile); - for (const sourceFile of programOfThisState.getSourceFiles()) { - if (sourceFile !== firstSourceFile) { - addSourceFile(sourceFile); - } - } - state.allFilesExcludingDefaultLibraryFile = result || emptyArray; - return state.allFilesExcludingDefaultLibraryFile; - function addSourceFile(sourceFile) { - if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { - (result || (result = [])).push(sourceFile); - } - } - } - BuilderState2.getAllFilesExcludingDefaultLibraryFile = getAllFilesExcludingDefaultLibraryFile; - function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { - const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && compilerOptions.outFile) { - return [sourceFileWithUpdatedShape]; - } - return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); - } - function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, host) { - if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) { - return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); - } - const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (getIsolatedModules(compilerOptions) || compilerOptions.outFile)) { - return [sourceFileWithUpdatedShape]; - } - const seenFileNamesMap = /* @__PURE__ */ new Map(); - seenFileNamesMap.set(sourceFileWithUpdatedShape.resolvedPath, sourceFileWithUpdatedShape); - const queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.resolvedPath); - while (queue.length > 0) { - const currentPath = queue.pop(); - if (!seenFileNamesMap.has(currentPath)) { - const currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); - seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, host)) { - queue.push(...getReferencedByPaths(state, currentSourceFile.resolvedPath)); - } - } - } - return arrayFrom(mapDefinedIterator(seenFileNamesMap.values(), (value) => value)); - } -})(BuilderState || (BuilderState = {})); - -// src/compiler/builder.ts -var BuilderFileEmit = /* @__PURE__ */ ((BuilderFileEmit2) => { - BuilderFileEmit2[BuilderFileEmit2["None"] = 0] = "None"; - BuilderFileEmit2[BuilderFileEmit2["Js"] = 1] = "Js"; - BuilderFileEmit2[BuilderFileEmit2["JsMap"] = 2] = "JsMap"; - BuilderFileEmit2[BuilderFileEmit2["JsInlineMap"] = 4] = "JsInlineMap"; - BuilderFileEmit2[BuilderFileEmit2["DtsErrors"] = 8] = "DtsErrors"; - BuilderFileEmit2[BuilderFileEmit2["DtsEmit"] = 16] = "DtsEmit"; - BuilderFileEmit2[BuilderFileEmit2["DtsMap"] = 32] = "DtsMap"; - BuilderFileEmit2[BuilderFileEmit2["Dts"] = 24] = "Dts"; - BuilderFileEmit2[BuilderFileEmit2["AllJs"] = 7] = "AllJs"; - BuilderFileEmit2[BuilderFileEmit2["AllDtsEmit"] = 48] = "AllDtsEmit"; - BuilderFileEmit2[BuilderFileEmit2["AllDts"] = 56] = "AllDts"; - BuilderFileEmit2[BuilderFileEmit2["All"] = 63] = "All"; - return BuilderFileEmit2; -})(BuilderFileEmit || {}); -function isBuilderProgramStateWithDefinedProgram(state) { - return state.program !== void 0; -} -function toBuilderProgramStateWithDefinedProgram(state) { - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - return state; -} -function getBuilderFileEmit(options) { - let result = 1 /* Js */; - if (options.sourceMap) result = result | 2 /* JsMap */; - if (options.inlineSourceMap) result = result | 4 /* JsInlineMap */; - if (getEmitDeclarations(options)) result = result | 24 /* Dts */; - if (options.declarationMap) result = result | 32 /* DtsMap */; - if (options.emitDeclarationOnly) result = result & 56 /* AllDts */; - return result; -} -function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) { - const oldEmitKind = oldOptionsOrEmitKind && (isNumber(oldOptionsOrEmitKind) ? oldOptionsOrEmitKind : getBuilderFileEmit(oldOptionsOrEmitKind)); - const emitKind = isNumber(optionsOrEmitKind) ? optionsOrEmitKind : getBuilderFileEmit(optionsOrEmitKind); - if (oldEmitKind === emitKind) return 0 /* None */; - if (!oldEmitKind || !emitKind) return emitKind; - const diff = oldEmitKind ^ emitKind; - let result = 0 /* None */; - if (diff & 7 /* AllJs */) result = emitKind & 7 /* AllJs */; - if (diff & 8 /* DtsErrors */) result = result | emitKind & 8 /* DtsErrors */; - if (diff & 48 /* AllDtsEmit */) result = result | emitKind & 48 /* AllDtsEmit */; - return result; -} -function hasSameKeys(map1, map2) { - return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key)); -} -function createBuilderProgramState(newProgram, oldState) { - var _a, _b; - const state = BuilderState.create( - newProgram, - oldState, - /*disableUseFileVersionAsSignature*/ - false - ); - state.program = newProgram; - const compilerOptions = newProgram.getCompilerOptions(); - state.compilerOptions = compilerOptions; - const outFilePath = compilerOptions.outFile; - state.semanticDiagnosticsPerFile = /* @__PURE__ */ new Map(); - if (outFilePath && compilerOptions.composite && (oldState == null ? void 0 : oldState.outSignature) && outFilePath === oldState.compilerOptions.outFile) { - state.outSignature = oldState.outSignature && getEmitSignatureFromOldSignature(compilerOptions, oldState.compilerOptions, oldState.outSignature); - } - state.changedFilesSet = /* @__PURE__ */ new Set(); - state.latestChangedDtsFile = compilerOptions.composite ? oldState == null ? void 0 : oldState.latestChangedDtsFile : void 0; - state.checkPending = state.compilerOptions.noCheck ? true : void 0; - const useOldState = BuilderState.canReuseOldState(state.referencedMap, oldState); - const oldCompilerOptions = useOldState ? oldState.compilerOptions : void 0; - let canCopySemanticDiagnostics = useOldState && !compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions); - const canCopyEmitSignatures = compilerOptions.composite && (oldState == null ? void 0 : oldState.emitSignatures) && !outFilePath && !compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions); - let canCopyEmitDiagnostics = true; - if (useOldState) { - (_a = oldState.changedFilesSet) == null ? void 0 : _a.forEach((value) => state.changedFilesSet.add(value)); - if (!outFilePath && ((_b = oldState.affectedFilesPendingEmit) == null ? void 0 : _b.size)) { - state.affectedFilesPendingEmit = new Map(oldState.affectedFilesPendingEmit); - state.seenAffectedFiles = /* @__PURE__ */ new Set(); - } - state.programEmitPending = oldState.programEmitPending; - if (outFilePath && state.changedFilesSet.size) { - canCopySemanticDiagnostics = false; - canCopyEmitDiagnostics = false; - } - state.hasErrorsFromOldState = oldState.hasErrors; - } else { - state.buildInfoEmitPending = isIncrementalCompilation(compilerOptions); - } - const referencedMap = state.referencedMap; - const oldReferencedMap = useOldState ? oldState.referencedMap : void 0; - 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 - !(oldInfo = oldState.fileInfos.get(sourceFilePath)) || // versions dont match - oldInfo.version !== info.version || // Implied formats dont match - oldInfo.impliedFormat !== info.impliedFormat || // Referenced files changed - !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(sourceFilePath); - } else { - const sourceFile = newProgram.getSourceFileByPath(sourceFilePath); - const emitDiagnostics = canCopyEmitDiagnostics ? (_a2 = oldState.emitDiagnosticsPerFile) == null ? void 0 : _a2.get(sourceFilePath) : void 0; - if (emitDiagnostics) { - (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set( - sourceFilePath, - oldState.hasReusableDiagnostic ? convertToDiagnostics(emitDiagnostics, sourceFilePath, newProgram) : repopulateDiagnostics(emitDiagnostics, newProgram) - ); - } - 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, sourceFilePath, newProgram) : repopulateDiagnostics(diagnostics, newProgram) - ); - (state.semanticDiagnosticsFromOldState ?? (state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set())).add(sourceFilePath); - } - } - } - if (canCopyEmitSignatures) { - const oldEmitSignature = oldState.emitSignatures.get(sourceFilePath); - if (oldEmitSignature) { - (state.emitSignatures ?? (state.emitSignatures = /* @__PURE__ */ new Map())).set(sourceFilePath, getEmitSignatureFromOldSignature(compilerOptions, oldState.compilerOptions, oldEmitSignature)); - } - } - }); - if (useOldState && forEachEntry(oldState.fileInfos, (info, sourceFilePath) => { - if (state.fileInfos.has(sourceFilePath)) return false; - if (info.affectsGlobalScope) return true; - state.buildInfoEmitPending = true; - return !!outFilePath; - })) { - BuilderState.getAllFilesExcludingDefaultLibraryFile( - state, - newProgram, - /*firstSourceFile*/ - void 0 - ).forEach((file) => addFileToChangeSet(file.resolvedPath)); - } else if (oldCompilerOptions) { - const pendingEmitKind = compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions) ? getBuilderFileEmit(compilerOptions) : getPendingEmitKind(compilerOptions, oldCompilerOptions); - if (pendingEmitKind !== 0 /* None */) { - if (!outFilePath) { - newProgram.getSourceFiles().forEach((f) => { - if (!state.changedFilesSet.has(f.resolvedPath)) { - addToAffectedFilesPendingEmit( - state, - f.resolvedPath, - pendingEmitKind - ); - } - }); - Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); - state.seenAffectedFiles = state.seenAffectedFiles || /* @__PURE__ */ new Set(); - } else if (!state.changedFilesSet.size) { - state.programEmitPending = state.programEmitPending ? state.programEmitPending | pendingEmitKind : pendingEmitKind; - } - state.buildInfoEmitPending = true; - } - } - if (useOldState && state.semanticDiagnosticsPerFile.size !== state.fileInfos.size && oldState.checkPending !== state.checkPending) state.buildInfoEmitPending = true; - return state; - function addFileToChangeSet(path) { - state.changedFilesSet.add(path); - if (outFilePath) { - canCopySemanticDiagnostics = false; - canCopyEmitDiagnostics = false; - state.semanticDiagnosticsFromOldState = void 0; - state.semanticDiagnosticsPerFile.clear(); - state.emitDiagnosticsPerFile = void 0; - } - state.buildInfoEmitPending = true; - state.programEmitPending = void 0; - } -} -function getEmitSignatureFromOldSignature(options, oldOptions, oldEmitSignature) { - return !!options.declarationMap === !!oldOptions.declarationMap ? ( - // Use same format of signature - oldEmitSignature - ) : ( - // Convert to different format - isString(oldEmitSignature) ? [oldEmitSignature] : oldEmitSignature[0] - ); -} -function repopulateDiagnostics(diagnostics, newProgram) { - if (!diagnostics.length) return diagnostics; - return sameMap(diagnostics, (diag2) => { - if (isString(diag2.messageText)) return diag2; - const repopulatedChain = convertOrRepopulateDiagnosticMessageChain(diag2.messageText, diag2.file, newProgram, (chain) => { - var _a; - return (_a = chain.repopulateInfo) == null ? void 0 : _a.call(chain); - }); - return repopulatedChain === diag2.messageText ? diag2 : { ...diag2, messageText: repopulatedChain }; - }); -} -function convertOrRepopulateDiagnosticMessageChain(chain, sourceFile, newProgram, repopulateInfo) { - const info = repopulateInfo(chain); - if (info === true) { - return { - ...createModeMismatchDetails(sourceFile), - next: convertOrRepopulateDiagnosticMessageChainArray(chain.next, sourceFile, newProgram, repopulateInfo) - }; - } else if (info) { - return { - ...createModuleNotFoundChain(sourceFile, newProgram, info.moduleReference, info.mode, info.packageName || info.moduleReference), - next: convertOrRepopulateDiagnosticMessageChainArray(chain.next, sourceFile, newProgram, repopulateInfo) - }; - } - const next = convertOrRepopulateDiagnosticMessageChainArray(chain.next, sourceFile, newProgram, repopulateInfo); - return next === chain.next ? chain : { ...chain, next }; -} -function convertOrRepopulateDiagnosticMessageChainArray(array, sourceFile, newProgram, repopulateInfo) { - return sameMap(array, (chain) => convertOrRepopulateDiagnosticMessageChain(chain, sourceFile, newProgram, repopulateInfo)); -} -function convertToDiagnostics(diagnostics, diagnosticFilePath, newProgram) { - if (!diagnostics.length) return emptyArray; - let buildInfoDirectory; - return diagnostics.map((diagnostic) => { - const result = convertToDiagnosticRelatedInformation(diagnostic, diagnosticFilePath, newProgram, toPathInBuildInfoDirectory); - result.reportsUnnecessary = diagnostic.reportsUnnecessary; - result.reportsDeprecated = diagnostic.reportDeprecated; - result.source = diagnostic.source; - result.skippedOn = diagnostic.skippedOn; - const { relatedInformation } = diagnostic; - result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => convertToDiagnosticRelatedInformation(r, diagnosticFilePath, newProgram, toPathInBuildInfoDirectory)) : [] : void 0; - return result; - }); - function toPathInBuildInfoDirectory(path) { - buildInfoDirectory ?? (buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()))); - return toPath(path, buildInfoDirectory, newProgram.getCanonicalFileName); - } -} -function convertToDiagnosticRelatedInformation(diagnostic, diagnosticFilePath, newProgram, toPath3) { - const { file } = diagnostic; - const sourceFile = file !== false ? newProgram.getSourceFileByPath(file ? toPath3(file) : diagnosticFilePath) : void 0; - return { - ...diagnostic, - file: sourceFile, - messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertOrRepopulateDiagnosticMessageChain(diagnostic.messageText, sourceFile, newProgram, (chain) => chain.info) - }; -} -function releaseCache(state) { - BuilderState.releaseCache(state); - state.program = void 0; -} -function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) { - Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath)); -} -function getNextAffectedFile(state, cancellationToken, host) { - var _a; - while (true) { - const { affectedFiles } = state; - if (affectedFiles) { - const seenAffectedFiles = state.seenAffectedFiles; - let affectedFilesIndex = state.affectedFilesIndex; - while (affectedFilesIndex < affectedFiles.length) { - const affectedFile = affectedFiles[affectedFilesIndex]; - if (!seenAffectedFiles.has(affectedFile.resolvedPath)) { - state.affectedFilesIndex = affectedFilesIndex; - addToAffectedFilesPendingEmit( - state, - affectedFile.resolvedPath, - getBuilderFileEmit(state.compilerOptions) - ); - handleDtsMayChangeOfAffectedFile( - state, - affectedFile, - cancellationToken, - host - ); - return affectedFile; - } - affectedFilesIndex++; - } - state.changedFilesSet.delete(state.currentChangedFilePath); - state.currentChangedFilePath = void 0; - (_a = state.oldSignatures) == null ? void 0 : _a.clear(); - state.affectedFiles = void 0; - } - const nextKey = state.changedFilesSet.keys().next(); - if (nextKey.done) { - return void 0; - } - const compilerOptions = state.program.getCompilerOptions(); - if (compilerOptions.outFile) return state.program; - state.affectedFiles = BuilderState.getFilesAffectedByWithOldState( - state, - state.program, - nextKey.value, - cancellationToken, - host - ); - state.currentChangedFilePath = nextKey.value; - state.affectedFilesIndex = 0; - if (!state.seenAffectedFiles) state.seenAffectedFiles = /* @__PURE__ */ new Set(); - } -} -function clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles, isForDtsErrors) { - var _a, _b; - if (!((_a = state.affectedFilesPendingEmit) == null ? void 0 : _a.size) && !state.programEmitPending) return; - if (!emitOnlyDtsFiles && !isForDtsErrors) { - state.affectedFilesPendingEmit = void 0; - state.programEmitPending = void 0; - } - (_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.forEach((emitKind, path) => { - const pending = !isForDtsErrors ? emitKind & 7 /* AllJs */ : emitKind & (7 /* AllJs */ | 48 /* AllDtsEmit */); - if (!pending) state.affectedFilesPendingEmit.delete(path); - else state.affectedFilesPendingEmit.set(path, pending); - }); - if (state.programEmitPending) { - const pending = !isForDtsErrors ? state.programEmitPending & 7 /* AllJs */ : state.programEmitPending & (7 /* AllJs */ | 48 /* AllDtsEmit */); - if (!pending) state.programEmitPending = void 0; - else state.programEmitPending = pending; - } -} -function getPendingEmitKindWithSeen(optionsOrEmitKind, seenOldOptionsOrEmitKind, emitOnlyDtsFiles, isForDtsErrors) { - let pendingKind = getPendingEmitKind(optionsOrEmitKind, seenOldOptionsOrEmitKind); - if (emitOnlyDtsFiles) pendingKind = pendingKind & 56 /* AllDts */; - if (isForDtsErrors) pendingKind = pendingKind & 8 /* DtsErrors */; - return pendingKind; -} -function getBuilderFileEmitAllDts(isForDtsErrors) { - return !isForDtsErrors ? 56 /* AllDts */ : 8 /* DtsErrors */; -} -function getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles, isForDtsErrors) { - var _a; - if (!((_a = state.affectedFilesPendingEmit) == null ? void 0 : _a.size)) return void 0; - return forEachEntry(state.affectedFilesPendingEmit, (emitKind, path) => { - var _a2; - const affectedFile = state.program.getSourceFileByPath(path); - if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) { - state.affectedFilesPendingEmit.delete(path); - return void 0; - } - const seenKind = (_a2 = state.seenEmittedFiles) == null ? void 0 : _a2.get(affectedFile.resolvedPath); - const pendingKind = getPendingEmitKindWithSeen( - emitKind, - seenKind, - emitOnlyDtsFiles, - isForDtsErrors - ); - if (pendingKind) return { affectedFile, emitKind: pendingKind }; - }); -} -function getNextPendingEmitDiagnosticsFile(state, isForDtsErrors) { - 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 & getBuilderFileEmitAllDts(isForDtsErrors))) return { affectedFile, diagnostics, seenKind }; - }); -} -function removeDiagnosticsOfLibraryFiles(state) { - if (!state.cleanedDiagnosticsOfLibFiles) { - state.cleanedDiagnosticsOfLibFiles = true; - const options = state.program.getCompilerOptions(); - forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeCheckingIgnoringNoCheck(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath)); - } -} -function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) { - removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath); - if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) { - removeDiagnosticsOfLibraryFiles(state); - BuilderState.updateShapeSignature( - state, - state.program, - affectedFile, - cancellationToken, - host - ); - return; - } - if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) return; - handleDtsMayChangeOfReferencingExportOfAffectedFile( - state, - affectedFile, - cancellationToken, - host - ); -} -function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) { - removeSemanticDiagnosticsOf(state, path); - if (!state.changedFilesSet.has(path)) { - const sourceFile = state.program.getSourceFileByPath(path); - if (sourceFile) { - BuilderState.updateShapeSignature( - state, - state.program, - sourceFile, - cancellationToken, - host, - /*useFileVersionAsSignature*/ - true - ); - if (invalidateJsFiles) { - addToAffectedFilesPendingEmit( - state, - path, - getBuilderFileEmit(state.compilerOptions) - ); - } else if (getEmitDeclarations(state.compilerOptions)) { - addToAffectedFilesPendingEmit( - state, - path, - state.compilerOptions.declarationMap ? 56 /* AllDts */ : 24 /* Dts */ - ); - } - } - } -} -function removeSemanticDiagnosticsOf(state, path) { - if (!state.semanticDiagnosticsFromOldState) { - return true; - } - state.semanticDiagnosticsFromOldState.delete(path); - state.semanticDiagnosticsPerFile.delete(path); - return !state.semanticDiagnosticsFromOldState.size; -} -function isChangedSignature(state, path) { - const oldSignature = Debug.checkDefined(state.oldSignatures).get(path) || void 0; - const newSignature = Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignature; -} -function handleDtsMayChangeOfGlobalScope(state, filePath, invalidateJsFiles, cancellationToken, host) { - var _a; - if (!((_a = state.fileInfos.get(filePath)) == null ? void 0 : _a.affectsGlobalScope)) return false; - BuilderState.getAllFilesExcludingDefaultLibraryFile( - state, - state.program, - /*firstSourceFile*/ - void 0 - ).forEach( - (file) => handleDtsMayChangeOf( - state, - file.resolvedPath, - invalidateJsFiles, - cancellationToken, - host - ) - ); - removeDiagnosticsOfLibraryFiles(state); - return true; -} -function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, host) { - var _a, _b; - if (!state.referencedMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) return; - if (!isChangedSignature(state, affectedFile.resolvedPath)) return; - if (getIsolatedModules(state.compilerOptions)) { - const seenFileNamesMap = /* @__PURE__ */ new Map(); - seenFileNamesMap.set(affectedFile.resolvedPath, true); - const queue = BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath); - while (queue.length > 0) { - const currentPath = queue.pop(); - if (!seenFileNamesMap.has(currentPath)) { - seenFileNamesMap.set(currentPath, true); - if (handleDtsMayChangeOfGlobalScope( - state, - currentPath, - /*invalidateJsFiles*/ - false, - cancellationToken, - host - )) return; - handleDtsMayChangeOf( - state, - currentPath, - /*invalidateJsFiles*/ - false, - cancellationToken, - host - ); - if (isChangedSignature(state, currentPath)) { - const currentSourceFile = state.program.getSourceFileByPath(currentPath); - queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); - } - } - } - } - const seenFileAndExportsOfFile = /* @__PURE__ */ new Set(); - const invalidateJsFiles = !!((_a = affectedFile.symbol) == null ? void 0 : _a.exports) && !!forEachEntry( - affectedFile.symbol.exports, - (exported) => { - if ((exported.flags & 128 /* ConstEnum */) !== 0) return true; - const aliased = skipAlias(exported, state.program.getTypeChecker()); - if (aliased === exported) return false; - return (aliased.flags & 128 /* ConstEnum */) !== 0 && some(aliased.declarations, (d) => getSourceFileOfNode(d) === affectedFile); - } - ); - (_b = state.referencedMap.getKeys(affectedFile.resolvedPath)) == null ? void 0 : _b.forEach((exportedFromPath) => { - if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, invalidateJsFiles, cancellationToken, host)) return true; - const references = state.referencedMap.getKeys(exportedFromPath); - return references && forEachKey(references, (filePath) => handleDtsMayChangeOfFileAndExportsOfFile( - state, - filePath, - invalidateJsFiles, - seenFileAndExportsOfFile, - cancellationToken, - host - )); - }); -} -function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsFiles, seenFileAndExportsOfFile, cancellationToken, host) { - var _a; - if (!tryAddToSet(seenFileAndExportsOfFile, filePath)) return void 0; - if (handleDtsMayChangeOfGlobalScope(state, filePath, invalidateJsFiles, cancellationToken, host)) return true; - handleDtsMayChangeOf(state, filePath, invalidateJsFiles, cancellationToken, host); - (_a = state.referencedMap.getKeys(filePath)) == null ? void 0 : _a.forEach( - (referencingFilePath) => handleDtsMayChangeOfFileAndExportsOfFile( - state, - referencingFilePath, - invalidateJsFiles, - seenFileAndExportsOfFile, - cancellationToken, - host - ) - ); - return void 0; -} -function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) { - if (state.compilerOptions.noCheck) return emptyArray; - return concatenate( - getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile), - state.program.getProgramDiagnostics(sourceFile) - ); -} -function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) { - semanticDiagnosticsPerFile ?? (semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile); - const path = sourceFile.resolvedPath; - const cachedDiagnostics = semanticDiagnosticsPerFile.get(path); - if (cachedDiagnostics) { - return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions); - } - const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken); - semanticDiagnosticsPerFile.set(path, diagnostics); - state.buildInfoEmitPending = true; - return filterSemanticDiagnostics(diagnostics, state.compilerOptions); -} -function isIncrementalBundleEmitBuildInfo(info) { - var _a; - return !!((_a = info.options) == null ? void 0 : _a.outFile); -} -function isIncrementalBuildInfo(info) { - return !!info.fileNames; -} -function isNonIncrementalBuildInfo(info) { - return !isIncrementalBuildInfo(info) && !!info.root; -} -function ensureHasErrorsForState(state) { - if (state.hasErrors !== void 0) return; - if (isIncrementalCompilation(state.compilerOptions)) { - state.hasErrors = !some(state.program.getSourceFiles(), (f) => { - var _a, _b; - const bindAndCheckDiagnostics = state.semanticDiagnosticsPerFile.get(f.resolvedPath); - return bindAndCheckDiagnostics === void 0 || // Missing semantic diagnostics in cache will be encoded in buildInfo - !!bindAndCheckDiagnostics.length || // cached semantic diagnostics will be encoded in buildInfo - !!((_b = (_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.get(f.resolvedPath)) == null ? void 0 : _b.length); - }) && (hasSyntaxOrGlobalErrors(state) || some(state.program.getSourceFiles(), (f) => !!state.program.getProgramDiagnostics(f).length)); - } else { - state.hasErrors = some(state.program.getSourceFiles(), (f) => { - var _a, _b; - const bindAndCheckDiagnostics = state.semanticDiagnosticsPerFile.get(f.resolvedPath); - return !!(bindAndCheckDiagnostics == null ? void 0 : bindAndCheckDiagnostics.length) || // If has semantic diagnostics - !!((_b = (_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.get(f.resolvedPath)) == null ? void 0 : _b.length); - }) || hasSyntaxOrGlobalErrors(state); - } -} -function hasSyntaxOrGlobalErrors(state) { - return !!state.program.getConfigFileParsingDiagnostics().length || !!state.program.getSyntacticDiagnostics().length || !!state.program.getOptionsDiagnostics().length || !!state.program.getGlobalDiagnostics().length; -} -function getBuildInfoEmitPending(state) { - ensureHasErrorsForState(state); - return state.buildInfoEmitPending ?? (state.buildInfoEmitPending = !!state.hasErrorsFromOldState !== !!state.hasErrors); -} -function getBuildInfo2(state) { - var _a, _b; - const currentDirectory = state.program.getCurrentDirectory(); - const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory)); - const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0; - const fileNames = []; - const fileNameToFileId = /* @__PURE__ */ new Map(); - const rootFileNames = new Set(state.program.getRootFileNames().map((f) => toPath(f, currentDirectory, state.program.getCanonicalFileName))); - ensureHasErrorsForState(state); - if (!isIncrementalCompilation(state.compilerOptions)) { - const buildInfo2 = { - root: arrayFrom(rootFileNames, (r) => relativeToBuildInfo(r)), - errors: state.hasErrors ? true : void 0, - checkPending: state.checkPending, - version - }; - return buildInfo2; - } - const root = []; - if (state.compilerOptions.outFile) { - const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => { - const fileId = toFileId(key); - tryAddRoot(key, fileId); - return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version; - }); - const buildInfo2 = { - fileNames, - fileInfos: fileInfos2, - root, - resolvedRoot: toResolvedRoot(), - options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions), - semanticDiagnosticsPerFile: !state.changedFilesSet.size ? toIncrementalBuildInfoDiagnostics() : void 0, - emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(), - changeFileSet: toChangeFileSet(), - outSignature: state.outSignature, - latestChangedDtsFile, - pendingEmit: !state.programEmitPending ? void 0 : ( - // Pending is undefined or None is encoded as undefined - state.programEmitPending === getBuilderFileEmit(state.compilerOptions) ? false : ( - // Pending emit is same as deteremined by compilerOptions - state.programEmitPending - ) - ), - // Actual value - errors: state.hasErrors ? true : void 0, - checkPending: state.checkPending, - version - }; - return buildInfo2; - } - let fileIdsList; - let fileNamesToFileIdListId; - let emitSignatures; - const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]) => { - var _a2, _b2; - const fileId = toFileId(key); - tryAddRoot(key, fileId); - Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key)); - const oldSignature = (_a2 = state.oldSignatures) == null ? void 0 : _a2.get(key); - const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value.signature; - if (state.compilerOptions.composite) { - const file = state.program.getSourceFileByPath(key); - if (!isJsonSourceFile(file) && sourceFileMayBeEmitted(file, state.program)) { - const emitSignature = (_b2 = state.emitSignatures) == null ? void 0 : _b2.get(key); - if (emitSignature !== actualSignature) { - emitSignatures = append( - emitSignatures, - 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] - ) - ); - } - } - } - return value.version === actualSignature ? value.affectsGlobalScope || value.impliedFormat ? ( - // If file version is same as signature, dont serialize signature - { version: value.version, signature: void 0, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } - ) : ( - // If file info only contains version and signature and both are same we can just write string - value.version - ) : actualSignature !== void 0 ? ( - // If signature is not same as version, encode signature in the fileInfo - oldSignature === void 0 ? ( - // If we havent computed signature, use fileInfo as is - value - ) : ( - // Serialize fileInfo with new updated signature - { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } - ) - ) : ( - // Signature of the FileInfo is undefined, serialize it as false - { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } - ); - }); - let referencedMap; - if ((_a = state.referencedMap) == null ? void 0 : _a.size()) { - referencedMap = arrayFrom(state.referencedMap.keys()).sort(compareStringsCaseSensitive).map((key) => [ - toFileId(key), - toFileIdListId(state.referencedMap.getValues(key)) - ]); - } - const semanticDiagnosticsPerFile = toIncrementalBuildInfoDiagnostics(); - let affectedFilesPendingEmit; - if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) { - const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions); - const seenFiles = /* @__PURE__ */ new Set(); - for (const path of arrayFrom(state.affectedFilesPendingEmit.keys()).sort(compareStringsCaseSensitive)) { - if (tryAddToSet(seenFiles, path)) { - const file = state.program.getSourceFileByPath(path); - if (!file || !sourceFileMayBeEmitted(file, state.program)) continue; - const fileId = toFileId(path), pendingEmit = state.affectedFilesPendingEmit.get(path); - affectedFilesPendingEmit = append( - affectedFilesPendingEmit, - pendingEmit === fullEmitForOptions ? fileId : ( - // Pending full emit per options - pendingEmit === 24 /* Dts */ ? [fileId] : ( - // Pending on Dts only - [fileId, pendingEmit] - ) - ) - // Anything else - ); - } - } - } - const buildInfo = { - fileNames, - fileIdsList, - fileInfos, - root, - resolvedRoot: toResolvedRoot(), - options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions), - referencedMap, - semanticDiagnosticsPerFile, - emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(), - changeFileSet: toChangeFileSet(), - affectedFilesPendingEmit, - emitSignatures, - latestChangedDtsFile, - errors: state.hasErrors ? true : void 0, - checkPending: state.checkPending, - version - }; - return buildInfo; - function relativeToBuildInfoEnsuringAbsolutePath(path) { - return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory)); - } - function relativeToBuildInfo(path) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName)); - } - function toFileId(path) { - let fileId = fileNameToFileId.get(path); - if (fileId === void 0) { - fileNames.push(relativeToBuildInfo(path)); - fileNameToFileId.set(path, fileId = fileNames.length); - } - return fileId; - } - function toFileIdListId(set) { - const fileIds = arrayFrom(set.keys(), toFileId).sort(compareValues); - const key = fileIds.join(); - let fileIdListId = fileNamesToFileIdListId == null ? void 0 : fileNamesToFileIdListId.get(key); - if (fileIdListId === void 0) { - fileIdsList = append(fileIdsList, fileIds); - (fileNamesToFileIdListId ?? (fileNamesToFileIdListId = /* @__PURE__ */ new Map())).set(key, fileIdListId = fileIdsList.length); - } - return fileIdListId; - } - function tryAddRoot(path, fileId) { - const file = state.program.getSourceFile(path); - if (!state.program.getFileIncludeReasons().get(file.path).some((r) => r.kind === 0 /* RootFile */)) return; - if (!root.length) return root.push(fileId); - const last2 = root[root.length - 1]; - const isLastStartEnd = isArray(last2); - if (isLastStartEnd && last2[1] === fileId - 1) return last2[1] = fileId; - if (isLastStartEnd || root.length === 1 || last2 !== fileId - 1) return root.push(fileId); - const lastButOne = root[root.length - 2]; - if (!isNumber(lastButOne) || lastButOne !== last2 - 1) return root.push(fileId); - root[root.length - 2] = [lastButOne, fileId]; - return root.length = root.length - 1; - } - function toResolvedRoot() { - let result; - rootFileNames.forEach((path) => { - const file = state.program.getSourceFileByPath(path); - if (file && path !== file.resolvedPath) { - result = append(result, [toFileId(file.resolvedPath), toFileId(path)]); - } - }); - return result; - } - function toIncrementalBuildInfoCompilerOptions(options) { - let result; - const { optionsNameMap } = getOptionsNameMap(); - for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) { - const optionInfo = optionsNameMap.get(name.toLowerCase()); - if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) { - (result || (result = {}))[name] = toReusableCompilerOptionValue( - optionInfo, - options[name] - ); - } - } - return result; - } - function toReusableCompilerOptionValue(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); - } - } - return value; - } - function toIncrementalBuildInfoDiagnostics() { - let result; - state.fileInfos.forEach((_value, key) => { - const value = state.semanticDiagnosticsPerFile.get(key); - if (!value) { - if (!state.changedFilesSet.has(key)) result = append(result, toFileId(key)); - } else if (value.length) { - result = append(result, [ - toFileId(key), - toReusableDiagnostic(value, key) - ]); - } - }); - return result; - } - function toIncrementalBuildInfoEmitDiagnostics() { - var _a2; - let result; - if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) return result; - for (const key of arrayFrom(state.emitDiagnosticsPerFile.keys()).sort(compareStringsCaseSensitive)) { - const value = state.emitDiagnosticsPerFile.get(key); - result = append(result, [ - toFileId(key), - toReusableDiagnostic(value, key) - ]); - } - return result; - } - function toReusableDiagnostic(diagnostics, diagnosticFilePath) { - Debug.assert(!!diagnostics.length); - return diagnostics.map((diagnostic) => { - const result = toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath); - 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) => toReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0; - return result; - }); - } - function toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) { - const { file } = diagnostic; - return { - ...diagnostic, - file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false, - messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText) - }; - } - function toReusableDiagnosticMessageChain(chain) { - if (chain.repopulateInfo) { - return { - info: chain.repopulateInfo(), - next: toReusableDiagnosticMessageChainArray(chain.next) - }; - } - const next = toReusableDiagnosticMessageChainArray(chain.next); - return next === chain.next ? chain : { ...chain, next }; - } - function toReusableDiagnosticMessageChainArray(array) { - if (!array) return array; - return forEach(array, (chain, index) => { - const reusable = toReusableDiagnosticMessageChain(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(toReusableDiagnosticMessageChain(array[i])); - } - return result; - }) || array; - } - function toChangeFileSet() { - let changeFileSet; - if (state.changedFilesSet.size) { - for (const path of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) { - changeFileSet = append(changeFileSet, toFileId(path)); - } - } - return changeFileSet; - } -} -var BuilderProgramKind = /* @__PURE__ */ ((BuilderProgramKind2) => { - BuilderProgramKind2[BuilderProgramKind2["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram"; - BuilderProgramKind2[BuilderProgramKind2["EmitAndSemanticDiagnosticsBuilderProgram"] = 1] = "EmitAndSemanticDiagnosticsBuilderProgram"; - return BuilderProgramKind2; -})(BuilderProgramKind || {}); -function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { - let host; - let newProgram; - let oldProgram; - if (newProgramOrRootNames === void 0) { - Debug.assert(hostOrOptions === void 0); - host = oldProgramOrHost; - oldProgram = configFileParsingDiagnosticsOrOldProgram; - Debug.assert(!!oldProgram); - newProgram = oldProgram.getProgram(); - } else if (isArray(newProgramOrRootNames)) { - oldProgram = configFileParsingDiagnosticsOrOldProgram; - newProgram = createProgram({ - rootNames: newProgramOrRootNames, - options: hostOrOptions, - host: oldProgramOrHost, - oldProgram: oldProgram && oldProgram.getProgramOrUndefined(), - configFileParsingDiagnostics, - projectReferences - }); - host = oldProgramOrHost; - } else { - newProgram = newProgramOrRootNames; - host = hostOrOptions; - oldProgram = oldProgramOrHost; - configFileParsingDiagnostics = configFileParsingDiagnosticsOrOldProgram; - } - return { host, newProgram, oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || emptyArray }; -} -function getTextHandlingSourceMapForSignature(text, data) { - return (data == null ? void 0 : data.sourceMapUrlPos) !== void 0 ? text.substring(0, data.sourceMapUrlPos) : text; -} -function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) { - var _a; - 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"); - } - return (host.createHash ?? generateDjb2Hash)(text); - function flattenDiagnosticMessageText2(diagnostic) { - return isString(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n"); - } - function locationInfo(diagnostic) { - if (diagnostic.file.resolvedPath === sourceFile.resolvedPath) return `(${diagnostic.start},${diagnostic.length})`; - if (sourceFileDirectory === void 0) sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath); - return `${ensurePathIsNonModuleName(getRelativePathFromDirectory( - sourceFileDirectory, - diagnostic.file.resolvedPath, - program.getCanonicalFileName - ))}(${diagnostic.start},${diagnostic.length})`; - } -} -function computeSignature(text, host, data) { - return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data)); -} -function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) { - let oldState = oldProgram && oldProgram.state; - if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) { - newProgram = void 0; - oldState = void 0; - return oldProgram; - } - const state = createBuilderProgramState(newProgram, oldState); - newProgram.getBuildInfo = () => getBuildInfo2(toBuilderProgramStateWithDefinedProgram(state)); - newProgram = void 0; - oldProgram = void 0; - oldState = void 0; - const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics); - builderProgram.state = state; - builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature; - builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies( - state, - Debug.checkDefined(state.program), - sourceFile - ); - builderProgram.getSemanticDiagnostics = getSemanticDiagnostics; - builderProgram.getDeclarationDiagnostics = getDeclarationDiagnostics2; - builderProgram.emit = emit; - builderProgram.releaseProgram = () => releaseCache(state); - if (kind === 0 /* SemanticDiagnosticsBuilderProgram */) { - builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; - } else if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) { - builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; - builderProgram.emitNextAffectedFile = emitNextAffectedFile; - builderProgram.emitBuildInfo = emitBuildInfo; - } else { - notImplemented(); - } - return builderProgram; - function emitBuildInfo(writeFile2, cancellationToken) { - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - if (getBuildInfoEmitPending(state)) { - const result = state.program.emitBuildInfo( - writeFile2 || maybeBind(host, host.writeFile), - cancellationToken - ); - state.buildInfoEmitPending = false; - return result; - } - return emitSkippedWithNoDiagnostics; - } - function emitNextAffectedFileOrDtsErrors(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers, isForDtsErrors) { - var _a, _b, _c, _d; - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - let affected = getNextAffectedFile(state, cancellationToken, host); - const programEmitKind = getBuilderFileEmit(state.compilerOptions); - let emitKind = !isForDtsErrors ? emitOnlyDtsFiles ? programEmitKind & 56 /* AllDts */ : programEmitKind : 8 /* DtsErrors */; - if (!affected) { - if (!state.compilerOptions.outFile) { - const pendingAffectedFile = getNextAffectedFilePendingEmit( - state, - emitOnlyDtsFiles, - isForDtsErrors - ); - if (pendingAffectedFile) { - ({ affectedFile: affected, emitKind } = pendingAffectedFile); - } else { - const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile( - state, - isForDtsErrors - ); - if (pendingForDiagnostics) { - (state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set( - pendingForDiagnostics.affectedFile.resolvedPath, - pendingForDiagnostics.seenKind | getBuilderFileEmitAllDts(isForDtsErrors) - ); - return { - result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics }, - affected: pendingForDiagnostics.affectedFile - }; - } - } - } else { - if (state.programEmitPending) { - emitKind = getPendingEmitKindWithSeen( - state.programEmitPending, - state.seenProgramEmit, - emitOnlyDtsFiles, - isForDtsErrors - ); - if (emitKind) affected = state.program; - } - if (!affected && ((_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.size)) { - const seenKind = state.seenProgramEmit || 0 /* None */; - if (!(seenKind & getBuilderFileEmitAllDts(isForDtsErrors))) { - state.seenProgramEmit = getBuilderFileEmitAllDts(isForDtsErrors) | seenKind; - const diagnostics = []; - state.emitDiagnosticsPerFile.forEach((d) => addRange(diagnostics, d)); - return { - result: { emitSkipped: true, diagnostics }, - affected: state.program - }; - } - } - } - if (!affected) { - if (isForDtsErrors || !getBuildInfoEmitPending(state)) return void 0; - const affected2 = state.program; - const result2 = affected2.emitBuildInfo( - writeFile2 || maybeBind(host, host.writeFile), - cancellationToken - ); - state.buildInfoEmitPending = false; - return { result: result2, affected: affected2 }; - } - } - let emitOnly; - if (emitKind & 7 /* AllJs */) emitOnly = 0 /* Js */; - if (emitKind & 56 /* AllDts */) emitOnly = emitOnly === void 0 ? 1 /* Dts */ : void 0; - const result = !isForDtsErrors ? state.program.emit( - affected === state.program ? void 0 : affected, - getWriteFileCallback(writeFile2, customTransformers), - cancellationToken, - emitOnly, - customTransformers, - /*forceDtsEmit*/ - void 0, - /*skipBuildInfo*/ - true - ) : { - emitSkipped: true, - diagnostics: state.program.getDeclarationDiagnostics( - affected === state.program ? void 0 : affected, - cancellationToken - ) - }; - if (affected !== state.program) { - const affectedSourceFile = affected; - state.seenAffectedFiles.add(affectedSourceFile.resolvedPath); - if (state.affectedFilesIndex !== void 0) state.affectedFilesIndex++; - state.buildInfoEmitPending = true; - const existing = ((_b = state.seenEmittedFiles) == null ? void 0 : _b.get(affectedSourceFile.resolvedPath)) || 0 /* None */; - (state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, emitKind | existing); - const existingPending = ((_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.get(affectedSourceFile.resolvedPath)) || programEmitKind; - const pendingKind = getPendingEmitKind(existingPending, emitKind | existing); - if (pendingKind) (state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, pendingKind); - else (_d = state.affectedFilesPendingEmit) == null ? void 0 : _d.delete(affectedSourceFile.resolvedPath); - if (result.diagnostics.length) (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, result.diagnostics); - } else { - state.changedFilesSet.clear(); - state.programEmitPending = state.changedFilesSet.size ? getPendingEmitKind(programEmitKind, emitKind) : state.programEmitPending ? getPendingEmitKind(state.programEmitPending, emitKind) : void 0; - state.seenProgramEmit = emitKind | (state.seenProgramEmit || 0 /* None */); - setEmitDiagnosticsPerFile(result.diagnostics); - state.buildInfoEmitPending = true; - } - return { result, affected }; - } - function setEmitDiagnosticsPerFile(diagnostics) { - let emitDiagnosticsPerFile; - diagnostics.forEach((d) => { - if (!d.file) return; - let diagnostics2 = emitDiagnosticsPerFile == null ? void 0 : emitDiagnosticsPerFile.get(d.file.resolvedPath); - if (!diagnostics2) (emitDiagnosticsPerFile ?? (emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(d.file.resolvedPath, diagnostics2 = []); - diagnostics2.push(d); - }); - if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile; - } - function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { - return emitNextAffectedFileOrDtsErrors( - writeFile2, - cancellationToken, - emitOnlyDtsFiles, - customTransformers, - /*isForDtsErrors*/ - false - ); - } - function getWriteFileCallback(writeFile2, customTransformers) { - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile); - return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => { - var _a, _b, _c; - if (isDeclarationFileName(fileName)) { - if (!state.compilerOptions.outFile) { - Debug.assert((sourceFiles == null ? void 0 : sourceFiles.length) === 1); - let emitSignature; - if (!customTransformers) { - const file = sourceFiles[0]; - const info = state.fileInfos.get(file.resolvedPath); - if (info.signature === file.version) { - const signature = computeSignatureWithDiagnostics( - state.program, - file, - text, - host, - data - ); - if (!((_a = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a.length)) emitSignature = signature; - if (signature !== file.version) { - if (host.storeSignatureInfo) (state.signatureInfo ?? (state.signatureInfo = /* @__PURE__ */ new Map())).set(file.resolvedPath, 1 /* StoredSignatureAtEmit */); - if (state.affectedFiles) { - const existing = (_b = state.oldSignatures) == null ? void 0 : _b.get(file.resolvedPath); - if (existing === void 0) (state.oldSignatures ?? (state.oldSignatures = /* @__PURE__ */ new Map())).set(file.resolvedPath, info.signature || false); - info.signature = signature; - } else { - info.signature = signature; - } - } - } - } - if (state.compilerOptions.composite) { - const filePath = sourceFiles[0].resolvedPath; - emitSignature = handleNewSignature((_c = state.emitSignatures) == null ? void 0 : _c.get(filePath), emitSignature); - if (!emitSignature) return data.skippedDtsWrite = true; - (state.emitSignatures ?? (state.emitSignatures = /* @__PURE__ */ new Map())).set(filePath, emitSignature); - } - } else if (state.compilerOptions.composite) { - const newSignature = handleNewSignature( - state.outSignature, - /*newSignature*/ - void 0 - ); - if (!newSignature) return data.skippedDtsWrite = true; - state.outSignature = newSignature; - } - } - if (writeFile2) writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data); - else if (host.writeFile) host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); - else state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); - function handleNewSignature(oldSignatureFormat, newSignature) { - const oldSignature = !oldSignatureFormat || isString(oldSignatureFormat) ? oldSignatureFormat : oldSignatureFormat[0]; - newSignature ?? (newSignature = computeSignature(text, host, data)); - if (newSignature === oldSignature) { - if (oldSignatureFormat === oldSignature) return void 0; - else if (data) data.differsOnlyInMap = true; - else data = { differsOnlyInMap: true }; - } else { - state.hasChangedEmitSignature = true; - state.latestChangedDtsFile = fileName; - } - return newSignature; - } - }; - } - function emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) { - assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - } - const result = handleNoEmitOptions(builderProgram, targetSourceFile, writeFile2, cancellationToken); - if (result) return result; - if (!targetSourceFile) { - if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) { - let sourceMaps = []; - let emitSkipped = false; - let diagnostics; - let emittedFiles = []; - let affectedEmitResult; - while (affectedEmitResult = emitNextAffectedFile( - writeFile2, - cancellationToken, - emitOnlyDtsFiles, - customTransformers - )) { - emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; - diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics); - emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles); - sourceMaps = addRange(sourceMaps, affectedEmitResult.result.sourceMaps); - } - return { - emitSkipped, - diagnostics: diagnostics || emptyArray, - emittedFiles, - sourceMaps - }; - } else { - clearAffectedFilesPendingEmit( - state, - emitOnlyDtsFiles, - /*isForDtsErrors*/ - false - ); - } - } - const emitResult = state.program.emit( - targetSourceFile, - getWriteFileCallback(writeFile2, customTransformers), - cancellationToken, - emitOnlyDtsFiles, - customTransformers - ); - handleNonEmitBuilderWithEmitOrDtsErrors( - targetSourceFile, - emitOnlyDtsFiles, - /*isForDtsErrors*/ - false, - emitResult.diagnostics - ); - return emitResult; - } - function handleNonEmitBuilderWithEmitOrDtsErrors(targetSourceFile, emitOnlyDtsFiles, isForDtsErrors, diagnostics) { - if (!targetSourceFile && kind !== 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) { - clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles, isForDtsErrors); - setEmitDiagnosticsPerFile(diagnostics); - } - } - function getDeclarationDiagnostics2(sourceFile, cancellationToken) { - var _a; - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) { - assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); - let affectedEmitResult; - let diagnostics; - while (affectedEmitResult = emitNextAffectedFileOrDtsErrors( - /*writeFile*/ - void 0, - cancellationToken, - /*emitOnlyDtsFiles*/ - void 0, - /*customTransformers*/ - void 0, - /*isForDtsErrors*/ - true - )) { - if (!sourceFile) diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics); - } - return (!sourceFile ? diagnostics : (_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.get(sourceFile.resolvedPath)) || emptyArray; - } else { - const result = state.program.getDeclarationDiagnostics(sourceFile, cancellationToken); - handleNonEmitBuilderWithEmitOrDtsErrors( - sourceFile, - /*emitOnlyDtsFiles*/ - void 0, - /*isForDtsErrors*/ - true, - result - ); - return result; - } - } - function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) { - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - while (true) { - const affected = getNextAffectedFile(state, cancellationToken, host); - let result; - if (!affected) { - if (state.checkPending && !state.compilerOptions.noCheck) { - state.checkPending = void 0; - state.buildInfoEmitPending = true; - } - return void 0; - } else if (affected !== state.program) { - const affectedSourceFile = affected; - if (!ignoreSourceFile || !ignoreSourceFile(affectedSourceFile)) { - result = getSemanticDiagnosticsOfFile(state, affectedSourceFile, cancellationToken); - } - state.seenAffectedFiles.add(affectedSourceFile.resolvedPath); - state.affectedFilesIndex++; - state.buildInfoEmitPending = true; - if (!result) continue; - } else { - let diagnostics; - const semanticDiagnosticsPerFile = /* @__PURE__ */ new Map(); - state.program.getSourceFiles().forEach( - (sourceFile) => diagnostics = addRange( - diagnostics, - getSemanticDiagnosticsOfFile( - state, - sourceFile, - cancellationToken, - semanticDiagnosticsPerFile - ) - ) - ); - state.semanticDiagnosticsPerFile = semanticDiagnosticsPerFile; - result = diagnostics || emptyArray; - state.changedFilesSet.clear(); - state.programEmitPending = getBuilderFileEmit(state.compilerOptions); - if (!state.compilerOptions.noCheck) state.checkPending = void 0; - state.buildInfoEmitPending = true; - } - return { result, affected }; - } - } - function getSemanticDiagnostics(sourceFile, cancellationToken) { - Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); - assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); - if (sourceFile) { - return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); - } - while (true) { - const affectedResult = getSemanticDiagnosticsOfNextAffectedFile(cancellationToken); - if (!affectedResult) break; - if (affectedResult.affected === state.program) return affectedResult.result; - } - let diagnostics; - for (const sourceFile2 of state.program.getSourceFiles()) { - diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken)); - } - if (state.checkPending && !state.compilerOptions.noCheck) { - state.checkPending = void 0; - state.buildInfoEmitPending = true; - } - return diagnostics || emptyArray; - } -} -function addToAffectedFilesPendingEmit(state, affectedFilePendingEmit, kind) { - 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 }; -} -function toBuilderFileEmit(value, fullEmitForOptions) { - return isNumber(value) ? fullEmitForOptions : value[1] || 24 /* Dts */; -} -function toProgramEmitPending(value, options) { - return !value ? getBuilderFileEmit(options || {}) : value; -} -function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host) { - var _a, _b, _c, _d; - const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); - const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - let state; - const filePaths = (_a = buildInfo.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory); - let filePathsSetList; - const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0; - const fileInfos = /* @__PURE__ */ new Map(); - const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath)); - if (isIncrementalBundleEmitBuildInfo(buildInfo)) { - buildInfo.fileInfos.forEach((fileInfo, index) => { - const path = toFilePath(index + 1); - fileInfos.set(path, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo); - }); - state = { - fileInfos, - compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {}, - semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile), - emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile), - hasReusableDiagnostic: true, - changedFilesSet, - latestChangedDtsFile, - outSignature: buildInfo.outSignature, - programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options), - hasErrors: buildInfo.errors, - checkPending: buildInfo.checkPending - }; - } else { - filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath))); - const emitSignatures = ((_c = buildInfo.options) == null ? void 0 : _c.composite) && !buildInfo.options.outFile ? /* @__PURE__ */ new Map() : void 0; - buildInfo.fileInfos.forEach((fileInfo, index) => { - const path = toFilePath(index + 1); - const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo); - fileInfos.set(path, stateFileInfo); - if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path, stateFileInfo.signature); - }); - (_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => { - if (isNumber(value)) emitSignatures.delete(toFilePath(value)); - else { - const key = toFilePath(value[0]); - emitSignatures.set( - key, - !isString(value[1]) && !value[1].length ? ( - // File signature is emit signature but differs in map - [emitSignatures.get(key)] - ) : value[1] - ); - } - }); - const fullEmitForOptions = buildInfo.affectedFilesPendingEmit ? getBuilderFileEmit(buildInfo.options || {}) : void 0; - state = { - fileInfos, - compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {}, - referencedMap: toManyToManyPathMap(buildInfo.referencedMap, buildInfo.options ?? {}), - semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile), - emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile), - hasReusableDiagnostic: true, - changedFilesSet, - affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)), - latestChangedDtsFile, - emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0, - hasErrors: buildInfo.errors, - checkPending: buildInfo.checkPending - }; - } - return { - state, - getProgram: notImplemented, - getProgramOrUndefined: returnUndefined, - releaseProgram: noop, - getCompilerOptions: () => state.compilerOptions, - getSourceFile: notImplemented, - getSourceFiles: notImplemented, - getOptionsDiagnostics: notImplemented, - getGlobalDiagnostics: notImplemented, - getConfigFileParsingDiagnostics: notImplemented, - getSyntacticDiagnostics: notImplemented, - getDeclarationDiagnostics: notImplemented, - getSemanticDiagnostics: notImplemented, - emit: notImplemented, - getAllDependencies: notImplemented, - getCurrentDirectory: notImplemented, - emitNextAffectedFile: notImplemented, - getSemanticDiagnosticsOfNextAffectedFile: notImplemented, - emitBuildInfo: notImplemented, - close: noop, - hasChangedEmitSignature: returnFalse - }; - function toPathInBuildInfoDirectory(path) { - return toPath(path, buildInfoDirectory, getCanonicalFileName); - } - function toAbsolutePath(path) { - return getNormalizedAbsolutePath(path, buildInfoDirectory); - } - function toFilePath(fileId) { - return filePaths[fileId - 1]; - } - function toFilePathsSet(fileIdsListId) { - return filePathsSetList[fileIdsListId - 1]; - } - function toManyToManyPathMap(referenceMap, options) { - const map2 = BuilderState.createReferencedMap(options); - if (!map2 || !referenceMap) return map2; - referenceMap.forEach(([fileId, fileIdListId]) => map2.set(toFilePath(fileId), toFilePathsSet(fileIdListId))); - return map2; - } - function toPerFileSemanticDiagnostics(diagnostics) { - const semanticDiagnostics = new Map( - mapDefinedIterator( - fileInfos.keys(), - (key) => !changedFilesSet.has(key) ? [key, emptyArray] : void 0 - ) - ); - diagnostics == null ? void 0 : diagnostics.forEach((value) => { - if (isNumber(value)) semanticDiagnostics.delete(toFilePath(value)); - else semanticDiagnostics.set(toFilePath(value[0]), value[1]); - }); - return semanticDiagnostics; - } - function toPerFileEmitDiagnostics(diagnostics) { - return diagnostics && arrayToMap(diagnostics, (value) => toFilePath(value[0]), (value) => value[1]); - } -} -function getBuildInfoFileVersionMap(program, buildInfoPath, host) { - const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); - const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - const fileInfos = /* @__PURE__ */ new Map(); - let rootIndex = 0; - const roots = /* @__PURE__ */ new Map(); - const resolvedRoots = new Map(program.resolvedRoot); - program.fileInfos.forEach((fileInfo, index) => { - const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName); - const version2 = isString(fileInfo) ? fileInfo : fileInfo.version; - fileInfos.set(path, version2); - if (rootIndex < program.root.length) { - const current = program.root[rootIndex]; - const fileId = index + 1; - if (isArray(current)) { - if (current[0] <= fileId && fileId <= current[1]) { - addRoot(fileId, path); - if (current[1] === fileId) rootIndex++; - } - } else if (current === fileId) { - addRoot(fileId, path); - rootIndex++; - } - } - }); - return { fileInfos, roots }; - function addRoot(fileId, path) { - const root = resolvedRoots.get(fileId); - if (root) { - roots.set(toPath(program.fileNames[root - 1], buildInfoDirectory, getCanonicalFileName), path); - } else { - roots.set(path, void 0); - } - } -} -function getNonIncrementalBuildInfoRoots(buildInfo, buildInfoPath, host) { - if (!isNonIncrementalBuildInfo(buildInfo)) return void 0; - const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); - const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - return buildInfo.root.map((r) => toPath(r, buildInfoDirectory, getCanonicalFileName)); -} -function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) { - return { - state: void 0, - getProgram, - getProgramOrUndefined: () => state.program, - releaseProgram: () => state.program = void 0, - getCompilerOptions: () => state.compilerOptions, - getSourceFile: (fileName) => getProgram().getSourceFile(fileName), - getSourceFiles: () => getProgram().getSourceFiles(), - getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken), - getGlobalDiagnostics: (cancellationToken) => getProgram().getGlobalDiagnostics(cancellationToken), - getConfigFileParsingDiagnostics: () => configFileParsingDiagnostics, - getSyntacticDiagnostics: (sourceFile, cancellationToken) => getProgram().getSyntacticDiagnostics(sourceFile, cancellationToken), - getDeclarationDiagnostics: (sourceFile, cancellationToken) => getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken), - getSemanticDiagnostics: (sourceFile, cancellationToken) => getProgram().getSemanticDiagnostics(sourceFile, cancellationToken), - emit: (sourceFile, writeFile2, cancellationToken, emitOnlyDts, customTransformers) => getProgram().emit(sourceFile, writeFile2, cancellationToken, emitOnlyDts, customTransformers), - emitBuildInfo: (writeFile2, cancellationToken) => getProgram().emitBuildInfo(writeFile2, cancellationToken), - getAllDependencies: notImplemented, - getCurrentDirectory: () => getProgram().getCurrentDirectory(), - close: noop - }; - function getProgram() { - return Debug.checkDefined(state.program); - } -} - -// src/compiler/builderPublic.ts -function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { - return createBuilderProgram( - 0 /* SemanticDiagnosticsBuilderProgram */, - getBuilderCreationParameters( - newProgramOrRootNames, - hostOrOptions, - oldProgramOrHost, - configFileParsingDiagnosticsOrOldProgram, - configFileParsingDiagnostics, - projectReferences - ) - ); -} -function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { - return createBuilderProgram( - 1 /* EmitAndSemanticDiagnosticsBuilderProgram */, - getBuilderCreationParameters( - newProgramOrRootNames, - hostOrOptions, - oldProgramOrHost, - configFileParsingDiagnosticsOrOldProgram, - configFileParsingDiagnostics, - projectReferences - ) - ); -} -function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { - const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters( - newProgramOrRootNames, - hostOrOptions, - oldProgramOrHost, - configFileParsingDiagnosticsOrOldProgram, - configFileParsingDiagnostics, - projectReferences - ); - return createRedirectedBuilderProgram( - { program: newProgram, compilerOptions: newProgram.getCompilerOptions() }, - newConfigFileParsingDiagnostics - ); -} - -// src/compiler/resolutionCache.ts -function removeIgnoredPath(path) { - if (endsWith(path, "/node_modules/.staging")) { - return removeSuffix(path, "/.staging"); - } - return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path; -} -function perceivedOsRootLengthForWatching(pathComponents2, length2) { - if (length2 <= 1) return 1; - let indexAfterOsRoot = 1; - let isDosStyle = pathComponents2[0].search(/[a-z]:/i) === 0; - if (pathComponents2[0] !== directorySeparator && !isDosStyle && // Non dos style paths - pathComponents2[1].search(/[a-z]\$$/i) === 0) { - if (length2 === 2) return 2; - indexAfterOsRoot = 2; - isDosStyle = true; - } - if (isDosStyle && !pathComponents2[indexAfterOsRoot].match(/^users$/i)) { - return indexAfterOsRoot; - } - if (pathComponents2[indexAfterOsRoot].match(/^workspaces$/i)) { - return indexAfterOsRoot + 1; - } - return indexAfterOsRoot + 2; -} -function canWatchDirectoryOrFile(pathComponents2, length2) { - if (length2 === void 0) length2 = pathComponents2.length; - if (length2 <= 2) return false; - const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2); - return length2 > perceivedOsRootLength + 1; -} -function canWatchDirectoryOrFilePath(path) { - return canWatchDirectoryOrFile(getPathComponents(path)); -} -function canWatchAtTypes(atTypes) { - return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes)); -} -function isInDirectoryPath(dirComponents, fileOrDirComponents) { - if (fileOrDirComponents.length < dirComponents.length) return false; - for (let i = 0; i < dirComponents.length; i++) { - if (fileOrDirComponents[i] !== dirComponents[i]) return false; - } - return true; -} -function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) { - return canWatchDirectoryOrFilePath(fileOrDirPath); -} -function canWatchAffectingLocation(filePath) { - return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath); -} -function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch) { - const failedLookupPathComponents = getPathComponents(failedLookupLocationPath); - failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory()); - const failedLookupComponents = getPathComponents(failedLookupLocation); - const perceivedOsRootLength = perceivedOsRootLengthForWatching(failedLookupPathComponents, failedLookupPathComponents.length); - if (failedLookupPathComponents.length <= perceivedOsRootLength + 1) return void 0; - const nodeModulesIndex = failedLookupPathComponents.indexOf("node_modules"); - if (nodeModulesIndex !== -1 && nodeModulesIndex + 1 <= perceivedOsRootLength + 1) return void 0; - const lastNodeModulesIndex = failedLookupPathComponents.lastIndexOf("node_modules"); - if (isRootWatchable && isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) { - if (failedLookupPathComponents.length > rootPathComponents.length + 1) { - return getDirectoryOfFailedLookupWatch( - failedLookupComponents, - failedLookupPathComponents, - Math.max(rootPathComponents.length + 1, perceivedOsRootLength + 1), - lastNodeModulesIndex - ); - } else { - return { - dir: rootDir, - dirPath: rootPath, - nonRecursive: true - }; - } - } - return getDirectoryToWatchFromFailedLookupLocationDirectory( - failedLookupComponents, - failedLookupPathComponents, - failedLookupPathComponents.length - 1, - perceivedOsRootLength, - nodeModulesIndex, - rootPathComponents, - lastNodeModulesIndex, - preferNonRecursiveWatch - ); -} -function getDirectoryToWatchFromFailedLookupLocationDirectory(dirComponents, dirPathComponents, dirPathComponentsLength, perceivedOsRootLength, nodeModulesIndex, rootPathComponents, lastNodeModulesIndex, preferNonRecursiveWatch) { - if (nodeModulesIndex !== -1) { - return getDirectoryOfFailedLookupWatch( - dirComponents, - dirPathComponents, - nodeModulesIndex + 1, - lastNodeModulesIndex - ); - } - let nonRecursive = true; - let length2 = dirPathComponentsLength; - if (!preferNonRecursiveWatch) { - for (let i = 0; i < dirPathComponentsLength; i++) { - if (dirPathComponents[i] !== rootPathComponents[i]) { - nonRecursive = false; - length2 = Math.max(i + 1, perceivedOsRootLength + 1); - break; - } - } - } - return getDirectoryOfFailedLookupWatch( - dirComponents, - dirPathComponents, - length2, - lastNodeModulesIndex, - nonRecursive - ); -} -function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, length2, lastNodeModulesIndex, nonRecursive) { - let packageDirLength; - if (lastNodeModulesIndex !== -1 && lastNodeModulesIndex + 1 >= length2 && lastNodeModulesIndex + 2 < dirPathComponents.length) { - if (!startsWith(dirPathComponents[lastNodeModulesIndex + 1], "@")) { - packageDirLength = lastNodeModulesIndex + 2; - } else if (lastNodeModulesIndex + 3 < dirPathComponents.length) { - packageDirLength = lastNodeModulesIndex + 3; - } - } - return { - dir: getPathFromPathComponents(dirComponents, length2), - dirPath: getPathFromPathComponents(dirPathComponents, length2), - nonRecursive, - packageDir: packageDirLength !== void 0 ? getPathFromPathComponents(dirComponents, packageDirLength) : void 0, - packageDirPath: packageDirLength !== void 0 ? getPathFromPathComponents(dirPathComponents, packageDirLength) : void 0 - }; -} -function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) { - const typeRootPathComponents = getPathComponents(typeRootPath); - if (isRootWatchable && isInDirectoryPath(rootPathComponents, typeRootPathComponents)) { - return rootPath; - } - typeRoot = isRootedDiskPath(typeRoot) ? normalizePath(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory()); - const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory( - getPathComponents(typeRoot), - typeRootPathComponents, - typeRootPathComponents.length, - perceivedOsRootLengthForWatching(typeRootPathComponents, typeRootPathComponents.length), - typeRootPathComponents.indexOf("node_modules"), - rootPathComponents, - typeRootPathComponents.lastIndexOf("node_modules"), - preferNonRecursiveWatch - ); - return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : void 0; -} -function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory) { - const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()); - return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized; -} -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.getGlobalTypingsCacheLocation) { - return primaryResult; - } - const globalCache = resolutionHost.getGlobalTypingsCacheLocation(); - 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; - let filesWithInvalidatedNonRelativeUnresolvedImports; - const nonRelativeExternalModuleResolutions = /* @__PURE__ */ new Set(); - const resolutionsWithFailedLookups = /* @__PURE__ */ new Set(); - const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set(); - const resolvedFileToResolution = /* @__PURE__ */ new Map(); - const impliedFormatPackageJsons = /* @__PURE__ */ new Map(); - let hasChangedAutomaticTypeDirectiveNames = false; - let affectingPathChecksForFile; - let affectingPathChecks; - let failedLookupChecks; - let startsWithPathChecks; - let isInDirectoryChecks; - let allModuleAndTypeResolutionsAreInvalidated = false; - const getCurrentDirectory = memoize(() => resolutionHost.getCurrentDirectory()); - const cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); - const resolvedModuleNames = /* @__PURE__ */ new Map(); - const moduleResolutionCache = createModuleResolutionCache( - getCurrentDirectory(), - resolutionHost.getCanonicalFileName, - resolutionHost.getCompilationSettings() - ); - const resolvedTypeReferenceDirectives = /* @__PURE__ */ new Map(); - const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache( - getCurrentDirectory(), - resolutionHost.getCanonicalFileName, - resolutionHost.getCompilationSettings(), - moduleResolutionCache.getPackageJsonInfoCache(), - moduleResolutionCache.optionsToRedirectsKey - ); - const resolvedLibraries = /* @__PURE__ */ new Map(); - const libraryResolutionCache = createModuleResolutionCache( - getCurrentDirectory(), - resolutionHost.getCanonicalFileName, - getOptionsForLibraryResolution(resolutionHost.getCompilationSettings()), - moduleResolutionCache.getPackageJsonInfoCache() - ); - const directoryWatchesOfFailedLookups = /* @__PURE__ */ new Map(); - const fileWatchesOfAffectingLocations = /* @__PURE__ */ new Map(); - const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory); - const rootPath = resolutionHost.toPath(rootDir); - const rootPathComponents = getPathComponents(rootPath); - const isRootWatchable = canWatchDirectoryOrFile(rootPathComponents); - const isSymlinkCache = /* @__PURE__ */ new Map(); - const packageDirWatchers = /* @__PURE__ */ new Map(); - const dirPathToSymlinkPackageRefCount = /* @__PURE__ */ new Map(); - const typeRootsWatches = /* @__PURE__ */ new Map(); - return { - rootDirForResolution, - resolvedModuleNames, - resolvedTypeReferenceDirectives, - resolvedLibraries, - resolvedFileToResolution, - resolutionsWithFailedLookups, - resolutionsWithOnlyAffectingLocations, - directoryWatchesOfFailedLookups, - fileWatchesOfAffectingLocations, - packageDirWatchers, - dirPathToSymlinkPackageRefCount, - watchFailedLookupLocationsOfExternalModuleResolutions, - getModuleResolutionCache: () => moduleResolutionCache, - startRecordingFilesWithChangedResolutions, - finishRecordingFilesWithChangedResolutions, - // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update - // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) - startCachingPerDirectoryResolution, - finishCachingPerDirectoryResolution, - resolveModuleNameLiterals, - resolveTypeReferenceDirectiveReferences, - resolveLibrary: resolveLibrary2, - resolveSingleModuleNameWithoutWatching, - removeResolutionsFromProjectReferenceRedirects, - removeResolutionsOfFile, - hasChangedAutomaticTypeDirectiveNames: () => hasChangedAutomaticTypeDirectiveNames, - invalidateResolutionOfFile, - invalidateResolutionsOfFailedLookupLocations, - setFilesWithInvalidatedNonRelativeUnresolvedImports, - createHasInvalidatedResolutions, - isFileWithInvalidatedNonRelativeUnresolvedImports, - updateTypeRootsWatch, - closeTypeRootsWatch, - clear: clear2, - onChangesAffectModuleResolution - }; - function clear2() { - clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf); - clearMap(fileWatchesOfAffectingLocations, closeFileWatcherOf); - isSymlinkCache.clear(); - packageDirWatchers.clear(); - dirPathToSymlinkPackageRefCount.clear(); - nonRelativeExternalModuleResolutions.clear(); - closeTypeRootsWatch(); - resolvedModuleNames.clear(); - resolvedTypeReferenceDirectives.clear(); - resolvedFileToResolution.clear(); - resolutionsWithFailedLookups.clear(); - resolutionsWithOnlyAffectingLocations.clear(); - failedLookupChecks = void 0; - startsWithPathChecks = void 0; - isInDirectoryChecks = void 0; - affectingPathChecks = void 0; - affectingPathChecksForFile = void 0; - allModuleAndTypeResolutionsAreInvalidated = false; - moduleResolutionCache.clear(); - typeReferenceDirectiveResolutionCache.clear(); - moduleResolutionCache.update(resolutionHost.getCompilationSettings()); - typeReferenceDirectiveResolutionCache.update(resolutionHost.getCompilationSettings()); - libraryResolutionCache.clear(); - impliedFormatPackageJsons.clear(); - resolvedLibraries.clear(); - hasChangedAutomaticTypeDirectiveNames = false; - } - function onChangesAffectModuleResolution() { - allModuleAndTypeResolutionsAreInvalidated = true; - moduleResolutionCache.clearAllExceptPackageJsonInfoCache(); - typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache(); - moduleResolutionCache.update(resolutionHost.getCompilationSettings()); - typeReferenceDirectiveResolutionCache.update(resolutionHost.getCompilationSettings()); - } - function startRecordingFilesWithChangedResolutions() { - filesWithChangedSetOfUnresolvedImports = []; - } - function finishRecordingFilesWithChangedResolutions() { - const collected = filesWithChangedSetOfUnresolvedImports; - filesWithChangedSetOfUnresolvedImports = void 0; - return collected; - } - function isFileWithInvalidatedNonRelativeUnresolvedImports(path) { - if (!filesWithInvalidatedNonRelativeUnresolvedImports) { - return false; - } - const value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path); - return !!value && !!value.length; - } - function createHasInvalidatedResolutions(customHasInvalidatedResolutions, customHasInvalidatedLibResolutions) { - invalidateResolutionsOfFailedLookupLocations(); - const collected = filesWithInvalidatedResolutions; - filesWithInvalidatedResolutions = void 0; - return { - hasInvalidatedResolutions: (path) => customHasInvalidatedResolutions(path) || allModuleAndTypeResolutionsAreInvalidated || !!(collected == null ? void 0 : collected.has(path)) || isFileWithInvalidatedNonRelativeUnresolvedImports(path), - hasInvalidatedLibResolutions: (libFileName) => { - var _a; - return customHasInvalidatedLibResolutions(libFileName) || !!((_a = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName)) == null ? void 0 : _a.isInvalidated); - } - }; - } - 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(); - watchFailedLookupLocationOfNonRelativeModuleResolutions(); - isSymlinkCache.clear(); - } - function cleanupLibResolutionWatching(newProgram) { - resolvedLibraries.forEach((resolution, libFileName) => { - var _a; - if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) { - stopWatchFailedLookupLocationOfResolution( - resolution, - resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)), - getResolvedModuleFromResolution - ); - resolvedLibraries.delete(libFileName); - } - }); - } - function finishCachingPerDirectoryResolution(newProgram, oldProgram) { - filesWithInvalidatedNonRelativeUnresolvedImports = void 0; - allModuleAndTypeResolutionsAreInvalidated = false; - watchFailedLookupLocationOfNonRelativeModuleResolutions(); - if (newProgram !== oldProgram) { - cleanupLibResolutionWatching(newProgram); - newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => { - var _a; - const expected = ((_a = newFile.packageJsonLocations) == null ? void 0 : _a.length) ?? 0; - const existing = impliedFormatPackageJsons.get(newFile.resolvedPath) ?? emptyArray; - for (let i = existing.length; i < expected; i++) { - createFileWatcherOfAffectingLocation( - newFile.packageJsonLocations[i], - /*forResolution*/ - false - ); - } - if (existing.length > expected) { - for (let i = expected; i < existing.length; i++) { - fileWatchesOfAffectingLocations.get(existing[i]).files--; - } - } - if (expected) impliedFormatPackageJsons.set(newFile.resolvedPath, newFile.packageJsonLocations); - else impliedFormatPackageJsons.delete(newFile.resolvedPath); - }); - impliedFormatPackageJsons.forEach((existing, path) => { - const newFile = newProgram == null ? void 0 : newProgram.getSourceFileByPath(path); - if (!newFile || newFile.resolvedPath !== path) { - existing.forEach((location) => fileWatchesOfAffectingLocations.get(location).files--); - impliedFormatPackageJsons.delete(path); - } - }); - } - directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup); - fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation); - packageDirWatchers.forEach(closePackageDirWatcher); - hasChangedAutomaticTypeDirectiveNames = false; - moduleResolutionCache.isReadonly = true; - typeReferenceDirectiveResolutionCache.isReadonly = true; - libraryResolutionCache.isReadonly = true; - moduleResolutionCache.getPackageJsonInfoCache().isReadonly = true; - isSymlinkCache.clear(); - } - function closePackageDirWatcher(watcher, packageDirPath) { - if (watcher.dirPathToWatcher.size === 0) { - packageDirWatchers.delete(packageDirPath); - } - } - function closeDirectoryWatchesOfFailedLookup(watcher, path) { - if (watcher.refCount === 0) { - directoryWatchesOfFailedLookups.delete(path); - watcher.watcher.close(); - } - } - 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, - containingFile, - containingSourceFile, - redirectedReference, - options, - perFileCache, - reusedNames, - loader, - getResolutionWithResolvedFileName, - deferWatchingNonRelativeResolution, - shouldRetryResolution, - logChanges - }) { - var _a; - const path = resolutionHost.toPath(containingFile); - const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path); - const resolvedModules = []; - const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path); - const program = resolutionHost.getCurrentProgram(); - const oldRedirect = program && ((_a = program.getRedirectFromSourceFile(containingFile)) == null ? void 0 : _a.resolvedRef); - const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference; - const seenNamesInFile = createModeAwareCache(); - for (const entry of entries) { - const name = loader.nameAndMode.getName(entry); - 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))) { - const existingResolution = resolution; - resolution = loader.resolve(name, mode); - if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) { - resolutionHost.onDiscoveredSymlink(); - } - resolutionsInFile.set(name, mode, resolution); - 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 = getModuleResolutionHost(resolutionHost); - if (isTraceEnabled(options, host) && !seenNamesInFile.has(name, mode)) { - const resolved = getResolutionWithResolvedFileName(resolution); - trace( - host, - perFileCache === resolvedModuleNames ? (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 : (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved, - name, - containingFile, - resolved == null ? void 0 : resolved.resolvedFileName, - (resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId) - ); - } - } - Debug.assert(resolution !== void 0 && !resolution.isInvalidated); - 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, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options), - true - ) - ); - if (resolutionsInFile.size() !== seenNamesInFile.size()) { - resolutionsInFile.forEach((resolution, name, mode) => { - if (!seenNamesInFile.has(name, mode)) { - stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName); - resolutionsInFile.delete(name, mode); - } - }); - } - return resolvedModules; - function resolutionIsEqualTo(oldResolution, newResolution) { - if (oldResolution === newResolution) { - return true; - } - if (!oldResolution || !newResolution) { - return false; - } - const oldResult = getResolutionWithResolvedFileName(oldResolution); - const newResult = getResolutionWithResolvedFileName(newResolution); - if (oldResult === newResult) { - return true; - } - if (!oldResult || !newResult) { - return false; - } - return oldResult.resolvedFileName === newResult.resolvedFileName; - } - } - function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { - return resolveNamesWithLocalCache({ - entries: typeDirectiveReferences, - containingFile, - containingSourceFile, - redirectedReference, - options, - reusedNames, - perFileCache: resolvedTypeReferenceDirectives, - loader: createTypeReferenceResolutionLoader( - containingFile, - redirectedReference, - options, - getModuleResolutionHost(resolutionHost), - typeReferenceDirectiveResolutionCache - ), - getResolutionWithResolvedFileName: getResolvedTypeReferenceDirectiveFromResolution, - shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0, - deferWatchingNonRelativeResolution: false - }); - } - function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { - return resolveNamesWithLocalCache({ - entries: moduleLiterals, - containingFile, - containingSourceFile, - redirectedReference, - options, - reusedNames, - perFileCache: resolvedModuleNames, - loader: createModuleResolutionLoaderUsingGlobalCache( - containingFile, - redirectedReference, - options, - resolutionHost, - moduleResolutionCache - ), - getResolutionWithResolvedFileName: getResolvedModuleFromResolution, - shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension), - logChanges: logChangesWhenResolvingModule, - deferWatchingNonRelativeResolution: true - // Defer non relative resolution watch because we could be using ambient modules - }); - } - function resolveLibrary2(libraryName, resolveFrom, options, libFileName) { - const host = getModuleResolutionHost(resolutionHost); - let resolution = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName); - if (!resolution || resolution.isInvalidated) { - const existingResolution = resolution; - resolution = resolveLibrary(libraryName, resolveFrom, options, host, libraryResolutionCache); - const path = resolutionHost.toPath(resolveFrom); - watchFailedLookupLocationsOfExternalModuleResolutions( - libraryName, - resolution, - path, - getResolvedModuleFromResolution, - /*deferWatchingNonRelativeResolution*/ - false - ); - resolvedLibraries.set(libFileName, resolution); - if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolvedModuleFromResolution); - } - } else { - if (isTraceEnabled(options, host)) { - const resolved = getResolvedModuleFromResolution(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, - libraryName, - resolveFrom, - resolved == null ? void 0 : resolved.resolvedFileName, - (resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId) - ); - } - } - 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( - moduleName, - /*mode*/ - void 0 - ); - if (resolution && !resolution.isInvalidated) return resolution; - 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"); - } - function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) { - (resolution.files ?? (resolution.files = /* @__PURE__ */ new Set())).add(filePath); - if (resolution.files.size !== 1) return; - if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) { - watchFailedLookupLocationOfResolution(resolution); - } else { - nonRelativeExternalModuleResolutions.add(resolution); - } - const resolved = getResolutionWithResolvedFileName(resolution); - if (resolved && resolved.resolvedFileName) { - const key = resolutionHost.toPath(resolved.resolvedFileName); - let resolutions = resolvedFileToResolution.get(key); - if (!resolutions) resolvedFileToResolution.set(key, resolutions = /* @__PURE__ */ new Set()); - resolutions.add(resolution); - } - } - function watchFailedLookupLocation(failedLookupLocation, setAtRoot) { - const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - const toWatch = getDirectoryToWatchFailedLookupLocation( - failedLookupLocation, - failedLookupLocationPath, - rootDir, - rootPath, - rootPathComponents, - isRootWatchable, - getCurrentDirectory, - resolutionHost.preferNonRecursiveWatch - ); - if (toWatch) { - const { dir, dirPath, nonRecursive, packageDir, packageDirPath } = toWatch; - if (dirPath === rootPath) { - Debug.assert(nonRecursive); - Debug.assert(!packageDir); - setAtRoot = true; - } else { - setDirectoryWatcher(dir, dirPath, packageDir, packageDirPath, nonRecursive); - } - } - return setAtRoot; - } - function watchFailedLookupLocationOfResolution(resolution) { - var _a; - Debug.assert(!!((_a = resolution.files) == null ? void 0 : _a.size)); - 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) || alternateResult) resolutionsWithFailedLookups.add(resolution); - let setAtRoot = false; - if (failedLookupLocations) { - for (const failedLookupLocation of failedLookupLocations) { - setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot); - } - } - if (alternateResult) setAtRoot = watchFailedLookupLocation(alternateResult, setAtRoot); - if (setAtRoot) { - setDirectoryWatcher( - rootDir, - rootPath, - /*packageDir*/ - void 0, - /*packageDirPath*/ - void 0, - /*nonRecursive*/ - true - ); - } - watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !alternateResult); - } - function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) { - var _a; - Debug.assert(!!((_a = resolution.files) == null ? void 0 : _a.size)); - const { affectingLocations } = resolution; - if (!(affectingLocations == null ? void 0 : affectingLocations.length)) return; - if (addToResolutionsWithOnlyAffectingLocations) resolutionsWithOnlyAffectingLocations.add(resolution); - for (const affectingLocation of affectingLocations) { - createFileWatcherOfAffectingLocation( - affectingLocation, - /*forResolution*/ - true - ); - } - } - function createFileWatcherOfAffectingLocation(affectingLocation, forResolution) { - const fileWatcher = fileWatchesOfAffectingLocations.get(affectingLocation); - if (fileWatcher) { - if (forResolution) fileWatcher.resolutions++; - else fileWatcher.files++; - return; - } - let locationToWatch = affectingLocation; - let isSymlink = false; - let symlinkWatcher; - if (resolutionHost.realpath) { - locationToWatch = resolutionHost.realpath(affectingLocation); - 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); - (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() { - nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfResolution); - nonRelativeExternalModuleResolutions.clear(); - } - function createDirectoryWatcherForPackageDir(dir, dirPath, packageDir, packageDirPath, nonRecursive) { - Debug.assert(!nonRecursive); - let isSymlink = isSymlinkCache.get(packageDirPath); - let packageDirWatcher = packageDirWatchers.get(packageDirPath); - if (isSymlink === void 0) { - const realPath2 = resolutionHost.realpath(packageDir); - isSymlink = realPath2 !== packageDir && resolutionHost.toPath(realPath2) !== packageDirPath; - isSymlinkCache.set(packageDirPath, isSymlink); - if (!packageDirWatcher) { - packageDirWatchers.set( - packageDirPath, - packageDirWatcher = { - dirPathToWatcher: /* @__PURE__ */ new Map(), - isSymlink - } - ); - } else if (packageDirWatcher.isSymlink !== isSymlink) { - packageDirWatcher.dirPathToWatcher.forEach((watcher) => { - removeDirectoryWatcher(packageDirWatcher.isSymlink ? packageDirPath : dirPath); - watcher.watcher = createDirPathToWatcher(); - }); - packageDirWatcher.isSymlink = isSymlink; - } - } else { - Debug.assertIsDefined(packageDirWatcher); - Debug.assert(isSymlink === packageDirWatcher.isSymlink); - } - const forDirPath = packageDirWatcher.dirPathToWatcher.get(dirPath); - if (forDirPath) { - forDirPath.refCount++; - } else { - packageDirWatcher.dirPathToWatcher.set(dirPath, { - watcher: createDirPathToWatcher(), - refCount: 1 - }); - if (isSymlink) dirPathToSymlinkPackageRefCount.set(dirPath, (dirPathToSymlinkPackageRefCount.get(dirPath) ?? 0) + 1); - } - function createDirPathToWatcher() { - return isSymlink ? createOrAddRefToDirectoryWatchOfFailedLookups(packageDir, packageDirPath, nonRecursive) : createOrAddRefToDirectoryWatchOfFailedLookups(dir, dirPath, nonRecursive); - } - } - function setDirectoryWatcher(dir, dirPath, packageDir, packageDirPath, nonRecursive) { - if (!packageDirPath || !resolutionHost.realpath) { - createOrAddRefToDirectoryWatchOfFailedLookups(dir, dirPath, nonRecursive); - } else { - createDirectoryWatcherForPackageDir(dir, dirPath, packageDir, packageDirPath, nonRecursive); - } - } - function createOrAddRefToDirectoryWatchOfFailedLookups(dir, dirPath, nonRecursive) { - let dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - if (dirWatcher) { - Debug.assert(!!nonRecursive === !!dirWatcher.nonRecursive); - dirWatcher.refCount++; - } else { - directoryWatchesOfFailedLookups.set(dirPath, dirWatcher = { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive }); - } - return dirWatcher; - } - function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) { - const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - const toWatch = getDirectoryToWatchFailedLookupLocation( - failedLookupLocation, - failedLookupLocationPath, - rootDir, - rootPath, - rootPathComponents, - isRootWatchable, - getCurrentDirectory, - resolutionHost.preferNonRecursiveWatch - ); - if (toWatch) { - const { dirPath, packageDirPath } = toWatch; - if (dirPath === rootPath) { - removeAtRoot = true; - } else if (packageDirPath && resolutionHost.realpath) { - const packageDirWatcher = packageDirWatchers.get(packageDirPath); - const forDirPath = packageDirWatcher.dirPathToWatcher.get(dirPath); - forDirPath.refCount--; - if (forDirPath.refCount === 0) { - removeDirectoryWatcher(packageDirWatcher.isSymlink ? packageDirPath : dirPath); - packageDirWatcher.dirPathToWatcher.delete(dirPath); - if (packageDirWatcher.isSymlink) { - const refCount = dirPathToSymlinkPackageRefCount.get(dirPath) - 1; - if (refCount === 0) { - dirPathToSymlinkPackageRefCount.delete(dirPath); - } else { - dirPathToSymlinkPackageRefCount.set(dirPath, refCount); - } - } - } - } else { - removeDirectoryWatcher(dirPath); - } - } - return removeAtRoot; - } - function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { - Debug.checkDefined(resolution.files).delete(filePath); - if (resolution.files.size) return; - resolution.files = void 0; - const resolved = getResolutionWithResolvedFileName(resolution); - if (resolved && resolved.resolvedFileName) { - const key = resolutionHost.toPath(resolved.resolvedFileName); - const resolutions = resolvedFileToResolution.get(key); - if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size) resolvedFileToResolution.delete(key); - } - const { failedLookupLocations, affectingLocations, alternateResult } = resolution; - if (resolutionsWithFailedLookups.delete(resolution)) { - let removeAtRoot = false; - if (failedLookupLocations) { - for (const failedLookupLocation of failedLookupLocations) { - removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot); - } - } - if (alternateResult) removeAtRoot = stopWatchFailedLookupLocation(alternateResult, removeAtRoot); - if (removeAtRoot) removeDirectoryWatcher(rootPath); - } else if (affectingLocations == null ? void 0 : affectingLocations.length) { - resolutionsWithOnlyAffectingLocations.delete(resolution); - } - if (affectingLocations) { - for (const affectingLocation of affectingLocations) { - const watcher = fileWatchesOfAffectingLocations.get(affectingLocation); - watcher.resolutions--; - } - } - } - function removeDirectoryWatcher(dirPath) { - const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - dirWatcher.refCount--; - } - function createDirectoryWatcher(directory, dirPath, nonRecursive) { - return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => { - const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (cachedDirectoryStructureHost) { - cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); - } - scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath); - }, nonRecursive ? 0 /* None */ : 1 /* Recursive */); - } - function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { - const resolutions = cache.get(filePath); - if (resolutions) { - resolutions.forEach( - (resolution) => stopWatchFailedLookupLocationOfResolution( - resolution, - filePath, - getResolutionWithResolvedFileName - ) - ); - cache.delete(filePath); - } - } - function removeResolutionsFromProjectReferenceRedirects(filePath) { - if (!fileExtensionIs(filePath, ".json" /* Json */)) return; - const program = resolutionHost.getCurrentProgram(); - if (!program) return; - const resolvedProjectReference = program.getResolvedProjectReferenceByPath(filePath); - if (!resolvedProjectReference) return; - resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f))); - } - function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModuleFromResolution); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirectiveFromResolution); - } - function invalidateResolutions(resolutions, canInvalidate) { - if (!resolutions) return false; - let invalidated = false; - resolutions.forEach((resolution) => { - if (resolution.isInvalidated || !canInvalidate(resolution)) return; - resolution.isInvalidated = invalidated = true; - for (const containingFilePath of Debug.checkDefined(resolution.files)) { - (filesWithInvalidatedResolutions ?? (filesWithInvalidatedResolutions = /* @__PURE__ */ new Set())).add(containingFilePath); - hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || endsWith(containingFilePath, inferredTypesContainingFile); - } - }); - return invalidated; - } - function invalidateResolutionOfFile(filePath) { - removeResolutionsOfFile(filePath); - const prevHasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; - if (invalidateResolutions(resolvedFileToResolution.get(filePath), returnTrue) && hasChangedAutomaticTypeDirectiveNames && !prevHasChangedAutomaticTypeDirectiveNames) { - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - } - } - function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { - Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === void 0); - filesWithInvalidatedNonRelativeUnresolvedImports = filesMap; - } - function scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, isCreatingWatchedDirectory) { - if (isCreatingWatchedDirectory) { - (isInDirectoryChecks || (isInDirectoryChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); - } else { - const updatedPath = removeIgnoredPath(fileOrDirectoryPath); - if (!updatedPath) return false; - fileOrDirectoryPath = updatedPath; - if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) { - return false; - } - const dirOfFileOrDirectory = getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { - (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); - (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); - } else { - if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { - return false; - } - if (fileExtensionIs(fileOrDirectoryPath, ".map")) { - return false; - } - (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); - (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); - const packagePath = parseNodeModuleFromPath( - fileOrDirectoryPath, - /*isFolder*/ - true - ); - if (packagePath) (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(packagePath); - } - } - resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); - } - function invalidatePackageJsonMap() { - const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap(); - if (packageJsonMap && (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks)) { - packageJsonMap.forEach((_value, path) => isInvalidatedFailedLookup(path) ? packageJsonMap.delete(path) : void 0); - } - } - function invalidateResolutionsOfFailedLookupLocations() { - var _a; - if (allModuleAndTypeResolutionsAreInvalidated) { - affectingPathChecksForFile = void 0; - invalidatePackageJsonMap(); - if (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks || affectingPathChecks) { - invalidateResolutions(resolvedLibraries, canInvalidateFailedLookupResolution); - } - failedLookupChecks = void 0; - startsWithPathChecks = void 0; - isInDirectoryChecks = void 0; - affectingPathChecks = void 0; - return true; - } - let invalidated = false; - if (affectingPathChecksForFile) { - (_a = resolutionHost.getCurrentProgram()) == null ? void 0 : _a.getSourceFiles().forEach((f) => { - if (some(f.packageJsonLocations, (location) => affectingPathChecksForFile.has(location))) { - (filesWithInvalidatedResolutions ?? (filesWithInvalidatedResolutions = /* @__PURE__ */ new Set())).add(f.path); - invalidated = true; - } - }); - affectingPathChecksForFile = void 0; - } - if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks && !affectingPathChecks) { - return invalidated; - } - invalidated = invalidateResolutions(resolutionsWithFailedLookups, canInvalidateFailedLookupResolution) || invalidated; - invalidatePackageJsonMap(); - failedLookupChecks = void 0; - startsWithPathChecks = void 0; - isInDirectoryChecks = void 0; - invalidated = invalidateResolutions(resolutionsWithOnlyAffectingLocations, canInvalidatedFailedLookupResolutionWithAffectingLocation) || invalidated; - affectingPathChecks = void 0; - return invalidated; - } - function canInvalidateFailedLookupResolution(resolution) { - var _a; - if (canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution)) return true; - if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks) return false; - 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); - } - function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) { - var _a; - return !!affectingPathChecks && ((_a = resolution.affectingLocations) == null ? void 0 : _a.some((location) => affectingPathChecks.has(location))); - } - function closeTypeRootsWatch() { - clearMap(typeRootsWatches, closeFileWatcher); - } - function createTypeRootsWatch(typeRoot) { - return canWatchTypeRootPath(typeRoot) ? resolutionHost.watchTypeRootsDirectory(typeRoot, (fileOrDirectory) => { - const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (cachedDirectoryStructureHost) { - cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); - } - hasChangedAutomaticTypeDirectiveNames = true; - resolutionHost.onChangedAutomaticTypeDirectiveNames(); - const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot( - typeRoot, - resolutionHost.toPath(typeRoot), - rootPath, - rootPathComponents, - isRootWatchable, - getCurrentDirectory, - resolutionHost.preferNonRecursiveWatch, - (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2) || dirPathToSymlinkPackageRefCount.has(dirPath2) - ); - if (dirPath) { - scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath); - } - }, 1 /* Recursive */) : noopFileWatcher; - } - function updateTypeRootsWatch() { - const options = resolutionHost.getCompilationSettings(); - if (options.types) { - closeTypeRootsWatch(); - return; - } - const typeRoots = getEffectiveTypeRoots(options, { getCurrentDirectory }); - if (typeRoots) { - mutateMap( - typeRootsWatches, - new Set(typeRoots), - { - createNewValue: createTypeRootsWatch, - onDeleteValue: closeFileWatcher - } - ); - } else { - closeTypeRootsWatch(); - } - } - function canWatchTypeRootPath(typeRoot) { - if (resolutionHost.getCompilationSettings().typeRoots) return true; - return canWatchAtTypes(resolutionHost.toPath(typeRoot)); - } -} -function resolutionIsSymlink(resolution) { - var _a, _b; - return !!(((_a = resolution.resolvedModule) == null ? void 0 : _a.originalPath) || ((_b = resolution.resolvedTypeReferenceDirective) == null ? void 0 : _b.originalPath)); -} - -// src/compiler/watch.ts -var sysFormatDiagnosticsHost = sys ? { - getCurrentDirectory: () => sys.getCurrentDirectory(), - getNewLine: () => sys.newLine, - getCanonicalFileName: createGetCanonicalFileName(sys.useCaseSensitiveFileNames) -} : void 0; -function createDiagnosticReporter(system, pretty) { - const host = system === sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : { - getCurrentDirectory: () => system.getCurrentDirectory(), - getNewLine: () => system.newLine, - getCanonicalFileName: createGetCanonicalFileName(system.useCaseSensitiveFileNames) - }; - if (!pretty) { - return (diagnostic) => system.write(formatDiagnostic(diagnostic, host)); - } - const diagnostics = new Array(1); - return (diagnostic) => { - diagnostics[0] = diagnostic; - system.write(formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine()); - diagnostics[0] = void 0; - }; -} -function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { - if (system.clearScreen && !options.preserveWatchOutput && !options.extendedDiagnostics && !options.diagnostics && contains(screenStartingMessageCodes, diagnostic.code)) { - system.clearScreen(); - return true; - } - return false; -} -var screenStartingMessageCodes = [ - Diagnostics.Starting_compilation_in_watch_mode.code, - Diagnostics.File_change_detected_Starting_incremental_compilation.code -]; -function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) { - return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine; -} -function getLocaleTimeString(system) { - return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : ( - // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. - // This branch is solely for testing, so just switch it to a normal space for baseline stability. - // See: - // - https://github.com/nodejs/node/issues/45171 - // - https://github.com/nodejs/node/issues/45753 - system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202F", " ") - ); -} -function createWatchStatusReporter(system, pretty) { - return pretty ? (diagnostic, newLine, options) => { - clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); - let output = `[${formatColorAndReset(getLocaleTimeString(system), "\x1B[90m" /* Grey */)}] `; - output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${newLine + newLine}`; - system.write(output); - } : (diagnostic, newLine, options) => { - let output = ""; - if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) { - output += newLine; - } - output += `${getLocaleTimeString(system)} - `; - output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${getPlainDiagnosticFollowingNewLines(diagnostic, newLine)}`; - system.write(output); - }; -} -function parseConfigFileWithSystem(configFileName, optionsToExtend, extendedConfigCache, watchOptionsToExtend, system, reportDiagnostic) { - const host = system; - host.onUnRecoverableConfigFileDiagnostic = (diagnostic) => reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); - const result = getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend); - host.onUnRecoverableConfigFileDiagnostic = void 0; - return result; -} -function getErrorCountForSummary(diagnostics) { - return countWhere(diagnostics, (diagnostic) => diagnostic.category === 1 /* Error */); -} -function getFilesInErrorForSummary(diagnostics) { - const filesInError = filter(diagnostics, (diagnostic) => diagnostic.category === 1 /* Error */).map( - (errorDiagnostic) => { - if (errorDiagnostic.file === void 0) return; - return `${errorDiagnostic.file.fileName}`; - } - ); - return filesInError.map((fileName) => { - if (fileName === void 0) { - return void 0; - } - 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 { - fileName, - line: line + 1 - }; - } - }); -} -function getWatchErrorSummaryDiagnosticMessage(errorCount) { - return errorCount === 1 ? Diagnostics.Found_1_error_Watching_for_file_changes : Diagnostics.Found_0_errors_Watching_for_file_changes; -} -function prettyPathForFileError(error2, cwd) { - const line = formatColorAndReset(":" + error2.line, "\x1B[90m" /* Grey */); - if (pathIsAbsolute(error2.fileName) && pathIsAbsolute(cwd)) { - return getRelativePathFromDirectory( - cwd, - error2.fileName, - /*ignoreCase*/ - false - ) + line; - } - return error2.fileName + line; -} -function getErrorSummaryText(errorCount, filesInError, newLine, host) { - if (errorCount === 0) return ""; - const nonNilFiles = filesInError.filter((fileInError) => fileInError !== void 0); - const distinctFileNamesWithLines = nonNilFiles.map((fileInError) => `${fileInError.fileName}:${fileInError.line}`).filter((value, index, self) => self.indexOf(value) === index); - const firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory()); - let messageAndArgs; - if (errorCount === 1) { - messageAndArgs = filesInError[0] !== void 0 ? [Diagnostics.Found_1_error_in_0, firstFileReference] : [Diagnostics.Found_1_error]; - } else { - messageAndArgs = distinctFileNamesWithLines.length === 0 ? [Diagnostics.Found_0_errors, errorCount] : distinctFileNamesWithLines.length === 1 ? [Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1, errorCount, firstFileReference] : [Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length]; - } - const d = createCompilerDiagnostic(...messageAndArgs); - const suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : ""; - return `${newLine}${flattenDiagnosticMessageText(d.messageText, newLine)}${newLine}${newLine}${suffix}`; -} -function createTabularErrorsDisplay(filesInError, host) { - const distinctFiles = filesInError.filter((value, index, self) => index === self.findIndex((file) => (file == null ? void 0 : file.fileName) === (value == null ? void 0 : value.fileName))); - if (distinctFiles.length === 0) return ""; - const numberLength = (num) => Math.log(num) * Math.LOG10E + 1; - const fileToErrorCount = distinctFiles.map((file) => [file, countWhere(filesInError, (fileInError) => fileInError.fileName === file.fileName)]); - const maxErrors = maxBy(fileToErrorCount, 0, (value) => value[1]); - const headerRow = Diagnostics.Errors_Files.message; - const leftColumnHeadingLength = headerRow.split(" ")[0].length; - const leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors)); - const headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0); - let tabularData = ""; - tabularData += " ".repeat(headerPadding) + headerRow + "\n"; - fileToErrorCount.forEach((row) => { - const [file, errorCount] = row; - const errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0; - const leftPadding = errorCountDigitsLength < leftPaddingGoal ? " ".repeat(leftPaddingGoal - errorCountDigitsLength) : ""; - const fileRef = prettyPathForFileError(file, host.getCurrentDirectory()); - tabularData += `${leftPadding}${errorCount} ${fileRef} -`; - }); - return tabularData; -} -function isBuilderProgram(program) { - return !!program.state; -} -function listFiles(program, write) { - const options = program.getCompilerOptions(); - if (options.explainFiles) { - explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write); - } else if (options.listFiles || options.listFilesOnly) { - forEach(program.getSourceFiles(), (file) => { - write(file.fileName); - }); - } -} -function explainFiles(program, write) { - var _a, _b; - const reasons = program.getFileIncludeReasons(); - const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName); - for (const file of program.getSourceFiles()) { - write(`${toFileName(file, relativeFileName)}`); - (_a = reasons.get(file.path)) == null ? void 0 : _a.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`)); - (_b = explainIfFileIsRedirectAndImpliedFormat(file, program.getCompilerOptionsForFile(file), relativeFileName)) == null ? void 0 : _b.forEach((d) => write(` ${d.messageText}`)); - } -} -function explainIfFileIsRedirectAndImpliedFormat(file, options, fileNameConvertor) { - var _a; - let result; - if (file.path !== file.resolvedPath) { - (result ?? (result = [])).push(chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.File_is_output_of_project_reference_source_0, - toFileName(file.originalFileName, fileNameConvertor) - )); - } - if (file.redirectInfo) { - (result ?? (result = [])).push(chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.File_redirects_to_file_0, - toFileName(file.redirectInfo.redirectTarget, fileNameConvertor) - )); - } - if (isExternalOrCommonJsModule(file)) { - switch (getImpliedNodeFormatForEmitWorker(file, options)) { - case 99 /* ESNext */: - if (file.packageJsonScope) { - (result ?? (result = [])).push(chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.File_is_ECMAScript_module_because_0_has_field_type_with_value_module, - toFileName(last(file.packageJsonLocations), fileNameConvertor) - )); - } - break; - case 1 /* CommonJS */: - if (file.packageJsonScope) { - (result ?? (result = [])).push(chainDiagnosticMessages( - /*details*/ - void 0, - file.packageJsonScope.contents.packageJsonContent.type ? Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module : Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type, - toFileName(last(file.packageJsonLocations), fileNameConvertor) - )); - } else if ((_a = file.packageJsonLocations) == null ? void 0 : _a.length) { - (result ?? (result = [])).push(chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.File_is_CommonJS_module_because_package_json_was_not_found - )); - } - break; - } - } - return result; -} -function getMatchedFileSpec(program, fileName) { - var _a; - const configFile = program.getCompilerOptions().configFile; - if (!((_a = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a.validatedFilesSpec)) return void 0; - const filePath = program.getCanonicalFileName(fileName); - const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); - const index = findIndex(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath); - return index !== -1 ? configFile.configFileSpecs.validatedFilesSpecBeforeSubstitution[index] : void 0; -} -function getMatchedIncludeSpec(program, fileName) { - var _a, _b; - const configFile = program.getCompilerOptions().configFile; - if (!((_a = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a.validatedIncludeSpecs)) return void 0; - if (configFile.configFileSpecs.isDefaultIncludeSpec) return true; - const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */); - const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); - const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames(); - const index = findIndex((_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})$`, useCaseSensitiveFileNames2).test(fileName); - }); - return index !== -1 ? configFile.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[index] : void 0; -} -function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) { - var _a, _b; - const options = program.getCompilerOptions(); - if (isReferencedFile(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"); - switch (reason.kind) { - case 3 /* Import */: - if (isReferenceFileLocation(referenceLocation)) { - message = referenceLocation.packageId ? Diagnostics.Imported_via_0_from_file_1_with_packageId_2 : Diagnostics.Imported_via_0_from_file_1; - } else if (referenceLocation.text === externalHelpersModuleNameText) { - message = referenceLocation.packageId ? Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions : Diagnostics.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions; - } else { - message = referenceLocation.packageId ? Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions : Diagnostics.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions; - } - break; - case 4 /* ReferenceFile */: - Debug.assert(!referenceLocation.packageId); - message = Diagnostics.Referenced_via_0_from_file_1; - break; - case 5 /* TypeReferenceDirective */: - message = referenceLocation.packageId ? Diagnostics.Type_library_referenced_via_0_from_file_1_with_packageId_2 : Diagnostics.Type_library_referenced_via_0_from_file_1; - break; - case 7 /* LibReferenceDirective */: - Debug.assert(!referenceLocation.packageId); - message = Diagnostics.Library_referenced_via_0_from_file_1; - break; - default: - Debug.assertNever(reason); - } - return chainDiagnosticMessages( - /*details*/ - void 0, - message, - referenceText, - toFileName(referenceLocation.file, fileNameConvertor), - referenceLocation.packageId && packageIdToString(referenceLocation.packageId) - ); - } - switch (reason.kind) { - case 0 /* RootFile */: - if (!((_a = options.configFile) == null ? void 0 : _a.configFileSpecs)) return chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Root_file_specified_for_compilation - ); - const fileName = getNormalizedAbsolutePath(program.getRootFileNames()[reason.index], program.getCurrentDirectory()); - const matchedByFiles = getMatchedFileSpec(program, fileName); - if (matchedByFiles) return chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Part_of_files_list_in_tsconfig_json - ); - const matchedByInclude = getMatchedIncludeSpec(program, fileName); - return isString(matchedByInclude) ? chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Matched_by_include_pattern_0_in_1, - matchedByInclude, - toFileName(options.configFile, fileNameConvertor) - ) : ( - // Could be additional files specified as roots or matched by default include - chainDiagnosticMessages( - /*details*/ - void 0, - matchedByInclude ? Diagnostics.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk : Diagnostics.Root_file_specified_for_compilation - ) - ); - case 1 /* SourceFromProjectReference */: - case 2 /* OutputFromProjectReference */: - const isOutput = reason.kind === 2 /* OutputFromProjectReference */; - const referencedResolvedRef = Debug.checkDefined((_b = program.getResolvedProjectReferences()) == null ? void 0 : _b[reason.index]); - return chainDiagnosticMessages( - /*details*/ - void 0, - options.outFile ? isOutput ? Diagnostics.Output_from_referenced_project_0_included_because_1_specified : Diagnostics.Source_from_referenced_project_0_included_because_1_specified : isOutput ? Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none : Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none, - toFileName(referencedResolvedRef.sourceFile.fileName, fileNameConvertor), - options.outFile ? "--outFile" : "--out" - ); - case 8 /* AutomaticTypeDirectiveFile */: { - const messageAndArgs = options.types ? reason.packageId ? [Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1, reason.typeReference, packageIdToString(reason.packageId)] : [Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions, reason.typeReference] : reason.packageId ? [Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1, reason.typeReference, packageIdToString(reason.packageId)] : [Diagnostics.Entry_point_for_implicit_type_library_0, reason.typeReference]; - return chainDiagnosticMessages( - /*details*/ - void 0, - ...messageAndArgs - ); - } - case 6 /* LibFile */: { - if (reason.index !== void 0) return chainDiagnosticMessages( - /*details*/ - void 0, - Diagnostics.Library_0_specified_in_compilerOptions, - options.lib[reason.index] - ); - const target = getNameOfScriptTarget(getEmitScriptTarget(options)); - const messageAndArgs = target ? [Diagnostics.Default_library_for_target_0, target] : [Diagnostics.Default_library]; - return chainDiagnosticMessages( - /*details*/ - void 0, - ...messageAndArgs - ); - } - default: - Debug.assertNever(reason); - } -} -function toFileName(file, fileNameConvertor) { - const fileName = isString(file) ? file : file.fileName; - return fileNameConvertor ? fileNameConvertor(fileName) : fileName; -} -function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { - const options = program.getCompilerOptions(); - const allDiagnostics = program.getConfigFileParsingDiagnostics().slice(); - const configFileParsingDiagnosticsLength = allDiagnostics.length; - addRange(allDiagnostics, program.getSyntacticDiagnostics( - /*sourceFile*/ - void 0, - cancellationToken - )); - if (allDiagnostics.length === configFileParsingDiagnosticsLength) { - addRange(allDiagnostics, program.getOptionsDiagnostics(cancellationToken)); - if (!options.listFilesOnly) { - addRange(allDiagnostics, program.getGlobalDiagnostics(cancellationToken)); - if (allDiagnostics.length === configFileParsingDiagnosticsLength) { - addRange(allDiagnostics, program.getSemanticDiagnostics( - /*sourceFile*/ - void 0, - cancellationToken - )); - } - if (options.noEmit && getEmitDeclarations(options) && allDiagnostics.length === configFileParsingDiagnosticsLength) { - addRange(allDiagnostics, program.getDeclarationDiagnostics( - /*sourceFile*/ - void 0, - cancellationToken - )); - } - } - } - const emitResult = options.listFilesOnly ? { emitSkipped: true, diagnostics: emptyArray } : program.emit( - /*targetSourceFile*/ - void 0, - writeFile2, - cancellationToken, - emitOnlyDtsFiles, - customTransformers - ); - addRange(allDiagnostics, emitResult.diagnostics); - const diagnostics = sortAndDeduplicateDiagnostics(allDiagnostics); - diagnostics.forEach(reportDiagnostic); - if (write) { - const currentDir = program.getCurrentDirectory(); - forEach(emitResult.emittedFiles, (file) => { - const filepath = getNormalizedAbsolutePath(file, currentDir); - write(`TSFILE: ${filepath}`); - }); - listFiles(program, write); - } - if (reportSummary) { - reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics)); - } - return { - emitResult, - diagnostics - }; -} -function emitFilesAndReportErrorsAndGetExitStatus(program, reportDiagnostic, write, reportSummary, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { - const { emitResult, diagnostics } = emitFilesAndReportErrors( - program, - reportDiagnostic, - write, - reportSummary, - writeFile2, - cancellationToken, - emitOnlyDtsFiles, - customTransformers - ); - if (emitResult.emitSkipped && diagnostics.length > 0) { - return 1 /* DiagnosticsPresent_OutputsSkipped */; - } else if (diagnostics.length > 0) { - return 2 /* DiagnosticsPresent_OutputsGenerated */; - } - return 0 /* Success */; -} -var noopFileWatcher = { close: noop }; -var returnNoopFileWatcher = () => noopFileWatcher; -function createWatchHost(system = sys, reportWatchStatus2) { - const onWatchStatusChange = reportWatchStatus2 || createWatchStatusReporter(system); - return { - onWatchStatusChange, - watchFile: maybeBind(system, system.watchFile) || returnNoopFileWatcher, - watchDirectory: maybeBind(system, system.watchDirectory) || returnNoopFileWatcher, - setTimeout: maybeBind(system, system.setTimeout) || noop, - clearTimeout: maybeBind(system, system.clearTimeout) || noop, - preferNonRecursiveWatch: system.preferNonRecursiveWatch - }; -} -var WatchType = { - ConfigFile: "Config file", - ExtendedConfigFile: "Extended config file", - SourceFile: "Source file", - MissingFile: "Missing file", - WildcardDirectory: "Wild card directory", - FailedLookupLocations: "Failed Lookup Locations", - AffectingFileLocation: "File location affecting resolution", - TypeRoots: "Type roots", - ConfigFileOfReferencedProject: "Config file of referened project", - ExtendedConfigOfReferencedProject: "Extended config file of referenced project", - WildcardDirectoryOfReferencedProject: "Wild card directory of referenced project", - PackageJson: "package.json file", - ClosedScriptInfo: "Closed Script info", - ConfigFileForInferredRoot: "Config file for the inferred project root", - NodeModules: "node_modules for closed script infos and package.jsons affecting module specifier cache", - MissingSourceMapFile: "Missing source map file", - NoopConfigFileForInferredRoot: "Noop Config file for the inferred project root", - MissingGeneratedFile: "Missing generated file", - NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation", - TypingInstallerLocationFile: "File location for typing installer", - TypingInstallerLocationDirectory: "Directory location for typing installer" -}; -function createWatchFactory(host, options) { - const watchLogLevel = host.trace ? options.extendedDiagnostics ? 2 /* Verbose */ : options.diagnostics ? 1 /* TriggerOnly */ : 0 /* None */ : 0 /* None */; - const writeLog = watchLogLevel !== 0 /* None */ ? (s) => host.trace(s) : noop; - const result = getWatchFactory(host, watchLogLevel, writeLog); - result.writeLog = writeLog; - return result; -} -function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) { - const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames(); - const compilerHost = { - getSourceFile: createGetSourceFile( - (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding), - /*setParentNodes*/ - void 0 - ), - getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation), - getDefaultLibFileName: (options) => host.getDefaultLibFileName(options), - writeFile: createWriteFileMeasuringIO( - (path, data, writeByteOrderMark) => host.writeFile(path, data, writeByteOrderMark), - (path) => host.createDirectory(path), - (path) => host.directoryExists(path) - ), - getCurrentDirectory: memoize(() => host.getCurrentDirectory()), - useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, - getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2), - getNewLine: () => getNewLineCharacter(getCompilerOptions()), - fileExists: (f) => host.fileExists(f), - readFile: (f) => host.readFile(f), - trace: maybeBind(host, host.trace), - directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists), - getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories), - realpath: maybeBind(host, host.realpath), - getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""), - createHash: maybeBind(host, host.createHash), - readDirectory: maybeBind(host, host.readDirectory), - storeSignatureInfo: host.storeSignatureInfo, - jsDocParsingMode: host.jsDocParsingMode - }; - return compilerHost; -} -function getSourceFileVersionAsHashFromText(host, text) { - if (text.match(sourceMapCommentRegExpDontCareLineStart)) { - let lineEnd = text.length; - let lineStart = lineEnd; - for (let pos = lineEnd - 1; pos >= 0; pos--) { - const ch = text.charCodeAt(pos); - switch (ch) { - case 10 /* lineFeed */: - if (pos && text.charCodeAt(pos - 1) === 13 /* carriageReturn */) { - pos--; - } - // falls through - case 13 /* carriageReturn */: - break; - default: - if (ch < 127 /* maxAsciiCharacter */ || !isLineBreak(ch)) { - lineStart = pos; - continue; - } - break; - } - const line = text.substring(lineStart, lineEnd); - if (line.match(sourceMapCommentRegExp)) { - text = text.substring(0, lineStart); - break; - } else if (!line.match(whitespaceOrMapCommentRegExp)) { - break; - } - lineEnd = lineStart; - } - } - return (host.createHash || generateDjb2Hash)(text); -} -function setGetSourceFileAsHashVersioned(compilerHost) { - const originalGetSourceFile = compilerHost.getSourceFile; - compilerHost.getSourceFile = (...args) => { - const result = originalGetSourceFile.call(compilerHost, ...args); - if (result) { - result.version = getSourceFileVersionAsHashFromText(compilerHost, result.text); - } - return result; - }; -} -function createProgramHost(system, createProgram2) { - const getDefaultLibLocation = memoize(() => getDirectoryPath(normalizePath(system.getExecutingFilePath()))); - return { - useCaseSensitiveFileNames: () => system.useCaseSensitiveFileNames, - getNewLine: () => system.newLine, - getCurrentDirectory: memoize(() => system.getCurrentDirectory()), - getDefaultLibLocation, - getDefaultLibFileName: (options) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)), - fileExists: (path) => system.fileExists(path), - readFile: (path, encoding) => system.readFile(path, encoding), - directoryExists: (path) => system.directoryExists(path), - getDirectories: (path) => system.getDirectories(path), - readDirectory: (path, extensions, exclude, include, depth) => system.readDirectory(path, extensions, exclude, include, depth), - realpath: maybeBind(system, system.realpath), - getEnvironmentVariable: maybeBind(system, system.getEnvironmentVariable), - trace: (s) => system.write(s + system.newLine), - createDirectory: (path) => system.createDirectory(path), - writeFile: (path, data, writeByteOrderMark) => system.writeFile(path, data, writeByteOrderMark), - createHash: maybeBind(system, system.createHash), - createProgram: createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram, - storeSignatureInfo: system.storeSignatureInfo, - now: maybeBind(system, system.now) - }; -} -function createWatchCompilerHost(system = sys, createProgram2, reportDiagnostic, reportWatchStatus2) { - const write = (s) => system.write(s + system.newLine); - const result = createProgramHost(system, createProgram2); - copyProperties(result, createWatchHost(system, reportWatchStatus2)); - result.afterProgramCreate = (builderProgram) => { - const compilerOptions = builderProgram.getCompilerOptions(); - const newLine = getNewLineCharacter(compilerOptions); - emitFilesAndReportErrors( - builderProgram, - reportDiagnostic, - write, - (errorCount) => result.onWatchStatusChange( - createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), - newLine, - compilerOptions, - errorCount - ) - ); - }; - return result; -} -function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) { - reportDiagnostic(diagnostic); - system.exit(1 /* DiagnosticsPresent_OutputsSkipped */); -} -function createWatchCompilerHostOfConfigFile({ - configFileName, - optionsToExtend, - watchOptionsToExtend, - extraFileExtensions, - system, - createProgram: createProgram2, - reportDiagnostic, - reportWatchStatus: reportWatchStatus2 -}) { - const diagnosticReporter = reportDiagnostic || createDiagnosticReporter(system); - const host = createWatchCompilerHost(system, createProgram2, diagnosticReporter, reportWatchStatus2); - host.onUnRecoverableConfigFileDiagnostic = (diagnostic) => reportUnrecoverableDiagnostic(system, diagnosticReporter, diagnostic); - host.configFileName = configFileName; - host.optionsToExtend = optionsToExtend; - host.watchOptionsToExtend = watchOptionsToExtend; - host.extraFileExtensions = extraFileExtensions; - return host; -} -function createWatchCompilerHostOfFilesAndCompilerOptions({ - rootFiles, - options, - watchOptions, - projectReferences, - system, - createProgram: createProgram2, - reportDiagnostic, - reportWatchStatus: reportWatchStatus2 -}) { - const host = createWatchCompilerHost(system, createProgram2, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus2); - host.rootFiles = rootFiles; - host.options = options; - host.watchOptions = watchOptions; - host.projectReferences = projectReferences; - return host; -} -function performIncrementalCompilation(input) { - const system = input.system || sys; - const host = input.host || (input.host = createIncrementalCompilerHost(input.options, system)); - const builderProgram = createIncrementalProgram(input); - const exitStatus = emitFilesAndReportErrorsAndGetExitStatus( - builderProgram, - input.reportDiagnostic || createDiagnosticReporter(system), - (s) => host.trace && host.trace(s), - input.reportErrorSummary || input.options.pretty ? (errorCount, filesInError) => system.write(getErrorSummaryText(errorCount, filesInError, system.newLine, host)) : void 0 - ); - if (input.afterProgramEmitAndDiagnostics) input.afterProgramEmitAndDiagnostics(builderProgram); - return exitStatus; -} - -// src/compiler/watchPublic.ts -function readBuilderProgram(compilerOptions, host) { - const buildInfoPath = getTsBuildInfoEmitOutputFilePath(compilerOptions); - if (!buildInfoPath) return void 0; - let buildInfo; - if (host.getBuildInfo) { - buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath); - } else { - const content = host.readFile(buildInfoPath); - if (!content) return void 0; - buildInfo = getBuildInfo(buildInfoPath, content); - } - if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0; - return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host); -} -function createIncrementalCompilerHost(options, system = sys) { - const host = createCompilerHostWorker( - options, - /*setParentNodes*/ - void 0, - system - ); - host.createHash = maybeBind(system, system.createHash); - host.storeSignatureInfo = system.storeSignatureInfo; - setGetSourceFileAsHashVersioned(host); - changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName)); - return host; -} -function createIncrementalProgram({ - rootNames, - options, - configFileParsingDiagnostics, - projectReferences, - host, - createProgram: createProgram2 -}) { - host = host || createIncrementalCompilerHost(options); - createProgram2 = createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram; - const oldProgram = readBuilderProgram(options, host); - return createProgram2(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences); -} -function createWatchCompilerHost2(rootFilesOrConfigFileName, options, system, createProgram2, reportDiagnostic, reportWatchStatus2, projectReferencesOrWatchOptionsToExtend, watchOptionsOrExtraFileExtensions) { - if (isArray(rootFilesOrConfigFileName)) { - return createWatchCompilerHostOfFilesAndCompilerOptions({ - rootFiles: rootFilesOrConfigFileName, - options, - watchOptions: watchOptionsOrExtraFileExtensions, - projectReferences: projectReferencesOrWatchOptionsToExtend, - system, - createProgram: createProgram2, - reportDiagnostic, - reportWatchStatus: reportWatchStatus2 - }); - } else { - return createWatchCompilerHostOfConfigFile({ - configFileName: rootFilesOrConfigFileName, - optionsToExtend: options, - watchOptionsToExtend: projectReferencesOrWatchOptionsToExtend, - extraFileExtensions: watchOptionsOrExtraFileExtensions, - system, - createProgram: createProgram2, - reportDiagnostic, - reportWatchStatus: reportWatchStatus2 - }); - } -} -function createWatchProgram(host) { - let builderProgram; - let updateLevel; - let missingFilesMap; - let watchedWildcardDirectories; - let staleWatches = /* @__PURE__ */ new Map([[void 0, void 0]]); - let timerToUpdateProgram; - let timerToInvalidateFailedLookupResolutions; - let parsedConfigs; - let sharedExtendedConfigFileWatchers; - let extendedConfigCache = host.extendedConfigCache; - let reportFileChangeDetectedOnCreateProgram = false; - const sourceFilesCache = /* @__PURE__ */ new Map(); - let missingFilePathsRequestedForRelease; - let hasChangedCompilerOptions = false; - 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; - let wildcardDirectories; - let configFileParsingDiagnostics; - let canConfigFileJsonReportNoInputFiles = false; - let hasChangedConfigFileParsingErrors = false; - const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2); - const directoryStructureHost = cachedDirectoryStructureHost || host; - const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost); - let newLine = updateNewLine(); - if (configFileName && host.configFileParsingResult) { - setConfigFileParsingResult(host.configFileParsingResult); - newLine = updateNewLine(); - } - reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode); - if (configFileName && !host.configFileParsingResult) { - newLine = getNewLineCharacter(optionsToExtendForConfigFile); - Debug.assert(!rootFileNames); - parseConfigFile2(); - newLine = updateNewLine(); - } - Debug.assert(compilerOptions); - Debug.assert(rootFileNames); - const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions); - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); - writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`); - let configFileWatcher; - if (configFileName) { - configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile); - } - const compilerHost = createCompilerHostFromProgramHost(host, () => compilerOptions, directoryStructureHost); - setGetSourceFileAsHashVersioned(compilerHost); - const getNewSourceFile = compilerHost.getSourceFile; - compilerHost.getSourceFile = (fileName, ...args) => getVersionedSourceFileByPath(fileName, toPath3(fileName), ...args); - compilerHost.getSourceFileByPath = getVersionedSourceFileByPath; - compilerHost.getNewLine = () => newLine; - compilerHost.fileExists = fileExists; - compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile; - compilerHost.onReleaseParsedCommandLine = onReleaseParsedCommandLine; - compilerHost.toPath = toPath3; - compilerHost.getCompilationSettings = () => compilerOptions; - compilerHost.useSourceOfProjectReferenceRedirect = maybeBind(host, host.useSourceOfProjectReferenceRedirect); - compilerHost.preferNonRecursiveWatch = host.preferNonRecursiveWatch; - compilerHost.watchDirectoryOfFailedLookupLocation = (dir, cb, flags) => watchDirectory(dir, cb, flags, watchOptions, WatchType.FailedLookupLocations); - compilerHost.watchAffectingFileLocation = (file, cb) => watchFile2(file, cb, 2e3 /* High */, watchOptions, WatchType.AffectingFileLocation); - compilerHost.watchTypeRootsDirectory = (dir, cb, flags) => watchDirectory(dir, cb, flags, watchOptions, WatchType.TypeRoots); - compilerHost.getCachedDirectoryStructureHost = () => cachedDirectoryStructureHost; - compilerHost.scheduleInvalidateResolutionsOfFailedLookupLocations = scheduleInvalidateResolutionsOfFailedLookupLocations; - compilerHost.onInvalidatedResolution = scheduleProgramUpdate; - compilerHost.onChangedAutomaticTypeDirectiveNames = scheduleProgramUpdate; - compilerHost.fileIsOpen = returnFalse; - compilerHost.getCurrentProgram = getCurrentProgram; - compilerHost.writeLog = writeLog; - compilerHost.getParsedCommandLine = getParsedCommandLine; - const resolutionCache = createResolutionCache( - compilerHost, - configFileName ? getDirectoryPath(getNormalizedAbsolutePath(configFileName, currentDirectory)) : currentDirectory, - /*logChangesWhenResolvingModule*/ - false - ); - compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals); - compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames); - if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) { - compilerHost.resolveModuleNameLiterals = resolutionCache.resolveModuleNameLiterals.bind(resolutionCache); - } - compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences); - compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives); - if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) { - compilerHost.resolveTypeReferenceDirectiveReferences = resolutionCache.resolveTypeReferenceDirectiveReferences.bind(resolutionCache); - } - compilerHost.resolveLibrary = !host.resolveLibrary ? resolutionCache.resolveLibrary.bind(resolutionCache) : host.resolveLibrary.bind(host); - compilerHost.getModuleResolutionCache = host.resolveModuleNameLiterals || host.resolveModuleNames ? maybeBind(host, host.getModuleResolutionCache) : () => resolutionCache.getModuleResolutionCache(); - const userProvidedResolution = !!host.resolveModuleNameLiterals || !!host.resolveTypeReferenceDirectiveReferences || !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives; - const customHasInvalidatedResolutions = userProvidedResolution ? maybeBind(host, host.hasInvalidatedResolutions) || returnTrue : returnFalse; - const customHasInvalidLibResolutions = host.resolveLibrary ? maybeBind(host, host.hasInvalidatedLibResolutions) || returnTrue : returnFalse; - builderProgram = readBuilderProgram(compilerOptions, compilerHost); - synchronizeProgram(); - return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache }; - function close() { - clearInvalidateResolutionsOfFailedLookupLocations(); - resolutionCache.clear(); - clearMap(sourceFilesCache, (value) => { - if (value && value.fileWatcher) { - value.fileWatcher.close(); - value.fileWatcher = void 0; - } - }); - if (configFileWatcher) { - configFileWatcher.close(); - configFileWatcher = void 0; - } - extendedConfigCache == null ? void 0 : extendedConfigCache.clear(); - extendedConfigCache = void 0; - if (sharedExtendedConfigFileWatchers) { - clearMap(sharedExtendedConfigFileWatchers, closeFileWatcherOf); - sharedExtendedConfigFileWatchers = void 0; - } - if (watchedWildcardDirectories) { - clearMap(watchedWildcardDirectories, closeFileWatcherOf); - watchedWildcardDirectories = void 0; - } - if (missingFilesMap) { - clearMap(missingFilesMap, closeFileWatcher); - missingFilesMap = void 0; - } - if (parsedConfigs) { - clearMap(parsedConfigs, (config) => { - var _a; - (_a = config.watcher) == null ? void 0 : _a.close(); - config.watcher = void 0; - if (config.watchedDirectories) clearMap(config.watchedDirectories, closeFileWatcherOf); - config.watchedDirectories = void 0; - }); - parsedConfigs = void 0; - } - builderProgram = void 0; - } - function getResolutionCache() { - return resolutionCache; - } - function getCurrentBuilderProgram() { - return builderProgram; - } - function getCurrentProgram() { - return builderProgram && builderProgram.getProgramOrUndefined(); - } - function synchronizeProgram() { - writeLog(`Synchronizing program`); - Debug.assert(compilerOptions); - Debug.assert(rootFileNames); - clearInvalidateResolutionsOfFailedLookupLocations(); - const program = getCurrentBuilderProgram(); - if (hasChangedCompilerOptions) { - newLine = updateNewLine(); - if (program && changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { - resolutionCache.onChangesAffectModuleResolution(); - } - } - const { hasInvalidatedResolutions, hasInvalidatedLibResolutions } = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions, customHasInvalidLibResolutions); - const { - originalReadFile, - originalFileExists, - originalDirectoryExists, - originalCreateDirectory, - originalWriteFile, - readFileWithCache - } = changeCompilerHostLikeToUseCache(compilerHost, toPath3); - if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, (path) => getSourceVersion(path, readFileWithCache), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { - if (hasChangedConfigFileParsingErrors) { - if (reportFileChangeDetectedOnCreateProgram) { - reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation); - } - builderProgram = createProgram2( - /*rootNames*/ - void 0, - /*options*/ - void 0, - compilerHost, - builderProgram, - configFileParsingDiagnostics, - projectReferences - ); - hasChangedConfigFileParsingErrors = false; - } - } else { - if (reportFileChangeDetectedOnCreateProgram) { - reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation); - } - createNewProgram(hasInvalidatedResolutions, hasInvalidatedLibResolutions); - } - reportFileChangeDetectedOnCreateProgram = false; - if (host.afterProgramCreate && program !== builderProgram) { - host.afterProgramCreate(builderProgram); - } - compilerHost.readFile = originalReadFile; - compilerHost.fileExists = originalFileExists; - compilerHost.directoryExists = originalDirectoryExists; - compilerHost.createDirectory = originalCreateDirectory; - compilerHost.writeFile = originalWriteFile; - staleWatches == null ? void 0 : staleWatches.forEach((configFile, configPath) => { - if (!configPath) { - watchConfigFileWildCardDirectories(); - if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); - } else { - const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath); - if (config) watchReferencedProject(configFile, configPath, config); - } - }); - staleWatches = void 0; - return builderProgram; - } - function createNewProgram(hasInvalidatedResolutions, hasInvalidatedLibResolutions) { - writeLog("CreatingProgramWith::"); - writeLog(` roots: ${JSON.stringify(rootFileNames)}`); - writeLog(` options: ${JSON.stringify(compilerOptions)}`); - if (projectReferences) writeLog(` projectReferences: ${JSON.stringify(projectReferences)}`); - const needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram(); - hasChangedCompilerOptions = false; - hasChangedConfigFileParsingErrors = false; - resolutionCache.startCachingPerDirectoryResolution(); - compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions; - compilerHost.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions; - compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; - 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 - ); - if (needsUpdateInTypeRootWatch) { - resolutionCache.updateTypeRootsWatch(); - } - if (missingFilePathsRequestedForRelease) { - for (const missingFilePath of missingFilePathsRequestedForRelease) { - if (!missingFilesMap.has(missingFilePath)) { - sourceFilesCache.delete(missingFilePath); - } - } - missingFilePathsRequestedForRelease = void 0; - } - } - function updateRootFileNames(files) { - Debug.assert(!configFileName, "Cannot update root file names with config file watch mode"); - rootFileNames = files; - scheduleProgramUpdate(); - } - function updateNewLine() { - return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile); - } - function toPath3(fileName) { - return toPath(fileName, currentDirectory, getCanonicalFileName); - } - function isFileMissingOnHost(hostSourceFile) { - return typeof hostSourceFile === "boolean"; - } - function isFilePresenceUnknownOnHost(hostSourceFile) { - return typeof hostSourceFile.version === "boolean"; - } - function fileExists(fileName) { - const path = toPath3(fileName); - if (isFileMissingOnHost(sourceFilesCache.get(path))) { - return false; - } - return directoryStructureHost.fileExists(fileName); - } - function getVersionedSourceFileByPath(fileName, path, languageVersionOrOptions, onError, shouldCreateNewSourceFile) { - const hostSourceFile = sourceFilesCache.get(path); - if (isFileMissingOnHost(hostSourceFile)) { - return void 0; - } - 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) { - hostSourceFile.sourceFile = sourceFile; - hostSourceFile.version = sourceFile.version; - if (!hostSourceFile.fileWatcher) { - hostSourceFile.fileWatcher = watchFilePath(path, fileName, onSourceFileChange, 250 /* Low */, watchOptions, WatchType.SourceFile); - } - } else { - if (hostSourceFile.fileWatcher) { - hostSourceFile.fileWatcher.close(); - } - sourceFilesCache.set(path, false); - } - } else { - if (sourceFile) { - const fileWatcher = watchFilePath(path, fileName, onSourceFileChange, 250 /* Low */, watchOptions, WatchType.SourceFile); - sourceFilesCache.set(path, { sourceFile, version: sourceFile.version, fileWatcher }); - } else { - sourceFilesCache.set(path, false); - } - } - return sourceFile; - } - return hostSourceFile.sourceFile; - } - function nextSourceFileVersion(path) { - const hostSourceFile = sourceFilesCache.get(path); - if (hostSourceFile !== void 0) { - if (isFileMissingOnHost(hostSourceFile)) { - sourceFilesCache.set(path, { version: false }); - } else { - hostSourceFile.version = false; - } - } - } - function getSourceVersion(path, readFileWithCache) { - const hostSourceFile = sourceFilesCache.get(path); - if (!hostSourceFile) return void 0; - if (hostSourceFile.version) return hostSourceFile.version; - const text = readFileWithCache(path); - return text !== void 0 ? getSourceFileVersionAsHashFromText(compilerHost, text) : void 0; - } - function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) { - const hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath); - if (hostSourceFileInfo !== void 0) { - if (isFileMissingOnHost(hostSourceFileInfo)) { - (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); - } else if (hostSourceFileInfo.sourceFile === oldSourceFile) { - if (hostSourceFileInfo.fileWatcher) { - hostSourceFileInfo.fileWatcher.close(); - } - sourceFilesCache.delete(oldSourceFile.resolvedPath); - if (!hasSourceFileByPath) { - resolutionCache.removeResolutionsOfFile(oldSourceFile.path); - } - } - } - } - function reportWatchDiagnostic(message) { - if (host.onWatchStatusChange) { - host.onWatchStatusChange(createCompilerDiagnostic(message), newLine, compilerOptions || optionsToExtendForConfigFile); - } - } - function hasChangedAutomaticTypeDirectiveNames() { - return resolutionCache.hasChangedAutomaticTypeDirectiveNames(); - } - function clearInvalidateResolutionsOfFailedLookupLocations() { - if (!timerToInvalidateFailedLookupResolutions) return false; - host.clearTimeout(timerToInvalidateFailedLookupResolutions); - timerToInvalidateFailedLookupResolutions = void 0; - return true; - } - function scheduleInvalidateResolutionsOfFailedLookupLocations() { - if (!host.setTimeout || !host.clearTimeout) { - return resolutionCache.invalidateResolutionsOfFailedLookupLocations(); - } - const pending = clearInvalidateResolutionsOfFailedLookupLocations(); - writeLog(`Scheduling invalidateFailedLookup${pending ? ", Cancelled earlier one" : ""}`); - timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250, "timerToInvalidateFailedLookupResolutions"); - } - function invalidateResolutionsOfFailedLookup() { - timerToInvalidateFailedLookupResolutions = void 0; - if (resolutionCache.invalidateResolutionsOfFailedLookupLocations()) { - scheduleProgramUpdate(); - } - } - function scheduleProgramUpdate() { - if (!host.setTimeout || !host.clearTimeout) { - return; - } - if (timerToUpdateProgram) { - host.clearTimeout(timerToUpdateProgram); - } - writeLog("Scheduling update"); - timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250, "timerToUpdateProgram"); - } - function scheduleProgramReload() { - Debug.assert(!!configFileName); - updateLevel = 2 /* Full */; - scheduleProgramUpdate(); - } - function updateProgramWithWatchStatus() { - timerToUpdateProgram = void 0; - reportFileChangeDetectedOnCreateProgram = true; - updateProgram(); - } - function updateProgram() { - switch (updateLevel) { - case 1 /* RootNamesAndUpdate */: - reloadFileNamesFromConfigFile(); - break; - case 2 /* Full */: - reloadConfigFile(); - break; - default: - synchronizeProgram(); - break; - } - return getCurrentBuilderProgram(); - } - function reloadFileNamesFromConfigFile() { - writeLog("Reloading new file names and options"); - Debug.assert(compilerOptions); - Debug.assert(configFileName); - 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; - } - synchronizeProgram(); - } - function reloadConfigFile() { - Debug.assert(configFileName); - writeLog(`Reloading config file: ${configFileName}`); - updateLevel = 0 /* Update */; - if (cachedDirectoryStructureHost) { - cachedDirectoryStructureHost.clearCache(); - } - parseConfigFile2(); - hasChangedCompilerOptions = true; - (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(void 0, void 0); - synchronizeProgram(); - } - function parseConfigFile2() { - Debug.assert(configFileName); - setConfigFileParsingResult( - getParsedCommandLineOfConfigFile( - configFileName, - optionsToExtendForConfigFile, - parseConfigFileHost, - extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()), - watchOptionsToExtend, - extraFileExtensions - ) - ); - } - function setConfigFileParsingResult(configFileParseResult) { - rootFileNames = configFileParseResult.fileNames; - compilerOptions = configFileParseResult.options; - watchOptions = configFileParseResult.watchOptions; - projectReferences = configFileParseResult.projectReferences; - wildcardDirectories = configFileParseResult.wildcardDirectories; - configFileParsingDiagnostics = getConfigFileParsingDiagnostics(configFileParseResult).slice(); - canConfigFileJsonReportNoInputFiles = canJsonReportNoInputFiles(configFileParseResult.raw); - hasChangedConfigFileParsingErrors = true; - } - function getParsedCommandLine(configFileName2) { - const configPath = toPath3(configFileName2); - let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath); - if (config) { - if (!config.updateLevel) return config.parsedCommandLine; - if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) { - writeLog("Reloading new file names and options"); - Debug.assert(compilerOptions); - const fileNames = getFileNamesFromConfigSpecs( - config.parsedCommandLine.options.configFile.configFileSpecs, - getNormalizedAbsolutePath(getDirectoryPath(configFileName2), currentDirectory), - compilerOptions, - parseConfigFileHost - ); - config.parsedCommandLine = { ...config.parsedCommandLine, fileNames }; - config.updateLevel = void 0; - return config.parsedCommandLine; - } - } - writeLog(`Loading config file: ${configFileName2}`); - const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2); - if (config) { - config.parsedCommandLine = parsedCommandLine; - config.updateLevel = void 0; - } else { - (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine }); - } - (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(configPath, configFileName2); - return parsedCommandLine; - } - function getParsedCommandLineFromConfigFileHost(configFileName2) { - const onUnRecoverableConfigFileDiagnostic = parseConfigFileHost.onUnRecoverableConfigFileDiagnostic; - parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = noop; - const parsedCommandLine = getParsedCommandLineOfConfigFile( - configFileName2, - /*optionsToExtend*/ - void 0, - parseConfigFileHost, - extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()), - watchOptionsToExtend - ); - parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = onUnRecoverableConfigFileDiagnostic; - return parsedCommandLine; - } - function onReleaseParsedCommandLine(fileName) { - var _a; - const path = toPath3(fileName); - const config = parsedConfigs == null ? void 0 : parsedConfigs.get(path); - if (!config) return; - parsedConfigs.delete(path); - if (config.watchedDirectories) clearMap(config.watchedDirectories, closeFileWatcherOf); - (_a = config.watcher) == null ? void 0 : _a.close(); - clearSharedExtendedConfigFileWatcher(path, sharedExtendedConfigFileWatchers); - } - function watchFilePath(path, file, callback, pollingInterval, options, watchType) { - return watchFile2(file, (fileName, eventKind) => callback(fileName, eventKind, path), pollingInterval, options, watchType); - } - function onSourceFileChange(fileName, eventKind, path) { - updateCachedSystemWithFile(fileName, path, eventKind); - if (eventKind === 2 /* Deleted */ && sourceFilesCache.has(path)) { - resolutionCache.invalidateResolutionOfFile(path); - } - nextSourceFileVersion(path); - scheduleProgramUpdate(); - } - function updateCachedSystemWithFile(fileName, path, eventKind) { - if (cachedDirectoryStructureHost) { - cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind); - } - } - 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); - if (eventKind === 0 /* Created */ && missingFilesMap.has(missingFilePath)) { - missingFilesMap.get(missingFilePath).close(); - missingFilesMap.delete(missingFilePath); - nextSourceFileVersion(missingFilePath); - scheduleProgramUpdate(); - } - } - function watchConfigFileWildCardDirectories() { - updateWatchingWildcardDirectories( - watchedWildcardDirectories || (watchedWildcardDirectories = /* @__PURE__ */ new Map()), - wildcardDirectories, - watchWildcardDirectory - ); - } - function watchWildcardDirectory(directory, flags) { - return watchDirectory( - directory, - (fileOrDirectory) => { - Debug.assert(configFileName); - Debug.assert(compilerOptions); - const fileOrDirectoryPath = toPath3(fileOrDirectory); - if (cachedDirectoryStructureHost) { - cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); - } - nextSourceFileVersion(fileOrDirectoryPath); - if (isIgnoredFileFromWildCardWatching({ - watchedDirPath: toPath3(directory), - fileOrDirectory, - fileOrDirectoryPath, - configFileName, - extraFileExtensions, - options: compilerOptions, - program: getCurrentBuilderProgram() || rootFileNames, - currentDirectory, - useCaseSensitiveFileNames: useCaseSensitiveFileNames2, - writeLog, - toPath: toPath3 - })) return; - if (updateLevel !== 2 /* Full */) { - updateLevel = 1 /* RootNamesAndUpdate */; - scheduleProgramUpdate(); - } - }, - flags, - watchOptions, - WatchType.WildcardDirectory - ); - } - function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { - updateSharedExtendedConfigFileWatcher( - forProjectPath, - options, - sharedExtendedConfigFileWatchers || (sharedExtendedConfigFileWatchers = /* @__PURE__ */ new Map()), - (extendedConfigFileName, extendedConfigFilePath) => watchFile2( - extendedConfigFileName, - (_fileName, eventKind) => { - var _a; - updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind); - if (extendedConfigCache) cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath3); - const projects = (_a = sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) == null ? void 0 : _a.projects; - if (!(projects == null ? void 0 : projects.size)) return; - projects.forEach((projectPath) => { - if (configFileName && toPath3(configFileName) === projectPath) { - updateLevel = 2 /* Full */; - } else { - const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath); - if (config) config.updateLevel = 2 /* Full */; - resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath); - } - scheduleProgramUpdate(); - }); - }, - 2e3 /* High */, - watchOptions2, - watchType - ), - toPath3 - ); - } - function watchReferencedProject(configFileName2, configPath, commandLine) { - 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.updateLevel = 2 /* Full */; - resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath); - scheduleProgramUpdate(); - }, - 2e3 /* High */, - ((_a = commandLine.parsedCommandLine) == null ? void 0 : _a.watchOptions) || watchOptions, - WatchType.ConfigFileOfReferencedProject - )); - 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, - (_c = commandLine.parsedCommandLine) == null ? void 0 : _c.options, - ((_d = commandLine.parsedCommandLine) == null ? void 0 : _d.watchOptions) || watchOptions, - WatchType.ExtendedConfigOfReferencedProject - ); - } -} - -// src/compiler/tsbuild.ts -var UpToDateStatusType = /* @__PURE__ */ ((UpToDateStatusType2) => { - UpToDateStatusType2[UpToDateStatusType2["Unbuildable"] = 0] = "Unbuildable"; - UpToDateStatusType2[UpToDateStatusType2["UpToDate"] = 1] = "UpToDate"; - UpToDateStatusType2[UpToDateStatusType2["UpToDateWithUpstreamTypes"] = 2] = "UpToDateWithUpstreamTypes"; - UpToDateStatusType2[UpToDateStatusType2["OutputMissing"] = 3] = "OutputMissing"; - UpToDateStatusType2[UpToDateStatusType2["ErrorReadingFile"] = 4] = "ErrorReadingFile"; - UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf"; - UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream"; - UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfoWithPendingEmit"] = 7] = "OutOfDateBuildInfoWithPendingEmit"; - UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfoWithErrors"] = 8] = "OutOfDateBuildInfoWithErrors"; - UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions"; - UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked"; - UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream"; - UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate"; - UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText"; - UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly"; - UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild"; - return UpToDateStatusType2; -})(UpToDateStatusType || {}); -function resolveConfigFileProjectName(project) { - if (fileExtensionIs(project, ".json" /* Json */)) { - return project; - } - return combinePaths(project, "tsconfig.json"); -} - -// src/compiler/tsbuildPublic.ts -var minimumDate = /* @__PURE__ */ new Date(-864e13); -function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) { - const existingValue = configFileMap.get(resolved); - let newValue; - if (!existingValue) { - newValue = createT(); - configFileMap.set(resolved, newValue); - } - return existingValue || newValue; -} -function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) { - return getOrCreateValueFromConfigFileMap(configFileMap, resolved, () => /* @__PURE__ */ new Map()); -} -function getCurrentTime(host) { - return host.now ? host.now() : /* @__PURE__ */ new Date(); -} -function isCircularBuildOrder(buildOrder) { - return !!buildOrder && !!buildOrder.buildOrder; -} -function getBuildOrderFromAnyBuildOrder(anyBuildOrder) { - return isCircularBuildOrder(anyBuildOrder) ? anyBuildOrder.buildOrder : anyBuildOrder; -} -function createBuilderStatusReporter(system, pretty) { - return (diagnostic) => { - let output = pretty ? `[${formatColorAndReset(getLocaleTimeString(system), "\x1B[90m" /* Grey */)}] ` : `${getLocaleTimeString(system)} - `; - output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${system.newLine + system.newLine}`; - system.write(output); - }; -} -function createSolutionBuilderHostBase(system, createProgram2, reportDiagnostic, reportSolutionBuilderStatus) { - const host = createProgramHost(system, createProgram2); - host.getModifiedTime = system.getModifiedTime ? (path) => system.getModifiedTime(path) : returnUndefined; - host.setModifiedTime = system.setModifiedTime ? (path, date) => system.setModifiedTime(path, date) : noop; - host.deleteFile = system.deleteFile ? (path) => system.deleteFile(path) : noop; - host.reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system); - host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system); - host.now = maybeBind(system, system.now); - return host; -} -function createSolutionBuilderHost(system = sys, createProgram2, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary2) { - const host = createSolutionBuilderHostBase(system, createProgram2, reportDiagnostic, reportSolutionBuilderStatus); - host.reportErrorSummary = reportErrorSummary2; - return host; -} -function createSolutionBuilderWithWatchHost(system = sys, createProgram2, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus2) { - const host = createSolutionBuilderHostBase(system, createProgram2, reportDiagnostic, reportSolutionBuilderStatus); - const watchHost = createWatchHost(system, reportWatchStatus2); - copyProperties(host, watchHost); - return host; -} -function getCompilerOptionsOfBuildOptions(buildOptions) { - const result = {}; - commonOptionsWithBuild.forEach((option) => { - if (hasProperty(buildOptions, option.name)) result[option.name] = buildOptions[option.name]; - }); - result.tscBuild = true; - return result; -} -function createSolutionBuilder(host, rootNames, defaultOptions) { - return createSolutionBuilderWorker( - /*watch*/ - false, - host, - rootNames, - defaultOptions - ); -} -function createSolutionBuilderWithWatch(host, rootNames, defaultOptions, baseWatchOptions) { - return createSolutionBuilderWorker( - /*watch*/ - true, - host, - rootNames, - defaultOptions, - baseWatchOptions - ); -} -function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) { - const host = hostOrHostWithWatch; - const hostWithWatch = hostOrHostWithWatch; - const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options); - const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions); - setGetSourceFileAsHashVersioned(compilerHost); - compilerHost.getParsedCommandLine = (fileName) => parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); - compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals); - compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences); - compilerHost.resolveLibrary = maybeBind(host, host.resolveLibrary); - compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames); - compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives); - compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache); - let moduleResolutionCache, typeReferenceDirectiveResolutionCache; - if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) { - moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName); - compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( - moduleNames, - containingFile, - redirectedReference, - options2, - containingSourceFile, - host, - moduleResolutionCache, - createModuleResolutionLoader - ); - compilerHost.getModuleResolutionCache = () => moduleResolutionCache; - } - if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) { - typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache( - compilerHost.getCurrentDirectory(), - compilerHost.getCanonicalFileName, - /*options*/ - void 0, - moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), - moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey - ); - compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( - typeDirectiveNames, - containingFile, - redirectedReference, - options2, - containingSourceFile, - host, - typeReferenceDirectiveResolutionCache, - createTypeReferenceResolutionLoader - ); - } - let libraryResolutionCache; - if (!compilerHost.resolveLibrary) { - libraryResolutionCache = createModuleResolutionCache( - compilerHost.getCurrentDirectory(), - compilerHost.getCanonicalFileName, - /*options*/ - void 0, - moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache() - ); - compilerHost.resolveLibrary = (libraryName, resolveFrom, options2) => resolveLibrary( - libraryName, - resolveFrom, - options2, - host, - libraryResolutionCache - ); - } - compilerHost.getBuildInfo = (fileName, configFilePath) => getBuildInfo3( - state, - fileName, - toResolvedConfigFilePath(state, configFilePath), - /*modifiedTime*/ - void 0 - ); - const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(hostWithWatch, options); - const state = { - host, - hostWithWatch, - parseConfigFileHost: parseConfigHostFromCompilerHostLike(host), - write: maybeBind(host, host.trace), - // State of solution - options, - baseCompilerOptions, - rootNames, - baseWatchOptions, - resolvedConfigFilePaths: /* @__PURE__ */ new Map(), - configFileCache: /* @__PURE__ */ new Map(), - projectStatus: /* @__PURE__ */ new Map(), - extendedConfigCache: /* @__PURE__ */ new Map(), - buildInfoCache: /* @__PURE__ */ new Map(), - outputTimeStamps: /* @__PURE__ */ new Map(), - builderPrograms: /* @__PURE__ */ new Map(), - diagnostics: /* @__PURE__ */ new Map(), - projectPendingBuild: /* @__PURE__ */ new Map(), - projectErrorsReported: /* @__PURE__ */ new Map(), - compilerHost, - moduleResolutionCache, - typeReferenceDirectiveResolutionCache, - libraryResolutionCache, - // Mutable state - buildOrder: void 0, - readFileWithCache: (f) => host.readFile(f), - projectCompilerOptions: baseCompilerOptions, - cache: void 0, - allProjectBuildPending: true, - needsSummary: true, - watchAllProjectsPending: watch, - // Watch state - watch, - allWatchedWildcardDirectories: /* @__PURE__ */ new Map(), - allWatchedInputFiles: /* @__PURE__ */ new Map(), - allWatchedConfigFiles: /* @__PURE__ */ new Map(), - allWatchedExtendedConfigFiles: /* @__PURE__ */ new Map(), - allWatchedPackageJsonFiles: /* @__PURE__ */ new Map(), - filesWatched: /* @__PURE__ */ new Map(), - lastCachedPackageJsonLookups: /* @__PURE__ */ new Map(), - timerToBuildInvalidatedProject: void 0, - reportFileChangeDetected: false, - watchFile: watchFile2, - watchDirectory, - writeLog - }; - return state; -} -function toPath2(state, fileName) { - return toPath(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName); -} -function toResolvedConfigFilePath(state, fileName) { - const { resolvedConfigFilePaths } = state; - const path = resolvedConfigFilePaths.get(fileName); - if (path !== void 0) return path; - const resolvedPath = toPath2(state, fileName); - resolvedConfigFilePaths.set(fileName, resolvedPath); - return resolvedPath; -} -function isParsedCommandLine(entry) { - return !!entry.options; -} -function getCachedParsedConfigFile(state, configFilePath) { - const value = state.configFileCache.get(configFilePath); - return value && isParsedCommandLine(value) ? value : void 0; -} -function parseConfigFile(state, configFileName, configFilePath) { - const { configFileCache } = state; - const value = configFileCache.get(configFilePath); - if (value) { - return isParsedCommandLine(value) ? value : void 0; - } - mark("SolutionBuilder::beforeConfigFileParsing"); - let diagnostic; - const { parseConfigFileHost, baseCompilerOptions, baseWatchOptions, extendedConfigCache, host } = state; - let parsed; - if (host.getParsedCommandLine) { - parsed = host.getParsedCommandLine(configFileName); - if (!parsed) diagnostic = createCompilerDiagnostic(Diagnostics.File_0_not_found, configFileName); - } else { - parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = (d) => diagnostic = d; - parsed = getParsedCommandLineOfConfigFile(configFileName, baseCompilerOptions, parseConfigFileHost, extendedConfigCache, baseWatchOptions); - parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = noop; - } - configFileCache.set(configFilePath, parsed || diagnostic); - mark("SolutionBuilder::afterConfigFileParsing"); - measure("SolutionBuilder::Config file parsing", "SolutionBuilder::beforeConfigFileParsing", "SolutionBuilder::afterConfigFileParsing"); - return parsed; -} -function resolveProjectName(state, name) { - return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name)); -} -function createBuildOrder(state, roots) { - const temporaryMarks = /* @__PURE__ */ new Map(); - const permanentMarks = /* @__PURE__ */ new Map(); - const circularityReportStack = []; - let buildOrder; - let circularDiagnostics; - for (const root of roots) { - visit(root); - } - return circularDiagnostics ? { buildOrder: buildOrder || emptyArray, circularDiagnostics } : buildOrder || emptyArray; - function visit(configFileName, inCircularContext) { - const projPath = toResolvedConfigFilePath(state, configFileName); - if (permanentMarks.has(projPath)) return; - if (temporaryMarks.has(projPath)) { - if (!inCircularContext) { - (circularDiagnostics || (circularDiagnostics = [])).push( - createCompilerDiagnostic( - Diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0, - circularityReportStack.join("\r\n") - ) - ); - } - return; - } - temporaryMarks.set(projPath, true); - circularityReportStack.push(configFileName); - const parsed = parseConfigFile(state, configFileName, projPath); - if (parsed && parsed.projectReferences) { - for (const ref of parsed.projectReferences) { - const resolvedRefPath = resolveProjectName(state, ref.path); - visit(resolvedRefPath, inCircularContext || ref.circular); - } - } - circularityReportStack.pop(); - permanentMarks.set(projPath, true); - (buildOrder || (buildOrder = [])).push(configFileName); - } -} -function getBuildOrder(state) { - return state.buildOrder || createStateBuildOrder(state); -} -function createStateBuildOrder(state) { - const buildOrder = createBuildOrder(state, state.rootNames.map((f) => resolveProjectName(state, f))); - state.resolvedConfigFilePaths.clear(); - const currentProjects = new Set( - getBuildOrderFromAnyBuildOrder(buildOrder).map( - (resolved) => toResolvedConfigFilePath(state, resolved) - ) - ); - const noopOnDelete = { onDeleteValue: noop }; - mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete); - mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete); - mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete); - mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete); - mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete); - 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, - currentProjects, - { onDeleteValue: closeFileWatcher } - ); - state.allWatchedExtendedConfigFiles.forEach((watcher) => { - watcher.projects.forEach((project) => { - if (!currentProjects.has(project)) { - watcher.projects.delete(project); - } - }); - watcher.close(); - }); - mutateMapSkippingNewValues( - state.allWatchedWildcardDirectories, - currentProjects, - { onDeleteValue: (existingMap) => existingMap.forEach(closeFileWatcherOf) } - ); - mutateMapSkippingNewValues( - state.allWatchedInputFiles, - currentProjects, - { onDeleteValue: (existingMap) => existingMap.forEach(closeFileWatcher) } - ); - mutateMapSkippingNewValues( - state.allWatchedPackageJsonFiles, - currentProjects, - { onDeleteValue: (existingMap) => existingMap.forEach(closeFileWatcher) } - ); - } - return state.buildOrder = buildOrder; -} -function getBuildOrderFor(state, project, onlyReferences) { - const resolvedProject = project && resolveProjectName(state, project); - const buildOrderFromState = getBuildOrder(state); - if (isCircularBuildOrder(buildOrderFromState)) return buildOrderFromState; - if (resolvedProject) { - const projectPath = toResolvedConfigFilePath(state, resolvedProject); - const projectIndex = findIndex( - buildOrderFromState, - (configFileName) => toResolvedConfigFilePath(state, configFileName) === projectPath - ); - if (projectIndex === -1) return void 0; - } - const buildOrder = resolvedProject ? createBuildOrder(state, [resolvedProject]) : buildOrderFromState; - Debug.assert(!isCircularBuildOrder(buildOrder)); - Debug.assert(!onlyReferences || resolvedProject !== void 0); - Debug.assert(!onlyReferences || buildOrder[buildOrder.length - 1] === resolvedProject); - return onlyReferences ? buildOrder.slice(0, buildOrder.length - 1) : buildOrder; -} -function enableCache(state) { - if (state.cache) { - disableCache(state); - } - const { compilerHost, host } = state; - const originalReadFileWithCache = state.readFileWithCache; - const originalGetSourceFile = compilerHost.getSourceFile; - const { - originalReadFile, - originalFileExists, - originalDirectoryExists, - originalCreateDirectory, - originalWriteFile, - getSourceFileWithCache, - readFileWithCache - } = changeCompilerHostLikeToUseCache( - host, - (fileName) => toPath2(state, fileName), - (...args) => originalGetSourceFile.call(compilerHost, ...args) - ); - state.readFileWithCache = readFileWithCache; - compilerHost.getSourceFile = getSourceFileWithCache; - state.cache = { - originalReadFile, - originalFileExists, - originalDirectoryExists, - originalCreateDirectory, - originalWriteFile, - originalReadFileWithCache, - originalGetSourceFile - }; -} -function disableCache(state) { - if (!state.cache) return; - const { cache, host, compilerHost, extendedConfigCache, moduleResolutionCache, typeReferenceDirectiveResolutionCache, libraryResolutionCache } = state; - host.readFile = cache.originalReadFile; - host.fileExists = cache.originalFileExists; - host.directoryExists = cache.originalDirectoryExists; - host.createDirectory = cache.originalCreateDirectory; - host.writeFile = cache.originalWriteFile; - compilerHost.getSourceFile = cache.originalGetSourceFile; - state.readFileWithCache = cache.originalReadFileWithCache; - extendedConfigCache.clear(); - moduleResolutionCache == null ? void 0 : moduleResolutionCache.clear(); - typeReferenceDirectiveResolutionCache == null ? void 0 : typeReferenceDirectiveResolutionCache.clear(); - libraryResolutionCache == null ? void 0 : libraryResolutionCache.clear(); - state.cache = void 0; -} -function clearProjectStatus(state, resolved) { - state.projectStatus.delete(resolved); - state.diagnostics.delete(resolved); -} -function addProjToQueue({ projectPendingBuild }, proj, updateLevel) { - const value = projectPendingBuild.get(proj); - if (value === void 0) { - projectPendingBuild.set(proj, updateLevel); - } else if (value < updateLevel) { - projectPendingBuild.set(proj, updateLevel); - } -} -function setupInitialBuild(state, cancellationToken) { - if (!state.allProjectBuildPending) return; - state.allProjectBuildPending = false; - if (state.options.watch) reportWatchStatus(state, Diagnostics.Starting_compilation_in_watch_mode); - enableCache(state); - const buildOrder = getBuildOrderFromAnyBuildOrder(getBuildOrder(state)); - buildOrder.forEach( - (configFileName) => state.projectPendingBuild.set( - toResolvedConfigFilePath(state, configFileName), - 0 /* Update */ - ) - ); - if (cancellationToken) { - cancellationToken.throwIfCancellationRequested(); - } -} -var InvalidatedProjectKind = /* @__PURE__ */ ((InvalidatedProjectKind2) => { - InvalidatedProjectKind2[InvalidatedProjectKind2["Build"] = 0] = "Build"; - InvalidatedProjectKind2[InvalidatedProjectKind2["UpdateOutputFileStamps"] = 1] = "UpdateOutputFileStamps"; - return InvalidatedProjectKind2; -})(InvalidatedProjectKind || {}); -function doneInvalidatedProject(state, projectPath) { - state.projectPendingBuild.delete(projectPath); - return state.diagnostics.has(projectPath) ? 1 /* DiagnosticsPresent_OutputsSkipped */ : 0 /* Success */; -} -function createUpdateOutputFileStampsProject(state, project, projectPath, config, buildOrder) { - let updateOutputFileStampsPending = true; - return { - kind: 1 /* UpdateOutputFileStamps */, - project, - projectPath, - buildOrder, - getCompilerOptions: () => config.options, - getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(), - updateOutputFileStatmps: () => { - updateOutputTimestamps(state, config, projectPath); - updateOutputFileStampsPending = false; - }, - done: () => { - if (updateOutputFileStampsPending) { - updateOutputTimestamps(state, config, projectPath); - } - mark("SolutionBuilder::Timestamps only updates"); - return doneInvalidatedProject(state, projectPath); - } - }; -} -function createBuildOrUpdateInvalidedProject(state, project, projectPath, projectIndex, config, status, buildOrder) { - let step = 0 /* CreateProgram */; - let program; - let buildResult; - return { - kind: 0 /* Build */, - project, - projectPath, - buildOrder, - getCompilerOptions: () => config.options, - getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(), - getBuilderProgram: () => withProgramOrUndefined(identity), - getProgram: () => withProgramOrUndefined( - (program2) => program2.getProgramOrUndefined() - ), - getSourceFile: (fileName) => withProgramOrUndefined( - (program2) => program2.getSourceFile(fileName) - ), - getSourceFiles: () => withProgramOrEmptyArray( - (program2) => program2.getSourceFiles() - ), - getOptionsDiagnostics: (cancellationToken) => withProgramOrEmptyArray( - (program2) => program2.getOptionsDiagnostics(cancellationToken) - ), - getGlobalDiagnostics: (cancellationToken) => withProgramOrEmptyArray( - (program2) => program2.getGlobalDiagnostics(cancellationToken) - ), - getConfigFileParsingDiagnostics: () => withProgramOrEmptyArray( - (program2) => program2.getConfigFileParsingDiagnostics() - ), - getSyntacticDiagnostics: (sourceFile, cancellationToken) => withProgramOrEmptyArray( - (program2) => program2.getSyntacticDiagnostics(sourceFile, cancellationToken) - ), - getAllDependencies: (sourceFile) => withProgramOrEmptyArray( - (program2) => program2.getAllDependencies(sourceFile) - ), - getSemanticDiagnostics: (sourceFile, cancellationToken) => withProgramOrEmptyArray( - (program2) => program2.getSemanticDiagnostics(sourceFile, cancellationToken) - ), - getSemanticDiagnosticsOfNextAffectedFile: (cancellationToken, ignoreSourceFile) => withProgramOrUndefined( - (program2) => program2.getSemanticDiagnosticsOfNextAffectedFile && program2.getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) - ), - emit: (targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) => { - if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined( - (program2) => { - var _a, _b; - return program2.emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) == null ? void 0 : _b.call(_a, project))); - } - ); - } - executeSteps(0 /* CreateProgram */, cancellationToken); - return emit(writeFile2, cancellationToken, customTransformers); - }, - done - }; - function done(cancellationToken, writeFile2, customTransformers) { - executeSteps(3 /* Done */, cancellationToken, writeFile2, customTransformers); - mark("SolutionBuilder::Projects built"); - return doneInvalidatedProject(state, projectPath); - } - function withProgramOrUndefined(action) { - executeSteps(0 /* CreateProgram */); - return program && action(program); - } - function withProgramOrEmptyArray(action) { - return withProgramOrUndefined(action) || emptyArray; - } - function createProgram2() { - 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); - buildResult = 1 /* Success */; - step = 2 /* QueueReferencingProjects */; - return; - } - if (state.options.verbose) reportStatus(state, Diagnostics.Building_project_0, project); - if (config.fileNames.length === 0) { - reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); - buildResult = 0 /* None */; - step = 2 /* QueueReferencingProjects */; - return; - } - const { host, compilerHost } = state; - state.projectCompilerOptions = config.options; - (_a = state.moduleResolutionCache) == null ? void 0 : _a.update(config.options); - (_b = state.typeReferenceDirectiveResolutionCache) == null ? void 0 : _b.update(config.options); - program = host.createProgram( - config.fileNames, - config.options, - compilerHost, - getOldProgram(state, projectPath, config), - getConfigFileParsingDiagnostics(config), - config.projectReferences - ); - if (state.watch) { - 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++; - } - function emit(writeFileCallback, cancellationToken, customTransformers) { - var _a, _b, _c; - Debug.assertIsDefined(program); - Debug.assert(step === 1 /* Emit */); - const { host, compilerHost } = state; - const emittedOutputs = /* @__PURE__ */ new Map(); - const options = program.getCompilerOptions(); - const isIncremental = isIncrementalCompilation(options); - let outputTimeStampMap; - let now; - const { emitResult, diagnostics } = emitFilesAndReportErrors( - program, - (d) => host.reportDiagnostic(d), - state.write, - /*reportSummary*/ - void 0, - (name, text, writeByteOrderMark, onError, sourceFiles, data) => { - var _a2; - const path = toPath2(state, name); - emittedOutputs.set(toPath2(state, name), name); - if (data == null ? void 0 : data.buildInfo) { - now || (now = getCurrentTime(state.host)); - const isChangedSignature2 = (_a2 = program.hasChangedEmitSignature) == null ? void 0 : _a2.call(program); - const existing = getBuildInfoCacheEntry(state, name, projectPath); - if (existing) { - existing.buildInfo = data.buildInfo; - existing.modifiedTime = now; - if (isChangedSignature2) existing.latestChangedDtsTime = now; - } else { - state.buildInfoCache.set(projectPath, { - path: toPath2(state, name), - buildInfo: data.buildInfo, - modifiedTime: now, - latestChangedDtsTime: isChangedSignature2 ? now : void 0 - }); - } - } - const modifiedTime = (data == null ? void 0 : data.differsOnlyInMap) ? getModifiedTime(state.host, name) : void 0; - (writeFileCallback || compilerHost.writeFile)( - name, - text, - writeByteOrderMark, - onError, - sourceFiles, - data - ); - if (data == null ? void 0 : data.differsOnlyInMap) state.host.setModifiedTime(name, modifiedTime); - else if (!isIncremental && state.watch) { - (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host))); - } - }, - cancellationToken, - /*emitOnlyDtsFiles*/ - void 0, - customTransformers || ((_b = (_a = state.host).getCustomTransformers) == null ? void 0 : _b.call(_a, project)) - ); - if ((!options.noEmitOnError || !diagnostics.length) && (emittedOutputs.size || status.type !== 8 /* OutOfDateBuildInfoWithErrors */)) { - updateOutputTimestampsWorker(state, config, projectPath, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs); - } - state.projectErrorsReported.set(projectPath, true); - buildResult = ((_c = program.hasChangedEmitSignature) == null ? void 0 : _c.call(program)) ? 0 /* None */ : 2 /* DeclarationOutputUnchanged */; - if (!diagnostics.length) { - state.diagnostics.delete(projectPath); - state.projectStatus.set(projectPath, { - type: 1 /* UpToDate */, - oldestOutputFileName: firstOrUndefinedIterator(emittedOutputs.values()) ?? getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()) - }); - } else { - state.diagnostics.set(projectPath, diagnostics); - state.projectStatus.set(projectPath, { type: 0 /* Unbuildable */, reason: `it had errors` }); - buildResult |= 4 /* AnyErrors */; - } - afterProgramDone(state, program); - step = 2 /* QueueReferencingProjects */; - return emitResult; - } - function executeSteps(till, cancellationToken, writeFile2, customTransformers) { - while (step <= till && step < 3 /* Done */) { - const currentStep = step; - switch (step) { - case 0 /* CreateProgram */: - createProgram2(); - break; - case 1 /* Emit */: - emit(writeFile2, cancellationToken, customTransformers); - break; - case 2 /* QueueReferencingProjects */: - queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, Debug.checkDefined(buildResult)); - step++; - break; - // Should never be done - case 3 /* Done */: - default: - assertType(step); - } - Debug.assert(step > currentStep); - } - } -} -function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { - if (!state.projectPendingBuild.size) return void 0; - if (isCircularBuildOrder(buildOrder)) return void 0; - const { options, projectPendingBuild } = state; - for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) { - const project = buildOrder[projectIndex]; - const projectPath = toResolvedConfigFilePath(state, project); - const updateLevel = state.projectPendingBuild.get(projectPath); - if (updateLevel === void 0) continue; - if (reportQueue) { - reportQueue = false; - reportBuildQueue(state, buildOrder); - } - const config = parseConfigFile(state, project, projectPath); - if (!config) { - reportParseConfigFileDiagnostic(state, projectPath); - projectPendingBuild.delete(projectPath); - continue; - } - 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 (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); - watchPackageJsonFiles(state, project, projectPath, config); - } - const status = getUpToDateStatus(state, config, projectPath); - if (!options.force) { - if (status.type === 1 /* UpToDate */) { - verboseReportProjectStatus(state, project, status); - reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); - projectPendingBuild.delete(projectPath); - if (options.dry) { - reportStatus(state, Diagnostics.Project_0_is_up_to_date, project); - } - continue; - } - if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) { - reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); - return { - kind: 1 /* UpdateOutputFileStamps */, - status, - project, - projectPath, - projectIndex, - config - }; - } - } - if (status.type === 12 /* UpstreamBlocked */) { - verboseReportProjectStatus(state, project, status); - reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); - projectPendingBuild.delete(projectPath); - if (options.verbose) { - reportStatus( - state, - status.upstreamProjectBlocked ? Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors, - project, - status.upstreamProjectName - ); - } - continue; - } - if (status.type === 16 /* ContainerOnly */) { - verboseReportProjectStatus(state, project, status); - reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); - projectPendingBuild.delete(projectPath); - continue; - } - return { - kind: 0 /* Build */, - status, - project, - projectPath, - projectIndex, - config - }; - } - return void 0; -} -function createInvalidatedProjectWithInfo(state, info, buildOrder) { - verboseReportProjectStatus(state, info.project, info.status); - return info.kind !== 1 /* UpdateOutputFileStamps */ ? createBuildOrUpdateInvalidedProject( - state, - info.project, - info.projectPath, - info.projectIndex, - info.config, - info.status, - buildOrder - ) : createUpdateOutputFileStampsProject( - state, - info.project, - info.projectPath, - info.config, - buildOrder - ); -} -function getNextInvalidatedProject(state, buildOrder, reportQueue) { - const info = getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue); - if (!info) return info; - return createInvalidatedProjectWithInfo(state, info, buildOrder); -} -function getOldProgram({ options, builderPrograms, compilerHost }, proj, parsed) { - if (options.force) return void 0; - const value = builderPrograms.get(proj); - if (value) return value; - return readBuilderProgram(parsed.options, compilerHost); -} -function afterProgramDone(state, program) { - if (program) { - if (state.host.afterProgramEmitAndDiagnostics) { - state.host.afterProgramEmitAndDiagnostics(program); - } - program.releaseProgram(); - } - state.projectCompilerOptions = state.baseCompilerOptions; -} -function isFileWatcherWithModifiedTime(value) { - return !!value.watcher; -} -function getModifiedTime2(state, fileName) { - const path = toPath2(state, fileName); - const existing = state.filesWatched.get(path); - if (state.watch && !!existing) { - if (!isFileWatcherWithModifiedTime(existing)) return existing; - if (existing.modifiedTime) return existing.modifiedTime; - } - const result = getModifiedTime(state.host, fileName); - if (state.watch) { - if (existing) existing.modifiedTime = result; - else state.filesWatched.set(path, result); - } - return result; -} -function watchFile(state, file, callback, pollingInterval, options, watchType, project) { - const path = toPath2(state, file); - const existing = state.filesWatched.get(path); - if (existing && isFileWatcherWithModifiedTime(existing)) { - existing.callbacks.push(callback); - } else { - const watcher = state.watchFile( - file, - (fileName, eventKind, modifiedTime) => { - const existing2 = Debug.checkDefined(state.filesWatched.get(path)); - Debug.assert(isFileWatcherWithModifiedTime(existing2)); - existing2.modifiedTime = modifiedTime; - existing2.callbacks.forEach((cb) => cb(fileName, eventKind, modifiedTime)); - }, - pollingInterval, - options, - watchType, - project - ); - state.filesWatched.set(path, { callbacks: [callback], watcher, modifiedTime: existing }); - } - return { - close: () => { - const existing2 = Debug.checkDefined(state.filesWatched.get(path)); - Debug.assert(isFileWatcherWithModifiedTime(existing2)); - if (existing2.callbacks.length === 1) { - state.filesWatched.delete(path); - closeFileWatcherOf(existing2); - } else { - unorderedRemoveItem(existing2.callbacks, callback); - } - } - }; -} -function getOutputTimeStampMap(state, resolvedConfigFilePath) { - if (!state.watch) return void 0; - let result = state.outputTimeStamps.get(resolvedConfigFilePath); - if (!result) state.outputTimeStamps.set(resolvedConfigFilePath, result = /* @__PURE__ */ new Map()); - return result; -} -function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) { - const path = toPath2(state, buildInfoPath); - const existing = state.buildInfoCache.get(resolvedConfigPath); - return (existing == null ? void 0 : existing.path) === path ? existing : void 0; -} -function getBuildInfo3(state, buildInfoPath, resolvedConfigPath, modifiedTime) { - const path = toPath2(state, buildInfoPath); - const existing = state.buildInfoCache.get(resolvedConfigPath); - if (existing !== void 0 && existing.path === path) { - return existing.buildInfo || void 0; - } - const value = state.readFileWithCache(buildInfoPath); - const buildInfo = value ? getBuildInfo(buildInfoPath, value) : void 0; - state.buildInfoCache.set(resolvedConfigPath, { path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || missingFileModifiedTime }); - return buildInfo; -} -function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) { - const tsconfigTime = getModifiedTime2(state, configFile); - if (oldestOutputFileTime < tsconfigTime) { - return { - type: 5 /* OutOfDateWithSelf */, - outOfDateOutputFileName: oldestOutputFileName, - newerInputFileName: configFile - }; - } -} -function getUpToDateStatusWorker(state, project, resolvedPath) { - var _a, _b, _c, _d, _e; - if (isSolutionConfig(project)) return { type: 16 /* ContainerOnly */ }; - let referenceStatuses; - const force = !!state.options.force; - if (project.projectReferences) { - state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ }); - for (const ref of project.projectReferences) { - const resolvedRef = resolveProjectReferencePath(ref); - const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef); - const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath); - const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath); - if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) { - continue; - } - if (state.options.stopBuildOnErrors && (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */)) { - return { - type: 12 /* UpstreamBlocked */, - upstreamProjectName: ref.path, - upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */ - }; - } - if (!force) (referenceStatuses || (referenceStatuses = [])).push({ ref, refStatus, resolvedRefPath, resolvedConfig }); - } - } - if (force) return { type: 17 /* ForceBuild */ }; - const { host } = state; - const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options); - const isIncremental = isIncrementalCompilation(project.options); - let buildInfoCacheEntry = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath); - const buildInfoTime = (buildInfoCacheEntry == null ? void 0 : buildInfoCacheEntry.modifiedTime) || getModifiedTime(host, buildInfoPath); - if (buildInfoTime === missingFileModifiedTime) { - if (!buildInfoCacheEntry) { - state.buildInfoCache.set(resolvedPath, { - path: toPath2(state, buildInfoPath), - buildInfo: false, - modifiedTime: buildInfoTime - }); - } - return { - type: 3 /* OutputMissing */, - missingOutputFileName: buildInfoPath - }; - } - const buildInfo = getBuildInfo3(state, buildInfoPath, resolvedPath, buildInfoTime); - if (!buildInfo) { - return { - type: 4 /* ErrorReadingFile */, - fileName: buildInfoPath - }; - } - const incrementalBuildInfo = isIncremental && isIncrementalBuildInfo(buildInfo) ? buildInfo : void 0; - if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !== version) { - return { - type: 14 /* TsVersionOutputOfDate */, - version: buildInfo.version - }; - } - if (!project.options.noCheck && (buildInfo.errors || // TODO: syntax errors???? - buildInfo.checkPending)) { - return { - type: 8 /* OutOfDateBuildInfoWithErrors */, - buildInfoFile: buildInfoPath - }; - } - if (incrementalBuildInfo) { - if (!project.options.noCheck && (((_a = incrementalBuildInfo.changeFileSet) == null ? void 0 : _a.length) || ((_b = incrementalBuildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _b.length) || getEmitDeclarations(project.options) && ((_c = incrementalBuildInfo.emitDiagnosticsPerFile) == null ? void 0 : _c.length))) { - return { - type: 8 /* OutOfDateBuildInfoWithErrors */, - buildInfoFile: buildInfoPath - }; - } - if (!project.options.noEmit && (((_d = incrementalBuildInfo.changeFileSet) == null ? void 0 : _d.length) || ((_e = incrementalBuildInfo.affectedFilesPendingEmit) == null ? void 0 : _e.length) || incrementalBuildInfo.pendingEmit !== void 0)) { - return { - type: 7 /* OutOfDateBuildInfoWithPendingEmit */, - buildInfoFile: buildInfoPath - }; - } - if ((!project.options.noEmit || project.options.noEmit && getEmitDeclarations(project.options)) && getPendingEmitKindWithSeen( - project.options, - incrementalBuildInfo.options || {}, - /*emitOnlyDtsFiles*/ - void 0, - !!project.options.noEmit - )) { - return { - type: 9 /* OutOfDateOptions */, - buildInfoFile: buildInfoPath - }; - } - } - let oldestOutputFileTime = buildInfoTime; - let oldestOutputFileName = buildInfoPath; - let newestInputFileName = void 0; - let newestInputFileTime = minimumDate; - let pseudoInputUpToDate = false; - const seenRoots = /* @__PURE__ */ new Set(); - let buildInfoVersionMap; - for (const inputFile of project.fileNames) { - const inputTime = getModifiedTime2(state, inputFile); - if (inputTime === missingFileModifiedTime) { - return { - type: 0 /* Unbuildable */, - reason: `${inputFile} does not exist` - }; - } - const inputPath = toPath2(state, inputFile); - if (buildInfoTime < inputTime) { - let version2; - let currentVersion; - if (incrementalBuildInfo) { - if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host); - const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath); - version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath); - const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0; - currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0; - if (version2 && version2 === currentVersion) pseudoInputUpToDate = true; - } - if (!version2 || version2 !== currentVersion) { - return { - type: 5 /* OutOfDateWithSelf */, - outOfDateOutputFileName: buildInfoPath, - newerInputFileName: inputFile - }; - } - } - if (inputTime > newestInputFileTime) { - newestInputFileName = inputFile; - newestInputFileTime = inputTime; - } - seenRoots.add(inputPath); - } - let existingRoot; - if (incrementalBuildInfo) { - if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host); - existingRoot = forEachEntry( - buildInfoVersionMap.roots, - // File was root file when project was built but its not any more - (_resolved, existingRoot2) => !seenRoots.has(existingRoot2) ? existingRoot2 : void 0 - ); - } else { - existingRoot = forEach( - getNonIncrementalBuildInfoRoots(buildInfo, buildInfoPath, host), - (root) => !seenRoots.has(root) ? root : void 0 - ); - } - if (existingRoot) { - return { - type: 10 /* OutOfDateRoots */, - buildInfoFile: buildInfoPath, - inputFile: existingRoot - }; - } - if (!isIncremental) { - const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames()); - const outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath); - for (const output of outputs) { - if (output === buildInfoPath) continue; - const path = toPath2(state, output); - let outputTime = outputTimeStampMap == null ? void 0 : outputTimeStampMap.get(path); - if (!outputTime) { - outputTime = getModifiedTime(state.host, output); - outputTimeStampMap == null ? void 0 : outputTimeStampMap.set(path, outputTime); - } - if (outputTime === missingFileModifiedTime) { - return { - type: 3 /* OutputMissing */, - missingOutputFileName: output - }; - } - if (outputTime < newestInputFileTime) { - return { - type: 5 /* OutOfDateWithSelf */, - outOfDateOutputFileName: output, - newerInputFileName: newestInputFileName - }; - } - if (outputTime < oldestOutputFileTime) { - oldestOutputFileTime = outputTime; - oldestOutputFileName = output; - } - } - } - let pseudoUpToDate = false; - if (referenceStatuses) { - for (const { ref, refStatus, resolvedConfig, resolvedRefPath } of referenceStatuses) { - if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) { - continue; - } - if (hasSameBuildInfo(state, buildInfoCacheEntry ?? (buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath)), resolvedRefPath)) { - return { - type: 6 /* OutOfDateWithUpstream */, - outOfDateOutputFileName: buildInfoPath, - newerProjectName: ref.path - }; - } - const newestDeclarationFileContentChangedTime = getLatestChangedDtsTime(state, resolvedConfig.options, resolvedRefPath); - if (newestDeclarationFileContentChangedTime && newestDeclarationFileContentChangedTime <= oldestOutputFileTime) { - pseudoUpToDate = true; - continue; - } - Debug.assert(oldestOutputFileName !== void 0, "Should have an oldest output filename here"); - return { - type: 6 /* OutOfDateWithUpstream */, - outOfDateOutputFileName: oldestOutputFileName, - newerProjectName: ref.path - }; - } - } - const configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName); - if (configStatus) return configStatus; - const extendedConfigStatus = forEach(project.options.configFile.extendedSourceFiles || emptyArray, (configFile) => checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName)); - if (extendedConfigStatus) return extendedConfigStatus; - const packageJsonLookups = state.lastCachedPackageJsonLookups.get(resolvedPath); - const dependentPackageFileStatus = packageJsonLookups && forEachKey( - packageJsonLookups, - (path) => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName) - ); - if (dependentPackageFileStatus) return dependentPackageFileStatus; - return { - type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */, - newestInputFileTime, - newestInputFileName, - oldestOutputFileName - }; -} -function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) { - const refBuildInfo = state.buildInfoCache.get(resolvedRefPath); - return refBuildInfo.path === buildInfoCacheEntry.path; -} -function getUpToDateStatus(state, project, resolvedPath) { - if (project === void 0) { - return { type: 0 /* Unbuildable */, reason: "config file deleted mid-build" }; - } - const prior = state.projectStatus.get(resolvedPath); - if (prior !== void 0) { - return prior; - } - mark("SolutionBuilder::beforeUpToDateCheck"); - const actual = getUpToDateStatusWorker(state, project, resolvedPath); - mark("SolutionBuilder::afterUpToDateCheck"); - measure("SolutionBuilder::Up-to-date check", "SolutionBuilder::beforeUpToDateCheck", "SolutionBuilder::afterUpToDateCheck"); - state.projectStatus.set(resolvedPath, actual); - return actual; -} -function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) { - if (proj.options.noEmit) return; - let now; - const buildInfoPath = getTsBuildInfoEmitOutputFilePath(proj.options); - const isIncremental = isIncrementalCompilation(proj.options); - if (buildInfoPath && isIncremental) { - if (!(skipOutputs == null ? void 0 : skipOutputs.has(toPath2(state, buildInfoPath)))) { - if (!!state.options.verbose) reportStatus(state, verboseMessage, proj.options.configFilePath); - state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host)); - getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now; - } - state.outputTimeStamps.delete(projectPath); - return; - } - const { host } = state; - const outputs = getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames()); - const outputTimeStampMap = getOutputTimeStampMap(state, projectPath); - const modifiedOutputs = outputTimeStampMap ? /* @__PURE__ */ new Set() : void 0; - if (!skipOutputs || outputs.length !== skipOutputs.size) { - let reportVerbose = !!state.options.verbose; - for (const file of outputs) { - const path = toPath2(state, file); - if (skipOutputs == null ? void 0 : skipOutputs.has(path)) continue; - if (reportVerbose) { - reportVerbose = false; - reportStatus(state, verboseMessage, proj.options.configFilePath); - } - host.setModifiedTime(file, now || (now = getCurrentTime(state.host))); - if (file === buildInfoPath) getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now; - else if (outputTimeStampMap) { - outputTimeStampMap.set(path, now); - modifiedOutputs.add(path); - } - } - } - outputTimeStampMap == null ? void 0 : outputTimeStampMap.forEach((_value, key) => { - if (!(skipOutputs == null ? void 0 : skipOutputs.has(key)) && !modifiedOutputs.has(key)) outputTimeStampMap.delete(key); - }); -} -function getLatestChangedDtsTime(state, options, resolvedConfigPath) { - if (!options.composite) return void 0; - const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath)); - if (entry.latestChangedDtsTime !== void 0) return entry.latestChangedDtsTime || void 0; - const latestChangedDtsTime = entry.buildInfo && isIncrementalBuildInfo(entry.buildInfo) && entry.buildInfo.latestChangedDtsFile ? state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.latestChangedDtsFile, getDirectoryPath(entry.path))) : void 0; - entry.latestChangedDtsTime = latestChangedDtsTime || false; - return latestChangedDtsTime; -} -function updateOutputTimestamps(state, proj, resolvedPath) { - if (state.options.dry) { - return reportStatus(state, Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath); - } - updateOutputTimestampsWorker(state, proj, resolvedPath, Diagnostics.Updating_output_timestamps_of_project_0); - state.projectStatus.set(resolvedPath, { - type: 1 /* UpToDate */, - oldestOutputFileName: getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames()) - }); -} -function queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, buildResult) { - if (state.options.stopBuildOnErrors && buildResult & 4 /* AnyErrors */) return; - if (!config.options.composite) return; - for (let index = projectIndex + 1; index < buildOrder.length; index++) { - const nextProject = buildOrder[index]; - const nextProjectPath = toResolvedConfigFilePath(state, nextProject); - if (state.projectPendingBuild.has(nextProjectPath)) continue; - const nextProjectConfig = parseConfigFile(state, nextProject, nextProjectPath); - if (!nextProjectConfig || !nextProjectConfig.projectReferences) continue; - for (const ref of nextProjectConfig.projectReferences) { - const resolvedRefPath = resolveProjectName(state, ref.path); - if (toResolvedConfigFilePath(state, resolvedRefPath) !== projectPath) continue; - const status = state.projectStatus.get(nextProjectPath); - if (status) { - switch (status.type) { - case 1 /* UpToDate */: - if (buildResult & 2 /* DeclarationOutputUnchanged */) { - status.type = 2 /* UpToDateWithUpstreamTypes */; - break; - } - // falls through - case 15 /* UpToDateWithInputFileText */: - case 2 /* UpToDateWithUpstreamTypes */: - if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) { - state.projectStatus.set(nextProjectPath, { - type: 6 /* OutOfDateWithUpstream */, - outOfDateOutputFileName: status.oldestOutputFileName, - newerProjectName: project - }); - } - break; - case 12 /* UpstreamBlocked */: - if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { - clearProjectStatus(state, nextProjectPath); - } - break; - } - } - addProjToQueue(state, nextProjectPath, 0 /* Update */); - break; - } - } -} -function build(state, project, cancellationToken, writeFile2, getCustomTransformers, onlyReferences) { - mark("SolutionBuilder::beforeBuild"); - const result = buildWorker(state, project, cancellationToken, writeFile2, getCustomTransformers, onlyReferences); - mark("SolutionBuilder::afterBuild"); - measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"); - return result; -} -function buildWorker(state, project, cancellationToken, writeFile2, getCustomTransformers, onlyReferences) { - const buildOrder = getBuildOrderFor(state, project, onlyReferences); - if (!buildOrder) return 3 /* InvalidProject_OutputsSkipped */; - setupInitialBuild(state, cancellationToken); - let reportQueue = true; - let successfulProjects = 0; - while (true) { - const invalidatedProject = getNextInvalidatedProject(state, buildOrder, reportQueue); - if (!invalidatedProject) break; - reportQueue = false; - invalidatedProject.done(cancellationToken, writeFile2, getCustomTransformers == null ? void 0 : getCustomTransformers(invalidatedProject.project)); - if (!state.diagnostics.has(invalidatedProject.projectPath)) successfulProjects++; - } - disableCache(state); - reportErrorSummary(state, buildOrder); - startWatching(state, buildOrder); - return isCircularBuildOrder(buildOrder) ? 4 /* ProjectReferenceCycle_OutputsSkipped */ : !buildOrder.some((p) => state.diagnostics.has(toResolvedConfigFilePath(state, p))) ? 0 /* Success */ : successfulProjects ? 2 /* DiagnosticsPresent_OutputsGenerated */ : 1 /* DiagnosticsPresent_OutputsSkipped */; -} -function clean(state, project, onlyReferences) { - mark("SolutionBuilder::beforeClean"); - const result = cleanWorker(state, project, onlyReferences); - mark("SolutionBuilder::afterClean"); - measure("SolutionBuilder::Clean", "SolutionBuilder::beforeClean", "SolutionBuilder::afterClean"); - return result; -} -function cleanWorker(state, project, onlyReferences) { - const buildOrder = getBuildOrderFor(state, project, onlyReferences); - if (!buildOrder) return 3 /* InvalidProject_OutputsSkipped */; - if (isCircularBuildOrder(buildOrder)) { - reportErrors(state, buildOrder.circularDiagnostics); - return 4 /* ProjectReferenceCycle_OutputsSkipped */; - } - const { options, host } = state; - const filesToDelete = options.dry ? [] : void 0; - for (const proj of buildOrder) { - const resolvedPath = toResolvedConfigFilePath(state, proj); - const parsed = parseConfigFile(state, proj, resolvedPath); - if (parsed === void 0) { - reportParseConfigFileDiagnostic(state, resolvedPath); - continue; - } - const outputs = getAllProjectOutputs(parsed, !host.useCaseSensitiveFileNames()); - if (!outputs.length) continue; - const inputFileNames = new Set(parsed.fileNames.map((f) => toPath2(state, f))); - for (const output of outputs) { - if (inputFileNames.has(toPath2(state, output))) continue; - if (host.fileExists(output)) { - if (filesToDelete) { - filesToDelete.push(output); - } else { - host.deleteFile(output); - invalidateProject(state, resolvedPath, 0 /* Update */); - } - } - } - } - if (filesToDelete) { - reportStatus(state, Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map((f) => `\r - * ${f}`).join("")); - } - return 0 /* Success */; -} -function invalidateProject(state, resolved, updateLevel) { - if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) { - updateLevel = 2 /* Full */; - } - if (updateLevel === 2 /* Full */) { - state.configFileCache.delete(resolved); - state.buildOrder = void 0; - } - state.needsSummary = true; - clearProjectStatus(state, resolved); - addProjToQueue(state, resolved, updateLevel); - enableCache(state); -} -function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) { - state.reportFileChangeDetected = true; - invalidateProject(state, resolvedPath, updateLevel); - scheduleBuildInvalidatedProject( - state, - 250, - /*changeDetected*/ - true - ); -} -function scheduleBuildInvalidatedProject(state, time, changeDetected) { - const { hostWithWatch } = state; - if (!hostWithWatch.setTimeout || !hostWithWatch.clearTimeout) { - return; - } - if (state.timerToBuildInvalidatedProject) { - hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject); - } - state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, "timerToBuildInvalidatedProject", state, changeDetected); -} -function buildNextInvalidatedProject(_timeoutType, state, changeDetected) { - mark("SolutionBuilder::beforeBuild"); - const buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected); - mark("SolutionBuilder::afterBuild"); - measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"); - if (buildOrder) reportErrorSummary(state, buildOrder); -} -function buildNextInvalidatedProjectWorker(state, changeDetected) { - state.timerToBuildInvalidatedProject = void 0; - if (state.reportFileChangeDetected) { - state.reportFileChangeDetected = false; - state.projectErrorsReported.clear(); - reportWatchStatus(state, Diagnostics.File_change_detected_Starting_incremental_compilation); - } - let projectsBuilt = 0; - const buildOrder = getBuildOrder(state); - const invalidatedProject = getNextInvalidatedProject( - state, - buildOrder, - /*reportQueue*/ - false - ); - if (invalidatedProject) { - invalidatedProject.done(); - projectsBuilt++; - while (state.projectPendingBuild.size) { - if (state.timerToBuildInvalidatedProject) return; - const info = getNextInvalidatedProjectCreateInfo( - state, - buildOrder, - /*reportQueue*/ - false - ); - if (!info) break; - if (info.kind !== 1 /* UpdateOutputFileStamps */ && (changeDetected || projectsBuilt === 5)) { - scheduleBuildInvalidatedProject( - state, - 100, - /*changeDetected*/ - false - ); - return; - } - const project = createInvalidatedProjectWithInfo(state, info, buildOrder); - project.done(); - if (info.kind !== 1 /* UpdateOutputFileStamps */) projectsBuilt++; - } - } - disableCache(state); - return buildOrder; -} -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 - ) - ); -} -function watchExtendedConfigFiles(state, resolvedPath, parsed) { - updateSharedExtendedConfigFileWatcher( - resolvedPath, - parsed == null ? void 0 : parsed.options, - state.allWatchedExtendedConfigFiles, - (extendedConfigFileName, extendedConfigFilePath) => watchFile( - state, - extendedConfigFileName, - () => { - var _a; - return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) == null ? void 0 : _a.projects.forEach((projectConfigFilePath) => invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, 2 /* Full */)); - }, - 2e3 /* High */, - parsed == null ? void 0 : parsed.watchOptions, - WatchType.ExtendedConfigFile - ), - (fileName) => toPath2(state, fileName) - ); -} -function watchWildCardDirectories(state, resolved, resolvedPath, parsed) { - if (!state.watch) return; - updateWatchingWildcardDirectories( - getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath), - parsed.wildcardDirectories, - (dir, flags) => state.watchDirectory( - dir, - (fileOrDirectory) => { - var _a; - if (isIgnoredFileFromWildCardWatching({ - watchedDirPath: toPath2(state, dir), - fileOrDirectory, - fileOrDirectoryPath: toPath2(state, fileOrDirectory), - configFileName: resolved, - currentDirectory: state.compilerHost.getCurrentDirectory(), - options: parsed.options, - program: state.builderPrograms.get(resolvedPath) || ((_a = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a.fileNames), - useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames, - writeLog: (s) => state.writeLog(s), - toPath: (fileName) => toPath2(state, fileName) - })) return; - invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */); - }, - flags, - parsed == null ? void 0 : parsed.watchOptions, - WatchType.WildcardDirectory, - resolved - ) - ); -} -function watchInputFiles(state, resolved, resolvedPath, parsed) { - if (!state.watch) return; - mutateMap( - getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), - new Set(parsed.fileNames), - { - createNewValue: (input) => watchFile( - state, - input, - () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */), - 250 /* Low */, - parsed == null ? void 0 : parsed.watchOptions, - WatchType.SourceFile, - resolved - ), - onDeleteValue: closeFileWatcher - } - ); -} -function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) { - if (!state.watch || !state.lastCachedPackageJsonLookups) return; - mutateMap( - getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), - state.lastCachedPackageJsonLookups.get(resolvedPath), - { - createNewValue: (input) => watchFile( - state, - input, - () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */), - 2e3 /* High */, - parsed == null ? void 0 : parsed.watchOptions, - WatchType.PackageJson, - resolved - ), - onDeleteValue: closeFileWatcher - } - ); -} -function startWatching(state, buildOrder) { - if (!state.watchAllProjectsPending) return; - mark("SolutionBuilder::beforeWatcherCreation"); - state.watchAllProjectsPending = false; - for (const resolved of getBuildOrderFromAnyBuildOrder(buildOrder)) { - const resolvedPath = toResolvedConfigFilePath(state, resolved); - const cfg = parseConfigFile(state, resolved, resolvedPath); - watchConfigFile(state, resolved, resolvedPath, cfg); - watchExtendedConfigFiles(state, resolvedPath, cfg); - if (cfg) { - watchWildCardDirectories(state, resolved, resolvedPath, cfg); - watchInputFiles(state, resolved, resolvedPath, cfg); - watchPackageJsonFiles(state, resolved, resolvedPath, cfg); - } - } - mark("SolutionBuilder::afterWatcherCreation"); - measure("SolutionBuilder::Watcher creation", "SolutionBuilder::beforeWatcherCreation", "SolutionBuilder::afterWatcherCreation"); -} -function stopWatching(state) { - clearMap(state.allWatchedConfigFiles, closeFileWatcher); - clearMap(state.allWatchedExtendedConfigFiles, closeFileWatcherOf); - clearMap(state.allWatchedWildcardDirectories, (watchedWildcardDirectories) => clearMap(watchedWildcardDirectories, closeFileWatcherOf)); - clearMap(state.allWatchedInputFiles, (watchedWildcardDirectories) => clearMap(watchedWildcardDirectories, closeFileWatcher)); - clearMap(state.allWatchedPackageJsonFiles, (watchedPacageJsonFiles) => clearMap(watchedPacageJsonFiles, closeFileWatcher)); -} -function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) { - const state = createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions); - return { - build: (project, cancellationToken, writeFile2, getCustomTransformers) => build(state, project, cancellationToken, writeFile2, getCustomTransformers), - clean: (project) => clean(state, project), - buildReferences: (project, cancellationToken, writeFile2, getCustomTransformers) => build( - state, - project, - cancellationToken, - writeFile2, - getCustomTransformers, - /*onlyReferences*/ - true - ), - cleanReferences: (project) => clean( - state, - project, - /*onlyReferences*/ - true - ), - getNextInvalidatedProject: (cancellationToken) => { - setupInitialBuild(state, cancellationToken); - return getNextInvalidatedProject( - state, - getBuildOrder(state), - /*reportQueue*/ - false - ); - }, - getBuildOrder: () => getBuildOrder(state), - getUpToDateStatusOfProject: (project) => { - const configFileName = resolveProjectName(state, project); - const configFilePath = toResolvedConfigFilePath(state, configFileName); - return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath); - }, - invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */), - close: () => stopWatching(state) - }; -} -function relName(state, path) { - return convertToRelativePath(path, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName); -} -function reportStatus(state, message, ...args) { - state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args)); -} -function reportWatchStatus(state, message, ...args) { - var _a, _b; - (_b = (_a = state.hostWithWatch).onWatchStatusChange) == null ? void 0 : _b.call(_a, createCompilerDiagnostic(message, ...args), state.host.getNewLine(), state.baseCompilerOptions); -} -function reportErrors({ host }, errors) { - errors.forEach((err) => host.reportDiagnostic(err)); -} -function reportAndStoreErrors(state, proj, errors) { - reportErrors(state, errors); - state.projectErrorsReported.set(proj, true); - if (errors.length) { - state.diagnostics.set(proj, errors); - } -} -function reportParseConfigFileDiagnostic(state, proj) { - reportAndStoreErrors(state, proj, [state.configFileCache.get(proj)]); -} -function reportErrorSummary(state, buildOrder) { - if (!state.needsSummary) return; - state.needsSummary = false; - const canReportSummary = state.watch || !!state.host.reportErrorSummary; - const { diagnostics } = state; - let totalErrors = 0; - let filesInError = []; - if (isCircularBuildOrder(buildOrder)) { - reportBuildQueue(state, buildOrder.buildOrder); - reportErrors(state, buildOrder.circularDiagnostics); - if (canReportSummary) totalErrors += getErrorCountForSummary(buildOrder.circularDiagnostics); - if (canReportSummary) filesInError = [...filesInError, ...getFilesInErrorForSummary(buildOrder.circularDiagnostics)]; - } else { - buildOrder.forEach((project) => { - const projectPath = toResolvedConfigFilePath(state, project); - if (!state.projectErrorsReported.has(projectPath)) { - reportErrors(state, diagnostics.get(projectPath) || emptyArray); - } - }); - if (canReportSummary) diagnostics.forEach((singleProjectErrors) => totalErrors += getErrorCountForSummary(singleProjectErrors)); - if (canReportSummary) diagnostics.forEach((singleProjectErrors) => [...filesInError, ...getFilesInErrorForSummary(singleProjectErrors)]); - } - if (state.watch) { - reportWatchStatus(state, getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors); - } else if (state.host.reportErrorSummary) { - state.host.reportErrorSummary(totalErrors, filesInError); - } -} -function reportBuildQueue(state, buildQueue) { - if (state.options.verbose) { - reportStatus(state, Diagnostics.Projects_in_this_build_Colon_0, buildQueue.map((s) => "\r\n * " + relName(state, s)).join("")); - } -} -function reportUpToDateStatus(state, configFileName, status) { - switch (status.type) { - case 5 /* OutOfDateWithSelf */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, - relName(state, configFileName), - relName(state, status.outOfDateOutputFileName), - relName(state, status.newerInputFileName) - ); - case 6 /* OutOfDateWithUpstream */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, - relName(state, configFileName), - relName(state, status.outOfDateOutputFileName), - relName(state, status.newerProjectName) - ); - case 3 /* OutputMissing */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, - relName(state, configFileName), - relName(state, status.missingOutputFileName) - ); - case 4 /* ErrorReadingFile */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_there_was_error_reading_file_1, - relName(state, configFileName), - relName(state, status.fileName) - ); - case 7 /* OutOfDateBuildInfoWithPendingEmit */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted, - relName(state, configFileName), - relName(state, status.buildInfoFile) - ); - case 8 /* OutOfDateBuildInfoWithErrors */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors, - relName(state, configFileName), - relName(state, status.buildInfoFile) - ); - case 9 /* OutOfDateOptions */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions, - relName(state, configFileName), - relName(state, status.buildInfoFile) - ); - case 10 /* OutOfDateRoots */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more, - relName(state, configFileName), - relName(state, status.buildInfoFile), - relName(state, status.inputFile) - ); - case 1 /* UpToDate */: - if (status.newestInputFileTime !== void 0) { - return reportStatus( - state, - Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2, - relName(state, configFileName), - relName(state, status.newestInputFileName || ""), - relName(state, status.oldestOutputFileName || "") - ); - } - break; - case 2 /* UpToDateWithUpstreamTypes */: - return reportStatus( - state, - Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, - relName(state, configFileName) - ); - case 15 /* UpToDateWithInputFileText */: - return reportStatus( - state, - Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, - relName(state, configFileName) - ); - case 11 /* UpstreamOutOfDate */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, - relName(state, configFileName), - relName(state, status.upstreamProjectName) - ); - case 12 /* UpstreamBlocked */: - return reportStatus( - state, - status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, - relName(state, configFileName), - relName(state, status.upstreamProjectName) - ); - case 0 /* Unbuildable */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_1, - relName(state, configFileName), - status.reason - ); - case 14 /* TsVersionOutputOfDate */: - return reportStatus( - state, - Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, - relName(state, configFileName), - status.version, - version - ); - case 17 /* ForceBuild */: - return reportStatus( - state, - Diagnostics.Project_0_is_being_forcibly_rebuilt, - relName(state, configFileName) - ); - case 16 /* ContainerOnly */: - // Don't report status on "solution" projects - // falls through - case 13 /* ComputingUpstream */: - break; - default: - assertType(status); - } -} -function verboseReportProjectStatus(state, configFileName, status) { - if (state.options.verbose) { - reportUpToDateStatus(state, configFileName, status); - } -} - -// src/compiler/executeCommandLine.ts -var StatisticType = /* @__PURE__ */ ((StatisticType2) => { - StatisticType2[StatisticType2["time"] = 0] = "time"; - StatisticType2[StatisticType2["count"] = 1] = "count"; - StatisticType2[StatisticType2["memory"] = 2] = "memory"; - return StatisticType2; -})(StatisticType || {}); -function countLines(program) { - const counts2 = getCountsMap(); - forEach(program.getSourceFiles(), (file) => { - const key = getCountKey(program, file); - const lineCount = getLineStarts(file).length; - counts2.set(key, counts2.get(key) + lineCount); - }); - return counts2; -} -function getCountsMap() { - const counts2 = /* @__PURE__ */ new Map(); - counts2.set("Library", 0); - counts2.set("Definitions", 0); - counts2.set("TypeScript", 0); - counts2.set("JavaScript", 0); - counts2.set("JSON", 0); - counts2.set("Other", 0); - return counts2; -} -function getCountKey(program, file) { - if (program.isSourceFileDefaultLibrary(file)) { - return "Library"; - } else if (file.isDeclarationFile) { - return "Definitions"; - } - const path = file.path; - if (fileExtensionIsOneOf(path, supportedTSExtensionsFlat)) { - return "TypeScript"; - } else if (fileExtensionIsOneOf(path, supportedJSExtensionsFlat)) { - return "JavaScript"; - } else if (fileExtensionIs(path, ".json" /* Json */)) { - return "JSON"; - } else { - return "Other"; - } -} -function updateReportDiagnostic(sys2, existing, options) { - return shouldBePretty(sys2, options) ? createDiagnosticReporter( - sys2, - /*pretty*/ - true - ) : existing; -} -function defaultIsPretty(sys2) { - return !!sys2.writeOutputIsTTY && sys2.writeOutputIsTTY() && !sys2.getEnvironmentVariable("NO_COLOR"); -} -function shouldBePretty(sys2, options) { - if (!options || typeof options.pretty === "undefined") { - return defaultIsPretty(sys2); - } - return options.pretty; -} -function getOptionsForHelp(commandLine) { - return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.concat(tscBuildOption), (v) => !!v.showInSimplifiedHelpView); -} -function printVersion(sys2) { - sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine); -} -function createColors(sys2) { - const showColors = defaultIsPretty(sys2); - if (!showColors) { - return { - bold: (str) => str, - blue: (str) => str, - blueBackground: (str) => str, - brightWhite: (str) => str - }; - } - function bold(str) { - return `\x1B[1m${str}\x1B[22m`; - } - const isWindows = sys2.getEnvironmentVariable("OS") && sys2.getEnvironmentVariable("OS").toLowerCase().includes("windows"); - const isWindowsTerminal = sys2.getEnvironmentVariable("WT_SESSION"); - const isVSCode = sys2.getEnvironmentVariable("TERM_PROGRAM") && sys2.getEnvironmentVariable("TERM_PROGRAM") === "vscode"; - function blue(str) { - if (isWindows && !isWindowsTerminal && !isVSCode) { - return brightWhite(str); - } - return `\x1B[94m${str}\x1B[39m`; - } - const supportsRicherColors = sys2.getEnvironmentVariable("COLORTERM") === "truecolor" || sys2.getEnvironmentVariable("TERM") === "xterm-256color"; - function blueBackground(str) { - if (supportsRicherColors) { - return `\x1B[48;5;68m${str}\x1B[39;49m`; - } else { - return `\x1B[44m${str}\x1B[39;49m`; - } - } - function brightWhite(str) { - return `\x1B[97m${str}\x1B[39m`; - } - return { - bold, - blue, - brightWhite, - blueBackground - }; -} -function getDisplayNameTextOfOption(option) { - return `--${option.name}${option.shortName ? `, -${option.shortName}` : ""}`; -} -function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight) { - var _a; - const text = []; - const colors = createColors(sys2); - const name = getDisplayNameTextOfOption(option); - const valueCandidates = getValueCandidate(option); - const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue( - option.defaultValueDescription, - option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type - ); - const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? void 0 : _a.call(sys2)) ?? 0; - if (terminalWidth >= 80) { - let description3 = ""; - if (option.description) { - description3 = getDiagnosticText(option.description); - } - text.push(...getPrettyOutput( - name, - description3, - rightAlignOfLeft, - leftAlignOfRight, - terminalWidth, - /*colorLeft*/ - true - ), sys2.newLine); - if (showAdditionalInfoOutput(valueCandidates, option)) { - if (valueCandidates) { - text.push(...getPrettyOutput( - valueCandidates.valueType, - valueCandidates.possibleValues, - rightAlignOfLeft, - leftAlignOfRight, - terminalWidth, - /*colorLeft*/ - false - ), sys2.newLine); - } - if (defaultValueDescription) { - text.push(...getPrettyOutput( - getDiagnosticText(Diagnostics.default_Colon), - defaultValueDescription, - rightAlignOfLeft, - leftAlignOfRight, - terminalWidth, - /*colorLeft*/ - false - ), sys2.newLine); - } - } - text.push(sys2.newLine); - } else { - text.push(colors.blue(name), sys2.newLine); - if (option.description) { - const description3 = getDiagnosticText(option.description); - text.push(description3); - } - text.push(sys2.newLine); - if (showAdditionalInfoOutput(valueCandidates, option)) { - if (valueCandidates) { - text.push(`${valueCandidates.valueType} ${valueCandidates.possibleValues}`); - } - if (defaultValueDescription) { - if (valueCandidates) text.push(sys2.newLine); - const diagType = getDiagnosticText(Diagnostics.default_Colon); - text.push(`${diagType} ${defaultValueDescription}`); - } - text.push(sys2.newLine); - } - text.push(sys2.newLine); - } - return text; - function formatDefaultValue(defaultValue, type) { - return defaultValue !== void 0 && typeof type === "object" ? arrayFrom(type.entries()).filter(([, value]) => value === defaultValue).map(([name2]) => name2).join("/") : String(defaultValue); - } - function showAdditionalInfoOutput(valueCandidates2, option2) { - const ignoreValues = ["string"]; - const ignoredDescriptions = [void 0, "false", "n/a"]; - const defaultValueDescription2 = option2.defaultValueDescription; - if (option2.category === Diagnostics.Command_line_Options) return false; - if (contains(ignoreValues, valueCandidates2 == null ? void 0 : valueCandidates2.possibleValues) && contains(ignoredDescriptions, defaultValueDescription2)) { - return false; - } - return true; - } - function getPrettyOutput(left, right, rightAlignOfLeft2, leftAlignOfRight2, terminalWidth2, colorLeft) { - const res = []; - let isFirstLine = true; - let remainRight = right; - const rightCharacterNumber = terminalWidth2 - leftAlignOfRight2; - while (remainRight.length > 0) { - let curLeft = ""; - if (isFirstLine) { - curLeft = left.padStart(rightAlignOfLeft2); - curLeft = curLeft.padEnd(leftAlignOfRight2); - curLeft = colorLeft ? colors.blue(curLeft) : curLeft; - } else { - curLeft = "".padStart(leftAlignOfRight2); - } - const curRight = remainRight.substr(0, rightCharacterNumber); - remainRight = remainRight.slice(rightCharacterNumber); - res.push(`${curLeft}${curRight}`); - isFirstLine = false; - } - return res; - } - function getValueCandidate(option2) { - if (option2.type === "object") { - return void 0; - } - return { - valueType: getValueType(option2), - possibleValues: getPossibleValues(option2) - }; - function getValueType(option3) { - Debug.assert(option3.type !== "listOrElement"); - switch (option3.type) { - case "string": - case "number": - case "boolean": - return getDiagnosticText(Diagnostics.type_Colon); - case "list": - return getDiagnosticText(Diagnostics.one_or_more_Colon); - default: - return getDiagnosticText(Diagnostics.one_of_Colon); - } - } - function getPossibleValues(option3) { - let possibleValues; - switch (option3.type) { - case "string": - case "number": - case "boolean": - possibleValues = option3.type; - break; - case "list": - case "listOrElement": - possibleValues = getPossibleValues(option3.element); - break; - case "object": - possibleValues = ""; - break; - default: - const inverted = {}; - option3.type.forEach((value, name2) => { - var _a2; - if (!((_a2 = option3.deprecatedKeys) == null ? void 0 : _a2.has(name2))) { - (inverted[value] || (inverted[value] = [])).push(name2); - } - }); - return Object.entries(inverted).map(([, synonyms]) => synonyms.join("/")).join(", "); - } - return possibleValues; - } - } -} -function generateGroupOptionOutput(sys2, optionsList) { - let maxLength2 = 0; - for (const option of optionsList) { - const curLength = getDisplayNameTextOfOption(option).length; - maxLength2 = maxLength2 > curLength ? maxLength2 : curLength; - } - const rightAlignOfLeftPart = maxLength2 + 2; - const leftAlignOfRightPart = rightAlignOfLeftPart + 2; - let lines = []; - for (const option of optionsList) { - const tmp = generateOptionOutput(sys2, option, rightAlignOfLeftPart, leftAlignOfRightPart); - lines = [...lines, ...tmp]; - } - if (lines[lines.length - 2] !== sys2.newLine) { - lines.push(sys2.newLine); - } - return lines; -} -function generateSectionOptionsOutput(sys2, sectionName, options, subCategory, beforeOptionsDescription, afterOptionsDescription) { - let res = []; - res.push(createColors(sys2).bold(sectionName) + sys2.newLine + sys2.newLine); - if (beforeOptionsDescription) { - res.push(beforeOptionsDescription + sys2.newLine + sys2.newLine); - } - if (!subCategory) { - res = [...res, ...generateGroupOptionOutput(sys2, options)]; - if (afterOptionsDescription) { - res.push(afterOptionsDescription + sys2.newLine + sys2.newLine); - } - return res; - } - const categoryMap = /* @__PURE__ */ new Map(); - for (const option of options) { - if (!option.category) { - continue; - } - const curCategory = getDiagnosticText(option.category); - const optionsOfCurCategory = categoryMap.get(curCategory) ?? []; - optionsOfCurCategory.push(option); - categoryMap.set(curCategory, optionsOfCurCategory); - } - categoryMap.forEach((value, key) => { - res.push(`### ${key}${sys2.newLine}${sys2.newLine}`); - res = [...res, ...generateGroupOptionOutput(sys2, value)]; - }); - if (afterOptionsDescription) { - res.push(afterOptionsDescription + sys2.newLine + sys2.newLine); - } - return res; -} -function printEasyHelp(sys2, simpleOptions) { - const colors = createColors(sys2); - let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)]; - output.push(colors.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine); - example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory); - example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options); - example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory); - example("tsc --init", Diagnostics.Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory); - example("tsc -p ./path/to/tsconfig.json", Diagnostics.Compiles_the_TypeScript_project_located_at_the_specified_path); - example("tsc --help --all", Diagnostics.An_expanded_version_of_this_information_showing_all_possible_compiler_options); - example(["tsc --noEmit", "tsc --target esnext"], Diagnostics.Compiles_the_current_project_with_additional_settings); - const cliCommands = simpleOptions.filter((opt) => opt.isCommandLineOnly || opt.category === Diagnostics.Command_line_Options); - const configOpts = simpleOptions.filter((opt) => !contains(cliCommands, opt)); - output = [ - ...output, - ...generateSectionOptionsOutput( - sys2, - getDiagnosticText(Diagnostics.COMMAND_LINE_FLAGS), - cliCommands, - /*subCategory*/ - false, - /*beforeOptionsDescription*/ - void 0, - /*afterOptionsDescription*/ - void 0 - ), - ...generateSectionOptionsOutput( - sys2, - getDiagnosticText(Diagnostics.COMMON_COMPILER_OPTIONS), - configOpts, - /*subCategory*/ - false, - /*beforeOptionsDescription*/ - void 0, - formatMessage(Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc") - ) - ]; - for (const line of output) { - sys2.write(line); - } - function example(ex, desc) { - const examples = typeof ex === "string" ? [ex] : ex; - for (const example2 of examples) { - output.push(" " + colors.blue(example2) + sys2.newLine); - } - output.push(" " + getDiagnosticText(desc) + sys2.newLine + sys2.newLine); - } -} -function printAllHelp(sys2, compilerOptions, buildOptions, watchOptions) { - let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)]; - output = [...output, ...generateSectionOptionsOutput( - sys2, - getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS), - compilerOptions, - /*subCategory*/ - true, - /*beforeOptionsDescription*/ - void 0, - formatMessage(Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc") - )]; - output = [...output, ...generateSectionOptionsOutput( - sys2, - getDiagnosticText(Diagnostics.WATCH_OPTIONS), - watchOptions, - /*subCategory*/ - false, - getDiagnosticText(Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon) - )]; - output = [...output, ...generateSectionOptionsOutput( - sys2, - getDiagnosticText(Diagnostics.BUILD_OPTIONS), - filter(buildOptions, (option) => option !== tscBuildOption), - /*subCategory*/ - false, - formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds") - )]; - for (const line of output) { - sys2.write(line); - } -} -function printBuildHelp(sys2, buildOptions) { - let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)]; - output = [...output, ...generateSectionOptionsOutput( - sys2, - getDiagnosticText(Diagnostics.BUILD_OPTIONS), - filter(buildOptions, (option) => option !== tscBuildOption), - /*subCategory*/ - false, - formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds") - )]; - for (const line of output) { - sys2.write(line); - } -} -function getHeader(sys2, message) { - var _a; - const colors = createColors(sys2); - const header = []; - const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? void 0 : _a.call(sys2)) ?? 0; - const tsIconLength = 5; - const tsIconFirstLine = colors.blueBackground("".padStart(tsIconLength)); - const tsIconSecondLine = colors.blueBackground(colors.brightWhite("TS ".padStart(tsIconLength))); - if (terminalWidth >= message.length + tsIconLength) { - const rightAlign = terminalWidth > 120 ? 120 : terminalWidth; - const leftAlign = rightAlign - tsIconLength; - header.push(message.padEnd(leftAlign) + tsIconFirstLine + sys2.newLine); - header.push("".padStart(leftAlign) + tsIconSecondLine + sys2.newLine); - } else { - header.push(message + sys2.newLine); - header.push(sys2.newLine); - } - return header; -} -function printHelp(sys2, commandLine) { - if (!commandLine.options.all) { - printEasyHelp(sys2, getOptionsForHelp(commandLine)); - } else { - printAllHelp(sys2, getOptionsForHelp(commandLine), optionsForBuild, optionsForWatch); - } -} -function executeCommandLineWorker(sys2, cb, commandLine) { - let reportDiagnostic = createDiagnosticReporter(sys2); - let configFileName; - if (commandLine.options.locale) { - validateLocaleAndSetLanguage(commandLine.options.locale, sys2, commandLine.errors); - } - if (commandLine.errors.length > 0) { - commandLine.errors.forEach(reportDiagnostic); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - if (commandLine.options.init) { - writeConfigFile(sys2, reportDiagnostic, commandLine.options); - return sys2.exit(0 /* Success */); - } - if (commandLine.options.version) { - printVersion(sys2); - return sys2.exit(0 /* Success */); - } - if (commandLine.options.help || commandLine.options.all) { - printHelp(sys2, commandLine); - return sys2.exit(0 /* Success */); - } - if (commandLine.options.watch && commandLine.options.listFilesOnly) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "listFilesOnly")); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - if (commandLine.options.project) { - if (commandLine.fileNames.length !== 0) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.Option_project_cannot_be_mixed_with_source_files_on_a_command_line)); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - const fileOrDirectory = normalizePath(commandLine.options.project); - if (!fileOrDirectory || sys2.directoryExists(fileOrDirectory)) { - configFileName = combinePaths(fileOrDirectory, "tsconfig.json"); - if (!sys2.fileExists(configFileName)) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0, commandLine.options.project)); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - } else { - configFileName = fileOrDirectory; - if (!sys2.fileExists(configFileName)) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_specified_path_does_not_exist_Colon_0, commandLine.options.project)); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - } - } else if (commandLine.fileNames.length === 0) { - const searchPath = normalizePath(sys2.getCurrentDirectory()); - configFileName = findConfigFile(searchPath, (fileName) => sys2.fileExists(fileName)); - } - if (commandLine.fileNames.length === 0 && !configFileName) { - if (commandLine.options.showConfig) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, normalizePath(sys2.getCurrentDirectory()))); - } else { - printVersion(sys2); - printHelp(sys2, commandLine); - } - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - const currentDirectory = sys2.getCurrentDirectory(); - const commandLineOptions = convertToOptionsWithAbsolutePaths( - commandLine.options, - (fileName) => getNormalizedAbsolutePath(fileName, currentDirectory) - ); - if (configFileName) { - const extendedConfigCache = /* @__PURE__ */ new Map(); - const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, extendedConfigCache, commandLine.watchOptions, sys2, reportDiagnostic); - if (commandLineOptions.showConfig) { - if (configParseResult.errors.length !== 0) { - reportDiagnostic = updateReportDiagnostic( - sys2, - reportDiagnostic, - configParseResult.options - ); - configParseResult.errors.forEach(reportDiagnostic); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - sys2.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys2), null, 4) + sys2.newLine); - return sys2.exit(0 /* Success */); - } - reportDiagnostic = updateReportDiagnostic( - sys2, - reportDiagnostic, - configParseResult.options - ); - if (isWatchSet(configParseResult.options)) { - if (reportWatchModeWithoutSysSupport(sys2, reportDiagnostic)) return; - return createWatchOfConfigFile( - sys2, - cb, - reportDiagnostic, - configParseResult, - commandLineOptions, - commandLine.watchOptions, - extendedConfigCache - ); - } else if (isIncrementalCompilation(configParseResult.options)) { - performIncrementalCompilation2( - sys2, - cb, - reportDiagnostic, - configParseResult - ); - } else { - performCompilation( - sys2, - cb, - reportDiagnostic, - configParseResult - ); - } - } else { - if (commandLineOptions.showConfig) { - sys2.write(JSON.stringify(convertToTSConfig(commandLine, combinePaths(currentDirectory, "tsconfig.json"), sys2), null, 4) + sys2.newLine); - return sys2.exit(0 /* Success */); - } - reportDiagnostic = updateReportDiagnostic( - sys2, - reportDiagnostic, - commandLineOptions - ); - if (isWatchSet(commandLineOptions)) { - if (reportWatchModeWithoutSysSupport(sys2, reportDiagnostic)) return; - return createWatchOfFilesAndCompilerOptions( - sys2, - cb, - reportDiagnostic, - commandLine.fileNames, - commandLineOptions, - commandLine.watchOptions - ); - } else if (isIncrementalCompilation(commandLineOptions)) { - performIncrementalCompilation2( - sys2, - cb, - reportDiagnostic, - { ...commandLine, options: commandLineOptions } - ); - } else { - performCompilation( - sys2, - cb, - reportDiagnostic, - { ...commandLine, options: commandLineOptions } - ); - } - } -} -function isBuildCommand(commandLineArgs) { - if (commandLineArgs.length > 0 && commandLineArgs[0].charCodeAt(0) === 45 /* minus */) { - const firstOption = commandLineArgs[0].slice(commandLineArgs[0].charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); - return firstOption === tscBuildOption.name || firstOption === tscBuildOption.shortName; - } - return false; -} -function executeCommandLine(system, cb, commandLineArgs) { - if (isBuildCommand(commandLineArgs)) { - const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs); - if (buildOptions.generateCpuProfile && system.enableCPUProfiler) { - system.enableCPUProfiler(buildOptions.generateCpuProfile, () => performBuild( - system, - cb, - buildOptions, - watchOptions, - projects, - errors - )); - } else { - return performBuild( - system, - cb, - buildOptions, - watchOptions, - projects, - errors - ); - } - } - const commandLine = parseCommandLine(commandLineArgs, (path) => system.readFile(path)); - if (commandLine.options.generateCpuProfile && system.enableCPUProfiler) { - system.enableCPUProfiler(commandLine.options.generateCpuProfile, () => executeCommandLineWorker( - system, - cb, - commandLine - )); - } else { - return executeCommandLineWorker(system, cb, commandLine); - } -} -function reportWatchModeWithoutSysSupport(sys2, reportDiagnostic) { - if (!sys2.watchFile || !sys2.watchDirectory) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--watch")); - sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - return true; - } - return false; -} -var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */; -function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) { - const reportDiagnostic = updateReportDiagnostic( - sys2, - createDiagnosticReporter(sys2), - buildOptions - ); - if (buildOptions.locale) { - validateLocaleAndSetLanguage(buildOptions.locale, sys2, errors); - } - if (errors.length > 0) { - errors.forEach(reportDiagnostic); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - if (buildOptions.help) { - printVersion(sys2); - printBuildHelp(sys2, buildOpts); - return sys2.exit(0 /* Success */); - } - if (projects.length === 0) { - printVersion(sys2); - printBuildHelp(sys2, buildOpts); - return sys2.exit(0 /* Success */); - } - if (!sys2.getModifiedTime || !sys2.setModifiedTime || buildOptions.clean && !sys2.deleteFile) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--build")); - return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); - } - if (buildOptions.watch) { - if (reportWatchModeWithoutSysSupport(sys2, reportDiagnostic)) return; - const buildHost2 = createSolutionBuilderWithWatchHost( - sys2, - /*createProgram*/ - void 0, - reportDiagnostic, - createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)), - createWatchStatusReporter2(sys2, buildOptions) - ); - buildHost2.jsDocParsingMode = defaultJSDocParsingMode; - const solutionPerformance2 = enableSolutionPerformance(sys2, buildOptions); - updateSolutionBuilderHost(sys2, cb, buildHost2, solutionPerformance2); - const onWatchStatusChange = buildHost2.onWatchStatusChange; - let reportBuildStatistics = false; - buildHost2.onWatchStatusChange = (d, newLine, options, errorCount) => { - onWatchStatusChange == null ? void 0 : onWatchStatusChange(d, newLine, options, errorCount); - if (reportBuildStatistics && (d.code === Diagnostics.Found_0_errors_Watching_for_file_changes.code || d.code === Diagnostics.Found_1_error_Watching_for_file_changes.code)) { - reportSolutionBuilderTimes(builder2, solutionPerformance2); - } - }; - const builder2 = createSolutionBuilderWithWatch(buildHost2, projects, buildOptions, watchOptions); - builder2.build(); - reportSolutionBuilderTimes(builder2, solutionPerformance2); - reportBuildStatistics = true; - return builder2; - } - const buildHost = createSolutionBuilderHost( - sys2, - /*createProgram*/ - void 0, - reportDiagnostic, - createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)), - createReportErrorSummary(sys2, buildOptions) - ); - buildHost.jsDocParsingMode = defaultJSDocParsingMode; - const solutionPerformance = enableSolutionPerformance(sys2, buildOptions); - updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance); - const builder = createSolutionBuilder(buildHost, projects, buildOptions); - const exitStatus = buildOptions.clean ? builder.clean() : builder.build(); - reportSolutionBuilderTimes(builder, solutionPerformance); - dumpTracingLegend(); - return sys2.exit(exitStatus); -} -function createReportErrorSummary(sys2, options) { - return shouldBePretty(sys2, options) ? (errorCount, filesInError) => sys2.write(getErrorSummaryText(errorCount, filesInError, sys2.newLine, sys2)) : void 0; -} -function performCompilation(sys2, cb, reportDiagnostic, config) { - const { fileNames, options, projectReferences } = config; - const host = createCompilerHostWorker( - options, - /*setParentNodes*/ - void 0, - sys2 - ); - host.jsDocParsingMode = defaultJSDocParsingMode; - const currentDirectory = host.getCurrentDirectory(); - const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName)); - enableStatisticsAndTracing( - sys2, - options, - /*isBuildMode*/ - false - ); - const programOptions = { - rootNames: fileNames, - options, - projectReferences, - host, - configFileParsingDiagnostics: getConfigFileParsingDiagnostics(config) - }; - const program = createProgram(programOptions); - const exitStatus = emitFilesAndReportErrorsAndGetExitStatus( - program, - reportDiagnostic, - (s) => sys2.write(s + sys2.newLine), - createReportErrorSummary(sys2, options) - ); - reportStatistics( - sys2, - program, - /*solutionPerformance*/ - void 0 - ); - cb(program); - return sys2.exit(exitStatus); -} -function performIncrementalCompilation2(sys2, cb, reportDiagnostic, config) { - const { options, fileNames, projectReferences } = config; - enableStatisticsAndTracing( - sys2, - options, - /*isBuildMode*/ - false - ); - const host = createIncrementalCompilerHost(options, sys2); - host.jsDocParsingMode = defaultJSDocParsingMode; - const exitStatus = performIncrementalCompilation({ - host, - system: sys2, - rootNames: fileNames, - options, - configFileParsingDiagnostics: getConfigFileParsingDiagnostics(config), - projectReferences, - reportDiagnostic, - reportErrorSummary: createReportErrorSummary(sys2, options), - afterProgramEmitAndDiagnostics: (builderProgram) => { - reportStatistics( - sys2, - builderProgram.getProgram(), - /*solutionPerformance*/ - void 0 - ); - cb(builderProgram); - } - }); - return sys2.exit(exitStatus); -} -function updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance) { - updateCreateProgram( - sys2, - buildHost, - /*isBuildMode*/ - true - ); - buildHost.afterProgramEmitAndDiagnostics = (program) => { - reportStatistics(sys2, program.getProgram(), solutionPerformance); - cb(program); - }; -} -function updateCreateProgram(sys2, host, isBuildMode) { - const compileUsingBuilder = host.createProgram; - host.createProgram = (rootNames, options, host2, oldProgram, configFileParsingDiagnostics, projectReferences) => { - Debug.assert(rootNames !== void 0 || options === void 0 && !!oldProgram); - if (options !== void 0) { - enableStatisticsAndTracing(sys2, options, isBuildMode); - } - return compileUsingBuilder(rootNames, options, host2, oldProgram, configFileParsingDiagnostics, projectReferences); - }; -} -function updateWatchCompilationHost(sys2, cb, watchCompilerHost) { - watchCompilerHost.jsDocParsingMode = defaultJSDocParsingMode; - updateCreateProgram( - sys2, - watchCompilerHost, - /*isBuildMode*/ - false - ); - const emitFilesUsingBuilder = watchCompilerHost.afterProgramCreate; - watchCompilerHost.afterProgramCreate = (builderProgram) => { - emitFilesUsingBuilder(builderProgram); - reportStatistics( - sys2, - builderProgram.getProgram(), - /*solutionPerformance*/ - void 0 - ); - cb(builderProgram); - }; -} -function createWatchStatusReporter2(sys2, options) { - return createWatchStatusReporter(sys2, shouldBePretty(sys2, options)); -} -function createWatchOfConfigFile(system, cb, reportDiagnostic, configParseResult, optionsToExtend, watchOptionsToExtend, extendedConfigCache) { - const watchCompilerHost = createWatchCompilerHostOfConfigFile({ - configFileName: configParseResult.options.configFilePath, - optionsToExtend, - watchOptionsToExtend, - system, - reportDiagnostic, - reportWatchStatus: createWatchStatusReporter2(system, configParseResult.options) - }); - updateWatchCompilationHost(system, cb, watchCompilerHost); - watchCompilerHost.configFileParsingResult = configParseResult; - watchCompilerHost.extendedConfigCache = extendedConfigCache; - return createWatchProgram(watchCompilerHost); -} -function createWatchOfFilesAndCompilerOptions(system, cb, reportDiagnostic, rootFiles, options, watchOptions) { - const watchCompilerHost = createWatchCompilerHostOfFilesAndCompilerOptions({ - rootFiles, - options, - watchOptions, - system, - reportDiagnostic, - reportWatchStatus: createWatchStatusReporter2(system, options) - }); - updateWatchCompilationHost(system, cb, watchCompilerHost); - return createWatchProgram(watchCompilerHost); -} -function enableSolutionPerformance(system, options) { - if (system === sys && options.extendedDiagnostics) { - enable(); - return createSolutionPerfomrance(); - } -} -function createSolutionPerfomrance() { - let statistics; - return { - addAggregateStatistic, - forEachAggregateStatistics: forEachAggreateStatistics, - clear: clear2 - }; - function addAggregateStatistic(s) { - const existing = statistics == null ? void 0 : statistics.get(s.name); - if (existing) { - if (existing.type === 2 /* memory */) existing.value = Math.max(existing.value, s.value); - else existing.value += s.value; - } else { - (statistics ?? (statistics = /* @__PURE__ */ new Map())).set(s.name, s); - } - } - function forEachAggreateStatistics(cb) { - statistics == null ? void 0 : statistics.forEach(cb); - } - function clear2() { - statistics = void 0; - } -} -function reportSolutionBuilderTimes(builder, solutionPerformance) { - if (!solutionPerformance) return; - if (!isEnabled()) { - sys.write(Diagnostics.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + "\n"); - return; - } - const statistics = []; - statistics.push( - { name: "Projects in scope", value: getBuildOrderFromAnyBuildOrder(builder.getBuildOrder()).length, type: 1 /* count */ } - ); - reportSolutionBuilderCountStatistic("SolutionBuilder::Projects built"); - reportSolutionBuilderCountStatistic("SolutionBuilder::Timestamps only updates"); - reportSolutionBuilderCountStatistic("SolutionBuilder::Bundles updated"); - solutionPerformance.forEachAggregateStatistics((s) => { - s.name = `Aggregate ${s.name}`; - statistics.push(s); - }); - forEachMeasure((name, duration) => { - if (isSolutionMarkOrMeasure(name)) statistics.push({ name: `${getNameFromSolutionBuilderMarkOrMeasure(name)} time`, value: duration, type: 0 /* time */ }); - }); - disable(); - enable(); - solutionPerformance.clear(); - reportAllStatistics(sys, statistics); - function reportSolutionBuilderCountStatistic(name) { - const value = getCount(name); - if (value) { - statistics.push({ name: getNameFromSolutionBuilderMarkOrMeasure(name), value, type: 1 /* count */ }); - } - } - function getNameFromSolutionBuilderMarkOrMeasure(name) { - return name.replace("SolutionBuilder::", ""); - } -} -function canReportDiagnostics(system, compilerOptions) { - return system === sys && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); -} -function canTrace(system, compilerOptions) { - return system === sys && compilerOptions.generateTrace; -} -function enableStatisticsAndTracing(system, compilerOptions, isBuildMode) { - if (canReportDiagnostics(system, compilerOptions)) { - enable(system); - } - if (canTrace(system, compilerOptions)) { - startTracing(isBuildMode ? "build" : "project", compilerOptions.generateTrace, compilerOptions.configFilePath); - } -} -function isSolutionMarkOrMeasure(name) { - return startsWith(name, "SolutionBuilder::"); -} -function reportStatistics(sys2, program, solutionPerformance) { - var _a; - const compilerOptions = program.getCompilerOptions(); - if (canTrace(sys2, compilerOptions)) { - (_a = tracing) == null ? void 0 : _a.stopTracing(); - } - let statistics; - if (canReportDiagnostics(sys2, compilerOptions)) { - statistics = []; - const memoryUsed = sys2.getMemoryUsage ? sys2.getMemoryUsage() : -1; - reportCountStatistic("Files", program.getSourceFiles().length); - const lineCounts = countLines(program); - if (compilerOptions.extendedDiagnostics) { - for (const [key, value] of lineCounts.entries()) { - reportCountStatistic("Lines of " + key, value); - } - } else { - reportCountStatistic("Lines", reduceLeftIterator(lineCounts.values(), (sum, count) => sum + count, 0)); - } - reportCountStatistic("Identifiers", program.getIdentifierCount()); - reportCountStatistic("Symbols", program.getSymbolCount()); - reportCountStatistic("Types", program.getTypeCount()); - reportCountStatistic("Instantiations", program.getInstantiationCount()); - if (memoryUsed >= 0) { - reportStatisticalValue( - { name: "Memory used", value: memoryUsed, type: 2 /* memory */ }, - /*aggregate*/ - true - ); - } - const isPerformanceEnabled = isEnabled(); - const programTime = isPerformanceEnabled ? getDuration("Program") : 0; - const bindTime = isPerformanceEnabled ? getDuration("Bind") : 0; - const checkTime = isPerformanceEnabled ? getDuration("Check") : 0; - const emitTime = isPerformanceEnabled ? getDuration("Emit") : 0; - if (compilerOptions.extendedDiagnostics) { - const caches = program.getRelationCacheSizes(); - reportCountStatistic("Assignability cache size", caches.assignable); - reportCountStatistic("Identity cache size", caches.identity); - reportCountStatistic("Subtype cache size", caches.subtype); - reportCountStatistic("Strict subtype cache size", caches.strictSubtype); - if (isPerformanceEnabled) { - forEachMeasure((name, duration) => { - if (!isSolutionMarkOrMeasure(name)) reportTimeStatistic( - `${name} time`, - duration, - /*aggregate*/ - true - ); - }); - } - } else if (isPerformanceEnabled) { - reportTimeStatistic( - "I/O read", - getDuration("I/O Read"), - /*aggregate*/ - true - ); - reportTimeStatistic( - "I/O write", - getDuration("I/O Write"), - /*aggregate*/ - true - ); - reportTimeStatistic( - "Parse time", - programTime, - /*aggregate*/ - true - ); - reportTimeStatistic( - "Bind time", - bindTime, - /*aggregate*/ - true - ); - reportTimeStatistic( - "Check time", - checkTime, - /*aggregate*/ - true - ); - reportTimeStatistic( - "Emit time", - emitTime, - /*aggregate*/ - true - ); - } - if (isPerformanceEnabled) { - reportTimeStatistic( - "Total time", - programTime + bindTime + checkTime + emitTime, - /*aggregate*/ - false - ); - } - reportAllStatistics(sys2, statistics); - if (!isPerformanceEnabled) { - sys2.write(Diagnostics.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + "\n"); - } else { - if (solutionPerformance) { - forEachMeasure((name) => { - if (!isSolutionMarkOrMeasure(name)) clearMeasures(name); - }); - forEachMark((name) => { - if (!isSolutionMarkOrMeasure(name)) clearMarks(name); - }); - } else { - disable(); - } - } - } - function reportStatisticalValue(s, aggregate) { - statistics.push(s); - if (aggregate) solutionPerformance == null ? void 0 : solutionPerformance.addAggregateStatistic(s); - } - function reportCountStatistic(name, count) { - reportStatisticalValue( - { name, value: count, type: 1 /* count */ }, - /*aggregate*/ - true - ); - } - function reportTimeStatistic(name, time, aggregate) { - reportStatisticalValue({ name, value: time, type: 0 /* time */ }, aggregate); - } -} -function reportAllStatistics(sys2, statistics) { - let nameSize = 0; - let valueSize = 0; - for (const s of statistics) { - if (s.name.length > nameSize) { - nameSize = s.name.length; - } - const value = statisticValue(s); - if (value.length > valueSize) { - valueSize = value.length; - } - } - for (const s of statistics) { - sys2.write(`${s.name}:`.padEnd(nameSize + 2) + statisticValue(s).toString().padStart(valueSize) + sys2.newLine); - } -} -function statisticValue(s) { - switch (s.type) { - case 1 /* count */: - return "" + s.value; - case 0 /* time */: - return (s.value / 1e3).toFixed(2) + "s"; - case 2 /* memory */: - return Math.round(s.value / 1e3) + "K"; - default: - Debug.assertNever(s.type); - } -} -function writeConfigFile(sys2, reportDiagnostic, options) { - const currentDirectory = sys2.getCurrentDirectory(); - const file = normalizePath(combinePaths(currentDirectory, "tsconfig.json")); - if (sys2.fileExists(file)) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file)); - } else { - sys2.writeFile(file, generateTSConfig(options, sys2.newLine)); - const output = [sys2.newLine, ...getHeader(sys2, "Created a new tsconfig.json")]; - output.push(`You can learn more at https://aka.ms/tsconfig` + sys2.newLine); - for (const line of output) { - sys2.write(line); - } - } - return; -} - -// src/compiler/expressionToTypeNode.ts -function syntacticResult(type, reportFallback = true) { - return { type, reportFallback }; -} -var notImplemented2 = syntacticResult( - /*type*/ - void 0, - /*reportFallback*/ - false -); -var alreadyReported = syntacticResult( - /*type*/ - void 0, - /*reportFallback*/ - false -); -var failed = syntacticResult( - /*type*/ - void 0, - /*reportFallback*/ - true -); -function createSyntacticTypeNodeBuilder(options, resolver) { - const strictNullChecks = getStrictOptionValue(options, "strictNullChecks"); - return { - serializeTypeOfDeclaration, - serializeReturnTypeForSignature, - serializeTypeOfExpression, - serializeTypeOfAccessor, - tryReuseExistingTypeNode(context, existing) { - if (!resolver.canReuseTypeNode(context, existing)) { - return void 0; - } - return tryReuseExistingTypeNode(context, existing); - } - }; - function reuseNode(context, node, range = node) { - return node === void 0 ? void 0 : resolver.markNodeReuse(context, node.flags & 16 /* Synthesized */ ? node : factory.cloneNode(node), range ?? node); - } - function tryReuseExistingTypeNode(context, existing) { - const { finalizeBoundary, startRecoveryScope, hadError, markError } = resolver.createRecoveryBoundary(context); - const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode); - if (!finalizeBoundary()) { - return void 0; - } - context.approximateLength += existing.end - existing.pos; - return transformed; - function visitExistingNodeTreeSymbols(node) { - if (hadError()) return node; - const recover = startRecoveryScope(); - const onExitNewScope = isNewScopeNode(node) ? resolver.enterNewScope(context, node) : void 0; - const result = visitExistingNodeTreeSymbolsWorker(node); - onExitNewScope == null ? void 0 : onExitNewScope(); - if (hadError()) { - if (isTypeNode(node) && !isTypePredicateNode(node)) { - recover(); - return resolver.serializeExistingTypeNode(context, node); - } - return node; - } - return result ? resolver.markNodeReuse(context, result, node) : void 0; - } - function tryVisitSimpleTypeNode(node) { - const innerNode = skipTypeParentheses(node); - switch (innerNode.kind) { - case 184 /* TypeReference */: - return tryVisitTypeReference(innerNode); - case 187 /* TypeQuery */: - return tryVisitTypeQuery(innerNode); - case 200 /* IndexedAccessType */: - return tryVisitIndexedAccess(innerNode); - case 199 /* TypeOperator */: - const typeOperatorNode = innerNode; - if (typeOperatorNode.operator === 143 /* KeyOfKeyword */) { - return tryVisitKeyOf(typeOperatorNode); - } - } - return visitNode(node, visitExistingNodeTreeSymbols, isTypeNode); - } - function tryVisitIndexedAccess(node) { - const resultObjectType = tryVisitSimpleTypeNode(node.objectType); - if (resultObjectType === void 0) { - return void 0; - } - return factory.updateIndexedAccessTypeNode(node, resultObjectType, visitNode(node.indexType, visitExistingNodeTreeSymbols, isTypeNode)); - } - function tryVisitKeyOf(node) { - Debug.assertEqual(node.operator, 143 /* KeyOfKeyword */); - const type = tryVisitSimpleTypeNode(node.type); - if (type === void 0) { - return void 0; - } - return factory.updateTypeOperatorNode(node, type); - } - function tryVisitTypeQuery(node) { - const { introducesError, node: exprName } = resolver.trackExistingEntityName(context, node.exprName); - if (!introducesError) { - return factory.updateTypeQueryNode( - node, - exprName, - visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode) - ); - } - const serializedName = resolver.serializeTypeName( - context, - node.exprName, - /*isTypeOf*/ - true - ); - if (serializedName) { - return resolver.markNodeReuse(context, serializedName, node.exprName); - } - } - function tryVisitTypeReference(node) { - if (resolver.canReuseTypeNode(context, node)) { - const { introducesError, node: newName } = resolver.trackExistingEntityName(context, node.typeName); - const typeArguments = visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode); - if (!introducesError) { - const updated = factory.updateTypeReferenceNode( - node, - newName, - typeArguments - ); - return resolver.markNodeReuse(context, updated, node); - } else { - const serializedName = resolver.serializeTypeName( - context, - node.typeName, - /*isTypeOf*/ - false, - typeArguments - ); - if (serializedName) { - return resolver.markNodeReuse(context, serializedName, node.typeName); - } - } - } - } - function visitExistingNodeTreeSymbolsWorker(node) { - var _a; - if (isJSDocTypeExpression(node)) { - return visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode); - } - if (isJSDocAllType(node) || node.kind === 320 /* JSDocNamepathType */) { - return factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - if (isJSDocUnknownType(node)) { - return factory.createKeywordTypeNode(159 /* UnknownKeyword */); - } - if (isJSDocNullableType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createLiteralTypeNode(factory.createNull())]); - } - if (isJSDocOptionalType(node)) { - return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]); - } - if (isJSDocNonNullableType(node)) { - return visitNode(node.type, visitExistingNodeTreeSymbols); - } - if (isJSDocVariadicType(node)) { - return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode)); - } - if (isJSDocTypeLiteral(node)) { - return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (t) => { - const name = visitNode(isIdentifier(t.name) ? t.name : t.name.right, visitExistingNodeTreeSymbols, isIdentifier); - const overrideTypeNode = resolver.getJsDocPropertyOverride(context, node, t); - return factory.createPropertySignature( - /*modifiers*/ - void 0, - name, - t.isBracketed || t.typeExpression && isJSDocOptionalType(t.typeExpression.type) ? factory.createToken(58 /* QuestionToken */) : void 0, - overrideTypeNode || t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(133 /* AnyKeyword */) - ); - })); - } - if (isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "") { - return setOriginalNode(factory.createKeywordTypeNode(133 /* AnyKeyword */), node); - } - if ((isExpressionWithTypeArguments(node) || isTypeReferenceNode(node)) && isJSDocIndexSignature(node)) { - return factory.createTypeLiteralNode([factory.createIndexSignature( - /*modifiers*/ - void 0, - [factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "x", - /*questionToken*/ - void 0, - visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols, isTypeNode) - )], - visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols, isTypeNode) - )]); - } - if (isJSDocFunctionType(node)) { - if (isJSDocConstructSignature(node)) { - let newTypeNode; - return factory.createConstructorTypeNode( - /*modifiers*/ - void 0, - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), - mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, void 0) : factory.createParameterDeclaration( - /*modifiers*/ - void 0, - getEffectiveDotDotDotForParameter(p), - resolver.markNodeReuse(context, factory.createIdentifier(getNameForJSDocFunctionParameter(p, i)), p), - factory.cloneNode(p.questionToken), - visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), - /*initializer*/ - void 0 - )), - visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(133 /* AnyKeyword */) - ); - } else { - return factory.createFunctionTypeNode( - visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), - map(node.parameters, (p, i) => factory.createParameterDeclaration( - /*modifiers*/ - void 0, - getEffectiveDotDotDotForParameter(p), - resolver.markNodeReuse(context, factory.createIdentifier(getNameForJSDocFunctionParameter(p, i)), p), - factory.cloneNode(p.questionToken), - visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode), - /*initializer*/ - void 0 - )), - visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode(133 /* AnyKeyword */) - ); - } - } - if (isThisTypeNode(node)) { - if (resolver.canReuseTypeNode(context, node)) { - return node; - } - markError(); - return node; - } - if (isTypeParameterDeclaration(node)) { - const { node: newName } = resolver.trackExistingEntityName(context, node.name); - return factory.updateTypeParameterDeclaration( - node, - visitNodes2(node.modifiers, visitExistingNodeTreeSymbols, isModifier), - // resolver.markNodeReuse(context, typeParameterToName(getDeclaredTypeOfSymbol(getSymbolOfDeclaration(node)), context), node), - newName, - visitNode(node.constraint, visitExistingNodeTreeSymbols, isTypeNode), - visitNode(node.default, visitExistingNodeTreeSymbols, isTypeNode) - ); - } - if (isIndexedAccessTypeNode(node)) { - const result = tryVisitIndexedAccess(node); - if (!result) { - markError(); - return node; - } - return result; - } - if (isTypeReferenceNode(node)) { - const result = tryVisitTypeReference(node); - if (result) { - return result; - } - markError(); - return node; - } - if (isLiteralImportTypeNode(node)) { - if (((_a = node.attributes) == null ? void 0 : _a.token) === 132 /* AssertKeyword */) { - markError(); - return node; - } - if (!resolver.canReuseTypeNode(context, node)) { - return resolver.serializeExistingTypeNode(context, node); - } - const specifier = rewriteModuleSpecifier2(node, node.argument.literal); - const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier; - return factory.updateImportTypeNode( - node, - literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal), - visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes), - visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName), - visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode), - node.isTypeOf - ); - } - if (isNamedDeclaration(node) && node.name.kind === 168 /* ComputedPropertyName */ && !resolver.hasLateBindableName(node)) { - if (!hasDynamicName(node)) { - return visitEachChild2(node, visitExistingNodeTreeSymbols); - } - if (resolver.shouldRemoveDeclaration(context, node)) { - return void 0; - } - } - if (isFunctionLike(node) && !node.type || isPropertyDeclaration(node) && !node.type && !node.initializer || isPropertySignature(node) && !node.type && !node.initializer || isParameter(node) && !node.type && !node.initializer) { - let visited = visitEachChild2(node, visitExistingNodeTreeSymbols); - if (visited === node) { - visited = resolver.markNodeReuse(context, factory.cloneNode(node), node); - } - visited.type = factory.createKeywordTypeNode(133 /* AnyKeyword */); - if (isParameter(node)) { - visited.modifiers = void 0; - } - return visited; - } - if (isTypeQueryNode(node)) { - const result = tryVisitTypeQuery(node); - if (!result) { - markError(); - return node; - } - return result; - } - if (isComputedPropertyName(node) && isEntityNameExpression(node.expression)) { - const { node: result, introducesError } = resolver.trackExistingEntityName(context, node.expression); - if (!introducesError) { - return factory.updateComputedPropertyName(node, result); - } else { - const computedPropertyNameType = resolver.serializeTypeOfExpression(context, node.expression); - let literal; - if (isLiteralTypeNode(computedPropertyNameType)) { - literal = computedPropertyNameType.literal; - } else { - const evaluated = resolver.evaluateEntityNameExpression(node.expression); - const literalNode = typeof evaluated.value === "string" ? factory.createStringLiteral( - evaluated.value, - /*isSingleQuote*/ - void 0 - ) : typeof evaluated.value === "number" ? factory.createNumericLiteral( - evaluated.value, - /*numericLiteralFlags*/ - 0 - ) : void 0; - if (!literalNode) { - if (isImportTypeNode(computedPropertyNameType)) { - resolver.trackComputedName(context, node.expression); - } - return node; - } - literal = literalNode; - } - if (literal.kind === 11 /* StringLiteral */ && isIdentifierText(literal.text, getEmitScriptTarget(options))) { - return factory.createIdentifier(literal.text); - } - if (literal.kind === 9 /* NumericLiteral */ && !literal.text.startsWith("-")) { - return literal; - } - return factory.updateComputedPropertyName(node, literal); - } - } - if (isTypePredicateNode(node)) { - let parameterName; - if (isIdentifier(node.parameterName)) { - const { node: result, introducesError } = resolver.trackExistingEntityName(context, node.parameterName); - if (introducesError) markError(); - parameterName = result; - } else { - parameterName = factory.cloneNode(node.parameterName); - } - return factory.updateTypePredicateNode(node, factory.cloneNode(node.assertsModifier), parameterName, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode)); - } - if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) { - const visited = visitEachChild2(node, visitExistingNodeTreeSymbols); - const clone2 = resolver.markNodeReuse(context, visited === node ? factory.cloneNode(node) : visited, node); - const flags = getEmitFlags(clone2); - setEmitFlags(clone2, flags | (context.flags & 1024 /* MultilineObjectLiterals */ && isTypeLiteralNode(node) ? 0 : 1 /* SingleLine */)); - return clone2; - } - if (isStringLiteral(node) && !!(context.flags & 268435456 /* UseSingleQuotesForStringLiteralType */) && !node.singleQuote) { - const clone2 = factory.cloneNode(node); - clone2.singleQuote = true; - return clone2; - } - if (isConditionalTypeNode(node)) { - const checkType = visitNode(node.checkType, visitExistingNodeTreeSymbols, isTypeNode); - const disposeScope = resolver.enterNewScope(context, node); - const extendType = visitNode(node.extendsType, visitExistingNodeTreeSymbols, isTypeNode); - const trueType = visitNode(node.trueType, visitExistingNodeTreeSymbols, isTypeNode); - disposeScope(); - const falseType = visitNode(node.falseType, visitExistingNodeTreeSymbols, isTypeNode); - return factory.updateConditionalTypeNode( - node, - checkType, - extendType, - trueType, - falseType - ); - } - if (isTypeOperatorNode(node)) { - if (node.operator === 158 /* UniqueKeyword */ && node.type.kind === 155 /* SymbolKeyword */) { - if (!resolver.canReuseTypeNode(context, node)) { - markError(); - return node; - } - } else if (node.operator === 143 /* KeyOfKeyword */) { - const result = tryVisitKeyOf(node); - if (!result) { - markError(); - return node; - } - return result; - } - } - return visitEachChild2(node, visitExistingNodeTreeSymbols); - function visitEachChild2(node2, visitor) { - const nonlocalNode = !context.enclosingFile || context.enclosingFile !== getSourceFileOfNode(node2); - return visitEachChild( - node2, - visitor, - /*context*/ - void 0, - nonlocalNode ? visitNodesWithoutCopyingPositions : void 0 - ); - } - function visitNodesWithoutCopyingPositions(nodes, visitor, test, start, count) { - let result = visitNodes2(nodes, visitor, test, start, count); - if (result) { - if (result.pos !== -1 || result.end !== -1) { - if (result === nodes) { - result = factory.createNodeArray(nodes.slice(), nodes.hasTrailingComma); - } - setTextRangePosEnd(result, -1, -1); - } - } - return result; - } - function getEffectiveDotDotDotForParameter(p) { - return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0); - } - function getNameForJSDocFunctionParameter(p, index) { - return p.name && isIdentifier(p.name) && p.name.escapedText === "this" ? "this" : getEffectiveDotDotDotForParameter(p) ? `args` : `arg${index}`; - } - function rewriteModuleSpecifier2(parent2, lit) { - const newName = resolver.getModuleSpecifierOverride(context, parent2, lit); - return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit; - } - } - } - function serializeExistingTypeNode(typeNode, context, addUndefined) { - if (!typeNode) return void 0; - let result; - if ((!addUndefined || canAddUndefined(typeNode)) && resolver.canReuseTypeNode(context, typeNode)) { - result = tryReuseExistingTypeNode(context, typeNode); - if (result !== void 0) { - result = addUndefinedIfNeeded( - result, - addUndefined, - /*owner*/ - void 0, - context - ); - } - } - return result; - } - function serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol, requiresAddingUndefined, useFallback = requiresAddingUndefined !== void 0) { - if (!declaredType) return void 0; - if (!resolver.canReuseTypeNodeAnnotation(context, node, declaredType, symbol, requiresAddingUndefined)) { - if (!requiresAddingUndefined || !resolver.canReuseTypeNodeAnnotation( - context, - node, - declaredType, - symbol, - /*requiresAddingUndefined*/ - false - )) { - return void 0; - } - } - let result; - if (!requiresAddingUndefined || canAddUndefined(declaredType)) { - result = serializeExistingTypeNode(declaredType, context, requiresAddingUndefined); - } - if (result !== void 0 || !useFallback) { - return result; - } - context.tracker.reportInferenceFallback(node); - return resolver.serializeExistingTypeNode(context, declaredType, requiresAddingUndefined) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - function serializeExistingTypeNodeWithFallback(typeNode, context, addUndefined, targetNode) { - if (!typeNode) return void 0; - const result = serializeExistingTypeNode(typeNode, context, addUndefined); - if (result !== void 0) { - return result; - } - context.tracker.reportInferenceFallback(targetNode ?? typeNode); - return resolver.serializeExistingTypeNode(context, typeNode, addUndefined) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - function serializeTypeOfAccessor(accessor, symbol, context) { - return typeFromAccessor(accessor, symbol, context) ?? inferAccessorType(accessor, resolver.getAllAccessorDeclarations(accessor), context, symbol); - } - function serializeTypeOfExpression(expr, context, addUndefined, preserveLiterals) { - const result = typeFromExpression( - expr, - context, - /*isConstContext*/ - false, - addUndefined, - preserveLiterals - ); - return result.type !== void 0 ? result.type : inferExpressionType(expr, context, result.reportFallback); - } - function serializeTypeOfDeclaration(node, symbol, context) { - switch (node.kind) { - case 170 /* Parameter */: - case 342 /* JSDocParameterTag */: - return typeFromParameter(node, symbol, context); - case 261 /* VariableDeclaration */: - return typeFromVariable(node, symbol, context); - case 172 /* PropertySignature */: - case 349 /* JSDocPropertyTag */: - case 173 /* PropertyDeclaration */: - return typeFromProperty(node, symbol, context); - case 209 /* BindingElement */: - return inferTypeOfDeclaration(node, symbol, context); - case 278 /* ExportAssignment */: - return serializeTypeOfExpression( - node.expression, - context, - /*addUndefined*/ - void 0, - /*preserveLiterals*/ - true - ); - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - case 227 /* BinaryExpression */: - return typeFromExpandoProperty(node, symbol, context); - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - return typeFromPropertyAssignment(node, symbol, context); - default: - Debug.assertNever(node, `Node needs to be an inferrable node, found ${Debug.formatSyntaxKind(node.kind)}`); - } - } - function typeFromPropertyAssignment(node, symbol, context) { - const typeAnnotation = getEffectiveTypeAnnotationNode(node); - let result; - if (typeAnnotation && resolver.canReuseTypeNodeAnnotation(context, node, typeAnnotation, symbol)) { - result = serializeExistingTypeNode(typeAnnotation, context); - } - if (!result && node.kind === 304 /* PropertyAssignment */) { - const initializer = node.initializer; - const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 235 /* AsExpression */ || initializer.kind === 217 /* TypeAssertionExpression */ ? initializer.type : void 0; - if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) { - result = serializeExistingTypeNode(assertionNode, context); - } - } - return result ?? inferTypeOfDeclaration( - node, - symbol, - context, - /*reportFallback*/ - false - ); - } - function serializeReturnTypeForSignature(node, symbol, context) { - switch (node.kind) { - case 178 /* GetAccessor */: - return serializeTypeOfAccessor(node, symbol, context); - case 175 /* MethodDeclaration */: - case 263 /* FunctionDeclaration */: - case 181 /* ConstructSignature */: - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 177 /* Constructor */: - case 179 /* SetAccessor */: - case 182 /* IndexSignature */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 318 /* JSDocFunctionType */: - case 324 /* JSDocSignature */: - return createReturnFromSignature(node, symbol, context); - default: - Debug.assertNever(node, `Node needs to be an inferrable node, found ${Debug.formatSyntaxKind(node.kind)}`); - } - } - function getTypeAnnotationFromAccessor(accessor) { - if (accessor) { - return accessor.kind === 178 /* GetAccessor */ ? isInJSFile(accessor) && getJSDocType(accessor) || getEffectiveReturnTypeNode(accessor) : getEffectiveSetAccessorTypeAnnotationNode(accessor); - } - } - function getTypeAnnotationFromAllAccessorDeclarations(node, accessors) { - let accessorType = getTypeAnnotationFromAccessor(node); - if (!accessorType && node !== accessors.firstAccessor) { - accessorType = getTypeAnnotationFromAccessor(accessors.firstAccessor); - } - if (!accessorType && accessors.secondAccessor && node !== accessors.secondAccessor) { - accessorType = getTypeAnnotationFromAccessor(accessors.secondAccessor); - } - return accessorType; - } - function typeFromAccessor(node, symbol, context) { - const accessorDeclarations = resolver.getAllAccessorDeclarations(node); - const accessorType = getTypeAnnotationFromAllAccessorDeclarations(node, accessorDeclarations); - if (accessorType && !isTypePredicateNode(accessorType)) { - return withNewScope(context, node, () => serializeTypeAnnotationOfDeclaration(accessorType, context, node, symbol) ?? inferTypeOfDeclaration(node, symbol, context)); - } - if (accessorDeclarations.getAccessor) { - return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature(accessorDeclarations.getAccessor, symbol, context)); - } - return void 0; - } - function typeFromVariable(node, symbol, context) { - var _a; - const declaredType = getEffectiveTypeAnnotationNode(node); - let resultType = failed; - if (declaredType) { - resultType = syntacticResult(serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol)); - } else if (node.initializer && (((_a = symbol.declarations) == null ? void 0 : _a.length) === 1 || countWhere(symbol.declarations, isVariableDeclaration) === 1)) { - if (!resolver.isExpandoFunctionDeclaration(node) && !isContextuallyTyped(node)) { - resultType = typeFromExpression( - node.initializer, - context, - /*isConstContext*/ - void 0, - /*requiresAddingUndefined*/ - void 0, - isVarConstLike(node) - ); - } - } - return resultType.type !== void 0 ? resultType.type : inferTypeOfDeclaration(node, symbol, context, resultType.reportFallback); - } - function typeFromParameter(node, symbol, context) { - const parent2 = node.parent; - if (parent2.kind === 179 /* SetAccessor */) { - return serializeTypeOfAccessor( - parent2, - /*symbol*/ - void 0, - context - ); - } - const declaredType = getEffectiveTypeAnnotationNode(node); - const addUndefined = resolver.requiresAddingImplicitUndefined(node, symbol, context.enclosingDeclaration); - let resultType = failed; - if (declaredType) { - resultType = syntacticResult(serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol, addUndefined)); - } else if (isParameter(node) && node.initializer && isIdentifier(node.name) && !isContextuallyTyped(node)) { - resultType = typeFromExpression( - node.initializer, - context, - /*isConstContext*/ - void 0, - addUndefined - ); - } - return resultType.type !== void 0 ? resultType.type : inferTypeOfDeclaration(node, symbol, context, resultType.reportFallback); - } - function typeFromExpandoProperty(node, symbol, context) { - const declaredType = getEffectiveTypeAnnotationNode(node); - let result; - if (declaredType) { - result = serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol); - } - const oldSuppressReportInferenceFallback = context.suppressReportInferenceFallback; - context.suppressReportInferenceFallback = true; - const resultType = result ?? inferTypeOfDeclaration( - node, - symbol, - context, - /*reportFallback*/ - false - ); - context.suppressReportInferenceFallback = oldSuppressReportInferenceFallback; - return resultType; - } - function typeFromProperty(node, symbol, context) { - const declaredType = getEffectiveTypeAnnotationNode(node); - const requiresAddingUndefined = resolver.requiresAddingImplicitUndefined(node, symbol, context.enclosingDeclaration); - let resultType = failed; - if (declaredType) { - resultType = syntacticResult(serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol, requiresAddingUndefined)); - } else { - const initializer = isPropertyDeclaration(node) ? node.initializer : void 0; - if (initializer && !isContextuallyTyped(node)) { - const isReadonly = isDeclarationReadonly(node); - resultType = typeFromExpression( - initializer, - context, - /*isConstContext*/ - void 0, - requiresAddingUndefined, - isReadonly - ); - } - } - return resultType.type !== void 0 ? resultType.type : inferTypeOfDeclaration(node, symbol, context, resultType.reportFallback); - } - function inferTypeOfDeclaration(node, symbol, context, reportFallback = true) { - if (reportFallback) { - context.tracker.reportInferenceFallback(node); - } - if (context.noInferenceFallback === true) { - return factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - return resolver.serializeTypeOfDeclaration(context, node, symbol); - } - function inferExpressionType(node, context, reportFallback = true, requiresAddingUndefined) { - Debug.assert(!requiresAddingUndefined); - if (reportFallback) { - context.tracker.reportInferenceFallback(node); - } - if (context.noInferenceFallback === true) { - return factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - return resolver.serializeTypeOfExpression(context, node) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - function inferReturnTypeOfSignatureSignature(node, context, symbol, reportFallback) { - if (reportFallback) { - context.tracker.reportInferenceFallback(node); - } - if (context.noInferenceFallback === true) { - return factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - return resolver.serializeReturnTypeForSignature(context, node, symbol) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - function inferAccessorType(node, allAccessors, context, symbol, reportFallback = true) { - if (node.kind === 178 /* GetAccessor */) { - return createReturnFromSignature(node, symbol, context, reportFallback); - } else { - if (reportFallback) { - context.tracker.reportInferenceFallback(node); - } - const result = allAccessors.getAccessor && createReturnFromSignature(allAccessors.getAccessor, symbol, context, reportFallback); - return result ?? resolver.serializeTypeOfDeclaration(context, node, symbol) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - } - function withNewScope(context, node, fn) { - const cleanup = resolver.enterNewScope(context, node); - const result = fn(); - cleanup(); - return result; - } - function typeFromTypeAssertion(expression, type, context, requiresAddingUndefined) { - if (isConstTypeReference(type)) { - return typeFromExpression( - expression, - context, - /*isConstContext*/ - true, - requiresAddingUndefined - ); - } - return syntacticResult(serializeExistingTypeNodeWithFallback(type, context, requiresAddingUndefined)); - } - function typeFromExpression(node, context, isConstContext = false, requiresAddingUndefined = false, preserveLiterals = false) { - switch (node.kind) { - case 218 /* ParenthesizedExpression */: - if (isJSDocTypeAssertion(node)) { - return typeFromTypeAssertion(node.expression, getJSDocTypeAssertionType(node), context, requiresAddingUndefined); - } - return typeFromExpression(node.expression, context, isConstContext, requiresAddingUndefined); - case 80 /* Identifier */: - if (resolver.isUndefinedIdentifierExpression(node)) { - return syntacticResult(createUndefinedTypeNode()); - } - break; - case 106 /* NullKeyword */: - if (strictNullChecks) { - return syntacticResult(addUndefinedIfNeeded(factory.createLiteralTypeNode(factory.createNull()), requiresAddingUndefined, node, context)); - } else { - return syntacticResult(factory.createKeywordTypeNode(133 /* AnyKeyword */)); - } - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - Debug.type(node); - return withNewScope(context, node, () => typeFromFunctionLikeExpression(node, context)); - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - const asExpression = node; - return typeFromTypeAssertion(asExpression.expression, asExpression.type, context, requiresAddingUndefined); - case 225 /* PrefixUnaryExpression */: - const unaryExpression = node; - if (isPrimitiveLiteralValue(unaryExpression)) { - return typeFromPrimitiveLiteral( - unaryExpression.operator === 40 /* PlusToken */ ? unaryExpression.operand : unaryExpression, - unaryExpression.operand.kind === 10 /* BigIntLiteral */ ? 163 /* BigIntKeyword */ : 150 /* NumberKeyword */, - context, - isConstContext || preserveLiterals, - requiresAddingUndefined - ); - } - break; - case 210 /* ArrayLiteralExpression */: - return typeFromArrayLiteral(node, context, isConstContext, requiresAddingUndefined); - case 211 /* ObjectLiteralExpression */: - return typeFromObjectLiteral(node, context, isConstContext, requiresAddingUndefined); - case 232 /* ClassExpression */: - return syntacticResult(inferExpressionType( - node, - context, - /*reportFallback*/ - true, - requiresAddingUndefined - )); - case 229 /* TemplateExpression */: - if (!isConstContext && !preserveLiterals) { - return syntacticResult(factory.createKeywordTypeNode(154 /* StringKeyword */)); - } - break; - default: - let typeKind; - let primitiveNode = node; - switch (node.kind) { - case 9 /* NumericLiteral */: - typeKind = 150 /* NumberKeyword */; - break; - case 15 /* NoSubstitutionTemplateLiteral */: - primitiveNode = factory.createStringLiteral(node.text); - typeKind = 154 /* StringKeyword */; - break; - case 11 /* StringLiteral */: - typeKind = 154 /* StringKeyword */; - break; - case 10 /* BigIntLiteral */: - typeKind = 163 /* BigIntKeyword */; - break; - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - typeKind = 136 /* BooleanKeyword */; - break; - } - if (typeKind) { - return typeFromPrimitiveLiteral(primitiveNode, typeKind, context, isConstContext || preserveLiterals, requiresAddingUndefined); - } - } - return failed; - } - function typeFromFunctionLikeExpression(fnNode, context) { - const returnType = createReturnFromSignature( - fnNode, - /*symbol*/ - void 0, - context - ); - const typeParameters = reuseTypeParameters(fnNode.typeParameters, context); - const parameters = fnNode.parameters.map((p) => ensureParameter(p, context)); - return syntacticResult( - factory.createFunctionTypeNode( - typeParameters, - parameters, - returnType - ) - ); - } - function canGetTypeFromArrayLiteral(arrayLiteral, context, isConstContext) { - if (!isConstContext) { - context.tracker.reportInferenceFallback(arrayLiteral); - return false; - } - for (const element of arrayLiteral.elements) { - if (element.kind === 231 /* SpreadElement */) { - context.tracker.reportInferenceFallback(element); - return false; - } - } - return true; - } - function typeFromArrayLiteral(arrayLiteral, context, isConstContext, requiresAddingUndefined) { - if (!canGetTypeFromArrayLiteral(arrayLiteral, context, isConstContext)) { - if (requiresAddingUndefined || isDeclaration(walkUpParenthesizedExpressions(arrayLiteral).parent)) { - return alreadyReported; - } - return syntacticResult(inferExpressionType( - arrayLiteral, - context, - /*reportFallback*/ - false, - requiresAddingUndefined - )); - } - const oldNoInferenceFallback = context.noInferenceFallback; - context.noInferenceFallback = true; - const elementTypesInfo = []; - for (const element of arrayLiteral.elements) { - Debug.assert(element.kind !== 231 /* SpreadElement */); - if (element.kind === 233 /* OmittedExpression */) { - elementTypesInfo.push( - createUndefinedTypeNode() - ); - } else { - const expressionType = typeFromExpression(element, context, isConstContext); - const elementType = expressionType.type !== void 0 ? expressionType.type : inferExpressionType(element, context, expressionType.reportFallback); - elementTypesInfo.push(elementType); - } - } - const tupleType = factory.createTupleTypeNode(elementTypesInfo); - tupleType.emitNode = { flags: 1, autoGenerate: void 0, internalFlags: 0 }; - context.noInferenceFallback = oldNoInferenceFallback; - return notImplemented2; - } - function canGetTypeFromObjectLiteral(objectLiteral, context) { - let result = true; - for (const prop of objectLiteral.properties) { - if (prop.flags & 262144 /* ThisNodeHasError */) { - result = false; - break; - } - if (prop.kind === 305 /* ShorthandPropertyAssignment */ || prop.kind === 306 /* SpreadAssignment */) { - context.tracker.reportInferenceFallback(prop); - result = false; - } else if (prop.name.flags & 262144 /* ThisNodeHasError */) { - result = false; - break; - } else if (prop.name.kind === 81 /* PrivateIdentifier */) { - result = false; - } else if (prop.name.kind === 168 /* ComputedPropertyName */) { - const expression = prop.name.expression; - if (!isPrimitiveLiteralValue( - expression, - /*includeBigInt*/ - false - ) && !resolver.isDefinitelyReferenceToGlobalSymbolObject(expression)) { - context.tracker.reportInferenceFallback(prop.name); - result = false; - } - } - } - return result; - } - function typeFromObjectLiteral(objectLiteral, context, isConstContext, requiresAddingUndefined) { - if (!canGetTypeFromObjectLiteral(objectLiteral, context)) { - if (requiresAddingUndefined || isDeclaration(walkUpParenthesizedExpressions(objectLiteral).parent)) { - return alreadyReported; - } - return syntacticResult(inferExpressionType( - objectLiteral, - context, - /*reportFallback*/ - false, - requiresAddingUndefined - )); - } - const oldNoInferenceFallback = context.noInferenceFallback; - context.noInferenceFallback = true; - const properties = []; - const oldFlags = context.flags; - context.flags |= 4194304 /* InObjectTypeLiteral */; - for (const prop of objectLiteral.properties) { - Debug.assert(!isShorthandPropertyAssignment(prop) && !isSpreadAssignment(prop)); - const name = prop.name; - let newProp; - switch (prop.kind) { - case 175 /* MethodDeclaration */: - newProp = withNewScope(context, prop, () => typeFromObjectLiteralMethod(prop, name, context, isConstContext)); - break; - case 304 /* PropertyAssignment */: - newProp = typeFromObjectLiteralPropertyAssignment(prop, name, context, isConstContext); - break; - case 179 /* SetAccessor */: - case 178 /* GetAccessor */: - newProp = typeFromObjectLiteralAccessor(prop, name, context); - break; - } - if (newProp) { - setCommentRange(newProp, prop); - properties.push(newProp); - } - } - context.flags = oldFlags; - const typeNode = factory.createTypeLiteralNode(properties); - if (!(context.flags & 1024 /* MultilineObjectLiterals */)) { - setEmitFlags(typeNode, 1 /* SingleLine */); - } - context.noInferenceFallback = oldNoInferenceFallback; - return notImplemented2; - } - function typeFromObjectLiteralPropertyAssignment(prop, name, context, isConstContext) { - const modifiers = isConstContext ? [factory.createModifier(148 /* ReadonlyKeyword */)] : []; - const expressionResult = typeFromExpression(prop.initializer, context, isConstContext); - const typeNode = expressionResult.type !== void 0 ? expressionResult.type : inferTypeOfDeclaration( - prop, - /*symbol*/ - void 0, - context, - expressionResult.reportFallback - ); - return factory.createPropertySignature( - modifiers, - reuseNode(context, name), - /*questionToken*/ - void 0, - typeNode - ); - } - function ensureParameter(p, context) { - return factory.updateParameterDeclaration( - p, - /*modifiers*/ - void 0, - reuseNode(context, p.dotDotDotToken), - resolver.serializeNameOfParameter(context, p), - resolver.isOptionalParameter(p) ? factory.createToken(58 /* QuestionToken */) : void 0, - typeFromParameter( - p, - /*symbol*/ - void 0, - context - ), - // Ignore private param props, since this type is going straight back into a param - /*initializer*/ - void 0 - ); - } - function reuseTypeParameters(typeParameters, context) { - return typeParameters == null ? void 0 : typeParameters.map((tp) => { - var _a; - const { node: tpName } = resolver.trackExistingEntityName(context, tp.name); - return factory.updateTypeParameterDeclaration( - tp, - (_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)), - tpName, - serializeExistingTypeNodeWithFallback(tp.constraint, context), - serializeExistingTypeNodeWithFallback(tp.default, context) - ); - }); - } - function typeFromObjectLiteralMethod(method, name, context, isConstContext) { - const returnType = createReturnFromSignature( - method, - /*symbol*/ - void 0, - context - ); - const typeParameters = reuseTypeParameters(method.typeParameters, context); - const parameters = method.parameters.map((p) => ensureParameter(p, context)); - if (isConstContext) { - return factory.createPropertySignature( - [factory.createModifier(148 /* ReadonlyKeyword */)], - reuseNode(context, name), - reuseNode(context, method.questionToken), - factory.createFunctionTypeNode( - typeParameters, - parameters, - returnType - ) - ); - } else { - if (isIdentifier(name) && name.escapedText === "new") { - name = factory.createStringLiteral("new"); - } - return factory.createMethodSignature( - [], - reuseNode(context, name), - reuseNode(context, method.questionToken), - typeParameters, - parameters, - returnType - ); - } - } - function typeFromObjectLiteralAccessor(accessor, name, context) { - const allAccessors = resolver.getAllAccessorDeclarations(accessor); - const getAccessorType = allAccessors.getAccessor && getTypeAnnotationFromAccessor(allAccessors.getAccessor); - const setAccessorType = allAccessors.setAccessor && getTypeAnnotationFromAccessor(allAccessors.setAccessor); - if (getAccessorType !== void 0 && setAccessorType !== void 0) { - return withNewScope(context, accessor, () => { - const parameters = accessor.parameters.map((p) => ensureParameter(p, context)); - if (isGetAccessor(accessor)) { - return factory.updateGetAccessorDeclaration( - accessor, - [], - reuseNode(context, name), - parameters, - serializeExistingTypeNodeWithFallback(getAccessorType, context), - /*body*/ - void 0 - ); - } else { - return factory.updateSetAccessorDeclaration( - accessor, - [], - reuseNode(context, name), - parameters, - /*body*/ - void 0 - ); - } - }); - } else if (allAccessors.firstAccessor === accessor) { - const foundType = getAccessorType ? withNewScope(context, allAccessors.getAccessor, () => serializeExistingTypeNodeWithFallback(getAccessorType, context)) : setAccessorType ? withNewScope(context, allAccessors.setAccessor, () => serializeExistingTypeNodeWithFallback(setAccessorType, context)) : void 0; - const propertyType = foundType ?? inferAccessorType( - accessor, - allAccessors, - context, - /*symbol*/ - void 0 - ); - const propertySignature = factory.createPropertySignature( - allAccessors.setAccessor === void 0 ? [factory.createModifier(148 /* ReadonlyKeyword */)] : [], - reuseNode(context, name), - /*questionToken*/ - void 0, - propertyType - ); - return propertySignature; - } - } - function createUndefinedTypeNode() { - if (strictNullChecks) { - return factory.createKeywordTypeNode(157 /* UndefinedKeyword */); - } else { - return factory.createKeywordTypeNode(133 /* AnyKeyword */); - } - } - function typeFromPrimitiveLiteral(node, baseType, context, preserveLiterals, requiresAddingUndefined) { - let result; - if (preserveLiterals) { - if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 40 /* PlusToken */) { - result = factory.createLiteralTypeNode(reuseNode(context, node.operand)); - } - result = factory.createLiteralTypeNode(reuseNode(context, node)); - } else { - result = factory.createKeywordTypeNode(baseType); - } - return syntacticResult(addUndefinedIfNeeded(result, requiresAddingUndefined, node, context)); - } - function addUndefinedIfNeeded(node, addUndefined, owner, context) { - const parentDeclaration = owner && walkUpParenthesizedExpressions(owner).parent; - const optionalDeclaration = parentDeclaration && isDeclaration(parentDeclaration) && isOptionalDeclaration(parentDeclaration); - if (!strictNullChecks || !(addUndefined || optionalDeclaration)) return node; - if (!canAddUndefined(node)) { - context.tracker.reportInferenceFallback(node); - } - if (isUnionTypeNode(node)) { - return factory.createUnionTypeNode([...node.types, factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]); - } - return factory.createUnionTypeNode([node, factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]); - } - function canAddUndefined(node) { - if (!strictNullChecks) return true; - if (isKeyword(node.kind) || node.kind === 202 /* LiteralType */ || node.kind === 185 /* FunctionType */ || node.kind === 186 /* ConstructorType */ || node.kind === 189 /* ArrayType */ || node.kind === 190 /* TupleType */ || node.kind === 188 /* TypeLiteral */ || node.kind === 204 /* TemplateLiteralType */ || node.kind === 198 /* ThisType */) { - return true; - } - if (node.kind === 197 /* ParenthesizedType */) { - return canAddUndefined(node.type); - } - if (node.kind === 193 /* UnionType */ || node.kind === 194 /* IntersectionType */) { - return node.types.every(canAddUndefined); - } - return false; - } - function createReturnFromSignature(fn, symbol, context, reportFallback = true) { - let returnType = failed; - const returnTypeNode = isJSDocConstructSignature(fn) ? getEffectiveTypeAnnotationNode(fn.parameters[0]) : getEffectiveReturnTypeNode(fn); - if (returnTypeNode) { - returnType = syntacticResult(serializeTypeAnnotationOfDeclaration(returnTypeNode, context, fn, symbol)); - } else if (isValueSignatureDeclaration(fn)) { - returnType = typeFromSingleReturnExpression(fn, context); - } - return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, symbol, reportFallback && returnType.reportFallback && !returnTypeNode); - } - function typeFromSingleReturnExpression(declaration, context) { - let candidateExpr; - if (declaration && !nodeIsMissing(declaration.body)) { - const flags = getFunctionFlags(declaration); - if (flags & 3 /* AsyncGenerator */) return failed; - const body = declaration.body; - if (body && isBlock(body)) { - forEachReturnStatement(body, (s) => { - if (s.parent !== body) { - candidateExpr = void 0; - return true; - } - if (!candidateExpr) { - candidateExpr = s.expression; - } else { - candidateExpr = void 0; - return true; - } - }); - } else { - candidateExpr = body; - } - } - if (candidateExpr) { - if (isContextuallyTyped(candidateExpr)) { - const type = isJSDocTypeAssertion(candidateExpr) ? getJSDocTypeAssertionType(candidateExpr) : isAsExpression(candidateExpr) || isTypeAssertionExpression(candidateExpr) ? candidateExpr.type : void 0; - if (type && !isConstTypeReference(type)) { - return syntacticResult(serializeExistingTypeNode(type, context)); - } - } else { - return typeFromExpression(candidateExpr, context); - } - } - return failed; - } - function isContextuallyTyped(node) { - return findAncestor(node.parent, (n) => { - return isCallExpression(n) || !isFunctionLikeDeclaration(n) && !!getEffectiveTypeAnnotationNode(n) || isJsxElement(n) || isJsxExpression(n); - }); - } -} - -// src/jsTyping/_namespaces/ts.JsTyping.ts -var ts_JsTyping_exports = {}; -__export(ts_JsTyping_exports, { - NameValidationResult: () => NameValidationResult, - discoverTypings: () => discoverTypings, - isTypingUpToDate: () => isTypingUpToDate, - loadSafeList: () => loadSafeList, - loadTypesMap: () => loadTypesMap, - nonRelativeModuleNameForTypingCache: () => nonRelativeModuleNameForTypingCache, - renderPackageNameValidationFailure: () => renderPackageNameValidationFailure, - validatePackageName: () => validatePackageName -}); - -// src/jsTyping/shared.ts -var ActionSet = "action::set"; -var ActionInvalidate = "action::invalidate"; -var ActionPackageInstalled = "action::packageInstalled"; -var EventTypesRegistry = "event::typesRegistry"; -var EventBeginInstallTypes = "event::beginInstallTypes"; -var EventEndInstallTypes = "event::endInstallTypes"; -var EventInitializationFailed = "event::initializationFailed"; -var ActionWatchTypingLocations = "action::watchTypingLocations"; -var Arguments; -((Arguments2) => { - Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation"; - Arguments2.LogFile = "--logFile"; - Arguments2.EnableTelemetry = "--enableTelemetry"; - Arguments2.TypingSafeListLocation = "--typingSafeListLocation"; - Arguments2.TypesMapLocation = "--typesMapLocation"; - Arguments2.NpmLocation = "--npmLocation"; - Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation"; -})(Arguments || (Arguments = {})); -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")}`; -} -var indentStr = "\n "; -function indent2(str) { - return indentStr + str.replace(/\n/g, indentStr); -} -function stringifyIndented(json) { - return indent2(JSON.stringify(json, void 0, 2)); -} - -// src/jsTyping/jsTyping.ts -function isTypingUpToDate(cachedTyping, availableTypingVersions) { - const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")); - return availableVersion.compareTo(cachedTyping.version) <= 0; -} -function nonRelativeModuleNameForTypingCache(moduleName) { - return nodeCoreModules.has(moduleName) ? "node" : moduleName; -} -function loadSafeList(host, safeListPath) { - const result = readConfigFile(safeListPath, (path) => host.readFile(path)); - return new Map(Object.entries(result.config)); -} -function loadTypesMap(host, typesMapPath) { - var _a; - const result = readConfigFile(typesMapPath, (path) => host.readFile(path)); - if ((_a = result.config) == null ? void 0 : _a.simpleMap) { - return new Map(Object.entries(result.config.simpleMap)); - } - return void 0; -} -function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry, compilerOptions) { - if (!typeAcquisition || !typeAcquisition.enable) { - return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; - } - const inferredTypings = /* @__PURE__ */ new Map(); - fileNames = mapDefined(fileNames, (fileName) => { - const path = normalizePath(fileName); - if (hasJSFileExtension(path)) { - return path; - } - }); - const filesToWatch = []; - if (typeAcquisition.include) addInferredTypings(typeAcquisition.include, "Explicitly included types"); - const exclude = typeAcquisition.exclude || []; - if (!compilerOptions.types) { - const possibleSearchDirs = new Set(fileNames.map(getDirectoryPath)); - possibleSearchDirs.add(projectRootPath); - possibleSearchDirs.forEach((searchDir) => { - getTypingNames(searchDir, "bower.json", "bower_components", filesToWatch); - getTypingNames(searchDir, "package.json", "node_modules", filesToWatch); - }); - } - if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { - getTypingNamesFromSourceFileNames(fileNames); - } - if (unresolvedImports) { - const module2 = deduplicate( - unresolvedImports.map(nonRelativeModuleNameForTypingCache), - equateStringsCaseSensitive, - compareStringsCaseSensitive - ); - addInferredTypings(module2, "Inferred typings from unresolved imports"); - } - 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) { - cachedTypingPaths.push(inferred); - } else { - newTypingNames.push(typing); - } - }); - const result = { cachedTypingPaths, newTypingNames, filesToWatch }; - if (log) log(`Finished typings discovery:${stringifyIndented(result)}`); - return result; - function addInferredTyping(typingName) { - if (!inferredTypings.has(typingName)) { - inferredTypings.set(typingName, false); - } - } - function addInferredTypings(typingNames, message) { - if (log) log(`${message}: ${JSON.stringify(typingNames)}`); - forEach(typingNames, addInferredTyping); - } - function getTypingNames(projectRootPath2, manifestName, modulesDirName, filesToWatch2) { - const manifestPath = combinePaths(projectRootPath2, manifestName); - let manifest; - let manifestTypingNames; - if (host.fileExists(manifestPath)) { - filesToWatch2.push(manifestPath); - manifest = readConfigFile(manifestPath, (path) => host.readFile(path)).config; - manifestTypingNames = flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], getOwnKeys); - addInferredTypings(manifestTypingNames, `Typing names in '${manifestPath}' dependencies`); - } - const packagesFolderPath = combinePaths(projectRootPath2, modulesDirName); - filesToWatch2.push(packagesFolderPath); - if (!host.directoryExists(packagesFolderPath)) { - return; - } - const packageNames = []; - const dependencyManifestNames = manifestTypingNames ? manifestTypingNames.map((typingName) => combinePaths(packagesFolderPath, typingName, manifestName)) : host.readDirectory( - packagesFolderPath, - [".json" /* Json */], - /*excludes*/ - void 0, - /*includes*/ - void 0, - /*depth*/ - 3 - ).filter((manifestPath2) => { - if (getBaseFileName(manifestPath2) !== manifestName) { - return false; - } - const pathComponents2 = getPathComponents(normalizePath(manifestPath2)); - const isScoped = pathComponents2[pathComponents2.length - 3][0] === "@"; - return isScoped && toFileNameLowerCase(pathComponents2[pathComponents2.length - 4]) === modulesDirName || // `node_modules/@foo/bar` - !isScoped && toFileNameLowerCase(pathComponents2[pathComponents2.length - 3]) === modulesDirName; - }); - if (log) log(`Searching for typing names in ${packagesFolderPath}; all files: ${JSON.stringify(dependencyManifestNames)}`); - for (const manifestPath2 of dependencyManifestNames) { - const normalizedFileName = normalizePath(manifestPath2); - const result2 = readConfigFile(normalizedFileName, (path) => host.readFile(path)); - const manifest2 = result2.config; - if (!manifest2.name) { - continue; - } - const ownTypes = manifest2.types || manifest2.typings; - if (ownTypes) { - const absolutePath = getNormalizedAbsolutePath(ownTypes, getDirectoryPath(normalizedFileName)); - if (host.fileExists(absolutePath)) { - if (log) log(` Package '${manifest2.name}' provides its own types.`); - inferredTypings.set(manifest2.name, absolutePath); - } else { - if (log) log(` Package '${manifest2.name}' provides its own types but they are missing.`); - } - } else { - packageNames.push(manifest2.name); - } - } - addInferredTypings(packageNames, " Found package names"); - } - function getTypingNamesFromSourceFileNames(fileNames2) { - const fromFileNames = mapDefined(fileNames2, (j) => { - if (!hasJSFileExtension(j)) return void 0; - const inferredTypingName = removeFileExtension(toFileNameLowerCase(getBaseFileName(j))); - const cleanedTypingName = removeMinAndVersionNumbers(inferredTypingName); - return safeList.get(cleanedTypingName); - }); - if (fromFileNames.length) { - addInferredTypings(fromFileNames, "Inferred typings from file names"); - } - const hasJsxFile = some(fileNames2, (f) => fileExtensionIs(f, ".jsx" /* Jsx */)); - if (hasJsxFile) { - if (log) log(`Inferred 'react' typings due to presence of '.jsx' extension`); - addInferredTyping("react"); - } - } -} -var NameValidationResult = /* @__PURE__ */ ((NameValidationResult2) => { - NameValidationResult2[NameValidationResult2["Ok"] = 0] = "Ok"; - NameValidationResult2[NameValidationResult2["EmptyName"] = 1] = "EmptyName"; - NameValidationResult2[NameValidationResult2["NameTooLong"] = 2] = "NameTooLong"; - NameValidationResult2[NameValidationResult2["NameStartsWithDot"] = 3] = "NameStartsWithDot"; - NameValidationResult2[NameValidationResult2["NameStartsWithUnderscore"] = 4] = "NameStartsWithUnderscore"; - NameValidationResult2[NameValidationResult2["NameContainsNonURISafeCharacters"] = 5] = "NameContainsNonURISafeCharacters"; - return NameValidationResult2; -})(NameValidationResult || {}); -var maxPackageNameLength = 214; -function validatePackageName(packageName) { - return validatePackageNameWorker( - packageName, - /*supportScopedPackage*/ - true - ); -} -function validatePackageNameWorker(packageName, supportScopedPackage) { - if (!packageName) { - return 1 /* EmptyName */; - } - if (packageName.length > maxPackageNameLength) { - return 2 /* NameTooLong */; - } - if (packageName.charCodeAt(0) === 46 /* dot */) { - return 3 /* NameStartsWithDot */; - } - if (packageName.charCodeAt(0) === 95 /* _ */) { - return 4 /* NameStartsWithUnderscore */; - } - if (supportScopedPackage) { - const matches = /^@([^/]+)\/([^/]+)$/.exec(packageName); - if (matches) { - const scopeResult = validatePackageNameWorker( - matches[1], - /*supportScopedPackage*/ - false - ); - if (scopeResult !== 0 /* Ok */) { - return { name: matches[1], isScopeName: true, result: scopeResult }; - } - const packageResult = validatePackageNameWorker( - matches[2], - /*supportScopedPackage*/ - false - ); - if (packageResult !== 0 /* Ok */) { - return { name: matches[2], isScopeName: false, result: packageResult }; - } - return 0 /* Ok */; - } - } - if (encodeURIComponent(packageName) !== packageName) { - return 5 /* NameContainsNonURISafeCharacters */; - } - return 0 /* Ok */; -} -function renderPackageNameValidationFailure(result, typing) { - return typeof result === "object" ? renderPackageNameValidationFailureWorker(typing, result.result, result.name, result.isScopeName) : renderPackageNameValidationFailureWorker( - typing, - result, - typing, - /*isScopeName*/ - false - ); -} -function renderPackageNameValidationFailureWorker(typing, result, name, isScopeName) { - const kind = isScopeName ? "Scope" : "Package"; - switch (result) { - case 1 /* EmptyName */: - return `'${typing}':: ${kind} name '${name}' cannot be empty`; - case 2 /* NameTooLong */: - return `'${typing}':: ${kind} name '${name}' should be less than ${maxPackageNameLength} characters`; - case 3 /* NameStartsWithDot */: - return `'${typing}':: ${kind} name '${name}' cannot start with '.'`; - case 4 /* NameStartsWithUnderscore */: - return `'${typing}':: ${kind} name '${name}' cannot start with '_'`; - case 5 /* NameContainsNonURISafeCharacters */: - return `'${typing}':: ${kind} name '${name}' contains non URI safe characters`; - case 0 /* Ok */: - return Debug.fail(); - // Shouldn't have called this. - default: - Debug.assertNever(result); - } -} - -// src/services/types.ts -var ScriptSnapshot; -((ScriptSnapshot2) => { - class StringScriptSnapshot { - constructor(text) { - this.text = text; - } - getText(start, end) { - return start === 0 && end === this.text.length ? this.text : this.text.substring(start, end); - } - getLength() { - return this.text.length; - } - getChangeRange() { - return void 0; - } - } - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot2.fromString = fromString; -})(ScriptSnapshot || (ScriptSnapshot = {})); -var PackageJsonDependencyGroup = /* @__PURE__ */ ((PackageJsonDependencyGroup2) => { - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["Dependencies"] = 1] = "Dependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["DevDependencies"] = 2] = "DevDependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["PeerDependencies"] = 4] = "PeerDependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["OptionalDependencies"] = 8] = "OptionalDependencies"; - PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["All"] = 15] = "All"; - return PackageJsonDependencyGroup2; -})(PackageJsonDependencyGroup || {}); -var PackageJsonAutoImportPreference = /* @__PURE__ */ ((PackageJsonAutoImportPreference2) => { - PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Off"] = 0] = "Off"; - PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["On"] = 1] = "On"; - PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Auto"] = 2] = "Auto"; - return PackageJsonAutoImportPreference2; -})(PackageJsonAutoImportPreference || {}); -var LanguageServiceMode = /* @__PURE__ */ ((LanguageServiceMode2) => { - LanguageServiceMode2[LanguageServiceMode2["Semantic"] = 0] = "Semantic"; - LanguageServiceMode2[LanguageServiceMode2["PartialSemantic"] = 1] = "PartialSemantic"; - LanguageServiceMode2[LanguageServiceMode2["Syntactic"] = 2] = "Syntactic"; - return LanguageServiceMode2; -})(LanguageServiceMode || {}); -var emptyOptions = {}; -var SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat2) => { - SemanticClassificationFormat2["Original"] = "original"; - SemanticClassificationFormat2["TwentyTwenty"] = "2020"; - return SemanticClassificationFormat2; -})(SemanticClassificationFormat || {}); -var OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode2) => { - OrganizeImportsMode2["All"] = "All"; - OrganizeImportsMode2["SortAndCombine"] = "SortAndCombine"; - OrganizeImportsMode2["RemoveUnused"] = "RemoveUnused"; - return OrganizeImportsMode2; -})(OrganizeImportsMode || {}); -var CompletionTriggerKind = /* @__PURE__ */ ((CompletionTriggerKind2) => { - CompletionTriggerKind2[CompletionTriggerKind2["Invoked"] = 1] = "Invoked"; - CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 2] = "TriggerCharacter"; - CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; - return CompletionTriggerKind2; -})(CompletionTriggerKind || {}); -var InlayHintKind2 = /* @__PURE__ */ ((InlayHintKind3) => { - InlayHintKind3["Type"] = "Type"; - InlayHintKind3["Parameter"] = "Parameter"; - InlayHintKind3["Enum"] = "Enum"; - return InlayHintKind3; -})(InlayHintKind2 || {}); -var HighlightSpanKind = /* @__PURE__ */ ((HighlightSpanKind2) => { - HighlightSpanKind2["none"] = "none"; - HighlightSpanKind2["definition"] = "definition"; - HighlightSpanKind2["reference"] = "reference"; - HighlightSpanKind2["writtenReference"] = "writtenReference"; - return HighlightSpanKind2; -})(HighlightSpanKind || {}); -var IndentStyle = /* @__PURE__ */ ((IndentStyle3) => { - IndentStyle3[IndentStyle3["None"] = 0] = "None"; - IndentStyle3[IndentStyle3["Block"] = 1] = "Block"; - IndentStyle3[IndentStyle3["Smart"] = 2] = "Smart"; - return IndentStyle3; -})(IndentStyle || {}); -var SemicolonPreference = /* @__PURE__ */ ((SemicolonPreference2) => { - SemicolonPreference2["Ignore"] = "ignore"; - SemicolonPreference2["Insert"] = "insert"; - SemicolonPreference2["Remove"] = "remove"; - return SemicolonPreference2; -})(SemicolonPreference || {}); -function getDefaultFormatCodeSettings(newLineCharacter) { - return { - indentSize: 4, - tabSize: 4, - newLineCharacter: newLineCharacter || "\n", - convertTabsToSpaces: true, - indentStyle: 2 /* Smart */, - insertSpaceAfterConstructor: false, - insertSpaceAfterCommaDelimiter: true, - insertSpaceAfterSemicolonInForStatements: true, - insertSpaceBeforeAndAfterBinaryOperators: true, - insertSpaceAfterKeywordsInControlFlowStatements: true, - insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, - insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, - insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, - insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, - insertSpaceBeforeFunctionParenthesis: false, - placeOpenBraceOnNewLineForFunctions: false, - placeOpenBraceOnNewLineForControlBlocks: false, - semicolons: "ignore" /* Ignore */, - trimTrailingWhitespace: true, - indentSwitchCase: true - }; -} -var testFormatSettings = getDefaultFormatCodeSettings("\n"); -var SymbolDisplayPartKind = /* @__PURE__ */ ((SymbolDisplayPartKind2) => { - SymbolDisplayPartKind2[SymbolDisplayPartKind2["aliasName"] = 0] = "aliasName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["className"] = 1] = "className"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumName"] = 2] = "enumName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["fieldName"] = 3] = "fieldName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["interfaceName"] = 4] = "interfaceName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["keyword"] = 5] = "keyword"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["lineBreak"] = 6] = "lineBreak"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["numericLiteral"] = 7] = "numericLiteral"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["stringLiteral"] = 8] = "stringLiteral"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["localName"] = 9] = "localName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["methodName"] = 10] = "methodName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["moduleName"] = 11] = "moduleName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["operator"] = 12] = "operator"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["parameterName"] = 13] = "parameterName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["propertyName"] = 14] = "propertyName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["punctuation"] = 15] = "punctuation"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["space"] = 16] = "space"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["text"] = 17] = "text"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["typeParameterName"] = 18] = "typeParameterName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumMemberName"] = 19] = "enumMemberName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["functionName"] = 20] = "functionName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["link"] = 22] = "link"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkName"] = 23] = "linkName"; - SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkText"] = 24] = "linkText"; - return SymbolDisplayPartKind2; -})(SymbolDisplayPartKind || {}); -var CompletionInfoFlags = /* @__PURE__ */ ((CompletionInfoFlags2) => { - CompletionInfoFlags2[CompletionInfoFlags2["None"] = 0] = "None"; - CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeAutoImports"] = 1] = "MayIncludeAutoImports"; - CompletionInfoFlags2[CompletionInfoFlags2["IsImportStatementCompletion"] = 2] = "IsImportStatementCompletion"; - CompletionInfoFlags2[CompletionInfoFlags2["IsContinuation"] = 4] = "IsContinuation"; - CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiers"] = 8] = "ResolvedModuleSpecifiers"; - CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiersBeyondLimit"] = 16] = "ResolvedModuleSpecifiersBeyondLimit"; - CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeMethodSnippets"] = 32] = "MayIncludeMethodSnippets"; - return CompletionInfoFlags2; -})(CompletionInfoFlags || {}); -var OutliningSpanKind = /* @__PURE__ */ ((OutliningSpanKind2) => { - OutliningSpanKind2["Comment"] = "comment"; - OutliningSpanKind2["Region"] = "region"; - OutliningSpanKind2["Code"] = "code"; - OutliningSpanKind2["Imports"] = "imports"; - return OutliningSpanKind2; -})(OutliningSpanKind || {}); -var OutputFileType = /* @__PURE__ */ ((OutputFileType2) => { - OutputFileType2[OutputFileType2["JavaScript"] = 0] = "JavaScript"; - OutputFileType2[OutputFileType2["SourceMap"] = 1] = "SourceMap"; - OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration"; - return OutputFileType2; -})(OutputFileType || {}); -var 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 || {}); -var TokenClass = /* @__PURE__ */ ((TokenClass2) => { - TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation"; - TokenClass2[TokenClass2["Keyword"] = 1] = "Keyword"; - TokenClass2[TokenClass2["Operator"] = 2] = "Operator"; - TokenClass2[TokenClass2["Comment"] = 3] = "Comment"; - TokenClass2[TokenClass2["Whitespace"] = 4] = "Whitespace"; - TokenClass2[TokenClass2["Identifier"] = 5] = "Identifier"; - TokenClass2[TokenClass2["NumberLiteral"] = 6] = "NumberLiteral"; - TokenClass2[TokenClass2["BigIntLiteral"] = 7] = "BigIntLiteral"; - TokenClass2[TokenClass2["StringLiteral"] = 8] = "StringLiteral"; - TokenClass2[TokenClass2["RegExpLiteral"] = 9] = "RegExpLiteral"; - return TokenClass2; -})(TokenClass || {}); -var ScriptElementKind = /* @__PURE__ */ ((ScriptElementKind2) => { - ScriptElementKind2["unknown"] = ""; - ScriptElementKind2["warning"] = "warning"; - ScriptElementKind2["keyword"] = "keyword"; - ScriptElementKind2["scriptElement"] = "script"; - ScriptElementKind2["moduleElement"] = "module"; - ScriptElementKind2["classElement"] = "class"; - ScriptElementKind2["localClassElement"] = "local class"; - ScriptElementKind2["interfaceElement"] = "interface"; - ScriptElementKind2["typeElement"] = "type"; - ScriptElementKind2["enumElement"] = "enum"; - 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"; - ScriptElementKind2["memberGetAccessorElement"] = "getter"; - ScriptElementKind2["memberSetAccessorElement"] = "setter"; - ScriptElementKind2["memberVariableElement"] = "property"; - ScriptElementKind2["memberAccessorVariableElement"] = "accessor"; - ScriptElementKind2["constructorImplementationElement"] = "constructor"; - ScriptElementKind2["callSignatureElement"] = "call"; - ScriptElementKind2["indexSignatureElement"] = "index"; - ScriptElementKind2["constructSignatureElement"] = "construct"; - ScriptElementKind2["parameterElement"] = "parameter"; - ScriptElementKind2["typeParameterElement"] = "type parameter"; - ScriptElementKind2["primitiveType"] = "primitive type"; - ScriptElementKind2["label"] = "label"; - ScriptElementKind2["alias"] = "alias"; - ScriptElementKind2["constElement"] = "const"; - ScriptElementKind2["letElement"] = "let"; - ScriptElementKind2["directory"] = "directory"; - ScriptElementKind2["externalModuleName"] = "external module name"; - ScriptElementKind2["jsxAttribute"] = "JSX attribute"; - ScriptElementKind2["string"] = "string"; - ScriptElementKind2["link"] = "link"; - ScriptElementKind2["linkName"] = "link name"; - ScriptElementKind2["linkText"] = "link text"; - return ScriptElementKind2; -})(ScriptElementKind || {}); -var ScriptElementKindModifier = /* @__PURE__ */ ((ScriptElementKindModifier2) => { - ScriptElementKindModifier2["none"] = ""; - ScriptElementKindModifier2["publicMemberModifier"] = "public"; - ScriptElementKindModifier2["privateMemberModifier"] = "private"; - ScriptElementKindModifier2["protectedMemberModifier"] = "protected"; - ScriptElementKindModifier2["exportedModifier"] = "export"; - ScriptElementKindModifier2["ambientModifier"] = "declare"; - ScriptElementKindModifier2["staticModifier"] = "static"; - ScriptElementKindModifier2["abstractModifier"] = "abstract"; - ScriptElementKindModifier2["optionalModifier"] = "optional"; - ScriptElementKindModifier2["deprecatedModifier"] = "deprecated"; - ScriptElementKindModifier2["dtsModifier"] = ".d.ts"; - ScriptElementKindModifier2["tsModifier"] = ".ts"; - ScriptElementKindModifier2["tsxModifier"] = ".tsx"; - ScriptElementKindModifier2["jsModifier"] = ".js"; - ScriptElementKindModifier2["jsxModifier"] = ".jsx"; - ScriptElementKindModifier2["jsonModifier"] = ".json"; - ScriptElementKindModifier2["dmtsModifier"] = ".d.mts"; - ScriptElementKindModifier2["mtsModifier"] = ".mts"; - ScriptElementKindModifier2["mjsModifier"] = ".mjs"; - ScriptElementKindModifier2["dctsModifier"] = ".d.cts"; - ScriptElementKindModifier2["ctsModifier"] = ".cts"; - ScriptElementKindModifier2["cjsModifier"] = ".cjs"; - return ScriptElementKindModifier2; -})(ScriptElementKindModifier || {}); -var ClassificationTypeNames = /* @__PURE__ */ ((ClassificationTypeNames2) => { - ClassificationTypeNames2["comment"] = "comment"; - ClassificationTypeNames2["identifier"] = "identifier"; - ClassificationTypeNames2["keyword"] = "keyword"; - ClassificationTypeNames2["numericLiteral"] = "number"; - ClassificationTypeNames2["bigintLiteral"] = "bigint"; - ClassificationTypeNames2["operator"] = "operator"; - ClassificationTypeNames2["stringLiteral"] = "string"; - ClassificationTypeNames2["whiteSpace"] = "whitespace"; - ClassificationTypeNames2["text"] = "text"; - ClassificationTypeNames2["punctuation"] = "punctuation"; - ClassificationTypeNames2["className"] = "class name"; - ClassificationTypeNames2["enumName"] = "enum name"; - ClassificationTypeNames2["interfaceName"] = "interface name"; - ClassificationTypeNames2["moduleName"] = "module name"; - ClassificationTypeNames2["typeParameterName"] = "type parameter name"; - ClassificationTypeNames2["typeAliasName"] = "type alias name"; - ClassificationTypeNames2["parameterName"] = "parameter name"; - ClassificationTypeNames2["docCommentTagName"] = "doc comment tag name"; - ClassificationTypeNames2["jsxOpenTagName"] = "jsx open tag name"; - ClassificationTypeNames2["jsxCloseTagName"] = "jsx close tag name"; - ClassificationTypeNames2["jsxSelfClosingTagName"] = "jsx self closing tag name"; - ClassificationTypeNames2["jsxAttribute"] = "jsx attribute"; - ClassificationTypeNames2["jsxText"] = "jsx text"; - ClassificationTypeNames2["jsxAttributeStringLiteralValue"] = "jsx attribute string literal value"; - return ClassificationTypeNames2; -})(ClassificationTypeNames || {}); -var 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 || {}); - -// src/services/utilities.ts -var scanner = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - true -); -var SemanticMeaning = /* @__PURE__ */ ((SemanticMeaning2) => { - SemanticMeaning2[SemanticMeaning2["None"] = 0] = "None"; - SemanticMeaning2[SemanticMeaning2["Value"] = 1] = "Value"; - SemanticMeaning2[SemanticMeaning2["Type"] = 2] = "Type"; - SemanticMeaning2[SemanticMeaning2["Namespace"] = 4] = "Namespace"; - SemanticMeaning2[SemanticMeaning2["All"] = 7] = "All"; - return SemanticMeaning2; -})(SemanticMeaning || {}); -function getMeaningFromDeclaration(node) { - switch (node.kind) { - case 261 /* VariableDeclaration */: - return isInJSFile(node) && getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 170 /* Parameter */: - case 209 /* BindingElement */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 300 /* CatchClause */: - case 292 /* JsxAttribute */: - return 1 /* Value */; - case 169 /* TypeParameter */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 188 /* TypeLiteral */: - return 2 /* Type */; - case 347 /* JSDocTypedefTag */: - return node.name === void 0 ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 307 /* EnumMember */: - case 264 /* ClassDeclaration */: - return 1 /* Value */ | 2 /* Type */; - case 268 /* ModuleDeclaration */: - if (isAmbientModule(node)) { - return 4 /* Namespace */ | 1 /* Value */; - } else if (getModuleInstanceState(node) === 1 /* Instantiated */) { - return 4 /* Namespace */ | 1 /* Value */; - } else { - return 4 /* Namespace */; - } - case 267 /* EnumDeclaration */: - case 276 /* NamedImports */: - case 277 /* ImportSpecifier */: - case 272 /* ImportEqualsDeclaration */: - case 273 /* ImportDeclaration */: - case 278 /* ExportAssignment */: - case 279 /* ExportDeclaration */: - return 7 /* All */; - // An external module can be a Value - case 308 /* SourceFile */: - return 4 /* Namespace */ | 1 /* Value */; - } - return 7 /* All */; -} -function getMeaningFromLocation(node) { - node = getAdjustedReferenceLocation(node); - const parent2 = node.parent; - if (node.kind === 308 /* SourceFile */) { - return 1 /* Value */; - } else if (isExportAssignment(parent2) || isExportSpecifier(parent2) || isExternalModuleReference(parent2) || isImportSpecifier(parent2) || isImportClause(parent2) || isImportEqualsDeclaration(parent2) && node === parent2.name) { - return 7 /* All */; - } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { - return getMeaningFromRightHandSideOfImportEquals(node); - } else if (isDeclarationName(node)) { - return getMeaningFromDeclaration(parent2); - } else if (isEntityName(node) && findAncestor(node, or(isJSDocNameReference, isJSDocLinkLike, isJSDocMemberName))) { - return 7 /* All */; - } else if (isTypeReference(node)) { - return 2 /* Type */; - } else if (isNamespaceReference(node)) { - return 4 /* Namespace */; - } else if (isTypeParameterDeclaration(parent2)) { - Debug.assert(isJSDocTemplateTag(parent2.parent)); - return 2 /* Type */; - } else if (isLiteralTypeNode(parent2)) { - return 2 /* Type */ | 1 /* Value */; - } else { - return 1 /* Value */; - } -} -function getMeaningFromRightHandSideOfImportEquals(node) { - const name = node.kind === 167 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; - return name && name.parent.kind === 272 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; -} -function isInRightSideOfInternalImportEqualsDeclaration(node) { - if (!node.parent) { - return false; - } - while (node.parent.kind === 167 /* QualifiedName */) { - node = node.parent; - } - return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; -} -function isNamespaceReference(node) { - return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); -} -function isQualifiedNameNamespaceReference(node) { - let root = node; - let isLastClause = true; - if (root.parent.kind === 167 /* QualifiedName */) { - while (root.parent && root.parent.kind === 167 /* QualifiedName */) { - root = root.parent; - } - isLastClause = root.right === node; - } - return root.parent.kind === 184 /* TypeReference */ && !isLastClause; -} -function isPropertyAccessNamespaceReference(node) { - let root = node; - let isLastClause = true; - if (root.parent.kind === 212 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 212 /* PropertyAccessExpression */) { - root = root.parent; - } - isLastClause = root.name === node; - } - if (!isLastClause && root.parent.kind === 234 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 299 /* HeritageClause */) { - const decl = root.parent.parent.parent; - return decl.kind === 264 /* ClassDeclaration */ && root.parent.parent.token === 119 /* ImplementsKeyword */ || decl.kind === 265 /* InterfaceDeclaration */ && root.parent.parent.token === 96 /* ExtendsKeyword */; - } - return false; -} -function isTypeReference(node) { - if (isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - switch (node.kind) { - case 110 /* ThisKeyword */: - return !isExpressionNode(node); - case 198 /* ThisType */: - return true; - } - switch (node.parent.kind) { - case 184 /* TypeReference */: - return true; - case 206 /* ImportType */: - return !node.parent.isTypeOf; - case 234 /* ExpressionWithTypeArguments */: - return isPartOfTypeNode(node.parent); - } - return false; -} -function isCallExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { - return isCalleeWorker(node, isCallExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); -} -function isNewExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { - return isCalleeWorker(node, isNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); -} -function isCallOrNewExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { - return isCalleeWorker(node, isCallOrNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); -} -function isTaggedTemplateTag(node, includeElementAccess = false, skipPastOuterExpressions = false) { - return isCalleeWorker(node, isTaggedTemplateExpression, selectTagOfTaggedTemplateExpression, includeElementAccess, skipPastOuterExpressions); -} -function isDecoratorTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { - return isCalleeWorker(node, isDecorator, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); -} -function isJsxOpeningLikeElementTagName(node, includeElementAccess = false, skipPastOuterExpressions = false) { - return isCalleeWorker(node, isJsxOpeningLikeElement, selectTagNameOfJsxOpeningLikeElement, includeElementAccess, skipPastOuterExpressions); -} -function selectExpressionOfCallOrNewExpressionOrDecorator(node) { - return node.expression; -} -function selectTagOfTaggedTemplateExpression(node) { - return node.tag; -} -function selectTagNameOfJsxOpeningLikeElement(node) { - return node.tagName; -} -function isCalleeWorker(node, pred, calleeSelector, includeElementAccess, skipPastOuterExpressions) { - let target = includeElementAccess ? climbPastPropertyOrElementAccess(node) : climbPastPropertyAccess(node); - if (skipPastOuterExpressions) { - target = skipOuterExpressions(target); - } - return !!target && !!target.parent && pred(target.parent) && calleeSelector(target.parent) === target; -} -function climbPastPropertyAccess(node) { - return isRightSideOfPropertyAccess(node) ? node.parent : node; -} -function climbPastPropertyOrElementAccess(node) { - return isRightSideOfPropertyAccess(node) || isArgumentExpressionOfElementAccess(node) ? node.parent : node; -} -function getTargetLabel(referenceNode, labelName) { - while (referenceNode) { - if (referenceNode.kind === 257 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { - return referenceNode.label; - } - referenceNode = referenceNode.parent; - } - return void 0; -} -function hasPropertyAccessExpressionWithName(node, funcName) { - if (!isPropertyAccessExpression(node.expression)) { - return false; - } - return node.expression.name.text === funcName; -} -function isJumpStatementTarget(node) { - var _a; - return isIdentifier(node) && ((_a = tryCast(node.parent, isBreakOrContinueStatement)) == null ? void 0 : _a.label) === node; -} -function isLabelOfLabeledStatement(node) { - var _a; - return isIdentifier(node) && ((_a = tryCast(node.parent, isLabeledStatement)) == null ? void 0 : _a.label) === node; -} -function isLabelName(node) { - return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); -} -function isTagName(node) { - var _a; - return ((_a = tryCast(node.parent, isJSDocTag)) == null ? void 0 : _a.tagName) === node; -} -function isRightSideOfQualifiedName(node) { - var _a; - return ((_a = tryCast(node.parent, isQualifiedName)) == null ? void 0 : _a.right) === node; -} -function isRightSideOfPropertyAccess(node) { - var _a; - return ((_a = tryCast(node.parent, isPropertyAccessExpression)) == null ? void 0 : _a.name) === node; -} -function isArgumentExpressionOfElementAccess(node) { - var _a; - return ((_a = tryCast(node.parent, isElementAccessExpression)) == null ? void 0 : _a.argumentExpression) === node; -} -function isNameOfModuleDeclaration(node) { - var _a; - return ((_a = tryCast(node.parent, isModuleDeclaration)) == null ? void 0 : _a.name) === node; -} -function isNameOfFunctionDeclaration(node) { - var _a; - return isIdentifier(node) && ((_a = tryCast(node.parent, isFunctionLike)) == null ? void 0 : _a.name) === node; -} -function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { - switch (node.parent.kind) { - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 304 /* PropertyAssignment */: - case 307 /* EnumMember */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 268 /* ModuleDeclaration */: - return getNameOfDeclaration(node.parent) === node; - case 213 /* ElementAccessExpression */: - return node.parent.argumentExpression === node; - case 168 /* ComputedPropertyName */: - return true; - case 202 /* LiteralType */: - return node.parent.parent.kind === 200 /* IndexedAccessType */; - default: - return false; - } -} -function isExpressionOfExternalModuleImportEqualsDeclaration(node) { - return isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node; -} -function getContainerNode(node) { - if (isJSDocTypeAlias(node)) { - node = node.parent.parent; - } - while (true) { - node = node.parent; - if (!node) { - return void 0; - } - switch (node.kind) { - case 308 /* SourceFile */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 268 /* ModuleDeclaration */: - return node; - } - } -} -function getNodeKind(node) { - switch (node.kind) { - case 308 /* SourceFile */: - return isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 268 /* ModuleDeclaration */: - return "module" /* moduleElement */; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return "class" /* classElement */; - case 265 /* InterfaceDeclaration */: - return "interface" /* interfaceElement */; - case 266 /* TypeAliasDeclaration */: - case 339 /* JSDocCallbackTag */: - case 347 /* JSDocTypedefTag */: - return "type" /* typeElement */; - case 267 /* EnumDeclaration */: - return "enum" /* enumElement */; - case 261 /* VariableDeclaration */: - return getKindOfVariableDeclaration(node); - case 209 /* BindingElement */: - return getKindOfVariableDeclaration(getRootDeclaration(node)); - case 220 /* ArrowFunction */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - return "function" /* functionElement */; - case 178 /* GetAccessor */: - return "getter" /* memberGetAccessorElement */; - case 179 /* SetAccessor */: - return "setter" /* memberSetAccessorElement */; - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - return "method" /* memberFunctionElement */; - case 304 /* PropertyAssignment */: - const { initializer } = node; - return isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 305 /* ShorthandPropertyAssignment */: - case 306 /* SpreadAssignment */: - return "property" /* memberVariableElement */; - case 182 /* IndexSignature */: - return "index" /* indexSignatureElement */; - case 181 /* ConstructSignature */: - return "construct" /* constructSignatureElement */; - case 180 /* CallSignature */: - return "call" /* callSignatureElement */; - case 177 /* Constructor */: - case 176 /* ClassStaticBlockDeclaration */: - return "constructor" /* constructorImplementationElement */; - case 169 /* TypeParameter */: - return "type parameter" /* typeParameterElement */; - case 307 /* EnumMember */: - return "enum member" /* enumMemberElement */; - case 170 /* Parameter */: - return hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 272 /* ImportEqualsDeclaration */: - case 277 /* ImportSpecifier */: - case 282 /* ExportSpecifier */: - case 275 /* NamespaceImport */: - case 281 /* NamespaceExport */: - return "alias" /* alias */; - case 227 /* BinaryExpression */: - const kind = getAssignmentDeclarationKind(node); - const { right } = node; - switch (kind) { - case 7 /* ObjectDefinePropertyValue */: - case 8 /* ObjectDefinePropertyExports */: - case 9 /* ObjectDefinePrototypeProperty */: - case 0 /* None */: - return "" /* unknown */; - case 1 /* ExportsProperty */: - case 2 /* ModuleExports */: - const rightKind = getNodeKind(right); - return rightKind === "" /* unknown */ ? "const" /* constElement */ : rightKind; - case 3 /* PrototypeProperty */: - return isFunctionExpression(right) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 4 /* ThisProperty */: - return "property" /* memberVariableElement */; - // property - case 5 /* Property */: - return isFunctionExpression(right) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 6 /* Prototype */: - return "local class" /* localClassElement */; - default: { - assertType(kind); - return "" /* unknown */; - } - } - case 80 /* Identifier */: - return isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 278 /* ExportAssignment */: - const scriptKind = getNodeKind(node.expression); - return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; - default: - return "" /* unknown */; - } - function getKindOfVariableDeclaration(v) { - return isVarConst(v) ? "const" /* constElement */ : isLet(v) ? "let" /* letElement */ : "var" /* variableElement */; - } -} -function isThis(node) { - switch (node.kind) { - case 110 /* ThisKeyword */: - return true; - case 80 /* Identifier */: - return identifierIsThisKeyword(node) && node.parent.kind === 170 /* Parameter */; - default: - return false; - } -} -var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= end; -} -function rangeOverlapsWithStartEnd(r1, start, end) { - return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); -} -function nodeOverlapsWithStartEnd(node, sourceFile, start, end) { - return startEndOverlapsWithStartEnd(node.getStart(sourceFile), node.end, start, end); -} -function startEndOverlapsWithStartEnd(start1, end1, start2, end2) { - const start = Math.max(start1, start2); - const end = Math.min(end1, end2); - return start < end; -} -function positionBelongsToNode(candidate, position, sourceFile) { - Debug.assert(candidate.pos <= position); - return position < candidate.end || !isCompletedNode(candidate, sourceFile); -} -function isCompletedNode(n, sourceFile) { - if (n === void 0 || nodeIsMissing(n)) { - return false; - } - switch (n.kind) { - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 211 /* ObjectLiteralExpression */: - case 207 /* ObjectBindingPattern */: - case 188 /* TypeLiteral */: - case 242 /* Block */: - case 269 /* ModuleBlock */: - case 270 /* CaseBlock */: - case 276 /* NamedImports */: - case 280 /* NamedExports */: - return nodeEndsWith(n, 20 /* CloseBraceToken */, sourceFile); - case 300 /* CatchClause */: - return isCompletedNode(n.block, sourceFile); - case 215 /* NewExpression */: - if (!n.arguments) { - return true; - } - // falls through - case 214 /* CallExpression */: - case 218 /* ParenthesizedExpression */: - case 197 /* ParenthesizedType */: - return nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile); - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - return isCompletedNode(n.type, sourceFile); - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 181 /* ConstructSignature */: - case 180 /* CallSignature */: - case 220 /* ArrowFunction */: - if (n.body) { - return isCompletedNode(n.body, sourceFile); - } - if (n.type) { - return isCompletedNode(n.type, sourceFile); - } - return hasChildOfKind(n, 22 /* CloseParenToken */, sourceFile); - case 268 /* ModuleDeclaration */: - return !!n.body && isCompletedNode(n.body, sourceFile); - case 246 /* IfStatement */: - if (n.elseStatement) { - return isCompletedNode(n.elseStatement, sourceFile); - } - return isCompletedNode(n.thenStatement, sourceFile); - case 245 /* ExpressionStatement */: - return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 27 /* SemicolonToken */, sourceFile); - case 210 /* ArrayLiteralExpression */: - case 208 /* ArrayBindingPattern */: - case 213 /* ElementAccessExpression */: - case 168 /* ComputedPropertyName */: - case 190 /* TupleType */: - return nodeEndsWith(n, 24 /* CloseBracketToken */, sourceFile); - case 182 /* IndexSignature */: - if (n.type) { - return isCompletedNode(n.type, sourceFile); - } - return hasChildOfKind(n, 24 /* CloseBracketToken */, sourceFile); - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - return false; - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 248 /* WhileStatement */: - return isCompletedNode(n.statement, sourceFile); - case 247 /* DoStatement */: - return hasChildOfKind(n, 117 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 187 /* TypeQuery */: - return isCompletedNode(n.exprName, sourceFile); - case 222 /* TypeOfExpression */: - case 221 /* DeleteExpression */: - case 223 /* VoidExpression */: - case 230 /* YieldExpression */: - case 231 /* SpreadElement */: - const unaryWordExpression = n; - return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 216 /* TaggedTemplateExpression */: - return isCompletedNode(n.template, sourceFile); - case 229 /* TemplateExpression */: - const lastSpan = lastOrUndefined(n.templateSpans); - return isCompletedNode(lastSpan, sourceFile); - case 240 /* TemplateSpan */: - return nodeIsPresent(n.literal); - case 279 /* ExportDeclaration */: - case 273 /* ImportDeclaration */: - return nodeIsPresent(n.moduleSpecifier); - case 225 /* PrefixUnaryExpression */: - return isCompletedNode(n.operand, sourceFile); - case 227 /* BinaryExpression */: - return isCompletedNode(n.right, sourceFile); - case 228 /* ConditionalExpression */: - return isCompletedNode(n.whenFalse, sourceFile); - default: - return true; - } -} -function nodeEndsWith(n, expectedLastToken, sourceFile) { - const children = n.getChildren(sourceFile); - if (children.length) { - const lastChild = last(children); - if (lastChild.kind === expectedLastToken) { - return true; - } else if (lastChild.kind === 27 /* SemicolonToken */ && children.length !== 1) { - return children[children.length - 2].kind === expectedLastToken; - } - } - return false; -} -function findListItemInfo(node) { - const list = findContainingList(node); - if (!list) { - return void 0; - } - const children = list.getChildren(); - const listItemIndex = indexOfNode(children, node); - return { - listItemIndex, - list - }; -} -function hasChildOfKind(n, kind, sourceFile) { - return !!findChildOfKind(n, kind, sourceFile); -} -function findChildOfKind(n, kind, sourceFile) { - return find(n.getChildren(sourceFile), (c) => c.kind === kind); -} -function findContainingList(node) { - const syntaxList = find(node.parent.getChildren(), (c) => isSyntaxList(c) && rangeContainsRange(c, node)); - Debug.assert(!syntaxList || contains(syntaxList.getChildren(), node)); - return syntaxList; -} -function isDefaultModifier2(node) { - return node.kind === 90 /* DefaultKeyword */; -} -function isClassKeyword(node) { - return node.kind === 86 /* ClassKeyword */; -} -function isFunctionKeyword(node) { - return node.kind === 100 /* FunctionKeyword */; -} -function getAdjustedLocationForClass(node) { - if (isNamedDeclaration(node)) { - return node.name; - } - if (isClassDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier2); - if (defaultModifier) return defaultModifier; - } - if (isClassExpression(node)) { - const classKeyword = find(node.getChildren(), isClassKeyword); - if (classKeyword) return classKeyword; - } -} -function getAdjustedLocationForFunction(node) { - if (isNamedDeclaration(node)) { - return node.name; - } - if (isFunctionDeclaration(node)) { - const defaultModifier = find(node.modifiers, isDefaultModifier2); - if (defaultModifier) return defaultModifier; - } - if (isFunctionExpression(node)) { - const functionKeyword = find(node.getChildren(), isFunctionKeyword); - if (functionKeyword) return functionKeyword; - } -} -function getAncestorTypeNode(node) { - let lastTypeNode; - findAncestor(node, (a) => { - if (isTypeNode(a)) { - lastTypeNode = a; - } - return !isQualifiedName(a.parent) && !isTypeNode(a.parent) && !isTypeElement(a.parent); - }); - return lastTypeNode; -} -function getContextualTypeFromParentOrAncestorTypeNode(node, checker) { - if (node.flags & (16777216 /* JSDoc */ & ~524288 /* JavaScriptFile */)) return void 0; - const contextualType = getContextualTypeFromParent(node, checker); - if (contextualType) return contextualType; - const ancestorTypeNode = getAncestorTypeNode(node); - return ancestorTypeNode && checker.getTypeAtLocation(ancestorTypeNode); -} -function getAdjustedLocationForDeclaration(node, forRename) { - if (!forRename) { - switch (node.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - return getAdjustedLocationForClass(node); - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - return getAdjustedLocationForFunction(node); - case 177 /* Constructor */: - return node; - } - } - if (isNamedDeclaration(node)) { - return node.name; - } -} -function getAdjustedLocationForImportDeclaration(node, forRename) { - if (node.importClause) { - if (node.importClause.name && node.importClause.namedBindings) { - return; - } - if (node.importClause.name) { - return node.importClause.name; - } - if (node.importClause.namedBindings) { - if (isNamedImports(node.importClause.namedBindings)) { - const onlyBinding = singleOrUndefined(node.importClause.namedBindings.elements); - if (!onlyBinding) { - return; - } - return onlyBinding.name; - } else if (isNamespaceImport(node.importClause.namedBindings)) { - return node.importClause.namedBindings.name; - } - } - } - if (!forRename) { - return node.moduleSpecifier; - } -} -function getAdjustedLocationForExportDeclaration(node, forRename) { - if (node.exportClause) { - if (isNamedExports(node.exportClause)) { - const onlyBinding = singleOrUndefined(node.exportClause.elements); - if (!onlyBinding) { - return; - } - return node.exportClause.elements[0].name; - } else if (isNamespaceExport(node.exportClause)) { - return node.exportClause.name; - } - } - if (!forRename) { - return node.moduleSpecifier; - } -} -function getAdjustedLocationForHeritageClause(node) { - if (node.types.length === 1) { - return node.types[0].expression; - } -} -function getAdjustedLocation(node, forRename) { - const { parent: parent2 } = node; - if (isModifier(node) && (forRename || node.kind !== 90 /* DefaultKeyword */) ? canHaveModifiers(parent2) && contains(parent2.modifiers, node) : node.kind === 86 /* ClassKeyword */ ? isClassDeclaration(parent2) || isClassExpression(node) : node.kind === 100 /* FunctionKeyword */ ? isFunctionDeclaration(parent2) || isFunctionExpression(node) : node.kind === 120 /* InterfaceKeyword */ ? isInterfaceDeclaration(parent2) : node.kind === 94 /* EnumKeyword */ ? isEnumDeclaration(parent2) : node.kind === 156 /* TypeKeyword */ ? isTypeAliasDeclaration(parent2) : node.kind === 145 /* NamespaceKeyword */ || node.kind === 144 /* ModuleKeyword */ ? isModuleDeclaration(parent2) : node.kind === 102 /* ImportKeyword */ ? isImportEqualsDeclaration(parent2) : node.kind === 139 /* GetKeyword */ ? isGetAccessorDeclaration(parent2) : node.kind === 153 /* SetKeyword */ && isSetAccessorDeclaration(parent2)) { - const location = getAdjustedLocationForDeclaration(parent2, forRename); - if (location) { - return location; - } - } - if ((node.kind === 115 /* VarKeyword */ || node.kind === 87 /* ConstKeyword */ || node.kind === 121 /* LetKeyword */) && isVariableDeclarationList(parent2) && parent2.declarations.length === 1) { - const decl = parent2.declarations[0]; - if (isIdentifier(decl.name)) { - return decl.name; - } - } - if (node.kind === 156 /* TypeKeyword */) { - if (isImportClause(parent2) && parent2.isTypeOnly) { - const location = getAdjustedLocationForImportDeclaration(parent2.parent, forRename); - if (location) { - return location; - } - } - if (isExportDeclaration(parent2) && parent2.isTypeOnly) { - const location = getAdjustedLocationForExportDeclaration(parent2, forRename); - if (location) { - return location; - } - } - } - if (node.kind === 130 /* AsKeyword */) { - if (isImportSpecifier(parent2) && parent2.propertyName || isExportSpecifier(parent2) && parent2.propertyName || isNamespaceImport(parent2) || isNamespaceExport(parent2)) { - return parent2.name; - } - if (isExportDeclaration(parent2) && parent2.exportClause && isNamespaceExport(parent2.exportClause)) { - return parent2.exportClause.name; - } - } - if (node.kind === 102 /* ImportKeyword */ && isImportDeclaration(parent2)) { - const location = getAdjustedLocationForImportDeclaration(parent2, forRename); - if (location) { - return location; - } - } - if (node.kind === 95 /* ExportKeyword */) { - if (isExportDeclaration(parent2)) { - const location = getAdjustedLocationForExportDeclaration(parent2, forRename); - if (location) { - return location; - } - } - if (isExportAssignment(parent2)) { - return skipOuterExpressions(parent2.expression); - } - } - if (node.kind === 149 /* RequireKeyword */ && isExternalModuleReference(parent2)) { - return parent2.expression; - } - 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) { - const location = getAdjustedLocationForHeritageClause(parent2); - if (location) { - return location; - } - } - if (node.kind === 96 /* ExtendsKeyword */) { - if (isTypeParameterDeclaration(parent2) && parent2.constraint && isTypeReferenceNode(parent2.constraint)) { - return parent2.constraint.typeName; - } - if (isConditionalTypeNode(parent2) && isTypeReferenceNode(parent2.extendsType)) { - return parent2.extendsType.typeName; - } - } - if (node.kind === 140 /* InferKeyword */ && isInferTypeNode(parent2)) { - return parent2.typeParameter.name; - } - if (node.kind === 103 /* InKeyword */ && isTypeParameterDeclaration(parent2) && isMappedTypeNode(parent2.parent)) { - return parent2.name; - } - if (node.kind === 143 /* KeyOfKeyword */ && isTypeOperatorNode(parent2) && parent2.operator === 143 /* KeyOfKeyword */ && isTypeReferenceNode(parent2.type)) { - return parent2.type.typeName; - } - if (node.kind === 148 /* ReadonlyKeyword */ && isTypeOperatorNode(parent2) && parent2.operator === 148 /* ReadonlyKeyword */ && isArrayTypeNode(parent2.type) && isTypeReferenceNode(parent2.type.elementType)) { - return parent2.type.elementType.typeName; - } - if (!forRename) { - if (node.kind === 105 /* NewKeyword */ && isNewExpression(parent2) || node.kind === 116 /* VoidKeyword */ && isVoidExpression(parent2) || node.kind === 114 /* TypeOfKeyword */ && isTypeOfExpression(parent2) || node.kind === 135 /* AwaitKeyword */ && isAwaitExpression(parent2) || node.kind === 127 /* YieldKeyword */ && isYieldExpression(parent2) || node.kind === 91 /* DeleteKeyword */ && isDeleteExpression(parent2)) { - if (parent2.expression) { - return skipOuterExpressions(parent2.expression); - } - } - if ((node.kind === 103 /* InKeyword */ || node.kind === 104 /* InstanceOfKeyword */) && isBinaryExpression(parent2) && parent2.operatorToken === node) { - return skipOuterExpressions(parent2.right); - } - if (node.kind === 130 /* AsKeyword */ && isAsExpression(parent2) && isTypeReferenceNode(parent2.type)) { - return parent2.type.typeName; - } - if (node.kind === 103 /* InKeyword */ && isForInStatement(parent2) || node.kind === 165 /* OfKeyword */ && isForOfStatement(parent2)) { - return skipOuterExpressions(parent2.expression); - } - } - return node; -} -function getAdjustedReferenceLocation(node) { - return getAdjustedLocation( - node, - /*forRename*/ - false - ); -} -function getAdjustedRenameLocation(node) { - return getAdjustedLocation( - node, - /*forRename*/ - true - ); -} -function getTouchingPropertyName(sourceFile, position) { - return getTouchingToken(sourceFile, position, (n) => isPropertyNameLiteral(n) || isKeyword(n.kind) || isPrivateIdentifier(n)); -} -function getTouchingToken(sourceFile, position, includePrecedingTokenAtEndPosition) { - return getTokenAtPositionWorker( - sourceFile, - position, - /*allowPositionInLeadingTrivia*/ - false, - includePrecedingTokenAtEndPosition, - /*includeEndPosition*/ - false - ); -} -function getTokenAtPosition(sourceFile, position) { - return getTokenAtPositionWorker( - sourceFile, - position, - /*allowPositionInLeadingTrivia*/ - true, - /*includePrecedingTokenAtEndPosition*/ - void 0, - /*includeEndPosition*/ - false - ); -} -function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includePrecedingTokenAtEndPosition, includeEndPosition) { - let current = sourceFile; - let foundToken; - outer: - while (true) { - const children = current.getChildren(sourceFile); - const i = binarySearchKey(children, position, (_, i2) => i2, (middle, _) => { - const end = children[middle].getEnd(); - if (end < position) { - return -1 /* LessThan */; - } - const start = allowPositionInLeadingTrivia ? children[middle].getFullStart() : children[middle].getStart( - sourceFile, - /*includeJsDocComment*/ - true - ); - if (start > position) { - return 1 /* GreaterThan */; - } - if (nodeContainsPosition(children[middle], start, end)) { - if (children[middle - 1]) { - if (nodeContainsPosition(children[middle - 1])) { - return 1 /* GreaterThan */; - } - } - return 0 /* EqualTo */; - } - if (includePrecedingTokenAtEndPosition && start === position && children[middle - 1] && children[middle - 1].getEnd() === position && nodeContainsPosition(children[middle - 1])) { - return 1 /* GreaterThan */; - } - return -1 /* LessThan */; - }); - if (foundToken) { - return foundToken; - } - if (i >= 0 && children[i]) { - current = children[i]; - continue outer; - } - return current; - } - function nodeContainsPosition(node, start, end) { - end ?? (end = node.getEnd()); - if (end < position) { - return false; - } - start ?? (start = allowPositionInLeadingTrivia ? node.getFullStart() : node.getStart( - sourceFile, - /*includeJsDocComment*/ - true - )); - if (start > position) { - return false; - } - if (position < end || position === end && (node.kind === 1 /* EndOfFileToken */ || includeEndPosition)) { - return true; - } else if (includePrecedingTokenAtEndPosition && end === position) { - const previousToken = findPrecedingToken(position, sourceFile, node); - if (previousToken && includePrecedingTokenAtEndPosition(previousToken)) { - foundToken = previousToken; - return true; - } - } - return false; - } -} -function findFirstNonJsxWhitespaceToken(sourceFile, position) { - let tokenAtPosition = getTokenAtPosition(sourceFile, position); - while (isWhiteSpaceOnlyJsxText(tokenAtPosition)) { - const nextToken = findNextToken(tokenAtPosition, tokenAtPosition.parent, sourceFile); - if (!nextToken) return; - tokenAtPosition = nextToken; - } - return tokenAtPosition; -} -function findTokenOnLeftOfPosition(file, position) { - const tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { - return tokenAtPosition; - } - return findPrecedingToken(position, file); -} -function findNextToken(previousToken, parent2, sourceFile) { - return find2(parent2); - function find2(n) { - if (isToken(n) && n.pos === previousToken.end) { - return n; - } - return firstDefined(n.getChildren(sourceFile), (child) => { - const shouldDiveInChildNode = ( - // previous token is enclosed somewhere in the child - child.pos <= previousToken.pos && child.end > previousToken.end || // previous token ends exactly at the beginning of child - child.pos === previousToken.end - ); - return shouldDiveInChildNode && nodeHasTokens(child, sourceFile) ? find2(child) : void 0; - }); - } -} -function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) { - const result = find2(startNode2 || sourceFile); - Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); - return result; - function find2(n) { - if (isNonWhitespaceToken(n) && n.kind !== 1 /* EndOfFileToken */) { - return n; - } - const children = n.getChildren(sourceFile); - const i = binarySearchKey(children, position, (_, i2) => i2, (middle, _) => { - if (position < children[middle].end) { - if (!children[middle - 1] || position >= children[middle - 1].end) { - return 0 /* EqualTo */; - } - return 1 /* GreaterThan */; - } - return -1 /* LessThan */; - }); - if (i >= 0 && children[i]) { - const child = children[i]; - if (position < child.end) { - const start = child.getStart( - sourceFile, - /*includeJsDoc*/ - !excludeJsdoc - ); - const lookInPreviousChild = start >= position || // cursor in the leading trivia - !nodeHasTokens(child, sourceFile) || isWhiteSpaceOnlyJsxText(child); - if (lookInPreviousChild) { - const candidate2 = findRightmostChildNodeWithTokens( - children, - /*exclusiveStartPosition*/ - i, - sourceFile, - n.kind - ); - if (candidate2) { - if (!excludeJsdoc && isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) { - return find2(candidate2); - } - return findRightmostToken(candidate2, sourceFile); - } - return void 0; - } else { - return find2(child); - } - } - } - Debug.assert(startNode2 !== void 0 || n.kind === 308 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n)); - const candidate = findRightmostChildNodeWithTokens( - children, - /*exclusiveStartPosition*/ - children.length, - sourceFile, - n.kind - ); - return candidate && findRightmostToken(candidate, sourceFile); - } -} -function isNonWhitespaceToken(n) { - return isToken(n) && !isWhiteSpaceOnlyJsxText(n); -} -function findRightmostToken(n, sourceFile) { - if (isNonWhitespaceToken(n)) { - return n; - } - const children = n.getChildren(sourceFile); - if (children.length === 0) { - return n; - } - const candidate = findRightmostChildNodeWithTokens( - children, - /*exclusiveStartPosition*/ - children.length, - sourceFile, - n.kind - ); - return candidate && findRightmostToken(candidate, sourceFile); -} -function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sourceFile, parentKind) { - for (let i = exclusiveStartPosition - 1; i >= 0; i--) { - const child = children[i]; - if (isWhiteSpaceOnlyJsxText(child)) { - if (i === 0 && (parentKind === 12 /* JsxText */ || parentKind === 286 /* JsxSelfClosingElement */)) { - Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - } else if (nodeHasTokens(children[i], sourceFile)) { - return children[i]; - } - } -} -function isInString(sourceFile, position, previousToken = findPrecedingToken(position, sourceFile)) { - if (previousToken && isStringTextContainingNode(previousToken)) { - const start = previousToken.getStart(sourceFile); - const end = previousToken.getEnd(); - if (start < position && position < end) { - return true; - } - if (position === end) { - return !!previousToken.isUnterminated; - } - } - return false; -} -function isInsideJsxElementOrAttribute(sourceFile, position) { - const token = getTokenAtPosition(sourceFile, position); - if (!token) { - return false; - } - if (token.kind === 12 /* JsxText */) { - return true; - } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 12 /* JsxText */) { - return true; - } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 295 /* JsxExpression */) { - return true; - } - if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 295 /* JsxExpression */) { - return true; - } - if (token.kind === 31 /* LessThanSlashToken */ && token.parent.kind === 288 /* JsxClosingElement */) { - return true; - } - return false; -} -function isWhiteSpaceOnlyJsxText(node) { - return isJsxText(node) && node.containsOnlyTriviaWhiteSpaces; -} -function isInTemplateString(sourceFile, position) { - const token = getTokenAtPosition(sourceFile, position); - return isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); -} -function isInJSXText(sourceFile, position) { - const token = getTokenAtPosition(sourceFile, position); - if (isJsxText(token)) { - return true; - } - if (token.kind === 19 /* OpenBraceToken */ && isJsxExpression(token.parent) && isJsxElement(token.parent.parent)) { - return true; - } - if (token.kind === 30 /* LessThanToken */ && isJsxOpeningLikeElement(token.parent) && isJsxElement(token.parent.parent)) { - return true; - } - return false; -} -function isInsideJsxElement(sourceFile, position) { - function isInsideJsxElementTraversal(node) { - while (node) { - if (node.kind >= 286 /* JsxSelfClosingElement */ && node.kind <= 295 /* 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.kind === 31 /* LessThanSlashToken */) { - node = node.parent; - } else if (node.kind === 285 /* JsxElement */) { - if (position > node.getStart(sourceFile)) return true; - node = node.parent; - } else { - return false; - } - } - return false; - } - return isInsideJsxElementTraversal(getTokenAtPosition(sourceFile, position)); -} -function findPrecedingMatchingToken(token, matchingTokenKind, sourceFile) { - const closeTokenText = tokenToString(token.kind); - const matchingTokenText = tokenToString(matchingTokenKind); - const tokenFullStart = token.getFullStart(); - const bestGuessIndex = sourceFile.text.lastIndexOf(matchingTokenText, tokenFullStart); - if (bestGuessIndex === -1) { - return void 0; - } - if (sourceFile.text.lastIndexOf(closeTokenText, tokenFullStart - 1) < bestGuessIndex) { - const nodeAtGuess = findPrecedingToken(bestGuessIndex + 1, sourceFile); - if (nodeAtGuess && nodeAtGuess.kind === matchingTokenKind) { - return nodeAtGuess; - } - } - const tokenKind = token.kind; - let remainingMatchingTokens = 0; - while (true) { - const preceding = findPrecedingToken(token.getFullStart(), sourceFile); - if (!preceding) { - return void 0; - } - token = preceding; - if (token.kind === matchingTokenKind) { - if (remainingMatchingTokens === 0) { - return token; - } - remainingMatchingTokens--; - } else if (token.kind === tokenKind) { - remainingMatchingTokens++; - } - } -} -function removeOptionality(type, isOptionalExpression, isOptionalChain2) { - return isOptionalExpression ? type.getNonNullableType() : isOptionalChain2 ? type.getNonOptionalType() : type; -} -function isPossiblyTypeArgumentPosition(token, sourceFile, checker) { - const info = getPossibleTypeArgumentsInfo(token, sourceFile); - return info !== void 0 && (isPartOfTypeNode(info.called) || getPossibleGenericSignatures(info.called, info.nTypeArguments, checker).length !== 0 || isPossiblyTypeArgumentPosition(info.called, sourceFile, checker)); -} -function getPossibleGenericSignatures(called, typeArgumentCount, checker) { - let type = checker.getTypeAtLocation(called); - if (isOptionalChain(called.parent)) { - type = removeOptionality( - type, - isOptionalChainRoot(called.parent), - /*isOptionalChain*/ - true - ); - } - const signatures = isNewExpression(called.parent) ? type.getConstructSignatures() : type.getCallSignatures(); - return signatures.filter((candidate) => !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount); -} -function getPossibleTypeArgumentsInfo(tokenIn, sourceFile) { - if (sourceFile.text.lastIndexOf("<", tokenIn ? tokenIn.pos : sourceFile.text.length) === -1) { - return void 0; - } - let token = tokenIn; - let remainingLessThanTokens = 0; - let nTypeArguments = 0; - while (token) { - switch (token.kind) { - case 30 /* LessThanToken */: - token = findPrecedingToken(token.getFullStart(), sourceFile); - if (token && token.kind === 29 /* QuestionDotToken */) { - token = findPrecedingToken(token.getFullStart(), sourceFile); - } - if (!token || !isIdentifier(token)) return void 0; - if (!remainingLessThanTokens) { - return isDeclarationName(token) ? void 0 : { called: token, nTypeArguments }; - } - remainingLessThanTokens--; - break; - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - remainingLessThanTokens = 3; - break; - case 49 /* GreaterThanGreaterThanToken */: - remainingLessThanTokens = 2; - break; - case 32 /* GreaterThanToken */: - remainingLessThanTokens++; - break; - case 20 /* CloseBraceToken */: - token = findPrecedingMatchingToken(token, 19 /* OpenBraceToken */, sourceFile); - if (!token) return void 0; - break; - case 22 /* CloseParenToken */: - token = findPrecedingMatchingToken(token, 21 /* OpenParenToken */, sourceFile); - if (!token) return void 0; - break; - case 24 /* CloseBracketToken */: - token = findPrecedingMatchingToken(token, 23 /* OpenBracketToken */, sourceFile); - if (!token) return void 0; - break; - // Valid tokens in a type name. Skip. - case 28 /* CommaToken */: - nTypeArguments++; - break; - case 39 /* EqualsGreaterThanToken */: - // falls through - case 80 /* Identifier */: - case 11 /* StringLiteral */: - case 9 /* NumericLiteral */: - case 10 /* BigIntLiteral */: - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - // falls through - case 114 /* TypeOfKeyword */: - case 96 /* ExtendsKeyword */: - case 143 /* KeyOfKeyword */: - case 25 /* DotToken */: - case 52 /* BarToken */: - case 58 /* QuestionToken */: - case 59 /* ColonToken */: - break; - default: - if (isTypeNode(token)) { - break; - } - return void 0; - } - token = findPrecedingToken(token.getFullStart(), sourceFile); - } - return void 0; -} -function isInComment(sourceFile, position, tokenAtPosition) { - return ts_formatting_exports.getRangeOfEnclosingComment( - sourceFile, - position, - /*precedingToken*/ - void 0, - tokenAtPosition - ); -} -function hasDocComment(sourceFile, position) { - const token = getTokenAtPosition(sourceFile, position); - return !!findAncestor(token, isJSDoc); -} -function nodeHasTokens(n, sourceFile) { - return n.kind === 1 /* EndOfFileToken */ ? !!n.jsDoc : n.getWidth(sourceFile) !== 0; -} -function getNodeModifiers(node, excludeFlags = 0 /* None */) { - const result = []; - const flags = isDeclaration(node) ? getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags : 0 /* None */; - if (flags & 2 /* Private */) result.push("private" /* privateMemberModifier */); - if (flags & 4 /* Protected */) result.push("protected" /* protectedMemberModifier */); - if (flags & 1 /* Public */) result.push("public" /* publicMemberModifier */); - if (flags & 256 /* Static */ || isClassStaticBlockDeclaration(node)) result.push("static" /* staticModifier */); - if (flags & 64 /* Abstract */) result.push("abstract" /* abstractModifier */); - if (flags & 32 /* Export */) result.push("export" /* exportedModifier */); - if (flags & 65536 /* Deprecated */) result.push("deprecated" /* deprecatedModifier */); - if (node.flags & 33554432 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 278 /* ExportAssignment */) result.push("export" /* exportedModifier */); - return result.length > 0 ? result.join(",") : "" /* none */; -} -function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 184 /* TypeReference */ || node.kind === 214 /* CallExpression */) { - return node.typeArguments; - } - if (isFunctionLike(node) || node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* InterfaceDeclaration */) { - return node.typeParameters; - } - return void 0; -} -function isComment(kind) { - return kind === 2 /* SingleLineCommentTrivia */ || kind === 3 /* MultiLineCommentTrivia */; -} -function isStringOrRegularExpressionOrTemplateLiteral(kind) { - if (kind === 11 /* StringLiteral */ || kind === 14 /* RegularExpressionLiteral */ || isTemplateLiteralKind(kind)) { - return true; - } - return false; -} -function areIntersectedTypesAvoidingStringReduction(checker, t1, t2) { - return !!(t1.flags & 4 /* String */) && checker.isEmptyAnonymousObjectType(t2); -} -function isStringAndEmptyAnonymousObjectIntersection(type) { - if (!type.isIntersection()) { - return false; - } - const { types, checker } = type; - return types.length === 2 && (areIntersectedTypesAvoidingStringReduction(checker, types[0], types[1]) || areIntersectedTypesAvoidingStringReduction(checker, types[1], types[0])); -} -function isInsideTemplateLiteral(node, position, sourceFile) { - return isTemplateLiteralKind(node.kind) && (node.getStart(sourceFile) < position && position < node.end) || !!node.isUnterminated && position === node.end; -} -function isAccessibilityModifier(kind) { - switch (kind) { - case 125 /* PublicKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - return true; - } - return false; -} -function cloneCompilerOptions(options) { - const result = clone(options); - setConfigFileInOptions(result, options && options.configFile); - return result; -} -function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 210 /* ArrayLiteralExpression */ || node.kind === 211 /* ObjectLiteralExpression */) { - if (node.parent.kind === 227 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */) { - return true; - } - if (node.parent.kind === 251 /* ForOfStatement */ && node.parent.initializer === node) { - return true; - } - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 304 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { - return true; - } - } - return false; -} -function isInReferenceComment(sourceFile, position) { - return isInReferenceCommentWorker( - sourceFile, - position, - /*shouldBeReference*/ - true - ); -} -function isInNonReferenceComment(sourceFile, position) { - return isInReferenceCommentWorker( - sourceFile, - position, - /*shouldBeReference*/ - false - ); -} -function isInReferenceCommentWorker(sourceFile, position, shouldBeReference) { - const range = isInComment( - sourceFile, - position, - /*tokenAtPosition*/ - void 0 - ); - return !!range && shouldBeReference === tripleSlashDirectivePrefixRegex.test(sourceFile.text.substring(range.pos, range.end)); -} -function getReplacementSpanForContextToken(contextToken, position) { - if (!contextToken) return void 0; - switch (contextToken.kind) { - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - return createTextSpanFromStringLiteralLikeContent(contextToken, position); - default: - return createTextSpanFromNode(contextToken); - } -} -function createTextSpanFromNode(node, sourceFile, endNode2) { - return createTextSpanFromBounds(node.getStart(sourceFile), (endNode2 || node).getEnd()); -} -function createTextSpanFromStringLiteralLikeContent(node, position) { - let replacementEnd = node.getEnd() - 1; - if (node.isUnterminated) { - if (node.getStart() === replacementEnd) return void 0; - replacementEnd = Math.min(position, node.getEnd()); - } - return createTextSpanFromBounds(node.getStart() + 1, replacementEnd); -} -function createTextRangeFromNode(node, sourceFile) { - return createRange(node.getStart(sourceFile), node.end); -} -function createTextSpanFromRange(range) { - return createTextSpanFromBounds(range.pos, range.end); -} -function createTextRangeFromSpan(span) { - return createRange(span.start, span.start + span.length); -} -function createTextChangeFromStartLength(start, length2, newText) { - return createTextChange(createTextSpan(start, length2), newText); -} -function createTextChange(span, newText) { - return { span, newText }; -} -var typeKeywords = [ - 133 /* AnyKeyword */, - 131 /* AssertsKeyword */, - 163 /* BigIntKeyword */, - 136 /* BooleanKeyword */, - 97 /* FalseKeyword */, - 140 /* InferKeyword */, - 143 /* KeyOfKeyword */, - 146 /* NeverKeyword */, - 106 /* NullKeyword */, - 150 /* NumberKeyword */, - 151 /* ObjectKeyword */, - 148 /* ReadonlyKeyword */, - 154 /* StringKeyword */, - 155 /* SymbolKeyword */, - 114 /* TypeOfKeyword */, - 112 /* TrueKeyword */, - 116 /* VoidKeyword */, - 157 /* UndefinedKeyword */, - 158 /* UniqueKeyword */, - 159 /* UnknownKeyword */ -]; -function isTypeKeyword(kind) { - return contains(typeKeywords, kind); -} -function isTypeKeywordToken(node) { - return node.kind === 156 /* TypeKeyword */; -} -function isTypeKeywordTokenOrIdentifier(node) { - return isTypeKeywordToken(node) || isIdentifier(node) && node.text === "type"; -} -function nodeSeenTracker() { - const seen = []; - return (node) => { - const id = getNodeId(node); - return !seen[id] && (seen[id] = true); - }; -} -function getSnapshotText(snap) { - return snap.getText(0, snap.getLength()); -} -function repeatString(str, count) { - let result = ""; - for (let i = 0; i < count; i++) { - result += str; - } - return result; -} -function skipConstraint(type) { - return type.isTypeParameter() ? type.getConstraint() || type : type; -} -function getNameFromPropertyName(name) { - return name.kind === 168 /* 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)); -} -function programContainsEsModules(program) { - return program.getSourceFiles().some((s) => !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!s.externalModuleIndicator); -} -function compilerOptionsIndicateEsModules(compilerOptions) { - return !!compilerOptions.module || getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ || !!compilerOptions.noEmit; -} -function createModuleSpecifierResolutionHost(program, host) { - return { - fileExists: (fileName) => program.fileExists(fileName), - getCurrentDirectory: () => host.getCurrentDirectory(), - readFile: maybeBind(host, host.readFile), - useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames) || program.useCaseSensitiveFileNames, - getSymlinkCache: maybeBind(host, host.getSymlinkCache) || program.getSymlinkCache, - getModuleSpecifierCache: maybeBind(host, host.getModuleSpecifierCache), - getPackageJsonInfoCache: () => { - var _a; - return (_a = program.getModuleResolutionCache()) == null ? void 0 : _a.getPackageJsonInfoCache(); - }, - getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation), - redirectTargetsMap: program.redirectTargetsMap, - getRedirectFromSourceFile: (fileName) => program.getRedirectFromSourceFile(fileName), - isSourceOfProjectReferenceRedirect: (fileName) => program.isSourceOfProjectReferenceRedirect(fileName), - getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson), - getFileIncludeReasons: () => program.getFileIncludeReasons(), - getCommonSourceDirectory: () => program.getCommonSourceDirectory(), - getDefaultResolutionModeForFile: (file) => program.getDefaultResolutionModeForFile(file), - getModeForResolutionAtIndex: (file, index) => program.getModeForResolutionAtIndex(file, index) - }; -} -function getModuleSpecifierResolverHost(program, host) { - return { - ...createModuleSpecifierResolutionHost(program, host), - getCommonSourceDirectory: () => program.getCommonSourceDirectory() - }; -} -function moduleResolutionUsesNodeModules(moduleResolution) { - return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */; -} -function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference, isTypeOnly) { - return factory.createImportDeclaration( - /*modifiers*/ - void 0, - defaultImport || namedImports ? factory.createImportClause(isTypeOnly ? 156 /* TypeKeyword */ : void 0, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0, - typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier, - /*attributes*/ - void 0 - ); -} -function makeStringLiteral(text, quotePreference) { - return factory.createStringLiteral(text, quotePreference === 0 /* Single */); -} -var QuotePreference = /* @__PURE__ */ ((QuotePreference6) => { - QuotePreference6[QuotePreference6["Single"] = 0] = "Single"; - QuotePreference6[QuotePreference6["Double"] = 1] = "Double"; - return QuotePreference6; -})(QuotePreference || {}); -function quotePreferenceFromString(str, sourceFile) { - return isStringDoubleQuoted(str, sourceFile) ? 1 /* Double */ : 0 /* Single */; -} -function getQuotePreference(sourceFile, preferences) { - if (preferences.quotePreference && preferences.quotePreference !== "auto") { - return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; - } else { - const firstModuleSpecifier = isFullSourceFile(sourceFile) && sourceFile.imports && find(sourceFile.imports, (n) => isStringLiteral(n) && !nodeIsSynthesized(n.parent)); - return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1 /* Double */; - } -} -function getQuoteFromPreference(qp) { - switch (qp) { - case 0 /* Single */: - return "'"; - case 1 /* Double */: - return '"'; - default: - return Debug.assertNever(qp); - } -} -function symbolNameNoDefault(symbol) { - const escaped = symbolEscapedNameNoDefault(symbol); - return escaped === void 0 ? void 0 : unescapeLeadingUnderscores(escaped); -} -function symbolEscapedNameNoDefault(symbol) { - if (symbol.escapedName !== "default" /* Default */) { - return symbol.escapedName; - } - return firstDefined(symbol.declarations, (decl) => { - const name = getNameOfDeclaration(decl); - return name && name.kind === 80 /* Identifier */ ? name.escapedText : void 0; - }); -} -function isModuleSpecifierLike(node) { - return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) || isJSDocImportTag(node.parent) || isRequireCall( - node.parent, - /*requireStringLiteralLikeArgument*/ - false - ) && node.parent.arguments[0] === node || isImportCall(node.parent) && node.parent.arguments[0] === node); -} -function isObjectBindingElementWithoutPropertyName(bindingElement) { - return isBindingElement(bindingElement) && isObjectBindingPattern(bindingElement.parent) && isIdentifier(bindingElement.name) && !bindingElement.propertyName; -} -function getPropertySymbolFromBindingElement(checker, bindingElement) { - const typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); -} -function getParentNodeInSpan(node, file, span) { - if (!node) return void 0; - while (node.parent) { - if (isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { - return node; - } - node = node.parent; - } -} -function spanContainsNode(span, node, file) { - return textSpanContainsPosition(span, node.getStart(file)) && node.getEnd() <= textSpanEnd(span); -} -function findModifier(node, kind) { - return canHaveModifiers(node) ? find(node.modifiers, (m) => m.kind === kind) : void 0; -} -function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { - var _a; - const decl = isArray(imports) ? imports[0] : imports; - const importKindPredicate = decl.kind === 244 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; - const existingImportStatements = filter(sourceFile.statements, importKindPredicate); - const { comparer, isSorted } = ts_OrganizeImports_exports.getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences); - const sortedNewImports = isArray(imports) ? toSorted(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports]; - if (!(existingImportStatements == null ? void 0 : existingImportStatements.length)) { - if (isFullSourceFile(sourceFile)) { - changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); - } else { - for (const newImport of sortedNewImports) { - changes.insertStatementsInNewFile(sourceFile.fileName, [newImport], (_a = getOriginalNode(newImport)) == null ? void 0 : _a.getSourceFile()); - } - } - return; - } - Debug.assert(isFullSourceFile(sourceFile)); - if (existingImportStatements && isSorted) { - for (const newImport of sortedNewImports) { - const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport, comparer); - if (insertionIndex === 0) { - const options = existingImportStatements[0] === sourceFile.statements[0] ? { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude } : {}; - changes.insertNodeBefore( - sourceFile, - existingImportStatements[0], - newImport, - /*blankLineBetween*/ - false, - options - ); - } else { - const prevImport = existingImportStatements[insertionIndex - 1]; - changes.insertNodeAfter(sourceFile, prevImport, newImport); - } - } - } else { - const lastExistingImport = lastOrUndefined(existingImportStatements); - if (lastExistingImport) { - changes.insertNodesAfter(sourceFile, lastExistingImport, sortedNewImports); - } else { - changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); - } - } -} -function getTypeKeywordOfTypeOnlyImport(importClause, sourceFile) { - Debug.assert(importClause.isTypeOnly); - return cast(importClause.getChildAt(0, sourceFile), isTypeKeywordToken); -} -function textSpansEqual(a, b) { - return !!a && !!b && a.start === b.start && a.length === b.length; -} -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) { - for (let i = 0; i < array.length; i++) { - if (array.indexOf(array[i]) === i) { - const result = callback(array[i], i); - if (result) { - return result; - } - } - } - } - return void 0; -} -function isTextWhiteSpaceLike(text, startPos, endPos) { - for (let i = startPos; i < endPos; i++) { - if (!isWhiteSpaceLike(text.charCodeAt(i))) { - return false; - } - } - return true; -} -function getMappedLocation(location, sourceMapper, fileExists) { - const mapsTo = sourceMapper.tryGetSourcePosition(location); - return mapsTo && (!fileExists || fileExists(normalizePath(mapsTo.fileName)) ? mapsTo : void 0); -} -function getMappedDocumentSpan(documentSpan, sourceMapper, fileExists) { - const { fileName, textSpan } = documentSpan; - const newPosition = getMappedLocation({ fileName, pos: textSpan.start }, sourceMapper, fileExists); - if (!newPosition) return void 0; - const newEndPosition = getMappedLocation({ fileName, pos: textSpan.start + textSpan.length }, sourceMapper, fileExists); - const newLength = newEndPosition ? newEndPosition.pos - newPosition.pos : textSpan.length; - return { - fileName: newPosition.fileName, - textSpan: { - start: newPosition.pos, - length: newLength - }, - originalFileName: documentSpan.fileName, - originalTextSpan: documentSpan.textSpan, - contextSpan: getMappedContextSpan(documentSpan, sourceMapper, fileExists), - originalContextSpan: documentSpan.contextSpan - }; -} -function getMappedContextSpan(documentSpan, sourceMapper, fileExists) { - const contextSpanStart = documentSpan.contextSpan && getMappedLocation( - { fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start }, - sourceMapper, - fileExists - ); - const contextSpanEnd = documentSpan.contextSpan && getMappedLocation( - { fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start + documentSpan.contextSpan.length }, - sourceMapper, - fileExists - ); - return contextSpanStart && contextSpanEnd ? { start: contextSpanStart.pos, length: contextSpanEnd.pos - contextSpanStart.pos } : void 0; -} -function isFirstDeclarationOfSymbolParameter(symbol) { - const declaration = symbol.declarations ? firstOrUndefined(symbol.declarations) : void 0; - return !!findAncestor(declaration, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit"); -} -var displayPartWriterCache = /* @__PURE__ */ new Map(); -function getDisplayPartWriter(maximumLength) { - maximumLength = maximumLength || defaultMaximumTruncationLength; - if (!displayPartWriterCache.has(maximumLength)) { - displayPartWriterCache.set(maximumLength, getDisplayPartWriterWorker(maximumLength)); - } - return displayPartWriterCache.get(maximumLength); -} -function getDisplayPartWriterWorker(maximumLength) { - const absoluteMaximumLength = maximumLength * 10; - let displayParts; - let lineStart; - let indent3; - let length2; - resetWriter(); - const unknownWrite = (text) => writeKind(text, 17 /* text */); - return { - displayParts: () => { - const finalText = displayParts.length && displayParts[displayParts.length - 1].text; - if (length2 > absoluteMaximumLength && finalText && finalText !== "...") { - if (!isWhiteSpaceLike(finalText.charCodeAt(finalText.length - 1))) { - displayParts.push(displayPart(" ", 16 /* space */)); - } - displayParts.push(displayPart("...", 15 /* punctuation */)); - } - return displayParts; - }, - writeKeyword: (text) => writeKind(text, 5 /* keyword */), - writeOperator: (text) => writeKind(text, 12 /* operator */), - writePunctuation: (text) => writeKind(text, 15 /* punctuation */), - writeTrailingSemicolon: (text) => writeKind(text, 15 /* punctuation */), - writeSpace: (text) => writeKind(text, 16 /* space */), - writeStringLiteral: (text) => writeKind(text, 8 /* stringLiteral */), - writeParameter: (text) => writeKind(text, 13 /* parameterName */), - writeProperty: (text) => writeKind(text, 14 /* propertyName */), - writeLiteral: (text) => writeKind(text, 8 /* stringLiteral */), - writeSymbol, - writeLine, - write: unknownWrite, - writeComment: unknownWrite, - getText: () => "", - getTextPos: () => 0, - getColumn: () => 0, - getLine: () => 0, - isAtStartOfLine: () => false, - hasTrailingWhitespace: () => false, - hasTrailingComment: () => false, - rawWrite: notImplemented, - getIndent: () => indent3, - increaseIndent: () => { - indent3++; - }, - decreaseIndent: () => { - indent3--; - }, - clear: resetWriter - }; - function writeIndent() { - if (length2 > absoluteMaximumLength) return; - if (lineStart) { - const indentString = getIndentString(indent3); - if (indentString) { - length2 += indentString.length; - displayParts.push(displayPart(indentString, 16 /* space */)); - } - lineStart = false; - } - } - function writeKind(text, kind) { - if (length2 > absoluteMaximumLength) return; - writeIndent(); - length2 += text.length; - displayParts.push(displayPart(text, kind)); - } - function writeSymbol(text, symbol) { - if (length2 > absoluteMaximumLength) return; - writeIndent(); - length2 += text.length; - displayParts.push(symbolPart(text, symbol)); - } - function writeLine() { - if (length2 > absoluteMaximumLength) return; - length2 += 1; - displayParts.push(lineBreakPart()); - lineStart = true; - } - function resetWriter() { - displayParts = []; - lineStart = true; - indent3 = 0; - length2 = 0; - } -} -function symbolPart(text, symbol) { - return displayPart(text, displayPartKind(symbol)); - function displayPartKind(symbol2) { - const flags = symbol2.flags; - if (flags & 3 /* Variable */) { - return isFirstDeclarationOfSymbolParameter(symbol2) ? 13 /* parameterName */ : 9 /* localName */; - } - if (flags & 4 /* Property */) return 14 /* propertyName */; - if (flags & 32768 /* GetAccessor */) return 14 /* propertyName */; - if (flags & 65536 /* SetAccessor */) return 14 /* propertyName */; - if (flags & 8 /* EnumMember */) return 19 /* enumMemberName */; - if (flags & 16 /* Function */) return 20 /* functionName */; - if (flags & 32 /* Class */) return 1 /* className */; - if (flags & 64 /* Interface */) return 4 /* interfaceName */; - if (flags & 384 /* Enum */) return 2 /* enumName */; - if (flags & 1536 /* Module */) return 11 /* moduleName */; - if (flags & 8192 /* Method */) return 10 /* methodName */; - if (flags & 262144 /* TypeParameter */) return 18 /* typeParameterName */; - if (flags & 524288 /* TypeAlias */) return 0 /* aliasName */; - if (flags & 2097152 /* Alias */) return 0 /* aliasName */; - return 17 /* text */; - } -} -function displayPart(text, kind) { - return { text, kind: SymbolDisplayPartKind[kind] }; -} -function spacePart() { - return displayPart(" ", 16 /* space */); -} -function keywordPart(kind) { - return displayPart(tokenToString(kind), 5 /* keyword */); -} -function punctuationPart(kind) { - return displayPart(tokenToString(kind), 15 /* punctuation */); -} -function operatorPart(kind) { - return displayPart(tokenToString(kind), 12 /* operator */); -} -function parameterNamePart(text) { - return displayPart(text, 13 /* parameterName */); -} -function propertyNamePart(text) { - return displayPart(text, 14 /* propertyName */); -} -function textOrKeywordPart(text) { - const kind = stringToToken(text); - return kind === void 0 ? textPart(text) : keywordPart(kind); -} -function textPart(text) { - return displayPart(text, 17 /* text */); -} -function typeAliasNamePart(text) { - return displayPart(text, 0 /* aliasName */); -} -function typeParameterNamePart(text) { - return displayPart(text, 18 /* typeParameterName */); -} -function linkTextPart(text) { - return displayPart(text, 24 /* linkText */); -} -function linkNamePart(text, target) { - return { - text, - kind: SymbolDisplayPartKind[23 /* linkName */], - target: { - fileName: getSourceFileOfNode(target).fileName, - textSpan: createTextSpanFromNode(target) - } - }; -} -function linkPart(text) { - return displayPart(text, 22 /* link */); -} -function buildLinkParts(link, checker) { - var _a; - const prefix = isJSDocLink(link) ? "link" : isJSDocLinkCode(link) ? "linkcode" : "linkplain"; - const parts = [linkPart(`{@${prefix} `)]; - if (!link.name) { - if (link.text) { - parts.push(linkTextPart(link.text)); - } - } 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 = (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 { - 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("}")); - return parts; -} -function skipSeparatorFromLinkText(text) { - let pos = 0; - if (text.charCodeAt(pos++) === 124 /* bar */) { - while (pos < text.length && text.charCodeAt(pos) === 32 /* space */) pos++; - return text.slice(pos); - } - return text; -} -function findLinkNameEnd(text) { - let pos = text.indexOf("://"); - if (pos === 0) { - while (pos < text.length && text.charCodeAt(pos) !== 124 /* bar */) pos++; - return pos; - } - if (text.indexOf("()") === 0) return 2; - if (text.charAt(0) === "<") { - let brackets2 = 0; - let i = 0; - while (i < text.length) { - if (text[i] === "<") brackets2++; - if (text[i] === ">") brackets2--; - i++; - if (!brackets2) return i; - } - } - return 0; -} -var lineFeed2 = "\n"; -function getNewLineOrDefaultFromHost(host, formatSettings) { - var _a; - return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a = host.getNewLine) == null ? void 0 : _a.call(host)) || lineFeed2; -} -function lineBreakPart() { - return displayPart("\n", 6 /* lineBreak */); -} -function mapToDisplayParts(writeDisplayParts, maximumLength) { - const displayPartWriter = getDisplayPartWriter(maximumLength); - try { - writeDisplayParts(displayPartWriter); - return displayPartWriter.displayParts(); - } finally { - displayPartWriter.clear(); - } -} -function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags = 0 /* None */, maximumLength, verbosityLevel, out) { - return mapToDisplayParts((writer) => { - typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer, maximumLength, verbosityLevel, out); - }, maximumLength); -} -function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags = 0 /* None */) { - return mapToDisplayParts((writer) => { - typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8 /* UseAliasDefinedOutsideCurrentScope */, writer); - }); -} -function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags = 0 /* None */, maximumLength, verbosityLevel, out) { - flags |= 16384 /* UseAliasDefinedOutsideCurrentScope */ | 1024 /* MultilineObjectLiterals */ | 32 /* WriteTypeArgumentsOfSignature */ | 8192 /* OmitParameterModifiers */; - return mapToDisplayParts((writer) => { - typechecker.writeSignature( - signature, - enclosingDeclaration, - flags, - /*kind*/ - void 0, - writer, - maximumLength, - verbosityLevel, - out - ); - }, maximumLength); -} -function isImportOrExportSpecifierName(location) { - return !!location.parent && isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location; -} -function getScriptKind(fileName, host) { - return ensureScriptKind(fileName, host.getScriptKind && host.getScriptKind(fileName)); -} -function getSymbolTarget(symbol, checker) { - let next = symbol; - while (isAliasSymbol(next) || isTransientSymbol(next) && next.links.target) { - if (isTransientSymbol(next) && next.links.target) { - next = next.links.target; - } else { - next = skipAlias(next, checker); - } - } - return next; -} -function isAliasSymbol(symbol) { - return (symbol.flags & 2097152 /* Alias */) !== 0; -} -function getUniqueSymbolId(symbol, checker) { - return getSymbolId(skipAlias(symbol, checker)); -} -function getFirstNonSpaceCharacterPosition(text, position) { - while (isWhiteSpaceLike(text.charCodeAt(position))) { - position += 1; - } - return position; -} -function getPrecedingNonSpaceCharacterPosition(text, position) { - while (position > -1 && isWhiteSpaceSingleLine(text.charCodeAt(position))) { - position -= 1; - } - return position + 1; -} -function copyComments(sourceNode, targetNode) { - const sourceFile = sourceNode.getSourceFile(); - const text = sourceFile.text; - if (hasLeadingLineBreak(sourceNode, text)) { - copyLeadingComments(sourceNode, targetNode, sourceFile); - } else { - copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile); - } - copyTrailingComments(sourceNode, targetNode, sourceFile); -} -function hasLeadingLineBreak(node, text) { - const start = node.getFullStart(); - const end = node.getStart(); - for (let i = start; i < end; i++) { - if (text.charCodeAt(i) === 10 /* lineFeed */) return true; - } - return false; -} -function getUniqueName(baseName, sourceFile) { - let nameText = baseName; - for (let i = 1; !isFileLevelUniqueName(sourceFile, nameText); i++) { - nameText = `${baseName}_${i}`; - } - return nameText; -} -function getRenameLocation(edits, renameFilename, name, preferLastLocation) { - let delta = 0; - let lastPos = -1; - for (const { fileName, textChanges: textChanges2 } of edits) { - Debug.assert(fileName === renameFilename); - for (const change of textChanges2) { - const { span, newText } = change; - const index = indexInTextChange(newText, escapeString(name)); - if (index !== -1) { - lastPos = span.start + delta + index; - if (!preferLastLocation) { - return lastPos; - } - } - delta += newText.length - span.length; - } - } - Debug.assert(preferLastLocation); - Debug.assert(lastPos >= 0); - return lastPos; -} -function copyLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { - forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, addSyntheticLeadingComment)); -} -function copyTrailingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { - forEachTrailingCommentRange(sourceFile.text, sourceNode.end, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, addSyntheticTrailingComment)); -} -function copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { - forEachTrailingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, addSyntheticLeadingComment)); -} -function getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, cb) { - return (pos, end, kind, htnl) => { - if (kind === 3 /* MultiLineCommentTrivia */) { - pos += 2; - end -= 2; - } else { - pos += 2; - } - cb(targetNode, commentKind || kind, sourceFile.text.slice(pos, end), hasTrailingNewLine !== void 0 ? hasTrailingNewLine : htnl); - }; -} -function indexInTextChange(change, name) { - if (startsWith(change, name)) return 0; - let idx = change.indexOf(" " + name); - if (idx === -1) idx = change.indexOf("." + name); - if (idx === -1) idx = change.indexOf('"' + name); - return idx === -1 ? -1 : idx + 1; -} -function needsParentheses(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 215 /* NewExpression */: - return checker.getContextualType(parent2, contextFlags); - case 227 /* BinaryExpression */: { - const { left, operatorToken, right } = parent2; - return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); - } - case 297 /* CaseClause */: - return getSwitchedType(parent2, checker); - default: - return checker.getContextualType(node, contextFlags); - } -} -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; -} -function isEqualityOperatorKind(kind) { - switch (kind) { - case 37 /* EqualsEqualsEqualsToken */: - case 35 /* EqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - return true; - default: - return false; - } -} -function isStringLiteralOrTemplate(node) { - switch (node.kind) { - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 229 /* TemplateExpression */: - case 216 /* TaggedTemplateExpression */: - return true; - default: - return false; - } -} -function hasIndexSignature(type) { - return !!type.getStringIndexType() || !!type.getNumberIndexType(); -} -function getSwitchedType(caseClause, checker) { - return checker.getTypeAtLocation(caseClause.parent.parent.expression); -} -var ANONYMOUS = "anonymous function"; -function getTypeNodeIfAccessible(type, enclosingScope, program, host) { - const checker = program.getTypeChecker(); - let typeIsAccessible = true; - const notAccessible = () => typeIsAccessible = false; - const res = checker.typeToTypeNode(type, enclosingScope, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */, { - trackSymbol: (symbol, declaration, meaning) => { - typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible( - symbol, - declaration, - meaning, - /*shouldComputeAliasToMarkVisible*/ - false - ).accessibility === 0 /* Accessible */; - return !typeIsAccessible; - }, - reportInaccessibleThisError: notAccessible, - reportPrivateInBaseOfClassExpression: notAccessible, - reportInaccessibleUniqueSymbolError: notAccessible, - moduleResolverHost: getModuleSpecifierResolverHost(program, host) - }); - return typeIsAccessible ? res : void 0; -} -function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 180 /* CallSignature */ || kind === 181 /* ConstructSignature */ || kind === 182 /* IndexSignature */ || kind === 172 /* PropertySignature */ || kind === 174 /* MethodSignature */; -} -function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 263 /* FunctionDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; -} -function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 268 /* ModuleDeclaration */; -} -function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 244 /* VariableStatement */ || kind === 245 /* ExpressionStatement */ || kind === 247 /* DoStatement */ || kind === 252 /* ContinueStatement */ || kind === 253 /* BreakStatement */ || kind === 254 /* ReturnStatement */ || kind === 258 /* ThrowStatement */ || kind === 260 /* DebuggerStatement */ || kind === 173 /* PropertyDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 278 /* ExportAssignment */; -} -var syntaxMayBeASICandidate = or( - syntaxRequiresTrailingCommaOrSemicolonOrASI, - syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, - syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, - syntaxRequiresTrailingSemicolonOrASI -); -function nodeIsASICandidate(node, sourceFile) { - const lastToken = node.getLastToken(sourceFile); - if (lastToken && lastToken.kind === 27 /* SemicolonToken */) { - return false; - } - if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) { - if (lastToken && lastToken.kind === 28 /* CommaToken */) { - return false; - } - } else if (syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(node.kind)) { - const lastChild = last(node.getChildren(sourceFile)); - if (lastChild && isModuleBlock(lastChild)) { - return false; - } - } else if (syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(node.kind)) { - const lastChild = last(node.getChildren(sourceFile)); - if (lastChild && isFunctionBlock(lastChild)) { - return false; - } - } else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) { - return false; - } - if (node.kind === 247 /* DoStatement */) { - return true; - } - const topNode = findAncestor(node, (ancestor) => !ancestor.parent); - const nextToken = findNextToken(node, topNode, sourceFile); - if (!nextToken || nextToken.kind === 20 /* CloseBraceToken */) { - return true; - } - const startLine = sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; - const endLine = sourceFile.getLineAndCharacterOfPosition(nextToken.getStart(sourceFile)).line; - return startLine !== endLine; -} -function positionIsASICandidate(pos, context, sourceFile) { - const contextAncestor = findAncestor(context, (ancestor) => { - if (ancestor.end !== pos) { - return "quit"; - } - return syntaxMayBeASICandidate(ancestor.kind); - }); - return !!contextAncestor && nodeIsASICandidate(contextAncestor, sourceFile); -} -function probablyUsesSemicolons(sourceFile) { - let withSemicolon = 0; - let withoutSemicolon = 0; - const nStatementsToObserve = 5; - forEachChild(sourceFile, function visit(node) { - if (syntaxRequiresTrailingSemicolonOrASI(node.kind)) { - const lastToken = node.getLastToken(sourceFile); - if ((lastToken == null ? void 0 : lastToken.kind) === 27 /* SemicolonToken */) { - withSemicolon++; - } else { - withoutSemicolon++; - } - } else if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) { - const lastToken = node.getLastToken(sourceFile); - if ((lastToken == null ? void 0 : lastToken.kind) === 27 /* SemicolonToken */) { - withSemicolon++; - } else if (lastToken && lastToken.kind !== 28 /* CommaToken */) { - const lastTokenLine = getLineAndCharacterOfPosition(sourceFile, lastToken.getStart(sourceFile)).line; - const nextTokenLine = getLineAndCharacterOfPosition(sourceFile, getSpanOfTokenAtPosition(sourceFile, lastToken.end).start).line; - if (lastTokenLine !== nextTokenLine) { - withoutSemicolon++; - } - } - } - if (withSemicolon + withoutSemicolon >= nStatementsToObserve) { - return true; - } - return forEachChild(node, visit); - }); - if (withSemicolon === 0 && withoutSemicolon <= 1) { - return true; - } - return withSemicolon / withoutSemicolon > 1 / nStatementsToObserve; -} -function tryGetDirectories(host, directoryName) { - return tryIOAndConsumeErrors(host, host.getDirectories, directoryName) || []; -} -function tryReadDirectory(host, path, extensions, exclude, include) { - return tryIOAndConsumeErrors(host, host.readDirectory, path, extensions, exclude, include) || emptyArray; -} -function tryFileExists(host, path) { - return tryIOAndConsumeErrors(host, host.fileExists, path); -} -function tryDirectoryExists(host, path) { - return tryAndIgnoreErrors(() => directoryProbablyExists(path, host)) || false; -} -function tryAndIgnoreErrors(cb) { - try { - return cb(); - } catch { - return void 0; - } -} -function tryIOAndConsumeErrors(host, toApply, ...args) { - return tryAndIgnoreErrors(() => toApply && toApply.apply(host, args)); -} -function findPackageJsons(startDirectory, host) { - const paths = []; - forEachAncestorDirectoryStoppingAtGlobalCache( - host, - startDirectory, - (ancestor) => { - const currentConfigPath = combinePaths(ancestor, "package.json"); - if (tryFileExists(host, currentConfigPath)) { - paths.push(currentConfigPath); - } - } - ); - return paths; -} -function findPackageJson(directory, host) { - let packageJson; - forEachAncestorDirectoryStoppingAtGlobalCache( - host, - directory, - (ancestor) => { - if (ancestor === "node_modules") return true; - packageJson = findConfigFile(ancestor, (f) => tryFileExists(host, f), "package.json"); - if (packageJson) { - return true; - } - } - ); - return packageJson; -} -function getPackageJsonsVisibleToFile(fileName, host) { - if (!host.fileExists) { - return []; - } - const packageJsons = []; - forEachAncestorDirectoryStoppingAtGlobalCache( - host, - getDirectoryPath(fileName), - (ancestor) => { - const packageJsonFileName = combinePaths(ancestor, "package.json"); - if (host.fileExists(packageJsonFileName)) { - const info = createPackageJsonInfo(packageJsonFileName, host); - if (info) { - packageJsons.push(info); - } - } - } - ); - return packageJsons; -} -function createPackageJsonInfo(fileName, host) { - if (!host.readFile) { - return void 0; - } - const dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"]; - const stringContent = host.readFile(fileName) || ""; - const content = tryParseJson(stringContent); - const info = {}; - if (content) { - for (const key of dependencyKeys) { - const dependencies = content[key]; - if (!dependencies) { - continue; - } - const dependencyMap = /* @__PURE__ */ new Map(); - for (const packageName in dependencies) { - dependencyMap.set(packageName, dependencies[packageName]); - } - info[key] = dependencyMap; - } - } - const dependencyGroups = [ - [1 /* Dependencies */, info.dependencies], - [2 /* DevDependencies */, info.devDependencies], - [8 /* OptionalDependencies */, info.optionalDependencies], - [4 /* PeerDependencies */, info.peerDependencies] - ]; - return { - ...info, - parseable: !!content, - fileName, - get, - has(dependencyName, inGroups) { - return !!get(dependencyName, inGroups); - } - }; - function get(dependencyName, inGroups = 15 /* All */) { - for (const [group2, deps] of dependencyGroups) { - if (deps && inGroups & group2) { - const dep = deps.get(dependencyName); - if (dep !== void 0) { - return dep; - } - } - } - } -} -function createPackageJsonImportFilter(fromFile, preferences, host) { - const packageJsons = (host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName) || getPackageJsonsVisibleToFile(fromFile.fileName, host)).filter((p) => p.parseable); - let usesNodeCoreModules; - let ambientModuleCache; - let sourceFileCache; - return { - allowsImportingAmbientModule, - getSourceFileInfo, - allowsImportingSpecifier - }; - function moduleSpecifierIsCoveredByPackageJson(specifier) { - const packageName = getNodeModuleRootSpecifier(specifier); - for (const packageJson of packageJsons) { - if (packageJson.has(packageName) || packageJson.has(getTypesPackageName(packageName))) { - return true; - } - } - return false; - } - function allowsImportingAmbientModule(moduleSymbol, moduleSpecifierResolutionHost) { - if (!packageJsons.length || !moduleSymbol.valueDeclaration) { - return true; - } - if (!ambientModuleCache) { - ambientModuleCache = /* @__PURE__ */ new Map(); - } else { - const cached = ambientModuleCache.get(moduleSymbol); - if (cached !== void 0) { - return cached; - } - } - const declaredModuleSpecifier = stripQuotes(moduleSymbol.getName()); - if (isAllowedCoreNodeModulesImport(declaredModuleSpecifier)) { - ambientModuleCache.set(moduleSymbol, true); - return true; - } - const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); - const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); - if (typeof declaringNodeModuleName === "undefined") { - ambientModuleCache.set(moduleSymbol, true); - return true; - } - const result = moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); - ambientModuleCache.set(moduleSymbol, result); - return result; - } - function getSourceFileInfo(sourceFile, moduleSpecifierResolutionHost) { - if (!packageJsons.length) { - return { importable: true, packageName: void 0 }; - } - if (!sourceFileCache) { - sourceFileCache = /* @__PURE__ */ new Map(); - } else { - const cached = sourceFileCache.get(sourceFile); - if (cached !== void 0) { - return cached; - } - } - const packageName = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost); - if (!packageName) { - const result2 = { importable: true, packageName }; - sourceFileCache.set(sourceFile, result2); - return result2; - } - const importable = moduleSpecifierIsCoveredByPackageJson(packageName); - const result = { importable, packageName }; - sourceFileCache.set(sourceFile, result); - return result; - } - function allowsImportingSpecifier(moduleSpecifier) { - if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) { - return true; - } - if (pathIsRelative(moduleSpecifier) || isRootedDiskPath(moduleSpecifier)) { - return true; - } - return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); - } - function isAllowedCoreNodeModulesImport(moduleSpecifier) { - if (isFullSourceFile(fromFile) && isSourceFileJS(fromFile) && nodeCoreModules.has(moduleSpecifier)) { - if (usesNodeCoreModules === void 0) { - usesNodeCoreModules = consumesNodeCoreModules(fromFile); - } - if (usesNodeCoreModules) { - return true; - } - } - return false; - } - function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) { - if (!importedFileName.includes("node_modules")) { - return void 0; - } - const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName( - host.getCompilationSettings(), - fromFile, - importedFileName, - moduleSpecifierResolutionHost, - preferences - ); - if (!specifier) { - return void 0; - } - if (!pathIsRelative(specifier) && !isRootedDiskPath(specifier)) { - return getNodeModuleRootSpecifier(specifier); - } - } - function getNodeModuleRootSpecifier(fullSpecifier) { - const components = getPathComponents(getPackageNameFromTypesPackageName(fullSpecifier)).slice(1); - if (startsWith(components[0], "@")) { - return `${components[0]}/${components[1]}`; - } - return components[0]; - } -} -function consumesNodeCoreModules(sourceFile) { - return some(sourceFile.imports, ({ text }) => nodeCoreModules.has(text)); -} -function isInsideNodeModules(fileOrDirectory) { - return contains(getPathComponents(fileOrDirectory), "node_modules"); -} -function isDiagnosticWithLocation(diagnostic) { - return diagnostic.file !== void 0 && diagnostic.start !== void 0 && diagnostic.length !== void 0; -} -function findDiagnosticForNode(node, sortedFileDiagnostics) { - const span = createTextSpanFromNode(node); - const index = binarySearchKey(sortedFileDiagnostics, span, identity, compareTextSpans); - if (index >= 0) { - const diagnostic = sortedFileDiagnostics[index]; - Debug.assertEqual(diagnostic.file, node.getSourceFile(), "Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"); - return cast(diagnostic, isDiagnosticWithLocation); - } -} -function getDiagnosticsWithinSpan(span, sortedFileDiagnostics) { - var _a; - let index = binarySearchKey(sortedFileDiagnostics, span.start, (diag2) => diag2.start, compareValues); - if (index < 0) { - index = ~index; - } - while (((_a = sortedFileDiagnostics[index - 1]) == null ? void 0 : _a.start) === span.start) { - index--; - } - const result = []; - const end = textSpanEnd(span); - while (true) { - const diagnostic = tryCast(sortedFileDiagnostics[index], isDiagnosticWithLocation); - if (!diagnostic || diagnostic.start > end) { - break; - } - if (textSpanContainsTextSpan(span, diagnostic)) { - result.push(diagnostic); - } - index++; - } - return result; -} -function getRefactorContextSpan({ startPosition, endPosition }) { - return createTextSpanFromBounds(startPosition, endPosition === void 0 ? startPosition : endPosition); -} -function getFixableErrorSpanExpression(sourceFile, span) { - const token = getTokenAtPosition(sourceFile, span.start); - const expression = findAncestor(token, (node) => { - if (node.getStart(sourceFile) < span.start || node.getEnd() > textSpanEnd(span)) { - return "quit"; - } - return isExpression(node) && textSpansEqual(span, createTextSpanFromNode(node, sourceFile)); - }); - return expression; -} -function mapOneOrMany(valueOrArray, f, resultSelector = identity) { - return valueOrArray ? isArray(valueOrArray) ? resultSelector(map(valueOrArray, f)) : f(valueOrArray, 0) : void 0; -} -function firstOrOnly(valueOrArray) { - return isArray(valueOrArray) ? first(valueOrArray) : valueOrArray; -} -function getNameForExportedSymbol(symbol, scriptTarget, preferCapitalized) { - if (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */) { - return getDefaultLikeExportNameFromDeclaration(symbol) || moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget, !!preferCapitalized); - } - return symbol.name; -} -function getDefaultLikeExportNameFromDeclaration(symbol) { - 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; - } - const name = (_c = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _c.text; - if (name) { - return name; - } - if (symbol.parent && !isExternalModuleSymbol(symbol.parent)) { - return symbol.parent.getName(); - } - }); -} -function getSymbolParentOrFail(symbol) { - var _a; - return Debug.checkDefined( - symbol.parent, - `Symbol parent was undefined. Flags: ${Debug.formatSymbolFlags(symbol.flags)}. Declarations: ${(_a = symbol.declarations) == null ? void 0 : _a.map((d) => { - const kind = Debug.formatSyntaxKind(d.kind); - const inJS = isInJSFile(d); - const { expression } = d; - return (inJS ? "[JS]" : "") + kind + (expression ? ` (expression: ${Debug.formatSyntaxKind(expression.kind)})` : ""); - }).join(", ")}.` - ); -} -function moduleSymbolToValidIdentifier(moduleSymbol, target, forceCapitalize) { - return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes(moduleSymbol.name)), target, forceCapitalize); -} -function moduleSpecifierToValidIdentifier(moduleSpecifier, target, forceCapitalize) { - const baseName = getBaseFileName(removeSuffix(removeFileExtension(moduleSpecifier), "/index")); - let res = ""; - let lastCharWasValid = true; - const firstCharCode = baseName.charCodeAt(0); - if (isIdentifierStart(firstCharCode, target)) { - res += String.fromCharCode(firstCharCode); - if (forceCapitalize) { - res = res.toUpperCase(); - } - } else { - lastCharWasValid = false; - } - for (let i = 1; i < baseName.length; i++) { - const ch = baseName.charCodeAt(i); - const isValid = isIdentifierPart(ch, target); - if (isValid) { - let char = String.fromCharCode(ch); - if (!lastCharWasValid) { - char = char.toUpperCase(); - } - res += char; - } - lastCharWasValid = isValid; - } - return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`; -} -function stringContainsAt(haystack, needle, startIndex) { - const needleLength = needle.length; - if (needleLength + startIndex > haystack.length) { - return false; - } - for (let i = 0; i < needleLength; i++) { - if (needle.charCodeAt(i) !== haystack.charCodeAt(i + startIndex)) return false; - } - return true; -} -function startsWithUnderscore(name) { - return name.charCodeAt(0) === 95 /* _ */; -} -function isDeprecatedDeclaration(decl) { - return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 65536 /* Deprecated */); -} -function shouldUseUriStyleNodeCoreModules(file, program) { - let decisionFromFile; - for (const node of file.imports) { - if (nodeCoreModules.has(node.text) && !exclusivelyPrefixedNodeCoreModules.has(node.text)) { - if (startsWith(node.text, "node:")) { - return true; - } else { - decisionFromFile = false; - } - } - } - return decisionFromFile ?? program.usesUriStyleNodeCoreModules; -} -function getNewLineKind(newLineCharacter) { - return newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; -} -function diagnosticToString(diag2) { - return isArray(diag2) ? formatStringFromArgs(getLocaleSpecificMessage(diag2[0]), diag2.slice(1)) : getLocaleSpecificMessage(diag2); -} -function getFormatCodeSettingsForWriting({ options }, sourceFile) { - const shouldAutoDetectSemicolonPreference = !options.semicolons || options.semicolons === "ignore" /* Ignore */; - const shouldRemoveSemicolons = options.semicolons === "remove" /* Remove */ || shouldAutoDetectSemicolonPreference && !probablyUsesSemicolons(sourceFile); - return { - ...options, - semicolons: shouldRemoveSemicolons ? "remove" /* Remove */ : "ignore" /* Ignore */ - }; -} -function jsxModeNeedsExplicitImport(jsx) { - return jsx === 2 /* React */ || jsx === 3 /* ReactNative */; -} -function isSourceFileFromLibrary(program, node) { - return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); -} -function newCaseClauseTracker(checker, clauses) { - const existingStrings = /* @__PURE__ */ new Set(); - const existingNumbers = /* @__PURE__ */ new Set(); - const existingBigInts = /* @__PURE__ */ new Set(); - for (const clause of clauses) { - if (!isDefaultClause(clause)) { - const expression = skipParentheses(clause.expression); - if (isLiteralExpression(expression)) { - switch (expression.kind) { - case 15 /* NoSubstitutionTemplateLiteral */: - case 11 /* StringLiteral */: - existingStrings.add(expression.text); - break; - case 9 /* NumericLiteral */: - existingNumbers.add(parseInt(expression.text)); - break; - case 10 /* BigIntLiteral */: - const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); - if (parsedBigInt) { - existingBigInts.add(pseudoBigIntToString(parsedBigInt)); - } - break; - } - } else { - const symbol = checker.getSymbolAtLocation(clause.expression); - if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { - const enumValue = checker.getConstantValue(symbol.valueDeclaration); - if (enumValue !== void 0) { - addValue(enumValue); - } - } - } - } - } - return { - addValue, - hasValue - }; - function addValue(value) { - switch (typeof value) { - case "string": - existingStrings.add(value); - break; - case "number": - existingNumbers.add(value); - } - } - function hasValue(value) { - switch (typeof value) { - case "string": - return existingStrings.has(value); - case "number": - return existingNumbers.has(value); - case "object": - return existingBigInts.has(pseudoBigIntToString(value)); - } - } -} -function fileShouldUseJavaScriptRequire(file, program, host, preferRequire) { - var _a; - const fileName = typeof file === "string" ? file : file.fileName; - if (!hasJSFileExtension(fileName)) { - return false; - } - const compilerOptions = typeof file === "string" ? program.getCompilerOptions() : program.getCompilerOptionsForFile(file); - const moduleKind = getEmitModuleKind(compilerOptions); - const sourceFileLike = typeof file === "string" ? { - fileName: file, - impliedNodeFormat: getImpliedNodeFormatForFile(toPath(file, host.getCurrentDirectory(), hostGetCanonicalFileName(host)), (_a = program.getPackageJsonInfoCache) == null ? void 0 : _a.call(program), host, compilerOptions) - } : file; - const impliedNodeFormat = getImpliedNodeFormatForEmitWorker(sourceFileLike, compilerOptions); - if (impliedNodeFormat === 99 /* ESNext */) { - return false; - } - if (impliedNodeFormat === 1 /* CommonJS */) { - return true; - } - if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { - return true; - } - if (compilerOptions.verbatimModuleSyntax && emitModuleKindIsNonNodeESM(moduleKind)) { - return false; - } - if (typeof file === "object") { - if (file.commonJsModuleIndicator) { - return true; - } - if (file.externalModuleIndicator) { - return false; - } - } - return preferRequire; -} -function isBlockLike(node) { - switch (node.kind) { - case 242 /* Block */: - case 308 /* SourceFile */: - case 269 /* ModuleBlock */: - case 297 /* CaseClause */: - return true; - default: - return false; - } -} -function createFutureSourceFile(fileName, syntaxModuleIndicator, program, moduleResolutionHost) { - var _a; - const result = getImpliedNodeFormatForFileWorker(fileName, (_a = program.getPackageJsonInfoCache) == null ? void 0 : _a.call(program), moduleResolutionHost, program.getCompilerOptions()); - let impliedNodeFormat, packageJsonScope; - if (typeof result === "object") { - impliedNodeFormat = result.impliedNodeFormat; - packageJsonScope = result.packageJsonScope; - } - return { - path: toPath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName), - fileName, - externalModuleIndicator: syntaxModuleIndicator === 99 /* ESNext */ ? true : void 0, - commonJsModuleIndicator: syntaxModuleIndicator === 1 /* CommonJS */ ? true : void 0, - impliedNodeFormat, - packageJsonScope, - statements: emptyArray, - imports: emptyArray - }; -} - -// src/services/exportInfoMap.ts -var ImportKind = /* @__PURE__ */ ((ImportKind2) => { - ImportKind2[ImportKind2["Named"] = 0] = "Named"; - ImportKind2[ImportKind2["Default"] = 1] = "Default"; - ImportKind2[ImportKind2["Namespace"] = 2] = "Namespace"; - ImportKind2[ImportKind2["CommonJS"] = 3] = "CommonJS"; - return ImportKind2; -})(ImportKind || {}); -var ExportKind = /* @__PURE__ */ ((ExportKind3) => { - ExportKind3[ExportKind3["Named"] = 0] = "Named"; - ExportKind3[ExportKind3["Default"] = 1] = "Default"; - ExportKind3[ExportKind3["ExportEquals"] = 2] = "ExportEquals"; - ExportKind3[ExportKind3["UMD"] = 3] = "UMD"; - ExportKind3[ExportKind3["Module"] = 4] = "Module"; - return ExportKind3; -})(ExportKind || {}); -function createCacheableExportInfoMap(host) { - let exportInfoId = 1; - const exportInfo = createMultiMap(); - const symbols = /* @__PURE__ */ new Map(); - const packages = /* @__PURE__ */ new Map(); - let usableByFileName; - const cache = { - isUsableByFile: (importingFile) => importingFile === usableByFileName, - isEmpty: () => !exportInfo.size, - clear: () => { - exportInfo.clear(); - symbols.clear(); - usableByFileName = void 0; - }, - add: (importingFile, symbol, symbolTableKey, moduleSymbol, moduleFile, exportKind, isFromPackageJson, checker) => { - if (importingFile !== usableByFileName) { - cache.clear(); - usableByFileName = importingFile; - } - let packageName; - if (moduleFile) { - const nodeModulesPathParts = getNodeModulePathParts(moduleFile.fileName); - if (nodeModulesPathParts) { - const { topLevelNodeModulesIndex, topLevelPackageNameIndex, packageRootIndex } = nodeModulesPathParts; - packageName = unmangleScopedPackageName(getPackageNameFromTypesPackageName(moduleFile.fileName.substring(topLevelPackageNameIndex + 1, packageRootIndex))); - if (startsWith(importingFile, moduleFile.path.substring(0, topLevelNodeModulesIndex))) { - const prevDeepestNodeModulesPath = packages.get(packageName); - const nodeModulesPath = moduleFile.fileName.substring(0, topLevelPackageNameIndex + 1); - if (prevDeepestNodeModulesPath) { - const prevDeepestNodeModulesIndex = prevDeepestNodeModulesPath.indexOf(nodeModulesPathPart); - if (topLevelNodeModulesIndex > prevDeepestNodeModulesIndex) { - packages.set(packageName, nodeModulesPath); - } - } else { - packages.set(packageName, nodeModulesPath); - } - } - } - } - const isDefault = exportKind === 1 /* Default */; - const namedSymbol = isDefault && getLocalSymbolForExportDefault(symbol) || symbol; - const names = exportKind === 0 /* Named */ || isExternalModuleSymbol(namedSymbol) ? unescapeLeadingUnderscores(symbolTableKey) : getNamesForExportedSymbol( - namedSymbol, - checker, - /*scriptTarget*/ - void 0 - ); - const symbolName2 = typeof names === "string" ? names : names[0]; - const capitalizedSymbolName = typeof names === "string" ? void 0 : names[1]; - const moduleName = stripQuotes(moduleSymbol.name); - const id = exportInfoId++; - const target = skipAlias(symbol, checker); - const storedSymbol = symbol.flags & 33554432 /* Transient */ ? void 0 : symbol; - const storedModuleSymbol = moduleSymbol.flags & 33554432 /* Transient */ ? void 0 : moduleSymbol; - if (!storedSymbol || !storedModuleSymbol) symbols.set(id, [symbol, moduleSymbol]); - exportInfo.add(key(symbolName2, symbol, isExternalModuleNameRelative(moduleName) ? void 0 : moduleName, checker), { - id, - symbolTableKey, - symbolName: symbolName2, - capitalizedSymbolName, - moduleName, - moduleFile, - moduleFileName: moduleFile == null ? void 0 : moduleFile.fileName, - packageName, - exportKind, - targetFlags: target.flags, - isFromPackageJson, - symbol: storedSymbol, - moduleSymbol: storedModuleSymbol - }); - }, - get: (importingFile, key2) => { - if (importingFile !== usableByFileName) return; - const result = exportInfo.get(key2); - return result == null ? void 0 : result.map(rehydrateCachedInfo); - }, - search: (importingFile, preferCapitalized, matches, action) => { - if (importingFile !== usableByFileName) return; - return forEachEntry(exportInfo, (info, key2) => { - const { symbolName: symbolName2, ambientModuleName } = parseKey(key2); - const name = preferCapitalized && info[0].capitalizedSymbolName || symbolName2; - if (matches(name, info[0].targetFlags)) { - const rehydrated = info.map(rehydrateCachedInfo); - const filtered = rehydrated.filter((r, i) => isNotShadowedByDeeperNodeModulesPackage(r, info[i].packageName)); - if (filtered.length) { - const res = action(filtered, name, !!ambientModuleName, key2); - if (res !== void 0) return res; - } - } - }); - }, - releaseSymbols: () => { - symbols.clear(); - }, - onFileChanged: (oldSourceFile, newSourceFile, typeAcquisitionEnabled) => { - if (fileIsGlobalOnly(oldSourceFile) && fileIsGlobalOnly(newSourceFile)) { - return false; - } - if (usableByFileName && usableByFileName !== newSourceFile.path || // If ATA is enabled, auto-imports uses existing imports to guess whether you want auto-imports from node. - // Adding or removing imports from node could change the outcome of that guess, so could change the suggestions list. - typeAcquisitionEnabled && consumesNodeCoreModules(oldSourceFile) !== consumesNodeCoreModules(newSourceFile) || // Module agumentation and ambient module changes can add or remove exports available to be auto-imported. - // Changes elsewhere in the file can change the *type* of an export in a module augmentation, - // but type info is gathered in getCompletionEntryDetails, which doesn't use the cache. - !arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations) || !ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile)) { - cache.clear(); - return true; - } - usableByFileName = newSourceFile.path; - return false; - } - }; - if (Debug.isDebugging) { - Object.defineProperty(cache, "__cache", { value: exportInfo }); - } - return cache; - function rehydrateCachedInfo(info) { - if (info.symbol && info.moduleSymbol) return info; - const { id, exportKind, targetFlags, isFromPackageJson, moduleFileName } = info; - const [cachedSymbol, cachedModuleSymbol] = symbols.get(id) || emptyArray; - if (cachedSymbol && cachedModuleSymbol) { - return { - symbol: cachedSymbol, - moduleSymbol: cachedModuleSymbol, - moduleFileName, - exportKind, - targetFlags, - isFromPackageJson - }; - } - 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 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}` - ); - symbols.set(id, [symbol, moduleSymbol]); - return { - symbol, - moduleSymbol, - moduleFileName, - exportKind, - targetFlags, - isFromPackageJson - }; - } - function key(importedName, symbol, ambientModuleName, checker) { - const moduleKey = ambientModuleName || ""; - return `${importedName.length} ${getSymbolId(skipAlias(symbol, checker))} ${importedName} ${moduleKey}`; - } - function parseKey(key2) { - 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 }; - } - function fileIsGlobalOnly(file) { - return !file.commonJsModuleIndicator && !file.externalModuleIndicator && !file.moduleAugmentations && !file.ambientModuleNames; - } - function ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile) { - if (!arrayIsEqualTo(oldSourceFile.ambientModuleNames, newSourceFile.ambientModuleNames)) { - return false; - } - let oldFileStatementIndex = -1; - let newFileStatementIndex = -1; - for (const ambientModuleName of newSourceFile.ambientModuleNames) { - const isMatchingModuleDeclaration = (node) => isNonGlobalAmbientModule(node) && node.name.text === ambientModuleName; - oldFileStatementIndex = findIndex(oldSourceFile.statements, isMatchingModuleDeclaration, oldFileStatementIndex + 1); - newFileStatementIndex = findIndex(newSourceFile.statements, isMatchingModuleDeclaration, newFileStatementIndex + 1); - if (oldSourceFile.statements[oldFileStatementIndex] !== newSourceFile.statements[newFileStatementIndex]) { - return false; - } - } - return true; - } - function isNotShadowedByDeeperNodeModulesPackage(info, packageName) { - if (!packageName || !info.moduleFileName) return true; - const typingsCacheLocation = host.getGlobalTypingsCacheLocation(); - if (typingsCacheLocation && startsWith(info.moduleFileName, typingsCacheLocation)) return true; - const packageDeepestNodeModulesPath = packages.get(packageName); - return !packageDeepestNodeModulesPath || startsWith(info.moduleFileName, packageDeepestNodeModulesPath); - } -} -function isImportable(program, fromFile, toFile, toModule, preferences, packageJsonFilter, moduleSpecifierResolutionHost, moduleSpecifierCache) { - var _a; - if (!toFile) { - let useNodePrefix; - const moduleName = stripQuotes(toModule.name); - if (nodeCoreModules.has(moduleName) && (useNodePrefix = shouldUseUriStyleNodeCoreModules(fromFile, program)) !== void 0) { - return useNodePrefix === startsWith(moduleName, "node:"); - } - return !packageJsonFilter || packageJsonFilter.allowsImportingAmbientModule(toModule, moduleSpecifierResolutionHost) || fileContainsPackageImport(fromFile, moduleName); - } - Debug.assertIsDefined(toFile); - if (fromFile === toFile) return false; - const cachedResult = moduleSpecifierCache == null ? void 0 : moduleSpecifierCache.get(fromFile.path, toFile.path, preferences, {}); - if ((cachedResult == null ? void 0 : cachedResult.isBlockedByPackageJsonDependencies) !== void 0) { - return !cachedResult.isBlockedByPackageJsonDependencies || !!cachedResult.packageName && fileContainsPackageImport(fromFile, cachedResult.packageName); - } - const getCanonicalFileName = hostGetCanonicalFileName(moduleSpecifierResolutionHost); - const globalTypingsCache = (_a = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) == null ? void 0 : _a.call(moduleSpecifierResolutionHost); - const hasImportablePath = !!ts_moduleSpecifiers_exports.forEachFileNameOfModule( - fromFile.fileName, - toFile.fileName, - moduleSpecifierResolutionHost, - /*preferSymlinks*/ - false, - (toPath3) => { - const file = program.getSourceFile(toPath3); - return (file === toFile || !file) && isImportablePath( - fromFile.fileName, - toPath3, - getCanonicalFileName, - globalTypingsCache, - moduleSpecifierResolutionHost - ); - } - ); - if (packageJsonFilter) { - const importInfo = hasImportablePath ? packageJsonFilter.getSourceFileInfo(toFile, moduleSpecifierResolutionHost) : void 0; - moduleSpecifierCache == null ? void 0 : moduleSpecifierCache.setBlockedByPackageJsonDependencies(fromFile.path, toFile.path, preferences, {}, importInfo == null ? void 0 : importInfo.packageName, !(importInfo == null ? void 0 : importInfo.importable)); - return !!(importInfo == null ? void 0 : importInfo.importable) || hasImportablePath && !!(importInfo == null ? void 0 : importInfo.packageName) && fileContainsPackageImport(fromFile, importInfo.packageName); - } - return hasImportablePath; -} -function fileContainsPackageImport(sourceFile, packageName) { - return sourceFile.imports && sourceFile.imports.some((i) => i.text === packageName || i.text.startsWith(packageName + "/")); -} -function isImportablePath(fromPath, toPath3, getCanonicalFileName, globalCachePath, host) { - const toNodeModules = forEachAncestorDirectoryStoppingAtGlobalCache( - host, - toPath3, - (ancestor) => getBaseFileName(ancestor) === "node_modules" ? ancestor : void 0 - ); - const toNodeModulesParent = toNodeModules && getDirectoryPath(getCanonicalFileName(toNodeModules)); - return toNodeModulesParent === void 0 || startsWith(getCanonicalFileName(fromPath), toNodeModulesParent) || !!globalCachePath && startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent); -} -function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) { - var _a, _b; - const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); - const excludePatterns = preferences.autoImportFileExcludePatterns && getIsExcludedPatterns(preferences, useCaseSensitiveFileNames2); - forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, host, (module2, file) => cb( - module2, - file, - program, - /*isFromPackageJson*/ - false - )); - const autoImportProvider = useAutoImportProvider && ((_a = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a.call(host)); - if (autoImportProvider) { - const start = timestamp(); - const checker = program.getTypeChecker(); - forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, host, (module2, file) => { - if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName( - module2.name, - /*location*/ - void 0, - 1536 /* Module */, - /*excludeGlobals*/ - false - )) { - cb( - module2, - file, - autoImportProvider, - /*isFromPackageJson*/ - true - ); - } - }); - (_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start}`); - } -} -function getIsExcludedPatterns(preferences, useCaseSensitiveFileNames2) { - return mapDefined(preferences.autoImportFileExcludePatterns, (spec) => { - const pattern = getSubPatternFromSpec(spec, "", "exclude"); - return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0; - }); -} -function forEachExternalModule(checker, allSourceFiles, excludePatterns, host, cb) { - var _a; - const isExcluded = excludePatterns && getIsExcluded(excludePatterns, host); - for (const ambient of checker.getAmbientModules()) { - if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile()))))) { - cb( - ambient, - /*sourceFile*/ - void 0 - ); - } - } - for (const sourceFile of allSourceFiles) { - if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile))) { - cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile); - } - } -} -function getIsExcluded(excludePatterns, host) { - var _a; - const realpathsWithSymlinks = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath(); - return ({ 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 forEachAncestorDirectoryStoppingAtGlobalCache( - host, - 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; - }; -} -function getIsFileExcluded(host, preferences) { - if (!preferences.autoImportFileExcludePatterns) return () => false; - return getIsExcluded(getIsExcludedPatterns(preferences, hostUsesCaseSensitiveFileNames(host)), host); -} -function getExportInfoMap(importingFile, host, program, preferences, cancellationToken) { - var _a, _b, _c, _d, _e; - const start = timestamp(); - (_a = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a.call(host); - const cache = ((_b = host.getCachedExportInfoMap) == null ? void 0 : _b.call(host)) || createCacheableExportInfoMap({ - getCurrentProgram: () => program, - getPackageJsonAutoImportProvider: () => { - var _a2; - return (_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host); - }, - getGlobalTypingsCacheLocation: () => { - var _a2; - return (_a2 = host.getGlobalTypingsCacheLocation) == null ? void 0 : _a2.call(host); - } - }); - if (cache.isUsableByFile(importingFile.path)) { - (_c = host.log) == null ? void 0 : _c.call(host, "getExportInfoMap: cache hit"); - return cache; - } - (_d = host.log) == null ? void 0 : _d.call(host, "getExportInfoMap: cache miss or empty; calculating new results"); - let moduleCount = 0; - try { - forEachExternalModuleToImportFrom( - program, - host, - preferences, - /*useAutoImportProvider*/ - true, - (moduleSymbol, moduleFile, program2, isFromPackageJson) => { - if (++moduleCount % 100 === 0) cancellationToken == null ? void 0 : cancellationToken.throwIfCancellationRequested(); - const seenExports = /* @__PURE__ */ new Set(); - const checker = program2.getTypeChecker(); - const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker); - if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) { - cache.add( - importingFile.path, - defaultInfo.symbol, - defaultInfo.exportKind === 1 /* Default */ ? "default" /* Default */ : "export=" /* ExportEquals */, - moduleSymbol, - moduleFile, - defaultInfo.exportKind, - isFromPackageJson, - checker - ); - } - checker.forEachExportAndPropertyOfModule(moduleSymbol, (exported, key) => { - if (exported !== (defaultInfo == null ? void 0 : defaultInfo.symbol) && isImportableSymbol(exported, checker) && addToSeen(seenExports, key)) { - cache.add( - importingFile.path, - exported, - key, - moduleSymbol, - moduleFile, - 0 /* Named */, - isFromPackageJson, - checker - ); - } - }); - } - ); - } catch (err) { - cache.clear(); - throw err; - } - (_e = host.log) == null ? void 0 : _e.call(host, `getExportInfoMap: done in ${timestamp() - start} ms`); - return cache; -} -function getDefaultLikeExportInfo(moduleSymbol, checker) { - const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol); - if (exportEquals !== moduleSymbol) { - const defaultExport2 = checker.tryGetMemberInModuleExports("default" /* Default */, exportEquals); - if (defaultExport2) return { symbol: defaultExport2, exportKind: 1 /* Default */ }; - return { symbol: exportEquals, exportKind: 2 /* ExportEquals */ }; - } - const defaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol); - if (defaultExport) return { symbol: defaultExport, exportKind: 1 /* Default */ }; -} -function isImportableSymbol(symbol, checker) { - return !checker.isUndefinedSymbol(symbol) && !checker.isUnknownSymbol(symbol) && !isKnownSymbol(symbol) && !isPrivateIdentifierSymbol(symbol); -} -function getNamesForExportedSymbol(defaultExport, checker, scriptTarget) { - let names; - forEachNameOfDefaultExport(defaultExport, checker, scriptTarget, (name, capitalizedName) => { - names = capitalizedName ? [name, capitalizedName] : name; - return true; - }); - return Debug.checkDefined(names); -} -function forEachNameOfDefaultExport(defaultExport, checker, scriptTarget, cb) { - let chain; - let current = defaultExport; - const seen = /* @__PURE__ */ new Set(); - while (current) { - const fromDeclaration = getDefaultLikeExportNameFromDeclaration(current); - if (fromDeclaration) { - const final = cb(fromDeclaration); - if (final) return final; - } - if (current.escapedName !== "default" /* Default */ && current.escapedName !== "export=" /* ExportEquals */) { - const final = cb(current.name); - if (final) return final; - } - chain = append(chain, current); - if (!addToSeen(seen, current)) break; - current = current.flags & 2097152 /* Alias */ ? checker.getImmediateAliasedSymbol(current) : void 0; - } - for (const symbol of chain ?? emptyArray) { - if (symbol.parent && isExternalModuleSymbol(symbol.parent)) { - const final = cb( - moduleSymbolToValidIdentifier( - symbol.parent, - scriptTarget, - /*forceCapitalize*/ - false - ), - moduleSymbolToValidIdentifier( - symbol.parent, - scriptTarget, - /*forceCapitalize*/ - true - ) - ); - if (final) return final; - } - } -} - -// src/services/classifier.ts -function createClassifier() { - const scanner2 = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - false - ); - function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { - return convertClassificationsToResult(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); - } - function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) { - let token = 0 /* Unknown */; - let lastNonTriviaToken = 0 /* Unknown */; - const templateStack = []; - const { prefix, pushTemplate } = getPrefixFromLexState(lexState); - text = prefix + text; - const offset = prefix.length; - if (pushTemplate) { - templateStack.push(16 /* TemplateHead */); - } - scanner2.setText(text); - let endOfLineState = 0 /* None */; - const spans = []; - let angleBracketStack = 0; - do { - token = scanner2.scan(); - if (!isTrivia(token)) { - handleToken(); - lastNonTriviaToken = token; - } - const end = scanner2.getTokenEnd(); - pushEncodedClassification(scanner2.getTokenStart(), end, offset, classFromKind(token), spans); - if (end >= text.length) { - const end2 = getNewEndOfLineState(scanner2, token, lastOrUndefined(templateStack)); - if (end2 !== void 0) { - endOfLineState = end2; - } - } - } while (token !== 1 /* EndOfFileToken */); - function handleToken() { - switch (token) { - case 44 /* SlashToken */: - case 69 /* SlashEqualsToken */: - if (!noRegexTable[lastNonTriviaToken] && scanner2.reScanSlashToken() === 14 /* RegularExpressionLiteral */) { - token = 14 /* RegularExpressionLiteral */; - } - break; - case 30 /* LessThanToken */: - if (lastNonTriviaToken === 80 /* Identifier */) { - angleBracketStack++; - } - break; - case 32 /* GreaterThanToken */: - if (angleBracketStack > 0) { - angleBracketStack--; - } - break; - case 133 /* AnyKeyword */: - case 154 /* StringKeyword */: - case 150 /* NumberKeyword */: - case 136 /* BooleanKeyword */: - case 155 /* SymbolKeyword */: - if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - token = 80 /* Identifier */; - } - break; - case 16 /* TemplateHead */: - templateStack.push(token); - break; - case 19 /* OpenBraceToken */: - if (templateStack.length > 0) { - templateStack.push(token); - } - break; - case 20 /* CloseBraceToken */: - if (templateStack.length > 0) { - const lastTemplateStackToken = lastOrUndefined(templateStack); - if (lastTemplateStackToken === 16 /* TemplateHead */) { - token = scanner2.reScanTemplateToken( - /*isTaggedTemplate*/ - false - ); - if (token === 18 /* TemplateTail */) { - templateStack.pop(); - } else { - Debug.assertEqual(token, 17 /* TemplateMiddle */, "Should have been a template middle."); - } - } else { - Debug.assertEqual(lastTemplateStackToken, 19 /* OpenBraceToken */, "Should have been an open brace"); - templateStack.pop(); - } - } - break; - default: - if (!isKeyword(token)) { - break; - } - if (lastNonTriviaToken === 25 /* DotToken */) { - token = 80 /* Identifier */; - } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 80 /* Identifier */; - } - } - } - return { endOfLineState, spans }; - } - return { getClassificationsForLine, getEncodedLexicalClassifications }; -} -var 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 -); -function getNewEndOfLineState(scanner2, token, lastOnTemplateStack) { - switch (token) { - case 11 /* StringLiteral */: { - if (!scanner2.isUnterminated()) return void 0; - const tokenText = scanner2.getTokenText(); - const lastCharIndex = tokenText.length - 1; - let numBackslashes = 0; - while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92 /* backslash */) { - numBackslashes++; - } - if ((numBackslashes & 1) === 0) return void 0; - return tokenText.charCodeAt(0) === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */; - } - case 3 /* MultiLineCommentTrivia */: - return scanner2.isUnterminated() ? 1 /* InMultiLineCommentTrivia */ : void 0; - default: - if (isTemplateLiteralKind(token)) { - if (!scanner2.isUnterminated()) { - return void 0; - } - switch (token) { - case 18 /* TemplateTail */: - return 5 /* InTemplateMiddleOrTail */; - case 15 /* NoSubstitutionTemplateLiteral */: - return 4 /* InTemplateHeadOrNoSubstitutionTemplate */; - default: - return Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); - } - } - return lastOnTemplateStack === 16 /* TemplateHead */ ? 6 /* InTemplateSubstitutionPosition */ : void 0; - } -} -function pushEncodedClassification(start, end, offset, classification, result) { - if (classification === 8 /* whiteSpace */) { - return; - } - if (start === 0 && offset > 0) { - start += offset; - } - const length2 = end - start; - if (length2 > 0) { - result.push(start - offset, length2, classification); - } -} -function convertClassificationsToResult(classifications, text) { - const entries = []; - const dense = classifications.spans; - let lastEnd = 0; - for (let i = 0; i < dense.length; i += 3) { - const start = dense[i]; - const length2 = dense[i + 1]; - const type = dense[i + 2]; - if (lastEnd >= 0) { - const whitespaceLength2 = start - lastEnd; - if (whitespaceLength2 > 0) { - entries.push({ length: whitespaceLength2, classification: 4 /* Whitespace */ }); - } - } - entries.push({ length: length2, classification: convertClassification(type) }); - lastEnd = start + length2; - } - const whitespaceLength = text.length - lastEnd; - if (whitespaceLength > 0) { - entries.push({ length: whitespaceLength, classification: 4 /* Whitespace */ }); - } - return { entries, finalLexState: classifications.endOfLineState }; -} -function convertClassification(type) { - switch (type) { - case 1 /* comment */: - return 3 /* Comment */; - case 3 /* keyword */: - return 1 /* Keyword */; - case 4 /* numericLiteral */: - return 6 /* NumberLiteral */; - case 25 /* bigintLiteral */: - return 7 /* BigIntLiteral */; - case 5 /* operator */: - return 2 /* Operator */; - case 6 /* stringLiteral */: - return 8 /* StringLiteral */; - case 8 /* whiteSpace */: - return 4 /* Whitespace */; - case 10 /* punctuation */: - return 0 /* Punctuation */; - case 2 /* identifier */: - case 11 /* className */: - case 12 /* enumName */: - case 13 /* interfaceName */: - case 14 /* moduleName */: - case 15 /* typeParameterName */: - case 16 /* typeAliasName */: - case 9 /* text */: - case 17 /* parameterName */: - return 5 /* Identifier */; - default: - return void 0; - } -} -function canFollow(keyword1, keyword2) { - if (!isAccessibilityModifier(keyword1)) { - return true; - } - switch (keyword2) { - case 139 /* GetKeyword */: - case 153 /* SetKeyword */: - case 137 /* ConstructorKeyword */: - case 126 /* StaticKeyword */: - case 129 /* AccessorKeyword */: - return true; - // Allow things like "public get", "public constructor" and "public static". - default: - return false; - } -} -function getPrefixFromLexState(lexState) { - switch (lexState) { - case 3 /* InDoubleQuoteStringLiteral */: - return { prefix: '"\\\n' }; - case 2 /* InSingleQuoteStringLiteral */: - return { prefix: "'\\\n" }; - case 1 /* InMultiLineCommentTrivia */: - return { prefix: "/*\n" }; - case 4 /* InTemplateHeadOrNoSubstitutionTemplate */: - return { prefix: "`\n" }; - case 5 /* InTemplateMiddleOrTail */: - return { prefix: "}\n", pushTemplate: true }; - case 6 /* InTemplateSubstitutionPosition */: - return { prefix: "", pushTemplate: true }; - case 0 /* None */: - return { prefix: "" }; - default: - return Debug.assertNever(lexState); - } -} -function isBinaryExpressionOperatorToken(token) { - switch (token) { - case 42 /* AsteriskToken */: - case 44 /* SlashToken */: - case 45 /* PercentToken */: - case 40 /* PlusToken */: - case 41 /* MinusToken */: - case 48 /* LessThanLessThanToken */: - case 49 /* GreaterThanGreaterThanToken */: - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - case 30 /* LessThanToken */: - case 32 /* GreaterThanToken */: - case 33 /* LessThanEqualsToken */: - case 34 /* GreaterThanEqualsToken */: - case 104 /* InstanceOfKeyword */: - case 103 /* InKeyword */: - case 130 /* AsKeyword */: - case 152 /* SatisfiesKeyword */: - case 35 /* EqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - case 37 /* EqualsEqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - case 51 /* AmpersandToken */: - case 53 /* CaretToken */: - case 52 /* BarToken */: - case 56 /* AmpersandAmpersandToken */: - case 57 /* BarBarToken */: - case 75 /* BarEqualsToken */: - case 74 /* AmpersandEqualsToken */: - case 79 /* CaretEqualsToken */: - case 71 /* LessThanLessThanEqualsToken */: - case 72 /* GreaterThanGreaterThanEqualsToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 65 /* PlusEqualsToken */: - case 66 /* MinusEqualsToken */: - case 67 /* AsteriskEqualsToken */: - case 69 /* SlashEqualsToken */: - case 70 /* PercentEqualsToken */: - case 64 /* EqualsToken */: - case 28 /* CommaToken */: - case 61 /* QuestionQuestionToken */: - case 76 /* BarBarEqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - return true; - default: - return false; - } -} -function isPrefixUnaryExpressionOperatorToken(token) { - switch (token) { - case 40 /* PlusToken */: - case 41 /* MinusToken */: - case 55 /* TildeToken */: - case 54 /* ExclamationToken */: - case 46 /* PlusPlusToken */: - case 47 /* MinusMinusToken */: - return true; - default: - return false; - } -} -function classFromKind(token) { - if (isKeyword(token)) { - return 3 /* keyword */; - } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return 5 /* operator */; - } else if (token >= 19 /* FirstPunctuation */ && token <= 79 /* LastPunctuation */) { - return 10 /* punctuation */; - } - switch (token) { - case 9 /* NumericLiteral */: - return 4 /* numericLiteral */; - case 10 /* BigIntLiteral */: - return 25 /* bigintLiteral */; - case 11 /* StringLiteral */: - return 6 /* stringLiteral */; - case 14 /* RegularExpressionLiteral */: - return 7 /* regularExpressionLiteral */; - case 7 /* ConflictMarkerTrivia */: - case 3 /* MultiLineCommentTrivia */: - case 2 /* SingleLineCommentTrivia */: - return 1 /* comment */; - case 5 /* WhitespaceTrivia */: - case 4 /* NewLineTrivia */: - return 8 /* whiteSpace */; - case 80 /* Identifier */: - default: - if (isTemplateLiteralKind(token)) { - return 6 /* stringLiteral */; - } - return 2 /* identifier */; - } -} -function getSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) { - return convertClassificationsToSpans(getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span)); -} -function checkForClassificationCancellation(cancellationToken, kind) { - switch (kind) { - case 268 /* ModuleDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 263 /* FunctionDeclaration */: - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } -} -function getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) { - const spans = []; - sourceFile.forEachChild(function cb(node) { - if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { - return; - } - checkForClassificationCancellation(cancellationToken, node.kind); - if (isIdentifier(node) && !nodeIsMissing(node) && classifiableNames.has(node.escapedText)) { - const symbol = typeChecker.getSymbolAtLocation(node); - const type = symbol && classifySymbol(symbol, getMeaningFromLocation(node), typeChecker); - if (type) { - pushClassification(node.getStart(sourceFile), node.getEnd(), type); - } - } - node.forEachChild(cb); - }); - return { spans, endOfLineState: 0 /* None */ }; - function pushClassification(start, end, type) { - const length2 = end - start; - Debug.assert(length2 > 0, `Classification had non-positive length of ${length2}`); - spans.push(start); - spans.push(length2); - spans.push(type); - } -} -function classifySymbol(symbol, meaningAtPosition, checker) { - const flags = symbol.getFlags(); - if ((flags & 2885600 /* Classifiable */) === 0 /* None */) { - return void 0; - } else if (flags & 32 /* Class */) { - return 11 /* className */; - } else if (flags & 384 /* Enum */) { - return 12 /* enumName */; - } else if (flags & 524288 /* TypeAlias */) { - return 16 /* typeAliasName */; - } else if (flags & 1536 /* Module */) { - return meaningAtPosition & 4 /* Namespace */ || meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol) ? 14 /* moduleName */ : void 0; - } else if (flags & 2097152 /* Alias */) { - return classifySymbol(checker.getAliasedSymbol(symbol), meaningAtPosition, checker); - } else if (meaningAtPosition & 2 /* Type */) { - return flags & 64 /* Interface */ ? 13 /* interfaceName */ : flags & 262144 /* TypeParameter */ ? 15 /* typeParameterName */ : void 0; - } else { - return void 0; - } -} -function hasValueSideModule(symbol) { - return some(symbol.declarations, (declaration) => isModuleDeclaration(declaration) && getModuleInstanceState(declaration) === 1 /* Instantiated */); -} -function getClassificationTypeName(type) { - switch (type) { - case 1 /* comment */: - return "comment" /* comment */; - case 2 /* identifier */: - return "identifier" /* identifier */; - case 3 /* keyword */: - return "keyword" /* keyword */; - case 4 /* numericLiteral */: - return "number" /* numericLiteral */; - case 25 /* bigintLiteral */: - return "bigint" /* bigintLiteral */; - case 5 /* operator */: - return "operator" /* operator */; - case 6 /* stringLiteral */: - return "string" /* stringLiteral */; - case 8 /* whiteSpace */: - return "whitespace" /* whiteSpace */; - case 9 /* text */: - return "text" /* text */; - case 10 /* punctuation */: - return "punctuation" /* punctuation */; - case 11 /* className */: - return "class name" /* className */; - case 12 /* enumName */: - return "enum name" /* enumName */; - case 13 /* interfaceName */: - return "interface name" /* interfaceName */; - case 14 /* moduleName */: - return "module name" /* moduleName */; - case 15 /* typeParameterName */: - return "type parameter name" /* typeParameterName */; - case 16 /* typeAliasName */: - return "type alias name" /* typeAliasName */; - case 17 /* parameterName */: - return "parameter name" /* parameterName */; - case 18 /* docCommentTagName */: - return "doc comment tag name" /* docCommentTagName */; - case 19 /* jsxOpenTagName */: - return "jsx open tag name" /* jsxOpenTagName */; - case 20 /* jsxCloseTagName */: - return "jsx close tag name" /* jsxCloseTagName */; - case 21 /* jsxSelfClosingTagName */: - return "jsx self closing tag name" /* jsxSelfClosingTagName */; - case 22 /* jsxAttribute */: - return "jsx attribute" /* jsxAttribute */; - case 23 /* jsxText */: - return "jsx text" /* jsxText */; - case 24 /* jsxAttributeStringLiteralValue */: - return "jsx attribute string literal value" /* jsxAttributeStringLiteralValue */; - default: - return void 0; - } -} -function convertClassificationsToSpans(classifications) { - Debug.assert(classifications.spans.length % 3 === 0); - const dense = classifications.spans; - const result = []; - for (let i = 0; i < dense.length; i += 3) { - result.push({ - textSpan: createTextSpan(dense[i], dense[i + 1]), - classificationType: getClassificationTypeName(dense[i + 2]) - }); - } - return result; -} -function getSyntacticClassifications(cancellationToken, sourceFile, span) { - return convertClassificationsToSpans(getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)); -} -function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) { - const spanStart = span.start; - const spanLength = span.length; - const triviaScanner = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - false, - sourceFile.languageVariant, - sourceFile.text - ); - const mergeConflictScanner = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - false, - sourceFile.languageVariant, - sourceFile.text - ); - const result = []; - processElement(sourceFile); - return { spans: result, endOfLineState: 0 /* None */ }; - function pushClassification(start, length2, type) { - result.push(start); - result.push(length2); - result.push(type); - } - function classifyLeadingTriviaAndGetTokenStart(token) { - triviaScanner.resetTokenState(token.pos); - while (true) { - const start = triviaScanner.getTokenEnd(); - if (!couldStartTrivia(sourceFile.text, start)) { - return start; - } - const kind = triviaScanner.scan(); - const end = triviaScanner.getTokenEnd(); - const width = end - start; - if (!isTrivia(kind)) { - return start; - } - switch (kind) { - case 4 /* NewLineTrivia */: - case 5 /* WhitespaceTrivia */: - continue; - case 2 /* SingleLineCommentTrivia */: - case 3 /* MultiLineCommentTrivia */: - classifyComment(token, kind, start, width); - triviaScanner.resetTokenState(end); - continue; - case 7 /* ConflictMarkerTrivia */: - const text = sourceFile.text; - const ch = text.charCodeAt(start); - if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - pushClassification(start, width, 1 /* comment */); - continue; - } - Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); - classifyDisabledMergeCode(text, start, end); - break; - case 6 /* ShebangTrivia */: - break; - default: - Debug.assertNever(kind); - } - } - } - function classifyComment(token, kind, start, width) { - if (kind === 3 /* MultiLineCommentTrivia */) { - const docCommentAndDiagnostics = parseIsolatedJSDocComment(sourceFile.text, start, width); - if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDoc) { - setParent(docCommentAndDiagnostics.jsDoc, token); - classifyJSDocComment(docCommentAndDiagnostics.jsDoc); - return; - } - } else if (kind === 2 /* SingleLineCommentTrivia */) { - if (tryClassifyTripleSlashComment(start, width)) { - return; - } - } - pushCommentRange(start, width); - } - function pushCommentRange(start, width) { - pushClassification(start, width, 1 /* comment */); - } - function classifyJSDocComment(docComment) { - var _a, _b, _c, _d, _e, _f, _g, _h; - let pos = docComment.pos; - if (docComment.tags) { - for (const tag of docComment.tags) { - if (tag.pos !== pos) { - pushCommentRange(pos, tag.pos - pos); - } - pushClassification(tag.pos, 1, 10 /* punctuation */); - pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); - pos = tag.tagName.end; - let commentStart = tag.tagName.end; - switch (tag.kind) { - case 342 /* JSDocParameterTag */: - const param = tag; - processJSDocParameterTag(param); - commentStart = param.isNameFirst && ((_a = param.typeExpression) == null ? void 0 : _a.end) || param.name.end; - break; - case 349 /* JSDocPropertyTag */: - const prop = tag; - commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end; - break; - case 346 /* JSDocTemplateTag */: - processJSDocTemplateTag(tag); - pos = tag.end; - commentStart = tag.typeParameters.end; - break; - case 347 /* JSDocTypedefTag */: - const type = tag; - commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 310 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart; - break; - case 339 /* JSDocCallbackTag */: - commentStart = tag.typeExpression.end; - break; - case 345 /* JSDocTypeTag */: - processElement(tag.typeExpression); - pos = tag.end; - commentStart = tag.typeExpression.end; - break; - case 344 /* JSDocThisTag */: - case 341 /* JSDocEnumTag */: - commentStart = tag.typeExpression.end; - break; - case 343 /* JSDocReturnTag */: - processElement(tag.typeExpression); - pos = tag.end; - commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart; - break; - case 348 /* JSDocSeeTag */: - commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart; - break; - case 329 /* JSDocAugmentsTag */: - case 330 /* JSDocImplementsTag */: - commentStart = tag.class.end; - break; - case 350 /* JSDocThrowsTag */: - processElement(tag.typeExpression); - pos = tag.end; - commentStart = ((_h = tag.typeExpression) == null ? void 0 : _h.end) || commentStart; - break; - } - if (typeof tag.comment === "object") { - pushCommentRange(tag.comment.pos, tag.comment.end - tag.comment.pos); - } else if (typeof tag.comment === "string") { - pushCommentRange(commentStart, tag.end - commentStart); - } - } - } - if (pos !== docComment.end) { - pushCommentRange(pos, docComment.end - pos); - } - return; - function processJSDocParameterTag(tag) { - if (tag.isNameFirst) { - pushCommentRange(pos, tag.name.pos - pos); - pushClassification(tag.name.pos, tag.name.end - tag.name.pos, 17 /* parameterName */); - pos = tag.name.end; - } - if (tag.typeExpression) { - pushCommentRange(pos, tag.typeExpression.pos - pos); - processElement(tag.typeExpression); - pos = tag.typeExpression.end; - } - if (!tag.isNameFirst) { - pushCommentRange(pos, tag.name.pos - pos); - pushClassification(tag.name.pos, tag.name.end - tag.name.pos, 17 /* parameterName */); - pos = tag.name.end; - } - } - } - function tryClassifyTripleSlashComment(start, width) { - const tripleSlashXMLCommentRegEx = /^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/m; - const attributeRegex = /(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/g; - const text = sourceFile.text.substr(start, width); - const match = tripleSlashXMLCommentRegEx.exec(text); - if (!match) { - return false; - } - if (!match[3] || !(match[3] in commentPragmas)) { - return false; - } - let pos = start; - pushCommentRange(pos, match[1].length); - pos += match[1].length; - pushClassification(pos, match[2].length, 10 /* punctuation */); - pos += match[2].length; - pushClassification(pos, match[3].length, 21 /* jsxSelfClosingTagName */); - pos += match[3].length; - const attrText = match[4]; - let attrPos = pos; - while (true) { - const attrMatch = attributeRegex.exec(attrText); - if (!attrMatch) { - break; - } - const newAttrPos = pos + attrMatch.index + attrMatch[1].length; - if (newAttrPos > attrPos) { - pushCommentRange(attrPos, newAttrPos - attrPos); - attrPos = newAttrPos; - } - pushClassification(attrPos, attrMatch[2].length, 22 /* jsxAttribute */); - attrPos += attrMatch[2].length; - if (attrMatch[3].length) { - pushCommentRange(attrPos, attrMatch[3].length); - attrPos += attrMatch[3].length; - } - pushClassification(attrPos, attrMatch[4].length, 5 /* operator */); - attrPos += attrMatch[4].length; - if (attrMatch[5].length) { - pushCommentRange(attrPos, attrMatch[5].length); - attrPos += attrMatch[5].length; - } - pushClassification(attrPos, attrMatch[6].length, 24 /* jsxAttributeStringLiteralValue */); - attrPos += attrMatch[6].length; - } - pos += match[4].length; - if (pos > attrPos) { - pushCommentRange(attrPos, pos - attrPos); - } - if (match[5]) { - pushClassification(pos, match[5].length, 10 /* punctuation */); - pos += match[5].length; - } - const end = start + width; - if (pos < end) { - pushCommentRange(pos, end - pos); - } - return true; - } - function processJSDocTemplateTag(tag) { - for (const child of tag.getChildren()) { - processElement(child); - } - } - function classifyDisabledMergeCode(text, start, end) { - let i; - for (i = start; i < end; i++) { - if (isLineBreak(text.charCodeAt(i))) { - break; - } - } - pushClassification(start, i - start, 1 /* comment */); - mergeConflictScanner.resetTokenState(i); - while (mergeConflictScanner.getTokenEnd() < end) { - classifyDisabledCodeToken(); - } - } - function classifyDisabledCodeToken() { - const start = mergeConflictScanner.getTokenEnd(); - const tokenKind = mergeConflictScanner.scan(); - const end = mergeConflictScanner.getTokenEnd(); - const type = classifyTokenType(tokenKind); - if (type) { - pushClassification(start, end - start, type); - } - } - function tryClassifyNode(node) { - if (isJSDoc(node)) { - return true; - } - if (nodeIsMissing(node)) { - return true; - } - const classifiedElementName = tryClassifyJsxElementName(node); - if (!isToken(node) && node.kind !== 12 /* JsxText */ && classifiedElementName === void 0) { - return false; - } - const tokenStart = node.kind === 12 /* JsxText */ ? node.pos : classifyLeadingTriviaAndGetTokenStart(node); - const tokenWidth = node.end - tokenStart; - Debug.assert(tokenWidth >= 0); - if (tokenWidth > 0) { - const type = classifiedElementName || classifyTokenType(node.kind, node); - if (type) { - pushClassification(tokenStart, tokenWidth, type); - } - } - return true; - } - function tryClassifyJsxElementName(token) { - switch (token.parent && token.parent.kind) { - case 287 /* JsxOpeningElement */: - if (token.parent.tagName === token) { - return 19 /* jsxOpenTagName */; - } - break; - case 288 /* JsxClosingElement */: - if (token.parent.tagName === token) { - return 20 /* jsxCloseTagName */; - } - break; - case 286 /* JsxSelfClosingElement */: - if (token.parent.tagName === token) { - return 21 /* jsxSelfClosingTagName */; - } - break; - case 292 /* JsxAttribute */: - if (token.parent.name === token) { - return 22 /* jsxAttribute */; - } - break; - } - return void 0; - } - function classifyTokenType(tokenKind, token) { - if (isKeyword(tokenKind)) { - return 3 /* keyword */; - } - if (tokenKind === 30 /* LessThanToken */ || tokenKind === 32 /* GreaterThanToken */) { - if (token && getTypeArgumentOrTypeParameterList(token.parent)) { - return 10 /* punctuation */; - } - } - if (isPunctuation(tokenKind)) { - if (token) { - const parent2 = token.parent; - if (tokenKind === 64 /* EqualsToken */) { - if (parent2.kind === 261 /* VariableDeclaration */ || parent2.kind === 173 /* PropertyDeclaration */ || parent2.kind === 170 /* Parameter */ || parent2.kind === 292 /* JsxAttribute */) { - return 5 /* operator */; - } - } - if (parent2.kind === 227 /* BinaryExpression */ || parent2.kind === 225 /* PrefixUnaryExpression */ || parent2.kind === 226 /* PostfixUnaryExpression */ || parent2.kind === 228 /* ConditionalExpression */) { - return 5 /* operator */; - } - } - return 10 /* punctuation */; - } else if (tokenKind === 9 /* NumericLiteral */) { - return 4 /* numericLiteral */; - } else if (tokenKind === 10 /* BigIntLiteral */) { - return 25 /* bigintLiteral */; - } else if (tokenKind === 11 /* StringLiteral */) { - return token && token.parent.kind === 292 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; - } else if (tokenKind === 14 /* RegularExpressionLiteral */) { - return 6 /* stringLiteral */; - } else if (isTemplateLiteralKind(tokenKind)) { - return 6 /* stringLiteral */; - } else if (tokenKind === 12 /* JsxText */) { - return 23 /* jsxText */; - } else if (tokenKind === 80 /* Identifier */) { - if (token) { - switch (token.parent.kind) { - case 264 /* ClassDeclaration */: - if (token.parent.name === token) { - return 11 /* className */; - } - return; - case 169 /* TypeParameter */: - if (token.parent.name === token) { - return 15 /* typeParameterName */; - } - return; - case 265 /* InterfaceDeclaration */: - if (token.parent.name === token) { - return 13 /* interfaceName */; - } - return; - case 267 /* EnumDeclaration */: - if (token.parent.name === token) { - return 12 /* enumName */; - } - return; - case 268 /* ModuleDeclaration */: - if (token.parent.name === token) { - return 14 /* moduleName */; - } - return; - case 170 /* Parameter */: - if (token.parent.name === token) { - return isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; - } - return; - } - if (isConstTypeReference(token.parent)) { - return 3 /* keyword */; - } - } - return 2 /* identifier */; - } - } - function processElement(element) { - if (!element) { - return; - } - if (decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { - checkForClassificationCancellation(cancellationToken, element.kind); - for (const child of element.getChildren(sourceFile)) { - if (!tryClassifyNode(child)) { - processElement(child); - } - } - } - } -} - -// src/services/documentHighlights.ts -var DocumentHighlights; -((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))) { - const { openingElement, closingElement } = node.parent.parent; - const highlightSpans = [openingElement, closingElement].map(({ tagName }) => getHighlightSpanForNode(tagName, sourceFile)); - return [{ fileName: sourceFile.fileName, highlightSpans }]; - } - return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); - } - DocumentHighlights3.getDocumentHighlights = getDocumentHighlights; - function getHighlightSpanForNode(node, sourceFile) { - return { - fileName: sourceFile.fileName, - textSpan: createTextSpanFromNode(node, sourceFile), - kind: "none" /* none */ - }; - } - function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { - const sourceFilesSet = new Set(sourceFilesToSearch.map((f) => f.fileName)); - const referenceEntries = ts_FindAllReferences_exports.getReferenceEntriesForNode( - position, - node, - program, - sourceFilesToSearch, - cancellationToken, - /*options*/ - void 0, - sourceFilesSet - ); - if (!referenceEntries) return void 0; - const map2 = arrayToMultiMap(referenceEntries.map(ts_FindAllReferences_exports.toHighlightSpan), (e) => e.fileName, (e) => e.span); - const getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames()); - return arrayFrom(mapDefinedIterator(map2.entries(), ([fileName, highlightSpans]) => { - if (!sourceFilesSet.has(fileName)) { - if (!program.redirectTargetsMap.has(toPath(fileName, program.getCurrentDirectory(), getCanonicalFileName))) { - return void 0; - } - const redirectTarget = program.getSourceFile(fileName); - const redirect = find(sourceFilesToSearch, (f) => !!f.redirectInfo && f.redirectInfo.redirectTarget === redirectTarget); - fileName = redirect.fileName; - Debug.assert(sourceFilesSet.has(fileName)); - } - return { fileName, highlightSpans }; - })); - } - function getSyntacticDocumentHighlights(node, sourceFile) { - const highlightSpans = getHighlightSpans(node, sourceFile); - return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans }]; - } - function getHighlightSpans(node, sourceFile) { - switch (node.kind) { - case 101 /* IfKeyword */: - case 93 /* ElseKeyword */: - return isIfStatement(node.parent) ? getIfElseOccurrences(node.parent, sourceFile) : void 0; - case 107 /* ReturnKeyword */: - return useParent(node.parent, isReturnStatement, getReturnOccurrences); - case 111 /* ThrowKeyword */: - return useParent(node.parent, isThrowStatement, getThrowOccurrences); - case 113 /* TryKeyword */: - case 85 /* CatchKeyword */: - case 98 /* FinallyKeyword */: - const tryStatement = node.kind === 85 /* CatchKeyword */ ? node.parent.parent : node.parent; - return useParent(tryStatement, isTryStatement, getTryCatchFinallyOccurrences); - case 109 /* SwitchKeyword */: - return useParent(node.parent, isSwitchStatement, getSwitchCaseDefaultOccurrences); - case 84 /* CaseKeyword */: - case 90 /* DefaultKeyword */: { - if (isDefaultClause(node.parent) || isCaseClause(node.parent)) { - return useParent(node.parent.parent.parent, isSwitchStatement, getSwitchCaseDefaultOccurrences); - } - return void 0; - } - case 83 /* BreakKeyword */: - case 88 /* ContinueKeyword */: - return useParent(node.parent, isBreakOrContinueStatement, getBreakOrContinueStatementOccurrences); - case 99 /* ForKeyword */: - case 117 /* WhileKeyword */: - case 92 /* DoKeyword */: - return useParent(node.parent, (n) => isIterationStatement( - n, - /*lookInLabeledStatements*/ - true - ), getLoopBreakContinueOccurrences); - case 137 /* ConstructorKeyword */: - return getFromAllDeclarations(isConstructorDeclaration, [137 /* ConstructorKeyword */]); - case 139 /* GetKeyword */: - case 153 /* SetKeyword */: - return getFromAllDeclarations(isAccessor, [139 /* GetKeyword */, 153 /* SetKeyword */]); - case 135 /* AwaitKeyword */: - return useParent(node.parent, isAwaitExpression, getAsyncAndAwaitOccurrences); - case 134 /* AsyncKeyword */: - return highlightSpans(getAsyncAndAwaitOccurrences(node)); - 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; - } - function getFromAllDeclarations(nodeTest, keywords) { - return useParent(node.parent, nodeTest, (decl) => { - var _a; - return mapDefined((_a = tryCast(decl, canHaveSymbol)) == null ? void 0 : _a.symbol.declarations, (d) => nodeTest(d) ? find(d.getChildren(sourceFile), (c) => contains(keywords, c.kind)) : void 0); - }); - } - function useParent(node2, nodeTest, getNodes4) { - return nodeTest(node2) ? highlightSpans(getNodes4(node2, sourceFile)) : void 0; - } - function highlightSpans(nodes) { - return nodes && nodes.map((node2) => getHighlightSpanForNode(node2, sourceFile)); - } - } - function aggregateOwnedThrowStatements(node) { - if (isThrowStatement(node)) { - return [node]; - } else if (isTryStatement(node)) { - return concatenate( - node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), - node.finallyBlock && aggregateOwnedThrowStatements(node.finallyBlock) - ); - } - return isFunctionLike(node) ? void 0 : flatMapChildren(node, aggregateOwnedThrowStatements); - } - function getThrowStatementOwner(throwStatement) { - let child = throwStatement; - while (child.parent) { - const parent2 = child.parent; - if (isFunctionBlock(parent2) || parent2.kind === 308 /* SourceFile */) { - return parent2; - } - if (isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) { - return child; - } - child = parent2; - } - return void 0; - } - function aggregateAllBreakAndContinueStatements(node) { - return isBreakOrContinueStatement(node) ? [node] : isFunctionLike(node) ? void 0 : flatMapChildren(node, aggregateAllBreakAndContinueStatements); - } - function flatMapChildren(node, cb) { - const result = []; - node.forEachChild((child) => { - const value = cb(child); - if (value !== void 0) { - result.push(...toArray(value)); - } - }); - return result; - } - function ownsBreakOrContinueStatement(owner, statement) { - const actualOwner = getBreakOrContinueOwner(statement); - return !!actualOwner && actualOwner === owner; - } - function getBreakOrContinueOwner(statement) { - return findAncestor(statement, (node) => { - switch (node.kind) { - case 256 /* SwitchStatement */: - if (statement.kind === 252 /* ContinueStatement */) { - return false; - } - // falls through - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 248 /* WhileStatement */: - case 247 /* DoStatement */: - return !statement.label || isLabeledBy(node, statement.label.escapedText); - default: - return isFunctionLike(node) && "quit"; - } - }); - } - function getModifierOccurrences(modifier, declaration) { - return mapDefined(getNodesToSearchForModifier(declaration, modifierToFlag(modifier)), (node) => findModifier(node, modifier)); - } - function getNodesToSearchForModifier(declaration, modifierFlag) { - const container = declaration.parent; - switch (container.kind) { - case 269 /* ModuleBlock */: - case 308 /* SourceFile */: - case 242 /* Block */: - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - if (modifierFlag & 64 /* Abstract */ && isClassDeclaration(declaration)) { - return [...declaration.members, declaration]; - } else { - return container.statements; - } - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 263 /* FunctionDeclaration */: - return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []]; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 188 /* TypeLiteral */: - const nodes = container.members; - if (modifierFlag & (7 /* AccessibilityModifier */ | 8 /* Readonly */)) { - const constructor = find(container.members, isConstructorDeclaration); - if (constructor) { - return [...nodes, ...constructor.parameters]; - } - } else if (modifierFlag & 64 /* Abstract */) { - return [...nodes, container]; - } - return nodes; - // Syntactically invalid positions that the parser might produce anyway - default: - return void 0; - } - } - function pushKeywordIf(keywordList, token, ...expected) { - if (token && contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - return false; - } - function getLoopBreakContinueOccurrences(loopNode) { - const keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 99 /* ForKeyword */, 117 /* WhileKeyword */, 92 /* DoKeyword */)) { - if (loopNode.kind === 247 /* DoStatement */) { - const loopTokens = loopNode.getChildren(); - for (let i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 117 /* WhileKeyword */)) { - break; - } - } - } - } - forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), (statement) => { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 83 /* BreakKeyword */, 88 /* ContinueKeyword */); - } - }); - return keywords; - } - function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { - const owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - return getLoopBreakContinueOccurrences(owner); - case 256 /* SwitchStatement */: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return void 0; - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - const keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 109 /* SwitchKeyword */); - forEach(switchStatement.caseBlock.clauses, (clause) => { - pushKeywordIf(keywords, clause.getFirstToken(), 84 /* CaseKeyword */, 90 /* DefaultKeyword */); - forEach(aggregateAllBreakAndContinueStatements(clause), (statement) => { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 83 /* BreakKeyword */); - } - }); - }); - return keywords; - } - function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { - const keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 113 /* TryKeyword */); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 85 /* CatchKeyword */); - } - if (tryStatement.finallyBlock) { - const finallyKeyword = findChildOfKind(tryStatement, 98 /* FinallyKeyword */, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 98 /* FinallyKeyword */); - } - return keywords; - } - function getThrowOccurrences(throwStatement, sourceFile) { - const owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return void 0; - } - const keywords = []; - forEach(aggregateOwnedThrowStatements(owner), (throwStatement2) => { - keywords.push(findChildOfKind(throwStatement2, 111 /* ThrowKeyword */, sourceFile)); - }); - if (isFunctionBlock(owner)) { - forEachReturnStatement(owner, (returnStatement) => { - keywords.push(findChildOfKind(returnStatement, 107 /* ReturnKeyword */, sourceFile)); - }); - } - return keywords; - } - function getReturnOccurrences(returnStatement, sourceFile) { - const func = getContainingFunction(returnStatement); - if (!func) { - return void 0; - } - const keywords = []; - forEachReturnStatement(cast(func.body, isBlock), (returnStatement2) => { - keywords.push(findChildOfKind(returnStatement2, 107 /* ReturnKeyword */, sourceFile)); - }); - forEach(aggregateOwnedThrowStatements(func.body), (throwStatement) => { - keywords.push(findChildOfKind(throwStatement, 111 /* ThrowKeyword */, sourceFile)); - }); - return keywords; - } - function getAsyncAndAwaitOccurrences(node) { - const func = getContainingFunction(node); - if (!func) { - return void 0; - } - const keywords = []; - if (func.modifiers) { - func.modifiers.forEach((modifier) => { - pushKeywordIf(keywords, modifier, 134 /* AsyncKeyword */); - }); - } - forEachChild(func, (child) => { - traverseWithoutCrossingFunction(child, (node2) => { - if (isAwaitExpression(node2)) { - pushKeywordIf(keywords, node2.getFirstToken(), 135 /* AwaitKeyword */); - } - }); - }); - return keywords; - } - function getYieldOccurrences(node) { - const func = getContainingFunction(node); - if (!func) { - return void 0; - } - const keywords = []; - forEachChild(func, (child) => { - traverseWithoutCrossingFunction(child, (node2) => { - if (isYieldExpression(node2)) { - pushKeywordIf(keywords, node2.getFirstToken(), 127 /* YieldKeyword */); - } - }); - }); - return keywords; - } - function traverseWithoutCrossingFunction(node, cb) { - cb(node); - if (!isFunctionLike(node) && !isClassLike(node) && !isInterfaceDeclaration(node) && !isModuleDeclaration(node) && !isTypeAliasDeclaration(node) && !isTypeNode(node)) { - forEachChild(node, (child) => traverseWithoutCrossingFunction(child, cb)); - } - } - function getIfElseOccurrences(ifStatement, sourceFile) { - const keywords = getIfElseKeywords(ifStatement, sourceFile); - const result = []; - for (let i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 93 /* ElseKeyword */ && i < keywords.length - 1) { - const elseKeyword = keywords[i]; - const ifKeyword = keywords[i + 1]; - let shouldCombineElseAndIf = true; - for (let j = ifKeyword.getStart(sourceFile) - 1; j >= elseKeyword.end; j--) { - if (!isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { - shouldCombineElseAndIf = false; - break; - } - } - if (shouldCombineElseAndIf) { - result.push({ - fileName: sourceFile.fileName, - textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: "reference" /* reference */ - }); - i++; - continue; - } - } - result.push(getHighlightSpanForNode(keywords[i], sourceFile)); - } - return result; - } - function getIfElseKeywords(ifStatement, sourceFile) { - const keywords = []; - while (isIfStatement(ifStatement.parent) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - while (true) { - const children = ifStatement.getChildren(sourceFile); - pushKeywordIf(keywords, children[0], 101 /* IfKeyword */); - for (let i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 93 /* ElseKeyword */)) { - break; - } - } - if (!ifStatement.elseStatement || !isIfStatement(ifStatement.elseStatement)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - return keywords; - } - function isLabeledBy(node, labelName) { - return !!findAncestor(node.parent, (owner) => !isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName); - } -})(DocumentHighlights || (DocumentHighlights = {})); - -// src/services/documentRegistry.ts -function isDocumentRegistryEntry(entry) { - return !!entry.sourceFile; -} -function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) { - return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode); -} -function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) { - const buckets = /* @__PURE__ */ new Map(); - const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2); - function reportStats() { - const bucketInfoArray = arrayFrom(buckets.keys()).filter((name) => name && name.charAt(0) === "_").map((name) => { - const entries = buckets.get(name); - const sourceFiles = []; - entries.forEach((entry, name2) => { - if (isDocumentRegistryEntry(entry)) { - sourceFiles.push({ - name: name2, - scriptKind: entry.sourceFile.scriptKind, - refCount: entry.languageServiceRefCount - }); - } else { - entry.forEach((value, scriptKind) => sourceFiles.push({ name: name2, scriptKind, refCount: value.languageServiceRefCount })); - } - }); - sourceFiles.sort((x, y) => y.refCount - x.refCount); - return { - bucket: name, - sourceFiles - }; - }); - return JSON.stringify(bucketInfoArray, void 0, 2); - } - function getCompilationSettings(settingsOrHost) { - if (typeof settingsOrHost.getCompilationSettings === "function") { - return settingsOrHost.getCompilationSettings(); - } - return settingsOrHost; - } - function acquireDocument(fileName, compilationSettings, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) { - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings)); - return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions); - } - function acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) { - return acquireOrUpdateDocument( - fileName, - path, - compilationSettings, - key, - scriptSnapshot, - version2, - /*acquiring*/ - true, - scriptKind, - languageVersionOrOptions - ); - } - function updateDocument(fileName, compilationSettings, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) { - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings)); - return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions); - } - function updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version2, scriptKind, languageVersionOrOptions) { - return acquireOrUpdateDocument( - fileName, - path, - getCompilationSettings(compilationSettings), - key, - scriptSnapshot, - version2, - /*acquiring*/ - false, - scriptKind, - languageVersionOrOptions - ); - } - function getDocumentRegistryEntry(bucketEntry, scriptKind) { - const entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided")); - Debug.assert(scriptKind === void 0 || !entry || entry.sourceFile.scriptKind === scriptKind, `Script kind should match provided ScriptKind:${scriptKind} and sourceFile.scriptKind: ${entry == null ? void 0 : entry.sourceFile.scriptKind}, !entry: ${!entry}`); - return entry; - } - function acquireOrUpdateDocument(fileName, path, compilationSettingsOrHost, key, scriptSnapshot, version2, acquiring, scriptKind, languageVersionOrOptions) { - var _a, _b, _c, _d; - scriptKind = ensureScriptKind(fileName, scriptKind); - const compilationSettings = getCompilationSettings(compilationSettingsOrHost); - const host = compilationSettingsOrHost === compilationSettings ? void 0 : compilationSettingsOrHost; - const scriptTarget = scriptKind === 6 /* JSON */ ? 100 /* JSON */ : getEmitScriptTarget(compilationSettings); - 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), - 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()); - if (tracing) { - if (buckets.size > oldBucketCount) { - tracing.instant(tracing.Phase.Session, "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key: keyWithMode }); - } - const otherBucketKey = !isDeclarationFileName(path) && forEachEntry(buckets, (bucket2, bucketKey) => bucketKey !== keyWithMode && bucket2.has(path) && bucketKey); - if (otherBucketKey) { - tracing.instant(tracing.Phase.Session, "documentRegistryBucketOverlap", { path, key1: otherBucketKey, key2: keyWithMode }); - } - } - const bucketEntry = bucket.get(path); - let entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind); - if (!entry && externalCache) { - const sourceFile = externalCache.getDocument(keyWithMode, path); - if (sourceFile && sourceFile.scriptKind === scriptKind && sourceFile.text === getSnapshotText(scriptSnapshot)) { - Debug.assert(acquiring); - entry = { - sourceFile, - languageServiceRefCount: 0 - }; - setBucketEntry(); - } - } - if (!entry) { - const sourceFile = createLanguageServiceSourceFile( - fileName, - scriptSnapshot, - sourceFileOptions, - version2, - /*setNodeParents*/ - false, - scriptKind - ); - if (externalCache) { - externalCache.setDocument(keyWithMode, path, sourceFile); - } - entry = { - sourceFile, - languageServiceRefCount: 1 - }; - setBucketEntry(); - } else { - if (entry.sourceFile.version !== version2) { - entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version2, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); - if (externalCache) { - externalCache.setDocument(keyWithMode, path, entry.sourceFile); - } - } - if (acquiring) { - entry.languageServiceRefCount++; - } - } - Debug.assert(entry.languageServiceRefCount !== 0); - return entry.sourceFile; - function setBucketEntry() { - if (!bucketEntry) { - bucket.set(path, entry); - } else if (isDocumentRegistryEntry(bucketEntry)) { - const scriptKindMap = /* @__PURE__ */ new Map(); - scriptKindMap.set(bucketEntry.sourceFile.scriptKind, bucketEntry); - scriptKindMap.set(scriptKind, entry); - bucket.set(path, scriptKindMap); - } else { - bucketEntry.set(scriptKind, entry); - } - } - } - function releaseDocument(fileName, compilationSettings, scriptKind, impliedNodeFormat) { - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const key = getKeyForCompilationSettings(compilationSettings); - return releaseDocumentWithKey(path, key, scriptKind, impliedNodeFormat); - } - function releaseDocumentWithKey(path, key, scriptKind, impliedNodeFormat) { - const bucket = Debug.checkDefined(buckets.get(getDocumentRegistryBucketKeyWithMode(key, impliedNodeFormat))); - const bucketEntry = bucket.get(path); - const entry = getDocumentRegistryEntry(bucketEntry, scriptKind); - entry.languageServiceRefCount--; - Debug.assert(entry.languageServiceRefCount >= 0); - if (entry.languageServiceRefCount === 0) { - if (isDocumentRegistryEntry(bucketEntry)) { - bucket.delete(path); - } else { - bucketEntry.delete(scriptKind); - if (bucketEntry.size === 1) { - bucket.set(path, firstDefinedIterator(bucketEntry.values(), identity)); - } - } - } - } - return { - acquireDocument, - acquireDocumentWithKey, - updateDocument, - updateDocumentWithKey, - releaseDocument, - releaseDocumentWithKey, - getKeyForCompilationSettings, - getDocumentRegistryBucketKeyWithMode, - reportStats, - getBuckets: () => buckets - }; -} -function getKeyForCompilationSettings(settings) { - return getKeyForCompilerOptions(settings, sourceFileAffectingCompilerOptions); -} -function getDocumentRegistryBucketKeyWithMode(key, mode) { - return mode ? `${key}|${mode}` : key; -} - -// src/services/getEditsForFileRename.ts -function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) { - 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(), useCaseSensitiveFileNames2); - updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName); - }); -} -function getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper) { - const canonicalOldPath = getCanonicalFileName(oldFileOrDirPath); - return (path) => { - const originalPath = sourceMapper && sourceMapper.tryGetSourcePosition({ fileName: path, pos: 0 }); - const updatedPath = getUpdatedPath(originalPath ? originalPath.fileName : path); - return originalPath ? updatedPath === void 0 ? void 0 : makeCorrespondingRelativeChange(originalPath.fileName, updatedPath, path, getCanonicalFileName) : updatedPath; - }; - function getUpdatedPath(pathToUpdate) { - if (getCanonicalFileName(pathToUpdate) === canonicalOldPath) return newFileOrDirPath; - const suffix = tryRemoveDirectoryPrefix(pathToUpdate, canonicalOldPath, getCanonicalFileName); - return suffix === void 0 ? void 0 : newFileOrDirPath + "/" + suffix; - } -} -function makeCorrespondingRelativeChange(a0, b0, a1, getCanonicalFileName) { - const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName); - return combinePathsSafe(getDirectoryPath(a1), rel); -} -function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) { - const { configFile } = program.getCompilerOptions(); - if (!configFile) return; - const configDir = getDirectoryPath(configFile.fileName); - const jsonObjectLiteral = getTsConfigObjectLiteralExpression(configFile); - if (!jsonObjectLiteral) return; - forEachProperty(jsonObjectLiteral, (property, propertyName) => { - switch (propertyName) { - case "files": - case "include": - case "exclude": { - const foundExactMatch = updatePaths(property); - if (foundExactMatch || propertyName !== "include" || !isArrayLiteralExpression(property.initializer)) return; - const includes = mapDefined(property.initializer.elements, (e) => isStringLiteral(e) ? e.text : void 0); - if (includes.length === 0) return; - const matchers = getFileMatcherPatterns( - configDir, - /*excludes*/ - [], - includes, - useCaseSensitiveFileNames2, - currentDirectory - ); - 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; - } - case "compilerOptions": - forEachProperty(property.initializer, (property2, propertyName2) => { - const option = getOptionFromName(propertyName2); - Debug.assert((option == null ? void 0 : option.type) !== "listOrElement"); - if (option && (option.isFilePath || option.type === "list" && option.element.isFilePath)) { - updatePaths(property2); - } else if (propertyName2 === "paths") { - forEachProperty(property2.initializer, (pathsProperty) => { - if (!isArrayLiteralExpression(pathsProperty.initializer)) return; - for (const e of pathsProperty.initializer.elements) { - tryUpdateString(e); - } - }); - } - }); - return; - } - }); - function updatePaths(property) { - const elements = isArrayLiteralExpression(property.initializer) ? property.initializer.elements : [property.initializer]; - let foundExactMatch = false; - for (const element of elements) { - foundExactMatch = tryUpdateString(element) || foundExactMatch; - } - return foundExactMatch; - } - function tryUpdateString(element) { - if (!isStringLiteral(element)) return false; - const elementFileName = combinePathsSafe(configDir, element.text); - const updated = oldToNew(elementFileName); - if (updated !== void 0) { - changeTracker.replaceRangeWithText(configFile, createStringRange(element, configFile), relativePath(updated)); - return true; - } - return false; - } - function relativePath(path) { - return getRelativePathFromDirectory( - configDir, - path, - /*ignoreCase*/ - !useCaseSensitiveFileNames2 - ); - } -} -function updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName) { - const allFiles = program.getSourceFiles(); - for (const sourceFile of allFiles) { - const newFromOld = oldToNew(sourceFile.fileName); - const newImportFromPath = newFromOld ?? sourceFile.fileName; - const newImportFromDirectory = getDirectoryPath(newImportFromPath); - const oldFromNew = newToOld(sourceFile.fileName); - 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, newImportFromPath, toImport.newFileName, createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0; - }); - } -} -function combineNormal(pathA, pathB) { - return normalizePath(combinePaths(pathA, pathB)); -} -function combinePathsSafe(pathA, pathB) { - return ensurePathIsNonModuleName(combineNormal(pathA, pathB)); -} -function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) { - 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 = program.getModeForUsageLocation(importingSourceFile, importLiteral); - const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? program.getResolvedModuleFromModuleSpecifier(importLiteral, importingSourceFile) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode); - return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles()); - } -} -function getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, sourceFiles) { - if (!resolved) return void 0; - if (resolved.resolvedModule) { - const result2 = tryChange(resolved.resolvedModule.resolvedFileName); - if (result2) return result2; - } - const result = forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJsonExisting) || pathIsRelative(importLiteral.text) && forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJson); - if (result) return result; - return resolved.resolvedModule && { newFileName: resolved.resolvedModule.resolvedFileName, updated: false }; - function tryChangeWithIgnoringPackageJsonExisting(oldFileName) { - const newFileName = oldToNew(oldFileName); - return newFileName && find(sourceFiles, (src) => src.fileName === newFileName) ? tryChangeWithIgnoringPackageJson(oldFileName) : void 0; - } - function tryChangeWithIgnoringPackageJson(oldFileName) { - return !endsWith(oldFileName, "/package.json") ? tryChange(oldFileName) : void 0; - } - function tryChange(oldFileName) { - const newFileName = oldToNew(oldFileName); - return newFileName && { newFileName, updated: true }; - } -} -function updateImportsWorker(sourceFile, changeTracker, updateRef, updateImport) { - for (const ref of sourceFile.referencedFiles || emptyArray) { - const updated = updateRef(ref.fileName); - if (updated !== void 0 && updated !== sourceFile.text.slice(ref.pos, ref.end)) changeTracker.replaceRangeWithText(sourceFile, ref, updated); - } - for (const importStringLiteral of sourceFile.imports) { - const updated = updateImport(importStringLiteral); - if (updated !== void 0 && updated !== importStringLiteral.text) changeTracker.replaceRangeWithText(sourceFile, createStringRange(importStringLiteral, sourceFile), updated); - } -} -function createStringRange(node, sourceFile) { - return createRange(node.getStart(sourceFile) + 1, node.end - 1); -} -function forEachProperty(objectLiteral, cb) { - if (!isObjectLiteralExpression(objectLiteral)) return; - for (const property of objectLiteral.properties) { - if (isPropertyAssignment(property) && isStringLiteral(property.name)) { - cb(property, property.name.text); - } - } -} - -// src/services/patternMatcher.ts -var PatternMatchKind = /* @__PURE__ */ ((PatternMatchKind2) => { - PatternMatchKind2[PatternMatchKind2["exact"] = 0] = "exact"; - PatternMatchKind2[PatternMatchKind2["prefix"] = 1] = "prefix"; - PatternMatchKind2[PatternMatchKind2["substring"] = 2] = "substring"; - PatternMatchKind2[PatternMatchKind2["camelCase"] = 3] = "camelCase"; - return PatternMatchKind2; -})(PatternMatchKind || {}); -function createPatternMatch(kind, isCaseSensitive) { - return { - kind, - isCaseSensitive - }; -} -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 { - getFullMatch: (containers, candidate) => getFullMatch(containers, candidate, dotSeparatedSegments, stringToWordSpans), - getMatchForLastSegmentOfPattern: (candidate) => matchSegment(candidate, last(dotSeparatedSegments), stringToWordSpans), - patternContainsDots: dotSeparatedSegments.length > 1 - }; -} -function getFullMatch(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans) { - const candidateMatch = matchSegment(candidate, last(dotSeparatedSegments), stringToWordSpans); - if (!candidateMatch) { - return void 0; - } - if (dotSeparatedSegments.length - 1 > candidateContainers.length) { - return void 0; - } - let bestMatch; - for (let i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i -= 1, j -= 1) { - bestMatch = betterMatch(bestMatch, matchSegment(candidateContainers[j], dotSeparatedSegments[i], stringToWordSpans)); - } - return bestMatch; -} -function getWordSpans(word, stringToWordSpans) { - let spans = stringToWordSpans.get(word); - if (!spans) { - stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); - } - return spans; -} -function matchTextChunk(candidate, chunk, stringToWordSpans) { - const index = indexOfIgnoringCase(candidate, chunk.textLowerCase); - if (index === 0) { - return createPatternMatch( - chunk.text.length === candidate.length ? 0 /* exact */ : 1 /* prefix */, - /*isCaseSensitive:*/ - startsWith(candidate, chunk.text) - ); - } - if (chunk.isLowerCase) { - if (index === -1) return void 0; - const wordSpans = getWordSpans(candidate, stringToWordSpans); - for (const span of wordSpans) { - if (partStartsWith( - candidate, - span, - chunk.text, - /*ignoreCase*/ - true - )) { - return createPatternMatch( - 2 /* substring */, - /*isCaseSensitive:*/ - partStartsWith( - candidate, - span, - chunk.text, - /*ignoreCase*/ - false - ) - ); - } - } - if (chunk.text.length < candidate.length && isUpperCaseLetter(candidate.charCodeAt(index))) { - return createPatternMatch( - 2 /* substring */, - /*isCaseSensitive*/ - false - ); - } - } else { - if (candidate.indexOf(chunk.text) > 0) { - return createPatternMatch( - 2 /* substring */, - /*isCaseSensitive*/ - true - ); - } - if (chunk.characterSpans.length > 0) { - const candidateParts = getWordSpans(candidate, stringToWordSpans); - const isCaseSensitive = tryCamelCaseMatch( - candidate, - candidateParts, - chunk, - /*ignoreCase*/ - false - ) ? true : tryCamelCaseMatch( - candidate, - candidateParts, - chunk, - /*ignoreCase*/ - true - ) ? false : void 0; - if (isCaseSensitive !== void 0) { - return createPatternMatch(3 /* camelCase */, isCaseSensitive); - } - } - } -} -function matchSegment(candidate, segment, stringToWordSpans) { - if (every2(segment.totalTextChunk.text, (ch) => ch !== 32 /* space */ && ch !== 42 /* asterisk */)) { - const match = matchTextChunk(candidate, segment.totalTextChunk, stringToWordSpans); - if (match) return match; - } - const subWordTextChunks = segment.subWordTextChunks; - let bestMatch; - for (const subWordTextChunk of subWordTextChunks) { - bestMatch = betterMatch(bestMatch, matchTextChunk(candidate, subWordTextChunk, stringToWordSpans)); - } - return bestMatch; -} -function betterMatch(a, b) { - return min([a, b], compareMatches); -} -function compareMatches(a, b) { - return a === void 0 ? 1 /* GreaterThan */ : b === void 0 ? -1 /* LessThan */ : compareValues(a.kind, b.kind) || compareBooleans(!a.isCaseSensitive, !b.isCaseSensitive); -} -function partStartsWith(candidate, candidateSpan, pattern, ignoreCase, patternSpan = { start: 0, length: pattern.length }) { - return patternSpan.length <= candidateSpan.length && everyInRange(0, patternSpan.length, (i) => equalChars(pattern.charCodeAt(patternSpan.start + i), candidate.charCodeAt(candidateSpan.start + i), ignoreCase)); -} -function equalChars(ch1, ch2, ignoreCase) { - return ignoreCase ? toLowerCase2(ch1) === toLowerCase2(ch2) : ch1 === ch2; -} -function tryCamelCaseMatch(candidate, candidateParts, chunk, ignoreCase) { - const chunkCharacterSpans = chunk.characterSpans; - let currentCandidate = 0; - let currentChunkSpan = 0; - let firstMatch; - let contiguous; - while (true) { - if (currentChunkSpan === chunkCharacterSpans.length) { - return true; - } else if (currentCandidate === candidateParts.length) { - return false; - } - let candidatePart = candidateParts[currentCandidate]; - let gotOneMatchThisCandidate = false; - for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { - const chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; - if (gotOneMatchThisCandidate) { - if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { - break; - } - } - if (!partStartsWith(candidate, candidatePart, chunk.text, ignoreCase, chunkCharacterSpan)) { - break; - } - gotOneMatchThisCandidate = true; - firstMatch = firstMatch === void 0 ? currentCandidate : firstMatch; - contiguous = contiguous === void 0 ? true : contiguous; - candidatePart = createTextSpan(candidatePart.start + chunkCharacterSpan.length, candidatePart.length - chunkCharacterSpan.length); - } - if (!gotOneMatchThisCandidate && contiguous !== void 0) { - contiguous = false; - } - currentCandidate++; - } -} -function createSegment(text) { - return { - totalTextChunk: createTextChunk(text), - subWordTextChunks: breakPatternIntoTextChunks(text) - }; -} -function isUpperCaseLetter(ch) { - if (ch >= 65 /* A */ && ch <= 90 /* Z */) { - return true; - } - if (ch < 127 /* maxAsciiCharacter */ || !isUnicodeIdentifierStart(ch, 99 /* Latest */)) { - return false; - } - const str = String.fromCharCode(ch); - return str === str.toUpperCase(); -} -function isLowerCaseLetter(ch) { - if (ch >= 97 /* a */ && ch <= 122 /* z */) { - return true; - } - if (ch < 127 /* maxAsciiCharacter */ || !isUnicodeIdentifierStart(ch, 99 /* Latest */)) { - return false; - } - const str = String.fromCharCode(ch); - return str === str.toLowerCase(); -} -function indexOfIgnoringCase(str, value) { - const n = str.length - value.length; - for (let start = 0; start <= n; start++) { - if (every2(value, (valueChar, i) => toLowerCase2(str.charCodeAt(i + start)) === valueChar)) { - return start; - } - } - return -1; -} -function toLowerCase2(ch) { - if (ch >= 65 /* A */ && ch <= 90 /* Z */) { - return 97 /* a */ + (ch - 65 /* A */); - } - if (ch < 127 /* maxAsciiCharacter */) { - return ch; - } - return String.fromCharCode(ch).toLowerCase().charCodeAt(0); -} -function isDigit2(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; -} -function isWordChar(ch) { - return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit2(ch) || ch === 95 /* _ */ || ch === 36 /* $ */; -} -function breakPatternIntoTextChunks(pattern) { - const result = []; - let wordStart = 0; - let wordLength = 0; - for (let i = 0; i < pattern.length; i++) { - const ch = pattern.charCodeAt(i); - if (isWordChar(ch)) { - if (wordLength === 0) { - wordStart = i; - } - wordLength++; - } else { - if (wordLength > 0) { - result.push(createTextChunk(pattern.substr(wordStart, wordLength))); - wordLength = 0; - } - } - } - if (wordLength > 0) { - result.push(createTextChunk(pattern.substr(wordStart, wordLength))); - } - return result; -} -function createTextChunk(text) { - const textLowerCase = text.toLowerCase(); - return { - text, - textLowerCase, - isLowerCase: text === textLowerCase, - characterSpans: breakIntoCharacterSpans(text) - }; -} -function breakIntoCharacterSpans(identifier) { - return breakIntoSpans( - identifier, - /*word*/ - false - ); -} -function breakIntoWordSpans(identifier) { - return breakIntoSpans( - identifier, - /*word*/ - true - ); -} -function breakIntoSpans(identifier, word) { - const result = []; - let wordStart = 0; - for (let i = 1; i < identifier.length; i++) { - const lastIsDigit = isDigit2(identifier.charCodeAt(i - 1)); - const currentIsDigit = isDigit2(identifier.charCodeAt(i)); - const hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); - const hasTransitionFromUpperToLower = word && transitionFromUpperToLower(identifier, i, wordStart); - if (charIsPunctuation(identifier.charCodeAt(i - 1)) || charIsPunctuation(identifier.charCodeAt(i)) || lastIsDigit !== currentIsDigit || hasTransitionFromLowerToUpper || hasTransitionFromUpperToLower) { - if (!isAllPunctuation(identifier, wordStart, i)) { - result.push(createTextSpan(wordStart, i - wordStart)); - } - wordStart = i; - } - } - if (!isAllPunctuation(identifier, wordStart, identifier.length)) { - result.push(createTextSpan(wordStart, identifier.length - wordStart)); - } - return result; -} -function charIsPunctuation(ch) { - switch (ch) { - case 33 /* exclamation */: - case 34 /* doubleQuote */: - case 35 /* hash */: - case 37 /* percent */: - case 38 /* ampersand */: - case 39 /* singleQuote */: - case 40 /* openParen */: - case 41 /* closeParen */: - case 42 /* asterisk */: - case 44 /* comma */: - case 45 /* minus */: - case 46 /* dot */: - case 47 /* slash */: - case 58 /* colon */: - case 59 /* semicolon */: - case 63 /* question */: - case 64 /* at */: - case 91 /* openBracket */: - case 92 /* backslash */: - case 93 /* closeBracket */: - case 95 /* _ */: - case 123 /* openBrace */: - case 125 /* closeBrace */: - return true; - } - return false; -} -function isAllPunctuation(identifier, start, end) { - return every2(identifier, (ch) => charIsPunctuation(ch) && ch !== 95 /* _ */, start, end); -} -function transitionFromUpperToLower(identifier, index, wordStart) { - return index !== wordStart && index + 1 < identifier.length && isUpperCaseLetter(identifier.charCodeAt(index)) && isLowerCaseLetter(identifier.charCodeAt(index + 1)) && every2(identifier, isUpperCaseLetter, wordStart, index); -} -function transitionFromLowerToUpper(identifier, word, index) { - const lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); - const currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); - return currentIsUpper && (!word || !lastIsUpper); -} -function everyInRange(start, end, pred) { - for (let i = start; i < end; i++) { - if (!pred(i)) { - return false; - } - } - return true; -} -function every2(s, pred, start = 0, end = s.length) { - return everyInRange(start, end, (i) => pred(s.charCodeAt(i), i)); -} - -// src/services/preProcess.ts -function preProcessFile(sourceText, readImportFiles = true, detectJavaScriptImports = false) { - const pragmaContext = { - languageVersion: 1 /* ES5 */, - // controls whether the token scanner considers unicode identifiers or not - shouldn't matter, since we're only using it for trivia - pragmas: void 0, - checkJsDirective: void 0, - referencedFiles: [], - typeReferenceDirectives: [], - libReferenceDirectives: [], - amdDependencies: [], - hasNoDefaultLib: void 0, - moduleName: void 0 - }; - const importedFiles = []; - let ambientExternalModules; - let lastToken; - let currentToken; - let braceNesting = 0; - let externalModule = false; - function nextToken() { - lastToken = currentToken; - currentToken = scanner.scan(); - if (currentToken === 19 /* OpenBraceToken */) { - braceNesting++; - } else if (currentToken === 20 /* CloseBraceToken */) { - braceNesting--; - } - return currentToken; - } - function getFileReference() { - const fileName = scanner.getTokenValue(); - const pos = scanner.getTokenStart(); - return { fileName, pos, end: pos + fileName.length }; - } - function recordAmbientExternalModule() { - if (!ambientExternalModules) { - ambientExternalModules = []; - } - ambientExternalModules.push({ ref: getFileReference(), depth: braceNesting }); - } - function recordModuleName() { - importedFiles.push(getFileReference()); - markAsExternalModuleIfTopLevel(); - } - function markAsExternalModuleIfTopLevel() { - if (braceNesting === 0) { - externalModule = true; - } - } - function tryConsumeDeclare() { - let token = scanner.getToken(); - if (token === 138 /* DeclareKeyword */) { - token = nextToken(); - if (token === 144 /* ModuleKeyword */) { - token = nextToken(); - if (token === 11 /* StringLiteral */) { - recordAmbientExternalModule(); - } - } - return true; - } - return false; - } - function tryConsumeImport() { - if (lastToken === 25 /* DotToken */) { - return false; - } - let token = scanner.getToken(); - if (token === 102 /* ImportKeyword */) { - token = nextToken(); - if (token === 21 /* OpenParenToken */) { - token = nextToken(); - if (token === 11 /* StringLiteral */ || token === 15 /* NoSubstitutionTemplateLiteral */) { - recordModuleName(); - return true; - } - } else if (token === 11 /* StringLiteral */) { - recordModuleName(); - return true; - } else { - if (token === 156 /* TypeKeyword */) { - const skipTypeKeyword = scanner.lookAhead(() => { - const token2 = scanner.scan(); - return token2 !== 161 /* FromKeyword */ && (token2 === 42 /* AsteriskToken */ || token2 === 19 /* OpenBraceToken */ || token2 === 80 /* Identifier */ || isKeyword(token2)); - }); - if (skipTypeKeyword) { - token = nextToken(); - } - } - if (token === 80 /* Identifier */ || isKeyword(token)) { - token = nextToken(); - if (token === 161 /* FromKeyword */) { - token = nextToken(); - if (token === 11 /* StringLiteral */) { - recordModuleName(); - return true; - } - } else if (token === 64 /* EqualsToken */) { - if (tryConsumeRequireCall( - /*skipCurrentToken*/ - true - )) { - return true; - } - } else if (token === 28 /* CommaToken */) { - token = nextToken(); - } else { - return true; - } - } - if (token === 19 /* OpenBraceToken */) { - token = nextToken(); - while (token !== 20 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { - token = nextToken(); - } - if (token === 20 /* CloseBraceToken */) { - token = nextToken(); - if (token === 161 /* FromKeyword */) { - token = nextToken(); - if (token === 11 /* StringLiteral */) { - recordModuleName(); - } - } - } - } else if (token === 42 /* AsteriskToken */) { - token = nextToken(); - if (token === 130 /* AsKeyword */) { - token = nextToken(); - if (token === 80 /* Identifier */ || isKeyword(token)) { - token = nextToken(); - if (token === 161 /* FromKeyword */) { - token = nextToken(); - if (token === 11 /* StringLiteral */) { - recordModuleName(); - } - } - } - } - } - } - return true; - } - return false; - } - function tryConsumeExport() { - let token = scanner.getToken(); - if (token === 95 /* ExportKeyword */) { - markAsExternalModuleIfTopLevel(); - token = nextToken(); - if (token === 156 /* TypeKeyword */) { - const skipTypeKeyword = scanner.lookAhead(() => { - const token2 = scanner.scan(); - return token2 === 42 /* AsteriskToken */ || token2 === 19 /* OpenBraceToken */; - }); - if (skipTypeKeyword) { - token = nextToken(); - } - } - if (token === 19 /* OpenBraceToken */) { - token = nextToken(); - while (token !== 20 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { - token = nextToken(); - } - if (token === 20 /* CloseBraceToken */) { - token = nextToken(); - if (token === 161 /* FromKeyword */) { - token = nextToken(); - if (token === 11 /* StringLiteral */) { - recordModuleName(); - } - } - } - } else if (token === 42 /* AsteriskToken */) { - token = nextToken(); - if (token === 161 /* FromKeyword */) { - token = nextToken(); - if (token === 11 /* StringLiteral */) { - recordModuleName(); - } - } - } else if (token === 102 /* ImportKeyword */) { - token = nextToken(); - if (token === 156 /* TypeKeyword */) { - const skipTypeKeyword = scanner.lookAhead(() => { - const token2 = scanner.scan(); - return token2 === 80 /* Identifier */ || isKeyword(token2); - }); - if (skipTypeKeyword) { - token = nextToken(); - } - } - if (token === 80 /* Identifier */ || isKeyword(token)) { - token = nextToken(); - if (token === 64 /* EqualsToken */) { - if (tryConsumeRequireCall( - /*skipCurrentToken*/ - true - )) { - return true; - } - } - } - } - return true; - } - return false; - } - function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals = false) { - let token = skipCurrentToken ? nextToken() : scanner.getToken(); - if (token === 149 /* RequireKeyword */) { - token = nextToken(); - if (token === 21 /* OpenParenToken */) { - token = nextToken(); - if (token === 11 /* StringLiteral */ || allowTemplateLiterals && token === 15 /* NoSubstitutionTemplateLiteral */) { - recordModuleName(); - } - } - return true; - } - return false; - } - function tryConsumeDefine() { - let token = scanner.getToken(); - if (token === 80 /* Identifier */ && scanner.getTokenValue() === "define") { - token = nextToken(); - if (token !== 21 /* OpenParenToken */) { - return true; - } - token = nextToken(); - if (token === 11 /* StringLiteral */ || token === 15 /* NoSubstitutionTemplateLiteral */) { - token = nextToken(); - if (token === 28 /* CommaToken */) { - token = nextToken(); - } else { - return true; - } - } - if (token !== 23 /* OpenBracketToken */) { - return true; - } - token = nextToken(); - while (token !== 24 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { - if (token === 11 /* StringLiteral */ || token === 15 /* NoSubstitutionTemplateLiteral */) { - recordModuleName(); - } - token = nextToken(); - } - return true; - } - return false; - } - function processImports() { - scanner.setText(sourceText); - nextToken(); - while (true) { - if (scanner.getToken() === 1 /* EndOfFileToken */) { - break; - } - if (scanner.getToken() === 16 /* TemplateHead */) { - const stack = [scanner.getToken()]; - loop: - while (length(stack)) { - const token = scanner.scan(); - switch (token) { - case 1 /* EndOfFileToken */: - break loop; - case 102 /* ImportKeyword */: - tryConsumeImport(); - break; - case 16 /* TemplateHead */: - stack.push(token); - break; - case 19 /* OpenBraceToken */: - if (length(stack)) { - stack.push(token); - } - break; - case 20 /* CloseBraceToken */: - if (length(stack)) { - if (lastOrUndefined(stack) === 16 /* TemplateHead */) { - if (scanner.reScanTemplateToken( - /*isTaggedTemplate*/ - false - ) === 18 /* TemplateTail */) { - stack.pop(); - } - } else { - stack.pop(); - } - } - break; - } - } - nextToken(); - } - if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || detectJavaScriptImports && (tryConsumeRequireCall( - /*skipCurrentToken*/ - false, - /*allowTemplateLiterals*/ - true - ) || tryConsumeDefine())) { - continue; - } else { - nextToken(); - } - } - scanner.setText(void 0); - } - if (readImportFiles) { - processImports(); - } - processCommentPragmas(pragmaContext, sourceText); - processPragmasIntoFields(pragmaContext, noop); - if (externalModule) { - if (ambientExternalModules) { - for (const decl of ambientExternalModules) { - importedFiles.push(decl.ref); - } - } - return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: void 0 }; - } else { - let ambientModuleNames; - if (ambientExternalModules) { - for (const decl of ambientExternalModules) { - if (decl.depth === 0) { - if (!ambientModuleNames) { - ambientModuleNames = []; - } - ambientModuleNames.push(decl.ref.fileName); - } else { - importedFiles.push(decl.ref); - } - } - } - return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames }; - } -} - -// src/services/sourcemaps.ts -var base64UrlRegExp = /^data:(?:application\/json;charset=[uU][tT][fF]-8;base64,([A-Za-z0-9+/=]+)$)?/; -function getSourceMapper(host) { - const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - const currentDirectory = host.getCurrentDirectory(); - const sourceFileLike = /* @__PURE__ */ new Map(); - const documentPositionMappers = /* @__PURE__ */ new Map(); - return { - tryGetSourcePosition, - tryGetGeneratedPosition, - toLineColumnOffset, - clearCache, - documentPositionMappers - }; - function toPath3(fileName) { - return toPath(fileName, currentDirectory, getCanonicalFileName); - } - function getDocumentPositionMapper2(generatedFileName, sourceFileName) { - const path = toPath3(generatedFileName); - const value = documentPositionMappers.get(path); - if (value) return value; - let mapper; - if (host.getDocumentPositionMapper) { - mapper = host.getDocumentPositionMapper(generatedFileName, sourceFileName); - } else if (host.readFile) { - const file = getSourceFileLike(generatedFileName); - mapper = file && getDocumentPositionMapper( - { getSourceFileLike, getCanonicalFileName, log: (s) => host.log(s) }, - generatedFileName, - getLineInfo(file.text, getLineStarts(file)), - (f) => !host.fileExists || host.fileExists(f) ? host.readFile(f) : void 0 - ); - } - documentPositionMappers.set(path, mapper || identitySourceMapConsumer); - return mapper || identitySourceMapConsumer; - } - function tryGetSourcePosition(info) { - if (!isDeclarationFileName(info.fileName)) return void 0; - const file = getSourceFile(info.fileName); - if (!file) return void 0; - const newLoc = getDocumentPositionMapper2(info.fileName).getSourcePosition(info); - return !newLoc || newLoc === info ? void 0 : tryGetSourcePosition(newLoc) || newLoc; - } - function tryGetGeneratedPosition(info) { - if (isDeclarationFileName(info.fileName)) return void 0; - const sourceFile = getSourceFile(info.fileName); - if (!sourceFile) return void 0; - const program = host.getProgram(); - if (program.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) { - return void 0; - } - const options = program.getCompilerOptions(); - const outPath = options.outFile; - const declarationPath = outPath ? removeFileExtension(outPath) + ".d.ts" /* Dts */ : getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), program); - if (declarationPath === void 0) return void 0; - const newLoc = getDocumentPositionMapper2(declarationPath, info.fileName).getGeneratedPosition(info); - return newLoc === info ? void 0 : newLoc; - } - function getSourceFile(fileName) { - const program = host.getProgram(); - if (!program) return void 0; - const path = toPath3(fileName); - const file = program.getSourceFileByPath(path); - return file && file.resolvedPath === path ? file : void 0; - } - function getOrCreateSourceFileLike(fileName) { - const path = toPath3(fileName); - const fileFromCache = sourceFileLike.get(path); - if (fileFromCache !== void 0) return fileFromCache ? fileFromCache : void 0; - if (!host.readFile || host.fileExists && !host.fileExists(fileName)) { - sourceFileLike.set(path, false); - return void 0; - } - const text = host.readFile(fileName); - const file = text ? createSourceFileLike(text) : false; - sourceFileLike.set(path, file); - return file ? file : void 0; - } - function getSourceFileLike(fileName) { - return !host.getSourceFileLike ? getSourceFile(fileName) || getOrCreateSourceFileLike(fileName) : host.getSourceFileLike(fileName); - } - function toLineColumnOffset(fileName, position) { - const file = getSourceFileLike(fileName); - return file.getLineAndCharacterOfPosition(position); - } - function clearCache() { - sourceFileLike.clear(); - documentPositionMappers.clear(); - } -} -function getDocumentPositionMapper(host, generatedFileName, generatedFileLineInfo, readMapFile) { - let mapFileName = tryGetSourceMappingURL(generatedFileLineInfo); - if (mapFileName) { - const match = base64UrlRegExp.exec(mapFileName); - if (match) { - if (match[1]) { - const base64Object = match[1]; - return convertDocumentToSourceMapper(host, base64decode(sys, base64Object), generatedFileName); - } - mapFileName = void 0; - } - } - const possibleMapLocations = []; - if (mapFileName) { - possibleMapLocations.push(mapFileName); - } - possibleMapLocations.push(generatedFileName + ".map"); - const originalMapFileName = mapFileName && getNormalizedAbsolutePath(mapFileName, getDirectoryPath(generatedFileName)); - for (const location of possibleMapLocations) { - const mapFileName2 = getNormalizedAbsolutePath(location, getDirectoryPath(generatedFileName)); - const mapFileContents = readMapFile(mapFileName2, originalMapFileName); - if (isString(mapFileContents)) { - return convertDocumentToSourceMapper(host, mapFileContents, mapFileName2); - } - if (mapFileContents !== void 0) { - return mapFileContents || void 0; - } - } - return void 0; -} -function convertDocumentToSourceMapper(host, contents, mapFileName) { - const map2 = tryParseRawSourceMap(contents); - if (!map2 || !map2.sources || !map2.file || !map2.mappings) { - return void 0; - } - if (map2.sourcesContent && map2.sourcesContent.some(isString)) return void 0; - return createDocumentPositionMapper(host, map2, mapFileName); -} -function createSourceFileLike(text, lineMap) { - return { - text, - lineMap, - getLineAndCharacterOfPosition(pos) { - return computeLineAndCharacterOfPosition(getLineStarts(this), pos); - } - }; -} - -// src/services/suggestionDiagnostics.ts -var visitedNestedConvertibleFunctions = /* @__PURE__ */ new Map(); -function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { - var _a; - program.getSemanticDiagnostics(sourceFile, cancellationToken); - const diags = []; - const checker = program.getTypeChecker(); - const isCommonJSFile = program.getImpliedNodeFormatForEmit(sourceFile) === 1 /* CommonJS */ || fileExtensionIsOneOf(sourceFile.fileName, [".cts" /* Cts */, ".cjs" /* Cjs */]); - if (!isCommonJSFile && sourceFile.commonJsModuleIndicator && (programContainsEsModules(program) || compilerOptionsIndicateEsModules(program.getCompilerOptions())) && containsTopLevelCommonjs(sourceFile)) { - diags.push(createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module)); - } - const isJsFile = isSourceFileJS(sourceFile); - visitedNestedConvertibleFunctions.clear(); - check(sourceFile); - if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) { - for (const moduleSpecifier of sourceFile.imports) { - const importNode = importFromModuleSpecifier(moduleSpecifier); - if (isImportEqualsDeclaration(importNode) && hasSyntacticModifier(importNode, 32 /* Export */)) continue; - const name = importNameForConvertToDefaultImport(importNode); - if (!name) continue; - const module2 = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, sourceFile)) == 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)); - } - } - } - addRange(diags, sourceFile.bindSuggestionDiagnostics); - addRange(diags, program.getSuggestionDiagnostics(sourceFile, cancellationToken)); - diags.sort((d1, d2) => d1.start - d2.start); - return diags; - function check(node) { - if (isJsFile) { - if (canBeConvertedToClass(node, checker)) { - diags.push(createDiagnosticForNode(isVariableDeclaration(node.parent) ? node.parent.name : node, Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); - } - } else { - if (isVariableStatement(node) && node.parent === sourceFile && node.declarationList.flags & 2 /* Const */ && node.declarationList.declarations.length === 1) { - const init = node.declarationList.declarations[0].initializer; - if (init && isRequireCall( - init, - /*requireStringLiteralLikeArgument*/ - true - )) { - diags.push(createDiagnosticForNode(init, Diagnostics.require_call_may_be_converted_to_an_import)); - } - } - 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)) { - diags.push(createDiagnosticForNode(node.name || node, Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types)); - } - } - if (canBeConvertedToAsync(node)) { - addConvertToAsyncFunctionDiagnostics(node, checker, diags); - } - node.forEachChild(check); - } -} -function containsTopLevelCommonjs(sourceFile) { - return sourceFile.statements.some((statement) => { - switch (statement.kind) { - case 244 /* VariableStatement */: - return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall( - propertyAccessLeftHandSide(decl.initializer), - /*requireStringLiteralLikeArgument*/ - true - )); - case 245 /* ExpressionStatement */: { - const { expression } = statement; - if (!isBinaryExpression(expression)) return isRequireCall( - expression, - /*requireStringLiteralLikeArgument*/ - true - ); - const kind = getAssignmentDeclarationKind(expression); - return kind === 1 /* ExportsProperty */ || kind === 2 /* ModuleExports */; - } - default: - return false; - } - }); -} -function propertyAccessLeftHandSide(node) { - return isPropertyAccessExpression(node) ? propertyAccessLeftHandSide(node.expression) : node; -} -function importNameForConvertToDefaultImport(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - const { importClause, moduleSpecifier } = node; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 275 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; - case 272 /* ImportEqualsDeclaration */: - return node.name; - default: - return void 0; - } -} -function addConvertToAsyncFunctionDiagnostics(node, checker, diags) { - if (isConvertibleFunction(node, checker) && !visitedNestedConvertibleFunctions.has(getKeyFromNode(node))) { - diags.push(createDiagnosticForNode( - !node.name && isVariableDeclaration(node.parent) && isIdentifier(node.parent.name) ? node.parent.name : node, - Diagnostics.This_may_be_converted_to_an_async_function - )); - } -} -function isConvertibleFunction(node, checker) { - return !isAsyncFunction(node) && node.body && isBlock(node.body) && hasReturnStatementWithPromiseHandler(node.body, checker) && returnsPromise(node, checker); -} -function returnsPromise(node, checker) { - const signature = checker.getSignatureFromDeclaration(node); - const returnType = signature ? checker.getReturnTypeOfSignature(signature) : void 0; - return !!returnType && !!checker.getPromisedTypeOfPromise(returnType); -} -function getErrorNodeFromCommonJsIndicator(commonJsModuleIndicator) { - return isBinaryExpression(commonJsModuleIndicator) ? commonJsModuleIndicator.left : commonJsModuleIndicator; -} -function hasReturnStatementWithPromiseHandler(body, checker) { - return !!forEachReturnStatement(body, (statement) => isReturnStatementWithFixablePromiseHandler(statement, checker)); -} -function isReturnStatementWithFixablePromiseHandler(node, checker) { - return isReturnStatement(node) && !!node.expression && isFixablePromiseHandler(node.expression, checker); -} -function isFixablePromiseHandler(node, checker) { - if (!isPromiseHandler(node) || !hasSupportedNumberOfArguments(node) || !node.arguments.every((arg) => isFixablePromiseArgument(arg, checker))) { - return false; - } - let currentNode = node.expression.expression; - while (isPromiseHandler(currentNode) || isPropertyAccessExpression(currentNode)) { - if (isCallExpression(currentNode)) { - if (!hasSupportedNumberOfArguments(currentNode) || !currentNode.arguments.every((arg) => isFixablePromiseArgument(arg, checker))) { - return false; - } - currentNode = currentNode.expression.expression; - } else { - currentNode = currentNode.expression; - } - } - return true; -} -function isPromiseHandler(node) { - return isCallExpression(node) && (hasPropertyAccessExpressionWithName(node, "then") || hasPropertyAccessExpressionWithName(node, "catch") || hasPropertyAccessExpressionWithName(node, "finally")); -} -function hasSupportedNumberOfArguments(node) { - const name = node.expression.name.text; - const maxArguments = name === "then" ? 2 : name === "catch" ? 1 : name === "finally" ? 1 : 0; - if (node.arguments.length > maxArguments) return false; - if (node.arguments.length < maxArguments) return true; - return maxArguments === 1 || some(node.arguments, (arg) => { - return arg.kind === 106 /* NullKeyword */ || isIdentifier(arg) && arg.text === "undefined"; - }); -} -function isFixablePromiseArgument(arg, checker) { - switch (arg.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - const functionFlags = getFunctionFlags(arg); - if (functionFlags & 1 /* Generator */) { - return false; - } - // falls through - case 220 /* ArrowFunction */: - visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); - // falls through - case 106 /* NullKeyword */: - return true; - case 80 /* Identifier */: - case 212 /* PropertyAccessExpression */: { - const symbol = checker.getSymbolAtLocation(arg); - if (!symbol) { - return false; - } - return checker.isUndefinedSymbol(symbol) || some(skipAlias(symbol, checker).declarations, (d) => isFunctionLike(d) || hasInitializer(d) && !!d.initializer && isFunctionLike(d.initializer)); - } - default: - return false; - } -} -function getKeyFromNode(exp) { - return `${exp.pos.toString()}:${exp.end.toString()}`; -} -function canBeConvertedToClass(node, checker) { - var _a, _b, _c, _d; - if (isFunctionExpression(node)) { - if (isVariableDeclaration(node.parent) && ((_a = node.symbol.members) == null ? void 0 : _a.size)) { - return true; - } - const symbol = checker.getSymbolOfExpando( - node, - /*allowDeclaration*/ - false - ); - return !!(symbol && (((_b = symbol.exports) == null ? void 0 : _b.size) || ((_c = symbol.members) == null ? void 0 : _c.size))); - } - if (isFunctionDeclaration(node)) { - return !!((_d = node.symbol.members) == null ? void 0 : _d.size); - } - return false; -} -function canBeConvertedToAsync(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return true; - default: - return false; - } -} - -// src/services/transpile.ts -var optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([ - "isolatedModules" -]); -function transpileModule(input, transpileOptions) { - return transpileWorker( - input, - transpileOptions, - /*declaration*/ - false - ); -} -function transpileDeclaration(input, transpileOptions) { - return transpileWorker( - input, - transpileOptions, - /*declaration*/ - true - ); -} -var barebonesLibContent = `/// -interface Boolean {} -interface Function {} -interface CallableFunction {} -interface NewableFunction {} -interface IArguments {} -interface Number {} -interface Object {} -interface RegExp {} -interface String {} -interface Array { length: number; [n: number]: T; } -interface SymbolConstructor { - (desc?: string | number): symbol; - for(name: string): symbol; - readonly toStringTag: symbol; -} -declare var Symbol: SymbolConstructor; -interface Symbol { - readonly [Symbol.toStringTag]: string; -}`; -var barebonesLibName = "lib.d.ts"; -var barebonesLibSourceFile; -function transpileWorker(input, transpileOptions, declaration) { - barebonesLibSourceFile ?? (barebonesLibSourceFile = createSourceFile(barebonesLibName, barebonesLibContent, { languageVersion: 99 /* Latest */ })); - const diagnostics = []; - const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {}; - const defaultOptions = getDefaultCompilerOptions2(); - for (const key in defaultOptions) { - if (hasProperty(defaultOptions, key) && options[key] === void 0) { - options[key] = defaultOptions[key]; - } - } - for (const option of transpileOptionValueCompilerOptions) { - if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) { - continue; - } - options[option.name] = option.transpileOptionValue; - } - options.suppressOutputPathCheck = true; - options.allowNonTsExtensions = true; - if (declaration) { - options.declaration = true; - options.emitDeclarationOnly = true; - options.isolatedDeclarations = true; - } else { - options.declaration = false; - options.declarationMap = false; - } - const newLine = getNewLineCharacter(options); - const compilerHost = { - getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : fileName === normalizePath(barebonesLibName) ? barebonesLibSourceFile : void 0, - writeFile: (name, text) => { - if (fileExtensionIs(name, ".map")) { - Debug.assertEqual(sourceMapText, void 0, "Unexpected multiple source map outputs, file:", name); - sourceMapText = text; - } else { - Debug.assertEqual(outputText, void 0, "Unexpected multiple outputs, file:", name); - outputText = text; - } - }, - getDefaultLibFileName: () => barebonesLibName, - useCaseSensitiveFileNames: () => false, - getCanonicalFileName: (fileName) => fileName, - getCurrentDirectory: () => "", - getNewLine: () => newLine, - fileExists: (fileName) => fileName === inputFileName || !!declaration && fileName === barebonesLibName, - readFile: () => "", - directoryExists: () => true, - getDirectories: () => [] - }; - const inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts"); - const sourceFile = createSourceFile( - inputFileName, - input, - { - languageVersion: getEmitScriptTarget(options), - impliedNodeFormat: getImpliedNodeFormatForFile( - toPath(inputFileName, "", compilerHost.getCanonicalFileName), - /*packageJsonInfoCache*/ - void 0, - compilerHost, - options - ), - setExternalModuleIndicator: getSetExternalModuleIndicator(options), - jsDocParsingMode: transpileOptions.jsDocParsingMode ?? 0 /* ParseAll */ - } - ); - if (transpileOptions.moduleName) { - sourceFile.moduleName = transpileOptions.moduleName; - } - if (transpileOptions.renamedDependencies) { - sourceFile.renamedDependencies = new Map(Object.entries(transpileOptions.renamedDependencies)); - } - let outputText; - let sourceMapText; - const inputs = declaration ? [inputFileName, barebonesLibName] : [inputFileName]; - const program = createProgram(inputs, options, compilerHost); - if (transpileOptions.reportDiagnostics) { - addRange( - /*to*/ - diagnostics, - /*from*/ - program.getSyntacticDiagnostics(sourceFile) - ); - addRange( - /*to*/ - diagnostics, - /*from*/ - program.getOptionsDiagnostics() - ); - } - const result = program.emit( - /*targetSourceFile*/ - void 0, - /*writeFile*/ - void 0, - /*cancellationToken*/ - void 0, - /*emitOnlyDtsFiles*/ - declaration, - transpileOptions.transformers, - /*forceDtsEmit*/ - declaration - ); - addRange( - /*to*/ - diagnostics, - /*from*/ - result.diagnostics - ); - if (outputText === void 0) return Debug.fail("Output generation failed"); - return { outputText, diagnostics, sourceMapText }; -} -function transpile(input, compilerOptions, fileName, diagnostics, moduleName) { - const output = transpileModule(input, { compilerOptions, fileName, reportDiagnostics: !!diagnostics, moduleName }); - addRange(diagnostics, output.diagnostics); - return output.outputText; -} -var commandLineOptionsStringToEnum; -function fixupCompilerOptions(options, diagnostics) { - commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || filter(optionDeclarations, (o) => typeof o.type === "object" && !forEachEntry(o.type, (v) => typeof v !== "number")); - options = cloneCompilerOptions(options); - for (const opt of commandLineOptionsStringToEnum) { - if (!hasProperty(options, opt.name)) { - continue; - } - const value = options[opt.name]; - if (isString(value)) { - options[opt.name] = parseCustomTypeOption(opt, value, diagnostics); - } else { - if (!forEachEntry(opt.type, (v) => v === value)) { - diagnostics.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } - } - } - return options; -} - -// src/services/_namespaces/ts.NavigateTo.ts -var ts_NavigateTo_exports = {}; -__export(ts_NavigateTo_exports, { - getNavigateToItems: () => getNavigateToItems -}); - -// src/services/navigateTo.ts -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, !!excludeLibFiles, singleCurrentFile, rawItems); - }); - } - rawItems.sort(compareNavigateToItems); - return (maxResultCount === void 0 ? rawItems : rawItems.slice(0, maxResultCount)).map(createNavigateToItem); -} -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, excludeLibFiles, singleCurrentFile)) continue; - if (patternMatcher.patternContainsDots) { - const fullMatch = patternMatcher.getFullMatch(getContainers(declaration), name); - if (fullMatch) { - rawItems.push({ name, fileName, matchKind: fullMatch.kind, isCaseSensitive: fullMatch.isCaseSensitive, declaration }); - } - } else { - rawItems.push({ name, fileName, matchKind: match.kind, isCaseSensitive: match.isCaseSensitive, declaration }); - } - } -} -function shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile) { - var _a; - switch (declaration.kind) { - case 274 /* ImportClause */: - case 277 /* ImportSpecifier */: - case 272 /* ImportEqualsDeclaration */: - const importer = checker.getSymbolAtLocation(declaration.name); - const imported = checker.getAliasedSymbol(importer); - 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 === 168 /* 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); -} -function pushLiteral(node, containers) { - return isPropertyNameLiteral(node) && (containers.push(getTextOfIdentifierOrLiteral(node)), true); -} -function getContainers(declaration) { - const containers = []; - const name = getNameOfDeclaration(declaration); - if (name && name.kind === 168 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { - return emptyArray; - } - containers.shift(); - let container = getContainerNode(declaration); - while (container) { - if (!tryAddSingleDeclarationName(container, containers)) { - return emptyArray; - } - container = getContainerNode(container); - } - containers.reverse(); - return containers; -} -function compareNavigateToItems(i1, i2) { - return compareValues(i1.matchKind, i2.matchKind) || compareStringsCaseSensitiveUI(i1.name, i2.name); -} -function createNavigateToItem(rawItem) { - const declaration = rawItem.declaration; - const container = getContainerNode(declaration); - const containerName = container && getNameOfDeclaration(container); - return { - name: rawItem.name, - kind: getNodeKind(declaration), - kindModifiers: getNodeModifiers(declaration), - matchKind: PatternMatchKind[rawItem.matchKind], - isCaseSensitive: rawItem.isCaseSensitive, - fileName: rawItem.fileName, - textSpan: createTextSpanFromNode(declaration), - // TODO(jfreeman): What should be the containerName when the container has a computed name? - containerName: containerName ? containerName.text : "", - containerKind: containerName ? getNodeKind(container) : "" /* unknown */ - }; -} - -// src/services/_namespaces/ts.NavigationBar.ts -var ts_NavigationBar_exports = {}; -__export(ts_NavigationBar_exports, { - getNavigationBarItems: () => getNavigationBarItems, - getNavigationTree: () => getNavigationTree -}); - -// src/services/navigationBar.ts -var whiteSpaceRegex = /\s+/g; -var maxLength = 150; -var curCancellationToken; -var curSourceFile; -var parentsStack = []; -var parent; -var trackedEs5ClassesStack = []; -var trackedEs5Classes; -var emptyChildItemArray = []; -function getNavigationBarItems(sourceFile, cancellationToken) { - curCancellationToken = cancellationToken; - curSourceFile = sourceFile; - try { - return map(primaryNavBarMenuItems(rootNavigationBarNode(sourceFile)), convertToPrimaryNavBarMenuItem); - } finally { - reset(); - } -} -function getNavigationTree(sourceFile, cancellationToken) { - curCancellationToken = cancellationToken; - curSourceFile = sourceFile; - try { - return convertToTree(rootNavigationBarNode(sourceFile)); - } finally { - reset(); - } -} -function reset() { - curSourceFile = void 0; - curCancellationToken = void 0; - parentsStack = []; - parent = void 0; - emptyChildItemArray = []; -} -function nodeText(node) { - return cleanText(node.getText(curSourceFile)); -} -function navigationBarNodeKind(n) { - return n.node.kind; -} -function pushChild(parent2, child) { - if (parent2.children) { - parent2.children.push(child); - } else { - parent2.children = [child]; - } -} -function rootNavigationBarNode(sourceFile) { - Debug.assert(!parentsStack.length); - const root = { node: sourceFile, name: void 0, additionalNodes: void 0, parent: void 0, children: void 0, indent: 0 }; - parent = root; - for (const statement of sourceFile.statements) { - addChildrenRecursively(statement); - } - endNode(); - Debug.assert(!parent && !parentsStack.length); - return root; -} -function addLeafNode(node, name) { - pushChild(parent, emptyNavigationBarNode(node, name)); -} -function emptyNavigationBarNode(node, name) { - return { - node, - name: name || (isDeclaration(node) || isExpression(node) ? getNameOfDeclaration(node) : void 0), - additionalNodes: void 0, - parent, - children: void 0, - indent: parent.indent + 1 - }; -} -function addTrackedEs5Class(name) { - if (!trackedEs5Classes) { - trackedEs5Classes = /* @__PURE__ */ new Map(); - } - trackedEs5Classes.set(name, true); -} -function endNestedNodes(depth) { - for (let i = 0; i < depth; i++) endNode(); -} -function startNestedNodes(targetNode, entityName) { - const names = []; - while (!isPropertyNameLiteral(entityName)) { - const name = getNameOrArgument(entityName); - const nameText = getElementOrPropertyAccessName(entityName); - entityName = entityName.expression; - if (nameText === "prototype" || isPrivateIdentifier(name)) continue; - names.push(name); - } - names.push(entityName); - for (let i = names.length - 1; i > 0; i--) { - const name = names[i]; - startNode(targetNode, name); - } - return [names.length - 1, names[0]]; -} -function startNode(node, name) { - const navNode = emptyNavigationBarNode(node, name); - pushChild(parent, navNode); - parentsStack.push(parent); - trackedEs5ClassesStack.push(trackedEs5Classes); - trackedEs5Classes = void 0; - parent = navNode; -} -function endNode() { - if (parent.children) { - mergeChildren(parent.children, parent); - sortChildren(parent.children); - } - parent = parentsStack.pop(); - trackedEs5Classes = trackedEs5ClassesStack.pop(); -} -function addNodeWithRecursiveChild(node, child, name) { - startNode(node, name); - addChildrenRecursively(child); - endNode(); -} -function addNodeWithRecursiveInitializer(node) { - if (node.initializer && isFunctionOrClassExpression(node.initializer)) { - startNode(node); - forEachChild(node.initializer, addChildrenRecursively); - endNode(); - } else { - addNodeWithRecursiveChild(node, node.initializer); - } -} -function hasNavigationBarName(node) { - 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(); - if (!node || isToken(node)) { - return; - } - switch (node.kind) { - case 177 /* Constructor */: - const ctr = node; - addNodeWithRecursiveChild(ctr, ctr.body); - for (const param of ctr.parameters) { - if (isParameterPropertyDeclaration(param, ctr)) { - addLeafNode(param); - } - } - break; - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 174 /* MethodSignature */: - if (hasNavigationBarName(node)) { - addNodeWithRecursiveChild(node, node.body); - } - break; - case 173 /* PropertyDeclaration */: - if (hasNavigationBarName(node)) { - addNodeWithRecursiveInitializer(node); - } - break; - case 172 /* PropertySignature */: - if (hasNavigationBarName(node)) { - addLeafNode(node); - } - break; - case 274 /* ImportClause */: - const importClause = node; - if (importClause.name) { - addLeafNode(importClause.name); - } - const { namedBindings } = importClause; - if (namedBindings) { - if (namedBindings.kind === 275 /* NamespaceImport */) { - addLeafNode(namedBindings); - } else { - for (const element of namedBindings.elements) { - addLeafNode(element); - } - } - } - break; - case 305 /* ShorthandPropertyAssignment */: - addNodeWithRecursiveChild(node, node.name); - break; - case 306 /* SpreadAssignment */: - const { expression } = node; - isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); - break; - case 209 /* BindingElement */: - case 304 /* PropertyAssignment */: - case 261 /* VariableDeclaration */: { - const child = node; - if (isBindingPattern(child.name)) { - addChildrenRecursively(child.name); - } else { - addNodeWithRecursiveInitializer(child); - } - break; - } - case 263 /* FunctionDeclaration */: - const nameNode = node.name; - if (nameNode && isIdentifier(nameNode)) { - addTrackedEs5Class(nameNode.text); - } - addNodeWithRecursiveChild(node, node.body); - break; - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - addNodeWithRecursiveChild(node, node.body); - break; - case 267 /* EnumDeclaration */: - startNode(node); - for (const member of node.members) { - if (!isComputedProperty(member)) { - addLeafNode(member); - } - } - endNode(); - break; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - startNode(node); - for (const member of node.members) { - addChildrenRecursively(member); - } - endNode(); - break; - case 268 /* ModuleDeclaration */: - addNodeWithRecursiveChild(node, getInteriorModule(node).body); - break; - case 278 /* ExportAssignment */: { - const expression2 = node.expression; - const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0; - if (child) { - startNode(node); - addChildrenRecursively(child); - endNode(); - } else { - addLeafNode(node); - } - break; - } - case 282 /* ExportSpecifier */: - case 272 /* ImportEqualsDeclaration */: - case 182 /* IndexSignature */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 266 /* TypeAliasDeclaration */: - addLeafNode(node); - break; - case 214 /* CallExpression */: - case 227 /* BinaryExpression */: { - const special = getAssignmentDeclarationKind(node); - switch (special) { - case 1 /* ExportsProperty */: - case 2 /* ModuleExports */: - addNodeWithRecursiveChild(node, node.right); - return; - case 6 /* Prototype */: - case 3 /* PrototypeProperty */: { - const binaryExpression = node; - const assignmentTarget = binaryExpression.left; - const prototypeAccess = special === 3 /* PrototypeProperty */ ? assignmentTarget.expression : assignmentTarget; - let depth = 0; - let className; - if (isIdentifier(prototypeAccess.expression)) { - addTrackedEs5Class(prototypeAccess.expression.text); - className = prototypeAccess.expression; - } else { - [depth, className] = startNestedNodes(binaryExpression, prototypeAccess.expression); - } - if (special === 6 /* Prototype */) { - if (isObjectLiteralExpression(binaryExpression.right)) { - if (binaryExpression.right.properties.length > 0) { - startNode(binaryExpression, className); - forEachChild(binaryExpression.right, addChildrenRecursively); - endNode(); - } - } - } else if (isFunctionExpression(binaryExpression.right) || isArrowFunction(binaryExpression.right)) { - addNodeWithRecursiveChild(node, binaryExpression.right, className); - } else { - startNode(binaryExpression, className); - addNodeWithRecursiveChild(node, binaryExpression.right, assignmentTarget.name); - endNode(); - } - endNestedNodes(depth); - return; - } - case 7 /* ObjectDefinePropertyValue */: - case 9 /* ObjectDefinePrototypeProperty */: { - const defineCall = node; - const className = special === 7 /* ObjectDefinePropertyValue */ ? defineCall.arguments[0] : defineCall.arguments[0].expression; - const memberName = defineCall.arguments[1]; - const [depth, classNameIdentifier] = startNestedNodes(node, className); - startNode(node, classNameIdentifier); - startNode(node, setTextRange(factory.createIdentifier(memberName.text), memberName)); - addChildrenRecursively(node.arguments[2]); - endNode(); - endNode(); - endNestedNodes(depth); - return; - } - case 5 /* Property */: { - const binaryExpression = node; - const assignmentTarget = binaryExpression.left; - const targetFunction = assignmentTarget.expression; - if (isIdentifier(targetFunction) && getElementOrPropertyAccessName(assignmentTarget) !== "prototype" && trackedEs5Classes && trackedEs5Classes.has(targetFunction.text)) { - if (isFunctionExpression(binaryExpression.right) || isArrowFunction(binaryExpression.right)) { - addNodeWithRecursiveChild(node, binaryExpression.right, targetFunction); - } else if (isBindableStaticAccessExpression(assignmentTarget)) { - startNode(binaryExpression, targetFunction); - addNodeWithRecursiveChild(binaryExpression.left, binaryExpression.right, getNameOrArgument(assignmentTarget)); - endNode(); - } - return; - } - break; - } - case 4 /* ThisProperty */: - case 0 /* None */: - case 8 /* ObjectDefinePropertyExports */: - break; - default: - Debug.assertNever(special); - } - } - // falls through - default: - if (hasJSDocNodes(node)) { - forEach(node.jsDoc, (jsDoc) => { - forEach(jsDoc.tags, (tag) => { - if (isJSDocTypeAlias(tag)) { - addLeafNode(tag); - } - }); - }); - } - forEachChild(node, addChildrenRecursively); - } -} -function mergeChildren(children, node) { - const nameToItems = /* @__PURE__ */ new Map(); - filterMutate(children, (child, index) => { - const declName = child.name || getNameOfDeclaration(child.node); - const name = declName && nodeText(declName); - if (!name) { - return true; - } - const itemsWithSameName = nameToItems.get(name); - if (!itemsWithSameName) { - nameToItems.set(name, child); - return true; - } - if (itemsWithSameName instanceof Array) { - for (const itemWithSameName of itemsWithSameName) { - if (tryMerge(itemWithSameName, child, index, node)) { - return false; - } - } - itemsWithSameName.push(child); - return true; - } else { - const itemWithSameName = itemsWithSameName; - if (tryMerge(itemWithSameName, child, index, node)) { - return false; - } - nameToItems.set(name, [itemWithSameName, child]); - return true; - } - }); -} -var isEs5ClassMember = { - [5 /* Property */]: true, - [3 /* PrototypeProperty */]: true, - [7 /* ObjectDefinePropertyValue */]: true, - [9 /* ObjectDefinePrototypeProperty */]: true, - [0 /* None */]: false, - [1 /* ExportsProperty */]: false, - [2 /* ModuleExports */]: false, - [8 /* ObjectDefinePropertyExports */]: false, - [6 /* Prototype */]: true, - [4 /* ThisProperty */]: false -}; -function tryMergeEs5Class(a, b, bIndex, parent2) { - function isPossibleConstructor(node) { - return isFunctionExpression(node) || isFunctionDeclaration(node) || isVariableDeclaration(node); - } - const bAssignmentDeclarationKind = isBinaryExpression(b.node) || isCallExpression(b.node) ? getAssignmentDeclarationKind(b.node) : 0 /* None */; - const aAssignmentDeclarationKind = isBinaryExpression(a.node) || isCallExpression(a.node) ? getAssignmentDeclarationKind(a.node) : 0 /* None */; - if (isEs5ClassMember[bAssignmentDeclarationKind] && isEs5ClassMember[aAssignmentDeclarationKind] || isPossibleConstructor(a.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isPossibleConstructor(b.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration(a.node) && isSynthesized(a.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isClassDeclaration(b.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration(a.node) && isSynthesized(a.node) && isPossibleConstructor(b.node) || isClassDeclaration(b.node) && isPossibleConstructor(a.node) && isSynthesized(a.node)) { - let lastANode = a.additionalNodes && lastOrUndefined(a.additionalNodes) || a.node; - if (!isClassDeclaration(a.node) && !isClassDeclaration(b.node) || isPossibleConstructor(a.node) || isPossibleConstructor(b.node)) { - const ctorFunction = isPossibleConstructor(a.node) ? a.node : isPossibleConstructor(b.node) ? b.node : void 0; - if (ctorFunction !== void 0) { - const ctorNode = setTextRange( - factory.createConstructorDeclaration( - /*modifiers*/ - void 0, - [], - /*body*/ - void 0 - ), - ctorFunction - ); - const ctor = emptyNavigationBarNode(ctorNode); - ctor.indent = a.indent + 1; - ctor.children = a.node === ctorFunction ? a.children : b.children; - a.children = a.node === ctorFunction ? concatenate([ctor], b.children || [b]) : concatenate(a.children || [{ ...a }], [ctor]); - } else { - if (a.children || b.children) { - a.children = concatenate(a.children || [{ ...a }], b.children || [b]); - if (a.children) { - mergeChildren(a.children, a); - sortChildren(a.children); - } - } - } - 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) { - mergeChildren(a.children, a); - } - } - const bNode = b.node; - if (parent2.children[bIndex - 1].node.end === lastANode.end) { - setTextRange(lastANode, { pos: lastANode.pos, end: bNode.end }); - } 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 - )); - } - return true; - } - return bAssignmentDeclarationKind === 0 /* None */ ? false : true; -} -function tryMerge(a, b, bIndex, parent2) { - if (tryMergeEs5Class(a, b, bIndex, parent2)) { - return true; - } - if (shouldReallyMerge(a.node, b.node, parent2)) { - merge(a, b); - return true; - } - return false; -} -function shouldReallyMerge(a, b, parent2) { - if (a.kind !== b.kind || a.parent !== b.parent && !(isOwnChild(a, parent2) && isOwnChild(b, parent2))) { - return false; - } - switch (a.kind) { - case 173 /* PropertyDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return isStatic(a) === isStatic(b); - case 268 /* ModuleDeclaration */: - return areSameModule(a, b) && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b); - default: - return true; - } -} -function isSynthesized(node) { - return !!(node.flags & 16 /* Synthesized */); -} -function isOwnChild(n, parent2) { - if (n.parent === void 0) return false; - const par = isModuleBlock(n.parent) ? n.parent.parent : n.parent; - return par === parent2.node || contains(parent2.additionalNodes, par); -} -function areSameModule(a, b) { - if (!a.body || !b.body) { - return a.body === b.body; - } - return a.body.kind === b.body.kind && (a.body.kind !== 268 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); -} -function merge(target, source) { - target.additionalNodes = target.additionalNodes || []; - target.additionalNodes.push(source.node); - if (source.additionalNodes) { - target.additionalNodes.push(...source.additionalNodes); - } - target.children = concatenate(target.children, source.children); - if (target.children) { - mergeChildren(target.children, target); - sortChildren(target.children); - } -} -function sortChildren(children) { - children.sort(compareChildren); -} -function compareChildren(child1, child2) { - return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2)); -} -function tryGetName(node) { - if (node.kind === 268 /* ModuleDeclaration */) { - return getModuleName(node); - } - const declName = getNameOfDeclaration(node); - if (declName && isPropertyName(declName)) { - const propertyName = getPropertyNameForPropertyNameNode(declName); - return propertyName && unescapeLeadingUnderscores(propertyName); - } - switch (node.kind) { - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 232 /* ClassExpression */: - return getFunctionOrClassName(node); - default: - return void 0; - } -} -function getItemName(node, name) { - if (node.kind === 268 /* ModuleDeclaration */) { - return cleanText(getModuleName(node)); - } - if (name) { - const text = isIdentifier(name) ? name.text : isElementAccessExpression(name) ? `[${nodeText(name.argumentExpression)}]` : nodeText(name); - if (text.length > 0) { - return cleanText(text); - } - } - switch (node.kind) { - case 308 /* SourceFile */: - const sourceFile = node; - return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : ""; - case 278 /* ExportAssignment */: - return isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 220 /* ArrowFunction */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - if (getSyntacticModifierFlags(node) & 2048 /* Default */) { - return "default"; - } - return getFunctionOrClassName(node); - case 177 /* Constructor */: - return "constructor"; - case 181 /* ConstructSignature */: - return "new()"; - case 180 /* CallSignature */: - return "()"; - case 182 /* IndexSignature */: - return "[]"; - default: - return ""; - } -} -function primaryNavBarMenuItems(root) { - const primaryNavBarMenuItems2 = []; - function recur(item) { - if (shouldAppearInPrimaryNavBarMenu(item)) { - primaryNavBarMenuItems2.push(item); - if (item.children) { - for (const child of item.children) { - recur(child); - } - } - } - } - recur(root); - return primaryNavBarMenuItems2; - function shouldAppearInPrimaryNavBarMenu(item) { - if (item.children) { - return true; - } - switch (navigationBarNodeKind(item)) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 267 /* EnumDeclaration */: - case 265 /* InterfaceDeclaration */: - case 268 /* ModuleDeclaration */: - case 308 /* SourceFile */: - case 266 /* TypeAliasDeclaration */: - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - return true; - case 220 /* ArrowFunction */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - return isTopLevelFunctionDeclaration(item); - default: - return false; - } - function isTopLevelFunctionDeclaration(item2) { - if (!item2.node.body) { - return false; - } - switch (navigationBarNodeKind(item2.parent)) { - case 269 /* ModuleBlock */: - case 308 /* SourceFile */: - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - return true; - default: - return false; - } - } - } -} -function convertToTree(n) { - return { - text: getItemName(n.node, n.name), - kind: getNodeKind(n.node), - kindModifiers: getModifiers2(n.node), - spans: getSpans(n), - nameSpan: n.name && getNodeSpan(n.name), - childItems: map(n.children, convertToTree) - }; -} -function convertToPrimaryNavBarMenuItem(n) { - return { - text: getItemName(n.node, n.name), - kind: getNodeKind(n.node), - kindModifiers: getModifiers2(n.node), - spans: getSpans(n), - childItems: map(n.children, convertToSecondaryNavBarMenuItem) || emptyChildItemArray, - indent: n.indent, - bolded: false, - grayed: false - }; - function convertToSecondaryNavBarMenuItem(n2) { - return { - text: getItemName(n2.node, n2.name), - kind: getNodeKind(n2.node), - kindModifiers: getNodeModifiers(n2.node), - spans: getSpans(n2), - childItems: emptyChildItemArray, - indent: 0, - bolded: false, - grayed: false - }; - } -} -function getSpans(n) { - const spans = [getNodeSpan(n.node)]; - if (n.additionalNodes) { - for (const node of n.additionalNodes) { - spans.push(getNodeSpan(node)); - } - } - return spans; -} -function getModuleName(moduleDeclaration) { - if (isAmbientModule(moduleDeclaration)) { - return getTextOfNode(moduleDeclaration.name); - } - return getFullyQualifiedModuleName(moduleDeclaration); -} -function getFullyQualifiedModuleName(moduleDeclaration) { - const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 268 /* ModuleDeclaration */) { - moduleDeclaration = moduleDeclaration.body; - result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - } - return result.join("."); -} -function getInteriorModule(decl) { - return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; -} -function isComputedProperty(member) { - return !member.name || member.name.kind === 168 /* ComputedPropertyName */; -} -function getNodeSpan(node) { - return node.kind === 308 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); -} -function getModifiers2(node) { - if (node.parent && node.parent.kind === 261 /* VariableDeclaration */) { - node = node.parent; - } - return getNodeModifiers(node); -} -function getFunctionOrClassName(node) { - const { parent: parent2 } = node; - if (node.name && getFullWidth(node.name) > 0) { - return cleanText(declarationNameToString(node.name)); - } else if (isVariableDeclaration(parent2)) { - return cleanText(declarationNameToString(parent2.name)); - } else if (isBinaryExpression(parent2) && parent2.operatorToken.kind === 64 /* EqualsToken */) { - return nodeText(parent2.left).replace(whiteSpaceRegex, ""); - } else if (isPropertyAssignment(parent2)) { - return nodeText(parent2.name); - } else if (getSyntacticModifierFlags(node) & 2048 /* Default */) { - return "default"; - } else if (isClassLike(node)) { - return ""; - } else if (isCallExpression(parent2)) { - let name = getCalledExpressionName(parent2.expression); - if (name !== void 0) { - name = cleanText(name); - if (name.length > maxLength) { - return `${name} callback`; - } - const args = cleanText(mapDefined(parent2.arguments, (a) => isStringLiteralLike(a) || isTemplateLiteral(a) ? a.getText(curSourceFile) : void 0).join(", ")); - return `${name}(${args}) callback`; - } - } - return ""; -} -function getCalledExpressionName(expr) { - if (isIdentifier(expr)) { - return expr.text; - } else if (isPropertyAccessExpression(expr)) { - const left = getCalledExpressionName(expr.expression); - const right = expr.name.text; - return left === void 0 ? right : `${left}.${right}`; - } else { - return void 0; - } -} -function isFunctionOrClassExpression(node) { - switch (node.kind) { - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - case 232 /* ClassExpression */: - return true; - default: - return false; - } -} -function cleanText(text) { - text = text.length > maxLength ? text.substring(0, maxLength) + "..." : text; - return text.replace(/\\?(?:\r?\n|[\r\u2028\u2029])/g, ""); -} - -// src/services/_namespaces/ts.refactor.ts -var ts_refactor_exports = {}; -__export(ts_refactor_exports, { - addExportsInOldFile: () => addExportsInOldFile, - addImportsForMovedSymbols: () => addImportsForMovedSymbols, - addNewFileToTsconfig: () => addNewFileToTsconfig, - addOrRemoveBracesToArrowFunction: () => ts_refactor_addOrRemoveBracesToArrowFunction_exports, - addTargetFileImports: () => addTargetFileImports, - containsJsx: () => containsJsx, - convertArrowFunctionOrFunctionExpression: () => ts_refactor_convertArrowFunctionOrFunctionExpression_exports, - convertParamsToDestructuredObject: () => ts_refactor_convertParamsToDestructuredObject_exports, - convertStringOrTemplateLiteral: () => ts_refactor_convertStringOrTemplateLiteral_exports, - convertToOptionalChainExpression: () => ts_refactor_convertToOptionalChainExpression_exports, - createNewFileName: () => createNewFileName, - doChangeNamedToNamespaceOrDefault: () => doChangeNamedToNamespaceOrDefault, - extractSymbol: () => ts_refactor_extractSymbol_exports, - generateGetAccessorAndSetAccessor: () => ts_refactor_generateGetAccessorAndSetAccessor_exports, - getApplicableRefactors: () => getApplicableRefactors, - getEditsForRefactor: () => getEditsForRefactor, - getExistingLocals: () => getExistingLocals, - getIdentifierForNode: () => getIdentifierForNode, - getNewStatementsAndRemoveFromOldFile: () => getNewStatementsAndRemoveFromOldFile, - getStatementsToMove: () => getStatementsToMove, - getUsageInfo: () => getUsageInfo, - inferFunctionReturnType: () => ts_refactor_inferFunctionReturnType_exports, - isInImport: () => isInImport, - isRefactorErrorInfo: () => isRefactorErrorInfo, - refactorKindBeginsWith: () => refactorKindBeginsWith, - registerRefactor: () => registerRefactor -}); - -// src/services/refactorProvider.ts -var refactors = /* @__PURE__ */ new Map(); -function registerRefactor(name, refactor) { - refactors.set(name, refactor); -} -function getApplicableRefactors(context, includeInteractiveActions) { - return arrayFrom(flatMapIterator(refactors.values(), (refactor) => { - var _a; - 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, refactorName14, actionName2, interactiveRefactorArguments) { - const refactor = refactors.get(refactorName14); - return refactor && refactor.getEditsForAction(context, actionName2, interactiveRefactorArguments); -} - -// src/services/refactors/convertExport.ts -var refactorName = "Convert export"; -var defaultToNamedAction = { - name: "Convert default export to named export", - description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), - kind: "refactor.rewrite.export.named" -}; -var namedToDefaultAction = { - name: "Convert named export to default export", - description: getLocaleSpecificMessage(Diagnostics.Convert_named_export_to_default_export), - kind: "refactor.rewrite.export.default" -}; -registerRefactor(refactorName, { - kinds: [ - defaultToNamedAction.kind, - namedToDefaultAction.kind - ], - getAvailableActions: function getRefactorActionsToConvertBetweenNamedAndDefaultExports(context) { - const info = getInfo2(context, context.triggerReason === "invoked"); - if (!info) return emptyArray; - if (!isRefactorErrorInfo(info)) { - const action = info.wasDefault ? defaultToNamedAction : namedToDefaultAction; - return [{ name: refactorName, description: action.description, actions: [action] }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [ - { - name: refactorName, - description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), - actions: [ - { ...defaultToNamedAction, notApplicableReason: info.error }, - { ...namedToDefaultAction, notApplicableReason: info.error } - ] - } - ]; - } - return emptyArray; - }, - getEditsForAction: function getRefactorEditsToConvertBetweenNamedAndDefaultExports(context, actionName2) { - Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); - const info = getInfo2(context); - Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange(context.file, context.program, info, t, context.cancellationToken)); - return { edits, renameFilename: void 0, renameLocation: void 0 }; - } -}); -function getInfo2(context, considerPartialSpans = true) { - const { file, program } = context; - const span = getRefactorContextSpan(context); - const token = getTokenAtPosition(file, span.start); - 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 ? 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 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 268 /* ModuleDeclaration */: { - const node = exportNode; - if (!node.name) return void 0; - return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol }; - } - case 244 /* VariableStatement */: { - const vs = exportNode; - if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { - return void 0; - } - const decl = first(vs.declarationList.declarations); - if (!decl.initializer) return void 0; - Debug.assert(!wasDefault, "Can't have a default flag here"); - return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol }; - } - case 278 /* ExportAssignment */: { - const node = exportNode; - if (node.isExportEquals) return void 0; - return noSymbolError(node.expression) || { exportNode: node, exportName: node.expression, wasDefault, exportingModuleSymbol }; - } - default: - return void 0; - } -} -function doChange(exportingSourceFile, program, info, changes, cancellationToken) { - changeExport(exportingSourceFile, info, changes, program.getTypeChecker()); - changeImports(program, info, changes, cancellationToken); -} -function changeExport(exportingSourceFile, { wasDefault, exportNode, exportName }, changes, checker) { - if (wasDefault) { - if (isExportAssignment(exportNode) && !exportNode.isExportEquals) { - const exp = exportNode.expression; - const spec = makeExportSpecifier(exp.text, exp.text); - changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([spec]) - )); - } else { - changes.delete(exportingSourceFile, Debug.checkDefined(findModifier(exportNode, 90 /* DefaultKeyword */), "Should find a default keyword in modifier list")); - } - } else { - const exportKeyword = Debug.checkDefined(findModifier(exportNode, 95 /* ExportKeyword */), "Should find an export keyword in modifier list"); - switch (exportNode.kind) { - case 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken(90 /* DefaultKeyword */)); - break; - case 244 /* 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; - } - // falls through - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 268 /* ModuleDeclaration */: - changes.deleteModifier(exportingSourceFile, exportKeyword); - changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text))); - break; - default: - Debug.fail(`Unexpected exportNode kind ${exportNode.kind}`); - } - } -} -function changeImports(program, { wasDefault, exportName, exportingModuleSymbol }, changes, cancellationToken) { - const checker = program.getTypeChecker(); - const exportSymbol = Debug.checkDefined(checker.getSymbolAtLocation(exportName), "Export name should resolve to a symbol"); - ts_FindAllReferences_exports.Core.eachExportReference(program.getSourceFiles(), checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName.text, wasDefault, (ref) => { - if (exportName === ref) return; - const importingSourceFile = ref.getSourceFile(); - if (wasDefault) { - changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName.text); - } else { - changeNamedToDefaultImport(importingSourceFile, ref, changes); - } - }); -} -function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { - const { parent: parent2 } = ref; - switch (parent2.kind) { - case 212 /* PropertyAccessExpression */: - changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName)); - break; - case 277 /* ImportSpecifier */: - case 282 /* ExportSpecifier */: { - const spec = parent2; - changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); - break; - } - case 274 /* 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 === 275 /* 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( - /*defaultImport*/ - void 0, - [makeImportSpecifier(exportName, ref.text)], - clause.parent.moduleSpecifier, - quotePreference - ); - changes.insertNodeAfter(importingSourceFile, clause.parent, newImport); - } else { - changes.delete(importingSourceFile, ref); - changes.insertNodeAtEndOfList(importingSourceFile, namedBindings.elements, spec); - } - break; - } - case 206 /* ImportType */: - const importTypeNode = parent2; - changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); - break; - default: - Debug.failBadSyntaxKind(parent2); - } -} -function changeNamedToDefaultImport(importingSourceFile, ref, changes) { - const parent2 = ref.parent; - switch (parent2.kind) { - case 212 /* PropertyAccessExpression */: - changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default")); - break; - case 277 /* ImportSpecifier */: { - const defaultImport = factory.createIdentifier(parent2.name.text); - if (parent2.parent.elements.length === 1) { - changes.replaceNode(importingSourceFile, parent2.parent, defaultImport); - } else { - changes.delete(importingSourceFile, parent2); - changes.insertNodeBefore(importingSourceFile, parent2.parent, defaultImport); - } - break; - } - case 282 /* ExportSpecifier */: { - changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text)); - break; - } - default: - Debug.assertNever(parent2, `Unexpected parent kind ${parent2.kind}`); - } -} -function makeImportSpecifier(propertyName, name) { - return factory.createImportSpecifier( - /*isTypeOnly*/ - false, - propertyName === name ? void 0 : factory.createIdentifier(propertyName), - factory.createIdentifier(name) - ); -} -function makeExportSpecifier(propertyName, name) { - return factory.createExportSpecifier( - /*isTypeOnly*/ - false, - propertyName === name ? void 0 : factory.createIdentifier(propertyName), - factory.createIdentifier(name) - ); -} -function getExportingModuleSymbol(parent2, checker) { - if (isSourceFile(parent2)) { - return parent2.symbol; - } - const symbol = parent2.parent.symbol; - if (symbol.valueDeclaration && isExternalModuleAugmentation(symbol.valueDeclaration)) { - return checker.getMergedSymbol(symbol); - } - return symbol; -} - -// src/services/refactors/convertImport.ts -var refactorName2 = "Convert import"; -var actions = { - [0 /* Named */]: { - name: "Convert namespace import to named imports", - description: getLocaleSpecificMessage(Diagnostics.Convert_namespace_import_to_named_imports), - kind: "refactor.rewrite.import.named" - }, - [2 /* Namespace */]: { - name: "Convert named imports to namespace import", - description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_namespace_import), - kind: "refactor.rewrite.import.namespace" - }, - [1 /* Default */]: { - name: "Convert named imports to default import", - description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_default_import), - kind: "refactor.rewrite.import.default" - } -}; -registerRefactor(refactorName2, { - kinds: getOwnValues(actions).map((a) => a.kind), - getAvailableActions: function getRefactorActionsToConvertBetweenNamedAndNamespacedImports(context) { - const info = getImportConversionInfo(context, context.triggerReason === "invoked"); - if (!info) return emptyArray; - if (!isRefactorErrorInfo(info)) { - const action = actions[info.convertTo]; - return [{ name: refactorName2, description: action.description, actions: [action] }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return getOwnValues(actions).map((action) => ({ - name: refactorName2, - description: action.description, - actions: [{ ...action, notApplicableReason: info.error }] - })); - } - return emptyArray; - }, - getEditsForAction: function getRefactorEditsToConvertBetweenNamedAndNamespacedImports(context, actionName2) { - Debug.assert(some(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); - const info = getImportConversionInfo(context); - Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange2(context.file, context.program, t, info)); - return { edits, renameFilename: void 0, renameLocation: void 0 }; - } -}); -function getImportConversionInfo(context, considerPartialSpans = true) { - const { file } = context; - const span = getRefactorContextSpan(context); - const token = getTokenAtPosition(file, span.start); - const importDecl = considerPartialSpans ? findAncestor(token, or(isImportDeclaration, isJSDocImportTag)) : getParentNodeInSpan(token, file, span); - if (importDecl === void 0 || !(isImportDeclaration(importDecl) || isJSDocImportTag(importDecl))) return { error: "Selection is not an import declaration." }; - const end = span.start + span.length; - const nextToken = findNextToken(importDecl, importDecl.parent, file); - if (nextToken && end > nextToken.getStart()) return void 0; - const { importClause } = importDecl; - if (!importClause) { - return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_import_clause) }; - } - if (!importClause.namedBindings) { - return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) }; - } - if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { - return { convertTo: 0 /* Named */, import: importClause.namedBindings }; - } - const shouldUseDefault = getShouldUseDefault(context.program, importClause); - return shouldUseDefault ? { convertTo: 1 /* Default */, import: importClause.namedBindings } : { convertTo: 2 /* Namespace */, import: importClause.namedBindings }; -} -function getShouldUseDefault(program, importClause) { - return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); -} -function doChange2(sourceFile, program, changes, info) { - const checker = program.getTypeChecker(); - if (info.convertTo === 0 /* Named */) { - doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); - } else { - doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, info.import, info.convertTo === 1 /* Default */); - } -} -function doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, allowSyntheticDefaultImports) { - let usedAsNamespaceOrDefault = false; - const nodesToReplace = []; - const conflictingNames = /* @__PURE__ */ new Map(); - ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(toConvert.name, checker, sourceFile, (id) => { - if (!isPropertyAccessOrQualifiedName(id.parent)) { - usedAsNamespaceOrDefault = true; - } else { - const exportName = getRightOfPropertyAccessOrQualifiedName(id.parent).text; - if (checker.resolveName( - exportName, - id, - -1 /* All */, - /*excludeGlobals*/ - true - )) { - conflictingNames.set(exportName, true); - } - Debug.assert(getLeftOfPropertyAccessOrQualifiedName(id.parent) === id, "Parent expression should match id"); - nodesToReplace.push(id.parent); - } - }); - const exportNameToImportName = /* @__PURE__ */ new Map(); - for (const propertyAccessOrQualifiedName of nodesToReplace) { - const exportName = getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName).text; - let importName = exportNameToImportName.get(exportName); - if (importName === void 0) { - exportNameToImportName.set(exportName, importName = conflictingNames.has(exportName) ? getUniqueName(exportName, sourceFile) : exportName); - } - changes.replaceNode(sourceFile, propertyAccessOrQualifiedName, factory.createIdentifier(importName)); - } - const importSpecifiers = []; - exportNameToImportName.forEach((name, propertyName) => { - importSpecifiers.push(factory.createImportSpecifier( - /*isTypeOnly*/ - false, - name === propertyName ? void 0 : factory.createIdentifier(propertyName), - factory.createIdentifier(name) - )); - }); - const importDecl = toConvert.parent.parent; - if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports && isImportDeclaration(importDecl)) { - changes.insertNodeAfter(sourceFile, importDecl, createImport( - importDecl, - /*defaultImportName*/ - void 0, - importSpecifiers - )); - } else { - const defaultImportName = usedAsNamespaceOrDefault ? factory.createIdentifier(toConvert.name.text) : void 0; - changes.replaceNode(sourceFile, toConvert.parent, createImportClause(defaultImportName, importSpecifiers)); - } -} -function getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) { - return isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.name : propertyAccessOrQualifiedName.right; -} -function getLeftOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) { - return isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.expression : propertyAccessOrQualifiedName.left; -} -function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConvert, shouldUseDefault = getShouldUseDefault(program, toConvert.parent)) { - const checker = program.getTypeChecker(); - const importDecl = toConvert.parent.parent; - const { moduleSpecifier } = importDecl; - const toConvertSymbols = /* @__PURE__ */ new Set(); - toConvert.elements.forEach((namedImport) => { - const symbol = checker.getSymbolAtLocation(namedImport.name); - if (symbol) { - toConvertSymbols.add(symbol); - } - }); - const preferredName = moduleSpecifier && isStringLiteral(moduleSpecifier) ? moduleSpecifierToValidIdentifier(moduleSpecifier.text, 99 /* ESNext */) : "module"; - function hasNamespaceNameConflict(namedImport) { - return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(namedImport.name, checker, sourceFile, (id) => { - const symbol = checker.resolveName( - preferredName, - id, - -1 /* All */, - /*excludeGlobals*/ - true - ); - if (symbol) { - if (toConvertSymbols.has(symbol)) { - return isExportSpecifier(id.parent); - } - return true; - } - return false; - }); - } - const namespaceNameConflicts = toConvert.elements.some(hasNamespaceNameConflict); - const namespaceImportName = namespaceNameConflicts ? getUniqueName(preferredName, sourceFile) : preferredName; - const neededNamedImports = /* @__PURE__ */ new Set(); - for (const element of toConvert.elements) { - const propertyName = element.propertyName || element.name; - ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, (id) => { - const access = propertyName.kind === 11 /* StringLiteral */ ? factory.createElementAccessExpression(factory.createIdentifier(namespaceImportName), factory.cloneNode(propertyName)) : factory.createPropertyAccessExpression(factory.createIdentifier(namespaceImportName), factory.cloneNode(propertyName)); - if (isShorthandPropertyAssignment(id.parent)) { - changes.replaceNode(sourceFile, id.parent, factory.createPropertyAssignment(id.text, access)); - } else if (isExportSpecifier(id.parent)) { - neededNamedImports.add(element); - } else { - changes.replaceNode(sourceFile, id, access); - } - }); - } - changes.replaceNode( - sourceFile, - toConvert, - shouldUseDefault ? factory.createIdentifier(namespaceImportName) : factory.createNamespaceImport(factory.createIdentifier(namespaceImportName)) - ); - if (neededNamedImports.size && isImportDeclaration(importDecl)) { - const newNamedImports = arrayFrom(neededNamedImports.values(), (element) => factory.createImportSpecifier(element.isTypeOnly, element.propertyName && factory.cloneNode(element.propertyName), factory.cloneNode(element.name))); - changes.insertNodeAfter(sourceFile, toConvert.parent.parent, createImport( - importDecl, - /*defaultImportName*/ - void 0, - newNamedImports - )); - } -} -function isExportEqualsModule(moduleSpecifier, checker) { - const externalModule = checker.resolveExternalModuleName(moduleSpecifier); - if (!externalModule) return false; - const exportEquals = checker.resolveExternalModuleSymbol(externalModule); - return externalModule !== exportEquals; -} -function createImport(node, defaultImportName, elements) { - return factory.createImportDeclaration( - /*modifiers*/ - void 0, - createImportClause(defaultImportName, elements), - node.moduleSpecifier, - /*attributes*/ - void 0 - ); -} -function createImportClause(defaultImportName, elements) { - return factory.createImportClause( - /*phaseModifier*/ - void 0, - defaultImportName, - elements && elements.length ? factory.createNamedImports(elements) : void 0 - ); -} - -// src/services/refactors/extractType.ts -var refactorName3 = "Extract type"; -var extractToTypeAliasAction = { - name: "Extract to type alias", - description: getLocaleSpecificMessage(Diagnostics.Extract_to_type_alias), - kind: "refactor.extract.type" -}; -var extractToInterfaceAction = { - name: "Extract to interface", - description: getLocaleSpecificMessage(Diagnostics.Extract_to_interface), - kind: "refactor.extract.interface" -}; -var extractToTypeDefAction = { - name: "Extract to typedef", - description: getLocaleSpecificMessage(Diagnostics.Extract_to_typedef), - kind: "refactor.extract.typedef" -}; -registerRefactor(refactorName3, { - kinds: [ - extractToTypeAliasAction.kind, - extractToInterfaceAction.kind, - extractToTypeDefAction.kind - ], - getAvailableActions: function getRefactorActionsToExtractType(context) { - const { info, affectedTextRange } = getRangeToExtract(context, context.triggerReason === "invoked"); - if (!info) return emptyArray; - if (!isRefactorErrorInfo(info)) { - const refactorInfo = [{ - name: refactorName3, - description: getLocaleSpecificMessage(Diagnostics.Extract_type), - actions: info.isJS ? [extractToTypeDefAction] : append([extractToTypeAliasAction], info.typeElements && extractToInterfaceAction) - }]; - return refactorInfo.map((info2) => ({ - ...info2, - actions: info2.actions.map((action) => ({ - ...action, - range: affectedTextRange ? { - start: { line: getLineAndCharacterOfPosition(context.file, affectedTextRange.pos).line, offset: getLineAndCharacterOfPosition(context.file, affectedTextRange.pos).character }, - end: { line: getLineAndCharacterOfPosition(context.file, affectedTextRange.end).line, offset: getLineAndCharacterOfPosition(context.file, affectedTextRange.end).character } - } : void 0 - })) - })); - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [{ - name: refactorName3, - description: getLocaleSpecificMessage(Diagnostics.Extract_type), - actions: [ - { ...extractToTypeDefAction, notApplicableReason: info.error }, - { ...extractToTypeAliasAction, notApplicableReason: info.error }, - { ...extractToInterfaceAction, notApplicableReason: info.error } - ] - }]; - } - return emptyArray; - }, - getEditsForAction: function getRefactorEditsToExtractType(context, actionName2) { - const { file } = context; - const { info } = getRangeToExtract(context); - Debug.assert(info && !isRefactorErrorInfo(info), "Expected to find a range to extract"); - const name = getUniqueName("NewType", file); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - switch (actionName2) { - case extractToTypeAliasAction.name: - Debug.assert(!info.isJS, "Invalid actionName/JS combo"); - return doTypeAliasChange(changes, file, name, info); - case extractToTypeDefAction.name: - Debug.assert(info.isJS, "Invalid actionName/JS combo"); - return doTypedefChange(changes, context, file, name, info); - case extractToInterfaceAction.name: - Debug.assert(!info.isJS && !!info.typeElements, "Invalid actionName/JS combo"); - return doInterfaceChange(changes, file, name, info); - default: - Debug.fail("Unexpected action name"); - } - }); - const renameFilename = file.fileName; - const renameLocation = getRenameLocation( - edits, - renameFilename, - name, - /*preferLastLocation*/ - false - ); - return { edits, renameFilename, renameLocation }; - } -}); -function getRangeToExtract(context, considerEmptySpans = true) { - const { file, startPosition } = context; - const isJS = isSourceFileJS(file); - const range = createTextRangeFromSpan(getRefactorContextSpan(context)); - const isCursorRequest = range.pos === range.end && considerEmptySpans; - const firstType = getFirstTypeAt(file, startPosition, range, isCursorRequest); - if (!firstType || !isTypeNode(firstType)) return { info: { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) }, affectedTextRange: void 0 }; - const checker = context.program.getTypeChecker(); - const enclosingNode = getEnclosingNode(firstType, isJS); - if (enclosingNode === void 0) return { info: { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) }, affectedTextRange: void 0 }; - const expandedFirstType = getExpandedSelectionNode(firstType, enclosingNode); - if (!isTypeNode(expandedFirstType)) return { info: { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) }, affectedTextRange: void 0 }; - 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, affectedTextRange } = collectTypeParameters(checker, selection, enclosingNode, file); - if (!typeParameters) return { info: { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) }, affectedTextRange: void 0 }; - const typeElements = flattenTypeLiteralNodeReference(checker, selection); - return { info: { isJS, selection, enclosingNode, typeParameters, typeElements }, affectedTextRange }; -} -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 (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 Set(); - 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; - } - addRange(result, flattenedTypeMembers); - } - return result; - } else if (isParenthesizedTypeNode(selection)) { - return flattenTypeLiteralNodeReference(checker, selection.type); - } else if (isTypeLiteralNode(selection)) { - return selection.members; - } - return void 0; -} -function rangeContainsSkipTrivia(r1, node, file) { - return rangeContainsStartEnd(r1, skipTrivia(file.text, node.pos), node.end); -} -function collectTypeParameters(checker, selection, enclosingNode, file) { - const result = []; - const selectionArray = toArray(selection); - const selectionRange = { pos: selectionArray[0].getStart(file), end: selectionArray[selectionArray.length - 1].end }; - for (const t of selectionArray) { - if (visitor(t)) return { typeParameters: void 0, affectedTextRange: void 0 }; - } - return { typeParameters: result, affectedTextRange: selectionRange }; - function visitor(node) { - if (isTypeReferenceNode(node)) { - if (isIdentifier(node.typeName)) { - const typeName = node.typeName; - const symbol = checker.resolveName( - typeName.text, - typeName, - 262144 /* TypeParameter */, - /*excludeGlobals*/ - true - ); - 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, selectionRange, file)) { - return true; - } - if (rangeContainsSkipTrivia(enclosingNode, decl, file) && !rangeContainsSkipTrivia(selectionRange, decl, file)) { - pushIfUnique(result, decl); - break; - } - } - } - } - } else if (isInferTypeNode(node)) { - const conditionalTypeNode = findAncestor(node, (n) => isConditionalTypeNode(n) && rangeContainsSkipTrivia(n.extendsType, node, 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(selectionRange, functionLikeNode, file)) { - return true; - } - } else if (isTypeQueryNode(node)) { - if (isIdentifier(node.exprName)) { - const symbol = checker.resolveName( - node.exprName.text, - node.exprName, - 111551 /* Value */, - /*excludeGlobals*/ - false - ); - 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(selectionRange, node.parent, file)) { - return true; - } - } - } - if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) { - setEmitFlags(node, 1 /* SingleLine */); - } - return forEachChild(node, visitor); - } -} -function doTypeAliasChange(changes, file, name, info) { - const { enclosingNode, typeParameters } = info; - const { firstTypeNode, lastTypeNode, newTypeNode } = getNodesToEdit(info); - const newTypeDeclaration = factory.createTypeAliasDeclaration( - /*modifiers*/ - void 0, - name, - typeParameters.map((id) => factory.updateTypeParameterDeclaration( - id, - id.modifiers, - id.name, - id.constraint, - /*defaultType*/ - void 0 - )), - newTypeNode - ); - changes.insertNodeBefore( - file, - enclosingNode, - ignoreSourceNewlines(newTypeDeclaration), - /*blankLineBetween*/ - true - ); - changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( - id.name, - /*typeArguments*/ - void 0 - ))), { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.ExcludeWhitespace }); -} -function doInterfaceChange(changes, file, name, info) { - var _a; - const { enclosingNode, typeParameters, typeElements } = info; - const newTypeNode = factory.createInterfaceDeclaration( - /*modifiers*/ - void 0, - name, - typeParameters, - /*heritageClauses*/ - void 0, - typeElements - ); - setTextRange(newTypeNode, (_a = typeElements[0]) == null ? void 0 : _a.parent); - changes.insertNodeBefore( - file, - enclosingNode, - ignoreSourceNewlines(newTypeNode), - /*blankLineBetween*/ - true - ); - const { firstTypeNode, lastTypeNode } = getNodesToEdit(info); - changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( - id.name, - /*typeArguments*/ - void 0 - ))), { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.ExcludeWhitespace }); -} -function doTypedefChange(changes, context, file, name, info) { - var _a; - 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(newTypeNode), - factory.createIdentifier(name) - ); - const templates = []; - forEach(typeParameters, (typeParameter) => { - const constraint = getEffectiveConstraintOfTypeParameter(typeParameter); - const parameter = factory.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - typeParameter.name - ); - const template = factory.createJSDocTemplateTag( - factory.createIdentifier("template"), - constraint && cast(constraint, isJSDocTypeExpression), - [parameter] - ); - templates.push(template); - }); - const jsDoc = factory.createJSDocComment( - /*comment*/ - void 0, - factory.createNodeArray(concatenate(templates, [node])) - ); - if (isJSDoc(enclosingNode)) { - const pos = enclosingNode.getStart(file); - const newLineCharacter = getNewLineOrDefaultFromHost(context.host, (_a = context.formatContext) == null ? void 0 : _a.options); - changes.insertNodeAt(file, enclosingNode.getStart(file), jsDoc, { - suffix: newLineCharacter + newLineCharacter + file.text.slice(getPrecedingNonSpaceCharacterPosition(file.text, pos - 1), pos) - }); - } else { - changes.insertNodeBefore( - file, - enclosingNode, - jsDoc, - /*blankLineBetween*/ - true - ); - } - 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; -} - -// src/services/refactors/moveToFile.ts -var refactorNameForMoveToFile = "Move to file"; -var description = getLocaleSpecificMessage(Diagnostics.Move_to_file); -var moveToFileAction = { - name: "Move to file", - description, - kind: "refactor.move.file" -}; -registerRefactor(refactorNameForMoveToFile, { - kinds: [moveToFileAction.kind], - getAvailableActions: function getRefactorActionsToMoveToFile(context, interactiveRefactorArguments) { - const file = context.file; - const statements = getStatementsToMove(context); - if (!interactiveRefactorArguments) { - return emptyArray; - } - if (context.triggerReason === "implicit" && context.endPosition !== void 0) { - const startNodeAncestor = findAncestor(getTokenAtPosition(file, context.startPosition), isBlockLike); - const endNodeAncestor = findAncestor(getTokenAtPosition(file, context.endPosition), isBlockLike); - if (startNodeAncestor && !isSourceFile(startNodeAncestor) && endNodeAncestor && !isSourceFile(endNodeAncestor)) { - return emptyArray; - } - } - if (context.preferences.allowTextChangesInNewFiles && statements) { - const affectedTextRange = { - start: { line: getLineAndCharacterOfPosition(file, statements.all[0].getStart(file)).line, offset: getLineAndCharacterOfPosition(file, statements.all[0].getStart(file)).character }, - end: { line: getLineAndCharacterOfPosition(file, last(statements.all).end).line, offset: getLineAndCharacterOfPosition(file, last(statements.all).end).character } - }; - return [{ name: refactorNameForMoveToFile, description, actions: [{ ...moveToFileAction, range: affectedTextRange }] }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [{ name: refactorNameForMoveToFile, description, 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) => doChange3(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences)); - return { edits, renameFilename: void 0, renameLocation: void 0 }; - } - return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid)); - } -}); -function error(notApplicableReason) { - return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason }; -} -function doChange3(context, oldFile, targetFile, program, toMove, changes, host, preferences) { - const checker = program.getTypeChecker(); - const isForNewFile = !host.fileExists(targetFile); - const targetSourceFile = isForNewFile ? createFutureSourceFile(targetFile, oldFile.externalModuleIndicator ? 99 /* ESNext */ : oldFile.commonJsModuleIndicator ? 1 /* CommonJS */ : void 0, program, host) : Debug.checkDefined(program.getSourceFile(targetFile)); - const importAdderForOldFile = ts_codefix_exports.createImportAdder(oldFile, context.program, context.preferences, context.host); - const importAdderForNewFile = ts_codefix_exports.createImportAdder(targetSourceFile, context.program, context.preferences, context.host); - getNewStatementsAndRemoveFromOldFile(oldFile, targetSourceFile, getUsageInfo(oldFile, toMove.all, checker, isForNewFile ? void 0 : getExistingLocals(targetSourceFile, toMove.all, checker)), changes, toMove, program, host, preferences, importAdderForNewFile, importAdderForOldFile); - if (isForNewFile) { - addNewFileToTsconfig(program, changes, oldFile.fileName, targetFile, hostGetCanonicalFileName(host)); - } -} -function getNewStatementsAndRemoveFromOldFile(oldFile, targetFile, usage, changes, toMove, program, host, preferences, importAdderForNewFile, importAdderForOldFile) { - const checker = program.getTypeChecker(); - const prologueDirectives = takeWhile(oldFile.statements, isPrologueDirective); - const useEsModuleSyntax = !fileShouldUseJavaScriptRequire(targetFile.fileName, program, host, !!oldFile.commonJsModuleIndicator); - const quotePreference = getQuotePreference(oldFile, preferences); - addImportsForMovedSymbols(usage.oldFileImportsFromTargetFile, targetFile.fileName, importAdderForOldFile, program); - deleteUnusedOldImports(oldFile, toMove.all, usage.unusedImportsFromOldFile, importAdderForOldFile); - importAdderForOldFile.writeFixes(changes, quotePreference); - deleteMovedStatements(oldFile, toMove.ranges, changes); - updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, targetFile.fileName, quotePreference); - addExportsInOldFile(oldFile, usage.targetFileImportsFromOldFile, changes, useEsModuleSyntax); - addTargetFileImports(oldFile, usage.oldImportsNeededByTargetFile, usage.targetFileImportsFromOldFile, checker, program, importAdderForNewFile); - if (!isFullSourceFile(targetFile) && prologueDirectives.length) { - changes.insertStatementsInNewFile(targetFile.fileName, prologueDirectives, oldFile); - } - importAdderForNewFile.writeFixes(changes, quotePreference); - const body = addExports(oldFile, toMove.all, arrayFrom(usage.oldFileImportsFromTargetFile.keys()), useEsModuleSyntax); - if (isFullSourceFile(targetFile) && targetFile.statements.length > 0) { - moveStatementsToTargetFile(changes, program, body, targetFile, toMove); - } else if (isFullSourceFile(targetFile)) { - changes.insertNodesAtEndOfFile( - targetFile, - body, - /*blankLineBetween*/ - false - ); - } else { - changes.insertStatementsInNewFile(targetFile.fileName, importAdderForNewFile.hasFixes() ? [4 /* NewLineTrivia */, ...body] : body, oldFile); - } -} -function addNewFileToTsconfig(program, changes, oldFileName, newFileNameWithExtension, getCanonicalFileName) { - const cfg = program.getCompilerOptions().configFile; - if (!cfg) return; - const newFileAbsolutePath = normalizePath(combinePaths(oldFileName, "..", newFileNameWithExtension)); - const newFilePath = getRelativePathFromFile(cfg.fileName, newFileAbsolutePath, getCanonicalFileName); - const cfgObject = cfg.statements[0] && tryCast(cfg.statements[0].expression, isObjectLiteralExpression); - const filesProp = cfgObject && find(cfgObject.properties, (prop) => isPropertyAssignment(prop) && isStringLiteral(prop.name) && prop.name.text === "files"); - if (filesProp && isArrayLiteralExpression(filesProp.initializer)) { - changes.insertNodeInListAfter(cfg, last(filesProp.initializer.elements), factory.createStringLiteral(newFilePath), filesProp.initializer.elements); - } -} -function deleteMovedStatements(sourceFile, moved, changes) { - for (const { first: first2, afterLast } of moved) { - changes.deleteNodeRangeExcludingEnd(sourceFile, first2, afterLast); - } -} -function deleteUnusedOldImports(oldFile, toMove, toDelete, importAdder) { - for (const statement of oldFile.statements) { - if (contains(toMove, statement)) continue; - forEachImportInStatement(statement, (i) => { - forEachAliasDeclarationInImportOrRequire(i, (decl) => { - if (toDelete.has(decl.symbol)) { - importAdder.removeExistingImport(decl); - } - }); - }); - } -} -function addExportsInOldFile(oldFile, targetFileImportsFromOldFile, changes, useEsModuleSyntax) { - const markSeenTop = nodeSeenTracker(); - targetFileImportsFromOldFile.forEach((_, symbol) => { - if (!symbol.declarations) { - return; - } - for (const decl of symbol.declarations) { - if (!isTopLevelDeclaration(decl)) continue; - const name = nameOfTopLevelDeclaration(decl); - if (!name) continue; - const top = getTopLevelDeclarationStatement(decl); - if (markSeenTop(top)) { - addExportToChanges(oldFile, top, name, changes, useEsModuleSyntax); - } - } - }); -} -function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols, targetFileName, quotePreference) { - const checker = program.getTypeChecker(); - for (const sourceFile of program.getSourceFiles()) { - if (sourceFile === oldFile) continue; - for (const statement of sourceFile.statements) { - forEachImportInStatement(statement, (importNode) => { - if (checker.getSymbolAtLocation(moduleSpecifierFromImport(importNode)) !== oldFile.symbol) return; - const shouldMove = (name) => { - const symbol = isBindingElement(name.parent) ? getPropertySymbolFromBindingElement(checker, name.parent) : skipAlias(checker.getSymbolAtLocation(name), checker); - return !!symbol && movedSymbols.has(symbol); - }; - deleteUnusedImports(sourceFile, importNode, changes, shouldMove); - const pathToTargetFileWithExtension = resolvePath(getDirectoryPath(getNormalizedAbsolutePath(oldFile.fileName, program.getCurrentDirectory())), targetFileName); - if (getStringComparer(!program.useCaseSensitiveFileNames())(pathToTargetFileWithExtension, sourceFile.fileName) === 0 /* EqualTo */) return; - const newModuleSpecifier = ts_moduleSpecifiers_exports.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); - const ns = getNamespaceLikeImport(importNode); - if (ns) updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, ns, importNode, quotePreference); - }); - } - } -} -function getNamespaceLikeImport(node) { - switch (node.kind) { - case 273 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 275 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0; - case 272 /* ImportEqualsDeclaration */: - return node.name; - case 261 /* VariableDeclaration */: - return tryCast(node.name, isIdentifier); - default: - return Debug.assertNever(node, `Unexpected node kind ${node.kind}`); - } -} -function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, oldImportId, oldImportNode, quotePreference) { - const preferredNewNamespaceName = moduleSpecifierToValidIdentifier(newModuleSpecifier, 99 /* ESNext */); - let needUniqueName = false; - const toChange = []; - ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(oldImportId, checker, sourceFile, (ref) => { - if (!isPropertyAccessExpression(ref.parent)) return; - needUniqueName = needUniqueName || !!checker.resolveName( - preferredNewNamespaceName, - ref, - -1 /* All */, - /*excludeGlobals*/ - true - ); - if (movedSymbols.has(checker.getSymbolAtLocation(ref.parent.name))) { - toChange.push(ref); - } - }); - if (toChange.length) { - const newNamespaceName = needUniqueName ? getUniqueName(preferredNewNamespaceName, sourceFile) : preferredNewNamespaceName; - for (const ref of toChange) { - changes.replaceNode(sourceFile, ref, factory.createIdentifier(newNamespaceName)); - } - changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, preferredNewNamespaceName, newModuleSpecifier, quotePreference)); - } -} -function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier, quotePreference) { - const newNamespaceId = factory.createIdentifier(newNamespaceName); - const newModuleString = makeStringLiteral(newModuleSpecifier, quotePreference); - switch (node.kind) { - case 273 /* ImportDeclaration */: - return factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /*phaseModifier*/ - void 0, - /*name*/ - void 0, - factory.createNamespaceImport(newNamespaceId) - ), - newModuleString, - /*attributes*/ - void 0 - ); - case 272 /* ImportEqualsDeclaration */: - return factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - newNamespaceId, - factory.createExternalModuleReference(newModuleString) - ); - case 261 /* VariableDeclaration */: - return factory.createVariableDeclaration( - newNamespaceId, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - createRequireCall(newModuleString) - ); - default: - return Debug.assertNever(node, `Unexpected node kind ${node.kind}`); - } -} -function createRequireCall(moduleSpecifier) { - return factory.createCallExpression( - factory.createIdentifier("require"), - /*typeArguments*/ - void 0, - [moduleSpecifier] - ); -} -function moduleSpecifierFromImport(i) { - return i.kind === 273 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 272 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]; -} -function forEachImportInStatement(statement, cb) { - if (isImportDeclaration(statement)) { - if (isStringLiteral(statement.moduleSpecifier)) cb(statement); - } else if (isImportEqualsDeclaration(statement)) { - if (isExternalModuleReference(statement.moduleReference) && isStringLiteralLike(statement.moduleReference.expression)) { - cb(statement); - } - } else if (isVariableStatement(statement)) { - for (const decl of statement.declarationList.declarations) { - if (decl.initializer && isRequireCall( - decl.initializer, - /*requireStringLiteralLikeArgument*/ - true - )) { - cb(decl); - } - } - } -} -function forEachAliasDeclarationInImportOrRequire(importOrRequire, cb) { - var _a, _b, _c, _d, _e; - if (importOrRequire.kind === 273 /* ImportDeclaration */) { - if ((_a = importOrRequire.importClause) == null ? void 0 : _a.name) { - cb(importOrRequire.importClause); - } - if (((_c = (_b = importOrRequire.importClause) == null ? void 0 : _b.namedBindings) == null ? void 0 : _c.kind) === 275 /* NamespaceImport */) { - cb(importOrRequire.importClause.namedBindings); - } - if (((_e = (_d = importOrRequire.importClause) == null ? void 0 : _d.namedBindings) == null ? void 0 : _e.kind) === 276 /* NamedImports */) { - for (const element of importOrRequire.importClause.namedBindings.elements) { - cb(element); - } - } - } else if (importOrRequire.kind === 272 /* ImportEqualsDeclaration */) { - cb(importOrRequire); - } else if (importOrRequire.kind === 261 /* VariableDeclaration */) { - if (importOrRequire.name.kind === 80 /* Identifier */) { - cb(importOrRequire); - } else if (importOrRequire.name.kind === 207 /* ObjectBindingPattern */) { - for (const element of importOrRequire.name.elements) { - if (isIdentifier(element.name)) { - cb(element); - } - } - } - } -} -function addImportsForMovedSymbols(symbols, targetFileName, importAdder, program) { - for (const [symbol, isValidTypeOnlyUseSite] of symbols) { - const symbolName2 = getNameForExportedSymbol(symbol, getEmitScriptTarget(program.getCompilerOptions())); - const exportKind = symbol.name === "default" && symbol.parent ? 1 /* Default */ : 0 /* Named */; - importAdder.addImportForNonExistentExport(symbolName2, targetFileName, exportKind, symbol.flags, isValidTypeOnlyUseSite); - } -} -function makeVariableStatement(name, type, initializer, flags = 2 /* Const */) { - return factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - type, - initializer - )], flags) - ); -} -function addExports(sourceFile, toMove, needExport, useEs6Exports) { - return flatMap(toMove, (statement) => { - if (isTopLevelDeclarationStatement(statement) && !isExported(sourceFile, statement, useEs6Exports) && forEachTopLevelDeclaration(statement, (d) => { - var _a; - return needExport.includes(Debug.checkDefined((_a = tryCast(d, canHaveSymbol)) == null ? void 0 : _a.symbol)); - })) { - const exports2 = addExport(getSynthesizedDeepClone(statement), useEs6Exports); - if (exports2) return exports2; - } - return getSynthesizedDeepClone(statement); - }); -} -function isExported(sourceFile, decl, useEs6Exports, name) { - var _a; - if (useEs6Exports) { - 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) { - if (importDecl.kind === 273 /* ImportDeclaration */ && importDecl.importClause) { - const { name, namedBindings } = importDecl.importClause; - if ((!name || isUnused(name)) && (!namedBindings || namedBindings.kind === 276 /* NamedImports */ && namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)))) { - return changes.delete(sourceFile, importDecl); - } - } - forEachAliasDeclarationInImportOrRequire(importDecl, (i) => { - if (i.name && isIdentifier(i.name) && isUnused(i.name)) { - changes.delete(sourceFile, i); - } - }); -} -function isTopLevelDeclarationStatement(node) { - Debug.assert(isSourceFile(node.parent), "Node parent should be a SourceFile"); - return isNonVariableTopLevelDeclaration(node) || isVariableStatement(node); -} -function addExport(decl, useEs6Exports) { - return useEs6Exports ? [addEs6Export(decl)] : addCommonjsExport(decl); -} -function addEs6Export(d) { - const modifiers = canHaveModifiers(d) ? concatenate([factory.createModifier(95 /* ExportKeyword */)], getModifiers(d)) : void 0; - switch (d.kind) { - case 263 /* FunctionDeclaration */: - return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 264 /* 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 244 /* VariableStatement */: - return factory.updateVariableStatement(d, modifiers, d.declarationList); - case 268 /* ModuleDeclaration */: - return factory.updateModuleDeclaration(d, modifiers, d.name, d.body); - case 267 /* EnumDeclaration */: - return factory.updateEnumDeclaration(d, modifiers, d.name, d.members); - case 266 /* TypeAliasDeclaration */: - return factory.updateTypeAliasDeclaration(d, modifiers, d.name, d.typeParameters, d.type); - case 265 /* InterfaceDeclaration */: - return factory.updateInterfaceDeclaration(d, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 272 /* ImportEqualsDeclaration */: - return factory.updateImportEqualsDeclaration(d, modifiers, d.isTypeOnly, d.name, d.moduleReference); - case 245 /* ExpressionStatement */: - return Debug.fail(); - default: - return Debug.assertNever(d, `Unexpected declaration kind ${d.kind}`); - } -} -function addCommonjsExport(decl) { - return [decl, ...getNamesToExportInCommonJS(decl).map(createExportAssignment)]; -} -function createExportAssignment(name) { - return factory.createExpressionStatement( - factory.createBinaryExpression( - factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(name)), - 64 /* EqualsToken */, - factory.createIdentifier(name) - ) - ); -} -function getNamesToExportInCommonJS(decl) { - switch (decl.kind) { - case 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: - return [decl.name.text]; - // TODO: GH#18217 - case 244 /* VariableStatement */: - return mapDefined(decl.declarationList.declarations, (d) => isIdentifier(d.name) ? d.name.text : void 0); - case 268 /* ModuleDeclaration */: - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 265 /* InterfaceDeclaration */: - case 272 /* ImportEqualsDeclaration */: - return emptyArray; - case 245 /* ExpressionStatement */: - return Debug.fail("Can't export an ExpressionStatement"); - default: - return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`); - } -} -function filterImport(i, moduleSpecifier, keep) { - switch (i.kind) { - case 273 /* ImportDeclaration */: { - const clause = i.importClause; - if (!clause) return void 0; - const defaultImport = clause.name && keep(clause.name) ? clause.name : void 0; - const namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep); - return defaultImport || namedBindings ? factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause(clause.phaseModifier, defaultImport, namedBindings), - getSynthesizedDeepClone(moduleSpecifier), - /*attributes*/ - void 0 - ) : void 0; - } - case 272 /* ImportEqualsDeclaration */: - return keep(i.name) ? i : void 0; - case 261 /* VariableDeclaration */: { - const name = filterBindingName(i.name, keep); - return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : void 0; - } - default: - return Debug.assertNever(i, `Unexpected import kind ${i.kind}`); - } -} -function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 275 /* NamespaceImport */) { - return keep(namedBindings.name) ? namedBindings : void 0; - } else { - const newElements = namedBindings.elements.filter((e) => keep(e.name)); - return newElements.length ? factory.createNamedImports(newElements) : void 0; - } -} -function filterBindingName(name, keep) { - switch (name.kind) { - case 80 /* Identifier */: - return keep(name) ? name : void 0; - case 208 /* ArrayBindingPattern */: - return name; - case 207 /* ObjectBindingPattern */: { - const newElements = name.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name)); - return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0; - } - } -} -function nameOfTopLevelDeclaration(d) { - return isExpressionStatement(d) ? tryCast(d.expression.left.name, isIdentifier) : tryCast(d.name, isIdentifier); -} -function getTopLevelDeclarationStatement(d) { - switch (d.kind) { - case 261 /* VariableDeclaration */: - return d.parent.parent; - case 209 /* BindingElement */: - return getTopLevelDeclarationStatement( - cast(d.parent.parent, (p) => isVariableDeclaration(p) || isBindingElement(p)) - ); - default: - return d; - } -} -function addExportToChanges(sourceFile, decl, name, changes, useEs6Exports) { - if (isExported(sourceFile, decl, useEs6Exports, name)) return; - if (useEs6Exports) { - if (!isExpressionStatement(decl)) changes.insertExportModifier(sourceFile, decl); - } else { - const names = getNamesToExportInCommonJS(decl); - if (names.length !== 0) changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment)); - } -} -function createNewFileName(oldFile, program, host, toMove) { - const checker = program.getTypeChecker(); - if (toMove) { - const usage = getUsageInfo(oldFile, toMove.all, checker); - const currentDirectory = getDirectoryPath(oldFile.fileName); - const extension = extensionFromPath(oldFile.fileName); - const newFileName = combinePaths( - // new file is always placed in the same directory as the old file - currentDirectory, - // ensures the filename computed below isn't already taken - makeUniqueFilename( - // infers a name for the new file from the symbols being moved - inferNewFileName(usage.oldFileImportsFromTargetFile, usage.movedSymbols), - extension, - currentDirectory, - host - ) - ) + extension; - return newFileName; - } - return ""; -} -function getRangeToMove(context) { - const { file } = context; - const range = createTextRangeFromSpan(getRefactorContextSpan(context)); - const { statements } = file; - let startNodeIndex = findIndex(statements, (s) => s.end > range.pos); - if (startNodeIndex === -1) return void 0; - const startStatement = statements[startNodeIndex]; - 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; - } - return { - toMove: statements.slice(startNodeIndex, endNodeIndex === -1 ? statements.length : endNodeIndex + 1), - afterLast: endNodeIndex === -1 ? void 0 : statements[endNodeIndex + 1] - }; -} -function getStatementsToMove(context) { - const rangeToMove = getRangeToMove(context); - if (rangeToMove === void 0) return void 0; - const all = []; - const ranges = []; - const { toMove, afterLast } = rangeToMove; - getRangesWhere(toMove, isAllowedStatementToMove, (start, afterEndIndex) => { - for (let i = start; i < afterEndIndex; i++) all.push(toMove[i]); - ranges.push({ first: toMove[start], afterLast }); - }); - 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 273 /* ImportDeclaration */: - return true; - case 272 /* ImportEqualsDeclaration */: - return !hasSyntacticModifier(node, 32 /* Export */); - case 244 /* VariableStatement */: - return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall( - d.initializer, - /*requireStringLiteralLikeArgument*/ - true - )); - default: - return false; - } -} -function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PURE__ */ new Set(), enclosingRange) { - var _a; - const movedSymbols = /* @__PURE__ */ new Set(); - const oldImportsNeededByTargetFile = /* @__PURE__ */ new Map(); - const targetFileImportsFromOldFile = /* @__PURE__ */ new Map(); - const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx(toMove)); - if (jsxNamespaceSymbol) { - oldImportsNeededByTargetFile.set(jsxNamespaceSymbol, [false, tryCast((_a = jsxNamespaceSymbol.declarations) == null ? void 0 : _a[0], (d) => isImportSpecifier(d) || isImportClause(d) || isNamespaceImport(d) || isImportEqualsDeclaration(d) || isBindingElement(d) || isVariableDeclaration(d))]); - } - for (const statement of toMove) { - forEachTopLevelDeclaration(statement, (decl) => { - 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, enclosingRange, (symbol, isValidTypeOnlyUseSite) => { - if (!some(symbol.declarations)) { - return; - } - if (existingTargetLocals.has(skipAlias(symbol, checker))) { - unusedImportsFromOldFile.add(symbol); - return; - } - const importedDeclaration = find(symbol.declarations, isInImport); - if (importedDeclaration) { - const prevIsTypeOnly = oldImportsNeededByTargetFile.get(symbol); - oldImportsNeededByTargetFile.set(symbol, [ - prevIsTypeOnly === void 0 ? isValidTypeOnlyUseSite : prevIsTypeOnly && isValidTypeOnlyUseSite, - tryCast(importedDeclaration, (d) => isImportSpecifier(d) || isImportClause(d) || isNamespaceImport(d) || isImportEqualsDeclaration(d) || isBindingElement(d) || isVariableDeclaration(d)) - ]); - } else if (!movedSymbols.has(symbol) && every(symbol.declarations, (decl) => isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile)) { - targetFileImportsFromOldFile.set(symbol, isValidTypeOnlyUseSite); - } - }); - } - for (const unusedImport of oldImportsNeededByTargetFile.keys()) { - unusedImportsFromOldFile.add(unusedImport); - } - const oldFileImportsFromTargetFile = /* @__PURE__ */ new Map(); - for (const statement of oldFile.statements) { - if (contains(toMove, statement)) continue; - if (jsxNamespaceSymbol && !!(statement.transformFlags & 2 /* ContainsJsx */)) { - unusedImportsFromOldFile.delete(jsxNamespaceSymbol); - } - forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => { - if (movedSymbols.has(symbol)) oldFileImportsFromTargetFile.set(symbol, isValidTypeOnlyUseSite); - unusedImportsFromOldFile.delete(symbol); - }); - } - return { movedSymbols, targetFileImportsFromOldFile, oldFileImportsFromTargetFile, oldImportsNeededByTargetFile, unusedImportsFromOldFile }; - function getJsxNamespaceSymbol(containsJsx2) { - if (containsJsx2 === void 0) { - return void 0; - } - const jsxNamespace = checker.getJsxNamespace(containsJsx2); - const jsxNamespaceSymbol2 = checker.resolveName( - jsxNamespace, - containsJsx2, - 1920 /* Namespace */, - /*excludeGlobals*/ - true - ); - return !!jsxNamespaceSymbol2 && some(jsxNamespaceSymbol2.declarations, isInImport) ? jsxNamespaceSymbol2 : void 0; - } -} -function makeUniqueFilename(proposedFilename, extension, inDirectory, host) { - let newFilename = proposedFilename; - for (let i = 1; ; i++) { - const name = combinePaths(inDirectory, newFilename + extension); - if (!host.fileExists(name)) return newFilename; - newFilename = `${proposedFilename}.${i}`; - } -} -function inferNewFileName(importsFromNewFile, movedSymbols) { - return forEachKey(importsFromNewFile, symbolNameNoDefault) || forEachKey(movedSymbols, symbolNameNoDefault) || "newFile"; -} -function forEachReference(node, checker, enclosingRange, onReference) { - node.forEachChild(function cb(node2) { - if (isIdentifier(node2) && !isDeclarationName(node2)) { - if (enclosingRange && !rangeContainsRange(enclosingRange, node2)) { - return; - } - const sym = checker.getSymbolAtLocation(node2); - if (sym) onReference(sym, isValidTypeOnlyAliasUseSite(node2)); - } else { - node2.forEachChild(cb); - } - }); -} -function forEachTopLevelDeclaration(statement, cb) { - switch (statement.kind) { - case 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: - case 268 /* ModuleDeclaration */: - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 265 /* InterfaceDeclaration */: - case 272 /* ImportEqualsDeclaration */: - return cb(statement); - case 244 /* VariableStatement */: - return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb)); - case 245 /* ExpressionStatement */: { - const { expression } = statement; - return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) : void 0; - } - } -} -function isInImport(decl) { - switch (decl.kind) { - case 272 /* ImportEqualsDeclaration */: - case 277 /* ImportSpecifier */: - case 274 /* ImportClause */: - case 275 /* NamespaceImport */: - return true; - case 261 /* VariableDeclaration */: - return isVariableDeclarationInImport(decl); - case 209 /* BindingElement */: - return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); - default: - return false; - } -} -function isVariableDeclarationInImport(decl) { - return isSourceFile(decl.parent.parent.parent) && !!decl.initializer && isRequireCall( - decl.initializer, - /*requireStringLiteralLikeArgument*/ - true - ); -} -function isTopLevelDeclaration(node) { - return isNonVariableTopLevelDeclaration(node) && isSourceFile(node.parent) || isVariableDeclaration(node) && isSourceFile(node.parent.parent.parent); -} -function sourceFileOfTopLevelDeclaration(node) { - return isVariableDeclaration(node) ? node.parent.parent.parent : node.parent; -} -function forEachTopLevelDeclarationInBindingName(name, cb) { - switch (name.kind) { - case 80 /* Identifier */: - return cb(cast(name.parent, (x) => isVariableDeclaration(x) || isBindingElement(x))); - case 208 /* ArrayBindingPattern */: - case 207 /* ObjectBindingPattern */: - return firstDefined(name.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb)); - default: - return Debug.assertNever(name, `Unexpected name kind ${name.kind}`); - } -} -function isNonVariableTopLevelDeclaration(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: - case 268 /* ModuleDeclaration */: - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 265 /* InterfaceDeclaration */: - case 272 /* 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, - /*enclosingRange*/ - void 0, - (s) => { - const symbol = skipAlias(s, checker); - if (symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration).path === sourceFile.path) { - existingLocals.add(symbol); - } - } - ); - } - return existingLocals; -} - -// src/services/refactors/helpers.ts -function isRefactorErrorInfo(info) { - return info.error !== void 0; -} -function refactorKindBeginsWith(known, requested) { - if (!requested) return true; - return known.substr(0, requested.length) === requested; -} -function getIdentifierForNode(node, scope, checker, file) { - return isPropertyAccessExpression(node) && !isClassLike(scope) && !checker.resolveName( - node.name.text, - node, - 111551 /* Value */, - /*excludeGlobals*/ - false - ) && !isPrivateIdentifier(node.name) && !identifierToKeywordKind(node.name) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); -} -function addTargetFileImports(oldFile, importsToCopy, targetFileImportsFromOldFile, checker, program, importAdder) { - importsToCopy.forEach(([isValidTypeOnlyUseSite, declaration], symbol) => { - var _a; - const targetSymbol = skipAlias(symbol, checker); - if (checker.isUnknownSymbol(targetSymbol)) { - importAdder.addVerbatimImport(Debug.checkDefined(declaration ?? findAncestor((_a = symbol.declarations) == null ? void 0 : _a[0], isAnyImportOrRequireStatement))); - } else if (targetSymbol.parent === void 0) { - Debug.assert(declaration !== void 0, "expected module symbol to have a declaration"); - importAdder.addImportForModuleSymbol(symbol, isValidTypeOnlyUseSite, declaration); - } else { - importAdder.addImportFromExportedSymbol(targetSymbol, isValidTypeOnlyUseSite, declaration); - } - }); - addImportsForMovedSymbols(targetFileImportsFromOldFile, oldFile.fileName, importAdder, program); -} - -// src/services/refactors/inlineVariable.ts -var refactorName4 = "Inline variable"; -var refactorDescription = getLocaleSpecificMessage(Diagnostics.Inline_variable); -var 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) { - const closestStringIdentifierParent = isStringLiteral(replacement) && isIdentifier(node) && walkUpParenthesizedExpressions(node.parent); - if (closestStringIdentifierParent && isTemplateSpan(closestStringIdentifierParent) && !isTaggedTemplateExpression(closestStringIdentifierParent.parent.parent)) { - replaceTemplateStringVariableWithLiteral(tracker, file, closestStringIdentifierParent, replacement); - } else { - tracker.replaceNode(file, node, getReplacementExpression(node, replacement)); - } - } - tracker.delete(file, declaration); - }); - return { edits }; - } -}); -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; -} -function replaceTemplateStringVariableWithLiteral(tracker, sourceFile, reference, replacement) { - const templateExpression = reference.parent; - const index = templateExpression.templateSpans.indexOf(reference); - const prevNode = index === 0 ? templateExpression.head : templateExpression.templateSpans[index - 1]; - tracker.replaceRangeWithText( - sourceFile, - { - pos: prevNode.getEnd() - 2, - end: reference.literal.getStart() + 1 - }, - replacement.text.replace(/\\/g, "\\\\").replace(/`/g, "\\`") - ); -} - -// src/services/refactors/moveToNewFile.ts -var refactorName5 = "Move to a new file"; -var description2 = getLocaleSpecificMessage(Diagnostics.Move_to_a_new_file); -var moveToNewFileAction = { - name: refactorName5, - description: description2, - kind: "refactor.move.newFile" -}; -registerRefactor(refactorName5, { - kinds: [moveToNewFileAction.kind], - getAvailableActions: function getRefactorActionsToMoveToNewFile(context) { - const statements = getStatementsToMove(context); - const file = context.file; - if (context.triggerReason === "implicit" && context.endPosition !== void 0) { - const startNodeAncestor = findAncestor(getTokenAtPosition(file, context.startPosition), isBlockLike); - const endNodeAncestor = findAncestor(getTokenAtPosition(file, context.endPosition), isBlockLike); - if (startNodeAncestor && !isSourceFile(startNodeAncestor) && endNodeAncestor && !isSourceFile(endNodeAncestor)) { - return emptyArray; - } - } - if (context.preferences.allowTextChangesInNewFiles && statements) { - const file2 = context.file; - const affectedTextRange = { - start: { line: getLineAndCharacterOfPosition(file2, statements.all[0].getStart(file2)).line, offset: getLineAndCharacterOfPosition(file2, statements.all[0].getStart(file2)).character }, - end: { line: getLineAndCharacterOfPosition(file2, last(statements.all).end).line, offset: getLineAndCharacterOfPosition(file2, last(statements.all).end).character } - }; - return [{ name: refactorName5, description: description2, actions: [{ ...moveToNewFileAction, range: affectedTextRange }] }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [{ name: refactorName5, description: description2, actions: [{ ...moveToNewFileAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_statement_or_statements) }] }]; - } - return emptyArray; - }, - getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { - Debug.assert(actionName2 === refactorName5, "Wrong refactor invoked"); - const statements = Debug.checkDefined(getStatementsToMove(context)); - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context.file, context.program, statements, t, context.host, context, context.preferences)); - return { edits, renameFilename: void 0, renameLocation: void 0 }; - } -}); -function doChange4(oldFile, program, toMove, changes, host, context, preferences) { - const checker = program.getTypeChecker(); - const usage = getUsageInfo(oldFile, toMove.all, checker); - const newFilename = createNewFileName(oldFile, program, host, toMove); - const newSourceFile = createFutureSourceFile(newFilename, oldFile.externalModuleIndicator ? 99 /* ESNext */ : oldFile.commonJsModuleIndicator ? 1 /* CommonJS */ : void 0, program, host); - const importAdderForOldFile = ts_codefix_exports.createImportAdder(oldFile, context.program, context.preferences, context.host); - const importAdderForNewFile = ts_codefix_exports.createImportAdder(newSourceFile, context.program, context.preferences, context.host); - getNewStatementsAndRemoveFromOldFile(oldFile, newSourceFile, usage, changes, toMove, program, host, preferences, importAdderForNewFile, importAdderForOldFile); - addNewFileToTsconfig(program, changes, oldFile.fileName, newFilename, hostGetCanonicalFileName(host)); -} - -// src/services/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.ts -var ts_refactor_addOrRemoveBracesToArrowFunction_exports = {}; - -// src/services/refactors/convertOverloadListToSingleSignature.ts -var refactorName6 = "Convert overload list to single signature"; -var refactorDescription2 = getLocaleSpecificMessage(Diagnostics.Convert_overload_list_to_single_signature); -var functionOverloadAction = { - name: refactorName6, - description: refactorDescription2, - kind: "refactor.rewrite.function.overloadList" -}; -registerRefactor(refactorName6, { - kinds: [functionOverloadAction.kind], - getEditsForAction: getRefactorEditsToConvertOverloadsToOneSignature, - getAvailableActions: getRefactorActionsToConvertOverloadsToOneSignature -}); -function getRefactorActionsToConvertOverloadsToOneSignature(context) { - const { file, startPosition, program } = context; - const info = getConvertableOverloadListAtPosition(file, startPosition, program); - if (!info) return emptyArray; - return [{ - name: refactorName6, - description: refactorDescription2, - actions: [functionOverloadAction] - }]; -} -function getRefactorEditsToConvertOverloadsToOneSignature(context) { - const { file, startPosition, program } = context; - const signatureDecls = getConvertableOverloadListAtPosition(file, startPosition, program); - if (!signatureDecls) return void 0; - const checker = program.getTypeChecker(); - const lastDeclaration = signatureDecls[signatureDecls.length - 1]; - let updated = lastDeclaration; - switch (lastDeclaration.kind) { - case 174 /* MethodSignature */: { - updated = factory.updateMethodSignature( - lastDeclaration, - lastDeclaration.modifiers, - lastDeclaration.name, - lastDeclaration.questionToken, - lastDeclaration.typeParameters, - getNewParametersForCombinedSignature(signatureDecls), - lastDeclaration.type - ); - break; - } - case 175 /* MethodDeclaration */: { - updated = factory.updateMethodDeclaration( - lastDeclaration, - lastDeclaration.modifiers, - lastDeclaration.asteriskToken, - lastDeclaration.name, - lastDeclaration.questionToken, - lastDeclaration.typeParameters, - getNewParametersForCombinedSignature(signatureDecls), - lastDeclaration.type, - lastDeclaration.body - ); - break; - } - case 180 /* CallSignature */: { - updated = factory.updateCallSignature( - lastDeclaration, - lastDeclaration.typeParameters, - getNewParametersForCombinedSignature(signatureDecls), - lastDeclaration.type - ); - break; - } - case 177 /* Constructor */: { - updated = factory.updateConstructorDeclaration( - lastDeclaration, - lastDeclaration.modifiers, - getNewParametersForCombinedSignature(signatureDecls), - lastDeclaration.body - ); - break; - } - case 181 /* ConstructSignature */: { - updated = factory.updateConstructSignature( - lastDeclaration, - lastDeclaration.typeParameters, - getNewParametersForCombinedSignature(signatureDecls), - lastDeclaration.type - ); - break; - } - case 263 /* FunctionDeclaration */: { - updated = factory.updateFunctionDeclaration( - lastDeclaration, - lastDeclaration.modifiers, - lastDeclaration.asteriskToken, - lastDeclaration.name, - lastDeclaration.typeParameters, - getNewParametersForCombinedSignature(signatureDecls), - lastDeclaration.type, - lastDeclaration.body - ); - break; - } - default: - return Debug.failBadSyntaxKind(lastDeclaration, "Unhandled signature kind in overload list conversion refactoring"); - } - if (updated === lastDeclaration) { - return; - } - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - t.replaceNodeRange(file, signatureDecls[0], signatureDecls[signatureDecls.length - 1], updated); - }); - return { renameFilename: void 0, renameLocation: void 0, edits }; - function getNewParametersForCombinedSignature(signatureDeclarations) { - const lastSig = signatureDeclarations[signatureDeclarations.length - 1]; - if (isFunctionLikeDeclaration(lastSig) && lastSig.body) { - signatureDeclarations = signatureDeclarations.slice(0, signatureDeclarations.length - 1); - } - return factory.createNodeArray([ - factory.createParameterDeclaration( - /*modifiers*/ - void 0, - factory.createToken(26 /* DotDotDotToken */), - "args", - /*questionToken*/ - void 0, - factory.createUnionTypeNode(map(signatureDeclarations, convertSignatureParametersToTuple)) - ) - ]); - } - function convertSignatureParametersToTuple(decl) { - const members = map(decl.parameters, convertParameterToNamedTupleMember); - return setEmitFlags(factory.createTupleTypeNode(members), some(members, (m) => !!length(getSyntheticLeadingComments(m))) ? 0 /* None */ : 1 /* SingleLine */); - } - 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 parameterDocComment = p.symbol && p.symbol.getDocumentationComment(checker); - if (parameterDocComment) { - const newComment = displayPartsToString(parameterDocComment); - if (newComment.length) { - setSyntheticLeadingComments(result, [{ - text: `* -${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} - `, - kind: 3 /* MultiLineCommentTrivia */, - pos: -1, - end: -1, - hasTrailingNewLine: true, - hasLeadingNewline: true - }]); - } - } - return result; - } -} -function isConvertableSignatureDeclaration(d) { - switch (d.kind) { - case 174 /* MethodSignature */: - case 175 /* MethodDeclaration */: - case 180 /* CallSignature */: - case 177 /* Constructor */: - case 181 /* ConstructSignature */: - case 263 /* FunctionDeclaration */: - return true; - } - return false; -} -function getConvertableOverloadListAtPosition(file, startPosition, program) { - const node = getTokenAtPosition(file, startPosition); - const containingDecl = findAncestor(node, isConvertableSignatureDeclaration); - if (!containingDecl) { - return; - } - if (isFunctionLikeDeclaration(containingDecl) && containingDecl.body && rangeContainsPosition(containingDecl.body, startPosition)) { - return; - } - const checker = program.getTypeChecker(); - const signatureSymbol = containingDecl.symbol; - if (!signatureSymbol) { - return; - } - const decls = signatureSymbol.declarations; - if (length(decls) <= 1) { - return; - } - if (!every(decls, (d) => getSourceFileOfNode(d) === file)) { - return; - } - if (!isConvertableSignatureDeclaration(decls[0])) { - return; - } - const kindOne = decls[0].kind; - if (!every(decls, (d) => d.kind === kindOne)) { - return; - } - const signatureDecls = decls; - if (some(signatureDecls, (d) => !!d.typeParameters || some(d.parameters, (p) => !!p.modifiers || !isIdentifier(p.name)))) { - return; - } - const signatures = mapDefined(signatureDecls, (d) => checker.getSignatureFromDeclaration(d)); - if (length(signatures) !== length(decls)) { - return; - } - const returnOne = checker.getReturnTypeOfSignature(signatures[0]); - if (!every(signatures, (s) => checker.getReturnTypeOfSignature(s) === returnOne)) { - return; - } - return signatureDecls; -} - -// src/services/refactors/addOrRemoveBracesToArrowFunction.ts -var refactorName7 = "Add or remove braces in an arrow function"; -var refactorDescription3 = getLocaleSpecificMessage(Diagnostics.Add_or_remove_braces_in_an_arrow_function); -var addBracesAction = { - name: "Add braces to arrow function", - description: getLocaleSpecificMessage(Diagnostics.Add_braces_to_arrow_function), - kind: "refactor.rewrite.arrow.braces.add" -}; -var removeBracesAction = { - name: "Remove braces from arrow function", - description: getLocaleSpecificMessage(Diagnostics.Remove_braces_from_arrow_function), - kind: "refactor.rewrite.arrow.braces.remove" -}; -registerRefactor(refactorName7, { - kinds: [removeBracesAction.kind], - getEditsForAction: getRefactorEditsToRemoveFunctionBraces, - getAvailableActions: getRefactorActionsToRemoveFunctionBraces -}); -function getRefactorActionsToRemoveFunctionBraces(context) { - const { file, startPosition, triggerReason } = context; - const info = getConvertibleArrowFunctionAtPosition(file, startPosition, triggerReason === "invoked"); - if (!info) return emptyArray; - if (!isRefactorErrorInfo(info)) { - return [{ - name: refactorName7, - description: refactorDescription3, - actions: [ - info.addBraces ? addBracesAction : removeBracesAction - ] - }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [{ - name: refactorName7, - description: refactorDescription3, - actions: [ - { ...addBracesAction, notApplicableReason: info.error }, - { ...removeBracesAction, notApplicableReason: info.error } - ] - }]; - } - return emptyArray; -} -function getRefactorEditsToRemoveFunctionBraces(context, actionName2) { - const { file, startPosition } = context; - const info = getConvertibleArrowFunctionAtPosition(file, startPosition); - Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const { expression, returnStatement, func } = info; - let body; - if (actionName2 === addBracesAction.name) { - const returnStatement2 = factory.createReturnStatement(expression); - body = factory.createBlock( - [returnStatement2], - /*multiLine*/ - true - ); - copyLeadingComments( - expression, - returnStatement2, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - true - ); - } else if (actionName2 === removeBracesAction.name && returnStatement) { - const actualExpression = expression || factory.createVoidZero(); - body = needsParentheses(actualExpression) ? factory.createParenthesizedExpression(actualExpression) : actualExpression; - copyTrailingAsLeadingComments( - returnStatement, - body, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - false - ); - copyLeadingComments( - returnStatement, - body, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - false - ); - copyTrailingComments( - returnStatement, - body, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - false - ); - } else { - Debug.fail("invalid action"); - } - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - t.replaceNode(file, func.body, body); - }); - return { renameFilename: void 0, renameLocation: void 0, edits }; -} -function getConvertibleArrowFunctionAtPosition(file, startPosition, considerFunctionBodies = true, kind) { - const node = getTokenAtPosition(file, startPosition); - const func = getContainingFunction(node); - if (!func) { - return { - error: getLocaleSpecificMessage(Diagnostics.Could_not_find_a_containing_arrow_function) - }; - } - if (!isArrowFunction(func)) { - return { - error: getLocaleSpecificMessage(Diagnostics.Containing_function_is_not_an_arrow_function) - }; - } - if (!rangeContainsRange(func, node) || rangeContainsRange(func.body, node) && !considerFunctionBodies) { - return void 0; - } - if (refactorKindBeginsWith(addBracesAction.kind, kind) && isExpression(func.body)) { - return { func, addBraces: true, expression: func.body }; - } else if (refactorKindBeginsWith(removeBracesAction.kind, kind) && isBlock(func.body) && func.body.statements.length === 1) { - const firstStatement = first(func.body.statements); - if (isReturnStatement(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; -} - -// src/services/_namespaces/ts.refactor.convertArrowFunctionOrFunctionExpression.ts -var ts_refactor_convertArrowFunctionOrFunctionExpression_exports = {}; - -// src/services/refactors/convertArrowFunctionOrFunctionExpression.ts -var refactorName8 = "Convert arrow function or function expression"; -var refactorDescription4 = getLocaleSpecificMessage(Diagnostics.Convert_arrow_function_or_function_expression); -var toAnonymousFunctionAction = { - name: "Convert to anonymous function", - description: getLocaleSpecificMessage(Diagnostics.Convert_to_anonymous_function), - kind: "refactor.rewrite.function.anonymous" -}; -var toNamedFunctionAction = { - name: "Convert to named function", - description: getLocaleSpecificMessage(Diagnostics.Convert_to_named_function), - kind: "refactor.rewrite.function.named" -}; -var toArrowFunctionAction = { - name: "Convert to arrow function", - description: getLocaleSpecificMessage(Diagnostics.Convert_to_arrow_function), - kind: "refactor.rewrite.function.arrow" -}; -registerRefactor(refactorName8, { - kinds: [ - toAnonymousFunctionAction.kind, - toNamedFunctionAction.kind, - toArrowFunctionAction.kind - ], - getEditsForAction: getRefactorEditsToConvertFunctionExpressions, - getAvailableActions: getRefactorActionsToConvertFunctionExpressions -}); -function getRefactorActionsToConvertFunctionExpressions(context) { - const { file, startPosition, program, kind } = context; - const info = getFunctionInfo(file, startPosition, program); - if (!info) return emptyArray; - const { selectedVariableDeclaration, func } = info; - const possibleActions = []; - const errors = []; - if (refactorKindBeginsWith(toNamedFunctionAction.kind, kind)) { - 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 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 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: refactorName8, - description: refactorDescription4, - actions: possibleActions.length === 0 && context.preferences.provideRefactorNotApplicableReason ? errors : possibleActions - }]; -} -function getRefactorEditsToConvertFunctionExpressions(context, actionName2) { - const { file, startPosition, program } = context; - const info = getFunctionInfo(file, startPosition, program); - if (!info) return void 0; - const { func } = info; - const edits = []; - switch (actionName2) { - case toAnonymousFunctionAction.name: - edits.push(...getEditInfoForConvertToAnonymousFunction(context, func)); - break; - case toNamedFunctionAction.name: - const variableInfo = getVariableInfo(func); - if (!variableInfo) return void 0; - edits.push(...getEditInfoForConvertToNamedFunction(context, func, variableInfo)); - break; - case toArrowFunctionAction.name: - if (!isFunctionExpression(func)) return void 0; - edits.push(...getEditInfoForConvertToArrowFunction(context, func)); - break; - default: - return Debug.fail("invalid action"); - } - return { renameFilename: void 0, renameLocation: void 0, edits }; -} -function containingThis(node) { - let containsThis = false; - node.forEachChild(function checkThis(child) { - if (isThis(child)) { - containsThis = true; - return; - } - if (!isClassLike(child) && !isFunctionDeclaration(child) && !isFunctionExpression(child)) { - forEachChild(child, checkThis); - } - }); - return containsThis; -} -function getFunctionInfo(file, startPosition, program) { - const token = getTokenAtPosition(file, startPosition); - const typeChecker = program.getTypeChecker(); - const func = tryGetFunctionFromVariableDeclaration(file, typeChecker, token.parent); - if (func && !containingThis(func.body) && !typeChecker.containsArgumentsReference(func)) { - return { selectedVariableDeclaration: true, func }; - } - const maybeFunc = getContainingFunction(token); - if (maybeFunc && (isFunctionExpression(maybeFunc) || isArrowFunction(maybeFunc)) && !rangeContainsRange(maybeFunc.body, token) && !containingThis(maybeFunc.body) && !typeChecker.containsArgumentsReference(maybeFunc)) { - if (isFunctionExpression(maybeFunc) && isFunctionReferencedInFile(file, typeChecker, maybeFunc)) return void 0; - return { selectedVariableDeclaration: false, func: maybeFunc }; - } - return void 0; -} -function isSingleVariableDeclaration(parent2) { - return isVariableDeclaration(parent2) || isVariableDeclarationList(parent2) && parent2.declarations.length === 1; -} -function tryGetFunctionFromVariableDeclaration(sourceFile, typeChecker, parent2) { - if (!isSingleVariableDeclaration(parent2)) { - return void 0; - } - const variableDeclaration = isVariableDeclaration(parent2) ? parent2 : first(parent2.declarations); - const initializer = variableDeclaration.initializer; - if (initializer && (isArrowFunction(initializer) || isFunctionExpression(initializer) && !isFunctionReferencedInFile(sourceFile, typeChecker, initializer))) { - return initializer; - } - return void 0; -} -function convertToBlock(body) { - if (isExpression(body)) { - const returnStatement = factory.createReturnStatement(body); - const file = body.getSourceFile(); - setTextRange(returnStatement, body); - suppressLeadingAndTrailingTrivia(returnStatement); - copyTrailingAsLeadingComments( - body, - returnStatement, - file, - /*commentKind*/ - void 0, - /*hasTrailingNewLine*/ - true - ); - return factory.createBlock( - [returnStatement], - /*multiLine*/ - true - ); - } else { - return body; - } -} -function getVariableInfo(func) { - const variableDeclaration = func.parent; - if (!isVariableDeclaration(variableDeclaration) || !isVariableDeclarationInVariableStatement(variableDeclaration)) return void 0; - const variableDeclarationList = variableDeclaration.parent; - const statement = variableDeclarationList.parent; - if (!isVariableDeclarationList(variableDeclarationList) || !isVariableStatement(statement) || !isIdentifier(variableDeclaration.name)) return void 0; - return { variableDeclaration, variableDeclarationList, statement, name: variableDeclaration.name }; -} -function getEditInfoForConvertToAnonymousFunction(context, func) { - const { file } = context; - const body = convertToBlock(func.body); - const newNode = factory.createFunctionExpression( - func.modifiers, - func.asteriskToken, - /*name*/ - void 0, - func.typeParameters, - func.parameters, - func.type, - body - ); - return ts_textChanges_exports.ChangeTracker.with(context, (t) => t.replaceNode(file, func, newNode)); -} -function getEditInfoForConvertToNamedFunction(context, func, variableInfo) { - const { file } = context; - const body = convertToBlock(func.body); - const { variableDeclaration, variableDeclarationList, statement, name } = variableInfo; - suppressLeadingTrivia(statement); - 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) { - return ts_textChanges_exports.ChangeTracker.with(context, (t) => t.replaceNode(file, statement, newNode)); - } else { - return ts_textChanges_exports.ChangeTracker.with(context, (t) => { - t.delete(file, variableDeclaration); - t.insertNodeAfter(file, statement, newNode); - }); - } -} -function getEditInfoForConvertToArrowFunction(context, func) { - const { file } = context; - const statements = func.body.statements; - const head = statements[0]; - let body; - if (canBeConvertedToExpression(func.body, head)) { - body = head.expression; - suppressLeadingAndTrailingTrivia(body); - copyComments(head, body); - } else { - body = func.body; - } - const newNode = factory.createArrowFunction(func.modifiers, func.typeParameters, func.parameters, func.type, factory.createToken(39 /* EqualsGreaterThanToken */), body); - return ts_textChanges_exports.ChangeTracker.with(context, (t) => t.replaceNode(file, func, newNode)); -} -function canBeConvertedToExpression(body, head) { - return body.statements.length === 1 && (isReturnStatement(head) && !!head.expression); -} -function isFunctionReferencedInFile(sourceFile, typeChecker, node) { - return !!node.name && ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(node.name, typeChecker, sourceFile); -} - -// src/services/_namespaces/ts.refactor.convertParamsToDestructuredObject.ts -var ts_refactor_convertParamsToDestructuredObject_exports = {}; - -// src/services/refactors/convertParamsToDestructuredObject.ts -var refactorName9 = "Convert parameters to destructured object"; -var minimumParameterLength = 1; -var refactorDescription5 = getLocaleSpecificMessage(Diagnostics.Convert_parameters_to_destructured_object); -var toDestructuredAction = { - name: refactorName9, - description: refactorDescription5, - kind: "refactor.rewrite.parameters.toDestructured" -}; -registerRefactor(refactorName9, { - kinds: [toDestructuredAction.kind], - getEditsForAction: getRefactorEditsToConvertParametersToDestructuredObject, - getAvailableActions: getRefactorActionsToConvertParametersToDestructuredObject -}); -function getRefactorActionsToConvertParametersToDestructuredObject(context) { - const { file, startPosition } = context; - const isJSFile = isSourceFileJS(file); - if (isJSFile) return emptyArray; - const functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, context.program.getTypeChecker()); - if (!functionDeclaration) return emptyArray; - return [{ - name: refactorName9, - description: refactorDescription5, - actions: [toDestructuredAction] - }]; -} -function getRefactorEditsToConvertParametersToDestructuredObject(context, actionName2) { - Debug.assert(actionName2 === refactorName9, "Unexpected action name"); - const { file, startPosition, program, cancellationToken, host } = context; - const functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, program.getTypeChecker()); - if (!functionDeclaration || !cancellationToken) return void 0; - const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); - if (groupedReferences.valid) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange5(file, program, host, t, functionDeclaration, groupedReferences)); - return { renameFilename: void 0, renameLocation: void 0, edits }; - } - return { edits: [] }; -} -function doChange5(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { - const signature = groupedReferences.signature; - const newFunctionDeclarationParams = map(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); - if (signature) { - const newSignatureParams = map(createNewParameters(signature, program, host), (param) => getSynthesizedDeepClone(param)); - replaceParameters(signature, newSignatureParams); - } - replaceParameters(functionDeclaration, newFunctionDeclarationParams); - const functionCalls = sortAndDeduplicate( - groupedReferences.functionCalls, - /*comparer*/ - (a, b) => compareValues(a.pos, b.pos) - ); - for (const call of functionCalls) { - if (call.arguments && call.arguments.length) { - const newArgument = getSynthesizedDeepClone( - createNewArgument(functionDeclaration, call.arguments), - /*includeTrivia*/ - true - ); - changes.replaceNodeRange( - getSourceFileOfNode(call), - first(call.arguments), - last(call.arguments), - newArgument, - { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include } - ); - } - } - function replaceParameters(declarationOrSignature, parameterDeclarations) { - changes.replaceNodeRangeWithNodes( - sourceFile, - first(declarationOrSignature.parameters), - last(declarationOrSignature.parameters), - parameterDeclarations, - { - joiner: ", ", - // indentation is set to 0 because otherwise the object parameter will be indented if there is a `this` parameter - indentation: 0, - leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include - } - ); - } -} -function getGroupedReferences(functionDeclaration, program, cancellationToken) { - const functionNames = getFunctionNames(functionDeclaration); - const classNames = isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : []; - const names = deduplicate([...functionNames, ...classNames], equateValues); - const checker = program.getTypeChecker(); - const references = flatMap( - names, - /*mapfn*/ - (name) => ts_FindAllReferences_exports.getReferenceEntriesForNode(-1, name, program, program.getSourceFiles(), cancellationToken) - ); - const groupedReferences = groupReferences(references); - if (!every( - groupedReferences.declarations, - /*callback*/ - (decl) => contains(names, decl) - )) { - groupedReferences.valid = false; - } - return groupedReferences; - function groupReferences(referenceEntries) { - const classReferences = { accessExpressions: [], typeUsages: [] }; - const groupedReferences2 = { functionCalls: [], declarations: [], classReferences, valid: true }; - const functionSymbols = map(functionNames, getSymbolTargetAtLocation); - const classSymbols = map(classNames, getSymbolTargetAtLocation); - const isConstructor = isConstructorDeclaration(functionDeclaration); - const contextualSymbols = map(functionNames, (name) => getSymbolForContextualType(name, checker)); - for (const entry of referenceEntries) { - if (entry.kind === ts_FindAllReferences_exports.EntryKind.Span) { - groupedReferences2.valid = false; - continue; - } - if (contains(contextualSymbols, getSymbolTargetAtLocation(entry.node))) { - if (isValidMethodSignature(entry.node.parent)) { - groupedReferences2.signature = entry.node.parent; - continue; - } - const call = entryToFunctionCall(entry); - if (call) { - groupedReferences2.functionCalls.push(call); - continue; - } - } - const contextualSymbol = getSymbolForContextualType(entry.node, checker); - if (contextualSymbol && contains(contextualSymbols, contextualSymbol)) { - const decl = entryToDeclaration(entry); - if (decl) { - groupedReferences2.declarations.push(decl); - continue; - } - } - if (contains(functionSymbols, getSymbolTargetAtLocation(entry.node)) || isNewExpressionTarget(entry.node)) { - const importOrExportReference = entryToImportOrExport(entry); - if (importOrExportReference) { - continue; - } - const decl = entryToDeclaration(entry); - if (decl) { - groupedReferences2.declarations.push(decl); - continue; - } - const call = entryToFunctionCall(entry); - if (call) { - groupedReferences2.functionCalls.push(call); - continue; - } - } - if (isConstructor && contains(classSymbols, getSymbolTargetAtLocation(entry.node))) { - const importOrExportReference = entryToImportOrExport(entry); - if (importOrExportReference) { - continue; - } - const decl = entryToDeclaration(entry); - if (decl) { - groupedReferences2.declarations.push(decl); - continue; - } - const accessExpression = entryToAccessExpression(entry); - if (accessExpression) { - classReferences.accessExpressions.push(accessExpression); - continue; - } - if (isClassDeclaration(functionDeclaration.parent)) { - const type = entryToType(entry); - if (type) { - classReferences.typeUsages.push(type); - continue; - } - } - } - groupedReferences2.valid = false; - } - return groupedReferences2; - } - function getSymbolTargetAtLocation(node) { - const symbol = checker.getSymbolAtLocation(node); - return symbol && getSymbolTarget(symbol, checker); - } -} -function getSymbolForContextualType(node, checker) { - const element = getContainingObjectLiteralElement(node); - if (element) { - const contextualType = checker.getContextualTypeForObjectLiteralElement(element); - const symbol = contextualType == null ? void 0 : contextualType.getSymbol(); - if (symbol && !(getCheckFlags(symbol) & 6 /* Synthetic */)) { - return symbol; - } - } -} -function entryToImportOrExport(entry) { - const node = entry.node; - if (isImportSpecifier(node.parent) || isImportClause(node.parent) || isImportEqualsDeclaration(node.parent) || isNamespaceImport(node.parent)) { - return node; - } - if (isExportSpecifier(node.parent) || isExportAssignment(node.parent)) { - return node; - } - return void 0; -} -function entryToDeclaration(entry) { - if (isDeclaration(entry.node.parent)) { - return entry.node; - } - return void 0; -} -function entryToFunctionCall(entry) { - if (entry.node.parent) { - const functionReference = entry.node; - const parent2 = functionReference.parent; - switch (parent2.kind) { - // foo(...) or super(...) or new Foo(...) - case 214 /* CallExpression */: - case 215 /* NewExpression */: - const callOrNewExpression = tryCast(parent2, isCallOrNewExpression); - if (callOrNewExpression && callOrNewExpression.expression === functionReference) { - return callOrNewExpression; - } - break; - // x.foo(...) - case 212 /* PropertyAccessExpression */: - const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); - if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { - const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression); - if (callOrNewExpression2 && callOrNewExpression2.expression === propertyAccessExpression) { - return callOrNewExpression2; - } - } - break; - // x["foo"](...) - case 213 /* ElementAccessExpression */: - const elementAccessExpression = tryCast(parent2, isElementAccessExpression); - if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { - const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression); - if (callOrNewExpression2 && callOrNewExpression2.expression === elementAccessExpression) { - return callOrNewExpression2; - } - } - break; - } - } - return void 0; -} -function entryToAccessExpression(entry) { - if (entry.node.parent) { - const reference = entry.node; - const parent2 = reference.parent; - switch (parent2.kind) { - // `C.foo` - case 212 /* PropertyAccessExpression */: - const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); - if (propertyAccessExpression && propertyAccessExpression.expression === reference) { - return propertyAccessExpression; - } - break; - // `C["foo"]` - case 213 /* ElementAccessExpression */: - const elementAccessExpression = tryCast(parent2, isElementAccessExpression); - if (elementAccessExpression && elementAccessExpression.expression === reference) { - return elementAccessExpression; - } - break; - } - } - return void 0; -} -function entryToType(entry) { - const reference = entry.node; - if (getMeaningFromLocation(reference) === 2 /* Type */ || isExpressionWithTypeArgumentsInClassExtendsClause(reference.parent)) { - return reference; - } - return void 0; -} -function getFunctionDeclarationAtPosition(file, startPosition, checker) { - const node = getTouchingToken(file, startPosition); - const functionDeclaration = getContainingFunctionDeclaration(node); - if (isTopLevelJSDoc(node)) return void 0; - if (functionDeclaration && isValidFunctionDeclaration(functionDeclaration, checker) && rangeContainsRange(functionDeclaration, node) && !(functionDeclaration.body && rangeContainsRange(functionDeclaration.body, node))) return functionDeclaration; - return void 0; -} -function isTopLevelJSDoc(node) { - const containingJSDoc = findAncestor(node, isJSDocNode); - if (containingJSDoc) { - const containingNonJSDoc = findAncestor(containingJSDoc, (n) => !isJSDocNode(n)); - return !!containingNonJSDoc && isFunctionLikeDeclaration(containingNonJSDoc); - } - return false; -} -function isValidMethodSignature(node) { - return isMethodSignature(node) && (isInterfaceDeclaration(node.parent) || isTypeLiteralNode(node.parent)); -} -function isValidFunctionDeclaration(functionDeclaration, checker) { - var _a; - if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; - switch (functionDeclaration.kind) { - case 263 /* FunctionDeclaration */: - return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 175 /* 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 177 /* Constructor */: - if (isClassDeclaration(functionDeclaration.parent)) { - return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); - } else { - return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); - } - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return isValidVariableDeclaration(functionDeclaration.parent); - } - return false; -} -function isSingleImplementation(functionDeclaration, checker) { - return !!functionDeclaration.body && !checker.isImplementationOfOverload(functionDeclaration); -} -function hasNameOrDefault(functionOrClassDeclaration) { - if (!functionOrClassDeclaration.name) { - const defaultKeyword = findModifier(functionOrClassDeclaration, 90 /* DefaultKeyword */); - return !!defaultKeyword; - } - return true; -} -function isValidParameterNodeArray(parameters, checker) { - return getRefactorableParametersLength(parameters) >= minimumParameterLength && every( - parameters, - /*callback*/ - (paramDecl) => isValidParameterDeclaration(paramDecl, checker) - ); -} -function isValidParameterDeclaration(parameterDeclaration, checker) { - if (isRestParameter(parameterDeclaration)) { - const type = checker.getTypeAtLocation(parameterDeclaration); - if (!checker.isArrayType(type) && !checker.isTupleType(type)) return false; - } - return !parameterDeclaration.modifiers && isIdentifier(parameterDeclaration.name); -} -function isValidVariableDeclaration(node) { - return isVariableDeclaration(node) && isVarConst(node) && isIdentifier(node.name) && !node.type; -} -function hasThisParameter(parameters) { - return parameters.length > 0 && isThis(parameters[0].name); -} -function getRefactorableParametersLength(parameters) { - if (hasThisParameter(parameters)) { - return parameters.length - 1; - } - return parameters.length; -} -function getRefactorableParameters(parameters) { - if (hasThisParameter(parameters)) { - parameters = factory.createNodeArray(parameters.slice(1), parameters.hasTrailingComma); - } - return parameters; -} -function createPropertyOrShorthandAssignment(name, initializer) { - if (isIdentifier(initializer) && getTextOfIdentifierOrLiteral(initializer) === name) { - return factory.createShorthandPropertyAssignment(name); - } - return factory.createPropertyAssignment(name, initializer); -} -function createNewArgument(functionDeclaration, functionArguments) { - const parameters = getRefactorableParameters(functionDeclaration.parameters); - const hasRestParameter2 = isRestParameter(last(parameters)); - const nonRestArguments = hasRestParameter2 ? functionArguments.slice(0, parameters.length - 1) : functionArguments; - const properties = map(nonRestArguments, (arg, i) => { - const parameterName = getParameterName(parameters[i]); - const property = createPropertyOrShorthandAssignment(parameterName, arg); - suppressLeadingAndTrailingTrivia(property.name); - if (isPropertyAssignment(property)) suppressLeadingAndTrailingTrivia(property.initializer); - copyComments(arg, property); - return property; - }); - if (hasRestParameter2 && functionArguments.length >= parameters.length) { - const restArguments = functionArguments.slice(parameters.length - 1); - const restProperty = factory.createPropertyAssignment(getParameterName(last(parameters)), factory.createArrayLiteralExpression(restArguments)); - properties.push(restProperty); - } - const objectLiteral = factory.createObjectLiteralExpression( - properties, - /*multiLine*/ - false - ); - return objectLiteral; -} -function createNewParameters(functionDeclaration, program, host) { - const checker = program.getTypeChecker(); - const refactorableParameters = getRefactorableParameters(functionDeclaration.parameters); - const bindingElements = map(refactorableParameters, createBindingElementFromParameterDeclaration); - const objectParameterName = factory.createObjectBindingPattern(bindingElements); - const objectParameterType = createParameterTypeNode(refactorableParameters); - let objectInitializer; - if (every(refactorableParameters, isOptionalParameter)) { - objectInitializer = factory.createObjectLiteralExpression(); - } - const objectParameter = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - objectParameterName, - /*questionToken*/ - void 0, - objectParameterType, - objectInitializer - ); - if (hasThisParameter(functionDeclaration.parameters)) { - const thisParameter = functionDeclaration.parameters[0]; - const newThisParameter = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - thisParameter.name, - /*questionToken*/ - void 0, - thisParameter.type - ); - suppressLeadingAndTrailingTrivia(newThisParameter.name); - copyComments(thisParameter.name, newThisParameter.name); - if (thisParameter.type) { - suppressLeadingAndTrailingTrivia(newThisParameter.type); - copyComments(thisParameter.type, newThisParameter.type); - } - return factory.createNodeArray([newThisParameter, objectParameter]); - } - return factory.createNodeArray([objectParameter]); - function createBindingElementFromParameterDeclaration(parameterDeclaration) { - const element = factory.createBindingElement( - /*dotDotDotToken*/ - void 0, - /*propertyName*/ - void 0, - getParameterName(parameterDeclaration), - isRestParameter(parameterDeclaration) && isOptionalParameter(parameterDeclaration) ? factory.createArrayLiteralExpression() : parameterDeclaration.initializer - ); - suppressLeadingAndTrailingTrivia(element); - if (parameterDeclaration.initializer && element.initializer) { - copyComments(parameterDeclaration.initializer, element.initializer); - } - return element; - } - function createParameterTypeNode(parameters) { - const members = map(parameters, createPropertySignatureFromParameterDeclaration); - const typeNode = addEmitFlags(factory.createTypeLiteralNode(members), 1 /* SingleLine */); - return typeNode; - } - function createPropertySignatureFromParameterDeclaration(parameterDeclaration) { - let parameterType = parameterDeclaration.type; - if (!parameterType && (parameterDeclaration.initializer || isRestParameter(parameterDeclaration))) { - parameterType = getTypeNode3(parameterDeclaration); - } - const propertySignature = factory.createPropertySignature( - /*modifiers*/ - void 0, - getParameterName(parameterDeclaration), - isOptionalParameter(parameterDeclaration) ? factory.createToken(58 /* QuestionToken */) : parameterDeclaration.questionToken, - parameterType - ); - suppressLeadingAndTrailingTrivia(propertySignature); - copyComments(parameterDeclaration.name, propertySignature.name); - if (parameterDeclaration.type && propertySignature.type) { - copyComments(parameterDeclaration.type, propertySignature.type); - } - return propertySignature; - } - function getTypeNode3(node) { - const type = checker.getTypeAtLocation(node); - return getTypeNodeIfAccessible(type, node, program, host); - } - function isOptionalParameter(parameterDeclaration) { - if (isRestParameter(parameterDeclaration)) { - const type = checker.getTypeAtLocation(parameterDeclaration); - return !checker.isTupleType(type); - } - return checker.isOptionalParameter(parameterDeclaration); - } -} -function getParameterName(paramDeclaration) { - return getTextOfIdentifierOrLiteral(paramDeclaration.name); -} -function getClassNames(constructorDeclaration) { - switch (constructorDeclaration.parent.kind) { - case 264 /* ClassDeclaration */: - const classDeclaration = constructorDeclaration.parent; - if (classDeclaration.name) return [classDeclaration.name]; - const defaultModifier = Debug.checkDefined( - findModifier(classDeclaration, 90 /* DefaultKeyword */), - "Nameless class declaration should be a default export" - ); - return [defaultModifier]; - case 232 /* ClassExpression */: - const classExpression = constructorDeclaration.parent; - const variableDeclaration = constructorDeclaration.parent.parent; - const className = classExpression.name; - if (className) return [className, variableDeclaration.name]; - return [variableDeclaration.name]; - } -} -function getFunctionNames(functionDeclaration) { - switch (functionDeclaration.kind) { - case 263 /* FunctionDeclaration */: - if (functionDeclaration.name) return [functionDeclaration.name]; - const defaultModifier = Debug.checkDefined( - findModifier(functionDeclaration, 90 /* DefaultKeyword */), - "Nameless function declaration should be a default export" - ); - return [defaultModifier]; - case 175 /* MethodDeclaration */: - return [functionDeclaration.name]; - case 177 /* Constructor */: - const ctrKeyword = Debug.checkDefined( - findChildOfKind(functionDeclaration, 137 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), - "Constructor declaration should have constructor keyword" - ); - if (functionDeclaration.parent.kind === 232 /* ClassExpression */) { - const variableDeclaration = functionDeclaration.parent.parent; - return [variableDeclaration.name, ctrKeyword]; - } - return [ctrKeyword]; - case 220 /* ArrowFunction */: - return [functionDeclaration.parent.name]; - case 219 /* FunctionExpression */: - if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; - return [functionDeclaration.parent.name]; - default: - return Debug.assertNever(functionDeclaration, `Unexpected function declaration kind ${functionDeclaration.kind}`); - } -} - -// src/services/_namespaces/ts.refactor.convertStringOrTemplateLiteral.ts -var ts_refactor_convertStringOrTemplateLiteral_exports = {}; - -// src/services/refactors/convertStringOrTemplateLiteral.ts -var refactorName10 = "Convert to template string"; -var refactorDescription6 = getLocaleSpecificMessage(Diagnostics.Convert_to_template_string); -var convertStringAction = { - name: refactorName10, - description: refactorDescription6, - kind: "refactor.rewrite.string" -}; -registerRefactor(refactorName10, { - kinds: [convertStringAction.kind], - getEditsForAction: getRefactorEditsToConvertToTemplateString, - getAvailableActions: getRefactorActionsToConvertToTemplateString -}); -function getRefactorActionsToConvertToTemplateString(context) { - const { file, startPosition } = context; - const node = getNodeOrParentOfParentheses(file, startPosition); - const maybeBinary = getParentBinaryExpression(node); - 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_concatenations_and_string_literals) }); - return [refactorInfo]; - } - return emptyArray; -} -function getNodeOrParentOfParentheses(file, startPosition) { - const node = getTokenAtPosition(file, startPosition); - const nestedBinary = getParentBinaryExpression(node); - const isNonStringBinary = !treeToArray(nestedBinary).isValidConcatenation; - if (isNonStringBinary && isParenthesizedExpression(nestedBinary.parent) && isBinaryExpression(nestedBinary.parent.parent)) { - return nestedBinary.parent.parent; - } - return node; -} -function getRefactorEditsToConvertToTemplateString(context, actionName2) { - const { file, startPosition } = context; - const node = getNodeOrParentOfParentheses(file, startPosition); - switch (actionName2) { - case refactorDescription6: - return { edits: getEditsForToTemplateLiteral(context, node) }; - default: - return Debug.fail("invalid action"); - } -} -function getEditsForToTemplateLiteral(context, node) { - const maybeBinary = getParentBinaryExpression(node); - const file = context.file; - const templateLiteral = nodesToTemplate(treeToArray(maybeBinary), file); - const trailingCommentRanges = getTrailingCommentRanges(file.text, maybeBinary.end); - if (trailingCommentRanges) { - const lastComment = trailingCommentRanges[trailingCommentRanges.length - 1]; - const trailingRange = { pos: trailingCommentRanges[0].pos, end: lastComment.end }; - return ts_textChanges_exports.ChangeTracker.with(context, (t) => { - t.deleteRange(file, trailingRange); - t.replaceNode(file, maybeBinary, templateLiteral); - }); - } else { - return ts_textChanges_exports.ChangeTracker.with(context, (t) => t.replaceNode(file, maybeBinary, templateLiteral)); - } -} -function isNotEqualsOperator(node) { - return !(node.operatorToken.kind === 64 /* EqualsToken */ || node.operatorToken.kind === 65 /* PlusEqualsToken */); -} -function getParentBinaryExpression(expr) { - const container = findAncestor(expr.parent, (n) => { - switch (n.kind) { - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - return false; - case 229 /* TemplateExpression */: - case 227 /* BinaryExpression */: - return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); - default: - return "quit"; - } - }); - return container || expr; -} -function treeToArray(current) { - const loop = (current2) => { - if (!isBinaryExpression(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))) { - return { nodes: [current2], operators: [], hasString: false, validOperators: true }; - } - const currentOperatorValid = current2.operatorToken.kind === 40 /* PlusToken */; - const validOperators2 = leftOperatorValid && currentOperatorValid; - nodes2.push(current2.right); - operators2.push(current2.operatorToken); - return { nodes: nodes2, operators: operators2, hasString: true, validOperators: validOperators2 }; - }; - const { nodes, operators, validOperators, hasString } = loop(current); - return { nodes, operators, isValidConcatenation: validOperators && hasString }; -} -var copyTrailingOperatorComments = (operators, file) => (index, targetNode) => { - if (index < operators.length) { - copyTrailingComments( - operators[index], - targetNode, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - false - ); - } -}; -var copyCommentFromMultiNode = (nodes, file, copyOperatorComments) => (indexes, targetNode) => { - while (indexes.length > 0) { - const index = indexes.shift(); - copyTrailingComments( - nodes[index], - targetNode, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - false - ); - copyOperatorComments(index, targetNode); - } -}; -function escapeRawStringForTemplate(s) { - return s.replace(/\\.|[$`]/g, (m) => m[0] === "\\" ? m : "\\" + m); -} -function getRawTextOfTemplate(node) { - const rightShaving = isTemplateHead(node) || isTemplateMiddle(node) ? -2 : -1; - return getTextOfNode(node).slice(1, rightShaving); -} -function concatConsecutiveString(index, nodes) { - const indexes = []; - let text = "", rawText = ""; - while (index < nodes.length) { - const node = nodes[index]; - if (isStringLiteralLike(node)) { - text += node.text; - rawText += escapeRawStringForTemplate(getTextOfNode(node).slice(1, -1)); - indexes.push(index); - index++; - } else if (isTemplateExpression(node)) { - text += node.head.text; - rawText += getRawTextOfTemplate(node.head); - break; - } else { - break; - } - } - return [index, text, rawText, indexes]; -} -function nodesToTemplate({ nodes, operators }, file) { - const copyOperatorComments = copyTrailingOperatorComments(operators, file); - const copyCommentFromStringLiterals = copyCommentFromMultiNode(nodes, file, copyOperatorComments); - const [begin, headText, rawHeadText, headIndexes] = concatConsecutiveString(0, nodes); - if (begin === nodes.length) { - const noSubstitutionTemplateLiteral = factory.createNoSubstitutionTemplateLiteral(headText, rawHeadText); - copyCommentFromStringLiterals(headIndexes, noSubstitutionTemplateLiteral); - return noSubstitutionTemplateLiteral; - } - const templateSpans = []; - const templateHead = factory.createTemplateHead(headText, rawHeadText); - copyCommentFromStringLiterals(headIndexes, templateHead); - for (let i = begin; i < nodes.length; i++) { - const currentNode = getExpressionFromParenthesesOrExpression(nodes[i]); - copyOperatorComments(i, currentNode); - const [newIndex, subsequentText, rawSubsequentText, stringIndexes] = concatConsecutiveString(i + 1, nodes); - i = newIndex - 1; - const isLast = i === nodes.length - 1; - if (isTemplateExpression(currentNode)) { - const spans = map(currentNode.templateSpans, (span, index) => { - copyExpressionComments(span); - 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) - ); - }); - templateSpans.push(...spans); - } else { - const templatePart = isLast ? factory.createTemplateTail(subsequentText, rawSubsequentText) : factory.createTemplateMiddle(subsequentText, rawSubsequentText); - copyCommentFromStringLiterals(stringIndexes, templatePart); - templateSpans.push(factory.createTemplateSpan(currentNode, templatePart)); - } - } - return factory.createTemplateExpression(templateHead, templateSpans); -} -function copyExpressionComments(node) { - const file = node.getSourceFile(); - copyTrailingComments( - node, - node.expression, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - false - ); - copyTrailingAsLeadingComments( - node.expression, - node.expression, - file, - 3 /* MultiLineCommentTrivia */, - /*hasTrailingNewLine*/ - false - ); -} -function getExpressionFromParenthesesOrExpression(node) { - if (isParenthesizedExpression(node)) { - copyExpressionComments(node); - node = node.expression; - } - return node; -} - -// src/services/_namespaces/ts.refactor.convertToOptionalChainExpression.ts -var ts_refactor_convertToOptionalChainExpression_exports = {}; - -// src/services/refactors/convertToOptionalChainExpression.ts -var refactorName11 = "Convert to optional chain expression"; -var convertToOptionalChainExpressionMessage = getLocaleSpecificMessage(Diagnostics.Convert_to_optional_chain_expression); -var toOptionalChainAction = { - name: refactorName11, - description: convertToOptionalChainExpressionMessage, - kind: "refactor.rewrite.expression.optionalChain" -}; -registerRefactor(refactorName11, { - kinds: [toOptionalChainAction.kind], - getEditsForAction: getRefactorEditsToConvertToOptionalChain, - getAvailableActions: getRefactorActionsToConvertToOptionalChain -}); -function getRefactorActionsToConvertToOptionalChain(context) { - const info = getInfo3(context, context.triggerReason === "invoked"); - if (!info) return emptyArray; - if (!isRefactorErrorInfo(info)) { - return [{ - name: refactorName11, - description: convertToOptionalChainExpressionMessage, - actions: [toOptionalChainAction] - }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [{ - name: refactorName11, - description: convertToOptionalChainExpressionMessage, - actions: [{ ...toOptionalChainAction, notApplicableReason: info.error }] - }]; - } - return emptyArray; -} -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)); - return { edits, renameFilename: void 0, renameLocation: void 0 }; -} -function isValidExpression(node) { - return isBinaryExpression(node) || isConditionalExpression(node); -} -function isValidStatement(node) { - return isExpressionStatement(node) || isReturnStatement(node) || isVariableStatement(node); -} -function isValidExpressionOrStatement(node) { - return isValidExpression(node) || isValidStatement(node); -} -function getInfo3(context, considerEmptySpans = true) { - const { file, program } = context; - const span = getRefactorContextSpan(context); - const forEmptySpan = span.length === 0; - if (forEmptySpan && !considerEmptySpans) return void 0; - const startToken = getTokenAtPosition(file, span.start); - const endToken = findTokenOnLeftOfPosition(file, span.start + span.length); - const adjustedSpan = createTextSpanFromBounds(startToken.pos, endToken && endToken.end >= startToken.pos ? endToken.getEnd() : startToken.getEnd()); - const parent2 = forEmptySpan ? getValidParentNodeOfEmptySpan(startToken) : getValidParentNodeContainingSpan(startToken, adjustedSpan); - const expression = parent2 && isValidExpressionOrStatement(parent2) ? getExpression(parent2) : void 0; - if (!expression) return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) }; - const checker = program.getTypeChecker(); - return isConditionalExpression(expression) ? getConditionalInfo(expression, checker) : getBinaryInfo(expression); -} -function getConditionalInfo(expression, checker) { - const condition = expression.condition; - const finalExpression = getFinalExpressionInChain(expression.whenTrue); - if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { - return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) }; - } - if ((isPropertyAccessExpression(condition) || isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { - return { finalExpression, occurrences: [condition], expression }; - } else if (isBinaryExpression(condition)) { - const occurrences = getOccurrencesInExpression(finalExpression.expression, condition); - return occurrences ? { finalExpression, occurrences, expression } : { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_matching_access_expressions) }; - } -} -function getBinaryInfo(expression) { - if (expression.operatorToken.kind !== 56 /* AmpersandAmpersandToken */) { - return { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_logical_AND_access_chains) }; - } - const finalExpression = getFinalExpressionInChain(expression.right); - if (!finalExpression) return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) }; - const occurrences = getOccurrencesInExpression(finalExpression.expression, expression.left); - return occurrences ? { finalExpression, occurrences, expression } : { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_matching_access_expressions) }; -} -function getOccurrencesInExpression(matchTo, expression) { - const occurrences = []; - while (isBinaryExpression(expression) && expression.operatorToken.kind === 56 /* AmpersandAmpersandToken */) { - const match = getMatchingStart(skipParentheses(matchTo), skipParentheses(expression.right)); - if (!match) { - break; - } - occurrences.push(match); - matchTo = match; - expression = expression.left; - } - const finalMatch = getMatchingStart(matchTo, expression); - if (finalMatch) { - occurrences.push(finalMatch); - } - return occurrences.length > 0 ? occurrences : void 0; -} -function getMatchingStart(chain, subchain) { - if (!isIdentifier(subchain) && !isPropertyAccessExpression(subchain) && !isElementAccessExpression(subchain)) { - return void 0; - } - return chainStartsWith(chain, subchain) ? subchain : void 0; -} -function chainStartsWith(chain, subchain) { - while (isCallExpression(chain) || isPropertyAccessExpression(chain) || isElementAccessExpression(chain)) { - if (getTextOfChainNode(chain) === getTextOfChainNode(subchain)) break; - chain = chain.expression; - } - while (isPropertyAccessExpression(chain) && isPropertyAccessExpression(subchain) || isElementAccessExpression(chain) && isElementAccessExpression(subchain)) { - if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain)) return false; - chain = chain.expression; - subchain = subchain.expression; - } - return isIdentifier(chain) && isIdentifier(subchain) && chain.getText() === subchain.getText(); -} -function getTextOfChainNode(node) { - if (isIdentifier(node) || isStringOrNumericLiteralLike(node)) { - return node.getText(); - } - if (isPropertyAccessExpression(node)) { - return getTextOfChainNode(node.name); - } - if (isElementAccessExpression(node)) { - return getTextOfChainNode(node.argumentExpression); - } - return void 0; -} -function getValidParentNodeContainingSpan(node, span) { - while (node.parent) { - if (isValidExpressionOrStatement(node) && span.length !== 0 && node.end >= span.start + span.length) { - return node; - } - node = node.parent; - } - return void 0; -} -function getValidParentNodeOfEmptySpan(node) { - while (node.parent) { - if (isValidExpressionOrStatement(node) && !isValidExpressionOrStatement(node.parent)) { - return node; - } - node = node.parent; - } - return void 0; -} -function getExpression(node) { - if (isValidExpression(node)) { - return node; - } - if (isVariableStatement(node)) { - const variable = getSingleVariableOfVariableStatement(node); - const initializer = variable == null ? void 0 : variable.initializer; - return initializer && isValidExpression(initializer) ? initializer : void 0; - } - return node.expression && isValidExpression(node.expression) ? node.expression : void 0; -} -function getFinalExpressionInChain(node) { - node = skipParentheses(node); - if (isBinaryExpression(node)) { - return getFinalExpressionInChain(node.left); - } else if ((isPropertyAccessExpression(node) || isElementAccessExpression(node) || isCallExpression(node)) && !isOptionalChain(node)) { - return node; - } - return void 0; -} -function convertOccurrences(checker, toConvert, occurrences) { - if (isPropertyAccessExpression(toConvert) || isElementAccessExpression(toConvert) || isCallExpression(toConvert)) { - const chain = convertOccurrences(checker, toConvert.expression, occurrences); - const lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : void 0; - const isOccurrence = (lastOccurrence == null ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText(); - if (isOccurrence) occurrences.pop(); - if (isCallExpression(toConvert)) { - return isOccurrence ? factory.createCallChain(chain, factory.createToken(29 /* QuestionDotToken */), toConvert.typeArguments, toConvert.arguments) : factory.createCallChain(chain, toConvert.questionDotToken, toConvert.typeArguments, toConvert.arguments); - } else if (isPropertyAccessExpression(toConvert)) { - return isOccurrence ? factory.createPropertyAccessChain(chain, factory.createToken(29 /* QuestionDotToken */), toConvert.name) : factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name); - } else if (isElementAccessExpression(toConvert)) { - return isOccurrence ? factory.createElementAccessChain(chain, factory.createToken(29 /* QuestionDotToken */), toConvert.argumentExpression) : factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression); - } - } - return toConvert; -} -function doChange6(sourceFile, checker, changes, info, _actionName) { - const { finalExpression, occurrences, expression } = info; - const firstOccurrence = occurrences[occurrences.length - 1]; - const convertedChain = convertOccurrences(checker, finalExpression, occurrences); - if (convertedChain && (isPropertyAccessExpression(convertedChain) || isElementAccessExpression(convertedChain) || isCallExpression(convertedChain))) { - 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)); - } - } -} - -// src/services/_namespaces/ts.refactor.extractSymbol.ts -var ts_refactor_extractSymbol_exports = {}; -__export(ts_refactor_extractSymbol_exports, { - Messages: () => Messages, - RangeFacts: () => RangeFacts, - getRangeToExtract: () => getRangeToExtract2, - getRefactorActionsToExtractSymbol: () => getRefactorActionsToExtractSymbol, - getRefactorEditsToExtractSymbol: () => getRefactorEditsToExtractSymbol -}); - -// src/services/refactors/extractSymbol.ts -var refactorName12 = "Extract Symbol"; -var extractConstantAction = { - name: "Extract Constant", - description: getLocaleSpecificMessage(Diagnostics.Extract_constant), - kind: "refactor.extract.constant" -}; -var extractFunctionAction = { - name: "Extract Function", - description: getLocaleSpecificMessage(Diagnostics.Extract_function), - kind: "refactor.extract.function" -}; -registerRefactor(refactorName12, { - kinds: [ - extractConstantAction.kind, - extractFunctionAction.kind - ], - getEditsForAction: getRefactorEditsToExtractSymbol, - getAvailableActions: getRefactorActionsToExtractSymbol -}); -function getRefactorActionsToExtractSymbol(context) { - const requestedRefactor = context.kind; - const rangeToExtract = getRangeToExtract2(context.file, getRefactorContextSpan(context), context.triggerReason === "invoked"); - const targetRange = rangeToExtract.targetRange; - if (targetRange === void 0) { - if (!rangeToExtract.errors || rangeToExtract.errors.length === 0 || !context.preferences.provideRefactorNotApplicableReason) { - return emptyArray; - } - const errors = []; - if (refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) { - errors.push({ - name: refactorName12, - description: extractFunctionAction.description, - actions: [{ ...extractFunctionAction, notApplicableReason: getStringError(rangeToExtract.errors) }] - }); - } - if (refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) { - errors.push({ - name: refactorName12, - description: extractConstantAction.description, - actions: [{ ...extractConstantAction, notApplicableReason: getStringError(rangeToExtract.errors) }] - }); - } - return errors; - } - const { affectedTextRange, extractions } = getPossibleExtractions(targetRange, context); - if (extractions === void 0) { - return emptyArray; - } - const functionActions = []; - const usedFunctionNames = /* @__PURE__ */ new Map(); - let innermostErrorFunctionAction; - const constantActions = []; - const usedConstantNames = /* @__PURE__ */ new Map(); - let innermostErrorConstantAction; - let i = 0; - for (const { functionExtraction, constantExtraction } of extractions) { - if (refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) { - const description3 = functionExtraction.description; - if (functionExtraction.errors.length === 0) { - if (!usedFunctionNames.has(description3)) { - usedFunctionNames.set(description3, true); - functionActions.push({ - description: description3, - name: `function_scope_${i}`, - kind: extractFunctionAction.kind, - range: { - start: { line: getLineAndCharacterOfPosition(context.file, affectedTextRange.pos).line, offset: getLineAndCharacterOfPosition(context.file, affectedTextRange.pos).character }, - end: { line: getLineAndCharacterOfPosition(context.file, affectedTextRange.end).line, offset: getLineAndCharacterOfPosition(context.file, affectedTextRange.end).character } - } - }); - } - } else if (!innermostErrorFunctionAction) { - innermostErrorFunctionAction = { - description: description3, - name: `function_scope_${i}`, - notApplicableReason: getStringError(functionExtraction.errors), - kind: extractFunctionAction.kind - }; - } - } - if (refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) { - const description3 = constantExtraction.description; - if (constantExtraction.errors.length === 0) { - if (!usedConstantNames.has(description3)) { - usedConstantNames.set(description3, true); - constantActions.push({ - description: description3, - name: `constant_scope_${i}`, - kind: extractConstantAction.kind, - range: { - start: { line: getLineAndCharacterOfPosition(context.file, affectedTextRange.pos).line, offset: getLineAndCharacterOfPosition(context.file, affectedTextRange.pos).character }, - end: { line: getLineAndCharacterOfPosition(context.file, affectedTextRange.end).line, offset: getLineAndCharacterOfPosition(context.file, affectedTextRange.end).character } - } - }); - } - } else if (!innermostErrorConstantAction) { - innermostErrorConstantAction = { - description: description3, - name: `constant_scope_${i}`, - notApplicableReason: getStringError(constantExtraction.errors), - kind: extractConstantAction.kind - }; - } - } - i++; - } - const infos = []; - if (functionActions.length) { - infos.push({ - name: refactorName12, - description: getLocaleSpecificMessage(Diagnostics.Extract_function), - actions: functionActions - }); - } else if (context.preferences.provideRefactorNotApplicableReason && innermostErrorFunctionAction) { - infos.push({ - name: refactorName12, - description: getLocaleSpecificMessage(Diagnostics.Extract_function), - actions: [innermostErrorFunctionAction] - }); - } - if (constantActions.length) { - infos.push({ - name: refactorName12, - description: getLocaleSpecificMessage(Diagnostics.Extract_constant), - actions: constantActions - }); - } else if (context.preferences.provideRefactorNotApplicableReason && innermostErrorConstantAction) { - infos.push({ - name: refactorName12, - description: getLocaleSpecificMessage(Diagnostics.Extract_constant), - actions: [innermostErrorConstantAction] - }); - } - return infos.length ? infos : emptyArray; - function getStringError(errors) { - let error2 = errors[0].messageText; - if (typeof error2 !== "string") { - error2 = error2.messageText; - } - return error2; - } -} -function getRefactorEditsToExtractSymbol(context, actionName2) { - const rangeToExtract = getRangeToExtract2(context.file, getRefactorContextSpan(context)); - const targetRange = rangeToExtract.targetRange; - const parsedFunctionIndexMatch = /^function_scope_(\d+)$/.exec(actionName2); - if (parsedFunctionIndexMatch) { - const index = +parsedFunctionIndexMatch[1]; - Debug.assert(isFinite(index), "Expected to parse a finite number from the function scope index"); - return getFunctionExtractionAtIndex(targetRange, context, index); - } - const parsedConstantIndexMatch = /^constant_scope_(\d+)$/.exec(actionName2); - if (parsedConstantIndexMatch) { - const index = +parsedConstantIndexMatch[1]; - Debug.assert(isFinite(index), "Expected to parse a finite number from the constant scope index"); - return getConstantExtractionAtIndex(targetRange, context, index); - } - Debug.fail("Unrecognized action name"); -} -var Messages; -((Messages2) => { - function createMessage(message) { - return { message, code: 0, category: 3 /* Message */, key: message }; - } - Messages2.cannotExtractRange = createMessage("Cannot extract range."); - Messages2.cannotExtractImport = createMessage("Cannot extract import statement."); - Messages2.cannotExtractSuper = createMessage("Cannot extract super call."); - Messages2.cannotExtractJSDoc = createMessage("Cannot extract JSDoc."); - Messages2.cannotExtractEmpty = createMessage("Cannot extract empty range."); - Messages2.expressionExpected = createMessage("expression expected."); - Messages2.uselessConstantType = createMessage("No reason to extract constant of type."); - Messages2.statementOrExpressionExpected = createMessage("Statement or expression expected."); - Messages2.cannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage("Cannot extract range containing conditional break or continue statements."); - Messages2.cannotExtractRangeContainingConditionalReturnStatement = createMessage("Cannot extract range containing conditional return statement."); - Messages2.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); - Messages2.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); - Messages2.typeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); - Messages2.functionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); - Messages2.cannotExtractIdentifier = createMessage("Select more than a single identifier."); - Messages2.cannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); - Messages2.cannotWriteInExpression = createMessage("Cannot write back side-effects when extracting an expression"); - Messages2.cannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); - Messages2.cannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); - Messages2.cannotAccessVariablesFromNestedScopes = createMessage("Cannot access variables from nested scopes"); - Messages2.cannotExtractToJSClass = createMessage("Cannot extract constant to a class scope in JS"); - Messages2.cannotExtractToExpressionArrowFunction = createMessage("Cannot extract constant to an arrow function without a block"); - Messages2.cannotExtractFunctionsContainingThisToMethod = createMessage("Cannot extract functions containing this to method"); -})(Messages || (Messages = {})); -var RangeFacts = /* @__PURE__ */ ((RangeFacts2) => { - RangeFacts2[RangeFacts2["None"] = 0] = "None"; - RangeFacts2[RangeFacts2["HasReturn"] = 1] = "HasReturn"; - RangeFacts2[RangeFacts2["IsGenerator"] = 2] = "IsGenerator"; - RangeFacts2[RangeFacts2["IsAsyncFunction"] = 4] = "IsAsyncFunction"; - RangeFacts2[RangeFacts2["UsesThis"] = 8] = "UsesThis"; - RangeFacts2[RangeFacts2["UsesThisInFunction"] = 16] = "UsesThisInFunction"; - RangeFacts2[RangeFacts2["InStaticRegion"] = 32] = "InStaticRegion"; - return RangeFacts2; -})(RangeFacts || {}); -function getRangeToExtract2(sourceFile, span, invoked = true) { - const { length: length2 } = span; - if (length2 === 0 && !invoked) { - return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractEmpty)] }; - } - const cursorRequest = length2 === 0 && invoked; - const startToken = findFirstNonJsxWhitespaceToken(sourceFile, span.start); - const endToken = findTokenOnLeftOfPosition(sourceFile, textSpanEnd(span)); - const adjustedSpan = startToken && endToken && invoked ? getAdjustedSpanFromNodes(startToken, endToken, sourceFile) : span; - const start = cursorRequest ? getExtractableParent(startToken) : getParentNodeInSpan(startToken, sourceFile, adjustedSpan); - const end = cursorRequest ? start : getParentNodeInSpan(endToken, sourceFile, adjustedSpan); - let rangeFacts = 0 /* None */; - let thisNode; - if (!start || !end) { - return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] }; - } - if (start.flags & 16777216 /* JSDoc */) { - return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractJSDoc)] }; - } - if (start.parent !== end.parent) { - return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] }; - } - if (start !== end) { - if (!isBlockLike(start.parent)) { - return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] }; - } - const statements = []; - for (const statement of start.parent.statements) { - if (statement === start || statements.length) { - const errors2 = checkNode(statement); - if (errors2) { - return { errors: errors2 }; - } - statements.push(statement); - } - if (statement === end) { - break; - } - } - if (!statements.length) { - return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] }; - } - return { targetRange: { range: statements, facts: rangeFacts, thisNode } }; - } - if (isReturnStatement(start) && !start.expression) { - return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] }; - } - const node = refineNode(start); - const errors = checkRootNode(node) || checkNode(node); - if (errors) { - return { errors }; - } - return { targetRange: { range: getStatementOrExpressionRange(node), facts: rangeFacts, thisNode } }; - function refineNode(node2) { - if (isReturnStatement(node2)) { - if (node2.expression) { - return node2.expression; - } - } else if (isVariableStatement(node2) || isVariableDeclarationList(node2)) { - const declarations = isVariableStatement(node2) ? node2.declarationList.declarations : node2.declarations; - let numInitializers = 0; - let lastInitializer; - for (const declaration of declarations) { - if (declaration.initializer) { - numInitializers++; - lastInitializer = declaration.initializer; - } - } - if (numInitializers === 1) { - return lastInitializer; - } - } else if (isVariableDeclaration(node2)) { - if (node2.initializer) { - return node2.initializer; - } - } - return node2; - } - function checkRootNode(node2) { - if (isIdentifier(isExpressionStatement(node2) ? node2.expression : node2)) { - return [createDiagnosticForNode(node2, Messages.cannotExtractIdentifier)]; - } - return void 0; - } - function checkForStaticContext(nodeToCheck, containingClass) { - let current = nodeToCheck; - while (current !== containingClass) { - if (current.kind === 173 /* PropertyDeclaration */) { - if (isStatic(current)) { - rangeFacts |= 32 /* InStaticRegion */; - } - break; - } else if (current.kind === 170 /* Parameter */) { - const ctorOrMethod = getContainingFunction(current); - if (ctorOrMethod.kind === 177 /* Constructor */) { - rangeFacts |= 32 /* InStaticRegion */; - } - break; - } else if (current.kind === 175 /* MethodDeclaration */) { - if (isStatic(current)) { - rangeFacts |= 32 /* InStaticRegion */; - } - } - current = current.parent; - } - } - function checkNode(nodeToCheck) { - let PermittedJumps; - ((PermittedJumps2) => { - PermittedJumps2[PermittedJumps2["None"] = 0] = "None"; - PermittedJumps2[PermittedJumps2["Break"] = 1] = "Break"; - PermittedJumps2[PermittedJumps2["Continue"] = 2] = "Continue"; - PermittedJumps2[PermittedJumps2["Return"] = 4] = "Return"; - })(PermittedJumps || (PermittedJumps = {})); - Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"); - Debug.assert(!positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"); - if (!isStatement(nodeToCheck) && !(isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck)) && !isStringLiteralJsxAttribute(nodeToCheck)) { - return [createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; - } - if (nodeToCheck.flags & 33554432 /* Ambient */) { - return [createDiagnosticForNode(nodeToCheck, Messages.cannotExtractAmbientBlock)]; - } - const containingClass = getContainingClass(nodeToCheck); - if (containingClass) { - checkForStaticContext(nodeToCheck, containingClass); - } - let errors2; - let permittedJumps = 4 /* Return */; - let seenLabels; - visit(nodeToCheck); - if (rangeFacts & 8 /* UsesThis */) { - const container = getThisContainer( - nodeToCheck, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (container.kind === 263 /* FunctionDeclaration */ || container.kind === 175 /* MethodDeclaration */ && container.parent.kind === 211 /* ObjectLiteralExpression */ || container.kind === 219 /* FunctionExpression */) { - rangeFacts |= 16 /* UsesThisInFunction */; - } - } - return errors2; - function visit(node2) { - if (errors2) { - return true; - } - if (isDeclaration(node2)) { - const declaringNode = node2.kind === 261 /* VariableDeclaration */ ? node2.parent.parent : node2; - if (hasSyntacticModifier(declaringNode, 32 /* Export */)) { - (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); - return true; - } - } - switch (node2.kind) { - case 273 /* ImportDeclaration */: - (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractImport)); - return true; - case 278 /* ExportAssignment */: - (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); - return true; - case 108 /* SuperKeyword */: - if (node2.parent.kind === 214 /* 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)); - return true; - } - } else { - rangeFacts |= 8 /* UsesThis */; - thisNode = node2; - } - break; - case 220 /* ArrowFunction */: - forEachChild(node2, function check(n) { - if (isThis(n)) { - rangeFacts |= 8 /* UsesThis */; - thisNode = node2; - } else if (isClassLike(n) || isFunctionLike(n) && !isArrowFunction(n)) { - return false; - } else { - forEachChild(n, check); - } - }); - // falls through - case 264 /* ClassDeclaration */: - case 263 /* FunctionDeclaration */: - if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) { - (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.functionWillNotBeVisibleInTheNewScope)); - } - // falls through - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return false; - } - const savedPermittedJumps = permittedJumps; - switch (node2.kind) { - case 246 /* IfStatement */: - permittedJumps &= ~4 /* Return */; - break; - case 259 /* TryStatement */: - permittedJumps = 0 /* None */; - break; - case 242 /* Block */: - if (node2.parent && node2.parent.kind === 259 /* TryStatement */ && node2.parent.finallyBlock === node2) { - permittedJumps = 4 /* Return */; - } - break; - case 298 /* DefaultClause */: - case 297 /* CaseClause */: - permittedJumps |= 1 /* Break */; - break; - default: - if (isIterationStatement( - node2, - /*lookInLabeledStatements*/ - false - )) { - permittedJumps |= 1 /* Break */ | 2 /* Continue */; - } - break; - } - switch (node2.kind) { - case 198 /* ThisType */: - case 110 /* ThisKeyword */: - rangeFacts |= 8 /* UsesThis */; - thisNode = node2; - break; - case 257 /* LabeledStatement */: { - const label = node2.label; - (seenLabels || (seenLabels = [])).push(label.escapedText); - forEachChild(node2, visit); - seenLabels.pop(); - break; - } - case 253 /* BreakStatement */: - case 252 /* ContinueStatement */: { - const label = node2.label; - if (label) { - if (!contains(seenLabels, label.escapedText)) { - (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); - } - } else { - if (!(permittedJumps & (node2.kind === 253 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { - (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); - } - } - break; - } - case 224 /* AwaitExpression */: - rangeFacts |= 4 /* IsAsyncFunction */; - break; - case 230 /* YieldExpression */: - rangeFacts |= 2 /* IsGenerator */; - break; - case 254 /* ReturnStatement */: - if (permittedJumps & 4 /* Return */) { - rangeFacts |= 1 /* HasReturn */; - } else { - (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalReturnStatement)); - } - break; - default: - forEachChild(node2, visit); - break; - } - permittedJumps = savedPermittedJumps; - } - } -} -function getAdjustedSpanFromNodes(startNode2, endNode2, sourceFile) { - const start = startNode2.getStart(sourceFile); - let end = endNode2.getEnd(); - if (sourceFile.text.charCodeAt(end) === 59 /* semicolon */) { - end++; - } - return { start, length: end - start }; -} -function getStatementOrExpressionRange(node) { - if (isStatement(node)) { - return [node]; - } - if (isExpressionNode(node)) { - return isExpressionStatement(node.parent) ? [node.parent] : node; - } - if (isStringLiteralJsxAttribute(node)) { - return node; - } - return void 0; -} -function isScope(node) { - return isArrowFunction(node) ? isFunctionBody(node.body) : isFunctionLikeDeclaration(node) || isSourceFile(node) || isModuleBlock(node) || isClassLike(node); -} -function collectEnclosingScopes(range) { - let current = isReadonlyArray(range.range) ? first(range.range) : range.range; - if (range.facts & 8 /* UsesThis */ && !(range.facts & 16 /* UsesThisInFunction */)) { - const containingClass = getContainingClass(current); - if (containingClass) { - const containingFunction = findAncestor(current, isFunctionLikeDeclaration); - return containingFunction ? [containingFunction, containingClass] : [containingClass]; - } - } - const scopes = []; - while (true) { - current = current.parent; - if (current.kind === 170 /* Parameter */) { - current = findAncestor(current, (parent2) => isFunctionLikeDeclaration(parent2)).parent; - } - if (isScope(current)) { - scopes.push(current); - if (current.kind === 308 /* SourceFile */) { - return scopes; - } - } - } -} -function getFunctionExtractionAtIndex(targetRange, context, requestedChangesIndex) { - const { scopes, readsAndWrites: { target, usagesPerScope, functionErrorsPerScope, exposedVariableDeclarations } } = getPossibleExtractionsWorker(targetRange, context); - Debug.assert(!functionErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); - context.cancellationToken.throwIfCancellationRequested(); - return extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], exposedVariableDeclarations, targetRange, context); -} -function getConstantExtractionAtIndex(targetRange, context, requestedChangesIndex) { - const { scopes, readsAndWrites: { target, usagesPerScope, constantErrorsPerScope, exposedVariableDeclarations } } = getPossibleExtractionsWorker(targetRange, context); - Debug.assert(!constantErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); - Debug.assert(exposedVariableDeclarations.length === 0, "Extract constant accepted a range containing a variable declaration?"); - context.cancellationToken.throwIfCancellationRequested(); - const expression = isExpression(target) ? target : target.statements[0].expression; - return extractConstantInScope(expression, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange.facts, context); -} -function getPossibleExtractions(targetRange, context) { - const { scopes, affectedTextRange, readsAndWrites: { functionErrorsPerScope, constantErrorsPerScope } } = getPossibleExtractionsWorker(targetRange, context); - const extractions = scopes.map((scope, i) => { - const functionDescriptionPart = getDescriptionForFunctionInScope(scope); - const constantDescriptionPart = getDescriptionForConstantInScope(scope); - const scopeDescription = isFunctionLikeDeclaration(scope) ? getDescriptionForFunctionLikeDeclaration(scope) : isClassLike(scope) ? getDescriptionForClassLikeDeclaration(scope) : getDescriptionForModuleLikeDeclaration(scope); - let functionDescription; - let constantDescription; - if (scopeDescription === 1 /* Global */) { - functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "global"]); - constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "global"]); - } else if (scopeDescription === 0 /* Module */) { - functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "module"]); - constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "module"]); - } else { - functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1), [functionDescriptionPart, scopeDescription]); - constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1), [constantDescriptionPart, scopeDescription]); - } - if (i === 0 && !isClassLike(scope)) { - constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_enclosing_scope), [constantDescriptionPart]); - } - return { - functionExtraction: { - description: functionDescription, - errors: functionErrorsPerScope[i] - }, - constantExtraction: { - description: constantDescription, - errors: constantErrorsPerScope[i] - } - }; - }); - return { affectedTextRange, extractions }; -} -function getPossibleExtractionsWorker(targetRange, context) { - const { file: sourceFile } = context; - const scopes = collectEnclosingScopes(targetRange); - const enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); - const readsAndWrites = collectReadsAndWrites( - targetRange, - scopes, - enclosingTextRange, - sourceFile, - context.program.getTypeChecker(), - context.cancellationToken - ); - return { scopes, affectedTextRange: enclosingTextRange, readsAndWrites }; -} -function getDescriptionForFunctionInScope(scope) { - return isFunctionLikeDeclaration(scope) ? "inner function" : isClassLike(scope) ? "method" : "function"; -} -function getDescriptionForConstantInScope(scope) { - return isClassLike(scope) ? "readonly field" : "constant"; -} -function getDescriptionForFunctionLikeDeclaration(scope) { - switch (scope.kind) { - case 177 /* Constructor */: - return "constructor"; - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - return scope.name ? `function '${scope.name.text}'` : ANONYMOUS; - case 220 /* ArrowFunction */: - return "arrow function"; - case 175 /* MethodDeclaration */: - return `method '${scope.name.getText()}'`; - case 178 /* GetAccessor */: - return `'get ${scope.name.getText()}'`; - case 179 /* SetAccessor */: - return `'set ${scope.name.getText()}'`; - default: - Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`); - } -} -function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 264 /* 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 === 269 /* 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(); - const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); - const importAdder = ts_codefix_exports.createImportAdder(context.file, context.program, context.preferences, context.host); - const file = scope.getSourceFile(); - const functionNameText = getUniqueName(isClassLike(scope) ? "newMethod" : "newFunction", file); - const isJS = isInJSFile(scope); - const functionName = factory.createIdentifier(functionNameText); - let returnType; - const parameters = []; - const callArguments = []; - let writes; - usagesInScope.forEach((usage, name) => { - let typeNode; - if (!isJS) { - let type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); - type = checker.getBaseTypeOfLiteralType(type); - typeNode = ts_codefix_exports.typeToAutoImportableTypeNode(checker, importAdder, type, scope, scriptTarget, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */); - } - const paramDecl = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - /*name*/ - name, - /*questionToken*/ - void 0, - typeNode - ); - parameters.push(paramDecl); - if (usage.usage === 2 /* Write */) { - (writes || (writes = [])).push(usage); - } - callArguments.push(factory.createIdentifier(name)); - }); - const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclarationBeforePosition(type, context.startPosition) })); - typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder); - const typeParameters = typeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(typeParametersAndDeclarations, ({ declaration }) => declaration); - const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode( - decl.name, - /*typeArguments*/ - void 0 - )) : void 0; - if (isExpression(node) && !isJS) { - const contextualType = checker.getContextualType(node); - returnType = checker.typeToTypeNode(contextualType, scope, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */); - } - const { body, returnValueProperty } = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & 1 /* HasReturn */)); - suppressLeadingAndTrailingTrivia(body); - let newFunction; - const callThis = !!(range.facts & 16 /* UsesThisInFunction */); - if (isClassLike(scope)) { - const modifiers = isJS ? [] : [factory.createModifier(123 /* PrivateKeyword */)]; - if (range.facts & 32 /* InStaticRegion */) { - modifiers.push(factory.createModifier(126 /* StaticKeyword */)); - } - if (range.facts & 4 /* IsAsyncFunction */) { - modifiers.push(factory.createModifier(134 /* AsyncKeyword */)); - } - newFunction = factory.createMethodDeclaration( - modifiers.length ? modifiers : void 0, - range.facts & 2 /* IsGenerator */ ? factory.createToken(42 /* AsteriskToken */) : void 0, - functionName, - /*questionToken*/ - void 0, - typeParameters, - parameters, - returnType, - body - ); - } else { - if (callThis) { - parameters.unshift( - factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - /*name*/ - "this", - /*questionToken*/ - void 0, - checker.typeToTypeNode( - checker.getTypeAtLocation(range.thisNode), - scope, - 1 /* NoTruncation */, - 8 /* AllowUnresolvedNames */ - ), - /*initializer*/ - void 0 - ) - ); - } - newFunction = factory.createFunctionDeclaration( - range.facts & 4 /* IsAsyncFunction */ ? [factory.createToken(134 /* AsyncKeyword */)] : void 0, - range.facts & 2 /* IsGenerator */ ? factory.createToken(42 /* AsteriskToken */) : void 0, - functionName, - typeParameters, - parameters, - returnType, - body - ); - } - const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context); - const minInsertionPos = (isReadonlyArray(range.range) ? last(range.range) : range.range).end; - const nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope); - if (nodeToInsertBefore) { - changeTracker.insertNodeBefore( - context.file, - nodeToInsertBefore, - newFunction, - /*blankLineBetween*/ - true - ); - } else { - changeTracker.insertNodeAtEndOfScope(context.file, scope, newFunction); - } - importAdder.writeFixes(changeTracker); - const newNodes = []; - const called = getCalledExpression(scope, range, functionNameText); - if (callThis) { - callArguments.unshift(factory.createIdentifier("this")); - } - let call = factory.createCallExpression( - callThis ? factory.createPropertyAccessExpression( - called, - "call" - ) : called, - callTypeArguments, - // Note that no attempt is made to take advantage of type argument inference - callArguments - ); - if (range.facts & 2 /* IsGenerator */) { - call = factory.createYieldExpression(factory.createToken(42 /* AsteriskToken */), call); - } - if (range.facts & 4 /* IsAsyncFunction */) { - call = factory.createAwaitExpression(call); - } - if (isInJSXContent(node)) { - call = factory.createJsxExpression( - /*dotDotDotToken*/ - void 0, - call - ); - } - if (exposedVariableDeclarations.length && !writes) { - Debug.assert(!returnValueProperty, "Expected no returnValueProperty"); - Debug.assert(!(range.facts & 1 /* HasReturn */), "Expected RangeFacts.HasReturn flag to be unset"); - if (exposedVariableDeclarations.length === 1) { - const variableDeclaration = exposedVariableDeclarations[0]; - newNodes.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - getSynthesizedDeepClone(variableDeclaration.name), - /*exclamationToken*/ - void 0, - /*type*/ - getSynthesizedDeepClone(variableDeclaration.type), - /*initializer*/ - call - )], - variableDeclaration.parent.flags - ) - )); - } else { - const bindingElements = []; - const typeElements = []; - let commonNodeFlags = exposedVariableDeclarations[0].parent.flags; - let sawExplicitType = false; - for (const variableDeclaration of exposedVariableDeclarations) { - bindingElements.push(factory.createBindingElement( - /*dotDotDotToken*/ - void 0, - /*propertyName*/ - void 0, - /*name*/ - getSynthesizedDeepClone(variableDeclaration.name) - )); - const variableType = checker.typeToTypeNode( - checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), - scope, - 1 /* NoTruncation */, - 8 /* AllowUnresolvedNames */ - ); - typeElements.push(factory.createPropertySignature( - /*modifiers*/ - void 0, - /*name*/ - variableDeclaration.symbol.name, - /*questionToken*/ - void 0, - /*type*/ - variableType - )); - sawExplicitType = sawExplicitType || variableDeclaration.type !== void 0; - commonNodeFlags = commonNodeFlags & variableDeclaration.parent.flags; - } - const typeLiteral = sawExplicitType ? factory.createTypeLiteralNode(typeElements) : void 0; - if (typeLiteral) { - setEmitFlags(typeLiteral, 1 /* SingleLine */); - } - newNodes.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - factory.createObjectBindingPattern(bindingElements), - /*exclamationToken*/ - void 0, - /*type*/ - typeLiteral, - /*initializer*/ - call - )], - commonNodeFlags - ) - )); - } - } else if (exposedVariableDeclarations.length || writes) { - if (exposedVariableDeclarations.length) { - for (const variableDeclaration of exposedVariableDeclarations) { - let flags = variableDeclaration.parent.flags; - if (flags & 2 /* Const */) { - flags = flags & ~2 /* Const */ | 1 /* Let */; - } - newNodes.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - variableDeclaration.symbol.name, - /*exclamationToken*/ - void 0, - getTypeDeepCloneUnionUndefined(variableDeclaration.type) - )], - flags - ) - )); - } - } - if (returnValueProperty) { - newNodes.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - returnValueProperty, - /*exclamationToken*/ - void 0, - getTypeDeepCloneUnionUndefined(returnType) - )], - 1 /* Let */ - ) - )); - } - const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); - if (returnValueProperty) { - assignments.unshift(factory.createShorthandPropertyAssignment(returnValueProperty)); - } - if (assignments.length === 1) { - Debug.assert(!returnValueProperty, "Shouldn't have returnValueProperty here"); - newNodes.push(factory.createExpressionStatement(factory.createAssignment(assignments[0].name, call))); - if (range.facts & 1 /* HasReturn */) { - newNodes.push(factory.createReturnStatement()); - } - } else { - newNodes.push(factory.createExpressionStatement(factory.createAssignment(factory.createObjectLiteralExpression(assignments), call))); - if (returnValueProperty) { - newNodes.push(factory.createReturnStatement(factory.createIdentifier(returnValueProperty))); - } - } - } else { - if (range.facts & 1 /* HasReturn */) { - newNodes.push(factory.createReturnStatement(call)); - } else if (isReadonlyArray(range.range)) { - newNodes.push(factory.createExpressionStatement(call)); - } else { - newNodes.push(call); - } - } - if (isReadonlyArray(range.range)) { - changeTracker.replaceNodeRangeWithNodes(context.file, first(range.range), last(range.range), newNodes); - } else { - changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); - } - const edits = changeTracker.getChanges(); - const renameRange = isReadonlyArray(range.range) ? first(range.range) : range.range; - const renameFilename = renameRange.getSourceFile().fileName; - const renameLocation = getRenameLocation( - edits, - renameFilename, - functionNameText, - /*preferLastLocation*/ - false - ); - return { renameFilename, renameLocation, edits }; - function getTypeDeepCloneUnionUndefined(typeNode) { - if (typeNode === void 0) { - return void 0; - } - const clone2 = getSynthesizedDeepClone(typeNode); - let withoutParens = clone2; - while (isParenthesizedTypeNode(withoutParens)) { - withoutParens = withoutParens.type; - } - return isUnionTypeNode(withoutParens) && find(withoutParens.types, (t) => t.kind === 157 /* UndefinedKeyword */) ? clone2 : factory.createUnionTypeNode([clone2, factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]); - } -} -function extractConstantInScope(node, scope, { substitutions }, rangeFacts, context) { - const checker = context.program.getTypeChecker(); - const file = scope.getSourceFile(); - const localNameText = getIdentifierForNode(node, scope, checker, file); - const isJS = isInJSFile(scope); - let variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */); - let initializer = transformConstantInitializer(skipParentheses(node), substitutions); - ({ variableType, initializer } = transformFunctionInitializerAndType(variableType, initializer)); - suppressLeadingAndTrailingTrivia(initializer); - const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context); - if (isClassLike(scope)) { - Debug.assert(!isJS, "Cannot extract to a JS class"); - const modifiers = []; - modifiers.push(factory.createModifier(123 /* PrivateKeyword */)); - if (rangeFacts & 32 /* InStaticRegion */) { - modifiers.push(factory.createModifier(126 /* StaticKeyword */)); - } - modifiers.push(factory.createModifier(148 /* ReadonlyKeyword */)); - const newVariable = factory.createPropertyDeclaration( - modifiers, - localNameText, - /*questionOrExclamationToken*/ - void 0, - variableType, - initializer - ); - let localReference = factory.createPropertyAccessExpression( - rangeFacts & 32 /* InStaticRegion */ ? factory.createIdentifier(scope.name.getText()) : factory.createThis(), - factory.createIdentifier(localNameText) - ); - if (isInJSXContent(node)) { - localReference = factory.createJsxExpression( - /*dotDotDotToken*/ - void 0, - localReference - ); - } - const maxInsertionPos = node.pos; - const nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); - changeTracker.insertNodeBefore( - context.file, - nodeToInsertBefore, - newVariable, - /*blankLineBetween*/ - true - ); - changeTracker.replaceNode(context.file, node, localReference); - } else { - const newVariableDeclaration = factory.createVariableDeclaration( - localNameText, - /*exclamationToken*/ - void 0, - variableType, - initializer - ); - const oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope); - if (oldVariableDeclaration) { - changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); - const localReference = factory.createIdentifier(localNameText); - changeTracker.replaceNode(context.file, node, localReference); - } else if (node.parent.kind === 245 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) { - const newVariableStatement = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */) - ); - changeTracker.replaceNode(context.file, node.parent, newVariableStatement); - } else { - const newVariableStatement = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */) - ); - const nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope); - if (nodeToInsertBefore.pos === 0) { - changeTracker.insertNodeAtTopOfFile( - context.file, - newVariableStatement, - /*blankLineBetween*/ - false - ); - } else { - changeTracker.insertNodeBefore( - context.file, - nodeToInsertBefore, - newVariableStatement, - /*blankLineBetween*/ - false - ); - } - if (node.parent.kind === 245 /* ExpressionStatement */) { - changeTracker.delete(context.file, node.parent); - } else { - let localReference = factory.createIdentifier(localNameText); - if (isInJSXContent(node)) { - localReference = factory.createJsxExpression( - /*dotDotDotToken*/ - void 0, - localReference - ); - } - changeTracker.replaceNode(context.file, node, localReference); - } - } - } - const edits = changeTracker.getChanges(); - const renameFilename = node.getSourceFile().fileName; - const renameLocation = getRenameLocation( - edits, - renameFilename, - localNameText, - /*preferLastLocation*/ - true - ); - return { renameFilename, renameLocation, edits }; - function transformFunctionInitializerAndType(variableType2, initializer2) { - if (variableType2 === void 0) return { variableType: variableType2, initializer: initializer2 }; - if (!isFunctionExpression(initializer2) && !isArrowFunction(initializer2) || !!initializer2.typeParameters) return { variableType: variableType2, initializer: initializer2 }; - const functionType = checker.getTypeAtLocation(node); - const functionSignature = singleOrUndefined(checker.getSignaturesOfType(functionType, 0 /* Call */)); - if (!functionSignature) return { variableType: variableType2, initializer: initializer2 }; - if (!!functionSignature.getTypeParameters()) return { variableType: variableType2, initializer: initializer2 }; - const parameters = []; - let hasAny = false; - for (const p of initializer2.parameters) { - if (p.type) { - parameters.push(p); - } else { - 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 */, 8 /* AllowUnresolvedNames */), 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 */, 8 /* AllowUnresolvedNames */), 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 */, 8 /* AllowUnresolvedNames */) - ) - ); - } - } - 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 }; - } -} -function getContainingVariableDeclarationIfInList(node, scope) { - let prevNode; - while (node !== void 0 && node !== scope) { - if (isVariableDeclaration(node) && node.initializer === prevNode && isVariableDeclarationList(node.parent) && node.parent.declarations.length > 1) { - return node; - } - prevNode = node; - node = node.parent; - } -} -function getFirstDeclarationBeforePosition(type, position) { - let firstDeclaration; - const symbol = type.symbol; - if (symbol && symbol.declarations) { - for (const declaration of symbol.declarations) { - if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) { - firstDeclaration = declaration; - } - } - } - return firstDeclaration; -} -function compareTypesByDeclarationOrder({ type: type1, declaration: declaration1 }, { type: type2, declaration: declaration2 }) { - return compareProperties(declaration1, declaration2, "pos", compareValues) || compareStringsCaseSensitive( - type1.symbol ? type1.symbol.getName() : "", - type2.symbol ? type2.symbol.getName() : "" - ) || compareValues(type1.id, type2.id); -} -function getCalledExpression(scope, range, functionNameText) { - const functionReference = factory.createIdentifier(functionNameText); - if (isClassLike(scope)) { - const lhs = range.facts & 32 /* InStaticRegion */ ? factory.createIdentifier(scope.name.text) : factory.createThis(); - return factory.createPropertyAccessExpression(lhs, functionReference); - } else { - return functionReference; - } -} -function transformFunctionBody(body, exposedVariableDeclarations, writes, substitutions, hasReturn2) { - const hasWritesOrVariableDeclarations = writes !== void 0 || exposedVariableDeclarations.length > 0; - if (isBlock(body) && !hasWritesOrVariableDeclarations && substitutions.size === 0) { - return { body: factory.createBlock( - body.statements, - /*multiLine*/ - true - ), returnValueProperty: void 0 }; - } - let returnValueProperty; - let ignoreReturns = false; - const statements = factory.createNodeArray(isBlock(body) ? body.statements.slice(0) : [isStatement(body) ? body : factory.createReturnStatement(skipParentheses(body))]); - if (hasWritesOrVariableDeclarations || substitutions.size) { - const rewrittenStatements = visitNodes2(statements, visitor, isStatement).slice(); - if (hasWritesOrVariableDeclarations && !hasReturn2 && isStatement(body)) { - const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); - if (assignments.length === 1) { - rewrittenStatements.push(factory.createReturnStatement(assignments[0].name)); - } else { - rewrittenStatements.push(factory.createReturnStatement(factory.createObjectLiteralExpression(assignments))); - } - } - return { body: factory.createBlock( - rewrittenStatements, - /*multiLine*/ - true - ), returnValueProperty }; - } else { - return { body: factory.createBlock( - statements, - /*multiLine*/ - true - ), returnValueProperty: void 0 }; - } - function visitor(node) { - if (!ignoreReturns && isReturnStatement(node) && hasWritesOrVariableDeclarations) { - const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); - if (node.expression) { - if (!returnValueProperty) { - returnValueProperty = "__return"; - } - assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor, isExpression))); - } - if (assignments.length === 1) { - return factory.createReturnStatement(assignments[0].name); - } else { - return factory.createReturnStatement(factory.createObjectLiteralExpression(assignments)); - } - } else { - const oldIgnoreReturns = ignoreReturns; - ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node); - const substitution = substitutions.get(getNodeId(node).toString()); - const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild( - node, - visitor, - /*context*/ - void 0 - ); - ignoreReturns = oldIgnoreReturns; - return result; - } - } -} -function transformConstantInitializer(initializer, substitutions) { - return substitutions.size ? visitor(initializer) : initializer; - function visitor(node) { - const substitution = substitutions.get(getNodeId(node).toString()); - return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild( - node, - visitor, - /*context*/ - void 0 - ); - } -} -function getStatementsOrClassElements(scope) { - if (isFunctionLikeDeclaration(scope)) { - const body = scope.body; - if (isBlock(body)) { - return body.statements; - } - } else if (isModuleBlock(scope) || isSourceFile(scope)) { - return scope.statements; - } else if (isClassLike(scope)) { - return scope.members; - } else { - assertType(scope); - } - return emptyArray; -} -function getNodeToInsertFunctionBefore(minPos, scope) { - return find(getStatementsOrClassElements(scope), (child) => child.pos >= minPos && isFunctionLikeDeclaration(child) && !isConstructorDeclaration(child)); -} -function getNodeToInsertPropertyBefore(maxPos, scope) { - const members = scope.members; - Debug.assert(members.length > 0, "Found no members"); - let prevMember; - let allProperties = true; - for (const member of members) { - if (member.pos > maxPos) { - return prevMember || members[0]; - } - if (allProperties && !isPropertyDeclaration(member)) { - if (prevMember !== void 0) { - return member; - } - allProperties = false; - } - prevMember = member; - } - if (prevMember === void 0) return Debug.fail(); - return prevMember; -} -function getNodeToInsertConstantBefore(node, scope) { - Debug.assert(!isClassLike(scope)); - let prevScope; - for (let curr = node; curr !== scope; curr = curr.parent) { - if (isScope(curr)) { - prevScope = curr; - } - } - for (let curr = (prevScope || node).parent; ; curr = curr.parent) { - if (isBlockLike(curr)) { - let prevStatement; - for (const statement of curr.statements) { - if (statement.pos > node.pos) { - break; - } - prevStatement = statement; - } - if (!prevStatement && isCaseClause(curr)) { - Debug.assert(isSwitchStatement(curr.parent.parent), "Grandparent isn't a switch statement"); - return curr.parent.parent; - } - return Debug.checkDefined(prevStatement, "prevStatement failed to get set"); - } - Debug.assert(curr !== scope, "Didn't encounter a block-like before encountering scope"); - } -} -function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) { - const variableAssignments = map(exposedVariableDeclarations, (v) => factory.createShorthandPropertyAssignment(v.symbol.name)); - const writeAssignments = map(writes, (w) => factory.createShorthandPropertyAssignment(w.symbol.name)); - return variableAssignments === void 0 ? writeAssignments : writeAssignments === void 0 ? variableAssignments : variableAssignments.concat(writeAssignments); -} -function isReadonlyArray(v) { - return isArray(v); -} -function getEnclosingTextRange(targetRange, sourceFile) { - return isReadonlyArray(targetRange.range) ? { pos: first(targetRange.range).getStart(sourceFile), end: last(targetRange.range).getEnd() } : targetRange.range; -} -function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker, cancellationToken) { - const allTypeParameterUsages = /* @__PURE__ */ new Map(); - const usagesPerScope = []; - const substitutionsPerScope = []; - const functionErrorsPerScope = []; - const constantErrorsPerScope = []; - const visibleDeclarationsInExtractedRange = []; - const exposedVariableSymbolSet = /* @__PURE__ */ new Map(); - const exposedVariableDeclarations = []; - let firstExposedNonVariableDeclaration; - const expression = !isReadonlyArray(targetRange.range) ? targetRange.range : targetRange.range.length === 1 && isExpressionStatement(targetRange.range[0]) ? targetRange.range[0].expression : void 0; - let expressionDiagnostic; - if (expression === void 0) { - const statements = targetRange.range; - const start = first(statements).getStart(); - const end = last(statements).end; - expressionDiagnostic = createFileDiagnostic(sourceFile, start, end - start, Messages.expressionExpected); - } else if (checker.getTypeAtLocation(expression).flags & (16384 /* Void */ | 131072 /* Never */)) { - expressionDiagnostic = createDiagnosticForNode(expression, Messages.uselessConstantType); - } - for (const scope of scopes) { - usagesPerScope.push({ usages: /* @__PURE__ */ new Map(), typeParameterUsages: /* @__PURE__ */ new Map(), substitutions: /* @__PURE__ */ new Map() }); - substitutionsPerScope.push(/* @__PURE__ */ new Map()); - functionErrorsPerScope.push([]); - const constantErrors = []; - if (expressionDiagnostic) { - constantErrors.push(expressionDiagnostic); - } - if (isClassLike(scope) && isInJSFile(scope)) { - constantErrors.push(createDiagnosticForNode(scope, Messages.cannotExtractToJSClass)); - } - if (isArrowFunction(scope) && !isBlock(scope.body)) { - constantErrors.push(createDiagnosticForNode(scope, Messages.cannotExtractToExpressionArrowFunction)); - } - constantErrorsPerScope.push(constantErrors); - } - const seenUsages = /* @__PURE__ */ new Map(); - const target = isReadonlyArray(targetRange.range) ? factory.createBlock(targetRange.range) : targetRange.range; - const unmodifiedNode = isReadonlyArray(targetRange.range) ? first(targetRange.range) : targetRange.range; - const inGenericContext = isInGenericContext(unmodifiedNode); - collectUsages(target); - if (inGenericContext && !isReadonlyArray(targetRange.range) && !isJsxAttribute(targetRange.range)) { - const contextualType = checker.getContextualType(targetRange.range); - recordTypeParameterUsages(contextualType); - } - if (allTypeParameterUsages.size > 0) { - const seenTypeParameterUsages = /* @__PURE__ */ new Map(); - let i = 0; - for (let curr = unmodifiedNode; curr !== void 0 && i < scopes.length; curr = curr.parent) { - if (curr === scopes[i]) { - seenTypeParameterUsages.forEach((typeParameter, id) => { - usagesPerScope[i].typeParameterUsages.set(id, typeParameter); - }); - i++; - } - if (isDeclarationWithTypeParameters(curr)) { - for (const typeParameterDecl of getEffectiveTypeParameterDeclarations(curr)) { - const typeParameter = checker.getTypeAtLocation(typeParameterDecl); - if (allTypeParameterUsages.has(typeParameter.id.toString())) { - seenTypeParameterUsages.set(typeParameter.id.toString(), typeParameter); - } - } - } - } - Debug.assert(i === scopes.length, "Should have iterated all scopes"); - } - if (visibleDeclarationsInExtractedRange.length) { - const containingLexicalScopeOfExtraction = isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : getEnclosingBlockScopeContainer(scopes[0]); - forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); - } - for (let i = 0; i < scopes.length; i++) { - const scopeUsages = usagesPerScope[i]; - if (i > 0 && (scopeUsages.usages.size > 0 || scopeUsages.typeParameterUsages.size > 0)) { - const errorNode = isReadonlyArray(targetRange.range) ? targetRange.range[0] : targetRange.range; - constantErrorsPerScope[i].push(createDiagnosticForNode(errorNode, Messages.cannotAccessVariablesFromNestedScopes)); - } - if (targetRange.facts & 16 /* UsesThisInFunction */ && isClassLike(scopes[i])) { - functionErrorsPerScope[i].push(createDiagnosticForNode(targetRange.thisNode, Messages.cannotExtractFunctionsContainingThisToMethod)); - } - let hasWrite = false; - let readonlyClassPropertyWrite; - 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, 8 /* Readonly */)) { - readonlyClassPropertyWrite = value.symbol.valueDeclaration; - } - } - }); - Debug.assert(isReadonlyArray(targetRange.range) || exposedVariableDeclarations.length === 0, "No variable declarations expected if something was extracted"); - if (hasWrite && !isReadonlyArray(targetRange.range)) { - const diag2 = createDiagnosticForNode(targetRange.range, Messages.cannotWriteInExpression); - functionErrorsPerScope[i].push(diag2); - constantErrorsPerScope[i].push(diag2); - } else if (readonlyClassPropertyWrite && i > 0) { - const diag2 = createDiagnosticForNode(readonlyClassPropertyWrite, Messages.cannotExtractReadonlyPropertyInitializerOutsideConstructor); - functionErrorsPerScope[i].push(diag2); - constantErrorsPerScope[i].push(diag2); - } else if (firstExposedNonVariableDeclaration) { - const diag2 = createDiagnosticForNode(firstExposedNonVariableDeclaration, Messages.cannotExtractExportedEntity); - functionErrorsPerScope[i].push(diag2); - constantErrorsPerScope[i].push(diag2); - } - } - return { target, usagesPerScope, functionErrorsPerScope, constantErrorsPerScope, exposedVariableDeclarations }; - function isInGenericContext(node) { - return !!findAncestor(node, (n) => isDeclarationWithTypeParameters(n) && getEffectiveTypeParameterDeclarations(n).length !== 0); - } - function recordTypeParameterUsages(type) { - const symbolWalker = checker.getSymbolWalker(() => (cancellationToken.throwIfCancellationRequested(), true)); - const { visitedTypes } = symbolWalker.walkType(type); - for (const visitedType of visitedTypes) { - if (visitedType.isTypeParameter()) { - allTypeParameterUsages.set(visitedType.id.toString(), visitedType); - } - } - } - function collectUsages(node, valueUsage = 1 /* Read */) { - if (inGenericContext) { - const type = checker.getTypeAtLocation(node); - recordTypeParameterUsages(type); - } - if (isDeclaration(node) && node.symbol) { - visibleDeclarationsInExtractedRange.push(node); - } - if (isAssignmentExpression(node)) { - collectUsages(node.left, 2 /* Write */); - collectUsages(node.right); - } else if (isUnaryExpressionWithWrite(node)) { - collectUsages(node.operand, 2 /* Write */); - } else if (isPropertyAccessExpression(node) || isElementAccessExpression(node)) { - forEachChild(node, collectUsages); - } else if (isIdentifier(node)) { - if (!node.parent) { - return; - } - if (isQualifiedName(node.parent) && node !== node.parent.left) { - return; - } - if (isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { - return; - } - recordUsage( - node, - valueUsage, - /*isTypeNode*/ - isPartOfTypeNode(node) - ); - } else { - forEachChild(node, collectUsages); - } - } - function recordUsage(n, usage, isTypeNode2) { - const symbolId = recordUsagebySymbol(n, usage, isTypeNode2); - if (symbolId) { - for (let i = 0; i < scopes.length; i++) { - const substitution = substitutionsPerScope[i].get(symbolId); - if (substitution) { - usagesPerScope[i].substitutions.set(getNodeId(n).toString(), substitution); - } - } - } - } - function recordUsagebySymbol(identifier, usage, isTypeName) { - const symbol = getSymbolReferencedByIdentifier(identifier); - if (!symbol) { - return void 0; - } - const symbolId = getSymbolId(symbol).toString(); - const lastUsage = seenUsages.get(symbolId); - if (lastUsage && lastUsage >= usage) { - return symbolId; - } - seenUsages.set(symbolId, usage); - if (lastUsage) { - for (const perScope of usagesPerScope) { - const prevEntry = perScope.usages.get(identifier.text); - if (prevEntry) { - perScope.usages.set(identifier.text, { usage, symbol, node: identifier }); - } - } - return symbolId; - } - const decls = symbol.getDeclarations(); - const declInFile = decls && find(decls, (d) => d.getSourceFile() === sourceFile); - if (!declInFile) { - return void 0; - } - if (rangeContainsStartEnd(enclosingTextRange, declInFile.getStart(), declInFile.end)) { - return void 0; - } - if (targetRange.facts & 2 /* IsGenerator */ && usage === 2 /* Write */) { - const diag2 = createDiagnosticForNode(identifier, Messages.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators); - for (const errors of functionErrorsPerScope) { - errors.push(diag2); - } - for (const errors of constantErrorsPerScope) { - errors.push(diag2); - } - } - for (let i = 0; i < scopes.length; i++) { - const scope = scopes[i]; - const resolvedSymbol = checker.resolveName( - symbol.name, - scope, - symbol.flags, - /*excludeGlobals*/ - false - ); - if (resolvedSymbol === symbol) { - continue; - } - if (!substitutionsPerScope[i].has(symbolId)) { - const substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName); - if (substitution) { - substitutionsPerScope[i].set(symbolId, substitution); - } else if (isTypeName) { - if (!(symbol.flags & 262144 /* TypeParameter */)) { - const diag2 = createDiagnosticForNode(identifier, Messages.typeWillNotBeVisibleInTheNewScope); - functionErrorsPerScope[i].push(diag2); - constantErrorsPerScope[i].push(diag2); - } - } else { - usagesPerScope[i].usages.set(identifier.text, { usage, symbol, node: identifier }); - } - } - } - return symbolId; - } - function checkForUsedDeclarations(node) { - if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) { - return; - } - const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node); - if (sym) { - const decl = find(visibleDeclarationsInExtractedRange, (d) => d.symbol === sym); - if (decl) { - if (isVariableDeclaration(decl)) { - const idString = decl.symbol.id.toString(); - if (!exposedVariableSymbolSet.has(idString)) { - exposedVariableDeclarations.push(decl); - exposedVariableSymbolSet.set(idString, true); - } - } else { - firstExposedNonVariableDeclaration = firstExposedNonVariableDeclaration || decl; - } - } - } - forEachChild(node, checkForUsedDeclarations); - } - function getSymbolReferencedByIdentifier(identifier) { - return identifier.parent && isShorthandPropertyAssignment(identifier.parent) && identifier.parent.name === identifier ? checker.getShorthandAssignmentValueSymbol(identifier.parent) : checker.getSymbolAtLocation(identifier); - } - function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode2) { - if (!symbol) { - return void 0; - } - const decls = symbol.getDeclarations(); - if (decls && decls.some((d) => d.parent === scopeDecl)) { - return factory.createIdentifier(symbol.name); - } - const prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode2); - if (prefix === void 0) { - return void 0; - } - return isTypeNode2 ? factory.createQualifiedName(prefix, factory.createIdentifier(symbol.name)) : factory.createPropertyAccessExpression(prefix, symbol.name); - } -} -function getExtractableParent(node) { - return findAncestor(node, (node2) => node2.parent && isExtractableExpression(node2) && !isBinaryExpression(node2.parent)); -} -function isExtractableExpression(node) { - const { parent: parent2 } = node; - switch (parent2.kind) { - case 307 /* EnumMember */: - return false; - } - switch (node.kind) { - case 11 /* StringLiteral */: - return parent2.kind !== 273 /* ImportDeclaration */ && parent2.kind !== 277 /* ImportSpecifier */; - case 231 /* SpreadElement */: - case 207 /* ObjectBindingPattern */: - case 209 /* BindingElement */: - return false; - case 80 /* Identifier */: - return parent2.kind !== 209 /* BindingElement */ && parent2.kind !== 277 /* ImportSpecifier */ && parent2.kind !== 282 /* ExportSpecifier */; - } - return true; -} -function isInJSXContent(node) { - return isStringLiteralJsxAttribute(node) || (isJsxElement(node) || isJsxSelfClosingElement(node) || isJsxFragment(node)) && (isJsxElement(node.parent) || isJsxFragment(node.parent)); -} -function isStringLiteralJsxAttribute(node) { - return isStringLiteral(node) && node.parent && isJsxAttribute(node.parent); -} - -// src/services/_namespaces/ts.refactor.generateGetAccessorAndSetAccessor.ts -var ts_refactor_generateGetAccessorAndSetAccessor_exports = {}; - -// src/services/refactors/generateGetAccessorAndSetAccessor.ts -var actionName = "Generate 'get' and 'set' accessors"; -var actionDescription = getLocaleSpecificMessage(Diagnostics.Generate_get_and_set_accessors); -var generateGetSetAction = { - name: actionName, - description: actionDescription, - kind: "refactor.rewrite.property.generateAccessors" -}; -registerRefactor(actionName, { - kinds: [generateGetSetAction.kind], - getEditsForAction: function getRefactorActionsToGenerateGetAndSetAccessors(context, actionName2) { - if (!context.endPosition) return void 0; - const info = ts_codefix_exports.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition); - Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_codefix_exports.generateAccessorFromProperty(context.file, context.program, context.startPosition, context.endPosition, context, actionName2); - if (!edits) return void 0; - const renameFilename = context.file.fileName; - const nameNeedRename = info.renameAccessor ? info.accessorName : info.fieldName; - const renameLocationOffset = isIdentifier(nameNeedRename) ? 0 : -1; - const renameLocation = renameLocationOffset + getRenameLocation( - edits, - renameFilename, - nameNeedRename.text, - /*preferLastLocation*/ - isParameter(info.declaration) - ); - return { renameFilename, renameLocation, edits }; - }, - getAvailableActions(context) { - if (!context.endPosition) return emptyArray; - const info = ts_codefix_exports.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition, context.triggerReason === "invoked"); - if (!info) return emptyArray; - if (!isRefactorErrorInfo(info)) { - return [{ - name: actionName, - description: actionDescription, - actions: [generateGetSetAction] - }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [{ - name: actionName, - description: actionDescription, - actions: [{ ...generateGetSetAction, notApplicableReason: info.error }] - }]; - } - return emptyArray; - } -}); - -// src/services/_namespaces/ts.refactor.inferFunctionReturnType.ts -var ts_refactor_inferFunctionReturnType_exports = {}; - -// src/services/refactors/inferFunctionReturnType.ts -var refactorName13 = "Infer function return type"; -var refactorDescription7 = getLocaleSpecificMessage(Diagnostics.Infer_function_return_type); -var inferReturnTypeAction = { - name: refactorName13, - description: refactorDescription7, - kind: "refactor.rewrite.function.returnType" -}; -registerRefactor(refactorName13, { - kinds: [inferReturnTypeAction.kind], - getEditsForAction: getRefactorEditsToInferReturnType, - getAvailableActions: getRefactorActionsToInferReturnType -}); -function getRefactorEditsToInferReturnType(context) { - const info = getInfo4(context); - if (info && !isRefactorErrorInfo(info)) { - const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange7(context.file, t, info.declaration, info.returnTypeNode)); - return { renameFilename: void 0, renameLocation: void 0, edits }; - } - return void 0; -} -function getRefactorActionsToInferReturnType(context) { - const info = getInfo4(context); - if (!info) return emptyArray; - if (!isRefactorErrorInfo(info)) { - return [{ - name: refactorName13, - description: refactorDescription7, - actions: [inferReturnTypeAction] - }]; - } - if (context.preferences.provideRefactorNotApplicableReason) { - return [{ - name: refactorName13, - description: refactorDescription7, - actions: [{ ...inferReturnTypeAction, notApplicableReason: info.error }] - }]; - } - return emptyArray; -} -function doChange7(sourceFile, changes, declaration, typeNode) { - const closeParen = findChildOfKind(declaration, 22 /* CloseParenToken */, sourceFile); - const needParens = isArrowFunction(declaration) && closeParen === void 0; - const endNode2 = needParens ? first(declaration.parameters) : closeParen; - if (endNode2) { - if (needParens) { - changes.insertNodeBefore(sourceFile, endNode2, factory.createToken(21 /* OpenParenToken */)); - changes.insertNodeAfter(sourceFile, endNode2, factory.createToken(22 /* CloseParenToken */)); - } - changes.insertNodeAt(sourceFile, endNode2.end, typeNode, { prefix: ": " }); - } -} -function getInfo4(context) { - if (isInJSFile(context.file) || !refactorKindBeginsWith(inferReturnTypeAction.kind, context.kind)) return; - 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) }; - } - const typeChecker = context.program.getTypeChecker(); - let returnType; - if (typeChecker.isImplementationOfOverload(declaration)) { - const signatures = typeChecker.getTypeAtLocation(declaration).getCallSignatures(); - if (signatures.length > 1) { - returnType = typeChecker.getUnionType(mapDefined(signatures, (s) => s.getReturnType())); - } - } - if (!returnType) { - const signature = typeChecker.getSignatureFromDeclaration(declaration); - if (signature) { - const typePredicate = typeChecker.getTypePredicateOfSignature(signature); - if (typePredicate && typePredicate.type) { - const typePredicateTypeNode = typeChecker.typePredicateToTypePredicateNode(typePredicate, declaration, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */); - if (typePredicateTypeNode) { - return { declaration, returnTypeNode: typePredicateTypeNode }; - } - } else { - returnType = typeChecker.getReturnTypeOfSignature(signature); - } - } - } - if (!returnType) { - return { error: getLocaleSpecificMessage(Diagnostics.Could_not_determine_function_return_type) }; - } - const returnTypeNode = typeChecker.typeToTypeNode(returnType, declaration, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */); - if (returnTypeNode) { - return { declaration, returnTypeNode }; - } -} -function isConvertibleDeclaration(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - return true; - default: - return false; - } -} - -// src/services/classifier2020.ts -var TokenEncodingConsts = /* @__PURE__ */ ((TokenEncodingConsts2) => { - TokenEncodingConsts2[TokenEncodingConsts2["typeOffset"] = 8] = "typeOffset"; - TokenEncodingConsts2[TokenEncodingConsts2["modifierMask"] = 255] = "modifierMask"; - return TokenEncodingConsts2; -})(TokenEncodingConsts || {}); -var TokenType = /* @__PURE__ */ ((TokenType2) => { - TokenType2[TokenType2["class"] = 0] = "class"; - TokenType2[TokenType2["enum"] = 1] = "enum"; - TokenType2[TokenType2["interface"] = 2] = "interface"; - TokenType2[TokenType2["namespace"] = 3] = "namespace"; - TokenType2[TokenType2["typeParameter"] = 4] = "typeParameter"; - TokenType2[TokenType2["type"] = 5] = "type"; - TokenType2[TokenType2["parameter"] = 6] = "parameter"; - TokenType2[TokenType2["variable"] = 7] = "variable"; - TokenType2[TokenType2["enumMember"] = 8] = "enumMember"; - TokenType2[TokenType2["property"] = 9] = "property"; - TokenType2[TokenType2["function"] = 10] = "function"; - TokenType2[TokenType2["member"] = 11] = "member"; - return TokenType2; -})(TokenType || {}); -var TokenModifier = /* @__PURE__ */ ((TokenModifier2) => { - TokenModifier2[TokenModifier2["declaration"] = 0] = "declaration"; - TokenModifier2[TokenModifier2["static"] = 1] = "static"; - TokenModifier2[TokenModifier2["async"] = 2] = "async"; - TokenModifier2[TokenModifier2["readonly"] = 3] = "readonly"; - TokenModifier2[TokenModifier2["defaultLibrary"] = 4] = "defaultLibrary"; - TokenModifier2[TokenModifier2["local"] = 5] = "local"; - return TokenModifier2; -})(TokenModifier || {}); -function getSemanticClassifications2(program, cancellationToken, sourceFile, span) { - const classifications = getEncodedSemanticClassifications2(program, cancellationToken, sourceFile, span); - Debug.assert(classifications.spans.length % 3 === 0); - const dense = classifications.spans; - const result = []; - for (let i = 0; i < dense.length; i += 3) { - result.push({ - textSpan: createTextSpan(dense[i], dense[i + 1]), - classificationType: dense[i + 2] - }); - } - return result; -} -function getEncodedSemanticClassifications2(program, cancellationToken, sourceFile, span) { - return { - spans: getSemanticTokens(program, sourceFile, span, cancellationToken), - endOfLineState: 0 /* None */ - }; -} -function getSemanticTokens(program, sourceFile, span, cancellationToken) { - const resultTokens = []; - const collector = (node, typeIdx, modifierSet) => { - resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), (typeIdx + 1 << 8 /* typeOffset */) + modifierSet); - }; - if (program && sourceFile) { - collectTokens(program, sourceFile, span, collector, cancellationToken); - } - return resultTokens; -} -function collectTokens(program, sourceFile, span, collector, cancellationToken) { - const typeChecker = program.getTypeChecker(); - let inJSXElement = false; - function visit(node) { - switch (node.kind) { - case 268 /* ModuleDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 263 /* FunctionDeclaration */: - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } - if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { - return; - } - const prevInJSXElement = inJSXElement; - if (isJsxElement(node) || isJsxSelfClosingElement(node)) { - inJSXElement = true; - } - if (isJsxExpression(node)) { - inJSXElement = false; - } - if (isIdentifier(node) && !inJSXElement && !inImportClause(node) && !isInfinityOrNaNString(node.escapedText)) { - let symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - if (symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - let typeIdx = classifySymbol2(symbol, getMeaningFromLocation(node)); - if (typeIdx !== void 0) { - let modifierSet = 0; - if (node.parent) { - const parentIsDeclaration = isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx; - if (parentIsDeclaration && node.parent.name === node) { - modifierSet = 1 << 0 /* declaration */; - } - } - if (typeIdx === 6 /* parameter */ && isRightSideOfQualifiedNameOrPropertyAccess2(node)) { - typeIdx = 9 /* property */; - } - typeIdx = reclassifyByType(typeChecker, node, typeIdx); - const decl = symbol.valueDeclaration; - if (decl) { - const modifiers = getCombinedModifierFlags(decl); - const nodeFlags = getCombinedNodeFlags(decl); - if (modifiers & 256 /* Static */) { - modifierSet |= 1 << 1 /* static */; - } - if (modifiers & 1024 /* Async */) { - modifierSet |= 1 << 2 /* async */; - } - if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) { - if (modifiers & 8 /* Readonly */ || nodeFlags & 2 /* Const */ || symbol.getFlags() & 8 /* EnumMember */) { - modifierSet |= 1 << 3 /* readonly */; - } - } - if ((typeIdx === 7 /* variable */ || typeIdx === 10 /* function */) && isLocalDeclaration(decl, sourceFile)) { - modifierSet |= 1 << 5 /* local */; - } - if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - } else if (symbol.declarations && symbol.declarations.some((d) => program.isSourceFileDefaultLibrary(d.getSourceFile()))) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - collector(node, typeIdx, modifierSet); - } - } - } - forEachChild(node, visit); - inJSXElement = prevInJSXElement; - } - visit(sourceFile); -} -function classifySymbol2(symbol, meaning) { - const flags = symbol.getFlags(); - if (flags & 32 /* Class */) { - return 0 /* class */; - } else if (flags & 384 /* Enum */) { - return 1 /* enum */; - } else if (flags & 524288 /* TypeAlias */) { - return 5 /* type */; - } else if (flags & 64 /* Interface */) { - if (meaning & 2 /* Type */) { - return 2 /* interface */; - } - } else if (flags & 262144 /* TypeParameter */) { - return 4 /* typeParameter */; - } - let decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; - if (decl && isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - return decl && tokenFromDeclarationMapping.get(decl.kind); -} -function reclassifyByType(typeChecker, node, typeIdx) { - if (typeIdx === 7 /* variable */ || typeIdx === 9 /* property */ || typeIdx === 6 /* parameter */) { - const type = typeChecker.getTypeAtLocation(node); - if (type) { - const test = (condition) => { - return condition(type) || type.isUnion() && type.types.some(condition); - }; - if (typeIdx !== 6 /* parameter */ && test((t) => t.getConstructSignatures().length > 0)) { - return 0 /* class */; - } - if (test((t) => t.getCallSignatures().length > 0) && !test((t) => t.getProperties().length > 0) || isExpressionInCallExpression(node)) { - return typeIdx === 9 /* property */ ? 11 /* member */ : 10 /* function */; - } - } - } - return typeIdx; -} -function isLocalDeclaration(decl, sourceFile) { - if (isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - if (isVariableDeclaration(decl)) { - return (!isSourceFile(decl.parent.parent.parent) || isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile; - } else if (isFunctionDeclaration(decl)) { - return !isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile; - } - return false; -} -function getDeclarationForBindingElement(element) { - while (true) { - if (isBindingElement(element.parent.parent)) { - element = element.parent.parent; - } else { - return element.parent.parent; - } - } -} -function inImportClause(node) { - const parent2 = node.parent; - return parent2 && (isImportClause(parent2) || isImportSpecifier(parent2) || isNamespaceImport(parent2)); -} -function isExpressionInCallExpression(node) { - while (isRightSideOfQualifiedNameOrPropertyAccess2(node)) { - node = node.parent; - } - return isCallExpression(node.parent) && node.parent.expression === node; -} -function isRightSideOfQualifiedNameOrPropertyAccess2(node) { - return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node; -} -var tokenFromDeclarationMapping = /* @__PURE__ */ new Map([ - [261 /* VariableDeclaration */, 7 /* variable */], - [170 /* Parameter */, 6 /* parameter */], - [173 /* PropertyDeclaration */, 9 /* property */], - [268 /* ModuleDeclaration */, 3 /* namespace */], - [267 /* EnumDeclaration */, 1 /* enum */], - [307 /* EnumMember */, 8 /* enumMember */], - [264 /* ClassDeclaration */, 0 /* class */], - [175 /* MethodDeclaration */, 11 /* member */], - [263 /* FunctionDeclaration */, 10 /* function */], - [219 /* FunctionExpression */, 10 /* function */], - [174 /* MethodSignature */, 11 /* member */], - [178 /* GetAccessor */, 9 /* property */], - [179 /* SetAccessor */, 9 /* property */], - [172 /* PropertySignature */, 9 /* property */], - [265 /* InterfaceDeclaration */, 2 /* interface */], - [266 /* TypeAliasDeclaration */, 5 /* type */], - [169 /* TypeParameter */, 4 /* typeParameter */], - [304 /* PropertyAssignment */, 9 /* property */], - [305 /* ShorthandPropertyAssignment */, 9 /* property */] -]); - -// src/services/services.ts -var servicesVersion = "0.8"; -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 & 101441536 /* ContextFlags */; - return node; -} -var NodeObject = class { - constructor(kind, pos, end) { - this.pos = pos; - this.end = end; - this.kind = kind; - this.id = 0; - this.flags = 0 /* None */; - this.modifierFlagsCache = 0 /* None */; - this.transformFlags = 0 /* None */; - this.parent = void 0; - this.original = void 0; - this.emitNode = void 0; - } - assertHasRealPosition(message) { - Debug.assert(!positionIsSynthesized(this.pos) && !positionIsSynthesized(this.end), message || "Node must have a real position for this operation"); - } - getSourceFile() { - return getSourceFileOfNode(this); - } - getStart(sourceFile, includeJsDocComment) { - this.assertHasRealPosition(); - return getTokenPosOfNode(this, sourceFile, includeJsDocComment); - } - getFullStart() { - this.assertHasRealPosition(); - return this.pos; - } - getEnd() { - this.assertHasRealPosition(); - return this.end; - } - getWidth(sourceFile) { - this.assertHasRealPosition(); - return this.getEnd() - this.getStart(sourceFile); - } - getFullWidth() { - this.assertHasRealPosition(); - return this.end - this.pos; - } - getLeadingTriviaWidth(sourceFile) { - this.assertHasRealPosition(); - return this.getStart(sourceFile) - this.pos; - } - getFullText(sourceFile) { - this.assertHasRealPosition(); - return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); - } - getText(sourceFile) { - this.assertHasRealPosition(); - if (!sourceFile) { - sourceFile = this.getSourceFile(); - } - return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd()); - } - getChildCount(sourceFile) { - return this.getChildren(sourceFile).length; - } - getChildAt(index, sourceFile) { - return this.getChildren(sourceFile)[index]; - } - getChildren(sourceFile = getSourceFileOfNode(this)) { - this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"); - return getNodeChildren(this, sourceFile) ?? setNodeChildren(this, sourceFile, createChildren(this, sourceFile)); - } - getFirstToken(sourceFile) { - this.assertHasRealPosition(); - const children = this.getChildren(sourceFile); - if (!children.length) { - return void 0; - } - const child = find(children, (kid) => kid.kind < 310 /* FirstJSDocNode */ || kid.kind > 352 /* LastJSDocNode */); - return child.kind < 167 /* FirstNode */ ? child : child.getFirstToken(sourceFile); - } - getLastToken(sourceFile) { - this.assertHasRealPosition(); - const children = this.getChildren(sourceFile); - const child = lastOrUndefined(children); - if (!child) { - return void 0; - } - return child.kind < 167 /* FirstNode */ ? child : child.getLastToken(sourceFile); - } - forEachChild(cbNode, cbNodeArray) { - return forEachChild(this, cbNode, cbNodeArray); - } -}; -function createChildren(node, sourceFile) { - const children = []; - if (isJSDocCommentContainingNode(node)) { - node.forEachChild((child) => { - children.push(child); - }); - return children; - } - const languageVariant = (sourceFile == null ? void 0 : sourceFile.languageVariant) ?? 0 /* Standard */; - scanner.setText((sourceFile || node.getSourceFile()).text); - scanner.setLanguageVariant(languageVariant); - let pos = node.pos; - const processNode = (child) => { - addSyntheticNodes(children, pos, child.pos, node); - children.push(child); - pos = child.end; - }; - const processNodes = (nodes) => { - addSyntheticNodes(children, pos, nodes.pos, node); - children.push(createSyntaxList(nodes, node)); - pos = nodes.end; - }; - forEach(node.jsDoc, processNode); - pos = node.pos; - node.forEachChild(processNode, processNodes); - addSyntheticNodes(children, pos, node.end, node); - scanner.setText(void 0); - scanner.setLanguageVariant(0 /* Standard */); - return children; -} -function addSyntheticNodes(nodes, pos, end, parent2) { - scanner.resetTokenState(pos); - while (pos < end) { - const token = scanner.scan(); - const textPos = scanner.getTokenEnd(); - if (textPos <= end) { - if (token === 80 /* Identifier */) { - if (hasTabstop(parent2)) { - continue; - } - Debug.fail(`Did not expect ${Debug.formatSyntaxKind(parent2.kind)} to have an Identifier in its trivia`); - } - nodes.push(createNode(token, pos, textPos, parent2)); - } - pos = textPos; - if (token === 1 /* EndOfFileToken */) { - break; - } - } -} -function createSyntaxList(nodes, parent2) { - const list = createNode(353 /* SyntaxList */, nodes.pos, nodes.end, parent2); - const children = []; - let pos = nodes.pos; - for (const node of nodes) { - addSyntheticNodes(children, pos, node.pos, parent2); - children.push(node); - pos = node.end; - } - addSyntheticNodes(children, pos, nodes.end, parent2); - list._children = children; - return list; -} -var TokenOrIdentifierObject = class { - constructor(kind, pos, end) { - this.pos = pos; - this.end = end; - this.kind = kind; - this.id = 0; - this.flags = 0 /* None */; - this.transformFlags = 0 /* None */; - this.parent = void 0; - this.emitNode = void 0; - } - getSourceFile() { - return getSourceFileOfNode(this); - } - getStart(sourceFile, includeJsDocComment) { - return getTokenPosOfNode(this, sourceFile, includeJsDocComment); - } - getFullStart() { - return this.pos; - } - getEnd() { - return this.end; - } - getWidth(sourceFile) { - return this.getEnd() - this.getStart(sourceFile); - } - getFullWidth() { - return this.end - this.pos; - } - getLeadingTriviaWidth(sourceFile) { - return this.getStart(sourceFile) - this.pos; - } - getFullText(sourceFile) { - return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); - } - getText(sourceFile) { - if (!sourceFile) { - sourceFile = this.getSourceFile(); - } - return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd()); - } - getChildCount() { - return this.getChildren().length; - } - getChildAt(index) { - return this.getChildren()[index]; - } - getChildren() { - return this.kind === 1 /* EndOfFileToken */ ? this.jsDoc || emptyArray : emptyArray; - } - getFirstToken() { - return void 0; - } - getLastToken() { - return void 0; - } - forEachChild() { - return void 0; - } -}; -var SymbolObject = class { - constructor(flags, name) { - this.flags = flags; - this.escapedName = name; - this.declarations = void 0; - this.valueDeclaration = void 0; - this.id = 0; - this.mergeId = 0; - this.parent = void 0; - this.members = void 0; - this.exports = void 0; - this.exportSymbol = void 0; - this.constEnumOnlyModule = void 0; - this.isReferenced = void 0; - this.lastAssignmentPos = void 0; - this.links = void 0; - } - getFlags() { - return this.flags; - } - get name() { - return symbolName(this); - } - getEscapedName() { - return this.escapedName; - } - getName() { - return this.name; - } - getDeclarations() { - return this.declarations; - } - getDocumentationComment(checker) { - if (!this.documentationComment) { - this.documentationComment = emptyArray; - if (!this.declarations && isTransientSymbol(this) && this.links.target && isTransientSymbol(this.links.target) && this.links.target.links.tupleLabelDeclaration) { - const labelDecl = this.links.target.links.tupleLabelDeclaration; - this.documentationComment = getDocumentationComment([labelDecl], checker); - } else { - this.documentationComment = getDocumentationComment(this.declarations, checker); - } - } - return this.documentationComment; - } - getContextualDocumentationComment(context, checker) { - if (context) { - if (isGetAccessor(context)) { - if (!this.contextualGetAccessorDocumentationComment) { - this.contextualGetAccessorDocumentationComment = emptyArray; - this.contextualGetAccessorDocumentationComment = getDocumentationComment(filter(this.declarations, isGetAccessor), checker); - } - if (length(this.contextualGetAccessorDocumentationComment)) { - return this.contextualGetAccessorDocumentationComment; - } - } - if (isSetAccessor(context)) { - if (!this.contextualSetAccessorDocumentationComment) { - this.contextualSetAccessorDocumentationComment = emptyArray; - this.contextualSetAccessorDocumentationComment = getDocumentationComment(filter(this.declarations, isSetAccessor), checker); - } - if (length(this.contextualSetAccessorDocumentationComment)) { - return this.contextualSetAccessorDocumentationComment; - } - } - } - return this.getDocumentationComment(checker); - } - getJsDocTags(checker) { - if (this.tags === void 0) { - this.tags = emptyArray; - this.tags = getJsDocTagsOfDeclarations(this.declarations, checker); - } - return this.tags; - } - getContextualJsDocTags(context, checker) { - if (context) { - if (isGetAccessor(context)) { - if (!this.contextualGetAccessorTags) { - this.contextualGetAccessorTags = emptyArray; - this.contextualGetAccessorTags = getJsDocTagsOfDeclarations(filter(this.declarations, isGetAccessor), checker); - } - if (length(this.contextualGetAccessorTags)) { - return this.contextualGetAccessorTags; - } - } - if (isSetAccessor(context)) { - if (!this.contextualSetAccessorTags) { - this.contextualSetAccessorTags = emptyArray; - this.contextualSetAccessorTags = getJsDocTagsOfDeclarations(filter(this.declarations, isSetAccessor), checker); - } - if (length(this.contextualSetAccessorTags)) { - return this.contextualSetAccessorTags; - } - } - } - return this.getJsDocTags(checker); - } -}; -var TokenObject = class extends TokenOrIdentifierObject { - constructor(kind, pos, end) { - super(kind, pos, end); - } -}; -var IdentifierObject = class extends TokenOrIdentifierObject { - constructor(kind, pos, end) { - super(kind, pos, end); - } - get text() { - return idText(this); - } -}; -var PrivateIdentifierObject = class extends TokenOrIdentifierObject { - constructor(kind, pos, end) { - super(kind, pos, end); - } - get text() { - return idText(this); - } -}; -var TypeObject = class { - constructor(checker, flags) { - this.flags = flags; - this.checker = checker; - } - getFlags() { - return this.flags; - } - getSymbol() { - return this.symbol; - } - getProperties() { - return this.checker.getPropertiesOfType(this); - } - getProperty(propertyName) { - return this.checker.getPropertyOfType(this, propertyName); - } - getApparentProperties() { - return this.checker.getAugmentedPropertiesOfType(this); - } - getCallSignatures() { - return this.checker.getSignaturesOfType(this, 0 /* Call */); - } - getConstructSignatures() { - return this.checker.getSignaturesOfType(this, 1 /* Construct */); - } - getStringIndexType() { - return this.checker.getIndexTypeOfType(this, 0 /* String */); - } - getNumberIndexType() { - return this.checker.getIndexTypeOfType(this, 1 /* Number */); - } - getBaseTypes() { - return this.isClassOrInterface() ? this.checker.getBaseTypes(this) : void 0; - } - isNullableType() { - return this.checker.isNullableType(this); - } - getNonNullableType() { - return this.checker.getNonNullableType(this); - } - getNonOptionalType() { - return this.checker.getNonOptionalType(this); - } - getConstraint() { - return this.checker.getBaseConstraintOfType(this); - } - getDefault() { - return this.checker.getDefaultFromTypeParameter(this); - } - isUnion() { - return !!(this.flags & 1048576 /* Union */); - } - isIntersection() { - return !!(this.flags & 2097152 /* Intersection */); - } - isUnionOrIntersection() { - return !!(this.flags & 3145728 /* UnionOrIntersection */); - } - isLiteral() { - return !!(this.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */ | 2048 /* BigIntLiteral */)); - } - isStringLiteral() { - return !!(this.flags & 128 /* StringLiteral */); - } - isNumberLiteral() { - return !!(this.flags & 256 /* NumberLiteral */); - } - isTypeParameter() { - return !!(this.flags & 262144 /* TypeParameter */); - } - isClassOrInterface() { - return !!(getObjectFlags(this) & 3 /* ClassOrInterface */); - } - isClass() { - return !!(getObjectFlags(this) & 1 /* Class */); - } - isIndexType() { - return !!(this.flags & 4194304 /* Index */); - } - /** - * This polyfills `referenceType.typeArguments` for API consumers - */ - get typeArguments() { - if (getObjectFlags(this) & 4 /* Reference */) { - return this.checker.getTypeArguments(this); - } - return void 0; - } -}; -var SignatureObject = class { - // same - constructor(checker, flags) { - this.flags = flags; - this.checker = checker; - } - getDeclaration() { - return this.declaration; - } - getTypeParameters() { - return this.typeParameters; - } - getParameters() { - return this.parameters; - } - getReturnType() { - return this.checker.getReturnTypeOfSignature(this); - } - getTypeParameterAtPosition(pos) { - const type = this.checker.getParameterType(this, pos); - if (type.isIndexType() && isThisTypeParameter(type.type)) { - const constraint = type.type.getConstraint(); - if (constraint) { - return this.checker.getIndexType(constraint); - } - } - return type; - } - getDocumentationComment() { - return this.documentationComment || (this.documentationComment = getDocumentationComment(singleElementArray(this.declaration), this.checker)); - } - getJsDocTags() { - return this.jsDocTags || (this.jsDocTags = getJsDocTagsOfDeclarations(singleElementArray(this.declaration), this.checker)); - } -}; -function hasJSDocInheritDocTag(node) { - return getJSDocTags(node).some((tag) => tag.tagName.text === "inheritDoc" || tag.tagName.text === "inheritdoc"); -} -function getJsDocTagsOfDeclarations(declarations, checker) { - if (!declarations) return emptyArray; - let tags = ts_JsDoc_exports.getJsDocTagsFromDeclarations(declarations, checker); - if (checker && (tags.length === 0 || declarations.some(hasJSDocInheritDocTag))) { - const seenSymbols = /* @__PURE__ */ new Set(); - for (const declaration of declarations) { - const inheritedTags = findBaseOfDeclaration(checker, declaration, (symbol) => { - var _a; - if (!seenSymbols.has(symbol)) { - seenSymbols.add(symbol); - if (declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) { - return symbol.getContextualJsDocTags(declaration, checker); - } - return ((_a = symbol.declarations) == null ? void 0 : _a.length) === 1 ? symbol.getJsDocTags(checker) : void 0; - } - }); - if (inheritedTags) { - tags = [...inheritedTags, ...tags]; - } - } - } - return tags; -} -function getDocumentationComment(declarations, checker) { - if (!declarations) return emptyArray; - let doc = ts_JsDoc_exports.getJsDocCommentsFromDeclarations(declarations, checker); - if (checker && (doc.length === 0 || declarations.some(hasJSDocInheritDocTag))) { - const seenSymbols = /* @__PURE__ */ new Set(); - for (const declaration of declarations) { - const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => { - if (!seenSymbols.has(symbol)) { - seenSymbols.add(symbol); - if (declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) { - return symbol.getContextualDocumentationComment(declaration, checker); - } - return symbol.getDocumentationComment(checker); - } - }); - if (inheritedDocs) doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(lineBreakPart(), doc); - } - } - return doc; -} -function findBaseOfDeclaration(checker, declaration, cb) { - var _a; - const classOrInterfaceDeclaration = ((_a = declaration.parent) == null ? void 0 : _a.kind) === 177 /* Constructor */ ? declaration.parent.parent : declaration.parent; - if (!classOrInterfaceDeclaration) return; - const isStaticMember = hasStaticModifier(declaration); - return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), (superTypeNode) => { - const baseType = checker.getTypeAtLocation(superTypeNode); - const type = isStaticMember && baseType.symbol ? checker.getTypeOfSymbol(baseType.symbol) : baseType; - const symbol = checker.getPropertyOfType(type, declaration.symbol.name); - return symbol ? cb(symbol) : void 0; - }); -} -var SourceFileObject = class extends NodeObject { - constructor(kind, pos, end) { - super(kind, pos, end); - } - update(newText, textChangeRange) { - return updateSourceFile(this, newText, textChangeRange); - } - getLineAndCharacterOfPosition(position) { - return getLineAndCharacterOfPosition(this, position); - } - getLineStarts() { - return getLineStarts(this); - } - getPositionOfLineAndCharacter(line, character, allowEdits) { - return computePositionOfLineAndCharacter(getLineStarts(this), line, character, this.text, allowEdits); - } - getLineEndOfPosition(pos) { - const { line } = this.getLineAndCharacterOfPosition(pos); - const lineStarts = this.getLineStarts(); - let lastCharPos; - if (line + 1 >= lineStarts.length) { - lastCharPos = this.getEnd(); - } - if (!lastCharPos) { - lastCharPos = lineStarts[line + 1] - 1; - } - const fullText = this.getFullText(); - return fullText[lastCharPos] === "\n" && fullText[lastCharPos - 1] === "\r" ? lastCharPos - 1 : lastCharPos; - } - getNamedDeclarations() { - if (!this.namedDeclarations) { - this.namedDeclarations = this.computeNamedDeclarations(); - } - return this.namedDeclarations; - } - computeNamedDeclarations() { - const result = createMultiMap(); - this.forEachChild(visit); - return result; - function addDeclaration(declaration) { - const name = getDeclarationName(declaration); - if (name) { - result.add(name, declaration); - } - } - function getDeclarations(name) { - let declarations = result.get(name); - if (!declarations) { - result.set(name, declarations = []); - } - return declarations; - } - function getDeclarationName(declaration) { - const name = getNonAssignedNameOfDeclaration(declaration); - return name && (isComputedPropertyName(name) && isPropertyAccessExpression(name.expression) ? name.expression.name.text : isPropertyName(name) ? getNameFromPropertyName(name) : void 0); - } - function visit(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - const functionDeclaration = node; - const declarationName = getDeclarationName(functionDeclaration); - if (declarationName) { - const declarations = getDeclarations(declarationName); - const lastDeclaration = lastOrUndefined(declarations); - if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) { - if (functionDeclaration.body && !lastDeclaration.body) { - declarations[declarations.length - 1] = functionDeclaration; - } - } else { - declarations.push(functionDeclaration); - } - } - forEachChild(node, visit); - break; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 267 /* EnumDeclaration */: - case 268 /* ModuleDeclaration */: - case 272 /* ImportEqualsDeclaration */: - case 282 /* ExportSpecifier */: - case 277 /* ImportSpecifier */: - case 274 /* ImportClause */: - case 275 /* NamespaceImport */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 188 /* TypeLiteral */: - addDeclaration(node); - forEachChild(node, visit); - break; - case 170 /* Parameter */: - if (!hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) { - break; - } - // falls through - case 261 /* VariableDeclaration */: - case 209 /* BindingElement */: { - const decl = node; - if (isBindingPattern(decl.name)) { - forEachChild(decl.name, visit); - break; - } - if (decl.initializer) { - visit(decl.initializer); - } - } - // falls through - case 307 /* EnumMember */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - addDeclaration(node); - break; - case 279 /* ExportDeclaration */: - const exportDeclaration = node; - if (exportDeclaration.exportClause) { - if (isNamedExports(exportDeclaration.exportClause)) { - forEach(exportDeclaration.exportClause.elements, visit); - } else { - visit(exportDeclaration.exportClause.name); - } - } - break; - case 273 /* ImportDeclaration */: - const importClause = node.importClause; - if (importClause) { - if (importClause.name) { - addDeclaration(importClause.name); - } - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { - addDeclaration(importClause.namedBindings); - } else { - forEach(importClause.namedBindings.elements, visit); - } - } - } - break; - case 227 /* BinaryExpression */: - if (getAssignmentDeclarationKind(node) !== 0 /* None */) { - addDeclaration(node); - } - // falls through - default: - forEachChild(node, visit); - } - } - } -}; -var SourceMapSourceObject = class { - constructor(fileName, text, skipTrivia2) { - this.fileName = fileName; - this.text = text; - this.skipTrivia = skipTrivia2 || ((pos) => pos); - } - getLineAndCharacterOfPosition(pos) { - return getLineAndCharacterOfPosition(this, pos); - } -}; -function getServicesObjectAllocator() { - return { - getNodeConstructor: () => NodeObject, - getTokenConstructor: () => TokenObject, - getIdentifierConstructor: () => IdentifierObject, - getPrivateIdentifierConstructor: () => PrivateIdentifierObject, - getSourceFileConstructor: () => SourceFileObject, - getSymbolConstructor: () => SymbolObject, - getTypeConstructor: () => TypeObject, - getSignatureConstructor: () => SignatureObject, - getSourceMapSourceConstructor: () => SourceMapSourceObject - }; -} -function toEditorSettings(optionsAsMap) { - let allPropertiesAreCamelCased = true; - for (const key in optionsAsMap) { - if (hasProperty(optionsAsMap, key) && !isCamelCase(key)) { - allPropertiesAreCamelCased = false; - break; - } - } - if (allPropertiesAreCamelCased) { - return optionsAsMap; - } - const settings = {}; - for (const key in optionsAsMap) { - if (hasProperty(optionsAsMap, key)) { - const newKey = isCamelCase(key) ? key : key.charAt(0).toLowerCase() + key.substr(1); - settings[newKey] = optionsAsMap[key]; - } - } - return settings; -} -function isCamelCase(s) { - return !s.length || s.charAt(0) === s.charAt(0).toLowerCase(); -} -function displayPartsToString(displayParts) { - if (displayParts) { - return map(displayParts, (displayPart2) => displayPart2.text).join(""); - } - return ""; -} -function getDefaultCompilerOptions2() { - return { - target: 1 /* ES5 */, - jsx: 1 /* Preserve */ - }; -} -function getSupportedCodeFixes() { - return ts_codefix_exports.getSupportedErrorCodes(); -} -var SyntaxTreeCache = class { - constructor(host) { - this.host = host; - } - getCurrentSourceFile(fileName) { - var _a, _b, _c, _d, _e, _f, _g, _h; - const scriptSnapshot = this.host.getScriptSnapshot(fileName); - if (!scriptSnapshot) { - throw new Error("Could not find file: '" + fileName + "'."); - } - const scriptKind = getScriptKind(fileName, this.host); - const version2 = this.host.getScriptVersion(fileName); - let sourceFile; - if (this.currentFileName !== fileName) { - const options = { - languageVersion: 99 /* Latest */, - impliedNodeFormat: getImpliedNodeFormatForFile( - toPath(fileName, this.host.getCurrentDirectory(), ((_c = (_b = (_a = this.host).getCompilerHost) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.getCanonicalFileName) || hostGetCanonicalFileName(this.host)), - (_h = (_g = (_f = (_e = (_d = this.host).getCompilerHost) == null ? void 0 : _e.call(_d)) == null ? void 0 : _f.getModuleResolutionCache) == null ? void 0 : _g.call(_f)) == null ? void 0 : _h.getPackageJsonInfoCache(), - this.host, - 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, - scriptSnapshot, - options, - version2, - /*setNodeParents*/ - true, - scriptKind - ); - } else if (this.currentFileVersion !== version2) { - const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version2, editRange); - } - if (sourceFile) { - this.currentFileVersion = version2; - this.currentFileName = fileName; - this.currentFileScriptSnapshot = scriptSnapshot; - this.currentSourceFile = sourceFile; - } - return this.currentSourceFile; - } -}; -function setSourceFileFields(sourceFile, scriptSnapshot, version2) { - sourceFile.version = version2; - sourceFile.scriptSnapshot = scriptSnapshot; -} -function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind) { - const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind); - setSourceFileFields(sourceFile, scriptSnapshot, version2); - return sourceFile; -} -function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version2, textChangeRange, aggressiveChecks) { - if (textChangeRange) { - if (version2 !== sourceFile.version) { - let newText; - const prefix = textChangeRange.span.start !== 0 ? sourceFile.text.substr(0, textChangeRange.span.start) : ""; - const suffix = textSpanEnd(textChangeRange.span) !== sourceFile.text.length ? sourceFile.text.substr(textSpanEnd(textChangeRange.span)) : ""; - if (textChangeRange.newLength === 0) { - newText = prefix && suffix ? prefix + suffix : prefix || suffix; - } else { - const changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength); - newText = prefix && suffix ? prefix + changedText + suffix : prefix ? prefix + changedText : changedText + suffix; - } - const newSourceFile = updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); - setSourceFileFields(newSourceFile, scriptSnapshot, version2); - newSourceFile.nameTable = void 0; - if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) { - if (sourceFile.scriptSnapshot.dispose) { - sourceFile.scriptSnapshot.dispose(); - } - sourceFile.scriptSnapshot = void 0; - } - return newSourceFile; - } - } - const options = { - languageVersion: sourceFile.languageVersion, - impliedNodeFormat: sourceFile.impliedNodeFormat, - setExternalModuleIndicator: sourceFile.setExternalModuleIndicator, - jsDocParsingMode: sourceFile.jsDocParsingMode - }; - return createLanguageServiceSourceFile( - sourceFile.fileName, - scriptSnapshot, - options, - version2, - /*setNodeParents*/ - true, - sourceFile.scriptKind - ); -} -var NoopCancellationToken = { - isCancellationRequested: returnFalse, - throwIfCancellationRequested: noop -}; -var CancellationTokenObject = class { - constructor(cancellationToken) { - this.cancellationToken = cancellationToken; - } - isCancellationRequested() { - return this.cancellationToken.isCancellationRequested(); - } - throwIfCancellationRequested() { - var _a; - if (this.isCancellationRequested()) { - (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "cancellationThrown", { kind: "CancellationTokenObject" }); - throw new OperationCanceledException(); - } - } -}; -var ThrottledCancellationToken = class { - constructor(hostCancellationToken, throttleWaitMilliseconds = 20) { - this.hostCancellationToken = hostCancellationToken; - this.throttleWaitMilliseconds = throttleWaitMilliseconds; - // Store when we last tried to cancel. Checking cancellation can be expensive (as we have - // to marshall over to the host layer). So we only bother actually checking once enough - // time has passed. - this.lastCancellationCheckTime = 0; - } - isCancellationRequested() { - const time = timestamp(); - const duration = Math.abs(time - this.lastCancellationCheckTime); - if (duration >= this.throttleWaitMilliseconds) { - this.lastCancellationCheckTime = time; - return this.hostCancellationToken.isCancellationRequested(); - } - return false; - } - throwIfCancellationRequested() { - var _a; - if (this.isCancellationRequested()) { - (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "cancellationThrown", { kind: "ThrottledCancellationToken" }); - throw new OperationCanceledException(); - } - } -}; -var invalidOperationsInPartialSemanticMode = [ - "getSemanticDiagnostics", - "getSuggestionDiagnostics", - "getCompilerOptionsDiagnostics", - "getSemanticClassifications", - "getEncodedSemanticClassifications", - "getCodeFixesAtPosition", - "getCombinedCodeFix", - "applyCodeActionCommand", - "organizeImports", - "getEditsForFileRename", - "getEmitOutput", - "getApplicableRefactors", - "getEditsForRefactor", - "prepareCallHierarchy", - "provideCallHierarchyIncomingCalls", - "provideCallHierarchyOutgoingCalls", - "provideInlayHints", - "getSupportedCodeFixes", - "getPasteEdits" -]; -var invalidOperationsInSyntacticMode = [ - ...invalidOperationsInPartialSemanticMode, - "getCompletionsAtPosition", - "getCompletionEntryDetails", - "getCompletionEntrySymbol", - "getSignatureHelpItems", - "getQuickInfoAtPosition", - "getDefinitionAtPosition", - "getDefinitionAndBoundSpan", - "getImplementationAtPosition", - "getTypeDefinitionAtPosition", - "getReferencesAtPosition", - "findReferences", - "getDocumentHighlights", - "getNavigateToItems", - "getRenameInfo", - "findRenameLocations", - "getApplicableRefactors", - "preparePasteEditsForFile" -]; -function createLanguageService(host, documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory(), host.jsDocParsingMode), syntaxOnlyOrLanguageServiceMode) { - var _a; - let languageServiceMode; - if (syntaxOnlyOrLanguageServiceMode === void 0) { - languageServiceMode = 0 /* Semantic */; - } else if (typeof syntaxOnlyOrLanguageServiceMode === "boolean") { - languageServiceMode = syntaxOnlyOrLanguageServiceMode ? 2 /* Syntactic */ : 0 /* Semantic */; - } else { - languageServiceMode = syntaxOnlyOrLanguageServiceMode; - } - const syntaxTreeCache = new SyntaxTreeCache(host); - let program; - let lastProjectVersion; - let lastTypesRootVersion = 0; - const cancellationToken = host.getCancellationToken ? new CancellationTokenObject(host.getCancellationToken()) : NoopCancellationToken; - const currentDirectory = host.getCurrentDirectory(); - maybeSetLocalizedDiagnosticMessages((_a = host.getLocalizedDiagnosticMessages) == null ? void 0 : _a.bind(host)); - function log(message) { - if (host.log) { - host.log(message); - } - } - const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); - const sourceMapper = getSourceMapper({ - useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, - getCurrentDirectory: () => currentDirectory, - getProgram, - fileExists: maybeBind(host, host.fileExists), - readFile: maybeBind(host, host.readFile), - getDocumentPositionMapper: maybeBind(host, host.getDocumentPositionMapper), - getSourceFileLike: maybeBind(host, host.getSourceFileLike), - log - }); - function getValidSourceFile(fileName) { - const sourceFile = program.getSourceFile(fileName); - if (!sourceFile) { - 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) { - const hostProjectVersion = host.getProjectVersion(); - if (hostProjectVersion) { - if (lastProjectVersion === hostProjectVersion && !((_a2 = host.hasChangedAutomaticTypeDirectiveNames) == null ? void 0 : _a2.call(host))) { - return; - } - lastProjectVersion = hostProjectVersion; - } - } - const typeRootsVersion = host.getTypeRootsVersion ? host.getTypeRootsVersion() : 0; - if (lastTypesRootVersion !== typeRootsVersion) { - log("TypeRoots version has changed; provide new program"); - program = void 0; - lastTypesRootVersion = typeRootsVersion; - } - const rootFileNames = host.getScriptFileNames().slice(); - const newSettings = host.getCompilationSettings() || getDefaultCompilerOptions2(); - const hasInvalidatedResolutions = host.hasInvalidatedResolutions || returnFalse; - const hasInvalidatedLibResolutions = maybeBind(host, host.hasInvalidatedLibResolutions) || returnFalse; - const hasChangedAutomaticTypeDirectiveNames = maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames); - const projectReferences = (_b = host.getProjectReferences) == null ? void 0 : _b.call(host); - let parsedCommandLines; - let compilerHost = { - getSourceFile: getOrCreateSourceFile, - getSourceFileByPath: getOrCreateSourceFileByPath, - getCancellationToken: () => cancellationToken, - getCanonicalFileName, - useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, - getNewLine: () => getNewLineCharacter(newSettings), - getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2), - writeFile: noop, - getCurrentDirectory: () => currentDirectory, - fileExists: (fileName) => host.fileExists(fileName), - readFile: (fileName) => host.readFile && host.readFile(fileName), - getSymlinkCache: maybeBind(host, host.getSymlinkCache), - realpath: maybeBind(host, host.realpath), - directoryExists: (directoryName) => { - return directoryProbablyExists(directoryName, host); - }, - getDirectories: (path) => { - return host.getDirectories ? host.getDirectories(path) : []; - }, - readDirectory: (path, extensions, exclude, include, depth) => { - Debug.checkDefined(host.readDirectory, "'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"); - return host.readDirectory(path, extensions, exclude, include, depth); - }, - onReleaseOldSourceFile, - onReleaseParsedCommandLine, - hasInvalidatedResolutions, - hasInvalidatedLibResolutions, - hasChangedAutomaticTypeDirectiveNames, - trace: maybeBind(host, host.trace), - resolveModuleNames: maybeBind(host, host.resolveModuleNames), - getModuleResolutionCache: maybeBind(host, host.getModuleResolutionCache), - createHash: maybeBind(host, host.createHash), - resolveTypeReferenceDirectives: maybeBind(host, host.resolveTypeReferenceDirectives), - resolveModuleNameLiterals: maybeBind(host, host.resolveModuleNameLiterals), - resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences), - resolveLibrary: maybeBind(host, host.resolveLibrary), - useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect), - getParsedCommandLine, - jsDocParsingMode: host.jsDocParsingMode, - getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation) - }; - const originalGetSourceFile = compilerHost.getSourceFile; - const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache( - compilerHost, - (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName), - (...args) => originalGetSourceFile.call(compilerHost, ...args) - ); - compilerHost.getSourceFile = getSourceFileWithCache; - (_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost); - const parseConfigHost = { - 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, - onUnRecoverableConfigFileDiagnostic: noop - }; - const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); - let releasedScriptKinds = /* @__PURE__ */ new Set(); - if (isProgramUptoDate(program, rootFileNames, newSettings, (_path, fileName) => host.getScriptVersion(fileName), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { - compilerHost = void 0; - parsedCommandLines = void 0; - releasedScriptKinds = void 0; - return; - } - const options = { - rootNames: rootFileNames, - options: newSettings, - host: compilerHost, - oldProgram: program, - projectReferences - }; - program = createProgram(options); - compilerHost = void 0; - parsedCommandLines = void 0; - releasedScriptKinds = void 0; - sourceMapper.clearCache(); - program.getTypeChecker(); - return; - function getParsedCommandLine(fileName) { - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const existing = parsedCommandLines == null ? void 0 : parsedCommandLines.get(path); - if (existing !== void 0) return existing || void 0; - const result = host.getParsedCommandLine ? host.getParsedCommandLine(fileName) : getParsedCommandLineOfConfigFileUsingSourceFile(fileName); - (parsedCommandLines || (parsedCommandLines = /* @__PURE__ */ new Map())).set(path, result || false); - return result; - } - function getParsedCommandLineOfConfigFileUsingSourceFile(configFileName) { - const result = getOrCreateSourceFile(configFileName, 100 /* JSON */); - if (!result) return void 0; - result.path = toPath(configFileName, currentDirectory, getCanonicalFileName); - result.resolvedPath = result.path; - result.originalFileName = result.fileName; - return parseJsonSourceFileConfigFileContent( - result, - parseConfigHost, - getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), - /*existingOptions*/ - void 0, - getNormalizedAbsolutePath(configFileName, currentDirectory) - ); - } - function onReleaseParsedCommandLine(configFileName, oldResolvedRef, oldOptions) { - var _a3; - if (host.getParsedCommandLine) { - (_a3 = host.onReleaseParsedCommandLine) == null ? void 0 : _a3.call(host, configFileName, oldResolvedRef, oldOptions); - } else if (oldResolvedRef) { - releaseOldSourceFile(oldResolvedRef.sourceFile, oldOptions); - } - } - function releaseOldSourceFile(oldSourceFile, oldOptions) { - const oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldOptions); - documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, oldSettingsKey, oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat); - } - function onReleaseOldSourceFile(oldSourceFile, oldOptions, hasSourceFileByPath, newSourceFileByResolvedPath) { - var _a3; - releaseOldSourceFile(oldSourceFile, oldOptions); - (_a3 = host.onReleaseOldSourceFile) == null ? void 0 : _a3.call(host, oldSourceFile, oldOptions, hasSourceFileByPath, newSourceFileByResolvedPath); - } - function getOrCreateSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) { - return getOrCreateSourceFileByPath(fileName, toPath(fileName, currentDirectory, getCanonicalFileName), languageVersionOrOptions, onError, shouldCreateNewSourceFile); - } - function getOrCreateSourceFileByPath(fileName, path, languageVersionOrOptions, _onError, shouldCreateNewSourceFile) { - Debug.assert(compilerHost, "getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host."); - const scriptSnapshot = host.getScriptSnapshot(fileName); - if (!scriptSnapshot) { - return void 0; - } - const scriptKind = getScriptKind(fileName, host); - const scriptVersion = host.getScriptVersion(fileName); - if (!shouldCreateNewSourceFile) { - const oldSourceFile = program && program.getSourceFileByPath(path); - if (oldSourceFile) { - if (scriptKind === oldSourceFile.scriptKind || releasedScriptKinds.has(oldSourceFile.resolvedPath)) { - return documentRegistry.updateDocumentWithKey(fileName, path, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions); - } else { - documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat); - releasedScriptKinds.add(oldSourceFile.resolvedPath); - } - } - } - return documentRegistry.acquireDocumentWithKey(fileName, path, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions); - } - } - function getProgram() { - if (languageServiceMode === 2 /* Syntactic */) { - Debug.assert(program === void 0); - return void 0; - } - synchronizeHostData(); - return program; - } - function getAutoImportProvider() { - var _a2; - return (_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host); - } - function updateIsDefinitionOfReferencedSymbols(referencedSymbols, knownSymbolSpans) { - const checker = program.getTypeChecker(); - const symbol = getSymbolForProgram(); - if (!symbol) return false; - for (const referencedSymbol of referencedSymbols) { - for (const ref of referencedSymbol.references) { - const refNode = getNodeForSpan(ref); - Debug.assertIsDefined(refNode); - if (knownSymbolSpans.has(ref) || ts_FindAllReferences_exports.isDeclarationOfSymbol(refNode, symbol)) { - knownSymbolSpans.add(ref); - ref.isDefinition = true; - const mappedSpan = getMappedDocumentSpan(ref, sourceMapper, maybeBind(host, host.fileExists)); - if (mappedSpan) { - knownSymbolSpans.add(mappedSpan); - } - } else { - ref.isDefinition = false; - } - } - } - return true; - function getSymbolForProgram() { - for (const referencedSymbol of referencedSymbols) { - for (const ref of referencedSymbol.references) { - if (knownSymbolSpans.has(ref)) { - const refNode = getNodeForSpan(ref); - Debug.assertIsDefined(refNode); - return checker.getSymbolAtLocation(refNode); - } - const mappedSpan = getMappedDocumentSpan(ref, sourceMapper, maybeBind(host, host.fileExists)); - if (mappedSpan && knownSymbolSpans.has(mappedSpan)) { - const refNode = getNodeForSpan(mappedSpan); - if (refNode) { - return checker.getSymbolAtLocation(refNode); - } - } - } - } - return void 0; - } - function getNodeForSpan(docSpan) { - const sourceFile = program.getSourceFile(docSpan.fileName); - if (!sourceFile) return void 0; - const rawNode = getTouchingPropertyName(sourceFile, docSpan.textSpan.start); - const adjustedNode = ts_FindAllReferences_exports.Core.getAdjustedNode(rawNode, { use: ts_FindAllReferences_exports.FindReferencesUse.References }); - return adjustedNode; - } - } - function cleanupSemanticCache() { - 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) { - synchronizeHostData(); - return program.getSyntacticDiagnostics(getValidSourceFile(fileName), cancellationToken).slice(); - } - function getSemanticDiagnostics(fileName) { - synchronizeHostData(); - const targetSourceFile = getValidSourceFile(fileName); - const semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); - if (!getEmitDeclarations(program.getCompilerOptions())) { - return semanticDiagnostics.slice(); - } - const declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); - return [...semanticDiagnostics, ...declarationDiagnostics]; - } - function getRegionSemanticDiagnostics(fileName, ranges) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const options = program.getCompilerOptions(); - if (skipTypeChecking(sourceFile, options, program) || !canIncludeBindAndCheckDiagnostics(sourceFile, options) || program.getCachedSemanticDiagnostics(sourceFile)) { - return void 0; - } - const nodes = getNodesForRanges(sourceFile, ranges); - if (!nodes) { - return void 0; - } - const checkedSpans = normalizeSpans(nodes.map((node) => createTextSpanFromBounds(node.getFullStart(), node.getEnd()))); - const semanticDiagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken, nodes); - return { - diagnostics: semanticDiagnostics.slice(), - spans: checkedSpans - }; - } - function getNodesForRanges(file, ranges) { - const nodes = []; - const spans = normalizeSpans(ranges.map((range) => createTextSpanFromRange(range))); - for (const span of spans) { - const nodesForSpan = getNodesForSpan(file, span); - if (!nodesForSpan) { - return void 0; - } - nodes.push(...nodesForSpan); - } - if (!nodes.length) { - return void 0; - } - return nodes; - } - function getNodesForSpan(file, span) { - if (textSpanContainsTextRange(span, file)) { - return void 0; - } - const endToken = findTokenOnLeftOfPosition(file, textSpanEnd(span)) || file; - const enclosingNode = findAncestor(endToken, (node) => textRangeContainsTextSpan(node, span)); - const nodes = []; - chooseOverlappingNodes(span, enclosingNode, nodes); - if (file.end === span.start + span.length) { - nodes.push(file.endOfFileToken); - } - if (some(nodes, isSourceFile)) { - return void 0; - } - return nodes; - } - function chooseOverlappingNodes(span, node, result) { - if (!nodeOverlapsWithSpan(node, span)) { - return false; - } - if (textSpanContainsTextRange(span, node)) { - addSourceElement(node, result); - return true; - } - if (isBlockLike(node)) { - return chooseOverlappingBlockLike(span, node, result); - } - if (isClassLike(node)) { - return chooseOverlappingClassLike(span, node, result); - } - addSourceElement(node, result); - return true; - } - function nodeOverlapsWithSpan(node, span) { - const spanEnd = span.start + span.length; - return node.pos < spanEnd && node.end > span.start; - } - function addSourceElement(node, result) { - while (node.parent && !isSourceElement(node)) { - node = node.parent; - } - result.push(node); - } - function chooseOverlappingBlockLike(span, node, result) { - const childResult = []; - const stmts = node.statements.filter((stmt) => chooseOverlappingNodes(span, stmt, childResult)); - if (stmts.length === node.statements.length) { - addSourceElement(node, result); - return true; - } - result.push(...childResult); - return false; - } - function chooseOverlappingClassLike(span, node, result) { - var _a2, _b, _c; - const overlaps = (n) => textRangeIntersectsWithTextSpan(n, span); - if (((_a2 = node.modifiers) == null ? void 0 : _a2.some(overlaps)) || node.name && overlaps(node.name) || ((_b = node.typeParameters) == null ? void 0 : _b.some(overlaps)) || ((_c = node.heritageClauses) == null ? void 0 : _c.some(overlaps))) { - addSourceElement(node, result); - return true; - } - const childResult = []; - const members = node.members.filter((member) => chooseOverlappingNodes(span, member, childResult)); - if (members.length === node.members.length) { - addSourceElement(node, result); - return true; - } - result.push(...childResult); - return false; - } - function getSuggestionDiagnostics(fileName) { - synchronizeHostData(); - return computeSuggestionDiagnostics(getValidSourceFile(fileName), program, cancellationToken); - } - function getCompilerOptionsDiagnostics() { - synchronizeHostData(); - return [...program.getOptionsDiagnostics(cancellationToken), ...program.getGlobalDiagnostics(cancellationToken)]; - } - function getCompletionsAtPosition2(fileName, position, options = emptyOptions, formattingSettings) { - const fullPreferences = { - ...identity(options), - // avoid excess property check - includeCompletionsForModuleExports: options.includeCompletionsForModuleExports || options.includeExternalModuleExports, - includeCompletionsWithInsertText: options.includeCompletionsWithInsertText || options.includeInsertTextCompletions - }; - synchronizeHostData(); - return ts_Completions_exports.getCompletionsAtPosition( - host, - program, - log, - getValidSourceFile(fileName), - position, - fullPreferences, - options.triggerCharacter, - options.triggerKind, - cancellationToken, - formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host), - options.includeSymbol - ); - } - function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) { - synchronizeHostData(); - return ts_Completions_exports.getCompletionEntryDetails( - program, - log, - getValidSourceFile(fileName), - position, - { name, source, data }, - host, - formattingOptions && ts_formatting_exports.getFormatContext(formattingOptions, host), - // TODO: GH#18217 - preferences, - cancellationToken - ); - } - function getCompletionEntrySymbol2(fileName, position, name, source, preferences = emptyOptions) { - synchronizeHostData(); - return ts_Completions_exports.getCompletionEntrySymbol(program, log, getValidSourceFile(fileName), position, { name, source }, host, preferences); - } - function getQuickInfoAtPosition(fileName, position, maximumLength, verbosityLevel) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const node = getTouchingPropertyName(sourceFile, position); - if (node === sourceFile) { - return void 0; - } - const typeChecker = program.getTypeChecker(); - const nodeForQuickInfo = getNodeForQuickInfo(node); - const symbol = getSymbolAtLocationForQuickInfo(nodeForQuickInfo, typeChecker); - if (!symbol || typeChecker.isUnknownSymbol(symbol)) { - const type = shouldGetType(sourceFile, nodeForQuickInfo, position) ? typeChecker.getTypeAtLocation(nodeForQuickInfo) : void 0; - return type && { - kind: "" /* unknown */, - kindModifiers: "" /* none */, - textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), - displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts( - typeChecker2, - type, - getContainerNode(nodeForQuickInfo), - /*flags*/ - void 0, - verbosityLevel - )), - documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : void 0, - tags: type.symbol ? type.symbol.getJsDocTags(typeChecker) : void 0 - }; - } - const { symbolKind, displayParts, documentation, tags, canIncreaseVerbosityLevel } = typeChecker.runWithCancellationToken( - cancellationToken, - (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind( - typeChecker2, - symbol, - sourceFile, - getContainerNode(nodeForQuickInfo), - nodeForQuickInfo, - /*semanticMeaning*/ - void 0, - /*alias*/ - void 0, - maximumLength ?? defaultHoverMaximumTruncationLength, - verbosityLevel - ) - ); - return { - kind: symbolKind, - kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), - textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), - displayParts, - documentation, - tags, - canIncreaseVerbosityLevel - }; - } - function preparePasteEditsForFile(fileName, copiedTextRange) { - synchronizeHostData(); - return ts_preparePasteEdits_exports.preparePasteEdits( - getValidSourceFile(fileName), - copiedTextRange, - program.getTypeChecker() - ); - } - function getPasteEdits(args, formatOptions) { - synchronizeHostData(); - return ts_PasteEdits_exports.pasteEditsProvider( - getValidSourceFile(args.targetFile), - args.pastedText, - args.pasteLocations, - args.copiedFrom ? { file: getValidSourceFile(args.copiedFrom.file), range: args.copiedFrom.range } : void 0, - host, - args.preferences, - ts_formatting_exports.getFormatContext(formatOptions, host), - cancellationToken - ); - } - function getNodeForQuickInfo(node) { - if (isNewExpression(node.parent) && node.pos === node.parent.pos) { - return node.parent.expression; - } - if (isNamedTupleMember(node.parent) && node.pos === node.parent.pos) { - return node.parent; - } - if (isImportMeta(node.parent) && node.parent.name === node) { - return node.parent; - } - if (isJsxNamespacedName(node.parent)) { - return node.parent; - } - return node; - } - function shouldGetType(sourceFile, node, position) { - switch (node.kind) { - case 80 /* Identifier */: - if (node.flags & 16777216 /* JSDoc */ && !isInJSFile(node) && (node.parent.kind === 172 /* PropertySignature */ && node.parent.name === node || findAncestor(node, (n) => n.kind === 170 /* Parameter */))) { - return false; - } - return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent); - case 212 /* PropertyAccessExpression */: - case 167 /* QualifiedName */: - return !isInComment(sourceFile, position); - case 110 /* ThisKeyword */: - case 198 /* ThisType */: - case 108 /* SuperKeyword */: - case 203 /* NamedTupleMember */: - return true; - case 237 /* MetaProperty */: - return isImportMeta(node); - default: - return false; - } - } - function getDefinitionAtPosition2(fileName, position, searchOtherFilesOnly, stopAtAlias) { - synchronizeHostData(); - return ts_GoToDefinition_exports.getDefinitionAtPosition(program, getValidSourceFile(fileName), position, searchOtherFilesOnly, stopAtAlias); - } - function getDefinitionAndBoundSpan2(fileName, position) { - synchronizeHostData(); - return ts_GoToDefinition_exports.getDefinitionAndBoundSpan(program, getValidSourceFile(fileName), position); - } - function getTypeDefinitionAtPosition2(fileName, position) { - synchronizeHostData(); - return ts_GoToDefinition_exports.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); - } - function getImplementationAtPosition(fileName, position) { - synchronizeHostData(); - return ts_FindAllReferences_exports.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); - } - function getDocumentHighlights(fileName, position, filesToSearch) { - const normalizedFileName = normalizePath(fileName); - Debug.assert(filesToSearch.some((f) => normalizePath(f) === normalizedFileName)); - synchronizeHostData(); - const sourceFilesToSearch = mapDefined(filesToSearch, (fileName2) => program.getSourceFile(fileName2)); - const sourceFile = getValidSourceFile(fileName); - return DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); - } - function findRenameLocations(fileName, position, findInStrings, findInComments, preferences) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const node = getAdjustedRenameLocation(getTouchingPropertyName(sourceFile, position)); - if (!ts_Rename_exports.nodeIsEligibleForRename(node)) return void 0; - if (isIdentifier(node) && (isJsxOpeningElement(node.parent) || isJsxClosingElement(node.parent)) && isIntrinsicJsxName(node.escapedText)) { - const { openingElement, closingElement } = node.parent.parent; - return [openingElement, closingElement].map((node2) => { - const textSpan = createTextSpanFromNode(node2.tagName, sourceFile); - return { - fileName: sourceFile.fileName, - textSpan, - ...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, node2.parent) - }; - }); - } else { - const quotePreference = getQuotePreference(sourceFile, preferences ?? emptyOptions); - const providePrefixAndSuffixTextForRename = typeof preferences === "boolean" ? preferences : preferences == null ? void 0 : preferences.providePrefixAndSuffixTextForRename; - 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 getReferencesWorker2(getTouchingPropertyName(getValidSourceFile(fileName), position), position, { use: ts_FindAllReferences_exports.FindReferencesUse.References }, ts_FindAllReferences_exports.toReferenceEntry); - } - 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); - } - function findReferences(fileName, position) { - synchronizeHostData(); - return ts_FindAllReferences_exports.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); - } - function getFileReferences(fileName) { - synchronizeHostData(); - return ts_FindAllReferences_exports.Core.getReferencesForFileName(fileName, program, program.getSourceFiles()).map(ts_FindAllReferences_exports.toReferenceEntry); - } - 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, excludeLibFiles); - } - function getEmitOutput(fileName, emitOnlyDtsFiles, forceDtsEmit) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const customTransformers = host.getCustomTransformers && host.getCustomTransformers(); - return getFileEmitOutput(program, sourceFile, !!emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit); - } - function getSignatureHelpItems2(fileName, position, { triggerReason } = emptyOptions) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - return ts_SignatureHelp_exports.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken); - } - function getNonBoundSourceFile(fileName) { - return syntaxTreeCache.getCurrentSourceFile(fileName); - } - function getNameOrDottedNameSpan(fileName, startPos, _endPos) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const node = getTouchingPropertyName(sourceFile, startPos); - if (node === sourceFile) { - return void 0; - } - switch (node.kind) { - case 212 /* PropertyAccessExpression */: - case 167 /* QualifiedName */: - case 11 /* StringLiteral */: - case 97 /* FalseKeyword */: - case 112 /* TrueKeyword */: - case 106 /* NullKeyword */: - case 108 /* SuperKeyword */: - case 110 /* ThisKeyword */: - case 198 /* ThisType */: - case 80 /* Identifier */: - break; - // Cant create the text span - default: - return void 0; - } - let nodeForStartPos = node; - while (true) { - if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { - nodeForStartPos = nodeForStartPos.parent; - } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 268 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { - nodeForStartPos = nodeForStartPos.parent.parent.name; - } else { - break; - } - } else { - break; - } - } - return createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd()); - } - function getBreakpointStatementAtPosition(fileName, position) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts_BreakpointResolver_exports.spanInSourceFileAtLocation(sourceFile, position); - } - function getNavigationBarItems2(fileName) { - return getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); - } - function getNavigationTree2(fileName) { - return getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); - } - function getSemanticClassifications3(fileName, span, format) { - synchronizeHostData(); - const responseFormat = format || "original" /* Original */; - if (responseFormat === "2020" /* TwentyTwenty */) { - return getSemanticClassifications2(program, cancellationToken, getValidSourceFile(fileName), span); - } else { - return getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } - } - function getEncodedSemanticClassifications3(fileName, span, format) { - synchronizeHostData(); - const responseFormat = format || "original" /* Original */; - if (responseFormat === "original" /* Original */) { - return getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } else { - return getEncodedSemanticClassifications2(program, cancellationToken, getValidSourceFile(fileName), span); - } - } - function getSyntacticClassifications2(fileName, span) { - return getSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); - } - function getEncodedSyntacticClassifications2(fileName, span) { - return getEncodedSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); - } - function getOutliningSpans(fileName) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts_OutliningElementsCollector_exports.collectElements(sourceFile, cancellationToken); - } - const braceMatching = new Map(Object.entries({ - [19 /* OpenBraceToken */]: 20 /* CloseBraceToken */, - [21 /* OpenParenToken */]: 22 /* CloseParenToken */, - [23 /* OpenBracketToken */]: 24 /* CloseBracketToken */, - [32 /* GreaterThanToken */]: 30 /* LessThanToken */ - })); - braceMatching.forEach((value, key) => braceMatching.set(value.toString(), Number(key))); - function getBraceMatchingAtPosition(fileName, position) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const token = getTouchingToken(sourceFile, position); - const matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : void 0; - const match = matchKind && findChildOfKind(token.parent, matchKind, sourceFile); - return match ? [createTextSpanFromNode(token, sourceFile), createTextSpanFromNode(match, sourceFile)].sort((a, b) => a.start - b.start) : emptyArray; - } - function getIndentationAtPosition(fileName, position, editorOptions) { - let start = timestamp(); - const settings = toEditorSettings(editorOptions); - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - log("getIndentationAtPosition: getCurrentSourceFile: " + (timestamp() - start)); - start = timestamp(); - const result = ts_formatting_exports.SmartIndenter.getIndentation(position, sourceFile, settings); - log("getIndentationAtPosition: computeIndentation : " + (timestamp() - start)); - return result; - } - function getFormattingEditsForRange(fileName, start, end, options) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts_formatting_exports.formatSelection(start, end, sourceFile, ts_formatting_exports.getFormatContext(toEditorSettings(options), host)); - } - function getFormattingEditsForDocument(fileName, options) { - return ts_formatting_exports.formatDocument(syntaxTreeCache.getCurrentSourceFile(fileName), ts_formatting_exports.getFormatContext(toEditorSettings(options), host)); - } - function getFormattingEditsAfterKeystroke(fileName, position, key, options) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const formatContext = ts_formatting_exports.getFormatContext(toEditorSettings(options), host); - if (!isInComment(sourceFile, position)) { - switch (key) { - case "{": - return ts_formatting_exports.formatOnOpeningCurly(position, sourceFile, formatContext); - case "}": - return ts_formatting_exports.formatOnClosingCurly(position, sourceFile, formatContext); - case ";": - return ts_formatting_exports.formatOnSemicolon(position, sourceFile, formatContext); - case "\n": - return ts_formatting_exports.formatOnEnter(position, sourceFile, formatContext); - } - } - return []; - } - function getCodeFixesAtPosition(fileName, start, end, errorCodes68, formatOptions, preferences = emptyOptions) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const span = createTextSpanFromBounds(start, end); - const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return flatMap(deduplicate(errorCodes68, equateValues, compareValues), (errorCode) => { - cancellationToken.throwIfCancellationRequested(); - return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences }); - }); - } - function getCombinedCodeFix(scope, fixId56, formatOptions, preferences = emptyOptions) { - synchronizeHostData(); - Debug.assert(scope.type === "file"); - const sourceFile = getValidSourceFile(scope.fileName); - const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - return ts_codefix_exports.getAllFixes({ fixId: fixId56, sourceFile, program, host, cancellationToken, formatContext, preferences }); - } - function organizeImports2(args, formatOptions, preferences = emptyOptions) { - synchronizeHostData(); - Debug.assert(args.type === "file"); - const sourceFile = getValidSourceFile(args.fileName); - if (containsParseError(sourceFile)) return emptyArray; - const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); - const mode = args.mode ?? (args.skipDestructiveCodeActions ? "SortAndCombine" /* SortAndCombine */ : "All" /* All */); - return ts_OrganizeImports_exports.organizeImports(sourceFile, formatContext, host, program, preferences, mode); - } - function getEditsForFileRename2(oldFilePath, newFilePath, formatOptions, preferences = emptyOptions) { - return getEditsForFileRename(getProgram(), oldFilePath, newFilePath, host, ts_formatting_exports.getFormatContext(formatOptions, host), preferences, sourceMapper); - } - function applyCodeActionCommand(fileName, actionOrFormatSettingsOrUndefined) { - const action = typeof fileName === "string" ? actionOrFormatSettingsOrUndefined : fileName; - return isArray(action) ? Promise.all(action.map((a) => applySingleCodeActionCommand(a))) : applySingleCodeActionCommand(action); - } - function applySingleCodeActionCommand(action) { - const getPath = (path) => toPath(path, currentDirectory, getCanonicalFileName); - Debug.assertEqual(action.type, "install package"); - return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); - } - function getDocCommentTemplateAtPosition2(fileName, position, options, formatOptions) { - const formatSettings = formatOptions ? ts_formatting_exports.getFormatContext(formatOptions, host).options : void 0; - return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, formatSettings), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); - } - function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { - if (openingBrace === 60 /* lessThan */) { - return false; - } - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - if (isInString(sourceFile, position)) { - return false; - } - if (isInsideJsxElementOrAttribute(sourceFile, position)) { - return openingBrace === 123 /* openBrace */; - } - if (isInTemplateString(sourceFile, position)) { - return false; - } - switch (openingBrace) { - case 39 /* singleQuote */: - case 34 /* doubleQuote */: - case 96 /* backtick */: - return !isInComment(sourceFile, position); - } - return true; - } - function getJsxClosingTagAtPosition(fileName, position) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const token = findPrecedingToken(position, sourceFile); - if (!token) return void 0; - const element = token.kind === 32 /* GreaterThanToken */ && isJsxOpeningElement(token.parent) ? token.parent.parent : isJsxText(token) && isJsxElement(token.parent) ? token.parent : void 0; - if (element && isUnclosedTag(element)) { - return { newText: `` }; - } - const fragment = token.kind === 32 /* GreaterThanToken */ && isJsxOpeningFragment(token.parent) ? token.parent.parent : isJsxText(token) && isJsxFragment(token.parent) ? token.parent : void 0; - if (fragment && isUnclosedFragment(fragment)) { - return { newText: "" }; - } - } - function getLinkedEditingRangeAtPosition(fileName, position) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const token = findPrecedingToken(position, sourceFile); - if (!token || token.parent.kind === 308 /* SourceFile */) return void 0; - const jsxTagWordPattern = "[a-zA-Z0-9:\\-\\._$]*"; - if (isJsxFragment(token.parent.parent)) { - const openFragment = token.parent.parent.openingFragment; - const closeFragment = token.parent.parent.closingFragment; - if (containsParseError(openFragment) || containsParseError(closeFragment)) return void 0; - const openPos = openFragment.getStart(sourceFile) + 1; - const closePos = closeFragment.getStart(sourceFile) + 2; - if (position !== openPos && position !== closePos) return void 0; - return { - ranges: [{ start: openPos, length: 0 }, { start: closePos, length: 0 }], - wordPattern: jsxTagWordPattern - }; - } else { - 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 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: openTagNameStart, length: openTagNameEnd - openTagNameStart }, { start: closeTagNameStart, length: closeTagNameEnd - closeTagNameStart }], - wordPattern: jsxTagWordPattern - }; - } - } - function getLinesForRange(sourceFile, textRange) { - return { - lineStarts: sourceFile.getLineStarts(), - firstLine: sourceFile.getLineAndCharacterOfPosition(textRange.pos).line, - lastLine: sourceFile.getLineAndCharacterOfPosition(textRange.end).line - }; - } - function toggleLineComment(fileName, textRange, insertComment) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const textChanges2 = []; - const { lineStarts, firstLine, lastLine } = getLinesForRange(sourceFile, textRange); - let isCommenting = insertComment || false; - let leftMostPosition = Number.MAX_VALUE; - const lineTextStarts = /* @__PURE__ */ new Map(); - const firstNonWhitespaceCharacterRegex = new RegExp(/\S/); - const isJsx = isInsideJsxElement(sourceFile, lineStarts[firstLine]); - const openComment = isJsx ? "{/*" : "//"; - for (let i = firstLine; i <= lastLine; i++) { - const lineText = sourceFile.text.substring(lineStarts[i], sourceFile.getLineEndOfPosition(lineStarts[i])); - const regExec = firstNonWhitespaceCharacterRegex.exec(lineText); - if (regExec) { - leftMostPosition = Math.min(leftMostPosition, regExec.index); - lineTextStarts.set(i.toString(), regExec.index); - if (lineText.substr(regExec.index, openComment.length) !== openComment) { - isCommenting = insertComment === void 0 || insertComment; - } - } - } - for (let i = firstLine; i <= lastLine; i++) { - if (firstLine !== lastLine && lineStarts[i] === textRange.end) { - continue; - } - const lineTextStart = lineTextStarts.get(i.toString()); - if (lineTextStart !== void 0) { - if (isJsx) { - textChanges2.push(...toggleMultilineComment(fileName, { pos: lineStarts[i] + leftMostPosition, end: sourceFile.getLineEndOfPosition(lineStarts[i]) }, isCommenting, isJsx)); - } else if (isCommenting) { - textChanges2.push({ - newText: openComment, - span: { - length: 0, - start: lineStarts[i] + leftMostPosition - } - }); - } else if (sourceFile.text.substr(lineStarts[i] + lineTextStart, openComment.length) === openComment) { - textChanges2.push({ - newText: "", - span: { - length: openComment.length, - start: lineStarts[i] + lineTextStart - } - }); - } - } - } - return textChanges2; - } - function toggleMultilineComment(fileName, textRange, insertComment, isInsideJsx) { - var _a2; - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const textChanges2 = []; - const { text } = sourceFile; - let hasComment = false; - let isCommenting = insertComment || false; - const positions = []; - let { pos } = textRange; - const isJsx = isInsideJsx !== void 0 ? isInsideJsx : isInsideJsxElement(sourceFile, pos); - const openMultiline = isJsx ? "{/*" : "/*"; - const closeMultiline = isJsx ? "*/}" : "*/"; - const openMultilineRegex = isJsx ? "\\{\\/\\*" : "\\/\\*"; - const closeMultilineRegex = isJsx ? "\\*\\/\\}" : "\\*\\/"; - while (pos <= textRange.end) { - const offset = text.substr(pos, openMultiline.length) === openMultiline ? openMultiline.length : 0; - const commentRange = isInComment(sourceFile, pos + offset); - if (commentRange) { - if (isJsx) { - commentRange.pos--; - commentRange.end++; - } - positions.push(commentRange.pos); - if (commentRange.kind === 3 /* MultiLineCommentTrivia */) { - positions.push(commentRange.end); - } - hasComment = true; - pos = commentRange.end + 1; - } else { - const newPos = text.substring(pos, textRange.end).search(`(${openMultilineRegex})|(${closeMultilineRegex})`); - isCommenting = insertComment !== void 0 ? insertComment : isCommenting || !isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); - pos = newPos === -1 ? textRange.end + 1 : pos + newPos + closeMultiline.length; - } - } - if (isCommenting || !hasComment) { - if (((_a2 = isInComment(sourceFile, textRange.pos)) == null ? void 0 : _a2.kind) !== 2 /* SingleLineCommentTrivia */) { - insertSorted(positions, textRange.pos, compareValues); - } - insertSorted(positions, textRange.end, compareValues); - const firstPos = positions[0]; - if (text.substr(firstPos, openMultiline.length) !== openMultiline) { - textChanges2.push({ - newText: openMultiline, - span: { - length: 0, - start: firstPos - } - }); - } - for (let i = 1; i < positions.length - 1; i++) { - if (text.substr(positions[i] - closeMultiline.length, closeMultiline.length) !== closeMultiline) { - textChanges2.push({ - newText: closeMultiline, - span: { - length: 0, - start: positions[i] - } - }); - } - if (text.substr(positions[i], openMultiline.length) !== openMultiline) { - textChanges2.push({ - newText: openMultiline, - span: { - length: 0, - start: positions[i] - } - }); - } - } - if (textChanges2.length % 2 !== 0) { - textChanges2.push({ - newText: closeMultiline, - span: { - length: 0, - start: positions[positions.length - 1] - } - }); - } - } else { - for (const pos2 of positions) { - const from = pos2 - closeMultiline.length > 0 ? pos2 - closeMultiline.length : 0; - const offset = text.substr(from, closeMultiline.length) === closeMultiline ? closeMultiline.length : 0; - textChanges2.push({ - newText: "", - span: { - length: openMultiline.length, - start: pos2 - offset - } - }); - } - } - return textChanges2; - } - function commentSelection(fileName, textRange) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const { firstLine, lastLine } = getLinesForRange(sourceFile, textRange); - return firstLine === lastLine && textRange.pos !== textRange.end ? toggleMultilineComment( - fileName, - textRange, - /*insertComment*/ - true - ) : toggleLineComment( - fileName, - textRange, - /*insertComment*/ - true - ); - } - function uncommentSelection(fileName, textRange) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const textChanges2 = []; - const { pos } = textRange; - let { end } = textRange; - if (pos === end) { - end += isInsideJsxElement(sourceFile, pos) ? 2 : 1; - } - for (let i = pos; i <= end; i++) { - const commentRange = isInComment(sourceFile, i); - if (commentRange) { - switch (commentRange.kind) { - case 2 /* SingleLineCommentTrivia */: - textChanges2.push(...toggleLineComment( - fileName, - { end: commentRange.end, pos: commentRange.pos + 1 }, - /*insertComment*/ - false - )); - break; - case 3 /* MultiLineCommentTrivia */: - textChanges2.push(...toggleMultilineComment( - fileName, - { end: commentRange.end, pos: commentRange.pos + 1 }, - /*insertComment*/ - false - )); - } - i = commentRange.end + 1; - } - } - return textChanges2; - } - function isUnclosedTag({ openingElement, closingElement, parent: parent2 }) { - return !tagNamesAreEquivalent(openingElement.tagName, closingElement.tagName) || isJsxElement(parent2) && tagNamesAreEquivalent(openingElement.tagName, parent2.openingElement.tagName) && isUnclosedTag(parent2); - } - function isUnclosedFragment({ closingFragment, parent: parent2 }) { - return !!(closingFragment.flags & 262144 /* ThisNodeHasError */) || isJsxFragment(parent2) && isUnclosedFragment(parent2); - } - function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const range = ts_formatting_exports.getRangeOfEnclosingComment(sourceFile, position); - return range && (!onlyMultiLine || range.kind === 3 /* MultiLineCommentTrivia */) ? createTextSpanFromRange(range) : void 0; - } - function getTodoComments(fileName, descriptors) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - cancellationToken.throwIfCancellationRequested(); - const fileContents = sourceFile.text; - const result = []; - if (descriptors.length > 0 && !isNodeModulesFile(sourceFile.fileName)) { - const regExp = getTodoCommentsRegExp(); - let matchArray; - while (matchArray = regExp.exec(fileContents)) { - cancellationToken.throwIfCancellationRequested(); - const firstDescriptorCaptureIndex = 3; - Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); - const preamble = matchArray[1]; - const matchPosition = matchArray.index + preamble.length; - if (!isInComment(sourceFile, matchPosition)) { - continue; - } - let descriptor; - for (let i = 0; i < descriptors.length; i++) { - if (matchArray[i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[i]; - } - } - if (descriptor === void 0) return Debug.fail(); - if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { - continue; - } - const message = matchArray[2]; - result.push({ descriptor, message, position: matchPosition }); - } - } - return result; - function escapeRegExp(str) { - return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); - } - function getTodoCommentsRegExp() { - const singleLineCommentStart = /(?:\/{2,}\s*)/.source; - const multiLineCommentStart = /(?:\/\*+\s*)/.source; - const anyNumberOfSpacesAndAsterisksAtStartOfLine = /(?:^(?:\s|\*)*)/.source; - const preamble = "(" + anyNumberOfSpacesAndAsterisksAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - const literals = "(?:" + map(descriptors, (d) => "(" + escapeRegExp(d.text) + ")").join("|") + ")"; - const endOfLineOrEndOfComment = /(?:$|\*\/)/.source; - const messageRemainder = /(?:.*?)/.source; - const messagePortion = "(" + literals + messageRemainder + ")"; - const regExpString = preamble + messagePortion + endOfLineOrEndOfComment; - return new RegExp(regExpString, "gim"); - } - function isLetterOrDigit(char) { - return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */; - } - function isNodeModulesFile(path) { - return path.includes("/node_modules/"); - } - } - function getRenameInfo2(fileName, position, preferences) { - synchronizeHostData(); - return ts_Rename_exports.getRenameInfo(program, getValidSourceFile(fileName), position, preferences || {}); - } - function getRefactorContext(file, positionOrRange, preferences, formatOptions, triggerReason, kind) { - const [startPosition, endPosition] = typeof positionOrRange === "number" ? [positionOrRange, void 0] : [positionOrRange.pos, positionOrRange.end]; - return { - file, - startPosition, - endPosition, - program: getProgram(), - host, - formatContext: ts_formatting_exports.getFormatContext(formatOptions, host), - // TODO: GH#18217 - cancellationToken, - preferences, - triggerReason, - kind - }; - } - function getInlayHintsContext(file, span, preferences) { - return { - file, - program: getProgram(), - host, - span, - preferences, - cancellationToken - }; - } - function getSmartSelectionRange2(fileName, position) { - return ts_SmartSelectionRange_exports.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName)); - } - function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind, includeInteractiveActions) { - synchronizeHostData(); - const file = getValidSourceFile(fileName); - return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind), includeInteractiveActions); - } - function getMoveToRefactoringFileSuggestions(fileName, positionOrRange, preferences = emptyOptions) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const allFiles = Debug.checkDefined(program.getSourceFiles()); - const extension = extensionFromPath(fileName); - const toMove = getStatementsToMove(getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions)); - const toMoveContainsJsx = containsJsx(toMove == null ? void 0 : toMove.all); - const files = mapDefined(allFiles, (file) => { - const fileNameExtension = extensionFromPath(file.fileName); - const isValidSourceFile = !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" /* Ts */ && fileNameExtension === ".d.ts" /* Dts */ || extension === ".d.ts" /* Dts */ && startsWith(getBaseFileName(file.fileName), "lib.") && fileNameExtension === ".d.ts" /* Dts */); - return isValidSourceFile && (extension === fileNameExtension || (extension === ".tsx" /* Tsx */ && fileNameExtension === ".ts" /* Ts */ || extension === ".jsx" /* Jsx */ && fileNameExtension === ".js" /* Js */) && !toMoveContainsJsx) ? file.fileName : void 0; - }); - return { newFileName: createNewFileName(sourceFile, program, host, toMove), files }; - } - function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName14, actionName2, preferences = emptyOptions, interactiveRefactorArguments) { - synchronizeHostData(); - const file = getValidSourceFile(fileName); - return ts_refactor_exports.getEditsForRefactor(getRefactorContext(file, positionOrRange, preferences, formatOptions), refactorName14, actionName2, interactiveRefactorArguments); - } - function toLineColumnOffset(fileName, position) { - if (position === 0) { - return { line: 0, character: 0 }; - } - return sourceMapper.toLineColumnOffset(fileName, position); - } - function prepareCallHierarchy(fileName, position) { - synchronizeHostData(); - const declarations = ts_CallHierarchy_exports.resolveCallHierarchyDeclaration(program, getTouchingPropertyName(getValidSourceFile(fileName), position)); - return declarations && mapOneOrMany(declarations, (declaration) => ts_CallHierarchy_exports.createCallHierarchyItem(program, declaration)); - } - function provideCallHierarchyIncomingCalls(fileName, position) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const declaration = firstOrOnly(ts_CallHierarchy_exports.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : getTouchingPropertyName(sourceFile, position))); - return declaration ? ts_CallHierarchy_exports.getIncomingCalls(program, declaration, cancellationToken) : []; - } - function provideCallHierarchyOutgoingCalls(fileName, position) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - const declaration = firstOrOnly(ts_CallHierarchy_exports.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : getTouchingPropertyName(sourceFile, position))); - return declaration ? ts_CallHierarchy_exports.getOutgoingCalls(program, declaration) : []; - } - function provideInlayHints2(fileName, span, preferences = emptyOptions) { - synchronizeHostData(); - const sourceFile = getValidSourceFile(fileName); - return ts_InlayHints_exports.provideInlayHints(getInlayHintsContext(sourceFile, span, preferences)); - } - function mapCode2(sourceFile, contents, focusLocations, formatOptions, preferences) { - return ts_MapCode_exports.mapCode( - syntaxTreeCache.getCurrentSourceFile(sourceFile), - contents, - focusLocations, - host, - ts_formatting_exports.getFormatContext(formatOptions, host), - preferences - ); - } - const ls = { - dispose, - cleanupSemanticCache, - getSyntacticDiagnostics, - getSemanticDiagnostics, - getRegionSemanticDiagnostics, - getSuggestionDiagnostics, - getCompilerOptionsDiagnostics, - getSyntacticClassifications: getSyntacticClassifications2, - getSemanticClassifications: getSemanticClassifications3, - getEncodedSyntacticClassifications: getEncodedSyntacticClassifications2, - getEncodedSemanticClassifications: getEncodedSemanticClassifications3, - getCompletionsAtPosition: getCompletionsAtPosition2, - getCompletionEntryDetails: getCompletionEntryDetails2, - getCompletionEntrySymbol: getCompletionEntrySymbol2, - getSignatureHelpItems: getSignatureHelpItems2, - getQuickInfoAtPosition, - getDefinitionAtPosition: getDefinitionAtPosition2, - getDefinitionAndBoundSpan: getDefinitionAndBoundSpan2, - getImplementationAtPosition, - getTypeDefinitionAtPosition: getTypeDefinitionAtPosition2, - getReferencesAtPosition, - findReferences, - getFileReferences, - getDocumentHighlights, - getNameOrDottedNameSpan, - getBreakpointStatementAtPosition, - getNavigateToItems: getNavigateToItems2, - getRenameInfo: getRenameInfo2, - getSmartSelectionRange: getSmartSelectionRange2, - findRenameLocations, - getNavigationBarItems: getNavigationBarItems2, - getNavigationTree: getNavigationTree2, - getOutliningSpans, - getTodoComments, - getBraceMatchingAtPosition, - getIndentationAtPosition, - getFormattingEditsForRange, - getFormattingEditsForDocument, - getFormattingEditsAfterKeystroke, - getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition2, - isValidBraceCompletionAtPosition, - getJsxClosingTagAtPosition, - getLinkedEditingRangeAtPosition, - getSpanOfEnclosingComment, - getCodeFixesAtPosition, - getCombinedCodeFix, - applyCodeActionCommand, - organizeImports: organizeImports2, - getEditsForFileRename: getEditsForFileRename2, - getEmitOutput, - getNonBoundSourceFile, - getProgram, - getCurrentProgram: () => program, - getAutoImportProvider, - updateIsDefinitionOfReferencedSymbols, - getApplicableRefactors: getApplicableRefactors2, - getEditsForRefactor: getEditsForRefactor2, - getMoveToRefactoringFileSuggestions, - toLineColumnOffset, - getSourceMapper: () => sourceMapper, - clearSourceMapperCache: () => sourceMapper.clearCache(), - prepareCallHierarchy, - provideCallHierarchyIncomingCalls, - provideCallHierarchyOutgoingCalls, - toggleLineComment, - toggleMultilineComment, - commentSelection, - uncommentSelection, - provideInlayHints: provideInlayHints2, - getSupportedCodeFixes, - preparePasteEditsForFile, - getPasteEdits, - mapCode: mapCode2 - }; - switch (languageServiceMode) { - case 0 /* Semantic */: - break; - case 1 /* PartialSemantic */: - invalidOperationsInPartialSemanticMode.forEach( - (key) => ls[key] = () => { - throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.PartialSemantic`); - } - ); - break; - case 2 /* Syntactic */: - invalidOperationsInSyntacticMode.forEach( - (key) => ls[key] = () => { - throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.Syntactic`); - } - ); - break; - default: - Debug.assertNever(languageServiceMode); - } - return ls; -} -function getNameTable(sourceFile) { - if (!sourceFile.nameTable) { - initializeNameTable(sourceFile); - } - return sourceFile.nameTable; -} -function initializeNameTable(sourceFile) { - const nameTable = sourceFile.nameTable = /* @__PURE__ */ new Map(); - sourceFile.forEachChild(function walk(node) { - if (isIdentifier(node) && !isTagName(node) && node.escapedText || isStringOrNumericLiteralLike(node) && literalIsName(node)) { - const text = getEscapedTextOfIdentifierOrLiteral(node); - nameTable.set(text, nameTable.get(text) === void 0 ? node.pos : -1); - } else if (isPrivateIdentifier(node)) { - const text = node.escapedText; - nameTable.set(text, nameTable.get(text) === void 0 ? node.pos : -1); - } - forEachChild(node, walk); - if (hasJSDocNodes(node)) { - for (const jsDoc of node.jsDoc) { - forEachChild(jsDoc, walk); - } - } - }); -} -function literalIsName(node) { - return isDeclarationName(node) || node.parent.kind === 284 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); -} -function getContainingObjectLiteralElement(node) { - const element = getContainingObjectLiteralElementWorker(node); - return element && (isObjectLiteralExpression(element.parent) || isJsxAttributes(element.parent)) ? element : void 0; -} -function getContainingObjectLiteralElementWorker(node) { - switch (node.kind) { - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 9 /* NumericLiteral */: - if (node.parent.kind === 168 /* ComputedPropertyName */) { - return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0; - } - // falls through - case 80 /* Identifier */: - case 296 /* JsxNamespacedName */: - return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 211 /* ObjectLiteralExpression */ || node.parent.parent.kind === 293 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0; - } - return void 0; -} -function getSymbolAtLocationForQuickInfo(node, checker) { - const object = getContainingObjectLiteralElement(node); - if (object) { - const contextualType = checker.getContextualType(object.parent); - const properties = contextualType && getPropertySymbolsFromContextualType( - object, - checker, - contextualType, - /*unionSymbolOk*/ - false - ); - if (properties && properties.length === 1) { - return first(properties); - } - } - return checker.getSymbolAtLocation(node); -} -function getPropertySymbolsFromContextualType(node, checker, contextualType, unionSymbolOk) { - const name = getNameFromPropertyName(node.name); - if (!name) return emptyArray; - if (!contextualType.isUnion()) { - const symbol = contextualType.getProperty(name); - return symbol ? [symbol] : emptyArray; - } - 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 (!filteredTypes.length && !discriminatedPropertySymbols.length) { - return mapDefined(contextualType.types, (t) => t.getProperty(name)); - } - return deduplicate(discriminatedPropertySymbols, equateValues); -} -function isArgumentOfElementAccessExpression(node) { - return node && node.parent && node.parent.kind === 213 /* ElementAccessExpression */ && node.parent.argumentExpression === node; -} -function getDefaultLibFilePath(options) { - if (sys) { - return combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)); - } - throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); -} -setObjectAllocator(getServicesObjectAllocator()); - -// src/services/transform.ts -function transform(source, transformers, compilerOptions) { - const diagnostics = []; - compilerOptions = fixupCompilerOptions(compilerOptions, diagnostics); - const nodes = isArray(source) ? source : [source]; - const result = transformNodes( - /*resolver*/ - void 0, - /*host*/ - void 0, - factory, - compilerOptions, - nodes, - transformers, - /*allowDtsFiles*/ - true - ); - result.diagnostics = concatenate(result.diagnostics, diagnostics); - return result; -} - -// src/services/_namespaces/ts.BreakpointResolver.ts -var ts_BreakpointResolver_exports = {}; -__export(ts_BreakpointResolver_exports, { - spanInSourceFileAtLocation: () => spanInSourceFileAtLocation -}); - -// src/services/breakpoints.ts -function spanInSourceFileAtLocation(sourceFile, position) { - if (sourceFile.isDeclarationFile) { - return void 0; - } - let tokenAtLocation = getTokenAtPosition(sourceFile, position); - const lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) { - const preceding = findPrecedingToken(tokenAtLocation.pos, sourceFile); - if (!preceding || sourceFile.getLineAndCharacterOfPosition(preceding.getEnd()).line !== lineOfPosition) { - return void 0; - } - tokenAtLocation = preceding; - } - if (tokenAtLocation.flags & 33554432 /* Ambient */) { - return void 0; - } - return spanInNode(tokenAtLocation); - function textSpan(startNode2, endNode2) { - const lastDecorator = canHaveDecorators(startNode2) ? findLast(startNode2.modifiers, isDecorator) : void 0; - const start = lastDecorator ? skipTrivia(sourceFile.text, lastDecorator.end) : startNode2.getStart(sourceFile); - return createTextSpanFromBounds(start, (endNode2 || startNode2).getEnd()); - } - function textSpanEndingAtNextToken(startNode2, previousTokenToFindNextEndToken) { - return textSpan(startNode2, findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent, sourceFile)); - } - function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { - if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { - return spanInNode(node); - } - return spanInNode(otherwiseOnNode); - } - function spanInNodeArray(nodeArray, node, match) { - if (nodeArray) { - const index = nodeArray.indexOf(node); - if (index >= 0) { - let start = index; - let end = index + 1; - while (start > 0 && match(nodeArray[start - 1])) start--; - while (end < nodeArray.length && match(nodeArray[end])) end++; - return createTextSpanFromBounds(skipTrivia(sourceFile.text, nodeArray[start].pos), nodeArray[end - 1].end); - } - } - return textSpan(node); - } - function spanInPreviousNode(node) { - return spanInNode(findPrecedingToken(node.pos, sourceFile)); - } - function spanInNextNode(node) { - return spanInNode(findNextToken(node, node.parent, sourceFile)); - } - function spanInNode(node) { - if (node) { - const { parent: parent2 } = node; - switch (node.kind) { - case 244 /* VariableStatement */: - return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 261 /* VariableDeclaration */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - return spanInVariableDeclaration(node); - case 170 /* Parameter */: - return spanInParameterDeclaration(node); - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 177 /* Constructor */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return spanInFunctionDeclaration(node); - case 242 /* Block */: - if (isFunctionBlock(node)) { - return spanInFunctionBlock(node); - } - // falls through - case 269 /* ModuleBlock */: - return spanInBlock(node); - case 300 /* CatchClause */: - return spanInBlock(node.block); - case 245 /* ExpressionStatement */: - return textSpan(node.expression); - case 254 /* ReturnStatement */: - return textSpan(node.getChildAt(0), node.expression); - case 248 /* WhileStatement */: - return textSpanEndingAtNextToken(node, node.expression); - case 247 /* DoStatement */: - return spanInNode(node.statement); - case 260 /* DebuggerStatement */: - return textSpan(node.getChildAt(0)); - case 246 /* IfStatement */: - return textSpanEndingAtNextToken(node, node.expression); - case 257 /* LabeledStatement */: - return spanInNode(node.statement); - case 253 /* BreakStatement */: - case 252 /* ContinueStatement */: - return textSpan(node.getChildAt(0), node.label); - case 249 /* ForStatement */: - return spanInForStatement(node); - case 250 /* ForInStatement */: - return textSpanEndingAtNextToken(node, node.expression); - case 251 /* ForOfStatement */: - return spanInInitializerOfForLike(node); - case 256 /* SwitchStatement */: - return textSpanEndingAtNextToken(node, node.expression); - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - return spanInNode(node.statements[0]); - case 259 /* TryStatement */: - return spanInBlock(node.tryBlock); - case 258 /* ThrowStatement */: - return textSpan(node, node.expression); - case 278 /* ExportAssignment */: - return textSpan(node, node.expression); - case 272 /* ImportEqualsDeclaration */: - return textSpan(node, node.moduleReference); - case 273 /* ImportDeclaration */: - return textSpan(node, node.moduleSpecifier); - case 279 /* ExportDeclaration */: - return textSpan(node, node.moduleSpecifier); - case 268 /* ModuleDeclaration */: - if (getModuleInstanceState(node) !== 1 /* Instantiated */) { - return void 0; - } - // falls through - case 264 /* ClassDeclaration */: - case 267 /* EnumDeclaration */: - case 307 /* EnumMember */: - case 209 /* BindingElement */: - return textSpan(node); - case 255 /* WithStatement */: - return spanInNode(node.statement); - case 171 /* Decorator */: - return spanInNodeArray(parent2.modifiers, node, isDecorator); - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - return spanInBindingPattern(node); - // No breakpoint in interface, type alias - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - return void 0; - // Tokens: - case 27 /* SemicolonToken */: - case 1 /* EndOfFileToken */: - return spanInNodeIfStartsOnSameLine(findPrecedingToken(node.pos, sourceFile)); - case 28 /* CommaToken */: - return spanInPreviousNode(node); - case 19 /* OpenBraceToken */: - return spanInOpenBraceToken(node); - case 20 /* CloseBraceToken */: - return spanInCloseBraceToken(node); - case 24 /* CloseBracketToken */: - return spanInCloseBracketToken(node); - case 21 /* OpenParenToken */: - return spanInOpenParenToken(node); - case 22 /* CloseParenToken */: - return spanInCloseParenToken(node); - case 59 /* ColonToken */: - return spanInColonToken(node); - case 32 /* GreaterThanToken */: - case 30 /* LessThanToken */: - return spanInGreaterThanOrLessThanToken(node); - // Keywords: - case 117 /* WhileKeyword */: - return spanInWhileKeyword(node); - case 93 /* ElseKeyword */: - case 85 /* CatchKeyword */: - case 98 /* FinallyKeyword */: - return spanInNextNode(node); - case 165 /* OfKeyword */: - return spanInOfKeyword(node); - default: - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { - return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); - } - if ((node.kind === 80 /* Identifier */ || node.kind === 231 /* SpreadElement */ || node.kind === 304 /* PropertyAssignment */ || node.kind === 305 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { - return textSpan(node); - } - if (node.kind === 227 /* BinaryExpression */) { - const { left, operatorToken } = node; - if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { - return spanInArrayLiteralOrObjectLiteralDestructuringPattern( - left - ); - } - if (operatorToken.kind === 64 /* EqualsToken */ && isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { - return textSpan(node); - } - if (operatorToken.kind === 28 /* CommaToken */) { - return spanInNode(left); - } - } - if (isExpressionNode(node)) { - switch (parent2.kind) { - case 247 /* DoStatement */: - return spanInPreviousNode(node); - case 171 /* Decorator */: - return spanInNode(node.parent); - case 249 /* ForStatement */: - case 251 /* ForOfStatement */: - return textSpan(node); - case 227 /* BinaryExpression */: - if (node.parent.operatorToken.kind === 28 /* CommaToken */) { - return textSpan(node); - } - break; - case 220 /* ArrowFunction */: - if (node.parent.body === node) { - return textSpan(node); - } - break; - } - } - switch (node.parent.kind) { - case 304 /* PropertyAssignment */: - if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { - return spanInNode(node.parent.initializer); - } - break; - case 217 /* TypeAssertionExpression */: - if (node.parent.type === node) { - return spanInNextNode(node.parent.type); - } - break; - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: { - const { initializer, type } = node.parent; - if (initializer === node || type === node || isAssignmentOperator(node.kind)) { - return spanInPreviousNode(node); - } - break; - } - case 227 /* BinaryExpression */: { - const { left } = node.parent; - if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { - return spanInPreviousNode(node); - } - break; - } - default: - if (isFunctionLike(node.parent) && node.parent.type === node) { - return spanInPreviousNode(node); - } - } - return spanInNode(node.parent); - } - } - function textSpanFromVariableDeclaration(variableDeclaration) { - if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] === variableDeclaration) { - return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); - } else { - return textSpan(variableDeclaration); - } - } - function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 250 /* 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, 32 /* Export */) || parent2.parent.kind === 251 /* ForOfStatement */) { - return textSpanFromVariableDeclaration(variableDeclaration); - } - if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { - return spanInNode(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); - } - } - function canHaveSpanInParameterDeclaration(parameter) { - return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter, 1 /* Public */ | 2 /* Private */); - } - function spanInParameterDeclaration(parameter) { - if (isBindingPattern(parameter.name)) { - return spanInBindingPattern(parameter.name); - } else if (canHaveSpanInParameterDeclaration(parameter)) { - return textSpan(parameter); - } else { - const functionDeclaration = parameter.parent; - const indexOfParameter = functionDeclaration.parameters.indexOf(parameter); - Debug.assert(indexOfParameter !== -1); - if (indexOfParameter !== 0) { - return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); - } else { - return spanInNode(functionDeclaration.body); - } - } - } - function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 264 /* ClassDeclaration */ && functionDeclaration.kind !== 177 /* Constructor */; - } - function spanInFunctionDeclaration(functionDeclaration) { - if (!functionDeclaration.body) { - return void 0; - } - if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { - return textSpan(functionDeclaration); - } - return spanInNode(functionDeclaration.body); - } - function spanInFunctionBlock(block) { - const nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); - if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { - return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); - } - return spanInNode(nodeForSpanInBlock); - } - function spanInBlock(block) { - switch (block.parent.kind) { - case 268 /* ModuleDeclaration */: - if (getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { - return void 0; - } - // Set on parent if on same line otherwise on first statement - // falls through - case 248 /* WhileStatement */: - case 246 /* IfStatement */: - case 250 /* ForInStatement */: - return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 249 /* ForStatement */: - case 251 /* ForOfStatement */: - return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); - } - return spanInNode(block.statements[0]); - } - function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 262 /* VariableDeclarationList */) { - const variableDeclarationList = forLikeStatement.initializer; - if (variableDeclarationList.declarations.length > 0) { - return spanInNode(variableDeclarationList.declarations[0]); - } - } else { - return spanInNode(forLikeStatement.initializer); - } - } - function spanInForStatement(forStatement) { - if (forStatement.initializer) { - return spanInInitializerOfForLike(forStatement); - } - if (forStatement.condition) { - return textSpan(forStatement.condition); - } - if (forStatement.incrementor) { - return textSpan(forStatement.incrementor); - } - } - function spanInBindingPattern(bindingPattern) { - const firstBindingElement = forEach(bindingPattern.elements, (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0); - if (firstBindingElement) { - return spanInNode(firstBindingElement); - } - if (bindingPattern.parent.kind === 209 /* BindingElement */) { - return textSpan(bindingPattern.parent); - } - return textSpanFromVariableDeclaration(bindingPattern.parent); - } - function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) { - Debug.assert(node2.kind !== 208 /* ArrayBindingPattern */ && node2.kind !== 207 /* ObjectBindingPattern */); - const elements = node2.kind === 210 /* ArrayLiteralExpression */ ? node2.elements : node2.properties; - const firstBindingElement = forEach(elements, (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0); - if (firstBindingElement) { - return spanInNode(firstBindingElement); - } - return textSpan(node2.parent.kind === 227 /* BinaryExpression */ ? node2.parent : node2); - } - function spanInOpenBraceToken(node2) { - switch (node2.parent.kind) { - case 267 /* EnumDeclaration */: - const enumDeclaration = node2.parent; - return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 264 /* ClassDeclaration */: - const classDeclaration = node2.parent; - return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 270 /* CaseBlock */: - return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]); - } - return spanInNode(node2.parent); - } - function spanInCloseBraceToken(node2) { - switch (node2.parent.kind) { - case 269 /* ModuleBlock */: - if (getModuleInstanceState(node2.parent.parent) !== 1 /* Instantiated */) { - return void 0; - } - // falls through - case 267 /* EnumDeclaration */: - case 264 /* ClassDeclaration */: - return textSpan(node2); - case 242 /* Block */: - if (isFunctionBlock(node2.parent)) { - return textSpan(node2); - } - // falls through - case 300 /* CatchClause */: - return spanInNode(lastOrUndefined(node2.parent.statements)); - case 270 /* CaseBlock */: - const caseBlock = node2.parent; - const lastClause = lastOrUndefined(caseBlock.clauses); - if (lastClause) { - return spanInNode(lastOrUndefined(lastClause.statements)); - } - return void 0; - case 207 /* ObjectBindingPattern */: - const bindingPattern = node2.parent; - return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern); - // Default to parent node - default: - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node2.parent)) { - const objectLiteral = node2.parent; - return textSpan(lastOrUndefined(objectLiteral.properties) || objectLiteral); - } - return spanInNode(node2.parent); - } - } - function spanInCloseBracketToken(node2) { - switch (node2.parent.kind) { - case 208 /* ArrayBindingPattern */: - const bindingPattern = node2.parent; - return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern); - default: - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node2.parent)) { - const arrayLiteral = node2.parent; - return textSpan(lastOrUndefined(arrayLiteral.elements) || arrayLiteral); - } - return spanInNode(node2.parent); - } - } - function spanInOpenParenToken(node2) { - if (node2.parent.kind === 247 /* DoStatement */ || // Go to while keyword and do action instead - node2.parent.kind === 214 /* CallExpression */ || node2.parent.kind === 215 /* NewExpression */) { - return spanInPreviousNode(node2); - } - if (node2.parent.kind === 218 /* ParenthesizedExpression */) { - return spanInNextNode(node2); - } - return spanInNode(node2.parent); - } - function spanInCloseParenToken(node2) { - switch (node2.parent.kind) { - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 177 /* Constructor */: - case 248 /* WhileStatement */: - case 247 /* DoStatement */: - case 249 /* ForStatement */: - case 251 /* ForOfStatement */: - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 218 /* ParenthesizedExpression */: - return spanInPreviousNode(node2); - // Default to parent node - default: - return spanInNode(node2.parent); - } - } - function spanInColonToken(node2) { - if (isFunctionLike(node2.parent) || node2.parent.kind === 304 /* PropertyAssignment */ || node2.parent.kind === 170 /* Parameter */) { - return spanInPreviousNode(node2); - } - return spanInNode(node2.parent); - } - function spanInGreaterThanOrLessThanToken(node2) { - if (node2.parent.kind === 217 /* TypeAssertionExpression */) { - return spanInNextNode(node2); - } - return spanInNode(node2.parent); - } - function spanInWhileKeyword(node2) { - if (node2.parent.kind === 247 /* DoStatement */) { - return textSpanEndingAtNextToken(node2, node2.parent.expression); - } - return spanInNode(node2.parent); - } - function spanInOfKeyword(node2) { - if (node2.parent.kind === 251 /* ForOfStatement */) { - return spanInNextNode(node2); - } - return spanInNode(node2.parent); - } - } -} - -// src/services/_namespaces/ts.CallHierarchy.ts -var ts_CallHierarchy_exports = {}; -__export(ts_CallHierarchy_exports, { - createCallHierarchyItem: () => createCallHierarchyItem, - getIncomingCalls: () => getIncomingCalls, - getOutgoingCalls: () => getOutgoingCalls, - resolveCallHierarchyDeclaration: () => resolveCallHierarchyDeclaration -}); - -// src/services/callHierarchy.ts -function isNamedExpression(node) { - return (isFunctionExpression(node) || isClassExpression(node)) && isNamedDeclaration(node); -} -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) || isAssignedExpression(node); -} -function getCallHierarchyDeclarationReferenceNode(node) { - if (isSourceFile(node)) return node; - if (isNamedDeclaration(node)) return node.name; - if (isAssignedExpression(node)) return node.parent.name; - return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier3)); -} -function isDefaultModifier3(node) { - return node.kind === 90 /* DefaultKeyword */; -} -function getSymbolOfCallHierarchyDeclaration(typeChecker, node) { - const location = getCallHierarchyDeclarationReferenceNode(node); - return location && typeChecker.getSymbolAtLocation(location); -} -function getCallHierarchyItemName(program, node) { - if (isSourceFile(node)) { - return { text: node.fileName, pos: 0, end: 0 }; - } - if ((isFunctionDeclaration(node) || isClassDeclaration(node)) && !isNamedDeclaration(node)) { - const defaultModifier = node.modifiers && find(node.modifiers, isDefaultModifier3); - if (defaultModifier) { - return { text: "default", pos: defaultModifier.getStart(), end: defaultModifier.getEnd() }; - } - } - if (isClassStaticBlockDeclaration(node)) { - const sourceFile = node.getSourceFile(); - const pos = skipTrivia(sourceFile.text, moveRangePastModifiers(node).pos); - const end = pos + 6; - const typeChecker = program.getTypeChecker(); - const symbol = typeChecker.getSymbolAtLocation(node.parent); - const prefix = symbol ? `${typeChecker.symbolToString(symbol, node.parent)} ` : ""; - return { text: `${prefix}static {}`, pos, end }; - } - 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(); - const symbol = typeChecker.getSymbolAtLocation(declName); - if (symbol) { - text = typeChecker.symbolToString(symbol, node); - } - } - if (text === void 0) { - const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); - text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer)); - } - return { text, pos: declName.getStart(), end: declName.getEnd() }; -} -function getCallHierarchItemContainerName(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 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - if (node.parent.kind === 211 /* ObjectLiteralExpression */) { - return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText(); - } - return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText(); - case 263 /* FunctionDeclaration */: - case 264 /* ClassDeclaration */: - case 268 /* ModuleDeclaration */: - if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) { - return node.parent.parent.name.getText(); - } - } -} -function findImplementation(typeChecker, node) { - if (node.body) { - return node; - } - if (isConstructorDeclaration(node)) { - return getFirstConstructorWithBody(node.parent); - } - if (isFunctionDeclaration(node) || isMethodDeclaration(node)) { - const symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node); - if (symbol && symbol.valueDeclaration && isFunctionLikeDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.body) { - return symbol.valueDeclaration; - } - return void 0; - } - return node; -} -function findAllInitialDeclarations(typeChecker, node) { - const symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node); - let declarations; - if (symbol && symbol.declarations) { - const indices = indicesOf(symbol.declarations); - const keys = map(symbol.declarations, (decl) => ({ file: decl.getSourceFile().fileName, pos: decl.pos })); - indices.sort((a, b) => compareStringsCaseSensitive(keys[a].file, keys[b].file) || keys[a].pos - keys[b].pos); - const sortedDeclarations = map(indices, (i) => symbol.declarations[i]); - let lastDecl; - for (const decl of sortedDeclarations) { - if (isValidCallHierarchyDeclaration(decl)) { - if (!lastDecl || lastDecl.parent !== decl.parent || lastDecl.end !== decl.pos) { - declarations = append(declarations, decl); - } - lastDecl = decl; - } - } - } - return declarations; -} -function findImplementationOrAllInitialDeclarations(typeChecker, node) { - if (isClassStaticBlockDeclaration(node)) { - return node; - } - if (isFunctionLikeDeclaration(node)) { - return findImplementation(typeChecker, node) ?? findAllInitialDeclarations(typeChecker, node) ?? node; - } - return findAllInitialDeclarations(typeChecker, node) ?? node; -} -function resolveCallHierarchyDeclaration(program, location) { - const typeChecker = program.getTypeChecker(); - let followingSymbol = false; - while (true) { - if (isValidCallHierarchyDeclaration(location)) { - return findImplementationOrAllInitialDeclarations(typeChecker, location); - } - if (isPossibleCallHierarchyDeclaration(location)) { - const ancestor = findAncestor(location, isValidCallHierarchyDeclaration); - return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor); - } - if (isDeclarationName(location)) { - if (isValidCallHierarchyDeclaration(location.parent)) { - return findImplementationOrAllInitialDeclarations(typeChecker, location.parent); - } - if (isPossibleCallHierarchyDeclaration(location.parent)) { - const ancestor = findAncestor(location.parent, isValidCallHierarchyDeclaration); - return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor); - } - if (isVariableLike2(location.parent) && location.parent.initializer && isAssignedExpression(location.parent.initializer)) { - return location.parent.initializer; - } - return void 0; - } - if (isConstructorDeclaration(location)) { - if (isValidCallHierarchyDeclaration(location.parent)) { - return location.parent; - } - return void 0; - } - if (location.kind === 126 /* StaticKeyword */ && isClassStaticBlockDeclaration(location.parent)) { - location = location.parent; - continue; - } - if (isVariableDeclaration(location) && location.initializer && isAssignedExpression(location.initializer)) { - return location.initializer; - } - if (!followingSymbol) { - let symbol = typeChecker.getSymbolAtLocation(location); - if (symbol) { - if (symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - if (symbol.valueDeclaration) { - followingSymbol = true; - location = symbol.valueDeclaration; - continue; - } - } - } - return void 0; - } -} -function createCallHierarchyItem(program, node) { - const sourceFile = node.getSourceFile(); - const name = getCallHierarchyItemName(program, node); - const containerName = getCallHierarchItemContainerName(node); - const kind = getNodeKind(node); - const kindModifiers = getNodeModifiers(node); - const span = createTextSpanFromBounds(skipTrivia( - sourceFile.text, - node.getFullStart(), - /*stopAfterLineBreak*/ - false, - /*stopAtComments*/ - true - ), node.getEnd()); - const selectionSpan = createTextSpanFromBounds(name.pos, name.end); - return { file: sourceFile.fileName, kind, kindModifiers, name: name.text, containerName, span, selectionSpan }; -} -function isDefined(x) { - return x !== void 0; -} -function convertEntryToCallSite(entry) { - if (entry.kind === ts_FindAllReferences_exports.EntryKind.Node) { - const { node } = entry; - if (isCallOrNewExpressionTarget( - node, - /*includeElementAccess*/ - true, - /*skipPastOuterExpressions*/ - true - ) || isTaggedTemplateTag( - node, - /*includeElementAccess*/ - true, - /*skipPastOuterExpressions*/ - true - ) || isDecoratorTarget( - node, - /*includeElementAccess*/ - true, - /*skipPastOuterExpressions*/ - true - ) || isJsxOpeningLikeElementTagName( - node, - /*includeElementAccess*/ - true, - /*skipPastOuterExpressions*/ - true - ) || isRightSideOfPropertyAccess(node) || isArgumentExpressionOfElementAccess(node)) { - const sourceFile = node.getSourceFile(); - const ancestor = findAncestor(node, isValidCallHierarchyDeclaration) || sourceFile; - return { declaration: ancestor, range: createTextRangeFromNode(node, sourceFile) }; - } - } -} -function getCallSiteGroupKey(entry) { - return getNodeId(entry.declaration); -} -function createCallHierarchyIncomingCall(from, fromSpans) { - return { from, fromSpans }; -} -function convertCallSiteGroupToIncomingCall(program, entries) { - return createCallHierarchyIncomingCall(createCallHierarchyItem(program, entries[0].declaration), map(entries, (entry) => createTextSpanFromRange(entry.range))); -} -function getIncomingCalls(program, declaration, cancellationToken) { - if (isSourceFile(declaration) || isModuleDeclaration(declaration) || isClassStaticBlockDeclaration(declaration)) { - return []; - } - const location = getCallHierarchyDeclarationReferenceNode(declaration); - const calls = filter(ts_FindAllReferences_exports.findReferenceOrRenameEntries( - program, - cancellationToken, - program.getSourceFiles(), - location, - /*position*/ - 0, - { use: ts_FindAllReferences_exports.FindReferencesUse.References }, - convertEntryToCallSite - ), isDefined); - return calls ? group(calls, getCallSiteGroupKey, (entries) => convertCallSiteGroupToIncomingCall(program, entries)) : []; -} -function createCallSiteCollector(program, callSites) { - function recordCallSite(node) { - const target = isTaggedTemplateExpression(node) ? node.tag : isJsxOpeningLikeElement(node) ? node.tagName : isAccessExpression(node) ? node : isClassStaticBlockDeclaration(node) ? node : node.expression; - const declaration = resolveCallHierarchyDeclaration(program, target); - if (declaration) { - const range = createTextRangeFromNode(target, node.getSourceFile()); - if (isArray(declaration)) { - for (const decl of declaration) { - callSites.push({ declaration: decl, range }); - } - } else { - callSites.push({ declaration, range }); - } - } - } - function collect(node) { - if (!node) return; - if (node.flags & 33554432 /* Ambient */) { - return; - } - if (isValidCallHierarchyDeclaration(node)) { - if (isClassLike(node)) { - for (const member of node.members) { - if (member.name && isComputedPropertyName(member.name)) { - collect(member.name.expression); - } - } - } - return; - } - switch (node.kind) { - case 80 /* Identifier */: - case 272 /* ImportEqualsDeclaration */: - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - return; - case 176 /* ClassStaticBlockDeclaration */: - recordCallSite(node); - return; - case 217 /* TypeAssertionExpression */: - case 235 /* AsExpression */: - collect(node.expression); - return; - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - collect(node.name); - collect(node.initializer); - return; - case 214 /* CallExpression */: - recordCallSite(node); - collect(node.expression); - forEach(node.arguments, collect); - return; - case 215 /* NewExpression */: - recordCallSite(node); - collect(node.expression); - forEach(node.arguments, collect); - return; - case 216 /* TaggedTemplateExpression */: - recordCallSite(node); - collect(node.tag); - collect(node.template); - return; - case 287 /* JsxOpeningElement */: - case 286 /* JsxSelfClosingElement */: - recordCallSite(node); - collect(node.tagName); - collect(node.attributes); - return; - case 171 /* Decorator */: - recordCallSite(node); - collect(node.expression); - return; - case 212 /* PropertyAccessExpression */: - case 213 /* ElementAccessExpression */: - recordCallSite(node); - forEachChild(node, collect); - break; - case 239 /* SatisfiesExpression */: - collect(node.expression); - return; - } - if (isPartOfTypeNode(node)) { - return; - } - forEachChild(node, collect); - } - return collect; -} -function collectCallSitesOfSourceFile(node, collect) { - forEach(node.statements, collect); -} -function collectCallSitesOfModuleDeclaration(node, collect) { - if (!hasSyntacticModifier(node, 128 /* Ambient */) && node.body && isModuleBlock(node.body)) { - forEach(node.body.statements, collect); - } -} -function collectCallSitesOfFunctionLikeDeclaration(typeChecker, node, collect) { - const implementation = findImplementation(typeChecker, node); - if (implementation) { - forEach(implementation.parameters, collect); - collect(implementation.body); - } -} -function collectCallSitesOfClassStaticBlockDeclaration(node, collect) { - collect(node.body); -} -function collectCallSitesOfClassLikeDeclaration(node, collect) { - forEach(node.modifiers, collect); - const heritage = getClassExtendsHeritageElement(node); - if (heritage) { - collect(heritage.expression); - } - for (const member of node.members) { - if (canHaveModifiers(member)) { - forEach(member.modifiers, collect); - } - if (isPropertyDeclaration(member)) { - collect(member.initializer); - } else if (isConstructorDeclaration(member) && member.body) { - forEach(member.parameters, collect); - collect(member.body); - } else if (isClassStaticBlockDeclaration(member)) { - collect(member); - } - } -} -function collectCallSites(program, node) { - const callSites = []; - const collect = createCallSiteCollector(program, callSites); - switch (node.kind) { - case 308 /* SourceFile */: - collectCallSitesOfSourceFile(node, collect); - break; - case 268 /* ModuleDeclaration */: - collectCallSitesOfModuleDeclaration(node, collect); - break; - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); - break; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - collectCallSitesOfClassLikeDeclaration(node, collect); - break; - case 176 /* ClassStaticBlockDeclaration */: - collectCallSitesOfClassStaticBlockDeclaration(node, collect); - break; - default: - Debug.assertNever(node); - } - return callSites; -} -function createCallHierarchyOutgoingCall(to, fromSpans) { - return { to, fromSpans }; -} -function convertCallSiteGroupToOutgoingCall(program, entries) { - return createCallHierarchyOutgoingCall(createCallHierarchyItem(program, entries[0].declaration), map(entries, (entry) => createTextSpanFromRange(entry.range))); -} -function getOutgoingCalls(program, declaration) { - if (declaration.flags & 33554432 /* Ambient */ || isMethodSignature(declaration)) { - return []; - } - return group(collectCallSites(program, declaration), getCallSiteGroupKey, (entries) => convertCallSiteGroupToOutgoingCall(program, entries)); -} - -// src/services/_namespaces/ts.classifier.ts -var ts_classifier_exports = {}; -__export(ts_classifier_exports, { - v2020: () => ts_classifier_v2020_exports -}); - -// src/services/_namespaces/ts.classifier.v2020.ts -var ts_classifier_v2020_exports = {}; -__export(ts_classifier_v2020_exports, { - TokenEncodingConsts: () => TokenEncodingConsts, - TokenModifier: () => TokenModifier, - TokenType: () => TokenType, - getEncodedSemanticClassifications: () => getEncodedSemanticClassifications2, - getSemanticClassifications: () => getSemanticClassifications2 -}); - -// src/services/_namespaces/ts.codefix.ts -var ts_codefix_exports = {}; -__export(ts_codefix_exports, { - PreserveOptionalFlags: () => PreserveOptionalFlags, - addNewNodeForMemberSymbol: () => addNewNodeForMemberSymbol, - codeFixAll: () => codeFixAll, - createCodeFixAction: () => createCodeFixAction, - createCodeFixActionMaybeFixAll: () => createCodeFixActionMaybeFixAll, - createCodeFixActionWithoutFixAll: () => createCodeFixActionWithoutFixAll, - createCombinedCodeActions: () => createCombinedCodeActions, - createFileTextChanges: () => createFileTextChanges, - createImportAdder: () => createImportAdder, - createImportSpecifierResolver: () => createImportSpecifierResolver, - createMissingMemberNodes: () => createMissingMemberNodes, - createSignatureDeclarationFromCallExpression: () => createSignatureDeclarationFromCallExpression, - createSignatureDeclarationFromSignature: () => createSignatureDeclarationFromSignature, - createStubbedBody: () => createStubbedBody, - eachDiagnostic: () => eachDiagnostic, - findAncestorMatchingSpan: () => findAncestorMatchingSpan, - generateAccessorFromProperty: () => generateAccessorFromProperty, - getAccessorConvertiblePropertyAtPosition: () => getAccessorConvertiblePropertyAtPosition, - getAllFixes: () => getAllFixes, - getFixes: () => getFixes, - getImportCompletionAction: () => getImportCompletionAction, - getImportKind: () => getImportKind, - getJSDocTypedefNodes: () => getJSDocTypedefNodes, - getNoopSymbolTrackerWithResolver: () => getNoopSymbolTrackerWithResolver, - getPromoteTypeOnlyCompletionAction: () => getPromoteTypeOnlyCompletionAction, - getSupportedErrorCodes: () => getSupportedErrorCodes, - importFixName: () => importFixName, - importSymbols: () => importSymbols, - parameterShouldGetTypeFromJSDoc: () => parameterShouldGetTypeFromJSDoc, - registerCodeFix: () => registerCodeFix, - setJsonCompilerOptionValue: () => setJsonCompilerOptionValue, - setJsonCompilerOptionValues: () => setJsonCompilerOptionValues, - tryGetAutoImportableReferenceFromTypeNode: () => tryGetAutoImportableReferenceFromTypeNode, - typeNodeToAutoImportableTypeNode: () => typeNodeToAutoImportableTypeNode, - typePredicateToAutoImportableTypeNode: () => typePredicateToAutoImportableTypeNode, - typeToAutoImportableTypeNode: () => typeToAutoImportableTypeNode, - typeToMinimizedReferenceType: () => typeToMinimizedReferenceType -}); - -// src/services/codeFixProvider.ts -var errorCodeToFixes = createMultiMap(); -var fixIdToRegistration = /* @__PURE__ */ new Map(); -function createCodeFixActionWithoutFixAll(fixName8, changes, description3) { - return createCodeFixActionWorker( - fixName8, - diagnosticToString(description3), - changes, - /*fixId*/ - void 0, - /*fixAllDescription*/ - void 0 - ); -} -function createCodeFixAction(fixName8, changes, description3, fixId56, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId56, diagnosticToString(fixAllDescription), command); -} -function createCodeFixActionMaybeFixAll(fixName8, changes, description3, fixId56, fixAllDescription, command) { - return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId56, fixAllDescription && diagnosticToString(fixAllDescription), command); -} -function createCodeFixActionWorker(fixName8, description3, changes, fixId56, fixAllDescription, command) { - return { fixName: fixName8, description: description3, changes, fixId: fixId56, fixAllDescription, commands: command ? [command] : void 0 }; -} -function registerCodeFix(reg) { - for (const error2 of reg.errorCodes) { - errorCodeToFixesArray = void 0; - errorCodeToFixes.add(String(error2), reg); - } - if (reg.fixIds) { - for (const fixId56 of reg.fixIds) { - Debug.assert(!fixIdToRegistration.has(fixId56)); - fixIdToRegistration.set(fixId56, reg); - } - } -} -var errorCodeToFixesArray; -function getSupportedErrorCodes() { - return errorCodeToFixesArray ?? (errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys())); -} -function removeFixIdIfFixAllUnavailable(registration, diagnostics) { - const { errorCodes: errorCodes68 } = registration; - let maybeFixableDiagnostics = 0; - for (const diag2 of diagnostics) { - if (contains(errorCodes68, diag2.code)) maybeFixableDiagnostics++; - if (maybeFixableDiagnostics > 1) break; - } - const fixAllUnavailable = maybeFixableDiagnostics < 2; - return ({ fixId: fixId56, fixAllDescription, ...action }) => { - return fixAllUnavailable ? action : { ...action, fixId: fixId56, fixAllDescription }; - }; -} -function getFixes(context) { - const diagnostics = getDiagnostics(context); - const registrations = errorCodeToFixes.get(String(context.errorCode)); - return flatMap(registrations, (f) => map(f.getCodeActions(context), removeFixIdIfFixAllUnavailable(f, diagnostics))); -} -function getAllFixes(context) { - return fixIdToRegistration.get(cast(context.fixId, isString)).getAllCodeActions(context); -} -function createCombinedCodeActions(changes, commands) { - return { changes, commands }; -} -function createFileTextChanges(fileName, textChanges2) { - return { fileName, textChanges: textChanges2 }; -} -function codeFixAll(context, errorCodes68, use) { - const commands = []; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes68, (diag2) => use(t, diag2, commands))); - return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands); -} -function eachDiagnostic(context, errorCodes68, cb) { - for (const diag2 of getDiagnostics(context)) { - if (contains(errorCodes68, diag2.code)) { - cb(diag2); - } - } -} -function getDiagnostics({ program, sourceFile, cancellationToken }) { - const diagnostics = [ - ...program.getSemanticDiagnostics(sourceFile, cancellationToken), - ...program.getSyntacticDiagnostics(sourceFile, cancellationToken), - ...computeSuggestionDiagnostics(sourceFile, program, cancellationToken) - ]; - if (getEmitDeclarations(program.getCompilerOptions())) { - diagnostics.push( - ...program.getDeclarationDiagnostics(sourceFile, cancellationToken) - ); - } - return diagnostics; -} - -// src/services/codefixes/addConvertToUnknownForNonOverlappingTypes.ts -var fixId = "addConvertToUnknownForNonOverlappingTypes"; -var errorCodes = [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.code]; -registerCodeFix({ - errorCodes, - getCodeActions: function getCodeActionsToAddConvertToUnknownForNonOverlappingTypes(context) { - const assertion = getAssertion(context.sourceFile, context.span.start); - if (assertion === void 0) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange(t, context.sourceFile, assertion)); - return [createCodeFixAction(fixId, changes, Diagnostics.Add_unknown_conversion_for_non_overlapping_types, fixId, Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]; - }, - fixIds: [fixId], - getAllCodeActions: (context) => codeFixAll(context, errorCodes, (changes, diag2) => { - const assertion = getAssertion(diag2.file, diag2.start); - if (assertion) { - makeChange(changes, diag2.file, assertion); - } - }) -}); -function makeChange(changeTracker, sourceFile, assertion) { - const replacement = isAsExpression(assertion) ? factory.createAsExpression(assertion.expression, factory.createKeywordTypeNode(159 /* UnknownKeyword */)) : factory.createTypeAssertion(factory.createKeywordTypeNode(159 /* UnknownKeyword */), assertion.expression); - changeTracker.replaceNode(sourceFile, assertion.expression, replacement); -} -function getAssertion(sourceFile, pos) { - if (isInJSFile(sourceFile)) return void 0; - return findAncestor(getTokenAtPosition(sourceFile, pos), (n) => isAsExpression(n) || isTypeAssertionExpression(n)); -} - -// src/services/codefixes/addEmptyExportDeclaration.ts -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) { - const { sourceFile } = context; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - const exportDeclaration = factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([]), - /*moduleSpecifier*/ - void 0 - ); - changes2.insertNodeAtEndOfScope(sourceFile, sourceFile, exportDeclaration); - }); - return [createCodeFixActionWithoutFixAll("addEmptyExportDeclaration", changes, Diagnostics.Add_export_to_make_this_file_into_a_module)]; - } -}); - -// src/services/codefixes/addMissingAsync.ts -var fixId2 = "addMissingAsync"; -var errorCodes2 = [ - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, - Diagnostics.Type_0_is_not_assignable_to_type_1.code, - Diagnostics.Type_0_is_not_comparable_to_type_1.code -]; -registerCodeFix({ - fixIds: [fixId2], - errorCodes: errorCodes2, - getCodeActions: function getCodeActionsToAddMissingAsync(context) { - const { sourceFile, errorCode, cancellationToken, program, span } = context; - const diagnostic = find(program.getTypeChecker().getDiagnostics(sourceFile, cancellationToken), getIsMatchingAsyncError(span, errorCode)); - const directSpan = diagnostic && diagnostic.relatedInformation && find(diagnostic.relatedInformation, (r) => r.code === Diagnostics.Did_you_mean_to_mark_this_function_as_async.code); - const decl = getFixableErrorSpanDeclaration(sourceFile, directSpan); - if (!decl) { - return; - } - const trackChanges = (cb) => ts_textChanges_exports.ChangeTracker.with(context, cb); - return [getFix(context, decl, trackChanges)]; - }, - getAllCodeActions: (context) => { - const { sourceFile } = context; - const fixedDeclarations = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes2, (t, diagnostic) => { - const span = diagnostic.relatedInformation && find(diagnostic.relatedInformation, (r) => r.code === Diagnostics.Did_you_mean_to_mark_this_function_as_async.code); - const decl = getFixableErrorSpanDeclaration(sourceFile, span); - if (!decl) { - return; - } - const trackChanges = (cb) => (cb(t), []); - return getFix(context, decl, trackChanges, fixedDeclarations); - }); - } -}); -function getFix(context, decl, trackChanges, fixedDeclarations) { - const changes = trackChanges((t) => makeChange2(t, context.sourceFile, decl, fixedDeclarations)); - return createCodeFixAction(fixId2, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId2, Diagnostics.Add_all_missing_async_modifiers); -} -function makeChange2(changeTracker, sourceFile, insertionSite, fixedDeclarations) { - if (fixedDeclarations) { - if (fixedDeclarations.has(getNodeId(insertionSite))) { - return; - } - } - fixedDeclarations == null ? void 0 : fixedDeclarations.add(getNodeId(insertionSite)); - const cloneWithModifier = factory.replaceModifiers( - getSynthesizedDeepClone( - insertionSite, - /*includeTrivia*/ - true - ), - factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) | 1024 /* Async */)) - ); - changeTracker.replaceNode( - sourceFile, - insertionSite, - cloneWithModifier - ); -} -function getFixableErrorSpanDeclaration(sourceFile, span) { - if (!span) return void 0; - const token = getTokenAtPosition(sourceFile, span.start); - const decl = findAncestor(token, (node) => { - if (node.getStart(sourceFile) < span.start || node.getEnd() > textSpanEnd(span)) { - return "quit"; - } - return (isArrowFunction(node) || isMethodDeclaration(node) || isFunctionExpression(node) || isFunctionDeclaration(node)) && textSpansEqual(span, createTextSpanFromNode(node, sourceFile)); - }); - return decl; -} -function getIsMatchingAsyncError(span, errorCode) { - return ({ start, length: length2, relatedInformation, code }) => isNumber(start) && isNumber(length2) && textSpansEqual({ start, length: length2 }, span) && code === errorCode && !!relatedInformation && some(relatedInformation, (related) => related.code === Diagnostics.Did_you_mean_to_mark_this_function_as_async.code); -} - -// src/services/codefixes/addMissingAwait.ts -var fixId3 = "addMissingAwait"; -var propertyAccessCode = Diagnostics.Property_0_does_not_exist_on_type_1.code; -var callableConstructableErrorCodes = [ - Diagnostics.This_expression_is_not_callable.code, - Diagnostics.This_expression_is_not_constructable.code -]; -var errorCodes3 = [ - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code, - Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code, - Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code, - Diagnostics.Operator_0_cannot_be_applied_to_type_1.code, - Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code, - Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code, - Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code, - Diagnostics.Type_0_is_not_an_array_type.code, - Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code, - Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code, - Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, - Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, - Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code, - Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, - propertyAccessCode, - ...callableConstructableErrorCodes -]; -registerCodeFix({ - fixIds: [fixId3], - errorCodes: errorCodes3, - getCodeActions: function getCodeActionsToAddMissingAwait(context) { - const { sourceFile, errorCode, span, cancellationToken, program } = context; - const expression = getAwaitErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program); - if (!expression) { - return; - } - const checker = context.program.getTypeChecker(); - const trackChanges = (cb) => ts_textChanges_exports.ChangeTracker.with(context, cb); - return compact([ - getDeclarationSiteFix(context, expression, errorCode, checker, trackChanges), - getUseSiteFix(context, expression, errorCode, checker, trackChanges) - ]); - }, - getAllCodeActions: (context) => { - const { sourceFile, program, cancellationToken } = context; - const checker = context.program.getTypeChecker(); - const fixedDeclarations = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes3, (t, diagnostic) => { - const expression = getAwaitErrorSpanExpression(sourceFile, diagnostic.code, diagnostic, cancellationToken, program); - if (!expression) { - return; - } - const trackChanges = (cb) => (cb(t), []); - return getDeclarationSiteFix(context, expression, diagnostic.code, checker, trackChanges, fixedDeclarations) || getUseSiteFix(context, expression, diagnostic.code, checker, trackChanges, fixedDeclarations); - }); - } -}); -function getAwaitErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program) { - const expression = getFixableErrorSpanExpression(sourceFile, span); - return expression && isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program) && isInsideAwaitableBody(expression) ? expression : void 0; -} -function getDeclarationSiteFix(context, expression, errorCode, checker, trackChanges, fixedDeclarations) { - const { sourceFile, program, cancellationToken } = context; - const awaitableInitializers = findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker); - if (awaitableInitializers) { - const initializerChanges = trackChanges((t) => { - forEach(awaitableInitializers.initializers, ({ expression: expression2 }) => makeChange3(t, errorCode, sourceFile, checker, expression2, fixedDeclarations)); - if (fixedDeclarations && awaitableInitializers.needsSecondPassForFixAll) { - makeChange3(t, errorCode, sourceFile, checker, expression, fixedDeclarations); - } - }); - return createCodeFixActionWithoutFixAll( - "addMissingAwaitToInitializer", - initializerChanges, - awaitableInitializers.initializers.length === 1 ? [Diagnostics.Add_await_to_initializer_for_0, awaitableInitializers.initializers[0].declarationSymbol.name] : Diagnostics.Add_await_to_initializers - ); - } -} -function getUseSiteFix(context, expression, errorCode, checker, trackChanges, fixedDeclarations) { - const changes = trackChanges((t) => makeChange3(t, errorCode, context.sourceFile, checker, expression, fixedDeclarations)); - return createCodeFixAction(fixId3, changes, Diagnostics.Add_await, fixId3, Diagnostics.Fix_all_expressions_possibly_missing_await); -} -function isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program) { - const checker = program.getTypeChecker(); - const diagnostics = checker.getDiagnostics(sourceFile, cancellationToken); - return some(diagnostics, ({ start, length: length2, relatedInformation, code }) => isNumber(start) && isNumber(length2) && textSpansEqual({ start, length: length2 }, span) && code === errorCode && !!relatedInformation && some(relatedInformation, (related) => related.code === Diagnostics.Did_you_forget_to_use_await.code)); -} -function findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker) { - const identifiers = getIdentifiersFromErrorSpanExpression(expression, checker); - if (!identifiers) { - return; - } - let isCompleteFix = identifiers.isCompleteFix; - let initializers; - for (const identifier of identifiers.identifiers) { - const symbol = checker.getSymbolAtLocation(identifier); - if (!symbol) { - continue; - } - const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration); - const variableName = declaration && tryCast(declaration.name, isIdentifier); - const variableStatement = getAncestor(declaration, 244 /* VariableStatement */); - if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 32 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) { - isCompleteFix = false; - continue; - } - const diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); - const isUsedElsewhere = ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(variableName, checker, sourceFile, (reference) => { - return identifier !== reference && !symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker); - }); - if (isUsedElsewhere) { - isCompleteFix = false; - continue; - } - (initializers || (initializers = [])).push({ - expression: declaration.initializer, - declarationSymbol: symbol - }); - } - return initializers && { - initializers, - needsSecondPassForFixAll: !isCompleteFix - }; -} -function getIdentifiersFromErrorSpanExpression(expression, checker) { - if (isPropertyAccessExpression(expression.parent) && isIdentifier(expression.parent.expression)) { - return { identifiers: [expression.parent.expression], isCompleteFix: true }; - } - if (isIdentifier(expression)) { - return { identifiers: [expression], isCompleteFix: true }; - } - if (isBinaryExpression(expression)) { - let sides; - let isCompleteFix = true; - for (const side of [expression.left, expression.right]) { - const type = checker.getTypeAtLocation(side); - if (checker.getPromisedTypeOfPromise(type)) { - if (!isIdentifier(side)) { - isCompleteFix = false; - continue; - } - (sides || (sides = [])).push(side); - } - } - return sides && { identifiers: sides, isCompleteFix }; - } -} -function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker) { - const errorNode = isPropertyAccessExpression(reference.parent) ? reference.parent.name : isBinaryExpression(reference.parent) ? reference.parent : reference; - const diagnostic = find(diagnostics, (diagnostic2) => diagnostic2.start === errorNode.getStart(sourceFile) && diagnostic2.start + diagnostic2.length === errorNode.getEnd()); - return diagnostic && contains(errorCodes3, diagnostic.code) || // A Promise is usually not correct in a binary expression (it's not valid - // in an arithmetic expression and an equality comparison seems unusual), - // but if the other side of the binary expression has an error, the side - // is typed `any` which will squash the error that would identify this - // Promise as an invalid operand. So if the whole binary expression is - // typed `any` as a result, there is a strong likelihood that this Promise - // is accidentally missing `await`. - checker.getTypeAtLocation(errorNode).flags & 1 /* Any */; -} -function isInsideAwaitableBody(node) { - return node.flags & 65536 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 263 /* FunctionDeclaration */ || ancestor.parent.kind === 219 /* FunctionExpression */ || ancestor.parent.kind === 220 /* ArrowFunction */ || ancestor.parent.kind === 175 /* MethodDeclaration */)); -} -function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { - if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) { - const exprType = checker.getTypeAtLocation(insertionSite); - const asyncIter = checker.getAnyAsyncIterableType(); - if (asyncIter && checker.isTypeAssignableTo(exprType, asyncIter)) { - const forOf = insertionSite.parent; - changeTracker.replaceNode(sourceFile, forOf, factory.updateForOfStatement(forOf, factory.createToken(135 /* AwaitKeyword */), forOf.initializer, forOf.expression, forOf.statement)); - return; - } - } - if (isBinaryExpression(insertionSite)) { - for (const side of [insertionSite.left, insertionSite.right]) { - if (fixedDeclarations && isIdentifier(side)) { - const symbol = checker.getSymbolAtLocation(side); - if (symbol && fixedDeclarations.has(getSymbolId(symbol))) { - continue; - } - } - const type = checker.getTypeAtLocation(side); - const newNode = checker.getPromisedTypeOfPromise(type) ? factory.createAwaitExpression(side) : side; - changeTracker.replaceNode(sourceFile, side, newNode); - } - } else if (errorCode === propertyAccessCode && isPropertyAccessExpression(insertionSite.parent)) { - if (fixedDeclarations && isIdentifier(insertionSite.parent.expression)) { - const symbol = checker.getSymbolAtLocation(insertionSite.parent.expression); - if (symbol && fixedDeclarations.has(getSymbolId(symbol))) { - return; - } - } - changeTracker.replaceNode( - sourceFile, - insertionSite.parent.expression, - factory.createParenthesizedExpression(factory.createAwaitExpression(insertionSite.parent.expression)) - ); - insertLeadingSemicolonIfNeeded(changeTracker, insertionSite.parent.expression, sourceFile); - } else if (contains(callableConstructableErrorCodes, errorCode) && isCallOrNewExpression(insertionSite.parent)) { - if (fixedDeclarations && isIdentifier(insertionSite)) { - const symbol = checker.getSymbolAtLocation(insertionSite); - if (symbol && fixedDeclarations.has(getSymbolId(symbol))) { - return; - } - } - changeTracker.replaceNode(sourceFile, insertionSite, factory.createParenthesizedExpression(factory.createAwaitExpression(insertionSite))); - insertLeadingSemicolonIfNeeded(changeTracker, insertionSite, sourceFile); - } else { - if (fixedDeclarations && isVariableDeclaration(insertionSite.parent) && isIdentifier(insertionSite.parent.name)) { - const symbol = checker.getSymbolAtLocation(insertionSite.parent.name); - if (symbol && !tryAddToSet(fixedDeclarations, getSymbolId(symbol))) { - return; - } - } - changeTracker.replaceNode(sourceFile, insertionSite, factory.createAwaitExpression(insertionSite)); - } -} -function insertLeadingSemicolonIfNeeded(changeTracker, beforeNode, sourceFile) { - const precedingToken = findPrecedingToken(beforeNode.pos, sourceFile); - if (precedingToken && positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) { - changeTracker.insertText(sourceFile, beforeNode.getStart(sourceFile), ";"); - } -} - -// src/services/codefixes/addMissingConst.ts -var fixId4 = "addMissingConst"; -var errorCodes4 = [ - Diagnostics.Cannot_find_name_0.code, - Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code -]; -registerCodeFix({ - errorCodes: errorCodes4, - getCodeActions: function getCodeActionsToAddMissingConst(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange4(t, context.sourceFile, context.span.start, context.program)); - if (changes.length > 0) { - return [createCodeFixAction(fixId4, changes, Diagnostics.Add_const_to_unresolved_variable, fixId4, Diagnostics.Add_const_to_all_unresolved_variables)]; - } - }, - fixIds: [fixId4], - getAllCodeActions: (context) => { - const fixedNodes = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes4, (changes, diag2) => makeChange4(changes, diag2.file, diag2.start, context.program, fixedNodes)); - } -}); -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"); - if (forInitializer) return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes); - const parent2 = token.parent; - if (isBinaryExpression(parent2) && parent2.operatorToken.kind === 64 /* EqualsToken */ && isExpressionStatement(parent2.parent)) { - return applyChange(changeTracker, token, sourceFile, fixedNodes); - } - if (isArrayLiteralExpression(parent2)) { - const checker = program.getTypeChecker(); - if (!every(parent2.elements, (element) => arrayElementCouldBeVariableDeclaration(element, checker))) { - return; - } - return applyChange(changeTracker, parent2, sourceFile, fixedNodes); - } - const commaExpression = findAncestor(token, (node) => isExpressionStatement(node.parent) ? true : isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit"); - if (commaExpression) { - const checker = program.getTypeChecker(); - if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) { - return; - } - return applyChange(changeTracker, commaExpression, sourceFile, fixedNodes); - } -} -function applyChange(changeTracker, initializer, sourceFile, fixedNodes) { - if (!fixedNodes || tryAddToSet(fixedNodes, initializer)) { - changeTracker.insertModifierBefore(sourceFile, 87 /* ConstKeyword */, initializer); - } -} -function isPossiblyPartOfDestructuring(node) { - switch (node.kind) { - case 80 /* Identifier */: - case 210 /* ArrayLiteralExpression */: - case 211 /* ObjectLiteralExpression */: - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - return true; - default: - return false; - } -} -function arrayElementCouldBeVariableDeclaration(expression, checker) { - const identifier = isIdentifier(expression) ? expression : isAssignmentExpression( - expression, - /*excludeCompoundAssignment*/ - true - ) && isIdentifier(expression.left) ? expression.left : void 0; - return !!identifier && !checker.getSymbolAtLocation(identifier); -} -function isPossiblyPartOfCommaSeperatedInitializer(node) { - switch (node.kind) { - case 80 /* Identifier */: - case 227 /* BinaryExpression */: - case 28 /* CommaToken */: - return true; - default: - return false; - } -} -function expressionCouldBeVariableDeclaration(expression, checker) { - if (!isBinaryExpression(expression)) { - return false; - } - if (expression.operatorToken.kind === 28 /* CommaToken */) { - return every([expression.left, expression.right], (expression2) => expressionCouldBeVariableDeclaration(expression2, checker)); - } - return expression.operatorToken.kind === 64 /* EqualsToken */ && isIdentifier(expression.left) && !checker.getSymbolAtLocation(expression.left); -} - -// src/services/codefixes/addMissingDeclareProperty.ts -var fixId5 = "addMissingDeclareProperty"; -var errorCodes5 = [ - 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.code -]; -registerCodeFix({ - errorCodes: errorCodes5, - getCodeActions: function getCodeActionsToAddMissingDeclareOnProperty(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange5(t, context.sourceFile, context.span.start)); - if (changes.length > 0) { - return [createCodeFixAction(fixId5, changes, Diagnostics.Prefix_with_declare, fixId5, Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]; - } - }, - fixIds: [fixId5], - getAllCodeActions: (context) => { - const fixedNodes = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes5, (changes, diag2) => makeChange5(changes, diag2.file, diag2.start, fixedNodes)); - } -}); -function makeChange5(changeTracker, sourceFile, pos, fixedNodes) { - const token = getTokenAtPosition(sourceFile, pos); - if (!isIdentifier(token)) { - return; - } - const declaration = token.parent; - if (declaration.kind === 173 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { - changeTracker.insertModifierBefore(sourceFile, 138 /* DeclareKeyword */, declaration); - } -} - -// src/services/codefixes/addMissingInvocationForDecorator.ts -var fixId6 = "addMissingInvocationForDecorator"; -var errorCodes6 = [Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code]; -registerCodeFix({ - errorCodes: errorCodes6, - getCodeActions: function getCodeActionsToAddMissingInvocationForDecorator(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange6(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId6, changes, Diagnostics.Call_decorator_expression, fixId6, Diagnostics.Add_to_all_uncalled_decorators)]; - }, - fixIds: [fixId6], - getAllCodeActions: (context) => codeFixAll(context, errorCodes6, (changes, diag2) => makeChange6(changes, diag2.file, diag2.start)) -}); -function makeChange6(changeTracker, sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - const decorator = findAncestor(token, isDecorator); - Debug.assert(!!decorator, "Expected position to be owned by a decorator."); - const replacement = factory.createCallExpression( - decorator.expression, - /*typeArguments*/ - void 0, - /*argumentsArray*/ - void 0 - ); - changeTracker.replaceNode(sourceFile, decorator.expression, replacement); -} - -// src/services/codefixes/addMissingResolutionModeImportAttribute.ts -var fixId7 = "addMissingResolutionModeImportAttribute"; -var errorCodes7 = [ - Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code, - Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code -]; -registerCodeFix({ - errorCodes: errorCodes7, - getCodeActions: function getCodeActionsToAddMissingResolutionModeImportAttribute(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange7(t, context.sourceFile, context.span.start, context.program, context.host, context.preferences)); - return [createCodeFixAction(fixId7, changes, Diagnostics.Add_resolution_mode_import_attribute, fixId7, Diagnostics.Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it)]; - }, - fixIds: [fixId7], - getAllCodeActions: (context) => codeFixAll(context, errorCodes7, (changes, diag2) => makeChange7(changes, diag2.file, diag2.start, context.program, context.host, context.preferences)) -}); -function makeChange7(changeTracker, sourceFile, pos, program, host, preferences) { - var _a, _b, _c; - const token = getTokenAtPosition(sourceFile, pos); - const importNode = findAncestor(token, or(isImportDeclaration, isImportTypeNode)); - Debug.assert(!!importNode, "Expected position to be owned by an ImportDeclaration or ImportType."); - const useSingleQuotes = getQuotePreference(sourceFile, preferences) === 0 /* Single */; - const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importNode); - const canUseImportMode = !moduleSpecifier || ((_a = resolveModuleName( - moduleSpecifier.text, - sourceFile.fileName, - program.getCompilerOptions(), - host, - program.getModuleResolutionCache(), - /*redirectedReference*/ - void 0, - 99 /* ESNext */ - ).resolvedModule) == null ? void 0 : _a.resolvedFileName) === ((_c = (_b = program.getResolvedModuleFromModuleSpecifier( - moduleSpecifier, - sourceFile - )) == null ? void 0 : _b.resolvedModule) == null ? void 0 : _c.resolvedFileName); - const attributes = importNode.attributes ? factory.updateImportAttributes( - importNode.attributes, - factory.createNodeArray([ - ...importNode.attributes.elements, - factory.createImportAttribute( - factory.createStringLiteral("resolution-mode", useSingleQuotes), - factory.createStringLiteral(canUseImportMode ? "import" : "require", useSingleQuotes) - ) - ], importNode.attributes.elements.hasTrailingComma), - importNode.attributes.multiLine - ) : factory.createImportAttributes( - factory.createNodeArray([ - factory.createImportAttribute( - factory.createStringLiteral("resolution-mode", useSingleQuotes), - factory.createStringLiteral(canUseImportMode ? "import" : "require", useSingleQuotes) - ) - ]) - ); - if (importNode.kind === 273 /* ImportDeclaration */) { - changeTracker.replaceNode( - sourceFile, - importNode, - factory.updateImportDeclaration( - importNode, - importNode.modifiers, - importNode.importClause, - importNode.moduleSpecifier, - attributes - ) - ); - } else { - changeTracker.replaceNode( - sourceFile, - importNode, - factory.updateImportTypeNode( - importNode, - importNode.argument, - attributes, - importNode.qualifier, - importNode.typeArguments - ) - ); - } -} - -// src/services/codefixes/addNameToNamelessParameter.ts -var fixId8 = "addNameToNamelessParameter"; -var errorCodes8 = [Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code]; -registerCodeFix({ - errorCodes: errorCodes8, - getCodeActions: function getCodeActionsToAddNameToNamelessParameter(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange8(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId8, changes, Diagnostics.Add_parameter_name, fixId8, Diagnostics.Add_names_to_all_parameters_without_names)]; - }, - fixIds: [fixId8], - getAllCodeActions: (context) => codeFixAll(context, errorCodes8, (changes, diag2) => makeChange8(changes, diag2.file, diag2.start)) -}); -function makeChange8(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)); - } - 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."); - 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 && !isArrayTypeNode(typeNode) ? factory.createArrayTypeNode(typeNode) : typeNode, - param.initializer - ); - 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; -} - -// src/services/codefixes/addOptionalPropertyUndefined.ts -var addOptionalPropertyUndefined = "addOptionalPropertyUndefined"; -var errorCodes9 = [ - Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code, - Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code -]; -registerCodeFix({ - errorCodes: errorCodes9, - getCodeActions(context) { - const typeChecker = context.program.getTypeChecker(); - const toAdd = getPropertiesToAdd(context.sourceFile, context.span, typeChecker); - if (!toAdd.length) { - return void 0; - } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addUndefinedToOptionalProperty(t, toAdd)); - return [createCodeFixActionWithoutFixAll(addOptionalPropertyUndefined, changes, Diagnostics.Add_undefined_to_optional_property_type)]; - }, - fixIds: [addOptionalPropertyUndefined] -}); -function getPropertiesToAdd(file, span, checker) { - var _a, _b; - const sourceTarget = getSourceTarget(getFixableErrorSpanExpression(file, span), checker); - if (!sourceTarget) { - return emptyArray; - } - const { source: sourceNode, target: targetNode } = sourceTarget; - const target = shouldUseParentTypeOfProperty(sourceNode, targetNode, checker) ? checker.getTypeAtLocation(targetNode.expression) : checker.getTypeAtLocation(targetNode); - if ((_b = (_a = target.symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => getSourceFileOfNode(d).fileName.match(/\.d\.ts$/))) { - return emptyArray; - } - return checker.getExactOptionalProperties(target); -} -function shouldUseParentTypeOfProperty(sourceNode, targetNode, checker) { - return isPropertyAccessExpression(targetNode) && !!checker.getExactOptionalProperties(checker.getTypeAtLocation(targetNode.expression)).length && checker.getTypeAtLocation(sourceNode) === checker.getUndefinedType(); -} -function getSourceTarget(errorNode, checker) { - var _a; - if (!errorNode) { - return void 0; - } else if (isBinaryExpression(errorNode.parent) && errorNode.parent.operatorToken.kind === 64 /* EqualsToken */) { - return { source: errorNode.parent.right, target: errorNode.parent.left }; - } else if (isVariableDeclaration(errorNode.parent) && errorNode.parent.initializer) { - return { source: errorNode.parent.initializer, target: errorNode.parent.name }; - } else if (isCallExpression(errorNode.parent)) { - const n = checker.getSymbolAtLocation(errorNode.parent.expression); - if (!(n == null ? void 0 : n.valueDeclaration) || !isFunctionLikeKind(n.valueDeclaration.kind)) return void 0; - if (!isExpression(errorNode)) return void 0; - const i = errorNode.parent.arguments.indexOf(errorNode); - if (i === -1) return void 0; - const name = n.valueDeclaration.parameters[i].name; - if (isIdentifier(name)) return { source: errorNode, target: name }; - } else if (isPropertyAssignment(errorNode.parent) && isIdentifier(errorNode.parent.name) || isShorthandPropertyAssignment(errorNode.parent)) { - const parentTarget = getSourceTarget(errorNode.parent.parent, checker); - if (!parentTarget) return void 0; - const prop = checker.getPropertyOfType(checker.getTypeAtLocation(parentTarget.target), errorNode.parent.name.text); - const declaration = (_a = prop == null ? void 0 : prop.declarations) == null ? void 0 : _a[0]; - if (!declaration) return void 0; - return { - source: isPropertyAssignment(errorNode.parent) ? errorNode.parent.initializer : errorNode.parent.name, - target: declaration - }; - } - return void 0; -} -function addUndefinedToOptionalProperty(changes, toAdd) { - for (const add of toAdd) { - const d = add.valueDeclaration; - if (d && (isPropertySignature(d) || isPropertyDeclaration(d)) && d.type) { - const t = factory.createUnionTypeNode([ - ...d.type.kind === 193 /* UnionType */ ? d.type.types : [d.type], - factory.createTypeReferenceNode("undefined") - ]); - changes.replaceNode(d.getSourceFile(), d.type, t); - } - } -} - -// src/services/codefixes/annotateWithTypeFromJSDoc.ts -var fixId9 = "annotateWithTypeFromJSDoc"; -var errorCodes10 = [Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code]; -registerCodeFix({ - errorCodes: errorCodes10, - getCodeActions(context) { - const decl = getDeclaration(context.sourceFile, context.span.start); - if (!decl) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange8(t, context.sourceFile, decl)); - return [createCodeFixAction(fixId9, changes, Diagnostics.Annotate_with_type_from_JSDoc, fixId9, Diagnostics.Annotate_everything_with_types_from_JSDoc)]; - }, - fixIds: [fixId9], - getAllCodeActions: (context) => codeFixAll(context, errorCodes10, (changes, diag2) => { - const decl = getDeclaration(diag2.file, diag2.start); - if (decl) doChange8(changes, diag2.file, decl); - }) -}); -function getDeclaration(file, pos) { - const name = getTokenAtPosition(file, pos); - return tryCast(isParameter(name.parent) ? name.parent.parent : name.parent, parameterShouldGetTypeFromJSDoc); -} -function parameterShouldGetTypeFromJSDoc(node) { - return isDeclarationWithType(node) && hasUsableJSDoc(node); -} -function hasUsableJSDoc(decl) { - return isFunctionLikeDeclaration(decl) ? decl.parameters.some(hasUsableJSDoc) || !decl.type && !!getJSDocReturnType(decl) : !decl.type && !!getJSDocType(decl); -} -function doChange8(changes, sourceFile, decl) { - if (isFunctionLikeDeclaration(decl) && (getJSDocReturnType(decl) || decl.parameters.some((p) => !!getJSDocType(p)))) { - if (!decl.typeParameters) { - const typeParameters = getJSDocTypeParameterDeclarations(decl); - if (typeParameters.length) changes.insertTypeParameters(sourceFile, decl, typeParameters); - } - const needParens = isArrowFunction(decl) && !findChildOfKind(decl, 21 /* OpenParenToken */, sourceFile); - if (needParens) changes.insertNodeBefore(sourceFile, first(decl.parameters), factory.createToken(21 /* OpenParenToken */)); - for (const param of decl.parameters) { - if (!param.type) { - const paramType = getJSDocType(param); - if (paramType) changes.tryInsertTypeAnnotation(sourceFile, param, visitNode(paramType, transformJSDocType, isTypeNode)); - } - } - if (needParens) changes.insertNodeAfter(sourceFile, last(decl.parameters), factory.createToken(22 /* CloseParenToken */)); - if (!decl.type) { - const returnType = getJSDocReturnType(decl); - if (returnType) changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(returnType, transformJSDocType, isTypeNode)); - } - } else { - const jsdocType = Debug.checkDefined(getJSDocType(decl), "A JSDocType for this declaration should exist"); - Debug.assert(!decl.type, "The JSDocType decl should have a type"); - changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(jsdocType, transformJSDocType, isTypeNode)); - } -} -function isDeclarationWithType(node) { - return isFunctionLikeDeclaration(node) || node.kind === 261 /* VariableDeclaration */ || node.kind === 172 /* PropertySignature */ || node.kind === 173 /* PropertyDeclaration */; -} -function transformJSDocType(node) { - switch (node.kind) { - case 313 /* JSDocAllType */: - case 314 /* JSDocUnknownType */: - return factory.createTypeReferenceNode("any", emptyArray); - case 317 /* JSDocOptionalType */: - return transformJSDocOptionalType(node); - case 316 /* JSDocNonNullableType */: - return transformJSDocType(node.type); - case 315 /* JSDocNullableType */: - return transformJSDocNullableType(node); - case 319 /* JSDocVariadicType */: - return transformJSDocVariadicType(node); - case 318 /* JSDocFunctionType */: - return transformJSDocFunctionType(node); - case 184 /* TypeReference */: - return transformJSDocTypeReference(node); - case 323 /* JSDocTypeLiteral */: - return transformJSDocTypeLiteral(node); - default: - const visited = visitEachChild( - node, - transformJSDocType, - /*context*/ - void 0 - ); - setEmitFlags(visited, 1 /* SingleLine */); - return visited; - } -} -function transformJSDocTypeLiteral(node) { - const typeNode = factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (tag) => factory.createPropertySignature( - /*modifiers*/ - void 0, - isIdentifier(tag.name) ? tag.name : tag.name.right, - isOptionalJSDocPropertyLikeTag(tag) ? factory.createToken(58 /* QuestionToken */) : void 0, - tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType, isTypeNode) || factory.createKeywordTypeNode(133 /* AnyKeyword */) - ))); - setEmitFlags(typeNode, 1 /* SingleLine */); - return typeNode; -} -function transformJSDocOptionalType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("undefined", emptyArray)]); -} -function transformJSDocNullableType(node) { - return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("null", emptyArray)]); -} -function transformJSDocVariadicType(node) { - return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType, isTypeNode)); -} -function transformJSDocFunctionType(node) { - return factory.createFunctionTypeNode(emptyArray, node.parameters.map(transformJSDocParameter), node.type ?? factory.createKeywordTypeNode(133 /* AnyKeyword */)); -} -function transformJSDocParameter(node) { - const index = node.parent.parameters.indexOf(node); - const isRest = node.type.kind === 319 /* 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); -} -function transformJSDocTypeReference(node) { - let name = node.typeName; - let args = node.typeArguments; - if (isIdentifier(node.typeName)) { - if (isJSDocIndexSignature(node)) { - return transformJSDocIndexSignature(node); - } - let text = node.typeName.text; - switch (node.typeName.text) { - case "String": - case "Boolean": - case "Object": - case "Number": - text = text.toLowerCase(); - break; - case "array": - case "date": - case "promise": - text = text[0].toUpperCase() + text.slice(1); - break; - } - name = factory.createIdentifier(text); - if ((text === "Array" || text === "Promise") && !node.typeArguments) { - args = factory.createNodeArray([factory.createTypeReferenceNode("any", emptyArray)]); - } else { - args = visitNodes2(node.typeArguments, transformJSDocType, isTypeNode); - } - } - return factory.createTypeReferenceNode(name, args); -} -function transformJSDocIndexSignature(node) { - const index = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - node.typeArguments[0].kind === 150 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ - void 0, - factory.createTypeReferenceNode(node.typeArguments[0].kind === 150 /* NumberKeyword */ ? "number" : "string", []), - /*initializer*/ - void 0 - ); - const indexSignature = factory.createTypeLiteralNode([factory.createIndexSignature( - /*modifiers*/ - void 0, - [index], - node.typeArguments[1] - )]); - setEmitFlags(indexSignature, 1 /* SingleLine */); - return indexSignature; -} - -// src/services/codefixes/convertFunctionToEs6Class.ts -var fixId10 = "convertFunctionToEs6Class"; -var errorCodes11 = [Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code]; -registerCodeFix({ - errorCodes: errorCodes11, - getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange9(t, context.sourceFile, context.span.start, context.program.getTypeChecker(), context.preferences, context.program.getCompilerOptions())); - return [createCodeFixAction(fixId10, changes, Diagnostics.Convert_function_to_an_ES2015_class, fixId10, Diagnostics.Convert_all_constructor_functions_to_classes)]; - }, - fixIds: [fixId10], - getAllCodeActions: (context) => codeFixAll(context, errorCodes11, (changes, err) => doChange9(changes, err.file, err.start, context.program.getTypeChecker(), context.preferences, context.program.getCompilerOptions())) -}); -function doChange9(changes, sourceFile, position, checker, preferences, compilerOptions) { - const ctorSymbol = checker.getSymbolAtLocation(getTokenAtPosition(sourceFile, position)); - if (!ctorSymbol || !ctorSymbol.valueDeclaration || !(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { - return void 0; - } - const ctorDeclaration = ctorSymbol.valueDeclaration; - if (isFunctionDeclaration(ctorDeclaration) || isFunctionExpression(ctorDeclaration)) { - changes.replaceNode(sourceFile, ctorDeclaration, createClassFromFunction(ctorDeclaration)); - } else if (isVariableDeclaration(ctorDeclaration)) { - const classDeclaration = createClassFromVariableDeclaration(ctorDeclaration); - if (!classDeclaration) { - return void 0; - } - const ancestor = ctorDeclaration.parent.parent; - if (isVariableDeclarationList(ctorDeclaration.parent) && ctorDeclaration.parent.declarations.length > 1) { - changes.delete(sourceFile, ctorDeclaration); - changes.insertNodeAfter(sourceFile, ancestor, classDeclaration); - } else { - changes.replaceNode(sourceFile, ancestor, classDeclaration); - } - } - function createClassElementsFromSymbol(symbol) { - const memberElements = []; - if (symbol.exports) { - symbol.exports.forEach((member) => { - if (member.name === "prototype" && member.declarations) { - const firstDeclaration = member.declarations[0]; - if (member.declarations.length === 1 && isPropertyAccessExpression(firstDeclaration) && isBinaryExpression(firstDeclaration.parent) && firstDeclaration.parent.operatorToken.kind === 64 /* EqualsToken */ && isObjectLiteralExpression(firstDeclaration.parent.right)) { - const prototypes = firstDeclaration.parent.right; - createClassElement( - prototypes.symbol, - /*modifiers*/ - void 0, - memberElements - ); - } - } else { - createClassElement(member, [factory.createToken(126 /* StaticKeyword */)], memberElements); - } - }); - } - if (symbol.members) { - symbol.members.forEach((member, key) => { - var _a, _b, _c, _d; - if (key === "constructor" && member.valueDeclaration) { - const prototypeAssignment = (_d = (_c = (_b = (_a = symbol.exports) == null ? void 0 : _a.get("prototype")) == null ? void 0 : _b.declarations) == null ? void 0 : _c[0]) == null ? void 0 : _d.parent; - if (prototypeAssignment && isBinaryExpression(prototypeAssignment) && isObjectLiteralExpression(prototypeAssignment.right) && some(prototypeAssignment.right.properties, isConstructorAssignment)) { - } else { - changes.delete(sourceFile, member.valueDeclaration.parent); - } - return; - } - createClassElement( - member, - /*modifiers*/ - void 0, - memberElements - ); - }); - } - return memberElements; - function shouldConvertDeclaration(_target, source) { - if (isAccessExpression(_target)) { - if (isPropertyAccessExpression(_target) && isConstructorAssignment(_target)) return true; - return isFunctionLike(source); - } else { - return every(_target.properties, (property) => { - if (isMethodDeclaration(property) || isGetOrSetAccessorDeclaration(property)) return true; - if (isPropertyAssignment(property) && isFunctionExpression(property.initializer) && !!property.name) return true; - if (isConstructorAssignment(property)) return true; - return false; - }); - } - } - function createClassElement(symbol2, modifiers, members) { - if (!(symbol2.flags & 8192 /* Method */) && !(symbol2.flags & 4096 /* ObjectLiteral */)) { - return; - } - const memberDeclaration = symbol2.valueDeclaration; - const assignmentBinaryExpression = memberDeclaration.parent; - const assignmentExpr = assignmentBinaryExpression.right; - if (!shouldConvertDeclaration(memberDeclaration, assignmentExpr)) { - return; - } - if (some(members, (m) => { - const name = getNameOfDeclaration(m); - if (name && isIdentifier(name) && idText(name) === symbolName(symbol2)) { - return true; - } - return false; - })) { - return; - } - const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 245 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; - changes.delete(sourceFile, nodeToDelete); - if (!assignmentExpr) { - members.push(factory.createPropertyDeclaration( - modifiers, - symbol2.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - )); - return; - } - if (isAccessExpression(memberDeclaration) && (isFunctionExpression(assignmentExpr) || isArrowFunction(assignmentExpr))) { - const quotePreference = getQuotePreference(sourceFile, preferences); - const name = tryGetPropertyName(memberDeclaration, compilerOptions, quotePreference); - if (name) { - createFunctionLikeExpressionMember(members, assignmentExpr, name); - } - return; - } else if (isObjectLiteralExpression(assignmentExpr)) { - forEach( - assignmentExpr.properties, - (property) => { - if (isMethodDeclaration(property) || isGetOrSetAccessorDeclaration(property)) { - members.push(property); - } - if (isPropertyAssignment(property) && isFunctionExpression(property.initializer)) { - createFunctionLikeExpressionMember(members, property.initializer, property.name); - } - if (isConstructorAssignment(property)) return; - return; - } - ); - return; - } else { - if (isSourceFileJS(sourceFile)) return; - if (!isPropertyAccessExpression(memberDeclaration)) return; - const prop = factory.createPropertyDeclaration( - modifiers, - memberDeclaration.name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - assignmentExpr - ); - copyLeadingComments(assignmentBinaryExpression.parent, prop, sourceFile); - members.push(prop); - return; - } - function createFunctionLikeExpressionMember(members2, expression, name) { - if (isFunctionExpression(expression)) return createFunctionExpressionMember(members2, expression, name); - else return createArrowFunctionExpressionMember(members2, expression, name); - } - function createFunctionExpressionMember(members2, functionExpression, name) { - const fullModifiers = concatenate(modifiers, getModifierKindFromSource(functionExpression, 134 /* AsyncKeyword */)); - const method = factory.createMethodDeclaration( - fullModifiers, - /*asteriskToken*/ - void 0, - name, - /*questionToken*/ - void 0, - /*typeParameters*/ - void 0, - functionExpression.parameters, - /*type*/ - void 0, - functionExpression.body - ); - copyLeadingComments(assignmentBinaryExpression, method, sourceFile); - members2.push(method); - return; - } - function createArrowFunctionExpressionMember(members2, arrowFunction, name) { - const arrowFunctionBody = arrowFunction.body; - let bodyBlock; - if (arrowFunctionBody.kind === 242 /* Block */) { - bodyBlock = arrowFunctionBody; - } else { - bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]); - } - const fullModifiers = concatenate(modifiers, getModifierKindFromSource(arrowFunction, 134 /* AsyncKeyword */)); - const method = factory.createMethodDeclaration( - fullModifiers, - /*asteriskToken*/ - void 0, - name, - /*questionToken*/ - void 0, - /*typeParameters*/ - void 0, - arrowFunction.parameters, - /*type*/ - void 0, - bodyBlock - ); - copyLeadingComments(assignmentBinaryExpression, method, sourceFile); - members2.push(method); - } - } - } - function createClassFromVariableDeclaration(node) { - const initializer = node.initializer; - if (!initializer || !isFunctionExpression(initializer) || !isIdentifier(node.name)) { - return void 0; - } - const memberElements = createClassElementsFromSymbol(node.symbol); - if (initializer.body) { - memberElements.unshift(factory.createConstructorDeclaration( - /*modifiers*/ - void 0, - initializer.parameters, - initializer.body - )); - } - const modifiers = getModifierKindFromSource(node.parent.parent, 95 /* ExportKeyword */); - const cls = factory.createClassDeclaration( - modifiers, - node.name, - /*typeParameters*/ - void 0, - /*heritageClauses*/ - void 0, - memberElements - ); - return cls; - } - function createClassFromFunction(node) { - const memberElements = createClassElementsFromSymbol(ctorSymbol); - if (node.body) { - memberElements.unshift(factory.createConstructorDeclaration( - /*modifiers*/ - void 0, - node.parameters, - node.body - )); - } - const modifiers = getModifierKindFromSource(node, 95 /* ExportKeyword */); - const cls = factory.createClassDeclaration( - modifiers, - node.name, - /*typeParameters*/ - void 0, - /*heritageClauses*/ - void 0, - memberElements - ); - return cls; - } -} -function getModifierKindFromSource(source, kind) { - return canHaveModifiers(source) ? filter(source.modifiers, (modifier) => modifier.kind === kind) : void 0; -} -function isConstructorAssignment(x) { - if (!x.name) return false; - if (isIdentifier(x.name) && x.name.text === "constructor") return true; - return false; -} -function tryGetPropertyName(node, compilerOptions, quotePreference) { - if (isPropertyAccessExpression(node)) { - return node.name; - } - const propName = node.argumentExpression; - if (isNumericLiteral(propName)) { - return propName; - } - if (isStringLiteralLike(propName)) { - return isIdentifierText(propName.text, getEmitScriptTarget(compilerOptions)) ? factory.createIdentifier(propName.text) : isNoSubstitutionTemplateLiteral(propName) ? factory.createStringLiteral(propName.text, quotePreference === 0 /* Single */) : propName; - } - return void 0; -} - -// src/services/codefixes/convertToAsyncFunction.ts -var fixId11 = "convertToAsyncFunction"; -var errorCodes12 = [Diagnostics.This_may_be_converted_to_an_async_function.code]; -var codeActionSucceeded = true; -registerCodeFix({ - errorCodes: errorCodes12, - getCodeActions(context) { - codeActionSucceeded = true; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => convertToAsyncFunction(t, context.sourceFile, context.span.start, context.program.getTypeChecker())); - return codeActionSucceeded ? [createCodeFixAction(fixId11, changes, Diagnostics.Convert_to_async_function, fixId11, Diagnostics.Convert_all_to_async_functions)] : []; - }, - fixIds: [fixId11], - getAllCodeActions: (context) => codeFixAll(context, errorCodes12, (changes, err) => convertToAsyncFunction(changes, err.file, err.start, context.program.getTypeChecker())) -}); -function convertToAsyncFunction(changes, sourceFile, position, checker) { - const tokenAtPosition = getTokenAtPosition(sourceFile, position); - let functionToConvert; - if (isIdentifier(tokenAtPosition) && isVariableDeclaration(tokenAtPosition.parent) && tokenAtPosition.parent.initializer && isFunctionLikeDeclaration(tokenAtPosition.parent.initializer)) { - functionToConvert = tokenAtPosition.parent.initializer; - } else { - functionToConvert = tryCast(getContainingFunction(getTokenAtPosition(sourceFile, position)), canBeConvertedToAsync); - } - if (!functionToConvert) { - return; - } - const synthNamesMap = /* @__PURE__ */ new Map(); - const isInJavascript = isInJSFile(functionToConvert); - const setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker); - const functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap); - if (!returnsPromise(functionToConvertRenamed, checker)) { - return; - } - const returnStatements = functionToConvertRenamed.body && isBlock(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body, checker) : emptyArray; - const transformer = { checker, synthNamesMap, setOfExpressionsToReturn, isInJSFile: isInJavascript }; - if (!returnStatements.length) { - return; - } - const pos = skipTrivia(sourceFile.text, moveRangePastModifiers(functionToConvert).pos); - changes.insertModifierAt(sourceFile, pos, 134 /* AsyncKeyword */, { suffix: " " }); - for (const returnStatement of returnStatements) { - forEachChild(returnStatement, function visit(node) { - if (isCallExpression(node)) { - const newNodes = transformExpression( - node, - node, - transformer, - /*hasContinuation*/ - false - ); - if (hasFailed()) { - return true; - } - changes.replaceNodeWithNodes(sourceFile, returnStatement, newNodes); - } else if (!isFunctionLike(node)) { - forEachChild(node, visit); - if (hasFailed()) { - return true; - } - } - }); - if (hasFailed()) { - return; - } - } -} -function getReturnStatementsWithPromiseHandlers(body, checker) { - const res = []; - forEachReturnStatement(body, (ret) => { - if (isReturnStatementWithFixablePromiseHandler(ret, checker)) res.push(ret); - }); - return res; -} -function getAllPromiseExpressionsToReturn(func, checker) { - if (!func.body) { - return /* @__PURE__ */ new Set(); - } - const setOfExpressionsToReturn = /* @__PURE__ */ new Set(); - forEachChild(func.body, function visit(node) { - if (isPromiseReturningCallExpression(node, checker, "then")) { - setOfExpressionsToReturn.add(getNodeId(node)); - forEach(node.arguments, visit); - } else if (isPromiseReturningCallExpression(node, checker, "catch") || isPromiseReturningCallExpression(node, checker, "finally")) { - setOfExpressionsToReturn.add(getNodeId(node)); - forEachChild(node, visit); - } else if (isPromiseTypedExpression(node, checker)) { - setOfExpressionsToReturn.add(getNodeId(node)); - } else { - forEachChild(node, visit); - } - }); - return setOfExpressionsToReturn; -} -function isPromiseReturningCallExpression(node, checker, name) { - if (!isCallExpression(node)) return false; - const isExpressionOfName = hasPropertyAccessExpressionWithName(node, name); - const nodeType = isExpressionOfName && checker.getTypeAtLocation(node); - return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType)); -} -function isReferenceToType(type, target) { - return (getObjectFlags(type) & 4 /* Reference */) !== 0 && type.target === target; -} -function getExplicitPromisedTypeOfPromiseReturningCallExpression(node, callback, checker) { - if (node.expression.name.escapedText === "finally") { - return void 0; - } - const promiseType = checker.getTypeAtLocation(node.expression.expression); - if (isReferenceToType(promiseType, checker.getPromiseType()) || isReferenceToType(promiseType, checker.getPromiseLikeType())) { - if (node.expression.name.escapedText === "then") { - if (callback === elementAt(node.arguments, 0)) { - return elementAt(node.typeArguments, 0); - } else if (callback === elementAt(node.arguments, 1)) { - return elementAt(node.typeArguments, 1); - } - } else { - return elementAt(node.typeArguments, 0); - } - } -} -function isPromiseTypedExpression(node, checker) { - if (!isExpression(node)) return false; - return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node)); -} -function renameCollidingVarNames(nodeToRename, checker, synthNamesMap) { - const identsToRenameMap = /* @__PURE__ */ new Map(); - const collidingSymbolMap = createMultiMap(); - forEachChild(nodeToRename, function visit(node) { - if (!isIdentifier(node)) { - forEachChild(node, visit); - return; - } - const symbol = checker.getSymbolAtLocation(node); - if (symbol) { - const type = checker.getTypeAtLocation(node); - const lastCallSignature = getLastCallSignature(type, checker); - const symbolIdString = getSymbolId(symbol).toString(); - if (lastCallSignature && !isParameter(node.parent) && !isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { - const firstParameter = firstOrUndefined(lastCallSignature.parameters); - const ident = (firstParameter == null ? void 0 : firstParameter.valueDeclaration) && isParameter(firstParameter.valueDeclaration) && tryCast(firstParameter.valueDeclaration.name, isIdentifier) || factory.createUniqueName("result", 16 /* Optimistic */); - const synthName = getNewNameIfConflict(ident, collidingSymbolMap); - synthNamesMap.set(symbolIdString, synthName); - collidingSymbolMap.add(ident.text, symbol); - } else if (node.parent && (isParameter(node.parent) || isVariableDeclaration(node.parent) || isBindingElement(node.parent))) { - const originalName = node.text; - const collidingSymbols = collidingSymbolMap.get(originalName); - if (collidingSymbols && collidingSymbols.some((prevSymbol) => prevSymbol !== symbol)) { - const newName = getNewNameIfConflict(node, collidingSymbolMap); - identsToRenameMap.set(symbolIdString, newName.identifier); - synthNamesMap.set(symbolIdString, newName); - collidingSymbolMap.add(originalName, symbol); - } else { - const identifier = getSynthesizedDeepClone(node); - synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier)); - collidingSymbolMap.add(originalName, symbol); - } - } - } - }); - return getSynthesizedDeepCloneWithReplacements( - nodeToRename, - /*includeTrivia*/ - true, - (original) => { - if (isBindingElement(original) && isIdentifier(original.name) && isObjectBindingPattern(original.parent)) { - const symbol = checker.getSymbolAtLocation(original.name); - const renameInfo = symbol && identsToRenameMap.get(String(getSymbolId(symbol))); - if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) { - return factory.createBindingElement( - original.dotDotDotToken, - original.propertyName || original.name, - renameInfo, - original.initializer - ); - } - } else if (isIdentifier(original)) { - const symbol = checker.getSymbolAtLocation(original); - const renameInfo = symbol && identsToRenameMap.get(String(getSymbolId(symbol))); - if (renameInfo) { - return factory.createIdentifier(renameInfo.text); - } - } - } - ); -} -function getNewNameIfConflict(name, originalNames) { - const numVarsSameName = (originalNames.get(name.text) || emptyArray).length; - const identifier = numVarsSameName === 0 ? name : factory.createIdentifier(name.text + "_" + numVarsSameName); - return createSynthIdentifier(identifier); -} -function hasFailed() { - return !codeActionSucceeded; -} -function silentFail() { - codeActionSucceeded = false; - return emptyArray; -} -function transformExpression(returnContextNode, node, transformer, hasContinuation, continuationArgName) { - if (isPromiseReturningCallExpression(node, transformer.checker, "then")) { - return transformThen(node, elementAt(node.arguments, 0), elementAt(node.arguments, 1), transformer, hasContinuation, continuationArgName); - } - if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) { - return transformCatch(node, elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName); - } - if (isPromiseReturningCallExpression(node, transformer.checker, "finally")) { - return transformFinally(node, elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName); - } - if (isPropertyAccessExpression(node)) { - return transformExpression(returnContextNode, node.expression, transformer, hasContinuation, continuationArgName); - } - const nodeType = transformer.checker.getTypeAtLocation(node); - if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { - Debug.assertNode(getOriginalNode(node).parent, isPropertyAccessExpression); - return transformPromiseExpressionOfPropertyAccess(returnContextNode, node, transformer, hasContinuation, continuationArgName); - } - return silentFail(); -} -function isNullOrUndefined2({ checker }, node) { - if (node.kind === 106 /* NullKeyword */) return true; - if (isIdentifier(node) && !isGeneratedIdentifier(node) && idText(node) === "undefined") { - const symbol = checker.getSymbolAtLocation(node); - return !symbol || checker.isUndefinedSymbol(symbol); - } - return false; -} -function createUniqueSynthName(prevArgName) { - const renamedPrevArg = factory.createUniqueName(prevArgName.identifier.text, 16 /* Optimistic */); - return createSynthIdentifier(renamedPrevArg); -} -function getPossibleNameForVarDecl(node, transformer, continuationArgName) { - let possibleNameForVarDecl; - if (continuationArgName && !shouldReturn(node, transformer)) { - if (isSynthIdentifier(continuationArgName)) { - possibleNameForVarDecl = continuationArgName; - transformer.synthNamesMap.forEach((val, key) => { - if (val.identifier.text === continuationArgName.identifier.text) { - const newSynthName = createUniqueSynthName(continuationArgName); - transformer.synthNamesMap.set(key, newSynthName); - } - }); - } else { - possibleNameForVarDecl = createSynthIdentifier(factory.createUniqueName("result", 16 /* Optimistic */), continuationArgName.types); - } - declareSynthIdentifier(possibleNameForVarDecl); - } - return possibleNameForVarDecl; -} -function finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName) { - const statements = []; - let varDeclIdentifier; - if (possibleNameForVarDecl && !shouldReturn(node, transformer)) { - varDeclIdentifier = getSynthesizedDeepClone(declareSynthIdentifier(possibleNameForVarDecl)); - const typeArray = possibleNameForVarDecl.types; - const unionType = transformer.checker.getUnionType(typeArray, 2 /* Subtype */); - const unionTypeNode = transformer.isInJSFile ? void 0 : transformer.checker.typeToTypeNode( - unionType, - /*enclosingDeclaration*/ - void 0, - /*flags*/ - void 0 - ); - const varDecl = [factory.createVariableDeclaration( - varDeclIdentifier, - /*exclamationToken*/ - void 0, - unionTypeNode - )]; - const varDeclList = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList(varDecl, 1 /* Let */) - ); - statements.push(varDeclList); - } - statements.push(tryStatement); - if (continuationArgName && varDeclIdentifier && isSynthBindingPattern(continuationArgName)) { - statements.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - getSynthesizedDeepClone(declareSynthBindingPattern(continuationArgName)), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - varDeclIdentifier - ) - ], 2 /* Const */) - )); - } - return statements; -} -function transformFinally(node, onFinally, transformer, hasContinuation, continuationArgName) { - if (!onFinally || isNullOrUndefined2(transformer, onFinally)) { - return transformExpression( - /* returnContextNode */ - node, - node.expression.expression, - transformer, - hasContinuation, - continuationArgName - ); - } - const possibleNameForVarDecl = getPossibleNameForVarDecl(node, transformer, continuationArgName); - const inlinedLeftHandSide = transformExpression( - /*returnContextNode*/ - node, - node.expression.expression, - transformer, - /*hasContinuation*/ - true, - possibleNameForVarDecl - ); - if (hasFailed()) return silentFail(); - const inlinedCallback = transformCallbackArgument( - onFinally, - hasContinuation, - /*continuationArgName*/ - void 0, - /*inputArgName*/ - void 0, - node, - transformer - ); - if (hasFailed()) return silentFail(); - const tryBlock = factory.createBlock(inlinedLeftHandSide); - const finallyBlock = factory.createBlock(inlinedCallback); - const tryStatement = factory.createTryStatement( - tryBlock, - /*catchClause*/ - void 0, - finallyBlock - ); - return finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName); -} -function transformCatch(node, onRejected, transformer, hasContinuation, continuationArgName) { - if (!onRejected || isNullOrUndefined2(transformer, onRejected)) { - return transformExpression( - /* returnContextNode */ - node, - node.expression.expression, - transformer, - hasContinuation, - continuationArgName - ); - } - const inputArgName = getArgBindingName(onRejected, transformer); - const possibleNameForVarDecl = getPossibleNameForVarDecl(node, transformer, continuationArgName); - const inlinedLeftHandSide = transformExpression( - /*returnContextNode*/ - node, - node.expression.expression, - transformer, - /*hasContinuation*/ - true, - possibleNameForVarDecl - ); - if (hasFailed()) return silentFail(); - const inlinedCallback = transformCallbackArgument(onRejected, hasContinuation, possibleNameForVarDecl, inputArgName, node, transformer); - if (hasFailed()) return silentFail(); - const tryBlock = factory.createBlock(inlinedLeftHandSide); - const catchClause = factory.createCatchClause(inputArgName && getSynthesizedDeepClone(declareSynthBindingName(inputArgName)), factory.createBlock(inlinedCallback)); - const tryStatement = factory.createTryStatement( - tryBlock, - catchClause, - /*finallyBlock*/ - void 0 - ); - return finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName); -} -function transformThen(node, onFulfilled, onRejected, transformer, hasContinuation, continuationArgName) { - if (!onFulfilled || isNullOrUndefined2(transformer, onFulfilled)) { - return transformCatch(node, onRejected, transformer, hasContinuation, continuationArgName); - } - if (onRejected && !isNullOrUndefined2(transformer, onRejected)) { - return silentFail(); - } - const inputArgName = getArgBindingName(onFulfilled, transformer); - const inlinedLeftHandSide = transformExpression( - node.expression.expression, - node.expression.expression, - transformer, - /*hasContinuation*/ - true, - inputArgName - ); - if (hasFailed()) return silentFail(); - const inlinedCallback = transformCallbackArgument(onFulfilled, hasContinuation, continuationArgName, inputArgName, node, transformer); - if (hasFailed()) return silentFail(); - return concatenate(inlinedLeftHandSide, inlinedCallback); -} -function transformPromiseExpressionOfPropertyAccess(returnContextNode, node, transformer, hasContinuation, continuationArgName) { - if (shouldReturn(returnContextNode, transformer)) { - let returnValue = getSynthesizedDeepClone(node); - if (hasContinuation) { - returnValue = factory.createAwaitExpression(returnValue); - } - return [factory.createReturnStatement(returnValue)]; - } - return createVariableOrAssignmentOrExpressionStatement( - continuationArgName, - factory.createAwaitExpression(node), - /*typeAnnotation*/ - void 0 - ); -} -function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide, typeAnnotation) { - if (!variableName || isEmptyBindingName(variableName)) { - return [factory.createExpressionStatement(rightHandSide)]; - } - if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) { - return [factory.createExpressionStatement(factory.createAssignment(getSynthesizedDeepClone(referenceSynthIdentifier(variableName)), rightHandSide))]; - } - return [ - factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - getSynthesizedDeepClone(declareSynthBindingName(variableName)), - /*exclamationToken*/ - void 0, - typeAnnotation, - rightHandSide - ) - ], 2 /* Const */) - ) - ]; -} -function maybeAnnotateAndReturn(expressionToReturn, typeAnnotation) { - if (typeAnnotation && expressionToReturn) { - const name = factory.createUniqueName("result", 16 /* Optimistic */); - return [ - ...createVariableOrAssignmentOrExpressionStatement(createSynthIdentifier(name), expressionToReturn, typeAnnotation), - factory.createReturnStatement(name) - ]; - } - return [factory.createReturnStatement(expressionToReturn)]; -} -function transformCallbackArgument(func, hasContinuation, continuationArgName, inputArgName, parent2, transformer) { - var _a; - switch (func.kind) { - case 106 /* NullKeyword */: - break; - case 212 /* PropertyAccessExpression */: - case 80 /* Identifier */: - if (!inputArgName) { - break; - } - const synthCall = factory.createCallExpression( - getSynthesizedDeepClone(func), - /*typeArguments*/ - void 0, - isSynthIdentifier(inputArgName) ? [referenceSynthIdentifier(inputArgName)] : [] - ); - if (shouldReturn(parent2, transformer)) { - return maybeAnnotateAndReturn(synthCall, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker)); - } - const type = transformer.checker.getTypeAtLocation(func); - const callSignatures = transformer.checker.getSignaturesOfType(type, 0 /* Call */); - if (!callSignatures.length) { - return silentFail(); - } - const returnType = callSignatures[0].getReturnType(); - const varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(continuationArgName, factory.createAwaitExpression(synthCall), getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker)); - if (continuationArgName) { - continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType); - } - return varDeclOrAssignment; - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: { - const funcBody = func.body; - const returnType2 = (_a = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a.getReturnType(); - if (isBlock(funcBody)) { - let refactoredStmts = []; - let seenReturnStatement = false; - for (const statement of funcBody.statements) { - if (isReturnStatement(statement)) { - seenReturnStatement = true; - if (isReturnStatementWithFixablePromiseHandler(statement, transformer.checker)) { - refactoredStmts = refactoredStmts.concat(transformReturnStatementWithFixablePromiseHandler(transformer, statement, hasContinuation, continuationArgName)); - } else { - const possiblyAwaitedRightHandSide = returnType2 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType2, statement.expression) : statement.expression; - refactoredStmts.push(...maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker))); - } - } else if (hasContinuation && forEachReturnStatement(statement, returnTrue)) { - return silentFail(); - } else { - refactoredStmts.push(statement); - } - } - return shouldReturn(parent2, transformer) ? refactoredStmts.map((s) => getSynthesizedDeepClone(s)) : removeReturns( - refactoredStmts, - continuationArgName, - transformer, - seenReturnStatement - ); - } else { - const inlinedStatements = isFixablePromiseHandler(funcBody, transformer.checker) ? transformReturnStatementWithFixablePromiseHandler(transformer, factory.createReturnStatement(funcBody), hasContinuation, continuationArgName) : emptyArray; - if (inlinedStatements.length > 0) { - return inlinedStatements; - } - if (returnType2) { - const possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType2, funcBody); - if (!shouldReturn(parent2, transformer)) { - const transformedStatement = createVariableOrAssignmentOrExpressionStatement( - continuationArgName, - possiblyAwaitedRightHandSide, - /*typeAnnotation*/ - void 0 - ); - if (continuationArgName) { - continuationArgName.types.push(transformer.checker.getAwaitedType(returnType2) || returnType2); - } - return transformedStatement; - } else { - return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker)); - } - } else { - return silentFail(); - } - } - } - default: - return silentFail(); - } - return emptyArray; -} -function getPossiblyAwaitedRightHandSide(checker, type, expr) { - const rightHandSide = getSynthesizedDeepClone(expr); - return !!checker.getPromisedTypeOfPromise(type) ? factory.createAwaitExpression(rightHandSide) : rightHandSide; -} -function getLastCallSignature(type, checker) { - const callSignatures = checker.getSignaturesOfType(type, 0 /* Call */); - return lastOrUndefined(callSignatures); -} -function removeReturns(stmts, prevArgName, transformer, seenReturnStatement) { - const ret = []; - for (const stmt of stmts) { - if (isReturnStatement(stmt)) { - if (stmt.expression) { - const possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? factory.createAwaitExpression(stmt.expression) : stmt.expression; - if (prevArgName === void 0) { - ret.push(factory.createExpressionStatement(possiblyAwaitedExpression)); - } else if (isSynthIdentifier(prevArgName) && prevArgName.hasBeenDeclared) { - ret.push(factory.createExpressionStatement(factory.createAssignment(referenceSynthIdentifier(prevArgName), possiblyAwaitedExpression))); - } else { - ret.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([factory.createVariableDeclaration( - declareSynthBindingName(prevArgName), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - possiblyAwaitedExpression - )], 2 /* Const */) - )); - } - } - } else { - ret.push(getSynthesizedDeepClone(stmt)); - } - } - if (!seenReturnStatement && prevArgName !== void 0) { - ret.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([factory.createVariableDeclaration( - declareSynthBindingName(prevArgName), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - factory.createIdentifier("undefined") - )], 2 /* Const */) - )); - } - return ret; -} -function transformReturnStatementWithFixablePromiseHandler(transformer, innerRetStmt, hasContinuation, continuationArgName) { - let innerCbBody = []; - forEachChild(innerRetStmt, function visit(node) { - if (isCallExpression(node)) { - const temp = transformExpression(node, node, transformer, hasContinuation, continuationArgName); - innerCbBody = innerCbBody.concat(temp); - if (innerCbBody.length > 0) { - return; - } - } else if (!isFunctionLike(node)) { - forEachChild(node, visit); - } - }); - return innerCbBody; -} -function getArgBindingName(funcNode, transformer) { - const types = []; - let name; - if (isFunctionLikeDeclaration(funcNode)) { - if (funcNode.parameters.length > 0) { - const param = funcNode.parameters[0].name; - name = getMappedBindingNameOrDefault(param); - } - } else if (isIdentifier(funcNode)) { - name = getMapEntryOrDefault(funcNode); - } else if (isPropertyAccessExpression(funcNode) && isIdentifier(funcNode.name)) { - name = getMapEntryOrDefault(funcNode.name); - } - if (!name || "identifier" in name && name.identifier.text === "undefined") { - return void 0; - } - return name; - function getMappedBindingNameOrDefault(bindingName) { - if (isIdentifier(bindingName)) return getMapEntryOrDefault(bindingName); - const elements = flatMap(bindingName.elements, (element) => { - if (isOmittedExpression(element)) return []; - return [getMappedBindingNameOrDefault(element.name)]; - }); - return createSynthBindingPattern(bindingName, elements); - } - function getMapEntryOrDefault(identifier) { - const originalNode = getOriginalNode2(identifier); - const symbol = getSymbol2(originalNode); - if (!symbol) { - return createSynthIdentifier(identifier, types); - } - const mapEntry = transformer.synthNamesMap.get(getSymbolId(symbol).toString()); - return mapEntry || createSynthIdentifier(identifier, types); - } - function getSymbol2(node) { - var _a; - return ((_a = tryCast(node, canHaveSymbol)) == null ? void 0 : _a.symbol) ?? transformer.checker.getSymbolAtLocation(node); - } - function getOriginalNode2(node) { - return node.original ? node.original : node; - } -} -function isEmptyBindingName(bindingName) { - if (!bindingName) { - return true; - } - if (isSynthIdentifier(bindingName)) { - return !bindingName.identifier.text; - } - return every(bindingName.elements, isEmptyBindingName); -} -function createSynthIdentifier(identifier, types = []) { - return { kind: 0 /* Identifier */, identifier, types, hasBeenDeclared: false, hasBeenReferenced: false }; -} -function createSynthBindingPattern(bindingPattern, elements = emptyArray, types = []) { - return { kind: 1 /* BindingPattern */, bindingPattern, elements, types }; -} -function referenceSynthIdentifier(synthId) { - synthId.hasBeenReferenced = true; - return synthId.identifier; -} -function declareSynthBindingName(synthName) { - return isSynthIdentifier(synthName) ? declareSynthIdentifier(synthName) : declareSynthBindingPattern(synthName); -} -function declareSynthBindingPattern(synthPattern) { - for (const element of synthPattern.elements) { - declareSynthBindingName(element); - } - return synthPattern.bindingPattern; -} -function declareSynthIdentifier(synthId) { - synthId.hasBeenDeclared = true; - return synthId.identifier; -} -function isSynthIdentifier(bindingName) { - return bindingName.kind === 0 /* Identifier */; -} -function isSynthBindingPattern(bindingName) { - return bindingName.kind === 1 /* BindingPattern */; -} -function shouldReturn(expression, transformer) { - return !!expression.original && transformer.setOfExpressionsToReturn.has(getNodeId(expression.original)); -} - -// src/services/codefixes/convertToEsModule.ts -registerCodeFix({ - errorCodes: [Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code], - getCodeActions(context) { - const { sourceFile, program, preferences } = context; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - const moduleExportsChangedToDefault = convertFileToEsModule(sourceFile, program.getTypeChecker(), changes2, getEmitScriptTarget(program.getCompilerOptions()), getQuotePreference(sourceFile, preferences)); - if (moduleExportsChangedToDefault) { - for (const importingFile of program.getSourceFiles()) { - fixImportOfModuleExports(importingFile, sourceFile, program, changes2, getQuotePreference(importingFile, preferences)); - } - } - }); - return [createCodeFixActionWithoutFixAll("convertToEsModule", changes, Diagnostics.Convert_to_ES_module)]; - } -}); -function fixImportOfModuleExports(importingFile, exportingFile, program, changes, quotePreference) { - var _a; - for (const moduleSpecifier of importingFile.imports) { - const imported = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, importingFile)) == null ? void 0 : _a.resolvedModule; - if (!imported || imported.resolvedFileName !== exportingFile.fileName) { - continue; - } - const importNode = importFromModuleSpecifier(moduleSpecifier); - switch (importNode.kind) { - case 272 /* ImportEqualsDeclaration */: - changes.replaceNode(importingFile, importNode, makeImport( - importNode.name, - /*namedImports*/ - void 0, - moduleSpecifier, - quotePreference - )); - break; - case 214 /* CallExpression */: - if (isRequireCall( - importNode, - /*requireStringLiteralLikeArgument*/ - false - )) { - changes.replaceNode(importingFile, importNode, factory.createPropertyAccessExpression(getSynthesizedDeepClone(importNode), "default")); - } - break; - } - } -} -function convertFileToEsModule(sourceFile, checker, changes, target, quotePreference) { - const identifiers = { original: collectFreeIdentifiers(sourceFile), additional: /* @__PURE__ */ new Set() }; - const exports2 = collectExportRenames(sourceFile, checker, identifiers); - convertExportsAccesses(sourceFile, exports2, changes); - let moduleExportsChangedToDefault = false; - let useSitesToUnqualify; - for (const statement of filter(sourceFile.statements, isVariableStatement)) { - const newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); - if (newUseSites) { - copyEntries(newUseSites, useSitesToUnqualify ?? (useSitesToUnqualify = /* @__PURE__ */ new Map())); - } - } - for (const statement of filter(sourceFile.statements, (s) => !isVariableStatement(s))) { - const moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports2, useSitesToUnqualify, quotePreference); - moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; - } - useSitesToUnqualify == null ? void 0 : useSitesToUnqualify.forEach((replacement, original) => { - changes.replaceNode(sourceFile, original, replacement); - }); - return moduleExportsChangedToDefault; -} -function collectExportRenames(sourceFile, checker, identifiers) { - const res = /* @__PURE__ */ new Map(); - forEachExportReference(sourceFile, (node) => { - const { text } = node.name; - if (!res.has(text) && (isIdentifierANonContextualKeyword(node.name) || checker.resolveName( - text, - node, - 111551 /* Value */, - /*excludeGlobals*/ - true - ))) { - res.set(text, makeUniqueName(`_${text}`, identifiers)); - } - }); - return res; -} -function convertExportsAccesses(sourceFile, exports2, changes) { - forEachExportReference(sourceFile, (node, isAssignmentLhs) => { - if (isAssignmentLhs) { - return; - } - const { text } = node.name; - changes.replaceNode(sourceFile, node, factory.createIdentifier(exports2.get(text) || text)); - }); -} -function forEachExportReference(sourceFile, cb) { - sourceFile.forEachChild(function recur(node) { - if (isPropertyAccessExpression(node) && isExportsOrModuleExportsOrAlias(sourceFile, node.expression) && isIdentifier(node.name)) { - const { parent: parent2 } = node; - cb(node, isBinaryExpression(parent2) && parent2.left === node && parent2.operatorToken.kind === 64 /* EqualsToken */); - } - node.forEachChild(recur); - }); -} -function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports2, useSitesToUnqualify, quotePreference) { - switch (statement.kind) { - case 244 /* VariableStatement */: - convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); - return false; - case 245 /* ExpressionStatement */: { - const { expression } = statement; - switch (expression.kind) { - case 214 /* CallExpression */: { - if (isRequireCall( - expression, - /*requireStringLiteralLikeArgument*/ - true - )) { - changes.replaceNode(sourceFile, statement, makeImport( - /*defaultImport*/ - void 0, - /*namedImports*/ - void 0, - expression.arguments[0], - quotePreference - )); - } - return false; - } - case 227 /* BinaryExpression */: { - const { operatorToken } = expression; - return operatorToken.kind === 64 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports2, useSitesToUnqualify); - } - } - } - // falls through - default: - return false; - } -} -function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) { - const { declarationList } = statement; - let foundImport = false; - const converted = map(declarationList.declarations, (decl) => { - const { name, initializer } = decl; - if (initializer) { - if (isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { - foundImport = true; - return convertedImports([]); - } else if (isRequireCall( - initializer, - /*requireStringLiteralLikeArgument*/ - true - )) { - foundImport = true; - return convertSingleImport(name, initializer.arguments[0], checker, identifiers, target, quotePreference); - } else if (isPropertyAccessExpression(initializer) && isRequireCall( - initializer.expression, - /*requireStringLiteralLikeArgument*/ - true - )) { - foundImport = true; - return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0], identifiers, quotePreference); - } - } - return convertedImports([factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([decl], declarationList.flags) - )]); - }); - if (foundImport) { - changes.replaceNodeWithNodes(sourceFile, statement, flatMap(converted, (c) => c.newImports)); - let combinedUseSites; - forEach(converted, (c) => { - if (c.useSitesToUnqualify) { - copyEntries(c.useSitesToUnqualify, combinedUseSites ?? (combinedUseSites = /* @__PURE__ */ new Map())); - } - }); - return combinedUseSites; - } -} -function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { - switch (name.kind) { - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: { - const tmp = makeUniqueName(propertyName, identifiers); - return convertedImports([ - makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), - makeConst( - /*modifiers*/ - void 0, - name, - factory.createIdentifier(tmp) - ) - ]); - } - case 80 /* Identifier */: - return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]); - default: - return Debug.assertNever(name, `Convert to ES module got invalid syntax form ${name.kind}`); - } -} -function convertAssignment(sourceFile, checker, assignment, changes, exports2, useSitesToUnqualify) { - const { left, right } = assignment; - if (!isPropertyAccessExpression(left)) { - return false; - } - if (isExportsOrModuleExportsOrAlias(sourceFile, left)) { - if (isExportsOrModuleExportsOrAlias(sourceFile, right)) { - changes.delete(sourceFile, assignment.parent); - } else { - const replacement = isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify) : isRequireCall( - right, - /*requireStringLiteralLikeArgument*/ - true - ) ? convertReExportAll(right.arguments[0], checker) : void 0; - if (replacement) { - changes.replaceNodeWithNodes(sourceFile, assignment.parent, replacement[0]); - return replacement[1]; - } else { - changes.replaceRangeWithText(sourceFile, createRange(left.getStart(sourceFile), right.pos), "export default"); - return true; - } - } - } else if (isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { - convertNamedExport(sourceFile, assignment, changes, exports2); - } - return false; -} -function tryChangeModuleExportsObject(object, useSitesToUnqualify) { - const statements = mapAllOrFail(object.properties, (prop) => { - switch (prop.kind) { - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. - // falls through - case 305 /* ShorthandPropertyAssignment */: - case 306 /* SpreadAssignment */: - return void 0; - case 304 /* PropertyAssignment */: - return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 175 /* 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}`); - } - }); - return statements && [statements, false]; -} -function convertNamedExport(sourceFile, assignment, changes, exports2) { - const { text } = assignment.left.name; - const rename = exports2.get(text); - if (rename !== void 0) { - const newNodes = [ - makeConst( - /*modifiers*/ - void 0, - rename, - assignment.right - ), - makeExportDeclaration([factory.createExportSpecifier( - /*isTypeOnly*/ - false, - rename, - text - )]) - ]; - changes.replaceNodeWithNodes(sourceFile, assignment.parent, newNodes); - } else { - convertExportsPropertyAssignment(assignment, sourceFile, changes); - } -} -function convertReExportAll(reExported, checker) { - const moduleSpecifier = reExported.text; - const moduleSymbol = checker.getSymbolAtLocation(reExported); - const exports2 = moduleSymbol ? moduleSymbol.exports : emptyMap; - return exports2.has("export=" /* ExportEquals */) ? [[reExportDefault(moduleSpecifier)], true] : !exports2.has("default" /* Default */) ? [[reExportStar(moduleSpecifier)], false] : ( - // If there's some non-default export, must include both `export *` and `export default`. - exports2.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true] - ); -} -function reExportStar(moduleSpecifier) { - return makeExportDeclaration( - /*exportSpecifiers*/ - void 0, - moduleSpecifier - ); -} -function reExportDefault(moduleSpecifier) { - return makeExportDeclaration([factory.createExportSpecifier( - /*isTypeOnly*/ - false, - /*propertyName*/ - void 0, - "default" - )], moduleSpecifier); -} -function convertExportsPropertyAssignment({ left, right, parent: parent2 }, sourceFile, changes) { - const name = left.name.text; - if ((isFunctionExpression(right) || isArrowFunction(right) || isClassExpression(right)) && (!right.name || right.name.text === name)) { - changes.replaceRange(sourceFile, { pos: left.getStart(sourceFile), end: right.getStart(sourceFile) }, factory.createToken(95 /* ExportKeyword */), { suffix: " " }); - if (!right.name) changes.insertName(sourceFile, right, name); - const semi = findChildOfKind(parent2, 27 /* SemicolonToken */, sourceFile); - 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: " " }); - } -} -function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { - const modifiers = [factory.createToken(95 /* ExportKeyword */)]; - switch (exported.kind) { - case 219 /* FunctionExpression */: { - const { name: expressionName } = exported; - if (expressionName && expressionName.text !== name) { - return exportConst(); - } - } - // falls through - case 220 /* ArrowFunction */: - return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 232 /* ClassExpression */: - return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - default: - return exportConst(); - } - function exportConst() { - return makeConst(modifiers, factory.createIdentifier(name), replaceImportUseSites(exported, useSitesToUnqualify)); - } -} -function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { - if (!useSitesToUnqualify || !some(arrayFrom(useSitesToUnqualify.keys()), (original) => rangeContainsRange(nodeOrNodes, original))) { - return nodeOrNodes; - } - return isArray(nodeOrNodes) ? getSynthesizedDeepClonesWithReplacements( - nodeOrNodes, - /*includeTrivia*/ - true, - replaceNode - ) : getSynthesizedDeepCloneWithReplacements( - nodeOrNodes, - /*includeTrivia*/ - true, - replaceNode - ); - function replaceNode(original) { - if (original.kind === 212 /* PropertyAccessExpression */) { - const replacement = useSitesToUnqualify.get(original); - useSitesToUnqualify.delete(original); - return replacement; - } - } -} -function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { - switch (name.kind) { - case 207 /* 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( - /*defaultImport*/ - void 0, - importSpecifiers, - moduleSpecifier, - quotePreference - )]); - } - } - // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 208 /* ArrayBindingPattern */: { - const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); - return convertedImports([ - makeImport( - factory.createIdentifier(tmp), - /*namedImports*/ - void 0, - moduleSpecifier, - quotePreference - ), - makeConst( - /*modifiers*/ - void 0, - getSynthesizedDeepClone(name), - factory.createIdentifier(tmp) - ) - ]); - } - case 80 /* Identifier */: - return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference); - default: - return Debug.assertNever(name, `Convert to ES module got invalid name kind ${name.kind}`); - } -} -function convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference) { - const nameSymbol = checker.getSymbolAtLocation(name); - const namedBindingsNames = /* @__PURE__ */ new Map(); - let needDefaultImport = false; - let useSitesToUnqualify; - for (const use of identifiers.original.get(name.text)) { - if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { - continue; - } - const { parent: parent2 } = use; - if (isPropertyAccessExpression(parent2)) { - const { name: { text: propertyName } } = parent2; - if (propertyName === "default") { - needDefaultImport = true; - const importDefaultName = use.getText(); - (useSitesToUnqualify ?? (useSitesToUnqualify = /* @__PURE__ */ new Map())).set(parent2, factory.createIdentifier(importDefaultName)); - } else { - Debug.assert(parent2.expression === use, "Didn't expect expression === use"); - let idName = namedBindingsNames.get(propertyName); - if (idName === void 0) { - idName = makeUniqueName(propertyName, identifiers); - namedBindingsNames.set(propertyName, idName); - } - (useSitesToUnqualify ?? (useSitesToUnqualify = /* @__PURE__ */ new Map())).set(parent2, factory.createIdentifier(idName)); - } - } else { - needDefaultImport = true; - } - } - const namedBindings = namedBindingsNames.size === 0 ? void 0 : arrayFrom(mapIterator(namedBindingsNames.entries(), ([propertyName, idName]) => factory.createImportSpecifier( - /*isTypeOnly*/ - false, - propertyName === idName ? void 0 : factory.createIdentifier(propertyName), - factory.createIdentifier(idName) - ))); - if (!namedBindings) { - needDefaultImport = true; - } - return convertedImports( - [makeImport(needDefaultImport ? getSynthesizedDeepClone(name) : void 0, namedBindings, moduleSpecifier, quotePreference)], - useSitesToUnqualify - ); -} -function makeUniqueName(name, identifiers) { - while (identifiers.original.has(name) || identifiers.additional.has(name)) { - name = `_${name}`; - } - identifiers.additional.add(name); - return name; -} -function collectFreeIdentifiers(file) { - const map2 = createMultiMap(); - forEachFreeIdentifier(file, (id) => map2.add(id.text, id)); - return map2; -} -function forEachFreeIdentifier(node, cb) { - if (isIdentifier(node) && isFreeIdentifier(node)) cb(node); - node.forEachChild((child) => forEachFreeIdentifier(child, cb)); -} -function isFreeIdentifier(node) { - const { parent: parent2 } = node; - switch (parent2.kind) { - case 212 /* PropertyAccessExpression */: - return parent2.name !== node; - case 209 /* BindingElement */: - return parent2.propertyName !== node; - case 277 /* ImportSpecifier */: - return parent2.propertyName !== node; - default: - return true; - } -} -function functionExpressionToDeclaration(name, additionalModifiers, fn, useSitesToUnqualify) { - return factory.createFunctionDeclaration( - concatenate(additionalModifiers, getSynthesizedDeepClones(fn.modifiers)), - getSynthesizedDeepClone(fn.asteriskToken), - name, - getSynthesizedDeepClones(fn.typeParameters), - getSynthesizedDeepClones(fn.parameters), - getSynthesizedDeepClone(fn.type), - factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify)) - ); -} -function classExpressionToDeclaration(name, additionalModifiers, cls, useSitesToUnqualify) { - return factory.createClassDeclaration( - concatenate(additionalModifiers, getSynthesizedDeepClones(cls.modifiers)), - name, - getSynthesizedDeepClones(cls.typeParameters), - getSynthesizedDeepClones(cls.heritageClauses), - replaceImportUseSites(cls.members, useSitesToUnqualify) - ); -} -function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) { - return propertyName === "default" ? makeImport( - factory.createIdentifier(localName), - /*namedImports*/ - void 0, - moduleSpecifier, - quotePreference - ) : makeImport( - /*defaultImport*/ - void 0, - [makeImportSpecifier2(propertyName, localName)], - moduleSpecifier, - quotePreference - ); -} -function makeImportSpecifier2(propertyName, name) { - return factory.createImportSpecifier( - /*isTypeOnly*/ - false, - propertyName !== void 0 && propertyName !== name ? factory.createIdentifier(propertyName) : void 0, - factory.createIdentifier(name) - ); -} -function makeConst(modifiers, name, init) { - return factory.createVariableStatement( - modifiers, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - init - )], - 2 /* Const */ - ) - ); -} -function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { - return factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - exportSpecifiers && factory.createNamedExports(exportSpecifiers), - moduleSpecifier === void 0 ? void 0 : factory.createStringLiteral(moduleSpecifier) - ); -} -function convertedImports(newImports, useSitesToUnqualify) { - return { - newImports, - useSitesToUnqualify - }; -} - -// src/services/codefixes/correctQualifiedNameToIndexedAccessType.ts -var fixId12 = "correctQualifiedNameToIndexedAccessType"; -var errorCodes13 = [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.code]; -registerCodeFix({ - errorCodes: errorCodes13, - getCodeActions(context) { - const qualifiedName = getQualifiedName(context.sourceFile, context.span.start); - if (!qualifiedName) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange10(t, context.sourceFile, qualifiedName)); - const newText = `${qualifiedName.left.text}["${qualifiedName.right.text}"]`; - return [createCodeFixAction(fixId12, changes, [Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId12, Diagnostics.Rewrite_all_as_indexed_access_types)]; - }, - fixIds: [fixId12], - getAllCodeActions: (context) => codeFixAll(context, errorCodes13, (changes, diag2) => { - const q = getQualifiedName(diag2.file, diag2.start); - if (q) { - doChange10(changes, diag2.file, q); - } - }) -}); -function getQualifiedName(sourceFile, pos) { - const qualifiedName = findAncestor(getTokenAtPosition(sourceFile, pos), isQualifiedName); - Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); - return isIdentifier(qualifiedName.left) ? qualifiedName : void 0; -} -function doChange10(changeTracker, sourceFile, qualifiedName) { - const rightText = qualifiedName.right.text; - const replacement = factory.createIndexedAccessTypeNode( - factory.createTypeReferenceNode( - qualifiedName.left, - /*typeArguments*/ - void 0 - ), - factory.createLiteralTypeNode(factory.createStringLiteral(rightText)) - ); - changeTracker.replaceNode(sourceFile, qualifiedName, replacement); -} - -// src/services/codefixes/convertToTypeOnlyExport.ts -var errorCodes14 = [Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code]; -var fixId13 = "convertToTypeOnlyExport"; -registerCodeFix({ - errorCodes: errorCodes14, - getCodeActions: function getCodeActionsToConvertToTypeOnlyExport(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => fixSingleExportDeclaration(t, getExportSpecifierForDiagnosticSpan(context.span, context.sourceFile), context)); - if (changes.length) { - return [createCodeFixAction(fixId13, changes, Diagnostics.Convert_to_type_only_export, fixId13, Diagnostics.Convert_all_re_exported_types_to_type_only_exports)]; - } - }, - fixIds: [fixId13], - getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyExport(context) { - const fixedExportDeclarations = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes14, (changes, diag2) => { - const exportSpecifier = getExportSpecifierForDiagnosticSpan(diag2, context.sourceFile); - if (exportSpecifier && addToSeen(fixedExportDeclarations, getNodeId(exportSpecifier.parent.parent))) { - fixSingleExportDeclaration(changes, exportSpecifier, context); - } - }); - } -}); -function getExportSpecifierForDiagnosticSpan(span, sourceFile) { - return tryCast(getTokenAtPosition(sourceFile, span.start).parent, isExportSpecifier); -} -function fixSingleExportDeclaration(changes, exportSpecifier, context) { - if (!exportSpecifier) { - return; - } - const exportClause = exportSpecifier.parent; - const exportDeclaration = exportClause.parent; - const typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context); - if (typeExportSpecifiers.length === exportClause.elements.length) { - changes.insertModifierBefore(context.sourceFile, 156 /* TypeKeyword */, exportClause); - } else { - const valueExportDeclaration = factory.updateExportDeclaration( - exportDeclaration, - exportDeclaration.modifiers, - /*isTypeOnly*/ - false, - factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))), - exportDeclaration.moduleSpecifier, - /*attributes*/ - void 0 - ); - const typeExportDeclaration = factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - true, - factory.createNamedExports(typeExportSpecifiers), - exportDeclaration.moduleSpecifier, - /*attributes*/ - void 0 - ); - changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, { - leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude - }); - changes.insertNodeAfter(context.sourceFile, exportDeclaration, typeExportDeclaration); - } -} -function getTypeExportSpecifiers(originExportSpecifier, context) { - const exportClause = originExportSpecifier.parent; - if (exportClause.elements.length === 1) { - return exportClause.elements; - } - const diagnostics = getDiagnosticsWithinSpan( - createTextSpanFromNode(exportClause), - context.program.getSemanticDiagnostics(context.sourceFile, context.cancellationToken) - ); - return filter(exportClause.elements, (element) => { - var _a; - return element === originExportSpecifier || ((_a = findDiagnosticForNode(element, diagnostics)) == null ? void 0 : _a.code) === errorCodes14[0]; - }); -} - -// src/services/codefixes/convertToTypeOnlyImport.ts -var errorCodes15 = [ - 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 -]; -var fixId14 = "convertToTypeOnlyImport"; -registerCodeFix({ - errorCodes: errorCodes15, - 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)); - const importDeclarationChanges = declaration.kind === 277 /* ImportSpecifier */ && isImportDeclaration(declaration.parent.parent.parent) && 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( - fixId14, - changes, - declaration.kind === 277 /* ImportSpecifier */ ? [Diagnostics.Use_type_0, ((_a = declaration.propertyName) == null ? void 0 : _a.text) ?? declaration.name.text] : Diagnostics.Use_import_type, - fixId14, - Diagnostics.Fix_all_with_type_only_imports - ); - if (some(importDeclarationChanges)) { - return [ - createCodeFixActionWithoutFixAll(fixId14, importDeclarationChanges, Diagnostics.Use_import_type), - mainAction - ]; - } - return [mainAction]; - } - return void 0; - }, - fixIds: [fixId14], - getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) { - const fixedImportDeclarations = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes15, (changes, diag2) => { - const errorDeclaration = getDeclaration2(diag2.file, diag2.start); - if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 273 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) { - doChange11(changes, diag2.file, errorDeclaration); - fixedImportDeclarations.add(errorDeclaration); - } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 277 /* ImportSpecifier */ && isImportDeclaration(errorDeclaration.parent.parent.parent) && !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) === 277 /* ImportSpecifier */) { - doChange11(changes, diag2.file, errorDeclaration); - } - }); - } -}); -function getDeclaration2(sourceFile, pos) { - 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) => { - const symbol = checker.getSymbolAtLocation(usage); - return !!symbol && checker.symbolIsValue(symbol) || !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, - /*isTypeOnly*/ - true, - declaration.propertyName, - declaration.name - )); - } else { - const importClause = declaration.importClause; - if (importClause.name && importClause.namedBindings) { - changes.replaceNodeWithNodes(sourceFile, declaration, [ - factory.createImportDeclaration( - getSynthesizedDeepClones( - declaration.modifiers, - /*includeTrivia*/ - true - ), - factory.createImportClause( - 156 /* TypeKeyword */, - getSynthesizedDeepClone( - importClause.name, - /*includeTrivia*/ - true - ), - /*namedBindings*/ - void 0 - ), - getSynthesizedDeepClone( - declaration.moduleSpecifier, - /*includeTrivia*/ - true - ), - getSynthesizedDeepClone( - declaration.attributes, - /*includeTrivia*/ - true - ) - ), - factory.createImportDeclaration( - getSynthesizedDeepClones( - declaration.modifiers, - /*includeTrivia*/ - true - ), - factory.createImportClause( - 156 /* TypeKeyword */, - /*name*/ - void 0, - getSynthesizedDeepClone( - importClause.namedBindings, - /*includeTrivia*/ - true - ) - ), - getSynthesizedDeepClone( - declaration.moduleSpecifier, - /*includeTrivia*/ - true - ), - getSynthesizedDeepClone( - declaration.attributes, - /*includeTrivia*/ - true - ) - ) - ]); - } else { - const newNamedBindings = ((_a = importClause.namedBindings) == null ? void 0 : _a.kind) === 276 /* NamedImports */ ? factory.updateNamedImports( - importClause.namedBindings, - sameMap(importClause.namedBindings.elements, (e) => factory.updateImportSpecifier( - e, - /*isTypeOnly*/ - false, - e.propertyName, - e.name - )) - ) : importClause.namedBindings; - const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause(importClause, 156 /* TypeKeyword */, importClause.name, newNamedBindings), declaration.moduleSpecifier, declaration.attributes); - changes.replaceNode(sourceFile, declaration, importDeclaration); - } - } -} - -// src/services/codefixes/convertTypedefToType.ts -var fixId15 = "convertTypedefToType"; -var errorCodes16 = [Diagnostics.JSDoc_typedef_may_be_converted_to_TypeScript_type.code]; -registerCodeFix({ - fixIds: [fixId15], - errorCodes: errorCodes16, - 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, newLineCharacter)); - if (changes.length > 0) { - return [ - createCodeFixAction( - fixId15, - changes, - Diagnostics.Convert_typedef_to_TypeScript_type, - fixId15, - Diagnostics.Convert_all_typedef_to_TypeScript_types - ) - ]; - } - }, - getAllCodeActions: (context) => codeFixAll( - context, - errorCodes16, - (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); - } - ) -}); -function doChange12(changes, node, sourceFile, newLine, fixAll = false) { - if (!isJSDocTypedefTag(node)) return; - const declaration = createDeclaration(node); - if (!declaration) return; - 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]/.test(comment.substring(i - 1, i))) { - return from + i; - } - } - return to; -} -function createDeclaration(tag) { - var _a; - const { typeExpression } = tag; - if (!typeExpression) return; - const typeName = (_a = tag.name) == null ? void 0 : _a.getText(); - if (!typeName) return; - if (typeExpression.kind === 323 /* JSDocTypeLiteral */) { - return createInterfaceForTypeLiteral(typeName, typeExpression); - } - if (typeExpression.kind === 310 /* JSDocTypeExpression */) { - return createTypeAliasForTypeExpression(typeName, typeExpression); - } -} -function createInterfaceForTypeLiteral(typeName, typeLiteral) { - const propertySignatures = createSignatureFromTypeLiteral(typeLiteral); - if (!some(propertySignatures)) return; - return factory.createInterfaceDeclaration( - /*modifiers*/ - void 0, - typeName, - /*typeParameters*/ - void 0, - /*heritageClauses*/ - void 0, - propertySignatures - ); -} -function createTypeAliasForTypeExpression(typeName, typeExpression) { - const typeReference = getSynthesizedDeepClone(typeExpression.type); - if (!typeReference) return; - return factory.createTypeAliasDeclaration( - /*modifiers*/ - void 0, - factory.createIdentifier(typeName), - /*typeParameters*/ - void 0, - typeReference - ); -} -function createSignatureFromTypeLiteral(typeLiteral) { - const propertyTags = typeLiteral.jsDocPropertyTags; - if (!some(propertyTags)) return; - const getSignature = (tag) => { - var _a; - const name = getPropertyName(tag); - const type = (_a = tag.typeExpression) == null ? void 0 : _a.type; - const isOptional = tag.isBracketed; - let typeReference; - if (type && isJSDocTypeLiteral(type)) { - const signatures = createSignatureFromTypeLiteral(type); - typeReference = factory.createTypeLiteralNode(signatures); - } else if (type) { - typeReference = getSynthesizedDeepClone(type); - } - if (typeReference && name) { - const questionToken = isOptional ? factory.createToken(58 /* QuestionToken */) : void 0; - return factory.createPropertySignature( - /*modifiers*/ - void 0, - name, - questionToken, - typeReference - ); - } - }; - return mapDefined(propertyTags, getSignature); -} -function getPropertyName(tag) { - return tag.name.kind === 80 /* Identifier */ ? tag.name.text : tag.name.right.text; -} -function getJSDocTypedefNodes(node) { - if (hasJSDocNodes(node)) { - return flatMap(node.jsDoc, (doc) => { - var _a; - return (_a = doc.tags) == null ? void 0 : _a.filter((tag) => isJSDocTypedefTag(tag)); - }); - } - return []; -} - -// src/services/codefixes/convertLiteralTypeToMappedType.ts -var fixId16 = "convertLiteralTypeToMappedType"; -var errorCodes17 = [Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code]; -registerCodeFix({ - errorCodes: errorCodes17, - getCodeActions: function getCodeActionsToConvertLiteralTypeToMappedType(context) { - const { sourceFile, span } = context; - const info = getInfo5(sourceFile, span.start); - if (!info) { - return void 0; - } - const { name, constraint } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange13(t, sourceFile, info)); - return [createCodeFixAction(fixId16, changes, [Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId16, Diagnostics.Convert_all_type_literals_to_mapped_type)]; - }, - fixIds: [fixId16], - getAllCodeActions: (context) => codeFixAll(context, errorCodes17, (changes, diag2) => { - const info = getInfo5(diag2.file, diag2.start); - if (info) { - doChange13(changes, diag2.file, info); - } - }) -}); -function getInfo5(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - if (isIdentifier(token)) { - const propertySignature = cast(token.parent.parent, isPropertySignature); - const propertyName = token.getText(sourceFile); - return { - container: cast(propertySignature.parent, isTypeLiteralNode), - typeNode: propertySignature.type, - constraint: propertyName, - name: propertyName === "K" ? "P" : "K" - }; - } - return void 0; -} -function doChange13(changes, sourceFile, { container, typeNode, constraint, name }) { - changes.replaceNode( - sourceFile, - container, - factory.createMappedTypeNode( - /*readonlyToken*/ - void 0, - factory.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - name, - factory.createTypeReferenceNode(constraint) - ), - /*nameType*/ - void 0, - /*questionToken*/ - void 0, - typeNode, - /*members*/ - void 0 - ) - ); -} - -// src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts -var errorCodes18 = [ - Diagnostics.Class_0_incorrectly_implements_interface_1.code, - Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code -]; -var fixId17 = "fixClassIncorrectlyImplementsInterface"; -registerCodeFix({ - errorCodes: errorCodes18, - getCodeActions(context) { - const { sourceFile, span } = context; - const classDeclaration = getClass(sourceFile, span.start); - return mapDefined(getEffectiveImplementsTypeNodes(classDeclaration), (implementedTypeNode) => { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences)); - return changes.length === 0 ? void 0 : createCodeFixAction(fixId17, changes, [Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId17, Diagnostics.Implement_all_unimplemented_interfaces); - }); - }, - fixIds: [fixId17], - getAllCodeActions(context) { - const seenClassDeclarations = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes18, (changes, diag2) => { - const classDeclaration = getClass(diag2.file, diag2.start); - if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) { - for (const implementedTypeNode of getEffectiveImplementsTypeNodes(classDeclaration)) { - addMissingDeclarations(context, implementedTypeNode, diag2.file, classDeclaration, changes, context.preferences); - } - } - }); - } -}); -function getClass(sourceFile, pos) { - return Debug.checkDefined(getContainingClass(getTokenAtPosition(sourceFile, pos)), "There should be a containing class"); -} -function symbolPointsToNonPrivateMember(symbol) { - return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) & 2 /* Private */); -} -function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { - const checker = context.program.getTypeChecker(); - const maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker); - const implementedType = checker.getTypeAtLocation(implementedTypeNode); - const implementedTypeSymbols = checker.getPropertiesOfType(implementedType); - const nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(and(symbolPointsToNonPrivateMember, (symbol) => !maybeHeritageClauseSymbol.has(symbol.escapedName))); - const classType = checker.getTypeAtLocation(classDeclaration); - const constructor = find(classDeclaration.members, (m) => isConstructorDeclaration(m)); - if (!classType.getNumberIndexType()) { - createMissingIndexSignatureDeclaration(implementedType, 1 /* Number */); - } - if (!classType.getStringIndexType()) { - createMissingIndexSignatureDeclaration(implementedType, 0 /* String */); - } - const importAdder = createImportAdder(sourceFile, context.program, preferences, context.host); - createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, sourceFile, context, preferences, importAdder, (member) => insertInterfaceMemberNode(sourceFile, classDeclaration, member)); - importAdder.writeFixes(changeTracker); - function createMissingIndexSignatureDeclaration(type, kind) { - const indexInfoOfKind = checker.getIndexInfoOfType(type, kind); - if (indexInfoOfKind) { - insertInterfaceMemberNode(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration( - indexInfoOfKind, - classDeclaration, - /*flags*/ - void 0, - /*internalFlags*/ - void 0, - getNoopSymbolTrackerWithResolver(context) - )); - } - } - function insertInterfaceMemberNode(sourceFile2, cls, newElement) { - if (constructor) { - changeTracker.insertNodeAfter(sourceFile2, constructor, newElement); - } else { - changeTracker.insertMemberAtStart(sourceFile2, cls, newElement); - } - } -} -function getHeritageClauseSymbolTable(classDeclaration, checker) { - const heritageClauseNode = getEffectiveBaseTypeNode(classDeclaration); - if (!heritageClauseNode) return createSymbolTable(); - const heritageClauseType = checker.getTypeAtLocation(heritageClauseNode); - const heritageClauseTypeSymbols = checker.getPropertiesOfType(heritageClauseType); - return createSymbolTable(heritageClauseTypeSymbols.filter(symbolPointsToNonPrivateMember)); -} - -// src/services/codefixes/importFixes.ts -var importFixName = "import"; -var importFixId = "fixMissingImport"; -var errorCodes19 = [ - Diagnostics.Cannot_find_name_0.code, - Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, - Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, - Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, - Diagnostics.Cannot_find_namespace_0.code, - 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.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, - Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code, - Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code -]; -registerCodeFix({ - errorCodes: errorCodes19, - getCodeActions(context) { - const { errorCode, preferences, sourceFile, span, program } = context; - const info = getFixInfos( - context, - errorCode, - span.start, - /*useAutoImportProvider*/ - true - ); - if (!info) return void 0; - return info.map( - ({ fix, symbolName: symbolName2, errorIdentifierText }) => codeActionForFix( - context, - sourceFile, - symbolName2, - fix, - /*includeSymbolNameInDescription*/ - symbolName2 !== errorIdentifierText, - program, - preferences - ) - ); - }, - fixIds: [importFixId], - getAllCodeActions: (context) => { - const { sourceFile, program, preferences, host, cancellationToken } = context; - const importAdder = createImportAdderWorker( - sourceFile, - program, - /*useAutoImportProvider*/ - true, - preferences, - host, - cancellationToken - ); - eachDiagnostic(context, errorCodes19, (diag2) => importAdder.addImportFromDiagnostic(diag2, context)); - return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, importAdder.writeFixes)); - } -}); -function createImportAdder(sourceFile, program, preferences, host, cancellationToken) { - return createImportAdderWorker( - sourceFile, - program, - /*useAutoImportProvider*/ - false, - preferences, - host, - cancellationToken - ); -} -function createImportAdderWorker(sourceFile, program, useAutoImportProvider, preferences, host, cancellationToken) { - const compilerOptions = program.getCompilerOptions(); - const addToNamespace = []; - const importType = []; - const addToExisting = /* @__PURE__ */ new Map(); - const removeExisting = /* @__PURE__ */ new Set(); - const verbatimImports = /* @__PURE__ */ new Set(); - const newImports = /* @__PURE__ */ new Map(); - return { addImportFromDiagnostic, addImportFromExportedSymbol, addImportForModuleSymbol, writeFixes, hasFixes, addImportForUnresolvedIdentifier, addImportForNonExistentExport, removeExistingImport, addVerbatimImport }; - function addVerbatimImport(declaration) { - verbatimImports.add(declaration); - } - function addImportForUnresolvedIdentifier(context, symbolToken, useAutoImportProvider2) { - const info = getFixInfosWithoutDiagnostic(context, symbolToken, useAutoImportProvider2); - if (!info || !info.length) return; - addImport(first(info)); - } - function addImportFromDiagnostic(diagnostic, context) { - const info = getFixInfos(context, diagnostic.code, diagnostic.start, useAutoImportProvider); - if (!info || !info.length) return; - addImport(first(info)); - } - function addImportFromExportedSymbol(exportedSymbol, isValidTypeOnlyUseSite, referenceImport) { - var _a, _b; - const moduleSymbol = Debug.checkDefined(exportedSymbol.parent, "Expected exported symbol to have module symbol as parent"); - const symbolName2 = getNameForExportedSymbol(exportedSymbol, getEmitScriptTarget(compilerOptions)); - const checker = program.getTypeChecker(); - const symbol = checker.getMergedSymbol(skipAlias(exportedSymbol, checker)); - const exportInfo = getAllExportInfoForSymbol( - sourceFile, - symbol, - symbolName2, - moduleSymbol, - /*preferCapitalized*/ - false, - program, - host, - preferences, - cancellationToken - ); - if (!exportInfo) { - Debug.assert((_a = preferences.autoImportFileExcludePatterns) == null ? void 0 : _a.length); - return; - } - const useRequire = shouldUseRequire(sourceFile, program); - let fix = getImportFixForSymbol( - sourceFile, - exportInfo, - program, - /*position*/ - void 0, - !!isValidTypeOnlyUseSite, - useRequire, - host, - preferences - ); - if (fix) { - const localName = ((_b = tryCast(referenceImport == null ? void 0 : referenceImport.name, isIdentifier)) == null ? void 0 : _b.text) ?? symbolName2; - let addAsTypeOnly; - let propertyName; - if (referenceImport && isTypeOnlyImportDeclaration(referenceImport) && (fix.kind === 3 /* AddNew */ || fix.kind === 2 /* AddToExisting */) && fix.addAsTypeOnly === 1 /* Allowed */) { - addAsTypeOnly = 2 /* Required */; - } - if (exportedSymbol.name !== localName) { - propertyName = exportedSymbol.name; - } - fix = { - ...fix, - ...addAsTypeOnly === void 0 ? {} : { addAsTypeOnly }, - ...propertyName === void 0 ? {} : { propertyName } - }; - addImport({ fix, symbolName: localName ?? symbolName2, errorIdentifierText: void 0 }); - } - } - function addImportForModuleSymbol(symbolAlias, isValidTypeOnlyUseSite, referenceImport) { - var _a, _b, _c; - const checker = program.getTypeChecker(); - const moduleSymbol = checker.getAliasedSymbol(symbolAlias); - Debug.assert(moduleSymbol.flags & 1536 /* Module */, "Expected symbol to be a module"); - const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); - const moduleSpecifierResult = ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo( - moduleSymbol, - checker, - compilerOptions, - sourceFile, - moduleSpecifierResolutionHost, - preferences, - /*options*/ - void 0, - /*forAutoImport*/ - true - ); - const useRequire = shouldUseRequire(sourceFile, program); - let addAsTypeOnly = getAddAsTypeOnly( - isValidTypeOnlyUseSite, - /*isForNewImportDeclaration*/ - true, - /*symbol*/ - void 0, - symbolAlias.flags, - program.getTypeChecker(), - compilerOptions - ); - addAsTypeOnly = addAsTypeOnly === 1 /* Allowed */ && isTypeOnlyImportDeclaration(referenceImport) ? 2 /* Required */ : 1 /* Allowed */; - const importKind = isImportDeclaration(referenceImport) ? isDefaultImport(referenceImport) ? 1 /* Default */ : 2 /* Namespace */ : isImportSpecifier(referenceImport) ? 0 /* Named */ : isImportClause(referenceImport) && !!referenceImport.name ? 1 /* Default */ : 2 /* Namespace */; - const exportInfo = [{ - symbol: symbolAlias, - moduleSymbol, - moduleFileName: (_c = (_b = (_a = moduleSymbol.declarations) == null ? void 0 : _a[0]) == null ? void 0 : _b.getSourceFile()) == null ? void 0 : _c.fileName, - exportKind: 4 /* Module */, - targetFlags: symbolAlias.flags, - isFromPackageJson: false - }]; - const existingFix = getImportFixForSymbol( - sourceFile, - exportInfo, - program, - /*position*/ - void 0, - !!isValidTypeOnlyUseSite, - useRequire, - host, - preferences - ); - let fix; - if (existingFix && importKind !== 2 /* Namespace */ && existingFix.kind !== 0 /* UseNamespace */ && existingFix.kind !== 1 /* JsdocTypeImport */) { - fix = { - ...existingFix, - addAsTypeOnly, - importKind - }; - } else { - fix = { - kind: 3 /* AddNew */, - moduleSpecifierKind: existingFix !== void 0 ? existingFix.moduleSpecifierKind : moduleSpecifierResult.kind, - moduleSpecifier: existingFix !== void 0 ? existingFix.moduleSpecifier : first(moduleSpecifierResult.moduleSpecifiers), - importKind, - addAsTypeOnly, - useRequire - }; - } - addImport({ fix, symbolName: symbolAlias.name, errorIdentifierText: void 0 }); - } - function addImportForNonExistentExport(exportName, exportingFileName, exportKind, exportedMeanings, isImportUsageValidAsTypeOnly) { - const exportingSourceFile = program.getSourceFile(exportingFileName); - const useRequire = shouldUseRequire(sourceFile, program); - if (exportingSourceFile && exportingSourceFile.symbol) { - const { fixes } = getImportFixes( - [{ - exportKind, - isFromPackageJson: false, - moduleFileName: exportingFileName, - moduleSymbol: exportingSourceFile.symbol, - targetFlags: exportedMeanings - }], - /*usagePosition*/ - void 0, - isImportUsageValidAsTypeOnly, - useRequire, - program, - sourceFile, - host, - preferences - ); - if (fixes.length) { - addImport({ fix: fixes[0], symbolName: exportName, errorIdentifierText: exportName }); - } - } else { - const futureExportingSourceFile = createFutureSourceFile(exportingFileName, 99 /* ESNext */, program, host); - const moduleSpecifier = ts_moduleSpecifiers_exports.getLocalModuleSpecifierBetweenFileNames( - sourceFile, - exportingFileName, - compilerOptions, - createModuleSpecifierResolutionHost(program, host), - preferences - ); - const importKind = getImportKind(futureExportingSourceFile, exportKind, program); - const addAsTypeOnly = getAddAsTypeOnly( - isImportUsageValidAsTypeOnly, - /*isForNewImportDeclaration*/ - true, - /*symbol*/ - void 0, - exportedMeanings, - program.getTypeChecker(), - compilerOptions - ); - const fix = { - kind: 3 /* AddNew */, - moduleSpecifierKind: "relative", - moduleSpecifier, - importKind, - addAsTypeOnly, - useRequire - }; - addImport({ fix, symbolName: exportName, errorIdentifierText: exportName }); - } - } - function removeExistingImport(declaration) { - if (declaration.kind === 274 /* ImportClause */) { - Debug.assertIsDefined(declaration.name, "ImportClause should have a name if it's being removed"); - } - removeExisting.add(declaration); - } - function addImport(info) { - var _a, _b, _c; - const { fix, symbolName: symbolName2 } = info; - switch (fix.kind) { - case 0 /* UseNamespace */: - addToNamespace.push(fix); - break; - case 1 /* JsdocTypeImport */: - importType.push(fix); - break; - case 2 /* AddToExisting */: { - const { importClauseOrBindingPattern, importKind, addAsTypeOnly, propertyName } = fix; - let entry = addToExisting.get(importClauseOrBindingPattern); - if (!entry) { - addToExisting.set(importClauseOrBindingPattern, entry = { importClauseOrBindingPattern, defaultImport: void 0, namedImports: /* @__PURE__ */ new Map() }); - } - if (importKind === 0 /* Named */) { - const prevTypeOnly = (_a = entry == null ? void 0 : entry.namedImports.get(symbolName2)) == null ? void 0 : _a.addAsTypeOnly; - entry.namedImports.set(symbolName2, { addAsTypeOnly: reduceAddAsTypeOnlyValues(prevTypeOnly, addAsTypeOnly), propertyName }); - } else { - Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName2, "(Add to Existing) Default import should be missing or match symbolName"); - entry.defaultImport = { - name: symbolName2, - addAsTypeOnly: reduceAddAsTypeOnlyValues((_b = entry.defaultImport) == null ? void 0 : _b.addAsTypeOnly, addAsTypeOnly) - }; - } - break; - } - case 3 /* AddNew */: { - const { moduleSpecifier, importKind, useRequire, addAsTypeOnly, propertyName } = fix; - const entry = getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly); - Debug.assert(entry.useRequire === useRequire, "(Add new) Tried to add an `import` and a `require` for the same module"); - switch (importKind) { - case 1 /* Default */: - Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName2, "(Add new) Default import should be missing or match symbolName"); - entry.defaultImport = { name: symbolName2, addAsTypeOnly: reduceAddAsTypeOnlyValues((_c = entry.defaultImport) == null ? void 0 : _c.addAsTypeOnly, addAsTypeOnly) }; - break; - case 0 /* Named */: - const prevValue = (entry.namedImports || (entry.namedImports = /* @__PURE__ */ new Map())).get(symbolName2); - entry.namedImports.set(symbolName2, [reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly), propertyName]); - break; - case 3 /* CommonJS */: - if (compilerOptions.verbatimModuleSyntax) { - const prevValue2 = (entry.namedImports || (entry.namedImports = /* @__PURE__ */ new Map())).get(symbolName2); - entry.namedImports.set(symbolName2, [reduceAddAsTypeOnlyValues(prevValue2, addAsTypeOnly), propertyName]); - } else { - Debug.assert(entry.namespaceLikeImport === void 0 || entry.namespaceLikeImport.name === symbolName2, "Namespacelike import shoudl be missing or match symbolName"); - entry.namespaceLikeImport = { importKind, name: symbolName2, addAsTypeOnly }; - } - break; - case 2 /* Namespace */: - Debug.assert(entry.namespaceLikeImport === void 0 || entry.namespaceLikeImport.name === symbolName2, "Namespacelike import shoudl be missing or match symbolName"); - entry.namespaceLikeImport = { importKind, name: symbolName2, addAsTypeOnly }; - break; - } - break; - } - case 4 /* PromoteTypeOnly */: - break; - default: - Debug.assertNever(fix, `fix wasn't never - got kind ${fix.kind}`); - } - function reduceAddAsTypeOnlyValues(prevValue, newValue) { - return Math.max(prevValue ?? 0, newValue); - } - function getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly) { - const typeOnlyKey = newImportsKey( - moduleSpecifier, - /*topLevelTypeOnly*/ - true - ); - const nonTypeOnlyKey = newImportsKey( - moduleSpecifier, - /*topLevelTypeOnly*/ - false - ); - const typeOnlyEntry = newImports.get(typeOnlyKey); - const nonTypeOnlyEntry = newImports.get(nonTypeOnlyKey); - const newEntry = { - defaultImport: void 0, - namedImports: void 0, - namespaceLikeImport: void 0, - useRequire - }; - if (importKind === 1 /* Default */ && addAsTypeOnly === 2 /* Required */) { - if (typeOnlyEntry) return typeOnlyEntry; - newImports.set(typeOnlyKey, newEntry); - return newEntry; - } - if (addAsTypeOnly === 1 /* Allowed */ && (typeOnlyEntry || nonTypeOnlyEntry)) { - return typeOnlyEntry || nonTypeOnlyEntry; - } - if (nonTypeOnlyEntry) { - return nonTypeOnlyEntry; - } - newImports.set(nonTypeOnlyKey, newEntry); - return newEntry; - } - function newImportsKey(moduleSpecifier, topLevelTypeOnly) { - return `${topLevelTypeOnly ? 1 : 0}|${moduleSpecifier}`; - } - } - function writeFixes(changeTracker, oldFileQuotePreference) { - var _a, _b; - let quotePreference; - if (sourceFile.imports !== void 0 && sourceFile.imports.length === 0 && oldFileQuotePreference !== void 0) { - quotePreference = oldFileQuotePreference; - } else { - quotePreference = getQuotePreference(sourceFile, preferences); - } - for (const fix of addToNamespace) { - addNamespaceQualifier(changeTracker, sourceFile, fix); - } - for (const fix of importType) { - addImportType(changeTracker, sourceFile, fix, quotePreference); - } - let importSpecifiersToRemoveWhileAdding; - if (removeExisting.size) { - Debug.assert(isFullSourceFile(sourceFile), "Cannot remove imports from a future source file"); - const importDeclarationsWithRemovals = new Set(mapDefined([...removeExisting], (d) => findAncestor(d, isImportDeclaration))); - const variableDeclarationsWithRemovals = new Set(mapDefined([...removeExisting], (d) => findAncestor(d, isVariableDeclarationInitializedToRequire))); - const emptyImportDeclarations = [...importDeclarationsWithRemovals].filter( - (d) => { - var _a2, _b2, _c; - return ( - // nothing added to the import declaration - !addToExisting.has(d.importClause) && // no default, or default is being removed - (!((_a2 = d.importClause) == null ? void 0 : _a2.name) || removeExisting.has(d.importClause)) && // no namespace import, or namespace import is being removed - (!tryCast((_b2 = d.importClause) == null ? void 0 : _b2.namedBindings, isNamespaceImport) || removeExisting.has(d.importClause.namedBindings)) && // no named imports, or all named imports are being removed - (!tryCast((_c = d.importClause) == null ? void 0 : _c.namedBindings, isNamedImports) || every(d.importClause.namedBindings.elements, (e) => removeExisting.has(e))) - ); - } - ); - const emptyVariableDeclarations = [...variableDeclarationsWithRemovals].filter( - (d) => ( - // no binding elements being added to the variable declaration - (d.name.kind !== 207 /* ObjectBindingPattern */ || !addToExisting.has(d.name)) && // no binding elements, or all binding elements are being removed - (d.name.kind !== 207 /* ObjectBindingPattern */ || every(d.name.elements, (e) => removeExisting.has(e))) - ) - ); - const namedBindingsToDelete = [...importDeclarationsWithRemovals].filter( - (d) => { - var _a2, _b2; - return ( - // has named bindings - ((_a2 = d.importClause) == null ? void 0 : _a2.namedBindings) && // is not being fully removed - emptyImportDeclarations.indexOf(d) === -1 && // is not gaining named imports - !((_b2 = addToExisting.get(d.importClause)) == null ? void 0 : _b2.namedImports) && // all named imports are being removed - (d.importClause.namedBindings.kind === 275 /* NamespaceImport */ || every(d.importClause.namedBindings.elements, (e) => removeExisting.has(e))) - ); - } - ); - for (const declaration of [...emptyImportDeclarations, ...emptyVariableDeclarations]) { - changeTracker.delete(sourceFile, declaration); - } - for (const declaration of namedBindingsToDelete) { - changeTracker.replaceNode( - sourceFile, - declaration.importClause, - factory.updateImportClause( - declaration.importClause, - declaration.importClause.phaseModifier, - declaration.importClause.name, - /*namedBindings*/ - void 0 - ) - ); - } - for (const declaration of removeExisting) { - const importDeclaration = findAncestor(declaration, isImportDeclaration); - if (importDeclaration && emptyImportDeclarations.indexOf(importDeclaration) === -1 && namedBindingsToDelete.indexOf(importDeclaration) === -1) { - if (declaration.kind === 274 /* ImportClause */) { - changeTracker.delete(sourceFile, declaration.name); - } else { - Debug.assert(declaration.kind === 277 /* ImportSpecifier */, "NamespaceImport should have been handled earlier"); - if ((_a = addToExisting.get(importDeclaration.importClause)) == null ? void 0 : _a.namedImports) { - (importSpecifiersToRemoveWhileAdding ?? (importSpecifiersToRemoveWhileAdding = /* @__PURE__ */ new Set())).add(declaration); - } else { - changeTracker.delete(sourceFile, declaration); - } - } - } else if (declaration.kind === 209 /* BindingElement */) { - if ((_b = addToExisting.get(declaration.parent)) == null ? void 0 : _b.namedImports) { - (importSpecifiersToRemoveWhileAdding ?? (importSpecifiersToRemoveWhileAdding = /* @__PURE__ */ new Set())).add(declaration); - } else { - changeTracker.delete(sourceFile, declaration); - } - } else if (declaration.kind === 272 /* ImportEqualsDeclaration */) { - changeTracker.delete(sourceFile, declaration); - } - } - } - addToExisting.forEach(({ importClauseOrBindingPattern, defaultImport, namedImports }) => { - doAddExistingFix( - changeTracker, - sourceFile, - importClauseOrBindingPattern, - defaultImport, - arrayFrom(namedImports.entries(), ([name, { addAsTypeOnly, propertyName }]) => ({ addAsTypeOnly, propertyName, name })), - importSpecifiersToRemoveWhileAdding, - preferences - ); - }); - let newDeclarations; - newImports.forEach(({ useRequire, defaultImport, namedImports, namespaceLikeImport }, key) => { - const moduleSpecifier = key.slice(2); - const getDeclarations = useRequire ? getNewRequires : getNewImports; - const declarations = getDeclarations( - moduleSpecifier, - quotePreference, - defaultImport, - namedImports && arrayFrom(namedImports.entries(), ([name, [addAsTypeOnly, propertyName]]) => ({ addAsTypeOnly, propertyName, name })), - namespaceLikeImport, - compilerOptions, - preferences - ); - newDeclarations = combine(newDeclarations, declarations); - }); - newDeclarations = combine(newDeclarations, getCombinedVerbatimImports()); - if (newDeclarations) { - insertImports( - changeTracker, - sourceFile, - newDeclarations, - /*blankLineBetween*/ - true, - preferences - ); - } - } - function getCombinedVerbatimImports() { - if (!verbatimImports.size) return void 0; - const importDeclarations = new Set(mapDefined([...verbatimImports], (d) => findAncestor(d, isImportDeclaration))); - const requireStatements = new Set(mapDefined([...verbatimImports], (d) => findAncestor(d, isRequireVariableStatement))); - return [ - ...mapDefined([...verbatimImports], (d) => d.kind === 272 /* ImportEqualsDeclaration */ ? getSynthesizedDeepClone( - d, - /*includeTrivia*/ - true - ) : void 0), - ...[...importDeclarations].map((d) => { - var _a; - if (verbatimImports.has(d)) { - return getSynthesizedDeepClone( - d, - /*includeTrivia*/ - true - ); - } - return getSynthesizedDeepClone( - factory.updateImportDeclaration( - d, - d.modifiers, - d.importClause && factory.updateImportClause( - d.importClause, - d.importClause.phaseModifier, - verbatimImports.has(d.importClause) ? d.importClause.name : void 0, - verbatimImports.has(d.importClause.namedBindings) ? d.importClause.namedBindings : ((_a = tryCast(d.importClause.namedBindings, isNamedImports)) == null ? void 0 : _a.elements.some((e) => verbatimImports.has(e))) ? factory.updateNamedImports( - d.importClause.namedBindings, - d.importClause.namedBindings.elements.filter((e) => verbatimImports.has(e)) - ) : void 0 - ), - d.moduleSpecifier, - d.attributes - ), - /*includeTrivia*/ - true - ); - }), - ...[...requireStatements].map((s) => { - if (verbatimImports.has(s)) { - return getSynthesizedDeepClone( - s, - /*includeTrivia*/ - true - ); - } - return getSynthesizedDeepClone( - factory.updateVariableStatement( - s, - s.modifiers, - factory.updateVariableDeclarationList( - s.declarationList, - mapDefined(s.declarationList.declarations, (d) => { - if (verbatimImports.has(d)) { - return d; - } - return factory.updateVariableDeclaration( - d, - d.name.kind === 207 /* ObjectBindingPattern */ ? factory.updateObjectBindingPattern( - d.name, - d.name.elements.filter((e) => verbatimImports.has(e)) - ) : d.name, - d.exclamationToken, - d.type, - d.initializer - ); - }) - ) - ), - /*includeTrivia*/ - true - ); - }) - ]; - } - function hasFixes() { - return addToNamespace.length > 0 || importType.length > 0 || addToExisting.size > 0 || newImports.size > 0 || verbatimImports.size > 0 || removeExisting.size > 0; - } -} -function createImportSpecifierResolver(importingFile, program, host, preferences) { - const packageJsonImportFilter = createPackageJsonImportFilter(importingFile, preferences, host); - const importMap = createExistingImportMap(importingFile, program); - return { getModuleSpecifierForBestExportInfo }; - function getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, fromCacheOnly) { - const { fixes, computedWithoutCacheCount } = getImportFixes( - exportInfo, - position, - isValidTypeOnlyUseSite, - /*useRequire*/ - false, - program, - importingFile, - host, - preferences, - importMap, - fromCacheOnly - ); - const result = getBestFix(fixes, importingFile, program, packageJsonImportFilter, host, preferences); - return result && { ...result, computedWithoutCacheCount }; - } -} -function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { - let exportInfos; - if (exportMapKey) { - exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey); - Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey"); - } else { - exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken); - Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol"); - } - const useRequire = shouldUseRequire(sourceFile, program); - const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); - return { - moduleSpecifier: fix.moduleSpecifier, - codeAction: codeFixActionToCodeAction(codeActionForFix( - { host, formatContext, preferences }, - sourceFile, - symbolName2, - fix, - /*includeSymbolNameInDescription*/ - false, - program, - preferences - )) - }; -} -function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, host, formatContext, preferences) { - const compilerOptions = program.getCompilerOptions(); - 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, - program, - preferences - )); -} -function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { - const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); - return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host, preferences); -} -function codeFixActionToCodeAction({ description: description3, changes, commands }) { - return { description: description3, changes, commands }; -} -function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) { - const getChecker = createGetChecker(program, host); - const isFileExcluded = preferences.autoImportFileExcludePatterns && getIsFileExcluded(host, preferences); - const mergedModuleSymbol = program.getTypeChecker().getMergedSymbol(moduleSymbol); - const moduleSourceFile = isFileExcluded && mergedModuleSymbol.declarations && getDeclarationOfKind(mergedModuleSymbol, 308 /* SourceFile */); - const moduleSymbolExcluded = moduleSourceFile && isFileExcluded(moduleSourceFile); - return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => { - const checker = getChecker(info[0].isFromPackageJson); - if (checker.getMergedSymbol(skipAlias(info[0].symbol, checker)) === symbol && (moduleSymbolExcluded || info.some((i) => checker.getMergedSymbol(i.moduleSymbol) === moduleSymbol || i.symbol.parent === moduleSymbol))) { - return info; - } - }); -} -function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) { - var _a, _b; - const mainProgramInfo = getInfoWithChecker( - program.getTypeChecker(), - /*isFromPackageJson*/ - false - ); - if (mainProgramInfo) { - return mainProgramInfo; - } - const autoImportProvider = (_b = (_a = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getTypeChecker(); - return Debug.checkDefined(autoImportProvider && getInfoWithChecker( - autoImportProvider, - /*isFromPackageJson*/ - true - ), `Could not find symbol in specified module for code actions`); - function getInfoWithChecker(checker, isFromPackageJson) { - const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker); - if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) { - return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; - } - const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); - if (named && skipAlias(named, checker) === symbol) { - return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0 /* Named */, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; - } - } -} -function getImportFixes(exportInfos, usagePosition, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = isFullSourceFile(sourceFile) ? createExistingImportMap(sourceFile, program) : void 0, fromCacheOnly) { - const checker = program.getTypeChecker(); - const existingImports = importMap ? flatMap(exportInfos, importMap.getImportsForExportInfo) : emptyArray; - const useNamespace = usagePosition !== void 0 && tryUseExistingNamespaceImport(existingImports, usagePosition); - const addToExisting = tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, program.getCompilerOptions()); - if (addToExisting) { - return { - computedWithoutCacheCount: 0, - fixes: [...useNamespace ? [useNamespace] : emptyArray, addToExisting] - }; - } - const { fixes, computedWithoutCacheCount = 0 } = getFixesForAddImport( - exportInfos, - existingImports, - program, - sourceFile, - usagePosition, - isValidTypeOnlyUseSite, - useRequire, - host, - preferences, - fromCacheOnly - ); - return { - computedWithoutCacheCount, - fixes: [...useNamespace ? [useNamespace] : emptyArray, ...fixes] - }; -} -function tryUseExistingNamespaceImport(existingImports, position) { - return firstDefined(existingImports, ({ declaration, importKind }) => { - var _a; - if (importKind !== 0 /* Named */) return void 0; - const namespacePrefix = getNamespaceLikeImportText(declaration); - const moduleSpecifier = namespacePrefix && ((_a = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a.text); - if (moduleSpecifier) { - return { kind: 0 /* UseNamespace */, namespacePrefix, usagePosition: position, moduleSpecifierKind: void 0, moduleSpecifier }; - } - }); -} -function getNamespaceLikeImportText(declaration) { - var _a, _b, _c; - switch (declaration.kind) { - case 261 /* VariableDeclaration */: - return (_a = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a.text; - case 272 /* ImportEqualsDeclaration */: - return declaration.name.text; - case 352 /* JSDocImportTag */: - case 273 /* ImportDeclaration */: - return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text; - default: - return Debug.assertNever(declaration); - } -} -function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, symbol, targetFlags, checker, compilerOptions) { - if (!isValidTypeOnlyUseSite) { - return 4 /* NotAllowed */; - } - if (symbol && compilerOptions.verbatimModuleSyntax && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { - return 2 /* Required */; - } - return 1 /* Allowed */; -} -function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, compilerOptions) { - let best; - for (const existingImport of existingImports) { - const fix = getAddToExistingImportFix(existingImport); - if (!fix) continue; - const isTypeOnly = isTypeOnlyImportDeclaration(fix.importClauseOrBindingPattern); - if (fix.addAsTypeOnly !== 4 /* NotAllowed */ && isTypeOnly || fix.addAsTypeOnly === 4 /* NotAllowed */ && !isTypeOnly) { - return fix; - } - best ?? (best = fix); - } - return best; - function getAddToExistingImportFix({ declaration, importKind, symbol, targetFlags }) { - if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 272 /* ImportEqualsDeclaration */) { - return void 0; - } - if (declaration.kind === 261 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 207 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifierKind: void 0, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0; - } - const { importClause } = declaration; - if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier)) { - return void 0; - } - const { name, namedBindings } = importClause; - if (importClause.isTypeOnly && !(importKind === 0 /* Named */ && namedBindings)) { - return void 0; - } - const addAsTypeOnly = getAddAsTypeOnly( - isValidTypeOnlyUseSite, - /*isForNewImportDeclaration*/ - false, - symbol, - targetFlags, - checker, - compilerOptions - ); - if (importKind === 1 /* Default */ && (name || // Cannot add a default import to a declaration that already has one - addAsTypeOnly === 2 /* Required */ && namedBindings)) { - return void 0; - } - if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 275 /* NamespaceImport */) { - return void 0; - } - return { - kind: 2 /* AddToExisting */, - importClauseOrBindingPattern: importClause, - importKind, - moduleSpecifierKind: void 0, - moduleSpecifier: declaration.moduleSpecifier.text, - addAsTypeOnly - }; - } -} -function createExistingImportMap(importingFile, program) { - const checker = program.getTypeChecker(); - let importMap; - for (const moduleSpecifier of importingFile.imports) { - const i = importFromModuleSpecifier(moduleSpecifier); - if (isVariableDeclarationInitializedToRequire(i.parent)) { - const moduleSymbol = checker.resolveExternalModuleName(moduleSpecifier); - if (moduleSymbol) { - (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i.parent); - } - } else if (i.kind === 273 /* ImportDeclaration */ || i.kind === 272 /* ImportEqualsDeclaration */ || i.kind === 352 /* JSDocImportTag */) { - const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); - if (moduleSymbol) { - (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i); - } - } - } - return { - getImportsForExportInfo: ({ moduleSymbol, exportKind, targetFlags, symbol }) => { - const matchingDeclarations = importMap == null ? void 0 : importMap.get(getSymbolId(moduleSymbol)); - if (!matchingDeclarations) return emptyArray; - if (isSourceFileJS(importingFile) && !(targetFlags & 111551 /* Value */) && !every(matchingDeclarations, isJSDocImportTag)) return emptyArray; - const importKind = getImportKind(importingFile, exportKind, program); - return matchingDeclarations.map((declaration) => ({ declaration, importKind, symbol, targetFlags })); - } - }; -} -function shouldUseRequire(sourceFile, program) { - if (!hasJSFileExtension(sourceFile.fileName)) { - return false; - } - if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) return true; - if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) return false; - const compilerOptions = program.getCompilerOptions(); - if (compilerOptions.configFile) { - return getEmitModuleKind(compilerOptions) < 5 /* ES2015 */; - } - if (getImpliedNodeFormatForEmit(sourceFile, program) === 1 /* CommonJS */) return true; - if (getImpliedNodeFormatForEmit(sourceFile, program) === 99 /* ESNext */) return false; - for (const otherFile of program.getSourceFiles()) { - if (otherFile === sourceFile || !isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) continue; - if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) return true; - if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) return false; - } - return true; -} -function createGetChecker(program, host) { - return memoizeOne((isFromPackageJson) => isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker()); -} -function getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { - const isJs = hasJSFileExtension(sourceFile.fileName); - const compilerOptions = program.getCompilerOptions(); - const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); - const getChecker = createGetChecker(program, host); - const moduleResolution = getEmitModuleResolutionKind(compilerOptions); - const rejectNodeModulesRelativePaths = moduleResolutionUsesNodeModules(moduleResolution); - const getModuleSpecifiers2 = fromCacheOnly ? (exportInfo2) => ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(exportInfo2.moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences) : (exportInfo2, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo( - exportInfo2.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); - const { computedWithoutCache, moduleSpecifiers, kind: moduleSpecifierKind } = getModuleSpecifiers2(exportInfo2, checker) ?? {}; - const importedSymbolHasValueMeaning = !!(exportInfo2.targetFlags & 111551 /* Value */); - const addAsTypeOnly = getAddAsTypeOnly( - isValidTypeOnlyUseSite, - /*isForNewImportDeclaration*/ - true, - exportInfo2.symbol, - exportInfo2.targetFlags, - checker, - compilerOptions - ); - computedWithoutCacheCount += computedWithoutCache ? 1 : 0; - return mapDefined(moduleSpecifiers, (moduleSpecifier) => { - if (rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier)) { - return void 0; - } - if (!importedSymbolHasValueMeaning && isJs && usagePosition !== void 0) { - return { kind: 1 /* JsdocTypeImport */, moduleSpecifierKind, moduleSpecifier, usagePosition, exportInfo: exportInfo2, isReExport: i > 0 }; - } - const importKind = getImportKind(sourceFile, exportInfo2.exportKind, program); - let qualification; - if (usagePosition !== void 0 && importKind === 3 /* CommonJS */ && exportInfo2.exportKind === 0 /* Named */) { - const exportEquals = checker.resolveExternalModuleSymbol(exportInfo2.moduleSymbol); - let namespacePrefix; - if (exportEquals !== exportInfo2.moduleSymbol) { - namespacePrefix = forEachNameOfDefaultExport(exportEquals, checker, getEmitScriptTarget(compilerOptions), identity); - } - namespacePrefix || (namespacePrefix = moduleSymbolToValidIdentifier( - exportInfo2.moduleSymbol, - getEmitScriptTarget(compilerOptions), - /*forceCapitalize*/ - false - )); - qualification = { namespacePrefix, usagePosition }; - } - return { - kind: 3 /* AddNew */, - moduleSpecifierKind, - moduleSpecifier, - importKind, - useRequire, - addAsTypeOnly, - exportInfo: exportInfo2, - isReExport: i > 0, - qualification - }; - }); - }); - return { computedWithoutCacheCount, fixes }; -} -function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { - const existingDeclaration = firstDefined(existingImports, (info) => newImportInfoFromExistingSpecifier(info, isValidTypeOnlyUseSite, useRequire, program.getTypeChecker(), program.getCompilerOptions())); - return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); -} -function newImportInfoFromExistingSpecifier({ declaration, importKind, symbol, targetFlags }, isValidTypeOnlyUseSite, useRequire, checker, compilerOptions) { - var _a; - const moduleSpecifier = (_a = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a.text; - if (moduleSpecifier) { - const addAsTypeOnly = useRequire ? 4 /* NotAllowed */ : getAddAsTypeOnly( - isValidTypeOnlyUseSite, - /*isForNewImportDeclaration*/ - true, - symbol, - targetFlags, - checker, - compilerOptions - ); - return { kind: 3 /* AddNew */, moduleSpecifierKind: void 0, moduleSpecifier, importKind, addAsTypeOnly, useRequire }; - } -} -function getFixInfos(context, errorCode, pos, useAutoImportProvider) { - const symbolToken = getTokenAtPosition(context.sourceFile, pos); - let info; - if (errorCode === Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { - info = getFixesInfoForUMDImport(context, symbolToken); - } else if (!isIdentifier(symbolToken)) { - return void 0; - } else if (errorCode === Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code) { - const symbolName2 = single(getSymbolNamesToImport(context.sourceFile, context.program.getTypeChecker(), symbolToken, context.program.getCompilerOptions())); - const fix = getTypeOnlyPromotionFix(context.sourceFile, symbolToken, symbolName2, context.program); - return fix && [{ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text }]; - } else { - info = getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider); - } - const packageJsonImportFilter = createPackageJsonImportFilter(context.sourceFile, context.preferences, context.host); - return info && sortFixInfo(info, context.sourceFile, context.program, packageJsonImportFilter, context.host, context.preferences); -} -function sortFixInfo(fixes, sourceFile, program, packageJsonImportFilter, host, preferences) { - const _toPath = (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host)); - return toSorted(fixes, (a, b) => compareBooleans(!!a.isJsxNamespaceFix, !!b.isJsxNamespaceFix) || compareValues(a.fix.kind, b.fix.kind) || compareModuleSpecifiers(a.fix, b.fix, sourceFile, program, preferences, packageJsonImportFilter.allowsImportingSpecifier, _toPath)); -} -function getFixInfosWithoutDiagnostic(context, symbolToken, useAutoImportProvider) { - const info = getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider); - const packageJsonImportFilter = createPackageJsonImportFilter(context.sourceFile, context.preferences, context.host); - return info && sortFixInfo(info, context.sourceFile, context.program, packageJsonImportFilter, context.host, context.preferences); -} -function getBestFix(fixes, sourceFile, program, packageJsonImportFilter, host, preferences) { - if (!some(fixes)) return; - if (fixes[0].kind === 0 /* UseNamespace */ || fixes[0].kind === 2 /* AddToExisting */) { - return fixes[0]; - } - return fixes.reduce( - (best, fix) => ( - // Takes true branch of conditional if `fix` is better than `best` - compareModuleSpecifiers( - fix, - best, - sourceFile, - program, - preferences, - packageJsonImportFilter.allowsImportingSpecifier, - (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host)) - ) === -1 /* LessThan */ ? fix : best - ) - ); -} -function compareModuleSpecifiers(a, b, importingFile, program, preferences, allowsImportingSpecifier, toPath3) { - if (a.kind !== 0 /* UseNamespace */ && b.kind !== 0 /* UseNamespace */) { - return compareBooleans( - b.moduleSpecifierKind !== "node_modules" || allowsImportingSpecifier(b.moduleSpecifier), - a.moduleSpecifierKind !== "node_modules" || allowsImportingSpecifier(a.moduleSpecifier) - ) || compareModuleSpecifierRelativity(a, b, preferences) || compareNodeCoreModuleSpecifiers(a.moduleSpecifier, b.moduleSpecifier, importingFile, program) || compareBooleans( - isFixPossiblyReExportingImportingFile(a, importingFile.path, toPath3), - isFixPossiblyReExportingImportingFile(b, importingFile.path, toPath3) - ) || compareNumberOfDirectorySeparators(a.moduleSpecifier, b.moduleSpecifier); - } - return 0 /* EqualTo */; -} -function compareModuleSpecifierRelativity(a, b, preferences) { - if (preferences.importModuleSpecifierPreference === "non-relative" || preferences.importModuleSpecifierPreference === "project-relative") { - return compareBooleans(a.moduleSpecifierKind === "relative", b.moduleSpecifierKind === "relative"); - } - return 0 /* EqualTo */; -} -function isFixPossiblyReExportingImportingFile(fix, importingFilePath, toPath3) { - var _a; - if (fix.isReExport && ((_a = fix.exportInfo) == null ? void 0 : _a.moduleFileName) && isIndexFileName(fix.exportInfo.moduleFileName)) { - const reExportDir = toPath3(getDirectoryPath(fix.exportInfo.moduleFileName)); - return startsWith(importingFilePath, reExportDir); - } - return false; -} -function isIndexFileName(fileName) { - return getBaseFileName( - fileName, - [".js", ".jsx", ".d.ts", ".ts", ".tsx"], - /*ignoreCase*/ - true - ) === "index"; -} -function compareNodeCoreModuleSpecifiers(a, b, importingFile, program) { - if (startsWith(a, "node:") && !startsWith(b, "node:")) return shouldUseUriStyleNodeCoreModules(importingFile, program) ? -1 /* LessThan */ : 1 /* GreaterThan */; - if (startsWith(b, "node:") && !startsWith(a, "node:")) return shouldUseUriStyleNodeCoreModules(importingFile, program) ? 1 /* GreaterThan */ : -1 /* LessThan */; - return 0 /* EqualTo */; -} -function getFixesInfoForUMDImport({ sourceFile, program, host, preferences }, token) { - const checker = program.getTypeChecker(); - const umdSymbol = getUmdSymbol(token, checker); - if (!umdSymbol) return void 0; - const symbol = checker.getAliasedSymbol(umdSymbol); - const symbolName2 = umdSymbol.name; - const exportInfo = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: void 0, exportKind: 3 /* UMD */, targetFlags: symbol.flags, isFromPackageJson: false }]; - const useRequire = shouldUseRequire(sourceFile, program); - const fixes = getImportFixes( - exportInfo, - /*usagePosition*/ - void 0, - /*isValidTypeOnlyUseSite*/ - false, - useRequire, - program, - sourceFile, - host, - preferences - ).fixes; - return fixes.map((fix) => { - var _a; - return { fix, symbolName: symbolName2, errorIdentifierText: (_a = tryCast(token, isIdentifier)) == null ? void 0 : _a.text }; - }); -} -function getUmdSymbol(token, checker) { - const umdSymbol = isIdentifier(token) ? checker.getSymbolAtLocation(token) : void 0; - if (isUMDExportSymbol(umdSymbol)) return umdSymbol; - const { parent: parent2 } = token; - if (isJsxOpeningLikeElement(parent2) && parent2.tagName === token || isJsxOpeningFragment(parent2)) { - const parentSymbol = checker.resolveName( - checker.getJsxNamespace(parent2), - isJsxOpeningLikeElement(parent2) ? token : parent2, - 111551 /* Value */, - /*excludeGlobals*/ - false - ); - if (isUMDExportSymbol(parentSymbol)) { - return parentSymbol; - } - } - return void 0; -} -function getImportKind(importingFile, exportKind, program, forceImportKeyword) { - if (program.getCompilerOptions().verbatimModuleSyntax && getEmitModuleFormatOfFile(importingFile, program) === 1 /* CommonJS */) { - return 3 /* CommonJS */; - } - switch (exportKind) { - case 0 /* Named */: - return 0 /* Named */; - case 1 /* Default */: - return 1 /* Default */; - case 2 /* ExportEquals */: - return getExportEqualsImportKind(importingFile, program.getCompilerOptions(), !!forceImportKeyword); - case 3 /* UMD */: - return getUmdImportKind(importingFile, program, !!forceImportKeyword); - case 4 /* Module */: - return 2 /* Namespace */; - default: - return Debug.assertNever(exportKind); - } -} -function getUmdImportKind(importingFile, program, forceImportKeyword) { - if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) { - return 1 /* Default */; - } - const moduleKind = getEmitModuleKind(program.getCompilerOptions()); - switch (moduleKind) { - case 2 /* AMD */: - case 1 /* CommonJS */: - case 3 /* UMD */: - if (hasJSFileExtension(importingFile.fileName)) { - return importingFile.externalModuleIndicator || forceImportKeyword ? 2 /* Namespace */ : 3 /* CommonJS */; - } - return 3 /* CommonJS */; - case 4 /* System */: - case 5 /* ES2015 */: - case 6 /* ES2020 */: - case 7 /* ES2022 */: - case 99 /* ESNext */: - case 0 /* None */: - case 200 /* Preserve */: - return 2 /* Namespace */; - case 100 /* Node16 */: - case 101 /* Node18 */: - case 102 /* Node20 */: - case 199 /* NodeNext */: - return getImpliedNodeFormatForEmit(importingFile, program) === 99 /* ESNext */ ? 2 /* Namespace */ : 3 /* CommonJS */; - default: - return Debug.assertNever(moduleKind, `Unexpected moduleKind ${moduleKind}`); - } -} -function getFixesInfoForNonUMDImport({ sourceFile, program, cancellationToken, host, preferences }, symbolToken, useAutoImportProvider) { - const checker = program.getTypeChecker(); - const compilerOptions = program.getCompilerOptions(); - return flatMap(getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions), (symbolName2) => { - if (symbolName2 === "default" /* Default */) { - return void 0; - } - const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(symbolToken); - const useRequire = shouldUseRequire(sourceFile, program); - const exportInfo = getExportInfos(symbolName2, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences); - return arrayFrom( - flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), - (fix) => ({ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName2 !== symbolToken.text }) - ); - }); -} -function getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName2, program) { - const checker = program.getTypeChecker(); - const symbol = checker.resolveName( - symbolName2, - symbolToken, - 111551 /* Value */, - /*excludeGlobals*/ - true - ); - if (!symbol) return void 0; - const typeOnlyAliasDeclaration = checker.getTypeOnlyAliasDeclaration(symbol); - if (!typeOnlyAliasDeclaration || getSourceFileOfNode(typeOnlyAliasDeclaration) !== sourceFile) return void 0; - return { kind: 4 /* PromoteTypeOnly */, typeOnlyAliasDeclaration }; -} -function getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions) { - const parent2 = symbolToken.parent; - if ((isJsxOpeningLikeElement(parent2) || isJsxClosingElement(parent2)) && parent2.tagName === symbolToken && jsxModeNeedsExplicitImport(compilerOptions.jsx)) { - const jsxNamespace = checker.getJsxNamespace(sourceFile); - if (needsJsxNamespaceFix(jsxNamespace, symbolToken, checker)) { - const needsComponentNameFix = !isIntrinsicJsxName(symbolToken.text) && !checker.resolveName( - symbolToken.text, - symbolToken, - 111551 /* Value */, - /*excludeGlobals*/ - false - ); - return needsComponentNameFix ? [symbolToken.text, jsxNamespace] : [jsxNamespace]; - } - } - return [symbolToken.text]; -} -function needsJsxNamespaceFix(jsxNamespace, symbolToken, checker) { - if (isIntrinsicJsxName(symbolToken.text)) return true; - const namespaceSymbol = checker.resolveName( - jsxNamespace, - symbolToken, - 111551 /* Value */, - /*excludeGlobals*/ - true - ); - return !namespaceSymbol || some(namespaceSymbol.declarations, isTypeOnlyImportOrExportDeclaration) && !(namespaceSymbol.flags & 111551 /* Value */); -} -function getExportInfos(symbolName2, isJsxTagName, currentTokenMeaning, cancellationToken, fromFile, program, useAutoImportProvider, host, preferences) { - var _a; - const originalSymbolToExportInfos = createMultiMap(); - const packageJsonFilter = createPackageJsonImportFilter(fromFile, preferences, host); - const moduleSpecifierCache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host); - const getModuleSpecifierResolutionHost = memoizeOne((isFromPackageJson) => { - return createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host); - }); - function addSymbol(moduleSymbol, toFile, exportedSymbol, exportKind, program2, isFromPackageJson) { - const moduleSpecifierResolutionHost = getModuleSpecifierResolutionHost(isFromPackageJson); - if (isImportable(program2, fromFile, toFile, moduleSymbol, preferences, packageJsonFilter, moduleSpecifierResolutionHost, moduleSpecifierCache)) { - const checker = program2.getTypeChecker(); - originalSymbolToExportInfos.add(getUniqueSymbolId(exportedSymbol, checker).toString(), { symbol: exportedSymbol, moduleSymbol, moduleFileName: toFile == null ? void 0 : toFile.fileName, exportKind, targetFlags: skipAlias(exportedSymbol, checker).flags, isFromPackageJson }); - } - } - forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, (moduleSymbol, sourceFile, program2, isFromPackageJson) => { - const checker = program2.getTypeChecker(); - cancellationToken.throwIfCancellationRequested(); - const compilerOptions = program2.getCompilerOptions(); - const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker); - if (defaultInfo && symbolFlagsHaveMeaning(checker.getSymbolFlags(defaultInfo.symbol), currentTokenMeaning) && forEachNameOfDefaultExport(defaultInfo.symbol, checker, getEmitScriptTarget(compilerOptions), (name, capitalizedName) => (isJsxTagName ? capitalizedName ?? name : name) === symbolName2)) { - addSymbol(moduleSymbol, sourceFile, defaultInfo.symbol, defaultInfo.exportKind, program2, isFromPackageJson); - } - const exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); - if (exportSymbolWithIdenticalName && symbolFlagsHaveMeaning(checker.getSymbolFlags(exportSymbolWithIdenticalName), currentTokenMeaning)) { - addSymbol(moduleSymbol, sourceFile, exportSymbolWithIdenticalName, 0 /* Named */, program2, isFromPackageJson); - } - }); - return originalSymbolToExportInfos; -} -function getExportEqualsImportKind(importingFile, compilerOptions, forceImportKeyword) { - const allowSyntheticDefaults = getAllowSyntheticDefaultImports(compilerOptions); - const isJS = hasJSFileExtension(importingFile.fileName); - if (!isJS && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */) { - return allowSyntheticDefaults ? 1 /* Default */ : 2 /* Namespace */; - } - if (isJS) { - return importingFile.externalModuleIndicator || forceImportKeyword ? allowSyntheticDefaults ? 1 /* Default */ : 2 /* Namespace */ : 3 /* CommonJS */; - } - for (const statement of importingFile.statements ?? emptyArray) { - if (isImportEqualsDeclaration(statement) && !nodeIsMissing(statement.moduleReference)) { - return 3 /* CommonJS */; - } - } - return allowSyntheticDefaults ? 1 /* Default */ : 3 /* CommonJS */; -} -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, program, preferences); - }); - return createCodeFixAction(importFixName, changes, diag2, importFixId, Diagnostics.Add_all_missing_imports); -} -function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences) { - const quotePreference = getQuotePreference(sourceFile, preferences); - switch (fix.kind) { - case 0 /* UseNamespace */: - addNamespaceQualifier(changes, sourceFile, fix); - return [Diagnostics.Change_0_to_1, symbolName2, `${fix.namespacePrefix}.${symbolName2}`]; - case 1 /* JsdocTypeImport */: - addImportType(changes, sourceFile, fix, quotePreference); - return [Diagnostics.Change_0_to_1, symbolName2, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName2]; - case 2 /* AddToExisting */: { - const { importClauseOrBindingPattern, importKind, addAsTypeOnly, moduleSpecifier } = fix; - doAddExistingFix( - changes, - sourceFile, - importClauseOrBindingPattern, - importKind === 1 /* Default */ ? { name: symbolName2, addAsTypeOnly } : void 0, - importKind === 0 /* Named */ ? [{ name: symbolName2, addAsTypeOnly }] : emptyArray, - /*removeExistingImportSpecifiers*/ - void 0, - preferences - ); - const moduleSpecifierWithoutQuotes = stripQuotes(moduleSpecifier); - return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifierWithoutQuotes] : [Diagnostics.Update_import_from_0, moduleSpecifierWithoutQuotes]; - } - case 3 /* AddNew */: { - const { importKind, moduleSpecifier, addAsTypeOnly, useRequire, qualification } = fix; - const getDeclarations = useRequire ? getNewRequires : getNewImports; - const defaultImport = importKind === 1 /* Default */ ? { name: symbolName2, addAsTypeOnly } : void 0; - const namedImports = importKind === 0 /* Named */ ? [{ name: symbolName2, addAsTypeOnly }] : void 0; - const namespaceLikeImport = importKind === 2 /* Namespace */ || importKind === 3 /* CommonJS */ ? { importKind, name: (qualification == null ? void 0 : qualification.namespacePrefix) || symbolName2, addAsTypeOnly } : void 0; - insertImports( - changes, - sourceFile, - getDeclarations( - moduleSpecifier, - quotePreference, - defaultImport, - namedImports, - namespaceLikeImport, - program.getCompilerOptions(), - preferences - ), - /*blankLineBetween*/ - true, - preferences - ); - if (qualification) { - addNamespaceQualifier(changes, sourceFile, qualification); - } - return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifier] : [Diagnostics.Add_import_from_0, moduleSpecifier]; - } - case 4 /* PromoteTypeOnly */: { - const { typeOnlyAliasDeclaration } = fix; - const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, program, sourceFile, preferences); - return promotedDeclaration.kind === 277 /* 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}`); - } -} -function getModuleSpecifierText(promotedDeclaration) { - var _a, _b; - return promotedDeclaration.kind === 272 /* 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, program, sourceFile, preferences) { - const compilerOptions = program.getCompilerOptions(); - const convertExistingToTypeOnly = compilerOptions.verbatimModuleSyntax; - switch (aliasDeclaration.kind) { - case 277 /* ImportSpecifier */: - if (aliasDeclaration.isTypeOnly) { - if (aliasDeclaration.parent.elements.length > 1) { - const newSpecifier = factory.updateImportSpecifier( - aliasDeclaration, - /*isTypeOnly*/ - false, - aliasDeclaration.propertyName, - aliasDeclaration.name - ); - const { specifierComparer } = ts_OrganizeImports_exports.getNamedImportSpecifierComparerWithDetection(aliasDeclaration.parent.parent.parent, preferences, sourceFile); - const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, specifierComparer); - 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 274 /* ImportClause */: - promoteImportClause(aliasDeclaration); - return aliasDeclaration; - case 275 /* NamespaceImport */: - promoteImportClause(aliasDeclaration.parent); - return aliasDeclaration.parent; - case 272 /* 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, sourceFile)) == 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) { - const sortState = ts_OrganizeImports_exports.getNamedImportSpecifierComparerWithDetection(importClause.parent, preferences, sourceFile); - if (sortState.isSorted !== false && aliasDeclaration.kind === 277 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { - changes.delete(sourceFile, aliasDeclaration); - changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); - } - for (const element of namedImports.elements) { - if (element !== aliasDeclaration && !element.isTypeOnly) { - changes.insertModifierBefore(sourceFile, 156 /* TypeKeyword */, element); - } - } - } - } - } -} -function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, removeExistingImportSpecifiers, preferences) { - var _a; - if (clause.kind === 207 /* ObjectBindingPattern */) { - if (removeExistingImportSpecifiers && clause.elements.some((e) => removeExistingImportSpecifiers.has(e))) { - changes.replaceNode( - sourceFile, - clause, - factory.createObjectBindingPattern([ - ...clause.elements.filter((e) => !removeExistingImportSpecifiers.has(e)), - ...defaultImport ? [factory.createBindingElement( - /*dotDotDotToken*/ - void 0, - /*propertyName*/ - "default", - defaultImport.name - )] : emptyArray, - ...namedImports.map((i) => factory.createBindingElement( - /*dotDotDotToken*/ - void 0, - i.propertyName, - i.name - )) - ]) - ); - return; - } - if (defaultImport) { - addElementToBindingPattern(clause, defaultImport.name, "default"); - } - for (const specifier of namedImports) { - addElementToBindingPattern(clause, specifier.name, specifier.propertyName); - } - return; - } - const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */); - const existingSpecifiers = clause.namedBindings && ((_a = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a.elements); - if (defaultImport) { - Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); - changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); - } - if (namedImports.length) { - const { specifierComparer, isSorted } = ts_OrganizeImports_exports.getNamedImportSpecifierComparerWithDetection(clause.parent, preferences, sourceFile); - const newSpecifiers = toSorted( - namedImports.map( - (namedImport) => factory.createImportSpecifier( - (!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences), - namedImport.propertyName === void 0 ? void 0 : factory.createIdentifier(namedImport.propertyName), - factory.createIdentifier(namedImport.name) - ) - ), - specifierComparer - ); - if (removeExistingImportSpecifiers) { - changes.replaceNode( - sourceFile, - clause.namedBindings, - factory.updateNamedImports( - clause.namedBindings, - toSorted([...existingSpecifiers.filter((s) => !removeExistingImportSpecifiers.has(s)), ...newSpecifiers], specifierComparer) - ) - ); - } else if ((existingSpecifiers == null ? void 0 : existingSpecifiers.length) && isSorted !== false) { - const transformedExistingSpecifiers = promoteFromTypeOnly2 && existingSpecifiers ? factory.updateNamedImports( - clause.namedBindings, - sameMap(existingSpecifiers, (e) => factory.updateImportSpecifier( - e, - /*isTypeOnly*/ - true, - e.propertyName, - e.name - )) - ).elements : existingSpecifiers; - for (const spec of newSpecifiers) { - const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(transformedExistingSpecifiers, spec, specifierComparer); - changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings, insertionIndex); - } - } else if (existingSpecifiers == null ? void 0 : existingSpecifiers.length) { - for (const spec of newSpecifiers) { - changes.insertNodeInListAfter(sourceFile, last(existingSpecifiers), spec, existingSpecifiers); - } - } else { - if (newSpecifiers.length) { - const namedImports2 = factory.createNamedImports(newSpecifiers); - if (clause.namedBindings) { - changes.replaceNode(sourceFile, clause.namedBindings, namedImports2); - } else { - changes.insertNodeAfter(sourceFile, Debug.checkDefined(clause.name, "Import clause must have either named imports or a default import"), namedImports2); - } - } - } - } - if (promoteFromTypeOnly2) { - changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(clause, sourceFile)); - if (existingSpecifiers) { - for (const specifier of existingSpecifiers) { - changes.insertModifierBefore(sourceFile, 156 /* TypeKeyword */, specifier); - } - } - } - function addElementToBindingPattern(bindingPattern, name, propertyName) { - const element = factory.createBindingElement( - /*dotDotDotToken*/ - void 0, - propertyName, - name - ); - if (bindingPattern.elements.length) { - changes.insertNodeInListAfter(sourceFile, last(bindingPattern.elements), element); - } else { - changes.replaceNode(sourceFile, bindingPattern, factory.createObjectBindingPattern([element])); - } - } -} -function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, usagePosition }) { - changes.insertText(sourceFile, usagePosition, namespacePrefix + "."); -} -function addImportType(changes, sourceFile, { moduleSpecifier, usagePosition: position }, quotePreference) { - changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference)); -} -function getImportTypePrefix(moduleSpecifier, quotePreference) { - const quote2 = getQuoteFromPreference(quotePreference); - return `import(${quote2}${moduleSpecifier}${quote2}).`; -} -function needsTypeOnly({ addAsTypeOnly }) { - return addAsTypeOnly === 2 /* Required */; -} -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 || 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), - namedImport.propertyName === void 0 ? void 0 : factory.createIdentifier(namedImport.propertyName), - factory.createIdentifier(namedImport.name) - ) - ), - moduleSpecifier, - quotePreference, - topLevelTypeOnly - ) - ); - } - if (namespaceLikeImport) { - const declaration = namespaceLikeImport.importKind === 3 /* CommonJS */ ? factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - shouldUseTypeOnly(namespaceLikeImport, preferences), - factory.createIdentifier(namespaceLikeImport.name), - factory.createExternalModuleReference(quotedModuleSpecifier) - ) : factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - shouldUseTypeOnly(namespaceLikeImport, preferences) ? 156 /* TypeKeyword */ : void 0, - /*name*/ - void 0, - factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name)) - ), - quotedModuleSpecifier, - /*attributes*/ - void 0 - ); - statements = combine(statements, declaration); - } - return Debug.checkDefined(statements); -} -function getNewRequires(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) { - const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference); - let statements; - if (defaultImport || (namedImports == null ? void 0 : namedImports.length)) { - const bindingElements = (namedImports == null ? void 0 : namedImports.map(({ name, propertyName }) => factory.createBindingElement( - /*dotDotDotToken*/ - void 0, - propertyName, - name - ))) || []; - if (defaultImport) { - bindingElements.unshift(factory.createBindingElement( - /*dotDotDotToken*/ - void 0, - "default", - defaultImport.name - )); - } - const declaration = createConstEqualsRequireDeclaration(factory.createObjectBindingPattern(bindingElements), quotedModuleSpecifier); - statements = combine(statements, declaration); - } - if (namespaceLikeImport) { - const declaration = createConstEqualsRequireDeclaration(namespaceLikeImport.name, quotedModuleSpecifier); - statements = combine(statements, declaration); - } - return Debug.checkDefined(statements); -} -function createConstEqualsRequireDeclaration(name, quotedModuleSpecifier) { - return factory.createVariableStatement( - /*modifiers*/ - void 0, - 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, - [quotedModuleSpecifier] - ) - ) - ], 2 /* Const */) - ); -} -function symbolFlagsHaveMeaning(flags, meaning) { - return meaning === 7 /* All */ ? true : meaning & 1 /* Value */ ? !!(flags & 111551 /* Value */) : meaning & 2 /* Type */ ? !!(flags & 788968 /* Type */) : meaning & 4 /* Namespace */ ? !!(flags & 1920 /* Namespace */) : false; -} -function getImpliedNodeFormatForEmit(file, program) { - return isFullSourceFile(file) ? program.getImpliedNodeFormatForEmit(file) : getImpliedNodeFormatForEmitWorker(file, program.getCompilerOptions()); -} -function getEmitModuleFormatOfFile(file, program) { - return isFullSourceFile(file) ? program.getEmitModuleFormatOfFile(file) : getEmitModuleFormatOfFileWorker(file, program.getCompilerOptions()); -} - -// src/services/codefixes/fixAddMissingConstraint.ts -var fixId18 = "addMissingConstraint"; -var errorCodes20 = [ - // We want errors this could be attached to: - // Diagnostics.This_type_parameter_probably_needs_an_extends_0_constraint - Diagnostics.Type_0_is_not_comparable_to_type_1.code, - Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code, - Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, - Diagnostics.Type_0_is_not_assignable_to_type_1.code, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, - Diagnostics.Property_0_is_incompatible_with_index_signature.code, - Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code, - Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code -]; -registerCodeFix({ - errorCodes: errorCodes20, - getCodeActions(context) { - const { sourceFile, span, program, preferences, host } = context; - const info = getInfo6(program, sourceFile, span); - if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingConstraint(t, program, preferences, host, sourceFile, info)); - return [createCodeFixAction(fixId18, changes, Diagnostics.Add_extends_constraint, fixId18, Diagnostics.Add_extends_constraint_to_all_type_parameters)]; - }, - fixIds: [fixId18], - getAllCodeActions: (context) => { - const { program, preferences, host } = context; - const seen = /* @__PURE__ */ new Set(); - return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes20, (diag2) => { - const info = getInfo6(program, diag2.file, createTextSpan(diag2.start, diag2.length)); - if (info) { - if (addToSeen(seen, getNodeId(info.declaration))) { - return addMissingConstraint(changes, program, preferences, host, diag2.file, info); - } - } - return void 0; - }); - })); - } -}); -function getInfo6(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; - const related = find(diag2.relatedInformation, (related2) => related2.code === Diagnostics.This_type_parameter_might_need_an_extends_0_constraint.code); - if (related === void 0 || related.file === void 0 || related.start === void 0 || related.length === void 0) return; - let declaration = findAncestorMatchingSpan(related.file, createTextSpan(related.start, related.length)); - if (declaration === void 0) return; - if (isIdentifier(declaration) && isTypeParameterDeclaration(declaration.parent)) { - declaration = declaration.parent; - } - if (isTypeParameterDeclaration(declaration)) { - if (isMappedTypeNode(declaration.parent)) return; - const token = getTokenAtPosition(sourceFile, span.start); - const checker = program.getTypeChecker(); - const constraint = tryGetConstraintType(checker, token) || tryGetConstraintFromDiagnosticMessage(related.messageText); - return { constraint, declaration, token }; - } - return void 0; -} -function addMissingConstraint(changes, program, preferences, host, sourceFile, info) { - const { declaration, constraint } = info; - const checker = program.getTypeChecker(); - if (isString(constraint)) { - changes.insertText(sourceFile, declaration.name.end, ` extends ${constraint}`); - } else { - const scriptTarget = getEmitScriptTarget(program.getCompilerOptions()); - const tracker = getNoopSymbolTrackerWithResolver({ program, host }); - const importAdder = createImportAdder(sourceFile, program, preferences, host); - const typeNode = typeToAutoImportableTypeNode( - checker, - importAdder, - constraint, - /*contextNode*/ - void 0, - scriptTarget, - /*flags*/ - void 0, - /*internalFlags*/ - void 0, - tracker - ); - if (typeNode) { - changes.replaceNode(sourceFile, declaration, factory.updateTypeParameterDeclaration( - declaration, - /*modifiers*/ - void 0, - declaration.name, - typeNode, - declaration.default - )); - importAdder.writeFixes(changes); - } - } -} -function tryGetConstraintFromDiagnosticMessage(messageText) { - const [, constraint] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || []; - return constraint; -} -function tryGetConstraintType(checker, node) { - if (isTypeNode(node.parent)) { - return checker.getTypeArgumentConstraint(node.parent); - } - const contextualType = isExpression(node) ? checker.getContextualType(node) : void 0; - return contextualType || checker.getTypeAtLocation(node); -} - -// src/services/codefixes/fixOverrideModifier.ts -var fixName = "fixOverrideModifier"; -var fixAddOverrideId = "fixAddOverrideModifier"; -var fixRemoveOverrideId = "fixRemoveOverrideModifier"; -var errorCodes21 = [ - Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code, - Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code, - Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code, - Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code, - Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code, - Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code, - Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code, - Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code, - Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code -]; -var errorCodeFixIdMap = { - // case #1: - [Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]: { - descriptions: Diagnostics.Add_override_modifier, - fixId: fixAddOverrideId, - fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers - }, - [Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]: { - descriptions: Diagnostics.Add_override_modifier, - fixId: fixAddOverrideId, - fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers - }, - // case #2: - [Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]: { - descriptions: Diagnostics.Remove_override_modifier, - fixId: fixRemoveOverrideId, - fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers - }, - [Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]: { - descriptions: Diagnostics.Remove_override_modifier, - fixId: fixRemoveOverrideId, - fixAllDescriptions: Diagnostics.Remove_override_modifier - }, - // case #3: - [Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]: { - descriptions: Diagnostics.Add_override_modifier, - fixId: fixAddOverrideId, - fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers - }, - [Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]: { - descriptions: Diagnostics.Add_override_modifier, - fixId: fixAddOverrideId, - fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers - }, - // case #4: - [Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]: { - descriptions: Diagnostics.Add_override_modifier, - fixId: fixAddOverrideId, - fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers - }, - // case #5: - [Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]: { - descriptions: Diagnostics.Remove_override_modifier, - fixId: fixRemoveOverrideId, - fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers - }, - [Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]: { - descriptions: Diagnostics.Remove_override_modifier, - fixId: fixRemoveOverrideId, - fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers - } -}; -registerCodeFix({ - errorCodes: errorCodes21, - getCodeActions: function getCodeActionsToFixOverrideModifierIssues(context) { - const { errorCode, span } = context; - const info = errorCodeFixIdMap[errorCode]; - if (!info) return emptyArray; - const { descriptions, fixId: fixId56, fixAllDescriptions } = info; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => dispatchChanges(changes2, context, errorCode, span.start)); - return [ - createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId56, fixAllDescriptions) - ]; - }, - fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId], - getAllCodeActions: (context) => codeFixAll(context, errorCodes21, (changes, diag2) => { - const { code, start } = diag2; - const info = errorCodeFixIdMap[code]; - if (!info || info.fixId !== context.fixId) { - return; - } - dispatchChanges(changes, context, code, start); - }) -}); -function dispatchChanges(changeTracker, context, errorCode, pos) { - switch (errorCode) { - case Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code: - case Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code: - case Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code: - case Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code: - case Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code: - return doAddOverrideModifierChange(changeTracker, context.sourceFile, pos); - case Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code: - case Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code: - case Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code: - case Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code: - return doRemoveOverrideModifierChange(changeTracker, context.sourceFile, pos); - default: - Debug.fail("Unexpected error code: " + errorCode); - } -} -function doAddOverrideModifierChange(changeTracker, sourceFile, pos) { - const classElement = findContainerClassElementLike(sourceFile, pos); - if (isSourceFileJS(sourceFile)) { - changeTracker.addJSDocTags(sourceFile, classElement, [factory.createJSDocOverrideTag(factory.createIdentifier("override"))]); - return; - } - const modifiers = classElement.modifiers || emptyArray; - const staticModifier = find(modifiers, isStaticModifier); - const abstractModifier = find(modifiers, isAbstractModifier); - const accessibilityModifier = find(modifiers, (m) => isAccessibilityModifier(m.kind)); - 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, 164 /* OverrideKeyword */, options); -} -function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) { - const classElement = findContainerClassElementLike(sourceFile, pos); - if (isSourceFileJS(sourceFile)) { - changeTracker.filterJSDocTags(sourceFile, classElement, not(isJSDocOverrideTag)); - return; - } - const overrideModifier = find(classElement.modifiers, isOverrideModifier); - Debug.assertIsDefined(overrideModifier); - changeTracker.deleteModifier(sourceFile, overrideModifier); -} -function isClassElementLikeHasJSDoc(node) { - switch (node.kind) { - case 177 /* Constructor */: - case 173 /* PropertyDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return true; - case 170 /* Parameter */: - return isParameterPropertyDeclaration(node, node.parent); - default: - return false; - } -} -function findContainerClassElementLike(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - const classElement = findAncestor(token, (node) => { - if (isClassLike(node)) return "quit"; - return isClassElementLikeHasJSDoc(node); - }); - Debug.assert(classElement && isClassElementLikeHasJSDoc(classElement)); - return classElement; -} - -// src/services/codefixes/fixNoPropertyAccessFromIndexSignature.ts -var fixId19 = "fixNoPropertyAccessFromIndexSignature"; -var errorCodes22 = [ - Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code -]; -registerCodeFix({ - errorCodes: errorCodes22, - fixIds: [fixId19], - getCodeActions(context) { - const { sourceFile, span, preferences } = context; - const property = getPropertyAccessExpression(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property, preferences)); - return [createCodeFixAction(fixId19, changes, [Diagnostics.Use_element_access_for_0, property.name.text], fixId19, Diagnostics.Use_element_access_for_all_undeclared_properties)]; - }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes22, (changes, diag2) => doChange14(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences)) -}); -function doChange14(changes, sourceFile, node, preferences) { - const quotePreference = getQuotePreference(sourceFile, preferences); - const argumentsExpression = factory.createStringLiteral(node.name.text, quotePreference === 0 /* Single */); - changes.replaceNode( - sourceFile, - node, - isPropertyAccessChain(node) ? factory.createElementAccessChain(node.expression, node.questionDotToken, argumentsExpression) : factory.createElementAccessExpression(node.expression, argumentsExpression) - ); -} -function getPropertyAccessExpression(sourceFile, pos) { - return cast(getTokenAtPosition(sourceFile, pos).parent, isPropertyAccessExpression); -} - -// src/services/codefixes/fixImplicitThis.ts -var fixId20 = "fixImplicitThis"; -var errorCodes23 = [Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code]; -registerCodeFix({ - errorCodes: errorCodes23, - getCodeActions: function getCodeActionsToFixImplicitThis(context) { - const { sourceFile, program, span } = context; - let diagnostic; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - diagnostic = doChange15(t, sourceFile, span.start, program.getTypeChecker()); - }); - return diagnostic ? [createCodeFixAction(fixId20, changes, diagnostic, fixId20, Diagnostics.Fix_all_implicit_this_errors)] : emptyArray; - }, - fixIds: [fixId20], - getAllCodeActions: (context) => codeFixAll(context, errorCodes23, (changes, diag2) => { - doChange15(changes, diag2.file, diag2.start, context.program.getTypeChecker()); - }) -}); -function doChange15(changes, sourceFile, pos, checker) { - const token = getTokenAtPosition(sourceFile, pos); - if (!isThis(token)) return void 0; - const fn = getThisContainer( - token, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (!isFunctionDeclaration(fn) && !isFunctionExpression(fn)) return void 0; - if (!isSourceFile(getThisContainer( - fn, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ))) { - const fnKeyword = Debug.checkDefined(findChildOfKind(fn, 100 /* FunctionKeyword */, sourceFile)); - const { name } = fn; - const body = Debug.checkDefined(fn.body); - if (isFunctionExpression(fn)) { - if (name && ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(name, checker, sourceFile, body)) { - return void 0; - } - changes.delete(sourceFile, fnKeyword); - if (name) { - changes.delete(sourceFile, name); - } - changes.insertText(sourceFile, body.pos, " =>"); - return [Diagnostics.Convert_function_expression_0_to_arrow_function, name ? name.text : ANONYMOUS]; - } else { - changes.replaceNode(sourceFile, fnKeyword, factory.createToken(87 /* ConstKeyword */)); - changes.insertText(sourceFile, name.end, " = "); - changes.insertText(sourceFile, body.pos, " =>"); - return [Diagnostics.Convert_function_declaration_0_to_arrow_function, name.text]; - } - } -} - -// src/services/codefixes/fixImportNonExportedMember.ts -var fixId21 = "fixImportNonExportedMember"; -var errorCodes24 = [ - Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported.code -]; -registerCodeFix({ - errorCodes: errorCodes24, - fixIds: [fixId21], - getCodeActions(context) { - const { sourceFile, span, program } = context; - const info = getInfo7(sourceFile, span.start, program); - if (info === void 0) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange16(t, program, info)); - return [createCodeFixAction(fixId21, changes, [Diagnostics.Export_0_from_module_1, info.exportName.node.text, info.moduleSpecifier], fixId21, Diagnostics.Export_all_referenced_locals)]; - }, - getAllCodeActions(context) { - const { program } = context; - return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - const exports2 = /* @__PURE__ */ new Map(); - eachDiagnostic(context, errorCodes24, (diag2) => { - const info = getInfo7(diag2.file, diag2.start, program); - if (info === void 0) return void 0; - const { exportName, node, moduleSourceFile } = info; - if (tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly) === void 0 && canHaveExportModifier(node)) { - changes.insertExportModifier(moduleSourceFile, node); - } else { - const moduleExports = exports2.get(moduleSourceFile) || { typeOnlyExports: [], exports: [] }; - if (exportName.isTypeOnly) { - moduleExports.typeOnlyExports.push(exportName); - } else { - moduleExports.exports.push(exportName); - } - exports2.set(moduleSourceFile, moduleExports); - } - }); - exports2.forEach((moduleExports, moduleSourceFile) => { - const exportDeclaration = tryGetExportDeclaration( - moduleSourceFile, - /*isTypeOnly*/ - true - ); - if (exportDeclaration && exportDeclaration.isTypeOnly) { - doChanges(changes, program, moduleSourceFile, moduleExports.typeOnlyExports, exportDeclaration); - doChanges(changes, program, moduleSourceFile, moduleExports.exports, tryGetExportDeclaration( - moduleSourceFile, - /*isTypeOnly*/ - false - )); - } else { - doChanges(changes, program, moduleSourceFile, [...moduleExports.exports, ...moduleExports.typeOnlyExports], exportDeclaration); - } - }); - })); - } -}); -function getInfo7(sourceFile, pos, program) { - 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 : void 0; - if (moduleSpecifier === void 0) return void 0; - const resolvedModule = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, sourceFile)) == 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 = (_b = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _b.locals; - if (locals === void 0) return void 0; - const localSymbol = locals.get(token.escapedText); - if (localSymbol === void 0) return void 0; - const node = getNodeOfSymbol(localSymbol); - if (node === void 0) return void 0; - const exportName = { node: token, isTypeOnly: isTypeDeclaration(node) }; - return { exportName, node, moduleSourceFile, moduleSpecifier: moduleSpecifier.text }; - } - return void 0; -} -function doChange16(changes, program, { exportName, node, moduleSourceFile }) { - const exportDeclaration = tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly); - if (exportDeclaration) { - updateExport(changes, program, moduleSourceFile, exportDeclaration, [exportName]); - } else if (canHaveExportModifier(node)) { - changes.insertExportModifier(moduleSourceFile, node); - } else { - createExport(changes, program, moduleSourceFile, [exportName]); - } -} -function doChanges(changes, program, sourceFile, moduleExports, node) { - if (length(moduleExports)) { - if (node) { - updateExport(changes, program, sourceFile, node, moduleExports); - } else { - createExport(changes, program, sourceFile, moduleExports); - } - } -} -function tryGetExportDeclaration(sourceFile, isTypeOnly) { - const predicate = (node) => isExportDeclaration(node) && (isTypeOnly && node.isTypeOnly || !node.isTypeOnly); - return findLast(sourceFile.statements, predicate); -} -function updateExport(changes, program, sourceFile, node, names) { - const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]); - const allowTypeModifier = !node.isTypeOnly && !!(getIsolatedModules(program.getCompilerOptions()) || find(namedExports, (e) => e.isTypeOnly)); - changes.replaceNode( - sourceFile, - node, - factory.updateExportDeclaration( - node, - node.modifiers, - node.isTypeOnly, - factory.createNamedExports( - factory.createNodeArray( - [...namedExports, ...createExportSpecifiers(names, allowTypeModifier)], - /*hasTrailingComma*/ - namedExports.hasTrailingComma - ) - ), - node.moduleSpecifier, - 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, - /*attributes*/ - void 0 - )); -} -function createExportSpecifiers(names, allowTypeModifier) { - return factory.createNodeArray(map(names, (n) => factory.createExportSpecifier( - allowTypeModifier && n.isTypeOnly, - /*propertyName*/ - void 0, - n.node - ))); -} -function getNodeOfSymbol(symbol) { - if (symbol.valueDeclaration === void 0) { - return firstOrUndefined(symbol.declarations); - } - const declaration = symbol.valueDeclaration; - const variableStatement = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : void 0; - return variableStatement && length(variableStatement.declarationList.declarations) === 1 ? variableStatement : declaration; -} - -// src/services/codefixes/fixIncorrectNamedTupleSyntax.ts -var fixId22 = "fixIncorrectNamedTupleSyntax"; -var errorCodes25 = [ - 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.code, - Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code -]; -registerCodeFix({ - errorCodes: errorCodes25, - getCodeActions: function getCodeActionsToFixIncorrectNamedTupleSyntax(context) { - const { sourceFile, span } = context; - const namedTupleMember = getNamedTupleMember(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange17(t, sourceFile, namedTupleMember)); - return [createCodeFixAction(fixId22, changes, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels, fixId22, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]; - }, - fixIds: [fixId22] -}); -function getNamedTupleMember(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - return findAncestor(token, (t) => t.kind === 203 /* NamedTupleMember */); -} -function doChange17(changes, sourceFile, namedTupleMember) { - if (!namedTupleMember) { - return; - } - let unwrappedType = namedTupleMember.type; - let sawOptional = false; - let sawRest = false; - while (unwrappedType.kind === 191 /* OptionalType */ || unwrappedType.kind === 192 /* RestType */ || unwrappedType.kind === 197 /* ParenthesizedType */) { - if (unwrappedType.kind === 191 /* OptionalType */) { - sawOptional = true; - } else if (unwrappedType.kind === 192 /* RestType */) { - sawRest = true; - } - unwrappedType = unwrappedType.type; - } - const updated = factory.updateNamedTupleMember( - namedTupleMember, - namedTupleMember.dotDotDotToken || (sawRest ? factory.createToken(26 /* DotDotDotToken */) : void 0), - namedTupleMember.name, - namedTupleMember.questionToken || (sawOptional ? factory.createToken(58 /* QuestionToken */) : void 0), - unwrappedType - ); - if (updated === namedTupleMember) { - return; - } - changes.replaceNode(sourceFile, namedTupleMember, updated); -} - -// src/services/codefixes/fixSpelling.ts -var fixId23 = "fixSpelling"; -var errorCodes26 = [ - Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, - Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, - Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, - Diagnostics.Could_not_find_name_0_Did_you_mean_1.code, - Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code, - Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, - Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, - Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code, - Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code, - 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.code, - // for JSX class components - Diagnostics.No_overload_matches_this_call.code, - // for JSX FC - Diagnostics.Type_0_is_not_assignable_to_type_1.code -]; -registerCodeFix({ - errorCodes: errorCodes26, - getCodeActions(context) { - const { sourceFile, errorCode } = context; - const info = getInfo8(sourceFile, context.span.start, context, errorCode); - if (!info) return void 0; - const { node, suggestedSymbol } = info; - const target = getEmitScriptTarget(context.host.getCompilationSettings()); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange18(t, sourceFile, node, suggestedSymbol, target)); - return [createCodeFixAction("spelling", changes, [Diagnostics.Change_spelling_to_0, symbolName(suggestedSymbol)], fixId23, Diagnostics.Fix_all_detected_spelling_errors)]; - }, - fixIds: [fixId23], - getAllCodeActions: (context) => codeFixAll(context, errorCodes26, (changes, diag2) => { - const info = getInfo8(diag2.file, diag2.start, context, diag2.code); - const target = getEmitScriptTarget(context.host.getCompilationSettings()); - if (info) doChange18(changes, context.sourceFile, info.node, info.suggestedSymbol, target); - }) -}); -function getInfo8(sourceFile, pos, context, errorCode) { - const node = getTokenAtPosition(sourceFile, pos); - const parent2 = node.parent; - if ((errorCode === Diagnostics.No_overload_matches_this_call.code || errorCode === Diagnostics.Type_0_is_not_assignable_to_type_1.code) && !isJsxAttribute(parent2)) return void 0; - const checker = context.program.getTypeChecker(); - let suggestedSymbol; - 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 & 64 /* OptionalChain */) { - containingType = checker.getNonNullableType(containingType); - } - suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); - } else if (isBinaryExpression(parent2) && parent2.operatorToken.kind === 103 /* InKeyword */ && parent2.left === node && isPrivateIdentifier(node)) { - const receiverType = checker.getTypeAtLocation(parent2.right); - suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, receiverType); - } else if (isQualifiedName(parent2) && parent2.right === node) { - const symbol = checker.getSymbolAtLocation(parent2.left); - if (symbol && symbol.flags & 1536 /* Module */) { - suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent2.right, symbol); - } - } 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(context, importDeclaration, sourceFile); - if (resolvedSourceFile && resolvedSourceFile.symbol) { - suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(node, resolvedSourceFile.symbol); - } - } else if (isJsxAttribute(parent2) && parent2.name === node) { - Debug.assertNode(node, isIdentifier, "Expected an identifier for JSX attribute"); - const tag = findAncestor(node, isJsxOpeningLikeElement); - const props = checker.getContextualTypeForArgumentAtIndex(tag, 0); - suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props); - } 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; - if (baseType) { - suggestedSymbol = checker.getSuggestedSymbolForNonexistentClassMember(getTextOfNode(node), baseType); - } - } else { - const meaning = getMeaningFromLocation(node); - const name = getTextOfNode(node); - Debug.assert(name !== void 0, "name should be defined"); - suggestedSymbol = checker.getSuggestedSymbolForNonexistentSymbol(node, name, convertSemanticMeaningToSymbolFlags(meaning)); - } - return suggestedSymbol === void 0 ? void 0 : { node, suggestedSymbol }; -} -function doChange18(changes, sourceFile, node, suggestedSymbol, target) { - const suggestion = symbolName(suggestedSymbol); - if (!isIdentifierText(suggestion, target) && isPropertyAccessExpression(node.parent)) { - const valDecl = suggestedSymbol.valueDeclaration; - if (valDecl && isNamedDeclaration(valDecl) && isPrivateIdentifier(valDecl.name)) { - changes.replaceNode(sourceFile, node, factory.createIdentifier(suggestion)); - } else { - changes.replaceNode(sourceFile, node.parent, factory.createElementAccessExpression(node.parent.expression, factory.createStringLiteral(suggestion))); - } - } else { - changes.replaceNode(sourceFile, node, factory.createIdentifier(suggestion)); - } -} -function convertSemanticMeaningToSymbolFlags(meaning) { - let flags = 0; - if (meaning & 4 /* Namespace */) { - flags |= 1920 /* Namespace */; - } - if (meaning & 2 /* Type */) { - flags |= 788968 /* Type */; - } - if (meaning & 1 /* Value */) { - flags |= 111551 /* Value */; - } - return flags; -} -function getResolvedSourceFileFromImportDeclaration(context, importDeclaration, importingFile) { - var _a; - if (!importDeclaration || !isStringLiteralLike(importDeclaration.moduleSpecifier)) return void 0; - const resolvedModule = (_a = context.program.getResolvedModuleFromModuleSpecifier(importDeclaration.moduleSpecifier, importingFile)) == null ? void 0 : _a.resolvedModule; - if (!resolvedModule) return void 0; - return context.program.getSourceFile(resolvedModule.resolvedFileName); -} - -// src/services/codefixes/returnValueCorrect.ts -var fixId24 = "returnValueCorrect"; -var fixIdAddReturnStatement = "fixAddReturnStatement"; -var fixRemoveBracesFromArrowFunctionBody = "fixRemoveBracesFromArrowFunctionBody"; -var fixIdWrapTheBlockWithParen = "fixWrapTheBlockWithParen"; -var errorCodes27 = [ - Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code, - Diagnostics.Type_0_is_not_assignable_to_type_1.code, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code -]; -registerCodeFix({ - errorCodes: errorCodes27, - fixIds: [fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen], - getCodeActions: function getCodeActionsToCorrectReturnValue(context) { - const { program, sourceFile, span: { start }, errorCode } = context; - const info = getInfo9(program.getTypeChecker(), sourceFile, start, errorCode); - if (!info) return void 0; - if (info.kind === 0 /* MissingReturnStatement */) { - return append( - [getActionForfixAddReturnStatement(context, info.expression, info.statement)], - isArrowFunction(info.declaration) ? getActionForFixRemoveBracesFromArrowFunctionBody(context, info.declaration, info.expression, info.commentSource) : void 0 - ); - } else { - return [getActionForfixWrapTheBlockWithParen(context, info.declaration, info.expression)]; - } - }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes27, (changes, diag2) => { - const info = getInfo9(context.program.getTypeChecker(), diag2.file, diag2.start, diag2.code); - if (!info) return void 0; - switch (context.fixId) { - case fixIdAddReturnStatement: - addReturnStatement(changes, diag2.file, info.expression, info.statement); - break; - case fixRemoveBracesFromArrowFunctionBody: - if (!isArrowFunction(info.declaration)) return void 0; - removeBlockBodyBrace( - changes, - diag2.file, - info.declaration, - info.expression, - info.commentSource, - /*withParen*/ - false - ); - break; - case fixIdWrapTheBlockWithParen: - if (!isArrowFunction(info.declaration)) return void 0; - wrapBlockWithParen(changes, diag2.file, info.declaration, info.expression); - break; - default: - Debug.fail(JSON.stringify(context.fixId)); - } - }) -}); -function createObjectTypeFromLabeledExpression(checker, label, expression) { - const member = checker.createSymbol(4 /* Property */, label.escapedText); - member.links.type = checker.getTypeAtLocation(expression); - const members = createSymbolTable([member]); - return checker.createAnonymousType( - /*symbol*/ - void 0, - members, - [], - [], - [] - ); -} -function getFixInfo(checker, declaration, expectType, isFunctionType) { - if (!declaration.body || !isBlock(declaration.body) || length(declaration.body.statements) !== 1) return void 0; - const firstStatement = first(declaration.body.statements); - if (isExpressionStatement(firstStatement) && checkFixedAssignableTo(checker, declaration, checker.getTypeAtLocation(firstStatement.expression), expectType, isFunctionType)) { - return { - declaration, - kind: 0 /* MissingReturnStatement */, - expression: firstStatement.expression, - statement: firstStatement, - commentSource: firstStatement.expression - }; - } else if (isLabeledStatement(firstStatement) && isExpressionStatement(firstStatement.statement)) { - const node = factory.createObjectLiteralExpression([factory.createPropertyAssignment(firstStatement.label, firstStatement.statement.expression)]); - const nodeType = createObjectTypeFromLabeledExpression(checker, firstStatement.label, firstStatement.statement.expression); - if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) { - return isArrowFunction(declaration) ? { - declaration, - kind: 1 /* MissingParentheses */, - expression: node, - statement: firstStatement, - commentSource: firstStatement.statement.expression - } : { - declaration, - kind: 0 /* MissingReturnStatement */, - expression: node, - statement: firstStatement, - commentSource: firstStatement.statement.expression - }; - } - } else if (isBlock(firstStatement) && length(firstStatement.statements) === 1) { - const firstBlockStatement = first(firstStatement.statements); - if (isLabeledStatement(firstBlockStatement) && isExpressionStatement(firstBlockStatement.statement)) { - const node = factory.createObjectLiteralExpression([factory.createPropertyAssignment(firstBlockStatement.label, firstBlockStatement.statement.expression)]); - const nodeType = createObjectTypeFromLabeledExpression(checker, firstBlockStatement.label, firstBlockStatement.statement.expression); - if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) { - return { - declaration, - kind: 0 /* MissingReturnStatement */, - expression: node, - statement: firstStatement, - commentSource: firstBlockStatement - }; - } - } - } - return void 0; -} -function checkFixedAssignableTo(checker, declaration, exprType, type, isFunctionType) { - if (isFunctionType) { - const sig = checker.getSignatureFromDeclaration(declaration); - if (sig) { - if (hasSyntacticModifier(declaration, 1024 /* Async */)) { - exprType = checker.createPromiseType(exprType); - } - const newSig = checker.createSignature( - declaration, - sig.typeParameters, - sig.thisParameter, - sig.parameters, - exprType, - /*typePredicate*/ - void 0, - sig.minArgumentCount, - sig.flags - ); - exprType = checker.createAnonymousType( - /*symbol*/ - void 0, - createSymbolTable(), - [newSig], - [], - [] - ); - } else { - exprType = checker.getAnyType(); - } - } - return checker.isTypeAssignableTo(exprType, type); -} -function getInfo9(checker, sourceFile, position, errorCode) { - const node = getTokenAtPosition(sourceFile, position); - if (!node.parent) return void 0; - const declaration = findAncestor(node.parent, isFunctionLikeDeclaration); - switch (errorCode) { - case Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code: - if (!declaration || !declaration.body || !declaration.type || !rangeContainsRange(declaration.type, node)) return void 0; - return getFixInfo( - checker, - declaration, - checker.getTypeFromTypeNode(declaration.type), - /*isFunctionType*/ - false - ); - case Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code: - 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; - return getFixInfo( - checker, - declaration, - type, - /*isFunctionType*/ - true - ); - case Diagnostics.Type_0_is_not_assignable_to_type_1.code: - if (!isDeclarationName(node) || !isVariableLike(node.parent) && !isJsxAttribute(node.parent)) return void 0; - const initializer = getVariableLikeInitializer(node.parent); - if (!initializer || !isFunctionLikeDeclaration(initializer) || !initializer.body) return void 0; - return getFixInfo( - checker, - initializer, - checker.getTypeAtLocation(node.parent), - /*isFunctionType*/ - true - ); - } - return void 0; -} -function getVariableLikeInitializer(declaration) { - switch (declaration.kind) { - case 261 /* VariableDeclaration */: - case 170 /* Parameter */: - case 209 /* BindingElement */: - case 173 /* PropertyDeclaration */: - case 304 /* PropertyAssignment */: - return declaration.initializer; - case 292 /* JsxAttribute */: - return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0); - case 305 /* ShorthandPropertyAssignment */: - case 172 /* PropertySignature */: - case 307 /* EnumMember */: - case 349 /* JSDocPropertyTag */: - case 342 /* JSDocParameterTag */: - return void 0; - } -} -function addReturnStatement(changes, sourceFile, expression, statement) { - suppressLeadingAndTrailingTrivia(expression); - const probablyNeedSemi = probablyUsesSemicolons(sourceFile); - changes.replaceNode(sourceFile, statement, factory.createReturnStatement(expression), { - leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude, - suffix: probablyNeedSemi ? ";" : void 0 - }); -} -function removeBlockBodyBrace(changes, sourceFile, declaration, expression, commentSource, withParen) { - const newBody = withParen || needsParentheses(expression) ? factory.createParenthesizedExpression(expression) : expression; - suppressLeadingAndTrailingTrivia(commentSource); - copyComments(commentSource, newBody); - changes.replaceNode(sourceFile, declaration.body, newBody); -} -function wrapBlockWithParen(changes, sourceFile, declaration, expression) { - changes.replaceNode(sourceFile, declaration.body, factory.createParenthesizedExpression(expression)); -} -function getActionForfixAddReturnStatement(context, expression, statement) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addReturnStatement(t, context.sourceFile, expression, statement)); - return createCodeFixAction(fixId24, changes, Diagnostics.Add_a_return_statement, fixIdAddReturnStatement, Diagnostics.Add_all_missing_return_statement); -} -function getActionForFixRemoveBracesFromArrowFunctionBody(context, declaration, expression, commentSource) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => removeBlockBodyBrace( - t, - context.sourceFile, - declaration, - expression, - commentSource, - /*withParen*/ - false - )); - return createCodeFixAction(fixId24, changes, Diagnostics.Remove_braces_from_arrow_function_body, fixRemoveBracesFromArrowFunctionBody, Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues); -} -function getActionForfixWrapTheBlockWithParen(context, declaration, expression) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => wrapBlockWithParen(t, context.sourceFile, declaration, expression)); - return createCodeFixAction(fixId24, changes, Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal, fixIdWrapTheBlockWithParen, Diagnostics.Wrap_all_object_literal_with_parentheses); -} - -// src/services/codefixes/fixAddMissingMember.ts -var fixMissingMember = "fixMissingMember"; -var fixMissingProperties = "fixMissingProperties"; -var fixMissingAttributes = "fixMissingAttributes"; -var fixMissingFunctionDeclaration = "fixMissingFunctionDeclaration"; -var errorCodes28 = [ - Diagnostics.Property_0_does_not_exist_on_type_1.code, - Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, - Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code, - Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code, - Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, - Diagnostics.Cannot_find_name_0.code, - Diagnostics.Type_0_does_not_satisfy_the_expected_type_1.code -]; -registerCodeFix({ - errorCodes: errorCodes28, - getCodeActions(context) { - const typeChecker = context.program.getTypeChecker(); - const info = getInfo10(context.sourceFile, context.span.start, context.errorCode, typeChecker, context.program); - if (!info) { - return void 0; - } - if (info.kind === 3 /* ObjectLiteral */) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addObjectLiteralProperties(t, context, info)); - return [createCodeFixAction(fixMissingProperties, changes, Diagnostics.Add_missing_properties, fixMissingProperties, Diagnostics.Add_all_missing_properties)]; - } - if (info.kind === 4 /* JsxAttributes */) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addJsxAttributes(t, context, info)); - return [createCodeFixAction(fixMissingAttributes, changes, Diagnostics.Add_missing_attributes, fixMissingAttributes, Diagnostics.Add_all_missing_attributes)]; - } - if (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addFunctionDeclaration(t, context, info)); - return [createCodeFixAction(fixMissingFunctionDeclaration, changes, [Diagnostics.Add_missing_function_declaration_0, info.token.text], fixMissingFunctionDeclaration, Diagnostics.Add_all_missing_function_declarations)]; - } - if (info.kind === 1 /* Enum */) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addEnumMemberDeclaration(t, context.program.getTypeChecker(), info)); - return [createCodeFixAction(fixMissingMember, changes, [Diagnostics.Add_missing_enum_member_0, info.token.text], fixMissingMember, Diagnostics.Add_all_missing_members)]; - } - return concatenate(getActionsForMissingMethodDeclaration(context, info), getActionsForMissingMemberDeclaration(context, info)); - }, - fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes], - getAllCodeActions: (context) => { - const { program, fixId: fixId56 } = context; - const checker = program.getTypeChecker(); - const seen = /* @__PURE__ */ new Set(); - const typeDeclToMembers = /* @__PURE__ */ new Map(); - return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes28, (diag2) => { - const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program); - if (info === void 0) return; - const nodeId = getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier || getNodeId(info.token) : info.token.text); - if (!addToSeen(seen, nodeId)) return; - if (fixId56 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) { - addFunctionDeclaration(changes, context, info); - } else if (fixId56 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) { - addObjectLiteralProperties(changes, context, info); - } else if (fixId56 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) { - addJsxAttributes(changes, context, info); - } else { - if (info.kind === 1 /* Enum */) { - addEnumMemberDeclaration(changes, checker, info); - } - if (info.kind === 0 /* TypeLikeDeclaration */) { - const { parentDeclaration, token } = info; - const infos = getOrUpdate(typeDeclToMembers, parentDeclaration, () => []); - if (!infos.some((i) => i.token.text === token.text)) { - infos.push(info); - } - } - } - }); - typeDeclToMembers.forEach((infos, declaration) => { - const supers = isTypeLiteralNode(declaration) ? void 0 : getAllSupers(declaration, checker); - for (const info of infos) { - if (supers == null ? void 0 : supers.some((superClassOrInterface) => { - const superInfos = typeDeclToMembers.get(superClassOrInterface); - return !!superInfos && superInfos.some(({ token: token2 }) => token2.text === info.token.text); - })) continue; - const { parentDeclaration, declSourceFile, modifierFlags, token, call, isJSFile } = info; - if (call && !isPrivateIdentifier(token)) { - addMethodDeclaration(context, changes, call, token, modifierFlags & 256 /* Static */, parentDeclaration, declSourceFile); - } else { - if (isJSFile && !isInterfaceDeclaration(parentDeclaration) && !isTypeLiteralNode(parentDeclaration)) { - addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */)); - } else { - const typeNode = getTypeNode2(checker, parentDeclaration, token); - addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags & 256 /* Static */); - } - } - } - }); - })); - } -}); -function getInfo10(sourceFile, tokenPos, errorCode, checker, program) { - var _a, _b; - const token = getTokenAtPosition(sourceFile, tokenPos); - const parent2 = token.parent; - if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) { - if (!(token.kind === 19 /* OpenBraceToken */ && isObjectLiteralExpression(parent2) && isCallExpression(parent2.parent))) return void 0; - const argIndex = findIndex(parent2.parent.arguments, (arg) => arg === parent2); - if (argIndex < 0) return void 0; - const signature = checker.getResolvedSignature(parent2.parent); - if (!(signature && signature.declaration && signature.parameters[argIndex])) return void 0; - const param = signature.parameters[argIndex].valueDeclaration; - if (!(param && isParameter(param) && isIdentifier(param.name))) return void 0; - const properties = arrayFrom(checker.getUnmatchedProperties( - checker.getTypeAtLocation(parent2), - checker.getParameterType(signature, argIndex).getNonNullableType(), - /*requireOptionalProperties*/ - false, - /*matchDiscriminantProperties*/ - false - )); - if (!length(properties)) return void 0; - return { kind: 3 /* ObjectLiteral */, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 }; - } - if (token.kind === 19 /* OpenBraceToken */ || isSatisfiesExpression(parent2) || isReturnStatement(parent2)) { - const expression = (isSatisfiesExpression(parent2) || isReturnStatement(parent2)) && parent2.expression ? parent2.expression : parent2; - if (isObjectLiteralExpression(expression)) { - const targetType = isSatisfiesExpression(parent2) ? checker.getTypeFromTypeNode(parent2.type) : checker.getContextualType(expression) || checker.getTypeAtLocation(expression); - const properties = arrayFrom(checker.getUnmatchedProperties( - checker.getTypeAtLocation(parent2), - targetType.getNonNullableType(), - /*requireOptionalProperties*/ - false, - /*matchDiscriminantProperties*/ - false - )); - if (!length(properties)) return void 0; - return { kind: 3 /* ObjectLiteral */, token: parent2, identifier: void 0, properties, parentDeclaration: expression, indentation: isReturnStatement(expression.parent) || isYieldExpression(expression.parent) ? 0 : void 0 }; - } - } - if (!isMemberName(token)) return void 0; - if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) { - const targetType = (_a = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _a.getNonNullableType(); - const properties = arrayFrom(checker.getUnmatchedProperties( - checker.getTypeAtLocation(parent2.initializer), - targetType, - /*requireOptionalProperties*/ - false, - /*matchDiscriminantProperties*/ - false - )); - if (!length(properties)) return void 0; - return { kind: 3 /* ObjectLiteral */, token, identifier: token.text, properties, parentDeclaration: parent2.initializer }; - } - if (isIdentifier(token) && isJsxOpeningLikeElement(token.parent)) { - const target = getEmitScriptTarget(program.getCompilerOptions()); - const attributes = getUnmatchedAttributes(checker, target, token.parent); - if (!length(attributes)) return void 0; - return { kind: 4 /* JsxAttributes */, token, attributes, parentDeclaration: token.parent }; - } - if (isIdentifier(token)) { - const type = (_b = checker.getContextualType(token)) == null ? void 0 : _b.getNonNullableType(); - if (type && getObjectFlags(type) & 16 /* Anonymous */) { - const signature = firstOrUndefined(checker.getSignaturesOfType(type, 0 /* Call */)); - if (signature === void 0) return void 0; - return { kind: 5 /* Signature */, token, signature, sourceFile, parentDeclaration: findScope(token) }; - } - if (isCallExpression(parent2) && parent2.expression === token) { - return { kind: 2 /* Function */, token, call: parent2, sourceFile, modifierFlags: 0 /* None */, parentDeclaration: findScope(token) }; - } - } - if (!isPropertyAccessExpression(parent2)) return void 0; - const leftExpressionType = skipConstraint(checker.getTypeAtLocation(parent2.expression)); - const symbol = leftExpressionType.symbol; - if (!symbol || !symbol.declarations) return void 0; - if (isIdentifier(token) && isCallExpression(parent2.parent)) { - 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: moduleDeclarationSourceFile, 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: 32 /* Export */, parentDeclaration: moduleSourceFile }; - } - } - const classDeclaration = find(symbol.declarations, isClassLike); - if (!classDeclaration && isPrivateIdentifier(token)) return void 0; - const declaration = classDeclaration || find(symbol.declarations, (d) => isInterfaceDeclaration(d) || isTypeLiteralNode(d)); - if (declaration && !isSourceFileFromLibrary(program, declaration.getSourceFile())) { - const makeStatic = !isTypeLiteralNode(declaration) && (leftExpressionType.target || leftExpressionType) !== checker.getDeclaredTypeOfSymbol(symbol); - if (makeStatic && (isPrivateIdentifier(token) || isInterfaceDeclaration(declaration))) return void 0; - const declSourceFile = declaration.getSourceFile(); - 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 }; - } - const enumDeclaration = find(symbol.declarations, isEnumDeclaration); - if (enumDeclaration && !(leftExpressionType.flags & 1056 /* EnumLike */) && !isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) { - return { kind: 1 /* Enum */, token, parentDeclaration: enumDeclaration }; - } - return void 0; -} -function getActionsForMissingMemberDeclaration(context, info) { - return info.isJSFile ? singleElementArray(createActionForAddMissingMemberInJavascriptFile(context, info)) : createActionsForAddMissingMemberInTypeScriptFile(context, info); -} -function createActionForAddMissingMemberInJavascriptFile(context, { parentDeclaration, declSourceFile, modifierFlags, token }) { - if (isInterfaceDeclaration(parentDeclaration) || isTypeLiteralNode(parentDeclaration)) { - return void 0; - } - 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 & 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 === 232 /* ClassExpression */) { - return; - } - const className = classDeclaration.name.getText(); - const staticInitialization = initializePropertyToUndefined(factory.createIdentifier(className), tokenName); - changeTracker.insertNodeAfter(sourceFile, classDeclaration, staticInitialization); - } else if (isPrivateIdentifier(token)) { - const property = factory.createPropertyDeclaration( - /*modifiers*/ - void 0, - tokenName, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - /*initializer*/ - void 0 - ); - const lastProp = getNodeToInsertPropertyAfter(classDeclaration); - if (lastProp) { - changeTracker.insertNodeAfter(sourceFile, lastProp, property); - } else { - changeTracker.insertMemberAtStart(sourceFile, classDeclaration, property); - } - } else { - const classConstructor = getFirstConstructorWithBody(classDeclaration); - if (!classConstructor) { - return; - } - const propertyInitialization = initializePropertyToUndefined(factory.createThis(), tokenName); - changeTracker.insertNodeAtConstructorEnd(sourceFile, classConstructor, propertyInitialization); - } -} -function initializePropertyToUndefined(obj, propertyName) { - return factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(obj, propertyName), createUndefined())); -} -function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDeclaration, declSourceFile, modifierFlags, token }) { - const memberName = token.text; - 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 & 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 & 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 === 227 /* 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))); - typeNode = checker.typeToTypeNode(widenedType, node, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */); - } else { - const contextualType = checker.getContextualType(token.parent); - typeNode = contextualType ? checker.typeToTypeNode( - contextualType, - /*enclosingDeclaration*/ - void 0, - 1 /* NoTruncation */, - 8 /* AllowUnresolvedNames */ - ) : void 0; - } - return typeNode || factory.createKeywordTypeNode(133 /* AnyKeyword */); -} -function addPropertyDeclaration(changeTracker, sourceFile, node, tokenName, typeNode, modifierFlags) { - const modifiers = modifierFlags ? factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; - const property = isClassLike(node) ? factory.createPropertyDeclaration( - modifiers, - tokenName, - /*questionOrExclamationToken*/ - void 0, - typeNode, - /*initializer*/ - void 0 - ) : factory.createPropertySignature( - /*modifiers*/ - void 0, - tokenName, - /*questionToken*/ - void 0, - typeNode - ); - const lastProp = getNodeToInsertPropertyAfter(node); - if (lastProp) { - changeTracker.insertNodeAfter(sourceFile, lastProp, property); - } else { - changeTracker.insertMemberAtStart(sourceFile, node, property); - } -} -function getNodeToInsertPropertyAfter(node) { - let res; - for (const member of node.members) { - if (!isPropertyDeclaration(member)) break; - res = member; - } - return res; -} -function createAddIndexSignatureAction(context, sourceFile, node, tokenName, typeNode) { - const stringTypeNode = factory.createKeywordTypeNode(154 /* StringKeyword */); - const indexingParameter = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "x", - /*questionToken*/ - void 0, - stringTypeNode, - /*initializer*/ - void 0 - ); - const indexSignature = factory.createIndexSignature( - /*modifiers*/ - void 0, - [indexingParameter], - typeNode - ); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => t.insertMemberAtStart(sourceFile, node, indexSignature)); - return createCodeFixActionWithoutFixAll(fixMissingMember, changes, [Diagnostics.Add_index_signature_for_property_0, tokenName]); -} -function getActionsForMissingMethodDeclaration(context, info) { - const { parentDeclaration, declSourceFile, modifierFlags, token, call } = info; - if (call === void 0) { - 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 & 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) ? 175 /* MethodDeclaration */ : 174 /* MethodSignature */; - const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context, importAdder, callExpression, name, modifierFlags, parentDeclaration); - const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression); - if (containingMethodDeclaration) { - changes.insertNodeAfter(sourceFile, containingMethodDeclaration, signatureDeclaration); - } else { - changes.insertMemberAtStart(sourceFile, parentDeclaration, signatureDeclaration); - } - importAdder.writeFixes(changes); -} -function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }) { - const hasStringInitializer = some(parentDeclaration.members, (member) => { - 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); - 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(263 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature( - 263 /* FunctionDeclaration */, - context, - quotePreference, - info.signature, - createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), - info.token, - /*modifiers*/ - void 0, - /*optional*/ - void 0, - /*enclosingDeclaration*/ - void 0, - importAdder - ); - if (functionDeclaration === void 0) { - Debug.fail("fixMissingFunctionDeclaration codefix got unexpected error."); - } - isReturnStatement(info.parentDeclaration) ? changes.insertNodeBefore( - info.sourceFile, - info.parentDeclaration, - functionDeclaration, - /*blankLineBetween*/ - true - ) : changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration); - importAdder.writeFixes(changes); -} -function addJsxAttributes(changes, context, info) { - const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host); - const quotePreference = getQuotePreference(context.sourceFile, context.preferences); - const checker = context.program.getTypeChecker(); - const jsxAttributesNode = info.parentDeclaration.attributes; - const hasSpreadAttribute = some(jsxAttributesNode.properties, isJsxSpreadAttribute); - const attrs = map(info.attributes, (attr) => { - const value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr), info.parentDeclaration); - const name = factory.createIdentifier(attr.name); - const jsxAttribute = factory.createJsxAttribute(name, factory.createJsxExpression( - /*dotDotDotToken*/ - void 0, - value - )); - setParent(name, jsxAttribute); - return jsxAttribute; - }); - const jsxAttributes = factory.createJsxAttributes(hasSpreadAttribute ? [...attrs, ...jsxAttributesNode.properties] : [...jsxAttributesNode.properties, ...attrs]); - const options = { prefix: jsxAttributesNode.pos === jsxAttributesNode.end ? " " : void 0 }; - changes.replaceNode(context.sourceFile, jsxAttributesNode, jsxAttributes, options); - importAdder.writeFixes(changes); -} -function addObjectLiteralProperties(changes, context, info) { - const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host); - const quotePreference = getQuotePreference(context.sourceFile, context.preferences); - const target = getEmitScriptTarget(context.program.getCompilerOptions()); - const checker = context.program.getTypeChecker(); - const props = map(info.properties, (prop) => { - const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), info.parentDeclaration); - return factory.createPropertyAssignment(createPropertyNameFromSymbol(prop, target, quotePreference, checker), initializer); - }); - const options = { - leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude, - indentation: info.indentation - }; - changes.replaceNode(context.sourceFile, info.parentDeclaration, factory.createObjectLiteralExpression( - [...info.parentDeclaration.properties, ...props], - /*multiLine*/ - true - ), options); - importAdder.writeFixes(changes); -} -function tryGetValueFromType(context, checker, importAdder, quotePreference, type, enclosingDeclaration) { - if (type.flags & 3 /* AnyOrUnknown */) { - return createUndefined(); - } - if (type.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) { - return factory.createStringLiteral( - "", - /* isSingleQuote */ - quotePreference === 0 /* Single */ - ); - } - if (type.flags & 8 /* Number */) { - return factory.createNumericLiteral(0); - } - if (type.flags & 64 /* BigInt */) { - return factory.createBigIntLiteral("0n"); - } - if (type.flags & 16 /* Boolean */) { - return factory.createFalse(); - } - if (type.flags & 1056 /* EnumLike */) { - const enumMember = type.symbol.exports ? firstOrUndefinedIterator(type.symbol.exports.values()) : type.symbol; - const symbol = type.symbol.parent && type.symbol.parent.flags & 256 /* RegularEnum */ ? type.symbol.parent : type.symbol; - const name = checker.symbolToExpression( - symbol, - 111551 /* Value */, - /*enclosingDeclaration*/ - void 0, - /*flags*/ - 64 /* UseFullyQualifiedType */ - ); - return enumMember === void 0 || name === void 0 ? factory.createNumericLiteral(0) : factory.createPropertyAccessExpression(name, checker.symbolToString(enumMember)); - } - if (type.flags & 256 /* NumberLiteral */) { - return factory.createNumericLiteral(type.value); - } - if (type.flags & 2048 /* BigIntLiteral */) { - return factory.createBigIntLiteral(type.value); - } - if (type.flags & 128 /* StringLiteral */) { - return factory.createStringLiteral( - type.value, - /* isSingleQuote */ - quotePreference === 0 /* Single */ - ); - } - if (type.flags & 512 /* BooleanLiteral */) { - return type === checker.getFalseType() || type === checker.getFalseType( - /*fresh*/ - true - ) ? factory.createFalse() : factory.createTrue(); - } - if (type.flags & 65536 /* Null */) { - return factory.createNull(); - } - if (type.flags & 1048576 /* Union */) { - const expression = firstDefined(type.types, (t) => tryGetValueFromType(context, checker, importAdder, quotePreference, t, enclosingDeclaration)); - return expression ?? createUndefined(); - } - if (checker.isArrayLikeType(type)) { - return factory.createArrayLiteralExpression(); - } - if (isObjectLiteralType(type)) { - const props = map(checker.getPropertiesOfType(type), (prop) => { - const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration); - return factory.createPropertyAssignment(prop.name, initializer); - }); - return factory.createObjectLiteralExpression( - props, - /*multiLine*/ - true - ); - } - if (getObjectFlags(type) & 16 /* Anonymous */) { - const decl = find(type.symbol.declarations || emptyArray, or(isFunctionTypeNode, isMethodSignature, isMethodDeclaration)); - if (decl === void 0) return createUndefined(); - const signature = checker.getSignaturesOfType(type, 0 /* Call */); - if (signature === void 0) return createUndefined(); - const func = createSignatureDeclarationFromSignature( - 219 /* FunctionExpression */, - context, - quotePreference, - signature[0], - createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), - /*name*/ - void 0, - /*modifiers*/ - void 0, - /*optional*/ - void 0, - /*enclosingDeclaration*/ - enclosingDeclaration, - importAdder - ); - return func ?? createUndefined(); - } - if (getObjectFlags(type) & 1 /* Class */) { - const classDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); - if (classDeclaration === void 0 || hasAbstractModifier(classDeclaration)) return createUndefined(); - const constructorDeclaration = getFirstConstructorWithBody(classDeclaration); - if (constructorDeclaration && length(constructorDeclaration.parameters)) return createUndefined(); - return factory.createNewExpression( - factory.createIdentifier(type.symbol.name), - /*typeArguments*/ - void 0, - /*argumentsArray*/ - void 0 - ); - } - return createUndefined(); -} -function createUndefined() { - return factory.createIdentifier("undefined"); -} -function isObjectLiteralType(type) { - return type.flags & 524288 /* Object */ && (getObjectFlags(type) & 128 /* ObjectLiteral */ || type.symbol && tryCast(singleOrUndefined(type.symbol.declarations), isTypeLiteralNode)); -} -function getUnmatchedAttributes(checker, target, source) { - const attrsType = checker.getContextualType(source.attributes); - if (attrsType === void 0) return emptyArray; - const targetProps = attrsType.getProperties(); - if (!length(targetProps)) return emptyArray; - const seenNames = /* @__PURE__ */ new Set(); - for (const sourceProp of source.attributes.properties) { - if (isJsxAttribute(sourceProp)) { - seenNames.add(getEscapedTextOfJsxAttributeName(sourceProp.name)); - } - if (isJsxSpreadAttribute(sourceProp)) { - const type = checker.getTypeAtLocation(sourceProp.expression); - for (const prop of type.getProperties()) { - seenNames.add(prop.escapedName); - } - } - } - return filter(targetProps, (targetProp) => isIdentifierText(targetProp.name, target, 1 /* JSX */) && !(targetProp.flags & 16777216 /* Optional */ || getCheckFlags(targetProp) & 48 /* Partial */ || seenNames.has(targetProp.escapedName))); -} -function tryGetContainingMethodDeclaration(node, callExpression) { - if (isTypeLiteralNode(node)) { - return void 0; - } - const declaration = findAncestor(callExpression, (n) => isMethodDeclaration(n) || isConstructorDeclaration(n)); - return declaration && declaration.parent === node ? declaration : void 0; -} -function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) { - if (isTransientSymbol(symbol)) { - const prop = checker.symbolToNode( - symbol, - 111551 /* Value */, - /*enclosingDeclaration*/ - void 0, - /*flags*/ - void 0, - 1 /* WriteComputedProps */ - ); - if (prop && isComputedPropertyName(prop)) return prop; - } - return createPropertyNameNodeForIdentifierOrLiteral( - symbol.name, - target, - quotePreference === 0 /* Single */, - /*stringNamed*/ - false, - /*isMethod*/ - false - ); -} -function findScope(node) { - if (findAncestor(node, isJsxExpression)) { - const returnStatement = findAncestor(node.parent, isReturnStatement); - if (returnStatement) return returnStatement; - } - return getSourceFileOfNode(node); -} -function getAllSupers(decl, checker) { - const res = []; - while (decl) { - const superElement = getClassExtendsHeritageElement(decl); - const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression); - if (!superSymbol) break; - const symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol; - const superDecl = symbol.declarations && find(symbol.declarations, isClassLike); - if (!superDecl) break; - res.push(superDecl); - decl = superDecl; - } - return res; -} - -// src/services/codefixes/fixAddMissingNewOperator.ts -var fixId25 = "addMissingNewOperator"; -var errorCodes29 = [Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code]; -registerCodeFix({ - errorCodes: errorCodes29, - getCodeActions(context) { - const { sourceFile, span } = context; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingNewOperator(t, sourceFile, span)); - return [createCodeFixAction(fixId25, changes, Diagnostics.Add_missing_new_operator_to_call, fixId25, Diagnostics.Add_missing_new_operator_to_all_calls)]; - }, - fixIds: [fixId25], - getAllCodeActions: (context) => codeFixAll(context, errorCodes29, (changes, diag2) => addMissingNewOperator(changes, context.sourceFile, diag2)) -}); -function addMissingNewOperator(changes, sourceFile, span) { - const call = cast(findAncestorMatchingSpan2(sourceFile, span), isCallExpression); - const newExpression = factory.createNewExpression(call.expression, call.typeArguments, call.arguments); - changes.replaceNode(sourceFile, call, newExpression); -} -function findAncestorMatchingSpan2(sourceFile, span) { - let token = getTokenAtPosition(sourceFile, span.start); - const end = textSpanEnd(span); - while (token.end < end) { - token = token.parent; - } - return token; -} - -// src/services/codefixes/fixAddMissingParam.ts -var addMissingParamFixId = "addMissingParam"; -var addOptionalParamFixId = "addOptionalParam"; -var errorCodes30 = [Diagnostics.Expected_0_arguments_but_got_1.code]; -registerCodeFix({ - errorCodes: errorCodes30, - 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.program, context.preferences, context.host, 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.program, context.preferences, context.host, 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, errorCodes30, (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.program, context.preferences, context.host, declarations, newParameters); - } - if (context.fixId === addOptionalParamFixId) { - doChange19(changes, context.program, context.preferences, context.host, declarations, newOptionalParameters); - } - } - }) -}); -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 */, 8 /* AllowUnresolvedNames */) ?? factory.createKeywordTypeNode(159 /* UnknownKeyword */); -} -function doChange19(changes, program, preferences, host, declarations, newParameters) { - const scriptTarget = getEmitScriptTarget(program.getCompilerOptions()); - forEach(declarations, (declaration) => { - const sourceFile = getSourceFileOfNode(declaration); - const importAdder = createImportAdder(sourceFile, program, preferences, host); - if (length(declaration.parameters)) { - changes.replaceNodeRangeWithNodes( - sourceFile, - first(declaration.parameters), - last(declaration.parameters), - updateParameters(importAdder, scriptTarget, declaration, newParameters), - { - joiner: ", ", - indentation: 0, - leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include - } - ); - } else { - forEach(updateParameters(importAdder, scriptTarget, 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); - } - }); - } - importAdder.writeFixes(changes); - }); -} -function isConvertibleSignatureDeclaration(node) { - switch (node.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 220 /* ArrowFunction */: - return true; - default: - return false; - } -} -function updateParameters(importAdder, scriptTarget, 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, - getParameterType(importAdder, declaration.type, scriptTarget), - 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); -} -function getParameterType(importAdder, typeNode, scriptTarget) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); - if (importableReference) { - importSymbols(importAdder, importableReference.symbols); - return importableReference.typeNode; - } - return typeNode; -} - -// src/services/codefixes/fixCannotFindModule.ts -var fixName2 = "fixCannotFindModule"; -var fixIdInstallTypesPackage = "installTypesPackage"; -var errorCodeCannotFindModule = Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code; -var errorCannotFindImplicitJsxImport = Diagnostics.This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed.code; -var errorCodes31 = [ - errorCodeCannotFindModule, - Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, - errorCannotFindImplicitJsxImport -]; -registerCodeFix({ - errorCodes: errorCodes31, - getCodeActions: function getCodeActionsToFixNotFoundModule(context) { - const { host, sourceFile, span: { start }, errorCode } = context; - const packageName = errorCode === errorCannotFindImplicitJsxImport ? getJSXImplicitImportBase(context.program.getCompilerOptions(), sourceFile) : tryGetImportedPackageName(sourceFile, start); - if (packageName === void 0) return void 0; - const typesPackageName = getTypesPackageNameToInstall(packageName, host, errorCode); - return typesPackageName === void 0 ? [] : [createCodeFixAction( - fixName2, - /*changes*/ - [], - [Diagnostics.Install_0, typesPackageName], - fixIdInstallTypesPackage, - Diagnostics.Install_all_missing_types_packages, - getInstallCommand(sourceFile.fileName, typesPackageName) - )]; - }, - fixIds: [fixIdInstallTypesPackage], - getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes31, (_changes, diag2, commands) => { - const packageName = tryGetImportedPackageName(diag2.file, diag2.start); - if (packageName === void 0) return void 0; - switch (context.fixId) { - case fixIdInstallTypesPackage: { - const pkg = getTypesPackageNameToInstall(packageName, context.host, diag2.code); - if (pkg) { - commands.push(getInstallCommand(diag2.file.fileName, pkg)); - } - break; - } - default: - Debug.fail(`Bad fixId: ${context.fixId}`); - } - }); - } -}); -function getInstallCommand(fileName, packageName) { - return { type: "install package", file: fileName, packageName }; -} -function tryGetImportedPackageName(sourceFile, pos) { - const moduleSpecifierText = tryCast(getTokenAtPosition(sourceFile, pos), isStringLiteral); - if (!moduleSpecifierText) return void 0; - const moduleName = moduleSpecifierText.text; - const { packageName } = parsePackageName(moduleName); - return isExternalModuleNameRelative(packageName) ? void 0 : packageName; -} -function getTypesPackageNameToInstall(packageName, host, diagCode) { - var _a; - return diagCode === errorCodeCannotFindModule ? nodeCoreModules.has(packageName) ? "@types/node" : void 0 : ((_a = host.isKnownTypesPackageName) == null ? void 0 : _a.call(host, packageName)) ? getTypesPackageName(packageName) : void 0; -} - -// src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts -var errorCodes32 = [ - Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code, - Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2.code, - Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more.code, - Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code, - Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1.code, - Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more.code -]; -var fixId26 = "fixClassDoesntImplementInheritedAbstractMember"; -registerCodeFix({ - errorCodes: errorCodes32, - 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)); - return changes.length === 0 ? void 0 : [createCodeFixAction(fixId26, changes, Diagnostics.Implement_inherited_abstract_class, fixId26, Diagnostics.Implement_all_inherited_abstract_classes)]; - }, - fixIds: [fixId26], - getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context) { - const seenClassDeclarations = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes32, (changes, diag2) => { - const classDeclaration = getClass2(diag2.file, diag2.start); - if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) { - addMissingMembers(classDeclaration, context.sourceFile, context, changes, context.preferences); - } - }); - } -}); -function getClass2(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - return cast(token.parent, isClassLike); -} -function addMissingMembers(classDeclaration, sourceFile, context, changeTracker, preferences) { - const extendsNode = getEffectiveBaseTypeNode(classDeclaration); - const checker = context.program.getTypeChecker(); - const instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); - const abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); - const importAdder = createImportAdder(sourceFile, context.program, preferences, context.host); - createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, sourceFile, context, preferences, importAdder, (member) => changeTracker.insertMemberAtStart(sourceFile, classDeclaration, member)); - importAdder.writeFixes(changeTracker); -} -function symbolPointsToNonPrivateAndAbstractMember(symbol) { - const flags = getSyntacticModifierFlags(first(symbol.getDeclarations())); - return !(flags & 2 /* Private */) && !!(flags & 64 /* Abstract */); -} - -// src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts -var fixId27 = "classSuperMustPrecedeThisAccess"; -var errorCodes33 = [Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code]; -registerCodeFix({ - errorCodes: errorCodes33, - 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) => doChange20(t, sourceFile, constructor, superCall)); - return [createCodeFixAction(fixId27, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId27, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]; - }, - fixIds: [fixId27], - getAllCodeActions(context) { - const { sourceFile } = context; - const seenClasses = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes33, (changes, diag2) => { - const nodes = getNodes(diag2.file, diag2.start); - if (!nodes) return; - const { constructor, superCall } = nodes; - if (addToSeen(seenClasses, getNodeId(constructor.parent))) { - doChange20(changes, sourceFile, constructor, superCall); - } - }); - } -}); -function doChange20(changes, sourceFile, constructor, superCall) { - changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); - changes.delete(sourceFile, superCall); -} -function getNodes(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - if (token.kind !== 110 /* ThisKeyword */) return void 0; - const constructor = getContainingFunction(token); - const superCall = findSuperCall(constructor.body); - return superCall && !superCall.expression.arguments.some((arg) => isPropertyAccessExpression(arg) && arg.expression === token) ? { constructor, superCall } : void 0; -} -function findSuperCall(n) { - return isExpressionStatement(n) && isSuperCall(n.expression) ? n : isFunctionLike(n) ? void 0 : forEachChild(n, findSuperCall); -} - -// src/services/codefixes/fixConstructorForDerivedNeedSuperCall.ts -var fixId28 = "constructorForDerivedNeedSuperCall"; -var errorCodes34 = [Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code]; -registerCodeFix({ - errorCodes: errorCodes34, - getCodeActions(context) { - const { sourceFile, span } = context; - const ctr = getNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange21(t, sourceFile, ctr)); - return [createCodeFixAction(fixId28, changes, Diagnostics.Add_missing_super_call, fixId28, Diagnostics.Add_all_missing_super_calls)]; - }, - fixIds: [fixId28], - getAllCodeActions: (context) => codeFixAll(context, errorCodes34, (changes, diag2) => doChange21(changes, context.sourceFile, getNode(diag2.file, diag2.start))) -}); -function getNode(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - Debug.assert(isConstructorDeclaration(token.parent), "token should be at the constructor declaration"); - return token.parent; -} -function doChange21(changes, sourceFile, ctr) { - const superCall = factory.createExpressionStatement(factory.createCallExpression( - factory.createSuper(), - /*typeArguments*/ - void 0, - /*argumentsArray*/ - emptyArray - )); - changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); -} - -// src/services/codefixes/fixEnableJsxFlag.ts -var fixID = "fixEnableJsxFlag"; -var errorCodes35 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; -registerCodeFix({ - errorCodes: errorCodes35, - 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) => doChange22(changeTracker, configFile)); - return [ - createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) - ]; - }, - fixIds: [fixID], - getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes) => { - const { configFile } = context.program.getCompilerOptions(); - if (configFile === void 0) { - return void 0; - } - doChange22(changes, configFile); - }) -}); -function doChange22(changeTracker, configFile) { - setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); -} - -// src/services/codefixes/fixNaNEquality.ts -var fixId29 = "fixNaNEquality"; -var errorCodes36 = [ - Diagnostics.This_condition_will_always_return_0.code -]; -registerCodeFix({ - errorCodes: errorCodes36, - getCodeActions(context) { - const { sourceFile, span, program } = context; - 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) => doChange23(t, sourceFile, arg, expression)); - return [createCodeFixAction(fixId29, changes, [Diagnostics.Use_0, suggestion], fixId29, Diagnostics.Use_Number_isNaN_in_all_conditions)]; - }, - fixIds: [fixId29], - getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes36, (changes, diag2) => { - const info = getInfo12(context.program, diag2.file, createTextSpan(diag2.start, diag2.length)); - if (info) { - doChange23(changes, diag2.file, info.arg, info.expression); - } - }); - } -}); -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; - const related = find(diag2.relatedInformation, (related2) => related2.code === Diagnostics.Did_you_mean_0.code); - if (related === void 0 || related.file === void 0 || related.start === void 0 || related.length === void 0) return; - const token = findAncestorMatchingSpan(related.file, createTextSpan(related.start, related.length)); - if (token === void 0) return; - if (isExpression(token) && isBinaryExpression(token.parent)) { - return { suggestion: getSuggestion(related.messageText), expression: token.parent, arg: token }; - } - return void 0; -} -function doChange23(changes, sourceFile, arg, expression) { - const callExpression = factory.createCallExpression( - factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), - /*typeArguments*/ - void 0, - [arg] - ); - const operator = expression.operatorToken.kind; - changes.replaceNode( - sourceFile, - expression, - operator === 38 /* ExclamationEqualsEqualsToken */ || operator === 36 /* ExclamationEqualsToken */ ? factory.createPrefixUnaryExpression(54 /* ExclamationToken */, callExpression) : callExpression - ); -} -function getSuggestion(messageText) { - const [, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || []; - return suggestion; -} - -// src/services/codefixes/fixModuleAndTargetOptions.ts -registerCodeFix({ - errorCodes: [ - Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_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_node18_node20_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_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code - ], - getCodeActions: function getCodeActionsToFixModuleAndTarget(context) { - const compilerOptions = context.program.getCompilerOptions(); - const { configFile } = compilerOptions; - if (configFile === void 0) { - return void 0; - } - const codeFixes = []; - const moduleKind = getEmitModuleKind(compilerOptions); - const moduleOutOfRange = moduleKind >= 5 /* ES2015 */ && moduleKind < 99 /* ESNext */; - if (moduleOutOfRange) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => { - setJsonCompilerOptionValue(changes2, configFile, "module", factory.createStringLiteral("esnext")); - }); - codeFixes.push(createCodeFixActionWithoutFixAll("fixModuleOption", changes, [Diagnostics.Set_the_module_option_in_your_configuration_file_to_0, "esnext"])); - } - const target = getEmitScriptTarget(compilerOptions); - const targetOutOfRange = target < 4 /* ES2017 */ || target > 99 /* ESNext */; - if (targetOutOfRange) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (tracker) => { - const configObject = getTsConfigObjectLiteralExpression(configFile); - if (!configObject) return; - const options = [["target", factory.createStringLiteral("es2017")]]; - if (moduleKind === 1 /* CommonJS */) { - options.push(["module", factory.createStringLiteral("commonjs")]); - } - setJsonCompilerOptionValues(tracker, configFile, options); - }); - codeFixes.push(createCodeFixActionWithoutFixAll("fixTargetOption", changes, [Diagnostics.Set_the_target_option_in_your_configuration_file_to_0, "es2017"])); - } - return codeFixes.length ? codeFixes : void 0; - } -}); - -// src/services/codefixes/fixPropertyAssignment.ts -var fixId30 = "fixPropertyAssignment"; -var errorCodes37 = [ - 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: errorCodes37, - fixIds: [fixId30], - getCodeActions(context) { - const { sourceFile, span } = context; - const property = getProperty2(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange24(t, context.sourceFile, property)); - return [createCodeFixAction(fixId30, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId30, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; - }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes37, (changes, diag2) => doChange24(changes, diag2.file, getProperty2(diag2.file, diag2.start))) -}); -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); -} - -// src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts -var fixId31 = "extendsInterfaceBecomesImplements"; -var errorCodes38 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; -registerCodeFix({ - errorCodes: errorCodes38, - getCodeActions(context) { - const { sourceFile } = context; - const nodes = getNodes2(sourceFile, context.span.start); - if (!nodes) return void 0; - const { extendsToken, heritageClauses } = nodes; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChanges2(t, sourceFile, extendsToken, heritageClauses)); - return [createCodeFixAction(fixId31, changes, Diagnostics.Change_extends_to_implements, fixId31, Diagnostics.Change_all_extended_interfaces_to_implements)]; - }, - fixIds: [fixId31], - getAllCodeActions: (context) => codeFixAll(context, errorCodes38, (changes, diag2) => { - const nodes = getNodes2(diag2.file, diag2.start); - if (nodes) doChanges2(changes, diag2.file, nodes.extendsToken, nodes.heritageClauses); - }) -}); -function getNodes2(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - const heritageClauses = getContainingClass(token).heritageClauses; - const extendsToken = heritageClauses[0].getFirstToken(); - return extendsToken.kind === 96 /* ExtendsKeyword */ ? { extendsToken, heritageClauses } : void 0; -} -function doChanges2(changes, sourceFile, extendsToken, heritageClauses) { - changes.replaceNode(sourceFile, extendsToken, factory.createToken(119 /* ImplementsKeyword */)); - if (heritageClauses.length === 2 && heritageClauses[0].token === 96 /* ExtendsKeyword */ && heritageClauses[1].token === 119 /* ImplementsKeyword */) { - const implementsToken = heritageClauses[1].getFirstToken(); - const implementsFullStart = implementsToken.getFullStart(); - changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, factory.createToken(28 /* CommaToken */)); - const text = sourceFile.text; - let end = implementsToken.end; - while (end < text.length && isWhiteSpaceSingleLine(text.charCodeAt(end))) { - end++; - } - changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end }); - } -} - -// src/services/codefixes/fixForgottenThisPropertyAccess.ts -var fixId32 = "forgottenThisPropertyAccess"; -var didYouMeanStaticMemberCode = Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code; -var errorCodes39 = [ - 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: errorCodes39, - getCodeActions(context) { - const { sourceFile } = context; - const info = getInfo13(sourceFile, context.span.start, context.errorCode); - if (!info) { - return void 0; - } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange25(t, sourceFile, info)); - return [createCodeFixAction(fixId32, changes, [Diagnostics.Add_0_to_unresolved_variable, info.className || "this"], fixId32, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; - }, - fixIds: [fixId32], - getAllCodeActions: (context) => codeFixAll(context, errorCodes39, (changes, diag2) => { - const info = getInfo13(diag2.file, diag2.start, diag2.code); - if (info) doChange25(changes, context.sourceFile, info); - }) -}); -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 doChange25(changes, sourceFile, { node, className }) { - suppressLeadingAndTrailingTrivia(node); - changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); -} - -// src/services/codefixes/fixInvalidJsxCharacters.ts -var fixIdExpression = "fixInvalidJsxCharacters_expression"; -var fixIdHtmlEntity = "fixInvalidJsxCharacters_htmlEntity"; -var errorCodes40 = [ - Diagnostics.Unexpected_token_Did_you_mean_or_gt.code, - Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code -]; -registerCodeFix({ - errorCodes: errorCodes40, - fixIds: [fixIdExpression, fixIdHtmlEntity], - getCodeActions(context) { - const { sourceFile, preferences, span } = context; - const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26( - t, - preferences, - sourceFile, - span.start, - /*useHtmlEntity*/ - false - )); - const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange26( - t, - preferences, - sourceFile, - span.start, - /*useHtmlEntity*/ - true - )); - return [ - createCodeFixAction(fixIdExpression, changeToExpression, Diagnostics.Wrap_invalid_character_in_an_expression_container, fixIdExpression, Diagnostics.Wrap_all_invalid_characters_in_an_expression_container), - createCodeFixAction(fixIdHtmlEntity, changeToHtmlEntity, Diagnostics.Convert_invalid_character_to_its_html_entity_code, fixIdHtmlEntity, Diagnostics.Convert_all_invalid_characters_to_HTML_entity_code) - ]; - }, - getAllCodeActions(context) { - return codeFixAll(context, errorCodes40, (changes, diagnostic) => doChange26(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity)); - } -}); -var htmlEntity = { - ">": ">", - "}": "}" -}; -function isValidCharacter(character) { - return hasProperty(htmlEntity, character); -} -function doChange26(changes, preferences, sourceFile, start, useHtmlEntity) { - const character = sourceFile.getText()[start]; - if (!isValidCharacter(character)) { - return; - } - const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`; - changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); -} - -// src/services/codefixes/fixUnmatchedParameter.ts -var deleteUnmatchedParameter = "deleteUnmatchedParameter"; -var renameUnmatchedParameter = "renameUnmatchedParameter"; -var errorCodes41 = [ - Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code -]; -registerCodeFix({ - fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter], - errorCodes: errorCodes41, - getCodeActions: function getCodeActionsToFixUnmatchedParameter(context) { - const { sourceFile, span } = context; - const actions2 = []; - const info = getInfo14(sourceFile, span.start); - if (info) { - append(actions2, getDeleteAction(context, info)); - append(actions2, getRenameAction(context, info)); - return actions2; - } - return void 0; - }, - getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) { - const tagsToSignature = /* @__PURE__ */ new Map(); - return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes41, ({ file, start }) => { - const info = getInfo14(file, start); - if (info) { - tagsToSignature.set(info.signature, append(tagsToSignature.get(info.signature), info.jsDocParameterTag)); - } - }); - tagsToSignature.forEach((tags, signature) => { - if (context.fixId === deleteUnmatchedParameter) { - const tagsSet = new Set(tags); - changes.filterJSDocTags(signature.getSourceFile(), signature, (t) => !tagsSet.has(t)); - } - }); - })); - } -}); -function getDeleteAction(context, { name, jsDocHost, jsDocParameterTag }) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.filterJSDocTags(context.sourceFile, jsDocHost, (t) => t !== jsDocParameterTag)); - return createCodeFixAction( - deleteUnmatchedParameter, - changes, - [Diagnostics.Delete_unused_param_tag_0, name.getText(context.sourceFile)], - deleteUnmatchedParameter, - Diagnostics.Delete_all_unused_param_tags - ); -} -function getRenameAction(context, { name, jsDocHost, signature, jsDocParameterTag }) { - if (!length(signature.parameters)) return void 0; - const sourceFile = context.sourceFile; - const tags = getJSDocTags(signature); - const names = /* @__PURE__ */ new Set(); - for (const tag of tags) { - if (isJSDocParameterTag(tag) && isIdentifier(tag.name)) { - names.add(tag.name.escapedText); - } - } - const parameterName = firstDefined(signature.parameters, (p) => isIdentifier(p.name) && !names.has(p.name.escapedText) ? p.name.getText(sourceFile) : void 0); - if (parameterName === void 0) return void 0; - const newJSDocParameterTag = factory.updateJSDocParameterTag( - jsDocParameterTag, - jsDocParameterTag.tagName, - factory.createIdentifier(parameterName), - jsDocParameterTag.isBracketed, - jsDocParameterTag.typeExpression, - jsDocParameterTag.isNameFirst, - jsDocParameterTag.comment - ); - 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 getInfo14(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - if (token.parent && isJSDocParameterTag(token.parent) && isIdentifier(token.parent.name)) { - const jsDocParameterTag = token.parent; - const jsDocHost = getJSDocHost(jsDocParameterTag); - const signature = getHostSignatureFromJSDoc(jsDocParameterTag); - if (jsDocHost && signature) { - return { jsDocHost, signature, name: token.parent.name, jsDocParameterTag }; - } - } - return void 0; -} - -// src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts -var fixId33 = "fixUnreferenceableDecoratorMetadata"; -var errorCodes42 = [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: errorCodes42, - 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 === 277 /* 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(fixId33, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); - } - if (typeOnlyChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId33, typeOnlyChanges, Diagnostics.Use_import_type)); - } - return actions2; - }, - fixIds: [fixId33] -}); -function getImportDeclaration(sourceFile, program, start) { - const identifier = tryCast(getTokenAtPosition(sourceFile, start), isIdentifier); - if (!identifier || identifier.parent.kind !== 184 /* 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 === 272 /* ImportEqualsDeclaration */) { - changes.insertModifierBefore(sourceFile, 156 /* TypeKeyword */, importDeclaration.name); - return; - } - const importClause = importDeclaration.kind === 274 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent; - if (importClause.name && importClause.namedBindings) { - return; - } - const checker = program.getTypeChecker(); - const importsValue = !!forEachImportClauseDeclaration(importClause, (decl) => { - if (skipAlias(decl.symbol, checker).flags & 111551 /* Value */) return true; - }); - if (importsValue) { - return; - } - changes.insertModifierBefore(sourceFile, 156 /* TypeKeyword */, importClause); -} -function doNamespaceImportChange(changes, sourceFile, importDeclaration, program) { - ts_refactor_exports.doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, importDeclaration.parent); -} - -// src/services/codefixes/fixUnusedIdentifier.ts -var fixName3 = "unusedIdentifier"; -var fixIdPrefix = "unusedIdentifier_prefix"; -var fixIdDelete = "unusedIdentifier_delete"; -var fixIdDeleteImports = "unusedIdentifier_deleteImports"; -var fixIdInfer = "unusedIdentifier_infer"; -var errorCodes43 = [ - 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, - Diagnostics.All_imports_in_import_declaration_are_unused.code, - Diagnostics.All_destructured_elements_are_unused.code, - Diagnostics.All_variables_are_unused.code, - Diagnostics.All_type_parameters_are_unused.code -]; -registerCodeFix({ - errorCodes: errorCodes43, - getCodeActions(context) { - const { errorCode, sourceFile, program, cancellationToken } = context; - const checker = program.getTypeChecker(); - const sourceFiles = program.getSourceFiles(); - const token = getTokenAtPosition(sourceFile, context.span.start); - if (isJSDocTemplateTag(token)) { - return [createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => t.delete(sourceFile, token)), Diagnostics.Remove_template_tag)]; - } - if (token.kind === 30 /* LessThanToken */) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteTypeParameters(t, sourceFile, token)); - return [createDeleteFix(changes, Diagnostics.Remove_type_parameters)]; - } - const importDecl = tryGetFullImport(token); - if (importDecl) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => t.delete(sourceFile, importDecl)); - return [createCodeFixAction(fixName3, changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)], fixIdDeleteImports, Diagnostics.Delete_all_unused_imports)]; - } else if (isImport(token)) { - const deletion = ts_textChanges_exports.ChangeTracker.with(context, (t) => tryDeleteDeclaration( - sourceFile, - token, - t, - checker, - sourceFiles, - program, - cancellationToken, - /*isFixAll*/ - false - )); - if (deletion.length) { - return [createCodeFixAction(fixName3, deletion, [Diagnostics.Remove_unused_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDeleteImports, Diagnostics.Delete_all_unused_imports)]; - } - } - if (isObjectBindingPattern(token.parent) || isArrayBindingPattern(token.parent)) { - if (isParameter(token.parent.parent)) { - const elements = token.parent.elements; - const diagnostic = [ - elements.length > 1 ? Diagnostics.Remove_unused_declarations_for_Colon_0 : Diagnostics.Remove_unused_declaration_for_Colon_0, - map(elements, (e) => e.getText(sourceFile)).join(", ") - ]; - return [ - createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteDestructuringElements(t, sourceFile, token.parent)), diagnostic) - ]; - } - return [ - createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteDestructuring(context, t, sourceFile, token.parent)), Diagnostics.Remove_unused_destructuring_declaration) - ]; - } - if (canDeleteEntireVariableStatement(sourceFile, token)) { - return [ - createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteEntireVariableStatement(t, sourceFile, token.parent)), Diagnostics.Remove_variable_statement) - ]; - } - if (isIdentifier(token) && isFunctionDeclaration(token.parent)) { - return [createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteFunctionLikeDeclaration(t, sourceFile, token.parent)), [Diagnostics.Remove_unused_declaration_for_Colon_0, token.getText(sourceFile)])]; - } - const result = []; - if (token.kind === 140 /* InferKeyword */) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => changeInferToUnknown(t, sourceFile, token)); - const name = cast(token.parent, isInferTypeNode).typeParameter.name.text; - result.push(createCodeFixAction(fixName3, changes, [Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, Diagnostics.Replace_all_unused_infer_with_unknown)); - } else { - const deletion = ts_textChanges_exports.ChangeTracker.with(context, (t) => tryDeleteDeclaration( - sourceFile, - token, - t, - checker, - sourceFiles, - program, - cancellationToken, - /*isFixAll*/ - false - )); - if (deletion.length) { - const name = isComputedPropertyName(token.parent) ? token.parent : token; - result.push(createDeleteFix(deletion, [Diagnostics.Remove_unused_declaration_for_Colon_0, name.getText(sourceFile)])); - } - } - const prefix = ts_textChanges_exports.ChangeTracker.with(context, (t) => tryPrefixDeclaration(t, errorCode, sourceFile, token)); - if (prefix.length) { - result.push(createCodeFixAction(fixName3, prefix, [Diagnostics.Prefix_0_with_an_underscore, token.getText(sourceFile)], fixIdPrefix, Diagnostics.Prefix_all_unused_declarations_with_where_possible)); - } - return result; - }, - fixIds: [fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer], - getAllCodeActions: (context) => { - const { sourceFile, program, cancellationToken } = context; - const checker = program.getTypeChecker(); - const sourceFiles = program.getSourceFiles(); - return codeFixAll(context, errorCodes43, (changes, diag2) => { - const token = getTokenAtPosition(sourceFile, diag2.start); - switch (context.fixId) { - case fixIdPrefix: - tryPrefixDeclaration(changes, diag2.code, sourceFile, token); - break; - case fixIdDeleteImports: { - const importDecl = tryGetFullImport(token); - if (importDecl) { - changes.delete(sourceFile, importDecl); - } else if (isImport(token)) { - tryDeleteDeclaration( - sourceFile, - token, - changes, - checker, - sourceFiles, - program, - cancellationToken, - /*isFixAll*/ - true - ); - } - break; - } - case fixIdDelete: { - if (token.kind === 140 /* InferKeyword */ || isImport(token)) { - break; - } else if (isJSDocTemplateTag(token)) { - changes.delete(sourceFile, token); - } else if (token.kind === 30 /* LessThanToken */) { - deleteTypeParameters(changes, sourceFile, token); - } else if (isObjectBindingPattern(token.parent)) { - if (token.parent.parent.initializer) { - break; - } else if (!isParameter(token.parent.parent) || isNotProvidedArguments(token.parent.parent, checker, sourceFiles)) { - changes.delete(sourceFile, token.parent.parent); - } - } else if (isArrayBindingPattern(token.parent.parent) && token.parent.parent.parent.initializer) { - break; - } else if (canDeleteEntireVariableStatement(sourceFile, token)) { - deleteEntireVariableStatement(changes, sourceFile, token.parent); - } else if (isIdentifier(token) && isFunctionDeclaration(token.parent)) { - deleteFunctionLikeDeclaration(changes, sourceFile, token.parent); - } else { - tryDeleteDeclaration( - sourceFile, - token, - changes, - checker, - sourceFiles, - program, - cancellationToken, - /*isFixAll*/ - true - ); - } - break; - } - case fixIdInfer: - if (token.kind === 140 /* InferKeyword */) { - changeInferToUnknown(changes, sourceFile, token); - } - break; - default: - Debug.fail(JSON.stringify(context.fixId)); - } - }); - } -}); -function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, factory.createKeywordTypeNode(159 /* UnknownKeyword */)); -} -function createDeleteFix(changes, diag2) { - return createCodeFixAction(fixName3, changes, diag2, fixIdDelete, Diagnostics.Delete_all_unused_declarations); -} -function deleteTypeParameters(changes, sourceFile, token) { - 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 === 277 /* ImportSpecifier */ || token.parent.kind === 274 /* ImportClause */); -} -function tryGetFullImport(token) { - return token.kind === 102 /* ImportKeyword */ ? tryCast(token.parent, isImportDeclaration) : void 0; -} -function canDeleteEntireVariableStatement(sourceFile, token) { - return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token; -} -function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 244 /* VariableStatement */ ? node.parent : node); -} -function deleteDestructuringElements(changes, sourceFile, node) { - forEach(node.elements, (n) => changes.delete(sourceFile, n)); -} -function deleteDestructuring(context, changes, sourceFile, { parent: parent2 }) { - if (isVariableDeclaration(parent2) && parent2.initializer && isCallLikeExpression(parent2.initializer)) { - if (isVariableDeclarationList(parent2.parent) && length(parent2.parent.declarations) > 1) { - const varStatement = parent2.parent.parent; - const pos = varStatement.getStart(sourceFile); - const end = varStatement.end; - changes.delete(sourceFile, parent2); - changes.insertNodeAt(sourceFile, end, parent2.initializer, { - prefix: getNewLineOrDefaultFromHost(context.host, context.formatContext.options) + sourceFile.text.slice(getPrecedingNonSpaceCharacterPosition(sourceFile.text, pos - 1), pos), - suffix: probablyUsesSemicolons(sourceFile) ? ";" : "" - }); - } else { - changes.replaceNode(sourceFile, parent2.parent, parent2.initializer); - } - } else { - changes.delete(sourceFile, parent2); - } -} -function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { - if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 140 /* InferKeyword */) { - token = cast(token.parent, isInferTypeNode).typeParameter.name; - } - if (isIdentifier(token) && canPrefix(token)) { - changes.replaceNode(sourceFile, token, factory.createIdentifier(`_${token.text}`)); - if (isParameter(token.parent)) { - getJSDocParameterTags(token.parent).forEach((tag) => { - if (isIdentifier(tag.name)) { - changes.replaceNode(sourceFile, tag.name, factory.createIdentifier(`_${tag.name.text}`)); - } - }); - } - } -} -function canPrefix(token) { - switch (token.parent.kind) { - case 170 /* Parameter */: - case 169 /* TypeParameter */: - return true; - case 261 /* VariableDeclaration */: { - const varDecl = token.parent; - switch (varDecl.parent.parent.kind) { - case 251 /* ForOfStatement */: - case 250 /* ForInStatement */: - return true; - } - } - } - return false; -} -function tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, program, cancellationToken, isFixAll) { - tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll); - if (isIdentifier(token)) { - ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(token, checker, sourceFile, (ref) => { - if (isPropertyAccessExpression(ref.parent) && ref.parent.name === ref) ref = ref.parent; - if (!isFixAll && mayDeleteExpression(ref)) { - changes.delete(sourceFile, ref.parent.parent); - } - }); - } -} -function tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll) { - const { parent: parent2 } = token; - if (isParameter(parent2)) { - tryDeleteParameter(changes, sourceFile, parent2, checker, sourceFiles, program, cancellationToken, isFixAll); - } else if (!(isFixAll && isIdentifier(token) && ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(token, checker, sourceFile))) { - const node = isImportClause(parent2) ? token : isComputedPropertyName(parent2) ? parent2.parent : parent2; - Debug.assert(node !== sourceFile, "should not delete whole source file"); - changes.delete(sourceFile, node); - } -} -function tryDeleteParameter(changes, sourceFile, parameter, checker, sourceFiles, program, cancellationToken, isFixAll = false) { - if (mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll)) { - if (parameter.modifiers && parameter.modifiers.length > 0 && (!isIdentifier(parameter.name) || ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(parameter.name, checker, sourceFile))) { - for (const modifier of parameter.modifiers) { - if (isModifier(modifier)) { - changes.deleteModifier(sourceFile, modifier); - } - } - } else if (!parameter.initializer && isNotProvidedArguments(parameter, checker, sourceFiles)) { - changes.delete(sourceFile, parameter); - } - } -} -function isNotProvidedArguments(parameter, checker, sourceFiles) { - const index = parameter.parent.parameters.indexOf(parameter); - return !ts_FindAllReferences_exports.Core.someSignatureUsage(parameter.parent, sourceFiles, checker, (_, call) => !call || call.arguments.length > index); -} -function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) { - const { parent: parent2 } = parameter; - switch (parent2.kind) { - case 175 /* MethodDeclaration */: - case 177 /* 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); - if (entries) { - for (const entry of entries) { - for (const reference of entry.references) { - if (reference.kind === ts_FindAllReferences_exports.EntryKind.Node) { - const isSuperCall2 = isSuperKeyword(reference.node) && isCallExpression(reference.node.parent) && reference.node.parent.arguments.length > index; - const isSuperMethodCall = isPropertyAccessExpression(reference.node.parent) && isSuperKeyword(reference.node.parent.expression) && isCallExpression(reference.node.parent.parent) && reference.node.parent.parent.arguments.length > index; - const isOverriddenMethod = (isMethodDeclaration(reference.node.parent) || isMethodSignature(reference.node.parent)) && reference.node.parent !== parameter.parent && reference.node.parent.parameters.length > index; - if (isSuperCall2 || isSuperMethodCall || isOverriddenMethod) return false; - } - } - } - } - return true; - case 263 /* FunctionDeclaration */: { - if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) { - return isLastParameter(parent2, parameter, isFixAll); - } - return true; - } - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return isLastParameter(parent2, parameter, isFixAll); - case 179 /* SetAccessor */: - return false; - case 178 /* 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.includes(reference)); -} -function isLastParameter(func, parameter, isFixAll) { - const parameters = func.parameters; - const index = parameters.indexOf(parameter); - Debug.assert(index !== -1, "The parameter should already be in the list"); - return isFixAll ? parameters.slice(index + 1).every((p) => isIdentifier(p.name) && !p.symbol.isReferenced) : index === parameters.length - 1; -} -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); -} -function deleteFunctionLikeDeclaration(changes, sourceFile, node) { - const declarations = node.symbol.declarations; - if (declarations) { - for (const declaration of declarations) { - changes.delete(sourceFile, declaration); - } - } -} - -// src/services/codefixes/fixUnreachableCode.ts -var fixId34 = "fixUnreachableCode"; -var errorCodes44 = [Diagnostics.Unreachable_code_detected.code]; -registerCodeFix({ - errorCodes: errorCodes44, - getCodeActions(context) { - const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken); - if (syntacticDiagnostics.length) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange27(t, context.sourceFile, context.span.start, context.span.length, context.errorCode)); - return [createCodeFixAction(fixId34, changes, Diagnostics.Remove_unreachable_code, fixId34, Diagnostics.Remove_all_unreachable_code)]; - }, - fixIds: [fixId34], - getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => doChange27(changes, diag2.file, diag2.start, diag2.length, diag2.code)) -}); -function doChange27(changes, sourceFile, start, length2, errorCode) { - const token = getTokenAtPosition(sourceFile, start); - const statement = findAncestor(token, isStatement); - if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { - const logData = JSON.stringify({ - statementKind: Debug.formatSyntaxKind(statement.kind), - tokenKind: Debug.formatSyntaxKind(token.kind), - errorCode, - start, - length: length2 - }); - Debug.fail("Token and statement should start at the same point. " + logData); - } - const container = (isBlock(statement.parent) ? statement.parent : statement).parent; - if (!isBlock(statement.parent) || statement === first(statement.parent.statements)) { - switch (container.kind) { - case 246 /* IfStatement */: - if (container.elseStatement) { - if (isBlock(statement.parent)) { - break; - } else { - changes.replaceNode(sourceFile, statement, factory.createBlock(emptyArray)); - } - return; - } - // falls through - case 248 /* WhileStatement */: - case 249 /* ForStatement */: - changes.delete(sourceFile, container); - return; - } - } - if (isBlock(statement.parent)) { - const end = start + length2; - const lastStatement = Debug.checkDefined(lastWhere(sliceAfter(statement.parent.statements, statement), (s) => s.pos < end), "Some statement should be last"); - changes.deleteNodeRange(sourceFile, statement, lastStatement); - } else { - changes.delete(sourceFile, statement); - } -} -function lastWhere(a, pred) { - let last2; - for (const value of a) { - if (!pred(value)) break; - last2 = value; - } - return last2; -} - -// src/services/codefixes/fixUnusedLabel.ts -var fixId35 = "fixUnusedLabel"; -var errorCodes45 = [Diagnostics.Unused_label.code]; -registerCodeFix({ - errorCodes: errorCodes45, - getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange28(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId35, changes, Diagnostics.Remove_unused_label, fixId35, Diagnostics.Remove_all_unused_labels)]; - }, - fixIds: [fixId35], - getAllCodeActions: (context) => codeFixAll(context, errorCodes45, (changes, diag2) => doChange28(changes, diag2.file, diag2.start)) -}); -function doChange28(changes, sourceFile, start) { - const token = getTokenAtPosition(sourceFile, start); - const labeledStatement = cast(token.parent, isLabeledStatement); - const pos = token.getStart(sourceFile); - const statementPos = labeledStatement.statement.getStart(sourceFile); - const end = positionsAreOnSameLine(pos, statementPos, sourceFile) ? statementPos : skipTrivia( - sourceFile.text, - findChildOfKind(labeledStatement, 59 /* ColonToken */, sourceFile).end, - /*stopAfterLineBreak*/ - true - ); - changes.deleteRange(sourceFile, { pos, end }); -} - -// src/services/codefixes/fixJSDocTypes.ts -var fixIdPlain = "fixJSDocTypes_plain"; -var fixIdNullable = "fixJSDocTypes_nullable"; -var errorCodes46 = [ - 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: errorCodes46, - getCodeActions(context) { - const { sourceFile } = context; - const checker = context.program.getTypeChecker(); - 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 === 315 /* 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, fixId56, fixAllDescription) { - 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)], fixId56, fixAllDescription); - } - }, - fixIds: [fixIdPlain, fixIdNullable], - getAllCodeActions(context) { - const { fixId: fixId56, program, sourceFile } = context; - const checker = program.getTypeChecker(); - return codeFixAll(context, errorCodes46, (changes, err) => { - const info = getInfo15(err.file, err.start, checker); - if (!info) return; - const { typeNode, type } = info; - const fixedType = typeNode.kind === 315 /* JSDocNullableType */ && fixId56 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange29(changes, sourceFile, typeNode, fixedType, checker); - }); - } -}); -function doChange29(changes, sourceFile, oldTypeNode, newType, checker) { - changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( - newType, - /*enclosingDeclaration*/ - oldTypeNode, - /*flags*/ - void 0 - )); -} -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 235 /* AsExpression */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 263 /* FunctionDeclaration */: - case 178 /* GetAccessor */: - case 182 /* IndexSignature */: - case 201 /* MappedType */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 170 /* Parameter */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 179 /* SetAccessor */: - case 266 /* TypeAliasDeclaration */: - case 217 /* TypeAssertionExpression */: - case 261 /* VariableDeclaration */: - return true; - default: - return false; - } -} -function getType(checker, node) { - if (isJSDocNullableType(node)) { - const type = checker.getTypeFromTypeNode(node.type); - if (type === checker.getNeverType() || type === checker.getVoidType()) { - return type; - } - return checker.getUnionType( - append([type, checker.getUndefinedType()], node.postfix ? void 0 : checker.getNullType()) - ); - } - return checker.getTypeFromTypeNode(node); -} - -// src/services/codefixes/fixMissingCallParentheses.ts -var fixId36 = "fixMissingCallParentheses"; -var errorCodes47 = [ - Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code -]; -registerCodeFix({ - errorCodes: errorCodes47, - fixIds: [fixId36], - getCodeActions(context) { - const { sourceFile, span } = context; - const callName = getCallName(sourceFile, span.start); - if (!callName) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange30(t, context.sourceFile, callName)); - return [createCodeFixAction(fixId36, changes, Diagnostics.Add_missing_call_parentheses, fixId36, Diagnostics.Add_all_missing_call_parentheses)]; - }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes47, (changes, diag2) => { - const callName = getCallName(diag2.file, diag2.start); - if (callName) doChange30(changes, diag2.file, callName); - }) -}); -function doChange30(changes, sourceFile, name) { - changes.replaceNodeWithText(sourceFile, name, `${name.text}()`); -} -function getCallName(sourceFile, start) { - const token = getTokenAtPosition(sourceFile, start); - if (isPropertyAccessExpression(token.parent)) { - let current = token.parent; - while (isPropertyAccessExpression(current.parent)) { - current = current.parent; - } - return current.name; - } - if (isIdentifier(token)) { - return token; - } - return void 0; -} - -// src/services/codefixes/fixMissingTypeAnnotationOnExports.ts -var fixId37 = "fixMissingTypeAnnotationOnExports"; -var addAnnotationFix = "add-annotation"; -var addInlineTypeAssertion = "add-type-assertion"; -var extractExpression = "extract-expression"; -var errorCodes48 = [ - Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code, - Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code, - Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code, - Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code, - Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code, - Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code, - Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations.code, - Diagnostics.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations.code, - Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations.code, - Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations.code, - Diagnostics.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations.code, - Diagnostics.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations.code, - Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations.code, - Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations.code, - Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations.code, - Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations.code, - Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations.code, - Diagnostics.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function.code, - Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations.code, - Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations.code, - Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code -]; -var canHaveTypeAnnotation = /* @__PURE__ */ new Set([ - 178 /* GetAccessor */, - 175 /* MethodDeclaration */, - 173 /* PropertyDeclaration */, - 263 /* FunctionDeclaration */, - 219 /* FunctionExpression */, - 220 /* ArrowFunction */, - 261 /* VariableDeclaration */, - 170 /* Parameter */, - 278 /* ExportAssignment */, - 264 /* ClassDeclaration */, - 207 /* ObjectBindingPattern */, - 208 /* ArrayBindingPattern */ -]); -var declarationEmitNodeBuilderFlags2 = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */; -var declarationEmitInternalNodeBuilderFlags2 = 1 /* WriteComputedProps */; -registerCodeFix({ - errorCodes: errorCodes48, - fixIds: [fixId37], - getCodeActions(context) { - const fixes = []; - addCodeAction(addAnnotationFix, fixes, context, 0 /* Full */, (f) => f.addTypeAnnotation(context.span)); - addCodeAction(addAnnotationFix, fixes, context, 1 /* Relative */, (f) => f.addTypeAnnotation(context.span)); - addCodeAction(addAnnotationFix, fixes, context, 2 /* Widened */, (f) => f.addTypeAnnotation(context.span)); - addCodeAction(addInlineTypeAssertion, fixes, context, 0 /* Full */, (f) => f.addInlineAssertion(context.span)); - addCodeAction(addInlineTypeAssertion, fixes, context, 1 /* Relative */, (f) => f.addInlineAssertion(context.span)); - addCodeAction(addInlineTypeAssertion, fixes, context, 2 /* Widened */, (f) => f.addInlineAssertion(context.span)); - addCodeAction(extractExpression, fixes, context, 0 /* Full */, (f) => f.extractAsVariable(context.span)); - return fixes; - }, - getAllCodeActions: (context) => { - const changes = withContext(context, 0 /* Full */, (f) => { - eachDiagnostic(context, errorCodes48, (diag2) => { - f.addTypeAnnotation(diag2); - }); - }); - return createCombinedCodeActions(changes.textChanges); - } -}); -function addCodeAction(fixName8, fixes, context, typePrintMode, cb) { - const changes = withContext(context, typePrintMode, cb); - if (changes.result && changes.textChanges.length) { - fixes.push(createCodeFixAction( - fixName8, - changes.textChanges, - changes.result, - fixId37, - Diagnostics.Add_all_missing_type_annotations - )); - } -} -function withContext(context, typePrintMode, cb) { - const emptyInferenceResult = { typeNode: void 0, mutatedTarget: false }; - const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context); - const sourceFile = context.sourceFile; - const program = context.program; - const typeChecker = program.getTypeChecker(); - const scriptTarget = getEmitScriptTarget(program.getCompilerOptions()); - const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host); - const fixedNodes = /* @__PURE__ */ new Set(); - const expandoPropertiesAdded = /* @__PURE__ */ new Set(); - const typePrinter = createPrinter({ - preserveSourceNewlines: false - }); - const result = cb({ addTypeAnnotation, addInlineAssertion, extractAsVariable }); - importAdder.writeFixes(changeTracker); - return { - result, - textChanges: changeTracker.getChanges() - }; - function addTypeAnnotation(span) { - context.cancellationToken.throwIfCancellationRequested(); - const nodeWithDiag = getTokenAtPosition(sourceFile, span.start); - const expandoFunction = findExpandoFunction(nodeWithDiag); - if (expandoFunction) { - if (isFunctionDeclaration(expandoFunction)) { - return createNamespaceForExpandoProperties(expandoFunction); - } - return fixIsolatedDeclarationError(expandoFunction); - } - const nodeMissingType = findAncestorWithMissingType(nodeWithDiag); - if (nodeMissingType) { - return fixIsolatedDeclarationError(nodeMissingType); - } - return void 0; - } - function createNamespaceForExpandoProperties(expandoFunc) { - var _a; - if (expandoPropertiesAdded == null ? void 0 : expandoPropertiesAdded.has(expandoFunc)) return void 0; - expandoPropertiesAdded == null ? void 0 : expandoPropertiesAdded.add(expandoFunc); - const type = typeChecker.getTypeAtLocation(expandoFunc); - const elements = typeChecker.getPropertiesOfType(type); - if (!expandoFunc.name || elements.length === 0) return void 0; - const newProperties = []; - for (const symbol of elements) { - if (!isIdentifierText(symbol.name, getEmitScriptTarget(program.getCompilerOptions()))) continue; - if (symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration)) continue; - newProperties.push(factory.createVariableStatement( - [factory.createModifier(95 /* ExportKeyword */)], - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - symbol.name, - /*exclamationToken*/ - void 0, - typeToTypeNode2(typeChecker.getTypeOfSymbol(symbol), expandoFunc), - /*initializer*/ - void 0 - )] - ) - )); - } - if (newProperties.length === 0) return void 0; - const modifiers = []; - if ((_a = expandoFunc.modifiers) == null ? void 0 : _a.some((modifier) => modifier.kind === 95 /* ExportKeyword */)) { - modifiers.push(factory.createModifier(95 /* ExportKeyword */)); - } - modifiers.push(factory.createModifier(138 /* DeclareKeyword */)); - const namespace = factory.createModuleDeclaration( - modifiers, - expandoFunc.name, - factory.createModuleBlock(newProperties), - /*flags*/ - 32 /* Namespace */ | 128 /* ExportContext */ | 33554432 /* Ambient */ | 101441536 /* ContextFlags */ - ); - changeTracker.insertNodeAfter(sourceFile, expandoFunc, namespace); - return [Diagnostics.Annotate_types_of_properties_expando_function_in_a_namespace]; - } - function needsParenthesizedExpressionForAssertion(node) { - return !isEntityNameExpression(node) && !isCallExpression(node) && !isObjectLiteralExpression(node) && !isArrayLiteralExpression(node); - } - function createAsExpression(node, type) { - if (needsParenthesizedExpressionForAssertion(node)) { - node = factory.createParenthesizedExpression(node); - } - return factory.createAsExpression(node, type); - } - function createSatisfiesAsExpression(node, type) { - if (needsParenthesizedExpressionForAssertion(node)) { - node = factory.createParenthesizedExpression(node); - } - return factory.createAsExpression(factory.createSatisfiesExpression(node, getSynthesizedDeepClone(type)), type); - } - function addInlineAssertion(span) { - context.cancellationToken.throwIfCancellationRequested(); - const nodeWithDiag = getTokenAtPosition(sourceFile, span.start); - const expandoFunction = findExpandoFunction(nodeWithDiag); - if (expandoFunction) return; - const targetNode = findBestFittingNode(nodeWithDiag, span); - if (!targetNode || isValueSignatureDeclaration(targetNode) || isValueSignatureDeclaration(targetNode.parent)) return; - const isExpressionTarget = isExpression(targetNode); - const isShorthandPropertyAssignmentTarget = isShorthandPropertyAssignment(targetNode); - if (!isShorthandPropertyAssignmentTarget && isDeclaration(targetNode)) { - return void 0; - } - if (findAncestor(targetNode, isBindingPattern)) { - return void 0; - } - if (findAncestor(targetNode, isEnumMember)) { - return void 0; - } - if (isExpressionTarget && (findAncestor(targetNode, isHeritageClause) || findAncestor(targetNode, isTypeNode))) { - return void 0; - } - if (isSpreadElement(targetNode)) { - return void 0; - } - const variableDeclaration = findAncestor(targetNode, isVariableDeclaration); - const type = variableDeclaration && typeChecker.getTypeAtLocation(variableDeclaration); - if (type && type.flags & 8192 /* UniqueESSymbol */) { - return void 0; - } - if (!(isExpressionTarget || isShorthandPropertyAssignmentTarget)) return void 0; - const { typeNode, mutatedTarget } = inferType(targetNode, type); - if (!typeNode || mutatedTarget) return void 0; - if (isShorthandPropertyAssignmentTarget) { - changeTracker.insertNodeAt( - sourceFile, - targetNode.end, - createAsExpression( - getSynthesizedDeepClone(targetNode.name), - typeNode - ), - { - prefix: ": " - } - ); - } else if (isExpressionTarget) { - changeTracker.replaceNode( - sourceFile, - targetNode, - createSatisfiesAsExpression( - getSynthesizedDeepClone(targetNode), - typeNode - ) - ); - } else { - Debug.assertNever(targetNode); - } - return [Diagnostics.Add_satisfies_and_an_inline_type_assertion_with_0, typeToStringForDiag(typeNode)]; - } - function extractAsVariable(span) { - context.cancellationToken.throwIfCancellationRequested(); - const nodeWithDiag = getTokenAtPosition(sourceFile, span.start); - const targetNode = findBestFittingNode(nodeWithDiag, span); - if (!targetNode || isValueSignatureDeclaration(targetNode) || isValueSignatureDeclaration(targetNode.parent)) return; - const isExpressionTarget = isExpression(targetNode); - if (!isExpressionTarget) return; - if (isArrayLiteralExpression(targetNode)) { - changeTracker.replaceNode( - sourceFile, - targetNode, - createAsExpression(targetNode, factory.createTypeReferenceNode("const")) - ); - return [Diagnostics.Mark_array_literal_as_const]; - } - const parentPropertyAssignment = findAncestor(targetNode, isPropertyAssignment); - if (parentPropertyAssignment) { - if (parentPropertyAssignment === targetNode.parent && isEntityNameExpression(targetNode)) return; - const tempName = factory.createUniqueName( - getIdentifierForNode(targetNode, sourceFile, typeChecker, sourceFile), - 16 /* Optimistic */ - ); - let replacementTarget = targetNode; - let initializationNode = targetNode; - if (isSpreadElement(replacementTarget)) { - replacementTarget = walkUpParenthesizedExpressions(replacementTarget.parent); - if (isConstAssertion2(replacementTarget.parent)) { - initializationNode = replacementTarget = replacementTarget.parent; - } else { - initializationNode = createAsExpression( - replacementTarget, - factory.createTypeReferenceNode("const") - ); - } - } - if (isEntityNameExpression(replacementTarget)) return void 0; - const variableDefinition = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - tempName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializationNode - ) - ], 2 /* Const */) - ); - const statement = findAncestor(targetNode, isStatement); - changeTracker.insertNodeBefore(sourceFile, statement, variableDefinition); - changeTracker.replaceNode( - sourceFile, - replacementTarget, - factory.createAsExpression( - factory.cloneNode(tempName), - factory.createTypeQueryNode( - factory.cloneNode(tempName) - ) - ) - ); - return [Diagnostics.Extract_to_variable_and_replace_with_0_as_typeof_0, typeToStringForDiag(tempName)]; - } - } - function findExpandoFunction(node) { - const expandoDeclaration = findAncestor(node, (n) => isStatement(n) ? "quit" : isExpandoPropertyDeclaration(n)); - if (expandoDeclaration && isExpandoPropertyDeclaration(expandoDeclaration)) { - let assignmentTarget = expandoDeclaration; - if (isBinaryExpression(assignmentTarget)) { - assignmentTarget = assignmentTarget.left; - if (!isExpandoPropertyDeclaration(assignmentTarget)) return void 0; - } - const targetType = typeChecker.getTypeAtLocation(assignmentTarget.expression); - if (!targetType) return; - const properties = typeChecker.getPropertiesOfType(targetType); - if (some(properties, (p) => p.valueDeclaration === expandoDeclaration || p.valueDeclaration === expandoDeclaration.parent)) { - const fn = targetType.symbol.valueDeclaration; - if (fn) { - if (isFunctionExpressionOrArrowFunction(fn) && isVariableDeclaration(fn.parent)) { - return fn.parent; - } - if (isFunctionDeclaration(fn)) { - return fn; - } - } - } - } - return void 0; - } - function fixIsolatedDeclarationError(node) { - if (fixedNodes == null ? void 0 : fixedNodes.has(node)) return void 0; - fixedNodes == null ? void 0 : fixedNodes.add(node); - switch (node.kind) { - case 170 /* Parameter */: - case 173 /* PropertyDeclaration */: - case 261 /* VariableDeclaration */: - return addTypeToVariableLike(node); - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - return addTypeToSignatureDeclaration(node, sourceFile); - case 278 /* ExportAssignment */: - return transformExportAssignment(node); - case 264 /* ClassDeclaration */: - return transformExtendsClauseWithExpression(node); - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - return transformDestructuringPatterns(node); - default: - throw new Error(`Cannot find a fix for the given node ${node.kind}`); - } - } - function addTypeToSignatureDeclaration(func, sourceFile2) { - if (func.type) { - return; - } - const { typeNode } = inferType(func); - if (typeNode) { - changeTracker.tryInsertTypeAnnotation( - sourceFile2, - func, - typeNode - ); - return [Diagnostics.Add_return_type_0, typeToStringForDiag(typeNode)]; - } - } - function transformExportAssignment(defaultExport) { - if (defaultExport.isExportEquals) { - return; - } - const { typeNode } = inferType(defaultExport.expression); - if (!typeNode) return void 0; - const defaultIdentifier = factory.createUniqueName("_default"); - changeTracker.replaceNodeWithNodes(sourceFile, defaultExport, [ - factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - defaultIdentifier, - /*exclamationToken*/ - void 0, - typeNode, - defaultExport.expression - )], - 2 /* Const */ - ) - ), - factory.updateExportAssignment(defaultExport, defaultExport == null ? void 0 : defaultExport.modifiers, defaultIdentifier) - ]); - return [ - Diagnostics.Extract_default_export_to_variable - ]; - } - function transformExtendsClauseWithExpression(classDecl) { - var _a, _b; - const extendsClause = (_a = classDecl.heritageClauses) == null ? void 0 : _a.find((p) => p.token === 96 /* ExtendsKeyword */); - const heritageExpression = extendsClause == null ? void 0 : extendsClause.types[0]; - if (!heritageExpression) { - return void 0; - } - const { typeNode: heritageTypeNode } = inferType(heritageExpression.expression); - if (!heritageTypeNode) { - return void 0; - } - const baseClassName = factory.createUniqueName( - classDecl.name ? classDecl.name.text + "Base" : "Anonymous", - 16 /* Optimistic */ - ); - const heritageVariable = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - baseClassName, - /*exclamationToken*/ - void 0, - heritageTypeNode, - heritageExpression.expression - )], - 2 /* Const */ - ) - ); - changeTracker.insertNodeBefore(sourceFile, classDecl, heritageVariable); - const trailingComments = getTrailingCommentRanges(sourceFile.text, heritageExpression.end); - const realEnd = ((_b = trailingComments == null ? void 0 : trailingComments[trailingComments.length - 1]) == null ? void 0 : _b.end) ?? heritageExpression.end; - changeTracker.replaceRange( - sourceFile, - { - pos: heritageExpression.getFullStart(), - end: realEnd - }, - baseClassName, - { - prefix: " " - } - ); - return [Diagnostics.Extract_base_class_to_variable]; - } - // removed by dead control flow - - // removed by dead control flow - - function transformDestructuringPatterns(bindingPattern) { - var _a; - const enclosingVariableDeclaration = bindingPattern.parent; - const enclosingVarStmt = bindingPattern.parent.parent.parent; - if (!enclosingVariableDeclaration.initializer) return void 0; - let baseExpr; - const newNodes = []; - if (!isIdentifier(enclosingVariableDeclaration.initializer)) { - const tempHolderForReturn = factory.createUniqueName("dest", 16 /* Optimistic */); - baseExpr = { expression: { kind: 3 /* Identifier */, identifier: tempHolderForReturn } }; - newNodes.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - tempHolderForReturn, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - enclosingVariableDeclaration.initializer - )], - 2 /* Const */ - ) - )); - } else { - baseExpr = { expression: { kind: 3 /* Identifier */, identifier: enclosingVariableDeclaration.initializer } }; - } - const bindingElements = []; - if (isArrayBindingPattern(bindingPattern)) { - addArrayBindingPatterns(bindingPattern, bindingElements, baseExpr); - } else { - addObjectBindingPatterns(bindingPattern, bindingElements, baseExpr); - } - const expressionToVar = /* @__PURE__ */ new Map(); - for (const bindingElement of bindingElements) { - if (bindingElement.element.propertyName && isComputedPropertyName(bindingElement.element.propertyName)) { - const computedExpression = bindingElement.element.propertyName.expression; - const identifierForComputedProperty = factory.getGeneratedNameForNode(computedExpression); - const variableDecl = factory.createVariableDeclaration( - identifierForComputedProperty, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - computedExpression - ); - const variableList = factory.createVariableDeclarationList([variableDecl], 2 /* Const */); - const variableStatement = factory.createVariableStatement( - /*modifiers*/ - void 0, - variableList - ); - newNodes.push(variableStatement); - expressionToVar.set(computedExpression, identifierForComputedProperty); - } - const name = bindingElement.element.name; - if (isArrayBindingPattern(name)) { - addArrayBindingPatterns(name, bindingElements, bindingElement); - } else if (isObjectBindingPattern(name)) { - addObjectBindingPatterns(name, bindingElements, bindingElement); - } else { - const { typeNode } = inferType(name); - let variableInitializer = createChainedExpression(bindingElement, expressionToVar); - if (bindingElement.element.initializer) { - const propertyName = (_a = bindingElement.element) == null ? void 0 : _a.propertyName; - const tempName = factory.createUniqueName( - propertyName && isIdentifier(propertyName) ? propertyName.text : "temp", - 16 /* Optimistic */ - ); - newNodes.push(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - tempName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - variableInitializer - )], - 2 /* Const */ - ) - )); - variableInitializer = factory.createConditionalExpression( - factory.createBinaryExpression( - tempName, - factory.createToken(37 /* EqualsEqualsEqualsToken */), - factory.createIdentifier("undefined") - ), - factory.createToken(58 /* QuestionToken */), - bindingElement.element.initializer, - factory.createToken(59 /* ColonToken */), - variableInitializer - ); - } - const exportModifier = hasSyntacticModifier(enclosingVarStmt, 32 /* Export */) ? [factory.createToken(95 /* ExportKeyword */)] : void 0; - newNodes.push(factory.createVariableStatement( - exportModifier, - factory.createVariableDeclarationList( - [factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - typeNode, - variableInitializer - )], - 2 /* Const */ - ) - )); - } - } - if (enclosingVarStmt.declarationList.declarations.length > 1) { - newNodes.push(factory.updateVariableStatement( - enclosingVarStmt, - enclosingVarStmt.modifiers, - factory.updateVariableDeclarationList( - enclosingVarStmt.declarationList, - enclosingVarStmt.declarationList.declarations.filter((node) => node !== bindingPattern.parent) - ) - )); - } - changeTracker.replaceNodeWithNodes(sourceFile, enclosingVarStmt, newNodes); - return [ - Diagnostics.Extract_binding_expressions_to_variable - ]; - } - function addArrayBindingPatterns(bindingPattern, bindingElements, parent2) { - for (let i = 0; i < bindingPattern.elements.length; ++i) { - const element = bindingPattern.elements[i]; - if (isOmittedExpression(element)) { - continue; - } - bindingElements.push({ - element, - parent: parent2, - expression: { kind: 2 /* ArrayAccess */, arrayIndex: i } - }); - } - } - function addObjectBindingPatterns(bindingPattern, bindingElements, parent2) { - for (const bindingElement of bindingPattern.elements) { - let name; - if (bindingElement.propertyName) { - if (isComputedPropertyName(bindingElement.propertyName)) { - bindingElements.push({ - element: bindingElement, - parent: parent2, - expression: { kind: 1 /* Computed */, computed: bindingElement.propertyName.expression } - }); - continue; - } else { - name = bindingElement.propertyName.text; - } - } else { - name = bindingElement.name.text; - } - bindingElements.push({ - element: bindingElement, - parent: parent2, - expression: { kind: 0 /* Text */, text: name } - }); - } - } - function createChainedExpression(expression, expressionToVar) { - const reverseTraverse = [expression]; - while (expression.parent) { - expression = expression.parent; - reverseTraverse.push(expression); - } - let chainedExpression = reverseTraverse[reverseTraverse.length - 1].expression.identifier; - for (let i = reverseTraverse.length - 2; i >= 0; --i) { - const nextSubExpr = reverseTraverse[i].expression; - if (nextSubExpr.kind === 0 /* Text */) { - chainedExpression = factory.createPropertyAccessChain( - chainedExpression, - /*questionDotToken*/ - void 0, - factory.createIdentifier(nextSubExpr.text) - ); - } else if (nextSubExpr.kind === 1 /* Computed */) { - chainedExpression = factory.createElementAccessExpression( - chainedExpression, - expressionToVar.get(nextSubExpr.computed) - ); - } else if (nextSubExpr.kind === 2 /* ArrayAccess */) { - chainedExpression = factory.createElementAccessExpression( - chainedExpression, - nextSubExpr.arrayIndex - ); - } - } - return chainedExpression; - } - function inferType(node, variableType) { - if (typePrintMode === 1 /* Relative */) { - return relativeType(node); - } - let type; - if (isValueSignatureDeclaration(node)) { - const signature = typeChecker.getSignatureFromDeclaration(node); - if (signature) { - const typePredicate = typeChecker.getTypePredicateOfSignature(signature); - if (typePredicate) { - if (!typePredicate.type) { - return emptyInferenceResult; - } - return { - typeNode: typePredicateToTypeNode(typePredicate, findAncestor(node, isDeclaration) ?? sourceFile, getFlags(typePredicate.type)), - mutatedTarget: false - }; - } - type = typeChecker.getReturnTypeOfSignature(signature); - } - } else { - type = typeChecker.getTypeAtLocation(node); - } - if (!type) { - return emptyInferenceResult; - } - if (typePrintMode === 2 /* Widened */) { - if (variableType) { - type = variableType; - } - const widenedType = typeChecker.getWidenedLiteralType(type); - if (typeChecker.isTypeAssignableTo(widenedType, type)) { - return emptyInferenceResult; - } - type = widenedType; - } - const enclosingDeclaration = findAncestor(node, isDeclaration) ?? sourceFile; - if (isParameter(node) && typeChecker.requiresAddingImplicitUndefined(node, enclosingDeclaration)) { - type = typeChecker.getUnionType([typeChecker.getUndefinedType(), type], 0 /* None */); - } - return { - typeNode: typeToTypeNode2(type, enclosingDeclaration, getFlags(type)), - mutatedTarget: false - }; - function getFlags(type2) { - return (isVariableDeclaration(node) || isPropertyDeclaration(node) && hasSyntacticModifier(node, 256 /* Static */ | 8 /* Readonly */)) && type2.flags & 8192 /* UniqueESSymbol */ ? 1048576 /* AllowUniqueESSymbolType */ : 0 /* None */; - } - } - function createTypeOfFromEntityNameExpression(node) { - return factory.createTypeQueryNode(getSynthesizedDeepClone(node)); - } - function typeFromArraySpreadElements(node, name = "temp") { - const isConstContext = !!findAncestor(node, isConstAssertion2); - if (!isConstContext) return emptyInferenceResult; - return typeFromSpreads( - node, - name, - isConstContext, - (n) => n.elements, - isSpreadElement, - factory.createSpreadElement, - (props) => factory.createArrayLiteralExpression( - props, - /*multiLine*/ - true - ), - (types) => factory.createTupleTypeNode(types.map(factory.createRestTypeNode)) - ); - } - function typeFromObjectSpreadAssignment(node, name = "temp") { - const isConstContext = !!findAncestor(node, isConstAssertion2); - return typeFromSpreads( - node, - name, - isConstContext, - (n) => n.properties, - isSpreadAssignment, - factory.createSpreadAssignment, - (props) => factory.createObjectLiteralExpression( - props, - /*multiLine*/ - true - ), - factory.createIntersectionTypeNode - ); - } - function typeFromSpreads(node, name, isConstContext, getChildren, isSpread, createSpread, makeNodeOfKind, finalType) { - const intersectionTypes = []; - const newSpreads = []; - let currentVariableProperties; - const statement = findAncestor(node, isStatement); - for (const prop of getChildren(node)) { - if (isSpread(prop)) { - finalizesVariablePart(); - if (isEntityNameExpression(prop.expression)) { - intersectionTypes.push(createTypeOfFromEntityNameExpression(prop.expression)); - newSpreads.push(prop); - } else { - makeVariable(prop.expression); - } - } else { - (currentVariableProperties ?? (currentVariableProperties = [])).push(prop); - } - } - if (newSpreads.length === 0) { - return emptyInferenceResult; - } - finalizesVariablePart(); - changeTracker.replaceNode(sourceFile, node, makeNodeOfKind(newSpreads)); - return { - typeNode: finalType(intersectionTypes), - mutatedTarget: true - }; - function makeVariable(expression) { - const tempName = factory.createUniqueName( - name + "_Part" + (newSpreads.length + 1), - 16 /* Optimistic */ - ); - const initializer = !isConstContext ? expression : factory.createAsExpression( - expression, - factory.createTypeReferenceNode("const") - ); - const variableDefinition = factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - tempName, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ) - ], 2 /* Const */) - ); - changeTracker.insertNodeBefore(sourceFile, statement, variableDefinition); - intersectionTypes.push(createTypeOfFromEntityNameExpression(tempName)); - newSpreads.push(createSpread(tempName)); - } - function finalizesVariablePart() { - if (currentVariableProperties) { - makeVariable(makeNodeOfKind( - currentVariableProperties - )); - currentVariableProperties = void 0; - } - } - } - function isConstAssertion2(location) { - return isAssertionExpression(location) && isConstTypeReference(location.type); - } - function relativeType(node) { - if (isParameter(node)) { - return emptyInferenceResult; - } - if (isShorthandPropertyAssignment(node)) { - return { - typeNode: createTypeOfFromEntityNameExpression(node.name), - mutatedTarget: false - }; - } - if (isEntityNameExpression(node)) { - return { - typeNode: createTypeOfFromEntityNameExpression(node), - mutatedTarget: false - }; - } - if (isConstAssertion2(node)) { - return relativeType(node.expression); - } - if (isArrayLiteralExpression(node)) { - const variableDecl = findAncestor(node, isVariableDeclaration); - const partName = variableDecl && isIdentifier(variableDecl.name) ? variableDecl.name.text : void 0; - return typeFromArraySpreadElements(node, partName); - } - if (isObjectLiteralExpression(node)) { - const variableDecl = findAncestor(node, isVariableDeclaration); - const partName = variableDecl && isIdentifier(variableDecl.name) ? variableDecl.name.text : void 0; - return typeFromObjectSpreadAssignment(node, partName); - } - if (isVariableDeclaration(node) && node.initializer) { - return relativeType(node.initializer); - } - if (isConditionalExpression(node)) { - const { typeNode: trueType, mutatedTarget: mTrue } = relativeType(node.whenTrue); - if (!trueType) return emptyInferenceResult; - const { typeNode: falseType, mutatedTarget: mFalse } = relativeType(node.whenFalse); - if (!falseType) return emptyInferenceResult; - return { - typeNode: factory.createUnionTypeNode([trueType, falseType]), - mutatedTarget: mTrue || mFalse - }; - } - return emptyInferenceResult; - } - function typeToTypeNode2(type, enclosingDeclaration, flags = 0 /* None */) { - let isTruncated = false; - const minimizedTypeNode = typeToMinimizedReferenceType(typeChecker, type, enclosingDeclaration, declarationEmitNodeBuilderFlags2 | flags, declarationEmitInternalNodeBuilderFlags2, { - moduleResolverHost: program, - trackSymbol() { - return true; - }, - reportTruncationError() { - isTruncated = true; - } - }); - if (!minimizedTypeNode) { - return void 0; - } - const result2 = typeNodeToAutoImportableTypeNode(minimizedTypeNode, importAdder, scriptTarget); - return isTruncated ? factory.createKeywordTypeNode(133 /* AnyKeyword */) : result2; - } - function typePredicateToTypeNode(typePredicate, enclosingDeclaration, flags = 0 /* None */) { - let isTruncated = false; - const result2 = typePredicateToAutoImportableTypeNode(typeChecker, importAdder, typePredicate, enclosingDeclaration, scriptTarget, declarationEmitNodeBuilderFlags2 | flags, declarationEmitInternalNodeBuilderFlags2, { - moduleResolverHost: program, - trackSymbol() { - return true; - }, - reportTruncationError() { - isTruncated = true; - } - }); - return isTruncated ? factory.createKeywordTypeNode(133 /* AnyKeyword */) : result2; - } - function addTypeToVariableLike(decl) { - const { typeNode } = inferType(decl); - if (typeNode) { - if (decl.type) { - changeTracker.replaceNode(getSourceFileOfNode(decl), decl.type, typeNode); - } else { - changeTracker.tryInsertTypeAnnotation(getSourceFileOfNode(decl), decl, typeNode); - } - return [Diagnostics.Add_annotation_of_type_0, typeToStringForDiag(typeNode)]; - } - } - function typeToStringForDiag(node) { - setEmitFlags(node, 1 /* SingleLine */); - const result2 = typePrinter.printNode(4 /* Unspecified */, node, sourceFile); - if (result2.length > defaultMaximumTruncationLength) { - return result2.substring(0, defaultMaximumTruncationLength - "...".length) + "..."; - } - setEmitFlags(node, 0 /* None */); - return result2; - } - function findAncestorWithMissingType(node) { - return findAncestor(node, (n) => { - return canHaveTypeAnnotation.has(n.kind) && (!isObjectBindingPattern(n) && !isArrayBindingPattern(n) || isVariableDeclaration(n.parent)); - }); - } - function findBestFittingNode(node, span) { - while (node && node.end < span.start + span.length) { - node = node.parent; - } - while (node.parent.pos === node.pos && node.parent.end === node.end) { - node = node.parent; - } - if (isIdentifier(node) && hasInitializer(node.parent) && node.parent.initializer) { - return node.parent.initializer; - } - return node; - } -} - -// src/services/codefixes/fixAwaitInSyncFunction.ts -var fixId38 = "fixAwaitInSyncFunction"; -var errorCodes49 = [ - 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: errorCodes49, - 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) => doChange31(t, sourceFile, nodes)); - return [createCodeFixAction(fixId38, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId38, Diagnostics.Add_all_missing_async_modifiers)]; - }, - fixIds: [fixId38], - getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) { - const seen = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes49, (changes, diag2) => { - const nodes = getNodes3(diag2.file, diag2.start); - if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; - doChange31(changes, context.sourceFile, nodes); - }); - } -}); -function getReturnType(expr) { - if (expr.type) { - return expr.type; - } - if (isVariableDeclaration(expr.parent) && expr.parent.type && isFunctionTypeNode(expr.parent.type)) { - return expr.parent.type.type; - } -} -function getNodes3(sourceFile, start) { - const token = getTokenAtPosition(sourceFile, start); - const containingFunction = getContainingFunction(token); - if (!containingFunction) { - return; - } - let insertBefore; - switch (containingFunction.kind) { - case 175 /* MethodDeclaration */: - insertBefore = containingFunction.name; - break; - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - insertBefore = findChildOfKind(containingFunction, 100 /* FunctionKeyword */, sourceFile); - break; - case 220 /* ArrowFunction */: - const kind = containingFunction.typeParameters ? 30 /* LessThanToken */ : 21 /* OpenParenToken */; - insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters); - break; - default: - return; - } - return insertBefore && { - insertBefore, - returnType: getReturnType(containingFunction) - }; -} -function doChange31(changes, sourceFile, { insertBefore, returnType }) { - if (returnType) { - const entityName = getEntityNameFromTypeNode(returnType); - if (!entityName || entityName.kind !== 80 /* Identifier */ || entityName.text !== "Promise") { - changes.replaceNode(sourceFile, returnType, factory.createTypeReferenceNode("Promise", factory.createNodeArray([returnType]))); - } - } - changes.insertModifierBefore(sourceFile, 134 /* AsyncKeyword */, insertBefore); -} - -// src/services/codefixes/fixPropertyOverrideAccessor.ts -var errorCodes50 = [ - 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 -]; -var fixId39 = "fixPropertyOverrideAccessor"; -registerCodeFix({ - errorCodes: errorCodes50, - getCodeActions(context) { - const edits = doChange32(context.sourceFile, context.span.start, context.span.length, context.errorCode, context); - if (edits) { - return [createCodeFixAction(fixId39, edits, Diagnostics.Generate_get_and_set_accessors, fixId39, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; - } - }, - fixIds: [fixId39], - getAllCodeActions: (context) => codeFixAll(context, errorCodes50, (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); - } - } - }) -}); -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) { - startPosition = start; - endPosition = start + length2; - } else if (code === Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) { - const checker = context.program.getTypeChecker(); - const node = getTokenAtPosition(file, start).parent; - if (isComputedPropertyName(node)) { - return; - } - Debug.assert(isAccessor(node), "error span of fixPropertyOverrideAccessor should only be on an accessor"); - const containingClass = node.parent; - Debug.assert(isClassLike(containingClass), "erroneous accessors should only be inside classes"); - const baseTypeNode = getEffectiveBaseTypeNode(containingClass); - if (!baseTypeNode) return; - const expression = skipParentheses(baseTypeNode.expression); - const base = isClassExpression(expression) ? expression.symbol : checker.getSymbolAtLocation(expression); - if (!base) return; - const baseType = checker.getDeclaredTypeOfSymbol(base); - const baseProp = checker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(node.name))); - if (!baseProp || !baseProp.valueDeclaration) return; - startPosition = baseProp.valueDeclaration.pos; - endPosition = baseProp.valueDeclaration.end; - file = getSourceFileOfNode(baseProp.valueDeclaration); - } else { - Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code); - } - return generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, Diagnostics.Generate_get_and_set_accessors.message); -} - -// src/services/codefixes/inferFromUsage.ts -var fixId40 = "inferFromUsage"; -var errorCodes51 = [ - // Variable declarations - Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, - // Variable uses - Diagnostics.Variable_0_implicitly_has_an_1_type.code, - // Parameter declarations - Diagnostics.Parameter_0_implicitly_has_an_1_type.code, - Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, - // Get Accessor declarations - Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, - Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, - // Set Accessor declarations - Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, - // Property declarations - Diagnostics.Member_0_implicitly_has_an_1_type.code, - //// Suggestions - // Variable declarations - Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code, - // Variable uses - Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, - // Parameter declarations - Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, - Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code, - // Get Accessor declarations - Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code, - Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code, - // Set Accessor declarations - Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code, - // Property declarations - Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, - // Function expressions and declarations - Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code -]; -registerCodeFix({ - errorCodes: errorCodes51, - 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 = doChange33( - changes2, - sourceFile, - token, - errorCode, - program, - cancellationToken, - /*markSeen*/ - returnTrue, - host, - preferences - ); - }); - const name = declaration && getNameOfDeclaration(declaration); - return !name || changes.length === 0 ? void 0 : [createCodeFixAction(fixId40, changes, [getDiagnostic(errorCode, token), getTextOfNode(name)], fixId40, Diagnostics.Infer_all_types_from_usage)]; - }, - fixIds: [fixId40], - getAllCodeActions(context) { - const { sourceFile, program, cancellationToken, host, preferences } = context; - const markSeen = nodeSeenTracker(); - return codeFixAll(context, errorCodes51, (changes, err) => { - doChange33(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); - }); - } -}); -function getDiagnostic(errorCode, token) { - switch (errorCode) { - case Diagnostics.Parameter_0_implicitly_has_an_1_type.code: - case Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: - return isSetAccessorDeclaration(getContainingFunction(token)) ? Diagnostics.Infer_type_of_0_from_usage : Diagnostics.Infer_parameter_types_from_usage; - // TODO: GH#18217 - case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code: - return Diagnostics.Infer_parameter_types_from_usage; - case Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code: - return Diagnostics.Infer_this_type_of_0_from_usage; - default: - return Diagnostics.Infer_type_of_0_from_usage; - } -} -function mapSuggestionDiagnostic(errorCode) { - switch (errorCode) { - case Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code: - return Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code; - case Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: - return Diagnostics.Variable_0_implicitly_has_an_1_type.code; - case Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: - return Diagnostics.Parameter_0_implicitly_has_an_1_type.code; - case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code: - return Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code; - case Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code: - return Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code; - case Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code: - return Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code; - case Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code: - return Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code; - case Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: - return Diagnostics.Member_0_implicitly_has_an_1_type.code; - } - return errorCode; -} -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; - } - const { parent: parent2 } = token; - const importAdder = createImportAdder(sourceFile, program, preferences, host); - errorCode = mapSuggestionDiagnostic(errorCode); - switch (errorCode) { - // Variable and Property declarations - case Diagnostics.Member_0_implicitly_has_an_1_type.code: - case Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: - if (isVariableDeclaration(parent2) && markSeen(parent2) || isPropertyDeclaration(parent2) || isPropertySignature(parent2)) { - annotateVariableDeclaration(changes, importAdder, sourceFile, parent2, program, host, cancellationToken); - importAdder.writeFixes(changes); - return parent2; - } - if (isPropertyAccessExpression(parent2)) { - const type = inferTypeForVariableFromUsage(parent2.name, program, cancellationToken); - const typeNode = getTypeNodeIfAccessible(type, parent2, program, host); - if (typeNode) { - const typeTag = factory.createJSDocTypeTag( - /*tagName*/ - void 0, - factory.createJSDocTypeExpression(typeNode), - /*comment*/ - void 0 - ); - changes.addJSDocTags(sourceFile, cast(parent2.parent.parent, isExpressionStatement), [typeTag]); - } - importAdder.writeFixes(changes); - return parent2; - } - return void 0; - case Diagnostics.Variable_0_implicitly_has_an_1_type.code: { - const symbol = program.getTypeChecker().getSymbolAtLocation(token); - if (symbol && symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && markSeen(symbol.valueDeclaration)) { - annotateVariableDeclaration(changes, importAdder, getSourceFileOfNode(symbol.valueDeclaration), symbol.valueDeclaration, program, host, cancellationToken); - importAdder.writeFixes(changes); - return symbol.valueDeclaration; - } - return void 0; - } - } - const containingFunction = getContainingFunction(token); - if (containingFunction === void 0) { - return void 0; - } - let declaration; - switch (errorCode) { - // Parameter declarations - case Diagnostics.Parameter_0_implicitly_has_an_1_type.code: - if (isSetAccessorDeclaration(containingFunction)) { - annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken); - declaration = containingFunction; - break; - } - // falls through - case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - if (markSeen(containingFunction)) { - const param = cast(parent2, isParameter); - annotateParameters(changes, importAdder, sourceFile, param, containingFunction, program, host, cancellationToken); - declaration = param; - } - break; - // Get Accessor declarations - case Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: - case Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: - if (isGetAccessorDeclaration(containingFunction) && isIdentifier(containingFunction.name)) { - annotate(changes, importAdder, sourceFile, containingFunction, inferTypeForVariableFromUsage(containingFunction.name, program, cancellationToken), program, host); - declaration = containingFunction; - } - break; - // Set Accessor declarations - case Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: - if (isSetAccessorDeclaration(containingFunction)) { - annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken); - declaration = containingFunction; - } - break; - // Function 'this' - case Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code: - if (ts_textChanges_exports.isThisTypeAnnotatable(containingFunction) && markSeen(containingFunction)) { - annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken); - declaration = containingFunction; - } - break; - default: - return Debug.fail(String(errorCode)); - } - importAdder.writeFixes(changes); - return declaration; -} -function annotateVariableDeclaration(changes, importAdder, sourceFile, declaration, program, host, cancellationToken) { - if (isIdentifier(declaration.name)) { - annotate(changes, importAdder, sourceFile, declaration, inferTypeForVariableFromUsage(declaration.name, program, cancellationToken), program, host); - } -} -function annotateParameters(changes, importAdder, sourceFile, parameterDeclaration, containingFunction, program, host, cancellationToken) { - if (!isIdentifier(parameterDeclaration.name)) { - return; - } - const parameterInferences = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken); - Debug.assert(containingFunction.parameters.length === parameterInferences.length, "Parameter count and inference count should match"); - if (isInJSFile(containingFunction)) { - annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host); - } else { - const needParens = isArrowFunction(containingFunction) && !findChildOfKind(containingFunction, 21 /* OpenParenToken */, sourceFile); - if (needParens) changes.insertNodeBefore(sourceFile, first(containingFunction.parameters), factory.createToken(21 /* OpenParenToken */)); - for (const { declaration, type } of parameterInferences) { - if (declaration && !declaration.type && !declaration.initializer) { - annotate(changes, importAdder, sourceFile, declaration, type, program, host); - } - } - if (needParens) changes.insertNodeAfter(sourceFile, last(containingFunction.parameters), factory.createToken(22 /* CloseParenToken */)); - } -} -function annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken) { - const references = getFunctionReferences(containingFunction, sourceFile, program, cancellationToken); - if (!references || !references.length) { - return; - } - const thisInference = inferTypeFromReferences(program, references, cancellationToken).thisParameter(); - const typeNode = getTypeNodeIfAccessible(thisInference, containingFunction, program, host); - if (!typeNode) { - return; - } - if (isInJSFile(containingFunction)) { - annotateJSDocThis(changes, sourceFile, containingFunction, typeNode); - } else { - changes.tryInsertThisTypeAnnotation(sourceFile, containingFunction, typeNode); - } -} -function annotateJSDocThis(changes, sourceFile, containingFunction, typeNode) { - changes.addJSDocTags(sourceFile, containingFunction, [ - factory.createJSDocThisTag( - /*tagName*/ - void 0, - factory.createJSDocTypeExpression(typeNode) - ) - ]); -} -function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclaration, program, host, cancellationToken) { - const param = firstOrUndefined(setAccessorDeclaration.parameters); - if (param && isIdentifier(setAccessorDeclaration.name) && isIdentifier(param.name)) { - let type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken); - if (type === program.getTypeChecker().getAnyType()) { - type = inferTypeForVariableFromUsage(param.name, program, cancellationToken); - } - if (isInJSFile(setAccessorDeclaration)) { - annotateJSDocParameters(changes, sourceFile, [{ declaration: param, type }], program, host); - } else { - annotate(changes, importAdder, sourceFile, param, type, program, host); - } - } -} -function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { - const typeNode = getTypeNodeIfAccessible(type, declaration, program, host); - if (typeNode) { - if (isInJSFile(sourceFile) && declaration.kind !== 172 /* PropertySignature */) { - const parent2 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration; - if (!parent2) { - return; - } - const typeExpression = factory.createJSDocTypeExpression(typeNode); - const typeTag = isGetAccessorDeclaration(declaration) ? factory.createJSDocReturnTag( - /*tagName*/ - void 0, - typeExpression, - /*comment*/ - void 0 - ) : factory.createJSDocTypeTag( - /*tagName*/ - void 0, - typeExpression, - /*comment*/ - void 0 - ); - changes.addJSDocTags(sourceFile, parent2, [typeTag]); - } else if (!tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, getEmitScriptTarget(program.getCompilerOptions()))) { - changes.tryInsertTypeAnnotation(sourceFile, declaration, typeNode); - } - } -} -function tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, scriptTarget) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); - if (importableReference && changes.tryInsertTypeAnnotation(sourceFile, declaration, importableReference.typeNode)) { - forEach(importableReference.symbols, (s) => importAdder.addImportFromExportedSymbol( - s, - /*isValidTypeOnlyUseSite*/ - true - )); - return true; - } - return false; -} -function annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host) { - const signature = parameterInferences.length && parameterInferences[0].declaration.parent; - if (!signature) { - return; - } - const inferences = mapDefined(parameterInferences, (inference) => { - const param = inference.declaration; - if (param.initializer || getJSDocType(param) || !isIdentifier(param.name)) { - return; - } - const typeNode = inference.type && getTypeNodeIfAccessible(inference.type, param, program, host); - if (typeNode) { - const name = factory.cloneNode(param.name); - setEmitFlags(name, 3072 /* NoComments */ | 4096 /* NoNestedComments */); - return { name: factory.cloneNode(param.name), param, isOptional: !!inference.isOptional, typeNode }; - } - }); - if (!inferences.length) { - return; - } - if (isArrowFunction(signature) || isFunctionExpression(signature)) { - const needParens = isArrowFunction(signature) && !findChildOfKind(signature, 21 /* OpenParenToken */, sourceFile); - if (needParens) { - changes.insertNodeBefore(sourceFile, first(signature.parameters), factory.createToken(21 /* OpenParenToken */)); - } - forEach(inferences, ({ typeNode, param }) => { - const typeTag = factory.createJSDocTypeTag( - /*tagName*/ - void 0, - factory.createJSDocTypeExpression(typeNode) - ); - const jsDoc = factory.createJSDocComment( - /*comment*/ - void 0, - [typeTag] - ); - changes.insertNodeAt(sourceFile, param.getStart(sourceFile), jsDoc, { suffix: " " }); - }); - if (needParens) { - changes.insertNodeAfter(sourceFile, last(signature.parameters), factory.createToken(22 /* CloseParenToken */)); - } - } else { - const paramTags = map(inferences, ({ name, typeNode, isOptional }) => factory.createJSDocParameterTag( - /*tagName*/ - void 0, - name, - /*isBracketed*/ - !!isOptional, - factory.createJSDocTypeExpression(typeNode), - /*isNameFirst*/ - false, - /*comment*/ - void 0 - )); - changes.addJSDocTags(sourceFile, signature, paramTags); - } -} -function getReferences(token, program, cancellationToken) { - return mapDefined(ts_FindAllReferences_exports.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), (entry) => entry.kind !== ts_FindAllReferences_exports.EntryKind.Span ? tryCast(entry.node, isIdentifier) : void 0); -} -function inferTypeForVariableFromUsage(token, program, cancellationToken) { - const references = getReferences(token, program, cancellationToken); - return inferTypeFromReferences(program, references, cancellationToken).single(); -} -function inferTypeForParametersFromUsage(func, sourceFile, program, cancellationToken) { - const references = getFunctionReferences(func, sourceFile, program, cancellationToken); - return references && inferTypeFromReferences(program, references, cancellationToken).parameters(func) || func.parameters.map((p) => ({ - declaration: p, - type: isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : program.getTypeChecker().getAnyType() - })); -} -function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { - let searchToken; - switch (containingFunction.kind) { - case 177 /* Constructor */: - searchToken = findChildOfKind(containingFunction, 137 /* ConstructorKeyword */, sourceFile); - break; - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - const parent2 = containingFunction.parent; - searchToken = (isVariableDeclaration(parent2) || isPropertyDeclaration(parent2)) && isIdentifier(parent2.name) ? parent2.name : containingFunction.name; - break; - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - searchToken = containingFunction.name; - break; - } - if (!searchToken) { - return void 0; - } - return getReferences(searchToken, program, cancellationToken); -} -function inferTypeFromReferences(program, references, cancellationToken) { - const checker = program.getTypeChecker(); - const builtinConstructors = { - string: () => checker.getStringType(), - number: () => checker.getNumberType(), - Array: (t) => checker.createArrayType(t), - Promise: (t) => checker.createPromiseType(t) - }; - const builtins = [ - checker.getStringType(), - checker.getNumberType(), - checker.createArrayType(checker.getAnyType()), - checker.createPromiseType(checker.getAnyType()) - ]; - return { - single: single2, - parameters, - thisParameter - }; - function createEmptyUsage() { - return { - isNumber: void 0, - isString: void 0, - isNumberOrString: void 0, - candidateTypes: void 0, - properties: void 0, - calls: void 0, - constructs: void 0, - numberIndex: void 0, - stringIndex: void 0, - candidateThisTypes: void 0, - inferredTypes: void 0 - }; - } - function combineUsages(usages) { - const combinedProperties = /* @__PURE__ */ new Map(); - for (const u of usages) { - if (u.properties) { - u.properties.forEach((p, name) => { - if (!combinedProperties.has(name)) { - combinedProperties.set(name, []); - } - combinedProperties.get(name).push(p); - }); - } - } - const properties = /* @__PURE__ */ new Map(); - combinedProperties.forEach((ps, name) => { - properties.set(name, combineUsages(ps)); - }); - return { - isNumber: usages.some((u) => u.isNumber), - isString: usages.some((u) => u.isString), - isNumberOrString: usages.some((u) => u.isNumberOrString), - candidateTypes: flatMap(usages, (u) => u.candidateTypes), - properties, - calls: flatMap(usages, (u) => u.calls), - constructs: flatMap(usages, (u) => u.constructs), - numberIndex: forEach(usages, (u) => u.numberIndex), - stringIndex: forEach(usages, (u) => u.stringIndex), - candidateThisTypes: flatMap(usages, (u) => u.candidateThisTypes), - inferredTypes: void 0 - // clear type cache - }; - } - function single2() { - return combineTypes(inferTypesFromReferencesSingle(references)); - } - function parameters(declaration) { - if (references.length === 0 || !declaration.parameters) { - return void 0; - } - const usage = createEmptyUsage(); - for (const reference of references) { - cancellationToken.throwIfCancellationRequested(); - calculateUsageOfNode(reference, usage); - } - const calls = [...usage.constructs || [], ...usage.calls || []]; - return declaration.parameters.map((parameter, parameterIndex) => { - const types = []; - const isRest = isRestParameter(parameter); - let isOptional = false; - for (const call of calls) { - if (call.argumentTypes.length <= parameterIndex) { - isOptional = isInJSFile(declaration); - types.push(checker.getUndefinedType()); - } else if (isRest) { - for (let i = parameterIndex; i < call.argumentTypes.length; i++) { - types.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[i])); - } - } else { - types.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[parameterIndex])); - } - } - if (isIdentifier(parameter.name)) { - const inferred = inferTypesFromReferencesSingle(getReferences(parameter.name, program, cancellationToken)); - types.push(...isRest ? mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred); - } - const type = combineTypes(types); - return { - type: isRest ? checker.createArrayType(type) : type, - isOptional: isOptional && !isRest, - declaration: parameter - }; - }); - } - function thisParameter() { - const usage = createEmptyUsage(); - for (const reference of references) { - cancellationToken.throwIfCancellationRequested(); - calculateUsageOfNode(reference, usage); - } - return combineTypes(usage.candidateThisTypes || emptyArray); - } - function inferTypesFromReferencesSingle(references2) { - const usage = createEmptyUsage(); - for (const reference of references2) { - cancellationToken.throwIfCancellationRequested(); - calculateUsageOfNode(reference, usage); - } - return inferTypes(usage); - } - function calculateUsageOfNode(node, usage) { - while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - switch (node.parent.kind) { - case 245 /* ExpressionStatement */: - inferTypeFromExpressionStatement(node, usage); - break; - case 226 /* PostfixUnaryExpression */: - usage.isNumber = true; - break; - case 225 /* PrefixUnaryExpression */: - inferTypeFromPrefixUnaryExpression(node.parent, usage); - break; - case 227 /* BinaryExpression */: - inferTypeFromBinaryExpression(node, node.parent, usage); - break; - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - inferTypeFromSwitchStatementLabel(node.parent, usage); - break; - case 214 /* CallExpression */: - case 215 /* NewExpression */: - if (node.parent.expression === node) { - inferTypeFromCallExpression(node.parent, usage); - } else { - inferTypeFromContextualType(node, usage); - } - break; - case 212 /* PropertyAccessExpression */: - inferTypeFromPropertyAccessExpression(node.parent, usage); - break; - case 213 /* ElementAccessExpression */: - inferTypeFromPropertyElementExpression(node.parent, node, usage); - break; - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - inferTypeFromPropertyAssignment(node.parent, usage); - break; - case 173 /* PropertyDeclaration */: - inferTypeFromPropertyDeclaration(node.parent, usage); - break; - case 261 /* VariableDeclaration */: { - const { name, initializer } = node.parent; - if (node === name) { - if (initializer) { - addCandidateType(usage, checker.getTypeAtLocation(initializer)); - } - break; - } - } - // falls through - default: - return inferTypeFromContextualType(node, usage); - } - } - function inferTypeFromContextualType(node, usage) { - if (isExpressionNode(node)) { - addCandidateType(usage, checker.getContextualType(node)); - } - } - function inferTypeFromExpressionStatement(node, usage) { - addCandidateType(usage, isCallExpression(node) ? checker.getVoidType() : checker.getAnyType()); - } - function inferTypeFromPrefixUnaryExpression(node, usage) { - switch (node.operator) { - case 46 /* PlusPlusToken */: - case 47 /* MinusMinusToken */: - case 41 /* MinusToken */: - case 55 /* TildeToken */: - usage.isNumber = true; - break; - case 40 /* PlusToken */: - usage.isNumberOrString = true; - break; - } - } - function inferTypeFromBinaryExpression(node, parent2, usage) { - switch (parent2.operatorToken.kind) { - // ExponentiationOperator - case 43 /* AsteriskAsteriskToken */: - // MultiplicativeOperator - // falls through - case 42 /* AsteriskToken */: - case 44 /* SlashToken */: - case 45 /* PercentToken */: - // ShiftOperator - // falls through - case 48 /* LessThanLessThanToken */: - case 49 /* GreaterThanGreaterThanToken */: - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - // BitwiseOperator - // falls through - case 51 /* AmpersandToken */: - case 52 /* BarToken */: - case 53 /* CaretToken */: - // CompoundAssignmentOperator - // falls through - case 66 /* MinusEqualsToken */: - case 68 /* AsteriskAsteriskEqualsToken */: - case 67 /* AsteriskEqualsToken */: - case 69 /* SlashEqualsToken */: - case 70 /* PercentEqualsToken */: - case 74 /* AmpersandEqualsToken */: - case 75 /* BarEqualsToken */: - case 79 /* CaretEqualsToken */: - case 71 /* LessThanLessThanEqualsToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 72 /* GreaterThanGreaterThanEqualsToken */: - // AdditiveOperator - // falls through - case 41 /* MinusToken */: - // RelationalOperator - // falls through - case 30 /* LessThanToken */: - case 33 /* LessThanEqualsToken */: - case 32 /* GreaterThanToken */: - case 34 /* GreaterThanEqualsToken */: - const operandType = checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left); - if (operandType.flags & 1056 /* EnumLike */) { - addCandidateType(usage, operandType); - } else { - usage.isNumber = true; - } - break; - case 65 /* PlusEqualsToken */: - case 40 /* PlusToken */: - const otherOperandType = checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left); - if (otherOperandType.flags & 1056 /* EnumLike */) { - addCandidateType(usage, otherOperandType); - } else if (otherOperandType.flags & 296 /* NumberLike */) { - usage.isNumber = true; - } else if (otherOperandType.flags & 402653316 /* StringLike */) { - usage.isString = true; - } else if (otherOperandType.flags & 1 /* Any */) { - } else { - usage.isNumberOrString = true; - } - break; - // AssignmentOperators - case 64 /* EqualsToken */: - case 35 /* EqualsEqualsToken */: - case 37 /* EqualsEqualsEqualsToken */: - case 38 /* ExclamationEqualsEqualsToken */: - case 36 /* ExclamationEqualsToken */: - case 77 /* AmpersandAmpersandEqualsToken */: - case 78 /* QuestionQuestionEqualsToken */: - case 76 /* BarBarEqualsToken */: - addCandidateType(usage, checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left)); - break; - case 103 /* InKeyword */: - if (node === parent2.left) { - usage.isString = true; - } - break; - // LogicalOperator Or NullishCoalescing - case 57 /* BarBarToken */: - case 61 /* QuestionQuestionToken */: - if (node === parent2.left && (node.parent.parent.kind === 261 /* VariableDeclaration */ || isAssignmentExpression( - node.parent.parent, - /*excludeCompoundAssignment*/ - true - ))) { - addCandidateType(usage, checker.getTypeAtLocation(parent2.right)); - } - break; - case 56 /* AmpersandAmpersandToken */: - case 28 /* CommaToken */: - case 104 /* InstanceOfKeyword */: - break; - } - } - function inferTypeFromSwitchStatementLabel(parent2, usage) { - addCandidateType(usage, checker.getTypeAtLocation(parent2.parent.parent.expression)); - } - function inferTypeFromCallExpression(parent2, usage) { - const call = { - argumentTypes: [], - return_: createEmptyUsage() - }; - if (parent2.arguments) { - for (const argument of parent2.arguments) { - call.argumentTypes.push(checker.getTypeAtLocation(argument)); - } - } - calculateUsageOfNode(parent2, call.return_); - if (parent2.kind === 214 /* CallExpression */) { - (usage.calls || (usage.calls = [])).push(call); - } else { - (usage.constructs || (usage.constructs = [])).push(call); - } - } - function inferTypeFromPropertyAccessExpression(parent2, usage) { - const name = escapeLeadingUnderscores(parent2.name.text); - if (!usage.properties) { - usage.properties = /* @__PURE__ */ new Map(); - } - const propertyUsage = usage.properties.get(name) || createEmptyUsage(); - calculateUsageOfNode(parent2, propertyUsage); - usage.properties.set(name, propertyUsage); - } - function inferTypeFromPropertyElementExpression(parent2, node, usage) { - if (node === parent2.argumentExpression) { - usage.isNumberOrString = true; - return; - } else { - const indexType = checker.getTypeAtLocation(parent2.argumentExpression); - const indexUsage = createEmptyUsage(); - calculateUsageOfNode(parent2, indexUsage); - if (indexType.flags & 296 /* NumberLike */) { - usage.numberIndex = indexUsage; - } else { - usage.stringIndex = indexUsage; - } - } - } - function inferTypeFromPropertyAssignment(assignment, usage) { - const nodeWithRealType = isVariableDeclaration(assignment.parent.parent) ? assignment.parent.parent : assignment.parent; - addCandidateThisType(usage, checker.getTypeAtLocation(nodeWithRealType)); - } - function inferTypeFromPropertyDeclaration(declaration, usage) { - addCandidateThisType(usage, checker.getTypeAtLocation(declaration.parent)); - } - function removeLowPriorityInferences(inferences, priorities) { - const toRemove = []; - for (const i of inferences) { - for (const { high, low } of priorities) { - if (high(i)) { - Debug.assert(!low(i), "Priority can't have both low and high"); - toRemove.push(low); - } - } - } - return inferences.filter((i) => toRemove.every((f) => !f(i))); - } - function combineFromUsage(usage) { - return combineTypes(inferTypes(usage)); - } - function combineTypes(inferences) { - if (!inferences.length) return checker.getAnyType(); - const stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]); - const priorities = [ - { - high: (t) => t === checker.getStringType() || t === checker.getNumberType(), - low: (t) => t === stringNumber - }, - { - high: (t) => !(t.flags & (1 /* Any */ | 16384 /* Void */)), - low: (t) => !!(t.flags & (1 /* Any */ | 16384 /* Void */)) - }, - { - high: (t) => !(t.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(getObjectFlags(t) & 16 /* Anonymous */), - low: (t) => !!(getObjectFlags(t) & 16 /* Anonymous */) - } - ]; - let good = removeLowPriorityInferences(inferences, priorities); - const anons = good.filter((i) => getObjectFlags(i) & 16 /* Anonymous */); - if (anons.length) { - good = good.filter((i) => !(getObjectFlags(i) & 16 /* Anonymous */)); - good.push(combineAnonymousTypes(anons)); - } - return checker.getWidenedType(checker.getUnionType(good.map(checker.getBaseTypeOfLiteralType), 2 /* Subtype */)); - } - function combineAnonymousTypes(anons) { - if (anons.length === 1) { - return anons[0]; - } - const calls = []; - const constructs = []; - const stringIndices = []; - const numberIndices = []; - let stringIndexReadonly = false; - let numberIndexReadonly = false; - const props = createMultiMap(); - for (const anon2 of anons) { - for (const p of checker.getPropertiesOfType(anon2)) { - props.add(p.escapedName, p.valueDeclaration ? checker.getTypeOfSymbolAtLocation(p, p.valueDeclaration) : checker.getAnyType()); - } - calls.push(...checker.getSignaturesOfType(anon2, 0 /* Call */)); - constructs.push(...checker.getSignaturesOfType(anon2, 1 /* Construct */)); - const stringIndexInfo = checker.getIndexInfoOfType(anon2, 0 /* String */); - if (stringIndexInfo) { - stringIndices.push(stringIndexInfo.type); - stringIndexReadonly = stringIndexReadonly || stringIndexInfo.isReadonly; - } - const numberIndexInfo = checker.getIndexInfoOfType(anon2, 1 /* Number */); - if (numberIndexInfo) { - numberIndices.push(numberIndexInfo.type); - numberIndexReadonly = numberIndexReadonly || numberIndexInfo.isReadonly; - } - } - const members = mapEntries(props, (name, types) => { - const isOptional = types.length < anons.length ? 16777216 /* Optional */ : 0; - const s = checker.createSymbol(4 /* Property */ | isOptional, name); - s.links.type = checker.getUnionType(types); - return [name, s]; - }); - const indexInfos = []; - if (stringIndices.length) indexInfos.push(checker.createIndexInfo(checker.getStringType(), checker.getUnionType(stringIndices), stringIndexReadonly)); - if (numberIndices.length) indexInfos.push(checker.createIndexInfo(checker.getNumberType(), checker.getUnionType(numberIndices), numberIndexReadonly)); - return checker.createAnonymousType( - anons[0].symbol, - members, - calls, - constructs, - indexInfos - ); - } - function inferTypes(usage) { - var _a, _b, _c; - const types = []; - if (usage.isNumber) { - types.push(checker.getNumberType()); - } - if (usage.isString) { - types.push(checker.getStringType()); - } - if (usage.isNumberOrString) { - types.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()])); - } - if (usage.numberIndex) { - types.push(checker.createArrayType(combineFromUsage(usage.numberIndex))); - } - if (((_a = usage.properties) == null ? void 0 : _a.size) || ((_b = usage.constructs) == null ? void 0 : _b.length) || usage.stringIndex) { - types.push(inferStructuralType(usage)); - } - const candidateTypes = (usage.candidateTypes || []).map((t) => checker.getBaseTypeOfLiteralType(t)); - const callsType = ((_c = usage.calls) == null ? void 0 : _c.length) ? inferStructuralType(usage) : void 0; - if (callsType && candidateTypes) { - types.push(checker.getUnionType([callsType, ...candidateTypes], 2 /* Subtype */)); - } else { - if (callsType) { - types.push(callsType); - } - if (length(candidateTypes)) { - types.push(...candidateTypes); - } - } - types.push(...inferNamedTypesFromProperties(usage)); - return types; - } - function inferStructuralType(usage) { - const members = /* @__PURE__ */ new Map(); - if (usage.properties) { - usage.properties.forEach((u, name) => { - const symbol = checker.createSymbol(4 /* Property */, name); - symbol.links.type = combineFromUsage(u); - members.set(name, symbol); - }); - } - const callSignatures = usage.calls ? [getSignatureFromCalls(usage.calls)] : []; - const constructSignatures = usage.constructs ? [getSignatureFromCalls(usage.constructs)] : []; - const indexInfos = usage.stringIndex ? [checker.createIndexInfo( - checker.getStringType(), - combineFromUsage(usage.stringIndex), - /*isReadonly*/ - false - )] : []; - return checker.createAnonymousType( - /*symbol*/ - void 0, - members, - callSignatures, - constructSignatures, - indexInfos - ); - } - function inferNamedTypesFromProperties(usage) { - if (!usage.properties || !usage.properties.size) return []; - const types = builtins.filter((t) => allPropertiesAreAssignableToUsage(t, usage)); - if (0 < types.length && types.length < 3) { - return types.map((t) => inferInstantiationFromUsage(t, usage)); - } - return []; - } - function allPropertiesAreAssignableToUsage(type, usage) { - if (!usage.properties) return false; - return !forEachEntry(usage.properties, (propUsage, name) => { - const source = checker.getTypeOfPropertyOfType(type, name); - if (!source) { - return true; - } - if (propUsage.calls) { - const sigs = checker.getSignaturesOfType(source, 0 /* Call */); - return !sigs.length || !checker.isTypeAssignableTo(source, getFunctionFromCalls(propUsage.calls)); - } else { - return !checker.isTypeAssignableTo(source, combineFromUsage(propUsage)); - } - }); - } - function inferInstantiationFromUsage(type, usage) { - if (!(getObjectFlags(type) & 4 /* Reference */) || !usage.properties) { - return type; - } - const generic = type.target; - const singleTypeParameter = singleOrUndefined(generic.typeParameters); - if (!singleTypeParameter) return type; - const types = []; - usage.properties.forEach((propUsage, name) => { - const genericPropertyType = checker.getTypeOfPropertyOfType(generic, name); - Debug.assert(!!genericPropertyType, "generic should have all the properties of its reference."); - types.push(...inferTypeParameters(genericPropertyType, combineFromUsage(propUsage), singleTypeParameter)); - }); - return builtinConstructors[type.symbol.escapedName](combineTypes(types)); - } - function inferTypeParameters(genericType, usageType, typeParameter) { - if (genericType === typeParameter) { - return [usageType]; - } else if (genericType.flags & 3145728 /* UnionOrIntersection */) { - return flatMap(genericType.types, (t) => inferTypeParameters(t, usageType, typeParameter)); - } else if (getObjectFlags(genericType) & 4 /* Reference */ && getObjectFlags(usageType) & 4 /* Reference */) { - const genericArgs = checker.getTypeArguments(genericType); - const usageArgs = checker.getTypeArguments(usageType); - const types = []; - if (genericArgs && usageArgs) { - for (let i = 0; i < genericArgs.length; i++) { - if (usageArgs[i]) { - types.push(...inferTypeParameters(genericArgs[i], usageArgs[i], typeParameter)); - } - } - } - return types; - } - const genericSigs = checker.getSignaturesOfType(genericType, 0 /* Call */); - const usageSigs = checker.getSignaturesOfType(usageType, 0 /* Call */); - if (genericSigs.length === 1 && usageSigs.length === 1) { - return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); - } - return []; - } - function inferFromSignatures(genericSig, usageSig, typeParameter) { - var _a; - const types = []; - for (let i = 0; i < genericSig.parameters.length; i++) { - const genericParam = genericSig.parameters[i]; - const usageParam = usageSig.parameters[i]; - const isRest = genericSig.declaration && isRestParameter(genericSig.declaration.parameters[i]); - if (!usageParam) { - break; - } - let genericParamType = genericParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(genericParam, genericParam.valueDeclaration) : checker.getAnyType(); - const elementType = isRest && checker.getElementTypeOfArrayType(genericParamType); - if (elementType) { - genericParamType = elementType; - } - const targetType = ((_a = tryCast(usageParam, isTransientSymbol)) == null ? void 0 : _a.links.type) || (usageParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration) : checker.getAnyType()); - types.push(...inferTypeParameters(genericParamType, targetType, typeParameter)); - } - const genericReturn = checker.getReturnTypeOfSignature(genericSig); - const usageReturn = checker.getReturnTypeOfSignature(usageSig); - types.push(...inferTypeParameters(genericReturn, usageReturn, typeParameter)); - return types; - } - function getFunctionFromCalls(calls) { - return checker.createAnonymousType( - /*symbol*/ - void 0, - createSymbolTable(), - [getSignatureFromCalls(calls)], - emptyArray, - emptyArray - ); - } - function getSignatureFromCalls(calls) { - const parameters2 = []; - const length2 = Math.max(...calls.map((c) => c.argumentTypes.length)); - for (let i = 0; i < length2; i++) { - const symbol = checker.createSymbol(1 /* FunctionScopedVariable */, escapeLeadingUnderscores(`arg${i}`)); - symbol.links.type = combineTypes(calls.map((call) => call.argumentTypes[i] || checker.getUndefinedType())); - if (calls.some((call) => call.argumentTypes[i] === void 0)) { - symbol.flags |= 16777216 /* Optional */; - } - parameters2.push(symbol); - } - const returnType = combineFromUsage(combineUsages(calls.map((call) => call.return_))); - return checker.createSignature( - /*declaration*/ - void 0, - /*typeParameters*/ - void 0, - /*thisParameter*/ - void 0, - parameters2, - returnType, - /*typePredicate*/ - void 0, - length2, - 0 /* None */ - ); - } - function addCandidateType(usage, type) { - if (type && !(type.flags & 1 /* Any */) && !(type.flags & 131072 /* Never */)) { - (usage.candidateTypes || (usage.candidateTypes = [])).push(type); - } - } - function addCandidateThisType(usage, type) { - if (type && !(type.flags & 1 /* Any */) && !(type.flags & 131072 /* Never */)) { - (usage.candidateThisTypes || (usage.candidateThisTypes = [])).push(type); - } - } -} - -// src/services/codefixes/fixReturnTypeInAsyncFunction.ts -var fixId41 = "fixReturnTypeInAsyncFunction"; -var errorCodes52 = [ - 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: errorCodes52, - fixIds: [fixId41], - getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context) { - const { sourceFile, program, span } = context; - const checker = program.getTypeChecker(); - 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) => doChange34(t, sourceFile, returnTypeNode, promisedTypeNode)); - return [createCodeFixAction( - fixId41, - changes, - [Diagnostics.Replace_0_with_Promise_1, checker.typeToString(returnType), checker.typeToString(promisedType)], - fixId41, - Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions - )]; - }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes52, (changes, diag2) => { - const info = getInfo16(diag2.file, context.program.getTypeChecker(), diag2.start); - if (info) { - doChange34(changes, diag2.file, info.returnTypeNode, info.promisedTypeNode); - } - }) -}); -function getInfo16(sourceFile, checker, pos) { - if (isInJSFile(sourceFile)) { - return void 0; - } - const token = getTokenAtPosition(sourceFile, pos); - const func = findAncestor(token, isFunctionLikeDeclaration); - const returnTypeNode = func == null ? void 0 : func.type; - if (!returnTypeNode) { - return void 0; - } - const returnType = checker.getTypeFromTypeNode(returnTypeNode); - const promisedType = checker.getAwaitedType(returnType) || checker.getVoidType(); - const promisedTypeNode = checker.typeToTypeNode( - promisedType, - /*enclosingDeclaration*/ - returnTypeNode, - /*flags*/ - void 0 - ); - if (promisedTypeNode) { - return { returnTypeNode, returnType, promisedTypeNode, promisedType }; - } -} -function doChange34(changes, sourceFile, returnTypeNode, promisedTypeNode) { - changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); -} - -// src/services/codefixes/disableJsDiagnostics.ts -var fixName4 = "disableJsDiagnostics"; -var fixId42 = "disableJsDiagnostics"; -var errorCodes53 = mapDefined(Object.keys(Diagnostics), (key) => { - const diag2 = Diagnostics[key]; - return diag2.category === 1 /* Error */ ? diag2.code : void 0; -}); -registerCodeFix({ - errorCodes: errorCodes53, - getCodeActions: function getCodeActionsToDisableJsDiagnostics(context) { - const { sourceFile, program, span, host, formatContext } = context; - if (!isInJSFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { - return void 0; - } - const newLineCharacter = sourceFile.checkJsDirective ? "" : getNewLineOrDefaultFromHost(host, formatContext.options); - const fixes = [ - // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. - createCodeFixActionWithoutFixAll( - fixName4, - [createFileTextChanges(sourceFile.fileName, [ - createTextChange( - sourceFile.checkJsDirective ? createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : createTextSpan(0, 0), - `// @ts-nocheck${newLineCharacter}` - ) - ])], - Diagnostics.Disable_checking_for_this_file - ) - ]; - if (ts_textChanges_exports.isValidLocationToAddComment(sourceFile, span.start)) { - fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange9(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId42, Diagnostics.Add_ts_ignore_to_all_error_messages)); - } - return fixes; - }, - fixIds: [fixId42], - getAllCodeActions: (context) => { - const seenLines = /* @__PURE__ */ new Set(); - return codeFixAll(context, errorCodes53, (changes, diag2) => { - if (ts_textChanges_exports.isValidLocationToAddComment(diag2.file, diag2.start)) { - makeChange9(changes, diag2.file, diag2.start, seenLines); - } - }); - } -}); -function makeChange9(changes, sourceFile, position, seenLines) { - const { line: lineNumber } = getLineAndCharacterOfPosition(sourceFile, position); - if (!seenLines || tryAddToSet(seenLines, lineNumber)) { - changes.insertCommentBeforeLine(sourceFile, lineNumber, position, " @ts-ignore"); - } -} - -// src/services/codefixes/helpers.ts -function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, sourceFile, context, preferences, importAdder, addClassElement) { - const classMembers = classDeclaration.symbol.members; - for (const symbol of possiblyMissingSymbols) { - if (!classMembers.has(symbol.escapedName)) { - addNewNodeForMemberSymbol( - symbol, - classDeclaration, - sourceFile, - context, - preferences, - importAdder, - addClassElement, - /*body*/ - void 0 - ); - } - } -} -function getNoopSymbolTrackerWithResolver(context) { - return { - trackSymbol: () => false, - moduleResolverHost: getModuleSpecifierResolverHost(context.program, context.host) - }; -} -var PreserveOptionalFlags = /* @__PURE__ */ ((PreserveOptionalFlags2) => { - PreserveOptionalFlags2[PreserveOptionalFlags2["Method"] = 1] = "Method"; - PreserveOptionalFlags2[PreserveOptionalFlags2["Property"] = 2] = "Property"; - PreserveOptionalFlags2[PreserveOptionalFlags2["All"] = 3] = "All"; - return PreserveOptionalFlags2; -})(PreserveOptionalFlags || {}); -function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, context, preferences, importAdder, addClassElement, body, preserveOptional = 3 /* All */, isAmbient = false) { - const declarations = symbol.getDeclarations(); - const declaration = firstOrUndefined(declarations); - const checker = context.program.getTypeChecker(); - const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); - const kind = (declaration == null ? void 0 : declaration.kind) ?? 172 /* PropertySignature */; - const declarationName = createDeclarationName(symbol, declaration); - const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 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 |= 512 /* Accessor */; - } - const modifiers = createModifiers(); - const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); - const optional = !!(symbol.flags & 16777216 /* Optional */); - const ambient = !!(enclosingDeclaration.flags & 33554432 /* Ambient */) || isAmbient; - const quotePreference = getQuotePreference(sourceFile, preferences); - const flags = 1 /* NoTruncation */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); - switch (kind) { - case 172 /* PropertySignature */: - case 173 /* PropertyDeclaration */: - let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, 8 /* AllowUnresolvedNames */, getNoopSymbolTrackerWithResolver(context)); - if (importAdder) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); - if (importableReference) { - typeNode = importableReference.typeNode; - importSymbols(importAdder, importableReference.symbols); - } - } - addClassElement(factory.createPropertyDeclaration( - modifiers, - declaration ? createName(declarationName) : symbol.getName(), - optional && preserveOptional & 2 /* Property */ ? factory.createToken(58 /* QuestionToken */) : void 0, - typeNode, - /*initializer*/ - void 0 - )); - break; - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: { - Debug.assertIsDefined(declarations); - let typeNode2 = checker.typeToTypeNode( - type, - enclosingDeclaration, - flags, - /*internalFlags*/ - void 0, - getNoopSymbolTrackerWithResolver(context) - ); - const allAccessors = getAllAccessorDeclarations(declarations, declaration); - const orderedAccessors = allAccessors.secondAccessor ? [allAccessors.firstAccessor, allAccessors.secondAccessor] : [allAccessors.firstAccessor]; - if (importAdder) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode2, scriptTarget); - if (importableReference) { - typeNode2 = importableReference.typeNode; - importSymbols(importAdder, importableReference.symbols); - } - } - for (const accessor of orderedAccessors) { - if (isGetAccessorDeclaration(accessor)) { - addClassElement(factory.createGetAccessorDeclaration( - modifiers, - createName(declarationName), - emptyArray, - createTypeNode(typeNode2), - createBody(body, quotePreference, ambient) - )); - } else { - Debug.assertNode(accessor, isSetAccessorDeclaration, "The counterpart to a getter should be a setter"); - const parameter = getSetAccessorValueParameter(accessor); - const parameterName = parameter && isIdentifier(parameter.name) ? idText(parameter.name) : void 0; - addClassElement(factory.createSetAccessorDeclaration( - modifiers, - createName(declarationName), - createDummyParameters( - 1, - [parameterName], - [createTypeNode(typeNode2)], - 1, - /*inJs*/ - false - ), - createBody(body, quotePreference, ambient) - )); - } - } - break; - } - case 174 /* MethodSignature */: - case 175 /* MethodDeclaration */: - Debug.assertIsDefined(declarations); - const signatures = type.isUnion() ? flatMap(type.types, (t) => t.getCallSignatures()) : type.getCallSignatures(); - if (!some(signatures)) { - break; - } - if (declarations.length === 1) { - Debug.assert(signatures.length === 1, "One declaration implies one signature"); - const signature = signatures[0]; - outputMethod(quotePreference, signature, modifiers, createName(declarationName), createBody(body, quotePreference, ambient)); - break; - } - for (const signature of signatures) { - if (signature.declaration && signature.declaration.flags & 33554432 /* Ambient */) { - continue; - } - outputMethod(quotePreference, signature, modifiers, createName(declarationName)); - } - if (!ambient) { - if (declarations.length > signatures.length) { - const signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); - outputMethod(quotePreference, signature, modifiers, createName(declarationName), createBody(body, quotePreference)); - } else { - Debug.assert(declarations.length === signatures.length, "Declarations and signatures should match count"); - addClassElement(createMethodImplementingSignatures(checker, context, enclosingDeclaration, signatures, createName(declarationName), optional && !!(preserveOptional & 1 /* Method */), modifiers, quotePreference, body)); - } - } - break; - } - function outputMethod(quotePreference2, signature, modifiers2, name, body2) { - const method = createSignatureDeclarationFromSignature(175 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder); - if (method) addClassElement(method); - } - function createModifiers() { - let modifiers2; - if (modifierFlags) { - modifiers2 = combine(modifiers2, factory.createModifiersFromModifierFlags(modifierFlags)); - } - if (shouldAddOverrideKeyword()) { - modifiers2 = append(modifiers2, factory.createToken(164 /* OverrideKeyword */)); - } - return modifiers2 && factory.createNodeArray(modifiers2); - } - function shouldAddOverrideKeyword() { - return !!(context.program.getCompilerOptions().noImplicitOverride && declaration && hasAbstractModifier(declaration)); - } - function createName(node) { - if (isIdentifier(node) && node.escapedText === "constructor") { - return factory.createComputedPropertyName(factory.createStringLiteral(idText(node), quotePreference === 0 /* Single */)); - } - return getSynthesizedDeepClone( - node, - /*includeTrivia*/ - false - ); - } - function createBody(block, quotePreference2, ambient2) { - return ambient2 ? void 0 : getSynthesizedDeepClone( - block, - /*includeTrivia*/ - false - ) || createStubbedMethodBody(quotePreference2); - } - function createTypeNode(typeNode) { - return getSynthesizedDeepClone( - typeNode, - /*includeTrivia*/ - 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; - const checker = program.getTypeChecker(); - const scriptTarget = getEmitScriptTarget(program.getCompilerOptions()); - const isJs = isInJSFile(enclosingDeclaration); - const flags = 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */ | 524288 /* AllowEmptyTuple */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); - const signatureDeclaration = checker.signatureToSignatureDeclaration(signature, kind, enclosingDeclaration, flags, 8 /* AllowUnresolvedNames */, getNoopSymbolTrackerWithResolver(context)); - if (!signatureDeclaration) { - return void 0; - } - let typeParameters = isJs ? void 0 : signatureDeclaration.typeParameters; - let parameters = signatureDeclaration.parameters; - let type = isJs ? void 0 : getSynthesizedDeepClone(signatureDeclaration.type); - if (importAdder) { - if (typeParameters) { - const newTypeParameters = sameMap(typeParameters, (typeParameterDecl) => { - let constraint = typeParameterDecl.constraint; - let defaultType = typeParameterDecl.default; - if (constraint) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(constraint, scriptTarget); - if (importableReference) { - constraint = importableReference.typeNode; - importSymbols(importAdder, importableReference.symbols); - } - } - if (defaultType) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(defaultType, scriptTarget); - if (importableReference) { - defaultType = importableReference.typeNode; - importSymbols(importAdder, importableReference.symbols); - } - } - return factory.updateTypeParameterDeclaration( - typeParameterDecl, - typeParameterDecl.modifiers, - typeParameterDecl.name, - constraint, - defaultType - ); - }); - if (typeParameters !== newTypeParameters) { - typeParameters = setTextRange(factory.createNodeArray(newTypeParameters, typeParameters.hasTrailingComma), typeParameters); - } - } - const newParameters = sameMap(parameters, (parameterDecl) => { - let type2 = isJs ? void 0 : parameterDecl.type; - if (type2) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(type2, scriptTarget); - if (importableReference) { - type2 = importableReference.typeNode; - importSymbols(importAdder, importableReference.symbols); - } - } - return factory.updateParameterDeclaration( - parameterDecl, - parameterDecl.modifiers, - parameterDecl.dotDotDotToken, - parameterDecl.name, - isJs ? void 0 : parameterDecl.questionToken, - type2, - parameterDecl.initializer - ); - }); - if (parameters !== newParameters) { - parameters = setTextRange(factory.createNodeArray(newParameters, parameters.hasTrailingComma), parameters); - } - if (type) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(type, scriptTarget); - if (importableReference) { - type = importableReference.typeNode; - importSymbols(importAdder, importableReference.symbols); - } - } - } - const questionToken = optional ? factory.createToken(58 /* QuestionToken */) : void 0; - const asteriskToken = signatureDeclaration.asteriskToken; - if (isFunctionExpression(signatureDeclaration)) { - return factory.updateFunctionExpression(signatureDeclaration, modifiers, signatureDeclaration.asteriskToken, tryCast(name, isIdentifier), typeParameters, parameters, type, body ?? signatureDeclaration.body); - } - if (isArrowFunction(signatureDeclaration)) { - return factory.updateArrowFunction(signatureDeclaration, modifiers, typeParameters, parameters, type, signatureDeclaration.equalsGreaterThanToken, body ?? signatureDeclaration.body); - } - if (isMethodDeclaration(signatureDeclaration)) { - return factory.updateMethodDeclaration(signatureDeclaration, modifiers, asteriskToken, name ?? factory.createIdentifier(""), questionToken, typeParameters, parameters, type, body); - } - if (isFunctionDeclaration(signatureDeclaration)) { - return factory.updateFunctionDeclaration(signatureDeclaration, modifiers, signatureDeclaration.asteriskToken, tryCast(name, isIdentifier), typeParameters, parameters, type, body ?? signatureDeclaration.body); - } - return void 0; -} -function createSignatureDeclarationFromCallExpression(kind, context, importAdder, call, name, modifierFlags, contextNode) { - const quotePreference = getQuotePreference(context.sourceFile, context.preferences); - const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); - const tracker = getNoopSymbolTrackerWithResolver(context); - const checker = context.program.getTypeChecker(); - const isJs = isInJSFile(contextNode); - const { typeArguments, arguments: args, parent: parent2 } = call; - const contextualType = isJs ? void 0 : checker.getContextualType(call); - const names = map(args, (arg) => isIdentifier(arg) ? arg.text : isPropertyAccessExpression(arg) && isIdentifier(arg.name) ? arg.name.text : void 0); - const instanceTypes = isJs ? [] : map(args, (arg) => checker.getTypeAtLocation(arg)); - const { argumentTypeNodes, argumentTypeParameters } = getArgumentTypesAndTypeParameters( - checker, - importAdder, - instanceTypes, - contextNode, - scriptTarget, - 1 /* NoTruncation */, - 8 /* AllowUnresolvedNames */, - tracker - ); - const modifiers = modifierFlags ? factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; - const asteriskToken = isYieldExpression(parent2) ? factory.createToken(42 /* AsteriskToken */) : void 0; - const typeParameters = isJs ? void 0 : createTypeParametersForArguments(checker, argumentTypeParameters, typeArguments); - const parameters = createDummyParameters( - args.length, - names, - argumentTypeNodes, - /*minArgumentCount*/ - void 0, - isJs - ); - const type = isJs || contextualType === void 0 ? void 0 : checker.typeToTypeNode( - contextualType, - contextNode, - /*flags*/ - void 0, - /*internalFlags*/ - void 0, - tracker - ); - switch (kind) { - case 175 /* MethodDeclaration */: - return factory.createMethodDeclaration( - modifiers, - asteriskToken, - name, - /*questionToken*/ - void 0, - typeParameters, - parameters, - type, - createStubbedMethodBody(quotePreference) - ); - case 174 /* MethodSignature */: - return factory.createMethodSignature( - modifiers, - name, - /*questionToken*/ - void 0, - typeParameters, - parameters, - type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type - ); - case 263 /* FunctionDeclaration */: - Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name"); - return factory.createFunctionDeclaration( - modifiers, - asteriskToken, - name, - typeParameters, - parameters, - type, - createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference) - ); - default: - Debug.fail("Unexpected kind"); - } -} -function createTypeParametersForArguments(checker, argumentTypeParameters, typeArguments) { - const usedNames = new Set(argumentTypeParameters.map((pair) => pair[0])); - const constraintsByName = new Map(argumentTypeParameters); - if (typeArguments) { - const typeArgumentsWithNewTypes = typeArguments.filter((typeArgument) => !argumentTypeParameters.some((pair) => { - var _a; - return checker.getTypeAtLocation(typeArgument) === ((_a = pair[1]) == null ? void 0 : _a.argumentType); - })); - const targetSize = usedNames.size + typeArgumentsWithNewTypes.length; - for (let i = 0; usedNames.size < targetSize; i += 1) { - usedNames.add(createTypeParameterName(i)); - } - } - return arrayFrom( - usedNames.values(), - (usedName) => { - var _a; - return factory.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - usedName, - (_a = constraintsByName.get(usedName)) == null ? void 0 : _a.constraint - ); - } - ); -} -function createTypeParameterName(index) { - return 84 /* T */ + index <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + index) : `T${index}`; -} -function typeToAutoImportableTypeNode(checker, importAdder, type, contextNode, scriptTarget, flags, internalFlags, tracker) { - const typeNode = checker.typeToTypeNode(type, contextNode, flags, internalFlags, tracker); - if (!typeNode) { - return void 0; - } - return typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget); -} -function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); - if (importableReference) { - importSymbols(importAdder, importableReference.symbols); - typeNode = importableReference.typeNode; - } - return getSynthesizedDeepClone(typeNode); -} -function endOfRequiredTypeParameters(checker, type) { - var _a; - Debug.assert(type.typeArguments); - const fullTypeArguments = type.typeArguments; - const target = type.target; - for (let cutoff = 0; cutoff < fullTypeArguments.length; cutoff++) { - if (((_a = target.localTypeParameters) == null ? void 0 : _a[cutoff].constraint) === void 0) { - continue; - } - const typeArguments = fullTypeArguments.slice(0, cutoff); - const filledIn = checker.fillMissingTypeArguments( - typeArguments, - target.typeParameters, - cutoff, - /*isJavaScriptImplicitAny*/ - false - ); - if (filledIn.every((fill, i) => fill === fullTypeArguments[i])) { - return cutoff; - } - } - return fullTypeArguments.length; -} -function typeToMinimizedReferenceType(checker, type, contextNode, flags, internalFlags, tracker) { - let typeNode = checker.typeToTypeNode(type, contextNode, flags, internalFlags, tracker); - if (!typeNode) { - return void 0; - } - if (isTypeReferenceNode(typeNode)) { - const genericType = type; - if (genericType.typeArguments && typeNode.typeArguments) { - const cutoff = endOfRequiredTypeParameters(checker, genericType); - if (cutoff < typeNode.typeArguments.length) { - const newTypeArguments = factory.createNodeArray(typeNode.typeArguments.slice(0, cutoff)); - typeNode = factory.updateTypeReferenceNode(typeNode, typeNode.typeName, newTypeArguments); - } - } - } - return typeNode; -} -function typePredicateToAutoImportableTypeNode(checker, importAdder, typePredicate, contextNode, scriptTarget, flags, internalFlags, tracker) { - let typePredicateNode = checker.typePredicateToTypePredicateNode(typePredicate, contextNode, flags, internalFlags, tracker); - if ((typePredicateNode == null ? void 0 : typePredicateNode.type) && isImportTypeNode(typePredicateNode.type)) { - const importableReference = tryGetAutoImportableReferenceFromTypeNode(typePredicateNode.type, scriptTarget); - if (importableReference) { - importSymbols(importAdder, importableReference.symbols); - typePredicateNode = factory.updateTypePredicateNode(typePredicateNode, typePredicateNode.assertsModifier, typePredicateNode.parameterName, importableReference.typeNode); - } - } - return getSynthesizedDeepClone(typePredicateNode); -} -function typeContainsTypeParameter(type) { - if (type.isUnionOrIntersection()) { - return type.types.some(typeContainsTypeParameter); - } - return type.flags & 262144 /* TypeParameter */; -} -function getArgumentTypesAndTypeParameters(checker, importAdder, instanceTypes, contextNode, scriptTarget, flags, internalFlags, tracker) { - const argumentTypeNodes = []; - const argumentTypeParameters = /* @__PURE__ */ new Map(); - for (let i = 0; i < instanceTypes.length; i += 1) { - const instanceType = instanceTypes[i]; - if (instanceType.isUnionOrIntersection() && instanceType.types.some(typeContainsTypeParameter)) { - const synthesizedTypeParameterName = createTypeParameterName(i); - argumentTypeNodes.push(factory.createTypeReferenceNode(synthesizedTypeParameterName)); - argumentTypeParameters.set(synthesizedTypeParameterName, void 0); - continue; - } - const widenedInstanceType = checker.getBaseTypeOfLiteralType(instanceType); - const argumentTypeNode = typeToAutoImportableTypeNode(checker, importAdder, widenedInstanceType, contextNode, scriptTarget, flags, internalFlags, tracker); - if (!argumentTypeNode) { - continue; - } - argumentTypeNodes.push(argumentTypeNode); - const argumentTypeParameter = getFirstTypeParameterName(instanceType); - const instanceTypeConstraint = instanceType.isTypeParameter() && instanceType.constraint && !isAnonymousObjectConstraintType(instanceType.constraint) ? typeToAutoImportableTypeNode(checker, importAdder, instanceType.constraint, contextNode, scriptTarget, flags, internalFlags, tracker) : void 0; - if (argumentTypeParameter) { - argumentTypeParameters.set(argumentTypeParameter, { argumentType: instanceType, constraint: instanceTypeConstraint }); - } - } - return { argumentTypeNodes, argumentTypeParameters: arrayFrom(argumentTypeParameters.entries()) }; -} -function isAnonymousObjectConstraintType(type) { - return type.flags & 524288 /* Object */ && type.objectFlags === 16 /* Anonymous */; -} -function getFirstTypeParameterName(type) { - var _a; - if (type.flags & (1048576 /* Union */ | 2097152 /* Intersection */)) { - for (const subType of type.types) { - const subTypeName = getFirstTypeParameterName(subType); - if (subTypeName) { - return subTypeName; - } - } - } - return type.flags & 262144 /* TypeParameter */ ? (_a = type.getSymbol()) == null ? void 0 : _a.getName() : void 0; -} -function createDummyParameters(argCount, names, types, minArgumentCount, inJs) { - const parameters = []; - const parameterNameCounts = /* @__PURE__ */ new Map(); - for (let i = 0; i < argCount; i++) { - const parameterName = (names == null ? void 0 : names[i]) || `arg${i}`; - const parameterNameCount = parameterNameCounts.get(parameterName); - parameterNameCounts.set(parameterName, (parameterNameCount || 0) + 1); - const newParameter = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - /*name*/ - parameterName + (parameterNameCount || ""), - /*questionToken*/ - minArgumentCount !== void 0 && i >= minArgumentCount ? factory.createToken(58 /* QuestionToken */) : void 0, - /*type*/ - inJs ? void 0 : (types == null ? void 0 : types[i]) || factory.createKeywordTypeNode(159 /* UnknownKeyword */), - /*initializer*/ - void 0 - ); - parameters.push(newParameter); - } - return parameters; -} -function createMethodImplementingSignatures(checker, context, enclosingDeclaration, signatures, name, optional, modifiers, quotePreference, body) { - let maxArgsSignature = signatures[0]; - let minArgumentCount = signatures[0].minArgumentCount; - let someSigHasRestParameter = false; - for (const sig of signatures) { - minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); - if (signatureHasRestParameter(sig)) { - someSigHasRestParameter = true; - } - if (sig.parameters.length >= maxArgsSignature.parameters.length && (!signatureHasRestParameter(sig) || signatureHasRestParameter(maxArgsSignature))) { - maxArgsSignature = sig; - } - } - const maxNonRestArgs = maxArgsSignature.parameters.length - (signatureHasRestParameter(maxArgsSignature) ? 1 : 0); - const maxArgsParameterSymbolNames = maxArgsSignature.parameters.map((symbol) => symbol.name); - const parameters = createDummyParameters( - maxNonRestArgs, - maxArgsParameterSymbolNames, - /*types*/ - void 0, - minArgumentCount, - /*inJs*/ - false - ); - if (someSigHasRestParameter) { - const restParameter = factory.createParameterDeclaration( - /*modifiers*/ - void 0, - factory.createToken(26 /* DotDotDotToken */), - maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", - /*questionToken*/ - maxNonRestArgs >= minArgumentCount ? factory.createToken(58 /* QuestionToken */) : void 0, - factory.createArrayTypeNode(factory.createKeywordTypeNode(159 /* UnknownKeyword */)), - /*initializer*/ - void 0 - ); - parameters.push(restParameter); - } - return createStubbedMethod( - modifiers, - name, - optional, - /*typeParameters*/ - void 0, - parameters, - getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration), - quotePreference, - body - ); -} -function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) { - if (length(signatures)) { - const type = checker.getUnionType(map(signatures, checker.getReturnTypeOfSignature)); - return checker.typeToTypeNode(type, enclosingDeclaration, 1 /* NoTruncation */, 8 /* AllowUnresolvedNames */, getNoopSymbolTrackerWithResolver(context)); - } -} -function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType, quotePreference, body) { - return factory.createMethodDeclaration( - modifiers, - /*asteriskToken*/ - void 0, - name, - optional ? factory.createToken(58 /* QuestionToken */) : void 0, - typeParameters, - parameters, - returnType, - body || createStubbedMethodBody(quotePreference) - ); -} -function createStubbedMethodBody(quotePreference) { - return createStubbedBody(Diagnostics.Method_not_implemented.message, quotePreference); -} -function createStubbedBody(text, quotePreference) { - return factory.createBlock( - [factory.createThrowStatement( - factory.createNewExpression( - factory.createIdentifier("Error"), - /*typeArguments*/ - void 0, - // TODO Handle auto quote preference. - [factory.createStringLiteral( - text, - /*isSingleQuote*/ - quotePreference === 0 /* Single */ - )] - ) - )], - /*multiLine*/ - true - ); -} -function setJsonCompilerOptionValues(changeTracker, configFile, options) { - const tsconfigObjectLiteral = getTsConfigObjectLiteralExpression(configFile); - if (!tsconfigObjectLiteral) 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 - ) - ) - ); - return; - } - const compilerOptions = compilerOptionsProperty.initializer; - if (!isObjectLiteralExpression(compilerOptions)) { - return; - } - for (const [optionName, optionValue] of options) { - const optionProperty = findJsonProperty(compilerOptions, optionName); - if (optionProperty === void 0) { - changeTracker.insertNodeAtObjectStart(configFile, compilerOptions, createJsonPropertyAssignment(optionName, optionValue)); - } else { - changeTracker.replaceNode(configFile, optionProperty.initializer, optionValue); - } - } -} -function setJsonCompilerOptionValue(changeTracker, configFile, optionName, optionValue) { - setJsonCompilerOptionValues(changeTracker, configFile, [[optionName, optionValue]]); -} -function createJsonPropertyAssignment(name, initializer) { - return factory.createPropertyAssignment(factory.createStringLiteral(name), initializer); -} -function findJsonProperty(obj, name) { - return find(obj.properties, (p) => isPropertyAssignment(p) && !!p.name && isStringLiteral(p.name) && p.name.text === name); -} -function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) { - let symbols; - const typeNode = visitNode(importTypeNode, visit, isTypeNode); - if (symbols && typeNode) { - return { typeNode, symbols }; - } - function visit(node) { - if (isLiteralImportTypeNode(node) && node.qualifier) { - const firstIdentifier = getFirstIdentifier(node.qualifier); - if (!firstIdentifier.symbol) { - return visitEachChild( - node, - visit, - /*context*/ - void 0 - ); - } - const name = getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget); - const qualifier = name !== firstIdentifier.text ? replaceFirstIdentifierOfEntityName(node.qualifier, factory.createIdentifier(name)) : node.qualifier; - symbols = append(symbols, firstIdentifier.symbol); - const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode); - return factory.createTypeReferenceNode(qualifier, typeArguments); - } - return visitEachChild( - node, - visit, - /*context*/ - void 0 - ); - } -} -function replaceFirstIdentifierOfEntityName(name, newIdentifier) { - if (name.kind === 80 /* Identifier */) { - return newIdentifier; - } - return factory.createQualifiedName(replaceFirstIdentifierOfEntityName(name.left, newIdentifier), name.right); -} -function importSymbols(importAdder, symbols) { - symbols.forEach((s) => importAdder.addImportFromExportedSymbol( - s, - /*isValidTypeOnlyUseSite*/ - true - )); -} -function findAncestorMatchingSpan(sourceFile, span) { - const end = textSpanEnd(span); - let token = getTokenAtPosition(sourceFile, span.start); - while (token.end < end) { - token = token.parent; - } - return token; -} - -// src/services/codefixes/generateAccessors.ts -function generateAccessorFromProperty(file, program, start, end, context, _actionName) { - const fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end); - if (!fieldInfo || ts_refactor_exports.isRefactorErrorInfo(fieldInfo)) return void 0; - const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context); - const { isStatic: isStatic2, isReadonly, fieldName, accessorName, originalName, type, container, declaration } = fieldInfo; - suppressLeadingAndTrailingTrivia(fieldName); - suppressLeadingAndTrailingTrivia(accessorName); - suppressLeadingAndTrailingTrivia(declaration); - suppressLeadingAndTrailingTrivia(container); - let accessorModifiers; - let fieldModifiers; - if (isClassLike(container)) { - const modifierFlags = getEffectiveModifierFlags(declaration); - if (isSourceFileJS(file)) { - const modifiers = factory.createModifiersFromModifierFlags(modifierFlags); - accessorModifiers = modifiers; - fieldModifiers = modifiers; - } else { - accessorModifiers = factory.createModifiersFromModifierFlags(prepareModifierFlagsForAccessor(modifierFlags)); - fieldModifiers = factory.createModifiersFromModifierFlags(prepareModifierFlagsForField(modifierFlags)); - } - if (canHaveDecorators(declaration)) { - fieldModifiers = concatenate(getDecorators(declaration), fieldModifiers); - } - } - updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, fieldModifiers); - const getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic2, container); - suppressLeadingAndTrailingTrivia(getAccessor); - insertAccessor(changeTracker, file, getAccessor, declaration, container); - if (isReadonly) { - const constructor = getFirstConstructorWithBody(container); - if (constructor) { - updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); - } - } else { - const setAccessor = generateSetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic2, container); - suppressLeadingAndTrailingTrivia(setAccessor); - insertAccessor(changeTracker, file, setAccessor, declaration, container); - } - return changeTracker.getChanges(); -} -function isConvertibleName(name) { - return isIdentifier(name) || isStringLiteral(name); -} -function isAcceptedDeclaration(node) { - return isParameterPropertyDeclaration(node, node.parent) || isPropertyDeclaration(node) || isPropertyAssignment(node); -} -function createPropertyName(name, originalName) { - return isIdentifier(originalName) ? factory.createIdentifier(name) : factory.createStringLiteral(name); -} -function createAccessorAccessExpression(fieldName, isStatic2, container) { - const leftHead = isStatic2 ? container.name : factory.createThis(); - return isIdentifier(fieldName) ? factory.createPropertyAccessExpression(leftHead, fieldName) : factory.createElementAccessExpression(leftHead, factory.createStringLiteralFromNode(fieldName)); -} -function prepareModifierFlagsForAccessor(modifierFlags) { - modifierFlags &= ~8 /* Readonly */; - modifierFlags &= ~2 /* Private */; - if (!(modifierFlags & 4 /* Protected */)) { - modifierFlags |= 1 /* Public */; - } - return modifierFlags; -} -function prepareModifierFlagsForField(modifierFlags) { - 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 = 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) - }; - } - if (!isConvertibleName(declaration.name)) { - return { - error: getLocaleSpecificMessage(Diagnostics.Name_is_not_valid) - }; - } - if ((getEffectiveModifierFlags(declaration) & 98303 /* Modifier */ | meaning) !== meaning) { - return { - error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_property_with_modifier) - }; - } - const name = declaration.name.text; - const startWithUnderscore = startsWithUnderscore(name); - const fieldName = createPropertyName(startWithUnderscore ? name : getUniqueName(`_${name}`, file), declaration.name); - const accessorName = createPropertyName(startWithUnderscore ? getUniqueName(name.substring(1), file) : name, declaration.name); - return { - isStatic: hasStaticModifier(declaration), - isReadonly: hasEffectiveReadonlyModifier(declaration), - type: getDeclarationType(declaration, program), - container: declaration.kind === 170 /* Parameter */ ? declaration.parent.parent : declaration.parent, - originalName: declaration.name.text, - declaration, - fieldName, - accessorName, - renameAccessor: startWithUnderscore - }; -} -function generateGetAccessor(fieldName, accessorName, type, modifiers, isStatic2, container) { - return factory.createGetAccessorDeclaration( - modifiers, - accessorName, - [], - type, - factory.createBlock( - [ - factory.createReturnStatement( - createAccessorAccessExpression(fieldName, isStatic2, container) - ) - ], - /*multiLine*/ - true - ) - ); -} -function generateSetAccessor(fieldName, accessorName, type, modifiers, isStatic2, container) { - return factory.createSetAccessorDeclaration( - modifiers, - accessorName, - [factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - factory.createIdentifier("value"), - /*questionToken*/ - void 0, - type - )], - factory.createBlock( - [ - factory.createExpressionStatement( - factory.createAssignment( - createAccessorAccessExpression(fieldName, isStatic2, container), - factory.createIdentifier("value") - ) - ) - ], - /*multiLine*/ - true - ) - ); -} -function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { - const property = factory.updatePropertyDeclaration( - declaration, - modifiers, - fieldName, - declaration.questionToken || declaration.exclamationToken, - type, - declaration.initializer - ); - changeTracker.replaceNode(file, declaration, property); -} -function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { - let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); - if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) { - if (assignment === declaration) assignment = factory.cloneNode(assignment); - assignment.modifiers = void 0; - assignment.questionToken = void 0; - assignment.exclamationToken = void 0; - } - changeTracker.replacePropertyAssignment(file, declaration, assignment); -} -function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { - if (isPropertyDeclaration(declaration)) { - updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers); - } 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)); - } -} -function insertAccessor(changeTracker, file, accessor, declaration, container) { - isParameterPropertyDeclaration(declaration, declaration.parent) ? changeTracker.insertMemberAtStart(file, container, accessor) : isPropertyAssignment(declaration) ? changeTracker.insertNodeAfterComma(file, declaration, accessor) : changeTracker.insertNodeAfter(file, declaration, accessor); -} -function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) { - if (!constructor.body) return; - constructor.body.forEachChild(function recur(node) { - if (isElementAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */ && isStringLiteral(node.argumentExpression) && node.argumentExpression.text === originalName && isWriteAccess(node)) { - changeTracker.replaceNode(file, node.argumentExpression, factory.createStringLiteral(fieldName)); - } - if (isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */ && node.name.text === originalName && isWriteAccess(node)) { - changeTracker.replaceNode(file, node.name, factory.createIdentifier(fieldName)); - } - if (!isFunctionLike(node) && !isClassLike(node)) { - node.forEachChild(recur); - } - }); -} -function getDeclarationType(declaration, program) { - const typeNode = getTypeAnnotationNode(declaration); - if (isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) { - const typeChecker = program.getTypeChecker(); - const type = typeChecker.getTypeFromTypeNode(typeNode); - if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type)) { - const types = isUnionTypeNode(typeNode) ? typeNode.types : [typeNode]; - return factory.createUnionTypeNode([...types, factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]); - } - } - return typeNode; -} - -// src/services/codefixes/fixInvalidImportSyntax.ts -var fixName5 = "invalidImportSyntax"; -function getCodeFixesForImportDeclaration(context, node) { - const sourceFile = getSourceFileOfNode(node); - const namespace = getNamespaceDeclarationNode(node); - const opts = context.program.getCompilerOptions(); - const variations = []; - variations.push(createAction(context, sourceFile, node, makeImport( - namespace.name, - /*namedImports*/ - void 0, - node.moduleSpecifier, - 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) - ) - )); - } - return variations; -} -function createAction(context, sourceFile, node, replacement) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => t.replaceNode(sourceFile, node, replacement)); - return createCodeFixActionWithoutFixAll(fixName5, changes, [Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]); -} -registerCodeFix({ - errorCodes: [ - Diagnostics.This_expression_is_not_callable.code, - Diagnostics.This_expression_is_not_constructable.code - ], - getCodeActions: getActionsForUsageOfInvalidImport -}); -function getActionsForUsageOfInvalidImport(context) { - const sourceFile = context.sourceFile; - const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 214 /* CallExpression */ : 215 /* NewExpression */; - const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.kind === targetKind); - if (!node) { - return []; - } - const expr = node.expression; - return getImportCodeFixesForExpression(context, expr); -} -registerCodeFix({ - errorCodes: [ - // The following error codes cover pretty much all assignability errors that could involve an expression - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, - Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code, - Diagnostics.Type_0_is_not_assignable_to_type_1.code, - Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code, - Diagnostics.Type_predicate_0_is_not_assignable_to_1.code, - Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code, - Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3.code, - Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code, - Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code, - Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code, - Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code - ], - getCodeActions: getActionsForInvalidImportLocation -}); -function getActionsForInvalidImportLocation(context) { - const sourceFile = context.sourceFile; - const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.getStart() === context.span.start && a.getEnd() === context.span.start + context.span.length); - if (!node) { - return []; - } - return getImportCodeFixesForExpression(context, node); -} -function getImportCodeFixesForExpression(context, expr) { - const type = context.program.getTypeChecker().getTypeAtLocation(expr); - if (!(type.symbol && isTransientSymbol(type.symbol) && type.symbol.links.originatingImport)) { - return []; - } - const fixes = []; - const relatedImport = type.symbol.links.originatingImport; - if (!isImportCall(relatedImport)) { - addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport)); - } - if (isExpression(expr) && !(isNamedDeclaration(expr.parent) && expr.parent.name === expr)) { - const sourceFile = context.sourceFile; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => t.replaceNode(sourceFile, expr, factory.createPropertyAccessExpression(expr, "default"), {})); - fixes.push(createCodeFixActionWithoutFixAll(fixName5, changes, Diagnostics.Use_synthetic_default_member)); - } - return fixes; -} - -// src/services/codefixes/fixStrictClassInitialization.ts -var fixName6 = "strictClassInitialization"; -var fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; -var fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; -var fixIdAddInitializer = "addMissingPropertyInitializer"; -var errorCodes54 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; -registerCodeFix({ - errorCodes: errorCodes54, - getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context) { - const info = getInfo17(context.sourceFile, context.span.start); - if (!info) return; - const result = []; - append(result, getActionForAddMissingUndefinedType(context, info)); - append(result, getActionForAddMissingDefiniteAssignmentAssertion(context, info)); - append(result, getActionForAddMissingInitializer(context, info)); - return result; - }, - fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], - getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes54, (changes, diag2) => { - const info = getInfo17(diag2.file, diag2.start); - if (!info) return; - switch (context.fixId) { - case fixIdAddDefiniteAssignmentAssertions: - addDefiniteAssignmentAssertion(changes, diag2.file, info.prop); - break; - case fixIdAddUndefinedType: - addUndefinedType(changes, diag2.file, info); - break; - case fixIdAddInitializer: - const checker = context.program.getTypeChecker(); - const initializer = getInitializer(checker, info.prop); - if (!initializer) return; - addInitializer(changes, diag2.file, info.prop, initializer); - break; - default: - Debug.fail(JSON.stringify(context.fixId)); - } - }); - } -}); -function getInfo17(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - if (isIdentifier(token) && isPropertyDeclaration(token.parent)) { - const type = getEffectiveTypeAnnotationNode(token.parent); - if (type) { - return { type, prop: token.parent, isJs: isInJSFile(token.parent) }; - } - } - return void 0; -} -function getActionForAddMissingDefiniteAssignmentAssertion(context, info) { - if (info.isJs) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addDefiniteAssignmentAssertion(t, context.sourceFile, info.prop)); - return createCodeFixAction(fixName6, changes, [Diagnostics.Add_definite_assignment_assertion_to_property_0, info.prop.getText()], fixIdAddDefiniteAssignmentAssertions, Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties); -} -function addDefiniteAssignmentAssertion(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - suppressLeadingAndTrailingTrivia(propertyDeclaration); - const property = factory.updatePropertyDeclaration( - propertyDeclaration, - propertyDeclaration.modifiers, - propertyDeclaration.name, - factory.createToken(54 /* ExclamationToken */), - propertyDeclaration.type, - propertyDeclaration.initializer - ); - changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property); -} -function getActionForAddMissingUndefinedType(context, info) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addUndefinedType(t, context.sourceFile, info)); - return createCodeFixAction(fixName6, changes, [Diagnostics.Add_undefined_type_to_property_0, info.prop.name.getText()], fixIdAddUndefinedType, Diagnostics.Add_undefined_type_to_all_uninitialized_properties); -} -function addUndefinedType(changeTracker, sourceFile, info) { - const undefinedTypeNode = factory.createKeywordTypeNode(157 /* UndefinedKeyword */); - const types = isUnionTypeNode(info.type) ? info.type.types.concat(undefinedTypeNode) : [info.type, undefinedTypeNode]; - const unionTypeNode = factory.createUnionTypeNode(types); - if (info.isJs) { - changeTracker.addJSDocTags(sourceFile, info.prop, [factory.createJSDocTypeTag( - /*tagName*/ - void 0, - factory.createJSDocTypeExpression(unionTypeNode) - )]); - } else { - changeTracker.replaceNode(sourceFile, info.type, unionTypeNode); - } -} -function getActionForAddMissingInitializer(context, info) { - if (info.isJs) return void 0; - const checker = context.program.getTypeChecker(); - const initializer = getInitializer(checker, info.prop); - if (!initializer) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addInitializer(t, context.sourceFile, info.prop, initializer)); - return createCodeFixAction(fixName6, changes, [Diagnostics.Add_initializer_to_property_0, info.prop.name.getText()], fixIdAddInitializer, Diagnostics.Add_initializers_to_all_uninitialized_properties); -} -function addInitializer(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, initializer) { - suppressLeadingAndTrailingTrivia(propertyDeclaration); - const property = factory.updatePropertyDeclaration( - propertyDeclaration, - propertyDeclaration.modifiers, - propertyDeclaration.name, - propertyDeclaration.questionToken, - propertyDeclaration.type, - initializer - ); - changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property); -} -function getInitializer(checker, propertyDeclaration) { - return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type)); -} -function getDefaultValueFromType(checker, type) { - if (type.flags & 512 /* BooleanLiteral */) { - return type === checker.getFalseType() || type === checker.getFalseType( - /*fresh*/ - true - ) ? factory.createFalse() : factory.createTrue(); - } else if (type.isStringLiteral()) { - return factory.createStringLiteral(type.value); - } else if (type.isNumberLiteral()) { - return factory.createNumericLiteral(type.value); - } else if (type.flags & 2048 /* BigIntLiteral */) { - return factory.createBigIntLiteral(type.value); - } else if (type.isUnion()) { - return firstDefined(type.types, (t) => getDefaultValueFromType(checker, t)); - } else if (type.isClass()) { - const classDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); - if (!classDeclaration || hasSyntacticModifier(classDeclaration, 64 /* Abstract */)) return void 0; - const constructorDeclaration = getFirstConstructorWithBody(classDeclaration); - if (constructorDeclaration && constructorDeclaration.parameters.length) return void 0; - return factory.createNewExpression( - factory.createIdentifier(type.symbol.name), - /*typeArguments*/ - void 0, - /*argumentsArray*/ - void 0 - ); - } else if (checker.isArrayLikeType(type)) { - return factory.createArrayLiteralExpression(); - } - return void 0; -} - -// src/services/codefixes/requireInTs.ts -var fixId43 = "requireInTs"; -var errorCodes55 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; -registerCodeFix({ - errorCodes: errorCodes55, - getCodeActions(context) { - const info = getInfo18(context.sourceFile, context.program, context.span.start, context.preferences); - if (!info) { - return void 0; - } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange35(t, context.sourceFile, info)); - return [createCodeFixAction(fixId43, changes, Diagnostics.Convert_require_to_import, fixId43, Diagnostics.Convert_all_require_to_import)]; - }, - fixIds: [fixId43], - getAllCodeActions: (context) => codeFixAll(context, errorCodes55, (changes, diag2) => { - const info = getInfo18(diag2.file, context.program, diag2.start, context.preferences); - if (info) { - doChange35(changes, context.sourceFile, info); - } - }) -}); -function doChange35(changes, sourceFile, info) { - const { allowSyntheticDefaults, defaultImportName, namedImports, statement, moduleSpecifier } = info; - changes.replaceNode( - sourceFile, - statement, - defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - defaultImportName, - factory.createExternalModuleReference(moduleSpecifier) - ) : factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /*phaseModifier*/ - void 0, - defaultImportName, - namedImports - ), - moduleSpecifier, - /*attributes*/ - void 0 - ) - ); -} -function getInfo18(sourceFile, program, pos, preferences) { - const { parent: parent2 } = getTokenAtPosition(sourceFile, pos); - if (!isRequireCall( - parent2, - /*requireStringLiteralLikeArgument*/ - true - )) { - Debug.failBadSyntaxKind(parent2); - } - const decl = cast(parent2.parent, isVariableDeclaration); - const quotePreference = getQuotePreference(sourceFile, preferences); - const defaultImportName = tryCast(decl.name, isIdentifier); - const namedImports = isObjectBindingPattern(decl.name) ? tryCreateNamedImportsFromObjectBindingPattern(decl.name) : void 0; - if (defaultImportName || namedImports) { - const moduleSpecifier = first(parent2.arguments); - return { - allowSyntheticDefaults: getAllowSyntheticDefaultImports(program.getCompilerOptions()), - defaultImportName, - namedImports, - statement: cast(decl.parent.parent, isVariableStatement), - moduleSpecifier: isNoSubstitutionTemplateLiteral(moduleSpecifier) ? factory.createStringLiteral(moduleSpecifier.text, quotePreference === 0 /* Single */) : moduleSpecifier - }; - } -} -function tryCreateNamedImportsFromObjectBindingPattern(node) { - const importSpecifiers = []; - for (const element of node.elements) { - if (!isIdentifier(element.name) || element.initializer) { - return void 0; - } - importSpecifiers.push(factory.createImportSpecifier( - /*isTypeOnly*/ - false, - tryCast(element.propertyName, isIdentifier), - element.name - )); - } - if (importSpecifiers.length) { - return factory.createNamedImports(importSpecifiers); - } -} - -// src/services/codefixes/useDefaultImport.ts -var fixId44 = "useDefaultImport"; -var errorCodes56 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; -registerCodeFix({ - errorCodes: errorCodes56, - getCodeActions(context) { - const { sourceFile, span: { start } } = context; - const info = getInfo19(sourceFile, start); - if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange36(t, sourceFile, info, context.preferences)); - return [createCodeFixAction(fixId44, changes, Diagnostics.Convert_to_default_import, fixId44, Diagnostics.Convert_all_to_default_imports)]; - }, - fixIds: [fixId44], - getAllCodeActions: (context) => codeFixAll(context, errorCodes56, (changes, diag2) => { - const info = getInfo19(diag2.file, diag2.start); - if (info) doChange36(changes, diag2.file, info, context.preferences); - }) -}); -function getInfo19(sourceFile, pos) { - const name = getTokenAtPosition(sourceFile, pos); - if (!isIdentifier(name)) return void 0; - const { parent: parent2 } = name; - if (isImportEqualsDeclaration(parent2) && isExternalModuleReference(parent2.moduleReference)) { - return { importNode: parent2, name, moduleSpecifier: parent2.moduleReference.expression }; - } else if (isNamespaceImport(parent2) && isImportDeclaration(parent2.parent.parent)) { - const importNode = parent2.parent.parent; - return { importNode, name, moduleSpecifier: importNode.moduleSpecifier }; - } -} -function doChange36(changes, sourceFile, info, preferences) { - changes.replaceNode(sourceFile, info.importNode, makeImport( - info.name, - /*namedImports*/ - void 0, - info.moduleSpecifier, - getQuotePreference(sourceFile, preferences) - )); -} - -// src/services/codefixes/useBigintLiteral.ts -var fixId45 = "useBigintLiteral"; -var errorCodes57 = [ - Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code -]; -registerCodeFix({ - errorCodes: errorCodes57, - getCodeActions: function getCodeActionsToUseBigintLiteral(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span)); - if (changes.length > 0) { - return [createCodeFixAction(fixId45, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId45, Diagnostics.Convert_all_to_bigint_numeric_literals)]; - } - }, - fixIds: [fixId45], - getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes57, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); - } -}); -function makeChange10(changeTracker, sourceFile, span) { - const numericLiteral = tryCast(getTokenAtPosition(sourceFile, span.start), isNumericLiteral); - if (!numericLiteral) { - return; - } - const newText = numericLiteral.getText(sourceFile) + "n"; - changeTracker.replaceNode(sourceFile, numericLiteral, factory.createBigIntLiteral(newText)); -} - -// src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts -var fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof"; -var fixId46 = fixIdAddMissingTypeof; -var errorCodes58 = [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: errorCodes58, - getCodeActions: function getCodeActionsToAddMissingTypeof(context) { - const { sourceFile, span } = context; - const importType = getImportTypeNode(sourceFile, span.start); - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange37(t, sourceFile, importType)); - return [createCodeFixAction(fixId46, changes, Diagnostics.Add_missing_typeof, fixId46, Diagnostics.Add_missing_typeof)]; - }, - fixIds: [fixId46], - getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => doChange37(changes, context.sourceFile, getImportTypeNode(diag2.file, diag2.start))) -}); -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 === 206 /* ImportType */, "Token parent should be an ImportType"); - return token.parent; -} -function doChange37(changes, sourceFile, importType) { - const newTypeNode = factory.updateImportTypeNode( - importType, - importType.argument, - importType.attributes, - importType.qualifier, - importType.typeArguments, - /*isTypeOf*/ - true - ); - changes.replaceNode(sourceFile, importType, newTypeNode); -} - -// src/services/codefixes/wrapJsxInFragment.ts -var fixID2 = "wrapJsxInFragment"; -var errorCodes59 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; -registerCodeFix({ - errorCodes: errorCodes59, - 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) => 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, errorCodes59, (changes, diag2) => { - const node = findNodeToFix(context.sourceFile, diag2.start); - if (!node) return void 0; - doChange38(changes, context.sourceFile, node); - }) -}); -function findNodeToFix(sourceFile, pos) { - const lessThanToken = getTokenAtPosition(sourceFile, pos); - const firstJsxElementOrOpenElement = lessThanToken.parent; - let binaryExpr = firstJsxElementOrOpenElement.parent; - if (!isBinaryExpression(binaryExpr)) { - binaryExpr = binaryExpr.parent; - if (!isBinaryExpression(binaryExpr)) return void 0; - } - if (!nodeIsMissing(binaryExpr.operatorToken)) return void 0; - return binaryExpr; -} -function doChange38(changeTracker, sf, node) { - const jsx = flattenInvalidBinaryExpr(node); - if (jsx) changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); -} -function flattenInvalidBinaryExpr(node) { - const children = []; - let current = node; - while (true) { - if (isBinaryExpression(current) && nodeIsMissing(current.operatorToken) && current.operatorToken.kind === 28 /* CommaToken */) { - children.push(current.left); - if (isJsxChild(current.right)) { - children.push(current.right); - return children; - } else if (isBinaryExpression(current.right)) { - current = current.right; - continue; - } else return void 0; - } else return void 0; - } -} - -// src/services/codefixes/wrapDecoratorInParentheses.ts -var fixId47 = "wrapDecoratorInParentheses"; -var errorCodes60 = [Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code]; -registerCodeFix({ - errorCodes: errorCodes60, - getCodeActions: function getCodeActionsToWrapDecoratorExpressionInParentheses(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span.start)); - return [createCodeFixAction(fixId47, changes, Diagnostics.Wrap_in_parentheses, fixId47, Diagnostics.Wrap_all_invalid_decorator_expressions_in_parentheses)]; - }, - fixIds: [fixId47], - getAllCodeActions: (context) => codeFixAll(context, errorCodes60, (changes, diag2) => makeChange11(changes, diag2.file, diag2.start)) -}); -function makeChange11(changeTracker, sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - const decorator = findAncestor(token, isDecorator); - Debug.assert(!!decorator, "Expected position to be owned by a decorator."); - const replacement = factory.createParenthesizedExpression(decorator.expression); - changeTracker.replaceNode(sourceFile, decorator.expression, replacement); -} - -// src/services/codefixes/convertToMappedObjectType.ts -var fixId48 = "fixConvertToMappedObjectType"; -var errorCodes61 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; -registerCodeFix({ - errorCodes: errorCodes61, - getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) { - const { sourceFile, span } = context; - const info = getInfo20(sourceFile, span.start); - if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange39(t, sourceFile, info)); - const name = idText(info.container.name); - return [createCodeFixAction(fixId48, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId48, [Diagnostics.Convert_0_to_mapped_object_type, name])]; - }, - fixIds: [fixId48], - getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, diag2) => { - const info = getInfo20(diag2.file, diag2.start); - if (info) doChange39(changes, diag2.file, info); - }) -}); -function getInfo20(sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); - const indexSignature = tryCast(token.parent.parent, isIndexSignatureDeclaration); - if (!indexSignature) return void 0; - const container = isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : tryCast(indexSignature.parent.parent, isTypeAliasDeclaration); - if (!container) return void 0; - return { indexSignature, container }; -} -function createTypeAliasFromInterface(declaration, type) { - return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type); -} -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); - const mappedTypeParameter = factory.createTypeParameterDeclaration( - /*modifiers*/ - void 0, - cast(parameter.name, isIdentifier), - parameter.type - ); - const mappedIntersectionType = factory.createMappedTypeNode( - hasEffectiveReadonlyModifier(indexSignature) ? factory.createModifier(148 /* ReadonlyKeyword */) : void 0, - mappedTypeParameter, - /*nameType*/ - void 0, - indexSignature.questionToken, - indexSignature.type, - /*members*/ - void 0 - ); - const intersectionType = factory.createIntersectionTypeNode([ - ...getAllSuperTypeNodes(container), - mappedIntersectionType, - ...otherMembers.length ? [factory.createTypeLiteralNode(otherMembers)] : emptyArray - ]); - changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType)); -} - -// src/services/codefixes/removeAccidentalCallParentheses.ts -var fixId49 = "removeAccidentalCallParentheses"; -var errorCodes62 = [ - Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code -]; -registerCodeFix({ - errorCodes: errorCodes62, - getCodeActions(context) { - const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression); - if (!callExpression) { - return void 0; - } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end }); - }); - return [createCodeFixActionWithoutFixAll(fixId49, changes, Diagnostics.Remove_parentheses)]; - }, - fixIds: [fixId49] -}); - -// src/services/codefixes/removeUnnecessaryAwait.ts -var fixId50 = "removeUnnecessaryAwait"; -var errorCodes63 = [ - Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code -]; -registerCodeFix({ - errorCodes: errorCodes63, - getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange12(t, context.sourceFile, context.span)); - if (changes.length > 0) { - return [createCodeFixAction(fixId50, changes, Diagnostics.Remove_unnecessary_await, fixId50, Diagnostics.Remove_all_unnecessary_uses_of_await)]; - } - }, - fixIds: [fixId50], - getAllCodeActions: (context) => { - return codeFixAll(context, errorCodes63, (changes, diag2) => makeChange12(changes, diag2.file, diag2)); - } -}); -function makeChange12(changeTracker, sourceFile, span) { - const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node) => node.kind === 135 /* AwaitKeyword */); - const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression); - if (!awaitExpression) { - return; - } - let expressionToReplace = awaitExpression; - const hasSurroundingParens = isParenthesizedExpression(awaitExpression.parent); - if (hasSurroundingParens) { - const leftMostExpression = getLeftmostExpression( - awaitExpression.expression, - /*stopAtCallExpressions*/ - false - ); - if (isIdentifier(leftMostExpression)) { - const precedingToken = findPrecedingToken(awaitExpression.parent.pos, sourceFile); - if (precedingToken && precedingToken.kind !== 105 /* NewKeyword */) { - expressionToReplace = awaitExpression.parent; - } - } - } - changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression); -} - -// src/services/codefixes/splitTypeOnlyImport.ts -var errorCodes64 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; -var fixId51 = "splitTypeOnlyImport"; -registerCodeFix({ - errorCodes: errorCodes64, - fixIds: [fixId51], - getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => { - return splitTypeOnlyImport(t, getImportDeclaration2(context.sourceFile, context.span), context); - }); - if (changes.length) { - return [createCodeFixAction(fixId51, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId51, Diagnostics.Split_all_invalid_type_only_imports)]; - } - }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes64, (changes, error2) => { - splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error2), context); - }) -}); -function getImportDeclaration2(sourceFile, span) { - return findAncestor(getTokenAtPosition(sourceFile, span.start), isImportDeclaration); -} -function splitTypeOnlyImport(changes, importDeclaration, context) { - if (!importDeclaration) { - return; - } - const importClause = Debug.checkDefined(importDeclaration.importClause); - changes.replaceNode( - context.sourceFile, - importDeclaration, - factory.updateImportDeclaration( - importDeclaration, - importDeclaration.modifiers, - factory.updateImportClause( - importClause, - importClause.phaseModifier, - importClause.name, - /*namedBindings*/ - void 0 - ), - importDeclaration.moduleSpecifier, - importDeclaration.attributes - ) - ); - changes.insertNodeAfter( - context.sourceFile, - importDeclaration, - factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.updateImportClause( - importClause, - importClause.phaseModifier, - /*name*/ - void 0, - importClause.namedBindings - ), - importDeclaration.moduleSpecifier, - importDeclaration.attributes - ) - ); -} - -// src/services/codefixes/convertConstToLet.ts -var fixId52 = "fixConvertConstToLet"; -var errorCodes65 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; -registerCodeFix({ - errorCodes: errorCodes65, - getCodeActions: function getCodeActionsToConvertConstToLet(context) { - const { sourceFile, span, program } = context; - const info = getInfo21(sourceFile, span.start, program); - if (info === void 0) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange40(t, sourceFile, info.token)); - return [createCodeFixActionMaybeFixAll(fixId52, changes, Diagnostics.Convert_const_to_let, fixId52, Diagnostics.Convert_all_const_to_let)]; - }, - getAllCodeActions: (context) => { - const { program } = context; - const seen = /* @__PURE__ */ new Set(); - return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => { - eachDiagnostic(context, errorCodes65, (diag2) => { - const info = getInfo21(diag2.file, diag2.start, program); - if (info) { - if (addToSeen(seen, getSymbolId(info.symbol))) { - return doChange40(changes, diag2.file, info.token); - } - } - return void 0; - }); - })); - }, - fixIds: [fixId52] -}); -function getInfo21(sourceFile, pos, program) { - var _a; - const checker = program.getTypeChecker(); - const symbol = checker.getSymbolAtLocation(getTokenAtPosition(sourceFile, pos)); - if (symbol === void 0) return; - const declaration = tryCast((_a = symbol == null ? void 0 : symbol.valueDeclaration) == null ? void 0 : _a.parent, isVariableDeclarationList); - if (declaration === void 0) return; - const constToken = findChildOfKind(declaration, 87 /* ConstKeyword */, sourceFile); - if (constToken === void 0) return; - return { symbol, token: constToken }; -} -function doChange40(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token, factory.createToken(121 /* LetKeyword */)); -} - -// src/services/codefixes/fixExpectedComma.ts -var fixId53 = "fixExpectedComma"; -var expectedErrorCode = Diagnostics._0_expected.code; -var errorCodes66 = [expectedErrorCode]; -registerCodeFix({ - errorCodes: errorCodes66, - getCodeActions(context) { - const { sourceFile } = context; - const info = getInfo22(sourceFile, context.span.start, context.errorCode); - if (!info) return void 0; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange41(t, sourceFile, info)); - return [createCodeFixAction( - fixId53, - changes, - [Diagnostics.Change_0_to_1, ";", ","], - fixId53, - [Diagnostics.Change_0_to_1, ";", ","] - )]; - }, - fixIds: [fixId53], - getAllCodeActions: (context) => codeFixAll(context, errorCodes66, (changes, diag2) => { - const info = getInfo22(diag2.file, diag2.start, diag2.code); - if (info) doChange41(changes, context.sourceFile, info); - }) -}); -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 doChange41(changes, sourceFile, { node }) { - const newNode = factory.createToken(28 /* CommaToken */); - changes.replaceNode(sourceFile, node, newNode); -} - -// src/services/codefixes/fixAddVoidToPromise.ts -var fixName7 = "addVoidToPromise"; -var fixId54 = "addVoidToPromise"; -var errorCodes67 = [ - 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: errorCodes67, - fixIds: [fixId54], - getCodeActions(context) { - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange13(t, context.sourceFile, context.span, context.program)); - if (changes.length > 0) { - return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId54, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; - } - }, - getAllCodeActions(context) { - return codeFixAll(context, errorCodes67, (changes, diag2) => makeChange13(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set())); - } -}); -function makeChange13(changes, sourceFile, span, program, seen) { - const node = getTokenAtPosition(sourceFile, span.start); - if (!isIdentifier(node) || !isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) return; - const checker = program.getTypeChecker(); - const symbol = checker.getSymbolAtLocation(node); - const decl = symbol == null ? void 0 : symbol.valueDeclaration; - if (!decl || !isParameter(decl) || !isNewExpression(decl.parent.parent)) return; - if (seen == null ? void 0 : seen.has(decl)) return; - seen == null ? void 0 : seen.add(decl); - const typeArguments = getEffectiveTypeArguments(decl.parent.parent); - if (some(typeArguments)) { - const typeArgument = typeArguments[0]; - const needsParens = !isUnionTypeNode(typeArgument) && !isParenthesizedTypeNode(typeArgument) && isParenthesizedTypeNode(factory.createUnionTypeNode([typeArgument, factory.createKeywordTypeNode(116 /* VoidKeyword */)]).types[0]); - if (needsParens) { - changes.insertText(sourceFile, typeArgument.pos, "("); - } - changes.insertText(sourceFile, typeArgument.end, needsParens ? ") | void" : " | void"); - } else { - const signature = checker.getResolvedSignature(node.parent); - const parameter = signature == null ? void 0 : signature.parameters[0]; - const parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent); - if (isInJSFile(decl)) { - if (!parameterType || parameterType.flags & 3 /* AnyOrUnknown */) { - changes.insertText(sourceFile, decl.parent.parent.end, `)`); - changes.insertText(sourceFile, skipTrivia(sourceFile.text, decl.parent.parent.pos), `/** @type {Promise} */(`); - } - } else { - if (!parameterType || parameterType.flags & 2 /* Unknown */) { - changes.insertText(sourceFile, decl.parent.parent.expression.end, ""); - } - } - } -} -function getEffectiveTypeArguments(node) { - var _a; - if (isInJSFile(node)) { - if (isParenthesizedExpression(node.parent)) { - const jsDocType = (_a = getJSDocTypeTag(node.parent)) == null ? void 0 : _a.typeExpression.type; - if (jsDocType && isTypeReferenceNode(jsDocType) && isIdentifier(jsDocType.typeName) && idText(jsDocType.typeName) === "Promise") { - return jsDocType.typeArguments; - } - } - } else { - return node.typeArguments; - } -} - -// src/services/_namespaces/ts.Completions.ts -var ts_Completions_exports = {}; -__export(ts_Completions_exports, { - CompletionKind: () => CompletionKind, - CompletionSource: () => CompletionSource, - SortText: () => SortText, - StringCompletions: () => ts_Completions_StringCompletions_exports, - SymbolOriginInfoKind: () => SymbolOriginInfoKind, - createCompletionDetails: () => createCompletionDetails, - createCompletionDetailsForSymbol: () => createCompletionDetailsForSymbol, - getCompletionEntriesFromSymbols: () => getCompletionEntriesFromSymbols, - getCompletionEntryDetails: () => getCompletionEntryDetails, - getCompletionEntrySymbol: () => getCompletionEntrySymbol, - getCompletionsAtPosition: () => getCompletionsAtPosition, - getDefaultCommitCharacters: () => getDefaultCommitCharacters, - getPropertiesForObjectExpression: () => getPropertiesForObjectExpression, - moduleSpecifierResolutionCacheAttemptLimit: () => moduleSpecifierResolutionCacheAttemptLimit, - moduleSpecifierResolutionLimit: () => moduleSpecifierResolutionLimit -}); - -// src/services/completions.ts -var moduleSpecifierResolutionLimit = 100; -var moduleSpecifierResolutionCacheAttemptLimit = 1e3; -var SortText = { - // Presets - LocalDeclarationPriority: "10", - LocationPriority: "11", - OptionalMember: "12", - MemberDeclaredBySpreadAssignment: "13", - SuggestedClassMembers: "14", - GlobalsOrKeywords: "15", - AutoImportSuggestions: "16", - ClassMemberSnippets: "17", - JavascriptIdentifiers: "18", - // Transformations - Deprecated(sortText) { - return "z" + sortText; - }, - ObjectLiteralProperty(presetSortText, symbolDisplayName) { - return `${presetSortText}\0${symbolDisplayName}\0`; - }, - SortBelow(sortText) { - return sortText + "1"; - } -}; -var allCommitCharacters = [".", ",", ";"]; -var noCommaCommitCharacters = [".", ";"]; -var CompletionSource = /* @__PURE__ */ ((CompletionSource2) => { - CompletionSource2["ThisProperty"] = "ThisProperty/"; - CompletionSource2["ClassMemberSnippet"] = "ClassMemberSnippet/"; - CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/"; - CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/"; - CompletionSource2["SwitchCases"] = "SwitchCases/"; - CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/"; - return CompletionSource2; -})(CompletionSource || {}); -var SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => { - SymbolOriginInfoKind2[SymbolOriginInfoKind2["ThisType"] = 1] = "ThisType"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMember"] = 2] = "SymbolMember"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["Export"] = 4] = "Export"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["Promise"] = 8] = "Promise"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["Nullable"] = 16] = "Nullable"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["ResolvedExport"] = 32] = "ResolvedExport"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport"; - SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport"; - return SymbolOriginInfoKind2; -})(SymbolOriginInfoKind || {}); -function originIsThisType(origin) { - return !!(origin.kind & 1 /* ThisType */); -} -function originIsSymbolMember(origin) { - return !!(origin.kind & 2 /* SymbolMember */); -} -function originIsExport(origin) { - return !!(origin && origin.kind & 4 /* Export */); -} -function originIsResolvedExport(origin) { - return !!(origin && origin.kind === 32 /* ResolvedExport */); -} -function originIncludesSymbolName(origin) { - return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin); -} -function originIsPackageJsonImport(origin) { - return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson; -} -function originIsPromise(origin) { - return !!(origin.kind & 8 /* Promise */); -} -function originIsNullableMember(origin) { - return !!(origin.kind & 16 /* Nullable */); -} -function originIsTypeOnlyAlias(origin) { - return !!(origin && origin.kind & 64 /* TypeOnlyAlias */); -} -function originIsObjectLiteralMethod(origin) { - return !!(origin && origin.kind & 128 /* ObjectLiteralMethod */); -} -function originIsIgnore(origin) { - return !!(origin && origin.kind & 256 /* Ignore */); -} -function originIsComputedPropertyName(origin) { - return !!(origin && origin.kind & 512 /* ComputedPropertyName */); -} -function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) { - var _a, _b, _c, _d; - const start = timestamp(); - const needsFullResolution = isForImportStatementCompletion || getResolvePackageJsonExports(program.getCompilerOptions()) || ((_a = preferences.autoImportSpecifierExcludeRegexes) == null ? void 0 : _a.length); - let skippedAny = false; - let ambientCount = 0; - let resolvedCount = 0; - let resolvedFromCacheCount = 0; - let cacheAttemptCount = 0; - const result = cb({ - tryResolve, - skippedAny: () => skippedAny, - resolvedAny: () => resolvedCount > 0, - resolvedBeyondLimit: () => resolvedCount > moduleSpecifierResolutionLimit - }); - const hitRateMessage = cacheAttemptCount ? ` (${(resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1)}% hit rate)` : ""; - (_b = host.log) == null ? void 0 : _b.call(host, `${logPrefix}: resolved ${resolvedCount} module specifiers, plus ${ambientCount} ambient and ${resolvedFromCacheCount} from cache${hitRateMessage}`); - (_c = host.log) == null ? void 0 : _c.call(host, `${logPrefix}: response is ${skippedAny ? "incomplete" : "complete"}`); - (_d = host.log) == null ? void 0 : _d.call(host, `${logPrefix}: ${timestamp() - start}`); - return result; - function tryResolve(exportInfo, isFromAmbientModule) { - if (isFromAmbientModule) { - const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite); - if (result3) { - ambientCount++; - } - return result3 || "failed"; - } - const shouldResolveModuleSpecifier = needsFullResolution || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; - const shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < moduleSpecifierResolutionCacheAttemptLimit; - const result2 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; - if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result2) { - skippedAny = true; - } - resolvedCount += (result2 == null ? void 0 : result2.computedWithoutCacheCount) || 0; - resolvedFromCacheCount += exportInfo.length - ((result2 == null ? void 0 : result2.computedWithoutCacheCount) || 0); - if (shouldGetModuleSpecifierFromCache) { - cacheAttemptCount++; - } - return result2 || (needsFullResolution ? "failed" : "skipped"); - } -} -function getDefaultCommitCharacters(isNewIdentifierLocation) { - if (isNewIdentifierLocation) { - return []; - } - return allCommitCharacters; -} -function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) { - var _a; - const { previousToken } = getRelevantTokens(position, sourceFile); - if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) { - return void 0; - } - if (triggerCharacter === " ") { - if (preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) { - return { - isGlobalCompletion: true, - isMemberCompletion: false, - isNewIdentifierLocation: true, - isIncomplete: true, - entries: [], - defaultCommitCharacters: getDefaultCommitCharacters( - /*isNewIdentifierLocation*/ - true - ) - }; - } - return void 0; - } - const compilerOptions = program.getCompilerOptions(); - const checker = program.getTypeChecker(); - const incompleteCompletionsCache = preferences.allowIncompleteCompletions ? (_a = host.getIncompleteCompletionsCache) == null ? void 0 : _a.call(host) : void 0; - if (incompleteCompletionsCache && completionKind === 3 /* TriggerForIncompleteCompletions */ && previousToken && isIdentifier(previousToken)) { - const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken, position); - if (incompleteContinuation) { - return incompleteContinuation; - } - } else { - incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear(); - } - const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol); - if (stringCompletions) { - return stringCompletions; - } - if (previousToken && isBreakOrContinueStatement(previousToken.parent) && (previousToken.kind === 83 /* BreakKeyword */ || previousToken.kind === 88 /* ContinueKeyword */ || previousToken.kind === 80 /* Identifier */)) { - return getLabelCompletionAtPosition(previousToken.parent); - } - const completionData = getCompletionData( - program, - log, - sourceFile, - compilerOptions, - position, - preferences, - /*detailsEntryId*/ - void 0, - host, - formatContext, - cancellationToken - ); - if (!completionData) { - return void 0; - } - switch (completionData.kind) { - case 0 /* Data */: - const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol); - if (response == null ? void 0 : response.isIncomplete) { - incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response); - } - return response; - case 1 /* JsDocTagName */: - return jsdocCompletionInfo([ - ...ts_JsDoc_exports.getJSDocTagNameCompletions(), - ...getJSDocParameterCompletions( - sourceFile, - position, - checker, - compilerOptions, - preferences, - /*tagNameOnly*/ - true - ) - ]); - case 2 /* JsDocTag */: - return jsdocCompletionInfo([ - ...ts_JsDoc_exports.getJSDocTagCompletions(), - ...getJSDocParameterCompletions( - sourceFile, - position, - checker, - compilerOptions, - preferences, - /*tagNameOnly*/ - false - ) - ]); - case 3 /* JsDocParameterName */: - return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocParameterNameCompletions(completionData.tag)); - case 4 /* Keywords */: - return specificKeywordCompletionInfo(completionData.keywordCompletions, completionData.isNewIdentifierLocation); - default: - return Debug.assertNever(completionData); - } -} -function compareCompletionEntries(entryInArray, entryToInsert) { - var _a, _b; - let result = compareStringsCaseSensitiveUI(entryInArray.sortText, entryToInsert.sortText); - if (result === 0 /* EqualTo */) { - result = compareStringsCaseSensitiveUI(entryInArray.name, entryToInsert.name); - } - if (result === 0 /* EqualTo */ && ((_a = entryInArray.data) == null ? void 0 : _a.moduleSpecifier) && ((_b = entryToInsert.data) == null ? void 0 : _b.moduleSpecifier)) { - result = compareNumberOfDirectorySeparators( - entryInArray.data.moduleSpecifier, - entryToInsert.data.moduleSpecifier - ); - } - if (result === 0 /* EqualTo */) { - return -1 /* LessThan */; - } - return result; -} -function completionEntryDataIsResolved(data) { - return !!(data == null ? void 0 : data.moduleSpecifier); -} -function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken, position) { - const previousResponse = cache.get(); - if (!previousResponse) return void 0; - const touchNode = getTouchingPropertyName(file, position); - const lowerCaseTokenText = location.text.toLowerCase(); - const exportMap = getExportInfoMap(file, host, program, preferences, cancellationToken); - const newEntries = resolvingModuleSpecifiers( - "continuePreviousIncompleteResponse", - host, - ts_codefix_exports.createImportSpecifierResolver(file, program, host, preferences), - program, - location.getStart(), - preferences, - /*isForImportStatementCompletion*/ - false, - isValidTypeOnlyAliasUseSite(location), - (context) => { - const entries = mapDefined(previousResponse.entries, (entry) => { - var _a; - if (!entry.hasAction || !entry.source || !entry.data || completionEntryDataIsResolved(entry.data)) { - return entry; - } - if (!charactersFuzzyMatchInString(entry.name, lowerCaseTokenText)) { - return void 0; - } - const { origin } = Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)); - const info = exportMap.get(file.path, entry.data.exportMapKey); - const result = info && context.tryResolve(info, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); - if (result === "skipped") return entry; - if (!result || result === "failed") { - (_a = host.log) == null ? void 0 : _a.call(host, `Unexpected failure resolving auto import for '${entry.name}' from '${entry.source}'`); - return void 0; - } - const newOrigin = { - ...origin, - kind: 32 /* ResolvedExport */, - moduleSpecifier: result.moduleSpecifier - }; - entry.data = originToCompletionEntryData(newOrigin); - entry.source = getSourceFromOrigin(newOrigin); - entry.sourceDisplay = [textPart(newOrigin.moduleSpecifier)]; - return entry; - }); - if (!context.skippedAny()) { - previousResponse.isIncomplete = void 0; - } - return entries; - } - ); - previousResponse.entries = newEntries; - previousResponse.flags = (previousResponse.flags || 0) | 4 /* IsContinuation */; - previousResponse.optionalReplacementSpan = getOptionalReplacementSpan(touchNode); - return previousResponse; -} -function jsdocCompletionInfo(entries) { - return { - isGlobalCompletion: false, - isMemberCompletion: false, - isNewIdentifierLocation: false, - entries, - defaultCommitCharacters: getDefaultCommitCharacters( - /*isNewIdentifierLocation*/ - false - ) - }; -} -function getJSDocParameterCompletions(sourceFile, position, checker, options, preferences, tagNameOnly) { - const currentToken = getTokenAtPosition(sourceFile, position); - if (!isJSDocTag(currentToken) && !isJSDoc(currentToken)) { - return []; - } - const jsDoc = isJSDoc(currentToken) ? currentToken : currentToken.parent; - if (!isJSDoc(jsDoc)) { - return []; - } - const func = jsDoc.parent; - if (!isFunctionLike(func)) { - return []; - } - const isJs = isSourceFileJS(sourceFile); - const isSnippet = preferences.includeCompletionsWithSnippetText || void 0; - const paramTagCount = countWhere(jsDoc.tags, (tag) => isJSDocParameterTag(tag) && tag.getEnd() <= position); - return mapDefined(func.parameters, (param) => { - if (getJSDocParameterTags(param).length) { - return void 0; - } - if (isIdentifier(param.name)) { - const tabstopCounter = { tabstop: 1 }; - const paramName = param.name.text; - let displayText = getJSDocParamAnnotation( - paramName, - param.initializer, - param.dotDotDotToken, - isJs, - /*isObject*/ - false, - /*isSnippet*/ - false, - checker, - options, - preferences - ); - let snippetText = isSnippet ? getJSDocParamAnnotation( - paramName, - param.initializer, - param.dotDotDotToken, - isJs, - /*isObject*/ - false, - /*isSnippet*/ - true, - checker, - options, - preferences, - tabstopCounter - ) : void 0; - if (tagNameOnly) { - displayText = displayText.slice(1); - if (snippetText) snippetText = snippetText.slice(1); - } - return { - name: displayText, - kind: "parameter" /* parameterElement */, - sortText: SortText.LocationPriority, - insertText: isSnippet ? snippetText : void 0, - isSnippet - }; - } else if (param.parent.parameters.indexOf(param) === paramTagCount) { - const paramPath = `param${paramTagCount}`; - const displayTextResult = generateJSDocParamTagsForDestructuring( - paramPath, - param.name, - param.initializer, - param.dotDotDotToken, - isJs, - /*isSnippet*/ - false, - checker, - options, - preferences - ); - const snippetTextResult = isSnippet ? generateJSDocParamTagsForDestructuring( - paramPath, - param.name, - param.initializer, - param.dotDotDotToken, - isJs, - /*isSnippet*/ - true, - checker, - options, - preferences - ) : void 0; - let displayText = displayTextResult.join(getNewLineCharacter(options) + "* "); - let snippetText = snippetTextResult == null ? void 0 : snippetTextResult.join(getNewLineCharacter(options) + "* "); - if (tagNameOnly) { - displayText = displayText.slice(1); - if (snippetText) snippetText = snippetText.slice(1); - } - return { - name: displayText, - kind: "parameter" /* parameterElement */, - sortText: SortText.LocationPriority, - insertText: isSnippet ? snippetText : void 0, - isSnippet - }; - } - }); -} -function generateJSDocParamTagsForDestructuring(path, pattern, initializer, dotDotDotToken, isJs, isSnippet, checker, options, preferences) { - if (!isJs) { - return [ - getJSDocParamAnnotation( - path, - initializer, - dotDotDotToken, - isJs, - /*isObject*/ - false, - isSnippet, - checker, - options, - preferences, - { tabstop: 1 } - ) - ]; - } - return patternWorker(path, pattern, initializer, dotDotDotToken, { tabstop: 1 }); - function patternWorker(path2, pattern2, initializer2, dotDotDotToken2, counter) { - if (isObjectBindingPattern(pattern2) && !dotDotDotToken2) { - const oldTabstop = counter.tabstop; - const childCounter = { tabstop: oldTabstop }; - const rootParam = getJSDocParamAnnotation( - path2, - initializer2, - dotDotDotToken2, - isJs, - /*isObject*/ - true, - isSnippet, - checker, - options, - preferences, - childCounter - ); - let childTags = []; - for (const element of pattern2.elements) { - const elementTags = elementWorker(path2, element, childCounter); - if (!elementTags) { - childTags = void 0; - break; - } else { - childTags.push(...elementTags); - } - } - if (childTags) { - counter.tabstop = childCounter.tabstop; - return [rootParam, ...childTags]; - } - } - return [ - getJSDocParamAnnotation( - path2, - initializer2, - dotDotDotToken2, - isJs, - /*isObject*/ - false, - isSnippet, - checker, - options, - preferences, - counter - ) - ]; - } - function elementWorker(path2, element, counter) { - if (!element.propertyName && isIdentifier(element.name) || isIdentifier(element.name)) { - const propertyName = element.propertyName ? tryGetTextOfPropertyName(element.propertyName) : element.name.text; - if (!propertyName) { - return void 0; - } - const paramName = `${path2}.${propertyName}`; - return [ - getJSDocParamAnnotation( - paramName, - element.initializer, - element.dotDotDotToken, - isJs, - /*isObject*/ - false, - isSnippet, - checker, - options, - preferences, - counter - ) - ]; - } else if (element.propertyName) { - const propertyName = tryGetTextOfPropertyName(element.propertyName); - return propertyName && patternWorker(`${path2}.${propertyName}`, element.name, element.initializer, element.dotDotDotToken, counter); - } - return void 0; - } -} -function getJSDocParamAnnotation(paramName, initializer, dotDotDotToken, isJs, isObject, isSnippet, checker, options, preferences, tabstopCounter) { - if (isSnippet) { - Debug.assertIsDefined(tabstopCounter); - } - if (initializer) { - paramName = getJSDocParamNameWithInitializer(paramName, initializer); - } - if (isSnippet) { - paramName = escapeSnippetText(paramName); - } - if (isJs) { - let type = "*"; - if (isObject) { - Debug.assert(!dotDotDotToken, `Cannot annotate a rest parameter with type 'Object'.`); - type = "Object"; - } else { - if (initializer) { - const inferredType = checker.getTypeAtLocation(initializer.parent); - if (!(inferredType.flags & (1 /* Any */ | 16384 /* Void */))) { - const sourceFile = initializer.getSourceFile(); - const quotePreference = getQuotePreference(sourceFile, preferences); - const builderFlags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */; - const typeNode = checker.typeToTypeNode(inferredType, findAncestor(initializer, isFunctionLike), builderFlags); - if (typeNode) { - const printer = isSnippet ? createSnippetPrinter({ - removeComments: true, - module: options.module, - moduleResolution: options.moduleResolution, - target: options.target - }) : createPrinter({ - removeComments: true, - module: options.module, - moduleResolution: options.moduleResolution, - target: options.target - }); - setEmitFlags(typeNode, 1 /* SingleLine */); - type = printer.printNode(4 /* Unspecified */, typeNode, sourceFile); - } - } - } - if (isSnippet && type === "*") { - type = `\${${tabstopCounter.tabstop++}:${type}}`; - } - } - const dotDotDot = !isObject && dotDotDotToken ? "..." : ""; - const description3 = isSnippet ? `\${${tabstopCounter.tabstop++}}` : ""; - return `@param {${dotDotDot}${type}} ${paramName} ${description3}`; - } else { - const description3 = isSnippet ? `\${${tabstopCounter.tabstop++}}` : ""; - return `@param ${paramName} ${description3}`; - } -} -function getJSDocParamNameWithInitializer(paramName, initializer) { - const initializerText = initializer.getText().trim(); - if (initializerText.includes("\n") || initializerText.length > 80) { - return `[${paramName}]`; - } - return `[${paramName}=${initializerText}]`; -} -function keywordToCompletionEntry(keyword) { - return { - name: tokenToString(keyword), - kind: "keyword" /* keyword */, - kindModifiers: "" /* none */, - sortText: SortText.GlobalsOrKeywords - }; -} -function specificKeywordCompletionInfo(entries, isNewIdentifierLocation) { - return { - isGlobalCompletion: false, - isMemberCompletion: false, - isNewIdentifierLocation, - entries: entries.slice(), - defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation) - }; -} -function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) { - return { - kind: 4 /* Keywords */, - keywordCompletions: getKeywordCompletions(keywordFilters, filterOutTsOnlyKeywords), - isNewIdentifierLocation - }; -} -function keywordFiltersFromSyntaxKind(keywordCompletion) { - switch (keywordCompletion) { - case 156 /* TypeKeyword */: - return 8 /* TypeKeyword */; - default: - Debug.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters"); - } -} -function getOptionalReplacementSpan(location) { - return (location == null ? void 0 : location.kind) === 80 /* Identifier */ ? createTextSpanFromNode(location) : void 0; -} -function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) { - const { - symbols, - contextToken, - completionKind, - isInSnippetScope, - isNewIdentifierLocation, - location, - propertyAccessToConvert, - keywordFilters, - symbolToOriginInfoMap, - recommendedCompletion, - isJsxInitializer, - isTypeOnlyLocation, - isJsxIdentifierExpected, - isRightOfOpenTag, - isRightOfDotOrQuestionDot, - importStatementCompletion, - insideJsDocTagTypeExpression, - symbolToSortTextMap, - hasUnresolvedAutoImports, - defaultCommitCharacters - } = completionData; - let literals = completionData.literals; - const checker = program.getTypeChecker(); - if (getLanguageVariant(sourceFile.scriptKind) === 1 /* JSX */) { - const completionInfo = getJsxClosingTagCompletion(location, sourceFile); - if (completionInfo) { - return completionInfo; - } - } - const caseClause = findAncestor(contextToken, isCaseClause); - if (caseClause && (isCaseKeyword(contextToken) || isNodeDescendantOf(contextToken, caseClause.expression))) { - const tracker = newCaseClauseTracker(checker, caseClause.parent.clauses); - literals = literals.filter((literal) => !tracker.hasValue(literal)); - symbols.forEach((symbol, i) => { - if (symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { - const value = checker.getConstantValue(symbol.valueDeclaration); - if (value !== void 0 && tracker.hasValue(value)) { - symbolToOriginInfoMap[i] = { kind: 256 /* Ignore */ }; - } - } - }); - } - const entries = createSortedArray(); - const isChecked = isCheckedFile(sourceFile, compilerOptions); - if (isChecked && !isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { - return void 0; - } - const uniqueNames = getCompletionEntriesFromSymbols( - symbols, - entries, - /*replacementToken*/ - void 0, - contextToken, - location, - position, - sourceFile, - host, - program, - getEmitScriptTarget(compilerOptions), - log, - completionKind, - preferences, - compilerOptions, - formatContext, - isTypeOnlyLocation, - propertyAccessToConvert, - isJsxIdentifierExpected, - isJsxInitializer, - importStatementCompletion, - recommendedCompletion, - symbolToOriginInfoMap, - symbolToSortTextMap, - isJsxIdentifierExpected, - isRightOfOpenTag, - includeSymbol - ); - if (keywordFilters !== 0 /* None */) { - for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) { - if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !isTypeOnlyLocation && isContextualKeywordInAutoImportableExpressionSpace(keywordEntry.name) || !uniqueNames.has(keywordEntry.name)) { - uniqueNames.add(keywordEntry.name); - insertSorted( - entries, - keywordEntry, - compareCompletionEntries, - /*equalityComparer*/ - void 0, - /*allowDuplicates*/ - true - ); - } - } - } - for (const keywordEntry of getContextualKeywords(contextToken, position)) { - if (!uniqueNames.has(keywordEntry.name)) { - uniqueNames.add(keywordEntry.name); - insertSorted( - entries, - keywordEntry, - compareCompletionEntries, - /*equalityComparer*/ - void 0, - /*allowDuplicates*/ - true - ); - } - } - for (const literal of literals) { - const literalEntry = createCompletionEntryForLiteral(sourceFile, preferences, literal); - uniqueNames.add(literalEntry.name); - insertSorted( - entries, - literalEntry, - compareCompletionEntries, - /*equalityComparer*/ - void 0, - /*allowDuplicates*/ - true - ); - } - if (!isChecked) { - getJSCompletionEntries(sourceFile, location.pos, uniqueNames, getEmitScriptTarget(compilerOptions), entries); - } - let caseBlock; - if (preferences.includeCompletionsWithInsertText && contextToken && !isRightOfOpenTag && !isRightOfDotOrQuestionDot && (caseBlock = findAncestor(contextToken, isCaseBlock))) { - const cases = getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, compilerOptions, host, program, formatContext); - if (cases) { - entries.push(cases.entry); - } - } - return { - flags: completionData.flags, - isGlobalCompletion: isInSnippetScope, - isIncomplete: preferences.allowIncompleteCompletions && hasUnresolvedAutoImports ? true : void 0, - isMemberCompletion: isMemberCompletionKind(completionKind), - isNewIdentifierLocation, - optionalReplacementSpan: getOptionalReplacementSpan(location), - entries, - defaultCommitCharacters: defaultCommitCharacters ?? getDefaultCommitCharacters(isNewIdentifierLocation) - }; -} -function isCheckedFile(sourceFile, compilerOptions) { - return !isSourceFileJS(sourceFile) || !!isCheckJsEnabledForFile(sourceFile, compilerOptions); -} -function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, host, program, formatContext) { - const clauses = caseBlock.clauses; - const checker = program.getTypeChecker(); - const switchType = checker.getTypeAtLocation(caseBlock.parent.expression); - if (switchType && switchType.isUnion() && every(switchType.types, (type) => type.isLiteral())) { - const tracker = newCaseClauseTracker(checker, clauses); - const target = getEmitScriptTarget(options); - const quotePreference = getQuotePreference(sourceFile, preferences); - const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host); - const elements = []; - for (const type of switchType.types) { - if (type.flags & 1024 /* EnumLiteral */) { - Debug.assert(type.symbol, "An enum member type should have a symbol"); - Debug.assert(type.symbol.parent, "An enum member type should have a parent symbol (the enum symbol)"); - const enumValue = type.symbol.valueDeclaration && checker.getConstantValue(type.symbol.valueDeclaration); - if (enumValue !== void 0) { - if (tracker.hasValue(enumValue)) { - continue; - } - tracker.addValue(enumValue); - } - const typeNode = ts_codefix_exports.typeToAutoImportableTypeNode(checker, importAdder, type, caseBlock, target); - if (!typeNode) { - return void 0; - } - const expr = typeNodeToExpression(typeNode, target, quotePreference); - if (!expr) { - return void 0; - } - elements.push(expr); - } else if (!tracker.hasValue(type.value)) { - switch (typeof type.value) { - case "object": - elements.push(type.value.negative ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createBigIntLiteral({ negative: false, base10Value: type.value.base10Value })) : factory.createBigIntLiteral(type.value)); - break; - case "number": - elements.push(type.value < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-type.value)) : factory.createNumericLiteral(type.value)); - break; - case "string": - elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */)); - break; - } - } - } - if (elements.length === 0) { - return void 0; - } - const newClauses = map(elements, (element) => factory.createCaseClause(element, [])); - const newLineChar = getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options); - const printer = createSnippetPrinter({ - removeComments: true, - module: options.module, - moduleResolution: options.moduleResolution, - target: options.target, - newLine: getNewLineKind(newLineChar) - }); - const printNode = formatContext ? (node) => printer.printAndFormatNode(4 /* Unspecified */, node, sourceFile, formatContext) : (node) => printer.printNode(4 /* Unspecified */, node, sourceFile); - const insertText = map(newClauses, (clause, i) => { - if (preferences.includeCompletionsWithSnippetText) { - return `${printNode(clause)}$${i + 1}`; - } - return `${printNode(clause)}`; - }).join(newLineChar); - const firstClause = printer.printNode(4 /* Unspecified */, newClauses[0], sourceFile); - return { - entry: { - name: `${firstClause} ...`, - kind: "" /* unknown */, - sortText: SortText.GlobalsOrKeywords, - insertText, - hasAction: importAdder.hasFixes() || void 0, - source: "SwitchCases/" /* SwitchCases */, - isSnippet: preferences.includeCompletionsWithSnippetText ? true : void 0 - }, - importAdder - }; - } - return void 0; -} -function typeNodeToExpression(typeNode, languageVersion, quotePreference) { - switch (typeNode.kind) { - case 184 /* TypeReference */: - const typeName = typeNode.typeName; - return entityNameToExpression(typeName, languageVersion, quotePreference); - case 200 /* IndexedAccessType */: - const objectExpression = typeNodeToExpression(typeNode.objectType, languageVersion, quotePreference); - const indexExpression = typeNodeToExpression(typeNode.indexType, languageVersion, quotePreference); - return objectExpression && indexExpression && factory.createElementAccessExpression(objectExpression, indexExpression); - case 202 /* LiteralType */: - const literal = typeNode.literal; - switch (literal.kind) { - case 11 /* StringLiteral */: - return factory.createStringLiteral(literal.text, quotePreference === 0 /* Single */); - case 9 /* NumericLiteral */: - return factory.createNumericLiteral(literal.text, literal.numericLiteralFlags); - } - return void 0; - case 197 /* ParenthesizedType */: - const exp = typeNodeToExpression(typeNode.type, languageVersion, quotePreference); - return exp && (isIdentifier(exp) ? exp : factory.createParenthesizedExpression(exp)); - case 187 /* TypeQuery */: - return entityNameToExpression(typeNode.exprName, languageVersion, quotePreference); - case 206 /* ImportType */: - Debug.fail(`We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.`); - } - return void 0; -} -function entityNameToExpression(entityName, languageVersion, quotePreference) { - if (isIdentifier(entityName)) { - return entityName; - } - const unescapedName = unescapeLeadingUnderscores(entityName.right.escapedText); - if (canUsePropertyAccess(unescapedName, languageVersion)) { - return factory.createPropertyAccessExpression( - entityNameToExpression(entityName.left, languageVersion, quotePreference), - unescapedName - ); - } else { - return factory.createElementAccessExpression( - entityNameToExpression(entityName.left, languageVersion, quotePreference), - factory.createStringLiteral(unescapedName, quotePreference === 0 /* Single */) - ); - } -} -function isMemberCompletionKind(kind) { - switch (kind) { - case 0 /* ObjectPropertyDeclaration */: - case 3 /* MemberLike */: - case 2 /* PropertyAccess */: - return true; - default: - return false; - } -} -function getJsxClosingTagCompletion(location, sourceFile) { - const jsxClosingElement = findAncestor(location, (node) => { - switch (node.kind) { - case 288 /* JsxClosingElement */: - return true; - case 31 /* LessThanSlashToken */: - case 32 /* GreaterThanToken */: - case 80 /* Identifier */: - case 212 /* PropertyAccessExpression */: - return false; - default: - return "quit"; - } - }); - if (jsxClosingElement) { - const hasClosingAngleBracket = !!findChildOfKind(jsxClosingElement, 32 /* GreaterThanToken */, sourceFile); - const tagName = jsxClosingElement.parent.openingElement.tagName; - const closingTag = tagName.getText(sourceFile); - const fullClosingTag = closingTag + (hasClosingAngleBracket ? "" : ">"); - const replacementSpan = createTextSpanFromNode(jsxClosingElement.tagName); - const entry = { - name: fullClosingTag, - kind: "class" /* classElement */, - kindModifiers: void 0, - sortText: SortText.LocationPriority - }; - return { - isGlobalCompletion: false, - isMemberCompletion: true, - isNewIdentifierLocation: false, - optionalReplacementSpan: replacementSpan, - entries: [entry], - defaultCommitCharacters: getDefaultCommitCharacters( - /*isNewIdentifierLocation*/ - false - ) - }; - } - return; -} -function getJSCompletionEntries(sourceFile, position, uniqueNames, target, entries) { - getNameTable(sourceFile).forEach((pos, name) => { - if (pos === position) { - return; - } - const realName = unescapeLeadingUnderscores(name); - if (!uniqueNames.has(realName) && isIdentifierText(realName, target)) { - uniqueNames.add(realName); - insertSorted(entries, { - name: realName, - kind: "warning" /* warning */, - kindModifiers: "", - sortText: SortText.JavascriptIdentifiers, - isFromUncheckedFile: true, - commitCharacters: [] - }, compareCompletionEntries); - } - }); -} -function completionNameForLiteral(sourceFile, preferences, literal) { - return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal); -} -function createCompletionEntryForLiteral(sourceFile, preferences, literal) { - return { - name: completionNameForLiteral(sourceFile, preferences, literal), - kind: "string" /* string */, - kindModifiers: "" /* none */, - sortText: SortText.LocationPriority, - commitCharacters: [] - }; -} -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, position); - let data; - let isSnippet; - let source = getSourceFromOrigin(origin); - let sourceDisplay; - let hasAction; - let labelDetails; - const typeChecker = program.getTypeChecker(); - const insertQuestionDot = origin && originIsNullableMember(origin); - const useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess; - if (origin && originIsThisType(origin)) { - insertText = needsConvertPropertyAccess ? `this${insertQuestionDot ? "?." : ""}[${quotePropertyName(sourceFile, preferences, name)}]` : `this${insertQuestionDot ? "?." : "."}${name}`; - } else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) { - insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name)}]` : `[${name}]` : name; - if (insertQuestionDot || propertyAccessToConvert.questionDotToken) { - insertText = `?.${insertText}`; - } - const dot = findChildOfKind(propertyAccessToConvert, 25 /* DotToken */, sourceFile) || findChildOfKind(propertyAccessToConvert, 29 /* QuestionDotToken */, sourceFile); - if (!dot) { - return void 0; - } - const end = startsWith(name, propertyAccessToConvert.name.text) ? propertyAccessToConvert.name.end : dot.end; - replacementSpan = createTextSpanFromBounds(dot.getStart(sourceFile), end); - } - if (isJsxInitializer) { - if (insertText === void 0) insertText = name; - insertText = `{${insertText}}`; - if (typeof isJsxInitializer !== "boolean") { - replacementSpan = createTextSpanFromNode(isJsxInitializer, sourceFile); - } - } - if (origin && originIsPromise(origin) && propertyAccessToConvert) { - if (insertText === void 0) insertText = name; - const precedingToken = findPrecedingToken(propertyAccessToConvert.pos, sourceFile); - let awaitText = ""; - if (precedingToken && positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) { - awaitText = ";"; - } - awaitText += `(await ${propertyAccessToConvert.expression.getText()})`; - insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`; - const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression); - const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression; - replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end); - } - if (originIsResolvedExport(origin)) { - sourceDisplay = [textPart(origin.moduleSpecifier)]; - if (importStatementCompletion) { - ({ insertText, replacementSpan } = getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, program, preferences)); - isSnippet = preferences.includeCompletionsWithSnippetText ? true : void 0; - } - } - 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; - 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()) || memberCompletionEntry.eraseRange) { - hasAction = true; - source = "ClassMemberSnippet/" /* ClassMemberSnippet */; - } - } else { - return void 0; - } - } - if (origin && originIsObjectLiteralMethod(origin)) { - ({ insertText, isSnippet, labelDetails } = origin); - if (!preferences.useLabelDetailsInCompletionEntries) { - name = name + labelDetails.detail; - labelDetails = void 0; - } - source = "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */; - sortText = SortText.SortBelow(sortText); - } - if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location.parent) && location.parent.initializer)) { - let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces"; - const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); - if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) { - if (type.flags & 402653316 /* StringLike */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & (402653316 /* StringLike */ | 32768 /* Undefined */) || isStringAndEmptyAnonymousObjectIntersection(type2)))) { - insertText = `${escapeSnippetText(name)}=${quote(sourceFile, preferences, "$1")}`; - isSnippet = true; - } else { - useBraces2 = true; - } - } - if (useBraces2) { - insertText = `${escapeSnippetText(name)}={$1}`; - isSnippet = true; - } - } - if (insertText !== void 0 && !preferences.includeCompletionsWithInsertText) { - return void 0; - } - if (originIsExport(origin) || originIsResolvedExport(origin)) { - data = originToCompletionEntryData(origin); - hasAction = !importStatementCompletion; - } - const parentNamedImportOrExport = findAncestor(location, isNamedImportsOrExports); - if (parentNamedImportOrExport) { - const languageVersion = getEmitScriptTarget(host.getCompilationSettings()); - if (!isIdentifierText(name, languageVersion)) { - insertText = quotePropertyName(sourceFile, preferences, name); - if (parentNamedImportOrExport.kind === 276 /* NamedImports */) { - scanner.setText(sourceFile.text); - scanner.resetTokenState(position); - if (!(scanner.scan() === 130 /* AsKeyword */ && scanner.scan() === 80 /* Identifier */)) { - insertText += " as " + generateIdentifierForArbitraryString(name, languageVersion); - } - } - } else if (parentNamedImportOrExport.kind === 276 /* NamedImports */) { - const possibleToken = stringToToken(name); - if (possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) { - insertText = `${name} as ${name}_`; - } - } - } - const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location); - const commitCharacters = kind === "warning" /* warning */ || kind === "string" /* string */ ? [] : void 0; - return { - name, - kind, - kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), - sortText, - source, - hasAction: hasAction ? true : void 0, - isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0, - insertText, - filterText, - replacementSpan, - sourceDisplay, - labelDetails, - isSnippet, - isPackageJsonImport: originIsPackageJsonImport(origin) || void 0, - isImportStatementCompletion: !!importStatementCompletion || void 0, - data, - commitCharacters, - ...includeSymbol ? { symbol } : void 0 - }; -} -function generateIdentifierForArbitraryString(text, languageVersion) { - let needsUnderscore = false; - let identifier = ""; - let ch; - for (let i = 0; i < text.length; i += ch !== void 0 && ch >= 65536 ? 2 : 1) { - ch = text.codePointAt(i); - if (ch !== void 0 && (i === 0 ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) { - if (needsUnderscore) identifier += "_"; - identifier += String.fromCodePoint(ch); - needsUnderscore = false; - } else { - needsUnderscore = true; - } - } - if (needsUnderscore) identifier += "_"; - return identifier || "_"; -} -function isClassLikeMemberCompletion(symbol, location, sourceFile) { - if (isInJSFile(location)) { - return false; - } - const memberFlags = 106500 /* ClassMember */ & 900095 /* EnumMemberExcludes */; - return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent)); -} -function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) { - const classLikeDeclaration = findAncestor(location, isClassLike); - if (!classLikeDeclaration) { - return void 0; - } - let isSnippet; - let insertText = name; - const filterText = name; - const checker = program.getTypeChecker(); - const sourceFile = location.getSourceFile(); - const printer = createSnippetPrinter({ - removeComments: true, - module: options.module, - moduleResolution: options.moduleResolution, - target: options.target, - omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) - }); - const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host); - let body; - if (preferences.includeCompletionsWithSnippetText) { - isSnippet = true; - const emptyStmt = factory.createEmptyStatement(); - body = factory.createBlock( - [emptyStmt], - /*multiLine*/ - true - ); - setSnippetElement(emptyStmt, { kind: 0 /* TabStop */, order: 0 }); - } else { - body = factory.createBlock( - [], - /*multiLine*/ - true - ); - } - let modifiers = 0 /* None */; - 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, - sourceFile, - { program, host }, - preferences, - importAdder, - // `addNewNodeForMemberSymbol` calls this callback function for each new member node - // it adds for the given member symbol. - // We store these member nodes in the `completionNodes` array. - // Note: there might be: - // - No nodes if `addNewNodeForMemberSymbol` cannot figure out a node for the member; - // - One node; - // - More than one node if the member is overloaded (e.g. a method with overload signatures). - (node) => { - let requiredModifiers = 0 /* None */; - if (isAbstract) { - requiredModifiers |= 64 /* Abstract */; - } - if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) { - requiredModifiers |= 16 /* Override */; - } - if (!completionNodes.length) { - modifiers = node.modifierFlagsCache | requiredModifiers; - } - node = factory.replaceModifiers(node, modifiers); - completionNodes.push(node); - }, - body, - ts_codefix_exports.PreserveOptionalFlags.Property, - !!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 */; - if (formatContext) { - insertText = printer.printAndFormatSnippetList( - format, - factory.createNodeArray(completionNodes), - sourceFile, - formatContext - ); - } else { - insertText = printer.printSnippetList( - format, - factory.createNodeArray(completionNodes), - sourceFile - ); - } - } - 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 decorators; - let contextMod; - const range = { pos: position, end: position }; - if (isPropertyDeclaration(contextToken.parent) && (contextMod = isModifierLike2(contextToken))) { - if (contextToken.parent.modifiers) { - modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */; - decorators = contextToken.parent.modifiers.filter(isDecorator) || []; - range.pos = Math.min(...contextToken.parent.modifiers.map((n) => n.getStart(sourceFile))); - } - const contextModifierFlag = modifierToFlag(contextMod); - if (!(modifiers & contextModifierFlag)) { - modifiers |= contextModifierFlag; - range.pos = Math.min(range.pos, contextToken.getStart(sourceFile)); - } - if (contextToken.parent.name !== contextToken) { - range.end = contextToken.parent.name.getStart(sourceFile); - } - } - return { modifiers, decorators, range: range.pos < range.end ? range : void 0 }; -} -function isModifierLike2(node) { - if (isModifier(node)) { - return node.kind; - } - if (isIdentifier(node)) { - const originalKeywordKind = identifierToKeywordKind(node); - if (originalKeywordKind && isModifierKind(originalKeywordKind)) { - return originalKeywordKind; - } - } - return void 0; -} -function getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclaration, program, host, options, preferences, formatContext) { - const isSnippet = preferences.includeCompletionsWithSnippetText || void 0; - let insertText = name; - const sourceFile = enclosingDeclaration.getSourceFile(); - const method = createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences); - if (!method) { - return void 0; - } - const printer = createSnippetPrinter({ - removeComments: true, - module: options.module, - moduleResolution: options.moduleResolution, - target: options.target, - omitTrailingSemicolon: false, - newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) - }); - if (formatContext) { - insertText = printer.printAndFormatSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, factory.createNodeArray( - [method], - /*hasTrailingComma*/ - true - ), sourceFile, formatContext); - } else { - insertText = printer.printSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, factory.createNodeArray( - [method], - /*hasTrailingComma*/ - true - ), sourceFile); - } - const signaturePrinter = createPrinter({ - removeComments: true, - module: options.module, - moduleResolution: options.moduleResolution, - target: options.target, - omitTrailingSemicolon: true - }); - const methodSignature = factory.createMethodSignature( - /*modifiers*/ - void 0, - /*name*/ - "", - method.questionToken, - method.typeParameters, - method.parameters, - method.type - ); - const labelDetails = { detail: signaturePrinter.printNode(4 /* Unspecified */, methodSignature, sourceFile) }; - return { isSnippet, insertText, labelDetails }; -} -function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences) { - const declarations = symbol.getDeclarations(); - if (!(declarations && declarations.length)) { - return void 0; - } - const checker = program.getTypeChecker(); - const declaration = declarations[0]; - const name = getSynthesizedDeepClone( - getNameOfDeclaration(declaration), - /*includeTrivia*/ - false - ); - const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); - const quotePreference = getQuotePreference(sourceFile, preferences); - const builderFlags = 33554432 /* OmitThisParameter */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); - switch (declaration.kind) { - case 172 /* PropertySignature */: - case 173 /* PropertyDeclaration */: - case 174 /* MethodSignature */: - case 175 /* 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); - if (functionTypes.length === 1) { - effectiveType = functionTypes[0]; - } else { - return void 0; - } - } - const signatures = checker.getSignaturesOfType(effectiveType, 0 /* Call */); - if (signatures.length !== 1) { - return void 0; - } - const typeNode = checker.typeToTypeNode( - effectiveType, - enclosingDeclaration, - builderFlags, - /*internalFlags*/ - void 0, - ts_codefix_exports.getNoopSymbolTrackerWithResolver({ program, host }) - ); - if (!typeNode || !isFunctionTypeNode(typeNode)) { - return void 0; - } - let body; - if (preferences.includeCompletionsWithSnippetText) { - const emptyStmt = factory.createEmptyStatement(); - body = factory.createBlock( - [emptyStmt], - /*multiLine*/ - true - ); - setSnippetElement(emptyStmt, { kind: 0 /* TabStop */, order: 0 }); - } else { - body = factory.createBlock( - [], - /*multiLine*/ - true - ); - } - 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, - /*asteriskToken*/ - void 0, - name, - /*questionToken*/ - void 0, - /*typeParameters*/ - void 0, - parameters, - /*type*/ - void 0, - body - ); - } - default: - return void 0; - } -} -function createSnippetPrinter(printerOptions) { - let escapes; - const baseWriter = ts_textChanges_exports.createWriter(getNewLineCharacter(printerOptions)); - const printer = createPrinter(printerOptions, baseWriter); - const writer = { - ...baseWriter, - write: (s) => escapingWrite(s, () => baseWriter.write(s)), - nonEscapingWrite: baseWriter.write, - writeLiteral: (s) => escapingWrite(s, () => baseWriter.writeLiteral(s)), - writeStringLiteral: (s) => escapingWrite(s, () => baseWriter.writeStringLiteral(s)), - writeSymbol: (s, symbol) => escapingWrite(s, () => baseWriter.writeSymbol(s, symbol)), - writeParameter: (s) => escapingWrite(s, () => baseWriter.writeParameter(s)), - writeComment: (s) => escapingWrite(s, () => baseWriter.writeComment(s)), - writeProperty: (s) => escapingWrite(s, () => baseWriter.writeProperty(s)) - }; - return { - printSnippetList, - printAndFormatSnippetList, - printNode, - printAndFormatNode - }; - function escapingWrite(s, write) { - const escaped = escapeSnippetText(s); - if (escaped !== s) { - const start = baseWriter.getTextPos(); - write(); - const end = baseWriter.getTextPos(); - escapes = append(escapes || (escapes = []), { newText: escaped, span: { start, length: end - start } }); - } else { - write(); - } - } - function printSnippetList(format, list, sourceFile) { - const unescaped = printUnescapedSnippetList(format, list, sourceFile); - return escapes ? ts_textChanges_exports.applyChanges(unescaped, escapes) : unescaped; - } - function printUnescapedSnippetList(format, list, sourceFile) { - escapes = void 0; - writer.clear(); - printer.writeList(format, list, sourceFile, writer); - return writer.getText(); - } - function printAndFormatSnippetList(format, list, sourceFile, formatContext) { - const syntheticFile = { - text: printUnescapedSnippetList( - format, - list, - sourceFile - ), - getLineAndCharacterOfPosition(pos) { - return getLineAndCharacterOfPosition(this, pos); - } - }; - const formatOptions = getFormatCodeSettingsForWriting(formatContext, sourceFile); - const changes = flatMap(list, (node) => { - const nodeWithPos = ts_textChanges_exports.assignPositionsToNode(node); - return ts_formatting_exports.formatNodeGivenIndentation( - nodeWithPos, - syntheticFile, - sourceFile.languageVariant, - /* indentation */ - 0, - /* delta */ - 0, - { ...formatContext, options: formatOptions } - ); - }); - const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes; - return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges); - } - function printNode(hint, node, sourceFile) { - const unescaped = printUnescapedNode(hint, node, sourceFile); - return escapes ? ts_textChanges_exports.applyChanges(unescaped, escapes) : unescaped; - } - function printUnescapedNode(hint, node, sourceFile) { - escapes = void 0; - writer.clear(); - printer.writeNode(hint, node, sourceFile, writer); - return writer.getText(); - } - function printAndFormatNode(hint, node, sourceFile, formatContext) { - const syntheticFile = { - text: printUnescapedNode( - hint, - node, - sourceFile - ), - getLineAndCharacterOfPosition(pos) { - return getLineAndCharacterOfPosition(this, pos); - } - }; - const formatOptions = getFormatCodeSettingsForWriting(formatContext, sourceFile); - const nodeWithPos = ts_textChanges_exports.assignPositionsToNode(node); - const changes = ts_formatting_exports.formatNodeGivenIndentation( - nodeWithPos, - syntheticFile, - sourceFile.languageVariant, - /* indentation */ - 0, - /* delta */ - 0, - { ...formatContext, options: formatOptions } - ); - const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes; - return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges); - } -} -function originToCompletionEntryData(origin) { - const ambientModuleName = origin.fileName ? void 0 : stripQuotes(origin.moduleSymbol.name); - const isPackageJsonImport = origin.isFromPackageJson ? true : void 0; - if (originIsResolvedExport(origin)) { - const resolvedData = { - exportName: origin.exportName, - exportMapKey: origin.exportMapKey, - moduleSpecifier: origin.moduleSpecifier, - ambientModuleName, - fileName: origin.fileName, - isPackageJsonImport - }; - return resolvedData; - } - const unresolvedData = { - exportName: origin.exportName, - exportMapKey: origin.exportMapKey, - fileName: origin.fileName, - ambientModuleName: origin.fileName ? void 0 : stripQuotes(origin.moduleSymbol.name), - isPackageJsonImport: origin.isFromPackageJson ? true : void 0 - }; - return unresolvedData; -} -function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbol) { - const isDefaultExport = data.exportName === "default" /* Default */; - const isFromPackageJson = !!data.isPackageJsonImport; - if (completionEntryDataIsResolved(data)) { - const resolvedOrigin = { - kind: 32 /* ResolvedExport */, - exportName: data.exportName, - exportMapKey: data.exportMapKey, - moduleSpecifier: data.moduleSpecifier, - symbolName: completionName, - fileName: data.fileName, - moduleSymbol, - isDefaultExport, - isFromPackageJson - }; - return resolvedOrigin; - } - const unresolvedOrigin = { - kind: 4 /* Export */, - exportName: data.exportName, - exportMapKey: data.exportMapKey, - symbolName: completionName, - fileName: data.fileName, - moduleSymbol, - isDefaultExport, - isFromPackageJson - }; - return unresolvedOrigin; -} -function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, program, preferences) { - const replacementSpan = importStatementCompletion.replacementSpan; - const quotedModuleSpecifier = escapeSnippetText(quote(sourceFile, preferences, origin.moduleSpecifier)); - const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */; - const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : ""; - const importKind = ts_codefix_exports.getImportKind( - sourceFile, - exportKind, - program, - /*forceImportKeyword*/ - true - ); - const isImportSpecifierTypeOnly = importStatementCompletion.couldBeTypeOnlyImportSpecifier; - const topLevelTypeOnlyText = importStatementCompletion.isTopLevelTypeOnly ? ` ${tokenToString(156 /* TypeKeyword */)} ` : " "; - const importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? `${tokenToString(156 /* TypeKeyword */)} ` : ""; - const suffix = useSemicolons ? ";" : ""; - switch (importKind) { - case 3 /* CommonJS */: - return { replacementSpan, insertText: `import${topLevelTypeOnlyText}${escapeSnippetText(name)}${tabStop} = require(${quotedModuleSpecifier})${suffix}` }; - case 1 /* Default */: - return { replacementSpan, insertText: `import${topLevelTypeOnlyText}${escapeSnippetText(name)}${tabStop} from ${quotedModuleSpecifier}${suffix}` }; - case 2 /* Namespace */: - return { replacementSpan, insertText: `import${topLevelTypeOnlyText}* as ${escapeSnippetText(name)} from ${quotedModuleSpecifier}${suffix}` }; - case 0 /* Named */: - return { replacementSpan, insertText: `import${topLevelTypeOnlyText}{ ${importSpecifierTypeOnlyText}${escapeSnippetText(name)}${tabStop} } from ${quotedModuleSpecifier}${suffix}` }; - } -} -function quotePropertyName(sourceFile, preferences, name) { - if (/^\d+$/.test(name)) { - return name; - } - return quote(sourceFile, preferences, name); -} -function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { - return localSymbol === recommendedCompletion || !!(localSymbol.flags & 1048576 /* ExportValue */) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion; -} -function getSourceFromOrigin(origin) { - if (originIsExport(origin)) { - return stripQuotes(origin.moduleSymbol.name); - } - if (originIsResolvedExport(origin)) { - return origin.moduleSpecifier; - } - if ((origin == null ? void 0 : origin.kind) === 1 /* ThisType */) { - return "ThisProperty/" /* ThisProperty */; - } - if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) { - return "TypeOnlyAlias/" /* TypeOnlyAlias */; - } -} -function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) { - const start = timestamp(); - const closestSymbolDeclaration = getClosestSymbolDeclaration(contextToken, location); - const useSemicolons = probablyUsesSemicolons(sourceFile); - const typeChecker = program.getTypeChecker(); - const uniques = /* @__PURE__ */ new Map(); - for (let i = 0; i < symbols.length; i++) { - const symbol = symbols[i]; - const origin = symbolToOriginInfoMap == null ? void 0 : symbolToOriginInfoMap[i]; - const info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected); - 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; - const entry = createCompletionEntry( - symbol, - sortText, - replacementToken, - contextToken, - location, - position, - sourceFile, - host, - program, - name, - needsConvertPropertyAccess, - origin, - recommendedCompletion, - propertyAccessToConvert, - isJsxInitializer, - importStatementCompletion, - useSemicolons, - compilerOptions, - preferences, - kind, - formatContext, - isJsxIdentifierExpected, - isRightOfOpenTag, - includeSymbol - ); - if (!entry) { - continue; - } - const shouldShadowLaterSymbols = (!origin || originIsTypeOnlyAlias(origin)) && !(symbol.parent === void 0 && !some(symbol.declarations, (d) => d.getSourceFile() === location.getSourceFile())); - uniques.set(name, shouldShadowLaterSymbols); - insertSorted( - entries, - entry, - compareCompletionEntries, - /*equalityComparer*/ - void 0, - /*allowDuplicates*/ - true - ); - } - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (timestamp() - start)); - return { - has: (name) => uniques.has(name), - add: (name) => uniques.set(name, true) - }; - function shouldIncludeSymbol(symbol, symbolToSortTextMap2) { - var _a; - let allFlags = symbol.flags; - if (location.parent && isExportAssignment(location.parent)) { - return true; - } - if (closestSymbolDeclaration && tryCast(closestSymbolDeclaration, isVariableDeclaration)) { - if (symbol.valueDeclaration === closestSymbolDeclaration) { - return false; - } - if (isBindingPattern(closestSymbolDeclaration.name) && closestSymbolDeclaration.name.elements.some((e) => e === symbol.valueDeclaration)) { - return false; - } - } - const symbolDeclaration = symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); - if (closestSymbolDeclaration && symbolDeclaration) { - if (isParameter(closestSymbolDeclaration) && isParameter(symbolDeclaration)) { - const parameters = closestSymbolDeclaration.parent.parameters; - if (symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < parameters.end) { - return false; - } - } else if (isTypeParameterDeclaration(closestSymbolDeclaration) && isTypeParameterDeclaration(symbolDeclaration)) { - if (closestSymbolDeclaration === symbolDeclaration && (contextToken == null ? void 0 : contextToken.kind) === 96 /* ExtendsKeyword */) { - return false; - } - if (isInTypeParameterDefault(contextToken) && !isInferTypeNode(closestSymbolDeclaration.parent)) { - const typeParameters = closestSymbolDeclaration.parent.typeParameters; - if (typeParameters && symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < typeParameters.end) { - return false; - } - } - } - } - const symbolOrigin = skipAlias(symbol, typeChecker); - if (!!sourceFile.externalModuleIndicator && !compilerOptions.allowUmdGlobalAccess && symbolToSortTextMap2[getSymbolId(symbol)] === SortText.GlobalsOrKeywords && (symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.AutoImportSuggestions || symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.LocationPriority)) { - return false; - } - allFlags |= getCombinedLocalAndExportSymbolFlags(symbolOrigin); - if (isInRightSideOfInternalImportEqualsDeclaration(location)) { - return !!(allFlags & 1920 /* Namespace */); - } - if (isTypeOnlyLocation) { - return symbolCanBeReferencedAtTypeLocation(symbol, typeChecker); - } - return !!(allFlags & 111551 /* Value */); - } - function symbolAppearsToBeTypeOnly(symbol) { - var _a; - const flags = getCombinedLocalAndExportSymbolFlags(skipAlias(symbol, typeChecker)); - return !(flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(flags & 788968 /* Type */)); - } -} -function getLabelCompletionAtPosition(node) { - const entries = getLabelStatementCompletions(node); - if (entries.length) { - return { - isGlobalCompletion: false, - isMemberCompletion: false, - isNewIdentifierLocation: false, - entries, - defaultCommitCharacters: getDefaultCommitCharacters( - /*isNewIdentifierLocation*/ - false - ) - }; - } -} -function getLabelStatementCompletions(node) { - const entries = []; - const uniques = /* @__PURE__ */ new Map(); - let current = node; - while (current) { - if (isFunctionLike(current)) { - break; - } - if (isLabeledStatement(current)) { - const name = current.label.text; - if (!uniques.has(name)) { - uniques.set(name, true); - entries.push({ - name, - kindModifiers: "" /* none */, - kind: "label" /* label */, - sortText: SortText.LocationPriority - }); - } - } - current = current.parent; - } - return entries; -} -function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences) { - if (entryId.source === "SwitchCases/" /* SwitchCases */) { - return { type: "cases" }; - } - if (entryId.data) { - const autoImport = getAutoImportSymbolFromCompletionEntryData(entryId.name, entryId.data, program, host); - if (autoImport) { - const { contextToken: contextToken2, previousToken: previousToken2 } = getRelevantTokens(position, sourceFile); - return { - type: "symbol", - symbol: autoImport.symbol, - location: getTouchingPropertyName(sourceFile, position), - previousToken: previousToken2, - contextToken: contextToken2, - isJsxInitializer: false, - isTypeOnlyLocation: false, - origin: autoImport.origin - }; - } - } - const compilerOptions = program.getCompilerOptions(); - const completionData = getCompletionData( - program, - log, - sourceFile, - compilerOptions, - position, - { includeCompletionsForModuleExports: true, includeCompletionsWithInsertText: true }, - entryId, - host, - /*formatContext*/ - void 0 - ); - if (!completionData) { - return { type: "none" }; - } - if (completionData.kind !== 0 /* Data */) { - return { type: "request", request: completionData }; - } - const { symbols, literals, location, completionKind, symbolToOriginInfoMap, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } = completionData; - const literal = find(literals, (l) => completionNameForLiteral(sourceFile, preferences, l) === entryId.name); - if (literal !== void 0) return { type: "literal", literal }; - 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 || 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) { - const typeChecker = program.getTypeChecker(); - const compilerOptions = program.getCompilerOptions(); - 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, program, host, cancellationToken, preferences); - } - const symbolCompletion = getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences); - switch (symbolCompletion.type) { - case "request": { - const { request } = symbolCompletion; - switch (request.kind) { - case 1 /* JsDocTagName */: - return ts_JsDoc_exports.getJSDocTagNameCompletionDetails(name); - case 2 /* JsDocTag */: - return ts_JsDoc_exports.getJSDocTagCompletionDetails(name); - case 3 /* JsDocParameterName */: - return ts_JsDoc_exports.getJSDocParameterNameCompletionDetails(name); - case 4 /* Keywords */: - return some(request.keywordCompletions, (c) => c.name === name) ? createSimpleDetails(name, "keyword" /* keyword */, 5 /* keyword */) : void 0; - default: - return Debug.assertNever(request); - } - } - case "symbol": { - const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion; - const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken); - const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name; - return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); - } - case "literal": { - const { literal } = symbolCompletion; - return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? 8 /* stringLiteral */ : 7 /* numericLiteral */); - } - case "cases": { - const snippets = getExhaustiveCaseSnippets( - contextToken.parent, - sourceFile, - preferences, - program.getCompilerOptions(), - host, - program, - /*formatContext*/ - void 0 - ); - if (snippets == null ? void 0 : snippets.importAdder.hasFixes()) { - const { entry, importAdder } = snippets; - const changes = ts_textChanges_exports.ChangeTracker.with( - { host, formatContext, preferences }, - importAdder.writeFixes - ); - return { - name: entry.name, - kind: "" /* unknown */, - kindModifiers: "", - displayParts: [], - sourceDisplay: void 0, - codeActions: [{ - changes, - description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name]) - }] - }; - } - return { - name, - kind: "" /* unknown */, - kindModifiers: "", - displayParts: [], - sourceDisplay: void 0 - }; - } - case "none": - return allKeywordsCompletions().some((c) => c.name === name) ? createSimpleDetails(name, "keyword" /* keyword */, 5 /* keyword */) : void 0; - default: - Debug.assertNever(symbolCompletion); - } -} -function createSimpleDetails(name, kind, kind2) { - 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 */)); - 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) { - return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source }; -} -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, sourceFile).replacementSpan) { - return { codeActions: void 0, sourceDisplay: [textPart(data.moduleSpecifier)] }; - } - } - if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) { - const { importAdder, eraseRange } = getEntryForMemberCompletion( - host, - program, - compilerOptions, - preferences, - name, - symbol, - location, - position, - contextToken, - formatContext - ); - if ((importAdder == null ? void 0 : importAdder.hasFixes()) || eraseRange) { - const changes = ts_textChanges_exports.ChangeTracker.with( - { host, formatContext, preferences }, - (tracker) => { - if (importAdder) { - importAdder.writeFixes(tracker); - } - if (eraseRange) { - tracker.deleteRange(sourceFile, eraseRange); - } - } - ); - return { - sourceDisplay: void 0, - codeActions: [{ - changes, - description: (importAdder == null ? void 0 : importAdder.hasFixes()) ? diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name]) : diagnosticToString([Diagnostics.Update_modifiers_of_0, name]) - }] - }; - } - } - if (originIsTypeOnlyAlias(origin)) { - const codeAction2 = ts_codefix_exports.getPromoteTypeOnlyCompletionAction( - sourceFile, - origin.declaration.name, - program, - host, - formatContext, - preferences - ); - 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 }; - } - const checker = origin.isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker(); - const { moduleSymbol } = origin; - const targetSymbol = checker.getMergedSymbol(skipAlias(symbol.exportSymbol || symbol, checker)); - const isJsxOpeningTagName = (contextToken == null ? void 0 : contextToken.kind) === 30 /* LessThanToken */ && isJsxOpeningLikeElement(contextToken.parent); - const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction( - targetSymbol, - moduleSymbol, - data == null ? void 0 : data.exportMapKey, - sourceFile, - name, - isJsxOpeningTagName, - host, - program, - formatContext, - previousToken && isIdentifier(previousToken) ? previousToken.getStart(sourceFile) : position, - preferences, - cancellationToken - ); - Debug.assert(!(data == null ? void 0 : data.moduleSpecifier) || moduleSpecifier === data.moduleSpecifier); - return { sourceDisplay: [textPart(moduleSpecifier)], codeActions: [codeAction] }; -} -function getCompletionEntrySymbol(program, log, sourceFile, position, entryId, host, preferences) { - const completion = getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences); - return completion.type === "symbol" ? completion.symbol : void 0; -} -var CompletionKind = /* @__PURE__ */ ((CompletionKind2) => { - CompletionKind2[CompletionKind2["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; - CompletionKind2[CompletionKind2["Global"] = 1] = "Global"; - CompletionKind2[CompletionKind2["PropertyAccess"] = 2] = "PropertyAccess"; - CompletionKind2[CompletionKind2["MemberLike"] = 3] = "MemberLike"; - CompletionKind2[CompletionKind2["String"] = 4] = "String"; - CompletionKind2[CompletionKind2["None"] = 5] = "None"; - return CompletionKind2; -})(CompletionKind || {}); -function getRecommendedCompletion(previousToken, contextualType, checker) { - return firstDefined(contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), (type) => { - const symbol = type && type.symbol; - return symbol && (symbol.flags & (8 /* EnumMember */ | 384 /* Enum */ | 32 /* Class */) && !isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, previousToken, checker) : void 0; - }); -} -function getContextualType(previousToken, position, sourceFile, checker) { - const { parent: parent2 } = previousToken; - switch (previousToken.kind) { - case 80 /* Identifier */: - return getContextualTypeFromParent(previousToken, checker); - case 64 /* EqualsToken */: - switch (parent2.kind) { - case 261 /* VariableDeclaration */: - return checker.getContextualType(parent2.initializer); - // TODO: GH#18217 - case 227 /* BinaryExpression */: - return checker.getTypeAtLocation(parent2.left); - case 292 /* JsxAttribute */: - return checker.getContextualTypeForJsxAttribute(parent2); - default: - return void 0; - } - case 105 /* NewKeyword */: - return checker.getContextualType(parent2); - case 84 /* CaseKeyword */: - const caseClause = tryCast(parent2, isCaseClause); - return caseClause ? getSwitchedType(caseClause, checker) : void 0; - 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, checker); - return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? ( - // completion at `x ===/**/` should be for the right side - checker.getTypeAtLocation(parent2.left) - ) : checker.getContextualType(previousToken, 4 /* Completions */) || checker.getContextualType(previousToken); - } -} -function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { - const chain = checker.getAccessibleSymbolChain( - symbol, - enclosingDeclaration, - /*meaning*/ - -1 /* All */, - /*useOnlyExternalAliasing*/ - false - ); - if (chain) return first(chain); - return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); -} -function isModuleSymbol(symbol) { - var _a; - return !!((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d.kind === 308 /* SourceFile */)); -} -function getCompletionData(program, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) { - const typeChecker = program.getTypeChecker(); - const inCheckedFile = isCheckedFile(sourceFile, compilerOptions); - let start = timestamp(); - let currentToken = getTokenAtPosition(sourceFile, position); - log("getCompletionData: Get current token: " + (timestamp() - start)); - start = timestamp(); - const insideComment = isInComment(sourceFile, position, currentToken); - log("getCompletionData: Is inside comment: " + (timestamp() - start)); - let insideJsDocTagTypeExpression = false; - let insideJsDocImportTag = false; - let isInSnippetScope = false; - if (insideComment) { - if (hasDocComment(sourceFile, position)) { - if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { - return { kind: 1 /* JsDocTagName */ }; - } else { - const lineStart = getLineStartPositionForPosition(position, sourceFile); - if (!/[^*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) { - return { kind: 2 /* JsDocTag */ }; - } - } - } - const tag = getJsDocTagAtPosition(currentToken, position); - if (tag) { - if (tag.tagName.pos <= position && position <= tag.tagName.end) { - return { kind: 1 /* JsDocTagName */ }; - } - if (isJSDocImportTag(tag)) { - insideJsDocImportTag = true; - } else { - const typeExpression = tryGetTypeExpressionFromTag(tag); - if (typeExpression) { - currentToken = getTokenAtPosition(sourceFile, position); - if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 349 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) { - insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression); - } - } - if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) { - return { kind: 3 /* JsDocParameterName */, tag }; - } - } - } - if (!insideJsDocTagTypeExpression && !insideJsDocImportTag) { - log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); - return void 0; - } - } - start = timestamp(); - const isJsOnlyLocation = !insideJsDocTagTypeExpression && !insideJsDocImportTag && isSourceFileJS(sourceFile); - const tokens = getRelevantTokens(position, sourceFile); - const previousToken = tokens.previousToken; - let contextToken = tokens.contextToken; - log("getCompletionData: Get previous token: " + (timestamp() - start)); - let node = currentToken; - let propertyAccessToConvert; - let isRightOfDot = false; - let isRightOfQuestionDot = false; - let isRightOfOpenTag = false; - let isStartingCloseTag = false; - let isJsxInitializer = false; - let isJsxIdentifierExpected = false; - let importStatementCompletion; - let location = getTouchingPropertyName(sourceFile, position); - let keywordFilters = 0 /* None */; - let isNewIdentifierLocation = false; - let flags = 0 /* None */; - let defaultCommitCharacters; - if (contextToken) { - const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile); - if (importStatementCompletionInfo.keywordCompletion) { - if (importStatementCompletionInfo.isKeywordOnlyCompletion) { - return { - kind: 4 /* Keywords */, - keywordCompletions: [keywordToCompletionEntry(importStatementCompletionInfo.keywordCompletion)], - isNewIdentifierLocation: importStatementCompletionInfo.isNewIdentifierLocation - }; - } - keywordFilters = keywordFiltersFromSyntaxKind(importStatementCompletionInfo.keywordCompletion); - } - if (importStatementCompletionInfo.replacementSpan && preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) { - flags |= 2 /* IsImportStatementCompletion */; - importStatementCompletion = importStatementCompletionInfo; - isNewIdentifierLocation = importStatementCompletionInfo.isNewIdentifierLocation; - } - if (!importStatementCompletionInfo.replacementSpan && isCompletionListBlocker(contextToken)) { - log("Returning an empty list because completion was requested in an invalid position."); - return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, computeCommitCharactersAndIsNewIdentifier().isNewIdentifierLocation) : void 0; - } - let parent2 = contextToken.parent; - if (contextToken.kind === 25 /* DotToken */ || contextToken.kind === 29 /* QuestionDotToken */) { - isRightOfDot = contextToken.kind === 25 /* DotToken */; - isRightOfQuestionDot = contextToken.kind === 29 /* QuestionDotToken */; - switch (parent2.kind) { - case 212 /* PropertyAccessExpression */: - propertyAccessToConvert = parent2; - node = propertyAccessToConvert.expression; - const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert); - if (nodeIsMissing(leftmostAccessExpression) || (isCallExpression(node) || isFunctionLike(node)) && node.end === contextToken.pos && node.getChildCount(sourceFile) && last(node.getChildren(sourceFile)).kind !== 22 /* CloseParenToken */) { - return void 0; - } - break; - case 167 /* QualifiedName */: - node = parent2.left; - break; - case 268 /* ModuleDeclaration */: - node = parent2.name; - break; - case 206 /* ImportType */: - node = parent2; - break; - case 237 /* MetaProperty */: - node = parent2.getFirstToken(sourceFile); - Debug.assert(node.kind === 102 /* ImportKeyword */ || node.kind === 105 /* NewKeyword */); - break; - default: - return void 0; - } - } else if (!importStatementCompletion) { - if (parent2 && parent2.kind === 212 /* PropertyAccessExpression */) { - contextToken = parent2; - parent2 = parent2.parent; - } - if (currentToken.parent === location) { - switch (currentToken.kind) { - case 32 /* GreaterThanToken */: - if (currentToken.parent.kind === 285 /* JsxElement */ || currentToken.parent.kind === 287 /* JsxOpeningElement */) { - location = currentToken; - } - break; - case 31 /* LessThanSlashToken */: - if (currentToken.parent.kind === 286 /* JsxSelfClosingElement */) { - location = currentToken; - } - break; - } - } - switch (parent2.kind) { - case 288 /* JsxClosingElement */: - if (contextToken.kind === 31 /* LessThanSlashToken */) { - isStartingCloseTag = true; - location = contextToken; - } - break; - case 227 /* BinaryExpression */: - if (!binaryExpressionMayBeOpenTag(parent2)) { - break; - } - // falls through - case 286 /* JsxSelfClosingElement */: - case 285 /* JsxElement */: - case 287 /* JsxOpeningElement */: - isJsxIdentifierExpected = true; - if (contextToken.kind === 30 /* LessThanToken */) { - isRightOfOpenTag = true; - location = contextToken; - } - break; - case 295 /* JsxExpression */: - case 294 /* JsxSpreadAttribute */: - if (previousToken.kind === 20 /* CloseBraceToken */ || previousToken.kind === 80 /* Identifier */ && previousToken.parent.kind === 292 /* JsxAttribute */) { - isJsxIdentifierExpected = true; - } - break; - case 292 /* JsxAttribute */: - if (parent2.initializer === previousToken && previousToken.end < position) { - isJsxIdentifierExpected = true; - break; - } - switch (previousToken.kind) { - case 64 /* EqualsToken */: - isJsxInitializer = true; - break; - case 80 /* Identifier */: - isJsxIdentifierExpected = true; - if (parent2 !== previousToken.parent && !parent2.initializer && findChildOfKind(parent2, 64 /* EqualsToken */, sourceFile)) { - isJsxInitializer = previousToken; - } - } - break; - } - } - } - const semanticStart = timestamp(); - let completionKind = 5 /* None */; - let hasUnresolvedAutoImports = false; - let symbols = []; - let importSpecifierResolver; - const symbolToOriginInfoMap = []; - const symbolToSortTextMap = []; - const seenPropertySymbols = /* @__PURE__ */ new Set(); - const isTypeOnlyLocation = isTypeOnlyCompletion(); - const getModuleSpecifierResolutionHost = memoizeOne((isFromPackageJson) => { - return createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host); - }); - if (isRightOfDot || isRightOfQuestionDot) { - getTypeScriptMemberSymbols(); - } else if (isRightOfOpenTag) { - symbols = typeChecker.getJsxIntrinsicTagNamesAt(location); - Debug.assertEachIsDefined(symbols, "getJsxIntrinsicTagNames() should all be defined"); - tryGetGlobalSymbols(); - completionKind = 1 /* Global */; - keywordFilters = 0 /* None */; - } else if (isStartingCloseTag) { - const tagName = contextToken.parent.parent.openingElement.tagName; - const tagSymbol = typeChecker.getSymbolAtLocation(tagName); - if (tagSymbol) { - symbols = [tagSymbol]; - } - completionKind = 1 /* Global */; - keywordFilters = 0 /* None */; - } else { - if (!tryGetGlobalSymbols()) { - return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierLocation) : void 0; - } - } - log("getCompletionData: Semantic work: " + (timestamp() - semanticStart)); - const contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker); - const isLiteralExpected = !tryCast(previousToken, isStringLiteralLike) && !isJsxIdentifierExpected; - const literals = !isLiteralExpected ? [] : mapDefined( - contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), - (t) => t.isLiteral() && !(t.flags & 1024 /* EnumLiteral */) ? t.value : void 0 - ); - const recommendedCompletion = previousToken && contextualType && getRecommendedCompletion(previousToken, contextualType, typeChecker); - return { - kind: 0 /* Data */, - symbols, - completionKind, - isInSnippetScope, - propertyAccessToConvert, - isNewIdentifierLocation, - location, - keywordFilters, - literals, - symbolToOriginInfoMap, - recommendedCompletion, - previousToken, - contextToken, - isJsxInitializer, - insideJsDocTagTypeExpression, - symbolToSortTextMap, - isTypeOnlyLocation, - isJsxIdentifierExpected, - isRightOfOpenTag, - isRightOfDotOrQuestionDot: isRightOfDot || isRightOfQuestionDot, - importStatementCompletion, - hasUnresolvedAutoImports, - flags, - defaultCommitCharacters - }; - function isTagWithTypeExpression(tag) { - switch (tag.kind) { - case 342 /* JSDocParameterTag */: - case 349 /* JSDocPropertyTag */: - case 343 /* JSDocReturnTag */: - case 345 /* JSDocTypeTag */: - case 347 /* JSDocTypedefTag */: - case 350 /* JSDocThrowsTag */: - case 351 /* JSDocSatisfiesTag */: - return true; - case 346 /* JSDocTemplateTag */: - return !!tag.constraint; - default: - return false; - } - } - function tryGetTypeExpressionFromTag(tag) { - if (isTagWithTypeExpression(tag)) { - const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression; - return typeExpression && typeExpression.kind === 310 /* JSDocTypeExpression */ ? typeExpression : void 0; - } - if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) { - return tag.class; - } - return void 0; - } - function getTypeScriptMemberSymbols() { - completionKind = 2 /* PropertyAccess */; - const isImportType = isLiteralImportTypeNode(node); - const isTypeLocation = isImportType && !node.isTypeOf || isPartOfTypeNode(node.parent) || isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); - const isRhsOfImportDeclaration = isInRightSideOfInternalImportEqualsDeclaration(node); - if (isEntityName(node) || isImportType || isPropertyAccessExpression(node)) { - const isNamespaceName = isModuleDeclaration(node.parent); - if (isNamespaceName) { - isNewIdentifierLocation = true; - defaultCommitCharacters = []; - } - let symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - symbol = skipAlias(symbol, typeChecker); - if (symbol.flags & (1536 /* Module */ | 384 /* Enum */)) { - const exportedSymbols = typeChecker.getExportsOfModule(symbol); - Debug.assertEachIsDefined(exportedSymbols, "getExportsOfModule() should all be defined"); - const isValidValueAccess = (symbol2) => typeChecker.isValidPropertyAccess(isImportType ? node : node.parent, symbol2.name); - const isValidTypeAccess = (symbol2) => symbolCanBeReferencedAtTypeLocation(symbol2, typeChecker); - const isValidAccess = isNamespaceName ? (symbol2) => { - var _a; - return !!(symbol2.flags & 1920 /* Namespace */) && !((_a = symbol2.declarations) == null ? void 0 : _a.every((d) => d.parent === node.parent)); - } : isRhsOfImportDeclaration ? ( - // Any kind is allowed when dotting off namespace in internal import equals declaration - (symbol2) => isValidTypeAccess(symbol2) || isValidValueAccess(symbol2) - ) : isTypeLocation || insideJsDocTagTypeExpression ? isValidTypeAccess : isValidValueAccess; - for (const exportedSymbol of exportedSymbols) { - if (isValidAccess(exportedSymbol)) { - symbols.push(exportedSymbol); - } - } - if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 308 /* SourceFile */ && d.kind !== 268 /* ModuleDeclaration */ && d.kind !== 267 /* EnumDeclaration */)) { - let type = typeChecker.getTypeOfSymbolAtLocation(symbol, 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; - } - } - } - addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot); - } - return; - } - } - } - if (!isTypeLocation || isInTypeQuery(node)) { - typeChecker.tryGetThisTypeAt( - node, - /*includeGlobalThis*/ - false - ); - let type = typeChecker.getTypeAtLocation(node).getNonOptionalType(); - 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 - ); - } - } - } - function addTypeProperties(type, insertAwait, insertQuestionDot) { - if (type.getStringIndexType()) { - isNewIdentifierLocation = true; - defaultCommitCharacters = []; - } - if (isRightOfQuestionDot && some(type.getCallSignatures())) { - isNewIdentifierLocation = true; - defaultCommitCharacters ?? (defaultCommitCharacters = allCommitCharacters); - } - const propertyAccess = node.kind === 206 /* ImportType */ ? node : node.parent; - if (inCheckedFile) { - for (const symbol of type.getApparentProperties()) { - if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { - addPropertySymbol( - symbol, - /*insertAwait*/ - false, - insertQuestionDot - ); - } - } - } else { - symbols.push(...filter(getPropertiesForCompletion(type, typeChecker), (s) => typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, s))); - } - if (insertAwait && preferences.includeCompletionsWithInsertText) { - const promiseType = typeChecker.getPromisedTypeOfPromise(type); - if (promiseType) { - for (const symbol of promiseType.getApparentProperties()) { - if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, promiseType, symbol)) { - addPropertySymbol( - symbol, - /*insertAwait*/ - true, - insertQuestionDot - ); - } - } - } - } - } - function addPropertySymbol(symbol, insertAwait, insertQuestionDot) { - var _a; - const computedPropertyName = firstDefined(symbol.declarations, (decl) => tryCast(getNameOfDeclaration(decl), isComputedPropertyName)); - if (computedPropertyName) { - const leftMostName = getLeftMostName(computedPropertyName.expression); - const nameSymbol = leftMostName && typeChecker.getSymbolAtLocation(leftMostName); - const firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker); - const firstAccessibleSymbolId = firstAccessibleSymbol && getSymbolId(firstAccessibleSymbol); - if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) { - const index = symbols.length; - symbols.push(firstAccessibleSymbol); - symbolToSortTextMap[getSymbolId(firstAccessibleSymbol)] = SortText.GlobalsOrKeywords; - const moduleSymbol = firstAccessibleSymbol.parent; - if (!moduleSymbol || !isExternalModuleSymbol(moduleSymbol) || typeChecker.tryGetMemberInModuleExportsAndProperties(firstAccessibleSymbol.name, moduleSymbol) !== firstAccessibleSymbol) { - 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) - ) || {}; - if (moduleSpecifier) { - const origin = { - kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */), - moduleSymbol, - isDefaultExport: false, - symbolName: firstAccessibleSymbol.name, - exportName: firstAccessibleSymbol.name, - fileName, - moduleSpecifier - }; - symbolToOriginInfoMap[index] = origin; - } - } - } else if (preferences.includeCompletionsWithInsertText) { - if (firstAccessibleSymbolId && seenPropertySymbols.has(firstAccessibleSymbolId)) { - return; - } - addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); - symbols.push(symbol); - } - } else { - addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); - symbols.push(symbol); - } - function addSymbolSortInfo(symbol2) { - if (isStaticProperty(symbol2)) { - symbolToSortTextMap[getSymbolId(symbol2)] = SortText.LocalDeclarationPriority; - } - } - function addSymbolOriginInfo(symbol2) { - if (preferences.includeCompletionsWithInsertText) { - if (insertAwait && addToSeen(seenPropertySymbols, getSymbolId(symbol2))) { - symbolToOriginInfoMap[symbols.length] = { kind: getNullableSymbolOriginInfoKind(8 /* Promise */) }; - } else if (insertQuestionDot) { - symbolToOriginInfoMap[symbols.length] = { kind: 16 /* Nullable */ }; - } - } - } - function getNullableSymbolOriginInfoKind(kind) { - return insertQuestionDot ? kind | 16 /* Nullable */ : kind; - } - } - function getLeftMostName(e) { - return isIdentifier(e) ? e : isPropertyAccessExpression(e) ? getLeftMostName(e.expression) : void 0; - } - function tryGetGlobalSymbols() { - const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetImportAttributesCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */); - return result === 1 /* Success */; - } - function tryGetConstructorCompletion() { - if (!tryGetConstructorLikeCompletionContainer(contextToken)) return 0 /* Continue */; - completionKind = 5 /* None */; - isNewIdentifierLocation = true; - keywordFilters = 4 /* ConstructorParameterKeywords */; - return 1 /* Success */; - } - function tryGetJsxCompletionSymbols() { - const jsxContainer = tryGetContainingJsxElement(contextToken); - const attrsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes); - if (!attrsType) return 0 /* Continue */; - const completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, 4 /* Completions */); - symbols = concatenate(symbols, filterJsxAttributes(getPropertiesForObjectExpression(attrsType, completionsType, jsxContainer.attributes, typeChecker), jsxContainer.attributes.properties)); - setSortTextToOptionalMember(); - completionKind = 3 /* MemberLike */; - isNewIdentifierLocation = false; - return 1 /* Success */; - } - function tryGetImportCompletionSymbols() { - if (!importStatementCompletion) return 0 /* Continue */; - isNewIdentifierLocation = true; - collectAutoImports(); - return 1 /* Success */; - } - function getGlobalCompletions() { - keywordFilters = tryGetFunctionLikeBodyCompletionContainer(contextToken) ? 5 /* FunctionLikeBodyKeywords */ : 1 /* All */; - completionKind = 1 /* Global */; - ({ isNewIdentifierLocation, defaultCommitCharacters } = computeCommitCharactersAndIsNewIdentifier()); - if (previousToken !== contextToken) { - Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); - } - const adjustedPosition = previousToken !== contextToken ? previousToken.getStart() : position; - const scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - isInSnippetScope = isSnippetScope(scopeNode); - const symbolMeanings = (isTypeOnlyLocation ? 0 /* None */ : 111551 /* Value */) | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */; - const typeOnlyAliasNeedsPromotion = previousToken && !isValidTypeOnlyAliasUseSite(previousToken); - symbols = concatenate(symbols, typeChecker.getSymbolsInScope(scopeNode, symbolMeanings)); - Debug.assertEachIsDefined(symbols, "getSymbolsInScope() should all be defined"); - for (let i = 0; i < symbols.length; i++) { - const symbol = symbols[i]; - if (!typeChecker.isArgumentsSymbol(symbol) && !some(symbol.declarations, (d) => d.getSourceFile() === sourceFile)) { - symbolToSortTextMap[getSymbolId(symbol)] = SortText.GlobalsOrKeywords; - } - if (typeOnlyAliasNeedsPromotion && !(symbol.flags & 111551 /* Value */)) { - const typeOnlyAliasDeclaration = symbol.declarations && find(symbol.declarations, isTypeOnlyImportDeclaration); - if (typeOnlyAliasDeclaration) { - const origin = { kind: 64 /* TypeOnlyAlias */, declaration: typeOnlyAliasDeclaration }; - symbolToOriginInfoMap[i] = origin; - } - } - } - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 308 /* SourceFile */) { - const thisType = typeChecker.tryGetThisTypeAt( - scopeNode, - /*includeGlobalThis*/ - false, - isClassLike(scopeNode.parent) ? scopeNode : void 0 - ); - if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) { - for (const symbol of getPropertiesForCompletion(thisType, typeChecker)) { - symbolToOriginInfoMap[symbols.length] = { kind: 1 /* ThisType */ }; - symbols.push(symbol); - symbolToSortTextMap[getSymbolId(symbol)] = SortText.SuggestedClassMembers; - } - } - } - collectAutoImports(); - if (isTypeOnlyLocation) { - keywordFilters = contextToken && isAssertionExpression(contextToken.parent) ? 6 /* TypeAssertionKeywords */ : 7 /* TypeKeywords */; - } - } - function shouldOfferImportCompletions() { - var _a; - if (importStatementCompletion) return true; - if (!preferences.includeCompletionsForModuleExports) return false; - if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator) return true; - if (compilerOptionsIndicateEsModules(program.getCompilerOptions())) return true; - return ((_a = program.getSymlinkCache) == null ? void 0 : _a.call(program).hasAnySymlinks()) || !!program.getCompilerOptions().paths || programContainsModules(program); - } - function isSnippetScope(scopeNode) { - switch (scopeNode.kind) { - case 308 /* SourceFile */: - case 229 /* TemplateExpression */: - case 295 /* JsxExpression */: - case 242 /* Block */: - return true; - default: - return isStatement(scopeNode); - } - } - function isTypeOnlyCompletion() { - return insideJsDocTagTypeExpression || insideJsDocImportTag || !!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 === 187 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 183 /* TypePredicate */); - } - function isContextTokenTypeLocation(contextToken2) { - if (contextToken2) { - const parentKind = contextToken2.parent.kind; - switch (contextToken2.kind) { - case 59 /* ColonToken */: - return parentKind === 173 /* PropertyDeclaration */ || parentKind === 172 /* PropertySignature */ || parentKind === 170 /* Parameter */ || parentKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(parentKind); - case 64 /* EqualsToken */: - return parentKind === 266 /* TypeAliasDeclaration */ || parentKind === 169 /* TypeParameter */; - case 130 /* AsKeyword */: - return parentKind === 235 /* AsExpression */; - case 30 /* LessThanToken */: - return parentKind === 184 /* TypeReference */ || parentKind === 217 /* TypeAssertionExpression */; - case 96 /* ExtendsKeyword */: - return parentKind === 169 /* TypeParameter */; - case 152 /* SatisfiesKeyword */: - return parentKind === 239 /* SatisfiesExpression */; - } - } - return false; - } - function collectAutoImports() { - var _a, _b; - if (!shouldOfferImportCompletions()) return; - Debug.assert(!(detailsEntryId == null ? void 0 : detailsEntryId.data), "Should not run 'collectAutoImports' when faster path is available via `data`"); - if (detailsEntryId && !detailsEntryId.source) { - return; - } - flags |= 1 /* MayIncludeAutoImports */; - const isAfterTypeOnlyImportSpecifierModifier = previousToken === contextToken && importStatementCompletion; - const lowerCaseTokenText = isAfterTypeOnlyImportSpecifierModifier ? "" : previousToken && isIdentifier(previousToken) ? previousToken.text.toLowerCase() : ""; - const moduleSpecifierCache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host); - const exportInfo = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken); - const packageJsonAutoImportProvider = (_b = host.getPackageJsonAutoImportProvider) == null ? void 0 : _b.call(host); - const packageJsonFilter = detailsEntryId ? void 0 : createPackageJsonImportFilter(sourceFile, preferences, host); - resolvingModuleSpecifiers( - "collectAutoImports", - host, - importSpecifierResolver || (importSpecifierResolver = ts_codefix_exports.createImportSpecifierResolver(sourceFile, program, host, preferences)), - program, - position, - preferences, - !!importStatementCompletion, - isValidTypeOnlyAliasUseSite(location), - (context) => { - exportInfo.search( - sourceFile.path, - /*preferCapitalized*/ - isRightOfOpenTag, - (symbolName2, targetFlags) => { - if (!isIdentifierText(symbolName2, getEmitScriptTarget(host.getCompilationSettings()))) return false; - if (!detailsEntryId && isStringANonContextualKeyword(symbolName2)) return false; - if (!isTypeOnlyLocation && !importStatementCompletion && !(targetFlags & 111551 /* Value */)) return false; - if (isTypeOnlyLocation && !(targetFlags & (1536 /* Module */ | 788968 /* Type */))) return false; - const firstChar = symbolName2.charCodeAt(0); - if (isRightOfOpenTag && (firstChar < 65 /* A */ || firstChar > 90 /* Z */)) return false; - if (detailsEntryId) return true; - return charactersFuzzyMatchInString(symbolName2, lowerCaseTokenText); - }, - (info, symbolName2, isFromAmbientModule, exportMapKey) => { - if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) { - return; - } - info = filter(info, isImportableExportInfo); - if (!info.length) { - return; - } - const result = context.tryResolve(info, isFromAmbientModule) || {}; - if (result === "failed") return; - let exportInfo2 = info[0], moduleSpecifier; - if (result !== "skipped") { - ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result); - } - const isDefaultExport = exportInfo2.exportKind === 1 /* Default */; - const symbol = isDefaultExport && getLocalSymbolForExportDefault(Debug.checkDefined(exportInfo2.symbol)) || Debug.checkDefined(exportInfo2.symbol); - pushAutoImportSymbol(symbol, { - kind: moduleSpecifier ? 32 /* ResolvedExport */ : 4 /* Export */, - moduleSpecifier, - symbolName: symbolName2, - exportMapKey, - exportName: exportInfo2.exportKind === 2 /* ExportEquals */ ? "export=" /* ExportEquals */ : Debug.checkDefined(exportInfo2.symbol).name, - fileName: exportInfo2.moduleFileName, - isDefaultExport, - moduleSymbol: exportInfo2.moduleSymbol, - isFromPackageJson: exportInfo2.isFromPackageJson - }); - } - ); - hasUnresolvedAutoImports = context.skippedAny(); - flags |= context.resolvedAny() ? 8 /* ResolvedModuleSpecifiers */ : 0; - flags |= context.resolvedBeyondLimit() ? 16 /* ResolvedModuleSpecifiersBeyondLimit */ : 0; - } - ); - function isImportableExportInfo(info) { - return isImportable( - info.isFromPackageJson ? packageJsonAutoImportProvider : program, - sourceFile, - tryCast(info.moduleSymbol.valueDeclaration, isSourceFile), - info.moduleSymbol, - preferences, - packageJsonFilter, - getModuleSpecifierResolutionHost(info.isFromPackageJson), - moduleSpecifierCache - ); - } - } - function pushAutoImportSymbol(symbol, origin) { - const symbolId = getSymbolId(symbol); - if (symbolToSortTextMap[symbolId] === SortText.GlobalsOrKeywords) { - return; - } - symbolToOriginInfoMap[symbols.length] = origin; - symbolToSortTextMap[symbolId] = importStatementCompletion ? SortText.LocationPriority : SortText.AutoImportSuggestions; - symbols.push(symbol); - } - function collectObjectLiteralMethodSymbols(members, enclosingDeclaration) { - if (isInJSFile(location)) { - return; - } - members.forEach((member) => { - if (!isObjectLiteralMethodSymbol(member)) { - return; - } - const displayName = getCompletionEntryDisplayNameForSymbol( - member, - getEmitScriptTarget(compilerOptions), - /*origin*/ - void 0, - 0 /* ObjectPropertyDeclaration */, - /*jsxIdentifierExpected*/ - false - ); - if (!displayName) { - return; - } - const { name } = displayName; - const entryProps = getEntryForObjectLiteralMethodCompletion( - member, - name, - enclosingDeclaration, - program, - host, - compilerOptions, - preferences, - formatContext - ); - if (!entryProps) { - return; - } - const origin = { kind: 128 /* ObjectLiteralMethod */, ...entryProps }; - flags |= 32 /* MayIncludeMethodSnippets */; - symbolToOriginInfoMap[symbols.length] = origin; - symbols.push(member); - }); - } - function isObjectLiteralMethodSymbol(symbol) { - if (!(symbol.flags & (4 /* Property */ | 8192 /* Method */))) { - return false; - } - return true; - } - function getScopeNode(initialToken, position2, sourceFile2) { - let scope = initialToken; - while (scope && !positionBelongsToNode(scope, position2, sourceFile2)) { - scope = scope.parent; - } - return scope; - } - function isCompletionListBlocker(contextToken2) { - const start2 = timestamp(); - const result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) || isSolelyIdentifierDefinitionLocation(contextToken2) || isDotOfNumericLiteral(contextToken2) || isInJsxText(contextToken2) || isBigIntLiteral(contextToken2); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (timestamp() - start2)); - return result; - } - function isInJsxText(contextToken2) { - if (contextToken2.kind === 12 /* JsxText */) { - return true; - } - if (contextToken2.kind === 32 /* GreaterThanToken */ && contextToken2.parent) { - if (location === contextToken2.parent && (location.kind === 287 /* JsxOpeningElement */ || location.kind === 286 /* JsxSelfClosingElement */)) { - return false; - } - if (contextToken2.parent.kind === 287 /* JsxOpeningElement */) { - return location.parent.kind !== 287 /* JsxOpeningElement */; - } - if (contextToken2.parent.kind === 288 /* JsxClosingElement */ || contextToken2.parent.kind === 286 /* JsxSelfClosingElement */) { - return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 285 /* JsxElement */; - } - } - return false; - } - function computeCommitCharactersAndIsNewIdentifier() { - if (contextToken) { - const containingNodeKind = contextToken.parent.kind; - const tokenKind = keywordForNode(contextToken); - switch (tokenKind) { - case 28 /* CommaToken */: - switch (containingNodeKind) { - case 214 /* CallExpression */: - // func( a, | - case 215 /* NewExpression */: { - const expression = contextToken.parent.expression; - if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { - return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - } - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; - } - case 227 /* BinaryExpression */: - return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - case 177 /* Constructor */: - // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - case 185 /* FunctionType */: - // var x: (s: string, list| - case 211 /* ObjectLiteralExpression */: - return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - case 210 /* ArrayLiteralExpression */: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; - default: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - case 21 /* OpenParenToken */: - switch (containingNodeKind) { - case 214 /* CallExpression */: - // func( | - case 215 /* NewExpression */: { - const expression = contextToken.parent.expression; - if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { - return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - } - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; - } - case 218 /* ParenthesizedExpression */: - return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - case 177 /* Constructor */: - // constructor( | - case 197 /* ParenthesizedType */: - return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - default: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - case 23 /* OpenBracketToken */: - switch (containingNodeKind) { - case 210 /* ArrayLiteralExpression */: - // [ | - case 182 /* IndexSignature */: - // [ | : string ] - case 190 /* TupleType */: - // [ | : string ] - case 168 /* ComputedPropertyName */: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; - default: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - case 144 /* ModuleKeyword */: - // module | - case 145 /* NamespaceKeyword */: - // namespace | - case 102 /* ImportKeyword */: - return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - case 25 /* DotToken */: - switch (containingNodeKind) { - case 268 /* ModuleDeclaration */: - return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - default: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - case 19 /* OpenBraceToken */: - switch (containingNodeKind) { - case 264 /* ClassDeclaration */: - // class A { | - case 211 /* ObjectLiteralExpression */: - return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - default: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - case 64 /* EqualsToken */: - switch (containingNodeKind) { - case 261 /* VariableDeclaration */: - // const x = a| - case 227 /* BinaryExpression */: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; - default: - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - case 16 /* TemplateHead */: - return { - defaultCommitCharacters: allCommitCharacters, - isNewIdentifierLocation: containingNodeKind === 229 /* TemplateExpression */ - // `aa ${| - }; - case 17 /* TemplateMiddle */: - return { - defaultCommitCharacters: allCommitCharacters, - isNewIdentifierLocation: containingNodeKind === 240 /* TemplateSpan */ - // `aa ${10} dd ${| - }; - case 134 /* AsyncKeyword */: - return containingNodeKind === 175 /* MethodDeclaration */ || containingNodeKind === 305 /* ShorthandPropertyAssignment */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - case 42 /* AsteriskToken */: - return containingNodeKind === 175 /* MethodDeclaration */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - if (isClassMemberCompletionKeyword(tokenKind)) { - return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - } - } - return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; - } - function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) { - return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); - } - function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() { - const typeLiteralNode = tryGetTypeLiteralNode(contextToken); - if (!typeLiteralNode) return 0 /* Continue */; - const intersectionTypeNode = isIntersectionTypeNode(typeLiteralNode.parent) ? typeLiteralNode.parent : void 0; - const containerTypeNode = intersectionTypeNode || typeLiteralNode; - const containerExpectedType = getConstraintOfTypeArgumentProperty(containerTypeNode, typeChecker); - if (!containerExpectedType) return 0 /* Continue */; - const containerActualType = typeChecker.getTypeFromTypeNode(containerTypeNode); - const members = getPropertiesForCompletion(containerExpectedType, typeChecker); - const existingMembers = getPropertiesForCompletion(containerActualType, typeChecker); - const existingMemberEscapedNames = /* @__PURE__ */ new Set(); - existingMembers.forEach((s) => existingMemberEscapedNames.add(s.escapedName)); - symbols = concatenate(symbols, filter(members, (s) => !existingMemberEscapedNames.has(s.escapedName))); - completionKind = 0 /* ObjectPropertyDeclaration */; - isNewIdentifierLocation = true; - return 1 /* Success */; - } - function tryGetObjectLikeCompletionSymbols() { - if ((contextToken == null ? void 0 : contextToken.kind) === 26 /* DotDotDotToken */) return 0 /* Continue */; - const symbolsStartIndex = symbols.length; - const objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken, position, sourceFile); - if (!objectLikeContainer) return 0 /* Continue */; - completionKind = 0 /* ObjectPropertyDeclaration */; - let typeMembers; - let existingMembers; - if (objectLikeContainer.kind === 211 /* ObjectLiteralExpression */) { - const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); - if (instantiatedType === void 0) { - if (objectLikeContainer.flags & 67108864 /* InWithStatement */) { - return 2 /* Fail */; - } - return 0 /* Continue */; - } - const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); - const hasStringIndexType = (completionsType || instantiatedType).getStringIndexType(); - const hasNumberIndextype = (completionsType || instantiatedType).getNumberIndexType(); - isNewIdentifierLocation = !!hasStringIndexType || !!hasNumberIndextype; - typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker); - existingMembers = objectLikeContainer.properties; - if (typeMembers.length === 0) { - if (!hasNumberIndextype) { - return 0 /* Continue */; - } - } - } else { - Debug.assert(objectLikeContainer.kind === 207 /* 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 === 251 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 170 /* Parameter */) { - if (isExpression(rootDeclaration.parent)) { - canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); - } else if (rootDeclaration.parent.kind === 175 /* MethodDeclaration */ || rootDeclaration.parent.kind === 179 /* SetAccessor */) { - canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); - } - } - if (canGetType) { - const typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer); - if (!typeForObject) return 2 /* Fail */; - typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter((propertySymbol) => { - return typeChecker.isPropertyAccessible( - objectLikeContainer, - /*isSuper*/ - false, - /*isWrite*/ - false, - typeForObject, - propertySymbol - ); - }); - existingMembers = objectLikeContainer.elements; - } - } - if (typeMembers && typeMembers.length > 0) { - const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers)); - symbols = concatenate(symbols, filteredMembers); - setSortTextToOptionalMember(); - if (objectLikeContainer.kind === 211 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { - transformObjectLiteralMembersSortText(symbolsStartIndex); - collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer); - } - } - return 1 /* Success */; - } - function tryGetImportOrExportClauseCompletionSymbols() { - if (!contextToken) return 0 /* Continue */; - const namedImportsOrExports = contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */ ? tryCast(contextToken.parent, isNamedImportsOrExports) : isTypeKeywordTokenOrIdentifier(contextToken) ? tryCast(contextToken.parent.parent, isNamedImportsOrExports) : void 0; - if (!namedImportsOrExports) return 0 /* Continue */; - if (!isTypeKeywordTokenOrIdentifier(contextToken)) { - keywordFilters = 8 /* TypeKeyword */; - } - const { moduleSpecifier } = namedImportsOrExports.kind === 276 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; - if (!moduleSpecifier) { - isNewIdentifierLocation = true; - return namedImportsOrExports.kind === 276 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; - } - const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); - if (!moduleSpecifierSymbol) { - isNewIdentifierLocation = true; - return 2 /* Fail */; - } - completionKind = 3 /* MemberLike */; - isNewIdentifierLocation = false; - const exports2 = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol); - const existing = new Set(namedImportsOrExports.elements.filter((n) => !isCurrentlyEditingNode(n)).map((n) => moduleExportNameTextEscaped(n.propertyName || n.name))); - const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName)); - symbols = concatenate(symbols, uniques); - if (!uniques.length) { - keywordFilters = 0 /* None */; - } - 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; - if (!namedExports) { - return 0 /* Continue */; - } - const localsContainer = findAncestor(namedExports, or(isSourceFile, isModuleDeclaration)); - completionKind = 5 /* None */; - isNewIdentifierLocation = false; - (_a = localsContainer.locals) == null ? void 0 : _a.forEach((symbol, name) => { - var _a2, _b; - symbols.push(symbol); - if ((_b = (_a2 = localsContainer.symbol) == null ? void 0 : _a2.exports) == null ? void 0 : _b.has(name)) { - symbolToSortTextMap[getSymbolId(symbol)] = SortText.OptionalMember; - } - }); - return 1 /* Success */; - } - function tryGetClassLikeCompletionSymbols() { - const decl = tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position); - if (!decl) return 0 /* Continue */; - completionKind = 3 /* MemberLike */; - isNewIdentifierLocation = true; - keywordFilters = contextToken.kind === 42 /* AsteriskToken */ ? 0 /* None */ : isClassLike(decl) ? 2 /* ClassElementKeywords */ : 3 /* InterfaceElementKeywords */; - if (!isClassLike(decl)) return 1 /* Success */; - const classElement = contextToken.kind === 27 /* SemicolonToken */ ? contextToken.parent.parent : contextToken.parent; - let classElementModifierFlags = isClassElement(classElement) ? getEffectiveModifierFlags(classElement) : 0 /* None */; - if (contextToken.kind === 80 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) { - switch (contextToken.getText()) { - case "private": - classElementModifierFlags = classElementModifierFlags | 2 /* Private */; - break; - case "static": - classElementModifierFlags = classElementModifierFlags | 256 /* Static */; - break; - case "override": - classElementModifierFlags = classElementModifierFlags | 16 /* Override */; - break; - } - } - if (isClassStaticBlockDeclaration(classElement)) { - classElementModifierFlags |= 256 /* Static */; - } - 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 & 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) => { - const declaration = symbol == null ? void 0 : symbol.valueDeclaration; - if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) { - const origin = { - kind: 512 /* ComputedPropertyName */, - symbolName: typeChecker.symbolToString(symbol) - }; - symbolToOriginInfoMap[index] = origin; - } - }); - } - return 1 /* Success */; - } - function isConstructorParameterCompletion(node2) { - return !!node2.parent && isParameter(node2.parent) && isConstructorDeclaration(node2.parent.parent) && (isParameterPropertyModifier(node2.kind) || isDeclarationName(node2)); - } - function tryGetConstructorLikeCompletionContainer(contextToken2) { - if (contextToken2) { - const parent2 = contextToken2.parent; - switch (contextToken2.kind) { - case 21 /* OpenParenToken */: - case 28 /* CommaToken */: - return isConstructorDeclaration(contextToken2.parent) ? contextToken2.parent : void 0; - default: - if (isConstructorParameterCompletion(contextToken2)) { - return parent2.parent; - } - } - } - return void 0; - } - function tryGetFunctionLikeBodyCompletionContainer(contextToken2) { - if (contextToken2) { - let prev; - const container = findAncestor(contextToken2.parent, (node2) => { - if (isClassLike(node2)) { - return "quit"; - } - if (isFunctionLikeDeclaration(node2) && prev === node2.body) { - return true; - } - prev = node2; - return false; - }); - return container && container; - } - } - function tryGetContainingJsxElement(contextToken2) { - if (contextToken2) { - const parent2 = contextToken2.parent; - switch (contextToken2.kind) { - case 32 /* GreaterThanToken */: - // End of a type argument list - case 31 /* LessThanSlashToken */: - case 44 /* SlashToken */: - case 80 /* Identifier */: - case 212 /* PropertyAccessExpression */: - case 293 /* JsxAttributes */: - case 292 /* JsxAttribute */: - case 294 /* JsxSpreadAttribute */: - if (parent2 && (parent2.kind === 286 /* JsxSelfClosingElement */ || parent2.kind === 287 /* JsxOpeningElement */)) { - if (contextToken2.kind === 32 /* GreaterThanToken */) { - const precedingToken = findPrecedingToken( - contextToken2.pos, - sourceFile, - /*startNode*/ - void 0 - ); - if (!parent2.typeArguments || precedingToken && precedingToken.kind === 44 /* SlashToken */) break; - } - return parent2; - } else if (parent2.kind === 292 /* JsxAttribute */) { - return parent2.parent.parent; - } - break; - // The context token is the closing } or " of an attribute, which means - // its parent is a JsxExpression, whose parent is a JsxAttribute, - // whose parent is a JsxOpeningLikeElement - case 11 /* StringLiteral */: - if (parent2 && (parent2.kind === 292 /* JsxAttribute */ || parent2.kind === 294 /* JsxSpreadAttribute */)) { - return parent2.parent.parent; - } - break; - case 20 /* CloseBraceToken */: - if (parent2 && parent2.kind === 295 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 292 /* JsxAttribute */) { - return parent2.parent.parent.parent; - } - if (parent2 && parent2.kind === 294 /* JsxSpreadAttribute */) { - return parent2.parent.parent; - } - break; - } - } - 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 === 261 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 244 /* VariableStatement */ || containingNodeKind === 267 /* EnumDeclaration */ || // enum a { foo, | - isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 265 /* InterfaceDeclaration */ || // interface A= contextToken2.pos; - case 25 /* DotToken */: - return containingNodeKind === 208 /* ArrayBindingPattern */; - // var [.| - case 59 /* ColonToken */: - return containingNodeKind === 209 /* BindingElement */; - // var {x :html| - case 23 /* OpenBracketToken */: - return containingNodeKind === 208 /* ArrayBindingPattern */; - // var [x| - case 21 /* OpenParenToken */: - return containingNodeKind === 300 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); - case 19 /* OpenBraceToken */: - return containingNodeKind === 267 /* EnumDeclaration */; - // enum a { | - case 30 /* LessThanToken */: - return containingNodeKind === 264 /* ClassDeclaration */ || // class A< | - containingNodeKind === 232 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 265 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 266 /* TypeAliasDeclaration */ || // type List< | - isFunctionLikeKind(containingNodeKind); - case 126 /* StaticKeyword */: - return containingNodeKind === 173 /* PropertyDeclaration */ && !isClassLike(parent2.parent); - case 26 /* DotDotDotToken */: - return containingNodeKind === 170 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 208 /* ArrayBindingPattern */; - // var [...z| - case 125 /* PublicKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - return containingNodeKind === 170 /* Parameter */ && !isConstructorDeclaration(parent2.parent); - case 130 /* AsKeyword */: - return containingNodeKind === 277 /* ImportSpecifier */ || containingNodeKind === 282 /* ExportSpecifier */ || containingNodeKind === 275 /* NamespaceImport */; - case 139 /* GetKeyword */: - case 153 /* SetKeyword */: - return !isFromObjectTypeDeclaration(contextToken2); - case 80 /* Identifier */: { - if ((containingNodeKind === 277 /* ImportSpecifier */ || containingNodeKind === 282 /* ExportSpecifier */) && 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 */: - case 100 /* FunctionKeyword */: - case 115 /* VarKeyword */: - case 102 /* ImportKeyword */: - case 121 /* LetKeyword */: - case 87 /* ConstKeyword */: - case 140 /* InferKeyword */: - return true; - case 156 /* TypeKeyword */: - return containingNodeKind !== 277 /* ImportSpecifier */; - case 42 /* AsteriskToken */: - return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent); - } - if (isClassMemberCompletionKeyword(keywordForNode(contextToken2)) && isFromObjectTypeDeclaration(contextToken2)) { - return false; - } - if (isConstructorParameterCompletion(contextToken2)) { - if (!isIdentifier(contextToken2) || isParameterPropertyModifier(keywordForNode(contextToken2)) || isCurrentlyEditingNode(contextToken2)) { - return false; - } - } - switch (keywordForNode(contextToken2)) { - case 128 /* AbstractKeyword */: - case 86 /* ClassKeyword */: - case 87 /* ConstKeyword */: - case 138 /* DeclareKeyword */: - case 94 /* EnumKeyword */: - case 100 /* FunctionKeyword */: - case 120 /* InterfaceKeyword */: - case 121 /* LetKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - case 125 /* PublicKeyword */: - case 126 /* StaticKeyword */: - case 115 /* VarKeyword */: - return true; - case 134 /* AsyncKeyword */: - return isPropertyDeclaration(contextToken2.parent); - } - const ancestorClassLike = findAncestor(contextToken2.parent, isClassLike); - if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) { - return false; - } - const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 173 /* PropertyDeclaration */); - if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) { - if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) { - return false; - } else if (contextToken2.kind !== 64 /* EqualsToken */ && (isInitializedProperty(ancestorPropertyDeclaraion) || hasType(ancestorPropertyDeclaraion))) { - return true; - } - } - return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent) || isTypeParameterDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end)); - } - function isPreviousPropertyDeclarationTerminated(contextToken2, position2) { - return contextToken2.kind !== 64 /* EqualsToken */ && (contextToken2.kind === 27 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile)); - } - function isFunctionLikeButNotConstructor(kind) { - return isFunctionLikeKind(kind) && kind !== 177 /* Constructor */; - } - function isDotOfNumericLiteral(contextToken2) { - if (contextToken2.kind === 9 /* NumericLiteral */) { - const text = contextToken2.getFullText(); - return text.charAt(text.length - 1) === "."; - } - return false; - } - function isVariableDeclarationListButNotTypeArgument(node2) { - return node2.parent.kind === 262 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); - } - function filterObjectMembersList(contextualMemberSymbols, existingMembers) { - if (existingMembers.length === 0) { - return contextualMemberSymbols; - } - const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set(); - const existingMemberNames = /* @__PURE__ */ new Set(); - for (const m of existingMembers) { - if (m.kind !== 304 /* PropertyAssignment */ && m.kind !== 305 /* ShorthandPropertyAssignment */ && m.kind !== 209 /* BindingElement */ && m.kind !== 175 /* MethodDeclaration */ && m.kind !== 178 /* GetAccessor */ && m.kind !== 179 /* SetAccessor */ && m.kind !== 306 /* SpreadAssignment */) { - continue; - } - if (isCurrentlyEditingNode(m)) { - continue; - } - let existingName; - if (isSpreadAssignment(m)) { - setMembersDeclaredBySpreadAssignment(m, membersDeclaredBySpreadAssignment); - } else if (isBindingElement(m) && m.propertyName) { - if (m.propertyName.kind === 80 /* Identifier */) { - existingName = m.propertyName.escapedText; - } - } else { - const name = getNameOfDeclaration(m); - existingName = name && isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0; - } - if (existingName !== void 0) { - existingMemberNames.add(existingName); - } - } - const filteredSymbols = contextualMemberSymbols.filter((m) => !existingMemberNames.has(m.escapedName)); - setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols); - return filteredSymbols; - } - function setMembersDeclaredBySpreadAssignment(declaration, membersDeclaredBySpreadAssignment) { - const expression = declaration.expression; - const symbol = typeChecker.getSymbolAtLocation(expression); - const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, expression); - const properties = type && type.properties; - if (properties) { - properties.forEach((property) => { - membersDeclaredBySpreadAssignment.add(property.name); - }); - } - } - function setSortTextToOptionalMember() { - symbols.forEach((m) => { - if (m.flags & 16777216 /* Optional */) { - const symbolId = getSymbolId(m); - symbolToSortTextMap[symbolId] = symbolToSortTextMap[symbolId] ?? SortText.OptionalMember; - } - }); - } - function setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, contextualMemberSymbols) { - if (membersDeclaredBySpreadAssignment.size === 0) { - return; - } - for (const contextualMemberSymbol of contextualMemberSymbols) { - if (membersDeclaredBySpreadAssignment.has(contextualMemberSymbol.name)) { - symbolToSortTextMap[getSymbolId(contextualMemberSymbol)] = SortText.MemberDeclaredBySpreadAssignment; - } - } - } - function transformObjectLiteralMembersSortText(start2) { - for (let i = start2; i < symbols.length; i++) { - const symbol = symbols[i]; - const symbolId = getSymbolId(symbol); - const origin = symbolToOriginInfoMap == null ? void 0 : symbolToOriginInfoMap[i]; - const target = getEmitScriptTarget(compilerOptions); - const displayName = getCompletionEntryDisplayNameForSymbol( - symbol, - target, - origin, - 0 /* ObjectPropertyDeclaration */, - /*jsxIdentifierExpected*/ - false - ); - if (displayName) { - const originalSortText = symbolToSortTextMap[symbolId] ?? SortText.LocationPriority; - const { name } = displayName; - symbolToSortTextMap[symbolId] = SortText.ObjectLiteralProperty(originalSortText, name); - } - } - } - function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) { - const existingMemberNames = /* @__PURE__ */ new Set(); - for (const m of existingMembers) { - if (m.kind !== 173 /* PropertyDeclaration */ && m.kind !== 175 /* MethodDeclaration */ && m.kind !== 178 /* GetAccessor */ && m.kind !== 179 /* SetAccessor */) { - continue; - } - if (isCurrentlyEditingNode(m)) { - continue; - } - if (hasEffectiveModifier(m, 2 /* Private */)) { - continue; - } - if (isStatic(m) !== !!(currentClassElementModifierFlags & 256 /* Static */)) { - continue; - } - const existingName = getPropertyNameForPropertyNameNode(m.name); - if (existingName) { - existingMemberNames.add(existingName); - } - } - 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(); - const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set(); - for (const attr of attributes) { - if (isCurrentlyEditingNode(attr)) { - continue; - } - if (attr.kind === 292 /* JsxAttribute */) { - seenNames.add(getEscapedTextOfJsxAttributeName(attr.name)); - } else if (isJsxSpreadAttribute(attr)) { - setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment); - } - } - const filteredSymbols = symbols2.filter((a) => !seenNames.has(a.escapedName)); - setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols); - return filteredSymbols; - } - function isCurrentlyEditingNode(node2) { - return node2.getStart(sourceFile) <= position && position <= node2.getEnd(); - } -} -function tryGetObjectLikeCompletionContainer(contextToken, position, sourceFile) { - var _a; - if (contextToken) { - const { parent: parent2 } = contextToken; - switch (contextToken.kind) { - case 19 /* OpenBraceToken */: - // const x = { | - case 28 /* CommaToken */: - if (isObjectLiteralExpression(parent2) || isObjectBindingPattern(parent2)) { - return parent2; - } - break; - case 42 /* AsteriskToken */: - return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0; - case 134 /* AsyncKeyword */: - return tryCast(parent2.parent, isObjectLiteralExpression); - case 80 /* Identifier */: - 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; -} -function getRelevantTokens(position, sourceFile) { - const previousToken = findPrecedingToken(position, sourceFile); - if (previousToken && position <= previousToken.end && (isMemberName(previousToken) || isKeyword(previousToken.kind))) { - const contextToken = findPrecedingToken( - previousToken.getFullStart(), - sourceFile, - /*startNode*/ - void 0 - ); - return { contextToken, previousToken }; - } - return { contextToken: previousToken, previousToken }; -} -function getAutoImportSymbolFromCompletionEntryData(name, data, program, host) { - const containingProgram = data.isPackageJsonImport ? host.getPackageJsonAutoImportProvider() : program; - const checker = containingProgram.getTypeChecker(); - const moduleSymbol = data.ambientModuleName ? checker.tryFindAmbientModule(data.ambientModuleName) : data.fileName ? checker.getMergedSymbol(Debug.checkDefined(containingProgram.getSourceFile(data.fileName)).symbol) : void 0; - if (!moduleSymbol) return void 0; - let symbol = data.exportName === "export=" /* ExportEquals */ ? checker.resolveExternalModuleSymbol(moduleSymbol) : checker.tryGetMemberInModuleExportsAndProperties(data.exportName, moduleSymbol); - if (!symbol) return void 0; - const isDefaultExport = data.exportName === "default" /* Default */; - symbol = isDefaultExport && getLocalSymbolForExportDefault(symbol) || symbol; - return { symbol, origin: completionEntryDataToSymbolOriginInfo(data, name, moduleSymbol) }; -} -function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, jsxIdentifierExpected) { - if (originIsIgnore(origin)) { - return void 0; - } - const name = originIncludesSymbolName(origin) ? origin.symbolName : symbol.name; - if (name === void 0 || symbol.flags & 1536 /* Module */ && isSingleOrDoubleQuote(name.charCodeAt(0)) || isKnownSymbol(symbol)) { - return void 0; - } - const validNameResult = { name, needsConvertPropertyAccess: false }; - if (isIdentifierText(name, target, jsxIdentifierExpected ? 1 /* JSX */ : 0 /* Standard */) || symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { - return validNameResult; - } - if (symbol.flags & 2097152 /* Alias */) { - return { name, needsConvertPropertyAccess: true }; - } - switch (kind) { - case 3 /* MemberLike */: - return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0; - case 0 /* ObjectPropertyDeclaration */: - return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; - case 2 /* PropertyAccess */: - case 1 /* Global */: - return name.charCodeAt(0) === 32 /* space */ ? void 0 : { name, needsConvertPropertyAccess: true }; - case 5 /* None */: - case 4 /* String */: - return validNameResult; - default: - Debug.assertNever(kind); - } -} -var _keywordCompletions = []; -var allKeywordsCompletions = memoize(() => { - const res = []; - for (let i = 83 /* FirstKeyword */; i <= 166 /* LastKeyword */; i++) { - res.push({ - name: tokenToString(i), - kind: "keyword" /* keyword */, - kindModifiers: "" /* none */, - sortText: SortText.GlobalsOrKeywords - }); - } - return res; -}); -function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) { - if (!filterOutTsOnlyKeywords) return getTypescriptKeywordCompletions(keywordFilter); - const index = keywordFilter + 8 /* Last */ + 1; - return _keywordCompletions[index] || (_keywordCompletions[index] = getTypescriptKeywordCompletions(keywordFilter).filter((entry) => !isTypeScriptOnlyKeyword(stringToToken(entry.name)))); -} -function getTypescriptKeywordCompletions(keywordFilter) { - return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter((entry) => { - const kind = stringToToken(entry.name); - switch (keywordFilter) { - case 0 /* None */: - return false; - case 1 /* All */: - return isFunctionLikeBodyKeyword(kind) || kind === 138 /* DeclareKeyword */ || kind === 144 /* ModuleKeyword */ || kind === 156 /* TypeKeyword */ || kind === 145 /* NamespaceKeyword */ || kind === 128 /* AbstractKeyword */ || isTypeKeyword(kind) && kind !== 157 /* UndefinedKeyword */; - case 5 /* FunctionLikeBodyKeywords */: - return isFunctionLikeBodyKeyword(kind); - case 2 /* ClassElementKeywords */: - return isClassMemberCompletionKeyword(kind); - case 3 /* InterfaceElementKeywords */: - return isInterfaceOrTypeLiteralCompletionKeyword(kind); - case 4 /* ConstructorParameterKeywords */: - return isParameterPropertyModifier(kind); - case 6 /* TypeAssertionKeywords */: - return isTypeKeyword(kind) || kind === 87 /* ConstKeyword */; - case 7 /* TypeKeywords */: - return isTypeKeyword(kind); - case 8 /* TypeKeyword */: - return kind === 156 /* TypeKeyword */; - default: - return Debug.assertNever(keywordFilter); - } - })); -} -function isTypeScriptOnlyKeyword(kind) { - switch (kind) { - case 128 /* AbstractKeyword */: - case 133 /* AnyKeyword */: - case 163 /* BigIntKeyword */: - case 136 /* BooleanKeyword */: - case 138 /* DeclareKeyword */: - case 94 /* EnumKeyword */: - case 162 /* GlobalKeyword */: - case 119 /* ImplementsKeyword */: - case 140 /* InferKeyword */: - case 120 /* InterfaceKeyword */: - case 142 /* IsKeyword */: - case 143 /* KeyOfKeyword */: - case 144 /* ModuleKeyword */: - case 145 /* NamespaceKeyword */: - case 146 /* NeverKeyword */: - case 150 /* NumberKeyword */: - case 151 /* ObjectKeyword */: - case 164 /* OverrideKeyword */: - case 123 /* PrivateKeyword */: - case 124 /* ProtectedKeyword */: - case 125 /* PublicKeyword */: - case 148 /* ReadonlyKeyword */: - case 154 /* StringKeyword */: - case 155 /* SymbolKeyword */: - case 156 /* TypeKeyword */: - case 158 /* UniqueKeyword */: - case 159 /* UnknownKeyword */: - return true; - default: - return false; - } -} -function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 148 /* ReadonlyKeyword */; -} -function isClassMemberCompletionKeyword(kind) { - switch (kind) { - case 128 /* AbstractKeyword */: - case 129 /* AccessorKeyword */: - case 137 /* ConstructorKeyword */: - case 139 /* GetKeyword */: - case 153 /* SetKeyword */: - case 134 /* AsyncKeyword */: - case 138 /* DeclareKeyword */: - case 164 /* OverrideKeyword */: - return true; - default: - return isClassMemberModifier(kind); - } -} -function isFunctionLikeBodyKeyword(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; -} -function getContextualKeywords(contextToken, position) { - const entries = []; - if (contextToken) { - const file = contextToken.getSourceFile(); - const parent2 = contextToken.parent; - const tokenLine = file.getLineAndCharacterOfPosition(contextToken.end).line; - const currentLine = file.getLineAndCharacterOfPosition(position).line; - if ((isImportDeclaration(parent2) || isExportDeclaration(parent2) && parent2.moduleSpecifier) && contextToken === parent2.moduleSpecifier && tokenLine === currentLine) { - entries.push({ - name: tokenToString(132 /* AssertKeyword */), - kind: "keyword" /* keyword */, - kindModifiers: "" /* none */, - sortText: SortText.GlobalsOrKeywords - }); - } - } - return entries; -} -function getJsDocTagAtPosition(node, position) { - return findAncestor(node, (n) => isJSDocTag(n) && rangeContainsPosition(n, position) ? true : isJSDoc(n) ? "quit" : false); -} -function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) { - const hasCompletionsType = completionsType && completionsType !== contextualType; - const promiseFilteredContextualType = checker.getUnionType( - filter( - contextualType.flags & 1048576 /* Union */ ? contextualType.types : [contextualType], - (t) => !checker.getPromisedTypeOfPromise(t) - ) - ); - const type = hasCompletionsType && !(completionsType.flags & 3 /* AnyOrUnknown */) ? checker.getUnionType([promiseFilteredContextualType, completionsType]) : promiseFilteredContextualType; - const properties = getApparentProperties(type, obj, checker); - return type.isClass() && containsNonPublicProperties(properties) ? [] : hasCompletionsType ? filter(properties, hasDeclarationOtherThanSelf) : properties; - function hasDeclarationOtherThanSelf(member) { - if (!length(member.declarations)) return true; - return some(member.declarations, (decl) => decl.parent !== obj); - } -} -function getApparentProperties(type, node, checker) { - if (!type.isUnion()) return type.getApparentProperties(); - 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) & 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 353 /* SyntaxList */: - return tryCast(location.parent, isObjectTypeDeclaration); - case 1 /* EndOfFileToken */: - const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration); - if (cls && !findChildOfKind(cls, 20 /* CloseBraceToken */, sourceFile)) { - 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) { - return void 0; - } - if (isPropertyDeclaration(location.parent) && location.parent.initializer === location) { - return void 0; - } - if (isFromObjectTypeDeclaration(location)) { - return findAncestor(location, isObjectTypeDeclaration); - } - } - } - if (!contextToken) return void 0; - if (location.kind === 137 /* ConstructorKeyword */ || isIdentifier(contextToken) && isPropertyDeclaration(contextToken.parent) && isClassLike(location)) { - return findAncestor(contextToken, isClassLike); - } - switch (contextToken.kind) { - case 64 /* EqualsToken */: - return void 0; - case 27 /* SemicolonToken */: - // class c {getValue(): number; | } - case 20 /* CloseBraceToken */: - return isFromObjectTypeDeclaration(location) && location.parent.name === location ? location.parent.parent : tryCast(location, isObjectTypeDeclaration); - case 19 /* OpenBraceToken */: - // class c { | - case 28 /* CommaToken */: - return tryCast(contextToken.parent, isObjectTypeDeclaration); - default: - if (isObjectTypeDeclaration(location)) { - if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { - return location; - } - const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; - return isValidKeyword(contextToken.kind) || contextToken.kind === 42 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword(identifierToKeywordKind(contextToken) ?? 0 /* Unknown */) ? contextToken.parent.parent : void 0; - } - return void 0; - } -} -function tryGetTypeLiteralNode(node) { - if (!node) return void 0; - const parent2 = node.parent; - switch (node.kind) { - case 19 /* OpenBraceToken */: - if (isTypeLiteralNode(parent2)) { - return parent2; - } - break; - case 27 /* SemicolonToken */: - case 28 /* CommaToken */: - case 80 /* Identifier */: - if (parent2.kind === 172 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) { - return parent2.parent; - } - break; - } - return void 0; -} -function getConstraintOfTypeArgumentProperty(node, checker) { - if (!node) return void 0; - if (isTypeNode(node) && isTypeReferenceType(node.parent)) { - return checker.getTypeArgumentConstraint(node); - } - const t = getConstraintOfTypeArgumentProperty(node.parent, checker); - if (!t) return void 0; - switch (node.kind) { - case 172 /* PropertySignature */: - return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName); - case 194 /* IntersectionType */: - case 188 /* TypeLiteral */: - case 193 /* UnionType */: - return t; - } -} -function isFromObjectTypeDeclaration(node) { - return node.parent && isClassOrTypeElement(node.parent) && isObjectTypeDeclaration(node.parent.parent); -} -function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) { - switch (triggerCharacter) { - case ".": - case "@": - return true; - case '"': - case "'": - case "`": - return !!contextToken && isStringLiteralOrTemplate(contextToken) && position === contextToken.getStart(sourceFile) + 1; - case "#": - return !!contextToken && isPrivateIdentifier(contextToken) && !!getContainingClass(contextToken); - case "<": - return !!contextToken && contextToken.kind === 30 /* LessThanToken */ && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); - case "/": - return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 31 /* LessThanSlashToken */ && isJsxClosingElement(contextToken.parent)); - case " ": - return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 308 /* SourceFile */; - default: - return Debug.assertNever(triggerCharacter); - } -} -function binaryExpressionMayBeOpenTag({ left }) { - return nodeIsMissing(left); -} -function isProbablyGlobalType(type, sourceFile, checker) { - const selfSymbol = checker.resolveName( - "self", - /*location*/ - void 0, - 111551 /* Value */, - /*excludeGlobals*/ - false - ); - if (selfSymbol && checker.getTypeOfSymbolAtLocation(selfSymbol, sourceFile) === type) { - return true; - } - const globalSymbol = checker.resolveName( - "global", - /*location*/ - void 0, - 111551 /* Value */, - /*excludeGlobals*/ - false - ); - if (globalSymbol && checker.getTypeOfSymbolAtLocation(globalSymbol, sourceFile) === type) { - return true; - } - const globalThisSymbol = checker.resolveName( - "globalThis", - /*location*/ - void 0, - 111551 /* Value */, - /*excludeGlobals*/ - false - ); - if (globalThisSymbol && checker.getTypeOfSymbolAtLocation(globalThisSymbol, sourceFile) === type) { - return true; - } - return false; -} -function isStaticProperty(symbol) { - return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & 256 /* Static */ && isClassLike(symbol.valueDeclaration.parent)); -} -function tryGetObjectLiteralContextualType(node, typeChecker) { - const type = typeChecker.getContextualType(node); - if (type) { - return type; - } - const parent2 = walkUpParenthesizedExpressions(node.parent); - if (isBinaryExpression(parent2) && parent2.operatorToken.kind === 64 /* EqualsToken */ && node === parent2.left) { - return typeChecker.getTypeAtLocation(parent2); - } - if (isExpression(parent2)) { - return typeChecker.getContextualType(parent2); - } - return void 0; -} -function getImportStatementCompletionInfo(contextToken, sourceFile) { - var _a, _b, _c; - let keywordCompletion; - let isKeywordOnlyCompletion = false; - const candidate = getCandidate(); - return { - isKeywordOnlyCompletion, - keywordCompletion, - isNewIdentifierLocation: !!(candidate || keywordCompletion === 156 /* TypeKeyword */), - isTopLevelTypeOnly: !!((_b = (_a = tryCast(candidate, isImportDeclaration)) == null ? void 0 : _a.importClause) == null ? void 0 : _b.isTypeOnly) || !!((_c = tryCast(candidate, isImportEqualsDeclaration)) == null ? void 0 : _c.isTypeOnly), - couldBeTypeOnlyImportSpecifier: !!candidate && couldBeTypeOnlyImportSpecifier(candidate, contextToken), - replacementSpan: getSingleLineReplacementSpanForImportCompletionNode(candidate) - }; - 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; - } - if (couldBeTypeOnlyImportSpecifier(parent2, contextToken) && canCompleteFromNamedBindings(parent2.parent)) { - return parent2; - } - if (isNamedImports(parent2) || isNamespaceImport(parent2)) { - if (!parent2.parent.isTypeOnly && (contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 102 /* ImportKeyword */ || contextToken.kind === 28 /* CommaToken */)) { - keywordCompletion = 156 /* TypeKeyword */; - } - if (canCompleteFromNamedBindings(parent2)) { - if (contextToken.kind === 20 /* CloseBraceToken */ || contextToken.kind === 80 /* Identifier */) { - isKeywordOnlyCompletion = true; - 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; - } - if (isImportKeyword(contextToken) && isImportDeclaration(parent2)) { - keywordCompletion = 156 /* TypeKeyword */; - return isModuleSpecifierMissingOrEmpty(parent2.moduleSpecifier) ? parent2 : void 0; - } - return void 0; - } -} -function getSingleLineReplacementSpanForImportCompletionNode(node) { - var _a; - if (!node) return void 0; - const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration, isJSDocImportTag)) ?? node; - const sourceFile = top.getSourceFile(); - if (rangeIsOnSingleLine(top, sourceFile)) { - return createTextSpanFromNode(top, sourceFile); - } - Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 277 /* ImportSpecifier */); - const potentialSplitPoint = top.kind === 273 /* ImportDeclaration */ || top.kind === 352 /* JSDocImportTag */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference; - const withoutModuleSpecifier = { - pos: top.getFirstToken().getStart(), - end: potentialSplitPoint.pos - }; - if (rangeIsOnSingleLine(withoutModuleSpecifier, sourceFile)) { - return createTextSpanFromRange(withoutModuleSpecifier); - } -} -function getPotentiallyInvalidImportSpecifier(namedBindings) { - var _a; - return find( - (_a = tryCast(namedBindings, isNamedImports)) == null ? void 0 : _a.elements, - (e) => { - var _a2; - return !e.propertyName && isStringANonContextualKeyword(e.name.text) && ((_a2 = findPrecedingToken(e.name.pos, namedBindings.getSourceFile(), namedBindings)) == null ? void 0 : _a2.kind) !== 28 /* CommaToken */; - } - ); -} -function couldBeTypeOnlyImportSpecifier(importSpecifier, contextToken) { - return isImportSpecifier(importSpecifier) && (importSpecifier.isTypeOnly || contextToken === importSpecifier.name && isTypeKeywordTokenOrIdentifier(contextToken)); -} -function canCompleteFromNamedBindings(namedBindings) { - if (!isModuleSpecifierMissingOrEmpty(namedBindings.parent.parent.moduleSpecifier) || namedBindings.parent.name) { - return false; - } - if (isNamedImports(namedBindings)) { - const invalidNamedImport = getPotentiallyInvalidImportSpecifier(namedBindings); - const validImports = invalidNamedImport ? namedBindings.elements.indexOf(invalidNamedImport) : namedBindings.elements.length; - return validImports < 2; - } - return true; -} -function isModuleSpecifierMissingOrEmpty(specifier) { - var _a; - if (nodeIsMissing(specifier)) return true; - return !((_a = tryCast(isExternalModuleReference(specifier) ? specifier.expression : specifier, isStringLiteralLike)) == null ? void 0 : _a.text); -} -function getClosestSymbolDeclaration(contextToken, location) { - if (!contextToken) return; - let closestDeclaration = findAncestor(contextToken, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : (isParameter(node) || isTypeParameterDeclaration(node)) && !isIndexSignatureDeclaration(node.parent)); - if (!closestDeclaration) { - closestDeclaration = findAncestor(location, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : isVariableDeclaration(node)); - } - return closestDeclaration; -} -function isInTypeParameterDefault(contextToken) { - if (!contextToken) { - return false; - } - let node = contextToken; - let parent2 = contextToken.parent; - while (parent2) { - if (isTypeParameterDeclaration(parent2)) { - return parent2.default === node || node.kind === 64 /* EqualsToken */; - } - node = parent2; - parent2 = parent2.parent; - } - return false; -} -function isArrowFunctionBody(node) { - return node.parent && isArrowFunction(node.parent) && (node.parent.body === node || // const a = () => /**/; - node.kind === 39 /* EqualsGreaterThanToken */); -} -function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules = /* @__PURE__ */ new Set()) { - return nonAliasCanBeReferencedAtTypeLocation(symbol) || nonAliasCanBeReferencedAtTypeLocation(skipAlias(symbol.exportSymbol || symbol, checker)); - function nonAliasCanBeReferencedAtTypeLocation(symbol2) { - return !!(symbol2.flags & 788968 /* Type */) || checker.isUnknownSymbol(symbol2) || !!(symbol2.flags & 1536 /* Module */) && addToSeen(seenModules, symbol2) && checker.getExportsOfModule(symbol2).some((e) => symbolCanBeReferencedAtTypeLocation(e, checker, seenModules)); - } -} -function isDeprecated(symbol, checker) { - const declarations = skipAlias(symbol, checker).declarations; - return !!length(declarations) && every(declarations, isDeprecatedDeclaration); -} -function charactersFuzzyMatchInString(identifierString, lowercaseCharacters) { - if (lowercaseCharacters.length === 0) { - return true; - } - let matchedFirstCharacter = false; - let prevChar; - let characterIndex = 0; - const len = identifierString.length; - for (let strIndex = 0; strIndex < len; strIndex++) { - const strChar = identifierString.charCodeAt(strIndex); - const testChar = lowercaseCharacters.charCodeAt(characterIndex); - if (strChar === testChar || strChar === toUpperCharCode(testChar)) { - matchedFirstCharacter || (matchedFirstCharacter = prevChar === void 0 || // Beginning of word - 97 /* a */ <= prevChar && prevChar <= 122 /* z */ && 65 /* A */ <= strChar && strChar <= 90 /* Z */ || // camelCase transition - prevChar === 95 /* _ */ && strChar !== 95 /* _ */); - if (matchedFirstCharacter) { - characterIndex++; - } - if (characterIndex === lowercaseCharacters.length) { - return true; - } - } - prevChar = strChar; - } - return false; -} -function toUpperCharCode(charCode) { - if (97 /* a */ <= charCode && charCode <= 122 /* z */) { - return charCode - 32; - } - return charCode; -} -function isContextualKeywordInAutoImportableExpressionSpace(keyword) { - return keyword === "abstract" || keyword === "async" || keyword === "await" || keyword === "declare" || keyword === "module" || keyword === "namespace" || keyword === "type" || keyword === "satisfies" || keyword === "as"; -} - -// src/services/_namespaces/ts.Completions.StringCompletions.ts -var ts_Completions_StringCompletions_exports = {}; -__export(ts_Completions_StringCompletions_exports, { - getStringLiteralCompletionDetails: () => getStringLiteralCompletionDetails, - getStringLiteralCompletions: () => getStringLiteralCompletions -}); - -// src/services/stringCompletions.ts -var kindPrecedence = { - ["directory" /* directory */]: 0, - ["script" /* scriptElement */]: 1, - ["external module name" /* externalModuleName */]: 2 -}; -function createNameAndKindSet() { - const map2 = /* @__PURE__ */ new Map(); - function add(value) { - const existing = map2.get(value.name); - if (!existing || kindPrecedence[existing.kind] < kindPrecedence[value.kind]) { - map2.set(value.name, value); - } - } - return { - add, - has: map2.has.bind(map2), - values: map2.values.bind(map2) - }; -} -function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) { - if (isInReferenceComment(sourceFile, position)) { - const entries = getTripleSlashReferenceCompletion(sourceFile, position, program, host, createModuleSpecifierResolutionHost(program, host)); - return entries && convertPathCompletions(entries); - } - if (isInString(sourceFile, position, contextToken)) { - if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; - const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program, host, preferences); - return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol); - } -} -function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) { - if (completion === void 0) { - return void 0; - } - const optionalReplacementSpan = createTextSpanFromStringLiteralLikeContent(contextToken, position); - switch (completion.kind) { - case 0 /* Paths */: - return convertPathCompletions(completion.paths); - case 1 /* Properties */: { - const entries = createSortedArray(); - getCompletionEntriesFromSymbols( - completion.symbols, - entries, - contextToken, - contextToken, - sourceFile, - position, - sourceFile, - host, - program, - 99 /* ESNext */, - log, - 4 /* String */, - preferences, - options, - /*formatContext*/ - void 0, - /*isTypeOnlyLocation*/ - void 0, - /*propertyAccessToConvert*/ - void 0, - /*jsxIdentifierExpected*/ - void 0, - /*isJsxInitializer*/ - void 0, - /*importStatementCompletion*/ - void 0, - /*recommendedCompletion*/ - void 0, - /*symbolToOriginInfoMap*/ - void 0, - /*symbolToSortTextMap*/ - void 0, - /*isJsxIdentifierExpected*/ - void 0, - /*isRightOfOpenTag*/ - void 0, - includeSymbol - ); - return { - isGlobalCompletion: false, - isMemberCompletion: true, - isNewIdentifierLocation: completion.hasIndexSignature, - optionalReplacementSpan, - entries, - defaultCommitCharacters: getDefaultCommitCharacters(completion.hasIndexSignature) - }; - } - 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: escapeString(type.value, quoteChar), - kindModifiers: "" /* none */, - kind: "string" /* string */, - sortText: SortText.LocationPriority, - replacementSpan: getReplacementSpanForContextToken(contextToken, position), - commitCharacters: [] - })); - return { - isGlobalCompletion: false, - isMemberCompletion: false, - isNewIdentifierLocation: completion.isNewIdentifier, - optionalReplacementSpan, - entries, - defaultCommitCharacters: getDefaultCommitCharacters(completion.isNewIdentifier) - }; - } - default: - return Debug.assertNever(completion); - } -} -function getStringLiteralCompletionDetails(name, sourceFile, position, contextToken, program, host, cancellationToken, preferences) { - if (!contextToken || !isStringLiteralLike(contextToken)) return void 0; - 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) { - case 0 /* Paths */: { - const match = find(completion.paths, (p) => p.name === name); - return match && createCompletionDetails(name, kindModifiersFromExtension(match.extension), match.kind, [textPart(name)]); - } - case 1 /* Properties */: { - const match = find(completion.symbols, (s) => s.name === name); - return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken); - } - case 2 /* Types */: - return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0; - default: - return Debug.assertNever(completion); - } -} -function convertPathCompletions(pathCompletions) { - const isGlobalCompletion = false; - const isNewIdentifierLocation = true; - const entries = pathCompletions.map(({ name, kind, span, extension }) => ({ name, kind, kindModifiers: kindModifiersFromExtension(extension), sortText: SortText.LocationPriority, replacementSpan: span })); - return { - isGlobalCompletion, - isMemberCompletion: false, - isNewIdentifierLocation, - entries, - defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation) - }; -} -function kindModifiersFromExtension(extension) { - switch (extension) { - case ".d.ts" /* Dts */: - return ".d.ts" /* dtsModifier */; - case ".js" /* Js */: - return ".js" /* jsModifier */; - case ".json" /* Json */: - return ".json" /* jsonModifier */; - case ".jsx" /* Jsx */: - return ".jsx" /* jsxModifier */; - case ".ts" /* Ts */: - return ".ts" /* tsModifier */; - case ".tsx" /* Tsx */: - return ".tsx" /* tsxModifier */; - case ".d.mts" /* Dmts */: - return ".d.mts" /* dmtsModifier */; - case ".mjs" /* Mjs */: - return ".mjs" /* mjsModifier */; - case ".mts" /* Mts */: - return ".mts" /* mtsModifier */; - case ".d.cts" /* Dcts */: - return ".d.cts" /* dctsModifier */; - case ".cjs" /* Cjs */: - return ".cjs" /* cjsModifier */; - case ".cts" /* Cts */: - return ".cts" /* ctsModifier */; - case ".tsbuildinfo" /* TsBuildInfo */: - return Debug.fail(`Extension ${".tsbuildinfo" /* TsBuildInfo */} is unsupported.`); - case void 0: - return "" /* none */; - default: - return Debug.assertNever(extension); - } -} -function getStringLiteralCompletionEntries(sourceFile, node, position, program, host, preferences) { - const typeChecker = program.getTypeChecker(); - const parent2 = walkUpParentheses(node.parent); - switch (parent2.kind) { - case 202 /* LiteralType */: { - const grandParent = walkUpParentheses(parent2.parent); - if (grandParent.kind === 206 /* ImportType */) { - return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; - } - return fromUnionableLiteralType(grandParent); - } - case 304 /* PropertyAssignment */: - if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) { - return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); - } - return fromContextualType() || fromContextualType(0 /* None */); - case 213 /* ElementAccessExpression */: { - const { expression, argumentExpression } = parent2; - if (node === skipParentheses(argumentExpression)) { - return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression)); - } - return void 0; - } - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 292 /* JsxAttribute */: - if (!isRequireCallArgument(node) && !isImportCall(parent2)) { - const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 292 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile, typeChecker); - return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */); - } - // falls through (is `require("")` or `require(""` or `import("")`) - case 273 /* ImportDeclaration */: - case 279 /* ExportDeclaration */: - case 284 /* ExternalModuleReference */: - case 352 /* JSDocImportTag */: - return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; - case 297 /* CaseClause */: - const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses); - const contextualTypes = fromContextualType(); - if (!contextualTypes) { - return; - } - const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); - return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; - case 277 /* ImportSpecifier */: - case 282 /* ExportSpecifier */: - const specifier = parent2; - if (specifier.propertyName && node !== specifier.propertyName) { - return; - } - const namedImportsOrExports = specifier.parent; - const { moduleSpecifier } = namedImportsOrExports.kind === 276 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; - if (!moduleSpecifier) return; - const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); - if (!moduleSpecifierSymbol) return; - const exports2 = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol); - const existing = new Set(namedImportsOrExports.elements.map((n) => moduleExportNameTextEscaped(n.propertyName || n.name))); - const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName)); - return { kind: 1 /* Properties */, symbols: uniques, hasIndexSignature: false }; - case 227 /* BinaryExpression */: - if (parent2.operatorToken.kind === 103 /* InKeyword */) { - const type = typeChecker.getTypeAtLocation(parent2.right); - const properties = type.isUnion() ? typeChecker.getAllPossiblePropertiesOfTypes(type.types) : type.getApparentProperties(); - return { - kind: 1 /* Properties */, - symbols: properties.filter((prop) => !prop.valueDeclaration || !isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration)), - hasIndexSignature: false - }; - } - return fromContextualType(0 /* None */); - default: - return fromContextualType() || fromContextualType(0 /* None */); - } - function fromUnionableLiteralType(grandParent) { - switch (grandParent.kind) { - case 234 /* ExpressionWithTypeArguments */: - case 184 /* 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 200 /* IndexedAccessType */: - const { indexType, objectType } = grandParent; - if (!rangeContainsPosition(indexType, position)) { - return void 0; - } - return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 193 /* UnionType */: { - const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent)); - if (!result) { - return void 0; - } - const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2); - if (result.kind === 1 /* Properties */) { - return { kind: 1 /* Properties */, symbols: result.symbols.filter((sym) => !contains(alreadyUsedTypes, sym.name)), hasIndexSignature: result.hasIndexSignature }; - } - return { kind: 2 /* Types */, types: result.types.filter((t) => !contains(alreadyUsedTypes, t.value)), isNewIdentifier: false }; - } - default: - return void 0; - } - } - function fromContextualType(contextFlags = 4 /* Completions */) { - const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); - if (!types.length) { - return; - } - return { kind: 2 /* Types */, types, isNewIdentifier: false }; - } -} -function walkUpParentheses(node) { - switch (node.kind) { - case 197 /* ParenthesizedType */: - return walkUpParenthesizedTypes(node); - case 218 /* ParenthesizedExpression */: - return walkUpParenthesizedExpressions(node); - default: - return node; - } -} -function getAlreadyUsedTypesInStringLiteralUnion(union, current) { - return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0); -} -function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) { - let isNewIdentifier = false; - const uniques = /* @__PURE__ */ new Set(); - const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg; - const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument); - const types = flatMap(candidates, (candidate) => { - if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length) return; - let type = candidate.getTypeParameterAtPosition(argumentInfo.argumentIndex); - if (isJsxOpeningLikeElement(call)) { - const propType = checker.getTypeOfPropertyOfType(type, getTextOfJsxAttributeName(editingArgument.name)); - if (propType) { - type = propType; - } - } - isNewIdentifier = isNewIdentifier || !!(type.flags & 4 /* String */); - return getStringLiteralTypes(type, uniques); - }); - return length(types) ? { kind: 2 /* Types */, types, isNewIdentifier } : void 0; -} -function stringLiteralCompletionsFromProperties(type) { - return type && { - kind: 1 /* Properties */, - symbols: filter(type.getApparentProperties(), (prop) => !(prop.valueDeclaration && isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration))), - hasIndexSignature: hasIndexSignature(type) - }; -} -function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpression) { - const contextualType = checker.getContextualType(objectLiteralExpression); - if (!contextualType) return void 0; - const completionsType = checker.getContextualType(objectLiteralExpression, 4 /* Completions */); - const symbols = getPropertiesForObjectExpression( - contextualType, - completionsType, - objectLiteralExpression, - checker - ); - return { - kind: 1 /* Properties */, - symbols, - hasIndexSignature: hasIndexSignature(contextualType) - }; -} -function getStringLiteralTypes(type, uniques = /* @__PURE__ */ new Set()) { - if (!type) return emptyArray; - type = skipConstraint(type); - return type.isUnion() ? flatMap(type.types, (t) => getStringLiteralTypes(t, uniques)) : type.isStringLiteral() && !(type.flags & 1024 /* EnumLiteral */) && addToSeen(uniques, type.value) ? [type] : emptyArray; -} -function nameAndKind(name, kind, extension) { - return { name, kind, extension }; -} -function directoryResult(name) { - return nameAndKind( - name, - "directory" /* directory */, - /*extension*/ - void 0 - ); -} -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 }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span }); -} -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, program, host, preferences) { - const literalValue = normalizeSlashes(node.text); - 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 moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); - const extensionOptions = getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile, typeChecker, preferences, mode); - return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && !compilerOptions.paths && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, program, host, moduleSpecifierResolutionHost, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, program, host, moduleSpecifierResolutionHost, extensionOptions); -} -function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, typeChecker, preferences, resolutionMode) { - return { - extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker)), - referenceKind, - importingSourceFile, - endingPreference: preferences == null ? void 0 : preferences.importModuleSpecifierEnding, - resolutionMode - }; -} -function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, program, host, moduleSpecifierResolutionHost, scriptPath, extensionOptions) { - const compilerOptions = program.getCompilerOptions(); - if (compilerOptions.rootDirs) { - return getCompletionEntriesForDirectoryFragmentWithRootDirs( - compilerOptions.rootDirs, - literalValue, - scriptDirectory, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - scriptPath - ); - } else { - return arrayFrom(getCompletionEntriesForDirectoryFragment( - literalValue, - scriptDirectory, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - /*moduleSpecifierIsRelative*/ - 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 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) => 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].map((baseDir) => removeTrailingDirectorySeparator(baseDir)), - equateStringsCaseSensitive, - compareStringsCaseSensitive - ); -} -function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, exclude) { - const compilerOptions = program.getCompilerOptions(); - const basePath = compilerOptions.project || host.getCurrentDirectory(); - const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); - return deduplicate( - flatMap(baseDirectories, (baseDirectory) => arrayFrom(getCompletionEntriesForDirectoryFragment( - fragment, - baseDirectory, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - /*moduleSpecifierIsRelative*/ - true, - exclude - ).values())), - (itemA, itemB) => itemA.name === itemB.name && itemA.kind === itemB.kind && itemA.extension === itemB.extension - ); -} -function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, moduleSpecifierIsRelative, exclude, result = createNameAndKindSet()) { - var _a; - if (fragment === void 0) { - fragment = ""; - } - fragment = normalizeSlashes(fragment); - if (!hasTrailingDirectorySeparator(fragment)) { - fragment = getDirectoryPath(fragment); - } - if (fragment === "") { - fragment = "." + directorySeparator; - } - fragment = ensureTrailingDirectorySeparator(fragment); - const absolutePath = resolvePath(scriptDirectory, fragment); - const baseDirectory = hasTrailingDirectorySeparator(absolutePath) ? absolutePath : getDirectoryPath(absolutePath); - if (!moduleSpecifierIsRelative) { - const packageJsonPath = findPackageJson(baseDirectory, host); - if (packageJsonPath) { - const packageJson = readJson(packageJsonPath, host); - const typesVersions = packageJson.typesVersions; - if (typeof typesVersions === "object") { - const versionPaths = (_a = getPackageJsonTypesVersionsPaths(typesVersions)) == null ? void 0 : _a.paths; - if (versionPaths) { - const packageDirectory = getDirectoryPath(packageJsonPath); - const pathInPackage = absolutePath.slice(ensureTrailingDirectorySeparator(packageDirectory).length); - if (addCompletionEntriesFromPaths(result, pathInPackage, packageDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, versionPaths)) { - return result; - } - } - } - } - } - const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - if (!tryDirectoryExists(host, baseDirectory)) return result; - const files = tryReadDirectory( - host, - baseDirectory, - extensionOptions.extensionsToSearch, - /*exclude*/ - void 0, - /*include*/ - ["./*"] - ); - if (files) { - for (let filePath of files) { - filePath = normalizePath(filePath); - if (exclude && comparePaths(filePath, exclude, scriptDirectory, ignoreCase) === 0 /* EqualTo */) { - continue; - } - const { name, extension } = getFilenameWithExtensionOption( - getBaseFileName(filePath), - program, - extensionOptions, - /*isExportsOrImportsWildcard*/ - false - ); - result.add(nameAndKind(name, "script" /* scriptElement */, extension)); - } - } - const directories = tryGetDirectories(host, baseDirectory); - if (directories) { - for (const directory of directories) { - const directoryName = getBaseFileName(normalizePath(directory)); - if (directoryName !== "@types") { - result.add(directoryResult(directoryName)); - } - } - } - return result; -} -function getFilenameWithExtensionOption(name, program, extensionOptions, isExportsOrImportsWildcard) { - const nonJsResult = ts_moduleSpecifiers_exports.tryGetRealFileNameForNonJsDeclarationFileName(name); - if (nonJsResult) { - return { name: nonJsResult, extension: tryGetExtensionFromPath2(nonJsResult) }; - } - if (extensionOptions.referenceKind === 0 /* Filename */) { - return { name, extension: tryGetExtensionFromPath2(name) }; - } - let allowedEndings = ts_moduleSpecifiers_exports.getModuleSpecifierPreferences( - { importModuleSpecifierEnding: extensionOptions.endingPreference }, - program, - program.getCompilerOptions(), - extensionOptions.importingSourceFile - ).getAllowedEndingsInPreferredOrder(extensionOptions.resolutionMode); - if (isExportsOrImportsWildcard) { - 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, program.getCompilerOptions()); - return outputExtension2 ? { name: changeExtension(name, outputExtension2), extension: outputExtension2 } : { name, extension: tryGetExtensionFromPath2(name) }; - } - if (!isExportsOrImportsWildcard && (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, program.getCompilerOptions()); - return outputExtension ? { name: changeExtension(name, outputExtension), extension: outputExtension } : { name, extension: tryGetExtensionFromPath2(name) }; -} -function addCompletionEntriesFromPaths(result, fragment, baseDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, paths) { - const getPatternsForKey = (key) => paths[key]; - const comparePaths2 = (a, b) => { - const patternA = tryParsePattern(a); - const patternB = tryParsePattern(b); - const lengthA = typeof patternA === "object" ? patternA.prefix.length : a.length; - const lengthB = typeof patternB === "object" ? patternB.prefix.length : b.length; - return compareValues(lengthB, lengthA); - }; - return addCompletionEntriesFromPathsOrExportsOrImports( - result, - /*isExports*/ - false, - /*isImports*/ - false, - fragment, - baseDirectory, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - getOwnKeys(paths), - getPatternsForKey, - comparePaths2 - ); -} -function addCompletionEntriesFromPathsOrExportsOrImports(result, isExports, isImports, fragment, baseDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, keys, getPatternsForKey, comparePaths2) { - let pathResults = []; - let matchedPath; - for (const key of keys) { - if (key === ".") continue; - const keyWithoutLeadingDotSlash = key.replace(/^\.\//, "") + ((isExports || isImports) && endsWith(key, "/") ? "*" : ""); - const patterns = getPatternsForKey(key); - if (patterns) { - const pathPattern = tryParsePattern(keyWithoutLeadingDotSlash); - if (!pathPattern) continue; - const isMatch = typeof pathPattern === "object" && isPatternMatch(pathPattern, fragment); - const isLongestMatch = isMatch && (matchedPath === void 0 || comparePaths2(keyWithoutLeadingDotSlash, matchedPath) === -1 /* LessThan */); - if (isLongestMatch) { - matchedPath = keyWithoutLeadingDotSlash; - pathResults = pathResults.filter((r) => !r.matchedPattern); - } - if (typeof pathPattern === "string" || matchedPath === void 0 || comparePaths2(keyWithoutLeadingDotSlash, matchedPath) !== 1 /* GreaterThan */) { - pathResults.push({ - matchedPattern: isMatch, - results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost).map(({ name, kind, extension }) => nameAndKind(name, kind, extension)) - }); - } - } - } - pathResults.forEach((pathResult) => pathResult.results.forEach((r) => result.add(r))); - return matchedPath !== void 0; -} -function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, program, host, moduleSpecifierResolutionHost, extensionOptions) { - const typeChecker = program.getTypeChecker(); - const compilerOptions = program.getCompilerOptions(); - const { baseUrl, paths } = compilerOptions; - const result = createNameAndKindSet(); - const moduleResolution = getEmitModuleResolutionKind(compilerOptions); - if (baseUrl) { - const absolute = normalizePath(combinePaths(host.getCurrentDirectory(), baseUrl)); - getCompletionEntriesForDirectoryFragment( - fragment, - absolute, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - /*moduleSpecifierIsRelative*/ - false, - /*exclude*/ - void 0, - result - ); - } - if (paths) { - const absolute = getPathsBasePath(compilerOptions, host); - addCompletionEntriesFromPaths(result, fragment, absolute, extensionOptions, program, host, moduleSpecifierResolutionHost, paths); - } - const fragmentDirectory = getFragmentDirectory(fragment); - for (const ambientName of getAmbientModuleCompletions(fragment, fragmentDirectory, typeChecker)) { - result.add(nameAndKind( - ambientName, - "external module name" /* externalModuleName */, - /*extension*/ - void 0 - )); - } - getCompletionEntriesFromTypings(program, host, moduleSpecifierResolutionHost, scriptPath, fragmentDirectory, extensionOptions, result); - if (moduleResolutionUsesNodeModules(moduleResolution)) { - let foundGlobal = false; - if (fragmentDirectory === void 0) { - for (const moduleName of enumerateNodeModulesVisibleToScript(host, scriptPath)) { - const moduleResult = nameAndKind( - moduleName, - "external module name" /* externalModuleName */, - /*extension*/ - void 0 - ); - if (!result.has(moduleResult.name)) { - foundGlobal = true; - result.add(moduleResult); - } - } - } - if (!foundGlobal) { - const resolvePackageJsonExports = getResolvePackageJsonExports(compilerOptions); - const resolvePackageJsonImports = getResolvePackageJsonImports(compilerOptions); - let seenPackageScope = false; - const importsLookup = (directory) => { - if (resolvePackageJsonImports && !seenPackageScope) { - const packageFile = combinePaths(directory, "package.json"); - if (seenPackageScope = tryFileExists(host, packageFile)) { - const packageJson = readJson(packageFile, host); - exportsOrImportsLookup( - packageJson.imports, - fragment, - directory, - /*isExports*/ - false, - /*isImports*/ - true - ); - } - } - }; - let ancestorLookup = (ancestor) => { - const nodeModules = combinePaths(ancestor, "node_modules"); - if (tryDirectoryExists(host, nodeModules)) { - getCompletionEntriesForDirectoryFragment( - fragment, - nodeModules, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - /*moduleSpecifierIsRelative*/ - false, - /*exclude*/ - void 0, - result - ); - } - importsLookup(ancestor); - }; - if (fragmentDirectory && resolvePackageJsonExports) { - const nodeModulesDirectoryOrImportsLookup = ancestorLookup; - ancestorLookup = (ancestor) => { - const components = getPathComponents(fragment); - components.shift(); - let packagePath = components.shift(); - if (!packagePath) { - return nodeModulesDirectoryOrImportsLookup(ancestor); - } - if (startsWith(packagePath, "@")) { - const subName = components.shift(); - if (!subName) { - return nodeModulesDirectoryOrImportsLookup(ancestor); - } - packagePath = combinePaths(packagePath, subName); - } - if (resolvePackageJsonImports && startsWith(packagePath, "#")) { - return importsLookup(ancestor); - } - const packageDirectory = combinePaths(ancestor, "node_modules", packagePath); - const packageFile = combinePaths(packageDirectory, "package.json"); - if (tryFileExists(host, packageFile)) { - const packageJson = readJson(packageFile, host); - const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : ""); - exportsOrImportsLookup( - packageJson.exports, - fragmentSubpath, - packageDirectory, - /*isExports*/ - true, - /*isImports*/ - false - ); - return; - } - return nodeModulesDirectoryOrImportsLookup(ancestor); - }; - } - forEachAncestorDirectoryStoppingAtGlobalCache(host, scriptPath, ancestorLookup); - } - } - return arrayFrom(result.values()); - function exportsOrImportsLookup(lookupTable, fragment2, baseDirectory, isExports, isImports) { - if (typeof lookupTable !== "object" || lookupTable === null) { - return; - } - const keys = getOwnKeys(lookupTable); - const conditions = getConditions(compilerOptions, mode); - addCompletionEntriesFromPathsOrExportsOrImports( - result, - isExports, - isImports, - fragment2, - baseDirectory, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - keys, - (key) => { - const pattern = getPatternFromFirstMatchingCondition(lookupTable[key], conditions); - if (pattern === void 0) { - return void 0; - } - return singleElementArray(endsWith(key, "/") && endsWith(pattern, "/") ? pattern + "*" : pattern); - }, - comparePatternKeys - ); - } -} -function getPatternFromFirstMatchingCondition(target, conditions) { - if (typeof target === "string") { - return target; - } - if (target && typeof target === "object" && !isArray(target)) { - for (const condition in target) { - if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) { - const pattern = target[condition]; - return getPatternFromFirstMatchingCondition(pattern, conditions); - } - } - } -} -function getFragmentDirectory(fragment) { - return containsSlash(fragment) ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0; -} -function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost) { - const parsedPath = tryParsePattern(path); - if (!parsedPath) { - return emptyArray; - } - if (typeof parsedPath === "string") { - return justPathMappingName(path, "script" /* scriptElement */); - } - const remainingFragment = tryRemovePrefix(fragment, parsedPath.prefix); - if (remainingFragment === void 0) { - const starIsFullPathComponent = endsWith(path, "/*"); - return starIsFullPathComponent ? justPathMappingName(parsedPath.prefix, "directory" /* directory */) : flatMap(patterns, (pattern) => { - var _a; - return (_a = getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost)) == null ? void 0 : _a.map(({ name, ...rest }) => ({ name: parsedPath.prefix + name + parsedPath.suffix, ...rest })); - }); - } - return flatMap(patterns, (pattern) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost)); - function justPathMappingName(name, kind) { - return startsWith(name, fragment) ? [{ name: removeTrailingDirectorySeparator(name), kind, extension: void 0 }] : emptyArray; - } -} -function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost) { - if (!host.readDirectory) { - return void 0; - } - const parsed = tryParsePattern(pattern); - if (parsed === void 0 || isString(parsed)) { - return void 0; - } - const normalizedPrefix = resolvePath(parsed.prefix); - const normalizedPrefixDirectory = hasTrailingDirectorySeparator(parsed.prefix) ? normalizedPrefix : getDirectoryPath(normalizedPrefix); - const normalizedPrefixBase = hasTrailingDirectorySeparator(parsed.prefix) ? "" : getBaseFileName(normalizedPrefix); - const fragmentHasPath = containsSlash(fragment); - const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0; - const getCommonSourceDirectory2 = () => moduleSpecifierResolutionHost.getCommonSourceDirectory(); - const ignoreCase = !hostUsesCaseSensitiveFileNames(moduleSpecifierResolutionHost); - const outDir = program.getCompilerOptions().outDir; - const declarationDir = program.getCompilerOptions().declarationDir; - const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory; - const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory)); - const possibleInputBaseDirectoryForOutDir = isImports && outDir && getPossibleOriginalInputPathWithoutChangingExt(baseDirectory, ignoreCase, outDir, getCommonSourceDirectory2); - const possibleInputBaseDirectoryForDeclarationDir = isImports && declarationDir && getPossibleOriginalInputPathWithoutChangingExt(baseDirectory, ignoreCase, declarationDir, getCommonSourceDirectory2); - const normalizedSuffix = normalizePath(parsed.suffix); - const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix); - const inputExtension = normalizedSuffix ? getPossibleOriginalInputExtensionForExtension("_" + normalizedSuffix) : void 0; - const matchingSuffixes = [ - declarationExtension && changeExtension(normalizedSuffix, declarationExtension), - ...inputExtension ? inputExtension.map((ext) => changeExtension(normalizedSuffix, ext)) : [], - normalizedSuffix - ].filter(isString); - const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"]; - const isExportsOrImportsWildcard = (isExports || isImports) && endsWith(pattern, "/*"); - let matches = getMatchesWithPrefix(baseDirectory); - if (possibleInputBaseDirectoryForOutDir) { - matches = concatenate(matches, getMatchesWithPrefix(possibleInputBaseDirectoryForOutDir)); - } - if (possibleInputBaseDirectoryForDeclarationDir) { - matches = concatenate(matches, getMatchesWithPrefix(possibleInputBaseDirectoryForDeclarationDir)); - } - if (!normalizedSuffix) { - matches = concatenate(matches, getDirectoryMatches(baseDirectory)); - if (possibleInputBaseDirectoryForOutDir) { - matches = concatenate(matches, getDirectoryMatches(possibleInputBaseDirectoryForOutDir)); - } - if (possibleInputBaseDirectoryForDeclarationDir) { - matches = concatenate(matches, getDirectoryMatches(possibleInputBaseDirectoryForDeclarationDir)); - } - } - return matches; - function getMatchesWithPrefix(directory) { - const completePrefix = fragmentHasPath ? directory : ensureTrailingDirectorySeparator(directory) + normalizedPrefixBase; - return mapDefined(tryReadDirectory( - host, - directory, - extensionOptions.extensionsToSearch, - /*exclude*/ - void 0, - includeGlobs - ), (match) => { - const trimmedWithPattern = trimPrefixAndSuffix(match, completePrefix); - if (trimmedWithPattern) { - if (containsSlash(trimmedWithPattern)) { - return directoryResult(getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]); - } - const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, program, extensionOptions, isExportsOrImportsWildcard); - return nameAndKind(name, "script" /* scriptElement */, extension); - } - }); - } - function getDirectoryMatches(directoryName) { - return mapDefined(tryGetDirectories(host, directoryName), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir)); - } - function trimPrefixAndSuffix(path, prefix) { - return firstDefined(matchingSuffixes, (suffix) => { - const inner = withoutStartAndEnd(normalizePath(path), prefix, suffix); - return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner); - }); - } -} -function withoutStartAndEnd(s, start, end) { - return startsWith(s, start) && endsWith(s, end) ? s.slice(start.length, s.length - end.length) : void 0; -} -function removeLeadingDirectorySeparator(path) { - return path[0] === directorySeparator ? path.slice(1) : path; -} -function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) { - const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name)); - 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)); - } - return nonRelativeModuleNames; -} -function getTripleSlashReferenceCompletion(sourceFile, position, program, host, moduleSpecifierResolutionHost) { - const compilerOptions = program.getCompilerOptions(); - const token = getTokenAtPosition(sourceFile, position); - const commentRanges = getLeadingCommentRanges(sourceFile.text, token.pos); - const range = commentRanges && find(commentRanges, (commentRange) => position >= commentRange.pos && position <= commentRange.end); - if (!range) { - return void 0; - } - const text = sourceFile.text.slice(range.pos, position); - const match = tripleSlashDirectiveFragmentRegex.exec(text); - if (!match) { - return void 0; - } - const [, prefix, kind, toComplete] = match; - const scriptPath = getDirectoryPath(sourceFile.path); - const names = kind === "path" ? getCompletionEntriesForDirectoryFragment( - toComplete, - scriptPath, - getExtensionOptions(compilerOptions, 0 /* Filename */, sourceFile), - program, - host, - moduleSpecifierResolutionHost, - /*moduleSpecifierIsRelative*/ - true, - sourceFile.path - ) : kind === "types" ? getCompletionEntriesFromTypings(program, host, moduleSpecifierResolutionHost, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile)) : Debug.fail(); - return addReplacementSpans(toComplete, range.pos + prefix.length, arrayFrom(names.values())); -} -function getCompletionEntriesFromTypings(program, host, moduleSpecifierResolutionHost, scriptPath, fragmentDirectory, extensionOptions, result = createNameAndKindSet()) { - const options = program.getCompilerOptions(); - const seen = /* @__PURE__ */ new Map(); - const typeRoots = tryAndIgnoreErrors(() => getEffectiveTypeRoots(options, host)) || emptyArray; - for (const root of typeRoots) { - getCompletionEntriesFromDirectories(root); - } - for (const packageJson of findPackageJsons(scriptPath, host)) { - const typesDir = combinePaths(getDirectoryPath(packageJson), "node_modules/@types"); - getCompletionEntriesFromDirectories(typesDir); - } - return result; - function getCompletionEntriesFromDirectories(directory) { - if (!tryDirectoryExists(host, directory)) return; - for (const typeDirectoryName of tryGetDirectories(host, directory)) { - const packageName = unmangleScopedPackageName(typeDirectoryName); - if (options.types && !contains(options.types, packageName)) continue; - if (fragmentDirectory === void 0) { - if (!seen.has(packageName)) { - result.add(nameAndKind( - packageName, - "external module name" /* externalModuleName */, - /*extension*/ - void 0 - )); - seen.set(packageName, true); - } - } else { - const baseDirectory = combinePaths(directory, typeDirectoryName); - const remainingFragment = tryRemoveDirectoryPrefix(fragmentDirectory, packageName, hostGetCanonicalFileName(host)); - if (remainingFragment !== void 0) { - getCompletionEntriesForDirectoryFragment( - remainingFragment, - baseDirectory, - extensionOptions, - program, - host, - moduleSpecifierResolutionHost, - /*moduleSpecifierIsRelative*/ - false, - /*exclude*/ - void 0, - result - ); - } - } - } - } -} -function enumerateNodeModulesVisibleToScript(host, scriptPath) { - if (!host.readFile || !host.fileExists) return emptyArray; - const result = []; - for (const packageJson of findPackageJsons(scriptPath, host)) { - const contents = readJson(packageJson, host); - for (const key of nodeModulesDependencyKeys) { - const dependencies = contents[key]; - if (!dependencies) continue; - for (const dep in dependencies) { - if (hasProperty(dependencies, dep) && !startsWith(dep, "@types/")) { - result.push(dep); - } - } - } - } - return result; -} -function getDirectoryFragmentTextSpan(text, textStart) { - const index = Math.max(text.lastIndexOf(directorySeparator), text.lastIndexOf(altDirectorySeparator)); - const offset = index !== -1 ? index + 1 : 0; - const length2 = text.length - offset; - return length2 === 0 || isIdentifierText(text.substr(offset, length2), 99 /* ESNext */) ? void 0 : createTextSpan(textStart + offset, length2); -} -function isPathRelativeToScript(path) { - if (path && path.length >= 2 && path.charCodeAt(0) === 46 /* dot */) { - const slashIndex = path.length >= 3 && path.charCodeAt(1) === 46 /* dot */ ? 2 : 1; - const slashCharCode = path.charCodeAt(slashIndex); - return slashCharCode === 47 /* slash */ || slashCharCode === 92 /* backslash */; - } - return false; -} -var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* Core, - DefinitionKind: () => DefinitionKind, - EntryKind: () => EntryKind, - ExportKind: () => ExportKind2, - FindReferencesUse: () => FindReferencesUse, - ImportExport: () => ImportExport, - createImportTracker: () => createImportTracker, - findModuleReferences: () => findModuleReferences, - findReferenceOrRenameEntries: () => findReferenceOrRenameEntries, - findReferencedSymbols: () => findReferencedSymbols, - getContextNode: () => getContextNode, - getExportInfo: () => getExportInfo, - getImplementationsAtPosition: () => getImplementationsAtPosition, - getImportOrExportSymbol: () => getImportOrExportSymbol, - getReferenceEntriesForNode: () => getReferenceEntriesForNode, - isContextWithStartAndEndNode: () => isContextWithStartAndEndNode, - isDeclarationOfSymbol: () => isDeclarationOfSymbol, - isWriteAccessForReference: () => isWriteAccessForReference, - toContextSpan: () => toContextSpan, - toHighlightSpan: () => toHighlightSpan, - toReferenceEntry: () => toReferenceEntry, - toRenameLocation: () => toRenameLocation -}); - -// src/services/importTracker.ts -function createImportTracker(sourceFiles, sourceFilesSet, checker, cancellationToken) { - const allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); - return (exportSymbol, exportInfo, isForRename) => { - const { directImports, indirectUsers } = getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, exportInfo, checker, cancellationToken); - return { indirectUsers, ...getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename) }; - }; -} -var ExportKind2 = /* @__PURE__ */ ((ExportKind3) => { - ExportKind3[ExportKind3["Named"] = 0] = "Named"; - ExportKind3[ExportKind3["Default"] = 1] = "Default"; - ExportKind3[ExportKind3["ExportEquals"] = 2] = "ExportEquals"; - return ExportKind3; -})(ExportKind2 || {}); -var ImportExport = /* @__PURE__ */ ((ImportExport2) => { - ImportExport2[ImportExport2["Import"] = 0] = "Import"; - ImportExport2[ImportExport2["Export"] = 1] = "Export"; - return ImportExport2; -})(ImportExport || {}); -function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { exportingModuleSymbol, exportKind }, checker, cancellationToken) { - const markSeenDirectImport = nodeSeenTracker(); - const markSeenIndirectUser = nodeSeenTracker(); - const directImports = []; - const isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; - const indirectUserDeclarations = isAvailableThroughGlobal ? void 0 : []; - handleDirectImports(exportingModuleSymbol); - return { directImports, indirectUsers: getIndirectUsers() }; - function getIndirectUsers() { - if (isAvailableThroughGlobal) { - return sourceFiles; - } - if (exportingModuleSymbol.declarations) { - for (const decl of exportingModuleSymbol.declarations) { - if (isExternalModuleAugmentation(decl) && sourceFilesSet.has(decl.getSourceFile().fileName)) { - addIndirectUser(decl); - } - } - } - return indirectUserDeclarations.map(getSourceFileOfNode); - } - function handleDirectImports(exportingModuleSymbol2) { - const theseDirectImports = getDirectImports(exportingModuleSymbol2); - if (theseDirectImports) { - for (const direct of theseDirectImports) { - if (!markSeenDirectImport(direct)) { - continue; - } - if (cancellationToken) cancellationToken.throwIfCancellationRequested(); - switch (direct.kind) { - case 214 /* CallExpression */: - if (isImportCall(direct)) { - handleImportCall(direct); - break; - } - if (!isAvailableThroughGlobal) { - const parent2 = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent2.kind === 261 /* VariableDeclaration */) { - const { name } = parent2; - if (name.kind === 80 /* Identifier */) { - directImports.push(name); - break; - } - } - } - break; - case 80 /* Identifier */: - break; - // TODO: GH#23879 - case 272 /* ImportEqualsDeclaration */: - handleNamespaceImport( - direct, - direct.name, - hasSyntacticModifier(direct, 32 /* Export */), - /*alreadyAddedDirect*/ - false - ); - break; - case 273 /* ImportDeclaration */: - case 352 /* JSDocImportTag */: - directImports.push(direct); - const namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 275 /* NamespaceImport */) { - handleNamespaceImport( - direct, - namedBindings.name, - /*isReExport*/ - false, - /*alreadyAddedDirect*/ - true - ); - } else if (!isAvailableThroughGlobal && isDefaultImport(direct)) { - addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); - } - break; - case 279 /* ExportDeclaration */: - if (!direct.exportClause) { - handleDirectImports(getContainingModuleSymbol(direct, checker)); - } else if (direct.exportClause.kind === 281 /* NamespaceExport */) { - addIndirectUser( - getSourceFileLikeForImportDeclaration(direct), - /*addTransitiveDependencies*/ - true - ); - } else { - directImports.push(direct); - } - break; - case 206 /* ImportType */: - if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) { - addIndirectUser( - direct.getSourceFile(), - /*addTransitiveDependencies*/ - true - ); - } - directImports.push(direct); - break; - default: - Debug.failBadSyntaxKind(direct, "Unexpected import kind."); - } - } - } - } - function handleImportCall(importCall) { - const top = findAncestor(importCall, isAmbientModuleDeclaration) || importCall.getSourceFile(); - addIndirectUser( - top, - /** addTransitiveDependencies */ - !!isExported2( - importCall, - /*stopAtAmbientModule*/ - true - ) - ); - } - function isExported2(node, stopAtAmbientModule = false) { - return findAncestor(node, (node2) => { - if (stopAtAmbientModule && isAmbientModuleDeclaration(node2)) return "quit"; - return canHaveModifiers(node2) && some(node2.modifiers, isExportModifier); - }); - } - function handleNamespaceImport(importDeclaration, name, isReExport, alreadyAddedDirect) { - if (exportKind === 2 /* ExportEquals */) { - if (!alreadyAddedDirect) directImports.push(importDeclaration); - } else if (!isAvailableThroughGlobal) { - const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - Debug.assert(sourceFileLike.kind === 308 /* SourceFile */ || sourceFileLike.kind === 268 /* ModuleDeclaration */); - if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { - addIndirectUser( - sourceFileLike, - /*addTransitiveDependencies*/ - true - ); - } else { - addIndirectUser(sourceFileLike); - } - } - } - function addIndirectUser(sourceFileLike, addTransitiveDependencies = false) { - Debug.assert(!isAvailableThroughGlobal); - const isNew = markSeenIndirectUser(sourceFileLike); - if (!isNew) return; - indirectUserDeclarations.push(sourceFileLike); - if (!addTransitiveDependencies) return; - const moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); - if (!moduleSymbol) return; - Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */)); - const directImports2 = getDirectImports(moduleSymbol); - if (directImports2) { - for (const directImport of directImports2) { - if (!isImportTypeNode(directImport)) { - addIndirectUser( - getSourceFileLikeForImportDeclaration(directImport), - /*addTransitiveDependencies*/ - true - ); - } - } - } - } - function getDirectImports(moduleSymbol) { - return allDirectImports.get(getSymbolId(moduleSymbol).toString()); - } -} -function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { - const importSearches = []; - const singleReferences = []; - function addSearch(location, symbol) { - importSearches.push([location, symbol]); - } - if (directImports) { - for (const decl of directImports) { - handleImport(decl); - } - } - return { importSearches, singleReferences }; - function handleImport(decl) { - if (decl.kind === 272 /* ImportEqualsDeclaration */) { - if (isExternalModuleImportEquals(decl)) { - handleNamespaceImportLike(decl.name); - } - return; - } - if (decl.kind === 80 /* Identifier */) { - handleNamespaceImportLike(decl); - return; - } - if (decl.kind === 206 /* ImportType */) { - if (decl.qualifier) { - const firstIdentifier = getFirstIdentifier(decl.qualifier); - if (firstIdentifier.escapedText === symbolName(exportSymbol)) { - singleReferences.push(firstIdentifier); - } - } else if (exportKind === 2 /* ExportEquals */) { - singleReferences.push(decl.argument.literal); - } - return; - } - if (decl.moduleSpecifier.kind !== 11 /* StringLiteral */) { - return; - } - if (decl.kind === 279 /* ExportDeclaration */) { - if (decl.exportClause && isNamedExports(decl.exportClause)) { - searchForNamedImport(decl.exportClause); - } - return; - } - const { name, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 }; - if (namedBindings) { - switch (namedBindings.kind) { - case 275 /* NamespaceImport */: - handleNamespaceImportLike(namedBindings.name); - break; - case 276 /* NamedImports */: - if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { - searchForNamedImport(namedBindings); - } - break; - default: - Debug.assertNever(namedBindings); - } - } - if (name && (exportKind === 1 /* Default */ || exportKind === 2 /* ExportEquals */) && (!isForRename || name.escapedText === symbolEscapedNameNoDefault(exportSymbol))) { - const defaultImportAlias = checker.getSymbolAtLocation(name); - addSearch(name, defaultImportAlias); - } - } - function handleNamespaceImportLike(importName) { - if (exportKind === 2 /* ExportEquals */ && (!isForRename || isNameMatch(importName.escapedText))) { - addSearch(importName, checker.getSymbolAtLocation(importName)); - } - } - function searchForNamedImport(namedBindings) { - if (!namedBindings) { - return; - } - for (const element of namedBindings.elements) { - const { name, propertyName } = element; - if (!isNameMatch(moduleExportNameTextEscaped(propertyName || name))) { - continue; - } - if (propertyName) { - singleReferences.push(propertyName); - if (!isForRename || moduleExportNameTextEscaped(name) === exportSymbol.escapedName) { - addSearch(name, checker.getSymbolAtLocation(name)); - } - } else { - const localSymbol = element.kind === 282 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); - addSearch(name, localSymbol); - } - } - } - function isNameMatch(name) { - return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === "default" /* Default */; - } -} -function findNamespaceReExports(sourceFileLike, name, checker) { - const namespaceImportSymbol = checker.getSymbolAtLocation(name); - return !!forEachPossibleImportOrExportStatement(sourceFileLike, (statement) => { - if (!isExportDeclaration(statement)) return; - const { exportClause, moduleSpecifier } = statement; - return !moduleSpecifier && exportClause && isNamedExports(exportClause) && exportClause.elements.some((element) => checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol); - }); -} -function findModuleReferences(program, sourceFiles, searchModuleSymbol) { - var _a; - const refs = []; - const checker = program.getTypeChecker(); - for (const referencingFile of sourceFiles) { - const searchSourceFile = searchModuleSymbol.valueDeclaration; - if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 308 /* SourceFile */) { - for (const ref of referencingFile.referencedFiles) { - if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { - refs.push({ kind: "reference", referencingFile, ref }); - } - } - for (const ref of referencingFile.typeReferenceDirectives) { - const referenced = (_a = program.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(ref, referencingFile)) == null ? void 0 : _a.resolvedTypeReferenceDirective; - if (referenced !== void 0 && referenced.resolvedFileName === searchSourceFile.fileName) { - refs.push({ kind: "reference", referencingFile, ref }); - } - } - } - forEachImport(referencingFile, (importDecl, moduleSpecifier) => { - const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); - if (moduleSymbol === searchModuleSymbol) { - refs.push(nodeIsSynthesized(importDecl) ? { kind: "implicit", literal: moduleSpecifier, referencingFile } : { kind: "import", literal: moduleSpecifier }); - } - }); - } - return refs; -} -function getDirectImportsMap(sourceFiles, checker, cancellationToken) { - const map2 = /* @__PURE__ */ new Map(); - for (const sourceFile of sourceFiles) { - if (cancellationToken) cancellationToken.throwIfCancellationRequested(); - forEachImport(sourceFile, (importDecl, moduleSpecifier) => { - const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); - if (moduleSymbol) { - const id = getSymbolId(moduleSymbol).toString(); - let imports = map2.get(id); - if (!imports) { - map2.set(id, imports = []); - } - imports.push(importDecl); - } - }); - } - return map2; -} -function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return forEach(sourceFileLike.kind === 308 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( - // TODO: GH#18217 - action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action) - )); -} -function forEachImport(sourceFile, action) { - if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) { - for (const i of sourceFile.imports) { - action(importFromModuleSpecifier(i), i); - } - } else { - forEachPossibleImportOrExportStatement(sourceFile, (statement) => { - switch (statement.kind) { - case 279 /* ExportDeclaration */: - case 273 /* ImportDeclaration */: { - const decl = statement; - if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) { - action(decl, decl.moduleSpecifier); - } - break; - } - case 272 /* ImportEqualsDeclaration */: { - const decl = statement; - if (isExternalModuleImportEquals(decl)) { - action(decl, decl.moduleReference.expression); - } - break; - } - } - }); - } -} -function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { - return comingFromExport ? getExport() : getExport() || getImport(); - function getExport() { - var _a; - const { parent: parent2 } = node; - const grandparent = parent2.parent; - if (symbol.exportSymbol) { - if (parent2.kind === 212 /* PropertyAccessExpression */) { - return ((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d === parent2)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport( - grandparent, - /*useLhsSymbol*/ - false - ) : void 0; - } else { - return exportInfo(symbol.exportSymbol, getExportKindForDeclaration(parent2)); - } - } else { - const exportNode = getExportNode(parent2, node); - if (exportNode && hasSyntacticModifier(exportNode, 32 /* Export */)) { - if (isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) { - if (comingFromExport) { - return void 0; - } - const lhsSymbol = checker.getSymbolAtLocation(exportNode.name); - return { kind: 0 /* Import */, symbol: lhsSymbol }; - } else { - return exportInfo(symbol, getExportKindForDeclaration(exportNode)); - } - } else if (isNamespaceExport(parent2)) { - return exportInfo(symbol, 0 /* Named */); - } else if (isExportAssignment(parent2)) { - return getExportAssignmentExport(parent2); - } else if (isExportAssignment(grandparent)) { - return getExportAssignmentExport(grandparent); - } else if (isBinaryExpression(parent2)) { - return getSpecialPropertyExport( - parent2, - /*useLhsSymbol*/ - true - ); - } else if (isBinaryExpression(grandparent)) { - return getSpecialPropertyExport( - grandparent, - /*useLhsSymbol*/ - true - ); - } else if (isJSDocTypedefTag(parent2) || isJSDocCallbackTag(parent2)) { - return exportInfo(symbol, 0 /* Named */); - } - } - function getExportAssignmentExport(ex) { - if (!ex.symbol.parent) return void 0; - const exportKind = ex.isExportEquals ? 2 /* ExportEquals */ : 1 /* Default */; - return { kind: 1 /* Export */, symbol, exportInfo: { exportingModuleSymbol: ex.symbol.parent, exportKind } }; - } - function getSpecialPropertyExport(node2, useLhsSymbol) { - let kind; - switch (getAssignmentDeclarationKind(node2)) { - case 1 /* ExportsProperty */: - kind = 0 /* Named */; - break; - case 2 /* ModuleExports */: - kind = 2 /* ExportEquals */; - break; - default: - return void 0; - } - const sym = useLhsSymbol ? checker.getSymbolAtLocation(getNameOfAccessExpression(cast(node2.left, isAccessExpression))) : symbol; - return sym && exportInfo(sym, kind); - } - } - function getImport() { - const isImport3 = isNodeImport(node); - if (!isImport3) return void 0; - let importedSymbol = checker.getImmediateAliasedSymbol(symbol); - if (!importedSymbol) return void 0; - importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); - if (importedSymbol.escapedName === "export=") { - importedSymbol = getExportEqualsLocalSymbol(importedSymbol, checker); - if (importedSymbol === void 0) return void 0; - } - const importedName = symbolEscapedNameNoDefault(importedSymbol); - if (importedName === void 0 || importedName === "default" /* Default */ || importedName === symbol.escapedName) { - return { kind: 0 /* Import */, symbol: importedSymbol }; - } - } - function exportInfo(symbol2, kind) { - const exportInfo2 = getExportInfo(symbol2, kind, checker); - return exportInfo2 && { kind: 1 /* Export */, symbol: symbol2, exportInfo: exportInfo2 }; - } - function getExportKindForDeclaration(node2) { - return hasSyntacticModifier(node2, 2048 /* Default */) ? 1 /* Default */ : 0 /* Named */; - } -} -function getExportEqualsLocalSymbol(importedSymbol, checker) { - var _a, _b; - if (importedSymbol.flags & 2097152 /* Alias */) { - return checker.getImmediateAliasedSymbol(importedSymbol); - } - const decl = Debug.checkDefined(importedSymbol.valueDeclaration); - if (isExportAssignment(decl)) { - return (_a = tryCast(decl.expression, canHaveSymbol)) == null ? void 0 : _a.symbol; - } else if (isBinaryExpression(decl)) { - return (_b = tryCast(decl.right, canHaveSymbol)) == null ? void 0 : _b.symbol; - } else if (isSourceFile(decl)) { - return decl.symbol; - } - return void 0; -} -function getExportNode(parent2, node) { - const declaration = isVariableDeclaration(parent2) ? parent2 : isBindingElement(parent2) ? walkUpBindingElementsAndPatterns(parent2) : void 0; - if (declaration) { - return parent2.name !== node ? void 0 : isCatchClause(declaration.parent) ? void 0 : isVariableStatement(declaration.parent.parent) ? declaration.parent.parent : void 0; - } else { - return parent2; - } -} -function isNodeImport(node) { - const { parent: parent2 } = node; - switch (parent2.kind) { - case 272 /* ImportEqualsDeclaration */: - return parent2.name === node && isExternalModuleImportEquals(parent2); - case 277 /* ImportSpecifier */: - return !parent2.propertyName; - case 274 /* ImportClause */: - case 275 /* NamespaceImport */: - Debug.assert(parent2.name === node); - return true; - case 209 /* BindingElement */: - return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent); - default: - return false; - } -} -function getExportInfo(exportSymbol, exportKind, checker) { - const moduleSymbol = exportSymbol.parent; - if (!moduleSymbol) return void 0; - const exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); - return isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol, exportKind } : void 0; -} -function skipExportSpecifierSymbol(symbol, checker) { - if (symbol.declarations) { - for (const declaration of symbol.declarations) { - if (isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { - return checker.getExportSpecifierLocalTargetSymbol(declaration) || symbol; - } else if (isPropertyAccessExpression(declaration) && isModuleExportsAccessExpression(declaration.expression) && !isPrivateIdentifier(declaration.name)) { - return checker.getSymbolAtLocation(declaration); - } else if (isShorthandPropertyAssignment(declaration) && isBinaryExpression(declaration.parent.parent) && getAssignmentDeclarationKind(declaration.parent.parent) === 2 /* ModuleExports */) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } - } - } - return symbol; -} -function getContainingModuleSymbol(importer, checker) { - return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); -} -function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 214 /* CallExpression */ || node.kind === 352 /* JSDocImportTag */) { - return node.getSourceFile(); - } - const { parent: parent2 } = node; - if (parent2.kind === 308 /* SourceFile */) { - return parent2; - } - Debug.assert(parent2.kind === 269 /* ModuleBlock */); - return cast(parent2.parent, isAmbientModuleDeclaration); -} -function isAmbientModuleDeclaration(node) { - return node.kind === 268 /* ModuleDeclaration */ && node.name.kind === 11 /* StringLiteral */; -} -function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 284 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 11 /* StringLiteral */; -} - -// src/services/findAllReferences.ts -var DefinitionKind = /* @__PURE__ */ ((DefinitionKind2) => { - DefinitionKind2[DefinitionKind2["Symbol"] = 0] = "Symbol"; - DefinitionKind2[DefinitionKind2["Label"] = 1] = "Label"; - DefinitionKind2[DefinitionKind2["Keyword"] = 2] = "Keyword"; - DefinitionKind2[DefinitionKind2["This"] = 3] = "This"; - DefinitionKind2[DefinitionKind2["String"] = 4] = "String"; - DefinitionKind2[DefinitionKind2["TripleSlashReference"] = 5] = "TripleSlashReference"; - return DefinitionKind2; -})(DefinitionKind || {}); -var EntryKind = /* @__PURE__ */ ((EntryKind2) => { - EntryKind2[EntryKind2["Span"] = 0] = "Span"; - EntryKind2[EntryKind2["Node"] = 1] = "Node"; - EntryKind2[EntryKind2["StringLiteral"] = 2] = "StringLiteral"; - EntryKind2[EntryKind2["SearchedLocalFoundProperty"] = 3] = "SearchedLocalFoundProperty"; - EntryKind2[EntryKind2["SearchedPropertyFoundLocal"] = 4] = "SearchedPropertyFoundLocal"; - return EntryKind2; -})(EntryKind || {}); -function nodeEntry(node, kind = 1 /* Node */) { - return { - kind, - node: node.name || node, - context: getContextNodeForNodeEntry(node) - }; -} -function isContextWithStartAndEndNode(node) { - return node && node.kind === void 0; -} -function getContextNodeForNodeEntry(node) { - if (isDeclaration(node)) { - return getContextNode(node); - } - if (!node.parent) return void 0; - if (!isDeclaration(node.parent) && !isExportAssignment(node.parent)) { - if (isInJSFile(node)) { - const binaryExpression = isBinaryExpression(node.parent) ? node.parent : isAccessExpression(node.parent) && isBinaryExpression(node.parent.parent) && node.parent.parent.left === node.parent ? node.parent.parent : void 0; - if (binaryExpression && getAssignmentDeclarationKind(binaryExpression) !== 0 /* None */) { - return getContextNode(binaryExpression); - } - } - if (isJsxOpeningElement(node.parent) || isJsxClosingElement(node.parent)) { - return node.parent.parent; - } else if (isJsxSelfClosingElement(node.parent) || isLabeledStatement(node.parent) || isBreakOrContinueStatement(node.parent)) { - return node.parent; - } else if (isStringLiteralLike(node)) { - const validImport = tryGetImportFromModuleSpecifier(node); - if (validImport) { - const declOrStatement = findAncestor(validImport, (node2) => isDeclaration(node2) || isStatement(node2) || isJSDocTag(node2)); - return isDeclaration(declOrStatement) ? getContextNode(declOrStatement) : declOrStatement; - } - } - const propertyName = findAncestor(node, isComputedPropertyName); - return propertyName ? getContextNode(propertyName.parent) : void 0; - } - 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, 2080 /* ExportDefault */)) { - return getContextNode(node.parent); - } - return void 0; -} -function getContextNode(node) { - if (!node) return void 0; - switch (node.kind) { - case 261 /* 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 209 /* BindingElement */: - return getContextNode(node.parent.parent); - case 277 /* ImportSpecifier */: - return node.parent.parent.parent; - case 282 /* ExportSpecifier */: - case 275 /* NamespaceImport */: - return node.parent.parent; - case 274 /* ImportClause */: - case 281 /* NamespaceExport */: - return node.parent; - case 227 /* BinaryExpression */: - return isExpressionStatement(node.parent) ? node.parent : node; - case 251 /* ForOfStatement */: - case 250 /* ForInStatement */: - return { - start: node.initializer, - end: node.expression - }; - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode( - findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2)) - ) : node; - case 256 /* SwitchStatement */: - return { - start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */), - end: node.caseBlock - }; - default: - return node; - } -} -function toContextSpan(textSpan, sourceFile, context) { - if (!context) return void 0; - const contextSpan = isContextWithStartAndEndNode(context) ? getTextSpan(context.start, sourceFile, context.end) : getTextSpan(context, sourceFile); - return contextSpan.start !== textSpan.start || contextSpan.length !== textSpan.length ? { contextSpan } : void 0; -} -var FindReferencesUse = /* @__PURE__ */ ((FindReferencesUse2) => { - FindReferencesUse2[FindReferencesUse2["Other"] = 0] = "Other"; - FindReferencesUse2[FindReferencesUse2["References"] = 1] = "References"; - FindReferencesUse2[FindReferencesUse2["Rename"] = 2] = "Rename"; - return FindReferencesUse2; -})(FindReferencesUse || {}); -function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { - const node = getTouchingPropertyName(sourceFile, position); - const options = { use: 1 /* References */ }; - const referencedSymbols = Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); - const checker = program.getTypeChecker(); - const adjustedNode = Core.getAdjustedNode(node, options); - const symbol = isDefinitionForReference(adjustedNode) ? checker.getSymbolAtLocation(adjustedNode) : void 0; - return !referencedSymbols || !referencedSymbols.length ? void 0 : mapDefined(referencedSymbols, ({ definition, references }) => ( - // Only include referenced symbols that have a valid definition. - definition && { - definition: checker.runWithCancellationToken(cancellationToken, (checker2) => definitionToReferencedSymbolDefinitionInfo(definition, checker2, node)), - references: references.map((r) => toReferencedSymbolEntry(r, symbol)) - } - )); -} -function isDefinitionForReference(node) { - return node.kind === 90 /* DefaultKeyword */ || !!getDeclarationFromName(node) || isLiteralComputedPropertyDeclarationName(node) || node.kind === 137 /* ConstructorKeyword */ && isConstructorDeclaration(node.parent); -} -function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) { - const node = getTouchingPropertyName(sourceFile, position); - let referenceEntries; - const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 212 /* PropertyAccessExpression */ || node.parent.kind === 209 /* BindingElement */ || node.parent.kind === 213 /* ElementAccessExpression */ || node.kind === 108 /* SuperKeyword */) { - referenceEntries = entries && [...entries]; - } else if (entries) { - const queue = createQueue(entries); - const seenNodes = /* @__PURE__ */ new Set(); - while (!queue.isEmpty()) { - const entry = queue.dequeue(); - if (!addToSeen(seenNodes, getNodeId(entry.node))) { - continue; - } - referenceEntries = append(referenceEntries, entry); - const entries2 = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, entry.node, entry.node.pos); - if (entries2) { - queue.enqueue(...entries2); - } - } - } - const checker = program.getTypeChecker(); - return map(referenceEntries, (entry) => toImplementationLocation(entry, checker)); -} -function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 308 /* SourceFile */) { - return void 0; - } - const checker = program.getTypeChecker(); - if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { - const result = []; - Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result.push(nodeEntry(node2))); - return result; - } else if (node.kind === 108 /* SuperKeyword */ || isSuperProperty(node.parent)) { - const symbol = checker.getSymbolAtLocation(node); - return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; - } else { - return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { implementations: true, use: 1 /* References */ }); - } -} -function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) { - return map(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), (entry) => convertEntry(entry, node, program.getTypeChecker())); -} -function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) { - return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet)); -} -function flattenEntries(referenceSymbols) { - return referenceSymbols && flatMap(referenceSymbols, (r) => r.references); -} -function definitionToReferencedSymbolDefinitionInfo(def, checker, originalNode) { - const info = (() => { - switch (def.type) { - case 0 /* Symbol */: { - const { symbol } = def; - const { displayParts: displayParts2, kind: kind2 } = getDefinitionKindAndDisplayParts(symbol, checker, originalNode); - const name2 = displayParts2.map((p) => p.text).join(""); - const declaration = symbol.declarations && firstOrUndefined(symbol.declarations); - const node = declaration ? getNameOfDeclaration(declaration) || declaration : originalNode; - return { - ...getFileAndTextSpanFromNode(node), - name: name2, - kind: kind2, - displayParts: displayParts2, - context: getContextNode(declaration) - }; - } - case 1 /* Label */: { - const { node } = def; - return { ...getFileAndTextSpanFromNode(node), name: node.text, kind: "label" /* label */, displayParts: [displayPart(node.text, 17 /* text */)] }; - } - case 2 /* Keyword */: { - const { node } = def; - const name2 = tokenToString(node.kind); - return { ...getFileAndTextSpanFromNode(node), name: name2, kind: "keyword" /* keyword */, displayParts: [{ text: name2, kind: "keyword" /* keyword */ }] }; - } - case 3 /* This */: { - const { node } = def; - const symbol = checker.getSymbolAtLocation(node); - const displayParts2 = symbol && ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind( - checker, - symbol, - node.getSourceFile(), - getContainerNode(node), - node - ).displayParts || [textPart("this")]; - return { ...getFileAndTextSpanFromNode(node), name: "this", kind: "var" /* variableElement */, displayParts: displayParts2 }; - } - case 4 /* String */: { - const { node } = def; - return { - ...getFileAndTextSpanFromNode(node), - name: node.text, - kind: "var" /* variableElement */, - displayParts: [displayPart(getTextOfNode(node), 8 /* stringLiteral */)] - }; - } - case 5 /* TripleSlashReference */: { - return { - textSpan: createTextSpanFromRange(def.reference), - sourceFile: def.file, - name: def.reference.fileName, - kind: "string" /* string */, - displayParts: [displayPart(`"${def.reference.fileName}"`, 8 /* stringLiteral */)] - }; - } - default: - return Debug.assertNever(def); - } - })(); - const { sourceFile, textSpan, name, kind, displayParts, context } = info; - return { - containerKind: "" /* unknown */, - containerName: "", - fileName: sourceFile.fileName, - kind, - name, - textSpan, - displayParts, - ...toContextSpan(textSpan, sourceFile, context) - }; -} -function getFileAndTextSpanFromNode(node) { - const sourceFile = node.getSourceFile(); - return { - sourceFile, - textSpan: getTextSpan(isComputedPropertyName(node) ? node.expression : node, sourceFile) - }; -} -function getDefinitionKindAndDisplayParts(symbol, checker, node) { - const meaning = Core.getIntersectingMeaningFromDeclarations(node, symbol); - const enclosingDeclaration = symbol.declarations && firstOrUndefined(symbol.declarations) || node; - const { displayParts, symbolKind } = ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning); - return { displayParts, kind: symbolKind }; -} -function toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixText, quotePreference) { - return { ...entryToDocumentSpan(entry), ...providePrefixAndSuffixText && getPrefixAndSuffixText(entry, originalNode, checker, quotePreference) }; -} -function toReferencedSymbolEntry(entry, symbol) { - const referenceEntry = toReferenceEntry(entry); - if (!symbol) return referenceEntry; - return { - ...referenceEntry, - isDefinition: entry.kind !== 0 /* Span */ && isDeclarationOfSymbol(entry.node, symbol) - }; -} -function toReferenceEntry(entry) { - const documentSpan = entryToDocumentSpan(entry); - if (entry.kind === 0 /* Span */) { - return { ...documentSpan, isWriteAccess: false }; - } - const { kind, node } = entry; - return { - ...documentSpan, - isWriteAccess: isWriteAccessForReference(node), - isInString: kind === 2 /* StringLiteral */ ? true : void 0 - }; -} -function entryToDocumentSpan(entry) { - if (entry.kind === 0 /* Span */) { - return { textSpan: entry.textSpan, fileName: entry.fileName }; - } else { - const sourceFile = entry.node.getSourceFile(); - const textSpan = getTextSpan(entry.node, sourceFile); - return { - textSpan, - fileName: sourceFile.fileName, - ...toContextSpan(textSpan, sourceFile, entry.context) - }; - } -} -function getPrefixAndSuffixText(entry, originalNode, checker, quotePreference) { - if (entry.kind !== 0 /* Span */ && (isIdentifier(originalNode) || isStringLiteralLike(originalNode))) { - const { node, kind } = entry; - const parent2 = node.parent; - const name = originalNode.text; - const isShorthandAssignment = isShorthandPropertyAssignment(parent2); - if (isShorthandAssignment || isObjectBindingElementWithoutPropertyName(parent2) && parent2.name === node && parent2.dotDotDotToken === void 0) { - const prefixColon = { prefixText: name + ": " }; - const suffixColon = { suffixText: ": " + name }; - if (kind === 3 /* SearchedLocalFoundProperty */) { - return prefixColon; - } - if (kind === 4 /* SearchedPropertyFoundLocal */) { - return suffixColon; - } - if (isShorthandAssignment) { - const grandParent = parent2.parent; - if (isObjectLiteralExpression(grandParent) && isBinaryExpression(grandParent.parent) && isModuleExportsAccessExpression(grandParent.parent.left)) { - return prefixColon; - } - return suffixColon; - } else { - return prefixColon; - } - } else if (isImportSpecifier(parent2) && !parent2.propertyName) { - const originalSymbol = isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode); - return contains(originalSymbol.declarations, parent2) ? { prefixText: name + " as " } : emptyOptions; - } else if (isExportSpecifier(parent2) && !parent2.propertyName) { - return originalNode === entry.node || checker.getSymbolAtLocation(originalNode) === checker.getSymbolAtLocation(entry.node) ? { prefixText: name + " as " } : { suffixText: " as " + name }; - } - } - if (entry.kind !== 0 /* Span */ && isNumericLiteral(entry.node) && isAccessExpression(entry.node.parent)) { - const quote2 = getQuoteFromPreference(quotePreference); - return { prefixText: quote2, suffixText: quote2 }; - } - return emptyOptions; -} -function toImplementationLocation(entry, checker) { - const documentSpan = entryToDocumentSpan(entry); - if (entry.kind !== 0 /* Span */) { - const { node } = entry; - return { - ...documentSpan, - ...implementationKindDisplayParts(node, checker) - }; - } else { - return { ...documentSpan, kind: "" /* unknown */, displayParts: [] }; - } -} -function implementationKindDisplayParts(node, checker) { - const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node); - if (symbol) { - return getDefinitionKindAndDisplayParts(symbol, checker, node); - } else if (node.kind === 211 /* ObjectLiteralExpression */) { - return { - kind: "interface" /* interfaceElement */, - displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("object literal"), punctuationPart(22 /* CloseParenToken */)] - }; - } else if (node.kind === 232 /* ClassExpression */) { - return { - kind: "local class" /* localClassElement */, - displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("anonymous local class"), punctuationPart(22 /* CloseParenToken */)] - }; - } else { - return { kind: getNodeKind(node), displayParts: [] }; - } -} -function toHighlightSpan(entry) { - const documentSpan = entryToDocumentSpan(entry); - if (entry.kind === 0 /* Span */) { - return { - fileName: documentSpan.fileName, - span: { - textSpan: documentSpan.textSpan, - kind: "reference" /* reference */ - } - }; - } - const writeAccess = isWriteAccessForReference(entry.node); - const span = { - textSpan: documentSpan.textSpan, - kind: writeAccess ? "writtenReference" /* writtenReference */ : "reference" /* reference */, - isInString: entry.kind === 2 /* StringLiteral */ ? true : void 0, - ...documentSpan.contextSpan && { contextSpan: documentSpan.contextSpan } - }; - return { fileName: documentSpan.fileName, span }; -} -function getTextSpan(node, sourceFile, endNode2) { - let start = node.getStart(sourceFile); - let end = (endNode2 || node).getEnd(); - if (isStringLiteralLike(node) && end - start > 2) { - Debug.assert(endNode2 === void 0); - start += 1; - end -= 1; - } - if ((endNode2 == null ? void 0 : endNode2.kind) === 270 /* CaseBlock */) { - end = endNode2.getFullStart(); - } - return createTextSpanFromBounds(start, end); -} -function getTextSpanOfEntry(entry) { - return entry.kind === 0 /* Span */ ? entry.textSpan : getTextSpan(entry.node, entry.node.getSourceFile()); -} -function isWriteAccessForReference(node) { - const decl = getDeclarationFromName(node); - return !!decl && declarationIsWriteAccess(decl) || node.kind === 90 /* DefaultKeyword */ || isWriteAccess(node); -} -function isDeclarationOfSymbol(node, target) { - var _a; - if (!target) return false; - const source = getDeclarationFromName(node) || (node.kind === 90 /* DefaultKeyword */ ? node.parent : isLiteralComputedPropertyDeclarationName(node) ? node.parent.parent : node.kind === 137 /* ConstructorKeyword */ && isConstructorDeclaration(node.parent) ? node.parent.parent : void 0); - const commonjsSource = source && isBinaryExpression(source) ? source.left : void 0; - return !!(source && ((_a = target.declarations) == null ? void 0 : _a.some((d) => d === source || d === commonjsSource))); -} -function declarationIsWriteAccess(decl) { - if (!!(decl.flags & 33554432 /* Ambient */)) return true; - switch (decl.kind) { - case 227 /* BinaryExpression */: - case 209 /* BindingElement */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 90 /* DefaultKeyword */: - case 267 /* EnumDeclaration */: - case 307 /* EnumMember */: - case 282 /* ExportSpecifier */: - case 274 /* ImportClause */: - // default import - case 272 /* ImportEqualsDeclaration */: - case 277 /* ImportSpecifier */: - case 265 /* InterfaceDeclaration */: - case 339 /* JSDocCallbackTag */: - case 347 /* JSDocTypedefTag */: - case 292 /* JsxAttribute */: - case 268 /* ModuleDeclaration */: - case 271 /* NamespaceExportDeclaration */: - case 275 /* NamespaceImport */: - case 281 /* NamespaceExport */: - case 170 /* Parameter */: - case 305 /* ShorthandPropertyAssignment */: - case 266 /* TypeAliasDeclaration */: - case 169 /* TypeParameter */: - return true; - case 304 /* PropertyAssignment */: - return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 177 /* Constructor */: - case 175 /* MethodDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return !!decl.body; - case 261 /* VariableDeclaration */: - case 173 /* PropertyDeclaration */: - return !!decl.initializer || isCatchClause(decl.parent); - case 174 /* MethodSignature */: - case 172 /* PropertySignature */: - case 349 /* JSDocPropertyTag */: - case 342 /* JSDocParameterTag */: - return false; - default: - return Debug.failBadSyntaxKind(decl); - } -} -var Core; -((Core2) => { - function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) { - var _a, _b; - node = getAdjustedNode2(node, options); - if (isSourceFile(node)) { - const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program); - if (!(resolvedRef == null ? void 0 : resolvedRef.file)) { - return void 0; - } - const moduleSymbol = program.getTypeChecker().getMergedSymbol(resolvedRef.file.symbol); - if (moduleSymbol) { - return getReferencedSymbolsForModule( - program, - moduleSymbol, - /*excludeImportTypeOfExportEquals*/ - false, - sourceFiles, - sourceFilesSet - ); - } - const fileIncludeReasons = program.getFileIncludeReasons(); - if (!fileIncludeReasons) { - return void 0; - } - return [{ - definition: { type: 5 /* TripleSlashReference */, reference: resolvedRef.reference, file: node }, - references: getReferencesForNonModule(resolvedRef.file, fileIncludeReasons, program) || emptyArray - }]; - } - if (!options.implementations) { - const special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); - if (special) { - return special; - } - } - const checker = program.getTypeChecker(); - const symbol = checker.getSymbolAtLocation(isConstructorDeclaration(node) && node.parent.name || node); - if (!symbol) { - if (!options.implementations && isStringLiteralLike(node)) { - if (isModuleSpecifierLike(node)) { - const fileIncludeReasons = program.getFileIncludeReasons(); - 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 }]; - } - } - return getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken); - } - return void 0; - } - if (symbol.escapedName === "export=" /* ExportEquals */) { - return getReferencedSymbolsForModule( - program, - symbol.parent, - /*excludeImportTypeOfExportEquals*/ - false, - sourceFiles, - sourceFilesSet - ); - } - const moduleReferences = getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); - if (moduleReferences && !(symbol.flags & 33554432 /* Transient */)) { - return moduleReferences; - } - const aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker); - const moduleReferencesOfExportTarget = aliasedSymbol && getReferencedSymbolsForModuleIfDeclaredBySourceFile(aliasedSymbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); - const references = getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options); - return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget); - } - Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function getAdjustedNode2(node, options) { - if (options.use === 1 /* References */) { - node = getAdjustedReferenceLocation(node); - } else if (options.use === 2 /* Rename */) { - node = getAdjustedRenameLocation(node); - } - return node; - } - Core2.getAdjustedNode = getAdjustedNode2; - function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) { - var _a, _b; - const moduleSymbol = (_a = program.getSourceFile(fileName)) == null ? void 0 : _a.symbol; - if (moduleSymbol) { - return ((_b = getReferencedSymbolsForModule( - program, - moduleSymbol, - /*excludeImportTypeOfExportEquals*/ - false, - sourceFiles, - sourceFilesSet - )[0]) == null ? void 0 : _b.references) || emptyArray; - } - const fileIncludeReasons = program.getFileIncludeReasons(); - const referencedFile = program.getSourceFile(fileName); - return referencedFile && fileIncludeReasons && getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray; - } - Core2.getReferencesForFileName = getReferencesForFileName; - function getReferencesForNonModule(referencedFile, refFileMap, program) { - let entries; - const references = refFileMap.get(referencedFile.path) || emptyArray; - for (const ref of references) { - if (isReferencedFile(ref)) { - const referencingFile = program.getSourceFileByPath(ref.file); - const location = getReferencedFileLocation(program, ref); - if (isReferenceFileLocation(location)) { - entries = append(entries, { - kind: 0 /* Span */, - fileName: referencingFile.fileName, - textSpan: createTextSpanFromRange(location) - }); - } - } - } - return entries; - } - function getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker) { - if (node.parent && isNamespaceExportDeclaration(node.parent)) { - const aliasedSymbol = checker.getAliasedSymbol(symbol); - const targetSymbol = checker.getMergedSymbol(aliasedSymbol); - if (aliasedSymbol !== targetSymbol) { - return targetSymbol; - } - } - return void 0; - } - function getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet) { - const moduleSourceFile = symbol.flags & 1536 /* Module */ && symbol.declarations && find(symbol.declarations, isSourceFile); - if (!moduleSourceFile) return void 0; - const exportEquals = symbol.exports.get("export=" /* ExportEquals */); - const moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet); - if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName)) return moduleReferences; - const checker = program.getTypeChecker(); - symbol = skipAlias(exportEquals, checker); - return mergeReferences(program, moduleReferences, getReferencedSymbolsForSymbol( - symbol, - /*node*/ - void 0, - sourceFiles, - sourceFilesSet, - checker, - cancellationToken, - options - )); - } - function mergeReferences(program, ...referencesToMerge) { - let result; - for (const references of referencesToMerge) { - if (!references || !references.length) continue; - if (!result) { - result = references; - continue; - } - for (const entry of references) { - if (!entry.definition || entry.definition.type !== 0 /* Symbol */) { - result.push(entry); - continue; - } - const symbol = entry.definition.symbol; - const refIndex = findIndex(result, (ref) => !!ref.definition && ref.definition.type === 0 /* Symbol */ && ref.definition.symbol === symbol); - if (refIndex === -1) { - result.push(entry); - continue; - } - const reference = result[refIndex]; - result[refIndex] = { - definition: reference.definition, - references: reference.references.concat(entry.references).sort((entry1, entry2) => { - const entry1File = getSourceFileIndexOfEntry(program, entry1); - const entry2File = getSourceFileIndexOfEntry(program, entry2); - if (entry1File !== entry2File) { - return compareValues(entry1File, entry2File); - } - const entry1Span = getTextSpanOfEntry(entry1); - const entry2Span = getTextSpanOfEntry(entry2); - return entry1Span.start !== entry2Span.start ? compareValues(entry1Span.start, entry2Span.start) : compareValues(entry1Span.length, entry2Span.length); - }) - }; - } - } - return result; - } - function getSourceFileIndexOfEntry(program, entry) { - const sourceFile = entry.kind === 0 /* Span */ ? program.getSourceFile(entry.fileName) : entry.node.getSourceFile(); - return program.getSourceFiles().indexOf(sourceFile); - } - function getReferencedSymbolsForModule(program, symbol, excludeImportTypeOfExportEquals, sourceFiles, sourceFilesSet) { - Debug.assert(!!symbol.valueDeclaration); - const references = mapDefined(findModuleReferences(program, sourceFiles, symbol), (reference) => { - if (reference.kind === "import") { - const parent2 = reference.literal.parent; - if (isLiteralTypeNode(parent2)) { - const importType = cast(parent2.parent, isImportTypeNode); - if (excludeImportTypeOfExportEquals && !importType.qualifier) { - return void 0; - } - } - return nodeEntry(reference.literal); - } else if (reference.kind === "implicit") { - const range = reference.literal.text !== externalHelpersModuleNameText && forEachChildRecursively( - reference.referencingFile, - (n) => !(n.transformFlags & 2 /* ContainsJsx */) ? "skip" : isJsxElement(n) || isJsxSelfClosingElement(n) || isJsxFragment(n) ? n : void 0 - ) || reference.referencingFile.statements[0] || reference.referencingFile; - return nodeEntry(range); - } else { - return { - kind: 0 /* Span */, - fileName: reference.referencingFile.fileName, - textSpan: createTextSpanFromRange(reference.ref) - }; - } - }); - if (symbol.declarations) { - for (const decl of symbol.declarations) { - switch (decl.kind) { - case 308 /* SourceFile */: - break; - case 268 /* ModuleDeclaration */: - if (sourceFilesSet.has(decl.getSourceFile().fileName)) { - references.push(nodeEntry(decl.name)); - } - break; - default: - Debug.assert(!!(symbol.flags & 33554432 /* Transient */), "Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); - } - } - } - const exported = symbol.exports.get("export=" /* ExportEquals */); - if (exported == null ? void 0 : exported.declarations) { - for (const decl of exported.declarations) { - const sourceFile = decl.getSourceFile(); - if (sourceFilesSet.has(sourceFile.fileName)) { - const node = isBinaryExpression(decl) && isPropertyAccessExpression(decl.left) ? decl.left.expression : isExportAssignment(decl) ? Debug.checkDefined(findChildOfKind(decl, 95 /* ExportKeyword */, sourceFile)) : getNameOfDeclaration(decl) || decl; - references.push(nodeEntry(node)); - } - } - } - return references.length ? [{ definition: { type: 0 /* Symbol */, symbol }, references }] : emptyArray; - } - function isReadonlyTypeOperator(node) { - return node.kind === 148 /* ReadonlyKeyword */ && isTypeOperatorNode(node.parent) && node.parent.operator === 148 /* ReadonlyKeyword */; - } - function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { - if (isTypeKeyword(node.kind)) { - if (node.kind === 116 /* VoidKeyword */ && isVoidExpression(node.parent)) { - return void 0; - } - if (node.kind === 148 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { - return void 0; - } - return getAllReferencesForKeyword( - sourceFiles, - node.kind, - cancellationToken, - node.kind === 148 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : void 0 - ); - } - if (isImportMeta(node.parent) && node.parent.name === node) { - return getAllReferencesForImportMeta(sourceFiles, cancellationToken); - } - if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) { - return [{ definition: { type: 2 /* Keyword */, node }, references: [nodeEntry(node)] }]; - } - if (isJumpStatementTarget(node)) { - const labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); - } else if (isLabelOfLabeledStatement(node)) { - return getLabelReferencesInNode(node.parent, node); - } - if (isThis(node)) { - return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); - } - if (node.kind === 108 /* SuperKeyword */) { - return getReferencesForSuperKeyword(node); - } - return void 0; - } - function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { - const symbol = node && skipPastExportOrImportSpecifierOrUnion( - originalSymbol, - node, - checker, - /*useLocalSymbolForExportSpecifier*/ - !isForRenameWithPrefixAndSuffixText(options) - ) || originalSymbol; - const searchMeaning = node && options.use !== 2 /* Rename */ ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; - const result = []; - const state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); - const exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) || !symbol.declarations ? void 0 : find(symbol.declarations, isExportSpecifier); - if (exportSpecifier) { - getReferencesAtExportSpecifier( - exportSpecifier.name, - symbol, - exportSpecifier, - state.createSearch( - node, - originalSymbol, - /*comingFrom*/ - void 0 - ), - state, - /*addReferencesHere*/ - true, - /*alwaysGetReferences*/ - true - ); - } else if (node && node.kind === 90 /* DefaultKeyword */ && symbol.escapedName === "default" /* Default */ && symbol.parent) { - addReference(node, symbol, state); - searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: 1 /* Default */ }, state); - } else { - const search = state.createSearch( - node, - symbol, - /*comingFrom*/ - void 0, - { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, options.use === 2 /* Rename */, !!options.providePrefixAndSuffixTextForRename, !!options.implementations) : [symbol] } - ); - getReferencesInContainerOrFiles(symbol, state, search); - } - return result; - } - function getReferencesInContainerOrFiles(symbol, state, search) { - const scope = getSymbolScope(symbol); - if (scope) { - getReferencesInContainer( - scope, - scope.getSourceFile(), - search, - state, - /*addReferencesHere*/ - !(isSourceFile(scope) && !contains(state.sourceFiles, scope)) - ); - } else { - for (const sourceFile of state.sourceFiles) { - state.cancellationToken.throwIfCancellationRequested(); - searchForName(sourceFile, search, state); - } - } - } - function getSpecialSearchKind(node) { - switch (node.kind) { - case 177 /* Constructor */: - case 137 /* ConstructorKeyword */: - return 1 /* Constructor */; - case 80 /* Identifier */: - if (isClassLike(node.parent)) { - Debug.assert(node.parent.name === node); - return 2 /* Class */; - } - // falls through - default: - return 0 /* None */; - } - } - function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) { - const { parent: parent2 } = node; - if (isExportSpecifier(parent2) && useLocalSymbolForExportSpecifier) { - return getLocalSymbolForExportSpecifier(node, symbol, parent2, checker); - } - return firstDefined(symbol.declarations, (decl) => { - if (!decl.parent) { - if (symbol.flags & 33554432 /* Transient */) return void 0; - Debug.fail(`Unexpected symbol at ${Debug.formatSyntaxKind(node.kind)}: ${Debug.formatSymbol(symbol)}`); - } - return isTypeLiteralNode(decl.parent) && isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) : void 0; - }); - } - let SpecialSearchKind; - ((SpecialSearchKind2) => { - SpecialSearchKind2[SpecialSearchKind2["None"] = 0] = "None"; - SpecialSearchKind2[SpecialSearchKind2["Constructor"] = 1] = "Constructor"; - SpecialSearchKind2[SpecialSearchKind2["Class"] = 2] = "Class"; - })(SpecialSearchKind || (SpecialSearchKind = {})); - function getNonModuleSymbolOfMergedModuleSymbol(symbol) { - if (!(symbol.flags & (1536 /* Module */ | 33554432 /* Transient */))) return void 0; - const decl = symbol.declarations && find(symbol.declarations, (d) => !isSourceFile(d) && !isModuleDeclaration(d)); - return decl && decl.symbol; - } - class State { - constructor(sourceFiles, sourceFilesSet, specialSearchKind, checker, cancellationToken, searchMeaning, options, result) { - this.sourceFiles = sourceFiles; - this.sourceFilesSet = sourceFilesSet; - this.specialSearchKind = specialSearchKind; - this.checker = checker; - this.cancellationToken = cancellationToken; - this.searchMeaning = searchMeaning; - this.options = options; - this.result = result; - /** Cache for `explicitlyinheritsFrom`. */ - this.inheritsFromCache = /* @__PURE__ */ new Map(); - /** - * Type nodes can contain multiple references to the same type. For example: - * let x: Foo & (Foo & Bar) = ... - * Because we are returning the implementation locations and not the identifier locations, - * duplicate entries would be returned here as each of the type references is part of - * the same implementation. For that reason, check before we add a new entry. - */ - this.markSeenContainingTypeReference = nodeSeenTracker(); - /** - * It's possible that we will encounter the right side of `export { foo as bar } from "x";` more than once. - * For example: - * // b.ts - * export { foo as bar } from "./a"; - * import { bar } from "./b"; - * - * Normally at `foo as bar` we directly add `foo` and do not locally search for it (since it doesn't declare a local). - * But another reference to it may appear in the same source file. - * See `tests/cases/fourslash/transitiveExportImports3.ts`. - */ - this.markSeenReExportRHS = nodeSeenTracker(); - this.symbolIdToReferences = []; - // Source file ID -> symbol ID -> Whether the symbol has been searched for in the source file. - this.sourceFileToSeenSymbols = []; - } - includesSourceFile(sourceFile) { - return this.sourceFilesSet.has(sourceFile.fileName); - } - /** Gets every place to look for references of an exported symbols. See `ImportsResult` in `importTracker.ts` for more documentation. */ - getImportSearches(exportSymbol, exportInfo) { - if (!this.importTracker) this.importTracker = createImportTracker(this.sourceFiles, this.sourceFilesSet, this.checker, this.cancellationToken); - return this.importTracker(exportSymbol, exportInfo, this.options.use === 2 /* Rename */); - } - /** @param allSearchSymbols set of additional symbols for use by `includes`. */ - createSearch(location, symbol, comingFrom, searchOptions = {}) { - const { - text = stripQuotes(symbolName(getLocalSymbolForExportDefault(symbol) || getNonModuleSymbolOfMergedModuleSymbol(symbol) || symbol)), - allSearchSymbols = [symbol] - } = searchOptions; - const escapedText = escapeLeadingUnderscores(text); - const parents = this.options.implementations && location ? getParentSymbolsOfPropertyAccess(location, symbol, this.checker) : void 0; - return { symbol, comingFrom, text, escapedText, parents, allSearchSymbols, includes: (sym) => contains(allSearchSymbols, sym) }; - } - /** - * Callback to add references for a particular searched symbol. - * This initializes a reference group, so only call this if you will add at least one reference. - */ - referenceAdder(searchSymbol) { - const symbolId = getSymbolId(searchSymbol); - let references = this.symbolIdToReferences[symbolId]; - if (!references) { - references = this.symbolIdToReferences[symbolId] = []; - this.result.push({ definition: { type: 0 /* Symbol */, symbol: searchSymbol }, references }); - } - return (node, kind) => references.push(nodeEntry(node, kind)); - } - /** Add a reference with no associated definition. */ - addStringOrCommentReference(fileName, textSpan) { - this.result.push({ - definition: void 0, - references: [{ kind: 0 /* Span */, fileName, textSpan }] - }); - } - /** Returns `true` the first time we search for a symbol in a file and `false` afterwards. */ - markSearchedSymbols(sourceFile, symbols) { - const sourceId = getNodeId(sourceFile); - const seenSymbols = this.sourceFileToSeenSymbols[sourceId] || (this.sourceFileToSeenSymbols[sourceId] = /* @__PURE__ */ new Set()); - let anyNewSymbols = false; - for (const sym of symbols) { - anyNewSymbols = tryAddToSet(seenSymbols, getSymbolId(sym)) || anyNewSymbols; - } - return anyNewSymbols; - } - } - function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { - const { importSearches, singleReferences, indirectUsers } = state.getImportSearches(exportSymbol, exportInfo); - if (singleReferences.length) { - const addRef = state.referenceAdder(exportSymbol); - for (const singleRef of singleReferences) { - if (shouldAddSingleReference(singleRef, state)) addRef(singleRef); - } - } - for (const [importLocation, importSymbol] of importSearches) { - getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch(importLocation, importSymbol, 1 /* Export */), state); - } - if (indirectUsers.length) { - let indirectSearch; - switch (exportInfo.exportKind) { - case 0 /* Named */: - indirectSearch = state.createSearch(exportLocation, exportSymbol, 1 /* Export */); - break; - case 1 /* Default */: - indirectSearch = state.options.use === 2 /* Rename */ ? void 0 : state.createSearch(exportLocation, exportSymbol, 1 /* Export */, { text: "default" }); - break; - case 2 /* ExportEquals */: - break; - } - if (indirectSearch) { - for (const indirectUser of indirectUsers) { - searchForName(indirectUser, indirectSearch, state); - } - } - } - } - function eachExportReference(sourceFiles, checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName, isDefaultExport, cb) { - const importTracker = createImportTracker(sourceFiles, new Set(sourceFiles.map((f) => f.fileName)), checker, cancellationToken); - const { importSearches, indirectUsers, singleReferences } = importTracker( - exportSymbol, - { exportKind: isDefaultExport ? 1 /* Default */ : 0 /* Named */, exportingModuleSymbol }, - /*isForRename*/ - false - ); - for (const [importLocation] of importSearches) { - cb(importLocation); - } - for (const singleReference of singleReferences) { - if (isIdentifier(singleReference) && isImportTypeNode(singleReference.parent)) { - cb(singleReference); - } - } - for (const indirectUser of indirectUsers) { - for (const node of getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? "default" : exportName)) { - const symbol = checker.getSymbolAtLocation(node); - const hasExportAssignmentDeclaration = some(symbol == null ? void 0 : symbol.declarations, (d) => tryCast(d, isExportAssignment) ? true : false); - if (isIdentifier(node) && !isImportOrExportSpecifier(node.parent) && (symbol === exportSymbol || hasExportAssignmentDeclaration)) { - cb(node); - } - } - } - } - Core2.eachExportReference = eachExportReference; - function shouldAddSingleReference(singleRef, state) { - if (!hasMatchingMeaning(singleRef, state)) return false; - if (state.options.use !== 2 /* Rename */) return true; - if (!isIdentifier(singleRef) && !isImportOrExportSpecifier(singleRef.parent)) return false; - return !(isImportOrExportSpecifier(singleRef.parent) && moduleExportNameIsDefault(singleRef)); - } - function searchForImportedSymbol(symbol, state) { - if (!symbol.declarations) return; - for (const declaration of symbol.declarations) { - const exportingFile = declaration.getSourceFile(); - getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state, state.includesSourceFile(exportingFile)); - } - } - function searchForName(sourceFile, search, state) { - if (getNameTable(sourceFile).get(search.escapedText) !== void 0) { - getReferencesInSourceFile(sourceFile, search, state); - } - } - function getPropertySymbolOfDestructuringAssignment(location, checker) { - return isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) ? checker.getPropertySymbolOfDestructuringAssignment(location) : void 0; - } - function getSymbolScope(symbol) { - const { declarations, flags, parent: parent2, valueDeclaration } = symbol; - if (valueDeclaration && (valueDeclaration.kind === 219 /* FunctionExpression */ || valueDeclaration.kind === 232 /* ClassExpression */)) { - return valueDeclaration; - } - if (!declarations) { - return void 0; - } - if (flags & (4 /* Property */ | 8192 /* Method */)) { - const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(d)); - if (privateDeclaration) { - return getAncestor(privateDeclaration, 264 /* ClassDeclaration */); - } - return void 0; - } - if (declarations.some(isObjectBindingElementWithoutPropertyName)) { - return void 0; - } - const exposedByParent = parent2 && !(symbol.flags & 262144 /* TypeParameter */); - if (exposedByParent && !(isExternalModuleSymbol(parent2) && !parent2.globalExports)) { - return void 0; - } - let scope; - for (const declaration of declarations) { - const container = getContainerNode(declaration); - if (scope && scope !== container) { - return void 0; - } - if (!container || container.kind === 308 /* SourceFile */ && !isExternalOrCommonJsModule(container)) { - return void 0; - } - scope = container; - if (isFunctionExpression(scope)) { - let next; - while (next = getNextJSDocCommentLocation(scope)) { - scope = next; - } - } - } - return exposedByParent ? scope.getSourceFile() : scope; - } - function isSymbolReferencedInFile(definition, checker, sourceFile, searchContainer = sourceFile) { - return eachSymbolReferenceInFile(definition, checker, sourceFile, () => true, searchContainer) || false; - } - Core2.isSymbolReferencedInFile = isSymbolReferencedInFile; - function eachSymbolReferenceInFile(definition, checker, sourceFile, cb, searchContainer = sourceFile) { - const symbol = isParameterPropertyDeclaration(definition.parent, definition.parent.parent) ? first(checker.getSymbolsOfParameterPropertyDeclaration(definition.parent, definition.text)) : checker.getSymbolAtLocation(definition); - if (!symbol) return void 0; - for (const token of getPossibleSymbolReferenceNodes(sourceFile, symbol.name, searchContainer)) { - if (!isIdentifier(token) || token === definition || token.escapedText !== definition.escapedText) continue; - const referenceSymbol = checker.getSymbolAtLocation(token); - if (referenceSymbol === symbol || checker.getShorthandAssignmentValueSymbol(token.parent) === symbol || isExportSpecifier(token.parent) && getLocalSymbolForExportSpecifier(token, referenceSymbol, token.parent, checker) === symbol) { - const res = cb(token); - if (res) return res; - } - } - } - Core2.eachSymbolReferenceInFile = eachSymbolReferenceInFile; - function getTopMostDeclarationNamesInFile(declarationName, sourceFile) { - const candidates = filter(getPossibleSymbolReferenceNodes(sourceFile, declarationName), (name) => !!getDeclarationFromName(name)); - return candidates.reduce((topMost, decl) => { - const depth = getDepth(decl); - if (!some(topMost.declarationNames) || depth === topMost.depth) { - topMost.declarationNames.push(decl); - topMost.depth = depth; - } else if (depth < topMost.depth) { - topMost.declarationNames = [decl]; - topMost.depth = depth; - } - return topMost; - }, { depth: Infinity, declarationNames: [] }).declarationNames; - function getDepth(declaration) { - let depth = 0; - while (declaration) { - declaration = getContainerNode(declaration); - depth++; - } - return depth; - } - } - Core2.getTopMostDeclarationNamesInFile = getTopMostDeclarationNamesInFile; - function someSignatureUsage(signature, sourceFiles, checker, cb) { - if (!signature.name || !isIdentifier(signature.name)) return false; - const symbol = Debug.checkDefined(checker.getSymbolAtLocation(signature.name)); - for (const sourceFile of sourceFiles) { - for (const name of getPossibleSymbolReferenceNodes(sourceFile, symbol.name)) { - if (!isIdentifier(name) || name === signature.name || name.escapedText !== signature.name.escapedText) continue; - const called = climbPastPropertyAccess(name); - const call = isCallExpression(called.parent) && called.parent.expression === called ? called.parent : void 0; - const referenceSymbol = checker.getSymbolAtLocation(name); - if (referenceSymbol && checker.getRootSymbols(referenceSymbol).some((s) => s === symbol)) { - if (cb(name, call)) { - return true; - } - } - } - } - return false; - } - Core2.someSignatureUsage = someSignatureUsage; - function getPossibleSymbolReferenceNodes(sourceFile, symbolName2, container = sourceFile) { - 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 = []; - if (!symbolName2 || !symbolName2.length) { - return positions; - } - const text = sourceFile.text; - const sourceLength = text.length; - const symbolNameLength = symbolName2.length; - let position = text.indexOf(symbolName2, container.pos); - while (position >= 0) { - if (position > container.end) break; - const endPosition = position + symbolNameLength; - if ((position === 0 || !isIdentifierPart(text.charCodeAt(position - 1), 99 /* Latest */)) && (endPosition === sourceLength || !isIdentifierPart(text.charCodeAt(endPosition), 99 /* Latest */))) { - positions.push(position); - } - position = text.indexOf(symbolName2, position + symbolNameLength + 1); - } - return positions; - } - function getLabelReferencesInNode(container, targetLabel) { - const sourceFile = container.getSourceFile(); - const labelName = targetLabel.text; - const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), (node) => ( - // Only pick labels that are either the target label, or have a target that is the target label - node === targetLabel || isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel ? nodeEntry(node) : void 0 - )); - return [{ definition: { type: 1 /* Label */, node: targetLabel }, references }]; - } - function isValidReferencePosition(node, searchSymbolName) { - switch (node.kind) { - case 81 /* PrivateIdentifier */: - if (isJSDocMemberName(node.parent)) { - return true; - } - // falls through I guess - case 80 /* Identifier */: - return node.text.length === searchSymbolName.length; - case 15 /* NoSubstitutionTemplateLiteral */: - case 11 /* StringLiteral */: { - const str = node; - return str.text.length === searchSymbolName.length && (isLiteralNameOfPropertyDeclarationOrIndexAccess(str) || isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isCallExpression(node.parent) && isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node || isImportOrExportSpecifier(node.parent)); - } - case 9 /* NumericLiteral */: - return isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.text.length === searchSymbolName.length; - case 90 /* DefaultKeyword */: - return "default".length === searchSymbolName.length; - default: - return false; - } - } - function getAllReferencesForImportMeta(sourceFiles, cancellationToken) { - const references = flatMap(sourceFiles, (sourceFile) => { - cancellationToken.throwIfCancellationRequested(); - return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "meta", sourceFile), (node) => { - const parent2 = node.parent; - if (isImportMeta(parent2)) { - return nodeEntry(parent2); - } - }); - }); - return references.length ? [{ definition: { type: 2 /* Keyword */, node: references[0].node }, references }] : void 0; - } - function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken, filter2) { - const references = flatMap(sourceFiles, (sourceFile) => { - cancellationToken.throwIfCancellationRequested(); - return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, tokenToString(keywordKind), sourceFile), (referenceLocation) => { - if (referenceLocation.kind === keywordKind && (!filter2 || filter2(referenceLocation))) { - return nodeEntry(referenceLocation); - } - }); - }); - return references.length ? [{ definition: { type: 2 /* Keyword */, node: references[0].node }, references }] : void 0; - } - function getReferencesInSourceFile(sourceFile, search, state, addReferencesHere = true) { - state.cancellationToken.throwIfCancellationRequested(); - return getReferencesInContainer(sourceFile, sourceFile, search, state, addReferencesHere); - } - function getReferencesInContainer(container, sourceFile, search, state, addReferencesHere) { - if (!state.markSearchedSymbols(sourceFile, search.allSearchSymbols)) { - return; - } - for (const position of getPossibleSymbolReferencePositions(sourceFile, search.text, container)) { - getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere); - } - } - function hasMatchingMeaning(referenceLocation, state) { - return !!(getMeaningFromLocation(referenceLocation) & state.searchMeaning); - } - function getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere) { - const referenceLocation = getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, search.text)) { - if (!state.options.implementations && (state.options.findInStrings && isInString(sourceFile, position) || state.options.findInComments && isInNonReferenceComment(sourceFile, position))) { - state.addStringOrCommentReference(sourceFile.fileName, createTextSpan(position, search.text.length)); - } - return; - } - if (!hasMatchingMeaning(referenceLocation, state)) return; - let referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); - if (!referenceSymbol) { - return; - } - const parent2 = referenceLocation.parent; - if (isImportSpecifier(parent2) && parent2.propertyName === referenceLocation) { - return; - } - if (isExportSpecifier(parent2)) { - Debug.assert(referenceLocation.kind === 80 /* Identifier */ || referenceLocation.kind === 11 /* StringLiteral */); - 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); - return; - } - switch (state.specialSearchKind) { - case 0 /* None */: - if (addReferencesHere) addReference(referenceLocation, relatedSymbol, state); - break; - case 1 /* Constructor */: - addConstructorReferences(referenceLocation, sourceFile, search, state); - break; - case 2 /* Class */: - addClassStaticThisReferences(referenceLocation, search, state); - break; - default: - Debug.assertNever(state.specialSearchKind); - } - if (isInJSFile(referenceLocation) && isBindingElement(referenceLocation.parent) && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) { - referenceSymbol = referenceLocation.parent.symbol; - if (!referenceSymbol) return; - } - 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; - const exportDeclaration = parent2.parent; - const localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); - if (!alwaysGetReferences && !search.includes(localSymbol)) { - return; - } - if (!propertyName) { - if (!(state.options.use === 2 /* Rename */ && moduleExportNameIsDefault(name))) { - addRef(); - } - } else if (referenceLocation === propertyName) { - if (!exportDeclaration.moduleSpecifier) { - addRef(); - } - if (addReferencesHere && state.options.use !== 2 /* Rename */ && state.markSeenReExportRHS(name)) { - addReference(name, Debug.checkDefined(exportSpecifier.symbol), state); - } - } else { - if (state.markSeenReExportRHS(referenceLocation)) { - addRef(); - } - } - if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { - const isDefaultExport = moduleExportNameIsDefault(referenceLocation) || moduleExportNameIsDefault(exportSpecifier.name); - const exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */; - const exportSymbol = Debug.checkDefined(exportSpecifier.symbol); - const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker); - if (exportInfo) { - searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); - } - } - if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !isForRenameWithPrefixAndSuffixText(state.options)) { - const imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); - if (imported) searchForImportedSymbol(imported, state); - } - function addRef() { - if (addReferencesHere) addReference(referenceLocation, localSymbol, state); - } - } - function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; - } - function isExportSpecifierAlias(referenceLocation, exportSpecifier) { - const { parent: parent2, propertyName, name } = exportSpecifier; - Debug.assert(propertyName === referenceLocation || name === referenceLocation); - if (propertyName) { - return propertyName === referenceLocation; - } else { - return !parent2.parent.moduleSpecifier; - } - } - function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { - const importOrExport = getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1 /* Export */); - if (!importOrExport) return; - const { symbol } = importOrExport; - if (importOrExport.kind === 0 /* Import */) { - if (!isForRenameWithPrefixAndSuffixText(state.options)) { - searchForImportedSymbol(symbol, state); - } - } else { - searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); - } - } - function getReferenceForShorthandProperty({ flags, valueDeclaration }, search, state) { - const shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); - const name = valueDeclaration && getNameOfDeclaration(valueDeclaration); - if (!(flags & 33554432 /* Transient */) && name && search.includes(shorthandValueSymbol)) { - addReference(name, shorthandValueSymbol, state); - } - } - function addReference(referenceLocation, relatedSymbol, state) { - const { kind, symbol } = "kind" in relatedSymbol ? relatedSymbol : { kind: void 0, symbol: relatedSymbol }; - if (state.options.use === 2 /* Rename */ && referenceLocation.kind === 90 /* DefaultKeyword */) { - return; - } - const addRef = state.referenceAdder(symbol); - if (state.options.implementations) { - addImplementationReferences(referenceLocation, addRef, state); - } else { - addRef(referenceLocation, kind); - } - } - function addConstructorReferences(referenceLocation, sourceFile, search, state) { - if (isNewExpressionTarget(referenceLocation)) { - addReference(referenceLocation, search.symbol, state); - } - const pusher = () => state.referenceAdder(search.symbol); - if (isClassLike(referenceLocation.parent)) { - Debug.assert(referenceLocation.kind === 90 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); - findOwnConstructorReferences(search.symbol, sourceFile, pusher()); - } else { - const classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending) { - findSuperConstructorAccesses(classExtending, pusher()); - findInheritedConstructorReferences(classExtending, state); - } - } - } - function addClassStaticThisReferences(referenceLocation, search, state) { - addReference(referenceLocation, search.symbol, state); - const classLike = referenceLocation.parent; - if (state.options.use === 2 /* Rename */ || !isClassLike(classLike)) return; - Debug.assert(classLike.name === referenceLocation); - const addRef = state.referenceAdder(search.symbol); - for (const member of classLike.members) { - if (!(isMethodOrAccessor(member) && isStatic(member))) { - continue; - } - if (member.body) { - member.body.forEachChild(function cb(node) { - if (node.kind === 110 /* ThisKeyword */) { - addRef(node); - } else if (!isFunctionLike(node) && !isClassLike(node)) { - node.forEachChild(cb); - } - }); - } - } - } - function findOwnConstructorReferences(classSymbol, sourceFile, addNode) { - const constructorSymbol = getClassConstructorSymbol(classSymbol); - if (constructorSymbol && constructorSymbol.declarations) { - for (const decl of constructorSymbol.declarations) { - const ctrKeyword = findChildOfKind(decl, 137 /* ConstructorKeyword */, sourceFile); - Debug.assert(decl.kind === 177 /* Constructor */ && !!ctrKeyword); - addNode(ctrKeyword); - } - } - if (classSymbol.exports) { - classSymbol.exports.forEach((member) => { - const decl = member.valueDeclaration; - if (decl && decl.kind === 175 /* MethodDeclaration */) { - const body = decl.body; - if (body) { - forEachDescendantOfKind(body, 110 /* ThisKeyword */, (thisKeyword) => { - if (isNewExpressionTarget(thisKeyword)) { - addNode(thisKeyword); - } - }); - } - } - }); - } - } - function getClassConstructorSymbol(classSymbol) { - return classSymbol.members && classSymbol.members.get("__constructor" /* Constructor */); - } - function findSuperConstructorAccesses(classDeclaration, addNode) { - const constructor = getClassConstructorSymbol(classDeclaration.symbol); - if (!(constructor && constructor.declarations)) { - return; - } - for (const decl of constructor.declarations) { - Debug.assert(decl.kind === 177 /* Constructor */); - const body = decl.body; - if (body) { - forEachDescendantOfKind(body, 108 /* SuperKeyword */, (node) => { - if (isCallExpressionTarget(node)) { - addNode(node); - } - }); - } - } - } - function hasOwnConstructor(classDeclaration) { - return !!getClassConstructorSymbol(classDeclaration.symbol); - } - function findInheritedConstructorReferences(classDeclaration, state) { - if (hasOwnConstructor(classDeclaration)) return; - const classSymbol = classDeclaration.symbol; - const search = state.createSearch( - /*location*/ - void 0, - classSymbol, - /*comingFrom*/ - void 0 - ); - getReferencesInContainerOrFiles(classSymbol, state, search); - } - function addImplementationReferences(refNode, addReference2, state) { - if (isDeclarationName(refNode) && isImplementation(refNode.parent)) { - addReference2(refNode); - return; - } - if (refNode.kind !== 80 /* Identifier */) { - return; - } - if (refNode.parent.kind === 305 /* ShorthandPropertyAssignment */) { - getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2); - } - const containingNode = getContainingNodeIfInHeritageClause(refNode); - if (containingNode) { - addReference2(containingNode); - return; - } - const typeNode = findAncestor(refNode, (a) => !isQualifiedName(a.parent) && !isTypeNode(a.parent) && !isTypeElement(a.parent)); - const typeHavingNode = typeNode.parent; - if (hasType(typeHavingNode) && typeHavingNode.type === typeNode && state.markSeenContainingTypeReference(typeHavingNode)) { - if (hasInitializer(typeHavingNode)) { - addIfImplementation(typeHavingNode.initializer); - } else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) { - const body = typeHavingNode.body; - if (body.kind === 242 /* Block */) { - forEachReturnStatement(body, (returnStatement) => { - if (returnStatement.expression) addIfImplementation(returnStatement.expression); - }); - } else { - addIfImplementation(body); - } - } else if (isAssertionExpression(typeHavingNode) || isSatisfiesExpression(typeHavingNode)) { - addIfImplementation(typeHavingNode.expression); - } - } - function addIfImplementation(e) { - if (isImplementationExpression(e)) addReference2(e); - } - } - 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 218 /* ParenthesizedExpression */: - return isImplementationExpression(node.expression); - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - case 211 /* ObjectLiteralExpression */: - case 232 /* ClassExpression */: - case 210 /* ArrayLiteralExpression */: - return true; - default: - return false; - } - } - function explicitlyInheritsFrom(symbol, parent2, cachedResults, checker) { - if (symbol === parent2) { - return true; - } - const key = getSymbolId(symbol) + "," + getSymbolId(parent2); - const cached = cachedResults.get(key); - if (cached !== void 0) { - 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); - }) - ); - cachedResults.set(key, inherits); - return inherits; - } - function getReferencesForSuperKeyword(superKeyword) { - let searchSpaceNode = getSuperContainer( - superKeyword, - /*stopOnFunctions*/ - false - ); - if (!searchSpaceNode) { - return void 0; - } - let staticFlag = 256 /* Static */; - switch (searchSpaceNode.kind) { - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - staticFlag &= getSyntacticModifierFlags(searchSpaceNode); - searchSpaceNode = searchSpaceNode.parent; - break; - default: - return void 0; - } - const sourceFile = searchSpaceNode.getSourceFile(); - const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "super", searchSpaceNode), (node) => { - if (node.kind !== 108 /* SuperKeyword */) { - return; - } - const container = getSuperContainer( - node, - /*stopOnFunctions*/ - false - ); - return container && isStatic(container) === !!staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : void 0; - }); - return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references }]; - } - function isParameterName(node) { - return node.kind === 80 /* Identifier */ && node.parent.kind === 170 /* Parameter */ && node.parent.name === node; - } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { - let searchSpaceNode = getThisContainer( - thisOrSuperKeyword, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - let staticFlag = 256 /* Static */; - switch (searchSpaceNode.kind) { - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - if (isObjectLiteralMethod(searchSpaceNode)) { - staticFlag &= getSyntacticModifierFlags(searchSpaceNode); - searchSpaceNode = searchSpaceNode.parent; - break; - } - // falls through - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - staticFlag &= getSyntacticModifierFlags(searchSpaceNode); - searchSpaceNode = searchSpaceNode.parent; - break; - case 308 /* SourceFile */: - if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { - return void 0; - } - // falls through - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - break; - // Computed properties in classes are not handled here because references to this are illegal, - // so there is no point finding references to them. - default: - return void 0; - } - const references = flatMap(searchSpaceNode.kind === 308 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { - cancellationToken.throwIfCancellationRequested(); - return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => { - if (!isThis(node)) { - return false; - } - const container = getThisContainer( - node, - /*includeArrowFunctions*/ - false, - /*includeClassComputedPropertyName*/ - false - ); - if (!canHaveSymbol(container)) return false; - switch (searchSpaceNode.kind) { - case 219 /* FunctionExpression */: - case 263 /* FunctionDeclaration */: - return searchSpaceNode.symbol === container.symbol; - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 232 /* ClassExpression */: - case 264 /* ClassDeclaration */: - case 211 /* ObjectLiteralExpression */: - return container.parent && canHaveSymbol(container.parent) && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag; - case 308 /* SourceFile */: - return container.kind === 308 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node); - } - }); - }).map((n) => nodeEntry(n)); - const thisParameter = firstDefined(references, (r) => isParameter(r.node.parent) ? r.node : void 0); - return [{ - definition: { type: 3 /* This */, node: thisParameter || thisOrSuperKeyword }, - references - }]; - } - function getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken) { - const type = getContextualTypeFromParentOrAncestorTypeNode(node, checker); - const references = flatMap(sourceFiles, (sourceFile) => { - cancellationToken.throwIfCancellationRequested(); - return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, node.text), (ref) => { - if (isStringLiteralLike(ref) && ref.text === node.text) { - if (type) { - const refType = getContextualTypeFromParentOrAncestorTypeNode(ref, checker); - if (type !== checker.getStringType() && (type === refType || isStringLiteralPropertyReference(ref, checker))) { - return nodeEntry(ref, 2 /* StringLiteral */); - } - } else { - return isNoSubstitutionTemplateLiteral(ref) && !rangeIsOnSingleLine(ref, sourceFile) ? void 0 : nodeEntry(ref, 2 /* StringLiteral */); - } - } - }); - }); - return [{ - definition: { type: 4 /* String */, node }, - 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( - symbol, - location, - checker, - isForRename, - !(isForRename && providePrefixAndSuffixText), - (sym, root, base) => { - if (base) { - if (isStaticSymbol(symbol) !== isStaticSymbol(base)) { - base = void 0; - } - } - result.push(base || root || sym); - }, - // when try to find implementation, implementations is true, and not allowed to find base class - /*allowBaseTypes*/ - () => !implementations - ); - return result; - } - function forEachRelatedSymbol(symbol, location, checker, isForRenamePopulateSearchSymbolSet, onlyIncludeBindingElementAtReferenceLocation, cbSymbol, allowBaseTypes) { - const containingObjectLiteralElement = getContainingObjectLiteralElement(location); - if (containingObjectLiteralElement) { - const shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); - if (shorthandValueSymbol && isForRenamePopulateSearchSymbolSet) { - return cbSymbol( - shorthandValueSymbol, - /*rootSymbol*/ - void 0, - /*baseSymbol*/ - void 0, - 3 /* SearchedLocalFoundProperty */ - ); - } - const contextualType = checker.getContextualType(containingObjectLiteralElement.parent); - const res2 = contextualType && firstDefined( - getPropertySymbolsFromContextualType( - containingObjectLiteralElement, - checker, - contextualType, - /*unionSymbolOk*/ - true - ), - (sym) => fromRoot(sym, 4 /* SearchedPropertyFoundLocal */) - ); - if (res2) return res2; - const propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); - const res1 = propertySymbol && cbSymbol( - propertySymbol, - /*rootSymbol*/ - void 0, - /*baseSymbol*/ - void 0, - 4 /* SearchedPropertyFoundLocal */ - ); - if (res1) return res1; - const res22 = shorthandValueSymbol && cbSymbol( - shorthandValueSymbol, - /*rootSymbol*/ - void 0, - /*baseSymbol*/ - void 0, - 3 /* SearchedLocalFoundProperty */ - ); - if (res22) return res22; - } - const aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(location, symbol, checker); - if (aliasedSymbol) { - const res2 = cbSymbol( - aliasedSymbol, - /*rootSymbol*/ - void 0, - /*baseSymbol*/ - void 0, - 1 /* Node */ - ); - if (res2) return res2; - } - const res = fromRoot(symbol); - if (res) return res; - if (symbol.valueDeclaration && isParameterPropertyDeclaration(symbol.valueDeclaration, symbol.valueDeclaration.parent)) { - const paramProps = checker.getSymbolsOfParameterPropertyDeclaration(cast(symbol.valueDeclaration, isParameter), symbol.name); - 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, 282 /* ExportSpecifier */); - if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { - const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); - if (localSymbol) { - const res2 = cbSymbol( - localSymbol, - /*rootSymbol*/ - void 0, - /*baseSymbol*/ - void 0, - 1 /* Node */ - ); - if (res2) return res2; - } - } - if (!isForRenamePopulateSearchSymbolSet) { - let bindingElementPropertySymbol; - if (onlyIncludeBindingElementAtReferenceLocation) { - bindingElementPropertySymbol = isObjectBindingElementWithoutPropertyName(location.parent) ? getPropertySymbolFromBindingElement(checker, location.parent) : void 0; - } else { - bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); - } - return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */); - } - Debug.assert(isForRenamePopulateSearchSymbolSet); - const includeOriginalSymbolOfBindingElement = onlyIncludeBindingElementAtReferenceLocation; - if (includeOriginalSymbolOfBindingElement) { - const bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); - return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */); - } - function fromRoot(sym, kind) { - return firstDefined(checker.getRootSymbols(sym), (rootSymbol) => cbSymbol( - sym, - rootSymbol, - /*baseSymbol*/ - void 0, - kind - ) || (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, 209 /* BindingElement */); - if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) { - return getPropertySymbolFromBindingElement(checker2, bindingElement); - } - } - } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) { - const seen = /* @__PURE__ */ new Set(); - return recur(symbol); - function recur(symbol2) { - if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return; - return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => { - const type = checker.getTypeAtLocation(typeReference); - const propertySymbol = type.symbol && checker.getPropertyOfType(type, propertyName); - return propertySymbol && firstDefined(checker.getRootSymbols(propertySymbol), cb) || type.symbol && recur(type.symbol); - })); - } - } - function isStaticSymbol(symbol) { - if (!symbol.valueDeclaration) return false; - const modifierFlags = getEffectiveModifierFlags(symbol.valueDeclaration); - return !!(modifierFlags & 256 /* Static */); - } - function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { - const { checker } = state; - return forEachRelatedSymbol( - referenceSymbol, - referenceLocation, - checker, - /*isForRenamePopulateSearchSymbolSet*/ - false, - /*onlyIncludeBindingElementAtReferenceLocation*/ - state.options.use !== 2 /* Rename */ || !!state.options.providePrefixAndSuffixTextForRename, - (sym, rootSymbol, baseSymbol, kind) => { - if (baseSymbol) { - if (isStaticSymbol(referenceSymbol) !== isStaticSymbol(baseSymbol)) { - baseSymbol = void 0; - } - } - return search.includes(baseSymbol || rootSymbol || sym) ? { symbol: rootSymbol && !(getCheckFlags(sym) & 6 /* Synthetic */) ? rootSymbol : sym, kind } : void 0; - }, - /*allowBaseTypes*/ - (rootSymbol) => !(search.parents && !search.parents.some((parent2) => explicitlyInheritsFrom(rootSymbol.parent, parent2, state.inheritsFromCache, checker))) - ); - } - function getIntersectingMeaningFromDeclarations(node, symbol) { - let meaning = getMeaningFromLocation(node); - const { declarations } = symbol; - if (declarations) { - let lastIterationMeaning; - do { - lastIterationMeaning = meaning; - for (const declaration of declarations) { - const declarationMeaning = getMeaningFromDeclaration(declaration); - if (declarationMeaning & meaning) { - meaning |= declarationMeaning; - } - } - } while (meaning !== lastIterationMeaning); - } - return meaning; - } - Core2.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; - function isImplementation(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); - const shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); - if (shorthandSymbol) { - for (const declaration of shorthandSymbol.getDeclarations()) { - if (getMeaningFromDeclaration(declaration) & 1 /* Value */) { - addReference2(declaration); - } - } - } - } - Core2.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; - function forEachDescendantOfKind(node, kind, action) { - forEachChild(node, (child) => { - if (child.kind === kind) { - action(child); - } - forEachDescendantOfKind(child, kind, action); - }); - } - function tryGetClassByExtendingIdentifier(node) { - return tryGetClassExtendingExpressionWithTypeArguments(climbPastPropertyAccess(node).parent); - } - function getParentSymbolsOfPropertyAccess(location, symbol, checker) { - const propertyAccessExpression = isRightSideOfPropertyAccess(location) ? location.parent : void 0; - const lhsType = propertyAccessExpression && checker.getTypeAtLocation(propertyAccessExpression.expression); - const res = mapDefined(lhsType && (lhsType.isUnionOrIntersection() ? lhsType.types : lhsType.symbol === symbol.parent ? void 0 : [lhsType]), (t) => t.symbol && t.symbol.flags & (32 /* Class */ | 64 /* Interface */) ? t.symbol : void 0); - return res.length === 0 ? void 0 : res; - } - function isForRenameWithPrefixAndSuffixText(options) { - return options.use === 2 /* Rename */ && options.providePrefixAndSuffixTextForRename; - } -})(Core || (Core = {})); - -// src/services/_namespaces/ts.GoToDefinition.ts -var ts_GoToDefinition_exports = {}; -__export(ts_GoToDefinition_exports, { - createDefinitionInfo: () => createDefinitionInfo, - getDefinitionAndBoundSpan: () => getDefinitionAndBoundSpan, - getDefinitionAtPosition: () => getDefinitionAtPosition, - getReferenceAtPosition: () => getReferenceAtPosition, - getTypeDefinitionAtPosition: () => getTypeDefinitionAtPosition -}); - -// src/services/goToDefinition.ts -function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) { - 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) { - return fileReferenceDefinition; - } - const node = getTouchingPropertyName(sourceFile, position); - if (node === sourceFile) { - return void 0; - } - const { parent: parent2 } = node; - const typeChecker = program.getTypeChecker(); - if (node.kind === 164 /* OverrideKeyword */ || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) { - const def = getDefinitionFromOverriddenMember(typeChecker, node); - if (def !== void 0 || node.kind !== 164 /* OverrideKeyword */) { - return def || emptyArray; - } - } - if (isJumpStatementTarget(node)) { - const label = getTargetLabel(node.parent, node.text); - return label ? [createDefinitionInfoFromName( - typeChecker, - label, - "label" /* label */, - node.text, - /*containerName*/ - void 0 - )] : void 0; - } - switch (node.kind) { - case 90 /* DefaultKeyword */: - if (!isDefaultClause(node.parent)) { - break; - } - // falls through - case 84 /* CaseKeyword */: - const switchStatement = findAncestor(node.parent, isSwitchStatement); - if (switchStatement) { - return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)]; - } - break; - } - let findFunctionDecl; - switch (node.kind) { - case 107 /* ReturnKeyword */: - case 135 /* AwaitKeyword */: - case 127 /* YieldKeyword */: - findFunctionDecl = isFunctionLikeDeclaration; - const functionDeclaration = findAncestor(node, findFunctionDecl); - return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0; - } - if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) { - const classDecl = node.parent.parent; - const { symbol: symbol2, failedAliasResolution: failedAliasResolution2 } = getSymbol(classDecl, typeChecker, stopAtAlias); - const staticBlocks = filter(classDecl.members, isClassStaticBlockDeclaration); - const containerName = symbol2 ? typeChecker.symbolToString(symbol2, classDecl) : ""; - const sourceFile2 = node.getSourceFile(); - return map(staticBlocks, (staticBlock) => { - let { pos } = moveRangePastModifiers(staticBlock); - pos = skipTrivia(sourceFile2.text, pos); - return createDefinitionInfoFromName( - typeChecker, - staticBlock, - "constructor" /* constructorImplementationElement */, - "static {}", - containerName, - /*unverified*/ - false, - failedAliasResolution2, - { start: pos, length: "static".length } - ); - }); - } - let { symbol, failedAliasResolution } = getSymbol(node, typeChecker, stopAtAlias); - let fallbackNode = node; - if (searchOtherFilesOnly && failedAliasResolution) { - const importDeclaration = forEach([node, ...(symbol == null ? void 0 : symbol.declarations) || emptyArray], (n) => findAncestor(n, isAnyImportOrBareOrAccessedRequire)); - const moduleSpecifier = importDeclaration && tryGetModuleSpecifierFromDeclaration(importDeclaration); - if (moduleSpecifier) { - ({ symbol, failedAliasResolution } = getSymbol(moduleSpecifier, typeChecker, stopAtAlias)); - fallbackNode = moduleSpecifier; - } - } - if (!symbol && isModuleSpecifierLike(fallbackNode)) { - const ref = (_a = program.getResolvedModuleFromModuleSpecifier(fallbackNode, sourceFile)) == null ? void 0 : _a.resolvedModule; - if (ref) { - return [{ - name: fallbackNode.text, - fileName: ref.resolvedFileName, - containerName: void 0, - containerKind: void 0, - kind: "script" /* scriptElement */, - textSpan: createTextSpan(0, 0), - failedAliasResolution, - isAmbient: isDeclarationFileName(ref.resolvedFileName), - unverified: fallbackNode !== node - }]; - } - } - if (isModifier(node) && (isClassElement(parent2) || isNamedDeclaration(parent2))) { - symbol = parent2.symbol; - } - if (!symbol) { - return concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker)); - } - if (searchOtherFilesOnly && every(symbol.declarations, (d) => d.getSourceFile().fileName === sourceFile.fileName)) return void 0; - const calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); - if (calledDeclaration && !(isJsxOpeningLikeElement(node.parent) && isJsxConstructorLike(calledDeclaration))) { - const sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration, failedAliasResolution); - let declarationFilter = (d) => d !== calledDeclaration; - if (typeChecker.getRootSymbols(symbol).some((s) => symbolMatchesSignature(s, calledDeclaration))) { - if (!isConstructorDeclaration(calledDeclaration)) return [sigInfo]; - declarationFilter = (d) => d !== calledDeclaration && (isClassDeclaration(d) || isClassExpression(d)); - } - const defs = getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, declarationFilter) || emptyArray; - return node.kind === 108 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo]; - } - if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { - const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); - const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo( - decl, - typeChecker, - shorthandSymbol, - node, - /*unverified*/ - false, - failedAliasResolution - )) : emptyArray; - return concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker, node)); - } - if (isPropertyName(node) && isBindingElement(parent2) && isObjectBindingPattern(parent2.parent) && node === (parent2.propertyName || parent2.name)) { - const name = getNameFromPropertyName(node); - const type = typeChecker.getTypeAtLocation(parent2.parent); - return name === void 0 ? emptyArray : flatMap(type.isUnion() ? type.types : [type], (t) => { - const prop = t.getProperty(name); - return prop && getDefinitionFromSymbol(typeChecker, prop, node); - }); - } - const objectLiteralElementDefinition = getDefinitionFromObjectLiteralElement(typeChecker, node); - return concatenate(fileReferenceDefinition, objectLiteralElementDefinition.length ? objectLiteralElementDefinition : getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution)); -} -function symbolMatchesSignature(s, calledDeclaration) { - var _a; - return s === calledDeclaration.symbol || s === calledDeclaration.symbol.parent || isAssignmentExpression(calledDeclaration.parent) || !isCallLikeExpression(calledDeclaration.parent) && s === ((_a = tryCast(calledDeclaration.parent, canHaveSymbol)) == null ? void 0 : _a.symbol); -} -function getDefinitionFromObjectLiteralElement(typeChecker, node) { - const element = getContainingObjectLiteralElement(node); - if (element) { - const contextualType = element && typeChecker.getContextualType(element.parent); - if (contextualType) { - return flatMap(getPropertySymbolsFromContextualType( - element, - typeChecker, - contextualType, - /*unionSymbolOk*/ - false - ), (propertySymbol) => getDefinitionFromSymbol(typeChecker, propertySymbol, node)); - } - } - return emptyArray; -} -function getDefinitionFromOverriddenMember(typeChecker, node) { - const classElement = findAncestor(node, isClassElement); - if (!(classElement && classElement.name)) return; - const baseDeclaration = findAncestor(classElement, isClassLike); - if (!baseDeclaration) return; - const baseTypeNode = getEffectiveBaseTypeNode(baseDeclaration); - if (!baseTypeNode) return; - const expression = skipParentheses(baseTypeNode.expression); - const base = isClassExpression(expression) ? expression.symbol : typeChecker.getSymbolAtLocation(expression); - if (!base) return; - const baseType = hasStaticModifier(classElement) ? typeChecker.getTypeOfSymbol(base) : typeChecker.getDeclaredTypeOfSymbol(base); - let baseProp; - if (isComputedPropertyName(classElement.name)) { - const prop = typeChecker.getSymbolAtLocation(classElement.name); - if (!prop) { - return; - } - if (isKnownSymbol(prop)) { - baseProp = find(typeChecker.getPropertiesOfType(baseType), (s) => s.escapedName === prop.escapedName); - } else { - baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(prop.escapedName)); - } - } else { - baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name))); - } - if (!baseProp) return; - return getDefinitionFromSymbol(typeChecker, baseProp, node); -} -function getReferenceAtPosition(sourceFile, position, program) { - var _a, _b; - const referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); - if (referencePath) { - const file = program.getSourceFileFromReference(sourceFile, referencePath); - return file && { reference: referencePath, fileName: file.fileName, file, unverified: false }; - } - const typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); - if (typeReferenceDirective) { - const reference = (_a = program.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(typeReferenceDirective, sourceFile)) == null ? void 0 : _a.resolvedTypeReferenceDirective; - const file = reference && program.getSourceFile(reference.resolvedFileName); - return file && { reference: typeReferenceDirective, fileName: file.fileName, file, unverified: false }; - } - const libReferenceDirective = findReferenceInPosition(sourceFile.libReferenceDirectives, position); - if (libReferenceDirective) { - const file = program.getLibFileFromReference(libReferenceDirective); - return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false }; - } - if (sourceFile.imports.length || sourceFile.moduleAugmentations.length) { - const node = getTouchingToken(sourceFile, position); - let resolution; - if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && (resolution = program.getResolvedModuleFromModuleSpecifier(node, sourceFile))) { - const verifiedFileName = (_b = resolution.resolvedModule) == null ? void 0 : _b.resolvedFileName; - const fileName = verifiedFileName || resolvePath(getDirectoryPath(sourceFile.fileName), node.text); - return { - file: program.getSourceFile(fileName), - fileName, - reference: { - pos: node.getStart(), - end: node.getEnd(), - fileName: node.text - }, - unverified: !verifiedFileName - }; - } - } - return void 0; -} -var typesWithUnwrappedTypeArguments = /* @__PURE__ */ new Set([ - "Array", - "ArrayLike", - "ReadonlyArray", - "Promise", - "PromiseLike", - "Iterable", - "IterableIterator", - "AsyncIterable", - "Set", - "WeakSet", - "ReadonlySet", - "Map", - "WeakMap", - "ReadonlyMap", - "Partial", - "Required", - "Readonly", - "Pick", - "Omit" -]); -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) { - return void 0; - } - if (isImportMeta(node.parent) && node.parent.name === node) { - return definitionFromType( - typeChecker.getTypeAtLocation(node.parent), - typeChecker, - node.parent, - /*failedAliasResolution*/ - false - ); - } - let { symbol, failedAliasResolution } = getSymbol( - node, - typeChecker, - /*stopAtAlias*/ - false - ); - if (isModifier(node) && (isClassElement(node.parent) || isNamedDeclaration(node.parent))) { - symbol = node.parent.symbol; - failedAliasResolution = false; - } - if (!symbol) return void 0; - const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node); - const returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker); - const fromReturnType = returnType && definitionFromType(returnType, typeChecker, node, failedAliasResolution); - 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)); -} -function tryGetReturnTypeOfFunction(symbol, type, checker) { - if (type.symbol === symbol || // At `const f = () => {}`, the symbol is `f` and the type symbol is at `() => {}` - symbol.valueDeclaration && type.symbol && isVariableDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.initializer === type.symbol.valueDeclaration) { - const sigs = type.getCallSignatures(); - if (sigs.length === 1) return checker.getReturnTypeOfSignature(first(sigs)); - } - return void 0; -} -function getDefinitionAndBoundSpan(program, sourceFile, position) { - const definitions = getDefinitionAtPosition(program, sourceFile, position); - if (!definitions || definitions.length === 0) { - return void 0; - } - const comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position) || findReferenceInPosition(sourceFile.libReferenceDirectives, position); - if (comment) { - return { definitions, textSpan: createTextSpanFromRange(comment) }; - } - const node = getTouchingPropertyName(sourceFile, position); - const textSpan = createTextSpan(node.getStart(), node.getWidth()); - return { definitions, textSpan }; -} -function getDefinitionInfoForIndexSignatures(node, checker) { - return mapDefined(checker.getIndexInfosAtLocation(node), (info) => info.declaration && createDefinitionFromSignatureDeclaration(checker, info.declaration)); -} -function getSymbol(node, checker, stopAtAlias) { - const symbol = checker.getSymbolAtLocation(node); - let failedAliasResolution = false; - if ((symbol == null ? void 0 : symbol.declarations) && symbol.flags & 2097152 /* Alias */ && !stopAtAlias && shouldSkipAlias(node, symbol.declarations[0])) { - const aliased = checker.getAliasedSymbol(symbol); - if (aliased.declarations) { - return { symbol: aliased }; - } else { - failedAliasResolution = true; - } - } - return { symbol, failedAliasResolution }; -} -function shouldSkipAlias(node, declaration) { - if (node.kind !== 80 /* Identifier */ && (node.kind !== 11 /* StringLiteral */ || !isImportOrExportSpecifier(node.parent))) { - return false; - } - if (node.parent === declaration) { - return true; - } - if (declaration.kind === 275 /* NamespaceImport */) { - return false; - } - return true; -} -function isExpandoDeclaration(node) { - if (!isAssignmentDeclaration(node)) return false; - const containingAssignment = findAncestor(node, (p) => { - if (isAssignmentExpression(p)) return true; - if (!isAssignmentDeclaration(p)) return "quit"; - return false; - }); - return !!containingAssignment && getAssignmentDeclarationKind(containingAssignment) === 5 /* Property */; -} -function getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, declarationFilter) { - const filteredDeclarations = declarationFilter !== void 0 ? filter(symbol.declarations, declarationFilter) : symbol.declarations; - const signatureDefinition = !declarationFilter && (getConstructSignatureDefinition() || getCallSignatureDefinition()); - if (signatureDefinition) { - return signatureDefinition; - } - const withoutExpandos = filter(filteredDeclarations, (d) => !isExpandoDeclaration(d)); - const results = some(withoutExpandos) ? withoutExpandos : filteredDeclarations; - return map(results, (declaration) => createDefinitionInfo( - declaration, - typeChecker, - symbol, - node, - /*unverified*/ - false, - failedAliasResolution - )); - function getConstructSignatureDefinition() { - if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (isNewExpressionTarget(node) || node.kind === 137 /* ConstructorKeyword */)) { - const cls = find(filteredDeclarations, isClassLike); - return cls && getSignatureDefinition( - cls.members, - /*selectConstructors*/ - true - ); - } - } - function getCallSignatureDefinition() { - return isCallOrNewExpressionTarget(node) || isNameOfFunctionDeclaration(node) ? getSignatureDefinition( - filteredDeclarations, - /*selectConstructors*/ - false - ) : void 0; - } - function getSignatureDefinition(signatureDeclarations, selectConstructors) { - if (!signatureDeclarations) { - return void 0; - } - const declarations = signatureDeclarations.filter(selectConstructors ? isConstructorDeclaration : isFunctionLike); - const declarationsWithBody = declarations.filter((d) => !!d.body); - return declarations.length ? declarationsWithBody.length !== 0 ? declarationsWithBody.map((x) => createDefinitionInfo(x, typeChecker, symbol, node)) : [createDefinitionInfo( - last(declarations), - typeChecker, - symbol, - node, - /*unverified*/ - false, - failedAliasResolution - )] : void 0; - } -} -function createDefinitionInfo(declaration, checker, symbol, node, unverified, failedAliasResolution) { - const symbolName2 = checker.symbolToString(symbol); - const symbolKind = ts_SymbolDisplay_exports.getSymbolKind(checker, symbol, node); - const containerName = symbol.parent ? checker.symbolToString(symbol.parent, node) : ""; - return createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName2, containerName, unverified, failedAliasResolution); -} -function createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName2, containerName, unverified, failedAliasResolution, textSpan) { - const sourceFile = declaration.getSourceFile(); - if (!textSpan) { - const name = getNameOfDeclaration(declaration) || declaration; - textSpan = createTextSpanFromNode(name, sourceFile); - } - return { - fileName: sourceFile.fileName, - textSpan, - kind: symbolKind, - name: symbolName2, - containerKind: void 0, - // TODO: GH#18217 - containerName, - ...ts_FindAllReferences_exports.toContextSpan( - textSpan, - sourceFile, - ts_FindAllReferences_exports.getContextNode(declaration) - ), - isLocal: !isDefinitionVisible(checker, declaration), - 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; - if (!declaration.parent) return false; - if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration) return isDefinitionVisible(checker, declaration.parent); - switch (declaration.kind) { - case 173 /* PropertyDeclaration */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - case 175 /* MethodDeclaration */: - if (hasEffectiveModifier(declaration, 2 /* Private */)) return false; - // Public properties/methods are visible if its parents are visible, so: - // falls through - case 177 /* Constructor */: - case 304 /* PropertyAssignment */: - case 305 /* ShorthandPropertyAssignment */: - case 211 /* ObjectLiteralExpression */: - case 232 /* ClassExpression */: - case 220 /* ArrowFunction */: - case 219 /* FunctionExpression */: - return isDefinitionVisible(checker, declaration.parent); - default: - return false; - } -} -function createDefinitionFromSignatureDeclaration(typeChecker, decl, failedAliasResolution) { - return createDefinitionInfo( - decl, - typeChecker, - decl.symbol, - decl, - /*unverified*/ - false, - failedAliasResolution - ); -} -function findReferenceInPosition(refs, pos) { - return find(refs, (ref) => textRangeContainsPositionInclusive(ref, pos)); -} -function getDefinitionInfoForFileReference(name, targetFileName, unverified) { - return { - fileName: targetFileName, - textSpan: createTextSpanFromBounds(0, 0), - kind: "script" /* scriptElement */, - name, - containerName: void 0, - containerKind: void 0, - // TODO: GH#18217 - unverified - }; -} -function getAncestorCallLikeExpression(node) { - const target = findAncestor(node, (n) => !isRightSideOfPropertyAccess(n)); - const callLike = target == null ? void 0 : target.parent; - return callLike && isCallLikeExpression(callLike) && getInvokedExpression(callLike) === target ? callLike : void 0; -} -function tryGetSignatureDeclaration(typeChecker, node) { - const callLike = getAncestorCallLikeExpression(node); - const signature = callLike && typeChecker.getResolvedSignature(callLike); - return tryCast(signature && signature.declaration, (d) => isFunctionLike(d) && !isFunctionTypeNode(d)); -} -function isJsxConstructorLike(node) { - switch (node.kind) { - case 177 /* Constructor */: - case 186 /* ConstructorType */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - return true; - default: - return false; - } -} - -// src/services/_namespaces/ts.InlayHints.ts -var ts_InlayHints_exports = {}; -__export(ts_InlayHints_exports, { - provideInlayHints: () => provideInlayHints -}); - -// src/services/inlayHints.ts -var leadingParameterNameCommentRegexFactory = (name) => { - return new RegExp(`^\\s?/\\*\\*?\\s?${name}\\s?\\*\\/\\s?$`); -}; -function shouldShowParameterNameHints(preferences) { - return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all"; -} -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); - return result; - function visitor(node) { - if (!node || node.getFullWidth() === 0) { - return; - } - switch (node.kind) { - case 268 /* ModuleDeclaration */: - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 263 /* FunctionDeclaration */: - case 232 /* ClassExpression */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 220 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } - if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { - return; - } - if (isTypeNode(node) && !isExpressionWithTypeArguments(node)) { - return; - } - if (preferences.includeInlayVariableTypeHints && isVariableDeclaration(node)) { - visitVariableLikeDeclaration(node); - } else if (preferences.includeInlayPropertyDeclarationTypeHints && isPropertyDeclaration(node)) { - visitVariableLikeDeclaration(node); - } else if (preferences.includeInlayEnumMemberValueHints && isEnumMember(node)) { - visitEnumMember(node); - } else if (shouldShowParameterNameHints(preferences) && (isCallExpression(node) || isNewExpression(node))) { - visitCallOrNewExpression(node); - } else { - if (preferences.includeInlayFunctionParameterTypeHints && isFunctionLikeDeclaration(node) && hasContextSensitiveParameters(node)) { - visitFunctionLikeForParameterType(node); - } - if (preferences.includeInlayFunctionLikeReturnTypeHints && isSignatureSupportingReturnAnnotation(node)) { - visitFunctionDeclarationLikeForReturnType(node); - } - } - return forEachChild(node, visitor); - } - function isSignatureSupportingReturnAnnotation(node) { - return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node); - } - 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: hintText, - position, - kind: "Parameter" /* Parameter */, - whitespaceAfter: true, - displayParts - }); - } - function addTypeHints(hintText, position) { - result.push({ - text: typeof hintText === "string" ? `: ${hintText}` : "", - displayParts: typeof hintText === "string" ? void 0 : [{ text: ": " }, ...hintText], - position, - kind: "Type" /* Type */, - whitespaceBefore: true - }); - } - function addEnumMemberValueHints(text, position) { - result.push({ - text: `= ${text}`, - position, - kind: "Enum" /* Enum */, - whitespaceBefore: true - }); - } - function visitEnumMember(member) { - if (member.initializer) { - return; - } - const enumValue = checker.getConstantValue(member); - if (enumValue !== void 0) { - addEnumMemberValueHints(enumValue.toString(), member.end); - } - } - function isModuleReferenceType(type) { - return type.symbol && type.symbol.flags & 1536 /* Module */; - } - function visitVariableLikeDeclaration(decl) { - if (decl.initializer === void 0 && !(isPropertyDeclaration(decl) && !(checker.getTypeAtLocation(decl).flags & 1 /* Any */)) || isBindingPattern(decl.name) || isVariableDeclaration(decl) && !isHintableDeclaration(decl)) { - return; - } - const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(decl); - if (effectiveTypeAnnotation) { - return; - } - const declarationType = checker.getTypeAtLocation(decl); - if (isModuleReferenceType(declarationType)) { - return; - } - 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(hintParts, decl.name.end); - } - } - function visitCallOrNewExpression(expr) { - const args = expr.arguments; - if (!args || !args.length) { - return; - } - const signature = checker.getResolvedSignature(expr); - if (signature === void 0) return; - let signatureParamPos = 0; - for (const originalArg of args) { - const arg = skipParentheses(originalArg); - if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) { - signatureParamPos++; - continue; - } - 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; - } - const name = unescapeLeadingUnderscores(parameterName); - if (leadingCommentsContainsParameterName(arg, name)) { - continue; - } - addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument); - } - } - } - function identifierOrAccessExpressionPostfixMatchesParameterName(expr, parameterName) { - if (isIdentifier(expr)) { - return expr.text === parameterName; - } - if (isPropertyAccessExpression(expr)) { - return expr.name.text === parameterName; - } - return false; - } - function leadingCommentsContainsParameterName(node, name) { - if (!isIdentifierText(name, getEmitScriptTarget(compilerOptions), getLanguageVariant(file.scriptKind))) { - return false; - } - const ranges = getLeadingCommentRanges(sourceFileText, node.pos); - if (!(ranges == null ? void 0 : ranges.length)) { - return false; - } - const regex = leadingParameterNameCommentRegexFactory(name); - return some(ranges, (range) => regex.test(sourceFileText.substring(range.pos, range.end))); - } - function isHintableLiteral(node) { - switch (node.kind) { - case 225 /* PrefixUnaryExpression */: { - const operand = node.operand; - return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText); - } - case 112 /* TrueKeyword */: - case 97 /* FalseKeyword */: - case 106 /* NullKeyword */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 229 /* TemplateExpression */: - return true; - case 80 /* Identifier */: { - const name = node.escapedText; - return isUndefined(name) || isInfinityOrNaNString(name); - } - } - return isLiteralExpression(node); - } - function visitFunctionDeclarationLikeForReturnType(decl) { - if (isArrowFunction(decl)) { - if (!findChildOfKind(decl, 21 /* OpenParenToken */, file)) { - return; - } - } - const effectiveTypeAnnotation = getEffectiveReturnTypeNode(decl); - if (effectiveTypeAnnotation || !decl.body) { - return; - } - const signature = checker.getSignatureFromDeclaration(decl); - if (!signature) { - return; - } - const typePredicate = checker.getTypePredicateOfSignature(signature); - if (typePredicate == null ? void 0 : typePredicate.type) { - const hintParts2 = typePredicateToInlayHintParts(typePredicate); - if (hintParts2) { - addTypeHints(hintParts2, getTypeAnnotationPosition(decl)); - return; - } - } - const returnType = checker.getReturnTypeOfSignature(signature); - if (isModuleReferenceType(returnType)) { - return; - } - const hintParts = typeToInlayHintParts(returnType); - if (hintParts) { - addTypeHints(hintParts, getTypeAnnotationPosition(decl)); - } - } - function getTypeAnnotationPosition(decl) { - const closeParenToken = findChildOfKind(decl, 22 /* CloseParenToken */, file); - if (closeParenToken) { - return closeParenToken.end; - } - return decl.parameters.end; - } - function visitFunctionLikeForParameterType(node) { - const signature = checker.getSignatureFromDeclaration(node); - if (!signature) { - return; - } - let pos = 0; - for (const param of node.parameters) { - if (isHintableDeclaration(param)) { - addParameterTypeHint(param, parameterIsThisKeyword(param) ? signature.thisParameter : signature.parameters[pos]); - } - if (parameterIsThisKeyword(param)) { - continue; - } - pos++; - } - } - function addParameterTypeHint(node, symbol) { - const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(node); - if (effectiveTypeAnnotation || symbol === void 0) return; - const typeHints = getParameterDeclarationTypeHints(symbol); - if (typeHints === void 0) return; - addTypeHints(typeHints, node.questionToken ? node.questionToken.end : node.name.end); - } - function getParameterDeclarationTypeHints(symbol) { - const valueDeclaration = symbol.valueDeclaration; - if (!valueDeclaration || !isParameter(valueDeclaration)) { - return void 0; - } - const signatureParamType = checker.getTypeOfSymbolAtLocation(symbol, valueDeclaration); - if (isModuleReferenceType(signatureParamType)) { - return void 0; - } - return typeToInlayHintParts(signatureParamType); - } - function printTypeInSingleLine(type) { - const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; - const printer = createPrinterWithRemoveComments(); - return usingSingleLineStringWriter((writer) => { - const typeNode = checker.typeToTypeNode( - type, - /*enclosingDeclaration*/ - void 0, - flags - ); - Debug.assertIsDefined(typeNode, "should always get typenode"); - printer.writeNode( - 4 /* Unspecified */, - typeNode, - /*sourceFile*/ - file, - writer - ); - }); - } - function printTypePredicateInSingleLine(typePredicate) { - const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; - const printer = createPrinterWithRemoveComments(); - return usingSingleLineStringWriter((writer) => { - const typePredicateNode = checker.typePredicateToTypePredicateNode( - typePredicate, - /*enclosingDeclaration*/ - void 0, - flags - ); - Debug.assertIsDefined(typePredicateNode, "should always get typePredicateNode"); - printer.writeNode( - 4 /* Unspecified */, - typePredicateNode, - /*sourceFile*/ - file, - writer - ); - }); - } - 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"); - return getInlayHintDisplayParts(typeNode); - } - function typePredicateToInlayHintParts(typePredicate) { - if (!shouldUseInteractiveInlayHints(preferences)) { - return printTypePredicateInSingleLine(typePredicate); - } - const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; - const typeNode = checker.typePredicateToTypePredicateNode( - typePredicate, - /*enclosingDeclaration*/ - void 0, - flags - ); - Debug.assertIsDefined(typeNode, "should always get typenode"); - return getInlayHintDisplayParts(typeNode); - } - function getInlayHintDisplayParts(node) { - const parts = []; - visitForDisplayParts(node); - return parts; - function visitForDisplayParts(node2) { - var _a, _b; - if (!node2) { - return; - } - const tokenString = tokenToString(node2.kind); - if (tokenString) { - parts.push({ text: tokenString }); - return; - } - if (isLiteralExpression(node2)) { - parts.push({ text: getLiteralText2(node2) }); - return; - } - switch (node2.kind) { - case 80 /* Identifier */: - Debug.assertNode(node2, isIdentifier); - const identifierText = idText(node2); - const name = node2.symbol && node2.symbol.declarations && node2.symbol.declarations.length && getNameOfDeclaration(node2.symbol.declarations[0]); - if (name) { - parts.push(getNodeDisplayPart(identifierText, name)); - } else { - parts.push({ text: identifierText }); - } - break; - case 167 /* QualifiedName */: - Debug.assertNode(node2, isQualifiedName); - visitForDisplayParts(node2.left); - parts.push({ text: "." }); - visitForDisplayParts(node2.right); - break; - case 183 /* TypePredicate */: - Debug.assertNode(node2, isTypePredicateNode); - if (node2.assertsModifier) { - parts.push({ text: "asserts " }); - } - visitForDisplayParts(node2.parameterName); - if (node2.type) { - parts.push({ text: " is " }); - visitForDisplayParts(node2.type); - } - break; - case 184 /* TypeReference */: - Debug.assertNode(node2, isTypeReferenceNode); - visitForDisplayParts(node2.typeName); - if (node2.typeArguments) { - parts.push({ text: "<" }); - visitDisplayPartList(node2.typeArguments, ", "); - parts.push({ text: ">" }); - } - break; - case 169 /* TypeParameter */: - Debug.assertNode(node2, isTypeParameterDeclaration); - if (node2.modifiers) { - visitDisplayPartList(node2.modifiers, " "); - } - visitForDisplayParts(node2.name); - if (node2.constraint) { - parts.push({ text: " extends " }); - visitForDisplayParts(node2.constraint); - } - if (node2.default) { - parts.push({ text: " = " }); - visitForDisplayParts(node2.default); - } - break; - case 170 /* Parameter */: - Debug.assertNode(node2, isParameter); - if (node2.modifiers) { - visitDisplayPartList(node2.modifiers, " "); - } - if (node2.dotDotDotToken) { - parts.push({ text: "..." }); - } - visitForDisplayParts(node2.name); - if (node2.questionToken) { - parts.push({ text: "?" }); - } - if (node2.type) { - parts.push({ text: ": " }); - visitForDisplayParts(node2.type); - } - break; - case 186 /* ConstructorType */: - Debug.assertNode(node2, isConstructorTypeNode); - parts.push({ text: "new " }); - visitParametersAndTypeParameters(node2); - parts.push({ text: " => " }); - visitForDisplayParts(node2.type); - break; - case 187 /* TypeQuery */: - Debug.assertNode(node2, isTypeQueryNode); - parts.push({ text: "typeof " }); - visitForDisplayParts(node2.exprName); - if (node2.typeArguments) { - parts.push({ text: "<" }); - visitDisplayPartList(node2.typeArguments, ", "); - parts.push({ text: ">" }); - } - break; - case 188 /* TypeLiteral */: - Debug.assertNode(node2, isTypeLiteralNode); - parts.push({ text: "{" }); - if (node2.members.length) { - parts.push({ text: " " }); - visitDisplayPartList(node2.members, "; "); - parts.push({ text: " " }); - } - parts.push({ text: "}" }); - break; - case 189 /* ArrayType */: - Debug.assertNode(node2, isArrayTypeNode); - visitForDisplayParts(node2.elementType); - parts.push({ text: "[]" }); - break; - case 190 /* TupleType */: - Debug.assertNode(node2, isTupleTypeNode); - parts.push({ text: "[" }); - visitDisplayPartList(node2.elements, ", "); - parts.push({ text: "]" }); - break; - case 203 /* NamedTupleMember */: - Debug.assertNode(node2, isNamedTupleMember); - if (node2.dotDotDotToken) { - parts.push({ text: "..." }); - } - visitForDisplayParts(node2.name); - if (node2.questionToken) { - parts.push({ text: "?" }); - } - parts.push({ text: ": " }); - visitForDisplayParts(node2.type); - break; - case 191 /* OptionalType */: - Debug.assertNode(node2, isOptionalTypeNode); - visitForDisplayParts(node2.type); - parts.push({ text: "?" }); - break; - case 192 /* RestType */: - Debug.assertNode(node2, isRestTypeNode); - parts.push({ text: "..." }); - visitForDisplayParts(node2.type); - break; - case 193 /* UnionType */: - Debug.assertNode(node2, isUnionTypeNode); - visitDisplayPartList(node2.types, " | "); - break; - case 194 /* IntersectionType */: - Debug.assertNode(node2, isIntersectionTypeNode); - visitDisplayPartList(node2.types, " & "); - break; - case 195 /* ConditionalType */: - Debug.assertNode(node2, isConditionalTypeNode); - visitForDisplayParts(node2.checkType); - parts.push({ text: " extends " }); - visitForDisplayParts(node2.extendsType); - parts.push({ text: " ? " }); - visitForDisplayParts(node2.trueType); - parts.push({ text: " : " }); - visitForDisplayParts(node2.falseType); - break; - case 196 /* InferType */: - Debug.assertNode(node2, isInferTypeNode); - parts.push({ text: "infer " }); - visitForDisplayParts(node2.typeParameter); - break; - case 197 /* ParenthesizedType */: - Debug.assertNode(node2, isParenthesizedTypeNode); - parts.push({ text: "(" }); - visitForDisplayParts(node2.type); - parts.push({ text: ")" }); - break; - case 199 /* TypeOperator */: - Debug.assertNode(node2, isTypeOperatorNode); - parts.push({ text: `${tokenToString(node2.operator)} ` }); - visitForDisplayParts(node2.type); - break; - case 200 /* IndexedAccessType */: - Debug.assertNode(node2, isIndexedAccessTypeNode); - visitForDisplayParts(node2.objectType); - parts.push({ text: "[" }); - visitForDisplayParts(node2.indexType); - parts.push({ text: "]" }); - break; - case 201 /* MappedType */: - Debug.assertNode(node2, isMappedTypeNode); - parts.push({ text: "{ " }); - if (node2.readonlyToken) { - if (node2.readonlyToken.kind === 40 /* PlusToken */) { - parts.push({ text: "+" }); - } else if (node2.readonlyToken.kind === 41 /* MinusToken */) { - parts.push({ text: "-" }); - } - parts.push({ text: "readonly " }); - } - parts.push({ text: "[" }); - visitForDisplayParts(node2.typeParameter); - if (node2.nameType) { - parts.push({ text: " as " }); - visitForDisplayParts(node2.nameType); - } - parts.push({ text: "]" }); - if (node2.questionToken) { - if (node2.questionToken.kind === 40 /* PlusToken */) { - parts.push({ text: "+" }); - } else if (node2.questionToken.kind === 41 /* MinusToken */) { - parts.push({ text: "-" }); - } - parts.push({ text: "?" }); - } - parts.push({ text: ": " }); - if (node2.type) { - visitForDisplayParts(node2.type); - } - parts.push({ text: "; }" }); - break; - case 202 /* LiteralType */: - Debug.assertNode(node2, isLiteralTypeNode); - visitForDisplayParts(node2.literal); - break; - case 185 /* FunctionType */: - Debug.assertNode(node2, isFunctionTypeNode); - visitParametersAndTypeParameters(node2); - parts.push({ text: " => " }); - visitForDisplayParts(node2.type); - break; - case 206 /* ImportType */: - Debug.assertNode(node2, isImportTypeNode); - if (node2.isTypeOf) { - parts.push({ text: "typeof " }); - } - parts.push({ text: "import(" }); - visitForDisplayParts(node2.argument); - if (node2.assertions) { - parts.push({ text: ", { assert: " }); - visitDisplayPartList(node2.assertions.assertClause.elements, ", "); - parts.push({ text: " }" }); - } - parts.push({ text: ")" }); - if (node2.qualifier) { - parts.push({ text: "." }); - visitForDisplayParts(node2.qualifier); - } - if (node2.typeArguments) { - parts.push({ text: "<" }); - visitDisplayPartList(node2.typeArguments, ", "); - parts.push({ text: ">" }); - } - break; - case 172 /* PropertySignature */: - Debug.assertNode(node2, isPropertySignature); - if ((_a = node2.modifiers) == null ? void 0 : _a.length) { - visitDisplayPartList(node2.modifiers, " "); - parts.push({ text: " " }); - } - visitForDisplayParts(node2.name); - if (node2.questionToken) { - parts.push({ text: "?" }); - } - if (node2.type) { - parts.push({ text: ": " }); - visitForDisplayParts(node2.type); - } - break; - case 182 /* IndexSignature */: - Debug.assertNode(node2, isIndexSignatureDeclaration); - parts.push({ text: "[" }); - visitDisplayPartList(node2.parameters, ", "); - parts.push({ text: "]" }); - if (node2.type) { - parts.push({ text: ": " }); - visitForDisplayParts(node2.type); - } - break; - case 174 /* MethodSignature */: - Debug.assertNode(node2, isMethodSignature); - if ((_b = node2.modifiers) == null ? void 0 : _b.length) { - visitDisplayPartList(node2.modifiers, " "); - parts.push({ text: " " }); - } - visitForDisplayParts(node2.name); - if (node2.questionToken) { - parts.push({ text: "?" }); - } - visitParametersAndTypeParameters(node2); - if (node2.type) { - parts.push({ text: ": " }); - visitForDisplayParts(node2.type); - } - break; - case 180 /* CallSignature */: - Debug.assertNode(node2, isCallSignatureDeclaration); - visitParametersAndTypeParameters(node2); - if (node2.type) { - parts.push({ text: ": " }); - visitForDisplayParts(node2.type); - } - break; - case 181 /* ConstructSignature */: - Debug.assertNode(node2, isConstructSignatureDeclaration); - parts.push({ text: "new " }); - visitParametersAndTypeParameters(node2); - if (node2.type) { - parts.push({ text: ": " }); - visitForDisplayParts(node2.type); - } - break; - case 208 /* ArrayBindingPattern */: - Debug.assertNode(node2, isArrayBindingPattern); - parts.push({ text: "[" }); - visitDisplayPartList(node2.elements, ", "); - parts.push({ text: "]" }); - break; - case 207 /* ObjectBindingPattern */: - Debug.assertNode(node2, isObjectBindingPattern); - parts.push({ text: "{" }); - if (node2.elements.length) { - parts.push({ text: " " }); - visitDisplayPartList(node2.elements, ", "); - parts.push({ text: " " }); - } - parts.push({ text: "}" }); - break; - case 209 /* BindingElement */: - Debug.assertNode(node2, isBindingElement); - visitForDisplayParts(node2.name); - break; - case 225 /* PrefixUnaryExpression */: - Debug.assertNode(node2, isPrefixUnaryExpression); - parts.push({ text: tokenToString(node2.operator) }); - visitForDisplayParts(node2.operand); - break; - case 204 /* TemplateLiteralType */: - Debug.assertNode(node2, isTemplateLiteralTypeNode); - visitForDisplayParts(node2.head); - node2.templateSpans.forEach(visitForDisplayParts); - break; - case 16 /* TemplateHead */: - Debug.assertNode(node2, isTemplateHead); - parts.push({ text: getLiteralText2(node2) }); - break; - case 205 /* TemplateLiteralTypeSpan */: - Debug.assertNode(node2, isTemplateLiteralTypeSpan); - visitForDisplayParts(node2.type); - visitForDisplayParts(node2.literal); - break; - case 17 /* TemplateMiddle */: - Debug.assertNode(node2, isTemplateMiddle); - parts.push({ text: getLiteralText2(node2) }); - break; - case 18 /* TemplateTail */: - Debug.assertNode(node2, isTemplateTail); - parts.push({ text: getLiteralText2(node2) }); - break; - case 198 /* ThisType */: - Debug.assertNode(node2, isThisTypeNode); - parts.push({ text: "this" }); - break; - case 168 /* ComputedPropertyName */: - Debug.assertNode(node2, isComputedPropertyName); - parts.push({ text: "[" }); - visitForDisplayParts(node2.expression); - parts.push({ text: "]" }); - break; - default: - Debug.failBadSyntaxKind(node2); - } - } - 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((node2, index) => { - if (index > 0) { - parts.push({ text: separator }); - } - visitForDisplayParts(node2); - }); - } - function getLiteralText2(node2) { - switch (node2.kind) { - case 11 /* StringLiteral */: - return quotePreference === 0 /* Single */ ? `'${escapeString(node2.text, 39 /* singleQuote */)}'` : `"${escapeString(node2.text, 34 /* doubleQuote */)}"`; - case 16 /* TemplateHead */: - case 17 /* TemplateMiddle */: - case 18 /* TemplateTail */: { - const rawText = node2.rawText ?? escapeTemplateSubstitution(escapeString(node2.text, 96 /* backtick */)); - switch (node2.kind) { - case 16 /* TemplateHead */: - return "`" + rawText + "${"; - case 17 /* TemplateMiddle */: - return "}" + rawText + "${"; - case 18 /* TemplateTail */: - return "}" + rawText + "`"; - } - } - } - return node2.text; - } - } - function isUndefined(name) { - return name === "undefined"; - } - function isHintableDeclaration(node) { - if ((isPartOfParameterDeclaration(node) || isVariableDeclaration(node) && isVarConst(node)) && node.initializer) { - const initializer = skipParentheses(node.initializer); - return !(isHintableLiteral(initializer) || isNewExpression(initializer) || isObjectLiteralExpression(initializer) || isAssertionExpression(initializer)); - } - return true; - } - function getNodeDisplayPart(text, node) { - const sourceFile = node.getSourceFile(); - return { - text, - span: createTextSpanFromNode(node, sourceFile), - file: sourceFile.fileName - }; - } -} - -// src/services/_namespaces/ts.JsDoc.ts -var ts_JsDoc_exports = {}; -__export(ts_JsDoc_exports, { - getDocCommentTemplateAtPosition: () => getDocCommentTemplateAtPosition, - getJSDocParameterNameCompletionDetails: () => getJSDocParameterNameCompletionDetails, - getJSDocParameterNameCompletions: () => getJSDocParameterNameCompletions, - getJSDocTagCompletionDetails: () => getJSDocTagCompletionDetails, - getJSDocTagCompletions: () => getJSDocTagCompletions, - getJSDocTagNameCompletionDetails: () => getJSDocTagNameCompletionDetails, - getJSDocTagNameCompletions: () => getJSDocTagNameCompletions, - getJsDocCommentsFromDeclarations: () => getJsDocCommentsFromDeclarations, - getJsDocTagsFromDeclarations: () => getJsDocTagsFromDeclarations -}); - -// src/services/jsDoc.ts -var jsDocTagNames = [ - "abstract", - "access", - "alias", - "argument", - "async", - "augments", - "author", - "borrows", - "callback", - "class", - "classdesc", - "constant", - "constructor", - "constructs", - "copyright", - "default", - "deprecated", - "description", - "emits", - "enum", - "event", - "example", - "exports", - "extends", - "external", - "field", - "file", - "fileoverview", - "fires", - "function", - "generator", - "global", - "hideconstructor", - "host", - "ignore", - "implements", - "import", - "inheritdoc", - "inner", - "instance", - "interface", - "kind", - "lends", - "license", - "link", - "linkcode", - "linkplain", - "listens", - "member", - "memberof", - "method", - "mixes", - "module", - "name", - "namespace", - "overload", - "override", - "package", - "param", - "private", - "prop", - "property", - "protected", - "public", - "readonly", - "requires", - "returns", - "satisfies", - "see", - "since", - "static", - "summary", - "template", - "this", - "throws", - "todo", - "tutorial", - "type", - "typedef", - "var", - "variation", - "version", - "virtual", - "yields" -]; -var jsDocTagNameCompletionEntries; -var jsDocTagCompletionEntries; -function getJsDocCommentsFromDeclarations(declarations, checker) { - const parts = []; - forEachUnique(declarations, (declaration) => { - for (const jsdoc of getCommentHavingNodes(declaration)) { - const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 328 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); - if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 347 /* JSDocTypedefTag */ && declaration.kind !== 339 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 347 /* JSDocTypedefTag */ || t.kind === 339 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 342 /* JSDocParameterTag */ || t.kind === 343 /* JSDocReturnTag */)) { - continue; - } - let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : []; - if (inheritDoc && inheritDoc.comment) { - newparts = newparts.concat(getDisplayPartsFromComment(inheritDoc.comment, checker)); - } - if (!contains(parts, newparts, isIdenticalListOfDisplayParts)) { - parts.push(newparts); - } - } - }); - return flatten(intersperse(parts, [lineBreakPart()])); -} -function isIdenticalListOfDisplayParts(parts1, parts2) { - return arrayIsEqualTo(parts1, parts2, (p1, p2) => p1.kind === p2.kind && p1.text === p2.text); -} -function getCommentHavingNodes(declaration) { - switch (declaration.kind) { - case 342 /* JSDocParameterTag */: - case 349 /* JSDocPropertyTag */: - return [declaration]; - case 339 /* JSDocCallbackTag */: - case 347 /* JSDocTypedefTag */: - return [declaration, declaration.parent]; - case 324 /* JSDocSignature */: - if (isJSDocOverloadTag(declaration.parent)) { - return [declaration.parent.parent]; - } - // falls through - default: - return getJSDocCommentsAndTags(declaration); - } -} -function getJsDocTagsFromDeclarations(declarations, checker) { - const infos = []; - forEachUnique(declarations, (declaration) => { - const tags = getJSDocTags(declaration); - if (tags.some((t) => t.kind === 347 /* JSDocTypedefTag */ || t.kind === 339 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 342 /* JSDocParameterTag */ || t.kind === 343 /* 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 === 322 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker) - ); -} -function getCommentDisplayParts(tag, checker) { - const { comment, kind } = tag; - const namePart = getTagNameDisplayPart(kind); - switch (kind) { - case 350 /* JSDocThrowsTag */: - const typeExpression = tag.typeExpression; - return typeExpression ? withNode(typeExpression) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); - case 330 /* JSDocImplementsTag */: - return withNode(tag.class); - case 329 /* JSDocAugmentsTag */: - return withNode(tag.class); - case 346 /* JSDocTemplateTag */: - const templateTag = tag; - const displayParts = []; - if (templateTag.constraint) { - displayParts.push(textPart(templateTag.constraint.getText())); - } - if (length(templateTag.typeParameters)) { - if (length(displayParts)) { - displayParts.push(spacePart()); - } - const lastTypeParameter = templateTag.typeParameters[templateTag.typeParameters.length - 1]; - forEach(templateTag.typeParameters, (tp) => { - displayParts.push(namePart(tp.getText())); - if (lastTypeParameter !== tp) { - displayParts.push(...[punctuationPart(28 /* CommaToken */), spacePart()]); - } - }); - } - if (comment) { - displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]); - } - return displayParts; - case 345 /* JSDocTypeTag */: - case 351 /* JSDocSatisfiesTag */: - return withNode(tag.typeExpression); - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - case 349 /* JSDocPropertyTag */: - case 342 /* JSDocParameterTag */: - case 348 /* JSDocSeeTag */: - const { name } = tag; - return name ? withNode(name) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); - default: - return comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); - } - function withNode(node) { - return addComment(node.getText()); - } - function addComment(s) { - if (comment) { - if (s.match(/^https?$/)) { - return [textPart(s), ...getDisplayPartsFromComment(comment, checker)]; - } else { - return [namePart(s), spacePart(), ...getDisplayPartsFromComment(comment, checker)]; - } - } else { - return [textPart(s)]; - } - } -} -function getTagNameDisplayPart(kind) { - switch (kind) { - case 342 /* JSDocParameterTag */: - return parameterNamePart; - case 349 /* JSDocPropertyTag */: - return propertyNamePart; - case 346 /* JSDocTemplateTag */: - return typeParameterNamePart; - case 347 /* JSDocTypedefTag */: - case 339 /* JSDocCallbackTag */: - return typeAliasNamePart; - default: - return textPart; - } -} -function getJSDocTagNameCompletions() { - return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = map(jsDocTagNames, (tagName) => { - return { - name: tagName, - kind: "keyword" /* keyword */, - kindModifiers: "", - sortText: ts_Completions_exports.SortText.LocationPriority - }; - })); -} -var getJSDocTagNameCompletionDetails = getJSDocTagCompletionDetails; -function getJSDocTagCompletions() { - return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = map(jsDocTagNames, (tagName) => { - return { - name: `@${tagName}`, - kind: "keyword" /* keyword */, - kindModifiers: "", - sortText: ts_Completions_exports.SortText.LocationPriority - }; - })); -} -function getJSDocTagCompletionDetails(name) { - return { - name, - kind: "" /* unknown */, - // TODO: should have its own kind? - kindModifiers: "", - displayParts: [textPart(name)], - documentation: emptyArray, - tags: void 0, - codeActions: void 0 - }; -} -function getJSDocParameterNameCompletions(tag) { - if (!isIdentifier(tag.name)) { - return emptyArray; - } - const nameThusFar = tag.name.text; - const jsdoc = tag.parent; - const fn = jsdoc.parent; - if (!isFunctionLike(fn)) return []; - return mapDefined(fn.parameters, (param) => { - if (!isIdentifier(param.name)) return void 0; - const name = param.name.text; - if (jsdoc.tags.some((t) => t !== tag && isJSDocParameterTag(t) && isIdentifier(t.name) && t.name.escapedText === name) || nameThusFar !== void 0 && !startsWith(name, nameThusFar)) { - return void 0; - } - return { name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: ts_Completions_exports.SortText.LocationPriority }; - }); -} -function getJSDocParameterNameCompletionDetails(name) { - return { - name, - kind: "parameter" /* parameterElement */, - kindModifiers: "", - displayParts: [textPart(name)], - documentation: emptyArray, - tags: void 0, - codeActions: void 0 - }; -} -function getDocCommentTemplateAtPosition(newLine, sourceFile, position, options) { - const tokenAtPos = getTokenAtPosition(sourceFile, position); - const existingDocComment = findAncestor(tokenAtPos, isJSDoc); - if (existingDocComment && (existingDocComment.comment !== void 0 || length(existingDocComment.tags))) { - return void 0; - } - const tokenStart = tokenAtPos.getStart(sourceFile); - if (!existingDocComment && tokenStart < position) { - return void 0; - } - const commentOwnerInfo = getCommentOwnerInfo(tokenAtPos, options); - if (!commentOwnerInfo) { - return void 0; - } - const { commentOwner, parameters, hasReturn: hasReturn2 } = commentOwnerInfo; - const commentOwnerJsDoc = hasJSDocNodes(commentOwner) && commentOwner.jsDoc ? commentOwner.jsDoc : void 0; - const lastJsDoc = lastOrUndefined(commentOwnerJsDoc); - if (commentOwner.getStart(sourceFile) < position || lastJsDoc && existingDocComment && lastJsDoc !== existingDocComment) { - return void 0; - } - const indentationStr = getIndentationStringAtPosition(sourceFile, position); - const isJavaScriptFile = hasJSFileExtension(sourceFile.fileName); - const tags = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : ""); - const openComment = "/**"; - const closeComment = " */"; - const hasTag = length(getJSDocTags(commentOwner)) > 0; - if (tags && !hasTag) { - const preamble = openComment + newLine + indentationStr + " * "; - const endLine = tokenStart === position ? newLine + indentationStr : ""; - const result = preamble + newLine + tags + indentationStr + closeComment + endLine; - return { newText: result, caretOffset: preamble.length }; - } - return { newText: openComment + closeComment, caretOffset: 3 }; -} -function getIndentationStringAtPosition(sourceFile, position) { - const { text } = sourceFile; - const lineStart = getLineStartPositionForPosition(position, sourceFile); - let pos = lineStart; - for (; pos <= position && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) ; - return text.slice(lineStart, pos); -} -function parameterDocComments(parameters, isJavaScriptFile, indentationStr, newLine) { - return parameters.map(({ name, dotDotDotToken }, i) => { - const paramName = name.kind === 80 /* Identifier */ ? name.text : "param" + i; - const type = isJavaScriptFile ? dotDotDotToken ? "{...any} " : "{any} " : ""; - return `${indentationStr} * @param ${type}${paramName}${newLine}`; - }).join(""); -} -function returnsDocComment(indentationStr, newLine) { - return `${indentationStr} * @returns${newLine}`; -} -function getCommentOwnerInfo(tokenAtPos, options) { - return forEachAncestor(tokenAtPos, (n) => getCommentOwnerInfoWorker(n, options)); -} -function getCommentOwnerInfoWorker(commentOwner, options) { - switch (commentOwner.kind) { - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - case 174 /* MethodSignature */: - case 220 /* ArrowFunction */: - const host = commentOwner; - return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) }; - case 304 /* PropertyAssignment */: - return getCommentOwnerInfoWorker(commentOwner.initializer, options); - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 307 /* EnumMember */: - case 266 /* TypeAliasDeclaration */: - return { commentOwner }; - case 172 /* PropertySignature */: { - const host2 = commentOwner; - return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner }; - } - case 244 /* 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 308 /* SourceFile */: - return "quit"; - case 268 /* ModuleDeclaration */: - return commentOwner.parent.kind === 268 /* ModuleDeclaration */ ? void 0 : { commentOwner }; - case 245 /* ExpressionStatement */: - return getCommentOwnerInfoWorker(commentOwner.expression, options); - case 227 /* 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 173 /* PropertyDeclaration */: - const init = commentOwner.initializer; - if (init && (isFunctionExpression(init) || isArrowFunction(init))) { - return { commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) }; - } - } -} -function hasReturn(node, options) { - 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 === 218 /* ParenthesizedExpression */) { - rightHandSide = rightHandSide.expression; - } - switch (rightHandSide.kind) { - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - return rightHandSide; - case 232 /* ClassExpression */: - return find(rightHandSide.members, isConstructorDeclaration); - } -} - -// src/services/_namespaces/ts.MapCode.ts -var ts_MapCode_exports = {}; -__export(ts_MapCode_exports, { - mapCode: () => mapCode -}); - -// src/services/mapCode.ts -function mapCode(sourceFile, contents, focusLocations, host, formatContext, preferences) { - return ts_textChanges_exports.ChangeTracker.with( - { host, formatContext, preferences }, - (changeTracker) => { - const parsed = contents.map((c) => parse(sourceFile, c)); - const flattenedLocations = focusLocations && flatten(focusLocations); - for (const nodes of parsed) { - placeNodeGroup( - sourceFile, - changeTracker, - nodes, - flattenedLocations - ); - } - } - ); -} -function parse(sourceFile, content) { - const nodeKinds = [ - { - parse: () => createSourceFile( - "__mapcode_content_nodes.ts", - content, - sourceFile.languageVersion, - /*setParentNodes*/ - true, - sourceFile.scriptKind - ), - body: (sf) => sf.statements - }, - { - parse: () => createSourceFile( - "__mapcode_class_content_nodes.ts", - `class __class { -${content} -}`, - sourceFile.languageVersion, - /*setParentNodes*/ - true, - sourceFile.scriptKind - ), - body: (cw) => cw.statements[0].members - } - ]; - const parsedNodes = []; - for (const { parse: parse2, body: body2 } of nodeKinds) { - const sourceFile2 = parse2(); - const bod = body2(sourceFile2); - if (bod.length && sourceFile2.parseDiagnostics.length === 0) { - return bod; - } else if (bod.length) { - parsedNodes.push({ sourceFile: sourceFile2, body: bod }); - } - } - parsedNodes.sort( - (a, b) => a.sourceFile.parseDiagnostics.length - b.sourceFile.parseDiagnostics.length - ); - const { body } = parsedNodes[0]; - return body; -} -function placeNodeGroup(originalFile, changeTracker, changes, focusLocations) { - if (isClassElement(changes[0]) || isTypeElement(changes[0])) { - placeClassNodeGroup( - originalFile, - changeTracker, - changes, - focusLocations - ); - } else { - placeStatements( - originalFile, - changeTracker, - changes, - focusLocations - ); - } -} -function placeClassNodeGroup(originalFile, changeTracker, changes, focusLocations) { - let classOrInterface; - if (!focusLocations || !focusLocations.length) { - classOrInterface = find(originalFile.statements, or(isClassLike, isInterfaceDeclaration)); - } else { - classOrInterface = forEach(focusLocations, (location) => findAncestor( - getTokenAtPosition(originalFile, location.start), - or(isClassLike, isInterfaceDeclaration) - )); - } - if (!classOrInterface) { - return; - } - const firstMatch = classOrInterface.members.find((member) => changes.some((change) => matchNode(change, member))); - if (firstMatch) { - const lastMatch = findLast( - classOrInterface.members, - (member) => changes.some((change) => matchNode(change, member)) - ); - forEach(changes, wipeNode); - changeTracker.replaceNodeRangeWithNodes( - originalFile, - firstMatch, - lastMatch, - changes - ); - return; - } - forEach(changes, wipeNode); - changeTracker.insertNodesAfter( - originalFile, - classOrInterface.members[classOrInterface.members.length - 1], - changes - ); -} -function placeStatements(originalFile, changeTracker, changes, focusLocations) { - if (!(focusLocations == null ? void 0 : focusLocations.length)) { - changeTracker.insertNodesAtEndOfFile( - originalFile, - changes, - /*blankLineBetween*/ - false - ); - return; - } - for (const location of focusLocations) { - const scope = findAncestor( - getTokenAtPosition(originalFile, location.start), - (block) => or(isBlock, isSourceFile)(block) && some(block.statements, (origStmt) => changes.some((newStmt) => matchNode(newStmt, origStmt))) - ); - if (scope) { - const start = scope.statements.find((stmt) => changes.some((node) => matchNode(node, stmt))); - if (start) { - const end = findLast(scope.statements, (stmt) => changes.some((node) => matchNode(node, stmt))); - forEach(changes, wipeNode); - changeTracker.replaceNodeRangeWithNodes( - originalFile, - start, - end, - changes - ); - return; - } - } - } - let scopeStatements = originalFile.statements; - for (const location of focusLocations) { - const block = findAncestor( - getTokenAtPosition(originalFile, location.start), - isBlock - ); - if (block) { - scopeStatements = block.statements; - break; - } - } - forEach(changes, wipeNode); - changeTracker.insertNodesAfter( - originalFile, - scopeStatements[scopeStatements.length - 1], - changes - ); -} -function matchNode(a, b) { - var _a, _b, _c, _d, _e, _f; - if (a.kind !== b.kind) { - return false; - } - if (a.kind === 177 /* Constructor */) { - return a.kind === b.kind; - } - if (isNamedDeclaration(a) && isNamedDeclaration(b)) { - return a.name.getText() === b.name.getText(); - } - if (isIfStatement(a) && isIfStatement(b)) { - return a.expression.getText() === b.expression.getText(); - } - if (isWhileStatement(a) && isWhileStatement(b)) { - return a.expression.getText() === b.expression.getText(); - } - if (isForStatement(a) && isForStatement(b)) { - return ((_a = a.initializer) == null ? void 0 : _a.getText()) === ((_b = b.initializer) == null ? void 0 : _b.getText()) && ((_c = a.incrementor) == null ? void 0 : _c.getText()) === ((_d = b.incrementor) == null ? void 0 : _d.getText()) && ((_e = a.condition) == null ? void 0 : _e.getText()) === ((_f = b.condition) == null ? void 0 : _f.getText()); - } - if (isForInOrOfStatement(a) && isForInOrOfStatement(b)) { - return a.expression.getText() === b.expression.getText() && a.initializer.getText() === b.initializer.getText(); - } - if (isLabeledStatement(a) && isLabeledStatement(b)) { - return a.label.getText() === b.label.getText(); - } - if (a.getText() === b.getText()) { - return true; - } - return false; -} -function wipeNode(node) { - resetNodePositions(node); - node.parent = void 0; -} -function resetNodePositions(node) { - node.pos = -1; - node.end = -1; - node.forEachChild(resetNodePositions); -} - -// src/services/_namespaces/ts.OrganizeImports.ts -var ts_OrganizeImports_exports = {}; -__export(ts_OrganizeImports_exports, { - compareImportsOrRequireStatements: () => compareImportsOrRequireStatements, - compareModuleSpecifiers: () => compareModuleSpecifiers2, - getImportDeclarationInsertionIndex: () => getImportDeclarationInsertionIndex, - getImportSpecifierInsertionIndex: () => getImportSpecifierInsertionIndex, - getNamedImportSpecifierComparerWithDetection: () => getNamedImportSpecifierComparerWithDetection, - getOrganizeImportsStringComparerWithDetection: () => getOrganizeImportsStringComparerWithDetection, - organizeImports: () => organizeImports, - testCoalesceExports: () => testCoalesceExports, - testCoalesceImports: () => testCoalesceImports -}); - -// src/services/organizeImports.ts -function organizeImports(sourceFile, formatContext, host, program, preferences, mode) { - const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext({ host, formatContext, preferences }); - const shouldSort = mode === "SortAndCombine" /* SortAndCombine */ || mode === "All" /* All */; - const shouldCombine = shouldSort; - const shouldRemove = mode === "RemoveUnused" /* RemoveUnused */ || mode === "All" /* All */; - const topLevelImportDecls = sourceFile.statements.filter(isImportDeclaration); - const topLevelImportGroupDecls = groupByNewlineContiguous(sourceFile, topLevelImportDecls); - const { comparersToTest, typeOrdersToTest } = getDetectionLists(preferences); - const defaultComparer = comparersToTest[0]; - const comparer = { - moduleSpecifierComparer: typeof preferences.organizeImportsIgnoreCase === "boolean" ? defaultComparer : void 0, - namedImportComparer: typeof preferences.organizeImportsIgnoreCase === "boolean" ? defaultComparer : void 0, - typeOrder: preferences.organizeImportsTypeOrder - }; - if (typeof preferences.organizeImportsIgnoreCase !== "boolean") { - ({ comparer: comparer.moduleSpecifierComparer } = detectModuleSpecifierCaseBySort(topLevelImportGroupDecls, comparersToTest)); - } - if (!comparer.typeOrder || typeof preferences.organizeImportsIgnoreCase !== "boolean") { - const namedImportSort = detectNamedImportOrganizationBySort(topLevelImportDecls, comparersToTest, typeOrdersToTest); - if (namedImportSort) { - const { namedImportComparer, typeOrder } = namedImportSort; - comparer.namedImportComparer = comparer.namedImportComparer ?? namedImportComparer; - comparer.typeOrder = comparer.typeOrder ?? typeOrder; - } - } - topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, comparer)); - if (mode !== "RemoveUnused" /* RemoveUnused */) { - getTopLevelExportGroups(sourceFile).forEach((exportGroupDecl) => organizeExportsWorker(exportGroupDecl, comparer.namedImportComparer)); - } - for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) { - if (!ambientModule.body) continue; - const ambientModuleImportGroupDecls = groupByNewlineContiguous(sourceFile, ambientModule.body.statements.filter(isImportDeclaration)); - ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, comparer)); - if (mode !== "RemoveUnused" /* RemoveUnused */) { - const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration); - organizeExportsWorker(ambientModuleExportDecls, comparer.namedImportComparer); - } - } - return changeTracker.getChanges(); - function organizeDeclsWorker(oldImportDecls, coalesce) { - if (length(oldImportDecls) === 0) { - return; - } - setEmitFlags(oldImportDecls[0], 1024 /* NoLeadingComments */); - const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls]; - const sortedImportGroups = shouldSort ? toSorted(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer.moduleSpecifierComparer ?? defaultComparer)) : oldImportGroups; - const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup); - if (newImportDecls.length === 0) { - changeTracker.deleteNodes( - sourceFile, - oldImportDecls, - { - leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include - }, - /*hasTrailingComment*/ - true - ); - } else { - const replaceOptions = { - leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, - // Leave header comment in place - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include, - suffix: getNewLineOrDefaultFromHost(host, formatContext.options) - }; - changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, replaceOptions); - const hasTrailingComment = changeTracker.nodeHasTrailingComment(sourceFile, oldImportDecls[0], replaceOptions); - changeTracker.deleteNodes(sourceFile, oldImportDecls.slice(1), { - trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include - }, hasTrailingComment); - } - } - function organizeImportsWorker(oldImportDecls, comparer2) { - const detectedModuleCaseComparer = comparer2.moduleSpecifierComparer ?? defaultComparer; - const detectedNamedImportCaseComparer = comparer2.namedImportComparer ?? defaultComparer; - const detectedTypeOrder = comparer2.typeOrder ?? "last"; - const specifierComparer = getNamedImportSpecifierComparer({ organizeImportsTypeOrder: detectedTypeOrder }, detectedNamedImportCaseComparer); - const processImportsOfSameModuleSpecifier = (importGroup) => { - if (shouldRemove) importGroup = removeUnusedImports(importGroup, sourceFile, program); - if (shouldCombine) importGroup = coalesceImportsWorker(importGroup, detectedModuleCaseComparer, specifierComparer, sourceFile); - if (shouldSort) importGroup = toSorted(importGroup, (s1, s2) => compareImportsOrRequireStatements(s1, s2, detectedModuleCaseComparer)); - return importGroup; - }; - organizeDeclsWorker(oldImportDecls, processImportsOfSameModuleSpecifier); - } - function organizeExportsWorker(oldExportDecls, specifierCaseComparer) { - const useComparer = getNamedImportSpecifierComparer(preferences, specifierCaseComparer); - organizeDeclsWorker(oldExportDecls, (group2) => coalesceExportsWorker(group2, useComparer)); - } -} -function getDetectionLists(preferences) { - return { - comparersToTest: typeof preferences.organizeImportsIgnoreCase === "boolean" ? [getOrganizeImportsStringComparer(preferences, preferences.organizeImportsIgnoreCase)] : [getOrganizeImportsStringComparer( - preferences, - /*ignoreCase*/ - true - ), getOrganizeImportsStringComparer( - preferences, - /*ignoreCase*/ - false - )], - typeOrdersToTest: preferences.organizeImportsTypeOrder ? [preferences.organizeImportsTypeOrder] : ["last", "inline", "first"] - }; -} -function groupByNewlineContiguous(sourceFile, decls) { - const scanner2 = createScanner( - sourceFile.languageVersion, - /*skipTrivia*/ - false, - sourceFile.languageVariant - ); - const group2 = []; - let groupIndex = 0; - for (const decl of decls) { - if (group2[groupIndex] && isNewGroup(sourceFile, decl, scanner2)) { - groupIndex++; - } - if (!group2[groupIndex]) { - group2[groupIndex] = []; - } - group2[groupIndex].push(decl); - } - return group2; -} -function isNewGroup(sourceFile, decl, scanner2) { - const startPos = decl.getFullStart(); - const endPos = decl.getStart(); - scanner2.setText(sourceFile.text, startPos, endPos - startPos); - let numberOfNewLines = 0; - while (scanner2.getTokenStart() < endPos) { - const tokenKind = scanner2.scan(); - if (tokenKind === 4 /* NewLineTrivia */) { - numberOfNewLines++; - if (numberOfNewLines >= 2) { - return true; - } - } - } - return false; -} -function getTopLevelExportGroups(sourceFile) { - const topLevelExportGroups = []; - const statements = sourceFile.statements; - const len = length(statements); - let i = 0; - let groupIndex = 0; - while (i < len) { - if (isExportDeclaration(statements[i])) { - if (topLevelExportGroups[groupIndex] === void 0) { - topLevelExportGroups[groupIndex] = []; - } - const exportDecl = statements[i]; - if (exportDecl.moduleSpecifier) { - topLevelExportGroups[groupIndex].push(exportDecl); - i++; - } else { - while (i < len && isExportDeclaration(statements[i])) { - topLevelExportGroups[groupIndex].push(statements[i++]); - } - groupIndex++; - } - } else { - i++; - } - } - return flatMap(topLevelExportGroups, (exportGroupDecls) => groupByNewlineContiguous(sourceFile, exportGroupDecls)); -} -function removeUnusedImports(oldImports, sourceFile, program) { - const typeChecker = program.getTypeChecker(); - const compilerOptions = program.getCompilerOptions(); - const jsxNamespace = typeChecker.getJsxNamespace(sourceFile); - const jsxFragmentFactory = typeChecker.getJsxFragmentFactory(sourceFile); - const jsxElementsPresent = !!(sourceFile.transformFlags & 2 /* ContainsJsx */); - const usedImports = []; - for (const importDecl of oldImports) { - const { importClause, moduleSpecifier } = importDecl; - if (!importClause) { - usedImports.push(importDecl); - continue; - } - let { name, namedBindings } = importClause; - if (name && !isDeclarationUsed(name)) { - name = void 0; - } - if (namedBindings) { - if (isNamespaceImport(namedBindings)) { - if (!isDeclarationUsed(namedBindings.name)) { - namedBindings = void 0; - } - } else { - const newElements = namedBindings.elements.filter((e) => isDeclarationUsed(e.name)); - if (newElements.length < namedBindings.elements.length) { - namedBindings = newElements.length ? factory.updateNamedImports(namedBindings, newElements) : void 0; - } - } - } - if (name || namedBindings) { - usedImports.push(updateImportDeclarationAndClause(importDecl, name, namedBindings)); - } else if (hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier)) { - if (sourceFile.isDeclarationFile) { - usedImports.push(factory.createImportDeclaration( - importDecl.modifiers, - /*importClause*/ - void 0, - moduleSpecifier, - /*attributes*/ - void 0 - )); - } else { - usedImports.push(importDecl); - } - } - } - return usedImports; - function isDeclarationUsed(identifier) { - return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) && jsxModeNeedsExplicitImport(compilerOptions.jsx) || ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile); - } -} -function getExternalModuleName2(specifier) { - return specifier !== void 0 && isStringLiteralLike(specifier) ? specifier.text : void 0; -} -function getCategorizedImports(importGroup) { - let importWithoutClause; - const typeOnlyImports = { defaultImports: [], namespaceImports: [], namedImports: [] }; - const regularImports = { defaultImports: [], namespaceImports: [], namedImports: [] }; - for (const importDeclaration of importGroup) { - if (importDeclaration.importClause === void 0) { - importWithoutClause = importWithoutClause || importDeclaration; - continue; - } - const group2 = importDeclaration.importClause.isTypeOnly ? typeOnlyImports : regularImports; - const { name, namedBindings } = importDeclaration.importClause; - if (name) { - group2.defaultImports.push(importDeclaration); - } - if (namedBindings) { - if (isNamespaceImport(namedBindings)) { - group2.namespaceImports.push(importDeclaration); - } else { - group2.namedImports.push(importDeclaration); - } - } - } - return { - importWithoutClause, - typeOnlyImports, - regularImports - }; -} -function coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceFile) { - if (importGroup.length === 0) { - return importGroup; - } - const importGroupsByAttributes = groupBy(importGroup, (decl) => { - if (decl.attributes) { - let attrs = decl.attributes.token + " "; - for (const x of toSorted(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; - } - 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 = toSorted(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; - } - 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( - toSorted(newImportSpecifiers, specifierComparer), - 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; -} -function coalesceExportsWorker(exportGroup, specifierComparer) { - if (exportGroup.length === 0) { - return exportGroup; - } - const { exportWithoutClause, namedExports, typeOnlyExports } = getCategorizedExports(exportGroup); - const coalescedExports = []; - if (exportWithoutClause) { - coalescedExports.push(exportWithoutClause); - } - for (const exportGroup2 of [namedExports, typeOnlyExports]) { - if (exportGroup2.length === 0) { - continue; - } - const newExportSpecifiers = []; - newExportSpecifiers.push(...flatMap(exportGroup2, (i) => i.exportClause && isNamedExports(i.exportClause) ? i.exportClause.elements : emptyArray)); - const sortedExportSpecifiers = toSorted(newExportSpecifiers, specifierComparer); - const exportDecl = exportGroup2[0]; - coalescedExports.push( - factory.updateExportDeclaration( - exportDecl, - exportDecl.modifiers, - exportDecl.isTypeOnly, - exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)), - exportDecl.moduleSpecifier, - exportDecl.attributes - ) - ); - } - return coalescedExports; - function getCategorizedExports(exportGroup2) { - let exportWithoutClause2; - const namedExports2 = []; - const typeOnlyExports2 = []; - for (const exportDeclaration of exportGroup2) { - if (exportDeclaration.exportClause === void 0) { - exportWithoutClause2 = exportWithoutClause2 || exportDeclaration; - } else if (exportDeclaration.isTypeOnly) { - typeOnlyExports2.push(exportDeclaration); - } else { - namedExports2.push(exportDeclaration); - } - } - return { - exportWithoutClause: exportWithoutClause2, - namedExports: namedExports2, - typeOnlyExports: typeOnlyExports2 - }; - } -} -function updateImportDeclarationAndClause(importDeclaration, name, namedBindings) { - return factory.updateImportDeclaration( - importDeclaration, - importDeclaration.modifiers, - factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.phaseModifier, name, namedBindings), - // TODO: GH#18217 - importDeclaration.moduleSpecifier, - importDeclaration.attributes - ); -} -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 compareModuleSpecifiersWorker(m1, m2, comparer) { - const name1 = m1 === void 0 ? void 0 : getExternalModuleName2(m1); - const name2 = m2 === void 0 ? void 0 : getExternalModuleName2(m2); - return compareBooleans(name1 === void 0, name2 === void 0) || compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || comparer(name1, name2); -} -function getModuleNamesFromDecls(decls) { - return decls.map((s) => getExternalModuleName2(getModuleSpecifierExpression(s)) || ""); -} -function getModuleSpecifierExpression(declaration) { - var _a; - switch (declaration.kind) { - case 272 /* ImportEqualsDeclaration */: - return (_a = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression; - case 273 /* ImportDeclaration */: - return declaration.moduleSpecifier; - case 244 /* VariableStatement */: - return declaration.declarationList.declarations[0].initializer.arguments[0]; - } -} -function hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier) { - const moduleSpecifierText = isStringLiteral(moduleSpecifier) && moduleSpecifier.text; - return isString(moduleSpecifierText) && some(sourceFile.moduleAugmentations, (moduleName) => isStringLiteral(moduleName) && moduleName.text === moduleSpecifierText); -} -function getNewImportSpecifiers(namedImports) { - return flatMap(namedImports, (namedImport) => map(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && moduleExportNameTextEscaped(importSpecifier.name) === moduleExportNameTextEscaped(importSpecifier.propertyName) ? factory.updateImportSpecifier( - importSpecifier, - importSpecifier.isTypeOnly, - /*propertyName*/ - void 0, - importSpecifier.name - ) : importSpecifier)); -} -function tryGetNamedBindingElements(namedImport) { - var _a; - return ((_a = namedImport.importClause) == null ? void 0 : _a.namedBindings) && isNamedImports(namedImport.importClause.namedBindings) ? namedImport.importClause.namedBindings.elements : void 0; -} -function detectModuleSpecifierCaseBySort(importDeclsByGroup, comparersToTest) { - const moduleSpecifiersByGroup = []; - importDeclsByGroup.forEach((importGroup) => { - moduleSpecifiersByGroup.push(getModuleNamesFromDecls(importGroup)); - }); - return detectCaseSensitivityBySort(moduleSpecifiersByGroup, comparersToTest); -} -function detectNamedImportOrganizationBySort(originalGroups, comparersToTest, typesToTest) { - let bothNamedImports = false; - const importDeclsWithNamed = originalGroups.filter((i) => { - var _a, _b; - const namedImports = (_b = tryCast((_a = i.importClause) == null ? void 0 : _a.namedBindings, isNamedImports)) == null ? void 0 : _b.elements; - if (!(namedImports == null ? void 0 : namedImports.length)) return false; - if (!bothNamedImports && namedImports.some((n) => n.isTypeOnly) && namedImports.some((n) => !n.isTypeOnly)) { - bothNamedImports = true; - } - return true; - }); - if (importDeclsWithNamed.length === 0) return; - const namedImportsByDecl = importDeclsWithNamed.map((importDecl) => { - var _a, _b; - return (_b = tryCast((_a = importDecl.importClause) == null ? void 0 : _a.namedBindings, isNamedImports)) == null ? void 0 : _b.elements; - }).filter((elements) => elements !== void 0); - if (!bothNamedImports || typesToTest.length === 0) { - const sortState = detectCaseSensitivityBySort(namedImportsByDecl.map((i) => i.map((n) => n.name.text)), comparersToTest); - return { - namedImportComparer: sortState.comparer, - typeOrder: typesToTest.length === 1 ? typesToTest[0] : void 0, - isSorted: sortState.isSorted - }; - } - const bestDiff = { first: Infinity, last: Infinity, inline: Infinity }; - const bestComparer = { first: comparersToTest[0], last: comparersToTest[0], inline: comparersToTest[0] }; - for (const curComparer of comparersToTest) { - const currDiff = { first: 0, last: 0, inline: 0 }; - for (const importDecl of namedImportsByDecl) { - for (const typeOrder of typesToTest) { - currDiff[typeOrder] = (currDiff[typeOrder] ?? 0) + measureSortedness(importDecl, (n1, n2) => compareImportOrExportSpecifiers(n1, n2, curComparer, { organizeImportsTypeOrder: typeOrder })); - } - } - for (const key of typesToTest) { - const typeOrder = key; - if (currDiff[typeOrder] < bestDiff[typeOrder]) { - bestDiff[typeOrder] = currDiff[typeOrder]; - bestComparer[typeOrder] = curComparer; - } - } - } - outer: for (const bestKey of typesToTest) { - const bestTypeOrder = bestKey; - for (const testKey of typesToTest) { - const testTypeOrder = testKey; - if (bestDiff[testTypeOrder] < bestDiff[bestTypeOrder]) continue outer; - } - return { namedImportComparer: bestComparer[bestTypeOrder], typeOrder: bestTypeOrder, isSorted: bestDiff[bestTypeOrder] === 0 }; - } - return { namedImportComparer: bestComparer.last, typeOrder: "last", isSorted: bestDiff.last === 0 }; -} -function measureSortedness(arr, comparer) { - let i = 0; - for (let j = 0; j < arr.length - 1; j++) { - if (comparer(arr[j], arr[j + 1]) > 0) { - i++; - } - } - return i; -} -function detectCaseSensitivityBySort(originalGroups, comparersToTest) { - let bestComparer; - let bestDiff = Infinity; - for (const curComparer of comparersToTest) { - let diffOfCurrentComparer = 0; - for (const listToSort of originalGroups) { - if (listToSort.length <= 1) continue; - const diff = measureSortedness(listToSort, curComparer); - diffOfCurrentComparer += diff; - } - if (diffOfCurrentComparer < bestDiff) { - bestDiff = diffOfCurrentComparer; - bestComparer = curComparer; - } - } - return { - comparer: bestComparer ?? comparersToTest[0], - isSorted: bestDiff === 0 - }; -} -function compareImportKind(s1, s2) { - return compareValues(getImportKindOrder(s1), getImportKindOrder(s2)); -} -function getImportKindOrder(s1) { - var _a; - switch (s1.kind) { - case 273 /* ImportDeclaration */: - if (!s1.importClause) return 0; - if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamespaceImport */) return 2; - if (s1.importClause.name) return 3; - return 4; - case 272 /* ImportEqualsDeclaration */: - return 5; - case 244 /* VariableStatement */: - return 6; - } -} -function getOrganizeImportsOrdinalStringComparer(ignoreCase) { - return ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; -} -function getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) { - const resolvedLocale = getOrganizeImportsLocale(preferences); - const caseFirst = preferences.organizeImportsCaseFirst ?? false; - const numeric = preferences.organizeImportsNumericCollation ?? false; - const accents = preferences.organizeImportsAccentCollation ?? true; - const sensitivity = ignoreCase ? accents ? "accent" : "base" : accents ? "variant" : "case"; - const collator = new Intl.Collator(resolvedLocale, { - usage: "sort", - caseFirst: caseFirst || "false", - sensitivity, - numeric - }); - return collator.compare; -} -function getOrganizeImportsLocale(preferences) { - let locale = preferences.organizeImportsLocale; - if (locale === "auto") locale = getUILocale(); - if (locale === void 0) locale = "en"; - const supportedLocales = Intl.Collator.supportedLocalesOf(locale); - const resolvedLocale = supportedLocales.length ? supportedLocales[0] : "en"; - return resolvedLocale; -} -function getOrganizeImportsStringComparer(preferences, ignoreCase) { - const collation = preferences.organizeImportsCollation ?? "ordinal"; - return collation === "unicode" ? getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) : getOrganizeImportsOrdinalStringComparer(ignoreCase); -} -function getOrganizeImportsStringComparerWithDetection(originalImportDecls, preferences) { - return detectModuleSpecifierCaseBySort([originalImportDecls], getDetectionLists(preferences).comparersToTest); -} -function getNamedImportSpecifierComparer(preferences, comparer) { - const stringComparer = comparer ?? getOrganizeImportsOrdinalStringComparer(!!preferences.organizeImportsIgnoreCase); - return (s1, s2) => compareImportOrExportSpecifiers(s1, s2, stringComparer, preferences); -} -function getNamedImportSpecifierComparerWithDetection(importDecl, preferences, sourceFile) { - const { comparersToTest, typeOrdersToTest } = getDetectionLists(preferences); - const detectFromDecl = detectNamedImportOrganizationBySort([importDecl], comparersToTest, typeOrdersToTest); - let specifierComparer = getNamedImportSpecifierComparer(preferences, comparersToTest[0]); - let isSorted; - if (typeof preferences.organizeImportsIgnoreCase !== "boolean" || !preferences.organizeImportsTypeOrder) { - if (detectFromDecl) { - const { namedImportComparer, typeOrder, isSorted: isDetectedSorted } = detectFromDecl; - isSorted = isDetectedSorted; - specifierComparer = getNamedImportSpecifierComparer({ organizeImportsTypeOrder: typeOrder }, namedImportComparer); - } else if (sourceFile) { - const detectFromFile = detectNamedImportOrganizationBySort(sourceFile.statements.filter(isImportDeclaration), comparersToTest, typeOrdersToTest); - if (detectFromFile) { - const { namedImportComparer, typeOrder, isSorted: isDetectedSorted } = detectFromFile; - isSorted = isDetectedSorted; - specifierComparer = getNamedImportSpecifierComparer({ organizeImportsTypeOrder: typeOrder }, namedImportComparer); - } - } - } - return { specifierComparer, isSorted }; -} -function getImportDeclarationInsertionIndex(sortedImports, newImport, comparer) { - 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, comparer); - return index < 0 ? ~index : index; -} -function compareImportsOrRequireStatements(s1, s2, comparer) { - return compareModuleSpecifiersWorker(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), comparer) || compareImportKind(s1, s2); -} -function testCoalesceImports(importGroup, ignoreCase, sourceFile, preferences) { - const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); - const specifierComparer = getNamedImportSpecifierComparer({ organizeImportsTypeOrder: preferences == null ? void 0 : preferences.organizeImportsTypeOrder }, comparer); - return coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceFile); -} -function testCoalesceExports(exportGroup, ignoreCase, preferences) { - const comparer = (s1, s2) => compareImportOrExportSpecifiers(s1, s2, getOrganizeImportsOrdinalStringComparer(ignoreCase), { organizeImportsTypeOrder: (preferences == null ? void 0 : preferences.organizeImportsTypeOrder) ?? "last" }); - return coalesceExportsWorker(exportGroup, comparer); -} -function compareModuleSpecifiers2(m1, m2, ignoreCase) { - const comparer = getOrganizeImportsOrdinalStringComparer(!!ignoreCase); - return compareModuleSpecifiersWorker(m1, m2, comparer); -} - -// src/services/_namespaces/ts.OutliningElementsCollector.ts -var ts_OutliningElementsCollector_exports = {}; -__export(ts_OutliningElementsCollector_exports, { - collectElements: () => collectElements -}); - -// src/services/outliningElementsCollector.ts -function collectElements(sourceFile, cancellationToken) { - const res = []; - addNodeOutliningSpans(sourceFile, cancellationToken, res); - addRegionOutliningSpans(sourceFile, res); - res.sort((span1, span2) => span1.textSpan.start - span2.textSpan.start); - return res; -} -function addNodeOutliningSpans(sourceFile, cancellationToken, out) { - let depthRemaining = 40; - let current = 0; - const statements = sourceFile.statements; - const n = statements.length; - while (current < n) { - while (current < n && !isAnyImportSyntax(statements[current])) { - visitNode3(statements[current]); - current++; - } - if (current === n) break; - const firstImport = current; - while (current < n && isAnyImportSyntax(statements[current])) { - visitNode3(statements[current]); - current++; - } - const lastImport = current - 1; - if (lastImport !== firstImport) { - out.push(createOutliningSpanFromBounds(findChildOfKind(statements[firstImport], 102 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), "imports" /* Imports */)); - } - } - visitNode3(sourceFile.endOfFileToken); - function visitNode3(n2) { - var _a; - if (depthRemaining === 0) return; - cancellationToken.throwIfCancellationRequested(); - if (isDeclaration(n2) || isVariableStatement(n2) || isReturnStatement(n2) || isCallOrNewExpression(n2) || n2.kind === 1 /* EndOfFileToken */) { - addOutliningForLeadingCommentsForNode(n2, sourceFile, cancellationToken, out); - } - if (isFunctionLike(n2) && isBinaryExpression(n2.parent) && isPropertyAccessExpression(n2.parent.left)) { - addOutliningForLeadingCommentsForNode(n2.parent.left, sourceFile, cancellationToken, out); - } - if (isBlock(n2) || isModuleBlock(n2)) { - addOutliningForLeadingCommentsForPos(n2.statements.end, sourceFile, cancellationToken, out); - } - if (isClassLike(n2) || isInterfaceDeclaration(n2)) { - addOutliningForLeadingCommentsForPos(n2.members.end, sourceFile, cancellationToken, out); - } - const span = getOutliningSpanForNode(n2, sourceFile); - if (span) out.push(span); - depthRemaining--; - if (isCallExpression(n2)) { - depthRemaining++; - visitNode3(n2.expression); - depthRemaining--; - n2.arguments.forEach(visitNode3); - (_a = n2.typeArguments) == null ? void 0 : _a.forEach(visitNode3); - } else if (isIfStatement(n2) && n2.elseStatement && isIfStatement(n2.elseStatement)) { - visitNode3(n2.expression); - visitNode3(n2.thenStatement); - depthRemaining++; - visitNode3(n2.elseStatement); - depthRemaining--; - } else { - n2.forEachChild(visitNode3); - } - depthRemaining++; - } -} -function addRegionOutliningSpans(sourceFile, out) { - const regions = []; - const lineStarts = sourceFile.getLineStarts(); - for (const currentLineStart of lineStarts) { - const lineEnd = sourceFile.getLineEndOfPosition(currentLineStart); - const lineText = sourceFile.text.substring(currentLineStart, lineEnd); - const result = parseRegionDelimiter(lineText); - if (!result || isInComment(sourceFile, currentLineStart)) { - continue; - } - if (result.isStart) { - const span = createTextSpanFromBounds(sourceFile.text.indexOf("//", currentLineStart), lineEnd); - regions.push(createOutliningSpan( - span, - "region" /* Region */, - span, - /*autoCollapse*/ - false, - result.name || "#region" - )); - } else { - const region = regions.pop(); - if (region) { - region.textSpan.length = lineEnd - region.textSpan.start; - region.hintSpan.length = lineEnd - region.textSpan.start; - out.push(region); - } - } - } -} -var regionDelimiterRegExp = /^#(end)?region(.*)\r?$/; -function parseRegionDelimiter(lineText) { - lineText = lineText.trimStart(); - if (!startsWith(lineText, "//")) { - return null; - } - lineText = lineText.slice(2).trim(); - const result = regionDelimiterRegExp.exec(lineText); - if (result) { - return { isStart: !result[1], name: result[2].trim() }; - } - return void 0; -} -function addOutliningForLeadingCommentsForPos(pos, sourceFile, cancellationToken, out) { - const comments = getLeadingCommentRanges(sourceFile.text, pos); - if (!comments) return; - let firstSingleLineCommentStart = -1; - let lastSingleLineCommentEnd = -1; - let singleLineCommentCount = 0; - const sourceText = sourceFile.getFullText(); - for (const { kind, pos: pos2, end } of comments) { - cancellationToken.throwIfCancellationRequested(); - switch (kind) { - case 2 /* SingleLineCommentTrivia */: - const commentText = sourceText.slice(pos2, end); - if (parseRegionDelimiter(commentText)) { - combineAndAddMultipleSingleLineComments(); - singleLineCommentCount = 0; - break; - } - if (singleLineCommentCount === 0) { - firstSingleLineCommentStart = pos2; - } - lastSingleLineCommentEnd = end; - singleLineCommentCount++; - break; - case 3 /* MultiLineCommentTrivia */: - combineAndAddMultipleSingleLineComments(); - out.push(createOutliningSpanFromBounds(pos2, end, "comment" /* Comment */)); - singleLineCommentCount = 0; - break; - default: - Debug.assertNever(kind); - } - } - combineAndAddMultipleSingleLineComments(); - function combineAndAddMultipleSingleLineComments() { - if (singleLineCommentCount > 1) { - out.push(createOutliningSpanFromBounds(firstSingleLineCommentStart, lastSingleLineCommentEnd, "comment" /* Comment */)); - } - } -} -function addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out) { - if (isJsxText(n)) return; - addOutliningForLeadingCommentsForPos(n.pos, sourceFile, cancellationToken, out); -} -function createOutliningSpanFromBounds(pos, end, kind) { - return createOutliningSpan(createTextSpanFromBounds(pos, end), kind); -} -function getOutliningSpanForNode(n, sourceFile) { - switch (n.kind) { - case 242 /* Block */: - if (isFunctionLike(n.parent)) { - return functionSpan(n.parent, n, sourceFile); - } - switch (n.parent.kind) { - case 247 /* DoStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 249 /* ForStatement */: - case 246 /* IfStatement */: - case 248 /* WhileStatement */: - case 255 /* WithStatement */: - case 300 /* CatchClause */: - return spanForNode(n.parent); - case 259 /* TryStatement */: - const tryStatement = n.parent; - if (tryStatement.tryBlock === n) { - return spanForNode(n.parent); - } else if (tryStatement.finallyBlock === n) { - const node = findChildOfKind(tryStatement, 98 /* FinallyKeyword */, sourceFile); - if (node) return spanForNode(node); - } - // falls through - default: - return createOutliningSpan(createTextSpanFromNode(n, sourceFile), "code" /* Code */); - } - case 269 /* ModuleBlock */: - return spanForNode(n.parent); - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 270 /* CaseBlock */: - case 188 /* TypeLiteral */: - case 207 /* ObjectBindingPattern */: - return spanForNode(n); - case 190 /* TupleType */: - return spanForNode( - n, - /*autoCollapse*/ - false, - /*useFullStart*/ - !isTupleTypeNode(n.parent), - 23 /* OpenBracketToken */ - ); - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - return spanForNodeArray(n.statements); - case 211 /* ObjectLiteralExpression */: - return spanForObjectOrArrayLiteral(n); - case 210 /* ArrayLiteralExpression */: - return spanForObjectOrArrayLiteral(n, 23 /* OpenBracketToken */); - case 285 /* JsxElement */: - return spanForJSXElement(n); - case 289 /* JsxFragment */: - return spanForJSXFragment(n); - case 286 /* JsxSelfClosingElement */: - case 287 /* JsxOpeningElement */: - return spanForJSXAttributes(n.attributes); - case 229 /* TemplateExpression */: - case 15 /* NoSubstitutionTemplateLiteral */: - return spanForTemplateLiteral(n); - case 208 /* ArrayBindingPattern */: - return spanForNode( - n, - /*autoCollapse*/ - false, - /*useFullStart*/ - !isBindingElement(n.parent), - 23 /* OpenBracketToken */ - ); - case 220 /* ArrowFunction */: - return spanForArrowFunction(n); - case 214 /* CallExpression */: - return spanForCallExpression(n); - case 218 /* ParenthesizedExpression */: - return spanForParenthesizedExpression(n); - case 276 /* NamedImports */: - case 280 /* NamedExports */: - case 301 /* ImportAttributes */: - return spanForImportExportElements(n); - } - function spanForImportExportElements(node) { - if (!node.elements.length) { - return void 0; - } - const openToken = findChildOfKind(node, 19 /* OpenBraceToken */, sourceFile); - const closeToken = findChildOfKind(node, 20 /* CloseBraceToken */, sourceFile); - if (!openToken || !closeToken || positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) { - return void 0; - } - return spanBetweenTokens( - openToken, - closeToken, - node, - sourceFile, - /*autoCollapse*/ - false, - /*useFullStart*/ - false - ); - } - function spanForCallExpression(node) { - if (!node.arguments.length) { - return void 0; - } - const openToken = findChildOfKind(node, 21 /* OpenParenToken */, sourceFile); - const closeToken = findChildOfKind(node, 22 /* CloseParenToken */, sourceFile); - if (!openToken || !closeToken || positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) { - return void 0; - } - return spanBetweenTokens( - openToken, - closeToken, - node, - sourceFile, - /*autoCollapse*/ - false, - /*useFullStart*/ - true - ); - } - function spanForArrowFunction(node) { - if (isBlock(node.body) || isParenthesizedExpression(node.body) || positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) { - return void 0; - } - const textSpan = createTextSpanFromBounds(node.body.getFullStart(), node.body.getEnd()); - return createOutliningSpan(textSpan, "code" /* Code */, createTextSpanFromNode(node)); - } - function spanForJSXElement(node) { - const textSpan = createTextSpanFromBounds(node.openingElement.getStart(sourceFile), node.closingElement.getEnd()); - const tagName = node.openingElement.tagName.getText(sourceFile); - const bannerText = "<" + tagName + ">..."; - return createOutliningSpan( - textSpan, - "code" /* Code */, - textSpan, - /*autoCollapse*/ - false, - bannerText - ); - } - function spanForJSXFragment(node) { - const textSpan = createTextSpanFromBounds(node.openingFragment.getStart(sourceFile), node.closingFragment.getEnd()); - const bannerText = "<>..."; - return createOutliningSpan( - textSpan, - "code" /* Code */, - textSpan, - /*autoCollapse*/ - false, - bannerText - ); - } - function spanForJSXAttributes(node) { - if (node.properties.length === 0) { - return void 0; - } - return createOutliningSpanFromBounds(node.getStart(sourceFile), node.getEnd(), "code" /* Code */); - } - function spanForTemplateLiteral(node) { - if (node.kind === 15 /* NoSubstitutionTemplateLiteral */ && node.text.length === 0) { - return void 0; - } - return createOutliningSpanFromBounds(node.getStart(sourceFile), node.getEnd(), "code" /* Code */); - } - function spanForObjectOrArrayLiteral(node, open = 19 /* OpenBraceToken */) { - return spanForNode( - node, - /*autoCollapse*/ - false, - /*useFullStart*/ - !isArrayLiteralExpression(node.parent) && !isCallExpression(node.parent), - open - ); - } - function spanForNode(hintSpanNode, autoCollapse = false, useFullStart = true, open = 19 /* OpenBraceToken */, close = open === 19 /* OpenBraceToken */ ? 20 /* CloseBraceToken */ : 24 /* CloseBracketToken */) { - const openToken = findChildOfKind(n, open, sourceFile); - const closeToken = findChildOfKind(n, close, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); - } - function spanForNodeArray(nodeArray) { - return nodeArray.length ? createOutliningSpan(createTextSpanFromRange(nodeArray), "code" /* Code */) : void 0; - } - function spanForParenthesizedExpression(node) { - if (positionsAreOnSameLine(node.getStart(), node.getEnd(), sourceFile)) return void 0; - const textSpan = createTextSpanFromBounds(node.getStart(), node.getEnd()); - return createOutliningSpan(textSpan, "code" /* Code */, createTextSpanFromNode(node)); - } -} -function functionSpan(node, body, sourceFile) { - const openToken = tryGetFunctionOpenToken(node, body, sourceFile); - const closeToken = findChildOfKind(body, 20 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens( - openToken, - closeToken, - node, - sourceFile, - /*autoCollapse*/ - node.kind !== 220 /* ArrowFunction */ - ); -} -function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) { - const textSpan = createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd()); - return createOutliningSpan(textSpan, "code" /* Code */, createTextSpanFromNode(hintSpanNode, sourceFile), autoCollapse); -} -function createOutliningSpan(textSpan, kind, hintSpan = textSpan, autoCollapse = false, bannerText = "...") { - return { textSpan, kind, hintSpan, bannerText, autoCollapse }; -} -function tryGetFunctionOpenToken(node, body, sourceFile) { - if (isNodeArrayMultiLine(node.parameters, sourceFile)) { - const openParenToken = findChildOfKind(node, 21 /* OpenParenToken */, sourceFile); - if (openParenToken) { - return openParenToken; - } - } - return findChildOfKind(body, 19 /* OpenBraceToken */, sourceFile); -} - -// src/services/_namespaces/ts.Rename.ts -var ts_Rename_exports = {}; -__export(ts_Rename_exports, { - getRenameInfo: () => getRenameInfo, - nodeIsEligibleForRename: () => nodeIsEligibleForRename -}); - -// src/services/rename.ts -function getRenameInfo(program, sourceFile, position, preferences) { - const node = getAdjustedRenameLocation(getTouchingPropertyName(sourceFile, position)); - if (nodeIsEligibleForRename(node)) { - const renameInfo = getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, program, preferences); - if (renameInfo) { - return renameInfo; - } - } - return getRenameInfoError(Diagnostics.You_cannot_rename_this_element); -} -function getRenameInfoForNode(node, typeChecker, sourceFile, program, preferences) { - const symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - if (isStringLiteralLike(node)) { - const type = getContextualTypeFromParentOrAncestorTypeNode(node, typeChecker); - if (type && (type.flags & 128 /* StringLiteral */ || type.flags & 1048576 /* Union */ && every(type.types, (type2) => !!(type2.flags & 128 /* StringLiteral */)))) { - return getRenameInfoSuccess(node.text, node.text, "string" /* string */, "", node, sourceFile); - } - } else if (isLabelName(node)) { - const name = getTextOfNode(node); - return getRenameInfoSuccess(name, name, "label" /* label */, "" /* none */, node, sourceFile); - } - return void 0; - } - const { declarations } = symbol; - if (!declarations || declarations.length === 0) return; - if (declarations.some((declaration) => isDefinedInLibraryFile(program, declaration))) { - return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); - } - if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & 1536 /* Module */) { - return void 0; - } - if (isStringLiteralLike(node) && tryGetImportFromModuleSpecifier(node)) { - return preferences.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : void 0; - } - const wouldRenameNodeModules = wouldRenameInOtherNodeModules(sourceFile, symbol, typeChecker, preferences); - if (wouldRenameNodeModules) { - return getRenameInfoError(wouldRenameNodeModules); - } - const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, node); - const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 168 /* 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); -} -function isDefinedInLibraryFile(program, declaration) { - const sourceFile = declaration.getSourceFile(); - return program.isSourceFileDefaultLibrary(sourceFile) && fileExtensionIs(sourceFile.fileName, ".d.ts" /* Dts */); -} -function wouldRenameInOtherNodeModules(originalFile, symbol, checker, preferences) { - if (!preferences.providePrefixAndSuffixTextForRename && symbol.flags & 2097152 /* Alias */) { - const importSpecifier = symbol.declarations && find(symbol.declarations, (decl) => isImportSpecifier(decl)); - if (importSpecifier && !importSpecifier.propertyName) { - symbol = checker.getAliasedSymbol(symbol); - } - } - const { declarations } = symbol; - if (!declarations) { - return void 0; - } - const originalPackage = getPackagePathComponents(originalFile.path); - if (originalPackage === void 0) { - if (some(declarations, (declaration) => isInsideNodeModules(declaration.getSourceFile().path))) { - return Diagnostics.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder; - } else { - return void 0; - } - } - for (const declaration of declarations) { - const declPackage = getPackagePathComponents(declaration.getSourceFile().path); - if (declPackage) { - const length2 = Math.min(originalPackage.length, declPackage.length); - for (let i = 0; i <= length2; i++) { - if (compareStringsCaseSensitive(originalPackage[i], declPackage[i]) !== 0 /* EqualTo */) { - return Diagnostics.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder; - } - } - } - } - return void 0; -} -function getPackagePathComponents(filePath) { - const components = getPathComponents(filePath); - const nodeModulesIdx = components.lastIndexOf("node_modules"); - if (nodeModulesIdx === -1) { - return void 0; - } - return components.slice(0, nodeModulesIdx + 2); -} -function getRenameInfoForModule(node, sourceFile, moduleSymbol) { - if (!isExternalModuleNameRelative(node.text)) { - return getRenameInfoError(Diagnostics.You_cannot_rename_a_module_via_a_global_import); - } - const moduleSourceFile = moduleSymbol.declarations && find(moduleSymbol.declarations, isSourceFile); - if (!moduleSourceFile) return void 0; - const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index"); - 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: fileName, - kind, - displayName: fileName, - fullDisplayName: node.text, - kindModifiers: "" /* none */, - triggerSpan - }; -} -function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { - return { - canRename: true, - fileToRename: void 0, - kind, - displayName, - fullDisplayName, - kindModifiers, - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; -} -function getRenameInfoError(diagnostic) { - return { canRename: false, localizedErrorMessage: getLocaleSpecificMessage(diagnostic) }; -} -function createTriggerSpanForNode(node, sourceFile) { - let start = node.getStart(sourceFile); - let width = node.getWidth(sourceFile); - if (isStringLiteralLike(node)) { - start += 1; - width -= 2; - } - return createTextSpan(start, width); -} -function nodeIsEligibleForRename(node) { - switch (node.kind) { - case 80 /* Identifier */: - case 81 /* PrivateIdentifier */: - case 11 /* StringLiteral */: - case 15 /* NoSubstitutionTemplateLiteral */: - case 110 /* ThisKeyword */: - return true; - case 9 /* NumericLiteral */: - return isLiteralNameOfPropertyDeclarationOrIndexAccess(node); - default: - return false; - } -} - -// src/services/_namespaces/ts.SignatureHelp.ts -var ts_SignatureHelp_exports = {}; -__export(ts_SignatureHelp_exports, { - getArgumentInfoForCompletions: () => getArgumentInfoForCompletions, - getSignatureHelpItems: () => getSignatureHelpItems -}); - -// src/services/signatureHelp.ts -function getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken) { - const typeChecker = program.getTypeChecker(); - const startingToken = findTokenOnLeftOfPosition(sourceFile, position); - if (!startingToken) { - return void 0; - } - const onlyUseSyntacticOwners = !!triggerReason && triggerReason.kind === "characterTyped"; - if (onlyUseSyntacticOwners && (isInString(sourceFile, position, startingToken) || isInComment(sourceFile, position))) { - return void 0; - } - const isManuallyInvoked = !!triggerReason && triggerReason.kind === "invoked"; - const argumentInfo = getContainingArgumentInfo(startingToken, position, sourceFile, typeChecker, isManuallyInvoked); - if (!argumentInfo) return void 0; - cancellationToken.throwIfCancellationRequested(); - const candidateInfo = getCandidateOrTypeInfo(argumentInfo, typeChecker, sourceFile, startingToken, onlyUseSyntacticOwners); - cancellationToken.throwIfCancellationRequested(); - if (!candidateInfo) { - return isSourceFileJS(sourceFile) ? createJSSignatureHelpItems(argumentInfo, program, cancellationToken) : void 0; - } - return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === 0 /* Candidate */ ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); -} -function getCandidateOrTypeInfo({ invocation, argumentCount }, checker, sourceFile, startingToken, onlyUseSyntacticOwners) { - switch (invocation.kind) { - case 0 /* Call */: { - if (onlyUseSyntacticOwners && !isSyntacticOwner(startingToken, invocation.node, sourceFile)) { - return void 0; - } - const candidates = []; - const resolvedSignature = checker.getResolvedSignatureForSignatureHelp(invocation.node, candidates, argumentCount); - return candidates.length === 0 ? void 0 : { kind: 0 /* Candidate */, candidates, resolvedSignature }; - } - case 1 /* TypeArgs */: { - const { called } = invocation; - if (onlyUseSyntacticOwners && !containsPrecedingToken(startingToken, sourceFile, isIdentifier(called) ? called.parent : called)) { - return void 0; - } - const candidates = getPossibleGenericSignatures(called, argumentCount, checker); - if (candidates.length !== 0) return { kind: 0 /* Candidate */, candidates, resolvedSignature: first(candidates) }; - const symbol = checker.getSymbolAtLocation(called); - return symbol && { kind: 1 /* Type */, symbol }; - } - case 2 /* Contextual */: - return { kind: 0 /* Candidate */, candidates: [invocation.signature], resolvedSignature: invocation.signature }; - default: - return Debug.assertNever(invocation); - } -} -function isSyntacticOwner(startingToken, node, sourceFile) { - if (!isCallOrNewExpression(node)) return false; - const invocationChildren = node.getChildren(sourceFile); - switch (startingToken.kind) { - case 21 /* OpenParenToken */: - return contains(invocationChildren, startingToken); - case 28 /* CommaToken */: { - const containingList = findContainingList(startingToken); - return !!containingList && contains(invocationChildren, containingList); - } - case 30 /* LessThanToken */: - return containsPrecedingToken(startingToken, sourceFile, node.expression); - default: - return false; - } -} -function createJSSignatureHelpItems(argumentInfo, program, cancellationToken) { - if (argumentInfo.invocation.kind === 2 /* Contextual */) return void 0; - const expression = getExpressionFromInvocation(argumentInfo.invocation); - const name = isPropertyAccessExpression(expression) ? expression.name.text : void 0; - const typeChecker = program.getTypeChecker(); - return name === void 0 ? void 0 : firstDefined(program.getSourceFiles(), (sourceFile) => firstDefined(sourceFile.getNamedDeclarations().get(name), (declaration) => { - const type = declaration.symbol && typeChecker.getTypeOfSymbolAtLocation(declaration.symbol, declaration); - const callSignatures = type && type.getCallSignatures(); - if (callSignatures && callSignatures.length) { - return typeChecker.runWithCancellationToken( - cancellationToken, - (typeChecker2) => createSignatureHelpItems( - callSignatures, - callSignatures[0], - argumentInfo, - sourceFile, - typeChecker2, - /*useFullPrefix*/ - true - ) - ); - } - })); -} -function containsPrecedingToken(startingToken, sourceFile, container) { - const pos = startingToken.getFullStart(); - let currentParent = startingToken.parent; - while (currentParent) { - const precedingToken = findPrecedingToken( - pos, - sourceFile, - currentParent, - /*excludeJsdoc*/ - true - ); - if (precedingToken) { - return rangeContainsRange(container, precedingToken); - } - currentParent = currentParent.parent; - } - return Debug.fail("Could not find preceding token"); -} -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, checker) { - const info = getArgumentOrParameterListAndIndex(node, sourceFile, checker); - if (!info) return void 0; - const { list, argumentIndex } = info; - const argumentCount = getArgumentCount(checker, list); - const argumentsSpan = getApplicableSpanForArguments(list, sourceFile); - return { list, argumentIndex, argumentCount, argumentsSpan }; -} -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(checker, list, node) }; - } -} -function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker) { - const { parent: parent2 } = node; - if (isCallOrNewExpression(parent2)) { - const invocation = parent2; - const info = getArgumentOrParameterListInfo(node, position, sourceFile, checker); - if (!info) return void 0; - const { list, argumentIndex, argumentCount, argumentsSpan } = info; - const isTypeParameterList = !!parent2.typeArguments && parent2.typeArguments.pos === list.pos; - return { isTypeParameterList, invocation: { kind: 0 /* Call */, node: invocation }, argumentsSpan, argumentIndex, argumentCount }; - } else if (isNoSubstitutionTemplateLiteral(node) && isTaggedTemplateExpression(parent2)) { - if (isInsideTemplateLiteral(node, position, sourceFile)) { - return getArgumentListInfoForTemplate( - parent2, - /*argumentIndex*/ - 0, - sourceFile - ); - } - return void 0; - } else if (isTemplateHead(node) && parent2.parent.kind === 216 /* TaggedTemplateExpression */) { - const templateExpression = parent2; - const tagExpression = templateExpression.parent; - Debug.assert(templateExpression.kind === 229 /* TemplateExpression */); - const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); - } else if (isTemplateSpan(parent2) && isTaggedTemplateExpression(parent2.parent.parent)) { - const templateSpan = parent2; - const tagExpression = parent2.parent.parent; - if (isTemplateTail(node) && !isInsideTemplateLiteral(node, position, sourceFile)) { - return void 0; - } - const spanIndex = templateSpan.parent.templateSpans.indexOf(templateSpan); - const argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile); - return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); - } else if (isJsxOpeningLikeElement(parent2)) { - const attributeSpanStart = parent2.attributes.pos; - const attributeSpanEnd = skipTrivia( - sourceFile.text, - parent2.attributes.end, - /*stopAfterLineBreak*/ - false - ); - return { - isTypeParameterList: false, - invocation: { kind: 0 /* Call */, node: parent2 }, - argumentsSpan: createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart), - argumentIndex: 0, - argumentCount: 1 - }; - } else { - const typeArgInfo = getPossibleTypeArgumentsInfo(node, sourceFile); - if (typeArgInfo) { - const { called, nTypeArguments } = typeArgInfo; - const invocation = { kind: 1 /* TypeArgs */, called }; - const argumentsSpan = createTextSpanFromBounds(called.getStart(sourceFile), node.end); - return { isTypeParameterList: true, invocation, argumentsSpan, argumentIndex: nTypeArguments, argumentCount: nTypeArguments + 1 }; - } - return void 0; - } -} -function getImmediatelyContainingArgumentOrContextualParameterInfo(node, position, sourceFile, checker) { - return tryGetParameterInfo(node, position, sourceFile, checker) || getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker); -} -function getHighestBinary(b) { - return isBinaryExpression(b.parent) ? getHighestBinary(b.parent) : b; -} -function countBinaryExpressionParameters(b) { - return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2; -} -function tryGetParameterInfo(startingToken, position, sourceFile, checker) { - const node = getAdjustedNode(startingToken); - if (node === void 0) return void 0; - const info = getContextualSignatureLocationInfo(node, sourceFile, position, checker); - if (info === void 0) return void 0; - const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info; - const nonNullableContextualType = contextualType.getNonNullableType(); - const symbol = nonNullableContextualType.symbol; - if (symbol === void 0) return void 0; - const signature = lastOrUndefined(nonNullableContextualType.getCallSignatures()); - if (signature === void 0) return void 0; - const invocation = { kind: 2 /* Contextual */, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) }; - return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount }; -} -function getAdjustedNode(node) { - switch (node.kind) { - case 21 /* OpenParenToken */: - case 28 /* CommaToken */: - return node; - default: - return findAncestor(node.parent, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit"); - } -} -function getContextualSignatureLocationInfo(node, sourceFile, position, checker) { - const { parent: parent2 } = node; - switch (parent2.kind) { - case 218 /* ParenthesizedExpression */: - case 175 /* MethodDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* 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 227 /* BinaryExpression */: { - const highestBinary = getHighestBinary(parent2); - const contextualType2 = checker.getContextualType(highestBinary); - const argumentIndex2 = node.kind === 21 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1; - const argumentCount2 = countBinaryExpressionParameters(highestBinary); - return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent2) }; - } - default: - return void 0; - } -} -function chooseBetterSymbol(s) { - return s.name === "__type" /* Type */ ? firstDefined(s.declarations, (d) => { - var _a; - return isFunctionTypeNode(d) ? (_a = tryCast(d.parent, canHaveSymbol)) == null ? void 0 : _a.symbol : void 0; - }) || s : s; -} -function getSpreadElementCount(node, checker) { - const spreadType = checker.getTypeAtLocation(node.expression); - if (checker.isTupleType(spreadType)) { - const { elementFlags, fixedLength } = spreadType.target; - if (fixedLength === 0) { - return 0; - } - const firstOptionalIndex = findIndex(elementFlags, (f) => !(f & 1 /* Required */)); - return firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex; - } - return 0; -} -function getArgumentIndex(checker, argumentsList, node) { - return getArgumentIndexOrCount(checker, argumentsList, node); -} -function getArgumentCount(checker, argumentsList) { - return getArgumentIndexOrCount( - checker, - argumentsList, - /*node*/ - void 0 - ); -} -function getArgumentIndexOrCount(checker, argumentsList, node) { - const args = argumentsList.getChildren(); - let argumentIndex = 0; - let skipComma = false; - for (const child of args) { - if (node && child === node) { - if (!skipComma && child.kind === 28 /* CommaToken */) { - argumentIndex++; - } - return argumentIndex; - } - if (isSpreadElement(child)) { - argumentIndex += getSpreadElementCount(child, checker); - skipComma = true; - continue; - } - if (child.kind !== 28 /* CommaToken */) { - argumentIndex++; - skipComma = true; - continue; - } - if (skipComma) { - skipComma = false; - continue; - } - argumentIndex++; - } - if (node) { - return argumentIndex; - } - return args.length && last(args).kind === 28 /* CommaToken */ ? argumentIndex + 1 : argumentIndex; -} -function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) { - Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); - if (isTemplateLiteralToken(node)) { - if (isInsideTemplateLiteral(node, position, sourceFile)) { - return 0; - } - return spanIndex + 2; - } - return spanIndex + 1; -} -function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { - const argumentCount = isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; - if (argumentIndex !== 0) { - Debug.assertLessThan(argumentIndex, argumentCount); - } - return { - isTypeParameterList: false, - invocation: { kind: 0 /* Call */, node: tagExpression }, - argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression, sourceFile), - argumentIndex, - argumentCount - }; -} -function getApplicableSpanForArguments(argumentsList, sourceFile) { - const applicableSpanStart = argumentsList.getFullStart(); - const applicableSpanEnd = skipTrivia( - sourceFile.text, - argumentsList.getEnd(), - /*stopAfterLineBreak*/ - false - ); - return createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); -} -function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) { - const template = taggedTemplate.template; - const applicableSpanStart = template.getStart(); - let applicableSpanEnd = template.getEnd(); - if (template.kind === 229 /* TemplateExpression */) { - const lastSpan = last(template.templateSpans); - if (lastSpan.literal.getFullWidth() === 0) { - applicableSpanEnd = skipTrivia( - sourceFile.text, - applicableSpanEnd, - /*stopAfterLineBreak*/ - false - ); - } - } - return createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); -} -function getContainingArgumentInfo(node, position, sourceFile, checker, isManuallyInvoked) { - for (let n = node; !isSourceFile(n) && (isManuallyInvoked || !isBlock(n)); n = n.parent) { - Debug.assert(rangeContainsRange(n.parent, n), "Not a subspan", () => `Child: ${Debug.formatSyntaxKind(n.kind)}, parent: ${Debug.formatSyntaxKind(n.parent.kind)}`); - const argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker); - if (argumentInfo) { - return argumentInfo; - } - } - return void 0; -} -function getChildListThatStartsWithOpenerToken(parent2, openerToken, sourceFile) { - const children = parent2.getChildren(sourceFile); - const indexOfOpenerToken = children.indexOf(openerToken); - Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); - return children[indexOfOpenerToken + 1]; -} -function getExpressionFromInvocation(invocation) { - return invocation.kind === 0 /* Call */ ? getInvokedExpression(invocation.node) : invocation.called; -} -function getEnclosingDeclarationFromInvocation(invocation) { - return invocation.kind === 0 /* Call */ ? invocation.node : invocation.kind === 1 /* TypeArgs */ ? invocation.called : invocation.node; -} -var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; -function createSignatureHelpItems(candidates, resolvedSignature, { isTypeParameterList, argumentCount, argumentsSpan: applicableSpan, invocation, argumentIndex }, sourceFile, typeChecker, useFullPrefix) { - var _a; - const enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation); - const callTargetSymbol = invocation.kind === 2 /* Contextual */ ? invocation.symbol : typeChecker.getSymbolAtLocation(getExpressionFromInvocation(invocation)) || useFullPrefix && ((_a = resolvedSignature.declaration) == null ? void 0 : _a.symbol); - const callTargetDisplayParts = callTargetSymbol ? symbolToDisplayParts( - typeChecker, - callTargetSymbol, - useFullPrefix ? sourceFile : void 0, - /*meaning*/ - void 0 - ) : emptyArray; - const items = map(candidates, (candidateSignature) => getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile)); - let selectedItemIndex = 0; - let itemsSeen = 0; - for (let i = 0; i < items.length; i++) { - const item = items[i]; - if (candidates[i] === resolvedSignature) { - selectedItemIndex = itemsSeen; - if (item.length > 1) { - let count = 0; - for (const i2 of item) { - if (i2.isVariadic || i2.parameters.length >= argumentCount) { - selectedItemIndex = itemsSeen + count; - break; - } - count++; - } - } - } - itemsSeen += item.length; - } - Debug.assert(selectedItemIndex !== -1); - const help = { items: flatMapToMutable(items, identity), applicableSpan, selectedItemIndex, argumentIndex, argumentCount }; - const selected = help.items[selectedItemIndex]; - if (selected.isVariadic) { - const firstRest = findIndex(selected.parameters, (p) => !!p.isRest); - if (-1 < firstRest && firstRest < selected.parameters.length - 1) { - help.argumentIndex = selected.parameters.length; - } else { - help.argumentIndex = Math.min(help.argumentIndex, selected.parameters.length - 1); - } - } - return help; -} -function createTypeHelpItems(symbol, { argumentCount, argumentsSpan: applicableSpan, invocation, argumentIndex }, sourceFile, checker) { - const typeParameters = checker.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - if (!typeParameters) return void 0; - const items = [getTypeHelpItem(symbol, typeParameters, checker, getEnclosingDeclarationFromInvocation(invocation), sourceFile)]; - return { items, applicableSpan, selectedItemIndex: 0, argumentIndex, argumentCount }; -} -function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) { - const typeSymbolDisplay = symbolToDisplayParts(checker, symbol); - const printer = createPrinterWithRemoveComments(); - const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); - const documentation = symbol.getDocumentationComment(checker); - const tags = symbol.getJsDocTags(checker); - const prefixDisplayParts = [...typeSymbolDisplay, punctuationPart(30 /* LessThanToken */)]; - return { isVariadic: false, prefixDisplayParts, suffixDisplayParts: [punctuationPart(32 /* GreaterThanToken */)], separatorDisplayParts, parameters, documentation, tags }; -} -var separatorDisplayParts = [punctuationPart(28 /* CommaToken */), spacePart()]; -function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) { - const infos = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile); - return map(infos, ({ isVariadic, parameters, prefix, suffix }) => { - const prefixDisplayParts = [...callTargetDisplayParts, ...prefix]; - const suffixDisplayParts = [...suffix, ...returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker)]; - const documentation = candidateSignature.getDocumentationComment(checker); - const tags = candidateSignature.getJsDocTags(); - return { isVariadic, prefixDisplayParts, suffixDisplayParts, separatorDisplayParts, parameters, documentation, tags }; - }); -} -function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker) { - return mapToDisplayParts((writer) => { - writer.writePunctuation(":"); - writer.writeSpace(" "); - const predicate = checker.getTypePredicateOfSignature(candidateSignature); - if (predicate) { - checker.writeTypePredicate( - predicate, - enclosingDeclaration, - /*flags*/ - void 0, - writer - ); - } else { - checker.writeType( - checker.getReturnTypeOfSignature(candidateSignature), - enclosingDeclaration, - /*flags*/ - void 0, - writer - ); - } - }); -} -function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { - const typeParameters = (candidateSignature.target || candidateSignature).typeParameters; - const printer = createPrinterWithRemoveComments(); - const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer)); - const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : []; - return checker.getExpandedParameters(candidateSignature).map((paramList) => { - const params = factory.createNodeArray([...thisParameter, ...map(paramList, (param) => checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags))]); - const parameterParts = mapToDisplayParts((writer) => { - printer.writeList(2576 /* CallExpressionArguments */, params, sourceFile, writer); - }); - return { isVariadic: false, parameters, prefix: [punctuationPart(30 /* LessThanToken */)], suffix: [punctuationPart(32 /* GreaterThanToken */), ...parameterParts] }; - }); -} -function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { - const printer = createPrinterWithRemoveComments(); - const typeParameterParts = mapToDisplayParts((writer) => { - if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { - const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags))); - printer.writeList(53776 /* TypeParameters */, args, sourceFile, writer); - } - }); - const lists = checker.getExpandedParameters(candidateSignature); - const isVariadic = !checker.hasEffectiveRestParameter(candidateSignature) ? (_) => false : lists.length === 1 ? (_) => true : (pList) => { - var _a; - return !!(pList.length && ((_a = tryCast(pList[pList.length - 1], isTransientSymbol)) == null ? void 0 : _a.links.checkFlags) & 32768 /* RestParameter */); - }; - return lists.map((parameterList) => ({ - isVariadic: isVariadic(parameterList), - parameters: parameterList.map((p) => createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer)), - prefix: [...typeParameterParts, punctuationPart(21 /* OpenParenToken */)], - suffix: [punctuationPart(22 /* CloseParenToken */)] - })); -} -function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) { - const displayParts = mapToDisplayParts((writer) => { - const param = checker.symbolToParameterDeclaration(parameter, enclosingDeclaration, signatureHelpNodeBuilderFlags); - printer.writeNode(4 /* Unspecified */, param, sourceFile, writer); - }); - const isOptional = checker.isOptionalParameter(parameter.valueDeclaration); - const isRest = isTransientSymbol(parameter) && !!(parameter.links.checkFlags & 32768 /* RestParameter */); - return { name: parameter.name, documentation: parameter.getDocumentationComment(checker), displayParts, isOptional, isRest }; -} -function createSignatureHelpParameterForTypeParameter(typeParameter, checker, enclosingDeclaration, sourceFile, printer) { - const displayParts = mapToDisplayParts((writer) => { - const param = checker.typeParameterToDeclaration(typeParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags); - printer.writeNode(4 /* Unspecified */, param, sourceFile, writer); - }); - return { name: typeParameter.symbol.name, documentation: typeParameter.symbol.getDocumentationComment(checker), displayParts, isOptional: false, isRest: false }; -} - -// src/services/_namespaces/ts.SmartSelectionRange.ts -var ts_SmartSelectionRange_exports = {}; -__export(ts_SmartSelectionRange_exports, { - getSmartSelectionRange: () => getSmartSelectionRange -}); - -// src/services/smartSelection.ts -function getSmartSelectionRange(pos, sourceFile) { - var _a, _b; - let selectionRange = { - textSpan: createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) - }; - let parentNode = sourceFile; - outer: - while (true) { - const children = getSelectionChildren(parentNode); - if (!children.length) break; - for (let i = 0; i < children.length; i++) { - const prevNode = children[i - 1]; - const node = children[i]; - const nextNode = children[i + 1]; - if (getTokenPosOfNode( - node, - sourceFile, - /*includeJsDoc*/ - true - ) > pos) { - break outer; - } - const comment = singleOrUndefined(getTrailingCommentRanges(sourceFile.text, node.end)); - if (comment && comment.kind === 2 /* SingleLineCommentTrivia */) { - pushSelectionCommentRange(comment.pos, comment.end); - } - if (positionShouldSnapToNode(sourceFile, pos, node)) { - if (isFunctionBody(node) && isFunctionLikeDeclaration(parentNode) && !positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) { - pushSelectionRange(node.getStart(sourceFile), node.getEnd()); - } - if (isBlock(node) || isTemplateSpan(node) || isTemplateHead(node) || isTemplateTail(node) || prevNode && isTemplateHead(prevNode) || isVariableDeclarationList(node) && isVariableStatement(parentNode) || isSyntaxList(node) && isVariableDeclarationList(parentNode) || isVariableDeclaration(node) && isSyntaxList(parentNode) && children.length === 1 || isJSDocTypeExpression(node) || isJSDocSignature(node) || isJSDocTypeLiteral(node)) { - parentNode = node; - break; - } - if (isTemplateSpan(parentNode) && nextNode && isTemplateMiddleOrTemplateTail(nextNode)) { - const start2 = node.getFullStart() - "${".length; - const end2 = nextNode.getStart() + "}".length; - pushSelectionRange(start2, end2); - } - const isBetweenMultiLineBookends = isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) && !positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile); - let start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart(); - const end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node); - if (hasJSDocNodes(node) && ((_a = node.jsDoc) == null ? void 0 : _a.length)) { - pushSelectionRange(first(node.jsDoc).getStart(), end); - } - if (isSyntaxList(node)) { - const firstChild = node.getChildren()[0]; - if (firstChild && hasJSDocNodes(firstChild) && ((_b = firstChild.jsDoc) == null ? void 0 : _b.length) && firstChild.getStart() !== node.pos) { - start = Math.min(start, first(firstChild.jsDoc).getStart()); - } - } - pushSelectionRange(start, end); - if (isStringLiteral(node) || isTemplateLiteral(node)) { - pushSelectionRange(start + 1, end - 1); - } - parentNode = node; - break; - } - if (i === children.length - 1) { - break outer; - } - } - } - return selectionRange; - function pushSelectionRange(start, end) { - if (start !== end) { - const textSpan = createTextSpanFromBounds(start, end); - if (!selectionRange || // Skip ranges that are identical to the parent - !textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don't contain the original position - textSpanIntersectsWithPosition(textSpan, pos)) { - selectionRange = { textSpan, ...selectionRange && { parent: selectionRange } }; - } - } - } - function pushSelectionCommentRange(start, end) { - pushSelectionRange(start, end); - let pos2 = start; - while (sourceFile.text.charCodeAt(pos2) === 47 /* slash */) { - pos2++; - } - pushSelectionRange(pos2, end); - } -} -function positionShouldSnapToNode(sourceFile, pos, node) { - Debug.assert(node.pos <= pos); - if (pos < node.end) { - return true; - } - const nodeEnd = node.getEnd(); - if (nodeEnd === pos) { - return getTouchingPropertyName(sourceFile, pos).pos < node.end; - } - return false; -} -var isImport2 = or(isImportDeclaration, isImportEqualsDeclaration); -function getSelectionChildren(node) { - var _a; - if (isSourceFile(node)) { - return groupChildren(node.getChildAt(0).getChildren(), isImport2); - } - if (isMappedTypeNode(node)) { - const [openBraceToken, ...children] = node.getChildren(); - const closeBraceToken = Debug.checkDefined(children.pop()); - 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 === 169 /* TypeParameter */ || kind === 24 /* CloseBracketToken */); - return [ - openBraceToken, - // Pivot on `:` - createSyntaxList2(splitChildren(groupedWithBrackets, ({ kind }) => kind === 59 /* ColonToken */)), - closeBraceToken - ]; - } - 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) === 321 /* 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; - } - if (isParameter(node)) { - const groupedDotDotDotAndName = groupChildren(node.getChildren(), (child) => child === node.dotDotDotToken || child === node.name); - const groupedWithQuestionToken = groupChildren(groupedDotDotDotAndName, (child) => child === groupedDotDotDotAndName[0] || child === node.questionToken); - return splitChildren(groupedWithQuestionToken, ({ kind }) => kind === 64 /* EqualsToken */); - } - if (isBindingElement(node)) { - return splitChildren(node.getChildren(), ({ kind }) => kind === 64 /* EqualsToken */); - } - return node.getChildren(); -} -function groupChildren(children, groupOn) { - const result = []; - let group2; - for (const child of children) { - if (groupOn(child)) { - group2 = group2 || []; - group2.push(child); - } else { - if (group2) { - result.push(createSyntaxList2(group2)); - group2 = void 0; - } - result.push(child); - } - } - if (group2) { - result.push(createSyntaxList2(group2)); - } - return result; -} -function splitChildren(children, pivotOn, separateTrailingSemicolon = true) { - if (children.length < 2) { - return children; - } - const splitTokenIndex = findIndex(children, pivotOn); - if (splitTokenIndex === -1) { - return children; - } - const leftChildren = children.slice(0, splitTokenIndex); - const splitToken = children[splitTokenIndex]; - const lastToken = last(children); - const separateLastToken = separateTrailingSemicolon && lastToken.kind === 27 /* SemicolonToken */; - const rightChildren = children.slice(splitTokenIndex + 1, separateLastToken ? children.length - 1 : void 0); - const result = compact([ - leftChildren.length ? createSyntaxList2(leftChildren) : void 0, - splitToken, - rightChildren.length ? createSyntaxList2(rightChildren) : void 0 - ]); - return separateLastToken ? result.concat(lastToken) : result; -} -function createSyntaxList2(children) { - Debug.assertGreaterThanOrEqual(children.length, 1); - return setTextRangePosEnd(parseNodeFactory.createSyntaxList(children), children[0].pos, last(children).end); -} -function isListOpener(token) { - const kind = token && token.kind; - return kind === 19 /* OpenBraceToken */ || kind === 23 /* OpenBracketToken */ || kind === 21 /* OpenParenToken */ || kind === 287 /* JsxOpeningElement */; -} -function isListCloser(token) { - const kind = token && token.kind; - return kind === 20 /* CloseBraceToken */ || kind === 24 /* CloseBracketToken */ || kind === 22 /* CloseParenToken */ || kind === 288 /* JsxClosingElement */; -} -function getEndPos(sourceFile, node) { - switch (node.kind) { - case 342 /* JSDocParameterTag */: - case 339 /* JSDocCallbackTag */: - case 349 /* JSDocPropertyTag */: - case 347 /* JSDocTypedefTag */: - case 344 /* JSDocThisTag */: - return sourceFile.getLineEndOfPosition(node.getStart()); - default: - return node.getEnd(); - } -} - -// src/services/_namespaces/ts.SymbolDisplay.ts -var ts_SymbolDisplay_exports = {}; -__export(ts_SymbolDisplay_exports, { - getSymbolDisplayPartsDocumentationAndSymbolKind: () => getSymbolDisplayPartsDocumentationAndSymbolKind, - getSymbolKind: () => getSymbolKind, - getSymbolModifiers: () => getSymbolModifiers -}); - -// src/services/symbolDisplay.ts -var symbolDisplayNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; -function getSymbolKind(typeChecker, symbol, location) { - const result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); - if (result !== "" /* unknown */) { - return result; - } - const flags = getCombinedLocalAndExportSymbolFlags(symbol); - if (flags & 32 /* Class */) { - return getDeclarationOfKind(symbol, 232 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; - } - if (flags & 384 /* Enum */) return "enum" /* enumElement */; - if (flags & 524288 /* TypeAlias */) return "type" /* typeElement */; - if (flags & 64 /* Interface */) return "interface" /* interfaceElement */; - if (flags & 262144 /* TypeParameter */) return "type parameter" /* typeParameterElement */; - if (flags & 8 /* EnumMember */) return "enum member" /* enumMemberElement */; - if (flags & 2097152 /* Alias */) return "alias" /* alias */; - if (flags & 1536 /* Module */) return "module" /* moduleElement */; - return result; -} -function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) { - const roots = typeChecker.getRootSymbols(symbol); - if (roots.length === 1 && first(roots).flags & 8192 /* Method */ && typeChecker.getTypeOfSymbolAtLocation(symbol, location).getNonNullableType().getCallSignatures().length !== 0) { - return "method" /* memberFunctionElement */; - } - if (typeChecker.isUndefinedSymbol(symbol)) { - return "var" /* variableElement */; - } - if (typeChecker.isArgumentsSymbol(symbol)) { - return "local var" /* localVariableElement */; - } - if (location.kind === 110 /* ThisKeyword */ && isExpression(location) || isThisInTypeQuery(location)) { - return "parameter" /* parameterElement */; - } - const flags = getCombinedLocalAndExportSymbolFlags(symbol); - if (flags & 3 /* Variable */) { - if (isFirstDeclarationOfSymbolParameter(symbol)) { - 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 */; - } - return isLocalVariableOrFunction(symbol) ? "local var" /* localVariableElement */ : "var" /* variableElement */; - } - if (flags & 16 /* Function */) return isLocalVariableOrFunction(symbol) ? "local function" /* localFunctionElement */ : "function" /* functionElement */; - if (flags & 32768 /* GetAccessor */) return "getter" /* memberGetAccessorElement */; - if (flags & 65536 /* SetAccessor */) return "setter" /* memberSetAccessorElement */; - if (flags & 8192 /* Method */) return "method" /* memberFunctionElement */; - if (flags & 16384 /* Constructor */) return "constructor" /* constructorImplementationElement */; - if (flags & 131072 /* Signature */) return "index" /* indexSignatureElement */; - if (flags & 4 /* Property */) { - if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /* Synthetic */) { - const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), (rootSymbol) => { - const rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) { - return "property" /* memberVariableElement */; - } - }); - if (!unionPropertyKind) { - const typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); - if (typeOfUnionProperty.getCallSignatures().length) { - return "method" /* memberFunctionElement */; - } - return "property" /* memberVariableElement */; - } - return unionPropertyKind; - } - return "property" /* memberVariableElement */; - } - return "" /* unknown */; -} -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)) ? 65536 /* Deprecated */ : 0 /* None */; - const modifiers = getNodeModifiers(declaration, excludeFlags); - if (modifiers) { - return modifiers.split(","); - } - } - return []; -} -function getSymbolModifiers(typeChecker, symbol) { - if (!symbol) { - return "" /* none */; - } - const modifiers = new Set(getNormalizedSymbolModifiers(symbol)); - if (symbol.flags & 2097152 /* Alias */) { - const resolvedSymbol = typeChecker.getAliasedSymbol(symbol); - if (resolvedSymbol !== symbol) { - forEach(getNormalizedSymbolModifiers(resolvedSymbol), (modifier) => { - modifiers.add(modifier); - }); - } - } - if (symbol.flags & 16777216 /* Optional */) { - modifiers.add("optional" /* optionalModifier */); - } - return modifiers.size > 0 ? arrayFrom(modifiers.values()).join(",") : "" /* none */; -} -function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias, maximumLength, verbosityLevel) { - var _a; - const displayParts = []; - let documentation = []; - let tags = []; - const symbolFlags = getCombinedLocalAndExportSymbolFlags(symbol); - let symbolKind = semanticMeaning & 1 /* Value */ ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) : "" /* unknown */; - let hasAddedSymbolInfo = false; - const isThisExpression = location.kind === 110 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location); - let documentationFromAlias; - let tagsFromAlias; - let hasMultipleSignatures = false; - const typeWriterOut = { canIncreaseExpansionDepth: false, truncated: false }; - let symbolWasExpanded = false; - if (location.kind === 110 /* ThisKeyword */ && !isThisExpression) { - return { displayParts: [keywordPart(110 /* ThisKeyword */)], documentation: [], symbolKind: "primitive type" /* primitiveType */, tags: void 0 }; - } - if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) { - if (symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */) { - const declaration = find( - symbol.declarations, - (declaration2) => declaration2.name === location && declaration2.kind !== 212 /* PropertyAccessExpression */ - ); - if (declaration) { - switch (declaration.kind) { - case 178 /* GetAccessor */: - symbolKind = "getter" /* memberGetAccessorElement */; - break; - case 179 /* SetAccessor */: - symbolKind = "setter" /* memberSetAccessorElement */; - break; - case 173 /* PropertyDeclaration */: - symbolKind = "accessor" /* memberAccessorVariableElement */; - break; - default: - Debug.assertNever(declaration); - } - } else { - symbolKind = "property" /* memberVariableElement */; - } - } - let signature; - type ?? (type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location)); - if (location.parent && location.parent.kind === 212 /* PropertyAccessExpression */) { - const right = location.parent.name; - if (right === location || right && right.getFullWidth() === 0) { - location = location.parent; - } - } - let callExpressionLike; - if (isCallOrNewExpression(location)) { - callExpressionLike = location; - } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - callExpressionLike = location.parent; - } else if (location.parent && (isJsxOpeningLikeElement(location.parent) || isTaggedTemplateExpression(location.parent)) && isFunctionLike(symbol.valueDeclaration)) { - callExpressionLike = location.parent; - } - if (callExpressionLike) { - signature = typeChecker.getResolvedSignature(callExpressionLike); - const useConstructSignatures = callExpressionLike.kind === 215 /* 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; - } - if (signature) { - if (useConstructSignatures && symbolFlags & 32 /* Class */) { - symbolKind = "constructor" /* constructorImplementationElement */; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } else if (symbolFlags & 2097152 /* Alias */) { - symbolKind = "alias" /* alias */; - pushSymbolKind(symbolKind); - displayParts.push(spacePart()); - if (useConstructSignatures) { - if (signature.flags & 4 /* Abstract */) { - displayParts.push(keywordPart(128 /* AbstractKeyword */)); - displayParts.push(spacePart()); - } - displayParts.push(keywordPart(105 /* NewKeyword */)); - displayParts.push(spacePart()); - } - addFullSymbolName(symbol); - } else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - switch (symbolKind) { - case "JSX attribute" /* jsxAttribute */: - case "property" /* memberVariableElement */: - case "var" /* variableElement */: - case "const" /* constElement */: - case "let" /* letElement */: - case "parameter" /* parameterElement */: - case "local var" /* localVariableElement */: - displayParts.push(punctuationPart(59 /* ColonToken */)); - displayParts.push(spacePart()); - if (!(getObjectFlags(type) & 16 /* Anonymous */) && type.symbol) { - addRange(displayParts, symbolToDisplayParts( - typeChecker, - type.symbol, - enclosingDeclaration, - /*meaning*/ - void 0, - 4 /* AllowAnyNodeKind */ | 1 /* WriteTypeParametersOrArguments */ - )); - displayParts.push(lineBreakPart()); - } - if (useConstructSignatures) { - if (signature.flags & 4 /* Abstract */) { - displayParts.push(keywordPart(128 /* AbstractKeyword */)); - displayParts.push(spacePart()); - } - displayParts.push(keywordPart(105 /* NewKeyword */)); - displayParts.push(spacePart()); - } - addSignatureDisplayParts(signature, allSignatures, 262144 /* WriteArrowStyleSignature */); - break; - default: - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; - hasMultipleSignatures = allSignatures.length > 1; - } - } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || // name of function declaration - location.kind === 137 /* ConstructorKeyword */ && location.parent.kind === 177 /* 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 === 177 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); - } else { - signature = allSignatures[0]; - } - if (functionDeclaration.kind === 177 /* Constructor */) { - symbolKind = "constructor" /* constructorImplementationElement */; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } else { - addPrefixForAnyFunctionOrVar( - functionDeclaration.kind === 180 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, - symbolKind - ); - } - if (signature) { - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; - hasMultipleSignatures = allSignatures.length > 1; - } - } - } - if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { - addAliasPrefixIfNecessary(); - const classExpression = getDeclarationOfKind(symbol, 232 /* ClassExpression */); - if (classExpression) { - pushSymbolKind("local class" /* localClassElement */); - displayParts.push(spacePart()); - } - if (!tryExpandSymbol(symbol, semanticMeaning)) { - if (!classExpression) { - displayParts.push(keywordPart(86 /* ClassKeyword */)); - displayParts.push(spacePart()); - } - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - } - if (symbolFlags & 64 /* Interface */ && semanticMeaning & 2 /* Type */) { - prefixNextMeaning(); - if (!tryExpandSymbol(symbol, semanticMeaning)) { - displayParts.push(keywordPart(120 /* InterfaceKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - } - if (symbolFlags & 524288 /* TypeAlias */ && semanticMeaning & 2 /* Type */) { - prefixNextMeaning(); - displayParts.push(keywordPart(156 /* TypeKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - displayParts.push(spacePart()); - displayParts.push(operatorPart(64 /* EqualsToken */)); - displayParts.push(spacePart()); - addRange( - displayParts, - typeToDisplayParts( - typeChecker, - location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), - enclosingDeclaration, - 8388608 /* InTypeAlias */, - maximumLength, - verbosityLevel, - typeWriterOut - ) - ); - } - if (symbolFlags & 384 /* Enum */) { - prefixNextMeaning(); - if (!tryExpandSymbol(symbol, semanticMeaning)) { - if (some(symbol.declarations, (d) => isEnumDeclaration(d) && isEnumConst(d))) { - displayParts.push(keywordPart(87 /* ConstKeyword */)); - displayParts.push(spacePart()); - } - displayParts.push(keywordPart(94 /* EnumKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName( - symbol, - /*enclosingDeclaration*/ - void 0 - ); - } - } - if (symbolFlags & 1536 /* Module */ && !isThisExpression) { - prefixNextMeaning(); - if (!tryExpandSymbol(symbol, semanticMeaning)) { - const declaration = getDeclarationOfKind(symbol, 268 /* ModuleDeclaration */); - const isNamespace = declaration && declaration.name && declaration.name.kind === 80 /* Identifier */; - displayParts.push(keywordPart(isNamespace ? 145 /* NamespaceKeyword */ : 144 /* ModuleKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - } - } - if (symbolFlags & 262144 /* TypeParameter */ && semanticMeaning & 2 /* Type */) { - prefixNextMeaning(); - displayParts.push(punctuationPart(21 /* OpenParenToken */)); - displayParts.push(textPart("type parameter")); - displayParts.push(punctuationPart(22 /* CloseParenToken */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - if (symbol.parent) { - addInPrefix(); - addFullSymbolName(symbol.parent, enclosingDeclaration); - writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); - } else { - const decl = getDeclarationOfKind(symbol, 169 /* TypeParameter */); - if (decl === void 0) return Debug.fail(); - const declaration = decl.parent; - if (declaration) { - if (isFunctionLike(declaration)) { - addInPrefix(); - const signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 181 /* ConstructSignature */) { - displayParts.push(keywordPart(105 /* NewKeyword */)); - displayParts.push(spacePart()); - } else if (declaration.kind !== 180 /* CallSignature */ && declaration.name) { - addFullSymbolName(declaration.symbol); - } - addRange(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); - } else if (isTypeAliasDeclaration(declaration)) { - addInPrefix(); - displayParts.push(keywordPart(156 /* TypeKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(declaration.symbol); - writeTypeParametersOfSymbol(declaration.symbol, sourceFile); - } - } - } - } - if (symbolFlags & 8 /* EnumMember */) { - 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) === 307 /* 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 */)); - } - } - } - if (symbol.flags & 2097152 /* Alias */) { - prefixNextMeaning(); - if (!hasAddedSymbolInfo || documentation.length === 0 && tags.length === 0) { - const resolvedSymbol = typeChecker.getAliasedSymbol(symbol); - if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { - const resolvedNode = resolvedSymbol.declarations[0]; - const declarationName = getNameOfDeclaration(resolvedNode); - if (declarationName && !hasAddedSymbolInfo) { - const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode, 128 /* Ambient */); - const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; - const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker( - typeChecker, - resolvedSymbol, - getSourceFileOfNode(resolvedNode), - enclosingDeclaration, - declarationName, - type, - semanticMeaning, - shouldUseAliasName ? symbol : resolvedSymbol, - maximumLength, - verbosityLevel - ); - displayParts.push(...resolvedInfo.displayParts); - displayParts.push(lineBreakPart()); - documentationFromAlias = resolvedInfo.documentation; - tagsFromAlias = resolvedInfo.tags; - if (typeWriterOut && resolvedInfo.canIncreaseVerbosityLevel) { - typeWriterOut.canIncreaseExpansionDepth = true; - } - } else { - documentationFromAlias = resolvedSymbol.getContextualDocumentationComment(resolvedNode, typeChecker); - tagsFromAlias = resolvedSymbol.getJsDocTags(typeChecker); - } - } - } - if (symbol.declarations) { - switch (symbol.declarations[0].kind) { - case 271 /* NamespaceExportDeclaration */: - displayParts.push(keywordPart(95 /* ExportKeyword */)); - displayParts.push(spacePart()); - displayParts.push(keywordPart(145 /* NamespaceKeyword */)); - break; - case 278 /* ExportAssignment */: - displayParts.push(keywordPart(95 /* ExportKeyword */)); - displayParts.push(spacePart()); - displayParts.push(keywordPart(symbol.declarations[0].isExportEquals ? 64 /* EqualsToken */ : 90 /* DefaultKeyword */)); - break; - case 282 /* ExportSpecifier */: - displayParts.push(keywordPart(95 /* ExportKeyword */)); - break; - default: - displayParts.push(keywordPart(102 /* ImportKeyword */)); - } - } - displayParts.push(spacePart()); - addFullSymbolName(symbol); - forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 272 /* ImportEqualsDeclaration */) { - const importEqualsDeclaration = declaration; - if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { - displayParts.push(spacePart()); - displayParts.push(operatorPart(64 /* EqualsToken */)); - displayParts.push(spacePart()); - displayParts.push(keywordPart(149 /* RequireKeyword */)); - displayParts.push(punctuationPart(21 /* OpenParenToken */)); - displayParts.push(displayPart(getTextOfNode(getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), 8 /* stringLiteral */)); - displayParts.push(punctuationPart(22 /* CloseParenToken */)); - } else { - const internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); - if (internalAliasSymbol) { - displayParts.push(spacePart()); - displayParts.push(operatorPart(64 /* EqualsToken */)); - displayParts.push(spacePart()); - addFullSymbolName(internalAliasSymbol, enclosingDeclaration); - } - } - return true; - } - }); - } - if (!hasAddedSymbolInfo) { - if (symbolKind !== "" /* unknown */) { - if (type) { - if (isThisExpression) { - prefixNextMeaning(); - displayParts.push(keywordPart(110 /* ThisKeyword */)); - } 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 */ || 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 */) { - const typeParameterParts = mapToDisplayParts((writer) => { - const param = typeChecker.typeParameterToDeclaration( - type, - enclosingDeclaration, - symbolDisplayNodeBuilderFlags, - /*internalFlags*/ - void 0, - /*tracker*/ - void 0, - maximumLength, - verbosityLevel, - typeWriterOut - ); - getPrinter().writeNode(4 /* Unspecified */, param, getSourceFileOfNode(getParseTreeNode(enclosingDeclaration)), writer); - }, maximumLength); - addRange(displayParts, typeParameterParts); - } else { - addRange( - displayParts, - typeToDisplayParts( - typeChecker, - type, - enclosingDeclaration, - /*flags*/ - void 0, - maximumLength, - verbosityLevel, - typeWriterOut - ) - ); - } - if (isTransientSymbol(symbol) && symbol.links.target && isTransientSymbol(symbol.links.target) && symbol.links.target.links.tupleLabelDeclaration) { - const labelDecl = symbol.links.target.links.tupleLabelDeclaration; - Debug.assertNode(labelDecl.name, isIdentifier); - displayParts.push(spacePart()); - displayParts.push(punctuationPart(21 /* OpenParenToken */)); - displayParts.push(textPart(idText(labelDecl.name))); - displayParts.push(punctuationPart(22 /* CloseParenToken */)); - } - } else if (symbolFlags & 16 /* Function */ || symbolFlags & 8192 /* Method */ || symbolFlags & 16384 /* Constructor */ || symbolFlags & 131072 /* Signature */ || symbolFlags & 98304 /* Accessor */ || symbolKind === "method" /* memberFunctionElement */) { - const allSignatures = type.getNonNullableType().getCallSignatures(); - if (allSignatures.length) { - addSignatureDisplayParts(allSignatures[0], allSignatures); - hasMultipleSignatures = allSignatures.length > 1; - } - } - } - } else { - symbolKind = getSymbolKind(typeChecker, symbol, location); - } - } - if (documentation.length === 0 && !hasMultipleSignatures) { - documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker); - } - if (documentation.length === 0 && symbolFlags & 4 /* Property */) { - if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 308 /* SourceFile */)) { - for (const declaration of symbol.declarations) { - if (!declaration.parent || declaration.parent.kind !== 227 /* BinaryExpression */) { - continue; - } - const rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); - if (!rhsSymbol) { - continue; - } - documentation = rhsSymbol.getDocumentationComment(typeChecker); - tags = rhsSymbol.getJsDocTags(typeChecker); - if (documentation.length > 0) { - break; - } - } - } - } - if (documentation.length === 0 && isIdentifier(location) && symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration)) { - const declaration = symbol.valueDeclaration; - const parent2 = declaration.parent; - 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(propertyName); - return prop ? prop.getDocumentationComment(typeChecker) : void 0; - }) || emptyArray; - } - } - if (tags.length === 0 && !hasMultipleSignatures && !isInJSDoc(location)) { - tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker); - } - if (documentation.length === 0 && documentationFromAlias) { - documentation = documentationFromAlias; - } - if (tags.length === 0 && tagsFromAlias) { - tags = tagsFromAlias; - } - const canIncreaseVerbosityLevel = !typeWriterOut.truncated && typeWriterOut.canIncreaseExpansionDepth; - return { - displayParts, - documentation, - symbolKind, - tags: tags.length === 0 ? void 0 : tags, - canIncreaseVerbosityLevel: verbosityLevel !== void 0 ? canIncreaseVerbosityLevel : void 0 - }; - function getPrinter() { - return createPrinterWithRemoveComments(); - } - function prefixNextMeaning() { - if (displayParts.length) { - displayParts.push(lineBreakPart()); - } - addAliasPrefixIfNecessary(); - } - function addAliasPrefixIfNecessary() { - if (alias) { - pushSymbolKind("alias" /* alias */); - displayParts.push(spacePart()); - } - } - function addInPrefix() { - displayParts.push(spacePart()); - displayParts.push(keywordPart(103 /* InKeyword */)); - displayParts.push(spacePart()); - } - function canExpandSymbol(symbol2, out) { - if (verbosityLevel === void 0) { - return false; - } - const type2 = symbol2.flags & (32 /* Class */ | 64 /* Interface */) ? typeChecker.getDeclaredTypeOfSymbol(symbol2) : typeChecker.getTypeOfSymbolAtLocation(symbol2, location); - if (!type2 || typeChecker.isLibType(type2)) { - return false; - } - if (0 < verbosityLevel) { - return true; - } - if (out) { - out.canIncreaseExpansionDepth = true; - } - return false; - } - function semanticToSymbolMeaning(meaning) { - let symbolMeaning = 0 /* None */; - if (meaning & 1 /* Value */) { - symbolMeaning |= 111551 /* Value */; - } - if (meaning & 2 /* Type */) { - symbolMeaning |= 788968 /* Type */; - } - if (meaning & 4 /* Namespace */) { - symbolMeaning |= 1920 /* Namespace */; - } - return symbolMeaning; - } - function tryExpandSymbol(symbol2, meaning) { - if (symbolWasExpanded) { - return true; - } - if (canExpandSymbol(symbol2, typeWriterOut)) { - const symbolMeaning = semanticToSymbolMeaning(meaning); - const expandedDisplayParts = mapToDisplayParts((writer) => { - const nodes = typeChecker.getEmitResolver().symbolToDeclarations( - symbol2, - symbolMeaning, - 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, - maximumLength, - verbosityLevel !== void 0 ? verbosityLevel - 1 : void 0, - typeWriterOut - ); - const printer = getPrinter(); - const sourceFile2 = symbol2.valueDeclaration && getSourceFileOfNode(symbol2.valueDeclaration); - nodes.forEach((node, i) => { - if (i > 0) writer.writeLine(); - printer.writeNode(4 /* Unspecified */, node, sourceFile2, writer); - }); - }, maximumLength); - addRange(displayParts, expandedDisplayParts); - symbolWasExpanded = true; - return true; - } - return false; - } - function addFullSymbolName(symbolToDisplay, enclosingDeclaration2) { - let indexInfos; - if (alias && symbolToDisplay === symbol) { - symbolToDisplay = alias; - } - if (symbolKind === "index" /* indexSignatureElement */) { - indexInfos = typeChecker.getIndexInfosOfIndexSymbol(symbolToDisplay); - } - let fullSymbolDisplayParts = []; - if (symbolToDisplay.flags & 131072 /* Signature */ && indexInfos) { - if (symbolToDisplay.parent) { - fullSymbolDisplayParts = symbolToDisplayParts(typeChecker, symbolToDisplay.parent); - } - fullSymbolDisplayParts.push(punctuationPart(23 /* OpenBracketToken */)); - indexInfos.forEach((info, i) => { - fullSymbolDisplayParts.push(...typeToDisplayParts(typeChecker, info.keyType)); - if (i !== indexInfos.length - 1) { - fullSymbolDisplayParts.push(spacePart()); - fullSymbolDisplayParts.push(punctuationPart(52 /* BarToken */)); - fullSymbolDisplayParts.push(spacePart()); - } - }); - fullSymbolDisplayParts.push(punctuationPart(24 /* CloseBracketToken */)); - } else { - fullSymbolDisplayParts = symbolToDisplayParts( - typeChecker, - symbolToDisplay, - enclosingDeclaration2 || sourceFile, - /*meaning*/ - void 0, - 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */ | 4 /* AllowAnyNodeKind */ - ); - } - addRange(displayParts, fullSymbolDisplayParts); - if (symbol.flags & 16777216 /* Optional */) { - displayParts.push(punctuationPart(58 /* QuestionToken */)); - } - } - function addPrefixForAnyFunctionOrVar(symbol2, symbolKind2) { - prefixNextMeaning(); - if (symbolKind2) { - pushSymbolKind(symbolKind2); - if (symbol2 && !some(symbol2.declarations, (d) => isArrowFunction(d) || (isFunctionExpression(d) || isClassExpression(d)) && !d.name)) { - displayParts.push(spacePart()); - addFullSymbolName(symbol2); - } - } - } - function pushSymbolKind(symbolKind2) { - switch (symbolKind2) { - case "var" /* variableElement */: - case "function" /* functionElement */: - case "let" /* letElement */: - case "const" /* constElement */: - case "constructor" /* constructorImplementationElement */: - case "using" /* variableUsingElement */: - case "await using" /* variableAwaitUsingElement */: - displayParts.push(textOrKeywordPart(symbolKind2)); - return; - default: - displayParts.push(punctuationPart(21 /* OpenParenToken */)); - displayParts.push(textOrKeywordPart(symbolKind2)); - displayParts.push(punctuationPart(22 /* CloseParenToken */)); - return; - } - } - function addSignatureDisplayParts(signature, allSignatures, flags = 0 /* None */) { - addRange(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */, maximumLength, verbosityLevel, typeWriterOut)); - if (allSignatures.length > 1) { - displayParts.push(spacePart()); - displayParts.push(punctuationPart(21 /* OpenParenToken */)); - displayParts.push(operatorPart(40 /* PlusToken */)); - displayParts.push(displayPart((allSignatures.length - 1).toString(), 7 /* numericLiteral */)); - displayParts.push(spacePart()); - displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); - displayParts.push(punctuationPart(22 /* CloseParenToken */)); - } - documentation = signature.getDocumentationComment(typeChecker); - tags = signature.getJsDocTags(); - if (allSignatures.length > 1 && documentation.length === 0 && tags.length === 0) { - documentation = allSignatures[0].getDocumentationComment(typeChecker); - tags = allSignatures[0].getJsDocTags().filter((tag) => tag.name !== "deprecated"); - } - } - function writeTypeParametersOfSymbol(symbol2, enclosingDeclaration2) { - const typeParameterParts = mapToDisplayParts((writer) => { - const params = typeChecker.symbolToTypeParameterDeclarations(symbol2, enclosingDeclaration2, symbolDisplayNodeBuilderFlags); - getPrinter().writeList(53776 /* TypeParameters */, params, getSourceFileOfNode(getParseTreeNode(enclosingDeclaration2)), writer); - }); - addRange(displayParts, typeParameterParts); - } -} -function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias, maximumLength, verbosityLevel) { - return getSymbolDisplayPartsDocumentationAndSymbolKindWorker( - typeChecker, - symbol, - sourceFile, - enclosingDeclaration, - location, - /*type*/ - void 0, - semanticMeaning, - alias, - maximumLength, - verbosityLevel - ); -} -function isLocalVariableOrFunction(symbol) { - if (symbol.parent) { - return false; - } - return forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 219 /* FunctionExpression */) { - return true; - } - if (declaration.kind !== 261 /* VariableDeclaration */ && declaration.kind !== 263 /* FunctionDeclaration */) { - return false; - } - for (let parent2 = declaration.parent; !isFunctionBlock(parent2); parent2 = parent2.parent) { - if (parent2.kind === 308 /* SourceFile */ || parent2.kind === 269 /* ModuleBlock */) { - return false; - } - } - return true; - }); -} - -// src/services/_namespaces/ts.textChanges.ts -var ts_textChanges_exports = {}; -__export(ts_textChanges_exports, { - ChangeTracker: () => ChangeTracker, - LeadingTriviaOption: () => LeadingTriviaOption, - TrailingTriviaOption: () => TrailingTriviaOption, - applyChanges: () => applyChanges, - assignPositionsToNode: () => assignPositionsToNode, - createWriter: () => createWriter, - deleteNode: () => deleteNode, - getAdjustedEndPosition: () => getAdjustedEndPosition, - isThisTypeAnnotatable: () => isThisTypeAnnotatable, - isValidLocationToAddComment: () => isValidLocationToAddComment -}); - -// src/services/textChanges.ts -function getPos2(n) { - const result = n.__pos; - Debug.assert(typeof result === "number"); - return result; -} -function setPos(n, pos) { - Debug.assert(typeof pos === "number"); - n.__pos = pos; -} -function getEnd(n) { - const result = n.__end; - Debug.assert(typeof result === "number"); - return result; -} -function setEnd(n, end) { - Debug.assert(typeof end === "number"); - n.__end = end; -} -var LeadingTriviaOption = /* @__PURE__ */ ((LeadingTriviaOption2) => { - LeadingTriviaOption2[LeadingTriviaOption2["Exclude"] = 0] = "Exclude"; - LeadingTriviaOption2[LeadingTriviaOption2["IncludeAll"] = 1] = "IncludeAll"; - LeadingTriviaOption2[LeadingTriviaOption2["JSDoc"] = 2] = "JSDoc"; - LeadingTriviaOption2[LeadingTriviaOption2["StartLine"] = 3] = "StartLine"; - return LeadingTriviaOption2; -})(LeadingTriviaOption || {}); -var TrailingTriviaOption = /* @__PURE__ */ ((TrailingTriviaOption2) => { - TrailingTriviaOption2[TrailingTriviaOption2["Exclude"] = 0] = "Exclude"; - TrailingTriviaOption2[TrailingTriviaOption2["ExcludeWhitespace"] = 1] = "ExcludeWhitespace"; - TrailingTriviaOption2[TrailingTriviaOption2["Include"] = 2] = "Include"; - return TrailingTriviaOption2; -})(TrailingTriviaOption || {}); -function skipWhitespacesAndLineBreaks(text, start) { - return skipTrivia( - text, - start, - /*stopAfterLineBreak*/ - false, - /*stopAtComments*/ - true - ); -} -function hasCommentsBeforeLineBreak(text, start) { - let i = start; - while (i < text.length) { - const ch = text.charCodeAt(i); - if (isWhiteSpaceSingleLine(ch)) { - i++; - continue; - } - return ch === 47 /* slash */; - } - return false; -} -var useNonAdjustedPositions = { - leadingTriviaOption: 0 /* Exclude */, - trailingTriviaOption: 0 /* Exclude */ -}; -function getAdjustedRange(sourceFile, startNode2, endNode2, options) { - return { pos: getAdjustedStartPosition(sourceFile, startNode2, options), end: getAdjustedEndPosition(sourceFile, endNode2, options) }; -} -function getAdjustedStartPosition(sourceFile, node, options, hasTrailingComment = false) { - var _a, _b; - const { leadingTriviaOption } = options; - if (leadingTriviaOption === 0 /* Exclude */) { - return node.getStart(sourceFile); - } - if (leadingTriviaOption === 3 /* StartLine */) { - const startPos = node.getStart(sourceFile); - const pos = getLineStartPositionForPosition(startPos, sourceFile); - return rangeContainsPosition(node, pos) ? pos : startPos; - } - if (leadingTriviaOption === 2 /* JSDoc */) { - const JSDocComments = getJSDocCommentRanges(node, sourceFile.text); - if (JSDocComments == null ? void 0 : JSDocComments.length) { - return getLineStartPositionForPosition(JSDocComments[0].pos, sourceFile); - } - } - const fullStart = node.getFullStart(); - const start = node.getStart(sourceFile); - if (fullStart === start) { - return start; - } - const fullStartLine = getLineStartPositionForPosition(fullStart, sourceFile); - const startLine = getLineStartPositionForPosition(start, sourceFile); - if (startLine === fullStartLine) { - return leadingTriviaOption === 1 /* IncludeAll */ ? fullStart : start; - } - if (hasTrailingComment) { - const comment = ((_a = getLeadingCommentRanges(sourceFile.text, fullStart)) == null ? void 0 : _a[0]) || ((_b = getTrailingCommentRanges(sourceFile.text, fullStart)) == null ? void 0 : _b[0]); - if (comment) { - return skipTrivia( - sourceFile.text, - comment.end, - /*stopAfterLineBreak*/ - true, - /*stopAtComments*/ - true - ); - } - } - const nextLineStart = fullStart > 0 ? 1 : 0; - let adjustedStartPosition = getStartPositionOfLine(getLineOfLocalPosition(sourceFile, fullStartLine) + nextLineStart, sourceFile); - adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); - return getStartPositionOfLine(getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); -} -function getEndPositionOfMultilineTrailingComment(sourceFile, node, options) { - const { end } = node; - const { trailingTriviaOption } = options; - if (trailingTriviaOption === 2 /* Include */) { - const comments = getTrailingCommentRanges(sourceFile.text, end); - if (comments) { - const nodeEndLine = getLineOfLocalPosition(sourceFile, node.end); - for (const comment of comments) { - if (comment.kind === 2 /* SingleLineCommentTrivia */ || getLineOfLocalPosition(sourceFile, comment.pos) > nodeEndLine) { - break; - } - const commentEndLine = getLineOfLocalPosition(sourceFile, comment.end); - if (commentEndLine > nodeEndLine) { - return skipTrivia( - sourceFile.text, - comment.end, - /*stopAfterLineBreak*/ - true, - /*stopAtComments*/ - true - ); - } - } - } - } - return void 0; -} -function getAdjustedEndPosition(sourceFile, node, options) { - var _a; - const { end } = node; - const { trailingTriviaOption } = options; - if (trailingTriviaOption === 0 /* Exclude */) { - return end; - } - if (trailingTriviaOption === 1 /* ExcludeWhitespace */) { - const comments = concatenate(getTrailingCommentRanges(sourceFile.text, end), getLeadingCommentRanges(sourceFile.text, end)); - const realEnd = (_a = comments == null ? void 0 : comments[comments.length - 1]) == null ? void 0 : _a.end; - if (realEnd) { - return realEnd; - } - return end; - } - const multilineEndPosition = getEndPositionOfMultilineTrailingComment(sourceFile, node, options); - if (multilineEndPosition) { - return multilineEndPosition; - } - const newEnd = skipTrivia( - sourceFile.text, - end, - /*stopAfterLineBreak*/ - true - ); - 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 === 211 /* ObjectLiteralExpression */); -} -function isThisTypeAnnotatable(containingFunction) { - return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction); -} -var ChangeTracker = class _ChangeTracker { - /** Public for tests only. Other callers should use `ChangeTracker.with`. */ - constructor(newLineCharacter, formatContext) { - this.newLineCharacter = newLineCharacter; - this.formatContext = formatContext; - this.changes = []; - this.classesWithNodesInsertedAtStart = /* @__PURE__ */ new Map(); - // Set implemented as Map - this.deletedNodes = []; - } - static fromContext(context) { - return new _ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); - } - static with(context, cb) { - const tracker = _ChangeTracker.fromContext(context); - cb(tracker); - return tracker.getChanges(); - } - pushRaw(sourceFile, change) { - Debug.assertEqual(sourceFile.fileName, change.fileName); - for (const c of change.textChanges) { - this.changes.push({ - kind: 3 /* Text */, - sourceFile, - text: c.newText, - range: createTextRangeFromSpan(c.span) - }); - } - } - deleteRange(sourceFile, range) { - this.changes.push({ kind: 0 /* Remove */, sourceFile, range }); - } - delete(sourceFile, node) { - this.deletedNodes.push({ sourceFile, node }); - } - /** Stop! Consider using `delete` instead, which has logic for deleting nodes from delimited lists. */ - deleteNode(sourceFile, node, options = { leadingTriviaOption: 1 /* IncludeAll */ }) { - this.deleteRange(sourceFile, getAdjustedRange(sourceFile, node, node, options)); - } - deleteNodes(sourceFile, nodes, options = { leadingTriviaOption: 1 /* IncludeAll */ }, hasTrailingComment) { - for (const node of nodes) { - const pos = getAdjustedStartPosition(sourceFile, node, options, hasTrailingComment); - const end = getAdjustedEndPosition(sourceFile, node, options); - this.deleteRange(sourceFile, { pos, end }); - hasTrailingComment = !!getEndPositionOfMultilineTrailingComment(sourceFile, node, options); - } - } - deleteModifier(sourceFile, modifier) { - this.deleteRange(sourceFile, { pos: modifier.getStart(sourceFile), end: skipTrivia( - sourceFile.text, - modifier.end, - /*stopAfterLineBreak*/ - true - ) }); - } - deleteNodeRange(sourceFile, startNode2, endNode2, options = { leadingTriviaOption: 1 /* IncludeAll */ }) { - const startPosition = getAdjustedStartPosition(sourceFile, startNode2, options); - const endPosition = getAdjustedEndPosition(sourceFile, endNode2, options); - this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); - } - deleteNodeRangeExcludingEnd(sourceFile, startNode2, afterEndNode, options = { leadingTriviaOption: 1 /* IncludeAll */ }) { - const startPosition = getAdjustedStartPosition(sourceFile, startNode2, options); - const endPosition = afterEndNode === void 0 ? sourceFile.text.length : getAdjustedStartPosition(sourceFile, afterEndNode, options); - this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); - } - replaceRange(sourceFile, range, newNode, options = {}) { - this.changes.push({ kind: 1 /* ReplaceWithSingleNode */, sourceFile, range, options, node: newNode }); - } - replaceNode(sourceFile, oldNode, newNode, options = useNonAdjustedPositions) { - this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); - } - replaceNodeRange(sourceFile, startNode2, endNode2, newNode, options = useNonAdjustedPositions) { - this.replaceRange(sourceFile, getAdjustedRange(sourceFile, startNode2, endNode2, options), newNode, options); - } - replaceRangeWithNodes(sourceFile, range, newNodes, options = {}) { - this.changes.push({ kind: 2 /* ReplaceWithMultipleNodes */, sourceFile, range, options, nodes: newNodes }); - } - replaceNodeWithNodes(sourceFile, oldNode, newNodes, options = useNonAdjustedPositions) { - this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); - } - replaceNodeWithText(sourceFile, oldNode, text) { - this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, useNonAdjustedPositions), text); - } - replaceNodeRangeWithNodes(sourceFile, startNode2, endNode2, newNodes, options = useNonAdjustedPositions) { - this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode2, endNode2, options), newNodes, options); - } - nodeHasTrailingComment(sourceFile, oldNode, configurableEnd = useNonAdjustedPositions) { - return !!getEndPositionOfMultilineTrailingComment(sourceFile, oldNode, configurableEnd); - } - nextCommaToken(sourceFile, node) { - const next = findNextToken(node, node.parent, sourceFile); - return next && next.kind === 28 /* CommaToken */ ? next : void 0; - } - replacePropertyAssignment(sourceFile, oldNode, newNode) { - const suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : "," + this.newLineCharacter; - this.replaceNode(sourceFile, oldNode, newNode, { suffix }); - } - insertNodeAt(sourceFile, pos, newNode, options = {}) { - this.replaceRange(sourceFile, createRange(pos), newNode, options); - } - insertNodesAt(sourceFile, pos, newNodes, options = {}) { - this.replaceRangeWithNodes(sourceFile, createRange(pos), newNodes, options); - } - insertNodeAtTopOfFile(sourceFile, newNode, blankLineBetween) { - this.insertAtTopOfFile(sourceFile, newNode, blankLineBetween); - } - insertNodesAtTopOfFile(sourceFile, newNodes, blankLineBetween) { - this.insertAtTopOfFile(sourceFile, newNodes, blankLineBetween); - } - insertAtTopOfFile(sourceFile, insert, blankLineBetween) { - const pos = getInsertionPositionAtSourceFileTop(sourceFile); - const options = { - prefix: pos === 0 ? void 0 : this.newLineCharacter, - suffix: (isLineBreak(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : "") - }; - if (isArray(insert)) { - this.insertNodesAt(sourceFile, pos, insert, options); - } else { - this.insertNodeAt(sourceFile, pos, insert, options); - } - } - insertNodesAtEndOfFile(sourceFile, newNodes, blankLineBetween) { - this.insertAtEndOfFile(sourceFile, newNodes, blankLineBetween); - } - insertAtEndOfFile(sourceFile, insert, blankLineBetween) { - const pos = sourceFile.end + 1; - const options = { - prefix: this.newLineCharacter, - suffix: this.newLineCharacter + (blankLineBetween ? this.newLineCharacter : "") - }; - this.insertNodesAt(sourceFile, pos, insert, options); - } - insertStatementsInNewFile(fileName, statements, oldFile) { - if (!this.newFileChanges) { - this.newFileChanges = createMultiMap(); - } - this.newFileChanges.add(fileName, { oldFile, statements }); - } - insertFirstParameter(sourceFile, parameters, newParam) { - const p0 = firstOrUndefined(parameters); - if (p0) { - this.insertNodeBefore(sourceFile, p0, newParam); - } else { - this.insertNodeAt(sourceFile, parameters.pos, newParam); - } - } - 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); - } - insertModifierBefore(sourceFile, modifier, before) { - return this.insertModifierAt(sourceFile, before.getStart(sourceFile), modifier, { suffix: " " }); - } - insertCommentBeforeLine(sourceFile, lineNumber, position, commentText) { - const lineStartPosition = getStartPositionOfLine(lineNumber, sourceFile); - const startPosition = getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); - const insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition); - const token = getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position); - 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) { - const fnStart = node.getStart(sourceFile); - if (node.jsDoc) { - for (const jsdoc of node.jsDoc) { - this.deleteRange(sourceFile, { - pos: getLineStartPositionForPosition(jsdoc.getStart(sourceFile), sourceFile), - end: getAdjustedEndPosition( - sourceFile, - jsdoc, - /*options*/ - {} - ) - }); - } - } - const startPosition = getPrecedingNonSpaceCharacterPosition(sourceFile.text, fnStart - 1); - 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); - const jsDoc = singleOrUndefined(node.jsDoc); - return jsDoc && positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && length(comments) === 0 ? void 0 : factory.createNodeArray(intersperse(comments, factory.createJSDocText("\n"))); - } - replaceJSDocComment(sourceFile, node, tags) { - this.insertJsdocCommentBefore(sourceFile, updateJSDocHost(node), factory.createJSDocComment(this.createJSDocText(sourceFile, node), factory.createNodeArray(tags))); - } - 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; - }) - ); - this.replaceJSDocComment(sourceFile, parent2, [...oldTags, ...unmergedNewTags]); - } - filterJSDocTags(sourceFile, parent2, predicate) { - this.replaceJSDocComment(sourceFile, parent2, filter(flatMapToMutable(parent2.jsDoc, (j) => j.tags), predicate)); - } - replaceRangeWithText(sourceFile, range, text) { - this.changes.push({ kind: 3 /* Text */, sourceFile, range, text }); - } - insertText(sourceFile, pos, text) { - this.replaceRangeWithText(sourceFile, createRange(pos), text); - } - /** Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node. */ - tryInsertTypeAnnotation(sourceFile, node, type) { - let endNode2; - if (isFunctionLike(node)) { - endNode2 = findChildOfKind(node, 22 /* CloseParenToken */, sourceFile); - if (!endNode2) { - if (!isArrowFunction(node)) return false; - endNode2 = first(node.parameters); - } - } else { - endNode2 = (node.kind === 261 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name; - } - this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " }); - return true; - } - tryInsertThisTypeAnnotation(sourceFile, node, type) { - const start = findChildOfKind(node, 21 /* OpenParenToken */, sourceFile).getStart(sourceFile) + 1; - const suffix = node.parameters.length ? ", " : ""; - this.insertNodeAt(sourceFile, start, type, { prefix: "this: ", suffix }); - } - insertTypeParameters(sourceFile, node, typeParameters) { - const start = (findChildOfKind(node, 21 /* OpenParenToken */, sourceFile) || first(node.parameters)).getStart(sourceFile); - this.insertNodesAt(sourceFile, start, typeParameters, { prefix: "<", suffix: ">", joiner: ", " }); - } - getOptionsForInsertNodeBefore(before, inserted, blankLineBetween) { - if (isStatement(before) || isClassElement(before)) { - return { suffix: blankLineBetween ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; - } else if (isVariableDeclaration(before)) { - return { suffix: ", " }; - } else if (isParameter(before)) { - return isParameter(inserted) ? { suffix: ", " } : {}; - } else if (isStringLiteral(before) && isImportDeclaration(before.parent) || isNamedImports(before)) { - return { suffix: ", " }; - } else if (isImportSpecifier(before)) { - return { suffix: "," + (blankLineBetween ? this.newLineCharacter : " ") }; - } - return Debug.failBadSyntaxKind(before); - } - insertNodeAtConstructorStart(sourceFile, ctr, newStatement) { - const firstStatement = firstOrUndefined(ctr.body.statements); - if (!firstStatement || !ctr.body.multiLine) { - this.replaceConstructorBody(sourceFile, ctr, [newStatement, ...ctr.body.statements]); - } else { - this.insertNodeBefore(sourceFile, firstStatement, newStatement); - } - } - insertNodeAtConstructorStartAfterSuperCall(sourceFile, ctr, newStatement) { - const superCallStatement = find(ctr.body.statements, (stmt) => isExpressionStatement(stmt) && isSuperCall(stmt.expression)); - if (!superCallStatement || !ctr.body.multiLine) { - this.replaceConstructorBody(sourceFile, ctr, [...ctr.body.statements, newStatement]); - } else { - this.insertNodeAfter(sourceFile, superCallStatement, newStatement); - } - } - insertNodeAtConstructorEnd(sourceFile, ctr, newStatement) { - const lastStatement = lastOrUndefined(ctr.body.statements); - if (!lastStatement || !ctr.body.multiLine) { - this.replaceConstructorBody(sourceFile, ctr, [...ctr.body.statements, newStatement]); - } else { - this.insertNodeAfter(sourceFile, lastStatement, newStatement); - } - } - replaceConstructorBody(sourceFile, ctr, statements) { - this.replaceNode(sourceFile, ctr.body, factory.createBlock( - statements, - /*multiLine*/ - true - )); - } - insertNodeAtEndOfScope(sourceFile, scope, newNode) { - const pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}); - this.insertNodeAt(sourceFile, pos, newNode, { - prefix: isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, - suffix: this.newLineCharacter - }); - } - insertMemberAtStart(sourceFile, node, newElement) { - this.insertNodeAtStartWorker(sourceFile, node, newElement); - } - insertNodeAtObjectStart(sourceFile, obj, newElement) { - this.insertNodeAtStartWorker(sourceFile, obj, newElement); - } - insertNodeAtStartWorker(sourceFile, node, newElement) { - const indentation = this.guessIndentationFromExistingMembers(sourceFile, node) ?? this.computeIndentationForNewMember(sourceFile, node); - this.insertNodeAt(sourceFile, getMembersOrProperties(node).pos, newElement, this.getInsertNodeAtStartInsertOptions(sourceFile, node, indentation)); - } - /** - * Tries to guess the indentation from the existing members of a class/interface/object. All members must be on - * new lines and must share the same indentation. - */ - guessIndentationFromExistingMembers(sourceFile, node) { - let indentation; - let lastRange = node; - for (const member of getMembersOrProperties(node)) { - if (rangeStartPositionsAreOnSameLine(lastRange, member, sourceFile)) { - return void 0; - } - const memberStart = member.getStart(sourceFile); - const memberIndentation = ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(getLineStartPositionForPosition(memberStart, sourceFile), memberStart, sourceFile, this.formatContext.options); - if (indentation === void 0) { - indentation = memberIndentation; - } else if (memberIndentation !== indentation) { - return void 0; - } - lastRange = member; - } - return indentation; - } - computeIndentationForNewMember(sourceFile, node) { - const nodeStart = node.getStart(sourceFile); - return ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(getLineStartPositionForPosition(nodeStart, sourceFile), nodeStart, sourceFile, this.formatContext.options) + (this.formatContext.options.indentSize ?? 4); - } - getInsertNodeAtStartInsertOptions(sourceFile, node, indentation) { - const members = getMembersOrProperties(node); - const isEmpty = members.length === 0; - const isFirstInsertion = !this.classesWithNodesInsertedAtStart.has(getNodeId(node)); - if (isFirstInsertion) { - this.classesWithNodesInsertedAtStart.set(getNodeId(node), { node, sourceFile }); - } - const insertTrailingComma = isObjectLiteralExpression(node) && (!isJsonSourceFile(sourceFile) || !isEmpty); - const insertLeadingComma = isObjectLiteralExpression(node) && isJsonSourceFile(sourceFile) && isEmpty && !isFirstInsertion; - return { - indentation, - prefix: (insertLeadingComma ? "," : "") + this.newLineCharacter, - suffix: insertTrailingComma ? "," : isInterfaceDeclaration(node) && isEmpty ? ";" : "" - }; - } - insertNodeAfterComma(sourceFile, after, newNode) { - const endPosition = this.insertNodeAfterWorker(sourceFile, this.nextCommaToken(sourceFile, after) || after, newNode); - this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after)); - } - insertNodeAfter(sourceFile, after, newNode) { - const endPosition = this.insertNodeAfterWorker(sourceFile, after, newNode); - this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after)); - } - insertNodeAtEndOfList(sourceFile, list, newNode) { - this.insertNodeAt(sourceFile, list.end, newNode, { prefix: ", " }); - } - insertNodesAfter(sourceFile, after, newNodes) { - const endPosition = this.insertNodeAfterWorker(sourceFile, after, first(newNodes)); - this.insertNodesAt(sourceFile, endPosition, newNodes, this.getInsertNodeAfterOptions(sourceFile, after)); - } - insertNodeAfterWorker(sourceFile, after, newNode) { - if (needSemicolonBetween(after, newNode)) { - if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { - this.replaceRange(sourceFile, createRange(after.end), factory.createToken(27 /* SemicolonToken */)); - } - } - const endPosition = getAdjustedEndPosition(sourceFile, after, {}); - return endPosition; - } - getInsertNodeAfterOptions(sourceFile, after) { - const options = this.getInsertNodeAfterOptionsWorker(after); - return { - ...options, - prefix: after.end === sourceFile.end && isStatement(after) ? options.prefix ? ` -${options.prefix}` : "\n" : options.prefix - }; - } - getInsertNodeAfterOptionsWorker(node) { - switch (node.kind) { - case 264 /* ClassDeclaration */: - case 268 /* ModuleDeclaration */: - return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 261 /* VariableDeclaration */: - case 11 /* StringLiteral */: - case 80 /* Identifier */: - return { prefix: ", " }; - case 304 /* PropertyAssignment */: - return { suffix: "," + this.newLineCharacter }; - case 95 /* ExportKeyword */: - return { prefix: " " }; - case 170 /* Parameter */: - return {}; - default: - Debug.assert(isStatement(node) || isClassOrTypeElement(node)); - return { suffix: this.newLineCharacter }; - } - } - insertName(sourceFile, node, name) { - Debug.assert(!node.name); - if (node.kind === 220 /* ArrowFunction */) { - const arrow = findChildOfKind(node, 39 /* EqualsGreaterThanToken */, sourceFile); - const lparen = findChildOfKind(node, 21 /* OpenParenToken */, sourceFile); - if (lparen) { - this.insertNodesAt(sourceFile, lparen.getStart(sourceFile), [factory.createToken(100 /* FunctionKeyword */), factory.createIdentifier(name)], { joiner: " " }); - deleteNode(this, sourceFile, arrow); - } else { - this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name}(`); - this.replaceRange(sourceFile, arrow, factory.createToken(22 /* CloseParenToken */)); - } - if (node.body.kind !== 242 /* 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 === 219 /* FunctionExpression */ ? 100 /* FunctionKeyword */ : 86 /* ClassKeyword */, sourceFile).end; - this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name), { prefix: " " }); - } - } - insertExportModifier(sourceFile, node) { - this.insertText(sourceFile, node.getStart(sourceFile), "export "); - } - insertImportSpecifierAtIndex(sourceFile, importSpecifier, namedImports, index) { - const prevSpecifier = namedImports.elements[index - 1]; - if (prevSpecifier) { - this.insertNodeInListAfter(sourceFile, prevSpecifier, importSpecifier); - } else { - this.insertNodeBefore( - sourceFile, - namedImports.elements[0], - importSpecifier, - !positionsAreOnSameLine(namedImports.elements[0].getStart(), namedImports.parent.parent.getStart(), sourceFile) - ); - } - } - /** - * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, - * i.e. arguments in arguments lists, parameters in parameter lists etc. - * Note that separators are part of the node in statements and class elements. - */ - insertNodeInListAfter(sourceFile, after, newNode, containingList = ts_formatting_exports.SmartIndenter.getContainingList(after, sourceFile)) { - if (!containingList) { - Debug.fail("node is not a list element"); - return; - } - const index = indexOfNode(containingList, after); - if (index < 0) { - return; - } - const end = after.getEnd(); - if (index !== containingList.length - 1) { - const nextToken = getTokenAtPosition(sourceFile, after.end); - if (nextToken && isSeparator(after, nextToken)) { - const nextNode = containingList[index + 1]; - const startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart()); - const suffix = `${tokenToString(nextToken.kind)}${sourceFile.text.substring(nextToken.end, startPos)}`; - this.insertNodesAt(sourceFile, startPos, [newNode], { suffix }); - } - } else { - const afterStart = after.getStart(sourceFile); - const afterStartLinePosition = getLineStartPositionForPosition(afterStart, sourceFile); - let separator; - let multilineList = false; - if (containingList.length === 1) { - separator = 28 /* CommaToken */; - } else { - const tokenBeforeInsertPosition = findPrecedingToken(after.pos, sourceFile); - separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 28 /* CommaToken */; - const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile); - multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; - } - if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) { - multilineList = true; - } - if (multilineList) { - this.replaceRange(sourceFile, createRange(end), factory.createToken(separator)); - const indentation = ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.formatContext.options); - let insertPos = skipTrivia( - sourceFile.text, - end, - /*stopAfterLineBreak*/ - true, - /*stopAtComments*/ - false - ); - while (insertPos !== end && isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) { - insertPos--; - } - this.replaceRange(sourceFile, createRange(insertPos), newNode, { indentation, prefix: this.newLineCharacter }); - } else { - this.replaceRange(sourceFile, createRange(end), newNode, { prefix: `${tokenToString(separator)} ` }); - } - } - } - parenthesizeExpression(sourceFile, expression) { - this.replaceRange(sourceFile, rangeOfNode(expression), factory.createParenthesizedExpression(expression)); - } - finishClassesWithNodesInsertedAtStart() { - this.classesWithNodesInsertedAtStart.forEach(({ node, sourceFile }) => { - const [openBraceEnd, closeBraceEnd] = getClassOrObjectBraceEnds(node, sourceFile); - if (openBraceEnd !== void 0 && closeBraceEnd !== void 0) { - const isEmpty = getMembersOrProperties(node).length === 0; - const isSingleLine = positionsAreOnSameLine(openBraceEnd, closeBraceEnd, sourceFile); - if (isEmpty && isSingleLine && openBraceEnd !== closeBraceEnd - 1) { - this.deleteRange(sourceFile, createRange(openBraceEnd, closeBraceEnd - 1)); - } - if (isSingleLine) { - this.insertText(sourceFile, closeBraceEnd - 1, this.newLineCharacter); - } - } - }); - } - finishDeleteDeclarations() { - const deletedNodesInLists = /* @__PURE__ */ new Set(); - for (const { sourceFile, node } of this.deletedNodes) { - if (!this.deletedNodes.some((d) => d.sourceFile === sourceFile && rangeContainsRangeExclusive(d.node, node))) { - if (isArray(node)) { - this.deleteRange(sourceFile, rangeOfTypeParameters(sourceFile, node)); - } else { - deleteDeclaration.deleteDeclaration(this, deletedNodesInLists, sourceFile, node); - } - } - } - deletedNodesInLists.forEach((node) => { - const sourceFile = node.getSourceFile(); - const list = ts_formatting_exports.SmartIndenter.getContainingList(node, sourceFile); - if (node !== last(list)) return; - const lastNonDeletedIndex = findLastIndex(list, (n) => !deletedNodesInLists.has(n), list.length - 2); - if (lastNonDeletedIndex !== -1) { - this.deleteRange(sourceFile, { pos: list[lastNonDeletedIndex].end, end: startPositionToDeleteNodeInList(sourceFile, list[lastNonDeletedIndex + 1]) }); - } - }); - } - /** - * Note: after calling this, the TextChanges object must be discarded! - * @param validate only for tests - * The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions, - * so we can only call this once and can't get the non-formatted text separately. - */ - getChanges(validate) { - this.finishDeleteDeclarations(); - this.finishClassesWithNodesInsertedAtStart(); - const changes = changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate); - if (this.newFileChanges) { - this.newFileChanges.forEach((insertions, fileName) => { - changes.push(changesToText.newFileChanges(fileName, insertions, this.newLineCharacter, this.formatContext)); - }); - } - return changes; - } - createNewFile(oldFile, fileName, statements) { - this.insertStatementsInNewFile(fileName, statements, oldFile); - } -}; -function updateJSDocHost(parent2) { - if (parent2.kind !== 220 /* ArrowFunction */) { - return parent2; - } - const jsDocNode = parent2.parent.kind === 173 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; - jsDocNode.jsDoc = parent2.jsDoc; - return jsDocNode; -} -function tryMergeJsdocTags(oldTag, newTag) { - if (oldTag.kind !== newTag.kind) { - return void 0; - } - switch (oldTag.kind) { - case 342 /* JSDocParameterTag */: { - const oldParam = oldTag; - const newParam = newTag; - return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag( - /*tagName*/ - void 0, - newParam.name, - /*isBracketed*/ - false, - newParam.typeExpression, - newParam.isNameFirst, - oldParam.comment - ) : void 0; - } - case 343 /* JSDocReturnTag */: - return factory.createJSDocReturnTag( - /*tagName*/ - void 0, - newTag.typeExpression, - oldTag.comment - ); - case 345 /* JSDocTypeTag */: - return factory.createJSDocTypeTag( - /*tagName*/ - void 0, - newTag.typeExpression, - oldTag.comment - ); - } -} -function startPositionToDeleteNodeInList(sourceFile, node) { - return skipTrivia( - sourceFile.text, - getAdjustedStartPosition(sourceFile, node, { leadingTriviaOption: 1 /* IncludeAll */ }), - /*stopAfterLineBreak*/ - false, - /*stopAtComments*/ - true - ); -} -function endPositionToDeleteNodeInList(sourceFile, node, prevNode, nextNode) { - const end = startPositionToDeleteNodeInList(sourceFile, nextNode); - if (prevNode === void 0 || positionsAreOnSameLine(getAdjustedEndPosition(sourceFile, node, {}), end, sourceFile)) { - return end; - } - const token = findPrecedingToken(nextNode.getStart(sourceFile), sourceFile); - if (isSeparator(node, token)) { - const prevToken = findPrecedingToken(node.getStart(sourceFile), sourceFile); - if (isSeparator(prevNode, prevToken)) { - const pos = skipTrivia( - sourceFile.text, - token.getEnd(), - /*stopAfterLineBreak*/ - true, - /*stopAtComments*/ - true - ); - if (positionsAreOnSameLine(prevToken.getStart(sourceFile), token.getStart(sourceFile), sourceFile)) { - return isLineBreak(sourceFile.text.charCodeAt(pos - 1)) ? pos - 1 : pos; - } - if (isLineBreak(sourceFile.text.charCodeAt(pos))) { - return pos; - } - } - } - return end; -} -function getClassOrObjectBraceEnds(cls, sourceFile) { - const open = findChildOfKind(cls, 19 /* OpenBraceToken */, sourceFile); - const close = findChildOfKind(cls, 20 /* CloseBraceToken */, sourceFile); - return [open == null ? void 0 : open.end, close == null ? void 0 : close.end]; -} -function getMembersOrProperties(node) { - return isObjectLiteralExpression(node) ? node.properties : node.members; -} -var changesToText; -((changesToText2) => { - function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate) { - return mapDefined(group(changes, (c) => c.sourceFile.path), (changesInFile) => { - const sourceFile = changesInFile[0].sourceFile; - const normalized = toSorted(changesInFile, (a, b) => a.range.pos - b.range.pos || a.range.end - b.range.end); - for (let i = 0; i < normalized.length - 1; i++) { - Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", () => `${JSON.stringify(normalized[i].range)} and ${JSON.stringify(normalized[i + 1].range)}`); - } - const textChanges2 = mapDefined(normalized, (c) => { - const span = createTextSpanFromRange(c.range); - const targetSourceFile = c.kind === 1 /* ReplaceWithSingleNode */ ? getSourceFileOfNode(getOriginalNode(c.node)) ?? c.sourceFile : c.kind === 2 /* ReplaceWithMultipleNodes */ ? getSourceFileOfNode(getOriginalNode(c.nodes[0])) ?? c.sourceFile : c.sourceFile; - const newText = computeNewText(c, targetSourceFile, sourceFile, newLineCharacter, formatContext, validate); - if (span.length === newText.length && stringContainsAt(targetSourceFile.text, newText, span.start)) { - return void 0; - } - return createTextChange(span, newText); - }); - return textChanges2.length > 0 ? { fileName: sourceFile.fileName, textChanges: textChanges2 } : void 0; - }); - } - changesToText2.getTextChangesFromChanges = getTextChangesFromChanges; - function newFileChanges(fileName, insertions, newLineCharacter, formatContext) { - const text = newFileChangesWorker(getScriptKindFromFileName(fileName), insertions, newLineCharacter, formatContext); - return { fileName, textChanges: [createTextChange(createTextSpan(0, 0), text)], isNewFile: true }; - } - changesToText2.newFileChanges = newFileChanges; - function newFileChangesWorker(scriptKind, insertions, newLineCharacter, formatContext) { - const nonFormattedText = flatMap(insertions, (insertion) => insertion.statements.map((s) => s === 4 /* NewLineTrivia */ ? "" : getNonformattedText(s, insertion.oldFile, newLineCharacter).text)).join(newLineCharacter); - const sourceFile = createSourceFile( - "any file name", - nonFormattedText, - { languageVersion: 99 /* ESNext */, jsDocParsingMode: 1 /* ParseNone */ }, - /*setParentNodes*/ - true, - scriptKind - ); - const changes = ts_formatting_exports.formatDocument(sourceFile, formatContext); - return applyChanges(nonFormattedText, changes) + newLineCharacter; - } - changesToText2.newFileChangesWorker = newFileChangesWorker; - function computeNewText(change, targetSourceFile, sourceFile, newLineCharacter, formatContext, validate) { - var _a; - if (change.kind === 0 /* Remove */) { - return ""; - } - if (change.kind === 3 /* Text */) { - return change.text; - } - const { options = {}, range: { pos } } = change; - const format = (n) => getFormattedTextOfNode(n, targetSourceFile, sourceFile, pos, options, newLineCharacter, formatContext, validate); - const text = change.kind === 2 /* ReplaceWithMultipleNodes */ ? change.nodes.map((n) => removeSuffix(format(n), newLineCharacter)).join(((_a = change.options) == null ? void 0 : _a.joiner) || newLineCharacter) : format(change.node); - const noIndent = options.indentation !== void 0 || getLineStartPositionForPosition(pos, targetSourceFile) === pos ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + noIndent + (!options.suffix || endsWith(noIndent, options.suffix) ? "" : options.suffix); - } - function getFormattedTextOfNode(nodeIn, targetSourceFile, sourceFile, pos, { indentation, prefix, delta }, newLineCharacter, formatContext, validate) { - const { node, text } = getNonformattedText(nodeIn, targetSourceFile, newLineCharacter); - if (validate) validate(node, text); - const formatOptions = getFormatCodeSettingsForWriting(formatContext, targetSourceFile); - const initialIndentation = indentation !== void 0 ? indentation : ts_formatting_exports.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, prefix === newLineCharacter || getLineStartPositionForPosition(pos, targetSourceFile) === pos); - if (delta === void 0) { - delta = ts_formatting_exports.SmartIndenter.shouldIndentChildNode(formatOptions, nodeIn) ? formatOptions.indentSize || 0 : 0; - } - const file = { - text, - getLineAndCharacterOfPosition(pos2) { - return getLineAndCharacterOfPosition(this, pos2); - } - }; - const changes = ts_formatting_exports.formatNodeGivenIndentation(node, file, targetSourceFile.languageVariant, initialIndentation, delta, { ...formatContext, options: formatOptions }); - return applyChanges(text, changes); - } - function getNonformattedText(node, sourceFile, newLineCharacter) { - const writer = createWriter(newLineCharacter); - const newLine = getNewLineKind(newLineCharacter); - createPrinter({ - newLine, - neverAsciiEscape: true, - preserveSourceNewlines: true, - terminateUnterminatedLiterals: true - }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); - return { text: writer.getText(), node: assignPositionsToNode(node) }; - } - changesToText2.getNonformattedText = getNonformattedText; -})(changesToText || (changesToText = {})); -function applyChanges(text, changes) { - for (let i = changes.length - 1; i >= 0; i--) { - const { span, newText } = changes[i]; - text = `${text.substring(0, span.start)}${newText}${text.substring(textSpanEnd(span))}`; - } - return text; -} -function isTrivia2(s) { - return skipTrivia(s, 0) === s.length; -} -var textChangesTransformationContext = { - ...nullTransformationContext, - factory: createNodeFactory( - nullTransformationContext.factory.flags | 1 /* NoParenthesizerRules */, - nullTransformationContext.factory.baseFactory - ) -}; -function assignPositionsToNode(node) { - const visited = visitEachChild(node, assignPositionsToNode, textChangesTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); - const newNode = nodeIsSynthesized(visited) ? visited : Object.create(visited); - setTextRangePosEnd(newNode, getPos2(node), getEnd(node)); - return newNode; -} -function assignPositionsToNodeArray(nodes, visitor, test, start, count) { - const visited = visitNodes2(nodes, visitor, test, start, count); - if (!visited) { - return visited; - } - Debug.assert(nodes); - const nodeArray = visited === nodes ? factory.createNodeArray(visited.slice(0)) : visited; - setTextRangePosEnd(nodeArray, getPos2(nodes), getEnd(nodes)); - return nodeArray; -} -function createWriter(newLine) { - let lastNonTriviaPosition = 0; - const writer = createTextWriter(newLine); - const onBeforeEmitNode = (node) => { - if (node) { - setPos(node, lastNonTriviaPosition); - } - }; - const onAfterEmitNode = (node) => { - if (node) { - setEnd(node, lastNonTriviaPosition); - } - }; - const onBeforeEmitNodeArray = (nodes) => { - if (nodes) { - setPos(nodes, lastNonTriviaPosition); - } - }; - const onAfterEmitNodeArray = (nodes) => { - if (nodes) { - setEnd(nodes, lastNonTriviaPosition); - } - }; - const onBeforeEmitToken = (node) => { - if (node) { - setPos(node, lastNonTriviaPosition); - } - }; - const onAfterEmitToken = (node) => { - if (node) { - setEnd(node, lastNonTriviaPosition); - } - }; - function setLastNonTriviaPosition(s, force) { - if (force || !isTrivia2(s)) { - lastNonTriviaPosition = writer.getTextPos(); - let i = 0; - while (isWhiteSpaceLike(s.charCodeAt(s.length - i - 1))) { - i++; - } - lastNonTriviaPosition -= i; - } - } - function write(s) { - writer.write(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeComment(s) { - writer.writeComment(s); - } - function writeKeyword(s) { - writer.writeKeyword(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeOperator(s) { - writer.writeOperator(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writePunctuation(s) { - writer.writePunctuation(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeTrailingSemicolon(s) { - writer.writeTrailingSemicolon(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeParameter(s) { - writer.writeParameter(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeProperty(s) { - writer.writeProperty(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeSpace(s) { - writer.writeSpace(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeStringLiteral(s) { - writer.writeStringLiteral(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeSymbol(s, sym) { - writer.writeSymbol(s, sym); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeLine(force) { - writer.writeLine(force); - } - function increaseIndent() { - writer.increaseIndent(); - } - function decreaseIndent() { - writer.decreaseIndent(); - } - function getText() { - return writer.getText(); - } - function rawWrite(s) { - writer.rawWrite(s); - setLastNonTriviaPosition( - s, - /*force*/ - false - ); - } - function writeLiteral(s) { - writer.writeLiteral(s); - setLastNonTriviaPosition( - s, - /*force*/ - true - ); - } - function getTextPos() { - return writer.getTextPos(); - } - function getLine() { - return writer.getLine(); - } - function getColumn() { - return writer.getColumn(); - } - function getIndent() { - return writer.getIndent(); - } - function isAtStartOfLine() { - return writer.isAtStartOfLine(); - } - function clear2() { - writer.clear(); - lastNonTriviaPosition = 0; - } - return { - onBeforeEmitNode, - onAfterEmitNode, - onBeforeEmitNodeArray, - onAfterEmitNodeArray, - onBeforeEmitToken, - onAfterEmitToken, - write, - writeComment, - writeKeyword, - writeOperator, - writePunctuation, - writeTrailingSemicolon, - writeParameter, - writeProperty, - writeSpace, - writeStringLiteral, - writeSymbol, - writeLine, - increaseIndent, - decreaseIndent, - getText, - rawWrite, - writeLiteral, - getTextPos, - getLine, - getColumn, - getIndent, - isAtStartOfLine, - hasTrailingComment: () => writer.hasTrailingComment(), - hasTrailingWhitespace: () => writer.hasTrailingWhitespace(), - clear: clear2 - }; -} -function getInsertionPositionAtSourceFileTop(sourceFile) { - let lastPrologue; - for (const node of sourceFile.statements) { - if (isPrologueDirective(node)) { - lastPrologue = node; - } else { - break; - } - } - let position = 0; - const text = sourceFile.text; - if (lastPrologue) { - position = lastPrologue.end; - advancePastLineBreak(); - return position; - } - const shebang = getShebang(text); - if (shebang !== void 0) { - position = shebang.length; - advancePastLineBreak(); - } - const ranges = getLeadingCommentRanges(text, position); - if (!ranges) return position; - let lastComment; - let firstNodeLine; - for (const range of ranges) { - if (range.kind === 3 /* MultiLineCommentTrivia */) { - if (isPinnedComment(text, range.pos)) { - lastComment = { range, pinnedOrTripleSlash: true }; - continue; - } - } else if (isRecognizedTripleSlashComment(text, range.pos, range.end)) { - lastComment = { range, pinnedOrTripleSlash: true }; - continue; - } - if (lastComment) { - if (lastComment.pinnedOrTripleSlash) break; - const commentLine = sourceFile.getLineAndCharacterOfPosition(range.pos).line; - const lastCommentEndLine = sourceFile.getLineAndCharacterOfPosition(lastComment.range.end).line; - if (commentLine >= lastCommentEndLine + 2) break; - } - if (sourceFile.statements.length) { - if (firstNodeLine === void 0) firstNodeLine = sourceFile.getLineAndCharacterOfPosition(sourceFile.statements[0].getStart()).line; - const commentEndLine = sourceFile.getLineAndCharacterOfPosition(range.end).line; - if (firstNodeLine < commentEndLine + 2) break; - } - lastComment = { range, pinnedOrTripleSlash: false }; - } - if (lastComment) { - position = lastComment.range.end; - advancePastLineBreak(); - } - return position; - function advancePastLineBreak() { - if (position < text.length) { - const charCode = text.charCodeAt(position); - if (isLineBreak(charCode)) { - position++; - if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) { - position++; - } - } - } - } -} -function isValidLocationToAddComment(sourceFile, position) { - 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 === 168 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b); -} -var deleteDeclaration; -((_deleteDeclaration) => { - function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) { - switch (node.kind) { - case 170 /* Parameter */: { - const oldFunction = node.parent; - if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 21 /* OpenParenToken */, sourceFile)) { - changes.replaceNodeWithText(sourceFile, node, "()"); - } else { - deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); - } - break; - } - case 273 /* ImportDeclaration */: - case 272 /* 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 209 /* BindingElement */: - const pattern = node.parent; - const preserveComma = pattern.kind === 208 /* ArrayBindingPattern */ && node !== last(pattern.elements); - if (preserveComma) { - deleteNode(changes, sourceFile, node); - } else { - deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); - } - break; - case 261 /* VariableDeclaration */: - deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); - break; - case 169 /* TypeParameter */: - deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); - break; - case 277 /* ImportSpecifier */: - const namedImports = node.parent; - if (namedImports.elements.length === 1) { - deleteImportBinding(changes, sourceFile, namedImports); - } else { - deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); - } - break; - case 275 /* NamespaceImport */: - deleteImportBinding(changes, sourceFile, node); - break; - case 27 /* SemicolonToken */: - deleteNode(changes, sourceFile, node, { trailingTriviaOption: 0 /* Exclude */ }); - break; - case 100 /* FunctionKeyword */: - deleteNode(changes, sourceFile, node, { leadingTriviaOption: 0 /* Exclude */ }); - break; - case 264 /* ClassDeclaration */: - case 263 /* FunctionDeclaration */: - deleteNode(changes, sourceFile, node, { leadingTriviaOption: hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ }); - break; - default: - if (!node.parent) { - deleteNode(changes, sourceFile, node); - } else if (isImportClause(node.parent) && node.parent.name === node) { - deleteDefaultImport(changes, sourceFile, node.parent); - } else if (isCallExpression(node.parent) && contains(node.parent.arguments, node)) { - deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); - } else { - deleteNode(changes, sourceFile, node); - } - } - } - _deleteDeclaration.deleteDeclaration = deleteDeclaration2; - function deleteDefaultImport(changes, sourceFile, importClause) { - if (!importClause.namedBindings) { - deleteNode(changes, sourceFile, importClause.parent); - } else { - const start = importClause.name.getStart(sourceFile); - const nextToken = getTokenAtPosition(sourceFile, importClause.name.end); - if (nextToken && nextToken.kind === 28 /* CommaToken */) { - const end = skipTrivia( - sourceFile.text, - nextToken.end, - /*stopAfterLineBreak*/ - false, - /*stopAtComments*/ - true - ); - changes.deleteRange(sourceFile, { pos: start, end }); - } else { - deleteNode(changes, sourceFile, importClause.name); - } - } - } - function deleteImportBinding(changes, sourceFile, node) { - if (node.parent.name) { - const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1)); - changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end }); - } else { - const importDecl = getAncestor(node, 273 /* ImportDeclaration */); - deleteNode(changes, sourceFile, importDecl); - } - } - function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { - const { parent: parent2 } = node; - if (parent2.kind === 300 /* CatchClause */) { - changes.deleteNodeRange(sourceFile, findChildOfKind(parent2, 21 /* OpenParenToken */, sourceFile), findChildOfKind(parent2, 22 /* CloseParenToken */, sourceFile)); - return; - } - if (parent2.declarations.length !== 1) { - deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); - return; - } - const gp = parent2.parent; - switch (gp.kind) { - case 251 /* ForOfStatement */: - case 250 /* ForInStatement */: - changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression()); - break; - case 249 /* ForStatement */: - deleteNode(changes, sourceFile, parent2); - break; - case 244 /* VariableStatement */: - deleteNode(changes, sourceFile, gp, { leadingTriviaOption: hasJSDocNodes(gp) ? 2 /* JSDoc */ : 3 /* StartLine */ }); - break; - default: - Debug.assertNever(gp); - } - } -})(deleteDeclaration || (deleteDeclaration = {})); -function deleteNode(changes, sourceFile, node, options = { leadingTriviaOption: 1 /* IncludeAll */ }) { - const startPosition = getAdjustedStartPosition(sourceFile, node, options); - const endPosition = getAdjustedEndPosition(sourceFile, node, options); - changes.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); -} -function deleteNodeInList(changes, deletedNodesInLists, sourceFile, node) { - const containingList = Debug.checkDefined(ts_formatting_exports.SmartIndenter.getContainingList(node, sourceFile)); - const index = indexOfNode(containingList, node); - Debug.assert(index !== -1); - if (containingList.length === 1) { - deleteNode(changes, sourceFile, node); - return; - } - Debug.assert(!deletedNodesInLists.has(node), "Deleting a node twice"); - deletedNodesInLists.add(node); - changes.deleteRange(sourceFile, { - pos: startPositionToDeleteNodeInList(sourceFile, node), - end: index === containingList.length - 1 ? getAdjustedEndPosition(sourceFile, node, {}) : endPositionToDeleteNodeInList(sourceFile, node, containingList[index - 1], containingList[index + 1]) - }); -} - -// src/services/_namespaces/ts.formatting.ts -var ts_formatting_exports = {}; -__export(ts_formatting_exports, { - FormattingContext: () => FormattingContext, - FormattingRequestKind: () => FormattingRequestKind, - RuleAction: () => RuleAction, - RuleFlags: () => RuleFlags, - SmartIndenter: () => SmartIndenter, - anyContext: () => anyContext, - createTextRangeWithKind: () => createTextRangeWithKind, - formatDocument: () => formatDocument, - formatNodeGivenIndentation: () => formatNodeGivenIndentation, - formatOnClosingCurly: () => formatOnClosingCurly, - formatOnEnter: () => formatOnEnter, - formatOnOpeningCurly: () => formatOnOpeningCurly, - formatOnSemicolon: () => formatOnSemicolon, - formatSelection: () => formatSelection, - getAllRules: () => getAllRules, - getFormatContext: () => getFormatContext, - getFormattingScanner: () => getFormattingScanner, - getIndentationString: () => getIndentationString, - getRangeOfEnclosingComment: () => getRangeOfEnclosingComment -}); - -// src/services/formatting/formattingContext.ts -var FormattingRequestKind = /* @__PURE__ */ ((FormattingRequestKind2) => { - FormattingRequestKind2[FormattingRequestKind2["FormatDocument"] = 0] = "FormatDocument"; - FormattingRequestKind2[FormattingRequestKind2["FormatSelection"] = 1] = "FormatSelection"; - FormattingRequestKind2[FormattingRequestKind2["FormatOnEnter"] = 2] = "FormatOnEnter"; - FormattingRequestKind2[FormattingRequestKind2["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; - FormattingRequestKind2[FormattingRequestKind2["FormatOnOpeningCurlyBrace"] = 4] = "FormatOnOpeningCurlyBrace"; - FormattingRequestKind2[FormattingRequestKind2["FormatOnClosingCurlyBrace"] = 5] = "FormatOnClosingCurlyBrace"; - return FormattingRequestKind2; -})(FormattingRequestKind || {}); -var FormattingContext = class { - constructor(sourceFile, formattingRequestKind, options) { - this.sourceFile = sourceFile; - this.formattingRequestKind = formattingRequestKind; - this.options = options; - } - updateContext(currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { - this.currentTokenSpan = Debug.checkDefined(currentRange); - this.currentTokenParent = Debug.checkDefined(currentTokenParent); - this.nextTokenSpan = Debug.checkDefined(nextRange); - this.nextTokenParent = Debug.checkDefined(nextTokenParent); - this.contextNode = Debug.checkDefined(commonParent); - this.contextNodeAllOnSameLine = void 0; - this.nextNodeAllOnSameLine = void 0; - this.tokensAreOnSameLine = void 0; - this.contextNodeBlockIsOnOneLine = void 0; - this.nextNodeBlockIsOnOneLine = void 0; - } - ContextNodeAllOnSameLine() { - if (this.contextNodeAllOnSameLine === void 0) { - this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); - } - return this.contextNodeAllOnSameLine; - } - NextNodeAllOnSameLine() { - if (this.nextNodeAllOnSameLine === void 0) { - this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeAllOnSameLine; - } - TokensAreOnSameLine() { - if (this.tokensAreOnSameLine === void 0) { - const startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line; - const endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line; - this.tokensAreOnSameLine = startLine === endLine; - } - return this.tokensAreOnSameLine; - } - ContextNodeBlockIsOnOneLine() { - if (this.contextNodeBlockIsOnOneLine === void 0) { - this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); - } - return this.contextNodeBlockIsOnOneLine; - } - NextNodeBlockIsOnOneLine() { - if (this.nextNodeBlockIsOnOneLine === void 0) { - this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeBlockIsOnOneLine; - } - NodeIsOnOneLine(node) { - const startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line; - const endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; - return startLine === endLine; - } - BlockIsOnOneLine(node) { - const openBrace = findChildOfKind(node, 19 /* OpenBraceToken */, this.sourceFile); - const closeBrace = findChildOfKind(node, 20 /* CloseBraceToken */, this.sourceFile); - if (openBrace && closeBrace) { - const startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; - const endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; - return startLine === endLine; - } - return false; - } -}; - -// src/services/formatting/formattingScanner.ts -var standardScanner = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - false, - 0 /* Standard */ -); -var jsxScanner = createScanner( - 99 /* Latest */, - /*skipTrivia*/ - false, - 1 /* JSX */ -); -function getFormattingScanner(text, languageVariant, startPos, endPos, cb) { - const scanner2 = languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner; - scanner2.setText(text); - scanner2.resetTokenState(startPos); - let wasNewLine = true; - let leadingTrivia; - let trailingTrivia; - let savedPos; - let lastScanAction; - let lastTokenInfo; - const res = cb({ - advance, - readTokenInfo, - readEOFTokenRange, - isOnToken, - isOnEOF, - getCurrentLeadingTrivia: () => leadingTrivia, - lastTrailingTriviaWasNewLine: () => wasNewLine, - skipToEndOf, - skipToStartOf, - getTokenFullStart: () => (lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) ?? scanner2.getTokenStart(), - getStartPos: () => (lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) ?? scanner2.getTokenStart() - }); - lastTokenInfo = void 0; - scanner2.setText(void 0); - return res; - function advance() { - lastTokenInfo = void 0; - const isStarted = scanner2.getTokenFullStart() !== startPos; - if (isStarted) { - wasNewLine = !!trailingTrivia && last(trailingTrivia).kind === 4 /* NewLineTrivia */; - } else { - scanner2.scan(); - } - leadingTrivia = void 0; - trailingTrivia = void 0; - let pos = scanner2.getTokenFullStart(); - while (pos < endPos) { - const t = scanner2.getToken(); - if (!isTrivia(t)) { - break; - } - scanner2.scan(); - const item = { - pos, - end: scanner2.getTokenFullStart(), - kind: t - }; - pos = scanner2.getTokenFullStart(); - leadingTrivia = append(leadingTrivia, item); - } - savedPos = scanner2.getTokenFullStart(); - } - function shouldRescanGreaterThanToken(node) { - switch (node.kind) { - case 34 /* GreaterThanEqualsToken */: - case 72 /* GreaterThanGreaterThanEqualsToken */: - case 73 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 50 /* GreaterThanGreaterThanGreaterThanToken */: - case 49 /* GreaterThanGreaterThanToken */: - return true; - } - return false; - } - function shouldRescanJsxIdentifier(node) { - if (node.parent) { - switch (node.parent.kind) { - case 292 /* JsxAttribute */: - case 287 /* JsxOpeningElement */: - case 288 /* JsxClosingElement */: - case 286 /* JsxSelfClosingElement */: - return isKeyword(node.kind) || node.kind === 80 /* Identifier */; - } - } - return false; - } - function shouldRescanJsxText(node) { - return isJsxText(node) || isJsxElement(node) && (lastTokenInfo == null ? void 0 : lastTokenInfo.token.kind) === 12 /* JsxText */; - } - function shouldRescanSlashToken(container) { - return container.kind === 14 /* RegularExpressionLiteral */; - } - function shouldRescanTemplateToken(container) { - return container.kind === 17 /* TemplateMiddle */ || container.kind === 18 /* TemplateTail */; - } - function shouldRescanJsxAttributeValue(node) { - return node.parent && isJsxAttribute(node.parent) && node.parent.initializer === node; - } - function startsWithSlashToken(t) { - return t === 44 /* SlashToken */ || t === 69 /* SlashEqualsToken */; - } - function readTokenInfo(n) { - Debug.assert(isOnToken()); - const expectedScanAction = shouldRescanGreaterThanToken(n) ? 1 /* RescanGreaterThanToken */ : shouldRescanSlashToken(n) ? 2 /* RescanSlashToken */ : shouldRescanTemplateToken(n) ? 3 /* RescanTemplateToken */ : shouldRescanJsxIdentifier(n) ? 4 /* RescanJsxIdentifier */ : shouldRescanJsxText(n) ? 5 /* RescanJsxText */ : shouldRescanJsxAttributeValue(n) ? 6 /* RescanJsxAttributeValue */ : 0 /* Scan */; - if (lastTokenInfo && expectedScanAction === lastScanAction) { - return fixTokenKind(lastTokenInfo, n); - } - if (scanner2.getTokenFullStart() !== savedPos) { - Debug.assert(lastTokenInfo !== void 0); - scanner2.resetTokenState(savedPos); - scanner2.scan(); - } - let currentToken = getNextToken(n, expectedScanAction); - const token = createTextRangeWithKind( - scanner2.getTokenFullStart(), - scanner2.getTokenEnd(), - currentToken - ); - if (trailingTrivia) { - trailingTrivia = void 0; - } - while (scanner2.getTokenFullStart() < endPos) { - currentToken = scanner2.scan(); - if (!isTrivia(currentToken)) { - break; - } - const trivia = createTextRangeWithKind( - scanner2.getTokenFullStart(), - scanner2.getTokenEnd(), - currentToken - ); - if (!trailingTrivia) { - trailingTrivia = []; - } - trailingTrivia.push(trivia); - if (currentToken === 4 /* NewLineTrivia */) { - scanner2.scan(); - break; - } - } - lastTokenInfo = { leadingTrivia, trailingTrivia, token }; - return fixTokenKind(lastTokenInfo, n); - } - function getNextToken(n, expectedScanAction) { - const token = scanner2.getToken(); - lastScanAction = 0 /* Scan */; - switch (expectedScanAction) { - case 1 /* RescanGreaterThanToken */: - if (token === 32 /* GreaterThanToken */) { - lastScanAction = 1 /* RescanGreaterThanToken */; - const newToken = scanner2.reScanGreaterToken(); - Debug.assert(n.kind === newToken); - return newToken; - } - break; - case 2 /* RescanSlashToken */: - if (startsWithSlashToken(token)) { - lastScanAction = 2 /* RescanSlashToken */; - const newToken = scanner2.reScanSlashToken(); - Debug.assert(n.kind === newToken); - return newToken; - } - break; - case 3 /* RescanTemplateToken */: - if (token === 20 /* CloseBraceToken */) { - lastScanAction = 3 /* RescanTemplateToken */; - return scanner2.reScanTemplateToken( - /*isTaggedTemplate*/ - false - ); - } - break; - case 4 /* RescanJsxIdentifier */: - lastScanAction = 4 /* RescanJsxIdentifier */; - return scanner2.scanJsxIdentifier(); - case 5 /* RescanJsxText */: - lastScanAction = 5 /* RescanJsxText */; - return scanner2.reScanJsxToken( - /*allowMultilineJsxText*/ - false - ); - case 6 /* RescanJsxAttributeValue */: - lastScanAction = 6 /* RescanJsxAttributeValue */; - return scanner2.reScanJsxAttributeValue(); - case 0 /* Scan */: - break; - default: - Debug.assertNever(expectedScanAction); - } - return token; - } - function readEOFTokenRange() { - Debug.assert(isOnEOF()); - return createTextRangeWithKind(scanner2.getTokenFullStart(), scanner2.getTokenEnd(), 1 /* EndOfFileToken */); - } - function isOnToken() { - const current = lastTokenInfo ? lastTokenInfo.token.kind : scanner2.getToken(); - return current !== 1 /* EndOfFileToken */ && !isTrivia(current); - } - function isOnEOF() { - const current = lastTokenInfo ? lastTokenInfo.token.kind : scanner2.getToken(); - return current === 1 /* EndOfFileToken */; - } - function fixTokenKind(tokenInfo, container) { - if (isToken(container) && tokenInfo.token.kind !== container.kind) { - tokenInfo.token.kind = container.kind; - } - return tokenInfo; - } - function skipToEndOf(node) { - scanner2.resetTokenState(node.end); - savedPos = scanner2.getTokenFullStart(); - lastScanAction = void 0; - lastTokenInfo = void 0; - wasNewLine = false; - leadingTrivia = void 0; - trailingTrivia = void 0; - } - function skipToStartOf(node) { - scanner2.resetTokenState(node.pos); - savedPos = scanner2.getTokenFullStart(); - lastScanAction = void 0; - lastTokenInfo = void 0; - wasNewLine = false; - leadingTrivia = void 0; - trailingTrivia = void 0; - } -} - -// src/services/formatting/rule.ts -var anyContext = emptyArray; -var RuleAction = /* @__PURE__ */ ((RuleAction2) => { - RuleAction2[RuleAction2["None"] = 0] = "None"; - RuleAction2[RuleAction2["StopProcessingSpaceActions"] = 1] = "StopProcessingSpaceActions"; - RuleAction2[RuleAction2["StopProcessingTokenActions"] = 2] = "StopProcessingTokenActions"; - RuleAction2[RuleAction2["InsertSpace"] = 4] = "InsertSpace"; - RuleAction2[RuleAction2["InsertNewLine"] = 8] = "InsertNewLine"; - RuleAction2[RuleAction2["DeleteSpace"] = 16] = "DeleteSpace"; - RuleAction2[RuleAction2["DeleteToken"] = 32] = "DeleteToken"; - RuleAction2[RuleAction2["InsertTrailingSemicolon"] = 64] = "InsertTrailingSemicolon"; - RuleAction2[RuleAction2["StopAction"] = 3] = "StopAction"; - RuleAction2[RuleAction2["ModifySpaceAction"] = 28] = "ModifySpaceAction"; - RuleAction2[RuleAction2["ModifyTokenAction"] = 96] = "ModifyTokenAction"; - return RuleAction2; -})(RuleAction || {}); -var RuleFlags = /* @__PURE__ */ ((RuleFlags2) => { - RuleFlags2[RuleFlags2["None"] = 0] = "None"; - RuleFlags2[RuleFlags2["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; - return RuleFlags2; -})(RuleFlags || {}); - -// src/services/formatting/rules.ts -function getAllRules() { - const allTokens = []; - for (let token = 0 /* FirstToken */; token <= 166 /* LastToken */; token++) { - if (token !== 1 /* EndOfFileToken */) { - allTokens.push(token); - } - } - function anyTokenExcept(...tokens) { - return { tokens: allTokens.filter((t) => !tokens.some((t2) => t2 === t)), isSpecific: false }; - } - const anyToken = { tokens: allTokens, isSpecific: false }; - const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, 3 /* MultiLineCommentTrivia */]); - const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]); - const keywords = tokenRangeFromRange(83 /* FirstKeyword */, 166 /* LastKeyword */); - const binaryOperators = tokenRangeFromRange(30 /* FirstBinaryOperator */, 79 /* LastBinaryOperator */); - const binaryKeywordOperators = [ - 103 /* InKeyword */, - 104 /* InstanceOfKeyword */, - 165 /* OfKeyword */, - 130 /* AsKeyword */, - 142 /* IsKeyword */, - 152 /* SatisfiesKeyword */ - ]; - const unaryPrefixOperators = [46 /* PlusPlusToken */, 47 /* MinusMinusToken */, 55 /* TildeToken */, 54 /* ExclamationToken */]; - const unaryPrefixExpressions = [ - 9 /* NumericLiteral */, - 10 /* BigIntLiteral */, - 80 /* Identifier */, - 21 /* OpenParenToken */, - 23 /* OpenBracketToken */, - 19 /* OpenBraceToken */, - 110 /* ThisKeyword */, - 105 /* NewKeyword */ - ]; - const unaryPreincrementExpressions = [80 /* Identifier */, 21 /* OpenParenToken */, 110 /* ThisKeyword */, 105 /* NewKeyword */]; - const unaryPostincrementExpressions = [80 /* Identifier */, 22 /* CloseParenToken */, 24 /* CloseBracketToken */, 105 /* NewKeyword */]; - const unaryPredecrementExpressions = [80 /* Identifier */, 21 /* OpenParenToken */, 110 /* ThisKeyword */, 105 /* NewKeyword */]; - const unaryPostdecrementExpressions = [80 /* Identifier */, 22 /* CloseParenToken */, 24 /* CloseBracketToken */, 105 /* NewKeyword */]; - const comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]; - const typeNames = [80 /* Identifier */, ...typeKeywords]; - const functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments; - 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, 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, 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 */), - // Special handling of unary operators. - // Prefix operators generally shouldn't have a space between - // them and their target unary expression. - rule("NoSpaceAfterUnaryPrefixOperator", unaryPrefixOperators, unaryPrefixExpressions, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterUnaryPreincrementOperator", 46 /* PlusPlusToken */, unaryPreincrementExpressions, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterUnaryPredecrementOperator", 47 /* MinusMinusToken */, unaryPredecrementExpressions, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceBeforeUnaryPostincrementOperator", unaryPostincrementExpressions, 46 /* PlusPlusToken */, [isNonJsxSameLineTokenContext, isNotStatementConditionContext], 16 /* DeleteSpace */), - rule("NoSpaceBeforeUnaryPostdecrementOperator", unaryPostdecrementExpressions, 47 /* MinusMinusToken */, [isNonJsxSameLineTokenContext, isNotStatementConditionContext], 16 /* DeleteSpace */), - // More unary operator special-casing. - // DevDiv 181814: Be careful when removing leading whitespace - // around unary operators. Examples: - // 1 - -2 --X--> 1--2 - // a + ++b --X--> a+++b - rule("SpaceAfterPostincrementWhenFollowedByAdd", 46 /* PlusPlusToken */, 40 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterAddWhenFollowedByUnaryPlus", 40 /* PlusToken */, 40 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterAddWhenFollowedByPreincrement", 40 /* PlusToken */, 46 /* PlusPlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterPostdecrementWhenFollowedBySubtract", 47 /* MinusMinusToken */, 41 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterSubtractWhenFollowedByUnaryMinus", 41 /* MinusToken */, 41 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterSubtractWhenFollowedByPredecrement", 41 /* MinusToken */, 47 /* MinusMinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("NoSpaceAfterCloseBrace", 20 /* CloseBraceToken */, [28 /* CommaToken */, 27 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // For functions and control block place } on a new line [multi-line rule] - rule("NewLineBeforeCloseBraceInBlockContext", anyTokenIncludingMultilineComments, 20 /* CloseBraceToken */, [isMultilineBlockContext], 8 /* InsertNewLine */), - // Space/new line after }. - rule("SpaceAfterCloseBrace", 20 /* CloseBraceToken */, anyTokenExcept(22 /* CloseParenToken */), [isNonJsxSameLineTokenContext, isAfterCodeBlockContext], 4 /* InsertSpace */), - // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied - // Also should not apply to }) - rule("SpaceBetweenCloseBraceAndElse", 20 /* CloseBraceToken */, 93 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBetweenCloseBraceAndWhile", 20 /* CloseBraceToken */, 117 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceBetweenEmptyBraceBrackets", 19 /* OpenBraceToken */, 20 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */), - // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' - rule("SpaceAfterConditionalClosingParen", 22 /* CloseParenToken */, 23 /* OpenBracketToken */, [isControlDeclContext], 4 /* InsertSpace */), - rule("NoSpaceBetweenFunctionKeywordAndStar", 100 /* FunctionKeyword */, 42 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 16 /* DeleteSpace */), - rule("SpaceAfterStarInGeneratorDeclaration", 42 /* AsteriskToken */, 80 /* Identifier */, [isFunctionDeclarationOrFunctionExpressionContext], 4 /* InsertSpace */), - rule("SpaceAfterFunctionInFuncDecl", 100 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 4 /* InsertSpace */), - // Insert new line after { and before } in multi-line contexts. - rule("NewLineAfterOpenBraceInBlockContext", 19 /* OpenBraceToken */, anyToken, [isMultilineBlockContext], 8 /* InsertNewLine */), - // For get/set members, we check for (identifier,identifier) since get/set don't have tokens and they are represented as just an identifier token. - // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: - // get x() {} - // set x(val) {} - rule("SpaceAfterGetSetInMember", [139 /* GetKeyword */, 153 /* SetKeyword */], 80 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), - rule("NoSpaceBetweenYieldKeywordAndStar", 127 /* YieldKeyword */, 42 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), - rule("SpaceBetweenYieldOrYieldStarAndOperand", [127 /* YieldKeyword */, 42 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), - rule("NoSpaceBetweenReturnAndSemicolon", 107 /* ReturnKeyword */, 27 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("SpaceAfterCertainKeywords", [115 /* VarKeyword */, 111 /* ThrowKeyword */, 105 /* NewKeyword */, 91 /* DeleteKeyword */, 107 /* ReturnKeyword */, 114 /* TypeOfKeyword */, 135 /* AwaitKeyword */], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceAfterLetConstInVariableDeclaration", [121 /* LetKeyword */, 87 /* ConstKeyword */], anyToken, [isNonJsxSameLineTokenContext, isStartOfVariableDeclarationList], 4 /* InsertSpace */), - rule("NoSpaceBeforeOpenParenInFuncCall", anyToken, 21 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isFunctionCallOrNewContext, isPreviousTokenNotComma], 16 /* DeleteSpace */), - // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. - rule("SpaceBeforeBinaryKeywordOperator", anyToken, binaryKeywordOperators, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterBinaryKeywordOperator", binaryKeywordOperators, anyToken, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterVoidOperator", 116 /* VoidKeyword */, anyToken, [isNonJsxSameLineTokenContext, isVoidOpContext], 4 /* InsertSpace */), - // Async-await - rule("SpaceBetweenAsyncAndOpenParen", 134 /* AsyncKeyword */, 21 /* OpenParenToken */, [isArrowFunctionContext, isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBetweenAsyncAndFunctionKeyword", 134 /* AsyncKeyword */, [100 /* FunctionKeyword */, 80 /* Identifier */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - // Template string - rule("NoSpaceBetweenTagAndTemplateString", [80 /* Identifier */, 22 /* CloseParenToken */], [15 /* NoSubstitutionTemplateLiteral */, 16 /* TemplateHead */], [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // JSX opening elements - rule("SpaceBeforeJsxAttribute", anyToken, 80 /* Identifier */, [isNextTokenParentJsxAttribute, isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeSlashInJsxOpeningElement", anyToken, 44 /* SlashToken */, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - 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 */), - // Add a space around certain TypeScript keywords - rule( - "SpaceAfterCertainTypeScriptKeywords", - [ - 128 /* AbstractKeyword */, - 129 /* AccessorKeyword */, - 86 /* ClassKeyword */, - 138 /* DeclareKeyword */, - 90 /* DefaultKeyword */, - 94 /* EnumKeyword */, - 95 /* ExportKeyword */, - 96 /* ExtendsKeyword */, - 139 /* GetKeyword */, - 119 /* ImplementsKeyword */, - 102 /* ImportKeyword */, - 120 /* InterfaceKeyword */, - 144 /* ModuleKeyword */, - 145 /* NamespaceKeyword */, - 123 /* PrivateKeyword */, - 125 /* PublicKeyword */, - 124 /* ProtectedKeyword */, - 148 /* ReadonlyKeyword */, - 153 /* SetKeyword */, - 126 /* StaticKeyword */, - 156 /* TypeKeyword */, - 161 /* FromKeyword */, - 143 /* KeyOfKeyword */, - 140 /* InferKeyword */ - ], - anyToken, - [isNonJsxSameLineTokenContext], - 4 /* InsertSpace */ - ), - rule( - "SpaceBeforeCertainTypeScriptKeywords", - anyToken, - [96 /* ExtendsKeyword */, 119 /* ImplementsKeyword */, 161 /* FromKeyword */], - [isNonJsxSameLineTokenContext], - 4 /* InsertSpace */ - ), - // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { - rule("SpaceAfterModuleName", 11 /* StringLiteral */, 19 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), - // Lambda expressions - rule("SpaceBeforeArrow", anyToken, 39 /* EqualsGreaterThanToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceAfterArrow", 39 /* EqualsGreaterThanToken */, anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - // Optional parameters and let args - rule("NoSpaceAfterEllipsis", 26 /* DotDotDotToken */, 80 /* Identifier */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterOptionalParameters", 58 /* QuestionToken */, [22 /* CloseParenToken */, 28 /* CommaToken */], [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 16 /* DeleteSpace */), - // Remove spaces in empty interface literals. e.g.: x: {} - rule("NoSpaceBetweenEmptyInterfaceBraceBrackets", 19 /* OpenBraceToken */, 20 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectTypeContext], 16 /* DeleteSpace */), - // generics and type assertions - rule("NoSpaceBeforeOpenAngularBracket", typeNames, 30 /* LessThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */), - rule("NoSpaceBetweenCloseParenAndAngularBracket", 22 /* CloseParenToken */, 30 /* LessThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterOpenAngularBracket", 30 /* LessThanToken */, anyToken, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */), - rule("NoSpaceBeforeCloseAngularBracket", anyToken, 32 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterCloseAngularBracket", 32 /* GreaterThanToken */, [21 /* OpenParenToken */, 23 /* OpenBracketToken */, 32 /* GreaterThanToken */, 28 /* CommaToken */], [ - isNonJsxSameLineTokenContext, - isTypeArgumentOrParameterOrAssertionContext, - isNotFunctionDeclContext, - /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/ - isNonTypeAssertionContext - ], 16 /* DeleteSpace */), - // decorators - rule("SpaceBeforeAt", [22 /* CloseParenToken */, 80 /* Identifier */], 60 /* AtToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterAt", 60 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // Insert space after @ in decorator - rule( - "SpaceAfterDecorator", - anyToken, - [ - 128 /* AbstractKeyword */, - 80 /* Identifier */, - 95 /* ExportKeyword */, - 90 /* DefaultKeyword */, - 86 /* ClassKeyword */, - 126 /* StaticKeyword */, - 125 /* PublicKeyword */, - 123 /* PrivateKeyword */, - 124 /* ProtectedKeyword */, - 139 /* GetKeyword */, - 153 /* SetKeyword */, - 23 /* OpenBracketToken */, - 42 /* AsteriskToken */ - ], - [isEndOfDecoratorContextOnSameLine], - 4 /* InsertSpace */ - ), - rule("NoSpaceBeforeNonNullAssertionOperator", anyToken, 54 /* ExclamationToken */, [isNonJsxSameLineTokenContext, isNonNullAssertionContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterNewKeywordOnConstructorSignature", 105 /* NewKeyword */, 21 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isConstructorSignatureContext], 16 /* DeleteSpace */), - rule("SpaceLessThanAndNonJSXTypeAnnotation", 30 /* LessThanToken */, 30 /* LessThanToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */) - ]; - const userConfigurableRules = [ - // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 137 /* ConstructorKeyword */, 21 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 137 /* ConstructorKeyword */, 21 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("SpaceAfterComma", 28 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), - rule("NoSpaceAfterComma", 28 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), - // Insert space after function keyword for anonymous functions - rule("SpaceAfterAnonymousFunctionKeyword", [100 /* FunctionKeyword */, 42 /* AsteriskToken */], 21 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 4 /* InsertSpace */), - rule("NoSpaceAfterAnonymousFunctionKeyword", [100 /* FunctionKeyword */, 42 /* AsteriskToken */], 21 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 16 /* DeleteSpace */), - // Insert space after keywords in control flow statements - rule("SpaceAfterKeywordInControl", keywords, 21 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], 4 /* InsertSpace */), - rule("NoSpaceAfterKeywordInControl", keywords, 21 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], 16 /* DeleteSpace */), - // Insert space after opening and before closing nonempty parenthesis - rule("SpaceAfterOpenParen", 21 /* OpenParenToken */, anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCloseParen", anyToken, 22 /* CloseParenToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBetweenOpenParens", 21 /* OpenParenToken */, 21 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceBetweenParens", 21 /* OpenParenToken */, 22 /* CloseParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterOpenParen", 21 /* OpenParenToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceBeforeCloseParen", anyToken, 22 /* CloseParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // Insert space after opening and before closing nonempty brackets - rule("SpaceAfterOpenBracket", 23 /* OpenBracketToken */, anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCloseBracket", anyToken, 24 /* CloseBracketToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceBetweenBrackets", 23 /* OpenBracketToken */, 24 /* CloseBracketToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterOpenBracket", 23 /* OpenBracketToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceBeforeCloseBracket", anyToken, 24 /* CloseBracketToken */, [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. - rule("SpaceAfterOpenBrace", 19 /* OpenBraceToken */, anyToken, [isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isBraceWrappedContext], 4 /* InsertSpace */), - rule("SpaceBeforeCloseBrace", anyToken, 20 /* CloseBraceToken */, [isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isBraceWrappedContext], 4 /* InsertSpace */), - rule("NoSpaceBetweenEmptyBraceBrackets", 19 /* OpenBraceToken */, 20 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterOpenBrace", 19 /* OpenBraceToken */, anyToken, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceBeforeCloseBrace", anyToken, 20 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // Insert a space after opening and before closing empty brace brackets - rule("SpaceBetweenEmptyBraceBrackets", 19 /* OpenBraceToken */, 20 /* CloseBraceToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")], 4 /* InsertSpace */), - rule("NoSpaceBetweenEmptyBraceBrackets", 19 /* OpenBraceToken */, 20 /* CloseBraceToken */, [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // Insert space after opening and before closing template string braces - rule("SpaceAfterTemplateHeadAndMiddle", [16 /* TemplateHead */, 17 /* TemplateMiddle */], anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxTextContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */), - rule("SpaceBeforeTemplateMiddleAndTail", anyToken, [17 /* TemplateMiddle */, 18 /* TemplateTail */], [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterTemplateHeadAndMiddle", [16 /* TemplateHead */, 17 /* TemplateMiddle */], anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxTextContext], 16 /* DeleteSpace */, 1 /* CanDeleteNewLines */), - rule("NoSpaceBeforeTemplateMiddleAndTail", anyToken, [17 /* TemplateMiddle */, 18 /* TemplateTail */], [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // No space after { and before } in JSX expression - rule("SpaceAfterOpenBraceInJsxExpression", 19 /* OpenBraceToken */, anyToken, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 4 /* InsertSpace */), - rule("SpaceBeforeCloseBraceInJsxExpression", anyToken, 20 /* CloseBraceToken */, [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 4 /* InsertSpace */), - rule("NoSpaceAfterOpenBraceInJsxExpression", 19 /* OpenBraceToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 16 /* DeleteSpace */), - rule("NoSpaceBeforeCloseBraceInJsxExpression", anyToken, 20 /* CloseBraceToken */, [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 16 /* DeleteSpace */), - // Insert space after semicolon in for statement - rule("SpaceAfterSemicolonInFor", 27 /* SemicolonToken */, anyToken, [isOptionEnabled("insertSpaceAfterSemicolonInForStatements"), isNonJsxSameLineTokenContext, isForContext], 4 /* InsertSpace */), - rule("NoSpaceAfterSemicolonInFor", 27 /* SemicolonToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterSemicolonInForStatements"), isNonJsxSameLineTokenContext, isForContext], 16 /* DeleteSpace */), - // Insert space before and after binary operators - rule("SpaceBeforeBinaryOperator", anyToken, binaryOperators, [isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("SpaceAfterBinaryOperator", binaryOperators, anyToken, [isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */), - rule("NoSpaceBeforeBinaryOperator", anyToken, binaryOperators, [isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterBinaryOperator", binaryOperators, anyToken, [isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], 16 /* DeleteSpace */), - rule("SpaceBeforeOpenParenInFuncDecl", anyToken, 21 /* OpenParenToken */, [isOptionEnabled("insertSpaceBeforeFunctionParenthesis"), isNonJsxSameLineTokenContext, isFunctionDeclContext], 4 /* InsertSpace */), - rule("NoSpaceBeforeOpenParenInFuncDecl", anyToken, 21 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceBeforeFunctionParenthesis"), isNonJsxSameLineTokenContext, isFunctionDeclContext], 16 /* DeleteSpace */), - // Open Brace braces after control block - rule("NewLineBeforeOpenBraceInControl", controlOpenBraceLeftTokenRange, 19 /* OpenBraceToken */, [isOptionEnabled("placeOpenBraceOnNewLineForControlBlocks"), isControlDeclContext, isBeforeMultilineBlockContext], 8 /* InsertNewLine */, 1 /* CanDeleteNewLines */), - // Open Brace braces after function - // TypeScript: Function can have return types, which can be made of tons of different token kinds - rule("NewLineBeforeOpenBraceInFunction", functionOpenBraceLeftTokenRange, 19 /* OpenBraceToken */, [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeMultilineBlockContext], 8 /* InsertNewLine */, 1 /* CanDeleteNewLines */), - // Open Brace braces after TypeScript module/class/interface - rule("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 19 /* OpenBraceToken */, [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], 8 /* InsertNewLine */, 1 /* CanDeleteNewLines */), - rule("SpaceAfterTypeAssertion", 32 /* GreaterThanToken */, anyToken, [isOptionEnabled("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 4 /* InsertSpace */), - rule("NoSpaceAfterTypeAssertion", 32 /* GreaterThanToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 16 /* DeleteSpace */), - rule("SpaceBeforeTypeAnnotation", anyToken, [58 /* QuestionToken */, 59 /* ColonToken */], [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 4 /* InsertSpace */), - rule("NoSpaceBeforeTypeAnnotation", anyToken, [58 /* QuestionToken */, 59 /* ColonToken */], [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 16 /* DeleteSpace */), - rule("NoOptionalSemicolon", 27 /* SemicolonToken */, anyTokenIncludingEOF, [optionEquals("semicolons", "remove" /* Remove */), isSemicolonDeletionContext], 32 /* DeleteToken */), - rule("OptionalSemicolon", anyToken, anyTokenIncludingEOF, [optionEquals("semicolons", "insert" /* Insert */), isSemicolonInsertionContext], 64 /* InsertTrailingSemicolon */) - ]; - const lowPriorityCommonRules = [ - // Space after keyword but not before ; or : or ? - rule("NoSpaceBeforeSemicolon", anyToken, 27 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("SpaceBeforeOpenBraceInControl", controlOpenBraceLeftTokenRange, 19 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForControlBlocks"), isControlDeclContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */), - rule("SpaceBeforeOpenBraceInFunction", functionOpenBraceLeftTokenRange, 19 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */), - rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 19 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */), - rule("NoSpaceBeforeComma", anyToken, 28 /* CommaToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // No space before and after indexer `x[]` - rule("NoSpaceBeforeOpenBracket", anyTokenExcept(134 /* AsyncKeyword */, 84 /* CaseKeyword */), 23 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - rule("NoSpaceAfterCloseBracket", 24 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 16 /* DeleteSpace */), - rule("SpaceAfterSemicolon", 27 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - // Remove extra space between for and await - rule("SpaceBetweenForAndAwaitKeyword", 99 /* ForKeyword */, 135 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - // Remove extra spaces between ... and type name in tuple spread - rule("SpaceBetweenDotDotDotAndTypeName", 26 /* DotDotDotToken */, typeNames, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), - // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. - // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] - rule( - "SpaceBetweenStatements", - [22 /* CloseParenToken */, 92 /* DoKeyword */, 93 /* ElseKeyword */, 84 /* CaseKeyword */], - anyToken, - [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], - 4 /* InsertSpace */ - ), - // This low-pri rule takes care of "try {", "catch {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. - rule("SpaceAfterTryCatchFinally", [113 /* TryKeyword */, 85 /* CatchKeyword */, 98 /* FinallyKeyword */], 19 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */) - ]; - return [ - ...highPriorityCommonRules, - ...userConfigurableRules, - ...lowPriorityCommonRules - ]; -} -function rule(debugName, left, right, context, action, flags = 0 /* None */) { - return { leftTokenRange: toTokenRange(left), rightTokenRange: toTokenRange(right), rule: { debugName, context, action, flags } }; -} -function tokenRangeFrom(tokens) { - return { tokens, isSpecific: true }; -} -function toTokenRange(arg) { - return typeof arg === "number" ? tokenRangeFrom([arg]) : isArray(arg) ? tokenRangeFrom(arg) : arg; -} -function tokenRangeFromRange(from, to, except = []) { - const tokens = []; - for (let token = from; token <= to; token++) { - if (!contains(except, token)) { - tokens.push(token); - } - } - return tokenRangeFrom(tokens); -} -function optionEquals(optionName, optionValue) { - return (context) => context.options && context.options[optionName] === optionValue; -} -function isOptionEnabled(optionName) { - return (context) => context.options && hasProperty(context.options, optionName) && !!context.options[optionName]; -} -function isOptionDisabled(optionName) { - return (context) => context.options && hasProperty(context.options, optionName) && !context.options[optionName]; -} -function isOptionDisabledOrUndefined(optionName) { - return (context) => !context.options || !hasProperty(context.options, optionName) || !context.options[optionName]; -} -function isOptionDisabledOrUndefinedOrTokensOnSameLine(optionName) { - return (context) => !context.options || !hasProperty(context.options, optionName) || !context.options[optionName] || context.TokensAreOnSameLine(); -} -function isOptionEnabledOrUndefined(optionName) { - return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName]; -} -function isForContext(context) { - return context.contextNode.kind === 249 /* ForStatement */; -} -function isNotForContext(context) { - return !isForContext(context); -} -function isBinaryOpContext(context) { - switch (context.contextNode.kind) { - case 227 /* BinaryExpression */: - return context.contextNode.operatorToken.kind !== 28 /* CommaToken */; - case 228 /* ConditionalExpression */: - case 195 /* ConditionalType */: - case 235 /* AsExpression */: - case 282 /* ExportSpecifier */: - case 277 /* ImportSpecifier */: - case 183 /* TypePredicate */: - case 193 /* UnionType */: - case 194 /* IntersectionType */: - case 239 /* SatisfiesExpression */: - return true; - // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 209 /* BindingElement */: - // equals in type X = ... - // falls through - case 266 /* TypeAliasDeclaration */: - // equal in import a = module('a'); - // falls through - case 272 /* ImportEqualsDeclaration */: - // equal in export = 1 - // falls through - case 278 /* ExportAssignment */: - // equal in let a = 0 - // falls through - case 261 /* VariableDeclaration */: - // equal in p = 0 - // falls through - case 170 /* Parameter */: - case 307 /* EnumMember */: - case 173 /* PropertyDeclaration */: - case 172 /* PropertySignature */: - return context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; - // "in" keyword in for (let x in []) { } - case 250 /* ForInStatement */: - // "in" keyword in [P in keyof T]: T[P] - // falls through - case 169 /* TypeParameter */: - return context.currentTokenSpan.kind === 103 /* InKeyword */ || context.nextTokenSpan.kind === 103 /* InKeyword */ || context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; - // Technically, "of" is not a binary operator, but format it the same way as "in" - case 251 /* ForOfStatement */: - return context.currentTokenSpan.kind === 165 /* OfKeyword */ || context.nextTokenSpan.kind === 165 /* OfKeyword */; - } - return false; -} -function isNotBinaryOpContext(context) { - return !isBinaryOpContext(context); -} -function isNotTypeAnnotationContext(context) { - return !isTypeAnnotationContext(context); -} -function isTypeAnnotationContext(context) { - const contextKind = context.contextNode.kind; - return contextKind === 173 /* PropertyDeclaration */ || contextKind === 172 /* PropertySignature */ || contextKind === 170 /* Parameter */ || contextKind === 261 /* 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 === 228 /* ConditionalExpression */ || context.contextNode.kind === 195 /* ConditionalType */; -} -function isSameLineTokenOrBeforeBlockContext(context) { - return context.TokensAreOnSameLine() || isBeforeBlockContext(context); -} -function isBraceWrappedContext(context) { - return context.contextNode.kind === 207 /* ObjectBindingPattern */ || context.contextNode.kind === 201 /* MappedType */ || isSingleLineBlockContext(context); -} -function isBeforeMultilineBlockContext(context) { - return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); -} -function isMultilineBlockContext(context) { - return isBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); -} -function isSingleLineBlockContext(context) { - return isBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); -} -function isBlockContext(context) { - return nodeIsBlockContext(context.contextNode); -} -function isBeforeBlockContext(context) { - return nodeIsBlockContext(context.nextTokenParent); -} -function nodeIsBlockContext(node) { - if (nodeIsTypeScriptDeclWithBlockContext(node)) { - return true; - } - switch (node.kind) { - case 242 /* Block */: - case 270 /* CaseBlock */: - case 211 /* ObjectLiteralExpression */: - case 269 /* ModuleBlock */: - return true; - } - return false; -} -function isFunctionDeclContext(context) { - switch (context.contextNode.kind) { - case 263 /* FunctionDeclaration */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - // case SyntaxKind.MemberFunctionDeclaration: - // falls through - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - // case SyntaxKind.MethodSignature: - // falls through - case 180 /* CallSignature */: - case 219 /* FunctionExpression */: - case 177 /* Constructor */: - case 220 /* ArrowFunction */: - // case SyntaxKind.ConstructorDeclaration: - // case SyntaxKind.SimpleArrowFunctionExpression: - // case SyntaxKind.ParenthesizedArrowFunctionExpression: - // falls through - case 265 /* InterfaceDeclaration */: - return true; - } - return false; -} -function isNotFunctionDeclContext(context) { - return !isFunctionDeclContext(context); -} -function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 263 /* FunctionDeclaration */ || context.contextNode.kind === 219 /* FunctionExpression */; -} -function isTypeScriptDeclWithBlockContext(context) { - return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); -} -function nodeIsTypeScriptDeclWithBlockContext(node) { - switch (node.kind) { - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 188 /* TypeLiteral */: - case 268 /* ModuleDeclaration */: - case 279 /* ExportDeclaration */: - case 280 /* NamedExports */: - case 273 /* ImportDeclaration */: - case 276 /* NamedImports */: - return true; - } - return false; -} -function isAfterCodeBlockContext(context) { - switch (context.currentTokenParent.kind) { - case 264 /* ClassDeclaration */: - case 268 /* ModuleDeclaration */: - case 267 /* EnumDeclaration */: - case 300 /* CatchClause */: - case 269 /* ModuleBlock */: - case 256 /* SwitchStatement */: - return true; - case 242 /* Block */: { - const blockParent = context.currentTokenParent.parent; - if (!blockParent || blockParent.kind !== 220 /* ArrowFunction */ && blockParent.kind !== 219 /* FunctionExpression */) { - return true; - } - } - } - return false; -} -function isControlDeclContext(context) { - switch (context.contextNode.kind) { - case 246 /* IfStatement */: - case 256 /* SwitchStatement */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 248 /* WhileStatement */: - case 259 /* TryStatement */: - case 247 /* DoStatement */: - case 255 /* WithStatement */: - // TODO - // case SyntaxKind.ElseClause: - // falls through - case 300 /* CatchClause */: - return true; - default: - return false; - } -} -function isObjectContext(context) { - return context.contextNode.kind === 211 /* ObjectLiteralExpression */; -} -function isFunctionCallContext(context) { - return context.contextNode.kind === 214 /* CallExpression */; -} -function isNewContext(context) { - return context.contextNode.kind === 215 /* NewExpression */; -} -function isFunctionCallOrNewContext(context) { - return isFunctionCallContext(context) || isNewContext(context); -} -function isPreviousTokenNotComma(context) { - return context.currentTokenSpan.kind !== 28 /* CommaToken */; -} -function isNextTokenNotCloseBracket(context) { - return context.nextTokenSpan.kind !== 24 /* CloseBracketToken */; -} -function isNextTokenNotCloseParen(context) { - return context.nextTokenSpan.kind !== 22 /* CloseParenToken */; -} -function isArrowFunctionContext(context) { - return context.contextNode.kind === 220 /* ArrowFunction */; -} -function isImportTypeContext(context) { - return context.contextNode.kind === 206 /* ImportType */; -} -function isNonJsxSameLineTokenContext(context) { - return context.TokensAreOnSameLine() && context.contextNode.kind !== 12 /* JsxText */; -} -function isNonJsxTextContext(context) { - return context.contextNode.kind !== 12 /* JsxText */; -} -function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 285 /* JsxElement */ && context.contextNode.kind !== 289 /* JsxFragment */; -} -function isJsxExpressionContext(context) { - return context.contextNode.kind === 295 /* JsxExpression */ || context.contextNode.kind === 294 /* JsxSpreadAttribute */; -} -function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 292 /* JsxAttribute */ || context.nextTokenParent.kind === 296 /* JsxNamespacedName */ && context.nextTokenParent.parent.kind === 292 /* JsxAttribute */; -} -function isJsxAttributeContext(context) { - return context.contextNode.kind === 292 /* JsxAttribute */; -} -function isNextTokenParentNotJsxNamespacedName(context) { - return context.nextTokenParent.kind !== 296 /* JsxNamespacedName */; -} -function isNextTokenParentJsxNamespacedName(context) { - return context.nextTokenParent.kind === 296 /* JsxNamespacedName */; -} -function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 286 /* JsxSelfClosingElement */; -} -function isNotBeforeBlockInFunctionDeclarationContext(context) { - return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); -} -function isEndOfDecoratorContextOnSameLine(context) { - return context.TokensAreOnSameLine() && hasDecorators(context.contextNode) && nodeIsInDecoratorContext(context.currentTokenParent) && !nodeIsInDecoratorContext(context.nextTokenParent); -} -function nodeIsInDecoratorContext(node) { - while (node && isExpression(node)) { - node = node.parent; - } - return node && node.kind === 171 /* Decorator */; -} -function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 262 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; -} -function isNotFormatOnEnter(context) { - return context.formattingRequestKind !== 2 /* FormatOnEnter */; -} -function isModuleDeclContext(context) { - return context.contextNode.kind === 268 /* ModuleDeclaration */; -} -function isObjectTypeContext(context) { - return context.contextNode.kind === 188 /* TypeLiteral */; -} -function isConstructorSignatureContext(context) { - return context.contextNode.kind === 181 /* ConstructSignature */; -} -function isTypeArgumentOrParameterOrAssertion(token, parent2) { - if (token.kind !== 30 /* LessThanToken */ && token.kind !== 32 /* GreaterThanToken */) { - return false; - } - switch (parent2.kind) { - case 184 /* TypeReference */: - case 217 /* TypeAssertionExpression */: - case 266 /* TypeAliasDeclaration */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 234 /* ExpressionWithTypeArguments */: - return true; - default: - return false; - } -} -function isTypeArgumentOrParameterOrAssertionContext(context) { - return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); -} -function isTypeAssertionContext(context) { - return context.contextNode.kind === 217 /* TypeAssertionExpression */; -} -function isNonTypeAssertionContext(context) { - return !isTypeAssertionContext(context); -} -function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 116 /* VoidKeyword */ && context.currentTokenParent.kind === 223 /* VoidExpression */; -} -function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 230 /* YieldExpression */ && context.contextNode.expression !== void 0; -} -function isNonNullAssertionContext(context) { - return context.contextNode.kind === 236 /* NonNullExpression */; -} -function isNotStatementConditionContext(context) { - return !isStatementConditionContext(context); -} -function isStatementConditionContext(context) { - switch (context.contextNode.kind) { - case 246 /* IfStatement */: - case 249 /* ForStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - return true; - default: - return false; - } -} -function isSemicolonDeletionContext(context) { - let nextTokenKind = context.nextTokenSpan.kind; - let nextTokenStart = context.nextTokenSpan.pos; - if (isTrivia(nextTokenKind)) { - const nextRealToken = context.nextTokenParent === context.currentTokenParent ? findNextToken( - context.currentTokenParent, - findAncestor(context.currentTokenParent, (a) => !a.parent), - context.sourceFile - ) : context.nextTokenParent.getFirstToken(context.sourceFile); - if (!nextRealToken) { - return true; - } - nextTokenKind = nextRealToken.kind; - nextTokenStart = nextRealToken.getStart(context.sourceFile); - } - const startLine = context.sourceFile.getLineAndCharacterOfPosition(context.currentTokenSpan.pos).line; - const endLine = context.sourceFile.getLineAndCharacterOfPosition(nextTokenStart).line; - if (startLine === endLine) { - return nextTokenKind === 20 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; - } - if (nextTokenKind === 27 /* SemicolonToken */ && context.currentTokenSpan.kind === 27 /* SemicolonToken */) { - return true; - } - if (nextTokenKind === 241 /* SemicolonClassElement */ || nextTokenKind === 27 /* SemicolonToken */) { - return false; - } - if (context.contextNode.kind === 265 /* InterfaceDeclaration */ || context.contextNode.kind === 266 /* TypeAliasDeclaration */) { - return !isPropertySignature(context.currentTokenParent) || !!context.currentTokenParent.type || nextTokenKind !== 21 /* OpenParenToken */; - } - if (isPropertyDeclaration(context.currentTokenParent)) { - return !context.currentTokenParent.initializer; - } - return context.currentTokenParent.kind !== 249 /* ForStatement */ && context.currentTokenParent.kind !== 243 /* EmptyStatement */ && context.currentTokenParent.kind !== 241 /* SemicolonClassElement */ && nextTokenKind !== 23 /* OpenBracketToken */ && nextTokenKind !== 21 /* OpenParenToken */ && nextTokenKind !== 40 /* PlusToken */ && nextTokenKind !== 41 /* MinusToken */ && nextTokenKind !== 44 /* SlashToken */ && nextTokenKind !== 14 /* RegularExpressionLiteral */ && nextTokenKind !== 28 /* CommaToken */ && nextTokenKind !== 229 /* 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().includes("."); -} - -// src/services/formatting/rulesMap.ts -function getFormatContext(options, host) { - return { options, getRules: getRulesMap(), host }; -} -var rulesMapCache; -function getRulesMap() { - if (rulesMapCache === void 0) { - rulesMapCache = createRulesMap(getAllRules()); - } - return rulesMapCache; -} -function getRuleActionExclusion(ruleAction) { - let mask2 = 0 /* None */; - if (ruleAction & 1 /* StopProcessingSpaceActions */) { - mask2 |= 28 /* ModifySpaceAction */; - } - if (ruleAction & 2 /* StopProcessingTokenActions */) { - mask2 |= 96 /* ModifyTokenAction */; - } - if (ruleAction & 28 /* ModifySpaceAction */) { - mask2 |= 28 /* ModifySpaceAction */; - } - if (ruleAction & 96 /* ModifyTokenAction */) { - mask2 |= 96 /* ModifyTokenAction */; - } - return mask2; -} -function createRulesMap(rules) { - const map2 = buildMap(rules); - return (context) => { - const bucket = map2[getRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind)]; - if (bucket) { - const rules2 = []; - let ruleActionMask = 0; - for (const rule2 of bucket) { - const acceptRuleActions = ~getRuleActionExclusion(ruleActionMask); - if (rule2.action & acceptRuleActions && every(rule2.context, (c) => c(context))) { - rules2.push(rule2); - ruleActionMask |= rule2.action; - } - } - if (rules2.length) { - return rules2; - } - } - }; -} -function buildMap(rules) { - const map2 = new Array(mapRowLength * mapRowLength); - const rulesBucketConstructionStateList = new Array(map2.length); - for (const rule2 of rules) { - const specificRule = rule2.leftTokenRange.isSpecific && rule2.rightTokenRange.isSpecific; - for (const left of rule2.leftTokenRange.tokens) { - for (const right of rule2.rightTokenRange.tokens) { - const index = getRuleBucketIndex(left, right); - let rulesBucket = map2[index]; - if (rulesBucket === void 0) { - rulesBucket = map2[index] = []; - } - addRule(rulesBucket, rule2.rule, specificRule, rulesBucketConstructionStateList, index); - } - } - } - return map2; -} -function getRuleBucketIndex(row, column) { - Debug.assert(row <= 166 /* LastKeyword */ && column <= 166 /* LastKeyword */, "Must compute formatting context from tokens"); - return row * mapRowLength + column; -} -var maskBitSize = 5; -var mask = 31; -var mapRowLength = 166 /* LastToken */ + 1; -var RulesPosition = ((RulesPosition2) => { - RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific"; - RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny"; - RulesPosition2[RulesPosition2["ContextRulesSpecific"] = maskBitSize * 2] = "ContextRulesSpecific"; - RulesPosition2[RulesPosition2["ContextRulesAny"] = maskBitSize * 3] = "ContextRulesAny"; - RulesPosition2[RulesPosition2["NoContextRulesSpecific"] = maskBitSize * 4] = "NoContextRulesSpecific"; - RulesPosition2[RulesPosition2["NoContextRulesAny"] = maskBitSize * 5] = "NoContextRulesAny"; - return RulesPosition2; -})(RulesPosition || {}); -function addRule(rules, rule2, specificTokens, constructionState, rulesBucketIndex) { - const position = rule2.action & 3 /* StopAction */ ? specificTokens ? 0 /* StopRulesSpecific */ : RulesPosition.StopRulesAny : rule2.context !== anyContext ? specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny : specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; - const state = constructionState[rulesBucketIndex] || 0; - rules.splice(getInsertionIndex(state, position), 0, rule2); - constructionState[rulesBucketIndex] = increaseInsertionIndex(state, position); -} -function getInsertionIndex(indexBitmap, maskPosition) { - let index = 0; - for (let pos = 0; pos <= maskPosition; pos += maskBitSize) { - index += indexBitmap & mask; - indexBitmap >>= maskBitSize; - } - return index; -} -function increaseInsertionIndex(indexBitmap, maskPosition) { - const value = (indexBitmap >> maskPosition & mask) + 1; - Debug.assert((value & mask) === value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); - return indexBitmap & ~(mask << maskPosition) | value << maskPosition; -} - -// src/services/formatting/formatting.ts -function createTextRangeWithKind(pos, end, kind) { - const textRangeWithKind = { pos, end, kind }; - if (Debug.isDebugging) { - Object.defineProperty(textRangeWithKind, "__debugKind", { - get: () => Debug.formatSyntaxKind(kind) - }); - } - return textRangeWithKind; -} -function formatOnEnter(position, sourceFile, formatContext) { - const line = sourceFile.getLineAndCharacterOfPosition(position).line; - if (line === 0) { - return []; - } - let endOfFormatSpan = getEndLinePosition(line, sourceFile); - while (isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(endOfFormatSpan))) { - endOfFormatSpan--; - } - if (isLineBreak(sourceFile.text.charCodeAt(endOfFormatSpan))) { - endOfFormatSpan--; - } - const span = { - // get start position for the previous line - pos: getStartPositionOfLine(line - 1, sourceFile), - // end value is exclusive so add 1 to the result - end: endOfFormatSpan + 1 - }; - return formatSpan(span, sourceFile, formatContext, 2 /* FormatOnEnter */); -} -function formatOnSemicolon(position, sourceFile, formatContext) { - const semicolon = findImmediatelyPrecedingTokenOfKind(position, 27 /* SemicolonToken */, sourceFile); - return formatNodeLines(findOutermostNodeWithinListLevel(semicolon), sourceFile, formatContext, 3 /* FormatOnSemicolon */); -} -function formatOnOpeningCurly(position, sourceFile, formatContext) { - const openingCurly = findImmediatelyPrecedingTokenOfKind(position, 19 /* OpenBraceToken */, sourceFile); - if (!openingCurly) { - return []; - } - const curlyBraceRange = openingCurly.parent; - const outermostNode = findOutermostNodeWithinListLevel(curlyBraceRange); - const textRange = { - pos: getLineStartPositionForPosition(outermostNode.getStart(sourceFile), sourceFile), - // TODO: GH#18217 - end: position - }; - return formatSpan(textRange, sourceFile, formatContext, 4 /* FormatOnOpeningCurlyBrace */); -} -function formatOnClosingCurly(position, sourceFile, formatContext) { - const precedingToken = findImmediatelyPrecedingTokenOfKind(position, 20 /* CloseBraceToken */, sourceFile); - return formatNodeLines(findOutermostNodeWithinListLevel(precedingToken), sourceFile, formatContext, 5 /* FormatOnClosingCurlyBrace */); -} -function formatDocument(sourceFile, formatContext) { - const span = { - pos: 0, - end: sourceFile.text.length - }; - return formatSpan(span, sourceFile, formatContext, 0 /* FormatDocument */); -} -function formatSelection(start, end, sourceFile, formatContext) { - const span = { - pos: getLineStartPositionForPosition(start, sourceFile), - end - }; - return formatSpan(span, sourceFile, formatContext, 1 /* FormatSelection */); -} -function findImmediatelyPrecedingTokenOfKind(end, expectedTokenKind, sourceFile) { - const precedingToken = findPrecedingToken(end, sourceFile); - return precedingToken && precedingToken.kind === expectedTokenKind && end === precedingToken.getEnd() ? precedingToken : void 0; -} -function findOutermostNodeWithinListLevel(node) { - let current = node; - while (current && current.parent && current.parent.end === node.end && !isListElement(current.parent, current)) { - current = current.parent; - } - return current; -} -function isListElement(parent2, node) { - switch (parent2.kind) { - case 264 /* ClassDeclaration */: - case 265 /* InterfaceDeclaration */: - return rangeContainsRange(parent2.members, node); - case 268 /* ModuleDeclaration */: - const body = parent2.body; - return !!body && body.kind === 269 /* ModuleBlock */ && rangeContainsRange(body.statements, node); - case 308 /* SourceFile */: - case 242 /* Block */: - case 269 /* ModuleBlock */: - return rangeContainsRange(parent2.statements, node); - case 300 /* CatchClause */: - return rangeContainsRange(parent2.block.statements, node); - } - return false; -} -function findEnclosingNode(range, sourceFile) { - return find2(sourceFile); - function find2(n) { - const candidate = forEachChild(n, (c) => startEndContainsRange(c.getStart(sourceFile), c.end, range) && c); - if (candidate) { - const result = find2(candidate); - if (result) { - return result; - } - } - return n; - } -} -function prepareRangeContainsErrorFunction(errors, originalRange) { - if (!errors.length) { - return rangeHasNoErrors; - } - const sorted = errors.filter((d) => rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length)).sort((e1, e2) => e1.start - e2.start); - if (!sorted.length) { - return rangeHasNoErrors; - } - let index = 0; - return (r) => { - while (true) { - if (index >= sorted.length) { - return false; - } - const error2 = sorted[index]; - if (r.end <= error2.start) { - return false; - } - if (startEndOverlapsWithStartEnd(r.pos, r.end, error2.start, error2.start + error2.length)) { - return true; - } - index++; - } - }; - function rangeHasNoErrors() { - return false; - } -} -function getScanStartPosition(enclosingNode, originalRange, sourceFile) { - const start = enclosingNode.getStart(sourceFile); - if (start === originalRange.pos && enclosingNode.end === originalRange.end) { - return start; - } - const precedingToken = findPrecedingToken(originalRange.pos, sourceFile); - if (!precedingToken) { - return enclosingNode.pos; - } - if (precedingToken.end >= originalRange.pos) { - return enclosingNode.pos; - } - return precedingToken.end; -} -function getOwnOrInheritedDelta(n, options, sourceFile) { - let previousLine = -1 /* Unknown */; - let child; - while (n) { - const line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; - if (previousLine !== -1 /* Unknown */ && line !== previousLine) { - break; - } - if (SmartIndenter.shouldIndentChildNode(options, n, child, sourceFile)) { - return options.indentSize; - } - previousLine = line; - child = n; - n = n.parent; - } - return 0; -} -function formatNodeGivenIndentation(node, sourceFileLike, languageVariant, initialIndentation, delta, formatContext) { - const range = { pos: node.pos, end: node.end }; - return getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end, (scanner2) => formatSpanWorker( - range, - node, - initialIndentation, - delta, - scanner2, - formatContext, - 1 /* FormatSelection */, - (_) => false, - // assume that node does not have any errors - sourceFileLike - )); -} -function formatNodeLines(node, sourceFile, formatContext, requestKind) { - if (!node) { - return []; - } - const span = { - pos: getLineStartPositionForPosition(node.getStart(sourceFile), sourceFile), - end: node.end - }; - return formatSpan(span, sourceFile, formatContext, requestKind); -} -function formatSpan(originalRange, sourceFile, formatContext, requestKind) { - const enclosingNode = findEnclosingNode(originalRange, sourceFile); - return getFormattingScanner( - sourceFile.text, - sourceFile.languageVariant, - getScanStartPosition(enclosingNode, originalRange, sourceFile), - originalRange.end, - (scanner2) => formatSpanWorker( - originalRange, - enclosingNode, - SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, formatContext.options), - getOwnOrInheritedDelta(enclosingNode, formatContext.options, sourceFile), - scanner2, - formatContext, - requestKind, - prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), - sourceFile - ) - ); -} -function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, { options, getRules, host }, requestKind, rangeContainsError, sourceFile) { - var _a; - const formattingContext = new FormattingContext(sourceFile, requestKind, options); - let previousRangeTriviaEnd; - let previousRange; - let previousParent; - let previousRangeStartLine; - let lastIndentedLine; - let indentationOnLastIndentedLine = -1 /* Unknown */; - const edits = []; - formattingScanner.advance(); - if (formattingScanner.isOnToken()) { - const startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; - let undecoratedStartLine = startLine; - if (hasDecorators(enclosingNode)) { - undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; - } - processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); - } - const remainingTrivia = formattingScanner.getCurrentLeadingTrivia(); - if (remainingTrivia) { - const indentation = SmartIndenter.nodeWillIndentChild( - options, - enclosingNode, - /*child*/ - void 0, - sourceFile, - /*indentByDefault*/ - false - ) ? initialIndentation + options.indentSize : initialIndentation; - indentTriviaItems( - remainingTrivia, - indentation, - /*indentNextTokenOrTrivia*/ - true, - (item) => { - processRange( - item, - sourceFile.getLineAndCharacterOfPosition(item.pos), - enclosingNode, - enclosingNode, - /*dynamicIndentation*/ - void 0 - ); - insertIndentation( - item.pos, - indentation, - /*lineAdded*/ - false - ); - } - ); - if (options.trimTrailingWhitespace !== false) { - trimTrailingWhitespacesForRemainingRange(remainingTrivia); - } - } - if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) { - const tokenInfo = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() : formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(enclosingNode).token : void 0; - if (tokenInfo && tokenInfo.pos === previousRangeTriviaEnd) { - const parent2 = ((_a = findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode)) == null ? void 0 : _a.parent) || previousParent; - processPair( - tokenInfo, - sourceFile.getLineAndCharacterOfPosition(tokenInfo.pos).line, - parent2, - previousRange, - previousRangeStartLine, - previousParent, - parent2, - /*dynamicIndentation*/ - void 0 - ); - } - } - return edits; - function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { - if (rangeOverlapsWithStartEnd(range, startPos, endPos) || rangeContainsStartEnd(range, startPos, endPos)) { - if (inheritedIndentation !== -1 /* Unknown */) { - return inheritedIndentation; - } - } else { - const startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; - const startLinePosition = getLineStartPositionForPosition(startPos, sourceFile); - const column = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (startLine !== parentStartLine || startPos === column) { - const baseIndentSize = SmartIndenter.getBaseIndentation(options); - return baseIndentSize > column ? baseIndentSize : column; - } - } - return -1 /* Unknown */; - } - function computeIndentation(node, startLine, inheritedIndentation, parent2, parentDynamicIndentation, effectiveParentStartLine) { - const delta2 = SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0; - if (effectiveParentStartLine === startLine) { - return { - indentation: startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(), - delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta2) - }; - } else if (inheritedIndentation === -1 /* Unknown */) { - if (node.kind === 21 /* OpenParenToken */ && startLine === lastIndentedLine) { - return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) }; - } else if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent2, node, startLine, sourceFile) || SmartIndenter.childIsUnindentedBranchOfConditionalExpression(parent2, node, startLine, sourceFile) || SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(parent2, node, startLine, sourceFile)) { - return { indentation: parentDynamicIndentation.getIndentation(), delta: delta2 }; - } else { - return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta2 }; - } - } else { - return { indentation: inheritedIndentation, delta: delta2 }; - } - } - function getFirstNonDecoratorTokenOfNode(node) { - if (canHaveModifiers(node)) { - const modifier = find(node.modifiers, isModifier, findIndex(node.modifiers, isDecorator)); - if (modifier) return modifier.kind; - } - switch (node.kind) { - case 264 /* ClassDeclaration */: - return 86 /* ClassKeyword */; - case 265 /* InterfaceDeclaration */: - return 120 /* InterfaceKeyword */; - case 263 /* FunctionDeclaration */: - return 100 /* FunctionKeyword */; - case 267 /* EnumDeclaration */: - return 267 /* EnumDeclaration */; - case 178 /* GetAccessor */: - return 139 /* GetKeyword */; - case 179 /* SetAccessor */: - return 153 /* SetKeyword */; - case 175 /* MethodDeclaration */: - if (node.asteriskToken) { - return 42 /* AsteriskToken */; - } - // falls through - case 173 /* PropertyDeclaration */: - case 170 /* Parameter */: - const name = getNameOfDeclaration(node); - if (name) { - return name.kind; - } - } - } - function getDynamicIndentation(node, nodeStartLine, indentation, delta2) { - return { - getIndentationForComment: (kind, tokenIndentation, container) => { - switch (kind) { - // preceding comment to the token that closes the indentation scope inherits the indentation from the scope - // .. { - // // comment - // } - case 20 /* CloseBraceToken */: - case 24 /* CloseBracketToken */: - case 22 /* CloseParenToken */: - return indentation + getDelta(container); - } - return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation; - }, - // if list end token is LessThanToken '>' then its delta should be explicitly suppressed - // so that LessThanToken as a binary operator can still be indented. - // foo.then - // < - // number, - // string, - // >(); - // vs - // var a = xValue - // > yValue; - getIndentationForToken: (line, kind, container, suppressDelta) => !suppressDelta && shouldAddDelta(line, kind, container) ? indentation + getDelta(container) : indentation, - getIndentation: () => indentation, - getDelta, - recomputeIndentation: (lineAdded, parent2) => { - if (SmartIndenter.shouldIndentChildNode(options, parent2, node, sourceFile)) { - indentation += lineAdded ? options.indentSize : -options.indentSize; - delta2 = SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0; - } - } - }; - function shouldAddDelta(line, kind, container) { - switch (kind) { - // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent - case 19 /* OpenBraceToken */: - case 20 /* CloseBraceToken */: - case 22 /* CloseParenToken */: - case 93 /* ElseKeyword */: - case 117 /* WhileKeyword */: - case 60 /* AtToken */: - return false; - case 44 /* SlashToken */: - case 32 /* GreaterThanToken */: - switch (container.kind) { - case 287 /* JsxOpeningElement */: - case 288 /* JsxClosingElement */: - case 286 /* JsxSelfClosingElement */: - return false; - } - break; - case 23 /* OpenBracketToken */: - case 24 /* CloseBracketToken */: - if (container.kind !== 201 /* MappedType */) { - return false; - } - break; - } - return nodeStartLine !== line && !(hasDecorators(node) && kind === getFirstNonDecoratorTokenOfNode(node)); - } - function getDelta(child) { - return SmartIndenter.nodeWillIndentChild( - options, - node, - child, - sourceFile, - /*indentByDefault*/ - true - ) ? delta2 : 0; - } - } - function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta2) { - if (!rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { - return; - } - const nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta2); - let childContextNode = contextNode; - forEachChild( - node, - (child) => { - processChildNode( - child, - /*inheritedIndentation*/ - -1 /* Unknown */, - node, - nodeDynamicIndentation, - nodeStartLine, - undecoratedNodeStartLine, - /*isListItem*/ - false - ); - }, - (nodes) => { - processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); - } - ); - while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { - const tokenInfo = formattingScanner.readTokenInfo(node); - if (tokenInfo.token.end > Math.min(node.end, originalRange.end)) { - break; - } - consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node); - } - function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { - Debug.assert(!nodeIsSynthesized(child)); - if (nodeIsMissing(child) || isGrammarError(parent2, child)) { - return inheritedIndentation; - } - const childStartPos = child.getStart(sourceFile); - const childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; - let undecoratedChildStartLine = childStartLine; - if (hasDecorators(child)) { - undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(child, sourceFile)).line; - } - let childIndentationAmount = -1 /* Unknown */; - if (isListItem && rangeContainsRange(originalRange, parent2)) { - childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); - if (childIndentationAmount !== -1 /* Unknown */) { - inheritedIndentation = childIndentationAmount; - } - } - if (!rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { - if (child.end < originalRange.pos) { - formattingScanner.skipToEndOf(child); - } - return inheritedIndentation; - } - if (child.getFullWidth() === 0) { - return inheritedIndentation; - } - while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { - const tokenInfo = formattingScanner.readTokenInfo(node); - if (tokenInfo.token.end > originalRange.end) { - return inheritedIndentation; - } - if (tokenInfo.token.end > childStartPos) { - if (tokenInfo.token.pos > childStartPos) { - formattingScanner.skipToStartOf(child); - } - break; - } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node); - } - if (!formattingScanner.isOnToken() || formattingScanner.getTokenFullStart() >= originalRange.end) { - return inheritedIndentation; - } - if (isToken(child)) { - const tokenInfo = formattingScanner.readTokenInfo(child); - if (child.kind !== 12 /* JsxText */) { - Debug.assert(tokenInfo.token.end === child.end, "Token end is child end"); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); - return inheritedIndentation; - } - } - const effectiveParentStartLine = child.kind === 171 /* 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 === 210 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { - inheritedIndentation = childIndentation.indentation; - } - return inheritedIndentation; - } - function processChildNodes(nodes, parent2, parentStartLine, parentDynamicIndentation) { - Debug.assert(isNodeArray(nodes)); - Debug.assert(!nodeIsSynthesized(nodes)); - const listStartToken = getOpenTokenForList(parent2, nodes); - let listDynamicIndentation = parentDynamicIndentation; - let startLine = parentStartLine; - if (!rangeOverlapsWithStartEnd(originalRange, nodes.pos, nodes.end)) { - if (nodes.end < originalRange.pos) { - formattingScanner.skipToEndOf(nodes); - } - return; - } - if (listStartToken !== 0 /* Unknown */) { - while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { - const tokenInfo = formattingScanner.readTokenInfo(parent2); - if (tokenInfo.token.end > nodes.pos) { - break; - } else if (tokenInfo.token.kind === listStartToken) { - startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - consumeTokenAndAdvanceScanner(tokenInfo, parent2, parentDynamicIndentation, parent2); - let indentationOnListStartToken; - if (indentationOnLastIndentedLine !== -1 /* Unknown */) { - indentationOnListStartToken = indentationOnLastIndentedLine; - } else { - const startLinePosition = getLineStartPositionForPosition(tokenInfo.token.pos, sourceFile); - indentationOnListStartToken = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, tokenInfo.token.pos, sourceFile, options); - } - listDynamicIndentation = getDynamicIndentation(parent2, parentStartLine, indentationOnListStartToken, options.indentSize); - } else { - consumeTokenAndAdvanceScanner(tokenInfo, parent2, parentDynamicIndentation, parent2); - } - } - } - let inheritedIndentation = -1 /* Unknown */; - for (let i = 0; i < nodes.length; i++) { - const child = nodes[i]; - inheritedIndentation = processChildNode( - child, - inheritedIndentation, - node, - listDynamicIndentation, - startLine, - startLine, - /*isListItem*/ - true, - /*isFirstListItem*/ - i === 0 - ); - } - const listEndToken = getCloseTokenForOpenToken(listStartToken); - if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { - let tokenInfo = formattingScanner.readTokenInfo(parent2); - if (tokenInfo.token.kind === 28 /* CommaToken */) { - consumeTokenAndAdvanceScanner(tokenInfo, parent2, listDynamicIndentation, parent2); - tokenInfo = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent2) : void 0; - } - if (tokenInfo && tokenInfo.token.kind === listEndToken && rangeContainsRange(parent2, tokenInfo.token)) { - consumeTokenAndAdvanceScanner( - tokenInfo, - parent2, - listDynamicIndentation, - parent2, - /*isListEndToken*/ - true - ); - } - } - } - function consumeTokenAndAdvanceScanner(currentTokenInfo, parent2, dynamicIndentation, container, isListEndToken) { - Debug.assert(rangeContainsRange(parent2, currentTokenInfo.token)); - const lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); - let indentToken = false; - if (currentTokenInfo.leadingTrivia) { - processTrivia(currentTokenInfo.leadingTrivia, parent2, childContextNode, dynamicIndentation); - } - let lineAction = 0 /* None */; - const isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); - const tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); - if (isTokenInRange) { - const rangeHasError = rangeContainsError(currentTokenInfo.token); - const savePreviousRange = previousRange; - lineAction = processRange(currentTokenInfo.token, tokenStart, parent2, childContextNode, dynamicIndentation); - if (!rangeHasError) { - if (lineAction === 0 /* None */) { - const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line; - indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine; - } else { - indentToken = lineAction === 1 /* LineAdded */; - } - } - } - if (currentTokenInfo.trailingTrivia) { - previousRangeTriviaEnd = last(currentTokenInfo.trailingTrivia).end; - processTrivia(currentTokenInfo.trailingTrivia, parent2, childContextNode, dynamicIndentation); - } - if (indentToken) { - const tokenIndentation = isTokenInRange && !rangeContainsError(currentTokenInfo.token) ? dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken) : -1 /* Unknown */; - let indentNextTokenOrTrivia = true; - if (currentTokenInfo.leadingTrivia) { - const commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container); - indentNextTokenOrTrivia = indentTriviaItems(currentTokenInfo.leadingTrivia, commentIndentation, indentNextTokenOrTrivia, (item) => insertIndentation( - item.pos, - commentIndentation, - /*lineAdded*/ - false - )); - } - if (tokenIndentation !== -1 /* Unknown */ && indentNextTokenOrTrivia) { - insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === 1 /* LineAdded */); - lastIndentedLine = tokenStart.line; - indentationOnLastIndentedLine = tokenIndentation; - } - } - formattingScanner.advance(); - childContextNode = parent2; - } - } - function indentTriviaItems(trivia, commentIndentation, indentNextTokenOrTrivia, indentSingleLine) { - for (const triviaItem of trivia) { - const triviaInRange = rangeContainsRange(originalRange, triviaItem); - switch (triviaItem.kind) { - case 3 /* MultiLineCommentTrivia */: - if (triviaInRange) { - indentMultilineComment( - triviaItem, - commentIndentation, - /*firstLineIsIndented*/ - !indentNextTokenOrTrivia - ); - } - indentNextTokenOrTrivia = false; - break; - case 2 /* SingleLineCommentTrivia */: - if (indentNextTokenOrTrivia && triviaInRange) { - indentSingleLine(triviaItem); - } - indentNextTokenOrTrivia = false; - break; - case 4 /* NewLineTrivia */: - indentNextTokenOrTrivia = true; - break; - } - } - return indentNextTokenOrTrivia; - } - function processTrivia(trivia, parent2, contextNode, dynamicIndentation) { - for (const triviaItem of trivia) { - if (isComment(triviaItem.kind) && rangeContainsRange(originalRange, triviaItem)) { - const triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); - processRange(triviaItem, triviaItemStart, parent2, contextNode, dynamicIndentation); - } - } - } - function processRange(range, rangeStart, parent2, contextNode, dynamicIndentation) { - const rangeHasError = rangeContainsError(range); - let lineAction = 0 /* None */; - if (!rangeHasError) { - if (!previousRange) { - const originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); - trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); - } else { - lineAction = processPair(range, rangeStart.line, parent2, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); - } - } - previousRange = range; - previousRangeTriviaEnd = range.end; - previousParent = parent2; - previousRangeStartLine = rangeStart.line; - return lineAction; - } - function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent2, contextNode, dynamicIndentation) { - formattingContext.updateContext(previousItem, previousParent2, currentItem, currentParent, contextNode); - const rules = getRules(formattingContext); - let trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; - let lineAction = 0 /* None */; - if (rules) { - forEachRight(rules, (rule2) => { - lineAction = applyRuleEdits(rule2, previousItem, previousStartLine, currentItem, currentStartLine); - if (dynamicIndentation) { - switch (lineAction) { - case 2 /* LineRemoved */: - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation( - /*lineAddedByFormatting*/ - false, - contextNode - ); - } - break; - case 1 /* LineAdded */: - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation( - /*lineAddedByFormatting*/ - true, - contextNode - ); - } - break; - default: - Debug.assert(lineAction === 0 /* None */); - } - } - trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule2.action & 16 /* DeleteSpace */) && rule2.flags !== 1 /* CanDeleteNewLines */; - }); - } else { - trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1 /* EndOfFileToken */; - } - if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { - trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); - } - return lineAction; - } - function insertIndentation(pos, indentation, lineAdded) { - const indentationString = getIndentationString(indentation, options); - if (lineAdded) { - recordReplace(pos, 0, indentationString); - } else { - const tokenStart = sourceFile.getLineAndCharacterOfPosition(pos); - const startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile); - if (indentation !== characterToColumn(startLinePosition, tokenStart.character) || indentationIsDifferent(indentationString, startLinePosition)) { - recordReplace(startLinePosition, tokenStart.character, indentationString); - } - } - } - function characterToColumn(startLinePosition, characterInLine) { - let column = 0; - for (let i = 0; i < characterInLine; i++) { - if (sourceFile.text.charCodeAt(startLinePosition + i) === 9 /* tab */) { - column += options.tabSize - column % options.tabSize; - } else { - column++; - } - } - return column; - } - function indentationIsDifferent(indentationString, startLinePosition) { - return indentationString !== sourceFile.text.substr(startLinePosition, indentationString.length); - } - function indentMultilineComment(commentRange, indentation, firstLineIsIndented, indentFinalLine = true) { - let startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; - const endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; - if (startLine === endLine) { - if (!firstLineIsIndented) { - insertIndentation( - commentRange.pos, - indentation, - /*lineAdded*/ - false - ); - } - return; - } - const parts = []; - let startPos = commentRange.pos; - for (let line = startLine; line < endLine; line++) { - const endOfLine = getEndLinePosition(line, sourceFile); - parts.push({ pos: startPos, end: endOfLine }); - startPos = getStartPositionOfLine(line + 1, sourceFile); - } - if (indentFinalLine) { - parts.push({ pos: startPos, end: commentRange.end }); - } - if (parts.length === 0) return; - const startLinePos = getStartPositionOfLine(startLine, sourceFile); - const nonWhitespaceColumnInFirstPart = SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); - let startIndex = 0; - if (firstLineIsIndented) { - startIndex = 1; - startLine++; - } - const delta2 = indentation - nonWhitespaceColumnInFirstPart.column; - for (let i = startIndex; i < parts.length; i++, startLine++) { - const startLinePos2 = getStartPositionOfLine(startLine, sourceFile); - const nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); - const newIndentation = nonWhitespaceCharacterAndColumn.column + delta2; - if (newIndentation > 0) { - const indentationString = getIndentationString(newIndentation, options); - recordReplace(startLinePos2, nonWhitespaceCharacterAndColumn.character, indentationString); - } else { - recordDelete(startLinePos2, nonWhitespaceCharacterAndColumn.character); - } - } - } - function trimTrailingWhitespacesForLines(line1, line2, range) { - for (let line = line1; line < line2; line++) { - const lineStartPosition = getStartPositionOfLine(line, sourceFile); - const lineEndPosition = getEndLinePosition(line, sourceFile); - if (range && (isComment(range.kind) || isStringOrRegularExpressionOrTemplateLiteral(range.kind)) && range.pos <= lineEndPosition && range.end > lineEndPosition) { - continue; - } - const whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition); - if (whitespaceStart !== -1) { - Debug.assert(whitespaceStart === lineStartPosition || !isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(whitespaceStart - 1))); - recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart); - } - } - } - function getTrailingWhitespaceStartPosition(start, end) { - let pos = end; - while (pos >= start && isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) { - pos--; - } - if (pos !== end) { - return pos + 1; - } - return -1; - } - function trimTrailingWhitespacesForRemainingRange(trivias) { - let startPos = previousRange ? previousRange.end : originalRange.pos; - for (const trivia of trivias) { - if (isComment(trivia.kind)) { - if (startPos < trivia.pos) { - trimTrailingWitespacesForPositions(startPos, trivia.pos - 1, previousRange); - } - startPos = trivia.end + 1; - } - } - if (startPos < originalRange.end) { - trimTrailingWitespacesForPositions(startPos, originalRange.end, previousRange); - } - } - function trimTrailingWitespacesForPositions(startPos, endPos, previousRange2) { - const startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; - const endLine = sourceFile.getLineAndCharacterOfPosition(endPos).line; - trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange2); - } - function recordDelete(start, len) { - if (len) { - edits.push(createTextChangeFromStartLength(start, len, "")); - } - } - function recordReplace(start, len, newText) { - if (len || newText) { - edits.push(createTextChangeFromStartLength(start, len, newText)); - } - } - function recordInsert(start, text) { - if (text) { - edits.push(createTextChangeFromStartLength(start, 0, text)); - } - } - function applyRuleEdits(rule2, previousRange2, previousStartLine, currentRange, currentStartLine) { - const onLaterLine = currentStartLine !== previousStartLine; - switch (rule2.action) { - case 1 /* StopProcessingSpaceActions */: - return 0 /* None */; - case 16 /* DeleteSpace */: - if (previousRange2.end !== currentRange.pos) { - recordDelete(previousRange2.end, currentRange.pos - previousRange2.end); - return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; - } - break; - case 32 /* DeleteToken */: - recordDelete(previousRange2.pos, previousRange2.end - previousRange2.pos); - break; - case 8 /* InsertNewLine */: - if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return 0 /* None */; - } - const lineDelta = currentStartLine - previousStartLine; - if (lineDelta !== 1) { - recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, getNewLineOrDefaultFromHost(host, options)); - return onLaterLine ? 0 /* None */ : 1 /* LineAdded */; - } - break; - case 4 /* InsertSpace */: - if (rule2.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return 0 /* None */; - } - const posDelta = currentRange.pos - previousRange2.end; - if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange2.end) !== 32 /* space */) { - recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, " "); - return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; - } - break; - case 64 /* InsertTrailingSemicolon */: - recordInsert(previousRange2.end, ";"); - } - return 0 /* None */; - } -} -function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenAtPosition = getTokenAtPosition(sourceFile, position)) { - const jsdoc = findAncestor(tokenAtPosition, isJSDoc); - if (jsdoc) tokenAtPosition = jsdoc.parent; - const tokenStart = tokenAtPosition.getStart(sourceFile); - if (tokenStart <= position && position < tokenAtPosition.getEnd()) { - return void 0; - } - precedingToken = precedingToken === null ? void 0 : precedingToken === void 0 ? findPrecedingToken(position, sourceFile) : precedingToken; - const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); - const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); - const commentRanges = concatenate(trailingRangesOfPreviousToken, leadingCommentRangesOfNextToken); - return commentRanges && find(commentRanges, (range) => rangeContainsPositionExclusive(range, position) || // The end marker of a single-line comment does not include the newline character. - // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position): - // - // // asdf ^\n - // - // But for closed multi-line comments, we don't want to be inside the comment in the following case: - // - // /* asdf */^ - // - // However, unterminated multi-line comments *do* contain their end. - // - // Internally, we represent the end of the comment at the newline and closing '/', respectively. - // - position === range.end && (range.kind === 2 /* SingleLineCommentTrivia */ || position === sourceFile.getFullWidth())); -} -function getOpenTokenForList(node, list) { - switch (node.kind) { - case 177 /* Constructor */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 220 /* ArrowFunction */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - if (node.typeParameters === list) { - return 30 /* LessThanToken */; - } else if (node.parameters === list) { - return 21 /* OpenParenToken */; - } - break; - case 214 /* CallExpression */: - case 215 /* NewExpression */: - if (node.typeArguments === list) { - return 30 /* LessThanToken */; - } else if (node.arguments === list) { - return 21 /* OpenParenToken */; - } - break; - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - if (node.typeParameters === list) { - return 30 /* LessThanToken */; - } - break; - case 184 /* TypeReference */: - case 216 /* TaggedTemplateExpression */: - case 187 /* TypeQuery */: - case 234 /* ExpressionWithTypeArguments */: - case 206 /* ImportType */: - if (node.typeArguments === list) { - return 30 /* LessThanToken */; - } - break; - case 188 /* TypeLiteral */: - return 19 /* OpenBraceToken */; - } - return 0 /* Unknown */; -} -function getCloseTokenForOpenToken(kind) { - switch (kind) { - case 21 /* OpenParenToken */: - return 22 /* CloseParenToken */; - case 30 /* LessThanToken */: - return 32 /* GreaterThanToken */; - case 19 /* OpenBraceToken */: - return 20 /* CloseBraceToken */; - } - return 0 /* Unknown */; -} -var internedSizes; -var internedTabsIndentation; -var internedSpacesIndentation; -function getIndentationString(indentation, options) { - const resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.tabSize || internedSizes.indentSize !== options.indentSize); - if (resetInternedStrings) { - internedSizes = { tabSize: options.tabSize, indentSize: options.indentSize }; - internedTabsIndentation = internedSpacesIndentation = void 0; - } - if (!options.convertTabsToSpaces) { - const tabs = Math.floor(indentation / options.tabSize); - const spaces = indentation - tabs * options.tabSize; - let tabString; - if (!internedTabsIndentation) { - internedTabsIndentation = []; - } - if (internedTabsIndentation[tabs] === void 0) { - internedTabsIndentation[tabs] = tabString = repeatString(" ", tabs); - } else { - tabString = internedTabsIndentation[tabs]; - } - return spaces ? tabString + repeatString(" ", spaces) : tabString; - } else { - let spacesString; - const quotient = Math.floor(indentation / options.indentSize); - const remainder = indentation % options.indentSize; - if (!internedSpacesIndentation) { - internedSpacesIndentation = []; - } - if (internedSpacesIndentation[quotient] === void 0) { - spacesString = repeatString(" ", options.indentSize * quotient); - internedSpacesIndentation[quotient] = spacesString; - } else { - spacesString = internedSpacesIndentation[quotient]; - } - return remainder ? spacesString + repeatString(" ", remainder) : spacesString; - } -} - -// src/services/formatting/smartIndenter.ts -var SmartIndenter; -((SmartIndenter2) => { - let Value; - ((Value2) => { - Value2[Value2["Unknown"] = -1] = "Unknown"; - })(Value || (Value = {})); - function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace = false) { - if (position > sourceFile.text.length) { - return getBaseIndentation(options); - } - if (options.indentStyle === 0 /* None */) { - return 0; - } - const precedingToken = findPrecedingToken( - position, - sourceFile, - /*startNode*/ - void 0, - /*excludeJsdoc*/ - true - ); - const enclosingCommentRange = getRangeOfEnclosingComment(sourceFile, position, precedingToken || null); - if (enclosingCommentRange && enclosingCommentRange.kind === 3 /* MultiLineCommentTrivia */) { - return getCommentIndent(sourceFile, position, options, enclosingCommentRange); - } - if (!precedingToken) { - return getBaseIndentation(options); - } - const precedingTokenIsLiteral = isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); - if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { - return 0; - } - const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - const currentToken = getTokenAtPosition(sourceFile, position); - const isObjectLiteral = currentToken.kind === 19 /* OpenBraceToken */ && currentToken.parent.kind === 211 /* ObjectLiteralExpression */; - if (options.indentStyle === 1 /* Block */ || isObjectLiteral) { - return getBlockIndent(sourceFile, position, options); - } - if (precedingToken.kind === 28 /* CommaToken */ && precedingToken.parent.kind !== 227 /* BinaryExpression */) { - const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation; - } - } - const containerList = getListByPosition(position, precedingToken.parent, sourceFile); - if (containerList && !rangeContainsRange(containerList, precedingToken)) { - const useTheSameBaseIndentation = [219 /* FunctionExpression */, 220 /* ArrowFunction */].includes(currentToken.parent.kind); - const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize; - return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize; - } - return getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options); - } - SmartIndenter2.getIndentation = getIndentation; - function getCommentIndent(sourceFile, position, options, enclosingCommentRange) { - const previousLine = getLineAndCharacterOfPosition(sourceFile, position).line - 1; - const commentStartLine = getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; - Debug.assert(commentStartLine >= 0); - if (previousLine <= commentStartLine) { - return findFirstNonWhitespaceColumn(getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); - } - const startPositionOfLine = getStartPositionOfLine(previousLine, sourceFile); - const { column, character } = findFirstNonWhitespaceCharacterAndColumn(startPositionOfLine, position, sourceFile, options); - if (column === 0) { - return column; - } - const firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPositionOfLine + character); - return firstNonWhitespaceCharacterCode === 42 /* asterisk */ ? column - 1 : column; - } - function getBlockIndent(sourceFile, position, options) { - let current = position; - while (current > 0) { - const char = sourceFile.text.charCodeAt(current); - if (!isWhiteSpaceLike(char)) { - break; - } - current--; - } - const lineStart = getLineStartPositionForPosition(current, sourceFile); - return findFirstNonWhitespaceColumn(lineStart, current, sourceFile, options); - } - function getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options) { - let previous; - let current = precedingToken; - while (current) { - if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode( - options, - current, - previous, - sourceFile, - /*isNextChild*/ - true - )) { - const currentStart = getStartLineAndCharacterForNode(current, sourceFile); - const nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); - const indentationDelta = nextTokenKind !== 0 /* Unknown */ ? assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; - return getIndentationForNodeWorker( - current, - currentStart, - /*ignoreActualIndentationRange*/ - void 0, - indentationDelta, - sourceFile, - /*isNextChild*/ - true, - options - ); - } - const actualIndentation = getActualIndentationForListItem( - current, - sourceFile, - options, - /*listIndentsChild*/ - true - ); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation; - } - previous = current; - current = current.parent; - } - return getBaseIndentation(options); - } - function getIndentationForNode(n, ignoreActualIndentationRange, sourceFile, options) { - const start = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); - return getIndentationForNodeWorker( - n, - start, - ignoreActualIndentationRange, - /*indentationDelta*/ - 0, - sourceFile, - /*isNextChild*/ - false, - options - ); - } - SmartIndenter2.getIndentationForNode = getIndentationForNode; - function getBaseIndentation(options) { - return options.baseIndentSize || 0; - } - SmartIndenter2.getBaseIndentation = getBaseIndentation; - function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, isNextChild, options) { - var _a; - let parent2 = current.parent; - while (parent2) { - let useActualIndentation = true; - if (ignoreActualIndentationRange) { - const start = current.getStart(sourceFile); - useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; - } - const containingListOrParentStart = getContainingListOrParentStart(parent2, current, sourceFile); - const parentAndChildShareLine = containingListOrParentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent2, current, currentStart.line, sourceFile); - if (useActualIndentation) { - const firstListChild = (_a = getContainingList(current, sourceFile)) == null ? void 0 : _a[0]; - const listIndentsChild = !!firstListChild && getStartLineAndCharacterForNode(firstListChild, sourceFile).line > containingListOrParentStart.line; - let actualIndentation = getActualIndentationForListItem(current, sourceFile, options, listIndentsChild); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation + indentationDelta; - } - actualIndentation = getActualIndentationForNode(current, parent2, currentStart, parentAndChildShareLine, sourceFile, options); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation + indentationDelta; - } - } - if (shouldIndentChildNode(options, parent2, current, sourceFile, isNextChild) && !parentAndChildShareLine) { - indentationDelta += options.indentSize; - } - const useTrueStart = isArgumentAndStartLineOverlapsExpressionBeingCalled(parent2, current, currentStart.line, sourceFile); - current = parent2; - parent2 = current.parent; - currentStart = useTrueStart ? sourceFile.getLineAndCharacterOfPosition(current.getStart(sourceFile)) : containingListOrParentStart; - } - return indentationDelta + getBaseIndentation(options); - } - function getContainingListOrParentStart(parent2, child, sourceFile) { - const containingList = getContainingList(child, sourceFile); - const startPos = containingList ? containingList.pos : parent2.getStart(sourceFile); - return sourceFile.getLineAndCharacterOfPosition(startPos); - } - function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { - const commaItemInfo = findListItemInfo(commaToken); - if (commaItemInfo && commaItemInfo.listItemIndex > 0) { - return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); - } else { - return -1 /* Unknown */; - } - } - function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 308 /* SourceFile */ || !parentAndChildShareLine); - if (!useActualIndentation) { - return -1 /* Unknown */; - } - return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); - } - let NextTokenKind; - ((NextTokenKind2) => { - NextTokenKind2[NextTokenKind2["Unknown"] = 0] = "Unknown"; - NextTokenKind2[NextTokenKind2["OpenBrace"] = 1] = "OpenBrace"; - NextTokenKind2[NextTokenKind2["CloseBrace"] = 2] = "CloseBrace"; - })(NextTokenKind || (NextTokenKind = {})); - function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { - const nextToken = findNextToken(precedingToken, current, sourceFile); - if (!nextToken) { - return 0 /* Unknown */; - } - if (nextToken.kind === 19 /* OpenBraceToken */) { - return 1 /* OpenBrace */; - } else if (nextToken.kind === 20 /* CloseBraceToken */) { - const nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine ? 2 /* CloseBrace */ : 0 /* Unknown */; - } - return 0 /* Unknown */; - } - function getStartLineAndCharacterForNode(n, sourceFile) { - return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); - } - function isArgumentAndStartLineOverlapsExpressionBeingCalled(parent2, child, childStartLine, sourceFile) { - if (!(isCallExpression(parent2) && contains(parent2.arguments, child))) { - return false; - } - const expressionOfCallExpressionEnd = parent2.expression.getEnd(); - const expressionOfCallExpressionEndLine = getLineAndCharacterOfPosition(sourceFile, expressionOfCallExpressionEnd).line; - return expressionOfCallExpressionEndLine === childStartLine; - } - SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; - function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) { - if (parent2.kind === 246 /* IfStatement */ && parent2.elseStatement === child) { - const elseKeyword = findChildOfKind(parent2, 93 /* ElseKeyword */, sourceFile); - Debug.assert(elseKeyword !== void 0); - const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; - return elseKeywordStartLine === childStartLine; - } - return false; - } - SmartIndenter2.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; - function childIsUnindentedBranchOfConditionalExpression(parent2, child, childStartLine, sourceFile) { - if (isConditionalExpression(parent2) && (child === parent2.whenTrue || child === parent2.whenFalse)) { - const conditionEndLine = getLineAndCharacterOfPosition(sourceFile, parent2.condition.end).line; - if (child === parent2.whenTrue) { - return childStartLine === conditionEndLine; - } else { - const trueStartLine = getStartLineAndCharacterForNode(parent2.whenTrue, sourceFile).line; - const trueEndLine = getLineAndCharacterOfPosition(sourceFile, parent2.whenTrue.end).line; - return conditionEndLine === trueStartLine && trueEndLine === childStartLine; - } - } - return false; - } - SmartIndenter2.childIsUnindentedBranchOfConditionalExpression = childIsUnindentedBranchOfConditionalExpression; - function argumentStartsOnSameLineAsPreviousArgument(parent2, child, childStartLine, sourceFile) { - if (isCallOrNewExpression(parent2)) { - if (!parent2.arguments) return false; - const currentNode = find(parent2.arguments, (arg) => arg.pos === child.pos); - if (!currentNode) return false; - const currentIndex = parent2.arguments.indexOf(currentNode); - if (currentIndex === 0) return false; - const previousNode = parent2.arguments[currentIndex - 1]; - const lineOfPreviousNode = getLineAndCharacterOfPosition(sourceFile, previousNode.getEnd()).line; - if (childStartLine === lineOfPreviousNode) { - return true; - } - } - return false; - } - SmartIndenter2.argumentStartsOnSameLineAsPreviousArgument = argumentStartsOnSameLineAsPreviousArgument; - function getContainingList(node, sourceFile) { - return node.parent && getListByRange(node.getStart(sourceFile), node.getEnd(), node.parent, sourceFile); - } - SmartIndenter2.getContainingList = getContainingList; - function getListByPosition(pos, node, sourceFile) { - return node && getListByRange(pos, pos, node, sourceFile); - } - function getListByRange(start, end, node, sourceFile) { - switch (node.kind) { - case 184 /* TypeReference */: - return getList(node.typeArguments); - case 211 /* ObjectLiteralExpression */: - return getList(node.properties); - case 210 /* ArrayLiteralExpression */: - return getList(node.elements); - case 188 /* TypeLiteral */: - return getList(node.members); - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 220 /* ArrowFunction */: - case 175 /* MethodDeclaration */: - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 177 /* Constructor */: - case 186 /* ConstructorType */: - case 181 /* ConstructSignature */: - return getList(node.typeParameters) || getList(node.parameters); - case 178 /* GetAccessor */: - return getList(node.parameters); - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 346 /* JSDocTemplateTag */: - return getList(node.typeParameters); - case 215 /* NewExpression */: - case 214 /* CallExpression */: - return getList(node.typeArguments) || getList(node.arguments); - case 262 /* VariableDeclarationList */: - return getList(node.declarations); - case 276 /* NamedImports */: - case 280 /* NamedExports */: - return getList(node.elements); - case 207 /* ObjectBindingPattern */: - case 208 /* ArrayBindingPattern */: - return getList(node.elements); - } - function getList(list) { - return list && rangeContainsStartEnd(getVisualListRange(node, list, sourceFile), start, end) ? list : void 0; - } - } - function getVisualListRange(node, list, sourceFile) { - const children = node.getChildren(sourceFile); - for (let i = 1; i < children.length - 1; i++) { - if (children[i].pos === list.pos && children[i].end === list.end) { - return { pos: children[i - 1].end, end: children[i + 1].getStart(sourceFile) }; - } - } - return list; - } - function getActualIndentationForListStartLine(list, sourceFile, options) { - if (!list) { - return -1 /* Unknown */; - } - return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); - } - function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 262 /* VariableDeclarationList */) { - return -1 /* Unknown */; - } - const containingList = getContainingList(node, sourceFile); - if (containingList) { - const index = containingList.indexOf(node); - if (index !== -1) { - const result = deriveActualIndentationFromList(containingList, index, sourceFile, options); - if (result !== -1 /* Unknown */) { - return result; - } - } - return getActualIndentationForListStartLine(containingList, sourceFile, options) + (listIndentsChild ? options.indentSize : 0); - } - return -1 /* Unknown */; - } - function deriveActualIndentationFromList(list, index, sourceFile, options) { - Debug.assert(index >= 0 && index < list.length); - const node = list[index]; - let lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); - for (let i = index - 1; i >= 0; i--) { - if (list[i].kind === 28 /* CommaToken */) { - continue; - } - const prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line; - if (prevEndLine !== lineAndCharacter.line) { - return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); - } - lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile); - } - return -1 /* Unknown */; - } - function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { - const lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); - return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); - } - function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { - let character = 0; - let column = 0; - for (let pos = startPos; pos < endPos; pos++) { - const ch = sourceFile.text.charCodeAt(pos); - if (!isWhiteSpaceSingleLine(ch)) { - break; - } - if (ch === 9 /* tab */) { - column += options.tabSize + column % options.tabSize; - } else { - column++; - } - character++; - } - return { column, character }; - } - SmartIndenter2.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; - function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { - return findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options).column; - } - SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; - function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) { - const childKind = child ? child.kind : 0 /* Unknown */; - switch (parent2.kind) { - case 245 /* ExpressionStatement */: - case 264 /* ClassDeclaration */: - case 232 /* ClassExpression */: - case 265 /* InterfaceDeclaration */: - case 267 /* EnumDeclaration */: - case 266 /* TypeAliasDeclaration */: - case 210 /* ArrayLiteralExpression */: - case 242 /* Block */: - case 269 /* ModuleBlock */: - case 211 /* ObjectLiteralExpression */: - case 188 /* TypeLiteral */: - case 201 /* MappedType */: - case 190 /* TupleType */: - case 218 /* ParenthesizedExpression */: - case 212 /* PropertyAccessExpression */: - case 214 /* CallExpression */: - case 215 /* NewExpression */: - case 244 /* VariableStatement */: - case 278 /* ExportAssignment */: - case 254 /* ReturnStatement */: - case 228 /* ConditionalExpression */: - case 208 /* ArrayBindingPattern */: - case 207 /* ObjectBindingPattern */: - case 287 /* JsxOpeningElement */: - case 290 /* JsxOpeningFragment */: - case 286 /* JsxSelfClosingElement */: - case 295 /* JsxExpression */: - case 174 /* MethodSignature */: - case 180 /* CallSignature */: - case 181 /* ConstructSignature */: - case 170 /* Parameter */: - case 185 /* FunctionType */: - case 186 /* ConstructorType */: - case 197 /* ParenthesizedType */: - case 216 /* TaggedTemplateExpression */: - case 224 /* AwaitExpression */: - case 280 /* NamedExports */: - case 276 /* NamedImports */: - case 282 /* ExportSpecifier */: - case 277 /* ImportSpecifier */: - case 173 /* PropertyDeclaration */: - case 297 /* CaseClause */: - case 298 /* DefaultClause */: - return true; - case 270 /* CaseBlock */: - return settings.indentSwitchCase ?? true; - case 261 /* VariableDeclaration */: - case 304 /* PropertyAssignment */: - case 227 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 211 /* ObjectLiteralExpression */) { - return rangeIsOnOneLine(sourceFile, child); - } - if (parent2.kind === 227 /* BinaryExpression */ && sourceFile && child && childKind === 285 /* 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 !== 227 /* BinaryExpression */) { - return true; - } - break; - case 247 /* DoStatement */: - case 248 /* WhileStatement */: - case 250 /* ForInStatement */: - case 251 /* ForOfStatement */: - case 249 /* ForStatement */: - case 246 /* IfStatement */: - case 263 /* FunctionDeclaration */: - case 219 /* FunctionExpression */: - case 175 /* MethodDeclaration */: - case 177 /* Constructor */: - case 178 /* GetAccessor */: - case 179 /* SetAccessor */: - return childKind !== 242 /* Block */; - case 220 /* ArrowFunction */: - if (sourceFile && childKind === 218 /* ParenthesizedExpression */) { - return rangeIsOnOneLine(sourceFile, child); - } - return childKind !== 242 /* Block */; - case 279 /* ExportDeclaration */: - return childKind !== 280 /* NamedExports */; - case 273 /* ImportDeclaration */: - return childKind !== 274 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 276 /* NamedImports */; - case 285 /* JsxElement */: - return childKind !== 288 /* JsxClosingElement */; - case 289 /* JsxFragment */: - return childKind !== 291 /* JsxClosingFragment */; - case 194 /* IntersectionType */: - case 193 /* UnionType */: - case 239 /* SatisfiesExpression */: - if (childKind === 188 /* TypeLiteral */ || childKind === 190 /* TupleType */ || childKind === 201 /* MappedType */) { - return false; - } - break; - case 259 /* TryStatement */: - if (childKind === 242 /* Block */) { - return false; - } - break; - } - return indentByDefault; - } - SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild; - function isControlFlowEndingStatement(kind, parent2) { - switch (kind) { - case 254 /* ReturnStatement */: - case 258 /* ThrowStatement */: - case 252 /* ContinueStatement */: - case 253 /* BreakStatement */: - return parent2.kind !== 242 /* Block */; - default: - return false; - } - } - function shouldIndentChildNode(settings, parent2, child, sourceFile, isNextChild = false) { - return nodeWillIndentChild( - settings, - parent2, - child, - sourceFile, - /*indentByDefault*/ - false - ) && !(isNextChild && child && isControlFlowEndingStatement(child.kind, parent2)); - } - SmartIndenter2.shouldIndentChildNode = shouldIndentChildNode; - function rangeIsOnOneLine(sourceFile, range) { - const rangeStart = skipTrivia(sourceFile.text, range.pos); - const startLine = sourceFile.getLineAndCharacterOfPosition(rangeStart).line; - const endLine = sourceFile.getLineAndCharacterOfPosition(range.end).line; - return startLine === endLine; - } -})(SmartIndenter || (SmartIndenter = {})); - -// src/services/_namespaces/ts.preparePasteEdits.ts -var ts_preparePasteEdits_exports = {}; -__export(ts_preparePasteEdits_exports, { - preparePasteEdits: () => preparePasteEdits -}); - -// src/services/preparePasteEdits.ts -function preparePasteEdits(sourceFile, copiedFromRange, checker) { - let shouldProvidePasteEdits = false; - copiedFromRange.forEach((range) => { - const enclosingNode = findAncestor( - getTokenAtPosition(sourceFile, range.pos), - (ancestorNode) => rangeContainsRange(ancestorNode, range) - ); - if (!enclosingNode) return; - forEachChild(enclosingNode, function checkNameResolution(node) { - var _a; - if (shouldProvidePasteEdits) return; - if (isIdentifier(node) && rangeContainsPosition(range, node.getStart(sourceFile))) { - const resolvedSymbol = checker.resolveName( - node.text, - node, - -1 /* All */, - /*excludeGlobals*/ - false - ); - if (resolvedSymbol && resolvedSymbol.declarations) { - for (const decl of resolvedSymbol.declarations) { - if (isInImport(decl) || !!(node.text && sourceFile.symbol && ((_a = sourceFile.symbol.exports) == null ? void 0 : _a.has(node.escapedText)))) { - shouldProvidePasteEdits = true; - return; - } - } - } - } - node.forEachChild(checkNameResolution); - }); - if (shouldProvidePasteEdits) return; - }); - return shouldProvidePasteEdits; -} - -// src/services/_namespaces/ts.PasteEdits.ts -var ts_PasteEdits_exports = {}; -__export(ts_PasteEdits_exports, { - pasteEditsProvider: () => pasteEditsProvider -}); - -// src/services/pasteEdits.ts -var fixId55 = "providePostPasteEdits"; -function pasteEditsProvider(targetFile, pastedText, pasteLocations, copiedFrom, host, preferences, formatContext, cancellationToken) { - const changes = ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => pasteEdits(targetFile, pastedText, pasteLocations, copiedFrom, host, preferences, formatContext, cancellationToken, changeTracker)); - return { edits: changes, fixId: fixId55 }; -} -function pasteEdits(targetFile, pastedText, pasteLocations, copiedFrom, host, preferences, formatContext, cancellationToken, changes) { - let actualPastedText; - if (pastedText.length !== pasteLocations.length) { - actualPastedText = pastedText.length === 1 ? pastedText[0] : pastedText.join(getNewLineOrDefaultFromHost(formatContext.host, formatContext.options)); - } - const statements = []; - let newText = targetFile.text; - for (let i = pasteLocations.length - 1; i >= 0; i--) { - const { pos, end } = pasteLocations[i]; - newText = actualPastedText ? newText.slice(0, pos) + actualPastedText + newText.slice(end) : newText.slice(0, pos) + pastedText[i] + newText.slice(end); - } - let importAdder; - Debug.checkDefined(host.runWithTemporaryFileUpdate).call(host, targetFile.fileName, newText, (updatedProgram, originalProgram, updatedFile) => { - importAdder = ts_codefix_exports.createImportAdder(updatedFile, updatedProgram, preferences, host); - if (copiedFrom == null ? void 0 : copiedFrom.range) { - Debug.assert(copiedFrom.range.length === pastedText.length); - copiedFrom.range.forEach((copy) => { - const statementsInSourceFile = copiedFrom.file.statements; - const startNodeIndex = findIndex(statementsInSourceFile, (s) => s.end > copy.pos); - if (startNodeIndex === -1) return void 0; - let endNodeIndex = findIndex(statementsInSourceFile, (s) => s.end >= copy.end, startNodeIndex); - if (endNodeIndex !== -1 && copy.end <= statementsInSourceFile[endNodeIndex].getStart()) { - endNodeIndex--; - } - statements.push(...statementsInSourceFile.slice(startNodeIndex, endNodeIndex === -1 ? statementsInSourceFile.length : endNodeIndex + 1)); - }); - Debug.assertIsDefined(originalProgram, "no original program found"); - const originalProgramTypeChecker = originalProgram.getTypeChecker(); - const usageInfoRange = getUsageInfoRangeForPasteEdits(copiedFrom); - const usage = getUsageInfo(copiedFrom.file, statements, originalProgramTypeChecker, getExistingLocals(updatedFile, statements, originalProgramTypeChecker), usageInfoRange); - const useEsModuleSyntax = !fileShouldUseJavaScriptRequire(targetFile.fileName, originalProgram, host, !!copiedFrom.file.commonJsModuleIndicator); - addExportsInOldFile(copiedFrom.file, usage.targetFileImportsFromOldFile, changes, useEsModuleSyntax); - addTargetFileImports(copiedFrom.file, usage.oldImportsNeededByTargetFile, usage.targetFileImportsFromOldFile, originalProgramTypeChecker, updatedProgram, importAdder); - } else { - const context = { - sourceFile: updatedFile, - program: originalProgram, - cancellationToken, - host, - preferences, - formatContext - }; - let offset = 0; - pasteLocations.forEach((location, i) => { - const oldTextLength = location.end - location.pos; - const textToBePasted = actualPastedText ?? pastedText[i]; - const startPos = location.pos + offset; - const endPos = startPos + textToBePasted.length; - const range = { pos: startPos, end: endPos }; - offset += textToBePasted.length - oldTextLength; - const enclosingNode = findAncestor( - getTokenAtPosition(context.sourceFile, range.pos), - (ancestorNode) => rangeContainsRange(ancestorNode, range) - ); - if (!enclosingNode) return; - forEachChild(enclosingNode, function importUnresolvedIdentifiers(node) { - const isImportCandidate = isIdentifier(node) && rangeContainsPosition(range, node.getStart(updatedFile)) && !(updatedProgram == null ? void 0 : updatedProgram.getTypeChecker().resolveName( - node.text, - node, - -1 /* All */, - /*excludeGlobals*/ - false - )); - if (isImportCandidate) { - return importAdder.addImportForUnresolvedIdentifier( - context, - node, - /*useAutoImportProvider*/ - true - ); - } - node.forEachChild(importUnresolvedIdentifiers); - }); - }); - } - importAdder.writeFixes(changes, getQuotePreference(copiedFrom ? copiedFrom.file : targetFile, preferences)); - }); - if (!importAdder.hasFixes()) { - return; - } - pasteLocations.forEach((paste, i) => { - changes.replaceRangeWithText( - targetFile, - { pos: paste.pos, end: paste.end }, - actualPastedText ?? pastedText[i] - ); - }); -} -function getUsageInfoRangeForPasteEdits({ file: sourceFile, range }) { - const pos = range[0].pos; - const end = range[range.length - 1].end; - const startToken = getTokenAtPosition(sourceFile, pos); - const endToken = findTokenOnLeftOfPosition(sourceFile, pos) ?? getTokenAtPosition(sourceFile, end); - return { - pos: isIdentifier(startToken) && pos <= startToken.getStart(sourceFile) ? startToken.getFullStart() : pos, - end: isIdentifier(endToken) && end === endToken.getEnd() ? ts_textChanges_exports.getAdjustedEndPosition(sourceFile, endToken, {}) : end - }; -} - -// 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, - 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, - 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, - ImportKind: () => ImportKind, - ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, - IndentStyle: () => IndentStyle, - IndexFlags: () => IndexFlags, - IndexKind: () => IndexKind, - InferenceFlags: () => InferenceFlags, - InferencePriority: () => InferencePriority, - InlayHintKind: () => InlayHintKind2, - InlayHints: () => ts_InlayHints_exports, - InternalEmitFlags: () => InternalEmitFlags, - InternalNodeBuilderFlags: () => InternalNodeBuilderFlags, - InternalSymbolName: () => InternalSymbolName, - IntersectionFlags: () => IntersectionFlags, - InvalidatedProjectKind: () => InvalidatedProjectKind, - JSDocParsingMode: () => JSDocParsingMode, - JsDoc: () => ts_JsDoc_exports, - JsTyping: () => ts_JsTyping_exports, - JsxEmit: () => JsxEmit, - JsxFlags: () => JsxFlags, - JsxReferenceKind: () => JsxReferenceKind, - LanguageFeatureMinimumTarget: () => LanguageFeatureMinimumTarget, - LanguageServiceMode: () => LanguageServiceMode, - LanguageVariant: () => LanguageVariant, - LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, - ListFormat: () => ListFormat, - LogLevel: () => LogLevel, - MapCode: () => ts_MapCode_exports, - 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, - PredicateSemantics: () => PredicateSemantics, - PreparePasteEdits: () => ts_preparePasteEdits_exports, - PrivateIdentifierKind: () => PrivateIdentifierKind, - ProcessLevel: () => ProcessLevel, - ProgramUpdateLevel: () => ProgramUpdateLevel, - QuotePreference: () => QuotePreference, - RegularExpressionFlags: () => RegularExpressionFlags, - 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, - SignatureInfo: () => SignatureInfo, - SignatureKind: () => SignatureKind, - SmartSelectionRange: () => ts_SmartSelectionRange_exports, - SnippetKind: () => SnippetKind, - StatisticType: () => StatisticType, - StructureIsReused: () => StructureIsReused, - SymbolAccessibility: () => SymbolAccessibility, - SymbolDisplay: () => ts_SymbolDisplay_exports, - SymbolDisplayPartKind: () => SymbolDisplayPartKind, - SymbolFlags: () => SymbolFlags, - SymbolFormatFlags: () => SymbolFormatFlags, - SyntaxKind: () => SyntaxKind, - 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, - 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, - arrayOf: () => arrayOf, - arrayReverseIterator: () => arrayReverseIterator, - arrayToMap: () => arrayToMap, - arrayToMultiMap: () => arrayToMultiMap, - arrayToNumericMap: () => arrayToNumericMap, - assertType: () => assertType, - assign: () => assign, - asyncSuperHelper: () => asyncSuperHelper, - attachFileToDiagnostics: () => attachFileToDiagnostics, - 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, - canHaveModuleSpecifier: () => canHaveModuleSpecifier, - canHaveSymbol: () => canHaveSymbol, - canIncludeBindAndCheckDiagnostics: () => canIncludeBindAndCheckDiagnostics, - canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, - canProduceDiagnostics: () => canProduceDiagnostics, - canUsePropertyAccess: () => canUsePropertyAccess, - canWatchAffectingLocation: () => canWatchAffectingLocation, - canWatchAtTypes: () => canWatchAtTypes, - canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, - canWatchDirectoryOrFilePath: () => canWatchDirectoryOrFilePath, - cartesianProduct: () => cartesianProduct, - cast: () => cast, - chainBundle: () => chainBundle, - chainDiagnosticMessages: () => chainDiagnosticMessages, - changeAnyExtension: () => changeAnyExtension, - changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, - changeExtension: () => changeExtension, - changeFullExtension: () => changeFullExtension, - changesAffectModuleResolution: () => changesAffectModuleResolution, - changesAffectingProgramStructure: () => changesAffectingProgramStructure, - characterCodeToRegularExpressionFlag: () => characterCodeToRegularExpressionFlag, - childIsDecorated: () => childIsDecorated, - classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, - classHasClassThisAssignment: () => classHasClassThisAssignment, - classHasDeclaredOrExplicitlyAssignedName: () => classHasDeclaredOrExplicitlyAssignedName, - classHasExplicitlyAssignedName: () => classHasExplicitlyAssignedName, - classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, - classicNameResolver: () => classicNameResolver, - classifier: () => ts_classifier_exports, - cleanExtendedConfigCache: () => cleanExtendedConfigCache, - clear: () => clear, - clearMap: () => clearMap, - clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, - climbPastPropertyAccess: () => climbPastPropertyAccess, - clone: () => clone, - cloneCompilerOptions: () => cloneCompilerOptions, - closeFileWatcher: () => closeFileWatcher, - closeFileWatcherOf: () => closeFileWatcherOf, - codefix: () => ts_codefix_exports, - collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, - collectExternalModuleInfo: () => collectExternalModuleInfo, - combine: () => combine, - combinePaths: () => combinePaths, - commandLineOptionOfCustomType: () => commandLineOptionOfCustomType, - commentPragmas: () => commentPragmas, - commonOptionsWithBuild: () => commonOptionsWithBuild, - compact: () => compact, - compareBooleans: () => compareBooleans, - compareDataObjects: () => compareDataObjects, - compareDiagnostics: () => compareDiagnostics, - 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, - compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, - compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, - compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, - compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, - compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, - computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, - computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, - computeLineOfPosition: () => computeLineOfPosition, - computeLineStarts: () => computeLineStarts, - computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, - 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, - createBuilderProgram: () => createBuilderProgram, - createBuilderProgramUsingIncrementalBuildInfo: () => createBuilderProgramUsingIncrementalBuildInfo, - createBuilderStatusReporter: () => createBuilderStatusReporter, - 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, - createEvaluator: () => createEvaluator, - createExpressionForJsxElement: () => createExpressionForJsxElement, - createExpressionForJsxFragment: () => createExpressionForJsxFragment, - createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, - createExpressionForPropertyName: () => createExpressionForPropertyName, - createExpressionFromEntityName: () => createExpressionFromEntityName, - createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createFileDiagnostic: () => createFileDiagnostic, - createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createFlowNode: () => createFlowNode, - createForOfBindingStatement: () => createForOfBindingStatement, - createFutureSourceFile: () => createFutureSourceFile, - createGetCanonicalFileName: () => createGetCanonicalFileName, - createGetIsolatedDeclarationErrors: () => createGetIsolatedDeclarationErrors, - createGetSourceFile: () => createGetSourceFile, - createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, - createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, - createGetSymbolWalker: () => createGetSymbolWalker, - createIncrementalCompilerHost: () => createIncrementalCompilerHost, - createIncrementalProgram: () => createIncrementalProgram, - createJsxFactoryExpression: () => createJsxFactoryExpression, - createLanguageService: () => createLanguageService, - createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createModeAwareCache: () => createModeAwareCache, - createModeAwareCacheKey: () => createModeAwareCacheKey, - createModeMismatchDetails: () => createModeMismatchDetails, - createModuleNotFoundChain: () => createModuleNotFoundChain, - createModuleResolutionCache: () => createModuleResolutionCache, - createModuleResolutionLoader: () => createModuleResolutionLoader, - createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache, - createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, - createMultiMap: () => createMultiMap, - createNameResolver: () => createNameResolver, - createNodeConverters: () => createNodeConverters, - createNodeFactory: () => createNodeFactory, - createOptionNameMap: () => createOptionNameMap, - createOverload: () => createOverload, - createPackageJsonImportFilter: () => createPackageJsonImportFilter, - createPackageJsonInfo: () => createPackageJsonInfo, - createParenthesizerRules: () => createParenthesizerRules, - createPatternMatcher: () => createPatternMatcher, - createPrinter: () => createPrinter, - createPrinterWithDefaults: () => createPrinterWithDefaults, - createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, - createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, - createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, - createProgram: () => createProgram, - createProgramDiagnostics: () => createProgramDiagnostics, - 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, - createSyntacticTypeNodeBuilder: () => createSyntacticTypeNodeBuilder, - 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, - createWatchCompilerHost: () => createWatchCompilerHost2, - createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, - createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, - createWatchFactory: () => createWatchFactory, - createWatchHost: () => createWatchHost, - createWatchProgram: () => createWatchProgram, - createWatchStatusReporter: () => createWatchStatusReporter, - createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - declarationNameToString: () => declarationNameToString, - decodeMappings: () => decodeMappings, - decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, - deduplicate: () => deduplicate, - defaultHoverMaximumTruncationLength: () => defaultHoverMaximumTruncationLength, - defaultInitCompilerOptions: () => defaultInitCompilerOptions, - defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, - diagnosticCategoryName: () => diagnosticCategoryName, - diagnosticToString: () => diagnosticToString, - diagnosticsEqualityComparer: () => diagnosticsEqualityComparer, - directoryProbablyExists: () => directoryProbablyExists, - directorySeparator: () => directorySeparator, - displayPart: () => displayPart, - displayPartsToString: () => displayPartsToString, - disposeEmitNodes: () => disposeEmitNodes, - documentSpansEqual: () => documentSpansEqual, - dumpTracingLegend: () => dumpTracingLegend, - elementAt: () => elementAt, - elideNodes: () => elideNodes, - emitDetachedComments: () => emitDetachedComments, - emitFiles: () => emitFiles, - emitFilesAndReportErrors: () => emitFilesAndReportErrors, - emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, - emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, - emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, - emitResolverSkipsTypeChecking: () => emitResolverSkipsTypeChecking, - emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, - emptyArray: () => emptyArray, - emptyFileSystemEntries: () => emptyFileSystemEntries, - emptyMap: () => emptyMap, - emptyOptions: () => emptyOptions, - endsWith: () => endsWith, - ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, - ensureScriptKind: () => ensureScriptKind, - ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, - entityNameToString: () => entityNameToString, - enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, - equalOwnProperties: () => equalOwnProperties, - equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, - equateStringsCaseSensitive: () => equateStringsCaseSensitive, - equateValues: () => equateValues, - escapeJsxAttributeString: () => escapeJsxAttributeString, - escapeLeadingUnderscores: () => escapeLeadingUnderscores, - escapeNonAsciiString: () => escapeNonAsciiString, - escapeSnippetText: () => escapeSnippetText, - escapeString: () => escapeString, - escapeTemplateSubstitution: () => escapeTemplateSubstitution, - evaluatorResult: () => evaluatorResult, - every: () => every, - exclusivelyPrefixedNodeCoreModules: () => exclusivelyPrefixedNodeCoreModules, - executeCommandLine: () => executeCommandLine, - expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, - explainFiles: () => explainFiles, - explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, - exportAssignmentIsAlias: () => exportAssignmentIsAlias, - expressionResultIsUnused: () => expressionResultIsUnused, - extend: () => extend, - 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, - findConstructorDeclaration: () => findConstructorDeclaration, - findContainingList: () => findContainingList, - findDiagnosticForNode: () => findDiagnosticForNode, - findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, - findIndex: () => findIndex, - findLast: () => findLast, - findLastIndex: () => findLastIndex, - findListItemInfo: () => findListItemInfo, - 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, - forEachAncestorDirectoryStoppingAtGlobalCache: () => forEachAncestorDirectoryStoppingAtGlobalCache, - forEachChild: () => forEachChild, - forEachChildRecursively: () => forEachChildRecursively, - forEachDynamicImportOrRequireCall: () => forEachDynamicImportOrRequireCall, - forEachEmittedFile: () => forEachEmittedFile, - forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, - forEachEntry: () => forEachEntry, - forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, - forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, - forEachKey: () => forEachKey, - forEachLeadingCommentRange: () => forEachLeadingCommentRange, - forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, - forEachNameOfDefaultExport: () => forEachNameOfDefaultExport, - forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName, - forEachProjectReference: () => forEachProjectReference, - forEachPropertyAssignment: () => forEachPropertyAssignment, - forEachResolvedProjectReference: () => forEachResolvedProjectReference, - forEachReturnStatement: () => forEachReturnStatement, - forEachRight: () => forEachRight, - forEachTrailingCommentRange: () => forEachTrailingCommentRange, - forEachTsConfigPropArray: () => forEachTsConfigPropArray, - forEachUnique: () => forEachUnique, - forEachYieldExpression: () => forEachYieldExpression, - formatColorAndReset: () => formatColorAndReset, - formatDiagnostic: () => formatDiagnostic, - formatDiagnostics: () => formatDiagnostics, - formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, - formatGeneratedName: () => formatGeneratedName, - formatGeneratedNamePart: () => formatGeneratedNamePart, - formatLocation: () => formatLocation, - formatMessage: () => formatMessage, - formatStringFromArgs: () => formatStringFromArgs, - formatting: () => ts_formatting_exports, - generateDjb2Hash: () => generateDjb2Hash, - generateTSConfig: () => generateTSConfig, - getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, - getAdjustedRenameLocation: () => getAdjustedRenameLocation, - getAliasDeclarationFromName: () => getAliasDeclarationFromName, - getAllAccessorDeclarations: () => getAllAccessorDeclarations, - getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, - getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, - getAllJSDocTags: () => getAllJSDocTags, - getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, - getAllKeys: () => getAllKeys, - getAllProjectOutputs: () => getAllProjectOutputs, - getAllSuperTypeNodes: () => getAllSuperTypeNodes, - getAllowImportingTsExtensions: () => getAllowImportingTsExtensions, - 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, - getCanonicalDiagnostic: () => getCanonicalDiagnostic, - getCheckFlags: () => getCheckFlags, - getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, - getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, - getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, - getCombinedModifierFlags: () => getCombinedModifierFlags, - getCombinedNodeFlags: () => getCombinedNodeFlags, - getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, - getCommentRange: () => getCommentRange, - getCommonSourceDirectory: () => getCommonSourceDirectory, - getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, - getCompilerOptionValue: () => getCompilerOptionValue, - 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, - getDeclarationDiagnostics: () => getDeclarationDiagnostics, - getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, - getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, - getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, - getDeclarationFileExtension: () => getDeclarationFileExtension, - getDeclarationFromName: () => getDeclarationFromName, - getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, - getDeclarationOfKind: () => getDeclarationOfKind, - getDeclarationsOfKind: () => getDeclarationsOfKind, - getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, - getDecorators: () => getDecorators, - getDefaultCompilerOptions: () => getDefaultCompilerOptions2, - getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, - getDefaultLibFileName: () => getDefaultLibFileName, - getDefaultLibFilePath: () => getDefaultLibFilePath, - getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, - getDefaultLikeExportNameFromDeclaration: () => getDefaultLikeExportNameFromDeclaration, - getDefaultResolutionModeForFileWorker: () => getDefaultResolutionModeForFileWorker, - 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, - getEmitModuleFormatOfFileWorker: () => getEmitModuleFormatOfFileWorker, - 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, - getImpliedNodeFormatForEmitWorker: () => getImpliedNodeFormatForEmitWorker, - getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, - getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, - getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, - getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, - getIndentString: () => getIndentString, - getInferredLibraryNameResolveFrom: () => getInferredLibraryNameResolveFrom, - getInitializedVariables: () => getInitializedVariables, - getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, - getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, - getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, - getInternalEmitFlags: () => getInternalEmitFlags, - getInvokedExpression: () => getInvokedExpression, - getIsFileExcluded: () => getIsFileExcluded, - 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, - 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, - getLibFileNameFromLibReference: () => getLibFileNameFromLibReference, - getLibNameFromLibReference: () => getLibNameFromLibReference, - getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName, - getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, - getLineInfo: () => getLineInfo, - getLineOfLocalPosition: () => getLineOfLocalPosition, - 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, - getNameOfScriptTarget: () => getNameOfScriptTarget, - getNameOrArgument: () => getNameOrArgument, - getNameTable: () => getNameTable, - getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, - getNewLineCharacter: () => getNewLineCharacter, - getNewLineKind: () => getNewLineKind, - getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, - getNewTargetContainer: () => getNewTargetContainer, - getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, - getNodeChildren: () => getNodeChildren, - getNodeForGeneratedName: () => getNodeForGeneratedName, - getNodeId: () => getNodeId, - getNodeKind: () => getNodeKind, - getNodeModifiers: () => getNodeModifiers, - getNodeModulePathParts: () => getNodeModulePathParts, - getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, - getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, - getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, - getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, - getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots, - getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode, - getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, - getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, - getNormalizedPathComponents: () => getNormalizedPathComponents, - getObjectFlags: () => getObjectFlags, - getOperatorAssociativity: () => getOperatorAssociativity, - getOperatorPrecedence: () => getOperatorPrecedence, - getOptionFromName: () => getOptionFromName, - getOptionsForLibraryResolution: () => getOptionsForLibraryResolution, - getOptionsNameMap: () => getOptionsNameMap, - getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue, - getOptionsSyntaxByValue: () => getOptionsSyntaxByValue, - getOrCreateEmitNode: () => getOrCreateEmitNode, - getOrUpdate: () => getOrUpdate, - getOriginalNode: () => getOriginalNode, - getOriginalNodeId: () => getOriginalNodeId, - getOutputDeclarationFileName: () => getOutputDeclarationFileName, - getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker, - getOutputExtension: () => getOutputExtension, - getOutputFileNames: () => getOutputFileNames, - getOutputJSFileNameWorker: () => getOutputJSFileNameWorker, - getOutputPathsFor: () => getOutputPathsFor, - getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, - getOwnKeys: () => getOwnKeys, - getOwnValues: () => getOwnValues, - getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, - getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, - getPackageScopeForPath: () => getPackageScopeForPath, - getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, - getParentNodeInSpan: () => getParentNodeInSpan, - getParseTreeNode: () => getParseTreeNode, - getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, - getPathComponents: () => getPathComponents, - getPathFromPathComponents: () => getPathFromPathComponents, - getPathUpdater: () => getPathUpdater, - getPathsBasePath: () => getPathsBasePath, - getPatternFromSpec: () => getPatternFromSpec, - getPendingEmitKindWithSeen: () => getPendingEmitKindWithSeen, - getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, - getPossibleGenericSignatures: () => getPossibleGenericSignatures, - getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, - getPossibleOriginalInputPathWithoutChangingExt: () => getPossibleOriginalInputPathWithoutChangingExt, - getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, - getPreEmitDiagnostics: () => getPreEmitDiagnostics, - getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, - getPrivateIdentifier: () => getPrivateIdentifier, - getProperties: () => getProperties, - getProperty: () => getProperty, - getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, - getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, - 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, - getResolvedModuleFromResolution: () => getResolvedModuleFromResolution, - getResolvedTypeReferenceDirectiveFromResolution: () => getResolvedTypeReferenceDirectiveFromResolution, - getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, - getRestParameterElementType: () => getRestParameterElementType, - getRightMostAssignedExpression: () => getRightMostAssignedExpression, - getRootDeclaration: () => getRootDeclaration, - getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache, - getRootLength: () => getRootLength, - getScriptKind: () => getScriptKind, - getScriptKindFromFileName: () => getScriptKindFromFileName, - getScriptTargetFeatures: () => getScriptTargetFeatures, - getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, - getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, - getSemanticClassifications: () => getSemanticClassifications, - getSemanticJsxChildren: () => getSemanticJsxChildren, - getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, - getSetAccessorValueParameter: () => getSetAccessorValueParameter, - getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, - getShebang: () => getShebang, - getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, - getSnapshotText: () => getSnapshotText, - getSnippetElement: () => getSnippetElement, - getSourceFileOfModule: () => getSourceFileOfModule, - getSourceFileOfNode: () => getSourceFileOfNode, - getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, - 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, - 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, - handleWatchOptionsConfigDirTemplateSubstitution: () => handleWatchOptionsConfigDirTemplateSubstitution, - hasAbstractModifier: () => hasAbstractModifier, - hasAccessorModifier: () => hasAccessorModifier, - hasAmbientModifier: () => hasAmbientModifier, - hasChangesInResolutions: () => hasChangesInResolutions, - hasContextSensitiveParameters: () => hasContextSensitiveParameters, - hasDecorators: () => hasDecorators, - hasDocComment: () => hasDocComment, - hasDynamicName: () => hasDynamicName, - hasEffectiveModifier: () => hasEffectiveModifier, - hasEffectiveModifiers: () => hasEffectiveModifiers, - hasEffectiveReadonlyModifier: () => hasEffectiveReadonlyModifier, - hasExtension: () => hasExtension, - hasImplementationTSFileExtension: () => hasImplementationTSFileExtension, - hasIndexSignature: () => hasIndexSignature, - hasInferredType: () => hasInferredType, - 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, - hostGetCanonicalFileName: () => hostGetCanonicalFileName, - hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, - idText: () => idText, - identifierIsThisKeyword: () => identifierIsThisKeyword, - identifierToKeywordKind: () => identifierToKeywordKind, - identity: () => identity, - identitySourceMapConsumer: () => identitySourceMapConsumer, - ignoreSourceNewlines: () => ignoreSourceNewlines, - ignoredPaths: () => ignoredPaths, - importFromModuleSpecifier: () => importFromModuleSpecifier, - importSyntaxAffectsModuleResolution: () => importSyntaxAffectsModuleResolution, - indexOfAnyCharCode: () => indexOfAnyCharCode, - indexOfNode: () => indexOfNode, - indicesOf: () => indicesOf, - inferredTypesContainingFile: () => inferredTypesContainingFile, - injectClassNamedEvaluationHelperBlockIfMissing: () => injectClassNamedEvaluationHelperBlockIfMissing, - injectClassThisAssignmentIfMissing: () => injectClassThisAssignmentIfMissing, - insertImports: () => insertImports, - 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, - isAliasableExpression: () => isAliasableExpression, - isAmbientModule: () => isAmbientModule, - isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, - isAnyDirectorySeparator: () => isAnyDirectorySeparator, - isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, - isAnyImportOrReExport: () => isAnyImportOrReExport, - isAnyImportOrRequireStatement: () => isAnyImportOrRequireStatement, - 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, - isBinaryLogicalOperator: () => isBinaryLogicalOperator, - isBinaryOperatorToken: () => isBinaryOperatorToken, - isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall, - isBindableStaticAccessExpression: () => isBindableStaticAccessExpression, - isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, - isBindableStaticNameExpression: () => isBindableStaticNameExpression, - isBindingElement: () => isBindingElement, - isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, - isBindingName: () => isBindingName, - isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, - isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, - isBindingPattern: () => isBindingPattern, - isBlock: () => isBlock, - isBlockLike: () => isBlockLike, - isBlockOrCatchScoped: () => isBlockOrCatchScoped, - isBlockScope: () => isBlockScope, - isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel, - isBooleanLiteral: () => isBooleanLiteral, - isBreakOrContinueStatement: () => isBreakOrContinueStatement, - isBreakStatement: () => isBreakStatement, - isBuildCommand: () => isBuildCommand, - isBuildInfoFile: () => isBuildInfoFile, - isBuilderProgram: () => isBuilderProgram, - isBundle: () => isBundle, - 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, - isCircularBuildOrder: () => isCircularBuildOrder, - isClassDeclaration: () => isClassDeclaration, - isClassElement: () => isClassElement, - isClassExpression: () => isClassExpression, - isClassInstanceProperty: () => isClassInstanceProperty, - isClassLike: () => isClassLike, - isClassMemberModifier: () => isClassMemberModifier, - isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock, - isClassOrTypeElement: () => isClassOrTypeElement, - isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, - isClassThisAssignmentBlock: () => isClassThisAssignmentBlock, - 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, - isConstAssertion: () => isConstAssertion, - 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, - isDiskPathRoot: () => isDiskPathRoot, - isDoStatement: () => isDoStatement, - isDocumentRegistryEntry: () => isDocumentRegistryEntry, - isDotDotDotToken: () => isDotDotDotToken, - isDottedName: () => isDottedName, - isDynamicName: () => isDynamicName, - isEffectiveExternalModule: () => isEffectiveExternalModule, - 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, - isFullSourceFile: () => isFullSourceFile, - 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, - isGeneratedIdentifier: () => isGeneratedIdentifier, - isGeneratedPrivateIdentifier: () => isGeneratedPrivateIdentifier, - isGetAccessor: () => isGetAccessor, - isGetAccessorDeclaration: () => isGetAccessorDeclaration, - isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, - isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, - isGlobalSourceFile: () => isGlobalSourceFile, - 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, - isImportable: () => isImportable, - 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, - isIncrementalBuildInfo: () => isIncrementalBuildInfo, - isIncrementalBundleEmitBuildInfo: () => isIncrementalBundleEmitBuildInfo, - 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, - isJSDocImportTag: () => isJSDocImportTag, - 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, - isJsxCallLike: () => isJsxCallLike, - 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, - isLet: () => isLet, - isLineBreak: () => isLineBreak, - isLiteralComputedPropertyDeclarationName: () => isLiteralComputedPropertyDeclarationName, - isLiteralExpression: () => isLiteralExpression, - isLiteralExpressionOfObject: () => isLiteralExpressionOfObject, - isLiteralImportTypeNode: () => isLiteralImportTypeNode, - isLiteralKind: () => isLiteralKind, - isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, - 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, - isModuleExportName: () => isModuleExportName, - isModuleExportsAccessExpression: () => isModuleExportsAccessExpression, - isModuleIdentifier: () => isModuleIdentifier, - isModuleName: () => isModuleName, - isModuleOrEnumDeclaration: () => isModuleOrEnumDeclaration, - isModuleReference: () => isModuleReference, - isModuleSpecifierLike: () => isModuleSpecifierLike, - isModuleWithStringLiteralName: () => isModuleWithStringLiteralName, - isNameOfFunctionDeclaration: () => isNameOfFunctionDeclaration, - isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, - 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, - isNewScopeNode: () => isNewScopeNode, - isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, - isNodeArray: () => isNodeArray, - isNodeArrayMultiLine: () => isNodeArrayMultiLine, - isNodeDescendantOf: () => isNodeDescendantOf, - isNodeKind: () => isNodeKind, - isNodeLikeSystem: () => isNodeLikeSystem, - isNodeModulesDirectory: () => isNodeModulesDirectory, - isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, - isNonContextualKeyword: () => isNonContextualKeyword, - isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, - isNonNullAccess: () => isNonNullAccess, - isNonNullChain: () => isNonNullChain, - isNonNullExpression: () => isNonNullExpression, - isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName, - 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, - isOmittedExpression: () => isOmittedExpression, - isOptionalChain: () => isOptionalChain, - isOptionalChainRoot: () => isOptionalChainRoot, - isOptionalDeclaration: () => isOptionalDeclaration, - isOptionalJSDocPropertyLikeTag: () => isOptionalJSDocPropertyLikeTag, - isOptionalTypeNode: () => isOptionalTypeNode, - isOuterExpression: () => isOuterExpression, - isOutermostOptionalChain: () => isOutermostOptionalChain, - isOverrideModifier: () => isOverrideModifier, - isPackageJsonInfo: () => isPackageJsonInfo, - isPackedArrayLiteral: () => isPackedArrayLiteral, - isParameter: () => isParameter, - isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, - isParameterPropertyModifier: () => isParameterPropertyModifier, - isParenthesizedExpression: () => isParenthesizedExpression, - isParenthesizedTypeNode: () => isParenthesizedTypeNode, - isParseTreeNode: () => isParseTreeNode, - isPartOfParameterDeclaration: () => isPartOfParameterDeclaration, - isPartOfTypeNode: () => isPartOfTypeNode, - isPartOfTypeOnlyImportOrExportDeclaration: () => isPartOfTypeOnlyImportOrExportDeclaration, - isPartOfTypeQuery: () => isPartOfTypeQuery, - isPartiallyEmittedExpression: () => isPartiallyEmittedExpression, - isPatternMatch: () => isPatternMatch, - isPinnedComment: () => isPinnedComment, - isPlainJsFile: () => isPlainJsFile, - isPlusToken: () => isPlusToken, - isPossiblyTypeArgumentPosition: () => isPossiblyTypeArgumentPosition, - isPostfixUnaryExpression: () => isPostfixUnaryExpression, - isPrefixUnaryExpression: () => isPrefixUnaryExpression, - isPrimitiveLiteralValue: () => isPrimitiveLiteralValue, - isPrivateIdentifier: () => isPrivateIdentifier, - isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration, - isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression, - isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol, - isProgramUptoDate: () => isProgramUptoDate, - isPrologueDirective: () => isPrologueDirective, - isPropertyAccessChain: () => isPropertyAccessChain, - isPropertyAccessEntityNameExpression: () => isPropertyAccessEntityNameExpression, - isPropertyAccessExpression: () => isPropertyAccessExpression, - isPropertyAccessOrQualifiedName: () => isPropertyAccessOrQualifiedName, - isPropertyAccessOrQualifiedNameOrImportTypeNode: () => isPropertyAccessOrQualifiedNameOrImportTypeNode, - isPropertyAssignment: () => isPropertyAssignment, - isPropertyDeclaration: () => isPropertyDeclaration, - isPropertyName: () => isPropertyName, - isPropertyNameLiteral: () => isPropertyNameLiteral, - isPropertySignature: () => isPropertySignature, - isPrototypeAccess: () => isPrototypeAccess, - isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, - isPunctuation: () => isPunctuation, - isPushOrUnshiftIdentifier: () => isPushOrUnshiftIdentifier, - isQualifiedName: () => isQualifiedName, - isQuestionDotToken: () => isQuestionDotToken, - isQuestionOrExclamationToken: () => isQuestionOrExclamationToken, - isQuestionOrPlusOrMinusToken: () => isQuestionOrPlusOrMinusToken, - isQuestionToken: () => isQuestionToken, - 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, - isSemicolonClassElement: () => isSemicolonClassElement, - isSetAccessor: () => isSetAccessor, - isSetAccessorDeclaration: () => isSetAccessorDeclaration, - isShiftOperatorOrHigher: () => isShiftOperatorOrHigher, - isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, - isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, - isSideEffectImport: () => isSideEffectImport, - isSignedNumericLiteral: () => isSignedNumericLiteral, - isSimpleCopiableExpression: () => isSimpleCopiableExpression, - isSimpleInlineableExpression: () => isSimpleInlineableExpression, - isSimpleParameterList: () => isSimpleParameterList, - isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, - isSolutionConfig: () => isSolutionConfig, - isSourceElement: () => isSourceElement, - isSourceFile: () => isSourceFile, - isSourceFileFromLibrary: () => isSourceFileFromLibrary, - isSourceFileJS: () => isSourceFileJS, - isSourceFileNotJson: () => isSourceFileNotJson, - isSourceMapping: () => isSourceMapping, - isSpecialPropertyDeclaration: () => isSpecialPropertyDeclaration, - isSpreadAssignment: () => isSpreadAssignment, - isSpreadElement: () => isSpreadElement, - isStatement: () => isStatement, - isStatementButNotDeclaration: () => isStatementButNotDeclaration, - isStatementOrBlock: () => isStatementOrBlock, - isStatementWithLocals: () => isStatementWithLocals, - isStatic: () => isStatic, - isStaticModifier: () => isStaticModifier, - isString: () => isString, - isStringANonContextualKeyword: () => isStringANonContextualKeyword, - isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, - isStringDoubleQuoted: () => isStringDoubleQuoted, - isStringLiteral: () => isStringLiteral, - isStringLiteralLike: () => isStringLiteralLike, - isStringLiteralOrJsxExpression: () => isStringLiteralOrJsxExpression, - isStringLiteralOrTemplate: () => isStringLiteralOrTemplate, - isStringOrNumericLiteralLike: () => isStringOrNumericLiteralLike, - isStringOrRegularExpressionOrTemplateLiteral: () => isStringOrRegularExpressionOrTemplateLiteral, - isStringTextContainingNode: () => isStringTextContainingNode, - isSuperCall: () => isSuperCall, - isSuperKeyword: () => isSuperKeyword, - 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, - 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, - isUrl: () => isUrl, - isValidBigIntString: () => isValidBigIntString, - isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, - isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, - isValueSignatureDeclaration: () => isValueSignatureDeclaration, - isVarAwaitUsing: () => isVarAwaitUsing, - isVarConst: () => isVarConst, - isVarConstLike: () => isVarConstLike, - isVarUsing: () => isVarUsing, - isVariableDeclaration: () => isVariableDeclaration, - isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, - isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, - isVariableDeclarationInitializedToRequire: () => isVariableDeclarationInitializedToRequire, - isVariableDeclarationList: () => isVariableDeclarationList, - isVariableLike: () => isVariableLike, - 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, - loadModuleFromGlobalCache: () => loadModuleFromGlobalCache, - loadWithModeAwareCache: () => loadWithModeAwareCache, - makeIdentifierFromModuleName: () => makeIdentifierFromModuleName, - makeImport: () => makeImport, - makeStringLiteral: () => makeStringLiteral, - mangleScopedPackageName: () => mangleScopedPackageName, - map: () => map, - mapAllOrFail: () => mapAllOrFail, - mapDefined: () => mapDefined, - mapDefinedIterator: () => mapDefinedIterator, - mapEntries: () => mapEntries, - mapIterator: () => mapIterator, - mapOneOrMany: () => mapOneOrMany, - mapToDisplayParts: () => mapToDisplayParts, - matchFiles: () => matchFiles, - matchPatternOrExact: () => matchPatternOrExact, - matchedText: () => matchedText, - matchesExclude: () => matchesExclude, - matchesExcludeWorker: () => matchesExcludeWorker, - maxBy: () => maxBy, - maybeBind: () => maybeBind, - maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, - memoize: () => memoize, - memoizeOne: () => memoizeOne, - min: () => min, - minAndMax: () => minAndMax, - missingFileModifiedTime: () => missingFileModifiedTime, - modifierToFlag: () => modifierToFlag, - modifiersToFlags: () => modifiersToFlags, - moduleExportNameIsDefault: () => moduleExportNameIsDefault, - moduleExportNameTextEscaped: () => moduleExportNameTextEscaped, - moduleExportNameTextUnescaped: () => moduleExportNameTextUnescaped, - moduleOptionDeclaration: () => moduleOptionDeclaration, - moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo, - moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter, - moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations, - moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports, - moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules, - moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier, - moduleSpecifiers: () => ts_moduleSpecifiers_exports, - moduleSupportsImportAttributes: () => moduleSupportsImportAttributes, - moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier, - 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, - nodeCoreModules: () => nodeCoreModules, - 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, - noop: () => noop, - noopFileWatcher: () => noopFileWatcher, - normalizePath: () => normalizePath, - normalizeSlashes: () => normalizeSlashes, - normalizeSpans: () => normalizeSpans, - 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, - or: () => or, - orderedRemoveItem: () => orderedRemoveItem, - orderedRemoveItemAt: () => orderedRemoveItemAt, - packageIdToPackageName: () => packageIdToPackageName, - packageIdToString: () => packageIdToString, - 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, - pasteEdits: () => ts_PasteEdits_exports, - patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory, - pathContainsNodeModules: () => pathContainsNodeModules, - pathIsAbsolute: () => pathIsAbsolute, - pathIsBareSpecifier: () => pathIsBareSpecifier, - pathIsRelative: () => pathIsRelative, - patternText: () => patternText, - performIncrementalCompilation: () => performIncrementalCompilation, - performance: () => ts_performance_exports, - positionBelongsToNode: () => positionBelongsToNode, - positionIsASICandidate: () => positionIsASICandidate, - positionIsSynthesized: () => positionIsSynthesized, - positionsAreOnSameLine: () => positionsAreOnSameLine, - preProcessFile: () => preProcessFile, - probablyUsesSemicolons: () => probablyUsesSemicolons, - processCommentPragmas: () => processCommentPragmas, - processPragmasIntoFields: () => processPragmasIntoFields, - processTaggedTemplateExpression: () => processTaggedTemplateExpression, - programContainsEsModules: () => programContainsEsModules, - programContainsModules: () => programContainsModules, - projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, - 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, - readJson: () => readJson, - readJsonConfigFile: () => readJsonConfigFile, - readJsonOrUndefined: () => readJsonOrUndefined, - reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, - reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, - reduceLeft: () => reduceLeft, - reduceLeftIterator: () => reduceLeftIterator, - reducePathComponents: () => reducePathComponents, - refactor: () => ts_refactor_exports, - regExpEscape: () => regExpEscape, - regularExpressionFlagToCharacterCode: () => regularExpressionFlagToCharacterCode, - relativeComplement: () => relativeComplement, - removeAllComments: () => removeAllComments, - removeEmitHelper: () => removeEmitHelper, - removeExtension: () => removeExtension, - removeFileExtension: () => removeFileExtension, - removeIgnoredPath: () => removeIgnoredPath, - removeMinAndVersionNumbers: () => removeMinAndVersionNumbers, - 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, - returnFalse: () => returnFalse, - returnNoopFileWatcher: () => returnNoopFileWatcher, - returnTrue: () => returnTrue, - returnUndefined: () => returnUndefined, - returnsPromise: () => returnsPromise, - rewriteModuleSpecifier: () => rewriteModuleSpecifier, - sameFlatMap: () => sameFlatMap, - sameMap: () => sameMap, - sameMapping: () => sameMapping, - scanTokenAtPosition: () => scanTokenAtPosition, - scanner: () => scanner, - semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, - serializeCompilerOptions: () => serializeCompilerOptions, - server: () => ts_server_exports3, - servicesVersion: () => servicesVersion, - setCommentRange: () => setCommentRange, - setConfigFileInOptions: () => setConfigFileInOptions, - setConstantValue: () => setConstantValue, - setEmitFlags: () => setEmitFlags, - setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, - setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, - setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, - setIdentifierTypeArguments: () => setIdentifierTypeArguments, - setInternalEmitFlags: () => setInternalEmitFlags, - setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, - setNodeChildren: () => setNodeChildren, - 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, - shouldRewriteModuleSpecifier: () => shouldRewriteModuleSpecifier, - shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, - showModuleSpecifier: () => showModuleSpecifier, - signatureHasRestParameter: () => signatureHasRestParameter, - signatureToDisplayParts: () => signatureToDisplayParts, - single: () => single, - singleElementArray: () => singleElementArray, - singleIterator: () => singleIterator, - singleOrMany: () => singleOrMany, - singleOrUndefined: () => singleOrUndefined, - skipAlias: () => skipAlias, - skipConstraint: () => skipConstraint, - skipOuterExpressions: () => skipOuterExpressions, - skipParentheses: () => skipParentheses, - skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions, - skipTrivia: () => skipTrivia, - skipTypeChecking: () => skipTypeChecking, - skipTypeCheckingIgnoringNoCheck: () => skipTypeCheckingIgnoringNoCheck, - skipTypeParentheses: () => skipTypeParentheses, - skipWhile: () => skipWhile, - sliceAfter: () => sliceAfter, - some: () => some, - sortAndDeduplicate: () => sortAndDeduplicate, - sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics, - sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions, - sourceFileMayBeEmitted: () => sourceFileMayBeEmitted, - sourceMapCommentRegExp: () => sourceMapCommentRegExp, - sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart, - spacePart: () => spacePart, - spanMap: () => spanMap, - startEndContainsRange: () => startEndContainsRange, - startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd, - startOnNewLine: () => startOnNewLine, - startTracing: () => startTracing, - startsWith: () => startsWith, - startsWithDirectory: () => startsWithDirectory, - startsWithUnderscore: () => startsWithUnderscore, - startsWithUseStrict: () => startsWithUseStrict, - stringContainsAt: () => stringContainsAt, - stringToToken: () => stringToToken, - stripQuotes: () => stripQuotes, - supportedDeclarationExtensions: () => supportedDeclarationExtensions, - supportedJSExtensionsFlat: () => supportedJSExtensionsFlat, - supportedLocaleDirectories: () => supportedLocaleDirectories, - supportedTSExtensionsFlat: () => supportedTSExtensionsFlat, - supportedTSImplementationExtensions: () => supportedTSImplementationExtensions, - suppressLeadingAndTrailingTrivia: () => suppressLeadingAndTrailingTrivia, - suppressLeadingTrivia: () => suppressLeadingTrivia, - suppressTrailingTrivia: () => suppressTrailingTrivia, - symbolEscapedNameNoDefault: () => symbolEscapedNameNoDefault, - symbolName: () => symbolName, - symbolNameNoDefault: () => symbolNameNoDefault, - symbolToDisplayParts: () => symbolToDisplayParts, - sys: () => sys, - sysLog: () => sysLog, - tagNamesAreEquivalent: () => tagNamesAreEquivalent, - takeWhile: () => takeWhile, - targetOptionDeclaration: () => targetOptionDeclaration, - targetToLibMap: () => targetToLibMap, - testFormatSettings: () => testFormatSettings, - textChangeRangeIsUnchanged: () => textChangeRangeIsUnchanged, - textChangeRangeNewSpan: () => textChangeRangeNewSpan, - textChanges: () => ts_textChanges_exports, - textOrKeywordPart: () => textOrKeywordPart, - textPart: () => textPart, - textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive, - textRangeContainsTextSpan: () => textRangeContainsTextSpan, - textRangeIntersectsWithTextSpan: () => textRangeIntersectsWithTextSpan, - textSpanContainsPosition: () => textSpanContainsPosition, - textSpanContainsTextRange: () => textSpanContainsTextRange, - 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, - toPath: () => toPath, - toProgramEmitPending: () => toProgramEmitPending, - toSorted: () => toSorted, - tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword, - tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan, - tokenToString: () => tokenToString, - trace: () => trace, - tracing: () => tracing, - tracingEnabled: () => tracingEnabled, - transferSourceFileChildren: () => transferSourceFileChildren, - transform: () => transform, - transformClassFields: () => transformClassFields, - transformDeclarations: () => transformDeclarations, - transformECMAScriptModule: () => transformECMAScriptModule, - transformES2015: () => transformES2015, - transformES2016: () => transformES2016, - transformES2017: () => transformES2017, - transformES2018: () => transformES2018, - transformES2019: () => transformES2019, - transformES2020: () => transformES2020, - transformES2021: () => transformES2021, - transformESDecorators: () => transformESDecorators, - transformESNext: () => transformESNext, - transformGenerators: () => transformGenerators, - transformImpliedNodeFormatDependentModule: () => transformImpliedNodeFormatDependentModule, - transformJsx: () => transformJsx, - transformLegacyDecorators: () => transformLegacyDecorators, - transformModule: () => transformModule, - transformNamedEvaluation: () => transformNamedEvaluation, - transformNodes: () => transformNodes, - transformSystemModule: () => transformSystemModule, - transformTypeScript: () => transformTypeScript, - transpile: () => transpile, - transpileDeclaration: () => transpileDeclaration, - 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, - tryParseJson: () => tryParseJson, - tryParsePattern: () => tryParsePattern, - tryParsePatterns: () => tryParsePatterns, - tryParseRawSourceMap: () => tryParseRawSourceMap, - tryReadDirectory: () => tryReadDirectory, - tryReadFile: () => tryReadFile, - tryRemoveDirectoryPrefix: () => tryRemoveDirectoryPrefix, - tryRemoveExtension: () => tryRemoveExtension, - tryRemovePrefix: () => tryRemovePrefix, - tryRemoveSuffix: () => tryRemoveSuffix, - tscBuildOption: () => tscBuildOption, - typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, - typeAliasNamePart: () => typeAliasNamePart, - typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, - typeKeywords: () => typeKeywords, - typeParameterNamePart: () => typeParameterNamePart, - typeToDisplayParts: () => typeToDisplayParts, - unchangedPollThresholds: () => unchangedPollThresholds, - unchangedTextChangeRange: () => unchangedTextChangeRange, - unescapeLeadingUnderscores: () => unescapeLeadingUnderscores, - unmangleScopedPackageName: () => unmangleScopedPackageName, - unorderedRemoveItem: () => unorderedRemoveItem, - unprefixedNodeCoreModules: () => unprefixedNodeCoreModules, - unreachableCodeIsError: () => unreachableCodeIsError, - unsetNodeChildren: () => unsetNodeChildren, - unusedLabelIsError: () => unusedLabelIsError, - unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, - unwrapParenthesizedExpression: () => unwrapParenthesizedExpression, - updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, - updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, - updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updateResolutionField: () => updateResolutionField, - updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, - updateSourceFile: () => updateSourceFile, - updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, - usingSingleLineStringWriter: () => usingSingleLineStringWriter, - utf16EncodeAsString: () => utf16EncodeAsString, - validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage, - version: () => version, - versionMajorMinor: () => versionMajorMinor, - visitArray: () => visitArray, - visitCommaListElements: () => visitCommaListElements, - visitEachChild: () => visitEachChild, - visitFunctionBody: () => visitFunctionBody, - visitIterationBody: () => visitIterationBody, - visitLexicalEnvironment: () => visitLexicalEnvironment, - visitNode: () => visitNode, - visitNodes: () => visitNodes2, - visitParameterList: () => visitParameterList, - walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, - walkUpOuterExpressions: () => walkUpOuterExpressions, - walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, - walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, - walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, - whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp, - writeCommentRange: () => writeCommentRange, - writeFile: () => writeFile, - writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, - zipWith: () => zipWith -}); - -// src/deprecatedCompat/deprecate.ts -var enableDeprecationWarnings = true; -var typeScriptVersion2; -function getTypeScriptVersion() { - return typeScriptVersion2 ?? (typeScriptVersion2 = new Version(version)); -} -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 += 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) { - const deprecationMessage = formatDeprecationMessage( - name, - /*error*/ - true, - errorAfter, - since, - message - ); - return () => { - throw new TypeError(deprecationMessage); - }; -} -function createWarningDeprecation(name, errorAfter, since, message) { - let hasWrittenDeprecation = false; - return () => { - if (enableDeprecationWarnings && !hasWrittenDeprecation) { - Debug.log.warn(formatDeprecationMessage( - name, - /*error*/ - false, - errorAfter, - since, - message - )); - hasWrittenDeprecation = true; - } - }; -} -function createDeprecation(name, options = {}) { - const version2 = typeof options.typeScriptVersion === "string" ? new Version(options.typeScriptVersion) : options.typeScriptVersion ?? getTypeScriptVersion(); - 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 error2 = options.error || errorAfter && version2.compareTo(errorAfter) >= 0; - const warn = !warnAfter || version2.compareTo(warnAfter) >= 0; - return error2 ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop; -} -function wrapFunction(deprecation, func) { - return function() { - deprecation(); - return func.apply(this, arguments); - }; -} -function deprecate(func, options) { - const deprecation = createDeprecation((options == null ? void 0 : options.name) ?? Debug.getFunctionName(func), options); - return wrapFunction(deprecation, func); -} - -// src/deprecatedCompat/deprecations.ts -function createOverload(name, overloads, binder2, deprecations) { - Object.defineProperty(call, "name", { ...Object.getOwnPropertyDescriptor(call, "name"), value: name }); - if (deprecations) { - for (const key of Object.keys(deprecations)) { - const index = +key; - if (!isNaN(index) && hasProperty(overloads, `${index}`)) { - overloads[index] = deprecate(overloads[index], { ...deprecations[index], name }); - } - } - } - const bind = createBinder2(overloads, binder2); - return call; - function call(...args) { - const index = bind(args); - const fn = index !== void 0 ? overloads[index] : void 0; - if (typeof fn === "function") { - return fn(...args); - } - throw new TypeError("Invalid arguments"); - } -} -function createBinder2(overloads, binder2) { - return (args) => { - for (let i = 0; hasProperty(overloads, `${i}`) && hasProperty(binder2, `${i}`); i++) { - const fn = binder2[i]; - if (fn(args)) { - return i; - } - } - }; -} -function buildOverload(name) { - return { - overload: (overloads) => ({ - bind: (binder2) => ({ - finish: () => createOverload(name, overloads, binder2), - deprecate: (deprecations) => ({ - finish: () => createOverload(name, overloads, binder2, deprecations) - }) - }) - }) - }; -} - -// 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, - ConfiguredProjectLoadKind: () => ConfiguredProjectLoadKind, - CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent, - CreateFileWatcherEvent: () => CreateFileWatcherEvent, - Errors: () => Errors, - EventBeginInstallTypes: () => EventBeginInstallTypes, - EventEndInstallTypes: () => EventEndInstallTypes, - EventInitializationFailed: () => EventInitializationFailed, - EventTypesRegistry: () => EventTypesRegistry, - ExternalProject: () => ExternalProject, - GcTimer: () => GcTimer, - InferredProject: () => InferredProject2, - LargeFileReferencedEvent: () => LargeFileReferencedEvent, - LineIndex: () => LineIndex, - LineLeaf: () => LineLeaf, - LineNode: () => LineNode, - LogLevel: () => LogLevel2, - Msg: () => Msg, - OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, - Project: () => Project2, - ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, - ProjectKind: () => ProjectKind, - ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, - ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, - ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, - ProjectService: () => ProjectService2, - ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, - ScriptInfo: () => ScriptInfo, - ScriptVersionCache: () => ScriptVersionCache, - Session: () => Session3, - TextStorage: () => TextStorage, - ThrottledOperations: () => ThrottledOperations, - 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, - formatDiagnosticToProtocol: () => formatDiagnosticToProtocol, - formatMessage: () => formatMessage2, - getBaseConfigFileName: () => getBaseConfigFileName, - getDetailWatchInfo: () => getDetailWatchInfo, - getLocationInNewDocument: () => getLocationInNewDocument, - hasArgument: () => hasArgument, - hasNoTypeScriptSource: () => hasNoTypeScriptSource, - indent: () => indent2, - isBackgroundProject: () => isBackgroundProject, - isConfigFile: () => isConfigFile, - isConfiguredProject: () => isConfiguredProject, - isDynamicFileName: () => isDynamicFileName, - isExternalProject: () => isExternalProject, - isInferredProject: () => isInferredProject, - isInferredProjectName: () => isInferredProjectName, - isProjectDeferredClose: () => isProjectDeferredClose, - makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, - makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, - makeInferredProjectName: () => makeInferredProjectName, - maxFileSize: () => maxFileSize, - maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, - normalizedPathToPath: () => normalizedPathToPath, - nowString: () => nowString, - nullCancellationToken: () => nullCancellationToken, - nullTypingsInstaller: () => nullTypingsInstaller, - protocol: () => ts_server_protocol_exports, - scriptInfoIsContainedByBackgroundProject: () => scriptInfoIsContainedByBackgroundProject, - scriptInfoIsContainedByDeferredClosedProject: () => scriptInfoIsContainedByDeferredClosedProject, - stringifyIndented: () => stringifyIndented, - toEvent: () => toEvent, - toNormalizedPath: () => toNormalizedPath, - tryConvertScriptKindName: () => tryConvertScriptKindName, - typingsInstaller: () => ts_server_typingsInstaller_exports, - updateProjectIfDirty: () => updateProjectIfDirty -}); - -// 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 -}); - -// src/typingsInstallerCore/typingsInstaller.ts -var nullLog = { - isEnabled: () => false, - writeLine: noop -}; -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 }; -} -var 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(); - this.pendingRunRequests = []; - this.installRunCount = 1; - this.inFlightRequestCount = 0; - // eslint-disable-line @typescript-eslint/unified-signatures - 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.packages || npmLock.dependencies)) { - for (const key in npmConfig.devDependencies) { - if (npmLock.packages && !hasProperty(npmLock.packages, `node_modules/${key}`) || npmLock.dependencies && !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 = npmLock.packages && getProperty(npmLock.packages, `node_modules/${key}`) || 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(); - }); - } - } -}; -function typingsName(packageName) { - return `@types/${packageName}@ts${versionMajorMinor}`; -} - -// src/server/utilitiesPublic.ts -var 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 || {}); -var emptyArray2 = createSortedArray2(); -var Msg = /* @__PURE__ */ ((Msg2) => { - Msg2["Err"] = "Err"; - Msg2["Info"] = "Info"; - Msg2["Perf"] = "Perf"; - return Msg2; -})(Msg || {}); -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" - }; -} -var Errors; -((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 = {})); -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 []; -} - -// src/server/utilities.ts -var 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) { - self.pendingTimeouts.delete(operationId); - if (self.logger) { - self.logger.info(`Running: ${operationId}`); - } - cb(); - } -}; -var 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) { - self.timerId = void 0; - 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}`); - } - } -}; -function getBaseConfigFileName(configFilePath) { - const base = getBaseFileName(configFilePath); - return base === "tsconfig.json" || base === "jsconfig.json" ? base : void 0; -} - -// src/server/_namespaces/ts.server.protocol.ts -var ts_server_protocol_exports = {}; -__export(ts_server_protocol_exports, { - ClassificationType: () => ClassificationType, - CommandTypes: () => CommandTypes, - CompletionTriggerKind: () => CompletionTriggerKind, - IndentStyle: () => IndentStyle2, - JsxEmit: () => JsxEmit2, - ModuleKind: () => ModuleKind2, - ModuleResolutionKind: () => ModuleResolutionKind2, - NewLineKind: () => NewLineKind2, - OrganizeImportsMode: () => OrganizeImportsMode, - PollingWatchKind: () => PollingWatchKind2, - ScriptTarget: () => ScriptTarget11, - SemicolonPreference: () => SemicolonPreference, - WatchDirectoryKind: () => WatchDirectoryKind2, - WatchFileKind: () => WatchFileKind2 -}); - -// src/server/protocol.ts -var 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["PreparePasteEdits"] = "preparePasteEdits"; - CommandTypes2["GetPasteEdits"] = "getPasteEdits"; - 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"; - CommandTypes2["MapCode"] = "mapCode"; - CommandTypes2["CopilotRelated"] = "copilotRelated"; - return CommandTypes2; -})(CommandTypes || {}); -var WatchFileKind2 = /* @__PURE__ */ ((WatchFileKind3) => { - WatchFileKind3["FixedPollingInterval"] = "FixedPollingInterval"; - WatchFileKind3["PriorityPollingInterval"] = "PriorityPollingInterval"; - WatchFileKind3["DynamicPriorityPolling"] = "DynamicPriorityPolling"; - WatchFileKind3["FixedChunkSizePolling"] = "FixedChunkSizePolling"; - WatchFileKind3["UseFsEvents"] = "UseFsEvents"; - WatchFileKind3["UseFsEventsOnParentDirectory"] = "UseFsEventsOnParentDirectory"; - return WatchFileKind3; -})(WatchFileKind2 || {}); -var WatchDirectoryKind2 = /* @__PURE__ */ ((WatchDirectoryKind3) => { - WatchDirectoryKind3["UseFsEvents"] = "UseFsEvents"; - WatchDirectoryKind3["FixedPollingInterval"] = "FixedPollingInterval"; - WatchDirectoryKind3["DynamicPriorityPolling"] = "DynamicPriorityPolling"; - WatchDirectoryKind3["FixedChunkSizePolling"] = "FixedChunkSizePolling"; - return WatchDirectoryKind3; -})(WatchDirectoryKind2 || {}); -var PollingWatchKind2 = /* @__PURE__ */ ((PollingWatchKind3) => { - PollingWatchKind3["FixedInterval"] = "FixedInterval"; - PollingWatchKind3["PriorityInterval"] = "PriorityInterval"; - PollingWatchKind3["DynamicPriority"] = "DynamicPriority"; - PollingWatchKind3["FixedChunkSize"] = "FixedChunkSize"; - return PollingWatchKind3; -})(PollingWatchKind2 || {}); -var IndentStyle2 = /* @__PURE__ */ ((IndentStyle3) => { - IndentStyle3["None"] = "None"; - IndentStyle3["Block"] = "Block"; - IndentStyle3["Smart"] = "Smart"; - return IndentStyle3; -})(IndentStyle2 || {}); -var JsxEmit2 = /* @__PURE__ */ ((JsxEmit3) => { - JsxEmit3["None"] = "none"; - JsxEmit3["Preserve"] = "preserve"; - JsxEmit3["ReactNative"] = "react-native"; - JsxEmit3["React"] = "react"; - JsxEmit3["ReactJSX"] = "react-jsx"; - JsxEmit3["ReactJSXDev"] = "react-jsxdev"; - return JsxEmit3; -})(JsxEmit2 || {}); -var 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["ES2020"] = "es2020"; - ModuleKind3["ES2022"] = "es2022"; - ModuleKind3["ESNext"] = "esnext"; - ModuleKind3["Node16"] = "node16"; - ModuleKind3["Node18"] = "node18"; - ModuleKind3["Node20"] = "node20"; - ModuleKind3["NodeNext"] = "nodenext"; - ModuleKind3["Preserve"] = "preserve"; - return ModuleKind3; -})(ModuleKind2 || {}); -var ModuleResolutionKind2 = /* @__PURE__ */ ((ModuleResolutionKind3) => { - ModuleResolutionKind3["Classic"] = "classic"; - ModuleResolutionKind3["Node"] = "node"; - ModuleResolutionKind3["NodeJs"] = "node"; - ModuleResolutionKind3["Node10"] = "node10"; - ModuleResolutionKind3["Node16"] = "node16"; - ModuleResolutionKind3["NodeNext"] = "nodenext"; - ModuleResolutionKind3["Bundler"] = "bundler"; - return ModuleResolutionKind3; -})(ModuleResolutionKind2 || {}); -var NewLineKind2 = /* @__PURE__ */ ((NewLineKind3) => { - NewLineKind3["Crlf"] = "Crlf"; - NewLineKind3["Lf"] = "Lf"; - return NewLineKind3; -})(NewLineKind2 || {}); -var ScriptTarget11 = /* @__PURE__ */ ((ScriptTarget12) => { - ScriptTarget12["ES3"] = "es3"; - ScriptTarget12["ES5"] = "es5"; - ScriptTarget12["ES6"] = "es6"; - ScriptTarget12["ES2015"] = "es2015"; - ScriptTarget12["ES2016"] = "es2016"; - ScriptTarget12["ES2017"] = "es2017"; - ScriptTarget12["ES2018"] = "es2018"; - ScriptTarget12["ES2019"] = "es2019"; - ScriptTarget12["ES2020"] = "es2020"; - ScriptTarget12["ES2021"] = "es2021"; - ScriptTarget12["ES2022"] = "es2022"; - ScriptTarget12["ES2023"] = "es2023"; - ScriptTarget12["ES2024"] = "es2024"; - ScriptTarget12["ESNext"] = "esnext"; - ScriptTarget12["JSON"] = "json"; - ScriptTarget12["Latest"] = "esnext" /* ESNext */; - return ScriptTarget12; -})(ScriptTarget11 || {}); -{ -} - -// src/server/scriptInfo.ts -var 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; - if (this.ownFileText && this.info.mTime === missingFileModifiedTime.getTime()) { - this.info.mTime = (this.host.getModifiedTime(this.info.fileName) || missingFileModifiedTime).getTime(); - } - 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); - } -}; -function isDynamicFileName(fileName) { - return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator); -} -var 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 isProjectDeferredClose(this.containingProjects[0]) || isBackgroundProject(this.containingProjects[0]) ? Errors.ThrowNoProject() : this.containingProjects[0]; - default: - 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.deferredClose) continue; - 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 (isExternalProject(project)) { - return project; - } else if (!firstInferredProject && isInferredProject(project)) { - firstInferredProject = project; - } - } - return (defaultConfiguredProject || firstNonSourceOfProjectReferenceRedirect || firstConfiguredProject || firstInferredProject) ?? Errors.ThrowNoProject(); - } - } - 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 this.deferredDelete || !forEach(this.containingProjects, (p) => !p.isOrphan()); - } - /** - * @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; - } - } -}; -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"}`); -} -function scriptInfoIsContainedByBackgroundProject(info) { - return some( - info.containingProjects, - isBackgroundProject - ); -} -function scriptInfoIsContainedByDeferredClosedProject(info) { - return some( - info.containingProjects, - isProjectDeferredClose - ); -} - -// src/server/project.ts -var 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 || {}); -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 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 Project2 = class _Project { - /** @internal */ - constructor(projectName, projectKind, projectService, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) { - this.projectKind = projectKind; - this.projectService = projectService; - this.compilerOptions = compilerOptions; - this.compileOnSaveEnabled = compileOnSaveEnabled; - this.watchOptions = watchOptions; - 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(); - this.hasAddedorRemovedFiles = false; - 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; - /** @internal */ - this.initialLoadPending = false; - /** @internal */ - this.dirty = false; - /** @internal */ - this.typingFiles = emptyArray2; - 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; - projectService.logger.info(`Creating ${ProjectKind[projectKind]}Project: ${projectName}, currentDirectory: ${currentDirectory}`); - 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.preferNonRecursiveWatch = this.projectService.canUseWatchEvents || host.preferNonRecursiveWatch; - this.resolutionCache = createResolutionCache( - this, - this.currentDirectory, - /*logChangesWhenResolvingModule*/ - true - ); - this.languageService = createLanguageService( - this, - this.projectService.documentRegistry, - this.projectService.serverMode - ); - if (lastFileExceededProgramSize) { - this.disableLanguageService(lastFileExceededProgramSize); - } - this.markAsDirty(); - if (!isBackgroundProject(this)) { - this.projectService.pendingEnsureProjectForOpenFiles = true; - } - this.projectService.onProjectCreation(this); - } - /** @internal */ - getRedirectFromSourceFile(_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.projectService.typingsInstaller.isKnownTypesPackageName(name); - } - installPackage(options) { - return this.projectService.typingsInstaller.installPackage({ ...options, projectName: this.projectName, projectRootPath: this.toPath(this.currentDirectory) }); - } - /** @internal */ - getGlobalTypingsCacheLocation() { - return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : void 0; - } - /** @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.rootFilesMap.size) { - 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, - /*deferredDeleteOk*/ - false - ); - if (scriptInfo) { - const existingValue = this.rootFilesMap.get(scriptInfo.path); - if (existingValue && existingValue.info !== 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, - /*deferredDeleteOk*/ - false - ); - 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.projectService.getScriptInfoForPath(path) || !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 */ - 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.enable || !newTypeAcquisition.include) { - return newTypeAcquisition; - } - return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) }; - } - getExternalFiles(updateLevel) { - return toSorted(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; - if (this.typingsCache) this.projectService.typingsInstaller.onProjectClosed(this); - this.typingsCache = void 0; - this.closeWatchingTypingLocations(); - this.cleanupProgram(); - forEach(this.externalFiles, (externalFile) => this.detachScriptInfoIfNotRoot(externalFile)); - this.rootFilesMap.forEach((root) => { - var _a2; - return (_a2 = root.info) == null ? void 0 : _a2.detachFromProject(this); - }); - this.projectService.pendingEnsureProjectForOpenFiles = true; - 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.rootFilesMap === void 0; - } - hasRoots() { - var _a; - return !!((_a = this.rootFilesMap) == null ? void 0 : _a.size); - } - /** @internal */ - isOrphan() { - return false; - } - getRootFiles() { - return this.rootFilesMap && arrayFrom(mapDefinedIterator(this.rootFilesMap.values(), (value) => { - var _a; - return (_a = value.info) == null ? void 0 : _a.fileName; - })); - } - /** @internal */ - getRootFilesMap() { - return this.rootFilesMap; - } - getRootScriptInfos() { - return arrayFrom(mapDefinedIterator(this.rootFilesMap.values(), (value) => value.info)); - } - getScriptInfos() { - if (!this.languageServiceEnabled) { - return this.getRootScriptInfos(); - } - 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, _b; - return ((_b = (_a = this.rootFilesMap) == null ? void 0 : _a.get(info.path)) == null ? void 0 : _b.info) === info; - } - // add a root file to project - addRoot(info, fileName) { - Debug.assert(!this.isRoot(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); - } - } - /** @internal */ - markAsDirty() { - if (!this.dirty) { - this.projectStateVersion++; - this.dirty = true; - } - } - /** @internal */ - markAutoImportProviderAsDirty() { - var _a; - if (!this.autoImportProviderHost) this.autoImportProviderHost = void 0; - (_a = this.autoImportProviderHost) == null ? void 0 : _a.markAsDirty(); - } - /** @internal */ - onAutoImportProviderSettingsChanged() { - this.markAutoImportProviderAsDirty(); - } - /** @internal */ - onPackageJsonChange() { - this.moduleSpecifierCache.clear(); - this.markAutoImportProviderAsDirty(); - } - /** @internal */ - onFileAddedOrRemoved(isSymlink) { - this.hasAddedorRemovedFiles = true; - if (isSymlink) { - this.hasAddedOrRemovedSymlinks = true; - } - } - /** @internal */ - onDiscoveredSymlink() { - this.hasAddedOrRemovedSymlinks = true; - } - /** @internal */ - onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath, newSourceFileByResolvedPath) { - if (!newSourceFileByResolvedPath || oldSourceFile.resolvedPath === oldSourceFile.path && newSourceFileByResolvedPath.resolvedPath !== oldSourceFile.path) { - this.detachScriptInfoFromProject(oldSourceFile.fileName, hasSourceFileByPath); - } - } - /** @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; - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "updateGraph", { name: this.projectName, kind: ProjectKind[this.projectKind] }); - 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.enqueueInstallTypingsForProject(hasAddedorRemovedFiles); - } else { - this.lastCachedUnresolvedImportsList = void 0; - } - const isFirstProgramLoad = this.projectProgramVersion === 0 && hasNewProgram; - if (hasNewProgram) { - this.projectProgramVersion++; - } - if (hasAddedorRemovedFiles) { - this.markAutoImportProviderAsDirty(); - } - if (isFirstProgramLoad) { - this.getPackageJsonAutoImportProvider(); - } - (_b = tracing) == null ? void 0 : _b.pop(); - return !hasNewProgram; - } - /** @internal */ - enqueueInstallTypingsForProject(forceRefresh) { - const typeAcquisition = this.getTypeAcquisition(); - if (!typeAcquisition || !typeAcquisition.enable || this.projectService.typingsInstaller === nullTypingsInstaller) { - return; - } - const entry = this.typingsCache; - if (forceRefresh || !entry || typeAcquisitionChanged(typeAcquisition, entry.typeAcquisition) || compilerOptionsChanged(this.getCompilationSettings(), entry.compilerOptions) || unresolvedImportsChanged(this.lastCachedUnresolvedImportsList, entry.unresolvedImports)) { - this.typingsCache = { - compilerOptions: this.getCompilationSettings(), - typeAcquisition, - unresolvedImports: this.lastCachedUnresolvedImportsList - }; - this.projectService.typingsInstaller.enqueueInstallTypingsRequest(this, typeAcquisition, this.lastCachedUnresolvedImportsList); - } - } - /** @internal */ - updateTypingFiles(compilerOptions, typeAcquisition, unresolvedImports, newTypings) { - this.typingsCache = { - compilerOptions, - typeAcquisition, - unresolvedImports - }; - const typingFiles = !typeAcquisition || !typeAcquisition.enable ? emptyArray2 : toSorted(newTypings); - 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); - } - } - closeWatchingTypingLocations() { - if (this.typingWatchers) clearMap(this.typingWatchers, closeFileWatcher); - this.typingWatchers = void 0; - } - 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)) { - const watchType = typingsWatcherType === "FileWatcher" /* FileWatcher */ ? WatchType.TypingInstallerLocationFile : WatchType.TypingInstallerLocationDirectory; - this.typingWatchers.set( - canonicalPath, - canWatchDirectoryOrFilePath(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, - 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, - this - ) : (this.writeLog(`Skipping watcher creation at ${path}:: ${getDetailWatchInfo(watchType, this)}`), noopFileWatcher) - ); - } - }; - 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) { - if (!include.length) return include; - const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this); - return filter(include, (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; - this.rootFilesMap.forEach((value, path) => { - var _a2; - const file = this.program.getSourceFileByPath(path); - const info = value.info; - if (!file || ((_a2 = value.info) == null ? void 0 : _a2.path) === file.resolvedPath) return; - value.info = this.projectService.getScriptInfo(file.fileName); - Debug.assert(value.info.isAttached(this)); - info == null ? void 0 : info.detachFromProject(this); - }); - 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 = this.compilerOptions.outFile; - 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.program), - 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, - /*deferredDeleteOk*/ - false - ); - 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) { - const scriptInfoToDetach = this.projectService.getScriptInfo(uncheckedFileName); - if (scriptInfoToDetach) { - scriptInfoToDetach.detachFromProject(this); - if (!noRemoveResolution) { - this.resolutionCache.removeResolutionsOfFile(scriptInfoToDetach.path); - } - } - } - 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 (this.compilerOptions.outFile) { - 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 - ); - } - filesToStringWorker(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) { - if (this.initialLoadPending) 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.initialLoadPending) { - 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) { - 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, this); - } - /** @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() - ) ?? false; - 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(); - } - } - isDefaultProjectForOpenFiles() { - return !!forEachEntry( - this.projectService.openFiles, - (_projectRootPath, path) => this.projectService.tryGetDefaultProjectForFile(this.projectService.getScriptInfoForPath(path)) === 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 */); - this.noDtsResolutionProject ?? (this.noDtsResolutionProject = new AuxiliaryProject(this)); - if (this.noDtsResolutionProject.rootFile !== rootFile) { - this.projectService.setFileNamesOfAutoImportProviderOrAuxillaryProject( - this.noDtsResolutionProject, - [rootFile] - ); - this.noDtsResolutionProject.rootFile = rootFile; - } - return this.noDtsResolutionProject; - } - /** @internal */ - runWithTemporaryFileUpdate(rootFile, updatedText, cb) { - var _a, _b, _c, _d; - const originalProgram = this.program; - const rootSourceFile = Debug.checkDefined((_a = this.program) == null ? void 0 : _a.getSourceFile(rootFile), "Expected file to be part of program"); - const originalText = Debug.checkDefined(rootSourceFile.getFullText()); - (_b = this.getScriptInfo(rootFile)) == null ? void 0 : _b.editContent(0, originalText.length, updatedText); - this.updateGraph(); - try { - cb(this.program, originalProgram, (_c = this.program) == null ? void 0 : _c.getSourceFile(rootFile)); - } finally { - (_d = this.getScriptInfo(rootFile)) == null ? void 0 : _d.editContent(0, updatedText.length, originalText); - } - } - /** @internal */ - getCompilerOptionsForNoDtsResolutionProject() { - return { - ...this.getCompilerOptions(), - noDtsResolution: true, - allowJs: true, - maxNodeModuleJsDepth: 3, - diagnostics: false, - skipLibCheck: true, - sourceMap: false, - types: emptyArray, - lib: emptyArray, - noLib: true - }; - } -}; -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; - }); -} -var InferredProject2 = class extends Project2 { - /** @internal */ - constructor(projectService, compilerOptions, watchOptions, projectRootPath, currentDirectory, typeAcquisition) { - super( - projectService.newInferredProjectName(), - 0 /* Inferred */, - projectService, - /*hasExplicitListOfFiles*/ - false, - /*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.stopWatchingConfigFilesForScriptInfo(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.stopWatchingConfigFilesForScriptInfo(info)); - super.close(); - } - getTypeAcquisition() { - return this.typeAcquisition || { - enable: allRootFilesAreJsOrDts(this), - include: emptyArray, - exclude: emptyArray - }; - } -}; -var AuxiliaryProject = class extends Project2 { - constructor(hostProject) { - super( - hostProject.projectService.newAuxiliaryProjectName(), - 4 /* Auxiliary */, - hostProject.projectService, - /*hasExplicitListOfFiles*/ - false, - /*lastFileExceededProgramSize*/ - void 0, - hostProject.getCompilerOptionsForNoDtsResolutionProject(), - /*compileOnSaveEnabled*/ - false, - /*watchOptions*/ - void 0, - hostProject.projectService.host, - hostProject.currentDirectory - ); - } - isOrphan() { - return true; - } - scheduleInvalidateResolutionsOfFailedLookupLocations() { - return; - } -}; -var _AutoImportProviderProject = class _AutoImportProviderProject extends Project2 { - /** @internal */ - constructor(hostProject, initialRootNames, compilerOptions) { - super( - hostProject.projectService.newAutoImportProviderProjectName(), - 3 /* AutoImportProvider */, - hostProject.projectService, - /*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) { - dependenciesAdded += addRootNames(entrypoints); - 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); - dependenciesAdded += addRootNames(entrypoints); - return true; - } - } - }); - if (done) continue; - if (packageJson && compilerOptions.allowJs && compilerOptions.maxNodeModuleJsDepth) { - const entrypoints = getRootNamesFromPackageJson( - packageJson, - program, - symlinkCache, - /*resolveJs*/ - true - ); - dependenciesAdded += addRootNames(entrypoints); - } - } - } - const references = program.getResolvedProjectReferences(); - let referencesAddded = 0; - if ((references == null ? void 0 : references.length) && hostProject.projectService.getHostPreferences().includeCompletionsForModuleExports) { - references.forEach((ref) => { - if (ref == null ? void 0 : ref.commandLine.options.outFile) { - referencesAddded += addRootNames(filterEntrypoints([ - changeExtension(ref.commandLine.options.outFile, ".d.ts") - ])); - } else if (ref) { - const getCommonSourceDirectory2 = memoize( - () => getCommonSourceDirectoryOfConfig( - ref.commandLine, - !hostProject.useCaseSensitiveFileNames() - ) - ); - referencesAddded += addRootNames(filterEntrypoints(mapDefined( - ref.commandLine.fileNames, - (fileName) => !isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */) && !program.getSourceFile(fileName) ? getOutputDeclarationFileName( - fileName, - ref.commandLine, - !hostProject.useCaseSensitiveFileNames(), - getCommonSourceDirectory2 - ) : void 0 - ))); - } - }); - } - if (rootNames == null ? void 0 : rootNames.size) { - hostProject.log(`AutoImportProviderProject: found ${rootNames.size} root files in ${dependenciesAdded} dependencies ${referencesAddded} referenced projects in ${timestamp() - start} ms`); - } - return rootNames ? arrayFrom(rootNames.values()) : emptyArray; - function addRootNames(entrypoints) { - if (!(entrypoints == null ? void 0 : entrypoints.length)) return 0; - rootNames ?? (rootNames = /* @__PURE__ */ new Set()); - entrypoints.forEach((entry) => rootNames.add(entry)); - return 1; - } - 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 filterEntrypoints(entrypoints, isSymlink ? (entrypoint) => entrypoint.replace(packageJson.packageDirectory, real) : void 0); - } - } - function filterEntrypoints(entrypoints, symlinkName) { - return mapDefined(entrypoints, (entrypoint) => { - const resolvedFileName = symlinkName ? symlinkName(entrypoint) : entrypoint; - if (!program.getSourceFile(resolvedFileName) && !(symlinkName && program.getSourceFile(entrypoint))) { - return resolvedFileName; - } - }); - } - } - /** @internal */ - static create(dependencySelection, hostProject, host) { - 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, compilerOptions); - } - /** @internal */ - isEmpty() { - return !some(this.rootFileNames); - } - /** @internal */ - 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.setFileNamesOfAutoImportProviderOrAuxillaryProject(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); - } - /** @internal */ - 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(); - } -}; -_AutoImportProviderProject.maxDependencies = 10; -/** @internal */ -_AutoImportProviderProject.compilerOptionsOverrides = { - diagnostics: false, - skipLibCheck: true, - sourceMap: false, - types: emptyArray, - lib: emptyArray, - noLib: true -}; -var AutoImportProviderProject = _AutoImportProviderProject; -var ConfiguredProject2 = class extends Project2 { - /** @internal */ - constructor(configFileName, canonicalConfigFilePath, projectService, cachedDirectoryStructureHost, pendingUpdateReason) { - super( - configFileName, - 1 /* Configured */, - projectService, - /*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.initialLoadPending = true; - /** @internal */ - this.sendLoadingProjectFinish = false; - this.pendingUpdateLevel = 2 /* Full */; - this.pendingUpdateReason = pendingUpdateReason; - } - /** @internal */ - setCompilerHost(host) { - this.compilerHost = host; - } - /** @internal */ - getCompilerHost() { - return this.compilerHost; - } - /** @internal */ - useSourceOfProjectReferenceRedirect() { - return this.languageServiceEnabled; - } - /** @internal */ - getParsedCommandLine(fileName) { - const configFileName = toNormalizedPath(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(toNormalizedPath(fileName)))); - } - 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() { - if (this.deferredClose) return false; - const isDirty = this.dirty; - this.initialLoadPending = false; - 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.projectService.reloadConfiguredProject(this, reason); - result = true; - break; - default: - result = super.updateGraph(); - } - this.compilerHost = void 0; - this.projectService.sendProjectLoadingFinishEvent(this); - this.projectService.sendProjectTelemetry(this); - if (updateLevel === 2 /* Full */ || // Already sent event through reload - result && // Not new program - (!isDirty || !this.triggerFileForConfigFileDiag || this.getCurrentProgram().structureIsReused === 2 /* Completely */)) { - this.triggerFileForConfigFileDiag = void 0; - } else if (!this.triggerFileForConfigFileDiag) { - this.projectService.sendConfigFileDiagEvent( - this, - /*triggerFile*/ - void 0, - /*force*/ - false - ); - } - 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.initialLoadPending); - (this.potentialProjectReferences || (this.potentialProjectReferences = /* @__PURE__ */ new Set())).add(canonicalConfigPath); - } - /** @internal */ - getRedirectFromSourceFile(fileName) { - const program = this.getCurrentProgram(); - return program && program.getRedirectFromSourceFile(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 */ - markAsDirty() { - if (this.deferredClose) return; - super.markAsDirty(); - } - /** @internal */ - isOrphan() { - return !!this.deferredClose; - } - getEffectiveTypeRoots() { - return getEffectiveTypeRoots(this.getCompilationSettings(), this) || []; - } - /** @internal */ - updateErrorOnNoInputFiles(parsedCommandLine) { - this.parsedCommandLine = parsedCommandLine; - updateErrorForNoInputFiles( - parsedCommandLine.fileNames, - this.getConfigFilePath(), - this.getCompilerOptions().configFile.configFileSpecs, - this.projectErrors, - canJsonReportNoInputFiles(parsedCommandLine.raw) - ); - } -}; -var ExternalProject = class extends Project2 { - /** @internal */ - constructor(externalProjectName, projectService, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, projectFilePath, watchOptions) { - super( - externalProjectName, - 2 /* External */, - projectService, - /*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; - } -}; -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 */; -} -function isProjectDeferredClose(project) { - return isConfiguredProject(project) && !!project.deferredClose; -} - -// src/server/editorServices.ts -var maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; -var maxFileSize = 4 * 1024 * 1024; -var ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; -var ProjectLoadingStartEvent = "projectLoadingStart"; -var ProjectLoadingFinishEvent = "projectLoadingFinish"; -var LargeFileReferencedEvent = "largeFileReferenced"; -var ConfigFileDiagEvent = "configFileDiag"; -var ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; -var ProjectInfoTelemetryEvent = "projectInfo"; -var OpenFileInfoTelemetryEvent = "openFileInfo"; -var CreateFileWatcherEvent = "createFileWatcher"; -var CreateDirectoryWatcherEvent = "createDirectoryWatcher"; -var CloseFileWatcherEvent = "closeFileWatcher"; -var ensureProjectForOpenFileSchedule = "*ensureProjectForOpenFiles*"; -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; -} -var compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(optionDeclarations); -var watchOptionsConverters = prepareConvertersForEnumLikeCompilerOptions(optionsForWatch); -var indentStyle = new Map(Object.entries({ - none: 0 /* None */, - block: 1 /* Block */, - smart: 2 /* Smart */ -})); -var 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, "$"]] - } -}; -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; -} -var 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)) -}; -var externalFilePropertyReader = { - getFileName: (x) => x.fileName, - getScriptKind: (x) => tryConvertScriptKindName(x.scriptKind), - // TODO: GH#18217 - hasMixedContent: (x) => !!x.hasMixedContent -}; -function findProjectByName(projectName, projects) { - for (const proj of projects) { - if (proj.getProjectName() === projectName) { - return proj; - } - } -} -var 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 -}; -var noopConfigFileWatcher = { close: noop }; -function getConfigFileNameFromCache(info, cache) { - if (!cache) return void 0; - const configFileForOpenFile = cache.get(info.path); - if (configFileForOpenFile === void 0) return void 0; - if (!isAncestorConfigFileInfo(info)) { - return isString(configFileForOpenFile) || !configFileForOpenFile ? configFileForOpenFile : ( - // direct result - configFileForOpenFile.get( - /*key*/ - false - ) - ); - } else { - return configFileForOpenFile && !isString(configFileForOpenFile) ? ( - // Map with fileName as key - configFileForOpenFile.get(info.fileName) - ) : void 0; - } -} -function isOpenScriptInfo(infoOrFileNameOrConfig) { - return !!infoOrFileNameOrConfig.containingProjects; -} -function isAncestorConfigFileInfo(infoOrFileNameOrConfig) { - return !!infoOrFileNameOrConfig.configFileInfo; -} -var ConfiguredProjectLoadKind = /* @__PURE__ */ ((ConfiguredProjectLoadKind2) => { - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["FindOptimized"] = 0] = "FindOptimized"; - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["Find"] = 1] = "Find"; - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["CreateReplayOptimized"] = 2] = "CreateReplayOptimized"; - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["CreateReplay"] = 3] = "CreateReplay"; - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["CreateOptimized"] = 4] = "CreateOptimized"; - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["Create"] = 5] = "Create"; - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["ReloadOptimized"] = 6] = "ReloadOptimized"; - ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["Reload"] = 7] = "Reload"; - return ConfiguredProjectLoadKind2; -})(ConfiguredProjectLoadKind || {}); -function toConfiguredProjectLoadOptimized(kind) { - return kind - 1; -} -function forEachAncestorProjectLoad(info, project, cb, kind, reason, allowDeferredClosed, reloadedProjects, searchOnlyPotentialSolution, delayReloadedConfiguredProjects) { - var _a; - while (true) { - if (project.parsedCommandLine && (searchOnlyPotentialSolution && !project.parsedCommandLine.options.composite || // Currently disableSolutionSearching is shared for finding solution/project when - // - loading solution for find all references - // - trying to find default project - project.parsedCommandLine.options.disableSolutionSearching)) return; - const configFileName = project.projectService.getConfigFileNameForFile( - { - fileName: project.getConfigFilePath(), - path: info.path, - configFileInfo: true, - isForDefaultProject: !searchOnlyPotentialSolution - }, - kind <= 3 /* CreateReplay */ - ); - if (!configFileName) return; - const ancestor = project.projectService.findCreateOrReloadConfiguredProject( - configFileName, - kind, - reason, - allowDeferredClosed, - !searchOnlyPotentialSolution ? info.fileName : void 0, - // Config Diag event for project if its for default project - reloadedProjects, - searchOnlyPotentialSolution, - // Delay load if we are searching for solution - delayReloadedConfiguredProjects - ); - if (!ancestor) return; - if (!ancestor.project.parsedCommandLine && ((_a = project.parsedCommandLine) == null ? void 0 : _a.options.composite)) { - ancestor.project.setPotentialProjectReference(project.canonicalConfigFilePath); - } - const result = cb(ancestor); - if (result) return result; - project = ancestor.project; - } -} -function forEachResolvedProjectReferenceProjectLoad(project, parentConfig, cb, kind, reason, allowDeferredClosed, reloadedProjects, seenResolvedRefs) { - const loadKind = parentConfig.options.disableReferencedProjectLoad ? 0 /* FindOptimized */ : kind; - let children; - return forEach( - parentConfig.projectReferences, - (ref) => { - var _a; - const childConfigName = toNormalizedPath(resolveProjectReferencePath(ref)); - const childCanonicalConfigPath = asNormalizedPath(project.projectService.toCanonicalFileName(childConfigName)); - const seenValue = seenResolvedRefs == null ? void 0 : seenResolvedRefs.get(childCanonicalConfigPath); - if (seenValue !== void 0 && seenValue >= loadKind) return void 0; - const configFileExistenceInfo = project.projectService.configFileExistenceInfoCache.get(childCanonicalConfigPath); - let childConfig = loadKind === 0 /* FindOptimized */ ? (configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.exists) || ((_a = project.resolvedChildConfigs) == null ? void 0 : _a.has(childCanonicalConfigPath)) ? configFileExistenceInfo.config.parsedCommandLine : void 0 : project.getParsedCommandLine(childConfigName); - if (childConfig && loadKind !== kind && loadKind > 2 /* CreateReplayOptimized */) { - childConfig = project.getParsedCommandLine(childConfigName); - } - if (!childConfig) return void 0; - const childProject = project.projectService.findConfiguredProjectByProjectName(childConfigName, allowDeferredClosed); - if (loadKind === 2 /* CreateReplayOptimized */ && !configFileExistenceInfo && !childProject) return void 0; - switch (loadKind) { - case 6 /* ReloadOptimized */: - if (childProject) childProject.projectService.reloadConfiguredProjectOptimized(childProject, reason, reloadedProjects); - // falls through - case 4 /* CreateOptimized */: - (project.resolvedChildConfigs ?? (project.resolvedChildConfigs = /* @__PURE__ */ new Set())).add(childCanonicalConfigPath); - // falls through - case 2 /* CreateReplayOptimized */: - case 0 /* FindOptimized */: - if (childProject || loadKind !== 0 /* FindOptimized */) { - const result = cb( - configFileExistenceInfo ?? project.projectService.configFileExistenceInfoCache.get(childCanonicalConfigPath), - childProject, - childConfigName, - reason, - project, - childCanonicalConfigPath - ); - if (result) return result; - } - break; - default: - Debug.assertNever(loadKind); - } - (seenResolvedRefs ?? (seenResolvedRefs = /* @__PURE__ */ new Map())).set(childCanonicalConfigPath, loadKind); - (children ?? (children = [])).push(childConfig); - } - ) || forEach( - children, - (childConfig) => childConfig.projectReferences && forEachResolvedProjectReferenceProjectLoad( - project, - childConfig, - cb, - loadKind, - reason, - allowDeferredClosed, - reloadedProjects, - seenResolvedRefs - ) - ); -} -function updateProjectFoundUsingFind(project, kind, triggerFile, reason, reloadedProjects) { - let sentConfigFileDiag = false; - let configFileExistenceInfo; - switch (kind) { - case 2 /* CreateReplayOptimized */: - case 3 /* CreateReplay */: - if (useConfigFileExistenceInfoForOptimizedLoading(project)) { - configFileExistenceInfo = project.projectService.configFileExistenceInfoCache.get(project.canonicalConfigFilePath); - } - break; - case 4 /* CreateOptimized */: - configFileExistenceInfo = configFileExistenceInfoForOptimizedLoading(project); - if (configFileExistenceInfo) break; - // falls through - case 5 /* Create */: - sentConfigFileDiag = updateConfiguredProject(project, triggerFile); - break; - case 6 /* ReloadOptimized */: - project.projectService.reloadConfiguredProjectOptimized(project, reason, reloadedProjects); - configFileExistenceInfo = configFileExistenceInfoForOptimizedLoading(project); - if (configFileExistenceInfo) break; - // falls through - case 7 /* Reload */: - sentConfigFileDiag = project.projectService.reloadConfiguredProjectClearingSemanticCache( - project, - reason, - reloadedProjects - ); - break; - case 0 /* FindOptimized */: - case 1 /* Find */: - break; - default: - Debug.assertNever(kind); - } - return { project, sentConfigFileDiag, configFileExistenceInfo, reason }; -} -function forEachPotentialProjectReference(project, cb) { - return project.initialLoadPending ? (project.potentialProjectReferences && forEachKey(project.potentialProjectReferences, cb)) ?? (project.resolvedChildConfigs && forEachKey(project.resolvedChildConfigs, cb)) : void 0; -} -function forEachAnyProjectReferenceKind(project, cb, cbProjectRef, cbPotentialProjectRef) { - return project.getCurrentProgram() ? project.forEachResolvedProjectReference(cb) : project.initialLoadPending ? 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 updateProjectIfDirty(project) { - project.invalidateResolutionsOfFailedLookupLocations(); - return project.dirty && !project.updateGraph(); -} -function updateWithTriggerFile(project, triggerFile, isReload) { - if (!isReload) { - project.invalidateResolutionsOfFailedLookupLocations(); - if (!project.dirty) return false; - } - project.triggerFileForConfigFileDiag = triggerFile; - const updateLevel = project.pendingUpdateLevel; - project.updateGraph(); - if (!project.triggerFileForConfigFileDiag && !isReload) return updateLevel === 2 /* Full */; - const sent = project.projectService.sendConfigFileDiagEvent(project, triggerFile, isReload); - project.triggerFileForConfigFileDiag = void 0; - return sent; -} -function updateConfiguredProject(project, triggerFile) { - if (triggerFile) { - if (updateWithTriggerFile( - project, - triggerFile, - /*isReload*/ - false - )) return true; - } else { - updateProjectIfDirty(project); - } - return false; -} -function configFileExistenceInfoForOptimizedLoading(project) { - const configFileName = toNormalizedPath(project.getConfigFilePath()); - const configFileExistenceInfo = project.projectService.ensureParsedConfigUptoDate( - configFileName, - project.canonicalConfigFilePath, - project.projectService.configFileExistenceInfoCache.get(project.canonicalConfigFilePath), - project - ); - const parsedCommandLine = configFileExistenceInfo.config.parsedCommandLine; - project.parsedCommandLine = parsedCommandLine; - project.resolvedChildConfigs = void 0; - project.updateReferences(parsedCommandLine.projectReferences); - if (useConfigFileExistenceInfoForOptimizedLoading(project)) return configFileExistenceInfo; -} -function useConfigFileExistenceInfoForOptimizedLoading(project) { - return !!project.parsedCommandLine && (!!project.parsedCommandLine.options.composite || // If solution, no need to load it to determine if file belongs to it - !!isSolutionConfig(project.parsedCommandLine)); -} -function configFileExistenceInfoForOptimizedReplay(project) { - return useConfigFileExistenceInfoForOptimizedLoading(project) ? project.projectService.configFileExistenceInfoCache.get(project.canonicalConfigFilePath) : void 0; -} -function fileOpenReason(info) { - return `Creating possible configured project for ${info.fileName} to open`; -} -function reloadReason(reason) { - return `User requested reload projects: ${reason}`; -} -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 getCanUseWatchEvents(service, canUseWatchEvents) { - return !!canUseWatchEvents && !!service.eventHandler && !!service.session; -} -function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) { - if (!getCanUseWatchEvents(service, canUseWatchEvents)) 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, - // Special case node_modules as we watch it for changes to closed script infos as well - ignoreUpdate: !path.endsWith("/node_modules") ? true : void 0 - } - }) - ); - } - function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) { - 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(args) { - if (isArray(args)) args.forEach(onWatchChangeRequestArgs); - else onWatchChangeRequestArgs(args); - } - function onWatchChangeRequestArgs({ id, created, deleted, updated }) { - onWatchEventType(id, created, 0 /* Created */); - onWatchEventType(id, deleted, 2 /* Deleted */); - onWatchEventType(id, updated, 1 /* Changed */); - } - function onWatchEventType(id, paths, eventKind) { - if (!(paths == null ? void 0 : paths.length)) return; - forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind)); - forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath)); - forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath)); - } - function forEachCallback(hostWatcherMap, id, eventPaths, cb) { - var _a; - (_a = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => { - eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath))); - }); - } -} -var _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 Set(); - /** - * 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(); - /** Config files looked up and cached config files for open script info */ - this.configFileForOpenFiles = /* @__PURE__ */ new Map(); - /** Set of open script infos that are root of inferred project */ - this.rootOfInferredProjects = /* @__PURE__ */ new Set(); - /** - * 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(); - this.sharedExtendedConfigFileWatchers = /* @__PURE__ */ new Map(); - 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); - this.logger.info(`currentDirectory:: ${this.host.getCurrentDirectory()} useCaseSensitiveFileNames:: ${this.host.useCaseSensitiveFileNames}`); - this.logger.info(`libs Location:: ${getDirectoryPath(this.host.getExecutingFilePath())}`); - this.logger.info(`globalTypingsCacheLocation:: ${this.typingsInstaller.globalTypingsCacheLocation}`); - if (this.typesMapLocation) { - this.loadTypesMap(); - } else { - this.logger.info("No types map provided; using the default"); - } - this.typingsInstaller.attach(this); - 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 - ); - this.canUseWatchEvents = getCanUseWatchEvents(this, opts.canUseWatchEvents); - (_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( - response.compilerOptions, - response.typeAcquisition, - response.unresolvedImports, - response.typings - ); - return; - case ActionInvalidate: - project.enqueueInstallTypingsForProject( - /*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) { - if (isProjectDeferredClose(project)) return; - 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; - } - /** - * If there is default project calculation pending for this file, - * then it completes that calculation so that correct default project is used for the project - */ - tryGetDefaultProjectForEnsuringConfiguredProjectForFile(fileNameOrScriptInfo) { - var _a; - const scriptInfo = isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo; - if (!scriptInfo) return void 0; - if ((_a = this.pendingOpenFileProjectUpdates) == null ? void 0 : _a.delete(scriptInfo.path)) { - this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo( - scriptInfo, - 5 /* Create */ - ); - if (scriptInfo.isOrphan()) { - this.assignOrphanScriptInfoToInferredProject(scriptInfo, this.openFiles.get(scriptInfo.path)); - } - } - return this.tryGetDefaultProjectForFile(scriptInfo); - } - /** @internal */ - ensureDefaultProjectForFile(fileNameOrScriptInfo) { - return this.tryGetDefaultProjectForEnsuringConfiguredProjectForFile(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) { - Debug.assert(!info.isScriptOpen()); - if (eventKind === 2 /* Deleted */) { - this.handleDeletedFile( - info, - /*deferredDelete*/ - true - ); - } else { - if (info.deferredDelete) info.deferredDelete = void 0; - 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 == null ? void 0 : 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, deferredDelete) { - Debug.assert(!info.isScriptOpen()); - this.delayUpdateProjectGraphs( - info.containingProjects, - /*clearSourceMapperCache*/ - false - ); - this.handleSourceMapProjects(info); - info.detachAllProjects(); - if (deferredDelete) { - info.delayReloadNonMixedContentFile(); - info.deferredDelete = true; - } else { - this.deleteScriptInfo(info); - } - } - /** - * This is to watch whenever files are added or removed to the wildcard directories - */ - watchWildcardDirectory(directory, flags, configFileName, config) { - let watcher = this.watchFactory.watchDirectory( - directory, - (fileOrDirectory) => this.onWildCardDirectoryWatcherInvoke( - directory, - configFileName, - config, - result, - fileOrDirectory - ), - flags, - this.getWatchOptionsFromProjectWatchOptions(config.parsedCommandLine.watchOptions, getDirectoryPath(configFileName)), - 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; - } - onWildCardDirectoryWatcherInvoke(directory, configFileName, config, wildCardWatcher, 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, wildCardWatcher); - } - if (!(fsResult == null ? void 0 : fsResult.fileExists)) { - this.sendSourceFileChange(fileOrDirectoryPath); - } - 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) => { - var _a; - if (!watchWildcardDirectories) return; - const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath); - if (!project) return; - if (configuredProjectForConfig !== project && this.getHostPreferences().includeCompletionsForModuleExports) { - const path = this.toPath(configFileName); - if (find((_a = project.getCurrentProgram()) == null ? void 0 : _a.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path)) { - project.markAutoImportProviderAsDirty(); - } - } - const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */; - if (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); - } - }); - } - 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.cachedDirectoryStructureHost.clearCache(); - configFileExistenceInfo.config.projects.forEach((_watchWildcardDirectories, projectCanonicalPath) => { - var _a, _b, _c; - const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath); - if (!project) return; - scheduledAnyProjectUpdate = true; - if (projectCanonicalPath === canonicalConfigFilePath) { - if (project.initialLoadPending) return; - project.pendingUpdateLevel = 2 /* Full */; - project.pendingUpdateReason = loadReason; - this.delayUpdateProjectGraph(project); - project.markAutoImportProviderAsDirty(); - } else { - if (project.initialLoadPending) { - (_b = (_a = this.configFileExistenceInfoCache.get(projectCanonicalPath)) == null ? void 0 : _a.openFilesImpactedByConfigFile) == null ? void 0 : _b.forEach((path2) => { - var _a2; - if (!((_a2 = this.pendingOpenFileProjectUpdates) == null ? void 0 : _a2.has(path2))) { - (this.pendingOpenFileProjectUpdates ?? (this.pendingOpenFileProjectUpdates = /* @__PURE__ */ new Map())).set( - path2, - this.configFileForOpenFiles.get(path2) - ); - } - }); - return; - } - const path = this.toPath(canonicalConfigFilePath); - project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(path); - this.delayUpdateProjectGraph(project); - if (this.getHostPreferences().includeCompletionsForModuleExports && find((_c = project.getCurrentProgram()) == null ? void 0 : _c.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path)) { - project.markAutoImportProviderAsDirty(); - } - } - }); - return scheduledAnyProjectUpdate; - } - onConfigFileChanged(configFileName, canonicalConfigFilePath, eventKind) { - const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); - const project = this.getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath); - const wasDefferedClose = project == null ? void 0 : project.deferredClose; - if (eventKind === 2 /* Deleted */) { - configFileExistenceInfo.exists = false; - if (project) project.deferredClose = true; - } else { - configFileExistenceInfo.exists = true; - if (wasDefferedClose) { - project.deferredClose = void 0; - project.markAsDirty(); - } - } - this.delayUpdateProjectsFromParsedConfigOnConfigFileChange( - canonicalConfigFilePath, - "Change in config file detected" - ); - this.openFiles.forEach((_projectRootPath, path) => { - var _a, _b; - const configFileForOpenFile = this.configFileForOpenFiles.get(path); - if (!((_a = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a.has(path))) return; - this.configFileForOpenFiles.delete(path); - const info = this.getScriptInfoForPath(path); - const newConfigFileNameForInfo = this.getConfigFileNameForFile( - info, - /*findFromCacheOnly*/ - false - ); - if (!newConfigFileNameForInfo) return; - if (!((_b = this.pendingOpenFileProjectUpdates) == null ? void 0 : _b.has(path))) { - (this.pendingOpenFileProjectUpdates ?? (this.pendingOpenFileProjectUpdates = /* @__PURE__ */ new Map())).set(path, configFileForOpenFile); - } - }); - 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) { - var _a; - const fileExists = info.isDynamic ? false : this.host.fileExists(info.fileName); - info.close(fileExists); - this.stopWatchingConfigFilesForScriptInfo(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 < 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); - (_a = this.pendingOpenFileProjectUpdates) == null ? void 0 : _a.delete(info.path); - Debug.assert(!this.rootOfInferredProjects.has(info)); - if (!skipAssignOrphanScriptInfosToInferredProject && ensureProjectsForOpenFiles) { - this.assignOrphanScriptInfosToInferredProject(); - } - if (fileExists) { - this.watchClosedScriptInfo(info); - } else { - this.handleDeletedFile( - info, - /*deferredDelete*/ - false - ); - } - return ensureProjectsForOpenFiles; - } - deleteScriptInfo(info) { - Debug.assert(!info.isScriptOpen()); - this.filenameToScriptInfo.delete(info.path); - this.filenameToScriptInfoVersion.set(info.path, info.textStorage.version); - this.stopWatchingScriptInfo(info); - const realpath = info.getRealpathIfDifferent(); - if (realpath) { - this.realpathToScriptInfos.remove(realpath, info); - } - info.closeSourceMapFileWatcher(); - } - configFileExists(configFileName, canonicalConfigFilePath, info) { - const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); - let openFilesImpactedByConfigFile; - if (this.openFiles.has(info.path) && (!isAncestorConfigFileInfo(info) || info.isForDefaultProject)) { - if (configFileExistenceInfo) (configFileExistenceInfo.openFilesImpactedByConfigFile ?? (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Set())).add(info.path); - else (openFilesImpactedByConfigFile = /* @__PURE__ */ new Set()).add(info.path); - } - if (configFileExistenceInfo) return configFileExistenceInfo.exists; - const exists = this.host.fileExists(configFileName); - this.configFileExistenceInfoCache.set(canonicalConfigFilePath, { exists, openFilesImpactedByConfigFile }); - return exists; - } - 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(configFileName, canonicalConfigFilePath, eventKind), - 2e3 /* High */, - this.getWatchOptionsFromProjectWatchOptions((_b = (_a = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config) == null ? void 0 : _a.parsedCommandLine) == null ? void 0 : _b.watchOptions, getDirectoryPath(configFileName)), - WatchType.ConfigFile, - forProject - ); - } - this.ensureConfigFileWatcherForProject(configFileExistenceInfo, forProject); - } - ensureConfigFileWatcherForProject(configFileExistenceInfo, forProject) { - const projects = configFileExistenceInfo.config.projects; - projects.set(forProject.canonicalConfigFilePath, projects.get(forProject.canonicalConfigFilePath) || false); - } - /** @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 (configFileExistenceInfo.inferredProjectRoots) { - if (!canWatchDirectoryOrFilePath(getDirectoryPath(canonicalConfigFilePath))) { - configFileExistenceInfo.watcher.close(); - configFileExistenceInfo.watcher = noopConfigFileWatcher; - } - } else { - configFileExistenceInfo.watcher.close(); - configFileExistenceInfo.watcher = void 0; - } - } else { - configFileExistenceInfo.watcher.close(); - this.configFileExistenceInfoCache.delete(canonicalConfigFilePath); - } - } - /** - * This is called on file close or when its removed from inferred project as root, - * so that we handle the watches and inferred project root data - * @internal - */ - stopWatchingConfigFilesForScriptInfo(info) { - if (this.serverMode !== 0 /* Semantic */) return; - const isRootOfInferredProject = this.rootOfInferredProjects.delete(info); - const isOpen = info.isScriptOpen(); - if (isOpen && !isRootOfInferredProject) return; - this.forEachConfigFileLocation(info, (canonicalConfigFilePath) => { - var _a, _b, _c; - const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); - if (!configFileExistenceInfo) return; - if (isOpen) { - if (!((_a = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a.has(info.path))) return; - } else { - if (!((_b = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _b.delete(info.path))) return; - } - if (isRootOfInferredProject) { - configFileExistenceInfo.inferredProjectRoots--; - if (configFileExistenceInfo.watcher && !configFileExistenceInfo.config && !configFileExistenceInfo.inferredProjectRoots) { - configFileExistenceInfo.watcher.close(); - configFileExistenceInfo.watcher = void 0; - } - } - 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) { - if (this.serverMode !== 0 /* Semantic */) return; - Debug.assert(info.isScriptOpen()); - this.rootOfInferredProjects.add(info); - this.forEachConfigFileLocation(info, (canonicalConfigFilePath, configFileName) => { - let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); - if (!configFileExistenceInfo) { - configFileExistenceInfo = { exists: this.host.fileExists(configFileName), inferredProjectRoots: 1 }; - this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo); - } else { - configFileExistenceInfo.inferredProjectRoots = (configFileExistenceInfo.inferredProjectRoots ?? 0) + 1; - } - (configFileExistenceInfo.openFilesImpactedByConfigFile ?? (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Set())).add(info.path); - configFileExistenceInfo.watcher || (configFileExistenceInfo.watcher = canWatchDirectoryOrFilePath(getDirectoryPath(canonicalConfigFilePath)) ? this.watchFactory.watchFile( - configFileName, - (_filename, eventKind) => this.onConfigFileChanged(configFileName, canonicalConfigFilePath, eventKind), - 2e3 /* High */, - this.hostConfiguration.watchOptions, - WatchType.ConfigFileForInferredRoot - ) : noopConfigFileWatcher); - }); - } - /** - * 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 searchTsconfig = true; - let searchJsconfig = true; - if (isAncestorConfigFileInfo(info)) { - if (endsWith(info.fileName, "tsconfig.json")) searchTsconfig = false; - else searchTsconfig = searchJsconfig = false; - } - do { - const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName); - if (searchTsconfig) { - const tsconfigFileName = asNormalizedPath(combinePaths(searchPath, "tsconfig.json")); - const result = action(combinePaths(canonicalSearchPath, "tsconfig.json"), tsconfigFileName); - if (result) return tsconfigFileName; - } - if (searchJsconfig) { - const jsconfigFileName = asNormalizedPath(combinePaths(searchPath, "jsconfig.json")); - const 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; - searchTsconfig = searchJsconfig = true; - } while (anySearchPathOk || isSearchPathInProjectRoot()); - return void 0; - } - /** @internal */ - findDefaultConfiguredProject(info) { - var _a; - return (_a = this.findDefaultConfiguredProjectWorker( - info, - 1 /* Find */ - )) == null ? void 0 : _a.defaultProject; - } - /** @internal */ - findDefaultConfiguredProjectWorker(info, kind) { - return info.isScriptOpen() ? this.tryFindDefaultConfiguredProjectForOpenScriptInfo( - info, - kind - ) : void 0; - } - /** Get cached configFileName for scriptInfo or ancestor of open script info */ - getConfigFileNameForFileFromCache(info, lookInPendingFilesForValue) { - if (lookInPendingFilesForValue) { - const result = getConfigFileNameFromCache(info, this.pendingOpenFileProjectUpdates); - if (result !== void 0) return result; - } - return getConfigFileNameFromCache(info, this.configFileForOpenFiles); - } - /** Caches the configFilename for script info or ancestor of open script info */ - setConfigFileNameForFileInCache(info, configFileName) { - if (!this.openFiles.has(info.path)) return; - const config = configFileName || false; - if (!isAncestorConfigFileInfo(info)) { - this.configFileForOpenFiles.set(info.path, config); - } else { - let configFileForOpenFile = this.configFileForOpenFiles.get(info.path); - if (!configFileForOpenFile || isString(configFileForOpenFile)) { - this.configFileForOpenFiles.set( - info.path, - configFileForOpenFile = (/* @__PURE__ */ new Map()).set(false, configFileForOpenFile) - ); - } - configFileForOpenFile.set(info.fileName, config); - } - } - /** - * 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 - * when findFromCacheOnly is true only looked up in cache instead of hitting disk to figure things out - * @internal - */ - getConfigFileNameForFile(info, findFromCacheOnly) { - const fromCache = this.getConfigFileNameForFileFromCache(info, findFromCacheOnly); - if (fromCache !== void 0) return fromCache || void 0; - if (findFromCacheOnly) return void 0; - const configFileName = this.forEachConfigFileLocation(info, (canonicalConfigFilePath, configFileName2) => this.configFileExists(configFileName2, canonicalConfigFilePath, info)); - this.logger.info(`getConfigFileNameForFile:: File: ${info.fileName} ProjectRootPath: ${this.openFiles.get(info.path)}:: Result: ${configFileName}`); - this.setConfigFileNameForFileInCache(info, configFileName); - 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, allowDeferredClosed) { - const canonicalConfigFilePath = asNormalizedPath(this.toCanonicalFileName(configFileName)); - const result = this.getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath); - return allowDeferredClosed ? result : !(result == null ? void 0 : result.deferredClose) ? result : void 0; - } - 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 ExternalProject( - projectFileName, - this, - 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 ExternalProject ? "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, reason) { - var _a; - (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "createConfiguredProject", { configFilePath: 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, - configFileExistenceInfo.config.cachedDirectoryStructureHost, - reason - ); - Debug.assert(!this.configuredProjects.has(canonicalConfigFilePath)); - this.configuredProjects.set(canonicalConfigFilePath, project); - this.createConfigFileWatcherForParsedConfig(configFileName, canonicalConfigFilePath, project); - return project; - } - /** - * Read the config file of the project, and update the project root file names. - */ - 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 = toNormalizedPath(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.parsedCommandLine = parsedCommandLine; - 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 === 1 /* RootNamesAndUpdate */) { - this.reloadFileNamesOfParsedConfig(configFilename, configFileExistenceInfo.config); - } - if (!configFileExistenceInfo.config.updateLevel) { - this.ensureConfigFileWatcherForProject(configFileExistenceInfo, forProject); - return configFileExistenceInfo; - } - } - if (!configFileExistenceInfo.exists && configFileExistenceInfo.config) { - configFileExistenceInfo.config.updateLevel = void 0; - this.ensureConfigFileWatcherForProject(configFileExistenceInfo, forProject); - 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 configDir = getDirectoryPath(configFilename); - const parsedCommandLine = parseJsonSourceFileConfigFileContent( - configFile, - cachedDirectoryStructureHost, - configDir, - /*existingOptions*/ - void 0, - configFilename, - /*resolutionStack*/ - void 0, - 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, - configDir - ), - // New options - this.getWatchOptionsFromProjectWatchOptions(parsedCommandLine.watchOptions, configDir) - )) { - (_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) { - var _a; - 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 (((_a = existingValue.info) == null ? void 0 : _a.path) === path) { - 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, - /*deferredDeleteOk*/ - false - )); - 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 config = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath).config); - project.updateErrorOnNoInputFiles(config); - this.updateNonInferredProjectFiles( - project, - config.fileNames.concat(project.getExternalFiles(1 /* RootNamesAndUpdate */)), - fileNamePropertyReader - ); - project.markAsDirty(); - return project.updateGraph(); - } - reloadFileNamesOfParsedConfig(configFileName, config) { - if (config.updateLevel === void 0) return config.parsedCommandLine; - 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 }; - config.updateLevel = void 0; - return config.parsedCommandLine; - } - /** @internal */ - setFileNamesOfAutoImportProviderOrAuxillaryProject(project, fileNames) { - this.updateNonInferredProjectFiles(project, fileNames, fileNamePropertyReader); - } - /** @internal */ - reloadConfiguredProjectOptimized(project, reason, reloadedProjects) { - if (reloadedProjects.has(project)) return; - reloadedProjects.set(project, 6 /* ReloadOptimized */); - if (!project.initialLoadPending) { - this.setProjectForReload(project, 2 /* Full */, reason); - } - } - /** @internal */ - reloadConfiguredProjectClearingSemanticCache(project, reason, reloadedProjects) { - if (reloadedProjects.get(project) === 7 /* Reload */) return false; - reloadedProjects.set(project, 7 /* Reload */); - this.clearSemanticCache(project); - this.reloadConfiguredProject(project, reloadReason(reason)); - return true; - } - setProjectForReload(project, updateLevel, reason) { - if (updateLevel === 2 /* Full */) this.clearSemanticCache(project); - project.pendingUpdateReason = reason && reloadReason(reason); - project.pendingUpdateLevel = updateLevel; - } - /** - * Read the config file of the project again by clearing the cache and update the project graph - * - * @internal - */ - reloadConfiguredProject(project, reason) { - project.initialLoadPending = false; - this.setProjectForReload(project, 0 /* Update */); - this.loadConfiguredProject(project, reason); - updateWithTriggerFile( - project, - project.triggerFileForConfigFileDiag ?? project.getConfigFilePath(), - /*isReload*/ - true - ); - } - clearSemanticCache(project) { - project.originalConfiguredProjects = void 0; - project.resolutionCache.clear(); - project.getLanguageService( - /*ensureSynchronized*/ - false - ).cleanupSemanticCache(); - project.cleanupProgram(); - project.markAsDirty(); - } - /** @internal */ - sendConfigFileDiagEvent(project, triggerFile, force) { - if (!this.eventHandler || this.suppressDiagnosticEvents) return false; - const diagnostics = project.getLanguageService().getCompilerOptionsDiagnostics(); - diagnostics.push(...project.getAllProjectErrors()); - if (!force && diagnostics.length === (project.configDiagDiagnosticsReported ?? 0)) return false; - project.configDiagDiagnosticsReported = diagnostics.length; - this.eventHandler( - { - eventName: ConfigFileDiagEvent, - data: { configFileName: project.getConfigFilePath(), diagnostics, triggerFile: triggerFile ?? project.getConfigFilePath() } - } - ); - return true; - } - 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( - this.currentDirectory, - /*isSingleInferredProject*/ - true, - /*projectRootPath*/ - void 0 - ); - } - 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, - /*isSingleInferredProject*/ - false, - /*projectRootPath*/ - void 0 - ); - } - 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, - 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, deferredDeleteOk) { - return this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath( - toNormalizedPath(uncheckedFileName), - currentDirectory, - /*scriptKind*/ - void 0, - /*hasMixedContent*/ - void 0, - hostToQueryFileExistsOn, - deferredDeleteOk - ); - } - 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( - mapDefinedIterator( - this.filenameToScriptInfo.entries(), - (entry) => entry[1].deferredDelete ? void 0 : entry - ), - ([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.filenameToScriptInfo.get(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, deferredDeleteOk) { - if (isRootedDiskPath(fileName) || isDynamicFileName(fileName)) { - return this.getOrCreateScriptInfoWorker( - fileName, - currentDirectory, - /*openedByClient*/ - false, - /*fileContent*/ - void 0, - scriptKind, - !!hasMixedContent, - hostToQueryFileExistsOn, - deferredDeleteOk - ); - } - const info = this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(fileName)); - if (info) { - return info; - } - return void 0; - } - getOrCreateScriptInfoForNormalizedPath(fileName, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { - return this.getOrCreateScriptInfoWorker( - fileName, - this.currentDirectory, - openedByClient, - fileContent, - scriptKind, - !!hasMixedContent, - hostToQueryFileExistsOn, - /*deferredDeleteOk*/ - false - ); - } - getOrCreateScriptInfoWorker(fileName, currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn, deferredDeleteOk) { - 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.filenameToScriptInfo.get(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); - } - } else if (info.deferredDelete) { - Debug.assert(!info.isDynamic); - if (!openedByClient && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) { - return deferredDeleteOk ? info : void 0; - } - info.deferredDelete = void 0; - } - 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) { - const info = this.filenameToScriptInfo.get(fileName); - return !info || !info.deferredDelete ? info : void 0; - } - /** @internal */ - getDocumentPositionMapper(project, generatedFileName, sourceFileName) { - const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient( - generatedFileName, - project.currentDirectory, - this.host, - /*deferredDeleteOk*/ - false - ); - 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 readMapFile = (mapFileName, mapFileNameFromDts) => { - const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient( - mapFileName, - project.currentDirectory, - this.host, - /*deferredDeleteOk*/ - true - ); - sourceMapFileInfo = mapInfo || mapFileNameFromDts; - if (!mapInfo || mapInfo.deferredDelete) return void 0; - 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) { - if (!isString(sourceMapFileInfo)) { - declarationInfo.sourceMapFilePath = sourceMapFileInfo.path; - sourceMapFileInfo.declarationInfoPath = declarationInfo.path; - if (!sourceMapFileInfo.deferredDelete) sourceMapFileInfo.documentPositionMapper = documentPositionMapper || false; - sourceMapFileInfo.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, sourceMapFileInfo.sourceInfos); - } else { - declarationInfo.sourceMapFilePath = { - watcher: this.addMissingSourceMapFile( - project.currentDirectory === this.currentDirectory ? sourceMapFileInfo : getNormalizedAbsolutePath(sourceMapFileInfo, 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, - /*deferredDeleteOk*/ - false - ); - (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, - /*deferredDeleteOk*/ - false - ); - 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, - includeCompletionsForModuleExports - } = 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.deferredClose && !project.isClosed() && project.pendingUpdateLevel === 2 /* Full */ && !this.hasPendingProjectUpdate(project)) { - project.updateGraph(); - } - }) - ); - } - if (includePackageJsonAutoImports !== args.preferences.includePackageJsonAutoImports || !!includeCompletionsForModuleExports !== !!args.preferences.includeCompletionsForModuleExports) { - 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) { - const watchOptions = (_a = convertWatchOptions(args.watchOptions)) == null ? void 0 : _a.watchOptions; - const substitution = handleWatchOptionsConfigDirTemplateSubstitution(watchOptions, this.currentDirectory); - this.hostConfiguration.watchOptions = substitution; - this.hostConfiguration.beforeSubstitution = substitution === watchOptions ? void 0 : 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(), project.getCurrentDirectory()); - } - getWatchOptionsFromProjectWatchOptions(projectOptions, basePath) { - const hostWatchOptions = !this.hostConfiguration.beforeSubstitution ? this.hostConfiguration.watchOptions : handleWatchOptionsConfigDirTemplateSubstitution( - this.hostConfiguration.beforeSubstitution, - basePath - ); - return projectOptions && hostWatchOptions ? { ...hostWatchOptions, ...projectOptions } : projectOptions || hostWatchOptions; - } - closeLog() { - this.logger.close(); - } - sendSourceFileChange(inPath) { - this.filenameToScriptInfo.forEach((info) => { - if (this.openFiles.has(info.path)) return; - if (!info.fileWatcher) return; - const eventKind = memoize( - () => this.host.fileExists(info.fileName) ? info.deferredDelete ? 0 /* Created */ : 1 /* Changed */ : 2 /* Deleted */ - ); - if (inPath) { - if (isScriptInfoWatchedFromNodeModules(info) || !info.path.startsWith(inPath)) return; - if (eventKind() === 2 /* Deleted */ && info.deferredDelete) return; - this.logger.info(`Invoking sourceFileChange on ${info.fileName}:: ${eventKind()}`); - } - this.onSourceFileChanged( - info, - eventKind() - ); - }); - } - /** - * 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.sendSourceFileChange( - /*inPath*/ - void 0 - ); - this.pendingProjectUpdates.forEach((_project, projectName) => { - this.throttledOperations.cancel(projectName); - this.pendingProjectUpdates.delete(projectName); - }); - this.throttledOperations.cancel(ensureProjectForOpenFileSchedule); - this.pendingOpenFileProjectUpdates = void 0; - this.pendingEnsureProjectForOpenFiles = false; - this.configFileExistenceInfoCache.forEach((info) => { - if (info.config) { - info.config.updateLevel = 2 /* Full */; - info.config.cachedDirectoryStructureHost.clearCache(); - } - }); - this.configFileForOpenFiles.clear(); - this.externalProjects.forEach((project) => { - this.clearSemanticCache(project); - project.updateGraph(); - }); - const reloadedConfiguredProjects = /* @__PURE__ */ new Map(); - const delayReloadedConfiguredProjects = /* @__PURE__ */ new Set(); - this.externalProjectToConfiguredProjectMap.forEach((projects, externalProjectName) => { - const reason = `Reloading configured project in external project: ${externalProjectName}`; - projects.forEach((project) => { - if (this.getHostPreferences().lazyConfiguredProjectsFromExternalProject) { - this.reloadConfiguredProjectOptimized(project, reason, reloadedConfiguredProjects); - } else { - this.reloadConfiguredProjectClearingSemanticCache( - project, - reason, - reloadedConfiguredProjects - ); - } - }); - }); - this.openFiles.forEach((_projectRootPath, path) => { - const info = this.getScriptInfoForPath(path); - if (find(info.containingProjects, isExternalProject)) return; - this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo( - info, - 7 /* Reload */, - reloadedConfiguredProjects, - delayReloadedConfiguredProjects - ); - }); - delayReloadedConfiguredProjects.forEach((p) => reloadedConfiguredProjects.set(p, 7 /* Reload */)); - this.inferredProjects.forEach((project) => this.clearSemanticCache(project)); - this.ensureProjectForOpenFiles(); - this.cleanupProjectsAndScriptInfos( - reloadedConfiguredProjects, - new Set(this.openFiles.keys()), - new Set(this.externalProjectToConfiguredProjectMap.keys()) - ); - this.logger.info("After reloading projects.."); - this.printProjects(); - } - /** - * 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(); - const pendingOpenFileProjectUpdates = this.pendingOpenFileProjectUpdates; - this.pendingOpenFileProjectUpdates = void 0; - pendingOpenFileProjectUpdates == null ? void 0 : pendingOpenFileProjectUpdates.forEach( - (_config, path) => this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo( - this.getScriptInfoForPath(path), - 5 /* Create */ - ) - ); - 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, - /*findFromCacheOnly*/ - false - ); - 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.createConfiguredProject(configFileName, `Creating project for original file: ${originalFileInfo.fileName}${location !== originalLocation ? " for location: " + location.fileName : ""}`); - } - const result = this.tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo( - originalFileInfo, - 5 /* Create */, - updateProjectFoundUsingFind( - configuredProject, - 4 /* CreateOptimized */ - ), - (project2) => `Creating project referenced in solution ${project2.projectName} to find possible configured project for original file: ${originalFileInfo.fileName}${location !== originalLocation ? " for location: " + location.fileName : ""}` - ); - if (!result.defaultProject) return void 0; - if (result.defaultProject === project) return originalLocation; - addOriginalConfiguredProject(result.defaultProject); - 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) { - (project.originalConfiguredProjects ?? (project.originalConfiguredProjects = /* @__PURE__ */ new Set())).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.getOrCreateScriptInfoWorker( - fileName, - projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, - /*openedByClient*/ - true, - fileContent, - scriptKind, - !!hasMixedContent, - /*hostToQueryFileExistsOn*/ - void 0, - /*deferredDeleteOk*/ - true - ); - this.openFiles.set(info.path, projectRootPath); - return info; - } - assignProjectToOpenedScriptInfo(info) { - let configFileName; - let configFileErrors; - const project = this.findExternalProjectContainingOpenScriptInfo(info); - let retainProjects; - let sentConfigDiag; - if (!project && this.serverMode === 0 /* Semantic */) { - const result = this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo( - info, - 5 /* Create */ - ); - if (result) { - retainProjects = result.seenProjects; - sentConfigDiag = result.sentConfigDiag; - if (result.defaultProject) { - configFileName = result.defaultProject.getConfigFilePath(); - configFileErrors = result.defaultProject.getAllProjectErrors(); - } - } - } - info.containingProjects.forEach(updateProjectIfDirty); - if (info.isOrphan()) { - retainProjects == null ? void 0 : retainProjects.forEach((kind, project2) => { - if (kind !== 4 /* CreateOptimized */ && !sentConfigDiag.has(project2)) this.sendConfigFileDiagEvent( - project2, - info.fileName, - /*force*/ - true - ); - }); - Debug.assert(this.openFiles.has(info.path)); - this.assignOrphanScriptInfoToInferredProject(info, this.openFiles.get(info.path)); - } - Debug.assert(!info.isOrphan()); - return { configFileName, configFileErrors, retainProjects }; - } - /** - * Depending on kind - * - Find the configuedProject and return it - if allowDeferredClosed is set it will find the deferredClosed project as well - * - Create - if the project doesnt exist, it creates one as well. If not delayLoad, the project is updated (with triggerFile if passed) - * - Reload - if the project doesnt exist, it creates one. If not delayLoad, the project is reloaded clearing semantic cache - * @internal - */ - findCreateOrReloadConfiguredProject(configFileName, kind, reason, allowDeferredClosed, triggerFile, reloadedProjects, delayLoad, delayReloadedConfiguredProjects, projectForConfigFile) { - let project = projectForConfigFile ?? this.findConfiguredProjectByProjectName(configFileName, allowDeferredClosed); - let sentConfigFileDiag = false; - let configFileExistenceInfo; - switch (kind) { - case 0 /* FindOptimized */: - case 1 /* Find */: - case 3 /* CreateReplay */: - if (!project) return; - break; - case 2 /* CreateReplayOptimized */: - if (!project) return; - configFileExistenceInfo = configFileExistenceInfoForOptimizedReplay(project); - break; - case 4 /* CreateOptimized */: - case 5 /* Create */: - project ?? (project = this.createConfiguredProject(configFileName, reason)); - if (!delayLoad) { - ({ sentConfigFileDiag, configFileExistenceInfo } = updateProjectFoundUsingFind( - project, - kind, - triggerFile - )); - } - break; - case 6 /* ReloadOptimized */: - project ?? (project = this.createConfiguredProject(configFileName, reloadReason(reason))); - project.projectService.reloadConfiguredProjectOptimized(project, reason, reloadedProjects); - configFileExistenceInfo = configFileExistenceInfoForOptimizedLoading(project); - if (configFileExistenceInfo) break; - // falls through - case 7 /* Reload */: - project ?? (project = this.createConfiguredProject(configFileName, reloadReason(reason))); - sentConfigFileDiag = !delayReloadedConfiguredProjects && this.reloadConfiguredProjectClearingSemanticCache(project, reason, reloadedProjects); - if (delayReloadedConfiguredProjects && !delayReloadedConfiguredProjects.has(project) && !reloadedProjects.has(project)) { - this.setProjectForReload(project, 2 /* Full */, reason); - delayReloadedConfiguredProjects.add(project); - } - break; - default: - Debug.assertNever(kind); - } - return { project, sentConfigFileDiag, configFileExistenceInfo, reason }; - } - /** - * Finds the default configured project for given info - * For any tsconfig found, it looks into that project, if not then all its references, - * The search happens for all tsconfigs till projectRootPath - */ - tryFindDefaultConfiguredProjectForOpenScriptInfo(info, kind, allowDeferredClosed, reloadedProjects) { - const configFileName = this.getConfigFileNameForFile(info, kind <= 3 /* CreateReplay */); - if (!configFileName) return; - const optimizedKind = toConfiguredProjectLoadOptimized(kind); - const result = this.findCreateOrReloadConfiguredProject( - configFileName, - optimizedKind, - fileOpenReason(info), - allowDeferredClosed, - info.fileName, - reloadedProjects - ); - return result && this.tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo( - info, - kind, - result, - (project) => `Creating project referenced in solution ${project.projectName} to find possible configured project for ${info.fileName} to open`, - allowDeferredClosed, - reloadedProjects - ); - } - isMatchedByConfig(configFileName, config, info) { - if (config.fileNames.some((rootName) => this.toPath(rootName) === info.path)) return true; - if (isSupportedSourceFileName( - info.fileName, - config.options, - this.hostConfiguration.extraFileExtensions - )) return false; - const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = config.options.configFile.configFileSpecs; - const basePath = toNormalizedPath(getNormalizedAbsolutePath(getDirectoryPath(configFileName), this.currentDirectory)); - if (validatedFilesSpec == null ? void 0 : validatedFilesSpec.some((fileSpec) => this.toPath(getNormalizedAbsolutePath(fileSpec, basePath)) === info.path)) return true; - if (!(validatedIncludeSpecs == null ? void 0 : validatedIncludeSpecs.length)) return false; - if (matchesExcludeWorker( - info.fileName, - validatedExcludeSpecs, - this.host.useCaseSensitiveFileNames, - this.currentDirectory, - basePath - )) return false; - return validatedIncludeSpecs == null ? void 0 : validatedIncludeSpecs.some((includeSpec) => { - const pattern = getPatternFromSpec(includeSpec, basePath, "files"); - return !!pattern && getRegexFromPattern(`(${pattern})$`, this.host.useCaseSensitiveFileNames).test(info.fileName); - }); - } - tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo(info, kind, initialConfigResult, referencedProjectReason, allowDeferredClosed, reloadedProjects) { - const infoIsOpenScriptInfo = isOpenScriptInfo(info); - const optimizedKind = toConfiguredProjectLoadOptimized(kind); - const seenProjects = /* @__PURE__ */ new Map(); - let seenConfigs; - const sentConfigDiag = /* @__PURE__ */ new Set(); - let defaultProject; - let possiblyDefault; - let tsconfigOfDefault; - let tsconfigOfPossiblyDefault; - tryFindDefaultConfiguredProject(initialConfigResult); - return { - defaultProject: defaultProject ?? possiblyDefault, - tsconfigProject: tsconfigOfDefault ?? tsconfigOfPossiblyDefault, - sentConfigDiag, - seenProjects, - seenConfigs - }; - function tryFindDefaultConfiguredProject(result) { - return isDefaultProjectOptimized(result, result.project) ?? tryFindDefaultConfiguredProjectFromReferences(result.project) ?? tryFindDefaultConfiguredProjectFromAncestor(result.project); - } - function isDefaultConfigFileExistenceInfo(configFileExistenceInfo, project, childConfigName, reason, tsconfigProject, canonicalConfigFilePath) { - if (project) { - if (seenProjects.has(project)) return; - seenProjects.set(project, optimizedKind); - } else { - if (seenConfigs == null ? void 0 : seenConfigs.has(canonicalConfigFilePath)) return; - (seenConfigs ?? (seenConfigs = /* @__PURE__ */ new Set())).add(canonicalConfigFilePath); - } - if (!tsconfigProject.projectService.isMatchedByConfig( - childConfigName, - configFileExistenceInfo.config.parsedCommandLine, - info - )) { - if (tsconfigProject.languageServiceEnabled) { - tsconfigProject.projectService.watchWildcards( - childConfigName, - configFileExistenceInfo, - tsconfigProject - ); - } - return; - } - const result = project ? updateProjectFoundUsingFind( - project, - kind, - info.fileName, - reason, - reloadedProjects - ) : tsconfigProject.projectService.findCreateOrReloadConfiguredProject( - childConfigName, - kind, - reason, - allowDeferredClosed, - info.fileName, - reloadedProjects - ); - if (!result) { - Debug.assert(kind === 3 /* CreateReplay */); - return void 0; - } - seenProjects.set(result.project, optimizedKind); - if (result.sentConfigFileDiag) sentConfigDiag.add(result.project); - return isDefaultProject(result.project, tsconfigProject); - } - function isDefaultProject(project, tsconfigProject) { - if (seenProjects.get(project) === kind) return; - seenProjects.set(project, kind); - const scriptInfo = infoIsOpenScriptInfo ? info : project.projectService.getScriptInfo(info.fileName); - const projectWithInfo = scriptInfo && project.containsScriptInfo(scriptInfo); - if (projectWithInfo && !project.isSourceOfProjectReferenceRedirect(scriptInfo.path)) { - tsconfigOfDefault = tsconfigProject; - return defaultProject = project; - } - if (!possiblyDefault && infoIsOpenScriptInfo && projectWithInfo) { - tsconfigOfPossiblyDefault = tsconfigProject; - possiblyDefault = project; - } - } - function isDefaultProjectOptimized(result, tsconfigProject) { - if (result.sentConfigFileDiag) sentConfigDiag.add(result.project); - return result.configFileExistenceInfo ? isDefaultConfigFileExistenceInfo( - result.configFileExistenceInfo, - result.project, - toNormalizedPath(result.project.getConfigFilePath()), - result.reason, - result.project, - result.project.canonicalConfigFilePath - ) : isDefaultProject(result.project, tsconfigProject); - } - function tryFindDefaultConfiguredProjectFromReferences(project) { - return project.parsedCommandLine && forEachResolvedProjectReferenceProjectLoad( - project, - project.parsedCommandLine, - isDefaultConfigFileExistenceInfo, - optimizedKind, - referencedProjectReason(project), - allowDeferredClosed, - reloadedProjects - ); - } - function tryFindDefaultConfiguredProjectFromAncestor(project) { - return infoIsOpenScriptInfo ? forEachAncestorProjectLoad( - // If not in referenced projects, try ancestors and its references - info, - project, - tryFindDefaultConfiguredProject, - optimizedKind, - `Creating possible configured project for ${info.fileName} to open`, - allowDeferredClosed, - reloadedProjects, - /*searchOnlyPotentialSolution*/ - false - ) : void 0; - } - } - tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(info, kind, reloadedProjects, delayReloadedConfiguredProjects) { - const allowDeferredClosed = kind === 1 /* Find */; - const result = this.tryFindDefaultConfiguredProjectForOpenScriptInfo( - info, - kind, - allowDeferredClosed, - reloadedProjects - ); - if (!result) return; - const { defaultProject, tsconfigProject, seenProjects } = result; - if (defaultProject) { - forEachAncestorProjectLoad( - info, - tsconfigProject, - (ancestor) => { - seenProjects.set(ancestor.project, kind); - }, - kind, - `Creating project possibly referencing default composite project ${defaultProject.getProjectName()} of open file ${info.fileName}`, - allowDeferredClosed, - reloadedProjects, - /*searchOnlyPotentialSolution*/ - true, - delayReloadedConfiguredProjects - ); - } - return result; - } - /** @internal */ - loadAncestorProjectTree(forProjects) { - forProjects ?? (forProjects = new Set( - mapDefinedIterator(this.configuredProjects.entries(), ([key, project]) => !project.initialLoadPending ? key : void 0) - )); - const seenProjects = /* @__PURE__ */ new Set(); - const currentConfiguredProjects = arrayFrom(this.configuredProjects.values()); - for (const project of currentConfiguredProjects) { - 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 = this.findConfiguredProjectByProjectName(configFileName) ?? this.createConfiguredProject( - configFileName, - `Creating project referenced by : ${project.projectName} as it references project ${referencedProject.sourceFile.fileName}` - ); - updateProjectIfDirty(childProject); - this.ensureProjectChildren(childProject, forProjects, seenProjects); - } - } - cleanupConfiguredProjects(toRetainConfiguredProjects, externalProjectsRetainingConfiguredProjects, openFilesWithRetainedConfiguredProject) { - this.getOrphanConfiguredProjects( - toRetainConfiguredProjects, - openFilesWithRetainedConfiguredProject, - externalProjectsRetainingConfiguredProjects - ).forEach((project) => this.removeProject(project)); - } - cleanupProjectsAndScriptInfos(toRetainConfiguredProjects, openFilesWithRetainedConfiguredProject, externalProjectsRetainingConfiguredProjects) { - this.cleanupConfiguredProjects( - toRetainConfiguredProjects, - externalProjectsRetainingConfiguredProjects, - openFilesWithRetainedConfiguredProject - ); - for (const inferredProject of this.inferredProjects.slice()) { - if (inferredProject.isOrphan()) { - this.removeProject(inferredProject); - } - } - this.removeOrphanScriptInfos(); - } - tryInvokeWildCardDirectories(info) { - this.configFileExistenceInfoCache.forEach((configFileExistenceInfo, config) => { - var _a, _b; - if (!((_a = configFileExistenceInfo.config) == null ? void 0 : _a.parsedCommandLine) || contains( - configFileExistenceInfo.config.parsedCommandLine.fileNames, - info.fileName, - !this.host.useCaseSensitiveFileNames ? equateStringsCaseInsensitive : equateStringsCaseSensitive - )) { - return; - } - (_b = configFileExistenceInfo.config.watchedDirectories) == null ? void 0 : _b.forEach((watcher, directory) => { - if (containsPath(directory, info.fileName, !this.host.useCaseSensitiveFileNames)) { - this.logger.info(`Invoking ${config}:: wildcard for open scriptInfo:: ${info.fileName}`); - this.onWildCardDirectoryWatcherInvoke( - directory, - config, - configFileExistenceInfo.config, - watcher.watcher, - info.fileName - ); - } - }); - }); - } - openClientFileWithNormalizedPath(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { - const existing = this.getScriptInfoForPath(normalizedPathToPath( - fileName, - projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, - this.toCanonicalFileName - )); - const info = this.getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath); - if (!existing && info && !info.isDynamic) this.tryInvokeWildCardDirectories(info); - const { retainProjects, ...result } = this.assignProjectToOpenedScriptInfo(info); - this.cleanupProjectsAndScriptInfos( - retainProjects, - /* @__PURE__ */ new Set([info.path]), - /*externalProjectsRetainingConfiguredProjects*/ - void 0 - ); - this.telemetryOnOpenFile(info); - this.printProjects(); - return result; - } - /** @internal */ - getOrphanConfiguredProjects(toRetainConfiguredProjects, openFilesWithRetainedConfiguredProject, externalProjectsRetainingConfiguredProjects) { - const toRemoveConfiguredProjects = new Set(this.configuredProjects.values()); - const markOriginalProjectsAsUsed = (project) => { - if (project.originalConfiguredProjects && (isConfiguredProject(project) || !project.isOrphan())) { - project.originalConfiguredProjects.forEach( - (_value, configuredProjectPath) => { - const project2 = this.getConfiguredProjectByCanonicalConfigFilePath(configuredProjectPath); - return project2 && retainConfiguredProject(project2); - } - ); - } - }; - toRetainConfiguredProjects == null ? void 0 : toRetainConfiguredProjects.forEach((_, project) => retainConfiguredProject(project)); - if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects; - this.inferredProjects.forEach(markOriginalProjectsAsUsed); - this.externalProjects.forEach(markOriginalProjectsAsUsed); - this.externalProjectToConfiguredProjectMap.forEach((projects, externalProjectName) => { - if (!(externalProjectsRetainingConfiguredProjects == null ? void 0 : externalProjectsRetainingConfiguredProjects.has(externalProjectName))) { - projects.forEach(retainConfiguredProject); - } - }); - if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects; - forEachEntry(this.openFiles, (_projectRootPath, path) => { - if (openFilesWithRetainedConfiguredProject == null ? void 0 : openFilesWithRetainedConfiguredProject.has(path)) return; - const info = this.getScriptInfoForPath(path); - if (find(info.containingProjects, isExternalProject)) return; - const result = this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo( - info, - 1 /* Find */ - ); - if (result == null ? void 0 : result.defaultProject) { - result == null ? void 0 : result.seenProjects.forEach((_, project) => retainConfiguredProject(project)); - if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects; - } - }); - if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects; - forEachEntry(this.configuredProjects, (project) => { - if (toRemoveConfiguredProjects.has(project)) { - if (isPendingUpdate(project) || forEachReferencedProject(project, isRetained)) { - retainConfiguredProject(project); - if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects; - } - } - }); - return toRemoveConfiguredProjects; - function isRetained(project) { - return !toRemoveConfiguredProjects.has(project) || isPendingUpdate(project); - } - function isPendingUpdate(project) { - var _a, _b; - return (project.deferredClose || project.projectService.hasPendingProjectUpdate(project)) && !!((_b = (_a = project.projectService.configFileExistenceInfoCache.get(project.canonicalConfigFilePath)) == null ? void 0 : _a.openFilesImpactedByConfigFile) == null ? void 0 : _b.size); - } - function retainConfiguredProject(project) { - if (!toRemoveConfiguredProjects.delete(project)) return; - markOriginalProjectsAsUsed(project); - forEachReferencedProject(project, retainConfiguredProject); - } - } - removeOrphanScriptInfos() { - const toRemoveScriptInfos = new Map(this.filenameToScriptInfo); - this.filenameToScriptInfo.forEach((info) => { - if (info.deferredDelete) return; - if (!info.isScriptOpen() && info.isOrphan() && !scriptInfoIsContainedByDeferredClosedProject(info) && !scriptInfoIsContainedByBackgroundProject(info)) { - if (!info.sourceMapFilePath) return; - let sourceInfos; - if (isString(info.sourceMapFilePath)) { - const sourceMapInfo = this.filenameToScriptInfo.get(info.sourceMapFilePath); - sourceInfos = sourceMapInfo == null ? void 0 : 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)) { - const sourceMapInfo = this.filenameToScriptInfo.get(info.sourceMapFilePath); - if (sourceMapInfo == null ? void 0 : sourceMapInfo.deferredDelete) { - info.sourceMapFilePath = { - watcher: this.addMissingSourceMapFile(sourceMapInfo.fileName, info.path), - sourceInfos: sourceMapInfo.sourceInfos - }; - } else { - toRemoveScriptInfos.delete(info.sourceMapFilePath); - } - sourceInfos = sourceMapInfo == null ? void 0 : sourceMapInfo.sourceInfos; - } else { - sourceInfos = info.sourceMapFilePath.sourceInfos; - } - if (sourceInfos) { - sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); - } - } - }); - toRemoveScriptInfos.forEach((info) => this.deleteScriptInfo(info)); - } - 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, mapDefinedIterator(this.configuredProjects.values(), (p) => p.deferredClose ? void 0 : p), includeProjectReferenceRedirectInfo, files); - this.collectChanges(knownProjects, this.inferredProjects, includeProjectReferenceRedirectInfo, files); - return files; - } - /** @internal */ - applyChangesInOpenFiles(openFiles, changedFiles, closedFiles) { - let existingOpenScriptInfos; - let openScriptInfos; - let assignOrphanScriptInfosToInferredProject = false; - if (openFiles) { - for (const file of openFiles) { - (existingOpenScriptInfos ?? (existingOpenScriptInfos = [])).push(this.getScriptInfoForPath(normalizedPathToPath( - toNormalizedPath(file.fileName), - file.projectRootPath ? this.getNormalizedAbsolutePath(file.projectRootPath) : this.currentDirectory, - this.toCanonicalFileName - ))); - 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; - forEach( - existingOpenScriptInfos, - (existing, index) => !existing && openScriptInfos[index] && !openScriptInfos[index].isDynamic ? this.tryInvokeWildCardDirectories(openScriptInfos[index]) : void 0 - ); - openScriptInfos == null ? void 0 : openScriptInfos.forEach( - (info) => { - var _a; - return (_a = this.assignProjectToOpenedScriptInfo(info).retainProjects) == null ? void 0 : _a.forEach( - (kind, p) => (retainProjects ?? (retainProjects = /* @__PURE__ */ new Map())).set(p, kind) - ); - } - ); - if (assignOrphanScriptInfosToInferredProject) { - this.assignOrphanScriptInfosToInferredProject(); - } - if (openScriptInfos) { - this.cleanupProjectsAndScriptInfos( - retainProjects, - new Set(openScriptInfos.map((info) => info.path)), - /*externalProjectsRetainingConfiguredProjects*/ - void 0 - ); - 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); - } - } - // eslint-disable-line @typescript-eslint/unified-signatures - closeExternalProject(uncheckedFileName, cleanupAfter) { - const fileName = toNormalizedPath(uncheckedFileName); - const projects = this.externalProjectToConfiguredProjectMap.get(fileName); - if (projects) { - this.externalProjectToConfiguredProjectMap.delete(fileName); - } else { - const externalProject = this.findExternalProjectByProjectName(uncheckedFileName); - if (externalProject) { - this.removeProject(externalProject); - } - } - if (cleanupAfter) { - this.cleanupConfiguredProjects(); - this.printProjects(); - } - } - openExternalProjects(projects) { - const projectsToClose = new Set(this.externalProjects.map((p) => p.getProjectName())); - this.externalProjectToConfiguredProjectMap.forEach((_, externalProjectName) => projectsToClose.add(externalProjectName)); - for (const externalProject of projects) { - this.openExternalProject( - externalProject, - /*cleanupAfter*/ - false - ); - projectsToClose.delete(externalProject.projectFileName); - } - projectsToClose.forEach((externalProjectName) => this.closeExternalProject( - externalProjectName, - /*cleanupAfter*/ - false - )); - this.cleanupConfiguredProjects(); - 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]); - } - } - // eslint-disable-line @typescript-eslint/unified-signatures - openExternalProject(proj, cleanupAfter) { - const existingExternalProject = this.findExternalProjectByProjectName(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.createConfiguredProject(normalized, `Creating configured project in external project: ${proj.projectFileName}`); - if (!this.getHostPreferences().lazyConfiguredProjectsFromExternalProject) project.updateGraph(); - } - (configuredProjects ?? (configuredProjects = /* @__PURE__ */ new Set())).add(project); - Debug.assert(!project.isClosed()); - } - } 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(); - } - } - if (cleanupAfter) { - this.cleanupConfiguredProjects( - configuredProjects, - /* @__PURE__ */ new Set([proj.projectFileName]) - ); - 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 || isExternalModuleNameRelative(pluginConfigEntry.name) || /[\\/]\.\.?(?:$|[\\/])/.test(pluginConfigEntry.name)) { - 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 = Project2.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, - Project2.importServicePluginSync( - pluginConfigEntry, - searchPaths, - this.host, - (s) => this.logger.info(s) - ) - ); - } - /** - * Performs the remaining steps of enabling a plugin after its module has been instantiated. - */ - 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); - let sendProjectsUpdatedInBackgroundEvent = false; - await Promise.all(map(pendingPlugins, async ([project, promises]) => { - const results = await Promise.all(promises); - if (project.isClosed() || isProjectDeferredClose(project)) { - this.logger.info(`Cancelling plugin enabling for ${project.getProjectName()} as it is ${project.isClosed() ? "closed" : "deferred close"}`); - return; - } - sendProjectsUpdatedInBackgroundEvent = true; - for (const result of results) { - this.endEnablePlugin(project, result); - } - this.delayUpdateProjectGraph(project); - })); - this.currentPluginEnablementPromise = void 0; - if (sendProjectsUpdatedInBackgroundEvent) this.sendProjectsUpdatedInBackgroundEvent(); - } - 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)) { - // Sync and check same directory again - case 3 /* Maybe */: - packageJsonCache.searchDirectoryAndAncestors(directory, project); - return processDirectory(directory); - // Check package.json - 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; - } - }; - forEachAncestorDirectoryStoppingAtGlobalCache( - project, - getDirectoryPath(fileName), - processDirectory - ); - return result; - } - /** @internal */ - getNearestAncestorDirectoryWithPackageJson(fileName, project) { - return forEachAncestorDirectoryStoppingAtGlobalCache( - project, - 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; - } - } - ); - } - 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 */: - 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); - } - 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; -var ProjectService2 = _ProjectService; -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 - ); -} - -// 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, kind, modulePaths, moduleSpecifiers) { - ensureCache(fromFileName, preferences, options).set(toFileName2, createInfo( - kind, - modulePaths, - moduleSpecifiers, - /*packageName*/ - void 0, - /*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( - /*kind*/ - void 0, - modulePaths, - /*moduleSpecifiers*/ - void 0, - /*packageName*/ - void 0, - /*isBlockedByPackageJsonDependencies*/ - void 0 - )); - } - }, - setBlockedByPackageJsonDependencies(fromFileName, toFileName2, preferences, options, packageName, isBlockedByPackageJsonDependencies) { - const cache2 = ensureCache(fromFileName, preferences, options); - const info = cache2.get(toFileName2); - if (info) { - info.isBlockedByPackageJsonDependencies = isBlockedByPackageJsonDependencies; - info.packageName = packageName; - } else { - cache2.set(toFileName2, createInfo( - /*kind*/ - void 0, - /*modulePaths*/ - void 0, - /*moduleSpecifiers*/ - void 0, - packageName, - 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(kind, modulePaths, moduleSpecifiers, packageName, isBlockedByPackageJsonDependencies) { - return { kind, modulePaths, moduleSpecifiers, packageName, isBlockedByPackageJsonDependencies }; - } -} - -// 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, project) => { - forEachAncestorDirectoryStoppingAtGlobalCache( - project, - 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 */; - } -} - -// src/server/session.ts -var nullCancellationToken = { - isCancellationRequested: () => false, - setRequest: () => void 0, - resetRequest: () => void 0 -}; -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); -} -var CommandNames = CommandTypes; -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}`; -} -var 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.performanceData); - this.requestId = void 0; - } - this.setTimerHandle(void 0); - this.setImmediateId(void 0); - this.performanceData = 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), this.performanceData); - }, 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), this.performanceData); - }, - 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}`); - } - } - this.performanceData = this.operationHost.getPerformanceData(); - 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; - } -}; -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, - getDefinitionLocation( - defaultProject, - initialLocation, - /*isForRename*/ - true - ), - mapDefinitionInProject, - (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, - getDefinitionLocation( - defaultProject, - initialLocation, - /*isForRename*/ - false - ), - mapDefinitionInProject, - (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, defaultDefinition, mapDefinitionInProject2, 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 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 = mapDefinitionInProject2(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 || !forPositionInResult) return projectResults; - 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 mapDefinitionInProjectIfFileInProject(definition, project) { - if (project.containsFile(toNormalizedPath(definition.fileName)) && !isLocationProjectReferenceRedirect(project, definition)) { - return definition; - } -} -function mapDefinitionInProject(definition, project, getGeneratedDefinition, getSourceDefinition) { - const result = mapDefinitionInProjectIfFileInProject(definition, project); - if (result) return result; - 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)); -} -var 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 */, - "getPasteEdits" /* GetPasteEdits */, - "copilotRelated" /* CopilotRelated */ -]; -var 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 */, - "preparePasteEdits" /* PreparePasteEdits */ -]; -var Session3 = class _Session { - constructor(opts) { - this.changeSeq = 0; - // Minimum number of lines for attempting to use region diagnostics for a file. - /** @internal */ - this.regionDiagLineCountThreshold = 500; - 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, - /*cleanupAfter*/ - 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, - /*cleanupAfter*/ - 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( - /*request*/ - void 0 - ); - }, - ["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(request); - }, - ["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( - /*request*/ - void 0 - ); - }, - ["geterrForProject" /* GeterrForProject */]: (request) => { - this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next, request.arguments.delay, request.arguments.file)); - return this.notRequired( - /*request*/ - void 0 - ); - }, - ["change" /* Change */]: (request) => { - this.change(request.arguments); - return this.notRequired(request); - }, - ["configure" /* Configure */]: (request) => { - this.projectService.setHostConfiguration(request.arguments); - return this.notRequired(request); - }, - ["reload" /* Reload */]: (request) => { - this.reload(request.arguments); - return this.requiredResponse({ reloadFinished: true }); - }, - ["saveto" /* Saveto */]: (request) => { - const savetoArgs = request.arguments; - this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); - return this.notRequired(request); - }, - ["close" /* Close */]: (request) => { - const closeArgs = request.arguments; - this.closeClientFile(closeArgs.file); - return this.notRequired(request); - }, - ["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 */]: (request) => { - this.projectService.reloadProjects(); - return this.notRequired(request); - }, - ["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)); - }, - ["preparePasteEdits" /* PreparePasteEdits */]: (request) => { - return this.requiredResponse(this.preparePasteEdits(request.arguments)); - }, - ["getPasteEdits" /* GetPasteEdits */]: (request) => { - return this.requiredResponse(this.getPasteEdits(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); - return this.notRequired(request); - }, - ["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)); - }, - ["mapCode" /* MapCode */]: (request) => { - return this.requiredResponse(this.mapCode(request.arguments)); - }, - ["copilotRelated" /* CopilotRelated */]: () => { - return this.requiredResponse(this.getCopilotRelatedInfo()); - } - })); - 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, performanceData) => this.executeWithRequestId(requestId, action, performanceData), - getCurrentRequestId: () => this.currentRequestId, - getPerformanceData: () => this.performanceData, - getServerHost: () => this.host, - logError: (err, cmd) => this.logError(err, cmd), - sendRequestCompletedEvent: (requestId, performanceData) => this.sendRequestCompletedEvent(requestId, performanceData), - 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 ProjectService2(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, performanceData) { - this.event( - { - request_seq: requestId, - performanceData: performanceData && toProtocolPerformanceData(performanceData) - }, - "requestCompleted" - ); - } - addPerformanceData(key, value) { - if (!this.performanceData) { - this.performanceData = {}; - } - this.performanceData[key] = (this.performanceData[key] ?? 0) + value; - } - addDiagnosticsPerformanceData(file, kind, duration) { - var _a, _b; - if (!this.performanceData) { - this.performanceData = {}; - } - let fileDiagnosticDuration = (_a = this.performanceData.diagnosticsDuration) == null ? void 0 : _a.get(file); - if (!fileDiagnosticDuration) ((_b = this.performanceData).diagnosticsDuration ?? (_b.diagnosticsDuration = /* @__PURE__ */ new Map())).set(file, fileDiagnosticDuration = {}); - fileDiagnosticDuration[kind] = duration; - } - 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) { - const msgText = formatMessage2(msg, this.logger, this.byteLength, this.host.newLine); - this.host.write(msgText); - } - event(body, eventName) { - this.send(toEvent(eventName, body)); - } - /** @internal */ - doOutput(info, cmdName, reqSeq, success, performanceData, message) { - const res = { - seq: 0, - type: "response", - command: cmdName, - request_seq: reqSeq, - success, - performanceData: performanceData && toProtocolPerformanceData(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; - const diagnosticsStartTime = timestamp(); - (_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", diagnosticsStartTime); - (_b = tracing) == null ? void 0 : _b.pop(); - } - syntacticCheck(file, project) { - var _a, _b; - const diagnosticsStartTime = timestamp(); - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "syntacticCheck", { file, configFilePath: project.canonicalConfigFilePath }); - this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag", diagnosticsStartTime); - (_b = tracing) == null ? void 0 : _b.pop(); - } - suggestionCheck(file, project) { - var _a, _b; - const diagnosticsStartTime = timestamp(); - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "suggestionCheck", { file, configFilePath: project.canonicalConfigFilePath }); - this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag", diagnosticsStartTime); - (_b = tracing) == null ? void 0 : _b.pop(); - } - regionSemanticCheck(file, project, ranges) { - var _a, _b, _c; - const diagnosticsStartTime = timestamp(); - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "regionSemanticCheck", { file, configFilePath: project.canonicalConfigFilePath }); - let diagnosticsResult; - if (!this.shouldDoRegionCheck(file) || !(diagnosticsResult = project.getLanguageService().getRegionSemanticDiagnostics(file, ranges))) { - (_b = tracing) == null ? void 0 : _b.pop(); - return; - } - this.sendDiagnosticsEvent(file, project, diagnosticsResult.diagnostics, "regionSemanticDiag", diagnosticsStartTime, diagnosticsResult.spans); - (_c = tracing) == null ? void 0 : _c.pop(); - return; - } - // We should only do the region-based semantic check if we think it would be - // considerably faster than a whole-file semantic check. - /** @internal */ - shouldDoRegionCheck(file) { - var _a; - const lineCount = (_a = this.projectService.getScriptInfoForNormalizedPath(file)) == null ? void 0 : _a.textStorage.getLineInfo().getLineCount(); - return !!(lineCount && lineCount >= this.regionDiagLineCountThreshold); - } - sendDiagnosticsEvent(file, project, diagnostics, kind, diagnosticsStartTime, spans) { - try { - const scriptInfo = Debug.checkDefined(project.getScriptInfo(file)); - const duration = timestamp() - diagnosticsStartTime; - const body = { - file, - diagnostics: diagnostics.map((diag2) => formatDiag(file, project, diag2)), - spans: spans == null ? void 0 : spans.map((span) => toProtocolTextSpan(span, scriptInfo)) - }; - this.event( - body, - kind - ); - this.addDiagnosticsPerformanceData(file, kind, duration); - } catch (err) { - this.logError(err, kind); - } - } - /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */ - updateErrorCheck(next, checkList, ms, requireOpen = true) { - if (checkList.length === 0) { - return; - } - Debug.assert(!this.suppressDiagnosticEvents); - const seq = this.changeSeq; - const followMs = Math.min(ms, 200); - let index = 0; - const goNext = () => { - index++; - if (checkList.length > index) { - return next.delay("checkOne", followMs, checkOne); - } - }; - const doSemanticCheck = (fileName, project) => { - this.semanticCheck(fileName, project); - if (this.changeSeq !== seq) { - return; - } - if (this.getPreferences(fileName).disableSuggestions) { - return goNext(); - } - next.immediate("suggestionCheck", () => { - this.suggestionCheck(fileName, project); - goNext(); - }); - }; - const checkOne = () => { - if (this.changeSeq !== seq) { - return; - } - let ranges; - let item = checkList[index]; - if (isString(item)) { - item = this.toPendingErrorCheck(item); - } else if ("ranges" in item) { - ranges = item.ranges; - item = this.toPendingErrorCheck(item.file); - } - if (!item) { - return goNext(); - } - 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 */) { - return goNext(); - } - if (ranges) { - return next.immediate("regionSemanticCheck", () => { - const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(fileName); - if (scriptInfo) { - this.regionSemanticCheck(fileName, project, ranges.map((range) => this.getRange({ file: fileName, ...range }, scriptInfo))); - } - if (this.changeSeq !== seq) { - return; - } - next.immediate("semanticCheck", () => doSemanticCheck(fileName, project)); - }); - } - next.immediate("semanticCheck", () => doSemanticCheck(fileName, project)); - }; - 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, - /*deferredDeleteOk*/ - false - ); - 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, 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, 277 /* 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 }; - } - }) - }; - }); - } - mapCode(args) { - var _a; - const formatOptions = this.getHostFormatOptions(); - const preferences = this.getHostPreferences(); - const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); - const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); - const focusLocations = (_a = args.mapping.focusLocations) == null ? void 0 : _a.map((spans) => { - return spans.map((loc) => { - const start = scriptInfo.lineOffsetToPosition(loc.start.line, loc.start.offset); - const end = scriptInfo.lineOffsetToPosition(loc.end.line, loc.end.offset); - return { - start, - length: end - start - }; - }); - }); - const changes = languageService.mapCode(file, args.mapping.contents, focusLocations, formatOptions, preferences); - return this.mapTextChangesToCodeEdits(changes); - } - getCopilotRelatedInfo() { - return { - relatedFiles: [] - }; - } - setCompilerOptionsForInferredProjects(args) { - this.projectService.setCompilerOptionsForInferredProjects(args.options, args.projectRootPath); - } - getProjectInfo(args) { - return this.getProjectInfoWorker( - args.file, - args.projectFileName, - args.needFileNameList, - args.needDefaultConfiguredProjectInfo, - /*excludeConfigFiles*/ - false - ); - } - getProjectInfoWorker(uncheckedFileName, projectFileName, needFileNameList, needDefaultConfiguredProjectInfo, 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, - configuredProjectInfo: needDefaultConfiguredProjectInfo ? this.getDefaultConfiguredProjectInfo(uncheckedFileName) : void 0 - }; - return projectInfo; - } - getDefaultConfiguredProjectInfo(uncheckedFileName) { - var _a; - const info = this.projectService.getScriptInfo(uncheckedFileName); - if (!info) return; - const result = this.projectService.findDefaultConfiguredProjectWorker( - info, - 3 /* CreateReplay */ - ); - if (!result) return void 0; - let notMatchedByConfig; - let notInProject; - result.seenProjects.forEach((kind, project) => { - if (project !== result.defaultProject) { - if (kind !== 3 /* CreateReplay */) { - (notMatchedByConfig ?? (notMatchedByConfig = [])).push(toNormalizedPath(project.getConfigFilePath())); - } else { - (notInProject ?? (notInProject = [])).push(toNormalizedPath(project.getConfigFilePath())); - } - } - }); - (_a = result.seenConfigs) == null ? void 0 : _a.forEach((config) => (notMatchedByConfig ?? (notMatchedByConfig = [])).push(config)); - return { - notMatchedByConfig, - notInProject, - defaultProject: result.defaultProject && toNormalizedPath(result.defaultProject.getConfigFilePath()) - }; - } - 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 = toNormalizedPath(args.file); - const preferences = this.getPreferences(fileName); - const initialLocation = { fileName, pos: 0 }; - const perProjectResults = getPerProjectReferences( - projects, - this.getDefaultProject(args), - initialLocation, - initialLocation, - mapDefinitionInProjectIfFileInProject, - (project) => { - this.logger.info(`Finding references to file ${fileName} in project ${project.getProjectName()}`); - return project.getLanguageService().getFileReferences(fileName); - } - ); - let references; - if (isArray(perProjectResults)) { - references = perProjectResults; - } else { - references = []; - const seen = createDocumentSpanSet(this.host.useCaseSensitiveFileNames); - perProjectResults.forEach((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 userPreferences = this.getPreferences(file); - const quickInfo = project.getLanguageService().getQuickInfoAtPosition( - file, - this.getPosition(args, scriptInfo), - userPreferences.maximumHoverLength, - args.verbosityLevel - ); - if (!quickInfo) { - return void 0; - } - const useDisplayParts = !!userPreferences.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), - canIncreaseVerbosityLevel: quickInfo.canIncreaseVerbosityLevel - }; - } 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 convertedSpan = entry.replacementSpan ? toProtocolTextSpan(entry.replacementSpan, scriptInfo) : void 0; - return { - ...entry, - replacementSpan: convertedSpan, - hasAction: entry.hasAction || void 0, - symbol: void 0 - }; - } - }); - 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: !!compilationSettings.outFile - }; - } - ); - } - 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, fileArgs) { - if (this.suppressDiagnosticEvents) { - return; - } - if (fileArgs.length > 0) { - this.updateErrorCheck(next, fileArgs, 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) { - 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++; - info.reloadFromFile(tempFileName); - } - } - 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); - const result = project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file), args.triggerReason, args.kind, args.includeInteractiveActions); - return result.map((result2) => ({ ...result2, actions: result2.actions.map((action) => ({ ...action, range: action.range ? { start: convertToLocation({ line: action.range.start.line, character: action.range.start.offset }), end: convertToLocation({ line: action.range.end.line, character: action.range.end.offset }) } : void 0 })) })); - } - 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)); - } - preparePasteEdits(args) { - const { file, project } = this.getFileAndProject(args); - return project.getLanguageService().preparePasteEditsForFile(file, args.copiedTextSpan.map((copies) => this.getRange({ file, startLine: copies.start.line, startOffset: copies.start.offset, endLine: copies.end.line, endOffset: copies.end.offset }, this.projectService.getScriptInfoForNormalizedPath(file)))); - } - getPasteEdits(args) { - const { file, project } = this.getFileAndProject(args); - if (isDynamicFileName(file)) return void 0; - const copiedFrom = args.copiedFrom ? { file: args.copiedFrom.file, range: args.copiedFrom.spans.map((copies) => this.getRange({ file: args.copiedFrom.file, startLine: copies.start.line, startOffset: copies.start.offset, endLine: copies.end.line, endOffset: copies.end.offset }, project.getScriptInfoForNormalizedPath(toNormalizedPath(args.copiedFrom.file)))) } : void 0; - const result = project.getLanguageService().getPasteEdits( - { - targetFile: file, - pastedText: args.pastedText, - pasteLocations: args.pasteLocations.map((paste) => this.getRange({ file, startLine: paste.start.line, startOffset: paste.start.offset, endLine: paste.end.line, endOffset: paste.end.offset }, project.getScriptInfoForNormalizedPath(file))), - copiedFrom, - preferences: this.getPreferences(file) - }, - this.getFormatOptions(file) - ); - return result && this.mapPasteEditsAction(result); - } - 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 error2 = e instanceof Error ? e : new Error(e); - const ls = project.getLanguageService(); - const existingDiagCodes = [ - ...ls.getSyntacticDiagnostics(file), - ...ls.getSemanticDiagnostics(file), - ...ls.getSuggestionDiagnostics(file) - ].filter((d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length)).map((d) => d.code); - const badCode = args.errorCodes.find((c) => !existingDiagCodes.includes(c)); - if (badCode !== void 0) { - error2.message += ` -Additional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`; - } - throw error2; - } - return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions; - } - getCombinedCodeFix({ scope, fixId: fixId56 }, simplifiedResult) { - Debug.assert(scope.type === "file"); - const { file, project } = this.getFileAndProject(scope.args); - const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId56, 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: fixId56, fixAllDescription }) { - return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId56, fixAllDescription }; - } - mapPasteEditsAction({ edits, fixId: fixId56 }) { - return { edits: this.mapTextChangesToCodeEdits(edits), fixId: fixId56 }; - } - 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, - /*needDefaultConfiguredProjectInfo*/ - void 0, - /*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(request) { - if (request) this.doOutput( - /*info*/ - void 0, - request.command, - request.seq, - /*success*/ - true, - this.performanceData - ); - return { responseRequired: false, performanceData: this.performanceData }; - } - requiredResponse(response) { - return { response, responseRequired: true, performanceData: this.performanceData }; - } - 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); - } - // eslint-disable-line @typescript-eslint/unified-signatures - executeWithRequestId(requestId, f, perfomanceData) { - const currentPerformanceData = this.performanceData; - try { - this.performanceData = perfomanceData; - this.setCurrentRequest(requestId); - return f(); - } finally { - this.resetCurrentRequest(requestId); - this.performanceData = currentPerformanceData; - } - } - executeCommand(request) { - const handler = this.handlers.get(request.command); - if (handler) { - const response = this.executeWithRequestId( - request.seq, - () => handler(request), - /*perfomanceData*/ - void 0 - ); - 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, - /*performanceData*/ - void 0, - `Unrecognized JSON command: ${request.command}` - ); - return { responseRequired: false }; - } - } - onMessage(message) { - var _a, _b, _c, _d, _e, _f, _g; - this.gcTimer.scheduleCollect(); - let start; - const currentPerformanceData = this.performanceData; - 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 = tracing) == null ? void 0 : _b.push( - tracing.Phase.Session, - "executeCommand", - { seq: request.seq, command: request.command }, - /*separateBeginAndEnd*/ - true - ); - const { response, responseRequired, performanceData } = this.executeCommand(request); - (_c = tracing) == null ? void 0 : _c.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}`); - } - } - (_d = tracing) == null ? void 0 : _d.instant(tracing.Phase.Session, "response", { seq: request.seq, command: request.command, success: !!response }); - if (response) { - this.doOutput( - response, - request.command, - request.seq, - /*success*/ - true, - performanceData - ); - } else if (responseRequired) { - this.doOutput( - /*info*/ - void 0, - request.command, - request.seq, - /*success*/ - false, - performanceData, - "No content available." - ); - } - } catch (err) { - (_e = tracing) == null ? void 0 : _e.popAll(); - if (err instanceof OperationCanceledException) { - (_f = tracing) == null ? void 0 : _f.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, - this.performanceData - ); - return; - } - this.logErrorWorker(err, this.toStringMessage(message), relevantFile); - (_g = tracing) == null ? void 0 : _g.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, - this.performanceData, - "Error processing request. " + err.message + "\n" + err.stack - ); - } finally { - this.performanceData = currentPerformanceData; - } - } - 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(); - } -}; -function toProtocolPerformanceData(performanceData) { - const diagnosticsDuration = performanceData.diagnosticsDuration && arrayFrom(performanceData.diagnosticsDuration, ([file, data]) => ({ ...data, file })); - return { ...performanceData, diagnosticsDuration }; -} -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")); -} - -// src/server/scriptVersionCache.ts -var lineCollectionCapacity = 4; -var 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 || {}); -var 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); - } - } -}; -var 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); - } -}; -var _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; -var ScriptVersionCache = _ScriptVersionCache; -var 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); - } - } - } -}; -var 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 }; - } -}; -var 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) { - if (this.children.length === 0) return; - 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; - } -}; -var 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 = 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; -var TypingsInstallerAdapter = _TypingsInstallerAdapter; - -// 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, - ConfiguredProjectLoadKind: () => ConfiguredProjectLoadKind, - CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent, - CreateFileWatcherEvent: () => CreateFileWatcherEvent, - Errors: () => Errors, - EventBeginInstallTypes: () => EventBeginInstallTypes, - EventEndInstallTypes: () => EventEndInstallTypes, - EventInitializationFailed: () => EventInitializationFailed, - EventTypesRegistry: () => EventTypesRegistry, - ExternalProject: () => ExternalProject, - GcTimer: () => GcTimer, - InferredProject: () => InferredProject2, - LargeFileReferencedEvent: () => LargeFileReferencedEvent, - LineIndex: () => LineIndex, - LineLeaf: () => LineLeaf, - LineNode: () => LineNode, - LogLevel: () => LogLevel2, - Msg: () => Msg, - OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, - Project: () => Project2, - ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, - ProjectKind: () => ProjectKind, - ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, - ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, - ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, - ProjectService: () => ProjectService2, - ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, - ScriptInfo: () => ScriptInfo, - ScriptVersionCache: () => ScriptVersionCache, - Session: () => Session3, - TextStorage: () => TextStorage, - ThrottledOperations: () => ThrottledOperations, - 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, - formatDiagnosticToProtocol: () => formatDiagnosticToProtocol, - formatMessage: () => formatMessage2, - getBaseConfigFileName: () => getBaseConfigFileName, - getDetailWatchInfo: () => getDetailWatchInfo, - getLocationInNewDocument: () => getLocationInNewDocument, - hasArgument: () => hasArgument, - hasNoTypeScriptSource: () => hasNoTypeScriptSource, - indent: () => indent2, - isBackgroundProject: () => isBackgroundProject, - isConfigFile: () => isConfigFile, - isConfiguredProject: () => isConfiguredProject, - isDynamicFileName: () => isDynamicFileName, - isExternalProject: () => isExternalProject, - isInferredProject: () => isInferredProject, - isInferredProjectName: () => isInferredProjectName, - isProjectDeferredClose: () => isProjectDeferredClose, - makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, - makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, - makeInferredProjectName: () => makeInferredProjectName, - maxFileSize: () => maxFileSize, - maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, - normalizedPathToPath: () => normalizedPathToPath, - nowString: () => nowString, - nullCancellationToken: () => nullCancellationToken, - nullTypingsInstaller: () => nullTypingsInstaller, - protocol: () => ts_server_protocol_exports, - scriptInfoIsContainedByBackgroundProject: () => scriptInfoIsContainedByBackgroundProject, - scriptInfoIsContainedByDeferredClosedProject: () => scriptInfoIsContainedByDeferredClosedProject, - stringifyIndented: () => stringifyIndented, - toEvent: () => toEvent, - toNormalizedPath: () => toNormalizedPath, - tryConvertScriptKindName: () => tryConvertScriptKindName, - typingsInstaller: () => ts_server_typingsInstaller_exports, - updateProjectIfDirty: () => updateProjectIfDirty -}); - -// src/typescript/typescript.ts -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); - } - } - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (0); -})({ get exports() { return ts; }, set exports(v) { ts = v; if ( true && module.exports) { module.exports = v; } } }) -//# sourceMappingURL=typescript.js.map - - -/***/ }), - -/***/ "?07ec": -/*!****************************!*\ - !*** perf_hooks (ignored) ***! - \****************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?2e60": -/*!********************!*\ - !*** fs (ignored) ***! - \********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?3711": -/*!**********************!*\ - !*** path (ignored) ***! - \**********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?5d40": -/*!************************************!*\ - !*** source-map-support (ignored) ***! - \************************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?c37c": -/*!********************!*\ - !*** os (ignored) ***! - \********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?d829": -/*!************************!*\ - !*** crypto (ignored) ***! - \************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?e316": -/*!***************************!*\ - !*** inspector (ignored) ***! - \***************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. -(() => { -"use strict"; -/*!****************************!*\ - !*** ./src/typescript.mjs ***! - \****************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ runTest: () => (/* binding */ runTest) -/* harmony export */ }); -/* harmony import */ var typescript__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! typescript */ "./node_modules/typescript/lib/typescript.js"); -// Copyright 2017 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - -const payloads = [ - { - // Compile typescript-angular.ts to ES3 (default) - name: "todomvc/typescript-angular.ts", - transpileOptions: { - compilerOptions: { - module: typescript__WEBPACK_IMPORTED_MODULE_0__.ModuleKind.CommonJS, - target: typescript__WEBPACK_IMPORTED_MODULE_0__.ScriptTarget.ES3, - }, - }, - }, - { - // Compile typescript-angular.ts to ESNext (latest) - name: "todomvc/typescript-angular.ts", - transpileOptions: { - compilerOptions: { - module: typescript__WEBPACK_IMPORTED_MODULE_0__.ModuleKind.CommonJS, - target: typescript__WEBPACK_IMPORTED_MODULE_0__.ScriptTarget.ESNext, - }, - }, - }, -]; - -function runTest(fileData) { - const testData = payloads.map(({ name, transpileOptions }) => ({ - input: fileData[name], - transpileOptions, - })); - - return testData.map(({ input, transpileOptions }) => - typescript__WEBPACK_IMPORTED_MODULE_0__.transpileModule(input, transpileOptions) - ); -} - -})(); - -self.WTBenchmark = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/web-tooling-benchmark/dist/typescript.bundle.min.js b/web-tooling-benchmark/dist/typescript.bundle.min.js new file mode 100644 index 00000000..24d35f9c --- /dev/null +++ b/web-tooling-benchmark/dist/typescript.bundle.min.js @@ -0,0 +1,6 @@ +(()=>{var e={6732:()=>{},18641:()=>{},58843:(e,t,n)=>{var r="/index.js",i=n(65606),o={};(e=>{"use strict";var t=Object.defineProperty,o=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.prototype.hasOwnProperty,(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})}),a={};o(a,{ANONYMOUS:()=>FZ,AccessFlags:()=>Yr,AssertionLevel:()=>gt,AssignmentDeclarationKind:()=>ci,AssignmentKind:()=>Yg,Associativity:()=>oy,BreakpointResolver:()=>b7,BuilderFileEmit:()=>lW,BuilderProgramKind:()=>RW,BuilderState:()=>sW,CallHierarchy:()=>k7,CharacterCodes:()=>Ti,CheckFlags:()=>Wr,CheckMode:()=>iJ,ClassificationType:()=>nX,ClassificationTypeNames:()=>tX,CommentDirectiveType:()=>wr,Comparison:()=>l,CompletionInfoFlags:()=>KG,CompletionTriggerKind:()=>JG,Completions:()=>Oae,ContainerFlags:()=>rB,ContextFlags:()=>jr,Debug:()=>pn,DiagnosticCategory:()=>li,Diagnostics:()=>fa,DocumentHighlights:()=>L0,ElementFlags:()=>Qr,EmitFlags:()=>Di,EmitHint:()=>Ai,EmitOnly:()=>Er,EndOfLineState:()=>QG,ExitStatus:()=>Ar,ExportKind:()=>x0,Extension:()=>Ci,ExternalEmitHelpers:()=>Pi,FileIncludeKind:()=>Dr,FilePreprocessingDiagnosticsKind:()=>Fr,FileSystemEntryKind:()=>ao,FileWatcherEventKind:()=>zi,FindAllReferences:()=>jce,FlattenLevel:()=>Lz,FlowFlags:()=>Cr,ForegroundColorEscapeSequences:()=>sV,FunctionFlags:()=>Mh,GeneratedIdentifierFlags:()=>kr,GetLiteralTextFlags:()=>ap,GoToDefinition:()=>Sle,HighlightSpanKind:()=>qG,IdentifierNameMap:()=>_z,ImportKind:()=>b0,ImportsNotUsedAsValues:()=>yi,IndentStyle:()=>UG,IndexFlags:()=>Zr,IndexKind:()=>ri,InferenceFlags:()=>ai,InferencePriority:()=>oi,InlayHintKind:()=>zG,InlayHints:()=>zle,InternalEmitFlags:()=>Fi,InternalNodeBuilderFlags:()=>Rr,InternalSymbolName:()=>$r,IntersectionFlags:()=>Lr,InvalidatedProjectKind:()=>PH,JSDocParsingMode:()=>Ri,JsDoc:()=>$le,JsTyping:()=>oG,JsxEmit:()=>hi,JsxFlags:()=>vr,JsxReferenceKind:()=>ei,LanguageFeatureMinimumTarget:()=>Ei,LanguageServiceMode:()=>jG,LanguageVariant:()=>ki,LexicalEnvironmentFlags:()=>Oi,ListFormat:()=>Li,LogLevel:()=>fn,MapCode:()=>d_e,MemberOverrideStatus:()=>Ir,ModifierFlags:()=>yr,ModuleDetectionKind:()=>di,ModuleInstanceState:()=>ZR,ModuleKind:()=>gi,ModuleResolutionKind:()=>ui,ModuleSpecifierEnding:()=>qS,NavigateTo:()=>s2,NavigationBar:()=>y2,NewLineKind:()=>vi,NodeBuilderFlags:()=>Mr,NodeCheckFlags:()=>Hr,NodeFactoryFlags:()=>aw,NodeFlags:()=>hr,NodeResolutionFeatures:()=>XM,ObjectFlags:()=>Gr,OperationCanceledException:()=>Nr,OperatorPrecedence:()=>_y,OrganizeImports:()=>y_e,OrganizeImportsMode:()=>BG,OuterExpressionKinds:()=>Ii,OutliningElementsCollector:()=>X_e,OutliningSpanKind:()=>GG,OutputFileType:()=>XG,PackageJsonAutoImportPreference:()=>LG,PackageJsonDependencyGroup:()=>OG,PatternMatchKind:()=>c1,PollingInterval:()=>qi,PollingWatchKind:()=>mi,PragmaKindFlags:()=>ji,PredicateSemantics:()=>xr,PreparePasteEdits:()=>Ife,PrivateIdentifierKind:()=>lN,ProcessLevel:()=>nq,ProgramUpdateLevel:()=>RU,QuotePreference:()=>mY,RegularExpressionFlags:()=>Sr,RelationComparisonResult:()=>br,Rename:()=>oue,ScriptElementKind:()=>ZG,ScriptElementKindModifier:()=>eX,ScriptKind:()=>bi,ScriptSnapshot:()=>NG,ScriptTarget:()=>xi,SemanticClassificationFormat:()=>RG,SemanticMeaning:()=>iX,SemicolonPreference:()=>VG,SignatureCheckMode:()=>oJ,SignatureFlags:()=>ni,SignatureHelp:()=>due,SignatureInfo:()=>cW,SignatureKind:()=>ti,SmartSelectionRange:()=>Rue,SnippetKind:()=>Ni,StatisticType:()=>hK,StructureIsReused:()=>Pr,SymbolAccessibility:()=>zr,SymbolDisplay:()=>Gue,SymbolDisplayPartKind:()=>HG,SymbolFlags:()=>Vr,SymbolFormatFlags:()=>Jr,SyntaxKind:()=>gr,Ternary:()=>si,ThrottledCancellationToken:()=>u7,TokenClass:()=>YG,TokenFlags:()=>Tr,TransformFlags:()=>wi,TypeFacts:()=>nJ,TypeFlags:()=>Kr,TypeFormatFlags:()=>Br,TypeMapKind:()=>ii,TypePredicateKind:()=>qr,TypeReferenceSerializationKind:()=>Ur,UnionReduction:()=>Or,UpToDateStatusType:()=>rH,VarianceFlags:()=>Xr,Version:()=>kn,VersionRange:()=>Tn,WatchDirectoryFlags:()=>Si,WatchDirectoryKind:()=>fi,WatchFileKind:()=>pi,WatchLogLevel:()=>$U,WatchType:()=>z$,accessPrivateIdentifier:()=>Pz,addEmitFlags:()=>Nw,addEmitHelper:()=>Hw,addEmitHelpers:()=>Kw,addInternalEmitFlags:()=>Fw,addNodeFactoryPatcher:()=>cw,addObjectAllocatorPatcher:()=>Vx,addRange:()=>le,addRelatedInfo:()=>uT,addSyntheticLeadingComment:()=>Jw,addSyntheticTrailingComment:()=>Uw,addToSeen:()=>Cx,advancedAsyncSuperHelper:()=>VN,affectsDeclarationPathOptionDeclarations:()=>VO,affectsEmitOptionDeclarations:()=>UO,allKeysStartWithDot:()=>NR,altDirectorySeparator:()=>mo,and:()=>tn,append:()=>ae,appendIfUnique:()=>ue,arrayFrom:()=>je,arrayIsEqualTo:()=>re,arrayIsHomogeneous:()=>NT,arrayOf:()=>Le,arrayReverseIterator:()=>pe,arrayToMap:()=>Be,arrayToMultiMap:()=>ze,arrayToNumericMap:()=>Je,assertType:()=>on,assign:()=>Me,asyncSuperHelper:()=>UN,attachFileToDiagnostics:()=>Zx,base64decode:()=>Fb,base64encode:()=>Db,binarySearch:()=>we,binarySearchKey:()=>Ne,bindSourceFile:()=>aB,breakIntoCharacterSpans:()=>C1,breakIntoWordSpans:()=>w1,buildLinkParts:()=>ZY,buildOpts:()=>tL,buildOverload:()=>Wfe,bundlerModuleNameResolver:()=>YM,canBeConvertedToAsync:()=>X1,canHaveDecorators:()=>PI,canHaveExportModifier:()=>XT,canHaveFlowNode:()=>Rg,canHaveIllegalDecorators:()=>QA,canHaveIllegalModifiers:()=>YA,canHaveIllegalType:()=>GA,canHaveIllegalTypeParameters:()=>XA,canHaveJSDoc:()=>Bg,canHaveLocals:()=>uu,canHaveModifiers:()=>EI,canHaveModuleSpecifier:()=>xg,canHaveSymbol:()=>_u,canIncludeBindAndCheckDiagnostics:()=>yT,canJsonReportNoInputFiles:()=>Tj,canProduceDiagnostics:()=>jq,canUsePropertyAccess:()=>YT,canWatchAffectingLocation:()=>s$,canWatchAtTypes:()=>i$,canWatchDirectoryOrFile:()=>n$,canWatchDirectoryOrFilePath:()=>r$,cartesianProduct:()=>cn,cast:()=>it,chainBundle:()=>rz,chainDiagnosticMessages:()=>ik,changeAnyExtension:()=>Qo,changeCompilerHostLikeToUseCache:()=>rV,changeExtension:()=>QS,changeFullExtension:()=>Yo,changesAffectModuleResolution:()=>rd,changesAffectingProgramStructure:()=>id,characterCodeToRegularExpressionFlag:()=>Ma,childIsDecorated:()=>vm,classElementOrClassElementParameterIsDecorated:()=>xm,classHasClassThisAssignment:()=>$z,classHasDeclaredOrExplicitlyAssignedName:()=>Yz,classHasExplicitlyAssignedName:()=>Qz,classOrConstructorParameterIsDecorated:()=>bm,classicNameResolver:()=>$R,classifier:()=>z7,cleanExtendedConfigCache:()=>zU,clear:()=>E,clearMap:()=>gx,clearSharedExtendedConfigFileWatcher:()=>JU,climbPastPropertyAccess:()=>yX,clone:()=>Ve,cloneCompilerOptions:()=>BQ,closeFileWatcher:()=>sx,closeFileWatcherOf:()=>GU,codefix:()=>U7,collapseTextChangeRangesAcrossMultipleVersions:()=>tc,collectExternalModuleInfo:()=>sz,combine:()=>se,combinePaths:()=>Jo,commandLineOptionOfCustomType:()=>QO,commentPragmas:()=>Mi,commonOptionsWithBuild:()=>MO,compact:()=>ie,compareBooleans:()=>jt,compareDataObjects:()=>mx,compareDiagnostics:()=>sk,compareEmitHelpers:()=>uN,compareNumberOfDirectorySeparators:()=>$S,comparePaths:()=>ra,comparePathsCaseInsensitive:()=>na,comparePathsCaseSensitive:()=>ta,comparePatternKeys:()=>FR,compareProperties:()=>Lt,compareStringsCaseInsensitive:()=>Ct,compareStringsCaseInsensitiveEslintCompatible:()=>wt,compareStringsCaseSensitive:()=>Nt,compareStringsCaseSensitiveUI:()=>Ot,compareTextSpans:()=>kt,compareValues:()=>xt,compilerOptionsAffectDeclarationPath:()=>Xk,compilerOptionsAffectEmit:()=>Gk,compilerOptionsAffectSemanticDiagnostics:()=>Kk,compilerOptionsDidYouMeanDiagnostics:()=>gL,compilerOptionsIndicateEsModules:()=>lY,computeCommonSourceDirectoryOfFilenames:()=>YU,computeLineAndCharacterOfPosition:()=>qa,computeLineOfPosition:()=>Ua,computeLineStarts:()=>Ra,computePositionOfLineAndCharacter:()=>Ja,computeSignatureWithDiagnostics:()=>zW,computeSuggestionDiagnostics:()=>J1,computedOptions:()=>xk,concatenate:()=>G,concatenateDiagnosticMessageChains:()=>ok,consumesNodeCoreModules:()=>KZ,contains:()=>C,containsIgnoredPath:()=>RT,containsObjectRestOrSpread:()=>DI,containsParseError:()=>kd,containsPath:()=>ia,convertCompilerOptionsForTelemetry:()=>nM,convertCompilerOptionsFromJson:()=>Fj,convertJsonOption:()=>Mj,convertToBase64:()=>Nb,convertToJson:()=>HL,convertToObject:()=>$L,convertToOptionsWithAbsolutePaths:()=>oj,convertToRelativePath:()=>ca,convertToTSConfig:()=>XL,convertTypeAcquisitionFromJson:()=>Ej,copyComments:()=>fZ,copyEntries:()=>ld,copyLeadingComments:()=>hZ,copyProperties:()=>$e,copyTrailingAsLeadingComments:()=>vZ,copyTrailingComments:()=>yZ,couldStartTrivia:()=>es,countWhere:()=>N,createAbstractBuilder:()=>ZW,createAccessorPropertyBackingField:()=>kI,createAccessorPropertyGetRedirector:()=>SI,createAccessorPropertySetRedirector:()=>TI,createBaseNodeFactory:()=>ZC,createBinaryExpressionTrampoline:()=>mI,createBuilderProgram:()=>qW,createBuilderProgramUsingIncrementalBuildInfo:()=>HW,createBuilderStatusReporter:()=>_H,createCacheableExportInfoMap:()=>k0,createCachedDirectoryStructureHost:()=>MU,createClassifier:()=>O0,createCommentDirectivesMap:()=>Vd,createCompilerDiagnostic:()=>nk,createCompilerDiagnosticForInvalidCustomType:()=>sL,createCompilerDiagnosticFromMessageChain:()=>rk,createCompilerHost:()=>ZU,createCompilerHostFromProgramHost:()=>U$,createCompilerHostWorker:()=>nV,createDetachedDiagnostic:()=>Xx,createDiagnosticCollection:()=>fy,createDiagnosticForFileFromMessageChain:()=>Gp,createDiagnosticForNode:()=>qp,createDiagnosticForNodeArray:()=>Up,createDiagnosticForNodeArrayFromMessageChain:()=>$p,createDiagnosticForNodeFromMessageChain:()=>Wp,createDiagnosticForNodeInSourceFile:()=>Vp,createDiagnosticForRange:()=>Qp,createDiagnosticMessageChainFromDiagnostic:()=>Xp,createDiagnosticReporter:()=>y$,createDocumentPositionMapper:()=>YJ,createDocumentRegistry:()=>X0,createDocumentRegistryInternal:()=>Q0,createEmitAndSemanticDiagnosticsBuilderProgram:()=>YW,createEmitHelperFactory:()=>_N,createEmptyExports:()=>lA,createEvaluator:()=>xC,createExpressionForJsxElement:()=>fA,createExpressionForJsxFragment:()=>mA,createExpressionForObjectLiteralElementLike:()=>vA,createExpressionForPropertyName:()=>yA,createExpressionFromEntityName:()=>hA,createExternalHelpersImportDeclarationIfNeeded:()=>MA,createFileDiagnostic:()=>ek,createFileDiagnosticFromMessageChain:()=>Kp,createFlowNode:()=>iB,createForOfBindingStatement:()=>gA,createFutureSourceFile:()=>v0,createGetCanonicalFileName:()=>Ht,createGetIsolatedDeclarationErrors:()=>Bq,createGetSourceFile:()=>eV,createGetSymbolAccessibilityDiagnosticForNode:()=>Rq,createGetSymbolAccessibilityDiagnosticForNodeName:()=>Mq,createGetSymbolWalker:()=>dB,createIncrementalCompilerHost:()=>Z$,createIncrementalProgram:()=>eH,createJsxFactoryExpression:()=>pA,createLanguageService:()=>f7,createLanguageServiceSourceFile:()=>s7,createMemberAccessForPropertyName:()=>_A,createModeAwareCache:()=>MM,createModeAwareCacheKey:()=>jM,createModeMismatchDetails:()=>hd,createModuleNotFoundChain:()=>gd,createModuleResolutionCache:()=>qM,createModuleResolutionLoader:()=>EV,createModuleResolutionLoaderUsingGlobalCache:()=>f$,createModuleSpecifierResolutionHost:()=>_Y,createMultiMap:()=>Ke,createNameResolver:()=>TC,createNodeConverters:()=>nw,createNodeFactory:()=>lw,createOptionNameMap:()=>rL,createOverload:()=>Vfe,createPackageJsonImportFilter:()=>HZ,createPackageJsonInfo:()=>$Z,createParenthesizerRules:()=>ew,createPatternMatcher:()=>_1,createPrinter:()=>IU,createPrinterWithDefaults:()=>FU,createPrinterWithRemoveComments:()=>EU,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>PU,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>AU,createProgram:()=>$V,createProgramDiagnostics:()=>oW,createProgramHost:()=>$$,createPropertyNameNodeForIdentifierOrLiteral:()=>$T,createQueue:()=>Qe,createRange:()=>Mb,createRedirectedBuilderProgram:()=>XW,createResolutionCache:()=>m$,createRuntimeTypeSerializer:()=>_q,createScanner:()=>bs,createSemanticDiagnosticsBuilderProgram:()=>QW,createSet:()=>Ye,createSolutionBuilder:()=>fH,createSolutionBuilderHost:()=>dH,createSolutionBuilderWithWatch:()=>mH,createSolutionBuilderWithWatchHost:()=>pH,createSortedArray:()=>ee,createSourceFile:()=>cO,createSourceMapGenerator:()=>IJ,createSourceMapSource:()=>xw,createSuperAccessVariableStatement:()=>fq,createSymbolTable:()=>Zu,createSymlinkCache:()=>nS,createSyntacticTypeNodeBuilder:()=>iG,createSystemWatchFunctions:()=>lo,createTextChange:()=>QQ,createTextChangeFromStartLength:()=>XQ,createTextChangeRange:()=>Zs,createTextRangeFromNode:()=>HQ,createTextRangeFromSpan:()=>GQ,createTextSpan:()=>Gs,createTextSpanFromBounds:()=>Xs,createTextSpanFromNode:()=>WQ,createTextSpanFromRange:()=>KQ,createTextSpanFromStringLiteralLikeContent:()=>$Q,createTextWriter:()=>Ry,createTokenRange:()=>qb,createTypeChecker:()=>pJ,createTypeReferenceDirectiveResolutionCache:()=>UM,createTypeReferenceResolutionLoader:()=>IV,createWatchCompilerHost:()=>tH,createWatchCompilerHostOfConfigFile:()=>G$,createWatchCompilerHostOfFilesAndCompilerOptions:()=>X$,createWatchFactory:()=>q$,createWatchHost:()=>J$,createWatchProgram:()=>nH,createWatchStatusReporter:()=>k$,createWriteFileMeasuringIO:()=>tV,declarationNameToString:()=>jp,decodeMappings:()=>zJ,decodedTextSpanIntersectsWith:()=>Vs,deduplicate:()=>Z,defaultHoverMaximumTruncationLength:()=>Xu,defaultInitCompilerOptions:()=>aL,defaultMaximumTruncationLength:()=>Ku,diagnosticCategoryName:()=>_i,diagnosticToString:()=>d0,diagnosticsEqualityComparer:()=>uk,directoryProbablyExists:()=>Ib,directorySeparator:()=>fo,displayPart:()=>JY,displayPartsToString:()=>n7,disposeEmitNodes:()=>Tw,documentSpansEqual:()=>EY,dumpTracingLegend:()=>mr,elementAt:()=>me,elideNodes:()=>hI,emitDetachedComments:()=>Cv,emitFiles:()=>CU,emitFilesAndReportErrors:()=>j$,emitFilesAndReportErrorsAndGetExitStatus:()=>M$,emitModuleKindIsNonNodeESM:()=>Bk,emitNewLineBeforeLeadingCommentOfPosition:()=>Tv,emitResolverSkipsTypeChecking:()=>TU,emitSkippedWithNoDiagnostics:()=>QV,emptyArray:()=>_,emptyFileSystemEntries:()=>cT,emptyMap:()=>u,emptyOptions:()=>MG,endsWith:()=>Bt,ensurePathIsNonModuleName:()=>Xo,ensureScriptKind:()=>CS,ensureTrailingDirectorySeparator:()=>Go,entityNameToString:()=>zp,enumerateInsertsAndDeletes:()=>sn,equalOwnProperties:()=>Re,equateStringsCaseInsensitive:()=>yt,equateStringsCaseSensitive:()=>vt,equateValues:()=>ht,escapeJsxAttributeString:()=>Ay,escapeLeadingUnderscores:()=>yc,escapeNonAsciiString:()=>Ny,escapeSnippetText:()=>VT,escapeString:()=>Cy,escapeTemplateSubstitution:()=>gy,evaluatorResult:()=>bC,every:()=>b,exclusivelyPrefixedNodeCoreModules:()=>PC,executeCommandLine:()=>OK,expandPreOrPostfixIncrementOrDecrementExpression:()=>bA,explainFiles:()=>E$,explainIfFileIsRedirectAndImpliedFormat:()=>P$,exportAssignmentIsAlias:()=>vh,expressionResultIsUnused:()=>MT,extend:()=>We,extensionFromPath:()=>iT,extensionIsTS:()=>nT,extensionsNotSupportingExtensionlessResolution:()=>jS,externalHelpersModuleNameText:()=>Hu,factory:()=>bw,fileExtensionIs:()=>wo,fileExtensionIsOneOf:()=>No,fileIncludeReasonToDiagnostics:()=>O$,fileShouldUseJavaScriptRequire:()=>h0,filter:()=>D,filterMutate:()=>F,filterSemanticDiagnostics:()=>ZV,find:()=>x,findAncestor:()=>mc,findBestPatternMatch:()=>Xt,findChildOfKind:()=>GX,findComputedPropertyNameCacheAssignment:()=>CI,findConfigFile:()=>XU,findConstructorDeclaration:()=>SC,findContainingList:()=>XX,findDiagnosticForNode:()=>QZ,findFirstNonJsxWhitespaceToken:()=>uQ,findIndex:()=>S,findLast:()=>k,findLastIndex:()=>T,findListItemInfo:()=>HX,findModifier:()=>wY,findNextToken:()=>pQ,findPackageJson:()=>WZ,findPackageJsons:()=>VZ,findPrecedingMatchingToken:()=>TQ,findPrecedingToken:()=>fQ,findSuperStatementIndexPath:()=>yz,findTokenOnLeftOfPosition:()=>dQ,findUseStrictPrologue:()=>CA,first:()=>ye,firstDefined:()=>m,firstDefinedIterator:()=>g,firstIterator:()=>ve,firstOrOnly:()=>n0,firstOrUndefined:()=>ge,firstOrUndefinedIterator:()=>he,fixupCompilerOptions:()=>a2,flatMap:()=>L,flatMapIterator:()=>M,flatMapToMutable:()=>j,flatten:()=>O,flattenCommaList:()=>NI,flattenDestructuringAssignment:()=>jz,flattenDestructuringBinding:()=>Bz,flattenDiagnosticMessageText:()=>vV,forEach:()=>p,forEachAncestor:()=>ad,forEachAncestorDirectory:()=>ua,forEachAncestorDirectoryStoppingAtGlobalCache:()=>LR,forEachChild:()=>iO,forEachChildRecursively:()=>oO,forEachDynamicImportOrRequireCall:()=>IC,forEachEmittedFile:()=>oU,forEachEnclosingBlockScopeContainer:()=>Lp,forEachEntry:()=>sd,forEachExternalModuleToImportFrom:()=>C0,forEachImportClauseDeclaration:()=>Fg,forEachKey:()=>cd,forEachLeadingCommentRange:()=>ls,forEachNameInAccessChainWalkingLeft:()=>Ax,forEachNameOfDefaultExport:()=>I0,forEachOptionsSyntaxByName:()=>qC,forEachProjectReference:()=>BC,forEachPropertyAssignment:()=>Kf,forEachResolvedProjectReference:()=>RC,forEachReturnStatement:()=>Af,forEachRight:()=>f,forEachTrailingCommentRange:()=>_s,forEachTsConfigPropArray:()=>Qf,forEachUnique:()=>AY,forEachYieldExpression:()=>If,formatColorAndReset:()=>mV,formatDiagnostic:()=>aV,formatDiagnostics:()=>oV,formatDiagnosticsWithColorAndContext:()=>yV,formatGeneratedName:()=>xI,formatGeneratedNamePart:()=>vI,formatLocation:()=>hV,formatMessage:()=>tk,formatStringFromArgs:()=>$x,formatting:()=>Ide,generateDjb2Hash:()=>Bi,generateTSConfig:()=>ij,getAdjustedReferenceLocation:()=>oQ,getAdjustedRenameLocation:()=>aQ,getAliasDeclarationFromName:()=>hh,getAllAccessorDeclarations:()=>hv,getAllDecoratorsOfClass:()=>Cz,getAllDecoratorsOfClassElement:()=>wz,getAllJSDocTags:()=>ul,getAllJSDocTagsOfKind:()=>dl,getAllKeys:()=>Ie,getAllProjectOutputs:()=>xU,getAllSuperTypeNodes:()=>Ch,getAllowImportingTsExtensions:()=>kk,getAllowJSCompilerOption:()=>Mk,getAllowSyntheticDefaultImports:()=>Fk,getAncestor:()=>Dh,getAnyExtensionFromPath:()=>Lo,getAreDeclarationMapsEnabled:()=>jk,getAssignedExpandoInitializer:()=>Xm,getAssignedName:()=>Ec,getAssignmentDeclarationKind:()=>og,getAssignmentDeclarationPropertyAccessKind:()=>mg,getAssignmentTargetKind:()=>eh,getAutomaticTypeDirectiveNames:()=>FM,getBaseFileName:()=>Io,getBinaryOperatorPrecedence:()=>dy,getBuildInfo:()=>NU,getBuildInfoFileVersionMap:()=>KW,getBuildInfoText:()=>wU,getBuildOrderFromAnyBuildOrder:()=>lH,getBuilderCreationParameters:()=>BW,getBuilderFileEmit:()=>uW,getCanonicalDiagnostic:()=>Yp,getCheckFlags:()=>cx,getClassExtendsHeritageElement:()=>Sh,getClassLikeDeclarationOfSymbol:()=>bx,getCombinedLocalAndExportSymbolFlags:()=>ux,getCombinedModifierFlags:()=>cc,getCombinedNodeFlags:()=>_c,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>lc,getCommentRange:()=>jw,getCommonSourceDirectory:()=>vU,getCommonSourceDirectoryOfConfig:()=>bU,getCompilerOptionValue:()=>Qk,getConditions:()=>NM,getConfigFileParsingDiagnostics:()=>qV,getConstantValue:()=>Ww,getContainerFlags:()=>_B,getContainerNode:()=>AX,getContainingClass:()=>em,getContainingClassExcludingClassDecorators:()=>rm,getContainingClassStaticBlock:()=>tm,getContainingFunction:()=>Yf,getContainingFunctionDeclaration:()=>Zf,getContainingFunctionOrClassStaticBlock:()=>nm,getContainingNodeArray:()=>BT,getContainingObjectLiteralElement:()=>g7,getContextualTypeFromParent:()=>SZ,getContextualTypeFromParentOrAncestorTypeNode:()=>eQ,getDeclarationDiagnostics:()=>Jq,getDeclarationEmitExtensionForPath:()=>Gy,getDeclarationEmitOutputFilePath:()=>Hy,getDeclarationEmitOutputFilePathWorker:()=>Ky,getDeclarationFileExtension:()=>bO,getDeclarationFromName:()=>fh,getDeclarationModifierFlagsFromSymbol:()=>lx,getDeclarationOfKind:()=>Qu,getDeclarationsOfKind:()=>Yu,getDeclaredExpandoInitializer:()=>Gm,getDecorators:()=>Pc,getDefaultCompilerOptions:()=>r7,getDefaultFormatCodeSettings:()=>WG,getDefaultLibFileName:()=>As,getDefaultLibFilePath:()=>y7,getDefaultLikeExportInfo:()=>P0,getDefaultLikeExportNameFromDeclaration:()=>i0,getDefaultResolutionModeForFileWorker:()=>XV,getDiagnosticText:()=>SL,getDiagnosticsWithinSpan:()=>YZ,getDirectoryPath:()=>Ao,getDirectoryToWatchFailedLookupLocation:()=>c$,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>u$,getDocumentPositionMapper:()=>M1,getDocumentSpansEqualityComparer:()=>PY,getESModuleInterop:()=>Dk,getEditsForFileRename:()=>e1,getEffectiveBaseTypeNode:()=>kh,getEffectiveConstraintOfTypeParameter:()=>ml,getEffectiveContainerForJSDocTemplateTag:()=>Vg,getEffectiveImplementsTypeNodes:()=>Th,getEffectiveInitializer:()=>Km,getEffectiveJSDocHost:()=>Hg,getEffectiveModifierFlags:()=>Vv,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>Wv,getEffectiveModifierFlagsNoCache:()=>Gv,getEffectiveReturnTypeNode:()=>bv,getEffectiveSetAccessorTypeAnnotationNode:()=>kv,getEffectiveTypeAnnotationNode:()=>yv,getEffectiveTypeParameterDeclarations:()=>fl,getEffectiveTypeRoots:()=>bM,getElementOrPropertyAccessArgumentExpressionOrName:()=>pg,getElementOrPropertyAccessName:()=>fg,getElementsOfBindingOrAssignmentPattern:()=>HA,getEmitDeclarations:()=>Ik,getEmitFlags:()=>rp,getEmitHelpers:()=>Xw,getEmitModuleDetectionKind:()=>wk,getEmitModuleFormatOfFileWorker:()=>KV,getEmitModuleKind:()=>Tk,getEmitModuleResolutionKind:()=>Ck,getEmitScriptTarget:()=>Sk,getEmitStandardClassFields:()=>Hk,getEnclosingBlockScopeContainer:()=>Op,getEnclosingContainer:()=>Ip,getEncodedSemanticClassifications:()=>U0,getEncodedSyntacticClassifications:()=>K0,getEndLinePosition:()=>Fd,getEntityNameFromTypeNode:()=>fm,getEntrypointsFromPackageJsonInfo:()=>hR,getErrorCountForSummary:()=>T$,getErrorSpanForNode:()=>tf,getErrorSummaryText:()=>D$,getEscapedTextOfIdentifierOrLiteral:()=>Hh,getEscapedTextOfJsxAttributeName:()=>aC,getEscapedTextOfJsxNamespacedName:()=>lC,getExpandoInitializer:()=>Qm,getExportAssignmentExpression:()=>bh,getExportInfoMap:()=>E0,getExportNeedsImportStarHelper:()=>iz,getExpressionAssociativity:()=>ay,getExpressionPrecedence:()=>cy,getExternalHelpersModuleName:()=>LA,getExternalModuleImportEqualsDeclarationExpression:()=>Fm,getExternalModuleName:()=>wg,getExternalModuleNameFromDeclaration:()=>Vy,getExternalModuleNameFromPath:()=>Wy,getExternalModuleNameLiteral:()=>BA,getExternalModuleRequireArgument:()=>Em,getFallbackOptions:()=>KU,getFileEmitOutput:()=>aW,getFileMatcherPatterns:()=>bS,getFileNamesFromConfigSpecs:()=>Vj,getFileWatcherEventKind:()=>eo,getFilesInErrorForSummary:()=>C$,getFirstConstructorWithBody:()=>cv,getFirstIdentifier:()=>db,getFirstNonSpaceCharacterPosition:()=>dZ,getFirstProjectOutput:()=>SU,getFixableErrorSpanExpression:()=>e0,getFormatCodeSettingsForWriting:()=>p0,getFullWidth:()=>ud,getFunctionFlags:()=>Rh,getHeritageClause:()=>Nh,getHostSignatureFromJSDoc:()=>$g,getIdentifierAutoGenerate:()=>aN,getIdentifierGeneratedImportReference:()=>cN,getIdentifierTypeArguments:()=>iN,getImmediatelyInvokedFunctionExpression:()=>lm,getImpliedNodeFormatForEmitWorker:()=>GV,getImpliedNodeFormatForFile:()=>UV,getImpliedNodeFormatForFileWorker:()=>VV,getImportNeedsImportDefaultHelper:()=>az,getImportNeedsImportStarHelper:()=>oz,getIndentString:()=>jy,getInferredLibraryNameResolveFrom:()=>jV,getInitializedVariables:()=>ix,getInitializerOfBinaryExpression:()=>gg,getInitializerOfBindingOrAssignmentElement:()=>zA,getInterfaceBaseTypeNodes:()=>wh,getInternalEmitFlags:()=>ip,getInvokedExpression:()=>mm,getIsFileExcluded:()=>F0,getIsolatedModules:()=>Nk,getJSDocAugmentsTag:()=>Jc,getJSDocClassTag:()=>qc,getJSDocCommentRanges:()=>Sf,getJSDocCommentsAndTags:()=>Jg,getJSDocDeprecatedTag:()=>Yc,getJSDocDeprecatedTagNoCache:()=>Zc,getJSDocEnumTag:()=>el,getJSDocHost:()=>Kg,getJSDocImplementsTags:()=>zc,getJSDocOverloadTags:()=>Wg,getJSDocOverrideTagNoCache:()=>Qc,getJSDocParameterTags:()=>Oc,getJSDocParameterTagsNoCache:()=>Lc,getJSDocPrivateTag:()=>Wc,getJSDocPrivateTagNoCache:()=>$c,getJSDocProtectedTag:()=>Hc,getJSDocProtectedTagNoCache:()=>Kc,getJSDocPublicTag:()=>Uc,getJSDocPublicTagNoCache:()=>Vc,getJSDocReadonlyTag:()=>Gc,getJSDocReadonlyTagNoCache:()=>Xc,getJSDocReturnTag:()=>nl,getJSDocReturnType:()=>sl,getJSDocRoot:()=>Gg,getJSDocSatisfiesExpressionType:()=>iC,getJSDocSatisfiesTag:()=>il,getJSDocTags:()=>ll,getJSDocTemplateTag:()=>rl,getJSDocThisTag:()=>tl,getJSDocType:()=>al,getJSDocTypeAliasName:()=>KA,getJSDocTypeAssertionType:()=>EA,getJSDocTypeParameterDeclarations:()=>xv,getJSDocTypeParameterTags:()=>Mc,getJSDocTypeParameterTagsNoCache:()=>Rc,getJSDocTypeTag:()=>ol,getJSXImplicitImportBase:()=>Zk,getJSXRuntimeImport:()=>eS,getJSXTransformEnabled:()=>Yk,getKeyForCompilerOptions:()=>IM,getLanguageVariant:()=>fk,getLastChild:()=>Tx,getLeadingCommentRanges:()=>fs,getLeadingCommentRangesOfNode:()=>kf,getLeftmostAccessExpression:()=>Px,getLeftmostExpression:()=>Ix,getLibFileNameFromLibReference:()=>MC,getLibNameFromLibReference:()=>jC,getLibraryNameFromLibFileName:()=>MV,getLineAndCharacterOfPosition:()=>Wa,getLineInfo:()=>MJ,getLineOfLocalPosition:()=>av,getLineStartPositionForPosition:()=>jX,getLineStarts:()=>za,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>ex,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>Zb,getLinesBetweenPositions:()=>Va,getLinesBetweenRangeEndAndRangeStart:()=>Kb,getLinesBetweenRangeEndPositions:()=>Gb,getLiteralText:()=>sp,getLocalNameForExternalImport:()=>RA,getLocalSymbolForExportDefault:()=>Tb,getLocaleSpecificMessage:()=>Gx,getLocaleTimeString:()=>x$,getMappedContextSpan:()=>jY,getMappedDocumentSpan:()=>LY,getMappedLocation:()=>OY,getMatchedFileSpec:()=>A$,getMatchedIncludeSpec:()=>I$,getMeaningFromDeclaration:()=>oX,getMeaningFromLocation:()=>aX,getMembersOfDeclaration:()=>Lf,getModeForFileReference:()=>bV,getModeForResolutionAtIndex:()=>xV,getModeForUsageLocation:()=>SV,getModifiedTime:()=>Vi,getModifiers:()=>Ac,getModuleInstanceState:()=>eB,getModuleNameStringLiteralAt:()=>iW,getModuleSpecifierEndingPreference:()=>US,getModuleSpecifierResolverHost:()=>uY,getNameForExportedSymbol:()=>r0,getNameFromImportAttribute:()=>yC,getNameFromIndexInfo:()=>Mp,getNameFromPropertyName:()=>aY,getNameOfAccessExpression:()=>Fx,getNameOfCompilerOptionValue:()=>tj,getNameOfDeclaration:()=>Fc,getNameOfExpando:()=>Zm,getNameOfJSDocTypedef:()=>wc,getNameOfScriptTarget:()=>$k,getNameOrArgument:()=>dg,getNameTable:()=>m7,getNamespaceDeclarationNode:()=>Ng,getNewLineCharacter:()=>jb,getNewLineKind:()=>u0,getNewLineOrDefaultFromHost:()=>tZ,getNewTargetContainer:()=>sm,getNextJSDocCommentLocation:()=>qg,getNodeChildren:()=>oA,getNodeForGeneratedName:()=>yI,getNodeId:()=>_J,getNodeKind:()=>IX,getNodeModifiers:()=>PQ,getNodeModulePathParts:()=>KT,getNonAssignedNameOfDeclaration:()=>Dc,getNonAssignmentOperatorForCompoundAssignment:()=>mz,getNonAugmentationDeclaration:()=>bp,getNonDecoratorTokenPosOfNode:()=>$d,getNonIncrementalBuildInfoRoots:()=>GW,getNonModifierTokenPosOfNode:()=>Hd,getNormalizedAbsolutePath:()=>Uo,getNormalizedAbsolutePathWithoutRoot:()=>$o,getNormalizedPathComponents:()=>qo,getObjectFlags:()=>xx,getOperatorAssociativity:()=>sy,getOperatorPrecedence:()=>uy,getOptionFromName:()=>yL,getOptionsForLibraryResolution:()=>VM,getOptionsNameMap:()=>iL,getOptionsSyntaxByArrayElementValue:()=>JC,getOptionsSyntaxByValue:()=>zC,getOrCreateEmitNode:()=>Sw,getOrUpdate:()=>q,getOriginalNode:()=>fc,getOriginalNodeId:()=>ez,getOutputDeclarationFileName:()=>dU,getOutputDeclarationFileNameWorker:()=>pU,getOutputExtension:()=>_U,getOutputFileNames:()=>kU,getOutputJSFileNameWorker:()=>mU,getOutputPathsFor:()=>cU,getOwnEmitOutputFilePath:()=>$y,getOwnKeys:()=>Ae,getOwnValues:()=>Oe,getPackageJsonTypesVersionsPaths:()=>vM,getPackageNameFromTypesPackageName:()=>UR,getPackageScopeForPath:()=>bR,getParameterSymbolFromJSDoc:()=>Ug,getParentNodeInSpan:()=>TY,getParseTreeNode:()=>hc,getParsedCommandLineOfConfigFile:()=>TL,getPathComponents:()=>jo,getPathFromPathComponents:()=>Mo,getPathUpdater:()=>t1,getPathsBasePath:()=>Yy,getPatternFromSpec:()=>hS,getPendingEmitKindWithSeen:()=>SW,getPositionOfLineAndCharacter:()=>Ba,getPossibleGenericSignatures:()=>wQ,getPossibleOriginalInputExtensionForExtension:()=>Xy,getPossibleOriginalInputPathWithoutChangingExt:()=>Qy,getPossibleTypeArgumentsInfo:()=>NQ,getPreEmitDiagnostics:()=>iV,getPrecedingNonSpaceCharacterPosition:()=>pZ,getPrivateIdentifier:()=>Fz,getProperties:()=>vz,getProperty:()=>Pe,getPropertyAssignmentAliasLikeExpression:()=>xh,getPropertyNameForPropertyNameNode:()=>Vh,getPropertyNameFromType:()=>pC,getPropertyNameOfBindingOrAssignmentElement:()=>VA,getPropertySymbolFromBindingElement:()=>SY,getPropertySymbolsFromContextualType:()=>h7,getQuoteFromPreference:()=>yY,getQuotePreference:()=>hY,getRangesWhere:()=>K,getRefactorContextSpan:()=>ZZ,getReferencedFileLocation:()=>JV,getRegexFromPattern:()=>xS,getRegularExpressionForWildcard:()=>fS,getRegularExpressionsForWildcards:()=>mS,getRelativePathFromDirectory:()=>sa,getRelativePathFromFile:()=>la,getRelativePathToDirectoryOrUrl:()=>_a,getRenameLocation:()=>gZ,getReplacementSpanForContextToken:()=>VQ,getResolutionDiagnostic:()=>nW,getResolutionModeOverride:()=>wV,getResolveJsonModule:()=>Ak,getResolvePackageJsonExports:()=>Ek,getResolvePackageJsonImports:()=>Pk,getResolvedExternalModuleName:()=>qy,getResolvedModuleFromResolution:()=>fd,getResolvedTypeReferenceDirectiveFromResolution:()=>md,getRestIndicatorOfBindingOrAssignmentElement:()=>UA,getRestParameterElementType:()=>Of,getRightMostAssignedExpression:()=>tg,getRootDeclaration:()=>ny,getRootDirectoryOfResolutionCache:()=>d$,getRootLength:()=>Po,getScriptKind:()=>cZ,getScriptKindFromFileName:()=>wS,getScriptTargetFeatures:()=>op,getSelectedEffectiveModifierFlags:()=>zv,getSelectedSyntacticModifierFlags:()=>qv,getSemanticClassifications:()=>z0,getSemanticJsxChildren:()=>py,getSetAccessorTypeAnnotationNode:()=>_v,getSetAccessorValueParameter:()=>lv,getSetExternalModuleIndicator:()=>yk,getShebang:()=>gs,getSingleVariableOfVariableStatement:()=>jg,getSnapshotText:()=>rY,getSnippetElement:()=>Yw,getSourceFileOfModule:()=>Td,getSourceFileOfNode:()=>Sd,getSourceFilePathInNewDir:()=>tv,getSourceFileVersionAsHashFromText:()=>V$,getSourceFilesToEmit:()=>Zy,getSourceMapRange:()=>Ew,getSourceMapper:()=>j1,getSourceTextOfNodeFromSourceFile:()=>Kd,getSpanOfTokenAtPosition:()=>Zp,getSpellingSuggestion:()=>Mt,getStartPositionOfLine:()=>Nd,getStartPositionOfRange:()=>Yb,getStartsOnNewLine:()=>Ow,getStaticPropertiesAndClassStaticBlock:()=>xz,getStrictOptionValue:()=>Wk,getStringComparer:()=>Dt,getSubPatternFromSpec:()=>yS,getSuperCallFromStatement:()=>gz,getSuperContainer:()=>cm,getSupportedCodeFixes:()=>i7,getSupportedExtensions:()=>MS,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>RS,getSwitchedType:()=>DZ,getSymbolId:()=>uJ,getSymbolNameForPrivateIdentifier:()=>Kh,getSymbolTarget:()=>lZ,getSyntacticClassifications:()=>H0,getSyntacticModifierFlags:()=>$v,getSyntacticModifierFlagsNoCache:()=>Xv,getSynthesizedDeepClone:()=>UC,getSynthesizedDeepCloneWithReplacements:()=>VC,getSynthesizedDeepClones:()=>$C,getSynthesizedDeepClonesWithReplacements:()=>HC,getSyntheticLeadingComments:()=>Rw,getSyntheticTrailingComments:()=>zw,getTargetLabel:()=>vX,getTargetOfBindingOrAssignmentElement:()=>qA,getTemporaryModuleResolutionState:()=>vR,getTextOfConstantValue:()=>cp,getTextOfIdentifierOrLiteral:()=>$h,getTextOfJSDocComment:()=>pl,getTextOfJsxAttributeName:()=>sC,getTextOfJsxNamespacedName:()=>_C,getTextOfNode:()=>ep,getTextOfNodeFromSourceText:()=>Zd,getTextOfPropertyName:()=>Jp,getThisContainer:()=>im,getThisParameter:()=>uv,getTokenAtPosition:()=>lQ,getTokenPosOfNode:()=>Wd,getTokenSourceMapRange:()=>Aw,getTouchingPropertyName:()=>sQ,getTouchingToken:()=>cQ,getTrailingCommentRanges:()=>ms,getTrailingSemicolonDeferringWriter:()=>By,getTransformers:()=>Hq,getTsBuildInfoEmitOutputFilePath:()=>aU,getTsConfigObjectLiteralExpression:()=>Gf,getTsConfigPropArrayElementValue:()=>Xf,getTypeAnnotationNode:()=>vv,getTypeArgumentOrTypeParameterList:()=>AQ,getTypeKeywordOfTypeOnlyImport:()=>DY,getTypeNode:()=>nN,getTypeNodeIfAccessible:()=>EZ,getTypeParameterFromJsDoc:()=>Xg,getTypeParameterOwner:()=>nc,getTypesPackageName:()=>zR,getUILocale:()=>At,getUniqueName:()=>mZ,getUniqueSymbolId:()=>uZ,getUseDefineForClassFields:()=>Rk,getWatchErrorSummaryDiagnosticMessage:()=>w$,getWatchFactory:()=>HU,group:()=>qe,groupBy:()=>Ue,guessIndentation:()=>Bu,handleNoEmitOptions:()=>YV,handleWatchOptionsConfigDirTemplateSubstitution:()=>fj,hasAbstractModifier:()=>jv,hasAccessorModifier:()=>Rv,hasAmbientModifier:()=>Mv,hasChangesInResolutions:()=>xd,hasContextSensitiveParameters:()=>JT,hasDecorators:()=>Jv,hasDocComment:()=>FQ,hasDynamicName:()=>qh,hasEffectiveModifier:()=>Pv,hasEffectiveModifiers:()=>Fv,hasEffectiveReadonlyModifier:()=>Bv,hasExtension:()=>Co,hasImplementationTSFileExtension:()=>zS,hasIndexSignature:()=>NZ,hasInferredType:()=>NC,hasInitializer:()=>Ou,hasInvalidEscape:()=>yy,hasJSDocNodes:()=>Au,hasJSDocParameterTags:()=>Bc,hasJSFileExtension:()=>BS,hasJsonModuleEmitEnabled:()=>Jk,hasOnlyExpressionInitializer:()=>Lu,hasOverrideModifier:()=>Lv,hasPossibleExternalModuleReference:()=>Pp,hasProperty:()=>Ee,hasPropertyAccessExpressionWithName:()=>bX,hasQuestionToken:()=>Eg,hasRecordedExternalHelpers:()=>jA,hasResolutionModeOverride:()=>mC,hasRestParameter:()=>qu,hasScopeMarker:()=>Y_,hasStaticModifier:()=>Ov,hasSyntacticModifier:()=>Av,hasSyntacticModifiers:()=>Ev,hasTSFileExtension:()=>JS,hasTabstop:()=>ZT,hasTrailingDirectorySeparator:()=>Do,hasType:()=>Iu,hasTypeArguments:()=>Qg,hasZeroOrOneAsteriskCharacter:()=>tS,hostGetCanonicalFileName:()=>zy,hostUsesCaseSensitiveFileNames:()=>Jy,idText:()=>bc,identifierIsThisKeyword:()=>gv,identifierToKeywordKind:()=>xc,identity:()=>lt,identitySourceMapConsumer:()=>ZJ,ignoreSourceNewlines:()=>eN,ignoredPaths:()=>to,importFromModuleSpecifier:()=>Sg,importSyntaxAffectsModuleResolution:()=>vk,indexOfAnyCharCode:()=>w,indexOfNode:()=>np,indicesOf:()=>Q,inferredTypesContainingFile:()=>LV,injectClassNamedEvaluationHelperBlockIfMissing:()=>Zz,injectClassThisAssignmentIfMissing:()=>Hz,insertImports:()=>NY,insertSorted:()=>te,insertStatementAfterCustomPrologue:()=>zd,insertStatementAfterStandardPrologue:()=>Jd,insertStatementsAfterCustomPrologue:()=>Bd,insertStatementsAfterStandardPrologue:()=>Rd,intersperse:()=>v,intrinsicTagNameToString:()=>uC,introducesArgumentsExoticObject:()=>zf,inverseJsxOptionMap:()=>AO,isAbstractConstructorSymbol:()=>vx,isAbstractModifier:()=>bD,isAccessExpression:()=>Dx,isAccessibilityModifier:()=>RQ,isAccessor:()=>g_,isAccessorModifier:()=>kD,isAliasableExpression:()=>yh,isAmbientModule:()=>dp,isAmbientPropertyDeclaration:()=>Sp,isAnyDirectorySeparator:()=>yo,isAnyImportOrBareOrAccessedRequire:()=>Dp,isAnyImportOrReExport:()=>Ap,isAnyImportOrRequireStatement:()=>Fp,isAnyImportSyntax:()=>Np,isAnySupportedFileExtension:()=>oT,isApplicableVersionedTypesKey:()=>AR,isArgumentExpressionOfElementAccess:()=>NX,isArray:()=>Ze,isArrayBindingElement:()=>D_,isArrayBindingOrAssignmentElement:()=>L_,isArrayBindingOrAssignmentPattern:()=>O_,isArrayBindingPattern:()=>pF,isArrayLiteralExpression:()=>mF,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>JQ,isArrayTypeNode:()=>KD,isArrowFunction:()=>CF,isAsExpression:()=>JF,isAssertClause:()=>FE,isAssertEntry:()=>EE,isAssertionExpression:()=>G_,isAssertsKeyword:()=>gD,isAssignmentDeclaration:()=>Hm,isAssignmentExpression:()=>cb,isAssignmentOperator:()=>ob,isAssignmentPattern:()=>N_,isAssignmentTarget:()=>th,isAsteriskToken:()=>oD,isAsyncFunction:()=>Bh,isAsyncModifier:()=>mD,isAutoAccessorPropertyDeclaration:()=>h_,isAwaitExpression:()=>FF,isAwaitKeyword:()=>hD,isBigIntLiteral:()=>HN,isBinaryExpression:()=>AF,isBinaryLogicalOperator:()=>Zv,isBinaryOperatorToken:()=>cI,isBindableObjectDefinePropertyCall:()=>ag,isBindableStaticAccessExpression:()=>lg,isBindableStaticElementAccessExpression:()=>_g,isBindableStaticNameExpression:()=>ug,isBindingElement:()=>fF,isBindingElementOfBareOrAccessedRequire:()=>qm,isBindingName:()=>a_,isBindingOrAssignmentElement:()=>E_,isBindingOrAssignmentPattern:()=>P_,isBindingPattern:()=>w_,isBlock:()=>GF,isBlockLike:()=>y0,isBlockOrCatchScoped:()=>_p,isBlockScope:()=>Tp,isBlockScopedContainerTopLevel:()=>gp,isBooleanLiteral:()=>__,isBreakOrContinueStatement:()=>Fl,isBreakStatement:()=>aE,isBuildCommand:()=>IK,isBuildInfoFile:()=>iU,isBuilderProgram:()=>F$,isBundle:()=>pP,isCallChain:()=>bl,isCallExpression:()=>vF,isCallExpressionTarget:()=>cX,isCallLikeExpression:()=>B_,isCallLikeOrFunctionLikeExpression:()=>R_,isCallOrNewExpression:()=>J_,isCallOrNewExpressionTarget:()=>_X,isCallSignatureDeclaration:()=>BD,isCallToHelper:()=>WN,isCaseBlock:()=>SE,isCaseClause:()=>iP,isCaseKeyword:()=>CD,isCaseOrDefaultClause:()=>wu,isCatchClause:()=>sP,isCatchClauseVariableDeclaration:()=>qT,isCatchClauseVariableDeclarationOrBindingElement:()=>up,isCheckJsEnabledForFile:()=>sT,isCircularBuildOrder:()=>cH,isClassDeclaration:()=>hE,isClassElement:()=>f_,isClassExpression:()=>MF,isClassInstanceProperty:()=>y_,isClassLike:()=>m_,isClassMemberModifier:()=>n_,isClassNamedEvaluationHelperBlock:()=>Xz,isClassOrTypeElement:()=>k_,isClassStaticBlockDeclaration:()=>LD,isClassThisAssignmentBlock:()=>Wz,isColonToken:()=>cD,isCommaExpression:()=>NA,isCommaListExpression:()=>$F,isCommaSequence:()=>DA,isCommaToken:()=>nD,isComment:()=>IQ,isCommonJsExportPropertyAssignment:()=>Bf,isCommonJsExportedExpression:()=>Rf,isCompoundAssignment:()=>fz,isComputedNonLiteralName:()=>Rp,isComputedPropertyName:()=>ND,isConciseBody:()=>nu,isConditionalExpression:()=>IF,isConditionalTypeNode:()=>tF,isConstAssertion:()=>kC,isConstTypeReference:()=>wl,isConstructSignatureDeclaration:()=>JD,isConstructorDeclaration:()=>jD,isConstructorTypeNode:()=>WD,isContextualKeyword:()=>Ah,isContinueStatement:()=>oE,isCustomPrologue:()=>yf,isDebuggerStatement:()=>pE,isDeclaration:()=>fu,isDeclarationBindingElement:()=>F_,isDeclarationFileName:()=>vO,isDeclarationName:()=>ph,isDeclarationNameOfEnumOrNamespace:()=>rx,isDeclarationReadonly:()=>sf,isDeclarationStatement:()=>mu,isDeclarationWithTypeParameterChildren:()=>wp,isDeclarationWithTypeParameters:()=>Cp,isDecorator:()=>ED,isDecoratorTarget:()=>dX,isDefaultClause:()=>oP,isDefaultImport:()=>Dg,isDefaultModifier:()=>fD,isDefaultedExpandoInitializer:()=>Ym,isDeleteExpression:()=>wF,isDeleteTarget:()=>uh,isDeprecatedDeclaration:()=>l0,isDestructuringAssignment:()=>lb,isDiskPathRoot:()=>xo,isDoStatement:()=>eE,isDocumentRegistryEntry:()=>G0,isDotDotDotToken:()=>tD,isDottedName:()=>pb,isDynamicName:()=>Uh,isEffectiveExternalModule:()=>xp,isEffectiveStrictModeSourceFile:()=>kp,isElementAccessChain:()=>vl,isElementAccessExpression:()=>yF,isEmittedFileOfProgram:()=>WU,isEmptyArrayLiteral:()=>Sb,isEmptyBindingElement:()=>oc,isEmptyBindingPattern:()=>ic,isEmptyObjectLiteral:()=>kb,isEmptyStatement:()=>QF,isEmptyStringLiteral:()=>km,isEntityName:()=>i_,isEntityNameExpression:()=>ub,isEnumConst:()=>af,isEnumDeclaration:()=>bE,isEnumMember:()=>uP,isEqualityOperatorKind:()=>CZ,isEqualsGreaterThanToken:()=>_D,isExclamationToken:()=>aD,isExcludedFile:()=>Wj,isExclusivelyTypeOnlyImportOrExport:()=>kV,isExpandoPropertyDeclaration:()=>fC,isExportAssignment:()=>ME,isExportDeclaration:()=>RE,isExportModifier:()=>pD,isExportName:()=>SA,isExportNamespaceAsDefaultDeclaration:()=>Gd,isExportOrDefaultModifier:()=>gI,isExportSpecifier:()=>JE,isExportsIdentifier:()=>ng,isExportsOrModuleExportsOrAlias:()=>lB,isExpression:()=>K_,isExpressionNode:()=>Tm,isExpressionOfExternalModuleImportEqualsDeclaration:()=>PX,isExpressionOfOptionalChainRoot:()=>Sl,isExpressionStatement:()=>YF,isExpressionWithTypeArguments:()=>BF,isExpressionWithTypeArgumentsInClassExtendsClause:()=>_b,isExternalModule:()=>uO,isExternalModuleAugmentation:()=>yp,isExternalModuleImportEqualsDeclaration:()=>Dm,isExternalModuleIndicator:()=>eu,isExternalModuleNameRelative:()=>Fs,isExternalModuleReference:()=>WE,isExternalModuleSymbol:()=>td,isExternalOrCommonJsModule:()=>rf,isFileLevelReservedGeneratedIdentifier:()=>Ql,isFileLevelUniqueName:()=>Ed,isFileProbablyExternalModule:()=>MI,isFirstDeclarationOfSymbolParameter:()=>MY,isFixablePromiseHandler:()=>W1,isForInOrOfStatement:()=>tu,isForInStatement:()=>rE,isForInitializer:()=>iu,isForOfStatement:()=>iE,isForStatement:()=>nE,isFullSourceFile:()=>Am,isFunctionBlock:()=>Uf,isFunctionBody:()=>ru,isFunctionDeclaration:()=>gE,isFunctionExpression:()=>TF,isFunctionExpressionOrArrowFunction:()=>UT,isFunctionLike:()=>s_,isFunctionLikeDeclaration:()=>l_,isFunctionLikeKind:()=>d_,isFunctionLikeOrClassStaticBlockDeclaration:()=>c_,isFunctionOrConstructorTypeNode:()=>C_,isFunctionOrModuleBlock:()=>p_,isFunctionSymbol:()=>bg,isFunctionTypeNode:()=>VD,isGeneratedIdentifier:()=>Gl,isGeneratedPrivateIdentifier:()=>Xl,isGetAccessor:()=>Pu,isGetAccessorDeclaration:()=>MD,isGetOrSetAccessorDeclaration:()=>hl,isGlobalScopeAugmentation:()=>hp,isGlobalSourceFile:()=>nf,isGrammarError:()=>Id,isHeritageClause:()=>aP,isHoistedFunction:()=>vf,isHoistedVariableStatement:()=>xf,isIdentifier:()=>uD,isIdentifierANonContextualKeyword:()=>Lh,isIdentifierName:()=>gh,isIdentifierOrThisTypeNode:()=>eI,isIdentifierPart:()=>ys,isIdentifierStart:()=>hs,isIdentifierText:()=>vs,isIdentifierTypePredicate:()=>$f,isIdentifierTypeReference:()=>wT,isIfStatement:()=>ZF,isIgnoredFileFromWildCardWatching:()=>VU,isImplicitGlob:()=>gS,isImportAttribute:()=>AE,isImportAttributeName:()=>Kl,isImportAttributes:()=>PE,isImportCall:()=>ff,isImportClause:()=>NE,isImportDeclaration:()=>wE,isImportEqualsDeclaration:()=>CE,isImportKeyword:()=>TD,isImportMeta:()=>mf,isImportOrExportSpecifier:()=>ql,isImportOrExportSpecifierName:()=>sZ,isImportSpecifier:()=>jE,isImportTypeAssertionContainer:()=>DE,isImportTypeNode:()=>lF,isImportable:()=>S0,isInComment:()=>DQ,isInCompoundLikeAssignment:()=>nh,isInExpressionContext:()=>Cm,isInJSDoc:()=>Mm,isInJSFile:()=>Om,isInJSXText:()=>kQ,isInJsonFile:()=>Lm,isInNonReferenceComment:()=>qQ,isInReferenceComment:()=>zQ,isInRightSideOfInternalImportEqualsDeclaration:()=>sX,isInString:()=>yQ,isInTemplateString:()=>xQ,isInTopLevelContext:()=>am,isInTypeQuery:()=>fv,isIncrementalBuildInfo:()=>OW,isIncrementalBundleEmitBuildInfo:()=>IW,isIncrementalCompilation:()=>Lk,isIndexSignatureDeclaration:()=>zD,isIndexedAccessTypeNode:()=>aF,isInferTypeNode:()=>nF,isInfinityOrNaNString:()=>zT,isInitializedProperty:()=>kz,isInitializedVariable:()=>ox,isInsideJsxElement:()=>SQ,isInsideJsxElementOrAttribute:()=>vQ,isInsideNodeModules:()=>GZ,isInsideTemplateLiteral:()=>MQ,isInstanceOfExpression:()=>bb,isInstantiatedModule:()=>dJ,isInterfaceDeclaration:()=>yE,isInternalDeclaration:()=>Wu,isInternalModuleImportEqualsDeclaration:()=>Pm,isInternalName:()=>xA,isIntersectionTypeNode:()=>eF,isIntrinsicJsxName:()=>Oy,isIterationStatement:()=>X_,isJSDoc:()=>DP,isJSDocAllType:()=>bP,isJSDocAugmentsTag:()=>PP,isJSDocAuthorTag:()=>AP,isJSDocCallbackTag:()=>OP,isJSDocClassTag:()=>IP,isJSDocCommentContainingNode:()=>Du,isJSDocConstructSignature:()=>Pg,isJSDocDeprecatedTag:()=>zP,isJSDocEnumTag:()=>UP,isJSDocFunctionType:()=>CP,isJSDocImplementsTag:()=>YP,isJSDocImportTag:()=>tA,isJSDocIndexSignature:()=>Rm,isJSDocLikeText:()=>jI,isJSDocLink:()=>hP,isJSDocLinkCode:()=>yP,isJSDocLinkLike:()=>zu,isJSDocLinkPlain:()=>vP,isJSDocMemberName:()=>gP,isJSDocNameReference:()=>mP,isJSDocNamepathType:()=>NP,isJSDocNamespaceBody:()=>su,isJSDocNode:()=>Nu,isJSDocNonNullableType:()=>SP,isJSDocNullableType:()=>kP,isJSDocOptionalParameter:()=>eC,isJSDocOptionalType:()=>TP,isJSDocOverloadTag:()=>JP,isJSDocOverrideTag:()=>BP,isJSDocParameterTag:()=>VP,isJSDocPrivateTag:()=>jP,isJSDocPropertyLikeTag:()=>Pl,isJSDocPropertyTag:()=>QP,isJSDocProtectedTag:()=>MP,isJSDocPublicTag:()=>LP,isJSDocReadonlyTag:()=>RP,isJSDocReturnTag:()=>WP,isJSDocSatisfiesExpression:()=>rC,isJSDocSatisfiesTag:()=>ZP,isJSDocSeeTag:()=>qP,isJSDocSignature:()=>EP,isJSDocTag:()=>Fu,isJSDocTemplateTag:()=>KP,isJSDocThisTag:()=>$P,isJSDocThrowsTag:()=>eA,isJSDocTypeAlias:()=>Ag,isJSDocTypeAssertion:()=>FA,isJSDocTypeExpression:()=>fP,isJSDocTypeLiteral:()=>FP,isJSDocTypeTag:()=>HP,isJSDocTypedefTag:()=>GP,isJSDocUnknownTag:()=>XP,isJSDocUnknownType:()=>xP,isJSDocVariadicType:()=>wP,isJSXTagName:()=>Sm,isJsonEqual:()=>vT,isJsonSourceFile:()=>of,isJsxAttribute:()=>ZE,isJsxAttributeLike:()=>ku,isJsxAttributeName:()=>cC,isJsxAttributes:()=>eP,isJsxCallLike:()=>Cu,isJsxChild:()=>xu,isJsxClosingElement:()=>GE,isJsxClosingFragment:()=>YE,isJsxElement:()=>$E,isJsxExpression:()=>nP,isJsxFragment:()=>XE,isJsxNamespacedName:()=>rP,isJsxOpeningElement:()=>KE,isJsxOpeningFragment:()=>QE,isJsxOpeningLikeElement:()=>Tu,isJsxOpeningLikeElementTagName:()=>pX,isJsxSelfClosingElement:()=>HE,isJsxSpreadAttribute:()=>tP,isJsxTagNameExpression:()=>bu,isJsxText:()=>GN,isJumpStatementTarget:()=>xX,isKeyword:()=>Fh,isKeywordOrPunctuation:()=>Ph,isKnownSymbol:()=>Gh,isLabelName:()=>SX,isLabelOfLabeledStatement:()=>kX,isLabeledStatement:()=>_E,isLateVisibilityPaintedStatement:()=>Ep,isLeftHandSideExpression:()=>q_,isLet:()=>df,isLineBreak:()=>Ka,isLiteralComputedPropertyDeclarationName:()=>mh,isLiteralExpression:()=>Ml,isLiteralExpressionOfObject:()=>Rl,isLiteralImportTypeNode:()=>gf,isLiteralKind:()=>jl,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>EX,isLiteralTypeLiteral:()=>H_,isLiteralTypeNode:()=>cF,isLocalName:()=>kA,isLogicalOperator:()=>eb,isLogicalOrCoalescingAssignmentExpression:()=>nb,isLogicalOrCoalescingAssignmentOperator:()=>tb,isLogicalOrCoalescingBinaryExpression:()=>ib,isLogicalOrCoalescingBinaryOperator:()=>rb,isMappedTypeNode:()=>sF,isMemberName:()=>gl,isMetaProperty:()=>UF,isMethodDeclaration:()=>OD,isMethodOrAccessor:()=>v_,isMethodSignature:()=>ID,isMinusToken:()=>iD,isMissingDeclaration:()=>qE,isMissingPackageJsonInfo:()=>PM,isModifier:()=>r_,isModifierKind:()=>e_,isModifierLike:()=>b_,isModuleAugmentationExternal:()=>vp,isModuleBlock:()=>kE,isModuleBody:()=>ou,isModuleDeclaration:()=>xE,isModuleExportName:()=>zE,isModuleExportsAccessExpression:()=>ig,isModuleIdentifier:()=>rg,isModuleName:()=>rI,isModuleOrEnumDeclaration:()=>lu,isModuleReference:()=>vu,isModuleSpecifierLike:()=>xY,isModuleWithStringLiteralName:()=>pp,isNameOfFunctionDeclaration:()=>FX,isNameOfModuleDeclaration:()=>DX,isNamedDeclaration:()=>Nc,isNamedEvaluation:()=>Zh,isNamedEvaluationSource:()=>Yh,isNamedExportBindings:()=>El,isNamedExports:()=>BE,isNamedImportBindings:()=>cu,isNamedImports:()=>LE,isNamedImportsOrExports:()=>Ex,isNamedTupleMember:()=>XD,isNamespaceBody:()=>au,isNamespaceExport:()=>OE,isNamespaceExportDeclaration:()=>TE,isNamespaceImport:()=>IE,isNamespaceReexportDeclaration:()=>Nm,isNewExpression:()=>bF,isNewExpressionTarget:()=>lX,isNewScopeNode:()=>LC,isNoSubstitutionTemplateLiteral:()=>QN,isNodeArray:()=>Ll,isNodeArrayMultiLine:()=>Xb,isNodeDescendantOf:()=>dh,isNodeKind:()=>Al,isNodeLikeSystem:()=>dn,isNodeModulesDirectory:()=>da,isNodeWithPossibleHoistedDeclaration:()=>rh,isNonContextualKeyword:()=>Ih,isNonGlobalAmbientModule:()=>fp,isNonNullAccess:()=>nC,isNonNullChain:()=>Dl,isNonNullExpression:()=>qF,isNonStaticMethodOrAccessorWithPrivateName:()=>Sz,isNotEmittedStatement:()=>UE,isNullishCoalesce:()=>Cl,isNumber:()=>nt,isNumericLiteral:()=>$N,isNumericLiteralName:()=>WT,isObjectBindingElementWithoutPropertyName:()=>kY,isObjectBindingOrAssignmentElement:()=>I_,isObjectBindingOrAssignmentPattern:()=>A_,isObjectBindingPattern:()=>dF,isObjectLiteralElement:()=>ju,isObjectLiteralElementLike:()=>S_,isObjectLiteralExpression:()=>gF,isObjectLiteralMethod:()=>Vf,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>Wf,isObjectTypeDeclaration:()=>wx,isOmittedExpression:()=>RF,isOptionalChain:()=>xl,isOptionalChainRoot:()=>kl,isOptionalDeclaration:()=>tC,isOptionalJSDocPropertyLikeTag:()=>QT,isOptionalTypeNode:()=>QD,isOuterExpression:()=>PA,isOutermostOptionalChain:()=>Tl,isOverrideModifier:()=>xD,isPackageJsonInfo:()=>EM,isPackedArrayLiteral:()=>jT,isParameter:()=>FD,isParameterPropertyDeclaration:()=>rc,isParameterPropertyModifier:()=>t_,isParenthesizedExpression:()=>SF,isParenthesizedTypeNode:()=>rF,isParseTreeNode:()=>gc,isPartOfParameterDeclaration:()=>ty,isPartOfTypeNode:()=>Ef,isPartOfTypeOnlyImportOrExportDeclaration:()=>$l,isPartOfTypeQuery:()=>wm,isPartiallyEmittedExpression:()=>WF,isPatternMatch:()=>en,isPinnedComment:()=>Ud,isPlainJsFile:()=>Cd,isPlusToken:()=>rD,isPossiblyTypeArgumentPosition:()=>CQ,isPostfixUnaryExpression:()=>PF,isPrefixUnaryExpression:()=>EF,isPrimitiveLiteralValue:()=>CC,isPrivateIdentifier:()=>dD,isPrivateIdentifierClassElementDeclaration:()=>Yl,isPrivateIdentifierPropertyAccessExpression:()=>Zl,isPrivateIdentifierSymbol:()=>Xh,isProgramUptoDate:()=>zV,isPrologueDirective:()=>hf,isPropertyAccessChain:()=>yl,isPropertyAccessEntityNameExpression:()=>fb,isPropertyAccessExpression:()=>hF,isPropertyAccessOrQualifiedName:()=>M_,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>j_,isPropertyAssignment:()=>cP,isPropertyDeclaration:()=>AD,isPropertyName:()=>o_,isPropertyNameLiteral:()=>Wh,isPropertySignature:()=>PD,isPrototypeAccess:()=>gb,isPrototypePropertyAssignment:()=>hg,isPunctuation:()=>Eh,isPushOrUnshiftIdentifier:()=>ey,isQualifiedName:()=>wD,isQuestionDotToken:()=>lD,isQuestionOrExclamationToken:()=>ZA,isQuestionOrPlusOrMinusToken:()=>nI,isQuestionToken:()=>sD,isReadonlyKeyword:()=>yD,isReadonlyKeywordOrPlusOrMinusToken:()=>tI,isRecognizedTripleSlashComment:()=>qd,isReferenceFileLocation:()=>BV,isReferencedFile:()=>RV,isRegularExpressionLiteral:()=>XN,isRequireCall:()=>Bm,isRequireVariableStatement:()=>Vm,isRestParameter:()=>Uu,isRestTypeNode:()=>YD,isReturnStatement:()=>sE,isReturnStatementWithFixablePromiseHandler:()=>V1,isRightSideOfAccessExpression:()=>yb,isRightSideOfInstanceofExpression:()=>xb,isRightSideOfPropertyAccess:()=>wX,isRightSideOfQualifiedName:()=>CX,isRightSideOfQualifiedNameOrPropertyAccess:()=>hb,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>vb,isRootedDiskPath:()=>bo,isSameEntityName:()=>eg,isSatisfiesExpression:()=>zF,isSemicolonClassElement:()=>KF,isSetAccessor:()=>Eu,isSetAccessorDeclaration:()=>RD,isShiftOperatorOrHigher:()=>iI,isShorthandAmbientModuleSymbol:()=>mp,isShorthandPropertyAssignment:()=>lP,isSideEffectImport:()=>DC,isSignedNumericLiteral:()=>zh,isSimpleCopiableExpression:()=>dz,isSimpleInlineableExpression:()=>pz,isSimpleParameterList:()=>Iz,isSingleOrDoubleQuote:()=>Wm,isSolutionConfig:()=>Sj,isSourceElement:()=>vC,isSourceFile:()=>dP,isSourceFileFromLibrary:()=>m0,isSourceFileJS:()=>Im,isSourceFileNotJson:()=>jm,isSourceMapping:()=>UJ,isSpecialPropertyDeclaration:()=>yg,isSpreadAssignment:()=>_P,isSpreadElement:()=>jF,isStatement:()=>hu,isStatementButNotDeclaration:()=>gu,isStatementOrBlock:()=>yu,isStatementWithLocals:()=>wd,isStatic:()=>Iv,isStaticModifier:()=>vD,isString:()=>tt,isStringANonContextualKeyword:()=>Oh,isStringAndEmptyAnonymousObjectIntersection:()=>jQ,isStringDoubleQuoted:()=>$m,isStringLiteral:()=>KN,isStringLiteralLike:()=>Ju,isStringLiteralOrJsxExpression:()=>Su,isStringLiteralOrTemplate:()=>wZ,isStringOrNumericLiteralLike:()=>Jh,isStringOrRegularExpressionOrTemplateLiteral:()=>OQ,isStringTextContainingNode:()=>Hl,isSuperCall:()=>pf,isSuperKeyword:()=>SD,isSuperProperty:()=>_m,isSupportedSourceFileName:()=>VS,isSwitchStatement:()=>lE,isSyntaxList:()=>nA,isSyntheticExpression:()=>VF,isSyntheticReference:()=>VE,isTagName:()=>TX,isTaggedTemplateExpression:()=>xF,isTaggedTemplateTag:()=>uX,isTemplateExpression:()=>OF,isTemplateHead:()=>YN,isTemplateLiteral:()=>z_,isTemplateLiteralKind:()=>Bl,isTemplateLiteralToken:()=>Jl,isTemplateLiteralTypeNode:()=>uF,isTemplateLiteralTypeSpan:()=>_F,isTemplateMiddle:()=>ZN,isTemplateMiddleOrTemplateTail:()=>zl,isTemplateSpan:()=>HF,isTemplateTail:()=>eD,isTextWhiteSpaceLike:()=>IY,isThis:()=>OX,isThisContainerOrFunctionBlock:()=>om,isThisIdentifier:()=>pv,isThisInTypeQuery:()=>mv,isThisInitializedDeclaration:()=>dm,isThisInitializedObjectBindingExpression:()=>pm,isThisProperty:()=>um,isThisTypeNode:()=>iF,isThisTypeParameter:()=>HT,isThisTypePredicate:()=>Hf,isThrowStatement:()=>uE,isToken:()=>Ol,isTokenKind:()=>Il,isTraceEnabled:()=>oM,isTransientSymbol:()=>ed,isTrivia:()=>jh,isTryStatement:()=>dE,isTupleTypeNode:()=>GD,isTypeAlias:()=>Ig,isTypeAliasDeclaration:()=>vE,isTypeAssertionExpression:()=>kF,isTypeDeclaration:()=>GT,isTypeElement:()=>x_,isTypeKeyword:()=>ZQ,isTypeKeywordTokenOrIdentifier:()=>tY,isTypeLiteralNode:()=>HD,isTypeNode:()=>T_,isTypeNodeKind:()=>Nx,isTypeOfExpression:()=>NF,isTypeOnlyExportDeclaration:()=>Vl,isTypeOnlyImportDeclaration:()=>Ul,isTypeOnlyImportOrExportDeclaration:()=>Wl,isTypeOperatorNode:()=>oF,isTypeParameterDeclaration:()=>DD,isTypePredicateNode:()=>qD,isTypeQueryNode:()=>$D,isTypeReferenceNode:()=>UD,isTypeReferenceType:()=>Mu,isTypeUsableAsPropertyName:()=>dC,isUMDExportSymbol:()=>kx,isUnaryExpression:()=>V_,isUnaryExpressionWithWrite:()=>$_,isUnicodeIdentifierStart:()=>Ea,isUnionTypeNode:()=>ZD,isUrl:()=>vo,isValidBigIntString:()=>TT,isValidESSymbolDeclaration:()=>Jf,isValidTypeOnlyAliasUseSite:()=>CT,isValueSignatureDeclaration:()=>ih,isVarAwaitUsing:()=>cf,isVarConst:()=>_f,isVarConstLike:()=>uf,isVarUsing:()=>lf,isVariableDeclaration:()=>fE,isVariableDeclarationInVariableStatement:()=>Mf,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>zm,isVariableDeclarationInitializedToRequire:()=>Jm,isVariableDeclarationList:()=>mE,isVariableLike:()=>jf,isVariableStatement:()=>XF,isVoidExpression:()=>DF,isWatchSet:()=>ax,isWhileStatement:()=>tE,isWhiteSpaceLike:()=>$a,isWhiteSpaceSingleLine:()=>Ha,isWithStatement:()=>cE,isWriteAccess:()=>px,isWriteOnlyAccess:()=>dx,isYieldExpression:()=>LF,jsxModeNeedsExplicitImport:()=>f0,keywordPart:()=>qY,last:()=>xe,lastOrUndefined:()=>be,length:()=>d,libMap:()=>LO,libs:()=>OO,lineBreakPart:()=>nZ,loadModuleFromGlobalCache:()=>GR,loadWithModeAwareCache:()=>OV,makeIdentifierFromModuleName:()=>lp,makeImport:()=>pY,makeStringLiteral:()=>fY,mangleScopedPackageName:()=>qR,map:()=>P,mapAllOrFail:()=>B,mapDefined:()=>J,mapDefinedIterator:()=>z,mapEntries:()=>$,mapIterator:()=>A,mapOneOrMany:()=>t0,mapToDisplayParts:()=>rZ,matchFiles:()=>kS,matchPatternOrExact:()=>lT,matchedText:()=>Gt,matchesExclude:()=>Hj,matchesExcludeWorker:()=>Kj,maxBy:()=>St,maybeBind:()=>He,maybeSetLocalizedDiagnosticMessages:()=>Kx,memoize:()=>ft,memoizeOne:()=>mt,min:()=>Tt,minAndMax:()=>dT,missingFileModifiedTime:()=>Ui,modifierToFlag:()=>Yv,modifiersToFlags:()=>Qv,moduleExportNameIsDefault:()=>Yd,moduleExportNameTextEscaped:()=>Qd,moduleExportNameTextUnescaped:()=>Xd,moduleOptionDeclaration:()=>BO,moduleResolutionIsEqualTo:()=>pd,moduleResolutionNameAndModeGetter:()=>FV,moduleResolutionOptionDeclarations:()=>WO,moduleResolutionSupportsPackageJsonExportsAndImports:()=>Uk,moduleResolutionUsesNodeModules:()=>dY,moduleSpecifierToValidIdentifier:()=>a0,moduleSpecifiers:()=>pB,moduleSupportsImportAttributes:()=>Vk,moduleSymbolToValidIdentifier:()=>o0,moveEmitHelpers:()=>Qw,moveRangeEnd:()=>Rb,moveRangePastDecorators:()=>Jb,moveRangePastModifiers:()=>zb,moveRangePos:()=>Bb,moveSyntheticComments:()=>Vw,mutateMap:()=>yx,mutateMapSkippingNewValues:()=>hx,needsParentheses:()=>kZ,needsScopeMarker:()=>Z_,newCaseClauseTracker:()=>g0,newPrivateEnvironment:()=>Dz,noEmitNotification:()=>eU,noEmitSubstitution:()=>Zq,noTransformers:()=>$q,noTruncationMaximumTruncationLength:()=>Gu,nodeCanBeDecorated:()=>gm,nodeCoreModules:()=>AC,nodeHasName:()=>Cc,nodeIsDecorated:()=>hm,nodeIsMissing:()=>Pd,nodeIsPresent:()=>Ad,nodeIsSynthesized:()=>iy,nodeModuleNameResolver:()=>ZM,nodeModulesPathPart:()=>oR,nodeNextJsonConfigResolver:()=>eR,nodeOrChildIsDecorated:()=>ym,nodeOverlapsWithStartEnd:()=>qX,nodePosToString:()=>Dd,nodeSeenTracker:()=>nY,nodeStartsNewLexicalEnvironment:()=>ry,noop:()=>ot,noopFileWatcher:()=>R$,normalizePath:()=>Vo,normalizeSlashes:()=>Ro,normalizeSpans:()=>Ks,not:()=>rn,notImplemented:()=>pt,notImplementedResolver:()=>DU,nullNodeConverters:()=>iw,nullParenthesizerRules:()=>tw,nullTransformationContext:()=>nU,objectAllocator:()=>qx,operatorPart:()=>VY,optionDeclarations:()=>zO,optionMapToObject:()=>YL,optionsAffectingProgramStructure:()=>HO,optionsForBuild:()=>eL,optionsForWatch:()=>jO,optionsHaveChanges:()=>od,or:()=>nn,orderedRemoveItem:()=>Ut,orderedRemoveItemAt:()=>Vt,packageIdToPackageName:()=>yd,packageIdToString:()=>vd,parameterIsThisKeyword:()=>dv,parameterNamePart:()=>WY,parseBaseNodeFactory:()=>AI,parseBigInt:()=>kT,parseBuildCommand:()=>kL,parseCommandLine:()=>hL,parseCommandLineWorker:()=>pL,parseConfigFileTextToJson:()=>wL,parseConfigFileWithSystem:()=>S$,parseConfigHostFromCompilerHostLike:()=>eW,parseCustomTypeOption:()=>lL,parseIsolatedEntityName:()=>lO,parseIsolatedJSDocComment:()=>pO,parseJSDocTypeExpressionForTests:()=>fO,parseJsonConfigFileContent:()=>sj,parseJsonSourceFileConfigFileContent:()=>cj,parseJsonText:()=>_O,parseListTypeOption:()=>_L,parseNodeFactory:()=>II,parseNodeModuleFromPath:()=>sR,parsePackageName:()=>wR,parsePseudoBigInt:()=>bT,parseValidBigInt:()=>ST,pasteEdits:()=>Lfe,patchWriteFileEnsuringDirectory:()=>_o,pathContainsNodeModules:()=>aR,pathIsAbsolute:()=>ko,pathIsBareSpecifier:()=>To,pathIsRelative:()=>So,patternText:()=>Kt,performIncrementalCompilation:()=>Q$,performance:()=>$n,positionBelongsToNode:()=>VX,positionIsASICandidate:()=>jZ,positionIsSynthesized:()=>tT,positionsAreOnSameLine:()=>Qb,preProcessFile:()=>O1,probablyUsesSemicolons:()=>MZ,processCommentPragmas:()=>xO,processPragmasIntoFields:()=>kO,processTaggedTemplateExpression:()=>rq,programContainsEsModules:()=>cY,programContainsModules:()=>sY,projectReferenceIsEqualTo:()=>dd,propertyNamePart:()=>$Y,pseudoBigIntToString:()=>xT,punctuationPart:()=>UY,pushIfUnique:()=>_e,quote:()=>TZ,quotePreferenceFromString:()=>gY,rangeContainsPosition:()=>RX,rangeContainsPositionExclusive:()=>BX,rangeContainsRange:()=>tx,rangeContainsRangeExclusive:()=>MX,rangeContainsStartEnd:()=>JX,rangeEndIsOnSameLineAsRangeStart:()=>Hb,rangeEndPositionsAreOnSameLine:()=>Wb,rangeEquals:()=>fe,rangeIsOnSingleLine:()=>Ub,rangeOfNode:()=>pT,rangeOfTypeParameters:()=>fT,rangeOverlapsWithStartEnd:()=>zX,rangeStartIsOnSameLineAsRangeEnd:()=>$b,rangeStartPositionsAreOnSameLine:()=>Vb,readBuilderProgram:()=>Y$,readConfigFile:()=>CL,readJson:()=>Pb,readJsonConfigFile:()=>NL,readJsonOrUndefined:()=>Eb,reduceEachLeadingCommentRange:()=>us,reduceEachTrailingCommentRange:()=>ds,reduceLeft:()=>De,reduceLeftIterator:()=>h,reducePathComponents:()=>Bo,refactor:()=>f6,regExpEscape:()=>aS,regularExpressionFlagToCharacterCode:()=>ja,relativeComplement:()=>oe,removeAllComments:()=>Cw,removeEmitHelper:()=>Gw,removeExtension:()=>XS,removeFileExtension:()=>KS,removeIgnoredPath:()=>e$,removeMinAndVersionNumbers:()=>qt,removePrefix:()=>Yt,removeSuffix:()=>Jt,removeTrailingDirectorySeparator:()=>Ko,repeatString:()=>iY,replaceElement:()=>Ce,replaceFirstStar:()=>hC,resolutionExtensionIsTSOrJson:()=>rT,resolveConfigFileProjectName:()=>iH,resolveJSModule:()=>GM,resolveLibrary:()=>WM,resolveModuleName:()=>HM,resolveModuleNameFromCache:()=>$M,resolvePackageNameToPackageJson:()=>DM,resolvePath:()=>zo,resolveProjectReferencePath:()=>tW,resolveTripleslashReference:()=>QU,resolveTypeReferenceDirective:()=>CM,resolvingEmptyArray:()=>$u,returnFalse:()=>at,returnNoopFileWatcher:()=>B$,returnTrue:()=>st,returnUndefined:()=>ct,returnsPromise:()=>U1,rewriteModuleSpecifier:()=>Oz,sameFlatMap:()=>R,sameMap:()=>I,sameMapping:()=>qJ,scanTokenAtPosition:()=>ef,scanner:()=>rX,semanticDiagnosticsOptionDeclarations:()=>qO,serializeCompilerOptions:()=>nj,server:()=>Khe,servicesVersion:()=>M8,setCommentRange:()=>Mw,setConfigFileInOptions:()=>lj,setConstantValue:()=>$w,setEmitFlags:()=>ww,setGetSourceFileAsHashVersioned:()=>W$,setIdentifierAutoGenerate:()=>oN,setIdentifierGeneratedImportReference:()=>sN,setIdentifierTypeArguments:()=>rN,setInternalEmitFlags:()=>Dw,setLocalizedDiagnosticMessages:()=>Hx,setNodeChildren:()=>aA,setNodeFlags:()=>AT,setObjectAllocator:()=>Wx,setOriginalNode:()=>kw,setParent:()=>IT,setParentRecursive:()=>OT,setPrivateIdentifier:()=>Ez,setSnippetElement:()=>Zw,setSourceMapRange:()=>Pw,setStackTraceLimit:()=>Ji,setStartsOnNewLine:()=>Lw,setSyntheticLeadingComments:()=>Bw,setSyntheticTrailingComments:()=>qw,setSys:()=>po,setSysLog:()=>io,setTextRange:()=>FI,setTextRangeEnd:()=>FT,setTextRangePos:()=>DT,setTextRangePosEnd:()=>ET,setTextRangePosWidth:()=>PT,setTokenSourceMapRange:()=>Iw,setTypeNode:()=>tN,setUILocale:()=>It,setValueDeclaration:()=>vg,shouldAllowImportingTsExtension:()=>KR,shouldPreserveConstEnums:()=>Ok,shouldRewriteModuleSpecifier:()=>Cg,shouldUseUriStyleNodeCoreModules:()=>_0,showModuleSpecifier:()=>Sx,signatureHasRestParameter:()=>hJ,signatureToDisplayParts:()=>aZ,single:()=>Se,singleElementArray:()=>an,singleIterator:()=>V,singleOrMany:()=>Te,singleOrUndefined:()=>ke,skipAlias:()=>_x,skipConstraint:()=>oY,skipOuterExpressions:()=>AA,skipParentheses:()=>_h,skipPartiallyEmittedExpressions:()=>Nl,skipTrivia:()=>ts,skipTypeChecking:()=>mT,skipTypeCheckingIgnoringNoCheck:()=>gT,skipTypeParentheses:()=>lh,skipWhile:()=>un,sliceAfter:()=>_T,some:()=>H,sortAndDeduplicate:()=>ne,sortAndDeduplicateDiagnostics:()=>Es,sourceFileAffectingCompilerOptions:()=>$O,sourceFileMayBeEmitted:()=>ev,sourceMapCommentRegExp:()=>LJ,sourceMapCommentRegExpDontCareLineStart:()=>OJ,spacePart:()=>zY,spanMap:()=>W,startEndContainsRange:()=>nx,startEndOverlapsWithStartEnd:()=>UX,startOnNewLine:()=>OA,startTracing:()=>fr,startsWith:()=>Qt,startsWithDirectory:()=>oa,startsWithUnderscore:()=>c0,startsWithUseStrict:()=>wA,stringContainsAt:()=>s0,stringToToken:()=>Oa,stripQuotes:()=>Iy,supportedDeclarationExtensions:()=>OS,supportedJSExtensionsFlat:()=>PS,supportedLocaleDirectories:()=>dc,supportedTSExtensionsFlat:()=>DS,supportedTSImplementationExtensions:()=>LS,suppressLeadingAndTrailingTrivia:()=>KC,suppressLeadingTrivia:()=>GC,suppressTrailingTrivia:()=>XC,symbolEscapedNameNoDefault:()=>bY,symbolName:()=>kc,symbolNameNoDefault:()=>vY,symbolToDisplayParts:()=>oZ,sys:()=>uo,sysLog:()=>ro,tagNamesAreEquivalent:()=>FO,takeWhile:()=>_n,targetOptionDeclaration:()=>RO,targetToLibMap:()=>Ps,testFormatSettings:()=>$G,textChangeRangeIsUnchanged:()=>Ys,textChangeRangeNewSpan:()=>Qs,textChanges:()=>ide,textOrKeywordPart:()=>HY,textPart:()=>KY,textRangeContainsPositionInclusive:()=>js,textRangeContainsTextSpan:()=>Bs,textRangeIntersectsWithTextSpan:()=>$s,textSpanContainsPosition:()=>Ls,textSpanContainsTextRange:()=>Rs,textSpanContainsTextSpan:()=>Ms,textSpanEnd:()=>Is,textSpanIntersection:()=>Hs,textSpanIntersectsWith:()=>Us,textSpanIntersectsWithPosition:()=>Ws,textSpanIntersectsWithTextSpan:()=>qs,textSpanIsEmpty:()=>Os,textSpanOverlap:()=>zs,textSpanOverlapsWith:()=>Js,textSpansEqual:()=>FY,textToKeywordObj:()=>ha,timestamp:()=>Wn,toArray:()=>et,toBuilderFileEmit:()=>WW,toBuilderStateFileInfoForMultiEmit:()=>VW,toEditorSettings:()=>e7,toFileNameLowerCase:()=>dt,toPath:()=>Ho,toProgramEmitPending:()=>$W,toSorted:()=>de,tokenIsIdentifierOrKeyword:()=>ma,tokenIsIdentifierOrKeywordOrGreaterThan:()=>ga,tokenToString:()=>Ia,trace:()=>iM,tracing:()=>Gn,tracingEnabled:()=>Xn,transferSourceFileChildren:()=>cA,transform:()=>v7,transformClassFields:()=>cq,transformDeclarations:()=>Uq,transformECMAScriptModule:()=>Oq,transformES2015:()=>Fq,transformES2016:()=>Nq,transformES2017:()=>pq,transformES2018:()=>mq,transformES2019:()=>gq,transformES2020:()=>hq,transformES2021:()=>yq,transformESDecorators:()=>dq,transformESNext:()=>vq,transformGenerators:()=>Eq,transformImpliedNodeFormatDependentModule:()=>Lq,transformJsx:()=>Cq,transformLegacyDecorators:()=>uq,transformModule:()=>Pq,transformNamedEvaluation:()=>tq,transformNodes:()=>tU,transformSystemModule:()=>Iq,transformTypeScript:()=>sq,transpile:()=>o2,transpileDeclaration:()=>Z1,transpileModule:()=>Y1,transpileOptionValueCompilerOptions:()=>KO,tryAddToSet:()=>U,tryAndIgnoreErrors:()=>qZ,tryCast:()=>rt,tryDirectoryExists:()=>zZ,tryExtractTSExtension:()=>Cb,tryFileExists:()=>JZ,tryGetClassExtendingExpressionWithTypeArguments:()=>ab,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>sb,tryGetDirectories:()=>RZ,tryGetExtensionFromPath:()=>aT,tryGetImportFromModuleSpecifier:()=>Tg,tryGetJSDocSatisfiesTypeNode:()=>oC,tryGetModuleNameFromFile:()=>JA,tryGetModuleSpecifierFromDeclaration:()=>kg,tryGetNativePerformanceHooks:()=>qn,tryGetPropertyAccessOrIdentifierToString:()=>mb,tryGetPropertyNameOfBindingOrAssignmentElement:()=>WA,tryGetSourceMappingURL:()=>RJ,tryGetTextOfPropertyName:()=>Bp,tryParseJson:()=>Ab,tryParsePattern:()=>YS,tryParsePatterns:()=>eT,tryParseRawSourceMap:()=>JJ,tryReadDirectory:()=>BZ,tryReadFile:()=>DL,tryRemoveDirectoryPrefix:()=>iS,tryRemoveExtension:()=>GS,tryRemovePrefix:()=>Zt,tryRemoveSuffix:()=>zt,tscBuildOption:()=>ZO,typeAcquisitionDeclarations:()=>nL,typeAliasNamePart:()=>GY,typeDirectiveIsEqualTo:()=>bd,typeKeywords:()=>YQ,typeParameterNamePart:()=>XY,typeToDisplayParts:()=>iZ,unchangedPollThresholds:()=>Ki,unchangedTextChangeRange:()=>ec,unescapeLeadingUnderscores:()=>vc,unmangleScopedPackageName:()=>VR,unorderedRemoveItem:()=>$t,unprefixedNodeCoreModules:()=>EC,unreachableCodeIsError:()=>zk,unsetNodeChildren:()=>sA,unusedLabelIsError:()=>qk,unwrapInnermostStatementOfLabel:()=>qf,unwrapParenthesizedExpression:()=>wC,updateErrorForNoInputFiles:()=>Cj,updateLanguageServiceSourceFile:()=>c7,updateMissingFilePathsWatch:()=>qU,updateResolutionField:()=>fM,updateSharedExtendedConfigFileWatcher:()=>BU,updateSourceFile:()=>dO,updateWatchingWildcardDirectories:()=>UU,usingSingleLineStringWriter:()=>_d,utf16EncodeAsString:()=>Ts,validateLocaleAndSetLanguage:()=>pc,version:()=>c,versionMajorMinor:()=>s,visitArray:()=>kJ,visitCommaListElements:()=>FJ,visitEachChild:()=>EJ,visitFunctionBody:()=>NJ,visitIterationBody:()=>DJ,visitLexicalEnvironment:()=>TJ,visitNode:()=>bJ,visitNodes:()=>xJ,visitParameterList:()=>CJ,walkUpBindingElementsAndPatterns:()=>ac,walkUpOuterExpressions:()=>IA,walkUpParenthesizedExpressions:()=>sh,walkUpParenthesizedTypes:()=>ah,walkUpParenthesizedTypesAndGetParentAndChild:()=>ch,whitespaceOrMapCommentRegExp:()=>jJ,writeCommentRange:()=>wv,writeFile:()=>rv,writeFileEnsuringDirectories:()=>ov,zipWith:()=>y}),e.exports=a;var s="5.9",c="5.9.2",l=(e=>(e[e.LessThan=-1]="LessThan",e[e.EqualTo=0]="EqualTo",e[e.GreaterThan=1]="GreaterThan",e))(l||{}),_=[],u=new Map;function d(e){return void 0!==e?e.length:0}function p(e,t){if(void 0!==e)for(let n=0;n=0;n--){const r=t(e[n],n);if(r)return r}}function m(e,t){if(void 0!==e)for(let n=0;n=0;r--){const n=e[r];if(t(n,r))return n}}function S(e,t,n){if(void 0===e)return-1;for(let r=n??0;r=0;r--)if(t(e[r],r))return r;return-1}function C(e,t,n=ht){if(void 0!==e)for(let r=0;r{const[i,o]=t(r,e);n.set(i,o)}),n}function H(e,t){if(void 0!==e){if(void 0===t)return e.length>0;for(let n=0;nn(e[t],e[r])||xt(t,r))}(e,r,n);let i=e[r[0]];const o=[r[0]];for(let n=1;ne[t])}function Z(e,t,n){return 0===e.length?[]:1===e.length?e.slice():n?Y(e,t,n):function(e,t){const n=[];for(let r=0;r0&&r(t,e[n-1]))return!1;if(n0&&pn.assertGreaterThanOrEqual(n(t[o],t[o-1]),0);t:for(const a=i;ia&&pn.assertGreaterThanOrEqual(n(e[i],e[i-1]),0),n(t[o],e[i])){case-1:r.push(t[o]);continue e;case 0:continue e;case 1:continue t}}return r}function ae(e,t){return void 0===t?e:void 0===e?[t]:(e.push(t),e)}function se(e,t){return void 0===e?t:void 0===t?e:Ze(e)?Ze(t)?G(e,t):ae(e,t):Ze(t)?ae(t,e):[e,t]}function ce(e,t){return t<0?e.length+t:t}function le(e,t,n,r){if(void 0===t||0===t.length)return e;if(void 0===e)return t.slice(n,r);n=void 0===n?0:ce(t,n),r=void 0===r?t.length:ce(t,r);for(let i=n;i=0;t--)yield e[t]}function fe(e,t,n,r){for(;nnull==e?void 0:e.at(t):(e,t)=>{if(void 0!==e&&(t=ce(e,t))>1);switch(r(n(e[i],i),t)){case-1:o=i+1;break;case 0:return i;case 1:a=i-1}}return~o}function De(e,t,n,r,i){if(e&&e.length>0){const o=e.length;if(o>0){let a=void 0===r||r<0?0:r;const s=void 0===i||a+i>o-1?o-1:a+i;let c;for(arguments.length<=2?(c=e[a],a++):c=n;a<=s;)c=t(c,e[a],a),a++;return c}}return n}var Fe=Object.prototype.hasOwnProperty;function Ee(e,t){return Fe.call(e,t)}function Pe(e,t){return Fe.call(e,t)?e[t]:void 0}function Ae(e){const t=[];for(const n in e)Fe.call(e,n)&&t.push(n);return t}function Ie(e){const t=[];do{const n=Object.getOwnPropertyNames(e);for(const e of n)_e(t,e)}while(e=Object.getPrototypeOf(e));return t}function Oe(e){const t=[];for(const n in e)Fe.call(e,n)&&t.push(e[n]);return t}function Le(e,t){const n=new Array(e);for(let r=0;r100&&n>t.length>>1){const e=t.length-n;t.copyWithin(0,n),t.length=e,n=0}return e},isEmpty:r}}function Ye(e,t){const n=new Map;let r=0;function*i(){for(const e of n.values())Ze(e)?yield*e:yield e}const o={has(r){const i=e(r);if(!n.has(i))return!1;const o=n.get(i);return Ze(o)?C(o,r,t):t(o,r)},add(i){const o=e(i);if(n.has(o)){const e=n.get(o);if(Ze(e))C(e,i,t)||(e.push(i),r++);else{const a=e;t(a,i)||(n.set(o,[a,i]),r++)}}else n.set(o,i),r++;return this},delete(i){const o=e(i);if(!n.has(o))return!1;const a=n.get(o);if(Ze(a)){for(let e=0;ei(),values:()=>i(),*entries(){for(const e of i())yield[e,e]},[Symbol.iterator]:()=>i(),[Symbol.toStringTag]:n[Symbol.toStringTag]};return o}function Ze(e){return Array.isArray(e)}function et(e){return Ze(e)?e:[e]}function tt(e){return"string"==typeof e}function nt(e){return"number"==typeof e}function rt(e,t){return void 0!==e&&t(e)?e:void 0}function it(e,t){return void 0!==e&&t(e)?e:pn.fail(`Invalid cast. The supplied value ${e} did not pass the test '${pn.getFunctionName(t)}'.`)}function ot(e){}function at(){return!1}function st(){return!0}function ct(){}function lt(e){return e}function _t(e){return e.toLowerCase()}var ut=/[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;function dt(e){return ut.test(e)?e.replace(ut,_t):e}function pt(){throw new Error("Not implemented")}function ft(e){let t;return()=>(e&&(t=e(),e=void 0),t)}function mt(e){const t=new Map;return n=>{const r=`${typeof n}:${n}`;let i=t.get(r);return void 0!==i||t.has(r)||(i=e(n),t.set(r,i)),i}}var gt=(e=>(e[e.None=0]="None",e[e.Normal=1]="Normal",e[e.Aggressive=2]="Aggressive",e[e.VeryAggressive=3]="VeryAggressive",e))(gt||{});function ht(e,t){return e===t}function yt(e,t){return e===t||void 0!==e&&void 0!==t&&e.toUpperCase()===t.toUpperCase()}function vt(e,t){return ht(e,t)}function bt(e,t){return e===t?0:void 0===e?-1:void 0===t?1:e-1===t(e,n)?e:n)}function Ct(e,t){return e===t?0:void 0===e?-1:void 0===t?1:(e=e.toUpperCase())<(t=t.toUpperCase())?-1:e>t?1:0}function wt(e,t){return e===t?0:void 0===e?-1:void 0===t?1:(e=e.toLowerCase())<(t=t.toLowerCase())?-1:e>t?1:0}function Nt(e,t){return bt(e,t)}function Dt(e){return e?Ct:Nt}var Ft,Et,Pt=(()=>function(e){const t=new Intl.Collator(e,{usage:"sort",sensitivity:"variant",numeric:!0}).compare;return(e,n)=>function(e,t,n){if(e===t)return 0;if(void 0===e)return-1;if(void 0===t)return 1;const r=n(e,t);return r<0?-1:r>0?1:0}(e,n,t)})();function At(){return Et}function It(e){Et!==e&&(Et=e,Ft=void 0)}function Ot(e,t){return Ft??(Ft=Pt(Et)),Ft(e,t)}function Lt(e,t,n,r){return e===t?0:void 0===e?-1:void 0===t?1:r(e[n],t[n])}function jt(e,t){return xt(e?1:0,t?1:0)}function Mt(e,t,n){const r=Math.max(2,Math.floor(.34*e.length));let i,o=Math.floor(.4*e.length)+1;for(const a of t){const t=n(a);if(void 0!==t&&Math.abs(t.length-e.length)<=r){if(t===e)continue;if(t.length<3&&t.toLowerCase()!==e.toLowerCase())continue;const n=Rt(e,t,o-.1);if(void 0===n)continue;pn.assert(nn?a-n:1),l=Math.floor(t.length>n+a?n+a:t.length);i[0]=a;let _=a;for(let e=1;en)return;const u=r;r=i,i=u}const a=r[t.length];return a>n?void 0:a}function Bt(e,t,n){const r=e.length-t.length;return r>=0&&(n?yt(e.slice(r),t):e.indexOf(t,r)===r)}function Jt(e,t){return Bt(e,t)?e.slice(0,e.length-t.length):e}function zt(e,t){return Bt(e,t)?e.slice(0,e.length-t.length):void 0}function qt(e){let t=e.length;for(let n=t-1;n>0;n--){let r=e.charCodeAt(n);if(r>=48&&r<=57)do{--n,r=e.charCodeAt(n)}while(n>0&&r>=48&&r<=57);else{if(!(n>4)||110!==r&&78!==r)break;if(--n,r=e.charCodeAt(n),105!==r&&73!==r)break;if(--n,r=e.charCodeAt(n),109!==r&&77!==r)break;--n,r=e.charCodeAt(n)}if(45!==r&&46!==r)break;t=n}return t===e.length?e:e.slice(0,t)}function Ut(e,t){for(let n=0;ne===t)}function Ht(e){return e?lt:dt}function Kt({prefix:e,suffix:t}){return`${e}*${t}`}function Gt(e,t){return pn.assert(en(e,t)),t.substring(e.prefix.length,t.length-e.suffix.length)}function Xt(e,t,n){let r,i=-1;for(let o=0;oi&&en(s,n)&&(i=s.prefix.length,r=a)}return r}function Qt(e,t,n){return n?yt(e.slice(0,t.length),t):0===e.lastIndexOf(t,0)}function Yt(e,t){return Qt(e,t)?e.substr(t.length):e}function Zt(e,t,n=lt){return Qt(n(e),n(t))?e.substring(t.length):void 0}function en({prefix:e,suffix:t},n){return n.length>=e.length+t.length&&Qt(n,e)&&Bt(n,t)}function tn(e,t){return n=>e(n)&&t(n)}function nn(...e){return(...t)=>{let n;for(const r of e)if(n=r(...t),n)return n;return n}}function rn(e){return(...t)=>!e(...t)}function on(e){}function an(e){return void 0===e?void 0:[e]}function sn(e,t,n,r,i,o){o??(o=ot);let a=0,s=0;const c=e.length,l=t.length;let _=!1;for(;a(e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose",e))(fn||{});(e=>{let t=0;function n(t){return e.currentLogLevel<=t}function r(t,r){e.loggingHost&&n(t)&&e.loggingHost.log(t,r)}function i(e){r(3,e)}var o;e.currentLogLevel=2,e.isDebugging=!1,e.shouldLog=n,e.log=i,(o=i=e.log||(e.log={})).error=function(e){r(1,e)},o.warn=function(e){r(2,e)},o.log=function(e){r(3,e)},o.trace=function(e){r(4,e)};const a={};function s(e){return t>=e}function c(t,n){return!!s(t)||(a[n]={level:t,assertion:e[n]},e[n]=ot,!1)}function l(e,t){const n=new Error(e?`Debug Failure. ${e}`:"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(n,t||l),n}function _(e,t,n,r){e||(t=t?`False expression: ${t}`:"False expression.",n&&(t+="\r\nVerbose Debug Information: "+("string"==typeof n?n:n())),l(t,r||_))}function u(e,t,n){null==e&&l(t,n||u)}function d(e,t,n){for(const r of e)u(r,t,n||d)}function p(e,t="Illegal value:",n){return l(`${t} ${"object"==typeof e&&Ee(e,"kind")&&Ee(e,"pos")?"SyntaxKind: "+v(e.kind):JSON.stringify(e)}`,n||p)}function f(e){}function m(e){if("function"!=typeof e)return"";if(Ee(e,"name"))return e.name;{const t=Function.prototype.toString.call(e),n=/^function\s+([\w$]+)\s*\(/.exec(t);return n?n[1]:""}}function g(e=0,t,n){const r=function(e){const t=h.get(e);if(t)return t;const n=[];for(const t in e){const r=e[t];"number"==typeof r&&n.push([r,t])}const r=de(n,(e,t)=>xt(e[0],t[0]));return h.set(e,r),r}(t);if(0===e)return r.length>0&&0===r[0][0]?r[0][1]:"0";if(n){const t=[];let n=e;for(const[i,o]of r){if(i>e)break;0!==i&&i&e&&(t.push(o),n&=~i)}if(0===n)return t.join("|")}else for(const[t,n]of r)if(t===e)return n;return e.toString()}e.getAssertionLevel=function(){return t},e.setAssertionLevel=function(n){const r=t;if(t=n,n>r)for(const t of Ae(a)){const r=a[t];void 0!==r&&e[t]!==r.assertion&&n>=r.level&&(e[t]=r,a[t]=void 0)}},e.shouldAssert=s,e.fail=l,e.failBadSyntaxKind=function e(t,n,r){return l(`${n||"Unexpected node."}\r\nNode ${v(t.kind)} was unexpected.`,r||e)},e.assert=_,e.assertEqual=function e(t,n,r,i,o){if(t!==n){l(`Expected ${t} === ${n}. ${r?i?`${r} ${i}`:r:""}`,o||e)}},e.assertLessThan=function e(t,n,r,i){t>=n&&l(`Expected ${t} < ${n}. ${r||""}`,i||e)},e.assertLessThanOrEqual=function e(t,n,r){t>n&&l(`Expected ${t} <= ${n}`,r||e)},e.assertGreaterThanOrEqual=function e(t,n,r){t= ${n}`,r||e)},e.assertIsDefined=u,e.checkDefined=function e(t,n,r){return u(t,n,r||e),t},e.assertEachIsDefined=d,e.checkEachDefined=function e(t,n,r){return d(t,n,r||e),t},e.assertNever=p,e.assertEachNode=function e(t,n,r,i){c(1,"assertEachNode")&&_(void 0===n||b(t,n),r||"Unexpected node.",()=>`Node array did not pass test '${m(n)}'.`,i||e)},e.assertNode=function e(t,n,r,i){c(1,"assertNode")&&_(void 0!==t&&(void 0===n||n(t)),r||"Unexpected node.",()=>`Node ${v(null==t?void 0:t.kind)} did not pass test '${m(n)}'.`,i||e)},e.assertNotNode=function e(t,n,r,i){c(1,"assertNotNode")&&_(void 0===t||void 0===n||!n(t),r||"Unexpected node.",()=>`Node ${v(t.kind)} should not have passed test '${m(n)}'.`,i||e)},e.assertOptionalNode=function e(t,n,r,i){c(1,"assertOptionalNode")&&_(void 0===n||void 0===t||n(t),r||"Unexpected node.",()=>`Node ${v(null==t?void 0:t.kind)} did not pass test '${m(n)}'.`,i||e)},e.assertOptionalToken=function e(t,n,r,i){c(1,"assertOptionalToken")&&_(void 0===n||void 0===t||t.kind===n,r||"Unexpected node.",()=>`Node ${v(null==t?void 0:t.kind)} was not a '${v(n)}' token.`,i||e)},e.assertMissingNode=function e(t,n,r){c(1,"assertMissingNode")&&_(void 0===t,n||"Unexpected node.",()=>`Node ${v(t.kind)} was unexpected'.`,r||e)},e.type=f,e.getFunctionName=m,e.formatSymbol=function(e){return`{ name: ${vc(e.escapedName)}; flags: ${C(e.flags)}; declarations: ${P(e.declarations,e=>v(e.kind))} }`},e.formatEnum=g;const h=new Map;function v(e){return g(e,gr,!1)}function x(e){return g(e,hr,!0)}function k(e){return g(e,yr,!0)}function S(e){return g(e,wi,!0)}function T(e){return g(e,Di,!0)}function C(e){return g(e,Vr,!0)}function w(e){return g(e,Kr,!0)}function N(e){return g(e,ni,!0)}function D(e){return g(e,Gr,!0)}function F(e){return g(e,Cr,!0)}e.formatSyntaxKind=v,e.formatSnippetKind=function(e){return g(e,Ni,!1)},e.formatScriptKind=function(e){return g(e,bi,!1)},e.formatNodeFlags=x,e.formatNodeCheckFlags=function(e){return g(e,Hr,!0)},e.formatModifierFlags=k,e.formatTransformFlags=S,e.formatEmitFlags=T,e.formatSymbolFlags=C,e.formatTypeFlags=w,e.formatSignatureFlags=N,e.formatObjectFlags=D,e.formatFlowFlags=F,e.formatRelationComparisonResult=function(e){return g(e,br,!0)},e.formatCheckMode=function(e){return g(e,iJ,!0)},e.formatSignatureCheckMode=function(e){return g(e,oJ,!0)},e.formatTypeFacts=function(e){return g(e,nJ,!0)};let E,A,I=!1;function O(e){"__debugFlowFlags"in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value(){const e=2&this.flags?"FlowStart":4&this.flags?"FlowBranchLabel":8&this.flags?"FlowLoopLabel":16&this.flags?"FlowAssignment":32&this.flags?"FlowTrueCondition":64&this.flags?"FlowFalseCondition":128&this.flags?"FlowSwitchClause":256&this.flags?"FlowArrayMutation":512&this.flags?"FlowCall":1024&this.flags?"FlowReduceLabel":1&this.flags?"FlowUnreachable":"UnknownFlow",t=-2048&this.flags;return`${e}${t?` (${F(t)})`:""}`}},__debugFlowFlags:{get(){return g(this.flags,Cr,!0)}},__debugToString:{value(){return M(this)}}})}function L(e){"__tsDebuggerDisplay"in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value:e=>`NodeArray ${e=String(e).replace(/(?:,[\s\w]+:[^,]+)+\]$/,"]")}`}})}e.attachFlowNodeDebugInfo=function(e){return I&&("function"==typeof Object.setPrototypeOf?(E||(E=Object.create(Object.prototype),O(E)),Object.setPrototypeOf(e,E)):O(e)),e},e.attachNodeArrayDebugInfo=function(e){I&&("function"==typeof Object.setPrototypeOf?(A||(A=Object.create(Array.prototype),L(A)),Object.setPrototypeOf(e,A)):L(e))},e.enableDebugInfo=function(){if(I)return;const e=new WeakMap,t=new WeakMap;Object.defineProperties(qx.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value(){const e=33554432&this.flags?"TransientSymbol":"Symbol",t=-33554433&this.flags;return`${e} '${kc(this)}'${t?` (${C(t)})`:""}`}},__debugFlags:{get(){return C(this.flags)}}}),Object.defineProperties(qx.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value(){const e=67359327&this.flags?`IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName?` (${this.debugIntrinsicName})`:""}`:98304&this.flags?"NullableType":384&this.flags?`LiteralType ${JSON.stringify(this.value)}`:2048&this.flags?`LiteralType ${this.value.negative?"-":""}${this.value.base10Value}n`:8192&this.flags?"UniqueESSymbolType":32&this.flags?"EnumType":1048576&this.flags?"UnionType":2097152&this.flags?"IntersectionType":4194304&this.flags?"IndexType":8388608&this.flags?"IndexedAccessType":16777216&this.flags?"ConditionalType":33554432&this.flags?"SubstitutionType":262144&this.flags?"TypeParameter":524288&this.flags?3&this.objectFlags?"InterfaceType":4&this.objectFlags?"TypeReference":8&this.objectFlags?"TupleType":16&this.objectFlags?"AnonymousType":32&this.objectFlags?"MappedType":1024&this.objectFlags?"ReverseMappedType":256&this.objectFlags?"EvolvingArrayType":"ObjectType":"Type",t=524288&this.flags?-1344&this.objectFlags:0;return`${e}${this.symbol?` '${kc(this.symbol)}'`:""}${t?` (${D(t)})`:""}`}},__debugFlags:{get(){return w(this.flags)}},__debugObjectFlags:{get(){return 524288&this.flags?D(this.objectFlags):""}},__debugTypeToString:{value(){let t=e.get(this);return void 0===t&&(t=this.checker.typeToString(this),e.set(this,t)),t}}}),Object.defineProperties(qx.getSignatureConstructor().prototype,{__debugFlags:{get(){return N(this.flags)}},__debugSignatureToString:{value(){var e;return null==(e=this.checker)?void 0:e.signatureToString(this)}}});const n=[qx.getNodeConstructor(),qx.getIdentifierConstructor(),qx.getTokenConstructor(),qx.getSourceFileConstructor()];for(const e of n)Ee(e.prototype,"__debugKind")||Object.defineProperties(e.prototype,{__tsDebuggerDisplay:{value(){return`${Gl(this)?"GeneratedIdentifier":uD(this)?`Identifier '${bc(this)}'`:dD(this)?`PrivateIdentifier '${bc(this)}'`:KN(this)?`StringLiteral ${JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")}`:$N(this)?`NumericLiteral ${this.text}`:HN(this)?`BigIntLiteral ${this.text}n`:DD(this)?"TypeParameterDeclaration":FD(this)?"ParameterDeclaration":jD(this)?"ConstructorDeclaration":MD(this)?"GetAccessorDeclaration":RD(this)?"SetAccessorDeclaration":BD(this)?"CallSignatureDeclaration":JD(this)?"ConstructSignatureDeclaration":zD(this)?"IndexSignatureDeclaration":qD(this)?"TypePredicateNode":UD(this)?"TypeReferenceNode":VD(this)?"FunctionTypeNode":WD(this)?"ConstructorTypeNode":$D(this)?"TypeQueryNode":HD(this)?"TypeLiteralNode":KD(this)?"ArrayTypeNode":GD(this)?"TupleTypeNode":QD(this)?"OptionalTypeNode":YD(this)?"RestTypeNode":ZD(this)?"UnionTypeNode":eF(this)?"IntersectionTypeNode":tF(this)?"ConditionalTypeNode":nF(this)?"InferTypeNode":rF(this)?"ParenthesizedTypeNode":iF(this)?"ThisTypeNode":oF(this)?"TypeOperatorNode":aF(this)?"IndexedAccessTypeNode":sF(this)?"MappedTypeNode":cF(this)?"LiteralTypeNode":XD(this)?"NamedTupleMember":lF(this)?"ImportTypeNode":v(this.kind)}${this.flags?` (${x(this.flags)})`:""}`}},__debugKind:{get(){return v(this.kind)}},__debugNodeFlags:{get(){return x(this.flags)}},__debugModifierFlags:{get(){return k(Gv(this))}},__debugTransformFlags:{get(){return S(this.transformFlags)}},__debugIsParseTreeNode:{get(){return gc(this)}},__debugEmitFlags:{get(){return T(rp(this))}},__debugGetText:{value(e){if(iy(this))return"";let n=t.get(this);if(void 0===n){const r=hc(this),i=r&&Sd(r);n=i?Kd(i,r,e):"",t.set(this,n)}return n}}});I=!0},e.formatVariance=function(e){const t=7&e;let n=0===t?"in out":3===t?"[bivariant]":2===t?"in":1===t?"out":4===t?"[independent]":"";return 8&e?n+=" (unmeasurable)":16&e&&(n+=" (unreliable)"),n};class j{__debugToString(){var e;switch(this.kind){case 3:return(null==(e=this.debugInfo)?void 0:e.call(this))||"(function mapper)";case 0:return`${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;case 1:return y(this.sources,this.targets||P(this.sources,()=>"any"),(e,t)=>`${e.__debugTypeToString()} -> ${"string"==typeof t?t:t.__debugTypeToString()}`).join(", ");case 2:return y(this.sources,this.targets,(e,t)=>`${e.__debugTypeToString()} -> ${t().__debugTypeToString()}`).join(", ");case 5:case 4:return`m1: ${this.mapper1.__debugToString().split("\n").join("\n ")}\nm2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`;default:return p(this)}}}function M(e){let t,n=-1;function r(e){return e.id||(e.id=n,n--),e.id}var i;let o;var a;(i=t||(t={})).lr="─",i.ud="│",i.dr="╭",i.dl="╮",i.ul="╯",i.ur="╰",i.udr="├",i.udl="┤",i.dlr="┬",i.ulr="┴",i.udlr="╫",(a=o||(o={}))[a.None=0]="None",a[a.Up=1]="Up",a[a.Down=2]="Down",a[a.Left=4]="Left",a[a.Right=8]="Right",a[a.UpDown=3]="UpDown",a[a.LeftRight=12]="LeftRight",a[a.UpLeft=5]="UpLeft",a[a.UpRight=9]="UpRight",a[a.DownLeft=6]="DownLeft",a[a.DownRight=10]="DownRight",a[a.UpDownLeft=7]="UpDownLeft",a[a.UpDownRight=11]="UpDownRight",a[a.UpLeftRight=13]="UpLeftRight",a[a.DownLeftRight=14]="DownLeftRight",a[a.UpDownLeftRight=15]="UpDownLeftRight",a[a.NoChildren=16]="NoChildren";const s=Object.create(null),c=[],l=[],_=m(e,new Set);for(const e of c)e.text=v(e.flowNode,e.circular),h(e);const u=function e(t){let n=0;for(const r of p(t))n=Math.max(n,e(r));return n+1}(_),d=function(e){const t=x(Array(e),0);for(const e of c)t[e.level]=Math.max(t[e.level],e.text.length);return t}(u);return function e(t,n){if(-1===t.lane){t.lane=n,t.endLane=n;const r=p(t);for(let i=0;i0&&n++;const o=r[i];e(o,n),o.endLane>t.endLane&&(n=o.endLane)}t.endLane=n}}(_,0),function(){const e=d.length,t=St(c,0,e=>e.lane)+1,n=x(Array(t),""),r=d.map(()=>Array(t)),i=d.map(()=>x(Array(t),0));for(const e of c){r[e.level][e.lane]=e;const t=p(e);for(let n=0;n0&&(o|=1),n0&&(o|=1),t0?i[n-1][e]:0,r=e>0?i[n][e-1]:0;let o=i[n][e];o||(8&t&&(o|=12),2&r&&(o|=3),i[n][e]=o)}for(let t=0;t0?e.repeat(t):"";let n="";for(;n.length=0,"Invalid argument: major"),pn.assert(t>=0,"Invalid argument: minor"),pn.assert(n>=0,"Invalid argument: patch");const o=r?Ze(r)?r:r.split("."):_,a=i?Ze(i)?i:i.split("."):_;pn.assert(b(o,e=>hn.test(e)),"Invalid argument: prerelease"),pn.assert(b(a,e=>vn.test(e)),"Invalid argument: build"),this.major=e,this.minor=t,this.patch=n,this.prerelease=o,this.build=a}static tryParse(t){const n=Sn(t);if(!n)return;const{major:r,minor:i,patch:o,prerelease:a,build:s}=n;return new e(r,i,o,a,s)}compareTo(e){return this===e?0:void 0===e?1:xt(this.major,e.major)||xt(this.minor,e.minor)||xt(this.patch,e.patch)||function(e,t){if(e===t)return 0;if(0===e.length)return 0===t.length?0:1;if(0===t.length)return-1;const n=Math.min(e.length,t.length);for(let r=0;r=]|<=|>=)?\s*([a-z0-9-+.*]+)$/i;function En(e){const t=[];for(let n of e.trim().split(Cn)){if(!n)continue;const e=[];n=n.trim();const r=Dn.exec(n);if(r){if(!An(r[1],r[2],e))return}else for(const t of n.split(wn)){const n=Fn.exec(t.trim());if(!n||!In(n[1],n[2],e))return}t.push(e)}return t}function Pn(e){const t=Nn.exec(e);if(!t)return;const[,n,r="*",i="*",o,a]=t;return{version:new kn(On(n)?0:parseInt(n,10),On(n)||On(r)?0:parseInt(r,10),On(n)||On(r)||On(i)?0:parseInt(i,10),o,a),major:n,minor:r,patch:i}}function An(e,t,n){const r=Pn(e);if(!r)return!1;const i=Pn(t);return!!i&&(On(r.major)||n.push(Ln(">=",r.version)),On(i.major)||n.push(On(i.minor)?Ln("<",i.version.increment("major")):On(i.patch)?Ln("<",i.version.increment("minor")):Ln("<=",i.version)),!0)}function In(e,t,n){const r=Pn(t);if(!r)return!1;const{version:i,major:o,minor:a,patch:s}=r;if(On(o))"<"!==e&&">"!==e||n.push(Ln("<",kn.zero));else switch(e){case"~":n.push(Ln(">=",i)),n.push(Ln("<",i.increment(On(a)?"major":"minor")));break;case"^":n.push(Ln(">=",i)),n.push(Ln("<",i.increment(i.major>0||On(a)?"major":i.minor>0||On(s)?"minor":"patch")));break;case"<":case">=":n.push(On(a)||On(s)?Ln(e,i.with({prerelease:"0"})):Ln(e,i));break;case"<=":case">":n.push(On(a)?Ln("<="===e?"<":">=",i.increment("major").with({prerelease:"0"})):On(s)?Ln("<="===e?"<":">=",i.increment("minor").with({prerelease:"0"})):Ln(e,i));break;case"=":case void 0:On(a)||On(s)?(n.push(Ln(">=",i.with({prerelease:"0"}))),n.push(Ln("<",i.increment(On(a)?"major":"minor").with({prerelease:"0"})))):n.push(Ln("=",i));break;default:return!1}return!0}function On(e){return"*"===e||"x"===e||"X"===e}function Ln(e,t){return{operator:e,operand:t}}function jn(e,t){for(const n of t)if(!Mn(e,n.operator,n.operand))return!1;return!0}function Mn(e,t,n){const r=e.compareTo(n);switch(t){case"<":return r<0;case"<=":return r<=0;case">":return r>0;case">=":return r>=0;case"=":return 0===r;default:return pn.assertNever(t)}}function Rn(e){return P(e,Bn).join(" ")}function Bn(e){return`${e.operator}${e.operand}`}var Jn=function(){const e=function(){if(dn())try{const{performance:e}=n(6732);if(e)return{shouldWriteNativeEvents:!1,performance:e}}catch{}if("object"==typeof performance)return{shouldWriteNativeEvents:!0,performance}}();if(!e)return;const{shouldWriteNativeEvents:t,performance:r}=e,i={shouldWriteNativeEvents:t,performance:void 0,performanceTime:void 0};return"number"==typeof r.timeOrigin&&"function"==typeof r.now&&(i.performanceTime=r),i.performanceTime&&"function"==typeof r.mark&&"function"==typeof r.measure&&"function"==typeof r.clearMarks&&"function"==typeof r.clearMeasures&&(i.performance=r),i}(),zn=null==Jn?void 0:Jn.performanceTime;function qn(){return Jn}var Un,Vn,Wn=zn?()=>zn.now():Date.now,$n={};function Hn(e,t,n,r){return e?Kn(t,n,r):Qn}function Kn(e,t,n){let r=0;return{enter:function(){1===++r&&rr(t)},exit:function(){0===--r?(rr(n),ir(e,t,n)):r<0&&pn.fail("enter/exit count does not match.")}}}o($n,{clearMarks:()=>_r,clearMeasures:()=>lr,createTimer:()=>Kn,createTimerIf:()=>Hn,disable:()=>pr,enable:()=>dr,forEachMark:()=>cr,forEachMeasure:()=>sr,getCount:()=>or,getDuration:()=>ar,isEnabled:()=>ur,mark:()=>rr,measure:()=>ir,nullTimer:()=>Qn});var Gn,Xn,Qn={enter:ot,exit:ot},Yn=!1,Zn=Wn(),er=new Map,tr=new Map,nr=new Map;function rr(e){if(Yn){const t=tr.get(e)??0;tr.set(e,t+1),er.set(e,Wn()),null==Vn||Vn.mark(e),"function"==typeof onProfilerEvent&&onProfilerEvent(e)}}function ir(e,t,n){if(Yn){const r=(void 0!==n?er.get(n):void 0)??Wn(),i=(void 0!==t?er.get(t):void 0)??Zn,o=nr.get(e)||0;nr.set(e,o+(r-i)),null==Vn||Vn.measure(e,t,n)}}function or(e){return tr.get(e)||0}function ar(e){return nr.get(e)||0}function sr(e){nr.forEach((t,n)=>e(n,t))}function cr(e){er.forEach((t,n)=>e(n))}function lr(e){void 0!==e?nr.delete(e):nr.clear(),null==Vn||Vn.clearMeasures(e)}function _r(e){void 0!==e?(tr.delete(e),er.delete(e)):(tr.clear(),er.clear()),null==Vn||Vn.clearMarks(e)}function ur(){return Yn}function dr(e=uo){var t;return Yn||(Yn=!0,Un||(Un=qn()),(null==Un?void 0:Un.performance)&&(Zn=Un.performance.timeOrigin,(Un.shouldWriteNativeEvents||(null==(t=null==e?void 0:e.cpuProfilingEnabled)?void 0:t.call(e))||(null==e?void 0:e.debugMode))&&(Vn=Un.performance))),!0}function pr(){Yn&&(er.clear(),tr.clear(),nr.clear(),Vn=void 0,Yn=!1)}(e=>{let t,r,o=0,a=0;const s=[];let c;const l=[];let _;var u;e.startTracing=function(_,u,d){if(pn.assert(!Gn,"Tracing already started"),void 0===t)try{t=n(84021)}catch(e){throw new Error(`tracing requires having fs\n(original error: ${e.message||e})`)}r=_,s.length=0,void 0===c&&(c=Jo(u,"legend.json")),t.existsSync(u)||t.mkdirSync(u,{recursive:!0});const p="build"===r?`.${i.pid}-${++o}`:"server"===r?`.${i.pid}`:"",f=Jo(u,`trace${p}.json`),m=Jo(u,`types${p}.json`);l.push({configFilePath:d,tracePath:f,typesPath:m}),a=t.openSync(f,"w"),Gn=e;const g={cat:"__metadata",ph:"M",ts:1e3*Wn(),pid:1,tid:1};t.writeSync(a,"[\n"+[{name:"process_name",args:{name:"tsc"},...g},{name:"thread_name",args:{name:"Main"},...g},{name:"TracingStartedInBrowser",...g,cat:"disabled-by-default-devtools.timeline"}].map(e=>JSON.stringify(e)).join(",\n"))},e.stopTracing=function(){pn.assert(Gn,"Tracing is not in progress"),pn.assert(!!s.length==("server"!==r)),t.writeSync(a,"\n]\n"),t.closeSync(a),Gn=void 0,s.length?function(e){var n,r,i,o,a,s,c,_,u,d,p,f,m,h,y,v,b,x,k;rr("beginDumpTypes");const S=l[l.length-1].typesPath,T=t.openSync(S,"w"),C=new Map;t.writeSync(T,"[");const w=e.length;for(let l=0;le.id),referenceLocation:g(e.node)}}let A={};if(16777216&S.flags){const e=S;A={conditionalCheckType:null==(s=e.checkType)?void 0:s.id,conditionalExtendsType:null==(c=e.extendsType)?void 0:c.id,conditionalTrueType:(null==(_=e.resolvedTrueType)?void 0:_.id)??-1,conditionalFalseType:(null==(u=e.resolvedFalseType)?void 0:u.id)??-1}}let I={};if(33554432&S.flags){const e=S;I={substitutionBaseType:null==(d=e.baseType)?void 0:d.id,constraintType:null==(p=e.constraint)?void 0:p.id}}let O={};if(1024&N){const e=S;O={reverseMappedSourceType:null==(f=e.source)?void 0:f.id,reverseMappedMappedType:null==(m=e.mappedType)?void 0:m.id,reverseMappedConstraintType:null==(h=e.constraintType)?void 0:h.id}}let L,j={};if(256&N){const e=S;j={evolvingArrayElementType:e.elementType.id,evolvingArrayFinalType:null==(y=e.finalArrayType)?void 0:y.id}}const M=S.checker.getRecursionIdentity(S);M&&(L=C.get(M),L||(L=C.size,C.set(M,L)));const R={id:S.id,intrinsicName:S.intrinsicName,symbolName:(null==D?void 0:D.escapedName)&&vc(D.escapedName),recursionId:L,isTuple:!!(8&N)||void 0,unionTypes:1048576&S.flags?null==(v=S.types)?void 0:v.map(e=>e.id):void 0,intersectionTypes:2097152&S.flags?S.types.map(e=>e.id):void 0,aliasTypeArguments:null==(b=S.aliasTypeArguments)?void 0:b.map(e=>e.id),keyofType:4194304&S.flags?null==(x=S.type)?void 0:x.id:void 0,...E,...P,...A,...I,...O,...j,destructuringPattern:g(S.pattern),firstDeclaration:g(null==(k=null==D?void 0:D.declarations)?void 0:k[0]),flags:pn.formatTypeFlags(S.flags).split("|"),display:F};t.writeSync(T,JSON.stringify(R)),l0),f(d.length-1,1e3*Wn(),e),d.length--},e.popAll=function(){const e=1e3*Wn();for(let t=d.length-1;t>=0;t--)f(t,e);d.length=0};const p=1e4;function f(e,t,n){const{phase:r,name:i,args:o,time:a,separateBeginAndEnd:s}=d[e];s?(pn.assert(!n,"`results` are not supported for events with `separateBeginAndEnd`"),m("E",r,i,o,void 0,t)):p-a%p<=t-a&&m("X",r,i,{...o,results:n},'"dur":'+(t-a),a)}function m(e,n,i,o,s,c=1e3*Wn()){"server"===r&&"checkTypes"===n||(rr("beginTracing"),t.writeSync(a,`,\n{"pid":1,"tid":1,"ph":"${e}","cat":"${n}","ts":${c},"name":"${i}"`),s&&t.writeSync(a,`,${s}`),o&&t.writeSync(a,`,"args":${JSON.stringify(o)}`),t.writeSync(a,"}"),rr("endTracing"),ir("Tracing","beginTracing","endTracing"))}function g(e){const t=Sd(e);return t?{path:t.path,start:n(Wa(t,e.pos)),end:n(Wa(t,e.end))}:void 0;function n(e){return{line:e.line+1,character:e.character+1}}}e.dumpLegend=function(){c&&t.writeFileSync(c,JSON.stringify(l))}})(Xn||(Xn={}));var fr=Xn.startTracing,mr=Xn.dumpLegend,gr=(e=>(e[e.Unknown=0]="Unknown",e[e.EndOfFileToken=1]="EndOfFileToken",e[e.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",e[e.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",e[e.NewLineTrivia=4]="NewLineTrivia",e[e.WhitespaceTrivia=5]="WhitespaceTrivia",e[e.ShebangTrivia=6]="ShebangTrivia",e[e.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",e[e.NonTextFileMarkerTrivia=8]="NonTextFileMarkerTrivia",e[e.NumericLiteral=9]="NumericLiteral",e[e.BigIntLiteral=10]="BigIntLiteral",e[e.StringLiteral=11]="StringLiteral",e[e.JsxText=12]="JsxText",e[e.JsxTextAllWhiteSpaces=13]="JsxTextAllWhiteSpaces",e[e.RegularExpressionLiteral=14]="RegularExpressionLiteral",e[e.NoSubstitutionTemplateLiteral=15]="NoSubstitutionTemplateLiteral",e[e.TemplateHead=16]="TemplateHead",e[e.TemplateMiddle=17]="TemplateMiddle",e[e.TemplateTail=18]="TemplateTail",e[e.OpenBraceToken=19]="OpenBraceToken",e[e.CloseBraceToken=20]="CloseBraceToken",e[e.OpenParenToken=21]="OpenParenToken",e[e.CloseParenToken=22]="CloseParenToken",e[e.OpenBracketToken=23]="OpenBracketToken",e[e.CloseBracketToken=24]="CloseBracketToken",e[e.DotToken=25]="DotToken",e[e.DotDotDotToken=26]="DotDotDotToken",e[e.SemicolonToken=27]="SemicolonToken",e[e.CommaToken=28]="CommaToken",e[e.QuestionDotToken=29]="QuestionDotToken",e[e.LessThanToken=30]="LessThanToken",e[e.LessThanSlashToken=31]="LessThanSlashToken",e[e.GreaterThanToken=32]="GreaterThanToken",e[e.LessThanEqualsToken=33]="LessThanEqualsToken",e[e.GreaterThanEqualsToken=34]="GreaterThanEqualsToken",e[e.EqualsEqualsToken=35]="EqualsEqualsToken",e[e.ExclamationEqualsToken=36]="ExclamationEqualsToken",e[e.EqualsEqualsEqualsToken=37]="EqualsEqualsEqualsToken",e[e.ExclamationEqualsEqualsToken=38]="ExclamationEqualsEqualsToken",e[e.EqualsGreaterThanToken=39]="EqualsGreaterThanToken",e[e.PlusToken=40]="PlusToken",e[e.MinusToken=41]="MinusToken",e[e.AsteriskToken=42]="AsteriskToken",e[e.AsteriskAsteriskToken=43]="AsteriskAsteriskToken",e[e.SlashToken=44]="SlashToken",e[e.PercentToken=45]="PercentToken",e[e.PlusPlusToken=46]="PlusPlusToken",e[e.MinusMinusToken=47]="MinusMinusToken",e[e.LessThanLessThanToken=48]="LessThanLessThanToken",e[e.GreaterThanGreaterThanToken=49]="GreaterThanGreaterThanToken",e[e.GreaterThanGreaterThanGreaterThanToken=50]="GreaterThanGreaterThanGreaterThanToken",e[e.AmpersandToken=51]="AmpersandToken",e[e.BarToken=52]="BarToken",e[e.CaretToken=53]="CaretToken",e[e.ExclamationToken=54]="ExclamationToken",e[e.TildeToken=55]="TildeToken",e[e.AmpersandAmpersandToken=56]="AmpersandAmpersandToken",e[e.BarBarToken=57]="BarBarToken",e[e.QuestionToken=58]="QuestionToken",e[e.ColonToken=59]="ColonToken",e[e.AtToken=60]="AtToken",e[e.QuestionQuestionToken=61]="QuestionQuestionToken",e[e.BacktickToken=62]="BacktickToken",e[e.HashToken=63]="HashToken",e[e.EqualsToken=64]="EqualsToken",e[e.PlusEqualsToken=65]="PlusEqualsToken",e[e.MinusEqualsToken=66]="MinusEqualsToken",e[e.AsteriskEqualsToken=67]="AsteriskEqualsToken",e[e.AsteriskAsteriskEqualsToken=68]="AsteriskAsteriskEqualsToken",e[e.SlashEqualsToken=69]="SlashEqualsToken",e[e.PercentEqualsToken=70]="PercentEqualsToken",e[e.LessThanLessThanEqualsToken=71]="LessThanLessThanEqualsToken",e[e.GreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanEqualsToken",e[e.GreaterThanGreaterThanGreaterThanEqualsToken=73]="GreaterThanGreaterThanGreaterThanEqualsToken",e[e.AmpersandEqualsToken=74]="AmpersandEqualsToken",e[e.BarEqualsToken=75]="BarEqualsToken",e[e.BarBarEqualsToken=76]="BarBarEqualsToken",e[e.AmpersandAmpersandEqualsToken=77]="AmpersandAmpersandEqualsToken",e[e.QuestionQuestionEqualsToken=78]="QuestionQuestionEqualsToken",e[e.CaretEqualsToken=79]="CaretEqualsToken",e[e.Identifier=80]="Identifier",e[e.PrivateIdentifier=81]="PrivateIdentifier",e[e.JSDocCommentTextToken=82]="JSDocCommentTextToken",e[e.BreakKeyword=83]="BreakKeyword",e[e.CaseKeyword=84]="CaseKeyword",e[e.CatchKeyword=85]="CatchKeyword",e[e.ClassKeyword=86]="ClassKeyword",e[e.ConstKeyword=87]="ConstKeyword",e[e.ContinueKeyword=88]="ContinueKeyword",e[e.DebuggerKeyword=89]="DebuggerKeyword",e[e.DefaultKeyword=90]="DefaultKeyword",e[e.DeleteKeyword=91]="DeleteKeyword",e[e.DoKeyword=92]="DoKeyword",e[e.ElseKeyword=93]="ElseKeyword",e[e.EnumKeyword=94]="EnumKeyword",e[e.ExportKeyword=95]="ExportKeyword",e[e.ExtendsKeyword=96]="ExtendsKeyword",e[e.FalseKeyword=97]="FalseKeyword",e[e.FinallyKeyword=98]="FinallyKeyword",e[e.ForKeyword=99]="ForKeyword",e[e.FunctionKeyword=100]="FunctionKeyword",e[e.IfKeyword=101]="IfKeyword",e[e.ImportKeyword=102]="ImportKeyword",e[e.InKeyword=103]="InKeyword",e[e.InstanceOfKeyword=104]="InstanceOfKeyword",e[e.NewKeyword=105]="NewKeyword",e[e.NullKeyword=106]="NullKeyword",e[e.ReturnKeyword=107]="ReturnKeyword",e[e.SuperKeyword=108]="SuperKeyword",e[e.SwitchKeyword=109]="SwitchKeyword",e[e.ThisKeyword=110]="ThisKeyword",e[e.ThrowKeyword=111]="ThrowKeyword",e[e.TrueKeyword=112]="TrueKeyword",e[e.TryKeyword=113]="TryKeyword",e[e.TypeOfKeyword=114]="TypeOfKeyword",e[e.VarKeyword=115]="VarKeyword",e[e.VoidKeyword=116]="VoidKeyword",e[e.WhileKeyword=117]="WhileKeyword",e[e.WithKeyword=118]="WithKeyword",e[e.ImplementsKeyword=119]="ImplementsKeyword",e[e.InterfaceKeyword=120]="InterfaceKeyword",e[e.LetKeyword=121]="LetKeyword",e[e.PackageKeyword=122]="PackageKeyword",e[e.PrivateKeyword=123]="PrivateKeyword",e[e.ProtectedKeyword=124]="ProtectedKeyword",e[e.PublicKeyword=125]="PublicKeyword",e[e.StaticKeyword=126]="StaticKeyword",e[e.YieldKeyword=127]="YieldKeyword",e[e.AbstractKeyword=128]="AbstractKeyword",e[e.AccessorKeyword=129]="AccessorKeyword",e[e.AsKeyword=130]="AsKeyword",e[e.AssertsKeyword=131]="AssertsKeyword",e[e.AssertKeyword=132]="AssertKeyword",e[e.AnyKeyword=133]="AnyKeyword",e[e.AsyncKeyword=134]="AsyncKeyword",e[e.AwaitKeyword=135]="AwaitKeyword",e[e.BooleanKeyword=136]="BooleanKeyword",e[e.ConstructorKeyword=137]="ConstructorKeyword",e[e.DeclareKeyword=138]="DeclareKeyword",e[e.GetKeyword=139]="GetKeyword",e[e.InferKeyword=140]="InferKeyword",e[e.IntrinsicKeyword=141]="IntrinsicKeyword",e[e.IsKeyword=142]="IsKeyword",e[e.KeyOfKeyword=143]="KeyOfKeyword",e[e.ModuleKeyword=144]="ModuleKeyword",e[e.NamespaceKeyword=145]="NamespaceKeyword",e[e.NeverKeyword=146]="NeverKeyword",e[e.OutKeyword=147]="OutKeyword",e[e.ReadonlyKeyword=148]="ReadonlyKeyword",e[e.RequireKeyword=149]="RequireKeyword",e[e.NumberKeyword=150]="NumberKeyword",e[e.ObjectKeyword=151]="ObjectKeyword",e[e.SatisfiesKeyword=152]="SatisfiesKeyword",e[e.SetKeyword=153]="SetKeyword",e[e.StringKeyword=154]="StringKeyword",e[e.SymbolKeyword=155]="SymbolKeyword",e[e.TypeKeyword=156]="TypeKeyword",e[e.UndefinedKeyword=157]="UndefinedKeyword",e[e.UniqueKeyword=158]="UniqueKeyword",e[e.UnknownKeyword=159]="UnknownKeyword",e[e.UsingKeyword=160]="UsingKeyword",e[e.FromKeyword=161]="FromKeyword",e[e.GlobalKeyword=162]="GlobalKeyword",e[e.BigIntKeyword=163]="BigIntKeyword",e[e.OverrideKeyword=164]="OverrideKeyword",e[e.OfKeyword=165]="OfKeyword",e[e.DeferKeyword=166]="DeferKeyword",e[e.QualifiedName=167]="QualifiedName",e[e.ComputedPropertyName=168]="ComputedPropertyName",e[e.TypeParameter=169]="TypeParameter",e[e.Parameter=170]="Parameter",e[e.Decorator=171]="Decorator",e[e.PropertySignature=172]="PropertySignature",e[e.PropertyDeclaration=173]="PropertyDeclaration",e[e.MethodSignature=174]="MethodSignature",e[e.MethodDeclaration=175]="MethodDeclaration",e[e.ClassStaticBlockDeclaration=176]="ClassStaticBlockDeclaration",e[e.Constructor=177]="Constructor",e[e.GetAccessor=178]="GetAccessor",e[e.SetAccessor=179]="SetAccessor",e[e.CallSignature=180]="CallSignature",e[e.ConstructSignature=181]="ConstructSignature",e[e.IndexSignature=182]="IndexSignature",e[e.TypePredicate=183]="TypePredicate",e[e.TypeReference=184]="TypeReference",e[e.FunctionType=185]="FunctionType",e[e.ConstructorType=186]="ConstructorType",e[e.TypeQuery=187]="TypeQuery",e[e.TypeLiteral=188]="TypeLiteral",e[e.ArrayType=189]="ArrayType",e[e.TupleType=190]="TupleType",e[e.OptionalType=191]="OptionalType",e[e.RestType=192]="RestType",e[e.UnionType=193]="UnionType",e[e.IntersectionType=194]="IntersectionType",e[e.ConditionalType=195]="ConditionalType",e[e.InferType=196]="InferType",e[e.ParenthesizedType=197]="ParenthesizedType",e[e.ThisType=198]="ThisType",e[e.TypeOperator=199]="TypeOperator",e[e.IndexedAccessType=200]="IndexedAccessType",e[e.MappedType=201]="MappedType",e[e.LiteralType=202]="LiteralType",e[e.NamedTupleMember=203]="NamedTupleMember",e[e.TemplateLiteralType=204]="TemplateLiteralType",e[e.TemplateLiteralTypeSpan=205]="TemplateLiteralTypeSpan",e[e.ImportType=206]="ImportType",e[e.ObjectBindingPattern=207]="ObjectBindingPattern",e[e.ArrayBindingPattern=208]="ArrayBindingPattern",e[e.BindingElement=209]="BindingElement",e[e.ArrayLiteralExpression=210]="ArrayLiteralExpression",e[e.ObjectLiteralExpression=211]="ObjectLiteralExpression",e[e.PropertyAccessExpression=212]="PropertyAccessExpression",e[e.ElementAccessExpression=213]="ElementAccessExpression",e[e.CallExpression=214]="CallExpression",e[e.NewExpression=215]="NewExpression",e[e.TaggedTemplateExpression=216]="TaggedTemplateExpression",e[e.TypeAssertionExpression=217]="TypeAssertionExpression",e[e.ParenthesizedExpression=218]="ParenthesizedExpression",e[e.FunctionExpression=219]="FunctionExpression",e[e.ArrowFunction=220]="ArrowFunction",e[e.DeleteExpression=221]="DeleteExpression",e[e.TypeOfExpression=222]="TypeOfExpression",e[e.VoidExpression=223]="VoidExpression",e[e.AwaitExpression=224]="AwaitExpression",e[e.PrefixUnaryExpression=225]="PrefixUnaryExpression",e[e.PostfixUnaryExpression=226]="PostfixUnaryExpression",e[e.BinaryExpression=227]="BinaryExpression",e[e.ConditionalExpression=228]="ConditionalExpression",e[e.TemplateExpression=229]="TemplateExpression",e[e.YieldExpression=230]="YieldExpression",e[e.SpreadElement=231]="SpreadElement",e[e.ClassExpression=232]="ClassExpression",e[e.OmittedExpression=233]="OmittedExpression",e[e.ExpressionWithTypeArguments=234]="ExpressionWithTypeArguments",e[e.AsExpression=235]="AsExpression",e[e.NonNullExpression=236]="NonNullExpression",e[e.MetaProperty=237]="MetaProperty",e[e.SyntheticExpression=238]="SyntheticExpression",e[e.SatisfiesExpression=239]="SatisfiesExpression",e[e.TemplateSpan=240]="TemplateSpan",e[e.SemicolonClassElement=241]="SemicolonClassElement",e[e.Block=242]="Block",e[e.EmptyStatement=243]="EmptyStatement",e[e.VariableStatement=244]="VariableStatement",e[e.ExpressionStatement=245]="ExpressionStatement",e[e.IfStatement=246]="IfStatement",e[e.DoStatement=247]="DoStatement",e[e.WhileStatement=248]="WhileStatement",e[e.ForStatement=249]="ForStatement",e[e.ForInStatement=250]="ForInStatement",e[e.ForOfStatement=251]="ForOfStatement",e[e.ContinueStatement=252]="ContinueStatement",e[e.BreakStatement=253]="BreakStatement",e[e.ReturnStatement=254]="ReturnStatement",e[e.WithStatement=255]="WithStatement",e[e.SwitchStatement=256]="SwitchStatement",e[e.LabeledStatement=257]="LabeledStatement",e[e.ThrowStatement=258]="ThrowStatement",e[e.TryStatement=259]="TryStatement",e[e.DebuggerStatement=260]="DebuggerStatement",e[e.VariableDeclaration=261]="VariableDeclaration",e[e.VariableDeclarationList=262]="VariableDeclarationList",e[e.FunctionDeclaration=263]="FunctionDeclaration",e[e.ClassDeclaration=264]="ClassDeclaration",e[e.InterfaceDeclaration=265]="InterfaceDeclaration",e[e.TypeAliasDeclaration=266]="TypeAliasDeclaration",e[e.EnumDeclaration=267]="EnumDeclaration",e[e.ModuleDeclaration=268]="ModuleDeclaration",e[e.ModuleBlock=269]="ModuleBlock",e[e.CaseBlock=270]="CaseBlock",e[e.NamespaceExportDeclaration=271]="NamespaceExportDeclaration",e[e.ImportEqualsDeclaration=272]="ImportEqualsDeclaration",e[e.ImportDeclaration=273]="ImportDeclaration",e[e.ImportClause=274]="ImportClause",e[e.NamespaceImport=275]="NamespaceImport",e[e.NamedImports=276]="NamedImports",e[e.ImportSpecifier=277]="ImportSpecifier",e[e.ExportAssignment=278]="ExportAssignment",e[e.ExportDeclaration=279]="ExportDeclaration",e[e.NamedExports=280]="NamedExports",e[e.NamespaceExport=281]="NamespaceExport",e[e.ExportSpecifier=282]="ExportSpecifier",e[e.MissingDeclaration=283]="MissingDeclaration",e[e.ExternalModuleReference=284]="ExternalModuleReference",e[e.JsxElement=285]="JsxElement",e[e.JsxSelfClosingElement=286]="JsxSelfClosingElement",e[e.JsxOpeningElement=287]="JsxOpeningElement",e[e.JsxClosingElement=288]="JsxClosingElement",e[e.JsxFragment=289]="JsxFragment",e[e.JsxOpeningFragment=290]="JsxOpeningFragment",e[e.JsxClosingFragment=291]="JsxClosingFragment",e[e.JsxAttribute=292]="JsxAttribute",e[e.JsxAttributes=293]="JsxAttributes",e[e.JsxSpreadAttribute=294]="JsxSpreadAttribute",e[e.JsxExpression=295]="JsxExpression",e[e.JsxNamespacedName=296]="JsxNamespacedName",e[e.CaseClause=297]="CaseClause",e[e.DefaultClause=298]="DefaultClause",e[e.HeritageClause=299]="HeritageClause",e[e.CatchClause=300]="CatchClause",e[e.ImportAttributes=301]="ImportAttributes",e[e.ImportAttribute=302]="ImportAttribute",e[e.AssertClause=301]="AssertClause",e[e.AssertEntry=302]="AssertEntry",e[e.ImportTypeAssertionContainer=303]="ImportTypeAssertionContainer",e[e.PropertyAssignment=304]="PropertyAssignment",e[e.ShorthandPropertyAssignment=305]="ShorthandPropertyAssignment",e[e.SpreadAssignment=306]="SpreadAssignment",e[e.EnumMember=307]="EnumMember",e[e.SourceFile=308]="SourceFile",e[e.Bundle=309]="Bundle",e[e.JSDocTypeExpression=310]="JSDocTypeExpression",e[e.JSDocNameReference=311]="JSDocNameReference",e[e.JSDocMemberName=312]="JSDocMemberName",e[e.JSDocAllType=313]="JSDocAllType",e[e.JSDocUnknownType=314]="JSDocUnknownType",e[e.JSDocNullableType=315]="JSDocNullableType",e[e.JSDocNonNullableType=316]="JSDocNonNullableType",e[e.JSDocOptionalType=317]="JSDocOptionalType",e[e.JSDocFunctionType=318]="JSDocFunctionType",e[e.JSDocVariadicType=319]="JSDocVariadicType",e[e.JSDocNamepathType=320]="JSDocNamepathType",e[e.JSDoc=321]="JSDoc",e[e.JSDocComment=321]="JSDocComment",e[e.JSDocText=322]="JSDocText",e[e.JSDocTypeLiteral=323]="JSDocTypeLiteral",e[e.JSDocSignature=324]="JSDocSignature",e[e.JSDocLink=325]="JSDocLink",e[e.JSDocLinkCode=326]="JSDocLinkCode",e[e.JSDocLinkPlain=327]="JSDocLinkPlain",e[e.JSDocTag=328]="JSDocTag",e[e.JSDocAugmentsTag=329]="JSDocAugmentsTag",e[e.JSDocImplementsTag=330]="JSDocImplementsTag",e[e.JSDocAuthorTag=331]="JSDocAuthorTag",e[e.JSDocDeprecatedTag=332]="JSDocDeprecatedTag",e[e.JSDocClassTag=333]="JSDocClassTag",e[e.JSDocPublicTag=334]="JSDocPublicTag",e[e.JSDocPrivateTag=335]="JSDocPrivateTag",e[e.JSDocProtectedTag=336]="JSDocProtectedTag",e[e.JSDocReadonlyTag=337]="JSDocReadonlyTag",e[e.JSDocOverrideTag=338]="JSDocOverrideTag",e[e.JSDocCallbackTag=339]="JSDocCallbackTag",e[e.JSDocOverloadTag=340]="JSDocOverloadTag",e[e.JSDocEnumTag=341]="JSDocEnumTag",e[e.JSDocParameterTag=342]="JSDocParameterTag",e[e.JSDocReturnTag=343]="JSDocReturnTag",e[e.JSDocThisTag=344]="JSDocThisTag",e[e.JSDocTypeTag=345]="JSDocTypeTag",e[e.JSDocTemplateTag=346]="JSDocTemplateTag",e[e.JSDocTypedefTag=347]="JSDocTypedefTag",e[e.JSDocSeeTag=348]="JSDocSeeTag",e[e.JSDocPropertyTag=349]="JSDocPropertyTag",e[e.JSDocThrowsTag=350]="JSDocThrowsTag",e[e.JSDocSatisfiesTag=351]="JSDocSatisfiesTag",e[e.JSDocImportTag=352]="JSDocImportTag",e[e.SyntaxList=353]="SyntaxList",e[e.NotEmittedStatement=354]="NotEmittedStatement",e[e.NotEmittedTypeElement=355]="NotEmittedTypeElement",e[e.PartiallyEmittedExpression=356]="PartiallyEmittedExpression",e[e.CommaListExpression=357]="CommaListExpression",e[e.SyntheticReferenceExpression=358]="SyntheticReferenceExpression",e[e.Count=359]="Count",e[e.FirstAssignment=64]="FirstAssignment",e[e.LastAssignment=79]="LastAssignment",e[e.FirstCompoundAssignment=65]="FirstCompoundAssignment",e[e.LastCompoundAssignment=79]="LastCompoundAssignment",e[e.FirstReservedWord=83]="FirstReservedWord",e[e.LastReservedWord=118]="LastReservedWord",e[e.FirstKeyword=83]="FirstKeyword",e[e.LastKeyword=166]="LastKeyword",e[e.FirstFutureReservedWord=119]="FirstFutureReservedWord",e[e.LastFutureReservedWord=127]="LastFutureReservedWord",e[e.FirstTypeNode=183]="FirstTypeNode",e[e.LastTypeNode=206]="LastTypeNode",e[e.FirstPunctuation=19]="FirstPunctuation",e[e.LastPunctuation=79]="LastPunctuation",e[e.FirstToken=0]="FirstToken",e[e.LastToken=166]="LastToken",e[e.FirstTriviaToken=2]="FirstTriviaToken",e[e.LastTriviaToken=7]="LastTriviaToken",e[e.FirstLiteralToken=9]="FirstLiteralToken",e[e.LastLiteralToken=15]="LastLiteralToken",e[e.FirstTemplateToken=15]="FirstTemplateToken",e[e.LastTemplateToken=18]="LastTemplateToken",e[e.FirstBinaryOperator=30]="FirstBinaryOperator",e[e.LastBinaryOperator=79]="LastBinaryOperator",e[e.FirstStatement=244]="FirstStatement",e[e.LastStatement=260]="LastStatement",e[e.FirstNode=167]="FirstNode",e[e.FirstJSDocNode=310]="FirstJSDocNode",e[e.LastJSDocNode=352]="LastJSDocNode",e[e.FirstJSDocTagNode=328]="FirstJSDocTagNode",e[e.LastJSDocTagNode=352]="LastJSDocTagNode",e[e.FirstContextualKeyword=128]="FirstContextualKeyword",e[e.LastContextualKeyword=166]="LastContextualKeyword",e))(gr||{}),hr=(e=>(e[e.None=0]="None",e[e.Let=1]="Let",e[e.Const=2]="Const",e[e.Using=4]="Using",e[e.AwaitUsing=6]="AwaitUsing",e[e.NestedNamespace=8]="NestedNamespace",e[e.Synthesized=16]="Synthesized",e[e.Namespace=32]="Namespace",e[e.OptionalChain=64]="OptionalChain",e[e.ExportContext=128]="ExportContext",e[e.ContainsThis=256]="ContainsThis",e[e.HasImplicitReturn=512]="HasImplicitReturn",e[e.HasExplicitReturn=1024]="HasExplicitReturn",e[e.GlobalAugmentation=2048]="GlobalAugmentation",e[e.HasAsyncFunctions=4096]="HasAsyncFunctions",e[e.DisallowInContext=8192]="DisallowInContext",e[e.YieldContext=16384]="YieldContext",e[e.DecoratorContext=32768]="DecoratorContext",e[e.AwaitContext=65536]="AwaitContext",e[e.DisallowConditionalTypesContext=131072]="DisallowConditionalTypesContext",e[e.ThisNodeHasError=262144]="ThisNodeHasError",e[e.JavaScriptFile=524288]="JavaScriptFile",e[e.ThisNodeOrAnySubNodesHasError=1048576]="ThisNodeOrAnySubNodesHasError",e[e.HasAggregatedChildData=2097152]="HasAggregatedChildData",e[e.PossiblyContainsDynamicImport=4194304]="PossiblyContainsDynamicImport",e[e.PossiblyContainsImportMeta=8388608]="PossiblyContainsImportMeta",e[e.JSDoc=16777216]="JSDoc",e[e.Ambient=33554432]="Ambient",e[e.InWithStatement=67108864]="InWithStatement",e[e.JsonFile=134217728]="JsonFile",e[e.TypeCached=268435456]="TypeCached",e[e.Deprecated=536870912]="Deprecated",e[e.BlockScoped=7]="BlockScoped",e[e.Constant=6]="Constant",e[e.ReachabilityCheckFlags=1536]="ReachabilityCheckFlags",e[e.ReachabilityAndEmitFlags=5632]="ReachabilityAndEmitFlags",e[e.ContextFlags=101441536]="ContextFlags",e[e.TypeExcludesFlags=81920]="TypeExcludesFlags",e[e.PermanentlySetIncrementalFlags=12582912]="PermanentlySetIncrementalFlags",e[e.IdentifierHasExtendedUnicodeEscape=256]="IdentifierHasExtendedUnicodeEscape",e[e.IdentifierIsInJSDocNamespace=4096]="IdentifierIsInJSDocNamespace",e))(hr||{}),yr=(e=>(e[e.None=0]="None",e[e.Public=1]="Public",e[e.Private=2]="Private",e[e.Protected=4]="Protected",e[e.Readonly=8]="Readonly",e[e.Override=16]="Override",e[e.Export=32]="Export",e[e.Abstract=64]="Abstract",e[e.Ambient=128]="Ambient",e[e.Static=256]="Static",e[e.Accessor=512]="Accessor",e[e.Async=1024]="Async",e[e.Default=2048]="Default",e[e.Const=4096]="Const",e[e.In=8192]="In",e[e.Out=16384]="Out",e[e.Decorator=32768]="Decorator",e[e.Deprecated=65536]="Deprecated",e[e.JSDocPublic=8388608]="JSDocPublic",e[e.JSDocPrivate=16777216]="JSDocPrivate",e[e.JSDocProtected=33554432]="JSDocProtected",e[e.JSDocReadonly=67108864]="JSDocReadonly",e[e.JSDocOverride=134217728]="JSDocOverride",e[e.SyntacticOrJSDocModifiers=31]="SyntacticOrJSDocModifiers",e[e.SyntacticOnlyModifiers=65504]="SyntacticOnlyModifiers",e[e.SyntacticModifiers=65535]="SyntacticModifiers",e[e.JSDocCacheOnlyModifiers=260046848]="JSDocCacheOnlyModifiers",e[e.JSDocOnlyModifiers=65536]="JSDocOnlyModifiers",e[e.NonCacheOnlyModifiers=131071]="NonCacheOnlyModifiers",e[e.HasComputedJSDocModifiers=268435456]="HasComputedJSDocModifiers",e[e.HasComputedFlags=536870912]="HasComputedFlags",e[e.AccessibilityModifier=7]="AccessibilityModifier",e[e.ParameterPropertyModifier=31]="ParameterPropertyModifier",e[e.NonPublicAccessibilityModifier=6]="NonPublicAccessibilityModifier",e[e.TypeScriptModifier=28895]="TypeScriptModifier",e[e.ExportDefault=2080]="ExportDefault",e[e.All=131071]="All",e[e.Modifier=98303]="Modifier",e))(yr||{}),vr=(e=>(e[e.None=0]="None",e[e.IntrinsicNamedElement=1]="IntrinsicNamedElement",e[e.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",e[e.IntrinsicElement=3]="IntrinsicElement",e))(vr||{}),br=(e=>(e[e.None=0]="None",e[e.Succeeded=1]="Succeeded",e[e.Failed=2]="Failed",e[e.ReportsUnmeasurable=8]="ReportsUnmeasurable",e[e.ReportsUnreliable=16]="ReportsUnreliable",e[e.ReportsMask=24]="ReportsMask",e[e.ComplexityOverflow=32]="ComplexityOverflow",e[e.StackDepthOverflow=64]="StackDepthOverflow",e[e.Overflow=96]="Overflow",e))(br||{}),xr=(e=>(e[e.None=0]="None",e[e.Always=1]="Always",e[e.Never=2]="Never",e[e.Sometimes=3]="Sometimes",e))(xr||{}),kr=(e=>(e[e.None=0]="None",e[e.Auto=1]="Auto",e[e.Loop=2]="Loop",e[e.Unique=3]="Unique",e[e.Node=4]="Node",e[e.KindMask=7]="KindMask",e[e.ReservedInNestedScopes=8]="ReservedInNestedScopes",e[e.Optimistic=16]="Optimistic",e[e.FileLevel=32]="FileLevel",e[e.AllowNameSubstitution=64]="AllowNameSubstitution",e))(kr||{}),Sr=(e=>(e[e.None=0]="None",e[e.HasIndices=1]="HasIndices",e[e.Global=2]="Global",e[e.IgnoreCase=4]="IgnoreCase",e[e.Multiline=8]="Multiline",e[e.DotAll=16]="DotAll",e[e.Unicode=32]="Unicode",e[e.UnicodeSets=64]="UnicodeSets",e[e.Sticky=128]="Sticky",e[e.AnyUnicodeMode=96]="AnyUnicodeMode",e[e.Modifiers=28]="Modifiers",e))(Sr||{}),Tr=(e=>(e[e.None=0]="None",e[e.PrecedingLineBreak=1]="PrecedingLineBreak",e[e.PrecedingJSDocComment=2]="PrecedingJSDocComment",e[e.Unterminated=4]="Unterminated",e[e.ExtendedUnicodeEscape=8]="ExtendedUnicodeEscape",e[e.Scientific=16]="Scientific",e[e.Octal=32]="Octal",e[e.HexSpecifier=64]="HexSpecifier",e[e.BinarySpecifier=128]="BinarySpecifier",e[e.OctalSpecifier=256]="OctalSpecifier",e[e.ContainsSeparator=512]="ContainsSeparator",e[e.UnicodeEscape=1024]="UnicodeEscape",e[e.ContainsInvalidEscape=2048]="ContainsInvalidEscape",e[e.HexEscape=4096]="HexEscape",e[e.ContainsLeadingZero=8192]="ContainsLeadingZero",e[e.ContainsInvalidSeparator=16384]="ContainsInvalidSeparator",e[e.PrecedingJSDocLeadingAsterisks=32768]="PrecedingJSDocLeadingAsterisks",e[e.BinaryOrOctalSpecifier=384]="BinaryOrOctalSpecifier",e[e.WithSpecifier=448]="WithSpecifier",e[e.StringLiteralFlags=7176]="StringLiteralFlags",e[e.NumericLiteralFlags=25584]="NumericLiteralFlags",e[e.TemplateLiteralLikeFlags=7176]="TemplateLiteralLikeFlags",e[e.IsInvalid=26656]="IsInvalid",e))(Tr||{}),Cr=(e=>(e[e.Unreachable=1]="Unreachable",e[e.Start=2]="Start",e[e.BranchLabel=4]="BranchLabel",e[e.LoopLabel=8]="LoopLabel",e[e.Assignment=16]="Assignment",e[e.TrueCondition=32]="TrueCondition",e[e.FalseCondition=64]="FalseCondition",e[e.SwitchClause=128]="SwitchClause",e[e.ArrayMutation=256]="ArrayMutation",e[e.Call=512]="Call",e[e.ReduceLabel=1024]="ReduceLabel",e[e.Referenced=2048]="Referenced",e[e.Shared=4096]="Shared",e[e.Label=12]="Label",e[e.Condition=96]="Condition",e))(Cr||{}),wr=(e=>(e[e.ExpectError=0]="ExpectError",e[e.Ignore=1]="Ignore",e))(wr||{}),Nr=class{},Dr=(e=>(e[e.RootFile=0]="RootFile",e[e.SourceFromProjectReference=1]="SourceFromProjectReference",e[e.OutputFromProjectReference=2]="OutputFromProjectReference",e[e.Import=3]="Import",e[e.ReferenceFile=4]="ReferenceFile",e[e.TypeReferenceDirective=5]="TypeReferenceDirective",e[e.LibFile=6]="LibFile",e[e.LibReferenceDirective=7]="LibReferenceDirective",e[e.AutomaticTypeDirectiveFile=8]="AutomaticTypeDirectiveFile",e))(Dr||{}),Fr=(e=>(e[e.FilePreprocessingLibReferenceDiagnostic=0]="FilePreprocessingLibReferenceDiagnostic",e[e.FilePreprocessingFileExplainingDiagnostic=1]="FilePreprocessingFileExplainingDiagnostic",e[e.ResolutionDiagnostics=2]="ResolutionDiagnostics",e))(Fr||{}),Er=(e=>(e[e.Js=0]="Js",e[e.Dts=1]="Dts",e[e.BuilderSignature=2]="BuilderSignature",e))(Er||{}),Pr=(e=>(e[e.Not=0]="Not",e[e.SafeModules=1]="SafeModules",e[e.Completely=2]="Completely",e))(Pr||{}),Ar=(e=>(e[e.Success=0]="Success",e[e.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",e[e.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated",e[e.InvalidProject_OutputsSkipped=3]="InvalidProject_OutputsSkipped",e[e.ProjectReferenceCycle_OutputsSkipped=4]="ProjectReferenceCycle_OutputsSkipped",e))(Ar||{}),Ir=(e=>(e[e.Ok=0]="Ok",e[e.NeedsOverride=1]="NeedsOverride",e[e.HasInvalidOverride=2]="HasInvalidOverride",e))(Ir||{}),Or=(e=>(e[e.None=0]="None",e[e.Literal=1]="Literal",e[e.Subtype=2]="Subtype",e))(Or||{}),Lr=(e=>(e[e.None=0]="None",e[e.NoSupertypeReduction=1]="NoSupertypeReduction",e[e.NoConstraintReduction=2]="NoConstraintReduction",e))(Lr||{}),jr=(e=>(e[e.None=0]="None",e[e.Signature=1]="Signature",e[e.NoConstraints=2]="NoConstraints",e[e.Completions=4]="Completions",e[e.SkipBindingPatterns=8]="SkipBindingPatterns",e))(jr||{}),Mr=(e=>(e[e.None=0]="None",e[e.NoTruncation=1]="NoTruncation",e[e.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",e[e.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",e[e.UseStructuralFallback=8]="UseStructuralFallback",e[e.ForbidIndexedAccessSymbolReferences=16]="ForbidIndexedAccessSymbolReferences",e[e.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",e[e.UseFullyQualifiedType=64]="UseFullyQualifiedType",e[e.UseOnlyExternalAliasing=128]="UseOnlyExternalAliasing",e[e.SuppressAnyReturnType=256]="SuppressAnyReturnType",e[e.WriteTypeParametersInQualifiedName=512]="WriteTypeParametersInQualifiedName",e[e.MultilineObjectLiterals=1024]="MultilineObjectLiterals",e[e.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",e[e.UseTypeOfFunction=4096]="UseTypeOfFunction",e[e.OmitParameterModifiers=8192]="OmitParameterModifiers",e[e.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",e[e.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",e[e.NoTypeReduction=536870912]="NoTypeReduction",e[e.OmitThisParameter=33554432]="OmitThisParameter",e[e.AllowThisInObjectLiteral=32768]="AllowThisInObjectLiteral",e[e.AllowQualifiedNameInPlaceOfIdentifier=65536]="AllowQualifiedNameInPlaceOfIdentifier",e[e.AllowAnonymousIdentifier=131072]="AllowAnonymousIdentifier",e[e.AllowEmptyUnionOrIntersection=262144]="AllowEmptyUnionOrIntersection",e[e.AllowEmptyTuple=524288]="AllowEmptyTuple",e[e.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",e[e.AllowEmptyIndexInfoType=2097152]="AllowEmptyIndexInfoType",e[e.AllowNodeModulesRelativePaths=67108864]="AllowNodeModulesRelativePaths",e[e.IgnoreErrors=70221824]="IgnoreErrors",e[e.InObjectTypeLiteral=4194304]="InObjectTypeLiteral",e[e.InTypeAlias=8388608]="InTypeAlias",e[e.InInitialEntityName=16777216]="InInitialEntityName",e))(Mr||{}),Rr=(e=>(e[e.None=0]="None",e[e.WriteComputedProps=1]="WriteComputedProps",e[e.NoSyntacticPrinter=2]="NoSyntacticPrinter",e[e.DoNotIncludeSymbolChain=4]="DoNotIncludeSymbolChain",e[e.AllowUnresolvedNames=8]="AllowUnresolvedNames",e))(Rr||{}),Br=(e=>(e[e.None=0]="None",e[e.NoTruncation=1]="NoTruncation",e[e.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",e[e.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",e[e.UseStructuralFallback=8]="UseStructuralFallback",e[e.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",e[e.UseFullyQualifiedType=64]="UseFullyQualifiedType",e[e.SuppressAnyReturnType=256]="SuppressAnyReturnType",e[e.MultilineObjectLiterals=1024]="MultilineObjectLiterals",e[e.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",e[e.UseTypeOfFunction=4096]="UseTypeOfFunction",e[e.OmitParameterModifiers=8192]="OmitParameterModifiers",e[e.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",e[e.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",e[e.NoTypeReduction=536870912]="NoTypeReduction",e[e.OmitThisParameter=33554432]="OmitThisParameter",e[e.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",e[e.AddUndefined=131072]="AddUndefined",e[e.WriteArrowStyleSignature=262144]="WriteArrowStyleSignature",e[e.InArrayType=524288]="InArrayType",e[e.InElementType=2097152]="InElementType",e[e.InFirstTypeArgument=4194304]="InFirstTypeArgument",e[e.InTypeAlias=8388608]="InTypeAlias",e[e.NodeBuilderFlagsMask=848330095]="NodeBuilderFlagsMask",e))(Br||{}),Jr=(e=>(e[e.None=0]="None",e[e.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",e[e.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing",e[e.AllowAnyNodeKind=4]="AllowAnyNodeKind",e[e.UseAliasDefinedOutsideCurrentScope=8]="UseAliasDefinedOutsideCurrentScope",e[e.WriteComputedProps=16]="WriteComputedProps",e[e.DoNotIncludeSymbolChain=32]="DoNotIncludeSymbolChain",e))(Jr||{}),zr=(e=>(e[e.Accessible=0]="Accessible",e[e.NotAccessible=1]="NotAccessible",e[e.CannotBeNamed=2]="CannotBeNamed",e[e.NotResolved=3]="NotResolved",e))(zr||{}),qr=(e=>(e[e.This=0]="This",e[e.Identifier=1]="Identifier",e[e.AssertsThis=2]="AssertsThis",e[e.AssertsIdentifier=3]="AssertsIdentifier",e))(qr||{}),Ur=(e=>(e[e.Unknown=0]="Unknown",e[e.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",e[e.VoidNullableOrNeverType=2]="VoidNullableOrNeverType",e[e.NumberLikeType=3]="NumberLikeType",e[e.BigIntLikeType=4]="BigIntLikeType",e[e.StringLikeType=5]="StringLikeType",e[e.BooleanType=6]="BooleanType",e[e.ArrayLikeType=7]="ArrayLikeType",e[e.ESSymbolType=8]="ESSymbolType",e[e.Promise=9]="Promise",e[e.TypeWithCallSignature=10]="TypeWithCallSignature",e[e.ObjectType=11]="ObjectType",e))(Ur||{}),Vr=(e=>(e[e.None=0]="None",e[e.FunctionScopedVariable=1]="FunctionScopedVariable",e[e.BlockScopedVariable=2]="BlockScopedVariable",e[e.Property=4]="Property",e[e.EnumMember=8]="EnumMember",e[e.Function=16]="Function",e[e.Class=32]="Class",e[e.Interface=64]="Interface",e[e.ConstEnum=128]="ConstEnum",e[e.RegularEnum=256]="RegularEnum",e[e.ValueModule=512]="ValueModule",e[e.NamespaceModule=1024]="NamespaceModule",e[e.TypeLiteral=2048]="TypeLiteral",e[e.ObjectLiteral=4096]="ObjectLiteral",e[e.Method=8192]="Method",e[e.Constructor=16384]="Constructor",e[e.GetAccessor=32768]="GetAccessor",e[e.SetAccessor=65536]="SetAccessor",e[e.Signature=131072]="Signature",e[e.TypeParameter=262144]="TypeParameter",e[e.TypeAlias=524288]="TypeAlias",e[e.ExportValue=1048576]="ExportValue",e[e.Alias=2097152]="Alias",e[e.Prototype=4194304]="Prototype",e[e.ExportStar=8388608]="ExportStar",e[e.Optional=16777216]="Optional",e[e.Transient=33554432]="Transient",e[e.Assignment=67108864]="Assignment",e[e.ModuleExports=134217728]="ModuleExports",e[e.All=-1]="All",e[e.Enum=384]="Enum",e[e.Variable=3]="Variable",e[e.Value=111551]="Value",e[e.Type=788968]="Type",e[e.Namespace=1920]="Namespace",e[e.Module=1536]="Module",e[e.Accessor=98304]="Accessor",e[e.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",e[e.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",e[e.ParameterExcludes=111551]="ParameterExcludes",e[e.PropertyExcludes=0]="PropertyExcludes",e[e.EnumMemberExcludes=900095]="EnumMemberExcludes",e[e.FunctionExcludes=110991]="FunctionExcludes",e[e.ClassExcludes=899503]="ClassExcludes",e[e.InterfaceExcludes=788872]="InterfaceExcludes",e[e.RegularEnumExcludes=899327]="RegularEnumExcludes",e[e.ConstEnumExcludes=899967]="ConstEnumExcludes",e[e.ValueModuleExcludes=110735]="ValueModuleExcludes",e[e.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",e[e.MethodExcludes=103359]="MethodExcludes",e[e.GetAccessorExcludes=46015]="GetAccessorExcludes",e[e.SetAccessorExcludes=78783]="SetAccessorExcludes",e[e.AccessorExcludes=13247]="AccessorExcludes",e[e.TypeParameterExcludes=526824]="TypeParameterExcludes",e[e.TypeAliasExcludes=788968]="TypeAliasExcludes",e[e.AliasExcludes=2097152]="AliasExcludes",e[e.ModuleMember=2623475]="ModuleMember",e[e.ExportHasLocal=944]="ExportHasLocal",e[e.BlockScoped=418]="BlockScoped",e[e.PropertyOrAccessor=98308]="PropertyOrAccessor",e[e.ClassMember=106500]="ClassMember",e[e.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",e[e.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",e[e.Classifiable=2885600]="Classifiable",e[e.LateBindingContainer=6256]="LateBindingContainer",e))(Vr||{}),Wr=(e=>(e[e.None=0]="None",e[e.Instantiated=1]="Instantiated",e[e.SyntheticProperty=2]="SyntheticProperty",e[e.SyntheticMethod=4]="SyntheticMethod",e[e.Readonly=8]="Readonly",e[e.ReadPartial=16]="ReadPartial",e[e.WritePartial=32]="WritePartial",e[e.HasNonUniformType=64]="HasNonUniformType",e[e.HasLiteralType=128]="HasLiteralType",e[e.ContainsPublic=256]="ContainsPublic",e[e.ContainsProtected=512]="ContainsProtected",e[e.ContainsPrivate=1024]="ContainsPrivate",e[e.ContainsStatic=2048]="ContainsStatic",e[e.Late=4096]="Late",e[e.ReverseMapped=8192]="ReverseMapped",e[e.OptionalParameter=16384]="OptionalParameter",e[e.RestParameter=32768]="RestParameter",e[e.DeferredType=65536]="DeferredType",e[e.HasNeverType=131072]="HasNeverType",e[e.Mapped=262144]="Mapped",e[e.StripOptional=524288]="StripOptional",e[e.Unresolved=1048576]="Unresolved",e[e.Synthetic=6]="Synthetic",e[e.Discriminant=192]="Discriminant",e[e.Partial=48]="Partial",e))(Wr||{}),$r=(e=>(e.Call="__call",e.Constructor="__constructor",e.New="__new",e.Index="__index",e.ExportStar="__export",e.Global="__global",e.Missing="__missing",e.Type="__type",e.Object="__object",e.JSXAttributes="__jsxAttributes",e.Class="__class",e.Function="__function",e.Computed="__computed",e.Resolving="__resolving__",e.ExportEquals="export=",e.Default="default",e.This="this",e.InstantiationExpression="__instantiationExpression",e.ImportAttributes="__importAttributes",e))($r||{}),Hr=(e=>(e[e.None=0]="None",e[e.TypeChecked=1]="TypeChecked",e[e.LexicalThis=2]="LexicalThis",e[e.CaptureThis=4]="CaptureThis",e[e.CaptureNewTarget=8]="CaptureNewTarget",e[e.SuperInstance=16]="SuperInstance",e[e.SuperStatic=32]="SuperStatic",e[e.ContextChecked=64]="ContextChecked",e[e.MethodWithSuperPropertyAccessInAsync=128]="MethodWithSuperPropertyAccessInAsync",e[e.MethodWithSuperPropertyAssignmentInAsync=256]="MethodWithSuperPropertyAssignmentInAsync",e[e.CaptureArguments=512]="CaptureArguments",e[e.EnumValuesComputed=1024]="EnumValuesComputed",e[e.LexicalModuleMergesWithClass=2048]="LexicalModuleMergesWithClass",e[e.LoopWithCapturedBlockScopedBinding=4096]="LoopWithCapturedBlockScopedBinding",e[e.ContainsCapturedBlockScopeBinding=8192]="ContainsCapturedBlockScopeBinding",e[e.CapturedBlockScopedBinding=16384]="CapturedBlockScopedBinding",e[e.BlockScopedBindingInLoop=32768]="BlockScopedBindingInLoop",e[e.NeedsLoopOutParameter=65536]="NeedsLoopOutParameter",e[e.AssignmentsMarked=131072]="AssignmentsMarked",e[e.ContainsConstructorReference=262144]="ContainsConstructorReference",e[e.ConstructorReference=536870912]="ConstructorReference",e[e.ContainsClassWithPrivateIdentifiers=1048576]="ContainsClassWithPrivateIdentifiers",e[e.ContainsSuperPropertyInStaticInitializer=2097152]="ContainsSuperPropertyInStaticInitializer",e[e.InCheckIdentifier=4194304]="InCheckIdentifier",e[e.PartiallyTypeChecked=8388608]="PartiallyTypeChecked",e[e.LazyFlags=539358128]="LazyFlags",e))(Hr||{}),Kr=(e=>(e[e.Any=1]="Any",e[e.Unknown=2]="Unknown",e[e.String=4]="String",e[e.Number=8]="Number",e[e.Boolean=16]="Boolean",e[e.Enum=32]="Enum",e[e.BigInt=64]="BigInt",e[e.StringLiteral=128]="StringLiteral",e[e.NumberLiteral=256]="NumberLiteral",e[e.BooleanLiteral=512]="BooleanLiteral",e[e.EnumLiteral=1024]="EnumLiteral",e[e.BigIntLiteral=2048]="BigIntLiteral",e[e.ESSymbol=4096]="ESSymbol",e[e.UniqueESSymbol=8192]="UniqueESSymbol",e[e.Void=16384]="Void",e[e.Undefined=32768]="Undefined",e[e.Null=65536]="Null",e[e.Never=131072]="Never",e[e.TypeParameter=262144]="TypeParameter",e[e.Object=524288]="Object",e[e.Union=1048576]="Union",e[e.Intersection=2097152]="Intersection",e[e.Index=4194304]="Index",e[e.IndexedAccess=8388608]="IndexedAccess",e[e.Conditional=16777216]="Conditional",e[e.Substitution=33554432]="Substitution",e[e.NonPrimitive=67108864]="NonPrimitive",e[e.TemplateLiteral=134217728]="TemplateLiteral",e[e.StringMapping=268435456]="StringMapping",e[e.Reserved1=536870912]="Reserved1",e[e.Reserved2=1073741824]="Reserved2",e[e.AnyOrUnknown=3]="AnyOrUnknown",e[e.Nullable=98304]="Nullable",e[e.Literal=2944]="Literal",e[e.Unit=109472]="Unit",e[e.Freshable=2976]="Freshable",e[e.StringOrNumberLiteral=384]="StringOrNumberLiteral",e[e.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",e[e.DefinitelyFalsy=117632]="DefinitelyFalsy",e[e.PossiblyFalsy=117724]="PossiblyFalsy",e[e.Intrinsic=67359327]="Intrinsic",e[e.StringLike=402653316]="StringLike",e[e.NumberLike=296]="NumberLike",e[e.BigIntLike=2112]="BigIntLike",e[e.BooleanLike=528]="BooleanLike",e[e.EnumLike=1056]="EnumLike",e[e.ESSymbolLike=12288]="ESSymbolLike",e[e.VoidLike=49152]="VoidLike",e[e.Primitive=402784252]="Primitive",e[e.DefinitelyNonNullable=470302716]="DefinitelyNonNullable",e[e.DisjointDomains=469892092]="DisjointDomains",e[e.UnionOrIntersection=3145728]="UnionOrIntersection",e[e.StructuredType=3670016]="StructuredType",e[e.TypeVariable=8650752]="TypeVariable",e[e.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",e[e.InstantiablePrimitive=406847488]="InstantiablePrimitive",e[e.Instantiable=465829888]="Instantiable",e[e.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",e[e.ObjectFlagsType=3899393]="ObjectFlagsType",e[e.Simplifiable=25165824]="Simplifiable",e[e.Singleton=67358815]="Singleton",e[e.Narrowable=536624127]="Narrowable",e[e.IncludesMask=473694207]="IncludesMask",e[e.IncludesMissingType=262144]="IncludesMissingType",e[e.IncludesNonWideningType=4194304]="IncludesNonWideningType",e[e.IncludesWildcard=8388608]="IncludesWildcard",e[e.IncludesEmptyObject=16777216]="IncludesEmptyObject",e[e.IncludesInstantiable=33554432]="IncludesInstantiable",e[e.IncludesConstrainedTypeVariable=536870912]="IncludesConstrainedTypeVariable",e[e.IncludesError=1073741824]="IncludesError",e[e.NotPrimitiveUnion=36323331]="NotPrimitiveUnion",e))(Kr||{}),Gr=(e=>(e[e.None=0]="None",e[e.Class=1]="Class",e[e.Interface=2]="Interface",e[e.Reference=4]="Reference",e[e.Tuple=8]="Tuple",e[e.Anonymous=16]="Anonymous",e[e.Mapped=32]="Mapped",e[e.Instantiated=64]="Instantiated",e[e.ObjectLiteral=128]="ObjectLiteral",e[e.EvolvingArray=256]="EvolvingArray",e[e.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",e[e.ReverseMapped=1024]="ReverseMapped",e[e.JsxAttributes=2048]="JsxAttributes",e[e.JSLiteral=4096]="JSLiteral",e[e.FreshLiteral=8192]="FreshLiteral",e[e.ArrayLiteral=16384]="ArrayLiteral",e[e.PrimitiveUnion=32768]="PrimitiveUnion",e[e.ContainsWideningType=65536]="ContainsWideningType",e[e.ContainsObjectOrArrayLiteral=131072]="ContainsObjectOrArrayLiteral",e[e.NonInferrableType=262144]="NonInferrableType",e[e.CouldContainTypeVariablesComputed=524288]="CouldContainTypeVariablesComputed",e[e.CouldContainTypeVariables=1048576]="CouldContainTypeVariables",e[e.SingleSignatureType=134217728]="SingleSignatureType",e[e.ClassOrInterface=3]="ClassOrInterface",e[e.RequiresWidening=196608]="RequiresWidening",e[e.PropagatingFlags=458752]="PropagatingFlags",e[e.InstantiatedMapped=96]="InstantiatedMapped",e[e.ObjectTypeKindMask=1343]="ObjectTypeKindMask",e[e.ContainsSpread=2097152]="ContainsSpread",e[e.ObjectRestType=4194304]="ObjectRestType",e[e.InstantiationExpressionType=8388608]="InstantiationExpressionType",e[e.IsClassInstanceClone=16777216]="IsClassInstanceClone",e[e.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",e[e.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",e[e.IsGenericTypeComputed=2097152]="IsGenericTypeComputed",e[e.IsGenericObjectType=4194304]="IsGenericObjectType",e[e.IsGenericIndexType=8388608]="IsGenericIndexType",e[e.IsGenericType=12582912]="IsGenericType",e[e.ContainsIntersections=16777216]="ContainsIntersections",e[e.IsUnknownLikeUnionComputed=33554432]="IsUnknownLikeUnionComputed",e[e.IsUnknownLikeUnion=67108864]="IsUnknownLikeUnion",e[e.IsNeverIntersectionComputed=16777216]="IsNeverIntersectionComputed",e[e.IsNeverIntersection=33554432]="IsNeverIntersection",e[e.IsConstrainedTypeVariable=67108864]="IsConstrainedTypeVariable",e))(Gr||{}),Xr=(e=>(e[e.Invariant=0]="Invariant",e[e.Covariant=1]="Covariant",e[e.Contravariant=2]="Contravariant",e[e.Bivariant=3]="Bivariant",e[e.Independent=4]="Independent",e[e.VarianceMask=7]="VarianceMask",e[e.Unmeasurable=8]="Unmeasurable",e[e.Unreliable=16]="Unreliable",e[e.AllowsStructuralFallback=24]="AllowsStructuralFallback",e))(Xr||{}),Qr=(e=>(e[e.Required=1]="Required",e[e.Optional=2]="Optional",e[e.Rest=4]="Rest",e[e.Variadic=8]="Variadic",e[e.Fixed=3]="Fixed",e[e.Variable=12]="Variable",e[e.NonRequired=14]="NonRequired",e[e.NonRest=11]="NonRest",e))(Qr||{}),Yr=(e=>(e[e.None=0]="None",e[e.IncludeUndefined=1]="IncludeUndefined",e[e.NoIndexSignatures=2]="NoIndexSignatures",e[e.Writing=4]="Writing",e[e.CacheSymbol=8]="CacheSymbol",e[e.AllowMissing=16]="AllowMissing",e[e.ExpressionPosition=32]="ExpressionPosition",e[e.ReportDeprecated=64]="ReportDeprecated",e[e.SuppressNoImplicitAnyError=128]="SuppressNoImplicitAnyError",e[e.Contextual=256]="Contextual",e[e.Persistent=1]="Persistent",e))(Yr||{}),Zr=(e=>(e[e.None=0]="None",e[e.StringsOnly=1]="StringsOnly",e[e.NoIndexSignatures=2]="NoIndexSignatures",e[e.NoReducibleCheck=4]="NoReducibleCheck",e))(Zr||{}),ei=(e=>(e[e.Component=0]="Component",e[e.Function=1]="Function",e[e.Mixed=2]="Mixed",e))(ei||{}),ti=(e=>(e[e.Call=0]="Call",e[e.Construct=1]="Construct",e))(ti||{}),ni=(e=>(e[e.None=0]="None",e[e.HasRestParameter=1]="HasRestParameter",e[e.HasLiteralTypes=2]="HasLiteralTypes",e[e.Abstract=4]="Abstract",e[e.IsInnerCallChain=8]="IsInnerCallChain",e[e.IsOuterCallChain=16]="IsOuterCallChain",e[e.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",e[e.IsNonInferrable=64]="IsNonInferrable",e[e.IsSignatureCandidateForOverloadFailure=128]="IsSignatureCandidateForOverloadFailure",e[e.PropagatingFlags=167]="PropagatingFlags",e[e.CallChainFlags=24]="CallChainFlags",e))(ni||{}),ri=(e=>(e[e.String=0]="String",e[e.Number=1]="Number",e))(ri||{}),ii=(e=>(e[e.Simple=0]="Simple",e[e.Array=1]="Array",e[e.Deferred=2]="Deferred",e[e.Function=3]="Function",e[e.Composite=4]="Composite",e[e.Merged=5]="Merged",e))(ii||{}),oi=(e=>(e[e.None=0]="None",e[e.NakedTypeVariable=1]="NakedTypeVariable",e[e.SpeculativeTuple=2]="SpeculativeTuple",e[e.SubstituteSource=4]="SubstituteSource",e[e.HomomorphicMappedType=8]="HomomorphicMappedType",e[e.PartialHomomorphicMappedType=16]="PartialHomomorphicMappedType",e[e.MappedTypeConstraint=32]="MappedTypeConstraint",e[e.ContravariantConditional=64]="ContravariantConditional",e[e.ReturnType=128]="ReturnType",e[e.LiteralKeyof=256]="LiteralKeyof",e[e.NoConstraints=512]="NoConstraints",e[e.AlwaysStrict=1024]="AlwaysStrict",e[e.MaxValue=2048]="MaxValue",e[e.PriorityImpliesCombination=416]="PriorityImpliesCombination",e[e.Circularity=-1]="Circularity",e))(oi||{}),ai=(e=>(e[e.None=0]="None",e[e.NoDefault=1]="NoDefault",e[e.AnyDefault=2]="AnyDefault",e[e.SkippedGenericFunction=4]="SkippedGenericFunction",e))(ai||{}),si=(e=>(e[e.False=0]="False",e[e.Unknown=1]="Unknown",e[e.Maybe=3]="Maybe",e[e.True=-1]="True",e))(si||{}),ci=(e=>(e[e.None=0]="None",e[e.ExportsProperty=1]="ExportsProperty",e[e.ModuleExports=2]="ModuleExports",e[e.PrototypeProperty=3]="PrototypeProperty",e[e.ThisProperty=4]="ThisProperty",e[e.Property=5]="Property",e[e.Prototype=6]="Prototype",e[e.ObjectDefinePropertyValue=7]="ObjectDefinePropertyValue",e[e.ObjectDefinePropertyExports=8]="ObjectDefinePropertyExports",e[e.ObjectDefinePrototypeProperty=9]="ObjectDefinePrototypeProperty",e))(ci||{}),li=(e=>(e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Suggestion=2]="Suggestion",e[e.Message=3]="Message",e))(li||{});function _i(e,t=!0){const n=li[e.category];return t?n.toLowerCase():n}var ui=(e=>(e[e.Classic=1]="Classic",e[e.NodeJs=2]="NodeJs",e[e.Node10=2]="Node10",e[e.Node16=3]="Node16",e[e.NodeNext=99]="NodeNext",e[e.Bundler=100]="Bundler",e))(ui||{}),di=(e=>(e[e.Legacy=1]="Legacy",e[e.Auto=2]="Auto",e[e.Force=3]="Force",e))(di||{}),pi=(e=>(e[e.FixedPollingInterval=0]="FixedPollingInterval",e[e.PriorityPollingInterval=1]="PriorityPollingInterval",e[e.DynamicPriorityPolling=2]="DynamicPriorityPolling",e[e.FixedChunkSizePolling=3]="FixedChunkSizePolling",e[e.UseFsEvents=4]="UseFsEvents",e[e.UseFsEventsOnParentDirectory=5]="UseFsEventsOnParentDirectory",e))(pi||{}),fi=(e=>(e[e.UseFsEvents=0]="UseFsEvents",e[e.FixedPollingInterval=1]="FixedPollingInterval",e[e.DynamicPriorityPolling=2]="DynamicPriorityPolling",e[e.FixedChunkSizePolling=3]="FixedChunkSizePolling",e))(fi||{}),mi=(e=>(e[e.FixedInterval=0]="FixedInterval",e[e.PriorityInterval=1]="PriorityInterval",e[e.DynamicPriority=2]="DynamicPriority",e[e.FixedChunkSize=3]="FixedChunkSize",e))(mi||{}),gi=(e=>(e[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES2015=5]="ES2015",e[e.ES2020=6]="ES2020",e[e.ES2022=7]="ES2022",e[e.ESNext=99]="ESNext",e[e.Node16=100]="Node16",e[e.Node18=101]="Node18",e[e.Node20=102]="Node20",e[e.NodeNext=199]="NodeNext",e[e.Preserve=200]="Preserve",e))(gi||{}),hi=(e=>(e[e.None=0]="None",e[e.Preserve=1]="Preserve",e[e.React=2]="React",e[e.ReactNative=3]="ReactNative",e[e.ReactJSX=4]="ReactJSX",e[e.ReactJSXDev=5]="ReactJSXDev",e))(hi||{}),yi=(e=>(e[e.Remove=0]="Remove",e[e.Preserve=1]="Preserve",e[e.Error=2]="Error",e))(yi||{}),vi=(e=>(e[e.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",e[e.LineFeed=1]="LineFeed",e))(vi||{}),bi=(e=>(e[e.Unknown=0]="Unknown",e[e.JS=1]="JS",e[e.JSX=2]="JSX",e[e.TS=3]="TS",e[e.TSX=4]="TSX",e[e.External=5]="External",e[e.JSON=6]="JSON",e[e.Deferred=7]="Deferred",e))(bi||{}),xi=(e=>(e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ES2021=8]="ES2021",e[e.ES2022=9]="ES2022",e[e.ES2023=10]="ES2023",e[e.ES2024=11]="ES2024",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest",e))(xi||{}),ki=(e=>(e[e.Standard=0]="Standard",e[e.JSX=1]="JSX",e))(ki||{}),Si=(e=>(e[e.None=0]="None",e[e.Recursive=1]="Recursive",e))(Si||{}),Ti=(e=>(e[e.EOF=-1]="EOF",e[e.nullCharacter=0]="nullCharacter",e[e.maxAsciiCharacter=127]="maxAsciiCharacter",e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.lineSeparator=8232]="lineSeparator",e[e.paragraphSeparator=8233]="paragraphSeparator",e[e.nextLine=133]="nextLine",e[e.space=32]="space",e[e.nonBreakingSpace=160]="nonBreakingSpace",e[e.enQuad=8192]="enQuad",e[e.emQuad=8193]="emQuad",e[e.enSpace=8194]="enSpace",e[e.emSpace=8195]="emSpace",e[e.threePerEmSpace=8196]="threePerEmSpace",e[e.fourPerEmSpace=8197]="fourPerEmSpace",e[e.sixPerEmSpace=8198]="sixPerEmSpace",e[e.figureSpace=8199]="figureSpace",e[e.punctuationSpace=8200]="punctuationSpace",e[e.thinSpace=8201]="thinSpace",e[e.hairSpace=8202]="hairSpace",e[e.zeroWidthSpace=8203]="zeroWidthSpace",e[e.narrowNoBreakSpace=8239]="narrowNoBreakSpace",e[e.ideographicSpace=12288]="ideographicSpace",e[e.mathematicalSpace=8287]="mathematicalSpace",e[e.ogham=5760]="ogham",e[e.replacementCharacter=65533]="replacementCharacter",e[e._=95]="_",e[e.$=36]="$",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.ampersand=38]="ampersand",e[e.asterisk=42]="asterisk",e[e.at=64]="at",e[e.backslash=92]="backslash",e[e.backtick=96]="backtick",e[e.bar=124]="bar",e[e.caret=94]="caret",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.closeParen=41]="closeParen",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.equals=61]="equals",e[e.exclamation=33]="exclamation",e[e.greaterThan=62]="greaterThan",e[e.hash=35]="hash",e[e.lessThan=60]="lessThan",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.openParen=40]="openParen",e[e.percent=37]="percent",e[e.plus=43]="plus",e[e.question=63]="question",e[e.semicolon=59]="semicolon",e[e.singleQuote=39]="singleQuote",e[e.slash=47]="slash",e[e.tilde=126]="tilde",e[e.backspace=8]="backspace",e[e.formFeed=12]="formFeed",e[e.byteOrderMark=65279]="byteOrderMark",e[e.tab=9]="tab",e[e.verticalTab=11]="verticalTab",e))(Ti||{}),Ci=(e=>(e.Ts=".ts",e.Tsx=".tsx",e.Dts=".d.ts",e.Js=".js",e.Jsx=".jsx",e.Json=".json",e.TsBuildInfo=".tsbuildinfo",e.Mjs=".mjs",e.Mts=".mts",e.Dmts=".d.mts",e.Cjs=".cjs",e.Cts=".cts",e.Dcts=".d.cts",e))(Ci||{}),wi=(e=>(e[e.None=0]="None",e[e.ContainsTypeScript=1]="ContainsTypeScript",e[e.ContainsJsx=2]="ContainsJsx",e[e.ContainsESNext=4]="ContainsESNext",e[e.ContainsES2022=8]="ContainsES2022",e[e.ContainsES2021=16]="ContainsES2021",e[e.ContainsES2020=32]="ContainsES2020",e[e.ContainsES2019=64]="ContainsES2019",e[e.ContainsES2018=128]="ContainsES2018",e[e.ContainsES2017=256]="ContainsES2017",e[e.ContainsES2016=512]="ContainsES2016",e[e.ContainsES2015=1024]="ContainsES2015",e[e.ContainsGenerator=2048]="ContainsGenerator",e[e.ContainsDestructuringAssignment=4096]="ContainsDestructuringAssignment",e[e.ContainsTypeScriptClassSyntax=8192]="ContainsTypeScriptClassSyntax",e[e.ContainsLexicalThis=16384]="ContainsLexicalThis",e[e.ContainsRestOrSpread=32768]="ContainsRestOrSpread",e[e.ContainsObjectRestOrSpread=65536]="ContainsObjectRestOrSpread",e[e.ContainsComputedPropertyName=131072]="ContainsComputedPropertyName",e[e.ContainsBlockScopedBinding=262144]="ContainsBlockScopedBinding",e[e.ContainsBindingPattern=524288]="ContainsBindingPattern",e[e.ContainsYield=1048576]="ContainsYield",e[e.ContainsAwait=2097152]="ContainsAwait",e[e.ContainsHoistedDeclarationOrCompletion=4194304]="ContainsHoistedDeclarationOrCompletion",e[e.ContainsDynamicImport=8388608]="ContainsDynamicImport",e[e.ContainsClassFields=16777216]="ContainsClassFields",e[e.ContainsDecorators=33554432]="ContainsDecorators",e[e.ContainsPossibleTopLevelAwait=67108864]="ContainsPossibleTopLevelAwait",e[e.ContainsLexicalSuper=134217728]="ContainsLexicalSuper",e[e.ContainsUpdateExpressionForIdentifier=268435456]="ContainsUpdateExpressionForIdentifier",e[e.ContainsPrivateIdentifierInExpression=536870912]="ContainsPrivateIdentifierInExpression",e[e.HasComputedFlags=-2147483648]="HasComputedFlags",e[e.AssertTypeScript=1]="AssertTypeScript",e[e.AssertJsx=2]="AssertJsx",e[e.AssertESNext=4]="AssertESNext",e[e.AssertES2022=8]="AssertES2022",e[e.AssertES2021=16]="AssertES2021",e[e.AssertES2020=32]="AssertES2020",e[e.AssertES2019=64]="AssertES2019",e[e.AssertES2018=128]="AssertES2018",e[e.AssertES2017=256]="AssertES2017",e[e.AssertES2016=512]="AssertES2016",e[e.AssertES2015=1024]="AssertES2015",e[e.AssertGenerator=2048]="AssertGenerator",e[e.AssertDestructuringAssignment=4096]="AssertDestructuringAssignment",e[e.OuterExpressionExcludes=-2147483648]="OuterExpressionExcludes",e[e.PropertyAccessExcludes=-2147483648]="PropertyAccessExcludes",e[e.NodeExcludes=-2147483648]="NodeExcludes",e[e.ArrowFunctionExcludes=-2072174592]="ArrowFunctionExcludes",e[e.FunctionExcludes=-1937940480]="FunctionExcludes",e[e.ConstructorExcludes=-1937948672]="ConstructorExcludes",e[e.MethodOrAccessorExcludes=-2005057536]="MethodOrAccessorExcludes",e[e.PropertyExcludes=-2013249536]="PropertyExcludes",e[e.ClassExcludes=-2147344384]="ClassExcludes",e[e.ModuleExcludes=-1941676032]="ModuleExcludes",e[e.TypeExcludes=-2]="TypeExcludes",e[e.ObjectLiteralExcludes=-2147278848]="ObjectLiteralExcludes",e[e.ArrayLiteralOrCallOrNewExcludes=-2147450880]="ArrayLiteralOrCallOrNewExcludes",e[e.VariableDeclarationListExcludes=-2146893824]="VariableDeclarationListExcludes",e[e.ParameterExcludes=-2147483648]="ParameterExcludes",e[e.CatchClauseExcludes=-2147418112]="CatchClauseExcludes",e[e.BindingPatternExcludes=-2147450880]="BindingPatternExcludes",e[e.ContainsLexicalThisOrSuper=134234112]="ContainsLexicalThisOrSuper",e[e.PropertyNamePropagatingFlags=134234112]="PropertyNamePropagatingFlags",e))(wi||{}),Ni=(e=>(e[e.TabStop=0]="TabStop",e[e.Placeholder=1]="Placeholder",e[e.Choice=2]="Choice",e[e.Variable=3]="Variable",e))(Ni||{}),Di=(e=>(e[e.None=0]="None",e[e.SingleLine=1]="SingleLine",e[e.MultiLine=2]="MultiLine",e[e.AdviseOnEmitNode=4]="AdviseOnEmitNode",e[e.NoSubstitution=8]="NoSubstitution",e[e.CapturesThis=16]="CapturesThis",e[e.NoLeadingSourceMap=32]="NoLeadingSourceMap",e[e.NoTrailingSourceMap=64]="NoTrailingSourceMap",e[e.NoSourceMap=96]="NoSourceMap",e[e.NoNestedSourceMaps=128]="NoNestedSourceMaps",e[e.NoTokenLeadingSourceMaps=256]="NoTokenLeadingSourceMaps",e[e.NoTokenTrailingSourceMaps=512]="NoTokenTrailingSourceMaps",e[e.NoTokenSourceMaps=768]="NoTokenSourceMaps",e[e.NoLeadingComments=1024]="NoLeadingComments",e[e.NoTrailingComments=2048]="NoTrailingComments",e[e.NoComments=3072]="NoComments",e[e.NoNestedComments=4096]="NoNestedComments",e[e.HelperName=8192]="HelperName",e[e.ExportName=16384]="ExportName",e[e.LocalName=32768]="LocalName",e[e.InternalName=65536]="InternalName",e[e.Indented=131072]="Indented",e[e.NoIndentation=262144]="NoIndentation",e[e.AsyncFunctionBody=524288]="AsyncFunctionBody",e[e.ReuseTempVariableScope=1048576]="ReuseTempVariableScope",e[e.CustomPrologue=2097152]="CustomPrologue",e[e.NoHoisting=4194304]="NoHoisting",e[e.Iterator=8388608]="Iterator",e[e.NoAsciiEscaping=16777216]="NoAsciiEscaping",e))(Di||{}),Fi=(e=>(e[e.None=0]="None",e[e.TypeScriptClassWrapper=1]="TypeScriptClassWrapper",e[e.NeverApplyImportHelper=2]="NeverApplyImportHelper",e[e.IgnoreSourceNewlines=4]="IgnoreSourceNewlines",e[e.Immutable=8]="Immutable",e[e.IndirectCall=16]="IndirectCall",e[e.TransformPrivateStaticElements=32]="TransformPrivateStaticElements",e))(Fi||{}),Ei={Classes:2,ForOf:2,Generators:2,Iteration:2,SpreadElements:2,RestElements:2,TaggedTemplates:2,DestructuringAssignment:2,BindingPatterns:2,ArrowFunctions:2,BlockScopedVariables:2,ObjectAssign:2,RegularExpressionFlagsUnicode:2,RegularExpressionFlagsSticky:2,Exponentiation:3,AsyncFunctions:4,ForAwaitOf:5,AsyncGenerators:5,AsyncIteration:5,ObjectSpreadRest:5,RegularExpressionFlagsDotAll:5,BindinglessCatch:6,BigInt:7,NullishCoalesce:7,OptionalChaining:7,LogicalAssignment:8,TopLevelAwait:9,ClassFields:9,PrivateNamesAndClassStaticBlocks:9,RegularExpressionFlagsHasIndices:9,ShebangComments:10,RegularExpressionFlagsUnicodeSets:11,UsingAndAwaitUsing:99,ClassAndClassElementDecorators:99},Pi=(e=>(e[e.Extends=1]="Extends",e[e.Assign=2]="Assign",e[e.Rest=4]="Rest",e[e.Decorate=8]="Decorate",e[e.ESDecorateAndRunInitializers=8]="ESDecorateAndRunInitializers",e[e.Metadata=16]="Metadata",e[e.Param=32]="Param",e[e.Awaiter=64]="Awaiter",e[e.Generator=128]="Generator",e[e.Values=256]="Values",e[e.Read=512]="Read",e[e.SpreadArray=1024]="SpreadArray",e[e.Await=2048]="Await",e[e.AsyncGenerator=4096]="AsyncGenerator",e[e.AsyncDelegator=8192]="AsyncDelegator",e[e.AsyncValues=16384]="AsyncValues",e[e.ExportStar=32768]="ExportStar",e[e.ImportStar=65536]="ImportStar",e[e.ImportDefault=131072]="ImportDefault",e[e.MakeTemplateObject=262144]="MakeTemplateObject",e[e.ClassPrivateFieldGet=524288]="ClassPrivateFieldGet",e[e.ClassPrivateFieldSet=1048576]="ClassPrivateFieldSet",e[e.ClassPrivateFieldIn=2097152]="ClassPrivateFieldIn",e[e.SetFunctionName=4194304]="SetFunctionName",e[e.PropKey=8388608]="PropKey",e[e.AddDisposableResourceAndDisposeResources=16777216]="AddDisposableResourceAndDisposeResources",e[e.RewriteRelativeImportExtension=33554432]="RewriteRelativeImportExtension",e[e.FirstEmitHelper=1]="FirstEmitHelper",e[e.LastEmitHelper=16777216]="LastEmitHelper",e[e.ForOfIncludes=256]="ForOfIncludes",e[e.ForAwaitOfIncludes=16384]="ForAwaitOfIncludes",e[e.AsyncGeneratorIncludes=6144]="AsyncGeneratorIncludes",e[e.AsyncDelegatorIncludes=26624]="AsyncDelegatorIncludes",e[e.SpreadIncludes=1536]="SpreadIncludes",e))(Pi||{}),Ai=(e=>(e[e.SourceFile=0]="SourceFile",e[e.Expression=1]="Expression",e[e.IdentifierName=2]="IdentifierName",e[e.MappedTypeParameter=3]="MappedTypeParameter",e[e.Unspecified=4]="Unspecified",e[e.EmbeddedStatement=5]="EmbeddedStatement",e[e.JsxAttributeValue=6]="JsxAttributeValue",e[e.ImportTypeNodeAttributes=7]="ImportTypeNodeAttributes",e))(Ai||{}),Ii=(e=>(e[e.Parentheses=1]="Parentheses",e[e.TypeAssertions=2]="TypeAssertions",e[e.NonNullAssertions=4]="NonNullAssertions",e[e.PartiallyEmittedExpressions=8]="PartiallyEmittedExpressions",e[e.ExpressionsWithTypeArguments=16]="ExpressionsWithTypeArguments",e[e.Satisfies=32]="Satisfies",e[e.Assertions=38]="Assertions",e[e.All=63]="All",e[e.ExcludeJSDocTypeAssertion=-2147483648]="ExcludeJSDocTypeAssertion",e))(Ii||{}),Oi=(e=>(e[e.None=0]="None",e[e.InParameters=1]="InParameters",e[e.VariablesHoistedInParameters=2]="VariablesHoistedInParameters",e))(Oi||{}),Li=(e=>(e[e.None=0]="None",e[e.SingleLine=0]="SingleLine",e[e.MultiLine=1]="MultiLine",e[e.PreserveLines=2]="PreserveLines",e[e.LinesMask=3]="LinesMask",e[e.NotDelimited=0]="NotDelimited",e[e.BarDelimited=4]="BarDelimited",e[e.AmpersandDelimited=8]="AmpersandDelimited",e[e.CommaDelimited=16]="CommaDelimited",e[e.AsteriskDelimited=32]="AsteriskDelimited",e[e.DelimitersMask=60]="DelimitersMask",e[e.AllowTrailingComma=64]="AllowTrailingComma",e[e.Indented=128]="Indented",e[e.SpaceBetweenBraces=256]="SpaceBetweenBraces",e[e.SpaceBetweenSiblings=512]="SpaceBetweenSiblings",e[e.Braces=1024]="Braces",e[e.Parenthesis=2048]="Parenthesis",e[e.AngleBrackets=4096]="AngleBrackets",e[e.SquareBrackets=8192]="SquareBrackets",e[e.BracketsMask=15360]="BracketsMask",e[e.OptionalIfUndefined=16384]="OptionalIfUndefined",e[e.OptionalIfEmpty=32768]="OptionalIfEmpty",e[e.Optional=49152]="Optional",e[e.PreferNewLine=65536]="PreferNewLine",e[e.NoTrailingNewLine=131072]="NoTrailingNewLine",e[e.NoInterveningComments=262144]="NoInterveningComments",e[e.NoSpaceIfEmpty=524288]="NoSpaceIfEmpty",e[e.SingleElement=1048576]="SingleElement",e[e.SpaceAfterList=2097152]="SpaceAfterList",e[e.Modifiers=2359808]="Modifiers",e[e.HeritageClauses=512]="HeritageClauses",e[e.SingleLineTypeLiteralMembers=768]="SingleLineTypeLiteralMembers",e[e.MultiLineTypeLiteralMembers=32897]="MultiLineTypeLiteralMembers",e[e.SingleLineTupleTypeElements=528]="SingleLineTupleTypeElements",e[e.MultiLineTupleTypeElements=657]="MultiLineTupleTypeElements",e[e.UnionTypeConstituents=516]="UnionTypeConstituents",e[e.IntersectionTypeConstituents=520]="IntersectionTypeConstituents",e[e.ObjectBindingPatternElements=525136]="ObjectBindingPatternElements",e[e.ArrayBindingPatternElements=524880]="ArrayBindingPatternElements",e[e.ObjectLiteralExpressionProperties=526226]="ObjectLiteralExpressionProperties",e[e.ImportAttributes=526226]="ImportAttributes",e[e.ImportClauseEntries=526226]="ImportClauseEntries",e[e.ArrayLiteralExpressionElements=8914]="ArrayLiteralExpressionElements",e[e.CommaListElements=528]="CommaListElements",e[e.CallExpressionArguments=2576]="CallExpressionArguments",e[e.NewExpressionArguments=18960]="NewExpressionArguments",e[e.TemplateExpressionSpans=262144]="TemplateExpressionSpans",e[e.SingleLineBlockStatements=768]="SingleLineBlockStatements",e[e.MultiLineBlockStatements=129]="MultiLineBlockStatements",e[e.VariableDeclarationList=528]="VariableDeclarationList",e[e.SingleLineFunctionBodyStatements=768]="SingleLineFunctionBodyStatements",e[e.MultiLineFunctionBodyStatements=1]="MultiLineFunctionBodyStatements",e[e.ClassHeritageClauses=0]="ClassHeritageClauses",e[e.ClassMembers=129]="ClassMembers",e[e.InterfaceMembers=129]="InterfaceMembers",e[e.EnumMembers=145]="EnumMembers",e[e.CaseBlockClauses=129]="CaseBlockClauses",e[e.NamedImportsOrExportsElements=525136]="NamedImportsOrExportsElements",e[e.JsxElementOrFragmentChildren=262144]="JsxElementOrFragmentChildren",e[e.JsxElementAttributes=262656]="JsxElementAttributes",e[e.CaseOrDefaultClauseStatements=163969]="CaseOrDefaultClauseStatements",e[e.HeritageClauseTypes=528]="HeritageClauseTypes",e[e.SourceFileStatements=131073]="SourceFileStatements",e[e.Decorators=2146305]="Decorators",e[e.TypeArguments=53776]="TypeArguments",e[e.TypeParameters=53776]="TypeParameters",e[e.Parameters=2576]="Parameters",e[e.IndexSignatureParameters=8848]="IndexSignatureParameters",e[e.JSDocComment=33]="JSDocComment",e))(Li||{}),ji=(e=>(e[e.None=0]="None",e[e.TripleSlashXML=1]="TripleSlashXML",e[e.SingleLine=2]="SingleLine",e[e.MultiLine=4]="MultiLine",e[e.All=7]="All",e[e.Default=7]="Default",e))(ji||{}),Mi={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0},{name:"resolution-mode",optional:!0},{name:"preserve",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}},Ri=(e=>(e[e.ParseAll=0]="ParseAll",e[e.ParseNone=1]="ParseNone",e[e.ParseForTypeErrors=2]="ParseForTypeErrors",e[e.ParseForTypeInfo=3]="ParseForTypeInfo",e))(Ri||{});function Bi(e){let t=5381;for(let n=0;n(e[e.Created=0]="Created",e[e.Changed=1]="Changed",e[e.Deleted=2]="Deleted",e))(zi||{}),qi=(e=>(e[e.High=2e3]="High",e[e.Medium=500]="Medium",e[e.Low=250]="Low",e))(qi||{}),Ui=new Date(0);function Vi(e,t){return e.getModifiedTime(t)||Ui}function Wi(e){return{250:e.Low,500:e.Medium,2e3:e.High}}var $i={Low:32,Medium:64,High:256},Hi=Wi($i),Ki=Wi($i);function Gi(e,t,n,r,i){let o=n;for(let s=t.length;r&&s;a(),s--){const a=t[n];if(!a)continue;if(a.isClosed){t[n]=void 0;continue}r--;const s=Zi(a,Vi(e,a.fileName));a.isClosed?t[n]=void 0:(null==i||i(a,n,s),t[n]&&(o{o.isClosed=!0,$t(t,o)}}};function a(e){const t=[];return t.pollingInterval=e,t.pollIndex=0,t.pollScheduled=!1,t}function s(e,t){t.pollIndex=l(t,t.pollingInterval,t.pollIndex,Hi[t.pollingInterval]),t.length?p(t.pollingInterval):(pn.assert(0===t.pollIndex),t.pollScheduled=!1)}function c(e,t){l(n,250,0,n.length),s(0,t),!t.pollScheduled&&n.length&&p(250)}function l(t,r,i,o){return Gi(e,t,i,o,function(e,i,o){o?(e.unchangedPolls=0,t!==n&&(t[i]=void 0,a=e,n.push(a),d(250))):e.unchangedPolls!==Ki[r]?e.unchangedPolls++:t===n?(e.unchangedPolls=1,t[i]=void 0,u(e,250)):2e3!==r&&(e.unchangedPolls++,t[i]=void 0,u(e,250===r?500:2e3));var a})}function _(e){switch(e){case 250:return r;case 500:return i;case 2e3:return o}}function u(e,t){_(t).push(e),d(t)}function d(e){_(e).pollScheduled||p(e)}function p(t){_(t).pollScheduled=e.setTimeout(250===t?c:s,t,250===t?"pollLowPollingIntervalQueue":"pollPollingIntervalQueue",_(t))}}function Qi(e,t,n,r){const i=Ke(),o=r?new Map:void 0,a=new Map,s=Ht(t);return function(t,r,c,l){const _=s(t);1===i.add(_,r).length&&o&&o.set(_,n(t)||Ui);const u=Ao(_)||".",d=a.get(u)||function(t,r,c){const l=e(t,1,(e,r)=>{if(!tt(r))return;const a=Uo(r,t),c=s(a),l=a&&i.get(c);if(l){let t,r=1;if(o){const i=o.get(c);if("change"===e&&(t=n(a)||Ui,t.getTime()===i.getTime()))return;t||(t=n(a)||Ui),o.set(c,t),i===Ui?r=0:t===Ui&&(r=2)}for(const e of l)e(a,r,t)}},!1,500,c);return l.referenceCount=0,a.set(r,l),l}(Ao(t)||".",u,l);return d.referenceCount++,{close:()=>{1===d.referenceCount?(d.close(),a.delete(u)):d.referenceCount--,i.remove(_,r)}}}}function Yi(e,t,n,r,i){const o=Ht(t)(n),a=e.get(o);return a?a.callbacks.push(r):e.set(o,{watcher:i((t,n,r)=>{var i;return null==(i=e.get(o))?void 0:i.callbacks.slice().forEach(e=>e(t,n,r))}),callbacks:[r]}),{close:()=>{const t=e.get(o);t&&Ut(t.callbacks,r)&&!t.callbacks.length&&(e.delete(o),GU(t))}}}function Zi(e,t){const n=e.mtime.getTime(),r=t.getTime();return n!==r&&(e.mtime=t,e.callback(e.fileName,eo(n,r),t),!0)}function eo(e,t){return 0===e?0:0===t?2:1}var to=["/node_modules/.","/.git","/.#"],no=ot;function ro(e){return no(e)}function io(e){no=e}function oo({watchDirectory:e,useCaseSensitiveFileNames:t,getCurrentDirectory:n,getAccessibleSortedChildDirectories:r,fileSystemEntryExists:i,realpath:o,setTimeout:a,clearTimeout:s}){const c=new Map,l=Ke(),u=new Map;let d;const p=Dt(!t),f=Ht(t);return(t,n,r,i)=>r?m(t,i,n):e(t,n,r,i);function m(t,n,r,o){const p=f(t);let m=c.get(p);m?m.refCount++:(m={watcher:e(t,e=>{var r;x(e,n)||((null==n?void 0:n.synchronousWatchDirectory)?((null==(r=c.get(p))?void 0:r.targetWatcher)||g(t,p,e),b(t,p,n)):function(e,t,n,r){const o=c.get(t);if(o&&i(e,1))return void function(e,t,n,r){const i=u.get(t);i?i.fileNames.push(n):u.set(t,{dirName:e,options:r,fileNames:[n]});d&&(s(d),d=void 0);d=a(h,1e3,"timerToUpdateChildWatches")}(e,t,n,r);g(e,t,n),v(o),y(o)}(t,p,e,n))},!1,n),refCount:1,childWatches:_,targetWatcher:void 0,links:void 0},c.set(p,m),b(t,p,n)),o&&(m.links??(m.links=new Set)).add(o);const k=r&&{dirName:t,callback:r};return k&&l.add(p,k),{dirName:t,close:()=>{var e;const t=pn.checkDefined(c.get(p));k&&l.remove(p,k),o&&(null==(e=t.links)||e.delete(o)),t.refCount--,t.refCount||(c.delete(p),t.links=void 0,GU(t),v(t),t.childWatches.forEach(sx))}}}function g(e,t,n,r){var i,o;let a,s;tt(n)?a=n:s=n,l.forEach((e,n)=>{if((!s||!0!==s.get(n))&&(n===t||Qt(t,n)&&t[n.length]===fo))if(s)if(r){const e=s.get(n);e?e.push(...r):s.set(n,r.slice())}else s.set(n,!0);else e.forEach(({callback:e})=>e(a))}),null==(o=null==(i=c.get(t))?void 0:i.links)||o.forEach(t=>{const n=n=>Jo(t,sa(e,n,f));s?g(t,f(t),s,null==r?void 0:r.map(n)):g(t,f(t),n(a))})}function h(){var e;d=void 0,ro(`sysLog:: onTimerToUpdateChildWatches:: ${u.size}`);const t=Wn(),n=new Map;for(;!d&&u.size;){const t=u.entries().next();pn.assert(!t.done);const{value:[r,{dirName:i,options:o,fileNames:a}]}=t;u.delete(r);const s=b(i,r,o);(null==(e=c.get(r))?void 0:e.targetWatcher)||g(i,r,n,s?void 0:a)}ro(`sysLog:: invokingWatchers:: Elapsed:: ${Wn()-t}ms:: ${u.size}`),l.forEach((e,t)=>{const r=n.get(t);r&&e.forEach(({callback:e,dirName:t})=>{Ze(r)?r.forEach(e):e(t)})});ro(`sysLog:: Elapsed:: ${Wn()-t}ms:: onTimerToUpdateChildWatches:: ${u.size} ${d}`)}function y(e){if(!e)return;const t=e.childWatches;e.childWatches=_;for(const e of t)e.close(),y(c.get(f(e.dirName)))}function v(e){(null==e?void 0:e.targetWatcher)&&(e.targetWatcher.close(),e.targetWatcher=void 0)}function b(e,t,n){const a=c.get(t);if(!a)return!1;const s=Vo(o(e));let l,u;return 0===p(s,e)?l=sn(i(e,1)?J(r(e),t=>{const r=Uo(t,e);return x(r,n)||0!==p(r,Vo(o(r)))?void 0:r}):_,a.childWatches,(e,t)=>p(e,t.dirName),function(e){d(m(e,n))},sx,d):a.targetWatcher&&0===p(s,a.targetWatcher.dirName)?(l=!1,pn.assert(a.childWatches===_)):(v(a),a.targetWatcher=m(s,n,void 0,e),a.childWatches.forEach(sx),l=!0),a.childWatches=u||_,l;function d(e){(u||(u=[])).push(e)}}function x(e,r){return H(to,n=>function(e,n){return!!e.includes(n)||!t&&f(e).includes(n)}(e,n))||so(e,r,t,n)}}var ao=(e=>(e[e.File=0]="File",e[e.Directory=1]="Directory",e))(ao||{});function so(e,t,n,r){return((null==t?void 0:t.excludeDirectories)||(null==t?void 0:t.excludeFiles))&&(Hj(e,null==t?void 0:t.excludeFiles,n,r())||Hj(e,null==t?void 0:t.excludeDirectories,n,r()))}function co(e,t,n,r,i){return(o,a)=>{if("rename"===o){const o=a?Vo(Jo(e,a)):e;a&&so(o,n,r,i)||t(o)}}}function lo({pollingWatchFileWorker:e,getModifiedTime:t,setTimeout:n,clearTimeout:r,fsWatchWorker:i,fileSystemEntryExists:o,useCaseSensitiveFileNames:a,getCurrentDirectory:s,fsSupportsRecursiveFsWatch:c,getAccessibleSortedChildDirectories:l,realpath:_,tscWatchFile:u,useNonPollingWatchers:d,tscWatchDirectory:p,inodeWatching:f,fsWatchWithTimestamp:m,sysLog:g}){const h=new Map,y=new Map,v=new Map;let b,x,k,S,T=!1;return{watchFile:C,watchDirectory:function(e,t,i,u){if(c)return P(e,1,co(e,t,u,a,s),i,500,KU(u));S||(S=oo({useCaseSensitiveFileNames:a,getCurrentDirectory:s,fileSystemEntryExists:o,getAccessibleSortedChildDirectories:l,watchDirectory:F,realpath:_,setTimeout:n,clearTimeout:r}));return S(e,t,i,u)}};function C(e,n,r,i){i=function(e,t){if(e&&void 0!==e.watchFile)return e;switch(u){case"PriorityPollingInterval":return{watchFile:1};case"DynamicPriorityPolling":return{watchFile:2};case"UseFsEvents":return D(4,1,e);case"UseFsEventsWithFallbackDynamicPolling":return D(4,2,e);case"UseFsEventsOnParentDirectory":t=!0;default:return t?D(5,1,e):{watchFile:4}}}(i,d);const o=pn.checkDefined(i.watchFile);switch(o){case 0:return E(e,n,250,void 0);case 1:return E(e,n,r,void 0);case 2:return w()(e,n,r,void 0);case 3:return N()(e,n,void 0,void 0);case 4:return P(e,0,function(e,t,n){return(r,i,o)=>{"rename"===r?(o||(o=n(e)||Ui),t(e,o!==Ui?0:2,o)):t(e,1,o)}}(e,n,t),!1,r,KU(i));case 5:return k||(k=Qi(P,a,t,m)),k(e,n,r,KU(i));default:pn.assertNever(o)}}function w(){return b||(b=Xi({getModifiedTime:t,setTimeout:n}))}function N(){return x||(x=function(e){const t=[];let n,r=0;return function(n,r){const i={fileName:n,callback:r,mtime:Vi(e,n)};return t.push(i),o(),{close:()=>{i.isClosed=!0,$t(t,i)}}};function i(){n=void 0,r=Gi(e,t,r,Hi[250]),o()}function o(){t.length&&!n&&(n=e.setTimeout(i,2e3,"pollQueue"))}}({getModifiedTime:t,setTimeout:n}))}function D(e,t,n){const r=null==n?void 0:n.fallbackPolling;return{watchFile:e,fallbackPolling:void 0===r?t:r}}function F(e,t,n,r){pn.assert(!n);const i=function(e){if(e&&void 0!==e.watchDirectory)return e;switch(p){case"RecursiveDirectoryUsingFsWatchFile":return{watchDirectory:1};case"RecursiveDirectoryUsingDynamicPriorityPolling":return{watchDirectory:2};default:const t=null==e?void 0:e.fallbackPolling;return{watchDirectory:0,fallbackPolling:void 0!==t?t:void 0}}}(r),o=pn.checkDefined(i.watchDirectory);switch(o){case 1:return E(e,()=>t(e),500,void 0);case 2:return w()(e,()=>t(e),500,void 0);case 3:return N()(e,()=>t(e),void 0,void 0);case 0:return P(e,1,co(e,t,r,a,s),n,500,KU(i));default:pn.assertNever(o)}}function E(t,n,r,i){return Yi(h,a,t,n,n=>e(t,n,r,i))}function P(e,n,r,s,c,l){return Yi(s?v:y,a,e,r,r=>function(e,n,r,a,s,c){let l,_;f&&(l=e.substring(e.lastIndexOf(fo)),_=l.slice(fo.length));let u=o(e,n)?p():v();return{close:()=>{u&&(u.close(),u=void 0)}};function d(t){u&&(g(`sysLog:: ${e}:: Changing watcher to ${t===p?"Present":"Missing"}FileSystemEntryWatcher`),u.close(),u=t())}function p(){if(T)return g(`sysLog:: ${e}:: Defaulting to watchFile`),y();try{const t=(1!==n&&m?A:i)(e,a,f?h:r);return t.on("error",()=>{r("rename",""),d(v)}),t}catch(t){return T||(T="ENOSPC"===t.code),g(`sysLog:: ${e}:: Changing to watchFile`),y()}}function h(n,i){let o;if(i&&Bt(i,"~")&&(o=i,i=i.slice(0,i.length-1)),"rename"!==n||i&&i!==_&&!Bt(i,l))o&&r(n,o),r(n,i);else{const a=t(e)||Ui;o&&r(n,o,a),r(n,i,a),f?d(a===Ui?v:p):a===Ui&&d(v)}}function y(){return C(e,function(e){return(t,n,r)=>e(1===n?"change":"rename","",r)}(r),s,c)}function v(){return C(e,(n,i,o)=>{0===i&&(o||(o=t(e)||Ui),o!==Ui&&(r("rename","",o),d(p)))},s,c)}}(e,n,r,s,c,l))}function A(e,n,r){let o=t(e)||Ui;return i(e,n,(n,i,a)=>{"change"===n&&(a||(a=t(e)||Ui),a.getTime()===o.getTime())||(o=a||t(e)||Ui,r(n,i,o))})}}function _o(e){const t=e.writeFile;e.writeFile=(n,r,i)=>ov(n,r,!!i,(n,r,i)=>t.call(e,n,r,i),t=>e.createDirectory(t),t=>e.directoryExists(t))}var uo=(()=>{let e;return dn()&&(e=function(){const e=/^native |^\([^)]+\)$|^(?:internal[\\/]|[\w\s]+(?:\.js)?$)/,t=n(84021),o=n(18641),a=n(82202);let s,c;try{s=n(72615)}catch{s=void 0}let l="./profile.cpuprofile";const _="darwin"===i.platform,u="linux"===i.platform||_,d={throwIfNoEntry:!1},p=a.platform(),f="win32"!==p&&"win64"!==p&&!D((k=r,k.replace(/\w/g,e=>{const t=e.toUpperCase();return e===t?e.toLowerCase():t}))),m=t.realpathSync.native?"win32"===i.platform?function(e){return e.length<260?t.realpathSync.native(e):t.realpathSync(e)}:t.realpathSync.native:t.realpathSync,g=r.endsWith("sys.js")?o.join(o.dirname("/"),"__fake__.js"):r,h="win32"===i.platform||_,y=ft(()=>i.cwd()),{watchFile:v,watchDirectory:b}=lo({pollingWatchFileWorker:function(e,n,r){let i;return t.watchFile(e,{persistent:!0,interval:r},o),{close:()=>t.unwatchFile(e,o)};function o(t,r){const o=0===+r.mtime||2===i;if(0===+t.mtime){if(o)return;i=2}else if(o)i=0;else{if(+t.mtime===+r.mtime)return;i=1}n(e,i,t.mtime)}},getModifiedTime:E,setTimeout,clearTimeout,fsWatchWorker:function(e,n,r){return t.watch(e,h?{persistent:!0,recursive:!!n}:{persistent:!0},r)},useCaseSensitiveFileNames:f,getCurrentDirectory:y,fileSystemEntryExists:N,fsSupportsRecursiveFsWatch:h,getAccessibleSortedChildDirectories:e=>w(e).directories,realpath:F,tscWatchFile:i.env.TSC_WATCHFILE,useNonPollingWatchers:!!i.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:i.env.TSC_WATCHDIRECTORY,inodeWatching:u,fsWatchWithTimestamp:_,sysLog:ro}),x={args:i.argv.slice(2),newLine:a.EOL,useCaseSensitiveFileNames:f,write(e){i.stdout.write(e)},getWidthOfTerminal:()=>i.stdout.columns,writeOutputIsTTY:()=>i.stdout.isTTY,readFile:function(e,n){let r;try{r=t.readFileSync(e)}catch{return}let i=r.length;if(i>=2&&254===r[0]&&255===r[1]){i&=-2;for(let e=0;e=2&&255===r[0]&&254===r[1]?r.toString("utf16le",2):i>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.toString("utf8",3):r.toString("utf8")},writeFile:function(e,n,r){let i;r&&(n="\ufeff"+n);try{i=t.openSync(e,"w"),t.writeSync(i,n,void 0,"utf8")}finally{void 0!==i&&t.closeSync(i)}},watchFile:v,watchDirectory:b,preferNonRecursiveWatch:!h,resolvePath:e=>o.resolve(e),fileExists:D,directoryExists:function(e){return N(e,1)},getAccessibleFileSystemEntries:w,createDirectory(e){if(!x.directoryExists(e))try{t.mkdirSync(e)}catch(e){if("EEXIST"!==e.code)throw e}},getExecutingFilePath:()=>g,getCurrentDirectory:y,getDirectories:function(e){return w(e).directories.slice()},getEnvironmentVariable:e=>i.env[e]||"",readDirectory:function(e,t,n,r,o){return kS(e,t,n,r,f,i.cwd(),o,w,F)},getModifiedTime:E,setModifiedTime:function(e,n){try{t.utimesSync(e,n,n)}catch{return}},deleteFile:function(e){try{return t.unlinkSync(e)}catch{return}},createHash:s?P:Bi,createSHA256Hash:s?P:void 0,getMemoryUsage:()=>(n.g.gc&&n.g.gc(),i.memoryUsage().heapUsed),getFileSize(e){const t=S(e);return(null==t?void 0:t.isFile())?t.size:0},exit(e){T(()=>i.exit(e))},enableCPUProfiler:function(e,t){if(c)return t(),!1;const r=n(66247);if(!r||!r.Session)return t(),!1;const i=new r.Session;return i.connect(),i.post("Profiler.enable",()=>{i.post("Profiler.start",()=>{c=i,l=e,t()})}),!0},disableCPUProfiler:T,cpuProfilingEnabled:()=>!!c||C(i.execArgv,"--cpu-prof")||C(i.execArgv,"--prof"),realpath:F,debugMode:!!i.env.NODE_INSPECTOR_IPC||!!i.env.VSCODE_INSPECTOR_OPTIONS||H(i.execArgv,e=>/^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(e))||!!i.recordreplay,tryEnableSourceMapsForHost(){try{n(97664).install()}catch{}},setTimeout,clearTimeout,clearScreen:()=>{i.stdout.write("")},setBlocking:()=>{var e;const t=null==(e=i.stdout)?void 0:e._handle;t&&t.setBlocking&&t.setBlocking(!0)},base64decode:e=>Buffer.from(e,"base64").toString("utf8"),base64encode:e=>Buffer.from(e).toString("base64"),require:(e,t)=>{try{const r=GM(t,e,x);return{module:n(89387)(r),modulePath:r,error:void 0}}catch(e){return{module:void 0,modulePath:void 0,error:e}}}};var k;return x;function S(e){try{return t.statSync(e,d)}catch{return}}function T(n){if(c&&"stopping"!==c){const r=c;return c.post("Profiler.stop",(a,{profile:s})=>{var _;if(!a){(null==(_=S(l))?void 0:_.isDirectory())&&(l=o.join(l,`${(new Date).toISOString().replace(/:/g,"-")}+P${i.pid}.cpuprofile`));try{t.mkdirSync(o.dirname(l),{recursive:!0})}catch{}t.writeFileSync(l,JSON.stringify(function(t){let n=0;const r=new Map,i=Ro(o.dirname(g)),a=`file://${1===Po(i)?"":"/"}${i}`;for(const i of t.nodes)if(i.callFrame.url){const t=Ro(i.callFrame.url);ia(a,t,f)?i.callFrame.url=_a(a,t,a,Ht(f),!0):e.test(t)||(i.callFrame.url=(r.has(t)?r:r.set(t,`external${n}.js`)).get(t),n++)}return t}(s)))}c=void 0,r.disconnect(),n()}),c="stopping",!0}return n(),!1}function w(e){try{const n=t.readdirSync(e||".",{withFileTypes:!0}),r=[],i=[];for(const t of n){const n="string"==typeof t?t:t.name;if("."===n||".."===n)continue;let o;if("string"==typeof t||t.isSymbolicLink()){if(o=S(Jo(e,n)),!o)continue}else o=t;o.isFile()?r.push(n):o.isDirectory()&&i.push(n)}return r.sort(),i.sort(),{files:r,directories:i}}catch{return cT}}function N(e,t){const n=S(e);if(!n)return!1;switch(t){case 0:return n.isFile();case 1:return n.isDirectory();default:return!1}}function D(e){return N(e,0)}function F(e){try{return m(e)}catch{return e}}function E(e){var t;return null==(t=S(e))?void 0:t.mtime}function P(e){const t=s.createHash("sha256");return t.update(e),t.digest("hex")}}()),e&&_o(e),e})();function po(e){uo=e}uo&&uo.getEnvironmentVariable&&(!function(e){if(!e.getEnvironmentVariable)return;const t=function(e,t){const r=n("TSC_WATCH_POLLINGINTERVAL");return!!r&&(i("Low"),i("Medium"),i("High"),!0);function i(e){t[e]=r[e]||t[e]}}(0,qi);function n(t){let n;return r("Low"),r("Medium"),r("High"),n;function r(r){const i=function(t,n){return e.getEnvironmentVariable(`${t}_${n.toUpperCase()}`)}(t,r);i&&((n||(n={}))[r]=Number(i))}}function r(e,r){const i=n(e);return(t||i)&&Wi(i?{...r,...i}:r)}Hi=r("TSC_WATCH_POLLINGCHUNKSIZE",$i)||Hi,Ki=r("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS",$i)||Ki}(uo),pn.setAssertionLevel(/^development$/i.test(uo.getEnvironmentVariable("NODE_ENV"))?1:0)),uo&&uo.debugMode&&(pn.isDebugging=!0);var fo="/",mo="\\",go="://",ho=/\\/g;function yo(e){return 47===e||92===e}function vo(e){return Eo(e)<0}function bo(e){return Eo(e)>0}function xo(e){const t=Eo(e);return t>0&&t===e.length}function ko(e){return 0!==Eo(e)}function So(e){return/^\.\.?(?:$|[\\/])/.test(e)}function To(e){return!ko(e)&&!So(e)}function Co(e){return Io(e).includes(".")}function wo(e,t){return e.length>t.length&&Bt(e,t)}function No(e,t){for(const n of t)if(wo(e,n))return!0;return!1}function Do(e){return e.length>0&&yo(e.charCodeAt(e.length-1))}function Fo(e){return e>=97&&e<=122||e>=65&&e<=90}function Eo(e){if(!e)return 0;const t=e.charCodeAt(0);if(47===t||92===t){if(e.charCodeAt(1)!==t)return 1;const n=e.indexOf(47===t?fo:mo,2);return n<0?e.length:n+1}if(Fo(t)&&58===e.charCodeAt(1)){const t=e.charCodeAt(2);if(47===t||92===t)return 3;if(2===e.length)return 2}const n=e.indexOf(go);if(-1!==n){const t=n+go.length,r=e.indexOf(fo,t);if(-1!==r){const i=e.slice(0,n),o=e.slice(t,r);if("file"===i&&(""===o||"localhost"===o)&&Fo(e.charCodeAt(r+1))){const t=function(e,t){const n=e.charCodeAt(t);if(58===n)return t+1;if(37===n&&51===e.charCodeAt(t+1)){const n=e.charCodeAt(t+2);if(97===n||65===n)return t+3}return-1}(e,r+2);if(-1!==t){if(47===e.charCodeAt(t))return~(t+1);if(t===e.length)return~t}}return~(r+1)}return~e.length}return 0}function Po(e){const t=Eo(e);return t<0?~t:t}function Ao(e){const t=Po(e=Ro(e));return t===e.length?e:(e=Ko(e)).slice(0,Math.max(t,e.lastIndexOf(fo)))}function Io(e,t,n){if(Po(e=Ro(e))===e.length)return"";const r=(e=Ko(e)).slice(Math.max(Po(e),e.lastIndexOf(fo)+1)),i=void 0!==t&&void 0!==n?Lo(r,t,n):void 0;return i?r.slice(0,r.length-i.length):r}function Oo(e,t,n){if(Qt(t,".")||(t="."+t),e.length>=t.length&&46===e.charCodeAt(e.length-t.length)){const r=e.slice(e.length-t.length);if(n(r,t))return r}}function Lo(e,t,n){if(t)return function(e,t,n){if("string"==typeof t)return Oo(e,t,n)||"";for(const r of t){const t=Oo(e,r,n);if(t)return t}return""}(Ko(e),t,n?yt:vt);const r=Io(e),i=r.lastIndexOf(".");return i>=0?r.substring(i):""}function jo(e,t=""){return function(e,t){const n=e.substring(0,t),r=e.substring(t).split(fo);return r.length&&!be(r)&&r.pop(),[n,...r]}(e=Jo(t,e),Po(e))}function Mo(e,t){if(0===e.length)return"";return(e[0]&&Go(e[0]))+e.slice(1,t).join(fo)}function Ro(e){return e.includes("\\")?e.replace(ho,fo):e}function Bo(e){if(!H(e))return[];const t=[e[0]];for(let n=1;n1){if(".."!==t[t.length-1]){t.pop();continue}}else if(t[0])continue;t.push(r)}}return t}function Jo(e,...t){e&&(e=Ro(e));for(let n of t)n&&(n=Ro(n),e=e&&0===Po(n)?Go(e)+n:n);return e}function zo(e,...t){return Vo(H(t)?Jo(e,...t):Ro(e))}function qo(e,t){return Bo(jo(e,t))}function Uo(e,t){let n=Po(e);0===n&&t?n=Po(e=Jo(t,e)):e=Ro(e);const r=Wo(e);if(void 0!==r)return r.length>n?Ko(r):r;const i=e.length,o=e.substring(0,n);let a,s=n,c=s,l=s,_=0!==n;for(;sc&&(a??(a=e.substring(0,c-1)),c=s);let r=e.indexOf(fo,s+1);-1===r&&(r=i);const u=r-c;if(1===u&&46===e.charCodeAt(s))a??(a=e.substring(0,l));else if(2===u&&46===e.charCodeAt(s)&&46===e.charCodeAt(s+1))if(_)if(void 0===a)a=l-2>=0?e.substring(0,Math.max(n,e.lastIndexOf(fo,l-2))):e.substring(0,l);else{const e=a.lastIndexOf(fo);a=-1!==e?a.substring(0,Math.max(n,e)):o,a.length===n&&(_=0!==n)}else void 0!==a?a+=a.length===n?"..":"/..":l=s+2;else void 0!==a?(a.length!==n&&(a+=fo),_=!0,a+=e.substring(c,r)):(_=!0,l=r);s=r+1}return a??(i>n?Ko(e):e)}function Vo(e){let t=Wo(e=Ro(e));return void 0!==t?t:(t=Uo(e,""),t&&Do(e)?Go(t):t)}function Wo(e){if(!Zo.test(e))return e;let t=e.replace(/\/\.\//g,"/");return t.startsWith("./")&&(t=t.slice(2)),t===e||(e=t,Zo.test(e))?void 0:e}function $o(e,t){return 0===(n=qo(e,t)).length?"":n.slice(1).join(fo);var n}function Ho(e,t,n){return n(bo(e)?Vo(e):Uo(e,t))}function Ko(e){return Do(e)?e.substr(0,e.length-1):e}function Go(e){return Do(e)?e:e+fo}function Xo(e){return ko(e)||So(e)?e:"./"+e}function Qo(e,t,n,r){const i=void 0!==n&&void 0!==r?Lo(e,n,r):Lo(e);return i?e.slice(0,e.length-i.length)+(Qt(t,".")?t:"."+t):e}function Yo(e,t){const n=bO(e);return n?e.slice(0,e.length-n.length)+(Qt(t,".")?t:"."+t):Qo(e,t)}var Zo=/\/\/|(?:^|\/)\.\.?(?:$|\/)/;function ea(e,t,n){if(e===t)return 0;if(void 0===e)return-1;if(void 0===t)return 1;const r=e.substring(0,Po(e)),i=t.substring(0,Po(t)),o=Ct(r,i);if(0!==o)return o;const a=e.substring(r.length),s=t.substring(i.length);if(!Zo.test(a)&&!Zo.test(s))return n(a,s);const c=Bo(jo(e)),l=Bo(jo(t)),_=Math.min(c.length,l.length);for(let e=1;e<_;e++){const t=n(c[e],l[e]);if(0!==t)return t}return xt(c.length,l.length)}function ta(e,t){return ea(e,t,Nt)}function na(e,t){return ea(e,t,Ct)}function ra(e,t,n,r){return"string"==typeof n?(e=Jo(n,e),t=Jo(n,t)):"boolean"==typeof n&&(r=n),ea(e,t,Dt(r))}function ia(e,t,n,r){if("string"==typeof n?(e=Jo(n,e),t=Jo(n,t)):"boolean"==typeof n&&(r=n),void 0===e||void 0===t)return!1;if(e===t)return!0;const i=Bo(jo(e)),o=Bo(jo(t));if(o.length0==Po(t)>0,"Paths must either both be absolute or both be relative");return Mo(aa(e,t,"boolean"==typeof n&&n?yt:vt,"function"==typeof n?n:lt))}function ca(e,t,n){return bo(e)?_a(t,e,t,n,!1):e}function la(e,t,n){return Xo(sa(Ao(e),t,n))}function _a(e,t,n,r,i){const o=aa(zo(n,e),zo(n,t),vt,r),a=o[0];if(i&&bo(a)){const e=a.charAt(0)===fo?"file://":"file:///";o[0]=e+a}return Mo(o)}function ua(e,t){for(;;){const n=t(e);if(void 0!==n)return n;const r=Ao(e);if(r===e)return;e=r}}function da(e){return Bt(e,"/node_modules")}function pa(e,t,n,r,i,o,a){return{code:e,category:t,key:n,message:r,reportsUnnecessary:i,elidedInCompatabilityPyramid:o,reportsDeprecated:a}}var fa={Unterminated_string_literal:pa(1002,1,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:pa(1003,1,"Identifier_expected_1003","Identifier expected."),_0_expected:pa(1005,1,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:pa(1006,1,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_1_to_match_the_0_token_here:pa(1007,1,"The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007","The parser expected to find a '{1}' to match the '{0}' token here."),Trailing_comma_not_allowed:pa(1009,1,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:pa(1010,1,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:pa(1011,1,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:pa(1012,1,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:pa(1013,1,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:pa(1014,1,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:pa(1015,1,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:pa(1016,1,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:pa(1017,1,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:pa(1018,1,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:pa(1019,1,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:pa(1020,1,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:pa(1021,1,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:pa(1022,1,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:pa(1024,1,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:pa(1025,1,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:pa(1028,1,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:pa(1029,1,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:pa(1030,1,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:pa(1031,1,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:pa(1034,1,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:pa(1035,1,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:pa(1036,1,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:pa(1038,1,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:pa(1039,1,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:pa(1040,1,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:pa(1042,1,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:pa(1044,1,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:pa(1046,1,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:pa(1047,1,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:pa(1048,1,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:pa(1049,1,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:pa(1051,1,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:pa(1052,1,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:pa(1053,1,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:pa(1054,1,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:pa(1055,1,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compa_1055","Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:pa(1056,1,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:pa(1058,1,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:pa(1059,1,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:pa(1060,1,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:pa(1061,1,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:pa(1062,1,"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:pa(1063,1,"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:pa(1064,1,"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:pa(1065,1,"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:pa(1066,1,"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:pa(1068,1,"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:pa(1069,1,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:pa(1070,1,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:pa(1071,1,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:pa(1079,1,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:pa(1084,1,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),_0_modifier_cannot_appear_on_a_constructor_declaration:pa(1089,1,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:pa(1090,1,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:pa(1091,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:pa(1092,1,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:pa(1093,1,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:pa(1094,1,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:pa(1095,1,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:pa(1096,1,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:pa(1097,1,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:pa(1098,1,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:pa(1099,1,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:pa(1100,1,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:pa(1101,1,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:pa(1102,1,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:pa(1103,1,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:pa(1104,1,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:pa(1105,1,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:pa(1106,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:pa(1107,1,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:pa(1108,1,"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:pa(1109,1,"Expression_expected_1109","Expression expected."),Type_expected:pa(1110,1,"Type_expected_1110","Type expected."),Private_field_0_must_be_declared_in_an_enclosing_class:pa(1111,1,"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:pa(1113,1,"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:pa(1114,1,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:pa(1115,1,"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."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:pa(1116,1,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:pa(1117,1,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:pa(1118,1,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:pa(1119,1,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:pa(1120,1,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_Use_the_syntax_0:pa(1121,1,"Octal_literals_are_not_allowed_Use_the_syntax_0_1121","Octal literals are not allowed. Use the syntax '{0}'."),Variable_declaration_list_cannot_be_empty:pa(1123,1,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:pa(1124,1,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:pa(1125,1,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:pa(1126,1,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:pa(1127,1,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:pa(1128,1,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:pa(1129,1,"Statement_expected_1129","Statement expected."),case_or_default_expected:pa(1130,1,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:pa(1131,1,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:pa(1132,1,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:pa(1134,1,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:pa(1135,1,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:pa(1136,1,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:pa(1137,1,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:pa(1138,1,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:pa(1139,1,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:pa(1140,1,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:pa(1141,1,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:pa(1142,1,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:pa(1144,1,"or_expected_1144","'{' or ';' expected."),or_JSX_element_expected:pa(1145,1,"or_JSX_element_expected_1145","'{' or JSX element expected."),Declaration_expected:pa(1146,1,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:pa(1147,1,"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:pa(1148,1,"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:pa(1149,1,"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."),_0_declarations_must_be_initialized:pa(1155,1,"_0_declarations_must_be_initialized_1155","'{0}' declarations must be initialized."),_0_declarations_can_only_be_declared_inside_a_block:pa(1156,1,"_0_declarations_can_only_be_declared_inside_a_block_1156","'{0}' declarations can only be declared inside a block."),Unterminated_template_literal:pa(1160,1,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:pa(1161,1,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:pa(1162,1,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:pa(1163,1,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:pa(1164,1,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:pa(1165,1,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:pa(1166,1,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:pa(1168,1,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:pa(1169,1,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:pa(1170,1,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:pa(1171,1,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:pa(1172,1,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:pa(1173,1,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:pa(1174,1,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:pa(1175,1,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:pa(1176,1,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:pa(1177,1,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:pa(1178,1,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:pa(1179,1,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:pa(1180,1,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:pa(1181,1,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:pa(1182,1,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:pa(1183,1,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:pa(1184,1,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:pa(1185,1,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:pa(1186,1,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:pa(1187,1,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:pa(1188,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:pa(1189,1,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:pa(1190,1,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:pa(1191,1,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:pa(1192,1,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:pa(1193,1,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:pa(1194,1,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:pa(1195,1,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:pa(1196,1,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:pa(1197,1,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:pa(1198,1,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:pa(1199,1,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:pa(1200,1,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),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:pa(1202,1,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202","Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead."),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:pa(1203,1,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_0_is_enabled_requires_using_export_type:pa(1205,1,"Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205","Re-exporting a type when '{0}' is enabled requires using 'export type'."),Decorators_are_not_valid_here:pa(1206,1,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:pa(1207,1,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0:pa(1209,1,"Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209","Invalid optional chain from new expression. Did you mean to call '{0}()'?"),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:pa(1210,1,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:pa(1211,1,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:pa(1212,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:pa(1213,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:pa(1214,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:pa(1215,1,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:pa(1216,1,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:pa(1218,1,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Generators_are_not_allowed_in_an_ambient_context:pa(1221,1,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:pa(1222,1,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:pa(1223,1,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:pa(1224,1,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:pa(1225,1,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:pa(1226,1,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:pa(1227,1,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:pa(1228,1,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:pa(1229,1,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:pa(1230,1,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:pa(1231,1,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:pa(1232,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:pa(1233,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:pa(1234,1,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:pa(1235,1,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:pa(1236,1,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:pa(1237,1,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:pa(1238,1,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:pa(1239,1,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:pa(1240,1,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:pa(1241,1,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:pa(1242,1,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:pa(1243,1,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:pa(1244,1,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:pa(1245,1,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:pa(1246,1,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:pa(1247,1,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:pa(1248,1,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:pa(1249,1,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5:pa(1250,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode:pa(1251,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definiti_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode:pa(1252,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_au_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode."),Abstract_properties_can_only_appear_within_an_abstract_class:pa(1253,1,"Abstract_properties_can_only_appear_within_an_abstract_class_1253","Abstract properties can only appear within an abstract class."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:pa(1254,1,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:pa(1255,1,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:pa(1257,1,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:pa(1258,1,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:pa(1259,1,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:pa(1260,1,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:pa(1261,1,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:pa(1262,1,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:pa(1263,1,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:pa(1264,1,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:pa(1265,1,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:pa(1266,1,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:pa(1267,1,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:pa(1268,1,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled:pa(1269,1,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269","Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."),Decorator_function_return_type_0_is_not_assignable_to_type_1:pa(1270,1,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:pa(1271,1,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:pa(1272,1,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:pa(1273,1,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:pa(1274,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),accessor_modifier_can_only_appear_on_a_property_declaration:pa(1275,1,"accessor_modifier_can_only_appear_on_a_property_declaration_1275","'accessor' modifier can only appear on a property declaration."),An_accessor_property_cannot_be_declared_optional:pa(1276,1,"An_accessor_property_cannot_be_declared_optional_1276","An 'accessor' property cannot be declared optional."),_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class:pa(1277,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277","'{0}' modifier can only appear on a type parameter of a function, method or class"),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0:pa(1278,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278","The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0:pa(1279,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279","The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."),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:pa(1280,1,"Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280","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."),Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead:pa(1281,1,"Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281","Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."),An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:pa(1282,1,"An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282","An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:pa(1283,1,"An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283","An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:pa(1284,1,"An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284","An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:pa(1285,1,"An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285","An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax:pa(1286,1,"ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286","ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'."),A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:pa(1287,1,"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:pa(1288,1,"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:pa(1289,1,"_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:pa(1290,1,"_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:pa(1291,1,"_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:pa(1292,1,"_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 }'."),ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve:pa(1293,1,"ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293","ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled:pa(1294,1,"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294","This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript:pa(1295,1,"ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295","ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript."),with_statements_are_not_allowed_in_an_async_function_block:pa(1300,1,"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:pa(1308,1,"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:pa(1309,1,"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."),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:pa(1312,1,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:pa(1313,1,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:pa(1314,1,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:pa(1315,1,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:pa(1316,1,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:pa(1317,1,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:pa(1318,1,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:pa(1319,1,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:pa(1320,1,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:pa(1321,1,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:pa(1322,1,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext:pa(1323,1,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve:pa(1324,1,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'."),Argument_of_dynamic_import_cannot_be_spread_element:pa(1325,1,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:pa(1326,1,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:pa(1327,1,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:pa(1328,1,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:pa(1329,1,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:pa(1330,1,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:pa(1331,1,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:pa(1332,1,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:pa(1333,1,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:pa(1334,1,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:pa(1335,1,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:pa(1337,1,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:pa(1338,1,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:pa(1339,1,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:pa(1340,1,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Class_constructor_may_not_be_an_accessor:pa(1341,1,"Class_constructor_may_not_be_an_accessor_1341","Class constructor may not be an accessor."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext:pa(1343,1,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'."),A_label_is_not_allowed_here:pa(1344,1,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:pa(1345,1,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:pa(1346,1,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:pa(1347,1,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:pa(1348,1,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:pa(1349,1,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:pa(1350,3,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:pa(1351,1,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:pa(1352,1,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:pa(1353,1,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:pa(1354,1,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:pa(1355,1,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:pa(1356,1,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:pa(1357,1,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:pa(1358,1,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:pa(1359,1,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),Type_0_does_not_satisfy_the_expected_type_1:pa(1360,1,"Type_0_does_not_satisfy_the_expected_type_1_1360","Type '{0}' does not satisfy the expected type '{1}'."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:pa(1361,1,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:pa(1362,1,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:pa(1363,1,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:pa(1364,3,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:pa(1365,3,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:pa(1366,3,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:pa(1367,3,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Class_constructor_may_not_be_a_generator:pa(1368,1,"Class_constructor_may_not_be_a_generator_1368","Class constructor may not be a generator."),Did_you_mean_0:pa(1369,3,"Did_you_mean_0_1369","Did you mean '{0}'?"),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:pa(1375,1,"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:pa(1376,3,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:pa(1377,3,"_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_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:pa(1378,1,"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', 'node18', 'node20', '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:pa(1379,1,"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:pa(1380,1,"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:pa(1381,1,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:pa(1382,1,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:pa(1385,1,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:pa(1386,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:pa(1387,1,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:pa(1388,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:pa(1389,1,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:pa(1390,1,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:pa(1392,1,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:pa(1393,3,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:pa(1394,3,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:pa(1395,3,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:pa(1396,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:pa(1397,3,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:pa(1398,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:pa(1399,3,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:pa(1400,3,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:pa(1401,3,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:pa(1402,3,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:pa(1403,3,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:pa(1404,3,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:pa(1405,3,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:pa(1406,3,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:pa(1407,3,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:pa(1408,3,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:pa(1409,3,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:pa(1410,3,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:pa(1411,3,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:pa(1412,3,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:pa(1413,3,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:pa(1414,3,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:pa(1415,3,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:pa(1416,3,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:pa(1417,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:pa(1418,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:pa(1419,3,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:pa(1420,3,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:pa(1421,3,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:pa(1422,3,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:pa(1423,3,"File_is_library_specified_here_1423","File is library specified here."),Default_library:pa(1424,3,"Default_library_1424","Default library"),Default_library_for_target_0:pa(1425,3,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:pa(1426,3,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:pa(1427,3,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:pa(1428,3,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:pa(1429,3,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:pa(1430,3,"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:pa(1431,1,"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_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:pa(1432,1,"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', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters:pa(1433,1,"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:pa(1434,1,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:pa(1435,1,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:pa(1436,1,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:pa(1437,1,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:pa(1438,1,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:pa(1439,1,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:pa(1440,1,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:pa(1441,1,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:pa(1442,1,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:pa(1443,1,"Module_declaration_names_may_only_use_or_quoted_strings_1443","Module declaration names may only use ' or \" quoted strings."),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled:pa(1448,1,"_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:pa(1449,3,"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_set_of_attributes_as_arguments:pa(1450,3,"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:pa(1451,1,"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_should_be_either_require_or_import:pa(1453,1,"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:pa(1454,1,"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:pa(1455,1,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:pa(1456,1,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:pa(1457,3,"Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457","Matched by default include pattern '**/*'"),File_is_ECMAScript_module_because_0_has_field_type_with_value_module:pa(1458,3,"File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458",'File is ECMAScript module because \'{0}\' has field "type" with value "module"'),File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:pa(1459,3,"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:pa(1460,3,"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:pa(1461,3,"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:pa(1463,1,"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:pa(1464,1,"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:pa(1470,1,"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:pa(1471,1,"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:pa(1472,1,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:pa(1473,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:pa(1474,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:pa(1475,3,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:pa(1476,3,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),An_instantiation_expression_cannot_be_followed_by_a_property_access:pa(1477,1,"An_instantiation_expression_cannot_be_followed_by_a_property_access_1477","An instantiation expression cannot be followed by a property access."),Identifier_or_string_literal_expected:pa(1478,1,"Identifier_or_string_literal_expected_1478","Identifier or string literal expected."),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:pa(1479,1,"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479","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."),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module:pa(1480,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480",'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1:pa(1481,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481","To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `\"type\": \"module\"` to '{1}'."),To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0:pa(1482,3,"To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482",'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'),To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module:pa(1483,3,"To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483",'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:pa(1484,1,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484","'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:pa(1485,1,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),Decorator_used_before_export_here:pa(1486,1,"Decorator_used_before_export_here_1486","Decorator used before 'export' here."),Octal_escape_sequences_are_not_allowed_Use_the_syntax_0:pa(1487,1,"Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487","Octal escape sequences are not allowed. Use the syntax '{0}'."),Escape_sequence_0_is_not_allowed:pa(1488,1,"Escape_sequence_0_is_not_allowed_1488","Escape sequence '{0}' is not allowed."),Decimals_with_leading_zeros_are_not_allowed:pa(1489,1,"Decimals_with_leading_zeros_are_not_allowed_1489","Decimals with leading zeros are not allowed."),File_appears_to_be_binary:pa(1490,1,"File_appears_to_be_binary_1490","File appears to be binary."),_0_modifier_cannot_appear_on_a_using_declaration:pa(1491,1,"_0_modifier_cannot_appear_on_a_using_declaration_1491","'{0}' modifier cannot appear on a 'using' declaration."),_0_declarations_may_not_have_binding_patterns:pa(1492,1,"_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:pa(1493,1,"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:pa(1494,1,"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:pa(1495,1,"_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:pa(1496,1,"Identifier_string_literal_or_number_literal_expected_1496","Identifier, string literal, or number literal expected."),Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator:pa(1497,1,"Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497","Expression must be enclosed in parentheses to be used as a decorator."),Invalid_syntax_in_decorator:pa(1498,1,"Invalid_syntax_in_decorator_1498","Invalid syntax in decorator."),Unknown_regular_expression_flag:pa(1499,1,"Unknown_regular_expression_flag_1499","Unknown regular expression flag."),Duplicate_regular_expression_flag:pa(1500,1,"Duplicate_regular_expression_flag_1500","Duplicate regular expression flag."),This_regular_expression_flag_is_only_available_when_targeting_0_or_later:pa(1501,1,"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501","This regular expression flag is only available when targeting '{0}' or later."),The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously:pa(1502,1,"The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1502","The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later:pa(1503,1,"Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1503","Named capturing groups are only available when targeting 'ES2018' or later."),Subpattern_flags_must_be_present_when_there_is_a_minus_sign:pa(1504,1,"Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1504","Subpattern flags must be present when there is a minus sign."),Incomplete_quantifier_Digit_expected:pa(1505,1,"Incomplete_quantifier_Digit_expected_1505","Incomplete quantifier. Digit expected."),Numbers_out_of_order_in_quantifier:pa(1506,1,"Numbers_out_of_order_in_quantifier_1506","Numbers out of order in quantifier."),There_is_nothing_available_for_repetition:pa(1507,1,"There_is_nothing_available_for_repetition_1507","There is nothing available for repetition."),Unexpected_0_Did_you_mean_to_escape_it_with_backslash:pa(1508,1,"Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1508","Unexpected '{0}'. Did you mean to escape it with backslash?"),This_regular_expression_flag_cannot_be_toggled_within_a_subpattern:pa(1509,1,"This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1509","This regular expression flag cannot be toggled within a subpattern."),k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets:pa(1510,1,"k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510","'\\k' must be followed by a capturing group name enclosed in angle brackets."),q_is_only_available_inside_character_class:pa(1511,1,"q_is_only_available_inside_character_class_1511","'\\q' is only available inside character class."),c_must_be_followed_by_an_ASCII_letter:pa(1512,1,"c_must_be_followed_by_an_ASCII_letter_1512","'\\c' must be followed by an ASCII letter."),Undetermined_character_escape:pa(1513,1,"Undetermined_character_escape_1513","Undetermined character escape."),Expected_a_capturing_group_name:pa(1514,1,"Expected_a_capturing_group_name_1514","Expected a capturing group name."),Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other:pa(1515,1,"Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1515","Named capturing groups with the same name must be mutually exclusive to each other."),A_character_class_range_must_not_be_bounded_by_another_character_class:pa(1516,1,"A_character_class_range_must_not_be_bounded_by_another_character_class_1516","A character class range must not be bounded by another character class."),Range_out_of_order_in_character_class:pa(1517,1,"Range_out_of_order_in_character_class_1517","Range out of order in character class."),Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class:pa(1518,1,"Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1518","Anything that would possibly match more than a single character is invalid inside a negated character class."),Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead:pa(1519,1,"Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1519","Operators must not be mixed within a character class. Wrap it in a nested class instead."),Expected_a_class_set_operand:pa(1520,1,"Expected_a_class_set_operand_1520","Expected a class set operand."),q_must_be_followed_by_string_alternatives_enclosed_in_braces:pa(1521,1,"q_must_be_followed_by_string_alternatives_enclosed_in_braces_1521","'\\q' must be followed by string alternatives enclosed in braces."),A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash:pa(1522,1,"A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1522","A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),Expected_a_Unicode_property_name:pa(1523,1,"Expected_a_Unicode_property_name_1523","Expected a Unicode property name."),Unknown_Unicode_property_name:pa(1524,1,"Unknown_Unicode_property_name_1524","Unknown Unicode property name."),Expected_a_Unicode_property_value:pa(1525,1,"Expected_a_Unicode_property_value_1525","Expected a Unicode property value."),Unknown_Unicode_property_value:pa(1526,1,"Unknown_Unicode_property_value_1526","Unknown Unicode property value."),Expected_a_Unicode_property_name_or_value:pa(1527,1,"Expected_a_Unicode_property_name_or_value_1527","Expected a Unicode property name or value."),Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set:pa(1528,1,"Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1528","Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),Unknown_Unicode_property_name_or_value:pa(1529,1,"Unknown_Unicode_property_name_or_value_1529","Unknown Unicode property name or value."),Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:pa(1530,1,"Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1530","Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces:pa(1531,1,"_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1531","'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),There_is_no_capturing_group_named_0_in_this_regular_expression:pa(1532,1,"There_is_no_capturing_group_named_0_in_this_regular_expression_1532","There is no capturing group named '{0}' in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression:pa(1533,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_r_1533","This backreference refers to a group that does not exist. There are only {0} capturing groups in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression:pa(1534,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regul_1534","This backreference refers to a group that does not exist. There are no capturing groups in this regular expression."),This_character_cannot_be_escaped_in_a_regular_expression:pa(1535,1,"This_character_cannot_be_escaped_in_a_regular_expression_1535","This character cannot be escaped in a regular expression."),Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead:pa(1536,1,"Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended__1536","Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '{0}' instead."),Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class:pa(1537,1,"Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537","Decimal escape sequences and backreferences are not allowed in a character class."),Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:pa(1538,1,"Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538","Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),A_bigint_literal_cannot_be_used_as_a_property_name:pa(1539,1,"A_bigint_literal_cannot_be_used_as_a_property_name_1539","A 'bigint' literal cannot be used as a property name."),A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead:pa(1540,2,"A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540","A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",void 0,void 0,!0),Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:pa(1541,1,"Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541","Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:pa(1542,1,"Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542","Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0:pa(1543,1,"Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543","Importing a JSON file into an ECMAScript module requires a 'type: \"json\"' import attribute when 'module' is set to '{0}'."),Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0:pa(1544,1,"Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544","Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."),using_declarations_are_not_allowed_in_ambient_contexts:pa(1545,1,"using_declarations_are_not_allowed_in_ambient_contexts_1545","'using' declarations are not allowed in ambient contexts."),await_using_declarations_are_not_allowed_in_ambient_contexts:pa(1546,1,"await_using_declarations_are_not_allowed_in_ambient_contexts_1546","'await using' declarations are not allowed in ambient contexts."),The_types_of_0_are_incompatible_between_these_types:pa(2200,1,"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:pa(2201,1,"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:pa(2202,1,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:pa(2203,1,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:pa(2204,1,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:pa(2205,1,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:pa(2206,1,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:pa(2207,1,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),This_type_parameter_might_need_an_extends_0_constraint:pa(2208,1,"This_type_parameter_might_need_an_extends_0_constraint_2208","This type parameter might need an `extends {0}` constraint."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:pa(2209,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:pa(2210,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Add_extends_constraint:pa(2211,3,"Add_extends_constraint_2211","Add `extends` constraint."),Add_extends_constraint_to_all_type_parameters:pa(2212,3,"Add_extends_constraint_to_all_type_parameters_2212","Add `extends` constraint to all type parameters"),Duplicate_identifier_0:pa(2300,1,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:pa(2301,1,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:pa(2302,1,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:pa(2303,1,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:pa(2304,1,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:pa(2305,1,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:pa(2306,1,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:pa(2307,1,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:pa(2308,1,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:pa(2309,1,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:pa(2310,1,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:pa(2311,1,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:pa(2312,1,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:pa(2313,1,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:pa(2314,1,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:pa(2315,1,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:pa(2316,1,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:pa(2317,1,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:pa(2318,1,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:pa(2319,1,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:pa(2320,1,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:pa(2321,1,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:pa(2322,1,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:pa(2323,1,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:pa(2324,1,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:pa(2325,1,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:pa(2326,1,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:pa(2327,1,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:pa(2328,1,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:pa(2329,1,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:pa(2330,1,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:pa(2331,1,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:pa(2332,1,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_a_static_property_initializer:pa(2334,1,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:pa(2335,1,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:pa(2336,1,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:pa(2337,1,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:pa(2338,1,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:pa(2339,1,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:pa(2340,1,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:pa(2341,1,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:pa(2343,1,"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:pa(2344,1,"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:pa(2345,1,"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:pa(2346,1,"Call_target_does_not_contain_any_signatures_2346","Call target does not contain any signatures."),Untyped_function_calls_may_not_accept_type_arguments:pa(2347,1,"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:pa(2348,1,"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:pa(2349,1,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:pa(2350,1,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:pa(2351,1,"This_expression_is_not_constructable_2351","This expression is not constructable."),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:pa(2352,1,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","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."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:pa(2353,1,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:pa(2354,1,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value:pa(2355,1,"A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:pa(2356,1,"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:pa(2357,1,"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:pa(2358,1,"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_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:pa(2359,1,"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:pa(2362,1,"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:pa(2363,1,"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:pa(2364,1,"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."),Operator_0_cannot_be_applied_to_types_1_and_2:pa(2365,1,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:pa(2366,1,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap:pa(2367,1,"This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367","This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."),Type_parameter_name_cannot_be_0:pa(2368,1,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:pa(2369,1,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:pa(2370,1,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:pa(2371,1,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:pa(2372,1,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:pa(2373,1,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:pa(2374,1,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:pa(2375,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),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:pa(2376,1,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","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."),Constructors_for_derived_classes_must_contain_a_super_call:pa(2377,1,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:pa(2378,1,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:pa(2379,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),Overload_signatures_must_all_be_exported_or_non_exported:pa(2383,1,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:pa(2384,1,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:pa(2385,1,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:pa(2386,1,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:pa(2387,1,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:pa(2388,1,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:pa(2389,1,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:pa(2390,1,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:pa(2391,1,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:pa(2392,1,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:pa(2393,1,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:pa(2394,1,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:pa(2395,1,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:pa(2396,1,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:pa(2397,1,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:pa(2398,1,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:pa(2399,1,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:pa(2400,1,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),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:pa(2401,1,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","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."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:pa(2402,1,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:pa(2403,1,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:pa(2404,1,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:pa(2405,1,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:pa(2406,1,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),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:pa(2407,1,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","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}'."),Setters_cannot_return_a_value:pa(2408,1,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:pa(2409,1,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:pa(2410,1,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:pa(2412,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:pa(2411,1,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:pa(2413,1,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:pa(2414,1,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:pa(2415,1,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:pa(2416,1,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:pa(2417,1,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:pa(2418,1,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:pa(2419,1,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:pa(2420,1,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:pa(2422,1,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:pa(2423,1,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:pa(2425,1,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:pa(2426,1,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:pa(2427,1,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:pa(2428,1,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:pa(2430,1,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:pa(2431,1,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:pa(2432,1,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:pa(2433,1,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:pa(2434,1,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:pa(2435,1,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:pa(2436,1,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:pa(2437,1,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:pa(2438,1,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:pa(2439,1,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:pa(2440,1,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:pa(2441,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:pa(2442,1,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:pa(2443,1,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:pa(2444,1,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:pa(2445,1,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:pa(2446,1,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:pa(2447,1,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:pa(2448,1,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:pa(2449,1,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:pa(2450,1,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:pa(2451,1,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:pa(2452,1,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:pa(2454,1,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:pa(2456,1,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:pa(2457,1,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:pa(2458,1,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:pa(2459,1,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:pa(2460,1,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:pa(2461,1,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:pa(2462,1,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:pa(2463,1,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:pa(2464,1,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:pa(2465,1,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:pa(2466,1,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:pa(2467,1,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:pa(2468,1,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:pa(2469,1,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:pa(2472,1,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:pa(2473,1,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_must_be_constant_expressions:pa(2474,1,"const_enum_member_initializers_must_be_constant_expressions_2474","const enum member initializers must be constant expressions."),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:pa(2475,1,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'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."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:pa(2476,1,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:pa(2477,1,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:pa(2478,1,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:pa(2480,1,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:pa(2481,1,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:pa(2483,1,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:pa(2484,1,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:pa(2487,1,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:pa(2488,1,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:pa(2489,1,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:pa(2490,1,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:pa(2491,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:pa(2492,1,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:pa(2493,1,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:pa(2494,1,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:pa(2495,1,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression:pa(2496,1,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_func_2496","The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:pa(2497,1,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:pa(2498,1,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:pa(2499,1,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:pa(2500,1,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:pa(2501,1,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:pa(2502,1,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:pa(2503,1,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:pa(2504,1,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:pa(2505,1,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:pa(2506,1,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:pa(2507,1,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:pa(2508,1,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:pa(2509,1,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:pa(2510,1,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:pa(2511,1,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:pa(2512,1,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:pa(2513,1,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),A_tuple_type_cannot_be_indexed_with_a_negative_value:pa(2514,1,"A_tuple_type_cannot_be_indexed_with_a_negative_value_2514","A tuple type cannot be indexed with a negative value."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:pa(2515,1,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:pa(2516,1,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:pa(2517,1,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:pa(2518,1,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:pa(2519,1,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:pa(2520,1,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method:pa(2522,1,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_sta_2522","The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:pa(2523,1,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:pa(2524,1,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:pa(2526,1,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:pa(2527,1,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:pa(2528,1,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:pa(2529,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:pa(2530,1,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:pa(2531,1,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:pa(2532,1,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:pa(2533,1,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:pa(2534,1,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Type_0_cannot_be_used_to_index_type_1:pa(2536,1,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:pa(2537,1,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:pa(2538,1,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:pa(2539,1,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:pa(2540,1,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:pa(2542,1,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:pa(2543,1,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:pa(2544,1,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:pa(2545,1,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:pa(2547,1,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:pa(2548,1,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:pa(2549,1,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:pa(2550,1,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:pa(2551,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:pa(2552,1,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:pa(2553,1,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:pa(2554,1,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:pa(2555,1,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:pa(2556,1,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:pa(2558,1,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:pa(2559,1,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:pa(2560,1,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:pa(2561,1,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:pa(2562,1,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:pa(2563,1,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:pa(2564,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:pa(2565,1,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:pa(2566,1,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:pa(2567,1,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:pa(2568,1,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:pa(2570,1,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:pa(2571,1,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:pa(2574,1,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:pa(2575,1,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:pa(2576,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:pa(2577,1,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:pa(2578,1,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:pa(2580,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:pa(2581,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),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:pa(2582,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:pa(2583,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:pa(2584,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_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:pa(2585,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{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."),Cannot_assign_to_0_because_it_is_a_constant:pa(2588,1,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:pa(2589,1,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:pa(2590,1,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),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:pa(2591,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),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:pa(2592,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),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:pa(2593,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:pa(2594,1,"This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594","This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:pa(2595,1,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:pa(2596,1,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:pa(2597,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:pa(2598,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:pa(2602,1,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:pa(2603,1,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:pa(2604,1,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:pa(2606,1,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:pa(2607,1,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:pa(2608,1,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:pa(2609,1,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:pa(2610,1,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:pa(2611,1,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),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:pa(2612,1,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","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."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:pa(2613,1,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:pa(2614,1,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:pa(2615,1,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:pa(2616,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:pa(2617,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:pa(2618,1,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:pa(2619,1,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:pa(2620,1,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:pa(2621,1,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:pa(2623,1,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:pa(2624,1,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:pa(2625,1,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:pa(2626,1,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:pa(2627,1,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:pa(2628,1,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:pa(2629,1,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:pa(2630,1,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:pa(2631,1,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:pa(2632,1,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:pa(2633,1,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:pa(2634,1,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:pa(2635,1,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:pa(2636,1,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:pa(2637,1,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator:pa(2638,1,"Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638","Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),React_components_cannot_include_JSX_namespace_names:pa(2639,1,"React_components_cannot_include_JSX_namespace_names_2639","React components cannot include JSX namespace names"),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:pa(2649,1,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more:pa(2650,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650","Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:pa(2651,1,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:pa(2652,1,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:pa(2653,1,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2:pa(2654,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more:pa(2655,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1:pa(2656,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656","Non-abstract class expression is missing implementations for the following members of '{0}': {1}."),JSX_expressions_must_have_one_parent_element:pa(2657,1,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:pa(2658,1,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:pa(2659,1,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:pa(2660,1,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:pa(2661,1,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:pa(2662,1,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:pa(2663,1,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:pa(2664,1,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:pa(2665,1,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:pa(2666,1,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:pa(2667,1,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:pa(2668,1,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:pa(2669,1,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:pa(2670,1,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:pa(2671,1,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:pa(2672,1,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:pa(2673,1,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:pa(2674,1,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:pa(2675,1,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:pa(2676,1,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:pa(2677,1,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:pa(2678,1,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:pa(2679,1,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:pa(2680,1,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:pa(2681,1,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:pa(2683,1,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:pa(2684,1,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:pa(2685,1,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:pa(2686,1,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:pa(2687,1,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:pa(2688,1,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:pa(2689,1,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:pa(2690,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:pa(2692,1,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:pa(2693,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:pa(2694,1,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:pa(2695,1,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:pa(2696,1,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:pa(2697,1,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:pa(2698,1,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:pa(2699,1,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:pa(2700,1,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:pa(2701,1,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:pa(2702,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:pa(2703,1,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:pa(2704,1,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:pa(2705,1,"An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_2705","An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:pa(2706,1,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:pa(2707,1,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:pa(2708,1,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:pa(2709,1,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:pa(2710,1,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:pa(2711,1,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:pa(2712,1,"A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_t_2712","A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),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:pa(2713,1,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713","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}\"]'?"),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:pa(2714,1,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:pa(2715,1,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:pa(2716,1,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:pa(2717,1,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:pa(2718,1,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:pa(2719,1,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:pa(2720,1,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:pa(2721,1,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:pa(2722,1,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:pa(2723,1,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:pa(2724,1,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0:pa(2725,1,"Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 and above with module {0}."),Cannot_find_lib_definition_for_0:pa(2726,1,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:pa(2727,1,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:pa(2728,3,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:pa(2729,1,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:pa(2730,1,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:pa(2731,1,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:pa(2732,1,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:pa(2733,1,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:pa(2734,1,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:pa(2735,1,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:pa(2736,1,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:pa(2737,1,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:pa(2738,3,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:pa(2739,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:pa(2740,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:pa(2741,1,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:pa(2742,1,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:pa(2743,1,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:pa(2744,1,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:pa(2745,1,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:pa(2746,1,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:pa(2747,1,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_0_is_enabled:pa(2748,1,"Cannot_access_ambient_const_enums_when_0_is_enabled_2748","Cannot access ambient const enums when '{0}' is enabled."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:pa(2749,1,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:pa(2750,1,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:pa(2751,1,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:pa(2752,1,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:pa(2753,1,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:pa(2754,1,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:pa(2755,1,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:pa(2756,1,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:pa(2757,1,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:pa(2758,1,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:pa(2759,1,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:pa(2760,1,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:pa(2761,1,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:pa(2762,1,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:pa(2763,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:pa(2764,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:pa(2765,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:pa(2766,1,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:pa(2767,1,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:pa(2768,1,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:pa(2769,1,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:pa(2770,1,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:pa(2771,1,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:pa(2772,1,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:pa(2773,1,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:pa(2774,1,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:pa(2775,1,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:pa(2776,1,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:pa(2777,1,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:pa(2778,1,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:pa(2779,1,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:pa(2780,1,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:pa(2781,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:pa(2782,3,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:pa(2783,1,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:pa(2784,1,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:pa(2785,1,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:pa(2786,1,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:pa(2787,1,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:pa(2788,1,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:pa(2789,1,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:pa(2790,1,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:pa(2791,1,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:pa(2792,1,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:pa(2793,1,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:pa(2794,1,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:pa(2795,1,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:pa(2796,1,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:pa(2797,1,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:pa(2798,1,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:pa(2799,1,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:pa(2800,1,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:pa(2801,1,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:pa(2802,1,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:pa(2803,1,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:pa(2804,1,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:pa(2806,1,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),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:pa(2807,1,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","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}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:pa(2808,1,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses:pa(2809,1,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:pa(2810,1,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:pa(2811,1,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:pa(2812,1,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:pa(2813,1,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:pa(2814,1,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks:pa(2815,1,"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815","'arguments' cannot be referenced in property initializers or class static initialization blocks."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:pa(2816,1,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:pa(2817,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:pa(2818,1,"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:pa(2819,1,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:pa(2820,1,"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_node18_node20_nodenext_or_preserve:pa(2821,1,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2821","Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:pa(2822,1,"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_node18_node20_nodenext_or_preserve:pa(2823,1,"Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2823","Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'."),Cannot_find_namespace_0_Did_you_mean_1:pa(2833,1,"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:pa(2834,1,"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:pa(2835,1,"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:pa(2836,1,"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:pa(2837,1,"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:pa(2838,1,"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:pa(2839,1,"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_It_can_only_extend_other_named_object_types:pa(2840,1,"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:pa(2842,1,"_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:pa(2843,1,"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:pa(2844,1,"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."),This_condition_will_always_return_0:pa(2845,1,"This_condition_will_always_return_0_2845","This condition will always return '{0}'."),A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead:pa(2846,1,"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:pa(2848,1,"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:pa(2849,1,"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:pa(2850,1,"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:pa(2851,1,"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:pa(2852,1,"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:pa(2853,1,"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_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:pa(2854,1,"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', 'node18', 'node20', '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:pa(2855,1,"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:pa(2856,1,"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:pa(2857,1,"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:pa(2858,1,"Import_attribute_values_must_be_string_literal_expressions_2858","Import attribute values must be string literal expressions."),Excessive_complexity_comparing_types_0_and_1:pa(2859,1,"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:pa(2860,1,"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:pa(2861,1,"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:pa(2862,1,"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:pa(2863,1,"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:pa(2864,1,"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:pa(2865,1,"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:pa(2866,1,"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:pa(2867,1,"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:pa(2868,1,"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."),Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish:pa(2869,1,"Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869","Right operand of ?? is unreachable because the left operand is never nullish."),This_binary_expression_is_never_nullish_Are_you_missing_parentheses:pa(2870,1,"This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870","This binary expression is never nullish. Are you missing parentheses?"),This_expression_is_always_nullish:pa(2871,1,"This_expression_is_always_nullish_2871","This expression is always nullish."),This_kind_of_expression_is_always_truthy:pa(2872,1,"This_kind_of_expression_is_always_truthy_2872","This kind of expression is always truthy."),This_kind_of_expression_is_always_falsy:pa(2873,1,"This_kind_of_expression_is_always_falsy_2873","This kind of expression is always falsy."),This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found:pa(2874,1,"This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found_2874","This JSX tag requires '{0}' to be in scope, but it could not be found."),This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed:pa(2875,1,"This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_fo_2875","This JSX tag requires the module path '{0}' to exist, but none could be found. Make sure you have types for the appropriate package installed."),This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0:pa(2876,1,"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876",'This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "{0}".'),This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path:pa(2877,1,"This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877","This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files:pa(2878,1,"This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878","This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found:pa(2879,1,"Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879","Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert:pa(2880,1,"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880","Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),This_expression_is_never_nullish:pa(2881,1,"This_expression_is_never_nullish_2881","This expression is never nullish."),Import_declaration_0_is_using_private_name_1:pa(4e3,1,"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:pa(4002,1,"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:pa(4004,1,"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}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:pa(4006,1,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:pa(4008,1,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:pa(4010,1,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:pa(4012,1,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:pa(4014,1,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:pa(4016,1,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:pa(4019,1,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:pa(4020,1,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:pa(4021,1,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:pa(4022,1,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4023,1,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:pa(4024,1,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:pa(4025,1,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4026,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4027,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:pa(4028,1,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4029,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4030,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:pa(4031,1,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:pa(4032,1,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:pa(4033,1,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4034,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:pa(4035,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4036,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:pa(4037,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4038,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4039,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:pa(4040,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4041,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4042,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:pa(4043,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:pa(4044,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:pa(4045,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:pa(4046,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:pa(4047,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:pa(4048,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:pa(4049,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:pa(4050,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:pa(4051,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:pa(4052,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:pa(4053,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:pa(4054,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:pa(4055,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:pa(4056,1,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:pa(4057,1,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:pa(4058,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:pa(4059,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:pa(4060,1,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4061,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4062,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:pa(4063,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:pa(4064,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:pa(4065,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:pa(4066,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:pa(4067,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4068,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4069,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:pa(4070,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4071,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4072,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:pa(4073,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:pa(4074,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:pa(4075,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4076,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:pa(4077,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:pa(4078,1,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:pa(4081,1,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:pa(4082,1,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:pa(4083,1,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:pa(4084,1,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1:pa(4085,1,"Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085","Extends clause for inferred type '{0}' has or is using private name '{1}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:pa(4091,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:pa(4092,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected:pa(4094,1,"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","Property '{0}' of exported anonymous class type may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4095,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4096,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:pa(4097,1,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4098,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:pa(4099,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:pa(4100,1,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:pa(4101,1,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:pa(4102,1,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:pa(4103,1,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:pa(4104,1,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:pa(4105,1,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:pa(4106,1,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:pa(4107,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:pa(4108,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:pa(4109,1,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:pa(4110,1,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:pa(4111,1,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:pa(4112,1,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:pa(4113,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:pa(4114,1,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:pa(4115,1,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:pa(4116,1,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:pa(4117,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:pa(4118,1,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:pa(4119,1,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:pa(4120,1,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:pa(4121,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:pa(4122,1,"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:pa(4123,1,"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:pa(4124,1,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given:pa(4125,1,"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:pa(4126,1,"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."),This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic:pa(4127,1,"This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127","This member cannot have an 'override' modifier because its name is dynamic."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic:pa(4128,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128","This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),The_current_host_does_not_support_the_0_option:pa(5001,1,"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:pa(5009,1,"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:pa(5010,1,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:pa(5012,1,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Unknown_compiler_option_0:pa(5023,1,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:pa(5024,1,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:pa(5025,1,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:pa(5033,1,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:pa(5042,1,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:pa(5047,1,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:pa(5051,1,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:pa(5052,1,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:pa(5053,1,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:pa(5054,1,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:pa(5055,1,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:pa(5056,1,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:pa(5057,1,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:pa(5058,1,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:pa(5059,1,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:pa(5061,1,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:pa(5062,1,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:pa(5063,1,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:pa(5064,1,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:pa(5065,1,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:pa(5066,1,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:pa(5067,1,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),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:pa(5068,1,"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:pa(5069,1,"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:pa(5070,1,"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_cannot_be_specified_when_module_is_set_to_none_system_or_umd:pa(5071,1,"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:pa(5072,1,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:pa(5073,1,"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:pa(5074,1,"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."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:pa(5075,1,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:pa(5076,1,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:pa(5077,1,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:pa(5078,1,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:pa(5079,1,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:pa(5080,1,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:pa(5081,1,"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:pa(5082,1,"_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:pa(5083,1,"Cannot_read_file_0_5083","Cannot read file '{0}'."),A_tuple_member_cannot_be_both_optional_and_rest:pa(5085,1,"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:pa(5086,1,"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:pa(5087,1,"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."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:pa(5088,1,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:pa(5089,1,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:pa(5090,1,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled:pa(5091,1,"Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."),The_root_value_of_a_0_file_must_be_an_object:pa(5092,1,"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:pa(5093,1,"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:pa(5094,1,"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_preserve_or_to_es2015_or_later:pa(5095,1,"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:pa(5096,1,"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:pa(5097,1,"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:pa(5098,1,"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'."),Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error:pa(5101,1,"Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101","Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '\"ignoreDeprecations\": \"{2}\"' to silence this error."),Option_0_has_been_removed_Please_remove_it_from_your_configuration:pa(5102,1,"Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102","Option '{0}' has been removed. Please remove it from your configuration."),Invalid_value_for_ignoreDeprecations:pa(5103,1,"Invalid_value_for_ignoreDeprecations_5103","Invalid value for '--ignoreDeprecations'."),Option_0_is_redundant_and_cannot_be_specified_with_option_1:pa(5104,1,"Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104","Option '{0}' is redundant and cannot be specified with option '{1}'."),Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System:pa(5105,1,"Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105","Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),Use_0_instead:pa(5106,3,"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:pa(5107,1,"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:pa(5108,1,"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:pa(5109,1,"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:pa(5110,1,"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:pa(6e3,3,"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:pa(6001,3,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:pa(6002,3,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:pa(6004,3,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:pa(6005,3,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:pa(6006,3,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:pa(6007,3,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:pa(6008,3,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:pa(6009,3,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:pa(6010,3,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:pa(6011,3,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:pa(6012,3,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:pa(6013,3,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:pa(6014,3,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:pa(6015,3,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:pa(6016,3,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:pa(6017,3,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:pa(6019,3,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:pa(6020,3,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:pa(6023,3,"Syntax_Colon_0_6023","Syntax: {0}"),options:pa(6024,3,"options_6024","options"),file:pa(6025,3,"file_6025","file"),Examples_Colon_0:pa(6026,3,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:pa(6027,3,"Options_Colon_6027","Options:"),Version_0:pa(6029,3,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:pa(6030,3,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:pa(6031,3,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:pa(6032,3,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:pa(6034,3,"KIND_6034","KIND"),FILE:pa(6035,3,"FILE_6035","FILE"),VERSION:pa(6036,3,"VERSION_6036","VERSION"),LOCATION:pa(6037,3,"LOCATION_6037","LOCATION"),DIRECTORY:pa(6038,3,"DIRECTORY_6038","DIRECTORY"),STRATEGY:pa(6039,3,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:pa(6040,3,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:pa(6041,3,"Errors_Files_6041","Errors Files"),Generates_corresponding_map_file:pa(6043,3,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:pa(6044,1,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:pa(6045,1,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:pa(6046,1,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:pa(6048,1,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form or -. For example '{0}' or '{1}'."),Unable_to_open_file_0:pa(6050,1,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:pa(6051,1,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:pa(6052,3,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:pa(6053,1,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:pa(6054,1,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:pa(6055,3,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:pa(6056,3,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:pa(6058,3,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:pa(6059,1,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:pa(6060,3,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:pa(6061,3,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:pa(6064,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:pa(6065,3,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:pa(6066,3,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:pa(6070,3,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:pa(6071,3,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:pa(6072,3,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:pa(6073,3,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:pa(6074,3,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:pa(6075,3,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:pa(6076,3,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:pa(6077,3,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:pa(6078,3,"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:pa(6079,3,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:pa(6080,3,"Specify_JSX_code_generation_6080","Specify JSX code generation."),Only_amd_and_system_modules_are_supported_alongside_0:pa(6082,1,"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:pa(6083,3,"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:pa(6084,3,"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"),Enable_tracing_of_the_name_resolution_process:pa(6085,3,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:pa(6086,3,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:pa(6087,3,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:pa(6088,3,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:pa(6089,3,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:pa(6090,3,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:pa(6091,3,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:pa(6092,3,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:pa(6093,3,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:pa(6094,3,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1:pa(6095,3,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095","Loading module as file / folder, candidate module location '{0}', target file types: {1}."),File_0_does_not_exist:pa(6096,3,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exists_use_it_as_a_name_resolution_result:pa(6097,3,"File_0_exists_use_it_as_a_name_resolution_result_6097","File '{0}' exists - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_types_Colon_1:pa(6098,3,"Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098","Loading module '{0}' from 'node_modules' folder, target file types: {1}."),Found_package_json_at_0:pa(6099,3,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:pa(6100,3,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:pa(6101,3,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:pa(6102,3,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:pa(6104,3,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:pa(6105,3,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:pa(6106,3,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:pa(6107,3,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:pa(6108,3,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:pa(6109,3,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:pa(6110,3,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:pa(6111,3,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:pa(6112,3,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:pa(6113,3,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:pa(6114,1,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:pa(6115,3,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:pa(6116,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:pa(6119,3,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:pa(6120,3,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:pa(6121,3,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:pa(6122,3,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:pa(6123,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:pa(6124,3,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:pa(6125,3,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:pa(6126,3,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:pa(6127,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:pa(6128,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:pa(6130,3,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:pa(6131,1,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:pa(6132,3,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:pa(6133,1,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:pa(6134,3,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:pa(6135,3,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:pa(6136,3,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:pa(6137,1,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:pa(6138,1,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:pa(6139,3,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:pa(6140,1,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:pa(6141,3,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:pa(6142,1,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:pa(6144,3,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:pa(6146,3,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:pa(6147,3,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:pa(6148,3,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:pa(6149,3,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:pa(6150,3,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:pa(6151,3,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:pa(6152,3,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:pa(6153,3,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:pa(6154,3,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:pa(6155,3,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:pa(6156,3,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:pa(6157,3,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:pa(6158,3,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:pa(6159,3,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:pa(6160,3,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:pa(6161,3,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:pa(6162,3,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:pa(6163,3,"The_character_set_of_the_input_files_6163","The character set of the input files."),Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1:pa(6164,3,"Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164","Skipping module '{0}' that looks like an absolute URI, target file types: {1}."),Do_not_truncate_error_messages:pa(6165,3,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:pa(6166,3,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:pa(6167,3,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:pa(6168,3,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:pa(6169,3,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:pa(6170,3,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:pa(6171,3,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5:pa(6179,3,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5'."),Enable_all_strict_type_checking_options:pa(6180,3,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:pa(6182,3,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:pa(6183,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:pa(6184,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:pa(6186,3,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:pa(6187,3,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:pa(6188,1,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:pa(6189,1,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:pa(6191,3,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:pa(6192,1,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:pa(6193,3,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:pa(6194,3,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:pa(6195,3,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:pa(6196,1,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:pa(6197,3,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:pa(6198,1,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:pa(6199,1,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:pa(6200,1,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:pa(6201,3,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:pa(6202,1,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:pa(6203,3,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:pa(6204,3,"and_here_6204","and here."),All_type_parameters_are_unused:pa(6205,1,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:pa(6206,3,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:pa(6207,3,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:pa(6208,3,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:pa(6209,3,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:pa(6210,3,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:pa(6211,3,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:pa(6212,3,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:pa(6213,3,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:pa(6214,3,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:pa(6215,3,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:pa(6216,3,"Found_1_error_6216","Found 1 error."),Found_0_errors:pa(6217,3,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:pa(6218,3,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:pa(6219,3,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:pa(6220,3,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:pa(6221,3,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:pa(6222,3,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:pa(6223,3,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:pa(6224,3,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:pa(6225,3,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:pa(6226,3,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:pa(6227,3,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:pa(6229,1,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:pa(6230,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:pa(6231,1,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:pa(6232,1,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:pa(6233,1,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:pa(6234,1,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:pa(6235,3,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:pa(6236,1,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:pa(6237,3,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:pa(6238,1,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:pa(6239,3,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:pa(6240,3,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:pa(6241,3,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:pa(6242,3,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:pa(6243,3,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:pa(6244,3,"Modules_6244","Modules"),File_Management:pa(6245,3,"File_Management_6245","File Management"),Emit:pa(6246,3,"Emit_6246","Emit"),JavaScript_Support:pa(6247,3,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:pa(6248,3,"Type_Checking_6248","Type Checking"),Editor_Support:pa(6249,3,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:pa(6250,3,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:pa(6251,3,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:pa(6252,3,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:pa(6253,3,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:pa(6254,3,"Language_and_Environment_6254","Language and Environment"),Projects:pa(6255,3,"Projects_6255","Projects"),Output_Formatting:pa(6256,3,"Output_Formatting_6256","Output Formatting"),Completeness:pa(6257,3,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:pa(6258,1,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_0:pa(6259,3,"Found_1_error_in_0_6259","Found 1 error in {0}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:pa(6260,3,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:pa(6261,3,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),File_name_0_has_a_1_extension_looking_up_2_instead:pa(6262,3,"File_name_0_has_a_1_extension_looking_up_2_instead_6262","File name '{0}' has a '{1}' extension - looking up '{2}' instead."),Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set:pa(6263,1,"Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263","Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."),Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present:pa(6264,3,"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264","Enable importing files with any extension, provided a declaration file is present."),Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder:pa(6265,3,"Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265","Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."),Option_0_can_only_be_specified_on_command_line:pa(6266,1,"Option_0_can_only_be_specified_on_command_line_6266","Option '{0}' can only be specified on command line."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:pa(6270,3,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:pa(6271,3,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:pa(6272,3,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:pa(6273,3,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:pa(6274,3,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:pa(6275,3,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:pa(6276,3,"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:pa(6277,3,"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:pa(6278,3,"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:pa(6279,3,"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:pa(6280,3,"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'."),package_json_has_a_peerDependencies_field:pa(6281,3,"package_json_has_a_peerDependencies_field_6281","'package.json' has a 'peerDependencies' field."),Found_peerDependency_0_with_1_version:pa(6282,3,"Found_peerDependency_0_with_1_version_6282","Found peerDependency '{0}' with '{1}' version."),Failed_to_find_peerDependency_0:pa(6283,3,"Failed_to_find_peerDependency_0_6283","Failed to find peerDependency '{0}'."),File_Layout:pa(6284,3,"File_Layout_6284","File Layout"),Environment_Settings:pa(6285,3,"Environment_Settings_6285","Environment Settings"),See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule:pa(6286,3,"See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule_6286","See also https://aka.ms/tsconfig/module"),For_nodejs_Colon:pa(6287,3,"For_nodejs_Colon_6287","For nodejs:"),and_npm_install_D_types_Slashnode:pa(6290,3,"and_npm_install_D_types_Slashnode_6290","and npm install -D @types/node"),Other_Outputs:pa(6291,3,"Other_Outputs_6291","Other Outputs"),Stricter_Typechecking_Options:pa(6292,3,"Stricter_Typechecking_Options_6292","Stricter Typechecking Options"),Style_Options:pa(6293,3,"Style_Options_6293","Style Options"),Recommended_Options:pa(6294,3,"Recommended_Options_6294","Recommended Options"),Enable_project_compilation:pa(6302,3,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:pa(6304,1,"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:pa(6305,1,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:pa(6306,1,"Referenced_project_0_must_have_setting_composite_Colon_true_6306","Referenced project '{0}' must have setting \"composite\": true."),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:pa(6307,1,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Referenced_project_0_may_not_disable_emit:pa(6310,1,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_output_1_is_older_than_input_2:pa(6350,3,"Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350","Project '{0}' is out of date because output '{1}' is older than input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2:pa(6351,3,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:pa(6352,3,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:pa(6353,3,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:pa(6354,3,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:pa(6355,3,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:pa(6356,3,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:pa(6357,3,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:pa(6358,3,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:pa(6359,3,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:pa(6361,3,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:pa(6362,3,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:pa(6363,3,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:pa(6364,3,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:pa(6365,3,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:pa(6367,3,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:pa(6369,1,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:pa(6370,1,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:pa(6371,3,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:pa(6374,3,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:pa(6377,1,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:pa(6379,1,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:pa(6380,3,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:pa(6381,3,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:pa(6382,3,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:pa(6383,3,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:pa(6384,3,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:pa(6385,2,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:pa(6386,3,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:pa(6387,2,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:pa(6388,3,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:pa(6389,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:pa(6390,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:pa(6391,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:pa(6392,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:pa(6393,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:pa(6394,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:pa(6395,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:pa(6396,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:pa(6397,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:pa(6398,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted:pa(6399,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399","Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files:pa(6400,3,"Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400","Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),Project_0_is_out_of_date_because_there_was_error_reading_file_1:pa(6401,3,"Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401","Project '{0}' is out of date because there was error reading file '{1}'"),Resolving_in_0_mode_with_conditions_1:pa(6402,3,"Resolving_in_0_mode_with_conditions_1_6402","Resolving in {0} mode with conditions {1}."),Matched_0_condition_1:pa(6403,3,"Matched_0_condition_1_6403","Matched '{0}' condition '{1}'."),Using_0_subpath_1_with_target_2:pa(6404,3,"Using_0_subpath_1_with_target_2_6404","Using '{0}' subpath '{1}' with target '{2}'."),Saw_non_matching_condition_0:pa(6405,3,"Saw_non_matching_condition_0_6405","Saw non-matching condition '{0}'."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions:pa(6406,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406","Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"),Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set:pa(6407,3,"Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407","Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),Use_the_package_json_exports_field_when_resolving_package_imports:pa(6408,3,"Use_the_package_json_exports_field_when_resolving_package_imports_6408","Use the package.json 'exports' field when resolving package imports."),Use_the_package_json_imports_field_when_resolving_imports:pa(6409,3,"Use_the_package_json_imports_field_when_resolving_imports_6409","Use the package.json 'imports' field when resolving imports."),Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports:pa(6410,3,"Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410","Conditions to set in addition to the resolver-specific defaults when resolving imports."),true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false:pa(6411,3,"true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411","`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more:pa(6412,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412","Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),Entering_conditional_exports:pa(6413,3,"Entering_conditional_exports_6413","Entering conditional exports."),Resolved_under_condition_0:pa(6414,3,"Resolved_under_condition_0_6414","Resolved under condition '{0}'."),Failed_to_resolve_under_condition_0:pa(6415,3,"Failed_to_resolve_under_condition_0_6415","Failed to resolve under condition '{0}'."),Exiting_conditional_exports:pa(6416,3,"Exiting_conditional_exports_6416","Exiting conditional exports."),Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0:pa(6417,3,"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:pa(6418,3,"Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418","Searching all ancestor node_modules directories for fallback extensions: {0}."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors:pa(6419,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419","Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),Project_0_is_out_of_date_because_1:pa(6420,3,"Project_0_is_out_of_date_because_1_6420","Project '{0}' is out of date because {1}."),Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files:pa(6421,3,"Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421","Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:pa(6500,3,"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:pa(6501,3,"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:pa(6502,3,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:pa(6503,3,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:pa(6504,1,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:pa(6505,3,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:pa(6506,3,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files:pa(6600,3,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:pa(6601,3,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:pa(6602,3,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:pa(6603,3,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:pa(6604,3,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:pa(6605,3,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:pa(6606,3,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:pa(6607,3,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:pa(6608,3,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:pa(6609,3,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:pa(6611,3,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:pa(6612,3,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:pa(6613,3,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:pa(6614,3,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:pa(6615,3,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:pa(6616,3,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:pa(6617,3,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:pa(6618,3,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:pa(6619,3,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:pa(6620,3,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:pa(6621,3,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:pa(6622,3,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:pa(6623,3,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:pa(6624,3,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:pa(6625,3,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:pa(6626,3,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:pa(6627,3,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:pa(6628,3,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:pa(6629,3,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_legacy_experimental_decorators:pa(6630,3,"Enable_experimental_support_for_legacy_experimental_decorators_6630","Enable experimental support for legacy experimental decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:pa(6631,3,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:pa(6632,3,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:pa(6633,3,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:pa(6634,3,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:pa(6635,3,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:pa(6636,3,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:pa(6637,3,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:pa(6638,3,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:pa(6639,3,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Skip_building_downstream_projects_on_error_in_upstream_project:pa(6640,3,"Skip_building_downstream_projects_on_error_in_upstream_project_6640","Skip building downstream projects on error in upstream project."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:pa(6641,3,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:pa(6642,3,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:pa(6643,3,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:pa(6644,3,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:pa(6645,3,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:pa(6646,3,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:pa(6647,3,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:pa(6648,3,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:pa(6649,3,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:pa(6650,3,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:pa(6651,3,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:pa(6652,3,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:pa(6653,3,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:pa(6654,3,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:pa(6655,3,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:pa(6656,3,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:pa(6657,3,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:pa(6658,3,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:pa(6659,3,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:pa(6660,3,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:pa(6661,3,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:pa(6662,3,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:pa(6663,3,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:pa(6664,3,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:pa(6665,3,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:pa(6666,3,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:pa(6667,3,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:pa(6668,3,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:pa(6669,3,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:pa(6670,3,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:pa(6671,3,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:pa(6672,3,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:pa(6673,3,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:pa(6674,3,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:pa(6675,3,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:pa(6676,3,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:pa(6677,3,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:pa(6678,3,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:pa(6679,3,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:pa(6680,3,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:pa(6681,3,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:pa(6682,3,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:pa(6683,3,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:pa(6684,3,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:pa(6685,3,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:pa(6686,3,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:pa(6687,3,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:pa(6688,3,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:pa(6689,3,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:pa(6690,3,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:pa(6691,3,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:pa(6692,3,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:pa(6693,3,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:pa(6694,3,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:pa(6695,3,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:pa(6697,3,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:pa(6698,3,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:pa(6699,3,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:pa(6700,3,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:pa(6701,3,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:pa(6702,3,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:pa(6703,3,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:pa(6704,3,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:pa(6705,3,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:pa(6706,3,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:pa(6707,3,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:pa(6709,3,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:pa(6710,3,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:pa(6711,3,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:pa(6712,3,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:pa(6713,3,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:pa(6714,3,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:pa(6715,3,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:pa(6717,3,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:pa(6718,3,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files:pa(6719,3,"Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719","Require sufficient annotation on exports so other tools can trivially generate declaration files."),Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any:pa(6720,3,"Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720","Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript:pa(6721,3,"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721","Do not allow runtime constructs that are not part of ECMAScript."),Default_catch_clause_variables_as_unknown_instead_of_any:pa(6803,3,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting:pa(6804,3,"Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804","Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported:pa(6805,3,"Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805","Disable full type checking (only critical parse and emit errors will be reported)."),Check_side_effect_imports:pa(6806,3,"Check_side_effect_imports_6806","Check side effect imports."),This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2:pa(6807,1,"This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807","This operation can be simplified. This shift is identical to `{0} {1} {2}`."),Enable_lib_replacement:pa(6808,3,"Enable_lib_replacement_6808","Enable lib replacement."),one_of_Colon:pa(6900,3,"one_of_Colon_6900","one of:"),one_or_more_Colon:pa(6901,3,"one_or_more_Colon_6901","one or more:"),type_Colon:pa(6902,3,"type_Colon_6902","type:"),default_Colon:pa(6903,3,"default_Colon_6903","default:"),module_system_or_esModuleInterop:pa(6904,3,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:pa(6905,3,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:pa(6906,3,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:pa(6907,3,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:pa(6908,3,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:pa(6909,3,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:pa(69010,3,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:pa(6911,3,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:pa(6912,3,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:pa(6913,3,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:pa(6914,3,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:pa(6915,3,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:pa(6916,3,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:pa(6917,3,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:pa(6918,3,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:pa(6919,3,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:pa(6920,3,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:pa(6921,3,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:pa(6922,3,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:pa(6923,3,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:pa(6924,3,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:pa(6925,3,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:pa(6926,3,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:pa(6927,3,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:pa(6928,3,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:pa(6929,3,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:pa(6930,3,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:pa(6931,1,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:pa(7005,1,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:pa(7006,1,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:pa(7008,1,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:pa(7009,1,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:pa(7010,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:pa(7011,1,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation:pa(7012,1,"This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012","This overload implicitly returns the type '{0}' because it lacks a return type annotation."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:pa(7013,1,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:pa(7014,1,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:pa(7015,1,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:pa(7016,1,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:pa(7017,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:pa(7018,1,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:pa(7019,1,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:pa(7020,1,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:pa(7022,1,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_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:pa(7023,1,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{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."),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:pa(7024,1,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","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."),Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation:pa(7025,1,"Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation_7025","Generator implicitly has yield type '{0}'. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:pa(7026,1,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:pa(7027,1,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:pa(7028,1,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:pa(7029,1,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:pa(7030,1,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:pa(7031,1,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:pa(7032,1,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:pa(7033,1,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:pa(7034,1,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:pa(7035,1,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:pa(7036,1,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:pa(7037,3,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),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:pa(7038,3,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","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."),Mapped_object_type_implicitly_has_an_any_template_type:pa(7039,1,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:pa(7040,1,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:pa(7041,1,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:pa(7042,1,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:pa(7043,2,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:pa(7044,2,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:pa(7045,2,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:pa(7046,2,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:pa(7047,2,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:pa(7048,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:pa(7049,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:pa(7050,2,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:pa(7051,1,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:pa(7052,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:pa(7053,1,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:pa(7054,1,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:pa(7055,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:pa(7056,1,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:pa(7057,1,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:pa(7058,1,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:pa(7059,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:pa(7060,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:pa(7061,1,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:pa(8e3,1,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:pa(8001,1,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:pa(8002,1,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:pa(8003,1,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:pa(8004,1,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:pa(8005,1,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:pa(8006,1,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:pa(8008,1,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:pa(8009,1,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:pa(8010,1,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:pa(8011,1,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:pa(8012,1,"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:pa(8013,1,"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:pa(8016,1,"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:pa(8017,1,"Signature_declarations_can_only_be_used_in_TypeScript_files_8017","Signature declarations can only be used in TypeScript files."),Report_errors_in_js_files:pa(8019,3,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:pa(8020,1,"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:pa(8021,1,"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."),JSDoc_0_is_not_attached_to_a_class:pa(8022,1,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:pa(8023,1,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:pa(8024,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:pa(8025,1,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:pa(8026,1,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:pa(8027,1,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:pa(8028,1,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:pa(8029,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:pa(8030,1,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:pa(8031,1,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:pa(8032,1,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:pa(8033,1,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:pa(8034,1,"The_tag_was_first_specified_here_8034","The tag was first specified here."),You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:pa(8035,1,"You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035","You cannot rename elements that are defined in a 'node_modules' folder."),You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder:pa(8036,1,"You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036","You cannot rename elements that are defined in another 'node_modules' folder."),Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files:pa(8037,1,"Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037","Type satisfaction expressions can only be used in TypeScript files."),Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export:pa(8038,1,"Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038","Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag:pa(8039,1,"A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039","A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:pa(9005,1,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:pa(9006,1,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:pa(9007,1,"Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007","Function must have an explicit return type annotation with --isolatedDeclarations."),Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:pa(9008,1,"Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008","Method must have an explicit return type annotation with --isolatedDeclarations."),At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations:pa(9009,1,"At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9009","At least one accessor must have an explicit type annotation with --isolatedDeclarations."),Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations:pa(9010,1,"Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010","Variable must have an explicit type annotation with --isolatedDeclarations."),Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations:pa(9011,1,"Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011","Parameter must have an explicit type annotation with --isolatedDeclarations."),Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations:pa(9012,1,"Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012","Property must have an explicit type annotation with --isolatedDeclarations."),Expression_type_can_t_be_inferred_with_isolatedDeclarations:pa(9013,1,"Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013","Expression type can't be inferred with --isolatedDeclarations."),Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations:pa(9014,1,"Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014","Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations."),Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations:pa(9015,1,"Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015","Objects that contain spread assignments can't be inferred with --isolatedDeclarations."),Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations:pa(9016,1,"Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016","Objects that contain shorthand properties can't be inferred with --isolatedDeclarations."),Only_const_arrays_can_be_inferred_with_isolatedDeclarations:pa(9017,1,"Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017","Only const arrays can be inferred with --isolatedDeclarations."),Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations:pa(9018,1,"Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018","Arrays with spread elements can't inferred with --isolatedDeclarations."),Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations:pa(9019,1,"Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019","Binding elements can't be exported directly with --isolatedDeclarations."),Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations:pa(9020,1,"Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020","Enum member initializers must be computable without references to external symbols with --isolatedDeclarations."),Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations:pa(9021,1,"Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021","Extends clause can't contain an expression with --isolatedDeclarations."),Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations:pa(9022,1,"Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022","Inference from class expressions is not supported with --isolatedDeclarations."),Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function:pa(9023,1,"Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023","Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function."),Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations:pa(9025,1,"Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_sup_9025","Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations."),Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations:pa(9026,1,"Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026","Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations."),Add_a_type_annotation_to_the_variable_0:pa(9027,1,"Add_a_type_annotation_to_the_variable_0_9027","Add a type annotation to the variable {0}."),Add_a_type_annotation_to_the_parameter_0:pa(9028,1,"Add_a_type_annotation_to_the_parameter_0_9028","Add a type annotation to the parameter {0}."),Add_a_type_annotation_to_the_property_0:pa(9029,1,"Add_a_type_annotation_to_the_property_0_9029","Add a type annotation to the property {0}."),Add_a_return_type_to_the_function_expression:pa(9030,1,"Add_a_return_type_to_the_function_expression_9030","Add a return type to the function expression."),Add_a_return_type_to_the_function_declaration:pa(9031,1,"Add_a_return_type_to_the_function_declaration_9031","Add a return type to the function declaration."),Add_a_return_type_to_the_get_accessor_declaration:pa(9032,1,"Add_a_return_type_to_the_get_accessor_declaration_9032","Add a return type to the get accessor declaration."),Add_a_type_to_parameter_of_the_set_accessor_declaration:pa(9033,1,"Add_a_type_to_parameter_of_the_set_accessor_declaration_9033","Add a type to parameter of the set accessor declaration."),Add_a_return_type_to_the_method:pa(9034,1,"Add_a_return_type_to_the_method_9034","Add a return type to the method"),Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit:pa(9035,1,"Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035","Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."),Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it:pa(9036,1,"Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036","Move the expression in default export to a variable and add a type annotation to it."),Default_exports_can_t_be_inferred_with_isolatedDeclarations:pa(9037,1,"Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037","Default exports can't be inferred with --isolatedDeclarations."),Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations:pa(9038,1,"Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038","Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."),Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations:pa(9039,1,"Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039","Type containing private name '{0}' can't be used with --isolatedDeclarations."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:pa(17e3,1,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:pa(17001,1,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:pa(17002,1,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:pa(17004,1,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:pa(17005,1,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:pa(17006,1,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:pa(17007,1,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:pa(17008,1,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:pa(17009,1,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:pa(17010,1,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:pa(17011,1,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:pa(17012,1,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:pa(17013,1,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:pa(17014,1,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:pa(17015,1,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:pa(17016,1,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:pa(17017,1,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:pa(17018,1,"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:pa(17019,1,"_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:pa(17020,1,"_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:pa(17021,1,"Unicode_escape_sequence_cannot_appear_here_17021","Unicode escape sequence cannot appear here."),Circularity_detected_while_resolving_configuration_Colon_0:pa(18e3,1,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:pa(18002,1,"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:pa(18003,1,"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}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:pa(80001,2,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:pa(80002,2,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:pa(80003,2,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:pa(80004,2,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:pa(80005,2,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:pa(80006,2,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:pa(80007,2,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:pa(80008,2,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),JSDoc_typedef_may_be_converted_to_TypeScript_type:pa(80009,2,"JSDoc_typedef_may_be_converted_to_TypeScript_type_80009","JSDoc typedef may be converted to TypeScript type."),JSDoc_typedefs_may_be_converted_to_TypeScript_types:pa(80010,2,"JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010","JSDoc typedefs may be converted to TypeScript types."),Add_missing_super_call:pa(90001,3,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:pa(90002,3,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:pa(90003,3,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:pa(90004,3,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:pa(90005,3,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:pa(90006,3,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:pa(90007,3,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:pa(90008,3,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:pa(90010,3,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:pa(90011,3,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:pa(90012,3,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:pa(90013,3,"Import_0_from_1_90013","Import '{0}' from \"{1}\""),Change_0_to_1:pa(90014,3,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:pa(90016,3,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:pa(90017,3,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:pa(90018,3,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:pa(90019,3,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:pa(90020,3,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:pa(90021,3,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:pa(90022,3,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:pa(90023,3,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:pa(90024,3,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:pa(90025,3,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:pa(90026,3,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:pa(90027,3,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:pa(90028,3,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:pa(90029,3,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:pa(90030,3,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:pa(90031,3,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:pa(90034,3,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:pa(90035,3,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:pa(90036,3,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:pa(90037,3,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:pa(90038,3,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:pa(90039,3,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:pa(90041,3,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:pa(90053,3,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:pa(90054,3,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:pa(90055,3,"Remove_type_from_import_declaration_from_0_90055","Remove 'type' from import declaration from \"{0}\""),Remove_type_from_import_of_0_from_1:pa(90056,3,"Remove_type_from_import_of_0_from_1_90056","Remove 'type' from import of '{0}' from \"{1}\""),Add_import_from_0:pa(90057,3,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:pa(90058,3,"Update_import_from_0_90058",'Update import from "{0}"'),Export_0_from_module_1:pa(90059,3,"Export_0_from_module_1_90059","Export '{0}' from module '{1}'"),Export_all_referenced_locals:pa(90060,3,"Export_all_referenced_locals_90060","Export all referenced locals"),Update_modifiers_of_0:pa(90061,3,"Update_modifiers_of_0_90061","Update modifiers of '{0}'"),Add_annotation_of_type_0:pa(90062,3,"Add_annotation_of_type_0_90062","Add annotation of type '{0}'"),Add_return_type_0:pa(90063,3,"Add_return_type_0_90063","Add return type '{0}'"),Extract_base_class_to_variable:pa(90064,3,"Extract_base_class_to_variable_90064","Extract base class to variable"),Extract_default_export_to_variable:pa(90065,3,"Extract_default_export_to_variable_90065","Extract default export to variable"),Extract_binding_expressions_to_variable:pa(90066,3,"Extract_binding_expressions_to_variable_90066","Extract binding expressions to variable"),Add_all_missing_type_annotations:pa(90067,3,"Add_all_missing_type_annotations_90067","Add all missing type annotations"),Add_satisfies_and_an_inline_type_assertion_with_0:pa(90068,3,"Add_satisfies_and_an_inline_type_assertion_with_0_90068","Add satisfies and an inline type assertion with '{0}'"),Extract_to_variable_and_replace_with_0_as_typeof_0:pa(90069,3,"Extract_to_variable_and_replace_with_0_as_typeof_0_90069","Extract to variable and replace with '{0} as typeof {0}'"),Mark_array_literal_as_const:pa(90070,3,"Mark_array_literal_as_const_90070","Mark array literal as const"),Annotate_types_of_properties_expando_function_in_a_namespace:pa(90071,3,"Annotate_types_of_properties_expando_function_in_a_namespace_90071","Annotate types of properties expando function in a namespace"),Convert_function_to_an_ES2015_class:pa(95001,3,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:pa(95003,3,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:pa(95004,3,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:pa(95005,3,"Extract_function_95005","Extract function"),Extract_constant:pa(95006,3,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:pa(95007,3,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:pa(95008,3,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:pa(95009,3,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:pa(95011,3,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:pa(95012,3,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:pa(95013,3,"Convert_to_default_import_95013","Convert to default import"),Install_0:pa(95014,3,"Install_0_95014","Install '{0}'"),Replace_import_with_0:pa(95015,3,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:pa(95016,3,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:pa(95017,3,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:pa(95018,3,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:pa(95019,3,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:pa(95020,3,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:pa(95021,3,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:pa(95022,3,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:pa(95023,3,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:pa(95024,3,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:pa(95025,3,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:pa(95026,3,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:pa(95027,3,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:pa(95028,3,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:pa(95029,3,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:pa(95030,3,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:pa(95031,3,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:pa(95032,3,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:pa(95033,3,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:pa(95034,3,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:pa(95035,3,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:pa(95036,3,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:pa(95037,3,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:pa(95038,3,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:pa(95039,3,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:pa(95040,3,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:pa(95041,3,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:pa(95042,3,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:pa(95043,3,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:pa(95044,3,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:pa(95045,3,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:pa(95046,3,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:pa(95047,3,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:pa(95048,3,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:pa(95049,3,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:pa(95050,3,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:pa(95051,3,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:pa(95052,3,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:pa(95053,3,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:pa(95054,3,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:pa(95055,3,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:pa(95056,3,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:pa(95057,3,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:pa(95058,3,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:pa(95059,3,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:pa(95060,3,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:pa(95061,3,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:pa(95062,3,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:pa(95063,3,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:pa(95064,3,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:pa(95065,3,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:pa(95066,3,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:pa(95067,3,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:pa(95068,3,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:pa(95069,3,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:pa(95070,3,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:pa(95071,3,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:pa(95072,3,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:pa(95073,3,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:pa(95074,3,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:pa(95075,3,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:pa(95077,3,"Extract_type_95077","Extract type"),Extract_to_type_alias:pa(95078,3,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:pa(95079,3,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:pa(95080,3,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:pa(95081,3,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:pa(95082,3,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:pa(95083,3,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:pa(95084,3,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:pa(95085,3,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:pa(95086,3,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:pa(95087,3,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:pa(95088,3,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:pa(95089,3,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:pa(95090,3,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:pa(95091,3,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:pa(95092,3,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:pa(95093,3,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:pa(95094,3,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:pa(95095,3,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:pa(95096,3,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:pa(95097,3,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:pa(95098,3,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:pa(95099,3,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:pa(95100,3,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:pa(95101,3,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_all_const_to_let:pa(95102,3,"Convert_all_const_to_let_95102","Convert all 'const' to 'let'"),Convert_function_expression_0_to_arrow_function:pa(95105,3,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:pa(95106,3,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:pa(95107,3,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:pa(95108,3,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:pa(95109,3,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:pa(95110,3,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:pa(95111,3,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:pa(95112,3,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:pa(95113,3,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:pa(95114,3,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:pa(95115,3,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:pa(95116,3,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:pa(95117,3,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:pa(95118,3,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:pa(95119,3,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:pa(95120,3,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:pa(95121,3,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:pa(95122,3,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:pa(95123,3,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:pa(95124,3,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:pa(95125,3,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:pa(95126,3,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:pa(95127,3,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:pa(95128,3,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:pa(95129,3,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:pa(95130,3,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:pa(95131,3,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:pa(95132,3,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:pa(95133,3,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:pa(95134,3,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:pa(95135,3,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:pa(95136,3,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:pa(95137,3,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:pa(95138,3,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:pa(95139,3,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:pa(95140,3,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:pa(95141,3,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:pa(95142,3,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:pa(95143,3,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:pa(95144,3,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:pa(95145,3,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:pa(95146,3,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:pa(95147,3,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:pa(95148,3,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:pa(95149,3,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:pa(95150,3,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:pa(95151,3,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:pa(95152,3,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:pa(95153,3,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenations_and_string_literals:pa(95154,3,"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:pa(95155,3,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:pa(95156,3,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:pa(95157,3,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:pa(95158,3,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:pa(95159,3,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:pa(95160,3,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:pa(95161,3,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:pa(95162,3,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:pa(95163,3,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:pa(95164,3,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:pa(95165,3,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:pa(95166,3,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:pa(95167,3,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:pa(95168,3,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:pa(95169,3,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:pa(95170,3,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:pa(95171,3,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:pa(95172,3,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:pa(95173,3,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),Use_0:pa(95174,3,"Use_0_95174","Use `{0}`."),Use_Number_isNaN_in_all_conditions:pa(95175,3,"Use_Number_isNaN_in_all_conditions_95175","Use `Number.isNaN` in all conditions."),Convert_typedef_to_TypeScript_type:pa(95176,3,"Convert_typedef_to_TypeScript_type_95176","Convert typedef to TypeScript type."),Convert_all_typedef_to_TypeScript_types:pa(95177,3,"Convert_all_typedef_to_TypeScript_types_95177","Convert all typedef to TypeScript types."),Move_to_file:pa(95178,3,"Move_to_file_95178","Move to file"),Cannot_move_to_file_selected_file_is_invalid:pa(95179,3,"Cannot_move_to_file_selected_file_is_invalid_95179","Cannot move to file, selected file is invalid"),Use_import_type:pa(95180,3,"Use_import_type_95180","Use 'import type'"),Use_type_0:pa(95181,3,"Use_type_0_95181","Use 'type {0}'"),Fix_all_with_type_only_imports:pa(95182,3,"Fix_all_with_type_only_imports_95182","Fix all with type-only imports"),Cannot_move_statements_to_the_selected_file:pa(95183,3,"Cannot_move_statements_to_the_selected_file_95183","Cannot move statements to the selected file"),Inline_variable:pa(95184,3,"Inline_variable_95184","Inline variable"),Could_not_find_variable_to_inline:pa(95185,3,"Could_not_find_variable_to_inline_95185","Could not find variable to inline."),Variables_with_multiple_declarations_cannot_be_inlined:pa(95186,3,"Variables_with_multiple_declarations_cannot_be_inlined_95186","Variables with multiple declarations cannot be inlined."),Add_missing_comma_for_object_member_completion_0:pa(95187,3,"Add_missing_comma_for_object_member_completion_0_95187","Add missing comma for object member completion '{0}'."),Add_missing_parameter_to_0:pa(95188,3,"Add_missing_parameter_to_0_95188","Add missing parameter to '{0}'"),Add_missing_parameters_to_0:pa(95189,3,"Add_missing_parameters_to_0_95189","Add missing parameters to '{0}'"),Add_all_missing_parameters:pa(95190,3,"Add_all_missing_parameters_95190","Add all missing parameters"),Add_optional_parameter_to_0:pa(95191,3,"Add_optional_parameter_to_0_95191","Add optional parameter to '{0}'"),Add_optional_parameters_to_0:pa(95192,3,"Add_optional_parameters_to_0_95192","Add optional parameters to '{0}'"),Add_all_optional_parameters:pa(95193,3,"Add_all_optional_parameters_95193","Add all optional parameters"),Wrap_in_parentheses:pa(95194,3,"Wrap_in_parentheses_95194","Wrap in parentheses"),Wrap_all_invalid_decorator_expressions_in_parentheses:pa(95195,3,"Wrap_all_invalid_decorator_expressions_in_parentheses_95195","Wrap all invalid decorator expressions in parentheses"),Add_resolution_mode_import_attribute:pa(95196,3,"Add_resolution_mode_import_attribute_95196","Add 'resolution-mode' import attribute"),Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it:pa(95197,3,"Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it_95197","Add 'resolution-mode' import attribute to all type-only imports that need it"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:pa(18004,1,"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:pa(18006,1,"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:pa(18007,1,"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?"),Private_identifiers_cannot_be_used_as_parameters:pa(18009,1,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:pa(18010,1,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:pa(18011,1,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:pa(18012,1,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:pa(18013,1,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:pa(18014,1,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:pa(18015,1,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:pa(18016,1,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:pa(18017,1,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:pa(18018,1,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:pa(18019,1,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:pa(18024,1,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:pa(18026,1,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:pa(18027,1,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:pa(18028,1,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:pa(18029,1,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:pa(18030,1,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:pa(18031,1,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:pa(18032,1,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values:pa(18033,1,"Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033","Type '{0}' is not assignable to type '{1}' as required for computed enum member values."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:pa(18034,3,"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:pa(18035,1,"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:pa(18036,1,"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:pa(18037,1,"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:pa(18038,1,"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:pa(18039,1,"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:pa(18041,1,"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:pa(18042,1,"_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."),Types_cannot_appear_in_export_declarations_in_JavaScript_files:pa(18043,1,"Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043","Types cannot appear in export declarations in JavaScript files."),_0_is_automatically_exported_here:pa(18044,3,"_0_is_automatically_exported_here_18044","'{0}' is automatically exported here."),Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher:pa(18045,1,"Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045","Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."),_0_is_of_type_unknown:pa(18046,1,"_0_is_of_type_unknown_18046","'{0}' is of type 'unknown'."),_0_is_possibly_null:pa(18047,1,"_0_is_possibly_null_18047","'{0}' is possibly 'null'."),_0_is_possibly_undefined:pa(18048,1,"_0_is_possibly_undefined_18048","'{0}' is possibly 'undefined'."),_0_is_possibly_null_or_undefined:pa(18049,1,"_0_is_possibly_null_or_undefined_18049","'{0}' is possibly 'null' or 'undefined'."),The_value_0_cannot_be_used_here:pa(18050,1,"The_value_0_cannot_be_used_here_18050","The value '{0}' cannot be used here."),Compiler_option_0_cannot_be_given_an_empty_string:pa(18051,1,"Compiler_option_0_cannot_be_given_an_empty_string_18051","Compiler option '{0}' cannot be given an empty string."),Its_type_0_is_not_a_valid_JSX_element_type:pa(18053,1,"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:pa(18054,1,"await_using_statements_cannot_be_used_inside_a_class_static_block_18054","'await using' statements cannot be used inside a class static block."),_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled:pa(18055,1,"_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055","'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled:pa(18056,1,"Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056","Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."),String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020:pa(18057,1,"String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057","String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'."),Default_imports_are_not_allowed_in_a_deferred_import:pa(18058,1,"Default_imports_are_not_allowed_in_a_deferred_import_18058","Default imports are not allowed in a deferred import."),Named_imports_are_not_allowed_in_a_deferred_import:pa(18059,1,"Named_imports_are_not_allowed_in_a_deferred_import_18059","Named imports are not allowed in a deferred import."),Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve:pa(18060,1,"Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve_18060","Deferred imports are only supported when the '--module' flag is set to 'esnext' or 'preserve'."),_0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer:pa(18061,1,"_0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer_18061","'{0}' is not a valid meta-property for keyword 'import'. Did you mean 'meta' or 'defer'?")};function ma(e){return e>=80}function ga(e){return 32===e||ma(e)}var ha={abstract:128,accessor:129,any:133,as:130,asserts:131,assert:132,bigint:163,boolean:136,break:83,case:84,catch:85,class:86,continue:88,const:87,constructor:137,debugger:89,declare:138,default:90,defer:166,delete:91,do:92,else:93,enum:94,export:95,extends:96,false:97,finally:98,for:99,from:161,function:100,get:139,if:101,implements:119,import:102,in:103,infer:140,instanceof:104,interface:120,intrinsic:141,is:142,keyof:143,let:121,module:144,namespace:145,never:146,new:105,null:106,number:150,object:151,package:122,private:123,protected:124,public:125,override:164,out:147,readonly:148,require:149,global:162,return:107,satisfies:152,set:153,static:126,string:154,super:108,switch:109,symbol:155,this:110,throw:111,true:112,try:113,type:156,typeof:114,undefined:157,unique:158,unknown:159,using:160,var:115,void:116,while:117,with:118,yield:127,async:134,await:135,of:165},ya=new Map(Object.entries(ha)),va=new Map(Object.entries({...ha,"{":19,"}":20,"(":21,")":22,"[":23,"]":24,".":25,"...":26,";":27,",":28,"<":30,">":32,"<=":33,">=":34,"==":35,"!=":36,"===":37,"!==":38,"=>":39,"+":40,"-":41,"**":43,"*":42,"/":44,"%":45,"++":46,"--":47,"<<":48,">":49,">>>":50,"&":51,"|":52,"^":53,"!":54,"~":55,"&&":56,"||":57,"?":58,"??":61,"?.":29,":":59,"=":64,"+=":65,"-=":66,"*=":67,"**=":68,"/=":69,"%=":70,"<<=":71,">>=":72,">>>=":73,"&=":74,"|=":75,"^=":79,"||=":76,"&&=":77,"??=":78,"@":60,"#":63,"`":62})),ba=new Map([[100,1],[103,2],[105,4],[109,8],[115,16],[117,32],[118,64],[121,128]]),xa=new Map([[1,Ei.RegularExpressionFlagsHasIndices],[16,Ei.RegularExpressionFlagsDotAll],[32,Ei.RegularExpressionFlagsUnicode],[64,Ei.RegularExpressionFlagsUnicodeSets],[128,Ei.RegularExpressionFlagsSticky]]),ka=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,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,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,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,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],Sa=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,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,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,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,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,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,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,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,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,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,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,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,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,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,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,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,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,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,65062,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],Ta=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2160,2183,2185,2190,2208,2249,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3165,3165,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3293,3294,3296,3297,3313,3314,3332,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,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,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5905,5919,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6988,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,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,8305,8305,8319,8319,8336,8348,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,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,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,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,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,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69248,69289,69296,69297,69376,69404,69415,69415,69424,69445,69488,69505,69552,69572,69600,69622,69635,69687,69745,69746,69749,69749,69763,69807,69840,69864,69891,69926,69956,69956,69959,69959,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70207,70208,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70753,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71488,71494,71680,71723,71840,71903,71935,71942,71945,71945,71948,71955,71957,71958,71960,71983,71999,71999,72001,72001,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72368,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73474,73474,73476,73488,73490,73523,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78913,78918,82944,83526,92160,92728,92736,92766,92784,92862,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,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,122624,122654,122661,122666,122928,122989,123136,123180,123191,123197,123214,123214,123536,123565,123584,123627,124112,124139,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125184,125251,125259,125259,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,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743],Ca=[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,2160,2183,2185,2190,2200,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,2901,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,3132,3140,3142,3144,3146,3149,3157,3158,3160,3162,3165,3165,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3293,3294,3296,3299,3302,3311,3313,3315,3328,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3457,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,3790,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,5909,5919,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6159,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,6847,6862,6912,6988,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,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,8204,8205,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,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,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43047,43052,43052,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,43881,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,65381,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,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,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,69248,69289,69291,69292,69296,69297,69373,69404,69415,69415,69424,69456,69488,69509,69552,69572,69600,69622,69632,69702,69734,69749,69759,69818,69826,69826,69840,69864,69872,69881,69888,69940,69942,69951,69956,69959,69968,70003,70006,70006,70016,70084,70089,70092,70094,70106,70108,70108,70144,70161,70163,70199,70206,70209,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,70753,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,71488,71494,71680,71738,71840,71913,71935,71942,71945,71945,71948,71955,71957,71958,71960,71989,71991,71992,71995,72003,72016,72025,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72368,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,73472,73488,73490,73530,73534,73538,73552,73561,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78912,78933,82944,83526,92160,92728,92736,92766,92768,92777,92784,92862,92864,92873,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,94180,94192,94193,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,118528,118573,118576,118598,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,122624,122654,122661,122666,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,122928,122989,123023,123023,123136,123180,123184,123197,123200,123209,123214,123214,123536,123566,123584,123641,124112,124153,124896,124902,124904,124907,124909,124910,124912,124926,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,130032,130041,131072,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743,917760,917999],wa=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,Na=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/,Da=/@(?:see|link)/i;function Fa(e,t){if(e=2?Ta:ka)}function Pa(e){const t=[];return e.forEach((e,n)=>{t[e]=n}),t}var Aa=Pa(va);function Ia(e){return Aa[e]}function Oa(e){return va.get(e)}var La=Pa(ba);function ja(e){return La[e]}function Ma(e){return ba.get(e)}function Ra(e){const t=[];let n=0,r=0;for(;n127&&Ka(i)&&(t.push(r),r=n)}}return t.push(r),t}function Ba(e,t,n,r){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,n,r):Ja(za(e),t,n,e.text,r)}function Ja(e,t,n,r,i){(t<0||t>=e.length)&&(i?t=t<0?0:t>=e.length?e.length-1:t:pn.fail(`Bad line number. Line: ${t}, lineStarts.length: ${e.length} , line map is correct? ${void 0!==r?re(e,Ra(r)):"unknown"}`));const o=e[t]+n;return i?o>e[t+1]?e[t+1]:"string"==typeof r&&o>r.length?r.length:o:(t=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function Ka(e){return 10===e||13===e||8232===e||8233===e}function Ga(e){return e>=48&&e<=57}function Xa(e){return Ga(e)||e>=65&&e<=70||e>=97&&e<=102}function Qa(e){return e>=65&&e<=90||e>=97&&e<=122}function Ya(e){return Qa(e)||Ga(e)||95===e}function Za(e){return e>=48&&e<=55}function es(e,t){const n=e.charCodeAt(t);switch(n){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return!0;case 35:return 0===t;default:return n>127}}function ts(e,t,n,r,i){if(tT(t))return t;let o=!1;for(;;){const a=e.charCodeAt(t);switch(a){case 13:10===e.charCodeAt(t+1)&&t++;case 10:if(t++,n)return t;o=!!i;continue;case 9:case 11:case 12:case 32:t++;continue;case 47:if(r)break;if(47===e.charCodeAt(t+1)){for(t+=2;t127&&$a(a)){t++;continue}}return t}}var ns=7;function rs(e,t){if(pn.assert(t>=0),0===t||Ka(e.charCodeAt(t-1))){const n=e.charCodeAt(t);if(t+ns=0&&n127&&$a(a)){u&&Ka(a)&&(_=!0),n++;continue}break e}}return u&&(p=i(s,c,l,_,o,p)),p}function ls(e,t,n,r){return cs(!1,e,t,!1,n,r)}function _s(e,t,n,r){return cs(!1,e,t,!0,n,r)}function us(e,t,n,r,i){return cs(!0,e,t,!1,n,r,i)}function ds(e,t,n,r,i){return cs(!0,e,t,!0,n,r,i)}function ps(e,t,n,r,i,o=[]){return o.push({kind:n,pos:e,end:t,hasTrailingNewLine:r}),o}function fs(e,t){return us(e,t,ps,void 0,void 0)}function ms(e,t){return ds(e,t,ps,void 0,void 0)}function gs(e){const t=os.exec(e);if(t)return t[0]}function hs(e,t){return Qa(e)||36===e||95===e||e>127&&Ea(e,t)}function ys(e,t,n){return Ya(e)||36===e||1===n&&(45===e||58===e)||e>127&&function(e,t){return Fa(e,t>=2?Ca:Sa)}(e,t)}function vs(e,t,n){let r=xs(e,0);if(!hs(r,t))return!1;for(let i=ks(r);il,getStartPos:()=>l,getTokenEnd:()=>s,getTextPos:()=>s,getToken:()=>u,getTokenStart:()=>_,getTokenPos:()=>_,getTokenText:()=>g.substring(_,s),getTokenValue:()=>d,hasUnicodeEscape:()=>!!(1024&f),hasExtendedUnicodeEscape:()=>!!(8&f),hasPrecedingLineBreak:()=>!!(1&f),hasPrecedingJSDocComment:()=>!!(2&f),hasPrecedingJSDocLeadingAsterisks:()=>!!(32768&f),isIdentifier:()=>80===u||u>118,isReservedWord:()=>u>=83&&u<=118,isUnterminated:()=>!!(4&f),getCommentDirectives:()=>m,getNumericLiteralFlags:()=>25584&f,getTokenFlags:()=>f,reScanGreaterToken:function(){if(32===u){if(62===S(s))return 62===S(s+1)?61===S(s+2)?(s+=3,u=73):(s+=2,u=50):61===S(s+1)?(s+=2,u=72):(s++,u=49);if(61===S(s))return s++,u=34}return u},reScanAsteriskEqualsToken:function(){return pn.assert(67===u,"'reScanAsteriskEqualsToken' should only be called on a '*='"),s=_+1,u=64},reScanSlashToken:function(t){if(44===u||69===u){const n=_+1;s=n;let r=!1,i=!1,a=!1;for(;;){const e=T(s);if(-1===e||Ka(e)){f|=4;break}if(r)r=!1;else{if(47===e&&!a)break;91===e?a=!0:92===e?r=!0:93===e?a=!1:a||40!==e||63!==T(s+1)||60!==T(s+2)||61===T(s+3)||33===T(s+3)||(i=!0)}s++}const l=s;if(4&f){s=n,r=!1;let e=0,t=!1,i=0;for(;s{!function(t,n,r){var i,a,l,u,f=!!(64&t),m=!!(96&t),h=m||!n,y=!1,v=0,b=[];function x(e){for(;;){if(b.push(u),u=void 0,w(e),u=b.pop(),124!==T(s))return;s++}}function w(t){let n=!1;for(;;){const r=s,i=T(s);switch(i){case-1:return;case 94:case 36:s++,n=!1;break;case 92:switch(T(++s)){case 98:case 66:s++,n=!1;break;default:D(),n=!0}break;case 40:if(63===T(++s))switch(T(++s)){case 61:case 33:s++,n=!h;break;case 60:const t=s;switch(T(++s)){case 61:case 33:s++,n=!1;break;default:A(!1),H(62),e<5&&C(fa.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later,t,s-t),v++,n=!0}break;default:const r=s,i=N(0);45===T(s)&&(s++,N(i),s===r+1&&C(fa.Subpattern_flags_must_be_present_when_there_is_a_minus_sign,r,s-r)),H(58),n=!0}else v++,n=!0;x(!0),H(41);break;case 123:const o=++s;F();const a=d;if(!h&&!a){n=!0;break}if(44===T(s)){s++,F();const e=d;if(a)e&&Number.parseInt(a)>Number.parseInt(e)&&(h||125===T(s))&&C(fa.Numbers_out_of_order_in_quantifier,o,s-o);else{if(!e&&125!==T(s)){C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,r,1,String.fromCharCode(i)),n=!0;break}C(fa.Incomplete_quantifier_Digit_expected,o,0)}}else if(!a){h&&C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,r,1,String.fromCharCode(i)),n=!0;break}if(125!==T(s)){if(!h){n=!0;break}C(fa._0_expected,s,0,String.fromCharCode(125)),s--}case 42:case 43:case 63:63===T(++s)&&s++,n||C(fa.There_is_nothing_available_for_repetition,r,s-r),n=!1;break;case 46:s++,n=!0;break;case 91:s++,f?j():L(),H(93),n=!0;break;case 41:if(t)return;case 93:case 125:(h||41===i)&&C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,s,1,String.fromCharCode(i)),s++,n=!0;break;case 47:case 124:return;default:$(),n=!0}}}function N(t){for(;;){const n=k(s);if(-1===n||!ys(n,e))break;const r=ks(n),i=Ma(n);void 0===i?C(fa.Unknown_regular_expression_flag,s,r):t&i?C(fa.Duplicate_regular_expression_flag,s,r):28&i?(t|=i,W(i,r)):C(fa.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern,s,r),s+=r}return t}function D(){switch(pn.assertEqual(S(s-1),92),T(s)){case 107:60===T(++s)?(s++,A(!0),H(62)):(h||r)&&C(fa.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets,s-2,2);break;case 113:if(f){s++,C(fa.q_is_only_available_inside_character_class,s-2,2);break}default:pn.assert(q()||E()||P(!0))}}function E(){pn.assertEqual(S(s-1),92);const e=T(s);if(e>=49&&e<=57){const e=s;return F(),l=ae(l,{pos:e,end:s,value:+d}),!0}return!1}function P(e){pn.assertEqual(S(s-1),92);let t=T(s);switch(t){case-1:return C(fa.Undetermined_character_escape,s-1,1),"\\";case 99:if(t=T(++s),Qa(t))return s++,String.fromCharCode(31&t);if(h)C(fa.c_must_be_followed_by_an_ASCII_letter,s-2,2);else if(e)return s--,"\\";return String.fromCharCode(t);case 94:case 36:case 47:case 92:case 46:case 42:case 43:case 63:case 40:case 41:case 91:case 93:case 123:case 125:case 124:return s++,String.fromCharCode(t);default:return s--,O(4|(n?8:0)|(m?16:0)|(e?32:0))}}function A(t){pn.assertEqual(S(s-1),60),_=s,V(k(s),e),s===_?C(fa.Expected_a_capturing_group_name):t?a=ae(a,{pos:_,end:s,name:d}):(null==u?void 0:u.has(d))||b.some(e=>null==e?void 0:e.has(d))?C(fa.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other,_,s-_):(u??(u=new Set),u.add(d),i??(i=new Set),i.add(d))}function I(e){return 93===e||-1===e||s>=c}function L(){for(pn.assertEqual(S(s-1),91),94===T(s)&&s++;;){if(I(T(s)))return;const e=s,t=z();if(45===T(s)){if(I(T(++s)))return;!t&&h&&C(fa.A_character_class_range_must_not_be_bounded_by_another_character_class,e,s-1-e);const n=s,r=z();if(!r&&h){C(fa.A_character_class_range_must_not_be_bounded_by_another_character_class,n,s-n);continue}if(!t)continue;const i=xs(t,0),o=xs(r,0);t.length===ks(i)&&r.length===ks(o)&&i>o&&C(fa.Range_out_of_order_in_character_class,e,s-e)}}}function j(){pn.assertEqual(S(s-1),91);let e=!1;94===T(s)&&(s++,e=!0);let t=!1,n=T(s);if(I(n))return;let r,i=s;switch(g.slice(s,s+2)){case"--":case"&&":C(fa.Expected_a_class_set_operand),y=!1;break;default:r=R()}switch(T(s)){case 45:if(45===T(s+1))return e&&y&&C(fa.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class,i,s-i),t=y,M(3),void(y=!e&&t);break;case 38:if(38===T(s+1))return M(2),e&&y&&C(fa.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class,i,s-i),t=y,void(y=!e&&t);C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,s,1,String.fromCharCode(n));break;default:e&&y&&C(fa.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class,i,s-i),t=y}for(;n=T(s),-1!==n;){switch(n){case 45:if(n=T(++s),I(n))return void(y=!e&&t);if(45===n){s++,C(fa.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead,s-2,2),i=s-2,r=g.slice(i,s);continue}{r||C(fa.A_character_class_range_must_not_be_bounded_by_another_character_class,i,s-1-i);const n=s,o=R();if(e&&y&&C(fa.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class,n,s-n),t||(t=y),!o){C(fa.A_character_class_range_must_not_be_bounded_by_another_character_class,n,s-n);break}if(!r)break;const a=xs(r,0),c=xs(o,0);r.length===ks(a)&&o.length===ks(c)&&a>c&&C(fa.Range_out_of_order_in_character_class,i,s-i)}break;case 38:i=s,38===T(++s)?(s++,C(fa.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead,s-2,2),38===T(s)&&(C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,s,1,String.fromCharCode(n)),s++)):C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,s-1,1,String.fromCharCode(n)),r=g.slice(i,s);continue}if(I(T(s)))break;switch(i=s,g.slice(s,s+2)){case"--":case"&&":C(fa.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead,s,2),s+=2,r=g.slice(i,s);break;default:r=R()}}y=!e&&t}function M(e){let t=y;for(;;){let n=T(s);if(I(n))break;switch(n){case 45:45===T(++s)?(s++,3!==e&&C(fa.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead,s-2,2)):C(fa.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead,s-1,1);break;case 38:38===T(++s)?(s++,2!==e&&C(fa.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead,s-2,2),38===T(s)&&(C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,s,1,String.fromCharCode(n)),s++)):C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,s-1,1,String.fromCharCode(n));break;default:switch(e){case 3:C(fa._0_expected,s,0,"--");break;case 2:C(fa._0_expected,s,0,"&&")}}if(n=T(s),I(n)){C(fa.Expected_a_class_set_operand);break}R(),t&&(t=y)}y=t}function R(){switch(y=!1,T(s)){case-1:return"";case 91:return s++,j(),H(93),"";case 92:if(s++,q())return"";if(113===T(s))return 123===T(++s)?(s++,B(),H(125),""):(C(fa.q_must_be_followed_by_string_alternatives_enclosed_in_braces,s-2,2),"q");s--;default:return J()}}function B(){pn.assertEqual(S(s-1),123);let e=0;for(;;){switch(T(s)){case-1:return;case 125:return void(1!==e&&(y=!0));case 124:1!==e&&(y=!0),s++,o=s,e=0;break;default:J(),e++}}}function J(){const e=T(s);if(-1===e)return"";if(92===e){const e=T(++s);switch(e){case 98:return s++,"\b";case 38:case 45:case 33:case 35:case 37:case 44:case 58:case 59:case 60:case 61:case 62:case 64:case 96:case 126:return s++,String.fromCharCode(e);default:return P(!1)}}else if(e===T(s+1))switch(e){case 38:case 33:case 35:case 37:case 42:case 43:case 44:case 46:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 96:case 126:return C(fa.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash,s,2),s+=2,g.substring(s-2,s)}switch(e){case 47:case 40:case 41:case 91:case 93:case 123:case 125:case 45:case 124:return C(fa.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,s,1,String.fromCharCode(e)),s++,String.fromCharCode(e)}return $()}function z(){if(92!==T(s))return $();{const e=T(++s);switch(e){case 98:return s++,"\b";case 45:return s++,String.fromCharCode(e);default:return q()?"":P(!1)}}}function q(){pn.assertEqual(S(s-1),92);let e=!1;const t=s-1,n=T(s);switch(n){case 100:case 68:case 115:case 83:case 119:case 87:return s++,!0;case 80:e=!0;case 112:if(123===T(++s)){const n=++s,r=U();if(61===T(s)){const e=Cs.get(r);if(s===n)C(fa.Expected_a_Unicode_property_name);else if(void 0===e){C(fa.Unknown_Unicode_property_name,n,s-n);const e=Mt(r,Cs.keys(),lt);e&&C(fa.Did_you_mean_0,n,s-n,e)}const t=++s,i=U();if(s===t)C(fa.Expected_a_Unicode_property_value);else if(void 0!==e&&!Ds[e].has(i)){C(fa.Unknown_Unicode_property_value,t,s-t);const n=Mt(i,Ds[e],lt);n&&C(fa.Did_you_mean_0,t,s-t,n)}}else if(s===n)C(fa.Expected_a_Unicode_property_name_or_value);else if(Ns.has(r))f?e?C(fa.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class,n,s-n):y=!0:C(fa.Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set,n,s-n);else if(!Ds.General_Category.has(r)&&!ws.has(r)){C(fa.Unknown_Unicode_property_name_or_value,n,s-n);const e=Mt(r,[...Ds.General_Category,...ws,...Ns],lt);e&&C(fa.Did_you_mean_0,n,s-n,e)}H(125),m||C(fa.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set,t,s-t)}else{if(!h)return s--,!1;C(fa._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces,s-2,2,String.fromCharCode(n))}return!0}return!1}function U(){let e="";for(;;){const t=T(s);if(-1===t||!Ya(t))break;e+=String.fromCharCode(t),s++}return e}function $(){const e=m?ks(k(s)):1;return s+=e,e>0?g.substring(s-e,s):""}function H(e){T(s)===e?s++:C(fa._0_expected,s,0,String.fromCharCode(e))}x(!1),p(a,e=>{if(!(null==i?void 0:i.has(e.name))&&(C(fa.There_is_no_capturing_group_named_0_in_this_regular_expression,e.pos,e.end-e.pos,e.name),i)){const t=Mt(e.name,i,lt);t&&C(fa.Did_you_mean_0,e.pos,e.end-e.pos,t)}}),p(l,e=>{e.value>v&&(v?C(fa.This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression,e.pos,e.end-e.pos,v):C(fa.This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression,e.pos,e.end-e.pos))})}(r,!0,i)})}d=g.substring(_,s),u=14}return u},reScanTemplateToken:function(e){return s=_,u=I(!e)},reScanTemplateHeadOrNoSubstitutionTemplate:function(){return s=_,u=I(!0)},scanJsxIdentifier:function(){if(ma(u)){for(;s=c)return u=1;for(let t=S(s);s=0&&Ha(S(s-1))&&!(s+1{const e=b.getText();return e.slice(0,b.getTokenFullStart())+"║"+e.slice(b.getTokenFullStart())}}),b;function x(e){return xs(g,e)}function k(e){return e>=0&&e=0&&e=65&&e<=70)e+=32;else if(!(e>=48&&e<=57||e>=97&&e<=102))break;r.push(e),s++,o=!1}}return r.length=c){n+=g.substring(r,s),f|=4,C(fa.Unterminated_string_literal);break}const i=S(s);if(i===t){n+=g.substring(r,s),s++;break}if(92!==i||e){if((10===i||13===i)&&!e){n+=g.substring(r,s),f|=4,C(fa.Unterminated_string_literal);break}s++}else n+=g.substring(r,s),n+=O(3),r=s}return n}function I(e){const t=96===S(s);let n,r=++s,i="";for(;;){if(s>=c){i+=g.substring(r,s),f|=4,C(fa.Unterminated_template_literal),n=t?15:18;break}const o=S(s);if(96===o){i+=g.substring(r,s),s++,n=t?15:18;break}if(36===o&&s+1=c)return C(fa.Unexpected_end_of_text),"";const r=S(s);switch(s++,r){case 48:if(s>=c||!Ga(S(s)))return"\0";case 49:case 50:case 51:s=55296&&i<=56319&&s+6=56320&&n<=57343)return s=t,o+String.fromCharCode(n)}return o;case 120:for(;s1114111&&(e&&C(fa.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,n,s-n),o=!0),s>=c?(e&&C(fa.Unexpected_end_of_text),o=!0):125===S(s)?s++:(e&&C(fa.Unterminated_Unicode_escape_sequence),o=!0),o?(f|=2048,g.substring(t,s)):(f|=8,Ts(i))}function j(){if(s+5=0&&ys(r,e)){t+=L(!0),n=s;continue}if(r=j(),!(r>=0&&ys(r,e)))break;f|=1024,t+=g.substring(n,s),t+=Ts(r),n=s+=6}}return t+=g.substring(n,s),t}function B(){const e=d.length;if(e>=2&&e<=12){const e=d.charCodeAt(0);if(e>=97&&e<=122){const e=ya.get(d);if(void 0!==e)return u=e}}return u=80}function J(e){let t="",n=!1,r=!1;for(;;){const i=S(s);if(95!==i){if(n=!0,!Ga(i)||i-48>=e)break;t+=g[s],s++,r=!1}else f|=512,n?(n=!1,r=!0):C(r?fa.Multiple_consecutive_numeric_separators_are_not_permitted:fa.Numeric_separators_are_not_allowed_here,s,1),s++}return 95===S(s-1)&&C(fa.Numeric_separators_are_not_allowed_here,s-1,1),t}function z(){if(110===S(s))return d+="n",384&f&&(d=bT(d)+"n"),s++,10;{const e=128&f?parseInt(d.slice(2),2):256&f?parseInt(d.slice(2),8):+d;return d=""+e,9}}function q(){for(l=s,f=0;;){if(_=s,s>=c)return u=1;const r=x(s);if(0===s&&35===r&&as(g,s)){if(s=ss(g,s),t)continue;return u=6}switch(r){case 10:case 13:if(f|=1,t){s++;continue}return 13===r&&s+1=0&&hs(i,e))return d=L(!0)+R(),u=B();const o=j();return o>=0&&hs(o,e)?(s+=6,f|=1024,d=String.fromCharCode(o)+R(),u=B()):(C(fa.Invalid_character),s++,u=0);case 35:if(0!==s&&"!"===g[s+1])return C(fa.can_only_be_used_at_the_start_of_a_file,s,2),s++,u=0;const a=x(s+1);if(92===a){s++;const t=M();if(t>=0&&hs(t,e))return d="#"+L(!0)+R(),u=81;const n=j();if(n>=0&&hs(n,e))return s+=6,f|=1024,d="#"+String.fromCharCode(n)+R(),u=81;s--}return hs(a,e)?(s++,V(a,e)):(d="#",C(fa.Invalid_character,s++,ks(r))),u=81;case 65533:return C(fa.File_appears_to_be_binary,0,0),s=c,u=8;default:const l=V(r,e);if(l)return u=l;if(Ha(r)){s+=ks(r);continue}if(Ka(r)){f|=1,s+=ks(r);continue}const p=ks(r);return C(fa.Invalid_character,s,p),s+=p,u=0}}}function U(){switch(v){case 0:return!0;case 1:return!1}return 3!==y&&4!==y||3!==v&&Da.test(g.slice(l,s))}function V(e,t){let n=e;if(hs(n,t)){for(s+=ks(n);s=c)return u=1;let t=S(s);if(60===t)return 47===S(s+1)?(s+=2,u=31):(s++,u=30);if(123===t)return s++,u=19;let n=0;for(;s0)break;$a(t)||(n=s)}s++}return d=g.substring(l,s),-1===n?13:12}function K(){switch(l=s,S(s)){case 34:case 39:return d=A(!0),u=11;default:return q()}}function G(){if(l=_=s,f=0,s>=c)return u=1;const t=x(s);switch(s+=ks(t),t){case 9:case 11:case 12:case 32:for(;s=0&&hs(t,e))return d=L(!0)+R(),u=B();const n=j();return n>=0&&hs(n,e)?(s+=6,f|=1024,d=String.fromCharCode(n)+R(),u=B()):(s++,u=0)}if(hs(t,e)){let n=t;for(;s=0),s=e,l=e,_=e,u=0,d=void 0,f=0}}function xs(e,t){return e.codePointAt(t)}function ks(e){return e>=65536?2:-1===e?0:1}var Ss=String.fromCodePoint?e=>String.fromCodePoint(e):function(e){if(pn.assert(0<=e&&e<=1114111),e<=65535)return String.fromCharCode(e);const t=Math.floor((e-65536)/1024)+55296,n=(e-65536)%1024+56320;return String.fromCharCode(t,n)};function Ts(e){return Ss(e)}var Cs=new Map(Object.entries({General_Category:"General_Category",gc:"General_Category",Script:"Script",sc:"Script",Script_Extensions:"Script_Extensions",scx:"Script_Extensions"})),ws=new Set(["ASCII","ASCII_Hex_Digit","AHex","Alphabetic","Alpha","Any","Assigned","Bidi_Control","Bidi_C","Bidi_Mirrored","Bidi_M","Case_Ignorable","CI","Cased","Changes_When_Casefolded","CWCF","Changes_When_Casemapped","CWCM","Changes_When_Lowercased","CWL","Changes_When_NFKC_Casefolded","CWKCF","Changes_When_Titlecased","CWT","Changes_When_Uppercased","CWU","Dash","Default_Ignorable_Code_Point","DI","Deprecated","Dep","Diacritic","Dia","Emoji","Emoji_Component","EComp","Emoji_Modifier","EMod","Emoji_Modifier_Base","EBase","Emoji_Presentation","EPres","Extended_Pictographic","ExtPict","Extender","Ext","Grapheme_Base","Gr_Base","Grapheme_Extend","Gr_Ext","Hex_Digit","Hex","IDS_Binary_Operator","IDSB","IDS_Trinary_Operator","IDST","ID_Continue","IDC","ID_Start","IDS","Ideographic","Ideo","Join_Control","Join_C","Logical_Order_Exception","LOE","Lowercase","Lower","Math","Noncharacter_Code_Point","NChar","Pattern_Syntax","Pat_Syn","Pattern_White_Space","Pat_WS","Quotation_Mark","QMark","Radical","Regional_Indicator","RI","Sentence_Terminal","STerm","Soft_Dotted","SD","Terminal_Punctuation","Term","Unified_Ideograph","UIdeo","Uppercase","Upper","Variation_Selector","VS","White_Space","space","XID_Continue","XIDC","XID_Start","XIDS"]),Ns=new Set(["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"]),Ds={General_Category:new Set(["C","Other","Cc","Control","cntrl","Cf","Format","Cn","Unassigned","Co","Private_Use","Cs","Surrogate","L","Letter","LC","Cased_Letter","Ll","Lowercase_Letter","Lm","Modifier_Letter","Lo","Other_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter","M","Mark","Combining_Mark","Mc","Spacing_Mark","Me","Enclosing_Mark","Mn","Nonspacing_Mark","N","Number","Nd","Decimal_Number","digit","Nl","Letter_Number","No","Other_Number","P","Punctuation","punct","Pc","Connector_Punctuation","Pd","Dash_Punctuation","Pe","Close_Punctuation","Pf","Final_Punctuation","Pi","Initial_Punctuation","Po","Other_Punctuation","Ps","Open_Punctuation","S","Symbol","Sc","Currency_Symbol","Sk","Modifier_Symbol","Sm","Math_Symbol","So","Other_Symbol","Z","Separator","Zl","Line_Separator","Zp","Paragraph_Separator","Zs","Space_Separator"]),Script:new Set(["Adlm","Adlam","Aghb","Caucasian_Albanian","Ahom","Arab","Arabic","Armi","Imperial_Aramaic","Armn","Armenian","Avst","Avestan","Bali","Balinese","Bamu","Bamum","Bass","Bassa_Vah","Batk","Batak","Beng","Bengali","Bhks","Bhaiksuki","Bopo","Bopomofo","Brah","Brahmi","Brai","Braille","Bugi","Buginese","Buhd","Buhid","Cakm","Chakma","Cans","Canadian_Aboriginal","Cari","Carian","Cham","Cher","Cherokee","Chrs","Chorasmian","Copt","Coptic","Qaac","Cpmn","Cypro_Minoan","Cprt","Cypriot","Cyrl","Cyrillic","Deva","Devanagari","Diak","Dives_Akuru","Dogr","Dogra","Dsrt","Deseret","Dupl","Duployan","Egyp","Egyptian_Hieroglyphs","Elba","Elbasan","Elym","Elymaic","Ethi","Ethiopic","Geor","Georgian","Glag","Glagolitic","Gong","Gunjala_Gondi","Gonm","Masaram_Gondi","Goth","Gothic","Gran","Grantha","Grek","Greek","Gujr","Gujarati","Guru","Gurmukhi","Hang","Hangul","Hani","Han","Hano","Hanunoo","Hatr","Hatran","Hebr","Hebrew","Hira","Hiragana","Hluw","Anatolian_Hieroglyphs","Hmng","Pahawh_Hmong","Hmnp","Nyiakeng_Puachue_Hmong","Hrkt","Katakana_Or_Hiragana","Hung","Old_Hungarian","Ital","Old_Italic","Java","Javanese","Kali","Kayah_Li","Kana","Katakana","Kawi","Khar","Kharoshthi","Khmr","Khmer","Khoj","Khojki","Kits","Khitan_Small_Script","Knda","Kannada","Kthi","Kaithi","Lana","Tai_Tham","Laoo","Lao","Latn","Latin","Lepc","Lepcha","Limb","Limbu","Lina","Linear_A","Linb","Linear_B","Lisu","Lyci","Lycian","Lydi","Lydian","Mahj","Mahajani","Maka","Makasar","Mand","Mandaic","Mani","Manichaean","Marc","Marchen","Medf","Medefaidrin","Mend","Mende_Kikakui","Merc","Meroitic_Cursive","Mero","Meroitic_Hieroglyphs","Mlym","Malayalam","Modi","Mong","Mongolian","Mroo","Mro","Mtei","Meetei_Mayek","Mult","Multani","Mymr","Myanmar","Nagm","Nag_Mundari","Nand","Nandinagari","Narb","Old_North_Arabian","Nbat","Nabataean","Newa","Nkoo","Nko","Nshu","Nushu","Ogam","Ogham","Olck","Ol_Chiki","Orkh","Old_Turkic","Orya","Oriya","Osge","Osage","Osma","Osmanya","Ougr","Old_Uyghur","Palm","Palmyrene","Pauc","Pau_Cin_Hau","Perm","Old_Permic","Phag","Phags_Pa","Phli","Inscriptional_Pahlavi","Phlp","Psalter_Pahlavi","Phnx","Phoenician","Plrd","Miao","Prti","Inscriptional_Parthian","Rjng","Rejang","Rohg","Hanifi_Rohingya","Runr","Runic","Samr","Samaritan","Sarb","Old_South_Arabian","Saur","Saurashtra","Sgnw","SignWriting","Shaw","Shavian","Shrd","Sharada","Sidd","Siddham","Sind","Khudawadi","Sinh","Sinhala","Sogd","Sogdian","Sogo","Old_Sogdian","Sora","Sora_Sompeng","Soyo","Soyombo","Sund","Sundanese","Sylo","Syloti_Nagri","Syrc","Syriac","Tagb","Tagbanwa","Takr","Takri","Tale","Tai_Le","Talu","New_Tai_Lue","Taml","Tamil","Tang","Tangut","Tavt","Tai_Viet","Telu","Telugu","Tfng","Tifinagh","Tglg","Tagalog","Thaa","Thaana","Thai","Tibt","Tibetan","Tirh","Tirhuta","Tnsa","Tangsa","Toto","Ugar","Ugaritic","Vaii","Vai","Vith","Vithkuqi","Wara","Warang_Citi","Wcho","Wancho","Xpeo","Old_Persian","Xsux","Cuneiform","Yezi","Yezidi","Yiii","Yi","Zanb","Zanabazar_Square","Zinh","Inherited","Qaai","Zyyy","Common","Zzzz","Unknown"]),Script_Extensions:void 0};function Fs(e){return So(e)||bo(e)}function Es(e){return ne(e,sk,uk)}Ds.Script_Extensions=Ds.Script;var Ps=new Map([[99,"lib.esnext.full.d.ts"],[11,"lib.es2024.full.d.ts"],[10,"lib.es2023.full.d.ts"],[9,"lib.es2022.full.d.ts"],[8,"lib.es2021.full.d.ts"],[7,"lib.es2020.full.d.ts"],[6,"lib.es2019.full.d.ts"],[5,"lib.es2018.full.d.ts"],[4,"lib.es2017.full.d.ts"],[3,"lib.es2016.full.d.ts"],[2,"lib.es6.d.ts"]]);function As(e){const t=Sk(e);switch(t){case 99:case 11:case 10:case 9:case 8:case 7:case 6:case 5:case 4:case 3:case 2:return Ps.get(t);default:return"lib.d.ts"}}function Is(e){return e.start+e.length}function Os(e){return 0===e.length}function Ls(e,t){return t>=e.start&&t=e.pos&&t<=e.end}function Ms(e,t){return t.start>=e.start&&Is(t)<=Is(e)}function Rs(e,t){return t.pos>=e.start&&t.end<=Is(e)}function Bs(e,t){return t.start>=e.pos&&Is(t)<=e.end}function Js(e,t){return void 0!==zs(e,t)}function zs(e,t){const n=Hs(e,t);return n&&0===n.length?void 0:n}function qs(e,t){return Vs(e.start,e.length,t.start,t.length)}function Us(e,t,n){return Vs(e.start,e.length,t,n)}function Vs(e,t,n,r){return n<=e+t&&n+r>=e}function Ws(e,t){return t<=Is(e)&&t>=e.start}function $s(e,t){return Us(t,e.pos,e.end-e.pos)}function Hs(e,t){const n=Math.max(e.start,t.start),r=Math.min(Is(e),Is(t));return n<=r?Xs(n,r):void 0}function Ks(e){e=e.filter(e=>e.length>0).sort((e,t)=>e.start!==t.start?e.start-t.start:e.length-t.length);const t=[];let n=0;for(;n=2&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)?"_"+e:e}function vc(e){const t=e;return t.length>=3&&95===t.charCodeAt(0)&&95===t.charCodeAt(1)&&95===t.charCodeAt(2)?t.substr(1):t}function bc(e){return vc(e.escapedText)}function xc(e){const t=Oa(e.escapedText);return t?rt(t,Fh):void 0}function kc(e){return e.valueDeclaration&&Yl(e.valueDeclaration)?bc(e.valueDeclaration.name):vc(e.escapedName)}function Sc(e){const t=e.parent.parent;if(t){if(fu(t))return Tc(t);switch(t.kind){case 244:if(t.declarationList&&t.declarationList.declarations[0])return Tc(t.declarationList.declarations[0]);break;case 245:let e=t.expression;switch(227===e.kind&&64===e.operatorToken.kind&&(e=e.left),e.kind){case 212:return e.name;case 213:const t=e.argumentExpression;if(uD(t))return t}break;case 218:return Tc(t.expression);case 257:if(fu(t.statement)||K_(t.statement))return Tc(t.statement)}}}function Tc(e){const t=Fc(e);return t&&uD(t)?t:void 0}function Cc(e,t){return!(!Nc(e)||!uD(e.name)||bc(e.name)!==bc(t))||!(!XF(e)||!H(e.declarationList.declarations,e=>Cc(e,t)))}function wc(e){return e.name||Sc(e)}function Nc(e){return!!e.name}function Dc(e){switch(e.kind){case 80:return e;case 349:case 342:{const{name:t}=e;if(167===t.kind)return t.right;break}case 214:case 227:{const t=e;switch(og(t)){case 1:case 4:case 5:case 3:return pg(t.left);case 7:case 8:case 9:return t.arguments[1];default:return}}case 347:return wc(e);case 341:return Sc(e);case 278:{const{expression:t}=e;return uD(t)?t:void 0}case 213:const t=e;if(_g(t))return t.argumentExpression}return e.name}function Fc(e){if(void 0!==e)return Dc(e)||(TF(e)||CF(e)||MF(e)?Ec(e):void 0)}function Ec(e){if(e.parent){if(cP(e.parent)||fF(e.parent))return e.parent.name;if(AF(e.parent)&&e===e.parent.right){if(uD(e.parent.left))return e.parent.left;if(Dx(e.parent.left))return pg(e.parent.left)}else if(fE(e.parent)&&uD(e.parent.name))return e.parent.name}}function Pc(e){if(Jv(e))return D(e.modifiers,ED)}function Ac(e){if(Av(e,98303))return D(e.modifiers,r_)}function Ic(e,t){if(e.name){if(uD(e.name)){const n=e.name.escapedText;return cl(e.parent,t).filter(e=>VP(e)&&uD(e.name)&&e.name.escapedText===n)}{const n=e.parent.parameters.indexOf(e);pn.assert(n>-1,"Parameters should always be in their parents' parameter list");const r=cl(e.parent,t).filter(VP);if(nKP(e)&&e.typeParameters.some(e=>e.name.escapedText===n))}function Mc(e){return jc(e,!1)}function Rc(e){return jc(e,!0)}function Bc(e){return!!_l(e,VP)}function Jc(e){return _l(e,PP)}function zc(e){return ul(e,YP)}function qc(e){return _l(e,IP)}function Uc(e){return _l(e,LP)}function Vc(e){return _l(e,LP,!0)}function Wc(e){return _l(e,jP)}function $c(e){return _l(e,jP,!0)}function Hc(e){return _l(e,MP)}function Kc(e){return _l(e,MP,!0)}function Gc(e){return _l(e,RP)}function Xc(e){return _l(e,RP,!0)}function Qc(e){return _l(e,BP,!0)}function Yc(e){return _l(e,zP)}function Zc(e){return _l(e,zP,!0)}function el(e){return _l(e,UP)}function tl(e){return _l(e,$P)}function nl(e){return _l(e,WP)}function rl(e){return _l(e,KP)}function il(e){return _l(e,ZP)}function ol(e){const t=_l(e,HP);if(t&&t.typeExpression&&t.typeExpression.type)return t}function al(e){let t=_l(e,HP);return!t&&FD(e)&&(t=x(Oc(e),e=>!!e.typeExpression)),t&&t.typeExpression&&t.typeExpression.type}function sl(e){const t=nl(e);if(t&&t.typeExpression)return t.typeExpression.type;const n=ol(e);if(n&&n.typeExpression){const e=n.typeExpression.type;if(HD(e)){const t=x(e.members,BD);return t&&t.type}if(VD(e)||CP(e))return e.type}}function cl(e,t){var n;if(!Bg(e))return _;let r=null==(n=e.jsDoc)?void 0:n.jsDocCache;if(void 0===r||t){const n=Jg(e,t);pn.assert(n.length<2||n[0]!==n[1]),r=L(n,e=>DP(e)?e.tags:e),t||(e.jsDoc??(e.jsDoc=[]),e.jsDoc.jsDocCache=r)}return r}function ll(e){return cl(e,!1)}function _l(e,t,n){return x(cl(e,n),t)}function ul(e,t){return ll(e).filter(t)}function dl(e,t){return ll(e).filter(e=>e.kind===t)}function pl(e){return"string"==typeof e?e:null==e?void 0:e.map(e=>322===e.kind?e.text:function(e){const t=325===e.kind?"link":326===e.kind?"linkcode":"linkplain",n=e.name?zp(e.name):"",r=e.name&&(""===e.text||e.text.startsWith("://"))?"":" ";return`{@${t} ${n}${r}${e.text}}`}(e)).join("")}function fl(e){if(EP(e)){if(JP(e.parent)){const t=Gg(e.parent);if(t&&d(t.tags))return L(t.tags,e=>KP(e)?e.typeParameters:void 0)}return _}if(Ag(e))return pn.assert(321===e.parent.kind),L(e.parent.tags,e=>KP(e)?e.typeParameters:void 0);if(e.typeParameters)return e.typeParameters;if(XA(e)&&e.typeParameters)return e.typeParameters;if(Om(e)){const t=xv(e);if(t.length)return t;const n=al(e);if(n&&VD(n)&&n.typeParameters)return n.typeParameters}return _}function ml(e){return e.constraint?e.constraint:KP(e.parent)&&e===e.parent.typeParameters[0]?e.parent.constraint:void 0}function gl(e){return 80===e.kind||81===e.kind}function hl(e){return 179===e.kind||178===e.kind}function yl(e){return hF(e)&&!!(64&e.flags)}function vl(e){return yF(e)&&!!(64&e.flags)}function bl(e){return vF(e)&&!!(64&e.flags)}function xl(e){const t=e.kind;return!!(64&e.flags)&&(212===t||213===t||214===t||236===t)}function kl(e){return xl(e)&&!qF(e)&&!!e.questionDotToken}function Sl(e){return kl(e.parent)&&e.parent.expression===e}function Tl(e){return!xl(e.parent)||kl(e.parent)||e!==e.parent.expression}function Cl(e){return 227===e.kind&&61===e.operatorToken.kind}function wl(e){return UD(e)&&uD(e.typeName)&&"const"===e.typeName.escapedText&&!e.typeArguments}function Nl(e){return AA(e,8)}function Dl(e){return qF(e)&&!!(64&e.flags)}function Fl(e){return 253===e.kind||252===e.kind}function El(e){return 281===e.kind||280===e.kind}function Pl(e){return 349===e.kind||342===e.kind}function Al(e){return e>=167}function Il(e){return e>=0&&e<=166}function Ol(e){return Il(e.kind)}function Ll(e){return Ee(e,"pos")&&Ee(e,"end")}function jl(e){return 9<=e&&e<=15}function Ml(e){return jl(e.kind)}function Rl(e){switch(e.kind){case 211:case 210:case 14:case 219:case 232:return!0}return!1}function Bl(e){return 15<=e&&e<=18}function Jl(e){return Bl(e.kind)}function zl(e){const t=e.kind;return 17===t||18===t}function ql(e){return jE(e)||JE(e)}function Ul(e){switch(e.kind){case 277:return e.isTypeOnly||156===e.parent.parent.phaseModifier;case 275:return 156===e.parent.phaseModifier;case 274:return 156===e.phaseModifier;case 272:return e.isTypeOnly}return!1}function Vl(e){switch(e.kind){case 282:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 279:return e.isTypeOnly&&!!e.moduleSpecifier&&!e.exportClause;case 281:return e.parent.isTypeOnly}return!1}function Wl(e){return Ul(e)||Vl(e)}function $l(e){return void 0!==mc(e,Wl)}function Hl(e){return 11===e.kind||Bl(e.kind)}function Kl(e){return KN(e)||uD(e)}function Gl(e){var t;return uD(e)&&void 0!==(null==(t=e.emitNode)?void 0:t.autoGenerate)}function Xl(e){var t;return dD(e)&&void 0!==(null==(t=e.emitNode)?void 0:t.autoGenerate)}function Ql(e){const t=e.emitNode.autoGenerate.flags;return!!(32&t)&&!!(16&t)&&!!(8&t)}function Yl(e){return(AD(e)||v_(e))&&dD(e.name)}function Zl(e){return hF(e)&&dD(e.name)}function e_(e){switch(e){case 128:case 129:case 134:case 87:case 138:case 90:case 95:case 103:case 125:case 123:case 124:case 148:case 126:case 147:case 164:return!0}return!1}function t_(e){return!!(31&Yv(e))}function n_(e){return t_(e)||126===e||164===e||129===e}function r_(e){return e_(e.kind)}function i_(e){const t=e.kind;return 167===t||80===t}function o_(e){const t=e.kind;return 80===t||81===t||11===t||9===t||168===t}function a_(e){const t=e.kind;return 80===t||207===t||208===t}function s_(e){return!!e&&d_(e.kind)}function c_(e){return!!e&&(d_(e.kind)||LD(e))}function l_(e){return e&&u_(e.kind)}function __(e){return 112===e.kind||97===e.kind}function u_(e){switch(e){case 263:case 175:case 177:case 178:case 179:case 219:case 220:return!0;default:return!1}}function d_(e){switch(e){case 174:case 180:case 324:case 181:case 182:case 185:case 318:case 186:return!0;default:return u_(e)}}function p_(e){return dP(e)||kE(e)||GF(e)&&s_(e.parent)}function f_(e){const t=e.kind;return 177===t||173===t||175===t||178===t||179===t||182===t||176===t||241===t}function m_(e){return e&&(264===e.kind||232===e.kind)}function g_(e){return e&&(178===e.kind||179===e.kind)}function h_(e){return AD(e)&&Rv(e)}function y_(e){return Om(e)&&fC(e)?!(lg(e)&&gb(e.expression)||ug(e,!0)):e.parent&&m_(e.parent)&&AD(e)&&!Rv(e)}function v_(e){switch(e.kind){case 175:case 178:case 179:return!0;default:return!1}}function b_(e){return r_(e)||ED(e)}function x_(e){const t=e.kind;return 181===t||180===t||172===t||174===t||182===t||178===t||179===t||355===t}function k_(e){return x_(e)||f_(e)}function S_(e){const t=e.kind;return 304===t||305===t||306===t||175===t||178===t||179===t}function T_(e){return Nx(e.kind)}function C_(e){switch(e.kind){case 185:case 186:return!0}return!1}function w_(e){if(e){const t=e.kind;return 208===t||207===t}return!1}function N_(e){const t=e.kind;return 210===t||211===t}function D_(e){const t=e.kind;return 209===t||233===t}function F_(e){switch(e.kind){case 261:case 170:case 209:return!0}return!1}function E_(e){return fE(e)||FD(e)||I_(e)||L_(e)}function P_(e){return A_(e)||O_(e)}function A_(e){switch(e.kind){case 207:case 211:return!0}return!1}function I_(e){switch(e.kind){case 209:case 304:case 305:case 306:return!0}return!1}function O_(e){switch(e.kind){case 208:case 210:return!0}return!1}function L_(e){switch(e.kind){case 209:case 233:case 231:case 210:case 211:case 80:case 212:case 213:return!0}return cb(e,!0)}function j_(e){const t=e.kind;return 212===t||167===t||206===t}function M_(e){const t=e.kind;return 212===t||167===t}function R_(e){return B_(e)||UT(e)}function B_(e){switch(e.kind){case 214:case 215:case 216:case 171:case 287:case 286:case 290:return!0;case 227:return 104===e.operatorToken.kind;default:return!1}}function J_(e){return 214===e.kind||215===e.kind}function z_(e){const t=e.kind;return 229===t||15===t}function q_(e){return U_(Nl(e).kind)}function U_(e){switch(e){case 212:case 213:case 215:case 214:case 285:case 286:case 289:case 216:case 210:case 218:case 211:case 232:case 219:case 80:case 81:case 14:case 9:case 10:case 11:case 15:case 229:case 97:case 106:case 110:case 112:case 108:case 236:case 234:case 237:case 102:case 283:return!0;default:return!1}}function V_(e){return W_(Nl(e).kind)}function W_(e){switch(e){case 225:case 226:case 221:case 222:case 223:case 224:case 217:return!0;default:return U_(e)}}function $_(e){switch(e.kind){case 226:return!0;case 225:return 46===e.operator||47===e.operator;default:return!1}}function H_(e){switch(e.kind){case 106:case 112:case 97:case 225:return!0;default:return Ml(e)}}function K_(e){return function(e){switch(e){case 228:case 230:case 220:case 227:case 231:case 235:case 233:case 357:case 356:case 239:return!0;default:return W_(e)}}(Nl(e).kind)}function G_(e){const t=e.kind;return 217===t||235===t}function X_(e,t){switch(e.kind){case 249:case 250:case 251:case 247:case 248:return!0;case 257:return t&&X_(e.statement,t)}return!1}function Q_(e){return ME(e)||RE(e)}function Y_(e){return H(e,Q_)}function Z_(e){return!(Ap(e)||ME(e)||Av(e,32)||dp(e))}function eu(e){return Ap(e)||ME(e)||Av(e,32)}function tu(e){return 250===e.kind||251===e.kind}function nu(e){return GF(e)||K_(e)}function ru(e){return GF(e)}function iu(e){return mE(e)||K_(e)}function ou(e){const t=e.kind;return 269===t||268===t||80===t}function au(e){const t=e.kind;return 269===t||268===t}function su(e){const t=e.kind;return 80===t||268===t}function cu(e){const t=e.kind;return 276===t||275===t}function lu(e){return 268===e.kind||267===e.kind}function _u(e){switch(e.kind){case 220:case 227:case 209:case 214:case 180:case 264:case 232:case 176:case 177:case 186:case 181:case 213:case 267:case 307:case 278:case 279:case 282:case 263:case 219:case 185:case 178:case 80:case 274:case 272:case 277:case 182:case 265:case 339:case 341:case 318:case 342:case 349:case 324:case 347:case 323:case 292:case 293:case 294:case 201:case 175:case 174:case 268:case 203:case 281:case 271:case 275:case 215:case 15:case 9:case 211:case 170:case 212:case 304:case 173:case 172:case 179:case 305:case 308:case 306:case 11:case 266:case 188:case 169:case 261:return!0;default:return!1}}function uu(e){switch(e.kind){case 220:case 242:case 180:case 270:case 300:case 176:case 195:case 177:case 186:case 181:case 249:case 250:case 251:case 263:case 219:case 185:case 178:case 182:case 339:case 341:case 318:case 324:case 347:case 201:case 175:case 174:case 268:case 179:case 308:case 266:return!0;default:return!1}}function du(e){return 263===e||283===e||264===e||265===e||266===e||267===e||268===e||273===e||272===e||279===e||278===e||271===e}function pu(e){return 253===e||252===e||260===e||247===e||245===e||243===e||250===e||251===e||249===e||246===e||257===e||254===e||256===e||258===e||259===e||244===e||248===e||255===e||354===e}function fu(e){return 169===e.kind?e.parent&&346!==e.parent.kind||Om(e):220===(t=e.kind)||209===t||264===t||232===t||176===t||177===t||267===t||307===t||282===t||263===t||219===t||178===t||274===t||272===t||277===t||265===t||292===t||175===t||174===t||268===t||271===t||275===t||281===t||170===t||304===t||173===t||172===t||179===t||305===t||266===t||169===t||261===t||347===t||339===t||349===t||203===t;var t}function mu(e){return du(e.kind)}function gu(e){return pu(e.kind)}function hu(e){const t=e.kind;return pu(t)||du(t)||function(e){if(242!==e.kind)return!1;if(void 0!==e.parent&&(259===e.parent.kind||300===e.parent.kind))return!1;return!Uf(e)}(e)}function yu(e){const t=e.kind;return pu(t)||du(t)||242===t}function vu(e){const t=e.kind;return 284===t||167===t||80===t}function bu(e){const t=e.kind;return 110===t||80===t||212===t||296===t}function xu(e){const t=e.kind;return 285===t||295===t||286===t||12===t||289===t}function ku(e){const t=e.kind;return 292===t||294===t}function Su(e){const t=e.kind;return 11===t||295===t}function Tu(e){const t=e.kind;return 287===t||286===t}function Cu(e){const t=e.kind;return 287===t||286===t||290===t}function wu(e){const t=e.kind;return 297===t||298===t}function Nu(e){return e.kind>=310&&e.kind<=352}function Du(e){return 321===e.kind||320===e.kind||322===e.kind||zu(e)||Fu(e)||FP(e)||EP(e)}function Fu(e){return e.kind>=328&&e.kind<=352}function Eu(e){return 179===e.kind}function Pu(e){return 178===e.kind}function Au(e){if(!Bg(e))return!1;const{jsDoc:t}=e;return!!t&&t.length>0}function Iu(e){return!!e.type}function Ou(e){return!!e.initializer}function Lu(e){switch(e.kind){case 261:case 170:case 209:case 173:case 304:case 307:return!0;default:return!1}}function ju(e){return 292===e.kind||294===e.kind||S_(e)}function Mu(e){return 184===e.kind||234===e.kind}var Ru=1073741823;function Bu(e){let t=Ru;for(const n of e){if(!n.length)continue;let e=0;for(;e0?n.parent.parameters[r-1]:void 0,o=t.text,a=i?G(ms(o,ts(o,i.end+1,!1,!0)),fs(o,e.pos)):ms(o,ts(o,e.pos,!1,!0));return H(a)&&Vu(xe(a),t)}return!!p(n&&kf(n,t),e=>Vu(e,t))}var $u=[],Hu="tslib",Ku=160,Gu=1e6,Xu=500;function Qu(e,t){const n=e.declarations;if(n)for(const e of n)if(e.kind===t)return e}function Yu(e,t){return D(e.declarations||_,e=>e.kind===t)}function Zu(e){const t=new Map;if(e)for(const n of e)t.set(n.escapedName,n);return t}function ed(e){return!!(33554432&e.flags)}function td(e){return!!(1536&e.flags)&&34===e.escapedName.charCodeAt(0)}var nd=function(){var e="";const t=t=>e+=t;return{getText:()=>e,write:t,rawWrite:t,writeKeyword:t,writeOperator:t,writePunctuation:t,writeSpace:t,writeStringLiteral:t,writeLiteral:t,writeParameter:t,writeProperty:t,writeSymbol:(e,n)=>t(e),writeTrailingSemicolon:t,writeComment:t,getTextPos:()=>e.length,getLine:()=>0,getColumn:()=>0,getIndent:()=>0,isAtStartOfLine:()=>!1,hasTrailingComment:()=>!1,hasTrailingWhitespace:()=>!!e.length&&$a(e.charCodeAt(e.length-1)),writeLine:()=>e+=" ",increaseIndent:ot,decreaseIndent:ot,clear:()=>e=""}}();function rd(e,t){return e.configFilePath!==t.configFilePath||function(e,t){return od(e,t,WO)}(e,t)}function id(e,t){return od(e,t,HO)}function od(e,t,n){return e!==t&&n.some(n=>!vT(Qk(e,n),Qk(t,n)))}function ad(e,t){for(;;){const n=t(e);if("quit"===n)return;if(void 0!==n)return n;if(dP(e))return;e=e.parent}}function sd(e,t){const n=e.entries();for(const[e,r]of n){const n=t(r,e);if(n)return n}}function cd(e,t){const n=e.keys();for(const e of n){const n=t(e);if(n)return n}}function ld(e,t){e.forEach((e,n)=>{t.set(n,e)})}function _d(e){const t=nd.getText();try{return e(nd),nd.getText()}finally{nd.clear(),nd.writeKeyword(t)}}function ud(e){return e.end-e.pos}function dd(e,t){return e.path===t.path&&!e.prepend==!t.prepend&&!e.circular==!t.circular}function pd(e,t){return e===t||e.resolvedModule===t.resolvedModule||!!e.resolvedModule&&!!t.resolvedModule&&e.resolvedModule.isExternalLibraryImport===t.resolvedModule.isExternalLibraryImport&&e.resolvedModule.extension===t.resolvedModule.extension&&e.resolvedModule.resolvedFileName===t.resolvedModule.resolvedFileName&&e.resolvedModule.originalPath===t.resolvedModule.originalPath&&(n=e.resolvedModule.packageId,r=t.resolvedModule.packageId,n===r||!!n&&!!r&&n.name===r.name&&n.subModuleName===r.subModuleName&&n.version===r.version&&n.peerDependencies===r.peerDependencies)&&e.alternateResult===t.alternateResult;var n,r}function fd(e){return e.resolvedModule}function md(e){return e.resolvedTypeReferenceDirective}function gd(e,t,n,r,i){var o;const a=null==(o=t.getResolvedModule(e,n,r))?void 0:o.alternateResult,s=a&&(2===Ck(t.getCompilerOptions())?[fa.There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler,[a]]:[fa.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,[a,a.includes(oR+"@types/")?`@types/${qR(i)}`:i]]),c=s?ik(void 0,s[0],...s[1]):t.typesPackageExists(i)?ik(void 0,fa.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,i,qR(i)):t.packageBundlesTypes(i)?ik(void 0,fa.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,i,n):ik(void 0,fa.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,n,qR(i));return c&&(c.repopulateInfo=()=>({moduleReference:n,mode:r,packageName:i===n?void 0:i})),c}function hd(e){const t=aT(e.fileName),n=e.packageJsonScope,r=".ts"===t?".mts":".js"===t?".mjs":void 0,i=n&&!n.contents.packageJsonContent.type?r?ik(void 0,fa.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1,r,Jo(n.packageDirectory,"package.json")):ik(void 0,fa.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0,Jo(n.packageDirectory,"package.json")):r?ik(void 0,fa.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module,r):ik(void 0,fa.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module);return i.repopulateInfo=()=>!0,i}function yd({name:e,subModuleName:t}){return t?`${e}/${t}`:e}function vd(e){return`${yd(e)}@${e.version}${e.peerDependencies??""}`}function bd(e,t){return e===t||e.resolvedTypeReferenceDirective===t.resolvedTypeReferenceDirective||!!e.resolvedTypeReferenceDirective&&!!t.resolvedTypeReferenceDirective&&e.resolvedTypeReferenceDirective.resolvedFileName===t.resolvedTypeReferenceDirective.resolvedFileName&&!!e.resolvedTypeReferenceDirective.primary==!!t.resolvedTypeReferenceDirective.primary&&e.resolvedTypeReferenceDirective.originalPath===t.resolvedTypeReferenceDirective.originalPath}function xd(e,t,n,r){pn.assert(e.length===t.length);for(let i=0;i=0),za(t)[e]}function Dd(e){const t=Sd(e),n=Wa(t,e.pos);return`${t.fileName}(${n.line+1},${n.character+1})`}function Fd(e,t){pn.assert(e>=0);const n=za(t),r=e,i=t.text;if(r+1===n.length)return i.length-1;{const e=n[r];let t=n[r+1]-1;for(pn.assert(Ka(i.charCodeAt(t)));e<=t&&Ka(i.charCodeAt(t));)t--;return t}}function Ed(e,t,n){return!(n&&n(t)||e.identifiers.has(t))}function Pd(e){return void 0===e||e.pos===e.end&&e.pos>=0&&1!==e.kind}function Ad(e){return!Pd(e)}function Id(e,t){return DD(e)?t===e.expression:LD(e)?t===e.modifiers:PD(e)?t===e.initializer:AD(e)?t===e.questionToken&&h_(e):cP(e)?t===e.modifiers||t===e.questionToken||t===e.exclamationToken||Od(e.modifiers,t,b_):lP(e)?t===e.equalsToken||t===e.modifiers||t===e.questionToken||t===e.exclamationToken||Od(e.modifiers,t,b_):OD(e)?t===e.exclamationToken:jD(e)?t===e.typeParameters||t===e.type||Od(e.typeParameters,t,DD):MD(e)?t===e.typeParameters||Od(e.typeParameters,t,DD):RD(e)?t===e.typeParameters||t===e.type||Od(e.typeParameters,t,DD):!!TE(e)&&(t===e.modifiers||Od(e.modifiers,t,b_))}function Od(e,t,n){return!(!e||Ze(t)||!n(t))&&C(e,t)}function Ld(e,t,n){if(void 0===t||0===t.length)return e;let r=0;for(;r[`${Wa(e,t.range.end).line}`,t])),r=new Map;return{getUnusedExpectations:function(){return je(n.entries()).filter(([e,t])=>0===t.type&&!r.get(e)).map(([e,t])=>t)},markUsed:function(e){if(!n.has(`${e}`))return!1;return r.set(`${e}`,!0),!0}}}function Wd(e,t,n){if(Pd(e))return e.pos;if(Nu(e)||12===e.kind)return ts((t??Sd(e)).text,e.pos,!1,!0);if(n&&Au(e))return Wd(e.jsDoc[0],t);if(353===e.kind){t??(t=Sd(e));const r=ge(oA(e,t));if(r)return Wd(r,t,n)}return ts((t??Sd(e)).text,e.pos,!1,!1,Mm(e))}function $d(e,t){const n=!Pd(e)&&EI(e)?k(e.modifiers,ED):void 0;return n?ts((t||Sd(e)).text,n.end):Wd(e,t)}function Hd(e,t){const n=!Pd(e)&&EI(e)&&e.modifiers?xe(e.modifiers):void 0;return n?ts((t||Sd(e)).text,n.end):Wd(e,t)}function Kd(e,t,n=!1){return Zd(e.text,t,n)}function Gd(e){return!!(RE(e)&&e.exportClause&&OE(e.exportClause)&&Yd(e.exportClause.name))}function Xd(e){return 11===e.kind?e.text:vc(e.escapedText)}function Qd(e){return 11===e.kind?yc(e.text):e.escapedText}function Yd(e){return"default"===(11===e.kind?e.text:e.escapedText)}function Zd(e,t,n=!1){if(Pd(t))return"";let r=e.substring(n?t.pos:ts(e,t.pos),t.end);return function(e){return!!mc(e,fP)}(t)&&(r=r.split(/\r\n|\n|\r/).map(e=>e.replace(/^\s*\*/,"").trimStart()).join("\n")),r}function ep(e,t=!1){return Kd(Sd(e),e,t)}function tp(e){return e.pos}function np(e,t){return we(e,t,tp,xt)}function rp(e){const t=e.emitNode;return t&&t.flags||0}function ip(e){const t=e.emitNode;return t&&t.internalFlags||0}var op=ft(()=>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","toReversed","toSorted","toSpliced","with"]})),Iterator:new Map(Object.entries({es2015:_})),AsyncIterator:new Map(Object.entries({es2015:_})),ArrayBuffer:new Map(Object.entries({es2024:["maxByteLength","resizable","resize","detached","transfer","transferToFixedLength"]})),Atomics:new Map(Object.entries({es2017:["add","and","compareExchange","exchange","isLockFree","load","or","store","sub","wait","notify","xor"],es2024:["waitAsync"],esnext:["pause"]})),SharedArrayBuffer:new Map(Object.entries({es2017:["byteLength","slice"],es2024:["growable","maxByteLength","grow"]})),AsyncIterable:new Map(Object.entries({es2018:_})),AsyncIterableIterator:new Map(Object.entries({es2018:_})),AsyncGenerator:new Map(Object.entries({es2018:_})),AsyncGeneratorFunction:new Map(Object.entries({es2018:_})),RegExp:new Map(Object.entries({es2015:["flags","sticky","unicode"],es2018:["dotAll"],es2024:["unicodeSets"]})),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"],esnext:["fromAsync"]})),ObjectConstructor:new Map(Object.entries({es2015:["assign","getOwnPropertySymbols","keys","is","setPrototypeOf"],es2017:["values","entries","getOwnPropertyDescriptors"],es2019:["fromEntries"],es2022:["hasOwn"],es2024:["groupBy"]})),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"],esnext:["f16round"]})),Map:new Map(Object.entries({es2015:["entries","keys","values"]})),MapConstructor:new Map(Object.entries({es2024:["groupBy"]})),Set:new Map(Object.entries({es2015:["entries","keys","values"],esnext:["union","intersection","difference","symmetricDifference","isSubsetOf","isSupersetOf","isDisjointFrom"]})),PromiseConstructor:new Map(Object.entries({es2015:["all","race","reject","resolve"],es2020:["allSettled"],es2021:["any"],es2024:["withResolvers"]})),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"],es2024:["isWellFormed","toWellFormed"]})),StringConstructor:new Map(Object.entries({es2015:["fromCodePoint","raw"]})),DateTimeFormat:new Map(Object.entries({es2017:["formatToParts"]})),Promise:new Map(Object.entries({es2015:_,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"],esnext:["metadata","dispose","asyncDispose"]})),DataView:new Map(Object.entries({es2020:["setBigInt64","setBigUint64","getBigInt64","getBigUint64"],esnext:["setFloat16","getFloat16"]})),BigInt:new Map(Object.entries({es2020:_})),RelativeTimeFormat:new Map(Object.entries({es2020:["format","formatToParts","resolvedOptions"]})),Int8Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint8Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint8ClampedArray:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Int16Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint16Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Int32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Float16Array:new Map(Object.entries({esnext:_})),Float32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Float64Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),BigInt64Array:new Map(Object.entries({es2020:_,es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),BigUint64Array:new Map(Object.entries({es2020:_,es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Error:new Map(Object.entries({es2022:["cause"]}))}))),ap=(e=>(e[e.None=0]="None",e[e.NeverAsciiEscape=1]="NeverAsciiEscape",e[e.JsxAttributeEscape=2]="JsxAttributeEscape",e[e.TerminateUnterminatedLiterals=4]="TerminateUnterminatedLiterals",e[e.AllowNumericSeparator=8]="AllowNumericSeparator",e))(ap||{});function sp(e,t,n){if(t&&function(e,t){if(iy(e)||!e.parent||4&t&&e.isUnterminated)return!1;if($N(e)){if(26656&e.numericLiteralFlags)return!1;if(512&e.numericLiteralFlags)return!!(8&t)}return!HN(e)}(e,n))return Kd(t,e);switch(e.kind){case 11:{const t=2&n?Ay:1&n||16777216&rp(e)?Cy:Ny;return e.singleQuote?"'"+t(e.text,39)+"'":'"'+t(e.text,34)+'"'}case 15:case 16:case 17:case 18:{const t=1&n||16777216&rp(e)?Cy:Ny,r=e.rawText??gy(t(e.text,96));switch(e.kind){case 15:return"`"+r+"`";case 16:return"`"+r+"${";case 17:return"}"+r+"${";case 18:return"}"+r+"`"}break}case 9:case 10:return e.text;case 14:return 4&n&&e.isUnterminated?e.text+(92===e.text.charCodeAt(e.text.length-1)?" /":"/"):e.text}return pn.fail(`Literal kind '${e.kind}' not accounted for.`)}function cp(e){return tt(e)?`"${Cy(e)}"`:""+e}function lp(e){return Io(e).replace(/^(\d)/,"_$1").replace(/\W/g,"_")}function _p(e){return!!(7&_c(e))||up(e)}function up(e){const t=ny(e);return 261===t.kind&&300===t.parent.kind}function dp(e){return xE(e)&&(11===e.name.kind||hp(e))}function pp(e){return xE(e)&&11===e.name.kind}function fp(e){return xE(e)&&KN(e.name)}function mp(e){return!!(t=e.valueDeclaration)&&268===t.kind&&!t.body;var t}function gp(e){return 308===e.kind||268===e.kind||c_(e)}function hp(e){return!!(2048&e.flags)}function yp(e){return dp(e)&&vp(e)}function vp(e){switch(e.parent.kind){case 308:return uO(e.parent);case 269:return dp(e.parent.parent)&&dP(e.parent.parent.parent)&&!uO(e.parent.parent.parent)}return!1}function bp(e){var t;return null==(t=e.declarations)?void 0:t.find(e=>!(yp(e)||xE(e)&&hp(e)))}function xp(e,t){return uO(e)||(1===(n=Tk(t))||100<=n&&n<=199)&&!!e.commonJsModuleIndicator;var n}function kp(e,t){switch(e.scriptKind){case 1:case 3:case 2:case 4:break;default:return!1}return!e.isDeclarationFile&&(!!Wk(t,"alwaysStrict")||(!!wA(e.statements)||!(!uO(e)&&!Nk(t))))}function Sp(e){return!!(33554432&e.flags)||Av(e,128)}function Tp(e,t){switch(e.kind){case 308:case 270:case 300:case 268:case 249:case 250:case 251:case 177:case 175:case 178:case 179:case 263:case 219:case 220:case 173:case 176:return!0;case 242:return!c_(t)}return!1}function Cp(e){switch(pn.type(e),e.kind){case 339:case 347:case 324:return!0;default:return wp(e)}}function wp(e){switch(pn.type(e),e.kind){case 180:case 181:case 174:case 182:case 185:case 186:case 318:case 264:case 232:case 265:case 266:case 346:case 263:case 175:case 177:case 178:case 179:case 219:case 220:return!0;default:return!1}}function Np(e){switch(e.kind){case 273:case 272:return!0;default:return!1}}function Dp(e){return Np(e)||zm(e)}function Fp(e){return Np(e)||Vm(e)}function Ep(e){switch(e.kind){case 273:case 272:case 244:case 264:case 263:case 268:case 266:case 265:case 267:return!0;default:return!1}}function Pp(e){return Ap(e)||xE(e)||lF(e)||ff(e)}function Ap(e){return Np(e)||RE(e)}function Ip(e){return mc(e.parent,e=>!!(1&_B(e)))}function Op(e){return mc(e.parent,e=>Tp(e,e.parent))}function Lp(e,t){let n=Op(e);for(;n;)t(n),n=Op(n)}function jp(e){return e&&0!==ud(e)?ep(e):"(Missing)"}function Mp(e){return e.declaration?jp(e.declaration.parameters[0].name):void 0}function Rp(e){return 168===e.kind&&!Jh(e.expression)}function Bp(e){var t;switch(e.kind){case 80:case 81:return(null==(t=e.emitNode)?void 0:t.autoGenerate)?void 0:e.escapedText;case 11:case 9:case 10:case 15:return yc(e.text);case 168:return Jh(e.expression)?yc(e.expression.text):void 0;case 296:return lC(e);default:return pn.assertNever(e)}}function Jp(e){return pn.checkDefined(Bp(e))}function zp(e){switch(e.kind){case 110:return"this";case 81:case 80:return 0===ud(e)?bc(e):ep(e);case 167:return zp(e.left)+"."+zp(e.right);case 212:return uD(e.name)||dD(e.name)?zp(e.expression)+"."+zp(e.name):pn.assertNever(e.name);case 312:return zp(e.left)+"#"+zp(e.right);case 296:return zp(e.namespace)+":"+zp(e.name);default:return pn.assertNever(e)}}function qp(e,t,...n){return Vp(Sd(e),e,t,...n)}function Up(e,t,n,...r){const i=ts(e.text,t.pos);return ek(e,i,t.end-i,n,...r)}function Vp(e,t,n,...r){const i=tf(e,t);return ek(e,i.start,i.length,n,...r)}function Wp(e,t,n,r){const i=tf(e,t);return Kp(e,i.start,i.length,n,r)}function $p(e,t,n,r){const i=ts(e.text,t.pos);return Kp(e,i,t.end-i,n,r)}function Hp(e,t,n){pn.assertGreaterThanOrEqual(t,0),pn.assertGreaterThanOrEqual(n,0),pn.assertLessThanOrEqual(t,e.length),pn.assertLessThanOrEqual(t+n,e.length)}function Kp(e,t,n,r,i){return Hp(e.text,t,n),{file:e,start:t,length:n,code:r.code,category:r.category,messageText:r.next?r:r.messageText,relatedInformation:i,canonicalHead:r.canonicalHead}}function Gp(e,t,n){return{file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:n}}function Xp(e){return"string"==typeof e.messageText?{code:e.code,category:e.category,messageText:e.messageText,next:e.next}:e.messageText}function Qp(e,t,n){return{file:e,start:t.pos,length:t.end-t.pos,code:n.code,category:n.category,messageText:n.message}}function Yp(e,...t){return{code:e.code,messageText:tk(e,...t)}}function Zp(e,t){const n=bs(e.languageVersion,!0,e.languageVariant,e.text,void 0,t);n.scan();return Xs(n.getTokenStart(),n.getTokenEnd())}function ef(e,t){const n=bs(e.languageVersion,!0,e.languageVariant,e.text,void 0,t);return n.scan(),n.getToken()}function tf(e,t){let n=t;switch(t.kind){case 308:{const t=ts(e.text,0,!1);return t===e.text.length?Gs(0,0):Zp(e,t)}case 261:case 209:case 264:case 232:case 265:case 268:case 267:case 307:case 263:case 219:case 175:case 178:case 179:case 266:case 173:case 172:case 275:n=t.name;break;case 220:return function(e,t){const n=ts(e.text,t.pos);if(t.body&&242===t.body.kind){const{line:r}=Wa(e,t.body.pos),{line:i}=Wa(e,t.body.end);if(r0?t.statements[0].pos:t.end);case 254:case 230:return Zp(e,ts(e.text,t.pos));case 239:return Zp(e,ts(e.text,t.expression.end));case 351:return Zp(e,ts(e.text,t.tagName.pos));case 177:{const n=t,r=ts(e.text,n.pos),i=bs(e.languageVersion,!0,e.languageVariant,e.text,void 0,r);let o=i.scan();for(;137!==o&&1!==o;)o=i.scan();return Xs(r,i.getTokenEnd())}}if(void 0===n)return Zp(e,t.pos);pn.assert(!DP(n));const r=Pd(n),i=r||GN(t)?n.pos:ts(e.text,n.pos);return r?(pn.assert(i===n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),pn.assert(i===n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")):(pn.assert(i>=n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),pn.assert(i<=n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")),Xs(i,n.end)}function nf(e){return 308===e.kind&&!rf(e)}function rf(e){return void 0!==(e.externalModuleIndicator||e.commonJsModuleIndicator)}function of(e){return 6===e.scriptKind}function af(e){return!!(4096&cc(e))}function sf(e){return!(!(8&cc(e))||rc(e,e.parent))}function cf(e){return 6==(7&_c(e))}function lf(e){return 4==(7&_c(e))}function _f(e){return 2==(7&_c(e))}function uf(e){const t=7&_c(e);return 2===t||4===t||6===t}function df(e){return 1==(7&_c(e))}function pf(e){return 214===e.kind&&108===e.expression.kind}function ff(e){if(214!==e.kind)return!1;const t=e.expression;return 102===t.kind||UF(t)&&102===t.keywordToken&&"defer"===t.name.escapedText}function mf(e){return UF(e)&&102===e.keywordToken&&"meta"===e.name.escapedText}function gf(e){return lF(e)&&cF(e.argument)&&KN(e.argument.literal)}function hf(e){return 245===e.kind&&11===e.expression.kind}function yf(e){return!!(2097152&rp(e))}function vf(e){return yf(e)&&gE(e)}function bf(e){return uD(e.name)&&!e.initializer}function xf(e){return yf(e)&&XF(e)&&b(e.declarationList.declarations,bf)}function kf(e,t){return 12!==e.kind?fs(t.text,e.pos):void 0}function Sf(e,t){return D(170===e.kind||169===e.kind||219===e.kind||220===e.kind||218===e.kind||261===e.kind||282===e.kind?G(ms(t,e.pos),fs(t,e.pos)):fs(t,e.pos),n=>n.end<=e.end&&42===t.charCodeAt(n.pos+1)&&42===t.charCodeAt(n.pos+2)&&47!==t.charCodeAt(n.pos+3))}var Tf=/^\/\/\/\s*/,Cf=/^\/\/\/\s*/,wf=/^\/\/\/\s*/,Nf=/^\/\/\/\s*/,Df=/^\/\/\/\s*/,Ff=/^\/\/\/\s*/;function Ef(e){if(183<=e.kind&&e.kind<=206)return!0;switch(e.kind){case 133:case 159:case 150:case 163:case 154:case 136:case 155:case 151:case 157:case 106:case 146:return!0;case 116:return 223!==e.parent.kind;case 234:return Pf(e);case 169:return 201===e.parent.kind||196===e.parent.kind;case 80:(167===e.parent.kind&&e.parent.right===e||212===e.parent.kind&&e.parent.name===e)&&(e=e.parent),pn.assert(80===e.kind||167===e.kind||212===e.kind,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 167:case 212:case 110:{const{parent:t}=e;if(187===t.kind)return!1;if(206===t.kind)return!t.isTypeOf;if(183<=t.kind&&t.kind<=206)return!0;switch(t.kind){case 234:return Pf(t);case 169:case 346:return e===t.constraint;case 173:case 172:case 170:case 261:case 263:case 219:case 220:case 177:case 175:case 174:case 178:case 179:case 180:case 181:case 182:case 217:return e===t.type;case 214:case 215:case 216:return C(t.typeArguments,e)}}}return!1}function Pf(e){return YP(e.parent)||PP(e.parent)||aP(e.parent)&&!_b(e)}function Af(e,t){return function e(n){switch(n.kind){case 254:return t(n);case 270:case 242:case 246:case 247:case 248:case 249:case 250:case 251:case 255:case 256:case 297:case 298:case 257:case 259:case 300:return iO(n,e)}}(e)}function If(e,t){return function e(n){switch(n.kind){case 230:t(n);const r=n.expression;return void(r&&e(r));case 267:case 265:case 268:case 266:return;default:if(s_(n)){if(n.name&&168===n.name.kind)return void e(n.name.expression)}else Ef(n)||iO(n,e)}}(e)}function Of(e){return e&&189===e.kind?e.elementType:e&&184===e.kind?ke(e.typeArguments):void 0}function Lf(e){switch(e.kind){case 265:case 264:case 232:case 188:return e.members;case 211:return e.properties}}function jf(e){if(e)switch(e.kind){case 209:case 307:case 170:case 304:case 173:case 172:case 305:case 261:return!0}return!1}function Mf(e){return 262===e.parent.kind&&244===e.parent.parent.kind}function Rf(e){return!!Om(e)&&(gF(e.parent)&&AF(e.parent.parent)&&2===og(e.parent.parent)||Bf(e.parent))}function Bf(e){return!!Om(e)&&(AF(e)&&1===og(e))}function Jf(e){return(fE(e)?_f(e)&&uD(e.name)&&Mf(e):AD(e)?Bv(e)&&Ov(e):PD(e)&&Bv(e))||Bf(e)}function zf(e){switch(e.kind){case 175:case 174:case 177:case 178:case 179:case 263:case 219:return!0}return!1}function qf(e,t){for(;;){if(t&&t(e),257!==e.statement.kind)return e.statement;e=e.statement}}function Uf(e){return e&&242===e.kind&&s_(e.parent)}function Vf(e){return e&&175===e.kind&&211===e.parent.kind}function Wf(e){return!(175!==e.kind&&178!==e.kind&&179!==e.kind||211!==e.parent.kind&&232!==e.parent.kind)}function $f(e){return e&&1===e.kind}function Hf(e){return e&&0===e.kind}function Kf(e,t,n,r){return p(null==e?void 0:e.properties,e=>{if(!cP(e))return;const i=Bp(e.name);return t===i||r&&r===i?n(e):void 0})}function Gf(e){if(e&&e.statements.length){return rt(e.statements[0].expression,gF)}}function Xf(e,t,n){return Qf(e,t,e=>mF(e.initializer)?x(e.initializer.elements,e=>KN(e)&&e.text===n):void 0)}function Qf(e,t,n){return Kf(Gf(e),t,n)}function Yf(e){return mc(e.parent,s_)}function Zf(e){return mc(e.parent,l_)}function em(e){return mc(e.parent,m_)}function tm(e){return mc(e.parent,e=>m_(e)||s_(e)?"quit":LD(e))}function nm(e){return mc(e.parent,c_)}function rm(e){const t=mc(e.parent,e=>m_(e)?"quit":ED(e));return t&&m_(t.parent)?em(t.parent):em(t??e)}function im(e,t,n){for(pn.assert(308!==e.kind);;){if(!(e=e.parent))return pn.fail();switch(e.kind){case 168:if(n&&m_(e.parent.parent))return e;e=e.parent.parent;break;case 171:170===e.parent.kind&&f_(e.parent.parent)?e=e.parent.parent:f_(e.parent)&&(e=e.parent);break;case 220:if(!t)continue;case 263:case 219:case 268:case 176:case 173:case 172:case 175:case 174:case 177:case 178:case 179:case 180:case 181:case 182:case 267:case 308:return e}}}function om(e){switch(e.kind){case 220:case 263:case 219:case 173:return!0;case 242:switch(e.parent.kind){case 177:case 175:case 178:case 179:return!0;default:return!1}default:return!1}}function am(e){uD(e)&&(hE(e.parent)||gE(e.parent))&&e.parent.name===e&&(e=e.parent);return dP(im(e,!0,!1))}function sm(e){const t=im(e,!1,!1);if(t)switch(t.kind){case 177:case 263:case 219:return t}}function cm(e,t){for(;;){if(!(e=e.parent))return;switch(e.kind){case 168:e=e.parent;break;case 263:case 219:case 220:if(!t)continue;case 173:case 172:case 175:case 174:case 177:case 178:case 179:case 176:return e;case 171:170===e.parent.kind&&f_(e.parent.parent)?e=e.parent.parent:f_(e.parent)&&(e=e.parent)}}}function lm(e){if(219===e.kind||220===e.kind){let t=e,n=e.parent;for(;218===n.kind;)t=n,n=n.parent;if(214===n.kind&&n.expression===t)return n}}function _m(e){const t=e.kind;return(212===t||213===t)&&108===e.expression.kind}function um(e){const t=e.kind;return(212===t||213===t)&&110===e.expression.kind}function dm(e){var t;return!!e&&fE(e)&&110===(null==(t=e.initializer)?void 0:t.kind)}function pm(e){return!!e&&(lP(e)||cP(e))&&AF(e.parent.parent)&&64===e.parent.parent.operatorToken.kind&&110===e.parent.parent.right.kind}function fm(e){switch(e.kind){case 184:return e.typeName;case 234:return ub(e.expression)?e.expression:void 0;case 80:case 167:return e}}function mm(e){switch(e.kind){case 216:return e.tag;case 287:case 286:return e.tagName;case 227:return e.right;case 290:return e;default:return e.expression}}function gm(e,t,n,r){if(e&&Nc(t)&&dD(t.name))return!1;switch(t.kind){case 264:return!0;case 232:return!e;case 173:return void 0!==n&&(e?hE(n):m_(n)&&!jv(t)&&!Mv(t));case 178:case 179:case 175:return void 0!==t.body&&void 0!==n&&(e?hE(n):m_(n));case 170:return!!e&&(void 0!==n&&void 0!==n.body&&(177===n.kind||175===n.kind||179===n.kind)&&uv(n)!==t&&void 0!==r&&264===r.kind)}return!1}function hm(e,t,n,r){return Jv(t)&&gm(e,t,n,r)}function ym(e,t,n,r){return hm(e,t,n,r)||vm(e,t,n)}function vm(e,t,n){switch(t.kind){case 264:return H(t.members,r=>ym(e,r,t,n));case 232:return!e&&H(t.members,r=>ym(e,r,t,n));case 175:case 179:case 177:return H(t.parameters,r=>hm(e,r,t,n));default:return!1}}function bm(e,t){if(hm(e,t))return!0;const n=cv(t);return!!n&&vm(e,n,t)}function xm(e,t,n){let r;if(g_(t)){const{firstAccessor:e,secondAccessor:i,setAccessor:o}=hv(n.members,t),a=Jv(e)?e:i&&Jv(i)?i:void 0;if(!a||t!==a)return!1;r=null==o?void 0:o.parameters}else OD(t)&&(r=t.parameters);if(hm(e,t,n))return!0;if(r)for(const i of r)if(!dv(i)&&hm(e,i,t,n))return!0;return!1}function km(e){if(e.textSourceNode){switch(e.textSourceNode.kind){case 11:return km(e.textSourceNode);case 15:return""===e.text}return!1}return""===e.text}function Sm(e){const{parent:t}=e;return(287===t.kind||286===t.kind||288===t.kind)&&t.tagName===e}function Tm(e){switch(e.kind){case 108:case 106:case 112:case 97:case 14:case 210:case 211:case 212:case 213:case 214:case 215:case 216:case 235:case 217:case 239:case 236:case 218:case 219:case 232:case 220:case 223:case 221:case 222:case 225:case 226:case 227:case 228:case 231:case 229:case 233:case 285:case 286:case 289:case 230:case 224:return!0;case 237:return!ff(e.parent)||e.parent.expression!==e;case 234:return!aP(e.parent)&&!PP(e.parent);case 167:for(;167===e.parent.kind;)e=e.parent;return 187===e.parent.kind||zu(e.parent)||mP(e.parent)||gP(e.parent)||Sm(e);case 312:for(;gP(e.parent);)e=e.parent;return 187===e.parent.kind||zu(e.parent)||mP(e.parent)||gP(e.parent)||Sm(e);case 81:return AF(e.parent)&&e.parent.left===e&&103===e.parent.operatorToken.kind;case 80:if(187===e.parent.kind||zu(e.parent)||mP(e.parent)||gP(e.parent)||Sm(e))return!0;case 9:case 10:case 11:case 15:case 110:return Cm(e);default:return!1}}function Cm(e){const{parent:t}=e;switch(t.kind){case 261:case 170:case 173:case 172:case 307:case 304:case 209:return t.initializer===e;case 245:case 246:case 247:case 248:case 254:case 255:case 256:case 297:case 258:return t.expression===e;case 249:const n=t;return n.initializer===e&&262!==n.initializer.kind||n.condition===e||n.incrementor===e;case 250:case 251:const r=t;return r.initializer===e&&262!==r.initializer.kind||r.expression===e;case 217:case 235:case 240:case 168:case 239:return e===t.expression;case 171:case 295:case 294:case 306:return!0;case 234:return t.expression===e&&!Ef(t);case 305:return t.objectAssignmentInitializer===e;default:return Tm(t)}}function wm(e){for(;167===e.kind||80===e.kind;)e=e.parent;return 187===e.kind}function Nm(e){return OE(e)&&!!e.parent.moduleSpecifier}function Dm(e){return 272===e.kind&&284===e.moduleReference.kind}function Fm(e){return pn.assert(Dm(e)),e.moduleReference.expression}function Em(e){return zm(e)&&Px(e.initializer).arguments[0]}function Pm(e){return 272===e.kind&&284!==e.moduleReference.kind}function Am(e){return 308===(null==e?void 0:e.kind)}function Im(e){return Om(e)}function Om(e){return!!e&&!!(524288&e.flags)}function Lm(e){return!!e&&!!(134217728&e.flags)}function jm(e){return!of(e)}function Mm(e){return!!e&&!!(16777216&e.flags)}function Rm(e){return UD(e)&&uD(e.typeName)&&"Object"===e.typeName.escapedText&&e.typeArguments&&2===e.typeArguments.length&&(154===e.typeArguments[0].kind||150===e.typeArguments[0].kind)}function Bm(e,t){if(214!==e.kind)return!1;const{expression:n,arguments:r}=e;if(80!==n.kind||"require"!==n.escapedText)return!1;if(1!==r.length)return!1;const i=r[0];return!t||Ju(i)}function Jm(e){return Um(e,!1)}function zm(e){return Um(e,!0)}function qm(e){return fF(e)&&zm(e.parent.parent)}function Um(e,t){return fE(e)&&!!e.initializer&&Bm(t?Px(e.initializer):e.initializer,!0)}function Vm(e){return XF(e)&&e.declarationList.declarations.length>0&&b(e.declarationList.declarations,e=>Jm(e))}function Wm(e){return 39===e||34===e}function $m(e,t){return 34===Kd(t,e).charCodeAt(0)}function Hm(e){return AF(e)||Dx(e)||uD(e)||vF(e)}function Km(e){return Om(e)&&e.initializer&&AF(e.initializer)&&(57===e.initializer.operatorToken.kind||61===e.initializer.operatorToken.kind)&&e.name&&ub(e.name)&&eg(e.name,e.initializer.left)?e.initializer.right:e.initializer}function Gm(e){const t=Km(e);return t&&Qm(t,gb(e.name))}function Xm(e){if(e&&e.parent&&AF(e.parent)&&64===e.parent.operatorToken.kind){const t=gb(e.parent.left);return Qm(e.parent.right,t)||function(e,t,n){const r=AF(t)&&(57===t.operatorToken.kind||61===t.operatorToken.kind)&&Qm(t.right,n);if(r&&eg(e,t.left))return r}(e.parent.left,e.parent.right,t)}if(e&&vF(e)&&ag(e)){const t=function(e,t){return p(e.properties,e=>cP(e)&&uD(e.name)&&"value"===e.name.escapedText&&e.initializer&&Qm(e.initializer,t))}(e.arguments[2],"prototype"===e.arguments[1].text);if(t)return t}}function Qm(e,t){if(vF(e)){const t=_h(e.expression);return 219===t.kind||220===t.kind?e:void 0}return 219===e.kind||232===e.kind||220===e.kind||gF(e)&&(0===e.properties.length||t)?e:void 0}function Ym(e){const t=fE(e.parent)?e.parent.name:AF(e.parent)&&64===e.parent.operatorToken.kind?e.parent.left:void 0;return t&&Qm(e.right,gb(t))&&ub(t)&&eg(t,e.left)}function Zm(e){if(AF(e.parent)){const t=57!==e.parent.operatorToken.kind&&61!==e.parent.operatorToken.kind||!AF(e.parent.parent)?e.parent:e.parent.parent;if(64===t.operatorToken.kind&&uD(t.left))return t.left}else if(fE(e.parent))return e.parent.name}function eg(e,t){return Wh(e)&&Wh(t)?$h(e)===$h(t):gl(e)&&sg(t)&&(110===t.expression.kind||uD(t.expression)&&("window"===t.expression.escapedText||"self"===t.expression.escapedText||"global"===t.expression.escapedText))?eg(e,dg(t)):!(!sg(e)||!sg(t))&&(fg(e)===fg(t)&&eg(e.expression,t.expression))}function tg(e){for(;cb(e,!0);)e=e.right;return e}function ng(e){return uD(e)&&"exports"===e.escapedText}function rg(e){return uD(e)&&"module"===e.escapedText}function ig(e){return(hF(e)||cg(e))&&rg(e.expression)&&"exports"===fg(e)}function og(e){const t=function(e){if(vF(e)){if(!ag(e))return 0;const t=e.arguments[0];return ng(t)||ig(t)?8:lg(t)&&"prototype"===fg(t)?9:7}if(64!==e.operatorToken.kind||!Dx(e.left)||(t=tg(e),DF(t)&&$N(t.expression)&&"0"===t.expression.text))return 0;var t;if(ug(e.left.expression,!0)&&"prototype"===fg(e.left)&&gF(gg(e)))return 6;return mg(e.left)}(e);return 5===t||Om(e)?t:0}function ag(e){return 3===d(e.arguments)&&hF(e.expression)&&uD(e.expression.expression)&&"Object"===bc(e.expression.expression)&&"defineProperty"===bc(e.expression.name)&&Jh(e.arguments[1])&&ug(e.arguments[0],!0)}function sg(e){return hF(e)||cg(e)}function cg(e){return yF(e)&&Jh(e.argumentExpression)}function lg(e,t){return hF(e)&&(!t&&110===e.expression.kind||uD(e.name)&&ug(e.expression,!0))||_g(e,t)}function _g(e,t){return cg(e)&&(!t&&110===e.expression.kind||ub(e.expression)||lg(e.expression,!0))}function ug(e,t){return ub(e)||lg(e,t)}function dg(e){return hF(e)?e.name:e.argumentExpression}function pg(e){if(hF(e))return e.name;const t=_h(e.argumentExpression);return $N(t)||Ju(t)?t:e}function fg(e){const t=pg(e);if(t){if(uD(t))return t.escapedText;if(Ju(t)||$N(t))return yc(t.text)}}function mg(e){if(110===e.expression.kind)return 4;if(ig(e))return 2;if(ug(e.expression,!0)){if(gb(e.expression))return 3;let t=e;for(;!uD(t.expression);)t=t.expression;const n=t.expression;if(("exports"===n.escapedText||"module"===n.escapedText&&"exports"===fg(t))&&lg(e))return 1;if(ug(e,!0)||yF(e)&&Uh(e))return 5}return 0}function gg(e){for(;AF(e.right);)e=e.right;return e.right}function hg(e){return AF(e)&&3===og(e)}function yg(e){return Om(e)&&e.parent&&245===e.parent.kind&&(!yF(e)||cg(e))&&!!ol(e.parent)}function vg(e,t){const{valueDeclaration:n}=e;(!n||(!(33554432&t.flags)||Om(t)||33554432&n.flags)&&Hm(n)&&!Hm(t)||n.kind!==t.kind&&function(e){return xE(e)||uD(e)}(n))&&(e.valueDeclaration=t)}function bg(e){if(!e||!e.valueDeclaration)return!1;const t=e.valueDeclaration;return 263===t.kind||fE(t)&&t.initializer&&s_(t.initializer)}function xg(e){switch(null==e?void 0:e.kind){case 261:case 209:case 273:case 279:case 272:case 274:case 281:case 275:case 282:case 277:case 206:return!0}return!1}function kg(e){var t,n;switch(e.kind){case 261:case 209:return null==(t=mc(e.initializer,e=>Bm(e,!0)))?void 0:t.arguments[0];case 273:case 279:case 352:return rt(e.moduleSpecifier,Ju);case 272:return rt(null==(n=rt(e.moduleReference,WE))?void 0:n.expression,Ju);case 274:case 281:return rt(e.parent.moduleSpecifier,Ju);case 275:case 282:return rt(e.parent.parent.moduleSpecifier,Ju);case 277:return rt(e.parent.parent.parent.moduleSpecifier,Ju);case 206:return gf(e)?e.argument.literal:void 0;default:pn.assertNever(e)}}function Sg(e){return Tg(e)||pn.failBadSyntaxKind(e.parent)}function Tg(e){switch(e.parent.kind){case 273:case 279:case 352:return e.parent;case 284:return e.parent.parent;case 214:return ff(e.parent)||Bm(e.parent,!1)?e.parent:void 0;case 202:if(!KN(e))break;return rt(e.parent.parent,lF);default:return}}function Cg(e,t){return!!t.rewriteRelativeImportExtensions&&So(e)&&!vO(e)&&JS(e)}function wg(e){switch(e.kind){case 273:case 279:case 352:return e.moduleSpecifier;case 272:return 284===e.moduleReference.kind?e.moduleReference.expression:void 0;case 206:return gf(e)?e.argument.literal:void 0;case 214:return e.arguments[0];case 268:return 11===e.name.kind?e.name:void 0;default:return pn.assertNever(e)}}function Ng(e){switch(e.kind){case 273:return e.importClause&&rt(e.importClause.namedBindings,IE);case 272:return e;case 279:return e.exportClause&&rt(e.exportClause,OE);default:return pn.assertNever(e)}}function Dg(e){return!(273!==e.kind&&352!==e.kind||!e.importClause||!e.importClause.name)}function Fg(e,t){if(e.name){const n=t(e);if(n)return n}if(e.namedBindings){const n=IE(e.namedBindings)?t(e.namedBindings):p(e.namedBindings.elements,t);if(n)return n}}function Eg(e){switch(e.kind){case 170:case 175:case 174:case 305:case 304:case 173:case 172:return void 0!==e.questionToken}return!1}function Pg(e){const t=CP(e)?ge(e.parameters):void 0,n=rt(t&&t.name,uD);return!!n&&"new"===n.escapedText}function Ag(e){return 347===e.kind||339===e.kind||341===e.kind}function Ig(e){return Ag(e)||vE(e)}function Og(e){return YF(e)&&AF(e.expression)&&0!==og(e.expression)&&AF(e.expression.right)&&(57===e.expression.right.operatorToken.kind||61===e.expression.right.operatorToken.kind)?e.expression.right.right:void 0}function Lg(e){switch(e.kind){case 244:const t=jg(e);return t&&t.initializer;case 173:case 304:return e.initializer}}function jg(e){return XF(e)?ge(e.declarationList.declarations):void 0}function Mg(e){return xE(e)&&e.body&&268===e.body.kind?e.body:void 0}function Rg(e){if(e.kind>=244&&e.kind<=260)return!0;switch(e.kind){case 80:case 110:case 108:case 167:case 237:case 213:case 212:case 209:case 219:case 220:case 175:case 178:case 179:return!0;default:return!1}}function Bg(e){switch(e.kind){case 220:case 227:case 242:case 253:case 180:case 297:case 264:case 232:case 176:case 177:case 186:case 181:case 252:case 260:case 247:case 213:case 243:case 1:case 267:case 307:case 278:case 279:case 282:case 245:case 250:case 251:case 249:case 263:case 219:case 185:case 178:case 80:case 246:case 273:case 272:case 182:case 265:case 318:case 324:case 257:case 175:case 174:case 268:case 203:case 271:case 211:case 170:case 218:case 212:case 304:case 173:case 172:case 254:case 241:case 179:case 305:case 306:case 256:case 258:case 259:case 266:case 169:case 261:case 244:case 248:case 255:return!0;default:return!1}}function Jg(e,t){let n;jf(e)&&Ou(e)&&Au(e.initializer)&&(n=le(n,zg(e,e.initializer.jsDoc)));let r=e;for(;r&&r.parent;){if(Au(r)&&(n=le(n,zg(e,r.jsDoc))),170===r.kind){n=le(n,(t?Lc:Oc)(r));break}if(169===r.kind){n=le(n,(t?Rc:Mc)(r));break}r=qg(r)}return n||_}function zg(e,t){const n=xe(t);return L(t,t=>{if(t===n){const n=D(t.tags,t=>function(e,t){return!((HP(t)||ZP(t))&&t.parent&&DP(t.parent)&&SF(t.parent.parent)&&t.parent.parent!==e)}(e,t));return t.tags===n?[t]:n}return D(t.tags,JP)})}function qg(e){const t=e.parent;return 304===t.kind||278===t.kind||173===t.kind||245===t.kind&&212===e.kind||254===t.kind||Mg(t)||cb(e)?t:t.parent&&(jg(t.parent)===e||cb(t))?t.parent:t.parent&&t.parent.parent&&(jg(t.parent.parent)||Lg(t.parent.parent)===e||Og(t.parent.parent))?t.parent.parent:void 0}function Ug(e){if(e.symbol)return e.symbol;if(!uD(e.name))return;const t=e.name.escapedText,n=$g(e);if(!n)return;const r=x(n.parameters,e=>80===e.name.kind&&e.name.escapedText===t);return r&&r.symbol}function Vg(e){if(DP(e.parent)&&e.parent.tags){const t=x(e.parent.tags,Ag);if(t)return t}return $g(e)}function Wg(e){return ul(e,JP)}function $g(e){const t=Hg(e);if(t)return PD(t)&&t.type&&s_(t.type)?t.type:s_(t)?t:void 0}function Hg(e){const t=Kg(e);if(t)return Og(t)||function(e){return YF(e)&&AF(e.expression)&&64===e.expression.operatorToken.kind?tg(e.expression):void 0}(t)||Lg(t)||jg(t)||Mg(t)||t}function Kg(e){const t=Gg(e);if(!t)return;const n=t.parent;return n&&n.jsDoc&&t===be(n.jsDoc)?n:void 0}function Gg(e){return mc(e.parent,DP)}function Xg(e){const t=e.name.escapedText,{typeParameters:n}=e.parent.parent.parent;return n&&x(n,e=>e.name.escapedText===t)}function Qg(e){return!!e.typeArguments}var Yg=(e=>(e[e.None=0]="None",e[e.Definite=1]="Definite",e[e.Compound=2]="Compound",e))(Yg||{});function Zg(e){let t=e.parent;for(;;){switch(t.kind){case 227:const n=t;return ob(n.operatorToken.kind)&&n.left===e?n:void 0;case 225:case 226:const r=t,i=r.operator;return 46===i||47===i?r:void 0;case 250:case 251:const o=t;return o.initializer===e?o:void 0;case 218:case 210:case 231:case 236:e=t;break;case 306:e=t.parent;break;case 305:if(t.name!==e)return;e=t.parent;break;case 304:if(t.name===e)return;e=t.parent;break;default:return}t=e.parent}}function eh(e){const t=Zg(e);if(!t)return 0;switch(t.kind){case 227:const e=t.operatorToken.kind;return 64===e||tb(e)?1:2;case 225:case 226:return 2;case 250:case 251:return 1}}function th(e){return!!Zg(e)}function nh(e){const t=Zg(e);return!!t&&cb(t,!0)&&function(e){const t=_h(e.right);return 227===t.kind&&iI(t.operatorToken.kind)}(t)}function rh(e){switch(e.kind){case 242:case 244:case 255:case 246:case 256:case 270:case 297:case 298:case 257:case 249:case 250:case 251:case 247:case 248:case 259:case 300:return!0}return!1}function ih(e){return TF(e)||CF(e)||v_(e)||gE(e)||jD(e)}function oh(e,t){for(;e&&e.kind===t;)e=e.parent;return e}function ah(e){return oh(e,197)}function sh(e){return oh(e,218)}function ch(e){let t;for(;e&&197===e.kind;)t=e,e=e.parent;return[t,e]}function lh(e){for(;rF(e);)e=e.type;return e}function _h(e,t){return AA(e,t?-2147483647:1)}function uh(e){return(212===e.kind||213===e.kind)&&((e=sh(e.parent))&&221===e.kind)}function dh(e,t){for(;e;){if(e===t)return!0;e=e.parent}return!1}function ph(e){return!dP(e)&&!w_(e)&&fu(e.parent)&&e.parent.name===e}function fh(e){const t=e.parent;switch(e.kind){case 11:case 15:case 9:if(ND(t))return t.parent;case 80:if(fu(t))return t.name===e?t:void 0;if(wD(t)){const e=t.parent;return VP(e)&&e.name===t?e:void 0}{const n=t.parent;return AF(n)&&0!==og(n)&&(n.left.symbol||n.symbol)&&Fc(n)===e?n:void 0}case 81:return fu(t)&&t.name===e?t:void 0;default:return}}function mh(e){return Jh(e)&&168===e.parent.kind&&fu(e.parent.parent)}function gh(e){const t=e.parent;switch(t.kind){case 173:case 172:case 175:case 174:case 178:case 179:case 307:case 304:case 212:return t.name===e;case 167:return t.right===e;case 209:case 277:return t.propertyName===e;case 282:case 292:case 286:case 287:case 288:return!0}return!1}function hh(e){switch(e.parent.kind){case 274:case 277:case 275:case 282:case 278:case 272:case 281:return e.parent;case 167:do{e=e.parent}while(167===e.parent.kind);return hh(e)}}function yh(e){return ub(e)||MF(e)}function vh(e){return yh(bh(e))}function bh(e){return ME(e)?e.expression:e.right}function xh(e){return 305===e.kind?e.name:304===e.kind?e.initializer:e.parent.right}function kh(e){const t=Sh(e);if(t&&Om(e)){const t=Jc(e);if(t)return t.class}return t}function Sh(e){const t=Nh(e.heritageClauses,96);return t&&t.types.length>0?t.types[0]:void 0}function Th(e){if(Om(e))return zc(e).map(e=>e.class);{const t=Nh(e.heritageClauses,119);return null==t?void 0:t.types}}function Ch(e){return yE(e)?wh(e)||_:m_(e)&&G(an(kh(e)),Th(e))||_}function wh(e){const t=Nh(e.heritageClauses,96);return t?t.types:void 0}function Nh(e,t){if(e)for(const n of e)if(n.token===t)return n}function Dh(e,t){for(;e;){if(e.kind===t)return e;e=e.parent}}function Fh(e){return 83<=e&&e<=166}function Eh(e){return 19<=e&&e<=79}function Ph(e){return Fh(e)||Eh(e)}function Ah(e){return 128<=e&&e<=166}function Ih(e){return Fh(e)&&!Ah(e)}function Oh(e){const t=Oa(e);return void 0!==t&&Ih(t)}function Lh(e){const t=xc(e);return!!t&&!Ah(t)}function jh(e){return 2<=e&&e<=7}var Mh=(e=>(e[e.Normal=0]="Normal",e[e.Generator=1]="Generator",e[e.Async=2]="Async",e[e.Invalid=4]="Invalid",e[e.AsyncGenerator=3]="AsyncGenerator",e))(Mh||{});function Rh(e){if(!e)return 4;let t=0;switch(e.kind){case 263:case 219:case 175:e.asteriskToken&&(t|=1);case 220:Av(e,1024)&&(t|=2)}return e.body||(t|=4),t}function Bh(e){switch(e.kind){case 263:case 219:case 220:case 175:return void 0!==e.body&&void 0===e.asteriskToken&&Av(e,1024)}return!1}function Jh(e){return Ju(e)||$N(e)}function zh(e){return EF(e)&&(40===e.operator||41===e.operator)&&$N(e.operand)}function qh(e){const t=Fc(e);return!!t&&Uh(t)}function Uh(e){if(168!==e.kind&&213!==e.kind)return!1;const t=yF(e)?_h(e.argumentExpression):e.expression;return!Jh(t)&&!zh(t)}function Vh(e){switch(e.kind){case 80:case 81:return e.escapedText;case 11:case 15:case 9:case 10:return yc(e.text);case 168:const t=e.expression;return Jh(t)?yc(t.text):zh(t)?41===t.operator?Ia(t.operator)+t.operand.text:t.operand.text:void 0;case 296:return lC(e);default:return pn.assertNever(e)}}function Wh(e){switch(e.kind){case 80:case 11:case 15:case 9:return!0;default:return!1}}function $h(e){return gl(e)?bc(e):rP(e)?_C(e):e.text}function Hh(e){return gl(e)?e.escapedText:rP(e)?lC(e):yc(e.text)}function Kh(e,t){return`__#${uJ(e)}@${t}`}function Gh(e){return Qt(e.escapedName,"__@")}function Xh(e){return Qt(e.escapedName,"__#")}function Qh(e,t){switch((e=AA(e)).kind){case 232:if(Yz(e))return!1;break;case 219:if(e.name)return!1;break;case 220:break;default:return!1}return"function"!=typeof t||t(e)}function Yh(e){switch(e.kind){case 304:return!function(e){return uD(e)?"__proto__"===bc(e):KN(e)&&"__proto__"===e.text}(e.name);case 305:return!!e.objectAssignmentInitializer;case 261:return uD(e.name)&&!!e.initializer;case 170:case 209:return uD(e.name)&&!!e.initializer&&!e.dotDotDotToken;case 173:return!!e.initializer;case 227:switch(e.operatorToken.kind){case 64:case 77:case 76:case 78:return uD(e.left)}break;case 278:return!0}return!1}function Zh(e,t){if(!Yh(e))return!1;switch(e.kind){case 304:case 261:case 170:case 209:case 173:return Qh(e.initializer,t);case 305:return Qh(e.objectAssignmentInitializer,t);case 227:return Qh(e.right,t);case 278:return Qh(e.expression,t)}}function ey(e){return"push"===e.escapedText||"unshift"===e.escapedText}function ty(e){return 170===ny(e).kind}function ny(e){for(;209===e.kind;)e=e.parent.parent;return e}function ry(e){const t=e.kind;return 177===t||219===t||263===t||220===t||175===t||178===t||179===t||268===t||308===t}function iy(e){return tT(e.pos)||tT(e.end)}var oy=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(oy||{});function ay(e){const t=ly(e),n=215===e.kind&&void 0!==e.arguments;return sy(e.kind,t,n)}function sy(e,t,n){switch(e){case 215:return n?0:1;case 225:case 222:case 223:case 221:case 224:case 228:case 230:return 1;case 227:switch(t){case 43:case 64:case 65:case 66:case 68:case 67:case 69:case 70:case 71:case 72:case 73:case 74:case 79:case 75:case 76:case 77:case 78:return 1}}return 0}function cy(e){const t=ly(e),n=215===e.kind&&void 0!==e.arguments;return uy(e.kind,t,n)}function ly(e){return 227===e.kind?e.operatorToken.kind:225===e.kind||226===e.kind?e.operator:e.kind}var _y=(e=>(e[e.Comma=0]="Comma",e[e.Spread=1]="Spread",e[e.Yield=2]="Yield",e[e.Assignment=3]="Assignment",e[e.Conditional=4]="Conditional",e[e.LogicalOR=5]="LogicalOR",e[e.Coalesce=5]="Coalesce",e[e.LogicalAND=6]="LogicalAND",e[e.BitwiseOR=7]="BitwiseOR",e[e.BitwiseXOR=8]="BitwiseXOR",e[e.BitwiseAND=9]="BitwiseAND",e[e.Equality=10]="Equality",e[e.Relational=11]="Relational",e[e.Shift=12]="Shift",e[e.Additive=13]="Additive",e[e.Multiplicative=14]="Multiplicative",e[e.Exponentiation=15]="Exponentiation",e[e.Unary=16]="Unary",e[e.Update=17]="Update",e[e.LeftHandSide=18]="LeftHandSide",e[e.Member=19]="Member",e[e.Primary=20]="Primary",e[e.Highest=20]="Highest",e[e.Lowest=0]="Lowest",e[e.Invalid=-1]="Invalid",e))(_y||{});function uy(e,t,n){switch(e){case 357:return 0;case 231:return 1;case 230:return 2;case 228:return 4;case 227:switch(t){case 28:return 0;case 64:case 65:case 66:case 68:case 67:case 69:case 70:case 71:case 72:case 73:case 74:case 79:case 75:case 76:case 77:case 78:return 3;default:return dy(t)}case 217:case 236:case 225:case 222:case 223:case 221:case 224:return 16;case 226:return 17;case 214:return 18;case 215:return n?19:18;case 216:case 212:case 213:case 237:return 19;case 235:case 239:return 11;case 110:case 108:case 80:case 81:case 106:case 112:case 97:case 9:case 10:case 11:case 210:case 211:case 219:case 220:case 232:case 14:case 15:case 229:case 218:case 233:case 285:case 286:case 289:return 20;default:return-1}}function dy(e){switch(e){case 61:case 57:return 5;case 56:return 6;case 52:return 7;case 53:return 8;case 51:return 9;case 35:case 36:case 37:case 38:return 10;case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:return 11;case 48:case 49:case 50:return 12;case 40:case 41:return 13;case 42:case 44:case 45:return 14;case 43:return 15}return-1}function py(e){return D(e,e=>{switch(e.kind){case 295:return!!e.expression;case 12:return!e.containsOnlyTriviaWhiteSpaces;default:return!0}})}function fy(){let e=[];const t=[],n=new Map;let r=!1;return{add:function(i){let o;i.file?(o=n.get(i.file.fileName),o||(o=[],n.set(i.file.fileName,o),te(t,i.file.fileName,Nt))):(r&&(r=!1,e=e.slice()),o=e);te(o,i,ck,uk)},lookup:function(t){let r;r=t.file?n.get(t.file.fileName):e;if(!r)return;const i=we(r,t,lt,ck);if(i>=0)return r[i];if(~i>0&&uk(t,r[~i-1]))return r[~i-1];return},getGlobalDiagnostics:function(){return r=!0,e},getDiagnostics:function(r){if(r)return n.get(r)||[];const i=j(t,e=>n.get(e));if(!e.length)return i;return i.unshift(...e),i}}}var my=/\$\{/g;function gy(e){return e.replace(my,"\\${")}function hy(e){return!!(2048&(e.templateFlags||0))}function yy(e){return e&&!!(QN(e)?hy(e):hy(e.head)||H(e.templateSpans,e=>hy(e.literal)))}var vy=/[\\"\u0000-\u001f\u2028\u2029\u0085]/g,by=/[\\'\u0000-\u001f\u2028\u2029\u0085]/g,xy=/\r\n|[\\`\u0000-\u0009\u000b-\u001f\u2028\u2029\u0085]/g,ky=new Map(Object.entries({"\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","…":"\\u0085","\r\n":"\\r\\n"}));function Sy(e){return"\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4)}function Ty(e,t,n){if(0===e.charCodeAt(0)){const r=n.charCodeAt(t+e.length);return r>=48&&r<=57?"\\x00":"\\0"}return ky.get(e)||Sy(e.charCodeAt(0))}function Cy(e,t){const n=96===t?xy:39===t?by:vy;return e.replace(n,Ty)}var wy=/[^\u0000-\u007F]/g;function Ny(e,t){return e=Cy(e,t),wy.test(e)?e.replace(wy,e=>Sy(e.charCodeAt(0))):e}var Dy=/["\u0000-\u001f\u2028\u2029\u0085]/g,Fy=/['\u0000-\u001f\u2028\u2029\u0085]/g,Ey=new Map(Object.entries({'"':""","'":"'"}));function Py(e){return 0===e.charCodeAt(0)?"�":Ey.get(e)||"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function Ay(e,t){const n=39===t?Fy:Dy;return e.replace(n,Py)}function Iy(e){const t=e.length;return t>=2&&e.charCodeAt(0)===e.charCodeAt(t-1)&&(39===(n=e.charCodeAt(0))||34===n||96===n)?e.substring(1,t-1):e;var n}function Oy(e){const t=e.charCodeAt(0);return t>=97&&t<=122||e.includes("-")}var Ly=[""," "];function jy(e){const t=Ly[1];for(let n=Ly.length;n<=e;n++)Ly.push(Ly[n-1]+t);return Ly[e]}function My(){return Ly[1].length}function Ry(e){var t,n,r,i,o,a=!1;function s(e){const n=Ra(e);n.length>1?(i=i+n.length-1,o=t.length-e.length+xe(n),r=o-t.length===0):r=!1}function c(e){e&&e.length&&(r&&(e=jy(n)+e,r=!1),t+=e,s(e))}function l(e){e&&(a=!1),c(e)}function _(){t="",n=0,r=!0,i=0,o=0,a=!1}return _(),{write:l,rawWrite:function(e){void 0!==e&&(t+=e,s(e),a=!1)},writeLiteral:function(e){e&&e.length&&l(e)},writeLine:function(n){r&&!n||(i++,o=(t+=e).length,r=!0,a=!1)},increaseIndent:()=>{n++},decreaseIndent:()=>{n--},getIndent:()=>n,getTextPos:()=>t.length,getLine:()=>i,getColumn:()=>r?n*My():t.length-o,getText:()=>t,isAtStartOfLine:()=>r,hasTrailingComment:()=>a,hasTrailingWhitespace:()=>!!t.length&&$a(t.charCodeAt(t.length-1)),clear:_,writeKeyword:l,writeOperator:l,writeParameter:l,writeProperty:l,writePunctuation:l,writeSpace:l,writeStringLiteral:l,writeSymbol:(e,t)=>l(e),writeTrailingSemicolon:l,writeComment:function(e){e&&(a=!0),c(e)}}}function By(e){let t=!1;function n(){t&&(e.writeTrailingSemicolon(";"),t=!1)}return{...e,writeTrailingSemicolon(){t=!0},writeLiteral(t){n(),e.writeLiteral(t)},writeStringLiteral(t){n(),e.writeStringLiteral(t)},writeSymbol(t,r){n(),e.writeSymbol(t,r)},writePunctuation(t){n(),e.writePunctuation(t)},writeKeyword(t){n(),e.writeKeyword(t)},writeOperator(t){n(),e.writeOperator(t)},writeParameter(t){n(),e.writeParameter(t)},writeSpace(t){n(),e.writeSpace(t)},writeProperty(t){n(),e.writeProperty(t)},writeComment(t){n(),e.writeComment(t)},writeLine(){n(),e.writeLine()},increaseIndent(){n(),e.increaseIndent()},decreaseIndent(){n(),e.decreaseIndent()}}}function Jy(e){return!!e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames()}function zy(e){return Ht(Jy(e))}function qy(e,t,n){return t.moduleName||Wy(e,t.fileName,n&&n.fileName)}function Uy(e,t){return e.getCanonicalFileName(Uo(t,e.getCurrentDirectory()))}function Vy(e,t,n){const r=t.getExternalModuleFileFromDeclaration(n);if(!r||r.isDeclarationFile)return;const i=wg(n);return!i||!Ju(i)||So(i.text)||Uy(e,r.path).includes(Uy(e,Go(e.getCommonSourceDirectory())))?qy(e,r):void 0}function Wy(e,t,n){const r=t=>e.getCanonicalFileName(t),i=Ho(n?Ao(n):e.getCommonSourceDirectory(),e.getCurrentDirectory(),r),o=KS(_a(i,Uo(t,e.getCurrentDirectory()),i,r,!1));return n?Xo(o):o}function $y(e,t,n){const r=t.getCompilerOptions();let i;return i=r.outDir?KS(tv(e,t,r.outDir)):KS(e),i+n}function Hy(e,t){return Ky(e,t.getCompilerOptions(),t)}function Ky(e,t,n){const r=t.declarationDir||t.outDir,i=r?nv(e,r,n.getCurrentDirectory(),n.getCommonSourceDirectory(),e=>n.getCanonicalFileName(e)):e,o=Gy(i);return KS(i)+o}function Gy(e){return No(e,[".mjs",".mts"])?".d.mts":No(e,[".cjs",".cts"])?".d.cts":No(e,[".json"])?".d.json.ts":".d.ts"}function Xy(e){return No(e,[".d.mts",".mjs",".mts"])?[".mts",".mjs"]:No(e,[".d.cts",".cjs",".cts"])?[".cts",".cjs"]:No(e,[".d.json.ts"])?[".json"]:[".tsx",".ts",".jsx",".js"]}function Qy(e,t,n,r){return n?zo(r(),sa(n,e,t)):e}function Yy(e,t){var n;if(e.paths)return e.baseUrl??pn.checkDefined(e.pathsBasePath||(null==(n=t.getCurrentDirectory)?void 0:n.call(t)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")}function Zy(e,t,n){const r=e.getCompilerOptions();if(r.outFile){const t=Tk(r),i=r.emitDeclarationOnly||2===t||4===t;return D(e.getSourceFiles(),t=>(i||!uO(t))&&ev(t,e,n))}return D(void 0===t?e.getSourceFiles():[t],t=>ev(t,e,n))}function ev(e,t,n){const r=t.getCompilerOptions();if(r.noEmitForJsFiles&&Im(e))return!1;if(e.isDeclarationFile)return!1;if(t.isSourceFileFromExternalLibrary(e))return!1;if(n)return!0;if(t.isSourceOfProjectReferenceRedirect(e.fileName))return!1;if(!of(e))return!0;if(t.getRedirectFromSourceFile(e.fileName))return!1;if(r.outFile)return!0;if(!r.outDir)return!1;if(r.rootDir||r.composite&&r.configFilePath){const n=Uo(vU(r,()=>[],t.getCurrentDirectory(),t.getCanonicalFileName),t.getCurrentDirectory()),i=nv(e.fileName,r.outDir,t.getCurrentDirectory(),n,t.getCanonicalFileName);if(0===ra(e.fileName,i,t.getCurrentDirectory(),!t.useCaseSensitiveFileNames()))return!1}return!0}function tv(e,t,n){return nv(e,n,t.getCurrentDirectory(),t.getCommonSourceDirectory(),e=>t.getCanonicalFileName(e))}function nv(e,t,n,r,i){let o=Uo(e,n);return o=0===i(o).indexOf(i(r))?o.substring(r.length):o,Jo(t,o)}function rv(e,t,n,r,i,o,a){e.writeFile(n,r,i,e=>{t.add(nk(fa.Could_not_write_file_0_Colon_1,n,e))},o,a)}function iv(e,t,n){if(e.length>Po(e)&&!n(e)){iv(Ao(e),t,n),t(e)}}function ov(e,t,n,r,i,o){try{r(e,t,n)}catch{iv(Ao(Vo(e)),i,o),r(e,t,n)}}function av(e,t){return Ua(za(e),t)}function sv(e,t){return Ua(e,t)}function cv(e){return x(e.members,e=>jD(e)&&Ad(e.body))}function lv(e){if(e&&e.parameters.length>0){const t=2===e.parameters.length&&dv(e.parameters[0]);return e.parameters[t?1:0]}}function _v(e){const t=lv(e);return t&&t.type}function uv(e){if(e.parameters.length&&!EP(e)){const t=e.parameters[0];if(dv(t))return t}}function dv(e){return pv(e.name)}function pv(e){return!!e&&80===e.kind&&gv(e)}function fv(e){return!!mc(e,e=>187===e.kind||80!==e.kind&&167!==e.kind&&"quit")}function mv(e){if(!pv(e))return!1;for(;wD(e.parent)&&e.parent.left===e;)e=e.parent;return 187===e.parent.kind}function gv(e){return"this"===e.escapedText}function hv(e,t){let n,r,i,o;return qh(t)?(n=t,178===t.kind?i=t:179===t.kind?o=t:pn.fail("Accessor has wrong kind")):p(e,e=>{if(g_(e)&&Iv(e)===Iv(t)){Vh(e.name)===Vh(t.name)&&(n?r||(r=e):n=e,178!==e.kind||i||(i=e),179!==e.kind||o||(o=e))}}),{firstAccessor:n,secondAccessor:r,getAccessor:i,setAccessor:o}}function yv(e){if(!Om(e)&&gE(e))return;if(vE(e))return;const t=e.type;return t||!Om(e)?t:Pl(e)?e.typeExpression&&e.typeExpression.type:al(e)}function vv(e){return e.type}function bv(e){return EP(e)?e.type&&e.type.typeExpression&&e.type.typeExpression.type:e.type||(Om(e)?sl(e):void 0)}function xv(e){return L(ll(e),e=>function(e){return KP(e)&&!(321===e.parent.kind&&(e.parent.tags.some(Ag)||e.parent.tags.some(JP)))}(e)?e.typeParameters:void 0)}function kv(e){const t=lv(e);return t&&yv(t)}function Sv(e,t,n,r){!function(e,t,n,r){r&&r.length&&n!==r[0].pos&&sv(e,n)!==sv(e,r[0].pos)&&t.writeLine()}(e,t,n.pos,r)}function Tv(e,t,n,r){n!==r&&sv(e,n)!==sv(e,r)&&t.writeLine()}function Cv(e,t,n,r,i,o,a){let s,c;if(a?0===i.pos&&(s=D(fs(e,i.pos),function(t){return Ud(e,t.pos)})):s=fs(e,i.pos),s){const a=[];let l;for(const e of s){if(l){const n=sv(t,l.end);if(sv(t,e.pos)>=n+2)break}a.push(e),l=e}if(a.length){const l=sv(t,xe(a).end);sv(t,ts(e,i.pos))>=l+2&&(Sv(t,n,i,s),function(e,t,n,r,i,o,a,s){if(r&&r.length>0){i&&n.writeSpace(" ");let c=!1;for(const i of r)c&&(n.writeSpace(" "),c=!1),s(e,t,n,i.pos,i.end,a),i.hasTrailingNewLine?n.writeLine():c=!0;c&&o&&n.writeSpace(" ")}}(e,t,n,a,!1,!0,o,r),c={nodePos:i.pos,detachedCommentEndPos:xe(a).end})}}return c}function wv(e,t,n,r,i,o){if(42===e.charCodeAt(r+1)){const a=qa(t,r),s=t.length;let c;for(let l=r,_=a.line;l0){let e=i%My();const t=jy((i-e)/My());for(n.rawWrite(t);e;)n.rawWrite(" "),e--}else n.rawWrite("")}Nv(e,i,n,o,l,u),l=u}}else n.writeComment(e.substring(r,i))}function Nv(e,t,n,r,i,o){const a=Math.min(t,o-1),s=e.substring(i,a).trim();s?(n.writeComment(s),a!==t&&n.writeLine()):n.rawWrite(r)}function Dv(e,t,n){let r=0;for(;t=0&&e.kind<=166?0:(536870912&e.modifierFlagsCache||(e.modifierFlagsCache=536870912|Xv(e)),n||t&&Om(e)?(268435456&e.modifierFlagsCache||!e.parent||(e.modifierFlagsCache|=268435456|Hv(e)),Kv(e.modifierFlagsCache)):65535&e.modifierFlagsCache)}function Vv(e){return Uv(e,!0)}function Wv(e){return Uv(e,!0,!0)}function $v(e){return Uv(e,!1)}function Hv(e){let t=0;return e.parent&&!FD(e)&&(Om(e)&&(Vc(e)&&(t|=8388608),$c(e)&&(t|=16777216),Kc(e)&&(t|=33554432),Xc(e)&&(t|=67108864),Qc(e)&&(t|=134217728)),Zc(e)&&(t|=65536)),t}function Kv(e){return 131071&e|(260046848&e)>>>23}function Gv(e){return Xv(e)|function(e){return Kv(Hv(e))}(e)}function Xv(e){let t=EI(e)?Qv(e.modifiers):0;return(8&e.flags||80===e.kind&&4096&e.flags)&&(t|=32),t}function Qv(e){let t=0;if(e)for(const n of e)t|=Yv(n.kind);return t}function Yv(e){switch(e){case 126:return 256;case 125:return 1;case 124:return 4;case 123:return 2;case 128:return 64;case 129:return 512;case 95:return 32;case 138:return 128;case 87:return 4096;case 90:return 2048;case 134:return 1024;case 148:return 8;case 164:return 16;case 103:return 8192;case 147:return 16384;case 171:return 32768}return 0}function Zv(e){return 57===e||56===e}function eb(e){return Zv(e)||54===e}function tb(e){return 76===e||77===e||78===e}function nb(e){return AF(e)&&tb(e.operatorToken.kind)}function rb(e){return Zv(e)||61===e}function ib(e){return AF(e)&&rb(e.operatorToken.kind)}function ob(e){return e>=64&&e<=79}function ab(e){const t=sb(e);return t&&!t.isImplements?t.class:void 0}function sb(e){if(BF(e)){if(aP(e.parent)&&m_(e.parent.parent))return{class:e.parent.parent,isImplements:119===e.parent.token};if(PP(e.parent)){const t=Hg(e.parent);if(t&&m_(t))return{class:t,isImplements:!1}}}}function cb(e,t){return AF(e)&&(t?64===e.operatorToken.kind:ob(e.operatorToken.kind))&&q_(e.left)}function lb(e){if(cb(e,!0)){const t=e.left.kind;return 211===t||210===t}return!1}function _b(e){return void 0!==ab(e)}function ub(e){return 80===e.kind||fb(e)}function db(e){switch(e.kind){case 80:return e;case 167:do{e=e.left}while(80!==e.kind);return e;case 212:do{e=e.expression}while(80!==e.kind);return e}}function pb(e){return 80===e.kind||110===e.kind||108===e.kind||237===e.kind||212===e.kind&&pb(e.expression)||218===e.kind&&pb(e.expression)}function fb(e){return hF(e)&&uD(e.name)&&ub(e.expression)}function mb(e){if(hF(e)){const t=mb(e.expression);if(void 0!==t)return t+"."+zp(e.name)}else if(yF(e)){const t=mb(e.expression);if(void 0!==t&&o_(e.argumentExpression))return t+"."+Vh(e.argumentExpression)}else{if(uD(e))return vc(e.escapedText);if(rP(e))return _C(e)}}function gb(e){return lg(e)&&"prototype"===fg(e)}function hb(e){return 167===e.parent.kind&&e.parent.right===e||212===e.parent.kind&&e.parent.name===e||237===e.parent.kind&&e.parent.name===e}function yb(e){return!!e.parent&&(hF(e.parent)&&e.parent.name===e||yF(e.parent)&&e.parent.argumentExpression===e)}function vb(e){return wD(e.parent)&&e.parent.right===e||hF(e.parent)&&e.parent.name===e||gP(e.parent)&&e.parent.right===e}function bb(e){return AF(e)&&104===e.operatorToken.kind}function xb(e){return bb(e.parent)&&e===e.parent.right}function kb(e){return 211===e.kind&&0===e.properties.length}function Sb(e){return 210===e.kind&&0===e.elements.length}function Tb(e){if(function(e){return e&&d(e.declarations)>0&&Av(e.declarations[0],2048)}(e)&&e.declarations)for(const t of e.declarations)if(t.localSymbol)return t.localSymbol}function Cb(e){return x(ES,t=>wo(e,t))}var wb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Nb(e){let t="";const n=function(e){const t=[],n=e.length;for(let r=0;r>6|192),t.push(63&n|128)):n<65536?(t.push(n>>12|224),t.push(n>>6&63|128),t.push(63&n|128)):n<131072?(t.push(n>>18|240),t.push(n>>12&63|128),t.push(n>>6&63|128),t.push(63&n|128)):pn.assert(!1,"Unexpected code point")}return t}(e);let r=0;const i=n.length;let o,a,s,c;for(;r>2,a=(3&n[r])<<4|n[r+1]>>4,s=(15&n[r+1])<<2|n[r+2]>>6,c=63&n[r+2],r+1>=i?s=c=64:r+2>=i&&(c=64),t+=wb.charAt(o)+wb.charAt(a)+wb.charAt(s)+wb.charAt(c),r+=3;return t}function Db(e,t){return e&&e.base64encode?e.base64encode(t):Nb(t)}function Fb(e,t){if(e&&e.base64decode)return e.base64decode(t);const n=t.length,r=[];let i=0;for(;i>4&3,c=(15&n)<<4|o>>2&15,l=(3&o)<<6|63&a;0===c&&0!==o?r.push(s):0===l&&0!==a?r.push(s,c):r.push(s,c,l),i+=4}return function(e){let t="",n=0;const r=e.length;for(;n=e||-1===t),{pos:e,end:t}}function Rb(e,t){return Mb(e.pos,t)}function Bb(e,t){return Mb(t,e.end)}function Jb(e){const t=EI(e)?k(e.modifiers,ED):void 0;return t&&!tT(t.end)?Bb(e,t.end):e}function zb(e){if(AD(e)||OD(e))return Bb(e,e.name.pos);const t=EI(e)?be(e.modifiers):void 0;return t&&!tT(t.end)?Bb(e,t.end):Jb(e)}function qb(e,t){return Mb(e,e+Ia(t).length)}function Ub(e,t){return $b(e,e,t)}function Vb(e,t,n){return Qb(Yb(e,n,!1),Yb(t,n,!1),n)}function Wb(e,t,n){return Qb(e.end,t.end,n)}function $b(e,t,n){return Qb(Yb(e,n,!1),t.end,n)}function Hb(e,t,n){return Qb(e.end,Yb(t,n,!1),n)}function Kb(e,t,n,r){const i=Yb(t,n,r);return Va(n,e.end,i)}function Gb(e,t,n){return Va(n,e.end,t.end)}function Xb(e,t){return!Qb(e.pos,e.end,t)}function Qb(e,t,n){return 0===Va(n,e,t)}function Yb(e,t,n){return tT(e.pos)?-1:ts(t.text,e.pos,!1,n)}function Zb(e,t,n,r){const i=ts(n.text,e,!1,r),o=function(e,t=0,n){for(;e-- >t;)if(!$a(n.text.charCodeAt(e)))return e}(i,t,n);return Va(n,o??t,i)}function ex(e,t,n,r){const i=ts(n.text,e,!1,r);return Va(n,e,Math.min(t,i))}function tx(e,t){return nx(e.pos,e.end,t)}function nx(e,t,n){return e<=n.pos&&t>=n.end}function rx(e){const t=hc(e);if(t)switch(t.parent.kind){case 267:case 268:return t===t.parent.name}return!1}function ix(e){return D(e.declarations,ox)}function ox(e){return fE(e)&&void 0!==e.initializer}function ax(e){return e.watch&&Ee(e,"watch")}function sx(e){e.close()}function cx(e){return 33554432&e.flags?e.links.checkFlags:0}function lx(e,t=!1){if(e.valueDeclaration){const n=cc(t&&e.declarations&&x(e.declarations,RD)||32768&e.flags&&x(e.declarations,MD)||e.valueDeclaration);return e.parent&&32&e.parent.flags?n:-8&n}if(6&cx(e)){const t=e.links.checkFlags;return(1024&t?2:256&t?1:4)|(2048&t?256:0)}return 4194304&e.flags?257:0}function _x(e,t){return 2097152&e.flags?t.getAliasedSymbol(e):e}function ux(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags}function dx(e){return 1===fx(e)}function px(e){return 0!==fx(e)}function fx(e){const{parent:t}=e;switch(null==t?void 0:t.kind){case 218:case 210:return fx(t);case 226:case 225:const{operator:n}=t;return 46===n||47===n?2:0;case 227:const{left:r,operatorToken:i}=t;return r===e&&ob(i.kind)?64===i.kind?1:2:0;case 212:return t.name!==e?0:fx(t);case 304:{const n=fx(t.parent);return e===t.name?function(e){switch(e){case 0:return 1;case 1:return 0;case 2:return 2;default:return pn.assertNever(e)}}(n):n}case 305:return e===t.objectAssignmentInitializer?0:fx(t.parent);case 250:case 251:return e===t.initializer?1:0;default:return 0}}function mx(e,t){if(!e||!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if("object"==typeof e[n]){if(!mx(e[n],t[n]))return!1}else if("function"!=typeof e[n]&&e[n]!==t[n])return!1;return!0}function gx(e,t){e.forEach(t),e.clear()}function hx(e,t,n){const{onDeleteValue:r,onExistingValue:i}=n;e.forEach((n,o)=>{var a;(null==t?void 0:t.has(o))?i&&i(n,null==(a=t.get)?void 0:a.call(t,o),o):(e.delete(o),r(n,o))})}function yx(e,t,n){hx(e,t,n);const{createNewValue:r}=n;null==t||t.forEach((t,n)=>{e.has(n)||e.set(n,r(n,t))})}function vx(e){if(32&e.flags){const t=bx(e);return!!t&&Av(t,64)}return!1}function bx(e){var t;return null==(t=e.declarations)?void 0:t.find(m_)}function xx(e){return 3899393&e.flags?e.objectFlags:0}function kx(e){return!!e&&!!e.declarations&&!!e.declarations[0]&&TE(e.declarations[0])}function Sx({moduleSpecifier:e}){return KN(e)?e.text:ep(e)}function Tx(e){let t;return iO(e,e=>{Ad(e)&&(t=e)},e=>{for(let n=e.length-1;n>=0;n--)if(Ad(e[n])){t=e[n];break}}),t}function Cx(e,t){return!e.has(t)&&(e.add(t),!0)}function wx(e){return m_(e)||yE(e)||HD(e)}function Nx(e){return e>=183&&e<=206||133===e||159===e||150===e||163===e||151===e||136===e||154===e||155===e||116===e||157===e||146===e||141===e||234===e||313===e||314===e||315===e||316===e||317===e||318===e||319===e}function Dx(e){return 212===e.kind||213===e.kind}function Fx(e){return 212===e.kind?e.name:(pn.assert(213===e.kind),e.argumentExpression)}function Ex(e){return 276===e.kind||280===e.kind}function Px(e){for(;Dx(e);)e=e.expression;return e}function Ax(e,t){if(Dx(e.parent)&&yb(e))return function e(n){if(212===n.kind){const e=t(n.name);if(void 0!==e)return e}else if(213===n.kind){if(!uD(n.argumentExpression)&&!Ju(n.argumentExpression))return;{const e=t(n.argumentExpression);if(void 0!==e)return e}}if(Dx(n.expression))return e(n.expression);if(uD(n.expression))return t(n.expression);return}(e.parent)}function Ix(e,t){for(;;){switch(e.kind){case 226:e=e.operand;continue;case 227:e=e.left;continue;case 228:e=e.condition;continue;case 216:e=e.tag;continue;case 214:if(t)return e;case 235:case 213:case 212:case 236:case 356:case 239:e=e.expression;continue}return e}}function Ox(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=0,this.mergeId=0,this.parent=void 0,this.members=void 0,this.exports=void 0,this.exportSymbol=void 0,this.constEnumOnlyModule=void 0,this.isReferenced=void 0,this.lastAssignmentPos=void 0,this.links=void 0}function Lx(e,t){this.flags=t,(pn.isDebugging||Gn)&&(this.checker=e)}function jx(e,t){this.flags=t,pn.isDebugging&&(this.checker=e)}function Mx(e,t,n){this.pos=t,this.end=n,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function Rx(e,t,n){this.pos=t,this.end=n,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.emitNode=void 0}function Bx(e,t,n){this.pos=t,this.end=n,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function Jx(e,t,n){this.fileName=e,this.text=t,this.skipTrivia=n||(e=>e)}var zx,qx={getNodeConstructor:()=>Mx,getTokenConstructor:()=>Rx,getIdentifierConstructor:()=>Bx,getPrivateIdentifierConstructor:()=>Mx,getSourceFileConstructor:()=>Mx,getSymbolConstructor:()=>Ox,getTypeConstructor:()=>Lx,getSignatureConstructor:()=>jx,getSourceMapSourceConstructor:()=>Jx},Ux=[];function Vx(e){Ux.push(e),e(qx)}function Wx(e){Object.assign(qx,e),p(Ux,e=>e(qx))}function $x(e,t){return e.replace(/\{(\d+)\}/g,(e,n)=>""+pn.checkDefined(t[+n]))}function Hx(e){zx=e}function Kx(e){!zx&&e&&(zx=e())}function Gx(e){return zx&&zx[e.key]||e.message}function Xx(e,t,n,r,i,...o){n+r>t.length&&(r=t.length-n),Hp(t,n,r);let a=Gx(i);return H(o)&&(a=$x(a,o)),{file:void 0,start:n,length:r,messageText:a,category:i.category,code:i.code,reportsUnnecessary:i.reportsUnnecessary,fileName:e}}function Qx(e){return void 0===e.file&&void 0!==e.start&&void 0!==e.length&&"string"==typeof e.fileName}function Yx(e,t){const n=t.fileName||"",r=t.text.length;pn.assertEqual(e.fileName,n),pn.assertLessThanOrEqual(e.start,r),pn.assertLessThanOrEqual(e.start+e.length,r);const i={file:t,start:e.start,length:e.length,messageText:e.messageText,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary};if(e.relatedInformation){i.relatedInformation=[];for(const o of e.relatedInformation)Qx(o)&&o.fileName===n?(pn.assertLessThanOrEqual(o.start,r),pn.assertLessThanOrEqual(o.start+o.length,r),i.relatedInformation.push(Yx(o,t))):i.relatedInformation.push(o)}return i}function Zx(e,t){const n=[];for(const r of e)n.push(Yx(r,t));return n}function ek(e,t,n,r,...i){Hp(e.text,t,n);let o=Gx(r);return H(i)&&(o=$x(o,i)),{file:e,start:t,length:n,messageText:o,category:r.category,code:r.code,reportsUnnecessary:r.reportsUnnecessary,reportsDeprecated:r.reportsDeprecated}}function tk(e,...t){let n=Gx(e);return H(t)&&(n=$x(n,t)),n}function nk(e,...t){let n=Gx(e);return H(t)&&(n=$x(n,t)),{file:void 0,start:void 0,length:void 0,messageText:n,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function rk(e,t){return{file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}}function ik(e,t,...n){let r=Gx(t);return H(n)&&(r=$x(r,n)),{messageText:r,category:t.category,code:t.code,next:void 0===e||Array.isArray(e)?e:[e]}}function ok(e,t){let n=e;for(;n.next;)n=n.next[0];n.next=[t]}function ak(e){return e.file?e.file.path:void 0}function sk(e,t){return ck(e,t)||function(e,t){if(!e.relatedInformation&&!t.relatedInformation)return 0;if(e.relatedInformation&&t.relatedInformation)return xt(t.relatedInformation.length,e.relatedInformation.length)||p(e.relatedInformation,(e,n)=>sk(e,t.relatedInformation[n]))||0;return e.relatedInformation?-1:1}(e,t)||0}function ck(e,t){const n=dk(e),r=dk(t);return Nt(ak(e),ak(t))||xt(e.start,t.start)||xt(e.length,t.length)||xt(n,r)||function(e,t){let n=pk(e),r=pk(t);"string"!=typeof n&&(n=n.messageText);"string"!=typeof r&&(r=r.messageText);const i="string"!=typeof e.messageText?e.messageText.next:void 0,o="string"!=typeof t.messageText?t.messageText.next:void 0;let a=Nt(n,r);if(a)return a;if(a=function(e,t){if(void 0===e&&void 0===t)return 0;if(void 0===e)return 1;if(void 0===t)return-1;return lk(e,t)||_k(e,t)}(i,o),a)return a;if(e.canonicalHead&&!t.canonicalHead)return-1;if(t.canonicalHead&&!e.canonicalHead)return 1;return 0}(e,t)||0}function lk(e,t){if(void 0===e&&void 0===t)return 0;if(void 0===e)return 1;if(void 0===t)return-1;let n=xt(t.length,e.length);if(n)return n;for(let r=0;r{e.externalModuleIndicator=MI(e)||!e.isDeclarationFile||void 0};case 1:return e=>{e.externalModuleIndicator=MI(e)};case 2:const t=[MI];4!==e.jsx&&5!==e.jsx||t.push(gk),t.push(hk);const n=nn(...t);return t=>{t.externalModuleIndicator=n(t,e)}}}function vk(e){const t=Ck(e);return 3<=t&&t<=99||Ek(e)||Pk(e)}var bk={allowImportingTsExtensions:{dependencies:["rewriteRelativeImportExtensions"],computeValue:e=>!(!e.allowImportingTsExtensions&&!e.rewriteRelativeImportExtensions)},target:{dependencies:["module"],computeValue:e=>(0===e.target?void 0:e.target)??((100===e.module||101===e.module?9:102===e.module&&10)||199===e.module&&99||1)},module:{dependencies:["target"],computeValue:e=>"number"==typeof e.module?e.module:bk.target.computeValue(e)>=2?5:1},moduleResolution:{dependencies:["module","target"],computeValue:e=>{let t=e.moduleResolution;if(void 0===t)switch(bk.module.computeValue(e)){case 1:t=2;break;case 100:case 101:case 102:t=3;break;case 199:t=99;break;case 200:t=100;break;default:t=1}return t}},moduleDetection:{dependencies:["module","target"],computeValue:e=>{if(void 0!==e.moduleDetection)return e.moduleDetection;const t=bk.module.computeValue(e);return 100<=t&&t<=199?3:2}},isolatedModules:{dependencies:["verbatimModuleSyntax"],computeValue:e=>!(!e.isolatedModules&&!e.verbatimModuleSyntax)},esModuleInterop:{dependencies:["module","target"],computeValue:e=>{if(void 0!==e.esModuleInterop)return e.esModuleInterop;switch(bk.module.computeValue(e)){case 100:case 101:case 102:case 199:case 200:return!0}return!1}},allowSyntheticDefaultImports:{dependencies:["module","target","moduleResolution"],computeValue:e=>void 0!==e.allowSyntheticDefaultImports?e.allowSyntheticDefaultImports:bk.esModuleInterop.computeValue(e)||4===bk.module.computeValue(e)||100===bk.moduleResolution.computeValue(e)},resolvePackageJsonExports:{dependencies:["moduleResolution"],computeValue:e=>{const t=bk.moduleResolution.computeValue(e);if(!Uk(t))return!1;if(void 0!==e.resolvePackageJsonExports)return e.resolvePackageJsonExports;switch(t){case 3:case 99:case 100:return!0}return!1}},resolvePackageJsonImports:{dependencies:["moduleResolution","resolvePackageJsonExports"],computeValue:e=>{const t=bk.moduleResolution.computeValue(e);if(!Uk(t))return!1;if(void 0!==e.resolvePackageJsonImports)return e.resolvePackageJsonImports;switch(t){case 3:case 99:case 100:return!0}return!1}},resolveJsonModule:{dependencies:["moduleResolution","module","target"],computeValue:e=>{if(void 0!==e.resolveJsonModule)return e.resolveJsonModule;switch(bk.module.computeValue(e)){case 102:case 199:return!0}return 100===bk.moduleResolution.computeValue(e)}},declaration:{dependencies:["composite"],computeValue:e=>!(!e.declaration&&!e.composite)},preserveConstEnums:{dependencies:["isolatedModules","verbatimModuleSyntax"],computeValue:e=>!(!e.preserveConstEnums&&!bk.isolatedModules.computeValue(e))},incremental:{dependencies:["composite"],computeValue:e=>!(!e.incremental&&!e.composite)},declarationMap:{dependencies:["declaration","composite"],computeValue:e=>!(!e.declarationMap||!bk.declaration.computeValue(e))},allowJs:{dependencies:["checkJs"],computeValue:e=>void 0===e.allowJs?!!e.checkJs:e.allowJs},useDefineForClassFields:{dependencies:["target","module"],computeValue:e=>void 0===e.useDefineForClassFields?bk.target.computeValue(e)>=9:e.useDefineForClassFields},noImplicitAny:{dependencies:["strict"],computeValue:e=>Wk(e,"noImplicitAny")},noImplicitThis:{dependencies:["strict"],computeValue:e=>Wk(e,"noImplicitThis")},strictNullChecks:{dependencies:["strict"],computeValue:e=>Wk(e,"strictNullChecks")},strictFunctionTypes:{dependencies:["strict"],computeValue:e=>Wk(e,"strictFunctionTypes")},strictBindCallApply:{dependencies:["strict"],computeValue:e=>Wk(e,"strictBindCallApply")},strictPropertyInitialization:{dependencies:["strict"],computeValue:e=>Wk(e,"strictPropertyInitialization")},strictBuiltinIteratorReturn:{dependencies:["strict"],computeValue:e=>Wk(e,"strictBuiltinIteratorReturn")},alwaysStrict:{dependencies:["strict"],computeValue:e=>Wk(e,"alwaysStrict")},useUnknownInCatchVariables:{dependencies:["strict"],computeValue:e=>Wk(e,"useUnknownInCatchVariables")}},xk=bk,kk=bk.allowImportingTsExtensions.computeValue,Sk=bk.target.computeValue,Tk=bk.module.computeValue,Ck=bk.moduleResolution.computeValue,wk=bk.moduleDetection.computeValue,Nk=bk.isolatedModules.computeValue,Dk=bk.esModuleInterop.computeValue,Fk=bk.allowSyntheticDefaultImports.computeValue,Ek=bk.resolvePackageJsonExports.computeValue,Pk=bk.resolvePackageJsonImports.computeValue,Ak=bk.resolveJsonModule.computeValue,Ik=bk.declaration.computeValue,Ok=bk.preserveConstEnums.computeValue,Lk=bk.incremental.computeValue,jk=bk.declarationMap.computeValue,Mk=bk.allowJs.computeValue,Rk=bk.useDefineForClassFields.computeValue;function Bk(e){return e>=5&&e<=99}function Jk(e){switch(Tk(e)){case 0:case 4:case 3:return!1}return!0}function zk(e){return!1===e.allowUnreachableCode}function qk(e){return!1===e.allowUnusedLabels}function Uk(e){return e>=3&&e<=99||100===e}function Vk(e){return 101<=e&&e<=199||200===e||99===e}function Wk(e,t){return void 0===e[t]?!!e.strict:!!e[t]}function $k(e){return sd(RO.type,(t,n)=>t===e?n:void 0)}function Hk(e){return!1!==e.useDefineForClassFields&&Sk(e)>=9}function Kk(e,t){return od(t,e,qO)}function Gk(e,t){return od(t,e,UO)}function Xk(e,t){return od(t,e,VO)}function Qk(e,t){return t.strictFlag?Wk(e,t.name):t.allowJsFlag?Mk(e):e[t.name]}function Yk(e){const t=e.jsx;return 2===t||4===t||5===t}function Zk(e,t){const n=null==t?void 0:t.pragmas.get("jsximportsource"),r=Ze(n)?n[n.length-1]:n,i=null==t?void 0:t.pragmas.get("jsxruntime"),o=Ze(i)?i[i.length-1]:i;if("classic"!==(null==o?void 0:o.arguments.factory))return 4===e.jsx||5===e.jsx||e.jsxImportSource||r||"automatic"===(null==o?void 0:o.arguments.factory)?(null==r?void 0:r.arguments.factory)||e.jsxImportSource||"react":void 0}function eS(e,t){return e?`${e}/${5===t.jsx?"jsx-dev-runtime":"jsx-runtime"}`:void 0}function tS(e){let t=!1;for(let n=0;ni,getSymlinkedDirectories:()=>n,getSymlinkedDirectoriesByRealpath:()=>r,setSymlinkedFile:(e,t)=>(i||(i=new Map)).set(e,t),setSymlinkedDirectory:(i,o)=>{let a=Ho(i,e,t);RT(a)||(a=Go(a),!1===o||(null==n?void 0:n.has(a))||(r||(r=Ke())).add(o.realPath,i),(n||(n=new Map)).set(a,o))},setSymlinksFromResolutions(e,t,n){pn.assert(!o),o=!0,e(e=>a(this,e.resolvedModule)),t(e=>a(this,e.resolvedTypeReferenceDirective)),n.forEach(e=>a(this,e.resolvedTypeReferenceDirective))},hasProcessedResolutions:()=>o,setSymlinksFromResolution(e){a(this,e)},hasAnySymlinks:function(){return!!(null==i?void 0:i.size)||!!n&&!!sd(n,e=>!!e)}};function a(n,r){if(!r||!r.originalPath||!r.resolvedFileName)return;const{resolvedFileName:i,originalPath:o}=r;n.setSymlinkedFile(Ho(o,e,t),i);const[a,s]=function(e,t,n,r){const i=jo(Uo(e,n)),o=jo(Uo(t,n));let a=!1;for(;i.length>=2&&o.length>=2&&!rS(i[i.length-2],r)&&!rS(o[o.length-2],r)&&r(i[i.length-1])===r(o[o.length-1]);)i.pop(),o.pop(),a=!0;return a?[Mo(i),Mo(o)]:void 0}(i,o,e,t)||_;a&&s&&n.setSymlinkedDirectory(s,{real:Go(a),realPath:Go(Ho(a,e,t))})}}function rS(e,t){return void 0!==e&&("node_modules"===t(e)||Qt(e,"@"))}function iS(e,t,n){const r=Zt(e,t,n);return void 0===r?void 0:yo((i=r).charCodeAt(0))?i.slice(1):void 0;var i}var oS=/[^\w\s/]/g;function aS(e){return e.replace(oS,sS)}function sS(e){return"\\"+e}var cS=[42,63],lS=`(?!(?:${["node_modules","bower_components","jspm_packages"].join("|")})(?:/|$))`,_S={singleAsteriskRegexFragment:"(?:[^./]|(?:\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:`(?:/${lS}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>vS(e,_S.singleAsteriskRegexFragment)},uS={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:`(?:/${lS}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>vS(e,uS.singleAsteriskRegexFragment)},dS={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(?:/.+?)?",replaceWildcardCharacter:e=>vS(e,dS.singleAsteriskRegexFragment)},pS={files:_S,directories:uS,exclude:dS};function fS(e,t,n){const r=mS(e,t,n);if(!r||!r.length)return;return`^(?:${r.map(e=>`(?:${e})`).join("|")})${"exclude"===n?"(?:$|/)":"$"}`}function mS(e,t,n){if(void 0!==e&&0!==e.length)return L(e,e=>e&&yS(e,t,n,pS[n]))}function gS(e){return!/[.*?]/.test(e)}function hS(e,t,n){const r=e&&yS(e,t,n,pS[n]);return r&&`^(?:${r})${"exclude"===n?"(?:$|/)":"$"}`}function yS(e,t,n,{singleAsteriskRegexFragment:r,doubleAsteriskRegexFragment:i,replaceWildcardCharacter:o}=pS[n]){let a="",s=!1;const c=qo(e,t),l=xe(c);if("exclude"!==n&&"**"===l)return;c[0]=Ko(c[0]),gS(l)&&c.push("**","*");let _=0;for(let e of c){if("**"===e)a+=i;else if("directories"===n&&(a+="(?:",_++),s&&(a+=fo),"exclude"!==n){let t="";42===e.charCodeAt(0)?(t+="(?:[^./]"+r+")?",e=e.substr(1)):63===e.charCodeAt(0)&&(t+="[^./]",e=e.substr(1)),t+=e.replace(oS,o),t!==e&&(a+=lS),a+=t}else a+=e.replace(oS,o);s=!0}for(;_>0;)a+=")?",_--;return a}function vS(e,t){return"*"===e?t:"?"===e?"[^/]":"\\"+e}function bS(e,t,n,r,i){e=Vo(e);const o=Jo(i=Vo(i),e);return{includeFilePatterns:P(mS(n,o,"files"),e=>`^${e}$`),includeFilePattern:fS(n,o,"files"),includeDirectoryPattern:fS(n,o,"directories"),excludePattern:fS(t,o,"exclude"),basePaths:SS(e,n,r)}}function xS(e,t){return new RegExp(e,t?"":"i")}function kS(e,t,n,r,i,o,a,s,c){e=Vo(e),o=Vo(o);const l=bS(e,n,r,i,o),_=l.includeFilePatterns&&l.includeFilePatterns.map(e=>xS(e,i)),u=l.includeDirectoryPattern&&xS(l.includeDirectoryPattern,i),d=l.excludePattern&&xS(l.excludePattern,i),p=_?_.map(()=>[]):[[]],f=new Map,m=Ht(i);for(const e of l.basePaths)g(e,Jo(o,e),a);return O(p);function g(e,n,r){const i=m(c(n));if(f.has(i))return;f.set(i,!0);const{files:o,directories:a}=s(e);for(const r of de(o,Nt)){const i=Jo(e,r),o=Jo(n,r);if((!t||No(i,t))&&(!d||!d.test(o)))if(_){const e=S(_,e=>e.test(o));-1!==e&&p[e].push(i)}else p[0].push(i)}if(void 0===r||0!==--r)for(const t of de(a,Nt)){const i=Jo(e,t),o=Jo(n,t);u&&!u.test(o)||d&&d.test(o)||g(i,o,r)}}}function SS(e,t,n){const r=[e];if(t){const i=[];for(const n of t){const t=bo(n)?n:Vo(Jo(e,n));i.push(TS(t))}i.sort(Dt(!n));for(const t of i)b(r,r=>!ia(r,t,e,!n))&&r.push(t)}return r}function TS(e){const t=w(e,cS);return t<0?Co(e)?Ko(Ao(e)):e:e.substring(0,e.lastIndexOf(fo,t))}function CS(e,t){return t||wS(e)||3}function wS(e){switch(e.substr(e.lastIndexOf(".")).toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}var NS=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]],DS=O(NS),FS=[...NS,[".json"]],ES=[".d.ts",".d.cts",".d.mts",".cts",".mts",".ts",".tsx"],PS=O([[".js",".jsx"],[".mjs"],[".cjs"]]),AS=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]],IS=[...AS,[".json"]],OS=[".d.ts",".d.cts",".d.mts"],LS=[".ts",".cts",".mts",".tsx"],jS=[".mts",".d.mts",".mjs",".cts",".d.cts",".cjs"];function MS(e,t){const n=e&&Mk(e);if(!t||0===t.length)return n?AS:NS;const r=n?AS:NS,i=O(r);return[...r,...J(t,e=>{return 7===e.scriptKind||n&&(1===(t=e.scriptKind)||2===t)&&!i.includes(e.extension)?[e.extension]:void 0;var t})]}function RS(e,t){return e&&Ak(e)?t===AS?IS:t===NS?FS:[...t,[".json"]]:t}function BS(e){return H(PS,t=>wo(e,t))}function JS(e){return H(DS,t=>wo(e,t))}function zS(e){return H(LS,t=>wo(e,t))&&!vO(e)}var qS=(e=>(e[e.Minimal=0]="Minimal",e[e.Index=1]="Index",e[e.JsExtension=2]="JsExtension",e[e.TsExtension=3]="TsExtension",e))(qS||{});function US(e,t,n,r){const i=Ck(n),o=3<=i&&i<=99;return"js"===e||99===t&&o?KR(n)&&2!==a()?3:2:"minimal"===e?0:"index"===e?1:KR(n)?a():r&&function({imports:e},t=nn(BS,JS)){return m(e,({text:e})=>So(e)&&!No(e,jS)?t(e):void 0)||!1}(r)?2:0;function a(){let e=!1;const i=(null==r?void 0:r.imports.length)?r.imports:r&&Im(r)?function(e){let t,n=0;for(const r of e.statements){if(n>3)break;Vm(r)?t=G(t,r.declarationList.declarations.map(e=>e.initializer)):YF(r)&&Bm(r.expression,!0)?t=ae(t,r.expression):n++}return t||_}(r).map(e=>e.arguments[0]):_;for(const a of i)if(So(a.text)){if(o&&1===t&&99===SV(r,a,n))continue;if(No(a.text,jS))continue;if(JS(a.text))return 3;BS(a.text)&&(e=!0)}return e?2:0}}function VS(e,t,n){if(!e)return!1;const r=MS(t,n);for(const n of O(RS(t,r)))if(wo(e,n))return!0;return!1}function WS(e){const t=e.match(/\//g);return t?t.length:0}function $S(e,t){return xt(WS(e),WS(t))}var HS=[".d.ts",".d.mts",".d.cts",".mjs",".mts",".cjs",".cts",".ts",".js",".tsx",".jsx",".json"];function KS(e){for(const t of HS){const n=GS(e,t);if(void 0!==n)return n}return e}function GS(e,t){return wo(e,t)?XS(e,t):void 0}function XS(e,t){return e.substring(0,e.length-t.length)}function QS(e,t){return Qo(e,t,HS,!1)}function YS(e){const t=e.indexOf("*");return-1===t?e:-1!==e.indexOf("*",t+1)?void 0:{prefix:e.substr(0,t),suffix:e.substr(t+1)}}var ZS=new WeakMap;function eT(e){let t,n,r=ZS.get(e);if(void 0!==r)return r;const i=Ae(e);for(const e of i){const r=YS(e);void 0!==r&&("string"==typeof r?(t??(t=new Set)).add(r):(n??(n=[])).push(r))}return ZS.set(e,r={matchableStringSet:t,patterns:n}),r}function tT(e){return!(e>=0)}function nT(e){return".ts"===e||".tsx"===e||".d.ts"===e||".cts"===e||".mts"===e||".d.mts"===e||".d.cts"===e||Qt(e,".d.")&&Bt(e,".ts")}function rT(e){return nT(e)||".json"===e}function iT(e){const t=aT(e);return void 0!==t?t:pn.fail(`File ${e} has unknown extension.`)}function oT(e){return void 0!==aT(e)}function aT(e){return x(HS,t=>wo(e,t))}function sT(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs}var cT={files:_,directories:_};function lT(e,t){const{matchableStringSet:n,patterns:r}=e;return(null==n?void 0:n.has(t))?t:void 0!==r&&0!==r.length?Xt(r,e=>e,t):void 0}function _T(e,t){const n=e.indexOf(t);return pn.assert(-1!==n),e.slice(n)}function uT(e,...t){return t.length?(e.relatedInformation||(e.relatedInformation=[]),pn.assert(e.relatedInformation!==_,"Diagnostic had empty array singleton for related info, but is still being constructed!"),e.relatedInformation.push(...t),e):e}function dT(e,t){pn.assert(0!==e.length);let n=t(e[0]),r=n;for(let i=1;ir&&(r=o)}return{min:n,max:r}}function pT(e){return{pos:Wd(e),end:e.end}}function fT(e,t){return{pos:t.pos-1,end:Math.min(e.text.length,ts(e.text,t.end)+1)}}function mT(e,t,n){return hT(e,t,n,!1)}function gT(e,t,n){return hT(e,t,n,!0)}function hT(e,t,n,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||!r&&t.noCheck||n.isSourceOfProjectReferenceRedirect(e.fileName)||!yT(e,t)}function yT(e,t){if(e.checkJsDirective&&!1===e.checkJsDirective.enabled)return!1;if(3===e.scriptKind||4===e.scriptKind||5===e.scriptKind)return!0;const n=(1===e.scriptKind||2===e.scriptKind)&&sT(e,t);return Cd(e,t.checkJs)||n||7===e.scriptKind}function vT(e,t){return e===t||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&Re(e,t,vT)}function bT(e){let t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:const n=e.length-1;let r=0;for(;48===e.charCodeAt(r);)r++;return e.slice(r,n)||"0"}const n=e.length-1,r=(n-2)*t,i=new Uint16Array((r>>>4)+(15&r?1:0));for(let r=n-1,o=0;r>=2;r--,o+=t){const t=o>>>4,n=e.charCodeAt(r),a=(n<=57?n-48:10+n-(n<=70?65:97))<<(15&o);i[t]|=a;const s=a>>>16;s&&(i[t+1]|=s)}let o="",a=i.length-1,s=!0;for(;s;){let e=0;s=!1;for(let t=a;t>=0;t--){const n=e<<16|i[t],r=n/10|0;i[t]=r,e=n-10*r,r&&!s&&(a=t,s=!0)}o=e+o}return o}function xT({negative:e,base10Value:t}){return(e&&"0"!==t?"-":"")+t}function kT(e){if(TT(e,!1))return ST(e)}function ST(e){const t=e.startsWith("-");return{negative:t,base10Value:bT(`${t?e.slice(1):e}n`)}}function TT(e,t){if(""===e)return!1;const n=bs(99,!1);let r=!0;n.setOnError(()=>r=!1),n.setText(e+"n");let i=n.scan();const o=41===i;o&&(i=n.scan());const a=n.getTokenFlags();return r&&10===i&&n.getTokenEnd()===e.length+1&&!(512&a)&&(!t||e===xT({negative:o,base10Value:bT(n.getTokenValue())}))}function CT(e){return!!(33554432&e.flags)||Mm(e)||wm(e)||function(e){if(80!==e.kind)return!1;const t=mc(e.parent,e=>{switch(e.kind){case 299:return!0;case 212:case 234:return!1;default:return"quit"}});return 119===(null==t?void 0:t.token)||265===(null==t?void 0:t.parent.kind)}(e)||function(e){for(;80===e.kind||212===e.kind;)e=e.parent;if(168!==e.kind)return!1;if(Av(e.parent,64))return!0;const t=e.parent.parent.kind;return 265===t||188===t}(e)||!(Tm(e)||function(e){return uD(e)&&lP(e.parent)&&e.parent.name===e}(e))}function wT(e){return UD(e)&&uD(e.typeName)}function NT(e,t=ht){if(e.length<2)return!0;const n=e[0];for(let r=1,i=e.length;re.includes(t))}function BT(e){if(!e.parent)return;switch(e.kind){case 169:const{parent:t}=e;return 196===t.kind?void 0:t.typeParameters;case 170:return e.parent.parameters;case 205:case 240:return e.parent.templateSpans;case 171:{const{parent:t}=e;return PI(t)?t.modifiers:void 0}case 299:return e.parent.heritageClauses}const{parent:t}=e;if(Fu(e))return FP(e.parent)?void 0:e.parent.tags;switch(t.kind){case 188:case 265:return x_(e)?t.members:void 0;case 193:case 194:return t.types;case 190:case 210:case 357:case 276:case 280:return t.elements;case 211:case 293:return t.properties;case 214:case 215:return T_(e)?t.typeArguments:t.expression===e?void 0:t.arguments;case 285:case 289:return xu(e)?t.children:void 0;case 287:case 286:return T_(e)?t.typeArguments:void 0;case 242:case 297:case 298:case 269:case 308:return t.statements;case 270:return t.clauses;case 264:case 232:return f_(e)?t.members:void 0;case 267:return uP(e)?t.members:void 0}}function JT(e){if(!e.typeParameters){if(H(e.parameters,e=>!yv(e)))return!0;if(220!==e.kind){const t=ge(e.parameters);if(!t||!dv(t))return!0}}return!1}function zT(e){return"Infinity"===e||"-Infinity"===e||"NaN"===e}function qT(e){return 261===e.kind&&300===e.parent.kind}function UT(e){return 219===e.kind||220===e.kind}function VT(e){return e.replace(/\$/g,()=>"\\$")}function WT(e){return(+e).toString()===e}function $T(e,t,n,r,i){const o=i&&"new"===e;return!o&&vs(e,t)?bw.createIdentifier(e):!r&&!o&&WT(e)&&+e>=0?bw.createNumericLiteral(+e):bw.createStringLiteral(e,!!n)}function HT(e){return!!(262144&e.flags&&e.isThisType)}function KT(e){let t,n=0,r=0,i=0,o=0;var a;(a=t||(t={}))[a.BeforeNodeModules=0]="BeforeNodeModules",a[a.NodeModules=1]="NodeModules",a[a.Scope=2]="Scope",a[a.PackageContent=3]="PackageContent";let s=0,c=0,l=0;for(;c>=0;)switch(s=c,c=e.indexOf("/",s+1),l){case 0:e.indexOf(oR,s)===s&&(n=s,r=c,l=1);break;case 1:case 2:1===l&&"@"===e.charAt(s+1)?l=2:(i=c,l=3);break;case 3:l=e.indexOf(oR,s)===s?1:3}return o=s,l>1?{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:r,packageRootIndex:i,fileNameIndex:o}:void 0}function GT(e){switch(e.kind){case 169:case 264:case 265:case 266:case 267:case 347:case 339:case 341:return!0;case 274:return 156===e.phaseModifier;case 277:return 156===e.parent.parent.phaseModifier;case 282:return e.parent.parent.isTypeOnly;default:return!1}}function XT(e){return bE(e)||XF(e)||gE(e)||hE(e)||yE(e)||GT(e)||xE(e)&&!yp(e)&&!hp(e)}function QT(e){if(!Pl(e))return!1;const{isBracketed:t,typeExpression:n}=e;return t||!!n&&317===n.type.kind}function YT(e,t){if(0===e.length)return!1;const n=e.charCodeAt(0);return 35===n?e.length>1&&hs(e.charCodeAt(1),t):hs(n,t)}function ZT(e){var t;return 0===(null==(t=Yw(e))?void 0:t.kind)}function eC(e){return Om(e)&&(e.type&&317===e.type.kind||Oc(e).some(QT))}function tC(e){switch(e.kind){case 173:case 172:return!!e.questionToken;case 170:return!!e.questionToken||eC(e);case 349:case 342:return QT(e);default:return!1}}function nC(e){const t=e.kind;return(212===t||213===t)&&qF(e.expression)}function rC(e){return Om(e)&&SF(e)&&Au(e)&&!!il(e)}function iC(e){return pn.checkDefined(oC(e))}function oC(e){const t=il(e);return t&&t.typeExpression&&t.typeExpression.type}function aC(e){return uD(e)?e.escapedText:lC(e)}function sC(e){return uD(e)?bc(e):_C(e)}function cC(e){const t=e.kind;return 80===t||296===t}function lC(e){return`${e.namespace.escapedText}:${bc(e.name)}`}function _C(e){return`${bc(e.namespace)}:${bc(e.name)}`}function uC(e){return uD(e)?bc(e):_C(e)}function dC(e){return!!(8576&e.flags)}function pC(e){return 8192&e.flags?e.escapedName:384&e.flags?yc(""+e.value):pn.fail()}function fC(e){return!!e&&(hF(e)||yF(e)||AF(e))}function mC(e){return void 0!==e&&!!wV(e.attributes)}var gC=String.prototype.replace;function hC(e,t){return gC.call(e,"*",t)}function yC(e){return uD(e.name)?e.name.escapedText:yc(e.name.text)}function vC(e){switch(e.kind){case 169:case 170:case 173:case 172:case 186:case 185:case 180:case 181:case 182:case 175:case 174:case 176:case 177:case 178:case 179:case 184:case 183:case 187:case 188:case 189:case 190:case 193:case 194:case 197:case 191:case 192:case 198:case 199:case 195:case 196:case 204:case 206:case 203:case 329:case 330:case 347:case 339:case 341:case 346:case 345:case 325:case 326:case 327:case 342:case 349:case 318:case 316:case 315:case 313:case 314:case 323:case 319:case 310:case 334:case 336:case 335:case 351:case 344:case 200:case 201:case 263:case 242:case 269:case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 251:case 252:case 253:case 254:case 255:case 256:case 257:case 258:case 259:case 261:case 209:case 264:case 265:case 266:case 267:case 268:case 273:case 272:case 279:case 278:case 243:case 260:case 283:return!0}return!1}function bC(e,t=!1,n=!1,r=!1){return{value:e,isSyntacticallyString:t,resolvedOtherFiles:n,hasExternalReferences:r}}function xC({evaluateElementAccessExpression:e,evaluateEntityNameExpression:t}){function n(r,i){let o=!1,a=!1,s=!1;switch((r=_h(r)).kind){case 225:const c=n(r.operand,i);if(a=c.resolvedOtherFiles,s=c.hasExternalReferences,"number"==typeof c.value)switch(r.operator){case 40:return bC(c.value,o,a,s);case 41:return bC(-c.value,o,a,s);case 55:return bC(~c.value,o,a,s)}break;case 227:{const e=n(r.left,i),t=n(r.right,i);if(o=(e.isSyntacticallyString||t.isSyntacticallyString)&&40===r.operatorToken.kind,a=e.resolvedOtherFiles||t.resolvedOtherFiles,s=e.hasExternalReferences||t.hasExternalReferences,"number"==typeof e.value&&"number"==typeof t.value)switch(r.operatorToken.kind){case 52:return bC(e.value|t.value,o,a,s);case 51:return bC(e.value&t.value,o,a,s);case 49:return bC(e.value>>t.value,o,a,s);case 50:return bC(e.value>>>t.value,o,a,s);case 48:return bC(e.value<=2)break;case 175:case 177:case 178:case 179:case 263:if(3&p&&"arguments"===I){w=n;break e}break;case 219:if(3&p&&"arguments"===I){w=n;break e}if(16&p){const e=s.name;if(e&&I===e.escapedText){w=s.symbol;break e}}break;case 171:s.parent&&170===s.parent.kind&&(s=s.parent),s.parent&&(f_(s.parent)||264===s.parent.kind)&&(s=s.parent);break;case 347:case 339:case 341:case 352:const o=Gg(s);o&&(s=o.parent);break;case 170:N&&(N===s.initializer||N===s.name&&w_(N))&&(E||(E=s));break;case 209:N&&(N===s.initializer||N===s.name&&w_(N))&&ty(s)&&!E&&(E=s);break;case 196:if(262144&p){const e=s.typeParameter.name;if(e&&I===e.escapedText){w=s.typeParameter.symbol;break e}}break;case 282:N&&N===s.propertyName&&s.parent.parent.moduleSpecifier&&(s=s.parent.parent.parent)}y(s,N)&&(D=s),N=s,s=KP(s)?Vg(s)||s.parent:(VP(s)||WP(s))&&$g(s)||s.parent}!b||!w||D&&w===D.symbol||(w.isReferenced|=p);if(!w){if(N&&(pn.assertNode(N,dP),N.commonJsModuleIndicator&&"exports"===I&&p&N.symbol.flags))return N.symbol;x||(w=a(o,I,p))}if(!w&&C&&Om(C)&&C.parent&&Bm(C.parent,!1))return t;if(f){if(F&&l(C,I,F,w))return;w?u(C,w,p,N,E,A):_(C,c,p,f)}return w};function g(t,n,r){const i=Sk(e),o=n;if(FD(r)&&o.body&&t.valueDeclaration&&t.valueDeclaration.pos>=o.body.pos&&t.valueDeclaration.end<=o.body.end&&i>=2){let e=c(o);return void 0===e&&(e=p(o.parameters,function(e){return a(e.name)||!!e.initializer&&a(e.initializer)})||!1,s(o,e)),!e}return!1;function a(e){switch(e.kind){case 220:case 219:case 263:case 177:return!1;case 175:case 178:case 179:case 304:return a(e.name);case 173:return Ov(e)?!f:a(e.name);default:return Cl(e)||xl(e)?i<7:fF(e)&&e.dotDotDotToken&&dF(e.parent)?i<4:!T_(e)&&(iO(e,a)||!1)}}}function h(e,t){return 220!==e.kind&&219!==e.kind?$D(e)||(l_(e)||173===e.kind&&!Iv(e))&&(!t||t!==e.name):(!t||t!==e.name)&&(!(!e.asteriskToken&&!Av(e,1024))||!lm(e))}function y(e,t){switch(e.kind){case 170:return!!t&&t===e.name;case 263:case 264:case 265:case 267:case 266:case 268:return!0;default:return!1}}function v(e,t){if(e.declarations)for(const n of e.declarations)if(169===n.kind){if((KP(n.parent)?Kg(n.parent):n.parent)===t)return!(KP(n.parent)&&x(n.parent.parent.tags,Ag))}return!1}}function CC(e,t=!0){switch(pn.type(e),e.kind){case 112:case 97:case 9:case 11:case 15:return!0;case 10:return t;case 225:return 41===e.operator?$N(e.operand)||t&&HN(e.operand):40===e.operator&&$N(e.operand);default:return!1}}function wC(e){for(;218===e.kind;)e=e.expression;return e}function NC(e){switch(pn.type(e),e.kind){case 170:case 172:case 173:case 209:case 212:case 213:case 227:case 261:case 278:case 304:case 305:case 342:case 349:return!0;default:return!1}}function DC(e){const t=mc(e,wE);return!!t&&!t.importClause}var FC=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","test/mock_loader","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"],EC=new Set(FC),PC=new Set(["node:sea","node:sqlite","node:test","node:test/reporters"]),AC=new Set([...FC,...FC.map(e=>`node:${e}`),...PC]);function IC(e,t,n,r){const i=Om(e),o=/import|require/g;for(;null!==o.exec(e.text);){const a=OC(e,o.lastIndex,t);if(i&&Bm(a,n))r(a,a.arguments[0]);else if(ff(a)&&a.arguments.length>=1&&(!n||Ju(a.arguments[0])))r(a,a.arguments[0]);else if(t&&gf(a))r(a,a.argument.literal);else if(t&&tA(a)){const e=wg(a);e&&KN(e)&&e.text&&r(a,e)}}}function OC(e,t,n){const r=Om(e);let i=e;const o=e=>{if(e.pos<=t&&(te&&t(e))}function BC(e,t,n,r){let i;return function e(t,o,a){if(r){const e=r(t,a);if(e)return e}let s;return p(o,(e,t)=>{if(e&&(null==i?void 0:i.has(e.sourceFile.path)))return void(s??(s=new Set)).add(e);const r=n(e,a,t);if(r||!e)return r;(i||(i=new Set)).add(e.sourceFile.path)})||p(o,t=>t&&!(null==s?void 0:s.has(t))?e(t.commandLine.projectReferences,t.references,t):void 0)}(e,t,void 0)}function JC(e,t,n){return e&&(r=n,Kf(e,t,e=>mF(e.initializer)?x(e.initializer.elements,e=>KN(e)&&e.text===r):void 0));var r}function zC(e,t,n){return qC(e,t,e=>KN(e.initializer)&&e.initializer.text===n?e.initializer:void 0)}function qC(e,t,n){return Kf(e,t,n)}function UC(e,t=!0){const n=e&&WC(e);return n&&!t&&KC(n),OT(n,!1)}function VC(e,t,n){let r=n(e);return r?kw(r,e):r=WC(e,n),r&&!t&&KC(r),r}function WC(e,t){const n=t?e=>VC(e,!0,t):UC,r=EJ(e,n,void 0,t?e=>e&&HC(e,!0,t):e=>e&&$C(e),n);if(r===e){return FI(KN(e)?kw(bw.createStringLiteralFromNode(e),e):$N(e)?kw(bw.createNumericLiteral(e.text,e.numericLiteralFlags),e):bw.cloneNode(e),e)}return r.parent=void 0,r}function $C(e,t=!0){if(e){const n=bw.createNodeArray(e.map(e=>UC(e,t)),e.hasTrailingComma);return FI(n,e),n}return e}function HC(e,t,n){return bw.createNodeArray(e.map(e=>VC(e,t,n)),e.hasTrailingComma)}function KC(e){GC(e),XC(e)}function GC(e){QC(e,1024,YC)}function XC(e){QC(e,2048,Tx)}function QC(e,t,n){Nw(e,t);const r=n(e);r&&QC(r,t,n)}function YC(e){return iO(e,e=>e)}function ZC(){let e,t,n,r,i;return{createBaseSourceFileNode:function(e){return new(i||(i=qx.getSourceFileConstructor()))(e,-1,-1)},createBaseIdentifierNode:function(e){return new(n||(n=qx.getIdentifierConstructor()))(e,-1,-1)},createBasePrivateIdentifierNode:function(e){return new(r||(r=qx.getPrivateIdentifierConstructor()))(e,-1,-1)},createBaseTokenNode:function(e){return new(t||(t=qx.getTokenConstructor()))(e,-1,-1)},createBaseNode:function(t){return new(e||(e=qx.getNodeConstructor()))(t,-1,-1)}}}function ew(e){let t,n;return{getParenthesizeLeftSideOfBinaryForOperator:function(e){t||(t=new Map);let n=t.get(e);n||(n=t=>o(e,t),t.set(e,n));return n},getParenthesizeRightSideOfBinaryForOperator:function(e){n||(n=new Map);let t=n.get(e);t||(t=t=>a(e,void 0,t),n.set(e,t));return t},parenthesizeLeftSideOfBinary:o,parenthesizeRightSideOfBinary:a,parenthesizeExpressionOfComputedPropertyName:function(t){return DA(t)?e.createParenthesizedExpression(t):t},parenthesizeConditionOfConditionalExpression:function(t){const n=uy(228,58),r=Nl(t);if(1!==xt(cy(r),n))return e.createParenthesizedExpression(t);return t},parenthesizeBranchOfConditionalExpression:function(t){return DA(Nl(t))?e.createParenthesizedExpression(t):t},parenthesizeExpressionOfExportDefault:function(t){const n=Nl(t);let r=DA(n);if(!r)switch(Ix(n,!1).kind){case 232:case 219:r=!0}return r?e.createParenthesizedExpression(t):t},parenthesizeExpressionOfNew:function(t){const n=Ix(t,!0);switch(n.kind){case 214:return e.createParenthesizedExpression(t);case 215:return n.arguments?t:e.createParenthesizedExpression(t)}return s(t)},parenthesizeLeftSideOfAccess:s,parenthesizeOperandOfPostfixUnary:function(t){return q_(t)?t:FI(e.createParenthesizedExpression(t),t)},parenthesizeOperandOfPrefixUnary:function(t){return V_(t)?t:FI(e.createParenthesizedExpression(t),t)},parenthesizeExpressionsOfCommaDelimitedList:function(t){const n=I(t,c);return FI(e.createNodeArray(n,t.hasTrailingComma),t)},parenthesizeExpressionForDisallowedComma:c,parenthesizeExpressionOfExpressionStatement:function(t){const n=Nl(t);if(vF(n)){const r=n.expression,i=Nl(r).kind;if(219===i||220===i){const i=e.updateCallExpression(n,FI(e.createParenthesizedExpression(r),r),n.typeArguments,n.arguments);return e.restoreOuterExpressions(t,i,8)}}const r=Ix(n,!1).kind;if(211===r||219===r)return FI(e.createParenthesizedExpression(t),t);return t},parenthesizeConciseBodyOfArrowFunction:function(t){if(!GF(t)&&(DA(t)||211===Ix(t,!1).kind))return FI(e.createParenthesizedExpression(t),t);return t},parenthesizeCheckTypeOfConditionalType:l,parenthesizeExtendsTypeOfConditionalType:function(t){if(195===t.kind)return e.createParenthesizedType(t);return t},parenthesizeConstituentTypesOfUnionType:function(t){return e.createNodeArray(I(t,_))},parenthesizeConstituentTypeOfUnionType:_,parenthesizeConstituentTypesOfIntersectionType:function(t){return e.createNodeArray(I(t,u))},parenthesizeConstituentTypeOfIntersectionType:u,parenthesizeOperandOfTypeOperator:d,parenthesizeOperandOfReadonlyTypeOperator:function(t){if(199===t.kind)return e.createParenthesizedType(t);return d(t)},parenthesizeNonArrayTypeOfPostfixType:p,parenthesizeElementTypesOfTupleType:function(t){return e.createNodeArray(I(t,f))},parenthesizeElementTypeOfTupleType:f,parenthesizeTypeOfOptionalType:function(t){return m(t)?e.createParenthesizedType(t):p(t)},parenthesizeTypeArguments:function(t){if(H(t))return e.createNodeArray(I(t,h))},parenthesizeLeadingTypeArgument:g};function r(e){if(jl((e=Nl(e)).kind))return e.kind;if(227===e.kind&&40===e.operatorToken.kind){if(void 0!==e.cachedLiteralKind)return e.cachedLiteralKind;const t=r(e.left),n=jl(t)&&t===r(e.right)?t:0;return e.cachedLiteralKind=n,n}return 0}function i(t,n,i,o){return 218===Nl(n).kind?n:function(e,t,n,i){const o=uy(227,e),a=sy(227,e),s=Nl(t);if(!n&&220===t.kind&&o>3)return!0;switch(xt(cy(s),o)){case-1:return!(!n&&1===a&&230===t.kind);case 1:return!1;case 0:if(n)return 1===a;if(AF(s)&&s.operatorToken.kind===e){if(function(e){return 42===e||52===e||51===e||53===e||28===e}(e))return!1;if(40===e){const e=i?r(i):0;if(jl(e)&&e===r(s))return!1}}return 0===ay(s)}}(t,n,i,o)?e.createParenthesizedExpression(n):n}function o(e,t){return i(e,t,!0)}function a(e,t,n){return i(e,n,!1,t)}function s(t,n){const r=Nl(t);return!q_(r)||215===r.kind&&!r.arguments||!n&&xl(r)?FI(e.createParenthesizedExpression(t),t):t}function c(t){return cy(Nl(t))>uy(227,28)?t:FI(e.createParenthesizedExpression(t),t)}function l(t){switch(t.kind){case 185:case 186:case 195:return e.createParenthesizedType(t)}return t}function _(t){switch(t.kind){case 193:case 194:return e.createParenthesizedType(t)}return l(t)}function u(t){switch(t.kind){case 193:case 194:return e.createParenthesizedType(t)}return _(t)}function d(t){return 194===t.kind?e.createParenthesizedType(t):u(t)}function p(t){switch(t.kind){case 196:case 199:case 187:return e.createParenthesizedType(t)}return d(t)}function f(t){return m(t)?e.createParenthesizedType(t):t}function m(e){return kP(e)?e.postfix:XD(e)||VD(e)||WD(e)||oF(e)?m(e.type):tF(e)?m(e.falseType):ZD(e)||eF(e)?m(xe(e.types)):!!nF(e)&&(!!e.typeParameter.constraint&&m(e.typeParameter.constraint))}function g(t){return C_(t)&&t.typeParameters?e.createParenthesizedType(t):t}function h(e,t){return 0===t?g(e):e}}var tw={getParenthesizeLeftSideOfBinaryForOperator:e=>lt,getParenthesizeRightSideOfBinaryForOperator:e=>lt,parenthesizeLeftSideOfBinary:(e,t)=>t,parenthesizeRightSideOfBinary:(e,t,n)=>n,parenthesizeExpressionOfComputedPropertyName:lt,parenthesizeConditionOfConditionalExpression:lt,parenthesizeBranchOfConditionalExpression:lt,parenthesizeExpressionOfExportDefault:lt,parenthesizeExpressionOfNew:e=>it(e,q_),parenthesizeLeftSideOfAccess:e=>it(e,q_),parenthesizeOperandOfPostfixUnary:e=>it(e,q_),parenthesizeOperandOfPrefixUnary:e=>it(e,V_),parenthesizeExpressionsOfCommaDelimitedList:e=>it(e,Ll),parenthesizeExpressionForDisallowedComma:lt,parenthesizeExpressionOfExpressionStatement:lt,parenthesizeConciseBodyOfArrowFunction:lt,parenthesizeCheckTypeOfConditionalType:lt,parenthesizeExtendsTypeOfConditionalType:lt,parenthesizeConstituentTypesOfUnionType:e=>it(e,Ll),parenthesizeConstituentTypeOfUnionType:lt,parenthesizeConstituentTypesOfIntersectionType:e=>it(e,Ll),parenthesizeConstituentTypeOfIntersectionType:lt,parenthesizeOperandOfTypeOperator:lt,parenthesizeOperandOfReadonlyTypeOperator:lt,parenthesizeNonArrayTypeOfPostfixType:lt,parenthesizeElementTypesOfTupleType:e=>it(e,Ll),parenthesizeElementTypeOfTupleType:lt,parenthesizeTypeOfOptionalType:lt,parenthesizeTypeArguments:e=>e&&it(e,Ll),parenthesizeLeadingTypeArgument:lt};function nw(e){return{convertToFunctionBlock:function(t,n){if(GF(t))return t;const r=e.createReturnStatement(t);FI(r,t);const i=e.createBlock([r],n);return FI(i,t),i},convertToFunctionExpression:function(t){var n;if(!t.body)return pn.fail("Cannot convert a FunctionDeclaration without a body");const r=e.createFunctionExpression(null==(n=Ac(t))?void 0:n.filter(e=>!pD(e)&&!fD(e)),t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body);kw(r,t),FI(r,t),Ow(t)&&Lw(r,!0);return r},convertToClassExpression:function(t){var n;const r=e.createClassExpression(null==(n=t.modifiers)?void 0:n.filter(e=>!pD(e)&&!fD(e)),t.name,t.typeParameters,t.heritageClauses,t.members);kw(r,t),FI(r,t),Ow(t)&&Lw(r,!0);return r},convertToArrayAssignmentElement:t,convertToObjectAssignmentElement:n,convertToAssignmentPattern:r,convertToObjectAssignmentPattern:i,convertToArrayAssignmentPattern:o,convertToAssignmentElementTarget:a};function t(t){if(fF(t)){if(t.dotDotDotToken)return pn.assertNode(t.name,uD),kw(FI(e.createSpreadElement(t.name),t),t);const n=a(t.name);return t.initializer?kw(FI(e.createAssignment(n,t.initializer),t),t):n}return it(t,K_)}function n(t){if(fF(t)){if(t.dotDotDotToken)return pn.assertNode(t.name,uD),kw(FI(e.createSpreadAssignment(t.name),t),t);if(t.propertyName){const n=a(t.name);return kw(FI(e.createPropertyAssignment(t.propertyName,t.initializer?e.createAssignment(n,t.initializer):n),t),t)}return pn.assertNode(t.name,uD),kw(FI(e.createShorthandPropertyAssignment(t.name,t.initializer),t),t)}return it(t,S_)}function r(e){switch(e.kind){case 208:case 210:return o(e);case 207:case 211:return i(e)}}function i(t){return dF(t)?kw(FI(e.createObjectLiteralExpression(P(t.elements,n)),t),t):it(t,gF)}function o(n){return pF(n)?kw(FI(e.createArrayLiteralExpression(P(n.elements,t)),n),n):it(n,mF)}function a(e){return w_(e)?r(e):it(e,K_)}}var rw,iw={convertToFunctionBlock:pt,convertToFunctionExpression:pt,convertToClassExpression:pt,convertToArrayAssignmentElement:pt,convertToObjectAssignmentElement:pt,convertToAssignmentPattern:pt,convertToObjectAssignmentPattern:pt,convertToArrayAssignmentPattern:pt,convertToAssignmentElementTarget:pt},ow=0,aw=(e=>(e[e.None=0]="None",e[e.NoParenthesizerRules=1]="NoParenthesizerRules",e[e.NoNodeConverters=2]="NoNodeConverters",e[e.NoIndentationOnFreshPropertyAccess=4]="NoIndentationOnFreshPropertyAccess",e[e.NoOriginalNode=8]="NoOriginalNode",e))(aw||{}),sw=[];function cw(e){sw.push(e)}function lw(e,t){const n=8&e?lt:kw,r=ft(()=>1&e?tw:ew(v)),i=ft(()=>2&e?iw:nw(v)),o=mt(e=>(t,n)=>Ot(t,e,n)),a=mt(e=>t=>At(e,t)),s=mt(e=>t=>It(t,e)),c=mt(e=>()=>function(e){return k(e)}(e)),l=mt(e=>t=>dr(e,t)),u=mt(e=>(t,n)=>function(e,t,n){return t.type!==n?Oi(dr(e,n),t):t}(e,t,n)),d=mt(e=>(t,n)=>ur(e,t,n)),f=mt(e=>(t,n)=>function(e,t,n){return t.type!==n?Oi(ur(e,n,t.postfix),t):t}(e,t,n)),m=mt(e=>(t,n)=>Or(e,t,n)),g=mt(e=>(t,n,r)=>function(e,t,n=hr(t),r){return t.tagName!==n||t.comment!==r?Oi(Or(e,n,r),t):t}(e,t,n,r)),h=mt(e=>(t,n,r)=>Lr(e,t,n,r)),y=mt(e=>(t,n,r,i)=>function(e,t,n=hr(t),r,i){return t.tagName!==n||t.typeExpression!==r||t.comment!==i?Oi(Lr(e,n,r,i),t):t}(e,t,n,r,i)),v={get parenthesizer(){return r()},get converters(){return i()},baseFactory:t,flags:e,createNodeArray:x,createNumericLiteral:C,createBigIntLiteral:w,createStringLiteral:D,createStringLiteralFromNode:function(e){const t=N($h(e),void 0);return t.textSourceNode=e,t},createRegularExpressionLiteral:F,createLiteralLikeNode:function(e,t){switch(e){case 9:return C(t,0);case 10:return w(t);case 11:return D(t,void 0);case 12:return $r(t,!1);case 13:return $r(t,!0);case 14:return F(t);case 15:return zt(e,t,void 0,0)}},createIdentifier:A,createTempVariable:I,createLoopVariable:function(e){let t=2;e&&(t|=8);return P("",t,void 0,void 0)},createUniqueName:function(e,t=0,n,r){return pn.assert(!(7&t),"Argument out of range: flags"),pn.assert(32!=(48&t),"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),P(e,3|t,n,r)},getGeneratedNameForNode:O,createPrivateIdentifier:function(e){Qt(e,"#")||pn.fail("First character of private identifier must be #: "+e);return L(yc(e))},createUniquePrivateName:function(e,t,n){e&&!Qt(e,"#")&&pn.fail("First character of private identifier must be #: "+e);return j(e??"",8|(e?3:1),t,n)},getGeneratedPrivateNameForNode:function(e,t,n){const r=gl(e)?xI(!0,t,e,n,bc):`#generated@${_J(e)}`,i=j(r,4|(t||n?16:0),t,n);return i.original=e,i},createToken:B,createSuper:function(){return B(108)},createThis:J,createNull:z,createTrue:q,createFalse:U,createModifier:V,createModifiersFromModifierFlags:W,createQualifiedName:$,updateQualifiedName:function(e,t,n){return e.left!==t||e.right!==n?Oi($(t,n),e):e},createComputedPropertyName:K,updateComputedPropertyName:function(e,t){return e.expression!==t?Oi(K(t),e):e},createTypeParameterDeclaration:G,updateTypeParameterDeclaration:X,createParameterDeclaration:Q,updateParameterDeclaration:Y,createDecorator:Z,updateDecorator:function(e,t){return e.expression!==t?Oi(Z(t),e):e},createPropertySignature:ee,updatePropertySignature:te,createPropertyDeclaration:ne,updatePropertyDeclaration:re,createMethodSignature:ie,updateMethodSignature:oe,createMethodDeclaration:se,updateMethodDeclaration:ce,createConstructorDeclaration:_e,updateConstructorDeclaration:ue,createGetAccessorDeclaration:de,updateGetAccessorDeclaration:pe,createSetAccessorDeclaration:fe,updateSetAccessorDeclaration:me,createCallSignature:ge,updateCallSignature:function(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?T(ge(t,n,r),e):e},createConstructSignature:he,updateConstructSignature:function(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?T(he(t,n,r),e):e},createIndexSignature:ye,updateIndexSignature:ve,createClassStaticBlockDeclaration:le,updateClassStaticBlockDeclaration:function(e,t){return e.body!==t?function(e,t){e!==t&&(e.modifiers=t.modifiers);return Oi(e,t)}(le(t),e):e},createTemplateLiteralTypeSpan:xe,updateTemplateLiteralTypeSpan:function(e,t,n){return e.type!==t||e.literal!==n?Oi(xe(t,n),e):e},createKeywordTypeNode:function(e){return B(e)},createTypePredicateNode:Se,updateTypePredicateNode:function(e,t,n,r){return e.assertsModifier!==t||e.parameterName!==n||e.type!==r?Oi(Se(t,n,r),e):e},createTypeReferenceNode:Te,updateTypeReferenceNode:function(e,t,n){return e.typeName!==t||e.typeArguments!==n?Oi(Te(t,n),e):e},createFunctionTypeNode:Ce,updateFunctionTypeNode:function(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?function(e,t){e!==t&&(e.modifiers=t.modifiers);return T(e,t)}(Ce(t,n,r),e):e},createConstructorTypeNode:we,updateConstructorTypeNode:function(...e){return 5===e.length?Fe(...e):4===e.length?function(e,t,n,r){return Fe(e,e.modifiers,t,n,r)}(...e):pn.fail("Incorrect number of arguments specified.")},createTypeQueryNode:Pe,updateTypeQueryNode:function(e,t,n){return e.exprName!==t||e.typeArguments!==n?Oi(Pe(t,n),e):e},createTypeLiteralNode:Ae,updateTypeLiteralNode:function(e,t){return e.members!==t?Oi(Ae(t),e):e},createArrayTypeNode:Ie,updateArrayTypeNode:function(e,t){return e.elementType!==t?Oi(Ie(t),e):e},createTupleTypeNode:Oe,updateTupleTypeNode:function(e,t){return e.elements!==t?Oi(Oe(t),e):e},createNamedTupleMember:Le,updateNamedTupleMember:function(e,t,n,r,i){return e.dotDotDotToken!==t||e.name!==n||e.questionToken!==r||e.type!==i?Oi(Le(t,n,r,i),e):e},createOptionalTypeNode:je,updateOptionalTypeNode:function(e,t){return e.type!==t?Oi(je(t),e):e},createRestTypeNode:Me,updateRestTypeNode:function(e,t){return e.type!==t?Oi(Me(t),e):e},createUnionTypeNode:function(e){return Re(193,e,r().parenthesizeConstituentTypesOfUnionType)},updateUnionTypeNode:function(e,t){return Be(e,t,r().parenthesizeConstituentTypesOfUnionType)},createIntersectionTypeNode:function(e){return Re(194,e,r().parenthesizeConstituentTypesOfIntersectionType)},updateIntersectionTypeNode:function(e,t){return Be(e,t,r().parenthesizeConstituentTypesOfIntersectionType)},createConditionalTypeNode:Je,updateConditionalTypeNode:function(e,t,n,r,i){return e.checkType!==t||e.extendsType!==n||e.trueType!==r||e.falseType!==i?Oi(Je(t,n,r,i),e):e},createInferTypeNode:ze,updateInferTypeNode:function(e,t){return e.typeParameter!==t?Oi(ze(t),e):e},createImportTypeNode:Ue,updateImportTypeNode:function(e,t,n,r,i,o=e.isTypeOf){return e.argument!==t||e.attributes!==n||e.qualifier!==r||e.typeArguments!==i||e.isTypeOf!==o?Oi(Ue(t,n,r,i,o),e):e},createParenthesizedType:Ve,updateParenthesizedType:function(e,t){return e.type!==t?Oi(Ve(t),e):e},createThisTypeNode:function(){const e=k(198);return e.transformFlags=1,e},createTypeOperatorNode:We,updateTypeOperatorNode:function(e,t){return e.type!==t?Oi(We(e.operator,t),e):e},createIndexedAccessTypeNode:$e,updateIndexedAccessTypeNode:function(e,t,n){return e.objectType!==t||e.indexType!==n?Oi($e(t,n),e):e},createMappedTypeNode:He,updateMappedTypeNode:function(e,t,n,r,i,o,a){return e.readonlyToken!==t||e.typeParameter!==n||e.nameType!==r||e.questionToken!==i||e.type!==o||e.members!==a?Oi(He(t,n,r,i,o,a),e):e},createLiteralTypeNode:Ke,updateLiteralTypeNode:function(e,t){return e.literal!==t?Oi(Ke(t),e):e},createTemplateLiteralType:qe,updateTemplateLiteralType:function(e,t,n){return e.head!==t||e.templateSpans!==n?Oi(qe(t,n),e):e},createObjectBindingPattern:Ge,updateObjectBindingPattern:function(e,t){return e.elements!==t?Oi(Ge(t),e):e},createArrayBindingPattern:Xe,updateArrayBindingPattern:function(e,t){return e.elements!==t?Oi(Xe(t),e):e},createBindingElement:Qe,updateBindingElement:function(e,t,n,r,i){return e.propertyName!==n||e.dotDotDotToken!==t||e.name!==r||e.initializer!==i?Oi(Qe(t,n,r,i),e):e},createArrayLiteralExpression:Ye,updateArrayLiteralExpression:function(e,t){return e.elements!==t?Oi(Ye(t,e.multiLine),e):e},createObjectLiteralExpression:et,updateObjectLiteralExpression:function(e,t){return e.properties!==t?Oi(et(t,e.multiLine),e):e},createPropertyAccessExpression:4&e?(e,t)=>ww(nt(e,t),262144):nt,updatePropertyAccessExpression:function(e,t,n){if(yl(e))return ot(e,t,e.questionDotToken,it(n,uD));return e.expression!==t||e.name!==n?Oi(nt(t,n),e):e},createPropertyAccessChain:4&e?(e,t,n)=>ww(rt(e,t,n),262144):rt,updatePropertyAccessChain:ot,createElementAccessExpression:ct,updateElementAccessExpression:function(e,t,n){if(vl(e))return ut(e,t,e.questionDotToken,n);return e.expression!==t||e.argumentExpression!==n?Oi(ct(t,n),e):e},createElementAccessChain:_t,updateElementAccessChain:ut,createCallExpression:pt,updateCallExpression:function(e,t,n,r){if(bl(e))return ht(e,t,e.questionDotToken,n,r);return e.expression!==t||e.typeArguments!==n||e.arguments!==r?Oi(pt(t,n,r),e):e},createCallChain:gt,updateCallChain:ht,createNewExpression:yt,updateNewExpression:function(e,t,n,r){return e.expression!==t||e.typeArguments!==n||e.arguments!==r?Oi(yt(t,n,r),e):e},createTaggedTemplateExpression:vt,updateTaggedTemplateExpression:function(e,t,n,r){return e.tag!==t||e.typeArguments!==n||e.template!==r?Oi(vt(t,n,r),e):e},createTypeAssertion:bt,updateTypeAssertion:xt,createParenthesizedExpression:kt,updateParenthesizedExpression:St,createFunctionExpression:Tt,updateFunctionExpression:Ct,createArrowFunction:wt,updateArrowFunction:Nt,createDeleteExpression:Dt,updateDeleteExpression:function(e,t){return e.expression!==t?Oi(Dt(t),e):e},createTypeOfExpression:Ft,updateTypeOfExpression:function(e,t){return e.expression!==t?Oi(Ft(t),e):e},createVoidExpression:Et,updateVoidExpression:function(e,t){return e.expression!==t?Oi(Et(t),e):e},createAwaitExpression:Pt,updateAwaitExpression:function(e,t){return e.expression!==t?Oi(Pt(t),e):e},createPrefixUnaryExpression:At,updatePrefixUnaryExpression:function(e,t){return e.operand!==t?Oi(At(e.operator,t),e):e},createPostfixUnaryExpression:It,updatePostfixUnaryExpression:function(e,t){return e.operand!==t?Oi(It(t,e.operator),e):e},createBinaryExpression:Ot,updateBinaryExpression:function(e,t,n,r){return e.left!==t||e.operatorToken!==n||e.right!==r?Oi(Ot(t,n,r),e):e},createConditionalExpression:jt,updateConditionalExpression:function(e,t,n,r,i,o){return e.condition!==t||e.questionToken!==n||e.whenTrue!==r||e.colonToken!==i||e.whenFalse!==o?Oi(jt(t,n,r,i,o),e):e},createTemplateExpression:Mt,updateTemplateExpression:function(e,t,n){return e.head!==t||e.templateSpans!==n?Oi(Mt(t,n),e):e},createTemplateHead:function(e,t,n){return zt(16,e=Rt(16,e,t,n),t,n)},createTemplateMiddle:function(e,t,n){return zt(17,e=Rt(16,e,t,n),t,n)},createTemplateTail:function(e,t,n){return zt(18,e=Rt(16,e,t,n),t,n)},createNoSubstitutionTemplateLiteral:function(e,t,n){return Jt(15,e=Rt(16,e,t,n),t,n)},createTemplateLiteralLikeNode:zt,createYieldExpression:qt,updateYieldExpression:function(e,t,n){return e.expression!==n||e.asteriskToken!==t?Oi(qt(t,n),e):e},createSpreadElement:Ut,updateSpreadElement:function(e,t){return e.expression!==t?Oi(Ut(t),e):e},createClassExpression:Vt,updateClassExpression:Wt,createOmittedExpression:function(){return k(233)},createExpressionWithTypeArguments:$t,updateExpressionWithTypeArguments:Ht,createAsExpression:Kt,updateAsExpression:Gt,createNonNullExpression:Xt,updateNonNullExpression:Yt,createSatisfiesExpression:Zt,updateSatisfiesExpression:en,createNonNullChain:tn,updateNonNullChain:nn,createMetaProperty:rn,updateMetaProperty:function(e,t){return e.name!==t?Oi(rn(e.keywordToken,t),e):e},createTemplateSpan:on,updateTemplateSpan:function(e,t,n){return e.expression!==t||e.literal!==n?Oi(on(t,n),e):e},createSemicolonClassElement:function(){const e=k(241);return e.transformFlags|=1024,e},createBlock:an,updateBlock:function(e,t){return e.statements!==t?Oi(an(t,e.multiLine),e):e},createVariableStatement:sn,updateVariableStatement:cn,createEmptyStatement:ln,createExpressionStatement:_n,updateExpressionStatement:function(e,t){return e.expression!==t?Oi(_n(t),e):e},createIfStatement:un,updateIfStatement:function(e,t,n,r){return e.expression!==t||e.thenStatement!==n||e.elseStatement!==r?Oi(un(t,n,r),e):e},createDoStatement:dn,updateDoStatement:function(e,t,n){return e.statement!==t||e.expression!==n?Oi(dn(t,n),e):e},createWhileStatement:fn,updateWhileStatement:function(e,t,n){return e.expression!==t||e.statement!==n?Oi(fn(t,n),e):e},createForStatement:mn,updateForStatement:function(e,t,n,r,i){return e.initializer!==t||e.condition!==n||e.incrementor!==r||e.statement!==i?Oi(mn(t,n,r,i),e):e},createForInStatement:gn,updateForInStatement:function(e,t,n,r){return e.initializer!==t||e.expression!==n||e.statement!==r?Oi(gn(t,n,r),e):e},createForOfStatement:hn,updateForOfStatement:function(e,t,n,r,i){return e.awaitModifier!==t||e.initializer!==n||e.expression!==r||e.statement!==i?Oi(hn(t,n,r,i),e):e},createContinueStatement:yn,updateContinueStatement:function(e,t){return e.label!==t?Oi(yn(t),e):e},createBreakStatement:vn,updateBreakStatement:function(e,t){return e.label!==t?Oi(vn(t),e):e},createReturnStatement:bn,updateReturnStatement:function(e,t){return e.expression!==t?Oi(bn(t),e):e},createWithStatement:xn,updateWithStatement:function(e,t,n){return e.expression!==t||e.statement!==n?Oi(xn(t,n),e):e},createSwitchStatement:kn,updateSwitchStatement:function(e,t,n){return e.expression!==t||e.caseBlock!==n?Oi(kn(t,n),e):e},createLabeledStatement:Sn,updateLabeledStatement:Tn,createThrowStatement:Cn,updateThrowStatement:function(e,t){return e.expression!==t?Oi(Cn(t),e):e},createTryStatement:wn,updateTryStatement:function(e,t,n,r){return e.tryBlock!==t||e.catchClause!==n||e.finallyBlock!==r?Oi(wn(t,n,r),e):e},createDebuggerStatement:function(){const e=k(260);return e.jsDoc=void 0,e.flowNode=void 0,e},createVariableDeclaration:Nn,updateVariableDeclaration:function(e,t,n,r,i){return e.name!==t||e.type!==r||e.exclamationToken!==n||e.initializer!==i?Oi(Nn(t,n,r,i),e):e},createVariableDeclarationList:Dn,updateVariableDeclarationList:function(e,t){return e.declarations!==t?Oi(Dn(t,e.flags),e):e},createFunctionDeclaration:Fn,updateFunctionDeclaration:En,createClassDeclaration:Pn,updateClassDeclaration:An,createInterfaceDeclaration:In,updateInterfaceDeclaration:On,createTypeAliasDeclaration:Ln,updateTypeAliasDeclaration:jn,createEnumDeclaration:Mn,updateEnumDeclaration:Rn,createModuleDeclaration:Bn,updateModuleDeclaration:Jn,createModuleBlock:zn,updateModuleBlock:function(e,t){return e.statements!==t?Oi(zn(t),e):e},createCaseBlock:qn,updateCaseBlock:function(e,t){return e.clauses!==t?Oi(qn(t),e):e},createNamespaceExportDeclaration:Un,updateNamespaceExportDeclaration:function(e,t){return e.name!==t?function(e,t){e!==t&&(e.modifiers=t.modifiers);return Oi(e,t)}(Un(t),e):e},createImportEqualsDeclaration:Vn,updateImportEqualsDeclaration:Wn,createImportDeclaration:$n,updateImportDeclaration:Hn,createImportClause:Kn,updateImportClause:function(e,t,n,r){"boolean"==typeof t&&(t=t?156:void 0);return e.phaseModifier!==t||e.name!==n||e.namedBindings!==r?Oi(Kn(t,n,r),e):e},createAssertClause:Gn,updateAssertClause:function(e,t,n){return e.elements!==t||e.multiLine!==n?Oi(Gn(t,n),e):e},createAssertEntry:Xn,updateAssertEntry:function(e,t,n){return e.name!==t||e.value!==n?Oi(Xn(t,n),e):e},createImportTypeAssertionContainer:Qn,updateImportTypeAssertionContainer:function(e,t,n){return e.assertClause!==t||e.multiLine!==n?Oi(Qn(t,n),e):e},createImportAttributes:Yn,updateImportAttributes:function(e,t,n){return e.elements!==t||e.multiLine!==n?Oi(Yn(t,n,e.token),e):e},createImportAttribute:Zn,updateImportAttribute:function(e,t,n){return e.name!==t||e.value!==n?Oi(Zn(t,n),e):e},createNamespaceImport:er,updateNamespaceImport:function(e,t){return e.name!==t?Oi(er(t),e):e},createNamespaceExport:tr,updateNamespaceExport:function(e,t){return e.name!==t?Oi(tr(t),e):e},createNamedImports:nr,updateNamedImports:function(e,t){return e.elements!==t?Oi(nr(t),e):e},createImportSpecifier:rr,updateImportSpecifier:function(e,t,n,r){return e.isTypeOnly!==t||e.propertyName!==n||e.name!==r?Oi(rr(t,n,r),e):e},createExportAssignment:ir,updateExportAssignment:or,createExportDeclaration:ar,updateExportDeclaration:sr,createNamedExports:cr,updateNamedExports:function(e,t){return e.elements!==t?Oi(cr(t),e):e},createExportSpecifier:lr,updateExportSpecifier:function(e,t,n,r){return e.isTypeOnly!==t||e.propertyName!==n||e.name!==r?Oi(lr(t,n,r),e):e},createMissingDeclaration:function(){const e=S(283);return e.jsDoc=void 0,e},createExternalModuleReference:_r,updateExternalModuleReference:function(e,t){return e.expression!==t?Oi(_r(t),e):e},get createJSDocAllType(){return c(313)},get createJSDocUnknownType(){return c(314)},get createJSDocNonNullableType(){return d(316)},get updateJSDocNonNullableType(){return f(316)},get createJSDocNullableType(){return d(315)},get updateJSDocNullableType(){return f(315)},get createJSDocOptionalType(){return l(317)},get updateJSDocOptionalType(){return u(317)},get createJSDocVariadicType(){return l(319)},get updateJSDocVariadicType(){return u(319)},get createJSDocNamepathType(){return l(320)},get updateJSDocNamepathType(){return u(320)},createJSDocFunctionType:pr,updateJSDocFunctionType:function(e,t,n){return e.parameters!==t||e.type!==n?Oi(pr(t,n),e):e},createJSDocTypeLiteral:fr,updateJSDocTypeLiteral:function(e,t,n){return e.jsDocPropertyTags!==t||e.isArrayType!==n?Oi(fr(t,n),e):e},createJSDocTypeExpression:mr,updateJSDocTypeExpression:function(e,t){return e.type!==t?Oi(mr(t),e):e},createJSDocSignature:gr,updateJSDocSignature:function(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?Oi(gr(t,n,r),e):e},createJSDocTemplateTag:br,updateJSDocTemplateTag:function(e,t=hr(e),n,r,i){return e.tagName!==t||e.constraint!==n||e.typeParameters!==r||e.comment!==i?Oi(br(t,n,r,i),e):e},createJSDocTypedefTag:xr,updateJSDocTypedefTag:function(e,t=hr(e),n,r,i){return e.tagName!==t||e.typeExpression!==n||e.fullName!==r||e.comment!==i?Oi(xr(t,n,r,i),e):e},createJSDocParameterTag:kr,updateJSDocParameterTag:function(e,t=hr(e),n,r,i,o,a){return e.tagName!==t||e.name!==n||e.isBracketed!==r||e.typeExpression!==i||e.isNameFirst!==o||e.comment!==a?Oi(kr(t,n,r,i,o,a),e):e},createJSDocPropertyTag:Sr,updateJSDocPropertyTag:function(e,t=hr(e),n,r,i,o,a){return e.tagName!==t||e.name!==n||e.isBracketed!==r||e.typeExpression!==i||e.isNameFirst!==o||e.comment!==a?Oi(Sr(t,n,r,i,o,a),e):e},createJSDocCallbackTag:Tr,updateJSDocCallbackTag:function(e,t=hr(e),n,r,i){return e.tagName!==t||e.typeExpression!==n||e.fullName!==r||e.comment!==i?Oi(Tr(t,n,r,i),e):e},createJSDocOverloadTag:Cr,updateJSDocOverloadTag:function(e,t=hr(e),n,r){return e.tagName!==t||e.typeExpression!==n||e.comment!==r?Oi(Cr(t,n,r),e):e},createJSDocAugmentsTag:wr,updateJSDocAugmentsTag:function(e,t=hr(e),n,r){return e.tagName!==t||e.class!==n||e.comment!==r?Oi(wr(t,n,r),e):e},createJSDocImplementsTag:Nr,updateJSDocImplementsTag:function(e,t=hr(e),n,r){return e.tagName!==t||e.class!==n||e.comment!==r?Oi(Nr(t,n,r),e):e},createJSDocSeeTag:Dr,updateJSDocSeeTag:function(e,t,n,r){return e.tagName!==t||e.name!==n||e.comment!==r?Oi(Dr(t,n,r),e):e},createJSDocImportTag:Rr,updateJSDocImportTag:function(e,t,n,r,i,o){return e.tagName!==t||e.comment!==o||e.importClause!==n||e.moduleSpecifier!==r||e.attributes!==i?Oi(Rr(t,n,r,i,o),e):e},createJSDocNameReference:Fr,updateJSDocNameReference:function(e,t){return e.name!==t?Oi(Fr(t),e):e},createJSDocMemberName:Er,updateJSDocMemberName:function(e,t,n){return e.left!==t||e.right!==n?Oi(Er(t,n),e):e},createJSDocLink:Pr,updateJSDocLink:function(e,t,n){return e.name!==t?Oi(Pr(t,n),e):e},createJSDocLinkCode:Ar,updateJSDocLinkCode:function(e,t,n){return e.name!==t?Oi(Ar(t,n),e):e},createJSDocLinkPlain:Ir,updateJSDocLinkPlain:function(e,t,n){return e.name!==t?Oi(Ir(t,n),e):e},get createJSDocTypeTag(){return h(345)},get updateJSDocTypeTag(){return y(345)},get createJSDocReturnTag(){return h(343)},get updateJSDocReturnTag(){return y(343)},get createJSDocThisTag(){return h(344)},get updateJSDocThisTag(){return y(344)},get createJSDocAuthorTag(){return m(331)},get updateJSDocAuthorTag(){return g(331)},get createJSDocClassTag(){return m(333)},get updateJSDocClassTag(){return g(333)},get createJSDocPublicTag(){return m(334)},get updateJSDocPublicTag(){return g(334)},get createJSDocPrivateTag(){return m(335)},get updateJSDocPrivateTag(){return g(335)},get createJSDocProtectedTag(){return m(336)},get updateJSDocProtectedTag(){return g(336)},get createJSDocReadonlyTag(){return m(337)},get updateJSDocReadonlyTag(){return g(337)},get createJSDocOverrideTag(){return m(338)},get updateJSDocOverrideTag(){return g(338)},get createJSDocDeprecatedTag(){return m(332)},get updateJSDocDeprecatedTag(){return g(332)},get createJSDocThrowsTag(){return h(350)},get updateJSDocThrowsTag(){return y(350)},get createJSDocSatisfiesTag(){return h(351)},get updateJSDocSatisfiesTag(){return y(351)},createJSDocEnumTag:Mr,updateJSDocEnumTag:function(e,t=hr(e),n,r){return e.tagName!==t||e.typeExpression!==n||e.comment!==r?Oi(Mr(t,n,r),e):e},createJSDocUnknownTag:jr,updateJSDocUnknownTag:function(e,t,n){return e.tagName!==t||e.comment!==n?Oi(jr(t,n),e):e},createJSDocText:Br,updateJSDocText:function(e,t){return e.text!==t?Oi(Br(t),e):e},createJSDocComment:Jr,updateJSDocComment:function(e,t,n){return e.comment!==t||e.tags!==n?Oi(Jr(t,n),e):e},createJsxElement:zr,updateJsxElement:function(e,t,n,r){return e.openingElement!==t||e.children!==n||e.closingElement!==r?Oi(zr(t,n,r),e):e},createJsxSelfClosingElement:qr,updateJsxSelfClosingElement:function(e,t,n,r){return e.tagName!==t||e.typeArguments!==n||e.attributes!==r?Oi(qr(t,n,r),e):e},createJsxOpeningElement:Ur,updateJsxOpeningElement:function(e,t,n,r){return e.tagName!==t||e.typeArguments!==n||e.attributes!==r?Oi(Ur(t,n,r),e):e},createJsxClosingElement:Vr,updateJsxClosingElement:function(e,t){return e.tagName!==t?Oi(Vr(t),e):e},createJsxFragment:Wr,createJsxText:$r,updateJsxText:function(e,t,n){return e.text!==t||e.containsOnlyTriviaWhiteSpaces!==n?Oi($r(t,n),e):e},createJsxOpeningFragment:function(){const e=k(290);return e.transformFlags|=2,e},createJsxJsxClosingFragment:function(){const e=k(291);return e.transformFlags|=2,e},updateJsxFragment:function(e,t,n,r){return e.openingFragment!==t||e.children!==n||e.closingFragment!==r?Oi(Wr(t,n,r),e):e},createJsxAttribute:Hr,updateJsxAttribute:function(e,t,n){return e.name!==t||e.initializer!==n?Oi(Hr(t,n),e):e},createJsxAttributes:Kr,updateJsxAttributes:function(e,t){return e.properties!==t?Oi(Kr(t),e):e},createJsxSpreadAttribute:Gr,updateJsxSpreadAttribute:function(e,t){return e.expression!==t?Oi(Gr(t),e):e},createJsxExpression:Xr,updateJsxExpression:function(e,t){return e.expression!==t?Oi(Xr(e.dotDotDotToken,t),e):e},createJsxNamespacedName:Qr,updateJsxNamespacedName:function(e,t,n){return e.namespace!==t||e.name!==n?Oi(Qr(t,n),e):e},createCaseClause:Yr,updateCaseClause:function(e,t,n){return e.expression!==t||e.statements!==n?Oi(Yr(t,n),e):e},createDefaultClause:Zr,updateDefaultClause:function(e,t){return e.statements!==t?Oi(Zr(t),e):e},createHeritageClause:ei,updateHeritageClause:function(e,t){return e.types!==t?Oi(ei(e.token,t),e):e},createCatchClause:ti,updateCatchClause:function(e,t,n){return e.variableDeclaration!==t||e.block!==n?Oi(ti(t,n),e):e},createPropertyAssignment:ni,updatePropertyAssignment:ri,createShorthandPropertyAssignment:ii,updateShorthandPropertyAssignment:function(e,t,n){return e.name!==t||e.objectAssignmentInitializer!==n?function(e,t){e!==t&&(e.modifiers=t.modifiers,e.questionToken=t.questionToken,e.exclamationToken=t.exclamationToken,e.equalsToken=t.equalsToken);return Oi(e,t)}(ii(t,n),e):e},createSpreadAssignment:oi,updateSpreadAssignment:function(e,t){return e.expression!==t?Oi(oi(t),e):e},createEnumMember:ai,updateEnumMember:function(e,t,n){return e.name!==t||e.initializer!==n?Oi(ai(t,n),e):e},createSourceFile:function(e,n,r){const i=t.createBaseSourceFileNode(308);return i.statements=x(e),i.endOfFileToken=n,i.flags|=r,i.text="",i.fileName="",i.path="",i.resolvedPath="",i.originalFileName="",i.languageVersion=1,i.languageVariant=0,i.scriptKind=0,i.isDeclarationFile=!1,i.hasNoDefaultLib=!1,i.transformFlags|=mw(i.statements)|fw(i.endOfFileToken),i.locals=void 0,i.nextContainer=void 0,i.endFlowNode=void 0,i.nodeCount=0,i.identifierCount=0,i.symbolCount=0,i.parseDiagnostics=void 0,i.bindDiagnostics=void 0,i.bindSuggestionDiagnostics=void 0,i.lineMap=void 0,i.externalModuleIndicator=void 0,i.setExternalModuleIndicator=void 0,i.pragmas=void 0,i.checkJsDirective=void 0,i.referencedFiles=void 0,i.typeReferenceDirectives=void 0,i.libReferenceDirectives=void 0,i.amdDependencies=void 0,i.commentDirectives=void 0,i.identifiers=void 0,i.packageJsonLocations=void 0,i.packageJsonScope=void 0,i.imports=void 0,i.moduleAugmentations=void 0,i.ambientModuleNames=void 0,i.classifiableNames=void 0,i.impliedNodeFormat=void 0,i},updateSourceFile:function(e,t,n=e.isDeclarationFile,r=e.referencedFiles,i=e.typeReferenceDirectives,o=e.hasNoDefaultLib,a=e.libReferenceDirectives){return e.statements!==t||e.isDeclarationFile!==n||e.referencedFiles!==r||e.typeReferenceDirectives!==i||e.hasNoDefaultLib!==o||e.libReferenceDirectives!==a?Oi(function(e,t,n,r,i,o,a){const s=ci(e);return s.statements=x(t),s.isDeclarationFile=n,s.referencedFiles=r,s.typeReferenceDirectives=i,s.hasNoDefaultLib=o,s.libReferenceDirectives=a,s.transformFlags=mw(s.statements)|fw(s.endOfFileToken),s}(e,t,n,r,i,o,a),e):e},createRedirectedSourceFile:si,createBundle:li,updateBundle:function(e,t){return e.sourceFiles!==t?Oi(li(t),e):e},createSyntheticExpression:function(e,t=!1,n){const r=k(238);return r.type=e,r.isSpread=t,r.tupleNameSource=n,r},createSyntaxList:function(e){const t=k(353);return t._children=e,t},createNotEmittedStatement:function(e){const t=k(354);return t.original=e,FI(t,e),t},createNotEmittedTypeElement:function(){return k(355)},createPartiallyEmittedExpression:_i,updatePartiallyEmittedExpression:ui,createCommaListExpression:pi,updateCommaListExpression:function(e,t){return e.elements!==t?Oi(pi(t),e):e},createSyntheticReferenceExpression:fi,updateSyntheticReferenceExpression:function(e,t,n){return e.expression!==t||e.thisArg!==n?Oi(fi(t,n),e):e},cloneNode:mi,get createComma(){return o(28)},get createAssignment(){return o(64)},get createLogicalOr(){return o(57)},get createLogicalAnd(){return o(56)},get createBitwiseOr(){return o(52)},get createBitwiseXor(){return o(53)},get createBitwiseAnd(){return o(51)},get createStrictEquality(){return o(37)},get createStrictInequality(){return o(38)},get createEquality(){return o(35)},get createInequality(){return o(36)},get createLessThan(){return o(30)},get createLessThanEquals(){return o(33)},get createGreaterThan(){return o(32)},get createGreaterThanEquals(){return o(34)},get createLeftShift(){return o(48)},get createRightShift(){return o(49)},get createUnsignedRightShift(){return o(50)},get createAdd(){return o(40)},get createSubtract(){return o(41)},get createMultiply(){return o(42)},get createDivide(){return o(44)},get createModulo(){return o(45)},get createExponent(){return o(43)},get createPrefixPlus(){return a(40)},get createPrefixMinus(){return a(41)},get createPrefixIncrement(){return a(46)},get createPrefixDecrement(){return a(47)},get createBitwiseNot(){return a(55)},get createLogicalNot(){return a(54)},get createPostfixIncrement(){return s(46)},get createPostfixDecrement(){return s(47)},createImmediatelyInvokedFunctionExpression:function(e,t,n){return pt(Tt(void 0,void 0,void 0,void 0,t?[t]:[],void 0,an(e,!0)),void 0,n?[n]:[])},createImmediatelyInvokedArrowFunction:function(e,t,n){return pt(wt(void 0,void 0,t?[t]:[],void 0,void 0,an(e,!0)),void 0,n?[n]:[])},createVoidZero:gi,createExportDefault:function(e){return ir(void 0,!1,e)},createExternalModuleExport:function(e){return ar(void 0,!1,cr([lr(!1,void 0,e)]))},createTypeCheck:function(e,t){return"null"===t?v.createStrictEquality(e,z()):"undefined"===t?v.createStrictEquality(e,gi()):v.createStrictEquality(Ft(e),D(t))},createIsNotTypeCheck:function(e,t){return"null"===t?v.createStrictInequality(e,z()):"undefined"===t?v.createStrictInequality(e,gi()):v.createStrictInequality(Ft(e),D(t))},createMethodCall:hi,createGlobalMethodCall:yi,createFunctionBindCall:function(e,t,n){return hi(e,"bind",[t,...n])},createFunctionCallCall:function(e,t,n){return hi(e,"call",[t,...n])},createFunctionApplyCall:function(e,t,n){return hi(e,"apply",[t,n])},createArraySliceCall:function(e,t){return hi(e,"slice",void 0===t?[]:[Pi(t)])},createArrayConcatCall:function(e,t){return hi(e,"concat",t)},createObjectDefinePropertyCall:function(e,t,n){return yi("Object","defineProperty",[e,Pi(t),n])},createObjectGetOwnPropertyDescriptorCall:function(e,t){return yi("Object","getOwnPropertyDescriptor",[e,Pi(t)])},createReflectGetCall:function(e,t,n){return yi("Reflect","get",n?[e,t,n]:[e,t])},createReflectSetCall:function(e,t,n,r){return yi("Reflect","set",r?[e,t,n,r]:[e,t,n])},createPropertyDescriptor:function(e,t){const n=[];vi(n,"enumerable",Pi(e.enumerable)),vi(n,"configurable",Pi(e.configurable));let r=vi(n,"writable",Pi(e.writable));r=vi(n,"value",e.value)||r;let i=vi(n,"get",e.get);return i=vi(n,"set",e.set)||i,pn.assert(!(r&&i),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."),et(n,!t)},createCallBinding:function(e,t,n,i=!1){const o=AA(e,63);let a,s;_m(o)?(a=J(),s=o):SD(o)?(a=J(),s=void 0!==n&&n<2?FI(A("_super"),o):o):8192&rp(o)?(a=gi(),s=r().parenthesizeLeftSideOfAccess(o,!1)):hF(o)?bi(o.expression,i)?(a=I(t),s=nt(FI(v.createAssignment(a,o.expression),o.expression),o.name),FI(s,o)):(a=o.expression,s=o):yF(o)?bi(o.expression,i)?(a=I(t),s=ct(FI(v.createAssignment(a,o.expression),o.expression),o.argumentExpression),FI(s,o)):(a=o.expression,s=o):(a=gi(),s=r().parenthesizeLeftSideOfAccess(e,!1));return{target:s,thisArg:a}},createAssignmentTargetWrapper:function(e,t){return nt(kt(et([fe(void 0,"value",[Q(void 0,void 0,e,void 0,void 0,void 0)],an([_n(t)]))])),"value")},inlineExpressions:function(e){return e.length>10?pi(e):De(e,v.createComma)},getInternalName:function(e,t,n){return xi(e,t,n,98304)},getLocalName:function(e,t,n,r){return xi(e,t,n,32768,r)},getExportName:ki,getDeclarationName:function(e,t,n){return xi(e,t,n)},getNamespaceMemberName:Si,getExternalModuleOrNamespaceExportName:function(e,t,n,r){if(e&&Av(t,32))return Si(e,xi(t),n,r);return ki(t,n,r)},restoreOuterExpressions:function e(t,n,r=63){if(t&&PA(t,r)&&(i=t,!(SF(i)&&iy(i)&&iy(Ew(i))&&iy(jw(i)))||H(Rw(i))||H(zw(i))))return function(e,t){switch(e.kind){case 218:return St(e,t);case 217:return xt(e,e.type,t);case 235:return Gt(e,t,e.type);case 239:return en(e,t,e.type);case 236:return Yt(e,t);case 234:return Ht(e,t,e.typeArguments);case 356:return ui(e,t)}}(t,e(t.expression,n));var i;return n},restoreEnclosingLabel:function e(t,n,r){if(!n)return t;const i=Tn(n,n.label,_E(n.statement)?e(t,n.statement):t);r&&r(n);return i},createUseStrictPrologue:Ci,copyPrologue:function(e,t,n,r){const i=wi(e,t,0,n);return Ni(e,t,i,r)},copyStandardPrologue:wi,copyCustomPrologue:Ni,ensureUseStrict:function(e){if(!CA(e))return FI(x([Ci(),...e]),e);return e},liftToBlock:function(e){return pn.assert(b(e,yu),"Cannot lift nodes to a Block."),ke(e)||an(e)},mergeLexicalEnvironment:function(e,t){if(!H(t))return e;const n=Di(e,hf,0),r=Di(e,vf,n),i=Di(e,xf,r),o=Di(t,hf,0),a=Di(t,vf,o),s=Di(t,xf,a),c=Di(t,yf,s);pn.assert(c===t.length,"Expected declarations to be valid standard or custom prologues");const l=Ll(e)?e.slice():e;c>s&&l.splice(i,0,...t.slice(s,c));s>a&&l.splice(r,0,...t.slice(a,s));a>o&&l.splice(n,0,...t.slice(o,a));if(o>0)if(0===n)l.splice(0,0,...t.slice(0,o));else{const r=new Map;for(let t=0;t=0;e--){const n=t[e];r.has(n.expression.text)||l.unshift(n)}}if(Ll(e))return FI(x(l,e.hasTrailingComma),e);return e},replaceModifiers:function(e,t){let n;n="number"==typeof t?W(t):t;return DD(e)?X(e,n,e.name,e.constraint,e.default):FD(e)?Y(e,n,e.dotDotDotToken,e.name,e.questionToken,e.type,e.initializer):WD(e)?Fe(e,n,e.typeParameters,e.parameters,e.type):PD(e)?te(e,n,e.name,e.questionToken,e.type):AD(e)?re(e,n,e.name,e.questionToken??e.exclamationToken,e.type,e.initializer):ID(e)?oe(e,n,e.name,e.questionToken,e.typeParameters,e.parameters,e.type):OD(e)?ce(e,n,e.asteriskToken,e.name,e.questionToken,e.typeParameters,e.parameters,e.type,e.body):jD(e)?ue(e,n,e.parameters,e.body):MD(e)?pe(e,n,e.name,e.parameters,e.type,e.body):RD(e)?me(e,n,e.name,e.parameters,e.body):zD(e)?ve(e,n,e.parameters,e.type):TF(e)?Ct(e,n,e.asteriskToken,e.name,e.typeParameters,e.parameters,e.type,e.body):CF(e)?Nt(e,n,e.typeParameters,e.parameters,e.type,e.equalsGreaterThanToken,e.body):MF(e)?Wt(e,n,e.name,e.typeParameters,e.heritageClauses,e.members):XF(e)?cn(e,n,e.declarationList):gE(e)?En(e,n,e.asteriskToken,e.name,e.typeParameters,e.parameters,e.type,e.body):hE(e)?An(e,n,e.name,e.typeParameters,e.heritageClauses,e.members):yE(e)?On(e,n,e.name,e.typeParameters,e.heritageClauses,e.members):vE(e)?jn(e,n,e.name,e.typeParameters,e.type):bE(e)?Rn(e,n,e.name,e.members):xE(e)?Jn(e,n,e.name,e.body):CE(e)?Wn(e,n,e.isTypeOnly,e.name,e.moduleReference):wE(e)?Hn(e,n,e.importClause,e.moduleSpecifier,e.attributes):ME(e)?or(e,n,e.expression):RE(e)?sr(e,n,e.isTypeOnly,e.exportClause,e.moduleSpecifier,e.attributes):pn.assertNever(e)},replaceDecoratorsAndModifiers:function(e,t){return FD(e)?Y(e,t,e.dotDotDotToken,e.name,e.questionToken,e.type,e.initializer):AD(e)?re(e,t,e.name,e.questionToken??e.exclamationToken,e.type,e.initializer):OD(e)?ce(e,t,e.asteriskToken,e.name,e.questionToken,e.typeParameters,e.parameters,e.type,e.body):MD(e)?pe(e,t,e.name,e.parameters,e.type,e.body):RD(e)?me(e,t,e.name,e.parameters,e.body):MF(e)?Wt(e,t,e.name,e.typeParameters,e.heritageClauses,e.members):hE(e)?An(e,t,e.name,e.typeParameters,e.heritageClauses,e.members):pn.assertNever(e)},replacePropertyName:function(e,t){switch(e.kind){case 178:return pe(e,e.modifiers,t,e.parameters,e.type,e.body);case 179:return me(e,e.modifiers,t,e.parameters,e.body);case 175:return ce(e,e.modifiers,e.asteriskToken,t,e.questionToken,e.typeParameters,e.parameters,e.type,e.body);case 174:return oe(e,e.modifiers,t,e.questionToken,e.typeParameters,e.parameters,e.type);case 173:return re(e,e.modifiers,t,e.questionToken??e.exclamationToken,e.type,e.initializer);case 172:return te(e,e.modifiers,t,e.questionToken,e.type);case 304:return ri(e,t,e.initializer)}}};return p(sw,e=>e(v)),v;function x(e,t){if(void 0===e||e===_)e=[];else if(Ll(e)){if(void 0===t||e.hasTrailingComma===t)return void 0===e.transformFlags&&gw(e),pn.attachNodeArrayDebugInfo(e),e;const n=e.slice();return n.pos=e.pos,n.end=e.end,n.hasTrailingComma=t,n.transformFlags=e.transformFlags,pn.attachNodeArrayDebugInfo(n),n}const n=e.length,r=n>=1&&n<=4?e.slice():e;return r.pos=-1,r.end=-1,r.hasTrailingComma=!!t,r.transformFlags=0,gw(r),pn.attachNodeArrayDebugInfo(r),r}function k(e){return t.createBaseNode(e)}function S(e){const t=k(e);return t.symbol=void 0,t.localSymbol=void 0,t}function T(e,t){return e!==t&&(e.typeArguments=t.typeArguments),Oi(e,t)}function C(e,t=0){const n="number"==typeof e?e+"":e;pn.assert(45!==n.charCodeAt(0),"Negative numbers should be created in combination with createPrefixUnaryExpression");const r=S(9);return r.text=n,r.numericLiteralFlags=t,384&t&&(r.transformFlags|=1024),r}function w(e){const t=M(10);return t.text="string"==typeof e?e:xT(e)+"n",t.transformFlags|=32,t}function N(e,t){const n=S(11);return n.text=e,n.singleQuote=t,n}function D(e,t,n){const r=N(e,t);return r.hasExtendedUnicodeEscape=n,n&&(r.transformFlags|=1024),r}function F(e){const t=M(14);return t.text=e,t}function E(e){const n=t.createBaseIdentifierNode(80);return n.escapedText=e,n.jsDoc=void 0,n.flowNode=void 0,n.symbol=void 0,n}function P(e,t,n,r){const i=E(yc(e));return oN(i,{flags:t,id:ow,prefix:n,suffix:r}),ow++,i}function A(e,t,n){void 0===t&&e&&(t=Oa(e)),80===t&&(t=void 0);const r=E(yc(e));return n&&(r.flags|=256),"await"===r.escapedText&&(r.transformFlags|=67108864),256&r.flags&&(r.transformFlags|=1024),r}function I(e,t,n,r){let i=1;t&&(i|=8);const o=P("",i,n,r);return e&&e(o),o}function O(e,t=0,n,r){pn.assert(!(7&t),"Argument out of range: flags");(n||r)&&(t|=16);const i=P(e?gl(e)?xI(!1,n,e,r,bc):`generated@${_J(e)}`:"",4|t,n,r);return i.original=e,i}function L(e){const n=t.createBasePrivateIdentifierNode(81);return n.escapedText=e,n.transformFlags|=16777216,n}function j(e,t,n,r){const i=L(yc(e));return oN(i,{flags:t,id:ow,prefix:n,suffix:r}),ow++,i}function M(e){return t.createBaseTokenNode(e)}function B(e){pn.assert(e>=0&&e<=166,"Invalid token"),pn.assert(e<=15||e>=18,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),pn.assert(e<=9||e>=15,"Invalid token. Use 'createLiteralLikeNode' to create literals."),pn.assert(80!==e,"Invalid token. Use 'createIdentifier' to create identifiers");const t=M(e);let n=0;switch(e){case 134:n=384;break;case 160:n=4;break;case 125:case 123:case 124:case 148:case 128:case 138:case 87:case 133:case 150:case 163:case 146:case 151:case 103:case 147:case 164:case 154:case 136:case 155:case 116:case 159:case 157:n=1;break;case 108:n=134218752,t.flowNode=void 0;break;case 126:n=1024;break;case 129:n=16777216;break;case 110:n=16384,t.flowNode=void 0}return n&&(t.transformFlags|=n),t}function J(){return B(110)}function z(){return B(106)}function q(){return B(112)}function U(){return B(97)}function V(e){return B(e)}function W(e){const t=[];return 32&e&&t.push(V(95)),128&e&&t.push(V(138)),2048&e&&t.push(V(90)),4096&e&&t.push(V(87)),1&e&&t.push(V(125)),2&e&&t.push(V(123)),4&e&&t.push(V(124)),64&e&&t.push(V(128)),256&e&&t.push(V(126)),16&e&&t.push(V(164)),8&e&&t.push(V(148)),512&e&&t.push(V(129)),1024&e&&t.push(V(134)),8192&e&&t.push(V(103)),16384&e&&t.push(V(147)),t.length?t:void 0}function $(e,t){const n=k(167);return n.left=e,n.right=Ei(t),n.transformFlags|=fw(n.left)|pw(n.right),n.flowNode=void 0,n}function K(e){const t=k(168);return t.expression=r().parenthesizeExpressionOfComputedPropertyName(e),t.transformFlags|=132096|fw(t.expression),t}function G(e,t,n,r){const i=S(169);return i.modifiers=Fi(e),i.name=Ei(t),i.constraint=n,i.default=r,i.transformFlags=1,i.expression=void 0,i.jsDoc=void 0,i}function X(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.constraint!==r||e.default!==i?Oi(G(t,n,r,i),e):e}function Q(e,t,n,r,i,o){const a=S(170);return a.modifiers=Fi(e),a.dotDotDotToken=t,a.name=Ei(n),a.questionToken=r,a.type=i,a.initializer=Ai(o),pv(a.name)?a.transformFlags=1:a.transformFlags=mw(a.modifiers)|fw(a.dotDotDotToken)|dw(a.name)|fw(a.questionToken)|fw(a.initializer)|(a.questionToken??a.type?1:0)|(a.dotDotDotToken??a.initializer?1024:0)|(31&Qv(a.modifiers)?8192:0),a.jsDoc=void 0,a}function Y(e,t,n,r,i,o,a){return e.modifiers!==t||e.dotDotDotToken!==n||e.name!==r||e.questionToken!==i||e.type!==o||e.initializer!==a?Oi(Q(t,n,r,i,o,a),e):e}function Z(e){const t=k(171);return t.expression=r().parenthesizeLeftSideOfAccess(e,!1),t.transformFlags|=33562625|fw(t.expression),t}function ee(e,t,n,r){const i=S(172);return i.modifiers=Fi(e),i.name=Ei(t),i.type=r,i.questionToken=n,i.transformFlags=1,i.initializer=void 0,i.jsDoc=void 0,i}function te(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.questionToken!==r||e.type!==i?function(e,t){e!==t&&(e.initializer=t.initializer);return Oi(e,t)}(ee(t,n,r,i),e):e}function ne(e,t,n,r,i){const o=S(173);o.modifiers=Fi(e),o.name=Ei(t),o.questionToken=n&&sD(n)?n:void 0,o.exclamationToken=n&&aD(n)?n:void 0,o.type=r,o.initializer=Ai(i);const a=33554432&o.flags||128&Qv(o.modifiers);return o.transformFlags=mw(o.modifiers)|dw(o.name)|fw(o.initializer)|(a||o.questionToken||o.exclamationToken||o.type?1:0)|(ND(o.name)||256&Qv(o.modifiers)&&o.initializer?8192:0)|16777216,o.jsDoc=void 0,o}function re(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.questionToken!==(void 0!==r&&sD(r)?r:void 0)||e.exclamationToken!==(void 0!==r&&aD(r)?r:void 0)||e.type!==i||e.initializer!==o?Oi(ne(t,n,r,i,o),e):e}function ie(e,t,n,r,i,o){const a=S(174);return a.modifiers=Fi(e),a.name=Ei(t),a.questionToken=n,a.typeParameters=Fi(r),a.parameters=Fi(i),a.type=o,a.transformFlags=1,a.jsDoc=void 0,a.locals=void 0,a.nextContainer=void 0,a.typeArguments=void 0,a}function oe(e,t,n,r,i,o,a){return e.modifiers!==t||e.name!==n||e.questionToken!==r||e.typeParameters!==i||e.parameters!==o||e.type!==a?T(ie(t,n,r,i,o,a),e):e}function se(e,t,n,r,i,o,a,s){const c=S(175);if(c.modifiers=Fi(e),c.asteriskToken=t,c.name=Ei(n),c.questionToken=r,c.exclamationToken=void 0,c.typeParameters=Fi(i),c.parameters=x(o),c.type=a,c.body=s,c.body){const e=1024&Qv(c.modifiers),t=!!c.asteriskToken,n=e&&t;c.transformFlags=mw(c.modifiers)|fw(c.asteriskToken)|dw(c.name)|fw(c.questionToken)|mw(c.typeParameters)|mw(c.parameters)|fw(c.type)|-67108865&fw(c.body)|(n?128:e?256:t?2048:0)|(c.questionToken||c.typeParameters||c.type?1:0)|1024}else c.transformFlags=1;return c.typeArguments=void 0,c.jsDoc=void 0,c.locals=void 0,c.nextContainer=void 0,c.flowNode=void 0,c.endFlowNode=void 0,c.returnFlowNode=void 0,c}function ce(e,t,n,r,i,o,a,s,c){return e.modifiers!==t||e.asteriskToken!==n||e.name!==r||e.questionToken!==i||e.typeParameters!==o||e.parameters!==a||e.type!==s||e.body!==c?function(e,t){e!==t&&(e.exclamationToken=t.exclamationToken);return Oi(e,t)}(se(t,n,r,i,o,a,s,c),e):e}function le(e){const t=S(176);return t.body=e,t.transformFlags=16777216|fw(e),t.modifiers=void 0,t.jsDoc=void 0,t.locals=void 0,t.nextContainer=void 0,t.endFlowNode=void 0,t.returnFlowNode=void 0,t}function _e(e,t,n){const r=S(177);return r.modifiers=Fi(e),r.parameters=x(t),r.body=n,r.body?r.transformFlags=mw(r.modifiers)|mw(r.parameters)|-67108865&fw(r.body)|1024:r.transformFlags=1,r.typeParameters=void 0,r.type=void 0,r.typeArguments=void 0,r.jsDoc=void 0,r.locals=void 0,r.nextContainer=void 0,r.endFlowNode=void 0,r.returnFlowNode=void 0,r}function ue(e,t,n,r){return e.modifiers!==t||e.parameters!==n||e.body!==r?function(e,t){e!==t&&(e.typeParameters=t.typeParameters,e.type=t.type);return T(e,t)}(_e(t,n,r),e):e}function de(e,t,n,r,i){const o=S(178);return o.modifiers=Fi(e),o.name=Ei(t),o.parameters=x(n),o.type=r,o.body=i,o.body?o.transformFlags=mw(o.modifiers)|dw(o.name)|mw(o.parameters)|fw(o.type)|-67108865&fw(o.body)|(o.type?1:0):o.transformFlags=1,o.typeArguments=void 0,o.typeParameters=void 0,o.jsDoc=void 0,o.locals=void 0,o.nextContainer=void 0,o.flowNode=void 0,o.endFlowNode=void 0,o.returnFlowNode=void 0,o}function pe(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.parameters!==r||e.type!==i||e.body!==o?function(e,t){e!==t&&(e.typeParameters=t.typeParameters);return T(e,t)}(de(t,n,r,i,o),e):e}function fe(e,t,n,r){const i=S(179);return i.modifiers=Fi(e),i.name=Ei(t),i.parameters=x(n),i.body=r,i.body?i.transformFlags=mw(i.modifiers)|dw(i.name)|mw(i.parameters)|-67108865&fw(i.body)|(i.type?1:0):i.transformFlags=1,i.typeArguments=void 0,i.typeParameters=void 0,i.type=void 0,i.jsDoc=void 0,i.locals=void 0,i.nextContainer=void 0,i.flowNode=void 0,i.endFlowNode=void 0,i.returnFlowNode=void 0,i}function me(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.parameters!==r||e.body!==i?function(e,t){e!==t&&(e.typeParameters=t.typeParameters,e.type=t.type);return T(e,t)}(fe(t,n,r,i),e):e}function ge(e,t,n){const r=S(180);return r.typeParameters=Fi(e),r.parameters=Fi(t),r.type=n,r.transformFlags=1,r.jsDoc=void 0,r.locals=void 0,r.nextContainer=void 0,r.typeArguments=void 0,r}function he(e,t,n){const r=S(181);return r.typeParameters=Fi(e),r.parameters=Fi(t),r.type=n,r.transformFlags=1,r.jsDoc=void 0,r.locals=void 0,r.nextContainer=void 0,r.typeArguments=void 0,r}function ye(e,t,n){const r=S(182);return r.modifiers=Fi(e),r.parameters=Fi(t),r.type=n,r.transformFlags=1,r.jsDoc=void 0,r.locals=void 0,r.nextContainer=void 0,r.typeArguments=void 0,r}function ve(e,t,n,r){return e.parameters!==n||e.type!==r||e.modifiers!==t?T(ye(t,n,r),e):e}function xe(e,t){const n=k(205);return n.type=e,n.literal=t,n.transformFlags=1,n}function Se(e,t,n){const r=k(183);return r.assertsModifier=e,r.parameterName=Ei(t),r.type=n,r.transformFlags=1,r}function Te(e,t){const n=k(184);return n.typeName=Ei(e),n.typeArguments=t&&r().parenthesizeTypeArguments(x(t)),n.transformFlags=1,n}function Ce(e,t,n){const r=S(185);return r.typeParameters=Fi(e),r.parameters=Fi(t),r.type=n,r.transformFlags=1,r.modifiers=void 0,r.jsDoc=void 0,r.locals=void 0,r.nextContainer=void 0,r.typeArguments=void 0,r}function we(...e){return 4===e.length?Ne(...e):3===e.length?function(e,t,n){return Ne(void 0,e,t,n)}(...e):pn.fail("Incorrect number of arguments specified.")}function Ne(e,t,n,r){const i=S(186);return i.modifiers=Fi(e),i.typeParameters=Fi(t),i.parameters=Fi(n),i.type=r,i.transformFlags=1,i.jsDoc=void 0,i.locals=void 0,i.nextContainer=void 0,i.typeArguments=void 0,i}function Fe(e,t,n,r,i){return e.modifiers!==t||e.typeParameters!==n||e.parameters!==r||e.type!==i?T(we(t,n,r,i),e):e}function Pe(e,t){const n=k(187);return n.exprName=e,n.typeArguments=t&&r().parenthesizeTypeArguments(t),n.transformFlags=1,n}function Ae(e){const t=S(188);return t.members=x(e),t.transformFlags=1,t}function Ie(e){const t=k(189);return t.elementType=r().parenthesizeNonArrayTypeOfPostfixType(e),t.transformFlags=1,t}function Oe(e){const t=k(190);return t.elements=x(r().parenthesizeElementTypesOfTupleType(e)),t.transformFlags=1,t}function Le(e,t,n,r){const i=S(203);return i.dotDotDotToken=e,i.name=t,i.questionToken=n,i.type=r,i.transformFlags=1,i.jsDoc=void 0,i}function je(e){const t=k(191);return t.type=r().parenthesizeTypeOfOptionalType(e),t.transformFlags=1,t}function Me(e){const t=k(192);return t.type=e,t.transformFlags=1,t}function Re(e,t,n){const r=k(e);return r.types=v.createNodeArray(n(t)),r.transformFlags=1,r}function Be(e,t,n){return e.types!==t?Oi(Re(e.kind,t,n),e):e}function Je(e,t,n,i){const o=k(195);return o.checkType=r().parenthesizeCheckTypeOfConditionalType(e),o.extendsType=r().parenthesizeExtendsTypeOfConditionalType(t),o.trueType=n,o.falseType=i,o.transformFlags=1,o.locals=void 0,o.nextContainer=void 0,o}function ze(e){const t=k(196);return t.typeParameter=e,t.transformFlags=1,t}function qe(e,t){const n=k(204);return n.head=e,n.templateSpans=x(t),n.transformFlags=1,n}function Ue(e,t,n,i,o=!1){const a=k(206);return a.argument=e,a.attributes=t,a.assertions&&a.assertions.assertClause&&a.attributes&&(a.assertions.assertClause=a.attributes),a.qualifier=n,a.typeArguments=i&&r().parenthesizeTypeArguments(i),a.isTypeOf=o,a.transformFlags=1,a}function Ve(e){const t=k(197);return t.type=e,t.transformFlags=1,t}function We(e,t){const n=k(199);return n.operator=e,n.type=148===e?r().parenthesizeOperandOfReadonlyTypeOperator(t):r().parenthesizeOperandOfTypeOperator(t),n.transformFlags=1,n}function $e(e,t){const n=k(200);return n.objectType=r().parenthesizeNonArrayTypeOfPostfixType(e),n.indexType=t,n.transformFlags=1,n}function He(e,t,n,r,i,o){const a=S(201);return a.readonlyToken=e,a.typeParameter=t,a.nameType=n,a.questionToken=r,a.type=i,a.members=o&&x(o),a.transformFlags=1,a.locals=void 0,a.nextContainer=void 0,a}function Ke(e){const t=k(202);return t.literal=e,t.transformFlags=1,t}function Ge(e){const t=k(207);return t.elements=x(e),t.transformFlags|=525312|mw(t.elements),32768&t.transformFlags&&(t.transformFlags|=65664),t}function Xe(e){const t=k(208);return t.elements=x(e),t.transformFlags|=525312|mw(t.elements),t}function Qe(e,t,n,r){const i=S(209);return i.dotDotDotToken=e,i.propertyName=Ei(t),i.name=Ei(n),i.initializer=Ai(r),i.transformFlags|=fw(i.dotDotDotToken)|dw(i.propertyName)|dw(i.name)|fw(i.initializer)|(i.dotDotDotToken?32768:0)|1024,i.flowNode=void 0,i}function Ye(e,t){const n=k(210),i=e&&be(e),o=x(e,!(!i||!RF(i))||void 0);return n.elements=r().parenthesizeExpressionsOfCommaDelimitedList(o),n.multiLine=t,n.transformFlags|=mw(n.elements),n}function et(e,t){const n=S(211);return n.properties=x(e),n.multiLine=t,n.transformFlags|=mw(n.properties),n.jsDoc=void 0,n}function tt(e,t,n){const r=S(212);return r.expression=e,r.questionDotToken=t,r.name=n,r.transformFlags=fw(r.expression)|fw(r.questionDotToken)|(uD(r.name)?pw(r.name):536870912|fw(r.name)),r.jsDoc=void 0,r.flowNode=void 0,r}function nt(e,t){const n=tt(r().parenthesizeLeftSideOfAccess(e,!1),void 0,Ei(t));return SD(e)&&(n.transformFlags|=384),n}function rt(e,t,n){const i=tt(r().parenthesizeLeftSideOfAccess(e,!0),t,Ei(n));return i.flags|=64,i.transformFlags|=32,i}function ot(e,t,n,r){return pn.assert(!!(64&e.flags),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."),e.expression!==t||e.questionDotToken!==n||e.name!==r?Oi(rt(t,n,r),e):e}function at(e,t,n){const r=S(213);return r.expression=e,r.questionDotToken=t,r.argumentExpression=n,r.transformFlags|=fw(r.expression)|fw(r.questionDotToken)|fw(r.argumentExpression),r.jsDoc=void 0,r.flowNode=void 0,r}function ct(e,t){const n=at(r().parenthesizeLeftSideOfAccess(e,!1),void 0,Pi(t));return SD(e)&&(n.transformFlags|=384),n}function _t(e,t,n){const i=at(r().parenthesizeLeftSideOfAccess(e,!0),t,Pi(n));return i.flags|=64,i.transformFlags|=32,i}function ut(e,t,n,r){return pn.assert(!!(64&e.flags),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."),e.expression!==t||e.questionDotToken!==n||e.argumentExpression!==r?Oi(_t(t,n,r),e):e}function dt(e,t,n,r){const i=S(214);return i.expression=e,i.questionDotToken=t,i.typeArguments=n,i.arguments=r,i.transformFlags|=fw(i.expression)|fw(i.questionDotToken)|mw(i.typeArguments)|mw(i.arguments),i.typeArguments&&(i.transformFlags|=1),_m(i.expression)&&(i.transformFlags|=16384),i}function pt(e,t,n){const i=dt(r().parenthesizeLeftSideOfAccess(e,!1),void 0,Fi(t),r().parenthesizeExpressionsOfCommaDelimitedList(x(n)));return TD(i.expression)&&(i.transformFlags|=8388608),i}function gt(e,t,n,i){const o=dt(r().parenthesizeLeftSideOfAccess(e,!0),t,Fi(n),r().parenthesizeExpressionsOfCommaDelimitedList(x(i)));return o.flags|=64,o.transformFlags|=32,o}function ht(e,t,n,r,i){return pn.assert(!!(64&e.flags),"Cannot update a CallExpression using updateCallChain. Use updateCall instead."),e.expression!==t||e.questionDotToken!==n||e.typeArguments!==r||e.arguments!==i?Oi(gt(t,n,r,i),e):e}function yt(e,t,n){const i=S(215);return i.expression=r().parenthesizeExpressionOfNew(e),i.typeArguments=Fi(t),i.arguments=n?r().parenthesizeExpressionsOfCommaDelimitedList(n):void 0,i.transformFlags|=fw(i.expression)|mw(i.typeArguments)|mw(i.arguments)|32,i.typeArguments&&(i.transformFlags|=1),i}function vt(e,t,n){const i=k(216);return i.tag=r().parenthesizeLeftSideOfAccess(e,!1),i.typeArguments=Fi(t),i.template=n,i.transformFlags|=fw(i.tag)|mw(i.typeArguments)|fw(i.template)|1024,i.typeArguments&&(i.transformFlags|=1),yy(i.template)&&(i.transformFlags|=128),i}function bt(e,t){const n=k(217);return n.expression=r().parenthesizeOperandOfPrefixUnary(t),n.type=e,n.transformFlags|=fw(n.expression)|fw(n.type)|1,n}function xt(e,t,n){return e.type!==t||e.expression!==n?Oi(bt(t,n),e):e}function kt(e){const t=k(218);return t.expression=e,t.transformFlags=fw(t.expression),t.jsDoc=void 0,t}function St(e,t){return e.expression!==t?Oi(kt(t),e):e}function Tt(e,t,n,r,i,o,a){const s=S(219);s.modifiers=Fi(e),s.asteriskToken=t,s.name=Ei(n),s.typeParameters=Fi(r),s.parameters=x(i),s.type=o,s.body=a;const c=1024&Qv(s.modifiers),l=!!s.asteriskToken,_=c&&l;return s.transformFlags=mw(s.modifiers)|fw(s.asteriskToken)|dw(s.name)|mw(s.typeParameters)|mw(s.parameters)|fw(s.type)|-67108865&fw(s.body)|(_?128:c?256:l?2048:0)|(s.typeParameters||s.type?1:0)|4194304,s.typeArguments=void 0,s.jsDoc=void 0,s.locals=void 0,s.nextContainer=void 0,s.flowNode=void 0,s.endFlowNode=void 0,s.returnFlowNode=void 0,s}function Ct(e,t,n,r,i,o,a,s){return e.name!==r||e.modifiers!==t||e.asteriskToken!==n||e.typeParameters!==i||e.parameters!==o||e.type!==a||e.body!==s?T(Tt(t,n,r,i,o,a,s),e):e}function wt(e,t,n,i,o,a){const s=S(220);s.modifiers=Fi(e),s.typeParameters=Fi(t),s.parameters=x(n),s.type=i,s.equalsGreaterThanToken=o??B(39),s.body=r().parenthesizeConciseBodyOfArrowFunction(a);const c=1024&Qv(s.modifiers);return s.transformFlags=mw(s.modifiers)|mw(s.typeParameters)|mw(s.parameters)|fw(s.type)|fw(s.equalsGreaterThanToken)|-67108865&fw(s.body)|(s.typeParameters||s.type?1:0)|(c?16640:0)|1024,s.typeArguments=void 0,s.jsDoc=void 0,s.locals=void 0,s.nextContainer=void 0,s.flowNode=void 0,s.endFlowNode=void 0,s.returnFlowNode=void 0,s}function Nt(e,t,n,r,i,o,a){return e.modifiers!==t||e.typeParameters!==n||e.parameters!==r||e.type!==i||e.equalsGreaterThanToken!==o||e.body!==a?T(wt(t,n,r,i,o,a),e):e}function Dt(e){const t=k(221);return t.expression=r().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=fw(t.expression),t}function Ft(e){const t=k(222);return t.expression=r().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=fw(t.expression),t}function Et(e){const t=k(223);return t.expression=r().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=fw(t.expression),t}function Pt(e){const t=k(224);return t.expression=r().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=2097536|fw(t.expression),t}function At(e,t){const n=k(225);return n.operator=e,n.operand=r().parenthesizeOperandOfPrefixUnary(t),n.transformFlags|=fw(n.operand),46!==e&&47!==e||!uD(n.operand)||Gl(n.operand)||kA(n.operand)||(n.transformFlags|=268435456),n}function It(e,t){const n=k(226);return n.operator=t,n.operand=r().parenthesizeOperandOfPostfixUnary(e),n.transformFlags|=fw(n.operand),!uD(n.operand)||Gl(n.operand)||kA(n.operand)||(n.transformFlags|=268435456),n}function Ot(e,t,n){const i=S(227),o="number"==typeof(a=t)?B(a):a;var a;const s=o.kind;return i.left=r().parenthesizeLeftSideOfBinary(s,e),i.operatorToken=o,i.right=r().parenthesizeRightSideOfBinary(s,i.left,n),i.transformFlags|=fw(i.left)|fw(i.operatorToken)|fw(i.right),61===s?i.transformFlags|=32:64===s?gF(i.left)?i.transformFlags|=5248|Lt(i.left):mF(i.left)&&(i.transformFlags|=5120|Lt(i.left)):43===s||68===s?i.transformFlags|=512:tb(s)&&(i.transformFlags|=16),103===s&&dD(i.left)&&(i.transformFlags|=536870912),i.jsDoc=void 0,i}function Lt(e){return DI(e)?65536:0}function jt(e,t,n,i,o){const a=k(228);return a.condition=r().parenthesizeConditionOfConditionalExpression(e),a.questionToken=t??B(58),a.whenTrue=r().parenthesizeBranchOfConditionalExpression(n),a.colonToken=i??B(59),a.whenFalse=r().parenthesizeBranchOfConditionalExpression(o),a.transformFlags|=fw(a.condition)|fw(a.questionToken)|fw(a.whenTrue)|fw(a.colonToken)|fw(a.whenFalse),a.flowNodeWhenFalse=void 0,a.flowNodeWhenTrue=void 0,a}function Mt(e,t){const n=k(229);return n.head=e,n.templateSpans=x(t),n.transformFlags|=fw(n.head)|mw(n.templateSpans)|1024,n}function Rt(e,t,n,r=0){let i;if(pn.assert(!(-7177&r),"Unsupported template flags."),void 0!==n&&n!==t&&(i=function(e,t){rw||(rw=bs(99,!1,0));switch(e){case 15:rw.setText("`"+t+"`");break;case 16:rw.setText("`"+t+"${");break;case 17:rw.setText("}"+t+"${");break;case 18:rw.setText("}"+t+"`")}let n,r=rw.scan();20===r&&(r=rw.reScanTemplateToken(!1));if(rw.isUnterminated())return rw.setText(void 0),uw;switch(r){case 15:case 16:case 17:case 18:n=rw.getTokenValue()}if(void 0===n||1!==rw.scan())return rw.setText(void 0),uw;return rw.setText(void 0),n}(e,n),"object"==typeof i))return pn.fail("Invalid raw text");if(void 0===t){if(void 0===i)return pn.fail("Arguments 'text' and 'rawText' may not both be undefined.");t=i}else void 0!==i&&pn.assert(t===i,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");return t}function Bt(e){let t=1024;return e&&(t|=128),t}function Jt(e,t,n,r){const i=S(e);return i.text=t,i.rawText=n,i.templateFlags=7176&r,i.transformFlags=Bt(i.templateFlags),i}function zt(e,t,n,r){return 15===e?Jt(e,t,n,r):function(e,t,n,r){const i=M(e);return i.text=t,i.rawText=n,i.templateFlags=7176&r,i.transformFlags=Bt(i.templateFlags),i}(e,t,n,r)}function qt(e,t){pn.assert(!e||!!t,"A `YieldExpression` with an asteriskToken must have an expression.");const n=k(230);return n.expression=t&&r().parenthesizeExpressionForDisallowedComma(t),n.asteriskToken=e,n.transformFlags|=1049728|(fw(n.expression)|fw(n.asteriskToken)),n}function Ut(e){const t=k(231);return t.expression=r().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=33792|fw(t.expression),t}function Vt(e,t,n,r,i){const o=S(232);return o.modifiers=Fi(e),o.name=Ei(t),o.typeParameters=Fi(n),o.heritageClauses=Fi(r),o.members=x(i),o.transformFlags|=mw(o.modifiers)|dw(o.name)|mw(o.typeParameters)|mw(o.heritageClauses)|mw(o.members)|(o.typeParameters?1:0)|1024,o.jsDoc=void 0,o}function Wt(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.heritageClauses!==i||e.members!==o?Oi(Vt(t,n,r,i,o),e):e}function $t(e,t){const n=k(234);return n.expression=r().parenthesizeLeftSideOfAccess(e,!1),n.typeArguments=t&&r().parenthesizeTypeArguments(t),n.transformFlags|=fw(n.expression)|mw(n.typeArguments)|1024,n}function Ht(e,t,n){return e.expression!==t||e.typeArguments!==n?Oi($t(t,n),e):e}function Kt(e,t){const n=k(235);return n.expression=e,n.type=t,n.transformFlags|=fw(n.expression)|fw(n.type)|1,n}function Gt(e,t,n){return e.expression!==t||e.type!==n?Oi(Kt(t,n),e):e}function Xt(e){const t=k(236);return t.expression=r().parenthesizeLeftSideOfAccess(e,!1),t.transformFlags|=1|fw(t.expression),t}function Yt(e,t){return Dl(e)?nn(e,t):e.expression!==t?Oi(Xt(t),e):e}function Zt(e,t){const n=k(239);return n.expression=e,n.type=t,n.transformFlags|=fw(n.expression)|fw(n.type)|1,n}function en(e,t,n){return e.expression!==t||e.type!==n?Oi(Zt(t,n),e):e}function tn(e){const t=k(236);return t.flags|=64,t.expression=r().parenthesizeLeftSideOfAccess(e,!0),t.transformFlags|=1|fw(t.expression),t}function nn(e,t){return pn.assert(!!(64&e.flags),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."),e.expression!==t?Oi(tn(t),e):e}function rn(e,t){const n=k(237);switch(n.keywordToken=e,n.name=t,n.transformFlags|=fw(n.name),e){case 105:n.transformFlags|=1024;break;case 102:n.transformFlags|=32;break;default:return pn.assertNever(e)}return n.flowNode=void 0,n}function on(e,t){const n=k(240);return n.expression=e,n.literal=t,n.transformFlags|=fw(n.expression)|fw(n.literal)|1024,n}function an(e,t){const n=k(242);return n.statements=x(e),n.multiLine=t,n.transformFlags|=mw(n.statements),n.jsDoc=void 0,n.locals=void 0,n.nextContainer=void 0,n}function sn(e,t){const n=k(244);return n.modifiers=Fi(e),n.declarationList=Ze(t)?Dn(t):t,n.transformFlags|=mw(n.modifiers)|fw(n.declarationList),128&Qv(n.modifiers)&&(n.transformFlags=1),n.jsDoc=void 0,n.flowNode=void 0,n}function cn(e,t,n){return e.modifiers!==t||e.declarationList!==n?Oi(sn(t,n),e):e}function ln(){const e=k(243);return e.jsDoc=void 0,e}function _n(e){const t=k(245);return t.expression=r().parenthesizeExpressionOfExpressionStatement(e),t.transformFlags|=fw(t.expression),t.jsDoc=void 0,t.flowNode=void 0,t}function un(e,t,n){const r=k(246);return r.expression=e,r.thenStatement=Ii(t),r.elseStatement=Ii(n),r.transformFlags|=fw(r.expression)|fw(r.thenStatement)|fw(r.elseStatement),r.jsDoc=void 0,r.flowNode=void 0,r}function dn(e,t){const n=k(247);return n.statement=Ii(e),n.expression=t,n.transformFlags|=fw(n.statement)|fw(n.expression),n.jsDoc=void 0,n.flowNode=void 0,n}function fn(e,t){const n=k(248);return n.expression=e,n.statement=Ii(t),n.transformFlags|=fw(n.expression)|fw(n.statement),n.jsDoc=void 0,n.flowNode=void 0,n}function mn(e,t,n,r){const i=k(249);return i.initializer=e,i.condition=t,i.incrementor=n,i.statement=Ii(r),i.transformFlags|=fw(i.initializer)|fw(i.condition)|fw(i.incrementor)|fw(i.statement),i.jsDoc=void 0,i.locals=void 0,i.nextContainer=void 0,i.flowNode=void 0,i}function gn(e,t,n){const r=k(250);return r.initializer=e,r.expression=t,r.statement=Ii(n),r.transformFlags|=fw(r.initializer)|fw(r.expression)|fw(r.statement),r.jsDoc=void 0,r.locals=void 0,r.nextContainer=void 0,r.flowNode=void 0,r}function hn(e,t,n,i){const o=k(251);return o.awaitModifier=e,o.initializer=t,o.expression=r().parenthesizeExpressionForDisallowedComma(n),o.statement=Ii(i),o.transformFlags|=fw(o.awaitModifier)|fw(o.initializer)|fw(o.expression)|fw(o.statement)|1024,e&&(o.transformFlags|=128),o.jsDoc=void 0,o.locals=void 0,o.nextContainer=void 0,o.flowNode=void 0,o}function yn(e){const t=k(252);return t.label=Ei(e),t.transformFlags|=4194304|fw(t.label),t.jsDoc=void 0,t.flowNode=void 0,t}function vn(e){const t=k(253);return t.label=Ei(e),t.transformFlags|=4194304|fw(t.label),t.jsDoc=void 0,t.flowNode=void 0,t}function bn(e){const t=k(254);return t.expression=e,t.transformFlags|=4194432|fw(t.expression),t.jsDoc=void 0,t.flowNode=void 0,t}function xn(e,t){const n=k(255);return n.expression=e,n.statement=Ii(t),n.transformFlags|=fw(n.expression)|fw(n.statement),n.jsDoc=void 0,n.flowNode=void 0,n}function kn(e,t){const n=k(256);return n.expression=r().parenthesizeExpressionForDisallowedComma(e),n.caseBlock=t,n.transformFlags|=fw(n.expression)|fw(n.caseBlock),n.jsDoc=void 0,n.flowNode=void 0,n.possiblyExhaustive=!1,n}function Sn(e,t){const n=k(257);return n.label=Ei(e),n.statement=Ii(t),n.transformFlags|=fw(n.label)|fw(n.statement),n.jsDoc=void 0,n.flowNode=void 0,n}function Tn(e,t,n){return e.label!==t||e.statement!==n?Oi(Sn(t,n),e):e}function Cn(e){const t=k(258);return t.expression=e,t.transformFlags|=fw(t.expression),t.jsDoc=void 0,t.flowNode=void 0,t}function wn(e,t,n){const r=k(259);return r.tryBlock=e,r.catchClause=t,r.finallyBlock=n,r.transformFlags|=fw(r.tryBlock)|fw(r.catchClause)|fw(r.finallyBlock),r.jsDoc=void 0,r.flowNode=void 0,r}function Nn(e,t,n,r){const i=S(261);return i.name=Ei(e),i.exclamationToken=t,i.type=n,i.initializer=Ai(r),i.transformFlags|=dw(i.name)|fw(i.initializer)|(i.exclamationToken??i.type?1:0),i.jsDoc=void 0,i}function Dn(e,t=0){const n=k(262);return n.flags|=7&t,n.declarations=x(e),n.transformFlags|=4194304|mw(n.declarations),7&t&&(n.transformFlags|=263168),4&t&&(n.transformFlags|=4),n}function Fn(e,t,n,r,i,o,a){const s=S(263);if(s.modifiers=Fi(e),s.asteriskToken=t,s.name=Ei(n),s.typeParameters=Fi(r),s.parameters=x(i),s.type=o,s.body=a,!s.body||128&Qv(s.modifiers))s.transformFlags=1;else{const e=1024&Qv(s.modifiers),t=!!s.asteriskToken,n=e&&t;s.transformFlags=mw(s.modifiers)|fw(s.asteriskToken)|dw(s.name)|mw(s.typeParameters)|mw(s.parameters)|fw(s.type)|-67108865&fw(s.body)|(n?128:e?256:t?2048:0)|(s.typeParameters||s.type?1:0)|4194304}return s.typeArguments=void 0,s.jsDoc=void 0,s.locals=void 0,s.nextContainer=void 0,s.endFlowNode=void 0,s.returnFlowNode=void 0,s}function En(e,t,n,r,i,o,a,s){return e.modifiers!==t||e.asteriskToken!==n||e.name!==r||e.typeParameters!==i||e.parameters!==o||e.type!==a||e.body!==s?function(e,t){e!==t&&e.modifiers===t.modifiers&&(e.modifiers=t.modifiers);return T(e,t)}(Fn(t,n,r,i,o,a,s),e):e}function Pn(e,t,n,r,i){const o=S(264);return o.modifiers=Fi(e),o.name=Ei(t),o.typeParameters=Fi(n),o.heritageClauses=Fi(r),o.members=x(i),128&Qv(o.modifiers)?o.transformFlags=1:(o.transformFlags|=mw(o.modifiers)|dw(o.name)|mw(o.typeParameters)|mw(o.heritageClauses)|mw(o.members)|(o.typeParameters?1:0)|1024,8192&o.transformFlags&&(o.transformFlags|=1)),o.jsDoc=void 0,o}function An(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.heritageClauses!==i||e.members!==o?Oi(Pn(t,n,r,i,o),e):e}function In(e,t,n,r,i){const o=S(265);return o.modifiers=Fi(e),o.name=Ei(t),o.typeParameters=Fi(n),o.heritageClauses=Fi(r),o.members=x(i),o.transformFlags=1,o.jsDoc=void 0,o}function On(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.heritageClauses!==i||e.members!==o?Oi(In(t,n,r,i,o),e):e}function Ln(e,t,n,r){const i=S(266);return i.modifiers=Fi(e),i.name=Ei(t),i.typeParameters=Fi(n),i.type=r,i.transformFlags=1,i.jsDoc=void 0,i.locals=void 0,i.nextContainer=void 0,i}function jn(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.type!==i?Oi(Ln(t,n,r,i),e):e}function Mn(e,t,n){const r=S(267);return r.modifiers=Fi(e),r.name=Ei(t),r.members=x(n),r.transformFlags|=mw(r.modifiers)|fw(r.name)|mw(r.members)|1,r.transformFlags&=-67108865,r.jsDoc=void 0,r}function Rn(e,t,n,r){return e.modifiers!==t||e.name!==n||e.members!==r?Oi(Mn(t,n,r),e):e}function Bn(e,t,n,r=0){const i=S(268);return i.modifiers=Fi(e),i.flags|=2088&r,i.name=t,i.body=n,128&Qv(i.modifiers)?i.transformFlags=1:i.transformFlags|=mw(i.modifiers)|fw(i.name)|fw(i.body)|1,i.transformFlags&=-67108865,i.jsDoc=void 0,i.locals=void 0,i.nextContainer=void 0,i}function Jn(e,t,n,r){return e.modifiers!==t||e.name!==n||e.body!==r?Oi(Bn(t,n,r,e.flags),e):e}function zn(e){const t=k(269);return t.statements=x(e),t.transformFlags|=mw(t.statements),t.jsDoc=void 0,t}function qn(e){const t=k(270);return t.clauses=x(e),t.transformFlags|=mw(t.clauses),t.locals=void 0,t.nextContainer=void 0,t}function Un(e){const t=S(271);return t.name=Ei(e),t.transformFlags|=1|pw(t.name),t.modifiers=void 0,t.jsDoc=void 0,t}function Vn(e,t,n,r){const i=S(272);return i.modifiers=Fi(e),i.name=Ei(n),i.isTypeOnly=t,i.moduleReference=r,i.transformFlags|=mw(i.modifiers)|pw(i.name)|fw(i.moduleReference),WE(i.moduleReference)||(i.transformFlags|=1),i.transformFlags&=-67108865,i.jsDoc=void 0,i}function Wn(e,t,n,r,i){return e.modifiers!==t||e.isTypeOnly!==n||e.name!==r||e.moduleReference!==i?Oi(Vn(t,n,r,i),e):e}function $n(e,t,n,r){const i=k(273);return i.modifiers=Fi(e),i.importClause=t,i.moduleSpecifier=n,i.attributes=i.assertClause=r,i.transformFlags|=fw(i.importClause)|fw(i.moduleSpecifier),i.transformFlags&=-67108865,i.jsDoc=void 0,i}function Hn(e,t,n,r,i){return e.modifiers!==t||e.importClause!==n||e.moduleSpecifier!==r||e.attributes!==i?Oi($n(t,n,r,i),e):e}function Kn(e,t,n){const r=S(274);return"boolean"==typeof e&&(e=e?156:void 0),r.isTypeOnly=156===e,r.phaseModifier=e,r.name=t,r.namedBindings=n,r.transformFlags|=fw(r.name)|fw(r.namedBindings),156===e&&(r.transformFlags|=1),r.transformFlags&=-67108865,r}function Gn(e,t){const n=k(301);return n.elements=x(e),n.multiLine=t,n.token=132,n.transformFlags|=4,n}function Xn(e,t){const n=k(302);return n.name=e,n.value=t,n.transformFlags|=4,n}function Qn(e,t){const n=k(303);return n.assertClause=e,n.multiLine=t,n}function Yn(e,t,n){const r=k(301);return r.token=n??118,r.elements=x(e),r.multiLine=t,r.transformFlags|=4,r}function Zn(e,t){const n=k(302);return n.name=e,n.value=t,n.transformFlags|=4,n}function er(e){const t=S(275);return t.name=e,t.transformFlags|=fw(t.name),t.transformFlags&=-67108865,t}function tr(e){const t=S(281);return t.name=e,t.transformFlags|=32|fw(t.name),t.transformFlags&=-67108865,t}function nr(e){const t=k(276);return t.elements=x(e),t.transformFlags|=mw(t.elements),t.transformFlags&=-67108865,t}function rr(e,t,n){const r=S(277);return r.isTypeOnly=e,r.propertyName=t,r.name=n,r.transformFlags|=fw(r.propertyName)|fw(r.name),r.transformFlags&=-67108865,r}function ir(e,t,n){const i=S(278);return i.modifiers=Fi(e),i.isExportEquals=t,i.expression=t?r().parenthesizeRightSideOfBinary(64,void 0,n):r().parenthesizeExpressionOfExportDefault(n),i.transformFlags|=mw(i.modifiers)|fw(i.expression),i.transformFlags&=-67108865,i.jsDoc=void 0,i}function or(e,t,n){return e.modifiers!==t||e.expression!==n?Oi(ir(t,e.isExportEquals,n),e):e}function ar(e,t,n,r,i){const o=S(279);return o.modifiers=Fi(e),o.isTypeOnly=t,o.exportClause=n,o.moduleSpecifier=r,o.attributes=o.assertClause=i,o.transformFlags|=mw(o.modifiers)|fw(o.exportClause)|fw(o.moduleSpecifier),o.transformFlags&=-67108865,o.jsDoc=void 0,o}function sr(e,t,n,r,i,o){return e.modifiers!==t||e.isTypeOnly!==n||e.exportClause!==r||e.moduleSpecifier!==i||e.attributes!==o?function(e,t){e!==t&&e.modifiers===t.modifiers&&(e.modifiers=t.modifiers);return Oi(e,t)}(ar(t,n,r,i,o),e):e}function cr(e){const t=k(280);return t.elements=x(e),t.transformFlags|=mw(t.elements),t.transformFlags&=-67108865,t}function lr(e,t,n){const r=k(282);return r.isTypeOnly=e,r.propertyName=Ei(t),r.name=Ei(n),r.transformFlags|=fw(r.propertyName)|fw(r.name),r.transformFlags&=-67108865,r.jsDoc=void 0,r}function _r(e){const t=k(284);return t.expression=e,t.transformFlags|=fw(t.expression),t.transformFlags&=-67108865,t}function ur(e,t,n=!1){const i=dr(e,n?t&&r().parenthesizeNonArrayTypeOfPostfixType(t):t);return i.postfix=n,i}function dr(e,t){const n=k(e);return n.type=t,n}function pr(e,t){const n=S(318);return n.parameters=Fi(e),n.type=t,n.transformFlags=mw(n.parameters)|(n.type?1:0),n.jsDoc=void 0,n.locals=void 0,n.nextContainer=void 0,n.typeArguments=void 0,n}function fr(e,t=!1){const n=S(323);return n.jsDocPropertyTags=Fi(e),n.isArrayType=t,n}function mr(e){const t=k(310);return t.type=e,t}function gr(e,t,n){const r=S(324);return r.typeParameters=Fi(e),r.parameters=x(t),r.type=n,r.jsDoc=void 0,r.locals=void 0,r.nextContainer=void 0,r}function hr(e){const t=_w(e.kind);return e.tagName.escapedText===yc(t)?e.tagName:A(t)}function yr(e,t,n){const r=k(e);return r.tagName=t,r.comment=n,r}function vr(e,t,n){const r=S(e);return r.tagName=t,r.comment=n,r}function br(e,t,n,r){const i=yr(346,e??A("template"),r);return i.constraint=t,i.typeParameters=x(n),i}function xr(e,t,n,r){const i=vr(347,e??A("typedef"),r);return i.typeExpression=t,i.fullName=n,i.name=KA(n),i.locals=void 0,i.nextContainer=void 0,i}function kr(e,t,n,r,i,o){const a=vr(342,e??A("param"),o);return a.typeExpression=r,a.name=t,a.isNameFirst=!!i,a.isBracketed=n,a}function Sr(e,t,n,r,i,o){const a=vr(349,e??A("prop"),o);return a.typeExpression=r,a.name=t,a.isNameFirst=!!i,a.isBracketed=n,a}function Tr(e,t,n,r){const i=vr(339,e??A("callback"),r);return i.typeExpression=t,i.fullName=n,i.name=KA(n),i.locals=void 0,i.nextContainer=void 0,i}function Cr(e,t,n){const r=yr(340,e??A("overload"),n);return r.typeExpression=t,r}function wr(e,t,n){const r=yr(329,e??A("augments"),n);return r.class=t,r}function Nr(e,t,n){const r=yr(330,e??A("implements"),n);return r.class=t,r}function Dr(e,t,n){const r=yr(348,e??A("see"),n);return r.name=t,r}function Fr(e){const t=k(311);return t.name=e,t}function Er(e,t){const n=k(312);return n.left=e,n.right=t,n.transformFlags|=fw(n.left)|fw(n.right),n}function Pr(e,t){const n=k(325);return n.name=e,n.text=t,n}function Ar(e,t){const n=k(326);return n.name=e,n.text=t,n}function Ir(e,t){const n=k(327);return n.name=e,n.text=t,n}function Or(e,t,n){return yr(e,t??A(_w(e)),n)}function Lr(e,t,n,r){const i=yr(e,t??A(_w(e)),r);return i.typeExpression=n,i}function jr(e,t){return yr(328,e,t)}function Mr(e,t,n){const r=vr(341,e??A(_w(341)),n);return r.typeExpression=t,r.locals=void 0,r.nextContainer=void 0,r}function Rr(e,t,n,r,i){const o=yr(352,e??A("import"),i);return o.importClause=t,o.moduleSpecifier=n,o.attributes=r,o.comment=i,o}function Br(e){const t=k(322);return t.text=e,t}function Jr(e,t){const n=k(321);return n.comment=e,n.tags=Fi(t),n}function zr(e,t,n){const r=k(285);return r.openingElement=e,r.children=x(t),r.closingElement=n,r.transformFlags|=fw(r.openingElement)|mw(r.children)|fw(r.closingElement)|2,r}function qr(e,t,n){const r=k(286);return r.tagName=e,r.typeArguments=Fi(t),r.attributes=n,r.transformFlags|=fw(r.tagName)|mw(r.typeArguments)|fw(r.attributes)|2,r.typeArguments&&(r.transformFlags|=1),r}function Ur(e,t,n){const r=k(287);return r.tagName=e,r.typeArguments=Fi(t),r.attributes=n,r.transformFlags|=fw(r.tagName)|mw(r.typeArguments)|fw(r.attributes)|2,t&&(r.transformFlags|=1),r}function Vr(e){const t=k(288);return t.tagName=e,t.transformFlags|=2|fw(t.tagName),t}function Wr(e,t,n){const r=k(289);return r.openingFragment=e,r.children=x(t),r.closingFragment=n,r.transformFlags|=fw(r.openingFragment)|mw(r.children)|fw(r.closingFragment)|2,r}function $r(e,t){const n=k(12);return n.text=e,n.containsOnlyTriviaWhiteSpaces=!!t,n.transformFlags|=2,n}function Hr(e,t){const n=S(292);return n.name=e,n.initializer=t,n.transformFlags|=fw(n.name)|fw(n.initializer)|2,n}function Kr(e){const t=S(293);return t.properties=x(e),t.transformFlags|=2|mw(t.properties),t}function Gr(e){const t=k(294);return t.expression=e,t.transformFlags|=2|fw(t.expression),t}function Xr(e,t){const n=k(295);return n.dotDotDotToken=e,n.expression=t,n.transformFlags|=fw(n.dotDotDotToken)|fw(n.expression)|2,n}function Qr(e,t){const n=k(296);return n.namespace=e,n.name=t,n.transformFlags|=fw(n.namespace)|fw(n.name)|2,n}function Yr(e,t){const n=k(297);return n.expression=r().parenthesizeExpressionForDisallowedComma(e),n.statements=x(t),n.transformFlags|=fw(n.expression)|mw(n.statements),n.jsDoc=void 0,n}function Zr(e){const t=k(298);return t.statements=x(e),t.transformFlags=mw(t.statements),t}function ei(e,t){const n=k(299);switch(n.token=e,n.types=x(t),n.transformFlags|=mw(n.types),e){case 96:n.transformFlags|=1024;break;case 119:n.transformFlags|=1;break;default:return pn.assertNever(e)}return n}function ti(e,t){const n=k(300);return n.variableDeclaration=function(e){if("string"==typeof e||e&&!fE(e))return Nn(e,void 0,void 0,void 0);return e}(e),n.block=t,n.transformFlags|=fw(n.variableDeclaration)|fw(n.block)|(e?0:64),n.locals=void 0,n.nextContainer=void 0,n}function ni(e,t){const n=S(304);return n.name=Ei(e),n.initializer=r().parenthesizeExpressionForDisallowedComma(t),n.transformFlags|=dw(n.name)|fw(n.initializer),n.modifiers=void 0,n.questionToken=void 0,n.exclamationToken=void 0,n.jsDoc=void 0,n}function ri(e,t,n){return e.name!==t||e.initializer!==n?function(e,t){e!==t&&(e.modifiers=t.modifiers,e.questionToken=t.questionToken,e.exclamationToken=t.exclamationToken);return Oi(e,t)}(ni(t,n),e):e}function ii(e,t){const n=S(305);return n.name=Ei(e),n.objectAssignmentInitializer=t&&r().parenthesizeExpressionForDisallowedComma(t),n.transformFlags|=pw(n.name)|fw(n.objectAssignmentInitializer)|1024,n.equalsToken=void 0,n.modifiers=void 0,n.questionToken=void 0,n.exclamationToken=void 0,n.jsDoc=void 0,n}function oi(e){const t=S(306);return t.expression=r().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=65664|fw(t.expression),t.jsDoc=void 0,t}function ai(e,t){const n=S(307);return n.name=Ei(e),n.initializer=t&&r().parenthesizeExpressionForDisallowedComma(t),n.transformFlags|=fw(n.name)|fw(n.initializer)|1,n.jsDoc=void 0,n}function si(e){const t=Object.create(e.redirectTarget);return Object.defineProperties(t,{id:{get(){return this.redirectInfo.redirectTarget.id},set(e){this.redirectInfo.redirectTarget.id=e}},symbol:{get(){return this.redirectInfo.redirectTarget.symbol},set(e){this.redirectInfo.redirectTarget.symbol=e}}}),t.redirectInfo=e,t}function ci(e){const r=e.redirectInfo?function(e){const t=si(e.redirectInfo);return t.flags|=-17&e.flags,t.fileName=e.fileName,t.path=e.path,t.resolvedPath=e.resolvedPath,t.originalFileName=e.originalFileName,t.packageJsonLocations=e.packageJsonLocations,t.packageJsonScope=e.packageJsonScope,t.emitNode=void 0,t}(e):function(e){const n=t.createBaseSourceFileNode(308);n.flags|=-17&e.flags;for(const t in e)!Ee(n,t)&&Ee(e,t)&&("emitNode"!==t?n[t]=e[t]:n.emitNode=void 0);return n}(e);return n(r,e),r}function li(e){const t=k(309);return t.sourceFiles=e,t.syntheticFileReferences=void 0,t.syntheticTypeReferences=void 0,t.syntheticLibReferences=void 0,t.hasNoDefaultLib=void 0,t}function _i(e,t){const n=k(356);return n.expression=e,n.original=t,n.transformFlags|=1|fw(n.expression),FI(n,t),n}function ui(e,t){return e.expression!==t?Oi(_i(t,e.original),e):e}function di(e){if(iy(e)&&!gc(e)&&!e.original&&!e.emitNode&&!e.id){if($F(e))return e.elements;if(AF(e)&&nD(e.operatorToken))return[e.left,e.right]}return e}function pi(e){const t=k(357);return t.elements=x(R(e,di)),t.transformFlags|=mw(t.elements),t}function fi(e,t){const n=k(358);return n.expression=e,n.thisArg=t,n.transformFlags|=fw(n.expression)|fw(n.thisArg),n}function mi(e){if(void 0===e)return e;if(dP(e))return ci(e);if(Gl(e))return function(e){const t=E(e.escapedText);return t.flags|=-17&e.flags,t.transformFlags=e.transformFlags,n(t,e),oN(t,{...e.emitNode.autoGenerate}),t}(e);if(uD(e))return function(e){const t=E(e.escapedText);t.flags|=-17&e.flags,t.jsDoc=e.jsDoc,t.flowNode=e.flowNode,t.symbol=e.symbol,t.transformFlags=e.transformFlags,n(t,e);const r=iN(e);return r&&rN(t,r),t}(e);if(Xl(e))return function(e){const t=L(e.escapedText);return t.flags|=-17&e.flags,t.transformFlags=e.transformFlags,n(t,e),oN(t,{...e.emitNode.autoGenerate}),t}(e);if(dD(e))return function(e){const t=L(e.escapedText);return t.flags|=-17&e.flags,t.transformFlags=e.transformFlags,n(t,e),t}(e);const r=Al(e.kind)?t.createBaseNode(e.kind):t.createBaseTokenNode(e.kind);r.flags|=-17&e.flags,r.transformFlags=e.transformFlags,n(r,e);for(const t in e)!Ee(r,t)&&Ee(e,t)&&(r[t]=e[t]);return r}function gi(){return Et(C("0"))}function hi(e,t,n){return bl(e)?gt(rt(e,void 0,t),void 0,void 0,n):pt(nt(e,t),void 0,n)}function yi(e,t,n){return hi(A(e),t,n)}function vi(e,t,n){return!!n&&(e.push(ni(t,n)),!0)}function bi(e,t){const n=_h(e);switch(n.kind){case 80:return t;case 110:case 9:case 10:case 11:return!1;case 210:return 0!==n.elements.length;case 211:return n.properties.length>0;default:return!0}}function xi(e,t,n,r=0,i){const o=i?e&&Dc(e):Fc(e);if(o&&uD(o)&&!Gl(o)){const e=IT(FI(mi(o),o),o.parent);return r|=rp(o),n||(r|=96),t||(r|=3072),r&&ww(e,r),e}return O(e)}function ki(e,t,n){return xi(e,t,n,16384)}function Si(e,t,n,r){const i=nt(e,iy(t)?t:mi(t));FI(i,t);let o=0;return r||(o|=96),n||(o|=3072),o&&ww(i,o),i}function Ti(e){return KN(e.expression)&&"use strict"===e.expression.text}function Ci(){return OA(_n(D("use strict")))}function wi(e,t,n=0,r){pn.assert(0===t.length,"Prologue directives should be at the first statement in the target statements array");let i=!1;const o=e.length;for(;n=183&&e<=206)return-2;switch(e){case 214:case 215:case 210:case 207:case 208:return-2147450880;case 268:return-1941676032;case 170:case 217:case 239:case 235:case 356:case 218:case 108:case 212:case 213:default:return-2147483648;case 220:return-2072174592;case 219:case 263:return-1937940480;case 262:return-2146893824;case 264:case 232:return-2147344384;case 177:return-1937948672;case 173:return-2013249536;case 175:case 178:case 179:return-2005057536;case 133:case 150:case 163:case 146:case 154:case 151:case 136:case 155:case 116:case 169:case 172:case 174:case 180:case 181:case 182:case 265:case 266:return-2;case 211:return-2147278848;case 300:return-2147418112}}(e.kind);return Nc(e)&&o_(e.name)?(n=e.name,t|134234112&n.transformFlags):t;var n}function mw(e){return e?e.transformFlags:0}function gw(e){let t=0;for(const n of e)t|=fw(n);e.transformFlags=t}var hw=ZC();function yw(e){return e.flags|=16,e}var vw,bw=lw(4,{createBaseSourceFileNode:e=>yw(hw.createBaseSourceFileNode(e)),createBaseIdentifierNode:e=>yw(hw.createBaseIdentifierNode(e)),createBasePrivateIdentifierNode:e=>yw(hw.createBasePrivateIdentifierNode(e)),createBaseTokenNode:e=>yw(hw.createBaseTokenNode(e)),createBaseNode:e=>yw(hw.createBaseNode(e))});function xw(e,t,n){return new(vw||(vw=qx.getSourceMapSourceConstructor()))(e,t,n)}function kw(e,t){if(e.original!==t&&(e.original=t,t)){const n=t.emitNode;n&&(e.emitNode=function(e,t){const{flags:n,internalFlags:r,leadingComments:i,trailingComments:o,commentRange:a,sourceMapRange:s,tokenSourceMapRanges:c,constantValue:l,helpers:_,startsOnNewLine:u,snippetElement:d,classThis:p,assignedName:f}=e;t||(t={});n&&(t.flags=n);r&&(t.internalFlags=-9&r);i&&(t.leadingComments=le(i.slice(),t.leadingComments));o&&(t.trailingComments=le(o.slice(),t.trailingComments));a&&(t.commentRange=a);s&&(t.sourceMapRange=s);c&&(t.tokenSourceMapRanges=function(e,t){t||(t=[]);for(const n in e)t[n]=e[n];return t}(c,t.tokenSourceMapRanges));void 0!==l&&(t.constantValue=l);if(_)for(const e of _)t.helpers=ue(t.helpers,e);void 0!==u&&(t.startsOnNewLine=u);void 0!==d&&(t.snippetElement=d);p&&(t.classThis=p);f&&(t.assignedName=f);return t}(n,e.emitNode))}return e}function Sw(e){if(e.emitNode)pn.assert(!(8&e.emitNode.internalFlags),"Invalid attempt to mutate an immutable node.");else{if(gc(e)){if(308===e.kind)return e.emitNode={annotatedNodes:[e]};Sw(Sd(hc(Sd(e)))??pn.fail("Could not determine parsed source file.")).annotatedNodes.push(e)}e.emitNode={}}return e.emitNode}function Tw(e){var t,n;const r=null==(n=null==(t=Sd(hc(e)))?void 0:t.emitNode)?void 0:n.annotatedNodes;if(r)for(const e of r)e.emitNode=void 0}function Cw(e){const t=Sw(e);return t.flags|=3072,t.leadingComments=void 0,t.trailingComments=void 0,e}function ww(e,t){return Sw(e).flags=t,e}function Nw(e,t){const n=Sw(e);return n.flags=n.flags|t,e}function Dw(e,t){return Sw(e).internalFlags=t,e}function Fw(e,t){const n=Sw(e);return n.internalFlags=n.internalFlags|t,e}function Ew(e){var t;return(null==(t=e.emitNode)?void 0:t.sourceMapRange)??e}function Pw(e,t){return Sw(e).sourceMapRange=t,e}function Aw(e,t){var n,r;return null==(r=null==(n=e.emitNode)?void 0:n.tokenSourceMapRanges)?void 0:r[t]}function Iw(e,t,n){const r=Sw(e);return(r.tokenSourceMapRanges??(r.tokenSourceMapRanges=[]))[t]=n,e}function Ow(e){var t;return null==(t=e.emitNode)?void 0:t.startsOnNewLine}function Lw(e,t){return Sw(e).startsOnNewLine=t,e}function jw(e){var t;return(null==(t=e.emitNode)?void 0:t.commentRange)??e}function Mw(e,t){return Sw(e).commentRange=t,e}function Rw(e){var t;return null==(t=e.emitNode)?void 0:t.leadingComments}function Bw(e,t){return Sw(e).leadingComments=t,e}function Jw(e,t,n,r){return Bw(e,ae(Rw(e),{kind:t,pos:-1,end:-1,hasTrailingNewLine:r,text:n}))}function zw(e){var t;return null==(t=e.emitNode)?void 0:t.trailingComments}function qw(e,t){return Sw(e).trailingComments=t,e}function Uw(e,t,n,r){return qw(e,ae(zw(e),{kind:t,pos:-1,end:-1,hasTrailingNewLine:r,text:n}))}function Vw(e,t){Bw(e,Rw(t)),qw(e,zw(t));const n=Sw(t);return n.leadingComments=void 0,n.trailingComments=void 0,e}function Ww(e){var t;return null==(t=e.emitNode)?void 0:t.constantValue}function $w(e,t){return Sw(e).constantValue=t,e}function Hw(e,t){const n=Sw(e);return n.helpers=ae(n.helpers,t),e}function Kw(e,t){if(H(t)){const n=Sw(e);for(const e of t)n.helpers=ue(n.helpers,e)}return e}function Gw(e,t){var n;const r=null==(n=e.emitNode)?void 0:n.helpers;return!!r&&Ut(r,t)}function Xw(e){var t;return null==(t=e.emitNode)?void 0:t.helpers}function Qw(e,t,n){const r=e.emitNode,i=r&&r.helpers;if(!H(i))return;const o=Sw(t);let a=0;for(let e=0;e0&&(i[e-a]=t)}a>0&&(i.length-=a)}function Yw(e){var t;return null==(t=e.emitNode)?void 0:t.snippetElement}function Zw(e,t){return Sw(e).snippetElement=t,e}function eN(e){return Sw(e).internalFlags|=4,e}function tN(e,t){return Sw(e).typeNode=t,e}function nN(e){var t;return null==(t=e.emitNode)?void 0:t.typeNode}function rN(e,t){return Sw(e).identifierTypeArguments=t,e}function iN(e){var t;return null==(t=e.emitNode)?void 0:t.identifierTypeArguments}function oN(e,t){return Sw(e).autoGenerate=t,e}function aN(e){var t;return null==(t=e.emitNode)?void 0:t.autoGenerate}function sN(e,t){return Sw(e).generatedImportReference=t,e}function cN(e){var t;return null==(t=e.emitNode)?void 0:t.generatedImportReference}var lN=(e=>(e.Field="f",e.Method="m",e.Accessor="a",e))(lN||{});function _N(e){const t=e.factory,n=ft(()=>Dw(t.createTrue(),8)),r=ft(()=>Dw(t.createFalse(),8));return{getUnscopedHelperName:i,createDecorateHelper:function(n,r,o,a){e.requestEmitHelper(pN);const s=[];s.push(t.createArrayLiteralExpression(n,!0)),s.push(r),o&&(s.push(o),a&&s.push(a));return t.createCallExpression(i("__decorate"),void 0,s)},createMetadataHelper:function(n,r){return e.requestEmitHelper(fN),t.createCallExpression(i("__metadata"),void 0,[t.createStringLiteral(n),r])},createParamHelper:function(n,r,o){return e.requestEmitHelper(mN),FI(t.createCallExpression(i("__param"),void 0,[t.createNumericLiteral(r+""),n]),o)},createESDecorateHelper:function(n,r,o,s,c,l){return e.requestEmitHelper(gN),t.createCallExpression(i("__esDecorate"),void 0,[n??t.createNull(),r??t.createNull(),o,a(s),c,l])},createRunInitializersHelper:function(n,r,o){return e.requestEmitHelper(hN),t.createCallExpression(i("__runInitializers"),void 0,o?[n,r,o]:[n,r])},createAssignHelper:function(n){if(Sk(e.getCompilerOptions())>=2)return t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"assign"),void 0,n);return e.requestEmitHelper(yN),t.createCallExpression(i("__assign"),void 0,n)},createAwaitHelper:function(n){return e.requestEmitHelper(vN),t.createCallExpression(i("__await"),void 0,[n])},createAsyncGeneratorHelper:function(n,r){return e.requestEmitHelper(vN),e.requestEmitHelper(bN),(n.emitNode||(n.emitNode={})).flags|=1572864,t.createCallExpression(i("__asyncGenerator"),void 0,[r?t.createThis():t.createVoidZero(),t.createIdentifier("arguments"),n])},createAsyncDelegatorHelper:function(n){return e.requestEmitHelper(vN),e.requestEmitHelper(xN),t.createCallExpression(i("__asyncDelegator"),void 0,[n])},createAsyncValuesHelper:function(n){return e.requestEmitHelper(kN),t.createCallExpression(i("__asyncValues"),void 0,[n])},createRestHelper:function(n,r,o,a){e.requestEmitHelper(SN);const s=[];let c=0;for(let e=0;e{let r="";for(let i=0;i= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };'},fN={name:"typescript:metadata",importName:"__metadata",scoped:!1,priority:3,text:'\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n };'},mN={name:"typescript:param",importName:"__param",scoped:!1,priority:4,text:"\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };"},gN={name:"typescript:esDecorate",importName:"__esDecorate",scoped:!1,priority:2,text:'\n var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }\n var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";\n var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === "accessor") {\n if (result === void 0) continue;\n if (result === null || typeof result !== "object") throw new TypeError("Object expected");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === "field") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n };'},hN={name:"typescript:runInitializers",importName:"__runInitializers",scoped:!1,priority:2,text:"\n var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n };"},yN={name:"typescript:assign",importName:"__assign",scoped:!1,priority:1,text:"\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };"},vN={name:"typescript:await",importName:"__await",scoped:!1,text:"\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }"},bN={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:!1,dependencies:[vN],text:'\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n 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]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume("next", value); }\n function reject(value) { resume("throw", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };'},xN={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:!1,dependencies:[vN],text:'\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n };'},kN={name:"typescript:asyncValues",importName:"__asyncValues",scoped:!1,text:'\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n };'},SN={name:"typescript:rest",importName:"__rest",scoped:!1,text:'\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };'},TN={name:"typescript:awaiter",importName:"__awaiter",scoped:!1,priority:5,text:'\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };'},CN={name:"typescript:extends",importName:"__extends",scoped:!1,priority:0,text:'\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();'},wN={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:!1,priority:0,text:'\n var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };'},NN={name:"typescript:read",importName:"__read",scoped:!1,text:'\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };'},DN={name:"typescript:spreadArray",importName:"__spreadArray",scoped:!1,text:"\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };"},FN={name:"typescript:propKey",importName:"__propKey",scoped:!1,text:'\n var __propKey = (this && this.__propKey) || function (x) {\n return typeof x === "symbol" ? x : "".concat(x);\n };'},EN={name:"typescript:setFunctionName",importName:"__setFunctionName",scoped:!1,text:'\n var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {\n if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";\n return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });\n };'},PN={name:"typescript:values",importName:"__values",scoped:!1,text:'\n var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n };'},AN={name:"typescript:generator",importName:"__generator",scoped:!1,priority:6,text:'\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);\n return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };'},IN={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:!1,priority:1,text:'\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));'},ON={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:!1,dependencies:[IN,{name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:!1,priority:1,text:'\n var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n }) : function(o, v) {\n o["default"] = v;\n });'}],priority:2,text:'\n var __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n })();'},LN={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:!1,text:'\n var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n };'},jN={name:"typescript:export-star",importName:"__exportStar",scoped:!1,dependencies:[IN],priority:2,text:'\n var __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n };'},MN={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:!1,text:'\n var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");\n return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);\n };'},RN={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:!1,text:'\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === "m") throw new TypeError("Private method is not writable");\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");\n return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };'},BN={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:!1,text:'\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use \'in\' operator on non-object");\n return typeof state === "function" ? receiver === state : state.has(receiver);\n };'},JN={name:"typescript:addDisposableResource",importName:"__addDisposableResource",scoped:!1,text:'\n var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== "function") throw new TypeError("Object not disposable.");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n };'},zN={name:"typescript:disposeResources",importName:"__disposeResources",scoped:!1,text:'\n var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {\n return function (env) {\n function fail(e) {\n env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n };\n })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;\n });'},qN={name:"typescript:rewriteRelativeImportExtensions",importName:"__rewriteRelativeImportExtension",scoped:!1,text:'\n var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {\n if (typeof path === "string" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");\n });\n }\n return path;\n };'},UN={name:"typescript:async-super",scoped:!0,text:dN` + const ${"_superIndex"} = name => super[name];`},VN={name:"typescript:advanced-async-super",scoped:!0,text:dN` + const ${"_superIndex"} = (function (geti, seti) { + const cache = Object.create(null); + return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); + })(name => super[name], (name, value) => super[name] = value);`};function WN(e,t){return vF(e)&&uD(e.expression)&&!!(8192&rp(e.expression))&&e.expression.escapedText===t}function $N(e){return 9===e.kind}function HN(e){return 10===e.kind}function KN(e){return 11===e.kind}function GN(e){return 12===e.kind}function XN(e){return 14===e.kind}function QN(e){return 15===e.kind}function YN(e){return 16===e.kind}function ZN(e){return 17===e.kind}function eD(e){return 18===e.kind}function tD(e){return 26===e.kind}function nD(e){return 28===e.kind}function rD(e){return 40===e.kind}function iD(e){return 41===e.kind}function oD(e){return 42===e.kind}function aD(e){return 54===e.kind}function sD(e){return 58===e.kind}function cD(e){return 59===e.kind}function lD(e){return 29===e.kind}function _D(e){return 39===e.kind}function uD(e){return 80===e.kind}function dD(e){return 81===e.kind}function pD(e){return 95===e.kind}function fD(e){return 90===e.kind}function mD(e){return 134===e.kind}function gD(e){return 131===e.kind}function hD(e){return 135===e.kind}function yD(e){return 148===e.kind}function vD(e){return 126===e.kind}function bD(e){return 128===e.kind}function xD(e){return 164===e.kind}function kD(e){return 129===e.kind}function SD(e){return 108===e.kind}function TD(e){return 102===e.kind}function CD(e){return 84===e.kind}function wD(e){return 167===e.kind}function ND(e){return 168===e.kind}function DD(e){return 169===e.kind}function FD(e){return 170===e.kind}function ED(e){return 171===e.kind}function PD(e){return 172===e.kind}function AD(e){return 173===e.kind}function ID(e){return 174===e.kind}function OD(e){return 175===e.kind}function LD(e){return 176===e.kind}function jD(e){return 177===e.kind}function MD(e){return 178===e.kind}function RD(e){return 179===e.kind}function BD(e){return 180===e.kind}function JD(e){return 181===e.kind}function zD(e){return 182===e.kind}function qD(e){return 183===e.kind}function UD(e){return 184===e.kind}function VD(e){return 185===e.kind}function WD(e){return 186===e.kind}function $D(e){return 187===e.kind}function HD(e){return 188===e.kind}function KD(e){return 189===e.kind}function GD(e){return 190===e.kind}function XD(e){return 203===e.kind}function QD(e){return 191===e.kind}function YD(e){return 192===e.kind}function ZD(e){return 193===e.kind}function eF(e){return 194===e.kind}function tF(e){return 195===e.kind}function nF(e){return 196===e.kind}function rF(e){return 197===e.kind}function iF(e){return 198===e.kind}function oF(e){return 199===e.kind}function aF(e){return 200===e.kind}function sF(e){return 201===e.kind}function cF(e){return 202===e.kind}function lF(e){return 206===e.kind}function _F(e){return 205===e.kind}function uF(e){return 204===e.kind}function dF(e){return 207===e.kind}function pF(e){return 208===e.kind}function fF(e){return 209===e.kind}function mF(e){return 210===e.kind}function gF(e){return 211===e.kind}function hF(e){return 212===e.kind}function yF(e){return 213===e.kind}function vF(e){return 214===e.kind}function bF(e){return 215===e.kind}function xF(e){return 216===e.kind}function kF(e){return 217===e.kind}function SF(e){return 218===e.kind}function TF(e){return 219===e.kind}function CF(e){return 220===e.kind}function wF(e){return 221===e.kind}function NF(e){return 222===e.kind}function DF(e){return 223===e.kind}function FF(e){return 224===e.kind}function EF(e){return 225===e.kind}function PF(e){return 226===e.kind}function AF(e){return 227===e.kind}function IF(e){return 228===e.kind}function OF(e){return 229===e.kind}function LF(e){return 230===e.kind}function jF(e){return 231===e.kind}function MF(e){return 232===e.kind}function RF(e){return 233===e.kind}function BF(e){return 234===e.kind}function JF(e){return 235===e.kind}function zF(e){return 239===e.kind}function qF(e){return 236===e.kind}function UF(e){return 237===e.kind}function VF(e){return 238===e.kind}function WF(e){return 356===e.kind}function $F(e){return 357===e.kind}function HF(e){return 240===e.kind}function KF(e){return 241===e.kind}function GF(e){return 242===e.kind}function XF(e){return 244===e.kind}function QF(e){return 243===e.kind}function YF(e){return 245===e.kind}function ZF(e){return 246===e.kind}function eE(e){return 247===e.kind}function tE(e){return 248===e.kind}function nE(e){return 249===e.kind}function rE(e){return 250===e.kind}function iE(e){return 251===e.kind}function oE(e){return 252===e.kind}function aE(e){return 253===e.kind}function sE(e){return 254===e.kind}function cE(e){return 255===e.kind}function lE(e){return 256===e.kind}function _E(e){return 257===e.kind}function uE(e){return 258===e.kind}function dE(e){return 259===e.kind}function pE(e){return 260===e.kind}function fE(e){return 261===e.kind}function mE(e){return 262===e.kind}function gE(e){return 263===e.kind}function hE(e){return 264===e.kind}function yE(e){return 265===e.kind}function vE(e){return 266===e.kind}function bE(e){return 267===e.kind}function xE(e){return 268===e.kind}function kE(e){return 269===e.kind}function SE(e){return 270===e.kind}function TE(e){return 271===e.kind}function CE(e){return 272===e.kind}function wE(e){return 273===e.kind}function NE(e){return 274===e.kind}function DE(e){return 303===e.kind}function FE(e){return 301===e.kind}function EE(e){return 302===e.kind}function PE(e){return 301===e.kind}function AE(e){return 302===e.kind}function IE(e){return 275===e.kind}function OE(e){return 281===e.kind}function LE(e){return 276===e.kind}function jE(e){return 277===e.kind}function ME(e){return 278===e.kind}function RE(e){return 279===e.kind}function BE(e){return 280===e.kind}function JE(e){return 282===e.kind}function zE(e){return 80===e.kind||11===e.kind}function qE(e){return 283===e.kind}function UE(e){return 354===e.kind}function VE(e){return 358===e.kind}function WE(e){return 284===e.kind}function $E(e){return 285===e.kind}function HE(e){return 286===e.kind}function KE(e){return 287===e.kind}function GE(e){return 288===e.kind}function XE(e){return 289===e.kind}function QE(e){return 290===e.kind}function YE(e){return 291===e.kind}function ZE(e){return 292===e.kind}function eP(e){return 293===e.kind}function tP(e){return 294===e.kind}function nP(e){return 295===e.kind}function rP(e){return 296===e.kind}function iP(e){return 297===e.kind}function oP(e){return 298===e.kind}function aP(e){return 299===e.kind}function sP(e){return 300===e.kind}function cP(e){return 304===e.kind}function lP(e){return 305===e.kind}function _P(e){return 306===e.kind}function uP(e){return 307===e.kind}function dP(e){return 308===e.kind}function pP(e){return 309===e.kind}function fP(e){return 310===e.kind}function mP(e){return 311===e.kind}function gP(e){return 312===e.kind}function hP(e){return 325===e.kind}function yP(e){return 326===e.kind}function vP(e){return 327===e.kind}function bP(e){return 313===e.kind}function xP(e){return 314===e.kind}function kP(e){return 315===e.kind}function SP(e){return 316===e.kind}function TP(e){return 317===e.kind}function CP(e){return 318===e.kind}function wP(e){return 319===e.kind}function NP(e){return 320===e.kind}function DP(e){return 321===e.kind}function FP(e){return 323===e.kind}function EP(e){return 324===e.kind}function PP(e){return 329===e.kind}function AP(e){return 331===e.kind}function IP(e){return 333===e.kind}function OP(e){return 339===e.kind}function LP(e){return 334===e.kind}function jP(e){return 335===e.kind}function MP(e){return 336===e.kind}function RP(e){return 337===e.kind}function BP(e){return 338===e.kind}function JP(e){return 340===e.kind}function zP(e){return 332===e.kind}function qP(e){return 348===e.kind}function UP(e){return 341===e.kind}function VP(e){return 342===e.kind}function WP(e){return 343===e.kind}function $P(e){return 344===e.kind}function HP(e){return 345===e.kind}function KP(e){return 346===e.kind}function GP(e){return 347===e.kind}function XP(e){return 328===e.kind}function QP(e){return 349===e.kind}function YP(e){return 330===e.kind}function ZP(e){return 351===e.kind}function eA(e){return 350===e.kind}function tA(e){return 352===e.kind}function nA(e){return 353===e.kind}var rA,iA=new WeakMap;function oA(e,t){var n;const r=e.kind;return Al(r)?353===r?e._children:null==(n=iA.get(t))?void 0:n.get(e):_}function aA(e,t,n){353===e.kind&&pn.fail("Should not need to re-set the children of a SyntaxList.");let r=iA.get(t);return void 0===r&&(r=new WeakMap,iA.set(t,r)),r.set(e,n),n}function sA(e,t){var n;353===e.kind&&pn.fail("Did not expect to unset the children of a SyntaxList."),null==(n=iA.get(t))||n.delete(e)}function cA(e,t){const n=iA.get(e);void 0!==n&&(iA.delete(e),iA.set(t,n))}function lA(e){return e.createExportDeclaration(void 0,!1,e.createNamedExports([]),void 0)}function _A(e,t,n,r){if(ND(n))return FI(e.createElementAccessExpression(t,n.expression),r);{const r=FI(gl(n)?e.createPropertyAccessExpression(t,n):e.createElementAccessExpression(t,n),n);return Nw(r,128),r}}function uA(e,t){const n=II.createIdentifier(e||"React");return IT(n,hc(t)),n}function dA(e,t,n){if(wD(t)){const r=dA(e,t.left,n),i=e.createIdentifier(bc(t.right));return i.escapedText=t.right.escapedText,e.createPropertyAccessExpression(r,i)}return uA(bc(t),n)}function pA(e,t,n,r){return t?dA(e,t,r):e.createPropertyAccessExpression(uA(n,r),"createElement")}function fA(e,t,n,r,i,o){const a=[n];if(r&&a.push(r),i&&i.length>0)if(r||a.push(e.createNull()),i.length>1)for(const e of i)OA(e),a.push(e);else a.push(i[0]);return FI(e.createCallExpression(t,void 0,a),o)}function mA(e,t,n,r,i,o,a){const s=function(e,t,n,r){return t?dA(e,t,r):e.createPropertyAccessExpression(uA(n,r),"Fragment")}(e,n,r,o),c=[s,e.createNull()];if(i&&i.length>0)if(i.length>1)for(const e of i)OA(e),c.push(e);else c.push(i[0]);return FI(e.createCallExpression(pA(e,t,r,o),void 0,c),a)}function gA(e,t,n){if(mE(t)){const r=ye(t.declarations),i=e.updateVariableDeclaration(r,r.name,void 0,void 0,n);return FI(e.createVariableStatement(void 0,e.updateVariableDeclarationList(t,[i])),t)}{const r=FI(e.createAssignment(t,n),t);return FI(e.createExpressionStatement(r),t)}}function hA(e,t){if(wD(t)){const n=hA(e,t.left),r=IT(FI(e.cloneNode(t.right),t.right),t.right.parent);return FI(e.createPropertyAccessExpression(n,r),t)}return IT(FI(e.cloneNode(t),t),t.parent)}function yA(e,t){return uD(t)?e.createStringLiteralFromNode(t):ND(t)?IT(FI(e.cloneNode(t.expression),t.expression),t.expression.parent):IT(FI(e.cloneNode(t),t),t.parent)}function vA(e,t,n,r){switch(n.name&&dD(n.name)&&pn.failBadSyntaxKind(n.name,"Private identifiers are not allowed in object literals."),n.kind){case 178:case 179:return function(e,t,n,r,i){const{firstAccessor:o,getAccessor:a,setAccessor:s}=hv(t,n);if(n===o)return FI(e.createObjectDefinePropertyCall(r,yA(e,n.name),e.createPropertyDescriptor({enumerable:e.createFalse(),configurable:!0,get:a&&FI(kw(e.createFunctionExpression(Ac(a),void 0,void 0,void 0,a.parameters,void 0,a.body),a),a),set:s&&FI(kw(e.createFunctionExpression(Ac(s),void 0,void 0,void 0,s.parameters,void 0,s.body),s),s)},!i)),o)}(e,t.properties,n,r,!!t.multiLine);case 304:return function(e,t,n){return kw(FI(e.createAssignment(_A(e,n,t.name,t.name),t.initializer),t),t)}(e,n,r);case 305:return function(e,t,n){return kw(FI(e.createAssignment(_A(e,n,t.name,t.name),e.cloneNode(t.name)),t),t)}(e,n,r);case 175:return function(e,t,n){return kw(FI(e.createAssignment(_A(e,n,t.name,t.name),kw(FI(e.createFunctionExpression(Ac(t),t.asteriskToken,void 0,void 0,t.parameters,void 0,t.body),t),t)),t),t)}(e,n,r)}}function bA(e,t,n,r,i){const o=t.operator;pn.assert(46===o||47===o,"Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");const a=e.createTempVariable(r);FI(n=e.createAssignment(a,n),t.operand);let s=EF(t)?e.createPrefixUnaryExpression(o,a):e.createPostfixUnaryExpression(a,o);return FI(s,t),i&&(s=e.createAssignment(i,s),FI(s,t)),FI(n=e.createComma(n,s),t),PF(t)&&FI(n=e.createComma(n,a),t),n}function xA(e){return!!(65536&rp(e))}function kA(e){return!!(32768&rp(e))}function SA(e){return!!(16384&rp(e))}function TA(e){return KN(e.expression)&&"use strict"===e.expression.text}function CA(e){for(const t of e){if(!hf(t))break;if(TA(t))return t}}function wA(e){const t=ge(e);return void 0!==t&&hf(t)&&TA(t)}function NA(e){return 227===e.kind&&28===e.operatorToken.kind}function DA(e){return NA(e)||$F(e)}function FA(e){return SF(e)&&Om(e)&&!!ol(e)}function EA(e){const t=al(e);return pn.assertIsDefined(t),t}function PA(e,t=63){switch(e.kind){case 218:return!(-2147483648&t&&FA(e))&&!!(1&t);case 217:case 235:return!!(2&t);case 239:return!!(34&t);case 234:return!!(16&t);case 236:return!!(4&t);case 356:return!!(8&t)}return!1}function AA(e,t=63){for(;PA(e,t);)e=e.expression;return e}function IA(e,t=63){let n=e.parent;for(;PA(n,t);)n=n.parent,pn.assert(n);return n}function OA(e){return Lw(e,!0)}function LA(e){const t=fc(e,dP),n=t&&t.emitNode;return n&&n.externalHelpersModuleName}function jA(e){const t=fc(e,dP),n=t&&t.emitNode;return!(!n||!n.externalHelpersModuleName&&!n.externalHelpers)}function MA(e,t,n,r,i,o,a){if(r.importHelpers&&xp(n,r)){const s=Tk(r),c=GV(n,r),l=function(e){return D(Xw(e),e=>!e.scoped)}(n);if(1!==c&&(s>=5&&s<=99||99===c||void 0===c&&200===s)){if(l){const r=[];for(const e of l){const t=e.importName;t&&_e(r,t)}if(H(r)){r.sort(Nt);const i=e.createNamedImports(P(r,r=>Ed(n,r)?e.createImportSpecifier(!1,void 0,e.createIdentifier(r)):e.createImportSpecifier(!1,e.createIdentifier(r),t.getUnscopedHelperName(r))));Sw(fc(n,dP)).externalHelpers=!0;const o=e.createImportDeclaration(void 0,e.createImportClause(void 0,void 0,i),e.createStringLiteral(Hu),void 0);return Fw(o,2),o}}}else{const t=function(e,t,n,r,i,o){const a=LA(t);if(a)return a;const s=H(r)||(i||Dk(n)&&o)&&KV(t,n)<4;if(s){const n=Sw(fc(t,dP));return n.externalHelpersModuleName||(n.externalHelpersModuleName=e.createUniqueName(Hu))}}(e,n,r,l,i,o||a);if(t){const n=e.createImportEqualsDeclaration(void 0,!1,t,e.createExternalModuleReference(e.createStringLiteral(Hu)));return Fw(n,2),n}}}}function RA(e,t,n){const r=Ng(t);if(r&&!Dg(t)&&!Gd(t)){const i=r.name;return 11===i.kind?e.getGeneratedNameForNode(t):Gl(i)?i:e.createIdentifier(Kd(n,i)||bc(i))}return 273===t.kind&&t.importClause||279===t.kind&&t.moduleSpecifier?e.getGeneratedNameForNode(t):void 0}function BA(e,t,n,r,i,o){const a=wg(t);if(a&&KN(a))return function(e,t,n,r,i){return JA(n,r.getExternalModuleFileFromDeclaration(e),t,i)}(t,r,e,i,o)||function(e,t,n){const r=n.renamedDependencies&&n.renamedDependencies.get(t.text);return r?e.createStringLiteral(r):void 0}(e,a,n)||e.cloneNode(a)}function JA(e,t,n,r){if(t)return t.moduleName?e.createStringLiteral(t.moduleName):!t.isDeclarationFile&&r.outFile?e.createStringLiteral(Wy(n,t.fileName)):void 0}function zA(e){if(F_(e))return e.initializer;if(cP(e)){const t=e.initializer;return cb(t,!0)?t.right:void 0}return lP(e)?e.objectAssignmentInitializer:cb(e,!0)?e.right:jF(e)?zA(e.expression):void 0}function qA(e){if(F_(e))return e.name;if(!S_(e))return cb(e,!0)?qA(e.left):jF(e)?qA(e.expression):e;switch(e.kind){case 304:return qA(e.initializer);case 305:return e.name;case 306:return qA(e.expression)}}function UA(e){switch(e.kind){case 170:case 209:return e.dotDotDotToken;case 231:case 306:return e}}function VA(e){const t=WA(e);return pn.assert(!!t||_P(e),"Invalid property name for binding element."),t}function WA(e){switch(e.kind){case 209:if(e.propertyName){const t=e.propertyName;return dD(t)?pn.failBadSyntaxKind(t):ND(t)&&$A(t.expression)?t.expression:t}break;case 304:if(e.name){const t=e.name;return dD(t)?pn.failBadSyntaxKind(t):ND(t)&&$A(t.expression)?t.expression:t}break;case 306:return e.name&&dD(e.name)?pn.failBadSyntaxKind(e.name):e.name}const t=qA(e);if(t&&o_(t))return t}function $A(e){const t=e.kind;return 11===t||9===t}function HA(e){switch(e.kind){case 207:case 208:case 210:return e.elements;case 211:return e.properties}}function KA(e){if(e){let t=e;for(;;){if(uD(t)||!t.body)return uD(t)?t:t.name;t=t.body}}}function GA(e){const t=e.kind;return 177===t||179===t}function XA(e){const t=e.kind;return 177===t||178===t||179===t}function QA(e){const t=e.kind;return 304===t||305===t||263===t||177===t||182===t||176===t||283===t||244===t||265===t||266===t||267===t||268===t||272===t||273===t||271===t||279===t||278===t}function YA(e){const t=e.kind;return 176===t||304===t||305===t||283===t||271===t}function ZA(e){return sD(e)||aD(e)}function eI(e){return uD(e)||iF(e)}function tI(e){return yD(e)||rD(e)||iD(e)}function nI(e){return sD(e)||rD(e)||iD(e)}function rI(e){return uD(e)||KN(e)}function iI(e){return function(e){return 48===e||49===e||50===e}(e)||function(e){return function(e){return 40===e||41===e}(e)||function(e){return function(e){return 43===e}(e)||function(e){return 42===e||44===e||45===e}(e)}(e)}(e)}function oI(e){return function(e){return 35===e||37===e||36===e||38===e}(e)||function(e){return function(e){return 30===e||33===e||32===e||34===e||104===e||103===e}(e)||iI(e)}(e)}function aI(e){return function(e){return 56===e||57===e}(e)||function(e){return function(e){return 51===e||52===e||53===e}(e)||oI(e)}(e)}function sI(e){return function(e){return 61===e||aI(e)||ob(e)}(e)||28===e}function cI(e){return sI(e.kind)}(e=>{function t(e,n,r,i,o,a,c){const l=n>0?o[n-1]:void 0;return pn.assertEqual(r[n],t),o[n]=e.onEnter(i[n],l,c),r[n]=s(e,t),n}function n(e,t,r,i,o,a,_){pn.assertEqual(r[t],n),pn.assertIsDefined(e.onLeft),r[t]=s(e,n);const u=e.onLeft(i[t].left,o[t],i[t]);return u?(l(t,i,u),c(t,r,i,o,u)):t}function r(e,t,n,i,o,a,c){return pn.assertEqual(n[t],r),pn.assertIsDefined(e.onOperator),n[t]=s(e,r),e.onOperator(i[t].operatorToken,o[t],i[t]),t}function i(e,t,n,r,o,a,_){pn.assertEqual(n[t],i),pn.assertIsDefined(e.onRight),n[t]=s(e,i);const u=e.onRight(r[t].right,o[t],r[t]);return u?(l(t,r,u),c(t,n,r,o,u)):t}function o(e,t,n,r,i,a,c){pn.assertEqual(n[t],o),n[t]=s(e,o);const l=e.onExit(r[t],i[t]);if(t>0){if(t--,e.foldState){const r=n[t]===o?"right":"left";i[t]=e.foldState(i[t],l,r)}}else a.value=l;return t}function a(e,t,n,r,i,o,s){return pn.assertEqual(n[t],a),t}function s(e,s){switch(s){case t:if(e.onLeft)return n;case n:if(e.onOperator)return r;case r:if(e.onRight)return i;case i:return o;case o:case a:return a;default:pn.fail("Invalid state")}}function c(e,n,r,i,o){return n[++e]=t,r[e]=o,i[e]=void 0,e}function l(e,t,n){if(pn.shouldAssert(2))for(;e>=0;)pn.assert(t[e]!==n,"Circular traversal detected."),e--}e.enter=t,e.left=n,e.operator=r,e.right=i,e.exit=o,e.done=a,e.nextState=s})(rA||(rA={}));var lI,_I,uI,dI,pI,fI=class{constructor(e,t,n,r,i,o){this.onEnter=e,this.onLeft=t,this.onOperator=n,this.onRight=r,this.onExit=i,this.foldState=o}};function mI(e,t,n,r,i,o){const a=new fI(e,t,n,r,i,o);return function(e,t){const n={value:void 0},r=[rA.enter],i=[e],o=[void 0];let s=0;for(;r[s]!==rA.done;)s=r[s](a,s,r,i,o,n,t);return pn.assertEqual(s,0),n.value}}function gI(e){return function(e){return 95===e||90===e}(e.kind)}function hI(e,t){if(void 0!==t)return 0===t.length?t:FI(e.createNodeArray([],t.hasTrailingComma),t)}function yI(e){var t;const n=e.emitNode.autoGenerate;if(4&n.flags){const r=n.id;let i=e,o=i.original;for(;o;){i=o;const e=null==(t=i.emitNode)?void 0:t.autoGenerate;if(gl(i)&&(void 0===e||4&e.flags&&e.id!==r))break;o=i.original}return i}return e}function vI(e,t){return"object"==typeof e?xI(!1,e.prefix,e.node,e.suffix,t):"string"==typeof e?e.length>0&&35===e.charCodeAt(0)?e.slice(1):e:""}function bI(e,t){return"string"==typeof e?e:function(e,t){return Xl(e)?t(e).slice(1):Gl(e)?t(e):dD(e)?e.escapedText.slice(1):bc(e)}(e,pn.checkDefined(t))}function xI(e,t,n,r,i){return t=vI(t,i),r=vI(r,i),`${e?"#":""}${t}${n=bI(n,i)}${r}`}function kI(e,t,n,r){return e.updatePropertyDeclaration(t,n,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage"),void 0,void 0,r)}function SI(e,t,n,r,i=e.createThis()){return e.createGetAccessorDeclaration(n,r,[],void 0,e.createBlock([e.createReturnStatement(e.createPropertyAccessExpression(i,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")))]))}function TI(e,t,n,r,i=e.createThis()){return e.createSetAccessorDeclaration(n,r,[e.createParameterDeclaration(void 0,void 0,"value")],e.createBlock([e.createExpressionStatement(e.createAssignment(e.createPropertyAccessExpression(i,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")),e.createIdentifier("value")))]))}function CI(e){let t=e.expression;for(;;)if(t=AA(t),$F(t))t=xe(t.elements);else{if(!NA(t)){if(cb(t,!0)&&Gl(t.left))return t;break}t=t.right}}function wI(e,t){if(function(e){return SF(e)&&iy(e)&&!e.emitNode}(e))wI(e.expression,t);else if(NA(e))wI(e.left,t),wI(e.right,t);else if($F(e))for(const n of e.elements)wI(n,t);else t.push(e)}function NI(e){const t=[];return wI(e,t),t}function DI(e){if(65536&e.transformFlags)return!0;if(128&e.transformFlags)for(const t of HA(e)){const e=qA(t);if(e&&N_(e)){if(65536&e.transformFlags)return!0;if(128&e.transformFlags&&DI(e))return!0}}return!1}function FI(e,t){return t?ET(e,t.pos,t.end):e}function EI(e){const t=e.kind;return 169===t||170===t||172===t||173===t||174===t||175===t||177===t||178===t||179===t||182===t||186===t||219===t||220===t||232===t||244===t||263===t||264===t||265===t||266===t||267===t||268===t||272===t||273===t||278===t||279===t}function PI(e){const t=e.kind;return 170===t||173===t||175===t||178===t||179===t||232===t||264===t}var AI={createBaseSourceFileNode:e=>new(pI||(pI=qx.getSourceFileConstructor()))(e,-1,-1),createBaseIdentifierNode:e=>new(uI||(uI=qx.getIdentifierConstructor()))(e,-1,-1),createBasePrivateIdentifierNode:e=>new(dI||(dI=qx.getPrivateIdentifierConstructor()))(e,-1,-1),createBaseTokenNode:e=>new(_I||(_I=qx.getTokenConstructor()))(e,-1,-1),createBaseNode:e=>new(lI||(lI=qx.getNodeConstructor()))(e,-1,-1)},II=lw(1,AI);function OI(e,t){return t&&e(t)}function LI(e,t,n){if(n){if(t)return t(n);for(const t of n){const n=e(t);if(n)return n}}}function jI(e,t){return 42===e.charCodeAt(t+1)&&42===e.charCodeAt(t+2)&&47!==e.charCodeAt(t+3)}function MI(e){return p(e.statements,RI)||function(e){return 8388608&e.flags?BI(e):void 0}(e)}function RI(e){return EI(e)&&function(e,t){return H(e.modifiers,e=>e.kind===t)}(e,95)||CE(e)&&WE(e.moduleReference)||wE(e)||ME(e)||RE(e)?e:void 0}function BI(e){return function(e){return UF(e)&&102===e.keywordToken&&"meta"===e.name.escapedText}(e)?e:iO(e,BI)}var JI,zI={167:function(e,t,n){return OI(t,e.left)||OI(t,e.right)},169:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.constraint)||OI(t,e.default)||OI(t,e.expression)},305:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.questionToken)||OI(t,e.exclamationToken)||OI(t,e.equalsToken)||OI(t,e.objectAssignmentInitializer)},306:function(e,t,n){return OI(t,e.expression)},170:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.dotDotDotToken)||OI(t,e.name)||OI(t,e.questionToken)||OI(t,e.type)||OI(t,e.initializer)},173:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.questionToken)||OI(t,e.exclamationToken)||OI(t,e.type)||OI(t,e.initializer)},172:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.questionToken)||OI(t,e.type)||OI(t,e.initializer)},304:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.questionToken)||OI(t,e.exclamationToken)||OI(t,e.initializer)},261:function(e,t,n){return OI(t,e.name)||OI(t,e.exclamationToken)||OI(t,e.type)||OI(t,e.initializer)},209:function(e,t,n){return OI(t,e.dotDotDotToken)||OI(t,e.propertyName)||OI(t,e.name)||OI(t,e.initializer)},182:function(e,t,n){return LI(t,n,e.modifiers)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)},186:function(e,t,n){return LI(t,n,e.modifiers)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)},185:function(e,t,n){return LI(t,n,e.modifiers)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)},180:qI,181:qI,175:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.asteriskToken)||OI(t,e.name)||OI(t,e.questionToken)||OI(t,e.exclamationToken)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)||OI(t,e.body)},174:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.questionToken)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)},177:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)||OI(t,e.body)},178:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)||OI(t,e.body)},179:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)||OI(t,e.body)},263:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.asteriskToken)||OI(t,e.name)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)||OI(t,e.body)},219:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.asteriskToken)||OI(t,e.name)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)||OI(t,e.body)},220:function(e,t,n){return LI(t,n,e.modifiers)||LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)||OI(t,e.equalsGreaterThanToken)||OI(t,e.body)},176:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.body)},184:function(e,t,n){return OI(t,e.typeName)||LI(t,n,e.typeArguments)},183:function(e,t,n){return OI(t,e.assertsModifier)||OI(t,e.parameterName)||OI(t,e.type)},187:function(e,t,n){return OI(t,e.exprName)||LI(t,n,e.typeArguments)},188:function(e,t,n){return LI(t,n,e.members)},189:function(e,t,n){return OI(t,e.elementType)},190:function(e,t,n){return LI(t,n,e.elements)},193:UI,194:UI,195:function(e,t,n){return OI(t,e.checkType)||OI(t,e.extendsType)||OI(t,e.trueType)||OI(t,e.falseType)},196:function(e,t,n){return OI(t,e.typeParameter)},206:function(e,t,n){return OI(t,e.argument)||OI(t,e.attributes)||OI(t,e.qualifier)||LI(t,n,e.typeArguments)},303:function(e,t,n){return OI(t,e.assertClause)},197:VI,199:VI,200:function(e,t,n){return OI(t,e.objectType)||OI(t,e.indexType)},201:function(e,t,n){return OI(t,e.readonlyToken)||OI(t,e.typeParameter)||OI(t,e.nameType)||OI(t,e.questionToken)||OI(t,e.type)||LI(t,n,e.members)},202:function(e,t,n){return OI(t,e.literal)},203:function(e,t,n){return OI(t,e.dotDotDotToken)||OI(t,e.name)||OI(t,e.questionToken)||OI(t,e.type)},207:WI,208:WI,210:function(e,t,n){return LI(t,n,e.elements)},211:function(e,t,n){return LI(t,n,e.properties)},212:function(e,t,n){return OI(t,e.expression)||OI(t,e.questionDotToken)||OI(t,e.name)},213:function(e,t,n){return OI(t,e.expression)||OI(t,e.questionDotToken)||OI(t,e.argumentExpression)},214:$I,215:$I,216:function(e,t,n){return OI(t,e.tag)||OI(t,e.questionDotToken)||LI(t,n,e.typeArguments)||OI(t,e.template)},217:function(e,t,n){return OI(t,e.type)||OI(t,e.expression)},218:function(e,t,n){return OI(t,e.expression)},221:function(e,t,n){return OI(t,e.expression)},222:function(e,t,n){return OI(t,e.expression)},223:function(e,t,n){return OI(t,e.expression)},225:function(e,t,n){return OI(t,e.operand)},230:function(e,t,n){return OI(t,e.asteriskToken)||OI(t,e.expression)},224:function(e,t,n){return OI(t,e.expression)},226:function(e,t,n){return OI(t,e.operand)},227:function(e,t,n){return OI(t,e.left)||OI(t,e.operatorToken)||OI(t,e.right)},235:function(e,t,n){return OI(t,e.expression)||OI(t,e.type)},236:function(e,t,n){return OI(t,e.expression)},239:function(e,t,n){return OI(t,e.expression)||OI(t,e.type)},237:function(e,t,n){return OI(t,e.name)},228:function(e,t,n){return OI(t,e.condition)||OI(t,e.questionToken)||OI(t,e.whenTrue)||OI(t,e.colonToken)||OI(t,e.whenFalse)},231:function(e,t,n){return OI(t,e.expression)},242:HI,269:HI,308:function(e,t,n){return LI(t,n,e.statements)||OI(t,e.endOfFileToken)},244:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.declarationList)},262:function(e,t,n){return LI(t,n,e.declarations)},245:function(e,t,n){return OI(t,e.expression)},246:function(e,t,n){return OI(t,e.expression)||OI(t,e.thenStatement)||OI(t,e.elseStatement)},247:function(e,t,n){return OI(t,e.statement)||OI(t,e.expression)},248:function(e,t,n){return OI(t,e.expression)||OI(t,e.statement)},249:function(e,t,n){return OI(t,e.initializer)||OI(t,e.condition)||OI(t,e.incrementor)||OI(t,e.statement)},250:function(e,t,n){return OI(t,e.initializer)||OI(t,e.expression)||OI(t,e.statement)},251:function(e,t,n){return OI(t,e.awaitModifier)||OI(t,e.initializer)||OI(t,e.expression)||OI(t,e.statement)},252:KI,253:KI,254:function(e,t,n){return OI(t,e.expression)},255:function(e,t,n){return OI(t,e.expression)||OI(t,e.statement)},256:function(e,t,n){return OI(t,e.expression)||OI(t,e.caseBlock)},270:function(e,t,n){return LI(t,n,e.clauses)},297:function(e,t,n){return OI(t,e.expression)||LI(t,n,e.statements)},298:function(e,t,n){return LI(t,n,e.statements)},257:function(e,t,n){return OI(t,e.label)||OI(t,e.statement)},258:function(e,t,n){return OI(t,e.expression)},259:function(e,t,n){return OI(t,e.tryBlock)||OI(t,e.catchClause)||OI(t,e.finallyBlock)},300:function(e,t,n){return OI(t,e.variableDeclaration)||OI(t,e.block)},171:function(e,t,n){return OI(t,e.expression)},264:GI,232:GI,265:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||LI(t,n,e.typeParameters)||LI(t,n,e.heritageClauses)||LI(t,n,e.members)},266:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||LI(t,n,e.typeParameters)||OI(t,e.type)},267:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||LI(t,n,e.members)},307:function(e,t,n){return OI(t,e.name)||OI(t,e.initializer)},268:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.body)},272:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||OI(t,e.moduleReference)},273:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.importClause)||OI(t,e.moduleSpecifier)||OI(t,e.attributes)},274:function(e,t,n){return OI(t,e.name)||OI(t,e.namedBindings)},301:function(e,t,n){return LI(t,n,e.elements)},302:function(e,t,n){return OI(t,e.name)||OI(t,e.value)},271:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)},275:function(e,t,n){return OI(t,e.name)},281:function(e,t,n){return OI(t,e.name)},276:XI,280:XI,279:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.exportClause)||OI(t,e.moduleSpecifier)||OI(t,e.attributes)},277:QI,282:QI,278:function(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.expression)},229:function(e,t,n){return OI(t,e.head)||LI(t,n,e.templateSpans)},240:function(e,t,n){return OI(t,e.expression)||OI(t,e.literal)},204:function(e,t,n){return OI(t,e.head)||LI(t,n,e.templateSpans)},205:function(e,t,n){return OI(t,e.type)||OI(t,e.literal)},168:function(e,t,n){return OI(t,e.expression)},299:function(e,t,n){return LI(t,n,e.types)},234:function(e,t,n){return OI(t,e.expression)||LI(t,n,e.typeArguments)},284:function(e,t,n){return OI(t,e.expression)},283:function(e,t,n){return LI(t,n,e.modifiers)},357:function(e,t,n){return LI(t,n,e.elements)},285:function(e,t,n){return OI(t,e.openingElement)||LI(t,n,e.children)||OI(t,e.closingElement)},289:function(e,t,n){return OI(t,e.openingFragment)||LI(t,n,e.children)||OI(t,e.closingFragment)},286:YI,287:YI,293:function(e,t,n){return LI(t,n,e.properties)},292:function(e,t,n){return OI(t,e.name)||OI(t,e.initializer)},294:function(e,t,n){return OI(t,e.expression)},295:function(e,t,n){return OI(t,e.dotDotDotToken)||OI(t,e.expression)},288:function(e,t,n){return OI(t,e.tagName)},296:function(e,t,n){return OI(t,e.namespace)||OI(t,e.name)},191:ZI,192:ZI,310:ZI,316:ZI,315:ZI,317:ZI,319:ZI,318:function(e,t,n){return LI(t,n,e.parameters)||OI(t,e.type)},321:function(e,t,n){return("string"==typeof e.comment?void 0:LI(t,n,e.comment))||LI(t,n,e.tags)},348:function(e,t,n){return OI(t,e.tagName)||OI(t,e.name)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))},311:function(e,t,n){return OI(t,e.name)},312:function(e,t,n){return OI(t,e.left)||OI(t,e.right)},342:eO,349:eO,331:function(e,t,n){return OI(t,e.tagName)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))},330:function(e,t,n){return OI(t,e.tagName)||OI(t,e.class)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))},329:function(e,t,n){return OI(t,e.tagName)||OI(t,e.class)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))},346:function(e,t,n){return OI(t,e.tagName)||OI(t,e.constraint)||LI(t,n,e.typeParameters)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))},347:function(e,t,n){return OI(t,e.tagName)||(e.typeExpression&&310===e.typeExpression.kind?OI(t,e.typeExpression)||OI(t,e.fullName)||("string"==typeof e.comment?void 0:LI(t,n,e.comment)):OI(t,e.fullName)||OI(t,e.typeExpression)||("string"==typeof e.comment?void 0:LI(t,n,e.comment)))},339:function(e,t,n){return OI(t,e.tagName)||OI(t,e.fullName)||OI(t,e.typeExpression)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))},343:tO,345:tO,344:tO,341:tO,351:tO,350:tO,340:tO,324:function(e,t,n){return p(e.typeParameters,t)||p(e.parameters,t)||OI(t,e.type)},325:nO,326:nO,327:nO,323:function(e,t,n){return p(e.jsDocPropertyTags,t)},328:rO,333:rO,334:rO,335:rO,336:rO,337:rO,332:rO,338:rO,352:function(e,t,n){return OI(t,e.tagName)||OI(t,e.importClause)||OI(t,e.moduleSpecifier)||OI(t,e.attributes)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))},356:function(e,t,n){return OI(t,e.expression)}};function qI(e,t,n){return LI(t,n,e.typeParameters)||LI(t,n,e.parameters)||OI(t,e.type)}function UI(e,t,n){return LI(t,n,e.types)}function VI(e,t,n){return OI(t,e.type)}function WI(e,t,n){return LI(t,n,e.elements)}function $I(e,t,n){return OI(t,e.expression)||OI(t,e.questionDotToken)||LI(t,n,e.typeArguments)||LI(t,n,e.arguments)}function HI(e,t,n){return LI(t,n,e.statements)}function KI(e,t,n){return OI(t,e.label)}function GI(e,t,n){return LI(t,n,e.modifiers)||OI(t,e.name)||LI(t,n,e.typeParameters)||LI(t,n,e.heritageClauses)||LI(t,n,e.members)}function XI(e,t,n){return LI(t,n,e.elements)}function QI(e,t,n){return OI(t,e.propertyName)||OI(t,e.name)}function YI(e,t,n){return OI(t,e.tagName)||LI(t,n,e.typeArguments)||OI(t,e.attributes)}function ZI(e,t,n){return OI(t,e.type)}function eO(e,t,n){return OI(t,e.tagName)||(e.isNameFirst?OI(t,e.name)||OI(t,e.typeExpression):OI(t,e.typeExpression)||OI(t,e.name))||("string"==typeof e.comment?void 0:LI(t,n,e.comment))}function tO(e,t,n){return OI(t,e.tagName)||OI(t,e.typeExpression)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))}function nO(e,t,n){return OI(t,e.name)}function rO(e,t,n){return OI(t,e.tagName)||("string"==typeof e.comment?void 0:LI(t,n,e.comment))}function iO(e,t,n){if(void 0===e||e.kind<=166)return;const r=zI[e.kind];return void 0===r?void 0:r(e,t,n)}function oO(e,t,n){const r=aO(e),i=[];for(;i.length=0;--t)r.push(e[t]),i.push(o)}else{const n=t(e,o);if(n){if("skip"===n)continue;return n}if(e.kind>=167)for(const t of aO(e))r.push(t),i.push(e)}}}function aO(e){const t=[];return iO(e,n,n),t;function n(e){t.unshift(e)}}function sO(e){e.externalModuleIndicator=MI(e)}function cO(e,t,n,r=!1,i){var o,a;let s;null==(o=Gn)||o.push(Gn.Phase.Parse,"createSourceFile",{path:e},!0),rr("beforeParse");const{languageVersion:c,setExternalModuleIndicator:l,impliedNodeFormat:_,jsDocParsingMode:u}="object"==typeof n?n:{languageVersion:n};if(100===c)s=JI.parseSourceFile(e,t,c,void 0,r,6,ot,u);else{const n=void 0===_?l:e=>(e.impliedNodeFormat=_,(l||sO)(e));s=JI.parseSourceFile(e,t,c,void 0,r,i,n,u)}return rr("afterParse"),ir("Parse","beforeParse","afterParse"),null==(a=Gn)||a.pop(),s}function lO(e,t){return JI.parseIsolatedEntityName(e,t)}function _O(e,t){return JI.parseJsonText(e,t)}function uO(e){return void 0!==e.externalModuleIndicator}function dO(e,t,n,r=!1){const i=gO.updateSourceFile(e,t,n,r);return i.flags|=12582912&e.flags,i}function pO(e,t,n){const r=JI.JSDocParser.parseIsolatedJSDocComment(e,t,n);return r&&r.jsDoc&&JI.fixupParentReferences(r.jsDoc),r}function fO(e,t,n){return JI.JSDocParser.parseJSDocTypeExpressionForTests(e,t,n)}(e=>{var t,n,r,i,o,a=bs(99,!0),s=40960;function c(e){return x++,e}var l,d,p,f,m,g,h,y,v,b,x,k,T,C,w,N,D=lw(11,{createBaseSourceFileNode:e=>c(new o(e,0,0)),createBaseIdentifierNode:e=>c(new r(e,0,0)),createBasePrivateIdentifierNode:e=>c(new i(e,0,0)),createBaseTokenNode:e=>c(new n(e,0,0)),createBaseNode:e=>c(new t(e,0,0))}),{createNodeArray:F,createNumericLiteral:E,createStringLiteral:P,createLiteralLikeNode:A,createIdentifier:I,createPrivateIdentifier:O,createToken:L,createArrayLiteralExpression:j,createObjectLiteralExpression:M,createPropertyAccessExpression:R,createPropertyAccessChain:B,createElementAccessExpression:z,createElementAccessChain:q,createCallExpression:U,createCallChain:V,createNewExpression:W,createParenthesizedExpression:$,createBlock:K,createVariableStatement:X,createExpressionStatement:Q,createIfStatement:Y,createWhileStatement:Z,createForStatement:ee,createForOfStatement:te,createVariableDeclaration:ne,createVariableDeclarationList:re}=D,ie=!0,oe=!1;function se(e,t,n=2,r,i=!1){ce(e,t,n,r,6,0),d=N,We();const o=Je();let a,s;if(1===qe())a=kt([],o,o),s=yt();else{let e;for(;1!==qe();){let t;switch(qe()){case 23:t=di();break;case 112:case 97:case 106:t=yt();break;case 41:t=nt(()=>9===We()&&59!==We())?Jr():fi();break;case 9:case 11:if(nt(()=>59!==We())){t=yn();break}default:t=fi()}e&&Ze(e)?e.push(t):e?e=[e,t]:(e=t,1!==qe()&&Le(fa.Unexpected_token))}const t=Ze(e)?St(j(e),o):pn.checkDefined(e),n=Q(t);St(n,o),a=kt([n],o),s=ht(1,fa.Unexpected_token)}const c=fe(e,2,6,!1,a,s,d,ot);i&&pe(c),c.nodeCount=x,c.identifierCount=T,c.identifiers=k,c.parseDiagnostics=Zx(h,c),y&&(c.jsDocDiagnostics=Zx(y,c));const l=c;return _e(),l}function ce(e,s,c,_,u,y){switch(t=qx.getNodeConstructor(),n=qx.getTokenConstructor(),r=qx.getIdentifierConstructor(),i=qx.getPrivateIdentifierConstructor(),o=qx.getSourceFileConstructor(),l=Vo(e),p=s,f=c,v=_,m=u,g=fk(u),h=[],C=0,k=new Map,T=0,x=0,d=0,ie=!0,m){case 1:case 2:N=524288;break;case 6:N=134742016;break;default:N=0}oe=!1,a.setText(p),a.setOnError(Be),a.setScriptTarget(f),a.setLanguageVariant(g),a.setScriptKind(m),a.setJSDocParsingMode(y)}function _e(){a.clearCommentDirectives(),a.setText(""),a.setOnError(void 0),a.setScriptKind(0),a.setJSDocParsingMode(0),p=void 0,f=void 0,v=void 0,m=void 0,g=void 0,d=0,h=void 0,y=void 0,C=0,k=void 0,w=void 0,ie=!0}e.parseSourceFile=function(e,t,n,r,i=!1,o,s,c=0){var f;if(6===(o=CS(e,o))){const o=se(e,t,n,r,i);return HL(o,null==(f=o.statements[0])?void 0:f.expression,o.parseDiagnostics,!1,void 0),o.referencedFiles=_,o.typeReferenceDirectives=_,o.libReferenceDirectives=_,o.amdDependencies=_,o.hasNoDefaultLib=!1,o.pragmas=u,o}ce(e,t,n,r,o,c);const m=function(e,t,n,r,i){const o=vO(l);o&&(N|=33554432);d=N,We();const s=Zt(0,Ri);pn.assert(1===qe());const c=ze(),_=de(yt(),c),u=fe(l,e,n,o,s,_,d,r);xO(u,p),kO(u,f),u.commentDirectives=a.getCommentDirectives(),u.nodeCount=x,u.identifierCount=T,u.identifiers=k,u.parseDiagnostics=Zx(h,u),u.jsDocParsingMode=i,y&&(u.jsDocDiagnostics=Zx(y,u));t&&pe(u);return u;function f(e,t,n){h.push(Xx(l,p,e,t,n))}}(n,i,o,s||sO,c);return _e(),m},e.parseIsolatedEntityName=function(e,t){ce("",e,t,void 0,1,0),We();const n=ln(!0),r=1===qe()&&!h.length;return _e(),r?n:void 0},e.parseJsonText=se;let ue=!1;function de(e,t){if(!t)return e;pn.assert(!e.jsDoc);const n=J(Sf(e,p),t=>$o.parseJSDocComment(e,t.pos,t.end-t.pos));return n.length&&(e.jsDoc=n),ue&&(ue=!1,e.flags|=536870912),e}function pe(e){OT(e,!0)}function fe(e,t,n,r,i,o,s,c){let l=D.createSourceFile(i,o,s);if(PT(l,0,p.length),_(l),!r&&uO(l)&&67108864&l.transformFlags){const e=l;l=function(e){const t=v,n=gO.createSyntaxCursor(e);v={currentNode:function(e){const t=n.currentNode(e);return ie&&t&&c(t)&&yO(t),t}};const r=[],i=h;h=[];let o=0,s=l(e.statements,0);for(;-1!==s;){const t=e.statements[o],n=e.statements[s];le(r,e.statements,o,s),o=_(e.statements,s);const c=S(i,e=>e.start>=t.pos),u=c>=0?S(i,e=>e.start>=n.pos,c):-1;c>=0&&le(h,i,c,u>=0?u:void 0),tt(()=>{const t=N;for(N|=65536,a.resetTokenState(n.pos),We();1!==qe();){const t=a.getTokenFullStart(),n=en(0,Ri);if(r.push(n),t===a.getTokenFullStart()&&We(),o>=0){const t=e.statements[o];if(n.end===t.pos)break;n.end>t.pos&&(o=_(e.statements,o+1))}}N=t},2),s=o>=0?l(e.statements,o):-1}if(o>=0){const t=e.statements[o];le(r,e.statements,o);const n=S(i,e=>e.start>=t.pos);n>=0&&le(h,i,n)}return v=t,D.updateSourceFile(e,FI(F(r),e.statements));function c(e){return!(65536&e.flags||!(67108864&e.transformFlags))}function l(e,t){for(let n=t;n118}function at(){return 80===qe()||(127!==qe()||!Ee())&&((135!==qe()||!Oe())&&qe()>118)}function st(e,t,n=!0){return qe()===e?(n&&We(),!0):(t?Le(t):Le(fa._0_expected,Ia(e)),!1)}e.fixupParentReferences=pe;const ct=Object.keys(ha).filter(e=>e.length>2);function _t(e){if(xF(e))return void Me(ts(p,e.template.pos),e.template.end,fa.Module_declaration_names_may_only_use_or_quoted_strings);const t=uD(e)?bc(e):void 0;if(!t||!vs(t,f))return void Le(fa._0_expected,Ia(27));const n=ts(p,e.pos);switch(t){case"const":case"let":case"var":return void Me(n,e.end,fa.Variable_declaration_not_allowed_at_this_location);case"declare":return;case"interface":return void ut(fa.Interface_name_cannot_be_0,fa.Interface_must_be_given_a_name,19);case"is":return void Me(n,a.getTokenStart(),fa.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);case"module":case"namespace":return void ut(fa.Namespace_name_cannot_be_0,fa.Namespace_must_be_given_a_name,19);case"type":return void ut(fa.Type_alias_name_cannot_be_0,fa.Type_alias_must_be_given_a_name,64)}const r=Mt(t,ct,lt)??function(e){for(const t of ct)if(e.length>t.length+2&&Qt(e,t))return`${t} ${e.slice(t.length)}`;return}(t);r?Me(n,e.end,fa.Unknown_keyword_or_identifier_Did_you_mean_0,r):0!==qe()&&Me(n,e.end,fa.Unexpected_keyword_or_identifier)}function ut(e,t,n){qe()===n?Le(t):Le(e,a.getTokenValue())}function dt(e){return qe()===e?($e(),!0):(pn.assert(Ph(e)),Le(fa._0_expected,Ia(e)),!1)}function pt(e,t,n,r){if(qe()===t)return void We();const i=Le(fa._0_expected,Ia(t));n&&i&&uT(i,Xx(l,p,r,1,fa.The_parser_expected_to_find_a_1_to_match_the_0_token_here,Ia(e),Ia(t)))}function ft(e){return qe()===e&&(We(),!0)}function mt(e){if(qe()===e)return yt()}function gt(e){if(qe()===e)return function(){const e=Je(),t=qe();return $e(),St(L(t),e)}()}function ht(e,t,n){return mt(e)||Tt(e,!1,t||fa._0_expected,n||Ia(e))}function yt(){const e=Je(),t=qe();return We(),St(L(t),e)}function vt(){return 27===qe()||(20===qe()||1===qe()||a.hasPrecedingLineBreak())}function bt(){return!!vt()&&(27===qe()&&We(),!0)}function xt(){return bt()||st(27)}function kt(e,t,n,r){const i=F(e,r);return ET(i,t,n??a.getTokenFullStart()),i}function St(e,t,n){return ET(e,t,n??a.getTokenFullStart()),N&&(e.flags|=N),oe&&(oe=!1,e.flags|=262144),e}function Tt(e,t,n,...r){t?je(a.getTokenFullStart(),0,n,...r):n&&Le(n,...r);const i=Je();return St(80===e?I("",void 0):Bl(e)?D.createTemplateLiteralLikeNode(e,"","",void 0):9===e?E("",void 0):11===e?P("",void 0):283===e?D.createMissingDeclaration():L(e),i)}function Ct(e){let t=k.get(e);return void 0===t&&k.set(e,t=e),t}function wt(e,t,n){if(e){T++;const e=a.hasPrecedingJSDocLeadingAsterisks()?a.getTokenStart():Je(),t=qe(),n=Ct(a.getTokenValue()),r=a.hasExtendedUnicodeEscape();return Ue(),St(I(n,t,r),e)}if(81===qe())return Le(n||fa.Private_identifiers_are_not_allowed_outside_class_bodies),wt(!0);if(0===qe()&&a.tryScan(()=>80===a.reScanInvalidIdentifier()))return wt(!0);T++;const r=1===qe(),i=a.isReservedWord(),o=a.getTokenText(),s=i?fa.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:fa.Identifier_expected;return Tt(80,r,t||s,o)}function Nt(e){return wt(it(),void 0,e)}function Dt(e,t){return wt(at(),e,t)}function Ft(e){return wt(ma(qe()),e)}function Et(){return(a.hasUnicodeEscape()||a.hasExtendedUnicodeEscape())&&Le(fa.Unicode_escape_sequence_cannot_appear_here),wt(ma(qe()))}function Pt(){return ma(qe())||11===qe()||9===qe()||10===qe()}function At(e){if(11===qe()||9===qe()||10===qe()){const e=yn();return e.text=Ct(e.text),e}return e&&23===qe()?function(){const e=Je();st(23);const t=Te(Tr);return st(24),St(D.createComputedPropertyName(t),e)}():81===qe()?Ot():Ft()}function It(){return At(!0)}function Ot(){const e=Je(),t=O(Ct(a.getTokenValue()));return We(),St(t,e)}function Lt(e){return qe()===e&&rt(Rt)}function jt(){return We(),!a.hasPrecedingLineBreak()&&zt()}function Rt(){switch(qe()){case 87:return 94===We();case 95:return We(),90===qe()?nt(qt):156===qe()?nt(Jt):Bt();case 90:return qt();case 126:return We(),zt();case 139:case 153:return We(),23===qe()||Pt();default:return jt()}}function Bt(){return 60===qe()||42!==qe()&&130!==qe()&&19!==qe()&&zt()}function Jt(){return We(),Bt()}function zt(){return 23===qe()||19===qe()||42===qe()||26===qe()||Pt()}function qt(){return We(),86===qe()||100===qe()||120===qe()||60===qe()||128===qe()&&nt(Ci)||134===qe()&&nt(wi)}function Ut(e,t){if(tn(e))return!0;switch(e){case 0:case 1:case 3:return!(27===qe()&&t)&&Ei();case 2:return 84===qe()||90===qe();case 4:return nt(zn);case 5:return nt(so)||27===qe()&&!t;case 6:return 23===qe()||Pt();case 12:switch(qe()){case 23:case 42:case 26:case 25:return!0;default:return Pt()}case 18:return Pt();case 9:return 23===qe()||26===qe()||Pt();case 24:return ma(qe())||11===qe();case 7:return 19===qe()?nt(Vt):t?at()&&!Kt():kr()&&!Kt();case 8:return Ki();case 10:return 28===qe()||26===qe()||Ki();case 19:return 103===qe()||87===qe()||at();case 15:switch(qe()){case 28:case 25:return!0}case 11:return 26===qe()||Sr();case 16:return En(!1);case 17:return En(!0);case 20:case 21:return 28===qe()||ar();case 22:return ko();case 23:return(161!==qe()||!nt(qi))&&(11===qe()||ma(qe()));case 13:return ma(qe())||19===qe();case 14:case 25:return!0;case 26:return pn.fail("ParsingContext.Count used as a context");default:pn.assertNever(e,"Non-exhaustive case in 'isListElement'.")}}function Vt(){if(pn.assert(19===qe()),20===We()){const e=We();return 28===e||19===e||96===e||119===e}return!0}function Wt(){return We(),at()}function $t(){return We(),ma(qe())}function Ht(){return We(),ga(qe())}function Kt(){return(119===qe()||96===qe())&&nt(Gt)}function Gt(){return We(),Sr()}function Xt(){return We(),ar()}function Yt(e){if(1===qe())return!0;switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return 20===qe();case 3:return 20===qe()||84===qe()||90===qe();case 7:return 19===qe()||96===qe()||119===qe();case 8:return function(){if(vt())return!0;if(Or(qe()))return!0;if(39===qe())return!0;return!1}();case 19:return 32===qe()||21===qe()||19===qe()||96===qe()||119===qe();case 11:return 22===qe()||27===qe();case 15:case 21:case 10:return 24===qe();case 17:case 16:case 18:return 22===qe()||24===qe();case 20:return 28!==qe();case 22:return 19===qe()||20===qe();case 13:return 32===qe()||44===qe();case 14:return 30===qe()&&nt(Fo);default:return!1}}function Zt(e,t){const n=C;C|=1<=0)}function an(e){return 6===e?fa.An_enum_member_name_must_be_followed_by_a_or:void 0}function sn(){const e=kt([],Je());return e.isMissingList=!0,e}function cn(e,t,n,r){if(st(n)){const n=on(e,t);return st(r),n}return sn()}function ln(e,t){const n=Je();let r=e?Ft(t):Dt(t);for(;ft(25)&&30!==qe();)r=St(D.createQualifiedName(r,un(e,!1,!0)),n);return r}function _n(e,t){return St(D.createQualifiedName(e,t),e.pos)}function un(e,t,n){if(a.hasPrecedingLineBreak()&&ma(qe())){if(nt(Ti))return Tt(80,!0,fa.Identifier_expected)}if(81===qe()){const e=Ot();return t?e:Tt(80,!0,fa.Identifier_expected)}return e?n?Ft():Et():Dt()}function dn(e){const t=Je();return St(D.createTemplateExpression(vn(e),function(e){const t=Je(),n=[];let r;do{r=hn(e),n.push(r)}while(17===r.literal.kind);return kt(n,t)}(e)),t)}function fn(){const e=Je();return St(D.createTemplateLiteralType(vn(!1),function(){const e=Je(),t=[];let n;do{n=mn(),t.push(n)}while(17===n.literal.kind);return kt(t,e)}()),e)}function mn(){const e=Je();return St(D.createTemplateLiteralTypeSpan(br(),gn(!1)),e)}function gn(e){return 20===qe()?(Ge(e),function(){const e=bn(qe());return pn.assert(17===e.kind||18===e.kind,"Template fragment has wrong token kind"),e}()):ht(18,fa._0_expected,Ia(20))}function hn(e){const t=Je();return St(D.createTemplateSpan(Te(Tr),gn(e)),t)}function yn(){return bn(qe())}function vn(e){!e&&26656&a.getTokenFlags()&&Ge(!1);const t=bn(qe());return pn.assert(16===t.kind,"Template head has wrong token kind"),t}function bn(e){const t=Je(),n=Bl(e)?D.createTemplateLiteralLikeNode(e,a.getTokenValue(),function(e){const t=15===e||18===e,n=a.getTokenText();return n.substring(1,n.length-(a.isUnterminated()?0:t?1:2))}(e),7176&a.getTokenFlags()):9===e?E(a.getTokenValue(),a.getNumericLiteralFlags()):11===e?P(a.getTokenValue(),void 0,a.hasExtendedUnicodeEscape()):jl(e)?A(e,a.getTokenValue()):pn.fail();return a.hasExtendedUnicodeEscape()&&(n.hasExtendedUnicodeEscape=!0),a.isUnterminated()&&(n.isUnterminated=!0),We(),St(n,t)}function xn(){return ln(!0,fa.Type_expected)}function kn(){if(!a.hasPrecedingLineBreak()&&30===Xe())return cn(20,br,30,32)}function Sn(){const e=Je();return St(D.createTypeReferenceNode(xn(),kn()),e)}function Tn(e){switch(e.kind){case 184:return Pd(e.typeName);case 185:case 186:{const{parameters:t,type:n}=e;return!!t.isMissingList||Tn(n)}case 197:return Tn(e.type);default:return!1}}function Cn(){const e=Je();return We(),St(D.createThisTypeNode(),e)}function wn(){const e=Je();let t;return 110!==qe()&&105!==qe()||(t=Ft(),st(59)),St(D.createParameterDeclaration(void 0,void 0,t,void 0,Nn(),void 0),e)}function Nn(){a.setSkipJsDocLeadingAsterisks(!0);const e=Je();if(ft(144)){const t=D.createJSDocNamepathType(void 0);e:for(;;)switch(qe()){case 20:case 1:case 28:case 5:break e;default:$e()}return a.setSkipJsDocLeadingAsterisks(!1),St(t,e)}const t=ft(26);let n=yr();return a.setSkipJsDocLeadingAsterisks(!1),t&&(n=St(D.createJSDocVariadicType(n),e)),64===qe()?(We(),St(D.createJSDocOptionalType(n),e)):n}function Dn(){const e=Je(),t=po(!1,!0),n=Dt();let r,i;ft(96)&&(ar()||!Sr()?r=br():i=zr());const o=ft(64)?br():void 0,a=D.createTypeParameterDeclaration(t,n,r,o);return a.expression=i,St(a,e)}function Fn(){if(30===qe())return cn(19,Dn,30,32)}function En(e){return 26===qe()||Ki()||e_(qe())||60===qe()||ar(!e)}function Pn(e){return An(e)}function An(e,t=!0){const n=Je(),r=ze(),i=e?Ne(()=>po(!0)):De(()=>po(!0));if(110===qe()){const e=D.createParameterDeclaration(i,void 0,wt(!0),void 0,xr(),void 0),t=ge(i);return t&&Re(t,fa.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters),de(St(e,n),r)}const o=ie;ie=!1;const a=mt(26);if(!t&&!it()&&23!==qe()&&19!==qe())return;const s=de(St(D.createParameterDeclaration(i,a,function(e){const t=Gi(fa.Private_identifiers_cannot_be_used_as_parameters);return 0===ud(t)&&!H(e)&&e_(qe())&&We(),t}(i),mt(58),xr(),Cr()),n),r);return ie=o,s}function In(e,t){if(function(e,t){if(39===e)return st(e),!0;if(ft(59))return!0;if(t&&39===qe())return Le(fa._0_expected,Ia(59)),We(),!0;return!1}(e,t))return Ce(yr)}function On(e,t){const n=Ee(),r=Oe();ye(!!(1&e)),xe(!!(2&e));const i=32&e?on(17,wn):on(16,()=>t?Pn(r):An(r,!1));return ye(n),xe(r),i}function Ln(e){if(!st(21))return sn();const t=On(e,!0);return st(22),t}function jn(){ft(28)||xt()}function Mn(e){const t=Je(),n=ze();181===e&&st(105);const r=Fn(),i=Ln(4),o=In(59,!0);jn();return de(St(180===e?D.createCallSignature(r,i,o):D.createConstructSignature(r,i,o),t),n)}function Rn(){return 23===qe()&&nt(Bn)}function Bn(){if(We(),26===qe()||24===qe())return!0;if(e_(qe())){if(We(),at())return!0}else{if(!at())return!1;We()}return 59===qe()||28===qe()||58===qe()&&(We(),59===qe()||28===qe()||24===qe())}function Jn(e,t,n){const r=cn(16,()=>Pn(!1),23,24),i=xr();jn();return de(St(D.createIndexSignature(n,r,i),e),t)}function zn(){if(21===qe()||30===qe()||139===qe()||153===qe())return!0;let e=!1;for(;e_(qe());)e=!0,We();return 23===qe()||(Pt()&&(e=!0,We()),!!e&&(21===qe()||30===qe()||58===qe()||59===qe()||28===qe()||vt()))}function qn(){if(21===qe()||30===qe())return Mn(180);if(105===qe()&&nt(Un))return Mn(181);const e=Je(),t=ze(),n=po(!1);return Lt(139)?ao(e,t,n,178,4):Lt(153)?ao(e,t,n,179,4):Rn()?Jn(e,t,n):function(e,t,n){const r=It(),i=mt(58);let o;if(21===qe()||30===qe()){const e=Fn(),t=Ln(4),a=In(59,!0);o=D.createMethodSignature(n,r,i,e,t,a)}else{const e=xr();o=D.createPropertySignature(n,r,i,e),64===qe()&&(o.initializer=Cr())}return jn(),de(St(o,e),t)}(e,t,n)}function Un(){return We(),21===qe()||30===qe()}function Vn(){return 25===We()}function Wn(){switch(We()){case 21:case 30:case 25:return!0}return!1}function $n(){let e;return st(19)?(e=Zt(4,qn),st(20)):e=sn(),e}function Hn(){return We(),40===qe()||41===qe()?148===We():(148===qe()&&We(),23===qe()&&Wt()&&103===We())}function Kn(){const e=Je();let t;st(19),148!==qe()&&40!==qe()&&41!==qe()||(t=yt(),148!==t.kind&&st(148)),st(23);const n=function(){const e=Je(),t=Ft();st(103);const n=br();return St(D.createTypeParameterDeclaration(void 0,t,n,void 0),e)}(),r=ft(130)?br():void 0;let i;st(24),58!==qe()&&40!==qe()&&41!==qe()||(i=yt(),58!==i.kind&&st(58));const o=xr();xt();const a=Zt(4,qn);return st(20),St(D.createMappedTypeNode(t,n,r,i,o,a),e)}function Gn(){const e=Je();if(ft(26))return St(D.createRestTypeNode(br()),e);const t=br();if(kP(t)&&t.pos===t.type.pos){const e=D.createOptionalTypeNode(t.type);return FI(e,t),e.flags=t.flags,e}return t}function Xn(){return 59===We()||58===qe()&&59===We()}function Qn(){return 26===qe()?ma(We())&&Xn():ma(qe())&&Xn()}function Yn(){if(nt(Qn)){const e=Je(),t=ze(),n=mt(26),r=Ft(),i=mt(58);st(59);const o=Gn();return de(St(D.createNamedTupleMember(n,r,i,o),e),t)}return Gn()}function Zn(){const e=Je(),t=ze(),n=function(){let e;if(128===qe()){const t=Je();We(),e=kt([St(L(128),t)],t)}return e}(),r=ft(105);pn.assert(!n||r,"Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");const i=Fn(),o=Ln(4),a=In(39,!1);return de(St(r?D.createConstructorTypeNode(n,i,o,a):D.createFunctionTypeNode(i,o,a),e),t)}function er(){const e=yt();return 25===qe()?void 0:e}function tr(e){const t=Je();e&&We();let n=112===qe()||97===qe()||106===qe()?yt():bn(qe());return e&&(n=St(D.createPrefixUnaryExpression(41,n),t)),St(D.createLiteralTypeNode(n),t)}function nr(){return We(),102===qe()}function rr(){d|=4194304;const e=Je(),t=ft(114);st(102),st(21);const n=br();let r;if(ft(28)){const e=a.getTokenStart();st(19);const t=qe();if(118===t||132===t?We():Le(fa._0_expected,Ia(118)),st(59),r=Io(t,!0),ft(28),!st(20)){const t=be(h);t&&t.code===fa._0_expected.code&&uT(t,Xx(l,p,e,1,fa.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}}st(22);const i=ft(25)?xn():void 0,o=kn();return St(D.createImportTypeNode(n,r,i,o,t),e)}function ir(){return We(),9===qe()||10===qe()}function or(){switch(qe()){case 133:case 159:case 154:case 150:case 163:case 155:case 136:case 157:case 146:case 151:return rt(er)||Sn();case 67:a.reScanAsteriskEqualsToken();case 42:return function(){const e=Je();return We(),St(D.createJSDocAllType(),e)}();case 61:a.reScanQuestionToken();case 58:return function(){const e=Je();return We(),28===qe()||20===qe()||22===qe()||32===qe()||64===qe()||52===qe()?St(D.createJSDocUnknownType(),e):St(D.createJSDocNullableType(br(),!1),e)}();case 100:return function(){const e=Je(),t=ze();if(rt(No)){const n=Ln(36),r=In(59,!1);return de(St(D.createJSDocFunctionType(n,r),e),t)}return St(D.createTypeReferenceNode(Ft(),void 0),e)}();case 54:return function(){const e=Je();return We(),St(D.createJSDocNonNullableType(or(),!1),e)}();case 15:case 11:case 9:case 10:case 112:case 97:case 106:return tr();case 41:return nt(ir)?tr(!0):Sn();case 116:return yt();case 110:{const t=Cn();return 142!==qe()||a.hasPrecedingLineBreak()?t:(e=t,We(),St(D.createTypePredicateNode(void 0,e,br()),e.pos))}case 114:return nt(nr)?rr():function(){const e=Je();st(114);const t=ln(!0),n=a.hasPrecedingLineBreak()?void 0:xo();return St(D.createTypeQueryNode(t,n),e)}();case 19:return nt(Hn)?Kn():function(){const e=Je();return St(D.createTypeLiteralNode($n()),e)}();case 23:return function(){const e=Je();return St(D.createTupleTypeNode(cn(21,Yn,23,24)),e)}();case 21:return function(){const e=Je();st(21);const t=br();return st(22),St(D.createParenthesizedType(t),e)}();case 102:return rr();case 131:return nt(Ti)?function(){const e=Je(),t=ht(131),n=110===qe()?Cn():Dt(),r=ft(142)?br():void 0;return St(D.createTypePredicateNode(t,n,r),e)}():Sn();case 16:return fn();default:return Sn()}var e}function ar(e){switch(qe()){case 133:case 159:case 154:case 150:case 163:case 136:case 148:case 155:case 158:case 116:case 157:case 106:case 110:case 114:case 146:case 19:case 23:case 30:case 52:case 51:case 105:case 11:case 9:case 10:case 112:case 97:case 151:case 42:case 58:case 54:case 26:case 140:case 102:case 131:case 15:case 16:return!0;case 100:return!e;case 41:return!e&&nt(ir);case 21:return!e&&nt(sr);default:return at()}}function sr(){return We(),22===qe()||En(!1)||ar()}function cr(){const e=Je();let t=or();for(;!a.hasPrecedingLineBreak();)switch(qe()){case 54:We(),t=St(D.createJSDocNonNullableType(t,!0),e);break;case 58:if(nt(Xt))return t;We(),t=St(D.createJSDocNullableType(t,!0),e);break;case 23:if(st(23),ar()){const n=br();st(24),t=St(D.createIndexedAccessTypeNode(t,n),e)}else st(24),t=St(D.createArrayTypeNode(t),e);break;default:return t}return t}function lr(){if(ft(96)){const e=we(br);if(Ae()||58!==qe())return e}}function _r(){const e=Je();return st(140),St(D.createInferTypeNode(function(){const e=Je(),t=Dt(),n=rt(lr);return St(D.createTypeParameterDeclaration(void 0,t,n),e)}()),e)}function ur(){const e=qe();switch(e){case 143:case 158:case 148:return function(e){const t=Je();return st(e),St(D.createTypeOperatorNode(e,ur()),t)}(e);case 140:return _r()}return Ce(cr)}function dr(e){if(gr()){const t=Zn();let n;return n=VD(t)?e?fa.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:fa.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:e?fa.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:fa.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type,Re(t,n),t}}function pr(e,t,n){const r=Je(),i=52===e,o=ft(e);let a=o&&dr(i)||t();if(qe()===e||o){const o=[a];for(;ft(e);)o.push(dr(i)||t());a=St(n(kt(o,r)),r)}return a}function fr(){return pr(51,ur,D.createIntersectionTypeNode)}function mr(){return We(),105===qe()}function gr(){return 30===qe()||(!(21!==qe()||!nt(hr))||(105===qe()||128===qe()&&nt(mr)))}function hr(){if(We(),22===qe()||26===qe())return!0;if(function(){if(e_(qe())&&po(!1),at()||110===qe())return We(),!0;if(23===qe()||19===qe()){const e=h.length;return Gi(),e===h.length}return!1}()){if(59===qe()||28===qe()||58===qe()||64===qe())return!0;if(22===qe()&&(We(),39===qe()))return!0}return!1}function yr(){const e=Je(),t=at()&&rt(vr),n=br();return t?St(D.createTypePredicateNode(void 0,t,n),e):n}function vr(){const e=Dt();if(142===qe()&&!a.hasPrecedingLineBreak())return We(),e}function br(){if(81920&N)return ke(81920,br);if(gr())return Zn();const e=Je(),t=pr(52,fr,D.createUnionTypeNode);if(!Ae()&&!a.hasPrecedingLineBreak()&&ft(96)){const n=we(br);st(58);const r=Ce(br);st(59);const i=Ce(br);return St(D.createConditionalTypeNode(t,n,r,i),e)}return t}function xr(){return ft(59)?br():void 0}function kr(){switch(qe()){case 110:case 108:case 106:case 112:case 97:case 9:case 10:case 11:case 15:case 16:case 21:case 23:case 19:case 100:case 86:case 105:case 44:case 69:case 80:return!0;case 102:return nt(Wn);default:return at()}}function Sr(){if(kr())return!0;switch(qe()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 46:case 47:case 30:case 135:case 127:case 81:case 60:return!0;default:return!!jr()||at()}}function Tr(){const e=Ie();e&&ve(!1);const t=Je();let n,r=wr(!0);for(;n=mt(28);)r=Rr(r,n,wr(!0),t);return e&&ve(!0),r}function Cr(){return ft(64)?wr(!0):void 0}function wr(e){if(function(){if(127===qe())return!!Ee()||nt(Ni);return!1}())return function(){const e=Je();return We(),a.hasPrecedingLineBreak()||42!==qe()&&!Sr()?St(D.createYieldExpression(void 0,void 0),e):St(D.createYieldExpression(mt(42),wr(!0)),e)}();const t=function(e){const t=function(){if(21===qe()||30===qe()||134===qe())return nt(Fr);if(39===qe())return 1;return 0}();if(0===t)return;return 1===t?Pr(!0,!0):rt(()=>function(e){const t=a.getTokenStart();if(null==w?void 0:w.has(t))return;const n=Pr(!1,e);n||(w||(w=new Set)).add(t);return n}(e))}(e)||function(e){if(134===qe()&&1===nt(Er)){const t=Je(),n=ze(),r=fo();return Dr(t,Ir(0),e,n,r)}return}(e);if(t)return t;const n=Je(),r=ze(),i=Ir(0);return 80===i.kind&&39===qe()?Dr(n,i,e,r,void 0):q_(i)&&ob(Ke())?Rr(i,yt(),wr(e),n):function(e,t,n){const r=mt(58);if(!r)return e;let i;return St(D.createConditionalExpression(e,r,ke(s,()=>wr(!1)),i=ht(59),Ad(i)?wr(n):Tt(80,!1,fa._0_expected,Ia(59))),t)}(i,n,e)}function Nr(){return We(),!a.hasPrecedingLineBreak()&&at()}function Dr(e,t,n,r,i){pn.assert(39===qe(),"parseSimpleArrowFunctionExpression should only have been called if we had a =>");const o=D.createParameterDeclaration(void 0,void 0,t,void 0,void 0,void 0);St(o,t.pos);const a=kt([o],o.pos,o.end),s=ht(39),c=Ar(!!i,n);return de(St(D.createArrowFunction(i,void 0,a,void 0,s,c),e),r)}function Fr(){if(134===qe()){if(We(),a.hasPrecedingLineBreak())return 0;if(21!==qe()&&30!==qe())return 0}const e=qe(),t=We();if(21===e){if(22===t){switch(We()){case 39:case 59:case 19:return 1;default:return 0}}if(23===t||19===t)return 2;if(26===t)return 1;if(e_(t)&&134!==t&&nt(Wt))return 130===We()?0:1;if(!at()&&110!==t)return 0;switch(We()){case 59:return 1;case 58:return We(),59===qe()||28===qe()||64===qe()||22===qe()?1:0;case 28:case 64:case 22:return 2}return 0}if(pn.assert(30===e),!at()&&87!==qe())return 0;if(1===g){return nt(()=>{ft(87);const e=We();if(96===e){switch(We()){case 64:case 32:case 44:return!1;default:return!0}}else if(28===e||64===e)return!0;return!1})?1:0}return 2}function Er(){if(134===qe()){if(We(),a.hasPrecedingLineBreak()||39===qe())return 0;const e=Ir(0);if(!a.hasPrecedingLineBreak()&&80===e.kind&&39===qe())return 1}return 0}function Pr(e,t){const n=Je(),r=ze(),i=fo(),o=H(i,mD)?2:0,a=Fn();let s;if(st(21)){if(e)s=On(o,e);else{const t=On(o,e);if(!t)return;s=t}if(!st(22)&&!e)return}else{if(!e)return;s=sn()}const c=59===qe(),l=In(59,!1);if(l&&!e&&Tn(l))return;let _=l;for(;197===(null==_?void 0:_.kind);)_=_.type;const u=_&&CP(_);if(!e&&39!==qe()&&(u||19!==qe()))return;const d=qe(),p=ht(39),f=39===d||19===d?Ar(H(i,mD),t):Dt();if(!t&&c&&59!==qe())return;return de(St(D.createArrowFunction(i,a,s,l,p,f),n),r)}function Ar(e,t){if(19===qe())return yi(e?2:0);if(27!==qe()&&100!==qe()&&86!==qe()&&Ei()&&(19===qe()||100===qe()||86===qe()||60===qe()||!Sr()))return yi(16|(e?2:0));const n=Ee();ye(!1);const r=ie;ie=!1;const i=e?Ne(()=>wr(t)):De(()=>wr(t));return ie=r,ye(n),i}function Ir(e){const t=Je();return Lr(e,zr(),t)}function Or(e){return 103===e||165===e}function Lr(e,t,n){for(;;){Ke();const r=dy(qe());if(!(43===qe()?r>=e:r>e))break;if(103===qe()&&Pe())break;if(130===qe()||152===qe()){if(a.hasPrecedingLineBreak())break;{const e=qe();We(),t=152===e?Mr(t,br()):Br(t,br())}}else t=Rr(t,yt(),Ir(r),n)}return t}function jr(){return(!Pe()||103!==qe())&&dy(qe())>0}function Mr(e,t){return St(D.createSatisfiesExpression(e,t),e.pos)}function Rr(e,t,n,r){return St(D.createBinaryExpression(e,t,n),r)}function Br(e,t){return St(D.createAsExpression(e,t),e.pos)}function Jr(){const e=Je();return St(D.createPrefixUnaryExpression(qe(),Ve(qr)),e)}function zr(){if(function(){switch(qe()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 135:return!1;case 30:if(1!==g)return!1;default:return!0}}()){const e=Je(),t=Ur();return 43===qe()?Lr(dy(qe()),t,e):t}const e=qe(),t=qr();if(43===qe()){const n=ts(p,t.pos),{end:r}=t;217===t.kind?Me(n,r,fa.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):(pn.assert(Ph(e)),Me(n,r,fa.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,Ia(e)))}return t}function qr(){switch(qe()){case 40:case 41:case 55:case 54:return Jr();case 91:return function(){const e=Je();return St(D.createDeleteExpression(Ve(qr)),e)}();case 114:return function(){const e=Je();return St(D.createTypeOfExpression(Ve(qr)),e)}();case 116:return function(){const e=Je();return St(D.createVoidExpression(Ve(qr)),e)}();case 30:return 1===g?$r(!0,void 0,void 0,!0):function(){pn.assert(1!==g,"Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments.");const e=Je();st(30);const t=br();st(32);const n=qr();return St(D.createTypeAssertion(t,n),e)}();case 135:if(135===qe()&&(Oe()||nt(Ni)))return function(){const e=Je();return St(D.createAwaitExpression(Ve(qr)),e)}();default:return Ur()}}function Ur(){if(46===qe()||47===qe()){const e=Je();return St(D.createPrefixUnaryExpression(qe(),Ve(Vr)),e)}if(1===g&&30===qe()&&nt(Ht))return $r(!0);const e=Vr();if(pn.assert(q_(e)),(46===qe()||47===qe())&&!a.hasPrecedingLineBreak()){const t=qe();return We(),St(D.createPostfixUnaryExpression(e,t),e.pos)}return e}function Vr(){const e=Je();let t;return 102===qe()?nt(Un)?(d|=4194304,t=yt()):nt(Vn)?(We(),We(),t=St(D.createMetaProperty(102,Ft()),e),"defer"===t.name.escapedText?21!==qe()&&30!==qe()||(d|=4194304):d|=8388608):t=Wr():t=108===qe()?function(){const e=Je();let t=yt();if(30===qe()){const e=Je(),n=rt(ci);void 0!==n&&(Me(e,Je(),fa.super_may_not_use_type_arguments),ii()||(t=D.createExpressionWithTypeArguments(t,n)))}if(21===qe()||25===qe()||23===qe())return t;return ht(25,fa.super_must_be_followed_by_an_argument_list_or_member_access),St(R(t,un(!0,!0,!0)),e)}():Wr(),ai(e,t)}function Wr(){return ri(Je(),li(),!0)}function $r(e,t,n,r=!1){const i=Je(),o=function(e){const t=Je();if(st(30),32===qe())return et(),St(D.createJsxOpeningFragment(),t);const n=Gr(),r=524288&N?void 0:xo(),i=function(){const e=Je();return St(D.createJsxAttributes(Zt(13,Qr)),e)}();let o;32===qe()?(et(),o=D.createJsxOpeningElement(n,r,i)):(st(44),st(32,void 0,!1)&&(e?We():et()),o=D.createJsxSelfClosingElement(n,r,i));return St(o,t)}(e);let a;if(287===o.kind){let t,r=Kr(o);const s=r[r.length-1];if(285===(null==s?void 0:s.kind)&&!FO(s.openingElement.tagName,s.closingElement.tagName)&&FO(o.tagName,s.closingElement.tagName)){const e=s.children.end,n=St(D.createJsxElement(s.openingElement,s.children,St(D.createJsxClosingElement(St(I(""),e,e)),e,e)),s.openingElement.pos,e);r=kt([...r.slice(0,r.length-1),n],r.pos,e),t=s.closingElement}else t=function(e,t){const n=Je();st(31);const r=Gr();st(32,void 0,!1)&&(t||!FO(e.tagName,r)?We():et());return St(D.createJsxClosingElement(r),n)}(o,e),FO(o.tagName,t.tagName)||(n&&KE(n)&&FO(t.tagName,n.tagName)?Re(o.tagName,fa.JSX_element_0_has_no_corresponding_closing_tag,Zd(p,o.tagName)):Re(t.tagName,fa.Expected_corresponding_JSX_closing_tag_for_0,Zd(p,o.tagName)));a=St(D.createJsxElement(o,r,t),i)}else 290===o.kind?a=St(D.createJsxFragment(o,Kr(o),function(e){const t=Je();st(31),st(32,fa.Expected_corresponding_closing_tag_for_JSX_fragment,!1)&&(e?We():et());return St(D.createJsxJsxClosingFragment(),t)}(e)),i):(pn.assert(286===o.kind),a=o);if(!r&&e&&30===qe()){const e=void 0===t?a.pos:t,n=rt(()=>$r(!0,e));if(n){const t=Tt(28,!1);return PT(t,n.pos,0),Me(ts(p,e),n.end,fa.JSX_expressions_must_have_one_parent_element),St(D.createBinaryExpression(a,t,n),i)}}return a}function Hr(e,t){switch(t){case 1:if(QE(e))Re(e,fa.JSX_fragment_has_no_corresponding_closing_tag);else{const t=e.tagName;Me(Math.min(ts(p,t.pos),t.end),t.end,fa.JSX_element_0_has_no_corresponding_closing_tag,Zd(p,e.tagName))}return;case 31:case 7:return;case 12:case 13:return function(){const e=Je(),t=D.createJsxText(a.getTokenValue(),13===b);return b=a.scanJsxToken(),St(t,e)}();case 19:return Xr(!1);case 30:return $r(!1,void 0,e);default:return pn.assertNever(t)}}function Kr(e){const t=[],n=Je(),r=C;for(C|=16384;;){const n=Hr(e,b=a.reScanJsxToken());if(!n)break;if(t.push(n),KE(e)&&285===(null==n?void 0:n.kind)&&!FO(n.openingElement.tagName,n.closingElement.tagName)&&FO(e.tagName,n.closingElement.tagName))break}return C=r,kt(t,n)}function Gr(){const e=Je(),t=function(){const e=Je();Ye();const t=110===qe(),n=Et();if(ft(59))return Ye(),St(D.createJsxNamespacedName(n,Et()),e);return t?St(D.createToken(110),e):n}();if(rP(t))return t;let n=t;for(;ft(25);)n=St(R(n,un(!0,!1,!1)),e);return n}function Xr(e){const t=Je();if(!st(19))return;let n,r;return 20!==qe()&&(e||(n=mt(26)),r=Tr()),e?st(20):st(20,void 0,!1)&&et(),St(D.createJsxExpression(n,r),t)}function Qr(){if(19===qe())return function(){const e=Je();st(19),st(26);const t=Tr();return st(20),St(D.createJsxSpreadAttribute(t),e)}();const e=Je();return St(D.createJsxAttribute(function(){const e=Je();Ye();const t=Et();if(ft(59))return Ye(),St(D.createJsxNamespacedName(t,Et()),e);return t}(),function(){if(64===qe()){if(11===(b=a.scanJsxAttributeValue()))return yn();if(19===qe())return Xr(!0);if(30===qe())return $r(!0);Le(fa.or_JSX_element_expected)}return}()),e)}function Yr(){return We(),ma(qe())||23===qe()||ii()}function Zr(){return 29===qe()&&nt(Yr)}function ei(e){if(64&e.flags)return!0;if(qF(e)){let t=e.expression;for(;qF(t)&&!(64&t.flags);)t=t.expression;if(64&t.flags){for(;qF(e);)e.flags|=64,e=e.expression;return!0}}return!1}function ti(e,t,n){const r=un(!0,!0,!0),i=n||ei(t),o=i?B(t,n,r):R(t,r);if(i&&dD(o.name)&&Re(o.name,fa.An_optional_chain_cannot_contain_private_identifiers),BF(t)&&t.typeArguments){Me(t.typeArguments.pos-1,ts(p,t.typeArguments.end)+1,fa.An_instantiation_expression_cannot_be_followed_by_a_property_access)}return St(o,e)}function ni(e,t,n){let r;if(24===qe())r=Tt(80,!0,fa.An_element_access_expression_should_take_an_argument);else{const e=Te(Tr);Jh(e)&&(e.text=Ct(e.text)),r=e}st(24);return St(n||ei(t)?q(t,n,r):z(t,r),e)}function ri(e,t,n){for(;;){let r,i=!1;if(n&&Zr()?(r=ht(29),i=ma(qe())):i=ft(25),i)t=ti(e,t,r);else if(!r&&Ie()||!ft(23)){if(!ii()){if(!r){if(54===qe()&&!a.hasPrecedingLineBreak()){We(),t=St(D.createNonNullExpression(t),e);continue}const n=rt(ci);if(n){t=St(D.createExpressionWithTypeArguments(t,n),e);continue}}return t}t=r||234!==t.kind?oi(e,t,r,void 0):oi(e,t.expression,r,t.typeArguments)}else t=ni(e,t,r)}}function ii(){return 15===qe()||16===qe()}function oi(e,t,n,r){const i=D.createTaggedTemplateExpression(t,r,15===qe()?(Ge(!0),yn()):dn(!0));return(n||64&t.flags)&&(i.flags|=64),i.questionDotToken=n,St(i,e)}function ai(e,t){for(;;){let n;t=ri(e,t,!0);const r=mt(29);if(!r||(n=rt(ci),!ii())){if(n||21===qe()){r||234!==t.kind||(n=t.typeArguments,t=t.expression);const i=si();t=St(r||ei(t)?V(t,r,n,i):U(t,n,i),e);continue}if(r){const n=Tt(80,!1,fa.Identifier_expected);t=St(B(t,r,n),e)}break}t=oi(e,t,r,n)}return t}function si(){st(21);const e=on(11,ui);return st(22),e}function ci(){if(524288&N)return;if(30!==Xe())return;We();const e=on(20,br);return 32===Ke()?(We(),e&&function(){switch(qe()){case 21:case 15:case 16:return!0;case 30:case 32:case 40:case 41:return!1}return a.hasPrecedingLineBreak()||jr()||!Sr()}()?e:void 0):void 0}function li(){switch(qe()){case 15:26656&a.getTokenFlags()&&Ge(!1);case 9:case 10:case 11:return yn();case 110:case 108:case 106:case 112:case 97:return yt();case 21:return function(){const e=Je(),t=ze();st(21);const n=Te(Tr);return st(22),de(St($(n),e),t)}();case 23:return di();case 19:return fi();case 134:if(!nt(wi))break;return mi();case 60:return function(){const e=Je(),t=ze(),n=po(!0);if(86===qe())return ho(e,t,n,232);const r=Tt(283,!0,fa.Expression_expected);return DT(r,e),r.modifiers=n,r}();case 86:return ho(Je(),ze(),void 0,232);case 100:return mi();case 105:return function(){const e=Je();if(st(105),ft(25)){const t=Ft();return St(D.createMetaProperty(105,t),e)}let t,n=ri(Je(),li(),!1);234===n.kind&&(t=n.typeArguments,n=n.expression);29===qe()&&Le(fa.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0,Zd(p,n));const r=21===qe()?si():void 0;return St(W(n,t,r),e)}();case 44:case 69:if(14===(b=a.reScanSlashToken()))return yn();break;case 16:return dn(!1);case 81:return Ot()}return Dt(fa.Expression_expected)}function _i(){return 26===qe()?function(){const e=Je();st(26);const t=wr(!0);return St(D.createSpreadElement(t),e)}():28===qe()?St(D.createOmittedExpression(),Je()):wr(!0)}function ui(){return ke(s,_i)}function di(){const e=Je(),t=a.getTokenStart(),n=st(23),r=a.hasPrecedingLineBreak(),i=on(15,_i);return pt(23,24,n,t),St(j(i,r),e)}function pi(){const e=Je(),t=ze();if(mt(26)){const n=wr(!0);return de(St(D.createSpreadAssignment(n),e),t)}const n=po(!0);if(Lt(139))return ao(e,t,n,178,0);if(Lt(153))return ao(e,t,n,179,0);const r=mt(42),i=at(),o=It(),a=mt(58),s=mt(54);if(r||21===qe()||30===qe())return ro(e,t,n,r,o,a,s);let c;if(i&&59!==qe()){const e=mt(64),t=e?Te(()=>wr(!0)):void 0;c=D.createShorthandPropertyAssignment(o,t),c.equalsToken=e}else{st(59);const e=Te(()=>wr(!0));c=D.createPropertyAssignment(o,e)}return c.modifiers=n,c.questionToken=a,c.exclamationToken=s,de(St(c,e),t)}function fi(){const e=Je(),t=a.getTokenStart(),n=st(19),r=a.hasPrecedingLineBreak(),i=on(12,pi,!0);return pt(19,20,n,t),St(M(i,r),e)}function mi(){const e=Ie();ve(!1);const t=Je(),n=ze(),r=po(!1);st(100);const i=mt(42),o=i?1:0,a=H(r,mD)?2:0,s=o&&a?Se(81920,gi):o?function(e){return Se(16384,e)}(gi):a?Ne(gi):gi();const c=Fn(),l=Ln(o|a),_=In(59,!1),u=yi(o|a);ve(e);return de(St(D.createFunctionExpression(r,i,s,c,l,_,u),t),n)}function gi(){return it()?Nt():void 0}function hi(e,t){const n=Je(),r=ze(),i=a.getTokenStart(),o=st(19,t);if(o||e){const e=a.hasPrecedingLineBreak(),t=Zt(1,Ri);pt(19,20,o,i);const s=de(St(K(t,e),n),r);return 64===qe()&&(Le(fa.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses),We()),s}{const e=sn();return de(St(K(e,void 0),n),r)}}function yi(e,t){const n=Ee();ye(!!(1&e));const r=Oe();xe(!!(2&e));const i=ie;ie=!1;const o=Ie();o&&ve(!1);const a=hi(!!(16&e),t);return o&&ve(!0),ie=i,ye(n),xe(r),a}function vi(){const e=Je(),t=ze();st(99);const n=mt(135);let r;let i;if(st(21),27!==qe()&&(r=115===qe()||121===qe()||87===qe()||160===qe()&&nt(Ai)||135===qe()&&nt(ji)?Yi(!0):Se(8192,Tr)),n?st(165):ft(165)){const e=Te(()=>wr(!0));st(22),i=te(n,r,e,Ri())}else if(ft(103)){const e=Te(Tr);st(22),i=D.createForInStatement(r,e,Ri())}else{st(27);const e=27!==qe()&&22!==qe()?Te(Tr):void 0;st(27);const t=22!==qe()?Te(Tr):void 0;st(22),i=ee(r,e,t,Ri())}return de(St(i,e),t)}function bi(e){const t=Je(),n=ze();st(253===e?83:88);const r=vt()?void 0:Dt();xt();return de(St(253===e?D.createBreakStatement(r):D.createContinueStatement(r),t),n)}function xi(){return 84===qe()?function(){const e=Je(),t=ze();st(84);const n=Te(Tr);st(59);const r=Zt(3,Ri);return de(St(D.createCaseClause(n,r),e),t)}():function(){const e=Je();st(90),st(59);const t=Zt(3,Ri);return St(D.createDefaultClause(t),e)}()}function ki(){const e=Je(),t=ze();st(109),st(21);const n=Te(Tr);st(22);const r=function(){const e=Je();st(19);const t=Zt(2,xi);return st(20),St(D.createCaseBlock(t),e)}();return de(St(D.createSwitchStatement(n,r),e),t)}function Si(){const e=Je(),t=ze();st(113);const n=hi(!1),r=85===qe()?function(){const e=Je();let t;st(85),ft(21)?(t=Qi(),st(22)):t=void 0;const n=hi(!1);return St(D.createCatchClause(t,n),e)}():void 0;let i;return r&&98!==qe()||(st(98,fa.catch_or_finally_expected),i=hi(!1)),de(St(D.createTryStatement(n,r,i),e),t)}function Ti(){return We(),ma(qe())&&!a.hasPrecedingLineBreak()}function Ci(){return We(),86===qe()&&!a.hasPrecedingLineBreak()}function wi(){return We(),100===qe()&&!a.hasPrecedingLineBreak()}function Ni(){return We(),(ma(qe())||9===qe()||10===qe()||11===qe())&&!a.hasPrecedingLineBreak()}function Di(){for(;;)switch(qe()){case 115:case 121:case 87:case 100:case 86:case 94:return!0;case 160:return Li();case 135:return Mi();case 120:case 156:case 166:return Nr();case 144:case 145:return Vi();case 128:case 129:case 134:case 138:case 123:case 124:case 125:case 148:const e=qe();if(We(),a.hasPrecedingLineBreak())return!1;if(138===e&&156===qe())return!0;continue;case 162:return We(),19===qe()||80===qe()||95===qe();case 102:return We(),166===qe()||11===qe()||42===qe()||19===qe()||ma(qe());case 95:let t=We();if(156===t&&(t=nt(We)),64===t||42===t||19===t||90===t||130===t||60===t)return!0;continue;case 126:We();continue;default:return!1}}function Fi(){return nt(Di)}function Ei(){switch(qe()){case 60:case 27:case 19:case 115:case 121:case 160:case 100:case 86:case 94:case 101:case 92:case 117:case 99:case 88:case 83:case 107:case 118:case 109:case 111:case 113:case 89:case 85:case 98:case 134:case 138:case 120:case 144:case 145:case 156:case 162:case 166:return!0;case 102:return Fi()||nt(Wn);case 87:case 95:return Fi();case 129:case 125:case 123:case 124:case 126:case 148:return Fi()||!nt(Ti);default:return Sr()}}function Pi(){return We(),it()||19===qe()||23===qe()}function Ai(){return Oi(!0)}function Ii(){return We(),64===qe()||27===qe()||59===qe()}function Oi(e){return We(),e&&165===qe()?nt(Ii):(it()||19===qe())&&!a.hasPrecedingLineBreak()}function Li(){return nt(Oi)}function ji(e){return 160===We()&&Oi(e)}function Mi(){return nt(ji)}function Ri(){switch(qe()){case 27:return function(){const e=Je(),t=ze();return st(27),de(St(D.createEmptyStatement(),e),t)}();case 19:return hi(!1);case 115:return eo(Je(),ze(),void 0);case 121:if(nt(Pi))return eo(Je(),ze(),void 0);break;case 135:if(Mi())return eo(Je(),ze(),void 0);break;case 160:if(Li())return eo(Je(),ze(),void 0);break;case 100:return to(Je(),ze(),void 0);case 86:return go(Je(),ze(),void 0);case 101:return function(){const e=Je(),t=ze();st(101);const n=a.getTokenStart(),r=st(21),i=Te(Tr);pt(21,22,r,n);const o=Ri(),s=ft(93)?Ri():void 0;return de(St(Y(i,o,s),e),t)}();case 92:return function(){const e=Je(),t=ze();st(92);const n=Ri();st(117);const r=a.getTokenStart(),i=st(21),o=Te(Tr);return pt(21,22,i,r),ft(27),de(St(D.createDoStatement(n,o),e),t)}();case 117:return function(){const e=Je(),t=ze();st(117);const n=a.getTokenStart(),r=st(21),i=Te(Tr);pt(21,22,r,n);const o=Ri();return de(St(Z(i,o),e),t)}();case 99:return vi();case 88:return bi(252);case 83:return bi(253);case 107:return function(){const e=Je(),t=ze();st(107);const n=vt()?void 0:Te(Tr);return xt(),de(St(D.createReturnStatement(n),e),t)}();case 118:return function(){const e=Je(),t=ze();st(118);const n=a.getTokenStart(),r=st(21),i=Te(Tr);pt(21,22,r,n);const o=Se(67108864,Ri);return de(St(D.createWithStatement(i,o),e),t)}();case 109:return ki();case 111:return function(){const e=Je(),t=ze();st(111);let n=a.hasPrecedingLineBreak()?void 0:Te(Tr);return void 0===n&&(T++,n=St(I(""),Je())),bt()||_t(n),de(St(D.createThrowStatement(n),e),t)}();case 113:case 85:case 98:return Si();case 89:return function(){const e=Je(),t=ze();return st(89),xt(),de(St(D.createDebuggerStatement(),e),t)}();case 60:return Ji();case 134:case 120:case 156:case 144:case 145:case 138:case 87:case 94:case 95:case 102:case 123:case 124:case 125:case 128:case 129:case 126:case 148:case 162:if(Fi())return Ji()}return function(){const e=Je();let t,n=ze();const r=21===qe(),i=Te(Tr);return uD(i)&&ft(59)?t=D.createLabeledStatement(i,Ri()):(bt()||_t(i),t=Q(i),r&&(n=!1)),de(St(t,e),n)}()}function Bi(e){return 138===e.kind}function Ji(){const e=Je(),t=ze(),n=po(!0);if(H(n,Bi)){const r=function(e){return Se(33554432,()=>{const t=tn(C,e);if(t)return nn(t)})}(e);if(r)return r;for(const e of n)e.flags|=33554432;return Se(33554432,()=>zi(e,t,n))}return zi(e,t,n)}function zi(e,t,n){switch(qe()){case 115:case 121:case 87:case 160:case 135:return eo(e,t,n);case 100:return to(e,t,n);case 86:return go(e,t,n);case 120:return function(e,t,n){st(120);const r=Dt(),i=Fn(),o=yo(),a=$n();return de(St(D.createInterfaceDeclaration(n,r,i,o,a),e),t)}(e,t,n);case 156:return function(e,t,n){st(156),a.hasPrecedingLineBreak()&&Le(fa.Line_break_not_permitted_here);const r=Dt(),i=Fn();st(64);const o=141===qe()&&rt(er)||br();xt();return de(St(D.createTypeAliasDeclaration(n,r,i,o),e),t)}(e,t,n);case 94:return function(e,t,n){st(94);const r=Dt();let i;st(19)?(i=ke(81920,()=>on(6,So)),st(20)):i=sn();return de(St(D.createEnumDeclaration(n,r,i),e),t)}(e,t,n);case 162:case 144:case 145:return function(e,t,n){let r=0;if(162===qe())return wo(e,t,n);if(ft(145))r|=32;else if(st(144),11===qe())return wo(e,t,n);return Co(e,t,n,r)}(e,t,n);case 102:return function(e,t,n){st(102);const r=a.getTokenFullStart();let i,o;at()&&(i=Dt());"type"===(null==i?void 0:i.escapedText)&&(161!==qe()||at()&&nt(Ui))&&(at()||42===qe()||19===qe())?(o=156,i=at()?Dt():void 0):"defer"!==(null==i?void 0:i.escapedText)||(161===qe()?nt(qi):28===qe()||64===qe())||(o=166,i=at()?Dt():void 0);if(i&&28!==qe()&&161!==qe()&&166!==o)return function(e,t,n,r,i){st(64);const o=149===qe()&&nt(No)?function(){const e=Je();st(149),st(21);const t=Oo();return st(22),St(D.createExternalModuleReference(t),e)}():ln(!1);xt();const a=D.createImportEqualsDeclaration(n,i,r,o),s=de(St(a,e),t);return s}(e,t,n,i,156===o);const s=Eo(i,r,o,void 0),c=Oo(),l=Po();xt();return de(St(D.createImportDeclaration(n,s,c,l),e),t)}(e,t,n);case 95:switch(We(),qe()){case 90:case 64:return function(e,t,n){const r=Oe();let i;xe(!0),ft(64)?i=!0:st(90);const o=wr(!0);xt(),xe(r);return de(St(D.createExportAssignment(n,i,o),e),t)}(e,t,n);case 130:return function(e,t,n){st(130),st(145);const r=Dt();xt();const i=D.createNamespaceExportDeclaration(r);return i.modifiers=n,de(St(i,e),t)}(e,t,n);default:return function(e,t,n){const r=Oe();let i,o,s;xe(!0);const c=ft(156),l=Je();ft(42)?(ft(130)&&(i=function(e){return St(D.createNamespaceExport(jo(Ft)),e)}(l)),st(161),o=Oo()):(i=Mo(280),(161===qe()||11===qe()&&!a.hasPrecedingLineBreak())&&(st(161),o=Oo()));const _=qe();!o||118!==_&&132!==_||a.hasPrecedingLineBreak()||(s=Io(_));xt(),xe(r);return de(St(D.createExportDeclaration(n,c,i,o,s),e),t)}(e,t,n)}default:if(n){const t=Tt(283,!0,fa.Declaration_expected);return DT(t,e),t.modifiers=n,t}return}}function qi(){return 11===We()}function Ui(){return We(),161===qe()||64===qe()}function Vi(){return We(),!a.hasPrecedingLineBreak()&&(at()||11===qe())}function Wi(e,t){if(19!==qe()){if(4&e)return void jn();if(vt())return void xt()}return yi(e,t)}function $i(){const e=Je();if(28===qe())return St(D.createOmittedExpression(),e);const t=mt(26),n=Gi(),r=Cr();return St(D.createBindingElement(t,void 0,n,r),e)}function Hi(){const e=Je(),t=mt(26),n=it();let r,i=It();n&&59!==qe()?(r=i,i=void 0):(st(59),r=Gi());const o=Cr();return St(D.createBindingElement(t,i,r,o),e)}function Ki(){return 19===qe()||23===qe()||81===qe()||it()}function Gi(e){return 23===qe()?function(){const e=Je();st(23);const t=Te(()=>on(10,$i));return st(24),St(D.createArrayBindingPattern(t),e)}():19===qe()?function(){const e=Je();st(19);const t=Te(()=>on(9,Hi));return st(20),St(D.createObjectBindingPattern(t),e)}():Nt(e)}function Xi(){return Qi(!0)}function Qi(e){const t=Je(),n=ze(),r=Gi(fa.Private_identifiers_are_not_allowed_in_variable_declarations);let i;e&&80===r.kind&&54===qe()&&!a.hasPrecedingLineBreak()&&(i=yt());const o=xr(),s=Or(qe())?void 0:Cr();return de(St(ne(r,i,o,s),t),n)}function Yi(e){const t=Je();let n,r=0;switch(qe()){case 115:break;case 121:r|=1;break;case 87:r|=2;break;case 160:r|=4;break;case 135:pn.assert(Mi()),r|=6,We();break;default:pn.fail()}if(We(),165===qe()&&nt(Zi))n=sn();else{const t=Pe();he(e),n=on(8,e?Qi:Xi),he(t)}return St(re(n,r),t)}function Zi(){return Wt()&&22===We()}function eo(e,t,n){const r=Yi(!1);xt();return de(St(X(n,r),e),t)}function to(e,t,n){const r=Oe(),i=Qv(n);st(100);const o=mt(42),a=2048&i?gi():Nt(),s=o?1:0,c=1024&i?2:0,l=Fn();32&i&&xe(!0);const _=Ln(s|c),u=In(59,!1),d=Wi(s|c,fa.or_expected);xe(r);return de(St(D.createFunctionDeclaration(n,o,a,l,_,u,d),e),t)}function no(e,t,n){return rt(()=>{if(137===qe()?st(137):11===qe()&&21===nt(We)?rt(()=>{const e=yn();return"constructor"===e.text?e:void 0}):void 0){const r=Fn(),i=Ln(0),o=In(59,!1),a=Wi(0,fa.or_expected),s=D.createConstructorDeclaration(n,i,a);return s.typeParameters=r,s.type=o,de(St(s,e),t)}})}function ro(e,t,n,r,i,o,a,s){const c=r?1:0,l=H(n,mD)?2:0,_=Fn(),u=Ln(c|l),d=In(59,!1),p=Wi(c|l,s),f=D.createMethodDeclaration(n,r,i,o,_,u,d,p);return f.exclamationToken=a,de(St(f,e),t)}function io(e,t,n,r,i){const o=i||a.hasPrecedingLineBreak()?void 0:mt(54),s=xr(),c=ke(90112,Cr);!function(e,t,n){if(60!==qe()||a.hasPrecedingLineBreak())return 21===qe()?(Le(fa.Cannot_start_a_function_call_in_a_type_annotation),void We()):void(!t||vt()?bt()||(n?Le(fa._0_expected,Ia(27)):_t(e)):n?Le(fa._0_expected,Ia(27)):Le(fa.Expected_for_property_initializer));Le(fa.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations)}(r,s,c);return de(St(D.createPropertyDeclaration(n,r,i||o,s,c),e),t)}function oo(e,t,n){const r=mt(42),i=It(),o=mt(58);return r||21===qe()||30===qe()?ro(e,t,n,r,i,o,void 0,fa.or_expected):io(e,t,n,i,o)}function ao(e,t,n,r,i){const o=It(),a=Fn(),s=Ln(0),c=In(59,!1),l=Wi(i),_=178===r?D.createGetAccessorDeclaration(n,o,s,c,l):D.createSetAccessorDeclaration(n,o,s,l);return _.typeParameters=a,RD(_)&&(_.type=c),de(St(_,e),t)}function so(){let e;if(60===qe())return!0;for(;e_(qe());){if(e=qe(),n_(e))return!0;We()}if(42===qe())return!0;if(Pt()&&(e=qe(),We()),23===qe())return!0;if(void 0!==e){if(!Fh(e)||153===e||139===e)return!0;switch(qe()){case 21:case 30:case 54:case 59:case 64:case 58:return!0;default:return vt()}}return!1}function co(e,t,n){ht(126);const r=function(){const e=Ee(),t=Oe();ye(!1),xe(!0);const n=hi(!1);return ye(e),xe(t),n}(),i=de(St(D.createClassStaticBlockDeclaration(r),e),t);return i.modifiers=n,i}function lo(){if(Oe()&&135===qe()){const e=Je(),t=Dt(fa.Expression_expected);We();return ai(e,ri(e,t,!0))}return Vr()}function _o(){const e=Je();if(!ft(60))return;const t=Se(32768,lo);return St(D.createDecorator(t),e)}function uo(e,t,n){const r=Je(),i=qe();if(87===qe()&&t){if(!rt(jt))return}else{if(n&&126===qe()&&nt(Do))return;if(e&&126===qe())return;if(!e_(qe())||!rt(Rt))return}return St(L(i),r)}function po(e,t,n){const r=Je();let i,o,a,s=!1,c=!1,l=!1;if(e&&60===qe())for(;o=_o();)i=ae(i,o);for(;a=uo(s,t,n);)126===a.kind&&(s=!0),i=ae(i,a),c=!0;if(c&&e&&60===qe())for(;o=_o();)i=ae(i,o),l=!0;if(l)for(;a=uo(s,t,n);)126===a.kind&&(s=!0),i=ae(i,a);return i&&kt(i,r)}function fo(){let e;if(134===qe()){const t=Je();We();e=kt([St(L(134),t)],t)}return e}function mo(){const e=Je(),t=ze();if(27===qe())return We(),de(St(D.createSemicolonClassElement(),e),t);const n=po(!0,!0,!0);if(126===qe()&&nt(Do))return co(e,t,n);if(Lt(139))return ao(e,t,n,178,0);if(Lt(153))return ao(e,t,n,179,0);if(137===qe()||11===qe()){const r=no(e,t,n);if(r)return r}if(Rn())return Jn(e,t,n);if(ma(qe())||11===qe()||9===qe()||10===qe()||42===qe()||23===qe()){if(H(n,Bi)){for(const e of n)e.flags|=33554432;return Se(33554432,()=>oo(e,t,n))}return oo(e,t,n)}if(n){const r=Tt(80,!0,fa.Declaration_expected);return io(e,t,n,r,void 0)}return pn.fail("Should not have attempted to parse class member declaration.")}function go(e,t,n){return ho(e,t,n,264)}function ho(e,t,n,r){const i=Oe();st(86);const o=!it()||119===qe()&&nt($t)?void 0:wt(it()),a=Fn();H(n,pD)&&xe(!0);const s=yo();let c;st(19)?(c=Zt(5,mo),st(20)):c=sn(),xe(i);return de(St(264===r?D.createClassDeclaration(n,o,a,s,c):D.createClassExpression(n,o,a,s,c),e),t)}function yo(){if(ko())return Zt(22,vo)}function vo(){const e=Je(),t=qe();pn.assert(96===t||119===t),We();const n=on(7,bo);return St(D.createHeritageClause(t,n),e)}function bo(){const e=Je(),t=Vr();if(234===t.kind)return t;const n=xo();return St(D.createExpressionWithTypeArguments(t,n),e)}function xo(){return 30===qe()?cn(20,br,30,32):void 0}function ko(){return 96===qe()||119===qe()}function So(){const e=Je(),t=ze(),n=It(),r=Te(Cr);return de(St(D.createEnumMember(n,r),e),t)}function To(){const e=Je();let t;return st(19)?(t=Zt(1,Ri),st(20)):t=sn(),St(D.createModuleBlock(t),e)}function Co(e,t,n,r){const i=32&r,o=8&r?Ft():Dt(),a=ft(25)?Co(Je(),!1,void 0,8|i):To();return de(St(D.createModuleDeclaration(n,o,a,r),e),t)}function wo(e,t,n){let r,i,o=0;162===qe()?(r=Dt(),o|=2048):(r=yn(),r.text=Ct(r.text)),19===qe()?i=To():xt();return de(St(D.createModuleDeclaration(n,r,i,o),e),t)}function No(){return 21===We()}function Do(){return 19===We()}function Fo(){return 44===We()}function Eo(e,t,n,r=!1){let i;return(e||42===qe()||19===qe())&&(i=function(e,t,n,r){let i;e&&!ft(28)||(r&&a.setSkipJsDocLeadingAsterisks(!0),i=42===qe()?function(){const e=Je();st(42),st(130);const t=Dt();return St(D.createNamespaceImport(t),e)}():Mo(276),r&&a.setSkipJsDocLeadingAsterisks(!1));return St(D.createImportClause(n,e,i),t)}(e,t,n,r),st(161)),i}function Po(){const e=qe();if((118===e||132===e)&&!a.hasPrecedingLineBreak())return Io(e)}function Ao(){const e=Je(),t=ma(qe())?Ft():bn(11);st(59);const n=wr(!0);return St(D.createImportAttribute(t,n),e)}function Io(e,t){const n=Je();t||st(e);const r=a.getTokenStart();if(st(19)){const t=a.hasPrecedingLineBreak(),i=on(24,Ao,!0);if(!st(20)){const e=be(h);e&&e.code===fa._0_expected.code&&uT(e,Xx(l,p,r,1,fa.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}return St(D.createImportAttributes(i,t,e),n)}{const t=kt([],Je(),void 0,!1);return St(D.createImportAttributes(t,!1,e),n)}}function Oo(){if(11===qe()){const e=yn();return e.text=Ct(e.text),e}return Tr()}function Lo(){return ma(qe())||11===qe()}function jo(e){return 11===qe()?yn():e()}function Mo(e){const t=Je();return St(276===e?D.createNamedImports(cn(23,Bo,19,20)):D.createNamedExports(cn(23,Ro,19,20)),t)}function Ro(){const e=ze();return de(Jo(282),e)}function Bo(){return Jo(277)}function Jo(e){const t=Je();let n,r=Fh(qe())&&!at(),i=a.getTokenStart(),o=a.getTokenEnd(),s=!1,c=!0,l=jo(Ft);if(80===l.kind&&"type"===l.escapedText)if(130===qe()){const e=Ft();if(130===qe()){const t=Ft();Lo()?(s=!0,n=e,l=jo(_),c=!1):(n=l,l=t,c=!1)}else Lo()?(n=l,c=!1,l=jo(_)):(s=!0,l=e)}else Lo()&&(s=!0,l=jo(_));c&&130===qe()&&(n=l,st(130),l=jo(_)),277===e&&(80!==l.kind?(Me(ts(p,l.pos),l.end,fa.Identifier_expected),l=ET(Tt(80,!1),l.pos,l.pos)):r&&Me(i,o,fa.Identifier_expected));return St(277===e?D.createImportSpecifier(s,n,l):D.createExportSpecifier(s,n,l),t);function _(){return r=Fh(qe())&&!at(),i=a.getTokenStart(),o=a.getTokenEnd(),Ft()}}let zo;var qo;let Uo;var Wo;let $o;(qo=zo||(zo={}))[qo.SourceElements=0]="SourceElements",qo[qo.BlockStatements=1]="BlockStatements",qo[qo.SwitchClauses=2]="SwitchClauses",qo[qo.SwitchClauseStatements=3]="SwitchClauseStatements",qo[qo.TypeMembers=4]="TypeMembers",qo[qo.ClassMembers=5]="ClassMembers",qo[qo.EnumMembers=6]="EnumMembers",qo[qo.HeritageClauseElement=7]="HeritageClauseElement",qo[qo.VariableDeclarations=8]="VariableDeclarations",qo[qo.ObjectBindingElements=9]="ObjectBindingElements",qo[qo.ArrayBindingElements=10]="ArrayBindingElements",qo[qo.ArgumentExpressions=11]="ArgumentExpressions",qo[qo.ObjectLiteralMembers=12]="ObjectLiteralMembers",qo[qo.JsxAttributes=13]="JsxAttributes",qo[qo.JsxChildren=14]="JsxChildren",qo[qo.ArrayLiteralMembers=15]="ArrayLiteralMembers",qo[qo.Parameters=16]="Parameters",qo[qo.JSDocParameters=17]="JSDocParameters",qo[qo.RestProperties=18]="RestProperties",qo[qo.TypeParameters=19]="TypeParameters",qo[qo.TypeArguments=20]="TypeArguments",qo[qo.TupleElementTypes=21]="TupleElementTypes",qo[qo.HeritageClauses=22]="HeritageClauses",qo[qo.ImportOrExportSpecifiers=23]="ImportOrExportSpecifiers",qo[qo.ImportAttributes=24]="ImportAttributes",qo[qo.JSDocComment=25]="JSDocComment",qo[qo.Count=26]="Count",(Wo=Uo||(Uo={}))[Wo.False=0]="False",Wo[Wo.True=1]="True",Wo[Wo.Unknown=2]="Unknown",(e=>{function t(e){const t=Je(),n=(e?ft:st)(19),r=Se(16777216,Nn);e&&!n||dt(20);const i=D.createJSDocTypeExpression(r);return pe(i),St(i,t)}function n(){const e=Je(),t=ft(19),n=Je();let r=ln(!1);for(;81===qe();)Qe(),$e(),r=St(D.createJSDocMemberName(r,Dt()),n);t&&dt(20);const i=D.createJSDocNameReference(r);return pe(i),St(i,e)}let r;var i;let o;var s;function c(e=0,r){const i=p,o=void 0===r?i.length:e+r;if(r=o-e,pn.assert(e>=0),pn.assert(e<=o),pn.assert(o<=i.length),!jI(i,e))return;let s,c,_,u,d,f=[];const m=[],g=C;C|=1<<25;const h=a.scanRange(e+3,r-5,function(){let t,n=1,r=e-(i.lastIndexOf("\n",e)+1)+4;function l(e){t||(t=r),f.push(e),r+=e.length}$e();for(;Z(5););Z(4)&&(n=0,r=0);e:for(;;){switch(qe()){case 60:v(f),d||(d=Je()),A(S(r)),n=0,t=void 0;break;case 4:f.push(a.getTokenText()),n=0,r=0;break;case 42:const i=a.getTokenText();1===n?(n=2,l(i)):(pn.assert(0===n),n=1,r+=i.length);break;case 5:pn.assert(2!==n,"whitespace shouldn't come from the scanner while saving top-level comment text");const o=a.getTokenText();void 0!==t&&r+o.length>t&&f.push(o.slice(t-r)),r+=o.length;break;case 1:break e;case 82:n=2,l(a.getTokenValue());break;case 19:n=2;const s=a.getTokenFullStart(),c=F(a.getTokenEnd()-1);if(c){u||y(f),m.push(St(D.createJSDocText(f.join("")),u??e,s)),m.push(c),f=[],u=a.getTokenEnd();break}default:n=2,l(a.getTokenText())}2===n?He(!1):$e()}const p=f.join("").trimEnd();m.length&&p.length&&m.push(St(D.createJSDocText(p),u??e,d));m.length&&s&&pn.assertIsDefined(d,"having parsed tags implies that the end of the comment span should be set");const g=s&&kt(s,c,_);return St(D.createJSDocComment(m.length?kt(m,e,d):p.length?p:void 0,g),e,o)});return C=g,h;function y(e){for(;e.length&&("\n"===e[0]||"\r"===e[0]);)e.shift()}function v(e){for(;e.length;){const t=e[e.length-1].trimEnd();if(""!==t){if(t.length$(n)))&&346!==t.kind;)if(s=!0,345===t.kind){if(r){const e=Le(fa.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);e&&uT(e,Xx(l,p,0,0,fa.The_tag_was_first_specified_here));break}r=t}else o=ae(o,t);if(s){const t=i&&189===i.type.kind,n=D.createJSDocTypeLiteral(o,t);i=r&&r.typeExpression&&!j(r.typeExpression.type)?r.typeExpression:St(n,e),a=i.end}}a=a||void 0!==s?Je():(o??i??t).end,s||(s=w(e,a,n,r));const c=D.createJSDocTypedefTag(t,i,o,s);return St(c,e,a)}(r,i,e,o);break;case"callback":c=function(e,t,n,r){const i=U();x();let o=N(n);const a=V(e,n);o||(o=w(e,Je(),n,r));const s=void 0!==o?Je():a.end;return St(D.createJSDocCallbackTag(t,a,i,o),e,s)}(r,i,e,o);break;case"overload":c=function(e,t,n,r){x();let i=N(n);const o=V(e,n);i||(i=w(e,Je(),n,r));const a=void 0!==i?Je():o.end;return St(D.createJSDocOverloadTag(t,o,i),e,a)}(r,i,e,o);break;case"satisfies":c=function(e,n,r,i){const o=t(!1),a=void 0!==r&&void 0!==i?w(e,Je(),r,i):void 0;return St(D.createJSDocSatisfiesTag(n,o,a),e)}(r,i,e,o);break;case"see":c=function(e,t,r,i){const o=23===qe()||nt(()=>60===$e()&&ma($e())&&P(a.getTokenValue()))?void 0:n(),s=void 0!==r&&void 0!==i?w(e,Je(),r,i):void 0;return St(D.createJSDocSeeTag(t,o,s),e)}(r,i,e,o);break;case"exception":case"throws":c=function(e,t,n,r){const i=O(),o=w(e,Je(),n,r);return St(D.createJSDocThrowsTag(t,i,o),e)}(r,i,e,o);break;case"import":c=function(e,t,n,r){const i=a.getTokenFullStart();let o;at()&&(o=Dt());const s=Eo(o,i,156,!0),c=Oo(),l=Po(),_=void 0!==n&&void 0!==r?w(e,Je(),n,r):void 0;return St(D.createJSDocImportTag(t,s,c,l,_),e)}(r,i,e,o);break;default:c=function(e,t,n,r){return St(D.createJSDocUnknownTag(t,w(e,Je(),n,r)),e)}(r,i,e,o)}return c}function w(e,t,n,r){return r||(n+=t-e),N(n,r.slice(n))}function N(e,t){const n=Je();let r=[];const i=[];let o,s,c=0;function l(t){s||(s=e),r.push(t),e+=t.length}void 0!==t&&(""!==t&&l(t),c=1);let _=qe();e:for(;;){switch(_){case 4:c=0,r.push(a.getTokenText()),e=0;break;case 60:a.resetTokenState(a.getTokenEnd()-1);break e;case 1:break e;case 5:pn.assert(2!==c&&3!==c,"whitespace shouldn't come from the scanner while saving comment text");const t=a.getTokenText();void 0!==s&&e+t.length>s&&(r.push(t.slice(s-e)),c=2),e+=t.length;break;case 19:c=2;const _=a.getTokenFullStart(),u=F(a.getTokenEnd()-1);u?(i.push(St(D.createJSDocText(r.join("")),o??n,_)),i.push(u),r=[],o=a.getTokenEnd()):l(a.getTokenText());break;case 62:c=3===c?2:3,l(a.getTokenText());break;case 82:3!==c&&(c=2),l(a.getTokenValue());break;case 42:if(0===c){c=1,e+=1;break}default:3!==c&&(c=2),l(a.getTokenText())}_=2===c||3===c?He(3===c):$e()}y(r);const u=r.join("").trimEnd();return i.length?(u.length&&i.push(St(D.createJSDocText(u),o??n)),kt(i,n,a.getTokenEnd())):u.length?u:void 0}function F(e){const t=rt(E);if(!t)return;$e(),x();const n=function(){if(ma(qe())){const e=Je();let t=Ft();for(;ft(25);)t=St(D.createQualifiedName(t,81===qe()?Tt(80,!1):Ft()),e);for(;81===qe();)Qe(),$e(),t=St(D.createJSDocMemberName(t,Dt()),e);return t}return}(),r=[];for(;20!==qe()&&4!==qe()&&1!==qe();)r.push(a.getTokenText()),$e();return St(("link"===t?D.createJSDocLink:"linkcode"===t?D.createJSDocLinkCode:D.createJSDocLinkPlain)(n,r.join("")),e,a.getTokenEnd())}function E(){if(k(),19===qe()&&60===$e()&&ma($e())){const e=a.getTokenValue();if(P(e))return e}}function P(e){return"link"===e||"linkcode"===e||"linkplain"===e}function A(e){e&&(s?s.push(e):(s=[e],c=e.pos),_=e.end)}function O(){return k(),19===qe()?t():void 0}function L(){const e=Z(23);e&&x();const t=Z(62),n=function(){let e=ee();ft(23)&&st(24);for(;ft(25);){const t=ee();ft(23)&&st(24),e=_n(e,t)}return e}();var r;return t&&(gt(r=62)||(pn.assert(Ph(r)),Tt(r,!1,fa._0_expected,Ia(r)))),e&&(x(),mt(64)&&Tr(),st(24)),{name:n,isBracketed:e}}function j(e){switch(e.kind){case 151:return!0;case 189:return j(e.elementType);default:return UD(e)&&uD(e.typeName)&&"Object"===e.typeName.escapedText&&!e.typeArguments}}function M(e,t,n,r){let i=O(),o=!i;k();const{name:a,isBracketed:s}=L(),c=k();o&&!nt(E)&&(i=O());const l=w(e,Je(),r,c),_=function(e,t,n,r){if(e&&j(e.type)){const i=Je();let o,a;for(;o=rt(()=>K(n,r,t));)342===o.kind||349===o.kind?a=ae(a,o):346===o.kind&&Re(o.tagName,fa.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);if(a){const t=St(D.createJSDocTypeLiteral(a,189===e.type.kind),i);return St(D.createJSDocTypeExpression(t),i)}}}(i,a,n,r);_&&(i=_,o=!0);return St(1===n?D.createJSDocPropertyTag(t,a,s,i,o,l):D.createJSDocParameterTag(t,a,s,i,o,l),e)}function B(e,n,r,i){H(s,HP)&&Me(n.pos,a.getTokenStart(),fa._0_tag_already_specified,vc(n.escapedText));const o=t(!0),c=void 0!==r&&void 0!==i?w(e,Je(),r,i):void 0;return St(D.createJSDocTypeTag(n,o,c),e)}function J(){const e=ft(19),t=Je(),n=function(){const e=Je();let t=ee();for(;ft(25);){const n=ee();t=St(R(t,n),e)}return t}();a.setSkipJsDocLeadingAsterisks(!0);const r=xo();a.setSkipJsDocLeadingAsterisks(!1);const i=St(D.createExpressionWithTypeArguments(n,r),t);return e&&(x(),st(20)),i}function z(e,t,n,r,i){return St(t(n,w(e,Je(),r,i)),e)}function q(e,n,r,i){const o=t(!0);return x(),St(D.createJSDocThisTag(n,o,w(e,Je(),r,i)),e)}function U(e){const t=a.getTokenStart();if(!ma(qe()))return;const n=ee();if(ft(25)){const r=U(!0);return St(D.createModuleDeclaration(void 0,n,r,e?8:void 0),t)}return e&&(n.flags|=4096),n}function V(e,t){const n=function(e){const t=Je();let n,r;for(;n=rt(()=>K(4,e));){if(346===n.kind){Re(n.tagName,fa.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);break}r=ae(r,n)}return kt(r||[],t)}(t),r=rt(()=>{if(Z(60)){const e=S(t);if(e&&343===e.kind)return e}});return St(D.createJSDocSignature(void 0,n,r),e)}function W(e,t){for(;!uD(e)||!uD(t);){if(uD(e)||uD(t)||e.right.escapedText!==t.right.escapedText)return!1;e=e.left,t=t.left}return e.escapedText===t.escapedText}function $(e){return K(1,e)}function K(e,t,n){let r=!0,i=!1;for(;;)switch($e()){case 60:if(r){const r=X(e,t);return!(r&&(342===r.kind||349===r.kind)&&n&&(uD(r.name)||!W(n,r.name.left)))&&r}i=!1;break;case 4:r=!0,i=!1;break;case 42:i&&(r=!1),i=!0;break;case 80:r=!1;break;case 1:return!1}}function X(e,t){pn.assert(60===qe());const n=a.getTokenFullStart();$e();const r=ee(),i=k();let o;switch(r.escapedText){case"type":return 1===e&&B(n,r);case"prop":case"property":o=1;break;case"arg":case"argument":case"param":o=6;break;case"template":return Y(n,r,t,i);case"this":return q(n,r,t,i);default:return!1}return!!(e&o)&&M(n,r,e,t)}function Q(){const e=Je(),t=Z(23);t&&x();const n=po(!1,!0),r=ee(fa.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);let i;if(t&&(x(),st(64),i=Se(16777216,Nn),st(24)),!Pd(r))return St(D.createTypeParameterDeclaration(n,r,void 0,i),e)}function Y(e,n,r,i){const o=19===qe()?t():void 0,a=function(){const e=Je(),t=[];do{x();const e=Q();void 0!==e&&t.push(e),k()}while(Z(28));return kt(t,e)}();return St(D.createJSDocTemplateTag(n,o,a,w(e,Je(),r,i)),e)}function Z(e){return qe()===e&&($e(),!0)}function ee(e){if(!ma(qe()))return Tt(80,!e,e||fa.Identifier_expected);T++;const t=a.getTokenStart(),n=a.getTokenEnd(),r=qe(),i=Ct(a.getTokenValue()),o=St(I(i,r),t,n);return $e(),o}}e.parseJSDocTypeExpressionForTests=function(e,n,r){ce("file.js",e,99,void 0,1,0),a.setText(e,n,r),b=a.scan();const i=t(),o=fe("file.js",99,1,!1,[],L(1),0,ot),s=Zx(h,o);return y&&(o.jsDocDiagnostics=Zx(y,o)),_e(),i?{jsDocTypeExpression:i,diagnostics:s}:void 0},e.parseJSDocTypeExpression=t,e.parseJSDocNameReference=n,e.parseIsolatedJSDocComment=function(e,t,n){ce("",e,99,void 0,1,0);const r=Se(16777216,()=>c(t,n)),i=Zx(h,{languageVariant:0,text:e});return _e(),r?{jsDoc:r,diagnostics:i}:void 0},e.parseJSDocComment=function(e,t,n){const r=b,i=h.length,o=oe,a=Se(16777216,()=>c(t,n));return IT(a,e),524288&N&&(y||(y=[]),le(y,h,i)),b=r,h.length=i,oe=o,a},(i=r||(r={}))[i.BeginningOfLine=0]="BeginningOfLine",i[i.SawAsterisk=1]="SawAsterisk",i[i.SavingComments=2]="SavingComments",i[i.SavingBackticks=3]="SavingBackticks",(s=o||(o={}))[s.Property=1]="Property",s[s.Parameter=2]="Parameter",s[s.CallbackParameter=4]="CallbackParameter"})($o=e.JSDocParser||(e.JSDocParser={}))})(JI||(JI={}));var mO=new WeakSet;var gO,hO=new WeakSet;function yO(e){hO.add(e)}function vO(e){return void 0!==bO(e)}function bO(e){const t=Lo(e,OS,!1);if(t)return t;if(wo(e,".ts")){const t=Io(e),n=t.lastIndexOf(".d.");if(n>=0)return t.substring(n)}}function xO(e,t){const n=[];for(const e of fs(t,0)||_){NO(n,e,t.substring(e.pos,e.end))}e.pragmas=new Map;for(const t of n){if(e.pragmas.has(t.name)){const n=e.pragmas.get(t.name);n instanceof Array?n.push(t.args):e.pragmas.set(t.name,[n,t.args]);continue}e.pragmas.set(t.name,t.args)}}function kO(e,t){e.checkJsDirective=void 0,e.referencedFiles=[],e.typeReferenceDirectives=[],e.libReferenceDirectives=[],e.amdDependencies=[],e.hasNoDefaultLib=!1,e.pragmas.forEach((n,r)=>{switch(r){case"reference":{const r=e.referencedFiles,i=e.typeReferenceDirectives,o=e.libReferenceDirectives;p(et(n),n=>{const{types:a,lib:s,path:c,"resolution-mode":l,preserve:_}=n.arguments,u="true"===_||void 0;if("true"===n.arguments["no-default-lib"])e.hasNoDefaultLib=!0;else if(a){const e=function(e,t,n,r){if(e)return"import"===e?99:"require"===e?1:void r(t,n-t,fa.resolution_mode_should_be_either_require_or_import)}(l,a.pos,a.end,t);i.push({pos:a.pos,end:a.end,fileName:a.value,...e?{resolutionMode:e}:{},...u?{preserve:u}:{}})}else s?o.push({pos:s.pos,end:s.end,fileName:s.value,...u?{preserve:u}:{}}):c?r.push({pos:c.pos,end:c.end,fileName:c.value,...u?{preserve:u}:{}}):t(n.range.pos,n.range.end-n.range.pos,fa.Invalid_reference_directive_syntax)});break}case"amd-dependency":e.amdDependencies=P(et(n),e=>({name:e.arguments.name,path:e.arguments.path}));break;case"amd-module":if(n instanceof Array)for(const r of n)e.moduleName&&t(r.range.pos,r.range.end-r.range.pos,fa.An_AMD_module_cannot_have_multiple_name_assignments),e.moduleName=r.arguments.name;else e.moduleName=n.arguments.name;break;case"ts-nocheck":case"ts-check":p(et(n),t=>{(!e.checkJsDirective||t.range.pos>e.checkJsDirective.pos)&&(e.checkJsDirective={enabled:"ts-check"===r,end:t.range.end,pos:t.range.pos})});break;case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:pn.fail("Unhandled pragma kind")}})}(e=>{function t(e,t,r,o,a,s,c){return void(r?_(e):l(e));function l(e){let r="";if(c&&n(e)&&(r=a.substring(e.pos,e.end)),sA(e,t),ET(e,e.pos+o,e.end+o),c&&n(e)&&pn.assert(r===s.substring(e.pos,e.end)),iO(e,l,_),Au(e))for(const t of e.jsDoc)l(t);i(e,c)}function _(e){ET(e,e.pos+o,e.end+o);for(const t of e)l(t)}}function n(e){switch(e.kind){case 11:case 9:case 80:return!0}return!1}function r(e,t,n,r,i){pn.assert(e.end>=t,"Adjusting an element that was entirely before the change range"),pn.assert(e.pos<=n,"Adjusting an element that was entirely after the change range"),pn.assert(e.pos<=e.end);const o=Math.min(e.pos,r),a=e.end>=n?e.end+i:Math.min(e.end,r);if(pn.assert(o<=a),e.parent){const t=e.parent;pn.assertGreaterThanOrEqual(o,t.pos),pn.assertLessThanOrEqual(a,t.end)}ET(e,o,a)}function i(e,t){if(t){let t=e.pos;const n=e=>{pn.assert(e.pos>=t),t=e.end};if(Au(e))for(const t of e.jsDoc)n(t);iO(e,n),pn.assert(t<=e.end)}}function o(e,t){let n,r=e;if(iO(e,function e(i){if(Pd(i))return;if(!(i.pos<=t))return pn.assert(i.pos>t),!0;if(i.pos>=r.pos&&(r=i),tr.pos&&(r=e)}return r}function a(e,t,n,r){const i=e.text;if(n&&(pn.assert(i.length-n.span.length+n.newLength===t.length),r||pn.shouldAssert(3))){const e=i.substr(0,n.span.start),r=t.substr(0,n.span.start);pn.assert(e===r);const o=i.substring(Is(n.span),i.length),a=t.substring(Is(Qs(n)),t.length);pn.assert(o===a)}}function s(e){let t=e.statements,n=0;pn.assert(n(o!==i&&(r&&r.end===o&&n=e.pos&&i=e.pos&&i0&&t<=n;t++){const t=o(e,r);pn.assert(t.pos<=r);const n=t.pos;r=Math.max(0,n-1)}const i=Xs(r,Is(t.span)),a=t.newLength+(t.span.start-r);return Zs(i,a)}(e,c);a(e,n,d,l),pn.assert(d.span.start<=c.span.start),pn.assert(Is(d.span)===Is(c.span)),pn.assert(Is(Qs(d))===Is(Qs(c)));const p=Qs(d).length-d.span.length;!function(e,n,o,a,s,c,l,_){return void u(e);function u(p){if(pn.assert(p.pos<=p.end),p.pos>o)return void t(p,e,!1,s,c,l,_);const f=p.end;if(f>=n){if(yO(p),sA(p,e),r(p,n,o,a,s),iO(p,u,d),Au(p))for(const e of p.jsDoc)u(e);i(p,_)}else pn.assert(fo)return void t(i,e,!0,s,c,l,_);const d=i.end;if(d>=n){yO(i),r(i,n,o,a,s);for(const e of i)u(e)}else pn.assert(dr){_();const t={range:{pos:e.pos+i,end:e.end+i},type:l};c=ae(c,t),s&&pn.assert(o.substring(e.pos,e.end)===a.substring(t.range.pos,t.range.end))}}return _(),c;function _(){l||(l=!0,c?t&&c.push(...t):c=t)}}(e.commentDirectives,f.commentDirectives,d.span.start,Is(d.span),p,_,n,l),f.impliedNodeFormat=e.impliedNodeFormat,cA(e,f),f},e.createSyntaxCursor=s,(l=c||(c={}))[l.Value=-1]="Value"})(gO||(gO={}));var SO=new Map;function TO(e){if(SO.has(e))return SO.get(e);const t=new RegExp(`(\\s${e}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`,"im");return SO.set(e,t),t}var CO=/^\/\/\/\s*<(\S+)\s.*?\/>/m,wO=/^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;function NO(e,t,n){const r=2===t.kind&&CO.exec(n);if(r){const i=r[1].toLowerCase(),o=Mi[i];if(!(o&&1&o.kind))return;if(o.args){const r={};for(const e of o.args){const i=TO(e.name).exec(n);if(!i&&!e.optional)return;if(i){const n=i[2]||i[3];if(e.captureSpan){const o=t.pos+i.index+i[1].length+1;r[e.name]={value:n,pos:o,end:o+n.length}}else r[e.name]=n}}e.push({name:i,args:{arguments:r,range:t}})}else e.push({name:i,args:{arguments:{},range:t}});return}const i=2===t.kind&&wO.exec(n);if(i)return DO(e,t,2,i);if(3===t.kind){const r=/@(\S+)(\s+(?:\S.*)?)?$/gm;let i;for(;i=r.exec(n);)DO(e,t,4,i)}}function DO(e,t,n,r){if(!r)return;const i=r[1].toLowerCase(),o=Mi[i];if(!(o&&o.kind&n))return;const a=function(e,t){if(!t)return{};if(!e.args)return{};const n=t.trim().split(/\s+/),r={};for(let t=0;t[""+t,e])),IO=[["es5","lib.es5.d.ts"],["es6","lib.es2015.d.ts"],["es2015","lib.es2015.d.ts"],["es7","lib.es2016.d.ts"],["es2016","lib.es2016.d.ts"],["es2017","lib.es2017.d.ts"],["es2018","lib.es2018.d.ts"],["es2019","lib.es2019.d.ts"],["es2020","lib.es2020.d.ts"],["es2021","lib.es2021.d.ts"],["es2022","lib.es2022.d.ts"],["es2023","lib.es2023.d.ts"],["es2024","lib.es2024.d.ts"],["esnext","lib.esnext.d.ts"],["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.core","lib.es2015.core.d.ts"],["es2015.collection","lib.es2015.collection.d.ts"],["es2015.generator","lib.es2015.generator.d.ts"],["es2015.iterable","lib.es2015.iterable.d.ts"],["es2015.promise","lib.es2015.promise.d.ts"],["es2015.proxy","lib.es2015.proxy.d.ts"],["es2015.reflect","lib.es2015.reflect.d.ts"],["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.arraybuffer","lib.es2017.arraybuffer.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"],["es2017.intl","lib.es2017.intl.d.ts"],["es2017.typedarrays","lib.es2017.typedarrays.d.ts"],["es2018.asyncgenerator","lib.es2018.asyncgenerator.d.ts"],["es2018.asynciterable","lib.es2018.asynciterable.d.ts"],["es2018.intl","lib.es2018.intl.d.ts"],["es2018.promise","lib.es2018.promise.d.ts"],["es2018.regexp","lib.es2018.regexp.d.ts"],["es2019.array","lib.es2019.array.d.ts"],["es2019.object","lib.es2019.object.d.ts"],["es2019.string","lib.es2019.string.d.ts"],["es2019.symbol","lib.es2019.symbol.d.ts"],["es2019.intl","lib.es2019.intl.d.ts"],["es2020.bigint","lib.es2020.bigint.d.ts"],["es2020.date","lib.es2020.date.d.ts"],["es2020.promise","lib.es2020.promise.d.ts"],["es2020.sharedmemory","lib.es2020.sharedmemory.d.ts"],["es2020.string","lib.es2020.string.d.ts"],["es2020.symbol.wellknown","lib.es2020.symbol.wellknown.d.ts"],["es2020.intl","lib.es2020.intl.d.ts"],["es2020.number","lib.es2020.number.d.ts"],["es2021.promise","lib.es2021.promise.d.ts"],["es2021.string","lib.es2021.string.d.ts"],["es2021.weakref","lib.es2021.weakref.d.ts"],["es2021.intl","lib.es2021.intl.d.ts"],["es2022.array","lib.es2022.array.d.ts"],["es2022.error","lib.es2022.error.d.ts"],["es2022.intl","lib.es2022.intl.d.ts"],["es2022.object","lib.es2022.object.d.ts"],["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"],["es2023.intl","lib.es2023.intl.d.ts"],["es2024.arraybuffer","lib.es2024.arraybuffer.d.ts"],["es2024.collection","lib.es2024.collection.d.ts"],["es2024.object","lib.es2024.object.d.ts"],["es2024.promise","lib.es2024.promise.d.ts"],["es2024.regexp","lib.es2024.regexp.d.ts"],["es2024.sharedmemory","lib.es2024.sharedmemory.d.ts"],["es2024.string","lib.es2024.string.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.es2024.promise.d.ts"],["esnext.weakref","lib.es2021.weakref.d.ts"],["esnext.decorators","lib.esnext.decorators.d.ts"],["esnext.object","lib.es2024.object.d.ts"],["esnext.array","lib.esnext.array.d.ts"],["esnext.regexp","lib.es2024.regexp.d.ts"],["esnext.string","lib.es2024.string.d.ts"],["esnext.iterator","lib.esnext.iterator.d.ts"],["esnext.promise","lib.esnext.promise.d.ts"],["esnext.float16","lib.esnext.float16.d.ts"],["esnext.error","lib.esnext.error.d.ts"],["esnext.sharedmemory","lib.esnext.sharedmemory.d.ts"],["decorators","lib.decorators.d.ts"],["decorators.legacy","lib.decorators.legacy.d.ts"]],OO=IO.map(e=>e[0]),LO=new Map(IO),jO=[{name:"watchFile",type:new Map(Object.entries({fixedpollinginterval:0,prioritypollinginterval:1,dynamicprioritypolling:2,fixedchunksizepolling:3,usefsevents:4,usefseventsonparentdirectory:5})),category:fa.Watch_and_Build_Modes,description:fa.Specify_how_the_TypeScript_watch_mode_works,defaultValueDescription:4},{name:"watchDirectory",type:new Map(Object.entries({usefsevents:0,fixedpollinginterval:1,dynamicprioritypolling:2,fixedchunksizepolling:3})),category:fa.Watch_and_Build_Modes,description:fa.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,defaultValueDescription:0},{name:"fallbackPolling",type:new Map(Object.entries({fixedinterval:0,priorityinterval:1,dynamicpriority:2,fixedchunksize:3})),category:fa.Watch_and_Build_Modes,description:fa.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,defaultValueDescription:1},{name:"synchronousWatchDirectory",type:"boolean",category:fa.Watch_and_Build_Modes,description:fa.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,defaultValueDescription:!1},{name:"excludeDirectories",type:"list",element:{name:"excludeDirectory",type:"string",isFilePath:!0,extraValidation:Xj},allowConfigDirTemplateSubstitution:!0,category:fa.Watch_and_Build_Modes,description:fa.Remove_a_list_of_directories_from_the_watch_process},{name:"excludeFiles",type:"list",element:{name:"excludeFile",type:"string",isFilePath:!0,extraValidation:Xj},allowConfigDirTemplateSubstitution:!0,category:fa.Watch_and_Build_Modes,description:fa.Remove_a_list_of_files_from_the_watch_mode_s_processing}],MO=[{name:"help",shortName:"h",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:fa.Command_line_Options,description:fa.Print_this_message,defaultValueDescription:!1},{name:"help",shortName:"?",type:"boolean",isCommandLineOnly:!0,category:fa.Command_line_Options,defaultValueDescription:!1},{name:"watch",shortName:"w",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:fa.Command_line_Options,description:fa.Watch_input_files,defaultValueDescription:!1},{name:"preserveWatchOutput",type:"boolean",showInSimplifiedHelpView:!1,category:fa.Output_Formatting,description:fa.Disable_wiping_the_console_in_watch_mode,defaultValueDescription:!1},{name:"listFiles",type:"boolean",category:fa.Compiler_Diagnostics,description:fa.Print_all_of_the_files_read_during_the_compilation,defaultValueDescription:!1},{name:"explainFiles",type:"boolean",category:fa.Compiler_Diagnostics,description:fa.Print_files_read_during_the_compilation_including_why_it_was_included,defaultValueDescription:!1},{name:"listEmittedFiles",type:"boolean",category:fa.Compiler_Diagnostics,description:fa.Print_the_names_of_emitted_files_after_a_compilation,defaultValueDescription:!1},{name:"pretty",type:"boolean",showInSimplifiedHelpView:!0,category:fa.Output_Formatting,description:fa.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,defaultValueDescription:!0},{name:"traceResolution",type:"boolean",category:fa.Compiler_Diagnostics,description:fa.Log_paths_used_during_the_moduleResolution_process,defaultValueDescription:!1},{name:"diagnostics",type:"boolean",category:fa.Compiler_Diagnostics,description:fa.Output_compiler_performance_information_after_building,defaultValueDescription:!1},{name:"extendedDiagnostics",type:"boolean",category:fa.Compiler_Diagnostics,description:fa.Output_more_detailed_compiler_performance_information_after_building,defaultValueDescription:!1},{name:"generateCpuProfile",type:"string",isFilePath:!0,paramType:fa.FILE_OR_DIRECTORY,category:fa.Compiler_Diagnostics,description:fa.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,defaultValueDescription:"profile.cpuprofile"},{name:"generateTrace",type:"string",isFilePath:!0,paramType:fa.DIRECTORY,category:fa.Compiler_Diagnostics,description:fa.Generates_an_event_trace_and_a_list_of_types},{name:"incremental",shortName:"i",type:"boolean",category:fa.Projects,description:fa.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,transpileOptionValue:void 0,defaultValueDescription:fa.false_unless_composite_is_set},{name:"declaration",shortName:"d",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.Emit,transpileOptionValue:void 0,description:fa.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,defaultValueDescription:fa.false_unless_composite_is_set},{name:"declarationMap",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.Emit,defaultValueDescription:!1,description:fa.Create_sourcemaps_for_d_ts_files},{name:"emitDeclarationOnly",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.Emit,description:fa.Only_output_d_ts_files_and_not_JavaScript_files,transpileOptionValue:void 0,defaultValueDescription:!1},{name:"sourceMap",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.Emit,defaultValueDescription:!1,description:fa.Create_source_map_files_for_emitted_JavaScript_files},{name:"inlineSourceMap",type:"boolean",affectsBuildInfo:!0,category:fa.Emit,description:fa.Include_sourcemap_files_inside_the_emitted_JavaScript,defaultValueDescription:!1},{name:"noCheck",type:"boolean",showInSimplifiedHelpView:!1,category:fa.Compiler_Diagnostics,description:fa.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,transpileOptionValue:!0,defaultValueDescription:!1},{name:"noEmit",type:"boolean",showInSimplifiedHelpView:!0,category:fa.Emit,description:fa.Disable_emitting_files_from_a_compilation,transpileOptionValue:void 0,defaultValueDescription:!1},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,category:fa.Watch_and_Build_Modes,description:fa.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,defaultValueDescription:!1},{name:"locale",type:"string",category:fa.Command_line_Options,isCommandLineOnly:!0,description:fa.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,defaultValueDescription:fa.Platform_specific}],RO={name:"target",shortName:"t",type:new Map(Object.entries({es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,es2022:9,es2023:10,es2024:11,esnext:99})),affectsSourceFile:!0,affectsModuleResolution:!0,affectsEmit:!0,affectsBuildInfo:!0,deprecatedKeys:new Set(["es3"]),paramType:fa.VERSION,showInSimplifiedHelpView:!0,category:fa.Language_and_Environment,description:fa.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,defaultValueDescription:1},BO={name:"module",shortName:"m",type:new Map(Object.entries({none:0,commonjs:1,amd:2,system:4,umd:3,es6:5,es2015:5,es2020:6,es2022:7,esnext:99,node16:100,node18:101,node20:102,nodenext:199,preserve:200})),affectsSourceFile:!0,affectsModuleResolution:!0,affectsEmit:!0,affectsBuildInfo:!0,paramType:fa.KIND,showInSimplifiedHelpView:!0,category:fa.Modules,description:fa.Specify_what_module_code_is_generated,defaultValueDescription:void 0},JO=[{name:"all",type:"boolean",showInSimplifiedHelpView:!0,category:fa.Command_line_Options,description:fa.Show_all_compiler_options,defaultValueDescription:!1},{name:"version",shortName:"v",type:"boolean",showInSimplifiedHelpView:!0,category:fa.Command_line_Options,description:fa.Print_the_compiler_s_version,defaultValueDescription:!1},{name:"init",type:"boolean",showInSimplifiedHelpView:!0,category:fa.Command_line_Options,description:fa.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,defaultValueDescription:!1},{name:"project",shortName:"p",type:"string",isFilePath:!0,showInSimplifiedHelpView:!0,category:fa.Command_line_Options,paramType:fa.FILE_OR_DIRECTORY,description:fa.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json},{name:"showConfig",type:"boolean",showInSimplifiedHelpView:!0,category:fa.Command_line_Options,isCommandLineOnly:!0,description:fa.Print_the_final_configuration_instead_of_building,defaultValueDescription:!1},{name:"listFilesOnly",type:"boolean",category:fa.Command_line_Options,isCommandLineOnly:!0,description:fa.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,defaultValueDescription:!1},RO,BO,{name:"lib",type:"list",element:{name:"lib",type:LO,defaultValueDescription:void 0},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:fa.Language_and_Environment,description:fa.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,transpileOptionValue:void 0},{name:"allowJs",type:"boolean",allowJsFlag:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.JavaScript_Support,description:fa.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files,defaultValueDescription:!1},{name:"checkJs",type:"boolean",affectsModuleResolution:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.JavaScript_Support,description:fa.Enable_error_reporting_in_type_checked_JavaScript_files,defaultValueDescription:!1},{name:"jsx",type:PO,affectsSourceFile:!0,affectsEmit:!0,affectsBuildInfo:!0,affectsModuleResolution:!0,affectsSemanticDiagnostics:!0,paramType:fa.KIND,showInSimplifiedHelpView:!0,category:fa.Language_and_Environment,description:fa.Specify_what_JSX_code_is_generated,defaultValueDescription:void 0},{name:"outFile",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:fa.FILE,showInSimplifiedHelpView:!0,category:fa.Emit,description:fa.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,transpileOptionValue:void 0},{name:"outDir",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:fa.DIRECTORY,showInSimplifiedHelpView:!0,category:fa.Emit,description:fa.Specify_an_output_folder_for_all_emitted_files},{name:"rootDir",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:fa.LOCATION,category:fa.Modules,description:fa.Specify_the_root_folder_within_your_source_files,defaultValueDescription:fa.Computed_from_the_list_of_input_files},{name:"composite",type:"boolean",affectsBuildInfo:!0,isTSConfigOnly:!0,category:fa.Projects,transpileOptionValue:void 0,defaultValueDescription:!1,description:fa.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references},{name:"tsBuildInfoFile",type:"string",affectsEmit:!0,affectsBuildInfo:!0,isFilePath:!0,paramType:fa.FILE,category:fa.Projects,transpileOptionValue:void 0,defaultValueDescription:".tsbuildinfo",description:fa.Specify_the_path_to_tsbuildinfo_incremental_compilation_file},{name:"removeComments",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.Emit,defaultValueDescription:!1,description:fa.Disable_emitting_comments},{name:"importHelpers",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,affectsSourceFile:!0,category:fa.Emit,description:fa.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,defaultValueDescription:!1},{name:"importsNotUsedAsValues",type:new Map(Object.entries({remove:0,preserve:1,error:2})),affectsEmit:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Backwards_Compatibility,description:fa.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,defaultValueDescription:0},{name:"downlevelIteration",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Emit,description:fa.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,defaultValueDescription:!1},{name:"isolatedModules",type:"boolean",category:fa.Interop_Constraints,description:fa.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,transpileOptionValue:!0,defaultValueDescription:!1},{name:"verbatimModuleSyntax",type:"boolean",affectsEmit:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Interop_Constraints,description:fa.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting,defaultValueDescription:!1},{name:"isolatedDeclarations",type:"boolean",category:fa.Interop_Constraints,description:fa.Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files,defaultValueDescription:!1,affectsBuildInfo:!0,affectsSemanticDiagnostics:!0},{name:"erasableSyntaxOnly",type:"boolean",category:fa.Interop_Constraints,description:fa.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,defaultValueDescription:!1,affectsBuildInfo:!0,affectsSemanticDiagnostics:!0},{name:"libReplacement",type:"boolean",affectsProgramStructure:!0,category:fa.Language_and_Environment,description:fa.Enable_lib_replacement,defaultValueDescription:!0},{name:"strict",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.Type_Checking,description:fa.Enable_all_strict_type_checking_options,defaultValueDescription:!1},{name:"noImplicitAny",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,defaultValueDescription:fa.false_unless_strict_is_set},{name:"strictNullChecks",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.When_type_checking_take_into_account_null_and_undefined,defaultValueDescription:fa.false_unless_strict_is_set},{name:"strictFunctionTypes",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,defaultValueDescription:fa.false_unless_strict_is_set},{name:"strictBindCallApply",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,defaultValueDescription:fa.false_unless_strict_is_set},{name:"strictPropertyInitialization",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,defaultValueDescription:fa.false_unless_strict_is_set},{name:"strictBuiltinIteratorReturn",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any,defaultValueDescription:fa.false_unless_strict_is_set},{name:"noImplicitThis",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.Enable_error_reporting_when_this_is_given_the_type_any,defaultValueDescription:fa.false_unless_strict_is_set},{name:"useUnknownInCatchVariables",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.Default_catch_clause_variables_as_unknown_instead_of_any,defaultValueDescription:fa.false_unless_strict_is_set},{name:"alwaysStrict",type:"boolean",affectsSourceFile:!0,affectsEmit:!0,affectsBuildInfo:!0,strictFlag:!0,category:fa.Type_Checking,description:fa.Ensure_use_strict_is_always_emitted,defaultValueDescription:fa.false_unless_strict_is_set},{name:"noUnusedLocals",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Enable_error_reporting_when_local_variables_aren_t_read,defaultValueDescription:!1},{name:"noUnusedParameters",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Raise_an_error_when_a_function_parameter_isn_t_read,defaultValueDescription:!1},{name:"exactOptionalPropertyTypes",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Interpret_optional_property_types_as_written_rather_than_adding_undefined,defaultValueDescription:!1},{name:"noImplicitReturns",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,defaultValueDescription:!1},{name:"noFallthroughCasesInSwitch",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,defaultValueDescription:!1},{name:"noUncheckedIndexedAccess",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Add_undefined_to_a_type_when_accessed_using_an_index,defaultValueDescription:!1},{name:"noImplicitOverride",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,defaultValueDescription:!1},{name:"noPropertyAccessFromIndexSignature",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!1,category:fa.Type_Checking,description:fa.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,defaultValueDescription:!1},{name:"moduleResolution",type:new Map(Object.entries({node10:2,node:2,classic:1,node16:3,nodenext:99,bundler:100})),deprecatedKeys:new Set(["node"]),affectsSourceFile:!0,affectsModuleResolution:!0,paramType:fa.STRATEGY,category:fa.Modules,description:fa.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,defaultValueDescription:fa.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node},{name:"baseUrl",type:"string",affectsModuleResolution:!0,isFilePath:!0,category:fa.Modules,description:fa.Specify_the_base_directory_to_resolve_non_relative_module_names},{name:"paths",type:"object",affectsModuleResolution:!0,allowConfigDirTemplateSubstitution:!0,isTSConfigOnly:!0,category:fa.Modules,description:fa.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,transpileOptionValue:void 0},{name:"rootDirs",type:"list",isTSConfigOnly:!0,element:{name:"rootDirs",type:"string",isFilePath:!0},affectsModuleResolution:!0,allowConfigDirTemplateSubstitution:!0,category:fa.Modules,description:fa.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,transpileOptionValue:void 0,defaultValueDescription:fa.Computed_from_the_list_of_input_files},{name:"typeRoots",type:"list",element:{name:"typeRoots",type:"string",isFilePath:!0},affectsModuleResolution:!0,allowConfigDirTemplateSubstitution:!0,category:fa.Modules,description:fa.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types},{name:"types",type:"list",element:{name:"types",type:"string"},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:fa.Modules,description:fa.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,transpileOptionValue:void 0},{name:"allowSyntheticDefaultImports",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Interop_Constraints,description:fa.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,defaultValueDescription:fa.module_system_or_esModuleInterop},{name:"esModuleInterop",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:fa.Interop_Constraints,description:fa.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,defaultValueDescription:!1},{name:"preserveSymlinks",type:"boolean",category:fa.Interop_Constraints,description:fa.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,defaultValueDescription:!1},{name:"allowUmdGlobalAccess",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Modules,description:fa.Allow_accessing_UMD_globals_from_modules,defaultValueDescription:!1},{name:"moduleSuffixes",type:"list",element:{name:"suffix",type:"string"},listPreserveFalsyValues:!0,affectsModuleResolution:!0,category:fa.Modules,description:fa.List_of_file_name_suffixes_to_search_when_resolving_a_module},{name:"allowImportingTsExtensions",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Modules,description:fa.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,defaultValueDescription:!1,transpileOptionValue:void 0},{name:"rewriteRelativeImportExtensions",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Modules,description:fa.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files,defaultValueDescription:!1},{name:"resolvePackageJsonExports",type:"boolean",affectsModuleResolution:!0,category:fa.Modules,description:fa.Use_the_package_json_exports_field_when_resolving_package_imports,defaultValueDescription:fa.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false},{name:"resolvePackageJsonImports",type:"boolean",affectsModuleResolution:!0,category:fa.Modules,description:fa.Use_the_package_json_imports_field_when_resolving_imports,defaultValueDescription:fa.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false},{name:"customConditions",type:"list",element:{name:"condition",type:"string"},affectsModuleResolution:!0,category:fa.Modules,description:fa.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports},{name:"noUncheckedSideEffectImports",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Modules,description:fa.Check_side_effect_imports,defaultValueDescription:!1},{name:"sourceRoot",type:"string",affectsEmit:!0,affectsBuildInfo:!0,paramType:fa.LOCATION,category:fa.Emit,description:fa.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code},{name:"mapRoot",type:"string",affectsEmit:!0,affectsBuildInfo:!0,paramType:fa.LOCATION,category:fa.Emit,description:fa.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations},{name:"inlineSources",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Emit,description:fa.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,defaultValueDescription:!1},{name:"experimentalDecorators",type:"boolean",affectsEmit:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Language_and_Environment,description:fa.Enable_experimental_support_for_legacy_experimental_decorators,defaultValueDescription:!1},{name:"emitDecoratorMetadata",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,category:fa.Language_and_Environment,description:fa.Emit_design_type_metadata_for_decorated_declarations_in_source_files,defaultValueDescription:!1},{name:"jsxFactory",type:"string",category:fa.Language_and_Environment,description:fa.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h,defaultValueDescription:"`React.createElement`"},{name:"jsxFragmentFactory",type:"string",category:fa.Language_and_Environment,description:fa.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,defaultValueDescription:"React.Fragment"},{name:"jsxImportSource",type:"string",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,affectsModuleResolution:!0,affectsSourceFile:!0,category:fa.Language_and_Environment,description:fa.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,defaultValueDescription:"react"},{name:"resolveJsonModule",type:"boolean",affectsModuleResolution:!0,category:fa.Modules,description:fa.Enable_importing_json_files,defaultValueDescription:!1},{name:"allowArbitraryExtensions",type:"boolean",affectsProgramStructure:!0,category:fa.Modules,description:fa.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,defaultValueDescription:!1},{name:"out",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!1,category:fa.Backwards_Compatibility,paramType:fa.FILE,transpileOptionValue:void 0,description:fa.Deprecated_setting_Use_outFile_instead},{name:"reactNamespace",type:"string",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Language_and_Environment,description:fa.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,defaultValueDescription:"`React`"},{name:"skipDefaultLibCheck",type:"boolean",affectsBuildInfo:!0,category:fa.Completeness,description:fa.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,defaultValueDescription:!1},{name:"charset",type:"string",category:fa.Backwards_Compatibility,description:fa.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,defaultValueDescription:"utf8"},{name:"emitBOM",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Emit,description:fa.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,defaultValueDescription:!1},{name:"newLine",type:new Map(Object.entries({crlf:0,lf:1})),affectsEmit:!0,affectsBuildInfo:!0,paramType:fa.NEWLINE,category:fa.Emit,description:fa.Set_the_newline_character_for_emitting_files,defaultValueDescription:"lf"},{name:"noErrorTruncation",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Output_Formatting,description:fa.Disable_truncating_types_in_error_messages,defaultValueDescription:!1},{name:"noLib",type:"boolean",category:fa.Language_and_Environment,affectsProgramStructure:!0,description:fa.Disable_including_any_library_files_including_the_default_lib_d_ts,transpileOptionValue:!0,defaultValueDescription:!1},{name:"noResolve",type:"boolean",affectsModuleResolution:!0,category:fa.Modules,description:fa.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project,transpileOptionValue:!0,defaultValueDescription:!1},{name:"stripInternal",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Emit,description:fa.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,defaultValueDescription:!1},{name:"disableSizeLimit",type:"boolean",affectsProgramStructure:!0,category:fa.Editor_Support,description:fa.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,defaultValueDescription:!1},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean",isTSConfigOnly:!0,category:fa.Projects,description:fa.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,defaultValueDescription:!1},{name:"disableSolutionSearching",type:"boolean",isTSConfigOnly:!0,category:fa.Projects,description:fa.Opt_a_project_out_of_multi_project_reference_checking_when_editing,defaultValueDescription:!1},{name:"disableReferencedProjectLoad",type:"boolean",isTSConfigOnly:!0,category:fa.Projects,description:fa.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,defaultValueDescription:!1},{name:"noImplicitUseStrict",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Backwards_Compatibility,description:fa.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,defaultValueDescription:!1},{name:"noEmitHelpers",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Emit,description:fa.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,defaultValueDescription:!1},{name:"noEmitOnError",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Emit,transpileOptionValue:void 0,description:fa.Disable_emitting_files_if_any_type_checking_errors_are_reported,defaultValueDescription:!1},{name:"preserveConstEnums",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Emit,description:fa.Disable_erasing_const_enum_declarations_in_generated_code,defaultValueDescription:!1},{name:"declarationDir",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:fa.DIRECTORY,category:fa.Emit,transpileOptionValue:void 0,description:fa.Specify_the_output_directory_for_generated_declaration_files},{name:"skipLibCheck",type:"boolean",affectsBuildInfo:!0,category:fa.Completeness,description:fa.Skip_type_checking_all_d_ts_files,defaultValueDescription:!1},{name:"allowUnusedLabels",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Disable_error_reporting_for_unused_labels,defaultValueDescription:void 0},{name:"allowUnreachableCode",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Type_Checking,description:fa.Disable_error_reporting_for_unreachable_code,defaultValueDescription:void 0},{name:"suppressExcessPropertyErrors",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Backwards_Compatibility,description:fa.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,defaultValueDescription:!1},{name:"suppressImplicitAnyIndexErrors",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Backwards_Compatibility,description:fa.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,defaultValueDescription:!1},{name:"forceConsistentCasingInFileNames",type:"boolean",affectsModuleResolution:!0,category:fa.Interop_Constraints,description:fa.Ensure_that_casing_is_correct_in_imports,defaultValueDescription:!0},{name:"maxNodeModuleJsDepth",type:"number",affectsModuleResolution:!0,category:fa.JavaScript_Support,description:fa.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,defaultValueDescription:0},{name:"noStrictGenericChecks",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:fa.Backwards_Compatibility,description:fa.Disable_strict_checking_of_generic_signatures_in_function_types,defaultValueDescription:!1},{name:"useDefineForClassFields",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,category:fa.Language_and_Environment,description:fa.Emit_ECMAScript_standard_compliant_class_fields,defaultValueDescription:fa.true_for_ES2022_and_above_including_ESNext},{name:"preserveValueImports",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:fa.Backwards_Compatibility,description:fa.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,defaultValueDescription:!1},{name:"keyofStringsOnly",type:"boolean",category:fa.Backwards_Compatibility,description:fa.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,defaultValueDescription:!1},{name:"plugins",type:"list",isTSConfigOnly:!0,element:{name:"plugin",type:"object"},description:fa.Specify_a_list_of_language_service_plugins_to_include,category:fa.Editor_Support},{name:"moduleDetection",type:new Map(Object.entries({auto:2,legacy:1,force:3})),affectsSourceFile:!0,affectsModuleResolution:!0,description:fa.Control_what_method_is_used_to_detect_module_format_JS_files,category:fa.Language_and_Environment,defaultValueDescription:fa.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules},{name:"ignoreDeprecations",type:"string",defaultValueDescription:void 0}],zO=[...MO,...JO],qO=zO.filter(e=>!!e.affectsSemanticDiagnostics),UO=zO.filter(e=>!!e.affectsEmit),VO=zO.filter(e=>!!e.affectsDeclarationPath),WO=zO.filter(e=>!!e.affectsModuleResolution),$O=zO.filter(e=>!!e.affectsSourceFile||!!e.affectsBindDiagnostics),HO=zO.filter(e=>!!e.affectsProgramStructure),KO=zO.filter(e=>Ee(e,"transpileOptionValue")),GO=zO.filter(e=>e.allowConfigDirTemplateSubstitution||!e.isCommandLineOnly&&e.isFilePath),XO=jO.filter(e=>e.allowConfigDirTemplateSubstitution||!e.isCommandLineOnly&&e.isFilePath),QO=zO.filter(function(e){return!tt(e.type)});var YO,ZO={name:"build",type:"boolean",shortName:"b",showInSimplifiedHelpView:!0,category:fa.Command_line_Options,description:fa.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,defaultValueDescription:!1},eL=[ZO,{name:"verbose",shortName:"v",category:fa.Command_line_Options,description:fa.Enable_verbose_logging,type:"boolean",defaultValueDescription:!1},{name:"dry",shortName:"d",category:fa.Command_line_Options,description:fa.Show_what_would_be_built_or_deleted_if_specified_with_clean,type:"boolean",defaultValueDescription:!1},{name:"force",shortName:"f",category:fa.Command_line_Options,description:fa.Build_all_projects_including_those_that_appear_to_be_up_to_date,type:"boolean",defaultValueDescription:!1},{name:"clean",category:fa.Command_line_Options,description:fa.Delete_the_outputs_of_all_projects,type:"boolean",defaultValueDescription:!1},{name:"stopBuildOnErrors",category:fa.Command_line_Options,description:fa.Skip_building_downstream_projects_on_error_in_upstream_project,type:"boolean",defaultValueDescription:!1}],tL=[...MO,...eL],nL=[{name:"enable",type:"boolean",defaultValueDescription:!1},{name:"include",type:"list",element:{name:"include",type:"string"}},{name:"exclude",type:"list",element:{name:"exclude",type:"string"}},{name:"disableFilenameBasedTypeAcquisition",type:"boolean",defaultValueDescription:!1}];function rL(e){const t=new Map,n=new Map;return p(e,e=>{t.set(e.name.toLowerCase(),e),e.shortName&&n.set(e.shortName,e.name)}),{optionsNameMap:t,shortOptionNames:n}}function iL(){return YO||(YO=rL(zO))}var oL={diagnostic:fa.Compiler_option_0_may_only_be_used_with_build,getOptionsNameMap:bL},aL={module:1,target:3,strict:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,skipLibCheck:!0};function sL(e){return cL(e,nk)}function cL(e,t){const n=je(e.type.keys()),r=(e.deprecatedKeys?n.filter(t=>!e.deprecatedKeys.has(t)):n).map(e=>`'${e}'`).join(", ");return t(fa.Argument_for_0_option_must_be_Colon_1,`--${e.name}`,r)}function lL(e,t,n){return Bj(e,(t??"").trim(),n)}function _L(e,t="",n){if(Qt(t=t.trim(),"-"))return;if("listOrElement"===e.type&&!t.includes(","))return Rj(e,t,n);if(""===t)return[];const r=t.split(",");switch(e.element.type){case"number":return J(r,t=>Rj(e.element,parseInt(t),n));case"string":return J(r,t=>Rj(e.element,t||"",n));case"boolean":case"object":return pn.fail(`List of ${e.element.type} is not yet supported.`);default:return J(r,t=>lL(e.element,t,n))}}function uL(e){return e.name}function dL(e,t,n,r,i){var o;const a=null==(o=t.alternateMode)?void 0:o.getOptionsNameMap().optionsNameMap.get(e.toLowerCase());if(a)return jj(i,r,a!==ZO?t.alternateMode.diagnostic:fa.Option_build_must_be_the_first_command_line_argument,e);const s=Mt(e,t.optionDeclarations,uL);return s?jj(i,r,t.unknownDidYouMeanDiagnostic,n||e,s.name):jj(i,r,t.unknownOptionDiagnostic,n||e)}function pL(e,t,n){const r={};let i;const o=[],a=[];return s(t),{options:r,watchOptions:i,fileNames:o,errors:a};function s(t){let n=0;for(;nuo.readFile(e)));if(!tt(t))return void a.push(t);const r=[];let i=0;for(;;){for(;i=t.length)break;const n=i;if(34===t.charCodeAt(n)){for(i++;i32;)i++;r.push(t.substring(n,i))}}s(r)}}function fL(e,t,n,r,i,o){if(r.isTSConfigOnly){const n=e[t];"null"===n?(i[r.name]=void 0,t++):"boolean"===r.type?"false"===n?(i[r.name]=Rj(r,!1,o),t++):("true"===n&&t++,o.push(nk(fa.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,r.name))):(o.push(nk(fa.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,r.name)),n&&!Qt(n,"-")&&t++)}else if(e[t]||"boolean"===r.type||o.push(nk(n.optionTypeMismatchDiagnostic,r.name,KL(r))),"null"!==e[t])switch(r.type){case"number":i[r.name]=Rj(r,parseInt(e[t]),o),t++;break;case"boolean":const n=e[t];i[r.name]=Rj(r,"false"!==n,o),"false"!==n&&"true"!==n||t++;break;case"string":i[r.name]=Rj(r,e[t]||"",o),t++;break;case"list":const a=_L(r,e[t],o);i[r.name]=a||[],a&&t++;break;case"listOrElement":pn.fail("listOrElement not supported here");break;default:i[r.name]=lL(r,e[t],o),t++}else i[r.name]=void 0,t++;return t}var mL,gL={alternateMode:oL,getOptionsNameMap:iL,optionDeclarations:zO,unknownOptionDiagnostic:fa.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:fa.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:fa.Compiler_option_0_expects_an_argument};function hL(e,t){return pL(gL,e,t)}function yL(e,t){return vL(iL,e,t)}function vL(e,t,n=!1){t=t.toLowerCase();const{optionsNameMap:r,shortOptionNames:i}=e();if(n){const e=i.get(t);void 0!==e&&(t=e)}return r.get(t)}function bL(){return mL||(mL=rL(tL))}var xL={alternateMode:{diagnostic:fa.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:iL},getOptionsNameMap:bL,optionDeclarations:tL,unknownOptionDiagnostic:fa.Unknown_build_option_0,unknownDidYouMeanDiagnostic:fa.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:fa.Build_option_0_requires_a_value_of_type_1};function kL(e){const{options:t,watchOptions:n,fileNames:r,errors:i}=pL(xL,e),o=t;return 0===r.length&&r.push("."),o.clean&&o.force&&i.push(nk(fa.Options_0_and_1_cannot_be_combined,"clean","force")),o.clean&&o.verbose&&i.push(nk(fa.Options_0_and_1_cannot_be_combined,"clean","verbose")),o.clean&&o.watch&&i.push(nk(fa.Options_0_and_1_cannot_be_combined,"clean","watch")),o.watch&&o.dry&&i.push(nk(fa.Options_0_and_1_cannot_be_combined,"watch","dry")),{buildOptions:o,watchOptions:n,projects:r,errors:i}}function SL(e,...t){return it(nk(e,...t).messageText,tt)}function TL(e,t,n,r,i,o){const a=DL(e,e=>n.readFile(e));if(!tt(a))return void n.onUnRecoverableConfigFileDiagnostic(a);const s=_O(e,a),c=n.getCurrentDirectory();return s.path=Ho(e,c,Ht(n.useCaseSensitiveFileNames)),s.resolvedPath=s.path,s.originalFileName=s.fileName,cj(s,n,Uo(Ao(e),c),t,Uo(e,c),void 0,o,r,i)}function CL(e,t){const n=DL(e,t);return tt(n)?wL(e,n):{config:{},error:n}}function wL(e,t){const n=_O(e,t);return{config:WL(n,n.parseDiagnostics,void 0),error:n.parseDiagnostics.length?n.parseDiagnostics[0]:void 0}}function NL(e,t){const n=DL(e,t);return tt(n)?_O(e,n):{fileName:e,parseDiagnostics:[n]}}function DL(e,t){let n;try{n=t(e)}catch(t){return nk(fa.Cannot_read_file_0_Colon_1,e,t.message)}return void 0===n?nk(fa.Cannot_read_file_0,e):n}function FL(e){return Be(e,uL)}var EL,PL={optionDeclarations:nL,unknownOptionDiagnostic:fa.Unknown_type_acquisition_option_0,unknownDidYouMeanDiagnostic:fa.Unknown_type_acquisition_option_0_Did_you_mean_1};function AL(){return EL||(EL=rL(jO))}var IL,OL,LL,jL={getOptionsNameMap:AL,optionDeclarations:jO,unknownOptionDiagnostic:fa.Unknown_watch_option_0,unknownDidYouMeanDiagnostic:fa.Unknown_watch_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:fa.Watch_option_0_requires_a_value_of_type_1};function ML(){return IL||(IL=FL(zO))}function RL(){return OL||(OL=FL(jO))}function BL(){return LL||(LL=FL(nL))}var JL,zL={name:"extends",type:"listOrElement",element:{name:"extends",type:"string"},category:fa.File_Management,disallowNullOrUndefined:!0},qL={name:"compilerOptions",type:"object",elementOptions:ML(),extraKeyDiagnostics:gL},UL={name:"watchOptions",type:"object",elementOptions:RL(),extraKeyDiagnostics:jL},VL={name:"typeAcquisition",type:"object",elementOptions:BL(),extraKeyDiagnostics:PL};function WL(e,t,n){var r;const i=null==(r=e.statements[0])?void 0:r.expression;if(i&&211!==i.kind){if(t.push(Vp(e,i,fa.The_root_value_of_a_0_file_must_be_an_object,"jsconfig.json"===Io(e.fileName)?"jsconfig.json":"tsconfig.json")),mF(i)){const r=x(i.elements,gF);if(r)return HL(e,r,t,!0,n)}return{}}return HL(e,i,t,!0,n)}function $L(e,t){var n;return HL(e,null==(n=e.statements[0])?void 0:n.expression,t,!0,void 0)}function HL(e,t,n,r,i){return t?o(t,null==i?void 0:i.rootOptions):r?{}:void 0;function o(t,s){switch(t.kind){case 112:return!0;case 97:return!1;case 106:return null;case 11:return a(t)||n.push(Vp(e,t,fa.String_literal_with_double_quotes_expected)),t.text;case 9:return Number(t.text);case 225:if(41!==t.operator||9!==t.operand.kind)break;return-Number(t.operand.text);case 211:return function(t,s){var c;const l=r?{}:void 0;for(const _ of t.properties){if(304!==_.kind){n.push(Vp(e,_,fa.Property_assignment_expected));continue}_.questionToken&&n.push(Vp(e,_.questionToken,fa.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),a(_.name)||n.push(Vp(e,_.name,fa.String_literal_with_double_quotes_expected));const t=Rp(_.name)?void 0:Jp(_.name),u=t&&vc(t),d=u?null==(c=null==s?void 0:s.elementOptions)?void 0:c.get(u):void 0,p=o(_.initializer,d);void 0!==u&&(r&&(l[u]=p),null==i||i.onPropertySet(u,p,_,s,d))}return l}(t,s);case 210:return function(e,t){if(r)return D(e.map(e=>o(e,t)),e=>void 0!==e);e.forEach(e=>o(e,t))}(t.elements,s&&s.element)}s?n.push(Vp(e,t,fa.Compiler_option_0_requires_a_value_of_type_1,s.name,KL(s))):n.push(Vp(e,t,fa.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal))}function a(t){return KN(t)&&$m(t,e)}}function KL(e){return"listOrElement"===e.type?`${KL(e.element)} or Array`:"list"===e.type?"Array":tt(e.type)?e.type:"string"}function GL(e,t){if(e){if(_j(t))return!e.disallowNullOrUndefined;if("list"===e.type)return Ze(t);if("listOrElement"===e.type)return Ze(t)||GL(e.element,t);return typeof t===(tt(e.type)?e.type:"string")}return!1}function XL(e,t,n){var r,i,o;const a=Ht(n.useCaseSensitiveFileNames),s=P(D(e.fileNames,(null==(i=null==(r=e.options.configFile)?void 0:r.configFileSpecs)?void 0:i.validatedIncludeSpecs)?function(e,t,n,r){if(!t)return st;const i=bS(e,n,t,r.useCaseSensitiveFileNames,r.getCurrentDirectory()),o=i.excludePattern&&xS(i.excludePattern,r.useCaseSensitiveFileNames),a=i.includeFilePattern&&xS(i.includeFilePattern,r.useCaseSensitiveFileNames);if(a)return o?e=>!(a.test(e)&&!o.test(e)):e=>!a.test(e);if(o)return e=>o.test(e);return st}(t,e.options.configFile.configFileSpecs.validatedIncludeSpecs,e.options.configFile.configFileSpecs.validatedExcludeSpecs,n):st),e=>la(Uo(t,n.getCurrentDirectory()),Uo(e,n.getCurrentDirectory()),a)),c={configFilePath:Uo(t,n.getCurrentDirectory()),useCaseSensitiveFileNames:n.useCaseSensitiveFileNames},l=nj(e.options,c),_=e.watchOptions&&rj(e.watchOptions,AL());const u={compilerOptions:{...YL(l),showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0},watchOptions:_&&YL(_),references:P(e.projectReferences,e=>({...e,path:e.originalPath?e.originalPath:"",originalPath:void 0})),files:d(s)?s:void 0,...(null==(o=e.options.configFile)?void 0:o.configFileSpecs)?{include:ZL(e.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:e.options.configFile.configFileSpecs.validatedExcludeSpecs}:{},compileOnSave:!!e.compileOnSave||void 0},p=new Set(l.keys()),f={};for(const t in xk)if(!p.has(t)&&QL(t,p)){xk[t].computeValue(e.options)!==xk[t].computeValue({})&&(f[t]=xk[t].computeValue(e.options))}return Me(u.compilerOptions,YL(nj(f,c))),u}function QL(e,t){const n=new Set;return function e(r){var i;if(Cx(n,r))return H(null==(i=xk[r])?void 0:i.dependencies,n=>t.has(n)||e(n));return!1}(e)}function YL(e){return Object.fromEntries(e)}function ZL(e){if(d(e)){if(1!==d(e))return e;if(e[0]!==dj)return e}}function ej(e){switch(e.type){case"string":case"number":case"boolean":case"object":return;case"list":case"listOrElement":return ej(e.element);default:return e.type}}function tj(e,t){return sd(t,(t,n)=>{if(t===e)return n})}function nj(e,t){return rj(e,iL(),t)}function rj(e,{optionsNameMap:t},n){const r=new Map,i=n&&Ht(n.useCaseSensitiveFileNames);for(const o in e)if(Ee(e,o)){if(t.has(o)&&(t.get(o).category===fa.Command_line_Options||t.get(o).category===fa.Output_Formatting))continue;const a=e[o],s=t.get(o.toLowerCase());if(s){pn.assert("listOrElement"!==s.type);const e=ej(s);e?"list"===s.type?r.set(o,a.map(t=>tj(t,e))):r.set(o,tj(a,e)):n&&s.isFilePath?r.set(o,la(n.configFilePath,Uo(a,Ao(n.configFilePath)),i)):n&&"list"===s.type&&s.element.isFilePath?r.set(o,a.map(e=>la(n.configFilePath,Uo(e,Ao(n.configFilePath)),i))):r.set(o,a)}}return r}function ij(e,t){const n=" ",r=[],i=Object.keys(e).filter(e=>"init"!==e&&"help"!==e&&"watch"!==e);if(r.push("{"),r.push(`${n}// ${Gx(fa.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)}`),r.push(`${n}"compilerOptions": {`),a(fa.File_Layout),s("rootDir","./src","optional"),s("outDir","./dist","optional"),o(),a(fa.Environment_Settings),a(fa.See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule),s("module",199),s("target",99),s("types",[]),e.lib&&s("lib",e.lib),a(fa.For_nodejs_Colon),r.push(`${n}${n}// "lib": ["esnext"],`),r.push(`${n}${n}// "types": ["node"],`),a(fa.and_npm_install_D_types_Slashnode),o(),a(fa.Other_Outputs),s("sourceMap",!0),s("declaration",!0),s("declarationMap",!0),o(),a(fa.Stricter_Typechecking_Options),s("noUncheckedIndexedAccess",!0),s("exactOptionalPropertyTypes",!0),o(),a(fa.Style_Options),s("noImplicitReturns",!0,"optional"),s("noImplicitOverride",!0,"optional"),s("noUnusedLocals",!0,"optional"),s("noUnusedParameters",!0,"optional"),s("noFallthroughCasesInSwitch",!0,"optional"),s("noPropertyAccessFromIndexSignature",!0,"optional"),o(),a(fa.Recommended_Options),s("strict",!0),s("jsx",4),s("verbatimModuleSyntax",!0),s("isolatedModules",!0),s("noUncheckedSideEffectImports",!0),s("moduleDetection",3),s("skipLibCheck",!0),i.length>0)for(o();i.length>0;)s(i[0],e[i[0]]);function o(){r.push("")}function a(e){r.push(`${n}${n}// ${Gx(e)}`)}function s(t,o,a="never"){const s=i.indexOf(t);let l;s>=0&&i.splice(s,1),l="always"===a||"never"!==a&&!Ee(e,t);const _=e[t]??o;l?r.push(`${n}${n}// "${t}": ${c(t,_)},`):r.push(`${n}${n}"${t}": ${c(t,_)},`)}function c(e,t){const n=zO.filter(t=>t.name===e)[0];n||pn.fail(`No option named ${e}?`);const r=n.type instanceof Map?n.type:void 0;if(Ze(t)){const e="element"in n&&n.element.type instanceof Map?n.element.type:void 0;return`[${t.map(t=>l(t,e)).join(", ")}]`}return l(t,r)}function l(e,t){return t&&(e=tj(e,t)??pn.fail(`No matching value of ${e}`)),JSON.stringify(e)}return r.push(`${n}}`),r.push("}"),r.push(""),r.join(t)}function oj(e,t){const n={},r=iL().optionsNameMap;for(const i in e)Ee(e,i)&&(n[i]=aj(r.get(i.toLowerCase()),e[i],t));return n.configFilePath&&(n.configFilePath=t(n.configFilePath)),n}function aj(e,t,n){if(e&&!_j(t)){if("list"===e.type){const r=t;if(e.element.isFilePath&&r.length)return r.map(n)}else if(e.isFilePath)return n(t);pn.assert("listOrElement"!==e.type)}return t}function sj(e,t,n,r,i,o,a,s,c){return pj(e,void 0,t,n,r,c,i,o,a,s)}function cj(e,t,n,r,i,o,a,s,c){var l,_;null==(l=Gn)||l.push(Gn.Phase.Parse,"parseJsonSourceFileConfigFileContent",{path:e.fileName});const u=pj(void 0,e,t,n,r,c,i,o,a,s);return null==(_=Gn)||_.pop(),u}function lj(e,t){t&&Object.defineProperty(e,"configFile",{enumerable:!1,writable:!1,value:t})}function _j(e){return null==e}function uj(e,t){return Ao(Uo(e,t))}var dj="**/*";function pj(e,t,n,r,i={},o,a,s=[],c=[],l){pn.assert(void 0===e&&void 0!==t||void 0!==e&&void 0===t);const _=[],u=wj(e,t,n,r,a,s,_,l),{raw:d}=u,p=mj(We(i,u.options||{}),GO,r),f=fj(o&&u.watchOptions?We(o,u.watchOptions):u.watchOptions||o,r);p.configFilePath=a&&Ro(a);const m=Vo(a?uj(a,r):r),g=function(){const e=v("references",e=>"object"==typeof e,"object"),n=h(y("files"));if(n){const r="no-prop"===e||Ze(e)&&0===e.length,i=Ee(d,"extends");if(0===n.length&&r&&!i)if(t){const e=a||"tsconfig.json",n=fa.The_files_list_in_config_file_0_is_empty,r=Qf(t,"files",e=>e.initializer),i=jj(t,r,n,e);_.push(i)}else x(fa.The_files_list_in_config_file_0_is_empty,a||"tsconfig.json")}let r=h(y("include"));const i=y("exclude");let o,s,c,l,u=!1,f=h(i);if("no-prop"===i){const e=p.outDir,t=p.declarationDir;(e||t)&&(f=D([e,t],e=>!!e))}void 0===n&&void 0===r&&(r=[dj],u=!0);r&&(o=Gj(r,_,!0,t,"include"),c=vj(o,m)||o);f&&(s=Gj(f,_,!1,t,"exclude"),l=vj(s,m)||s);const g=D(n,tt),b=vj(g,m)||g;return{filesSpecs:n,includeSpecs:r,excludeSpecs:f,validatedFilesSpec:b,validatedIncludeSpecs:c,validatedExcludeSpecs:l,validatedFilesSpecBeforeSubstitution:g,validatedIncludeSpecsBeforeSubstitution:o,validatedExcludeSpecsBeforeSubstitution:s,isDefaultIncludeSpec:u}}();return t&&(t.configFileSpecs=g),lj(p,t),{options:p,watchOptions:f,fileNames:function(e){const t=Vj(g,e,p,n,c);kj(t,Tj(d),s)&&_.push(xj(g,a));return t}(m),projectReferences:function(e){let t;const n=v("references",e=>"object"==typeof e,"object");if(Ze(n))for(const r of n)"string"!=typeof r.path?x(fa.Compiler_option_0_requires_a_value_of_type_1,"reference.path","string"):(t||(t=[])).push({path:Uo(r.path,e),originalPath:r.path,prepend:r.prepend,circular:r.circular});return t}(m),typeAcquisition:u.typeAcquisition||Ij(),raw:d,errors:_,wildcardDirectories:Qj(g,m,n.useCaseSensitiveFileNames),compileOnSave:!!d.compileOnSave};function h(e){return Ze(e)?e:void 0}function y(e){return v(e,tt,"string")}function v(e,n,r){if(Ee(d,e)&&!_j(d[e])){if(Ze(d[e])){const i=d[e];return t||b(i,n)||_.push(nk(fa.Compiler_option_0_requires_a_value_of_type_1,e,r)),i}return x(fa.Compiler_option_0_requires_a_value_of_type_1,e,"Array"),"not-array"}return"no-prop"}function x(e,...n){t||_.push(nk(e,...n))}}function fj(e,t){return mj(e,XO,t)}function mj(e,t,n){if(!e)return e;let r;for(const r of t)if(void 0!==e[r.name]){const t=e[r.name];switch(r.type){case"string":pn.assert(r.isFilePath),hj(t)&&i(r,yj(t,n));break;case"list":pn.assert(r.element.isFilePath);const e=vj(t,n);e&&i(r,e);break;case"object":pn.assert("paths"===r.name);const o=bj(t,n);o&&i(r,o);break;default:pn.fail("option type not supported")}}return r||e;function i(t,n){(r??(r=Me({},e)))[t.name]=n}}var gj="${configDir}";function hj(e){return tt(e)&&Qt(e,gj,!0)}function yj(e,t){return Uo(e.replace(gj,"./"),t)}function vj(e,t){if(!e)return e;let n;return e.forEach((r,i)=>{hj(r)&&((n??(n=e.slice()))[i]=yj(r,t))}),n}function bj(e,t){let n;return Ae(e).forEach(r=>{if(!Ze(e[r]))return;const i=vj(e[r],t);i&&((n??(n=Me({},e)))[r]=i)}),n}function xj({includeSpecs:e,excludeSpecs:t},n){return nk(fa.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,n||"tsconfig.json",JSON.stringify(e||[]),JSON.stringify(t||[]))}function kj(e,t,n){return 0===e.length&&t&&(!n||0===n.length)}function Sj(e){return!e.fileNames.length&&Ee(e.raw,"references")}function Tj(e){return!Ee(e,"files")&&!Ee(e,"references")}function Cj(e,t,n,r,i){const o=r.length;return kj(e,i)?r.push(xj(n,t)):F(r,e=>!function(e){return e.code===fa.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code}(e)),o!==r.length}function wj(e,t,n,r,i,o,a,s){var c;const l=Uo(i||"",r=Ro(r));if(o.includes(l))return a.push(nk(fa.Circularity_detected_while_resolving_configuration_Colon_0,[...o,l].join(" -> "))),{raw:e||$L(t,a)};const _=e?function(e,t,n,r,i){Ee(e,"excludes")&&i.push(nk(fa.Unknown_option_excludes_Did_you_mean_exclude));const o=Aj(e.compilerOptions,n,i,r),a=Oj(e.typeAcquisition,n,i,r),s=function(e,t,n){return Lj(RL(),e,t,void 0,jL,n)}(e.watchOptions,n,i);e.compileOnSave=function(e,t,n){if(!Ee(e,EO.name))return!1;const r=Mj(EO,e.compileOnSave,t,n);return"boolean"==typeof r&&r}(e,n,i);const c=e.extends||""===e.extends?Nj(e.extends,t,n,r,i):void 0;return{raw:e,options:o,watchOptions:s,typeAcquisition:a,extendedConfigPath:c}}(e,n,r,i,a):function(e,t,n,r,i){const o=Pj(r);let a,s,c,l;const _=(void 0===JL&&(JL={name:void 0,type:"object",elementOptions:FL([qL,UL,VL,zL,{name:"references",type:"list",element:{name:"references",type:"object"},category:fa.Projects},{name:"files",type:"list",element:{name:"files",type:"string"},category:fa.File_Management},{name:"include",type:"list",element:{name:"include",type:"string"},category:fa.File_Management,defaultValueDescription:fa.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk},{name:"exclude",type:"list",element:{name:"exclude",type:"string"},category:fa.File_Management,defaultValueDescription:fa.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified},EO])}),JL),u=WL(e,i,{rootOptions:_,onPropertySet:d});a||(a=Ij(r));l&&u&&void 0===u.compilerOptions&&i.push(Vp(e,l[0],fa._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file,Jp(l[0])));return{raw:u,options:o,watchOptions:s,typeAcquisition:a,extendedConfigPath:c};function d(u,d,p,f,m){if(m&&m!==zL&&(d=Mj(m,d,n,i,p,p.initializer,e)),null==f?void 0:f.name)if(m){let e;f===qL?e=o:f===UL?e=s??(s={}):f===VL?e=a??(a=Ij(r)):pn.fail("Unknown option"),e[m.name]=d}else u&&(null==f?void 0:f.extraKeyDiagnostics)&&(f.elementOptions?i.push(dL(u,f.extraKeyDiagnostics,void 0,p.name,e)):i.push(Vp(e,p.name,f.extraKeyDiagnostics.unknownOptionDiagnostic,u)));else f===_&&(m===zL?c=Nj(d,t,n,r,i,p,p.initializer,e):m||("excludes"===u&&i.push(Vp(e,p.name,fa.Unknown_option_excludes_Did_you_mean_exclude)),x(JO,e=>e.name===u)&&(l=ae(l,p.name))))}}(t,n,r,i,a);if((null==(c=_.options)?void 0:c.paths)&&(_.options.pathsBasePath=r),_.extendedConfigPath){o=o.concat([l]);const e={options:{}};tt(_.extendedConfigPath)?u(e,_.extendedConfigPath):_.extendedConfigPath.forEach(t=>u(e,t)),e.include&&(_.raw.include=e.include),e.exclude&&(_.raw.exclude=e.exclude),e.files&&(_.raw.files=e.files),void 0===_.raw.compileOnSave&&e.compileOnSave&&(_.raw.compileOnSave=e.compileOnSave),t&&e.extendedSourceFiles&&(t.extendedSourceFiles=je(e.extendedSourceFiles.keys())),_.options=Me(e.options,_.options),_.watchOptions=_.watchOptions&&e.watchOptions?d(e,_.watchOptions):_.watchOptions||e.watchOptions}return _;function u(e,i){const c=function(e,t,n,r,i,o,a){const s=n.useCaseSensitiveFileNames?t:dt(t);let c,l,_;o&&(c=o.get(s))?({extendedResult:l,extendedConfig:_}=c):(l=NL(t,e=>n.readFile(e)),l.parseDiagnostics.length||(_=wj(void 0,l,n,Ao(t),Io(t),r,i,o)),o&&o.set(s,{extendedResult:l,extendedConfig:_}));if(e&&((a.extendedSourceFiles??(a.extendedSourceFiles=new Set)).add(l.fileName),l.extendedSourceFiles))for(const e of l.extendedSourceFiles)a.extendedSourceFiles.add(e);if(l.parseDiagnostics.length)return void i.push(...l.parseDiagnostics);return _}(t,i,n,o,a,s,e);if(c&&c.options){const t=c.raw;let o;const a=a=>{_.raw[a]||t[a]&&(e[a]=P(t[a],e=>hj(e)||bo(e)?e:Jo(o||(o=ca(Ao(i),r,Ht(n.useCaseSensitiveFileNames))),e)))};a("include"),a("exclude"),a("files"),void 0!==t.compileOnSave&&(e.compileOnSave=t.compileOnSave),Me(e.options,c.options),e.watchOptions=e.watchOptions&&c.watchOptions?d(e,c.watchOptions):e.watchOptions||c.watchOptions}}function d(e,t){return e.watchOptionsCopied?Me(e.watchOptions,t):(e.watchOptionsCopied=!0,Me({},e.watchOptions,t))}}function Nj(e,t,n,r,i,o,a,s){let c;const l=r?uj(r,n):n;if(tt(e))c=Dj(e,t,l,i,a,s);else if(Ze(e)){c=[];for(let r=0;rjj(i,r,e,...t)))}function Jj(e,t,n,r,i,o,a){return D(P(t,(t,s)=>Mj(e.element,t,n,r,i,null==o?void 0:o.elements[s],a)),t=>!!e.listPreserveFalsyValues||!!t)}var zj,qj=/(?:^|\/)\*\*\/?$/,Uj=/^[^*?]*(?=\/[^/]*[*?])/;function Vj(e,t,n,r,i=_){t=Vo(t);const o=Ht(r.useCaseSensitiveFileNames),a=new Map,s=new Map,c=new Map,{validatedFilesSpec:l,validatedIncludeSpecs:u,validatedExcludeSpecs:d}=e,p=MS(n,i),f=RS(n,p);if(l)for(const e of l){const n=Uo(e,t);a.set(o(n),n)}let m;if(u&&u.length>0)for(const e of r.readDirectory(t,O(f),d,u,void 0)){if(wo(e,".json")){if(!m){const e=P(mS(u.filter(e=>Bt(e,".json")),t,"files"),e=>`^${e}$`);m=e?e.map(e=>xS(e,r.useCaseSensitiveFileNames)):_}if(-1!==S(m,t=>t.test(e))){const t=o(e);a.has(t)||c.has(t)||c.set(t,e)}continue}if(eM(e,a,s,p,o))continue;tM(e,s,p,o);const n=o(e);a.has(n)||s.has(n)||s.set(n,e)}const g=je(a.values()),h=je(s.values());return g.concat(h,je(c.values()))}function Wj(e,t,n,r,i){const{validatedFilesSpec:o,validatedIncludeSpecs:a,validatedExcludeSpecs:s}=t;if(!d(a)||!d(s))return!1;n=Vo(n);const c=Ht(r);if(o)for(const t of o)if(c(Uo(t,n))===e)return!1;return Kj(e,s,r,i,n)}function $j(e){const t=Qt(e,"**/")?0:e.indexOf("/**/");if(-1===t)return!1;return(Bt(e,"/..")?e.length:e.lastIndexOf("/../"))>t}function Hj(e,t,n,r){return Kj(e,D(t,e=>!$j(e)),n,r)}function Kj(e,t,n,r,i){const o=fS(t,Jo(Vo(r),i),"exclude"),a=o&&xS(o,n);return!!a&&(!!a.test(e)||!Co(e)&&a.test(Go(e)))}function Gj(e,t,n,r,i){return e.filter(e=>{if(!tt(e))return!1;const o=Xj(e,n);return void 0!==o&&t.push(function(e,t){const n=Xf(r,i,t);return jj(r,n,e,t)}(...o)),void 0===o})}function Xj(e,t){return pn.assert("string"==typeof e),t&&qj.test(e)?[fa.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,e]:$j(e)?[fa.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,e]:void 0}function Qj({validatedIncludeSpecs:e,validatedExcludeSpecs:t},n,r){const i=fS(t,n,"exclude"),o=i&&new RegExp(i,r?"":"i"),a={},s=new Map;if(void 0!==e){const t=[];for(const i of e){const e=Vo(Jo(n,i));if(o&&o.test(e))continue;const c=Zj(e,r);if(c){const{key:e,path:n,flags:r}=c,i=s.get(e),o=void 0!==i?a[i]:void 0;(void 0===o||oNo(e,t)?t:void 0);if(!o)return!1;for(const r of o){if(wo(e,r)&&(".ts"!==r||!wo(e,".d.ts")))return!1;const o=i(QS(e,r));if(t.has(o)||n.has(o)){if(".d.ts"===r&&(wo(e,".js")||wo(e,".jsx")))continue;return!0}}return!1}function tM(e,t,n,r){const i=p(n,t=>No(e,t)?t:void 0);if(i)for(let n=i.length-1;n>=0;n--){const o=i[n];if(wo(e,o))return;const a=r(QS(e,o));t.delete(a)}}function nM(e){const t={};for(const n in e)if(Ee(e,n)){const r=yL(n);void 0!==r&&(t[n]=rM(e[n],r))}return t}function rM(e,t){if(void 0===e)return e;switch(t.type){case"object":case"string":return"";case"number":return"number"==typeof e?e:"";case"boolean":return"boolean"==typeof e?e:"";case"listOrElement":if(!Ze(e))return rM(e,t.element);case"list":const n=t.element;return Ze(e)?J(e,e=>rM(e,n)):"";default:return sd(t.type,(t,n)=>{if(t===e)return n})}}function iM(e,t,...n){e.trace(tk(t,...n))}function oM(e,t){return!!e.traceResolution&&void 0!==t.trace}function aM(e,t,n){let r;if(t&&e){const i=e.contents.packageJsonContent;"string"==typeof i.name&&"string"==typeof i.version&&(r={name:i.name,subModuleName:t.path.slice(e.packageDirectory.length+fo.length),version:i.version,peerDependencies:kR(e,n)})}return t&&{path:t.path,extension:t.ext,packageId:r,resolvedUsingTsExtension:t.resolvedUsingTsExtension}}function sM(e){return aM(void 0,e,void 0)}function cM(e){if(e)return pn.assert(void 0===e.packageId),{path:e.path,ext:e.extension,resolvedUsingTsExtension:e.resolvedUsingTsExtension}}function lM(e){const t=[];return 1&e&&t.push("TypeScript"),2&e&&t.push("JavaScript"),4&e&&t.push("Declaration"),8&e&&t.push("JSON"),t.join(", ")}function _M(e){if(e)return pn.assert(nT(e.extension)),{fileName:e.path,packageId:e.packageId}}function uM(e,t,n,r,i,o,a,s,c){if(!a.resultFromCache&&!a.compilerOptions.preserveSymlinks&&t&&n&&!t.originalPath&&!Fs(e)){const{resolvedFileName:e,originalPath:n}=SM(t.path,a.host,a.traceEnabled);n&&(t={...t,path:e,originalPath:n})}return dM(t,n,r,i,o,a.resultFromCache,s,c)}function dM(e,t,n,r,i,o,a,s){return o?(null==a?void 0:a.isReadonly)?{...o,failedLookupLocations:mM(o.failedLookupLocations,n),affectingLocations:mM(o.affectingLocations,r),resolutionDiagnostics:mM(o.resolutionDiagnostics,i)}:(o.failedLookupLocations=fM(o.failedLookupLocations,n),o.affectingLocations=fM(o.affectingLocations,r),o.resolutionDiagnostics=fM(o.resolutionDiagnostics,i),o):{resolvedModule:e&&{resolvedFileName:e.path,originalPath:!0===e.originalPath?void 0:e.originalPath,extension:e.extension,isExternalLibraryImport:t,packageId:e.packageId,resolvedUsingTsExtension:!!e.resolvedUsingTsExtension},failedLookupLocations:pM(n),affectingLocations:pM(r),resolutionDiagnostics:pM(i),alternateResult:s}}function pM(e){return e.length?e:void 0}function fM(e,t){return(null==t?void 0:t.length)?(null==e?void 0:e.length)?(e.push(...t),e):t:e}function mM(e,t){return(null==e?void 0:e.length)?t.length?[...e,...t]:e.slice():pM(t)}function gM(e,t,n,r){if(!Ee(e,t))return void(r.traceEnabled&&iM(r.host,fa.package_json_does_not_have_a_0_field,t));const i=e[t];if(typeof i===n&&null!==i)return i;r.traceEnabled&&iM(r.host,fa.Expected_type_of_0_field_in_package_json_to_be_1_got_2,t,n,null===i?"null":typeof i)}function hM(e,t,n,r){const i=gM(e,t,"string",r);if(void 0===i)return;if(!i)return void(r.traceEnabled&&iM(r.host,fa.package_json_had_a_falsy_0_field,t));const o=Vo(Jo(n,i));return r.traceEnabled&&iM(r.host,fa.package_json_has_0_field_1_that_references_2,t,i,o),o}function yM(e,t){const n=function(e,t){const n=gM(e,"typesVersions","object",t);if(void 0!==n)return t.traceEnabled&&iM(t.host,fa.package_json_has_a_typesVersions_field_with_version_specific_path_mappings),n}(e,t);if(void 0===n)return;if(t.traceEnabled)for(const e in n)Ee(n,e)&&!Tn.tryParse(e)&&iM(t.host,fa.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range,e);const r=vM(n);if(!r)return void(t.traceEnabled&&iM(t.host,fa.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0,s));const{version:i,paths:o}=r;if("object"==typeof o)return r;t.traceEnabled&&iM(t.host,fa.Expected_type_of_0_field_in_package_json_to_be_1_got_2,`typesVersions['${i}']`,"object",typeof o)}function vM(e){zj||(zj=new kn(c));for(const t in e){if(!Ee(e,t))continue;const n=Tn.tryParse(t);if(void 0!==n&&n.test(zj))return{version:t,paths:e[t]}}}function bM(e,t){if(e.typeRoots)return e.typeRoots;let n;return e.configFilePath?n=Ao(e.configFilePath):t.getCurrentDirectory&&(n=t.getCurrentDirectory()),void 0!==n?function(e){let t;return ua(Vo(e),e=>{const n=Jo(e,xM);(t??(t=[])).push(n)}),t}(n):void 0}var xM=Jo("node_modules","@types");function kM(e,t,n){return 0===ra(e,t,!("function"==typeof n.useCaseSensitiveFileNames?n.useCaseSensitiveFileNames():n.useCaseSensitiveFileNames))}function SM(e,t,n){const r=rR(e,t,n),i=kM(e,r,t);return{resolvedFileName:i?e:r,originalPath:i?void 0:e}}function TM(e,t,n){return Jo(e,Bt(e,"/node_modules/@types")||Bt(e,"/node_modules/@types/")?JR(t,n):t)}function CM(e,t,n,r,i,o,a){pn.assert("string"==typeof e,"Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");const s=oM(n,r);i&&(n=i.commandLine.options);const c=t?Ao(t):void 0;let l=c?null==o?void 0:o.getFromDirectoryCache(e,a,c,i):void 0;if(l||!c||Fs(e)||(l=null==o?void 0:o.getFromNonRelativeNameCache(e,a,c,i)),l)return s&&(iM(r,fa.Resolving_type_reference_directive_0_containing_file_1,e,t),i&&iM(r,fa.Using_compiler_options_of_project_reference_redirect_0,i.sourceFile.fileName),iM(r,fa.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1,e,c),k(l)),l;const _=bM(n,r);s&&(void 0===t?void 0===_?iM(r,fa.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set,e):iM(r,fa.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1,e,_):void 0===_?iM(r,fa.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set,e,t):iM(r,fa.Resolving_type_reference_directive_0_containing_file_1_root_directory_2,e,t,_),i&&iM(r,fa.Using_compiler_options_of_project_reference_redirect_0,i.sourceFile.fileName));const u=[],d=[];let p=wM(n);void 0!==a&&(p|=30);const f=Ck(n);99===a&&3<=f&&f<=99&&(p|=32);const g=8&p?NM(n,a):[],h=[],y={compilerOptions:n,host:r,traceEnabled:s,failedLookupLocations:u,affectingLocations:d,packageJsonInfoCache:o,features:p,conditions:g,requestContainingDirectory:c,reportDiagnostic:e=>{h.push(e)},isConfigLookup:!1,candidateIsFromPackageJsonField:!1,resolvedPackageDirectory:!1};let v,b=function(){if(_&&_.length)return s&&iM(r,fa.Resolving_with_primary_search_path_0,_.join(", ")),m(_,t=>{const i=TM(t,e,y),o=Ib(t,r);if(!o&&s&&iM(r,fa.Directory_0_does_not_exist_skipping_all_lookups_in_it,t),n.typeRoots){const e=_R(4,i,!o,y);if(e){const t=sR(e.path);return _M(aM(t?SR(t,!1,y):void 0,e,y))}}return _M(gR(4,i,!o,y))});s&&iM(r,fa.Root_directory_cannot_be_determined_skipping_primary_search_paths)}(),x=!0;if(b||(b=function(){const i=t&&Ao(t);if(void 0!==i){let o;if(n.typeRoots&&Bt(t,LV))s&&iM(r,fa.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder);else if(s&&iM(r,fa.Looking_up_in_node_modules_folder_initial_location_0,i),Fs(e)){const{path:t}=nR(i,e);o=iR(4,t,!1,y,!0)}else{const t=IR(4,e,i,y,void 0,void 0);o=t&&t.value}return _M(o)}s&&iM(r,fa.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder)}(),x=!1),b){const{fileName:e,packageId:t}=b;let i,o=e;n.preserveSymlinks||({resolvedFileName:o,originalPath:i}=SM(e,r,s)),v={primary:x,resolvedFileName:o,originalPath:i,packageId:t,isExternalLibraryImport:aR(e)}}return l={resolvedTypeReferenceDirective:v,failedLookupLocations:pM(u),affectingLocations:pM(d),resolutionDiagnostics:pM(h)},c&&o&&!o.isReadonly&&(o.getOrCreateCacheForDirectory(c,i).set(e,a,l),Fs(e)||o.getOrCreateCacheForNonRelativeName(e,a,i).set(c,l)),s&&k(l),l;function k(t){var n;(null==(n=t.resolvedTypeReferenceDirective)?void 0:n.resolvedFileName)?t.resolvedTypeReferenceDirective.packageId?iM(r,fa.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3,e,t.resolvedTypeReferenceDirective.resolvedFileName,vd(t.resolvedTypeReferenceDirective.packageId),t.resolvedTypeReferenceDirective.primary):iM(r,fa.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2,e,t.resolvedTypeReferenceDirective.resolvedFileName,t.resolvedTypeReferenceDirective.primary):iM(r,fa.Type_reference_directive_0_was_not_resolved,e)}}function wM(e){let t=0;switch(Ck(e)){case 3:case 99:case 100:t=30}return e.resolvePackageJsonExports?t|=8:!1===e.resolvePackageJsonExports&&(t&=-9),e.resolvePackageJsonImports?t|=2:!1===e.resolvePackageJsonImports&&(t&=-3),t}function NM(e,t){const n=Ck(e);if(void 0===t)if(100===n)t=99;else if(2===n)return[];const r=99===t?["import"]:["require"];return e.noDtsResolution||r.push("types"),100!==n&&r.push("node"),G(r,e.customConditions)}function DM(e,t,n,r,i){const o=vR(null==i?void 0:i.getPackageJsonInfoCache(),r,n);return LR(r,t,t=>{if("node_modules"!==Io(t)){const n=Jo(t,"node_modules");return SR(Jo(n,e),!1,o)}})}function FM(e,t){if(e.types)return e.types;const n=[];if(t.directoryExists&&t.getDirectories){const r=bM(e,t);if(r)for(const e of r)if(t.directoryExists(e))for(const r of t.getDirectories(e)){const i=Vo(r),o=Jo(e,i,"package.json");if(!(t.fileExists(o)&&null===Pb(o,t).typings)){const e=Io(i);46!==e.charCodeAt(0)&&n.push(e)}}}return n}function EM(e){return!!(null==e?void 0:e.contents)}function PM(e){return!!e&&!e.contents}function AM(e){var t;if(null===e||"object"!=typeof e)return""+e;if(Ze(e))return`[${null==(t=e.map(e=>AM(e)))?void 0:t.join(",")}]`;let n="{";for(const t in e)Ee(e,t)&&(n+=`${t}: ${AM(e[t])}`);return n+"}"}function IM(e,t){return t.map(t=>AM(Qk(e,t))).join("|")+`|${e.pathsBasePath}`}function OM(e,t){const n=new Map,r=new Map;let i=new Map;return e&&n.set(e,i),{getMapOfCacheRedirects:function(e){return e?o(e.commandLine.options,!1):i},getOrCreateMapOfCacheRedirects:function(e){return e?o(e.commandLine.options,!0):i},update:function(t){e!==t&&(e?i=o(t,!0):n.set(t,i),e=t)},clear:function(){const o=e&&t.get(e);i.clear(),n.clear(),t.clear(),r.clear(),e&&(o&&t.set(e,o),n.set(e,i))},getOwnMap:()=>i};function o(t,o){let s=n.get(t);if(s)return s;const c=a(t);if(s=r.get(c),!s){if(e){const t=a(e);t===c?s=i:r.has(t)||r.set(t,i)}o&&(s??(s=new Map)),s&&r.set(c,s)}return s&&n.set(t,s),s}function a(e){let n=t.get(e);return n||t.set(e,n=IM(e,WO)),n}}function LM(e,t,n,r){const i=e.getOrCreateMapOfCacheRedirects(t);let o=i.get(n);return o||(o=r(),i.set(n,o)),o}function jM(e,t){return void 0===t?e:`${t}|${e}`}function MM(){const e=new Map,t=new Map,n={get:(t,n)=>e.get(r(t,n)),set:(t,i,o)=>(e.set(r(t,i),o),n),delete:(t,i)=>(e.delete(r(t,i)),n),has:(t,n)=>e.has(r(t,n)),forEach:n=>e.forEach((e,r)=>{const[i,o]=t.get(r);return n(e,i,o)}),size:()=>e.size};return n;function r(e,n){const r=jM(e,n);return t.set(r,[e,n]),r}}function RM(e){return e.resolvedModule&&(e.resolvedModule.originalPath||e.resolvedModule.resolvedFileName)}function BM(e){return e.resolvedTypeReferenceDirective&&(e.resolvedTypeReferenceDirective.originalPath||e.resolvedTypeReferenceDirective.resolvedFileName)}function JM(e,t,n,r,i){const o=OM(n,i);return{getFromNonRelativeNameCache:function(e,t,n,r){var i,a;return pn.assert(!Fs(e)),null==(a=null==(i=o.getMapOfCacheRedirects(r))?void 0:i.get(jM(e,t)))?void 0:a.get(n)},getOrCreateCacheForNonRelativeName:function(e,t,n){return pn.assert(!Fs(e)),LM(o,n,jM(e,t),a)},clear:function(){o.clear()},update:function(e){o.update(e)}};function a(){const n=new Map;return{get:function(r){return n.get(Ho(r,e,t))},set:function(i,o){const a=Ho(i,e,t);if(n.has(a))return;n.set(a,o);const s=r(o),c=s&&function(n,r){const i=Ho(Ao(r),e,t);let o=0;const a=Math.min(n.length,i.length);for(;oMM())},clear:function(){i.clear()},update:function(e){i.update(e)},directoryToModuleNameMap:i}}(e,t,n,o),s=JM(e,t,n,i,o);return r??(r=function(e,t){let n;return{getPackageJsonInfo:function(r){return null==n?void 0:n.get(Ho(r,e,t))},setPackageJsonInfo:function(r,i){(n||(n=new Map)).set(Ho(r,e,t),i)},clear:function(){n=void 0},getInternalMap:function(){return n}}}(e,t)),{...r,...a,...s,clear:function(){c(),r.clear()},update:function(e){a.update(e),s.update(e)},getPackageJsonInfoCache:()=>r,clearAllExceptPackageJsonInfoCache:c,optionsToRedirectsKey:o};function c(){a.clear(),s.clear()}}function qM(e,t,n,r,i){const o=zM(e,t,n,r,RM,i);return o.getOrCreateCacheForModuleName=(e,t,n)=>o.getOrCreateCacheForNonRelativeName(e,t,n),o}function UM(e,t,n,r,i){return zM(e,t,n,r,BM,i)}function VM(e){return{moduleResolution:2,traceResolution:e.traceResolution}}function WM(e,t,n,r,i){return HM(e,t,VM(n),r,i)}function $M(e,t,n,r){const i=Ao(t);return n.getFromDirectoryCache(e,r,i,void 0)}function HM(e,t,n,r,i,o,a){const s=oM(n,r);o&&(n=o.commandLine.options),s&&(iM(r,fa.Resolving_module_0_from_1,e,t),o&&iM(r,fa.Using_compiler_options_of_project_reference_redirect_0,o.sourceFile.fileName));const c=Ao(t);let l=null==i?void 0:i.getFromDirectoryCache(e,a,c,o);if(l)s&&iM(r,fa.Resolution_for_module_0_was_found_in_cache_from_location_1,e,c);else{let _=n.moduleResolution;switch(void 0===_?(_=Ck(n),s&&iM(r,fa.Module_resolution_kind_is_not_specified_using_0,ui[_])):s&&iM(r,fa.Explicitly_specified_module_resolution_kind_Colon_0,ui[_]),_){case 3:case 99:l=function(e,t,n,r,i,o,a){return QM(30,e,t,n,r,i,o,a)}(e,t,n,r,i,o,a);break;case 2:l=ZM(e,t,n,r,i,o,a?NM(n,a):void 0);break;case 1:l=$R(e,t,n,r,i,o);break;case 100:l=YM(e,t,n,r,i,o,a?NM(n,a):void 0);break;default:return pn.fail(`Unexpected moduleResolution: ${_}`)}i&&!i.isReadonly&&(i.getOrCreateCacheForDirectory(c,o).set(e,a,l),Fs(e)||i.getOrCreateCacheForNonRelativeName(e,a,o).set(c,l))}return s&&(l.resolvedModule?l.resolvedModule.packageId?iM(r,fa.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2,e,l.resolvedModule.resolvedFileName,vd(l.resolvedModule.packageId)):iM(r,fa.Module_name_0_was_successfully_resolved_to_1,e,l.resolvedModule.resolvedFileName):iM(r,fa.Module_name_0_was_not_resolved,e)),l}function KM(e,t,n,r,i){const o=function(e,t,n,r){const{baseUrl:i,paths:o}=r.compilerOptions;if(o&&!So(t)){r.traceEnabled&&(i&&iM(r.host,fa.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,i,t),iM(r.host,fa.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,t));return RR(e,t,Yy(r.compilerOptions,r.host),o,eT(o),n,!1,r)}}(e,t,r,i);return o?o.value:Fs(t)?function(e,t,n,r,i){if(!i.compilerOptions.rootDirs)return;i.traceEnabled&&iM(i.host,fa.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,t);const o=Vo(Jo(n,t));let a,s;for(const e of i.compilerOptions.rootDirs){let t=Vo(e);Bt(t,fo)||(t+=fo);const n=Qt(o,t)&&(void 0===s||s.length(e[e.None=0]="None",e[e.Imports=2]="Imports",e[e.SelfName=4]="SelfName",e[e.Exports=8]="Exports",e[e.ExportsPatternTrailers=16]="ExportsPatternTrailers",e[e.AllFeatures=30]="AllFeatures",e[e.Node16Default=30]="Node16Default",e[e.NodeNextDefault=30]="NodeNextDefault",e[e.BundlerDefault=30]="BundlerDefault",e[e.EsmMode=32]="EsmMode",e))(XM||{});function QM(e,t,n,r,i,o,a,s,c){const l=Ao(n),_=99===s?32:0;let u=r.noDtsResolution?3:7;return Ak(r)&&(u|=8),tR(e|_,t,l,r,i,o,u,!1,a,c)}function YM(e,t,n,r,i,o,a){const s=Ao(t);let c=n.noDtsResolution?3:7;return Ak(n)&&(c|=8),tR(wM(n),e,s,n,r,i,c,!1,o,a)}function ZM(e,t,n,r,i,o,a,s){let c;return s?c=8:n.noDtsResolution?(c=3,Ak(n)&&(c|=8)):c=Ak(n)?15:7,tR(a?30:0,e,Ao(t),n,r,i,c,!!s,o,a)}function eR(e,t,n){return tR(30,e,Ao(t),{moduleResolution:99},n,void 0,8,!0,void 0,void 0)}function tR(e,t,n,r,i,o,a,s,c,l){var u,p,f,m,g;const h=oM(r,i),y=[],v=[],x=Ck(r);l??(l=NM(r,100===x||2===x?void 0:32&e?99:1));const k=[],S={compilerOptions:r,host:i,traceEnabled:h,failedLookupLocations:y,affectingLocations:v,packageJsonInfoCache:o,features:e,conditions:l??_,requestContainingDirectory:n,reportDiagnostic:e=>{k.push(e)},isConfigLookup:s,candidateIsFromPackageJsonField:!1,resolvedPackageDirectory:!1};let T,w;if(h&&Uk(x)&&iM(i,fa.Resolving_in_0_mode_with_conditions_1,32&e?"ESM":"CJS",S.conditions.map(e=>`'${e}'`).join(", ")),2===x){const e=5&a,t=-6&a;T=e&&N(e,S)||t&&N(t,S)||void 0}else T=N(a,S);if(S.resolvedPackageDirectory&&!s&&!Fs(t)){const t=(null==T?void 0:T.value)&&5&a&&!CR(5,T.value.resolved.extension);if((null==(u=null==T?void 0:T.value)?void 0:u.isExternalLibraryImport)&&t&&8&e&&(null==l?void 0:l.includes("import"))){QR(S,fa.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);const e=N(5&a,{...S,features:-9&S.features,reportDiagnostic:ot});(null==(p=null==e?void 0:e.value)?void 0:p.isExternalLibraryImport)&&(w=e.value.resolved.path)}else if((!(null==T?void 0:T.value)||t)&&2===x){QR(S,fa.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update);const e={...S.compilerOptions,moduleResolution:100},t=N(5&a,{...S,compilerOptions:e,features:30,conditions:NM(e),reportDiagnostic:ot});(null==(f=null==t?void 0:t.value)?void 0:f.isExternalLibraryImport)&&(w=t.value.resolved.path)}}return uM(t,null==(m=null==T?void 0:T.value)?void 0:m.resolved,null==(g=null==T?void 0:T.value)?void 0:g.isExternalLibraryImport,y,v,k,S,o,w);function N(r,a){const s=KM(r,t,n,(e,t,n,r)=>iR(e,t,n,r,!0),a);if(s)return XR({resolved:s,isExternalLibraryImport:aR(s.path)});if(Fs(t)){const{path:e,parts:i}=nR(n,t),o=iR(r,e,!1,a,!0);return o&&XR({resolved:o,isExternalLibraryImport:C(i,"node_modules")})}{if(2&e&&Qt(t,"#")){const e=function(e,t,n,r,i,o){var a,s;if("#"===t||Qt(t,"#/"))return r.traceEnabled&&iM(r.host,fa.Invalid_import_specifier_0_has_no_possible_resolutions,t),XR(void 0);const c=Uo(n,null==(s=(a=r.host).getCurrentDirectory)?void 0:s.call(a)),l=bR(c,r);if(!l)return r.traceEnabled&&iM(r.host,fa.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve,c),XR(void 0);if(!l.contents.packageJsonContent.imports)return r.traceEnabled&&iM(r.host,fa.package_json_scope_0_has_no_imports_defined,l.packageDirectory),XR(void 0);const _=ER(e,r,i,o,t,l.contents.packageJsonContent.imports,l,!0);if(_)return _;r.traceEnabled&&iM(r.host,fa.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1,t,l.packageDirectory);return XR(void 0)}(r,t,n,a,o,c);if(e)return e.value&&{value:{resolved:e.value,isExternalLibraryImport:!1}}}if(4&e){const e=function(e,t,n,r,i,o){var a,s;const c=Uo(n,null==(s=(a=r.host).getCurrentDirectory)?void 0:s.call(a)),l=bR(c,r);if(!l||!l.contents.packageJsonContent.exports)return;if("string"!=typeof l.contents.packageJsonContent.name)return;const _=jo(t),u=jo(l.contents.packageJsonContent.name);if(!b(u,(e,t)=>_[t]===e))return;const p=_.slice(u.length),f=d(p)?`.${fo}${p.join(fo)}`:".";if(Mk(r.compilerOptions)&&!aR(n))return DR(l,e,f,r,i,o);const m=5&e,g=-6&e;return DR(l,m,f,r,i,o)||DR(l,g,f,r,i,o)}(r,t,n,a,o,c);if(e)return e.value&&{value:{resolved:e.value,isExternalLibraryImport:!1}}}if(t.includes(":"))return void(h&&iM(i,fa.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1,t,lM(r)));h&&iM(i,fa.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1,t,lM(r));let s=IR(r,t,n,a,o,c);return 4&r&&(s??(s=HR(t,a))),s&&{value:s.value&&{resolved:s.value,isExternalLibraryImport:!0}}}}}function nR(e,t){const n=Jo(e,t),r=jo(n),i=be(r);return{path:"."===i||".."===i?Go(Vo(n)):Vo(n),parts:r}}function rR(e,t,n){if(!t.realpath)return e;const r=Vo(t.realpath(e));return n&&iM(t,fa.Resolving_real_path_for_0_result_1,e,r),r}function iR(e,t,n,r,i){if(r.traceEnabled&&iM(r.host,fa.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1,t,lM(e)),!Do(t)){if(!n){const e=Ao(t);Ib(e,r.host)||(r.traceEnabled&&iM(r.host,fa.Directory_0_does_not_exist_skipping_all_lookups_in_it,e),n=!0)}const o=_R(e,t,n,r);if(o){const e=i?sR(o.path):void 0;return aM(e?SR(e,!1,r):void 0,o,r)}}if(!n){Ib(t,r.host)||(r.traceEnabled&&iM(r.host,fa.Directory_0_does_not_exist_skipping_all_lookups_in_it,t),n=!0)}if(!(32&r.features))return gR(e,t,n,r,i)}var oR="/node_modules/";function aR(e){return e.includes(oR)}function sR(e,t){const n=Vo(e),r=n.lastIndexOf(oR);if(-1===r)return;const i=r+oR.length;let o=cR(n,i,t);return 64===n.charCodeAt(i)&&(o=cR(n,o,t)),n.slice(0,o)}function cR(e,t,n){const r=e.indexOf(fo,t+1);return-1===r?n?e.length:t:r}function lR(e,t,n,r){return sM(_R(e,t,n,r))}function _R(e,t,n,r){const i=uR(e,t,n,r);if(i)return i;if(!(32&r.features)){const i=pR(t,e,"",n,r);if(i)return i}}function uR(e,t,n,r){if(!Io(t).includes("."))return;let i=KS(t);i===t&&(i=t.substring(0,t.lastIndexOf(".")));const o=t.substring(i.length);return r.traceEnabled&&iM(r.host,fa.File_name_0_has_a_1_extension_stripping_it,t,o),pR(i,e,o,n,r)}function dR(e,t,n,r,i){if(1&e&&No(t,LS)||4&e&&No(t,OS)){const e=fR(t,r,i),o=Cb(t);return void 0!==e?{path:t,ext:o,resolvedUsingTsExtension:n?!Bt(n,o):void 0}:void 0}if(i.isConfigLookup&&8===e&&wo(t,".json")){return void 0!==fR(t,r,i)?{path:t,ext:".json",resolvedUsingTsExtension:void 0}:void 0}return uR(e,t,r,i)}function pR(e,t,n,r,i){if(!r){const t=Ao(e);t&&(r=!Ib(t,i.host))}switch(n){case".mjs":case".mts":case".d.mts":return 1&t&&o(".mts",".mts"===n||".d.mts"===n)||4&t&&o(".d.mts",".mts"===n||".d.mts"===n)||2&t&&o(".mjs")||void 0;case".cjs":case".cts":case".d.cts":return 1&t&&o(".cts",".cts"===n||".d.cts"===n)||4&t&&o(".d.cts",".cts"===n||".d.cts"===n)||2&t&&o(".cjs")||void 0;case".json":return 4&t&&o(".d.json.ts")||8&t&&o(".json")||void 0;case".tsx":case".jsx":return 1&t&&(o(".tsx",".tsx"===n)||o(".ts",".tsx"===n))||4&t&&o(".d.ts",".tsx"===n)||2&t&&(o(".jsx")||o(".js"))||void 0;case".ts":case".d.ts":case".js":case"":return 1&t&&(o(".ts",".ts"===n||".d.ts"===n)||o(".tsx",".ts"===n||".d.ts"===n))||4&t&&o(".d.ts",".ts"===n||".d.ts"===n)||2&t&&(o(".js")||o(".jsx"))||i.isConfigLookup&&o(".json")||void 0;default:return 4&t&&!vO(e+n)&&o(`.d${n}.ts`)||void 0}function o(t,n){const o=fR(e+t,r,i);return void 0===o?void 0:{path:o,ext:t,resolvedUsingTsExtension:!i.candidateIsFromPackageJsonField&&n}}}function fR(e,t,n){var r;if(!(null==(r=n.compilerOptions.moduleSuffixes)?void 0:r.length))return mR(e,t,n);const i=aT(e)??"",o=i?XS(e,i):e;return p(n.compilerOptions.moduleSuffixes,e=>mR(o+e+i,t,n))}function mR(e,t,n){var r;if(!t){if(n.host.fileExists(e))return n.traceEnabled&&iM(n.host,fa.File_0_exists_use_it_as_a_name_resolution_result,e),e;n.traceEnabled&&iM(n.host,fa.File_0_does_not_exist,e)}null==(r=n.failedLookupLocations)||r.push(e)}function gR(e,t,n,r,i=!0){const o=i?SR(t,n,r):void 0;return aM(o,TR(e,t,n,r,o),r)}function hR(e,t,n,r,i){if(!i&&void 0!==e.contents.resolvedEntrypoints)return e.contents.resolvedEntrypoints;let o;const a=5|(i?2:0),s=wM(t),c=vR(null==r?void 0:r.getPackageJsonInfoCache(),n,t);c.conditions=NM(t),c.requestContainingDirectory=e.packageDirectory;const l=TR(a,e.packageDirectory,!1,c,e);if(o=ae(o,null==l?void 0:l.path),8&s&&e.contents.packageJsonContent.exports){const r=Z([NM(t,99),NM(t,1)],re);for(const t of r){const r={...c,failedLookupLocations:[],conditions:t,host:n},i=yR(e,e.contents.packageJsonContent.exports,r,a);if(i)for(const e of i)o=ue(o,e.path)}}return e.contents.resolvedEntrypoints=o||!1}function yR(e,t,n,r){let i;if(Ze(t))for(const e of t)o(e);else if("object"==typeof t&&null!==t&&NR(t))for(const e in t)o(t[e]);else o(t);return i;function o(t){var a,s;if("string"==typeof t&&Qt(t,"./"))if(t.includes("*")&&n.host.readDirectory){if(t.indexOf("*")!==t.lastIndexOf("*"))return!1;n.host.readDirectory(e.packageDirectory,function(e){const t=[];return 1&e&&t.push(...LS),2&e&&t.push(...PS),4&e&&t.push(...OS),8&e&&t.push(".json"),t}(r),void 0,[Yo(hC(t,"**/*"),".*")]).forEach(e=>{i=ue(i,{path:e,ext:Lo(e),resolvedUsingTsExtension:void 0})})}else{const o=jo(t).slice(2);if(o.includes("..")||o.includes(".")||o.includes("node_modules"))return!1;const c=Uo(Jo(e.packageDirectory,t),null==(s=(a=n.host).getCurrentDirectory)?void 0:s.call(a)),l=dR(r,c,t,!1,n);if(l)return i=ue(i,l,(e,t)=>e.path===t.path),!0}else if(Array.isArray(t))for(const e of t){if(o(e))return!0}else if("object"==typeof t&&null!==t)return p(Ae(t),e=>{if("default"===e||C(n.conditions,e)||AR(n.conditions,e))return o(t[e]),!0})}}function vR(e,t,n){return{host:t,compilerOptions:n,traceEnabled:oM(n,t),failedLookupLocations:void 0,affectingLocations:void 0,packageJsonInfoCache:e,features:0,conditions:_,requestContainingDirectory:void 0,reportDiagnostic:ot,isConfigLookup:!1,candidateIsFromPackageJsonField:!1,resolvedPackageDirectory:!1}}function bR(e,t){return LR(t.host,e,e=>SR(e,!1,t))}function xR(e,t){return void 0===e.contents.versionPaths&&(e.contents.versionPaths=yM(e.contents.packageJsonContent,t)||!1),e.contents.versionPaths||void 0}function kR(e,t){return void 0===e.contents.peerDependencies&&(e.contents.peerDependencies=function(e,t){const n=gM(e.contents.packageJsonContent,"peerDependencies","object",t);if(void 0===n)return;t.traceEnabled&&iM(t.host,fa.package_json_has_a_peerDependencies_field);const r=rR(e.packageDirectory,t.host,t.traceEnabled),i=r.substring(0,r.lastIndexOf("node_modules")+12)+fo;let o="";for(const e in n)if(Ee(n,e)){const n=SR(i+e,!1,t);if(n){const r=n.contents.packageJsonContent.version;o+=`+${e}@${r}`,t.traceEnabled&&iM(t.host,fa.Found_peerDependency_0_with_1_version,e,r)}else t.traceEnabled&&iM(t.host,fa.Failed_to_find_peerDependency_0,e)}return o}(e,t)||!1),e.contents.peerDependencies||void 0}function SR(e,t,n){var r,i,o,a,s,c;const{host:l,traceEnabled:_}=n,u=Jo(e,"package.json");if(t)return void(null==(r=n.failedLookupLocations)||r.push(u));const d=null==(i=n.packageJsonInfoCache)?void 0:i.getPackageJsonInfo(u);if(void 0!==d)return EM(d)?(_&&iM(l,fa.File_0_exists_according_to_earlier_cached_lookups,u),null==(o=n.affectingLocations)||o.push(u),d.packageDirectory===e?d:{packageDirectory:e,contents:d.contents}):(d.directoryExists&&_&&iM(l,fa.File_0_does_not_exist_according_to_earlier_cached_lookups,u),void(null==(a=n.failedLookupLocations)||a.push(u)));const p=Ib(e,l);if(p&&l.fileExists(u)){const t=Pb(u,l);_&&iM(l,fa.Found_package_json_at_0,u);const r={packageDirectory:e,contents:{packageJsonContent:t,versionPaths:void 0,resolvedEntrypoints:void 0,peerDependencies:void 0}};return n.packageJsonInfoCache&&!n.packageJsonInfoCache.isReadonly&&n.packageJsonInfoCache.setPackageJsonInfo(u,r),null==(s=n.affectingLocations)||s.push(u),r}p&&_&&iM(l,fa.File_0_does_not_exist,u),n.packageJsonInfoCache&&!n.packageJsonInfoCache.isReadonly&&n.packageJsonInfoCache.setPackageJsonInfo(u,{packageDirectory:e,directoryExists:p}),null==(c=n.failedLookupLocations)||c.push(u)}function TR(e,t,n,r,i){const o=i&&xR(i,r);let a;i&&kM(null==i?void 0:i.packageDirectory,t,r.host)&&(a=r.isConfigLookup?function(e,t,n){return hM(e,"tsconfig",t,n)}(i.contents.packageJsonContent,i.packageDirectory,r):4&e&&function(e,t,n){return hM(e,"typings",t,n)||hM(e,"types",t,n)}(i.contents.packageJsonContent,i.packageDirectory,r)||7&e&&function(e,t,n){return hM(e,"main",t,n)}(i.contents.packageJsonContent,i.packageDirectory,r)||void 0);const s=(e,t,n,r)=>{const o=dR(e,t,void 0,n,r);if(o)return sM(o);const a=4===e?5:e,s=r.features,c=r.candidateIsFromPackageJsonField;r.candidateIsFromPackageJsonField=!0,"module"!==(null==i?void 0:i.contents.packageJsonContent.type)&&(r.features&=-33);const l=iR(a,t,n,r,!1);return r.features=s,r.candidateIsFromPackageJsonField=c,l},l=a?!Ib(Ao(a),r.host):void 0,_=n||!Ib(t,r.host),u=Jo(t,r.isConfigLookup?"tsconfig":"index");if(o&&(!a||ia(t,a))){const n=sa(t,a||u,!1);r.traceEnabled&&iM(r.host,fa.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,o.version,c,n);const i=eT(o.paths),d=RR(e,n,t,o.paths,i,s,l||_,r);if(d)return cM(d.value)}const d=a&&cM(s(e,a,l,r));return d||(32&r.features?void 0:_R(e,u,_,r))}function CR(e,t){return 2&e&&(".js"===t||".jsx"===t||".mjs"===t||".cjs"===t)||1&e&&(".ts"===t||".tsx"===t||".mts"===t||".cts"===t)||4&e&&(".d.ts"===t||".d.mts"===t||".d.cts"===t)||8&e&&".json"===t||!1}function wR(e){let t=e.indexOf(fo);return"@"===e[0]&&(t=e.indexOf(fo,t+1)),-1===t?{packageName:e,rest:""}:{packageName:e.slice(0,t),rest:e.slice(t+1)}}function NR(e){return b(Ae(e),e=>Qt(e,"."))}function DR(e,t,n,r,i,o){if(e.contents.packageJsonContent.exports){if("."===n){let a;if("string"==typeof e.contents.packageJsonContent.exports||Array.isArray(e.contents.packageJsonContent.exports)||"object"==typeof e.contents.packageJsonContent.exports&&!H(Ae(e.contents.packageJsonContent.exports),e=>Qt(e,"."))?a=e.contents.packageJsonContent.exports:Ee(e.contents.packageJsonContent.exports,".")&&(a=e.contents.packageJsonContent.exports["."]),a){return PR(t,r,i,o,n,e,!1)(a,"",!1,".")}}else if(NR(e.contents.packageJsonContent.exports)){if("object"!=typeof e.contents.packageJsonContent.exports)return r.traceEnabled&&iM(r.host,fa.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,n,e.packageDirectory),XR(void 0);const a=ER(t,r,i,o,n,e.contents.packageJsonContent.exports,e,!1);if(a)return a}return r.traceEnabled&&iM(r.host,fa.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,n,e.packageDirectory),XR(void 0)}}function FR(e,t){const n=e.indexOf("*"),r=t.indexOf("*"),i=-1===n?e.length:n+1,o=-1===r?t.length:r+1;return i>o?-1:o>i||-1===n?1:-1===r||e.length>t.length?-1:t.length>e.length?1:0}function ER(e,t,n,r,i,o,a,s){const c=PR(e,t,n,r,i,a,s);if(!Bt(i,fo)&&!i.includes("*")&&Ee(o,i)){return c(o[i],"",!1,i)}const l=de(D(Ae(o),e=>function(e){const t=e.indexOf("*");return-1!==t&&t===e.lastIndexOf("*")}(e)||Bt(e,"/")),FR);for(const e of l){if(16&t.features&&_(e,i)){const t=o[e],n=e.indexOf("*");return c(t,i.substring(e.substring(0,n).length,i.length-(e.length-1-n)),!0,e)}if(Bt(e,"*")&&Qt(i,e.substring(0,e.length-1))){return c(o[e],i.substring(e.length-1),!0,e)}if(Qt(i,e)){return c(o[e],i.substring(e.length),!1,e)}}function _(e,t){if(Bt(e,"*"))return!1;const n=e.indexOf("*");return-1!==n&&(Qt(t,e.substring(0,n))&&Bt(t,e.substring(n+1)))}}function PR(e,t,n,r,i,o,a){return function s(c,l,u,p){var f,m;if("string"==typeof c){if(!u&&l.length>0&&!Bt(c,"/"))return t.traceEnabled&&iM(t.host,fa.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i),XR(void 0);if(!Qt(c,"./")){if(a&&!Qt(c,"../")&&!Qt(c,"/")&&!bo(c)){const i=u?c.replace(/\*/g,l):c+l;QR(t,fa.Using_0_subpath_1_with_target_2,"imports",p,i),QR(t,fa.Resolving_module_0_from_1,i,o.packageDirectory+"/");const a=tR(t.features,i,o.packageDirectory+"/",t.compilerOptions,t.host,n,e,!1,r,t.conditions);return null==(f=t.failedLookupLocations)||f.push(...a.failedLookupLocations??_),null==(m=t.affectingLocations)||m.push(...a.affectingLocations??_),XR(a.resolvedModule?{path:a.resolvedModule.resolvedFileName,extension:a.resolvedModule.extension,packageId:a.resolvedModule.packageId,originalPath:a.resolvedModule.originalPath,resolvedUsingTsExtension:a.resolvedModule.resolvedUsingTsExtension}:void 0)}return t.traceEnabled&&iM(t.host,fa.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i),XR(void 0)}const s=(So(c)?jo(c).slice(1):jo(c)).slice(1);if(s.includes("..")||s.includes(".")||s.includes("node_modules"))return t.traceEnabled&&iM(t.host,fa.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i),XR(void 0);const d=Jo(o.packageDirectory,c),y=jo(l);if(y.includes("..")||y.includes(".")||y.includes("node_modules"))return t.traceEnabled&&iM(t.host,fa.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i),XR(void 0);t.traceEnabled&&iM(t.host,fa.Using_0_subpath_1_with_target_2,a?"imports":"exports",p,u?c.replace(/\*/g,l):c+l);const v=g(u?d.replace(/\*/g,l):d+l),b=function(n,r,i,a){var s,c,l,_;if(!t.isConfigLookup&&(t.compilerOptions.declarationDir||t.compilerOptions.outDir)&&!n.includes("/node_modules/")&&(!t.compilerOptions.configFile||ia(o.packageDirectory,g(t.compilerOptions.configFile.fileName),!YR(t)))){const d=zy({useCaseSensitiveFileNames:()=>YR(t)}),p=[];if(t.compilerOptions.rootDir||t.compilerOptions.composite&&t.compilerOptions.configFilePath){const e=g(vU(t.compilerOptions,()=>[],(null==(c=(s=t.host).getCurrentDirectory)?void 0:c.call(s))||"",d));p.push(e)}else if(t.requestContainingDirectory){const e=g(Jo(t.requestContainingDirectory,"index.ts")),n=g(vU(t.compilerOptions,()=>[e,g(i)],(null==(_=(l=t.host).getCurrentDirectory)?void 0:_.call(l))||"",d));p.push(n);let r=Go(n);for(;r&&r.length>1;){const e=jo(r);e.pop();const t=Mo(e);p.unshift(t),r=Go(t)}}p.length>1&&t.reportDiagnostic(nk(a?fa.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:fa.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,""===r?".":r,i));for(const r of p){const i=u(r);for(const a of i)if(ia(a,n,!YR(t))){const i=Jo(r,n.slice(a.length+1)),s=[".mjs",".cjs",".js",".json",".d.mts",".d.cts",".d.ts"];for(const n of s)if(wo(i,n)){const r=Xy(i);for(const a of r){if(!CR(e,a))continue;const r=Qo(i,a,n,!YR(t));if(t.host.fileExists(r))return XR(aM(o,dR(e,r,void 0,!1,t),t))}}}}}return;function u(e){var n,r;const i=t.compilerOptions.configFile?(null==(r=(n=t.host).getCurrentDirectory)?void 0:r.call(n))||"":e,o=[];return t.compilerOptions.declarationDir&&o.push(g(h(i,t.compilerOptions.declarationDir))),t.compilerOptions.outDir&&t.compilerOptions.outDir!==t.compilerOptions.declarationDir&&o.push(g(h(i,t.compilerOptions.outDir))),o}}(v,l,Jo(o.packageDirectory,"package.json"),a);return b||XR(aM(o,dR(e,v,c,!1,t),t))}if("object"==typeof c&&null!==c){if(!Array.isArray(c)){QR(t,fa.Entering_conditional_exports);for(const e of Ae(c))if("default"===e||t.conditions.includes(e)||AR(t.conditions,e)){QR(t,fa.Matched_0_condition_1,a?"imports":"exports",e);const n=c[e],r=s(n,l,u,p);if(r)return QR(t,fa.Resolved_under_condition_0,e),QR(t,fa.Exiting_conditional_exports),r;QR(t,fa.Failed_to_resolve_under_condition_0,e)}else QR(t,fa.Saw_non_matching_condition_0,e);return void QR(t,fa.Exiting_conditional_exports)}if(!d(c))return t.traceEnabled&&iM(t.host,fa.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i),XR(void 0);for(const e of c){const t=s(e,l,u,p);if(t)return t}}else if(null===c)return t.traceEnabled&&iM(t.host,fa.package_json_scope_0_explicitly_maps_specifier_1_to_null,o.packageDirectory,i),XR(void 0);t.traceEnabled&&iM(t.host,fa.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i);return XR(void 0);function g(e){var n,r;return void 0===e?e:Uo(e,null==(r=(n=t.host).getCurrentDirectory)?void 0:r.call(n))}function h(e,t){return Go(Jo(e,t))}}}function AR(e,t){if(!e.includes("types"))return!1;if(!Qt(t,"types@"))return!1;const n=Tn.tryParse(t.substring(6));return!!n&&n.test(c)}function IR(e,t,n,r,i,o){return OR(e,t,n,r,!1,i,o)}function OR(e,t,n,r,i,o,a){const s=0===r.features?void 0:32&r.features||r.conditions.includes("import")?99:1,c=5&e,l=-6&e;if(c){QR(r,fa.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0,lM(c));const e=_(c);if(e)return e}if(l&&!i)return QR(r,fa.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0,lM(l)),_(l);function _(e){return LR(r.host,Ro(n),n=>{if("node_modules"!==Io(n)){const c=WR(o,t,s,n,a,r);return c||XR(jR(e,t,n,r,i,o,a))}})}}function LR(e,t,n){var r;const i=null==(r=null==e?void 0:e.getGlobalTypingsCacheLocation)?void 0:r.call(e);return ua(t,e=>{const t=n(e);return void 0!==t?t:e!==i&&void 0})||void 0}function jR(e,t,n,r,i,o,a){const s=Jo(n,"node_modules"),c=Ib(s,r.host);if(!c&&r.traceEnabled&&iM(r.host,fa.Directory_0_does_not_exist_skipping_all_lookups_in_it,s),!i){const n=MR(e,t,s,c,r,o,a);if(n)return n}if(4&e){const e=Jo(s,"@types");let n=c;return c&&!Ib(e,r.host)&&(r.traceEnabled&&iM(r.host,fa.Directory_0_does_not_exist_skipping_all_lookups_in_it,e),n=!1),MR(4,JR(t,r),e,n,r,o,a)}}function MR(e,t,n,r,i,o,a){var s,l;const u=Vo(Jo(n,t)),{packageName:d,rest:p}=wR(t),f=Jo(n,d);let m,g=SR(u,!r,i);if(""!==p&&g&&(!(8&i.features)||!Ee((null==(s=m=SR(f,!r,i))?void 0:s.contents.packageJsonContent)??_,"exports"))){const t=_R(e,u,!r,i);if(t)return sM(t);const n=TR(e,u,!r,i,g);return aM(g,n,i)}const h=(e,t,n,r)=>{let i=(p||!(32&r.features))&&_R(e,t,n,r)||TR(e,t,n,r,g);return!i&&!p&&g&&(void 0===g.contents.packageJsonContent.exports||null===g.contents.packageJsonContent.exports)&&32&r.features&&(i=_R(e,Jo(t,"index.js"),n,r)),aM(g,i,r)};if(""!==p&&(g=m??SR(f,!r,i)),g&&(i.resolvedPackageDirectory=!0),g&&g.contents.packageJsonContent.exports&&8&i.features)return null==(l=DR(g,e,Jo(".",p),i,o,a))?void 0:l.value;const y=""!==p&&g?xR(g,i):void 0;if(y){i.traceEnabled&&iM(i.host,fa.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,y.version,c,p);const t=r&&Ib(f,i.host),n=eT(y.paths),o=RR(e,p,f,y.paths,n,h,!t,i);if(o)return o.value}return h(e,u,!r,i)}function RR(e,t,n,r,i,o,a,s){const c=lT(i,t);if(c){const i=tt(c)?void 0:Gt(c,t),l=tt(c)?c:Kt(c);s.traceEnabled&&iM(s.host,fa.Module_name_0_matched_pattern_1,t,l);return{value:p(r[l],t=>{const r=i?hC(t,i):t,c=Vo(Jo(n,r));s.traceEnabled&&iM(s.host,fa.Trying_substitution_0_candidate_module_location_Colon_1,t,r);const l=aT(t);if(void 0!==l){const e=fR(c,a,s);if(void 0!==e)return sM({path:e,ext:l,resolvedUsingTsExtension:void 0})}return o(e,c,a||!Ib(Ao(c),s.host),s)})}}}var BR="__";function JR(e,t){const n=qR(e);return t.traceEnabled&&n!==e&&iM(t.host,fa.Scoped_package_detected_looking_in_0,n),n}function zR(e){return`@types/${qR(e)}`}function qR(e){if(Qt(e,"@")){const t=e.replace(fo,BR);if(t!==e)return t.slice(1)}return e}function UR(e){const t=Yt(e,"@types/");return t!==e?VR(t):e}function VR(e){return e.includes(BR)?"@"+e.replace(BR,fo):e}function WR(e,t,n,r,i,o){const a=e&&e.getFromNonRelativeNameCache(t,n,r,i);if(a)return o.traceEnabled&&iM(o.host,fa.Resolution_for_module_0_was_found_in_cache_from_location_1,t,r),o.resultFromCache=a,{value:a.resolvedModule&&{path:a.resolvedModule.resolvedFileName,originalPath:a.resolvedModule.originalPath||!0,extension:a.resolvedModule.extension,packageId:a.resolvedModule.packageId,resolvedUsingTsExtension:a.resolvedModule.resolvedUsingTsExtension}}}function $R(e,t,n,r,i,o){const a=oM(n,r),s=[],c=[],l=Ao(t),_=[],u={compilerOptions:n,host:r,traceEnabled:a,failedLookupLocations:s,affectingLocations:c,packageJsonInfoCache:i,features:0,conditions:[],requestContainingDirectory:l,reportDiagnostic:e=>{_.push(e)},isConfigLookup:!1,candidateIsFromPackageJsonField:!1,resolvedPackageDirectory:!1},d=p(5)||p(2|(n.resolveJsonModule?8:0));return uM(e,d&&d.value,(null==d?void 0:d.value)&&aR(d.value.path),s,c,_,u,i);function p(t){const n=KM(t,e,l,lR,u);if(n)return{value:n};if(Fs(e)){const n=Vo(Jo(l,e));return XR(lR(t,n,!1,u))}{const n=LR(u.host,l,n=>{const r=WR(i,e,void 0,n,o,u);if(r)return r;const a=Vo(Jo(n,e));return XR(lR(t,a,!1,u))});if(n)return n;if(5&t){let n=function(e,t,n){return OR(4,e,t,n,!0,void 0,void 0)}(e,l,u);return 4&t&&(n??(n=HR(e,u))),n}}}}function HR(e,t){if(t.compilerOptions.typeRoots)for(const n of t.compilerOptions.typeRoots){const r=TM(n,e,t),i=Ib(n,t.host);!i&&t.traceEnabled&&iM(t.host,fa.Directory_0_does_not_exist_skipping_all_lookups_in_it,n);const o=_R(4,r,!i,t);if(o){const e=sR(o.path);return XR(aM(e?SR(e,!1,t):void 0,o,t))}const a=gR(4,r,!i,t);if(a)return XR(a)}}function KR(e,t){return kk(e)||!!t&&vO(t)}function GR(e,t,n,r,i,o){const a=oM(n,r);a&&iM(r,fa.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2,t,e,i);const s=[],c=[],l=[],_={compilerOptions:n,host:r,traceEnabled:a,failedLookupLocations:s,affectingLocations:c,packageJsonInfoCache:o,features:0,conditions:[],requestContainingDirectory:void 0,reportDiagnostic:e=>{l.push(e)},isConfigLookup:!1,candidateIsFromPackageJsonField:!1,resolvedPackageDirectory:!1};return dM(jR(4,e,i,_,!1,void 0,void 0),!0,s,c,l,_.resultFromCache,void 0)}function XR(e){return void 0!==e?{value:e}:void 0}function QR(e,t,...n){e.traceEnabled&&iM(e.host,t,...n)}function YR(e){return!e.host.useCaseSensitiveFileNames||("boolean"==typeof e.host.useCaseSensitiveFileNames?e.host.useCaseSensitiveFileNames:e.host.useCaseSensitiveFileNames())}var ZR=(e=>(e[e.NonInstantiated=0]="NonInstantiated",e[e.Instantiated=1]="Instantiated",e[e.ConstEnumOnly=2]="ConstEnumOnly",e))(ZR||{});function eB(e,t){return e.body&&!e.body.parent&&(IT(e.body,e),OT(e.body,!1)),e.body?tB(e.body,t):1}function tB(e,t=new Map){const n=_J(e);if(t.has(n))return t.get(n)||0;t.set(n,void 0);const r=function(e,t){switch(e.kind){case 265:case 266:return 0;case 267:if(af(e))return 2;break;case 273:case 272:if(!Av(e,32))return 0;break;case 279:const n=e;if(!n.moduleSpecifier&&n.exportClause&&280===n.exportClause.kind){let e=0;for(const r of n.exportClause.elements){const n=nB(r,t);if(n>e&&(e=n),1===e)return e}return e}break;case 269:{let n=0;return iO(e,e=>{const r=tB(e,t);switch(r){case 0:return;case 2:return void(n=2);case 1:return n=1,!0;default:pn.assertNever(r)}}),n}case 268:return eB(e,t);case 80:if(4096&e.flags)return 0}return 1}(e,t);return t.set(n,r),r}function nB(e,t){const n=e.propertyName||e.name;if(80!==n.kind)return 1;let r=e.parent;for(;r;){if(GF(r)||kE(r)||dP(r)){const e=r.statements;let i;for(const o of e)if(Cc(o,n)){o.parent||(IT(o,r),OT(o,!1));const e=tB(o,t);if((void 0===i||e>i)&&(i=e),1===i)return i;272===o.kind&&(i=1)}if(void 0!==i)return i}r=r.parent}return 1}var rB=(e=>(e[e.None=0]="None",e[e.IsContainer=1]="IsContainer",e[e.IsBlockScopedContainer=2]="IsBlockScopedContainer",e[e.IsControlFlowContainer=4]="IsControlFlowContainer",e[e.IsFunctionLike=8]="IsFunctionLike",e[e.IsFunctionExpression=16]="IsFunctionExpression",e[e.HasLocals=32]="HasLocals",e[e.IsInterface=64]="IsInterface",e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor",e))(rB||{});function iB(e,t,n){return pn.attachFlowNodeDebugInfo({flags:e,id:0,node:t,antecedent:n})}var oB=sB();function aB(e,t){rr("beforeBind"),oB(e,t),rr("afterBind"),ir("Bind","beforeBind","afterBind")}function sB(){var e,t,n,r,i,o,a,s,c,l,_,u,f,m,g,h,y,v,x,k,S,T,w,N,D,F,E,P=!1,A=0,I=iB(1,void 0,void 0),O=iB(1,void 0,void 0),L=function(){return mI(function(e,t){if(t){t.stackIndex++,IT(e,r);const n=D;We(e);const i=r;r=e,t.skip=!1,t.inStrictModeStack[t.stackIndex]=n,t.parentStack[t.stackIndex]=i}else t={stackIndex:0,skip:!1,inStrictModeStack:[void 0],parentStack:[void 0]};const n=e.operatorToken.kind;if(rb(n)||tb(n)){if(fe(e)){const t=te(),n=u,r=w;w=!1,Se(e,t,t),u=w?de(t):n,w||(w=r)}else Se(e,h,y);t.skip=!0}return t},function(t,n,r){if(!n.skip){const n=e(t);return 28===r.operatorToken.kind&&be(t),n}},function(e,t,n){t.skip||ze(e)},function(t,n,r){if(!n.skip){const n=e(t);return 28===r.operatorToken.kind&&be(t),n}},function(e,t){if(!t.skip){const t=e.operatorToken.kind;if(ob(t)&&!th(e)&&(ke(e.left),64===t&&213===e.left.kind)){ee(e.left.expression)&&(u=le(256,u,e))}}const n=t.inStrictModeStack[t.stackIndex],i=t.parentStack[t.stackIndex];void 0!==n&&(D=n);void 0!==i&&(r=i);t.skip=!1,t.stackIndex--},void 0);function e(e){if(e&&AF(e)&&!lb(e))return e;ze(e)}}();return function(d,p){var b,x;e=d,n=Sk(t=p),D=function(e,t){return!(!Wk(t,"alwaysStrict")||e.isDeclarationFile)||!!e.externalModuleIndicator}(e,p),E=new Set,A=0,F=qx.getSymbolConstructor(),pn.attachFlowNodeDebugInfo(I),pn.attachFlowNodeDebugInfo(O),e.locals||(null==(b=Gn)||b.push(Gn.Phase.Bind,"bindSourceFile",{path:e.path},!0),ze(e),null==(x=Gn)||x.pop(),e.symbolCount=A,e.classifiableNames=E,function(){if(!c)return;const t=i,n=s,o=a,l=r,_=u;for(const t of c){const n=t.parent.parent;i=Ip(n)||e,a=Op(n)||e,u=iB(2,void 0,void 0),r=t,ze(t.typeExpression);const o=Fc(t);if((UP(t)||!t.fullName)&&o&&fb(o.parent)){const n=at(o.parent);if(n){nt(e.symbol,o.parent,n,!!mc(o,e=>hF(e)&&"prototype"===e.name.escapedText),!1);const r=i;switch(mg(o.parent)){case 1:case 2:i=rf(e)?e:void 0;break;case 4:i=o.parent.expression;break;case 3:i=o.parent.expression.name;break;case 5:i=lB(e,o.parent.expression)?e:hF(o.parent.expression)?o.parent.expression.name:o.parent.expression;break;case 0:return pn.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}i&&q(t,524288,788968),i=r}}else UP(t)||!t.fullName||80===t.fullName.kind?(r=t.parent,Oe(t,524288,788968)):ze(t.fullName)}i=t,s=n,a=o,r=l,u=_}(),function(){if(void 0===_)return;const t=i,n=s,o=a,c=r,l=u;for(const t of _){const n=Kg(t),o=n?Ip(n):void 0,s=n?Op(n):void 0;i=o||e,a=s||e,u=iB(2,void 0,void 0),r=t,ze(t.importClause)}i=t,s=n,a=o,r=c,u=l}());e=void 0,t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,a=void 0,s=void 0,c=void 0,_=void 0,l=!1,u=void 0,f=void 0,m=void 0,g=void 0,h=void 0,y=void 0,v=void 0,k=void 0,S=!1,T=!1,w=!1,P=!1,N=0};function j(t,n,...r){return Vp(Sd(t)||e,t,n,...r)}function M(e,t){return A++,new F(e,t)}function R(e,t,n){e.flags|=n,t.symbol=e,e.declarations=ue(e.declarations,t),1955&n&&!e.exports&&(e.exports=Zu()),6240&n&&!e.members&&(e.members=Zu()),e.constEnumOnlyModule&&304&e.flags&&(e.constEnumOnlyModule=!1),111551&n&&vg(e,t)}function B(e){if(278===e.kind)return e.isExportEquals?"export=":"default";const t=Fc(e);if(t){if(dp(e)){const n=$h(t);return hp(e)?"__global":`"${n}"`}if(168===t.kind){const e=t.expression;if(Jh(e))return yc(e.text);if(zh(e))return Ia(e.operator)+e.operand.text;pn.fail("Only computed properties with literal names have declaration names")}if(dD(t)){const n=em(e);if(!n)return;return Kh(n.symbol,t.escapedText)}return rP(t)?lC(t):Wh(t)?Hh(t):void 0}switch(e.kind){case 177:return"__constructor";case 185:case 180:case 324:return"__call";case 186:case 181:return"__new";case 182:return"__index";case 279:return"__export";case 308:return"export=";case 227:if(2===og(e))return"export=";pn.fail("Unknown binary declaration kind");break;case 318:return Pg(e)?"__new":"__call";case 170:pn.assert(318===e.parent.kind,"Impossible parameter parent kind",()=>`parent is: ${pn.formatSyntaxKind(e.parent.kind)}, expected JSDocFunctionType`);return"arg"+e.parent.parameters.indexOf(e)}}function J(e){return Nc(e)?jp(e.name):vc(pn.checkDefined(B(e)))}function z(t,n,r,i,o,a,s){pn.assert(s||!qh(r));const c=Av(r,2048)||JE(r)&&Yd(r.name),l=s?"__computed":c&&n?"default":B(r);let _;if(void 0===l)_=M(0,"__missing");else if(_=t.get(l),2885600&i&&E.add(l),_){if(a&&!_.isReplaceableByMethod)return _;if(_.flags&o)if(_.isReplaceableByMethod)t.set(l,_=M(0,l));else if(!(3&i&&67108864&_.flags)){Nc(r)&&IT(r.name,r);let t=2&_.flags?fa.Cannot_redeclare_block_scoped_variable_0:fa.Duplicate_identifier_0,n=!0;(384&_.flags||384&i)&&(t=fa.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations,n=!1);let o=!1;d(_.declarations)&&(c||_.declarations&&_.declarations.length&&278===r.kind&&!r.isExportEquals)&&(t=fa.A_module_cannot_have_multiple_default_exports,n=!1,o=!0);const a=[];vE(r)&&Pd(r.type)&&Av(r,32)&&2887656&_.flags&&a.push(j(r,fa.Did_you_mean_0,`export type { ${vc(r.name.escapedText)} }`));const s=Fc(r)||r;p(_.declarations,(r,i)=>{const c=Fc(r)||r,l=n?j(c,t,J(r)):j(c,t);e.bindDiagnostics.push(o?uT(l,j(s,0===i?fa.Another_export_default_is_here:fa.and_here)):l),o&&a.push(j(c,fa.The_first_export_default_is_here))});const u=n?j(s,t,J(r)):j(s,t);e.bindDiagnostics.push(uT(u,...a)),_=M(0,l)}}else t.set(l,_=M(0,l)),a&&(_.isReplaceableByMethod=!0);return R(_,r,i),_.parent?pn.assert(_.parent===n,"Existing symbol parent should match new one"):_.parent=n,_}function q(e,t,n){const r=!!(32&cc(e))||function(e){e.parent&&xE(e)&&(e=e.parent);if(!Ag(e))return!1;if(!UP(e)&&e.fullName)return!0;const t=Fc(e);return!!t&&(!(!fb(t.parent)||!at(t.parent))||!!(fu(t.parent)&&32&cc(t.parent)))}(e);if(2097152&t)return 282===e.kind||272===e.kind&&r?z(i.symbol.exports,i.symbol,e,t,n):(pn.assertNode(i,uu),z(i.locals,void 0,e,t,n));if(Ag(e)&&pn.assert(Om(e)),!dp(e)&&(r||128&i.flags)){if(!uu(i)||!i.locals||Av(e,2048)&&!B(e))return z(i.symbol.exports,i.symbol,e,t,n);const r=111551&t?1048576:0,o=z(i.locals,void 0,e,r,n);return o.exportSymbol=z(i.symbol.exports,i.symbol,e,t,n),e.localSymbol=o,o}return pn.assertNode(i,uu),z(i.locals,void 0,e,t,n)}function U(e){V(e,e=>263===e.kind?ze(e):void 0),V(e,e=>263!==e.kind?ze(e):void 0)}function V(e,t=ze){void 0!==e&&p(e,t)}function W(e){iO(e,ze,V)}function $(e){const n=P;if(P=!1,function(e){if(!(1&u.flags))return!1;if(u===I){const n=gu(e)&&243!==e.kind||264===e.kind||cB(e,t)||268===e.kind&&function(e){const n=eB(e);return 1===n||2===n&&Ok(t)}(e);if(n&&(u=O,!t.allowUnreachableCode)){const n=zk(t)&&!(33554432&e.flags)&&(!XF(e)||!!(7&_c(e.declarationList))||e.declarationList.declarations.some(e=>!!e.initializer));!function(e,t,n){if(hu(e)&&r(e)&&GF(e.parent)){const{statements:t}=e.parent,i=_T(t,e);K(i,r,(e,t)=>n(i[e],i[t-1]))}else n(e,e);function r(e){return!(gE(e)||i(e)||XF(e)&&!(7&_c(e))&&e.declarationList.declarations.some(e=>!e.initializer))}function i(e){switch(e.kind){case 265:case 266:return!0;case 268:return 1!==eB(e);case 267:return!cB(e,t);default:return!1}}}(e,t,(e,t)=>Je(n,e,t,fa.Unreachable_code_detected))}}return!0}(e))return Rg(e)&&e.flowNode&&(e.flowNode=void 0),W(e),qe(e),void(P=n);switch(e.kind>=244&&e.kind<=260&&(!t.allowUnreachableCode||254===e.kind)&&(e.flowNode=u),e.kind){case 248:!function(e){const t=ye(e,ne()),n=te(),r=te();oe(t,u),u=t,ge(e.expression,n,r),u=de(n),he(e.statement,r,t),oe(t,u),u=de(r)}(e);break;case 247:!function(e){const t=ne(),n=ye(e,te()),r=te();oe(t,u),u=t,he(e.statement,r,n),oe(n,u),u=de(n),ge(e.expression,t,r),u=de(r)}(e);break;case 249:!function(e){const t=ye(e,ne()),n=te(),r=te(),i=te();ze(e.initializer),oe(t,u),u=t,ge(e.condition,n,i),u=de(n),he(e.statement,i,r),oe(r,u),u=de(r),ze(e.incrementor),oe(t,u),u=de(i)}(e);break;case 250:case 251:!function(e){const t=ye(e,ne()),n=te();ze(e.expression),oe(t,u),u=t,251===e.kind&&ze(e.awaitModifier);oe(n,u),ze(e.initializer),262!==e.initializer.kind&&ke(e.initializer);he(e.statement,n,t),oe(t,u),u=de(n)}(e);break;case 246:!function(e){const t=te(),n=te(),r=te();ge(e.expression,t,n),u=de(t),ze(e.thenStatement),oe(r,u),u=de(n),ze(e.elseStatement),oe(r,u),u=de(r)}(e);break;case 254:case 258:!function(e){const t=T;T=!0,ze(e.expression),T=t,254===e.kind&&(S=!0,g&&oe(g,u));u=I,w=!0}(e);break;case 253:case 252:!function(e){if(ze(e.label),e.label){const t=function(e){for(let t=k;t;t=t.next)if(t.name===e)return t;return}(e.label.escapedText);t&&(t.referenced=!0,ve(e,t.breakTarget,t.continueTarget))}else ve(e,f,m)}(e);break;case 259:!function(e){const t=g,n=v,r=te(),i=te();let o=te();e.finallyBlock&&(g=i);oe(o,u),v=o,ze(e.tryBlock),oe(r,u),e.catchClause&&(u=de(o),o=te(),oe(o,u),v=o,ze(e.catchClause),oe(r,u));if(g=t,v=n,e.finallyBlock){const t=te();t.antecedent=G(G(r.antecedent,o.antecedent),i.antecedent),u=t,ze(e.finallyBlock),1&u.flags?u=I:(g&&i.antecedent&&oe(g,re(t,i.antecedent,u)),v&&o.antecedent&&oe(v,re(t,o.antecedent,u)),u=r.antecedent?re(t,r.antecedent,u):I)}else u=de(r)}(e);break;case 256:!function(e){const t=te();ze(e.expression);const n=f,r=x;f=t,x=u,ze(e.caseBlock),oe(t,u);const i=p(e.caseBlock.clauses,e=>298===e.kind);e.possiblyExhaustive=!i&&!t.antecedent,i||oe(t,ce(x,e,0,0));f=n,x=r,u=de(t)}(e);break;case 270:!function(e){const n=e.clauses,r=112===e.parent.expression.kind||X(e.parent.expression);let i=I;for(let o=0;oRE(e)||ME(e))}(e)?e.flags|=128:e.flags&=-129}function Ae(e){const t=eB(e),n=0!==t;return Ee(e,n?512:1024,n?110735:0),t}function Ie(e,t,n){const r=M(t,n);return 106508&t&&(r.parent=i.symbol),R(r,e,t),r}function Oe(e,t,n){switch(a.kind){case 268:q(e,t,n);break;case 308:if(rf(i)){q(e,t,n);break}default:pn.assertNode(a,uu),a.locals||(a.locals=Zu(),Fe(a)),z(a.locals,void 0,e,t,n)}}function Le(t){if(!(e.parseDiagnostics.length||33554432&t.flags||16777216&t.flags||gh(t))){const n=xc(t);if(void 0===n)return;D&&n>=119&&n<=127?e.bindDiagnostics.push(j(t,function(t){if(em(t))return fa.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode;if(e.externalModuleIndicator)return fa.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode;return fa.Identifier_expected_0_is_a_reserved_word_in_strict_mode}(t),jp(t))):135===n?uO(e)&&am(t)?e.bindDiagnostics.push(j(t,fa.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,jp(t))):65536&t.flags&&e.bindDiagnostics.push(j(t,fa.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,jp(t))):127===n&&16384&t.flags&&e.bindDiagnostics.push(j(t,fa.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,jp(t)))}}function je(t,n){if(n&&80===n.kind){const i=n;if(uD(r=i)&&("eval"===r.escapedText||"arguments"===r.escapedText)){const r=tf(e,n);e.bindDiagnostics.push(ek(e,r.start,r.length,function(t){if(em(t))return fa.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode;if(e.externalModuleIndicator)return fa.Invalid_use_of_0_Modules_are_automatically_in_strict_mode;return fa.Invalid_use_of_0_in_strict_mode}(t),bc(i)))}}var r}function Me(e){!D||33554432&e.flags||je(e,e.name)}function Re(t){if(n<2&&308!==a.kind&&268!==a.kind&&!c_(a)){const n=tf(e,t);e.bindDiagnostics.push(ek(e,n.start,n.length,function(t){return em(t)?fa.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode:e.externalModuleIndicator?fa.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode:fa.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5}(t)))}}function Be(t,n,...r){const i=Zp(e,t.pos);e.bindDiagnostics.push(ek(e,i.start,i.length,n,...r))}function Je(t,n,r,i){!function(t,n,r){const i=ek(e,n.pos,n.end-n.pos,r);t?e.bindDiagnostics.push(i):e.bindSuggestionDiagnostics=ae(e.bindSuggestionDiagnostics,{...i,category:2})}(t,{pos:Wd(n,e),end:r.end},i)}function ze(t){if(!t)return;IT(t,r),Gn&&(t.tracingPath=e.path);const n=D;if(We(t),t.kind>166){const e=r;r=t;const n=_B(t);0===n?$(t):function(e,t){const n=i,r=o,s=a,c=T;if(220===e.kind&&242!==e.body.kind&&(T=!0),1&t?(220!==e.kind&&(o=i),i=a=e,32&t&&(i.locals=Zu(),Fe(i))):2&t&&(a=e,32&t&&(a.locals=void 0)),4&t){const n=u,r=f,i=m,o=g,a=v,s=k,c=S,l=16&t&&!Av(e,1024)&&!e.asteriskToken&&!!lm(e)||176===e.kind;l||(u=iB(2,void 0,void 0),144&t&&(u.node=e)),g=l||177===e.kind||Om(e)&&(263===e.kind||219===e.kind)?te():void 0,v=void 0,f=void 0,m=void 0,k=void 0,S=!1,$(e),e.flags&=-5633,!(1&u.flags)&&8&t&&Ad(e.body)&&(e.flags|=512,S&&(e.flags|=1024),e.endFlowNode=u),308===e.kind&&(e.flags|=N,e.endFlowNode=u),g&&(oe(g,u),u=de(g),(177===e.kind||176===e.kind||Om(e)&&(263===e.kind||219===e.kind))&&(e.returnFlowNode=u)),l||(u=n),f=r,m=i,g=o,v=a,k=s,S=c}else 64&t?(l=!1,$(e),pn.assertNotNode(e,uD),e.flags=l?256|e.flags:-257&e.flags):$(e);T=c,i=n,o=r,a=s}(t,n),r=e}else{const e=r;1===t.kind&&(r=t),qe(t),r=e}D=n}function qe(e){if(Au(e))if(Om(e))for(const t of e.jsDoc)ze(t);else for(const t of e.jsDoc)IT(t,e),OT(t,!1)}function Ue(e){if(!D)for(const t of e){if(!hf(t))return;if(Ve(t))return void(D=!0)}}function Ve(t){const n=Kd(e,t.expression);return'"use strict"'===n||"'use strict'"===n}function We(n){switch(n.kind){case 80:if(4096&n.flags){let e=n.parent;for(;e&&!Ag(e);)e=e.parent;Oe(e,524288,788968);break}case 110:return u&&(K_(n)||305===r.kind)&&(n.flowNode=u),Le(n);case 167:u&&wm(n)&&(n.flowNode=u);break;case 237:case 108:n.flowNode=u;break;case 81:return function(t){"#constructor"===t.escapedText&&(e.parseDiagnostics.length||e.bindDiagnostics.push(j(t,fa.constructor_is_a_reserved_word,jp(t))))}(n);case 212:case 213:const o=n;u&&Q(o)&&(o.flowNode=u),yg(o)&&function(e){110===e.expression.kind?Xe(e):lg(e)&&308===e.parent.parent.kind&&(gb(e.expression)?Ze(e,e.parent):et(e))}(o),Om(o)&&e.commonJsModuleIndicator&&ig(o)&&!uB(a,"module")&&z(e.locals,void 0,o.expression,134217729,111550);break;case 227:switch(og(n)){case 1:Ke(n);break;case 2:!function(t){if(!He(t))return;const n=tg(t.right);if(kb(n)||i===e&&lB(e,n))return;if(gF(n)&&b(n.properties,lP))return void p(n.properties,Ge);const r=vh(t)?2097152:1049092,o=z(e.symbol.exports,e.symbol,t,67108864|r,0);vg(o,t)}(n);break;case 3:Ze(n.left,n);break;case 6:!function(e){IT(e.left,e),IT(e.right,e),st(e.left.expression,e.left,!1,!0)}(n);break;case 4:Xe(n);break;case 5:const t=n.left.expression;if(Om(n)&&uD(t)){const e=uB(a,t.escapedText);if(dm(null==e?void 0:e.valueDeclaration)){Xe(n);break}}!function(t){var n;const r=ct(t.left.expression,a)||ct(t.left.expression,i);if(!Om(t)&&!bg(r))return;const o=Px(t.left);if(uD(o)&&2097152&(null==(n=uB(i,o.escapedText))?void 0:n.flags))return;if(IT(t.left,t),IT(t.right,t),uD(t.left.expression)&&i===e&&lB(e,t.left.expression))Ke(t);else if(qh(t)){Ie(t,67108868,"__computed");Ye(t,nt(r,t.left.expression,at(t.left),!1,!1))}else et(it(t.left,ug))}(n);break;case 0:break;default:pn.fail("Unknown binary expression special property assignment kind")}return function(e){D&&q_(e.left)&&ob(e.operatorToken.kind)&&je(e,e.left)}(n);case 300:return function(e){D&&e.variableDeclaration&&je(e,e.variableDeclaration.name)}(n);case 221:return function(t){if(D&&80===t.expression.kind){const n=tf(e,t.expression);e.bindDiagnostics.push(ek(e,n.start,n.length,fa.delete_cannot_be_called_on_an_identifier_in_strict_mode))}}(n);case 226:return function(e){D&&je(e,e.operand)}(n);case 225:return function(e){D&&(46!==e.operator&&47!==e.operator||je(e,e.operand))}(n);case 255:return function(e){D&&Be(e,fa.with_statements_are_not_allowed_in_strict_mode)}(n);case 257:return function(e){D&&Sk(t)>=2&&(mu(e.statement)||XF(e.statement))&&Be(e.label,fa.A_label_is_not_allowed_here)}(n);case 198:return void(l=!0);case 183:break;case 169:return function(e){if(KP(e.parent)){const t=Vg(e.parent);t?(pn.assertNode(t,uu),t.locals??(t.locals=Zu()),z(t.locals,void 0,e,262144,526824)):Ee(e,262144,526824)}else if(196===e.parent.kind){const t=function(e){const t=mc(e,e=>e.parent&&tF(e.parent)&&e.parent.extendsType===e);return t&&t.parent}(e.parent);t?(pn.assertNode(t,uu),t.locals??(t.locals=Zu()),z(t.locals,void 0,e,262144,526824)):Ie(e,262144,B(e))}else Ee(e,262144,526824)}(n);case 170:return ut(n);case 261:return _t(n);case 209:return n.flowNode=u,_t(n);case 173:case 172:return function(e){const t=h_(e),n=t?13247:0;return dt(e,(t?98304:4)|(e.questionToken?16777216:0),n)}(n);case 304:case 305:return dt(n,4,0);case 307:return dt(n,8,900095);case 180:case 181:case 182:return Ee(n,131072,0);case 175:case 174:return dt(n,8192|(n.questionToken?16777216:0),Vf(n)?0:103359);case 263:return function(t){e.isDeclarationFile||33554432&t.flags||Bh(t)&&(N|=4096);Me(t),D?(Re(t),Oe(t,16,110991)):Ee(t,16,110991)}(n);case 177:return Ee(n,16384,0);case 178:return dt(n,32768,46015);case 179:return dt(n,65536,78783);case 185:case 318:case 324:case 186:return function(e){const t=M(131072,B(e));R(t,e,131072);const n=M(2048,"__type");R(n,e,2048),n.members=Zu(),n.members.set(t.escapedName,t)}(n);case 188:case 323:case 201:return function(e){return Ie(e,2048,"__type")}(n);case 333:return function(e){W(e);const t=$g(e);t&&175!==t.kind&&R(t.symbol,t,32)}(n);case 211:return function(e){return Ie(e,4096,"__object")}(n);case 219:case 220:return function(t){e.isDeclarationFile||33554432&t.flags||Bh(t)&&(N|=4096);u&&(t.flowNode=u);Me(t);const n=t.name?t.name.escapedText:"__function";return Ie(t,16,n)}(n);case 214:switch(og(n)){case 7:return function(e){let t=ct(e.arguments[0]);const n=308===e.parent.parent.kind;t=nt(t,e.arguments[0],n,!1,!1),ot(e,t,!1)}(n);case 8:return function(e){if(!He(e))return;const t=lt(e.arguments[0],void 0,(e,t)=>(t&&R(t,e,67110400),t));if(t){const n=1048580;z(t.exports,t,e,n,0)}}(n);case 9:return function(e){const t=ct(e.arguments[0].expression);t&&t.valueDeclaration&&R(t,t.valueDeclaration,32);ot(e,t,!0)}(n);case 0:break;default:return pn.fail("Unknown call expression assignment declaration kind")}Om(n)&&function(t){!e.commonJsModuleIndicator&&Bm(t,!1)&&He(t)}(n);break;case 232:case 264:return D=!0,function(t){if(264===t.kind)Oe(t,32,899503);else{Ie(t,32,t.name?t.name.escapedText:"__class"),t.name&&E.add(t.name.escapedText)}const{symbol:n}=t,r=M(4194308,"prototype"),i=n.exports.get(r.escapedName);i&&(t.name&&IT(t.name,t),e.bindDiagnostics.push(j(i.declarations[0],fa.Duplicate_identifier_0,kc(r))));n.exports.set(r.escapedName,r),r.parent=n}(n);case 265:return Oe(n,64,788872);case 266:return Oe(n,524288,788968);case 267:return function(e){return af(e)?Oe(e,128,899967):Oe(e,256,899327)}(n);case 268:return function(t){if(Pe(t),dp(t))if(Av(t,32)&&Be(t,fa.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible),vp(t))Ae(t);else{let n;if(11===t.name.kind){const{text:e}=t.name;n=YS(e),void 0===n&&Be(t.name,fa.Pattern_0_can_have_at_most_one_Asterisk_character,e)}const r=Ee(t,512,110735);e.patternAmbientModules=ae(e.patternAmbientModules,n&&!tt(n)?{pattern:n,symbol:r}:void 0)}else{const e=Ae(t);if(0!==e){const{symbol:n}=t;n.constEnumOnlyModule=!(304&n.flags)&&2===e&&!1!==n.constEnumOnlyModule}}}(n);case 293:return function(e){return Ie(e,4096,"__jsxAttributes")}(n);case 292:return function(e,t,n){return Ee(e,t,n)}(n,4,0);case 272:case 275:case 277:case 282:return Ee(n,2097152,2097152);case 271:return function(t){H(t.modifiers)&&e.bindDiagnostics.push(j(t,fa.Modifiers_cannot_appear_here));const n=dP(t.parent)?uO(t.parent)?t.parent.isDeclarationFile?void 0:fa.Global_module_exports_may_only_appear_in_declaration_files:fa.Global_module_exports_may_only_appear_in_module_files:fa.Global_module_exports_may_only_appear_at_top_level;n?e.bindDiagnostics.push(j(t,n)):(e.symbol.globalExports=e.symbol.globalExports||Zu(),z(e.symbol.globalExports,e.symbol,t,2097152,2097152))}(n);case 274:return function(e){e.name&&Ee(e,2097152,2097152)}(n);case 279:return function(e){i.symbol&&i.symbol.exports?e.exportClause?OE(e.exportClause)&&(IT(e.exportClause,e),z(i.symbol.exports,i.symbol,e.exportClause,2097152,2097152)):z(i.symbol.exports,i.symbol,e,8388608,0):Ie(e,8388608,B(e))}(n);case 278:return function(e){if(i.symbol&&i.symbol.exports){const t=vh(e)?2097152:4,n=z(i.symbol.exports,i.symbol,e,t,-1);e.isExportEquals&&vg(n,e)}else Ie(e,111551,B(e))}(n);case 308:return Ue(n.statements),function(){if(Pe(e),uO(e))$e();else if(of(e)){$e();const t=e.symbol;z(e.symbol.exports,e.symbol,e,4,-1),e.symbol=t}}();case 242:if(!c_(n.parent))return;case 269:return Ue(n.statements);case 342:if(324===n.parent.kind)return ut(n);if(323!==n.parent.kind)break;case 349:const s=n;return Ee(s,s.isBracketed||s.typeExpression&&317===s.typeExpression.type.kind?16777220:4,0);case 347:case 339:case 341:return(c||(c=[])).push(n);case 340:return ze(n.typeExpression);case 352:return(_||(_=[])).push(n)}}function $e(){Ie(e,512,`"${KS(e.fileName)}"`)}function He(t){return(!e.externalModuleIndicator||!0===e.externalModuleIndicator)&&(e.commonJsModuleIndicator||(e.commonJsModuleIndicator=t,e.externalModuleIndicator||$e()),!0)}function Ke(e){if(!He(e))return;const t=lt(e.left.expression,void 0,(e,t)=>(t&&R(t,e,67110400),t));if(t){const n=yh(e.right)&&(ng(e.left.expression)||ig(e.left.expression))?2097152:1048580;IT(e.left,e),z(t.exports,t,e.left,n,0)}}function Ge(t){z(e.symbol.exports,e.symbol,t,69206016,0)}function Xe(e){pn.assert(Om(e));if(AF(e)&&hF(e.left)&&dD(e.left.name)||hF(e)&&dD(e.name))return;const t=im(e,!1,!1);switch(t.kind){case 263:case 219:let n=t.symbol;if(AF(t.parent)&&64===t.parent.operatorToken.kind){const e=t.parent.left;lg(e)&&gb(e.expression)&&(n=ct(e.expression.expression,o))}n&&n.valueDeclaration&&(n.members=n.members||Zu(),qh(e)?Qe(e,n,n.members):z(n.members,n,e,67108868,0),R(n,n.valueDeclaration,32));break;case 177:case 173:case 175:case 178:case 179:case 176:const r=t.parent,i=Iv(t)?r.symbol.exports:r.symbol.members;qh(e)?Qe(e,r.symbol,i):z(i,r.symbol,e,67108868,0,!0);break;case 308:if(qh(e))break;t.commonJsModuleIndicator?z(t.symbol.exports,t.symbol,e,1048580,0):Ee(e,1,111550);break;case 268:break;default:pn.failBadSyntaxKind(t)}}function Qe(e,t,n){z(n,t,e,4,0,!0,!0),Ye(e,t)}function Ye(e,t){t&&(t.assignmentDeclarationMembers||(t.assignmentDeclarationMembers=new Map)).set(_J(e),e)}function Ze(e,t){const n=e.expression,r=n.expression;IT(r,n),IT(n,e),IT(e,t),st(r,e,!0,!0)}function et(e){pn.assert(!uD(e)),IT(e.expression,e),st(e.expression,e,!1,!1)}function nt(t,n,r,i,o){if(2097152&(null==t?void 0:t.flags))return t;if(r&&!i){const r=67110400,i=110735;t=lt(n,t,(t,n,o)=>{if(n)return R(n,t,r),n;return z(o?o.exports:e.jsGlobalAugmentations||(e.jsGlobalAugmentations=Zu()),o,t,r,i)})}return o&&t&&t.valueDeclaration&&R(t,t.valueDeclaration,32),t}function ot(e,t,n){if(!t||!function(e){if(1072&e.flags)return!0;const t=e.valueDeclaration;if(t&&vF(t))return!!Xm(t);let n=t?fE(t)?t.initializer:AF(t)?t.right:hF(t)&&AF(t.parent)?t.parent.right:void 0:void 0;if(n=n&&tg(n),n){const e=gb(fE(t)?t.name:AF(t)?t.left:t);return!!Qm(!AF(n)||57!==n.operatorToken.kind&&61!==n.operatorToken.kind?n:n.right,e)}return!1}(t))return;const r=n?t.members||(t.members=Zu()):t.exports||(t.exports=Zu());let i=0,o=0;l_(Xm(e))?(i=8192,o=103359):vF(e)&&ag(e)&&(H(e.arguments[2].properties,e=>{const t=Fc(e);return!!t&&uD(t)&&"set"===bc(t)})&&(i|=65540,o|=78783),H(e.arguments[2].properties,e=>{const t=Fc(e);return!!t&&uD(t)&&"get"===bc(t)})&&(i|=32772,o|=46015)),0===i&&(i=4,o=0),z(r,t,e,67108864|i,-67108865&o)}function at(e){return AF(e.parent)?308===function(e){for(;AF(e.parent);)e=e.parent;return e.parent}(e.parent).parent.kind:308===e.parent.parent.kind}function st(e,t,n,r){let o=ct(e,a)||ct(e,i);const s=at(t);o=nt(o,t.expression,s,n,r),ot(t,o,n)}function ct(e,t=i){if(uD(e))return uB(t,e.escapedText);{const t=ct(e.expression);return t&&t.exports&&t.exports.get(fg(e))}}function lt(t,n,r){if(lB(e,t))return e.symbol;if(uD(t))return r(t,ct(t),n);{const e=lt(t.expression,n,r),i=dg(t);return dD(i)&&pn.fail("unexpected PrivateIdentifier"),r(i,e&&e.exports&&e.exports.get(fg(t)),e)}}function _t(e){if(D&&je(e,e.name),!w_(e.name)){const t=261===e.kind?e:e.parent.parent;!Om(e)||!zm(t)||ol(e)||32&cc(e)?_p(e)?Oe(e,2,111551):ty(e)?Ee(e,1,111551):Ee(e,1,111550):Ee(e,2097152,2097152)}}function ut(e){if((342!==e.kind||324===i.kind)&&(!D||33554432&e.flags||je(e,e.name),w_(e.name)?Ie(e,1,"__"+e.parent.parameters.indexOf(e)):Ee(e,1,111551),rc(e,e.parent))){const t=e.parent.parent;z(t.symbol.members,t.symbol,e,4|(e.questionToken?16777216:0),0)}}function dt(t,n,r){return e.isDeclarationFile||33554432&t.flags||!Bh(t)||(N|=4096),u&&Wf(t)&&(t.flowNode=u),qh(t)?Ie(t,n,"__computed"):Ee(t,n,r)}}function cB(e,t){return 267===e.kind&&(!af(e)||Ok(t))}function lB(e,t){let n=0;const r=Qe();for(r.enqueue(t);!r.isEmpty()&&n<100;){if(n++,ng(t=r.dequeue())||ig(t))return!0;if(uD(t)){const n=uB(e,t.escapedText);if(n&&n.valueDeclaration&&fE(n.valueDeclaration)&&n.valueDeclaration.initializer){const e=n.valueDeclaration.initializer;r.enqueue(e),cb(e,!0)&&(r.enqueue(e.left),r.enqueue(e.right))}}}return!1}function _B(e){switch(e.kind){case 232:case 264:case 267:case 211:case 188:case 323:case 293:return 1;case 265:return 65;case 268:case 266:case 201:case 182:return 33;case 308:return 37;case 178:case 179:case 175:if(Wf(e))return 173;case 177:case 263:case 174:case 180:case 324:case 318:case 185:case 181:case 186:case 176:return 45;case 352:return 37;case 219:case 220:return 61;case 269:return 4;case 173:return e.initializer?4:0;case 300:case 249:case 250:case 251:case 270:return 34;case 242:return s_(e.parent)||LD(e.parent)?0:34}return 0}function uB(e,t){var n,r,i,o;const a=null==(r=null==(n=rt(e,uu))?void 0:n.locals)?void 0:r.get(t);return a?a.exportSymbol??a:dP(e)&&e.jsGlobalAugmentations&&e.jsGlobalAugmentations.has(t)?e.jsGlobalAugmentations.get(t):_u(e)?null==(o=null==(i=e.symbol)?void 0:i.exports)?void 0:o.get(t):void 0}function dB(e,t,n,r,i,o,a,s,c,l){return function(_=()=>!0){const u=[],d=[];return{walkType:e=>{try{return f(e),{visitedTypes:Oe(u),visitedSymbols:Oe(d)}}finally{E(u),E(d)}},walkSymbol:e=>{try{return h(e),{visitedTypes:Oe(u),visitedSymbols:Oe(d)}}finally{E(u),E(d)}}};function f(e){if(!e)return;if(u[e.id])return;u[e.id]=e;if(!h(e.symbol)){if(524288&e.flags){const n=e,i=n.objectFlags;4&i&&function(e){f(e.target),p(l(e),f)}(e),32&i&&function(e){f(e.typeParameter),f(e.constraintType),f(e.templateType),f(e.modifiersType)}(e),3&i&&(g(t=e),p(t.typeParameters,f),p(r(t),f),f(t.thisType)),24&i&&g(n)}var t;262144&e.flags&&function(e){f(s(e))}(e),3145728&e.flags&&function(e){p(e.types,f)}(e),4194304&e.flags&&function(e){f(e.type)}(e),8388608&e.flags&&function(e){f(e.objectType),f(e.indexType),f(e.constraint)}(e)}}function m(r){const i=t(r);i&&f(i.type),p(r.typeParameters,f);for(const e of r.parameters)h(e);f(e(r)),f(n(r))}function g(e){const t=i(e);for(const e of t.indexInfos)f(e.keyType),f(e.type);for(const e of t.callSignatures)m(e);for(const e of t.constructSignatures)m(e);for(const e of t.properties)h(e)}function h(e){if(!e)return!1;const t=uJ(e);if(d[t])return!1;if(d[t]=e,!_(e))return!0;return f(o(e)),e.exports&&e.exports.forEach(h),p(e.declarations,e=>{if(e.type&&187===e.type.kind){const t=e.type;h(a(c(t.exprName)))}}),!1}}}var pB={};o(pB,{RelativePreference:()=>mB,countPathComponents:()=>FB,forEachFileNameOfModule:()=>AB,getLocalModuleSpecifierBetweenFileNames:()=>CB,getModuleSpecifier:()=>yB,getModuleSpecifierPreferences:()=>gB,getModuleSpecifiers:()=>SB,getModuleSpecifiersWithCacheInfo:()=>TB,getNodeModulesPackageName:()=>vB,tryGetJSExtensionForFile:()=>UB,tryGetModuleSpecifiersFromCache:()=>xB,tryGetRealFileNameForNonJsDeclarationFileName:()=>zB,updateModuleSpecifier:()=>hB});var fB=mt(e=>{try{let t=e.indexOf("/");if(0!==t)return new RegExp(e);const n=e.lastIndexOf("/");if(t===n)return new RegExp(e);for(;(t=e.indexOf("/",t+1))!==n;)if("\\"!==e[t-1])return new RegExp(e);const r=e.substring(n+1).replace(/[^iu]/g,"");return e=e.substring(1,n),new RegExp(e,r)}catch{return}}),mB=(e=>(e[e.Relative=0]="Relative",e[e.NonRelative=1]="NonRelative",e[e.Shortest=2]="Shortest",e[e.ExternalNonRelative=3]="ExternalNonRelative",e))(mB||{});function gB({importModuleSpecifierPreference:e,importModuleSpecifierEnding:t,autoImportSpecifierExcludeRegexes:n},r,i,o,a){const s=c();return{excludeRegexes:n,relativePreference:void 0!==a?Fs(a)?0:1:"relative"===e?0:"non-relative"===e?1:"project-relative"===e?3:2,getAllowedEndingsInPreferredOrder:e=>{const t=$B(o,r,i),n=e!==t?c(e):s,a=Ck(i);if(99===(e??t)&&3<=a&&a<=99)return KR(i,o.fileName)?[3,2]:[2];if(1===Ck(i))return 2===n?[2,1]:[1,2];const l=KR(i,o.fileName);switch(n){case 2:return l?[2,3,0,1]:[2,0,1];case 3:return[3,0,2,1];case 1:return l?[1,0,3,2]:[1,0,2];case 0:return l?[0,1,3,2]:[0,1,2];default:pn.assertNever(n)}}};function c(e){if(void 0!==a){if(BS(a))return 2;if(Bt(a,"/index"))return 1}return US(t,e??$B(o,r,i),i,Am(o)?o:void 0)}}function hB(e,t,n,r,i,o,a={}){const s=bB(e,t,n,r,i,gB({},i,e,t,o),{},a);if(s!==o)return s}function yB(e,t,n,r,i,o={}){return bB(e,t,n,r,i,gB({},i,e,t),{},o)}function vB(e,t,n,r,i,o={}){const a=NB(t.fileName,r);return m(IB(a,n,r,i,e,o),n=>RB(n,a,t,r,e,i,!0,o.overrideImportMode))}function bB(e,t,n,r,i,o,a,s={}){const c=NB(n,i);return m(IB(c,r,i,a,e,s),n=>RB(n,c,t,i,e,a,void 0,s.overrideImportMode))||DB(r,c,e,i,s.overrideImportMode||$B(t,i,e),o)}function xB(e,t,n,r,i={}){const o=kB(e,t,n,r,i);return o[1]&&{kind:o[0],moduleSpecifiers:o[1],computedWithoutCache:!1}}function kB(e,t,n,r,i={}){var o;const a=Td(e);if(!a)return _;const s=null==(o=n.getModuleSpecifierCache)?void 0:o.call(n),c=null==s?void 0:s.get(t.path,a.path,r,i);return[null==c?void 0:c.kind,null==c?void 0:c.moduleSpecifiers,a,null==c?void 0:c.modulePaths,s]}function SB(e,t,n,r,i,o,a={}){return TB(e,t,n,r,i,o,a,!1).moduleSpecifiers}function TB(e,t,n,r,i,o,a={},s){let c=!1;const l=function(e,t){var n;const r=null==(n=e.declarations)?void 0:n.find(e=>fp(e)&&(!yp(e)||!Fs($h(e.name))));if(r)return r.name.text;const i=J(e.declarations,e=>{var n,r,i,o;if(!xE(e))return;const a=l(e);if(!((null==(n=null==a?void 0:a.parent)?void 0:n.parent)&&kE(a.parent)&&dp(a.parent.parent)&&dP(a.parent.parent.parent)))return;const s=null==(o=null==(i=null==(r=a.parent.parent.symbol.exports)?void 0:r.get("export="))?void 0:i.valueDeclaration)?void 0:o.expression;if(!s)return;const c=t.getSymbolAtLocation(s);if(!c)return;if((2097152&(null==c?void 0:c.flags)?t.getAliasedSymbol(c):c)===e.symbol)return a.parent.parent;function l(e){for(;8&e.flags;)e=e.parent;return e}}),o=i[0];if(o)return o.name.text}(e,t);if(l)return{kind:"ambient",moduleSpecifiers:s&&wB(l,o.autoImportSpecifierExcludeRegexes)?_:[l],computedWithoutCache:c};let[u,d,f,m,g]=kB(e,r,i,o,a);if(d)return{kind:u,moduleSpecifiers:d,computedWithoutCache:c};if(!f)return{kind:void 0,moduleSpecifiers:_,computedWithoutCache:c};c=!0,m||(m=LB(NB(r.fileName,i),f.originalFileName,i,n,a));const h=function(e,t,n,r,i,o={},a){const s=NB(n.fileName,r),c=gB(i,r,t,n),l=Am(n)&&p(e,e=>p(r.getFileIncludeReasons().get(Ho(e.path,r.getCurrentDirectory(),s.getCanonicalFileName)),e=>{if(3!==e.kind||e.file!==n.path)return;const t=r.getModeForResolutionAtIndex(n,e.index),i=o.overrideImportMode??r.getDefaultResolutionModeForFile(n);if(t!==i&&void 0!==t&&void 0!==i)return;const a=iW(n,e.index).text;return 1===c.relativePreference&&So(a)?void 0:a}));if(l)return{kind:void 0,moduleSpecifiers:[l],computedWithoutCache:!0};const u=H(e,e=>e.isInNodeModules);let d,f,m,g;for(const l of e){const e=l.isInNodeModules?RB(l,s,n,r,t,i,void 0,o.overrideImportMode):void 0;if(e&&(!a||!wB(e,c.excludeRegexes))&&(d=ae(d,e),l.isRedirect))return{kind:"node_modules",moduleSpecifiers:d,computedWithoutCache:!0};const _=DB(l.path,s,t,r,o.overrideImportMode||n.impliedNodeFormat,c,l.isRedirect||!!e);!_||a&&wB(_,c.excludeRegexes)||(l.isRedirect?m=ae(m,_):To(_)?aR(_)?g=ae(g,_):f=ae(f,_):(a||!u||l.isInNodeModules)&&(g=ae(g,_)))}return(null==f?void 0:f.length)?{kind:"paths",moduleSpecifiers:f,computedWithoutCache:!0}:(null==m?void 0:m.length)?{kind:"redirect",moduleSpecifiers:m,computedWithoutCache:!0}:(null==d?void 0:d.length)?{kind:"node_modules",moduleSpecifiers:d,computedWithoutCache:!0}:{kind:"relative",moduleSpecifiers:g??_,computedWithoutCache:!0}}(m,n,r,i,o,a,s);return null==g||g.set(r.path,f.path,o,a,h.kind,m,h.moduleSpecifiers),h}function CB(e,t,n,r,i,o={}){return DB(t,NB(e.fileName,r),n,r,o.overrideImportMode??e.impliedNodeFormat,gB(i,r,n,e))}function wB(e,t){return H(t,t=>{var n;return!!(null==(n=fB(t))?void 0:n.test(e))})}function NB(e,t){e=Uo(e,t.getCurrentDirectory());const n=Ht(!t.useCaseSensitiveFileNames||t.useCaseSensitiveFileNames()),r=Ao(e);return{getCanonicalFileName:n,importingSourceFileName:e,sourceDirectory:r,canonicalSourceDirectory:n(r)}}function DB(e,t,n,r,i,{getAllowedEndingsInPreferredOrder:o,relativePreference:a,excludeRegexes:s},c){const{baseUrl:l,paths:_,rootDirs:u}=n;if(c&&!_)return;const{sourceDirectory:d,canonicalSourceDirectory:f,getCanonicalFileName:m}=t,g=o(i),h=u&&function(e,t,n,r,i,o){const a=BB(t,e,r);if(void 0===a)return;const s=BB(n,e,r),c=L(s,e=>P(a,t=>Xo(sa(e,t,r)))),l=Tt(c,$S);if(!l)return;return JB(l,i,o)}(u,e,d,m,g,n)||JB(Xo(sa(d,e,m)),g,n);if(!l&&!_&&!Pk(n)||0===a)return c?void 0:h;const y=Uo(Yy(n,r)||l,r.getCurrentDirectory()),v=VB(e,y,m);if(!v)return c?void 0:h;const b=c?void 0:function(e,t,n,r,i,o){var a,s,c;if(!r.readFile||!Pk(n))return;const l=PB(r,t);if(!l)return;const _=Jo(l,"package.json"),u=null==(s=null==(a=r.getPackageJsonInfoCache)?void 0:a.call(r))?void 0:s.getPackageJsonInfo(_);if(PM(u)||!r.fileExists(_))return;const d=(null==u?void 0:u.contents.packageJsonContent)||Ab(r.readFile(_)),f=null==d?void 0:d.imports;if(!f)return;const m=NM(n,i);return null==(c=p(Ae(f),t=>{if(!Qt(t,"#")||"#"===t||Qt(t,"#/"))return;const i=Bt(t,"/")?1:t.includes("*")?2:0;return MB(n,r,e,l,t,f[t],m,i,!0,o)}))?void 0:c.moduleFileToTry}(e,d,n,r,i,function(e){const t=e.indexOf(3);return t>-1&&te.fileExists(Jo(t,"package.json"))?t:void 0)}function AB(e,t,n,r,i){var o,a;const s=zy(n),c=n.getCurrentDirectory(),l=n.isSourceOfProjectReferenceRedirect(t)?null==(o=n.getRedirectFromSourceFile(t))?void 0:o.outputDts:void 0,u=Ho(t,c,s),d=n.redirectTargetsMap.get(u)||_,f=[...l?[l]:_,t,...d].map(e=>Uo(e,c));let m=!b(f,RT);if(!r){const e=p(f,e=>!(m&&RT(e))&&i(e,l===e));if(e)return e}const g=null==(a=n.getSymlinkCache)?void 0:a.call(n).getSymlinkedDirectoriesByRealpath(),h=Uo(t,c);return g&&LR(n,Ao(h),t=>{const n=g.get(Go(Ho(t,c,s)));if(n)return!oa(e,t,s)&&p(f,e=>{if(!oa(e,t,s))return;const r=sa(t,e,s);for(const t of n){const n=zo(t,r),o=i(n,e===l);if(m=!0,o)return o}})})||(r?p(f,e=>m&&RT(e)?void 0:i(e,e===l)):void 0)}function IB(e,t,n,r,i,o={}){var a;const s=Ho(e.importingSourceFileName,n.getCurrentDirectory(),zy(n)),c=Ho(t,n.getCurrentDirectory(),zy(n)),l=null==(a=n.getModuleSpecifierCache)?void 0:a.call(n);if(l){const e=l.get(s,c,r,o);if(null==e?void 0:e.modulePaths)return e.modulePaths}const _=LB(e,t,n,i,o);return l&&l.setModulePaths(s,c,r,o,_),_}var OB=["dependencies","peerDependencies","optionalDependencies"];function LB(e,t,n,r,i){var o,a;const s=null==(o=n.getModuleResolutionCache)?void 0:o.call(n),c=null==(a=n.getSymlinkCache)?void 0:a.call(n);if(s&&c&&n.readFile&&!aR(e.importingSourceFileName)){pn.type(n);const t=vR(s.getPackageJsonInfoCache(),n,{}),o=bR(Ao(e.importingSourceFileName),t);if(o){const e=function(e){let t;for(const n of OB){const r=e[n];r&&"object"==typeof r&&(t=G(t,Ae(r)))}return t}(o.contents.packageJsonContent);for(const t of e||_){const e=HM(t,Jo(o.packageDirectory,"package.json"),r,n,s,void 0,i.overrideImportMode);c.setSymlinksFromResolution(e.resolvedModule)}}}const l=new Map;let u=!1;AB(e.importingSourceFileName,t,n,!0,(t,n)=>{const r=aR(t);l.set(t,{path:e.getCanonicalFileName(t),isRedirect:n,isInNodeModules:r}),u=u||r});const d=[];for(let t=e.canonicalSourceDirectory;0!==l.size;){const e=Go(t);let n;l.forEach(({path:t,isRedirect:r,isInNodeModules:i},o)=>{Qt(t,e)&&((n||(n=[])).push({path:o,isRedirect:r,isInNodeModules:i}),l.delete(o))}),n&&(n.length>1&&n.sort(EB),d.push(...n));const r=Ao(t);if(r===t)break;t=r}if(l.size){const e=je(l.entries(),([e,{isRedirect:t,isInNodeModules:n}])=>({path:e,isRedirect:t,isInNodeModules:n}));e.length>1&&e.sort(EB),d.push(...e)}return d}function jB(e,t,n,r,i,o,a){for(const o in t)for(const c of t[o]){const t=Vo(c),l=VB(t,r,i)??t,_=l.indexOf("*"),u=n.map(t=>({ending:t,value:JB(e,[t],a)}));if(aT(l)&&u.push({ending:void 0,value:e}),-1!==_){const e=l.substring(0,_),t=l.substring(_+1);for(const{ending:n,value:r}of u)if(r.length>=e.length+t.length&&Qt(r,e)&&Bt(r,t)&&s({ending:n,value:r})){const n=r.substring(e.length,r.length-t.length);if(!So(n))return hC(o,n)}}else if(H(u,e=>0!==e.ending&&l===e.value)||H(u,e=>0===e.ending&&l===e.value&&s(e)))return o}function s({ending:t,value:n}){return 0!==t||n===JB(e,[t],a,o)}}function MB(e,t,n,r,i,o,a,s,c,l){if("string"==typeof o){const a=!Jy(t),_=()=>t.getCommonSourceDirectory(),u=c&&mU(n,e,a,_),d=c&&pU(n,e,a,_),p=Uo(Jo(r,o),void 0),f=JS(n)?KS(n)+UB(n,e):void 0,m=l&&zS(n);switch(s){case 0:if(f&&0===ra(f,p,a)||0===ra(n,p,a)||u&&0===ra(u,p,a)||d&&0===ra(d,p,a))return{moduleFileToTry:i};break;case 1:if(m&&ia(n,p,a)){const e=sa(p,n,!1);return{moduleFileToTry:Uo(Jo(Jo(i,o),e),void 0)}}if(f&&ia(p,f,a)){const e=sa(p,f,!1);return{moduleFileToTry:Uo(Jo(Jo(i,o),e),void 0)}}if(!m&&ia(p,n,a)){const e=sa(p,n,!1);return{moduleFileToTry:Uo(Jo(Jo(i,o),e),void 0)}}if(u&&ia(p,u,a)){const e=sa(p,u,!1);return{moduleFileToTry:Jo(i,e)}}if(d&&ia(p,d,a)){const t=Yo(sa(p,d,!1),qB(d,e));return{moduleFileToTry:Jo(i,t)}}break;case 2:const t=p.indexOf("*"),r=p.slice(0,t),s=p.slice(t+1);if(m&&Qt(n,r,a)&&Bt(n,s,a)){const e=n.slice(r.length,n.length-s.length);return{moduleFileToTry:hC(i,e)}}if(f&&Qt(f,r,a)&&Bt(f,s,a)){const e=f.slice(r.length,f.length-s.length);return{moduleFileToTry:hC(i,e)}}if(!m&&Qt(n,r,a)&&Bt(n,s,a)){const e=n.slice(r.length,n.length-s.length);return{moduleFileToTry:hC(i,e)}}if(u&&Qt(u,r,a)&&Bt(u,s,a)){const e=u.slice(r.length,u.length-s.length);return{moduleFileToTry:hC(i,e)}}if(d&&Qt(d,r,a)&&Bt(d,s,a)){const t=d.slice(r.length,d.length-s.length),n=hC(i,t),o=UB(d,e);return o?{moduleFileToTry:Yo(n,o)}:void 0}}}else{if(Array.isArray(o))return p(o,o=>MB(e,t,n,r,i,o,a,s,c,l));if("object"==typeof o&&null!==o)for(const _ of Ae(o))if("default"===_||a.indexOf(_)>=0||AR(a,_)){const u=o[_],d=MB(e,t,n,r,i,u,a,s,c,l);if(d)return d}}}function RB({path:e,isRedirect:t},{getCanonicalFileName:n,canonicalSourceDirectory:r},i,o,a,s,c,l){if(!o.fileExists||!o.readFile)return;const _=KT(e);if(!_)return;const u=gB(s,o,a,i).getAllowedEndingsInPreferredOrder();let d=e,f=!1;if(!c){let t,n=_.packageRootIndex;for(;;){const{moduleFileToTry:r,packageRootPath:i,blockedByExports:s,verbatimFromExports:c}=v(n);if(1!==Ck(a)){if(s)return;if(c)return r}if(i){d=i,f=!0;break}if(t||(t=r),n=e.indexOf(fo,n+1),-1===n){d=JB(t,u,a,o);break}}}if(t&&!f)return;const m=o.getGlobalTypingsCacheLocation&&o.getGlobalTypingsCacheLocation(),g=n(d.substring(0,_.topLevelNodeModulesIndex));if(!(Qt(r,g)||m&&Qt(n(m),g)))return;const h=d.substring(_.topLevelPackageNameIndex+1),y=UR(h);return 1===Ck(a)&&y===h?void 0:y;function v(t){var r,s;const c=e.substring(0,t),d=Jo(c,"package.json");let f=e,m=!1;const g=null==(s=null==(r=o.getPackageJsonInfoCache)?void 0:r.call(o))?void 0:s.getPackageJsonInfo(d);if(EM(g)||void 0===g&&o.fileExists(d)){const t=(null==g?void 0:g.contents.packageJsonContent)||Ab(o.readFile(d)),r=l||$B(i,o,a);if(Ek(a)){const n=UR(c.substring(_.topLevelPackageNameIndex+1)),i=NM(a,r),s=(null==t?void 0:t.exports)?function(e,t,n,r,i,o,a){return"object"==typeof o&&null!==o&&!Array.isArray(o)&&NR(o)?p(Ae(o),s=>{const c=Uo(Jo(i,s),void 0),l=Bt(s,"/")?1:s.includes("*")?2:0;return MB(e,t,n,r,c,o[s],a,l,!1,!1)}):MB(e,t,n,r,i,o,a,0,!1,!1)}(a,o,e,c,n,t.exports,i):void 0;if(s)return{...s,verbatimFromExports:!0};if(null==t?void 0:t.exports)return{moduleFileToTry:e,blockedByExports:!0}}const s=(null==t?void 0:t.typesVersions)?vM(t.typesVersions):void 0;if(s){const t=jB(e.slice(c.length+1),s.paths,u,c,n,o,a);void 0===t?m=!0:f=Jo(c,t)}const h=(null==t?void 0:t.typings)||(null==t?void 0:t.types)||(null==t?void 0:t.main)||"index.js";if(tt(h)&&(!m||!lT(eT(s.paths),h))){const e=Ho(h,c,n),r=n(f);if(KS(e)===KS(r))return{packageRootPath:c,moduleFileToTry:f};if("module"!==(null==t?void 0:t.type)&&!No(r,jS)&&Qt(r,e)&&Ao(r)===Ko(e)&&"index"===KS(Io(r)))return{packageRootPath:c,moduleFileToTry:f}}}else{const e=n(f.substring(_.packageRootIndex+1));if("index.d.ts"===e||"index.js"===e||"index.ts"===e||"index.tsx"===e)return{moduleFileToTry:f,packageRootPath:c}}return{moduleFileToTry:f}}}function BB(e,t,n){return J(t,t=>{const r=VB(e,t,n);return void 0!==r&&WB(r)?void 0:r})}function JB(e,t,n,r){if(No(e,[".json",".mjs",".cjs"]))return e;const i=KS(e);if(e===i)return e;const o=t.indexOf(2),a=t.indexOf(3);if(No(e,[".mts",".cts"])&&-1!==a&&a0===e||1===e);return-1!==r&&r(e[e.None=0]="None",e[e.TypeofEQString=1]="TypeofEQString",e[e.TypeofEQNumber=2]="TypeofEQNumber",e[e.TypeofEQBigInt=4]="TypeofEQBigInt",e[e.TypeofEQBoolean=8]="TypeofEQBoolean",e[e.TypeofEQSymbol=16]="TypeofEQSymbol",e[e.TypeofEQObject=32]="TypeofEQObject",e[e.TypeofEQFunction=64]="TypeofEQFunction",e[e.TypeofEQHostObject=128]="TypeofEQHostObject",e[e.TypeofNEString=256]="TypeofNEString",e[e.TypeofNENumber=512]="TypeofNENumber",e[e.TypeofNEBigInt=1024]="TypeofNEBigInt",e[e.TypeofNEBoolean=2048]="TypeofNEBoolean",e[e.TypeofNESymbol=4096]="TypeofNESymbol",e[e.TypeofNEObject=8192]="TypeofNEObject",e[e.TypeofNEFunction=16384]="TypeofNEFunction",e[e.TypeofNEHostObject=32768]="TypeofNEHostObject",e[e.EQUndefined=65536]="EQUndefined",e[e.EQNull=131072]="EQNull",e[e.EQUndefinedOrNull=262144]="EQUndefinedOrNull",e[e.NEUndefined=524288]="NEUndefined",e[e.NENull=1048576]="NENull",e[e.NEUndefinedOrNull=2097152]="NEUndefinedOrNull",e[e.Truthy=4194304]="Truthy",e[e.Falsy=8388608]="Falsy",e[e.IsUndefined=16777216]="IsUndefined",e[e.IsNull=33554432]="IsNull",e[e.IsUndefinedOrNull=50331648]="IsUndefinedOrNull",e[e.All=134217727]="All",e[e.BaseStringStrictFacts=3735041]="BaseStringStrictFacts",e[e.BaseStringFacts=12582401]="BaseStringFacts",e[e.StringStrictFacts=16317953]="StringStrictFacts",e[e.StringFacts=16776705]="StringFacts",e[e.EmptyStringStrictFacts=12123649]="EmptyStringStrictFacts",e[e.EmptyStringFacts=12582401]="EmptyStringFacts",e[e.NonEmptyStringStrictFacts=7929345]="NonEmptyStringStrictFacts",e[e.NonEmptyStringFacts=16776705]="NonEmptyStringFacts",e[e.BaseNumberStrictFacts=3734786]="BaseNumberStrictFacts",e[e.BaseNumberFacts=12582146]="BaseNumberFacts",e[e.NumberStrictFacts=16317698]="NumberStrictFacts",e[e.NumberFacts=16776450]="NumberFacts",e[e.ZeroNumberStrictFacts=12123394]="ZeroNumberStrictFacts",e[e.ZeroNumberFacts=12582146]="ZeroNumberFacts",e[e.NonZeroNumberStrictFacts=7929090]="NonZeroNumberStrictFacts",e[e.NonZeroNumberFacts=16776450]="NonZeroNumberFacts",e[e.BaseBigIntStrictFacts=3734276]="BaseBigIntStrictFacts",e[e.BaseBigIntFacts=12581636]="BaseBigIntFacts",e[e.BigIntStrictFacts=16317188]="BigIntStrictFacts",e[e.BigIntFacts=16775940]="BigIntFacts",e[e.ZeroBigIntStrictFacts=12122884]="ZeroBigIntStrictFacts",e[e.ZeroBigIntFacts=12581636]="ZeroBigIntFacts",e[e.NonZeroBigIntStrictFacts=7928580]="NonZeroBigIntStrictFacts",e[e.NonZeroBigIntFacts=16775940]="NonZeroBigIntFacts",e[e.BaseBooleanStrictFacts=3733256]="BaseBooleanStrictFacts",e[e.BaseBooleanFacts=12580616]="BaseBooleanFacts",e[e.BooleanStrictFacts=16316168]="BooleanStrictFacts",e[e.BooleanFacts=16774920]="BooleanFacts",e[e.FalseStrictFacts=12121864]="FalseStrictFacts",e[e.FalseFacts=12580616]="FalseFacts",e[e.TrueStrictFacts=7927560]="TrueStrictFacts",e[e.TrueFacts=16774920]="TrueFacts",e[e.SymbolStrictFacts=7925520]="SymbolStrictFacts",e[e.SymbolFacts=16772880]="SymbolFacts",e[e.ObjectStrictFacts=7888800]="ObjectStrictFacts",e[e.ObjectFacts=16736160]="ObjectFacts",e[e.FunctionStrictFacts=7880640]="FunctionStrictFacts",e[e.FunctionFacts=16728e3]="FunctionFacts",e[e.VoidFacts=9830144]="VoidFacts",e[e.UndefinedFacts=26607360]="UndefinedFacts",e[e.NullFacts=42917664]="NullFacts",e[e.EmptyObjectStrictFacts=83427327]="EmptyObjectStrictFacts",e[e.EmptyObjectFacts=83886079]="EmptyObjectFacts",e[e.UnknownFacts=83886079]="UnknownFacts",e[e.AllTypeofNE=556800]="AllTypeofNE",e[e.OrFactsMask=8256]="OrFactsMask",e[e.AndFactsMask=134209471]="AndFactsMask",e))(nJ||{}),rJ=new Map(Object.entries({string:256,number:512,bigint:1024,boolean:2048,symbol:4096,undefined:524288,object:8192,function:16384})),iJ=(e=>(e[e.Normal=0]="Normal",e[e.Contextual=1]="Contextual",e[e.Inferential=2]="Inferential",e[e.SkipContextSensitive=4]="SkipContextSensitive",e[e.SkipGenericFunctions=8]="SkipGenericFunctions",e[e.IsForSignatureHelp=16]="IsForSignatureHelp",e[e.RestBindingElement=32]="RestBindingElement",e[e.TypeOnly=64]="TypeOnly",e))(iJ||{}),oJ=(e=>(e[e.None=0]="None",e[e.BivariantCallback=1]="BivariantCallback",e[e.StrictCallback=2]="StrictCallback",e[e.IgnoreReturnTypes=4]="IgnoreReturnTypes",e[e.StrictArity=8]="StrictArity",e[e.StrictTopSignature=16]="StrictTopSignature",e[e.Callback=3]="Callback",e))(oJ||{}),aJ=tn(fJ,function(e){return!g_(e)}),sJ=new Map(Object.entries({Uppercase:0,Lowercase:1,Capitalize:2,Uncapitalize:3,NoInfer:4})),cJ=class{};function lJ(){this.flags=0}function _J(e){return e.id||(e.id=ZB,ZB++),e.id}function uJ(e){return e.id||(e.id=YB,YB++),e.id}function dJ(e,t){const n=eB(e);return 1===n||t&&2===n}function pJ(e){var t,n,r,i,o=[],a=e=>{o.push(e)},s=qx.getSymbolConstructor(),c=qx.getTypeConstructor(),l=qx.getSignatureConstructor(),u=0,f=0,g=0,h=0,y=0,v=0,w=!1,F=Zu(),A=[1],j=e.getCompilerOptions(),M=Sk(j),R=Tk(j),B=!!j.experimentalDecorators,z=Rk(j),V=Hk(j),W=Fk(j),$=Wk(j,"strictNullChecks"),K=Wk(j,"strictFunctionTypes"),X=Wk(j,"strictBindCallApply"),Y=Wk(j,"strictPropertyInitialization"),ee=Wk(j,"strictBuiltinIteratorReturn"),te=Wk(j,"noImplicitAny"),ne=Wk(j,"noImplicitThis"),ie=Wk(j,"useUnknownInCatchVariables"),se=j.exactOptionalPropertyTypes,ce=!!j.noUncheckedSideEffectImports,de=function(){const e=mI(function(e,t,r){t?(t.stackIndex++,t.skip=!1,n(t,void 0),i(t,void 0)):t={checkMode:r,skip:!1,stackIndex:0,typeStack:[void 0,void 0]};if(Om(e)&&Xm(e))return t.skip=!0,i(t,WM(e.right,r)),t;!function(e){if(61!==e.operatorToken.kind)return;if(AF(e.parent)){const{left:t,operatorToken:n}=e.parent;AF(t)&&57===n.kind&&Wq(t,fa._0_and_1_operations_cannot_be_mixed_without_parentheses,Ia(61),Ia(n.kind))}else if(AF(e.left)){const{operatorToken:t}=e.left;57!==t.kind&&56!==t.kind||Wq(e.left,fa._0_and_1_operations_cannot_be_mixed_without_parentheses,Ia(t.kind),Ia(61))}else if(AF(e.right)){const{operatorToken:t}=e.right;56===t.kind&&Wq(e.right,fa._0_and_1_operations_cannot_be_mixed_without_parentheses,Ia(61),Ia(t.kind))}(function(e){const t=AA(e.left,63),n=hM(t);3!==n&&Jo(t,1===n?fa.This_expression_is_always_nullish:fa.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish)})(e),function(e){const t=AA(e.right,63),n=hM(t);if(function(e){return!AF(e.parent)||61!==e.parent.operatorToken.kind}(e))return;1===n?Jo(t,fa.This_expression_is_always_nullish):2===n&&Jo(t,fa.This_expression_is_never_nullish)}(e)}(e);if(64===e.operatorToken.kind&&(211===e.left.kind||210===e.left.kind))return t.skip=!0,i(t,fM(e.left,WM(e.right,r),r,110===e.right.kind)),t;return t},function(e,n,r){if(!n.skip)return t(n,e)},function(e,t,o){if(!t.skip){const a=r(t);pn.assertIsDefined(a),n(t,a),i(t,void 0);const s=e.kind;if(rb(s)){let e=o.parent;for(;218===e.kind||ib(e);)e=e.parent;(56===s||ZF(e))&&vB(o.left,a,ZF(e)?e.thenStatement:void 0),Zv(s)&&bB(a,o.left)}}},function(e,n,r){if(!n.skip)return t(n,e)},function(e,t){let o;if(t.skip)o=r(t);else{const n=function(e){return e.typeStack[e.stackIndex]}(t);pn.assertIsDefined(n);const i=r(t);pn.assertIsDefined(i),o=yM(e.left,e.operatorToken,e.right,n,i,t.checkMode,e)}return t.skip=!1,n(t,void 0),i(t,void 0),t.stackIndex--,o},function(e,t,n){return i(e,t),e});return(t,n)=>{const r=e(t,n);return pn.assertIsDefined(r),r};function t(e,t){if(AF(t))return t;i(e,WM(t,e.checkMode))}function n(e,t){e.typeStack[e.stackIndex]=t}function r(e){return e.typeStack[e.stackIndex+1]}function i(e,t){e.typeStack[e.stackIndex+1]=t}}(),pe={getReferencedExportContainer:jz,getReferencedImportDeclaration:Mz,getReferencedDeclarationWithCollidingName:Bz,isDeclarationWithCollidingName:Jz,isValueAliasDeclaration:e=>{const t=hc(e);return!t||!Re||zz(t)},hasGlobalName:sq,isReferencedAliasDeclaration:(e,t)=>{const n=hc(e);return!n||!Re||Wz(n,t)},hasNodeCheckFlag:(e,t)=>{const n=hc(e);return!!n&&Qz(n,t)},isTopLevelValueImportEqualsWithEntityName:qz,isDeclarationVisible:Wc,isImplementationOfOverload:$z,requiresAddingImplicitUndefined:Hz,isExpandoFunctionDeclaration:Kz,getPropertiesOfContainerFunction:Gz,createTypeOfDeclaration:rq,createReturnTypeOfSignatureDeclaration:oq,createTypeOfExpression:aq,createLiteralConstValue:dq,isSymbolAccessible:tc,isEntityNameVisible:dc,getConstantValue:e=>{const t=hc(e,Zz);return t?eq(t):void 0},getEnumMemberValue:e=>{const t=hc(e,uP);return t?Yz(t):void 0},collectLinkedAliases:$c,markLinkedReferences:e=>{const t=hc(e);return t&&xP(t,0)},getReferencedValueDeclaration:lq,getReferencedValueDeclarations:_q,getTypeReferenceSerializationKind:nq,isOptionalParameter:Og,isArgumentsLocalBinding:Lz,getExternalModuleFileFromDeclaration:e=>{const t=hc(e,Pp);return t&&gq(t)},isLiteralConstDeclaration:uq,isLateBound:e=>{const t=hc(e,fu),n=t&&Ss(t);return!!(n&&4096&cx(n))},getJsxFactoryEntity:pq,getJsxFragmentFactoryEntity:fq,isBindingCapturedByNode:(e,t)=>{const n=hc(e),r=hc(t);return!!n&&!!r&&(fE(r)||fF(r))&&function(e,t){const n=ua(e);return!!n&&C(n.capturedBlockScopeBindings,Ss(t))}(n,r)},getDeclarationStatementsForSourceFile:(e,t,n,r)=>{const i=hc(e);pn.assert(i&&308===i.kind,"Non-sourcefile node passed into getDeclarationsForSourceFile");const o=Ss(e);return o?(cs(o),o.exports?me.symbolTableToDeclarationStatements(o.exports,e,t,n,r):[]):e.locals?me.symbolTableToDeclarationStatements(e.locals,e,t,n,r):[]},isImportRequiredByAugmentation:function(e){const t=Sd(e);if(!t.symbol)return!1;const n=gq(e);if(!n)return!1;if(n===t)return!1;const r=hs(t.symbol);for(const e of je(r.values()))if(e.mergeId){const t=ks(e);if(t.declarations)for(const e of t.declarations)if(Sd(e)===n)return!0}return!1},isDefinitelyReferenceToGlobalSymbolObject:Po,createLateBoundIndexSignatures:(e,t,n,r,i)=>{const o=e.symbol,a=cg(z_(o)),s=zh(o),c=s&&oy(s,je(Fd(o).values()));let l;for(const e of[a,c])if(d(e)){l||(l=[]);for(const o of e){if(o.declaration)continue;if(o===di)continue;if(o.components&&b(o.components,e=>{var n;return!!(e.name&&ND(e.name)&&ub(e.name.expression)&&t&&0===(null==(n=dc(e.name.expression,t,!1))?void 0:n.accessibility))})){const s=D(o.components,e=>!md(e));l.push(...P(s,s=>{_(s.name.expression);const c=e===a?[bw.createModifier(126)]:void 0;return bw.createPropertyDeclaration(ae(c,o.isReadonly?bw.createModifier(148):void 0),s.name,(PD(s)||AD(s)||ID(s)||OD(s)||Pu(s)||Eu(s))&&s.questionToken?bw.createToken(58):void 0,me.typeToTypeNode(z_(s.symbol),t,n,r,i),void 0)}));continue}const s=me.indexInfoToIndexSignatureDeclaration(o,t,n,r,i);s&&e===a&&(s.modifiers||(s.modifiers=bw.createNodeArray())).unshift(bw.createModifier(126)),s&&l.push(s)}}return l;function _(e){if(!i.trackSymbol)return;const n=db(e),r=Ue(n,n.escapedText,1160127,void 0,!0);r&&i.trackSymbol(r,t,111551)}},symbolToDeclarations:(e,t,n,r,i,o)=>me.symbolToDeclarations(e,t,n,r,i,o)},me=function(){return{syntacticBuilderResolver:{evaluateEntityNameExpression:UJ,isExpandoFunctionDeclaration:Kz,hasLateBindableName:md,shouldRemoveDeclaration:(e,t)=>!(8&e.internalFlags&&ub(t.name.expression)&&1&uI(t.name).flags),createRecoveryBoundary:e=>function(e){t&&t.throwIfCancellationRequested&&t.throwIfCancellationRequested();let n,r,i=!1;const o=e.tracker,a=e.trackedSymbols;e.trackedSymbols=void 0;const s=e.encounteredError;return e.tracker=new vJ(e,{...o.inner,reportCyclicStructureError(){c(()=>o.reportCyclicStructureError())},reportInaccessibleThisError(){c(()=>o.reportInaccessibleThisError())},reportInaccessibleUniqueSymbolError(){c(()=>o.reportInaccessibleUniqueSymbolError())},reportLikelyUnsafeImportRequiredError(e){c(()=>o.reportLikelyUnsafeImportRequiredError(e))},reportNonSerializableProperty(e){c(()=>o.reportNonSerializableProperty(e))},reportPrivateInBaseOfClassExpression(e){c(()=>o.reportPrivateInBaseOfClassExpression(e))},trackSymbol:(e,t,r)=>((n??(n=[])).push([e,t,r]),!1),moduleResolverHost:e.tracker.moduleResolverHost},e.tracker.moduleResolverHost),{startRecoveryScope:l,finalizeBoundary:_,markError:c,hadError:()=>i};function c(e){i=!0,e&&(r??(r=[])).push(e)}function l(){const e=(null==n?void 0:n.length)??0,t=(null==r?void 0:r.length)??0;return()=>{i=!1,n&&(n.length=e),r&&(r.length=t)}}function _(){return e.tracker=o,e.trackedSymbols=a,e.encounteredError=s,null==r||r.forEach(e=>e()),!i&&(null==n||n.forEach(([t,n,r])=>e.tracker.trackSymbol(t,n,r)),!0)}}(e),isDefinitelyReferenceToGlobalSymbolObject:Po,getAllAccessorDeclarations:iq,requiresAddingImplicitUndefined(e,t,n){var r;switch(e.kind){case 173:case 172:case 349:t??(t=Ss(e));const i=z_(t);return!!(4&t.flags&&16777216&t.flags&&tC(e)&&(null==(r=t.links)?void 0:r.mappedType)&&function(e){const t=1048576&e.flags?e.types[0]:e;return!!(32768&t.flags)&&t!==Rt}(i));case 170:case 342:return Hz(e,n);default:pn.assertNever(e)}},isOptionalParameter:Og,isUndefinedIdentifierExpression:e=>Nz(e)===Ne,isEntityNameVisible:(e,t,n)=>dc(t,e.enclosingDeclaration,n),serializeExistingTypeNode:(e,t,r)=>function(e,t,r){const i=n(e,t);if(r&&!DF(i,e=>!!(32768&e.flags))&&Se(e,t)){const n=ke.tryReuseExistingTypeNode(e,t);if(n)return bw.createUnionTypeNode([n,bw.createKeywordTypeNode(157)])}return y(i,e)}(e,t,!!r),serializeReturnTypeForSignature(e,t,n){const r=e,i=zg(t);n??(n=Ss(t));const o=r.enclosingSymbolTypes.get(uJ(n))??CS(gh(i),r.mapper);return ve(r,i,o)},serializeTypeOfExpression(e,t){const n=e;return y(CS(Kw(Ez(t)),n.mapper),n)},serializeTypeOfDeclaration(e,t,n){var r;const i=e;n??(n=Ss(t));let o=null==(r=i.enclosingSymbolTypes)?void 0:r.get(uJ(n));void 0===o&&(o=98304&n.flags&&179===t.kind?CS(L_(n),i.mapper):!n||133120&n.flags?Et:CS(_w(z_(n)),i.mapper));return t&&(FD(t)||VP(t))&&Hz(t,i.enclosingDeclaration)&&(o=Nw(o)),ge(n,i,o)},serializeNameOfParameter:(e,t)=>V(Ss(t),t,e),serializeEntityName(e,t){const n=e,r=Nz(t,!0);if(r&&Ys(r,n.enclosingDeclaration))return ce(r,n,1160127)},serializeTypeName:(e,t,n,r)=>function(e,t,n,r){const i=n?111551:788968,o=ns(t,i,!0);if(!o)return;const a=2097152&o.flags?Ha(o):o;return 0!==tc(o,e.enclosingDeclaration,i,!1).accessibility?void 0:re(a,e,i,r)}(e,t,n,r),getJsDocPropertyOverride(e,t,r){const i=e,o=uD(r.name)?r.name:r.name.right,a=Zc(n(i,t),o.escapedText);return a&&r.typeExpression&&n(i,r.typeExpression.type)!==a?y(a,i):void 0},enterNewScope(e,t){if(s_(t)||EP(t)){const n=zg(t);return O(e,t,n.parameters,n.typeParameters)}return O(e,t,void 0,tF(t)?ak(t):[ju(Ss(t.typeParameter))])},markNodeReuse:(e,t,n)=>r(e,t,n),trackExistingEntityName:(e,t)=>be(t,e),trackComputedName(e,t){$(t,e.enclosingDeclaration,e)},getModuleSpecifierOverride(e,t,n){const r=e;if(r.bundled||r.enclosingFile!==Sd(n)){let e=n.text;const i=e,o=ua(t).resolvedSymbol,a=t.isTypeOf?111551:788968,s=o&&0===tc(o,r.enclosingDeclaration,a,!1).accessibility&&K(o,r,a,!0)[0];if(s&&td(s))e=te(s,r);else{const n=gq(t);n&&(e=te(n.symbol,r))}if(e.includes("/node_modules/")&&(r.encounteredError=!0,r.tracker.reportLikelyUnsafeImportRequiredError&&r.tracker.reportLikelyUnsafeImportRequiredError(e)),e!==i)return e}},canReuseTypeNode:(e,t)=>Se(e,t),canReuseTypeNodeAnnotation(e,t,n,r,i){var o;const a=e;if(void 0===a.enclosingDeclaration)return!1;r??(r=Ss(t));let s=null==(o=a.enclosingSymbolTypes)?void 0:o.get(uJ(r));void 0===s&&(s=98304&r.flags?179===t.kind?L_(r):C_(r):ih(t)?gh(zg(t)):z_(r));let c=Lc(n);return!!il(c)||(i&&c&&(c=Al(c,!FD(t))),!!c&&function(e,t,n){if(n===t)return!0;if(!e)return!1;if((PD(e)||AD(e))&&e.questionToken)return pD(t,524288)===n;if(FD(e)&&Fg(e))return pD(t,524288)===n;return!1}(t,s,c)&&me(n,s))}},typeToTypeNode:(e,t,n,r,i,o,a,c)=>s(t,n,r,i,o,a,t=>y(e,t),c),typePredicateToTypePredicateNode:(e,t,n,r,i)=>s(t,n,r,i,void 0,void 0,t=>z(e,t)),serializeTypeForDeclaration:(e,t,n,r,i,o)=>s(n,r,i,o,void 0,void 0,n=>ke.serializeTypeOfDeclaration(e,t,n)),serializeReturnTypeForSignature:(e,t,n,r,i)=>s(t,n,r,i,void 0,void 0,t=>ke.serializeReturnTypeForSignature(e,Ss(e),t)),serializeTypeForExpression:(e,t,n,r,i)=>s(t,n,r,i,void 0,void 0,t=>ke.serializeTypeOfExpression(e,t)),indexInfoToIndexSignatureDeclaration:(e,t,n,r,i)=>s(t,n,r,i,void 0,void 0,t=>E(e,t,void 0)),signatureToSignatureDeclaration:(e,t,n,r,i,o,a,c,l)=>s(n,r,i,o,a,c,n=>A(e,t,n),l),symbolToEntityName:(e,t,n,r,i,o)=>s(n,r,i,o,void 0,void 0,n=>se(e,n,t,!1)),symbolToExpression:(e,t,n,r,i,o)=>s(n,r,i,o,void 0,void 0,n=>ce(e,n,t)),symbolToTypeParameterDeclarations:(e,t,n,r,i)=>s(t,n,r,i,void 0,void 0,t=>Y(e,t)),symbolToParameterDeclaration:(e,t,n,r,i)=>s(t,n,r,i,void 0,void 0,t=>U(e,t)),typeParameterToDeclaration:(e,t,n,r,i,o,a,c)=>s(t,n,r,i,o,a,t=>B(e,t),c),symbolTableToDeclarationStatements:(e,t,n,r,i)=>s(t,n,r,i,void 0,void 0,t=>Te(e,t)),symbolToNode:(e,t,n,r,i,a)=>s(n,r,i,a,void 0,void 0,n=>o(e,n,t)),symbolToDeclarations:function(e,t,n,r,i,o){return J(s(void 0,n,void 0,void 0,r,i,t=>function(e,t){const n=Ru(e);t.typeStack.push(n.id),t.typeStack.push(-1);const r=Zu([e]),i=Te(r,t);return t.typeStack.pop(),t.typeStack.pop(),i}(e,t),o),n=>{switch(n.kind){case 264:return function(e,t){const n=D(t.declarations,m_),r=n&&n.length>0?n[0]:e,i=-161&Vv(r);MF(r)&&(e=bw.updateClassDeclaration(e,e.modifiers,void 0,e.typeParameters,e.heritageClauses,e.members));return bw.replaceModifiers(e,i)}(n,e);case 267:return a(n,bE,e);case 265:return function(e,t,n){if(!(64&n))return;return a(e,yE,t)}(n,e,t);case 268:return a(n,xE,e);default:return}})}};function n(e,t,n){const r=Lc(t);if(!e.mapper)return r;const i=CS(r,e.mapper);return n&&i!==r?void 0:i}function r(e,t,n){if(iy(t)&&16&t.flags&&e.enclosingFile&&e.enclosingFile===Sd(fc(t))||(t=bw.cloneNode(t)),t===n)return t;if(!n)return t;let r=t.original;for(;r&&r!==n;)r=r.original;return r||kw(t,n),e.enclosingFile&&e.enclosingFile===Sd(fc(n))?FI(t,n):t}function o(e,t,n){if(1&t.internalFlags){if(e.valueDeclaration){const t=Fc(e.valueDeclaration);if(t&&ND(t))return t}const r=_a(e).nameType;if(r&&9216&r.flags)return t.enclosingDeclaration=r.symbol.valueDeclaration,bw.createComputedPropertyName(ce(r.symbol,t,n))}return ce(e,t,n)}function a(e,t,n){const r=D(n.declarations,t),i=-161&Vv(r&&r.length>0?r[0]:e);return bw.replaceModifiers(e,i)}function s(t,n,r,i,o,a,s,c){const l=(null==i?void 0:i.trackSymbol)?i.moduleResolverHost:4&(r||0)?function(e){return{getCommonSourceDirectory:e.getCommonSourceDirectory?()=>e.getCommonSourceDirectory():()=>"",getCurrentDirectory:()=>e.getCurrentDirectory(),getSymlinkCache:He(e,e.getSymlinkCache),getPackageJsonInfoCache:()=>{var t;return null==(t=e.getPackageJsonInfoCache)?void 0:t.call(e)},useCaseSensitiveFileNames:()=>e.useCaseSensitiveFileNames(),redirectTargetsMap:e.redirectTargetsMap,getRedirectFromSourceFile:t=>e.getRedirectFromSourceFile(t),isSourceOfProjectReferenceRedirect:t=>e.isSourceOfProjectReferenceRedirect(t),fileExists:t=>e.fileExists(t),getFileIncludeReasons:()=>e.getFileIncludeReasons(),readFile:e.readFile?t=>e.readFile(t):void 0,getDefaultResolutionModeForFile:t=>e.getDefaultResolutionModeForFile(t),getModeForResolutionAtIndex:(t,n)=>e.getModeForResolutionAtIndex(t,n),getGlobalTypingsCacheLocation:He(e,e.getGlobalTypingsCacheLocation)}}(e):void 0;n=n||0;const _=o||(1&n?Gu:Ku),u={enclosingDeclaration:t,enclosingFile:t&&Sd(t),flags:n,internalFlags:r||0,tracker:void 0,maxTruncationLength:_,maxExpansionDepth:a??-1,encounteredError:!1,suppressReportInferenceFallback:!1,reportedDiagnostic:!1,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0,trackedSymbols:void 0,bundled:!!j.outFile&&!!t&&rf(Sd(t)),truncating:!1,usedSymbolNames:void 0,remappedSymbolNames:void 0,remappedSymbolReferences:void 0,reverseMappedStack:void 0,mustCreateTypeParameterSymbolList:!0,typeParameterSymbolList:void 0,mustCreateTypeParametersNamesLookups:!0,typeParameterNames:void 0,typeParameterNamesByText:void 0,typeParameterNamesByTextNextNameCount:void 0,enclosingSymbolTypes:new Map,mapper:void 0,depth:0,typeStack:[],out:{canIncreaseExpansionDepth:!1,truncated:!1}};u.tracker=new vJ(u,i,l);const d=s(u);return u.truncating&&1&u.flags&&u.tracker.reportTruncationError(),c&&(c.canIncreaseExpansionDepth=u.out.canIncreaseExpansionDepth,c.truncated=u.out.truncated),u.encounteredError?void 0:d}function c(e,t,n){const r=uJ(t),i=e.enclosingSymbolTypes.get(r);return e.enclosingSymbolTypes.set(r,n),function(){i?e.enclosingSymbolTypes.set(r,i):e.enclosingSymbolTypes.delete(r)}}function l(e){const t=e.flags,n=e.internalFlags,r=e.depth;return function(){e.flags=t,e.internalFlags=n,e.depth=r}}function u(e){return e.maxExpansionDepth>=0&&f(e)}function f(e){return e.truncating?e.truncating:e.truncating=e.approximateLength>e.maxTruncationLength}function g(e,t){for(let n=0;n0?1048576&e.flags?bw.createUnionTypeNode(n):bw.createIntersectionTypeNode(n):void(o.encounteredError||262144&o.flags||(o.encounteredError=!0))}if(48&x)return pn.assert(!!(524288&e.flags)),M(e);if(4194304&e.flags){const t=e.type;o.approximateLength+=6;const n=y(t,o);return bw.createTypeOperatorNode(143,n)}if(134217728&e.flags){const t=e.texts,n=e.types,r=bw.createTemplateHead(t[0]),i=bw.createNodeArray(P(n,(e,r)=>bw.createTemplateLiteralTypeSpan(y(e,o),(rk(e));if(33554432&e.flags){const t=y(e.baseType,o),n=Ay(e)&&Qy("NoInfer",!1);return n?re(n,o,788968,[t]):t}return pn.fail("Should be unreachable.");function k(e){const t=y(e.checkType,o);if(o.approximateLength+=15,4&o.flags&&e.root.isDistributive&&!(262144&e.checkType.flags)){const r=qs(Xo(262144,"T")),i=oe(r,o),a=bw.createTypeReferenceNode(i);o.approximateLength+=37;const s=dS(e.root.checkType,r,e.mapper),c=o.inferTypeParameters;o.inferTypeParameters=e.root.inferTypeParameters;const l=y(CS(e.root.extendsType,s),o);o.inferTypeParameters=c;const _=S(CS(n(o,e.root.node.trueType),s)),u=S(CS(n(o,e.root.node.falseType),s));return bw.createConditionalTypeNode(t,bw.createInferTypeNode(bw.createTypeParameterDeclaration(void 0,bw.cloneNode(a.typeName))),bw.createConditionalTypeNode(bw.createTypeReferenceNode(bw.cloneNode(i)),y(e.checkType,o),bw.createConditionalTypeNode(a,l,_,u),bw.createKeywordTypeNode(146)),bw.createKeywordTypeNode(146))}const r=o.inferTypeParameters;o.inferTypeParameters=e.root.inferTypeParameters;const i=y(e.extendsType,o);o.inferTypeParameters=r;const a=S(Zx(e)),s=S(rk(e));return bw.createConditionalTypeNode(t,i,a,s)}function S(e){var t,n,r;return 1048576&e.flags?(null==(t=o.visitedTypes)?void 0:t.has(Ab(e)))?(131072&o.flags||(o.encounteredError=!0,null==(r=null==(n=o.tracker)?void 0:n.reportCyclicStructureError)||r.call(n)),v(o)):B(e,e=>y(e,o)):y(e,o)}function w(e){return!!bS(e)}function L(e){return!!e.target&&w(e.target)&&!w(e)}function j(e){var t;pn.assert(!!(524288&e.flags));const r=e.declaration.readonlyToken?bw.createToken(e.declaration.readonlyToken.kind):void 0,i=e.declaration.questionToken?bw.createToken(e.declaration.questionToken.kind):void 0;let a,s,c=Tp(e);const l=vp(e),_=!wp(e)&&!(2&Np(e).flags)&&4&o.flags&&!(262144&kp(e).flags&&4194304&(null==(t=uf(kp(e)))?void 0:t.flags));if(wp(e)){if(L(e)&&4&o.flags){const t=qs(Xo(262144,"T")),n=oe(t,o),r=e.target;s=bw.createTypeReferenceNode(n),c=CS(Tp(r),oS([vp(r),Np(r)],[l,t]))}a=bw.createTypeOperatorNode(143,s||y(Np(e),o))}else if(_){const e=oe(qs(Xo(262144,"T")),o);s=bw.createTypeReferenceNode(e),a=s}else a=y(kp(e),o);const u=R(l,o,a),d=O(o,e.declaration,void 0,[ju(Ss(e.declaration.typeParameter))]),p=e.declaration.nameType?y(Sp(e),o):void 0,f=y(Iw(c,!!(4&Dp(e))),o);d();const m=bw.createMappedTypeNode(r,u,p,i,f,void 0);o.approximateLength+=10;const g=ww(m,1);if(L(e)&&4&o.flags){const t=CS(uf(n(o,e.declaration.typeParameter.constraint.type))||Ot,e.mapper);return bw.createConditionalTypeNode(y(Np(e),o),bw.createInferTypeNode(bw.createTypeParameterDeclaration(void 0,bw.cloneNode(s.typeName),2&t.flags?void 0:y(t,o))),g,bw.createKeywordTypeNode(146))}return _?bw.createConditionalTypeNode(y(kp(e),o),bw.createInferTypeNode(bw.createTypeParameterDeclaration(void 0,bw.cloneNode(s.typeName),bw.createTypeOperatorNode(143,y(Np(e),o)))),g,bw.createKeywordTypeNode(146)):g}function M(e,t=!1,r=!1){var i,a;const s=e.id,c=e.symbol;if(c){if(!!(8388608&xx(e))){const t=e.node;if($D(t)&&n(o,t)===e){const e=ke.tryReuseExistingTypeNode(o,t);if(e)return e}return(null==(i=o.visitedTypes)?void 0:i.has(s))?v(o):B(e,J)}const _=Ic(e)?788968:111551;if(ML(c.valueDeclaration))return re(c,o,_);if(!r&&(32&c.flags&&!t&&!F_(c)&&(!(c.valueDeclaration&&m_(c.valueDeclaration)&&2048&o.flags)||hE(c.valueDeclaration)&&0===tc(c,o.enclosingDeclaration,_,!1).accessibility)||896&c.flags||l())){if(!h(e,o))return re(c,o,_);o.depth+=1}if(null==(a=o.visitedTypes)?void 0:a.has(s)){const t=function(e){if(e.symbol&&2048&e.symbol.flags&&e.symbol.declarations){const t=ah(e.symbol.declarations[0].parent);if(vE(t))return Ss(t)}return}(e);return t?re(t,o,788968):v(o)}return B(e,J)}return J(e);function l(){var e;const t=!!(8192&c.flags)&&H(c.declarations,e=>Iv(e)&&!dd(Fc(e))),n=!!(16&c.flags)&&(c.parent||p(c.declarations,e=>308===e.parent.kind||269===e.parent.kind));if(t||n)return(!!(4096&o.flags)||(null==(e=o.visitedTypes)?void 0:e.has(s)))&&(!(8&o.flags)||Ys(c,o.enclosingDeclaration))}}function B(e,t){var n,i,a;const s=e.id,c=16&xx(e)&&e.symbol&&32&e.symbol.flags,l=4&xx(e)&&e.node?"N"+_J(e.node):16777216&e.flags?"N"+_J(e.root.node):e.symbol?(c?"+":"")+uJ(e.symbol):void 0;o.visitedTypes||(o.visitedTypes=new Set),l&&!o.symbolDepth&&(o.symbolDepth=new Map);const _=o.maxExpansionDepth>=0?void 0:o.enclosingDeclaration&&ua(o.enclosingDeclaration),u=`${Ab(e)}|${o.flags}|${o.internalFlags}`;_&&(_.serializedTypes||(_.serializedTypes=new Map));const d=null==(n=null==_?void 0:_.serializedTypes)?void 0:n.get(u);if(d)return null==(i=d.trackedSymbols)||i.forEach(([e,t,n])=>o.tracker.trackSymbol(e,t,n)),d.truncating&&(o.truncating=!0),o.approximateLength+=d.addedLength,y(d.node);let p;if(l){if(p=o.symbolDepth.get(l)||0,p>10)return v(o);o.symbolDepth.set(l,p+1)}o.visitedTypes.add(s);const f=o.trackedSymbols;o.trackedSymbols=void 0;const m=o.approximateLength,g=t(e),h=o.approximateLength-m;return o.reportedDiagnostic||o.encounteredError||null==(a=null==_?void 0:_.serializedTypes)||a.set(u,{node:g,truncating:o.truncating,addedLength:h,trackedSymbols:o.trackedSymbols}),o.visitedTypes.delete(s),l&&o.symbolDepth.set(l,p),o.trackedSymbols=f,g;function y(e){return iy(e)||hc(e)!==e?r(o,bw.cloneNode(EJ(e,y,void 0,b,y)),e):e}function b(e,t,n,r,i){return e&&0===e.length?FI(bw.createNodeArray(void 0,e.hasTrailingComma),e):xJ(e,t,n,r,i)}}function J(e){if(Bp(e)||e.containsError)return j(e);const t=Hp(e);if(!t.properties.length&&!t.indexInfos.length){if(!t.callSignatures.length&&!t.constructSignatures.length)return o.approximateLength+=2,ww(bw.createTypeLiteralNode(void 0),1);if(1===t.callSignatures.length&&!t.constructSignatures.length){return A(t.callSignatures[0],185,o)}if(1===t.constructSignatures.length&&!t.callSignatures.length){return A(t.constructSignatures[0],186,o)}}const n=D(t.constructSignatures,e=>!!(4&e.flags));if(H(n)){const e=P(n,Bh);return t.callSignatures.length+(t.constructSignatures.length-n.length)+t.indexInfos.length+(2048&o.flags?N(t.properties,e=>!(4194304&e.flags)):d(t.properties))&&e.push(function(e){if(0===e.constructSignatures.length)return e;if(e.objectTypeWithoutAbstractConstructSignatures)return e.objectTypeWithoutAbstractConstructSignatures;const t=D(e.constructSignatures,e=>!(4&e.flags));if(e.constructSignatures===t)return e;const n=Hs(e.symbol,e.members,e.callSignatures,H(t)?t:_,e.indexInfos);return e.objectTypeWithoutAbstractConstructSignatures=n,n.objectTypeWithoutAbstractConstructSignatures=n,n}(t)),y(Gb(e),o)}const r=l(o);o.flags|=4194304;const i=W(t);r();const a=bw.createTypeLiteralNode(i);return o.approximateLength+=2,ww(a,1024&o.flags?0:1),a}function z(e){let t=by(e);if(e.target===Zn||e.target===er){if(2&o.flags){const n=y(t[0],o);return bw.createTypeReferenceNode(e.target===Zn?"Array":"ReadonlyArray",[n])}const n=y(t[0],o),r=bw.createArrayTypeNode(n);return e.target===Zn?r:bw.createTypeOperatorNode(148,r)}if(!(8&e.target.objectFlags)){if(2048&o.flags&&e.symbol.valueDeclaration&&m_(e.symbol.valueDeclaration)&&!Ys(e.symbol,o.enclosingDeclaration))return M(e);{const n=e.target.outerTypeParameters;let r,i,a=0;if(n){const e=n.length;for(;a0){let n=0;if(e.target.typeParameters&&(n=Math.min(e.target.typeParameters.length,t.length),(W_(e,Cv(!1))||W_(e,wv(!1))||W_(e,Sv(!1))||W_(e,Tv(!1)))&&(!e.node||!UD(e.node)||!e.node.typeArguments||e.node.typeArguments.length0;){const r=t[n-1],i=wf(e.target.typeParameters[n-1]);if(!i||!OS(r,i))break;n--}i=F(t.slice(a,n),o)}const s=l(o);o.flags|=16;const c=re(e.symbol,o,788968,i);return s(),r?q(r,c):c}}if(t=I(t,(t,n)=>Iw(t,!!(2&e.target.elementFlags[n]))),t.length>0){const n=xy(e),r=F(t.slice(0,n),o);if(r){const{labeledElementDeclarations:t}=e.target;for(let n=0;n{var n;return!!(e.name&&ND(e.name)&&ub(e.name.expression)&&t.enclosingDeclaration&&0===(null==(n=dc(e.name.expression,t.enclosingDeclaration,!1))?void 0:n.accessibility))})){return P(D(e.components,e=>!md(e)),i=>($(i.name.expression,t.enclosingDeclaration,t),r(t,bw.createPropertySignature(e.isReadonly?[bw.createModifier(148)]:void 0,i.name,(PD(i)||AD(i)||ID(i)||OD(i)||Pu(i)||Eu(i))&&i.questionToken?bw.createToken(58):void 0,n||y(z_(i.symbol),t)),i)))}}return[E(e,t,n)]}function W(e){if(f(o))return o.out.truncated=!0,1&o.flags?[Uw(bw.createNotEmittedTypeElement(),3,"elided")]:[bw.createPropertySignature(void 0,"...",void 0,void 0)];o.typeStack.push(-1);const t=[];for(const n of e.callSignatures)t.push(A(n,180,o));for(const n of e.constructSignatures)4&n.flags||t.push(A(n,181,o));for(const n of e.indexInfos)t.push(...V(n,o,1024&e.objectFlags?v(o):void 0));const n=e.properties;if(!n)return o.typeStack.pop(),t;let r=0;for(const e of n)if(!(Ce(o)&&4194304&e.flags)){if(r++,2048&o.flags){if(4194304&e.flags)continue;6&lx(e)&&o.tracker.reportPrivateInBaseOfClassExpression&&o.tracker.reportPrivateInBaseOfClassExpression(vc(e.escapedName))}if(f(o)&&r+2!(32768&e.flags)),0);for(const i of r){const r=A(i,174,t,{name:s,questionToken:c});n.push(p(r,i.declaration||e.valueDeclaration))}if(r.length||!c)return}let l;k(e,t)?l=v(t):(i&&(t.reverseMappedStack||(t.reverseMappedStack=[]),t.reverseMappedStack.push(e)),l=o?he(t,void 0,o,e):bw.createKeywordTypeNode(133),i&&t.reverseMappedStack.pop());const u=Yj(e)?[bw.createToken(148)]:void 0;u&&(t.approximateLength+=9);const d=bw.createPropertySignature(u,s,c,l);function p(n,r){var i;const o=null==(i=e.declarations)?void 0:i.find(e=>349===e.kind);if(o){const e=pl(o.comment);e&&Bw(n,[{kind:3,text:"*\n * "+e.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}])}else r&&w(t,n,r);return n}n.push(p(d,e.valueDeclaration))}function w(e,t,n){return e.enclosingFile&&e.enclosingFile===Sd(n)?Mw(t,n):t}function F(e,t,n){if(H(e)){if(f(t)){if(t.out.truncated=!0,!n)return[1&t.flags?Jw(bw.createKeywordTypeNode(133),3,"elided"):bw.createTypeReferenceNode("...",void 0)];if(e.length>2)return[y(e[0],t),1&t.flags?Jw(bw.createKeywordTypeNode(133),3,`... ${e.length-2} more elided ...`):bw.createTypeReferenceNode(`... ${e.length-2} more ...`,void 0),y(e[e.length-1],t)]}const r=!(64&t.flags)?Ke():void 0,i=[];let o=0;for(const n of e){if(o++,f(t)&&o+2{if(!NT(e,([e],[t])=>function(e,t){return e===t||!!e.symbol&&e.symbol===t.symbol||!!e.aliasSymbol&&e.aliasSymbol===t.aliasSymbol}(e,t)))for(const[n,r]of e)i[r]=y(n,t)}),e()}return i}}function E(e,t,n){const r=Mp(e)||"x",i=y(e.keyType,t),o=bw.createParameterDeclaration(void 0,void 0,r,void 0,i,void 0);return n||(n=y(e.type||wt,t)),e.type||2097152&t.flags||(t.encounteredError=!0),t.approximateLength+=r.length+4,bw.createIndexSignature(e.isReadonly?[bw.createToken(148)]:void 0,[o],n)}function A(e,t,r,i){var o;let a,s;const _=Bd(e,!0)[0],u=O(r,e.declaration,_,e.typeParameters,e.parameters,e.mapper);r.approximateLength+=3,32&r.flags&&e.target&&e.mapper&&e.target.typeParameters?s=e.target.typeParameters.map(t=>y(CS(t,e.mapper),r)):a=e.typeParameters&&e.typeParameters.map(e=>B(e,r));const d=l(r);r.flags&=-257;const p=(H(_,e=>e!==_[_.length-1]&&!!(32768&cx(e)))?e.parameters:_).map(e=>U(e,r,177===t)),f=33554432&r.flags?void 0:function(e,t){if(e.thisParameter)return U(e.thisParameter,t);if(e.declaration&&Om(e.declaration)){const r=tl(e.declaration);if(r&&r.typeExpression)return bw.createParameterDeclaration(void 0,void 0,"this",void 0,y(n(t,r.typeExpression),t))}}(e,r);f&&p.unshift(f),d();const m=function(e,t){const n=256&e.flags,r=l(e);n&&(e.flags&=-257);let i;const o=gh(t);if(!n||!rl(o)){if(t.declaration&&!iy(t.declaration)&&!g(o,e)){const n=Ss(t.declaration),r=c(e,n,o);i=ke.serializeReturnTypeForSignature(t.declaration,n,e),r()}i||(i=ve(e,t,o))}i||n||(i=bw.createKeywordTypeNode(133));return r(),i}(r,e);let h=null==i?void 0:i.modifiers;if(186===t&&4&e.flags){const e=Qv(h);h=bw.createModifiersFromModifierFlags(64|e)}const v=180===t?bw.createCallSignature(a,p,m):181===t?bw.createConstructSignature(a,p,m):174===t?bw.createMethodSignature(h,(null==i?void 0:i.name)??bw.createIdentifier(""),null==i?void 0:i.questionToken,a,p,m):175===t?bw.createMethodDeclaration(h,void 0,(null==i?void 0:i.name)??bw.createIdentifier(""),void 0,a,p,m,void 0):177===t?bw.createConstructorDeclaration(h,p,void 0):178===t?bw.createGetAccessorDeclaration(h,(null==i?void 0:i.name)??bw.createIdentifier(""),p,m,void 0):179===t?bw.createSetAccessorDeclaration(h,(null==i?void 0:i.name)??bw.createIdentifier(""),p,void 0):182===t?bw.createIndexSignature(h,p,m):318===t?bw.createJSDocFunctionType(p,m):185===t?bw.createFunctionTypeNode(a,p,m??bw.createTypeReferenceNode(bw.createIdentifier(""))):186===t?bw.createConstructorTypeNode(h,a,p,m??bw.createTypeReferenceNode(bw.createIdentifier(""))):263===t?bw.createFunctionDeclaration(h,void 0,(null==i?void 0:i.name)?it(i.name,uD):bw.createIdentifier(""),a,p,m,void 0):219===t?bw.createFunctionExpression(h,void 0,(null==i?void 0:i.name)?it(i.name,uD):bw.createIdentifier(""),a,p,m,bw.createBlock([])):220===t?bw.createArrowFunction(h,a,p,m,void 0,bw.createBlock([])):pn.assertNever(t);if(s&&(v.typeArguments=bw.createNodeArray(s)),324===(null==(o=e.declaration)?void 0:o.kind)&&340===e.declaration.parent.kind){Jw(v,3,ep(e.declaration.parent.parent,!0).slice(2,-2).split(/\r\n|\n|\r/).map(e=>e.replace(/^\s+/," ")).join("\n"),!0)}return null==u||u(),v}function O(e,t,n,r,i,o){const a=de(e);let s,c;const l=e.enclosingDeclaration,u=e.mapper;if(o&&(e.mapper=o),e.enclosingDeclaration&&t){let t=function(t,n){let r;pn.assert(e.enclosingDeclaration),ua(e.enclosingDeclaration).fakeScopeForSignatureDeclaration===t?r=e.enclosingDeclaration:e.enclosingDeclaration.parent&&ua(e.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration===t&&(r=e.enclosingDeclaration.parent),pn.assertOptionalNode(r,GF);const i=(null==r?void 0:r.locals)??Zu();let o,a;if(n((e,t)=>{if(r){const t=i.get(e);t?a=ae(a,{name:e,oldSymbol:t}):o=ae(o,e)}i.set(e,t)}),r)return function(){p(o,e=>i.delete(e)),p(a,e=>i.set(e.name,e.oldSymbol))};{const n=bw.createBlock(_);ua(n).fakeScopeForSignatureDeclaration=t,n.locals=i,IT(n,e.enclosingDeclaration),e.enclosingDeclaration=n}};s=H(n)?t("params",e=>{if(n)for(let t=0;t{return FD(t)&&w_(t.name)?(n(t.name),!0):void 0;function n(t){p(t.elements,t=>{switch(t.kind){case 233:return;case 209:return function(t){if(w_(t.name))return n(t.name);const r=Ss(t);e(r.escapedName,r)}(t);default:return pn.assertNever(t)}})}})||e(r.escapedName,r)}}):void 0,4&e.flags&&H(r)&&(c=t("typeParams",t=>{for(const n of r??_){t(oe(n,e).escapedText,n.symbol)}}))}return()=>{null==s||s(),null==c||c(),a(),e.enclosingDeclaration=l,e.mapper=u}}function R(e,t,n){const r=l(t);t.flags&=-513;const i=bw.createModifiersFromModifierFlags(wC(e)),o=oe(e,t),a=wf(e),s=a&&y(a,t);return r(),bw.createTypeParameterDeclaration(i,o,n,s)}function B(e,t,r=uf(e)){const i=r&&function(e,t,r){return!g(e,r)&&t&&n(r,t)===e&&ke.tryReuseExistingTypeNode(r,t)||y(e,r)}(r,sy(e),t);return R(e,t,i)}function z(e,t){const n=2===e.kind||3===e.kind?bw.createToken(131):void 0,r=1===e.kind||3===e.kind?ww(bw.createIdentifier(e.parameterName),16777216):bw.createThisTypeNode(),i=e.type&&y(e.type,t);return bw.createTypePredicateNode(n,r,i)}function q(e){const t=Qu(e,170);return t||(ed(e)?void 0:Qu(e,342))}function U(e,t,n){const r=q(e),i=he(t,r,z_(e),e),o=!(8192&t.flags)&&n&&r&&EI(r)?P(Ac(r),bw.cloneNode):void 0,a=r&&Uu(r)||32768&cx(e)?bw.createToken(26):void 0,s=V(e,r,t),c=r&&Og(r)||16384&cx(e)?bw.createToken(58):void 0,l=bw.createParameterDeclaration(o,a,s,c,i,void 0);return t.approximateLength+=kc(e).length+3,l}function V(e,t,n){return t&&t.name?80===t.name.kind?ww(bw.cloneNode(t.name),16777216):167===t.name.kind?ww(bw.cloneNode(t.name.right),16777216):function e(t){n.tracker.canTrackSymbol&&ND(t)&&ud(t)&&$(t.expression,n.enclosingDeclaration,n);let r=EJ(t,e,void 0,void 0,e);return fF(r)&&(r=bw.updateBindingElement(r,r.dotDotDotToken,r.propertyName,r.name,void 0)),iy(r)||(r=bw.cloneNode(r)),ww(r,16777217)}(t.name):kc(e)}function $(e,t,n){if(!n.tracker.canTrackSymbol)return;const r=db(e),i=Ue(t,r.escapedText,1160127,void 0,!0);if(i)n.tracker.trackSymbol(i,t,111551);else{const e=Ue(r,r.escapedText,1160127,void 0,!0);e&&n.tracker.trackSymbol(e,t,111551)}}function K(e,t,n,r){return t.tracker.trackSymbol(e,t.enclosingDeclaration,n),X(e,t,n,r)}function X(e,t,n,r){let i;return 262144&e.flags||!(t.enclosingDeclaration||64&t.flags)||4&t.internalFlags?i=[e]:(i=pn.checkDefined(function e(n,i,o){let a,s=Xs(n,t.enclosingDeclaration,i,!!(128&t.flags));if(!s||Qs(s[0],t.enclosingDeclaration,1===s.length?i:Gs(i))){const r=Ns(s?s[0]:n,t.enclosingDeclaration,i);if(d(r)){a=r.map(e=>H(e.declarations,sc)?te(e,t):void 0);const o=r.map((e,t)=>t);o.sort(c);const l=o.map(e=>r[e]);for(const t of l){const r=e(t,Gs(i),!1);if(r){if(t.exports&&t.exports.get("export=")&&Ps(t.exports.get("export="),n)){s=r;break}s=r.concat(s||[Es(t,n)||n]);break}}}}if(s)return s;if(o||!(6144&n.flags)){if(!o&&!r&&p(n.declarations,sc))return;return[n]}function c(e,t){const n=a[e],r=a[t];if(n&&r){const e=So(r);return So(n)===e?FB(n)-FB(r):e?-1:1}return 0}}(e,n,!0)),pn.assert(i&&i.length>0)),i}function Y(e,t){let n;return 524384&jJ(e).flags&&(n=bw.createNodeArray(P(iu(e),e=>B(e,t)))),n}function Z(e,t,n){var r;pn.assert(e&&0<=t&&trS(e,o.links.mapper)),n)}else a=Y(i,n)}return a}function ee(e){return aF(e.objectType)?ee(e.objectType):e}function te(t,n,r){let i=Qu(t,308);if(!i){const e=m(t.declarations,e=>Ds(e,t));e&&(i=Qu(e,308))}if(i&&void 0!==i.moduleName)return i.moduleName;if(!i&&XB.test(t.escapedName))return t.escapedName.substring(1,t.escapedName.length-1);if(!n.enclosingFile||!n.tracker.moduleResolverHost)return XB.test(t.escapedName)?t.escapedName.substring(1,t.escapedName.length-1):Sd(bp(t)).fileName;const o=fc(n.enclosingDeclaration),a=xg(o)?kg(o):void 0,s=n.enclosingFile,c=r||a&&e.getModeForUsageLocation(s,a)||s&&e.getDefaultResolutionModeForFile(s),l=jM(s.path,c),_=_a(t);let u=_.specifierCache&&_.specifierCache.get(l);if(!u){const e=!!j.outFile,{moduleResolverHost:i}=n.tracker,o=e?{...j,baseUrl:i.getCommonSourceDirectory()}:j;u=ye(SB(t,We,o,s,i,{importModuleSpecifierPreference:e?"non-relative":"project-relative",importModuleSpecifierEnding:e?"minimal":99===c?"js":void 0},{overrideImportMode:r})),_.specifierCache??(_.specifierCache=new Map),_.specifierCache.set(l,u)}return u}function ne(e){const t=bw.createIdentifier(vc(e.escapedName));return e.parent?bw.createQualifiedName(ne(e.parent),t):t}function re(e,t,n,r){const i=K(e,t,n,!(16384&t.flags)),o=111551===n;if(H(i[0].declarations,sc)){const e=i.length>1?s(i,i.length-1,1):void 0,n=r||Z(i,0,t),a=Sd(fc(t.enclosingDeclaration)),c=Td(i[0]);let l,_;if(3!==Ck(j)&&99!==Ck(j)||99===(null==c?void 0:c.impliedNodeFormat)&&c.impliedNodeFormat!==(null==a?void 0:a.impliedNodeFormat)&&(l=te(i[0],t,99),_=bw.createImportAttributes(bw.createNodeArray([bw.createImportAttribute(bw.createStringLiteral("resolution-mode"),bw.createStringLiteral("import"))]))),l||(l=te(i[0],t)),!(67108864&t.flags)&&1!==Ck(j)&&l.includes("/node_modules/")){const e=l;if(3===Ck(j)||99===Ck(j)){const n=99===(null==a?void 0:a.impliedNodeFormat)?1:99;l=te(i[0],t,n),l.includes("/node_modules/")?l=e:_=bw.createImportAttributes(bw.createNodeArray([bw.createImportAttribute(bw.createStringLiteral("resolution-mode"),bw.createStringLiteral(99===n?"import":"require"))]))}_||(t.encounteredError=!0,t.tracker.reportLikelyUnsafeImportRequiredError&&t.tracker.reportLikelyUnsafeImportRequiredError(e))}const u=bw.createLiteralTypeNode(bw.createStringLiteral(l));if(t.approximateLength+=l.length+10,!e||i_(e)){if(e){rN(uD(e)?e:e.right,void 0)}return bw.createImportTypeNode(u,_,e,n,o)}{const t=ee(e),r=t.objectType.typeName;return bw.createIndexedAccessTypeNode(bw.createImportTypeNode(u,_,r,n,o),t.indexType)}}const a=s(i,i.length-1,0);if(aF(a))return a;if(o)return bw.createTypeQueryNode(a);{const e=uD(a)?a:a.right,t=iN(e);return rN(e,void 0),bw.createTypeReferenceNode(a,t)}function s(e,n,i){const o=n===e.length-1?r:Z(e,n,t),a=e[n],c=e[n-1];let l;if(0===n)t.flags|=16777216,l=Vc(a,t),t.approximateLength+=(l?l.length:0)+1,t.flags^=16777216;else if(c&&gs(c)){sd(gs(c),(e,t)=>{if(Ps(e,a)&&!fd(t)&&"export="!==t)return l=vc(t),!0})}if(void 0===l){const r=m(a.declarations,Fc);if(r&&ND(r)&&i_(r.expression)){const t=s(e,n-1,i);return i_(t)?bw.createIndexedAccessTypeNode(bw.createParenthesizedType(bw.createTypeQueryNode(t)),bw.createTypeQueryNode(r.expression)):t}l=Vc(a,t)}if(t.approximateLength+=l.length+1,!(16&t.flags)&&c&&Fd(c)&&Fd(c).get(a.escapedName)&&Ps(Fd(c).get(a.escapedName),a)){const t=s(e,n-1,i);return aF(t)?bw.createIndexedAccessTypeNode(t,bw.createLiteralTypeNode(bw.createStringLiteral(l))):bw.createIndexedAccessTypeNode(bw.createTypeReferenceNode(t,o),bw.createLiteralTypeNode(bw.createStringLiteral(l)))}const _=ww(bw.createIdentifier(l),16777216);if(o&&rN(_,bw.createNodeArray(o)),_.symbol=a,n>i){const t=s(e,n-1,i);return i_(t)?bw.createQualifiedName(t,_):pn.fail("Impossible construct - an export of an indexed access cannot be reachable")}return _}}function ie(e,t,n){const r=Ue(t.enclosingDeclaration,e,788968,void 0,!1);return!!(r&&262144&r.flags)&&r!==n.symbol}function oe(e,t){var n,i,o,a;if(4&t.flags&&t.typeParameterNames){const n=t.typeParameterNames.get(Ab(e));if(n)return n}let s=se(e.symbol,t,788968,!0);if(!(80&s.kind))return bw.createIdentifier("(Missing type parameter)");const c=null==(i=null==(n=e.symbol)?void 0:n.declarations)?void 0:i[0];if(c&&DD(c)&&(s=r(t,s,c.name)),4&t.flags){const n=s.escapedText;let r=(null==(o=t.typeParameterNamesByTextNextNameCount)?void 0:o.get(n))||0,i=n;for(;(null==(a=t.typeParameterNamesByText)?void 0:a.has(i))||ie(i,t,e);)r++,i=`${n}_${r}`;if(i!==n){const e=iN(s);s=bw.createIdentifier(i),rN(s,e)}t.mustCreateTypeParametersNamesLookups&&(t.mustCreateTypeParametersNamesLookups=!1,t.typeParameterNames=new Map(t.typeParameterNames),t.typeParameterNamesByTextNextNameCount=new Map(t.typeParameterNamesByTextNextNameCount),t.typeParameterNamesByText=new Set(t.typeParameterNamesByText)),t.typeParameterNamesByTextNextNameCount.set(n,r),t.typeParameterNames.set(Ab(e),s),t.typeParameterNamesByText.add(i)}return s}function se(e,t,n,r){const i=K(e,t,n);return!r||1===i.length||t.encounteredError||65536&t.flags||(t.encounteredError=!0),function e(n,r){const i=Z(n,r,t),o=n[r];0===r&&(t.flags|=16777216);const a=Vc(o,t);0===r&&(t.flags^=16777216);const s=ww(bw.createIdentifier(a),16777216);i&&rN(s,bw.createNodeArray(i));return s.symbol=o,r>0?bw.createQualifiedName(e(n,r-1),s):s}(i,i.length-1)}function ce(e,t,n){const r=K(e,t,n);return function e(n,r){const i=Z(n,r,t),o=n[r];0===r&&(t.flags|=16777216);let a=Vc(o,t);0===r&&(t.flags^=16777216);let s=a.charCodeAt(0);if(Wm(s)&&H(o.declarations,sc)){const e=te(o,t);return t.approximateLength+=2+e.length,bw.createStringLiteral(e)}if(0===r||YT(a,M)){const s=ww(bw.createIdentifier(a),16777216);return i&&rN(s,bw.createNodeArray(i)),s.symbol=o,t.approximateLength+=1+a.length,r>0?bw.createPropertyAccessExpression(e(n,r-1),s):s}{let c;if(91===s&&(a=a.substring(1,a.length-1),s=a.charCodeAt(0)),!Wm(s)||8&o.flags)""+ +a===a&&(t.approximateLength+=a.length,c=bw.createNumericLiteral(+a));else{const e=Iy(a).replace(/\\./g,e=>e.substring(1));t.approximateLength+=e.length+2,c=bw.createStringLiteral(e,39===s)}if(!c){const e=ww(bw.createIdentifier(a),16777216);i&&rN(e,bw.createNodeArray(i)),e.symbol=o,t.approximateLength+=a.length,c=e}return t.approximateLength+=2,bw.createElementAccessExpression(e(n,r-1),c)}}(r,r.length-1)}function le(e){const t=Fc(e);if(!t)return!1;if(ND(t)){return!!(402653316&WM(t.expression).flags)}if(yF(t)){return!!(402653316&WM(t.argumentExpression).flags)}return KN(t)}function _e(e){const t=Fc(e);return!!(t&&KN(t)&&(t.singleQuote||!iy(t)&&Qt(ep(t,!1),"'")))}function ue(e,t){const n=function(e){if(e.valueDeclaration&&Nc(e.valueDeclaration)&&dD(e.valueDeclaration.name))return bw.cloneNode(e.valueDeclaration.name);return}(e);if(n)return n;const r=!!d(e.declarations)&&b(e.declarations,le),i=!!d(e.declarations)&&b(e.declarations,_e),o=!!(8192&e.flags),a=function(e,t,n,r,i){const o=_a(e).nameType;if(o){if(384&o.flags){const e=""+o.value;return vs(e,Sk(j))||!r&&WT(e)?WT(e)&&Qt(e,"-")?bw.createComputedPropertyName(bw.createPrefixUnaryExpression(41,bw.createNumericLiteral(-e))):$T(e,Sk(j),n,r,i):bw.createStringLiteral(e,!!n)}if(8192&o.flags)return bw.createComputedPropertyName(ce(o.symbol,t,111551))}}(e,t,i,r,o);if(a)return a;return $T(vc(e.escapedName),Sk(j),i,r,o)}function de(e){const t=e.mustCreateTypeParameterSymbolList,n=e.mustCreateTypeParametersNamesLookups;e.mustCreateTypeParameterSymbolList=!0,e.mustCreateTypeParametersNamesLookups=!0;const r=e.typeParameterNames,i=e.typeParameterNamesByText,o=e.typeParameterNamesByTextNextNameCount,a=e.typeParameterSymbolList;return()=>{e.typeParameterNames=r,e.typeParameterNamesByText=i,e.typeParameterNamesByTextNextNameCount=o,e.typeParameterSymbolList=a,e.mustCreateTypeParameterSymbolList=t,e.mustCreateTypeParametersNamesLookups=n}}function pe(e,t){return e.declarations&&x(e.declarations,e=>!(!mq(e)||t&&!mc(e,e=>e===t)))}function me(e,t){if(!(4&xx(t)))return!0;if(!UD(e))return!0;$y(e);const n=ua(e).resolvedSymbol,r=n&&Ru(n);return!r||r!==t.target||d(e.typeArguments)>=Mg(t.target.typeParameters)}function ge(e,t,n){8192&n.flags&&n.symbol===e&&(!t.enclosingDeclaration||H(e.declarations,e=>Sd(e)===t.enclosingFile))&&(t.flags|=1048576);return y(n,t)}function he(e,t,n,r){var i;let o;const a=t&&(FD(t)||VP(t))&&Hz(t,e.enclosingDeclaration),s=t??r.valueDeclaration??pe(r)??(null==(i=r.declarations)?void 0:i[0]);if(!g(n,e)&&s){const t=c(e,r,n);g_(s)?o=ke.serializeTypeOfAccessor(s,r,e):!NC(s)||iy(s)||196608&xx(n)||(o=ke.serializeTypeOfDeclaration(s,r,e)),t()}return o||(a&&(n=Nw(n)),o=ge(r,e,n)),o??bw.createKeywordTypeNode(133)}function ve(e,t,n){const r=e.suppressReportInferenceFallback;e.suppressReportInferenceFallback=!0;const i=oh(t),o=i?z(e.mapper?mS(i,e.mapper):i,e):y(n,e);return e.suppressReportInferenceFallback=r,o}function be(e,t,n=t.enclosingDeclaration){let i=!1;const o=db(e);if(Om(e)&&(ng(o)||ig(o.parent)||wD(o.parent)&&rg(o.parent.left)&&ng(o.parent.right)))return i=!0,{introducesError:i,node:e};const a=uc(e);let s;if(pv(o))return s=Ss(im(o,!1,!1)),0!==tc(s,o,a,!1).accessibility&&(i=!0,t.tracker.reportInaccessibleThisError()),{introducesError:i,node:c(e)};if(s=ns(o,a,!0,!0),t.enclosingDeclaration&&!(s&&262144&s.flags)){s=As(s);const n=ns(o,a,!0,!0,t.enclosingDeclaration);if(n===bt||void 0===n&&void 0!==s||n&&s&&!Ps(As(n),s))return n!==bt&&t.tracker.reportInferenceFallback(e),i=!0,{introducesError:i,node:e,sym:s};s=n}return s?(1&s.flags&&s.valueDeclaration&&(ty(s.valueDeclaration)||VP(s.valueDeclaration))||(262144&s.flags||ph(e)||0===tc(s,n,a,!1).accessibility?t.tracker.trackSymbol(s,n,a):(t.tracker.reportInferenceFallback(e),i=!0)),{introducesError:i,node:c(e)}):{introducesError:i,node:e};function c(e){if(e===o){const n=Ru(s),i=262144&s.flags?oe(n,t):bw.cloneNode(e);return i.symbol=s,r(t,ww(i,16777216),e)}const n=EJ(e,e=>c(e),void 0);return r(t,n,e)}}function Se(e,t){const r=n(e,t,!0);if(!r)return!1;if(Om(t)&&gf(t)){lk(t);const e=ua(t).resolvedSymbol;return!e||!!((t.isTypeOf||788968&e.flags)&&d(t.typeArguments)>=Mg(iu(e)))}if(UD(t)){if(wl(t))return!1;const n=ua(t).resolvedSymbol;if(!n)return!1;if(262144&n.flags){const t=Ru(n);return!(e.mapper&&rS(t,e.mapper)!==t)}if(Mm(t))return me(t,r)&&!Wy(t)&&!!(788968&n.flags)}if(oF(t)&&158===t.operator&&155===t.type.kind){const n=e.enclosingDeclaration&&function(e){for(;ua(e).fakeScopeForSignatureDeclaration;)e=e.parent;return e}(e.enclosingDeclaration);return!!mc(t,e=>e===n)}return!0}function Te(e,t){var i;const a=le(bw.createPropertyDeclaration,175,!0),s=le((e,t,n,r)=>bw.createPropertySignature(e,t,n,r),174,!1),c=t.enclosingDeclaration;let f=[];const g=new Set,h=[],v=t;t={...v,usedSymbolNames:new Set(v.usedSymbolNames),remappedSymbolNames:new Map,remappedSymbolReferences:new Map(null==(i=v.remappedSymbolReferences)?void 0:i.entries()),tracker:void 0};const k={...v.tracker.inner,trackSymbol:(e,n,r)=>{var i,o;if(null==(i=t.remappedSymbolNames)?void 0:i.has(uJ(e)))return!1;if(0===tc(e,n,r,!1).accessibility){const n=X(e,t,r);if(!(4&e.flags)){const e=n[0],t=Sd(v.enclosingDeclaration);H(e.declarations,e=>Sd(e)===t)&&R(e)}}else if(null==(o=v.tracker.inner)?void 0:o.trackSymbol)return v.tracker.inner.trackSymbol(e,n,r);return!1}};t.tracker=new vJ(t,k,v.tracker.moduleResolverHost),sd(e,(e,t)=>{Te(e,vc(t))});let T=!t.bundled;const C=e.get("export=");return C&&e.size>1&&2098688&C.flags&&(e=Zu()).set("export=",C),I(e),function(e){e=function(e){const t=S(e,e=>RE(e)&&!e.moduleSpecifier&&!e.attributes&&!!e.exportClause&&BE(e.exportClause));if(t>=0){const n=e[t],r=J(n.exportClause.elements,t=>{if(!t.propertyName&&11!==t.name.kind){const n=t.name,r=D(Q(e),t=>Cc(e[t],n));if(d(r)&&b(r,t=>XT(e[t]))){for(const t of r)e[t]=N(e[t]);return}}return t});d(r)?e[t]=bw.updateExportDeclaration(n,n.modifiers,n.isTypeOnly,bw.updateNamedExports(n.exportClause,r),n.moduleSpecifier,n.attributes):Vt(e,t)}return e}(e=function(e){const t=D(e,e=>RE(e)&&!e.moduleSpecifier&&!!e.exportClause&&BE(e.exportClause));if(d(t)>1){e=[...D(e,e=>!RE(e)||!!e.moduleSpecifier||!e.exportClause),bw.createExportDeclaration(void 0,!1,bw.createNamedExports(L(t,e=>it(e.exportClause,BE).elements)),void 0)]}const n=D(e,e=>RE(e)&&!!e.moduleSpecifier&&!!e.exportClause&&BE(e.exportClause));if(d(n)>1){const t=qe(n,e=>KN(e.moduleSpecifier)?">"+e.moduleSpecifier.text:">");if(t.length!==n.length)for(const n of t)n.length>1&&(e=[...D(e,e=>!n.includes(e)),bw.createExportDeclaration(void 0,!1,bw.createNamedExports(L(n,e=>it(e.exportClause,BE).elements)),n[0].moduleSpecifier)])}return e}(e=function(e){const t=x(e,ME),n=S(e,xE);let r=-1!==n?e[n]:void 0;if(r&&t&&t.isExportEquals&&uD(t.expression)&&uD(r.name)&&bc(r.name)===bc(t.expression)&&r.body&&kE(r.body)){const i=D(e,e=>!!(32&Vv(e))),o=r.name;let a=r.body;if(d(i)&&(r=bw.updateModuleDeclaration(r,r.modifiers,r.name,a=bw.updateModuleBlock(a,bw.createNodeArray([...r.body.statements,bw.createExportDeclaration(void 0,!1,bw.createNamedExports(P(L(i,e=>function(e){if(XF(e))return D(P(e.declarationList.declarations,Fc),w);return D([Fc(e)],w)}(e)),e=>bw.createExportSpecifier(!1,void 0,e))),void 0)]))),e=[...e.slice(0,n),r,...e.slice(n+1)]),!x(e,e=>e!==r&&Cc(e,o))){f=[];const n=!H(a.statements,e=>Av(e,32)||ME(e)||RE(e));p(a.statements,e=>{z(e,n?32:0)}),e=[...D(e,e=>e!==r&&e!==t),...f]}}return e}(e))),c&&(dP(c)&&rf(c)||xE(c))&&(!H(e,eu)||!Y_(e)&&H(e,Z_))&&e.push(lA(bw));return e}(f);function w(e){return!!e&&80===e.kind}function N(e){const t=-129&Vv(e)|32;return bw.replaceModifiers(e,t)}function F(e){const t=-33&Vv(e);return bw.replaceModifiers(e,t)}function I(e,n,r){n||h.push(new Map);let i=0;const o=Array.from(e.values());for(const n of o){if(i++,u(t)&&i+2{O(e,!0,!!r)}),h.pop())}function O(e,n,r){lf(z_(e));const i=ks(e);if(g.has(uJ(i)))return;g.add(uJ(i));if(!n||d(e.declarations)&&H(e.declarations,e=>!!mc(e,e=>e===c))){const i=de(t);t.tracker.pushErrorFallbackNode(x(e.declarations,e=>Sd(e)===t.enclosingFile)),j(e,n,r),t.tracker.popErrorFallbackNode(),i()}}function j(e,i,a,s=e.escapedName){var c,f,m,g,h,v,k;const S=vc(s),T="default"===s;if(i&&!(131072&t.flags)&&Oh(S)&&!T)return void(t.encounteredError=!0);let C=T&&!!(-113&e.flags||16&e.flags&&d(lf(z_(e))))&&!(2097152&e.flags),w=!C&&!i&&Oh(S)&&!T;(C||w)&&(i=!0);const N=(i?0:32)|(T&&!C?2048:0),F=1536&e.flags&&7&e.flags&&"export="!==s,E=F&&ae(z_(e),e);if((8208&e.flags||E)&&G(z_(e),e,Te(e,S),N),524288&e.flags&&function(e,n,r){var i;const o=xu(e),a=_a(e).typeParameters,s=P(a,e=>B(e,t)),c=null==(i=e.declarations)?void 0:i.find(Ag),_=pl(c?c.comment||c.parent.comment:void 0),u=l(t);t.flags|=8388608;const d=t.enclosingDeclaration;t.enclosingDeclaration=c;const p=c&&c.typeExpression&&fP(c.typeExpression)&&ke.tryReuseExistingTypeNode(t,c.typeExpression.type)||y(o,t),f=Te(e,n);t.approximateLength+=8+((null==_?void 0:_.length)??0)+f.length,z(Bw(bw.createTypeAliasDeclaration(void 0,f,s,p),_?[{kind:3,text:"*\n * "+_.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}]:[]),r),u(),t.enclosingDeclaration=d}(e,S,N),98311&e.flags&&"export="!==s&&!(4194304&e.flags)&&!(32&e.flags)&&!(8192&e.flags)&&!E)if(a){oe(e)&&(w=!1,C=!1)}else{const n=z_(e),o=Te(e,S);if(n.symbol&&n.symbol!==e&&16&n.symbol.flags&&H(n.symbol.declarations,UT)&&((null==(c=n.symbol.members)?void 0:c.size)||(null==(f=n.symbol.exports)?void 0:f.size)))t.remappedSymbolReferences||(t.remappedSymbolReferences=new Map),t.remappedSymbolReferences.set(uJ(n.symbol),e),j(n.symbol,i,a,s),t.remappedSymbolReferences.delete(uJ(n.symbol));else if(16&e.flags||!ae(n,e)){const a=2&e.flags?nP(e)?2:1:(null==(m=e.parent)?void 0:m.valueDeclaration)&&dP(null==(g=e.parent)?void 0:g.valueDeclaration)?2:void 0,s=!C&&4&e.flags?xe(o,e):o;let c=e.declarations&&x(e.declarations,e=>fE(e));c&&mE(c.parent)&&1===c.parent.declarations.length&&(c=c.parent.parent);const l=null==(h=e.declarations)?void 0:h.find(hF);if(l&&AF(l.parent)&&uD(l.parent.right)&&(null==(v=n.symbol)?void 0:v.valueDeclaration)&&dP(n.symbol.valueDeclaration)){const e=o===l.parent.right.escapedText?void 0:l.parent.right;t.approximateLength+=12+((null==(k=null==e?void 0:e.escapedText)?void 0:k.length)??0),z(bw.createExportDeclaration(void 0,!1,bw.createNamedExports([bw.createExportSpecifier(!1,e,o)])),0),t.tracker.trackSymbol(n.symbol,t.enclosingDeclaration,111551)}else{const l=r(t,bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(s,void 0,he(t,void 0,n,e))],a)),c);t.approximateLength+=7+s.length,z(l,s!==o?-33&N:N),s===o||i||(t.approximateLength+=16+s.length+o.length,z(bw.createExportDeclaration(void 0,!1,bw.createNamedExports([bw.createExportSpecifier(!1,s,o)])),0),w=!1,C=!1)}}else G(n,e,o,N)}if(384&e.flags&&function(e,n,r){const i=Te(e,n);t.approximateLength+=9+i.length;const o=[],a=D(lf(z_(e)),e=>!!(8&e.flags));let s=0;for(const e of a){if(s++,u(t)&&s+2B(e,t));p(u,e=>t.approximateLength+=kc(e.symbol).length);const m=Id(bu(e)),g=gu(m),h=c&&Th(c),v=h&&function(e){const r=J(e,e=>{const r=t.enclosingDeclaration;t.enclosingDeclaration=e;let i=e.expression;if(ub(i)){if(uD(i)&&""===bc(i))return o(void 0);let e;if(({introducesError:e,node:i}=be(i,t)),e)return o(void 0)}return o(bw.createExpressionWithTypeArguments(i,P(e.typeArguments,e=>ke.tryReuseExistingTypeNode(t,e)||y(n(t,e),t))));function o(e){return t.enclosingDeclaration=r,e}});if(r.length===e.length)return r;return}(h)||J(function(e){let t=_;if(e.symbol.declarations)for(const n of e.symbol.declarations){const e=Th(n);if(e)for(const n of e){const e=$k(n);il(e)||(t===_?t=[e]:t.push(e))}}return t}(m),ve),b=z_(e),x=!!(null==(s=b.symbol)?void 0:s.valueDeclaration)&&m_(b.symbol.valueDeclaration),k=x?pu(b):wt;t.approximateLength+=(d(g)?8:0)+(d(v)?11:0);const S=[...d(g)?[bw.createHeritageClause(96,P(g,e=>function(e,n,r){const i=ye(e,111551);if(i)return i;const o=xe(`${r}_base`),a=bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(o,void 0,y(n,t))],2));return z(a,0),bw.createExpressionWithTypeArguments(bw.createIdentifier(o),void 0)}(e,k,i)))]:[],...d(v)?[bw.createHeritageClause(119,v)]:[]],T=function(e,t,n){if(!d(t))return n;const r=new Map;p(n,e=>{r.set(e.escapedName,e)});for(const n of t){const t=lf(Id(n,e.thisType));for(const e of t){const t=r.get(e.escapedName);t&&e.parent===t.parent&&r.delete(e.escapedName)}}return je(r.values())}(m,g,lf(m)),C=D(T,e=>!we(e)),w=H(T,we),N=w?Ce(t)?U(D(T,we),!0,g[0],!1):[bw.createPropertyDeclaration(void 0,bw.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:_;w&&!Ce(t)&&(t.approximateLength+=9);const F=U(C,!0,g[0],!1),E=U(D(lf(b),e=>!(4194304&e.flags||"prototype"===e.escapedName||ne(e))),!0,k,!0),A=!x&&!!e.valueDeclaration&&Om(e.valueDeclaration)&&!H(Jm(b,1));A&&(t.approximateLength+=21);const I=A?[bw.createConstructorDeclaration(bw.createModifiersFromModifierFlags(2),[],void 0)]:me(1,b,k,177),O=ge(m,g[0]);t.enclosingDeclaration=l,z(r(t,bw.createClassDeclaration(void 0,i,f,S,[...O,...E,...I,...F,...N]),e.declarations&&D(e.declarations,e=>hE(e)||MF(e))[0]),o)}(e,Te(e,S),N)),(1536&e.flags&&(!F||function(e){return b(K(e),e=>!(111551&Ga($a(e))))}(e))||E)&&function(e,n,r){const i=K(e),a=Ce(t),s=ze(i,t=>t.parent&&t.parent===e||a?"real":"merged"),c=s.get("real")||_,l=s.get("merged")||_;if(d(c)||a){let i;if(a){const n=t.flags;t.flags|=514,i=o(e,t,-1),t.flags=n}else{const r=Te(e,n);i=bw.createIdentifier(r),t.approximateLength+=r.length}ee(c,i,r,!!(67108880&e.flags))}if(d(l)){const r=Sd(t.enclosingDeclaration),i=Te(e,n),o=bw.createModuleBlock([bw.createExportDeclaration(void 0,!1,bw.createNamedExports(J(D(l,e=>"export="!==e.escapedName),n=>{var i,o;const a=vc(n.escapedName),s=Te(n,a),c=n.declarations&&Ca(n);if(r&&(c?r!==Sd(c):!H(n.declarations,e=>Sd(e)===r)))return void(null==(o=null==(i=t.tracker)?void 0:i.reportNonlocalAugmentation)||o.call(i,r,e,n));const l=c&&Ua(c,!0);R(l||n);const _=l?Te(l,vc(l.escapedName)):s;return bw.createExportSpecifier(!1,a===_?void 0:_,a)})))]);z(bw.createModuleDeclaration(void 0,bw.createIdentifier(i),o,32),0)}}(e,S,N),64&e.flags&&!(32&e.flags)&&function(e,n,r){const i=Te(e,n);t.approximateLength+=14+i.length;const o=bu(e),a=iu(e),s=P(a,e=>B(e,t)),c=gu(o),l=d(c)?Gb(c):void 0,_=U(lf(o),!1,l),u=me(0,o,l,180),p=me(1,o,l,181),f=ge(o,l),m=d(c)?[bw.createHeritageClause(96,J(c,e=>ye(e,111551)))]:void 0;z(bw.createInterfaceDeclaration(void 0,i,s,m,[...f,...p,...u,..._]),r)}(e,S,N),2097152&e.flags&&re(e,Te(e,S),N),4&e.flags&&"export="===e.escapedName&&oe(e),8388608&e.flags&&e.declarations)for(const n of e.declarations){const e=is(n,n.moduleSpecifier);if(!e)continue;const r=n.isTypeOnly,i=te(e,t);t.approximateLength+=17+i.length,z(bw.createExportDeclaration(void 0,r,void 0,bw.createStringLiteral(i)),0)}if(C){const n=Te(e,S);t.approximateLength+=16+n.length,z(bw.createExportAssignment(void 0,!1,bw.createIdentifier(n)),0)}else if(w){const n=Te(e,S);t.approximateLength+=22+S.length+n.length,z(bw.createExportDeclaration(void 0,!1,bw.createNamedExports([bw.createExportSpecifier(!1,n,S)])),0)}}function R(e){if(H(e.declarations,ty))return;pn.assertIsDefined(h[h.length-1]),xe(vc(e.escapedName),e);const t=!!(2097152&e.flags)&&!H(e.declarations,e=>!!mc(e,RE)||OE(e)||CE(e)&&!WE(e.moduleReference));h[t?0:h.length-1].set(uJ(e),e)}function z(e,n){if(EI(e)){const r=Vv(e);let i=0;const o=t.enclosingDeclaration&&(Ag(t.enclosingDeclaration)?Sd(t.enclosingDeclaration):t.enclosingDeclaration);32&n&&o&&(function(e){return dP(e)&&(rf(e)||of(e))||dp(e)&&!hp(e)}(o)||xE(o))&&XT(e)&&(i|=32),!T||32&i||o&&33554432&o.flags||!(bE(e)||XF(e)||gE(e)||hE(e)||xE(e))||(i|=128),2048&n&&(hE(e)||yE(e)||gE(e))&&(i|=2048),i&&(e=bw.replaceModifiers(e,i|r)),t.approximateLength+=_e(i|r)}f.push(e)}function U(e,n,r,i){const o=[];let s=0;for(const c of e){if(s++,u(t)&&s+2ne(e)&&vs(e.escapedName,99))}function G(e,n,i,o){const a=Jm(e,0);for(const e of a){t.approximateLength+=1;const n=A(e,263,t,{name:bw.createIdentifier(i)});z(r(t,n,Z(e)),o)}if(!(1536&n.flags&&n.exports&&n.exports.size)){const n=D(lf(e),ne);t.approximateLength+=i.length,ee(n,bw.createIdentifier(i),o,!0)}}function Y(e){return 1&t.flags?Jw(bw.createEmptyStatement(),3,e):bw.createExpressionStatement(bw.createIdentifier(e))}function Z(e){if(e.declaration&&e.declaration.parent){if(AF(e.declaration.parent)&&5===og(e.declaration.parent))return e.declaration.parent;if(fE(e.declaration.parent)&&e.declaration.parent.parent)return e.declaration.parent.parent}return e.declaration}function ee(e,n,r,i){const o=uD(n)?32:0,a=Ce(t);if(d(e)){t.approximateLength+=14;const s=ze(e,e=>!d(e.declarations)||H(e.declarations,e=>Sd(e)===Sd(t.enclosingDeclaration))||a?"local":"remote").get("local")||_;let l=II.createModuleDeclaration(void 0,n,bw.createModuleBlock([]),o);IT(l,c),l.locals=Zu(e),l.symbol=e[0].parent;const u=f;f=[];const p=T;T=!1;const m={...t,enclosingDeclaration:l},g=t;t=m,I(Zu(s),i,!0),t=g,T=p;const h=f;f=u;const y=P(h,e=>ME(e)&&!e.isExportEquals&&uD(e.expression)?bw.createExportDeclaration(void 0,!1,bw.createNamedExports([bw.createExportSpecifier(!1,e.expression,bw.createIdentifier("default"))])):e),v=b(y,e=>Av(e,32))?P(y,F):y;l=bw.updateModuleDeclaration(l,l.modifiers,l.name,bw.createModuleBlock(v)),z(l,r)}else a&&(t.approximateLength+=14,z(bw.createModuleDeclaration(void 0,n,bw.createModuleBlock([]),o),r))}function ne(e){return!!(2887656&e.flags)||!(4194304&e.flags||"prototype"===e.escapedName||e.valueDeclaration&&Iv(e.valueDeclaration)&&m_(e.valueDeclaration.parent))}function re(e,n,r){var i,o,a,s,c;const l=Ca(e);if(!l)return pn.fail();const _=ks(Ua(l,!0));if(!_)return;let u=mp(_)&&m(e.declarations,e=>{if(jE(e)||JE(e))return Xd(e.propertyName||e.name);if(AF(e)||ME(e)){const t=ME(e)?e.expression:e.right;if(hF(t))return bc(t.name)}if(wa(e)){const t=Fc(e);if(t&&uD(t))return bc(t)}})||vc(_.escapedName);"export="===u&&W&&(u="default");const d=Te(_,u);switch(R(_),l.kind){case 209:if(261===(null==(o=null==(i=l.parent)?void 0:i.parent)?void 0:o.kind)){const e=te(_.parent||_,t),{propertyName:r}=l,i=r&&uD(r)?bc(r):void 0;t.approximateLength+=24+n.length+e.length+((null==i?void 0:i.length)??0),z(bw.createImportDeclaration(void 0,bw.createImportClause(void 0,void 0,bw.createNamedImports([bw.createImportSpecifier(!1,i?bw.createIdentifier(i):void 0,bw.createIdentifier(n))])),bw.createStringLiteral(e),void 0),0);break}pn.failBadSyntaxKind((null==(a=l.parent)?void 0:a.parent)||l,"Unhandled binding element grandparent kind in declaration serialization");break;case 305:227===(null==(c=null==(s=l.parent)?void 0:s.parent)?void 0:c.kind)&&ie(vc(e.escapedName),d);break;case 261:if(hF(l.initializer)){const e=l.initializer,i=bw.createUniqueName(n),o=te(_.parent||_,t);t.approximateLength+=22+o.length+bc(i).length,z(bw.createImportEqualsDeclaration(void 0,!1,i,bw.createExternalModuleReference(bw.createStringLiteral(o))),0),t.approximateLength+=12+n.length+bc(i).length+bc(e.name).length,z(bw.createImportEqualsDeclaration(void 0,!1,bw.createIdentifier(n),bw.createQualifiedName(i,e.name)),r);break}case 272:if("export="===_.escapedName&&H(_.declarations,e=>dP(e)&&of(e))){oe(e);break}const p=!(512&_.flags||fE(l));t.approximateLength+=11+n.length+vc(_.escapedName).length,z(bw.createImportEqualsDeclaration(void 0,!1,bw.createIdentifier(n),p?se(_,t,-1,!1):bw.createExternalModuleReference(bw.createStringLiteral(te(_,t)))),p?r:0);break;case 271:z(bw.createNamespaceExportDeclaration(bc(l.name)),0);break;case 274:{const e=te(_.parent||_,t),r=t.bundled?bw.createStringLiteral(e):l.parent.moduleSpecifier,i=wE(l.parent)?l.parent.attributes:void 0,o=tA(l.parent);t.approximateLength+=14+n.length+3+(o?4:0),z(bw.createImportDeclaration(void 0,bw.createImportClause(o?156:void 0,bw.createIdentifier(n),void 0),r,i),0);break}case 275:{const e=te(_.parent||_,t),r=t.bundled?bw.createStringLiteral(e):l.parent.parent.moduleSpecifier,i=tA(l.parent.parent);t.approximateLength+=19+n.length+3+(i?4:0),z(bw.createImportDeclaration(void 0,bw.createImportClause(i?156:void 0,void 0,bw.createNamespaceImport(bw.createIdentifier(n))),r,l.parent.attributes),0);break}case 281:t.approximateLength+=19+n.length+3,z(bw.createExportDeclaration(void 0,!1,bw.createNamespaceExport(bw.createIdentifier(n)),bw.createStringLiteral(te(_,t))),0);break;case 277:{const e=te(_.parent||_,t),r=t.bundled?bw.createStringLiteral(e):l.parent.parent.parent.moduleSpecifier,i=tA(l.parent.parent.parent);t.approximateLength+=19+n.length+3+(i?4:0),z(bw.createImportDeclaration(void 0,bw.createImportClause(i?156:void 0,void 0,bw.createNamedImports([bw.createImportSpecifier(!1,n!==u?bw.createIdentifier(u):void 0,bw.createIdentifier(n))])),r,l.parent.parent.parent.attributes),0);break}case 282:const f=l.parent.parent.moduleSpecifier;if(f){const e=l.propertyName;e&&Yd(e)&&(u="default")}ie(vc(e.escapedName),f?u:d,f&&Ju(f)?bw.createStringLiteral(f.text):void 0);break;case 278:oe(e);break;case 227:case 212:case 213:"default"===e.escapedName||"export="===e.escapedName?oe(e):ie(n,d);break;default:return pn.failBadSyntaxKind(l,"Unhandled alias declaration kind in symbol serializer!")}}function ie(e,n,r){t.approximateLength+=16+e.length+(e!==n?n.length:0),z(bw.createExportDeclaration(void 0,!1,bw.createNamedExports([bw.createExportSpecifier(!1,e!==n?n:void 0,e)]),r),0)}function oe(e){var n;if(4194304&e.flags)return!1;const r=vc(e.escapedName),i="export="===r,o=i||"default"===r,a=e.declarations&&Ca(e),s=a&&Ua(a,!0);if(s&&d(s.declarations)&&H(s.declarations,e=>Sd(e)===Sd(c))){const n=a&&(ME(a)||AF(a)?bh(a):xh(a)),l=n&&ub(n)?function(e){switch(e.kind){case 80:return e;case 167:do{e=e.left}while(80!==e.kind);return e;case 212:do{if(ig(e.expression)&&!dD(e.name))return e.name;e=e.expression}while(80!==e.kind);return e}}(n):void 0,_=l&&ns(l,-1,!0,!0,c);(_||s)&&R(_||s);const u=t.tracker.disableTrackSymbol;if(t.tracker.disableTrackSymbol=!0,o)t.approximateLength+=10,f.push(bw.createExportAssignment(void 0,i,ce(s,t,-1)));else if(l===n&&l)ie(r,bc(l));else if(n&&MF(n))ie(r,Te(s,kc(s)));else{const n=xe(r,e);t.approximateLength+=n.length+10,z(bw.createImportEqualsDeclaration(void 0,!1,bw.createIdentifier(n),se(s,t,-1,!1)),0),ie(r,n)}return t.tracker.disableTrackSymbol=u,!0}{const a=xe(r,e),c=Kw(z_(ks(e)));if(ae(c,e))G(c,e,a,o?0:32);else{const i=268!==(null==(n=t.enclosingDeclaration)?void 0:n.kind)||98304&e.flags&&!(65536&e.flags)?2:1;t.approximateLength+=a.length+5;z(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(a,void 0,he(t,void 0,c,e))],i)),s&&4&s.flags&&"export="===s.escapedName?128:r===a?32:0)}return o?(t.approximateLength+=a.length+10,f.push(bw.createExportAssignment(void 0,i,bw.createIdentifier(a))),!0):r!==a&&(ie(r,a),!0)}}function ae(e,n){var r;const i=Sd(t.enclosingDeclaration);return 48&xx(e)&&!H(null==(r=e.symbol)?void 0:r.declarations,T_)&&!d(cg(e))&&!Ic(e)&&!(!d(D(lf(e),ne))&&!d(Jm(e,0)))&&!d(Jm(e,1))&&!pe(n,c)&&!(e.symbol&&H(e.symbol.declarations,e=>Sd(e)!==i))&&!H(lf(e),e=>fd(e.escapedName))&&!H(lf(e),e=>H(e.declarations,e=>Sd(e)!==i))&&b(lf(e),e=>!!vs(kc(e),M)&&(!(98304&e.flags)||U_(e)===L_(e)))}function le(e,n,i){return function(o,a,s){var c,l,_,u,d,f;const m=lx(o),g=!!(2&m)&&!Ce(t);if(a&&2887656&o.flags)return[];if(4194304&o.flags||"constructor"===o.escapedName||s&&Am(s,o.escapedName)&&Yj(Am(s,o.escapedName))===Yj(o)&&(16777216&o.flags)==(16777216&Am(s,o.escapedName).flags)&&OS(z_(o),Zc(s,o.escapedName)))return[];const h=-1025&m|(a?256:0),y=ue(o,t),v=null==(c=o.declarations)?void 0:c.find(nn(AD,g_,fE,PD,AF,hF));if(98304&o.flags&&i){const e=[];if(65536&o.flags){const n=o.declarations&&p(o.declarations,e=>179===e.kind?e:vF(e)&&ag(e)?p(e.arguments[2].properties,e=>{const t=Fc(e);if(t&&uD(t)&&"set"===bc(t))return e}):void 0);pn.assert(!!n);const i=l_(n)?zg(n).parameters[0]:void 0,a=null==(l=o.declarations)?void 0:l.find(Eu);t.approximateLength+=_e(h)+7+(i?kc(i).length:5)+(g?0:2),e.push(r(t,bw.createSetAccessorDeclaration(bw.createModifiersFromModifierFlags(h),y,[bw.createParameterDeclaration(void 0,void 0,i?V(i,q(i),t):"value",void 0,g?void 0:he(t,a,L_(o),o))],void 0),a??v))}if(32768&o.flags){const n=null==(_=o.declarations)?void 0:_.find(Pu);t.approximateLength+=_e(h)+8+(g?0:2),e.push(r(t,bw.createGetAccessorDeclaration(bw.createModifiersFromModifierFlags(h),y,[],g?void 0:he(t,n,z_(o),o),void 0),n??v))}return e}if(98311&o.flags){const n=(Yj(o)?8:0)|h;return t.approximateLength+=2+(g?0:2)+_e(n),r(t,e(bw.createModifiersFromModifierFlags(n),y,16777216&o.flags?bw.createToken(58):void 0,g?void 0:he(t,null==(u=o.declarations)?void 0:u.find(RD),L_(o),o),void 0),(null==(d=o.declarations)?void 0:d.find(nn(AD,fE)))||v)}if(8208&o.flags){const i=Jm(z_(o),0);if(g){const n=(Yj(o)?8:0)|h;return t.approximateLength+=1+_e(n),r(t,e(bw.createModifiersFromModifierFlags(n),y,16777216&o.flags?bw.createToken(58):void 0,void 0,void 0),(null==(f=o.declarations)?void 0:f.find(l_))||i[0]&&i[0].declaration||o.declarations&&o.declarations[0])}const a=[];for(const e of i){t.approximateLength+=1;const i=A(e,n,t,{name:y,questionToken:16777216&o.flags?bw.createToken(58):void 0,modifiers:h?bw.createModifiersFromModifierFlags(h):void 0}),s=e.declaration&&hg(e.declaration.parent)?e.declaration.parent:e.declaration;a.push(r(t,i,s))}return a}return pn.fail(`Unhandled class member kind! ${o.__debugFlags||o.flags}`)}}function _e(e){let t=0;return 32&e&&(t+=7),128&e&&(t+=8),2048&e&&(t+=8),4096&e&&(t+=6),1&e&&(t+=7),2&e&&(t+=8),4&e&&(t+=10),64&e&&(t+=9),256&e&&(t+=7),16&e&&(t+=9),8&e&&(t+=9),512&e&&(t+=9),1024&e&&(t+=6),8192&e&&(t+=3),16384&e&&(t+=4),t}function fe(e,t){return s(e,!1,t)}function me(e,n,i,o){const a=Jm(n,e);if(1===e){if(!i&&b(a,e=>0===d(e.parameters)))return[];if(i){const e=Jm(i,1);if(!d(e)&&b(a,e=>0===d(e.parameters)))return[];if(e.length===a.length){let t=!1;for(let n=0;ny(e,t)),i=ce(e.target.symbol,t,788968)):e.symbol&&Zs(e.symbol,c,n)&&(i=ce(e.symbol,t,788968)),i)return bw.createExpressionWithTypeArguments(i,r)}function ve(e){const n=ye(e,788968);return n||(e.symbol?bw.createExpressionWithTypeArguments(ce(e.symbol,t,788968),void 0):void 0)}function xe(e,n){var r,i;const o=n?uJ(n):void 0;if(o&&t.remappedSymbolNames.has(o))return t.remappedSymbolNames.get(o);n&&(e=Se(n,e));let a=0;const s=e;for(;null==(r=t.usedSymbolNames)?void 0:r.has(e);)a++,e=`${s}_${a}`;return null==(i=t.usedSymbolNames)||i.add(e),o&&t.remappedSymbolNames.set(o,e),e}function Se(e,n){if("default"===n||"__class"===n||"__function"===n){const r=l(t);t.flags|=16777216;const i=Vc(e,t);r(),n=i.length>0&&Wm(i.charCodeAt(0))?Iy(i):i}return"default"===n?n="_default":"export="===n&&(n="_exports"),n=vs(n,M)&&!Oh(n)?n:"_"+n.replace(/[^a-z0-9]/gi,"_")}function Te(e,n){const r=uJ(e);return t.remappedSymbolNames.has(r)?t.remappedSymbolNames.get(r):(n=Se(e,n),t.remappedSymbolNames.set(r,n),n)}}function Ce(e){return-1!==e.maxExpansionDepth}function we(e){return!!e.valueDeclaration&&Nc(e.valueDeclaration)&&dD(e.valueDeclaration.name)}}(),ke=iG(j,me.syntacticBuilderResolver),Se=xC({evaluateElementAccessExpression:function(e,t){const n=e.expression;if(ub(n)&&Ju(e.argumentExpression)){const r=ns(n,111551,!0);if(r&&384&r.flags){const n=yc(e.argumentExpression.text),i=r.exports.get(n);if(i)return pn.assert(Sd(i.valueDeclaration)===Sd(r.valueDeclaration)),t?VJ(e,i,t):Yz(i.valueDeclaration)}}return bC(void 0)},evaluateEntityNameExpression:UJ}),Te=Zu(),Ne=Xo(4,"undefined");Ne.declarations=[];var Fe=Xo(1536,"globalThis",8);Fe.exports=Te,Fe.declarations=[],Te.set(Fe.escapedName,Fe);var Ee,Pe,Ae,Ie=Xo(4,"arguments"),Oe=Xo(4,"require"),Me=j.verbatimModuleSyntax?"verbatimModuleSyntax":"isolatedModules",Re=!j.verbatimModuleSyntax,Be=0,Je=0,Ue=TC({compilerOptions:j,requireSymbol:Oe,argumentsSymbol:Ie,globals:Te,getSymbolOfDeclaration:Ss,error:Jo,getRequiresScopeChangeCache:ma,setRequiresScopeChangeCache:ga,lookup:da,onPropertyWithInvalidInitializer:function(e,t,n,r){if(!V)return e&&!r&&va(e,t,t)||Jo(e,e&&n.type&&js(n.type,e.pos)?fa.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:fa.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,jp(n.name),ya(t)),!0;return!1},onFailedToResolveSymbol:function(e,t,n,r){const i=tt(t)?t:t.escapedText;a(()=>{if(!(e&&(325===e.parent.kind||va(e,i,t)||ba(e)||function(e,t,n){const r=1920|(Om(e)?111551:0);if(n===r){const n=$a(Ue(e,t,788968&~r,void 0,!1)),i=e.parent;if(n){if(wD(i)){pn.assert(i.left===e,"Should only be resolving left side of qualified name as a namespace");const r=i.right.escapedText;if(Am(Ru(n),r))return Jo(i,fa.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,vc(t),vc(r)),!0}return Jo(e,fa._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,vc(t)),!0}}return!1}(e,i,n)||function(e,t){if(ka(t)&&282===e.parent.kind)return Jo(e,fa.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,t),!0;return!1}(e,i)||function(e,t,n){if(111127&n){if($a(Ue(e,t,1024,void 0,!1)))return Jo(e,fa.Cannot_use_namespace_0_as_a_value,vc(t)),!0}else if(788544&n){if($a(Ue(e,t,1536,void 0,!1)))return Jo(e,fa.Cannot_use_namespace_0_as_a_type,vc(t)),!0}return!1}(e,i,n)||function(e,t,n){if(111551&n){if(ka(t)){const n=e.parent.parent;if(n&&n.parent&&aP(n)){const r=n.token;265===n.parent.kind&&96===r?Jo(e,fa.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types,vc(t)):m_(n.parent)&&96===r?Jo(e,fa.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values,vc(t)):m_(n.parent)&&119===r&&Jo(e,fa.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types,vc(t))}else Jo(e,fa._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,vc(t));return!0}const n=$a(Ue(e,t,788544,void 0,!1)),r=n&&Ga(n);if(n&&void 0!==r&&!(111551&r)){const r=vc(t);return!function(e){switch(e){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return!0}return!1}(t)?!function(e,t){const n=mc(e.parent,e=>!ND(e)&&!PD(e)&&(HD(e)||"quit"));if(n&&1===n.members.length){const e=Ru(t);return!!(1048576&e.flags)&&sM(e,384,!0)}return!1}(e,n)?Jo(e,fa._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,r):Jo(e,fa._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,r,"K"===r?"P":"K"):Jo(e,fa._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,r),!0}}return!1}(e,i,n)||function(e,t,n){if(788584&n){const n=$a(Ue(e,t,111127,void 0,!1));if(n&&!(1920&n.flags))return Jo(e,fa._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,vc(t)),!0}return!1}(e,i,n)))){let o,a;if(t&&(a=function(e){const t=ya(e),n=op().get(t);return n&&ve(n.keys())}(t),a&&Jo(e,r,ya(t),a)),!a&&Ki{var a;const s=t.escapedName,c=r&&dP(r)&&rf(r);if(e&&(2&n||(32&n||384&n)&&!(111551&~n))){const n=As(t);(2&n.flags||32&n.flags||384&n.flags)&&function(e,t){var n;if(pn.assert(!!(2&e.flags||32&e.flags||384&e.flags)),67108881&e.flags&&32&e.flags)return;const r=null==(n=e.declarations)?void 0:n.find(e=>_p(e)||m_(e)||267===e.kind);if(void 0===r)return pn.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(33554432&r.flags||pa(r,t))){let n;const i=jp(Fc(r));2&e.flags?n=Jo(t,fa.Block_scoped_variable_0_used_before_its_declaration,i):32&e.flags?n=Jo(t,fa.Class_0_used_before_its_declaration,i):256&e.flags?n=Jo(t,fa.Enum_0_used_before_its_declaration,i):(pn.assert(!!(128&e.flags)),Nk(j)&&(n=Jo(t,fa.Enum_0_used_before_its_declaration,i))),n&&uT(n,qp(r,fa._0_is_declared_here,i))}}(n,e)}if(c&&!(111551&~n)&&!(16777216&e.flags)){const n=ks(t);d(n.declarations)&&b(n.declarations,e=>TE(e)||dP(e)&&!!e.symbol.globalExports)&&Vo(!j.allowUmdGlobalAccess,e,fa._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,vc(s))}if(i&&!o&&!(111551&~n)){const r=ks(Ed(t)),o=ny(i);r===Ss(i)?Jo(e,fa.Parameter_0_cannot_reference_itself,jp(i.name)):r.valueDeclaration&&r.valueDeclaration.pos>i.pos&&o.parent.locals&&da(o.parent.locals,r.escapedName,n)===r&&Jo(e,fa.Parameter_0_cannot_reference_identifier_1_declared_after_it,jp(i.name),jp(e))}if(e&&111551&n&&2097152&t.flags&&!(111551&t.flags)&&!CT(e)){const n=Ya(t,111551);if(n){const t=282===n.kind||279===n.kind||281===n.kind?fa._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:fa._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type,r=vc(s);ha(Jo(e,t,r),n,r)}}if(j.isolatedModules&&t&&c&&!(111551&~n)){const e=da(Te,s,n)===t&&dP(r)&&r.locals&&da(r.locals,s,-111552);if(e){const t=null==(a=e.declarations)?void 0:a.find(e=>277===e.kind||274===e.kind||275===e.kind||272===e.kind);t&&!Ul(t)&&Jo(t,fa.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,vc(s))}}})}}),Ve=TC({compilerOptions:j,requireSymbol:Oe,argumentsSymbol:Ie,globals:Te,getSymbolOfDeclaration:Ss,error:Jo,getRequiresScopeChangeCache:ma,setRequiresScopeChangeCache:ga,lookup:function(e,t,n){const r=da(e,t,n);if(r)return r;let i;if(e===Te){i=J(["string","number","boolean","object","bigint","symbol"],t=>e.has(t.charAt(0).toUpperCase()+t.slice(1))?Xo(524288,t):void 0).concat(je(e.values()))}else i=je(e.values());return OO(vc(t),i,n)}});const We={getNodeCount:()=>De(e.getSourceFiles(),(e,t)=>e+t.nodeCount,0),getIdentifierCount:()=>De(e.getSourceFiles(),(e,t)=>e+t.identifierCount,0),getSymbolCount:()=>De(e.getSourceFiles(),(e,t)=>e+t.symbolCount,f),getTypeCount:()=>u,getInstantiationCount:()=>g,getRelationCacheSizes:()=>({assignable:ko.size,identity:Do.size,subtype:bo.size,strictSubtype:xo.size}),isUndefinedSymbol:e=>e===Ne,isArgumentsSymbol:e=>e===Ie,isUnknownSymbol:e=>e===bt,getMergedSymbol:ks,symbolIsValue:Os,getDiagnostics:gz,getGlobalDiagnostics:function(){return hz(),ho.getGlobalDiagnostics()},getRecursionIdentity:BC,getUnmatchedProperties:yN,getTypeOfSymbolAtLocation:(e,t)=>{const n=hc(t);return n?function(e,t){if(e=As(e),(80===t.kind||81===t.kind)&&(hb(t)&&(t=t.parent),Tm(t)&&(!th(t)||px(t)))){const n=Ew(px(t)&&212===t.kind?_O(t,void 0,!0):qM(t));if(As(ua(t).resolvedSymbol)===e)return n}if(ph(t)&&Eu(t.parent)&&x_(t.parent))return D_(t.parent.symbol);return yb(t)&&px(t.parent)?L_(e):U_(e)}(e,n):Et},getTypeOfSymbol:z_,getSymbolsOfParameterPropertyDeclaration:(e,t)=>{const n=hc(e,FD);return void 0===n?pn.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."):(pn.assert(rc(n,n.parent)),function(e,t){const n=e.parent,r=e.parent.parent,i=da(n.locals,t,111551),o=da(Fd(r.symbol),t,111551);if(i&&o)return[i,o];return pn.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}(n,yc(t)))},getDeclaredTypeOfSymbol:Ru,getPropertiesOfType:lf,getPropertyOfType:(e,t)=>Am(e,yc(t)),getPrivateIdentifierPropertyOfType:(e,t,n)=>{const r=hc(n);if(!r)return;const i=fO(yc(t),r);return i?hO(e,i):void 0},getTypeOfPropertyOfType:(e,t)=>Zc(e,yc(t)),getIndexInfoOfType:(e,t)=>lg(e,0===t?Ut:Wt),getIndexInfosOfType:cg,getIndexInfosOfIndexSymbol:oy,getSignaturesOfType:Jm,getIndexTypeOfType:(e,t)=>dg(e,0===t?Ut:Wt),getIndexType:e=>_x(e),getBaseTypes:gu,getBaseTypeOfLiteralType:cw,getWidenedType:Kw,getWidenedLiteralType:_w,fillMissingTypeArguments:Jg,getTypeFromTypeNode:e=>{const t=hc(e,T_);return t?$k(t):Et},getParameterType:dj,getParameterIdentifierInfoAtPosition:function(e,t){var n;if(318===(null==(n=e.declaration)?void 0:n.kind))return;const r=e.parameters.length-(hJ(e)?1:0);if(tCR(e),getReturnTypeOfSignature:gh,isNullableType:eO,getNullableType:Cw,getNonNullableType:Dw,getNonOptionalType:Ew,getTypeArguments:by,typeToTypeNode:me.typeToTypeNode,typePredicateToTypePredicateNode:me.typePredicateToTypePredicateNode,indexInfoToIndexSignatureDeclaration:me.indexInfoToIndexSignatureDeclaration,signatureToSignatureDeclaration:me.signatureToSignatureDeclaration,symbolToEntityName:me.symbolToEntityName,symbolToExpression:me.symbolToExpression,symbolToNode:me.symbolToNode,symbolToTypeParameterDeclarations:me.symbolToTypeParameterDeclarations,symbolToParameterDeclaration:me.symbolToParameterDeclaration,typeParameterToDeclaration:me.typeParameterToDeclaration,getSymbolsInScope:(e,t)=>{const n=hc(e);return n?function(e,t){if(67108864&e.flags)return[];const n=Zu();let r=!1;return i(),n.delete("this"),Tg(n);function i(){for(;e;){switch(uu(e)&&e.locals&&!nf(e)&&a(e.locals,t),e.kind){case 308:if(!uO(e))break;case 268:s(Ss(e).exports,2623475&t);break;case 267:a(Ss(e).exports,8&t);break;case 232:e.name&&o(e.symbol,t);case 264:case 265:r||a(Fd(Ss(e)),788968&t);break;case 219:e.name&&o(e.symbol,t)}zf(e)&&o(Ie,t),r=Iv(e),e=e.parent}a(Te,t)}function o(e,t){if(ux(e)&t){const t=e.escapedName;n.has(t)||n.set(t,e)}}function a(e,t){t&&e.forEach(e=>{o(e,t)})}function s(e,t){t&&e.forEach(e=>{Qu(e,282)||Qu(e,281)||"default"===e.escapedName||o(e,t)})}}(n,t):[]},getSymbolAtLocation:e=>{const t=hc(e);return t?Nz(t,!0):void 0},getIndexInfosAtLocation:e=>{const t=hc(e);return t?function(e){if(uD(e)&&hF(e.parent)&&e.parent.name===e){const t=rx(e),n=qM(e.parent.expression);return L(1048576&n.flags?n.types:[n],e=>D(cg(e),e=>tg(t,e.keyType)))}return}(t):void 0},getShorthandAssignmentValueSymbol:e=>{const t=hc(e);return t?function(e){if(e&&305===e.kind)return ns(e.name,2208703,!0);return}(t):void 0},getExportSpecifierLocalTargetSymbol:e=>{const t=hc(e,JE);return t?function(e){if(JE(e)){const t=e.propertyName||e.name;return e.parent.parent.moduleSpecifier?Ra(e.parent.parent,e):11===t.kind?void 0:ns(t,2998271,!0)}return ns(e,2998271,!0)}(t):void 0},getExportSymbolOfSymbol:e=>ks(e.exportSymbol||e),getTypeAtLocation:e=>{const t=hc(e);return t?Dz(t):Et},getTypeOfAssignmentPattern:e=>{const t=hc(e,N_);return t&&Fz(t)||Et},getPropertySymbolOfDestructuringAssignment:e=>{const t=hc(e,uD);return t?function(e){const t=Fz(it(e.parent.parent,N_));return t&&Am(t,e.escapedText)}(t):void 0},signatureToString:(e,t,n,r)=>gc(e,hc(t),n,r),typeToString:(e,t,n)=>Sc(e,hc(t),n),symbolToString:(e,t,n,r)=>pc(e,hc(t),n,r),typePredicateToString:(e,t,n)=>Mc(e,hc(t),n),writeSignature:(e,t,n,r,i,o,a,s)=>gc(e,hc(t),n,r,i,o,a,s),writeType:(e,t,n,r,i,o,a)=>Sc(e,hc(t),n,r,i,o,a),writeSymbol:(e,t,n,r,i)=>pc(e,hc(t),n,r,i),writeTypePredicate:(e,t,n,r)=>Mc(e,hc(t),n,r),getAugmentedPropertiesOfType:Iz,getRootSymbols:function e(t){const n=function(e){if(6&cx(e))return J(_a(e).containingType.types,t=>Am(t,e.escapedName));if(33554432&e.flags){const{links:{leftSpread:t,rightSpread:n,syntheticOrigin:r}}=e;return t?[t,n]:r?[r]:an(function(e){let t,n=e;for(;n=_a(n).target;)t=n;return t}(e))}return}(t);return n?L(n,e):[t]},getSymbolOfExpando:BL,getContextualType:(e,t)=>{const n=hc(e,K_);if(n)return 4&t?Ge(n,()=>$A(n,t)):$A(n,t)},getContextualTypeForObjectLiteralElement:e=>{const t=hc(e,S_);return t?MA(t,void 0):void 0},getContextualTypeForArgumentAtIndex:(e,t)=>{const n=hc(e,B_);return n&&bA(n,t)},getContextualTypeForJsxAttribute:e=>{const t=hc(e,ku);return t&&JA(t,void 0)},isContextSensitive:ES,getTypeOfPropertyOfContextualType:wA,getFullyQualifiedName:es,getResolvedSignature:(e,t,n)=>Xe(e,t,n,0),getCandidateSignaturesForStringLiteralCompletions:function(e,t){const n=new Set,r=[];Ge(t,()=>Xe(e,r,void 0,0));for(const e of r)n.add(e);r.length=0,$e(t,()=>Xe(e,r,void 0,0));for(const e of r)n.add(e);return je(n)},getResolvedSignatureForSignatureHelp:(e,t,n)=>$e(e,()=>Xe(e,t,n,16)),getExpandedParameters:Bd,hasEffectiveRestParameter:yj,containsArgumentsReference:Qg,getConstantValue:e=>{const t=hc(e,Zz);return t?eq(t):void 0},isValidPropertyAccess:(e,t)=>{const n=hc(e,j_);return!!n&&function(e,t){switch(e.kind){case 212:return RO(e,108===e.expression.kind,t,Kw(WM(e.expression)));case 167:return RO(e,!1,t,Kw(WM(e.left)));case 206:return RO(e,!1,t,$k(e))}}(n,yc(t))},isValidPropertyAccessForCompletions:(e,t,n)=>{const r=hc(e,hF);return!!r&&MO(r,t,n)},getSignatureFromDeclaration:e=>{const t=hc(e,s_);return t?zg(t):void 0},isImplementationOfOverload:e=>{const t=hc(e,s_);return t?$z(t):void 0},getImmediateAliasedSymbol:hI,getAliasedSymbol:Ha,getEmitResolver:function(e,t,n){n||gz(e,t);return pe},requiresAddingImplicitUndefined:Hz,getExportsOfModule:ps,getExportsAndPropertiesOfModule:function(e){const t=ps(e),n=cs(e);if(n!==e){const e=z_(n);ms(e)&&le(t,lf(e))}return t},forEachExportAndPropertyOfModule:function(e,t){hs(e).forEach((e,n)=>{Us(n)||t(e,n)});const n=cs(e);if(n!==e){const e=z_(n);ms(e)&&function(e,t){e=Uf(e),3670016&e.flags&&Hp(e).members.forEach((e,n)=>{Ws(e,n)&&t(e,n)})}(e,(e,n)=>{t(e,n)})}},getSymbolWalker:dB(function(e){return Fh(e)||wt},oh,gh,gu,Hp,z_,zN,uf,db,by),getAmbientModules:function(){Wn||(Wn=[],Te.forEach((e,t)=>{XB.test(t)&&Wn.push(e)}));return Wn},getJsxIntrinsicTagNamesAt:function(e){const t=wI(HB.IntrinsicElements,e);return t?lf(t):_},isOptionalParameter:e=>{const t=hc(e,FD);return!!t&&Og(t)},tryGetMemberInModuleExports:(e,t)=>fs(yc(e),t),tryGetMemberInModuleExportsAndProperties:(e,t)=>function(e,t){const n=fs(e,t);if(n)return n;const r=cs(t);if(r===t)return;const i=z_(r);return ms(i)?Am(i,e):void 0}(yc(e),t),tryFindAmbientModule:e=>Dg(e,!0),getApparentType:qf,getUnionType:zb,isTypeAssignableTo:JS,createAnonymousType:Hs,createSignature:Ld,createSymbol:Xo,createIndexInfo:Qh,getAnyType:()=>wt,getStringType:()=>Ut,getStringLiteralType:Ek,getNumberType:()=>Wt,getNumberLiteralType:Pk,getBigIntType:()=>$t,getBigIntLiteralType:Lk,getUnknownType:()=>Ot,createPromiseType:Rj,createArrayType:Kv,getElementTypeOfArrayType:XC,getBooleanType:()=>on,getFalseType:e=>e?Ht:Kt,getTrueType:e=>e?Gt:Zt,getVoidType:()=>ln,getUndefinedType:()=>Lt,getNullType:()=>zt,getESSymbolType:()=>sn,getNeverType:()=>_n,getNonPrimitiveType:()=>mn,getOptionalType:()=>Jt,getPromiseType:()=>gv(!1),getPromiseLikeType:()=>hv(!1),getAnyAsyncIterableType:()=>{const e=Sv(!1);if(e!==On)return hy(e,[wt,wt,wt])},isSymbolAccessible:tc,isArrayType:$C,isTupleType:fw,isArrayLikeType:QC,isEmptyAnonymousObjectType:_T,isTypeInvalidDueToUnionDiscriminant:function(e,t){return t.properties.some(t=>{const n=t.name&&(rP(t.name)?Ek(sC(t.name)):rx(t.name)),r=n&&dC(n)?pC(n):void 0,i=void 0===r?void 0:Zc(e,r);return!!i&&sw(i)&&!JS(Dz(t),i)})},getExactOptionalProperties:function(e){return lf(e).filter(e=>Ow(z_(e)))},getAllPossiblePropertiesOfTypes:function(e){const t=zb(e);if(!(1048576&t.flags))return Iz(t);const n=Zu();for(const r of e)for(const{escapedName:e}of Iz(r))if(!n.has(e)){const r=Kf(t,e);r&&n.set(e,r)}return je(n.values())},getSuggestedSymbolForNonexistentProperty:FO,getSuggestedSymbolForNonexistentJSXAttribute:EO,getSuggestedSymbolForNonexistentSymbol:(e,t,n)=>AO(e,yc(t),n),getSuggestedSymbolForNonexistentModule:IO,getSuggestedSymbolForNonexistentClassMember:DO,getBaseConstraintOfType:xf,getDefaultFromTypeParameter:e=>e&&262144&e.flags?wf(e):void 0,resolveName:(e,t,n,r)=>Ue(t,yc(e),n,void 0,!1,r),getJsxNamespace:e=>vc(jo(e)),getJsxFragmentFactory:e=>{const t=fq(e);return t&&vc(db(t).escapedText)},getAccessibleSymbolChain:Xs,getTypePredicateOfSignature:oh,resolveExternalModuleName:e=>{const t=hc(e,K_);return t&&is(t,t,!0)},resolveExternalModuleSymbol:cs,tryGetThisTypeAt:(e,t,n)=>{const r=hc(e);return r&&aA(r,t,n)},getTypeArgumentConstraint:e=>{const t=hc(e,T_);return t&&function(e){const t=rt(e.parent,Mu);if(!t)return;const n=sR(t);if(!n)return;const r=uf(n[t.typeArguments.indexOf(e)]);return r&&CS(r,nS(n,oR(t,n)))}(t)},getSuggestionDiagnostics:(n,r)=>{const i=hc(n,dP)||pn.fail("Could not determine parsed source file.");if(mT(i,j,e))return _;let o;try{return t=r,yz(i),pn.assert(!!(1&ua(i).flags)),o=le(o,yo.getDiagnostics(i.fileName)),BR(mz(i),(e,t,n)=>{kd(e)||pz(t,!!(33554432&e.flags))||(o||(o=[])).push({...n,category:2})}),o||_}finally{t=void 0}},runWithCancellationToken:(e,n)=>{try{return t=e,n(We)}finally{t=void 0}},getLocalTypeParametersOfClassOrInterfaceOrTypeAlias:iu,isDeclarationVisible:Wc,isPropertyAccessible:BO,getTypeOnlyAliasDeclaration:Ya,getMemberOverrideModifierStatus:function(e,t,n){if(!t.name)return 0;const r=Ss(e),i=Ru(r),o=Id(i),a=z_(r),s=kh(e)&&gu(i),c=(null==s?void 0:s.length)?Id(ye(s),i.thisType):void 0,l=pu(i),_=t.parent?Lv(t):Av(t,16);return OJ(e,a,l,c,i,o,_,jv(t),Iv(t),!1,n)},isTypeParameterPossiblyReferenced:vS,typeHasCallOrConstructSignatures:Oz,getSymbolFlags:Ga,getTypeArgumentsForResolvedSignature:function(e){return void 0===e.mapper?void 0:Xk((e.target||e).typeParameters,e.mapper)},isLibType:jc};function $e(e,t){if(e=mc(e,R_)){const n=[],r=[];for(;e;){const t=ua(e);if(n.push([t,t.resolvedSignature]),t.resolvedSignature=void 0,UT(e)){const t=_a(Ss(e)),n=t.type;r.push([t,n]),t.type=void 0}e=mc(e.parent,R_)}const i=t();for(const[e,t]of n)e.resolvedSignature=t;for(const[e,t]of r)e.type=t;return i}return t()}function Ge(e,t){const n=mc(e,B_);if(n){let t=e;do{ua(t).skipDirectInference=!0,t=t.parent}while(t&&t!==n)}w=!0;const r=$e(e,t);if(w=!1,n){let t=e;do{ua(t).skipDirectInference=void 0,t=t.parent}while(t&&t!==n)}return r}function Xe(e,t,n,r){const i=hc(e,B_);Ee=n;const o=i?jL(i,t,r):void 0;return Ee=void 0,o}var Qe=new Map,Ye=new Map,et=new Map,nt=new Map,ot=new Map,at=new Map,st=new Map,ct=new Map,lt=new Map,_t=new Map,ut=new Map,dt=new Map,pt=new Map,ft=new Map,mt=new Map,gt=[],yt=new Map,vt=new Set,bt=Xo(4,"unknown"),kt=Xo(0,"__resolving__"),St=new Map,Tt=new Map,Ct=new Set,wt=Js(1,"any"),Nt=Js(1,"any",262144,"auto"),Dt=Js(1,"any",void 0,"wildcard"),Ft=Js(1,"any",void 0,"blocked string"),Et=Js(1,"error"),Pt=Js(1,"unresolved"),At=Js(1,"any",65536,"non-inferrable"),It=Js(1,"intrinsic"),Ot=Js(2,"unknown"),Lt=Js(32768,"undefined"),jt=$?Lt:Js(32768,"undefined",65536,"widening"),Rt=Js(32768,"undefined",void 0,"missing"),Bt=se?Rt:Lt,Jt=Js(32768,"undefined",void 0,"optional"),zt=Js(65536,"null"),qt=$?zt:Js(65536,"null",65536,"widening"),Ut=Js(4,"string"),Wt=Js(8,"number"),$t=Js(64,"bigint"),Ht=Js(512,"false",void 0,"fresh"),Kt=Js(512,"false"),Gt=Js(512,"true",void 0,"fresh"),Zt=Js(512,"true");Gt.regularType=Zt,Gt.freshType=Gt,Zt.regularType=Zt,Zt.freshType=Gt,Ht.regularType=Kt,Ht.freshType=Ht,Kt.regularType=Kt,Kt.freshType=Ht;var en,on=zb([Kt,Zt]),sn=Js(4096,"symbol"),ln=Js(16384,"void"),_n=Js(131072,"never"),un=Js(131072,"never",262144,"silent"),dn=Js(131072,"never",void 0,"implicit"),fn=Js(131072,"never",void 0,"unreachable"),mn=Js(67108864,"object"),gn=zb([Ut,Wt]),hn=zb([Ut,Wt,sn]),yn=zb([Wt,$t]),vn=zb([Ut,Wt,on,$t,zt,Lt]),bn=mx(["",""],[Wt]),xn=aS(e=>{return 262144&e.flags?!(t=e).constraint&&!sy(t)||t.constraint===jn?t:t.restrictiveInstantiation||(t.restrictiveInstantiation=qs(t.symbol),t.restrictiveInstantiation.constraint=jn,t.restrictiveInstantiation):e;var t},()=>"(restrictive mapper)"),kn=aS(e=>262144&e.flags?Dt:e,()=>"(permissive mapper)"),Sn=Js(131072,"never",void 0,"unique literal"),Tn=aS(e=>262144&e.flags?Sn:e,()=>"(unique literal mapper)"),Cn=aS(e=>(!en||e!==Bn&&e!==Jn&&e!==zn||en(!0),e),()=>"(unmeasurable reporter)"),wn=aS(e=>(!en||e!==Bn&&e!==Jn&&e!==zn||en(!1),e),()=>"(unreliable reporter)"),Nn=Hs(void 0,F,_,_,_),Dn=Hs(void 0,F,_,_,_);Dn.objectFlags|=2048;var Fn=Hs(void 0,F,_,_,_);Fn.objectFlags|=141440;var En=Xo(2048,"__type");En.members=Zu();var Pn=Hs(En,F,_,_,_),An=Hs(void 0,F,_,_,_),In=$?zb([Lt,zt,An]):Ot,On=Hs(void 0,F,_,_,_);On.instantiations=new Map;var Ln=Hs(void 0,F,_,_,_);Ln.objectFlags|=262144;var jn=Hs(void 0,F,_,_,_),Mn=Hs(void 0,F,_,_,_),Rn=Hs(void 0,F,_,_,_),Bn=qs(),Jn=qs();Jn.constraint=Bn;var zn=qs(),qn=qs(),Un=qs();Un.constraint=qn;var Vn,Wn,$n,Hn,Kn,Xn,Qn,Yn,Zn,er,tr,nr,or,ar,sr,cr,lr,_r,ur,dr,pr,fr,mr,gr,hr,yr,vr,br,xr,kr,Sr,Tr,Cr,wr,Nr,Dr,Fr,Er,Pr,Ar,Ir,Or,Lr,jr,Mr,Rr,Br,Jr,zr,qr,Ur,Vr,Wr,$r,Hr,Kr,Gr,Xr,Qr,Yr,Zr,ei,ti,ni,ri,ii,oi,ai=Lg(1,"<>",0,wt),si=Ld(void 0,void 0,void 0,_,wt,void 0,0,0),ci=Ld(void 0,void 0,void 0,_,Et,void 0,0,0),li=Ld(void 0,void 0,void 0,_,wt,void 0,0,0),_i=Ld(void 0,void 0,void 0,_,un,void 0,0,0),ui=Qh(Wt,Ut,!0),di=Qh(Ut,wt,!1),pi=new Map,fi={get yieldType(){return pn.fail("Not supported")},get returnType(){return pn.fail("Not supported")},get nextType(){return pn.fail("Not supported")}},mi=EB(wt,wt,wt),hi=EB(un,un,un),yi={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:function(e){return Dr||(Dr=tv("AsyncIterator",3,e))||On},getGlobalIterableType:Sv,getGlobalIterableIteratorType:Tv,getGlobalIteratorObjectType:function(e){return Ar||(Ar=tv("AsyncIteratorObject",3,e))||On},getGlobalGeneratorType:function(e){return Ir||(Ir=tv("AsyncGenerator",3,e))||On},getGlobalBuiltinIteratorTypes:function(){return Pr??(Pr=nv(["ReadableStreamAsyncIterator"],1))},resolveIterationType:(e,t)=>CR(e,t,fa.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member),mustHaveANextMethodDiagnostic:fa.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:fa.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:fa.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property},vi={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:function(e){return xr||(xr=tv("Iterator",3,e))||On},getGlobalIterableType:Cv,getGlobalIterableIteratorType:wv,getGlobalIteratorObjectType:function(e){return Sr||(Sr=tv("IteratorObject",3,e))||On},getGlobalGeneratorType:function(e){return Tr||(Tr=tv("Generator",3,e))||On},getGlobalBuiltinIteratorTypes:function(){return Er??(Er=nv(["ArrayIterator","MapIterator","SetIterator","StringIterator"],1))},resolveIterationType:(e,t)=>e,mustHaveANextMethodDiagnostic:fa.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:fa.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:fa.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property},bi=new Map,xi=new Map,ki=new Map,Si=0,Ti=0,Ci=0,wi=!1,Ni=0,Di=[],Fi=[],Pi=[],Ai=0,Ii=[],Oi=[],Li=[],ji=0,Mi=[],Ri=[],Bi=0,Ji=Ek(""),zi=Pk(0),qi=Lk({negative:!1,base10Value:"0"}),Ui=[],Vi=[],Wi=[],$i=0,Hi=!1,Ki=0,Gi=10,Xi=[],Qi=[],Yi=[],Zi=[],eo=[],to=[],no=[],ro=[],io=[],oo=[],ao=[],so=[],co=[],lo=[],_o=[],uo=[],po=[],fo=[],mo=[],go=0,ho=fy(),yo=fy(),vo=zb(je(rJ.keys(),Ek)),bo=new Map,xo=new Map,ko=new Map,To=new Map,Do=new Map,Fo=new Map,Eo=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",1===j.jsx?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];return function(){for(const t of e.getSourceFiles())aB(t,j);let t;Vn=new Map;for(const n of e.getSourceFiles())if(!n.redirectInfo){if(!rf(n)){const e=n.locals.get("globalThis");if(null==e?void 0:e.declarations)for(const t of e.declarations)ho.add(qp(t,fa.Declaration_name_conflicts_with_built_in_global_identifier_0,"globalThis"));aa(Te,n.locals)}if(n.jsGlobalAugmentations&&aa(Te,n.jsGlobalAugmentations),n.patternAmbientModules&&n.patternAmbientModules.length&&($n=G($n,n.patternAmbientModules)),n.moduleAugmentations.length&&(t||(t=[])).push(n.moduleAugmentations),n.symbol&&n.symbol.globalExports){n.symbol.globalExports.forEach((e,t)=>{Te.has(t)||Te.set(t,e)})}}if(t)for(const e of t)for(const t of e)hp(t.parent)&&ca(t);(function(){const e=Ne.escapedName,t=Te.get(e);t?p(t.declarations,t=>{GT(t)||ho.add(qp(t,fa.Declaration_name_conflicts_with_built_in_global_identifier_0,vc(e)))}):Te.set(e,Ne)})(),_a(Ne).type=jt,_a(Ie).type=tv("IArguments",0,!0),_a(bt).type=Et,_a(Fe).type=zs(16,Fe),Zn=tv("Array",1,!0),Kn=tv("Object",0,!0),Xn=tv("Function",0,!0),Qn=X&&tv("CallableFunction",0,!0)||Xn,Yn=X&&tv("NewableFunction",0,!0)||Xn,tr=tv("String",0,!0),nr=tv("Number",0,!0),or=tv("Boolean",0,!0),ar=tv("RegExp",0,!0),cr=Kv(wt),(lr=Kv(Nt))===Nn&&(lr=Hs(void 0,F,_,_,_));if(er=qv("ReadonlyArray",1)||Zn,_r=er?Wv(er,[wt]):cr,sr=qv("ThisType",1),t)for(const e of t)for(const t of e)hp(t.parent)||ca(t);Vn.forEach(({firstFile:e,secondFile:t,conflictingSymbols:n})=>{if(n.size<8)n.forEach(({isBlockScoped:e,firstFileLocations:t,secondFileLocations:n},r)=>{const i=e?fa.Cannot_redeclare_block_scoped_variable_0:fa.Duplicate_identifier_0;for(const e of t)oa(e,i,r,n);for(const e of n)oa(e,i,r,t)});else{const r=je(n.keys()).join(", ");ho.add(uT(qp(e,fa.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,r),qp(t,fa.Conflicts_are_in_this_file))),ho.add(uT(qp(t,fa.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,r),qp(e,fa.Conflicts_are_in_this_file)))}}),Vn=void 0}(),We;function Po(e){return!!hF(e)&&(!!uD(e.name)&&(!(!hF(e.expression)&&!uD(e.expression))&&(uD(e.expression)?"Symbol"===bc(e.expression)&&zN(e.expression)===(Zy("Symbol",1160127,void 0)||bt):!!uD(e.expression.expression)&&("Symbol"===bc(e.expression.name)&&"globalThis"===bc(e.expression.expression)&&zN(e.expression.expression)===Fe))))}function Io(e){return e?mt.get(e):void 0}function Oo(e,t){return e&&mt.set(e,t),t}function jo(e){if(e){const t=Sd(e);if(t)if(QE(e)){if(t.localJsxFragmentNamespace)return t.localJsxFragmentNamespace;const n=t.pragmas.get("jsxfrag");if(n){const e=Ze(n)?n[0]:n;if(t.localJsxFragmentFactory=lO(e.arguments.factory,M),bJ(t.localJsxFragmentFactory,Mo,i_),t.localJsxFragmentFactory)return t.localJsxFragmentNamespace=db(t.localJsxFragmentFactory).escapedText}const r=fq(e);if(r)return t.localJsxFragmentFactory=r,t.localJsxFragmentNamespace=db(r).escapedText}else{const e=function(e){if(e.localJsxNamespace)return e.localJsxNamespace;const t=e.pragmas.get("jsx");if(t){const n=Ze(t)?t[0]:t;if(e.localJsxFactory=lO(n.arguments.factory,M),bJ(e.localJsxFactory,Mo,i_),e.localJsxFactory)return e.localJsxNamespace=db(e.localJsxFactory).escapedText}}(t);if(e)return t.localJsxNamespace=e}}return ii||(ii="React",j.jsxFactory?(bJ(oi=lO(j.jsxFactory,M),Mo),oi&&(ii=db(oi).escapedText)):j.reactNamespace&&(ii=yc(j.reactNamespace))),oi||(oi=bw.createQualifiedName(bw.createIdentifier(vc(ii)),"createElement")),ii}function Mo(e){return ET(e,-1,-1),EJ(e,Mo,void 0)}function Ro(e,t,n,...r){const i=Jo(t,n,...r);return i.skippedOn=e,i}function Bo(e,t,...n){return e?qp(e,t,...n):nk(t,...n)}function Jo(e,t,...n){const r=Bo(e,t,...n);return ho.add(r),r}function zo(e){return No(Sd(e).fileName,[".cts",".cjs"])?fa.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax:fa.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript}function qo(e,t){e?ho.add(t):yo.add({...t,category:2})}function Vo(e,t,n,...r){if(t.pos<0||t.end<0){if(!e)return;const i=Sd(t);return void qo(e,"message"in n?ek(i,0,0,n,...r):Gp(i,n))}qo(e,"message"in n?qp(t,n,...r):Wp(Sd(t),t,n))}function Wo(e,t,n,...r){const i=Jo(e,n,...r);if(t){uT(i,qp(e,fa.Did_you_forget_to_use_await))}return i}function $o(e,t){const n=Array.isArray(e)?p(e,Yc):Yc(e);return n&&uT(t,qp(n,fa.The_declaration_was_marked_as_deprecated_here)),yo.add(t),t}function Ho(e){const t=Cs(e);return t&&d(e.declarations)>1?64&t.flags?H(e.declarations,Ko):b(e.declarations,Ko):!!e.valueDeclaration&&Ko(e.valueDeclaration)||d(e.declarations)&&b(e.declarations,Ko)}function Ko(e){return!!(536870912&eU(e))}function Go(e,t,n){return $o(t,qp(e,fa._0_is_deprecated,n))}function Xo(e,t,n){f++;const r=new s(33554432|e,t);return r.links=new cJ,r.links.checkFlags=n||0,r}function Qo(e,t){const n=Xo(1,e);return n.links.type=t,n}function Yo(e,t){const n=Xo(4,e);return n.links.type=t,n}function Zo(e){let t=0;return 2&e&&(t|=111551),1&e&&(t|=111550),4&e&&(t|=0),8&e&&(t|=900095),16&e&&(t|=110991),32&e&&(t|=899503),64&e&&(t|=788872),256&e&&(t|=899327),128&e&&(t|=899967),512&e&&(t|=110735),8192&e&&(t|=103359),32768&e&&(t|=46015),65536&e&&(t|=78783),262144&e&&(t|=526824),524288&e&&(t|=788968),2097152&e&&(t|=2097152),t}function ea(e,t){t.mergeId||(t.mergeId=eJ,eJ++),Xi[t.mergeId]=e}function ta(e){const t=Xo(e.flags,e.escapedName);return t.declarations=e.declarations?e.declarations.slice():[],t.parent=e.parent,e.valueDeclaration&&(t.valueDeclaration=e.valueDeclaration),e.constEnumOnlyModule&&(t.constEnumOnlyModule=!0),e.members&&(t.members=new Map(e.members)),e.exports&&(t.exports=new Map(e.exports)),ea(t,e),t}function na(e,t,n=!1){if(!(e.flags&Zo(t.flags))||67108864&(t.flags|e.flags)){if(t===e)return e;if(!(33554432&e.flags)){const n=$a(e);if(n===bt)return t;if(n.flags&Zo(t.flags)&&!(67108864&(t.flags|n.flags)))return r(e,t),t;e=ta(n)}512&t.flags&&512&e.flags&&e.constEnumOnlyModule&&!t.constEnumOnlyModule&&(e.constEnumOnlyModule=!1),e.flags|=t.flags,t.valueDeclaration&&vg(e,t.valueDeclaration),le(e.declarations,t.declarations),t.members&&(e.members||(e.members=Zu()),aa(e.members,t.members,n)),t.exports&&(e.exports||(e.exports=Zu()),aa(e.exports,t.exports,n,e)),n||ea(e,t)}else 1024&e.flags?e!==Fe&&Jo(t.declarations&&Fc(t.declarations[0]),fa.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity,pc(e)):r(e,t);return e;function r(e,t){const n=!!(384&e.flags||384&t.flags),r=!!(2&e.flags||2&t.flags),o=n?fa.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:r?fa.Cannot_redeclare_block_scoped_variable_0:fa.Duplicate_identifier_0,a=t.declarations&&Sd(t.declarations[0]),s=e.declarations&&Sd(e.declarations[0]),c=Cd(a,j.checkJs),l=Cd(s,j.checkJs),_=pc(t);if(a&&s&&Vn&&!n&&a!==s){const n=-1===ra(a.path,s.path)?a:s,o=n===a?s:a,u=q(Vn,`${n.path}|${o.path}`,()=>({firstFile:n,secondFile:o,conflictingSymbols:new Map})),d=q(u.conflictingSymbols,_,()=>({isBlockScoped:r,firstFileLocations:[],secondFileLocations:[]}));c||i(d.firstFileLocations,t),l||i(d.secondFileLocations,e)}else c||ia(t,o,_,e),l||ia(e,o,_,t)}function i(e,t){if(t.declarations)for(const n of t.declarations)_e(e,n)}}function ia(e,t,n,r){p(e.declarations,e=>{oa(e,t,n,r.declarations)})}function oa(e,t,n,r){const i=(Qm(e,!1)?Zm(e):Fc(e))||e,o=function(e,t,...n){const r=e?qp(e,t,...n):nk(t,...n);return ho.lookup(r)||(ho.add(r),r)}(i,t,n);for(const e of r||_){const t=(Qm(e,!1)?Zm(e):Fc(e))||e;if(t===i)continue;o.relatedInformation=o.relatedInformation||[];const r=qp(t,fa._0_was_also_declared_here,n),a=qp(t,fa.and_here);d(o.relatedInformation)>=5||H(o.relatedInformation,e=>0===sk(e,a)||0===sk(e,r))||uT(o,d(o.relatedInformation)?a:r)}}function aa(e,t,n=!1,r){t.forEach((t,i)=>{const o=e.get(i),a=o?na(o,t,n):ks(t);r&&o&&(a.parent=r),e.set(i,a)})}function ca(e){var t,n,r;const i=e.parent;if((null==(t=i.symbol.declarations)?void 0:t[0])===i)if(hp(i))aa(Te,i.symbol.exports);else{let t=os(e,e,33554432&e.parent.parent.flags?void 0:fa.Invalid_module_name_in_augmentation_module_0_cannot_be_found,!1,!0);if(!t)return;if(t=cs(t),1920&t.flags)if(H($n,e=>t===e.symbol)){const n=na(i.symbol,t,!0);Hn||(Hn=new Map),Hn.set(e.text,n)}else{if((null==(n=t.exports)?void 0:n.get("__export"))&&(null==(r=i.symbol.exports)?void 0:r.size)){const e=Dd(t,"resolvedExports");for(const[n,r]of je(i.symbol.exports.entries()))e.has(n)&&!t.exports.has(n)&&na(e.get(n),r)}na(t,i.symbol)}else Jo(e,fa.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity,e.text)}else pn.assert(i.symbol.declarations.length>1)}function _a(e){if(33554432&e.flags)return e.links;const t=uJ(e);return Qi[t]??(Qi[t]=new cJ)}function ua(e){const t=_J(e);return Yi[t]||(Yi[t]=new lJ)}function da(e,t,n){if(n){const r=ks(e.get(t));if(r){if(r.flags&n)return r;if(2097152&r.flags){if(Ga(r)&n)return r}}}}function pa(t,n){const r=Sd(t),i=Sd(n),o=Op(t);if(r!==i){if(R&&(r.externalModuleIndicator||i.externalModuleIndicator)||!j.outFile||fv(n)||33554432&t.flags)return!0;if(a(n,t))return!0;const o=e.getSourceFiles();return o.indexOf(r)<=o.indexOf(i)}if(16777216&n.flags||fv(n)||qN(n))return!0;if(t.pos<=n.pos&&(!AD(t)||!um(n.parent)||t.initializer||t.exclamationToken)){if(209===t.kind){const e=Dh(n,209);return e?mc(e,fF)!==mc(t,fF)||t.pose===t?"quit":ND(e)?e.parent.parent===t:!B&&ED(e)&&(e.parent===t||OD(e.parent)&&e.parent.parent===t||hl(e.parent)&&e.parent.parent===t||AD(e.parent)&&e.parent.parent===t||FD(e.parent)&&e.parent.parent.parent===t));return!e||!(B||!ED(e))&&!!mc(n,t=>t===e?"quit":s_(t)&&!lm(t))}return AD(t)?!c(t,n,!1):!rc(t,t.parent)||!(V&&em(t)===em(n)&&a(n,t))}return!!(282===n.parent.kind||278===n.parent.kind&&n.parent.isExportEquals)||(!(278!==n.kind||!n.isExportEquals)||!!a(n,t)&&(!V||!em(t)||!AD(t)&&!rc(t,t.parent)||!c(t,n,!0)));function a(e,t){return s(e,t)}function s(e,t){return!!mc(e,n=>{if(n===o)return"quit";if(s_(n))return!lm(n);if(LD(n))return t.pos=r&&o.pos<=i){const n=bw.createPropertyAccessExpression(bw.createThis(),e);IT(n.expression,n),IT(n,o),n.flowNode=o.returnFlowNode;if(!gT(IE(n,t,Nw(t))))return!0}return!1}(e,z_(Ss(t)),D(t.parent.members,LD),t.parent.pos,n.pos))return!0}}}else{if(!(173===t.kind&&!Iv(t))||em(e)!==em(t))return!0}}const i=rt(n.parent,ED);if(i&&i.expression===n){if(FD(i.parent))return!!s(i.parent.parent.parent,t)||"quit";if(OD(i.parent))return!!s(i.parent.parent,t)||"quit"}return!1})}function c(e,t,n){if(t.end>e.end)return!1;return void 0===mc(t,t=>{if(t===e)return"quit";switch(t.kind){case 220:return!0;case 173:return!n||!(AD(e)&&t.parent===e.parent||rc(e,e.parent)&&t.parent===e.parent.parent)||"quit";case 242:switch(t.parent.kind){case 178:case 175:case 179:return!0;default:return!1}default:return!1}})}}function ma(e){return ua(e).declarationRequiresScopeChange}function ga(e,t){ua(e).declarationRequiresScopeChange=t}function ha(e,t,n){return t?uT(e,qp(t,282===t.kind||279===t.kind||281===t.kind?fa._0_was_exported_here:fa._0_was_imported_here,n)):e}function ya(e){return tt(e)?vc(e):jp(e)}function va(e,t,n){if(!uD(e)||e.escapedText!==t||vz(e)||fv(e))return!1;const r=im(e,!1,!1);let i=r;for(;i;){if(m_(i.parent)){const o=Ss(i.parent);if(!o)break;if(Am(z_(o),t))return Jo(e,fa.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,ya(n),pc(o)),!0;if(i===r&&!Iv(i)){if(Am(Ru(o).thisType,t))return Jo(e,fa.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,ya(n)),!0}}i=i.parent}return!1}function ba(e){const t=xa(e);return!(!t||!ns(t,64,!0))&&(Jo(e,fa.Cannot_extend_an_interface_0_Did_you_mean_implements,ep(t)),!0)}function xa(e){switch(e.kind){case 80:case 212:return e.parent?xa(e.parent):void 0;case 234:if(ub(e.expression))return e.expression;default:return}}function ka(e){return"any"===e||"string"===e||"number"===e||"boolean"===e||"never"===e||"unknown"===e}function Sa(e,t,n){return!!t&&!!mc(e,e=>e===t||!!(e===n||s_(e)&&(!lm(e)||3&Rh(e)))&&"quit")}function Ta(e){switch(e.kind){case 272:return e;case 274:return e.parent;case 275:return e.parent.parent;case 277:return e.parent.parent.parent;default:return}}function Ca(e){return e.declarations&&k(e.declarations,wa)}function wa(e){return 272===e.kind||271===e.kind||274===e.kind&&!!e.name||275===e.kind||281===e.kind||277===e.kind||282===e.kind||278===e.kind&&vh(e)||AF(e)&&2===og(e)&&vh(e)||Dx(e)&&AF(e.parent)&&e.parent.left===e&&64===e.parent.operatorToken.kind&&Na(e.parent.right)||305===e.kind||304===e.kind&&Na(e.initializer)||261===e.kind&&zm(e)||209===e.kind&&zm(e.parent.parent)}function Na(e){return yh(e)||TF(e)&&ML(e)}function Da(e,t){const n=Ja(e);if(n){const e=Px(n.expression).arguments[0];return uD(n.name)?$a(Am(Zg(e),n.name.escapedText)):void 0}if(fE(e)||284===e.moduleReference.kind){const n=is(e,Em(e)||Fm(e)),r=cs(n);if(r&&102<=R&&R<=199){const n=Ma(r,"module.exports",e,t);if(n)return n}return Xa(e,n,r,!1),r}const r=Za(e.moduleReference,t);return function(e,t){if(Xa(e,void 0,t,!1)&&!e.isTypeOnly){const t=Ya(Ss(e)),n=282===t.kind||279===t.kind,r=n?fa.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:fa.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type,i=n?fa._0_was_exported_here:fa._0_was_imported_here,o=279===t.kind?"*":Xd(t.name);uT(Jo(e.moduleReference,r),qp(t,i,o))}}(e,r),r}function Fa(e,t,n,r){const i=e.exports.get("export="),o=i?Am(z_(i),t,!0):e.exports.get(t),a=$a(o,r);return Xa(n,o,a,!1),a}function Ea(e){return ME(e)&&!e.isExportEquals||Av(e,2048)||JE(e)||OE(e)}function Pa(t){return Ju(t)?e.getEmitSyntaxForUsageLocation(Sd(t),t):void 0}function Aa(e,t){if(100<=R&&R<=199){if(99===Pa(e)){t??(t=is(e,e,!0));const n=t&&Td(t);return n&&(of(n)||".d.json.ts"===bO(n.fileName))}}return!1}function Oa(t,n,r,i){const o=t&&Pa(i);if(t&&void 0!==o){const n=e.getImpliedNodeFormatForEmit(t);if(99===o&&1===n&&100<=R&&R<=199)return!0;if(99===o&&99===n)return!1}if(!W)return!1;if(!t||t.isDeclarationFile){const e=Fa(n,"default",void 0,!0);return(!e||!H(e.declarations,Ea))&&!Fa(n,yc("__esModule"),void 0,r)}return Im(t)?"object"!=typeof t.externalModuleIndicator&&!Fa(n,yc("__esModule"),void 0,r):ds(n)}function La(t,n,r){var i;const o=null==(i=t.declarations)?void 0:i.find(dP),a=ja(n);let s,c;if(mp(t))s=t;else{if(o&&a&&102<=R&&R<=199&&1===Pa(a)&&99===e.getImpliedNodeFormatForEmit(o)&&(c=Fa(t,"module.exports",n,r)))return Dk(j)?(Xa(n,c,void 0,!1),c):void Jo(n.name,fa.Module_0_can_only_be_default_imported_using_the_1_flag,pc(t),"esModuleInterop");s=Fa(t,"default",n,r)}if(!a)return s;const l=Aa(a,t),_=Oa(o,t,r,a);if(s||_||l){if(_||l){const e=cs(t,r)||$a(t,r);return Xa(n,t,e,!1),e}}else if(ds(t)&&!W){const e=R>=5?"allowSyntheticDefaultImports":"esModuleInterop",r=t.exports.get("export=").valueDeclaration,i=Jo(n.name,fa.Module_0_can_only_be_default_imported_using_the_1_flag,pc(t),e);r&&uT(i,qp(r,fa.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,e))}else NE(n)?function(e,t){var n,r,i;if(null==(n=e.exports)?void 0:n.has(t.symbol.escapedName))Jo(t.name,fa.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,pc(e),pc(t.symbol));else{const n=Jo(t.name,fa.Module_0_has_no_default_export,pc(e)),o=null==(r=e.exports)?void 0:r.get("__export");if(o){const e=null==(i=o.declarations)?void 0:i.find(e=>{var t,n;return!!(RE(e)&&e.moduleSpecifier&&(null==(n=null==(t=is(e,e.moduleSpecifier))?void 0:t.exports)?void 0:n.has("default")))});e&&uT(n,qp(e,fa.export_Asterisk_does_not_re_export_a_default))}}}(t,n):Ba(t,t,n,ql(n)&&n.propertyName||n.name);return Xa(n,s,void 0,!1),s}function ja(e){switch(e.kind){case 274:return e.parent.moduleSpecifier;case 272:return WE(e.moduleReference)?e.moduleReference.expression:void 0;case 275:case 282:return e.parent.parent.moduleSpecifier;case 277:return e.parent.parent.parent.moduleSpecifier;default:return pn.assertNever(e)}}function Ma(e,t,n,r){var i;if(1536&e.flags){const o=gs(e).get(t),a=$a(o,r);return Xa(n,o,a,!1,null==(i=_a(e).typeOnlyExportStarMap)?void 0:i.get(t),t),a}}function Ra(e,t,n=!1){var r;const i=Em(e)||e.moduleSpecifier,o=is(e,i),a=!hF(t)&&t.propertyName||t.name;if(!uD(a)&&11!==a.kind)return;const s=Qd(a),c=ls(o,i,!1,"default"===s&&W);if(c&&(s||11===a.kind)){if(mp(o))return o;let l;l=o&&o.exports&&o.exports.get("export=")?Am(z_(c),s,!0):function(e,t){if(3&e.flags){const n=e.valueDeclaration.type;if(n)return $a(Am($k(n),t))}}(c,s),l=$a(l,n);let _=Ma(c,s,t,n);if(void 0===_&&"default"===s){const e=null==(r=o.declarations)?void 0:r.find(dP);(Aa(i,o)||Oa(e,o,n,i))&&(_=cs(o,n)||$a(o,n))}const u=_&&l&&_!==l?function(e,t){if(e===bt&&t===bt)return bt;if(790504&e.flags)return e;const n=Xo(e.flags|t.flags,e.escapedName);return pn.assert(e.declarations||t.declarations),n.declarations=Z(G(e.declarations,t.declarations),ht),n.parent=e.parent||t.parent,e.valueDeclaration&&(n.valueDeclaration=e.valueDeclaration),t.members&&(n.members=new Map(t.members)),e.exports&&(n.exports=new Map(e.exports)),n}(l,_):_||l;return ql(t)&&Aa(i,o)&&"default"!==s?Jo(a,fa.Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0,gi[R]):u||Ba(o,c,e,a),u}}function Ba(e,t,n,r){var i;const o=es(e,n),a=jp(r),s=uD(r)?IO(r,t):void 0;if(void 0!==s){const e=pc(s),t=Jo(r,fa._0_has_no_exported_member_named_1_Did_you_mean_2,o,a,e);s.valueDeclaration&&uT(t,qp(s.valueDeclaration,fa._0_is_declared_here,e))}else(null==(i=e.exports)?void 0:i.has("default"))?Jo(r,fa.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,o,a):function(e,t,n,r,i){var o,a;const s=null==(a=null==(o=rt(r.valueDeclaration,uu))?void 0:o.locals)?void 0:a.get(Qd(t)),c=r.exports;if(s){const r=null==c?void 0:c.get("export=");if(r)Ps(r,s)?function(e,t,n,r){if(R>=5){Jo(t,Dk(j)?fa._0_can_only_be_imported_by_using_a_default_import:fa._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n)}else if(Om(e)){Jo(t,Dk(j)?fa._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:fa._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n)}else{Jo(t,Dk(j)?fa._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:fa._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n,n,r)}}(e,t,n,i):Jo(t,fa.Module_0_has_no_exported_member_1,i,n);else{const e=c?x(Tg(c),e=>!!Ps(e,s)):void 0,r=e?Jo(t,fa.Module_0_declares_1_locally_but_it_is_exported_as_2,i,n,pc(e)):Jo(t,fa.Module_0_declares_1_locally_but_it_is_not_exported,i,n);s.declarations&&uT(r,...P(s.declarations,(e,t)=>qp(e,0===t?fa._0_is_declared_here:fa.and_here,n)))}}else Jo(t,fa.Module_0_has_no_exported_member_1,i,n)}(n,r,a,e,o)}function Ja(e){if(fE(e)&&e.initializer&&hF(e.initializer))return e.initializer}function za(e,t,n){const r=e.propertyName||e.name;if(Yd(r)){const t=ja(e),r=t&&is(e,t);if(r)return La(r,e,!!n)}const i=e.parent.parent.moduleSpecifier?Ra(e.parent.parent,e,n):11===r.kind?void 0:ns(r,t,!1,n);return Xa(e,void 0,i,!1),i}function qa(e,t){if(MF(e))return SM(e).symbol;if(!i_(e)&&!ub(e))return;const n=ns(e,901119,!0,t);return n||(SM(e),ua(e).resolvedSymbol)}function Ua(e,t=!1){switch(e.kind){case 272:case 261:return Da(e,t);case 274:return function(e,t){const n=is(e,e.parent.moduleSpecifier);if(n)return La(n,e,t)}(e,t);case 275:return function(e,t){const n=e.parent.parent.moduleSpecifier,r=is(e,n),i=ls(r,n,t,!1);return Xa(e,r,i,!1),i}(e,t);case 281:return function(e,t){const n=e.parent.moduleSpecifier,r=n&&is(e,n),i=n&&ls(r,n,t,!1);return Xa(e,r,i,!1),i}(e,t);case 277:case 209:return function(e,t){if(jE(e)&&Yd(e.propertyName||e.name)){const n=ja(e),r=n&&is(e,n);if(r)return La(r,e,t)}const n=fF(e)?ny(e):e.parent.parent.parent,r=Ja(n),i=Ra(n,r||e,t),o=e.propertyName||e.name;return r&&i&&uD(o)?$a(Am(z_(i),o.escapedText),t):(Xa(e,void 0,i,!1),i)}(e,t);case 282:return za(e,901119,t);case 278:case 227:return function(e,t){const n=qa(ME(e)?e.expression:e.right,t);return Xa(e,void 0,n,!1),n}(e,t);case 271:return function(e,t){if(_u(e.parent)){const n=cs(e.parent.symbol,t);return Xa(e,void 0,n,!1),n}}(e,t);case 305:return ns(e.name,901119,!0,t);case 304:return qa(e.initializer,t);case 213:case 212:return function(e,t){if(AF(e.parent)&&e.parent.left===e&&64===e.parent.operatorToken.kind)return qa(e.parent.right,t)}(e,t);default:return pn.fail()}}function Va(e,t=901119){return!!e&&(2097152==(e.flags&(2097152|t))||!!(2097152&e.flags&&67108864&e.flags))}function $a(e,t){return!t&&Va(e)?Ha(e):e}function Ha(e){pn.assert(!!(2097152&e.flags),"Should only get Alias here.");const t=_a(e);if(t.aliasTarget)t.aliasTarget===kt&&(t.aliasTarget=bt);else{t.aliasTarget=kt;const n=Ca(e);if(!n)return pn.fail();const r=Ua(n);t.aliasTarget===kt?t.aliasTarget=r||bt:Jo(n,fa.Circular_definition_of_import_alias_0,pc(e))}return t.aliasTarget}function Ga(e,t,n){const r=t&&Ya(e),i=r&&RE(r),o=r&&(i?is(r.moduleSpecifier,r.moduleSpecifier,!0):Ha(r.symbol)),a=i&&o?hs(o):void 0;let s,c=n?0:e.flags;for(;2097152&e.flags;){const t=As(Ha(e));if(!i&&t===o||(null==a?void 0:a.get(t.escapedName))===t)break;if(t===bt)return-1;if(t===e||(null==s?void 0:s.has(t)))break;2097152&t.flags&&(s?s.add(t):s=new Set([e,t])),c|=t.flags,e=t}return c}function Xa(e,t,n,r,i,o){if(!e||hF(e))return!1;const a=Ss(e);if(Wl(e)){return _a(a).typeOnlyDeclaration=e,!0}if(i){const e=_a(a);return e.typeOnlyDeclaration=i,a.escapedName!==o&&(e.typeOnlyExportStarName=o),!0}const s=_a(a);return Qa(s,t,r)||Qa(s,n,r)}function Qa(e,t,n){var r;if(t&&(void 0===e.typeOnlyDeclaration||n&&!1===e.typeOnlyDeclaration)){const n=(null==(r=t.exports)?void 0:r.get("export="))??t,i=n.declarations&&x(n.declarations,Wl);e.typeOnlyDeclaration=i??_a(n).typeOnlyDeclaration??!1}return!!e.typeOnlyDeclaration}function Ya(e,t){var n;if(!(2097152&e.flags))return;const r=_a(e);if(void 0===r.typeOnlyDeclaration){r.typeOnlyDeclaration=!1;const t=$a(e);Xa(null==(n=e.declarations)?void 0:n[0],Ca(e)&&hI(e),t,!0)}if(void 0===t)return r.typeOnlyDeclaration||void 0;if(r.typeOnlyDeclaration){return Ga(279===r.typeOnlyDeclaration.kind?$a(hs(r.typeOnlyDeclaration.symbol.parent).get(r.typeOnlyExportStarName||e.escapedName)):Ha(r.typeOnlyDeclaration.symbol))&t?r.typeOnlyDeclaration:void 0}}function Za(e,t){return 80===e.kind&&hb(e)&&(e=e.parent),80===e.kind||167===e.parent.kind?ns(e,1920,!1,t):(pn.assert(272===e.parent.kind),ns(e,901119,!1,t))}function es(e,t){return e.parent?es(e.parent,t)+"."+pc(e):pc(e,t,void 0,36)}function ns(e,t,n,r,i){if(Pd(e))return;const o=1920|(Om(e)?111551&t:0);let a;if(80===e.kind){const r=t===o||iy(e)?fa.Cannot_find_namespace_0:JN(db(e)),s=Om(e)&&!iy(e)?function(e,t){if(Uy(e.parent)){const n=function(e){if(mc(e,e=>Nu(e)||16777216&e.flags?Ag(e):"quit"))return;const t=Kg(e);if(t&&YF(t)&&hg(t.expression)){const e=Ss(t.expression.left);if(e)return rs(e)}if(t&&TF(t)&&hg(t.parent)&&YF(t.parent.parent)){const e=Ss(t.parent.left);if(e)return rs(e)}if(t&&(Vf(t)||cP(t))&&AF(t.parent.parent)&&6===og(t.parent.parent)){const e=Ss(t.parent.parent.left);if(e)return rs(e)}const n=Hg(e);if(n&&s_(n)){const e=Ss(n);return e&&e.valueDeclaration}}(e.parent);if(n)return Ue(n,e,t,void 0,!0)}}(e,t):void 0;if(a=ks(Ue(i||e,e,t,n||s?void 0:r,!0,!1)),!a)return ks(s)}else if(167===e.kind||212===e.kind){const r=167===e.kind?e.left:e.expression,s=167===e.kind?e.right:e.name;let c=ns(r,o,n,!1,i);if(!c||Pd(s))return;if(c===bt)return c;if(c.valueDeclaration&&Om(c.valueDeclaration)&&100!==Ck(j)&&fE(c.valueDeclaration)&&c.valueDeclaration.initializer&&HL(c.valueDeclaration.initializer)){const e=c.valueDeclaration.initializer.arguments[0],t=is(e,e);if(t){const e=cs(t);e&&(c=e)}}if(a=ks(da(gs(c),s.escapedText,t)),!a&&2097152&c.flags&&(a=ks(da(gs(Ha(c)),s.escapedText,t))),!a){if(!n){const n=es(c),r=jp(s),i=IO(s,c);if(i)return void Jo(s,fa._0_has_no_exported_member_named_1_Did_you_mean_2,n,r,pc(i));const o=wD(e)&&function(e){for(;wD(e.parent);)e=e.parent;return e}(e),a=Kn&&788968&t&&o&&!NF(o.parent)&&function(e){let t=db(e),n=Ue(t,t,111551,void 0,!0);if(n){for(;wD(t.parent);){if(n=Am(z_(n),t.parent.right.escapedText),!n)return;t=t.parent}return n}}(o);if(a)return void Jo(o,fa._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,zp(o));if(1920&t&&wD(e.parent)){const t=ks(da(gs(c),s.escapedText,788968));if(t)return void Jo(e.parent.right,fa.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,pc(t),vc(e.parent.right.escapedText))}Jo(s,fa.Namespace_0_has_no_exported_member_1,n,r)}return}}else pn.assertNever(e,"Unknown entity name kind.");return!iy(e)&&i_(e)&&(2097152&a.flags||278===e.parent.kind)&&Xa(hh(e),a,void 0,!0),a.flags&t||r?a:Ha(a)}function rs(e){const t=e.parent.valueDeclaration;if(!t)return;return(Hm(t)?Xm(t):Lu(t)?Gm(t):void 0)||t}function is(e,t,n){const r=1===Ck(j)?fa.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:fa.Cannot_find_module_0_or_its_corresponding_type_declarations;return os(e,t,n?void 0:r,n)}function os(e,t,n,r=!1,i=!1){return Ju(t)?as(e,t.text,n,r?void 0:t,i):void 0}function as(t,n,r,i,o=!1){var a,s,c,l,_,u,d,p,f,m,g,h;if(i&&Qt(n,"@types/")){Jo(i,fa.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1,Yt(n,"@types/"),n)}const y=Dg(n,!0);if(y)return y;const v=Sd(t),b=Ju(t)?t:(null==(a=xE(t)?t:t.parent&&xE(t.parent)&&t.parent.name===t?t.parent:void 0)?void 0:a.name)||(null==(s=gf(t)?t:void 0)?void 0:s.argument.literal)||(fE(t)&&t.initializer&&Bm(t.initializer,!0)?t.initializer.arguments[0]:void 0)||(null==(c=mc(t,ff))?void 0:c.arguments[0])||(null==(l=mc(t,nn(wE,tA,RE)))?void 0:l.moduleSpecifier)||(null==(_=mc(t,Dm))?void 0:_.moduleReference.expression),x=b&&Ju(b)?e.getModeForUsageLocation(v,b):e.getDefaultResolutionModeForFile(v),k=Ck(j),S=null==(u=e.getResolvedModule(v,n,x))?void 0:u.resolvedModule,T=i&&S&&nW(j,S,v),C=S&&(!T||T===fa.Module_0_was_resolved_to_1_but_jsx_is_not_set)&&e.getSourceFile(S.resolvedFileName);if(C){if(T&&Jo(i,T,n,S.resolvedFileName),S.resolvedUsingTsExtension&&vO(n)){const e=(null==(d=mc(t,wE))?void 0:d.importClause)||mc(t,nn(CE,RE));(i&&e&&!e.isTypeOnly||mc(t,ff))&&Jo(i,fa.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,function(e){const t=XS(n,e);if(Bk(R)||99===x){const r=vO(n)&&KR(j);return t+(".mts"===e||".d.mts"===e?r?".mts":".mjs":".cts"===e||".d.mts"===e?r?".cts":".cjs":r?".ts":".js")}return t}(pn.checkDefined(Cb(n))))}else if(S.resolvedUsingTsExtension&&!KR(j,v.fileName)){const e=(null==(p=mc(t,wE))?void 0:p.importClause)||mc(t,nn(CE,RE));if(i&&!(null==e?void 0:e.isTypeOnly)&&!mc(t,lF)){const e=pn.checkDefined(Cb(n));Jo(i,fa.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled,e)}}else if(j.rewriteRelativeImportExtensions&&!(33554432&t.flags)&&!vO(n)&&!gf(t)&&!$l(t)){const t=Cg(n,j);if(!S.resolvedUsingTsExtension&&t)Jo(i,fa.This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0,la(Uo(v.fileName,e.getCurrentDirectory()),S.resolvedFileName,zy(e)));else if(S.resolvedUsingTsExtension&&!t&&ev(C,e))Jo(i,fa.This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path,Lo(n));else if(S.resolvedUsingTsExtension&&t){const t=null==(f=e.getRedirectFromSourceFile(C.path))?void 0:f.resolvedRef;if(t){const n=!e.useCaseSensitiveFileNames(),r=e.getCommonSourceDirectory(),o=bU(t.commandLine,n);sa(r,o,n)!==sa(j.outDir||r,t.commandLine.options.outDir||o,n)&&Jo(i,fa.This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files)}}}if(C.symbol){if(i&&S.isExternalLibraryImport&&!rT(S.extension)&&ss(!1,i,v,x,S,n),i&&(100===R||101===R)){const e=1===v.impliedNodeFormat&&!mc(t,ff)||!!mc(t,CE),r=mc(t,e=>lF(e)||RE(e)||wE(e)||tA(e));if(e&&99===C.impliedNodeFormat&&!mC(r))if(mc(t,CE))Jo(i,fa.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,n);else{let e;const t=aT(v.fileName);".ts"!==t&&".js"!==t&&".tsx"!==t&&".jsx"!==t||(e=hd(v));const o=273===(null==r?void 0:r.kind)&&(null==(m=r.importClause)?void 0:m.isTypeOnly)?fa.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:206===(null==r?void 0:r.kind)?fa.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:fa.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;ho.add(Wp(Sd(i),i,ik(e,o,n)))}}return ks(C.symbol)}i&&r&&!DC(i)&&Jo(i,fa.File_0_is_not_a_module,C.fileName)}else{if($n){const e=Xt($n,e=>e.pattern,n);if(e){const t=Hn&&Hn.get(n);return ks(t?t:e.symbol)}}if(i){if((!S||rT(S.extension)||void 0!==T)&&T!==fa.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type){if(r){if(S){const t=e.getRedirectFromSourceFile(S.resolvedFileName);if(null==t?void 0:t.outputDts)return void Jo(i,fa.Output_file_0_has_not_been_built_from_source_file_1,t.outputDts,S.resolvedFileName)}if(T)Jo(i,T,n,S.resolvedFileName);else{const t=So(n)&&!Co(n),o=3===k||99===k;if(!Ak(j)&&wo(n,".json")&&1!==k&&Jk(j))Jo(i,fa.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,n);else if(99===x&&o&&t){const t=Uo(n,Ao(v.path)),r=null==(g=Eo.find(([n,r])=>e.fileExists(t+n)))?void 0:g[1];r?Jo(i,fa.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,n+r):Jo(i,fa.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(null==(h=e.getResolvedModule(v,n,x))?void 0:h.alternateResult){Vo(!0,i,ik(gd(v,e,n,x,n),r,n))}else Jo(i,r,n)}}return}if(o){Jo(i,fa.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented,n,S.resolvedFileName)}else ss(te&&!!r,i,v,x,S,n)}}}function ss(t,n,r,i,{packageId:o,resolvedFileName:a},s){if(DC(n))return;let c;!Fs(s)&&o&&(c=gd(r,e,s,i,o.name)),Vo(t,n,ik(c,fa.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,s,a))}function cs(e,t){if(null==e?void 0:e.exports){const n=function(e,t){if(!e||e===bt||e===t||1===t.exports.size||2097152&e.flags)return e;const n=_a(e);if(n.cjsExportMerged)return n.cjsExportMerged;const r=33554432&e.flags?e:ta(e);r.flags=512|r.flags,void 0===r.exports&&(r.exports=Zu());t.exports.forEach((e,t)=>{"export="!==t&&r.exports.set(t,r.exports.has(t)?na(r.exports.get(t),e):e)}),r===e&&(_a(r).resolvedExports=void 0,_a(r).resolvedMembers=void 0);return _a(r).cjsExportMerged=r,n.cjsExportMerged=r}(ks($a(e.exports.get("export="),t)),ks(e));return ks(n)||e}}function ls(t,n,r,i){var o;const a=cs(t,r);if(!r&&a){if(!(i||1539&a.flags||Qu(a,308))){const e=R>=5?"allowSyntheticDefaultImports":"esModuleInterop";return Jo(n,fa.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,e),a}const s=n.parent,c=wE(s)&&Ng(s);if(c||ff(s)){const l=ff(s)?s.arguments[0]:s.moduleSpecifier,_=z_(a),u=WL(_,a,t,l);if(u)return us(a,u,s);const d=null==(o=null==t?void 0:t.declarations)?void 0:o.find(dP),p=Pa(l);let f;if(c&&d&&102<=R&&R<=199&&1===p&&99===e.getImpliedNodeFormatForEmit(d)&&(f=Fa(a,"module.exports",c,r)))return i||1539&a.flags||Jo(n,fa.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,"esModuleInterop"),Dk(j)&&_s(_)?us(f,_,s):f;const m=d&&function(e,t){return 99===e&&1===t}(p,e.getImpliedNodeFormatForEmit(d));if((Dk(j)||m)&&(_s(_)||Am(_,"default",!0)||m)){return us(a,3670016&_.flags?$L(_,a,t,l):VL(a,a.parent),s)}}}return a}function _s(e){return H(jm(e,0))||H(jm(e,1))}function us(e,t,n){const r=Xo(e.flags,e.escapedName);r.declarations=e.declarations?e.declarations.slice():[],r.parent=e.parent,r.links.target=e,r.links.originatingImport=n,e.valueDeclaration&&(r.valueDeclaration=e.valueDeclaration),e.constEnumOnlyModule&&(r.constEnumOnlyModule=!0),e.members&&(r.members=new Map(e.members)),e.exports&&(r.exports=new Map(e.exports));const i=Hp(t);return r.links.type=Hs(r,i.members,_,_,i.indexInfos),r}function ds(e){return void 0!==e.exports.get("export=")}function ps(e){return Tg(hs(e))}function fs(e,t){const n=hs(t);if(n)return n.get(e)}function ms(e){return!(402784252&e.flags||1&xx(e)||$C(e)||fw(e))}function gs(e){return 6256&e.flags?Dd(e,"resolvedExports"):1536&e.flags?hs(e):e.exports||F}function hs(e){const t=_a(e);if(!t.resolvedExports){const{exports:n,typeOnlyExportStarMap:r}=xs(e);t.resolvedExports=n,t.typeOnlyExportStarMap=r}return t.resolvedExports}function ys(e,t,n,r){t&&t.forEach((t,i)=>{if("default"===i)return;const o=e.get(i);if(o){if(n&&r&&o&&$a(o)!==$a(t)){const e=n.get(i);e.exportsWithDuplicate?e.exportsWithDuplicate.push(r):e.exportsWithDuplicate=[r]}}else e.set(i,t),n&&r&&n.set(i,{specifierText:ep(r.moduleSpecifier)})})}function xs(e){const t=[];let n;const r=new Set,i=function e(i,o,a){!a&&(null==i?void 0:i.exports)&&i.exports.forEach((e,t)=>r.add(t));if(!(i&&i.exports&&_e(t,i)))return;const s=new Map(i.exports),c=i.exports.get("__export");if(c){const t=Zu(),n=new Map;if(c.declarations)for(const r of c.declarations){const i=is(r,r.moduleSpecifier);ys(t,e(i,r,a||r.isTypeOnly),n,r)}n.forEach(({exportsWithDuplicate:e},t)=>{if("export="!==t&&e&&e.length&&!s.has(t))for(const r of e)ho.add(qp(r,fa.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity,n.get(t).specifierText,vc(t)))}),ys(s,t)}(null==o?void 0:o.isTypeOnly)&&(n??(n=new Map),s.forEach((e,t)=>n.set(t,o)));return s}(e=cs(e))||F;return n&&r.forEach(e=>n.delete(e)),{exports:i,typeOnlyExportStarMap:n}}function ks(e){let t;return e&&e.mergeId&&(t=Xi[e.mergeId])?t:e}function Ss(e){return ks(e.symbol&&Ed(e.symbol))}function Ts(e){return _u(e)?Ss(e):void 0}function Cs(e){return ks(e.parent&&Ed(e.parent))}function ws(e){var t,n;return(220===(null==(t=e.valueDeclaration)?void 0:t.kind)||219===(null==(n=e.valueDeclaration)?void 0:n.kind))&&Ts(e.valueDeclaration.parent)||e}function Ns(t,n,r){const i=Cs(t);if(i&&!(262144&t.flags))return l(i);const o=J(t.declarations,e=>{if(!dp(e)&&e.parent){if(sc(e.parent))return Ss(e.parent);if(kE(e.parent)&&e.parent.parent&&cs(Ss(e.parent.parent))===t)return Ss(e.parent.parent)}if(MF(e)&&AF(e.parent)&&64===e.parent.operatorToken.kind&&Dx(e.parent.left)&&ub(e.parent.left.expression))return ig(e.parent.left)||ng(e.parent.left.expression)?Ss(Sd(e)):(SM(e.parent.left.expression),ua(e.parent.left.expression).resolvedSymbol)});if(!d(o))return;const a=J(o,e=>Es(e,t)?e:void 0);let s=[],c=[];for(const e of a){const[t,...n]=l(e);s=ae(s,t),c=le(c,n)}return G(s,c);function l(i){const o=J(i.declarations,u),a=n&&function(t,n){const r=Sd(n),i=_J(r),o=_a(t);let a;if(o.extendedContainersByFile&&(a=o.extendedContainersByFile.get(i)))return a;if(r&&r.imports){for(const e of r.imports){if(iy(e))continue;const r=is(n,e,!0);r&&(Es(r,t)&&(a=ae(a,r)))}if(d(a))return(o.extendedContainersByFile||(o.extendedContainersByFile=new Map)).set(i,a),a}if(o.extendedContainers)return o.extendedContainers;const s=e.getSourceFiles();for(const e of s){if(!uO(e))continue;const n=Ss(e);Es(n,t)&&(a=ae(a,n))}return o.extendedContainers=a||_}(t,n),s=function(e,t){const n=!!d(e.declarations)&&ye(e.declarations);if(111551&t&&n&&n.parent&&fE(n.parent)&&(gF(n)&&n===n.parent.initializer||HD(n)&&n===n.parent.type))return Ss(n.parent)}(i,r);if(n&&i.flags&Gs(r)&&Xs(i,n,1920,!1))return ae(G(G([i],o),a),s);const c=!(i.flags&Gs(r))&&788968&i.flags&&524288&Ru(i).flags&&111551===r?Ks(n,e=>sd(e,e=>{if(e.flags&Gs(r)&&z_(e)===Ru(i))return e})):void 0;let l=c?[c,...o,i]:[...o,i];return l=ae(l,s),l=le(l,a),l}function u(e){return i&&Ds(e,i)}}function Ds(e,t){const n=ic(e),r=n&&n.exports&&n.exports.get("export=");return r&&Ps(r,t)?n:void 0}function Es(e,t){if(e===Cs(t))return t;const n=e.exports&&e.exports.get("export=");if(n&&Ps(n,t))return e;const r=gs(e),i=r.get(t.escapedName);return i&&Ps(i,t)?i:sd(r,e=>{if(Ps(e,t))return e})}function Ps(e,t){if(ks($a(ks(e)))===ks($a(ks(t))))return e}function As(e){return ks(e&&!!(1048576&e.flags)&&e.exportSymbol||e)}function Os(e,t){return!!(111551&e.flags||2097152&e.flags&&111551&Ga(e,!t))}function Ms(e){var t;const n=new c(We,e);return u++,n.id=u,null==(t=Gn)||t.recordType(n),n}function Rs(e,t){const n=Ms(e);return n.symbol=t,n}function Bs(e){return new c(We,e)}function Js(e,t,n=0,r){!function(e,t){const n=`${e},${t??""}`;Ct.has(n)&&pn.fail(`Duplicate intrinsic type name ${e}${t?` (${t})`:""}; you may need to pass a name to createIntrinsicType.`);Ct.add(n)}(t,r);const i=Ms(e);return i.intrinsicName=t,i.debugIntrinsicName=r,i.objectFlags=52953088|n,i}function zs(e,t){const n=Rs(524288,t);return n.objectFlags=e,n.members=void 0,n.properties=void 0,n.callSignatures=void 0,n.constructSignatures=void 0,n.indexInfos=void 0,n}function qs(e){return Rs(262144,e)}function Us(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&95!==e.charCodeAt(2)&&64!==e.charCodeAt(2)&&35!==e.charCodeAt(2)}function Vs(e){let t;return e.forEach((e,n)=>{Ws(e,n)&&(t||(t=[])).push(e)}),t||_}function Ws(e,t){return!Us(t)&&Os(e)}function $s(e,t,n,r,i){const o=e;return o.members=t,o.properties=_,o.callSignatures=n,o.constructSignatures=r,o.indexInfos=i,t!==F&&(o.properties=Vs(t)),o}function Hs(e,t,n,r,i){return $s(zs(16,e),t,n,r,i)}function Ks(e,t){let n;for(let r=e;r;r=r.parent){if(uu(r)&&r.locals&&!nf(r)&&(n=t(r.locals,void 0,!0,r)))return n;switch(r.kind){case 308:if(!rf(r))break;case 268:const e=Ss(r);if(n=t((null==e?void 0:e.exports)||F,void 0,!0,r))return n;break;case 264:case 232:case 265:let i;if((Ss(r).members||F).forEach((e,t)=>{788968&e.flags&&(i||(i=Zu())).set(t,e)}),i&&(n=t(i,void 0,!1,r)))return n}}return t(Te,void 0,!0)}function Gs(e){return 111551===e?111551:1920}function Xs(e,t,n,r,i=new Map){if(!e||function(e){if(e.declarations&&e.declarations.length){for(const t of e.declarations)switch(t.kind){case 173:case 175:case 178:case 179:continue;default:return!1}return!0}return!1}(e))return;const o=_a(e),a=o.accessibleChainCache||(o.accessibleChainCache=new Map),s=Ks(t,(e,t,n,r)=>r),c=`${r?0:1}|${s?_J(s):0}|${n}`;if(a.has(c))return a.get(c);const l=uJ(e);let _=i.get(l);_||i.set(l,_=[]);const u=Ks(t,d);return a.set(c,u),u;function d(n,i,o){if(!_e(_,n))return;const a=function(n,i,o){if(f(n.get(e.escapedName),void 0,i))return[e];const a=sd(n,n=>{if(2097152&n.flags&&"export="!==n.escapedName&&"default"!==n.escapedName&&!(kx(n)&&t&&uO(Sd(t)))&&(!r||H(n.declarations,Dm))&&(!o||!H(n.declarations,Nm))&&(i||!Qu(n,282))){const e=m(n,Ha(n),i);if(e)return e}if(n.escapedName===e.escapedName&&n.exportSymbol&&f(ks(n.exportSymbol),void 0,i))return[e]});return a||(n===Te?m(Fe,Fe,i):void 0)}(n,i,o);return _.pop(),a}function p(e,n){return!Qs(e,t,n)||!!Xs(e.parent,t,Gs(n),r,i)}function f(t,r,i){return(e===(r||t)||ks(e)===ks(r||t))&&!H(t.declarations,sc)&&(i||p(ks(t),n))}function m(e,t,r){if(f(e,t,r))return[e];const i=gs(t),o=i&&d(i,!0);return o&&p(e,Gs(n))?[e].concat(o):void 0}}function Qs(e,t,n){let r=!1;return Ks(t,t=>{let i=ks(t.get(e.escapedName));if(!i)return!1;if(i===e)return!0;const o=2097152&i.flags&&!Qu(i,282);i=o?Ha(i):i;return!!((o?Ga(i):i.flags)&n)&&(r=!0,!0)}),r}function Ys(e,t){return 0===nc(e,t,111551,!1,!0).accessibility}function Zs(e,t,n){return 0===nc(e,t,n,!1,!1).accessibility}function ec(e,t,n,r,i,o){if(!d(e))return;let a,s=!1;for(const c of e){const e=Xs(c,t,r,!1);if(e){a=c;const t=lc(e[0],i);if(t)return t}if(o&&H(c.declarations,sc)){if(i){s=!0;continue}return{accessibility:0}}const l=ec(Ns(c,t,r),t,n,n===c?Gs(r):r,i,o);if(l)return l}return s?{accessibility:0}:a?{accessibility:1,errorSymbolName:pc(n,t,r),errorModuleName:a!==n?pc(a,t,1920):void 0}:void 0}function tc(e,t,n,r){return nc(e,t,n,r,!0)}function nc(e,t,n,r,i){if(e&&t){const o=ec([e],t,e,n,r,i);if(o)return o;const a=p(e.declarations,ic);if(a){if(a!==ic(t))return{accessibility:2,errorSymbolName:pc(e,t,n),errorModuleName:pc(a),errorNode:Om(t)?t:void 0}}return{accessibility:1,errorSymbolName:pc(e,t,n)}}return{accessibility:0}}function ic(e){const t=mc(e,oc);return t&&Ss(t)}function oc(e){return dp(e)||308===e.kind&&rf(e)}function sc(e){return pp(e)||308===e.kind&&rf(e)}function lc(e,t){let n;if(b(D(e.declarations,e=>80!==e.kind),function(t){var n,i;if(!Wc(t)){const o=Ta(t);if(o&&!Av(o,32)&&Wc(o.parent))return r(t,o);if(fE(t)&&XF(t.parent.parent)&&!Av(t.parent.parent,32)&&Wc(t.parent.parent.parent))return r(t,t.parent.parent);if(Ep(t)&&!Av(t,32)&&Wc(t.parent))return r(t,t);if(fF(t)){if(2097152&e.flags&&Om(t)&&(null==(n=t.parent)?void 0:n.parent)&&fE(t.parent.parent)&&(null==(i=t.parent.parent.parent)?void 0:i.parent)&&XF(t.parent.parent.parent.parent)&&!Av(t.parent.parent.parent.parent,32)&&t.parent.parent.parent.parent.parent&&Wc(t.parent.parent.parent.parent.parent))return r(t,t.parent.parent.parent.parent);if(2&e.flags){const e=ac(t);if(170===e.kind)return!1;const n=e.parent.parent;return 244===n.kind&&(!!Av(n,32)||!!Wc(n.parent)&&r(t,n))}}return!1}return!0}))return{accessibility:0,aliasesToMakeVisible:n};function r(e,r){return t&&(ua(e).isVisible=!0,n=ue(n,r)),!0}}function uc(e){let t;return t=187===e.parent.kind||234===e.parent.kind&&!Ef(e.parent)||168===e.parent.kind||183===e.parent.kind&&e.parent.parameterName===e?1160127:167===e.kind||212===e.kind||272===e.parent.kind||167===e.parent.kind&&e.parent.left===e||212===e.parent.kind&&e.parent.expression===e||213===e.parent.kind&&e.parent.expression===e?1920:788968,t}function dc(e,t,n=!0){const r=uc(e),i=db(e),o=Ue(t,i.escapedText,r,void 0,!1);return o&&262144&o.flags&&788968&r||!o&&pv(i)&&0===tc(Ss(im(i,!1,!1)),i,r,!1).accessibility?{accessibility:0}:o?lc(o,n)||{accessibility:1,errorSymbolName:ep(i),errorNode:i}:{accessibility:3,errorSymbolName:ep(i),errorNode:i}}function pc(e,t,n,r=4,i){let o=70221824,a=0;2&r&&(o|=128),1&r&&(o|=512),8&r&&(o|=16384),32&r&&(a|=4),16&r&&(a|=1);const s=4&r?me.symbolToNode:me.symbolToEntityName;return i?c(i).getText():_d(c);function c(r){const i=s(e,n,t,o,a),c=308===(null==t?void 0:t.kind)?PU():EU(),l=t&&Sd(t);return c.writeNode(4,i,l,r),r}}function gc(e,t,n=0,r,i,o,a,s){return i?c(i).getText():_d(c);function c(i){let c;c=262144&n?1===r?186:185:1===r?181:180;const l=me.signatureToSignatureDeclaration(e,c,t,70222336|Ec(n),void 0,void 0,o,a,s),_=AU(),u=t&&Sd(t);return _.writeNode(4,l,u,By(i)),i}}function Sc(e,t,n=1064960,r=Ry(""),i,o,a){const s=!i&&j.noErrorTruncation||1&n,c=me.typeToTypeNode(e,t,70221824|Ec(n)|(s?1:0),void 0,void 0,i,o,a);if(void 0===c)return pn.fail("should always get typenode");const l=e!==Pt?EU():FU(),_=t&&Sd(t);l.writeNode(4,c,_,r);const u=r.getText(),d=i||(s?2*Gu:2*Ku);return d&&u&&u.length>=d?u.substr(0,d-3)+"...":u}function Tc(e,t){let n=Dc(e.symbol)?Sc(e,e.symbol.valueDeclaration):Sc(e),r=Dc(t.symbol)?Sc(t,t.symbol.valueDeclaration):Sc(t);return n===r&&(n=wc(e),r=wc(t)),[n,r]}function wc(e){return Sc(e,void 0,64)}function Dc(e){return e&&!!e.valueDeclaration&&K_(e.valueDeclaration)&&!ES(e.valueDeclaration)}function Ec(e=0){return 848330095&e}function Ic(e){return!!(e.symbol&&32&e.symbol.flags&&(e===bu(e.symbol)||524288&e.flags&&16777216&xx(e)))}function Lc(e){return $k(e)}function jc(t){var n;const r=4&xx(t)?t.target.symbol:t.symbol;return fw(t)||!!(null==(n=null==r?void 0:r.declarations)?void 0:n.some(t=>e.isSourceFileDefaultLibrary(Sd(t))))}function Mc(e,t,n=16384,r){return r?i(r).getText():_d(i);function i(r){const i=70222336|Ec(n),o=me.typePredicateToTypePredicateNode(e,t,i),a=EU(),s=t&&Sd(t);return a.writeNode(4,o,s,r),r}}function Rc(e){return 2===e?"private":4===e?"protected":"public"}function Jc(e){return e&&e.parent&&269===e.parent.kind&&yp(e.parent.parent)}function zc(e){return 308===e.kind||dp(e)}function Uc(e,t){const n=_a(e).nameType;if(n){if(384&n.flags){const e=""+n.value;return vs(e,Sk(j))||WT(e)?WT(e)&&Qt(e,"-")?`[${e}]`:e:`"${Cy(e,34)}"`}if(8192&n.flags)return`[${Vc(n.symbol,t)}]`}}function Vc(e,t){var n;if((null==(n=null==t?void 0:t.remappedSymbolReferences)?void 0:n.has(uJ(e)))&&(e=t.remappedSymbolReferences.get(uJ(e))),t&&"default"===e.escapedName&&!(16384&t.flags)&&(!(16777216&t.flags)||!e.declarations||t.enclosingDeclaration&&mc(e.declarations[0],zc)!==mc(t.enclosingDeclaration,zc)))return"default";if(e.declarations&&e.declarations.length){let n=m(e.declarations,e=>Fc(e)?e:void 0);const r=n&&Fc(n);if(n&&r){if(vF(n)&&ag(n))return kc(e);if(ND(r)&&!(4096&cx(e))){const n=_a(e).nameType;if(n&&384&n.flags){const n=Uc(e,t);if(void 0!==n)return n}}return jp(r)}if(n||(n=e.declarations[0]),n.parent&&261===n.parent.kind)return jp(n.parent.name);switch(n.kind){case 232:case 219:case 220:return!t||t.encounteredError||131072&t.flags||(t.encounteredError=!0),232===n.kind?"(Anonymous class)":"(Anonymous function)"}}const r=Uc(e,t);return void 0!==r?r:kc(e)}function Wc(e){if(e){const t=ua(e);return void 0===t.isVisible&&(t.isVisible=!!function(){switch(e.kind){case 339:case 347:case 341:return!!(e.parent&&e.parent.parent&&e.parent.parent.parent&&dP(e.parent.parent.parent));case 209:return Wc(e.parent.parent);case 261:if(w_(e.name)&&!e.name.elements.length)return!1;case 268:case 264:case 265:case 266:case 263:case 267:case 272:if(yp(e))return!0;const t=Qc(e);return 32&Zq(e)||272!==e.kind&&308!==t.kind&&33554432&t.flags?Wc(t):nf(t);case 173:case 172:case 178:case 179:case 175:case 174:if(Pv(e,6))return!1;case 177:case 181:case 180:case 182:case 170:case 269:case 185:case 186:case 188:case 184:case 189:case 190:case 193:case 194:case 197:case 203:return Wc(e.parent);case 274:case 275:case 277:return!1;case 169:case 308:case 271:return!0;default:return!1}}()),t.isVisible}return!1}function $c(e,t){let n,r,i;return 11!==e.kind&&e.parent&&278===e.parent.kind?n=Ue(e,e,2998271,void 0,!1):282===e.parent.kind&&(n=za(e.parent,2998271)),n&&(i=new Set,i.add(uJ(n)),function e(n){p(n,n=>{const o=Ta(n)||n;if(t?ua(n).isVisible=!0:(r=r||[],_e(r,o)),Pm(n)){const t=db(n.moduleReference),r=Ue(n,t.escapedText,901119,void 0,!1);r&&i&&U(i,uJ(r))&&e(r.declarations)}})}(n.declarations)),r}function Hc(e,t){const n=Kc(e,t);if(n>=0){const{length:e}=Ui;for(let t=n;t=$i;n--){if(Gc(Ui[n],Wi[n]))return-1;if(Ui[n]===e&&Wi[n]===t)return n}return-1}function Gc(e,t){switch(t){case 0:return!!_a(e).type;case 2:return!!_a(e).declaredType;case 1:return!!e.resolvedBaseConstructorType;case 3:return!!e.resolvedReturnType;case 4:return!!e.immediateBaseConstraint;case 5:return!!e.resolvedTypeArguments;case 6:return!!e.baseTypesResolved;case 7:return!!_a(e).writeType;case 8:return void 0!==ua(e).parameterInitializerContainsUndefined}return pn.assertNever(t)}function Xc(){return Ui.pop(),Wi.pop(),Vi.pop()}function Qc(e){return mc(ny(e),e=>{switch(e.kind){case 261:case 262:case 277:case 276:case 275:case 274:return!1;default:return!0}}).parent}function Zc(e,t){const n=Am(e,t);return n?z_(n):void 0}function nl(e,t){var n;let r;return Zc(e,t)||(r=null==(n=bg(e,t))?void 0:n.type)&&Al(r,!0,!0)}function rl(e){return e&&!!(1&e.flags)}function il(e){return e===Et||!!(1&e.flags&&e.aliasSymbol)}function sl(e,t){if(0!==t)return Il(e,!1,t);const n=Ss(e);return n&&_a(n).type||Il(e,!1,t)}function cl(e,t,n){if(131072&(e=OF(e,e=>!(98304&e.flags))).flags)return Nn;if(1048576&e.flags)return zF(e,e=>cl(e,t,n));let r=zb(P(t,rx));const i=[],o=[];for(const t of lf(e)){const e=ix(t,8576);JS(e,r)||6&lx(t)||!yk(t)?o.push(e):i.push(t)}if(Lx(e)||jx(r)){if(o.length&&(r=zb([r,...o])),131072&r.flags)return e;const t=(qr||(qr=Yy("Omit",2,!0)||bt),qr===bt?void 0:qr);return t?Sy(t,[e,r]):Et}const a=Zu();for(const e of i)a.set(e.escapedName,vk(e,!1));const s=Hs(n,a,_,_,cg(e));return s.objectFlags|=4194304,s}function _l(e){return!!(465829888&e.flags)&&oM(xf(e)||Ot,32768)}function dl(e){return pD(DF(e,_l)?zF(e,e=>465829888&e.flags?kf(e):e):e,524288)}function gl(e,t){const n=yl(e);return n?IE(n,t):t}function yl(e){const t=function(e){const t=e.parent.parent;switch(t.kind){case 209:case 304:return yl(t);case 210:return yl(e.parent);case 261:return t.initializer;case 227:return t.right}}(e);if(t&&Rg(t)&&t.flowNode){const n=vl(e);if(n){const r=FI(II.createStringLiteral(n),e),i=q_(t)?t:II.createParenthesizedExpression(t),o=FI(II.createElementAccessExpression(i,r),e);return IT(r,o),IT(o,e),i!==t&&IT(i,o),o.flowNode=t.flowNode,o}}}function vl(e){const t=e.parent;return 209===e.kind&&207===t.kind?Cl(e.propertyName||e.name):304===e.kind||305===e.kind?Cl(e.name):""+t.elements.indexOf(e)}function Cl(e){const t=rx(e);return 384&t.flags?""+t.value:void 0}function Nl(e){const t=e.dotDotDotToken?32:0,n=sl(e.parent.parent,t);return n&&Dl(e,n,!1)}function Dl(e,t,n){if(rl(t))return t;const r=e.parent;$&&33554432&e.flags&&ty(e)?t=Dw(t):$&&r.parent.initializer&&!lD(ZD(r.parent.initializer),65536)&&(t=pD(t,524288));const i=32|(n||sI(e)?16:0);let o;if(207===r.kind)if(e.dotDotDotToken){if(2&(t=Qf(t)).flags||!vI(t))return Jo(e,fa.Rest_types_may_only_be_created_from_object_types),Et;const n=[];for(const e of r.elements)e.dotDotDotToken||n.push(e.propertyName||e.name);o=cl(t,n,e.symbol)}else{const n=e.propertyName||e.name;o=gl(e,Ux(t,rx(n),i,n))}else{const n=wB(65|(e.dotDotDotToken?0:128),t,Lt,r),a=r.elements.indexOf(e);if(e.dotDotDotToken){const e=zF(t,e=>58982400&e.flags?kf(e):e);o=PF(e,fw)?zF(e,e=>Nb(e,a)):Kv(n)}else if(QC(t)){o=gl(e,Wx(t,Pk(a),i,e.name)||Et)}else o=n}return e.initializer?yv(ac(e))?$&&!lD(CM(e,0),16777216)?dl(o):o:NM(e,zb([dl(o),CM(e,0)],2)):o}function Fl(e){const t=al(e);if(t)return $k(t)}function El(e){const t=_h(e,!0);return 210===t.kind&&0===t.elements.length}function Al(e,t=!1,n=!0){return $&&n?Nw(e,t):e}function Il(e,t,n){if(fE(e)&&250===e.parent.parent.kind){const t=_x(tO(WM(e.parent.parent.expression,n)));return 4456448&t.flags?fx(t):Ut}if(fE(e)&&251===e.parent.parent.kind){return CB(e.parent.parent)||wt}if(w_(e.parent))return Nl(e);const r=AD(e)&&!Rv(e)||PD(e)||QP(e),i=t&&tC(e),o=v_(e);if(up(e))return o?rl(o)||o===Ot?o:Et:ie?Ot:wt;if(o)return Al(o,r,i);if((te||Om(e))&&fE(e)&&!w_(e.name)&&!(32&Zq(e))&&!(33554432&e.flags)){if(!(6&eU(e))&&(!e.initializer||function(e){const t=_h(e,!0);return 106===t.kind||80===t.kind&&zN(t)===Ne}(e.initializer)))return Nt;if(e.initializer&&El(e.initializer))return lr}if(FD(e)){if(!e.symbol)return;const t=e.parent;if(179===t.kind&&vd(t)){const n=Qu(Ss(e.parent),178);if(n){const r=zg(n),i=Iq(t);return i&&e===i?(pn.assert(!i.type),z_(r.thisParameter)):gh(r)}}const n=function(e,t){const n=qg(e);if(!n)return;const r=e.parameters.indexOf(t);return t.dotDotDotToken?fj(n,r):dj(n,r)}(t,e);if(n)return n;const r="this"===e.symbol.escapedName?pA(t):fA(e);if(r)return Al(r,!1,i)}if(Lu(e)&&e.initializer){if(Om(e)&&!FD(e)){const t=Vl(e,Ss(e),Gm(e));if(t)return t}return Al(NM(e,CM(e,n)),r,i)}if(AD(e)&&(te||Om(e))){if(Ov(e)){const t=D(e.parent.members,LD),n=t.length?function(e,t){const n=Qt(e.escapedName,"__#")?bw.createPrivateIdentifier(e.escapedName.split("@")[1]):vc(e.escapedName);for(const r of t){const t=bw.createPropertyAccessExpression(bw.createThis(),n);IT(t.expression,t),IT(t,r),t.flowNode=r.returnFlowNode;const i=Jl(t,e);if(!te||i!==Nt&&i!==lr||Jo(e.valueDeclaration,fa.Member_0_implicitly_has_an_1_type,pc(e),Sc(i)),!PF(i,eO))return _B(i)}}(e.symbol,t):128&Vv(e)?OC(e.symbol):void 0;return n&&Al(n,!0,i)}{const t=SC(e.parent),n=t?Bl(e.symbol,t):128&Vv(e)?OC(e.symbol):void 0;return n&&Al(n,!0,i)}}return ZE(e)?Gt:w_(e.name)?e_(e.name,!1,!0):void 0}function Ol(e){if(e.valueDeclaration&&AF(e.valueDeclaration)){const t=_a(e);return void 0===t.isConstructorDeclaredProperty&&(t.isConstructorDeclaredProperty=!1,t.isConstructorDeclaredProperty=!!jl(e)&&b(e.declarations,t=>AF(t)&&kA(t)&&(213!==t.left.kind||Jh(t.left.argumentExpression))&&!Hl(void 0,t,e,t))),t.isConstructorDeclaredProperty}return!1}function Ll(e){const t=e.valueDeclaration;return t&&AD(t)&&!yv(t)&&!t.initializer&&(te||Om(t))}function jl(e){if(e.declarations)for(const t of e.declarations){const e=im(t,!1,!1);if(e&&(177===e.kind||ML(e)))return e}}function Bl(e,t){const n=Qt(e.escapedName,"__#")?bw.createPrivateIdentifier(e.escapedName.split("@")[1]):vc(e.escapedName),r=bw.createPropertyAccessExpression(bw.createThis(),n);IT(r.expression,r),IT(r,t),r.flowNode=t.returnFlowNode;const i=Jl(r,e);return!te||i!==Nt&&i!==lr||Jo(e.valueDeclaration,fa.Member_0_implicitly_has_an_1_type,pc(e),Sc(i)),PF(i,eO)?void 0:_B(i)}function Jl(e,t){const n=(null==t?void 0:t.valueDeclaration)&&(!Ll(t)||128&Vv(t.valueDeclaration))&&OC(t)||Lt;return IE(e,Nt,n)}function zl(e,t){const n=Xm(e.valueDeclaration);if(n){const t=Om(n)?ol(n):void 0;if(t&&t.typeExpression)return $k(t.typeExpression);return e.valueDeclaration&&Vl(e.valueDeclaration,e,n)||_w(SM(n))}let r,i=!1,o=!1;if(Ol(e)&&(r=Bl(e,jl(e))),!r){let n;if(e.declarations){let a;for(const r of e.declarations){const s=AF(r)||vF(r)?r:Dx(r)?AF(r.parent)?r.parent:r:void 0;if(!s)continue;const c=Dx(s)?mg(s):og(s);(4===c||AF(s)&&kA(s,c))&&(Xl(s)?i=!0:o=!0),vF(s)||(a=Hl(a,s,e,r)),a||(n||(n=[])).push(AF(s)||vF(s)?Kl(e,t,s,c):_n)}r=a}if(!r){if(!d(n))return Et;let t=i&&e.declarations?function(e,t){return pn.assert(e.length===t.length),e.filter((e,n)=>{const r=t[n],i=AF(r)?r:AF(r.parent)?r.parent:void 0;return i&&Xl(i)})}(n,e.declarations):void 0;if(o){const n=OC(e);n&&((t||(t=[])).push(n),i=!0)}r=zb(H(t,e=>!!(-98305&e.flags))?t:n)}}const a=Kw(Al(r,!1,o&&!i));return e.valueDeclaration&&Om(e.valueDeclaration)&&OF(a,e=>!!(-98305&e.flags))===_n?(Qw(e.valueDeclaration,wt),wt):a}function Vl(e,t,n){var r,i;if(!Om(e)||!n||!gF(n)||n.properties.length)return;const o=Zu();for(;AF(e)||hF(e);){const t=Ts(e);(null==(r=null==t?void 0:t.exports)?void 0:r.size)&&aa(o,t.exports),e=AF(e)?e.parent:e.parent.parent}const a=Ts(e);(null==(i=null==a?void 0:a.exports)?void 0:i.size)&&aa(o,a.exports);const s=Hs(t,o,_,_,_);return s.objectFlags|=4096,s}function Hl(e,t,n,r){var i;const o=yv(t.parent);if(o){const t=Kw($k(o));if(!e)return t;il(e)||il(t)||OS(e,t)||pB(void 0,e,r,t)}if(null==(i=n.parent)?void 0:i.valueDeclaration){const e=ws(n.parent);if(e.valueDeclaration){const t=yv(e.valueDeclaration);if(t){const e=Am($k(t),n.escapedName);if(e)return U_(e)}}}return e}function Kl(e,t,n,r){if(vF(n)){if(t)return z_(t);const e=SM(n.arguments[2]),r=Zc(e,"value");if(r)return r;const i=Zc(e,"get");if(i){const e=eL(i);if(e)return gh(e)}const o=Zc(e,"set");if(o){const e=eL(o);if(e)return xj(e)}return wt}if(function(e,t){return hF(e)&&110===e.expression.kind&&oO(t,t=>VN(e,t))}(n.left,n.right))return wt;const i=1===r&&(hF(n.left)||yF(n.left))&&(ig(n.left.expression)||uD(n.left.expression)&&ng(n.left.expression)),o=t?z_(t):i?kk(SM(n.right)):_w(SM(n.right));if(524288&o.flags&&2===r&&"export="===e.escapedName){const n=Hp(o),r=Zu();ld(n.members,r);const i=r.size;t&&!t.exports&&(t.exports=Zu()),(t||e).exports.forEach((e,t)=>{var n;const i=r.get(t);if(!i||i===e||2097152&e.flags)r.set(t,e);else if(111551&e.flags&&111551&i.flags){if(e.valueDeclaration&&i.valueDeclaration&&Sd(e.valueDeclaration)!==Sd(i.valueDeclaration)){const t=vc(e.escapedName),r=(null==(n=rt(i.valueDeclaration,Nc))?void 0:n.name)||i.valueDeclaration;uT(Jo(e.valueDeclaration,fa.Duplicate_identifier_0,t),qp(r,fa._0_was_also_declared_here,t)),uT(Jo(r,fa.Duplicate_identifier_0,t),qp(e.valueDeclaration,fa._0_was_also_declared_here,t))}const o=Xo(e.flags|i.flags,t);o.links.type=zb([z_(e),z_(i)]),o.valueDeclaration=i.valueDeclaration,o.declarations=G(i.declarations,e.declarations),r.set(t,o)}else r.set(t,na(e,i))});const a=Hs(i!==r.size?void 0:n.symbol,r,n.callSignatures,n.constructSignatures,n.indexInfos);if(i===r.size&&(o.aliasSymbol&&(a.aliasSymbol=o.aliasSymbol,a.aliasTypeArguments=o.aliasTypeArguments),4&xx(o))){a.aliasSymbol=o.symbol;const e=by(o);a.aliasTypeArguments=d(e)?e:void 0}return a.objectFlags|=my([o])|20608&xx(o),a.symbol&&32&a.symbol.flags&&o===bu(a.symbol)&&(a.objectFlags|=16777216),a}return tw(o)?(Qw(n,cr),cr):o}function Xl(e){const t=im(e,!1,!1);return 177===t.kind||263===t.kind||219===t.kind&&!hg(t.parent)}function Ql(e,t,n){if(e.initializer){return Al(DM(e,CM(e,0,w_(e.name)?e_(e.name,!0,!1):Ot)))}return w_(e.name)?e_(e.name,t,n):(n&&!d_(e)&&Qw(e,wt),t?At:wt)}function e_(e,t=!1,n=!1){t&&Ii.push(e);const r=207===e.kind?function(e,t,n){const r=Zu();let i,o=131200;p(e.elements,e=>{const a=e.propertyName||e.name;if(e.dotDotDotToken)return void(i=Qh(Ut,wt,!1));const s=rx(a);if(!dC(s))return void(o|=512);const c=pC(s),l=Xo(4|(e.initializer?16777216:0),c);l.links.type=Ql(e,t,n),r.set(l.escapedName,l)});const a=Hs(void 0,r,_,_,i?[i]:_);return a.objectFlags|=o,t&&(a.pattern=e,a.objectFlags|=131072),a}(e,t,n):function(e,t,n){const r=e.elements,i=be(r),o=i&&209===i.kind&&i.dotDotDotToken?i:void 0;if(0===r.length||1===r.length&&o)return M>=2?Hv(wt):cr;const a=P(r,e=>RF(e)?wt:Ql(e,t,n)),s=T(r,e=>!(e===o||RF(e)||sI(e)),r.length-1)+1;let c=kb(a,P(r,(e,t)=>e===o?4:t>=s?2:1));return t&&(c=yy(c),c.pattern=e,c.objectFlags|=131072),c}(e,t,n);return t&&Ii.pop(),r}function t_(e,t){return u_(Il(e,!0,0),e,t)}function n_(e){const t=ua(e);if(!t.resolvedType){const n=Xo(4096,"__importAttributes"),r=Zu();p(e.elements,e=>{const t=Xo(4,yC(e));t.parent=n,t.links.type=function(e){return kk(SM(e.value))}(e),t.links.target=t,r.set(t.escapedName,t)});const i=Hs(n,r,_,_,_);i.objectFlags|=262272,t.resolvedType=i}return t.resolvedType}function a_(e){const t=Ts(e),n=(r=!1,pr||(pr=Qy("SymbolConstructor",r)));var r;return n&&t&&t===n}function u_(e,t,n){return e?(4096&e.flags&&a_(t.parent)&&(e=Mk(t)),n&&Yw(t,e),8192&e.flags&&(fF(t)||!v_(t))&&e.symbol!==Ss(t)&&(e=sn),Kw(e)):(e=FD(t)&&t.dotDotDotToken?cr:wt,n&&(d_(t)||Qw(t,e)),e)}function d_(e){const t=ny(e);return pR(170===t.kind?t.parent:t)}function v_(e){const t=yv(e);if(t)return $k(t)}function b_(e){const t=_a(e);if(!t.type){const n=function(e){if(4194304&e.flags)return function(e){const t=Ru(Cs(e));return t.typeParameters?hy(t,P(t.typeParameters,e=>wt)):t}(e);if(e===Oe)return wt;if(134217728&e.flags&&e.valueDeclaration){const t=Ss(Sd(e.valueDeclaration)),n=Xo(t.flags,"exports");n.declarations=t.declarations?t.declarations.slice():[],n.parent=e,n.links.target=t,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration),t.members&&(n.members=new Map(t.members)),t.exports&&(n.exports=new Map(t.exports));const r=Zu();return r.set("exports",n),Hs(e,r,_,_,_)}pn.assertIsDefined(e.valueDeclaration);const t=e.valueDeclaration;if(dP(t)&&of(t))return t.statements.length?Kw(_w(WM(t.statements[0].expression))):Nn;if(g_(t))return C_(e);if(!Hc(e,0))return 512&e.flags&&!(67108864&e.flags)?E_(e):I_(e);let n;if(278===t.kind)n=u_(v_(t)||SM(t.expression),t);else if(AF(t)||Om(t)&&(vF(t)||(hF(t)||_g(t))&&AF(t.parent)))n=zl(e);else if(hF(t)||yF(t)||uD(t)||Ju(t)||$N(t)||hE(t)||gE(t)||OD(t)&&!Vf(t)||ID(t)||dP(t)){if(9136&e.flags)return E_(e);n=AF(t.parent)?zl(e):v_(t)||wt}else if(cP(t))n=v_(t)||AM(t);else if(ZE(t))n=v_(t)||kI(t);else if(lP(t))n=v_(t)||PM(t.name,0);else if(Vf(t))n=v_(t)||IM(t,0);else if(FD(t)||AD(t)||PD(t)||fE(t)||fF(t)||Pl(t))n=t_(t,!0);else if(bE(t))n=E_(e);else{if(!uP(t))return pn.fail("Unhandled declaration kind! "+pn.formatSyntaxKind(t.kind)+" for "+pn.formatSymbol(e));n=P_(e)}if(!Xc())return 512&e.flags&&!(67108864&e.flags)?E_(e):I_(e);return n}(e);return t.type||function(e){let t=e.valueDeclaration;return!!t&&(fF(t)&&(t=ac(t)),!!FD(t)&&AS(t.parent))}(e)||(t.type=n),n}return t.type}function x_(e){if(e)switch(e.kind){case 178:return bv(e);case 179:return kv(e);case 173:pn.assert(Rv(e));return yv(e)}}function k_(e){const t=x_(e);return t&&$k(t)}function C_(e){const t=_a(e);if(!t.type){if(!Hc(e,0))return Et;const n=Qu(e,178),r=Qu(e,179),i=rt(Qu(e,173),h_);let o=n&&Om(n)&&Fl(n)||k_(n)||k_(r)||k_(i)||n&&n.body&&zj(n)||i&&t_(i,!0);o||(r&&!pR(r)?Vo(te,r,fa.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,pc(e)):n&&!pR(n)?Vo(te,n,fa.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,pc(e)):i&&!pR(i)&&Vo(te,i,fa.Member_0_implicitly_has_an_1_type,pc(e),"any"),o=wt),Xc()||(x_(n)?Jo(n,fa._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,pc(e)):x_(r)||x_(i)?Jo(r,fa._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,pc(e)):n&&te&&Jo(n,fa._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,pc(e)),o=wt),t.type??(t.type=o)}return t.type}function D_(e){const t=_a(e);if(!t.writeType){if(!Hc(e,7))return Et;const n=Qu(e,179)??rt(Qu(e,173),h_);let r=k_(n);Xc()||(x_(n)&&Jo(n,fa._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,pc(e)),r=wt),t.writeType??(t.writeType=r||C_(e))}return t.writeType}function F_(e){const t=pu(bu(e));return 8650752&t.flags?t:2097152&t.flags?x(t.types,e=>!!(8650752&e.flags)):void 0}function E_(e){let t=_a(e);const n=t;if(!t.type){const r=e.valueDeclaration&&BL(e.valueDeclaration,!1);if(r){const n=RL(e,r);n&&(e=n,t=n.links)}n.type=t.type=function(e){const t=e.valueDeclaration;if(1536&e.flags&&mp(e))return wt;if(t&&(227===t.kind||Dx(t)&&227===t.parent.kind))return zl(e);if(512&e.flags&&t&&dP(t)&&t.commonJsModuleIndicator){const t=cs(e);if(t!==e){if(!Hc(e,0))return Et;const n=ks(e.exports.get("export=")),r=zl(n,n===t?void 0:t);return Xc()?r:I_(e)}}const n=zs(16,e);if(32&e.flags){const t=F_(e);return t?Gb([n,t]):n}return $&&16777216&e.flags?Nw(n,!0):n}(e)}return t.type}function P_(e){const t=_a(e);return t.type||(t.type=Fu(e))}function A_(e){const t=_a(e);if(!t.type){if(!Hc(e,0))return Et;const n=Ha(e),r=e.declarations&&Ua(Ca(e),!0),i=m(null==r?void 0:r.declarations,e=>ME(e)?v_(e):void 0);if(t.type??(t.type=(null==r?void 0:r.declarations)&&oz(r.declarations)&&e.declarations.length?function(e){const t=Sd(e.declarations[0]),n=vc(e.escapedName),r=e.declarations.every(e=>Om(e)&&Dx(e)&&ig(e.expression)),i=r?bw.createPropertyAccessExpression(bw.createPropertyAccessExpression(bw.createIdentifier("module"),bw.createIdentifier("exports")),n):bw.createPropertyAccessExpression(bw.createIdentifier("exports"),n);return r&&IT(i.expression.expression,i.expression),IT(i.expression,i),IT(i,t),i.flowNode=t.endFlowNode,IE(i,Nt,Lt)}(r):oz(e.declarations)?Nt:i||(111551&Ga(n)?z_(n):Et)),!Xc())return I_(r??e),t.type??(t.type=Et)}return t.type}function I_(e){const t=e.valueDeclaration;if(t){if(yv(t))return Jo(e.valueDeclaration,fa._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,pc(e)),Et;te&&(170!==t.kind||t.initializer)&&Jo(e.valueDeclaration,fa._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,pc(e))}else if(2097152&e.flags){const t=Ca(e);t&&Jo(t,fa.Circular_definition_of_import_alias_0,pc(e))}return wt}function O_(e){const t=_a(e);return t.type||(pn.assertIsDefined(t.deferralParent),pn.assertIsDefined(t.deferralConstituents),t.type=1048576&t.deferralParent.flags?zb(t.deferralConstituents):Gb(t.deferralConstituents)),t.type}function L_(e){const t=cx(e);return 2&t?65536&t?function(e){const t=_a(e);return!t.writeType&&t.deferralWriteConstituents&&(pn.assertIsDefined(t.deferralParent),pn.assertIsDefined(t.deferralConstituents),t.writeType=1048576&t.deferralParent.flags?zb(t.deferralWriteConstituents):Gb(t.deferralWriteConstituents)),t.writeType}(e)||O_(e):e.links.writeType||e.links.type:4&e.flags?Iw(z_(e),!!(16777216&e.flags)):98304&e.flags?1&t?function(e){const t=_a(e);return t.writeType||(t.writeType=CS(L_(t.target),t.mapper))}(e):D_(e):z_(e)}function z_(e){const t=cx(e);return 65536&t?O_(e):1&t?function(e){const t=_a(e);return t.type||(t.type=CS(z_(t.target),t.mapper))}(e):262144&t?function(e){var t;if(!e.links.type){const n=e.links.mappedType;if(!Hc(e,0))return n.containsError=!0,Et;const i=CS(Tp(n.target||n),pS(n.mapper,vp(n),e.links.keyType));let o=$&&16777216&e.flags&&!oM(i,49152)?Nw(i,!0):524288&e.links.checkFlags?Lw(i):i;Xc()||(Jo(r,fa.Type_of_property_0_circularly_references_itself_in_mapped_type_1,pc(e),Sc(n)),o=Et),(t=e.links).type??(t.type=o)}return e.links.type}(e):8192&t?function(e){const t=_a(e);t.type||(t.type=hN(e.links.propertyType,e.links.mappedType,e.links.constraintType)||Ot);return t.type}(e):7&e.flags?b_(e):9136&e.flags?E_(e):8&e.flags?P_(e):98304&e.flags?C_(e):2097152&e.flags?A_(e):Et}function U_(e){return Iw(z_(e),!!(16777216&e.flags))}function V_(e,t){if(void 0===e||!(4&xx(e)))return!1;for(const n of t)if(e.target===n)return!0;return!1}function W_(e,t){return void 0!==e&&void 0!==t&&!!(4&xx(e))&&e.target===t}function $_(e){return 4&xx(e)?e.target:e}function H_(e,t){return function e(n){if(7&xx(n)){const r=$_(n);return r===t||H(gu(r),e)}if(2097152&n.flags)return H(n.types,e);return!1}(e)}function Q_(e,t){for(const n of t)e=ue(e,ju(Ss(n)));return e}function nu(e,t){for(;;){if((e=e.parent)&&AF(e)){const t=og(e);if(6===t||3===t){const t=Ss(e.left);t&&t.parent&&!mc(t.parent.valueDeclaration,t=>e===t)&&(e=t.parent.valueDeclaration)}}if(!e)return;const n=e.kind;switch(n){case 264:case 232:case 265:case 180:case 181:case 174:case 185:case 186:case 318:case 263:case 175:case 219:case 220:case 266:case 346:case 347:case 341:case 339:case 201:case 195:{const r=nu(e,t);if((219===n||220===n||Vf(e))&&ES(e)){const t=ge(Jm(z_(Ss(e)),0));if(t&&t.typeParameters)return[...r||_,...t.typeParameters]}if(201===n)return ae(r,ju(Ss(e.typeParameter)));if(195===n)return G(r,ak(e));const i=Q_(r,fl(e)),o=t&&(264===n||232===n||265===n||ML(e))&&bu(Ss(e)).thisType;return o?ae(i,o):i}case 342:const r=Ug(e);r&&(e=r.valueDeclaration);break;case 321:{const n=nu(e,t);return e.tags?Q_(n,L(e.tags,e=>KP(e)?e.typeParameters:void 0)):n}}}}function ru(e){var t;const n=32&e.flags||16&e.flags?e.valueDeclaration:null==(t=e.declarations)?void 0:t.find(e=>{if(265===e.kind)return!0;if(261!==e.kind)return!1;const t=e.initializer;return!!t&&(219===t.kind||220===t.kind)});return pn.assert(!!n,"Class was missing valueDeclaration -OR- non-class had no interface declarations"),nu(n)}function iu(e){if(!e.declarations)return;let t;for(const n of e.declarations)if(265===n.kind||264===n.kind||232===n.kind||ML(n)||Ig(n)){t=Q_(t,fl(n))}return t}function ou(e){const t=Jm(e,1);if(1===t.length){const e=t[0];if(!e.typeParameters&&1===e.parameters.length&&hJ(e)){const t=oj(e.parameters[0]);return rl(t)||XC(t)===wt}}return!1}function au(e){if(Jm(e,1).length>0)return!0;if(8650752&e.flags){const t=xf(e);return!!t&&ou(t)}return!1}function su(e){const t=bx(e.symbol);return t&&kh(t)}function cu(e,t,n){const r=d(t),i=Om(n);return D(Jm(e,1),e=>(i||r>=Mg(e.typeParameters))&&r<=d(e.typeParameters))}function du(e,t,n){const r=cu(e,t,n),i=P(t,$k);return I(r,e=>H(e.typeParameters)?Eh(e,i,Om(n)):e)}function pu(e){if(!e.resolvedBaseConstructorType){const t=bx(e.symbol),n=t&&kh(t),r=su(e);if(!r)return e.resolvedBaseConstructorType=Lt;if(!Hc(e,1))return Et;const i=WM(r.expression);if(n&&r!==n&&(pn.assert(!n.typeArguments),WM(n.expression)),2621440&i.flags&&Hp(i),!Xc())return Jo(e.symbol.valueDeclaration,fa._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,pc(e.symbol)),e.resolvedBaseConstructorType??(e.resolvedBaseConstructorType=Et);if(!(1&i.flags||i===qt||au(i))){const t=Jo(r.expression,fa.Type_0_is_not_a_constructor_function_type,Sc(i));if(262144&i.flags){const e=ly(i);let n=Ot;if(e){const t=Jm(e,1);t[0]&&(n=gh(t[0]))}i.symbol.declarations&&uT(t,qp(i.symbol.declarations[0],fa.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,pc(i.symbol),Sc(n)))}return e.resolvedBaseConstructorType??(e.resolvedBaseConstructorType=Et)}e.resolvedBaseConstructorType??(e.resolvedBaseConstructorType=i)}return e.resolvedBaseConstructorType}function mu(e,t){Jo(e,fa.Type_0_recursively_references_itself_as_a_base_type,Sc(t,void 0,2))}function gu(e){if(!e.baseTypesResolved){if(Hc(e,6)&&(8&e.objectFlags?e.resolvedBaseTypes=[yu(e)]:96&e.symbol.flags?(32&e.symbol.flags&&function(e){e.resolvedBaseTypes=$u;const t=qf(pu(e));if(!(2621441&t.flags))return e.resolvedBaseTypes=_;const n=su(e);let r;const i=t.symbol?Ru(t.symbol):void 0;if(t.symbol&&32&t.symbol.flags&&function(e){const t=e.outerTypeParameters;if(t){const n=t.length-1,r=by(e);return t[n].symbol!==r[n].symbol}return!0}(i))r=ky(n,t.symbol);else if(1&t.flags)r=t;else{const i=du(t,n.typeArguments,n);if(!i.length)return Jo(n.expression,fa.No_base_constructor_has_the_specified_number_of_type_arguments),e.resolvedBaseTypes=_;r=gh(i[0])}if(il(r))return e.resolvedBaseTypes=_;const o=Qf(r);if(!vu(o)){const t=ik(km(void 0,r),fa.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,Sc(o));return ho.add(Wp(Sd(n.expression),n.expression,t)),e.resolvedBaseTypes=_}if(e===o||H_(o,e))return Jo(e.symbol.valueDeclaration,fa.Type_0_recursively_references_itself_as_a_base_type,Sc(e,void 0,2)),e.resolvedBaseTypes=_;e.resolvedBaseTypes===$u&&(e.members=void 0);e.resolvedBaseTypes=[o]}(e),64&e.symbol.flags&&function(e){if(e.resolvedBaseTypes=e.resolvedBaseTypes||_,e.symbol.declarations)for(const t of e.symbol.declarations)if(265===t.kind&&wh(t))for(const n of wh(t)){const r=Qf($k(n));il(r)||(vu(r)?e===r||H_(r,e)?mu(t,e):e.resolvedBaseTypes===_?e.resolvedBaseTypes=[r]:e.resolvedBaseTypes.push(r):Jo(n,fa.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members))}}(e)):pn.fail("type must be class or interface"),!Xc()&&e.symbol.declarations))for(const t of e.symbol.declarations)264!==t.kind&&265!==t.kind||mu(t,e);e.baseTypesResolved=!0}return e.resolvedBaseTypes}function yu(e){return Kv(zb(I(e.typeParameters,(t,n)=>8&e.elementFlags[n]?Ux(t,Wt):t)||_),e.readonly)}function vu(e){if(262144&e.flags){const t=xf(e);if(t)return vu(t)}return!!(67633153&e.flags&&!Bp(e)||2097152&e.flags&&b(e.types,vu))}function bu(e){let t=_a(e);const n=t;if(!t.declaredType){const r=32&e.flags?1:2,i=RL(e,e.valueDeclaration&&function(e){var t;const n=e&&BL(e,!0),r=null==(t=null==n?void 0:n.exports)?void 0:t.get("prototype"),i=(null==r?void 0:r.valueDeclaration)&&function(e){if(!e.parent)return!1;let t=e.parent;for(;t&&212===t.kind;)t=t.parent;if(t&&AF(t)&&gb(t.left)&&64===t.operatorToken.kind){const e=gg(t);return gF(e)&&e}}(r.valueDeclaration);return i?Ss(i):void 0}(e.valueDeclaration));i&&(e=i,t=i.links);const o=n.declaredType=t.declaredType=zs(r,e),a=ru(e),s=iu(e);(a||s||1===r||!function(e){if(!e.declarations)return!0;for(const t of e.declarations)if(265===t.kind){if(256&t.flags)return!1;const e=wh(t);if(e)for(const t of e)if(ub(t.expression)){const e=ns(t.expression,788968,!0);if(!e||!(64&e.flags)||bu(e).thisType)return!1}}return!0}(e))&&(o.objectFlags|=4,o.typeParameters=G(a,s),o.outerTypeParameters=a,o.localTypeParameters=s,o.instantiations=new Map,o.instantiations.set(uy(o.typeParameters),o),o.target=o,o.resolvedTypeArguments=o.typeParameters,o.thisType=qs(e),o.thisType.isThisType=!0,o.thisType.constraint=o)}return t.declaredType}function xu(e){var t;const n=_a(e);if(!n.declaredType){if(!Hc(e,2))return Et;const r=pn.checkDefined(null==(t=e.declarations)?void 0:t.find(Ig),"Type alias symbol with no valid declaration found"),i=Ag(r)?r.typeExpression:r.type;let o=i?$k(i):Et;if(Xc()){const t=iu(e);t&&(n.typeParameters=t,n.instantiations=new Map,n.instantiations.set(uy(t),o)),o===It&&"BuiltinIteratorReturn"===e.escapedName&&(o=Nv())}else o=Et,341===r.kind?Jo(r.typeExpression.type,fa.Type_alias_0_circularly_references_itself,pc(e)):Jo(Nc(r)&&r.name||r,fa.Type_alias_0_circularly_references_itself,pc(e));n.declaredType??(n.declaredType=o)}return n.declaredType}function Su(e){return 1056&e.flags&&8&e.symbol.flags?Ru(Cs(e.symbol)):e}function wu(e){const t=_a(e);if(!t.declaredType){const n=[];if(e.declarations)for(const t of e.declarations)if(267===t.kind)for(const r of t.members)if(vd(r)){const t=Ss(r),i=Yz(r).value,o=xk(void 0!==i?jk(i,uJ(e),t):Du(t));_a(t).declaredType=o,n.push(kk(o))}const r=n.length?zb(n,1,e,void 0):Du(e);1048576&r.flags&&(r.flags|=1024,r.symbol=e),t.declaredType=r}return t.declaredType}function Du(e){const t=Rs(32,e),n=Rs(32,e);return t.regularType=t,t.freshType=n,n.regularType=t,n.freshType=n,t}function Fu(e){const t=_a(e);if(!t.declaredType){const n=wu(Cs(e));t.declaredType||(t.declaredType=n)}return t.declaredType}function ju(e){const t=_a(e);return t.declaredType||(t.declaredType=qs(e))}function Ru(e){return Bu(e)||Et}function Bu(e){return 96&e.flags?bu(e):524288&e.flags?xu(e):262144&e.flags?ju(e):384&e.flags?wu(e):8&e.flags?Fu(e):2097152&e.flags?function(e){const t=_a(e);return t.declaredType||(t.declaredType=Ru(Ha(e)))}(e):void 0}function Vu(e){switch(e.kind){case 133:case 159:case 154:case 150:case 163:case 136:case 155:case 151:case 116:case 157:case 146:case 202:return!0;case 189:return Vu(e.elementType);case 184:return!e.typeArguments||e.typeArguments.every(Vu)}return!1}function Wu(e){const t=ml(e);return!t||Vu(t)}function Xu(e){const t=yv(e);return t?Vu(t):!Ou(e)}function nd(e){if(e.declarations&&1===e.declarations.length){const t=e.declarations[0];if(t)switch(t.kind){case 173:case 172:return Xu(t);case 175:case 174:case 177:case 178:case 179:return function(e){const t=bv(e),n=fl(e);return(177===e.kind||!!t&&Vu(t))&&e.parameters.every(Xu)&&n.every(Wu)}(t)}}return!1}function rd(e,t,n){const r=Zu();for(const i of e)r.set(i.escapedName,n&&nd(i)?i:hS(i,t));return r}function id(e,t){for(const n of t){if(od(n))continue;const t=e.get(n.escapedName);(!t||t.valueDeclaration&&AF(t.valueDeclaration)&&!Ol(t)&&!tm(t.valueDeclaration))&&(e.set(n.escapedName,n),e.set(n.escapedName,n))}}function od(e){return!!e.valueDeclaration&&Yl(e.valueDeclaration)&&Iv(e.valueDeclaration)}function ad(e){if(!e.declaredProperties){const t=e.symbol,n=Fd(t);e.declaredProperties=Vs(n),e.declaredCallSignatures=_,e.declaredConstructSignatures=_,e.declaredIndexInfos=_,e.declaredCallSignatures=Yg(n.get("__call")),e.declaredConstructSignatures=Yg(n.get("__new")),e.declaredIndexInfos=Zh(t)}return e}function ud(e){return pd(e)&&dC(ND(e)?uI(e):SM(e.argumentExpression))}function dd(e){return pd(e)&&JS(ND(e)?uI(e):SM(e.argumentExpression),hn)}function pd(e){if(!ND(e)&&!yF(e))return!1;return ub(ND(e)?e.expression:e.argumentExpression)}function fd(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&64===e.charCodeAt(2)}function md(e){const t=Fc(e);return!!t&&ud(t)}function yd(e){const t=Fc(e);return!!t&&dd(t)}function vd(e){return!qh(e)||md(e)}function bd(e){return Uh(e)&&!ud(e)}function xd(e,t,n,r){pn.assert(!!r.symbol,"The member is expected to have a symbol.");const i=ua(r);if(!i.resolvedSymbol){i.resolvedSymbol=r.symbol;const o=AF(r)?r.left:r.name,a=yF(o)?SM(o.argumentExpression):uI(o);if(dC(a)){const s=pC(a),c=r.symbol.flags;let l=n.get(s);l||n.set(s,l=Xo(0,s,4096));const _=t&&t.get(s);if(!(32&e.flags)&&l.flags&Zo(c)){const e=_?G(_.declarations,l.declarations):l.declarations,t=!(8192&a.flags)&&vc(s)||jp(o);p(e,e=>Jo(Fc(e)||e,fa.Property_0_was_also_declared_here,t)),Jo(o||r,fa.Duplicate_property_0,t),l=Xo(0,s,4096)}return l.links.nameType=a,function(e,t,n){pn.assert(!!(4096&cx(e)),"Expected a late-bound symbol."),e.flags|=n,_a(t.symbol).lateSymbol=e,e.declarations?t.symbol.isReplaceableByMethod||e.declarations.push(t):e.declarations=[t],111551&n&&vg(e,t)}(l,r,c),l.parent?pn.assert(l.parent===e,"Existing symbol parent should match new one"):l.parent=e,i.resolvedSymbol=l}}return i.resolvedSymbol}function Nd(e,t,n,r){let i=n.get("__index");if(!i){const e=null==t?void 0:t.get("__index");e?(i=ta(e),i.links.checkFlags|=4096):i=Xo(0,"__index",4096),n.set("__index",i)}i.declarations?r.symbol.isReplaceableByMethod||i.declarations.push(r):i.declarations=[r]}function Dd(e,t){const n=_a(e);if(!n[t]){const r="resolvedExports"===t,i=r?1536&e.flags?xs(e).exports:e.exports:e.members;n[t]=i||F;const o=Zu();for(const t of e.declarations||_){const n=Lf(t);if(n)for(const t of n)r===Ov(t)&&(md(t)?xd(e,i,o,t):yd(t)&&Nd(0,i,o,t))}const a=ws(e).assignmentDeclarationMembers;if(a){const t=je(a.values());for(const n of t){const t=og(n);r===!(3===t||AF(n)&&kA(n,t)||9===t||6===t)&&md(n)&&xd(e,i,o,n)}}let s=function(e,t){if(!(null==e?void 0:e.size))return t;if(!(null==t?void 0:t.size))return e;const n=Zu();return aa(n,e),aa(n,t),n}(i,o);if(33554432&e.flags&&n.cjsExportMerged&&e.declarations)for(const n of e.declarations){const e=_a(n.symbol)[t];s?e&&e.forEach((e,t)=>{const n=s.get(t);if(n){if(n===e)return;s.set(t,na(n,e))}else s.set(t,e)}):s=e}n[t]=s||F}return n[t]}function Fd(e){return 6256&e.flags?Dd(e,"resolvedMembers"):e.members||F}function Ed(e){if(106500&e.flags&&"__computed"===e.escapedName){const t=_a(e);if(!t.lateSymbol&&H(e.declarations,md)){const t=ks(e.parent);H(e.declarations,Ov)?gs(t):Fd(t)}return t.lateSymbol||(t.lateSymbol=e)}return e}function Id(e,t,n){if(4&xx(e)){const n=e.target,r=by(e);return d(n.typeParameters)===d(r)?hy(n,G(r,[t||n.thisType])):e}if(2097152&e.flags){const r=I(e.types,e=>Id(e,t,n));return r!==e.types?Gb(r):e}return n?qf(e):e}function Od(e,t,n,r){let i,o,a,s,c;fe(n,r,0,n.length)?(o=t.symbol?Fd(t.symbol):Zu(t.declaredProperties),a=t.declaredCallSignatures,s=t.declaredConstructSignatures,c=t.declaredIndexInfos):(i=nS(n,r),o=rd(t.declaredProperties,i,1===n.length),a=Qk(t.declaredCallSignatures,i),s=Qk(t.declaredConstructSignatures,i),c=tS(t.declaredIndexInfos,i));const l=gu(t);if(l.length){if(t.symbol&&o===Fd(t.symbol)){const e=Zu(t.declaredProperties),n=zh(t.symbol);n&&e.set("__index",n),o=e}$s(e,o,a,s,c);const n=be(r);for(const e of l){const t=n?Id(CS(e,i),n):e;id(o,lf(t)),a=G(a,Jm(t,0)),s=G(s,Jm(t,1));const r=t!==wt?cg(t):[di];c=G(c,D(r,e=>!Vm(c,e.keyType)))}}$s(e,o,a,s,c)}function Ld(e,t,n,r,i,o,a,s){const c=new l(We,s);return c.declaration=e,c.typeParameters=t,c.parameters=r,c.thisParameter=n,c.resolvedReturnType=i,c.resolvedTypePredicate=o,c.minArgumentCount=a,c.resolvedMinArgumentCount=void 0,c.target=void 0,c.mapper=void 0,c.compositeSignatures=void 0,c.compositeKind=void 0,c}function jd(e){const t=Ld(e.declaration,e.typeParameters,e.thisParameter,e.parameters,void 0,void 0,e.minArgumentCount,167&e.flags);return t.target=e.target,t.mapper=e.mapper,t.compositeSignatures=e.compositeSignatures,t.compositeKind=e.compositeKind,t}function Md(e,t){const n=jd(e);return n.compositeSignatures=t,n.compositeKind=1048576,n.target=void 0,n.mapper=void 0,n}function Rd(e,t){if((24&e.flags)===t)return e;e.optionalCallSignatureCache||(e.optionalCallSignatureCache={});const n=8===t?"inner":"outer";return e.optionalCallSignatureCache[n]||(e.optionalCallSignatureCache[n]=function(e,t){pn.assert(8===t||16===t,"An optional call signature can either be for an inner call chain or an outer call chain, but not both.");const n=jd(e);return n.flags|=t,n}(e,t))}function Bd(e,t){if(hJ(e)){const r=e.parameters.length-1,i=e.parameters[r],o=z_(i);if(fw(o))return[n(o,r,i)];if(!t&&1048576&o.flags&&b(o.types,fw))return P(o.types,e=>n(e,r,i))}return[e.parameters];function n(t,n,r){const i=by(t),o=function(e,t){const n=P(e.target.labeledElementDeclarations,(n,r)=>sj(n,r,e.target.elementFlags[r],t));if(n){const e=[],t=new Set;for(let r=0;r{const a=o&&o[i]?o[i]:cj(e,n+i,t),s=t.target.elementFlags[i],c=Xo(1,a,12&s?32768:2&s?16384:0);return c.links.type=4&s?Kv(r):r,c});return G(e.parameters.slice(0,n),a)}}function Jd(e,t,n,r,i){for(const o of e)if(qC(o,t,n,r,i,n?MS:LS))return o}function zd(e,t,n){if(t.typeParameters){if(n>0)return;for(let n=1;n1&&(n=void 0===n?r:-1);for(const n of e[r])if(!t||!Jd(t,n,!1,!1,!0)){const i=zd(e,n,r);if(i){let e=n;if(i.length>1){let t=n.thisParameter;const r=p(i,e=>e.thisParameter);if(r){t=Rw(r,Gb(J(i,e=>e.thisParameter&&z_(e.thisParameter))))}e=Md(n,i),e.thisParameter=t}(t||(t=[])).push(e)}}}if(!d(t)&&-1!==n){const r=e[void 0!==n?n:0];let i=r.slice();for(const t of e)if(t!==r){const e=t[0];if(pn.assert(!!e,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"),i=e.typeParameters&&H(i,t=>!!t.typeParameters&&!Ud(e.typeParameters,t.typeParameters))?void 0:P(i,t=>Vd(t,e)),!i)break}t=i}return t||_}function Ud(e,t){if(d(e)!==d(t))return!1;if(!e||!t)return!0;const n=nS(t,e);for(let r=0;r=i?e:t,a=o===e?t:e,s=o===e?r:i,c=yj(e)||yj(t),l=c&&!yj(o),_=new Array(s+(l?1:0));for(let u=0;u=hj(o)&&u>=hj(a),h=u>=r?void 0:cj(e,u),y=u>=i?void 0:cj(t,u),v=Xo(1|(g&&!m?16777216:0),(h===y?h:h?y?void 0:h:y)||`arg${u}`,m?32768:g?16384:0);v.links.type=m?Kv(f):f,_[u]=v}if(l){const e=Xo(1,"args",32768);e.links.type=Kv(dj(a,s)),a===t&&(e.links.type=CS(e.links.type,n)),_[s]=e}return _}(e,t,r),s=be(a);s&&32768&cx(s)&&(i|=1);const c=function(e,t,n){return e&&t?Rw(e,Gb([z_(e),CS(z_(t),n)])):e||t}(e.thisParameter,t.thisParameter,r),l=Ld(o,n,c,a,void 0,void 0,Math.max(e.minArgumentCount,t.minArgumentCount),i);return l.compositeKind=1048576,l.compositeSignatures=G(2097152!==e.compositeKind&&e.compositeSignatures||[e],[t]),r?l.mapper=2097152!==e.compositeKind&&e.mapper&&e.compositeSignatures?_S(e.mapper,r):r:2097152!==e.compositeKind&&e.mapper&&e.compositeSignatures&&(l.mapper=e.mapper),l}function Wd(e){const t=cg(e[0]);if(t){const n=[];for(const r of t){const t=r.keyType;b(e,e=>!!lg(e,t))&&n.push(Qh(t,zb(P(e,e=>dg(e,t))),H(e,e=>lg(e,t).isReadonly)))}return n}return _}function $d(e,t){return e?t?Gb([e,t]):e:t}function Kd(e){const t=N(e,e=>Jm(e,1).length>0),n=P(e,ou);if(t>0&&t===N(n,e=>e)){const e=n.indexOf(!0);n[e]=!1}return n}function Gd(e,t,n,r){const i=[];for(let o=0;o!qC(e,n,!1,!1,!1,LS))||(e=ae(e,n));return e}function tp(e,t,n){if(e)for(let r=0;r{var n;418&t.flags||512&t.flags&&(null==(n=t.declarations)?void 0:n.length)&&b(t.declarations,dp)||e.set(t.escapedName,t)}),i=e}if($s(e,i,_,_,_),32&t.flags){const e=pu(bu(t));11272192&e.flags?(i=Zu(function(e){const t=Vs(e),n=Xh(e);return n?G(t,[n]):t}(i)),id(i,lf(e))):e===wt&&(r=di)}const o=Xh(i);if(o?n=oy(o,je(i.values())):(r&&(n=ae(n,r)),384&t.flags&&(32&Ru(t).flags||H(e.properties,e=>!!(296&z_(e).flags)))&&(n=ae(n,ui))),$s(e,i,_,_,n||_),8208&t.flags&&(e.callSignatures=Yg(t)),32&t.flags){const n=bu(t);let r=t.members?Yg(t.members.get("__constructor")):_;16&t.flags&&(r=le(r.slice(),J(e.callSignatures,e=>ML(e.declaration)?Ld(e.declaration,e.typeParameters,e.thisParameter,e.parameters,n,void 0,e.minArgumentCount,167&e.flags):void 0))),r.length||(r=function(e){const t=Jm(pu(e),1),n=bx(e.symbol),r=!!n&&Av(n,64);if(0===t.length)return[Ld(void 0,e.localTypeParameters,void 0,_,e,void 0,0,r?4:0)];const i=su(e),o=Om(i),a=Hy(i),s=d(a),c=[];for(const n of t){const t=Mg(n.typeParameters),i=d(n.typeParameters);if(o||s>=t&&s<=i){const s=i?Ah(n,Jg(a,n.typeParameters,t,o)):jd(n);s.typeParameters=e.localTypeParameters,s.resolvedReturnType=e,s.flags=r?4|s.flags:-5&s.flags,c.push(s)}}return c}(n)),e.constructSignatures=r}}function ip(e,t,n){return CS(e,nS([t.indexType,t.objectType],[Pk(0),kb([n])]))}function ap(e){const t=lg(e.source,Ut),n=Dp(e.mappedType),r=!(1&n),i=4&n?0:16777216,o=t?[Qh(Ut,hN(t.type,e.mappedType,e.constraintType)||Ot,r&&t.isReadonly)]:_,a=Zu(),s=function(e){const t=kp(e.mappedType);if(!(1048576&t.flags||2097152&t.flags))return;const n=1048576&t.flags?t.origin:t;if(!(n&&2097152&n.flags))return;const r=Gb(n.types.filter(t=>t!==e.constraintType));return r!==_n?r:void 0}(e);for(const t of lf(e.source)){if(s){if(!JS(ix(t,8576),s))continue}const n=8192|(r&&Yj(t)?8:0),o=Xo(4|t.flags&i,t.escapedName,n);if(o.declarations=t.declarations,o.links.nameType=_a(t).nameType,o.links.propertyType=z_(t),8388608&e.constraintType.type.flags&&262144&e.constraintType.type.objectType.flags&&262144&e.constraintType.type.indexType.flags){const t=e.constraintType.type.objectType,n=ip(e.mappedType,e.constraintType.type,t);o.links.mappedType=n,o.links.constraintType=_x(t)}else o.links.mappedType=e.mappedType,o.links.constraintType=e.constraintType;a.set(t.escapedName,o)}$s(e,a,_,_,o)}function sp(e){if(4194304&e.flags){const t=qf(e.type);return mw(t)?Db(t):_x(t)}if(16777216&e.flags){if(e.root.isDistributive){const t=e.checkType,n=sp(t);if(n!==t)return TS(e,dS(e.root.checkType,n,e.mapper),!1)}return e}if(1048576&e.flags)return zF(e,sp,!0);if(2097152&e.flags){const t=e.types;return 2===t.length&&76&t[0].flags&&t[1]===Pn?e:Gb(I(e.types,sp))}return e}function cp(e){return 4096&cx(e)}function lp(e,t,n,r){for(const n of lf(e))r(ix(n,t));if(1&e.flags)r(Ut);else for(const t of cg(e))(!n||134217732&t.keyType.flags)&&r(t.keyType)}function fp(e){const t=Zu();let n;$s(e,F,_,_,_);const r=vp(e),i=kp(e),o=e.target||e,a=Sp(o),s=2!==Vp(o),c=Tp(o),l=qf(Np(e)),u=Dp(e);function d(i){wF(a?CS(a,pS(e.mapper,r,i)):i,o=>function(i,o){if(dC(o)){const n=pC(o),r=t.get(n);if(r)r.links.nameType=zb([r.links.nameType,o]),r.links.keyType=zb([r.links.keyType,i]);else{const r=dC(i)?Am(l,pC(i)):void 0,a=!!(4&u||!(8&u)&&r&&16777216&r.flags),c=!!(1&u||!(2&u)&&r&&Yj(r)),_=$&&!a&&r&&16777216&r.flags,d=Xo(4|(a?16777216:0),n,262144|(r?cp(r):0)|(c?8:0)|(_?524288:0));d.links.mappedType=e,d.links.nameType=o,d.links.keyType=i,r&&(d.links.syntheticOrigin=r,d.declarations=s?r.declarations:void 0),t.set(n,d)}}else if(ay(o)||33&o.flags){const t=5&o.flags?Ut:40&o.flags?Wt:o,a=CS(c,pS(e.mapper,r,i)),s=yg(l,o),_=Qh(t,a,!!(1&u||!(2&u)&&(null==s?void 0:s.isReadonly)));n=tp(n,_,!0)}}(i,o))}wp(e)?lp(l,8576,!1,d):wF(sp(i),d),$s(e,t,_,_,n||_)}function vp(e){return e.typeParameter||(e.typeParameter=ju(Ss(e.declaration.typeParameter)))}function kp(e){return e.constraintType||(e.constraintType=uf(vp(e))||Et)}function Sp(e){return e.declaration.nameType?e.nameType||(e.nameType=CS($k(e.declaration.nameType),e.mapper)):void 0}function Tp(e){return e.templateType||(e.templateType=e.declaration.type?CS(Al($k(e.declaration.type),!0,!!(4&Dp(e))),e.mapper):Et)}function Cp(e){return ml(e.declaration.typeParameter)}function wp(e){const t=Cp(e);return 199===t.kind&&143===t.operator}function Np(e){if(!e.modifiersType)if(wp(e))e.modifiersType=CS($k(Cp(e).type),e.mapper);else{const t=kp(Hx(e.declaration)),n=t&&262144&t.flags?uf(t):t;e.modifiersType=n&&4194304&n.flags?CS(n.type,e.mapper):Ot}return e.modifiersType}function Dp(e){const t=e.declaration;return(t.readonlyToken?41===t.readonlyToken.kind?2:1:0)|(t.questionToken?41===t.questionToken.kind?8:4:0)}function Fp(e){const t=Dp(e);return 8&t?-1:4&t?1:0}function Ap(e){if(32&xx(e))return Fp(e)||Ap(Np(e));if(2097152&e.flags){const t=Ap(e.types[0]);return b(e.types,(e,n)=>0===n||Ap(e)===t)?t:0}return 0}function Bp(e){if(32&xx(e)){const t=kp(e);if(jx(t))return!0;const n=Sp(e);if(n&&jx(CS(n,iS(vp(e),t))))return!0}return!1}function Vp(e){const t=Sp(e);return t?JS(t,vp(e))?1:2:0}function Hp(e){return e.members||(524288&e.flags?4&e.objectFlags?function(e){const t=ad(e.target),n=G(t.typeParameters,[t.thisType]),r=by(e);Od(e,t,n,r.length===n.length?r:G(r,[e]))}(e):3&e.objectFlags?function(e){Od(e,ad(e),_,_)}(e):1024&e.objectFlags?ap(e):16&e.objectFlags?rp(e):32&e.objectFlags?fp(e):pn.fail("Unhandled object type "+pn.formatObjectFlags(e.objectFlags)):1048576&e.flags?function(e){const t=qd(P(e.types,e=>e===Xn?[ci]:Jm(e,0))),n=qd(P(e.types,e=>Jm(e,1))),r=Wd(e.types);$s(e,F,t,n,r)}(e):2097152&e.flags?function(e){let t,n,r;const i=e.types,o=Kd(i),a=N(o,e=>e);for(let s=0;s0&&(e=P(e,e=>{const t=jd(e);return t.resolvedReturnType=Gd(gh(e),i,o,s),t})),n=Zd(n,e)}t=Zd(t,Jm(c,0)),r=De(cg(c),(e,t)=>tp(e,t,!1),r)}$s(e,F,t||_,n||_,r||_)}(e):pn.fail("Unhandled type "+pn.formatTypeFlags(e.flags))),e}function Kp(e){return 524288&e.flags?Hp(e).properties:_}function Qp(e,t){if(524288&e.flags){const n=Hp(e).members.get(t);if(n&&Os(n))return n}}function cf(e){if(!e.resolvedProperties){const t=Zu();for(const n of e.types){for(const r of lf(n))if(!t.has(r.escapedName)){const n=Xf(e,r.escapedName,!!(2097152&e.flags));n&&t.set(r.escapedName,n)}if(1048576&e.flags&&0===cg(n).length)break}e.resolvedProperties=Vs(t)}return e.resolvedProperties}function lf(e){return 3145728&(e=Uf(e)).flags?cf(e):Kp(e)}function _f(e){return 262144&e.flags?uf(e):8388608&e.flags?function(e){return Sf(e)?function(e){if(Pf(e))return zx(e.objectType,e.indexType);const t=mf(e.indexType);if(t&&t!==e.indexType){const n=Wx(e.objectType,t,e.accessFlags);if(n)return n}const n=mf(e.objectType);if(n&&n!==e.objectType)return Wx(n,e.indexType,e.accessFlags);return}(e):void 0}(e):16777216&e.flags?bf(e):xf(e)}function uf(e){return Sf(e)?ly(e):void 0}function df(e,t=0){var n;return t<5&&!(!e||!(262144&e.flags&&H(null==(n=e.symbol)?void 0:n.declarations,e=>Av(e,4096))||3145728&e.flags&&H(e.types,e=>df(e,t))||8388608&e.flags&&df(e.objectType,t+1)||16777216&e.flags&&df(bf(e),t+1)||33554432&e.flags&&df(e.baseType,t)||32&xx(e)&&function(e,t){const n=bS(e);return!!n&&df(n,t)}(e,t)||mw(e)&&S(Pb(e),(n,r)=>!!(8&e.target.elementFlags[r])&&df(n,t))>=0))}function mf(e){const t=Rx(e,!1);return t!==e?t:_f(e)}function hf(e){if(!e.resolvedDefaultConstraint){const t=function(e){return e.resolvedInferredTrueType||(e.resolvedInferredTrueType=e.combinedMapper?CS($k(e.root.node.trueType),e.combinedMapper):Zx(e))}(e),n=rk(e);e.resolvedDefaultConstraint=rl(t)?n:rl(n)?t:zb([t,n])}return e.resolvedDefaultConstraint}function yf(e){if(void 0!==e.resolvedConstraintOfDistributive)return e.resolvedConstraintOfDistributive||void 0;if(e.root.isDistributive&&e.restrictiveInstantiation!==e){const t=Rx(e.checkType,!1),n=t===e.checkType?_f(t):t;if(n&&n!==e.checkType){const t=TS(e,dS(e.root.checkType,n,e.mapper),!0);if(!(131072&t.flags))return e.resolvedConstraintOfDistributive=t,t}}e.resolvedConstraintOfDistributive=!1}function vf(e){return yf(e)||hf(e)}function bf(e){return Sf(e)?vf(e):void 0}function xf(e){if(464781312&e.flags||mw(e)){const t=Tf(e);return t!==jn&&t!==Mn?t:void 0}return 4194304&e.flags?hn:void 0}function kf(e){return xf(e)||e}function Sf(e){return Tf(e)!==Mn}function Tf(e){if(e.resolvedBaseConstraint)return e.resolvedBaseConstraint;const t=[];return e.resolvedBaseConstraint=n(e);function n(e){if(!e.immediateBaseConstraint){if(!Hc(e,4))return Mn;let n;const o=BC(e);if((t.length<10||t.length<50&&!C(t,o))&&(t.push(o),n=function(e){if(262144&e.flags){const t=ly(e);return e.isThisType||!t?t:i(t)}if(3145728&e.flags){const t=e.types,n=[];let r=!1;for(const e of t){const t=i(e);t?(t!==e&&(r=!0),n.push(t)):r=!0}return r?1048576&e.flags&&n.length===t.length?zb(n):2097152&e.flags&&n.length?Gb(n):void 0:e}if(4194304&e.flags)return hn;if(134217728&e.flags){const t=e.types,n=J(t,i);return n.length===t.length?mx(e.texts,n):Ut}if(268435456&e.flags){const t=i(e.type);return t&&t!==e.type?hx(e.symbol,t):Ut}if(8388608&e.flags){if(Pf(e))return i(zx(e.objectType,e.indexType));const t=i(e.objectType),n=i(e.indexType),r=t&&n&&Wx(t,n,e.accessFlags);return r&&i(r)}if(16777216&e.flags){const t=vf(e);return t&&i(t)}if(33554432&e.flags)return i(My(e));if(mw(e)){return kb(P(Pb(e),(t,n)=>{const r=262144&t.flags&&8&e.target.elementFlags[n]&&i(t)||t;return r!==t&&PF(r,e=>KC(e)&&!mw(e))?r:t}),e.target.elementFlags,e.target.readonly,e.target.labeledElementDeclarations)}return e}(Rx(e,!1)),t.pop()),!Xc()){if(262144&e.flags){const t=sy(e);if(t){const n=Jo(t,fa.Type_parameter_0_has_a_circular_constraint,Sc(e));!r||dh(t,r)||dh(r,t)||uT(n,qp(r,fa.Circularity_originates_in_type_at_this_location))}}n=Mn}e.immediateBaseConstraint??(e.immediateBaseConstraint=n||jn)}return e.immediateBaseConstraint}function i(e){const t=n(e);return t!==jn&&t!==Mn?t:void 0}}function Cf(e){if(e.default)e.default===Rn&&(e.default=Mn);else if(e.target){const t=Cf(e.target);e.default=t?CS(t,e.mapper):jn}else{e.default=Rn;const t=e.symbol&&p(e.symbol.declarations,e=>DD(e)&&e.default),n=t?$k(t):jn;e.default===Rn&&(e.default=n)}return e.default}function wf(e){const t=Cf(e);return t!==jn&&t!==Mn?t:void 0}function Nf(e){return!(!e.symbol||!p(e.symbol.declarations,e=>DD(e)&&e.default))}function Df(e){return e.resolvedApparentType||(e.resolvedApparentType=function(e){const t=e.target??e,n=bS(t);if(n&&!t.declaration.nameType){const r=Np(e),i=Bp(r)?Df(r):xf(r);if(i&&PF(i,e=>KC(e)||Ff(e)))return CS(t,dS(n,i,e.mapper))}return e}(e))}function Ff(e){return!!(2097152&e.flags)&&b(e.types,KC)}function Pf(e){let t;return!(!(8388608&e.flags&&32&xx(t=e.objectType)&&!Bp(t)&&jx(e.indexType))||8&Dp(t)||t.declaration.nameType)}function qf(e){const t=465829888&e.flags?xf(e)||Ot:e,n=xx(t);return 32&n?Df(t):4&n&&t!==e?Id(t,e):2097152&t.flags?function(e,t){if(e===t)return e.resolvedApparentType||(e.resolvedApparentType=Id(e,t,!0));const n=`I${Ab(e)},${Ab(t)}`;return Io(n)??Oo(n,Id(e,t,!0))}(t,e):402653316&t.flags?tr:296&t.flags?nr:2112&t.flags?Vr||(Vr=tv("BigInt",0,!1))||Nn:528&t.flags?or:12288&t.flags?_v():67108864&t.flags?Nn:4194304&t.flags?hn:2&t.flags&&!$?Nn:t}function Uf(e){return Qf(qf(Qf(e)))}function Kf(e,t,n){var r,i,o;let a,s,c,l=0;const _=1048576&e.flags;let u,p=4,f=_?0:8,m=!1;for(const r of e.types){const e=qf(r);if(!(il(e)||131072&e.flags)){const r=Am(e,t,n),i=r?lx(r):0;if(r){if(106500&r.flags&&(u??(u=_?0:16777216),_?u|=16777216&r.flags:u&=r.flags),a){if(r!==a){if((jJ(r)||r)===(jJ(a)||a)&&-1===zC(a,r,(e,t)=>e===t?-1:0))m=!!a.parent&&!!d(iu(a.parent));else{s||(s=new Map,s.set(uJ(a),a));const e=uJ(r);s.has(e)||s.set(e,r)}98304&l&&(98304&r.flags)!=(98304&l)&&(l=-98305&l|4)}}else a=r,l=98304&r.flags||4;_&&Yj(r)?f|=8:_||Yj(r)||(f&=-9),f|=(6&i?0:256)|(4&i?512:0)|(2&i?1024:0)|(256&i?2048:0),GI(r)||(p=2)}else if(_){const n=!fd(t)&&bg(e,t);n?(l=-98305&l|4,f|=32|(n.isReadonly?8:0),c=ae(c,fw(e)?hw(e)||Lt:n.type)):!IN(e)||2097152&xx(e)?f|=16:(f|=32,c=ae(c,Lt))}}}if(!a||_&&(s||48&f)&&1536&f&&(!s||!function(e){let t;for(const n of e){if(!n.declarations)return;if(t){if(t.forEach(e=>{C(n.declarations,e)||t.delete(e)}),0===t.size)return}else t=new Set(n.declarations)}return t}(s.values())))return;if(!(s||16&f||c)){if(m){const t=null==(r=rt(a,ed))?void 0:r.links,n=Rw(a,null==t?void 0:t.type);return n.parent=null==(o=null==(i=a.valueDeclaration)?void 0:i.symbol)?void 0:o.parent,n.links.containingType=e,n.links.mapper=null==t?void 0:t.mapper,n.links.writeType=L_(a),n}return a}const g=s?je(s.values()):[a];let h,y,v;const b=[];let x,k,S=!1;for(const e of g){k?e.valueDeclaration&&e.valueDeclaration!==k&&(S=!0):k=e.valueDeclaration,h=le(h,e.declarations);const t=z_(e);y||(y=t,v=_a(e).nameType);const n=L_(e);(x||n!==t)&&(x=ae(x||b.slice(),n)),t!==y&&(f|=64),(sw(t)||Ax(t))&&(f|=128),131072&t.flags&&t!==Sn&&(f|=131072),b.push(t)}le(b,c);const T=Xo(l|(u??0),t,p|f);return T.links.containingType=e,!S&&k&&(T.valueDeclaration=k,k.symbol.parent&&(T.parent=k.symbol.parent)),T.declarations=h,T.links.nameType=v,b.length>2?(T.links.checkFlags|=65536,T.links.deferralParent=e,T.links.deferralConstituents=b,T.links.deferralWriteConstituents=x):(T.links.type=_?zb(b):Gb(b),x&&(T.links.writeType=_?zb(x):Gb(x))),T}function Gf(e,t,n){var r,i,o;let a=n?null==(r=e.propertyCacheWithoutObjectFunctionPropertyAugment)?void 0:r.get(t):null==(i=e.propertyCache)?void 0:i.get(t);if(!a&&(a=Kf(e,t,n),a)){if((n?e.propertyCacheWithoutObjectFunctionPropertyAugment||(e.propertyCacheWithoutObjectFunctionPropertyAugment=Zu()):e.propertyCache||(e.propertyCache=Zu())).set(t,a),n&&!(48&cx(a))&&!(null==(o=e.propertyCache)?void 0:o.get(t))){(e.propertyCache||(e.propertyCache=Zu())).set(t,a)}}return a}function Xf(e,t,n){const r=Gf(e,t,n);return!r||16&cx(r)?void 0:r}function Qf(e){return 1048576&e.flags&&16777216&e.objectFlags?e.resolvedReducedType||(e.resolvedReducedType=function(e){const t=I(e.types,Qf);if(t===e.types)return e;const n=zb(t);1048576&n.flags&&(n.resolvedReducedType=n);return n}(e)):2097152&e.flags?(16777216&e.objectFlags||(e.objectFlags|=16777216|(H(cf(e),Zf)?33554432:0)),33554432&e.objectFlags?_n:e):e}function Zf(e){return hm(e)||ym(e)}function hm(e){return!(16777216&e.flags||192!=(131264&cx(e))||!(131072&z_(e).flags))}function ym(e){return!e.valueDeclaration&&!!(1024&cx(e))}function vm(e){return!!(1048576&e.flags&&16777216&e.objectFlags&&H(e.types,vm)||2097152&e.flags&&function(e){const t=e.uniqueLiteralFilledInstantiation||(e.uniqueLiteralFilledInstantiation=CS(e,Tn));return Qf(t)!==t}(e))}function km(e,t){if(2097152&t.flags&&33554432&xx(t)){const n=x(cf(t),hm);if(n)return ik(e,fa.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,Sc(t,void 0,536870912),pc(n));const r=x(cf(t),ym);if(r)return ik(e,fa.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,Sc(t,void 0,536870912),pc(r))}return e}function Am(e,t,n,r){var i,o;if(524288&(e=Uf(e)).flags){const a=Hp(e),s=a.members.get(t);if(s&&!r&&512&(null==(i=e.symbol)?void 0:i.flags)&&(null==(o=_a(e.symbol).typeOnlyExportStarMap)?void 0:o.has(t)))return;if(s&&Os(s,r))return s;if(n)return;const c=a===Ln?Xn:a.callSignatures.length?Qn:a.constructSignatures.length?Yn:void 0;if(c){const e=Qp(c,t);if(e)return e}return Qp(Kn,t)}if(2097152&e.flags){const r=Xf(e,t,!0);return r||(n?void 0:Xf(e,t,n))}if(1048576&e.flags)return Xf(e,t,n)}function jm(e,t){if(3670016&e.flags){const n=Hp(e);return 0===t?n.callSignatures:n.constructSignatures}return _}function Jm(e,t){const n=jm(Uf(e),t);if(0===t&&!d(n)&&1048576&e.flags){if(e.arrayFallbackSignatures)return e.arrayFallbackSignatures;let r;if(PF(e,e=>{var t;return!!(null==(t=e.symbol)?void 0:t.parent)&&function(e){if(!e||!Zn.symbol||!er.symbol)return!1;return!!Ps(e,Zn.symbol)||!!Ps(e,er.symbol)}(e.symbol.parent)&&(r?r===e.symbol.escapedName:(r=e.symbol.escapedName,!0))})){const n=Kv(zF(e,e=>rS((Um(e.symbol.parent)?er:Zn).typeParameters[0],e.mapper)),DF(e,e=>Um(e.symbol.parent)));return e.arrayFallbackSignatures=Jm(Zc(n,r),t)}e.arrayFallbackSignatures=n}return n}function Um(e){return!(!e||!er.symbol)&&!!Ps(e,er.symbol)}function Vm(e,t){return x(e,e=>e.keyType===t)}function $m(e,t){let n,r,i;for(const o of e)o.keyType===Ut?n=o:tg(t,o.keyType)&&(r?(i||(i=[r])).push(o):r=o);return i?Qh(Ot,Gb(P(i,e=>e.type)),De(i,(e,t)=>e&&t.isReadonly,!0)):r||(n&&tg(t,Ut)?n:void 0)}function tg(e,t){return JS(e,t)||t===Ut&&JS(e,Wt)||t===Wt&&(e===bn||!!(128&e.flags)&&WT(e.value))}function sg(e){if(3670016&e.flags){return Hp(e).indexInfos}return _}function cg(e){return sg(Uf(e))}function lg(e,t){return Vm(cg(e),t)}function dg(e,t){var n;return null==(n=lg(e,t))?void 0:n.type}function pg(e,t){return cg(e).filter(e=>tg(t,e.keyType))}function yg(e,t){return $m(cg(e),t)}function bg(e,t){return yg(e,fd(t)?sn:Ek(vc(t)))}function Sg(e){var t;let n;for(const t of fl(e))n=ue(n,ju(t.symbol));return(null==n?void 0:n.length)?n:gE(e)?null==(t=qg(e))?void 0:t.typeParameters:void 0}function Tg(e){const t=[];return e.forEach((e,n)=>{Us(n)||t.push(e)}),t}function Dg(e,t){if(Fs(e))return;const n=da(Te,'"'+e+'"',512);return n&&t?ks(n):n}function Fg(e){return Eg(e)||QT(e)||FD(e)&&eC(e)}function Og(e){if(Fg(e))return!0;if(!FD(e))return!1;if(e.initializer){const t=zg(e.parent),n=e.parent.parameters.indexOf(e);return pn.assert(n>=0),n>=hj(t,3)}const t=lm(e.parent);return!!t&&(!e.type&&!e.dotDotDotToken&&e.parent.parameters.indexOf(e)>=fL(t).length)}function Lg(e,t,n,r){return{kind:e,parameterName:t,parameterIndex:n,type:r}}function Mg(e){let t=0;if(e)for(let n=0;n=n&&o<=i){const n=e?e.slice():[];for(let e=o;e!!al(e))&&!al(e)&&!iI(e)&&(i|=32);for(let t=l?1:0;tc.arguments.length&&!u||(o=n.length)}if((178===e.kind||179===e.kind)&&vd(e)&&(!s||!r)){const t=178===e.kind?179:178,n=Qu(Ss(e),t);n&&(r=function(e){const t=Iq(e);return t&&t.symbol}(n))}a&&a.typeExpression&&(r=Rw(Xo(1,"this"),$k(a.typeExpression)));const _=EP(e)?Hg(e):e,u=_&&jD(_)?bu(ks(_.parent.symbol)):void 0,d=u?u.localTypeParameters:Sg(e);(qu(e)||Om(e)&&function(e,t){if(EP(e)||!Qg(e))return!1;const n=be(e.parameters),r=n?Oc(n):ll(e).filter(VP),i=m(r,e=>e.typeExpression&&wP(e.typeExpression.type)?e.typeExpression.type:void 0),o=Xo(3,"args",32768);i?o.links.type=Kv($k(i.type)):(o.links.checkFlags|=65536,o.links.deferralParent=_n,o.links.deferralConstituents=[cr],o.links.deferralWriteConstituents=[cr]);i&&t.pop();return t.push(o),!0}(e,n))&&(i|=1),(WD(e)&&Av(e,64)||jD(e)&&Av(e.parent,64))&&(i|=4),t.resolvedSignature=Ld(e,d,r,n,void 0,void 0,o,i)}return t.resolvedSignature}function qg(e){if(!Om(e)||!l_(e))return;const t=ol(e);return(null==t?void 0:t.typeExpression)&&eL($k(t.typeExpression))}function Qg(e){const t=ua(e);return void 0===t.containsArgumentsReference&&(512&t.flags?t.containsArgumentsReference=!0:t.containsArgumentsReference=function e(t){if(!t)return!1;switch(t.kind){case 80:return t.escapedText===Ie.escapedName&&cq(t)===Ie;case 173:case 175:case 178:case 179:return 168===t.name.kind&&e(t.name);case 212:case 213:return e(t.expression);case 304:return e(t.initializer);default:return!ry(t)&&!Ef(t)&&!!iO(t,e)}}(e.body)),t.containsArgumentsReference}function Yg(e){if(!e||!e.declarations)return _;const t=[];for(let n=0;n0&&r.body){const t=e.declarations[n-1];if(r.parent===t.parent&&r.kind===t.kind&&r.pos===t.end)continue}if(Om(r)&&r.jsDoc){const e=Wg(r);if(d(e)){for(const n of e){const e=n.typeExpression;void 0!==e.type||jD(r)||Qw(e,wt),t.push(zg(e))}continue}}t.push(!UT(r)&&!Vf(r)&&qg(r)||zg(r))}}return t}function Zg(e){const t=is(e,e);if(t){const e=cs(t);if(e)return z_(e)}return wt}function rh(e){if(e.thisParameter)return z_(e.thisParameter)}function oh(e){if(!e.resolvedTypePredicate){if(e.target){const t=oh(e.target);e.resolvedTypePredicate=t?mS(t,e.mapper):ai}else if(e.compositeSignatures)e.resolvedTypePredicate=function(e,t){let n;const r=[];for(const i of e){const e=oh(i);if(e){if(0!==e.kind&&1!==e.kind||n&&!Ub(n,e))return;n=e,r.push(e.type)}else{const e=2097152!==t?gh(i):void 0;if(e!==Ht&&e!==Kt)return}}if(!n)return;const i=fh(r,t);return Lg(n.kind,n.parameterName,n.parameterIndex,i)}(e.compositeSignatures,e.compositeKind)||ai;else{const t=e.declaration&&bv(e.declaration);let n;if(!t){const t=qg(e.declaration);t&&e!==t&&(n=oh(t))}if(t||n)e.resolvedTypePredicate=t&&qD(t)?function(e,t){const n=e.parameterName,r=e.type&&$k(e.type);return 198===n.kind?Lg(e.assertsModifier?2:0,void 0,void 0,r):Lg(e.assertsModifier?3:1,n.escapedText,S(t.parameters,e=>e.escapedName===n.escapedText),r)}(t,e):n||ai;else if(e.declaration&&l_(e.declaration)&&(!e.resolvedReturnType||16&e.resolvedReturnType.flags)&&gj(e)>0){const{declaration:t}=e;e.resolvedTypePredicate=ai,e.resolvedTypePredicate=function(e){switch(e.kind){case 177:case 178:case 179:return}if(0!==Rh(e))return;let t;if(e.body&&242!==e.body.kind)t=e.body;else{if(Af(e.body,e=>{if(t||!e.expression)return!0;t=e.expression})||!t||$j(e))return}return function(e,t){t=_h(t,!0);return 16&SM(t).flags?p(e.parameters,(n,r)=>{const i=z_(n.symbol);if(!i||16&i.flags||!uD(n.name)||zE(n.symbol)||Uu(n))return;const o=function(e,t,n,r){const i=Rg(t)&&t.flowNode||254===t.parent.kind&&t.parent.flowNode||iB(2,void 0,void 0),o=iB(32,t,i),a=IE(n.name,r,r,e,o);if(a===r)return;const s=iB(64,t,i),c=Qf(IE(n.name,r,a,e,s));return 131072&c.flags?a:void 0}(e,t,n,i);return o?Lg(1,vc(n.name.escapedText),r,o):void 0}):void 0}(e,t)}(t)||ai}else e.resolvedTypePredicate=ai}pn.assert(!!e.resolvedTypePredicate)}return e.resolvedTypePredicate===ai?void 0:e.resolvedTypePredicate}function fh(e,t,n){return 2097152!==t?zb(e,n):Gb(e)}function gh(e){if(!e.resolvedReturnType){if(!Hc(e,3))return Et;let t=e.target?CS(gh(e.target),e.mapper):e.compositeSignatures?CS(fh(P(e.compositeSignatures,gh),e.compositeKind,2),e.mapper):Ch(e.declaration)||(Pd(e.declaration.body)?wt:zj(e.declaration));if(8&e.flags?t=Fw(t):16&e.flags&&(t=Nw(t)),!Xc()){if(e.declaration){const t=bv(e.declaration);if(t)Jo(t,fa.Return_type_annotation_circularly_references_itself);else if(te){const t=e.declaration,n=Fc(t);n?Jo(n,fa._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,jp(n)):Jo(t,fa.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)}}t=wt}e.resolvedReturnType??(e.resolvedReturnType=t)}return e.resolvedReturnType}function Ch(e){if(177===e.kind)return bu(ks(e.parent.symbol));const t=bv(e);if(EP(e)){const n=Gg(e);if(n&&jD(n.parent)&&!t)return bu(ks(n.parent.parent.symbol))}if(Pg(e))return $k(e.parameters[0].type);if(t)return $k(t);if(178===e.kind&&vd(e)){const t=Om(e)&&Fl(e);if(t)return t;const n=k_(Qu(Ss(e),179));if(n)return n}return function(e){const t=qg(e);return t&&gh(t)}(e)}function Nh(e){return e.compositeSignatures&&H(e.compositeSignatures,Nh)||!e.resolvedReturnType&&Kc(e,3)>=0}function Fh(e){if(hJ(e)){const t=z_(e.parameters[e.parameters.length-1]),n=fw(t)?hw(t):t;return n&&dg(n,Wt)}}function Eh(e,t,n,r){const i=Ph(e,Jg(t,e.typeParameters,Mg(e.typeParameters),n));if(r){const e=tL(gh(i));if(e){const t=jd(e);t.typeParameters=r;const n=Bh(t);n.mapper=i.mapper;const o=jd(i);return o.resolvedReturnType=n,o}}return i}function Ph(e,t){const n=e.instantiations||(e.instantiations=new Map),r=uy(t);let i=n.get(r);return i||n.set(r,i=Ah(e,t)),i}function Ah(e,t){return gS(e,function(e,t){return nS(Ih(e),t)}(e,t),!0)}function Ih(e){return I(e.typeParameters,e=>e.mapper?CS(e,e.mapper):e)}function Lh(e){return e.typeParameters?e.erasedSignatureCache||(e.erasedSignatureCache=function(e){return gS(e,lS(e.typeParameters),!0)}(e)):e}function jh(e){return e.typeParameters?e.canonicalSignatureCache||(e.canonicalSignatureCache=function(e){return Eh(e,P(e.typeParameters,e=>e.target&&!uf(e.target)?e.target:e),Om(e.declaration))}(e)):e}function Mh(e){const t=e.typeParameters;if(t){if(e.baseSignatureCache)return e.baseSignatureCache;const n=lS(t),r=nS(t,P(t,e=>uf(e)||Ot));let i=P(t,e=>CS(e,r)||Ot);for(let e=0;e{ay(e)&&!Vm(n,e)&&n.push(Qh(e,t.type?$k(t.type):wt,Pv(t,8),t))})}}else if(yd(t)){const e=AF(t)?t.left:t.name,_=yF(e)?SM(e.argumentExpression):uI(e);if(Vm(n,_))continue;JS(_,hn)&&(JS(_,Wt)?(r=!0,Bv(t)||(i=!1)):JS(_,sn)?(o=!0,Bv(t)||(a=!1)):(s=!0,Bv(t)||(c=!1)),l.push(t.symbol))}const _=G(l,D(t,t=>t!==e));return s&&!Vm(n,Ut)&&n.push(gI(c,0,_,Ut)),r&&!Vm(n,Wt)&&n.push(gI(i,0,_,Wt)),o&&!Vm(n,sn)&&n.push(gI(a,0,_,sn)),n}return _}function ay(e){return!!(4108&e.flags)||Ax(e)||!!(2097152&e.flags)&&!Ox(e)&&H(e.types,ay)}function sy(e){return J(D(e.symbol&&e.symbol.declarations,DD),ml)[0]}function cy(e,t){var n;let r;if(null==(n=e.symbol)?void 0:n.declarations)for(const n of e.symbol.declarations)if(196===n.parent.kind){const[i=n.parent,o]=ch(n.parent.parent);if(184!==o.kind||t){if(170===o.kind&&o.dotDotDotToken||192===o.kind||203===o.kind&&o.dotDotDotToken)r=ae(r,Kv(Ot));else if(205===o.kind)r=ae(r,Ut);else if(169===o.kind&&201===o.parent.kind)r=ae(r,hn);else if(201===o.kind&&o.type&&_h(o.type)===n.parent&&195===o.parent.kind&&o.parent.extendsType===o&&201===o.parent.checkType.kind&&o.parent.checkType.type){const e=o.parent.checkType;r=ae(r,CS($k(e.type),iS(ju(Ss(e.typeParameter)),e.typeParameter.constraint?$k(e.typeParameter.constraint):hn)))}}else{const t=o,n=sR(t);if(n){const o=t.typeArguments.indexOf(i);if(o()=>iR(t,n,r))));o!==e&&(r=ae(r,o))}}}}}return r&&Gb(r)}function ly(e){if(!e.constraint)if(e.target){const t=uf(e.target);e.constraint=t?CS(t,e.mapper):jn}else{const t=sy(e);if(t){let n=$k(t);1&n.flags&&!il(n)&&(n=201===t.parent.parent.kind?hn:Ot),e.constraint=n}else e.constraint=cy(e)||jn}return e.constraint===jn?void 0:e.constraint}function _y(e){const t=Qu(e.symbol,169),n=KP(t.parent)?Vg(t.parent):t.parent;return n&&Ts(n)}function uy(e){let t="";if(e){const n=e.length;let r=0;for(;r1&&(t+=":"+o),r+=o}}return t}function dy(e,t){return e?`@${uJ(e)}`+(t?`:${uy(t)}`:""):""}function my(e,t){let n=0;for(const r of e)void 0!==t&&r.flags&t||(n|=xx(r));return 458752&n}function gy(e,t){return H(t)&&e===On?Ot:hy(e,t)}function hy(e,t){const n=uy(t);let r=e.instantiations.get(n);return r||(r=zs(4,e.symbol),e.instantiations.set(n,r),r.objectFlags|=t?my(t):0,r.target=e,r.resolvedTypeArguments=t),r}function yy(e){const t=Rs(e.flags,e.symbol);return t.objectFlags=e.objectFlags,t.target=e.target,t.resolvedTypeArguments=e.resolvedTypeArguments,t}function vy(e,t,n,r,i){if(!r){const e=pk(r=dk(t));i=n?Xk(e,n):e}const o=zs(4,e.symbol);return o.target=e,o.node=t,o.mapper=n,o.aliasSymbol=r,o.aliasTypeArguments=i,o}function by(e){var t,n;if(!e.resolvedTypeArguments){if(!Hc(e,5))return G(e.target.outerTypeParameters,null==(t=e.target.localTypeParameters)?void 0:t.map(()=>Et))||_;const i=e.node,o=i?184===i.kind?G(e.target.outerTypeParameters,oR(i,e.target.localTypeParameters)):189===i.kind?[$k(i.elementType)]:P(i.elements,$k):_;Xc()?e.resolvedTypeArguments??(e.resolvedTypeArguments=e.mapper?Xk(o,e.mapper):o):(e.resolvedTypeArguments??(e.resolvedTypeArguments=G(e.target.outerTypeParameters,(null==(n=e.target.localTypeParameters)?void 0:n.map(()=>Et))||_)),Jo(e.node||r,e.target.symbol?fa.Type_arguments_for_0_circularly_reference_themselves:fa.Tuple_type_arguments_circularly_reference_themselves,e.target.symbol&&pc(e.target.symbol)))}return e.resolvedTypeArguments}function xy(e){return d(e.target.typeParameters)}function ky(e,t){const n=Ru(ks(t)),r=n.localTypeParameters;if(r){const t=d(e.typeArguments),i=Mg(r),o=Om(e);if(!(!te&&o)&&(tr.length)){const t=o&&BF(e)&&!PP(e.parent);if(Jo(e,i===r.length?t?fa.Expected_0_type_arguments_provide_these_with_an_extends_tag:fa.Generic_type_0_requires_1_type_argument_s:t?fa.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:fa.Generic_type_0_requires_between_1_and_2_type_arguments,Sc(n,void 0,2),i,r.length),!o)return Et}if(184===e.kind&&nb(e,d(e.typeArguments)!==r.length))return vy(n,e,void 0);return hy(n,G(n.outerTypeParameters,Jg(Hy(e),r,i,o)))}return Vy(e,t)?n:Et}function Sy(e,t,n,r){const i=Ru(e);if(i===It){const n=sJ.get(e.escapedName);if(void 0!==n&&t&&1===t.length)return 4===n?Ey(t[0]):hx(e,t[0])}const o=_a(e),a=o.typeParameters,s=uy(t)+dy(n,r);let c=o.instantiations.get(s);return c||o.instantiations.set(s,c=wS(i,nS(a,Jg(t,a,Mg(a),Om(e.valueDeclaration))),n,r)),c}function Ty(e){var t;const n=null==(t=e.declarations)?void 0:t.find(Ig);return!(!n||!Yf(n))}function wy(e){return e.parent?`${wy(e.parent)}.${e.escapedName}`:e.escapedName}function Ny(e){const t=(167===e.kind?e.right:212===e.kind?e.name:e).escapedText;if(t){const n=167===e.kind?Ny(e.left):212===e.kind?Ny(e.expression):void 0,r=n?`${wy(n)}.${t}`:t;let i=St.get(r);return i||(St.set(r,i=Xo(524288,t,1048576)),i.parent=n,i.links.declaredType=Pt),i}return bt}function Dy(e,t,n){const r=function(e){switch(e.kind){case 184:return e.typeName;case 234:const t=e.expression;if(ub(t))return t}}(e);if(!r)return bt;const i=ns(r,t,n);return i&&i!==bt?i:n?bt:Ny(r)}function Fy(e,t){if(t===bt)return Et;if(96&(t=function(e){const t=e.valueDeclaration;if(!t||!Om(t)||524288&e.flags||Qm(t,!1))return;const n=fE(t)?Gm(t):Xm(t);if(n){const t=Ts(n);if(t)return RL(t,e)}}(t)||t).flags)return ky(e,t);if(524288&t.flags)return function(e,t){if(1048576&cx(t)){const n=Hy(e),r=dy(t,n);let i=Tt.get(r);return i||(i=Js(1,"error",void 0,`alias ${r}`),i.aliasSymbol=t,i.aliasTypeArguments=n,Tt.set(r,i)),i}const n=Ru(t),r=_a(t).typeParameters;if(r){const n=d(e.typeArguments),i=Mg(r);if(nr.length)return Jo(e,i===r.length?fa.Generic_type_0_requires_1_type_argument_s:fa.Generic_type_0_requires_between_1_and_2_type_arguments,pc(t),i,r.length),Et;const o=dk(e);let a,s=!o||!Ty(t)&&Ty(o)?void 0:o;if(s)a=pk(s);else if(Mu(e)){const t=Dy(e,2097152,!0);if(t&&t!==bt){const n=Ha(t);n&&524288&n.flags&&(s=n,a=Hy(e)||(r?[]:void 0))}}return Sy(t,Hy(e),s,a)}return Vy(e,t)?n:Et}(e,t);const n=Bu(t);if(n)return Vy(e,t)?kk(n):Et;if(111551&t.flags&&Uy(e)){const n=function(e,t){const n=ua(e);if(!n.resolvedJSDocType){const r=z_(t);let i=r;if(t.valueDeclaration){const n=206===e.kind&&e.qualifier;r.symbol&&r.symbol!==t&&n&&(i=Fy(e,r.symbol))}n.resolvedJSDocType=i}return n.resolvedJSDocType}(e,t);return n||(Dy(e,788968),z_(t))}return Et}function Ey(e){return Py(e)?jy(e,Ot):e}function Py(e){return!!(3145728&e.flags&&H(e.types,Py)||33554432&e.flags&&!Ay(e)&&Py(e.baseType)||524288&e.flags&&!_T(e)||432275456&e.flags&&!Ax(e))}function Ay(e){return!!(33554432&e.flags&&2&e.constraint.flags)}function Ly(e,t){return 3&t.flags||t===e||1&e.flags?e:jy(e,t)}function jy(e,t){const n=`${Ab(e)}>${Ab(t)}`,r=dt.get(n);if(r)return r;const i=Ms(33554432);return i.baseType=e,i.constraint=t,dt.set(n,i),i}function My(e){return Ay(e)?e.baseType:Gb([e.constraint,e.baseType])}function Jy(e){return 190===e.kind&&1===e.elements.length}function qy(e,t,n){return Jy(t)&&Jy(n)?qy(e,t.elements[0],n.elements[0]):Kx($k(t))===Kx(e)?$k(n):void 0}function Uy(e){return!!(16777216&e.flags)&&(184===e.kind||206===e.kind)}function Vy(e,t){return!e.typeArguments||(Jo(e,fa.Type_0_is_not_generic,t?pc(t):e.typeName?jp(e.typeName):QB),!1)}function Wy(e){if(uD(e.typeName)){const t=e.typeArguments;switch(e.typeName.escapedText){case"String":return Vy(e),Ut;case"Number":return Vy(e),Wt;case"BigInt":return Vy(e),$t;case"Boolean":return Vy(e),on;case"Void":return Vy(e),ln;case"Undefined":return Vy(e),Lt;case"Null":return Vy(e),zt;case"Function":case"function":return Vy(e),Xn;case"array":return t&&t.length||te?void 0:cr;case"promise":return t&&t.length||te?void 0:Rj(wt);case"Object":if(t&&2===t.length){if(Rm(e)){const e=$k(t[0]),n=$k(t[1]),r=e===Ut||e===Wt?[Qh(e,n,!1)]:_;return Hs(void 0,F,_,_,r)}return wt}return Vy(e),te?void 0:wt}}}function $y(e){const t=ua(e);if(!t.resolvedType){if(wl(e)&&G_(e.parent))return t.resolvedSymbol=bt,t.resolvedType=SM(e.parent.expression);let n,r;const i=788968;Uy(e)&&(r=Wy(e),r||(n=Dy(e,i,!0),n===bt?n=Dy(e,111551|i):Dy(e,i),r=Fy(e,n))),r||(n=Dy(e,i),r=Fy(e,n)),t.resolvedSymbol=n,t.resolvedType=r}return t.resolvedType}function Hy(e){return P(e.typeArguments,$k)}function Ky(e){const t=ua(e);if(!t.resolvedType){const n=ZL(e);t.resolvedType=kk(Kw(n))}return t.resolvedType}function Gy(e,t){function n(e){const t=e.declarations;if(t)for(const e of t)switch(e.kind){case 264:case 265:case 267:return e}}if(!e)return t?On:Nn;const r=Ru(e);return 524288&r.flags?d(r.typeParameters)!==t?(Jo(n(e),fa.Global_type_0_must_have_1_type_parameter_s,kc(e),t),t?On:Nn):r:(Jo(n(e),fa.Global_type_0_must_be_a_class_or_interface_type,kc(e)),t?On:Nn)}function Xy(e,t){return Zy(e,111551,t?fa.Cannot_find_global_value_0:void 0)}function Qy(e,t){return Zy(e,788968,t?fa.Cannot_find_global_type_0:void 0)}function Yy(e,t,n){const r=Zy(e,788968,n?fa.Cannot_find_global_type_0:void 0);if(r&&(Ru(r),d(_a(r).typeParameters)!==t)){return void Jo(r.declarations&&x(r.declarations,vE),fa.Global_type_0_must_have_1_type_parameter_s,kc(r),t)}return r}function Zy(e,t,n){return Ue(void 0,e,t,n,!1,!1)}function tv(e,t,n){const r=Qy(e,n);return r||n?Gy(r,t):void 0}function nv(e,t){let n;for(const r of e)n=ae(n,tv(r,t,!1));return n??_}function rv(){return Lr||(Lr=tv("ImportMeta",0,!0)||Nn)}function iv(){if(!jr){const e=Xo(0,"ImportMetaExpression"),t=rv(),n=Xo(4,"meta",8);n.parent=e,n.links.type=t;const r=Zu([n]);e.members=r,jr=Hs(e,r,_,_,_)}return jr}function ov(e){return Mr||(Mr=tv("ImportCallOptions",0,e))||Nn}function av(e){return Rr||(Rr=tv("ImportAttributes",0,e))||Nn}function sv(e){return dr||(dr=Xy("Symbol",e))}function _v(){return fr||(fr=tv("Symbol",0,!1))||Nn}function gv(e){return gr||(gr=tv("Promise",1,e))||On}function hv(e){return hr||(hr=tv("PromiseLike",1,e))||On}function vv(e){return yr||(yr=Xy("Promise",e))}function Sv(e){return Nr||(Nr=tv("AsyncIterable",3,e))||On}function Tv(e){return Fr||(Fr=tv("AsyncIterableIterator",3,e))||On}function Cv(e){return br||(br=tv("Iterable",3,e))||On}function wv(e){return kr||(kr=tv("IterableIterator",3,e))||On}function Nv(){return ee?Lt:wt}function Dv(e){return Br||(Br=tv("Disposable",0,e))||Nn}function qv(e,t=0){const n=Zy(e,788968,void 0);return n&&Gy(n,t)}function Uv(e){return Ur||(Ur=Yy("Awaited",1,e)||(e?bt:void 0)),Ur===bt?void 0:Ur}function Wv(e,t){return e!==On?hy(e,t):Nn}function $v(e){return Wv(mr||(mr=tv("TypedPropertyDescriptor",1,!0)||On),[e])}function Hv(e){return Wv(Cv(!0),[e,ln,Lt])}function Kv(e,t){return Wv(t?er:Zn,[e])}function Gv(e){switch(e.kind){case 191:return 2;case 192:return Xv(e);case 203:return e.questionToken?2:e.dotDotDotToken?Xv(e):1;default:return 1}}function Xv(e){return Uk(e.type)?4:8}function eb(e){const t=function(e){return oF(e)&&148===e.operator}(e.parent);if(Uk(e))return t?er:Zn;return Sb(P(e.elements,Gv),t,P(e.elements,tb))}function tb(e){return XD(e)||FD(e)?e:void 0}function nb(e,t){return!!dk(e)||ab(e)&&(189===e.kind?lb(e.elementType):190===e.kind?H(e.elements,lb):t||H(e.typeArguments,lb))}function ab(e){const t=e.parent;switch(t.kind){case 197:case 203:case 184:case 193:case 194:case 200:case 195:case 199:case 189:case 190:return ab(t);case 266:return!0}return!1}function lb(e){switch(e.kind){case 184:return Uy(e)||!!(524288&Dy(e,788968).flags);case 187:return!0;case 199:return 158!==e.operator&&lb(e.type);case 197:case 191:case 203:case 317:case 315:case 316:case 310:return lb(e.type);case 192:return 189!==e.type.kind||lb(e.type.elementType);case 193:case 194:return H(e.types,lb);case 200:return lb(e.objectType)||lb(e.indexType);case 195:return lb(e.checkType)||lb(e.extendsType)||lb(e.trueType)||lb(e.falseType)}return!1}function kb(e,t,n=!1,r=[]){const i=Sb(t||P(e,e=>1),n,r);return i===On?Nn:e.length?Tb(i,e):i}function Sb(e,t,n){if(1===e.length&&4&e[0])return t?er:Zn;const r=P(e,e=>1&e?"#":2&e?"?":4&e?".":"*").join()+(t?"R":"")+(H(n,e=>!!e)?","+P(n,e=>e?_J(e):"_").join(","):"");let i=Qe.get(r);return i||Qe.set(r,i=function(e,t,n){const r=e.length,i=N(e,e=>!!(9&e));let o;const a=[];let s=0;if(r){o=new Array(r);for(let i=0;i!!(8&e.elementFlags[n]&&1179648&t.flags));if(n>=0)return Qb(P(t,(t,n)=>8&e.elementFlags[n]?t:Ot))?zF(t[n],r=>wb(e,Ce(t,n,r))):Et}const s=[],c=[],l=[];let _=-1,u=-1,d=-1;for(let c=0;c=1e4)return Jo(r,Ef(r)?fa.Type_produces_a_tuple_type_that_is_too_large_to_represent:fa.Expression_produces_a_tuple_type_that_is_too_large_to_represent),Et;p(e,(e,t)=>{var n;return m(e,l.target.elementFlags[t],null==(n=l.target.labeledElementDeclarations)?void 0:n[t])})}else m(QC(l)&&dg(l,Wt)||Et,4,null==(o=e.labeledElementDeclarations)?void 0:o[c]);else m(l,_,null==(a=e.labeledElementDeclarations)?void 0:a[c])}for(let e=0;e<_;e++)2&c[e]&&(c[e]=1);u>=0&&u8&c[u+t]?Ux(e,Wt):e)),s.splice(u+1,d-u),c.splice(u+1,d-u),l.splice(u+1,d-u));const f=Sb(c,e.readonly,l);return f===On?Nn:c.length?hy(f,s):f;function m(e,t,n){1&t&&(_=c.length),4&t&&u<0&&(u=c.length),6&t&&(d=c.length),s.push(2&t?Al(e,!0):e),c.push(t),l.push(n)}}function Nb(e,t,n=0){const r=e.target,i=xy(e)-n;return t>r.fixedLength?function(e){const t=hw(e);return t&&Kv(t)}(e)||kb(_):kb(by(e).slice(t,i),r.elementFlags.slice(t,i),!1,r.labeledElementDeclarations&&r.labeledElementDeclarations.slice(t,i))}function Db(e){return zb(ae(Le(e.target.fixedLength,e=>Ek(""+e)),_x(e.target.readonly?er:Zn)))}function Fb(e,t){return e.elementFlags.length-T(e.elementFlags,e=>!(e&t))-1}function Eb(e){return e.fixedLength+Fb(e,3)}function Pb(e){const t=by(e),n=xy(e);return t.length===n?t:t.slice(0,n)}function Ab(e){return e.id}function Ib(e,t){return we(e,t,Ab,xt)>=0}function Ob(e,t){const n=we(e,t,Ab,xt);return n<0&&(e.splice(~n,0,t),!0)}function Lb(e,t,n){const r=n.flags;if(!(131072&r))if(t|=473694207&r,465829888&r&&(t|=33554432),2097152&r&&67108864&xx(n)&&(t|=536870912),n===Dt&&(t|=8388608),il(n)&&(t|=1073741824),!$&&98304&r)65536&xx(n)||(t|=4194304);else{const t=e.length,r=t&&n.id>e[t-1].id?~t:we(e,n,Ab,xt);r<0&&e.splice(~r,0,n)}return t}function jb(e,t,n){let r;for(const i of n)i!==r&&(t=1048576&i.flags?jb(e,t|(Rb(i)?1048576:0),i.types):Lb(e,t,i),r=i);return t}function Mb(e,t){return 134217728&t.flags?DN(e,t):CN(e,t)}function Rb(e){return!!(1048576&e.flags&&(e.aliasSymbol||e.origin))}function Bb(e,t){for(const n of t)if(1048576&n.flags){const t=n.origin;n.aliasSymbol||t&&!(1048576&t.flags)?_e(e,n):t&&1048576&t.flags&&Bb(e,t.types)}}function Jb(e,t){const n=Bs(e);return n.types=t,n}function zb(e,t=1,n,r,i){if(0===e.length)return _n;if(1===e.length)return e[0];if(2===e.length&&!i&&(1048576&e[0].flags||1048576&e[1].flags)){const i=0===t?"N":2===t?"S":"L",o=e[0].id=2&&a[0]===Lt&&a[1]===Rt&&Vt(a,1),(402664352&s||16384&s&&32768&s)&&function(e,t,n){let r=e.length;for(;r>0;){r--;const i=e[r],o=i.flags;(402653312&o&&4&t||256&o&&8&t||2048&o&&64&t||8192&o&&4096&t||n&&32768&o&&16384&t||wk(i)&&Ib(e,i.regularType))&&Vt(e,r)}}(a,s,!!(2&t)),128&s&&402653184&s&&function(e){const t=D(e,Ax);if(t.length){let n=e.length;for(;n>0;){n--;const r=e[n];128&r.flags&&H(t,e=>Mb(r,e))&&Vt(e,n)}}}(a),536870912&s&&function(e){const t=[];for(const n of e)if(2097152&n.flags&&67108864&xx(n)){const e=8650752&n.types[0].flags?0:1;_e(t,n.types[e])}for(const n of t){const t=[];for(const r of e)if(2097152&r.flags&&67108864&xx(r)){const e=8650752&r.types[0].flags?0:1;r.types[e]===n&&Ob(t,r.types[1-e])}if(PF(xf(n),e=>Ib(t,e))){let r=e.length;for(;r>0;){r--;const i=e[r];if(2097152&i.flags&&67108864&xx(i)){const o=8650752&i.types[0].flags?0:1;i.types[o]===n&&Ib(t,i.types[1-o])&&Vt(e,r)}}Ob(e,n)}}}(a),2===t&&(a=function(e,t){var n;if(e.length<2)return e;const i=uy(e),o=pt.get(i);if(o)return o;const a=t&&H(e,e=>!!(524288&e.flags)&&!Bp(e)&&cT(Hp(e))),s=e.length;let c=s,l=0;for(;c>0;){c--;const t=e[c];if(a||469499904&t.flags){if(262144&t.flags&&1048576&kf(t).flags){DT(t,zb(P(e,e=>e===t?_n:e)),xo)&&Vt(e,c);continue}const i=61603840&t.flags?x(lf(t),e=>ow(z_(e))):void 0,o=i&&kk(z_(i));for(const a of e)if(t!==a){if(1e5===l&&l/(s-c)*s>1e6)return null==(n=Gn)||n.instant(Gn.Phase.CheckTypes,"removeSubtypes_DepthLimit",{typeIds:e.map(e=>e.id)}),void Jo(r,fa.Expression_produces_a_union_type_that_is_too_complex_to_represent);if(l++,i&&61603840&a.flags){const e=Zc(a,i.escapedName);if(e&&ow(e)&&kk(e)!==o)continue}if(DT(t,a,xo)&&(!(1&xx($_(t)))||!(1&xx($_(a)))||zS(t,a))){Vt(e,c);break}}}}return pt.set(i,e),e}(a,!!(524288&s)),!a))return Et;if(0===a.length)return 65536&s?4194304&s?zt:qt:32768&s?4194304&s?Lt:jt:_n}if(!o&&1048576&s){const t=[];Bb(t,e);const r=[];for(const e of a)H(t,t=>Ib(t.types,e))||r.push(e);if(!n&&1===t.length&&0===r.length)return t[0];if(De(t,(e,t)=>e+t.types.length,0)+r.length===a.length){for(const e of t)Ob(r,e);o=Jb(1048576,r)}}return Vb(a,(36323331&s?0:32768)|(2097152&s?16777216:0),n,i,o)}function Ub(e,t){return e.kind===t.kind&&e.parameterIndex===t.parameterIndex}function Vb(e,t,n,r,i){if(0===e.length)return _n;if(1===e.length)return e[0];const o=(i?1048576&i.flags?`|${uy(i.types)}`:2097152&i.flags?`&${uy(i.types)}`:`#${i.type.id}|${uy(e)}`:uy(e))+dy(n,r);let a=Ye.get(o);return a||(a=Ms(1048576),a.objectFlags=t|my(e,98304),a.types=e,a.origin=i,a.aliasSymbol=n,a.aliasTypeArguments=r,2===e.length&&512&e[0].flags&&512&e[1].flags&&(a.flags|=16,a.intrinsicName="boolean"),Ye.set(o,a)),a}function Wb(e,t,n){const r=n.flags;return 2097152&r?$b(e,t,n.types):(_T(n)?16777216&t||(t|=16777216,e.set(n.id.toString(),n)):(3&r?(n===Dt&&(t|=8388608),il(n)&&(t|=1073741824)):!$&&98304&r||(n===Rt&&(t|=262144,n=Lt),e.has(n.id.toString())||(109472&n.flags&&109472&t&&(t|=67108864),e.set(n.id.toString(),n))),t|=473694207&r),t)}function $b(e,t,n){for(const r of n)t=Wb(e,t,kk(r));return t}function Hb(e,t){for(const n of e)if(!Ib(n.types,t)){if(t===Rt)return Ib(n.types,Lt);if(t===Lt)return Ib(n.types,Rt);const e=128&t.flags?Ut:288&t.flags?Wt:2048&t.flags?$t:8192&t.flags?sn:void 0;if(!e||!Ib(n.types,e))return!1}return!0}function Kb(e,t){for(let n=0;n!(e.flags&t))}function Gb(e,t=0,n,r){const i=new Map,o=$b(i,0,e),a=je(i.values());let s=0;if(131072&o)return C(a,un)?un:_n;if($&&98304&o&&84410368&o||67108864&o&&402783228&o||402653316&o&&67238776&o||296&o&&469891796&o||2112&o&&469889980&o||12288&o&&469879804&o||49152&o&&469842940&o)return _n;if(402653184&o&&128&o&&function(e){let t=e.length;const n=D(e,e=>!!(128&e.flags));for(;t>0;){t--;const r=e[t];if(402653184&r.flags)for(const i of n){if(RS(i,r)){Vt(e,t);break}if(Ax(r))return!0}}return!1}(a))return _n;if(1&o)return 8388608&o?Dt:1073741824&o?Et:wt;if(!$&&98304&o)return 16777216&o?_n:32768&o?Lt:zt;if((4&o&&402653312&o||8&o&&256&o||64&o&&2048&o||4096&o&&8192&o||16384&o&&32768&o||16777216&o&&470302716&o)&&(1&t||function(e,t){let n=e.length;for(;n>0;){n--;const r=e[n];(4&r.flags&&402653312&t||8&r.flags&&256&t||64&r.flags&&2048&t||4096&r.flags&&8192&t||16384&r.flags&&32768&t||_T(r)&&470302716&t)&&Vt(e,n)}}(a,o)),262144&o&&(a[a.indexOf(Lt)]=Rt),0===a.length)return Ot;if(1===a.length)return a[0];if(2===a.length&&!(2&t)){const e=8650752&a[0].flags?0:1,t=a[e],n=a[1-e];if(8650752&t.flags&&(469893116&n.flags&&!Ix(n)||16777216&o)){const e=xf(t);if(e&&PF(e,e=>!!(469893116&e.flags)||_T(e))){if(BS(e,n))return t;if(!(1048576&e.flags&&DF(e,e=>BS(e,n))||BS(n,e)))return _n;s=67108864}}}const c=uy(a)+(2&t?"*":dy(n,r));let l=nt.get(c);if(!l){if(1048576&o)if(function(e){let t;const n=S(e,e=>!!(32768&xx(e)));if(n<0)return!1;let r=n+1;for(;r!!(1048576&e.flags&&32768&e.types[0].flags))){const e=H(a,Ow)?Rt:Lt;Kb(a,32768),l=zb([Gb(a,t),e],1,n,r)}else if(b(a,e=>!!(1048576&e.flags&&(65536&e.types[0].flags||65536&e.types[1].flags))))Kb(a,65536),l=zb([Gb(a,t),zt],1,n,r);else if(a.length>=3&&e.length>2){const e=Math.floor(a.length/2);l=Gb([Gb(a.slice(0,e),t),Gb(a.slice(e),t)],t,n,r)}else{if(!Qb(a))return Et;const e=function(e,t){const n=Xb(e),r=[];for(let i=0;i=0;t--)if(1048576&e[t].flags){const r=e[t].types,i=r.length;n[t]=r[o%i],o=Math.floor(o/i)}const a=Gb(n,t);131072&a.flags||r.push(a)}return r}(a,t);l=zb(e,1,n,r,H(e,e=>!!(2097152&e.flags))&&Zb(e)>Zb(a)?Jb(2097152,a):void 0)}else l=function(e,t,n,r){const i=Ms(2097152);return i.objectFlags=t|my(e,98304),i.types=e,i.aliasSymbol=n,i.aliasTypeArguments=r,i}(a,s,n,r);nt.set(c,l)}return l}function Xb(e){return De(e,(e,t)=>1048576&t.flags?e*t.types.length:131072&t.flags?0:e,1)}function Qb(e){var t;const n=Xb(e);return!(n>=1e5)||(null==(t=Gn)||t.instant(Gn.Phase.CheckTypes,"checkCrossProductUnion_DepthLimit",{typeIds:e.map(e=>e.id),size:n}),Jo(r,fa.Expression_produces_a_union_type_that_is_too_complex_to_represent),!1)}function Yb(e){return 3145728&e.flags&&!e.aliasSymbol?1048576&e.flags&&e.origin?Yb(e.origin):Zb(e.types):1}function Zb(e){return De(e,(e,t)=>e+Yb(t),0)}function ex(e,t){const n=Ms(4194304);return n.type=e,n.indexFlags=t,n}function tx(e,t){return 1&t?e.resolvedStringIndexType||(e.resolvedStringIndexType=ex(e,1)):e.resolvedIndexType||(e.resolvedIndexType=ex(e,0))}function nx(e,t){const n=vp(e),r=kp(e),i=Sp(e.target||e);if(!(i||2&t))return r;const o=[];if(jx(r)){if(wp(e))return tx(e,t);wF(r,s)}else if(wp(e)){lp(qf(Np(e)),8576,!!(1&t),s)}else wF(sp(r),s);const a=2&t?OF(zb(o),e=>!(5&e.flags)):zb(o);return 1048576&a.flags&&1048576&r.flags&&uy(a.types)===uy(r.types)?r:a;function s(t){const r=i?CS(i,pS(e.mapper,n,t)):t;o.push(r===Ut?gn:r)}}function rx(e){if(dD(e))return _n;if($N(e))return kk(WM(e));if(ND(e))return kk(uI(e));const t=Vh(e);return void 0!==t?Ek(vc(t)):K_(e)?kk(WM(e)):_n}function ix(e,t,n){if(n||!(6&lx(e))){let n=_a(Ed(e)).nameType;if(!n){const t=Fc(e.valueDeclaration);n="default"===e.escapedName?Ek("default"):t&&rx(t)||(Gh(e)?void 0:Ek(kc(e)))}if(n&&n.flags&t)return n}return _n}function ox(e,t){return!!(e.flags&t||2097152&e.flags&&H(e.types,e=>ox(e,t)))}function ax(e,t,n){const r=n&&(7&xx(e)||e.aliasSymbol)?function(e){const t=Bs(4194304);return t.type=e,t}(e):void 0;return zb(G(P(lf(e),e=>ix(e,t)),P(cg(e),e=>e!==ui&&ox(e.keyType,t)?e.keyType===Ut&&8&t?gn:e.keyType:_n)),1,void 0,void 0,r)}function sx(e,t=0){return!!(58982400&e.flags||mw(e)||Bp(e)&&(!function(e){const t=vp(e);return function e(n){return!!(470810623&n.flags)||(16777216&n.flags?n.root.isDistributive&&n.checkType===t:137363456&n.flags?b(n.types,e):8388608&n.flags?e(n.objectType)&&e(n.indexType):33554432&n.flags?e(n.baseType)&&e(n.constraint):!!(268435456&n.flags)&&e(n.type))}(Sp(e)||t)}(e)||2===Vp(e))||1048576&e.flags&&!(4&t)&&vm(e)||2097152&e.flags&&oM(e,465829888)&&H(e.types,_T))}function _x(e,t=0){return Ay(e=Qf(e))?Ey(_x(e.baseType,t)):sx(e,t)?tx(e,t):1048576&e.flags?Gb(P(e.types,e=>_x(e,t))):2097152&e.flags?zb(P(e.types,e=>_x(e,t))):32&xx(e)?nx(e,t):e===Dt?Dt:2&e.flags?_n:131073&e.flags?hn:ax(e,(2&t?128:402653316)|(1&t?0:12584),0===t)}function fx(e){const t=(zr||(zr=Yy("Extract",2,!0)||bt),zr===bt?void 0:zr);return t?Sy(t,[e,Ut]):Ut}function mx(e,t){const n=S(t,e=>!!(1179648&e.flags));if(n>=0)return Qb(t)?zF(t[n],r=>mx(e,Ce(t,n,r))):Et;if(C(t,Dt))return Dt;const r=[],i=[];let o=e[0];if(!function e(t,n){for(let a=0;a""===e)){if(b(r,e=>!!(4&e.flags)))return Ut;if(1===r.length&&Ax(r[0]))return r[0]}const a=`${uy(r)}|${P(i,e=>e.length).join(",")}|${i.join("")}`;let s=_t.get(a);return s||_t.set(a,s=function(e,t){const n=Ms(134217728);return n.texts=e,n.types=t,n}(i,r)),s}function gx(e){return 128&e.flags?e.value:256&e.flags?""+e.value:2048&e.flags?xT(e.value):98816&e.flags?e.intrinsicName:void 0}function hx(e,t){return 1179648&t.flags?zF(t,t=>hx(e,t)):128&t.flags?Ek(yx(e,t.value)):134217728&t.flags?mx(...function(e,t,n){switch(sJ.get(e.escapedName)){case 0:return[t.map(e=>e.toUpperCase()),n.map(t=>hx(e,t))];case 1:return[t.map(e=>e.toLowerCase()),n.map(t=>hx(e,t))];case 2:return[""===t[0]?t:[t[0].charAt(0).toUpperCase()+t[0].slice(1),...t.slice(1)],""===t[0]?[hx(e,n[0]),...n.slice(1)]:n];case 3:return[""===t[0]?t:[t[0].charAt(0).toLowerCase()+t[0].slice(1),...t.slice(1)],""===t[0]?[hx(e,n[0]),...n.slice(1)]:n]}return[t,n]}(e,t.texts,t.types)):268435456&t.flags&&e===t.symbol?t:268435461&t.flags||jx(t)?vx(e,t):Ex(t)?vx(e,mx(["",""],[t])):t}function yx(e,t){switch(sJ.get(e.escapedName)){case 0:return t.toUpperCase();case 1:return t.toLowerCase();case 2:return t.charAt(0).toUpperCase()+t.slice(1);case 3:return t.charAt(0).toLowerCase()+t.slice(1)}return t}function vx(e,t){const n=`${uJ(e)},${Ab(t)}`;let r=ut.get(n);return r||ut.set(n,r=function(e,t){const n=Rs(268435456,e);return n.type=t,n}(e,t)),r}function Sx(e){if(te)return!1;if(4096&xx(e))return!0;if(1048576&e.flags)return b(e.types,Sx);if(2097152&e.flags)return H(e.types,Sx);if(465829888&e.flags){const t=Tf(e);return t!==e&&Sx(t)}return!1}function Tx(e,t){return dC(e)?pC(e):t&&o_(t)?Vh(t):void 0}function Cx(e,t){if(8208&t.flags){const n=mc(e.parent,e=>!Dx(e))||e.parent;return B_(n)?J_(n)&&uD(e)&&iD(n,e):b(t.declarations,e=>!s_(e)||Ko(e))}return!0}function wx(e,t,n,r,i,o){const a=i&&213===i.kind?i:void 0,s=i&&dD(i)?void 0:Tx(n,i);if(void 0!==s){if(256&o)return wA(t,s)||wt;const e=Am(t,s);if(e){if(64&o&&i&&e.declarations&&Ho(e)&&Cx(i,e)){Go((null==a?void 0:a.argumentExpression)??(aF(i)?i.indexType:i),e.declarations,s)}if(a){if(LO(e,a,jO(a.expression,t.symbol)),Zj(a,e,eh(a)))return void Jo(a.argumentExpression,fa.Cannot_assign_to_0_because_it_is_a_read_only_property,pc(e));if(8&o&&(ua(i).resolvedSymbol=e),yO(a,e))return Nt}const n=4&o?L_(e):z_(e);return a&&1!==eh(a)?IE(a,n):i&&aF(i)&&Ow(n)?zb([n,Lt]):n}if(PF(t,fw)&&WT(s)){const e=+s;if(i&&PF(t,e=>!(12&e.target.combinedFlags))&&!(16&o)){const n=Fx(i);if(fw(t)){if(e<0)return Jo(n,fa.A_tuple_type_cannot_be_indexed_with_a_negative_value),Lt;Jo(n,fa.Tuple_type_0_of_length_1_has_no_element_at_index_2,Sc(t),xy(t),vc(s))}else Jo(n,fa.Property_0_does_not_exist_on_type_1,vc(s),Sc(t))}if(e>=0)return c(lg(t,Wt)),yw(t,e,1&o?Rt:void 0)}}if(!(98304&n.flags)&&aM(n,402665900)){if(131073&t.flags)return t;const l=yg(t,n)||lg(t,Ut);if(l){if(2&o&&l.keyType!==Wt)return void(a&&(4&o?Jo(a,fa.Type_0_is_generic_and_can_only_be_indexed_for_reading,Sc(e)):Jo(a,fa.Type_0_cannot_be_used_to_index_type_1,Sc(n),Sc(e))));if(i&&l.keyType===Ut&&!aM(n,12)){return Jo(Fx(i),fa.Type_0_cannot_be_used_as_an_index_type,Sc(n)),1&o?zb([l.type,Rt]):l.type}return c(l),1&o&&!(t.symbol&&384&t.symbol.flags&&n.symbol&&1024&n.flags&&Cs(n.symbol)===t.symbol)?zb([l.type,Rt]):l.type}if(131072&n.flags)return _n;if(Sx(t))return wt;if(a&&!cM(t)){if(IN(t)){if(te&&384&n.flags)return ho.add(qp(a,fa.Property_0_does_not_exist_on_type_1,n.value,Sc(t))),Lt;if(12&n.flags){return zb(ae(P(t.properties,e=>z_(e)),Lt))}}if(t.symbol===Fe&&void 0!==s&&Fe.exports.has(s)&&418&Fe.exports.get(s).flags)Jo(a,fa.Property_0_does_not_exist_on_type_1,vc(s),Sc(t));else if(te&&!(128&o))if(void 0!==s&&NO(s,t)){const e=Sc(t);Jo(a,fa.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,s,e,e+"["+ep(a.argumentExpression)+"]")}else if(dg(t,Wt))Jo(a.argumentExpression,fa.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);else{let e;if(void 0!==s&&(e=PO(s,t)))void 0!==e&&Jo(a.argumentExpression,fa.Property_0_does_not_exist_on_type_1_Did_you_mean_2,s,Sc(t),e);else{const e=function(e,t,n){function r(t){const r=Qp(e,t);if(r){const e=eL(z_(r));return!!e&&hj(e)>=1&&JS(n,dj(e,0))}return!1}const i=th(t)?"set":"get";if(!r(i))return;let o=mb(t.expression);void 0===o?o=i:o+="."+i;return o}(t,a,n);if(void 0!==e)Jo(a,fa.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,Sc(t),e);else{let e;if(1024&n.flags)e=ik(void 0,fa.Property_0_does_not_exist_on_type_1,"["+Sc(n)+"]",Sc(t));else if(8192&n.flags){const r=es(n.symbol,a);e=ik(void 0,fa.Property_0_does_not_exist_on_type_1,"["+r+"]",Sc(t))}else 128&n.flags||256&n.flags?e=ik(void 0,fa.Property_0_does_not_exist_on_type_1,n.value,Sc(t)):12&n.flags&&(e=ik(void 0,fa.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,Sc(n),Sc(t)));e=ik(e,fa.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,Sc(r),Sc(t)),ho.add(Wp(Sd(a),a,e))}}}return}}if(16&o&&IN(t))return Lt;if(Sx(t))return wt;if(i){const e=Fx(i);if(10!==e.kind&&384&n.flags)Jo(e,fa.Property_0_does_not_exist_on_type_1,""+n.value,Sc(t));else if(12&n.flags)Jo(e,fa.Type_0_has_no_matching_index_signature_for_type_1,Sc(t),Sc(n));else{const t=10===e.kind?"bigint":Sc(n);Jo(e,fa.Type_0_cannot_be_used_as_an_index_type,t)}}return rl(n)?n:void 0;function c(e){e&&e.isReadonly&&a&&(th(a)||uh(a))&&Jo(a,fa.Index_signature_in_type_0_only_permits_reading,Sc(t))}}function Fx(e){return 213===e.kind?e.argumentExpression:200===e.kind?e.indexType:168===e.kind?e.expression:e}function Ex(e){if(2097152&e.flags){let t=!1;for(const n of e.types)if(101248&n.flags||Ex(n))t=!0;else if(!(524288&n.flags))return!1;return t}return!!(77&e.flags)||Ax(e)}function Ax(e){return!!(134217728&e.flags)&&b(e.types,Ex)||!!(268435456&e.flags)&&Ex(e.type)}function Ix(e){return!!(402653184&e.flags)&&!Ax(e)}function Ox(e){return!!Mx(e)}function Lx(e){return!!(4194304&Mx(e))}function jx(e){return!!(8388608&Mx(e))}function Mx(e){return 3145728&e.flags?(2097152&e.objectFlags||(e.objectFlags|=2097152|De(e.types,(e,t)=>e|Mx(t),0)),12582912&e.objectFlags):33554432&e.flags?(2097152&e.objectFlags||(e.objectFlags|=2097152|Mx(e.baseType)|Mx(e.constraint)),12582912&e.objectFlags):(58982400&e.flags||Bp(e)||mw(e)?4194304:0)|(63176704&e.flags||Ix(e)?8388608:0)}function Rx(e,t){return 8388608&e.flags?function(e,t){const n=t?"simplifiedForWriting":"simplifiedForReading";if(e[n])return e[n]===Mn?e:e[n];e[n]=Mn;const r=Rx(e.objectType,t),i=Rx(e.indexType,t),o=function(e,t,n){if(1048576&t.flags){const r=P(t.types,t=>Rx(Ux(e,t),n));return n?Gb(r):zb(r)}}(r,i,t);if(o)return e[n]=o;if(!(465829888&i.flags)){const o=Bx(r,i,t);if(o)return e[n]=o}if(mw(r)&&296&i.flags){const o=vw(r,8&i.flags?0:r.target.fixedLength,0,t);if(o)return e[n]=o}if(Bp(r)&&2!==Vp(r))return e[n]=zF(zx(r,e.indexType),e=>Rx(e,t));return e[n]=e}(e,t):16777216&e.flags?function(e,t){const n=e.checkType,r=e.extendsType,i=Zx(e),o=rk(e);if(131072&o.flags&&Kx(i)===Kx(n)){if(1&n.flags||JS(DS(n),DS(r)))return Rx(i,t);if(Jx(n,r))return _n}else if(131072&i.flags&&Kx(o)===Kx(n)){if(!(1&n.flags)&&JS(DS(n),DS(r)))return _n;if(1&n.flags||Jx(n,r))return Rx(o,t)}return e}(e,t):e}function Bx(e,t,n){if(1048576&e.flags||2097152&e.flags&&!sx(e)){const r=P(e.types,e=>Rx(Ux(e,t),n));return 2097152&e.flags||n?Gb(r):zb(r)}}function Jx(e,t){return!!(131072&zb([$d(e,t),_n]).flags)}function zx(e,t){const n=nS([vp(e)],[t]),r=_S(e.mapper,n),i=CS(Tp(e.target||e),r),o=Fp(e)>0||(Ox(e)?Ap(Np(e))>0:function(e,t){const n=xf(t);return!!n&&H(lf(e),e=>!!(16777216&e.flags)&&JS(ix(e,8576),n))}(e,t));return Al(i,!0,o)}function Ux(e,t,n=0,r,i,o){return Wx(e,t,n,r,i,o)||(r?Et:Ot)}function Vx(e,t){return PF(e,e=>{if(384&e.flags){const n=pC(e);if(WT(n)){const e=+n;return e>=0&&e0&&!H(e.elements,e=>QD(e)||YD(e)||XD(e)&&!(!e.questionToken&&!e.dotDotDotToken))}function Qx(e,t){return Ox(e)||t&&fw(e)&&H(Pb(e),Ox)}function Yx(e,t,n,i,o){let a,s,c=0;for(;;){if(1e3===c)return Jo(r,fa.Type_instantiation_is_excessively_deep_and_possibly_infinite),Et;const _=CS(Kx(e.checkType),t),u=CS(e.extendsType,t);if(_===Et||u===Et)return Et;if(_===Dt||u===Dt)return Dt;const p=lh(e.node.checkType),f=lh(e.node.extendsType),m=Gx(p)&&Gx(f)&&d(p.elements)===d(f.elements),g=Qx(_,m);let h;if(e.inferTypeParameters){const n=tN(e.inferTypeParameters,void 0,0);t&&(n.nonFixingMapper=_S(n.nonFixingMapper,t)),g||EN(n.inferences,_,u,1536),h=t?_S(n.mapper,t):n.mapper}const y=h?CS(e.extendsType,h):u;if(!g&&!Qx(y,m)){if(!(3&y.flags)&&(1&_.flags||!JS(NS(_),NS(y)))){(1&_.flags||n&&!(131072&y.flags)&&DF(NS(y),e=>JS(e,NS(_))))&&(s||(s=[])).push(CS($k(e.node.trueType),h||t));const r=$k(e.node.falseType);if(16777216&r.flags){const n=r.root;if(n.node.parent===e.node&&(!n.isDistributive||n.checkType===e.checkType)){e=n;continue}if(l(r,t))continue}a=CS(r,t);break}if(3&y.flags||JS(DS(_),DS(y))){const n=$k(e.node.trueType),r=h||t;if(l(n,r))continue;a=CS(n,r);break}}a=Ms(16777216),a.root=e,a.checkType=CS(e.checkType,t),a.extendsType=CS(e.extendsType,t),a.mapper=t,a.combinedMapper=h,a.aliasSymbol=i||e.aliasSymbol,a.aliasTypeArguments=i?o:Xk(e.aliasTypeArguments,t);break}return s?zb(ae(s,a)):a;function l(n,r){if(16777216&n.flags&&r){const a=n.root;if(a.outerTypeParameters){const s=_S(n.mapper,r),l=P(a.outerTypeParameters,e=>rS(e,s)),_=nS(a.outerTypeParameters,l),u=a.isDistributive?rS(a.checkType,_):void 0;if(!(u&&u!==a.checkType&&1179648&u.flags))return e=a,t=_,i=void 0,o=void 0,a.aliasSymbol&&c++,!0}}return!1}}function Zx(e){return e.resolvedTrueType||(e.resolvedTrueType=CS($k(e.root.node.trueType),e.mapper))}function rk(e){return e.resolvedFalseType||(e.resolvedFalseType=CS($k(e.root.node.falseType),e.mapper))}function ak(e){let t;return e.locals&&e.locals.forEach(e=>{262144&e.flags&&(t=ae(t,Ru(e)))}),t}function ck(e){return uD(e)?[e]:ae(ck(e.left),e.right)}function lk(e){var t;const n=ua(e);if(!n.resolvedType){if(!gf(e))return Jo(e.argument,fa.String_literal_expected),n.resolvedSymbol=bt,n.resolvedType=Et;const r=e.isTypeOf?111551:16777216&e.flags?900095:788968,i=is(e,e.argument.literal);if(!i)return n.resolvedSymbol=bt,n.resolvedType=Et;const o=!!(null==(t=i.exports)?void 0:t.get("export=")),a=cs(i,!1);if(Pd(e.qualifier))if(a.flags&r)n.resolvedType=_k(e,n,a,r);else{Jo(e,111551===r?fa.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:fa.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0,e.argument.literal.text),n.resolvedSymbol=bt,n.resolvedType=Et}else{const t=ck(e.qualifier);let i,s=a;for(;i=t.shift();){const a=t.length?1920:r,c=ks($a(s)),l=e.isTypeOf||Om(e)&&o?Am(z_(c),i.escapedText,!1,!0):void 0,_=(e.isTypeOf?void 0:da(gs(c),i.escapedText,a))??l;if(!_)return Jo(i,fa.Namespace_0_has_no_exported_member_1,es(s),jp(i)),n.resolvedType=Et;ua(i).resolvedSymbol=_,ua(i.parent).resolvedSymbol=_,s=_}n.resolvedType=_k(e,n,s,r)}}return n.resolvedType}function _k(e,t,n,r){const i=$a(n);return t.resolvedSymbol=i,111551===r?ej(z_(n),e):Fy(e,i)}function uk(e){const t=ua(e);if(!t.resolvedType){const n=dk(e);if(!e.symbol||0===Fd(e.symbol).size&&!n)t.resolvedType=Pn;else{let r=zs(16,e.symbol);r.aliasSymbol=n,r.aliasTypeArguments=pk(n),FP(e)&&e.isArrayType&&(r=Kv(r)),t.resolvedType=r}}return t.resolvedType}function dk(e){let t=e.parent;for(;rF(t)||fP(t)||oF(t)&&148===t.operator;)t=t.parent;return Ig(t)?Ss(t):void 0}function pk(e){return e?iu(e):void 0}function fk(e){return!!(524288&e.flags)&&!Bp(e)}function mk(e){return lT(e)||!!(474058748&e.flags)}function gk(e,t){if(!(1048576&e.flags))return e;if(b(e.types,mk))return x(e.types,lT)||Nn;const n=x(e.types,e=>!mk(e));if(!n)return e;return x(e.types,e=>e!==n&&!mk(e))?e:function(e){const n=Zu();for(const r of lf(e))if(6&lx(r));else if(yk(r)){const e=65536&r.flags&&!(32768&r.flags),i=Xo(16777220,r.escapedName,cp(r)|(t?8:0));i.links.type=e?Lt:Al(z_(r),!0),i.declarations=r.declarations,i.links.nameType=_a(r).nameType,i.links.syntheticOrigin=r,n.set(r.escapedName,i)}const r=Hs(e.symbol,n,_,_,cg(e));return r.objectFlags|=131200,r}(n)}function hk(e,t,n,r,i){if(1&e.flags||1&t.flags)return wt;if(2&e.flags||2&t.flags)return Ot;if(131072&e.flags)return t;if(131072&t.flags)return e;if(1048576&(e=gk(e,i)).flags)return Qb([e,t])?zF(e,e=>hk(e,t,n,r,i)):Et;if(1048576&(t=gk(t,i)).flags)return Qb([e,t])?zF(t,t=>hk(e,t,n,r,i)):Et;if(473960444&t.flags)return e;if(Lx(e)||Lx(t)){if(lT(e))return t;if(2097152&e.flags){const o=e.types,a=o[o.length-1];if(fk(a)&&fk(t))return Gb(G(o.slice(0,o.length-1),[hk(a,t,n,r,i)]))}return Gb([e,t])}const o=Zu(),a=new Set,s=e===Nn?cg(t):Wd([e,t]);for(const e of lf(t))6&lx(e)?a.add(e.escapedName):yk(e)&&o.set(e.escapedName,vk(e,i));for(const t of lf(e))if(!a.has(t.escapedName)&&yk(t))if(o.has(t.escapedName)){const e=o.get(t.escapedName),n=z_(e);if(16777216&e.flags){const r=G(t.declarations,e.declarations),i=Xo(4|16777216&t.flags,t.escapedName),a=z_(t),s=Lw(a),c=Lw(n);i.links.type=s===c?a:zb([a,c],2),i.links.leftSpread=t,i.links.rightSpread=e,i.declarations=r,i.links.nameType=_a(t).nameType,o.set(t.escapedName,i)}}else o.set(t.escapedName,vk(t,i));const c=Hs(n,o,_,_,I(s,e=>function(e,t){return e.isReadonly!==t?Qh(e.keyType,e.type,t,e.declaration,e.components):e}(e,i)));return c.objectFlags|=2228352|r,c}function yk(e){var t;return!(H(e.declarations,Yl)||106496&e.flags&&(null==(t=e.declarations)?void 0:t.some(e=>m_(e.parent))))}function vk(e,t){const n=65536&e.flags&&!(32768&e.flags);if(!n&&t===Yj(e))return e;const r=Xo(4|16777216&e.flags,e.escapedName,cp(e)|(t?8:0));return r.links.type=n?Lt:z_(e),r.declarations=e.declarations,r.links.nameType=_a(e).nameType,r.links.syntheticOrigin=e,r}function bk(e,t,n,r){const i=Rs(e,n);return i.value=t,i.regularType=r||i,i}function xk(e){if(2976&e.flags){if(!e.freshType){const t=bk(e.flags,e.value,e.symbol,e);t.freshType=t,e.freshType=t}return e.freshType}return e}function kk(e){return 2976&e.flags?e.regularType:1048576&e.flags?e.regularType||(e.regularType=zF(e,kk)):e}function wk(e){return!!(2976&e.flags)&&e.freshType===e}function Ek(e){let t;return ot.get(e)||(ot.set(e,t=bk(128,e)),t)}function Pk(e){let t;return at.get(e)||(at.set(e,t=bk(256,e)),t)}function Lk(e){let t;const n=xT(e);return st.get(n)||(st.set(n,t=bk(2048,e)),t)}function jk(e,t,n){let r;const i=`${t}${"string"==typeof e?"@":"#"}${e}`,o=1024|("string"==typeof e?128:256);return ct.get(i)||(ct.set(i,r=bk(o,e,n)),r)}function Mk(e){if(Om(e)&&fP(e)){const t=Kg(e);t&&(e=jg(t)||t)}if(Jf(e)){const t=Bf(e)?Ts(e.left):Ts(e);if(t){const e=_a(t);return e.uniqueESSymbolType||(e.uniqueESSymbolType=function(e){const t=Rs(8192,e);return t.escapedName=`__@${t.symbol.escapedName}@${uJ(t.symbol)}`,t}(t))}}return sn}function zk(e){const t=ua(e);return t.resolvedType||(t.resolvedType=function(e){const t=im(e,!1,!1),n=t&&t.parent;if(n&&(m_(n)||265===n.kind)&&!Iv(t)&&(!jD(t)||dh(e,t.body)))return bu(Ss(n)).thisType;if(n&&gF(n)&&AF(n.parent)&&6===og(n.parent))return bu(Ts(n.parent.left).parent).thisType;const r=16777216&e.flags?$g(e):void 0;return r&&TF(r)&&AF(r.parent)&&3===og(r.parent)?bu(Ts(r.parent.left).parent).thisType:ML(t)&&dh(e,t.body)?bu(Ss(t)).thisType:(Jo(e,fa.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface),Et)}(e)),t.resolvedType}function qk(e){return $k(Uk(e.type)||e.type)}function Uk(e){switch(e.kind){case 197:return Uk(e.type);case 190:if(1===e.elements.length&&(192===(e=e.elements[0]).kind||203===e.kind&&e.dotDotDotToken))return Uk(e.type);break;case 189:return e.elementType}}function $k(e){return function(e,t){let n,r=!0;for(;t&&!hu(t)&&321!==t.kind;){const i=t.parent;if(170===i.kind&&(r=!r),(r||8650752&e.flags)&&195===i.kind&&t===i.trueType){const t=qy(e,i.checkType,i.extendsType);t&&(n=ae(n,t))}else if(262144&e.flags&&201===i.kind&&!i.nameType&&t===i.type){const t=$k(i);if(vp(t)===Kx(e)){const e=bS(t);if(e){const t=uf(e);t&&PF(t,KC)&&(n=ae(n,zb([Wt,bn])))}}}t=i}return n?Ly(e,Gb(n)):e}(Kk(e),e)}function Kk(e){switch(e.kind){case 133:case 313:case 314:return wt;case 159:return Ot;case 154:return Ut;case 150:return Wt;case 163:return $t;case 136:return on;case 155:return sn;case 116:return ln;case 157:return Lt;case 106:return zt;case 146:return _n;case 151:return 524288&e.flags&&!te?wt:mn;case 141:return It;case 198:case 110:return zk(e);case 202:return function(e){if(106===e.literal.kind)return zt;const t=ua(e);return t.resolvedType||(t.resolvedType=kk(WM(e.literal))),t.resolvedType}(e);case 184:case 234:return $y(e);case 183:return e.assertsModifier?ln:on;case 187:return Ky(e);case 189:case 190:return function(e){const t=ua(e);if(!t.resolvedType){const n=eb(e);if(n===On)t.resolvedType=Nn;else if(190===e.kind&&H(e.elements,e=>!!(8&Gv(e)))||!nb(e)){const r=189===e.kind?[$k(e.elementType)]:P(e.elements,$k);t.resolvedType=Tb(n,r)}else t.resolvedType=190===e.kind&&0===e.elements.length?n:vy(n,e,void 0)}return t.resolvedType}(e);case 191:return function(e){return Al($k(e.type),!0)}(e);case 193:return function(e){const t=ua(e);if(!t.resolvedType){const n=dk(e);t.resolvedType=zb(P(e.types,$k),1,n,pk(n))}return t.resolvedType}(e);case 194:return function(e){const t=ua(e);if(!t.resolvedType){const n=dk(e),r=P(e.types,$k),i=2===r.length?r.indexOf(Pn):-1,o=i>=0?r[1-i]:Ot,a=!!(76&o.flags||134217728&o.flags&&Ax(o));t.resolvedType=Gb(r,a?1:0,n,pk(n))}return t.resolvedType}(e);case 315:return function(e){const t=$k(e.type);return $?Cw(t,65536):t}(e);case 317:return Al($k(e.type));case 203:return function(e){const t=ua(e);return t.resolvedType||(t.resolvedType=e.dotDotDotToken?qk(e):Al($k(e.type),!0,!!e.questionToken))}(e);case 197:case 316:case 310:return $k(e.type);case 192:return qk(e);case 319:return function(e){const t=$k(e.type),{parent:n}=e,r=e.parent.parent;if(fP(e.parent)&&VP(r)){const e=$g(r),n=OP(r.parent.parent);if(e||n){const i=be(n?r.parent.parent.typeExpression.parameters:e.parameters),o=Ug(r);if(!i||o&&i.symbol===o&&Uu(i))return Kv(t)}}if(FD(n)&&CP(n.parent))return Kv(t);return Al(t)}(e);case 185:case 186:case 188:case 323:case 318:case 324:return uk(e);case 199:return function(e){const t=ua(e);if(!t.resolvedType)switch(e.operator){case 143:t.resolvedType=_x($k(e.type));break;case 158:t.resolvedType=155===e.type.kind?Mk(ah(e.parent)):Et;break;case 148:t.resolvedType=$k(e.type);break;default:pn.assertNever(e.operator)}return t.resolvedType}(e);case 200:return $x(e);case 201:return Hx(e);case 195:return function(e){const t=ua(e);if(!t.resolvedType){const n=$k(e.checkType),r=dk(e),i=pk(r),o=nu(e,!0),a=i?o:D(o,t=>vS(t,e)),s={node:e,checkType:n,extendsType:$k(e.extendsType),isDistributive:!!(262144&n.flags),inferTypeParameters:ak(e),outerTypeParameters:a,instantiations:void 0,aliasSymbol:r,aliasTypeArguments:i};t.resolvedType=Yx(s,void 0,!1),a&&(s.instantiations=new Map,s.instantiations.set(uy(a),t.resolvedType))}return t.resolvedType}(e);case 196:return function(e){const t=ua(e);return t.resolvedType||(t.resolvedType=ju(Ss(e.typeParameter))),t.resolvedType}(e);case 204:return function(e){const t=ua(e);return t.resolvedType||(t.resolvedType=mx([e.head.text,...P(e.templateSpans,e=>e.literal.text)],P(e.templateSpans,e=>$k(e.type)))),t.resolvedType}(e);case 206:return lk(e);case 80:case 167:case 212:const t=Nz(e);return t?Ru(t):Et;default:return Et}}function Gk(e,t,n){if(e&&e.length)for(let r=0;rH(n,t=>vS(e,t))):s,o.outerTypeParameters=s}if(s.length){const i=_S(e.mapper,t),o=P(s,e=>rS(e,i)),c=n||e.aliasSymbol,l=n?r:Xk(e.aliasTypeArguments,t),_=uy(o)+dy(c,l);a.instantiations||(a.instantiations=new Map,a.instantiations.set(uy(s)+dy(a.aliasSymbol,a.aliasTypeArguments),a));let u=a.instantiations.get(_);if(!u){let n=nS(s,o);134217728&a.objectFlags&&t&&(n=_S(n,t)),u=4&a.objectFlags?vy(e.target,e.node,n,c,l):32&a.objectFlags?function(e,t,n,r){const i=bS(e);if(i){const e=CS(i,t);if(i!==e)return VF(Qf(e),o,n,r)}return CS(kp(e),t)===Dt?Dt:SS(e,t,n,r);function o(n){if(61603843&n.flags&&n!==Dt&&!il(n)){if(!e.declaration.nameType){let r;if($C(n)||1&n.flags&&Kc(i,4)<0&&(r=uf(i))&&PF(r,KC))return function(e,t,n){const r=kS(t,Wt,!0,n);return il(r)?Et:Kv(r,xS(HC(e),Dp(t)))}(n,e,dS(i,n,t));if(fw(n))return function(e,t,n,r){const i=e.target.elementFlags,o=e.target.fixedLength,a=o?dS(n,e,r):r,s=P(Pb(e),(e,s)=>{const c=i[s];return s1&e?2:e):8&c?P(i,e=>2&e?1:e):i,_=xS(e.target.readonly,Dp(t));return C(s,Et)?Et:kb(s,l,_,e.target.labeledElementDeclarations)}(n,e,i,t);if(Ff(n))return Gb(P(n.types,o))}return SS(e,dS(i,n,t))}return n}}(a,n,c,l):SS(a,n,c,l),a.instantiations.set(_,u);const r=xx(u);if(3899393&u.flags&&!(524288&r)){const e=H(o,dN);524288&xx(u)||(u.objectFlags|=52&r?524288|(e?1048576:0):e?0:524288)}}return u}return e}function vS(e,t){if(e.symbol&&e.symbol.declarations&&1===e.symbol.declarations.length){const r=e.symbol.declarations[0].parent;for(let e=t;e!==r;e=e.parent)if(!e||242===e.kind||195===e.kind&&iO(e.extendsType,n))return!0;return n(t)}return!0;function n(t){switch(t.kind){case 198:return!!e.isThisType;case 80:return!e.isThisType&&Ef(t)&&function(e){return!(184===e.parent.kind&&e.parent.typeArguments&&e===e.parent.typeName||206===e.parent.kind&&e.parent.typeArguments&&e===e.parent.qualifier)}(t)&&Kk(t)===e;case 187:const r=db(t.exprName);if(!pv(r)){const i=zN(r),o=e.symbol.declarations[0],a=169===o.kind?o.parent:e.isThisType?o:void 0;if(i.declarations&&a)return H(i.declarations,e=>dh(e,a))||H(t.typeArguments,n)}return!0;case 175:case 174:return!t.type&&!!t.body||H(t.typeParameters,n)||H(t.parameters,n)||!!t.type&&n(t.type)}return!!iO(t,n)}}function bS(e){const t=kp(e);if(4194304&t.flags){const e=Kx(t.type);if(262144&e.flags)return e}}function xS(e,t){return!!(1&t)||!(2&t)&&e}function kS(e,t,n,r){const i=pS(r,vp(e),t),o=CS(Tp(e.target||e),i),a=Dp(e);return $&&4&a&&!oM(o,49152)?Nw(o,!0):$&&8&a&&n?pD(o,524288):o}function SS(e,t,n,r){pn.assert(e.symbol,"anonymous type must have symbol to be instantiated");const i=zs(-1572865&e.objectFlags|64,e.symbol);if(32&e.objectFlags){i.declaration=e.declaration;const n=vp(e),r=fS(n);i.typeParameter=r,t=_S(iS(n,r),t),r.mapper=t}return 8388608&e.objectFlags&&(i.node=e.node),i.target=e,i.mapper=t,i.aliasSymbol=n||e.aliasSymbol,i.aliasTypeArguments=n?r:Xk(e.aliasTypeArguments,t),i.objectFlags|=i.aliasTypeArguments?my(i.aliasTypeArguments):0,i}function TS(e,t,n,r,i){const o=e.root;if(o.outerTypeParameters){const e=P(o.outerTypeParameters,e=>rS(e,t)),a=(n?"C":"")+uy(e)+dy(r,i);let s=o.instantiations.get(a);if(!s){const t=nS(o.outerTypeParameters,e),c=o.checkType,l=o.isDistributive?Qf(rS(c,t)):void 0;s=l&&c!==l&&1179648&l.flags?VF(l,e=>Yx(o,dS(c,e,t),n),r,i):Yx(o,t,n,r,i),o.instantiations.set(a,s)}return s}return e}function CS(e,t){return e&&t?wS(e,t,void 0,void 0):e}function wS(e,t,n,i){var o;if(!dN(e))return e;if(100===y||h>=5e6)return null==(o=Gn)||o.instant(Gn.Phase.CheckTypes,"instantiateType_DepthLimit",{typeId:e.id,instantiationDepth:y,instantiationCount:h}),Jo(r,fa.Type_instantiation_is_excessively_deep_and_possibly_infinite),Et;const a=function(e){for(let t=Bi-1;t>=0;t--)if(e===Mi[t])return t;return-1}(t);-1===a&&function(e){Mi[Bi]=e,Ri[Bi]??(Ri[Bi]=new Map),Bi++}(t);const s=e.id+dy(n,i),c=Ri[-1!==a?a:Bi-1],l=c.get(s);if(l)return l;g++,h++,y++;const _=function(e,t,n,r){const i=e.flags;if(262144&i)return rS(e,t);if(524288&i){const i=e.objectFlags;if(52&i){if(4&i&&!e.node){const n=e.resolvedTypeArguments,r=Xk(n,t);return r!==n?Tb(e.target,r):e}return 1024&i?function(e,t){const n=CS(e.mappedType,t);if(!(32&xx(n)))return e;const r=CS(e.constraintType,t);if(!(4194304&r.flags))return e;const i=mN(CS(e.source,t),n,r);if(i)return i;return e}(e,t):yS(e,t,n,r)}return e}if(3145728&i){const o=1048576&e.flags?e.origin:void 0,a=o&&3145728&o.flags?o.types:e.types,s=Xk(a,t);if(s===a&&n===e.aliasSymbol)return e;const c=n||e.aliasSymbol,l=n?r:Xk(e.aliasTypeArguments,t);return 2097152&i||o&&2097152&o.flags?Gb(s,0,c,l):zb(s,1,c,l)}if(4194304&i)return _x(CS(e.type,t));if(134217728&i)return mx(e.texts,Xk(e.types,t));if(268435456&i)return hx(e.symbol,CS(e.type,t));if(8388608&i){const i=n||e.aliasSymbol,o=n?r:Xk(e.aliasTypeArguments,t);return Ux(CS(e.objectType,t),CS(e.indexType,t),e.accessFlags,void 0,i,o)}if(16777216&i)return TS(e,_S(e.mapper,t),!1,n,r);if(33554432&i){const n=CS(e.baseType,t);if(Ay(e))return Ey(n);const r=CS(e.constraint,t);return 8650752&n.flags&&Ox(r)?Ly(n,r):3&r.flags||JS(DS(n),DS(r))?n:8650752&n.flags?Ly(n,r):Gb([r,n])}return e}(e,t,n,i);return-1===a?(Bi--,Mi[Bi]=void 0,Ri[Bi].clear()):c.set(s,_),y--,_}function NS(e){return 402915327&e.flags?e:e.permissiveInstantiation||(e.permissiveInstantiation=CS(e,kn))}function DS(e){return 402915327&e.flags?e:(e.restrictiveInstantiation||(e.restrictiveInstantiation=CS(e,xn),e.restrictiveInstantiation.restrictiveInstantiation=e.restrictiveInstantiation),e.restrictiveInstantiation)}function FS(e,t){return Qh(e.keyType,CS(e.type,t),e.isReadonly,e.declaration,e.components)}function ES(e){switch(pn.assert(175!==e.kind||Vf(e)),e.kind){case 219:case 220:case 175:case 263:return PS(e);case 211:return H(e.properties,ES);case 210:return H(e.elements,ES);case 228:return ES(e.whenTrue)||ES(e.whenFalse);case 227:return(57===e.operatorToken.kind||61===e.operatorToken.kind)&&(ES(e.left)||ES(e.right));case 304:return ES(e.initializer);case 218:return ES(e.expression);case 293:return H(e.properties,ES)||KE(e.parent)&&H(e.parent.parent.children,ES);case 292:{const{initializer:t}=e;return!!t&&ES(t)}case 295:{const{expression:t}=e;return!!t&&ES(t)}}return!1}function PS(e){return JT(e)||function(e){if(e.typeParameters||bv(e)||!e.body)return!1;if(242!==e.body.kind)return ES(e.body);return!!Af(e.body,e=>!!e.expression&&ES(e.expression))}(e)}function AS(e){return(UT(e)||Vf(e))&&PS(e)}function IS(e){if(524288&e.flags){const t=Hp(e);if(t.constructSignatures.length||t.callSignatures.length){const n=zs(16,e.symbol);return n.members=t.members,n.properties=t.properties,n.callSignatures=_,n.constructSignatures=_,n.indexInfos=_,n}}else if(2097152&e.flags)return Gb(P(e.types,IS));return e}function OS(e,t){return DT(e,t,Do)}function LS(e,t){return DT(e,t,Do)?-1:0}function jS(e,t){return DT(e,t,ko)?-1:0}function MS(e,t){return DT(e,t,bo)?-1:0}function RS(e,t){return DT(e,t,bo)}function BS(e,t){return DT(e,t,xo)}function JS(e,t){return DT(e,t,ko)}function zS(e,t){return 1048576&e.flags?b(e.types,e=>zS(e,t)):1048576&t.flags?H(t.types,t=>zS(e,t)):2097152&e.flags?H(e.types,e=>zS(e,t)):58982400&e.flags?zS(xf(e)||Ot,t):_T(t)?!!(67633152&e.flags):t===Kn?!!(67633152&e.flags)&&!_T(e):t===Xn?!!(524288&e.flags)&&sD(e):H_(e,$_(t))||$C(t)&&!HC(t)&&zS(e,er)}function qS(e,t){return DT(e,t,To)}function US(e,t){return qS(e,t)||qS(t,e)}function VS(e,t,n,r,i,o){return jT(e,t,ko,n,r,i,o)}function WS(e,t,n,r,i,o){return $S(e,t,ko,n,r,i,o,void 0)}function $S(e,t,n,r,i,o,a,s){return!!DT(e,t,n)||(!r||!KS(i,e,t,n,o,a,s))&&jT(e,t,n,r,o,a,s)}function HS(e){return!!(16777216&e.flags||2097152&e.flags&&H(e.types,HS))}function KS(e,t,n,r,i,o,a){if(!e||HS(n))return!1;if(!jT(t,n,r,void 0)&&function(e,t,n,r,i,o,a){const s=Jm(t,0),c=Jm(t,1);for(const l of[c,s])if(H(l,e=>{const t=gh(e);return!(131073&t.flags)&&jT(t,n,r,void 0)})){const r=a||{};VS(t,n,e,i,o,r);return uT(r.errors[r.errors.length-1],qp(e,l===c?fa.Did_you_mean_to_use_new_with_this_expression:fa.Did_you_mean_to_call_this_expression)),!0}return!1}(e,t,n,r,i,o,a))return!0;switch(e.kind){case 235:if(!kC(e))break;case 295:case 218:return KS(e.expression,t,n,r,i,o,a);case 227:switch(e.operatorToken.kind){case 64:case 28:return KS(e.right,t,n,r,i,o,a)}break;case 211:return function(e,t,n,r,i,o){return!(402915324&n.flags)&&YS(function*(e){if(!d(e.properties))return;for(const t of e.properties){if(_P(t))continue;const e=ix(Ss(t),8576);if(e&&!(131072&e.flags))switch(t.kind){case 179:case 178:case 175:case 305:yield{errorNode:t.name,innerExpression:void 0,nameType:e};break;case 304:yield{errorNode:t.name,innerExpression:t.initializer,nameType:e,errorMessage:Rp(t.name)?fa.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:void 0};break;default:pn.assertNever(t)}}}(e),t,n,r,i,o)}(e,t,n,r,o,a);case 210:return function(e,t,n,r,i,o){if(402915324&n.flags)return!1;if(nw(t))return YS(eT(e,n),t,n,r,i,o);KA(e,n,!1);const a=cI(e,1,!0);if(GA(),nw(a))return YS(eT(e,n),a,n,r,i,o);return!1}(e,t,n,r,o,a);case 293:return function(e,t,n,r,i,o){let a,s=YS(function*(e){if(!d(e.properties))return;for(const t of e.properties)tP(t)||bI(sC(t.name))||(yield{errorNode:t.name,innerExpression:t.initializer,nameType:Ek(sC(t.name))})}(e),t,n,r,i,o);if(KE(e.parent)&&$E(e.parent.parent)){const a=e.parent.parent,l=LI(AI(e)),_=void 0===l?"children":vc(l),u=Ek(_),p=Ux(n,u),f=py(a.children);if(!d(f))return s;const m=d(f)>1;let g,h;if(Cv(!1)!==On){const e=Hv(wt);g=OF(p,t=>JS(t,e)),h=OF(p,t=>!JS(t,e))}else g=OF(p,rw),h=OF(p,e=>!rw(e));if(m){if(g!==_n){const e=kb(TI(a,0)),t=function*(e,t){if(!d(e.children))return;let n=0;for(let r=0;r!rw(e)),c=s!==_n?DB(13,0,s,void 0):void 0;let l=!1;for(let n=e.next();!n.done;n=e.next()){const{errorNode:e,innerExpression:s,nameType:_,errorMessage:u}=n.value;let d=c;const p=a!==_n?GS(t,a,_):void 0;if(!p||8388608&p.flags||(d=c?zb([c,p]):p),!d)continue;let f=Wx(t,_);if(!f)continue;const m=Tx(_,void 0);if(!jT(f,d,r,void 0)){if(l=!0,!(s&&KS(s,f,d,r,void 0,i,o))){const n=o||{},c=s?QS(s,f):f;if(se&&VT(c,d)){const t=qp(e,fa.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,Sc(c),Sc(d));ho.add(t),n.errors=[t]}else{const o=!!(m&&16777216&(Am(a,m)||bt).flags),s=!!(m&&16777216&(Am(t,m)||bt).flags);d=Iw(d,o),f=Iw(f,o&&s);jT(c,d,r,e,u,i,n)&&c!==f&&jT(f,d,r,e,u,i,n)}}}}return l}(t,e,g,r,i,o)||s}else if(!DT(Ux(t,u),p,r)){s=!0;const e=Jo(a.openingElement.tagName,fa.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided,_,Sc(p));o&&o.skipLogging&&(o.errors||(o.errors=[])).push(e)}}else if(h!==_n){const e=ZS(f[0],u,c);e&&(s=YS(function*(){yield e}(),t,n,r,i,o)||s)}else if(!DT(Ux(t,u),p,r)){s=!0;const e=Jo(a.openingElement.tagName,fa.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided,_,Sc(p));o&&o.skipLogging&&(o.errors||(o.errors=[])).push(e)}}return s;function c(){if(!a){const t=ep(e.parent.tagName),r=LI(AI(e)),i=void 0===r?"children":vc(r),o=Ux(n,Ek(i)),s=fa._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;a={...s,key:"!!ALREADY FORMATTED!!",message:tk(s,t,i,Sc(o))}}return a}}(e,t,n,r,o,a);case 220:return function(e,t,n,r,i,o){if(GF(e.body))return!1;if(H(e.parameters,Iu))return!1;const a=eL(t);if(!a)return!1;const s=Jm(n,0);if(!d(s))return!1;const c=e.body,l=gh(a),_=zb(P(s,gh));if(!jT(l,_,r,void 0)){const t=c&&KS(c,l,_,r,void 0,i,o);if(t)return t;const a=o||{};if(jT(l,_,r,c,void 0,i,a),a.errors)return n.symbol&&d(n.symbol.declarations)&&uT(a.errors[a.errors.length-1],qp(n.symbol.declarations[0],fa.The_expected_type_comes_from_the_return_type_of_this_signature)),2&Rh(e)||Zc(l,"then")||!jT(Rj(l),_,r,void 0)||uT(a.errors[a.errors.length-1],qp(e,fa.Did_you_mean_to_mark_this_function_as_async)),!0}return!1}(e,t,n,r,o,a)}return!1}function GS(e,t,n){const r=Wx(t,n);if(r)return r;if(1048576&t.flags){const r=KT(e,t);if(r)return Wx(r,n)}}function QS(e,t){KA(e,t,!1);const n=PM(e,1);return GA(),n}function YS(e,t,n,r,i,o){let a=!1;for(const s of e){const{errorNode:e,innerExpression:c,nameType:l,errorMessage:_}=s;let u=GS(t,n,l);if(!u||8388608&u.flags)continue;let p=Wx(t,l);if(!p)continue;const f=Tx(l,void 0);if(!jT(p,u,r,void 0)){if(a=!0,!(c&&KS(c,p,u,r,void 0,i,o))){const a=o||{},s=c?QS(c,p):p;if(se&&VT(s,u)){const t=qp(e,fa.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,Sc(s),Sc(u));ho.add(t),a.errors=[t]}else{const o=!!(f&&16777216&(Am(n,f)||bt).flags),c=!!(f&&16777216&(Am(t,f)||bt).flags);u=Iw(u,o),p=Iw(p,o&&c);jT(s,u,r,e,_,i,a)&&s!==p&&jT(p,u,r,e,_,i,a)}if(a.errors){const e=a.errors[a.errors.length-1],t=dC(l)?pC(l):void 0,r=void 0!==t?Am(n,t):void 0;let i=!1;if(!r){const t=yg(n,l);t&&t.declaration&&!Sd(t.declaration).hasNoDefaultLib&&(i=!0,uT(e,qp(t.declaration,fa.The_expected_type_comes_from_this_index_signature)))}if(!i&&(r&&d(r.declarations)||n.symbol&&d(n.symbol.declarations))){const i=r&&d(r.declarations)?r.declarations[0]:n.symbol.declarations[0];Sd(i).hasNoDefaultLib||uT(e,qp(i,fa.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,!t||8192&l.flags?Sc(l):vc(t),Sc(n)))}}}}}return a}function ZS(e,t,n){switch(e.kind){case 295:return{errorNode:e,innerExpression:e.expression,nameType:t};case 12:if(e.containsOnlyTriviaWhiteSpaces)break;return{errorNode:e,innerExpression:void 0,nameType:t,errorMessage:n()};case 285:case 286:case 289:return{errorNode:e,innerExpression:e,nameType:t};default:return pn.assertNever(e,"Found invalid jsx child")}}function*eT(e,t){const n=d(e.elements);if(n)for(let r=0;rc:hj(e)>c))return!r||8&n||i(fa.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1,hj(e),c),0;e.typeParameters&&e.typeParameters!==t.typeParameters&&(e=rL(e,t=jh(t),void 0,a));const l=gj(e),_=bj(e),u=bj(t);(_||u)&&CS(_||u,s);const d=t.declaration?t.declaration.kind:0,p=!(3&n)&&K&&175!==d&&174!==d&&177!==d;let f=-1;const m=rh(e);if(m&&m!==ln){const e=rh(t);if(e){const t=!p&&a(m,e,!1)||a(e,m,r);if(!t)return r&&i(fa.The_this_types_of_each_signature_are_incompatible),0;f&=t}}const g=_||u?Math.min(l,c):Math.max(l,c),h=_||u?g-1:-1;for(let c=0;c=hj(e)&&c=3&&32768&t[0].flags&&65536&t[1].flags&&H(t,_T)?67108864:0)}return!!(67108864&e.objectFlags)}return!1}(t))return!0}return!1}function DT(e,t,n){if(wk(e)&&(e=e.regularType),wk(t)&&(t=t.regularType),e===t)return!0;if(n!==Do){if(n===To&&!(131072&t.flags)&&kT(t,e,n)||kT(e,t,n))return!0}else if(!(61865984&(e.flags|t.flags))){if(e.flags!==t.flags)return!1;if(67358815&e.flags)return!0}if(524288&e.flags&&524288&t.flags){const r=n.get(PC(e,t,0,n,!1));if(void 0!==r)return!!(1&r)}return!!(469499904&e.flags||469499904&t.flags)&&jT(e,t,n,void 0)}function FT(e,t){return 2048&xx(e)&&bI(t.escapedName)}function PT(e,t){for(;;){const n=wk(e)?e.regularType:mw(e)?LT(e,t):4&xx(e)?e.node?hy(e.target,by(e)):ZC(e)||e:3145728&e.flags?OT(e,t):33554432&e.flags?t?e.baseType:My(e):25165824&e.flags?Rx(e,t):e;if(n===e)return n;e=n}}function OT(e,t){const n=Qf(e);if(n!==e)return n;if(2097152&e.flags&&function(e){let t=!1,n=!1;for(const r of e.types)if(t||(t=!!(465829888&r.flags)),n||(n=!!(98304&r.flags)||_T(r)),t&&n)return!0;return!1}(e)){const n=I(e.types,e=>PT(e,t));if(n!==e.types)return Gb(n)}return e}function LT(e,t){const n=Pb(e),r=I(n,e=>25165824&e.flags?Rx(e,t):e);return n!==r?wb(e.target,r):e}function jT(e,t,n,i,o,a,s){var c;let l,u,p,f,m,g,h,y,v=0,b=0,x=0,k=0,T=!1,w=0,N=0,D=16e6-n.size>>3;pn.assert(n!==Do||!i,"no error reporting in identity checking");const F=U(e,t,3,!!i,o);if(y&&L(),T){const o=PC(e,t,0,n,!1);n.set(o,2|(D<=0?32:64)),null==(c=Gn)||c.instant(Gn.Phase.CheckTypes,"checkTypeRelatedTo_DepthLimit",{sourceId:e.id,targetId:t.id,depth:b,targetDepth:x});const a=D<=0?fa.Excessive_complexity_comparing_types_0_and_1:fa.Excessive_stack_depth_comparing_types_0_and_1,l=Jo(i||r,a,Sc(e),Sc(t));s&&(s.errors||(s.errors=[])).push(l)}else if(l){if(a){const e=a();e&&(ok(e,l),l=e)}let r;if(o&&i&&!F&&e.symbol){const i=_a(e.symbol);if(i.originatingImport&&!ff(i.originatingImport)){if(jT(z_(i.target),t,n,void 0)){r=ae(r,qp(i.originatingImport,fa.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))}}}const c=Wp(Sd(i),i,l,r);u&&uT(c,...u),s&&(s.errors||(s.errors=[])).push(c),s&&s.skipLogging||ho.add(c)}return i&&s&&s.skipLogging&&0===F&&pn.assert(!!s.errors,"missed opportunity to interact with error."),0!==F;function E(e){l=e.errorInfo,h=e.lastSkippedInfo,y=e.incompatibleStack,w=e.overrideNextErrorInfo,N=e.skipParentCounter,u=e.relatedInfo}function A(){return{errorInfo:l,lastSkippedInfo:h,incompatibleStack:null==y?void 0:y.slice(),overrideNextErrorInfo:w,skipParentCounter:N,relatedInfo:null==u?void 0:u.slice()}}function O(e,...t){w++,h=void 0,(y||(y=[])).push([e,...t])}function L(){const e=y||[];y=void 0;const t=h;if(h=void 0,1===e.length)return M(...e[0]),void(t&&J(void 0,...t));let n="";const r=[];for(;e.length;){const[t,...i]=e.pop();switch(t.code){case fa.Types_of_property_0_are_incompatible.code:{0===n.indexOf("new ")&&(n=`(${n})`);const e=""+i[0];n=0===n.length?`${e}`:vs(e,Sk(j))?`${n}.${e}`:"["===e[0]&&"]"===e[e.length-1]?`${n}${e}`:`${n}[${e}]`;break}case fa.Call_signature_return_types_0_and_1_are_incompatible.code:case fa.Construct_signature_return_types_0_and_1_are_incompatible.code:case fa.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:case fa.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:if(0===n.length){let e=t;t.code===fa.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?e=fa.Call_signature_return_types_0_and_1_are_incompatible:t.code===fa.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code&&(e=fa.Construct_signature_return_types_0_and_1_are_incompatible),r.unshift([e,i[0],i[1]])}else{n=`${t.code===fa.Construct_signature_return_types_0_and_1_are_incompatible.code||t.code===fa.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"new ":""}${n}(${t.code===fa.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code||t.code===fa.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"":"..."})`}break;case fa.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code:r.unshift([fa.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,i[0],i[1]]);break;case fa.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code:r.unshift([fa.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,i[0],i[1],i[2]]);break;default:return pn.fail(`Unhandled Diagnostic: ${t.code}`)}}n?M(")"===n[n.length-1]?fa.The_types_returned_by_0_are_incompatible_between_these_types:fa.The_types_of_0_are_incompatible_between_these_types,n):r.shift();for(const[e,...t]of r){const n=e.elidedInCompatabilityPyramid;e.elidedInCompatabilityPyramid=!1,M(e,...t),e.elidedInCompatabilityPyramid=n}t&&J(void 0,...t)}function M(e,...t){pn.assert(!!i),y&&L(),e.elidedInCompatabilityPyramid||(0===N?l=ik(l,e,...t):N--)}function R(e,...t){M(e,...t),N++}function B(e){pn.assert(!!l),u?u.push(e):u=[e]}function J(e,t,r){y&&L();const[i,o]=Tc(t,r);let a=t,s=i;131072&r.flags||!sw(t)||RT(r)||(a=cw(t),pn.assert(!JS(a,r),"generalized source shouldn't be assignable"),s=wc(a));if(262144&(8388608&r.flags&&!(8388608&t.flags)?r.objectType.flags:r.flags)&&r!==qn&&r!==Un){const e=xf(r);let n;e&&(JS(a,e)||(n=JS(t,e)))?M(fa._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,n?i:s,o,Sc(e)):(l=void 0,M(fa._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,o,s))}if(e)e===fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1&&se&&BT(t,r).length&&(e=fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties);else if(n===To)e=fa.Type_0_is_not_comparable_to_type_1;else if(i===o)e=fa.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;else if(se&&BT(t,r).length)e=fa.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;else{if(128&t.flags&&1048576&r.flags){const e=function(e,t){const n=t.types.filter(e=>!!(128&e.flags));return Mt(e.value,n,e=>e.value)}(t,r);if(e)return void M(fa.Type_0_is_not_assignable_to_type_1_Did_you_mean_2,s,o,Sc(e))}e=fa.Type_0_is_not_assignable_to_type_1}M(e,s,o)}function z(e,t,n){return fw(e)?e.target.readonly&&GC(t)?(n&&M(fa.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,Sc(e),Sc(t)),!1):KC(t):HC(e)&&GC(t)?(n&&M(fa.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,Sc(e),Sc(t)),!1):!fw(t)||$C(e)}function q(e,t,n){return U(e,t,3,n)}function U(e,t,r=3,o=!1,a,s=0){if(e===t)return-1;if(524288&e.flags&&402784252&t.flags)return n===To&&!(131072&t.flags)&&kT(t,e,n)||kT(e,t,n,o?M:void 0)?-1:(o&&V(e,t,e,t,a),0);const c=PT(e,!1);let l=PT(t,!0);if(c===l)return-1;if(n===Do)return c.flags!==l.flags?0:67358815&c.flags?-1:(W(c,l),ee(c,l,!1,0,r));if(262144&c.flags&&_f(c)===l)return-1;if(470302716&c.flags&&1048576&l.flags){const e=l.types,t=2===e.length&&98304&e[0].flags?e[1]:3===e.length&&98304&e[0].flags&&98304&e[1].flags?e[2]:void 0;if(t&&!(98304&t.flags)&&(l=PT(t,!0),c===l))return-1}if(n===To&&!(131072&l.flags)&&kT(l,c,n)||kT(c,l,n,o?M:void 0))return-1;if(469499904&c.flags||469499904&l.flags){if(!(2&s)&&IN(c)&&8192&xx(c)&&function(e,t,r){var o;if(!$I(t)||!te&&4096&xx(t))return!1;const a=!!(2048&xx(e));if((n===ko||n===To)&&(kF(Kn,t)||!a&&lT(t)))return!1;let s,c=t;1048576&t.flags&&(c=Qq(e,t,U)||function(e){if(oM(e,67108864)){const t=OF(e,e=>!(402784252&e.flags));if(!(131072&t.flags))return t}return e}(t),s=1048576&c.flags?c.types:[c]);for(const t of lf(e))if(G(t,e.symbol)&&!FT(e,t)){if(!WI(c,t.escapedName,a)){if(r){const n=OF(c,$I);if(!i)return pn.fail();if(eP(i)||Tu(i)||Tu(i.parent)){t.valueDeclaration&&ZE(t.valueDeclaration)&&Sd(i)===Sd(t.valueDeclaration.name)&&(i=t.valueDeclaration.name);const e=pc(t),r=EO(e,n),o=r?pc(r):void 0;o?M(fa.Property_0_does_not_exist_on_type_1_Did_you_mean_2,e,Sc(n),o):M(fa.Property_0_does_not_exist_on_type_1,e,Sc(n))}else{const r=(null==(o=e.symbol)?void 0:o.declarations)&&ge(e.symbol.declarations);let a;if(t.valueDeclaration&&mc(t.valueDeclaration,e=>e===r)&&Sd(r)===Sd(i)){const e=t.valueDeclaration;pn.assertNode(e,S_);const r=e.name;i=r,uD(r)&&(a=PO(r,n))}void 0!==a?R(fa.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,pc(t),Sc(n),a):R(fa.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,pc(t),Sc(n))}}return!0}if(s&&!U(z_(t),K(s,t.escapedName),3,r))return r&&O(fa.Types_of_property_0_are_incompatible,pc(t)),!0}return!1}(c,l,o))return o&&J(a,c,t.aliasSymbol?t:l),0;const _=(n!==To||ow(c))&&!(2&s)&&405405692&c.flags&&c!==Kn&&2621440&l.flags&&cC(l)&&(lf(c).length>0||Oz(c)),u=!!(2048&xx(c));if(_&&!function(e,t,n){for(const r of lf(e))if(WI(t,r.escapedName,n))return!0;return!1}(c,l,u)){if(o){const n=Sc(e.aliasSymbol?e:c),r=Sc(t.aliasSymbol?t:l),i=Jm(c,0),o=Jm(c,1);i.length>0&&U(gh(i[0]),l,1,!1)||o.length>0&&U(gh(o[0]),l,1,!1)?M(fa.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,n,r):M(fa.Type_0_has_no_properties_in_common_with_type_1,n,r)}return 0}W(c,l);const d=1048576&c.flags&&c.types.length<4&&!(1048576&l.flags)||1048576&l.flags&&l.types.length<4&&!(469499904&c.flags)?X(c,l,o,s):ee(c,l,o,s,r);if(d)return d}return o&&V(e,t,c,l,a),0}function V(e,t,n,r,o){var a,s;const c=!!ZC(e),_=!!ZC(t);n=e.aliasSymbol||c?e:n,r=t.aliasSymbol||_?t:r;let u=w>0;if(u&&w--,524288&n.flags&&524288&r.flags){const e=l;z(n,r,!0),l!==e&&(u=!!l)}if(524288&n.flags&&402784252&r.flags)!function(e,t){const n=Dc(e.symbol)?Sc(e,e.symbol.valueDeclaration):Sc(e),r=Dc(t.symbol)?Sc(t,t.symbol.valueDeclaration):Sc(t);(tr===e&&Ut===t||nr===e&&Wt===t||or===e&&on===t||_v()===e&&sn===t)&&M(fa._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,r,n)}(n,r);else if(n.symbol&&524288&n.flags&&Kn===n)M(fa.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);else if(2048&xx(n)&&2097152&r.flags){const e=r.types,t=wI(HB.IntrinsicAttributes,i),n=wI(HB.IntrinsicClassAttributes,i);if(!il(t)&&!il(n)&&(C(e,t)||C(e,n)))return}else l=km(l,t);if(!o&&u){const e=A();let t;return J(o,n,r),l&&l!==e.errorInfo&&(t={code:l.code,messageText:l.messageText}),E(e),t&&l&&(l.canonicalHead=t),void(h=[n,r])}if(J(o,n,r),262144&n.flags&&(null==(s=null==(a=n.symbol)?void 0:a.declarations)?void 0:s[0])&&!_f(n)){const e=fS(n);if(e.constraint=CS(r,iS(n,e)),Sf(e)){const e=Sc(r,n.symbol.declarations[0]);B(qp(n.symbol.declarations[0],fa.This_type_parameter_might_need_an_extends_0_constraint,e))}}}function W(e,t){if(Gn&&3145728&e.flags&&3145728&t.flags){const n=e,r=t;if(n.objectFlags&r.objectFlags&32768)return;const o=n.types.length,a=r.types.length;o*a>1e6&&Gn.instant(Gn.Phase.CheckTypes,"traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:e.id,sourceSize:o,targetId:t.id,targetSize:a,pos:null==i?void 0:i.pos,end:null==i?void 0:i.end})}}function K(e,t){return zb(De(e,(e,n)=>{var r;const i=3145728&(n=qf(n)).flags?Xf(n,t):Qp(n,t);return ae(e,i&&z_(i)||(null==(r=bg(n,t))?void 0:r.type)||Lt)},void 0)||_)}function G(e,t){return e.valueDeclaration&&t.valueDeclaration&&e.valueDeclaration.parent===t.valueDeclaration}function X(e,t,r,i){if(1048576&e.flags){if(1048576&t.flags){const n=e.origin;if(n&&2097152&n.flags&&t.aliasSymbol&&C(n.types,t))return-1;const r=t.origin;if(r&&1048576&r.flags&&e.aliasSymbol&&C(r.types,e))return-1}return n===To?Z(e,t,r&&!(402784252&e.flags),i):function(e,t,n,r){let i=-1;const o=e.types,a=function(e,t){if(1048576&e.flags&&1048576&t.flags&&!(32768&e.types[0].flags)&&32768&t.types[0].flags)return WF(t,-32769);return t}(e,t);for(let e=0;e=a.types.length&&o.length%a.types.length===0){const t=U(s,a.types[e%a.types.length],3,!1,void 0,r);if(t){i&=t;continue}}const c=U(s,t,1,n,void 0,r);if(!c)return 0;i&=c}return i}(e,t,r&&!(402784252&e.flags),i)}if(1048576&t.flags)return Y(zw(e),t,r&&!(402784252&e.flags)&&!(402784252&t.flags),i);if(2097152&t.flags)return function(e,t,n,r){let i=-1;const o=t.types;for(const t of o){const o=U(e,t,2,n,void 0,r);if(!o)return 0;i&=o}return i}(e,t,r,2);if(n===To&&402784252&t.flags){const n=I(e.types,e=>465829888&e.flags?xf(e)||Ot:e);if(n!==e.types){if(131072&(e=Gb(n)).flags)return 0;if(!(2097152&e.flags))return U(e,t,1,!1)||U(t,e,1,!1)}}return Z(e,t,!1,1)}function Q(e,t){let n=-1;const r=e.types;for(const e of r){const r=Y(e,t,!1,0);if(!r)return 0;n&=r}return n}function Y(e,t,r,i){const o=t.types;if(1048576&t.flags){if(Ib(o,e))return-1;if(n!==To&&32768&xx(t)&&!(1024&e.flags)&&(2688&e.flags||(n===bo||n===xo)&&256&e.flags)){const t=e===e.regularType?e.freshType:e.regularType,n=128&e.flags?Ut:256&e.flags?Wt:2048&e.flags?$t:void 0;return n&&Ib(o,n)||t&&Ib(o,t)?-1:0}const r=nD(t,e);if(r){const t=U(e,r,2,!1,void 0,i);if(t)return t}}for(const t of o){const n=U(e,t,2,!1,void 0,i);if(n)return n}if(r){const n=KT(e,t,U);n&&U(e,n,2,!0,void 0,i)}return 0}function Z(e,t,n,r){const i=e.types;if(1048576&e.flags&&Ib(i,t))return-1;const o=i.length;for(let e=0;e(N|=e?16:8,S(e))),3===k?(null==(a=Gn)||a.instant(Gn.Phase.CheckTypes,"recursiveTypeRelatedTo_DepthLimit",{sourceId:e.id,sourceIdStack:m.map(e=>e.id),targetId:t.id,targetIdStack:g.map(e=>e.id),depth:b,targetDepth:x}),C=3):(null==(s=Gn)||s.push(Gn.Phase.CheckTypes,"structuredTypeRelatedTo",{sourceId:e.id,targetId:t.id}),C=function(e,t,r,i){const o=A();let a=function(e,t,r,i,o){let a,s,c=!1,u=e.flags;const d=t.flags;if(n===Do){if(3145728&u){let n=Q(e,t);return n&&(n&=Q(t,e)),n}if(4194304&u)return U(e.type,t.type,3,!1);if(8388608&u&&(a=U(e.objectType,t.objectType,3,!1))&&(a&=U(e.indexType,t.indexType,3,!1)))return a;if(16777216&u&&e.root.isDistributive===t.root.isDistributive&&(a=U(e.checkType,t.checkType,3,!1))&&(a&=U(e.extendsType,t.extendsType,3,!1))&&(a&=U(Zx(e),Zx(t),3,!1))&&(a&=U(rk(e),rk(t),3,!1)))return a;if(33554432&u&&(a=U(e.baseType,t.baseType,3,!1))&&(a&=U(e.constraint,t.constraint,3,!1)))return a;if(134217728&u&&re(e.texts,t.texts)){const n=e.types,r=t.types;a=-1;for(let e=0;e!!(262144&e.flags));){if(a=U(n,t,1,!1))return a;n=uf(n)}return 0}}else if(4194304&d){const n=t.type;if(4194304&u&&(a=U(n,e.type,3,!1)))return a;if(fw(n)){if(a=U(e,Db(n),2,r))return a}else{const i=mf(n);if(i){if(-1===U(e,_x(i,4|t.indexFlags),2,r))return-1}else if(Bp(n)){const t=Sp(n),i=kp(n);let o;if(t&&wp(n)){o=zb([ne(t,n),t])}else o=t||i;if(-1===U(e,o,2,r))return-1}}}else if(8388608&d){if(8388608&u){if((a=U(e.objectType,t.objectType,3,r))&&(a&=U(e.indexType,t.indexType,3,r)),a)return a;r&&(s=l)}if(n===ko||n===To){const n=t.objectType,c=t.indexType,_=xf(n)||n,u=xf(c)||c;if(!Lx(_)&&!jx(u)){const t=Wx(_,u,4|(_!==n?2:0));if(t){if(r&&s&&E(o),a=U(e,t,2,r,void 0,i))return a;r&&s&&l&&(l=h([s])<=h([l])?s:l)}}}r&&(s=void 0)}else if(Bp(t)&&n!==Do){const n=!!t.declaration.nameType,i=Tp(t),c=Dp(t);if(!(8&c)){if(!n&&8388608&i.flags&&i.objectType===e&&i.indexType===vp(t))return-1;if(!Bp(e)){const i=n?Sp(t):kp(t),_=_x(e,2),u=4&c,d=u?$d(i,_):void 0;if(u?!(131072&d.flags):U(i,_,3)){const o=Tp(t),s=vp(t),c=WF(o,-98305);if(!n&&8388608&c.flags&&c.indexType===s){if(a=U(e,c.objectType,2,r))return a}else{const t=Ux(e,n?d||i:d?Gb([d,s]):s);if(a=U(t,o,3,r))return a}}s=l,E(o)}}}else if(16777216&d){if(jC(t,g,x,10))return 3;const n=t;if(!(n.root.inferTypeParameters||(p=n.root,p.isDistributive&&(vS(p.checkType,p.node.trueType)||vS(p.checkType,p.node.falseType)))||16777216&e.flags&&e.root===n.root)){const t=!JS(NS(n.checkType),NS(n.extendsType)),r=!t&&JS(DS(n.checkType),DS(n.extendsType));if((a=t?-1:U(e,Zx(n),2,!1,void 0,i))&&(a&=r?-1:U(e,rk(n),2,!1,void 0,i),a))return a}}else if(134217728&d){if(134217728&u){if(n===To)return function(e,t){const n=e.texts[0],r=t.texts[0],i=e.texts[e.texts.length-1],o=t.texts[t.texts.length-1],a=Math.min(n.length,r.length),s=Math.min(i.length,o.length);return n.slice(0,a)!==r.slice(0,a)||i.slice(i.length-s)!==o.slice(o.length-s)}(e,t)?0:-1;CS(e,Cn)}if(DN(e,t))return-1}else if(268435456&t.flags&&!(268435456&e.flags)&&CN(e,t))return-1;var p;if(8650752&u){if(!(8388608&u&&8388608&d)){const n=_f(e)||Ot;if(a=U(n,t,1,!1,void 0,i))return a;if(a=U(Id(n,e),t,1,r&&n!==Ot&&!(d&u&262144),void 0,i))return a;if(Pf(e)){const n=_f(e.indexType);if(n&&(a=U(Ux(e.objectType,n),t,1,r)))return a}}}else if(4194304&u){const n=sx(e.type,e.indexFlags)&&32&xx(e.type);if(a=U(hn,t,1,r&&!n))return a;if(n){const n=e.type,i=Sp(n),o=i&&wp(n)?ne(i,n):i||kp(n);if(a=U(o,t,1,r))return a}}else if(134217728&u&&!(524288&d)){if(!(134217728&d)){const n=xf(e);if(n&&n!==e&&(a=U(n,t,1,r)))return a}}else if(268435456&u)if(268435456&d){if(e.symbol!==t.symbol)return 0;if(a=U(e.type,t.type,3,r))return a}else{const n=xf(e);if(n&&(a=U(n,t,1,r)))return a}else if(16777216&u){if(jC(e,m,b,10))return 3;if(16777216&d){const n=e.root.inferTypeParameters;let i,o=e.extendsType;if(n){const e=tN(n,void 0,0,q);EN(e.inferences,t.extendsType,o,1536),o=CS(o,e.mapper),i=e.mapper}if(OS(o,t.extendsType)&&(U(e.checkType,t.checkType,3)||U(t.checkType,e.checkType,3))&&((a=U(CS(Zx(e),i),Zx(t),3,r))&&(a&=U(rk(e),rk(t),3,r)),a))return a}const n=hf(e);if(n&&(a=U(n,t,1,r)))return a;const i=16777216&d||!Sf(e)?void 0:yf(e);if(i&&(E(o),a=U(i,t,1,r)))return a}else{if(n!==bo&&n!==xo&&(32&xx(f=t)&&4&Dp(f))&&lT(e))return-1;if(Bp(t))return Bp(e)&&(a=function(e,t,r){const i=n===To||(n===Do?Dp(e)===Dp(t):Ap(e)<=Ap(t));if(i){let n;if(n=U(kp(t),CS(kp(e),Ap(e)<0?wn:Cn),3,r)){const i=nS([vp(e)],[vp(t)]);if(CS(Sp(e),i)===CS(Sp(t),i))return n&U(CS(Tp(e),i),Tp(t),3,r)}}return 0}(e,t,r))?a:0;const p=!!(402784252&u);if(n!==Do)u=(e=qf(e)).flags;else if(Bp(e))return 0;if(4&xx(e)&&4&xx(t)&&e.target===t.target&&!fw(e)&&!CC(e)&&!CC(t)){if(tw(e))return-1;const n=_C(e.target);if(n===_)return 1;const r=y(by(e),by(t),n,i);if(void 0!==r)return r}else{if(HC(t)?PF(e,KC):$C(t)&&PF(e,e=>fw(e)&&!e.target.readonly))return n!==Do?U(dg(e,Wt)||wt,dg(t,Wt)||wt,3,r):0;if(mw(e)&&fw(t)&&!mw(t)){const n=kf(e);if(n!==e)return U(n,t,1,r)}else if((n===bo||n===xo)&&lT(t)&&8192&xx(t)&&!lT(e))return 0}if(2621440&u&&524288&d){const n=r&&l===o.errorInfo&&!p;if(a=ce(e,t,n,void 0,!1,i),a&&(a&=le(e,t,0,n,i),a&&(a&=le(e,t,1,n,i),a&&(a&=me(e,t,p,n,i)))),c&&a)l=s||l||o.errorInfo;else if(a)return a}if(2621440&u&&1048576&d){const r=WF(t,36175872);if(1048576&r.flags){const t=function(e,t){var r;const i=lf(e),o=ZN(i,t);if(!o)return 0;let a=1;for(const n of o)if(a*=JF(U_(n)),a>25)return null==(r=Gn)||r.instant(Gn.Phase.CheckTypes,"typeRelatedToDiscriminatedType_DepthLimit",{sourceId:e.id,targetId:t.id,numCombinations:a}),0;const s=new Array(o.length),c=new Set;for(let e=0;er[i],!1,0,$||n===To))continue e}_e(_,a,ht),i=!0}if(!i)return 0}let u=-1;for(const t of _)if(u&=ce(e,t,!1,c,!1,0),u&&(u&=le(e,t,0,!1,0),u&&(u&=le(e,t,1,!1,0),!u||fw(e)&&fw(t)||(u&=me(e,t,!1,!1,0)))),!u)return u;return u}(e,r);if(t)return t}}}var f;return 0;function h(e){return e?De(e,(e,t)=>e+1+h(t.next),0):0}function y(e,t,i,u){if(a=function(e=_,t=_,r=_,i,o){if(e.length!==t.length&&n===Do)return 0;const a=e.length<=t.length?e.length:t.length;let s=-1;for(let c=0;c!!(24&e)))return s=void 0,void E(o);const d=t&&function(e,t){for(let n=0;n!(7&e))))return 0;s=l,E(o)}}}(e,t,r,i,o);if(n!==Do){if(!a&&(2097152&e.flags||262144&e.flags&&1048576&t.flags)){const n=function(e,t){let n,r=!1;for(const i of e)if(465829888&i.flags){let e=_f(i);for(;e&&21233664&e.flags;)e=_f(e);e&&(n=ae(n,e),t&&(n=ae(n,i)))}else(469892092&i.flags||_T(i))&&(r=!0);if(n&&(t||r)){if(r)for(const t of e)(469892092&t.flags||_T(t))&&(n=ae(n,t));return PT(Gb(n,2),!1)}}(2097152&e.flags?e.types:[e],!!(1048576&t.flags));n&&PF(n,t=>t!==e)&&(a=U(n,t,1,!1,void 0,i))}a&&!(2&i)&&2097152&t.flags&&!Lx(t)&&2621440&e.flags?(a&=ce(e,t,r,void 0,!1,0),a&&IN(e)&&8192&xx(e)&&(a&=me(e,t,!1,r,0))):a&&fk(t)&&!KC(t)&&2097152&e.flags&&3670016&qf(e).flags&&!H(e.types,e=>e===t||!!(262144&xx(e)))&&(a&=ce(e,t,r,void 0,!0,i))}a&&E(o);return a}(e,t,r,i),null==(c=Gn)||c.pop()),en&&(en=S),1&o&&b--,2&o&&x--,k=y,C?(-1===C||0===b&&0===x)&&F(-1===C||3===C):(n.set(u,2|N),D--,F(!1)),C;function F(e){for(let t=h;t{r.push(CS(e,pS(t.mapper,vp(t),n)))}),zb(r)}function ie(e,t){if(!t||0===e.length)return e;let n;for(let r=0;r{return!!(4&lx(t))&&(n=e,r=IC(t),!AC(n,e=>{const t=IC(e);return!!t&&H_(t,r)}));var n,r})}(r,i))return a&&M(fa.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2,pc(i),Sc(IC(r)||e),Sc(IC(i)||t)),0}else if(4&l)return a&&M(fa.Property_0_is_protected_in_type_1_but_public_in_type_2,pc(i),Sc(e),Sc(t)),0;if(n===xo&&Yj(r)&&!Yj(i))return 0;const u=function(e,t,r,i,o){const a=$&&!!(48&cx(t)),s=Al(U_(t),!1,a);return s.flags&(n===xo?1:3)?-1:U(r(e),s,3,i,void 0,o)}(r,i,o,a,s);return u?!c&&16777216&r.flags&&106500&i.flags&&!(16777216&i.flags)?(a&&M(fa.Property_0_is_optional_in_type_1_but_required_in_type_2,pc(i),Sc(e),Sc(t)),0):u:(a&&O(fa.Types_of_property_0_are_incompatible,pc(i)),0)}function ce(e,t,r,i,a,s){if(n===Do)return function(e,t,n){if(!(524288&e.flags&&524288&t.flags))return 0;const r=ie(Kp(e),n),i=ie(Kp(t),n);if(r.length!==i.length)return 0;let o=-1;for(const e of r){const n=Qp(t,e.escapedName);if(!n)return 0;const r=zC(e,n,U);if(!r)return 0;o&=r}return o}(e,t,i);let c=-1;if(fw(t)){if(KC(e)){if(!t.target.readonly&&(HC(e)||fw(e)&&e.target.readonly))return 0;const n=xy(e),o=xy(t),a=fw(e)?4&e.target.combinedFlags:4,l=!!(12&t.target.combinedFlags),_=fw(e)?e.target.minLength:0,u=t.target.minLength;if(!a&&n!(e&t));return n>=0?n:e.elementFlags.length}(t.target,11),m=Fb(t.target,11);let g=!!i;for(let a=0;a=f?o-1-Math.min(u,m):a,y=t.target.elementFlags[h];if(8&y&&!(8&_))return r&&M(fa.Source_provides_no_match_for_variadic_element_at_position_0_in_target,h),0;if(8&_&&!(12&y))return r&&M(fa.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,a,h),0;if(1&y&&!(1&_))return r&&M(fa.Source_provides_no_match_for_required_element_at_position_0_in_target,h),0;if(g&&((12&_||12&y)&&(g=!1),g&&(null==i?void 0:i.has(""+a))))continue;const v=Iw(d[a],!!(_&y&2)),b=p[h],x=U(v,8&_&&4&y?Kv(b):Iw(b,!!(2&y)),3,r,void 0,s);if(!x)return r&&(o>1||n>1)&&(l&&a>=f&&u>=m&&f!==n-m-1?O(fa.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,f,n-m-1,h):O(fa.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,a,h)),0;c&=x}return c}if(12&t.target.combinedFlags)return 0}const _=!(n!==bo&&n!==xo||IN(e)||tw(e)||fw(e)),u=vN(e,t,_,!1);if(u)return r&&function(e,t){const n=jm(e,0),r=jm(e,1),i=Kp(e);if((n.length||r.length)&&!i.length)return!!(Jm(t,0).length&&n.length||Jm(t,1).length&&r.length);return!0}(e,t)&&function(e,t,n,r){let i=!1;if(n.valueDeclaration&&Nc(n.valueDeclaration)&&dD(n.valueDeclaration.name)&&e.symbol&&32&e.symbol.flags){const r=n.valueDeclaration.name.escapedText,i=Kh(e.symbol,r);if(i&&Am(e,i)){const n=bw.getDeclarationName(e.symbol.valueDeclaration),i=bw.getDeclarationName(t.symbol.valueDeclaration);return void M(fa.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2,ya(r),ya(""===n.escapedText?QB:n),ya(""===i.escapedText?QB:i))}}const a=je(yN(e,t,r,!1));if((!o||o.code!==fa.Class_0_incorrectly_implements_interface_1.code&&o.code!==fa.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)&&(i=!0),1===a.length){const r=pc(n,void 0,0,20);M(fa.Property_0_is_missing_in_type_1_but_required_in_type_2,r,...Tc(e,t)),d(n.declarations)&&B(qp(n.declarations[0],fa._0_is_declared_here,r)),i&&l&&w++}else z(e,t,!1)&&(a.length>5?M(fa.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,Sc(e),Sc(t),P(a.slice(0,4),e=>pc(e)).join(", "),a.length-4):M(fa.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,Sc(e),Sc(t),P(a,e=>pc(e)).join(", ")),i&&l&&w++)}(e,t,u,_),0;if(IN(t))for(const n of ie(lf(e),i))if(!Qp(t,n.escapedName)){if(!(32768&z_(n).flags))return r&&M(fa.Property_0_does_not_exist_on_type_1,pc(n),Sc(t)),0}const p=lf(t),f=fw(e)&&fw(t);for(const o of ie(p,i)){const i=o.escapedName;if(!(4194304&o.flags)&&(!f||WT(i)||"length"===i)&&(!a||16777216&o.flags)){const a=Am(e,i);if(a&&a!==o){const i=oe(e,t,a,o,U_,r,s,n===To);if(!i)return 0;c&=i}}}return c}function le(e,t,r,i,o){var a,s;if(n===Do)return function(e,t,n){const r=Jm(e,n),i=Jm(t,n);if(r.length!==i.length)return 0;let o=-1;for(let e=0;egc(e,void 0,262144,r);return M(fa.Type_0_is_not_assignable_to_type_1,e(t),e(c)),M(fa.Types_of_construct_signatures_are_incompatible),d}}else e:for(const t of u){const n=A();let a=i;for(const e of _){const r=pe(e,t,!0,a,o,p(e,t));if(r){d&=r,E(n);continue e}a=!1}return a&&M(fa.Type_0_provides_no_match_for_the_signature_1,Sc(e),gc(t,void 0,void 0,r)),0}return d}function ue(e,t){return 0===e.parameters.length&&0===t.parameters.length?(e,t)=>O(fa.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,Sc(e),Sc(t)):(e,t)=>O(fa.Call_signature_return_types_0_and_1_are_incompatible,Sc(e),Sc(t))}function de(e,t){return 0===e.parameters.length&&0===t.parameters.length?(e,t)=>O(fa.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,Sc(e),Sc(t)):(e,t)=>O(fa.Construct_signature_return_types_0_and_1_are_incompatible,Sc(e),Sc(t))}function pe(e,t,r,i,o,a){const s=n===bo?16:n===xo?24:0;return iT(r?Lh(e):e,r?Lh(t):t,s,i,M,a,function(e,t,n){return U(e,t,3,n,void 0,o)},Cn)}function fe(e,t,n,r){const i=U(e.type,t.type,3,n,void 0,r);return!i&&n&&(e.keyType===t.keyType?M(fa._0_index_signatures_are_incompatible,Sc(e.keyType)):M(fa._0_and_1_index_signatures_are_incompatible,Sc(e.keyType),Sc(t.keyType))),i}function me(e,t,r,i,o){if(n===Do)return function(e,t){const n=cg(e),r=cg(t);if(n.length!==r.length)return 0;for(const t of r){const n=lg(e,t.keyType);if(!n||!U(n.type,t.type,3)||n.isReadonly!==t.isReadonly)return 0}return-1}(e,t);const a=cg(t),s=H(a,e=>e.keyType===Ut);let c=-1;for(const t of a){const a=n!==xo&&!r&&s&&1&t.type.flags?-1:Bp(e)&&s?U(Tp(e),t.type,3,i):he(e,t,i,o);if(!a)return 0;c&=a}return c}function he(e,t,r,i){const o=yg(e,t.keyType);return o?fe(o,t,r,i):1&i||!(n!==xo||8192&xx(e))||!jw(e)?(r&&M(fa.Index_signature_for_type_0_is_missing_in_type_1,Sc(t.keyType),Sc(e)),0):function(e,t,n,r){let i=-1;const o=t.keyType,a=2097152&e.flags?cf(e):Kp(e);for(const s of a)if(!FT(e,s)&&tg(ix(s,8576),o)){const e=U_(s),a=U(se||32768&e.flags||o===Wt||!(16777216&s.flags)?e:pD(e,524288),t.type,3,n,void 0,r);if(!a)return n&&M(fa.Property_0_is_incompatible_with_index_signature,pc(s)),0;i&=a}for(const a of cg(e))if(tg(a.keyType,o)){const e=fe(a,t,n,r);if(!e)return 0;i&=e}return i}(e,t,r,i)}}function RT(e){if(16&e.flags)return!1;if(3145728&e.flags)return!!p(e.types,RT);if(465829888&e.flags){const t=_f(e);if(t&&t!==e)return RT(t)}return ow(e)||!!(134217728&e.flags)||!!(268435456&e.flags)}function BT(e,t){return fw(e)&&fw(t)?_:lf(t).filter(t=>VT(Zc(e,t.escapedName),z_(t)))}function VT(e,t){return!!e&&!!t&&oM(e,32768)&&!!Ow(t)}function KT(e,t,n=jS){return Qq(e,t,n)||function(e,t){const n=xx(e);if(20&n&&1048576&t.flags)return x(t.types,t=>{if(524288&t.flags){const r=n&xx(t);if(4&r)return e.target===t.target;if(16&r)return!!e.aliasSymbol&&e.aliasSymbol===t.aliasSymbol}return!1})}(e,t)||function(e,t){if(128&xx(e)&&DF(t,QC))return x(t.types,e=>!QC(e))}(e,t)||function(e,t){let n=0;const r=Jm(e,n).length>0||(n=1,Jm(e,n).length>0);if(r)return x(t.types,e=>Jm(e,n).length>0)}(e,t)||function(e,t){let n;if(!(406978556&e.flags)){let r=0;for(const i of t.types)if(!(406978556&i.flags)){const t=Gb([_x(e),_x(i)]);if(4194304&t.flags)return i;if(ow(t)||1048576&t.flags){const e=1048576&t.flags?N(t.types,ow):1;e>=r&&(n=i,r=e)}}}return n}(e,t)}function ZT(e,t,n){const r=e.types,i=r.map(e=>402784252&e.flags?0:-1);for(const[e,o]of t){let t=!1;for(let a=0;a!!n(e,s))?t=!0:i[a]=3)}for(let e=0;ei[t]),0):e;return 131072&o.flags?e:o}function cC(e){if(524288&e.flags){const t=Hp(e);return 0===t.callSignatures.length&&0===t.constructSignatures.length&&0===t.indexInfos.length&&t.properties.length>0&&b(t.properties,e=>!!(16777216&e.flags))}return 33554432&e.flags?cC(e.baseType):!!(2097152&e.flags)&&b(e.types,cC)}function _C(e){return e===Zn||e===er||8&e.objectFlags?A:hC(e.symbol,e.typeParameters)}function gC(e){return hC(e,_a(e).typeParameters)}function hC(e,t=_){var n,r;const i=_a(e);if(!i.variances){null==(n=Gn)||n.push(Gn.Phase.CheckTypes,"getVariancesWorker",{arity:t.length,id:Ab(Ru(e))});const o=Hi,a=$i;Hi||(Hi=!0,$i=Ui.length),i.variances=_;const s=[];for(const n of t){const t=wC(n);let r=16384&t?8192&t?0:1:8192&t?2:void 0;if(void 0===r){let t=!1,i=!1;const o=en;en=e=>e?i=!0:t=!0;const a=vC(e,n,Bn),s=vC(e,n,Jn);r=(JS(s,a)?1:0)|(JS(a,s)?2:0),3===r&&JS(vC(e,n,zn),a)&&(r=4),en=o,(t||i)&&(t&&(r|=8),i&&(r|=16))}s.push(r)}o||(Hi=!1,$i=a),i.variances=s,null==(r=Gn)||r.pop({variances:s.map(pn.formatVariance)})}return i.variances}function vC(e,t,n){const r=iS(t,n),i=Ru(e);if(il(i))return i;const o=524288&e.flags?Sy(e,Xk(_a(e).typeParameters,r)):hy(i,Xk(i.typeParameters,r));return vt.add(Ab(o)),o}function CC(e){return vt.has(Ab(e))}function wC(e){var t;return 28672&De(null==(t=e.symbol)?void 0:t.declarations,(e,t)=>e|Vv(t),0)}function FC(e){return 262144&e.flags&&!uf(e)}function EC(e){return function(e){return!!(4&xx(e))&&!e.node}(e)&&H(by(e),e=>!!(262144&e.flags)||EC(e))}function PC(e,t,n,r,i){if(r===Do&&e.id>t.id){const n=e;e=t,t=n}const o=n?":"+n:"";return EC(e)&&EC(t)?function(e,t,n,r){const i=[];let o="";const a=c(e,0),s=c(t,0);return`${o}${a},${s}${n}`;function c(e,t=0){let n=""+e.target.id;for(const a of by(e)){if(262144&a.flags){if(r||FC(a)){let e=i.indexOf(a);e<0&&(e=i.length,i.push(a)),n+="="+e;continue}o="*"}else if(t<4&&EC(a)){n+="<"+c(a,t+1)+">";continue}n+="-"+a.id}return n}}(e,t,o,i):`${e.id},${t.id}${o}`}function AC(e,t){if(!(6&cx(e)))return t(e);for(const n of e.links.containingType.types){const r=Am(n,e.escapedName),i=r&&AC(r,t);if(i)return i}}function IC(e){return e.parent&&32&e.parent.flags?Ru(Cs(e)):void 0}function OC(e){const t=IC(e),n=t&&gu(t)[0];return n&&Zc(n,e.escapedName)}function LC(e,t,n){return AC(t,t=>!!(4&lx(t,n))&&!H_(e,IC(t)))?void 0:e}function jC(e,t,n,r=3){if(n>=r){if(96&~xx(e)||(e=MC(e)),2097152&e.flags)return H(e.types,e=>jC(e,t,n,r));const i=BC(e);let o=0,a=0;for(let e=0;e=a&&(o++,o>=r))return!0;a=n.id}}}return!1}function MC(e){let t;for(;!(96&~xx(e))&&(t=Np(e))&&(t.symbol||2097152&t.flags&&H(t.types,e=>!!e.symbol));)e=t;return e}function RC(e,t){return 96&~xx(e)||(e=MC(e)),2097152&e.flags?H(e.types,e=>RC(e,t)):BC(e)===t}function BC(e){if(524288&e.flags&&!ON(e)){if(4&xx(e)&&e.node)return e.node;if(e.symbol&&!(16&xx(e)&&32&e.symbol.flags))return e.symbol;if(fw(e))return e.target}if(262144&e.flags)return e.symbol;if(8388608&e.flags){do{e=e.objectType}while(8388608&e.flags);return e}return 16777216&e.flags?e.root:e}function JC(e,t){return 0!==zC(e,t,LS)}function zC(e,t,n){if(e===t)return-1;const r=6&lx(e);if(r!==(6&lx(t)))return 0;if(r){if(jJ(e)!==jJ(t))return 0}else if((16777216&e.flags)!=(16777216&t.flags))return 0;return Yj(e)!==Yj(t)?0:n(z_(e),z_(t))}function qC(e,t,n,r,i,o){if(e===t)return-1;if(!function(e,t,n){const r=gj(e),i=gj(t),o=hj(e),a=hj(t),s=yj(e),c=yj(t);return r===i&&o===a&&s===c||!!(n&&o<=a)}(e,t,n))return 0;if(d(e.typeParameters)!==d(t.typeParameters))return 0;if(t.typeParameters){const n=nS(e.typeParameters,t.typeParameters);for(let r=0;re|(1048576&t.flags?VC(t.types):t.flags),0)}function WC(e){if(1===e.length)return e[0];const t=$?I(e,e=>OF(e,e=>!(98304&e.flags))):e,n=function(e){let t;for(const n of e)if(!(131072&n.flags)){const e=cw(n);if(t??(t=e),e===n||e!==t)return!1}return!0}(t)?zb(t):function(e){const t=De(e,(e,t)=>BS(e,t)?t:e);return b(e,e=>e===t||BS(e,t))?t:De(e,(e,t)=>RS(e,t)?t:e)}(t);return t===e?n:Cw(n,98304&VC(e))}function $C(e){return!!(4&xx(e))&&(e.target===Zn||e.target===er)}function HC(e){return!!(4&xx(e))&&e.target===er}function KC(e){return $C(e)||fw(e)}function GC(e){return $C(e)&&!HC(e)||fw(e)&&!e.target.readonly}function XC(e){return $C(e)?by(e)[0]:void 0}function QC(e){return $C(e)||!(98304&e.flags)&&JS(e,_r)}function YC(e){return GC(e)||!(98305&e.flags)&&JS(e,cr)}function ZC(e){if(!(4&xx(e)&&3&xx(e.target)))return;if(33554432&xx(e))return 67108864&xx(e)?e.cachedEquivalentBaseType:void 0;e.objectFlags|=33554432;const t=e.target;if(1&xx(t)){const e=su(t);if(e&&80!==e.expression.kind&&212!==e.expression.kind)return}const n=gu(t);if(1!==n.length)return;if(Fd(e.symbol).size)return;let r=d(t.typeParameters)?CS(n[0],nS(t.typeParameters,by(e).slice(0,t.typeParameters.length))):n[0];return d(by(e))>d(t.typeParameters)&&(r=Id(r,xe(by(e)))),e.objectFlags|=67108864,e.cachedEquivalentBaseType=r}function ew(e){return $?e===dn:e===jt}function tw(e){const t=XC(e);return!!t&&ew(t)}function nw(e){let t;return fw(e)||!!Am(e,"0")||QC(e)&&!!(t=Zc(e,"length"))&&PF(t,e=>!!(256&e.flags))}function rw(e){return QC(e)||nw(e)}function iw(e){return!(240544&e.flags)}function ow(e){return!!(109472&e.flags)}function aw(e){const t=kf(e);return 2097152&t.flags?H(t.types,ow):ow(t)}function sw(e){return!!(16&e.flags)||(1048576&e.flags?!!(1024&e.flags)||b(e.types,ow):ow(e))}function cw(e){return 1056&e.flags?Su(e):402653312&e.flags?Ut:256&e.flags?Wt:2048&e.flags?$t:512&e.flags?on:1048576&e.flags?function(e){const t=`B${Ab(e)}`;return Io(t)??Oo(t,zF(e,cw))}(e):e}function lw(e){return 402653312&e.flags?Ut:288&e.flags?Wt:2048&e.flags?$t:512&e.flags?on:1048576&e.flags?zF(e,lw):e}function _w(e){return 1056&e.flags&&wk(e)?Su(e):128&e.flags&&wk(e)?Ut:256&e.flags&&wk(e)?Wt:2048&e.flags&&wk(e)?$t:512&e.flags&&wk(e)?on:1048576&e.flags?zF(e,_w):e}function uw(e){return 8192&e.flags?sn:1048576&e.flags?zF(e,uw):e}function dw(e,t){return FM(e,t)||(e=uw(_w(e))),kk(e)}function pw(e,t,n,r){if(e&&ow(e)){e=dw(e,t?YB(n,t,r):void 0)}return e}function fw(e){return!!(4&xx(e)&&8&e.target.objectFlags)}function mw(e){return fw(e)&&!!(8&e.target.combinedFlags)}function gw(e){return mw(e)&&1===e.target.elementFlags.length}function hw(e){return vw(e,e.target.fixedLength)}function yw(e,t,n){return zF(e,e=>{const r=e,i=hw(r);return i?n&&t>=Eb(r.target)?zb([i,n]):i:Lt})}function vw(e,t,n=0,r=!1,i=!1){const o=xy(e)-n;if(tlD(e,4194304))}function Tw(e){return 4&e.flags?Ji:8&e.flags?zi:64&e.flags?qi:e===Kt||e===Ht||114691&e.flags||128&e.flags&&""===e.value||256&e.flags&&0===e.value||2048&e.flags&&xw(e)?e:_n}function Cw(e,t){const n=t&~e.flags&98304;return 0===n?e:zb(32768===n?[e,Lt]:65536===n?[e,zt]:[e,Lt,zt])}function Nw(e,t=!1){pn.assert($);const n=t?Bt:Lt;return e===n||1048576&e.flags&&e.types[0]===n?e:zb([e,n])}function Dw(e){return $?fD(e,2097152):e}function Fw(e){return $?zb([e,Jt]):e}function Ew(e){return $?LF(e,Jt):e}function Pw(e,t,n){return n?Tl(t)?Nw(e):Fw(e):e}function Aw(e,t){return Sl(t)?Dw(e):xl(t)?Ew(e):e}function Iw(e,t){return se&&t?LF(e,Rt):e}function Ow(e){return e===Rt||!!(1048576&e.flags)&&e.types[0]===Rt}function Lw(e){return se?LF(e,Rt):pD(e,524288)}function jw(e){const t=xx(e);return 2097152&e.flags?b(e.types,jw):!(!(e.symbol&&7040&e.symbol.flags)||32&e.symbol.flags||Oz(e))||!!(4194304&t)||!!(1024&t&&jw(e.source))}function Rw(e,t){const n=Xo(e.flags,e.escapedName,8&cx(e));n.declarations=e.declarations,n.parent=e.parent,n.links.type=t,n.links.target=e,e.valueDeclaration&&(n.valueDeclaration=e.valueDeclaration);const r=_a(e).nameType;return r&&(n.links.nameType=r),n}function zw(e){if(!(IN(e)&&8192&xx(e)))return e;const t=e.regularType;if(t)return t;const n=e,r=function(e,t){const n=Zu();for(const r of Kp(e)){const e=z_(r),i=t(e);n.set(r.escapedName,i===e?r:Rw(r,i))}return n}(e,zw),i=Hs(n.symbol,r,n.callSignatures,n.constructSignatures,n.indexInfos);return i.flags=n.flags,i.objectFlags|=-8193&n.objectFlags,e.regularType=i,i}function qw(e,t,n){return{parent:e,propertyName:t,siblings:n,resolvedProperties:void 0}}function Vw(e){if(!e.siblings){const t=[];for(const n of Vw(e.parent))if(IN(n)){const r=Qp(n,e.propertyName);r&&wF(z_(r),e=>{t.push(e)})}e.siblings=t}return e.siblings}function Ww(e){if(!e.resolvedProperties){const t=new Map;for(const n of Vw(e))if(IN(n)&&!(2097152&xx(n)))for(const e of lf(n))t.set(e.escapedName,e);e.resolvedProperties=je(t.values())}return e.resolvedProperties}function $w(e,t){if(!(4&e.flags))return e;const n=z_(e),r=Gw(n,t&&qw(t,e.escapedName,void 0));return r===n?e:Rw(e,r)}function Hw(e){const t=yt.get(e.escapedName);if(t)return t;const n=Rw(e,Bt);return n.flags|=16777216,yt.set(e.escapedName,n),n}function Kw(e){return Gw(e,void 0)}function Gw(e,t){if(196608&xx(e)){if(void 0===t&&e.widened)return e.widened;let n;if(98305&e.flags)n=wt;else if(IN(e))n=function(e,t){const n=Zu();for(const r of Kp(e))n.set(r.escapedName,$w(r,t));if(t)for(const e of Ww(t))n.has(e.escapedName)||n.set(e.escapedName,Hw(e));const r=Hs(e.symbol,n,_,_,I(cg(e),e=>Qh(e.keyType,Kw(e.type),e.isReadonly,e.declaration,e.components)));return r.objectFlags|=266240&xx(e),r}(e,t);else if(1048576&e.flags){const r=t||qw(void 0,void 0,e.types),i=I(e.types,e=>98304&e.flags?e:Gw(e,r));n=zb(i,H(i,lT)?2:1)}else 2097152&e.flags?n=Gb(I(e.types,Kw)):KC(e)&&(n=hy(e.target,I(by(e),Kw)));return n&&void 0===t&&(e.widened=n),n||e}return e}function Xw(e){var t;let n=!1;if(65536&xx(e))if(1048576&e.flags)if(H(e.types,lT))n=!0;else for(const t of e.types)n||(n=Xw(t));else if(KC(e))for(const t of by(e))n||(n=Xw(t));else if(IN(e))for(const r of Kp(e)){const i=z_(r);if(65536&xx(i)&&(n=Xw(i),!n)){const o=null==(t=r.declarations)?void 0:t.find(t=>{var n;return(null==(n=t.symbol.valueDeclaration)?void 0:n.parent)===e.symbol.valueDeclaration});o&&(Jo(o,fa.Object_literal_s_property_0_implicitly_has_an_1_type,pc(r),Sc(Kw(i))),n=!0)}}return n}function Qw(e,t,n){const r=Sc(Kw(t));if(Om(e)&&!sT(Sd(e),j))return;let i;switch(e.kind){case 227:case 173:case 172:i=te?fa.Member_0_implicitly_has_an_1_type:fa.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 170:const t=e;if(uD(t.name)){const n=xc(t.name);if((BD(t.parent)||ID(t.parent)||VD(t.parent))&&t.parent.parameters.includes(t)&&(Ue(t,t.name.escapedText,788968,void 0,!0)||n&&Nx(n))){const n="arg"+t.parent.parameters.indexOf(t),r=jp(t.name)+(t.dotDotDotToken?"[]":"");return void Vo(te,e,fa.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,n,r)}}i=e.dotDotDotToken?te?fa.Rest_parameter_0_implicitly_has_an_any_type:fa.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:te?fa.Parameter_0_implicitly_has_an_1_type:fa.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 209:if(i=fa.Binding_element_0_implicitly_has_an_1_type,!te)return;break;case 318:return void Jo(e,fa.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,r);case 324:return void(te&&JP(e.parent)&&Jo(e.parent.tagName,fa.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation,r));case 263:case 175:case 174:case 178:case 179:case 219:case 220:if(te&&!e.name)return void Jo(e,3===n?fa.Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation:fa.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,r);i=te?3===n?fa._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:fa._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:fa._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;break;case 201:return void(te&&Jo(e,fa.Mapped_object_type_implicitly_has_an_any_template_type));default:i=te?fa.Variable_0_implicitly_has_an_1_type:fa.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage}Vo(te,e,i,jp(Fc(e)),r)}function Yw(e,t,n){a(()=>{te&&65536&xx(t)&&(!n||l_(e)&&function(e,t){const n=iI(e);if(!n)return!0;let r=gh(n);const i=Rh(e);switch(t){case 1:return 1&i?r=YB(1,r,!!(2&i))??r:2&i&&(r=wR(r)??r),Ox(r);case 3:const e=YB(0,r,!!(2&i));return!!e&&Ox(e);case 2:const t=YB(2,r,!!(2&i));return!!t&&Ox(t)}return!1}(e,n))&&(Xw(t)||Qw(e,t,n))})}function Zw(e,t,n){const r=gj(e),i=gj(t),o=vj(e),a=vj(t),s=a?i-1:i,c=o?s:Math.min(r,s),l=rh(e);if(l){const e=rh(t);e&&n(l,e)}for(let r=0;re.typeParameter),P(e.inferences,(t,n)=>()=>(t.isFixed||(!function(e){if(e.intraExpressionInferenceSites){for(const{node:t,type:n}of e.intraExpressionInferenceSites){const r=175===t.kind?jA(t,2):$A(t,2);r&&EN(e.inferences,n,r)}e.intraExpressionInferenceSites=void 0}}(e),aN(e.inferences),t.isFixed=!0),MN(e,n))))}(i),i.nonFixingMapper=function(e){return sS(P(e.inferences,e=>e.typeParameter),P(e.inferences,(t,n)=>()=>MN(e,n)))}(i),i}function aN(e){for(const t of e)t.isFixed||(t.inferredType=void 0)}function sN(e,t,n){(e.intraExpressionInferenceSites??(e.intraExpressionInferenceSites=[])).push({node:t,type:n})}function lN(e){return{typeParameter:e,candidates:void 0,contraCandidates:void 0,inferredType:void 0,priority:void 0,topLevel:!0,isFixed:!1,impliedArity:void 0}}function _N(e){return{typeParameter:e.typeParameter,candidates:e.candidates&&e.candidates.slice(),contraCandidates:e.contraCandidates&&e.contraCandidates.slice(),inferredType:e.inferredType,priority:e.priority,topLevel:e.topLevel,isFixed:e.isFixed,impliedArity:e.impliedArity}}function uN(e){return e&&e.mapper}function dN(e){const t=xx(e);if(524288&t)return!!(1048576&t);const n=!!(465829888&e.flags||524288&e.flags&&!pN(e)&&(4&t&&(e.node||H(by(e),dN))||16&t&&e.symbol&&14384&e.symbol.flags&&e.symbol.declarations||12583968&t)||3145728&e.flags&&!(1024&e.flags)&&!pN(e)&&H(e.types,dN));return 3899393&e.flags&&(e.objectFlags|=524288|(n?1048576:0)),n}function pN(e){if(e.aliasSymbol&&!e.aliasTypeArguments){const t=Qu(e.aliasSymbol,266);return!(!t||!mc(t.parent,e=>308===e.kind||268!==e.kind&&"quit"))}return!1}function fN(e,t,n=0){return!!(e===t||3145728&e.flags&&H(e.types,e=>fN(e,t,n))||n<3&&16777216&e.flags&&(fN(Zx(e),t,n+1)||fN(rk(e),t,n+1)))}function mN(e,t,n){const r=e.id+","+t.id+","+n.id;if(xi.has(r))return xi.get(r);const i=function(e,t,n){if(!(lg(e,Ut)||0!==lf(e).length&&gN(e)))return;if($C(e)){const r=hN(by(e)[0],t,n);if(!r)return;return Kv(r,HC(e))}if(fw(e)){const r=P(Pb(e),e=>hN(e,t,n));if(!b(r,e=>!!e))return;return kb(r,4&Dp(t)?I(e.target.elementFlags,e=>2&e?1:e):e.target.elementFlags,e.target.readonly,e.target.labeledElementDeclarations)}const r=zs(1040,void 0);return r.source=e,r.mappedType=t,r.constraintType=n,r}(e,t,n);return xi.set(r,i),i}function gN(e){return!(262144&xx(e))||IN(e)&&H(lf(e),e=>gN(z_(e)))||fw(e)&&H(Pb(e),gN)}function hN(e,t,n){const r=e.id+","+t.id+","+n.id;if(bi.has(r))return bi.get(r)||Ot;fo.push(e),mo.push(t);const i=go;let o;return jC(e,fo,fo.length,2)&&(go|=1),jC(t,mo,mo.length,2)&&(go|=2),3!==go&&(o=function(e,t,n){const r=Ux(n.type,vp(t)),i=Tp(t),o=lN(r);return EN([o],e,i),bN(o)||Ot}(e,t,n)),fo.pop(),mo.pop(),go=i,bi.set(r,o),o}function*yN(e,t,n,r){const i=lf(t);for(const t of i)if(!od(t)&&(n||!(16777216&t.flags||48&cx(t)))){const n=Am(e,t.escapedName);if(n){if(r){const e=z_(t);if(109472&e.flags){const r=z_(n);1&r.flags||kk(r)===kk(e)||(yield t)}}}else yield t}}function vN(e,t,n,r){return he(yN(e,t,n,r))}function bN(e){return e.candidates?zb(e.candidates,2):e.contraCandidates?Gb(e.contraCandidates):void 0}function xN(e){return!!ua(e).skipDirectInference}function kN(e){return!(!e.symbol||!H(e.symbol.declarations,xN))}function SN(e,t){if(""===e)return!1;const n=+e;return isFinite(n)&&(!t||""+n===e)}function TN(e){return Lk(ST(e))}function CN(e,t){if(1&t.flags)return!0;if(134217732&t.flags)return JS(e,t);if(268435456&t.flags){const n=[];for(;268435456&t.flags;)n.unshift(t.symbol),t=t.type;return De(n,(e,t)=>hx(t,e),e)===e&&CN(e,t)}return!1}function wN(e,t){if(2097152&t.flags)return b(t.types,t=>t===Pn||wN(e,t));if(4&t.flags||JS(e,t))return!0;if(128&e.flags){const n=e.value;return!!(8&t.flags&&SN(n,!1)||64&t.flags&&TT(n,!1)||98816&t.flags&&n===t.intrinsicName||268435456&t.flags&&CN(e,t)||134217728&t.flags&&DN(e,t))}if(134217728&e.flags){const n=e.texts;return 2===n.length&&""===n[0]&&""===n[1]&&JS(e.types[0],t)}return!1}function NN(e,t){return 128&e.flags?FN([e.value],_,t):134217728&e.flags?re(e.texts,t.texts)?P(e.types,(e,n)=>{return JS(kf(e),kf(t.types[n]))?e:402653317&(r=e).flags?r:mx(["",""],[r]);var r}):FN(e.texts,e.types,t):void 0}function DN(e,t){const n=NN(e,t);return!!n&&b(n,(e,n)=>wN(e,t.types[n]))}function FN(e,t,n){const r=e.length-1,i=e[0],o=e[r],a=n.texts,s=a.length-1,c=a[0],l=a[s];if(0===r&&i.length0){let t=d,r=p;for(;r=f(t).indexOf(n,r),!(r>=0);){if(t++,t===e.length)return;r=0}m(t,r),p+=n.length}else if(p{if(!(128&e.flags))return;const n=yc(e.value),r=Xo(4,n);r.links.type=wt,e.symbol&&(r.declarations=e.symbol.declarations,r.valueDeclaration=e.symbol.valueDeclaration),t.set(n,r)});const n=4&e.flags?[Qh(Ut,Nn,!1)]:_;return Hs(void 0,t,_,_,n)}(t),a.type,256)}else if(8388608&t.flags&&8388608&a.flags)p(t.objectType,a.objectType),p(t.indexType,a.indexType);else if(268435456&t.flags&&268435456&a.flags)t.symbol===a.symbol&&p(t.type,a.type);else if(33554432&t.flags)p(t.baseType,a),f(My(t),a,4);else if(16777216&a.flags)m(t,a,w);else if(3145728&a.flags)S(t,a.types,a.flags);else if(1048576&t.flags){const e=t.types;for(const t of e)p(t,a)}else if(134217728&a.flags)!function(e,t){const n=NN(e,t),r=t.types;if(n||b(t.texts,e=>0===e.length))for(let e=0;ee|t.flags,0);if(!(4&r)){const n=t.value;296&r&&!SN(n,!0)&&(r&=-297),2112&r&&!TT(n,!0)&&(r&=-2113);const o=De(e,(e,i)=>i.flags&r?4&e.flags?e:4&i.flags?t:134217728&e.flags?e:134217728&i.flags&&DN(t,i)?t:268435456&e.flags?e:268435456&i.flags&&n===yx(i.symbol,n)?t:128&e.flags?e:128&i.flags&&i.value===n?i:8&e.flags?e:8&i.flags?Pk(+n):32&e.flags?e:32&i.flags?Pk(+n):256&e.flags?e:256&i.flags&&i.value===+n?i:64&e.flags?e:64&i.flags?TN(n):2048&e.flags?e:2048&i.flags&&xT(i.value)===n?i:16&e.flags?e:16&i.flags?"true"===n?Gt:"false"===n?Ht:on:512&e.flags?e:512&i.flags&&i.intrinsicName===n?i:32768&e.flags?e:32768&i.flags&&i.intrinsicName===n?i:65536&e.flags?e:65536&i.flags&&i.intrinsicName===n?i:e:e,_n);if(!(131072&o.flags)){p(o,i);continue}}}}p(t,i)}}(t,a);else{if(Bp(t=Qf(t))&&Bp(a)&&m(t,a,N),!(512&r&&467927040&t.flags)){const e=qf(t);if(e!==t&&!(2621440&e.flags))return p(e,a);t=e}2621440&t.flags&&m(t,a,F)}else h(by(t),by(a),_C(t.target))}}}function f(e,t,n){const i=r;r|=n,p(e,t),r=i}function m(e,t,n){const r=e.id+","+t.id,i=a&&a.get(r);if(void 0!==i)return void(u=Math.min(u,i));(a||(a=new Map)).set(r,-1);const o=u;u=2048;const l=d;(s??(s=[])).push(e),(c??(c=[])).push(t),jC(e,s,s.length,2)&&(d|=1),jC(t,c,c.length,2)&&(d|=2),3!==d?n(e,t):u=-1,c.pop(),s.pop(),d=l,a.set(r,u),u=Math.min(u,o)}function g(e,t,n){let r,i;for(const o of t)for(const t of e)n(t,o)&&(p(t,o),r=ue(r,t),i=ue(i,o));return[r?D(e,e=>!C(r,e)):e,i?D(t,e=>!C(i,e)):t]}function h(e,t,n){const r=e.length!!k(e));if(!e||t&&e!==t)return;t=e}return t}(t);return void(n&&f(e,n,1))}if(1===i&&!s){const e=L(o,(e,t)=>a[t]?void 0:e);if(e.length)return void p(zb(e),n)}}else for(const n of t)k(n)?i++:p(e,n);if(2097152&n?1===i:i>0)for(const n of t)k(n)&&f(e,n,1)}function T(e,t,n){if(1048576&n.flags||2097152&n.flags){let r=!1;for(const i of n.types)r=T(e,t,i)||r;return r}if(4194304&n.flags){const r=k(n.type);if(r&&!r.isFixed&&!kN(e)){const i=mN(e,t,n);i&&f(i,r.typeParameter,262144&xx(e)?16:8)}return!0}if(262144&n.flags){f(_x(e,e.pattern?2:0),n,32);const r=_f(n);if(r&&T(e,t,r))return!0;return p(zb(G(P(lf(e),z_),P(cg(e),e=>e!==ui?e.type:_n))),Tp(t)),!0}return!1}function w(e,t){if(16777216&e.flags)p(e.checkType,t.checkType),p(e.extendsType,t.extendsType),p(Zx(e),Zx(t)),p(rk(e),rk(t));else{!function(e,t,n,i){const o=r;r|=i,S(e,t,n),r=o}(e,[Zx(t),rk(t)],t.flags,i?64:0)}}function N(e,t){p(kp(e),kp(t)),p(Tp(e),Tp(t));const n=Sp(e),r=Sp(t);n&&r&&p(n,r)}function F(e,t){var n,r;if(4&xx(e)&&4&xx(t)&&(e.target===t.target||$C(e)&&$C(t)))h(by(e),by(t),_C(e.target));else{if(Bp(e)&&Bp(t)&&N(e,t),32&xx(t)&&!t.declaration.nameType){if(T(e,t,kp(t)))return}if(!function(e,t){return fw(e)&&fw(t)?function(e,t){return!(8&t.target.combinedFlags)&&t.target.minLength>e.target.minLength||!(12&t.target.combinedFlags)&&(!!(12&e.target.combinedFlags)||t.target.fixedLength(12&e)==(12&o.target.elementFlags[t])))){for(let t=0;t0){const e=Jm(t,n),o=e.length;for(let t=0;tRS(t,e)?t:e)}function jN(e,t){const n=function(e){if(e.length>1){const t=D(e,ON);if(t.length){const n=zb(t,2);return G(D(e,e=>!ON(e)),[n])}}return e}(e.candidates),r=function(e){const t=uf(e);return!!t&&oM(16777216&t.flags?hf(t):t,406978556)}(e.typeParameter)||df(e.typeParameter),i=!r&&e.topLevel&&(e.isFixed||!function(e,t){const n=oh(e);return n?!!n.type&&fN(n.type,t):fN(gh(e),t)}(t,e.typeParameter)),o=r?I(n,kk):i?I(n,_w):n;return Kw(416&e.priority?zb(o,2):WC(o))}function MN(e,t){const n=e.inferences[t];if(!n.inferredType){let r,i;if(e.signature){const o=n.candidates?jN(n,e.signature):void 0,a=n.contraCandidates?LN(n):void 0;if(o||a){const t=o&&(!a||!(131073&o.flags)&&H(n.contraCandidates,e=>JS(o,e))&&b(e.inferences,e=>e!==n&&uf(e.typeParameter)!==n.typeParameter||b(e.candidates,e=>JS(e,o))));r=t?o:a,i=t?a:o}else if(1&e.flags)r=un;else{const i=wf(n.typeParameter);i&&(r=CS(i,uS(function(e,t){const n=e.inferences.slice(t);return nS(P(n,e=>e.typeParameter),P(n,()=>Ot))}(e,t),e.nonFixingMapper)))}}else r=bN(n);n.inferredType=r||RN(!!(2&e.flags));const o=uf(n.typeParameter);if(o){const t=CS(o,e.nonFixingMapper);r&&e.compareTypes(r,Id(t,r))||(n.inferredType=i&&e.compareTypes(i,Id(t,i))?i:t)}!function(){for(let e=Bi-1;e>=0;e--)Ri[e].clear()}()}return n.inferredType}function RN(e){return e?wt:Ot}function BN(e){const t=[];for(let n=0;nyE(e)||vE(e)||HD(e)))}function UN(e,t,n,r){switch(e.kind){case 80:if(!mv(e)){const i=zN(e);return i!==bt?`${r?_J(r):"-1"}|${Ab(t)}|${Ab(n)}|${uJ(i)}`:void 0}case 110:return`0|${r?_J(r):"-1"}|${Ab(t)}|${Ab(n)}`;case 236:case 218:return UN(e.expression,t,n,r);case 167:const i=UN(e.left,t,n,r);return i&&`${i}.${e.right.escapedText}`;case 212:case 213:const o=WN(e);if(void 0!==o){const i=UN(e.expression,t,n,r);return i&&`${i}.${o}`}if(yF(e)&&uD(e.argumentExpression)){const i=zN(e.argumentExpression);if(nP(i)||iP(i)&&!zE(i)){const o=UN(e.expression,t,n,r);return o&&`${o}.@${uJ(i)}`}}break;case 207:case 208:case 263:case 219:case 220:case 175:return`${_J(e)}#${Ab(t)}`}}function VN(e,t){switch(t.kind){case 218:case 236:return VN(e,t.expression);case 227:return cb(t)&&VN(e,t.left)||AF(t)&&28===t.operatorToken.kind&&VN(e,t.right)}switch(e.kind){case 237:return 237===t.kind&&e.keywordToken===t.keywordToken&&e.name.escapedText===t.name.escapedText;case 80:case 81:return mv(e)?110===t.kind:80===t.kind&&zN(e)===zN(t)||(fE(t)||fF(t))&&As(zN(e))===Ss(t);case 110:return 110===t.kind;case 108:return 108===t.kind;case 236:case 218:case 239:return VN(e.expression,t);case 212:case 213:const n=WN(e);if(void 0!==n){const r=Dx(t)?WN(t):void 0;if(void 0!==r)return r===n&&VN(e.expression,t.expression)}if(yF(e)&&yF(t)&&uD(e.argumentExpression)&&uD(t.argumentExpression)){const n=zN(e.argumentExpression);if(n===zN(t.argumentExpression)&&(nP(n)||iP(n)&&!zE(n)))return VN(e.expression,t.expression)}break;case 167:return Dx(t)&&e.right.escapedText===WN(t)&&VN(e.left,t.expression);case 227:return AF(e)&&28===e.operatorToken.kind&&VN(e.right,t)}return!1}function WN(e){if(hF(e))return e.name.escapedText;if(yF(e))return Jh((t=e).argumentExpression)?yc(t.argumentExpression.text):ub(t.argumentExpression)?function(e){const t=ns(e,111551,!0);if(!t||!(nP(t)||8&t.flags))return;const n=t.valueDeclaration;if(void 0===n)return;const r=v_(n);if(r){const e=GN(r);if(void 0!==e)return e}if(Lu(n)&&pa(n,e)){const e=Km(n);if(e){const t=w_(n.parent)?Nl(n):qM(e);return t&&GN(t)}if(uP(n))return Jp(n.name)}}(t.argumentExpression):void 0;var t;if(fF(e)){const t=vl(e);return t?yc(t):void 0}return FD(e)?""+e.parent.parameters.indexOf(e):void 0}function GN(e){return 8192&e.flags?e.escapedName:384&e.flags?yc(""+e.value):void 0}function XN(e,t){for(;Dx(e);)if(VN(e=e.expression,t))return!0;return!1}function QN(e,t){for(;xl(e);)if(VN(e=e.expression,t))return!0;return!1}function YN(e,t){if(e&&1048576&e.flags){const n=Gf(e,t);if(n&&2&cx(n))return void 0===n.links.isDiscriminantProperty&&(n.links.isDiscriminantProperty=!(192&~n.links.checkFlags||Ox(z_(n)))),!!n.links.isDiscriminantProperty}return!1}function ZN(e,t){let n;for(const r of e)if(YN(t,r.escapedName)){if(n){n.push(r);continue}n=[r]}return n}function eD(e){const t=e.types;if(!(t.length<10||32768&xx(e)||N(t,e=>!!(59506688&e.flags))<10)){if(void 0===e.keyPropertyName){const n=p(t,e=>59506688&e.flags?p(lf(e),e=>ow(z_(e))?e.escapedName:void 0):void 0),r=n&&function(e,t){const n=new Map;let r=0;for(const i of e)if(61603840&i.flags){const e=Zc(i,t);if(e){if(!sw(e))return;let t=!1;wF(e,e=>{const r=Ab(kk(e)),o=n.get(r);o?o!==Ot&&(n.set(r,Ot),t=!0):n.set(r,i)}),t||r++}}return r>=10&&2*r>=e.length?n:void 0}(t,n);e.keyPropertyName=r?n:"",e.constituentMap=r}return e.keyPropertyName.length?e.keyPropertyName:void 0}}function tD(e,t){var n;const r=null==(n=e.constituentMap)?void 0:n.get(Ab(kk(t)));return r!==Ot?r:void 0}function nD(e,t){const n=eD(e),r=n&&Zc(t,n);return r&&tD(e,r)}function rD(e,t){return VN(e,t)||XN(e,t)}function iD(e,t){if(e.arguments)for(const n of e.arguments)if(rD(t,n)||QN(n,t))return!0;return!(212!==e.expression.kind||!rD(t,e.expression.expression))}function oD(e){return e.id<=0&&(e.id=tJ,tJ++),e.id}function aD(e,t){if(e===t)return e;if(131072&t.flags)return t;const n=`A${Ab(e)},${Ab(t)}`;return Io(n)??Oo(n,function(e,t){const n=OF(e,e=>function(e,t){if(!(1048576&e.flags))return JS(e,t);for(const n of e.types)if(JS(n,t))return!0;return!1}(t,e)),r=512&t.flags&&wk(t)?zF(n,xk):n;return JS(t,r)?r:e}(e,t))}function sD(e){if(256&xx(e))return!1;const t=Hp(e);return!!(t.callSignatures.length||t.constructSignatures.length||t.members.get("bind")&&RS(e,Xn))}function cD(e,t){return _D(e,t)&t}function lD(e,t){return 0!==cD(e,t)}function _D(e,t){467927040&e.flags&&(e=xf(e)||Ot);const n=e.flags;if(268435460&n)return $?16317953:16776705;if(134217856&n){const t=128&n&&""===e.value;return $?t?12123649:7929345:t?12582401:16776705}if(40&n)return $?16317698:16776450;if(256&n){const t=0===e.value;return $?t?12123394:7929090:t?12582146:16776450}if(64&n)return $?16317188:16775940;if(2048&n){const t=xw(e);return $?t?12122884:7928580:t?12581636:16775940}if(16&n)return $?16316168:16774920;if(528&n)return $?e===Ht||e===Kt?12121864:7927560:e===Ht||e===Kt?12580616:16774920;if(524288&n){return 0===(t&($?83427327:83886079))?0:16&xx(e)&&lT(e)?$?83427327:83886079:sD(e)?$?7880640:16728e3:$?7888800:16736160}return 16384&n?9830144:32768&n?26607360:65536&n?42917664:12288&n?$?7925520:16772880:67108864&n?$?7888800:16736160:131072&n?0:1048576&n?De(e.types,(e,n)=>e|_D(n,t),0):2097152&n?function(e,t){const n=oM(e,402784252);let r=0,i=134217727;for(const o of e.types)if(!(n&&524288&o.flags)){const e=_D(o,t);r|=e,i&=e}return 8256&r|134209471&i}(e,t):83886079}function pD(e,t){return OF(e,e=>lD(e,t))}function fD(e,t){const n=gD(pD($&&2&e.flags?In:e,t));if($)switch(t){case 524288:return mD(n,65536,131072,33554432,zt);case 1048576:return mD(n,131072,65536,16777216,Lt);case 2097152:case 4194304:return zF(n,e=>lD(e,262144)?function(e){return ur||(ur=Zy("NonNullable",524288,void 0)||bt),ur!==bt?Sy(ur,[e]):Gb([e,Nn])}(e):e)}return n}function mD(e,t,n,r,i){const o=cD(e,50528256);if(!(o&t))return e;const a=zb([Nn,i]);return zF(e,e=>lD(e,t)?Gb([e,o&r||!lD(e,n)?Nn:a]):e)}function gD(e){return e===In?Ot:e}function hD(e,t){return t?zb([dl(e),qM(t)]):e}function yD(e,t){var n;const r=rx(t);if(!dC(r))return Et;const i=pC(r);return Zc(e,i)||bD(null==(n=bg(e,i))?void 0:n.type)||Et}function vD(e,t){return PF(e,nw)&&function(e,t){const n=Zc(e,""+t);return n||(PF(e,fw)?yw(e,t,j.noUncheckedIndexedAccess?Lt:void 0):void 0)}(e,t)||bD(wB(65,e,Lt,void 0))||Et}function bD(e){return e&&j.noUncheckedIndexedAccess?zb([e,Rt]):e}function xD(e){return Kv(wB(65,e,Lt,void 0)||Et)}function SD(e){return 227===e.parent.kind&&e.parent.left===e||251===e.parent.kind&&e.parent.initializer===e}function CD(e){return yD(KD(e.parent),e.name)}function KD(e){const{parent:t}=e;switch(t.kind){case 250:return Ut;case 251:return CB(t)||Et;case 227:return function(e){return 210===e.parent.kind&&SD(e.parent)||304===e.parent.kind&&SD(e.parent.parent)?hD(KD(e),e.right):qM(e.right)}(t);case 221:return Lt;case 210:return function(e,t){return vD(KD(e),e.elements.indexOf(t))}(t,e);case 231:return function(e){return xD(KD(e.parent))}(t);case 304:return CD(t);case 305:return function(e){return hD(CD(e),e.objectAssignmentInitializer)}(t)}return Et}function ZD(e){return ua(e).resolvedType||qM(e)}function eF(e){return 261===e.kind?function(e){return e.initializer?ZD(e.initializer):250===e.parent.parent.kind?Ut:251===e.parent.parent.kind&&CB(e.parent.parent)||Et}(e):function(e){const t=e.parent,n=eF(t.parent);return hD(207===t.kind?yD(n,e.propertyName||e.name):e.dotDotDotToken?xD(n):vD(n,t.elements.indexOf(e)),e.initializer)}(e)}function nF(e){switch(e.kind){case 218:return nF(e.expression);case 227:switch(e.operatorToken.kind){case 64:case 76:case 77:case 78:return nF(e.left);case 28:return nF(e.right)}}return e}function iF(e){const{parent:t}=e;return 218===t.kind||227===t.kind&&64===t.operatorToken.kind&&t.left===e||227===t.kind&&28===t.operatorToken.kind&&t.right===e?iF(t):e}function sF(e){return 297===e.kind?kk(qM(e.expression)):_n}function _F(e){const t=ua(e);if(!t.switchTypes){t.switchTypes=[];for(const n of e.caseBlock.clauses)t.switchTypes.push(sF(n))}return t.switchTypes}function uF(e){if(H(e.caseBlock.clauses,e=>297===e.kind&&!Ju(e.expression)))return;const t=[];for(const n of e.caseBlock.clauses){const e=297===n.kind?n.expression.text:void 0;t.push(e&&!C(t,e)?e:void 0)}return t}function kF(e,t){return!!(e===t||131072&e.flags||1048576&t.flags&&function(e,t){if(1048576&e.flags){for(const n of e.types)if(!Ib(t.types,n))return!1;return!0}if(1056&e.flags&&Su(e)===t)return!0;return Ib(t.types,e)}(e,t))}function wF(e,t){return 1048576&e.flags?p(e.types,t):t(e)}function DF(e,t){return 1048576&e.flags?H(e.types,t):t(e)}function PF(e,t){return 1048576&e.flags?b(e.types,t):t(e)}function OF(e,t){if(1048576&e.flags){const n=e.types,r=D(n,t);if(r===n)return e;const i=e.origin;let o;if(i&&1048576&i.flags){const e=i.types,a=D(e,e=>!!(1048576&e.flags)||t(e));if(e.length-a.length===n.length-r.length){if(1===a.length)return a[0];o=Jb(1048576,a)}}return Vb(r,16809984&e.objectFlags,void 0,void 0,o)}return 131072&e.flags||t(e)?e:_n}function LF(e,t){return OF(e,e=>e!==t)}function JF(e){return 1048576&e.flags?e.types.length:1}function zF(e,t,n){if(131072&e.flags)return e;if(!(1048576&e.flags))return t(e);const r=e.origin,i=r&&1048576&r.flags?r.types:e.types;let o,a=!1;for(const e of i){const r=1048576&e.flags?zF(e,t,n):t(e);a||(a=e!==r),r&&(o?o.push(r):o=[r])}return a?o&&zb(o,n?0:1):e}function VF(e,t,n,r){return 1048576&e.flags&&n?zb(P(e.types,t),1,n,r):zF(e,t)}function WF(e,t){return OF(e,e=>0!==(e.flags&t))}function $F(e,t){return oM(e,134217804)&&oM(t,402655616)?zF(e,e=>4&e.flags?WF(t,402653316):Ax(e)&&!oM(t,402653188)?WF(t,128):8&e.flags?WF(t,264):64&e.flags?WF(t,2112):e):e}function KF(e){return 0===e.flags}function QF(e){return 0===e.flags?e.type:e}function eE(e,t){return t?{flags:0,type:131072&e.flags?un:e}:e}function tE(e){return gt[e.id]||(gt[e.id]=function(e){const t=zs(256);return t.elementType=e,t}(e))}function oE(e,t){const n=zw(cw(VM(t)));return kF(n,e.elementType)?e:tE(zb([e.elementType,n]))}function aE(e){return e.finalArrayType||(e.finalArrayType=131072&(t=e.elementType).flags?lr:Kv(1048576&t.flags?zb(t.types,2):t));var t}function sE(e){return 256&xx(e)?aE(e):e}function cE(e){return 256&xx(e)?e.elementType:_n}function lE(e){const t=iF(e),n=t.parent,r=hF(n)&&("length"===n.name.escapedText||214===n.parent.kind&&uD(n.name)&&ey(n.name)),i=213===n.kind&&n.expression===t&&227===n.parent.kind&&64===n.parent.operatorToken.kind&&n.parent.left===n&&!th(n.parent)&&aM(qM(n.argumentExpression),296);return r||i}function _E(e,t){if(8752&(e=$a(e)).flags)return z_(e);if(7&e.flags){if(262144&cx(e)){const t=e.links.syntheticOrigin;if(t&&_E(t))return z_(e)}const r=e.valueDeclaration;if(r){if((fE(n=r)||AD(n)||PD(n)||FD(n))&&(yv(n)||Om(n)&&Ou(n)&&n.initializer&&UT(n.initializer)&&bv(n.initializer)))return z_(e);if(fE(r)&&251===r.parent.parent.kind){const e=r.parent.parent,t=uE(e.expression,void 0);if(t){return wB(e.awaitModifier?15:13,t,Lt,void 0)}}t&&uT(t,qp(r,fa._0_needs_an_explicit_type_annotation,pc(e)))}}var n}function uE(e,t){if(!(67108864&e.flags))switch(e.kind){case 80:return _E(As(zN(e)),t);case 110:return function(e){const t=im(e,!1,!1);if(s_(t)){const e=zg(t);if(e.thisParameter)return _E(e.thisParameter)}if(m_(t.parent)){const e=Ss(t.parent);return Iv(t)?z_(e):Ru(e).thisType}}(e);case 108:return sA(e);case 212:{const n=uE(e.expression,t);if(n){const r=e.name;let i;if(dD(r)){if(!n.symbol)return;i=Am(n,Kh(n.symbol,r.escapedText))}else i=Am(n,r.escapedText);return i&&_E(i,t)}return}case 218:return uE(e.expression,t)}}function dE(e){const t=ua(e);let n=t.effectsSignature;if(void 0===n){let r;if(AF(e)){r=_M(ZI(e.right))}else 245===e.parent.kind?r=uE(e.expression,void 0):108!==e.expression.kind&&(r=xl(e)?sO(Aw(WM(e.expression),e.expression),e.expression):ZI(e.expression));const i=Jm(r&&qf(r)||Ot,0),o=1!==i.length||i[0].typeParameters?H(i,pE)?jL(e):void 0:i[0];n=t.effectsSignature=o&&pE(o)?o:ci}return n===ci?void 0:n}function pE(e){return!!(oh(e)||e.declaration&&131072&(Ch(e.declaration)||Ot).flags)}function SE(e){const t=FE(e,!1);return ti=e,ni=t,t}function DE(e){const t=_h(e,!0);return 97===t.kind||227===t.kind&&(56===t.operatorToken.kind&&(DE(t.left)||DE(t.right))||57===t.operatorToken.kind&&DE(t.left)&&DE(t.right))}function FE(e,t){for(;;){if(e===ti)return ni;const n=e.flags;if(4096&n){if(!t){const t=oD(e),n=oo[t];return void 0!==n?n:oo[t]=FE(e,!0)}t=!1}if(368&n)e=e.antecedent;else if(512&n){const t=dE(e.node);if(t){const n=oh(t);if(n&&3===n.kind&&!n.type){const t=e.node.arguments[n.parameterIndex];if(t&&DE(t))return!1}if(131072&gh(t).flags)return!1}e=e.antecedent}else{if(4&n)return H(e.antecedent,e=>FE(e,!1));if(8&n){const t=e.antecedent;if(void 0===t||0===t.length)return!1;e=t[0]}else{if(!(128&n)){if(1024&n){ti=void 0;const t=e.node.target,n=t.antecedent;t.antecedent=e.node.antecedents;const r=FE(e.antecedent,!1);return t.antecedent=n,r}return!(1&n)}{const t=e.node;if(t.clauseStart===t.clauseEnd&&Wj(t.switchStatement))return!1;e=e.antecedent}}}}}function EE(e,t){for(;;){const n=e.flags;if(4096&n){if(!t){const t=oD(e),n=ao[t];return void 0!==n?n:ao[t]=EE(e,!0)}t=!1}if(496&n)e=e.antecedent;else if(512&n){if(108===e.node.expression.kind)return!0;e=e.antecedent}else{if(4&n)return b(e.antecedent,e=>EE(e,!1));if(!(8&n)){if(1024&n){const t=e.node.target,n=t.antecedent;t.antecedent=e.node.antecedents;const r=EE(e.antecedent,!1);return t.antecedent=n,r}return!!(1&n)}e=e.antecedent[0]}}}function AE(e){switch(e.kind){case 110:return!0;case 80:if(!mv(e)){const t=zN(e);return nP(t)||iP(t)&&!zE(t)||!!t.valueDeclaration&&TF(t.valueDeclaration)}break;case 212:case 213:return AE(e.expression)&&Yj(ua(e).resolvedSymbol||bt);case 207:case 208:const t=ny(e.parent);return FD(t)||qT(t)?!UE(t):fE(t)&&tU(t)}return!1}function IE(e,t,n=t,r,i=(t=>null==(t=rt(e,Rg))?void 0:t.flowNode)()){let o,a=!1,s=0;if(wi)return Et;if(!i)return t;Ni++;const c=Ci,l=QF(d(i));Ci=c;const _=256&xx(l)&&lE(e)?lr:sE(l);return _===fn||e.parent&&236===e.parent.kind&&!(131072&_.flags)&&131072&pD(_,2097152).flags?t:_;function u(){return a?o:(a=!0,o=UN(e,t,n,r))}function d(i){var o;if(2e3===s)return null==(o=Gn)||o.instant(Gn.Phase.CheckTypes,"getTypeAtFlowNode_DepthLimit",{flowId:i.id}),wi=!0,function(e){const t=mc(e,p_),n=Sd(e),r=Zp(n,t.statements.pos);ho.add(ek(n,r.start,r.length,fa.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis))}(e),Et;let a;for(s++;;){const o=i.flags;if(4096&o){for(let e=c;e=0&&n.parameterIndex298===e.kind);if(n===r||o>=n&&ocD(e,t)===t)}return zb(P(i.slice(n,r),t=>t?V(e,t):_n))}(i,t.node);else if(112===n.kind)i=function(e,{switchStatement:t,clauseStart:n,clauseEnd:r}){const i=S(t.caseBlock.clauses,e=>298===e.kind),o=n===r||i>=n&&i297===t.kind?Y(e,t.expression,!0):_n))}(i,t.node);else{$&&(QN(n,e)?i=q(i,t.node,e=>!(163840&e.flags)):222===n.kind&&QN(n.expression,e)&&(i=q(i,t.node,e=>!(131072&e.flags||128&e.flags&&"undefined"===e.value))));const r=D(n,i);r&&(i=function(e,t,n){if(n.clauseStarttD(e,t)||Ot));if(t!==Ot)return t}return F(e,t,e=>U(e,n))}(i,r,t.node))}return eE(i,KF(r))}function T(e){const r=[];let i,o=!1,a=!1;for(const s of e.antecedent){if(!i&&128&s.flags&&s.node.clauseStart===s.node.clauseEnd){i=s;continue}const e=d(s),c=QF(e);if(c===t&&t===n)return c;_e(r,c),kF(c,n)||(o=!0),KF(e)&&(a=!0)}if(i){const e=d(i),s=QF(e);if(!(131072&s.flags||C(r,s)||Wj(i.node.switchStatement))){if(s===t&&t===n)return s;r.push(s),kF(s,n)||(o=!0),KF(e)&&(a=!0)}}return eE(N(r,o?2:1),a)}function w(e){const r=oD(e),i=Zi[r]||(Zi[r]=new Map),o=u();if(!o)return t;const a=i.get(o);if(a)return a;for(let t=Si;t{const t=nl(e,r)||Ot;return!(131072&t.flags)&&!(131072&s.flags)&&US(s,t)})}function E(e,t,n,r,i){if((37===n||38===n)&&1048576&e.flags){const o=eD(e);if(o&&o===WN(t)){const t=tD(e,qM(r));if(t)return n===(i?37:38)?t:ow(Zc(t,o)||Ot)?LF(e,t):e}}return F(e,t,e=>B(e,n,r,i))}function A(t,n,r){if(VN(e,n))return fD(t,r?4194304:8388608);$&&r&&QN(n,e)&&(t=fD(t,2097152));const i=D(n,t);return i?F(t,i,e=>pD(e,r?4194304:8388608)):t}function O(e,t,n){const r=Am(e,t);return r?!!(16777216&r.flags||48&cx(r))||n:!!bg(e,t)||!n}function L(e,t,n){const r=pC(t);if(DF(e,e=>O(e,r,!0)))return OF(e,e=>O(e,r,n));if(n){const n=($r||($r=Yy("Record",2,!0)||bt),$r===bt?void 0:$r);if(n)return Gb([e,Sy(n,[t,Ot])])}return e}function j(e,t,n,r,i){return Y(e,t,i=i!==(112===n.kind)!=(38!==r&&36!==r))}function M(t,n,r){switch(n.operatorToken.kind){case 64:case 76:case 77:case 78:return A(Y(t,n.right,r),n.left,r);case 35:case 36:case 37:case 38:const i=n.operatorToken.kind,o=nF(n.left),a=nF(n.right);if(222===o.kind&&Ju(a))return J(t,o,i,a,r);if(222===a.kind&&Ju(o))return J(t,a,i,o,r);if(VN(e,o))return B(t,i,a,r);if(VN(e,a))return B(t,i,o,r);$&&(QN(o,e)?t=R(t,i,a,r):QN(a,e)&&(t=R(t,i,o,r)));const s=D(o,t);if(s)return E(t,s,i,a,r);const c=D(a,t);if(c)return E(t,c,i,o,r);if(H(o))return K(t,i,a,r);if(H(a))return K(t,i,o,r);if(__(a)&&!Dx(o))return j(t,o,a,i,r);if(__(o)&&!Dx(a))return j(t,a,o,i,r);break;case 104:return function(t,n,r){const i=nF(n.left);if(!VN(e,i))return r&&$&&QN(i,e)?fD(t,2097152):t;const o=n.right,a=qM(o);if(!zS(a,Kn))return t;const s=dE(n),c=s&&oh(s);if(c&&1===c.kind&&0===c.parameterIndex)return X(t,c.type,r,!0);if(!zS(a,Xn))return t;const l=zF(a,G);if(rl(t)&&(l===Kn||l===Xn)||!r&&(!(524288&l.flags)||_T(l)))return t;return X(t,l,r,!0)}(t,n,r);case 103:if(dD(n.left))return function(t,n,r){const i=nF(n.right);if(!VN(e,i))return t;pn.assertNode(n.left,dD);const o=gO(n.left);if(void 0===o)return t;const a=o.parent,s=Ov(pn.checkDefined(o.valueDeclaration,"should always have a declaration"))?z_(a):Ru(a);return X(t,s,r,!0)}(t,n,r);const l=nF(n.right);if(Ow(t)&&Dx(e)&&VN(e.expression,l)){const i=qM(n.left);if(dC(i)&&WN(e)===pC(i))return pD(t,r?524288:65536)}if(VN(e,l)){const e=qM(n.left);if(dC(e))return L(t,e,r)}break;case 28:return Y(t,n.right,r);case 56:return r?Y(Y(t,n.left,!0),n.right,!0):zb([Y(t,n.left,!1),Y(t,n.right,!1)]);case 57:return r?zb([Y(t,n.left,!0),Y(t,n.right,!0)]):Y(Y(t,n.left,!1),n.right,!1)}return t}function R(e,t,n,r){const i=35===t||37===t,o=35===t||36===t?98304:32768,a=qM(n);return i!==r&&PF(a,e=>!!(e.flags&o))||i===r&&PF(a,e=>!(e.flags&(3|o)))?fD(e,2097152):e}function B(e,t,n,r){if(1&e.flags)return e;36!==t&&38!==t||(r=!r);const i=qM(n),o=35===t||36===t;if(98304&i.flags){if(!$)return e;return fD(e,o?r?262144:2097152:65536&i.flags?r?131072:1048576:r?65536:524288)}if(r){if(!o&&(2&e.flags||DF(e,_T))){if(469893116&i.flags||_T(i))return i;if(524288&i.flags)return mn}return $F(OF(e,e=>{return US(e,i)||o&&(t=i,!!(524&e.flags)&&!!(28&t.flags));var t}),i)}return ow(i)?OF(e,e=>!(aw(e)&&US(e,i))):e}function J(t,n,r,i,o){36!==r&&38!==r||(o=!o);const a=nF(n.expression);if(!VN(e,a)){$&&QN(a,e)&&o===("undefined"!==i.text)&&(t=fD(t,2097152));const n=D(a,t);return n?F(t,n,e=>z(e,i,o)):t}return z(t,i,o)}function z(e,t,n){return n?V(e,t.text):fD(e,rJ.get(t.text)||32768)}function q(e,{switchStatement:t,clauseStart:n,clauseEnd:r},i){return n!==r&&b(_F(t).slice(n,r),i)?pD(e,2097152):e}function U(e,{switchStatement:t,clauseStart:n,clauseEnd:r}){const i=_F(t);if(!i.length)return e;const o=i.slice(n,r),a=n===r||C(o,_n);if(2&e.flags&&!a){let t;for(let n=0;nUS(s,e)),s);if(!a)return c;const l=OF(e,e=>!(aw(e)&&C(i,32768&e.flags?Lt:kk(function(e){return 2097152&e.flags&&x(e.types,ow)||e}(e)))));return 131072&c.flags?l:zb([c,l])}function V(e,t){switch(t){case"string":return W(e,Ut,1);case"number":return W(e,Wt,2);case"bigint":return W(e,$t,4);case"boolean":return W(e,on,8);case"symbol":return W(e,sn,16);case"object":return 1&e.flags?e:zb([W(e,mn,32),W(e,zt,131072)]);case"function":return 1&e.flags?e:W(e,Xn,64);case"undefined":return W(e,Lt,65536)}return W(e,mn,128)}function W(e,t,n){return zF(e,e=>DT(e,t,xo)?lD(e,n)?e:_n:RS(t,e)?t:lD(e,n)?Gb([e,t]):_n)}function H(t){return(hF(t)&&"constructor"===bc(t.name)||yF(t)&&Ju(t.argumentExpression)&&"constructor"===t.argumentExpression.text)&&VN(e,t.expression)}function K(e,t,n,r){if(r?35!==t&&37!==t:36!==t&&38!==t)return e;const i=qM(n);if(!tq(i)&&!au(i))return e;const o=Am(i,"prototype");if(!o)return e;const a=z_(o),s=rl(a)?void 0:a;return s&&s!==Kn&&s!==Xn?rl(e)?s:OF(e,e=>function(e,t){if(524288&e.flags&&1&xx(e)||524288&t.flags&&1&xx(t))return e.symbol===t.symbol;return RS(e,t)}(e,s)):e}function G(e){const t=Zc(e,"prototype");if(t&&!rl(t))return t;const n=Jm(e,1);return n.length?zb(P(n,e=>gh(Lh(e)))):Nn}function X(e,t,n,r){const i=1048576&e.flags?`N${Ab(e)},${Ab(t)},${(n?1:0)|(r?2:0)}`:void 0;return Io(i)??Oo(i,function(e,t,n,r){if(!n){if(e===t)return _n;if(r)return OF(e,e=>!zS(e,t));const n=X(e=2&e.flags?In:e,t,!0,!1);return gD(OF(e,e=>!kF(e,n)))}if(3&e.flags)return t;if(e===t)return t;const i=r?zS:RS,o=1048576&e.flags?eD(e):void 0,a=zF(t,t=>{const n=o&&Zc(t,o),a=zF(n&&tD(e,n)||e,r?e=>zS(e,t)?e:zS(t,e)?t:_n:e=>BS(e,t)?e:BS(t,e)?t:RS(e,t)?e:RS(t,e)?t:_n);return 131072&a.flags?zF(e,e=>oM(e,465829888)&&i(t,xf(e)||Ot)?Gb([e,t]):_n):a});return 131072&a.flags?RS(t,e)?t:JS(e,t)?e:JS(t,e)?t:Gb([e,t]):a}(e,t,n,r))}function Q(t,n,r,i){if(n.type&&(!rl(t)||n.type!==Kn&&n.type!==Xn)){const o=function(e,t){if(1===e.kind||3===e.kind)return t.arguments[e.parameterIndex];const n=_h(t.expression);return Dx(n)?_h(n.expression):void 0}(n,r);if(o){if(VN(e,o))return X(t,n.type,i,!1);$&&QN(o,e)&&(i&&!lD(n.type,65536)||!i&&PF(n.type,eO))&&(t=fD(t,2097152));const r=D(o,t);if(r)return F(t,r,e=>X(e,n.type,i,!1))}}return t}function Y(t,n,r){if(Sl(n)||AF(n.parent)&&(61===n.parent.operatorToken.kind||78===n.parent.operatorToken.kind)&&n.parent.left===n)return function(t,n,r){if(VN(e,n))return fD(t,r?2097152:262144);const i=D(n,t);if(i)return F(t,i,e=>pD(e,r?2097152:262144));return t}(t,n,r);switch(n.kind){case 80:if(!VN(e,n)&&v<5){const i=zN(n);if(nP(i)){const n=i.valueDeclaration;if(n&&fE(n)&&!n.type&&n.initializer&&AE(e)){v++;const e=Y(t,n.initializer,r);return v--,e}}}case 110:case 108:case 212:case 213:return A(t,n,r);case 214:return function(t,n,r){if(iD(n,e)){const e=r||!bl(n)?dE(n):void 0,i=e&&oh(e);if(i&&(0===i.kind||1===i.kind))return Q(t,i,n,r)}if(Ow(t)&&Dx(e)&&hF(n.expression)){const i=n.expression;if(VN(e.expression,nF(i.expression))&&uD(i.name)&&"hasOwnProperty"===i.name.escapedText&&1===n.arguments.length){const i=n.arguments[0];if(Ju(i)&&WN(e)===yc(i.text))return pD(t,r?524288:65536)}}return t}(t,n,r);case 218:case 236:case 239:return Y(t,n.expression,r);case 227:return M(t,n,r);case 225:if(54===n.operator)return Y(t,n.operand,!r)}return t}}function LE(e){return mc(e.parent,e=>s_(e)&&!lm(e)||269===e.kind||308===e.kind||173===e.kind)}function zE(e){return!qE(e,void 0)}function qE(e,t){const n=mc(e.valueDeclaration,GE);if(!n)return!1;const r=ua(n);return 131072&r.flags||(r.flags|=131072,mc(n.parent,e=>GE(e)&&!!(131072&ua(e).flags))||YE(n)),!e.lastAssignmentPos||t&&Math.abs(e.lastAssignmentPos)233!==e.kind&&VE(e.name))}function GE(e){return l_(e)||dP(e)}function YE(e){switch(e.kind){case 80:const t=eh(e);if(0!==t){const n=zN(e),r=1===t||void 0!==n.lastAssignmentPos&&n.lastAssignmentPos<0;if(iP(n)){if(void 0===n.lastAssignmentPos||Math.abs(n.lastAssignmentPos)!==Number.MAX_VALUE){const t=mc(e,GE),r=mc(n.valueDeclaration,GE);n.lastAssignmentPos=t===r?function(e,t){let n=e.pos;for(;e&&e.pos>t.pos;){switch(e.kind){case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 251:case 255:case 256:case 259:case 264:n=e.end}e=e.parent}return n}(e,n.valueDeclaration):Number.MAX_VALUE}r&&n.lastAssignmentPos>0&&(n.lastAssignmentPos*=-1)}}return;case 282:const n=e.parent.parent,r=e.propertyName||e.name;if(!e.isTypeOnly&&!n.isTypeOnly&&!n.moduleSpecifier&&11!==r.kind){const e=ns(r,111551,!0,!0);if(e&&iP(e)){const t=void 0!==e.lastAssignmentPos&&e.lastAssignmentPos<0?-1:1;e.lastAssignmentPos=t*Number.MAX_VALUE}}return;case 265:case 266:case 267:return}T_(e)||iO(e,YE)}function nP(e){return 3&e.flags&&!!(6&KI(e))}function iP(e){const t=e.valueDeclaration&&ny(e.valueDeclaration);return!!t&&(FD(t)||fE(t)&&(sP(t.parent)||oP(t)))}function oP(e){return!!(1&e.parent.flags)&&!(32&cc(e)||244===e.parent.parent.kind&&nf(e.parent.parent.parent))}function pP(e,t){const n=$&&170===t.kind&&t.initializer&&lD(e,16777216)&&!function(e){const t=ua(e);if(void 0===t.parameterInitializerContainsUndefined){if(!Hc(e,8))return I_(e.symbol),!0;const n=!!lD(CM(e,0),16777216);if(!Xc())return I_(e.symbol),!0;t.parameterInitializerContainsUndefined??(t.parameterInitializerContainsUndefined=n)}return t.parameterInitializerContainsUndefined}(t);return n?pD(e,524288):e}function hP(e){return 2097152&e.flags?H(e.types,hP):!!(465829888&e.flags&&1146880&kf(e).flags)}function yP(e){return 2097152&e.flags?H(e.types,yP):!(!(465829888&e.flags)||oM(kf(e),98304))}function vP(e,t,n){Ay(e)&&(e=e.baseType);const r=!(n&&2&n)&&DF(e,hP)&&(function(e,t){const n=t.parent;return 212===n.kind||167===n.kind||214===n.kind&&n.expression===t||215===n.kind&&n.expression===t||213===n.kind&&n.expression===t&&!(DF(e,yP)&&jx(qM(n.argumentExpression)))}(e,t)||function(e,t){const n=(uD(e)||hF(e)||yF(e))&&!((KE(e.parent)||HE(e.parent))&&e.parent.tagName===e)&&$A(e,t&&32&t?8:void 0);return n&&!Ox(n)}(t,n));return r?zF(e,kf):e}function bP(e){return!!mc(e,e=>{const t=e.parent;return void 0===t?"quit":ME(t)?t.expression===e&&ub(e):!!JE(t)&&(t.name===e||t.propertyName===e)})}function xP(e,t,n,r){if(Re&&(!(33554432&e.flags)||PD(e)||AD(e)))switch(t){case 1:return TP(e);case 2:return NP(e,n,r);case 3:return DP(e);case 4:return AP(e);case 5:return IP(e);case 6:return LP(e);case 7:return jP(e);case 8:return MP(e);case 0:if(uD(e)&&(Tm(e)||lP(e.parent)||CE(e.parent)&&e.parent.moduleReference===e)&&XP(e)){if(M_(e.parent)){if((hF(e.parent)?e.parent.expression:e.parent.left)!==e)return}return void TP(e)}if(M_(e)){let t=e;for(;M_(t);){if(Ef(t))return;t=t.parent}return NP(e)}if(ME(e))return DP(e);if(Tu(e)||QE(e))return AP(e);if(CE(e))return Pm(e)||KJ(e)?LP(e):void 0;if(JE(e))return jP(e);if((l_(e)||ID(e))&&IP(e),!j.emitDecoratorMetadata)return;if(!(PI(e)&&Jv(e)&&e.modifiers&&gm(B,e,e.parent,e.parent.parent)))return;return MP(e);default:pn.assertNever(t,`Unhandled reference hint: ${t}`)}}function TP(e){const t=zN(e);t&&t!==Ie&&t!==bt&&!mv(e)&&RP(t,e)}function NP(e,t,n){const r=hF(e)?e.expression:e.left;if(pv(r)||!uD(r))return;const i=zN(r);if(!i||i===bt)return;if(Nk(j)||Ok(j)&&bP(e))return void RP(i,e);const o=n||SM(r);if(rl(o)||o===un)return void RP(i,e);let a=t;if(!a&&!n){const t=hF(e)?e.name:e.right,n=dD(t)&&fO(t.escapedText,t),r=qf(0!==eh(e)||pO(e)?Kw(o):o);a=dD(t)?n&&hO(r,n)||void 0:Am(r,t.escapedText)}a&&(Vz(a)||8&a.flags&&307===e.parent.kind)||RP(i,e)}function DP(e){if(uD(e.expression)){const t=e.expression,n=As(ns(t,-1,!0,!0,e));n&&RP(n,t)}}function AP(e){if(!DI(e)){const t=ho&&2===j.jsx?fa.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found:void 0,n=jo(e),r=Tu(e)?e.tagName:e,i=1!==j.jsx&&3!==j.jsx;let o;if(QE(e)&&"null"===n||(o=Ue(r,n,i?111551:111167,t,!0)),o&&(o.isReferenced=-1,Re&&2097152&o.flags&&!Ya(o)&&BP(o)),QE(e)){const n=pq(Sd(e));if(n){const e=db(n).escapedText;Ue(r,e,i?111551:111167,t,!0)}}}}function IP(e){if(M<2&&2&Rh(e)){const n=bv(e);qP((t=n)&&fm(t),!1)}var t}function LP(e){Av(e,32)&&zP(e)}function jP(e){if(!e.parent.parent.moduleSpecifier&&!e.isTypeOnly&&!e.parent.parent.isTypeOnly){const t=e.propertyName||e.name;if(11===t.kind)return;const n=Ue(t,t.escapedText,2998271,void 0,!0);if(n&&(n===Ne||n===Fe||n.declarations&&nf(Qc(n.declarations[0]))));else{const r=n&&(2097152&n.flags?Ha(n):n);(!r||111551&Ga(r))&&(zP(e),TP(t))}return}}function MP(e){if(j.emitDecoratorMetadata){const t=x(e.modifiers,ED);if(!t)return;switch(hq(t,16),e.kind){case 264:const t=cv(e);if(t)for(const e of t.parameters)UP(OR(e));break;case 178:case 179:const n=178===e.kind?179:178,r=Qu(Ss(e),n);UP(x_(e)||r&&x_(r));break;case 175:for(const t of e.parameters)UP(OR(t));UP(bv(e));break;case 173:UP(yv(e));break;case 170:UP(OR(e));const i=e.parent;for(const e of i.parameters)UP(OR(e));UP(bv(i))}}}function RP(e,t){if(Re&&Va(e,111551)&&!fv(t)){const n=Ha(e);1160127&Ga(e,!0)&&(Nk(j)||Ok(j)&&bP(t)||!Vz(As(n)))&&BP(e)}}function BP(e){pn.assert(Re);const t=_a(e);if(!t.referenced){t.referenced=!0;const n=Ca(e);if(!n)return pn.fail();if(Pm(n)&&111551&Ga($a(e))){TP(db(n.moduleReference))}}}function zP(e){const t=Ss(e),n=Ha(t);if(n){(n===bt||111551&Ga(t,!0)&&!Vz(n))&&BP(t)}}function qP(e,t){if(!e)return;const n=db(e),r=2097152|(80===e.kind?788968:1920),i=Ue(n,n.escapedText,r,void 0,!0);if(i&&2097152&i.flags)if(Re&&Os(i)&&!Vz(Ha(i))&&!Ya(i))BP(i);else if(t&&Nk(j)&&Tk(j)>=5&&!Os(i)&&!H(i.declarations,Wl)){const t=Jo(e,fa.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled),r=x(i.declarations||_,wa);r&&uT(t,qp(r,fa._0_was_imported_here,bc(n)))}}function UP(e){const t=AR(e);t&&i_(t)&&qP(t,!0)}function WP(e,t){if(mv(e))return;if(t===Ie){if(TO(e,!0))return void Jo(e,fa.arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks);let t=Yf(e);if(t)for(M<2&&(220===t.kind?Jo(e,fa.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression):Av(t,1024)&&Jo(e,fa.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method)),ua(t).flags|=512;t&&CF(t);)t=Yf(t),t&&(ua(t).flags|=512);return}const n=As(t),r=QJ(n,e);Ho(r)&&Cx(e,r)&&r.declarations&&Go(e,r.declarations,e.escapedText);const i=n.valueDeclaration;if(i&&32&n.flags&&m_(i)&&i.name!==e){let t=im(e,!1,!1);for(;308!==t.kind&&t.parent!==i;)t=im(t,!1,!1);308!==t.kind&&(ua(i).flags|=262144,ua(t).flags|=262144,ua(e).flags|=536870912)}!function(e,t){if(M>=2||!(34&t.flags)||!t.valueDeclaration||dP(t.valueDeclaration)||300===t.valueDeclaration.parent.kind)return;const n=Op(t.valueDeclaration),r=function(e,t){return!!mc(e,e=>e===t?"quit":s_(e)||e.parent&&AD(e.parent)&&!Ov(e.parent)&&e.parent.initializer===e)}(e,n),i=YP(n);if(i){if(r){let r=!0;if(nE(n)){const i=Dh(t.valueDeclaration,262);if(i&&i.parent===n){const i=function(e,t){return mc(e,e=>e===t?"quit":e===t.initializer||e===t.condition||e===t.incrementor||e===t.statement)}(e.parent,n);if(i){const e=ua(i);e.flags|=8192;_e(e.capturedBlockScopeBindings||(e.capturedBlockScopeBindings=[]),t),i===n.initializer&&(r=!1)}}}r&&(ua(i).flags|=4096)}if(nE(n)){const r=Dh(t.valueDeclaration,262);r&&r.parent===n&&function(e,t){let n=e;for(;218===n.parent.kind;)n=n.parent;let r=!1;if(th(n))r=!0;else if(225===n.parent.kind||226===n.parent.kind){const e=n.parent;r=46===e.operator||47===e.operator}if(!r)return!1;return!!mc(n,e=>e===t?"quit":e===t.statement)}(e,n)&&(ua(t.valueDeclaration).flags|=65536)}ua(t.valueDeclaration).flags|=32768}r&&(ua(t.valueDeclaration).flags|=16384)}(e,t)}function HP(e,t){if(mv(e))return oA(e);const n=zN(e);if(n===bt)return Et;if(WP(e,n),n===Ie)return TO(e)?Et:z_(n);XP(e)&&xP(e,1);const r=As(n);let i=r.valueDeclaration;const o=i;if(i&&209===i.kind&&C(Ii,i.parent)&&mc(e,e=>e===i.parent))return At;let a=function(e,t){var n;const r=z_(e),i=e.valueDeclaration;if(i){if(fF(i)&&!i.initializer&&!i.dotDotDotToken&&i.parent.elements.length>=2){const e=i.parent.parent,n=ny(e);if(261===n.kind&&6&eU(n)||170===n.kind){const r=ua(e);if(!(4194304&r.flags)){r.flags|=4194304;const o=sl(e,0),a=o&&zF(o,kf);if(r.flags&=-4194305,a&&1048576&a.flags&&(170!==n.kind||!UE(n))){const e=IE(i.parent,a,a,void 0,t.flowNode);return 131072&e.flags?_n:Dl(i,e,!0)}}}}if(FD(i)&&!i.type&&!i.initializer&&!i.dotDotDotToken){const e=i.parent;if(e.parameters.length>=2&&AS(e)){const r=oI(e);if(r&&1===r.parameters.length&&hJ(r)){const o=Uf(CS(z_(r.parameters[0]),null==(n=ZA(e))?void 0:n.nonFixingMapper));if(1048576&o.flags&&PF(o,fw)&&!H(e.parameters,UE))return Ux(IE(e,o,o,void 0,t.flowNode),Pk(e.parameters.indexOf(i)-(uv(e)?1:0)))}}}}return r}(r,e);const s=eh(e);if(s){if(!(3&r.flags||Om(e)&&512&r.flags)){return Jo(e,384&r.flags?fa.Cannot_assign_to_0_because_it_is_an_enum:32&r.flags?fa.Cannot_assign_to_0_because_it_is_a_class:1536&r.flags?fa.Cannot_assign_to_0_because_it_is_a_namespace:16&r.flags?fa.Cannot_assign_to_0_because_it_is_a_function:2097152&r.flags?fa.Cannot_assign_to_0_because_it_is_an_import:fa.Cannot_assign_to_0_because_it_is_not_a_variable,pc(n)),Et}if(Yj(r))return 3&r.flags?Jo(e,fa.Cannot_assign_to_0_because_it_is_a_constant,pc(n)):Jo(e,fa.Cannot_assign_to_0_because_it_is_a_read_only_property,pc(n)),Et}const c=2097152&r.flags;if(3&r.flags){if(1===s)return nh(e)?cw(a):a}else{if(!c)return a;i=Ca(n)}if(!i)return a;a=vP(a,e,t);const l=170===ny(i).kind,_=LE(i);let u=LE(e);const d=u!==_,p=e.parent&&e.parent.parent&&_P(e.parent)&&SD(e.parent.parent),f=134217728&n.flags,m=a===Nt||a===lr,g=m&&236===e.parent.kind;for(;u!==_&&(219===u.kind||220===u.kind||Wf(u))&&(nP(r)&&a!==lr||iP(r)&&qE(r,e));)u=LE(u);const h=o&&fE(o)&&!o.initializer&&!o.exclamationToken&&oP(o)&&!function(e){return(void 0!==e.lastAssignmentPos||zE(e)&&void 0!==e.lastAssignmentPos)&&e.lastAssignmentPos<0}(n),y=l||c||d&&!h||p||f||function(e,t){if(fF(t)){const n=mc(e,fF);return n&&ny(n)===ny(t)}}(e,i)||a!==Nt&&a!==lr&&(!$||!!(16387&a.flags)||fv(e)||qN(e)||282===e.parent.kind)||236===e.parent.kind||261===i.kind&&i.exclamationToken||33554432&i.flags,v=g?Lt:y?l?pP(a,i):a:m?Lt:Nw(a),b=g?Dw(IE(e,a,v,u)):IE(e,a,v,u);if(lE(e)||a!==Nt&&a!==lr){if(!y&&!gT(a)&&gT(b))return Jo(e,fa.Variable_0_is_used_before_being_assigned,pc(n)),a}else if(b===Nt||b===lr)return te&&(Jo(Fc(i),fa.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,pc(n),Sc(b)),Jo(e,fa.Variable_0_implicitly_has_an_1_type,pc(n),Sc(b))),_B(b);return s?cw(b):b}function XP(e){var t;const n=e.parent;if(n){if(hF(n)&&n.expression===e)return!1;if(JE(n)&&n.isTypeOnly)return!1;const r=null==(t=n.parent)?void 0:t.parent;if(r&&RE(r)&&r.isTypeOnly)return!1}return!0}function YP(e){return mc(e,e=>!e||ry(e)?"quit":X_(e,!1))}function eA(e,t){if(ua(e).flags|=2,173===t.kind||177===t.kind){ua(t.parent).flags|=4}else ua(t).flags|=4}function nA(e){return pf(e)?e:s_(e)?void 0:iO(e,nA)}function rA(e){return pu(Ru(Ss(e)))===qt}function iA(e,t,n){const r=t.parent;Sh(r)&&!rA(r)&&Rg(e)&&e.flowNode&&!EE(e.flowNode,!1)&&Jo(e,n)}function oA(e){const t=fv(e);let n=im(e,!0,!0),r=!1,i=!1;for(177===n.kind&&iA(e,n,fa.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);220===n.kind&&(n=im(n,!1,!i),r=!0),168===n.kind;)n=im(n,!r,!1),i=!0;if(function(e,t){AD(t)&&Ov(t)&&B&&t.initializer&&js(t.initializer,e.pos)&&Jv(t.parent)&&Jo(e,fa.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class)}(e,n),i)Jo(e,fa.this_cannot_be_referenced_in_a_computed_property_name);else switch(n.kind){case 268:Jo(e,fa.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 267:Jo(e,fa.this_cannot_be_referenced_in_current_location)}!t&&r&&M<2&&eA(e,n);const o=aA(e,!0,n);if(ne){const t=z_(Fe);if(o===t&&r)Jo(e,fa.The_containing_arrow_function_captures_the_global_value_of_this);else if(!o){const r=Jo(e,fa.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!dP(n)){const e=aA(n);e&&e!==t&&uT(r,qp(n,fa.An_outer_value_of_this_is_shadowed_by_this_container))}}}return o||wt}function aA(e,t=!0,n=im(e,!1,!1)){const r=Om(e);if(s_(n)&&(!gA(e)||uv(n))){let t=rh(zg(n))||r&&function(e){const t=tl(e);if(t&&t.typeExpression)return $k(t.typeExpression);const n=qg(e);if(n)return rh(n)}(n);if(!t){const e=function(e){if(219===e.kind&&AF(e.parent)&&3===og(e.parent))return e.parent.left.expression.expression;if(175===e.kind&&211===e.parent.kind&&AF(e.parent.parent)&&6===og(e.parent.parent))return e.parent.parent.left.expression;if(219===e.kind&&304===e.parent.kind&&211===e.parent.parent.kind&&AF(e.parent.parent.parent)&&6===og(e.parent.parent.parent))return e.parent.parent.parent.left.expression;if(219===e.kind&&cP(e.parent)&&uD(e.parent.name)&&("value"===e.parent.name.escapedText||"get"===e.parent.name.escapedText||"set"===e.parent.name.escapedText)&&gF(e.parent.parent)&&vF(e.parent.parent.parent)&&e.parent.parent.parent.arguments[2]===e.parent.parent&&9===og(e.parent.parent.parent))return e.parent.parent.parent.arguments[0].expression;if(OD(e)&&uD(e.name)&&("value"===e.name.escapedText||"get"===e.name.escapedText||"set"===e.name.escapedText)&&gF(e.parent)&&vF(e.parent.parent)&&e.parent.parent.arguments[2]===e.parent&&9===og(e.parent.parent))return e.parent.parent.arguments[0].expression}(n);if(r&&e){const n=WM(e).symbol;n&&n.members&&16&n.flags&&(t=Ru(n).thisType)}else ML(n)&&(t=Ru(ks(n.symbol)).thisType);t||(t=pA(n))}if(t)return IE(e,t)}if(m_(n.parent)){const t=Ss(n.parent);return IE(e,Iv(n)?z_(t):Ru(t).thisType)}if(dP(n)){if(n.commonJsModuleIndicator){const e=Ss(n);return e&&z_(e)}if(n.externalModuleIndicator)return Lt;if(t)return z_(Fe)}}function sA(e){const t=214===e.parent.kind&&e.parent.expression===e,n=cm(e,!0);let r=n,i=!1,o=!1;if(!t){for(;r&&220===r.kind;)Av(r,1024)&&(o=!0),r=cm(r,!0),i=M<2;r&&Av(r,1024)&&(o=!0)}let a=0;if(!r||!function(e){if(t)return 177===e.kind;if(m_(e.parent)||211===e.parent.kind)return Iv(e)?175===e.kind||174===e.kind||178===e.kind||179===e.kind||173===e.kind||176===e.kind:175===e.kind||174===e.kind||178===e.kind||179===e.kind||173===e.kind||172===e.kind||177===e.kind;return!1}(r)){const n=mc(e,e=>e===r?"quit":168===e.kind);return n&&168===n.kind?Jo(e,fa.super_cannot_be_referenced_in_a_computed_property_name):t?Jo(e,fa.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):r&&r.parent&&(m_(r.parent)||211===r.parent.kind)?Jo(e,fa.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class):Jo(e,fa.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions),Et}if(t||177!==n.kind||iA(e,r,fa.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class),Iv(r)||t?(a=32,!t&&M>=2&&M<=8&&(AD(r)||LD(r))&&Lp(e.parent,e=>{dP(e)&&!rf(e)||(ua(e).flags|=2097152)})):a=16,ua(e).flags|=a,175===r.kind&&o&&(_m(e.parent)&&th(e.parent)?ua(r).flags|=256:ua(r).flags|=128),i&&eA(e.parent,r),211===r.parent.kind)return M<2?(Jo(e,fa.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),Et):wt;const s=r.parent;if(!Sh(s))return Jo(e,fa.super_can_only_be_referenced_in_a_derived_class),Et;if(rA(s))return t?Et:qt;const c=Ru(Ss(s)),l=c&&gu(c)[0];return l?177===r.kind&&function(e,t){return!!mc(e,e=>l_(e)?"quit":170===e.kind&&e.parent===t)}(e,r)?(Jo(e,fa.super_cannot_be_referenced_in_constructor_arguments),Et):32===a?pu(c):Id(l,c.thisType):Et}function cA(e){return 175!==e.kind&&178!==e.kind&&179!==e.kind||211!==e.parent.kind?219===e.kind&&304===e.parent.kind?e.parent.parent:void 0:e.parent}function _A(e){return 4&xx(e)&&e.target===sr?by(e)[0]:void 0}function uA(e){return zF(e,e=>2097152&e.flags?p(e.types,_A):_A(e))}function dA(e,t){let n=e,r=t;for(;r;){const e=uA(r);if(e)return e;if(304!==n.parent.kind)break;n=n.parent.parent,r=UA(n,void 0)}}function pA(e){if(220===e.kind)return;if(AS(e)){const t=oI(e);if(t){const e=t.thisParameter;if(e)return z_(e)}}const t=Om(e);if(ne||t){const n=cA(e);if(n){const e=UA(n,void 0),t=dA(n,e);return t?CS(t,uN(ZA(n))):Kw(e?Dw(e):SM(n))}const r=sh(e.parent);if(cb(r)){const e=r.left;if(Dx(e)){const{expression:n}=e;if(t&&uD(n)){const e=Sd(r);if(e.commonJsModuleIndicator&&zN(n)===e.symbol)return}return Kw(SM(n))}}}}function fA(e){const t=e.parent;if(!AS(t))return;const n=lm(t);if(n&&n.arguments){const r=fL(n),i=t.parameters.indexOf(e);if(e.dotDotDotToken)return sL(r,i,r.length,wt,void 0,0);const o=ua(n),a=o.resolvedSignature;o.resolvedSignature=si;const s=i!!(58998787&e.flags)||XM(e,n,void 0)):2&n?OF(t,e=>!!(58998787&e.flags)||!!hR(e)):t}const i=lm(e);return i?$A(i,t):void 0}function vA(e,t){const n=fL(e).indexOf(t);return-1===n?void 0:bA(e,n)}function bA(e,t){if(ff(e))return 0===t?Ut:1===t?ov(!1):wt;const n=ua(e).resolvedSignature===li?li:jL(e);if(Tu(e)&&0===t)return eI(n,e);const r=n.parameters.length-1;return hJ(n)&&t>=r?Ux(z_(n.parameters[r]),Pk(t-r),256):dj(n,t)}function xA(e,t){const n=e.parent,{left:r,operatorToken:i,right:o}=n;switch(i.kind){case 64:case 77:case 76:case 78:return e===o?function(e){var t,n;const r=og(e);switch(r){case 0:case 4:const i=function(e){if(_u(e)&&e.symbol)return e.symbol;if(uD(e))return zN(e);if(hF(e)){const n=qM(e.expression);return dD(e.name)?t(n,e.name):Am(n,e.name.escapedText)}if(yF(e)){const t=SM(e.argumentExpression);if(!dC(t))return;return Am(qM(e.expression),pC(t))}return;function t(e,t){const n=fO(t.escapedText,t);return n&&hO(e,n)}}(e.left),o=i&&i.valueDeclaration;if(o&&(AD(o)||PD(o))){const t=yv(o);return t&&CS($k(t),_a(i).mapper)||(AD(o)?o.initializer&&qM(e.left):void 0)}return 0===r?qM(e.left):SA(e);case 5:if(kA(e,r))return SA(e);if(_u(e.left)&&e.left.symbol){const t=e.left.symbol.valueDeclaration;if(!t)return;const n=it(e.left,Dx),r=yv(t);if(r)return $k(r);if(uD(n.expression)){const e=n.expression,t=Ue(e,e.escapedText,111551,void 0,!0);if(t){const e=t.valueDeclaration&&yv(t.valueDeclaration);if(e){const t=fg(n);if(void 0!==t)return wA($k(e),t)}return}}return Om(t)||t===e.left?void 0:qM(e.left)}return qM(e.left);case 1:case 6:case 3:case 2:let a;2!==r&&(a=_u(e.left)?null==(t=e.left.symbol)?void 0:t.valueDeclaration:void 0),a||(a=null==(n=e.symbol)?void 0:n.valueDeclaration);const s=a&&yv(a);return s?$k(s):void 0;case 7:case 8:case 9:return pn.fail("Does not apply");default:return pn.assertNever(r)}}(n):void 0;case 57:case 61:const i=$A(n,t);return e===o&&(i&&i.pattern||!i&&!Ym(n))?qM(r):i;case 56:case 28:return e===o?$A(n,t):void 0;default:return}}function kA(e,t=og(e)){if(4===t)return!0;if(!Om(e)||5!==t||!uD(e.left.expression))return!1;const n=e.left.expression.escapedText,r=Ue(e.left,n,111551,void 0,!0,!0);return dm(null==r?void 0:r.valueDeclaration)}function SA(e){if(!e.symbol)return qM(e.left);if(e.symbol.valueDeclaration){const t=yv(e.symbol.valueDeclaration);if(t){const e=$k(t);if(e)return e}}const t=it(e.left,Dx);if(!Vf(im(t.expression,!1,!1)))return;const n=oA(t.expression),r=fg(t);return void 0!==r&&wA(n,r)||void 0}function TA(e,t){if(16777216&e.flags){const n=e;return!!(131072&Qf(Zx(n)).flags)&&Kx(rk(n))===Kx(n.checkType)&&JS(t,n.extendsType)}return!!(2097152&e.flags)&&H(e.types,e=>TA(e,t))}function wA(e,t,n){return zF(e,e=>{if(2097152&e.flags){let r,i,o=!1;for(const a of e.types){if(!(524288&a.flags))continue;if(Bp(a)&&2!==Vp(a)){r=NA(r,PA(a,t,n));continue}const e=OA(a,t);e?(o=!0,i=void 0,r=NA(r,e)):o||(i=ae(i,a))}if(i)for(const e of i){r=NA(r,LA(e,t,n))}if(!r)return;return 1===r.length?r[0]:Gb(r)}if(524288&e.flags)return Bp(e)&&2!==Vp(e)?PA(e,t,n):OA(e,t)??LA(e,t,n)},!0)}function NA(e,t){return t?ae(e,1&t.flags?Ot:t):e}function PA(e,t,n){const r=n||Ek(vc(t)),i=kp(e);if(e.nameType&&TA(e.nameType,r)||TA(i,r))return;return JS(r,xf(i)||i)?zx(e,r):void 0}function OA(e,t){const n=Am(e,t);var r;if(n&&!(262144&cx(r=n)&&!r.links.type&&Kc(r,0)>=0))return Iw(z_(n),!!(16777216&n.flags))}function LA(e,t,n){var r;if(fw(e)&&WT(t)&&+t>=0){const t=vw(e,e.target.fixedLength,0,!1,!0);if(t)return t}return null==(r=$m(sg(e),n||Ek(vc(t))))?void 0:r.type}function jA(e,t){if(pn.assert(Vf(e)),!(67108864&e.flags))return MA(e,t)}function MA(e,t){const n=e.parent,r=cP(e)&&mA(e,t);if(r)return r;const i=UA(n,t);if(i){if(vd(e)){const t=Ss(e);return wA(i,t.escapedName,_a(t).nameType)}if(qh(e)){const t=Fc(e);if(t&&ND(t)){const e=WM(t.expression),n=dC(e)&&wA(i,pC(e));if(n)return n}}if(e.name){const t=rx(e.name);return zF(i,e=>{var n;return null==(n=$m(sg(e),t))?void 0:n.type},!0)}}}function RA(e,t,n,r,i){return e&&zF(e,e=>{if(fw(e)){if((void 0===r||ti)?n-t:0,a=o>0&&12&e.target.combinedFlags?Fb(e.target,3):0;return o>0&&o<=a?by(e)[xy(e)-o]:vw(e,void 0===r?e.target.fixedLength:Math.min(e.target.fixedLength,r),void 0===n||void 0===i?a:Math.min(a,n-i),!1,!0)}return(!r||tQC(e)?Ux(e,Pk(a)):e,!0))}(n,e,t):void 0}function JA(e,t){if(ZE(e)){const n=UA(e.parent,t);if(!n||rl(n))return;return wA(n,aC(e.name))}return $A(e.parent,t)}function zA(e){switch(e.kind){case 11:case 9:case 10:case 15:case 229:case 112:case 97:case 106:case 80:case 157:return!0;case 212:case 218:return zA(e.expression);case 295:return!e.expression||zA(e.expression)}return!1}function qA(e,t){const n=`D${_J(e)},${Ab(t)}`;return Io(n)??Oo(n,function(e,t){const n=eD(e),r=n&&x(t.properties,e=>e.symbol&&304===e.kind&&e.symbol.escapedName===n&&zA(e.initializer)),i=r&&VM(r.initializer);return i&&tD(e,i)}(t,e)??ZT(t,G(P(D(e.properties,e=>!!e.symbol&&(304===e.kind?zA(e.initializer)&&YN(t,e.symbol.escapedName):305===e.kind&&YN(t,e.symbol.escapedName))),e=>[()=>VM(304===e.kind?e.initializer:e.name),e.symbol.escapedName]),P(D(lf(t),n=>{var r;return!!(16777216&n.flags)&&!!(null==(r=null==e?void 0:e.symbol)?void 0:r.members)&&!e.symbol.members.has(n.escapedName)&&YN(t,n.escapedName)}),e=>[()=>Lt,e.escapedName])),JS))}function UA(e,t){const n=VA(Vf(e)?jA(e,t):$A(e,t),e,t);if(n&&!(t&&2&t&&8650752&n.flags)){const t=zF(n,e=>32&xx(e)?e:qf(e),!0);return 1048576&t.flags&&gF(e)?qA(e,t):1048576&t.flags&&eP(e)?function(e,t){const n=`D${_J(e)},${Ab(t)}`,r=Io(n);if(r)return r;const i=LI(AI(e));return Oo(n,ZT(t,G(P(D(e.properties,e=>!!e.symbol&&292===e.kind&&YN(t,e.symbol.escapedName)&&(!e.initializer||zA(e.initializer))),e=>[e.initializer?()=>VM(e.initializer):()=>Gt,e.symbol.escapedName]),P(D(lf(t),n=>{var r;if(!(16777216&n.flags&&(null==(r=null==e?void 0:e.symbol)?void 0:r.members)))return!1;const o=e.parent.parent;return(n.escapedName!==i||!$E(o)||!py(o.children).length)&&!e.symbol.members.has(n.escapedName)&&YN(t,n.escapedName)}),e=>[()=>Lt,e.escapedName])),JS))}(e,t):t}}function VA(e,t,n){if(e&&oM(e,465829888)){const r=ZA(t);if(r&&1&n&&H(r.inferences,RM))return WA(e,r.nonFixingMapper);if(null==r?void 0:r.returnMapper){const t=WA(e,r.returnMapper);return 1048576&t.flags&&Ib(t.types,Kt)&&Ib(t.types,Zt)?OF(t,e=>e!==Kt&&e!==Zt):t}}return e}function WA(e,t){return 465829888&e.flags?CS(e,t):1048576&e.flags?zb(P(e.types,e=>WA(e,t)),0):2097152&e.flags?Gb(P(e.types,e=>WA(e,t))):e}function $A(e,t){var n;if(67108864&e.flags)return;const r=XA(e,!t);if(r>=0)return Fi[r];const{parent:i}=e;switch(i.kind){case 261:case 170:case 173:case 172:case 209:return function(e,t){const n=e.parent;if(Ou(n)&&e===n.initializer){const e=mA(n,t);if(e)return e;if(!(8&t)&&w_(n.name)&&n.name.elements.length>0)return e_(n.name,!0,!1)}}(e,t);case 220:case 254:return function(e,t){const n=Yf(e);if(n){let e=yA(n,t);if(e){const t=Rh(n);if(1&t){const n=!!(2&t);1048576&e.flags&&(e=OF(e,e=>!!YB(1,e,n)));const r=YB(1,e,!!(2&t));if(!r)return;e=r}if(2&t){const t=zF(e,wR);return t&&zb([t,Bj(t)])}return e}}}(e,t);case 230:return function(e,t){const n=Yf(e);if(n){const r=Rh(n);let i=yA(n,t);if(i){const n=!!(2&r);if(!e.asteriskToken&&1048576&i.flags&&(i=OF(i,e=>!!YB(1,e,n))),e.asteriskToken){const r=ZB(i,n),o=(null==r?void 0:r.yieldType)??un,a=$A(e,t)??un,s=(null==r?void 0:r.nextType)??Ot,c=qj(o,a,s,!1);return n?zb([c,qj(o,a,s,!0)]):c}return YB(0,i,n)}}}(i,t);case 224:return function(e,t){const n=$A(e,t);if(n){const e=wR(n);return e&&zb([e,Bj(e)])}}(i,t);case 214:case 215:return vA(i,e);case 171:return function(e){const t=Mj(e);return t?Bh(t):void 0}(i);case 217:case 235:return wl(i.type)?$A(i,t):$k(i.type);case 227:return xA(e,t);case 304:case 305:return MA(i,t);case 306:return $A(i.parent,t);case 210:{const r=i,o=UA(r,t),a=np(r.elements,e),s=(n=ua(r)).spreadIndices??(n.spreadIndices=function(e){let t,n;for(let r=0;r=0)return Fi[n]}return bA(e,0)}(i,t);case 302:return function(e){return wA(av(!1),yC(e))}(i)}}function HA(e){KA(e,$A(e,void 0),!0)}function KA(e,t,n){Di[Ai]=e,Fi[Ai]=t,Pi[Ai]=n,Ai++}function GA(){Ai--,Di[Ai]=void 0,Fi[Ai]=void 0,Pi[Ai]=void 0}function XA(e,t){for(let n=Ai-1;n>=0;n--)if(e===Di[n]&&(t||!Pi[n]))return n;return-1}function ZA(e){for(let t=ji-1;t>=0;t--)if(dh(e,Oi[t]))return Li[t]}function eI(e,t){return QE(t)||0!==lL(t)?function(e,t){let n=kj(e,Ot);n=tI(t,AI(t),n);const r=wI(HB.IntrinsicAttributes,t);il(r)||(n=$d(r,n));return n}(e,t):function(e,t){const n=AI(t),r=(i=n,OI(HB.ElementAttributesPropertyNameContainer,i));var i;let o=void 0===r?kj(e,Ot):""===r?gh(e):function(e,t){if(e.compositeSignatures){const n=[];for(const r of e.compositeSignatures){const e=gh(r);if(rl(e))return e;const i=Zc(e,t);if(!i)return;n.push(i)}return Gb(n)}const n=gh(e);return rl(n)?n:Zc(n,t)}(e,r);if(!o)return r&&d(t.attributes.properties)&&Jo(t,fa.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property,vc(r)),Ot;if(o=tI(t,n,o),rl(o))return o;{let n=o;const r=wI(HB.IntrinsicClassAttributes,t);if(!il(r)){const i=iu(r.symbol),o=gh(e);let a;if(i){a=CS(r,nS(i,Jg([o],i,Mg(i),Om(t))))}else a=r;n=$d(a,n)}const i=wI(HB.IntrinsicAttributes,t);return il(i)||(n=$d(i,n)),n}}(e,t)}function tI(e,t,n){const r=(i=t)&&da(i.exports,HB.LibraryManagedAttributes,788968);var i;if(r){const t=function(e){if(QE(e))return IL(e);if(xI(e.tagName))return Bh(AL(e,RI(e)));const t=SM(e.tagName);if(128&t.flags){const n=MI(t,e);return n?Bh(AL(e,n)):Et}return t}(e),i=UI(r,Om(e),t,n);if(i)return i}return n}function nI(e){return Wk(j,"noImplicitAny")?De(e,(e,t)=>e!==t&&e?Ud(e.typeParameters,t.typeParameters)?function(e,t){const n=e.typeParameters||t.typeParameters;let r;e.typeParameters&&t.typeParameters&&(r=nS(t.typeParameters,e.typeParameters));let i=166&(e.flags|t.flags);const o=e.declaration,a=function(e,t,n){const r=gj(e),i=gj(t),o=r>=i?e:t,a=o===e?t:e,s=o===e?r:i,c=yj(e)||yj(t),l=c&&!yj(o),_=new Array(s+(l?1:0));for(let u=0;u=hj(o)&&u>=hj(a),h=u>=r?void 0:cj(e,u),y=u>=i?void 0:cj(t,u),v=Xo(1|(g&&!m?16777216:0),(h===y?h:h?y?void 0:h:y)||`arg${u}`,m?32768:g?16384:0);v.links.type=m?Kv(f):f,_[u]=v}if(l){const e=Xo(1,"args",32768);e.links.type=Kv(dj(a,s)),a===t&&(e.links.type=CS(e.links.type,n)),_[s]=e}return _}(e,t,r),s=be(a);s&&32768&cx(s)&&(i|=1);const c=function(e,t,n){if(!e||!t)return e||t;const r=zb([z_(e),CS(z_(t),n)]);return Rw(e,r)}(e.thisParameter,t.thisParameter,r),l=Math.max(e.minArgumentCount,t.minArgumentCount),_=Ld(o,n,c,a,void 0,void 0,l,i);_.compositeKind=2097152,_.compositeSignatures=G(2097152===e.compositeKind&&e.compositeSignatures||[e],[t]),r&&(_.mapper=2097152===e.compositeKind&&e.mapper&&e.compositeSignatures?_S(e.mapper,r):r);return _}(e,t):void 0:e):void 0}function rI(e,t){const n=D(Jm(e,0),e=>!function(e,t){let n=0;for(;nfunction(e){const t=Sd(e);if(!qq(t)&&!e.isUnterminated){let r;n??(n=bs(99,!0)),n.setScriptTarget(t.languageVersion),n.setLanguageVariant(t.languageVariant),n.setOnError((e,i,o)=>{const a=n.getTokenEnd();if(3===e.category&&r&&a===r.start&&i===r.length){const n=Xx(t.fileName,t.text,a,i,e,o);uT(r,n)}else r&&a===r.start||(r=ek(t,a,i,e,o),ho.add(r))}),n.setText(t.text,e.pos,e.end-e.pos);try{return n.scan(),pn.assert(14===n.reScanSlashToken(!0),"Expected scanner to rescan RegularExpressionLiteral"),!!r}finally{n.setText(""),n.setOnError(void 0)}}return!1}(e))),ar}function sI(e){return 209===e.kind&&!!e.initializer||304===e.kind&&sI(e.initializer)||305===e.kind&&!!e.objectAssignmentInitializer||227===e.kind&&64===e.operatorToken.kind}function cI(e,t,n){const r=e.elements,i=r.length,o=[],a=[];HA(e);const s=th(e),c=EM(e),l=UA(e,void 0),_=function(e){const t=sh(e.parent);return jF(t)&&J_(t.parent)}(e)||!!l&&DF(l,e=>nw(e)||Bp(e)&&!e.nameType&&!!bS(e.target||e));let u=!1;for(let c=0;c8&a[t]?Wx(e,Wt)||wt:e),2):$?dn:jt,c))}function lI(e){if(!(4&xx(e)))return e;let t=e.literalType;return t||(t=e.literalType=yy(e),t.objectFlags|=147456),t}function _I(e){switch(e.kind){case 168:return function(e){return aM(uI(e),296)}(e);case 80:return WT(e.escapedText);case 9:case 11:return WT(e.text);default:return!1}}function uI(e){const t=ua(e.expression);if(!t.resolvedType){if((HD(e.parent.parent)||m_(e.parent.parent)||yE(e.parent.parent))&&AF(e.expression)&&103===e.expression.operatorToken.kind&&178!==e.parent.kind&&179!==e.parent.kind)return t.resolvedType=Et;if(t.resolvedType=WM(e.expression),AD(e.parent)&&!Ov(e.parent)&&MF(e.parent.parent)){const t=YP(Op(e.parent.parent));t&&(ua(t).flags|=4096,ua(e).flags|=32768,ua(e.parent.parent).flags|=32768)}(98304&t.resolvedType.flags||!aM(t.resolvedType,402665900)&&!JS(t.resolvedType,hn))&&Jo(e,fa.A_computed_property_name_must_be_of_type_string_number_symbol_or_any)}return t.resolvedType}function dI(e){var t;const n=null==(t=e.declarations)?void 0:t[0];return WT(e.escapedName)||n&&Nc(n)&&_I(n.name)}function pI(e){var t;const n=null==(t=e.declarations)?void 0:t[0];return Gh(e)||n&&Nc(n)&&ND(n.name)&&aM(uI(n.name),4096)}function fI(e){var t;const n=null==(t=e.declarations)?void 0:t[0];return n&&Nc(n)&&ND(n.name)}function gI(e,t,n,r){var i;const o=[];let a;for(let e=t;e0&&(a=hk(a,x(),e.symbol,m,l),o=[],i=Zu(),h=!1,y=!1,v=!1);const n=Qf(WM(_.expression,2&t));if(vI(n)){const t=gk(n,l);if(r&&CI(t,r,_),b=o.length,il(a))continue;a=hk(a,t,e.symbol,m,l)}else Jo(_,fa.Spread_types_may_only_be_created_from_object_types),a=Et;continue}pn.assert(178===_.kind||179===_.kind),lz(_)}!k||8576&k.flags?i.set(f.escapedName,f):JS(k,hn)&&(JS(k,Wt)?y=!0:JS(k,sn)?v=!0:h=!0,n&&(g=!0)),o.push(f)}return GA(),il(a)?Et:a!==Nn?(o.length>0&&(a=hk(a,x(),e.symbol,m,l),o=[],i=Zu(),h=!1,y=!1),zF(a,e=>e===Nn?x():e)):x();function x(){const t=[],r=EM(e);h&&t.push(gI(r,b,o,Ut)),y&&t.push(gI(r,b,o,Wt)),v&&t.push(gI(r,b,o,sn));const a=Hs(e.symbol,i,_,_,t);return a.objectFlags|=131200|m,f&&(a.objectFlags|=4096),g&&(a.objectFlags|=512),n&&(a.pattern=e),a}}function vI(e){const t=Sw(zF(e,kf));return!!(126615553&t.flags||3145728&t.flags&&b(t.types,vI))}function bI(e){return e.includes("-")}function xI(e){return uD(e)&&Oy(e.escapedText)||rP(e)}function kI(e,t){return e.initializer?PM(e.initializer,t):Gt}function SI(e,t=0){const n=$?Zu():void 0;let r,i=Zu(),o=Dn,a=!1,s=!1,c=2048;const l=LI(AI(e));let u,d=e;if(!QE(e)){const _=e.attributes;u=_.symbol,d=_;const p=$A(_,0);for(const e of _.properties){const u=e.symbol;if(ZE(e)){const r=kI(e,t);c|=458752&xx(r);const o=Xo(4|u.flags,u.escapedName);if(o.declarations=u.declarations,o.parent=u.parent,u.valueDeclaration&&(o.valueDeclaration=u.valueDeclaration),o.links.type=r,o.links.target=u,i.set(o.escapedName,o),null==n||n.set(o.escapedName,o),aC(e.name)===l&&(s=!0),p){const t=Am(p,u.escapedName);t&&t.declarations&&Ho(t)&&uD(e.name)&&Go(e.name,t.declarations,e.name.escapedText)}if(p&&2&t&&!(4&t)&&ES(e)){const t=ZA(_);pn.assert(t);sN(t,e.initializer.expression,r)}}else{pn.assert(294===e.kind),i.size>0&&(o=hk(o,f(),_.symbol,c,!1),i=Zu());const s=Qf(WM(e.expression,2&t));rl(s)&&(a=!0),vI(s)?(o=hk(o,s,_.symbol,c,!1),n&&CI(s,n,e)):(Jo(e.expression,fa.Spread_types_may_only_be_created_from_object_types),r=r?Gb([r,s]):s)}}a||i.size>0&&(o=hk(o,f(),_.symbol,c,!1))}const p=e.parent;if(($E(p)&&p.openingElement===e||XE(p)&&p.openingFragment===e)&&py(p.children).length>0){const n=TI(p,t);if(!a&&l&&""!==l){s&&Jo(d,fa._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,vc(l));const t=KE(e)?UA(e.attributes,void 0):void 0,r=t&&wA(t,l),i=Xo(4,l);i.links.type=1===n.length?n[0]:r&&DF(r,nw)?kb(n):Kv(zb(n)),i.valueDeclaration=bw.createPropertySignature(void 0,vc(l),void 0,void 0),IT(i.valueDeclaration,d),i.valueDeclaration.symbol=i;const a=Zu();a.set(l,i),o=hk(o,Hs(u,a,_,_,_),u,c,!1)}}return a?wt:r&&o!==Dn?Gb([r,o]):r||(o===Dn?f():o);function f(){return c|=8192,function(e,t,n){const r=Hs(t,n,_,_,_);return r.objectFlags|=139392|e,r}(c,u,i)}}function TI(e,t){const n=[];for(const r of e.children)if(12===r.kind)r.containsOnlyTriviaWhiteSpaces||n.push(Ut);else{if(295===r.kind&&!r.expression)continue;n.push(PM(r,t))}return n}function CI(e,t,n){for(const r of lf(e))if(!(16777216&r.flags)){const e=t.get(r.escapedName);if(e){uT(Jo(e.valueDeclaration,fa._0_is_specified_more_than_once_so_this_usage_will_be_overwritten,vc(e.escapedName)),qp(n,fa.This_spread_always_overwrites_this_property))}}}function wI(e,t){const n=AI(t),r=n&&gs(n),i=r&&da(r,e,788968);return i?Ru(i):Et}function NI(e){const t=ua(e);if(!t.resolvedSymbol){const n=wI(HB.IntrinsicElements,e);if(il(n))return te&&Jo(e,fa.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,vc(HB.IntrinsicElements)),t.resolvedSymbol=bt;{if(!uD(e.tagName)&&!rP(e.tagName))return pn.fail();const r=rP(e.tagName)?lC(e.tagName):e.tagName.escapedText,i=Am(n,r);if(i)return t.jsxFlags|=1,t.resolvedSymbol=i;const o=Cz(n,Ek(vc(r)));return o?(t.jsxFlags|=2,t.resolvedSymbol=o):nl(n,r)?(t.jsxFlags|=2,t.resolvedSymbol=n.symbol):(Jo(e,fa.Property_0_does_not_exist_on_type_1,uC(e.tagName),"JSX."+HB.IntrinsicElements),t.resolvedSymbol=bt)}}return t.resolvedSymbol}function DI(e){const t=e&&Sd(e),n=t&&ua(t);if(n&&!1===n.jsxImplicitImportContainer)return;if(n&&n.jsxImplicitImportContainer)return n.jsxImplicitImportContainer;const r=eS(Zk(j,t),j);if(!r)return;const i=1===Ck(j)?fa.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:fa.This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed,o=function(e,t){const n=j.importHelpers?1:0,r=null==e?void 0:e.imports[n];r&&pn.assert(iy(r)&&r.text===t,`Expected sourceFile.imports[${n}] to be the synthesized JSX runtime import`);return r}(t,r),a=as(o||e,r,i,e),s=a&&a!==bt?ks($a(a)):void 0;return n&&(n.jsxImplicitImportContainer=s||!1),s}function AI(e){const t=e&&ua(e);if(t&&t.jsxNamespace)return t.jsxNamespace;if(!t||!1!==t.jsxNamespace){let n=DI(e);if(!n||n===bt){const t=jo(e);n=Ue(e,t,1920,void 0,!1)}if(n){const e=$a(da(gs($a(n)),HB.JSX,1920));if(e&&e!==bt)return t&&(t.jsxNamespace=e),e}t&&(t.jsxNamespace=!1)}const n=$a(Zy(HB.JSX,1920,void 0));return n!==bt?n:void 0}function OI(e,t){const n=t&&da(t.exports,e,788968),r=n&&Ru(n),i=r&&lf(r);if(i){if(0===i.length)return"";if(1===i.length)return i[0].escapedName;i.length>1&&n.declarations&&Jo(n.declarations[0],fa.The_global_type_JSX_0_may_not_have_more_than_one_property,vc(e))}}function LI(e){return 4===j.jsx||5===j.jsx?"children":OI(HB.ElementChildrenAttributeNameContainer,e)}function jI(e,t){if(4&e.flags)return[si];if(128&e.flags){const n=MI(e,t);if(n){return[AL(t,n)]}return Jo(t,fa.Property_0_does_not_exist_on_type_1,e.value,"JSX."+HB.IntrinsicElements),_}const n=qf(e);let r=Jm(n,1);return 0===r.length&&(r=Jm(n,0)),0===r.length&&1048576&n.flags&&(r=qd(P(n.types,e=>jI(e,t)))),r}function MI(e,t){const n=wI(HB.IntrinsicElements,t);if(!il(n)){const t=Am(n,yc(e.value));if(t)return z_(t);const r=dg(n,Ut);return r||void 0}return wt}function RI(e){var t;pn.assert(xI(e.tagName));const n=ua(e);if(!n.resolvedJsxElementAttributesType){const r=NI(e);if(1&n.jsxFlags)return n.resolvedJsxElementAttributesType=z_(r)||Et;if(2&n.jsxFlags){const r=rP(e.tagName)?lC(e.tagName):e.tagName.escapedText;return n.resolvedJsxElementAttributesType=(null==(t=bg(wI(HB.IntrinsicElements,e),r))?void 0:t.type)||Et}return n.resolvedJsxElementAttributesType=Et}return n.resolvedJsxElementAttributesType}function BI(e){const t=wI(HB.ElementClass,e);if(!il(t))return t}function JI(e){return wI(HB.Element,e)}function zI(e){const t=JI(e);if(t)return zb([t,zt])}function qI(e){const t=AI(e);if(!t)return;const n=(r=t)&&da(r.exports,HB.ElementType,788968);var r;if(!n)return;const i=UI(n,Om(e));return i&&!il(i)?i:void 0}function UI(e,t,...n){const r=Ru(e);if(524288&e.flags){const i=_a(e).typeParameters;if(d(i)>=n.length){const o=Jg(n,i,n.length,t);return 0===d(o)?r:Sy(e,o)}}if(d(r.typeParameters)>=n.length){return hy(r,Jg(n,r.typeParameters,n.length,t))}}function VI(e){const t=Tu(e);var n;t&&function(e){(function(e){if(hF(e)&&rP(e.expression))return Wq(e.expression,fa.JSX_property_access_expressions_cannot_include_JSX_namespace_names);if(rP(e)&&Yk(j)&&!Oy(e.namespace.escapedText))Wq(e,fa.React_components_cannot_include_JSX_namespace_names)})(e.tagName),Cq(e,e.typeArguments);const t=new Map;for(const n of e.attributes.properties){if(294===n.kind)continue;const{name:e,initializer:r}=n,i=aC(e);if(t.get(i))return Wq(e,fa.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);if(t.set(i,!0),r&&295===r.kind&&!r.expression)return Wq(r,fa.JSX_attributes_must_only_be_assigned_a_non_empty_expression)}}(e),n=e,0===(j.jsx||0)&&Jo(n,fa.Cannot_use_JSX_unless_the_jsx_flag_is_provided),void 0===JI(n)&&te&&Jo(n,fa.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist),AP(e);const r=jL(e);if(JL(r,e),t){const t=e,n=qI(t);if(void 0!==n){const e=t.tagName;jT(xI(e)?Ek(uC(e)):WM(e),n,ko,e,fa.Its_type_0_is_not_a_valid_JSX_element_type,()=>{const t=ep(e);return ik(void 0,fa._0_cannot_be_used_as_a_JSX_component,t)})}else!function(e,t,n){if(1===e){const e=zI(n);e&&jT(t,e,ko,n.tagName,fa.Its_return_type_0_is_not_a_valid_JSX_element,r)}else if(0===e){const e=BI(n);e&&jT(t,e,ko,n.tagName,fa.Its_instance_type_0_is_not_a_valid_JSX_element,r)}else{const e=zI(n),i=BI(n);if(!e||!i)return;jT(t,zb([e,i]),ko,n.tagName,fa.Its_element_type_0_is_not_a_valid_JSX_element,r)}function r(){const e=ep(n.tagName);return ik(void 0,fa._0_cannot_be_used_as_a_JSX_component,e)}}(lL(t),gh(r),t)}}function WI(e,t,n){if(524288&e.flags&&(Qp(e,t)||bg(e,t)||fd(t)&&lg(e,Ut)||n&&bI(t)))return!0;if(33554432&e.flags)return WI(e.baseType,t,n);if(3145728&e.flags&&$I(e))for(const r of e.types)if(WI(r,t,n))return!0;return!1}function $I(e){return!!(524288&e.flags&&!(512&xx(e))||67108864&e.flags||33554432&e.flags&&$I(e.baseType)||1048576&e.flags&&H(e.types,$I)||2097152&e.flags&&b(e.types,$I))}function HI(e,t){if(function(e){if(e.expression&&DA(e.expression))Wq(e.expression,fa.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array)}(e),e.expression){const n=WM(e.expression,t);return e.dotDotDotToken&&n!==wt&&!$C(n)&&Jo(e,fa.JSX_spread_child_must_be_an_array_type),n}return Et}function KI(e){return e.valueDeclaration?eU(e.valueDeclaration):0}function GI(e){if(8192&e.flags||4&cx(e))return!0;if(Om(e.valueDeclaration)){const t=e.valueDeclaration.parent;return t&&AF(t)&&3===og(t)}}function XI(e,t,n,r,i,o=!0){return QI(e,t,n,r,i,o?167===e.kind?e.right:206===e.kind?e:209===e.kind&&e.propertyName?e.propertyName:e.name:void 0)}function QI(e,t,n,r,i,o){var a;const s=lx(i,n);if(t){if(M<2&&YI(i))return o&&Jo(o,fa.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword),!1;if(64&s)return o&&Jo(o,fa.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression,pc(i),Sc(IC(i))),!1;if(!(256&s)&&(null==(a=i.declarations)?void 0:a.some(y_)))return o&&Jo(o,fa.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super,pc(i)),!1}if(64&s&&YI(i)&&(um(e)||pm(e)||dF(e.parent)&&dm(e.parent.parent))){const t=bx(Cs(i));if(t&&mc(e,e=>!!(jD(e)&&Ad(e.body)||AD(e))||!(!m_(e)&&!l_(e))&&"quit"))return o&&Jo(o,fa.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor,pc(i),$h(t.name)),!1}if(!(6&s))return!0;if(2&s){return!!xz(e,bx(Cs(i)))||(o&&Jo(o,fa.Property_0_is_private_and_only_accessible_within_class_1,pc(i),Sc(IC(i))),!1)}if(t)return!0;let c=bz(e,e=>LC(Ru(Ss(e)),i,n));return!c&&(c=function(e){const t=function(e){const t=im(e,!1,!1);return t&&s_(t)?uv(t):void 0}(e);let n=(null==t?void 0:t.type)&&$k(t.type);if(n)262144&n.flags&&(n=uf(n));else{const t=im(e,!1,!1);s_(t)&&(n=pA(t))}if(n&&7&xx(n))return $_(n);return}(e),c=c&&LC(c,i,n),256&s||!c)?(o&&Jo(o,fa.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses,pc(i),Sc(IC(i)||r)),!1):!!(256&s)||(262144&r.flags&&(r=r.isThisType?uf(r):xf(r)),!(!r||!H_(r,c))||(o&&Jo(o,fa.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2,pc(i),Sc(c),Sc(r)),!1))}function YI(e){return!!AC(e,e=>!(8192&e.flags))}function ZI(e){return sO(WM(e),e)}function eO(e){return lD(e,50331648)}function tO(e){return eO(e)?Dw(e):e}function nO(e,t){const n=ub(e)?zp(e):void 0;if(106!==e.kind)if(void 0!==n&&n.length<100){if(uD(e)&&"undefined"===n)return void Jo(e,fa.The_value_0_cannot_be_used_here,"undefined");Jo(e,16777216&t?33554432&t?fa._0_is_possibly_null_or_undefined:fa._0_is_possibly_undefined:fa._0_is_possibly_null,n)}else Jo(e,16777216&t?33554432&t?fa.Object_is_possibly_null_or_undefined:fa.Object_is_possibly_undefined:fa.Object_is_possibly_null);else Jo(e,fa.The_value_0_cannot_be_used_here,"null")}function rO(e,t){Jo(e,16777216&t?33554432&t?fa.Cannot_invoke_an_object_which_is_possibly_null_or_undefined:fa.Cannot_invoke_an_object_which_is_possibly_undefined:fa.Cannot_invoke_an_object_which_is_possibly_null)}function aO(e,t,n){if($&&2&e.flags){if(ub(t)){const e=zp(t);if(e.length<100)return Jo(t,fa._0_is_of_type_unknown,e),Et}return Jo(t,fa.Object_is_of_type_unknown),Et}const r=cD(e,50331648);if(50331648&r){n(t,r);const i=Dw(e);return 229376&i.flags?Et:i}return e}function sO(e,t){return aO(e,t,nO)}function cO(e,t){const n=sO(e,t);if(16384&n.flags){if(ub(t)){const e=zp(t);if(uD(t)&&"undefined"===e)return Jo(t,fa.The_value_0_cannot_be_used_here,e),n;if(e.length<100)return Jo(t,fa._0_is_possibly_undefined,e),n}Jo(t,fa.Object_is_possibly_undefined)}return n}function _O(e,t,n){return 64&e.flags?function(e,t){const n=WM(e.expression),r=Aw(n,e.expression);return Pw(xO(e,e.expression,sO(r,e.expression),e.name,t),e,r!==n)}(e,t):xO(e,e.expression,ZI(e.expression),e.name,t,n)}function dO(e,t){const n=wm(e)&&pv(e.left)?sO(oA(e.left),e.left):ZI(e.left);return xO(e,e.left,n,e.right,t)}function pO(e){for(;218===e.parent.kind;)e=e.parent;return J_(e.parent)&&e.parent.expression===e}function fO(e,t){for(let n=rm(t);n;n=em(n)){const{symbol:t}=n,r=Kh(t,e),i=t.members&&t.members.get(r)||t.exports&&t.exports.get(r);if(i)return i}}function mO(e){!function(e){if(!em(e))return Wq(e,fa.Private_identifiers_are_not_allowed_outside_class_bodies);if(!rE(e.parent)){if(!Tm(e))return Wq(e,fa.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);const t=AF(e.parent)&&103===e.parent.operatorToken.kind;if(!gO(e)&&!t)return Wq(e,fa.Cannot_find_name_0,bc(e))}}(e);const t=gO(e);return t&&LO(t,void 0,!1),wt}function gO(e){if(!Tm(e))return;const t=ua(e);return void 0===t.resolvedSymbol&&(t.resolvedSymbol=fO(e.escapedText,e)),t.resolvedSymbol}function hO(e,t){return Am(e,t.escapedName)}function yO(e,t){return(Ol(t)||um(e)&&Ll(t))&&im(e,!0,!1)===jl(t)}function xO(e,t,n,r,i,o){const a=ua(t).resolvedSymbol,s=eh(e),c=qf(0!==s||pO(e)?Kw(n):n),l=rl(c)||c===un;let _,u;if(dD(r)){(M{const n=e.valueDeclaration;if(n&&Nc(n)&&dD(n.name)&&n.name.escapedText===t.escapedText)return r=e,!0});const o=ya(t);if(r){const i=pn.checkDefined(r.valueDeclaration),a=pn.checkDefined(em(i));if(null==n?void 0:n.valueDeclaration){const r=n.valueDeclaration,s=em(r);if(pn.assert(!!s),mc(s,e=>a===e))return uT(Jo(t,fa.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling,o,Sc(e)),qp(r,fa.The_shadowing_declaration_of_0_is_defined_here,o),qp(i,fa.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here,o)),!0}return Jo(t,fa.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier,o,ya(a.name||QB)),!0}return!1}(n,r,t))return Et;const e=rm(r);e&&Cd(Sd(e),j.checkJs)&&Wq(r,fa.Private_field_0_must_be_declared_in_an_enclosing_class,bc(r))}else{65536&_.flags&&!(32768&_.flags)&&1!==s&&Jo(e,fa.Private_accessor_was_defined_without_a_getter)}}else{if(l)return uD(t)&&a&&xP(e,2,void 0,n),il(c)?Et:c;_=Am(c,r.escapedText,cM(c),167===e.kind)}if(xP(e,2,_,n),_){const n=QJ(_,r);if(Ho(n)&&Cx(e,n)&&n.declarations&&Go(r,n.declarations,r.escapedText),function(e,t,n){const{valueDeclaration:r}=e;if(!r||Sd(t).isDeclarationFile)return;let i;const o=bc(n);!TO(t)||function(e){return AD(e)&&!Rv(e)&&e.questionToken}(r)||Dx(t)&&Dx(t.expression)||pa(r,n)||OD(r)&&256&Zq(r)||!z&&function(e){if(!(32&e.parent.flags))return!1;let t=z_(e.parent);for(;;){if(t=t.symbol&&CO(t),!t)return!1;const n=Am(t,e.escapedName);if(n&&n.valueDeclaration)return!0}}(e)?264!==r.kind||184===t.parent.kind||33554432&r.flags||pa(r,n)||(i=Jo(n,fa.Class_0_used_before_its_declaration,o)):i=Jo(n,fa.Property_0_is_used_before_its_initialization,o);i&&uT(i,qp(r,fa._0_is_declared_here,o))}(_,e,r),LO(_,e,jO(t,a)),ua(e).resolvedSymbol=_,XI(e,108===t.kind,px(e),c,_),Zj(e,_,s))return Jo(r,fa.Cannot_assign_to_0_because_it_is_a_read_only_property,bc(r)),Et;u=yO(e,_)?Nt:o||dx(e)?L_(_):z_(_)}else{const t=dD(r)||0!==s&&Lx(n)&&!HT(n)?void 0:bg(c,r.escapedText);if(!t||!t.type){const t=kO(e,n.symbol,!0);return!t&&Sx(n)?wt:n.symbol===Fe?(Fe.exports.has(r.escapedText)&&418&Fe.exports.get(r.escapedText).flags?Jo(r,fa.Property_0_does_not_exist_on_type_1,vc(r.escapedText),Sc(n)):te&&Jo(r,fa.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature,Sc(n)),wt):(r.escapedText&&!ba(e)&&wO(r,HT(n)?c:n,t),Et)}t.isReadonly&&(th(e)||uh(e))&&Jo(e,fa.Index_signature_in_type_0_only_permits_reading,Sc(c)),u=t.type,j.noUncheckedIndexedAccess&&1!==eh(e)&&(u=zb([u,Rt])),j.noPropertyAccessFromIndexSignature&&hF(e)&&Jo(r,fa.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0,vc(r.escapedText)),t.declaration&&Ko(t.declaration)&&Go(r,[t.declaration],r.escapedText)}return SO(e,_,u,r,i)}function kO(e,t,n){var r;const i=Sd(e);if(i&&void 0===j.checkJs&&void 0===i.checkJsDirective&&(1===i.scriptKind||2===i.scriptKind)){const o=p(null==t?void 0:t.declarations,Sd),a=!(null==t?void 0:t.valueDeclaration)||!m_(t.valueDeclaration)||(null==(r=t.valueDeclaration.heritageClauses)?void 0:r.length)||bm(!1,t.valueDeclaration);return!(i!==o&&o&&nf(o)||n&&t&&32&t.flags&&a||e&&n&&hF(e)&&110===e.expression.kind&&a)}return!1}function SO(e,t,n,r,i){const o=eh(e);if(1===o)return Iw(n,!!(t&&16777216&t.flags));if(t&&!(98311&t.flags)&&!(8192&t.flags&&1048576&n.flags)&&!oz(t.declarations))return n;if(n===Nt)return Jl(e,t);n=vP(n,e,i);let a=!1;if($&&Y&&Dx(e)&&110===e.expression.kind){const n=t&&t.valueDeclaration;if(n&&RJ(n)&&!Iv(n)){const t=LE(e);177!==t.kind||t.parent!==n.parent||33554432&n.flags||(a=!0)}}else $&&t&&t.valueDeclaration&&hF(t.valueDeclaration)&&mg(t.valueDeclaration)&&LE(e)===LE(t.valueDeclaration)&&(a=!0);const s=IE(e,n,a?Nw(n):n);return a&&!gT(n)&&gT(s)?(Jo(r,fa.Property_0_is_used_before_being_assigned,pc(t)),n):o?cw(s):s}function TO(e,t){return!!mc(e,e=>{switch(e.kind){case 173:case 176:return!0;case 187:case 288:return"quit";case 220:return!t&&"quit";case 242:return!(!l_(e.parent)||220===e.parent.kind)&&"quit";default:return!1}})}function CO(e){const t=gu(e);if(0!==t.length)return Gb(t)}function wO(e,t,n){const r=ua(e),i=r.nonExistentPropCheckCache||(r.nonExistentPropCheckCache=new Set),o=`${Ab(t)}|${n}`;if(i.has(o))return;let a,s;if(i.add(o),!dD(e)&&1048576&t.flags&&!(402784252&t.flags))for(const n of t.types)if(!Am(n,e.escapedText)&&!bg(n,e.escapedText)){a=ik(a,fa.Property_0_does_not_exist_on_type_1,jp(e),Sc(n));break}if(NO(e.escapedText,t)){const n=jp(e),r=Sc(t);a=ik(a,fa.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,n,r,r+"."+n)}else{const r=yR(t);if(r&&Am(r,e.escapedText))a=ik(a,fa.Property_0_does_not_exist_on_type_1,jp(e),Sc(t)),s=qp(e,fa.Did_you_forget_to_use_await);else{const r=jp(e),i=Sc(t),o=function(e,t){const n=qf(t).symbol;if(!n)return;const r=kc(n),i=op().get(r);if(i)for(const[t,n]of i)if(C(n,e))return t}(r,t);if(void 0!==o)a=ik(a,fa.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later,r,i,o);else{const o=FO(e,t);if(void 0!==o){const e=kc(o);a=ik(a,n?fa.Property_0_may_not_exist_on_type_1_Did_you_mean_2:fa.Property_0_does_not_exist_on_type_1_Did_you_mean_2,r,i,e),s=o.valueDeclaration&&qp(o.valueDeclaration,fa._0_is_declared_here,e)}else{const e=function(e){return j.lib&&!j.lib.includes("lib.dom.d.ts")&&(t=e,n=e=>e.symbol&&/^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(vc(e.symbol.escapedName)),3145728&t.flags?b(t.types,n):n(t))&&lT(e);var t,n}(t)?fa.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:fa.Property_0_does_not_exist_on_type_1;a=ik(km(a,t),e,r,i)}}}}const c=Wp(Sd(e),e,a);s&&uT(c,s),qo(!n||a.code!==fa.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,c)}function NO(e,t){const n=t.symbol&&Am(z_(t.symbol),e);return void 0!==n&&!!n.valueDeclaration&&Iv(n.valueDeclaration)}function DO(e,t){return OO(e,lf(t),106500)}function FO(e,t){let n=lf(t);if("string"!=typeof e){const r=e.parent;hF(r)&&(n=D(n,e=>MO(r,t,e))),e=bc(e)}return OO(e,n,111551)}function EO(e,t){const n=tt(e)?e:bc(e),r=lf(t);return("for"===n?x(r,e=>"htmlFor"===kc(e)):"class"===n?x(r,e=>"className"===kc(e)):void 0)??OO(n,r,111551)}function PO(e,t){const n=FO(e,t);return n&&kc(n)}function AO(e,t,n){pn.assert(void 0!==t,"outername should always be defined");return Ve(e,t,n,void 0,!1,!1)}function IO(e,t){return t.exports&&OO(bc(e),ps(t),2623475)}function OO(e,t,n){return Mt(e,t,function(e){const t=kc(e);if(Qt(t,'"'))return;if(e.flags&n)return t;if(2097152&e.flags){const r=function(e){if(_a(e).aliasTarget!==kt)return Ha(e)}(e);if(r&&r.flags&n)return t}return})}function LO(e,t,n){const r=e&&106500&e.flags&&e.valueDeclaration;if(!r)return;const i=Pv(r,2),o=e.valueDeclaration&&Nc(e.valueDeclaration)&&dD(e.valueDeclaration.name);if((i||o)&&(!t||!dx(t)||65536&e.flags)){if(n){const n=mc(t,l_);if(n&&n.symbol===e)return}(1&cx(e)?_a(e).target:e).isReferenced=-1}}function jO(e,t){return 110===e.kind||!!t&&ub(e)&&t===zN(db(e))}function MO(e,t,n){return BO(e,212===e.kind&&108===e.expression.kind,!1,t,n)}function RO(e,t,n,r){if(rl(r))return!0;const i=Am(r,n);return!!i&&BO(e,t,!1,r,i)}function BO(e,t,n,r,i){if(rl(r))return!0;if(i.valueDeclaration&&Yl(i.valueDeclaration)){const t=em(i.valueDeclaration);return!xl(e)&&!!mc(e,e=>e===t)}return QI(e,t,n,r,i)}function JO(e){const t=e.initializer;if(262===t.kind){const e=t.declarations[0];if(e&&!w_(e.name))return Ss(e)}else if(80===t.kind)return zN(t)}function zO(e){return 1===cg(e).length&&!!lg(e,Wt)}function qO(e,t){return 64&e.flags?function(e,t){const n=WM(e.expression),r=Aw(n,e.expression);return Pw(UO(e,sO(r,e.expression),t),e,r!==n)}(e,t):UO(e,ZI(e.expression),t)}function UO(e,t,n){const r=0!==eh(e)||pO(e)?Kw(t):t,i=e.argumentExpression,o=WM(i);if(il(r)||r===un)return r;if(cM(r)&&!Ju(i))return Jo(i,fa.A_const_enum_member_can_only_be_accessed_using_a_string_literal),Et;const a=function(e){const t=_h(e);if(80===t.kind){const n=zN(t);if(3&n.flags){let t=e,r=e.parent;for(;r;){if(250===r.kind&&t===r.statement&&JO(r)===n&&zO(qM(r.expression)))return!0;t=r,r=r.parent}}}return!1}(i)?Wt:o,s=eh(e);let c;0===s?c=32:(c=4|(Lx(r)&&!HT(r)?2:0),2===s&&(c|=32));const l=Wx(r,a,c,e)||Et;return _R(SO(e,ua(e).resolvedSymbol,l,i,n),e)}function VO(e){return J_(e)||xF(e)||Tu(e)}function WO(e){return VO(e)&&p(e.typeArguments,az),216===e.kind?WM(e.template):Tu(e)?WM(e.attributes):AF(e)?WM(e.left):J_(e)&&p(e.arguments,e=>{WM(e)}),si}function $O(e){return WO(e),ci}function HO(e){return!!e&&(231===e.kind||238===e.kind&&e.isSpread)}function KO(e){return S(e,HO)}function GO(e){return!!(16384&e.flags)}function XO(e){return!!(49155&e.flags)}function QO(e,t,n,r=!1){if(QE(e))return!0;let i,o=!1,a=gj(n),s=hj(n);if(216===e.kind)if(i=t.length,229===e.template.kind){const t=xe(e.template.templateSpans);o=Pd(t.literal)||!!t.literal.isUnterminated}else{const t=e.template;pn.assert(15===t.kind),o=!!t.isUnterminated}else if(171===e.kind)i=mL(e,n);else if(227===e.kind)i=1;else if(Tu(e)){if(o=e.attributes.end===e.end,o)return!0;i=0===s?t.length:1,a=0===t.length?a:1,s=Math.min(s,1)}else{if(!e.arguments)return pn.assert(215===e.kind),0===hj(n);{i=r?t.length+1:t.length,o=e.arguments.end===e.end;const a=KO(t);if(a>=0)return a>=hj(n)&&(yj(n)||aa)return!1;if(o||i>=s)return!0;for(let t=i;t=r&&t.length<=n}function ZO(e,t){let n;return!!(e.target&&(n=pj(e.target,t))&&Ox(n))}function eL(e){return nL(e,0,!1)}function tL(e){return nL(e,0,!1)||nL(e,1,!1)}function nL(e,t,n){if(524288&e.flags){const r=Hp(e);if(n||0===r.properties.length&&0===r.indexInfos.length){if(0===t&&1===r.callSignatures.length&&0===r.constructSignatures.length)return r.callSignatures[0];if(1===t&&1===r.constructSignatures.length&&0===r.callSignatures.length)return r.constructSignatures[0]}}}function rL(e,t,n,r){const i=tN(Ih(e),e,0,r),o=vj(t),a=n&&(o&&262144&o.flags?n.nonFixingMapper:n.mapper);return Zw(a?gS(t,a):t,e,(e,t)=>{EN(i.inferences,e,t)}),n||eN(t,e,(e,t)=>{EN(i.inferences,e,t,128)}),Eh(e,BN(i),Om(t.declaration))}function iL(e){if(!e)return ln;const t=WM(e);return xb(e)?t:kl(e.parent)?Dw(t):xl(e.parent)?Ew(t):t}function oL(e,t,n,r,i){if(Tu(e))return function(e,t,n,r){const i=eI(t,e),o=kM(e.attributes,i,r,n);return EN(r.inferences,o,i),BN(r)}(e,t,r,i);if(171!==e.kind&&227!==e.kind){const n=b(t.typeParameters,e=>!!wf(e)),r=$A(e,n?8:0);if(r){const o=gh(t);if(dN(o)){const a=ZA(e);if(!(!n&&$A(e,8)!==r)){const e=CS(r,uN(nN(a,1))),t=eL(e),n=t&&t.typeParameters?Bh(Ph(t,t.typeParameters)):e;EN(i.inferences,n,o,128)}const s=tN(t.typeParameters,t,i.flags),c=CS(r,a&&function(e){return e.outerReturnMapper??(e.outerReturnMapper=uS(e.returnMapper,nN(e).mapper))}(a));EN(s.inferences,c,o),i.returnMapper=H(s.inferences,MM)?uN(function(e){const t=D(e.inferences,MM);return t.length?oN(P(t,_N),e.signature,e.flags,e.compareTypes):void 0}(s)):void 0}}}const o=bj(t),a=o?Math.min(gj(t)-1,n.length):n.length;if(o&&262144&o.flags){const e=x(i.inferences,e=>e.typeParameter===o);e&&(e.impliedArity=S(n,HO,a)<0?n.length-a:void 0)}const s=rh(t);if(s&&dN(s)){const t=dL(e);EN(i.inferences,iL(t),s)}for(let e=0;e=n-1){const t=e[n-1];if(HO(t)){const e=238===t.kind?t.type:kM(t.expression,r,i,o);return QC(e)?aL(e):Kv(wB(33,e,Lt,231===t.kind?t.expression:t),a)}}const s=[],c=[],l=[];for(let _=t;_ik(void 0,fa.Type_0_does_not_satisfy_the_constraint_1):void 0,l=r||fa.Type_0_does_not_satisfy_the_constraint_1;s||(s=nS(o,a));const _=a[e];if(!VS(_,Id(CS(i,s),_),n?t[e]:void 0,l,c))return}}return a}function lL(e){if(xI(e.tagName))return 2;const t=qf(WM(e.tagName));return d(Jm(t,1))?0:d(Jm(t,0))?1:2}function _L(e){return AA(e,Om(e)?-2147483615:33)}function uL(e,t,n,r,i,o,a){const s={errors:void 0,skipLogging:!0};if(Cu(e))return function(e,t,n,r,i,o,a){const s=eI(t,e),c=QE(e)?SI(e):kM(e.attributes,s,void 0,r),l=4&r?zw(c):c;return function(){var t;if(DI(e))return!0;const n=!KE(e)&&!HE(e)||xI(e.tagName)||rP(e.tagName)?void 0:WM(e.tagName);if(!n)return!0;const r=Jm(n,0);if(!d(r))return!0;const o=pq(e);if(!o)return!0;const s=ns(o,111551,!0,!1,e);if(!s)return!0;const c=Jm(z_(s),0);if(!d(c))return!0;let l=!1,_=0;for(const e of c){const t=Jm(dj(e,0),0);if(d(t))for(const e of t){if(l=!0,yj(e))return!0;const t=gj(e);t>_&&(_=t)}}if(!l)return!0;let u=1/0;for(const e of r){const t=hj(e);t{n.push(e.expression)}),n}if(171===e.kind)return function(e){const t=e.expression,n=Mj(e);if(n){const e=[];for(const r of n.parameters){const n=z_(r);e.push(pL(t,n))}return e}return pn.fail()}(e);if(227===e.kind)return[e.left];if(Tu(e))return e.attributes.properties.length>0||KE(e)&&e.parent.children.length>0?[e.attributes]:_;const t=e.arguments||_,n=KO(t);if(n>=0){const e=t.slice(0,n);for(let r=n;r{var o;const a=i.target.elementFlags[r],s=pL(n,4&a?Kv(t):t,!!(12&a),null==(o=i.target.labeledElementDeclarations)?void 0:o[r]);e.push(s)}):e.push(n)}return e}return t}function mL(e,t){return j.experimentalDecorators?function(e,t){switch(e.parent.kind){case 264:case 232:return 1;case 173:return Rv(e.parent)?3:2;case 175:case 178:case 179:return t.parameters.length<=2?2:3;case 170:return 3;default:return pn.fail()}}(e,t):Math.min(Math.max(gj(t),1),2)}function gL(e){const t=Sd(e),{start:n,length:r}=tf(t,hF(e.expression)?e.expression.name:e.expression);return{start:n,length:r,sourceFile:t}}function hL(e,t,...n){if(vF(e)){const{sourceFile:r,start:i,length:o}=gL(e);return"message"in t?ek(r,i,o,t,...n):Gp(r,t)}return"message"in t?qp(e,t,...n):Wp(Sd(e),e,t)}function yL(e,t,n,r){var i;const o=KO(n);if(o>-1)return qp(n[o],fa.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);let a,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,_=Number.POSITIVE_INFINITY;for(const e of t){const t=hj(e),r=gj(e);tl&&(l=t),n.length1&&(y=I(S,bo,C,N)),y||(y=I(S,ko,C,N));const F=ua(e);if(F.resolvedSignature!==li&&!n)return pn.assert(F.resolvedSignature),F.resolvedSignature;if(y)return y;if(y=function(e,t,n,r,i){return pn.assert(t.length>0),lz(e),r||1===t.length||t.some(e=>!!e.typeParameters)?function(e,t,n,r){const i=function(e,t){let n=-1,r=-1;for(let i=0;i=t)return i;a>r&&(r=a,n=i)}return n}(t,void 0===Ee?n.length:Ee),o=t[i],{typeParameters:a}=o;if(!a)return o;const s=VO(e)?e.typeArguments:void 0,c=s?Ah(o,function(e,t,n){const r=e.map(Dz);for(;r.length>t.length;)r.pop();for(;r.lengthe.thisParameter);let n;t.length&&(n=xL(t,t.map(oj)));const{min:r,max:i}=dT(e,bL),o=[];for(let t=0;thJ(e)?tpj(e,t))))}const a=J(e,e=>hJ(e)?xe(e.parameters):void 0);let s=128;if(0!==a.length){const t=Kv(zb(J(e,Fh),2));o.push(kL(a,t)),s|=1}e.some(yJ)&&(s|=2);return Ld(e[0].declaration,void 0,n,o,Gb(e.map(gh)),void 0,r,s)}(t)}(e,S,T,!!n,r),F.resolvedSignature=y,f)if(!o&&u&&(o=fa.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method),m)if(1===m.length||m.length>3){const t=m[m.length-1];let n;m.length>3&&(n=ik(n,fa.The_last_overload_gave_the_following_error),n=ik(n,fa.No_overload_matches_this_call)),o&&(n=ik(n,o));const r=uL(e,T,t,ko,0,!0,()=>n);if(r)for(const e of r)t.declaration&&m.length>3&&uT(e,qp(t.declaration,fa.The_last_overload_is_declared_here)),A(t,e),ho.add(e);else pn.fail("No error for last overload signature")}else{const t=[];let n=0,r=Number.MAX_VALUE,i=0,a=0;for(const o of m){const s=uL(e,T,o,ko,0,!0,()=>ik(void 0,fa.Overload_0_of_1_2_gave_the_following_error,a+1,S.length,gc(o)));s?(s.length<=r&&(r=s.length,i=a),n=Math.max(n,s.length),t.push(s)):pn.fail("No error for 3 or fewer overload signatures"),a++}const s=n>1?t[i]:O(t);pn.assert(s.length>0,"No errors reported for 3 or fewer overload signatures");let c=ik(P(s,Xp),fa.No_overload_matches_this_call);o&&(c=ik(c,o));const l=[...L(s,e=>e.relatedInformation)];let _;if(b(s,e=>e.start===s[0].start&&e.length===s[0].length&&e.file===s[0].file)){const{file:e,start:t,length:n}=s[0];_={file:e,start:t,length:n,code:c.code,category:c.category,messageText:c,relatedInformation:l}}else _=Wp(Sd(e),J_(E=e)?hF(E.expression)?E.expression.name:E.expression:xF(E)?hF(E.tag)?E.tag.name:E.tag:Tu(E)?E.tagName:E,c,l);A(m[0],_),ho.add(_)}else if(g)ho.add(yL(e,[g],T,o));else if(h)cL(h,e.typeArguments,!0,o);else if(!l){const n=D(t,e=>YO(e,v));0===n.length?ho.add(function(e,t,n,r){const i=n.length;if(1===t.length){const o=t[0],a=Mg(o.typeParameters),s=d(o.typeParameters);if(r){let t=ik(void 0,fa.Expected_0_type_arguments_but_got_1,ai?a=Math.min(a,t):n1?x(s,e=>l_(e)&&Ad(e.body)):void 0;if(c){const e=zg(c),n=!e.typeParameters;I([e],ko,n)&&uT(t,qp(c,fa.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible))}m=i,g=o,h=a}function I(t,n,r,i=!1){if(m=void 0,g=void 0,h=void 0,r){const r=t[0];if(H(v)||!QO(e,T,r,i))return;return uL(e,T,r,n,0,!1,void 0)?void(m=[r]):r}for(let r=0;r!!(4&e.flags)))return Jo(e,fa.Cannot_create_an_instance_of_an_abstract_class),$O(e);const o=r.symbol&&bx(r.symbol);return o&&Av(o,64)?(Jo(e,fa.Cannot_create_an_instance_of_an_abstract_class),$O(e)):vL(e,i,t,n,0)}const o=Jm(r,0);if(o.length){const r=vL(e,o,t,n,0);return te||(r.declaration&&!ML(r.declaration)&&gh(r)!==ln&&Jo(e,fa.Only_a_void_function_can_be_called_with_the_new_keyword),rh(r)===ln&&Jo(e,fa.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)),r}return FL(e.expression,r,1),$O(e)}function wL(e,t){return Ze(e)?H(e,e=>wL(e,t)):1048576===e.compositeKind?H(e.compositeSignatures,t):t(e)}function NL(e,t){const n=gu(t);if(!d(n))return!1;const r=n[0];if(2097152&r.flags){const t=Kd(r.types);let n=0;for(const i of r.types){if(!t[n]&&3&xx(i)){if(i.symbol===e)return!0;if(NL(e,i))return!0}n++}return!1}return r.symbol===e||NL(e,r)}function DL(e,t,n){let r;const i=0===n,o=CR(t),a=o&&Jm(o,n).length>0;if(1048576&t.flags){const e=t.types;let o=!1;for(const a of e){if(0!==Jm(a,n).length){if(o=!0,r)break}else if(r||(r=ik(r,i?fa.Type_0_has_no_call_signatures:fa.Type_0_has_no_construct_signatures,Sc(a)),r=ik(r,i?fa.Not_all_constituents_of_type_0_are_callable:fa.Not_all_constituents_of_type_0_are_constructable,Sc(t))),o)break}o||(r=ik(void 0,i?fa.No_constituent_of_type_0_is_callable:fa.No_constituent_of_type_0_is_constructable,Sc(t))),r||(r=ik(r,i?fa.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:fa.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other,Sc(t)))}else r=ik(r,i?fa.Type_0_has_no_call_signatures:fa.Type_0_has_no_construct_signatures,Sc(t));let s=i?fa.This_expression_is_not_callable:fa.This_expression_is_not_constructable;if(vF(e.parent)&&0===e.parent.arguments.length){const{resolvedSymbol:t}=ua(e);t&&32768&t.flags&&(s=fa.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without)}return{messageChain:ik(r,s),relatedMessage:a?fa.Did_you_forget_to_use_await:void 0}}function FL(e,t,n,r){const{messageChain:i,relatedMessage:o}=DL(e,t,n),a=Wp(Sd(e),e,i);if(o&&uT(a,qp(e,o)),vF(e.parent)){const{start:t,length:n}=gL(e.parent);a.start=t,a.length=n}ho.add(a),EL(t,n,r?uT(a,r):a)}function EL(e,t,n){if(!e.symbol)return;const r=_a(e.symbol).originatingImport;if(r&&!ff(r)){const i=Jm(z_(_a(e.symbol).target),t);if(!i||!i.length)return;uT(n,qp(r,fa.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 PL(e,t,n){const r=WM(e.expression),i=qf(r);if(il(i))return $O(e);const o=Jm(i,0),a=Jm(i,1).length;if(TL(r,i,o.length,a))return WO(e);if(s=e,(c=o).length&&b(c,e=>0===e.minArgumentCount&&!hJ(e)&&e.parameters.lengthOm(e.declaration)&&!!qc(e.declaration))?(Jo(e,fa.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,Sc(i)),$O(e)):vL(e,a,t,n,r)}(e,t,n);case 215:return CL(e,t,n);case 216:return function(e,t,n){const r=WM(e.tag),i=qf(r);if(il(i))return $O(e);const o=Jm(i,0),a=Jm(i,1).length;if(TL(r,i,o.length,a))return WO(e);if(!o.length){if(mF(e.parent)){const t=qp(e.tag,fa.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);return ho.add(t),$O(e)}return FL(e.tag,i,0),$O(e)}return vL(e,o,t,n,0)}(e,t,n);case 171:return PL(e,t,n);case 290:case 287:case 286:return OL(e,t,n);case 227:return function(e,t,n){const r=WM(e.right);if(!rl(r)){const i=_M(r);if(i){const r=qf(i);if(il(r))return $O(e);const o=Jm(r,0),a=Jm(r,1);if(TL(i,r,o.length,a.length))return WO(e);if(o.length)return vL(e,o,t,n,0)}else if(!Oz(r)&&!RS(r,Xn))return Jo(e.right,fa.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),$O(e)}return si}(e,t,n)}pn.assertNever(e,"Branch in 'resolveSignature' should be unreachable.")}function jL(e,t,n){const r=ua(e),i=r.resolvedSignature;if(i&&i!==li&&!t)return i;const o=$i;i||($i=Ui.length),r.resolvedSignature=li;const a=LL(e,t,n||0);return $i=o,a!==li&&(r.resolvedSignature=Si===Ti?a:i),a}function ML(e){var t;if(!e||!Om(e))return!1;const n=gE(e)||TF(e)?e:(fE(e)||cP(e))&&e.initializer&&TF(e.initializer)?e.initializer:void 0;if(n){if(qc(e))return!0;if(cP(sh(n.parent)))return!1;const r=Ss(n);return!!(null==(t=null==r?void 0:r.members)?void 0:t.size)}return!1}function RL(e,t){var n,r;if(t){const i=_a(t);if(!i.inferredClassSymbol||!i.inferredClassSymbol.has(uJ(e))){const o=ed(e)?e:ta(e);return o.exports=o.exports||Zu(),o.members=o.members||Zu(),o.flags|=32&t.flags,(null==(n=t.exports)?void 0:n.size)&&aa(o.exports,t.exports),(null==(r=t.members)?void 0:r.size)&&aa(o.members,t.members),(i.inferredClassSymbol||(i.inferredClassSymbol=new Map)).set(uJ(o),o),o}return i.inferredClassSymbol.get(uJ(e))}}function BL(e,t){if(!e.parent)return;let n,r;if(fE(e.parent)&&e.parent.initializer===e){if(!(Om(e)||tU(e.parent)&&l_(e)))return;n=e.parent.name,r=e.parent}else if(AF(e.parent)){const i=e.parent,o=e.parent.operatorToken.kind;if(64!==o||!t&&i.right!==e){if(!(57!==o&&61!==o||(fE(i.parent)&&i.parent.initializer===i?(n=i.parent.name,r=i.parent):AF(i.parent)&&64===i.parent.operatorToken.kind&&(t||i.parent.right===i)&&(n=i.parent.left,r=n),n&&ug(n)&&eg(n,i.left))))return}else n=i.left,r=n}else t&&gE(e)&&(n=e.name,r=e);return r&&n&&(t||Qm(e,gb(n)))?Ts(r):void 0}function JL(e,t){var n,r,i,o;if(!(128&e.flags)&&(e.declaration&&536870912&e.declaration.flags)){const a=zL(t),s=mb(mm(t));n=a,r=e.declaration,i=s,o=gc(e),$o(r,i?qp(n,fa.The_signature_0_of_1_is_deprecated,o,i):qp(n,fa._0_is_deprecated,o))}}function zL(e){switch((e=_h(e)).kind){case 214:case 171:case 215:return zL(e.expression);case 216:return zL(e.tag);case 287:case 286:return zL(e.tagName);case 213:return e.argumentExpression;case 212:return e.name;case 184:const t=e;return wD(t.typeName)?t.typeName.right:t;default:return e}}function qL(e){if(!vF(e))return!1;let t=e.expression;if(hF(t)&&"for"===t.name.escapedText&&(t=t.expression),!uD(t)||"Symbol"!==t.escapedText)return!1;const n=sv(!1);return!!n&&n===Ue(t,"Symbol",111551,void 0,!1)}function UL(e){if(function(e){if(j.verbatimModuleSyntax&&1===R)return Wq(e,zo(e));if(237===e.expression.kind){if(99!==R&&200!==R)return Wq(e,fa.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve)}else if(5===R)return Wq(e,fa.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext);if(e.typeArguments)return Wq(e,fa.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);const t=e.arguments;if(!(100<=R&&R<=199)&&99!==R&&200!==R&&(xq(t),t.length>1)){return Wq(t[1],fa.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve)}if(0===t.length||t.length>2)return Wq(e,fa.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);const n=x(t,jF);if(n)return Wq(n,fa.Argument_of_dynamic_import_cannot_be_spread_element)}(e),0===e.arguments.length)return Jj(e,wt);const t=e.arguments[0],n=SM(t),r=e.arguments.length>1?SM(e.arguments[1]):void 0;for(let t=2;t!!e.typeParameters&&YO(e,n)),e=>{const t=cL(e,n,!0);return t?Eh(e,t,Om(e.declaration)):e})}}function tj(e,t,n){const r=WM(e,n),i=$k(t);if(il(i))return i;return WS(r,i,mc(t.parent,e=>239===e.kind||351===e.kind),e,fa.Type_0_does_not_satisfy_the_expected_type_1),r}function nj(e){return function(e){const t=e.name.escapedText;switch(e.keywordToken){case 105:if("target"!==t)return Wq(e.name,fa._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,vc(e.name.escapedText),Ia(e.keywordToken),"target");break;case 102:if("meta"!==t){const n=vF(e.parent)&&e.parent.expression===e;if("defer"!==t)return n?Wq(e.name,fa._0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer,vc(e.name.escapedText)):Wq(e.name,fa._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,vc(e.name.escapedText),Ia(e.keywordToken),"meta");if(!n)Vq(e,e.end,0,fa._0_expected,"(")}}}(e),105===e.keywordToken?ij(e):102===e.keywordToken?"defer"===e.name.escapedText?(pn.assert(!vF(e.parent)||e.parent.expression!==e,"Trying to get the type of `import.defer` in `import.defer(...)`"),Et):function(e){100<=R&&R<=199?99!==Sd(e).impliedNodeFormat&&Jo(e,fa.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output):R<6&&4!==R&&Jo(e,fa.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext);const t=Sd(e);return pn.assert(!!(8388608&t.flags),"Containing file is missing import meta node flag."),"meta"===e.name.escapedText?rv():Et}(e):pn.assertNever(e.keywordToken)}function rj(e){switch(e.keywordToken){case 102:return iv();case 105:const t=ij(e);return il(t)?Et:function(e){const t=Xo(0,"NewTargetExpression"),n=Xo(4,"target",8);n.parent=t,n.links.type=e;const r=Zu([n]);return t.members=r,Hs(t,r,_,_,_)}(t);default:pn.assertNever(e.keywordToken)}}function ij(e){const t=sm(e);if(t){if(177===t.kind){return z_(Ss(t.parent))}return z_(Ss(t))}return Jo(e,fa.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor,"new.target"),Et}function oj(e){const t=e.valueDeclaration;return Al(z_(e),!1,!!t&&(Ou(t)||tC(t)))}function aj(e,t,n){switch(e.name.kind){case 80:{const r=e.name.escapedText;return e.dotDotDotToken?12&n?r:`${r}_${t}`:3&n?r:`${r}_n`}case 208:if(e.dotDotDotToken){const r=e.name.elements,i=rt(be(r),fF),o=r.length-((null==i?void 0:i.dotDotDotToken)?1:0);if(t=r-1)return t===r-1?o:Kv(Ux(o,Wt));const a=[],s=[],c=[];for(let n=t;n!(1&e)),i=r<0?n.target.fixedLength:r;i>0&&(t=e.parameters.length-1+i)}}if(void 0===t){if(!n&&32&e.flags)return 0;t=e.minArgumentCount}if(r)return t;for(let n=t-1;n>=0;n--){if(131072&OF(dj(e,n),GO).flags)break;t=n}e.resolvedMinArgumentCount=t}return e.resolvedMinArgumentCount}function yj(e){if(hJ(e)){const t=z_(e.parameters[e.parameters.length-1]);return!fw(t)||!!(12&t.target.combinedFlags)}return!1}function vj(e){if(hJ(e)){const t=z_(e.parameters[e.parameters.length-1]);if(!fw(t))return rl(t)?cr:t;if(12&t.target.combinedFlags)return Nb(t,t.target.fixedLength)}}function bj(e){const t=vj(e);return!t||$C(t)||rl(t)?void 0:t}function xj(e){return kj(e,_n)}function kj(e,t){return e.parameters.length>0?dj(e,0):t}function Sj(e,t,n){const r=e.parameters.length-(hJ(e)?1:0);for(let i=0;i=0);const i=jD(e.parent)?z_(Ss(e.parent.parent)):Pz(e.parent),o=jD(e.parent)?Lt:Az(e.parent),a=Pk(r),s=Qo("target",i),c=Qo("propertyKey",o),l=Qo("parameterIndex",a);n.decoratorSignature=DR(void 0,void 0,[s,c,l],ln);break}case 175:case 178:case 179:case 173:{const e=t;if(!m_(e.parent))break;const r=Qo("target",Pz(e)),i=Qo("propertyKey",Az(e)),o=AD(e)?ln:$v(Dz(e));if(!AD(t)||Rv(t)){const t=Qo("descriptor",$v(Dz(e)));n.decoratorSignature=DR(void 0,void 0,[r,i,t],zb([o,ln]))}else n.decoratorSignature=DR(void 0,void 0,[r,i],zb([o,ln]));break}}return n.decoratorSignature===si?void 0:n.decoratorSignature}(e):jj(e)}function Rj(e){const t=gv(!0);return t!==On?hy(t,[e=wR(kR(e))||Ot]):Ot}function Bj(e){const t=hv(!0);return t!==On?hy(t,[e=wR(kR(e))||Ot]):Ot}function Jj(e,t){const n=Rj(t);return n===Ot?(Jo(e,ff(e)?fa.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:fa.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option),Et):(vv(!0)||Jo(e,ff(e)?fa.A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:fa.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option),n)}function zj(e,t){if(!e.body)return Et;const n=Rh(e),r=!!(2&n),i=!!(1&n);let o,a,s,c=ln;if(242!==e.body.kind)o=SM(e.body,t&&-9&t),r&&(o=kR(vR(o,!1,e,fa.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)));else if(i){const n=Hj(e,t);n?n.length>0&&(o=zb(n,2)):c=_n;const{yieldTypes:r,nextTypes:i}=function(e,t){const n=[],r=[],i=!!(2&Rh(e));return If(e.body,e=>{const o=e.expression?WM(e.expression,t):jt;let a;if(_e(n,Uj(e,o,wt,i)),e.asteriskToken){const t=OB(o,i?19:17,e.expression);a=t&&t.nextType}else a=$A(e,void 0);a&&_e(r,a)}),{yieldTypes:n,nextTypes:r}}(e,t);a=H(r)?zb(r,2):void 0,s=H(i)?Gb(i):void 0}else{const r=Hj(e,t);if(!r)return 2&n?Jj(e,_n):_n;if(0===r.length){const t=yA(e,void 0),r=t&&32768&(iJ(t,n)||ln).flags?Lt:ln;return 2&n?Jj(e,r):r}o=zb(r,2)}if(o||a||s){if(a&&Yw(e,a,3),o&&Yw(e,o,1),s&&Yw(e,s,2),o&&ow(o)||a&&ow(a)||s&&ow(s)){const t=iI(e),n=t?t===zg(e)?i?void 0:o:VA(gh(t),e,void 0):void 0;i?(a=pw(a,n,0,r),o=pw(o,n,1,r),s=pw(s,n,2,r)):o=function(e,t,n){e&&ow(e)&&(e=dw(e,t?n?yR(t):t:void 0));return e}(o,n,r)}a&&(a=Kw(a)),o&&(o=Kw(o)),s&&(s=Kw(s))}return i?qj(a||_n,o||c,s||hA(2,e)||Ot,r):r?Rj(o||c):o||c}function qj(e,t,n,r){const i=r?yi:vi,o=i.getGlobalGeneratorType(!1);if(e=i.resolveIterationType(e,void 0)||Ot,t=i.resolveIterationType(t,void 0)||Ot,o===On){const r=i.getGlobalIterableIteratorType(!1);return r!==On?Wv(r,[e,t,n]):(i.getGlobalIterableIteratorType(!0),Nn)}return Wv(o,[e,t,n])}function Uj(e,t,n,r){if(t===un)return un;const i=e.expression||e,o=e.asteriskToken?wB(r?19:17,t,n,i):t;return r?CR(o,i,e.asteriskToken?fa.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:fa.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o}function Vj(e,t,n){let r=0;for(let i=0;i=t?n[i]:void 0;r|=void 0!==o?rJ.get(o)||32768:0}return r}function Wj(e){const t=ua(e);if(void 0===t.isExhaustive){t.isExhaustive=0;const n=function(e){if(222===e.expression.kind){const t=uF(e);if(!t)return!1;const n=kf(SM(e.expression.expression)),r=Vj(0,0,t);return 3&n.flags?!(556800&~r):!DF(n,e=>cD(e,r)===r)}const t=kf(SM(e.expression));if(!sw(t))return!1;const n=_F(e);if(!n.length||H(n,iw))return!1;return r=zF(t,kk),i=n,1048576&r.flags?!p(r.types,e=>!C(i,e)):C(i,r);var r,i}(e);0===t.isExhaustive&&(t.isExhaustive=n)}else 0===t.isExhaustive&&(t.isExhaustive=!1);return t.isExhaustive}function $j(e){return e.endFlowNode&&SE(e.endFlowNode)}function Hj(e,t){const n=Rh(e),r=[];let i=$j(e),o=!1;if(Af(e.body,a=>{let s=a.expression;if(s){if(s=_h(s,!0),2&n&&224===s.kind&&(s=_h(s.expression,!0)),214===s.kind&&80===s.expression.kind&&SM(s.expression).symbol===ks(e.symbol)&&(!UT(e.symbol.valueDeclaration)||AE(s.expression)))return void(o=!0);let i=SM(s,t&&-9&t);2&n&&(i=kR(vR(i,!1,e,fa.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member))),131072&i.flags&&(o=!0),_e(r,i)}else i=!0}),0!==r.length||i||!o&&!function(e){switch(e.kind){case 219:case 220:return!0;case 175:return 211===e.parent.kind;default:return!1}}(e))return!($&&r.length&&i)||ML(e)&&r.some(t=>t.symbol===e.symbol)||_e(r,Lt),r}function Kj(e,t){return void a(function(){const n=Rh(e),r=t&&iJ(t,n);if(r&&(oM(r,16384)||32769&r.flags))return;if(174===e.kind||Pd(e.body)||242!==e.body.kind||!$j(e))return;const i=1024&e.flags,o=bv(e)||e;if(r&&131072&r.flags)Jo(o,fa.A_function_returning_never_cannot_have_a_reachable_end_point);else if(r&&!i)Jo(o,fa.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value);else if(r&&$&&!JS(Lt,r))Jo(o,fa.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);else if(j.noImplicitReturns){if(!r){if(!i)return;const t=gh(zg(e));if(oJ(e,t))return}Jo(o,fa.Not_all_code_paths_return_a_value)}})}function Gj(e,t){if(pn.assert(175!==e.kind||Vf(e)),lz(e),TF(e)&&lB(e,e.name),t&&4&t&&ES(e)){if(!bv(e)&&!JT(e)){const n=oI(e);if(n&&dN(gh(n))){const n=ua(e);if(n.contextFreeType)return n.contextFreeType;const r=zj(e,t),i=Ld(void 0,void 0,void 0,_,r,void 0,0,64),o=Hs(e.symbol,F,[i],_,_);return o.objectFlags|=262144,n.contextFreeType=o}}return Ln}return Tq(e)||219!==e.kind||Fq(e),function(e,t){const n=ua(e);if(!(64&n.flags)){const r=oI(e);if(!(64&n.flags)){n.flags|=64;const i=ge(Jm(z_(Ss(e)),0));if(!i)return;if(ES(e))if(r){const n=ZA(e);let o;if(t&&2&t){Sj(i,r,n);const e=vj(r);e&&262144&e.flags&&(o=gS(r,n.nonFixingMapper))}o||(o=n?gS(r,n.mapper):r),function(e,t){if(t.typeParameters){if(e.typeParameters)return;e.typeParameters=t.typeParameters}if(t.thisParameter){const n=e.thisParameter;(!n||n.valueDeclaration&&!n.valueDeclaration.type)&&(n||(e.thisParameter=Rw(t.thisParameter,void 0)),Tj(e.thisParameter,z_(t.thisParameter)))}const n=e.parameters.length-(hJ(e)?1:0);for(let r=0;re.parameters.length){const n=ZA(e);t&&2&t&&Sj(i,r,n)}if(r&&!Ch(e)&&!i.resolvedReturnType){const n=zj(e,t);i.resolvedReturnType||(i.resolvedReturnType=n)}GM(e)}}}(e,t),z_(Ss(e))}function Xj(e,t,n,r=!1){if(!JS(t,yn)){const i=r&&hR(t);return Wo(e,!!i&&JS(i,yn),n),!1}return!0}function Qj(e){if(!vF(e))return!1;if(!ag(e))return!1;const t=SM(e.arguments[2]);if(Zc(t,"value")){const e=Am(t,"writable"),n=e&&z_(e);if(!n||n===Ht||n===Kt)return!0;if(e&&e.valueDeclaration&&cP(e.valueDeclaration)){const t=WM(e.valueDeclaration.initializer);if(t===Ht||t===Kt)return!0}return!1}return!Am(t,"set")}function Yj(e){return!!(8&cx(e)||4&e.flags&&8&lx(e)||3&e.flags&&6&KI(e)||98304&e.flags&&!(65536&e.flags)||8&e.flags||H(e.declarations,Qj))}function Zj(e,t,n){var r,i;if(0===n)return!1;if(Yj(t)){if(4&t.flags&&Dx(e)&&110===e.expression.kind){const n=LE(e);if(!n||177!==n.kind&&!ML(n))return!0;if(t.valueDeclaration){const e=AF(t.valueDeclaration),o=n.parent===t.valueDeclaration.parent,a=n===t.valueDeclaration.parent,s=e&&(null==(r=t.parent)?void 0:r.valueDeclaration)===n.parent,c=e&&(null==(i=t.parent)?void 0:i.valueDeclaration)===n;return!(o||a||s||c)}}return!0}if(Dx(e)){const t=_h(e.expression);if(80===t.kind){const e=ua(t).resolvedSymbol;if(2097152&e.flags){const t=Ca(e);return!!t&&275===t.kind}}}return!1}function eM(e,t,n){const r=AA(e,39);return 80===r.kind||Dx(r)?!(64&r.flags)||(Jo(e,n),!1):(Jo(e,t),!1)}function tM(e){WM(e.expression);const t=_h(e.expression);if(!Dx(t))return Jo(t,fa.The_operand_of_a_delete_operator_must_be_a_property_reference),on;hF(t)&&dD(t.name)&&Jo(t,fa.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);const n=As(ua(t).resolvedSymbol);return n&&(Yj(n)?Jo(t,fa.The_operand_of_a_delete_operator_cannot_be_a_read_only_property):function(e,t){const n=z_(t);!$||131075&n.flags||(se?16777216&t.flags:lD(n,16777216))||Jo(e,fa.The_operand_of_a_delete_operator_must_be_optional)}(t,n)),on}function nM(e){let t=!1;const n=nm(e);if(n&&LD(n)){Jo(e,FF(e)?fa.await_expression_cannot_be_used_inside_a_class_static_block:fa.await_using_statements_cannot_be_used_inside_a_class_static_block),t=!0}else if(!(65536&e.flags))if(am(e)){const n=Sd(e);if(!qq(n)){let r;if(!xp(n,j)){r??(r=Zp(n,e.pos));const i=FF(e)?fa.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:fa.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,o=ek(n,r.start,r.length,i);ho.add(o),t=!0}switch(R){case 100:case 101:case 102:case 199:if(1===n.impliedNodeFormat){r??(r=Zp(n,e.pos)),ho.add(ek(n,r.start,r.length,fa.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)),t=!0;break}case 7:case 99:case 200:case 4:if(M>=4)break;default:r??(r=Zp(n,e.pos));const i=FF(e)?fa.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:fa.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;ho.add(ek(n,r.start,r.length,i)),t=!0}}}else{const r=Sd(e);if(!qq(r)){const i=Zp(r,e.pos),o=FF(e)?fa.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:fa.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules,a=ek(r,i.start,i.length,o);if(n&&177!==n.kind&&!(2&Rh(n))){uT(a,qp(n,fa.Did_you_mean_to_mark_this_function_as_async))}ho.add(a),t=!0}}return FF(e)&&gA(e)&&(Jo(e,fa.await_expressions_cannot_be_used_in_a_parameter_initializer),t=!0),t}function rM(e){return oM(e,2112)?aM(e,3)||oM(e,296)?yn:$t:Wt}function iM(e,t){if(oM(e,t))return!0;const n=kf(e);return!!n&&oM(n,t)}function oM(e,t){if(e.flags&t)return!0;if(3145728&e.flags){const n=e.types;for(const e of n)if(oM(e,t))return!0}return!1}function aM(e,t,n){return!!(e.flags&t)||!(n&&114691&e.flags)&&(!!(296&t)&&JS(e,Wt)||!!(2112&t)&&JS(e,$t)||!!(402653316&t)&&JS(e,Ut)||!!(528&t)&&JS(e,on)||!!(16384&t)&&JS(e,ln)||!!(131072&t)&&JS(e,_n)||!!(65536&t)&&JS(e,zt)||!!(32768&t)&&JS(e,Lt)||!!(4096&t)&&JS(e,sn)||!!(67108864&t)&&JS(e,mn))}function sM(e,t,n){return 1048576&e.flags?b(e.types,e=>sM(e,t,n)):aM(e,t,n)}function cM(e){return!!(16&xx(e))&&!!e.symbol&&lM(e.symbol)}function lM(e){return!!(128&e.flags)}function _M(e){const t=BB("hasInstance");if(sM(e,67108864)){const n=Am(e,t);if(n){const e=z_(n);if(e&&0!==Jm(e,0).length)return e}}}function uM(e,t,n,r){if(n===un||r===un)return un;if(dD(e)){if((Me===An||!!(2097152&e.flags)&&_T(kf(e)))&&Jo(t,fa.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator,Sc(r)),on}function dM(e,t,n,r,i=!1){const o=e.properties,a=o[n];if(304===a.kind||305===a.kind){const e=a.name,n=rx(e);if(dC(n)){const e=Am(t,pC(n));e&&(LO(e,a,i),XI(a,!1,!0,t,e))}const r=gl(a,Ux(t,n,32|(sI(a)?16:0),e));return fM(305===a.kind?a:a.initializer,r)}if(306===a.kind){if(!(nNb(e,n)):Kv(r),i)}Jo(o.operatorToken,fa.A_rest_element_cannot_have_an_initializer)}}}function fM(e,t,n,r){let i;if(305===e.kind){const r=e;r.objectAssignmentInitializer&&($&&!lD(WM(r.objectAssignmentInitializer),16777216)&&(t=pD(t,524288)),function(e,t,n,r,i){const o=t.kind;if(64===o&&(211===e.kind||210===e.kind))return fM(e,WM(n,r),r,110===n.kind);let a;a=Zv(o)?kB(e,r):WM(e,r);const s=WM(n,r);yM(e,t,n,a,s,r,i)}(r.name,r.equalsToken,r.objectAssignmentInitializer,n)),i=e.name}else i=e;return 227===i.kind&&64===i.operatorToken.kind&&(de(i,n),i=i.left,$&&(t=pD(t,524288))),211===i.kind?function(e,t,n){const r=e.properties;if($&&0===r.length)return sO(t,e);for(let i=0;i=32&&Vo(uP(sh(n.parent.parent)),s||t,fa.This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2,ep(e),Ia(c),r.value%32)}return l}case 40:case 65:if(r===un||i===un)return un;let h;if(aM(r,402653316)||aM(i,402653316)||(r=sO(r,e),i=sO(i,n)),aM(r,296,!0)&&aM(i,296,!0)?h=Wt:aM(r,2112,!0)&&aM(i,2112,!0)?h=$t:aM(r,402653316,!0)||aM(i,402653316,!0)?h=Ut:(rl(r)||rl(i))&&(h=il(r)||il(i)?Et:wt),h&&!d(c))return h;if(!h){const e=402655727;return m((t,n)=>aM(t,e)&&aM(n,e)),wt}return 65===c&&p(h),h;case 30:case 32:case 33:case 34:return d(c)&&(r=lw(sO(r,e)),i=lw(sO(i,n)),f((e,t)=>{if(rl(e)||rl(t))return!0;const n=JS(e,yn),r=JS(t,yn);return n&&r||!n&&!r&&US(e,t)})),on;case 35:case 36:case 37:case 38:if(!(o&&64&o)){if((Rl(e)||Rl(n))&&(!Om(e)||37===c||38===c)){const e=35===c||37===c;Jo(s,fa.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value,e?"false":"true")}!function(e,t,n,r){const i=g(_h(n)),o=g(_h(r));if(i||o){const a=Jo(e,fa.This_condition_will_always_return_0,Ia(37===t||35===t?97:112));if(i&&o)return;const s=38===t||36===t?Ia(54):"",c=i?r:n,l=_h(c);uT(a,qp(c,fa.Did_you_mean_0,`${s}Number.isNaN(${ub(l)?zp(l):"..."})`))}}(s,c,e,n),f((e,t)=>gM(e,t)||gM(t,e))}return on;case 104:return function(e,t,n,r,i){if(n===un||r===un)return un;!rl(n)&&sM(n,402784252)&&Jo(e,fa.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter),pn.assert(bb(e.parent));const o=jL(e.parent,void 0,i);return o===li?un:(VS(gh(o),on,t,fa.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),on)}(e,n,r,i,o);case 103:return uM(e,n,r,i);case 56:case 77:{const e=lD(r,4194304)?zb([(_=$?r:cw(i),zF(_,Tw)),i]):r;return 77===c&&p(i),e}case 57:case 76:{const e=lD(r,8388608)?zb([Dw(Sw(r)),i],2):r;return 76===c&&p(i),e}case 61:case 78:{const e=lD(r,262144)?zb([Dw(r),i],2):r;return 78===c&&p(i),e}case 64:const y=AF(e.parent)?og(e.parent):0;return function(e,t){if(2===e)for(const e of Kp(t)){const t=z_(e);if(t.symbol&&32&t.symbol.flags){const t=e.escapedName,n=Ue(e.valueDeclaration,t,788968,void 0,!1);(null==n?void 0:n.declarations)&&n.declarations.some(GP)&&(ia(n,fa.Duplicate_identifier_0,vc(t),e),ia(e,fa.Duplicate_identifier_0,vc(t),n))}}}(y,i),function(t){var r;switch(t){case 2:return!0;case 1:case 5:case 6:case 3:case 4:const t=Ts(e),i=Xm(n);return!!i&&gF(i)&&!!(null==(r=null==t?void 0:t.exports)?void 0:r.size);default:return!1}}(y)?(524288&i.flags&&(2===y||6===y||lT(i)||sD(i)||1&xx(i))||p(i),r):(p(i),i);case 28:if(!j.allowUnreachableCode&&mM(e)&&!(218===(l=e.parent).parent.kind&&$N(l.left)&&"0"===l.left.text&&(vF(l.parent.parent)&&l.parent.parent.expression===l.parent||216===l.parent.parent.kind)&&(Dx(l.right)||uD(l.right)&&"eval"===l.right.escapedText))){const t=Sd(e),n=ts(t.text,e.pos);t.parseDiagnostics.some(e=>e.code===fa.JSX_expressions_must_have_one_parent_element.code&&Ls(e,n))||Jo(e,fa.Left_side_of_comma_operator_is_unused_and_has_no_side_effects)}return i;default:return pn.fail()}var l,_;function u(e,t){return aM(e,2112)&&aM(t,2112)}function d(t){const o=iM(r,12288)?e:iM(i,12288)?n:void 0;return!o||(Jo(o,fa.The_0_operator_cannot_be_applied_to_type_symbol,Ia(t)),!1)}function p(i){ob(c)&&a(function(){let o=r;fz(t.kind)&&212===e.kind&&(o=_O(e,void 0,!0));if(eM(e,fa.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,fa.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)){let t;if(se&&hF(e)&&oM(i,32768)){const n=Zc(qM(e.expression),e.name.escapedText);VT(i,n)&&(t=fa.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target)}WS(i,o,e,n,t)}})}function f(e){return!e(r,i)&&(m(e),!0)}function m(e){let n=!1;const o=s||t;if(e){const t=wR(r),o=wR(i);n=!(t===r&&o===i)&&!(!t||!o)&&e(t,o)}let a=r,c=i;!n&&e&&([a,c]=function(e,t,n){let r=e,i=t;const o=cw(e),a=cw(t);n(o,a)||(r=o,i=a);return[r,i]}(r,i,e));const[l,_]=Tc(a,c);(function(e,n,r,i){switch(t.kind){case 37:case 35:case 38:case 36:return Wo(e,n,fa.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap,r,i);default:return}})(o,n,l,_)||Wo(o,n,fa.Operator_0_cannot_be_applied_to_types_1_and_2,Ia(t.kind),l,_)}function g(e){if(uD(e)&&"NaN"===e.escapedText){const t=Wr||(Wr=Xy("NaN",!1));return!!t&&t===zN(e)}return!1}}function vM(e){const t=e.parent;return SF(t)&&vM(t)||yF(t)&&t.argumentExpression===e}function bM(e){const t=[e.head.text],n=[];for(const r of e.templateSpans){const e=WM(r.expression);iM(e,12288)&&Jo(r.expression,fa.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String),t.push(r.literal.text),n.push(JS(e,vn)?e:Ut)}const r=216!==e.parent.kind&&Se(e).value;return r?xk(Ek(r)):EM(e)||vM(e)||DF($A(e,void 0)||Ot,xM)?mx(t,n):Ut}function xM(e){return!!(134217856&e.flags||58982400&e.flags&&oM(xf(e)||Ot,402653316))}function kM(e,t,n,r){const i=function(e){return eP(e)&&!HE(e.parent)?e.parent.parent:e}(e);KA(i,t,!1),function(e,t){Oi[ji]=e,Li[ji]=t,ji++}(i,n);const o=WM(e,1|r|(n?2:0));n&&n.intraExpressionInferenceSites&&(n.intraExpressionInferenceSites=void 0);const a=oM(o,2944)&&FM(o,VA(t,e,void 0))?kk(o):o;return ji--,Oi[ji]=void 0,Li[ji]=void 0,GA(),a}function SM(e,t){if(t)return WM(e,t);const n=ua(e);if(!n.resolvedType){const r=Si,i=ri;Si=Ti,ri=void 0,n.resolvedType=WM(e,t),ri=i,Si=r}return n.resolvedType}function TM(e){return 217===(e=_h(e,!0)).kind||235===e.kind||FA(e)}function CM(e,t,n){const r=Km(e);if(Om(e)){const n=oC(e);if(n)return tj(r,n,t)}const i=UM(r)||(n?kM(r,n,void 0,t||0):SM(r,t));if(FD(fF(e)?ac(e):e)){if(207===e.name.kind&&IN(i))return function(e,t){let n;for(const r of t.elements)if(r.initializer){const t=wM(r);t&&!Am(e,t)&&(n=ae(n,r))}if(!n)return e;const r=Zu();for(const t of Kp(e))r.set(t.escapedName,t);for(const e of n){const t=Xo(16777220,wM(e));t.links.type=Ql(e,!1,!1),r.set(t.escapedName,t)}const i=Hs(e.symbol,r,_,_,cg(e));return i.objectFlags=e.objectFlags,i}(i,e.name);if(208===e.name.kind&&fw(i))return function(e,t){if(12&e.target.combinedFlags||xy(e)>=t.elements.length)return e;const n=t.elements,r=Pb(e).slice(),i=e.target.elementFlags.slice();for(let t=xy(e);tFM(e,t))}if(58982400&t.flags){const n=xf(t)||Ot;return oM(n,4)&&oM(e,128)||oM(n,8)&&oM(e,256)||oM(n,64)&&oM(e,2048)||oM(n,4096)&&oM(e,8192)||FM(e,n)}return!!(406847616&t.flags&&oM(e,128)||256&t.flags&&oM(e,256)||2048&t.flags&&oM(e,2048)||512&t.flags&&oM(e,512)||8192&t.flags&&oM(e,8192))}return!1}function EM(e){const t=e.parent;return G_(t)&&wl(t.type)||FA(t)&&wl(EA(t))||GL(e)&&df($A(e,0))||(SF(t)||mF(t)||jF(t))&&EM(t)||(cP(t)||lP(t)||HF(t))&&EM(t.parent)}function PM(e,t,n){const r=WM(e,t,n);return EM(e)||Rf(e)?kk(r):TM(e)?r:dw(r,VA($A(e,void 0),e,void 0))}function AM(e,t){return 168===e.name.kind&&uI(e.name),PM(e.initializer,t)}function IM(e,t){Lq(e),168===e.name.kind&&uI(e.name);return OM(e,Gj(e,t),t)}function OM(e,t,n){if(n&&10&n){const r=nL(t,0,!0),i=nL(t,1,!0),o=r||i;if(o&&o.typeParameters){const t=UA(e,2);if(t){const i=nL(Dw(t),r?0:1,!1);if(i&&!i.typeParameters){if(8&n)return LM(e,n),Ln;const t=ZA(e),r=t.signature&&gh(t.signature),a=r&&tL(r);if(a&&!a.typeParameters&&!b(t.inferences,MM)){const e=function(e,t){const n=[];let r,i;for(const o of t){const t=o.symbol.escapedName;if(BM(e.inferredTypeParameters,t)||BM(n,t)){const a=qs(Xo(262144,JM(G(e.inferredTypeParameters,n),t)));a.target=o,r=ae(r,o),i=ae(i,a),n.push(a)}else n.push(o)}if(i){const e=nS(r,i);for(const t of i)t.mapper=e}return n}(t,o.typeParameters),n=Ph(o,e),r=P(t.inferences,e=>lN(e.typeParameter));if(Zw(n,i,(e,t)=>{EN(r,e,t,0,!0)}),H(r,MM)&&(eN(n,i,(e,t)=>{EN(r,e,t)}),!function(e,t){for(let n=0;ne.symbol.escapedName===t)}function JM(e,t){let n=t.length;for(;n>1&&t.charCodeAt(n-1)>=48&&t.charCodeAt(n-1)<=57;)n--;const r=t.slice(0,n);for(let t=1;;t++){const n=r+t;if(!BM(e,n))return n}}function zM(e){const t=eL(e);if(t&&!t.typeParameters)return gh(t)}function qM(e){const t=UM(e);if(t)return t;if(268435456&e.flags&&ri){const t=ri[_J(e)];if(t)return t}const n=Ni,r=WM(e,64);if(Ni!==n){(ri||(ri=[]))[_J(e)]=r,AT(e,268435456|e.flags)}return r}function UM(e){let t=_h(e,!0);if(FA(t)){const e=EA(t);if(!wl(e))return $k(e)}if(t=_h(e),FF(t)){const e=UM(t.expression);return e?CR(e):void 0}return!vF(t)||108===t.expression.kind||Bm(t,!0)||qL(t)||ff(t)?G_(t)&&!wl(t.type)?$k(t.type):Ml(e)||__(e)?WM(e):void 0:bl(t)?function(e){const t=WM(e.expression),n=Aw(t,e.expression),r=zM(t);return r&&Pw(r,e,n!==t)}(t):zM(ZI(t.expression))}function VM(e){const t=ua(e);if(t.contextFreeType)return t.contextFreeType;KA(e,wt,!1);const n=t.contextFreeType=WM(e,4);return GA(),n}function WM(n,i,o){var s,c;null==(s=Gn)||s.push(Gn.Phase.Check,"checkExpression",{kind:n.kind,pos:n.pos,end:n.end,path:n.tracingPath});const l=r;r=n,h=0;const u=function(e,n,r){const i=e.kind;if(t)switch(i){case 232:case 219:case 220:t.throwIfCancellationRequested()}switch(i){case 80:return HP(e,n);case 81:return mO(e);case 110:return oA(e);case 108:return sA(e);case 106:return qt;case 15:case 11:return xN(e)?Ft:xk(Ek(e.text));case 9:return Gq(e),xk(Pk(+e.text));case 10:return function(e){const t=cF(e.parent)||EF(e.parent)&&cF(e.parent.parent);if(!t&&!(33554432&e.flags)&&M<7&&Wq(e,fa.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020))return!0}(e),xk(Lk({negative:!1,base10Value:bT(e.text)}));case 112:return Gt;case 97:return Ht;case 229:return bM(e);case 14:return aI(e);case 210:return cI(e,n,r);case 211:return yI(e,n);case 212:return _O(e,n);case 167:return dO(e,n);case 213:return qO(e,n);case 214:if(ff(e))return UL(e);case 215:return function(e,t){var n,r,i;Cq(e,e.typeArguments);const o=jL(e,void 0,t);if(o===li)return un;if(JL(o,e),108===e.expression.kind)return ln;if(215===e.kind){const t=o.declaration;if(t&&177!==t.kind&&181!==t.kind&&186!==t.kind&&(!EP(t)||177!==(null==(r=null==(n=Gg(t))?void 0:n.parent)?void 0:r.kind))&&!Pg(t)&&!ML(t))return te&&Jo(e,fa.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type),wt}if(Om(e)&&HL(e))return Zg(e.arguments[0]);const a=gh(o);if(12288&a.flags&&qL(e))return Mk(sh(e.parent));if(214===e.kind&&!e.questionDotToken&&245===e.parent.kind&&16384&a.flags&&oh(o))if(pb(e.expression)){if(!dE(e)){const t=Jo(e.expression,fa.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);uE(e.expression,t)}}else Jo(e.expression,fa.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);if(Om(e)){const t=BL(e,!1);if(null==(i=null==t?void 0:t.exports)?void 0:i.size){const e=Hs(t,t.exports,_,_,_);return e.objectFlags|=4096,Gb([a,e])}}return a}(e,n);case 216:return KL(e);case 218:return function(e,t){if(Au(e)){if(rC(e))return tj(e.expression,iC(e),t);if(FA(e))return XL(e,t)}return WM(e.expression,t)}(e,n);case 232:return function(e){return AJ(e),lz(e),function(e){if(e.name)return;const t=IA(e);if(!Yh(t))return;let n;n=!B&&MnM(e));const t=WM(e.expression),n=vR(t,!0,e,fa.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);return n!==t||il(n)||3&t.flags||qo(!1,qp(e,fa.await_has_no_effect_on_the_type_of_this_expression)),n}(e);case 225:return function(e){const t=WM(e.operand);if(t===un)return un;switch(e.operand.kind){case 9:switch(e.operator){case 41:return xk(Pk(-e.operand.text));case 40:return xk(Pk(+e.operand.text))}break;case 10:if(41===e.operator)return xk(Lk({negative:!0,base10Value:bT(e.operand.text)}))}switch(e.operator){case 40:case 41:case 55:return sO(t,e.operand),iM(t,12288)&&Jo(e.operand,fa.The_0_operator_cannot_be_applied_to_type_symbol,Ia(e.operator)),40===e.operator?(iM(t,2112)&&Jo(e.operand,fa.Operator_0_cannot_be_applied_to_type_1,Ia(e.operator),Sc(cw(t))),Wt):rM(t);case 54:bB(t,e.operand);const n=cD(t,12582912);return 4194304===n?Ht:8388608===n?Gt:on;case 46:case 47:return Xj(e.operand,sO(t,e.operand),fa.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&eM(e.operand,fa.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,fa.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),rM(t)}return Et}(e);case 226:return function(e){const t=WM(e.operand);return t===un?un:(Xj(e.operand,sO(t,e.operand),fa.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&eM(e.operand,fa.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,fa.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),rM(t))}(e);case 227:return de(e,n);case 228:return function(e,t){const n=kB(e.condition,t);return vB(e.condition,n,e.whenTrue),zb([WM(e.whenTrue,t),WM(e.whenFalse,t)],2)}(e,n);case 231:return function(e,t){return MXM(e,n,void 0)));const o=i&&ZB(i,r),s=o&&o.yieldType||wt,c=o&&o.nextType||wt,l=e.expression?WM(e.expression):jt,_=Uj(e,l,c,r);if(i&&_&&WS(_,s,e.expression||e,e.expression),e.asteriskToken)return DB(r?19:17,1,l,e.expression)||wt;if(i)return YB(2,i,r)||wt;let u=hA(2,t);return u||(u=wt,a(()=>{if(te&&!MT(e)){const t=$A(e,void 0);t&&!rl(t)||Jo(e,fa.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation)}})),u}(e);case 238:return function(e){return e.isSpread?Ux(e.type,Wt):e.type}(e);case 295:return HI(e,n);case 285:case 286:return function(e){return lz(e),JI(e)||wt}(e);case 289:return function(e){VI(e.openingFragment);const t=Sd(e);!Yk(j)||!j.jsxFactory&&!t.pragmas.has("jsx")||j.jsxFragmentFactory||t.pragmas.has("jsxfrag")||Jo(e,j.jsxFactory?fa.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:fa.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments),TI(e);const n=JI(e);return il(n)?wt:n}(e);case 293:return function(e,t){return SI(e.parent,t)}(e,n);case 287:pn.fail("Shouldn't ever directly check a JsxOpeningElement")}return Et}(n,i,o),d=OM(n,u,i);return cM(d)&&function(t,n){var r;const i=212===t.parent.kind&&t.parent.expression===t||213===t.parent.kind&&t.parent.expression===t||(80===t.kind||167===t.kind)&&Sz(t)||187===t.parent.kind&&t.parent.exprName===t||282===t.parent.kind;i||Jo(t,fa.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(j.isolatedModules||j.verbatimModuleSyntax&&i&&!Ue(t,db(t),2097152,void 0,!1,!0)){pn.assert(!!(128&n.symbol.flags));const i=n.symbol.valueDeclaration,o=null==(r=e.getRedirectFromOutput(Sd(i).resolvedPath))?void 0:r.resolvedRef;!(33554432&i.flags)||CT(t)||o&&Ok(o.commandLine.options)||Jo(t,fa.Cannot_access_ambient_const_enums_when_0_is_enabled,Me)}}(n,d),r=l,null==(c=Gn)||c.pop(),d}function $M(e){vq(e),e.expression&&Uq(e.expression,fa.Type_expected),az(e.constraint),az(e.default);const t=ju(Ss(e));xf(t),function(e){return Cf(e)!==Mn}(t)||Jo(e.default,fa.Type_parameter_0_has_a_circular_default,Sc(t));const n=uf(t),r=wf(t);n&&r&&VS(r,Id(CS(n,iS(t,r)),r),e.default,fa.Type_0_does_not_satisfy_the_constraint_1),lz(e),a(()=>wJ(e.name,fa.Type_parameter_name_cannot_be_0))}function HM(e){vq(e),uB(e);const t=Yf(e);Av(e,31)&&(j.erasableSyntaxOnly&&Jo(e,fa.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled),177===t.kind&&Ad(t.body)||Jo(e,fa.A_parameter_property_is_only_allowed_in_a_constructor_implementation),177===t.kind&&uD(e.name)&&"constructor"===e.name.escapedText&&Jo(e.name,fa.constructor_cannot_be_used_as_a_parameter_property_name)),!e.initializer&&tC(e)&&w_(e.name)&&t.body&&Jo(e,fa.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),e.name&&uD(e.name)&&("this"===e.name.escapedText||"new"===e.name.escapedText)&&(0!==t.parameters.indexOf(e)&&Jo(e,fa.A_0_parameter_must_be_the_first_parameter,e.name.escapedText),177!==t.kind&&181!==t.kind&&186!==t.kind||Jo(e,fa.A_constructor_cannot_have_a_this_parameter),220===t.kind&&Jo(e,fa.An_arrow_function_cannot_have_a_this_parameter),178!==t.kind&&179!==t.kind||Jo(e,fa.get_and_set_accessors_cannot_declare_this_parameters)),!e.dotDotDotToken||w_(e.name)||JS(Qf(z_(e.symbol)),_r)||Jo(e,fa.A_rest_parameter_must_be_of_an_array_type)}function KM(e,t,n){for(const r of e.elements){if(RF(r))continue;const e=r.name;if(80===e.kind&&e.escapedText===n)return Jo(t,fa.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern,n),!0;if((208===e.kind||207===e.kind)&&KM(e,t,n))return!0}}function GM(e){182===e.kind?function(e){vq(e)||function(e){const t=e.parameters[0];if(1!==e.parameters.length)return Wq(t?t.name:e,fa.An_index_signature_must_have_exactly_one_parameter);if(xq(e.parameters,fa.An_index_signature_cannot_have_a_trailing_comma),t.dotDotDotToken)return Wq(t.dotDotDotToken,fa.An_index_signature_cannot_have_a_rest_parameter);if(Fv(t))return Wq(t.name,fa.An_index_signature_parameter_cannot_have_an_accessibility_modifier);if(t.questionToken)return Wq(t.questionToken,fa.An_index_signature_parameter_cannot_have_a_question_mark);if(t.initializer)return Wq(t.name,fa.An_index_signature_parameter_cannot_have_an_initializer);if(!t.type)return Wq(t.name,fa.An_index_signature_parameter_must_have_a_type_annotation);const n=$k(t.type);if(DF(n,e=>!!(8576&e.flags))||Ox(n))return Wq(t.name,fa.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead);if(!PF(n,ay))return Wq(t.name,fa.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type);if(!e.type)return Wq(e,fa.An_index_signature_must_have_a_type_annotation)}(e)}(e):185!==e.kind&&263!==e.kind&&186!==e.kind&&180!==e.kind&&177!==e.kind&&181!==e.kind||Tq(e);const t=Rh(e);4&t||(!(3&~t)&&M{uD(e)&&r.add(e.escapedText),w_(e)&&i.add(t)});const o=Qg(e);if(o){const e=t.length-1,o=t[e];n&&o&&uD(o.name)&&o.typeExpression&&o.typeExpression.type&&!r.has(o.name.escapedText)&&!i.has(e)&&!$C($k(o.typeExpression.type))&&Jo(o.name,fa.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,bc(o.name))}else p(t,({name:e,isNameFirst:t},o)=>{i.has(o)||uD(e)&&r.has(e.escapedText)||(wD(e)?n&&Jo(e,fa.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1,zp(e),zp(e.left)):t||Vo(n,e,fa.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,bc(e)))})}(e),p(e.parameters,HM),e.type&&az(e.type),a(function(){!function(e){if(M>=2||!qu(e)||33554432&e.flags||Pd(e.body))return;p(e.parameters,e=>{e.name&&!w_(e.name)&&e.name.escapedText===Ie.escapedName&&Ro("noEmit",e,fa.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters)})}(e);let t=bv(e),n=t;if(Om(e)){const r=ol(e);if(r&&r.typeExpression&&UD(r.typeExpression.type)){const e=eL($k(r.typeExpression));e&&e.declaration&&(t=bv(e.declaration),n=r.typeExpression.type)}}if(te&&!t)switch(e.kind){case 181:Jo(e,fa.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break;case 180:Jo(e,fa.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)}if(t&&n){const r=Rh(e);if(1==(5&r)){const e=$k(t);e===ln?Jo(n,fa.A_generator_cannot_have_a_void_type_annotation):XM(e,r,n)}else 2==(3&r)&&function(e,t,n){const r=$k(t);if(M>=2){if(il(r))return;const e=gv(!0);if(e!==On&&!W_(r,e))return void o(fa.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,t,n,Sc(wR(r)||ln))}else{if(xP(e,5),il(r))return;const a=fm(t);if(void 0===a)return void o(fa.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,t,n,Sc(r));const s=ns(a,111551,!0),c=s?z_(s):Et;if(il(c))return void(80===a.kind&&"Promise"===a.escapedText&&$_(r)===gv(!1)?Jo(n,fa.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option):o(fa.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,t,n,zp(a)));const l=(i=!0,vr||(vr=tv("PromiseConstructorLike",0,i))||Nn);if(l===Nn)return void o(fa.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,t,n,zp(a));const _=fa.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value;if(!VS(c,l,n,_,()=>t===n?void 0:ik(void 0,fa.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type)))return;const u=a&&db(a),d=da(e.locals,u.escapedText,111551);if(d)return void Jo(d.valueDeclaration,fa.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,bc(u),zp(a))}var i;function o(e,t,n,r){if(t===n)Jo(n,e,r);else{uT(Jo(n,fa.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type),qp(t,e,r))}}vR(r,!1,e,fa.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)}(e,t,n)}182!==e.kind&&318!==e.kind&&RR(e)})}function XM(e,t,n){const r=YB(0,e,!!(2&t))||wt;return VS(qj(r,YB(1,e,!!(2&t))||r,YB(2,e,!!(2&t))||Ot,!!(2&t)),e,n)}function QM(e){const t=new Map;for(const n of e.members)if(172===n.kind){let e;const r=n.name;switch(r.kind){case 11:case 9:e=r.text;break;case 80:e=bc(r);break;default:continue}t.get(e)?(Jo(Fc(n.symbol.valueDeclaration),fa.Duplicate_identifier_0,e),Jo(n.name,fa.Duplicate_identifier_0,e)):t.set(e,!0)}}function YM(e){if(265===e.kind){const t=Ss(e);if(t.declarations&&t.declarations.length>0&&t.declarations[0]!==e)return}const t=zh(Ss(e));if(null==t?void 0:t.declarations){const e=new Map;for(const n of t.declarations)zD(n)&&1===n.parameters.length&&n.parameters[0].type&&wF($k(n.parameters[0].type),t=>{const r=e.get(Ab(t));r?r.declarations.push(n):e.set(Ab(t),{type:t,declarations:[n]})});e.forEach(e=>{if(e.declarations.length>1)for(const t of e.declarations)Jo(t,fa.Duplicate_index_signature_for_type_0,Sc(e.type))})}}function ZM(e){vq(e)||function(e){if(ND(e.name)&&AF(e.name.expression)&&103===e.name.expression.operatorToken.kind)return Wq(e.parent.members[0],fa.A_mapped_type_may_not_declare_properties_or_methods);if(m_(e.parent)){if(KN(e.name)&&"constructor"===e.name.text)return Wq(e.name,fa.Classes_may_not_have_a_field_named_constructor);if(Oq(e.name,fa.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type))return!0;if(M<2&&dD(e.name))return Wq(e.name,fa.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(M<2&&h_(e)&&!(33554432&e.flags))return Wq(e.name,fa.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(h_(e)&&Eq(e.questionToken,fa.An_accessor_property_cannot_be_declared_optional))return!0}else if(265===e.parent.kind){if(Oq(e.name,fa.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return!0;if(pn.assertNode(e,PD),e.initializer)return Wq(e.initializer,fa.An_interface_property_cannot_have_an_initializer)}else if(HD(e.parent)){if(Oq(e.name,fa.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return!0;if(pn.assertNode(e,PD),e.initializer)return Wq(e.initializer,fa.A_type_literal_property_cannot_have_an_initializer)}33554432&e.flags&&Mq(e);if(AD(e)&&e.exclamationToken&&(!m_(e.parent)||!e.type||e.initializer||33554432&e.flags||Iv(e)||jv(e))){const t=e.initializer?fa.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:e.type?fa.A_definite_assignment_assertion_is_not_permitted_in_this_context:fa.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return Wq(e.exclamationToken,t)}}(e)||Dq(e.name),uB(e),eR(e),Av(e,64)&&173===e.kind&&e.initializer&&Jo(e,fa.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract,jp(e.name))}function eR(e){if(dD(e.name)&&(MAv(e,31))))if(function(e,t){const n=sh(e.parent);return YF(n)&&n.parent===t}(i,e.body)){let t;for(const n of e.body.statements){if(YF(n)&&pf(AA(n.expression))){t=n;break}if(nR(n))break}void 0===t&&Jo(e,fa.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 Jo(i,fa.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 n||Jo(e,fa.Constructors_for_derived_classes_must_contain_a_super_call)}})}function nR(e){return 108===e.kind||110===e.kind||!om(e)&&!!iO(e,nR)}function rR(e){uD(e.name)&&"constructor"===bc(e.name)&&m_(e.parent)&&Jo(e.name,fa.Class_constructor_may_not_be_an_accessor),a(function(){Tq(e)||function(e){if(!(33554432&e.flags)&&188!==e.parent.kind&&265!==e.parent.kind){if(M<2&&dD(e.name))return Wq(e.name,fa.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(void 0===e.body&&!Av(e,64))return Vq(e,e.end-1,1,fa._0_expected,"{")}if(e.body){if(Av(e,64))return Wq(e,fa.An_abstract_accessor_cannot_have_an_implementation);if(188===e.parent.kind||265===e.parent.kind)return Wq(e.body,fa.An_implementation_cannot_be_declared_in_ambient_contexts)}if(e.typeParameters)return Wq(e.name,fa.An_accessor_cannot_have_type_parameters);if(!function(e){return Iq(e)||e.parameters.length===(178===e.kind?0:1)}(e))return Wq(e.name,178===e.kind?fa.A_get_accessor_cannot_have_parameters:fa.A_set_accessor_must_have_exactly_one_parameter);if(179===e.kind){if(e.type)return Wq(e.name,fa.A_set_accessor_cannot_have_a_return_type_annotation);const t=pn.checkDefined(lv(e),"Return value does not match parameter count assertion.");if(t.dotDotDotToken)return Wq(t.dotDotDotToken,fa.A_set_accessor_cannot_have_rest_parameter);if(t.questionToken)return Wq(t.questionToken,fa.A_set_accessor_cannot_have_an_optional_parameter);if(t.initializer)return Wq(e.name,fa.A_set_accessor_parameter_cannot_have_an_initializer)}return!1}(e)||Dq(e.name);LR(e),GM(e),178===e.kind&&!(33554432&e.flags)&&Ad(e.body)&&512&e.flags&&(1024&e.flags||Jo(e.name,fa.A_get_accessor_must_return_a_value));168===e.name.kind&&uI(e.name);if(vd(e)){const t=Ss(e),n=Qu(t,178),r=Qu(t,179);if(n&&r&&!(1&Xz(n))){ua(n).flags|=1;const e=Vv(n),t=Vv(r);(64&e)!=(64&t)&&(Jo(n.name,fa.Accessors_must_both_be_abstract_or_non_abstract),Jo(r.name,fa.Accessors_must_both_be_abstract_or_non_abstract)),(4&e&&!(6&t)||2&e&&!(2&t))&&(Jo(n.name,fa.A_get_accessor_must_be_at_least_as_accessible_as_the_setter),Jo(r.name,fa.A_get_accessor_must_be_at_least_as_accessible_as_the_setter))}}const t=C_(Ss(e));178===e.kind&&Kj(e,t)}),az(e.body),eR(e)}function iR(e,t,n){return e.typeArguments&&n{const t=sR(e);t&&aR(e,t)});const t=ua(e).resolvedSymbol;t&&H(t.declarations,e=>GT(e)&&!!(536870912&e.flags))&&Go(zL(e),t.declarations,t.escapedName)}}function _R(e,t){if(!(8388608&e.flags))return e;const n=e.objectType,r=e.indexType,i=Bp(n)&&2===Vp(n)?nx(n,0):_x(n,0),o=!!lg(n,Wt);if(PF(r,e=>JS(e,i)||o&&tg(e,Wt)))return 213===t.kind&&th(t)&&32&xx(n)&&1&Dp(n)&&Jo(t,fa.Index_signature_in_type_0_only_permits_reading,Sc(n)),e;if(Lx(n)){const e=Tx(r,t);if(e){const r=wF(qf(n),t=>Am(t,e));if(r&&6&lx(r))return Jo(t,fa.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter,vc(e)),Et}}return Jo(t,fa.Type_0_cannot_be_used_to_index_type_1,Sc(r),Sc(n)),Et}function uR(e){!function(e){var t;if(null==(t=e.members)?void 0:t.length)Wq(e.members[0],fa.A_mapped_type_may_not_declare_properties_or_methods)}(e),az(e.typeParameter),az(e.nameType),az(e.type),e.type||Qw(e,wt);const t=Hx(e),n=Sp(t);if(n)VS(n,hn,e.nameType);else{VS(kp(t),hn,ml(e.typeParameter))}}function dR(e){!function(e){if(158===e.operator){if(155!==e.type.kind)return Wq(e.type,fa._0_expected,Ia(155));let t=ah(e.parent);if(Om(t)&&fP(t)){const e=Kg(t);e&&(t=jg(e)||e)}switch(t.kind){case 261:const n=t;if(80!==n.name.kind)return Wq(e,fa.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);if(!Mf(n))return Wq(e,fa.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement);if(!(2&n.parent.flags))return Wq(t.name,fa.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);break;case 173:if(!Iv(t)||!Bv(t))return Wq(t.name,fa.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);break;case 172:if(!Av(t,8))return Wq(t.name,fa.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);break;default:Wq(e,fa.unique_symbol_types_are_not_allowed_here)}}else if(148===e.operator&&189!==e.type.kind&&190!==e.type.kind)Uq(e,fa.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types,Ia(155))}(e),az(e.type)}function pR(e){return(Pv(e,2)||Yl(e))&&!!(33554432&e.flags)}function fR(e,t){let n=Zq(e);if(265!==e.parent.kind&&264!==e.parent.kind&&232!==e.parent.kind&&33554432&e.flags){const t=Ip(e);!(t&&128&t.flags)||128&n||kE(e.parent)&&xE(e.parent.parent)&&hp(e.parent.parent)||(n|=32),n|=128}return n&t}function mR(e){a(()=>function(e){function t(e,t){return void 0!==t&&t.parent===e[0].parent?t:e[0]}function n(e,n,r,i,o){if(0!==(i^o)){const i=fR(t(e,n),r);qe(e,e=>Sd(e).fileName).forEach(e=>{const o=fR(t(e,n),r);for(const t of e){const e=fR(t,r)^i,n=fR(t,r)^o;32&n?Jo(Fc(t),fa.Overload_signatures_must_all_be_exported_or_non_exported):128&n?Jo(Fc(t),fa.Overload_signatures_must_all_be_ambient_or_non_ambient):6&e?Jo(Fc(t)||t,fa.Overload_signatures_must_all_be_public_private_or_protected):64&e&&Jo(Fc(t),fa.Overload_signatures_must_all_be_abstract_or_non_abstract)}})}}function r(e,n,r,i){if(r!==i){const r=Eg(t(e,n));p(e,e=>{Eg(e)!==r&&Jo(Fc(e),fa.Overload_signatures_must_all_be_optional_or_required)})}}const i=230;let o,a,s,c=0,l=i,_=!1,u=!0,f=!1;const m=e.declarations,g=!!(16384&e.flags);function h(e){if(e.name&&Pd(e.name))return;let t=!1;const n=iO(e.parent,n=>{if(t)return n;t=n===e});if(n&&n.pos===e.end&&n.kind===e.kind){const t=n.name||n,r=n.name;if(e.name&&r&&(dD(e.name)&&dD(r)&&e.name.escapedText===r.escapedText||ND(e.name)&&ND(r)&&OS(uI(e.name),uI(r))||Wh(e.name)&&Wh(r)&&Hh(e.name)===Hh(r))){if((175===e.kind||174===e.kind)&&Iv(e)!==Iv(n)){Jo(t,Iv(e)?fa.Function_overload_must_be_static:fa.Function_overload_must_not_be_static)}return}if(Ad(n.body))return void Jo(t,fa.Function_implementation_name_must_be_0,jp(e.name))}const r=e.name||e;g?Jo(r,fa.Constructor_implementation_is_missing):Av(e,64)?Jo(r,fa.All_declarations_of_an_abstract_method_must_be_consecutive):Jo(r,fa.Function_implementation_is_missing_or_not_immediately_following_the_declaration)}let y=!1,v=!1,b=!1;const x=[];if(m)for(const e of m){const t=e,n=33554432&t.flags,r=t.parent&&(265===t.parent.kind||188===t.parent.kind)||n;if(r&&(s=void 0),264!==t.kind&&232!==t.kind||n||(b=!0),263===t.kind||175===t.kind||174===t.kind||177===t.kind){x.push(t);const e=fR(t,i);c|=e,l&=e,_=_||Eg(t),u=u&&Eg(t);const n=Ad(t.body);n&&o?g?v=!0:y=!0:(null==s?void 0:s.parent)===t.parent&&s.end!==t.pos&&h(s),n?o||(o=t):f=!0,s=t,r||(a=t)}Om(e)&&s_(e)&&e.jsDoc&&(f=d(Wg(e))>0)}v&&p(x,e=>{Jo(e,fa.Multiple_constructor_implementations_are_not_allowed)});y&&p(x,e=>{Jo(Fc(e)||e,fa.Duplicate_function_implementation)});if(b&&!g&&16&e.flags&&m){const t=D(m,e=>264===e.kind).map(e=>qp(e,fa.Consider_adding_a_declare_modifier_to_this_class));p(m,n=>{const r=264===n.kind?fa.Class_declaration_cannot_implement_overload_list_for_0:263===n.kind?fa.Function_with_bodies_can_only_merge_with_classes_that_are_ambient:void 0;r&&uT(Jo(Fc(n)||n,r,kc(e)),...t)})}!a||a.body||Av(a,64)||a.questionToken||h(a);if(f&&(m&&(n(m,o,i,c,l),r(m,o,_,u)),o)){const t=Yg(e),n=zg(o);for(const e of t)if(!oT(n,e)){uT(Jo(e.declaration&&EP(e.declaration)?e.declaration.parent.tagName:e.declaration,fa.This_overload_signature_is_not_compatible_with_its_implementation_signature),qp(o,fa.The_implementation_signature_is_declared_here));break}}}(e))}function gR(e){a(()=>function(e){let t=e.localSymbol;if(!t&&(t=Ss(e),!t.exportSymbol))return;if(Qu(t,e.kind)!==e)return;let n=0,r=0,i=0;for(const e of t.declarations){const t=s(e),o=fR(e,2080);32&o?2048&o?i|=t:n|=t:r|=t}const o=n&r,a=i&(n|r);if(o||a)for(const e of t.declarations){const t=s(e),n=Fc(e);t&a?Jo(n,fa.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead,jp(n)):t&o&&Jo(n,fa.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,jp(n))}function s(e){let t=e;switch(t.kind){case 265:case 266:case 347:case 339:case 341:return 2;case 268:return dp(t)||0!==eB(t)?5:4;case 264:case 267:case 307:return 3;case 308:return 7;case 278:case 227:const e=t,n=ME(e)?e.expression:e.right;if(!ub(n))return 1;t=n;case 272:case 275:case 274:let r=0;return p(Ha(Ss(t)).declarations,e=>{r|=s(e)}),r;case 261:case 209:case 263:case 277:case 80:return 1;case 174:case 172:return 2;default:return pn.failBadSyntaxKind(t)}}}(e))}function hR(e,t,n,...r){const i=yR(e,t);return i&&CR(i,t,n,...r)}function yR(e,t,n){if(rl(e))return;const r=e;if(r.promisedTypeOfPromise)return r.promisedTypeOfPromise;if(W_(e,gv(!1)))return r.promisedTypeOfPromise=by(e)[0];if(sM(kf(e),402915324))return;const i=Zc(e,"then");if(rl(i))return;const o=i?Jm(i,0):_;if(0===o.length)return void(t&&Jo(t,fa.A_promise_must_have_a_then_method));let a,s;for(const t of o){const n=rh(t);n&&n!==ln&&!DT(e,n,bo)?a=n:s=ae(s,t)}if(!s)return pn.assertIsDefined(a),n&&(n.value=a),void(t&&Jo(t,fa.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,Sc(e),Sc(a)));const c=pD(zb(P(s,xj)),2097152);if(rl(c))return;const l=Jm(c,0);if(0!==l.length)return r.promisedTypeOfPromise=zb(P(l,xj),2);t&&Jo(t,fa.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback)}function vR(e,t,n,r,...i){return(t?CR(e,n,r,...i):wR(e,n,r,...i))||Et}function bR(e){if(sM(kf(e),402915324))return!1;const t=Zc(e,"then");return!!t&&Jm(pD(t,2097152),0).length>0}function xR(e){var t;if(16777216&e.flags){const n=Uv(!1);return!!n&&e.aliasSymbol===n&&1===(null==(t=e.aliasTypeArguments)?void 0:t.length)}return!1}function kR(e){return 1048576&e.flags?zF(e,kR):xR(e)?e.aliasTypeArguments[0]:e}function SR(e){if(rl(e)||xR(e))return!1;if(Lx(e)){const t=xf(e);if(t?3&t.flags||lT(t)||DF(t,bR):oM(e,8650752))return!0}return!1}function TR(e){return SR(e)?function(e){const t=Uv(!0);if(t)return Sy(t,[kR(e)])}(e)??e:(pn.assert(xR(e)||void 0===yR(e),"type provided should not be a non-generic 'promise'-like."),e)}function CR(e,t,n,...r){const i=wR(e,t,n,...r);return i&&TR(i)}function wR(e,t,n,...r){if(rl(e))return e;if(xR(e))return e;const i=e;if(i.awaitedTypeOfType)return i.awaitedTypeOfType;if(1048576&e.flags){if(po.lastIndexOf(e.id)>=0)return void(t&&Jo(t,fa.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));const o=t?e=>wR(e,t,n,...r):wR;po.push(e.id);const a=zF(e,o);return po.pop(),i.awaitedTypeOfType=a}if(SR(e))return i.awaitedTypeOfType=e;const o={value:void 0},a=yR(e,void 0,o);if(a){if(e.id===a.id||po.lastIndexOf(a.id)>=0)return void(t&&Jo(t,fa.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));po.push(e.id);const o=wR(a,t,n,...r);if(po.pop(),!o)return;return i.awaitedTypeOfType=o}if(!bR(e))return i.awaitedTypeOfType=e;if(t){let i;pn.assertIsDefined(n),o.value&&(i=ik(i,fa.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,Sc(e),Sc(o.value))),i=ik(i,n,...r),ho.add(Wp(Sd(t),t,i))}}function NR(e){!function(e){if(!qq(Sd(e))){let t=e.expression;if(SF(t))return!1;let n,r=!0;for(;;)if(BF(t)||qF(t))t=t.expression;else if(vF(t))r||(n=t),t.questionDotToken&&(n=t.questionDotToken),t=t.expression,r=!1;else{if(!hF(t)){uD(t)||(n=t);break}t.questionDotToken&&(n=t.questionDotToken),t=t.expression,r=!1}if(n)return uT(Jo(e.expression,fa.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator),qp(n,fa.Invalid_syntax_in_decorator)),!0}}(e);const t=jL(e);JL(t,e);const n=gh(t);if(1&n.flags)return;const r=Mj(e);if(!(null==r?void 0:r.resolvedReturnType))return;let i;const o=r.resolvedReturnType;switch(e.parent.kind){case 264:case 232:i=fa.Decorator_function_return_type_0_is_not_assignable_to_type_1;break;case 173:if(!B){i=fa.Decorator_function_return_type_0_is_not_assignable_to_type_1;break}case 170:i=fa.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;break;case 175:case 178:case 179:i=fa.Decorator_function_return_type_0_is_not_assignable_to_type_1;break;default:return pn.failBadSyntaxKind(e.parent)}VS(n,o,e.expression,i)}function DR(e,t,n,r,i,o=n.length,a=0){return Ld(bw.createFunctionTypeNode(void 0,_,bw.createKeywordTypeNode(133)),e,t,n,r,i,o,a)}function FR(e,t,n,r,i,o,a){return Bh(DR(e,t,n,r,i,o,a))}function ER(e){return FR(void 0,void 0,_,e)}function PR(e){return FR(void 0,void 0,[Qo("value",e)],ln)}function AR(e){if(e)switch(e.kind){case 194:case 193:return IR(e.types);case 195:return IR([e.trueType,e.falseType]);case 197:case 203:return AR(e.type);case 184:return e.typeName}}function IR(e){let t;for(let n of e){for(;197===n.kind||203===n.kind;)n=n.type;if(146===n.kind)continue;if(!$&&(202===n.kind&&106===n.literal.kind||157===n.kind))continue;const e=AR(n);if(!e)return;if(t){if(!uD(t)||!uD(e)||t.escapedText!==e.escapedText)return}else t=e}return t}function OR(e){const t=yv(e);return Uu(e)?Of(t):t}function LR(e){if(!(PI(e)&&Jv(e)&&e.modifiers&&gm(B,e,e.parent,e.parent.parent)))return;const t=x(e.modifiers,ED);if(t){if(B)hq(t,8),170===e.kind&&hq(t,32);else if(Mt.kind===e.kind&&!(524288&t.flags));e===i&&mR(r),n.parent&&mR(n)}const r=174===e.kind?void 0:e.body;if(az(r),Kj(e,Ch(e)),a(function(){bv(e)||(Pd(r)&&!pR(e)&&Qw(e,wt),1&n&&Ad(r)&&gh(zg(e)))}),Om(e)){const t=ol(e);t&&t.typeExpression&&!rI($k(t.typeExpression),e)&&Jo(t.typeExpression.type,fa.The_type_of_a_function_declaration_must_match_the_function_s_signature)}}function RR(e){a(function(){const t=Sd(e);let n=ki.get(t.path);n||(n=[],ki.set(t.path,n));n.push(e)})}function BR(e,t){for(const n of e)switch(n.kind){case 264:case 232:qR(n,t),VR(n,t);break;case 308:case 268:case 242:case 270:case 249:case 250:case 251:XR(n,t);break;case 177:case 219:case 263:case 220:case 175:case 178:case 179:n.body&&XR(n,t),VR(n,t);break;case 174:case 180:case 181:case 185:case 186:case 266:case 265:VR(n,t);break;case 196:UR(n,t);break;default:pn.assertNever(n,"Node should not have been registered for unused identifiers check")}}function JR(e,t,n){n(e,0,qp(Fc(e)||e,GT(e)?fa._0_is_declared_but_never_used:fa._0_is_declared_but_its_value_is_never_read,t))}function zR(e){return uD(e)&&95===bc(e).charCodeAt(0)}function qR(e,t){for(const n of e.members)switch(n.kind){case 175:case 173:case 178:case 179:if(179===n.kind&&32768&n.symbol.flags)break;const e=Ss(n);e.isReferenced||!(Pv(n,2)||Nc(n)&&dD(n.name))||33554432&n.flags||t(n,0,qp(n.name,fa._0_is_declared_but_its_value_is_never_read,pc(e)));break;case 177:for(const e of n.parameters)!e.symbol.isReferenced&&Av(e,2)&&t(e,0,qp(e.name,fa.Property_0_is_declared_but_its_value_is_never_read,kc(e.symbol)));break;case 182:case 241:case 176:break;default:pn.fail("Unexpected class member")}}function UR(e,t){const{typeParameter:n}=e;WR(n)&&t(e,1,qp(e,fa._0_is_declared_but_its_value_is_never_read,bc(n.name)))}function VR(e,t){const n=Ss(e).declarations;if(!n||xe(n)!==e)return;const r=fl(e),i=new Set;for(const e of r){if(!WR(e))continue;const n=bc(e.name),{parent:r}=e;if(196!==r.kind&&r.typeParameters.every(WR)){if(U(i,r)){const i=Sd(r),o=KP(r)?pT(r):fT(i,r.typeParameters),a=1===r.typeParameters.length?[fa._0_is_declared_but_its_value_is_never_read,n]:[fa.All_type_parameters_are_unused];t(e,1,ek(i,o.pos,o.end-o.pos,...a))}}else t(e,1,qp(e,fa._0_is_declared_but_its_value_is_never_read,n))}}function WR(e){return!(262144&ks(e.symbol).isReferenced||zR(e.name))}function $R(e,t,n,r){const i=String(r(t)),o=e.get(i);o?o[1].push(n):e.set(i,[t,[n]])}function HR(e){return rt(ny(e),FD)}function GR(e){return fF(e)?dF(e.parent)?!(!e.propertyName||!zR(e.name)):zR(e.name):dp(e)||(fE(e)&&tu(e.parent.parent)||YR(e))&&zR(e.name)}function XR(e,t){const n=new Map,r=new Map,i=new Map;e.locals.forEach(e=>{if(!(262144&e.flags?!(3&e.flags)||3&e.isReferenced:e.isReferenced||e.exportSymbol)&&e.declarations)for(const o of e.declarations)if(!GR(o))if(YR(o))$R(n,ZR(o),o,_J);else if(fF(o)&&dF(o.parent)){o!==xe(o.parent.elements)&&xe(o.parent.elements).dotDotDotToken||$R(r,o.parent,o,_J)}else if(fE(o)){const e=7&eU(o),t=Fc(o);(4===e||6===e)&&t&&zR(t)||$R(i,o.parent,o,_J)}else{const n=e.valueDeclaration&&HR(e.valueDeclaration),i=e.valueDeclaration&&Fc(e.valueDeclaration);n&&i?rc(n,n.parent)||dv(n)||zR(i)||(fF(o)&&pF(o.parent)?$R(r,o.parent,o,_J):t(n,1,qp(i,fa._0_is_declared_but_its_value_is_never_read,kc(e)))):JR(o,kc(e),t)}}),n.forEach(([e,n])=>{const r=e.parent;if((e.name?1:0)+(e.namedBindings?275===e.namedBindings.kind?1:e.namedBindings.elements.length:0)===n.length)t(r,0,1===n.length?qp(r,fa._0_is_declared_but_its_value_is_never_read,bc(ye(n).name)):qp(r,fa.All_imports_in_import_declaration_are_unused));else for(const e of n)JR(e,bc(e.name),t)}),r.forEach(([e,n])=>{const r=HR(e.parent)?1:0;if(e.elements.length===n.length)1===n.length&&261===e.parent.kind&&262===e.parent.parent.kind?$R(i,e.parent.parent,e.parent,_J):t(e,r,1===n.length?qp(e,fa._0_is_declared_but_its_value_is_never_read,QR(ye(n).name)):qp(e,fa.All_destructured_elements_are_unused));else for(const e of n)t(e,r,qp(e,fa._0_is_declared_but_its_value_is_never_read,QR(e.name)))}),i.forEach(([e,n])=>{if(e.declarations.length===n.length)t(e,0,1===n.length?qp(ye(n).name,fa._0_is_declared_but_its_value_is_never_read,QR(ye(n).name)):qp(244===e.parent.kind?e.parent:e,fa.All_variables_are_unused));else for(const e of n)t(e,0,qp(e,fa._0_is_declared_but_its_value_is_never_read,QR(e.name)))})}function QR(e){switch(e.kind){case 80:return bc(e);case 208:case 207:return QR(it(ye(e.elements),fF).name);default:return pn.assertNever(e)}}function YR(e){return 274===e.kind||277===e.kind||275===e.kind}function ZR(e){return 274===e.kind?e:275===e.kind?e.parent:e.parent.parent}function tB(e){if(242===e.kind&&Kq(e),p_(e)){const t=wi;p(e.statements,az),wi=t}else p(e.statements,az);e.locals&&RR(e)}function nB(e,t,n){if((null==t?void 0:t.escapedText)!==n)return!1;if(173===e.kind||172===e.kind||175===e.kind||174===e.kind||178===e.kind||179===e.kind||304===e.kind)return!1;if(33554432&e.flags)return!1;if((NE(e)||CE(e)||jE(e))&&Wl(e))return!1;const r=ny(e);return!FD(r)||!Pd(r.parent.body)}function rB(e){mc(e,t=>{if(4&Xz(t)){return 80!==e.kind?Jo(Fc(e),fa.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference):Jo(e,fa.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference),!0}return!1})}function oB(e){mc(e,t=>{if(8&Xz(t)){return 80!==e.kind?Jo(Fc(e),fa.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference):Jo(e,fa.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference),!0}return!1})}function sB(e){1048576&Xz(Op(e))&&(pn.assert(Nc(e)&&uD(e.name)&&"string"==typeof e.name.escapedText,"The target of a WeakMap/WeakSet collision check should be an identifier"),Ro("noEmit",e,fa.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel,e.name.escapedText))}function cB(e){let t=!1;if(MF(e)){for(const n of e.members)if(2097152&Xz(n)){t=!0;break}}else if(TF(e))2097152&Xz(e)&&(t=!0);else{const n=Op(e);n&&2097152&Xz(n)&&(t=!0)}t&&(pn.assert(Nc(e)&&uD(e.name),"The target of a Reflect collision check should be an identifier"),Ro("noEmit",e,fa.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers,jp(e.name),"Reflect"))}function lB(t,n){n&&(function(t,n){if(e.getEmitModuleFormatOfFile(Sd(t))>=5)return;if(!n||!nB(t,n,"require")&&!nB(t,n,"exports"))return;if(xE(t)&&1!==eB(t))return;const r=Qc(t);308===r.kind&&rf(r)&&Ro("noEmit",n,fa.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,jp(n),jp(n))}(t,n),function(e,t){if(!t||M>=4||!nB(e,t,"Promise"))return;if(xE(e)&&1!==eB(e))return;const n=Qc(e);308===n.kind&&rf(n)&&4096&n.flags&&Ro("noEmit",t,fa.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,jp(t),jp(t))}(t,n),function(e,t){M<=8&&(nB(e,t,"WeakMap")||nB(e,t,"WeakSet"))&&lo.push(e)}(t,n),function(e,t){t&&M>=2&&M<=8&&nB(e,t,"Reflect")&&_o.push(e)}(t,n),m_(t)?(wJ(n,fa.Class_name_cannot_be_0),33554432&t.flags||function(t){M>=1&&"Object"===t.escapedText&&e.getEmitModuleFormatOfFile(Sd(t))<5&&Jo(t,fa.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0,gi[R])}(n)):bE(t)&&wJ(n,fa.Enum_name_cannot_be_0))}function _B(e){return e===Nt?wt:e===lr?cr:e}function uB(e){var t;if(LR(e),fF(e)||az(e.type),!e.name)return;if(168===e.name.kind&&(uI(e.name),Lu(e)&&e.initializer&&SM(e.initializer)),fF(e)){if(e.propertyName&&uD(e.name)&&ty(e)&&Pd(Yf(e).body))return void uo.push(e);dF(e.parent)&&e.dotDotDotToken&&M1&&H(n.declarations,t=>t!==e&&jf(t)&&!fB(t,e))&&Jo(e.name,fa.All_declarations_of_0_must_have_identical_modifiers,jp(e.name))}else{const t=_B(t_(e));il(r)||il(t)||OS(r,t)||67108864&n.flags||pB(n.valueDeclaration,r,e,t),Lu(e)&&e.initializer&&WS(SM(e.initializer),t,e,e.initializer,void 0),n.valueDeclaration&&!fB(e,n.valueDeclaration)&&Jo(e.name,fa.All_declarations_of_0_must_have_identical_modifiers,jp(e.name))}var i;173!==e.kind&&172!==e.kind&&(gR(e),261!==e.kind&&209!==e.kind||function(e){if(7&eU(e)||ty(e))return;const t=Ss(e);if(1&t.flags){if(!uD(e.name))return pn.fail();const n=Ue(e,e.name.escapedText,3,void 0,!1);if(n&&n!==t&&2&n.flags&&7&KI(n)){const t=Dh(n.valueDeclaration,262),r=244===t.parent.kind&&t.parent.parent?t.parent.parent:void 0;if(!r||!(242===r.kind&&s_(r.parent)||269===r.kind||268===r.kind||308===r.kind)){const t=pc(n);Jo(e,fa.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,t,t)}}}}(e),lB(e,e.name))}function pB(e,t,n,r){const i=Fc(n),o=173===n.kind||172===n.kind?fa.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:fa.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2,a=jp(i),s=Jo(i,o,a,Sc(t),Sc(r));e&&uT(s,qp(e,fa._0_was_also_declared_here,a))}function fB(e,t){if(170===e.kind&&261===t.kind||261===e.kind&&170===t.kind)return!0;if(Eg(e)!==Eg(t))return!1;return zv(e,1358)===zv(t,1358)}function mB(t){var n,r;null==(n=Gn)||n.push(Gn.Phase.Check,"checkVariableDeclaration",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath}),function(t){const n=eU(t),r=7&n;if(w_(t.name))switch(r){case 6:return Wq(t,fa._0_declarations_may_not_have_binding_patterns,"await using");case 4:return Wq(t,fa._0_declarations_may_not_have_binding_patterns,"using")}if(250!==t.parent.parent.kind&&251!==t.parent.parent.kind)if(33554432&n)Mq(t);else if(!t.initializer){if(w_(t.name)&&!w_(t.parent))return Wq(t,fa.A_destructuring_declaration_must_have_an_initializer);switch(r){case 6:return Wq(t,fa._0_declarations_must_be_initialized,"await using");case 4:return Wq(t,fa._0_declarations_must_be_initialized,"using");case 2:return Wq(t,fa._0_declarations_must_be_initialized,"const")}}if(t.exclamationToken&&(244!==t.parent.parent.kind||!t.type||t.initializer||33554432&n)){const e=t.initializer?fa.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?fa.A_definite_assignment_assertion_is_not_permitted_in_this_context:fa.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return Wq(t.exclamationToken,e)}e.getEmitModuleFormatOfFile(Sd(t))<4&&!(33554432&t.parent.parent.flags)&&Av(t.parent.parent,32)&&Rq(t.name);!!r&&Bq(t.name)}(t),uB(t),null==(r=Gn)||r.pop()}function gB(e){return function(e){if(e.dotDotDotToken){const t=e.parent.elements;if(e!==xe(t))return Wq(e,fa.A_rest_element_must_be_last_in_a_destructuring_pattern);if(xq(t,fa.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),e.propertyName)return Wq(e.name,fa.A_rest_element_cannot_have_a_property_name)}if(e.dotDotDotToken&&e.initializer)Vq(e,e.initializer.pos-1,1,fa.A_rest_element_cannot_have_an_initializer)}(e),uB(e)}function hB(e){const t=7&_c(e);(4===t||6===t)&&M=2,s=!a&&j.downlevelIteration,c=j.noUncheckedIndexedAccess&&!!(128&e);if(a||s||o){const o=OB(t,e,a?r:void 0);if(i&&o){const t=8&e?fa.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:32&e?fa.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:64&e?fa.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:16&e?fa.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;t&&VS(n,o.nextType,r,t)}if(o||a)return c?bD(o&&o.yieldType):o&&o.yieldType}let l=t,_=!1;if(4&e){if(1048576&l.flags){const e=t.types,n=D(e,e=>!(402653316&e.flags));n!==e&&(l=zb(n,2))}else 402653316&l.flags&&(l=_n);if(_=l!==t,_&&131072&l.flags)return c?bD(Ut):Ut}if(!QC(l)){if(r){const n=!!(4&e)&&!_,[i,o]=function(n,r){var i;if(r)return n?[fa.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:[fa.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0];if(DB(e,0,t,void 0))return[fa.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!1];if(function(e){switch(e){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return!0}return!1}(null==(i=t.symbol)?void 0:i.escapedName))return[fa.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!0];return n?[fa.Type_0_is_not_an_array_type_or_a_string_type,!0]:[fa.Type_0_is_not_an_array_type,!0]}(n,s);Wo(r,o&&!!hR(l),i,Sc(l))}return _?c?bD(Ut):Ut:void 0}const u=dg(l,Wt);return _&&u?402653316&u.flags&&!j.noUncheckedIndexedAccess?Ut:zb(c?[u,Ut,Lt]:[u,Ut],2):128&e?bD(u):u}function DB(e,t,n,r){if(rl(n))return;const i=OB(n,e,r);return i&&i[gJ(t)]}function EB(e=_n,t=_n,n=Ot){if(67359327&e.flags&&180227&t.flags&&180227&n.flags){const r=uy([e,t,n]);let i=pi.get(r);return i||(i={yieldType:e,returnType:t,nextType:n},pi.set(r,i)),i}return{yieldType:e,returnType:t,nextType:n}}function PB(e){let t,n,r;for(const i of e)if(void 0!==i&&i!==fi){if(i===mi)return mi;t=ae(t,i.yieldType),n=ae(n,i.returnType),r=ae(r,i.nextType)}return t||n||r?EB(t&&zb(t),n&&zb(n),r&&Gb(r)):fi}function AB(e,t){return e[t]}function IB(e,t,n){return e[t]=n}function OB(e,t,n){var r,i;if(e===un)return hi;if(rl(e))return mi;if(!(1048576&e.flags)){const i=n?{errors:void 0,skipLogging:!0}:void 0,o=jB(e,t,n,i);if(o===fi){if(n){const r=zB(n,e,!!(2&t));(null==i?void 0:i.errors)&&uT(r,...i.errors)}return}if(null==(r=null==i?void 0:i.errors)?void 0:r.length)for(const e of i.errors)ho.add(e);return o}const o=2&t?"iterationTypesOfAsyncIterable":"iterationTypesOfIterable",a=AB(e,o);if(a)return a===fi?void 0:a;let s;for(const r of e.types){const a=n?{errors:void 0}:void 0,c=jB(r,t,n,a);if(c===fi){if(n){const r=zB(n,e,!!(2&t));(null==a?void 0:a.errors)&&uT(r,...a.errors)}return void IB(e,o,fi)}if(null==(i=null==a?void 0:a.errors)?void 0:i.length)for(const e of a.errors)ho.add(e);s=ae(s,c)}const c=s?PB(s):fi;return IB(e,o,c),c===fi?void 0:c}function LB(e,t){if(e===fi)return fi;if(e===mi)return mi;const{yieldType:n,returnType:r,nextType:i}=e;return t&&Uv(!0),EB(CR(n,t)||wt,CR(r,t)||wt,i)}function jB(e,t,n,r){if(rl(e))return mi;let i=!1;if(2&t){const r=MB(e,yi)||RB(e,yi);if(r){if(r!==fi||!n)return 8&t?LB(r,n):r;i=!0}}if(1&t){let r=MB(e,vi)||RB(e,vi);if(r)if(r===fi&&n)i=!0;else{if(!(2&t))return r;if(r!==fi)return r=LB(r,n),i?r:IB(e,"iterationTypesOfAsyncIterable",r)}}if(2&t){const t=JB(e,yi,n,r,i);if(t!==fi)return t}if(1&t){let o=JB(e,vi,n,r,i);if(o!==fi)return 2&t?(o=LB(o,n),i?o:IB(e,"iterationTypesOfAsyncIterable",o)):o}return fi}function MB(e,t){return AB(e,t.iterableCacheKey)}function RB(e,t){if(W_(e,t.getGlobalIterableType(!1))||W_(e,t.getGlobalIteratorObjectType(!1))||W_(e,t.getGlobalIterableIteratorType(!1))||W_(e,t.getGlobalGeneratorType(!1))){const[n,r,i]=by(e);return IB(e,t.iterableCacheKey,EB(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(r,void 0)||r,i))}if(V_(e,t.getGlobalBuiltinIteratorTypes())){const[n]=by(e),r=Nv(),i=Ot;return IB(e,t.iterableCacheKey,EB(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(r,void 0)||r,i))}}function BB(e){const t=sv(!1),n=t&&Zc(z_(t),yc(e));return n&&dC(n)?pC(n):`__@${e}`}function JB(e,t,n,r,i){const o=Am(e,BB(t.iteratorSymbolName)),a=!o||16777216&o.flags?void 0:z_(o);if(rl(a))return i?mi:IB(e,t.iterableCacheKey,mi);const s=a?Jm(a,0):void 0,c=D(s,e=>0===hj(e));if(!H(c))return n&&H(s)&&VS(e,t.getGlobalIterableType(!0),n,void 0,void 0,r),i?fi:IB(e,t.iterableCacheKey,fi);const l=qB(Gb(P(c,gh)),t,n,r,i)??fi;return i?l:IB(e,t.iterableCacheKey,l)}function zB(e,t,n){const r=n?fa.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:fa.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;return Wo(e,!!hR(t)||!n&&iE(e.parent)&&e.parent.expression===e&&Sv(!1)!==On&&JS(t,Wv(Sv(!1),[wt,wt,wt])),r,Sc(t))}function qB(e,t,n,r,i){if(rl(e))return mi;let o=function(e,t){return AB(e,t.iteratorCacheKey)}(e,t)||function(e,t){if(W_(e,t.getGlobalIterableIteratorType(!1))||W_(e,t.getGlobalIteratorType(!1))||W_(e,t.getGlobalIteratorObjectType(!1))||W_(e,t.getGlobalGeneratorType(!1))){const[n,r,i]=by(e);return IB(e,t.iteratorCacheKey,EB(n,r,i))}if(V_(e,t.getGlobalBuiltinIteratorTypes())){const[n]=by(e),r=Nv(),i=Ot;return IB(e,t.iteratorCacheKey,EB(n,r,i))}}(e,t);return o===fi&&n&&(o=void 0,i=!0),o??(o=function(e,t,n,r,i){const o=PB([KB(e,t,"next",n,r),KB(e,t,"return",n,r),KB(e,t,"throw",n,r)]);return i?o:IB(e,t.iteratorCacheKey,o)}(e,t,n,r,i)),o===fi?void 0:o}function UB(e,t){const n=Zc(e,"done")||Ht;return JS(0===t?Ht:Gt,n)}function VB(e){return UB(e,0)}function WB(e){return UB(e,1)}function $B(e){if(rl(e))return mi;const t=AB(e,"iterationTypesOfIteratorResult");if(t)return t;if(W_(e,(n=!1,Cr||(Cr=tv("IteratorYieldResult",1,n))||On))){return IB(e,"iterationTypesOfIteratorResult",EB(by(e)[0],void 0,void 0))}var n;if(W_(e,function(e){return wr||(wr=tv("IteratorReturnResult",1,e))||On}(!1))){return IB(e,"iterationTypesOfIteratorResult",EB(void 0,by(e)[0],void 0))}const r=OF(e,VB),i=r!==_n?Zc(r,"value"):void 0,o=OF(e,WB),a=o!==_n?Zc(o,"value"):void 0;return IB(e,"iterationTypesOfIteratorResult",i||a?EB(i,a||ln,void 0):fi)}function KB(e,t,n,r,i){var o,a,s,c;const l=Am(e,n);if(!l&&"next"!==n)return;const u=!l||"next"===n&&16777216&l.flags?void 0:"next"===n?z_(l):pD(z_(l),2097152);if(rl(u))return mi;const d=u?Jm(u,0):_;if(0===d.length){if(r){const e="next"===n?t.mustHaveANextMethodDiagnostic:t.mustBeAMethodDiagnostic;i?(i.errors??(i.errors=[]),i.errors.push(qp(r,e,n))):Jo(r,e,n)}return"next"===n?fi:void 0}if((null==u?void 0:u.symbol)&&1===d.length){const e=t.getGlobalGeneratorType(!1),r=t.getGlobalIteratorType(!1),i=(null==(a=null==(o=e.symbol)?void 0:o.members)?void 0:a.get(n))===u.symbol,l=!i&&(null==(c=null==(s=r.symbol)?void 0:s.members)?void 0:c.get(n))===u.symbol;if(i||l){const t=i?e:r,{mapper:o}=u;return EB(rS(t.typeParameters[0],o),rS(t.typeParameters[1],o),"next"===n?rS(t.typeParameters[2],o):void 0)}}let p,f,m,g,h;for(const e of d)"throw"!==n&&H(e.parameters)&&(p=ae(p,dj(e,0))),f=ae(f,gh(e));if("throw"!==n){const e=p?zb(p):Ot;if("next"===n)g=e;else if("return"===n){m=ae(m,t.resolveIterationType(e,r)||wt)}}const y=f?Gb(f):_n,v=$B(t.resolveIterationType(y,r)||wt);return v===fi?(r&&(i?(i.errors??(i.errors=[]),i.errors.push(qp(r,t.mustHaveAValueDiagnostic,n))):Jo(r,t.mustHaveAValueDiagnostic,n)),h=wt,m=ae(m,wt)):(h=v.yieldType,m=ae(m,v.returnType)),EB(h,zb(m),g)}function YB(e,t,n){if(rl(t))return;const r=ZB(t,n);return r&&r[gJ(e)]}function ZB(e,t){if(rl(e))return mi;const n=t?yi:vi;return OB(e,t?2:1,void 0)||function(e,t,n,r){return qB(e,t,n,r,!1)}(e,n,void 0,void 0)}function nJ(e){Kq(e)||function(e){let t=e;for(;t;){if(c_(t))return Wq(e,fa.Jump_target_cannot_cross_function_boundary);switch(t.kind){case 257:if(e.label&&t.label.escapedText===e.label.escapedText){return!!(252===e.kind&&!X_(t.statement,!0))&&Wq(e,fa.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement)}break;case 256:if(253===e.kind&&!e.label)return!1;break;default:if(X_(t,!1)&&!e.label)return!1}t=t.parent}if(e.label){return Wq(e,253===e.kind?fa.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:fa.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement)}Wq(e,253===e.kind?fa.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:fa.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement)}(e)}function iJ(e,t){const n=!!(2&t);if(!!(1&t)){const t=YB(1,e,n);return t?n?wR(kR(t)):t:Et}return n?wR(e)||Et:e}function oJ(e,t){const n=iJ(t,Rh(e));return!(!n||!(oM(n,16384)||32769&n.flags))}function pJ(e,t,n,r,i,o=!1){const a=Om(n),s=Rh(e);if(r){const i=_h(r,a);if(IF(i))return pJ(e,t,n,i.whenTrue,WM(i.whenTrue),!0),void pJ(e,t,n,i.whenFalse,WM(i.whenFalse),!0)}const c=254===n.kind,l=2&s?vR(i,!1,n,fa.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):i,_=r&&_L(r);WS(l,t,c&&!o?n:_,_)}function kJ(e){Kq(e)||uD(e.expression)&&!e.expression.escapedText&&function(e,t,...n){const r=Sd(e);if(!qq(r)){const i=Zp(r,e.pos);return ho.add(ek(r,Is(i),0,t,...n)),!0}}(e,fa.Line_break_not_permitted_here),e.expression&&WM(e.expression)}function SJ(e,t,n){const r=cg(e);if(0===r.length)return;for(const t of Kp(e))n&&4194304&t.flags||TJ(e,t,ix(t,8576,!0),U_(t));const i=t.valueDeclaration;if(i&&m_(i))for(const t of i.members)if((!n&&!Iv(t)||n&&Iv(t))&&!vd(t)){const n=Ss(t);TJ(e,n,qM(t.name.expression),U_(n))}if(r.length>1)for(const t of r)CJ(e,t)}function TJ(e,t,n,r){const i=t.valueDeclaration,o=Fc(i);if(o&&dD(o))return;const a=pg(e,n),s=2&xx(e)?Qu(e.symbol,265):void 0,c=i&&227===i.kind||o&&168===o.kind?i:void 0,l=Cs(t)===e.symbol?i:void 0;for(const n of a){const i=n.declaration&&Cs(Ss(n.declaration))===e.symbol?n.declaration:void 0,o=l||i||(s&&!H(gu(e),e=>!!Qp(e,t.escapedName)&&!!dg(e,n.keyType))?s:void 0);if(o&&!JS(r,n.type)){const e=Bo(o,fa.Property_0_of_type_1_is_not_assignable_to_2_index_type_3,pc(t),Sc(r),Sc(n.keyType),Sc(n.type));c&&o!==c&&uT(e,qp(c,fa._0_is_declared_here,pc(t))),ho.add(e)}}}function CJ(e,t){const n=t.declaration,r=pg(e,t.keyType),i=2&xx(e)?Qu(e.symbol,265):void 0,o=n&&Cs(Ss(n))===e.symbol?n:void 0;for(const n of r){if(n===t)continue;const r=n.declaration&&Cs(Ss(n.declaration))===e.symbol?n.declaration:void 0,a=o||r||(i&&!H(gu(e),e=>!!lg(e,t.keyType)&&!!dg(e,n.keyType))?i:void 0);a&&!JS(t.type,n.type)&&Jo(a,fa._0_index_type_1_is_not_assignable_to_2_index_type_3,Sc(t.keyType),Sc(t.type),Sc(n.keyType),Sc(n.type))}}function wJ(e,t){switch(e.escapedText){case"any":case"unknown":case"never":case"number":case"bigint":case"boolean":case"string":case"symbol":case"void":case"object":case"undefined":Jo(e,t,e.escapedText)}}function NJ(e){let t=!1;if(e)for(let t=0;t{n.default?(t=!0,function(e,t,n){function r(e){if(184===e.kind){const r=$y(e);if(262144&r.flags)for(let i=n;i264===e.kind||265===e.kind)}(e);if(!n||n.length<=1)return;if(!FJ(n,Ru(e).localTypeParameters,fl)){const t=pc(e);for(const e of n)Jo(e.name,fa.All_declarations_of_0_must_have_identical_type_parameters,t)}}}function FJ(e,t,n){const r=d(t),i=Mg(t);for(const o of e){const e=n(o),a=e.length;if(ar)return!1;for(let n=0;n1)return Uq(r.types[1],fa.Classes_can_only_extend_a_single_class);t=!0}else{if(pn.assert(119===r.token),n)return Uq(r,fa.implements_clause_already_seen);n=!0}wq(r)}})(e)||kq(e.typeParameters,t)}(e),LR(e),lB(e,e.name),NJ(fl(e)),gR(e);const t=Ss(e),n=Ru(t),r=Id(n),i=z_(t);DJ(t),mR(t),function(e){const t=new Map,n=new Map,r=new Map;for(const o of e.members)if(177===o.kind)for(const e of o.parameters)rc(e,o)&&!w_(e.name)&&i(t,e.name,e.name.escapedText,3);else{const e=Iv(o),a=o.name;if(!a)continue;const s=dD(a),c=s&&e?16:0,l=s?r:e?n:t,_=a&&Yq(a);if(_)switch(o.kind){case 178:i(l,a,_,1|c);break;case 179:i(l,a,_,2|c);break;case 173:i(l,a,_,3|c);break;case 175:i(l,a,_,8|c)}}function i(e,t,n,r){const i=e.get(n);if(i)if((16&i)!=(16&r))Jo(t,fa.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name,ep(t));else{const o=!!(8&i),a=!!(8&r);o||a?o!==a&&Jo(t,fa.Duplicate_identifier_0,ep(t)):i&r&-17?Jo(t,fa.Duplicate_identifier_0,ep(t)):e.set(n,i|r)}else e.set(n,r)}}(e);!!(33554432&e.flags)||function(e){for(const t of e.members){const n=t.name;if(Iv(t)&&n){const t=Yq(n);switch(t){case"name":case"length":case"caller":case"arguments":if(z)break;case"prototype":Jo(n,fa.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1,t,Vc(Ss(e)))}}}}(e);const o=kh(e);if(o){p(o.typeArguments,az),M{const t=s[0],a=pu(n),c=qf(a);if(function(e,t){const n=Jm(e,1);if(n.length){const r=n[0].declaration;if(r&&Pv(r,2)){xz(t,bx(e.symbol))||Jo(t,fa.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private,es(e.symbol))}}}(c,o),az(o.expression),H(o.typeArguments)){p(o.typeArguments,az);for(const e of cu(c,o.typeArguments,o))if(!aR(o,e.typeParameters))break}const l=Id(t,n.thisType);if(VS(r,l,void 0)?VS(i,IS(c),e.name||e,fa.Class_static_side_0_incorrectly_extends_base_class_static_side_1):LJ(e,r,l,fa.Class_0_incorrectly_extends_base_class_1),8650752&a.flags)if(ou(i)){Jm(a,1).some(e=>4&e.flags)&&!Av(e,64)&&Jo(e.name||e,fa.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract)}else Jo(e.name||e,fa.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);if(!(c.symbol&&32&c.symbol.flags||8650752&a.flags)){p(du(c,o.typeArguments,o),e=>!ML(e.declaration)&&!OS(gh(e),t))&&Jo(o.expression,fa.Base_constructors_must_all_have_the_same_return_type)}!function(e,t){var n,r,i,o,a;const s=lf(t),c=new Map;e:for(const l of s){const s=jJ(l);if(4194304&s.flags)continue;const _=Qp(e,s.escapedName);if(!_)continue;const u=jJ(_),d=lx(s);if(pn.assert(!!u,"derived should point to something, even if it is the base class' declaration."),u===s){const r=bx(e.symbol);if(64&d&&(!r||!Av(r,64))){for(const n of gu(e)){if(n===t)continue;const e=Qp(n,s.escapedName),r=e&&jJ(e);if(r&&r!==s)continue e}const i=Sc(t),o=Sc(e),a=pc(l),_=ae(null==(n=c.get(r))?void 0:n.missedProperties,a);c.set(r,{baseTypeName:i,typeName:o,missedProperties:_})}}else{const n=lx(u);if(2&d||2&n)continue;let c;const l=98308&s.flags,_=98308&u.flags;if(l&&_){if((6&cx(s)?null==(r=s.declarations)?void 0:r.some(e=>MJ(e,d)):null==(i=s.declarations)?void 0:i.every(e=>MJ(e,d)))||262144&cx(s)||u.valueDeclaration&&AF(u.valueDeclaration))continue;const c=4!==l&&4===_;if(c||4===l&&4!==_){const n=c?fa._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:fa._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;Jo(Fc(u.valueDeclaration)||u.valueDeclaration,n,pc(s),Sc(t),Sc(e))}else if(z){const r=null==(o=u.declarations)?void 0:o.find(e=>173===e.kind&&!e.initializer);if(r&&!(33554432&u.flags)&&!(64&d)&&!(64&n)&&!(null==(a=u.declarations)?void 0:a.some(e=>!!(33554432&e.flags)))){const n=SC(bx(e.symbol)),i=r.name;if(r.exclamationToken||!n||!uD(i)||!$||!BJ(i,e,n)){const e=fa.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;Jo(Fc(u.valueDeclaration)||u.valueDeclaration,e,pc(s),Sc(t))}}}continue}if(GI(s)){if(GI(u)||4&u.flags)continue;pn.assert(!!(98304&u.flags)),c=fa.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor}else c=98304&s.flags?fa.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:fa.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;Jo(Fc(u.valueDeclaration)||u.valueDeclaration,c,Sc(t),pc(s),Sc(e))}}for(const[e,t]of c)if(1===d(t.missedProperties))MF(e)?Jo(e,fa.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,ye(t.missedProperties),t.baseTypeName):Jo(e,fa.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,t.typeName,ye(t.missedProperties),t.baseTypeName);else if(d(t.missedProperties)>5){const n=P(t.missedProperties.slice(0,4),e=>`'${e}'`).join(", "),r=d(t.missedProperties)-4;MF(e)?Jo(e,fa.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more,t.baseTypeName,n,r):Jo(e,fa.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more,t.typeName,t.baseTypeName,n,r)}else{const n=P(t.missedProperties,e=>`'${e}'`).join(", ");MF(e)?Jo(e,fa.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1,t.baseTypeName,n):Jo(e,fa.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2,t.typeName,t.baseTypeName,n)}}(n,t)})}!function(e,t,n,r){const i=kh(e),o=i&&gu(t),a=(null==o?void 0:o.length)?Id(ye(o),t.thisType):void 0,s=pu(t);for(const i of e.members)Mv(i)||(jD(i)&&p(i.parameters,o=>{rc(o,i)&&IJ(e,r,s,a,t,n,o,!0)}),IJ(e,r,s,a,t,n,i,!1))}(e,n,r,i);const s=Th(e);if(s)for(const e of s)ub(e.expression)&&!xl(e.expression)||Jo(e.expression,fa.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments),cR(e),a(c(e));function c(t){return()=>{const i=Qf($k(t));if(!il(i))if(vu(i)){const t=i.symbol&&32&i.symbol.flags?fa.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:fa.Class_0_incorrectly_implements_interface_1,o=Id(i,n.thisType);VS(r,o,void 0)||LJ(e,r,o,t)}else Jo(t,fa.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members)}}a(()=>{SJ(n,t),SJ(i,t,!0),YM(e),function(e){if(!$||!Y||33554432&e.flags)return;const t=SC(e);for(const n of e.members)if(!(128&Vv(n))&&!Iv(n)&&RJ(n)){const e=n.name;if(uD(e)||dD(e)||ND(e)){const r=z_(Ss(n));3&r.flags||gT(r)||t&&BJ(e,r,t)||Jo(n.name,fa.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor,jp(e))}}}(e)})}function IJ(e,t,n,r,i,o,a,s,c=!0){const l=a.name&&Nz(a.name)||Nz(a);return l?OJ(e,t,n,r,i,o,Lv(a),jv(a),Iv(a),s,l,c?a:void 0):0}function OJ(e,t,n,r,i,o,a,s,c,l,_,u){const d=Om(e),p=!!(33554432&e.flags);if(a&&(null==_?void 0:_.valueDeclaration)&&f_(_.valueDeclaration)&&_.valueDeclaration.name&&bd(_.valueDeclaration.name))return Jo(u,d?fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic:fa.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic),2;if(r&&(a||j.noImplicitOverride)){const e=c?n:r,i=Am(c?t:o,_.escapedName),f=Am(e,_.escapedName),m=Sc(r);if(i&&!f&&a){if(u){const t=DO(kc(_),e);t?Jo(u,d?fa.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:fa.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,m,pc(t)):Jo(u,d?fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:fa.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0,m)}return 2}if(i&&(null==f?void 0:f.declarations)&&j.noImplicitOverride&&!p){const e=H(f.declarations,jv);if(a)return 0;if(!e){if(u){Jo(u,l?d?fa.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:fa.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:d?fa.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:fa.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0,m)}return 1}if(s&&e)return u&&Jo(u,fa.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0,m),1}}else if(a){if(u){const e=Sc(i);Jo(u,d?fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:fa.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class,e)}return 2}return 0}function LJ(e,t,n,r){let i=!1;for(const r of e.members){if(Iv(r))continue;const e=r.name&&Nz(r.name)||Nz(r);if(e){const o=Am(t,e.escapedName),a=Am(n,e.escapedName);if(o&&a){const s=()=>ik(void 0,fa.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,pc(e),Sc(t),Sc(n));VS(z_(o),z_(a),r.name||r,void 0,s)||(i=!0)}}}i||VS(t,n,e.name||e,r)}function jJ(e){return 1&cx(e)?e.links.target:e}function MJ(e,t){return 64&t&&(!AD(e)||!e.initializer)||yE(e.parent)}function RJ(e){return 173===e.kind&&!jv(e)&&!e.exclamationToken&&!e.initializer}function BJ(e,t,n){const r=ND(e)?bw.createElementAccessExpression(bw.createThis(),e.expression):bw.createPropertyAccessExpression(bw.createThis(),e);IT(r.expression,r),IT(r,n),r.flowNode=n.returnFlowNode;return!gT(IE(r,t,Nw(t)))}function JJ(e){vq(e)||function(e){let t=!1;if(e.heritageClauses)for(const n of e.heritageClauses){if(96!==n.token)return pn.assert(119===n.token),Uq(n,fa.Interface_declaration_cannot_have_implements_clause);if(t)return Uq(n,fa.extends_clause_already_seen);t=!0,wq(n)}}(e),zq(e.parent)||Wq(e,fa._0_declarations_can_only_be_declared_inside_a_block,"interface"),NJ(e.typeParameters),a(()=>{wJ(e.name,fa.Interface_name_cannot_be_0),gR(e);const t=Ss(e);DJ(t);const n=Qu(t,265);if(e===n){const n=Ru(t),r=Id(n);if(function(e,t){const n=gu(e);if(n.length<2)return!0;const r=new Map;p(ad(e).declaredProperties,t=>{r.set(t.escapedName,{prop:t,containingType:e})});let i=!0;for(const o of n){const n=lf(Id(o,e.thisType));for(const a of n){const n=r.get(a.escapedName);if(n){if(n.containingType!==e&&!JC(n.prop,a)){i=!1;const r=Sc(n.containingType),s=Sc(o);let c=ik(void 0,fa.Named_property_0_of_types_1_and_2_are_not_identical,pc(a),r,s);c=ik(c,fa.Interface_0_cannot_simultaneously_extend_types_1_and_2,Sc(e),r,s),ho.add(Wp(Sd(t),t,c))}}else r.set(a.escapedName,{prop:a,containingType:o})}}return i}(n,e.name)){for(const t of gu(n))VS(r,Id(t,n.thisType),e.name,fa.Interface_0_incorrectly_extends_interface_1);SJ(n,t)}}QM(e)}),p(wh(e),e=>{ub(e.expression)&&!xl(e.expression)||Jo(e.expression,fa.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments),cR(e)}),p(e.members,az),a(()=>{YM(e),RR(e)})}function zJ(e){const t=ua(e);if(!(1024&t.flags)){t.flags|=1024;let n,r=0;for(const t of e.members){const e=qJ(t,r,n);ua(t).enumMemberValue=e,r="number"==typeof e.value?e.value+1:void 0,n=t}}}function qJ(e,t,n){if(Rp(e.name))Jo(e.name,fa.Computed_property_names_are_not_allowed_in_enums);else if(HN(e.name))Jo(e.name,fa.An_enum_member_cannot_have_a_numeric_name);else{const t=Jp(e.name);WT(t)&&!zT(t)&&Jo(e.name,fa.An_enum_member_cannot_have_a_numeric_name)}if(e.initializer)return function(e){const t=af(e.parent),n=e.initializer,r=Se(n,e);void 0!==r.value?t&&"number"==typeof r.value&&!isFinite(r.value)?Jo(n,isNaN(r.value)?fa.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:fa.const_enum_member_initializer_was_evaluated_to_a_non_finite_value):Nk(j)&&"string"==typeof r.value&&!r.isSyntacticallyString&&Jo(n,fa._0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled,`${bc(e.parent.name)}.${Jp(e.name)}`):t?Jo(n,fa.const_enum_member_initializers_must_be_constant_expressions):33554432&e.parent.flags?Jo(n,fa.In_ambient_enum_declarations_member_initializer_must_be_constant_expression):VS(WM(n),Wt,n,fa.Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values);return r}(e);if(33554432&e.parent.flags&&!af(e.parent))return bC(void 0);if(void 0===t)return Jo(e.name,fa.Enum_member_must_have_initializer),bC(void 0);if(Nk(j)&&(null==n?void 0:n.initializer)){const t=Yz(n);("number"!=typeof t.value||t.resolvedOtherFiles)&&Jo(e.name,fa.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled)}return bC(t)}function UJ(e,t){const n=ns(e,111551,!0);if(!n)return bC(void 0);if(80===e.kind){const t=e;if(zT(t.escapedText)&&n===Zy(t.escapedText,111551,void 0))return bC(+t.escapedText,!1)}if(8&n.flags)return t?VJ(e,n,t):Yz(n.valueDeclaration);if(nP(n)){const e=n.valueDeclaration;if(e&&fE(e)&&!e.type&&e.initializer&&(!t||e!==t&&pa(e,t))){const n=Se(e.initializer,e);return t&&Sd(t)!==Sd(e)?bC(n.value,!1,!0,!0):bC(n.value,n.isSyntacticallyString,n.resolvedOtherFiles,!0)}}return bC(void 0)}function VJ(e,t,n){const r=t.valueDeclaration;if(!r||r===n)return Jo(e,fa.Property_0_is_used_before_being_assigned,pc(t)),bC(void 0);if(!pa(r,n))return Jo(e,fa.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums),bC(0);const i=Yz(r);return n.parent!==r.parent?bC(i.value,i.isSyntacticallyString,i.resolvedOtherFiles,!0):i}function WJ(e){a(()=>function(e){vq(e),lB(e,e.name),gR(e),e.members.forEach(az),!j.erasableSyntaxOnly||33554432&e.flags||Jo(e,fa.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);zJ(e);const t=Ss(e),n=Qu(t,e.kind);if(e===n){if(t.declarations&&t.declarations.length>1){const n=af(e);p(t.declarations,e=>{bE(e)&&af(e)!==n&&Jo(Fc(e),fa.Enum_declarations_must_all_be_const_or_non_const)})}let n=!1;p(t.declarations,e=>{if(267!==e.kind)return!1;const t=e;if(!t.members.length)return!1;const r=t.members[0];r.initializer||(n?Jo(r.name,fa.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):n=!0)})}}(e))}function $J(t){t.body&&(az(t.body),hp(t)||RR(t)),a(function(){var n,r;const i=hp(t),o=33554432&t.flags;i&&!o&&Jo(t.name,fa.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);const a=dp(t),s=a?fa.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:fa.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;if(nz(t,s))return;vq(t)||o||11!==t.name.kind||Wq(t.name,fa.Only_ambient_modules_can_use_quoted_names);if(uD(t.name)&&(lB(t,t.name),!(2080&t.flags))){const e=Sd(t),n=Zp(e,Hd(t));yo.add(ek(e,n.start,n.length,fa.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead))}gR(t);const c=Ss(t);if(512&c.flags&&!o&&dJ(t,Ok(j))){if(j.erasableSyntaxOnly&&Jo(t.name,fa.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled),Nk(j)&&!Sd(t).externalModuleIndicator&&Jo(t.name,fa.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,Me),(null==(n=c.declarations)?void 0:n.length)>1){const e=function(e){const t=e.declarations;if(t)for(const e of t)if((264===e.kind||263===e.kind&&Ad(e.body))&&!(33554432&e.flags))return e}(c);e&&(Sd(t)!==Sd(e)?Jo(t.name,fa.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged):t.pos95===e.kind);e&&Jo(e,fa.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}}if(a)if(yp(t)){if((i||33554432&Ss(t).flags)&&t.body)for(const e of t.body.statements)HJ(e,i)}else nf(t.parent)?i?Jo(t.name,fa.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations):Fs($h(t.name))&&Jo(t.name,fa.Ambient_module_declaration_cannot_specify_relative_module_name):Jo(t.name,i?fa.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:fa.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces)})}function HJ(e,t){switch(e.kind){case 244:for(const n of e.declarationList.declarations)HJ(n,t);break;case 278:case 279:Uq(e,fa.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);break;case 272:if(Pm(e))break;case 273:Uq(e,fa.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);break;case 209:case 261:const n=e.name;if(w_(n)){for(const e of n.elements)HJ(e,t);break}case 264:case 267:case 263:case 265:case 268:case 266:if(t)return}}function KJ(e){const t=wg(e);if(!t||Pd(t))return!1;if(!KN(t))return Jo(t,fa.String_literal_expected),!1;const n=269===e.parent.kind&&dp(e.parent.parent);if(308!==e.parent.kind&&!n)return Jo(t,279===e.kind?fa.Export_declarations_are_not_permitted_in_a_namespace:fa.Import_declarations_in_a_namespace_cannot_reference_a_module),!1;if(n&&Fs(t.text)&&!Jc(e))return Jo(e,fa.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name),!1;if(!CE(e)&&e.attributes){const t=118===e.attributes.token?fa.Import_attribute_values_must_be_string_literal_expressions:fa.Import_assertion_values_must_be_string_literal_expressions;let n=!1;for(const r of e.attributes.elements)KN(r.value)||(n=!0,Jo(r.value,t));return!n}return!0}function GJ(e,t=!0){void 0!==e&&11===e.kind&&(t?5!==R&&6!==R||Wq(e,fa.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020):Wq(e,fa.Identifier_expected))}function XJ(t){var n,r,i,o,a;let s=Ss(t);const c=Ha(s);if(c!==bt){if(s=ks(s.exportSymbol||s),Om(t)&&!(111551&c.flags)&&!Wl(t)){const e=ql(t)?t.propertyName||t.name:Nc(t)?t.name:t;if(pn.assert(281!==t.kind),282===t.kind){const o=Jo(e,fa.Types_cannot_appear_in_export_declarations_in_JavaScript_files),a=null==(r=null==(n=Sd(t).symbol)?void 0:n.exports)?void 0:r.get(Qd(t.propertyName||t.name));if(a===c){const e=null==(i=a.declarations)?void 0:i.find(Nu);e&&uT(o,qp(e,fa._0_is_automatically_exported_here,vc(a.escapedName)))}}else{pn.assert(261!==t.kind);const n=mc(t,nn(wE,CE)),r=(n&&(null==(o=kg(n))?void 0:o.text))??"...",i=vc(uD(e)?e.escapedText:s.escapedName);Jo(e,fa._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation,i,`import("${r}").${i}`)}return}const l=Ga(c);if(l&((1160127&s.flags?111551:0)|(788968&s.flags?788968:0)|(1920&s.flags?1920:0))){Jo(t,282===t.kind?fa.Export_declaration_conflicts_with_exported_declaration_of_0:fa.Import_declaration_conflicts_with_local_declaration_of_0,pc(s))}else if(282!==t.kind){j.isolatedModules&&!mc(t,Wl)&&1160127&s.flags&&Jo(t,fa.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,pc(s),Me)}if(Nk(j)&&!Wl(t)&&!(33554432&t.flags)){const n=Ya(s),r=!(111551&l);if(r||n)switch(t.kind){case 274:case 277:case 272:if(j.verbatimModuleSyntax){pn.assertIsDefined(t.name,"An ImportClause with a symbol should have a name");const e=j.verbatimModuleSyntax&&Pm(t)?fa.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled:r?fa._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:fa._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled,i=Xd(277===t.kind&&t.propertyName||t.name);ha(Jo(t,e,i),r?void 0:n,i)}r&&272===t.kind&&Pv(t,32)&&Jo(t,fa.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled,Me);break;case 282:if(j.verbatimModuleSyntax||Sd(n)!==Sd(t)){const e=Xd(t.propertyName||t.name);ha(r?Jo(t,fa.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type,Me):Jo(t,fa._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled,e,Me),r?void 0:n,e);break}}if(j.verbatimModuleSyntax&&272!==t.kind&&!Om(t)&&1===e.getEmitModuleFormatOfFile(Sd(t))?Jo(t,zo(t)):200===R&&272!==t.kind&&261!==t.kind&&1===e.getEmitModuleFormatOfFile(Sd(t))&&Jo(t,fa.ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve),j.verbatimModuleSyntax&&!Wl(t)&&!(33554432&t.flags)&&128&l){const n=c.valueDeclaration,r=null==(a=e.getRedirectFromOutput(Sd(n).resolvedPath))?void 0:a.resolvedRef;!(33554432&n.flags)||r&&Ok(r.commandLine.options)||Jo(t,fa.Cannot_access_ambient_const_enums_when_0_is_enabled,Me)}}if(jE(t)){const e=QJ(s,t);Ho(e)&&e.declarations&&Go(t,e.declarations,e.escapedName)}}}function QJ(e,t){if(!(2097152&e.flags)||Ho(e)||!Ca(e))return e;const n=Ha(e);if(n===bt)return n;for(;2097152&e.flags;){const r=hI(e);if(!r)break;if(r===n)break;if(r.declarations&&d(r.declarations)){if(Ho(r)){Go(t,r.declarations,r.escapedName);break}if(e===n)break;e=r}}return n}function YJ(t){lB(t,t.name),XJ(t),277===t.kind&&(GJ(t.propertyName),Yd(t.propertyName||t.name)&&Dk(j)&&e.getEmitModuleFormatOfFile(Sd(t))<4&&hq(t,131072))}function ZJ(e){var t;const n=e.attributes;if(n){const r=av(!0);r!==Nn&&VS(n_(n),Cw(r,32768),n);const i=kV(e),o=wV(n,i?Wq:void 0),a=118===e.attributes.token;if(i&&o)return;if(!Vk(R))return Wq(n,a?fa.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve:fa.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve);if(102<=R&&R<=199&&!a)return Uq(n,fa.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);if(e.moduleSpecifier&&1===Pa(e.moduleSpecifier))return Wq(n,a?fa.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:fa.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls);if(tA(e)||(wE(e)?null==(t=e.importClause)?void 0:t.isTypeOnly:e.isTypeOnly))return Wq(n,a?fa.Import_attributes_cannot_be_used_with_type_only_imports_or_exports:fa.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);if(o)return Wq(n,fa.resolution_mode_can_only_be_set_for_type_only_imports)}}function ez(t){if(!nz(t,Om(t)?fa.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:fa.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){if(!vq(t)&&t.modifiers&&Uq(t,fa.An_import_declaration_cannot_have_modifiers),KJ(t)){let n;const r=t.importClause;r&&!function(e){var t,n;if(156===e.phaseModifier){if(e.name&&e.namedBindings)return Wq(e,fa.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);if(276===(null==(t=e.namedBindings)?void 0:t.kind))return Xq(e.namedBindings)}else if(166===e.phaseModifier){if(e.name)return Wq(e,fa.Default_imports_are_not_allowed_in_a_deferred_import);if(276===(null==(n=e.namedBindings)?void 0:n.kind))return Wq(e,fa.Named_imports_are_not_allowed_in_a_deferred_import);if(99!==R&&200!==R)return Wq(e,fa.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve)}return!1}(r)?(r.name&&YJ(r),r.namedBindings&&(275===r.namedBindings.kind?(YJ(r.namedBindings),e.getEmitModuleFormatOfFile(Sd(t))<4&&Dk(j)&&hq(t,65536)):(n=is(t,t.moduleSpecifier),n&&p(r.namedBindings.elements,YJ))),!r.isTypeOnly&&101<=R&&R<=199&&Aa(t.moduleSpecifier,n)&&!function(e){return!!e.attributes&&e.attributes.elements.some(e=>{var t;return"type"===$h(e.name)&&"json"===(null==(t=rt(e.value,Ju))?void 0:t.text)})}(t)&&Jo(t.moduleSpecifier,fa.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0,gi[R])):ce&&!r&&is(t,t.moduleSpecifier)}ZJ(t)}}function tz(t){if(!nz(t,Om(t)?fa.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:fa.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){if(!vq(t)&&Ev(t)&&Uq(t,fa.An_export_declaration_cannot_have_modifiers),function(e){var t;if(e.isTypeOnly&&280===(null==(t=e.exportClause)?void 0:t.kind))return Xq(e.exportClause)}(t),!t.moduleSpecifier||KJ(t))if(t.exportClause&&!OE(t.exportClause)){p(t.exportClause.elements,rz);const e=269===t.parent.kind&&dp(t.parent.parent),n=!e&&269===t.parent.kind&&!t.moduleSpecifier&&33554432&t.flags;308===t.parent.kind||e||n||Jo(t,fa.Export_declarations_are_not_permitted_in_a_namespace)}else{const n=is(t,t.moduleSpecifier);n&&ds(n)?Jo(t.moduleSpecifier,fa.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk,pc(n)):t.exportClause&&(XJ(t.exportClause),GJ(t.exportClause.name)),e.getEmitModuleFormatOfFile(Sd(t))<4&&(t.exportClause?Dk(j)&&hq(t,65536):hq(t,32768))}ZJ(t)}}function nz(e,t){const n=308===e.parent.kind||269===e.parent.kind||268===e.parent.kind;return n||Uq(e,t),!n}function rz(t){XJ(t);const n=void 0!==t.parent.parent.moduleSpecifier;if(GJ(t.propertyName,n),GJ(t.name),Ik(j)&&$c(t.propertyName||t.name,!0),n)Dk(j)&&e.getEmitModuleFormatOfFile(Sd(t))<4&&Yd(t.propertyName||t.name)&&hq(t,131072);else{const e=t.propertyName||t.name;if(11===e.kind)return;const n=Ue(e,e.escapedText,2998271,void 0,!0);n&&(n===Ne||n===Fe||n.declarations&&nf(Qc(n.declarations[0])))?Jo(e,fa.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,bc(e)):xP(t,7)}}function iz(e){const t=Ss(e),n=_a(t);if(!n.exportsChecked){const e=t.exports.get("export=");if(e&&function(e){return sd(e.exports,(e,t)=>"export="!==t)}(t)){const t=Ca(e)||e.valueDeclaration;!t||Jc(t)||Om(t)||Jo(t,fa.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements)}const r=hs(t);r&&r.forEach(({declarations:e,flags:t},n)=>{if("__export"===n)return;if(1920&t)return;const r=N(e,tn(aJ,rn(yE)));if(!(524288&t&&r<=2)&&r>1&&!oz(e))for(const t of e)fJ(t)&&ho.add(qp(t,fa.Cannot_redeclare_exported_variable_0,vc(n)))}),n.exportsChecked=!0}}function oz(e){return e&&e.length>1&&e.every(e=>Om(e)&&Dx(e)&&(ng(e.expression)||ig(e.expression)))}function az(n){if(n){const i=r;r=n,h=0,function(n){if(8388608&Xz(n))return;Bg(n)&&p(n.jsDoc,({comment:e,tags:t})=>{sz(e),p(t,e=>{sz(e.comment),Om(n)&&az(e)})});const r=n.kind;if(t)switch(r){case 268:case 264:case 265:case 263:t.throwIfCancellationRequested()}r>=244&&r<=260&&Rg(n)&&n.flowNode&&!SE(n.flowNode)&&Vo(!1===j.allowUnreachableCode,n,fa.Unreachable_code_detected);switch(r){case 169:return $M(n);case 170:return HM(n);case 173:return ZM(n);case 172:return function(e){return dD(e.name)&&Jo(e,fa.Private_identifiers_are_not_allowed_outside_class_bodies),ZM(e)}(n);case 186:case 185:case 180:case 181:case 182:return GM(n);case 175:case 174:return function(e){Lq(e)||Dq(e.name),OD(e)&&e.asteriskToken&&uD(e.name)&&"constructor"===bc(e.name)&&Jo(e.name,fa.Class_constructor_may_not_be_a_generator),MR(e),Av(e,64)&&175===e.kind&&e.body&&Jo(e,fa.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,jp(e.name)),dD(e.name)&&!em(e)&&Jo(e,fa.Private_identifiers_are_not_allowed_outside_class_bodies),eR(e)}(n);case 176:return function(e){vq(e),iO(e,az)}(n);case 177:return tR(n);case 178:case 179:return rR(n);case 184:return cR(n);case 183:return function(e){const t=function(e){switch(e.parent.kind){case 220:case 180:case 263:case 219:case 185:case 175:case 174:const t=e.parent;if(e===t.type)return t}}(e);if(!t)return void Jo(e,fa.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);const n=zg(t),r=oh(n);if(!r)return;az(e.type);const{parameterName:i}=e;if(0!==r.kind&&2!==r.kind)if(r.parameterIndex>=0){if(hJ(n)&&r.parameterIndex===n.parameters.length-1)Jo(i,fa.A_type_predicate_cannot_reference_a_rest_parameter);else if(r.type){const t=()=>ik(void 0,fa.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type);VS(r.type,z_(n.parameters[r.parameterIndex]),e.type,void 0,t)}}else if(i){let n=!1;for(const{name:e}of t.parameters)if(w_(e)&&KM(e,i,r.parameterName)){n=!0;break}n||Jo(e.parameterName,fa.Cannot_find_parameter_0,r.parameterName)}}(n);case 187:return function(e){Ky(e)}(n);case 188:return function(e){p(e.members,az),a(function(){const t=uk(e);SJ(t,t.symbol),YM(e),QM(e)})}(n);case 189:return function(e){az(e.elementType)}(n);case 190:return function(e){let t=!1,n=!1;for(const r of e.elements){let e=Gv(r);if(8&e){const t=$k(r.type);if(!QC(t)){Jo(r,fa.A_rest_element_type_must_be_an_array_type);break}($C(t)||fw(t)&&4&t.target.combinedFlags)&&(e|=4)}if(4&e){if(n){Wq(r,fa.A_rest_element_cannot_follow_another_rest_element);break}n=!0}else if(2&e){if(n){Wq(r,fa.An_optional_element_cannot_follow_a_rest_element);break}t=!0}else if(1&e&&t){Wq(r,fa.A_required_element_cannot_follow_an_optional_element);break}}p(e.elements,az),$k(e)}(n);case 193:case 194:return function(e){p(e.types,az),$k(e)}(n);case 197:case 191:case 192:return az(n.type);case 198:return function(e){zk(e)}(n);case 199:return dR(n);case 195:return function(e){iO(e,az)}(n);case 196:return function(e){mc(e,e=>e.parent&&195===e.parent.kind&&e.parent.extendsType===e)||Wq(e,fa.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type),az(e.typeParameter);const t=Ss(e.typeParameter);if(t.declarations&&t.declarations.length>1){const e=_a(t);if(!e.typeParametersChecked){e.typeParametersChecked=!0;const n=ju(t),r=Yu(t,169);if(!FJ(r,[n],e=>[e])){const e=pc(t);for(const t of r)Jo(t.name,fa.All_declarations_of_0_must_have_identical_constraints,e)}}}RR(e)}(n);case 204:return function(e){for(const t of e.templateSpans)az(t.type),VS($k(t.type),vn,t.type);$k(e)}(n);case 206:return function(e){az(e.argument),e.attributes&&wV(e.attributes,Wq),lR(e)}(n);case 203:return function(e){e.dotDotDotToken&&e.questionToken&&Wq(e,fa.A_tuple_member_cannot_be_both_optional_and_rest),191===e.type.kind&&Wq(e.type,fa.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type),192===e.type.kind&&Wq(e.type,fa.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type),az(e.type),$k(e)}(n);case 329:return function(e){const t=Hg(e);if(!t||!hE(t)&&!MF(t))return void Jo(t,fa.JSDoc_0_is_not_attached_to_a_class,bc(e.tagName));const n=ll(t).filter(PP);pn.assert(n.length>0),n.length>1&&Jo(n[1],fa.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);const r=jR(e.class.expression),i=Sh(t);if(i){const t=jR(i.expression);t&&r.escapedText!==t.escapedText&&Jo(r,fa.JSDoc_0_1_does_not_match_the_extends_2_clause,bc(e.tagName),bc(r),bc(t))}}(n);case 330:return function(e){const t=Hg(e);t&&(hE(t)||MF(t))||Jo(t,fa.JSDoc_0_is_not_attached_to_a_class,bc(e.tagName))}(n);case 347:case 339:case 341:return function(e){e.typeExpression||Jo(e.name,fa.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags),e.name&&wJ(e.name,fa.Type_alias_name_cannot_be_0),az(e.typeExpression),NJ(fl(e))}(n);case 346:return function(e){az(e.constraint);for(const t of e.typeParameters)az(t)}(n);case 345:return function(e){az(e.typeExpression)}(n);case 325:case 326:case 327:return function(e){e.name&&wz(e.name,!0)}(n);case 342:case 349:return function(e){az(e.typeExpression)}(n);case 318:!function(e){a(function(){e.type||Pg(e)||Qw(e,wt)}),GM(e)}(n);case 316:case 315:case 313:case 314:case 323:return cz(n),void iO(n,az);case 319:return void function(e){cz(e),az(e.type);const{parent:t}=e;if(FD(t)&&CP(t.parent))return void(xe(t.parent.parameters)!==t&&Jo(e,fa.A_rest_parameter_must_be_last_in_a_parameter_list));fP(t)||Jo(e,fa.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);const n=e.parent.parent;if(!VP(n))return void Jo(e,fa.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);const r=Ug(n);if(!r)return;const i=$g(n);i&&xe(i.parameters).symbol===r||Jo(e,fa.A_rest_parameter_must_be_last_in_a_parameter_list)}(n);case 310:return az(n.type);case 334:case 336:case 335:return function(e){const t=Kg(e);t&&Yl(t)&&Jo(e,fa.An_accessibility_modifier_cannot_be_used_with_a_private_identifier)}(n);case 351:return function(e){az(e.typeExpression);const t=Hg(e);if(t){const e=ul(t,ZP);if(d(e)>1)for(let t=1;t{var i;298!==e.kind||n||(void 0===t?t=e:(Wq(e,fa.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement),n=!0)),297===e.kind&&a((i=e,()=>{const e=WM(i.expression);gM(r,e)||tT(e,r,i.expression,void 0)})),p(e.statements,az),j.noFallthroughCasesInSwitch&&e.fallthroughFlowNode&&SE(e.fallthroughFlowNode)&&Jo(e,fa.Fallthrough_case_in_switch)}),e.caseBlock.locals&&RR(e.caseBlock)}(n);case 257:return function(e){Kq(e)||mc(e.parent,t=>s_(t)?"quit":257===t.kind&&t.label.escapedText===e.label.escapedText&&(Wq(e.label,fa.Duplicate_label_0,ep(e.label)),!0)),az(e.statement)}(n);case 258:return kJ(n);case 259:return function(e){Kq(e),tB(e.tryBlock);const t=e.catchClause;if(t){if(t.variableDeclaration){const e=t.variableDeclaration;uB(e);const n=yv(e);if(n){const e=$k(n);!e||3&e.flags||Uq(n,fa.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified)}else if(e.initializer)Uq(e.initializer,fa.Catch_clause_variable_cannot_have_an_initializer);else{const e=t.block.locals;e&&cd(t.locals,t=>{const n=e.get(t);(null==n?void 0:n.valueDeclaration)&&2&n.flags&&Wq(n.valueDeclaration,fa.Cannot_redeclare_identifier_0_in_catch_clause,vc(t))})}}tB(t.block)}e.finallyBlock&&tB(e.finallyBlock)}(n);case 261:return mB(n);case 209:return gB(n);case 264:return function(e){const t=x(e.modifiers,ED);B&&t&&H(e.members,e=>Ov(e)&&Yl(e))&&Wq(t,fa.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator),e.name||Av(e,2048)||Uq(e,fa.A_class_declaration_without_the_default_modifier_must_have_a_name),AJ(e),p(e.members,az),RR(e)}(n);case 265:return JJ(n);case 266:return function(e){if(vq(e),wJ(e.name,fa.Type_alias_name_cannot_be_0),zq(e.parent)||Wq(e,fa._0_declarations_can_only_be_declared_inside_a_block,"type"),gR(e),NJ(e.typeParameters),141===e.type.kind){const t=d(e.typeParameters);(0===t?"BuiltinIteratorReturn"===e.name.escapedText:1===t&&sJ.has(e.name.escapedText))||Jo(e.type,fa.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types)}else az(e.type),RR(e)}(n);case 267:return WJ(n);case 307:return function(e){dD(e.name)&&Jo(e,fa.An_enum_member_cannot_be_named_with_a_private_identifier),e.initializer&&WM(e.initializer)}(n);case 268:return $J(n);case 273:return ez(n);case 272:return function(e){if(!nz(e,Om(e)?fa.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:fa.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)&&(vq(e),!j.erasableSyntaxOnly||33554432&e.flags||Jo(e,fa.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled),Pm(e)||KJ(e)))if(YJ(e),xP(e,6),284!==e.moduleReference.kind){const t=Ha(Ss(e));if(t!==bt){const n=Ga(t);if(111551&n){const t=db(e.moduleReference);1920&ns(t,112575).flags||Jo(t,fa.Module_0_is_hidden_by_a_local_declaration_with_the_same_name,jp(t))}788968&n&&wJ(e.name,fa.Import_name_cannot_be_0)}e.isTypeOnly&&Wq(e,fa.An_import_alias_cannot_use_import_type)}else!(5<=R&&R<=99)||e.isTypeOnly||33554432&e.flags||Wq(e,fa.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)}(n);case 279:return tz(n);case 278:return function(t){if(nz(t,t.isExportEquals?fa.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:fa.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration))return;!j.erasableSyntaxOnly||!t.isExportEquals||33554432&t.flags||Jo(t,fa.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);const n=308===t.parent.kind?t.parent:t.parent.parent;if(268===n.kind&&!dp(n))return void(t.isExportEquals?Jo(t,fa.An_export_assignment_cannot_be_used_in_a_namespace):Jo(t,fa.A_default_export_can_only_be_used_in_an_ECMAScript_style_module));!vq(t)&&Fv(t)&&Uq(t,fa.An_export_assignment_cannot_have_modifiers);const r=yv(t);r&&VS(SM(t.expression),$k(r),t.expression);const i=!t.isExportEquals&&!(33554432&t.flags)&&j.verbatimModuleSyntax&&1===e.getEmitModuleFormatOfFile(Sd(t));if(80===t.expression.kind){const e=t.expression,n=As(ns(e,-1,!0,!0,t));if(n){xP(t,3);const r=Ya(n,111551);if(111551&Ga(n)?(SM(e),i||33554432&t.flags||!j.verbatimModuleSyntax||!r||Jo(e,t.isExportEquals?fa.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:fa.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,bc(e))):i||33554432&t.flags||!j.verbatimModuleSyntax||Jo(e,t.isExportEquals?fa.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:fa.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type,bc(e)),!i&&!(33554432&t.flags)&&Nk(j)&&!(111551&n.flags)){const i=Ga(n,!1,!0);!(2097152&n.flags&&788968&i)||111551&i||r&&Sd(r)===Sd(t)?r&&Sd(r)!==Sd(t)&&ha(Jo(e,t.isExportEquals?fa._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:fa._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,bc(e),Me),r,bc(e)):Jo(e,t.isExportEquals?fa._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:fa._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,bc(e),Me)}}else SM(e);Ik(j)&&$c(e,!0)}else SM(t.expression);i&&Jo(t,zo(t)),iz(n),33554432&t.flags&&!ub(t.expression)&&Wq(t.expression,fa.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context),t.isExportEquals&&(R>=5&&200!==R&&(33554432&t.flags&&99===e.getImpliedNodeFormatForEmit(Sd(t))||!(33554432&t.flags)&&1!==e.getImpliedNodeFormatForEmit(Sd(t)))?Wq(t,fa.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead):4!==R||33554432&t.flags||Wq(t,fa.Export_assignment_is_not_supported_when_module_flag_is_system))}(n);case 243:case 260:return void Kq(n);case 283:(function(e){LR(e)})(n)}}(n),r=i}}function sz(e){Ze(e)&&p(e,e=>{zu(e)&&az(e)})}function cz(e){if(!Om(e))if(SP(e)||kP(e)){const t=Ia(SP(e)?54:58),n=e.postfix?fa._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:fa._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1,r=$k(e.type);Wq(e,n,t,Sc(kP(e)&&r!==_n&&r!==ln?zb(ae([r,Lt],e.postfix?void 0:zt)):r))}else Wq(e,fa.JSDoc_types_can_only_be_used_inside_documentation_comments)}function lz(e){const t=ua(Sd(e));1&t.flags?pn.assert(!t.deferredNodes,"A type-checked file should have no deferred nodes."):(t.deferredNodes||(t.deferredNodes=new Set),t.deferredNodes.add(e))}function _z(e){const t=ua(e);t.deferredNodes&&t.deferredNodes.forEach(uz),t.deferredNodes=void 0}function uz(e){var t,n;null==(t=Gn)||t.push(Gn.Phase.Check,"checkDeferredNode",{kind:e.kind,pos:e.pos,end:e.end,path:e.tracingPath});const o=r;switch(r=e,h=0,e.kind){case 214:case 215:case 216:case 171:case 287:WO(e);break;case 219:case 220:case 175:case 174:!function(e){pn.assert(175!==e.kind||Vf(e));const t=Rh(e),n=Ch(e);if(Kj(e,n),e.body)if(bv(e)||gh(zg(e)),242===e.body.kind)az(e.body);else{const r=WM(e.body),i=n&&iJ(n,t);i&&pJ(e,i,e.body,e.body,r)}}(e);break;case 178:case 179:rR(e);break;case 232:!function(e){p(e.members,az),RR(e)}(e);break;case 169:!function(e){var t,n;if(yE(e.parent)||m_(e.parent)||vE(e.parent)){const r=ju(Ss(e)),o=24576&wC(r);if(o){const a=Ss(e.parent);if(!vE(e.parent)||48&xx(Ru(a))){if(8192===o||16384===o){null==(t=Gn)||t.push(Gn.Phase.CheckTypes,"checkTypeParameterDeferred",{parent:Ab(Ru(a)),id:Ab(r)});const s=vC(a,r,16384===o?Un:qn),c=vC(a,r,16384===o?qn:Un),l=r;i=r,VS(s,c,e,fa.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation),i=l,null==(n=Gn)||n.pop()}}else Jo(e,fa.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types)}}}(e);break;case 286:!function(e){VI(e)}(e);break;case 285:!function(e){VI(e.openingElement),xI(e.closingElement.tagName)?NI(e.closingElement):WM(e.closingElement.tagName),TI(e)}(e);break;case 217:case 235:case 218:!function(e){const{type:t}=QL(e),n=SF(e)?t:e,r=ua(e);pn.assertIsDefined(r.assertionExpressionType);const i=zw(cw(r.assertionExpressionType)),o=$k(t);il(o)||a(()=>{const e=Kw(i);qS(o,e)||tT(i,o,n,fa.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)})}(e);break;case 223:WM(e.expression);break;case 227:bb(e)&&WO(e)}r=o,null==(n=Gn)||n.pop()}function dz(t,n){var r,i;null==(r=Gn)||r.push(Gn.Phase.Check,n?"checkSourceFileNodes":"checkSourceFile",{path:t.path},!0);const o=n?"beforeCheckNodes":"beforeCheck",s=n?"afterCheckNodes":"afterCheck";rr(o),n?function(t,n){const r=ua(t);if(!(1&r.flags)){if(mT(t,j,e))return;Hq(t),E(so),E(co),E(lo),E(_o),E(uo),p(n,az),_z(t),(r.potentialThisCollisions||(r.potentialThisCollisions=[])).push(...so),(r.potentialNewTargetCollisions||(r.potentialNewTargetCollisions=[])).push(...co),(r.potentialWeakMapSetCollisions||(r.potentialWeakMapSetCollisions=[])).push(...lo),(r.potentialReflectCollisions||(r.potentialReflectCollisions=[])).push(..._o),(r.potentialUnusedRenamedBindingElementsInTypes||(r.potentialUnusedRenamedBindingElementsInTypes=[])).push(...uo),r.flags|=8388608;for(const e of n){ua(e).flags|=8388608}}}(t,n):function(t){const n=ua(t);if(!(1&n.flags)){if(mT(t,j,e))return;Hq(t),E(so),E(co),E(lo),E(_o),E(uo),8388608&n.flags&&(so=n.potentialThisCollisions,co=n.potentialNewTargetCollisions,lo=n.potentialWeakMapSetCollisions,_o=n.potentialReflectCollisions,uo=n.potentialUnusedRenamedBindingElementsInTypes),p(t.statements,az),az(t.endOfFileToken),_z(t),rf(t)&&RR(t),a(()=>{t.isDeclarationFile||!j.noUnusedLocals&&!j.noUnusedParameters||BR(mz(t),(e,t,n)=>{!kd(e)&&pz(t,!!(33554432&e.flags))&&ho.add(n)}),t.isDeclarationFile||function(){var e;for(const t of uo)if(!(null==(e=Ss(t))?void 0:e.isReferenced)){const e=ac(t);pn.assert(ty(e),"Only parameter declaration should be checked here");const n=qp(t.name,fa._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation,jp(t.name),jp(t.propertyName));e.type||uT(n,ek(Sd(e),e.end,0,fa.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here,jp(t.propertyName))),ho.add(n)}}()}),rf(t)&&iz(t),so.length&&(p(so,rB),E(so)),co.length&&(p(co,oB),E(co)),lo.length&&(p(lo,sB),E(lo)),_o.length&&(p(_o,cB),E(_o)),n.flags|=1}}(t),rr(s),ir("Check",o,s),null==(i=Gn)||i.pop()}function pz(e,t){if(t)return!1;switch(e){case 0:return!!j.noUnusedLocals;case 1:return!!j.noUnusedParameters;default:return pn.assertNever(e)}}function mz(e){return ki.get(e.path)||_}function gz(n,r,i){try{return t=r,function(t,n){if(t){hz();const e=ho.getGlobalDiagnostics(),r=e.length;yz(t,n);const i=ho.getDiagnostics(t.fileName);if(n)return i;const o=ho.getGlobalDiagnostics();if(o!==e){return G(oe(e,o,sk),i)}return 0===r&&o.length>0?G(o,i):i}return p(e.getSourceFiles(),e=>yz(e)),ho.getDiagnostics()}(n,i)}finally{t=void 0}}function hz(){for(const e of o)e();o=[]}function yz(e,t){hz();const n=a;a=e=>e(),dz(e,t),a=n}function vz(e){for(;167===e.parent.kind;)e=e.parent;return 184===e.parent.kind}function bz(e,t){let n,r=em(e);for(;r&&!(n=t(r));)r=em(r);return n}function xz(e,t){return!!bz(e,e=>e===t)}function Sz(e){return void 0!==function(e){for(;167===e.parent.kind;)e=e.parent;return 272===e.parent.kind?e.parent.moduleReference===e?e.parent:void 0:278===e.parent.kind&&e.parent.expression===e?e.parent:void 0}(e)}function Tz(e){if(ph(e))return Ts(e.parent);if(Om(e)&&212===e.parent.kind&&e.parent===e.parent.parent.left&&!dD(e)&&!gP(e)&&!function(e){if(110===e.expression.kind){const t=im(e,!1,!1);if(s_(t)){const e=cA(t);if(e){const t=dA(e,UA(e,void 0));return t&&!rl(t)}}}}(e.parent)){const t=function(e){switch(og(e.parent.parent)){case 1:case 3:return Ts(e.parent);case 5:if(hF(e.parent)&&Px(e.parent)===e)return;case 4:case 2:return Ss(e.parent.parent)}}(e);if(t)return t}if(278===e.parent.kind&&ub(e)){const t=ns(e,2998271,!0);if(t&&t!==bt)return t}else if(i_(e)&&Sz(e)){const t=Dh(e,272);return pn.assert(void 0!==t),Za(e,!0)}if(i_(e)){const t=function(e){let t=e.parent;for(;wD(t);)e=t,t=t.parent;if(t&&206===t.kind&&t.qualifier===e)return t}(e);if(t){$k(t);const n=ua(e).resolvedSymbol;return n===bt?void 0:n}}for(;vb(e);)e=e.parent;if(function(e){for(;212===e.parent.kind;)e=e.parent;return 234===e.parent.kind}(e)){let t=0;234===e.parent.kind?(t=Ef(e)?788968:111551,_b(e.parent)&&(t|=111551)):t=1920,t|=2097152;const n=ub(e)?ns(e,t,!0):void 0;if(n)return n}if(342===e.parent.kind)return Ug(e.parent);if(169===e.parent.kind&&346===e.parent.parent.kind){pn.assert(!Om(e));const t=Xg(e.parent);return t&&t.symbol}if(Tm(e)){if(Pd(e))return;const t=mc(e,nn(zu,mP,gP)),n=t?901119:111551;if(80===e.kind){if(Sm(e)&&xI(e)){const t=NI(e.parent);return t===bt?void 0:t}const r=ns(e,n,!0,!0,$g(e));if(!r&&t){const t=mc(e,nn(m_,yE));if(t)return wz(e,!0,Ss(t))}if(r&&t){const t=Kg(e);if(t&&uP(t)&&t===r.valueDeclaration)return ns(e,n,!0,!0,Sd(t))||r}return r}if(dD(e))return gO(e);if(212===e.kind||167===e.kind){const n=ua(e);return n.resolvedSymbol?n.resolvedSymbol:(212===e.kind?(_O(e,0),n.resolvedSymbol||(n.resolvedSymbol=Cz(SM(e.expression),rx(e.name)))):dO(e,0),!n.resolvedSymbol&&t&&wD(e)?wz(e):n.resolvedSymbol)}if(gP(e))return wz(e)}else if(i_(e)&&vz(e)){const t=ns(e,184===e.parent.kind?788968:1920,!0,!0);return t&&t!==bt?t:Ny(e)}return 183===e.parent.kind?ns(e,1,!0):void 0}function Cz(e,t){const n=pg(e,t);if(n.length&&e.members){const t=Xh(Hp(e).members);if(n===cg(e))return t;if(t){const r=_a(t),i=P(J(n,e=>e.declaration),_J).join(",");if(r.filteredIndexSymbolCache||(r.filteredIndexSymbolCache=new Map),r.filteredIndexSymbolCache.has(i))return r.filteredIndexSymbolCache.get(i);{const t=Xo(131072,"__index");return t.declarations=J(n,e=>e.declaration),t.parent=e.aliasSymbol?e.aliasSymbol:e.symbol?e.symbol:Nz(t.declarations[0].parent),r.filteredIndexSymbolCache.set(i,t),t}}}}function wz(e,t,n){if(i_(e)){const r=901119;let i=ns(e,r,t,!0,$g(e));if(!i&&uD(e)&&n&&(i=ks(da(gs(n),e.escapedText,r))),i)return i}const r=uD(e)?n:wz(e.left,t,n),i=uD(e)?e.escapedText:e.right.escapedText;if(r){const e=111551&r.flags&&Am(z_(r),"prototype");return Am(e?z_(e):Ru(r),i)}}function Nz(e,t){if(dP(e))return uO(e)?ks(e.symbol):void 0;const{parent:n}=e,r=n.parent;if(!(67108864&e.flags)){if(mJ(e)){const t=Ss(n);return ql(e.parent)&&e.parent.propertyName===e?hI(t):t}if(mh(e))return Ss(n.parent);if(80===e.kind){if(Sz(e))return Tz(e);if(209===n.kind&&207===r.kind&&e===n.propertyName){const t=Am(Dz(r),e.escapedText);if(t)return t}else if(UF(n)&&n.name===e)return 105===n.keywordToken&&"target"===bc(e)?ij(n).symbol:102===n.keywordToken&&"meta"===bc(e)?iv().members.get("meta"):void 0}switch(e.kind){case 80:case 81:case 212:case 167:if(!mv(e))return Tz(e);case 110:const i=im(e,!1,!1);if(s_(i)){const e=zg(i);if(e.thisParameter)return e.thisParameter}if(Cm(e))return WM(e).symbol;case 198:return zk(e).symbol;case 108:return WM(e).symbol;case 137:const o=e.parent;return o&&177===o.kind?o.parent.symbol:void 0;case 11:case 15:if(Dm(e.parent.parent)&&Fm(e.parent.parent)===e||(273===e.parent.kind||279===e.parent.kind)&&e.parent.moduleSpecifier===e||Om(e)&&tA(e.parent)&&e.parent.moduleSpecifier===e||Om(e)&&Bm(e.parent,!1)||ff(e.parent)||cF(e.parent)&&gf(e.parent.parent)&&e.parent.parent.argument===e.parent)return is(e,e,t);if(vF(n)&&ag(n)&&n.arguments[1]===e)return Ss(n);case 9:const a=yF(n)?n.argumentExpression===e?qM(n.expression):void 0:cF(n)&&aF(r)?$k(r.objectType):void 0;return a&&Am(a,yc(e.text));case 90:case 100:case 39:case 86:return Ts(e.parent);case 206:return gf(e)?Nz(e.argument.literal,t):void 0;case 95:return ME(e.parent)?pn.checkDefined(e.parent.symbol):void 0;case 102:if(UF(e.parent)&&"defer"===e.parent.name.escapedText)return;case 105:return UF(e.parent)?rj(e.parent).symbol:void 0;case 104:if(AF(e.parent)){const t=qM(e.parent.right),n=_M(t);return(null==n?void 0:n.symbol)??t.symbol}return;case 237:return WM(e).symbol;case 296:if(Sm(e)&&xI(e)){const t=NI(e.parent);return t===bt?void 0:t}default:return}}}function Dz(e){if(dP(e)&&!uO(e))return Et;if(67108864&e.flags)return Et;const t=sb(e),n=t&&bu(Ss(t.class));if(Ef(e)){const t=$k(e);return n?Id(t,n.thisType):t}if(Tm(e))return Ez(e);if(n&&!t.isImplements){const e=ge(gu(n));return e?Id(e,n.thisType):Et}if(GT(e)){return Ru(Ss(e))}if(80===(r=e).kind&>(r.parent)&&Fc(r.parent)===r){const t=Nz(e);return t?Ru(t):Et}var r;if(fF(e))return Il(e,!0,0)||Et;if(fu(e)){const t=Ss(e);return t?z_(t):Et}if(mJ(e)){const t=Nz(e);return t?z_(t):Et}if(w_(e))return Il(e.parent,!0,0)||Et;if(Sz(e)){const t=Nz(e);if(t){const e=Ru(t);return il(e)?z_(t):e}}return UF(e.parent)&&e.parent.keywordToken===e.kind?rj(e.parent):PE(e)?av(!1):Et}function Fz(e){if(pn.assert(211===e.kind||210===e.kind),251===e.parent.kind){return fM(e,CB(e.parent)||Et)}if(227===e.parent.kind){return fM(e,qM(e.parent.right)||Et)}if(304===e.parent.kind){const t=it(e.parent.parent,gF);return dM(t,Fz(t)||Et,np(t.properties,e.parent))}const t=it(e.parent,mF),n=Fz(t)||Et,r=wB(65,n,Lt,e.parent)||Et;return pM(t,n,t.elements.indexOf(e),r)}function Ez(e){return hb(e)&&(e=e.parent),kk(qM(e))}function Pz(e){const t=Ts(e.parent);return Iv(e)?z_(t):Ru(t)}function Az(e){const t=e.name;switch(t.kind){case 80:return Ek(bc(t));case 9:case 11:return Ek(t.text);case 168:const e=uI(t);return aM(e,12288)?e:Ut;default:return pn.fail("Unsupported property name.")}}function Iz(e){const t=Zu(lf(e=qf(e))),n=Jm(e,0).length?Qn:Jm(e,1).length?Yn:void 0;return n&&p(lf(n),e=>{t.has(e.escapedName)||t.set(e.escapedName,e)}),Vs(t)}function Oz(e){return 0!==Jm(e,0).length||0!==Jm(e,1).length}function Lz(e){if(Gl(e))return!1;const t=hc(e,uD);if(!t)return!1;const n=t.parent;if(!n)return!1;return!((hF(n)||cP(n))&&n.name===t)&&cq(t)===Ie}function jz(e,t){var n;const r=hc(e,uD);if(r){let e=cq(r,function(e){return lu(e.parent)&&e===e.parent.name}(r));if(e){if(1048576&e.flags){const n=ks(e.exportSymbol);if(!t&&944&n.flags&&!(3&n.flags))return;e=n}const i=Cs(e);if(i){if(512&i.flags&&308===(null==(n=i.valueDeclaration)?void 0:n.kind)){const e=i.valueDeclaration;return e!==Sd(r)?void 0:e}return mc(r.parent,e=>lu(e)&&Ss(e)===i)}}}}function Mz(e){const t=cN(e);if(t)return t;const n=hc(e,uD);if(n){const e=function(e){const t=ua(e).resolvedSymbol;if(t&&t!==bt)return t;return Ue(e,e.escapedText,3257279,void 0,!0,void 0)}(n);if(Va(e,111551)&&!Ya(e,111551))return Ca(e)}}function Rz(e){if(418&e.flags&&e.valueDeclaration&&!dP(e.valueDeclaration)){const t=_a(e);if(void 0===t.isDeclarationWithCollidingName){const n=Op(e.valueDeclaration);if(wd(n)||function(e){return e.valueDeclaration&&fF(e.valueDeclaration)&&300===ac(e.valueDeclaration).parent.kind}(e))if(Ue(n.parent,e.escapedName,111551,void 0,!1))t.isDeclarationWithCollidingName=!0;else if(Qz(e.valueDeclaration,16384)){const r=Qz(e.valueDeclaration,32768),i=X_(n,!1),o=242===n.kind&&X_(n.parent,!1);t.isDeclarationWithCollidingName=!(gp(n)||r&&(i||o))}else t.isDeclarationWithCollidingName=!1}return t.isDeclarationWithCollidingName}return!1}function Bz(e){if(!Gl(e)){const t=hc(e,uD);if(t){const e=cq(t);if(e&&Rz(e))return e.valueDeclaration}}}function Jz(e){const t=hc(e,fu);if(t){const e=Ss(t);if(e)return Rz(e)}return!1}function zz(e){switch(pn.assert(Re),e.kind){case 272:return Uz(Ss(e));case 274:case 275:case 277:case 282:const t=Ss(e);return!!t&&Uz(t,!0);case 279:const n=e.exportClause;return!!n&&(OE(n)||H(n.elements,zz));case 278:return!e.expression||80!==e.expression.kind||Uz(Ss(e),!0)}return!1}function qz(e){const t=hc(e,CE);if(void 0===t||308!==t.parent.kind||!Pm(t))return!1;return Uz(Ss(t))&&t.moduleReference&&!Pd(t.moduleReference)}function Uz(e,t){if(!e)return!1;const n=Sd(e.valueDeclaration);cs(n&&Ss(n));const r=As(Ha(e));return r===bt?!t||!Ya(e):!!(111551&Ga(e,t,!0))&&(Ok(j)||!Vz(r))}function Vz(e){return lM(e)||!!e.constEnumOnlyModule}function Wz(e,t){if(pn.assert(Re),wa(e)){const t=Ss(e),n=t&&_a(t);if(null==n?void 0:n.referenced)return!0;const r=_a(t).aliasTarget;if(r&&32&Vv(e)&&111551&Ga(r)&&(Ok(j)||!Vz(r)))return!0}return!!t&&!!iO(e,e=>Wz(e,t))}function $z(e){if(Ad(e.body)){if(Pu(e)||Eu(e))return!1;const t=Yg(Ss(e));return t.length>1||1===t.length&&t[0].declaration!==e}return!1}function Hz(e,t){return(function(e,t){if(!$||Og(e)||VP(e)||!e.initializer)return!1;if(Av(e,31))return!!t&&l_(t);return!0}(e,t)||function(e){return $&&Og(e)&&(VP(e)||!e.initializer)&&Av(e,31)}(e))&&!function(e){const t=mq(e);if(!t)return!1;const n=$k(t);return il(n)||gT(n)}(e)}function Kz(e){const t=hc(e,e=>gE(e)||fE(e));if(!t)return!1;let n;if(fE(t)){if(t.type||!Om(t)&&!tU(t))return!1;const e=Gm(t);if(!e||!_u(e))return!1;n=Ss(e)}else n=Ss(t);return!!(n&&16&n.flags|3)&&!!sd(gs(n),e=>111551&e.flags&&fC(e.valueDeclaration))}function Gz(e){const t=hc(e,gE);if(!t)return _;const n=Ss(t);return n&&lf(z_(n))||_}function Xz(e){var t;const n=e.id||0;return n<0||n>=Yi.length?0:(null==(t=Yi[n])?void 0:t.flags)||0}function Qz(e,t){return function(e,t){if(!j.noCheck&&yT(Sd(e),j))return;const n=ua(e);if(n.calculatedFlags&t)return;switch(t){case 16:case 32:return a(e);case 128:case 256:case 2097152:return o(e);case 512:case 8192:case 65536:case 262144:return c(e);case 536870912:return _(e);case 4096:case 32768:case 16384:return d(e);default:return pn.assertNever(t,`Unhandled node check flag calculation: ${pn.formatNodeCheckFlags(t)}`)}function r(e,t){const n=t(e,e.parent);if("skip"!==n)return n||oO(e,t)}function i(e){const n=ua(e);if(n.calculatedFlags&t)return"skip";n.calculatedFlags|=2097536,a(e)}function o(e){r(e,i)}function a(e){ua(e).calculatedFlags|=48,108===e.kind&&sA(e)}function s(e){const n=ua(e);if(n.calculatedFlags&t)return"skip";n.calculatedFlags|=336384,_(e)}function c(e){r(e,s)}function l(e){return Tm(e)||lP(e.parent)&&(e.parent.objectAssignmentInitializer??e.parent.name)===e}function _(e){const t=ua(e);if(t.calculatedFlags|=536870912,uD(e)&&(t.calculatedFlags|=49152,l(e)&&(!hF(e.parent)||e.parent.name!==e))){const t=zN(e);t&&t!==bt&&WP(e,t)}}function u(e){const n=ua(e);if(n.calculatedFlags&t)return"skip";n.calculatedFlags|=53248,p(e)}function d(e){r(Op(ph(e)?e.parent:e),u)}function p(e){_(e),ND(e)&&uI(e),dD(e)&&f_(e.parent)&&eR(e.parent)}}(e,t),!!(Xz(e)&t)}function Yz(e){return zJ(e.parent),ua(e).enumMemberValue??bC(void 0)}function Zz(e){switch(e.kind){case 307:case 212:case 213:return!0}return!1}function eq(e){if(307===e.kind)return Yz(e).value;ua(e).resolvedSymbol||SM(e);const t=ua(e).resolvedSymbol||(ub(e)?ns(e,111551,!0):void 0);if(t&&8&t.flags){const e=t.valueDeclaration;if(af(e.parent))return Yz(e).value}}function tq(e){return!!(524288&e.flags)&&Jm(e,0).length>0}function nq(e,t){var n;const r=hc(e,i_);if(!r)return 0;if(t&&!(t=hc(t)))return 0;let i=!1;if(wD(r)){const e=ns(db(r),111551,!0,!0,t);i=!!(null==(n=null==e?void 0:e.declarations)?void 0:n.every(Wl))}const o=ns(r,111551,!0,!0,t),a=o&&2097152&o.flags?Ha(o):o;i||(i=!(!o||!Ya(o,111551)));const s=ns(r,788968,!0,!0,t),c=s&&2097152&s.flags?Ha(s):s;if(o||i||(i=!(!s||!Ya(s,788968))),a&&a===c){const e=vv(!1);if(e&&a===e)return 9;const t=z_(a);if(t&&au(t))return i?10:1}if(!c)return i?11:0;const l=Ru(c);return il(l)?i?11:0:3&l.flags?11:aM(l,245760)?2:aM(l,528)?6:aM(l,296)?3:aM(l,2112)?4:aM(l,402653316)?5:fw(l)?7:aM(l,12288)?8:tq(l)?10:$C(l)?7:11}function rq(e,t,n,r,i){const o=hc(e,NC);if(!o)return bw.createToken(133);const a=Ss(o);return me.serializeTypeForDeclaration(o,a,t,1024|n,r,i)}function iq(e){const t=179===(e=hc(e,hl)).kind?178:179,n=Qu(Ss(e),t);return{firstAccessor:n&&n.pos{switch(e.kind){case 261:case 170:case 209:case 173:case 304:case 305:case 307:case 211:case 263:case 219:case 220:case 264:case 232:case 267:case 175:case 178:case 179:case 268:return!0}return!1})}}}function uq(e){return!!(sf(e)||fE(e)&&tU(e))&&wk(z_(Ss(e)))}function dq(e,t){return function(e,t,n){const r=1056&e.flags?me.symbolToExpression(e.symbol,111551,t,void 0,void 0,n):e===Gt?bw.createTrue():e===Ht&&bw.createFalse();if(r)return r;const i=e.value;return"object"==typeof i?bw.createBigIntLiteral(i):"string"==typeof i?bw.createStringLiteral(i):i<0?bw.createPrefixUnaryExpression(41,bw.createNumericLiteral(-i)):bw.createNumericLiteral(i)}(z_(Ss(e)),e,t)}function pq(e){return e?(jo(e),Sd(e).localJsxFactory||oi):oi}function fq(e){if(e){const t=Sd(e);if(t){if(t.localJsxFragmentFactory)return t.localJsxFragmentFactory;const e=t.pragmas.get("jsxfrag"),n=Ze(e)?e[0]:e;if(n)return t.localJsxFragmentFactory=lO(n.arguments.factory,M),t.localJsxFragmentFactory}}if(j.jsxFragmentFactory)return lO(j.jsxFragmentFactory,M)}function mq(e){const t=yv(e);if(t)return t;if(170===e.kind&&179===e.parent.kind){const t=iq(e.parent).getAccessor;if(t)return bv(t)}}function gq(e){const t=268===e.kind?rt(e.name,KN):wg(e),n=os(t,t,void 0);if(n)return Qu(n,308)}function hq(e,t){if(j.importHelpers){const n=Sd(e);if(xp(n,j)&&!(33554432&e.flags)){const r=function(e,t){const n=ua(e);n.externalHelpersModule||(n.externalHelpersModule=as(function(e){pn.assert(j.importHelpers,"Expected importHelpers to be enabled");const t=e.imports[0];return pn.assert(t&&iy(t)&&"tslib"===t.text,"Expected sourceFile.imports[0] to be the synthesized tslib import"),t}(e),Hu,fa.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,t)||bt);return n.externalHelpersModule}(n,e);if(r!==bt){const n=_a(r);if(n.requestedExternalEmitHelpers??(n.requestedExternalEmitHelpers=0),(n.requestedExternalEmitHelpers&t)!==t){const i=t&~n.requestedExternalEmitHelpers;for(let t=1;t<=16777216;t<<=1)if(i&t)for(const n of yq(t)){const i=$a(da(hs(r),yc(n),111551));i?524288&t?H(Yg(i),e=>gj(e)>3)||Jo(e,fa.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,Hu,n,4):1048576&t?H(Yg(i),e=>gj(e)>4)||Jo(e,fa.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,Hu,n,5):1024&t&&(H(Yg(i),e=>gj(e)>2)||Jo(e,fa.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,Hu,n,3)):Jo(e,fa.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,Hu,n)}}n.requestedExternalEmitHelpers|=t}}}}function yq(e){switch(e){case 1:return["__extends"];case 2:return["__assign"];case 4:return["__rest"];case 8:return B?["__decorate"]:["__esDecorate","__runInitializers"];case 16:return["__metadata"];case 32:return["__param"];case 64:return["__awaiter"];case 128:return["__generator"];case 256:return["__values"];case 512:return["__read"];case 1024:return["__spreadArray"];case 2048:return["__await"];case 4096:return["__asyncGenerator"];case 8192:return["__asyncDelegator"];case 16384:return["__asyncValues"];case 32768:return["__exportStar"];case 65536:return["__importStar"];case 131072:return["__importDefault"];case 262144:return["__makeTemplateObject"];case 524288:return["__classPrivateFieldGet"];case 1048576:return["__classPrivateFieldSet"];case 2097152:return["__classPrivateFieldIn"];case 4194304:return["__setFunctionName"];case 8388608:return["__propKey"];case 16777216:return["__addDisposableResource","__disposeResources"];case 33554432:return["__rewriteRelativeImportExtension"];default:return pn.fail("Unrecognized helper")}}function vq(t){var n;const r=function(e){const t=function(e){return QA(e)?x(e.modifiers,ED):void 0}(e);return t&&Uq(t,fa.Decorators_are_not_valid_here)}(t)||function(e){if(!e.modifiers)return!1;const t=function(e){switch(e.kind){case 178:case 179:case 177:case 173:case 172:case 175:case 174:case 182:case 268:case 273:case 272:case 279:case 278:case 219:case 220:case 170:case 169:return;case 176:case 304:case 305:case 271:case 283:return x(e.modifiers,r_);default:if(269===e.parent.kind||308===e.parent.kind)return;switch(e.kind){case 263:return bq(e,134);case 264:case 186:return bq(e,128);case 232:case 265:case 266:return x(e.modifiers,r_);case 244:return 4&e.declarationList.flags?bq(e,135):x(e.modifiers,r_);case 267:return bq(e,87);default:pn.assertNever(e)}}}(e);return t&&Uq(t,fa.Modifiers_cannot_appear_here)}(t);if(void 0!==r)return r;if(FD(t)&&dv(t))return Uq(t,fa.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters);const i=XF(t)?7&t.declarationList.flags:0;let o,a,s,c,l,_=0,u=!1,d=!1;for(const r of t.modifiers)if(ED(r)){if(!gm(B,t,t.parent,t.parent.parent))return 175!==t.kind||Ad(t.body)?Uq(t,fa.Decorators_are_not_valid_here):Uq(t,fa.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);if(B&&(178===t.kind||179===t.kind)){const e=iq(t);if(Jv(e.firstAccessor)&&t===e.secondAccessor)return Uq(t,fa.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}if(-34849&_)return Wq(r,fa.Decorators_are_not_valid_here);if(d&&98303&_){pn.assertIsDefined(l);return!qq(Sd(r))&&(uT(Jo(r,fa.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),qp(l,fa.Decorator_used_before_export_here)),!0)}_|=32768,98303&_?32&_&&(u=!0):d=!0,l??(l=r)}else{if(148!==r.kind){if(172===t.kind||174===t.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_type_member,Ia(r.kind));if(182===t.kind&&(126!==r.kind||!m_(t.parent)))return Wq(r,fa._0_modifier_cannot_appear_on_an_index_signature,Ia(r.kind))}if(103!==r.kind&&147!==r.kind&&87!==r.kind&&169===t.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_type_parameter,Ia(r.kind));switch(r.kind){case 87:{if(267!==t.kind&&169!==t.kind)return Wq(t,fa.A_class_member_cannot_have_the_0_keyword,Ia(87));const e=KP(t.parent)&&Hg(t.parent)||t.parent;if(169===t.kind&&!(l_(e)||m_(e)||VD(e)||WD(e)||BD(e)||JD(e)||ID(e)))return Wq(r,fa._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class,Ia(r.kind));break}case 164:if(16&_)return Wq(r,fa._0_modifier_already_seen,"override");if(128&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"override","declare");if(8&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"override","readonly");if(512&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"override","accessor");if(1024&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"override","async");_|=16,c=r;break;case 125:case 124:case 123:const d=Rc(Yv(r.kind));if(7&_)return Wq(r,fa.Accessibility_modifier_already_seen);if(16&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,d,"override");if(256&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,d,"static");if(512&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,d,"accessor");if(8&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,d,"readonly");if(1024&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,d,"async");if(269===t.parent.kind||308===t.parent.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_module_or_namespace_element,d);if(64&_)return 123===r.kind?Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,d,"abstract"):Wq(r,fa._0_modifier_must_precede_1_modifier,d,"abstract");if(Yl(t))return Wq(r,fa.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);_|=Yv(r.kind);break;case 126:if(256&_)return Wq(r,fa._0_modifier_already_seen,"static");if(8&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"static","readonly");if(1024&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"static","async");if(512&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"static","accessor");if(269===t.parent.kind||308===t.parent.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_module_or_namespace_element,"static");if(170===t.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_parameter,"static");if(64&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(16&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"static","override");_|=256,o=r;break;case 129:if(512&_)return Wq(r,fa._0_modifier_already_seen,"accessor");if(8&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"accessor","readonly");if(128&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"accessor","declare");if(173!==t.kind)return Wq(r,fa.accessor_modifier_can_only_appear_on_a_property_declaration);_|=512;break;case 148:if(8&_)return Wq(r,fa._0_modifier_already_seen,"readonly");if(173!==t.kind&&172!==t.kind&&182!==t.kind&&170!==t.kind)return Wq(r,fa.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);if(512&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"readonly","accessor");_|=8;break;case 95:if(j.verbatimModuleSyntax&&!(33554432&t.flags)&&266!==t.kind&&265!==t.kind&&268!==t.kind&&308===t.parent.kind&&1===e.getEmitModuleFormatOfFile(Sd(t)))return Wq(r,fa.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);if(32&_)return Wq(r,fa._0_modifier_already_seen,"export");if(128&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"export","declare");if(64&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"export","abstract");if(1024&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"export","async");if(m_(t.parent))return Wq(r,fa._0_modifier_cannot_appear_on_class_elements_of_this_kind,"export");if(170===t.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_parameter,"export");if(4===i)return Wq(r,fa._0_modifier_cannot_appear_on_a_using_declaration,"export");if(6===i)return Wq(r,fa._0_modifier_cannot_appear_on_an_await_using_declaration,"export");_|=32;break;case 90:const p=308===t.parent.kind?t.parent:t.parent.parent;if(268===p.kind&&!dp(p))return Wq(r,fa.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);if(4===i)return Wq(r,fa._0_modifier_cannot_appear_on_a_using_declaration,"default");if(6===i)return Wq(r,fa._0_modifier_cannot_appear_on_an_await_using_declaration,"default");if(!(32&_))return Wq(r,fa._0_modifier_must_precede_1_modifier,"export","default");if(u)return Wq(l,fa.Decorators_are_not_valid_here);_|=2048;break;case 138:if(128&_)return Wq(r,fa._0_modifier_already_seen,"declare");if(1024&_)return Wq(r,fa._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(16&_)return Wq(r,fa._0_modifier_cannot_be_used_in_an_ambient_context,"override");if(m_(t.parent)&&!AD(t))return Wq(r,fa._0_modifier_cannot_appear_on_class_elements_of_this_kind,"declare");if(170===t.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_parameter,"declare");if(4===i)return Wq(r,fa._0_modifier_cannot_appear_on_a_using_declaration,"declare");if(6===i)return Wq(r,fa._0_modifier_cannot_appear_on_an_await_using_declaration,"declare");if(33554432&t.parent.flags&&269===t.parent.kind)return Wq(r,fa.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);if(Yl(t))return Wq(r,fa._0_modifier_cannot_be_used_with_a_private_identifier,"declare");if(512&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"declare","accessor");_|=128,a=r;break;case 128:if(64&_)return Wq(r,fa._0_modifier_already_seen,"abstract");if(264!==t.kind&&186!==t.kind){if(175!==t.kind&&173!==t.kind&&178!==t.kind&&179!==t.kind)return Wq(r,fa.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);if(264!==t.parent.kind||!Av(t.parent,64)){return Wq(r,173===t.kind?fa.Abstract_properties_can_only_appear_within_an_abstract_class:fa.Abstract_methods_can_only_appear_within_an_abstract_class)}if(256&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(2&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"private","abstract");if(1024&_&&s)return Wq(s,fa._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");if(16&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"abstract","override");if(512&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"abstract","accessor")}if(Nc(t)&&81===t.name.kind)return Wq(r,fa._0_modifier_cannot_be_used_with_a_private_identifier,"abstract");_|=64;break;case 134:if(1024&_)return Wq(r,fa._0_modifier_already_seen,"async");if(128&_||33554432&t.parent.flags)return Wq(r,fa._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(170===t.kind)return Wq(r,fa._0_modifier_cannot_appear_on_a_parameter,"async");if(64&_)return Wq(r,fa._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");_|=1024,s=r;break;case 103:case 147:{const e=103===r.kind?8192:16384,i=103===r.kind?"in":"out",o=KP(t.parent)&&(Hg(t.parent)||x(null==(n=Gg(t.parent))?void 0:n.tags,GP))||t.parent;if(169!==t.kind||o&&!(yE(o)||m_(o)||vE(o)||GP(o)))return Wq(r,fa._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias,i);if(_&e)return Wq(r,fa._0_modifier_already_seen,i);if(8192&e&&16384&_)return Wq(r,fa._0_modifier_must_precede_1_modifier,"in","out");_|=e;break}}}return 177===t.kind?256&_?Wq(o,fa._0_modifier_cannot_appear_on_a_constructor_declaration,"static"):16&_?Wq(c,fa._0_modifier_cannot_appear_on_a_constructor_declaration,"override"):!!(1024&_)&&Wq(s,fa._0_modifier_cannot_appear_on_a_constructor_declaration,"async"):(273===t.kind||272===t.kind)&&128&_?Wq(a,fa.A_0_modifier_cannot_be_used_with_an_import_declaration,"declare"):170===t.kind&&31&_&&w_(t.name)?Wq(t,fa.A_parameter_property_may_not_be_declared_using_a_binding_pattern):170===t.kind&&31&_&&t.dotDotDotToken?Wq(t,fa.A_parameter_property_cannot_be_declared_using_a_rest_parameter):!!(1024&_)&&function(e,t){switch(e.kind){case 175:case 263:case 219:case 220:return!1}return Wq(t,fa._0_modifier_cannot_be_used_here,"async")}(t,s)}function bq(e,t){const n=x(e.modifiers,r_);return n&&n.kind!==t?n:void 0}function xq(e,t=fa.Trailing_comma_not_allowed){return!(!e||!e.hasTrailingComma)&&Vq(e[0],e.end-1,1,t)}function kq(e,t){if(e&&0===e.length){const n=e.pos-1;return Vq(t,n,ts(t.text,e.end)+1-n,fa.Type_parameter_list_cannot_be_empty)}return!1}function Sq(e){if(M>=3){const t=e.body&&GF(e.body)&&CA(e.body.statements);if(t){const n=D(e.parameters,e=>!!e.initializer||w_(e.name)||Uu(e));if(d(n)){p(n,e=>{uT(Jo(e,fa.This_parameter_is_not_allowed_with_use_strict_directive),qp(t,fa.use_strict_directive_used_here))});const e=n.map((e,t)=>qp(e,0===t?fa.Non_simple_parameter_declared_here:fa.and_here));return uT(Jo(t,fa.use_strict_directive_cannot_be_used_with_non_simple_parameter_list),...e),!0}}}return!1}function Tq(e){const t=Sd(e);return vq(e)||kq(e.typeParameters,t)||function(e){let t=!1;const n=e.length;for(let r=0;r1||e.typeParameters.hasTrailingComma||e.typeParameters[0].constraint)&&t&&No(t.fileName,[".mts",".cts"])&&Wq(e.typeParameters[0],fa.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);const{equalsGreaterThanToken:n}=e,r=Wa(t,n.pos).line,i=Wa(t,n.end).line;return r!==i&&Wq(n,fa.Line_terminator_not_permitted_before_arrow)}(e,t)||l_(e)&&Sq(e)}function Cq(e,t){return xq(t)||function(e,t){if(t&&0===t.length){const n=Sd(e),r=t.pos-1;return Vq(n,r,ts(n.text,t.end)+1-r,fa.Type_argument_list_cannot_be_empty)}return!1}(e,t)}function wq(e){const t=e.types;if(xq(t))return!0;if(t&&0===t.length){const n=Ia(e.token);return Vq(e,t.pos,0,fa._0_list_cannot_be_empty,n)}return H(t,Nq)}function Nq(e){return BF(e)&&TD(e.expression)&&e.typeArguments?Wq(e,fa.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments):Cq(e,e.typeArguments)}function Dq(e){if(168!==e.kind)return!1;const t=e;return 227===t.expression.kind&&28===t.expression.operatorToken.kind&&Wq(t.expression,fa.A_comma_expression_is_not_allowed_in_a_computed_property_name)}function Fq(e){if(e.asteriskToken){if(pn.assert(263===e.kind||219===e.kind||175===e.kind),33554432&e.flags)return Wq(e.asteriskToken,fa.Generators_are_not_allowed_in_an_ambient_context);if(!e.body)return Wq(e.asteriskToken,fa.An_overload_signature_cannot_be_declared_as_a_generator)}}function Eq(e,t){return!!e&&Wq(e,t)}function Pq(e,t){return!!e&&Wq(e,t)}function Aq(e){if(Kq(e))return!0;if(251===e.kind&&e.awaitModifier&&!(65536&e.flags)){const t=Sd(e);if(am(e)){if(!qq(t))switch(xp(t,j)||ho.add(qp(e.awaitModifier,fa.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)),R){case 100:case 101:case 102:case 199:if(1===t.impliedNodeFormat){ho.add(qp(e.awaitModifier,fa.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));break}case 7:case 99:case 200:case 4:if(M>=4)break;default:ho.add(qp(e.awaitModifier,fa.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher))}}else if(!qq(t)){const t=qp(e.awaitModifier,fa.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),n=Yf(e);if(n&&177!==n.kind){pn.assert(!(2&Rh(n)),"Enclosing function should never be an async function.");uT(t,qp(n,fa.Did_you_mean_to_mark_this_function_as_async))}return ho.add(t),!0}}if(iE(e)&&!(65536&e.flags)&&uD(e.initializer)&&"async"===e.initializer.escapedText)return Wq(e.initializer,fa.The_left_hand_side_of_a_for_of_statement_may_not_be_async),!1;if(262===e.initializer.kind){const t=e.initializer;if(!Jq(t)){const n=t.declarations;if(!n.length)return!1;if(n.length>1){const n=250===e.kind?fa.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:fa.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;return Uq(t.declarations[1],n)}const r=n[0];if(r.initializer){const t=250===e.kind?fa.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:fa.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return Wq(r.name,t)}if(r.type){return Wq(r,250===e.kind?fa.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:fa.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation)}}}return!1}function Iq(e){if(e.parameters.length===(178===e.kind?1:2))return uv(e)}function Oq(e,t){if(bd(e)&&!ub(yF(e)?_h(e.argumentExpression):e.expression))return Wq(e,t)}function Lq(e){if(Tq(e))return!0;if(175===e.kind){if(211===e.parent.kind){if(e.modifiers&&(1!==e.modifiers.length||134!==ye(e.modifiers).kind))return Uq(e,fa.Modifiers_cannot_appear_here);if(Eq(e.questionToken,fa.An_object_member_cannot_be_declared_optional))return!0;if(Pq(e.exclamationToken,fa.A_definite_assignment_assertion_is_not_permitted_in_this_context))return!0;if(void 0===e.body)return Vq(e,e.end-1,1,fa._0_expected,"{")}if(Fq(e))return!0}if(m_(e.parent)){if(M<2&&dD(e.name))return Wq(e.name,fa.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(33554432&e.flags)return Oq(e.name,fa.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(175===e.kind&&!e.body)return Oq(e.name,fa.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(265===e.parent.kind)return Oq(e.name,fa.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(188===e.parent.kind)return Oq(e.name,fa.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function jq(e){return Jh(e)||225===e.kind&&41===e.operator&&9===e.operand.kind}function Mq(e){const t=e.initializer;if(t){const r=!(jq(t)||function(e){if((hF(e)||yF(e)&&jq(e.argumentExpression))&&ub(e.expression))return!!(1056&SM(e).flags)}(t)||112===t.kind||97===t.kind||(n=t,10===n.kind||225===n.kind&&41===n.operator&&10===n.operand.kind));if(!(sf(e)||fE(e)&&tU(e))||e.type)return Wq(t,fa.Initializers_are_not_allowed_in_ambient_contexts);if(r)return Wq(t,fa.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference)}var n}function Rq(e){if(80===e.kind){if("__esModule"===bc(e))return function(e,t,n,...r){if(!qq(Sd(t)))return Ro(e,t,n,...r),!0;return!1}("noEmit",e,fa.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules)}else{const t=e.elements;for(const e of t)if(!RF(e))return Rq(e.name)}return!1}function Bq(e){if(80===e.kind){if("let"===e.escapedText)return Wq(e,fa.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations)}else{const t=e.elements;for(const e of t)RF(e)||Bq(e.name)}return!1}function Jq(e){const t=e.declarations;if(xq(e.declarations))return!0;if(!e.declarations.length)return Vq(e,t.pos,t.end-t.pos,fa.Variable_declaration_list_cannot_be_empty);const n=7&e.flags;if(4===n||6===n){if(rE(e.parent))return Wq(e,4===n?fa.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration:fa.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration);if(33554432&e.flags)return Wq(e,4===n?fa.using_declarations_are_not_allowed_in_ambient_contexts:fa.await_using_declarations_are_not_allowed_in_ambient_contexts);if(6===n)return nM(e)}return!1}function zq(e){switch(e.kind){case 246:case 247:case 248:case 255:case 249:case 250:case 251:return!1;case 257:return zq(e.parent)}return!0}function qq(e){return e.parseDiagnostics.length>0}function Uq(e,t,...n){const r=Sd(e);if(!qq(r)){const i=Zp(r,e.pos);return ho.add(ek(r,i.start,i.length,t,...n)),!0}return!1}function Vq(e,t,n,r,...i){const o=Sd(e);return!qq(o)&&(ho.add(ek(o,t,n,r,...i)),!0)}function Wq(e,t,...n){return!qq(Sd(e))&&(Jo(e,t,...n),!0)}function $q(e){return 265!==e.kind&&266!==e.kind&&273!==e.kind&&272!==e.kind&&279!==e.kind&&278!==e.kind&&271!==e.kind&&!Av(e,2208)&&Uq(e,fa.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function Hq(e){return!!(33554432&e.flags)&&function(e){for(const t of e.statements)if((fu(t)||244===t.kind)&&$q(t))return!0;return!1}(e)}function Kq(e){if(33554432&e.flags){if(!ua(e).hasReportedStatementInAmbientContext&&(s_(e.parent)||g_(e.parent)))return ua(e).hasReportedStatementInAmbientContext=Uq(e,fa.An_implementation_cannot_be_declared_in_ambient_contexts);if(242===e.parent.kind||269===e.parent.kind||308===e.parent.kind){const t=ua(e.parent);if(!t.hasReportedStatementInAmbientContext)return t.hasReportedStatementInAmbientContext=Uq(e,fa.Statements_are_not_allowed_in_ambient_contexts)}}return!1}function Gq(e){const t=ep(e).includes("."),n=16&e.numericLiteralFlags;if(t||n)return;+e.text<=2**53-1||qo(!1,qp(e,fa.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers))}function Xq(e){return!!p(e.elements,e=>{if(e.isTypeOnly)return Uq(e,277===e.kind?fa.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:fa.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)})}function Qq(e,t,n){if(1048576&t.flags&&2621440&e.flags){const r=nD(t,e);if(r)return r;const i=lf(e);if(i){const e=ZN(i,t);if(e){const r=ZT(t,P(e,e=>[()=>z_(e),e.escapedName]),n);if(r!==t)return r}}}}function Yq(e){const t=Vh(e);return t||(ND(e)?GN(qM(e.expression)):void 0)}function Zq(e){return Ae===e?Je:(Ae=e,Je=cc(e))}function eU(e){return Pe===e?Be:(Pe=e,Be=_c(e))}function tU(e){const t=7&eU(e);return 2===t||4===t||6===t}}function fJ(e){return 263!==e.kind&&175!==e.kind||!!e.body}function mJ(e){switch(e.parent.kind){case 277:case 282:return uD(e)||11===e.kind;default:return ph(e)}}function gJ(e){switch(e){case 0:return"yieldType";case 1:return"returnType";case 2:return"nextType"}}function hJ(e){return!!(1&e.flags)}function yJ(e){return!!(2&e.flags)}(KB=HB||(HB={})).JSX="JSX",KB.IntrinsicElements="IntrinsicElements",KB.ElementClass="ElementClass",KB.ElementAttributesPropertyNameContainer="ElementAttributesProperty",KB.ElementChildrenAttributeNameContainer="ElementChildrenAttribute",KB.Element="Element",KB.ElementType="ElementType",KB.IntrinsicAttributes="IntrinsicAttributes",KB.IntrinsicClassAttributes="IntrinsicClassAttributes",KB.LibraryManagedAttributes="LibraryManagedAttributes",(GB||(GB={})).Fragment="Fragment";var vJ=class e{constructor(t,n,r){var i;for(this.moduleResolverHost=void 0,this.inner=void 0,this.disableTrackSymbol=!1;n instanceof e;)n=n.inner;this.inner=n,this.moduleResolverHost=r,this.context=t,this.canTrackSymbol=!!(null==(i=this.inner)?void 0:i.trackSymbol)}trackSymbol(e,t,n){var r,i;if((null==(r=this.inner)?void 0:r.trackSymbol)&&!this.disableTrackSymbol){if(this.inner.trackSymbol(e,t,n))return this.onDiagnosticReported(),!0;262144&e.flags||((i=this.context).trackedSymbols??(i.trackedSymbols=[])).push([e,t,n])}return!1}reportInaccessibleThisError(){var e;(null==(e=this.inner)?void 0:e.reportInaccessibleThisError)&&(this.onDiagnosticReported(),this.inner.reportInaccessibleThisError())}reportPrivateInBaseOfClassExpression(e){var t;(null==(t=this.inner)?void 0:t.reportPrivateInBaseOfClassExpression)&&(this.onDiagnosticReported(),this.inner.reportPrivateInBaseOfClassExpression(e))}reportInaccessibleUniqueSymbolError(){var e;(null==(e=this.inner)?void 0:e.reportInaccessibleUniqueSymbolError)&&(this.onDiagnosticReported(),this.inner.reportInaccessibleUniqueSymbolError())}reportCyclicStructureError(){var e;(null==(e=this.inner)?void 0:e.reportCyclicStructureError)&&(this.onDiagnosticReported(),this.inner.reportCyclicStructureError())}reportLikelyUnsafeImportRequiredError(e){var t;(null==(t=this.inner)?void 0:t.reportLikelyUnsafeImportRequiredError)&&(this.onDiagnosticReported(),this.inner.reportLikelyUnsafeImportRequiredError(e))}reportTruncationError(){var e;(null==(e=this.inner)?void 0:e.reportTruncationError)&&(this.onDiagnosticReported(),this.inner.reportTruncationError())}reportNonlocalAugmentation(e,t,n){var r;(null==(r=this.inner)?void 0:r.reportNonlocalAugmentation)&&(this.onDiagnosticReported(),this.inner.reportNonlocalAugmentation(e,t,n))}reportNonSerializableProperty(e){var t;(null==(t=this.inner)?void 0:t.reportNonSerializableProperty)&&(this.onDiagnosticReported(),this.inner.reportNonSerializableProperty(e))}onDiagnosticReported(){this.context.reportedDiagnostic=!0}reportInferenceFallback(e){var t;(null==(t=this.inner)?void 0:t.reportInferenceFallback)&&!this.context.suppressReportInferenceFallback&&(this.onDiagnosticReported(),this.inner.reportInferenceFallback(e))}pushErrorFallbackNode(e){var t,n;return null==(n=null==(t=this.inner)?void 0:t.pushErrorFallbackNode)?void 0:n.call(t,e)}popErrorFallbackNode(){var e,t;return null==(t=null==(e=this.inner)?void 0:e.popErrorFallbackNode)?void 0:t.call(e)}};function bJ(e,t,n,r){if(void 0===e)return e;const i=t(e);let o;return void 0!==i?(o=Ze(i)?(r||AJ)(i):i,pn.assertNode(o,n),o):void 0}function xJ(e,t,n,r,i){if(void 0===e)return e;const o=e.length;let a;(void 0===r||r<0)&&(r=0),(void 0===i||i>o-r)&&(i=o-r);let s=-1,c=-1;r>0||io-r)&&(i=o-r),SJ(e,t,n,r,i)}function SJ(e,t,n,r,i){let o;const a=e.length;(r>0||i=2&&(i=function(e,t){let n;for(let r=0;r{const o=rl,addSource:P,setSourceContent:A,addName:I,addMapping:O,appendSourceMap:function(e,t,n,r,i,o){pn.assert(e>=k,"generatedLine cannot backtrack"),pn.assert(t>=0,"generatedCharacter cannot be negative"),s();const a=[];let l;const _=zJ(n.mappings);for(const s of _){if(o&&(s.generatedLine>o.line||s.generatedLine===o.line&&s.generatedCharacter>o.character))break;if(i&&(s.generatedLineJSON.stringify(R())};function P(t){s();const n=_a(r,t,e.getCurrentDirectory(),e.getCanonicalFileName,!0);let i=u.get(n);return void 0===i&&(i=_.length,_.push(n),l.push(t),u.set(n,i)),c(),i}function A(e,t){if(s(),null!==t){for(o||(o=[]);o.length=k,"generatedLine cannot backtrack"),pn.assert(t>=0,"generatedCharacter cannot be negative"),pn.assert(void 0===n||n>=0,"sourceIndex cannot be negative"),pn.assert(void 0===r||r>=0,"sourceLine cannot be negative"),pn.assert(void 0===i||i>=0,"sourceCharacter cannot be negative"),s(),(function(e,t){return!D||k!==e||S!==t}(e,t)||function(e,t,n){return void 0!==e&&void 0!==t&&void 0!==n&&T===e&&(C>t||C===t&&w>n)}(n,r,i))&&(j(),k=e,S=t,F=!1,E=!1,D=!0),void 0!==n&&void 0!==r&&void 0!==i&&(T=n,C=r,w=i,F=!0,void 0!==o&&(N=o,E=!0)),c()}function L(e){p.push(e),p.length>=1024&&M()}function j(){if(D&&(!x||m!==k||g!==S||h!==T||y!==C||v!==w||b!==N)){if(s(),m0&&(f+=String.fromCharCode.apply(void 0,p),p.length=0)}function R(){return j(),M(),{version:3,file:t,sourceRoot:n,sources:_,names:d,mappings:f,sourcesContent:o}}function B(e){e<0?e=1+(-e<<1):e<<=1;do{let t=31&e;(e>>=5)>0&&(t|=32),L(VJ(t))}while(e>0)}}var OJ=/\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,LJ=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,jJ=/^\s*(\/\/[@#] .*)?$/;function MJ(e,t){return{getLineCount:()=>t.length,getLineText:n=>e.substring(t[n],t[n+1])}}function RJ(e){for(let t=e.getLineCount()-1;t>=0;t--){const n=e.getLineText(t),r=LJ.exec(n);if(r)return r[1].trimEnd();if(!n.match(jJ))break}}function BJ(e){return"string"==typeof e||null===e}function JJ(e){try{const n=JSON.parse(e);if(null!==(t=n)&&"object"==typeof t&&3===t.version&&"string"==typeof t.file&&"string"==typeof t.mappings&&Ze(t.sources)&&b(t.sources,tt)&&(void 0===t.sourceRoot||null===t.sourceRoot||"string"==typeof t.sourceRoot)&&(void 0===t.sourcesContent||null===t.sourcesContent||Ze(t.sourcesContent)&&b(t.sourcesContent,BJ))&&(void 0===t.names||null===t.names||Ze(t.names)&&b(t.names,tt)))return n}catch{}var t}function zJ(e){let t,n=!1,r=0,i=0,o=0,a=0,s=0,c=0,l=0;return{get pos(){return r},get error(){return t},get state(){return _(!0,!0)},next(){for(;!n&&r=e.length)return d("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;const o=WJ(e.charCodeAt(r));if(-1===o)return d("Invalid character in VLQ"),-1;t=!!(32&o),i|=(31&o)<>=1,i=-i):i>>=1,i}}function qJ(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex}function UJ(e){return void 0!==e.sourceIndex&&void 0!==e.sourceLine&&void 0!==e.sourceCharacter}function VJ(e){return e>=0&&e<26?65+e:e>=26&&e<52?97+e-26:e>=52&&e<62?48+e-52:62===e?43:63===e?47:pn.fail(`${e}: not a base64 value`)}function WJ(e){return e>=65&&e<=90?e-65:e>=97&&e<=122?e-97+26:e>=48&&e<=57?e-48+52:43===e?62:47===e?63:-1}function $J(e){return void 0!==e.sourceIndex&&void 0!==e.sourcePosition}function HJ(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function KJ(e,t){return pn.assert(e.sourceIndex===t.sourceIndex),xt(e.sourcePosition,t.sourcePosition)}function GJ(e,t){return xt(e.generatedPosition,t.generatedPosition)}function XJ(e){return e.sourcePosition}function QJ(e){return e.generatedPosition}function YJ(e,t,n){const r=Ao(n),i=t.sourceRoot?Uo(t.sourceRoot,r):r,o=Uo(t.file,r),a=e.getSourceFileLike(o),s=t.sources.map(e=>Uo(e,i)),c=new Map(s.map((t,n)=>[e.getCanonicalFileName(t),n]));let l,u,d;return{getSourcePosition:function(e){const t=function(){if(void 0===u){const e=[];for(const t of f())e.push(t);u=ne(e,GJ,HJ)}return u}();if(!H(t))return e;let n=Ne(t,e.pos,QJ,xt);n<0&&(n=~n);const r=t[n];if(void 0===r||!$J(r))return e;return{fileName:s[r.sourceIndex],pos:r.sourcePosition}},getGeneratedPosition:function(t){const n=c.get(e.getCanonicalFileName(t.fileName));if(void 0===n)return t;const r=function(e){if(void 0===d){const e=[];for(const t of f()){if(!$J(t))continue;let n=e[t.sourceIndex];n||(e[t.sourceIndex]=n=[]),n.push(t)}d=e.map(e=>ne(e,KJ,HJ))}return d[e]}(n);if(!H(r))return t;let i=Ne(r,t.pos,XJ,xt);i<0&&(i=~i);const a=r[i];if(void 0===a||a.sourceIndex!==n)return t;return{fileName:o,pos:a.generatedPosition}}};function p(n){const r=void 0!==a?Ba(a,n.generatedLine,n.generatedCharacter,!0):-1;let i,o;if(UJ(n)){const r=e.getSourceFileLike(s[n.sourceIndex]);i=t.sources[n.sourceIndex],o=void 0!==r?Ba(r,n.sourceLine,n.sourceCharacter,!0):-1}return{generatedPosition:r,source:i,sourceIndex:n.sourceIndex,sourcePosition:o,nameIndex:n.nameIndex}}function f(){if(void 0===l){const n=zJ(t.mappings),r=je(n,p);void 0!==n.error?(e.log&&e.log(`Encountered error while decoding sourcemap: ${n.error}`),l=_):l=r}return l}}var ZJ={getSourcePosition:lt,getGeneratedPosition:lt};function ez(e){return(e=fc(e))?_J(e):0}function tz(e){return!!e&&(!(!LE(e)&&!BE(e))&&H(e.elements,nz))}function nz(e){return Yd(e.propertyName||e.name)}function rz(e,t){return function(n){return 308===n.kind?t(n):function(n){return e.factory.createBundle(P(n.sourceFiles,t))}(n)}}function iz(e){return!!Ng(e)}function oz(e){if(Ng(e))return!0;const t=e.importClause&&e.importClause.namedBindings;if(!t)return!1;if(!LE(t))return!1;let n=0;for(const e of t.elements)nz(e)&&n++;return n>0&&n!==t.elements.length||!!(t.elements.length-n)&&Dg(e)}function az(e){return!oz(e)&&(Dg(e)||!!e.importClause&&LE(e.importClause.namedBindings)&&tz(e.importClause.namedBindings))}function sz(e,t){const n=e.getEmitResolver(),r=e.getCompilerOptions(),i=[],o=new uz,a=[],s=new Map,c=new Set;let l,_,u=!1,d=!1,p=!1,f=!1;for(const n of t.statements)switch(n.kind){case 273:i.push(n),!p&&oz(n)&&(p=!0),!f&&az(n)&&(f=!0);break;case 272:284===n.moduleReference.kind&&i.push(n);break;case 279:if(n.moduleSpecifier)if(n.exportClause)if(i.push(n),BE(n.exportClause))g(n),f||(f=tz(n.exportClause));else{const e=n.exportClause.name,t=Xd(e);s.get(t)||(lz(a,ez(n),e),s.set(t,!0),l=ae(l,e)),p=!0}else i.push(n),d=!0;else g(n);break;case 278:n.isExportEquals&&!_&&(_=n);break;case 244:if(Av(n,32))for(const e of n.declarationList.declarations)l=cz(e,s,l,a);break;case 263:Av(n,32)&&h(n,void 0,Av(n,2048));break;case 264:if(Av(n,32))if(Av(n,2048))u||(lz(a,ez(n),e.factory.getDeclarationName(n)),u=!0);else{const e=n.name;e&&!s.get(bc(e))&&(lz(a,ez(n),e),s.set(bc(e),!0),l=ae(l,e))}}const m=MA(e.factory,e.getEmitHelperFactory(),t,r,d,p,f);return m&&i.unshift(m),{externalImports:i,exportSpecifiers:o,exportEquals:_,hasExportStarsToExportValues:d,exportedBindings:a,exportedNames:l,exportedFunctions:c,externalHelpersImportDeclaration:m};function g(e){for(const t of it(e.exportClause,BE).elements){const r=Xd(t.name);if(!s.get(r)){const i=t.propertyName||t.name;if(11!==i.kind){e.moduleSpecifier||o.add(i,t);const r=n.getReferencedImportDeclaration(i)||n.getReferencedValueDeclaration(i);if(r){if(263===r.kind){h(r,t.name,Yd(t.name));continue}lz(a,ez(r),t.name)}}s.set(r,!0),l=ae(l,t.name)}}}function h(t,n,r){if(c.add(fc(t,gE)),r)u||(lz(a,ez(t),n??e.factory.getDeclarationName(t)),u=!0);else{n??(n=t.name);const e=Xd(n);s.get(e)||(lz(a,ez(t),n),s.set(e,!0))}}}function cz(e,t,n,r){if(w_(e.name))for(const i of e.name.elements)RF(i)||(n=cz(i,t,n,r));else if(!Gl(e.name)){const i=bc(e.name);t.get(i)||(t.set(i,!0),n=ae(n,e.name),kA(e.name)&&lz(r,ez(e),e.name))}return n}function lz(e,t,n){let r=e[t];return r?r.push(n):e[t]=r=[n],r}var _z=class e{constructor(){this._map=new Map}get size(){return this._map.size}has(t){return this._map.has(e.toKey(t))}get(t){return this._map.get(e.toKey(t))}set(t,n){return this._map.set(e.toKey(t),n),this}delete(t){var n;return(null==(n=this._map)?void 0:n.delete(e.toKey(t)))??!1}clear(){this._map.clear()}values(){return this._map.values()}static toKey(t){if(Xl(t)||Gl(t)){const n=t.emitNode.autoGenerate;if(4==(7&n.flags)){const r=yI(t),i=gl(r)&&r!==t?e.toKey(r):`(generated@${_J(r)})`;return xI(!1,n.prefix,i,n.suffix,e.toKey)}{const t=`(auto@${n.id})`;return xI(!1,n.prefix,t,n.suffix,e.toKey)}}return dD(t)?bc(t).slice(1):bc(t)}},uz=class extends _z{add(e,t){let n=this.get(e);return n?n.push(t):this.set(e,n=[t]),n}remove(e,t){const n=this.get(e);n&&($t(n,t),n.length||this.delete(e))}};function dz(e){return Ju(e)||9===e.kind||Fh(e.kind)||uD(e)}function pz(e){return!uD(e)&&dz(e)}function fz(e){return e>=65&&e<=79}function mz(e){switch(e){case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 45;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 75:return 52;case 79:return 53;case 76:return 57;case 77:return 56;case 78:return 61}}function gz(e){if(!YF(e))return;const t=_h(e.expression);return pf(t)?t:void 0}function hz(e,t,n){for(let r=t;rfunction(e,t,n){return AD(e)&&(!!e.initializer||!t)&&Ov(e)===n}(e,t,n))}function bz(e){return AD(t=e)&&Ov(t)||LD(e);var t}function xz(e){return D(e.members,bz)}function kz(e){return 173===e.kind&&void 0!==e.initializer}function Sz(e){return!Iv(e)&&(v_(e)||h_(e))&&dD(e.name)}function Tz(e){let t;if(e){const n=e.parameters,r=n.length>0&&dv(n[0]),i=r?1:0,o=r?n.length-1:n.length;for(let e=0;eFz(e.privateEnv,t))}function Az(e){return!e.initializer&&uD(e.name)}function Iz(e){return b(e,Az)}function Oz(e,t){if(!e||!KN(e)||!Cg(e.text,t))return e;const n=QS(e.text,_U(e.text,t));return n!==e.text?kw(FI(bw.createStringLiteral(n,e.singleQuote),e),e):e}var Lz=(e=>(e[e.All=0]="All",e[e.ObjectRest=1]="ObjectRest",e))(Lz||{});function jz(e,t,n,r,i,o){let a,s,c=e;if(lb(e))for(a=e.right;Sb(e.left)||kb(e.left);){if(!lb(a))return pn.checkDefined(bJ(a,t,K_));c=e=a,a=e.right}const l={context:n,level:r,downlevelIteration:!!n.getCompilerOptions().downlevelIteration,hoistTempVariables:!0,emitExpression:_,emitBindingOrAssignment:function(e,r,i,a){pn.assertNode(e,o?uD:K_);const s=o?o(e,r,i):FI(n.factory.createAssignment(pn.checkDefined(bJ(e,t,K_)),r),i);s.original=a,_(s)},createArrayBindingOrAssignmentPattern:e=>function(e,t){return pn.assertEachNode(t,L_),e.createArrayLiteralExpression(P(t,e.converters.convertToArrayAssignmentElement))}(n.factory,e),createObjectBindingOrAssignmentPattern:e=>function(e,t){return pn.assertEachNode(t,I_),e.createObjectLiteralExpression(P(t,e.converters.convertToObjectAssignmentElement))}(n.factory,e),createArrayBindingOrAssignmentElement:Vz,visitor:t};if(a&&(a=bJ(a,t,K_),pn.assert(a),uD(a)&&Mz(e,a.escapedText)||Rz(e)?a=Uz(l,a,!1,c):i?a=Uz(l,a,!0,c):iy(e)&&(c=a)),Jz(l,e,a,c,lb(e)),a&&i){if(!H(s))return a;s.push(a)}return n.factory.inlineExpressions(s)||n.factory.createOmittedExpression();function _(e){s=ae(s,e)}}function Mz(e,t){const n=qA(e);return P_(n)?function(e,t){const n=HA(e);for(const e of n)if(Mz(e,t))return!0;return!1}(n,t):!!uD(n)&&n.escapedText===t}function Rz(e){const t=WA(e);if(t&&ND(t)&&!Ml(t.expression))return!0;const n=qA(e);return!!n&&P_(n)&&!!p(HA(n),Rz)}function Bz(e,t,n,r,i,o=!1,a){let s;const c=[],l=[],_={context:n,level:r,downlevelIteration:!!n.getCompilerOptions().downlevelIteration,hoistTempVariables:o,emitExpression:function(e){s=ae(s,e)},emitBindingOrAssignment:u,createArrayBindingOrAssignmentPattern:e=>function(e,t){return pn.assertEachNode(t,D_),e.createArrayBindingPattern(t)}(n.factory,e),createObjectBindingOrAssignmentPattern:e=>function(e,t){return pn.assertEachNode(t,fF),e.createObjectBindingPattern(t)}(n.factory,e),createArrayBindingOrAssignmentElement:e=>function(e,t){return e.createBindingElement(void 0,void 0,t)}(n.factory,e),visitor:t};if(fE(e)){let t=zA(e);t&&(uD(t)&&Mz(e,t.escapedText)||Rz(e))&&(t=Uz(_,pn.checkDefined(bJ(t,_.visitor,K_)),!1,t),e=n.factory.updateVariableDeclaration(e,e.name,void 0,void 0,t))}if(Jz(_,e,i,e,a),s){const e=n.factory.createTempVariable(void 0);if(o){const t=n.factory.inlineExpressions(s);s=void 0,u(e,t,void 0,void 0)}else{n.hoistVariableDeclaration(e);const t=xe(c);t.pendingExpressions=ae(t.pendingExpressions,n.factory.createAssignment(e,t.value)),le(t.pendingExpressions,s),t.value=e}}for(const{pendingExpressions:e,name:t,value:r,location:i,original:o}of c){const a=n.factory.createVariableDeclaration(t,void 0,void 0,e?n.factory.inlineExpressions(ae(e,r)):r);a.original=o,FI(a,i),l.push(a)}return l;function u(e,t,r,i){pn.assertNode(e,a_),s&&(t=n.factory.inlineExpressions(ae(s,t)),s=void 0),c.push({pendingExpressions:s,name:e,value:t,location:r,original:i})}}function Jz(e,t,n,r,i){const o=qA(t);if(!i){const i=bJ(zA(t),e.visitor,K_);i?n?(n=function(e,t,n,r){return t=Uz(e,t,!0,r),e.context.factory.createConditionalExpression(e.context.factory.createTypeCheck(t,"undefined"),void 0,n,void 0,t)}(e,n,i,r),!pz(i)&&P_(o)&&(n=Uz(e,n,!0,r))):n=i:n||(n=e.context.factory.createVoidZero())}A_(o)?function(e,t,n,r,i){const o=HA(n),a=o.length;if(1!==a){r=Uz(e,r,!F_(t)||0!==a,i)}let s,c;for(let t=0;t=1)||98304&l.transformFlags||98304&qA(l).transformFlags||ND(t)){s&&(e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(s),r,i,n),s=void 0);const o=qz(e,r,t);ND(t)&&(c=ae(c,o.argumentExpression)),Jz(e,l,o,l)}else s=ae(s,bJ(l,e.visitor,E_))}}s&&e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(s),r,i,n)}(e,t,o,n,r):O_(o)?function(e,t,n,r,i){const o=HA(n),a=o.length;if(e.level<1&&e.downlevelIteration)r=Uz(e,FI(e.context.getEmitHelperFactory().createReadHelper(r,a>0&&UA(o[a-1])?void 0:a),i),!1,i);else if(1!==a&&(e.level<1||0===a)||b(o,RF)){r=Uz(e,r,!F_(t)||0!==a,i)}let s,c;for(let t=0;t=1)if(65536&n.transformFlags||e.hasTransformedPriorElement&&!zz(n)){e.hasTransformedPriorElement=!0;const t=e.context.factory.createTempVariable(void 0);e.hoistTempVariables&&e.context.hoistVariableDeclaration(t),c=ae(c,[t,n]),s=ae(s,e.createArrayBindingOrAssignmentElement(t))}else s=ae(s,n);else{if(RF(n))continue;if(UA(n)){if(t===a-1){const i=e.context.factory.createArraySliceCall(r,t);Jz(e,n,i,n)}}else{const i=e.context.factory.createElementAccessExpression(r,t);Jz(e,n,i,n)}}}s&&e.emitBindingOrAssignment(e.createArrayBindingOrAssignmentPattern(s),r,i,n);if(c)for(const[t,n]of c)Jz(e,n,t,n)}(e,t,o,n,r):e.emitBindingOrAssignment(o,n,r,t)}function zz(e){const t=qA(e);if(!t||RF(t))return!0;const n=WA(e);if(n&&!Wh(n))return!1;const r=zA(e);return!(r&&!pz(r))&&(P_(t)?b(HA(t),zz):uD(t))}function qz(e,t,n){const{factory:r}=e.context;if(ND(n)){const r=Uz(e,pn.checkDefined(bJ(n.expression,e.visitor,K_)),!1,n);return e.context.factory.createElementAccessExpression(t,r)}if(Jh(n)||HN(n)){const i=r.cloneNode(n);return e.context.factory.createElementAccessExpression(t,i)}{const r=e.context.factory.createIdentifier(bc(n));return e.context.factory.createPropertyAccessExpression(t,r)}}function Uz(e,t,n,r){if(uD(t)&&n)return t;{const n=e.context.factory.createTempVariable(void 0);return e.hoistTempVariables?(e.context.hoistVariableDeclaration(n),e.emitExpression(FI(e.context.factory.createAssignment(n,t),r))):e.emitBindingOrAssignment(n,t,r,void 0),n}}function Vz(e){return e}function Wz(e){var t;if(!LD(e)||1!==e.body.statements.length)return!1;const n=e.body.statements[0];return YF(n)&&cb(n.expression,!0)&&uD(n.expression.left)&&(null==(t=e.emitNode)?void 0:t.classThis)===n.expression.left&&110===n.expression.right.kind}function $z(e){var t;return!!(null==(t=e.emitNode)?void 0:t.classThis)&&H(e.members,Wz)}function Hz(e,t,n,r){if($z(t))return t;const i=function(e,t,n=e.createThis()){const r=e.createAssignment(t,n),i=e.createExpressionStatement(r),o=e.createBlock([i],!1),a=e.createClassStaticBlockDeclaration(o);return Sw(a).classThis=t,a}(e,n,r);t.name&&Pw(i.body.statements[0],t.name);const o=e.createNodeArray([i,...t.members]);FI(o,t.members);const a=hE(t)?e.updateClassDeclaration(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,o):e.updateClassExpression(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,o);return Sw(a).classThis=n,a}function Kz(e,t,n){const r=fc(AA(n));return(hE(r)||gE(r))&&!r.name&&Av(r,2048)?e.createStringLiteral("default"):e.createStringLiteralFromNode(t)}function Gz(e,t,n){const{factory:r}=e;if(void 0!==n){return{assignedName:r.createStringLiteral(n),name:t}}if(Wh(t)||dD(t)){return{assignedName:r.createStringLiteralFromNode(t),name:t}}if(Wh(t.expression)&&!uD(t.expression)){return{assignedName:r.createStringLiteralFromNode(t.expression),name:t}}const i=r.getGeneratedNameForNode(t);e.hoistVariableDeclaration(i);const o=e.getEmitHelperFactory().createPropKeyHelper(t.expression),a=r.createAssignment(i,o);return{assignedName:i,name:r.updateComputedPropertyName(t,a)}}function Xz(e){var t;if(!LD(e)||1!==e.body.statements.length)return!1;const n=e.body.statements[0];return YF(n)&&WN(n.expression,"___setFunctionName")&&n.expression.arguments.length>=2&&n.expression.arguments[1]===(null==(t=e.emitNode)?void 0:t.assignedName)}function Qz(e){var t;return!!(null==(t=e.emitNode)?void 0:t.assignedName)&&H(e.members,Xz)}function Yz(e){return!!e.name||Qz(e)}function Zz(e,t,n,r){if(Qz(t))return t;const{factory:i}=e,o=function(e,t,n=e.factory.createThis()){const{factory:r}=e,i=e.getEmitHelperFactory().createSetFunctionNameHelper(n,t),o=r.createExpressionStatement(i),a=r.createBlock([o],!1),s=r.createClassStaticBlockDeclaration(a);return Sw(s).assignedName=t,s}(e,n,r);t.name&&Pw(o.body.statements[0],t.name);const a=S(t.members,Wz)+1,s=t.members.slice(0,a),c=t.members.slice(a),l=i.createNodeArray([...s,o,...c]);return FI(l,t.members),Sw(t=hE(t)?i.updateClassDeclaration(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,l):i.updateClassExpression(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,l)).assignedName=n,t}function eq(e,t,n,r){if(r&&KN(n)&&km(n))return t;const{factory:i}=e,o=AA(t),a=MF(o)?it(Zz(e,o,n),MF):e.getEmitHelperFactory().createSetFunctionNameHelper(o,n);return i.restoreOuterExpressions(t,a)}function tq(e,t,n,r){switch(t.kind){case 304:return function(e,t,n,r){const{factory:i}=e,{assignedName:o,name:a}=Gz(e,t.name,r),s=eq(e,t.initializer,o,n);return i.updatePropertyAssignment(t,a,s)}(e,t,n,r);case 305:return function(e,t,n,r){const{factory:i}=e,o=void 0!==r?i.createStringLiteral(r):Kz(i,t.name,t.objectAssignmentInitializer),a=eq(e,t.objectAssignmentInitializer,o,n);return i.updateShorthandPropertyAssignment(t,t.name,a)}(e,t,n,r);case 261:return function(e,t,n,r){const{factory:i}=e,o=void 0!==r?i.createStringLiteral(r):Kz(i,t.name,t.initializer),a=eq(e,t.initializer,o,n);return i.updateVariableDeclaration(t,t.name,t.exclamationToken,t.type,a)}(e,t,n,r);case 170:return function(e,t,n,r){const{factory:i}=e,o=void 0!==r?i.createStringLiteral(r):Kz(i,t.name,t.initializer),a=eq(e,t.initializer,o,n);return i.updateParameterDeclaration(t,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,t.type,a)}(e,t,n,r);case 209:return function(e,t,n,r){const{factory:i}=e,o=void 0!==r?i.createStringLiteral(r):Kz(i,t.name,t.initializer),a=eq(e,t.initializer,o,n);return i.updateBindingElement(t,t.dotDotDotToken,t.propertyName,t.name,a)}(e,t,n,r);case 173:return function(e,t,n,r){const{factory:i}=e,{assignedName:o,name:a}=Gz(e,t.name,r),s=eq(e,t.initializer,o,n);return i.updatePropertyDeclaration(t,t.modifiers,a,t.questionToken??t.exclamationToken,t.type,s)}(e,t,n,r);case 227:return function(e,t,n,r){const{factory:i}=e,o=void 0!==r?i.createStringLiteral(r):Kz(i,t.left,t.right),a=eq(e,t.right,o,n);return i.updateBinaryExpression(t,t.left,t.operatorToken,a)}(e,t,n,r);case 278:return function(e,t,n,r){const{factory:i}=e,o=void 0!==r?i.createStringLiteral(r):i.createStringLiteral(t.isExportEquals?"":"default"),a=eq(e,t.expression,o,n);return i.updateExportAssignment(t,t.modifiers,a)}(e,t,n,r)}}var nq=(e=>(e[e.LiftRestriction=0]="LiftRestriction",e[e.All=1]="All",e))(nq||{});function rq(e,t,n,r,i,o){const a=bJ(t.tag,n,K_);pn.assert(a);const s=[void 0],c=[],l=[],_=t.template;if(0===o&&!yy(_))return EJ(t,n,e);const{factory:u}=e;if(QN(_))c.push(iq(u,_)),l.push(oq(u,_,r));else{c.push(iq(u,_.head)),l.push(oq(u,_.head,r));for(const e of _.templateSpans)c.push(iq(u,e.literal)),l.push(oq(u,e.literal,r)),s.push(pn.checkDefined(bJ(e.expression,n,K_)))}const d=e.getEmitHelperFactory().createTemplateObjectHelper(u.createArrayLiteralExpression(c),u.createArrayLiteralExpression(l));if(uO(r)){const e=u.createUniqueName("templateObject");i(e),s[0]=u.createLogicalOr(e,u.createAssignment(e,d))}else s[0]=d;return u.createCallExpression(a,void 0,s)}function iq(e,t){return 26656&t.templateFlags?e.createVoidZero():e.createStringLiteral(t.text)}function oq(e,t,n){let r=t.rawText;if(void 0===r){pn.assertIsDefined(n,"Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."),r=Kd(n,t);const e=15===t.kind||18===t.kind;r=r.substring(1,r.length-(e?1:2))}return r=r.replace(/\r\n?/g,"\n"),FI(e.createStringLiteral(r),t)}var aq=!1;function sq(e){const{factory:t,getEmitHelperFactory:n,startLexicalEnvironment:r,resumeLexicalEnvironment:i,endLexicalEnvironment:o,hoistVariableDeclaration:a}=e,s=e.getEmitResolver(),c=e.getCompilerOptions(),l=Sk(c),_=Tk(c),u=!!c.experimentalDecorators,d=c.emitDecoratorMetadata?_q(e):void 0,p=e.onEmitNode,f=e.onSubstituteNode;let m,g,h,y,v;e.onEmitNode=function(e,t,n){const r=b,i=m;dP(t)&&(m=t);2&x&&function(e){return 268===fc(e).kind}(t)&&(b|=2);8&x&&function(e){return 267===fc(e).kind}(t)&&(b|=8);p(e,t,n),b=r,m=i},e.onSubstituteNode=function(e,n){if(n=f(e,n),1===e)return function(e){switch(e.kind){case 80:return function(e){return we(e)||e}(e);case 212:case 213:return function(e){return Ne(e)}(e)}return e}(n);if(lP(n))return function(e){if(2&x){const n=e.name,r=we(n);if(r){if(e.objectAssignmentInitializer){const i=t.createAssignment(r,e.objectAssignmentInitializer);return FI(t.createPropertyAssignment(n,i),e)}return FI(t.createPropertyAssignment(n,r),e)}}return e}(n);return n},e.enableSubstitution(212),e.enableSubstitution(213);let b,x=0;return function(e){if(309===e.kind)return function(e){return t.createBundle(e.sourceFiles.map(k))}(e);return k(e)};function k(t){if(t.isDeclarationFile)return t;m=t;const n=S(t,R);return Kw(n,e.readEmitHelpers()),m=void 0,n}function S(e,t){const n=y,r=v;!function(e){switch(e.kind){case 308:case 270:case 269:case 242:y=e,v=void 0;break;case 264:case 263:if(Av(e,128))break;e.name?se(e):pn.assert(264===e.kind||Av(e,2048))}}(e);const i=t(e);return y!==n&&(v=r),y=n,i}function T(e){return S(e,C)}function C(e){return 1&e.transformFlags?M(e):e}function w(e){return S(e,N)}function N(n){switch(n.kind){case 273:case 272:case 278:case 279:return function(n){if(function(e){const t=hc(e);if(t===e||ME(e))return!1;if(!t||t.kind!==e.kind)return!0;switch(e.kind){case 273:if(pn.assertNode(t,wE),e.importClause!==t.importClause)return!0;if(e.attributes!==t.attributes)return!0;break;case 272:if(pn.assertNode(t,CE),e.name!==t.name)return!0;if(e.isTypeOnly!==t.isTypeOnly)return!0;if(e.moduleReference!==t.moduleReference&&(i_(e.moduleReference)||i_(t.moduleReference)))return!0;break;case 279:if(pn.assertNode(t,RE),e.exportClause!==t.exportClause)return!0;if(e.attributes!==t.attributes)return!0}return!1}(n))return 1&n.transformFlags?EJ(n,T,e):n;switch(n.kind){case 273:return function(e){if(!e.importClause)return e;if(e.importClause.isTypeOnly)return;const n=bJ(e.importClause,pe,NE);return n?t.updateImportDeclaration(e,void 0,n,e.moduleSpecifier,e.attributes):void 0}(n);case 272:return he(n);case 278:return function(t){return c.verbatimModuleSyntax||s.isValueAliasDeclaration(t)?EJ(t,T,e):void 0}(n);case 279:return function(e){if(e.isTypeOnly)return;if(!e.exportClause||OE(e.exportClause))return t.updateExportDeclaration(e,e.modifiers,e.isTypeOnly,e.exportClause,e.moduleSpecifier,e.attributes);const n=!!c.verbatimModuleSyntax,r=bJ(e.exportClause,e=>function(e,n){return OE(e)?function(e){return t.updateNamespaceExport(e,pn.checkDefined(bJ(e.name,T,uD)))}(e):function(e,n){const r=xJ(e.elements,ge,JE);return n||H(r)?t.updateNamedExports(e,r):void 0}(e,n)}(e,n),El);return r?t.updateExportDeclaration(e,void 0,e.isTypeOnly,r,e.moduleSpecifier,e.attributes):void 0}(n);default:pn.fail("Unhandled ellided statement")}}(n);default:return C(n)}}function F(e){return S(e,E)}function E(e){if(279!==e.kind&&273!==e.kind&&274!==e.kind&&(272!==e.kind||284!==e.moduleReference.kind))return 1&e.transformFlags||Av(e,32)?M(e):e}function A(n){return r=>S(r,r=>function(n,r){switch(n.kind){case 177:return function(n){if(!Q(n))return;return t.updateConstructorDeclaration(n,void 0,CJ(n.parameters,T,e),function(n,r){const a=r&&D(r.parameters,e=>rc(e,r));if(!H(a))return NJ(n,T,e);let s=[];i();const c=t.copyPrologue(n.statements,s,!1,T),l=yz(n.statements,c),_=J(a,Z);l.length?Y(s,n.statements,c,l,0,_):(le(s,_),le(s,xJ(n.statements,T,hu,c)));s=t.mergeLexicalEnvironment(s,o());const u=t.createBlock(FI(t.createNodeArray(s),n.statements),!0);return FI(u,n),kw(u,n),u}(n.body,n))}(n);case 173:return function(e,n){const r=33554432&e.flags||Av(e,64);if(r&&(!u||!Jv(e)))return;let i=m_(n)?xJ(e.modifiers,r?L:T,b_):xJ(e.modifiers,O,b_);if(i=U(i,e,n),r)return t.updatePropertyDeclaration(e,G(i,t.createModifiersFromModifierFlags(128)),pn.checkDefined(bJ(e.name,T,o_)),void 0,void 0,void 0);return t.updatePropertyDeclaration(e,i,X(e),void 0,void 0,bJ(e.initializer,T,K_))}(n,r);case 178:return ne(n,r);case 179:return re(n,r);case 175:return ee(n,r);case 176:return EJ(n,T,e);case 241:return n;case 182:return;default:return pn.failBadSyntaxKind(n)}}(r,n))}function I(e){return t=>S(t,t=>function(e,t){switch(e.kind){case 304:case 305:case 306:return T(e);case 178:return ne(e,t);case 179:return re(e,t);case 175:return ee(e,t);default:return pn.failBadSyntaxKind(e)}}(t,e))}function O(e){return ED(e)?void 0:T(e)}function L(e){return r_(e)?void 0:T(e)}function j(e){if(!ED(e)&&!(28895&Yv(e.kind)||g&&95===e.kind))return e}function M(n){if(hu(n)&&Av(n,128))return t.createNotEmittedStatement(n);switch(n.kind){case 95:case 90:return g?void 0:n;case 125:case 123:case 124:case 128:case 164:case 87:case 138:case 148:case 103:case 147:case 189:case 190:case 191:case 192:case 188:case 183:case 169:case 133:case 159:case 136:case 154:case 150:case 146:case 116:case 155:case 186:case 185:case 187:case 184:case 193:case 194:case 195:case 197:case 198:case 199:case 200:case 201:case 202:case 182:case 271:return;case 266:case 265:return t.createNotEmittedStatement(n);case 264:return function(n){const r=function(e){let t=0;H(vz(e,!0,!0))&&(t|=1);const n=kh(e);n&&106!==AA(n.expression).kind&&(t|=64);bm(u,e)&&(t|=2);vm(u,e)&&(t|=4);ye(e)?t|=8:!function(e){return ve(e)&&Av(e,2048)}(e)?be(e)&&(t|=16):t|=32;return t}(n),i=l<=1&&!!(7&r);if(!function(e){return Jv(e)||H(e.typeParameters)||H(e.heritageClauses,B)||H(e.members,B)}(n)&&!bm(u,n)&&!ye(n))return t.updateClassDeclaration(n,xJ(n.modifiers,j,r_),n.name,void 0,xJ(n.heritageClauses,T,aP),xJ(n.members,A(n),f_));i&&e.startLexicalEnvironment();const o=i||8&r;let a=xJ(n.modifiers,o?L:T,b_);2&r&&(a=q(a,n));const s=o&&!n.name||4&r||1&r,c=s?n.name??t.getGeneratedNameForNode(n):n.name,_=t.updateClassDeclaration(n,a,c,void 0,xJ(n.heritageClauses,T,aP),z(n));let d,p=rp(n);1&r&&(p|=64);if(ww(_,p),i){const r=[_],i=qb(ts(m.text,n.members.end),20),o=t.getInternalName(n),a=t.createPartiallyEmittedExpression(o);FT(a,i.end),ww(a,3072);const s=t.createReturnStatement(a);DT(s,i.pos),ww(s,3840),r.push(s),Rd(r,e.endLexicalEnvironment());const c=t.createImmediatelyInvokedArrowFunction(r);Dw(c,1);const l=t.createVariableDeclaration(t.getLocalName(n,!1,!1),void 0,void 0,c);kw(l,n);const u=t.createVariableStatement(void 0,t.createVariableDeclarationList([l],1));kw(u,n),Mw(u,n),Pw(u,Jb(n)),OA(u),d=u}else d=_;if(o){if(8&r)return[d,xe(n)];if(32&r)return[d,t.createExportDefault(t.getLocalName(n,!1,!0))];if(16&r)return[d,t.createExternalModuleExport(t.getDeclarationName(n,!1,!0))]}return d}(n);case 232:return function(e){let n=xJ(e.modifiers,L,b_);bm(u,e)&&(n=q(n,e));return t.updateClassExpression(e,n,e.name,void 0,xJ(e.heritageClauses,T,aP),z(e))}(n);case 299:return function(t){if(119===t.token)return;return EJ(t,T,e)}(n);case 234:return function(e){return t.updateExpressionWithTypeArguments(e,pn.checkDefined(bJ(e.expression,T,q_)),void 0)}(n);case 211:return function(e){return t.updateObjectLiteralExpression(e,xJ(e.properties,I(e),S_))}(n);case 177:case 173:case 175:case 178:case 179:case 176:return pn.fail("Class and object literal elements must be visited with their respective visitors");case 263:return function(n){if(!Q(n))return t.createNotEmittedStatement(n);const r=t.updateFunctionDeclaration(n,xJ(n.modifiers,j,r_),n.asteriskToken,n.name,void 0,CJ(n.parameters,T,e),void 0,NJ(n.body,T,e)||t.createBlock([]));if(ye(n)){const e=[r];return function(e,t){e.push(xe(t))}(e,n),e}return r}(n);case 219:return function(n){if(!Q(n))return t.createOmittedExpression();const r=t.updateFunctionExpression(n,xJ(n.modifiers,j,r_),n.asteriskToken,n.name,void 0,CJ(n.parameters,T,e),void 0,NJ(n.body,T,e)||t.createBlock([]));return r}(n);case 220:return function(n){const r=t.updateArrowFunction(n,xJ(n.modifiers,j,r_),void 0,CJ(n.parameters,T,e),void 0,n.equalsGreaterThanToken,NJ(n.body,T,e));return r}(n);case 170:return function(e){if(dv(e))return;const n=t.updateParameterDeclaration(e,xJ(e.modifiers,e=>ED(e)?T(e):void 0,b_),e.dotDotDotToken,pn.checkDefined(bJ(e.name,T,a_)),void 0,void 0,bJ(e.initializer,T,K_));n!==e&&(Mw(n,e),FI(n,zb(e)),Pw(n,zb(e)),ww(n.name,64));return n}(n);case 218:return function(n){const r=AA(n.expression,-55);if(G_(r)||zF(r)){const e=bJ(n.expression,T,K_);return pn.assert(e),t.createPartiallyEmittedExpression(e,n)}return EJ(n,T,e)}(n);case 217:case 235:return function(e){const n=bJ(e.expression,T,K_);return pn.assert(n),t.createPartiallyEmittedExpression(n,e)}(n);case 239:return function(e){const n=bJ(e.expression,T,K_);return pn.assert(n),t.createPartiallyEmittedExpression(n,e)}(n);case 214:return function(e){return t.updateCallExpression(e,pn.checkDefined(bJ(e.expression,T,K_)),void 0,xJ(e.arguments,T,K_))}(n);case 215:return function(e){return t.updateNewExpression(e,pn.checkDefined(bJ(e.expression,T,K_)),void 0,xJ(e.arguments,T,K_))}(n);case 216:return function(e){return t.updateTaggedTemplateExpression(e,pn.checkDefined(bJ(e.tag,T,K_)),void 0,pn.checkDefined(bJ(e.template,T,z_)))}(n);case 236:return function(e){const n=bJ(e.expression,T,q_);return pn.assert(n),t.createPartiallyEmittedExpression(n,e)}(n);case 267:return function(e){if(!function(e){return!af(e)||Ok(c)}(e))return t.createNotEmittedStatement(e);const n=[];let i=4;const a=_e(n,e);a&&(4===_&&y===m||(i|=1024));const s=Te(e),l=Ce(e),u=ye(e)?t.getExternalModuleOrNamespaceExportName(h,e,!1,!0):t.getDeclarationName(e,!1,!0);let d=t.createLogicalOr(u,t.createAssignment(u,t.createObjectLiteralExpression()));if(ye(e)){const n=t.getLocalName(e,!1,!0);d=t.createAssignment(n,d)}const p=t.createExpressionStatement(t.createCallExpression(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,s)],void 0,function(e,n){const i=h;h=n;const a=[];r();const s=P(e.members,oe);return Rd(a,o()),le(a,s),h=i,t.createBlock(FI(t.createNodeArray(a),e.members),!0)}(e,l)),void 0,[d]));kw(p,e),a&&(Bw(p,void 0),qw(p,void 0));return FI(p,e),Nw(p,i),n.push(p),n}(n);case 244:return function(n){if(ye(n)){const e=ix(n.declarationList);if(0===e.length)return;return FI(t.createExpressionStatement(t.inlineExpressions(P(e,ie))),n)}return EJ(n,T,e)}(n);case 261:return function(e){const n=t.updateVariableDeclaration(e,pn.checkDefined(bJ(e.name,T,a_)),void 0,void 0,bJ(e.initializer,T,K_));e.type&&tN(n.name,e.type);return n}(n);case 268:return ue(n);case 272:return he(n);case 286:return function(e){return t.updateJsxSelfClosingElement(e,pn.checkDefined(bJ(e.tagName,T,bu)),void 0,pn.checkDefined(bJ(e.attributes,T,eP)))}(n);case 287:return function(e){return t.updateJsxOpeningElement(e,pn.checkDefined(bJ(e.tagName,T,bu)),void 0,pn.checkDefined(bJ(e.attributes,T,eP)))}(n);default:return EJ(n,T,e)}}function R(n){const r=Wk(c,"alwaysStrict")&&!(uO(n)&&_>=5)&&!of(n);return t.updateSourceFile(n,TJ(n.statements,w,e,0,r))}function B(e){return!!(8192&e.transformFlags)}function z(e){const n=xJ(e.members,A(e),f_);let r;const i=cv(e),o=i&&D(i.parameters,e=>rc(e,i));if(o)for(const e of o){const n=t.createPropertyDeclaration(void 0,e.name,void 0,void 0,void 0);kw(n,e),r=ae(r,n)}return r?(r=le(r,n),FI(t.createNodeArray(r),e.members)):n}function q(e,n){const r=V(n,n);if(H(r)){const n=[];le(n,_n(e,gI)),le(n,D(e,ED)),le(n,r),le(n,D(un(e,gI),r_)),e=FI(t.createNodeArray(n),e)}return e}function U(e,n,r){if(m_(r)&&xm(u,n,r)){const i=V(n,r);if(H(i)){const n=[];le(n,D(e,ED)),le(n,i),le(n,D(e,r_)),e=FI(t.createNodeArray(n),e)}}return e}function V(e,r){if(u)return aq?function(e,r){if(d){let i;if(W(e)){i=ae(i,t.createPropertyAssignment("type",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),d.serializeTypeOfNode({currentLexicalScope:y,currentNameScope:r},e,r))))}if(K(e)){i=ae(i,t.createPropertyAssignment("paramTypes",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),d.serializeParameterTypesOfNode({currentLexicalScope:y,currentNameScope:r},e,r))))}if($(e)){i=ae(i,t.createPropertyAssignment("returnType",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),d.serializeReturnTypeOfNode({currentLexicalScope:y,currentNameScope:r},e))))}if(i){const e=n().createMetadataHelper("design:typeinfo",t.createObjectLiteralExpression(i,!0));return[t.createDecorator(e)]}}}(e,r):function(e,r){if(d){let i;if(W(e)){const o=n().createMetadataHelper("design:type",d.serializeTypeOfNode({currentLexicalScope:y,currentNameScope:r},e,r));i=ae(i,t.createDecorator(o))}if(K(e)){const o=n().createMetadataHelper("design:paramtypes",d.serializeParameterTypesOfNode({currentLexicalScope:y,currentNameScope:r},e,r));i=ae(i,t.createDecorator(o))}if($(e)){const o=n().createMetadataHelper("design:returntype",d.serializeReturnTypeOfNode({currentLexicalScope:y,currentNameScope:r},e));i=ae(i,t.createDecorator(o))}return i}}(e,r)}function W(e){const t=e.kind;return 175===t||178===t||179===t||173===t}function $(e){return 175===e.kind}function K(e){switch(e.kind){case 264:case 232:return void 0!==cv(e);case 175:case 178:case 179:return!0}return!1}function X(e){const n=e.name;if(u&&ND(n)&&Jv(e)){const e=bJ(n.expression,T,K_);pn.assert(e);if(!pz(Nl(e))){const r=t.getGeneratedNameForNode(n);return a(r),t.updateComputedPropertyName(n,t.createAssignment(r,e))}}return pn.checkDefined(bJ(n,T,o_))}function Q(e){return!Pd(e.body)}function Y(e,n,r,i,o,a){const s=i[o],c=n[s];if(le(e,xJ(n,T,hu,r,s-r)),dE(c)){const n=[];Y(n,c.tryBlock.statements,0,i,o+1,a);FI(t.createNodeArray(n),c.tryBlock.statements),e.push(t.updateTryStatement(c,t.updateBlock(c.tryBlock,n),bJ(c.catchClause,T,sP),bJ(c.finallyBlock,T,GF)))}else le(e,xJ(n,T,hu,s,1)),le(e,a);le(e,xJ(n,T,hu,s+1))}function Z(e){const n=e.name;if(!uD(n))return;const r=IT(FI(t.cloneNode(n),n),n.parent);ww(r,3168);const i=IT(FI(t.cloneNode(n),n),n.parent);return ww(i,3072),OA(Cw(FI(kw(t.createExpressionStatement(t.createAssignment(FI(t.createPropertyAccessExpression(t.createThis(),r),e.name),i)),e),Bb(e,-1))))}function ee(n,r){if(!(1&n.transformFlags))return n;if(!Q(n))return;let i=m_(r)?xJ(n.modifiers,T,b_):xJ(n.modifiers,O,b_);return i=U(i,n,r),t.updateMethodDeclaration(n,i,n.asteriskToken,X(n),void 0,void 0,CJ(n.parameters,T,e),void 0,NJ(n.body,T,e))}function te(e){return!(Pd(e.body)&&Av(e,64))}function ne(n,r){if(!(1&n.transformFlags))return n;if(!te(n))return;let i=m_(r)?xJ(n.modifiers,T,b_):xJ(n.modifiers,O,b_);return i=U(i,n,r),t.updateGetAccessorDeclaration(n,i,X(n),CJ(n.parameters,T,e),void 0,NJ(n.body,T,e)||t.createBlock([]))}function re(n,r){if(!(1&n.transformFlags))return n;if(!te(n))return;let i=m_(r)?xJ(n.modifiers,T,b_):xJ(n.modifiers,O,b_);return i=U(i,n,r),t.updateSetAccessorDeclaration(n,i,X(n),CJ(n.parameters,T,e),NJ(n.body,T,e)||t.createBlock([]))}function ie(n){const r=n.name;return w_(r)?jz(n,T,e,0,!1,ke):FI(t.createAssignment(Se(r),pn.checkDefined(bJ(n.initializer,T,K_))),n)}function oe(n){const r=function(e,n){const r=e.name;return dD(r)?t.createIdentifier(""):ND(r)?n&&!pz(r.expression)?t.getGeneratedNameForNode(r):r.expression:uD(r)?t.createStringLiteral(bc(r)):t.cloneNode(r)}(n,!1),i=s.getEnumMemberValue(n),o=function(n,r){return void 0!==r?"string"==typeof r?t.createStringLiteral(r):r<0?t.createPrefixUnaryExpression(41,t.createNumericLiteral(-r)):t.createNumericLiteral(r):(8&x||(x|=8,e.enableSubstitution(80)),n.initializer?pn.checkDefined(bJ(n.initializer,T,K_)):t.createVoidZero())}(n,null==i?void 0:i.value),a=t.createAssignment(t.createElementAccessExpression(h,r),o),c="string"==typeof(null==i?void 0:i.value)||(null==i?void 0:i.isSyntacticallyString)?a:t.createAssignment(t.createElementAccessExpression(h,a),r);return FI(t.createExpressionStatement(FI(c,n)),n)}function se(e){v||(v=new Map);const t=ce(e);v.has(t)||v.set(t,e)}function ce(e){return pn.assertNode(e.name,uD),e.name.escapedText}function _e(e,n){const r=t.createVariableDeclaration(t.getLocalName(n,!1,!0)),i=308===y.kind?0:1,o=t.createVariableStatement(xJ(n.modifiers,j,r_),t.createVariableDeclarationList([r],i));return kw(r,n),Bw(r,void 0),qw(r,void 0),kw(o,n),se(n),!!function(e){if(v){const t=ce(e);return v.get(t)===e}return!0}(n)&&(267===n.kind?Pw(o.declarationList,n):Pw(o,n),Mw(o,n),Nw(o,2048),e.push(o),!0)}function ue(n){if(!function(e){const t=hc(e,xE);return!t||dJ(t,Ok(c))}(n))return t.createNotEmittedStatement(n);pn.assertNode(n.name,uD,"A TypeScript namespace should have an Identifier name."),2&x||(x|=2,e.enableSubstitution(80),e.enableSubstitution(305),e.enableEmitNotification(268));const i=[];let a=4;const s=_e(i,n);s&&(4===_&&y===m||(a|=1024));const l=Te(n),u=Ce(n),d=ye(n)?t.getExternalModuleOrNamespaceExportName(h,n,!1,!0):t.getDeclarationName(n,!1,!0);let p=t.createLogicalOr(d,t.createAssignment(d,t.createObjectLiteralExpression()));if(ye(n)){const e=t.getLocalName(n,!1,!0);p=t.createAssignment(e,p)}const f=t.createExpressionStatement(t.createCallExpression(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,l)],void 0,function(e,n){const i=h,a=g,s=v;h=n,g=e,v=void 0;const c=[];let l,_;if(r(),e.body)if(269===e.body.kind)S(e.body,e=>le(c,xJ(e.statements,F,hu))),l=e.body.statements,_=e.body;else{const t=ue(e.body);t&&(Ze(t)?le(c,t):c.push(t));l=Bb(de(e).body.statements,-1)}Rd(c,o()),h=i,g=a,v=s;const u=t.createBlock(FI(t.createNodeArray(c),l),!0);FI(u,_),e.body&&269===e.body.kind||ww(u,3072|rp(u));return u}(n,u)),void 0,[p]));return kw(f,n),s&&(Bw(f,void 0),qw(f,void 0)),FI(f,n),Nw(f,a),i.push(f),i}function de(e){if(268===e.body.kind){return de(e.body)||e.body}}function pe(e){pn.assert(156!==e.phaseModifier);const n=De(e)?e.name:void 0,r=bJ(e.namedBindings,fe,cu);return n||r?t.updateImportClause(e,e.phaseModifier,n,r):void 0}function fe(e){if(275===e.kind)return De(e)?e:void 0;{const n=c.verbatimModuleSyntax,r=xJ(e.elements,me,jE);return n||H(r)?t.updateNamedImports(e,r):void 0}}function me(e){return!e.isTypeOnly&&De(e)?e:void 0}function ge(e){return e.isTypeOnly||!c.verbatimModuleSyntax&&!s.isValueAliasDeclaration(e)?void 0:e}function he(n){if(n.isTypeOnly)return;if(Dm(n)){if(!De(n))return;return EJ(n,T,e)}if(!function(e){return De(e)||!uO(m)&&s.isTopLevelValueImportEqualsWithEntityName(e)}(n))return;const r=hA(t,n.moduleReference);return ww(r,7168),be(n)||!ye(n)?kw(FI(t.createVariableStatement(xJ(n.modifiers,j,r_),t.createVariableDeclarationList([kw(t.createVariableDeclaration(n.name,void 0,void 0,r),n)])),n),n):kw((i=n.name,o=r,a=n,FI(t.createExpressionStatement(t.createAssignment(t.getNamespaceMemberName(h,i,!1,!0),o)),a)),n);var i,o,a}function ye(e){return void 0!==g&&Av(e,32)}function ve(e){return void 0===g&&Av(e,32)}function be(e){return ve(e)&&!Av(e,2048)}function xe(e){const n=t.createAssignment(t.getExternalModuleOrNamespaceExportName(h,e,!1,!0),t.getLocalName(e));Pw(n,Mb(e.name?e.name.pos:e.pos,e.end));const r=t.createExpressionStatement(n);return Pw(r,Mb(-1,e.end)),r}function ke(e,n,r){return FI(t.createAssignment(Se(e),n),r)}function Se(e){return t.getNamespaceMemberName(h,e,!1,!0)}function Te(e){const n=t.getGeneratedNameForNode(e);return Pw(n,e.name),n}function Ce(e){return t.getGeneratedNameForNode(e)}function we(e){if(x&b&&!Gl(e)&&!kA(e)){const n=s.getReferencedExportContainer(e,!1);if(n&&308!==n.kind){if(2&b&&268===n.kind||8&b&&267===n.kind)return FI(t.createPropertyAccessExpression(t.getGeneratedNameForNode(n),e),e)}}}function Ne(e){const n=function(e){if(Nk(c))return;return hF(e)||yF(e)?s.getConstantValue(e):void 0}(e);if(void 0!==n){$w(e,n);const i="string"==typeof n?t.createStringLiteral(n):n<0?t.createPrefixUnaryExpression(41,t.createNumericLiteral(-n)):t.createNumericLiteral(n);if(!c.removeComments){const t=fc(e,Dx);Uw(i,3,` ${r=ep(t),r.replace(/\*\//g,"*_/")} `)}return i}var r;return e}function De(e){return c.verbatimModuleSyntax||Om(e)||s.isReferencedAliasDeclaration(e)}}function cq(e){const{factory:t,getEmitHelperFactory:n,hoistVariableDeclaration:r,endLexicalEnvironment:i,startLexicalEnvironment:o,resumeLexicalEnvironment:a,addBlockScopedVariable:s}=e,c=e.getEmitResolver(),l=e.getCompilerOptions(),_=Sk(l),u=Rk(l),d=!!l.experimentalDecorators,p=!u,f=u&&_<9,m=p||f,g=_<9,h=_<99?-1:u?0:3,y=_<9,v=y&&_>=2,b=m||g||-1===h,k=e.onSubstituteNode;e.onSubstituteNode=function(e,n){if(n=k(e,n),1===e)return function(e){switch(e.kind){case 80:return function(e){return function(e){if(1&E&&c.hasNodeCheckFlag(e,536870912)){const n=c.getReferencedValueDeclaration(e);if(n){const r=T[n.id];if(r){const n=t.cloneNode(r);return Pw(n,e),Mw(n,e),n}}}return}(e)||e}(e);case 110:return function(e){if(2&E&&(null==N?void 0:N.data)&&!I.has(e)){const{facts:n,classConstructor:r,classThis:i}=N.data,o=j?i??r:r;if(o)return FI(kw(t.cloneNode(o),e),e);if(1&n&&d)return t.createParenthesizedExpression(t.createVoidZero())}return e}(e)}return e}(n);return n};const S=e.onEmitNode;e.onEmitNode=function(e,t,n){const r=fc(t),i=A.get(r);if(i){const o=N,a=M;return N=i,M=j,j=!(LD(r)&&32&ip(r)),S(e,t,n),j=M,M=a,void(N=o)}switch(t.kind){case 219:if(CF(r)||524288&rp(t))break;case 263:case 177:case 178:case 179:case 175:case 173:{const r=N,i=M;return N=void 0,M=j,j=!1,S(e,t,n),j=M,M=i,void(N=r)}case 168:{const r=N,i=j;return N=null==N?void 0:N.previous,j=M,S(e,t,n),j=i,void(N=r)}}S(e,t,n)};let T,C,w,N,F=!1,E=0;const A=new Map,I=new Set;let O,L,j=!1,M=!1;return rz(e,function(t){if(t.isDeclarationFile)return t;if(N=void 0,F=!!(32&ip(t)),!b&&!F)return t;const n=EJ(t,B,e);return Kw(n,e.readEmitHelpers()),n});function R(e){return 129===e.kind?ne()?void 0:e:rt(e,r_)}function B(n){if(!(16777216&n.transformFlags||134234112&n.transformFlags))return n;switch(n.kind){case 264:return function(e){return ye(e,ve)}(n);case 232:return function(e){return ye(e,be)}(n);case 176:case 173:return pn.fail("Use `classElementVisitor` instead.");case 304:case 261:case 170:case 209:return function(t){Zh(t,pe)&&(t=tq(e,t));return EJ(t,B,e)}(n);case 244:return function(t){const n=w;w=[];const r=EJ(t,B,e),i=H(w)?[r,...w]:r;return w=n,i}(n);case 278:return function(t){Zh(t,pe)&&(t=tq(e,t,!0,t.isExportEquals?"":"default"));return EJ(t,B,e)}(n);case 81:return function(e){if(!g)return e;if(hu(e.parent))return e;return kw(t.createIdentifier(""),e)}(n);case 212:return function(n){if(dD(n.name)){const e=Re(n.name);if(e)return FI(kw(se(e,n.expression),n),n)}if(v&&L&&_m(n)&&uD(n.name)&&lq(L)&&(null==N?void 0:N.data)){const{classConstructor:e,superClassReference:r,facts:i}=N.data;if(1&i)return Fe(n);if(e&&r){const i=t.createReflectGetCall(r,t.createStringLiteralFromNode(n.name),e);return kw(i,n.expression),FI(i,n.expression),i}}return EJ(n,B,e)}(n);case 213:return function(n){if(v&&L&&_m(n)&&lq(L)&&(null==N?void 0:N.data)){const{classConstructor:e,superClassReference:r,facts:i}=N.data;if(1&i)return Fe(n);if(e&&r){const i=t.createReflectGetCall(r,bJ(n.argumentExpression,B,K_),e);return kw(i,n.expression),FI(i,n.expression),i}}return EJ(n,B,e)}(n);case 225:case 226:return _e(n,!1);case 227:return fe(n,!1);case 218:return me(n,!1);case 214:return function(n){var i;if(Zl(n.expression)&&Re(n.expression.name)){const{thisArg:e,target:i}=t.createCallBinding(n.expression,r,_);return bl(n)?t.updateCallChain(n,t.createPropertyAccessChain(bJ(i,B,K_),n.questionDotToken,"call"),void 0,void 0,[bJ(e,B,K_),...xJ(n.arguments,B,K_)]):t.updateCallExpression(n,t.createPropertyAccessExpression(bJ(i,B,K_),"call"),void 0,[bJ(e,B,K_),...xJ(n.arguments,B,K_)])}if(v&&L&&_m(n.expression)&&lq(L)&&(null==(i=null==N?void 0:N.data)?void 0:i.classConstructor)){const e=t.createFunctionCallCall(bJ(n.expression,B,K_),N.data.classConstructor,xJ(n.arguments,B,K_));return kw(e,n),FI(e,n),e}return EJ(n,B,e)}(n);case 245:return function(e){return t.updateExpressionStatement(e,bJ(e.expression,z,K_))}(n);case 216:return function(n){var i;if(Zl(n.tag)&&Re(n.tag.name)){const{thisArg:e,target:i}=t.createCallBinding(n.tag,r,_);return t.updateTaggedTemplateExpression(n,t.createCallExpression(t.createPropertyAccessExpression(bJ(i,B,K_),"bind"),void 0,[bJ(e,B,K_)]),void 0,bJ(n.template,B,z_))}if(v&&L&&_m(n.tag)&&lq(L)&&(null==(i=null==N?void 0:N.data)?void 0:i.classConstructor)){const e=t.createFunctionBindCall(bJ(n.tag,B,K_),N.data.classConstructor,[]);return kw(e,n),FI(e,n),t.updateTaggedTemplateExpression(n,e,void 0,bJ(n.template,B,z_))}return EJ(n,B,e)}(n);case 249:return function(n){return t.updateForStatement(n,bJ(n.initializer,z,iu),bJ(n.condition,B,K_),bJ(n.incrementor,z,K_),DJ(n.statement,B,e))}(n);case 110:return function(e){if(y&&L&&LD(L)&&(null==N?void 0:N.data)){const{classThis:t,classConstructor:n}=N.data;return t??n??e}return e}(n);case 263:case 219:return Y(void 0,J,n);case 177:case 175:case 178:case 179:return Y(n,J,n);default:return J(n)}}function J(t){return EJ(t,B,e)}function z(e){switch(e.kind){case 225:case 226:return _e(e,!0);case 227:return fe(e,!0);case 357:return function(e,n){const r=n?FJ(e.elements,z):FJ(e.elements,B,z);return t.updateCommaListExpression(e,r)}(e,!0);case 218:return me(e,!0);default:return B(e)}}function q(n){switch(n.kind){case 299:return EJ(n,q,e);case 234:return function(n){var i;if(4&((null==(i=null==N?void 0:N.data)?void 0:i.facts)||0)){const e=t.createTempVariable(r,!0);return Ee().superClassReference=e,t.updateExpressionWithTypeArguments(n,t.createAssignment(e,bJ(n.expression,B,K_)),void 0)}return EJ(n,B,e)}(n);default:return B(n)}}function U(e){switch(e.kind){case 211:case 210:return Ue(e);default:return B(e)}}function V(e){switch(e.kind){case 177:return Y(e,G,e);case 178:case 179:case 175:return Y(e,Q,e);case 173:return Y(e,re,e);case 176:return Y(e,xe,e);case 168:return K(e);case 241:return e;default:return b_(e)?R(e):B(e)}}function W(e){return 168===e.kind?K(e):B(e)}function $(e){switch(e.kind){case 173:return te(e);case 178:case 179:return V(e);default:pn.assertMissingNode(e,"Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration")}}function K(e){const n=bJ(e.expression,B,K_);return t.updateComputedPropertyName(e,function(e){return H(C)&&(SF(e)?(C.push(e.expression),e=t.updateParenthesizedExpression(e,t.inlineExpressions(C))):(C.push(e),e=t.inlineExpressions(C)),C=void 0),e}(n))}function G(e){return O?Se(e,O):J(e)}function X(e){return!!g||!!(Ov(e)&&32&ip(e))}function Q(n){if(pn.assert(!Jv(n)),!Yl(n)||!X(n))return EJ(n,V,e);const r=Re(n.name);if(pn.assert(r,"Undeclared private name for property declaration."),!r.isValid)return n;const i=function(e){pn.assert(dD(e.name));const t=Re(e.name);if(pn.assert(t,"Undeclared private name for property declaration."),"m"===t.kind)return t.methodName;if("a"===t.kind){if(Pu(e))return t.getterName;if(Eu(e))return t.setterName}}(n);i&&Ae().push(t.createAssignment(i,t.createFunctionExpression(D(n.modifiers,e=>r_(e)&&!vD(e)&&!kD(e)),n.asteriskToken,i,void 0,CJ(n.parameters,B,e),void 0,NJ(n.body,B,e))))}function Y(e,t,n){if(e!==L){const r=L;L=e;const i=t(n);return L=r,i}return t(n)}function Z(e){const n=jw(e),i=Ew(e),o=e.name;let a=o,s=o;if(ND(o)&&!pz(o.expression)){const e=CI(o);if(e)a=t.updateComputedPropertyName(o,bJ(o.expression,B,K_)),s=t.updateComputedPropertyName(o,e.left);else{const e=t.createTempVariable(r);Pw(e,o.expression);const n=bJ(o.expression,B,K_),i=t.createAssignment(e,n);Pw(i,o.expression),a=t.updateComputedPropertyName(o,i),s=t.updateComputedPropertyName(o,e)}}const c=xJ(e.modifiers,R,r_),l=kI(t,e,c,e.initializer);kw(l,e),ww(l,3072),Pw(l,i);const _=Iv(e)?function(){const e=Ee();return e.classThis??e.classConstructor??(null==O?void 0:O.name)}()??t.createThis():t.createThis(),u=SI(t,e,c,a,_);kw(u,e),Mw(u,n),Pw(u,i);const d=t.createModifiersFromModifierFlags(Qv(c)),p=TI(t,e,d,s,_);return kw(p,e),ww(p,3072),Pw(p,i),kJ([l,u,p],$,f_)}function ee(e){if(m&&!h_(e)){const n=function(e,n){if(ND(e)){const i=CI(e),o=bJ(e.expression,B,K_),a=Nl(o),l=pz(a);if(!(!!i||cb(a)&&Gl(a.left))&&!l&&n){const n=t.getGeneratedNameForNode(e);return c.hasNodeCheckFlag(e,32768)?s(n):r(n),t.createAssignment(n,o)}return l||uD(a)?void 0:o}}(e.name,!!e.initializer||u);if(n&&Ae().push(...NI(n)),Iv(e)&&!g){const n=we(e,t.createThis());if(n){const r=t.createClassStaticBlockDeclaration(t.createBlock([n]));return kw(r,e),Mw(r,e),Mw(n,{pos:-1,end:-1}),Bw(n,void 0),qw(n,void 0),r}}return}return t.updatePropertyDeclaration(e,xJ(e.modifiers,R,r_),bJ(e.name,W,o_),void 0,void 0,bJ(e.initializer,B,K_))}function te(n){return pn.assert(!Jv(n),"Decorators should already have been transformed and elided."),Yl(n)?function(n){if(X(n)){const e=Re(n.name);if(pn.assert(e,"Undeclared private name for property declaration."),!e.isValid)return n;if(e.isStatic&&!g){const e=we(n,t.createThis());if(e)return t.createClassStaticBlockDeclaration(t.createBlock([e],!0))}return}return p&&!Iv(n)&&(null==N?void 0:N.data)&&16&N.data.facts?t.updatePropertyDeclaration(n,xJ(n.modifiers,B,b_),n.name,void 0,void 0,void 0):(Zh(n,pe)&&(n=tq(e,n)),t.updatePropertyDeclaration(n,xJ(n.modifiers,R,r_),bJ(n.name,W,o_),void 0,void 0,bJ(n.initializer,B,K_)))}(n):ee(n)}function ne(){return-1===h||3===h&&!!(null==N?void 0:N.data)&&!!(16&N.data.facts)}function re(e){return h_(e)&&(ne()||Ov(e)&&32&ip(e))?Z(e):te(e)}function oe(e){if(L&&Ov(L)&&g_(L)&&h_(fc(L))){const t=AA(e);110===t.kind&&I.add(t)}}function se(e,t){return oe(t=bJ(t,B,K_)),ce(e,t)}function ce(e,t){switch(Mw(t,Bb(t,-1)),e.kind){case"a":return n().createClassPrivateFieldGetHelper(t,e.brandCheckIdentifier,e.kind,e.getterName);case"m":return n().createClassPrivateFieldGetHelper(t,e.brandCheckIdentifier,e.kind,e.methodName);case"f":return n().createClassPrivateFieldGetHelper(t,e.brandCheckIdentifier,e.kind,e.isStatic?e.variableName:void 0);case"untransformed":return pn.fail("Access helpers should not be created for untransformed private elements");default:pn.assertNever(e,"Unknown private element type")}}function _e(n,i){if(46===n.operator||47===n.operator){const e=_h(n.operand);if(Zl(e)){let o;if(o=Re(e.name)){const a=bJ(e.expression,B,K_);oe(a);const{readExpression:s,initializeExpression:c}=ue(a);let l=se(o,s);const _=EF(n)||i?void 0:t.createTempVariable(r);return l=bA(t,n,l,r,_),l=ge(o,c||s,l,64),kw(l,n),FI(l,n),_&&(l=t.createComma(l,_),FI(l,n)),l}}else if(v&&L&&_m(e)&&lq(L)&&(null==N?void 0:N.data)){const{classConstructor:o,superClassReference:a,facts:s}=N.data;if(1&s){const r=Fe(e);return EF(n)?t.updatePrefixUnaryExpression(n,r):t.updatePostfixUnaryExpression(n,r)}if(o&&a){let s,c;if(hF(e)?uD(e.name)&&(c=s=t.createStringLiteralFromNode(e.name)):pz(e.argumentExpression)?c=s=e.argumentExpression:(c=t.createTempVariable(r),s=t.createAssignment(c,bJ(e.argumentExpression,B,K_))),s&&c){let l=t.createReflectGetCall(a,c,o);FI(l,e);const _=i?void 0:t.createTempVariable(r);return l=bA(t,n,l,r,_),l=t.createReflectSetCall(a,s,l,o),kw(l,n),FI(l,n),_&&(l=t.createComma(l,_),FI(l,n)),l}}}}return EJ(n,B,e)}function ue(e){const n=iy(e)?e:t.cloneNode(e);if(110===e.kind&&I.has(e)&&I.add(n),pz(e))return{readExpression:n,initializeExpression:void 0};const i=t.createTempVariable(r);return{readExpression:i,initializeExpression:t.createAssignment(i,n)}}function de(e){if(N&&A.set(fc(e),N),g){if(Wz(e)){const t=bJ(e.body.statements[0].expression,B,K_);if(cb(t,!0)&&t.left===t.right)return;return t}if(Xz(e))return bJ(e.body.statements[0].expression,B,K_);o();let n=Y(e,e=>xJ(e,B,hu),e.body.statements);n=t.mergeLexicalEnvironment(n,i());const r=t.createImmediatelyInvokedArrowFunction(n);return kw(_h(r.expression),e),Nw(_h(r.expression),4),kw(r,e),FI(r,e),r}}function pe(e){if(MF(e)&&!e.name){const t=xz(e);if(H(t,Xz))return!1;return(g||!!ip(e))&&H(t,e=>LD(e)||Yl(e)||m&&kz(e))}return!1}function fe(i,o){if(lb(i)){const e=C;C=void 0,i=t.updateBinaryExpression(i,bJ(i.left,U,K_),i.operatorToken,bJ(i.right,B,K_));const n=H(C)?t.inlineExpressions(ie([...C,i])):i;return C=e,n}if(cb(i)){Zh(i,pe)&&(i=tq(e,i),pn.assertNode(i,cb));const n=AA(i.left,9);if(Zl(n)){const e=Re(n.name);if(e)return FI(kw(ge(e,n.expression,i.right,i.operatorToken.kind),i),i)}else if(v&&L&&_m(i.left)&&lq(L)&&(null==N?void 0:N.data)){const{classConstructor:e,superClassReference:n,facts:a}=N.data;if(1&a)return t.updateBinaryExpression(i,Fe(i.left),i.operatorToken,bJ(i.right,B,K_));if(e&&n){let a=yF(i.left)?bJ(i.left.argumentExpression,B,K_):uD(i.left.name)?t.createStringLiteralFromNode(i.left.name):void 0;if(a){let s=bJ(i.right,B,K_);if(fz(i.operatorToken.kind)){let o=a;pz(a)||(o=t.createTempVariable(r),a=t.createAssignment(o,a));const c=t.createReflectGetCall(n,o,e);kw(c,i.left),FI(c,i.left),s=t.createBinaryExpression(c,mz(i.operatorToken.kind),s),FI(s,i)}const c=o?void 0:t.createTempVariable(r);return c&&(s=t.createAssignment(c,s),FI(c,i)),s=t.createReflectSetCall(n,a,s,e),kw(s,i),FI(s,i),c&&(s=t.createComma(s,c),FI(s,i)),s}}}}return function(e){return dD(e.left)&&103===e.operatorToken.kind}(i)?function(t){const r=Re(t.left);if(r){const e=bJ(t.right,B,K_);return kw(n().createClassPrivateFieldInHelper(r.brandCheckIdentifier,e),t)}return EJ(t,B,e)}(i):EJ(i,B,e)}function me(e,n){const r=n?z:B,i=bJ(e.expression,r,K_);return t.updateParenthesizedExpression(e,i)}function ge(e,r,i,o){if(r=bJ(r,B,K_),i=bJ(i,B,K_),oe(r),fz(o)){const{readExpression:n,initializeExpression:a}=ue(r);r=a||n,i=t.createBinaryExpression(ce(e,n),mz(o),i)}switch(Mw(r,Bb(r,-1)),e.kind){case"a":return n().createClassPrivateFieldSetHelper(r,e.brandCheckIdentifier,i,e.kind,e.setterName);case"m":return n().createClassPrivateFieldSetHelper(r,e.brandCheckIdentifier,i,e.kind,void 0);case"f":return n().createClassPrivateFieldSetHelper(r,e.brandCheckIdentifier,i,e.kind,e.isStatic?e.variableName:void 0);case"untransformed":return pn.fail("Access helpers should not be created for untransformed private elements");default:pn.assertNever(e,"Unknown private element type")}}function he(e){return D(e.members,Sz)}function ye(n,r){var i;const o=O,a=C,s=N;O=n,C=void 0,N={previous:N,data:void 0};const l=32&ip(n);if(g||l){const e=Fc(n);if(e&&uD(e))Pe().data.className=e;else if((null==(i=n.emitNode)?void 0:i.assignedName)&&KN(n.emitNode.assignedName))if(n.emitNode.assignedName.textSourceNode&&uD(n.emitNode.assignedName.textSourceNode))Pe().data.className=n.emitNode.assignedName.textSourceNode;else if(vs(n.emitNode.assignedName.text,_)){const e=t.createIdentifier(n.emitNode.assignedName.text);Pe().data.className=e}}if(g){const e=he(n);H(e)&&(Pe().data.weakSetName=je("instances",e[0].name))}const u=function(e){var t;let n=0;const r=fc(e);m_(r)&&bm(d,r)&&(n|=1),g&&($z(e)||Qz(e))&&(n|=2);let i=!1,o=!1,a=!1,s=!1;for(const r of e.members)Iv(r)?(r.name&&(dD(r.name)||h_(r))&&g?n|=2:!h_(r)||-1!==h||e.name||(null==(t=e.emitNode)?void 0:t.classThis)||(n|=2),(AD(r)||LD(r))&&(y&&16384&r.transformFlags&&(n|=8,1&n||(n|=2)),v&&134217728&r.transformFlags&&(1&n||(n|=6)))):jv(fc(r))||(h_(r)?(s=!0,a||(a=Yl(r))):Yl(r)?(a=!0,c.hasNodeCheckFlag(r,262144)&&(n|=2)):AD(r)&&(i=!0,o||(o=!!r.initializer)));return(f&&i||p&&o||g&&a||g&&s&&-1===h)&&(n|=16),n}(n);u&&(Ee().facts=u),8&u&&(2&E||(E|=2,e.enableSubstitution(110),e.enableEmitNotification(263),e.enableEmitNotification(219),e.enableEmitNotification(177),e.enableEmitNotification(178),e.enableEmitNotification(179),e.enableEmitNotification(175),e.enableEmitNotification(173),e.enableEmitNotification(168)));const m=r(n,u);return N=null==N?void 0:N.previous,pn.assert(N===s),O=o,C=a,m}function ve(e,n){var i,o;let a;if(2&n)if(g&&(null==(i=e.emitNode)?void 0:i.classThis))Ee().classConstructor=e.emitNode.classThis,a=t.createAssignment(e.emitNode.classThis,t.getInternalName(e));else{const n=t.createTempVariable(r,!0);Ee().classConstructor=t.cloneNode(n),a=t.createAssignment(n,t.getInternalName(e))}(null==(o=e.emitNode)?void 0:o.classThis)&&(Ee().classThis=e.emitNode.classThis);const s=c.hasNodeCheckFlag(e,262144),l=Av(e,32),_=Av(e,2048);let u=xJ(e.modifiers,R,r_);const d=xJ(e.heritageClauses,q,aP),{members:f,prologue:m}=ke(e),h=[];if(a&&Ae().unshift(a),H(C)&&h.push(t.createExpressionStatement(t.inlineExpressions(C))),p||g||32&ip(e)){const n=xz(e);H(n)&&Ce(h,n,t.getInternalName(e))}h.length>0&&l&&_&&(u=xJ(u,e=>gI(e)?void 0:e,r_),h.push(t.createExportAssignment(void 0,!1,t.getLocalName(e,!1,!0))));const y=Ee().classConstructor;s&&y&&(De(),T[ez(e)]=y);const v=t.updateClassDeclaration(e,u,e.name,void 0,d,f);return h.unshift(v),m&&h.unshift(t.createExpressionStatement(m)),h}function be(e,n){var i,o,a;const l=!!(1&n),_=xz(e),u=c.hasNodeCheckFlag(e,262144),d=c.hasNodeCheckFlag(e,32768);let p;function f(){var n;if(g&&(null==(n=e.emitNode)?void 0:n.classThis))return Ee().classConstructor=e.emitNode.classThis;const i=t.createTempVariable(d?s:r,!0);return Ee().classConstructor=t.cloneNode(i),i}(null==(i=e.emitNode)?void 0:i.classThis)&&(Ee().classThis=e.emitNode.classThis),2&n&&(p??(p=f()));const h=xJ(e.modifiers,R,r_),y=xJ(e.heritageClauses,q,aP),{members:v,prologue:b}=ke(e),x=t.updateClassExpression(e,h,e.name,void 0,y,v),k=[];b&&k.push(b);if((g||32&ip(e))&&H(_,e=>LD(e)||Yl(e)||m&&kz(e))||H(C))if(l)pn.assertIsDefined(w,"Decorated classes transformed by TypeScript are expected to be within a variable declaration."),H(C)&&le(w,P(C,t.createExpressionStatement)),H(_)&&Ce(w,_,(null==(o=e.emitNode)?void 0:o.classThis)??t.getInternalName(e)),p?k.push(t.createAssignment(p,x)):g&&(null==(a=e.emitNode)?void 0:a.classThis)?k.push(t.createAssignment(e.emitNode.classThis,x)):k.push(x);else{if(p??(p=f()),u){De();const n=t.cloneNode(p);n.emitNode.autoGenerate.flags&=-9,T[ez(e)]=n}k.push(t.createAssignment(p,x)),le(k,C),le(k,function(e,t){const n=[];for(const r of e){const e=LD(r)?Y(r,de,r):Y(r,()=>Ne(r,t),void 0);e&&(OA(e),kw(e,r),Nw(e,3072&rp(r)),Pw(e,zb(r)),Mw(e,r),n.push(e))}return n}(_,p)),k.push(t.cloneNode(p))}else k.push(x);return k.length>1&&(Nw(x,131072),k.forEach(OA)),t.inlineExpressions(k)}function xe(t){if(!g)return EJ(t,B,e)}function ke(e){const n=!!(32&ip(e));if(g||F){for(const t of e.members)if(Yl(t))if(X(t))Le(t,t.name,Ie);else{Ez(Pe(),t.name,{kind:"untransformed"})}if(g&&H(he(e))&&function(){const{weakSetName:e}=Pe().data;pn.assert(e,"weakSetName should be set in private identifier environment"),Ae().push(t.createAssignment(e,t.createNewExpression(t.createIdentifier("WeakSet"),void 0,[])))}(),ne())for(const r of e.members)if(h_(r)){const e=t.getGeneratedPrivateNameForNode(r.name,void 0,"_accessor_storage");if(g||n&&Ov(r))Le(r,e,Oe);else{Ez(Pe(),e,{kind:"untransformed"})}}}let i,o,a,s=xJ(e.members,V,f_);if(H(s,jD)||(i=Se(void 0,e)),!g&&H(C)){let e=t.createExpressionStatement(t.inlineExpressions(C));if(134234112&e.transformFlags){const n=t.createTempVariable(r),i=t.createArrowFunction(void 0,void 0,[],void 0,void 0,t.createBlock([e]));o=t.createAssignment(n,i),e=t.createExpressionStatement(t.createCallExpression(n,void 0,[]))}const n=t.createBlock([e]);a=t.createClassStaticBlockDeclaration(n),C=void 0}if(i||a){let n;const r=x(s,Wz),o=x(s,Xz);n=ae(n,r),n=ae(n,o),n=ae(n,i),n=ae(n,a);n=le(n,r||o?D(s,e=>e!==r&&e!==o):s),s=FI(t.createNodeArray(n),e.members)}return{members:s,prologue:o}}function Se(n,r){if(n=bJ(n,B,jD),!((null==N?void 0:N.data)&&16&N.data.facts))return n;const o=kh(r),s=!(!o||106===AA(o.expression).kind),c=CJ(n?n.parameters:void 0,B,e),l=function(n,r,o){var s;const c=vz(n,!1,!1);let l=c;u||(l=D(l,e=>!!e.initializer||dD(e.name)||Rv(e)));const _=he(n),d=H(l)||H(_);if(!r&&!d)return NJ(void 0,B,e);a();const p=!r&&o;let f=0,m=[];const h=[],y=t.createThis();if(function(e,n,r){if(!g||!H(n))return;const{weakSetName:i}=Pe().data;pn.assert(i,"weakSetName should be set in private identifier environment"),e.push(t.createExpressionStatement(function(e,t,n){return e.createCallExpression(e.createPropertyAccessExpression(n,"add"),void 0,[t])}(t,r,i)))}(h,_,y),r){const e=D(c,e=>rc(fc(e),r)),t=D(l,e=>!rc(fc(e),r));Ce(h,e,y),Ce(h,t,y)}else Ce(h,l,y);if(null==r?void 0:r.body){f=t.copyPrologue(r.body.statements,m,!1,B);const e=yz(r.body.statements,f);if(e.length)Te(m,r.body.statements,f,e,0,h,r);else{for(;f=m.length?r.body.multiLine??m.length>0:m.length>0;return FI(t.createBlock(FI(t.createNodeArray(m),(null==(s=null==r?void 0:r.body)?void 0:s.statements)??n.members),v),null==r?void 0:r.body)}(r,n,s);return l?n?(pn.assert(c),t.updateConstructorDeclaration(n,void 0,c,l)):OA(kw(FI(t.createConstructorDeclaration(void 0,c??[],l),n||r),n)):n}function Te(e,n,r,i,o,a,s){const c=i[o],l=n[c];if(le(e,xJ(n,B,hu,r,c-r)),r=c+1,dE(l)){const n=[];Te(n,l.tryBlock.statements,0,i,o+1,a,s);FI(t.createNodeArray(n),l.tryBlock.statements),e.push(t.updateTryStatement(l,t.updateBlock(l.tryBlock,n),bJ(l.catchClause,B,sP),bJ(l.finallyBlock,B,GF)))}else{for(le(e,xJ(n,B,hu,c,1));rl(e,p,t),serializeTypeOfNode:(e,t,n)=>l(e,_,t,n),serializeParameterTypesOfNode:(e,t,n)=>l(e,u,t,n),serializeReturnTypeOfNode:(e,t)=>l(e,d,t)};function l(e,t,n,r){const i=s,o=c;s=e.currentLexicalScope,c=e.currentNameScope;const a=void 0===r?t(n):t(n,r);return s=i,c=o,a}function _(e,n){switch(e.kind){case 173:case 170:return p(e.type);case 179:case 178:return p(function(e,t){const n=hv(t.members,e);return n.setAccessor&&_v(n.setAccessor)||n.getAccessor&&bv(n.getAccessor)}(e,n));case 264:case 232:case 175:return t.createIdentifier("Function");default:return t.createVoidZero()}}function u(e,n){const r=m_(e)?cv(e):s_(e)&&Ad(e.body)?e:void 0,i=[];if(r){const e=function(e,t){if(t&&178===e.kind){const{setAccessor:n}=hv(t.members,e);if(n)return n.parameters}return e.parameters}(r,n),t=e.length;for(let r=0;re.parent&&tF(e.parent)&&(e.parent.trueType===e||e.parent.falseType===e)))return t.createIdentifier("Object");const r=y(e.typeName),o=t.createTempVariable(n);return t.createConditionalExpression(t.createTypeCheck(t.createAssignment(o,r),"function"),void 0,o,void 0,t.createIdentifier("Object"));case 1:return v(e.typeName);case 2:return t.createVoidZero();case 4:return b("BigInt",7);case 6:return t.createIdentifier("Boolean");case 3:return t.createIdentifier("Number");case 5:return t.createIdentifier("String");case 7:return t.createIdentifier("Array");case 8:return b("Symbol",2);case 10:return t.createIdentifier("Function");case 9:return t.createIdentifier("Promise");case 11:return t.createIdentifier("Object");default:return pn.assertNever(i)}}(e);case 194:return m(e.types,!0);case 193:return m(e.types,!1);case 195:return m([e.trueType,e.falseType],!1);case 199:if(148===e.operator)return p(e.type);break;case 187:case 200:case 201:case 188:case 133:case 159:case 198:case 206:case 313:case 314:case 318:case 319:case 320:break;case 315:case 316:case 317:return p(e.type);default:return pn.failBadSyntaxKind(e)}return t.createIdentifier("Object")}function f(e){switch(e.kind){case 11:case 15:return t.createIdentifier("String");case 225:{const t=e.operand;switch(t.kind){case 9:case 10:return f(t);default:return pn.failBadSyntaxKind(t)}}case 9:return t.createIdentifier("Number");case 10:return b("BigInt",7);case 112:case 97:return t.createIdentifier("Boolean");case 106:return t.createVoidZero();default:return pn.failBadSyntaxKind(e)}}function m(e,n){let r;for(let i of e){if(i=lh(i),146===i.kind){if(n)return t.createVoidZero();continue}if(159===i.kind){if(!n)return t.createIdentifier("Object");continue}if(133===i.kind)return t.createIdentifier("Object");if(!a&&(cF(i)&&106===i.literal.kind||157===i.kind))continue;const e=p(i);if(uD(e)&&"Object"===e.escapedText)return e;if(r){if(!g(r,e))return t.createIdentifier("Object")}else r=e}return r??t.createVoidZero()}function g(e,t){return Gl(e)?Gl(t):uD(e)?uD(t)&&e.escapedText===t.escapedText:hF(e)?hF(t)&&g(e.expression,t.expression)&&g(e.name,t.name):DF(e)?DF(t)&&$N(e.expression)&&"0"===e.expression.text&&$N(t.expression)&&"0"===t.expression.text:KN(e)?KN(t)&&e.text===t.text:NF(e)?NF(t)&&g(e.expression,t.expression):SF(e)?SF(t)&&g(e.expression,t.expression):IF(e)?IF(t)&&g(e.condition,t.condition)&&g(e.whenTrue,t.whenTrue)&&g(e.whenFalse,t.whenFalse):!!AF(e)&&(AF(t)&&e.operatorToken.kind===t.operatorToken.kind&&g(e.left,t.left)&&g(e.right,t.right))}function h(e,n){return t.createLogicalAnd(t.createStrictInequality(t.createTypeOfExpression(e),t.createStringLiteral("undefined")),n)}function y(e){if(80===e.kind){const t=v(e);return h(t,t)}if(80===e.left.kind)return h(v(e.left),v(e));const r=y(e.left),i=t.createTempVariable(n);return t.createLogicalAnd(t.createLogicalAnd(r.left,t.createStrictInequality(t.createAssignment(i,r.right),t.createVoidZero())),t.createPropertyAccessExpression(i,e.right))}function v(e){switch(e.kind){case 80:const n=IT(FI(II.cloneNode(e),e),e.parent);return n.original=void 0,IT(n,hc(s)),n;case 167:return function(e){return t.createPropertyAccessExpression(v(e.left),e.right)}(e)}}function b(e,n){return ogI(e)||ED(e)?void 0:e,b_),f=zb(o),m=function(n){if(i.hasNodeCheckFlag(n,262144)){c||(e.enableSubstitution(80),c=[]);const i=t.createUniqueName(n.name&&!Gl(n.name)?bc(n.name):"default");return c[ez(n)]=i,r(i),i}}(o),h=a<2?t.getInternalName(o,!1,!0):t.getLocalName(o,!1,!0),y=xJ(o.heritageClauses,_,aP);let v=xJ(o.members,_,f_),b=[];({members:v,decorationStatements:b}=p(o,v));const x=a>=9&&!!m&&H(v,e=>AD(e)&&Av(e,256)||LD(e));x&&(v=FI(t.createNodeArray([t.createClassStaticBlockDeclaration(t.createBlock([t.createExpressionStatement(t.createAssignment(m,t.createThis()))])),...v]),v));const k=t.createClassExpression(d,s&&Gl(s)?void 0:s,void 0,y,v);kw(k,o),FI(k,f);const S=m&&!x?t.createAssignment(m,k):k,T=t.createVariableDeclaration(h,void 0,void 0,S);kw(T,o);const C=t.createVariableDeclarationList([T],1),w=t.createVariableStatement(void 0,C);kw(w,o),FI(w,f),Mw(w,o);const N=[w];if(le(N,b),function(e,r){const i=function(e){const r=Cz(e,!0),i=g(r);if(!i)return;const o=c&&c[ez(e)],s=a<2?t.getInternalName(e,!1,!0):t.getDeclarationName(e,!1,!0),l=n().createDecorateHelper(i,s),_=t.createAssignment(s,o?t.createAssignment(o,l):l);return ww(_,3072),Pw(_,zb(e)),_}(r);i&&e.push(kw(t.createExpressionStatement(i),r))}(N,o),l)if(u){const e=t.createExportDefault(h);N.push(e)}else{const e=t.createExternalModuleExport(t.getDeclarationName(o));N.push(e)}return N}(o,o.name):function(e,n){const r=xJ(e.modifiers,l,r_),i=xJ(e.heritageClauses,_,aP);let o=xJ(e.members,_,f_),a=[];({members:o,decorationStatements:a}=p(e,o));const s=t.updateClassDeclaration(e,r,n,void 0,i,o);return le([s],a)}(o,o.name);return Te(s)}(o);case 232:return function(e){return t.updateClassExpression(e,xJ(e.modifiers,l,r_),e.name,void 0,xJ(e.heritageClauses,_,aP),xJ(e.members,_,f_))}(o);case 177:return function(e){return t.updateConstructorDeclaration(e,xJ(e.modifiers,l,r_),xJ(e.parameters,_,FD),bJ(e.body,_,GF))}(o);case 175:return function(e){return f(t.updateMethodDeclaration(e,xJ(e.modifiers,l,r_),e.asteriskToken,pn.checkDefined(bJ(e.name,_,o_)),void 0,void 0,xJ(e.parameters,_,FD),void 0,bJ(e.body,_,GF)),e)}(o);case 179:return function(e){return f(t.updateSetAccessorDeclaration(e,xJ(e.modifiers,l,r_),pn.checkDefined(bJ(e.name,_,o_)),xJ(e.parameters,_,FD),bJ(e.body,_,GF)),e)}(o);case 178:return function(e){return f(t.updateGetAccessorDeclaration(e,xJ(e.modifiers,l,r_),pn.checkDefined(bJ(e.name,_,o_)),xJ(e.parameters,_,FD),void 0,bJ(e.body,_,GF)),e)}(o);case 173:return function(e){if(33554432&e.flags||Av(e,128))return;return f(t.updatePropertyDeclaration(e,xJ(e.modifiers,l,r_),pn.checkDefined(bJ(e.name,_,o_)),void 0,void 0,bJ(e.initializer,_,K_)),e)}(o);case 170:return function(e){const n=t.updateParameterDeclaration(e,hI(t,e.modifiers),e.dotDotDotToken,pn.checkDefined(bJ(e.name,_,a_)),void 0,void 0,bJ(e.initializer,_,K_));n!==e&&(Mw(n,e),FI(n,zb(e)),Pw(n,zb(e)),ww(n.name,64));return n}(o);default:return EJ(o,_,e)}}function u(e){return!!(536870912&e.transformFlags)}function d(e){return H(e,u)}function p(e,n){let r=[];return h(r,e,!1),h(r,e,!0),function(e){for(const t of e.members){if(!PI(t))continue;const n=wz(t,e,!0);if(H(null==n?void 0:n.decorators,u))return!0;if(H(null==n?void 0:n.parameters,d))return!0}return!1}(e)&&(n=FI(t.createNodeArray([...n,t.createClassStaticBlockDeclaration(t.createBlock(r,!0))]),n),r=void 0),{decorationStatements:r,members:n}}function f(e,t){return e!==t&&(Mw(e,t),Pw(e,zb(t))),e}function m(e){return WN(e.expression,"___metadata")}function g(e){if(!e)return;const{false:t,true:n}=Ue(e.decorators,m),r=[];return le(r,P(t,v)),le(r,L(e.parameters,b)),le(r,P(n,v)),r}function h(e,n,r){le(e,P(function(e,t){const n=function(e,t){return D(e.members,n=>{return i=t,ym(!0,r=n,e)&&i===Iv(r);var r,i})}(e,t);let r;for(const t of n)r=ae(r,y(e,t));return r}(n,r),e=>t.createExpressionStatement(e)))}function y(e,r){const i=g(wz(r,e,!0));if(!i)return;const o=function(e,n){return Iv(n)?t.getDeclarationName(e):function(e){return t.createPropertyAccessExpression(t.getDeclarationName(e),"prototype")}(e)}(e,r),a=function(e,n){const r=e.name;return dD(r)?t.createIdentifier(""):ND(r)?n&&!pz(r.expression)?t.getGeneratedNameForNode(r):r.expression:uD(r)?t.createStringLiteral(bc(r)):t.cloneNode(r)}(r,!Av(r,128)),s=AD(r)&&!Rv(r)?t.createVoidZero():t.createNull(),c=n().createDecorateHelper(i,o,a,s);return ww(c,3072),Pw(c,zb(r)),c}function v(e){return pn.checkDefined(bJ(e.expression,_,K_))}function b(e,t){let r;if(e){r=[];for(const i of e){const e=n().createParamHelper(v(i),t);FI(e,i.expression),ww(e,3072),r.push(e)}}return r}}function dq(e){const{factory:t,getEmitHelperFactory:n,startLexicalEnvironment:r,endLexicalEnvironment:i,hoistVariableDeclaration:o}=e,a=Sk(e.getCompilerOptions());let s,c,l,_,u,d;return rz(e,function(t){s=void 0,d=!1;const n=EJ(t,b,e);Kw(n,e.readEmitHelpers()),d&&(Fw(n,32),d=!1);return n});function p(){switch(c=void 0,l=void 0,_=void 0,null==s?void 0:s.kind){case"class":c=s.classInfo;break;case"class-element":c=s.next.classInfo,l=s.classThis,_=s.classSuper;break;case"name":const e=s.next.next.next;"class-element"===(null==e?void 0:e.kind)&&(c=e.next.classInfo,l=e.classThis,_=e.classSuper)}}function f(e){s={kind:"class",next:s,classInfo:e,savedPendingExpressions:u},u=void 0,p()}function m(){pn.assert("class"===(null==s?void 0:s.kind),"Incorrect value for top.kind.",()=>`Expected top.kind to be 'class' but got '${null==s?void 0:s.kind}' instead.`),u=s.savedPendingExpressions,s=s.next,p()}function g(e){var t,n;pn.assert("class"===(null==s?void 0:s.kind),"Incorrect value for top.kind.",()=>`Expected top.kind to be 'class' but got '${null==s?void 0:s.kind}' instead.`),s={kind:"class-element",next:s},(LD(e)||AD(e)&&Ov(e))&&(s.classThis=null==(t=s.next.classInfo)?void 0:t.classThis,s.classSuper=null==(n=s.next.classInfo)?void 0:n.classSuper),p()}function h(){var e;pn.assert("class-element"===(null==s?void 0:s.kind),"Incorrect value for top.kind.",()=>`Expected top.kind to be 'class-element' but got '${null==s?void 0:s.kind}' instead.`),pn.assert("class"===(null==(e=s.next)?void 0:e.kind),"Incorrect value for top.next.kind.",()=>{var e;return`Expected top.next.kind to be 'class' but got '${null==(e=s.next)?void 0:e.kind}' instead.`}),s=s.next,p()}function y(){pn.assert("class-element"===(null==s?void 0:s.kind),"Incorrect value for top.kind.",()=>`Expected top.kind to be 'class-element' but got '${null==s?void 0:s.kind}' instead.`),s={kind:"name",next:s},p()}function v(){pn.assert("name"===(null==s?void 0:s.kind),"Incorrect value for top.kind.",()=>`Expected top.kind to be 'name' but got '${null==s?void 0:s.kind}' instead.`),s=s.next,p()}function b(n){if(!function(e){return!!(33554432&e.transformFlags)||!!l&&!!(16384&e.transformFlags)||!!l&&!!_&&!!(134217728&e.transformFlags)}(n))return n;switch(n.kind){case 171:return pn.fail("Use `modifierVisitor` instead.");case 264:return function(n){if(D(n)){const r=[],i=fc(n,m_)??n,o=i.name?t.createStringLiteralFromNode(i.name):t.createStringLiteral("default"),a=Av(n,32),s=Av(n,2048);if(n.name||(n=Zz(e,n,o)),a&&s){const e=N(n);if(n.name){const i=t.createVariableDeclaration(t.getLocalName(n),void 0,void 0,e);kw(i,n);const o=t.createVariableDeclarationList([i],1),a=t.createVariableStatement(void 0,o);r.push(a);const s=t.createExportDefault(t.getDeclarationName(n));kw(s,n),Mw(s,jw(n)),Pw(s,Jb(n)),r.push(s)}else{const i=t.createExportDefault(e);kw(i,n),Mw(i,jw(n)),Pw(i,Jb(n)),r.push(i)}}else{pn.assertIsDefined(n.name,"A class declaration that is not a default export must have a name.");const e=N(n),i=a?e=>pD(e)?void 0:k(e):k,o=xJ(n.modifiers,i,r_),s=t.getLocalName(n,!1,!0),c=t.createVariableDeclaration(s,void 0,void 0,e);kw(c,n);const l=t.createVariableDeclarationList([c],1),_=t.createVariableStatement(o,l);if(kw(_,n),Mw(_,jw(n)),r.push(_),a){const e=t.createExternalModuleExport(s);kw(e,n),r.push(e)}}return Te(r)}{const e=xJ(n.modifiers,k,r_),r=xJ(n.heritageClauses,b,aP);f(void 0);const i=xJ(n.members,S,f_);return m(),t.updateClassDeclaration(n,e,n.name,void 0,r,i)}}(n);case 232:return function(e){if(D(e)){const t=N(e);return kw(t,e),t}{const n=xJ(e.modifiers,k,r_),r=xJ(e.heritageClauses,b,aP);f(void 0);const i=xJ(e.members,S,f_);return m(),t.updateClassExpression(e,n,e.name,void 0,r,i)}}(n);case 177:case 173:case 176:return pn.fail("Not supported outside of a class. Use 'classElementVisitor' instead.");case 170:return function(n){Zh(n,O)&&(n=tq(e,n,L(n.initializer)));const r=t.updateParameterDeclaration(n,void 0,n.dotDotDotToken,bJ(n.name,b,a_),void 0,void 0,bJ(n.initializer,b,K_));r!==n&&(Mw(r,n),FI(r,zb(n)),Pw(r,zb(n)),ww(r.name,64));return r}(n);case 227:return j(n,!1);case 304:case 261:case 209:return function(t){Zh(t,O)&&(t=tq(e,t,L(t.initializer)));return EJ(t,b,e)}(n);case 278:return function(t){Zh(t,O)&&(t=tq(e,t,L(t.expression)));return EJ(t,b,e)}(n);case 110:return function(e){return l??e}(n);case 249:return function(n){return t.updateForStatement(n,bJ(n.initializer,T,iu),bJ(n.condition,b,K_),bJ(n.incrementor,T,K_),DJ(n.statement,b,e))}(n);case 245:return function(t){return EJ(t,T,e)}(n);case 357:return R(n,!1);case 218:return $(n,!1);case 356:return function(e,n){const r=n?T:b,i=bJ(e.expression,r,K_);return t.updatePartiallyEmittedExpression(e,i)}(n,!1);case 214:return function(n){if(_m(n.expression)&&l){const e=bJ(n.expression,b,K_),r=xJ(n.arguments,b,K_),i=t.createFunctionCallCall(e,l,r);return kw(i,n),FI(i,n),i}return EJ(n,b,e)}(n);case 216:return function(n){if(_m(n.tag)&&l){const e=bJ(n.tag,b,K_),r=t.createFunctionBindCall(e,l,[]);kw(r,n),FI(r,n);const i=bJ(n.template,b,z_);return t.updateTaggedTemplateExpression(n,r,void 0,i)}return EJ(n,b,e)}(n);case 225:case 226:return M(n,!1);case 212:return function(n){if(_m(n)&&uD(n.name)&&l&&_){const e=t.createStringLiteralFromNode(n.name),r=t.createReflectGetCall(_,e,l);return kw(r,n.expression),FI(r,n.expression),r}return EJ(n,b,e)}(n);case 213:return function(n){if(_m(n)&&l&&_){const e=bJ(n.argumentExpression,b,K_),r=t.createReflectGetCall(_,e,l);return kw(r,n.expression),FI(r,n.expression),r}return EJ(n,b,e)}(n);case 168:return J(n);case 175:case 179:case 178:case 219:case 263:{"other"===(null==s?void 0:s.kind)?(pn.assert(!u),s.depth++):(s={kind:"other",next:s,depth:0,savedPendingExpressions:u},u=void 0,p());const t=EJ(n,x,e);return pn.assert("other"===(null==s?void 0:s.kind),"Incorrect value for top.kind.",()=>`Expected top.kind to be 'other' but got '${null==s?void 0:s.kind}' instead.`),s.depth>0?(pn.assert(!u),s.depth--):(u=s.savedPendingExpressions,s=s.next,p()),t}default:return EJ(n,x,e)}}function x(e){if(171!==e.kind)return b(e)}function k(e){if(171!==e.kind)return e}function S(a){switch(a.kind){case 177:return function(e){g(e);const n=xJ(e.modifiers,k,r_),r=xJ(e.parameters,b,FD);let i;if(e.body&&c){const n=F(c.class,c);if(n){const r=[],o=t.copyPrologue(e.body.statements,r,!1,b),a=yz(e.body.statements,o);a.length>0?E(r,e.body.statements,o,a,0,n):(le(r,n),le(r,xJ(e.body.statements,b,hu))),i=t.createBlock(r,!0),kw(i,e.body),FI(i,e.body)}}return i??(i=bJ(e.body,b,GF)),h(),t.updateConstructorDeclaration(e,n,r,i)}(a);case 175:return function(e){g(e);const{modifiers:n,name:r,descriptorName:i}=I(e,c,ee);if(i)return h(),A(function(e,n,r){return e=xJ(e,e=>vD(e)?e:void 0,r_),t.createGetAccessorDeclaration(e,n,[],void 0,t.createBlock([t.createReturnStatement(t.createPropertyAccessExpression(r,t.createIdentifier("value")))]))}(n,r,i),e);{const i=xJ(e.parameters,b,FD),o=bJ(e.body,b,GF);return h(),A(t.updateMethodDeclaration(e,n,e.asteriskToken,r,void 0,void 0,i,void 0,o),e)}}(a);case 178:return function(e){g(e);const{modifiers:n,name:r,descriptorName:i}=I(e,c,te);if(i)return h(),A(ie(n,r,i),e);{const i=xJ(e.parameters,b,FD),o=bJ(e.body,b,GF);return h(),A(t.updateGetAccessorDeclaration(e,n,r,i,void 0,o),e)}}(a);case 179:return function(e){g(e);const{modifiers:n,name:r,descriptorName:i}=I(e,c,ne);if(i)return h(),A(oe(n,r,i),e);{const i=xJ(e.parameters,b,FD),o=bJ(e.body,b,GF);return h(),A(t.updateSetAccessorDeclaration(e,n,r,i,o),e)}}(a);case 173:return function(a){Zh(a,O)&&(a=tq(e,a,L(a.initializer)));g(a),pn.assert(!Sp(a),"Not yet implemented.");const{modifiers:s,name:l,initializersName:_,extraInitializersName:u,descriptorName:d,thisArg:p}=I(a,c,Rv(a)?re:void 0);r();let f=bJ(a.initializer,b,K_);_&&(f=n().createRunInitializersHelper(p??t.createThis(),_,f??t.createVoidZero()));Iv(a)&&c&&f&&(c.hasStaticInitializers=!0);const m=i();H(m)&&(f=t.createImmediatelyInvokedArrowFunction([...m,t.createReturnStatement(f)]));c&&(Iv(a)?(f=X(c,!0,f),u&&(c.pendingStaticInitializers??(c.pendingStaticInitializers=[]),c.pendingStaticInitializers.push(n().createRunInitializersHelper(c.classThis??t.createThis(),u)))):(f=X(c,!1,f),u&&(c.pendingInstanceInitializers??(c.pendingInstanceInitializers=[]),c.pendingInstanceInitializers.push(n().createRunInitializersHelper(t.createThis(),u)))));if(h(),Rv(a)&&d){const e=jw(a),n=Ew(a),r=a.name;let i=r,c=r;if(ND(r)&&!pz(r.expression)){const e=CI(r);if(e)i=t.updateComputedPropertyName(r,bJ(r.expression,b,K_)),c=t.updateComputedPropertyName(r,e.left);else{const e=t.createTempVariable(o);Pw(e,r.expression);const n=bJ(r.expression,b,K_),a=t.createAssignment(e,n);Pw(a,r.expression),i=t.updateComputedPropertyName(r,a),c=t.updateComputedPropertyName(r,e)}}const l=xJ(s,e=>129!==e.kind?e:void 0,r_),_=kI(t,a,l,f);kw(_,a),ww(_,3072),Pw(_,n),Pw(_.name,a.name);const u=ie(l,i,d);kw(u,a),Mw(u,e),Pw(u,n);const p=oe(l,c,d);return kw(p,a),ww(p,3072),Pw(p,n),[_,u,p]}return A(t.updatePropertyDeclaration(a,s,l,void 0,void 0,f),a)}(a);case 176:return function(n){let r;if(g(n),Xz(n))r=EJ(n,b,e);else if(Wz(n)){const t=l;l=void 0,r=EJ(n,b,e),l=t}else if(r=n=EJ(n,b,e),c&&(c.hasStaticInitializers=!0,H(c.pendingStaticInitializers))){const e=[];for(const n of c.pendingStaticInitializers){const r=t.createExpressionStatement(n);Pw(r,Ew(n)),e.push(r)}const n=t.createBlock(e,!0);r=[t.createClassStaticBlockDeclaration(n),r],c.pendingStaticInitializers=void 0}return h(),r}(a);default:return b(a)}}function T(e){switch(e.kind){case 225:case 226:return M(e,!0);case 227:return j(e,!0);case 357:return R(e,!0);case 218:return $(e,!0);default:return b(e)}}function C(e,n){return t.createUniqueName(`${function(e){let t=e.name&&uD(e.name)&&!Gl(e.name)?bc(e.name):e.name&&dD(e.name)&&!Gl(e.name)?bc(e.name).slice(1):e.name&&KN(e.name)&&vs(e.name.text,99)?e.name.text:m_(e)?"class":"member";return Pu(e)&&(t=`get_${t}`),Eu(e)&&(t=`set_${t}`),e.name&&dD(e.name)&&(t=`private_${t}`),Iv(e)&&(t=`static_${t}`),"_"+t}(e)}_${n}`,24)}function w(e,n){return t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(e,void 0,void 0,n)],1))}function N(o){r(),!Yz(o)&&bm(!1,o)&&(o=Zz(e,o,t.createStringLiteral("")));const a=t.getLocalName(o,!1,!1,!0),s=function(e){const r=t.createUniqueName("_metadata",48);let i,o,a,s,c,l=!1,_=!1,u=!1;if(hm(!1,e)){const n=H(e.members,e=>(Yl(e)||h_(e))&&Ov(e));a=t.createUniqueName("_classThis",n?24:48)}for(const r of e.members){if(v_(r)&&ym(!1,r,e))if(Ov(r)){if(!o){o=t.createUniqueName("_staticExtraInitializers",48);const r=n().createRunInitializersHelper(a??t.createThis(),o);Pw(r,e.name??Jb(e)),s??(s=[]),s.push(r)}}else{if(!i){i=t.createUniqueName("_instanceExtraInitializers",48);const r=n().createRunInitializersHelper(t.createThis(),i);Pw(r,e.name??Jb(e)),c??(c=[]),c.push(r)}i??(i=t.createUniqueName("_instanceExtraInitializers",48))}if(LD(r)?Xz(r)||(l=!0):AD(r)&&(Ov(r)?l||(l=!!r.initializer||Jv(r)):_||(_=!Sp(r))),(Yl(r)||h_(r))&&Ov(r)&&(u=!0),o&&i&&l&&_&&u)break}return{class:e,classThis:a,metadataReference:r,instanceMethodExtraInitializersName:i,staticMethodExtraInitializersName:o,hasStaticInitializers:l,hasNonAmbientInstanceFields:_,hasStaticPrivateClassElements:u,pendingStaticInitializers:s,pendingInstanceInitializers:c}}(o),c=[];let l,_,p,g,h=!1;const y=Q(Cz(o,!1));y&&(s.classDecoratorsName=t.createUniqueName("_classDecorators",48),s.classDescriptorName=t.createUniqueName("_classDescriptor",48),s.classExtraInitializersName=t.createUniqueName("_classExtraInitializers",48),pn.assertIsDefined(s.classThis),c.push(w(s.classDecoratorsName,t.createArrayLiteralExpression(y)),w(s.classDescriptorName),w(s.classExtraInitializersName,t.createArrayLiteralExpression()),w(s.classThis)),s.hasStaticPrivateClassElements&&(h=!0,d=!0));const v=Nh(o.heritageClauses,96),x=v&&ge(v.types),k=x&&bJ(x.expression,b,K_);if(k){s.classSuper=t.createUniqueName("_classSuper",48);const e=AA(k),n=MF(e)&&!e.name||TF(e)&&!e.name||CF(e)?t.createComma(t.createNumericLiteral(0),k):k;c.push(w(s.classSuper,n));const r=t.updateExpressionWithTypeArguments(x,s.classSuper,void 0),i=t.updateHeritageClause(v,[r]);g=t.createNodeArray([i])}const T=s.classThis??t.createThis();f(s),l=ae(l,function(e,n){const r=t.createVariableDeclaration(e,void 0,void 0,t.createConditionalExpression(t.createLogicalAnd(t.createTypeCheck(t.createIdentifier("Symbol"),"function"),t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata")),t.createToken(58),t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[n?se(n):t.createNull()]),t.createToken(59),t.createVoidZero()));return t.createVariableStatement(void 0,t.createVariableDeclarationList([r],2))}(s.metadataReference,s.classSuper));let C=o.members;if(C=xJ(C,e=>jD(e)?e:S(e),f_),C=xJ(C,e=>jD(e)?S(e):e,f_),u){let n;for(let r of u){r=bJ(r,function r(i){return 16384&i.transformFlags?110===i.kind?(n||(n=t.createUniqueName("_outerThis",16),c.unshift(w(n,t.createThis()))),n):EJ(i,r,e):i},K_);l=ae(l,t.createExpressionStatement(r))}u=void 0}if(m(),H(s.pendingInstanceInitializers)&&!cv(o)){const e=F(o,s);if(e){const n=kh(o),r=[];if(!(!n||106===AA(n.expression).kind)){const e=t.createSpreadElement(t.createIdentifier("arguments")),n=t.createCallExpression(t.createSuper(),void 0,[e]);r.push(t.createExpressionStatement(n))}le(r,e);const i=t.createBlock(r,!0);p=t.createConstructorDeclaration(void 0,[],i)}}if(s.staticMethodExtraInitializersName&&c.push(w(s.staticMethodExtraInitializersName,t.createArrayLiteralExpression())),s.instanceMethodExtraInitializersName&&c.push(w(s.instanceMethodExtraInitializersName,t.createArrayLiteralExpression())),s.memberInfos&&sd(s.memberInfos,(e,n)=>{Iv(n)&&(c.push(w(e.memberDecoratorsName)),e.memberInitializersName&&c.push(w(e.memberInitializersName,t.createArrayLiteralExpression())),e.memberExtraInitializersName&&c.push(w(e.memberExtraInitializersName,t.createArrayLiteralExpression())),e.memberDescriptorName&&c.push(w(e.memberDescriptorName)))}),s.memberInfos&&sd(s.memberInfos,(e,n)=>{Iv(n)||(c.push(w(e.memberDecoratorsName)),e.memberInitializersName&&c.push(w(e.memberInitializersName,t.createArrayLiteralExpression())),e.memberExtraInitializersName&&c.push(w(e.memberExtraInitializersName,t.createArrayLiteralExpression())),e.memberDescriptorName&&c.push(w(e.memberDescriptorName)))}),l=le(l,s.staticNonFieldDecorationStatements),l=le(l,s.nonStaticNonFieldDecorationStatements),l=le(l,s.staticFieldDecorationStatements),l=le(l,s.nonStaticFieldDecorationStatements),s.classDescriptorName&&s.classDecoratorsName&&s.classExtraInitializersName&&s.classThis){l??(l=[]);const e=t.createPropertyAssignment("value",T),r=t.createObjectLiteralExpression([e]),i=t.createAssignment(s.classDescriptorName,r),c=t.createPropertyAccessExpression(T,"name"),_=n().createESDecorateHelper(t.createNull(),i,s.classDecoratorsName,{kind:"class",name:c,metadata:s.metadataReference},t.createNull(),s.classExtraInitializersName),u=t.createExpressionStatement(_);Pw(u,Jb(o)),l.push(u);const d=t.createPropertyAccessExpression(s.classDescriptorName,"value"),p=t.createAssignment(s.classThis,d),f=t.createAssignment(a,p);l.push(t.createExpressionStatement(f))}if(l.push(function(e,n){const r=t.createObjectDefinePropertyCall(e,t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata"),t.createPropertyDescriptor({configurable:!0,writable:!0,enumerable:!0,value:n},!0));return ww(t.createIfStatement(n,t.createExpressionStatement(r)),1)}(T,s.metadataReference)),H(s.pendingStaticInitializers)){for(const e of s.pendingStaticInitializers){const n=t.createExpressionStatement(e);Pw(n,Ew(e)),_=ae(_,n)}s.pendingStaticInitializers=void 0}if(s.classExtraInitializersName){const e=n().createRunInitializersHelper(T,s.classExtraInitializersName),r=t.createExpressionStatement(e);Pw(r,o.name??Jb(o)),_=ae(_,r)}l&&_&&!s.hasStaticInitializers&&(le(l,_),_=void 0);const N=l&&t.createClassStaticBlockDeclaration(t.createBlock(l,!0));N&&h&&Dw(N,32);const D=_&&t.createClassStaticBlockDeclaration(t.createBlock(_,!0));if(N||p||D){const e=[],n=C.findIndex(Xz);N?(le(e,C,0,n+1),e.push(N),le(e,C,n+1)):le(e,C),p&&e.push(p),D&&e.push(D),C=FI(t.createNodeArray(e),C)}const E=i();let P;if(y){P=t.createClassExpression(void 0,void 0,void 0,g,C),s.classThis&&(P=Hz(t,P,s.classThis));const e=t.createVariableDeclaration(a,void 0,void 0,P),n=t.createVariableDeclarationList([e]),r=s.classThis?t.createAssignment(a,s.classThis):a;c.push(t.createVariableStatement(void 0,n),t.createReturnStatement(r))}else P=t.createClassExpression(void 0,o.name,void 0,g,C),c.push(t.createReturnStatement(P));if(h){Fw(P,32);for(const e of P.members)(Yl(e)||h_(e))&&Ov(e)&&Fw(e,32)}return kw(P,o),t.createImmediatelyInvokedArrowFunction(t.mergeLexicalEnvironment(c,E))}function D(e){return bm(!1,e)||vm(!1,e)}function F(e,n){if(H(n.pendingInstanceInitializers)){const e=[];return e.push(t.createExpressionStatement(t.inlineExpressions(n.pendingInstanceInitializers))),n.pendingInstanceInitializers=void 0,e}}function E(e,n,r,i,o,a){const s=i[o],c=n[s];if(le(e,xJ(n,b,hu,r,s-r)),dE(c)){const n=[];E(n,c.tryBlock.statements,0,i,o+1,a);FI(t.createNodeArray(n),c.tryBlock.statements),e.push(t.updateTryStatement(c,t.updateBlock(c.tryBlock,n),bJ(c.catchClause,b,sP),bJ(c.finallyBlock,b,GF)))}else le(e,xJ(n,b,hu,s,1)),le(e,a);le(e,xJ(n,b,hu,s+1))}function A(e,t){return e!==t&&(Mw(e,t),Pw(e,Jb(t))),e}function I(e,r,i){let a,s,c,l,_,d;if(!r){const t=xJ(e.modifiers,k,r_);return y(),s=B(e.name),v(),{modifiers:t,referencedName:a,name:s,initializersName:c,descriptorName:d,thisArg:_}}const p=Q(wz(e,r.class,!1)),f=xJ(e.modifiers,k,r_);if(p){const m=C(e,"decorators"),g=t.createArrayLiteralExpression(p),h=t.createAssignment(m,g),x={memberDecoratorsName:m};r.memberInfos??(r.memberInfos=new Map),r.memberInfos.set(e,x),u??(u=[]),u.push(h);const k=v_(e)||h_(e)?Iv(e)?r.staticNonFieldDecorationStatements??(r.staticNonFieldDecorationStatements=[]):r.nonStaticNonFieldDecorationStatements??(r.nonStaticNonFieldDecorationStatements=[]):AD(e)&&!h_(e)?Iv(e)?r.staticFieldDecorationStatements??(r.staticFieldDecorationStatements=[]):r.nonStaticFieldDecorationStatements??(r.nonStaticFieldDecorationStatements=[]):pn.fail(),S=MD(e)?"getter":RD(e)?"setter":OD(e)?"method":h_(e)?"accessor":AD(e)?"field":pn.fail();let T;if(uD(e.name)||dD(e.name))T={computed:!1,name:e.name};else if(Wh(e.name))T={computed:!0,name:t.createStringLiteralFromNode(e.name)};else{const r=e.name.expression;Wh(r)&&!uD(r)?T={computed:!0,name:t.createStringLiteralFromNode(r)}:(y(),({referencedName:a,name:s}=function(e){if(Wh(e)||dD(e)){return{referencedName:t.createStringLiteralFromNode(e),name:bJ(e,b,o_)}}if(Wh(e.expression)&&!uD(e.expression)){return{referencedName:t.createStringLiteralFromNode(e.expression),name:bJ(e,b,o_)}}const r=t.getGeneratedNameForNode(e);o(r);const i=n().createPropKeyHelper(bJ(e.expression,b,K_)),a=t.createAssignment(r,i),s=t.updateComputedPropertyName(e,G(a));return{referencedName:r,name:s}}(e.name)),T={computed:!0,name:a},v())}const w={kind:S,name:T,static:Iv(e),private:dD(e.name),access:{get:AD(e)||MD(e)||OD(e),set:AD(e)||RD(e)},metadata:r.metadataReference};if(v_(e)){const o=Iv(e)?r.staticMethodExtraInitializersName:r.instanceMethodExtraInitializersName;let a;pn.assertIsDefined(o),Yl(e)&&i&&(a=i(e,xJ(f,e=>rt(e,mD),r_)),x.memberDescriptorName=d=C(e,"descriptor"),a=t.createAssignment(d,a));const s=n().createESDecorateHelper(t.createThis(),a??t.createNull(),m,w,t.createNull(),o),c=t.createExpressionStatement(s);Pw(c,Jb(e)),k.push(c)}else if(AD(e)){let o;c=x.memberInitializersName??(x.memberInitializersName=C(e,"initializers")),l=x.memberExtraInitializersName??(x.memberExtraInitializersName=C(e,"extraInitializers")),Iv(e)&&(_=r.classThis),Yl(e)&&Rv(e)&&i&&(o=i(e,void 0),x.memberDescriptorName=d=C(e,"descriptor"),o=t.createAssignment(d,o));const a=n().createESDecorateHelper(h_(e)?t.createThis():t.createNull(),o??t.createNull(),m,w,c,l),s=t.createExpressionStatement(a);Pw(s,Jb(e)),k.push(s)}}return void 0===s&&(y(),s=B(e.name),v()),H(f)||!OD(e)&&!AD(e)||ww(s,1024),{modifiers:f,referencedName:a,name:s,initializersName:c,extraInitializersName:l,descriptorName:d,thisArg:_}}function O(e){return MF(e)&&!e.name&&D(e)}function L(e){const t=AA(e);return MF(t)&&!t.name&&!bm(!1,t)}function j(n,r){if(lb(n)){const e=W(n.left),r=bJ(n.right,b,K_);return t.updateBinaryExpression(n,e,n.operatorToken,r)}if(cb(n)){if(Zh(n,O))return EJ(n=tq(e,n,L(n.right)),b,e);if(_m(n.left)&&l&&_){let e=yF(n.left)?bJ(n.left.argumentExpression,b,K_):uD(n.left.name)?t.createStringLiteralFromNode(n.left.name):void 0;if(e){let i=bJ(n.right,b,K_);if(fz(n.operatorToken.kind)){let r=e;pz(e)||(r=t.createTempVariable(o),e=t.createAssignment(r,e));const a=t.createReflectGetCall(_,r,l);kw(a,n.left),FI(a,n.left),i=t.createBinaryExpression(a,mz(n.operatorToken.kind),i),FI(i,n)}const a=r?void 0:t.createTempVariable(o);return a&&(i=t.createAssignment(a,i),FI(a,n)),i=t.createReflectSetCall(_,e,i,l),kw(i,n),FI(i,n),a&&(i=t.createComma(i,a),FI(i,n)),i}}}if(28===n.operatorToken.kind){const e=bJ(n.left,T,K_),i=bJ(n.right,r?T:b,K_);return t.updateBinaryExpression(n,e,n.operatorToken,i)}return EJ(n,b,e)}function M(n,r){if(46===n.operator||47===n.operator){const e=_h(n.operand);if(_m(e)&&l&&_){let i=yF(e)?bJ(e.argumentExpression,b,K_):uD(e.name)?t.createStringLiteralFromNode(e.name):void 0;if(i){let e=i;pz(i)||(e=t.createTempVariable(o),i=t.createAssignment(e,i));let a=t.createReflectGetCall(_,e,l);kw(a,n),FI(a,n);const s=r?void 0:t.createTempVariable(o);return a=bA(t,n,a,o,s),a=t.createReflectSetCall(_,i,a,l),kw(a,n),FI(a,n),s&&(a=t.createComma(a,s),FI(a,n)),a}}}return EJ(n,b,e)}function R(e,n){const r=n?FJ(e.elements,T):FJ(e.elements,b,T);return t.updateCommaListExpression(e,r)}function B(e){return ND(e)?J(e):bJ(e,b,o_)}function J(e){let n=bJ(e.expression,b,K_);return pz(n)||(n=G(n)),t.updateComputedPropertyName(e,n)}function z(n){if(gF(n)||mF(n))return W(n);if(_m(n)&&l&&_){const e=yF(n)?bJ(n.argumentExpression,b,K_):uD(n.name)?t.createStringLiteralFromNode(n.name):void 0;if(e){const r=t.createTempVariable(void 0),i=t.createAssignmentTargetWrapper(r,t.createReflectSetCall(_,e,r,l));return kw(i,n),FI(i,n),i}}return EJ(n,b,e)}function q(n){if(cb(n,!0)){Zh(n,O)&&(n=tq(e,n,L(n.right)));const r=z(n.left),i=bJ(n.right,b,K_);return t.updateBinaryExpression(n,r,n.operatorToken,i)}return z(n)}function U(n){return pn.assertNode(n,L_),jF(n)?function(n){if(q_(n.expression)){const e=z(n.expression);return t.updateSpreadElement(n,e)}return EJ(n,b,e)}(n):RF(n)?EJ(n,b,e):q(n)}function V(n){return pn.assertNode(n,I_),_P(n)?function(n){if(q_(n.expression)){const e=z(n.expression);return t.updateSpreadAssignment(n,e)}return EJ(n,b,e)}(n):lP(n)?function(t){return Zh(t,O)&&(t=tq(e,t,L(t.objectAssignmentInitializer))),EJ(t,b,e)}(n):cP(n)?function(n){const r=bJ(n.name,b,o_);if(cb(n.initializer,!0)){const e=q(n.initializer);return t.updatePropertyAssignment(n,r,e)}if(q_(n.initializer)){const e=z(n.initializer);return t.updatePropertyAssignment(n,r,e)}return EJ(n,b,e)}(n):EJ(n,b,e)}function W(e){if(mF(e)){const n=xJ(e.elements,U,K_);return t.updateArrayLiteralExpression(e,n)}{const n=xJ(e.properties,V,S_);return t.updateObjectLiteralExpression(e,n)}}function $(e,n){const r=n?T:b,i=bJ(e.expression,r,K_);return t.updateParenthesizedExpression(e,i)}function K(e,n){return H(e)&&(n?SF(n)?(e.push(n.expression),n=t.updateParenthesizedExpression(n,t.inlineExpressions(e))):(e.push(n),n=t.inlineExpressions(e)):n=t.inlineExpressions(e)),n}function G(e){const t=K(u,e);return pn.assertIsDefined(t),t!==e&&(u=void 0),t}function X(e,t,n){const r=K(t?e.pendingStaticInitializers:e.pendingInstanceInitializers,n);return r!==n&&(t?e.pendingStaticInitializers=void 0:e.pendingInstanceInitializers=void 0),r}function Q(e){if(!e)return;const t=[];return le(t,P(e.decorators,Y)),t}function Y(e){const n=bJ(e.expression,b,K_);ww(n,3072);if(Dx(AA(n))){const{target:e,thisArg:r}=t.createCallBinding(n,o,a,!0);return t.restoreOuterExpressions(n,t.createFunctionBindCall(e,r,[]))}return n}function Z(e,r,i,o,a,s,c){const l=t.createFunctionExpression(i,o,void 0,void 0,s,void 0,c??t.createBlock([]));kw(l,e),Pw(l,Jb(e)),ww(l,3072);const _="get"===a||"set"===a?a:void 0,u=t.createStringLiteralFromNode(r,void 0),d=n().createSetFunctionNameHelper(l,u,_),p=t.createPropertyAssignment(t.createIdentifier(a),d);return kw(p,e),Pw(p,Jb(e)),ww(p,3072),p}function ee(e,n){return t.createObjectLiteralExpression([Z(e,e.name,n,e.asteriskToken,"value",xJ(e.parameters,b,FD),bJ(e.body,b,GF))])}function te(e,n){return t.createObjectLiteralExpression([Z(e,e.name,n,void 0,"get",[],bJ(e.body,b,GF))])}function ne(e,n){return t.createObjectLiteralExpression([Z(e,e.name,n,void 0,"set",xJ(e.parameters,b,FD),bJ(e.body,b,GF))])}function re(e,n){return t.createObjectLiteralExpression([Z(e,e.name,n,void 0,"get",[],t.createBlock([t.createReturnStatement(t.createPropertyAccessExpression(t.createThis(),t.getGeneratedPrivateNameForNode(e.name)))])),Z(e,e.name,n,void 0,"set",[t.createParameterDeclaration(void 0,void 0,"value")],t.createBlock([t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createThis(),t.getGeneratedPrivateNameForNode(e.name)),t.createIdentifier("value")))]))])}function ie(e,n,r){return e=xJ(e,e=>vD(e)?e:void 0,r_),t.createGetAccessorDeclaration(e,n,[],void 0,t.createBlock([t.createReturnStatement(t.createFunctionCallCall(t.createPropertyAccessExpression(r,t.createIdentifier("get")),t.createThis(),[]))]))}function oe(e,n,r){return e=xJ(e,e=>vD(e)?e:void 0,r_),t.createSetAccessorDeclaration(e,n,[t.createParameterDeclaration(void 0,void 0,"value")],t.createBlock([t.createReturnStatement(t.createFunctionCallCall(t.createPropertyAccessExpression(r,t.createIdentifier("set")),t.createThis(),[t.createIdentifier("value")]))]))}function se(e){return t.createBinaryExpression(t.createElementAccessExpression(e,t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata")),61,t.createNull())}}function pq(e){const{factory:t,getEmitHelperFactory:n,resumeLexicalEnvironment:r,endLexicalEnvironment:i,hoistVariableDeclaration:o}=e,a=e.getEmitResolver(),s=e.getCompilerOptions(),c=Sk(s);let l,_,u,d,f=0,m=0;const g=[];let h=0;const y=e.onEmitNode,v=e.onSubstituteNode;return e.onEmitNode=function(e,t,n){if(1&f&&function(e){const t=e.kind;return 264===t||177===t||175===t||178===t||179===t}(t)){const r=(a.hasNodeCheckFlag(t,128)?128:0)|(a.hasNodeCheckFlag(t,256)?256:0);if(r!==m){const i=m;return m=r,y(e,t,n),void(m=i)}}else if(f&&g[_J(t)]){const r=m;return m=0,y(e,t,n),void(m=r)}y(e,t,n)},e.onSubstituteNode=function(e,n){if(n=v(e,n),1===e&&m)return function(e){switch(e.kind){case 212:return $(e);case 213:return H(e);case 214:return function(e){const n=e.expression;if(_m(n)){const r=hF(n)?$(n):H(n);return t.createCallExpression(t.createPropertyAccessExpression(r,"call"),void 0,[t.createThis(),...e.arguments])}return e}(e)}return e}(n);return n},rz(e,function(t){if(t.isDeclarationFile)return t;b(1,!1),b(2,!kp(t,s));const n=EJ(t,C,e);return Kw(n,e.readEmitHelpers()),n});function b(e,t){h=t?h|e:h&~e}function x(e){return 0!==(h&e)}function k(e,t,n){const r=e&~h;if(r){b(r,!0);const e=t(n);return b(r,!1),e}return t(n)}function S(t){return EJ(t,C,e)}function T(t){switch(t.kind){case 219:case 263:case 175:case 178:case 179:case 177:return t;case 170:case 209:case 261:break;case 80:if(d&&a.isArgumentsLocalBinding(t))return d}return EJ(t,T,e)}function C(n){if(!(256&n.transformFlags))return d?T(n):n;switch(n.kind){case 134:return;case 224:return function(n){if(!x(1))return EJ(n,C,e);return kw(FI(t.createYieldExpression(void 0,bJ(n.expression,C,K_)),n),n)}(n);case 175:return k(3,D,n);case 263:return k(3,A,n);case 219:return k(3,I,n);case 220:return k(1,O,n);case 212:return _&&hF(n)&&108===n.expression.kind&&_.add(n.name.escapedText),EJ(n,C,e);case 213:return _&&108===n.expression.kind&&(u=!0),EJ(n,C,e);case 178:return k(3,F,n);case 179:return k(3,E,n);case 177:return k(3,N,n);case 264:case 232:return k(3,S,n);default:return EJ(n,C,e)}}function w(n){if(rh(n))switch(n.kind){case 244:return function(n){if(j(n.declarationList)){const e=M(n.declarationList,!1);return e?t.createExpressionStatement(e):void 0}return EJ(n,C,e)}(n);case 249:return function(n){const r=n.initializer;return t.updateForStatement(n,j(r)?M(r,!1):bJ(n.initializer,C,iu),bJ(n.condition,C,K_),bJ(n.incrementor,C,K_),DJ(n.statement,w,e))}(n);case 250:return function(n){return t.updateForInStatement(n,j(n.initializer)?M(n.initializer,!0):pn.checkDefined(bJ(n.initializer,C,iu)),pn.checkDefined(bJ(n.expression,C,K_)),DJ(n.statement,w,e))}(n);case 251:return function(n){return t.updateForOfStatement(n,bJ(n.awaitModifier,C,hD),j(n.initializer)?M(n.initializer,!0):pn.checkDefined(bJ(n.initializer,C,iu)),pn.checkDefined(bJ(n.expression,C,K_)),DJ(n.statement,w,e))}(n);case 300:return function(t){const n=new Set;let r;if(L(t.variableDeclaration,n),n.forEach((e,t)=>{l.has(t)&&(r||(r=new Set(l)),r.delete(t))}),r){const n=l;l=r;const i=EJ(t,w,e);return l=n,i}return EJ(t,w,e)}(n);case 242:case 256:case 270:case 297:case 298:case 259:case 247:case 248:case 246:case 255:case 257:return EJ(n,w,e);default:return pn.assertNever(n,"Unhandled node.")}return C(n)}function N(n){const r=d;d=void 0;const i=t.updateConstructorDeclaration(n,xJ(n.modifiers,C,r_),CJ(n.parameters,C,e),z(n));return d=r,i}function D(n){let r;const i=Rh(n),o=d;d=void 0;const a=t.updateMethodDeclaration(n,xJ(n.modifiers,C,b_),n.asteriskToken,n.name,void 0,void 0,r=2&i?U(n):CJ(n.parameters,C,e),void 0,2&i?V(n,r):z(n));return d=o,a}function F(n){const r=d;d=void 0;const i=t.updateGetAccessorDeclaration(n,xJ(n.modifiers,C,b_),n.name,CJ(n.parameters,C,e),void 0,z(n));return d=r,i}function E(n){const r=d;d=void 0;const i=t.updateSetAccessorDeclaration(n,xJ(n.modifiers,C,b_),n.name,CJ(n.parameters,C,e),z(n));return d=r,i}function A(n){let r;const i=d;d=void 0;const o=Rh(n),a=t.updateFunctionDeclaration(n,xJ(n.modifiers,C,b_),n.asteriskToken,n.name,void 0,r=2&o?U(n):CJ(n.parameters,C,e),void 0,2&o?V(n,r):NJ(n.body,C,e));return d=i,a}function I(n){let r;const i=d;d=void 0;const o=Rh(n),a=t.updateFunctionExpression(n,xJ(n.modifiers,C,r_),n.asteriskToken,n.name,void 0,r=2&o?U(n):CJ(n.parameters,C,e),void 0,2&o?V(n,r):NJ(n.body,C,e));return d=i,a}function O(n){let r;const i=Rh(n);return t.updateArrowFunction(n,xJ(n.modifiers,C,r_),void 0,r=2&i?U(n):CJ(n.parameters,C,e),void 0,n.equalsGreaterThanToken,2&i?V(n,r):NJ(n.body,C,e))}function L({name:e},t){if(uD(e))t.add(e.escapedText);else for(const n of e.elements)RF(n)||L(n,t)}function j(e){return!!e&&mE(e)&&!(7&e.flags)&&e.declarations.some(J)}function M(e,n){!function(e){p(e.declarations,R)}(e);const r=ix(e);return 0===r.length?n?bJ(t.converters.convertToAssignmentElementTarget(e.declarations[0].name),C,K_):void 0:t.inlineExpressions(P(r,B))}function R({name:e}){if(uD(e))o(e);else for(const t of e.elements)RF(t)||R(t)}function B(e){const n=Pw(t.createAssignment(t.converters.convertToAssignmentElementTarget(e.name),e.initializer),e);return pn.checkDefined(bJ(n,C,K_))}function J({name:e}){if(uD(e))return l.has(e.escapedText);for(const t of e.elements)if(!RF(t)&&J(t))return!0;return!1}function z(n){pn.assertIsDefined(n.body);const r=_,i=u;_=new Set,u=!1;let o=NJ(n.body,C,e);const s=fc(n,l_);if(c>=2&&(a.hasNodeCheckFlag(n,256)||a.hasNodeCheckFlag(n,128))&&!!(3&~Rh(s))){if(W(),_.size){const e=fq(t,a,n,_);g[_J(e)]=!0;const r=o.statements.slice();Rd(r,[e]),o=t.updateBlock(o,r)}u&&(a.hasNodeCheckFlag(n,256)?Hw(o,VN):a.hasNodeCheckFlag(n,128)&&Hw(o,UN))}return _=r,u=i,o}function q(){pn.assert(d);const e=t.createVariableDeclaration(d,void 0,void 0,t.createIdentifier("arguments")),n=t.createVariableStatement(void 0,[e]);return OA(n),Nw(n,2097152),n}function U(n){if(Iz(n.parameters))return CJ(n.parameters,C,e);const r=[];for(const e of n.parameters){if(e.initializer||e.dotDotDotToken){if(220===n.kind){const e=t.createParameterDeclaration(void 0,t.createToken(26),t.createUniqueName("args",8));r.push(e)}break}const i=t.createParameterDeclaration(void 0,void 0,t.getGeneratedNameForNode(e.name,8));r.push(i)}const i=t.createNodeArray(r);return FI(i,n.parameters),i}function V(o,s){const p=Iz(o.parameters)?void 0:CJ(o.parameters,C,e);r();const f=fc(o,s_).type,m=c<2?function(e){const t=e&&fm(e);if(t&&i_(t)){const e=a.getTypeReferenceSerializationKind(t);if(1===e||0===e)return t}return}(f):void 0,h=220===o.kind,y=d,v=a.hasNodeCheckFlag(o,512)&&!d;let b;if(v&&(d=t.createUniqueName("arguments")),p)if(h){const e=[];pn.assert(s.length<=o.parameters.length);for(let n=0;n=2&&(a.hasNodeCheckFlag(o,256)||a.hasNodeCheckFlag(o,128));if(r&&(W(),_.size)){const n=fq(t,a,o,_);g[_J(n)]=!0,Rd(e,[n])}v&&Rd(e,[q()]);const i=t.createBlock(e,!0);FI(i,o.body),r&&u&&(a.hasNodeCheckFlag(o,256)?Hw(i,VN):a.hasNodeCheckFlag(o,128)&&Hw(i,UN)),P=i}return l=k,h||(_=S,u=T,d=y),P}function W(){1&f||(f|=1,e.enableSubstitution(214),e.enableSubstitution(212),e.enableSubstitution(213),e.enableEmitNotification(264),e.enableEmitNotification(175),e.enableEmitNotification(178),e.enableEmitNotification(179),e.enableEmitNotification(177),e.enableEmitNotification(244))}function $(e){return 108===e.expression.kind?FI(t.createPropertyAccessExpression(t.createUniqueName("_super",48),e.name),e):e}function H(e){return 108===e.expression.kind?(n=e.argumentExpression,r=e,FI(256&m?t.createPropertyAccessExpression(t.createCallExpression(t.createUniqueName("_superIndex",48),void 0,[n]),"value"):t.createCallExpression(t.createUniqueName("_superIndex",48),void 0,[n]),r)):e;var n,r}}function fq(e,t,n,r){const i=t.hasNodeCheckFlag(n,256),o=[];return r.forEach((t,n)=>{const r=vc(n),a=[];a.push(e.createPropertyAssignment("get",e.createArrowFunction(void 0,void 0,[],void 0,void 0,ww(e.createPropertyAccessExpression(ww(e.createSuper(),8),r),8)))),i&&a.push(e.createPropertyAssignment("set",e.createArrowFunction(void 0,void 0,[e.createParameterDeclaration(void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,e.createAssignment(ww(e.createPropertyAccessExpression(ww(e.createSuper(),8),r),8),e.createIdentifier("v"))))),o.push(e.createPropertyAssignment(r,e.createObjectLiteralExpression(a)))}),e.createVariableStatement(void 0,e.createVariableDeclarationList([e.createVariableDeclaration(e.createUniqueName("_super",48),void 0,void 0,e.createCallExpression(e.createPropertyAccessExpression(e.createIdentifier("Object"),"create"),void 0,[e.createNull(),e.createObjectLiteralExpression(o,!0)]))],2))}function mq(e){const{factory:t,getEmitHelperFactory:n,resumeLexicalEnvironment:r,endLexicalEnvironment:i,hoistVariableDeclaration:o}=e,a=e.getEmitResolver(),s=e.getCompilerOptions(),c=Sk(s),l=e.onEmitNode;e.onEmitNode=function(e,t,n){if(1&y&&function(e){const t=e.kind;return 264===t||177===t||175===t||178===t||179===t}(t)){const r=(a.hasNodeCheckFlag(t,128)?128:0)|(a.hasNodeCheckFlag(t,256)?256:0);if(r!==v){const i=v;return v=r,l(e,t,n),void(v=i)}}else if(y&&x[_J(t)]){const r=v;return v=0,l(e,t,n),void(v=r)}l(e,t,n)};const _=e.onSubstituteNode;e.onSubstituteNode=function(e,n){if(n=_(e,n),1===e&&v)return function(e){switch(e.kind){case 212:return Q(e);case 213:return Y(e);case 214:return function(e){const n=e.expression;if(_m(n)){const r=hF(n)?Q(n):Y(n);return t.createCallExpression(t.createPropertyAccessExpression(r,"call"),void 0,[t.createThis(),...e.arguments])}return e}(e)}return e}(n);return n};let u,d,p,f,m,g,h=!1,y=0,v=0,b=0;const x=[];return rz(e,function(n){if(n.isDeclarationFile)return n;p=n;const r=function(n){const r=k(2,kp(n,s)?0:1);h=!1;const i=EJ(n,C,e),o=G(i.statements,f&&[t.createVariableStatement(void 0,t.createVariableDeclarationList(f))]),a=t.updateSourceFile(i,FI(t.createNodeArray(o),n.statements));return S(r),a}(n);return Kw(r,e.readEmitHelpers()),p=void 0,f=void 0,r});function k(e,t){const n=b;return b=3&(b&~e|t),n}function S(e){b=e}function T(e){f=ae(f,t.createVariableDeclaration(e))}function C(e){return E(e,!1)}function w(e){return E(e,!0)}function N(e){if(134!==e.kind)return e}function D(e,t,n,r){if(function(e,t){return b!==(b&~e|t)}(n,r)){const i=k(n,r),o=e(t);return S(i),o}return e(t)}function F(t){return EJ(t,C,e)}function E(r,i){if(!(128&r.transformFlags))return r;switch(r.kind){case 224:return function(r){if(2&u&&1&u)return kw(FI(t.createYieldExpression(void 0,n().createAwaitHelper(bJ(r.expression,C,K_))),r),r);return EJ(r,C,e)}(r);case 230:return function(r){if(2&u&&1&u){if(r.asteriskToken){const e=bJ(pn.checkDefined(r.expression),C,K_);return kw(FI(t.createYieldExpression(void 0,n().createAwaitHelper(t.updateYieldExpression(r,r.asteriskToken,FI(n().createAsyncDelegatorHelper(FI(n().createAsyncValuesHelper(e),e)),e)))),r),r)}return kw(FI(t.createYieldExpression(void 0,O(r.expression?bJ(r.expression,C,K_):t.createVoidZero())),r),r)}return EJ(r,C,e)}(r);case 254:return function(n){if(2&u&&1&u)return t.updateReturnStatement(n,O(n.expression?bJ(n.expression,C,K_):t.createVoidZero()));return EJ(n,C,e)}(r);case 257:return function(n){if(2&u){const e=qf(n);return 251===e.kind&&e.awaitModifier?I(e,n):t.restoreEnclosingLabel(bJ(e,C,hu,t.liftToBlock),n)}return EJ(n,C,e)}(r);case 211:return function(r){if(65536&r.transformFlags){const e=function(e){let n;const r=[];for(const i of e)if(306===i.kind){n&&(r.push(t.createObjectLiteralExpression(n)),n=void 0);const e=i.expression;r.push(bJ(e,C,K_))}else n=ae(n,304===i.kind?t.createPropertyAssignment(i.name,bJ(i.initializer,C,K_)):bJ(i,C,S_));n&&r.push(t.createObjectLiteralExpression(n));return r}(r.properties);e.length&&211!==e[0].kind&&e.unshift(t.createObjectLiteralExpression());let i=e[0];if(e.length>1){for(let t=1;t=2&&(a.hasNodeCheckFlag(o,256)||a.hasNodeCheckFlag(o,128));if(f){1&y||(y|=1,e.enableSubstitution(214),e.enableSubstitution(212),e.enableSubstitution(213),e.enableEmitNotification(264),e.enableEmitNotification(175),e.enableEmitNotification(178),e.enableEmitNotification(179),e.enableEmitNotification(177),e.enableEmitNotification(244));const n=fq(t,a,o,m);x[_J(n)]=!0,Rd(u,[n])}u.push(p);const h=t.updateBlock(o.body,u);return f&&g&&(a.hasNodeCheckFlag(o,256)?Hw(h,VN):a.hasNodeCheckFlag(o,128)&&Hw(h,UN)),m=l,g=_,h}function K(e){r();let n=0;const o=[],a=bJ(e.body,C,nu)??t.createBlock([]);GF(a)&&(n=t.copyPrologue(a.statements,o,!1,C)),le(o,X(void 0,e));const s=i();if(n>0||H(o)||H(s)){const e=t.converters.convertToFunctionBlock(a,!0);return Rd(o,s),le(o,e.statements.slice(n)),t.updateBlock(e,FI(t.createNodeArray(o),e.statements))}return a}function X(n,r){let i=!1;for(const o of r.parameters)if(i){if(w_(o.name)){if(o.name.elements.length>0){const r=Bz(o,C,e,0,t.getGeneratedNameForNode(o));if(H(r)){const e=t.createVariableDeclarationList(r),i=t.createVariableStatement(void 0,e);ww(i,2097152),n=ae(n,i)}}else if(o.initializer){const e=t.getGeneratedNameForNode(o),r=bJ(o.initializer,C,K_),i=t.createAssignment(e,r),a=t.createExpressionStatement(i);ww(a,2097152),n=ae(n,a)}}else if(o.initializer){const e=t.cloneNode(o.name);FI(e,o.name),ww(e,96);const r=bJ(o.initializer,C,K_);Nw(r,3168);const i=t.createAssignment(e,r);FI(i,o),ww(i,3072);const a=t.createBlock([t.createExpressionStatement(i)]);FI(a,o),ww(a,3905);const s=t.createTypeCheck(t.cloneNode(o.name),"undefined"),c=t.createIfStatement(s,a);OA(c),FI(c,o),ww(c,2101056),n=ae(n,c)}}else if(65536&o.transformFlags){i=!0;const r=Bz(o,C,e,1,t.getGeneratedNameForNode(o),!1,!0);if(H(r)){const e=t.createVariableDeclarationList(r),i=t.createVariableStatement(void 0,e);ww(i,2097152),n=ae(n,i)}}return n}function Q(e){return 108===e.expression.kind?FI(t.createPropertyAccessExpression(t.createUniqueName("_super",48),e.name),e):e}function Y(e){return 108===e.expression.kind?(n=e.argumentExpression,r=e,FI(256&v?t.createPropertyAccessExpression(t.createCallExpression(t.createIdentifier("_superIndex"),void 0,[n]),"value"):t.createCallExpression(t.createIdentifier("_superIndex"),void 0,[n]),r)):e;var n,r}}function gq(e){const t=e.factory;return rz(e,function(t){if(t.isDeclarationFile)return t;return EJ(t,n,e)});function n(r){return 64&r.transformFlags?300===r.kind?function(r){if(!r.variableDeclaration)return t.updateCatchClause(r,t.createVariableDeclaration(t.createTempVariable(void 0)),bJ(r.block,n,GF));return EJ(r,n,e)}(r):EJ(r,n,e):r}}function hq(e){const{factory:t,hoistVariableDeclaration:n}=e;return rz(e,function(t){if(t.isDeclarationFile)return t;return EJ(t,r,e)});function r(i){if(!(32&i.transformFlags))return i;switch(i.kind){case 214:{const e=o(i,!1);return pn.assertNotNode(e,VE),e}case 212:case 213:if(xl(i)){const e=s(i,!1,!1);return pn.assertNotNode(e,VE),e}return EJ(i,r,e);case 227:return 61===i.operatorToken.kind?function(e){let i=bJ(e.left,r,K_),o=i;dz(i)||(o=t.createTempVariable(n),i=t.createAssignment(o,i));return FI(t.createConditionalExpression(c(i,o),void 0,o,void 0,bJ(e.right,r,K_)),e)}(i):EJ(i,r,e);case 221:return function(e){return xl(_h(e.expression))?kw(a(e.expression,!1,!0),e):t.updateDeleteExpression(e,bJ(e.expression,r,K_))}(i);default:return EJ(i,r,e)}}function i(e,n,r){const i=a(e.expression,n,r);return VE(i)?t.createSyntheticReferenceExpression(t.updateParenthesizedExpression(e,i.expression),i.thisArg):t.updateParenthesizedExpression(e,i)}function o(n,o){if(xl(n))return s(n,o,!1);if(SF(n.expression)&&xl(_h(n.expression))){const e=i(n.expression,!0,!1),o=xJ(n.arguments,r,K_);return VE(e)?FI(t.createFunctionCallCall(e.expression,e.thisArg,o),n):t.updateCallExpression(n,e,void 0,o)}return EJ(n,r,e)}function a(e,a,c){switch(e.kind){case 218:return i(e,a,c);case 212:case 213:return function(e,i,o){if(xl(e))return s(e,i,o);let a,c=bJ(e.expression,r,K_);return pn.assertNotNode(c,VE),i&&(dz(c)?a=c:(a=t.createTempVariable(n),c=t.createAssignment(a,c))),c=212===e.kind?t.updatePropertyAccessExpression(e,c,bJ(e.name,r,uD)):t.updateElementAccessExpression(e,c,bJ(e.argumentExpression,r,K_)),a?t.createSyntheticReferenceExpression(c,a):c}(e,a,c);case 214:return o(e,a);default:return bJ(e,r,K_)}}function s(e,i,o){const{expression:s,chain:l}=function(e){pn.assertNotNode(e,Dl);const t=[e];for(;!e.questionDotToken&&!xF(e);)e=it(Nl(e.expression),xl),pn.assertNotNode(e,Dl),t.unshift(e);return{expression:e.expression,chain:t}}(e),_=a(Nl(s),bl(l[0]),!1);let u=VE(_)?_.thisArg:void 0,d=VE(_)?_.expression:_,p=t.restoreOuterExpressions(s,d,8);dz(d)||(d=t.createTempVariable(n),p=t.createAssignment(d,p));let f,m=d;for(let e=0;ee&&le(c,xJ(n.statements,_,hu,e,d-e));break}d++}pn.assert(dt&&(t=e)}return t}(n.caseBlock.clauses);if(r){const i=m();return g([t.updateSwitchStatement(n,bJ(n.expression,_,K_),t.updateCaseBlock(n.caseBlock,n.caseBlock.clauses.map(n=>function(n,r){if(0!==Tq(n.statements))return iP(n)?t.updateCaseClause(n,bJ(n.expression,_,K_),u(n.statements,0,n.statements.length,r,void 0)):t.updateDefaultClause(n,u(n.statements,0,n.statements.length,r,void 0));return EJ(n,_,e)}(n,i))))],i,2===r)}return EJ(n,_,e)}(n);default:return EJ(n,_,e)}}function u(i,o,a,s,u){const m=[];for(let r=o;rt&&(t=e)}return t}function Cq(e){const{factory:t,getEmitHelperFactory:n}=e,r=e.getCompilerOptions();let i,o;return rz(e,function(n){if(n.isDeclarationFile)return n;i=n,o={},o.importSpecifier=Zk(r,n);let a=EJ(n,l,e);Kw(a,e.readEmitHelpers());let s=a.statements;o.filenameDeclaration&&(s=zd(s.slice(),t.createVariableStatement(void 0,t.createVariableDeclarationList([o.filenameDeclaration],2))));if(o.utilizedImplicitRuntimeImports)for(const[e,r]of je(o.utilizedImplicitRuntimeImports.entries()))if(uO(n)){const n=t.createImportDeclaration(void 0,t.createImportClause(void 0,void 0,t.createNamedImports(je(r.values()))),t.createStringLiteral(e),void 0);OT(n,!1),s=zd(s.slice(),n)}else if(rf(n)){const n=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createObjectBindingPattern(je(r.values(),e=>t.createBindingElement(void 0,e.propertyName,e.name))),void 0,void 0,t.createCallExpression(t.createIdentifier("require"),void 0,[t.createStringLiteral(e)]))],2));OT(n,!1),s=zd(s.slice(),n)}s!==a.statements&&(a=t.updateSourceFile(a,s));return o=void 0,a});function a(){if(o.filenameDeclaration)return o.filenameDeclaration.name;const e=t.createVariableDeclaration(t.createUniqueName("_jsxFileName",48),void 0,void 0,t.createStringLiteral(i.fileName));return o.filenameDeclaration=e,o.filenameDeclaration.name}function s(e){const t=function(e){return 5===r.jsx?"jsxDEV":e?"jsxs":"jsx"}(e);return c(t)}function c(e){var n,i;const a="createElement"===e?o.importSpecifier:eS(o.importSpecifier,r),s=null==(i=null==(n=o.utilizedImplicitRuntimeImports)?void 0:n.get(a))?void 0:i.get(e);if(s)return s.name;o.utilizedImplicitRuntimeImports||(o.utilizedImplicitRuntimeImports=new Map);let c=o.utilizedImplicitRuntimeImports.get(a);c||(c=new Map,o.utilizedImplicitRuntimeImports.set(a,c));const l=t.createUniqueName(`_${e}`,112),_=t.createImportSpecifier(!1,t.createIdentifier(e),l);return sN(l,_),c.set(e,_),l}function l(t){return 2&t.transformFlags?function(t){switch(t.kind){case 285:return m(t,!1);case 286:return g(t,!1);case 289:return h(t,!1);case 295:return L(t);default:return EJ(t,l,e)}}(t):t}function u(e){switch(e.kind){case 12:return function(e){const n=function(e){let t,n=0,r=-1;for(let i=0;icP(e)&&(uD(e.name)&&"__proto__"===bc(e.name)||KN(e.name)&&"__proto__"===e.name.text))}function f(e){return void 0===o.importSpecifier||function(e){let t=!1;for(const n of e.attributes.properties)if(!tP(n)||gF(n.expression)&&!n.expression.properties.some(_P)){if(t&&ZE(n)&&uD(n.name)&&"key"===n.name.escapedText)return!0}else t=!0;return!1}(e)}function m(e,t){return(f(e.openingElement)?k:v)(e.openingElement,e.children,t,e)}function g(e,t){return(f(e)?k:v)(e,void 0,t,e)}function h(e,t){return(void 0===o.importSpecifier?T:S)(e.openingFragment,e.children,t,e)}function y(e){const n=py(e);if(1===d(n)&&!n[0].dotDotDotToken){const e=u(n[0]);return e&&t.createPropertyAssignment("children",e)}const r=J(e,u);return d(r)?t.createPropertyAssignment("children",t.createArrayLiteralExpression(r)):void 0}function v(e,n,r,i){const o=A(e),a=n&&n.length?y(n):void 0,s=x(e.attributes.properties,e=>!!e.name&&uD(e.name)&&"key"===e.name.escapedText),c=s?D(e.attributes.properties,e=>e!==s):e.attributes.properties;return b(o,d(c)?C(c,a):t.createObjectLiteralExpression(a?[a]:_),s,n||_,r,i)}function b(e,n,o,c,l,_){var u;const p=py(c),f=d(p)>1||!!(null==(u=p[0])?void 0:u.dotDotDotToken),m=[e,n];if(o&&m.push(N(o.initializer)),5===r.jsx){const e=fc(i);if(e&&dP(e)){void 0===o&&m.push(t.createVoidZero()),m.push(f?t.createTrue():t.createFalse());const n=Wa(e,_.pos);m.push(t.createObjectLiteralExpression([t.createPropertyAssignment("fileName",a()),t.createPropertyAssignment("lineNumber",t.createNumericLiteral(n.line+1)),t.createPropertyAssignment("columnNumber",t.createNumericLiteral(n.character+1))])),m.push(t.createThis())}}const g=FI(t.createCallExpression(s(f),void 0,m),_);return l&&OA(g),g}function k(n,a,s,l){const _=A(n),p=n.attributes.properties,f=d(p)?C(p):t.createNull(),m=void 0===o.importSpecifier?pA(t,e.getEmitResolver().getJsxFactoryEntity(i),r.reactNamespace,n):c("createElement"),g=fA(t,m,_,f,J(a,u),l);return s&&OA(g),g}function S(e,n,r,i){let o;if(n&&n.length){const e=function(e){const n=y(e);return n&&t.createObjectLiteralExpression([n])}(n);e&&(o=e)}return b(c("Fragment"),o||t.createObjectLiteralExpression([]),void 0,n,r,i)}function T(n,o,a,s){const c=mA(t,e.getEmitResolver().getJsxFactoryEntity(i),e.getEmitResolver().getJsxFragmentFactoryEntity(i),r.reactNamespace,J(o,u),n,s);return a&&OA(c),c}function C(e,i){const o=Sk(r);return o&&o>=5?t.createObjectLiteralExpression(function(e,n){const r=O(W(e,tP,(e,n)=>O(P(e,e=>{return n?gF((r=e).expression)&&!p(r.expression)?I(r.expression.properties,e=>pn.checkDefined(bJ(e,l,S_))):t.createSpreadAssignment(pn.checkDefined(bJ(r.expression,l,K_))):w(e);var r}))));n&&r.push(n);return r}(e,i)):function(e,r){const i=[];let o=[];for(const t of e)if(tP(t)){if(gF(t.expression)&&!p(t.expression)){for(const e of t.expression.properties)_P(e)?(a(),i.push(pn.checkDefined(bJ(e.expression,l,K_)))):o.push(pn.checkDefined(bJ(e,l)));continue}a(),i.push(pn.checkDefined(bJ(t.expression,l,K_)))}else o.push(w(t));r&&o.push(r);a(),i.length&&!gF(i[0])&&i.unshift(t.createObjectLiteralExpression());return ke(i)||n().createAssignHelper(i);function a(){o.length&&(i.push(t.createObjectLiteralExpression(o)),o=[])}}(e,i)}function w(e){const n=function(e){const n=e.name;if(uD(n)){const e=bc(n);return/^[A-Z_]\w*$/i.test(e)?n:t.createStringLiteral(e)}return t.createStringLiteral(bc(n.namespace)+":"+bc(n.name))}(e),r=N(e.initializer);return t.createPropertyAssignment(n,r)}function N(e){if(void 0===e)return t.createTrue();if(11===e.kind){const n=void 0!==e.singleQuote?e.singleQuote:!$m(e,i);return FI(t.createStringLiteral(function(e){const t=E(e);return t===e?void 0:t}(e.text)||e.text,n),e)}return 295===e.kind?void 0===e.expression?t.createTrue():pn.checkDefined(bJ(e.expression,l,K_)):$E(e)?m(e,!1):HE(e)?g(e,!1):XE(e)?h(e,!1):pn.failBadSyntaxKind(e)}function F(e,t){const n=E(t);return void 0===e?n:e+" "+n}function E(e){return e.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g,(e,t,n,r,i,o,a)=>{if(i)return Ts(parseInt(i,10));if(o)return Ts(parseInt(o,16));{const t=wq.get(a);return t?Ts(t):e}})}function A(e){if(285===e.kind)return A(e.openingElement);{const n=e.tagName;return uD(n)&&Oy(n.escapedText)?t.createStringLiteral(bc(n)):rP(n)?t.createStringLiteral(bc(n.namespace)+":"+bc(n.name)):hA(t,n)}}function L(e){const n=bJ(e.expression,l,K_);return e.dotDotDotToken?t.createSpreadElement(n):n}}var wq=new Map(Object.entries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}));function Nq(e){const{factory:t,hoistVariableDeclaration:n}=e;return rz(e,function(t){if(t.isDeclarationFile)return t;return EJ(t,r,e)});function r(i){return 512&i.transformFlags?227===i.kind?function(i){switch(i.operatorToken.kind){case 68:return function(e){let i,o;const a=bJ(e.left,r,K_),s=bJ(e.right,r,K_);if(yF(a)){const e=t.createTempVariable(n),r=t.createTempVariable(n);i=FI(t.createElementAccessExpression(FI(t.createAssignment(e,a.expression),a.expression),FI(t.createAssignment(r,a.argumentExpression),a.argumentExpression)),a),o=FI(t.createElementAccessExpression(e,r),a)}else if(hF(a)){const e=t.createTempVariable(n);i=FI(t.createPropertyAccessExpression(FI(t.createAssignment(e,a.expression),a.expression),a.name),a),o=FI(t.createPropertyAccessExpression(e,a.name),a)}else i=a,o=a;return FI(t.createAssignment(i,FI(t.createGlobalMethodCall("Math","pow",[o,s]),e)),e)}(i);case 43:return function(e){const n=bJ(e.left,r,K_),i=bJ(e.right,r,K_);return FI(t.createGlobalMethodCall("Math","pow",[n,i]),e)}(i);default:return EJ(i,r,e)}}(i):EJ(i,r,e):i}}function Dq(e,t){return{kind:e,expression:t}}function Fq(e){const{factory:t,getEmitHelperFactory:n,startLexicalEnvironment:r,resumeLexicalEnvironment:i,endLexicalEnvironment:o,hoistVariableDeclaration:a}=e,s=e.getCompilerOptions(),c=e.getEmitResolver(),l=e.onSubstituteNode,_=e.onEmitNode;let u,d,p,f,m;function g(e){f=ae(f,t.createVariableDeclaration(e))}e.onEmitNode=function(e,t,n){if(1&h&&s_(t)){const r=y(32670,16&rp(t)?81:65);return _(e,t,n),void v(r,0,0)}_(e,t,n)},e.onSubstituteNode=function(e,n){if(n=l(e,n),1===e)return function(e){switch(e.kind){case 80:return function(e){if(2&h&&!xA(e)){const n=c.getReferencedDeclarationWithCollidingName(e);if(n&&(!m_(n)||!function(e,t){let n=hc(t);if(!n||n===e||n.end<=e.pos||n.pos>=e.end)return!1;const r=Op(e);for(;n;){if(n===r||n===e)return!1;if(f_(n)&&n.parent===e)return!0;n=n.parent}return!1}(n,e)))return FI(t.getGeneratedNameForNode(Fc(n)),e)}return e}(e);case 110:return function(e){if(1&h&&16&p)return FI(E(),e);return e}(e)}return e}(n);if(uD(n))return function(e){if(2&h&&!xA(e)){const n=hc(e,uD);if(n&&function(e){switch(e.parent.kind){case 209:case 264:case 267:case 261:return e.parent.name===e&&c.isDeclarationWithCollidingName(e.parent)}return!1}(n))return FI(t.getGeneratedNameForNode(n),e)}return e}(n);return n};let h=0;return rz(e,function(n){if(n.isDeclarationFile)return n;u=n,d=n.text;const i=function(e){const n=y(8064,64),i=[],a=[];r();const s=t.copyPrologue(e.statements,i,!1,S);le(a,xJ(e.statements,S,hu,s)),f&&a.push(t.createVariableStatement(void 0,t.createVariableDeclarationList(f)));return t.mergeLexicalEnvironment(i,o()),se(i,e),v(n,0,0),t.updateSourceFile(e,FI(t.createNodeArray(G(i,a)),e.statements))}(n);return Kw(i,e.readEmitHelpers()),u=void 0,d=void 0,f=void 0,p=0,i});function y(e,t){const n=p;return p=32767&(p&~e|t),n}function v(e,t,n){p=-32768&(p&~t|n)|e}function x(e){return!!(8192&p)&&254===e.kind&&!e.expression}function k(e){return!!(1024&e.transformFlags)||void 0!==m||8192&p&&function(e){return 4194304&e.transformFlags&&(sE(e)||ZF(e)||cE(e)||lE(e)||SE(e)||iP(e)||oP(e)||dE(e)||sP(e)||_E(e)||X_(e,!1)||GF(e))}(e)||X_(e,!1)&&qe(e)||!!(1&ip(e))}function S(e){return k(e)?N(e,!1):e}function T(e){return k(e)?N(e,!0):e}function C(e){if(k(e)){const t=fc(e);if(AD(t)&&Ov(t)){const t=y(32670,16449),n=N(e,!1);return v(t,229376,0),n}return N(e,!1)}return e}function w(e){return 108===e.kind?lt(e,!0):S(e)}function N(n,r){switch(n.kind){case 126:return;case 264:return function(e){const n=t.createVariableDeclaration(t.getLocalName(e,!0),void 0,void 0,I(e));kw(n,e);const r=[],i=t.createVariableStatement(void 0,t.createVariableDeclarationList([n]));if(kw(i,e),FI(i,e),OA(i),r.push(i),Av(e,32)){const n=Av(e,2048)?t.createExportDefault(t.getLocalName(e)):t.createExternalModuleExport(t.getLocalName(e));kw(n,i),r.push(n)}return Te(r)}(n);case 232:return function(e){return I(e)}(n);case 170:return function(e){return e.dotDotDotToken?void 0:w_(e.name)?kw(FI(t.createParameterDeclaration(void 0,void 0,t.getGeneratedNameForNode(e),void 0,void 0,void 0),e),e):e.initializer?kw(FI(t.createParameterDeclaration(void 0,void 0,e.name,void 0,void 0,void 0),e),e):e}(n);case 263:return function(n){const r=m;m=void 0;const i=y(32670,65),o=CJ(n.parameters,S,e),a=ve(n),s=32768&p?t.getLocalName(n):n.name;return v(i,229376,0),m=r,t.updateFunctionDeclaration(n,xJ(n.modifiers,S,r_),n.asteriskToken,s,void 0,o,void 0,a)}(n);case 220:return function(n){16384&n.transformFlags&&!(16384&p)&&(p|=131072);const r=m;m=void 0;const i=y(15232,66),o=t.createFunctionExpression(void 0,void 0,void 0,void 0,CJ(n.parameters,S,e),void 0,ve(n));return FI(o,n),kw(o,n),ww(o,16),v(i,0,0),m=r,o}(n);case 219:return function(n){const r=524288&rp(n)?y(32662,69):y(32670,65),i=m;m=void 0;const o=CJ(n.parameters,S,e),a=ve(n),s=32768&p?t.getLocalName(n):n.name;return v(r,229376,0),m=i,t.updateFunctionExpression(n,void 0,n.asteriskToken,s,void 0,o,void 0,a)}(n);case 261:return we(n);case 80:return A(n);case 262:return function(n){if(7&n.flags||524288&n.transformFlags){7&n.flags&&_t();const e=xJ(n.declarations,1&n.flags?Ce:we,fE),r=t.createVariableDeclarationList(e);return kw(r,n),FI(r,n),Mw(r,n),524288&n.transformFlags&&(w_(n.declarations[0].name)||w_(xe(n.declarations).name))&&Pw(r,function(e){let t=-1,n=-1;for(const r of e)t=-1===t?r.pos:-1===r.pos?t:Math.min(t,r.pos),n=Math.max(n,r.end);return Mb(t,n)}(e)),r}return EJ(n,S,e)}(n);case 256:return function(t){if(void 0!==m){const n=m.allowedNonLabeledJumps;m.allowedNonLabeledJumps|=2;const r=EJ(t,S,e);return m.allowedNonLabeledJumps=n,r}return EJ(t,S,e)}(n);case 270:return function(t){const n=y(7104,0),r=EJ(t,S,e);return v(n,0,0),r}(n);case 242:return function(t,n){if(n)return EJ(t,S,e);const r=256&p?y(7104,512):y(6976,128),i=EJ(t,S,e);return v(r,0,0),i}(n,!1);case 253:case 252:return function(n){if(m){const e=253===n.kind?2:4;if(!(n.label&&m.labels&&m.labels.get(bc(n.label))||!n.label&&m.allowedNonLabeledJumps&e)){let e;const r=n.label;r?253===n.kind?(e=`break-${r.escapedText}`,Ge(m,!0,bc(r),e)):(e=`continue-${r.escapedText}`,Ge(m,!1,bc(r),e)):253===n.kind?(m.nonLocalJumps|=2,e="break"):(m.nonLocalJumps|=4,e="continue");let i=t.createStringLiteral(e);if(m.loopOutParameters.length){const e=m.loopOutParameters;let n;for(let r=0;rXF(e)&&!!ye(e.declarationList.declarations).initializer,i=m;m=void 0;const o=xJ(n.statements,C,hu);m=i;const a=D(o,r),s=D(o,e=>!r(e)),c=it(ye(a),XF).declarationList.declarations[0],l=AA(c.initializer);let _=rt(l,cb);!_&&AF(l)&&28===l.operatorToken.kind&&(_=rt(l.left,cb));const u=it(_?AA(_.right):l,vF),d=it(AA(u.expression),TF),p=d.body.statements;let f=0,g=-1;const h=[];if(_){const e=rt(p[f],YF);e&&(h.push(e),f++),h.push(p[f]),f++,h.push(t.createExpressionStatement(t.createAssignment(_.left,it(c.name,uD))))}for(;!sE(me(p,g));)g--;le(h,p,f,g),g<-1&&le(h,p,g+1);const y=rt(me(p,g),sE);for(const e of s)sE(e)&&(null==y?void 0:y.expression)&&!uD(y.expression)?h.push(y):h.push(e);return le(h,a,1),t.restoreOuterExpressions(e.expression,t.restoreOuterExpressions(c.initializer,t.restoreOuterExpressions(_&&_.right,t.updateCallExpression(u,t.restoreOuterExpressions(u.expression,t.updateFunctionExpression(d,void 0,void 0,void 0,void 0,d.parameters,void 0,t.updateBlock(d.body,h))),void 0,u.arguments))))}(n);const r=AA(n.expression);if(108===r.kind||_m(r)||H(n.arguments,jF))return function(n,r){if(32768&n.transformFlags||108===n.expression.kind||_m(AA(n.expression))){const{target:e,thisArg:i}=t.createCallBinding(n.expression,a);let o;if(108===n.expression.kind&&ww(i,8),o=32768&n.transformFlags?t.createFunctionApplyCall(pn.checkDefined(bJ(e,w,K_)),108===n.expression.kind?i:pn.checkDefined(bJ(i,S,K_)),tt(n.arguments,!0,!1,!1)):FI(t.createFunctionCallCall(pn.checkDefined(bJ(e,w,K_)),108===n.expression.kind?i:pn.checkDefined(bJ(i,S,K_)),xJ(n.arguments,S,K_)),n),108===n.expression.kind){const e=t.createLogicalOr(o,Z());o=r?t.createAssignment(E(),e):e}return kw(o,n)}pf(n)&&(p|=131072);return EJ(n,S,e)}(n,!0);return t.updateCallExpression(n,pn.checkDefined(bJ(n.expression,w,K_)),void 0,xJ(n.arguments,S,K_))}(n);case 215:return function(n){if(H(n.arguments,jF)){const{target:e,thisArg:r}=t.createCallBinding(t.createPropertyAccessExpression(n.expression,"bind"),a);return t.createNewExpression(t.createFunctionApplyCall(pn.checkDefined(bJ(e,S,K_)),r,tt(t.createNodeArray([t.createVoidZero(),...n.arguments]),!0,!1,!1)),void 0,[])}return EJ(n,S,e)}(n);case 218:return function(t,n){return EJ(t,n?T:S,e)}(n,r);case 227:return Se(n,r);case 357:return function(n,r){if(r)return EJ(n,T,e);let i;for(let e=0;e0&&e.push(t.createStringLiteral(r.literal.text)),n=t.createCallExpression(t.createPropertyAccessExpression(n,"concat"),void 0,e)}return FI(n,e)}(n);case 231:return function(e){return bJ(e.expression,S,K_)}(n);case 108:return lt(n,!1);case 110:return function(e){p|=65536,2&p&&!(16384&p)&&(p|=131072);if(m)return 2&p?(m.containsLexicalThis=!0,e):m.thisName||(m.thisName=t.createUniqueName("this"));return e}(n);case 237:return function(e){if(105===e.keywordToken&&"target"===e.name.escapedText)return p|=32768,t.createUniqueName("_newTarget",48);return e}(n);case 175:return function(e){pn.assert(!ND(e.name));const n=he(e,Bb(e,-1),void 0,void 0);return ww(n,1024|rp(n)),FI(t.createPropertyAssignment(e.name,n),e)}(n);case 178:case 179:return function(n){pn.assert(!ND(n.name));const r=m;m=void 0;const i=y(32670,65);let o;const a=CJ(n.parameters,S,e),s=ve(n);o=178===n.kind?t.updateGetAccessorDeclaration(n,n.modifiers,n.name,a,n.type,s):t.updateSetAccessorDeclaration(n,n.modifiers,n.name,a,s);return v(i,229376,0),m=r,o}(n);case 244:return function(n){const r=y(0,Av(n,32)?32:0);let i;if(!m||7&n.declarationList.flags||function(e){return 1===e.declarationList.declarations.length&&!!e.declarationList.declarations[0].initializer&&!!(1&ip(e.declarationList.declarations[0].initializer))}(n))i=EJ(n,S,e);else{let r;for(const i of n.declarationList.declarations)if(Ve(m,i),i.initializer){let n;w_(i.name)?n=jz(i,S,e,0):(n=t.createBinaryExpression(i.name,64,pn.checkDefined(bJ(i.initializer,S,K_))),FI(n,i)),r=ae(r,n)}i=r?FI(t.createExpressionStatement(t.inlineExpressions(r)),n):void 0}return v(r,0,0),i}(n);case 254:return function(n){if(m)return m.nonLocalJumps|=8,x(n)&&(n=F(n)),t.createReturnStatement(t.createObjectLiteralExpression([t.createPropertyAssignment(t.createIdentifier("value"),n.expression?pn.checkDefined(bJ(n.expression,S,K_)):t.createVoidZero())]));if(x(n))return F(n);return EJ(n,S,e)}(n);default:return EJ(n,S,e)}}function F(e){return kw(t.createReturnStatement(E()),e)}function E(){return t.createUniqueName("_this",48)}function A(e){return m&&c.isArgumentsLocalBinding(e)?m.argumentsName||(m.argumentsName=t.createUniqueName("arguments")):256&e.flags?kw(FI(t.createIdentifier(vc(e.escapedText)),e),e):e}function I(a){a.name&&_t();const s=Sh(a),c=t.createFunctionExpression(void 0,void 0,void 0,void 0,s?[t.createParameterDeclaration(void 0,void 0,ct())]:[],void 0,function(a,s){const c=[],l=t.getInternalName(a),_=Lh(l)?t.getGeneratedNameForNode(l):l;r(),function(e,r,i){i&&e.push(FI(t.createExpressionStatement(n().createExtendsHelper(t.getInternalName(r))),i))}(c,a,s),function(n,r,a,s){const c=m;m=void 0;const l=y(32662,73),_=cv(r),u=function(e,t){if(!e||!t)return!1;if(H(e.parameters))return!1;const n=ge(e.body.statements);if(!n||!iy(n)||245!==n.kind)return!1;const r=n.expression;if(!iy(r)||214!==r.kind)return!1;const i=r.expression;if(!iy(i)||108!==i.kind)return!1;const o=ke(r.arguments);if(!o||!iy(o)||231!==o.kind)return!1;const a=o.expression;return uD(a)&&"arguments"===a.escapedText}(_,void 0!==s),d=t.createFunctionDeclaration(void 0,void 0,a,void 0,function(t,n){return CJ(t&&!n?t.parameters:void 0,S,e)||[]}(_,u),void 0,function(e,n,r,a){const s=!!r&&106!==AA(r.expression).kind;if(!e)return function(e,n){const r=[];i(),t.mergeLexicalEnvironment(r,o()),n&&r.push(t.createReturnStatement(t.createLogicalOr(t.createLogicalAnd(t.createStrictInequality(ct(),t.createNull()),t.createFunctionApplyCall(ct(),Z(),t.createIdentifier("arguments"))),Z())));const a=t.createNodeArray(r);FI(a,e.members);const s=t.createBlock(a,!0);return FI(s,e),ww(s,3072),s}(n,s);const c=[],l=[];i();const _=t.copyStandardPrologue(e.body.statements,c,0);(a||j(e.body))&&(p|=8192);le(l,xJ(e.body.statements,S,hu,_));const u=s||8192&p;te(c,e),oe(c,e,a),_e(c,e),u?ce(c,e,Z()):se(c,e);t.mergeLexicalEnvironment(c,o()),u&&!Y(e.body)&&l.push(t.createReturnStatement(E()));const d=t.createBlock(FI(t.createNodeArray([...c,...l]),e.body.statements),!0);return FI(d,e.body),function(e,n,r){const i=e;e=function(e){for(let n=0;n0;n--){const i=e.statements[n];if(sE(i)&&i.expression&&M(i.expression)){const i=e.statements[n-1];let o;if(YF(i)&&$(AA(i.expression)))o=i.expression;else if(r&&B(i)){const e=i.declarationList.declarations[0];K(AA(e.initializer))&&(o=t.createAssignment(E(),e.initializer))}if(!o)break;const a=t.createReturnStatement(o);kw(a,i),FI(a,i);const s=t.createNodeArray([...e.statements.slice(0,n-1),a,...e.statements.slice(n+1)]);return FI(s,e.statements),t.updateBlock(e,s)}}return e}(e,n),e!==i&&(e=function(e,n){if(16384&n.transformFlags||65536&p||131072&p)return e;for(const t of n.statements)if(134217728&t.transformFlags&&!gz(t))return e;return t.updateBlock(e,xJ(e.statements,X,hu))}(e,n));r&&(e=function(e){return t.updateBlock(e,xJ(e.statements,Q,hu))}(e));return e}(d,e.body,a)}(_,r,s,u));FI(d,_||r),s&&ww(d,16);n.push(d),v(l,229376,0),m=c}(c,a,_,s),function(e,t){for(const n of t.members)switch(n.kind){case 241:e.push(ue(n));break;case 175:e.push(de(ut(t,n),n,t));break;case 178:case 179:const r=hv(t.members,n);n===r.firstAccessor&&e.push(pe(ut(t,n),r,t));break;case 177:case 176:break;default:pn.failBadSyntaxKind(n,u&&u.fileName)}}(c,a);const f=qb(ts(d,a.members.end),20),g=t.createPartiallyEmittedExpression(_);FT(g,f.end),ww(g,3072);const h=t.createReturnStatement(g);DT(h,f.pos),ww(h,3840),c.push(h),Rd(c,o());const b=t.createBlock(FI(t.createNodeArray(c),a.members),!0);return ww(b,3072),b}(a,s));ww(c,131072&rp(a)|1048576);const l=t.createPartiallyEmittedExpression(c);FT(l,a.end),ww(l,3072);const _=t.createPartiallyEmittedExpression(l);FT(_,ts(d,a.pos)),ww(_,3072);const f=t.createParenthesizedExpression(t.createCallExpression(_,void 0,s?[pn.checkDefined(bJ(s.expression,S,K_))]:[]));return Jw(f,3,"* @class "),f}function L(e){return XF(e)&&b(e.declarationList.declarations,e=>uD(e.name)&&!e.initializer)}function j(e){if(pf(e))return!0;if(!(134217728&e.transformFlags))return!1;switch(e.kind){case 220:case 219:case 263:case 177:case 176:return!1;case 178:case 179:case 175:case 173:{const t=e;return!!ND(t.name)&&!!iO(t.name,j)}}return!!iO(e,j)}function M(e){return Gl(e)&&"_this"===bc(e)}function R(e){return Gl(e)&&"_super"===bc(e)}function B(e){return XF(e)&&1===e.declarationList.declarations.length&&function(e){return fE(e)&&M(e.name)&&!!e.initializer}(e.declarationList.declarations[0])}function J(e){return cb(e,!0)&&M(e.left)}function z(e){return vF(e)&&hF(e.expression)&&R(e.expression.expression)&&uD(e.expression.name)&&("call"===bc(e.expression.name)||"apply"===bc(e.expression.name))&&e.arguments.length>=1&&110===e.arguments[0].kind}function q(e){return AF(e)&&57===e.operatorToken.kind&&110===e.right.kind&&z(e.left)}function U(e){return AF(e)&&56===e.operatorToken.kind&&AF(e.left)&&38===e.left.operatorToken.kind&&R(e.left.left)&&106===e.left.right.kind&&z(e.right)&&"apply"===bc(e.right.expression.name)}function V(e){return AF(e)&&57===e.operatorToken.kind&&110===e.right.kind&&U(e.left)}function $(e){return J(e)&&q(e.right)}function K(e){return z(e)||q(e)||$(e)||U(e)||V(e)||function(e){return J(e)&&V(e.right)}(e)}function X(e){if(B(e)){if(110===e.declarationList.declarations[0].initializer.kind)return}else if(J(e))return t.createPartiallyEmittedExpression(e.right,e);switch(e.kind){case 220:case 219:case 263:case 177:case 176:return e;case 178:case 179:case 175:case 173:{const n=e;return ND(n.name)?t.replacePropertyName(n,EJ(n.name,X,void 0)):e}}return EJ(e,X,void 0)}function Q(e){if(z(e)&&2===e.arguments.length&&uD(e.arguments[1])&&"arguments"===bc(e.arguments[1]))return t.createLogicalAnd(t.createStrictInequality(ct(),t.createNull()),e);switch(e.kind){case 220:case 219:case 263:case 177:case 176:return e;case 178:case 179:case 175:case 173:{const n=e;return ND(n.name)?t.replacePropertyName(n,EJ(n.name,Q,void 0)):e}}return EJ(e,Q,void 0)}function Y(e){if(254===e.kind)return!0;if(246===e.kind){const t=e;if(t.elseStatement)return Y(t.thenStatement)&&Y(t.elseStatement)}else if(242===e.kind){const t=be(e.statements);if(t&&Y(t))return!0}return!1}function Z(){return ww(t.createThis(),8)}function ee(e){return void 0!==e.initializer||w_(e.name)}function te(e,t){if(!H(t.parameters,ee))return!1;let n=!1;for(const r of t.parameters){const{name:t,initializer:i,dotDotDotToken:o}=r;o||(w_(t)?n=ne(e,r,t,i)||n:i&&(ie(e,r,t,i),n=!0))}return n}function ne(n,r,i,o){return i.elements.length>0?(zd(n,ww(t.createVariableStatement(void 0,t.createVariableDeclarationList(Bz(r,S,e,0,t.getGeneratedNameForNode(r)))),2097152)),!0):!!o&&(zd(n,ww(t.createExpressionStatement(t.createAssignment(t.getGeneratedNameForNode(r),pn.checkDefined(bJ(o,S,K_)))),2097152)),!0)}function ie(e,n,r,i){i=pn.checkDefined(bJ(i,S,K_));const o=t.createIfStatement(t.createTypeCheck(t.cloneNode(r),"undefined"),ww(FI(t.createBlock([t.createExpressionStatement(ww(FI(t.createAssignment(ww(IT(FI(t.cloneNode(r),r),r.parent),96),ww(i,3168|rp(i))),n),3072))]),n),3905));OA(o),FI(o,n),ww(o,2101056),zd(e,o)}function oe(n,r,i){const o=[],a=be(r.parameters);if(!function(e,t){return!(!e||!e.dotDotDotToken||t)}(a,i))return!1;const s=80===a.name.kind?IT(FI(t.cloneNode(a.name),a.name),a.name.parent):t.createTempVariable(void 0);ww(s,96);const c=80===a.name.kind?t.cloneNode(a.name):s,l=r.parameters.length-1,_=t.createLoopVariable();o.push(ww(FI(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(s,void 0,void 0,t.createArrayLiteralExpression([]))])),a),2097152));const u=t.createForStatement(FI(t.createVariableDeclarationList([t.createVariableDeclaration(_,void 0,void 0,t.createNumericLiteral(l))]),a),FI(t.createLessThan(_,t.createPropertyAccessExpression(t.createIdentifier("arguments"),"length")),a),FI(t.createPostfixIncrement(_),a),t.createBlock([OA(FI(t.createExpressionStatement(t.createAssignment(t.createElementAccessExpression(c,0===l?_:t.createSubtract(_,t.createNumericLiteral(l))),t.createElementAccessExpression(t.createIdentifier("arguments"),_))),a))]));return ww(u,2097152),OA(u),o.push(u),80!==a.name.kind&&o.push(ww(FI(t.createVariableStatement(void 0,t.createVariableDeclarationList(Bz(a,S,e,0,c))),a),2097152)),Bd(n,o),!0}function se(e,n){return!!(131072&p&&220!==n.kind)&&(ce(e,n,t.createThis()),!0)}function ce(n,r,i){1&h||(h|=1,e.enableSubstitution(110),e.enableEmitNotification(177),e.enableEmitNotification(175),e.enableEmitNotification(178),e.enableEmitNotification(179),e.enableEmitNotification(220),e.enableEmitNotification(219),e.enableEmitNotification(263));const o=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(E(),void 0,void 0,i)]));ww(o,2100224),Pw(o,r),zd(n,o)}function _e(e,n){if(32768&p){let r;switch(n.kind){case 220:return e;case 175:case 178:case 179:r=t.createVoidZero();break;case 177:r=t.createPropertyAccessExpression(ww(t.createThis(),8),"constructor");break;case 263:case 219:r=t.createConditionalExpression(t.createLogicalAnd(ww(t.createThis(),8),t.createBinaryExpression(ww(t.createThis(),8),104,t.getLocalName(n))),void 0,t.createPropertyAccessExpression(ww(t.createThis(),8),"constructor"),void 0,t.createVoidZero());break;default:return pn.failBadSyntaxKind(n)}const i=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_newTarget",48),void 0,void 0,r)]));ww(i,2100224),zd(e,i)}return e}function ue(e){return FI(t.createEmptyStatement(),e)}function de(n,r,i){const o=jw(r),a=Ew(r),s=he(r,r,void 0,i),c=bJ(r.name,S,o_);let l;if(pn.assert(c),!dD(c)&&Rk(e.getCompilerOptions())){const e=ND(c)?c.expression:uD(c)?t.createStringLiteral(vc(c.escapedText)):c;l=t.createObjectDefinePropertyCall(n,e,t.createPropertyDescriptor({value:s,enumerable:!1,writable:!0,configurable:!0}))}else{const e=_A(t,n,c,r.name);l=t.createAssignment(e,s)}ww(s,3072),Pw(s,a);const _=FI(t.createExpressionStatement(l),r);return kw(_,r),Mw(_,o),ww(_,96),_}function pe(e,n,r){const i=t.createExpressionStatement(fe(e,n,r,!1));return ww(i,3072),Pw(i,Ew(n.firstAccessor)),i}function fe(e,{firstAccessor:n,getAccessor:r,setAccessor:i},o,a){const s=IT(FI(t.cloneNode(e),e),e.parent);ww(s,3136),Pw(s,n.name);const c=bJ(n.name,S,o_);if(pn.assert(c),dD(c))return pn.failBadSyntaxKind(c,"Encountered unhandled private identifier while transforming ES2015.");const l=yA(t,c);ww(l,3104),Pw(l,n.name);const _=[];if(r){const e=he(r,void 0,void 0,o);Pw(e,Ew(r)),ww(e,1024);const n=t.createPropertyAssignment("get",e);Mw(n,jw(r)),_.push(n)}if(i){const e=he(i,void 0,void 0,o);Pw(e,Ew(i)),ww(e,1024);const n=t.createPropertyAssignment("set",e);Mw(n,jw(i)),_.push(n)}_.push(t.createPropertyAssignment("enumerable",r||i?t.createFalse():t.createTrue()),t.createPropertyAssignment("configurable",t.createTrue()));const u=t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"defineProperty"),void 0,[s,l,t.createObjectLiteralExpression(_,!0)]);return a&&OA(u),u}function he(n,r,i,o){const a=m;m=void 0;const s=o&&m_(o)&&!Iv(n)?y(32670,73):y(32670,65),c=CJ(n.parameters,S,e),l=ve(n);return 32768&p&&!i&&(263===n.kind||219===n.kind)&&(i=t.getGeneratedNameForNode(n)),v(s,229376,0),m=a,kw(FI(t.createFunctionExpression(void 0,n.asteriskToken,i,void 0,c,void 0,l),r),n)}function ve(e){let n,r,a=!1,s=!1;const c=[],l=[],_=e.body;let d;if(i(),GF(_)&&(d=t.copyStandardPrologue(_.statements,c,0,!1),d=t.copyCustomPrologue(_.statements,l,d,S,vf),d=t.copyCustomPrologue(_.statements,l,d,S,xf)),a=te(l,e)||a,a=oe(l,e,!1)||a,GF(_))d=t.copyCustomPrologue(_.statements,l,d,S),n=_.statements,le(l,xJ(_.statements,S,hu,d)),!a&&_.multiLine&&(a=!0);else{pn.assert(220===e.kind),n=Rb(_,-1);const i=e.equalsGreaterThanToken;iy(i)||iy(_)||(Hb(i,_,u)?s=!0:a=!0);const o=bJ(_,S,K_),c=t.createReturnStatement(o);FI(c,_),Vw(c,_),ww(c,2880),l.push(c),r=_}if(t.mergeLexicalEnvironment(c,o()),_e(c,e),se(c,e),H(c)&&(a=!0),l.unshift(...c),GF(_)&&re(l,_.statements))return _;const p=t.createBlock(FI(t.createNodeArray(l),n),a);return FI(p,e.body),!a&&s&&ww(p,1),r&&Iw(p,20,r),kw(p,e.body),p}function Se(n,r){return lb(n)?jz(n,S,e,0,!r):28===n.operatorToken.kind?t.updateBinaryExpression(n,pn.checkDefined(bJ(n.left,T,K_)),n.operatorToken,pn.checkDefined(bJ(n.right,r?T:S,K_))):EJ(n,S,e)}function Ce(n){return w_(n.name)?we(n):!n.initializer&&function(e){const t=c.hasNodeCheckFlag(e,16384),n=c.hasNodeCheckFlag(e,32768);return!(64&p||t&&n&&512&p)&&!(4096&p)&&(!c.isDeclarationWithCollidingName(e)||n&&!t&&!(6144&p))}(n)?t.updateVariableDeclaration(n,n.name,void 0,void 0,t.createVoidZero()):EJ(n,S,e)}function we(t){const n=y(32,0);let r;return r=w_(t.name)?Bz(t,S,e,0,void 0,!!(32&n)):EJ(t,S,e),v(n,0,0),r}function Ne(e){m.labels.set(bc(e.label),!0)}function De(e){m.labels.set(bc(e.label),!1)}function Fe(n,i,a,s,c){const l=y(n,i),_=function(n,i,a,s){if(!qe(n)){let r;m&&(r=m.allowedNonLabeledJumps,m.allowedNonLabeledJumps=6);const o=s?s(n,i,void 0,a):t.restoreEnclosingLabel(nE(n)?function(e){return t.updateForStatement(e,bJ(e.initializer,T,iu),bJ(e.condition,S,K_),bJ(e.incrementor,T,K_),pn.checkDefined(bJ(e.statement,S,hu,t.liftToBlock)))}(n):EJ(n,S,e),i,m&&De);return m&&(m.allowedNonLabeledJumps=r),o}const c=function(e){let t;switch(e.kind){case 249:case 250:case 251:const n=e.initializer;n&&262===n.kind&&(t=n)}const n=[],r=[];if(t&&7&_c(t)){const i=Be(e)||Je(e)||ze(e);for(const o of t.declarations)Qe(e,o,n,r,i)}const i={loopParameters:n,loopOutParameters:r};m&&(m.argumentsName&&(i.argumentsName=m.argumentsName),m.thisName&&(i.thisName=m.thisName),m.hoistedLocalVariables&&(i.hoistedLocalVariables=m.hoistedLocalVariables));return i}(n),l=[],_=m;m=c;const u=Be(n)?function(e,n){const r=t.createUniqueName("_loop_init"),i=!!(1048576&e.initializer.transformFlags);let o=0;n.containsLexicalThis&&(o|=16);i&&4&p&&(o|=524288);const a=[];a.push(t.createVariableStatement(void 0,e.initializer)),Ke(n.loopOutParameters,2,1,a);const s=t.createVariableStatement(void 0,ww(t.createVariableDeclarationList([t.createVariableDeclaration(r,void 0,void 0,ww(t.createFunctionExpression(void 0,i?t.createToken(42):void 0,void 0,void 0,void 0,void 0,pn.checkDefined(bJ(t.createBlock(a,!0),S,GF))),o))]),4194304)),c=t.createVariableDeclarationList(P(n.loopOutParameters,$e));return{functionName:r,containsYield:i,functionDeclaration:s,part:c}}(n,c):void 0,d=Ue(n)?function(e,n,i){const a=t.createUniqueName("_loop");r();const s=bJ(e.statement,S,hu,t.liftToBlock),c=o(),l=[];(Je(e)||ze(e))&&(n.conditionVariable=t.createUniqueName("inc"),e.incrementor?l.push(t.createIfStatement(n.conditionVariable,t.createExpressionStatement(pn.checkDefined(bJ(e.incrementor,S,K_))),t.createExpressionStatement(t.createAssignment(n.conditionVariable,t.createTrue())))):l.push(t.createIfStatement(t.createLogicalNot(n.conditionVariable),t.createExpressionStatement(t.createAssignment(n.conditionVariable,t.createTrue())))),Je(e)&&l.push(t.createIfStatement(t.createPrefixUnaryExpression(54,pn.checkDefined(bJ(e.condition,S,K_))),pn.checkDefined(bJ(t.createBreakStatement(),S,hu)))));pn.assert(s),GF(s)?le(l,s.statements):l.push(s);Ke(n.loopOutParameters,1,1,l),Rd(l,c);const _=t.createBlock(l,!0);GF(s)&&kw(_,s);const u=!!(1048576&e.statement.transformFlags);let d=1048576;n.containsLexicalThis&&(d|=16);u&&4&p&&(d|=524288);const f=t.createVariableStatement(void 0,ww(t.createVariableDeclarationList([t.createVariableDeclaration(a,void 0,void 0,ww(t.createFunctionExpression(void 0,u?t.createToken(42):void 0,void 0,void 0,n.loopParameters,void 0,_),d))]),4194304)),m=function(e,n,r,i){const o=[],a=!(-5&n.nonLocalJumps||n.labeledNonLocalBreaks||n.labeledNonLocalContinues),s=t.createCallExpression(e,void 0,P(n.loopParameters,e=>e.name)),c=i?t.createYieldExpression(t.createToken(42),ww(s,8388608)):s;if(a)o.push(t.createExpressionStatement(c)),Ke(n.loopOutParameters,1,0,o);else{const e=t.createUniqueName("state"),i=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(e,void 0,void 0,c)]));if(o.push(i),Ke(n.loopOutParameters,1,0,o),8&n.nonLocalJumps){let n;r?(r.nonLocalJumps|=8,n=t.createReturnStatement(e)):n=t.createReturnStatement(t.createPropertyAccessExpression(e,"value")),o.push(t.createIfStatement(t.createTypeCheck(e,"object"),n))}if(2&n.nonLocalJumps&&o.push(t.createIfStatement(t.createStrictEquality(e,t.createStringLiteral("break")),t.createBreakStatement())),n.labeledNonLocalBreaks||n.labeledNonLocalContinues){const i=[];Xe(n.labeledNonLocalBreaks,!0,e,r,i),Xe(n.labeledNonLocalContinues,!1,e,r,i),o.push(t.createSwitchStatement(e,t.createCaseBlock(i)))}}return o}(a,n,i,u);return{functionName:a,containsYield:u,functionDeclaration:f,part:m}}(n,c,_):void 0;m=_,u&&l.push(u.functionDeclaration);d&&l.push(d.functionDeclaration);(function(e,n,r){let i;n.argumentsName&&(r?r.argumentsName=n.argumentsName:(i||(i=[])).push(t.createVariableDeclaration(n.argumentsName,void 0,void 0,t.createIdentifier("arguments"))));n.thisName&&(r?r.thisName=n.thisName:(i||(i=[])).push(t.createVariableDeclaration(n.thisName,void 0,void 0,t.createIdentifier("this"))));if(n.hoistedLocalVariables)if(r)r.hoistedLocalVariables=n.hoistedLocalVariables;else{i||(i=[]);for(const e of n.hoistedLocalVariables)i.push(t.createVariableDeclaration(e))}if(n.loopOutParameters.length){i||(i=[]);for(const e of n.loopOutParameters)i.push(t.createVariableDeclaration(e.outParamName))}n.conditionVariable&&(i||(i=[]),i.push(t.createVariableDeclaration(n.conditionVariable,void 0,void 0,t.createFalse())));i&&e.push(t.createVariableStatement(void 0,t.createVariableDeclarationList(i)))})(l,c,_),u&&l.push(function(e,n){const r=t.createCallExpression(e,void 0,[]),i=n?t.createYieldExpression(t.createToken(42),ww(r,8388608)):r;return t.createExpressionStatement(i)}(u.functionName,u.containsYield));let f;if(d)if(s)f=s(n,i,d.part,a);else{const e=We(n,u,t.createBlock(d.part,!0));f=t.restoreEnclosingLabel(e,i,m&&De)}else{const e=We(n,u,pn.checkDefined(bJ(n.statement,S,hu,t.liftToBlock)));f=t.restoreEnclosingLabel(e,i,m&&De)}return l.push(f),l}(a,s,l,c);return v(l,0,0),_}function Ee(e,t){return Fe(0,1280,e,t)}function Pe(e,t){return Fe(5056,3328,e,t)}function Ae(e,t){return Fe(3008,5376,e,t)}function Ie(e,t){return Fe(3008,5376,e,t,s.downlevelIteration?Me:je)}function Oe(n,r,i){const o=[],a=n.initializer;if(mE(a)){7&n.initializer.flags&&_t();const i=ge(a.declarations);if(i&&w_(i.name)){const a=Bz(i,S,e,0,r),s=FI(t.createVariableDeclarationList(a),n.initializer);kw(s,n.initializer),Pw(s,Mb(a[0].pos,xe(a).end)),o.push(t.createVariableStatement(void 0,s))}else o.push(FI(t.createVariableStatement(void 0,kw(FI(t.createVariableDeclarationList([t.createVariableDeclaration(i?i.name:t.createTempVariable(void 0),void 0,void 0,r)]),Bb(a,-1)),a)),Rb(a,-1)))}else{const e=t.createAssignment(a,r);lb(e)?o.push(t.createExpressionStatement(Se(e,!0))):(FT(e,a.end),o.push(FI(t.createExpressionStatement(pn.checkDefined(bJ(e,S,K_))),Rb(a,-1))))}if(i)return Le(le(o,i));{const e=bJ(n.statement,S,hu,t.liftToBlock);return pn.assert(e),GF(e)?t.updateBlock(e,FI(t.createNodeArray(G(o,e.statements)),e.statements)):(o.push(e),Le(o))}}function Le(e){return ww(t.createBlock(t.createNodeArray(e),!0),864)}function je(e,n,r){const i=bJ(e.expression,S,K_);pn.assert(i);const o=t.createLoopVariable(),a=uD(i)?t.getGeneratedNameForNode(i):t.createTempVariable(void 0);ww(i,96|rp(i));const s=FI(t.createForStatement(ww(FI(t.createVariableDeclarationList([FI(t.createVariableDeclaration(o,void 0,void 0,t.createNumericLiteral(0)),Bb(e.expression,-1)),FI(t.createVariableDeclaration(a,void 0,void 0,i),e.expression)]),e.expression),4194304),FI(t.createLessThan(o,t.createPropertyAccessExpression(a,"length")),e.expression),FI(t.createPostfixIncrement(o),e.expression),Oe(e,t.createElementAccessExpression(a,o),r)),e);return ww(s,512),FI(s,e),t.restoreEnclosingLabel(s,n,m&&De)}function Me(e,r,i,o){const s=bJ(e.expression,S,K_);pn.assert(s);const c=uD(s)?t.getGeneratedNameForNode(s):t.createTempVariable(void 0),l=uD(s)?t.getGeneratedNameForNode(c):t.createTempVariable(void 0),_=t.createUniqueName("e"),u=t.getGeneratedNameForNode(_),d=t.createTempVariable(void 0),p=FI(n().createValuesHelper(s),e.expression),f=t.createCallExpression(t.createPropertyAccessExpression(c,"next"),void 0,[]);a(_),a(d);const g=1024&o?t.inlineExpressions([t.createAssignment(_,t.createVoidZero()),p]):p,h=ww(FI(t.createForStatement(ww(FI(t.createVariableDeclarationList([FI(t.createVariableDeclaration(c,void 0,void 0,g),e.expression),t.createVariableDeclaration(l,void 0,void 0,f)]),e.expression),4194304),t.createLogicalNot(t.createPropertyAccessExpression(l,"done")),t.createAssignment(l,f),Oe(e,t.createPropertyAccessExpression(l,"value"),i)),e),512);return t.createTryStatement(t.createBlock([t.restoreEnclosingLabel(h,r,m&&De)]),t.createCatchClause(t.createVariableDeclaration(u),ww(t.createBlock([t.createExpressionStatement(t.createAssignment(_,t.createObjectLiteralExpression([t.createPropertyAssignment("error",u)])))]),1)),t.createBlock([t.createTryStatement(t.createBlock([ww(t.createIfStatement(t.createLogicalAnd(t.createLogicalAnd(l,t.createLogicalNot(t.createPropertyAccessExpression(l,"done"))),t.createAssignment(d,t.createPropertyAccessExpression(c,"return"))),t.createExpressionStatement(t.createFunctionCallCall(d,c,[]))),1)]),void 0,ww(t.createBlock([ww(t.createIfStatement(_,t.createThrowStatement(t.createPropertyAccessExpression(_,"error"))),1)]),1))]))}function Re(e){return c.hasNodeCheckFlag(e,8192)}function Be(e){return nE(e)&&!!e.initializer&&Re(e.initializer)}function Je(e){return nE(e)&&!!e.condition&&Re(e.condition)}function ze(e){return nE(e)&&!!e.incrementor&&Re(e.incrementor)}function qe(e){return Ue(e)||Be(e)}function Ue(e){return c.hasNodeCheckFlag(e,4096)}function Ve(e,t){e.hoistedLocalVariables||(e.hoistedLocalVariables=[]),function t(n){if(80===n.kind)e.hoistedLocalVariables.push(n);else for(const e of n.elements)RF(e)||t(e.name)}(t.name)}function We(e,n,r){switch(e.kind){case 249:return function(e,n,r){const i=e.condition&&Re(e.condition),o=i||e.incrementor&&Re(e.incrementor);return t.updateForStatement(e,bJ(n?n.part:e.initializer,T,iu),bJ(i?void 0:e.condition,S,K_),bJ(o?void 0:e.incrementor,T,K_),r)}(e,n,r);case 250:return function(e,n){return t.updateForInStatement(e,pn.checkDefined(bJ(e.initializer,S,iu)),pn.checkDefined(bJ(e.expression,S,K_)),n)}(e,r);case 251:return function(e,n){return t.updateForOfStatement(e,void 0,pn.checkDefined(bJ(e.initializer,S,iu)),pn.checkDefined(bJ(e.expression,S,K_)),n)}(e,r);case 247:return function(e,n){return t.updateDoStatement(e,n,pn.checkDefined(bJ(e.expression,S,K_)))}(e,r);case 248:return function(e,n){return t.updateWhileStatement(e,pn.checkDefined(bJ(e.expression,S,K_)),n)}(e,r);default:return pn.failBadSyntaxKind(e,"IterationStatement expected")}}function $e(e){return t.createVariableDeclaration(e.originalName,void 0,void 0,e.outParamName)}function He(e,n){const r=0===n?e.outParamName:e.originalName,i=0===n?e.originalName:e.outParamName;return t.createBinaryExpression(i,64,r)}function Ke(e,n,r,i){for(const o of e)o.flags&n&&i.push(t.createExpressionStatement(He(o,r)))}function Ge(e,t,n,r){t?(e.labeledNonLocalBreaks||(e.labeledNonLocalBreaks=new Map),e.labeledNonLocalBreaks.set(n,r)):(e.labeledNonLocalContinues||(e.labeledNonLocalContinues=new Map),e.labeledNonLocalContinues.set(n,r))}function Xe(e,n,r,i,o){e&&e.forEach((e,a)=>{const s=[];if(!i||i.labels&&i.labels.get(a)){const e=t.createIdentifier(a);s.push(n?t.createBreakStatement(e):t.createContinueStatement(e))}else Ge(i,n,a,e),s.push(t.createReturnStatement(r));o.push(t.createCaseClause(t.createStringLiteral(e),s))})}function Qe(e,n,r,i,o){const a=n.name;if(w_(a))for(const t of a.elements)RF(t)||Qe(e,t,r,i,o);else{r.push(t.createParameterDeclaration(void 0,void 0,a));const s=c.hasNodeCheckFlag(n,65536);if(s||o){const r=t.createUniqueName("out_"+bc(a));let o=0;s&&(o|=1),nE(e)&&(e.initializer&&c.isBindingCapturedByNode(e.initializer,n)&&(o|=2),(e.condition&&c.isBindingCapturedByNode(e.condition,n)||e.incrementor&&c.isBindingCapturedByNode(e.incrementor,n))&&(o|=1)),i.push({flags:o,originalName:a,outParamName:r})}}}function Ye(e,n,r){const i=t.createAssignment(_A(t,n,pn.checkDefined(bJ(e.name,S,o_))),pn.checkDefined(bJ(e.initializer,S,K_)));return FI(i,e),r&&OA(i),i}function Ze(e,n,r){const i=t.createAssignment(_A(t,n,pn.checkDefined(bJ(e.name,S,o_))),t.cloneNode(e.name));return FI(i,e),r&&OA(i),i}function et(e,n,r,i){const o=t.createAssignment(_A(t,n,pn.checkDefined(bJ(e.name,S,o_))),he(e,e,void 0,r));return FI(o,e),i&&OA(o),o}function tt(e,r,i,o){const a=e.length,c=O(W(e,nt,(e,t,n,r)=>t(e,i,o&&r===a)));if(1===c.length){const e=c[0];if(r&&!s.downlevelIteration||jT(e.expression)||WN(e.expression,"___spreadArray"))return e.expression}const l=n(),_=0!==c[0].kind;let u=_?t.createArrayLiteralExpression():c[0].expression;for(let e=_?0:1;e0?t.inlineExpressions(P(i,G)):void 0,bJ(n.condition,R,K_),bJ(n.incrementor,R,K_),DJ(n.statement,R,e))}else n=EJ(n,R,e);m&&ce();return n}(r);case 250:return function(n){m&&ae();const r=n.initializer;if(mE(r)){for(const e of r.declarations)a(e.name);n=t.updateForInStatement(n,r.declarations[0].name,pn.checkDefined(bJ(n.expression,R,K_)),pn.checkDefined(bJ(n.statement,R,hu,t.liftToBlock)))}else n=EJ(n,R,e);m&&ce();return n}(r);case 253:return function(t){if(m){const e=me(t.label&&bc(t.label));if(e>0)return ve(e,t)}return EJ(t,R,e)}(r);case 252:return function(t){if(m){const e=ge(t.label&&bc(t.label));if(e>0)return ve(e,t)}return EJ(t,R,e)}(r);case 254:return function(e){return n=bJ(e.expression,R,K_),r=e,FI(t.createReturnStatement(t.createArrayLiteralExpression(n?[ye(2),n]:[ye(2)])),r);var n,r}(r);default:return 1048576&r.transformFlags?function(r){switch(r.kind){case 227:return function(n){const r=ay(n);switch(r){case 0:return function(n){if(X(n.right))return eb(n.operatorToken.kind)?function(e){const t=ee(),n=Z();Se(n,pn.checkDefined(bJ(e.left,R,K_)),e.left),56===e.operatorToken.kind?we(t,n,e.left):Ce(t,n,e.left);return Se(n,pn.checkDefined(bJ(e.right,R,K_)),e.right),te(t),n}(n):28===n.operatorToken.kind?U(n):t.updateBinaryExpression(n,Y(pn.checkDefined(bJ(n.left,R,K_))),n.operatorToken,pn.checkDefined(bJ(n.right,R,K_)));return EJ(n,R,e)}(n);case 1:return function(n){const{left:r,right:i}=n;if(X(i)){let e;switch(r.kind){case 212:e=t.updatePropertyAccessExpression(r,Y(pn.checkDefined(bJ(r.expression,R,q_))),r.name);break;case 213:e=t.updateElementAccessExpression(r,Y(pn.checkDefined(bJ(r.expression,R,q_))),Y(pn.checkDefined(bJ(r.argumentExpression,R,K_))));break;default:e=pn.checkDefined(bJ(r,R,K_))}const o=n.operatorToken.kind;return fz(o)?FI(t.createAssignment(e,FI(t.createBinaryExpression(Y(e),mz(o),pn.checkDefined(bJ(i,R,K_))),n)),n):t.updateBinaryExpression(n,e,n.operatorToken,pn.checkDefined(bJ(i,R,K_)))}return EJ(n,R,e)}(n);default:return pn.assertNever(r)}}(r);case 357:return function(e){let n=[];for(const r of e.elements)AF(r)&&28===r.operatorToken.kind?n.push(U(r)):(X(r)&&n.length>0&&(Ne(1,[t.createExpressionStatement(t.inlineExpressions(n))]),n=[]),n.push(pn.checkDefined(bJ(r,R,K_))));return t.inlineExpressions(n)}(r);case 228:return function(t){if(X(t.whenTrue)||X(t.whenFalse)){const e=ee(),n=ee(),r=Z();return we(e,pn.checkDefined(bJ(t.condition,R,K_)),t.condition),Se(r,pn.checkDefined(bJ(t.whenTrue,R,K_)),t.whenTrue),Te(n),te(e),Se(r,pn.checkDefined(bJ(t.whenFalse,R,K_)),t.whenFalse),te(n),r}return EJ(t,R,e)}(r);case 230:return function(e){const r=ee(),i=bJ(e.expression,R,K_);if(e.asteriskToken){!function(e,t){Ne(7,[e],t)}(8388608&rp(e.expression)?i:FI(n().createValuesHelper(i),e),e)}else!function(e,t){Ne(6,[e],t)}(i,e);return te(r),function(e){return FI(t.createCallExpression(t.createPropertyAccessExpression(C,"sent"),void 0,[]),e)}(e)}(r);case 210:return function(e){return V(e.elements,void 0,void 0,e.multiLine)}(r);case 211:return function(e){const n=e.properties,r=e.multiLine,i=Q(n),o=Z();Se(o,t.createObjectLiteralExpression(xJ(n,R,S_,0,i),r));const a=De(n,s,[],i);return a.push(r?OA(IT(FI(t.cloneNode(o),o),o.parent)):o),t.inlineExpressions(a);function s(n,i){X(i)&&n.length>0&&(ke(t.createExpressionStatement(t.inlineExpressions(n))),n=[]);const a=bJ(vA(t,e,i,o),R,K_);return a&&(r&&OA(a),n.push(a)),n}}(r);case 213:return function(n){if(X(n.argumentExpression))return t.updateElementAccessExpression(n,Y(pn.checkDefined(bJ(n.expression,R,q_))),pn.checkDefined(bJ(n.argumentExpression,R,K_)));return EJ(n,R,e)}(r);case 214:return function(n){if(!ff(n)&&p(n.arguments,X)){const{target:e,thisArg:r}=t.createCallBinding(n.expression,a,c,!0);return kw(FI(t.createFunctionApplyCall(Y(pn.checkDefined(bJ(e,R,q_))),r,V(n.arguments)),n),n)}return EJ(n,R,e)}(r);case 215:return function(n){if(p(n.arguments,X)){const{target:e,thisArg:r}=t.createCallBinding(t.createPropertyAccessExpression(n.expression,"bind"),a);return kw(FI(t.createNewExpression(t.createFunctionApplyCall(Y(pn.checkDefined(bJ(e,R,K_))),r,V(n.arguments,t.createVoidZero())),void 0,[]),n),n)}return EJ(n,R,e)}(r);default:return EJ(r,R,e)}}(r):4196352&r.transformFlags?EJ(r,R,e):r}}function J(n){if(n.asteriskToken)n=kw(FI(t.createFunctionDeclaration(n.modifiers,void 0,n.name,void 0,CJ(n.parameters,R,e),void 0,q(n.body)),n),n);else{const t=f,r=m;f=!1,m=!1,n=EJ(n,R,e),f=t,m=r}return f?void o(n):n}function z(n){if(n.asteriskToken)n=kw(FI(t.createFunctionExpression(void 0,void 0,n.name,void 0,CJ(n.parameters,R,e),void 0,q(n.body)),n),n);else{const t=f,r=m;f=!1,m=!1,n=EJ(n,R,e),f=t,m=r}return n}function q(e){const o=[],a=f,s=m,c=g,l=h,_=y,u=v,d=b,p=x,P=L,B=k,J=S,z=T,q=C;f=!0,m=!1,g=void 0,h=void 0,y=void 0,v=void 0,b=void 0,x=void 0,L=1,k=void 0,S=void 0,T=void 0,C=t.createTempVariable(void 0),r();const U=t.copyPrologue(e.statements,o,!1,R);W(e.statements,U);const V=function(){j=0,M=0,w=void 0,N=!1,D=!1,F=void 0,E=void 0,A=void 0,I=void 0,O=void 0;const e=function(){if(k){for(let e=0;e0)),1048576))}();return Rd(o,i()),o.push(t.createReturnStatement(V)),f=a,m=s,g=c,h=l,y=_,v=u,b=d,x=p,L=P,k=B,S=J,T=z,C=q,FI(t.createBlock(o,e.multiLine),e)}function U(e){let n=[];return r(e.left),r(e.right),t.inlineExpressions(n);function r(e){AF(e)&&28===e.operatorToken.kind?(r(e.left),r(e.right)):(X(e)&&n.length>0&&(Ne(1,[t.createExpressionStatement(t.inlineExpressions(n))]),n=[]),n.push(pn.checkDefined(bJ(e,R,K_))))}}function V(e,n,r,i){const o=Q(e);let a;if(o>0){a=Z();const r=xJ(e,R,K_,0,o);Se(a,t.createArrayLiteralExpression(n?[n,...r]:r)),n=void 0}const s=De(e,function(e,r){if(X(r)&&e.length>0){const r=void 0!==a;a||(a=Z()),Se(a,r?t.createArrayConcatCall(a,[t.createArrayLiteralExpression(e,i)]):t.createArrayLiteralExpression(n?[n,...e]:e,i)),n=void 0,e=[]}return e.push(pn.checkDefined(bJ(r,R,K_))),e},[],o);return a?t.createArrayConcatCall(a,[t.createArrayLiteralExpression(s,i)]):FI(t.createArrayLiteralExpression(n?[n,...s]:s,i),r)}function W(e,t=0){const n=e.length;for(let r=t;r0?Te(t,e):ke(e)}(n);case 253:return function(e){const t=me(e.label?bc(e.label):void 0);t>0?Te(t,e):ke(e)}(n);case 254:return function(e){t=bJ(e.expression,R,K_),n=e,Ne(8,[t],n);var t,n}(n);case 255:return function(e){X(e)?(function(e){const t=ee(),n=ee();te(t),ne({kind:1,expression:e,startLabel:t,endLabel:n})}(Y(pn.checkDefined(bJ(e.expression,R,K_)))),$(e.statement),function(){pn.assert(1===oe());te(re().endLabel)}()):ke(bJ(e,R,hu))}(n);case 256:return function(e){if(X(e.caseBlock)){const n=e.caseBlock,r=n.clauses.length,i=function(){const e=ee();return ne({kind:2,isScript:!1,breakLabel:e}),e}(),o=Y(pn.checkDefined(bJ(e.expression,R,K_))),a=[];let s=-1;for(let e=0;e0)break;l.push(t.createCaseClause(pn.checkDefined(bJ(r.expression,R,K_)),[ve(a[i],r.expression)]))}else e++}l.length&&(ke(t.createSwitchStatement(o,t.createCaseBlock(l))),c+=l.length,l=[]),e>0&&(c+=e,e=0)}Te(s>=0?a[s]:i);for(let e=0;e0)break;o.push(G(t))}o.length&&(ke(t.createExpressionStatement(t.inlineExpressions(o))),i+=o.length,o=[])}}function G(e){return Pw(t.createAssignment(Pw(t.cloneNode(e.name),e.name),pn.checkDefined(bJ(e.initializer,R,K_))),e)}function X(e){return!!e&&!!(1048576&e.transformFlags)}function Q(e){const t=e.length;for(let n=0;n=0;n--){const t=v[n];if(!de(t))break;if(t.labelText===e)return!0}return!1}function me(e){if(v)if(e)for(let t=v.length-1;t>=0;t--){const n=v[t];if(de(n)&&n.labelText===e)return n.breakLabel;if(ue(n)&&fe(e,t-1))return n.breakLabel}else for(let e=v.length-1;e>=0;e--){const t=v[e];if(ue(t))return t.breakLabel}return 0}function ge(e){if(v)if(e)for(let t=v.length-1;t>=0;t--){const n=v[t];if(pe(n)&&fe(e,t-1))return n.continueLabel}else for(let e=v.length-1;e>=0;e--){const t=v[e];if(pe(t))return t.continueLabel}return 0}function he(e){if(void 0!==e&&e>0){void 0===x&&(x=[]);const n=t.createNumericLiteral(Number.MAX_SAFE_INTEGER);return void 0===x[e]?x[e]=[n]:x[e].push(n),n}return t.createOmittedExpression()}function ye(e){const n=t.createNumericLiteral(e);return Uw(n,3,function(e){switch(e){case 2:return"return";case 3:return"break";case 4:return"yield";case 5:return"yield*";case 7:return"endfinally";default:return}}(e)),n}function ve(e,n){return pn.assertLessThan(0,e,"Invalid label"),FI(t.createReturnStatement(t.createArrayLiteralExpression([ye(3),he(e)])),n)}function xe(){Ne(0)}function ke(e){e?Ne(1,[e]):xe()}function Se(e,t,n){Ne(2,[e,t],n)}function Te(e,t){Ne(3,[e],t)}function Ce(e,t,n){Ne(4,[e,t],n)}function we(e,t,n){Ne(5,[e,t],n)}function Ne(e,t,n){void 0===k&&(k=[],S=[],T=[]),void 0===b&&te(ee());const r=k.length;k[r]=e,S[r]=t,T[r]=n}function Fe(){E&&(Pe(!N),N=!1,D=!1,M++)}function Ee(e){(function(e){if(!D)return!0;if(!b||!x)return!1;for(let t=0;t=0;e--){const n=O[e];E=[t.createWithStatement(n.expression,t.createBlock(E))]}if(I){const{startLabel:e,catchLabel:n,finallyLabel:r,endLabel:i}=I;E.unshift(t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createPropertyAccessExpression(C,"trys"),"push"),void 0,[t.createArrayLiteralExpression([he(e),he(n),he(r),he(i)])]))),I=void 0}e&&E.push(t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(C,"label"),t.createNumericLiteral(M+1))))}F.push(t.createCaseClause(t.createNumericLiteral(M),E||[])),E=void 0}function Ae(e){if(b)for(let t=0;t{Ju(e.arguments[0])&&!Cg(e.arguments[0].text,a)||(y=ae(y,e))});const n=function(e){switch(e){case 2:return S;case 3:return T;default:return k}}(u)(t);return g=void 0,h=void 0,b=!1,n});function x(){return!(BS(g.fileName)&&g.commonJsModuleIndicator&&(!g.externalModuleIndicator||!0===g.externalModuleIndicator))&&!(h.exportEquals||!uO(g))}function k(n){r();const o=[],s=Wk(a,"alwaysStrict")||uO(g),c=t.copyPrologue(n.statements,o,s&&!of(n),F);if(x()&&ae(o,G()),H(h.exportedNames)){const e=50;for(let n=0;n11===n.kind?t.createAssignment(t.createElementAccessExpression(t.createIdentifier("exports"),t.createStringLiteral(n.text)),e):t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("exports"),t.createIdentifier(bc(n))),e),t.createVoidZero())))}for(const e of h.exportedFunctions)W(o,e);ae(o,bJ(h.externalHelpersImportDeclaration,F,hu)),le(o,xJ(n.statements,F,hu,c)),D(o,!1),Rd(o,i());const l=t.updateSourceFile(n,FI(t.createNodeArray(o),n.statements));return Kw(l,e.readEmitHelpers()),l}function S(n){const r=t.createIdentifier("define"),i=JA(t,n,c,a),o=of(n)&&n,{aliasedModuleNames:s,unaliasedModuleNames:l,importAliasNames:u}=C(n,!0),d=t.updateSourceFile(n,FI(t.createNodeArray([t.createExpressionStatement(t.createCallExpression(r,void 0,[...i?[i]:[],t.createArrayLiteralExpression(o?_:[t.createStringLiteral("require"),t.createStringLiteral("exports"),...s,...l]),o?o.statements.length?o.statements[0].expression:t.createObjectLiteralExpression():t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,"require"),t.createParameterDeclaration(void 0,void 0,"exports"),...u],void 0,N(n))]))]),n.statements));return Kw(d,e.readEmitHelpers()),d}function T(n){const{aliasedModuleNames:r,unaliasedModuleNames:i,importAliasNames:o}=C(n,!1),s=JA(t,n,c,a),l=t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,"factory")],void 0,FI(t.createBlock([t.createIfStatement(t.createLogicalAnd(t.createTypeCheck(t.createIdentifier("module"),"object"),t.createTypeCheck(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),"object")),t.createBlock([t.createVariableStatement(void 0,[t.createVariableDeclaration("v",void 0,void 0,t.createCallExpression(t.createIdentifier("factory"),void 0,[t.createIdentifier("require"),t.createIdentifier("exports")]))]),ww(t.createIfStatement(t.createStrictInequality(t.createIdentifier("v"),t.createIdentifier("undefined")),t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),t.createIdentifier("v")))),1)]),t.createIfStatement(t.createLogicalAnd(t.createTypeCheck(t.createIdentifier("define"),"function"),t.createPropertyAccessExpression(t.createIdentifier("define"),"amd")),t.createBlock([t.createExpressionStatement(t.createCallExpression(t.createIdentifier("define"),void 0,[...s?[s]:[],t.createArrayLiteralExpression([t.createStringLiteral("require"),t.createStringLiteral("exports"),...r,...i]),t.createIdentifier("factory")]))])))],!0),void 0)),_=t.updateSourceFile(n,FI(t.createNodeArray([t.createExpressionStatement(t.createCallExpression(l,void 0,[t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,"require"),t.createParameterDeclaration(void 0,void 0,"exports"),...o],void 0,N(n))]))]),n.statements));return Kw(_,e.readEmitHelpers()),_}function C(e,n){const r=[],i=[],o=[];for(const n of e.amdDependencies)n.name?(r.push(t.createStringLiteral(n.path)),o.push(t.createParameterDeclaration(void 0,void 0,n.name))):i.push(t.createStringLiteral(n.path));for(const e of h.externalImports){const l=BA(t,e,g,c,s,a),_=RA(t,e,g);l&&(n&&_?(ww(_,8),r.push(l),o.push(t.createParameterDeclaration(void 0,void 0,_))):i.push(l))}return{aliasedModuleNames:r,unaliasedModuleNames:i,importAliasNames:o}}function w(e){if(CE(e)||RE(e)||!BA(t,e,g,c,s,a))return;const n=RA(t,e,g),r=R(e,n);return r!==n?t.createExpressionStatement(t.createAssignment(n,r)):void 0}function N(e){r();const n=[],o=t.copyPrologue(e.statements,n,!0,F);x()&&ae(n,G()),H(h.exportedNames)&&ae(n,t.createExpressionStatement(De(h.exportedNames,(e,n)=>11===n.kind?t.createAssignment(t.createElementAccessExpression(t.createIdentifier("exports"),t.createStringLiteral(n.text)),e):t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("exports"),t.createIdentifier(bc(n))),e),t.createVoidZero())));for(const e of h.exportedFunctions)W(n,e);ae(n,bJ(h.externalHelpersImportDeclaration,F,hu)),2===u&&le(n,J(h.externalImports,w)),le(n,xJ(e.statements,F,hu,o)),D(n,!0),Rd(n,i());const a=t.createBlock(n,!0);return b&&Hw(a,Aq),a}function D(e,n){if(h.exportEquals){const r=bJ(h.exportEquals.expression,A,K_);if(r)if(n){const n=t.createReturnStatement(r);FI(n,h.exportEquals),ww(n,3840),e.push(n)}else{const n=t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),r));FI(n,h.exportEquals),ww(n,3072),e.push(n)}}}function F(e){switch(e.kind){case 273:return function(e){let n;const r=Ng(e);if(2!==u){if(!e.importClause)return kw(FI(t.createExpressionStatement(B(e)),e),e);{const i=[];r&&!Dg(e)?i.push(t.createVariableDeclaration(t.cloneNode(r.name),void 0,void 0,R(e,B(e)))):(i.push(t.createVariableDeclaration(t.getGeneratedNameForNode(e),void 0,void 0,R(e,B(e)))),r&&Dg(e)&&i.push(t.createVariableDeclaration(t.cloneNode(r.name),void 0,void 0,t.getGeneratedNameForNode(e)))),n=ae(n,kw(FI(t.createVariableStatement(void 0,t.createVariableDeclarationList(i,l>=2?2:0)),e),e))}}else r&&Dg(e)&&(n=ae(n,t.createVariableStatement(void 0,t.createVariableDeclarationList([kw(FI(t.createVariableDeclaration(t.cloneNode(r.name),void 0,void 0,t.getGeneratedNameForNode(e)),e),e)],l>=2?2:0))));return n=function(e,t){if(h.exportEquals)return e;const n=t.importClause;if(!n)return e;const r=new _z;n.name&&(e=$(e,r,n));const i=n.namedBindings;if(i)switch(i.kind){case 275:e=$(e,r,i);break;case 276:for(const t of i.elements)e=$(e,r,t,!0)}return e}(n,e),Te(n)}(e);case 272:return function(e){let n;pn.assert(Dm(e),"import= for internal module references should be handled in an earlier transformer."),2!==u?n=Av(e,32)?ae(n,kw(FI(t.createExpressionStatement(Q(e.name,B(e))),e),e)):ae(n,kw(FI(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.cloneNode(e.name),void 0,void 0,B(e))],l>=2?2:0)),e),e)):Av(e,32)&&(n=ae(n,kw(FI(t.createExpressionStatement(Q(t.getExportName(e),t.getLocalName(e))),e),e)));return n=function(e,t){if(h.exportEquals)return e;return $(e,new _z,t)}(n,e),Te(n)}(e);case 279:return function(e){if(!e.moduleSpecifier)return;const r=t.getGeneratedNameForNode(e);if(e.exportClause&&BE(e.exportClause)){const i=[];2!==u&&i.push(kw(FI(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(r,void 0,void 0,B(e))])),e),e));for(const o of e.exportClause.elements){const s=o.propertyName||o.name,c=!!Dk(a)&&!(2&ip(e))&&Yd(s)?n().createImportDefaultHelper(r):r,l=11===s.kind?t.createElementAccessExpression(c,s):t.createPropertyAccessExpression(c,s);i.push(kw(FI(t.createExpressionStatement(Q(11===o.name.kind?t.cloneNode(o.name):t.getExportName(o),l,void 0,!0)),o),o))}return Te(i)}if(e.exportClause){const i=[];return i.push(kw(FI(t.createExpressionStatement(Q(t.cloneNode(e.exportClause.name),function(e,t){if(!Dk(a)||2&ip(e))return t;if(iz(e))return n().createImportStarHelper(t);return t}(e,2!==u?B(e):Gd(e)||11===e.exportClause.name.kind?r:t.createIdentifier(bc(e.exportClause.name))))),e),e)),Te(i)}return kw(FI(t.createExpressionStatement(n().createExportStarHelper(2!==u?B(e):r)),e),e)}(e);case 278:return function(e){if(e.isExportEquals)return;return X(t.createIdentifier("default"),bJ(e.expression,A,K_),e,!0)}(e);default:return E(e)}}function E(n){switch(n.kind){case 244:return function(n){let r,i,o;if(Av(n,32)){let e,a=!1;for(const r of n.declarationList.declarations)if(uD(r.name)&&kA(r.name))if(e||(e=xJ(n.modifiers,Y,r_)),r.initializer){i=ae(i,t.updateVariableDeclaration(r,r.name,void 0,void 0,Q(r.name,bJ(r.initializer,A,K_))))}else i=ae(i,r);else if(r.initializer)if(!w_(r.name)&&(CF(r.initializer)||TF(r.initializer)||MF(r.initializer))){const e=t.createAssignment(FI(t.createPropertyAccessExpression(t.createIdentifier("exports"),r.name),r.name),t.createIdentifier($h(r.name)));i=ae(i,t.createVariableDeclaration(r.name,r.exclamationToken,r.type,bJ(r.initializer,A,K_))),o=ae(o,e),a=!0}else o=ae(o,q(r));if(i&&(r=ae(r,t.updateVariableStatement(n,e,t.updateVariableDeclarationList(n.declarationList,i)))),o){const e=kw(FI(t.createExpressionStatement(t.inlineExpressions(o)),n),n);a&&Cw(e),r=ae(r,e)}}else r=ae(r,EJ(n,A,e));return r=function(e,t){return U(e,t.declarationList,!1)}(r,n),Te(r)}(n);case 263:return function(n){let r;r=Av(n,32)?ae(r,kw(FI(t.createFunctionDeclaration(xJ(n.modifiers,Y,r_),n.asteriskToken,t.getDeclarationName(n,!0,!0),void 0,xJ(n.parameters,A,FD),void 0,EJ(n.body,A,e)),n),n)):ae(r,EJ(n,A,e));return Te(r)}(n);case 264:return function(n){let r;r=Av(n,32)?ae(r,kw(FI(t.createClassDeclaration(xJ(n.modifiers,Y,b_),t.getDeclarationName(n,!0,!0),void 0,xJ(n.heritageClauses,A,aP),xJ(n.members,A,f_)),n),n)):ae(r,EJ(n,A,e));return r=W(r,n),Te(r)}(n);case 249:return L(n,!0);case 250:return function(n){if(mE(n.initializer)&&!(7&n.initializer.flags)){const r=U(void 0,n.initializer,!0);if(H(r)){const i=bJ(n.initializer,I,iu),o=bJ(n.expression,A,K_),a=DJ(n.statement,E,e),s=GF(a)?t.updateBlock(a,[...r,...a.statements]):t.createBlock([...r,a],!0);return t.updateForInStatement(n,i,o,s)}}return t.updateForInStatement(n,bJ(n.initializer,I,iu),bJ(n.expression,A,K_),DJ(n.statement,E,e))}(n);case 251:return function(n){if(mE(n.initializer)&&!(7&n.initializer.flags)){const r=U(void 0,n.initializer,!0),i=bJ(n.initializer,I,iu),o=bJ(n.expression,A,K_);let a=DJ(n.statement,E,e);return H(r)&&(a=GF(a)?t.updateBlock(a,[...r,...a.statements]):t.createBlock([...r,a],!0)),t.updateForOfStatement(n,n.awaitModifier,i,o,a)}return t.updateForOfStatement(n,n.awaitModifier,bJ(n.initializer,I,iu),bJ(n.expression,A,K_),DJ(n.statement,E,e))}(n);case 247:return function(n){return t.updateDoStatement(n,DJ(n.statement,E,e),bJ(n.expression,A,K_))}(n);case 248:return function(n){return t.updateWhileStatement(n,bJ(n.expression,A,K_),DJ(n.statement,E,e))}(n);case 257:return function(e){return t.updateLabeledStatement(e,e.label,bJ(e.statement,E,hu,t.liftToBlock)??FI(t.createEmptyStatement(),e.statement))}(n);case 255:return function(e){return t.updateWithStatement(e,bJ(e.expression,A,K_),pn.checkDefined(bJ(e.statement,E,hu,t.liftToBlock)))}(n);case 246:return function(e){return t.updateIfStatement(e,bJ(e.expression,A,K_),bJ(e.thenStatement,E,hu,t.liftToBlock)??t.createBlock([]),bJ(e.elseStatement,E,hu,t.liftToBlock))}(n);case 256:return function(e){return t.updateSwitchStatement(e,bJ(e.expression,A,K_),pn.checkDefined(bJ(e.caseBlock,E,SE)))}(n);case 270:return function(e){return t.updateCaseBlock(e,xJ(e.clauses,E,wu))}(n);case 297:return function(e){return t.updateCaseClause(e,bJ(e.expression,A,K_),xJ(e.statements,E,hu))}(n);case 298:case 259:return function(t){return EJ(t,E,e)}(n);case 300:return function(e){return t.updateCatchClause(e,e.variableDeclaration,pn.checkDefined(bJ(e.block,E,GF)))}(n);case 242:return function(t){return t=EJ(t,E,e),t}(n);default:return A(n)}}function P(r,i){if(!(276828160&r.transformFlags||(null==y?void 0:y.length)))return r;switch(r.kind){case 249:return L(r,!1);case 245:return function(e){return t.updateExpressionStatement(e,bJ(e.expression,I,K_))}(r);case 218:return function(e,n){return t.updateParenthesizedExpression(e,bJ(e.expression,n?I:A,K_))}(r,i);case 356:return function(e,n){return t.updatePartiallyEmittedExpression(e,bJ(e.expression,n?I:A,K_))}(r,i);case 214:const _=r===ge(y);if(_&&y.shift(),ff(r)&&c.shouldTransformImportCall(g))return function(r,i){if(0===u&&l>=7)return EJ(r,A,e);const _=BA(t,r,g,c,s,a),d=bJ(ge(r.arguments),A,K_),p=!_||d&&KN(d)&&d.text===_.text?d&&i?KN(d)?Oz(d,a):n().createRewriteRelativeImportExtensionsHelper(d):d:_,f=!!(16384&r.transformFlags);switch(a.module){case 2:return j(p,f);case 3:return function(e,n){if(b=!0,dz(e)){const r=Gl(e)?e:KN(e)?t.createStringLiteralFromNode(e):ww(FI(t.cloneNode(e),e),3072);return t.createConditionalExpression(t.createIdentifier("__syncRequire"),void 0,M(e),void 0,j(r,n))}{const r=t.createTempVariable(o);return t.createComma(t.createAssignment(r,e),t.createConditionalExpression(t.createIdentifier("__syncRequire"),void 0,M(r,!0),void 0,j(r,n)))}}(p??t.createVoidZero(),f);default:return M(p)}}(r,_);if(_)return function(e){return t.updateCallExpression(e,e.expression,void 0,xJ(e.arguments,t=>t===e.arguments[0]?Ju(t)?Oz(t,a):n().createRewriteRelativeImportExtensionsHelper(t):A(t),K_))}(r);break;case 227:if(lb(r))return function(t,n){if(O(t.left))return jz(t,A,e,0,!n,z);return EJ(t,A,e)}(r,i);break;case 225:case 226:return function(n,r){if((46===n.operator||47===n.operator)&&uD(n.operand)&&!Gl(n.operand)&&!kA(n.operand)&&!rx(n.operand)){const e=ee(n.operand);if(e){let i,a=bJ(n.operand,A,K_);EF(n)?a=t.updatePrefixUnaryExpression(n,a):(a=t.updatePostfixUnaryExpression(n,a),r||(i=t.createTempVariable(o),a=t.createAssignment(i,a),FI(a,n)),a=t.createComma(a,t.cloneNode(n.operand)),FI(a,n));for(const t of e)v[_J(a)]=!0,a=Q(t,a),FI(a,n);return i&&(v[_J(a)]=!0,a=t.createComma(a,i),FI(a,n)),a}}return EJ(n,A,e)}(r,i)}return EJ(r,A,e)}function A(e){return P(e,!1)}function I(e){return P(e,!0)}function O(e){if(gF(e))for(const t of e.properties)switch(t.kind){case 304:if(O(t.initializer))return!0;break;case 305:if(O(t.name))return!0;break;case 306:if(O(t.expression))return!0;break;case 175:case 178:case 179:return!1;default:pn.assertNever(t,"Unhandled object member kind")}else if(mF(e)){for(const t of e.elements)if(jF(t)){if(O(t.expression))return!0}else if(O(t))return!0}else if(uD(e))return d(ee(e))>(SA(e)?1:0);return!1}function L(n,r){if(r&&n.initializer&&mE(n.initializer)&&!(7&n.initializer.flags)){const i=U(void 0,n.initializer,!1);if(i){const o=[],a=bJ(n.initializer,I,mE),s=t.createVariableStatement(void 0,a);o.push(s),le(o,i);const c=bJ(n.condition,A,K_),l=bJ(n.incrementor,I,K_),_=DJ(n.statement,r?E:A,e);return o.push(t.updateForStatement(n,void 0,c,l,_)),o}}return t.updateForStatement(n,bJ(n.initializer,I,iu),bJ(n.condition,A,K_),bJ(n.incrementor,I,K_),DJ(n.statement,r?E:A,e))}function j(e,r){const i=t.createUniqueName("resolve"),o=t.createUniqueName("reject"),s=[t.createParameterDeclaration(void 0,void 0,i),t.createParameterDeclaration(void 0,void 0,o)],c=t.createBlock([t.createExpressionStatement(t.createCallExpression(t.createIdentifier("require"),void 0,[t.createArrayLiteralExpression([e||t.createOmittedExpression()]),i,o]))]);let _;l>=2?_=t.createArrowFunction(void 0,void 0,s,void 0,void 0,c):(_=t.createFunctionExpression(void 0,void 0,void 0,void 0,s,void 0,c),r&&ww(_,16));const u=t.createNewExpression(t.createIdentifier("Promise"),void 0,[_]);return Dk(a)?t.createCallExpression(t.createPropertyAccessExpression(u,t.createIdentifier("then")),void 0,[n().createImportStarCallbackHelper()]):u}function M(e,r){const i=e&&!pz(e)&&!r,o=t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Promise"),"resolve"),void 0,i?l>=2?[t.createTemplateExpression(t.createTemplateHead(""),[t.createTemplateSpan(e,t.createTemplateTail(""))])]:[t.createCallExpression(t.createPropertyAccessExpression(t.createStringLiteral(""),"concat"),void 0,[e])]:[]);let s=t.createCallExpression(t.createIdentifier("require"),void 0,i?[t.createIdentifier("s")]:e?[e]:[]);Dk(a)&&(s=n().createImportStarHelper(s));const c=i?[t.createParameterDeclaration(void 0,void 0,"s")]:[];let _;_=l>=2?t.createArrowFunction(void 0,void 0,c,void 0,void 0,s):t.createFunctionExpression(void 0,void 0,void 0,void 0,c,void 0,t.createBlock([t.createReturnStatement(s)]));return t.createCallExpression(t.createPropertyAccessExpression(o,"then"),void 0,[_])}function R(e,t){return!Dk(a)||2&ip(e)?t:oz(e)?n().createImportStarHelper(t):az(e)?n().createImportDefaultHelper(t):t}function B(e){const n=BA(t,e,g,c,s,a),r=[];return n&&r.push(Oz(n,a)),t.createCallExpression(t.createIdentifier("require"),void 0,r)}function z(e,n,r){const i=ee(e);if(i){let o=SA(e)?n:t.createAssignment(e,n);for(const e of i)ww(o,8),o=Q(e,o,r);return o}return t.createAssignment(e,n)}function q(n){return w_(n.name)?jz(bJ(n,A,ox),A,e,0,!1,z):t.createAssignment(FI(t.createPropertyAccessExpression(t.createIdentifier("exports"),n.name),n.name),n.initializer?bJ(n.initializer,A,K_):t.createVoidZero())}function U(e,t,n){if(h.exportEquals)return e;for(const r of t.declarations)e=V(e,r,n);return e}function V(e,t,n){if(h.exportEquals)return e;if(w_(t.name))for(const r of t.name.elements)RF(r)||(e=V(e,r,n));else Gl(t.name)||fE(t)&&!t.initializer&&!n||(e=$(e,new _z,t));return e}function W(e,n){if(h.exportEquals)return e;const r=new _z;if(Av(n,32)){e=K(e,r,Av(n,2048)?t.createIdentifier("default"):t.getDeclarationName(n),t.getLocalName(n),n)}return n.name&&(e=$(e,r,n)),e}function $(e,n,r,i){const o=t.getDeclarationName(r),a=h.exportSpecifiers.get(o);if(a)for(const t of a)e=K(e,n,t.name,o,t.name,void 0,i);return e}function K(e,t,n,r,i,o,a){if(11!==n.kind){if(t.has(n))return e;t.set(n,!0)}return e=ae(e,X(n,r,i,o,a))}function G(){const e=t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"defineProperty"),void 0,[t.createIdentifier("exports"),t.createStringLiteral("__esModule"),t.createObjectLiteralExpression([t.createPropertyAssignment("value",t.createTrue())])]));return ww(e,2097152),e}function X(e,n,r,i,o){const a=FI(t.createExpressionStatement(Q(e,n,void 0,o)),r);return OA(a),i||ww(a,3072),a}function Q(e,n,r,i){return FI(i?t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"defineProperty"),void 0,[t.createIdentifier("exports"),t.createStringLiteralFromNode(e),t.createObjectLiteralExpression([t.createPropertyAssignment("enumerable",t.createTrue()),t.createPropertyAssignment("get",t.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,t.createBlock([t.createReturnStatement(n)])))])]):t.createAssignment(11===e.kind?t.createElementAccessExpression(t.createIdentifier("exports"),t.cloneNode(e)):t.createPropertyAccessExpression(t.createIdentifier("exports"),t.cloneNode(e)),n),r)}function Y(e){switch(e.kind){case 95:case 90:return}return e}function Z(e){var n,r;if(8192&rp(e)){const n=LA(g);return n?t.createPropertyAccessExpression(n,e):e}if((!Gl(e)||64&e.emitNode.autoGenerate.flags)&&!kA(e)){const i=s.getReferencedExportContainer(e,SA(e));if(i&&308===i.kind)return FI(t.createPropertyAccessExpression(t.createIdentifier("exports"),t.cloneNode(e)),e);const o=s.getReferencedImportDeclaration(e);if(o){if(NE(o))return FI(t.createPropertyAccessExpression(t.getGeneratedNameForNode(o.parent),t.createIdentifier("default")),e);if(jE(o)){const i=o.propertyName||o.name,a=t.getGeneratedNameForNode((null==(r=null==(n=o.parent)?void 0:n.parent)?void 0:r.parent)||o);return FI(11===i.kind?t.createElementAccessExpression(a,t.cloneNode(i)):t.createPropertyAccessExpression(a,t.cloneNode(i)),e)}}}return e}function ee(e){if(Gl(e)){if(Ql(e)){const t=null==h?void 0:h.exportSpecifiers.get(e);if(t){const e=[];for(const n of t)e.push(n.name);return e}}}else{const t=s.getReferencedImportDeclaration(e);if(t)return null==h?void 0:h.exportedBindings[ez(t)];const n=new Set,r=s.getReferencedValueDeclarations(e);if(r){for(const e of r){const t=null==h?void 0:h.exportedBindings[ez(e)];if(t)for(const e of t)n.add(e)}if(n.size)return je(n)}}}}var Aq={name:"typescript:dynamicimport-sync-require",scoped:!0,text:'\n var __syncRequire = typeof module === "object" && typeof module.exports === "object";'};function Iq(e){const{factory:t,startLexicalEnvironment:n,endLexicalEnvironment:r,hoistVariableDeclaration:i}=e,o=e.getCompilerOptions(),a=e.getEmitResolver(),s=e.getEmitHost(),c=e.onSubstituteNode,l=e.onEmitNode;e.onSubstituteNode=function(e,n){if(function(e){return x&&e.id&&x[e.id]}(n=c(e,n)))return n;if(1===e)return function(e){switch(e.kind){case 80:return function(e){var n,r;if(8192&rp(e)){const n=LA(m);return n?t.createPropertyAccessExpression(n,e):e}if(!Gl(e)&&!kA(e)){const i=a.getReferencedImportDeclaration(e);if(i){if(NE(i))return FI(t.createPropertyAccessExpression(t.getGeneratedNameForNode(i.parent),t.createIdentifier("default")),e);if(jE(i)){const o=i.propertyName||i.name,a=t.getGeneratedNameForNode((null==(r=null==(n=i.parent)?void 0:n.parent)?void 0:r.parent)||i);return FI(11===o.kind?t.createElementAccessExpression(a,t.cloneNode(o)):t.createPropertyAccessExpression(a,t.cloneNode(o)),e)}}}return e}(e);case 227:return function(e){if(ob(e.operatorToken.kind)&&uD(e.left)&&(!Gl(e.left)||Ql(e.left))&&!kA(e.left)){const t=K(e.left);if(t){let n=e;for(const e of t)n=R(e,G(n));return n}}return e}(e);case 237:return function(e){if(mf(e))return t.createPropertyAccessExpression(y,t.createIdentifier("meta"));return e}(e)}return e}(n);if(4===e)return function(e){if(305===e.kind)return function(e){var n,r;const i=e.name;if(!Gl(i)&&!kA(i)){const o=a.getReferencedImportDeclaration(i);if(o){if(NE(o))return FI(t.createPropertyAssignment(t.cloneNode(i),t.createPropertyAccessExpression(t.getGeneratedNameForNode(o.parent),t.createIdentifier("default"))),e);if(jE(o)){const a=o.propertyName||o.name,s=t.getGeneratedNameForNode((null==(r=null==(n=o.parent)?void 0:n.parent)?void 0:r.parent)||o);return FI(t.createPropertyAssignment(t.cloneNode(i),11===a.kind?t.createElementAccessExpression(s,t.cloneNode(a)):t.createPropertyAccessExpression(s,t.cloneNode(a))),e)}}}return e}(e);return e}(n);return n},e.onEmitNode=function(e,t,n){if(308===t.kind){const r=ez(t);m=t,g=_[r],h=u[r],x=d[r],y=f[r],x&&delete d[r],l(e,t,n),m=void 0,g=void 0,h=void 0,y=void 0,x=void 0}else l(e,t,n)},e.enableSubstitution(80),e.enableSubstitution(305),e.enableSubstitution(227),e.enableSubstitution(237),e.enableEmitNotification(308);const _=[],u=[],d=[],f=[];let m,g,h,y,v,b,x;return rz(e,function(i){if(i.isDeclarationFile||!(xp(i,o)||8388608&i.transformFlags))return i;const c=ez(i);m=i,b=i,g=_[c]=sz(e,i),h=t.createUniqueName("exports"),u[c]=h,y=f[c]=t.createUniqueName("context");const l=function(e){const n=new Map,r=[];for(const i of e){const e=BA(t,i,m,s,a,o);if(e){const t=e.text,o=n.get(t);void 0!==o?r[o].externalImports.push(i):(n.set(t,r.length),r.push({name:e,externalImports:[i]}))}}return r}(g.externalImports),p=function(e,i){const a=[];n();const s=Wk(o,"alwaysStrict")||uO(m),c=t.copyPrologue(e.statements,a,s,T);a.push(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration("__moduleName",void 0,void 0,t.createLogicalAnd(y,t.createPropertyAccessExpression(y,"id")))]))),bJ(g.externalHelpersImportDeclaration,T,hu);const l=xJ(e.statements,T,hu,c);le(a,v),Rd(a,r());const _=function(e){if(!g.hasExportStarsToExportValues)return;if(!H(g.exportedNames)&&0===g.exportedFunctions.size&&0===g.exportSpecifiers.size){let t=!1;for(const e of g.externalImports)if(279===e.kind&&e.exportClause){t=!0;break}if(!t){const t=k(void 0);return e.push(t),t.name}}const n=[];if(g.exportedNames)for(const e of g.exportedNames)Yd(e)||n.push(t.createPropertyAssignment(t.createStringLiteralFromNode(e),t.createTrue()));for(const e of g.exportedFunctions)Av(e,2048)||(pn.assert(!!e.name),n.push(t.createPropertyAssignment(t.createStringLiteralFromNode(e.name),t.createTrue())));const r=t.createUniqueName("exportedNames");e.push(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(r,void 0,void 0,t.createObjectLiteralExpression(n,!0))])));const i=k(r);return e.push(i),i.name}(a),u=2097152&e.transformFlags?t.createModifiersFromModifierFlags(1024):void 0,d=t.createObjectLiteralExpression([t.createPropertyAssignment("setters",S(_,i)),t.createPropertyAssignment("execute",t.createFunctionExpression(u,void 0,void 0,void 0,[],void 0,t.createBlock(l,!0)))],!0);return a.push(t.createReturnStatement(d)),t.createBlock(a,!0)}(i,l),C=t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,h),t.createParameterDeclaration(void 0,void 0,y)],void 0,p),w=JA(t,i,s,o),N=t.createArrayLiteralExpression(P(l,e=>e.name)),D=ww(t.updateSourceFile(i,FI(t.createNodeArray([t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("System"),"register"),void 0,w?[w,N,C]:[N,C]))]),i.statements)),2048);o.outFile||Qw(D,p,e=>!e.scoped);x&&(d[c]=x,x=void 0);return m=void 0,g=void 0,h=void 0,y=void 0,v=void 0,b=void 0,D});function k(e){const n=t.createUniqueName("exportStar"),r=t.createIdentifier("m"),i=t.createIdentifier("n"),o=t.createIdentifier("exports");let a=t.createStrictInequality(i,t.createStringLiteral("default"));return e&&(a=t.createLogicalAnd(a,t.createLogicalNot(t.createCallExpression(t.createPropertyAccessExpression(e,"hasOwnProperty"),void 0,[i])))),t.createFunctionDeclaration(void 0,void 0,n,void 0,[t.createParameterDeclaration(void 0,void 0,r)],void 0,t.createBlock([t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(o,void 0,void 0,t.createObjectLiteralExpression([]))])),t.createForInStatement(t.createVariableDeclarationList([t.createVariableDeclaration(i)]),r,t.createBlock([ww(t.createIfStatement(a,t.createExpressionStatement(t.createAssignment(t.createElementAccessExpression(o,i),t.createElementAccessExpression(r,i)))),1)])),t.createExpressionStatement(t.createCallExpression(h,void 0,[o]))],!0))}function S(e,n){const r=[];for(const i of n){const n=p(i.externalImports,e=>RA(t,e,m)),o=n?t.getGeneratedNameForNode(n):t.createUniqueName(""),a=[];for(const n of i.externalImports){const r=RA(t,n,m);switch(n.kind){case 273:if(!n.importClause)break;case 272:pn.assert(void 0!==r),a.push(t.createExpressionStatement(t.createAssignment(r,o))),Av(n,32)&&a.push(t.createExpressionStatement(t.createCallExpression(h,void 0,[t.createStringLiteral(bc(r)),o])));break;case 279:if(pn.assert(void 0!==r),n.exportClause)if(BE(n.exportClause)){const e=[];for(const r of n.exportClause.elements)e.push(t.createPropertyAssignment(t.createStringLiteral(Xd(r.name)),t.createElementAccessExpression(o,t.createStringLiteral(Xd(r.propertyName||r.name)))));a.push(t.createExpressionStatement(t.createCallExpression(h,void 0,[t.createObjectLiteralExpression(e,!0)])))}else a.push(t.createExpressionStatement(t.createCallExpression(h,void 0,[t.createStringLiteral(Xd(n.exportClause.name)),o])));else a.push(t.createExpressionStatement(t.createCallExpression(e,void 0,[o])))}}r.push(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,o)],void 0,t.createBlock(a,!0)))}return t.createArrayLiteralExpression(r,!0)}function T(e){switch(e.kind){case 273:return function(e){let n;e.importClause&&i(RA(t,e,m));return Te(function(e,t){if(g.exportEquals)return e;const n=t.importClause;if(!n)return e;n.name&&(e=L(e,n));const r=n.namedBindings;if(r)switch(r.kind){case 275:e=L(e,r);break;case 276:for(const t of r.elements)e=L(e,t)}return e}(n,e))}(e);case 272:return function(e){let n;return pn.assert(Dm(e),"import= for internal module references should be handled in an earlier transformer."),i(RA(t,e,m)),Te(function(e,t){if(g.exportEquals)return e;return L(e,t)}(n,e))}(e);case 279:return function(e){return void pn.assertIsDefined(e)}(e);case 278:return function(e){if(e.isExportEquals)return;const n=bJ(e.expression,U,K_);return M(t.createIdentifier("default"),n,!0)}(e);default:return B(e)}}function C(e){if(!N(e.declarationList))return bJ(e,U,hu);let n;if(lf(e.declarationList)||cf(e.declarationList)){const r=xJ(e.modifiers,$,b_),i=[];for(const n of e.declarationList.declarations)i.push(t.updateVariableDeclaration(n,t.getGeneratedNameForNode(n.name),void 0,void 0,D(n,!1)));const o=t.updateVariableDeclarationList(e.declarationList,i);n=ae(n,t.updateVariableStatement(e,r,o))}else{let r;const i=Av(e,32);for(const t of e.declarationList.declarations)t.initializer?r=ae(r,D(t,i)):w(t);r&&(n=ae(n,FI(t.createExpressionStatement(t.inlineExpressions(r)),e)))}return n=function(e,t,n){if(g.exportEquals)return e;for(const r of t.declarationList.declarations)(r.initializer||n)&&(e=I(e,r,n));return e}(n,e,!1),Te(n)}function w(e){if(w_(e.name))for(const t of e.name.elements)RF(t)||w(t);else i(t.cloneNode(e.name))}function N(e){return!(4194304&rp(e)||308!==b.kind&&7&fc(e).flags)}function D(t,n){const r=n?F:E;return w_(t.name)?jz(t,U,e,0,!1,r):t.initializer?r(t.name,bJ(t.initializer,U,K_)):t.name}function F(e,t,n){return A(e,t,n,!0)}function E(e,t,n){return A(e,t,n,!1)}function A(e,n,r,o){return i(t.cloneNode(e)),o?R(e,G(FI(t.createAssignment(e,n),r))):G(FI(t.createAssignment(e,n),r))}function I(e,n,r){if(g.exportEquals)return e;if(w_(n.name))for(const t of n.name.elements)RF(t)||(e=I(e,t,r));else if(!Gl(n.name)){let i;r&&(e=j(e,n.name,t.getLocalName(n)),i=bc(n.name)),e=L(e,n,i)}return e}function O(e,n){if(g.exportEquals)return e;let r;if(Av(n,32)){const i=Av(n,2048)?t.createStringLiteral("default"):n.name;e=j(e,i,t.getLocalName(n)),r=$h(i)}return n.name&&(e=L(e,n,r)),e}function L(e,n,r){if(g.exportEquals)return e;const i=t.getDeclarationName(n),o=g.exportSpecifiers.get(i);if(o)for(const t of o)Xd(t.name)!==r&&(e=j(e,t.name,i));return e}function j(e,t,n,r){return e=ae(e,M(t,n,r))}function M(e,n,r){const i=t.createExpressionStatement(R(e,n));return OA(i),r||ww(i,3072),i}function R(e,n){const r=uD(e)?t.createStringLiteralFromNode(e):e;return ww(n,3072|rp(n)),Mw(t.createCallExpression(h,void 0,[r,n]),n)}function B(n){switch(n.kind){case 244:return C(n);case 263:return function(n){v=Av(n,32)?ae(v,t.updateFunctionDeclaration(n,xJ(n.modifiers,$,b_),n.asteriskToken,t.getDeclarationName(n,!0,!0),void 0,xJ(n.parameters,U,FD),void 0,bJ(n.body,U,GF))):ae(v,EJ(n,U,e)),v=O(v,n)}(n);case 264:return function(e){let n;const r=t.getLocalName(e);return i(r),n=ae(n,FI(t.createExpressionStatement(t.createAssignment(r,FI(t.createClassExpression(xJ(e.modifiers,$,b_),e.name,void 0,xJ(e.heritageClauses,U,aP),xJ(e.members,U,f_)),e))),e)),n=O(n,e),Te(n)}(n);case 249:return J(n,!0);case 250:return function(n){const r=b;return b=n,n=t.updateForInStatement(n,z(n.initializer),bJ(n.expression,U,K_),DJ(n.statement,B,e)),b=r,n}(n);case 251:return function(n){const r=b;return b=n,n=t.updateForOfStatement(n,n.awaitModifier,z(n.initializer),bJ(n.expression,U,K_),DJ(n.statement,B,e)),b=r,n}(n);case 247:return function(n){return t.updateDoStatement(n,DJ(n.statement,B,e),bJ(n.expression,U,K_))}(n);case 248:return function(n){return t.updateWhileStatement(n,bJ(n.expression,U,K_),DJ(n.statement,B,e))}(n);case 257:return function(e){return t.updateLabeledStatement(e,e.label,bJ(e.statement,B,hu,t.liftToBlock)??t.createExpressionStatement(t.createIdentifier("")))}(n);case 255:return function(e){return t.updateWithStatement(e,bJ(e.expression,U,K_),pn.checkDefined(bJ(e.statement,B,hu,t.liftToBlock)))}(n);case 246:return function(e){return t.updateIfStatement(e,bJ(e.expression,U,K_),bJ(e.thenStatement,B,hu,t.liftToBlock)??t.createBlock([]),bJ(e.elseStatement,B,hu,t.liftToBlock))}(n);case 256:return function(e){return t.updateSwitchStatement(e,bJ(e.expression,U,K_),pn.checkDefined(bJ(e.caseBlock,B,SE)))}(n);case 270:return function(e){const n=b;return b=e,e=t.updateCaseBlock(e,xJ(e.clauses,B,wu)),b=n,e}(n);case 297:return function(e){return t.updateCaseClause(e,bJ(e.expression,U,K_),xJ(e.statements,B,hu))}(n);case 298:case 259:return function(t){return EJ(t,B,e)}(n);case 300:return function(e){const n=b;return b=e,e=t.updateCatchClause(e,e.variableDeclaration,pn.checkDefined(bJ(e.block,B,GF))),b=n,e}(n);case 242:return function(t){const n=b;return b=t,t=EJ(t,B,e),b=n,t}(n);default:return U(n)}}function J(n,r){const i=b;return b=n,n=t.updateForStatement(n,bJ(n.initializer,r?z:V,iu),bJ(n.condition,U,K_),bJ(n.incrementor,V,K_),DJ(n.statement,r?B:U,e)),b=i,n}function z(e){if(function(e){return mE(e)&&N(e)}(e)){let n;for(const t of e.declarations)n=ae(n,D(t,!1)),t.initializer||w(t);return n?t.inlineExpressions(n):t.createOmittedExpression()}return bJ(e,V,iu)}function q(n,r){if(!(276828160&n.transformFlags))return n;switch(n.kind){case 249:return J(n,!1);case 245:return function(e){return t.updateExpressionStatement(e,bJ(e.expression,V,K_))}(n);case 218:return function(e,n){return t.updateParenthesizedExpression(e,bJ(e.expression,n?V:U,K_))}(n,r);case 356:return function(e,n){return t.updatePartiallyEmittedExpression(e,bJ(e.expression,n?V:U,K_))}(n,r);case 227:if(lb(n))return function(t,n){if(W(t.left))return jz(t,U,e,0,!n);return EJ(t,U,e)}(n,r);break;case 214:if(ff(n))return function(e){const n=BA(t,e,m,s,a,o),r=bJ(ge(e.arguments),U,K_),i=!n||r&&KN(r)&&r.text===n.text?r:n;return t.createCallExpression(t.createPropertyAccessExpression(y,t.createIdentifier("import")),void 0,i?[i]:[])}(n);break;case 225:case 226:return function(n,r){if((46===n.operator||47===n.operator)&&uD(n.operand)&&!Gl(n.operand)&&!kA(n.operand)&&!rx(n.operand)){const e=K(n.operand);if(e){let o,a=bJ(n.operand,U,K_);EF(n)?a=t.updatePrefixUnaryExpression(n,a):(a=t.updatePostfixUnaryExpression(n,a),r||(o=t.createTempVariable(i),a=t.createAssignment(o,a),FI(a,n)),a=t.createComma(a,t.cloneNode(n.operand)),FI(a,n));for(const t of e)a=R(t,G(a));return o&&(a=t.createComma(a,o),FI(a,n)),a}}return EJ(n,U,e)}(n,r)}return EJ(n,U,e)}function U(e){return q(e,!1)}function V(e){return q(e,!0)}function W(e){if(cb(e,!0))return W(e.left);if(jF(e))return W(e.expression);if(gF(e))return H(e.properties,W);if(mF(e))return H(e.elements,W);if(lP(e))return W(e.name);if(cP(e))return W(e.initializer);if(uD(e)){const t=a.getReferencedExportContainer(e);return void 0!==t&&308===t.kind}return!1}function $(e){switch(e.kind){case 95:case 90:return}return e}function K(e){let n;const r=function(e){if(!Gl(e)){const t=a.getReferencedImportDeclaration(e);if(t)return t;const n=a.getReferencedValueDeclaration(e);if(n&&(null==g?void 0:g.exportedBindings[ez(n)]))return n;const r=a.getReferencedValueDeclarations(e);if(r)for(const e of r)if(e!==n&&(null==g?void 0:g.exportedBindings[ez(e)]))return e;return n}}(e);if(r){const i=a.getReferencedExportContainer(e,!1);i&&308===i.kind&&(n=ae(n,t.getDeclarationName(r))),n=le(n,null==g?void 0:g.exportedBindings[ez(r)])}else if(Gl(e)&&Ql(e)){const t=null==g?void 0:g.exportSpecifiers.get(e);if(t){const e=[];for(const n of t)e.push(n.name);return e}}return n}function G(e){return void 0===x&&(x=[]),x[_J(e)]=!0,e}}function Oq(e){const{factory:t,getEmitHelperFactory:n}=e,r=e.getEmitHost(),i=e.getEmitResolver(),o=e.getCompilerOptions(),a=Sk(o),s=e.onEmitNode,c=e.onSubstituteNode;e.onEmitNode=function(e,t,n){dP(t)?((uO(t)||Nk(o))&&o.importHelpers&&(u=new Map),d=t,s(e,t,n),d=void 0,u=void 0):s(e,t,n)},e.onSubstituteNode=function(e,n){if((n=c(e,n)).id&&l.has(n.id))return n;if(uD(n)&&8192&rp(n))return function(e){const n=d&&LA(d);if(n)return l.add(_J(e)),t.createPropertyAccessExpression(n,e);if(u){const n=bc(e);let r=u.get(n);return r||u.set(n,r=t.createUniqueName(n,48)),r}return e}(n);return n},e.enableEmitNotification(308),e.enableSubstitution(80);const l=new Set;let _,u,d,p;return rz(e,function(r){if(r.isDeclarationFile)return r;if(uO(r)||Nk(o)){d=r,p=void 0,o.rewriteRelativeImportExtensions&&(4194304&d.flags||Om(r))&&IC(r,!1,!1,e=>{Ju(e.arguments[0])&&!Cg(e.arguments[0].text,o)||(_=ae(_,e))});let i=function(r){const i=MA(t,n(),r,o);if(i){const e=[],n=t.copyPrologue(r.statements,e);return le(e,kJ([i],f,hu)),le(e,xJ(r.statements,f,hu,n)),t.updateSourceFile(r,FI(t.createNodeArray(e),r.statements))}return EJ(r,f,e)}(r);return Kw(i,e.readEmitHelpers()),d=void 0,p&&(i=t.updateSourceFile(i,FI(t.createNodeArray(Bd(i.statements.slice(),p)),i.statements))),!uO(r)||200===Tk(o)||H(i.statements,eu)?i:t.updateSourceFile(i,FI(t.createNodeArray([...i.statements,lA(t)]),i.statements))}return r});function f(r){switch(r.kind){case 272:return Tk(o)>=100?function(e){let n;return pn.assert(Dm(e),"import= for internal module references should be handled in an earlier transformer."),n=ae(n,kw(FI(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.cloneNode(e.name),void 0,void 0,m(e))],a>=2?2:0)),e),e)),n=function(e,n){Av(n,32)&&(e=ae(e,t.createExportDeclaration(void 0,n.isTypeOnly,t.createNamedExports([t.createExportSpecifier(!1,void 0,bc(n.name))]))));return e}(n,e),Te(n)}(r):void 0;case 278:return function(e){if(e.isExportEquals){if(200===Tk(o)){return kw(t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),e.expression)),e)}return}return e}(r);case 279:return function(e){const n=Oz(e.moduleSpecifier,o);if(void 0!==o.module&&o.module>5||!e.exportClause||!OE(e.exportClause)||!e.moduleSpecifier)return e.moduleSpecifier&&n!==e.moduleSpecifier?t.updateExportDeclaration(e,e.modifiers,e.isTypeOnly,e.exportClause,n,e.attributes):e;const r=e.exportClause.name,i=t.getGeneratedNameForNode(r),a=t.createImportDeclaration(void 0,t.createImportClause(void 0,void 0,t.createNamespaceImport(i)),n,e.attributes);kw(a,e.exportClause);const s=Gd(e)?t.createExportDefault(i):t.createExportDeclaration(void 0,!1,t.createNamedExports([t.createExportSpecifier(!1,i,r)]));return kw(s,e),[a,s]}(r);case 273:return function(e){if(!o.rewriteRelativeImportExtensions)return e;const n=Oz(e.moduleSpecifier,o);if(n===e.moduleSpecifier)return e;return t.updateImportDeclaration(e,e.modifiers,e.importClause,n,e.attributes)}(r);case 214:if(r===(null==_?void 0:_[0]))return function(e){return t.updateCallExpression(e,e.expression,e.typeArguments,[Ju(e.arguments[0])?Oz(e.arguments[0],o):n().createRewriteRelativeImportExtensionsHelper(e.arguments[0]),...e.arguments.slice(1)])}(_.shift());default:if((null==_?void 0:_.length)&&tx(r,_[0]))return EJ(r,f,e)}return r}function m(e){const n=BA(t,e,pn.checkDefined(d),r,i,o),s=[];if(n&&s.push(Oz(n,o)),200===Tk(o))return t.createCallExpression(t.createIdentifier("require"),void 0,s);if(!p){const e=t.createUniqueName("_createRequire",48),n=t.createImportDeclaration(void 0,t.createImportClause(void 0,void 0,t.createNamedImports([t.createImportSpecifier(!1,t.createIdentifier("createRequire"),e)])),t.createStringLiteral("module"),void 0),r=t.createUniqueName("__require",48),i=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(r,void 0,void 0,t.createCallExpression(t.cloneNode(e),void 0,[t.createPropertyAccessExpression(t.createMetaProperty(102,t.createIdentifier("meta")),t.createIdentifier("url"))]))],a>=2?2:0));p=[n,i]}const c=p[1].declarationList.declarations[0].name;return pn.assertNode(c,uD),t.createCallExpression(t.cloneNode(c),void 0,s)}}function Lq(e){const t=e.onSubstituteNode,n=e.onEmitNode,r=Oq(e),i=e.onSubstituteNode,o=e.onEmitNode;e.onSubstituteNode=t,e.onEmitNode=n;const a=Pq(e),s=e.onSubstituteNode,c=e.onEmitNode,l=t=>e.getEmitHost().getEmitModuleFormatOfFile(t);let _;return e.onSubstituteNode=function(e,n){return dP(n)?(_=n,t(e,n)):_?l(_)>=5?i(e,n):s(e,n):t(e,n)},e.onEmitNode=function(e,t,r){dP(t)&&(_=t);if(!_)return n(e,t,r);if(l(_)>=5)return o(e,t,r);return c(e,t,r)},e.enableSubstitution(308),e.enableEmitNotification(308),function(t){return 308===t.kind?u(t):function(t){return e.factory.createBundle(P(t.sourceFiles,u))}(t)};function u(e){if(e.isDeclarationFile)return e;_=e;const t=(l(e)>=5?r:a)(e);return _=void 0,pn.assert(dP(t)),t}}function jq(e){return fE(e)||AD(e)||PD(e)||fF(e)||Eu(e)||Pu(e)||JD(e)||BD(e)||OD(e)||ID(e)||gE(e)||FD(e)||DD(e)||BF(e)||CE(e)||vE(e)||jD(e)||zD(e)||hF(e)||yF(e)||AF(e)||Ag(e)}function Mq(e){return Eu(e)||Pu(e)?function(t){const n=function(t){return Iv(e)?t.errorModuleName?2===t.accessibility?fa.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:264===e.parent.kind?t.errorModuleName?2===t.accessibility?fa.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Public_property_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?fa.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:fa.Property_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}:ID(e)||OD(e)?function(t){const n=function(t){return Iv(e)?t.errorModuleName?2===t.accessibility?fa.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:264===e.parent.kind?t.errorModuleName?2===t.accessibility?fa.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Public_method_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?fa.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:fa.Method_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}:Rq(e)}function Rq(e){return fE(e)||AD(e)||PD(e)||hF(e)||yF(e)||AF(e)||fF(e)||jD(e)?t:Eu(e)||Pu(e)?function(t){let n;n=179===e.kind?Iv(e)?t.errorModuleName?fa.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:t.errorModuleName?fa.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:Iv(e)?t.errorModuleName?2===t.accessibility?fa.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:t.errorModuleName?2===t.accessibility?fa.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1;return{diagnosticMessage:n,errorNode:e.name,typeName:e.name}}:JD(e)||BD(e)||OD(e)||ID(e)||gE(e)||zD(e)?function(t){let n;switch(e.kind){case 181:n=t.errorModuleName?fa.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:fa.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 180:n=t.errorModuleName?fa.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:fa.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 182:n=t.errorModuleName?fa.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:fa.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 175:case 174:n=Iv(e)?t.errorModuleName?2===t.accessibility?fa.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:fa.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:fa.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:264===e.parent.kind?t.errorModuleName?2===t.accessibility?fa.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:fa.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:fa.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:t.errorModuleName?fa.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:fa.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 263:n=t.errorModuleName?2===t.accessibility?fa.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:fa.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:fa.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return pn.fail("This is unknown kind for signature: "+e.kind)}return{diagnosticMessage:n,errorNode:e.name||e}}:FD(e)?rc(e,e.parent)&&Av(e.parent,2)?t:function(t){const n=function(t){switch(e.parent.kind){case 177:return t.errorModuleName?2===t.accessibility?fa.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 181:case 186:return t.errorModuleName?fa.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 180:return t.errorModuleName?fa.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 182:return t.errorModuleName?fa.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 175:case 174:return Iv(e.parent)?t.errorModuleName?2===t.accessibility?fa.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:264===e.parent.parent.kind?t.errorModuleName?2===t.accessibility?fa.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t.errorModuleName?fa.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 263:case 185:return t.errorModuleName?2===t.accessibility?fa.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 179:case 178:return t.errorModuleName?2===t.accessibility?fa.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:fa.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return pn.fail(`Unknown parent for parameter: ${pn.formatSyntaxKind(e.parent.kind)}`)}}(t);return void 0!==n?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}:DD(e)?function(){let t;switch(e.parent.kind){case 264:t=fa.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 265:t=fa.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 201:t=fa.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 186:case 181:t=fa.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 180:t=fa.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 175:case 174:t=Iv(e.parent)?fa.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:264===e.parent.parent.kind?fa.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:fa.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 185:case 263:t=fa.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 196:t=fa.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;break;case 266:t=fa.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return pn.fail("This is unknown parent for type parameter: "+e.parent.kind)}return{diagnosticMessage:t,errorNode:e,typeName:e.name}}:BF(e)?function(){let t;t=hE(e.parent.parent)?aP(e.parent)&&119===e.parent.token?fa.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:e.parent.parent.name?fa.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:fa.extends_clause_of_exported_class_has_or_is_using_private_name_0:fa.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1;return{diagnosticMessage:t,errorNode:e,typeName:Fc(e.parent.parent)}}:CE(e)?function(){return{diagnosticMessage:fa.Import_declaration_0_is_using_private_name_1,errorNode:e,typeName:e.name}}:vE(e)||Ag(e)?function(t){return{diagnosticMessage:t.errorModuleName?fa.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:fa.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:Ag(e)?pn.checkDefined(e.typeExpression):e.type,typeName:Ag(e)?Fc(e):e.name}}:pn.assertNever(e,`Attempted to set a declaration diagnostic context for unhandled node kind: ${pn.formatSyntaxKind(e.kind)}`);function t(t){const n=function(t){return 261===e.kind||209===e.kind?t.errorModuleName?2===t.accessibility?fa.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:fa.Exported_variable_0_has_or_is_using_private_name_1:173===e.kind||212===e.kind||213===e.kind||227===e.kind||172===e.kind||170===e.kind&&Av(e.parent,2)?Iv(e)?t.errorModuleName?2===t.accessibility?fa.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:264===e.parent.kind||170===e.kind?t.errorModuleName?2===t.accessibility?fa.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:fa.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:fa.Public_property_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?fa.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:fa.Property_0_of_exported_interface_has_or_is_using_private_name_1:void 0}(t);return void 0!==n?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}}function Bq(e){const t={220:fa.Add_a_return_type_to_the_function_expression,219:fa.Add_a_return_type_to_the_function_expression,175:fa.Add_a_return_type_to_the_method,178:fa.Add_a_return_type_to_the_get_accessor_declaration,179:fa.Add_a_type_to_parameter_of_the_set_accessor_declaration,263:fa.Add_a_return_type_to_the_function_declaration,181:fa.Add_a_return_type_to_the_function_declaration,170:fa.Add_a_type_annotation_to_the_parameter_0,261:fa.Add_a_type_annotation_to_the_variable_0,173:fa.Add_a_type_annotation_to_the_property_0,172:fa.Add_a_type_annotation_to_the_property_0,278:fa.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it},n={219:fa.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,263:fa.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,220:fa.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,175:fa.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,181:fa.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,178:fa.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations,179:fa.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations,170:fa.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations,261:fa.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations,173:fa.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,172:fa.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,168:fa.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations,306:fa.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations,305:fa.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations,210:fa.Only_const_arrays_can_be_inferred_with_isolatedDeclarations,278:fa.Default_exports_can_t_be_inferred_with_isolatedDeclarations,231:fa.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations};return function(r){if(mc(r,aP))return qp(r,fa.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations);if((Ef(r)||$D(r.parent))&&(i_(r)||ub(r)))return function(e){const t=qp(e,fa.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations,ep(e,!1));return o(e,t),t}(r);switch(pn.type(r),r.kind){case 178:case 179:return i(r);case 168:case 305:case 306:return function(e){const t=qp(e,n[e.kind]);return o(e,t),t}(r);case 210:case 231:return function(e){const t=qp(e,n[e.kind]);return o(e,t),t}(r);case 175:case 181:case 219:case 220:case 263:return function(e){const r=qp(e,n[e.kind]);return o(e,r),uT(r,qp(e,t[e.kind])),r}(r);case 209:return function(e){return qp(e,fa.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations)}(r);case 173:case 261:return function(e){const r=qp(e,n[e.kind]),i=ep(e.name,!1);return uT(r,qp(e,t[e.kind],i)),r}(r);case 170:return function(r){if(Eu(r.parent))return i(r.parent);const o=e.requiresAddingImplicitUndefined(r,r.parent);if(!o&&r.initializer)return a(r.initializer);const s=o?fa.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations:n[r.kind],c=qp(r,s),l=ep(r.name,!1);return uT(c,qp(r,t[r.kind],l)),c}(r);case 304:return a(r.initializer);case 232:return function(e){return a(e,fa.Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations)}(r);default:return a(r)}};function r(e){const t=mc(e,e=>ME(e)||hu(e)||fE(e)||AD(e)||FD(e));if(t)return ME(t)?t:sE(t)?mc(t,e=>l_(e)&&!jD(e)):hu(t)?void 0:t}function i(e){const{getAccessor:r,setAccessor:i}=hv(e.symbol.declarations,e),o=qp((Eu(e)?e.parameters[0]:e)??e,n[e.kind]);return i&&uT(o,qp(i,t[i.kind])),r&&uT(o,qp(r,t[r.kind])),o}function o(e,n){const i=r(e);if(i){const e=ME(i)||!i.name?"":ep(i.name,!1);uT(n,qp(i,t[i.kind],e))}return n}function a(e,i){const o=r(e);let a;if(o){const r=ME(o)||!o.name?"":ep(o.name,!1);o===mc(e.parent,e=>ME(e)||(hu(e)?"quit":!SF(e)&&!kF(e)&&!JF(e)))?(a=qp(e,i??n[o.kind]),uT(a,qp(o,t[o.kind],r))):(a=qp(e,i??fa.Expression_type_can_t_be_inferred_with_isolatedDeclarations),uT(a,qp(o,t[o.kind],r)),uT(a,qp(e,fa.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit)))}else a=qp(e,i??fa.Expression_type_can_t_be_inferred_with_isolatedDeclarations);return a}}function Jq(e,t,n){const r=e.getCompilerOptions();return C(D(Zy(e,n),jm),n)?tU(t,e,bw,r,[n],[Uq],!1).diagnostics:void 0}var zq=531469,qq=8;function Uq(e){const t=()=>pn.fail("Diagnostic emitted without context");let n,r,i,o,a=t,s=!0,c=!1,l=!1,u=!1,f=!1;const{factory:m}=e,g=e.getEmitHost();let h=()=>{};const y={trackSymbol:function(e,t,n){if(262144&e.flags)return!1;return M(w.isSymbolAccessible(e,t,n,!0))},reportInaccessibleThisError:function(){(v||b)&&e.addDiagnostic(qp(v||b,fa.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,R(),"this"))},reportInaccessibleUniqueSymbolError:function(){(v||b)&&e.addDiagnostic(qp(v||b,fa.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,R(),"unique symbol"))},reportCyclicStructureError:function(){(v||b)&&e.addDiagnostic(qp(v||b,fa.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,R()))},reportPrivateInBaseOfClassExpression:function(t){(v||b)&&e.addDiagnostic(uT(qp(v||b,fa.Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected,t),...fE((v||b).parent)?[qp(v||b,fa.Add_a_type_annotation_to_the_variable_0,R())]:[]))},reportLikelyUnsafeImportRequiredError:function(t){(v||b)&&e.addDiagnostic(qp(v||b,fa.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,R(),t))},reportTruncationError:function(){(v||b)&&e.addDiagnostic(qp(v||b,fa.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed))},moduleResolverHost:g,reportNonlocalAugmentation:function(t,n,r){var i;const o=null==(i=n.declarations)?void 0:i.find(e=>Sd(e)===t),a=D(r.declarations,e=>Sd(e)!==t);if(o&&a)for(const t of a)e.addDiagnostic(uT(qp(t,fa.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),qp(o,fa.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)))},reportNonSerializableProperty:function(t){(v||b)&&e.addDiagnostic(qp(v||b,fa.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized,t))},reportInferenceFallback:j,pushErrorFallbackNode(e){const t=b,n=h;h=()=>{h=n,b=t},b=e},popErrorFallbackNode(){h()}};let v,b,x,k,S,T;const w=e.getEmitResolver(),N=e.getCompilerOptions(),F=Bq(w),{stripInternal:E,isolatedDeclarations:A}=N;return function(_){if(308===_.kind&&_.isDeclarationFile)return _;if(309===_.kind){c=!0,k=[],S=[],T=[];let d=!1;const p=m.createBundle(P(_.sourceFiles,c=>{if(c.isDeclarationFile)return;if(d=d||c.hasNoDefaultLib,x=c,n=c,r=void 0,o=!1,i=new Map,a=t,u=!1,f=!1,h(c),rf(c)||of(c)){l=!1,s=!1;const t=Im(c)?m.createNodeArray(B(c)):xJ(c.statements,ce,hu);return m.updateSourceFile(c,[m.createModuleDeclaration([m.createModifier(138)],m.createStringLiteral(qy(e.getEmitHost(),c)),m.createModuleBlock(FI(m.createNodeArray(oe(t)),c.statements)))],!0,[],[],!1,[])}s=!0;const _=Im(c)?m.createNodeArray(B(c)):xJ(c.statements,ce,hu);return m.updateSourceFile(c,oe(_),!0,[],[],!1,[])})),y=Ao(Ro(cU(_,g,!0).declarationFilePath));return p.syntheticFileReferences=w(y),p.syntheticTypeReferences=v(),p.syntheticLibReferences=b(),p.hasNoDefaultLib=d,p}let d;if(s=!0,u=!1,f=!1,n=_,x=_,a=t,c=!1,l=!1,o=!1,r=void 0,i=new Map,k=[],S=[],T=[],h(x),Im(x))d=m.createNodeArray(B(_));else{const e=xJ(_.statements,ce,hu);d=FI(m.createNodeArray(oe(e)),_.statements),uO(_)&&(!l||u&&!f)&&(d=FI(m.createNodeArray([...d,lA(m)]),d))}const p=Ao(Ro(cU(_,g,!0).declarationFilePath));return m.updateSourceFile(_,d,!0,w(p),v(),_.hasNoDefaultLib,b());function h(e){k=G(k,P(e.referencedFiles,t=>[e,t])),S=G(S,e.typeReferenceDirectives),T=G(T,e.libReferenceDirectives)}function y(e){const t={...e};return t.pos=-1,t.end=-1,t}function v(){return J(S,e=>{if(e.preserve)return y(e)})}function b(){return J(T,e=>{if(e.preserve)return y(e)})}function w(e){return J(k,([t,n])=>{if(!n.preserve)return;const r=g.getSourceFileFromReference(t,n);if(!r)return;let i;if(r.isDeclarationFile)i=r.fileName;else{if(c&&C(_.sourceFiles,r))return;const e=cU(r,g,!0);i=e.declarationFilePath||e.jsFilePath||r.fileName}if(!i)return;const o=_a(e,i,g.getCurrentDirectory(),g.getCanonicalFileName,!1),a=y(n);return a.fileName=o,a})}};function I(t){w.getPropertiesOfContainerFunction(t).forEach(t=>{if(fC(t.valueDeclaration)){const n=AF(t.valueDeclaration)?t.valueDeclaration.left:t.valueDeclaration;e.addDiagnostic(qp(n,fa.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function))}})}function j(t){A&&!Im(x)&&Sd(t)===x&&(fE(t)&&w.isExpandoFunctionDeclaration(t)?I(t):e.addDiagnostic(F(t)))}function M(t){if(0===t.accessibility){if(t.aliasesToMakeVisible)if(r)for(const e of t.aliasesToMakeVisible)_e(r,e);else r=t.aliasesToMakeVisible}else if(3!==t.accessibility){const n=a(t);if(n)return n.typeName?e.addDiagnostic(qp(t.errorNode||n.errorNode,n.diagnosticMessage,ep(n.typeName),t.errorSymbolName,t.errorModuleName)):e.addDiagnostic(qp(t.errorNode||n.errorNode,n.diagnosticMessage,t.errorSymbolName,t.errorModuleName)),!0}return!1}function R(){return v?jp(v):b&&Fc(b)?jp(Fc(b)):b&&ME(b)?b.isExportEquals?"export=":"default":"(Missing)"}function B(e){const t=a;a=t=>t.errorNode&&jq(t.errorNode)?Rq(t.errorNode)(t):{diagnosticMessage:t.errorModuleName?fa.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:fa.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,errorNode:t.errorNode||e};const n=w.getDeclarationStatementsForSourceFile(e,zq,qq,y);return a=t,n}function z(e){return 80===e.kind?e:208===e.kind?m.updateArrayBindingPattern(e,xJ(e.elements,t,D_)):m.updateObjectBindingPattern(e,xJ(e.elements,t,fF));function t(e){return 233===e.kind?e:(e.propertyName&&ND(e.propertyName)&&ub(e.propertyName.expression)&&ee(e.propertyName.expression,n),m.updateBindingElement(e,e.dotDotDotToken,e.propertyName,z(e.name),void 0))}}function q(e,t){let n;o||(n=a,a=Rq(e));const r=m.updateParameterDeclaration(e,function(e,t,n,r){return e.createModifiersFromModifierFlags(Vq(t,n,r))}(m,e,t),e.dotDotDotToken,z(e.name),w.isOptionalParameter(e)?e.questionToken||m.createToken(58):void 0,W(e,!0),V(e));return o||(a=n),r}function U(e){return Wq(e)&&!!e.initializer&&w.isLiteralConstDeclaration(hc(e))}function V(e){if(U(e)){return CC(wC(e.initializer))||j(e),w.createLiteralConstValue(hc(e,Wq),y)}}function W(e,t){if(!t&&Pv(e,2))return;if(U(e))return;if(!ME(e)&&!fF(e)&&e.type&&(!FD(e)||!w.requiresAddingImplicitUndefined(e,n)))return bJ(e.type,se,T_);const r=v;let i,s;return v=e.name,o||(i=a,jq(e)&&(a=Rq(e))),NC(e)?s=w.createTypeOfDeclaration(e,n,zq,qq,y):s_(e)?s=w.createReturnTypeOfSignatureDeclaration(e,n,zq,qq,y):pn.assertNever(e),v=r,o||(a=i),s??m.createKeywordTypeNode(133)}function $(e){switch((e=hc(e)).kind){case 263:case 268:case 265:case 264:case 266:case 267:return!w.isDeclarationVisible(e);case 261:return!K(e);case 272:case 273:case 279:case 278:return!1;case 176:return!0}return!1}function K(e){return!RF(e)&&(w_(e.name)?H(e.name.elements,K):w.isDeclarationVisible(e))}function X(e,t,n){if(Pv(e,2))return m.createNodeArray();const r=P(t,e=>q(e,n));return r?m.createNodeArray(r,t.hasTrailingComma):m.createNodeArray()}function Q(e,t){let n;if(!t){const t=uv(e);t&&(n=[q(t)])}if(RD(e)){let r;if(!t){const t=lv(e);t&&(r=q(t))}r||(r=m.createParameterDeclaration(void 0,void 0,"value")),n=ae(n,r)}return m.createNodeArray(n||_)}function Y(e,t){return Pv(e,2)?void 0:xJ(t,se,DD)}function Z(e){return dP(e)||vE(e)||xE(e)||hE(e)||yE(e)||s_(e)||zD(e)||sF(e)}function ee(e,t){M(w.isEntityNameVisible(e,t))}function te(e,t){return Au(e)&&Au(t)&&(e.jsDoc=t.jsDoc),Mw(e,jw(t))}function ne(t,n){if(n){if(l=l||268!==t.kind&&206!==t.kind,Ju(n)&&c){const n=Vy(e.getEmitHost(),w,t);if(n)return m.createStringLiteral(n)}return n}}function re(e){const t=wV(e);return e&&void 0!==t?e:void 0}function oe(e){for(;d(r);){const e=r.shift();if(!Ep(e))return pn.fail(`Late replaced statement was found which is not handled by the declaration transformer!: ${pn.formatSyntaxKind(e.kind)}`);const t=s;s=e.parent&&dP(e.parent)&&!(uO(e.parent)&&c);const n=de(e);s=t,i.set(ez(e),n)}return xJ(e,function(e){if(Ep(e)){const t=ez(e);if(i.has(t)){const n=i.get(t);return i.delete(t),n&&((Ze(n)?H(n,Z_):Z_(n))&&(u=!0),dP(e.parent)&&(Ze(n)?H(n,eu):eu(n))&&(l=!0)),n}}return e},hu)}function se(t){if(fe(t))return;if(fu(t)){if($(t))return;if(qh(t))if(A){if(!w.isDefinitelyReferenceToGlobalSymbolObject(t.name.expression)){if(hE(t.parent)||gF(t.parent))return void e.addDiagnostic(qp(t,fa.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));if((yE(t.parent)||HD(t.parent))&&!ub(t.name.expression))return void e.addDiagnostic(qp(t,fa.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations))}}else if(!w.isLateBound(hc(t))||!ub(t.name.expression))return}if(s_(t)&&w.isImplementationOfOverload(t))return;if(KF(t))return;let r;Z(t)&&(r=n,n=t);const i=a,s=jq(t),c=o;let l=(188===t.kind||201===t.kind)&&266!==t.parent.kind;if((OD(t)||ID(t))&&Pv(t,2)){if(t.symbol&&t.symbol.declarations&&t.symbol.declarations[0]!==t)return;return u(m.createPropertyDeclaration(ge(t),t.name,void 0,void 0,void 0))}if(s&&!o&&(a=Rq(t)),$D(t)&&ee(t.exprName,n),l&&(o=!0),function(e){switch(e.kind){case 181:case 177:case 175:case 178:case 179:case 173:case 172:case 174:case 180:case 182:case 261:case 169:case 234:case 184:case 195:case 185:case 186:case 206:return!0}return!1}(t))switch(t.kind){case 234:{(i_(t.expression)||ub(t.expression))&&ee(t.expression,n);const r=EJ(t,se,e);return u(m.updateExpressionWithTypeArguments(r,r.expression,r.typeArguments))}case 184:{ee(t.typeName,n);const r=EJ(t,se,e);return u(m.updateTypeReferenceNode(r,r.typeName,r.typeArguments))}case 181:return u(m.updateConstructSignature(t,Y(t,t.typeParameters),X(t,t.parameters),W(t)));case 177:return u(m.createConstructorDeclaration(ge(t),X(t,t.parameters,0),void 0));case 175:if(dD(t.name))return u(void 0);return u(m.createMethodDeclaration(ge(t),void 0,t.name,t.questionToken,Y(t,t.typeParameters),X(t,t.parameters),W(t),void 0));case 178:return dD(t.name)?u(void 0):u(m.updateGetAccessorDeclaration(t,ge(t),t.name,Q(t,Pv(t,2)),W(t),void 0));case 179:return dD(t.name)?u(void 0):u(m.updateSetAccessorDeclaration(t,ge(t),t.name,Q(t,Pv(t,2)),void 0));case 173:return dD(t.name)?u(void 0):u(m.updatePropertyDeclaration(t,ge(t),t.name,t.questionToken,W(t),V(t)));case 172:return dD(t.name)?u(void 0):u(m.updatePropertySignature(t,ge(t),t.name,t.questionToken,W(t)));case 174:return dD(t.name)?u(void 0):u(m.updateMethodSignature(t,ge(t),t.name,t.questionToken,Y(t,t.typeParameters),X(t,t.parameters),W(t)));case 180:return u(m.updateCallSignature(t,Y(t,t.typeParameters),X(t,t.parameters),W(t)));case 182:return u(m.updateIndexSignature(t,ge(t),X(t,t.parameters),bJ(t.type,se,T_)||m.createKeywordTypeNode(133)));case 261:return w_(t.name)?pe(t.name):(l=!0,o=!0,u(m.updateVariableDeclaration(t,t.name,void 0,W(t),V(t))));case 169:return 175===(_=t).parent.kind&&Pv(_.parent,2)&&(t.default||t.constraint)?u(m.updateTypeParameterDeclaration(t,t.modifiers,t.name,void 0,void 0)):u(EJ(t,se,e));case 195:{const e=bJ(t.checkType,se,T_),r=bJ(t.extendsType,se,T_),i=n;n=t.trueType;const o=bJ(t.trueType,se,T_);n=i;const a=bJ(t.falseType,se,T_);return pn.assert(e),pn.assert(r),pn.assert(o),pn.assert(a),u(m.updateConditionalTypeNode(t,e,r,o,a))}case 185:return u(m.updateFunctionTypeNode(t,xJ(t.typeParameters,se,DD),X(t,t.parameters),pn.checkDefined(bJ(t.type,se,T_))));case 186:return u(m.updateConstructorTypeNode(t,ge(t),xJ(t.typeParameters,se,DD),X(t,t.parameters),pn.checkDefined(bJ(t.type,se,T_))));case 206:return gf(t)?u(m.updateImportTypeNode(t,m.updateLiteralTypeNode(t.argument,ne(t,t.argument.literal)),t.attributes,t.qualifier,xJ(t.typeArguments,se,T_),t.isTypeOf)):u(t);default:pn.assertNever(t,`Attempted to process unhandled node kind: ${pn.formatSyntaxKind(t.kind)}`)}var _;return GD(t)&&Wa(x,t.pos).line===Wa(x,t.end).line&&ww(t,1),u(EJ(t,se,e));function u(e){return e&&s&&qh(t)&&function(e){let t;o||(t=a,a=Mq(e));v=e.name,pn.assert(qh(e));const r=e;ee(r.name.expression,n),o||(a=t);v=void 0}(t),Z(t)&&(n=r),s&&!o&&(a=i),l&&(o=c),e===t?e:e&&kw(te(e,t),t)}}function ce(e){if(!function(e){switch(e.kind){case 263:case 268:case 272:case 265:case 264:case 266:case 267:case 244:case 273:case 279:case 278:return!0}return!1}(e))return;if(fe(e))return;switch(e.kind){case 279:return dP(e.parent)&&(l=!0),f=!0,m.updateExportDeclaration(e,e.modifiers,e.isTypeOnly,e.exportClause,ne(e,e.moduleSpecifier),re(e.attributes));case 278:if(dP(e.parent)&&(l=!0),f=!0,80===e.expression.kind)return e;{const t=m.createUniqueName("_default",16);a=()=>({diagnosticMessage:fa.Default_export_of_the_module_has_or_is_using_private_name_0,errorNode:e}),b=e;const n=W(e),r=m.createVariableDeclaration(t,void 0,n,void 0);b=void 0;const i=m.createVariableStatement(s?[m.createModifier(138)]:[],m.createVariableDeclarationList([r],2));return te(i,e),Cw(e),[i,m.updateExportAssignment(e,e.modifiers,t)]}}const t=de(e);return i.set(ez(e),t),e}function le(e){if(CE(e)||Pv(e,2048)||!EI(e))return e;const t=m.createModifiersFromModifierFlags(131039&Vv(e));return m.replaceModifiers(e,t)}function ue(e,t,n,r){const i=m.updateModuleDeclaration(e,t,n,r);if(dp(i)||32&i.flags)return i;const o=m.createModuleDeclaration(i.modifiers,i.name,i.body,32|i.flags);return kw(o,i),FI(o,i),o}function de(t){if(r)for(;Ut(r,t););if(fe(t))return;switch(t.kind){case 272:return function(e){if(w.isDeclarationVisible(e)){if(284===e.moduleReference.kind){const t=Fm(e);return m.updateImportEqualsDeclaration(e,e.modifiers,e.isTypeOnly,e.name,m.updateExternalModuleReference(e.moduleReference,ne(e,t)))}{const t=a;return a=Rq(e),ee(e.moduleReference,n),a=t,e}}}(t);case 273:return function(t){if(!t.importClause)return m.updateImportDeclaration(t,t.modifiers,t.importClause,ne(t,t.moduleSpecifier),re(t.attributes));const n=166===t.importClause.phaseModifier?void 0:t.importClause.phaseModifier,r=t.importClause&&t.importClause.name&&w.isDeclarationVisible(t.importClause)?t.importClause.name:void 0;if(!t.importClause.namedBindings)return r&&m.updateImportDeclaration(t,t.modifiers,m.updateImportClause(t.importClause,n,r,void 0),ne(t,t.moduleSpecifier),re(t.attributes));if(275===t.importClause.namedBindings.kind){const e=w.isDeclarationVisible(t.importClause.namedBindings)?t.importClause.namedBindings:void 0;return r||e?m.updateImportDeclaration(t,t.modifiers,m.updateImportClause(t.importClause,n,r,e),ne(t,t.moduleSpecifier),re(t.attributes)):void 0}const i=J(t.importClause.namedBindings.elements,e=>w.isDeclarationVisible(e)?e:void 0);return i&&i.length||r?m.updateImportDeclaration(t,t.modifiers,m.updateImportClause(t.importClause,n,r,i&&i.length?m.updateNamedImports(t.importClause.namedBindings,i):void 0),ne(t,t.moduleSpecifier),re(t.attributes)):w.isImportRequiredByAugmentation(t)?(A&&e.addDiagnostic(qp(t,fa.Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations)),m.updateImportDeclaration(t,t.modifiers,void 0,ne(t,t.moduleSpecifier),re(t.attributes))):void 0}(t)}if(fu(t)&&$(t))return;if(tA(t))return;if(s_(t)&&w.isImplementationOfOverload(t))return;let o;Z(t)&&(o=n,n=t);const c=jq(t),_=a;c&&(a=Rq(t));const g=s;switch(t.kind){case 266:{s=!1;const e=h(m.updateTypeAliasDeclaration(t,ge(t),t.name,xJ(t.typeParameters,se,DD),pn.checkDefined(bJ(t.type,se,T_))));return s=g,e}case 265:return h(m.updateInterfaceDeclaration(t,ge(t),t.name,Y(t,t.typeParameters),he(t.heritageClauses),xJ(t.members,se,x_)));case 263:{const e=h(m.updateFunctionDeclaration(t,ge(t),void 0,t.name,Y(t,t.typeParameters),X(t,t.parameters),W(t),void 0));if(e&&w.isExpandoFunctionDeclaration(t)&&function(e){var t;if(e.body)return!0;const n=null==(t=e.symbol.declarations)?void 0:t.filter(e=>gE(e)&&!e.body);return!n||n.indexOf(e)===n.length-1}(t)){const r=w.getPropertiesOfContainerFunction(t);A&&I(t);const i=II.createModuleDeclaration(void 0,e.name||m.createIdentifier("_default"),m.createModuleBlock([]),32);IT(i,n),i.locals=Zu(r),i.symbol=r[0].parent;const o=[];let s=J(r,e=>{if(!fC(e.valueDeclaration))return;const t=vc(e.escapedName);if(!vs(t,99))return;a=Rq(e.valueDeclaration);const n=w.createTypeOfDeclaration(e.valueDeclaration,i,zq,2|qq,y);a=_;const r=Oh(t),s=r?m.getGeneratedNameForNode(e.valueDeclaration):m.createIdentifier(t);r&&o.push([s,t]);const c=m.createVariableDeclaration(s,void 0,n,void 0);return m.createVariableStatement(r?void 0:[m.createToken(95)],m.createVariableDeclarationList([c]))});o.length?s.push(m.createExportDeclaration(void 0,!1,m.createNamedExports(P(o,([e,t])=>m.createExportSpecifier(!1,e,t))))):s=J(s,e=>m.replaceModifiers(e,0));const c=m.createModuleDeclaration(ge(t),t.name,m.createModuleBlock(s),32);if(!Pv(e,2048))return[e,c];const u=m.createModifiersFromModifierFlags(-2081&Vv(e)|128),d=m.updateFunctionDeclaration(e,u,void 0,e.name,e.typeParameters,e.parameters,e.type,void 0),p=m.updateModuleDeclaration(c,u,c.name,c.body),g=m.createExportAssignment(void 0,!1,c.name);return dP(t.parent)&&(l=!0),f=!0,[d,p,g]}return e}case 268:{s=!1;const e=t.body;if(e&&269===e.kind){const n=u,r=f;f=!1,u=!1;let i=oe(xJ(e.statements,ce,hu));33554432&t.flags&&(u=!1),hp(t)||function(e){return H(e,me)}(i)||f||(i=u?m.createNodeArray([...i,lA(m)]):xJ(i,le,hu));const o=m.updateModuleBlock(e,i);s=g,u=n,f=r;const a=ge(t);return h(ue(t,a,yp(t)?ne(t,t.name):t.name,o))}{s=g;const n=ge(t);s=!1,bJ(e,ce);const r=ez(e),o=i.get(r);return i.delete(r),h(ue(t,n,t.name,o))}}case 264:{v=t.name,b=t;const e=m.createNodeArray(ge(t)),r=Y(t,t.typeParameters),i=cv(t);let o;if(i){const e=a;o=ie(L(i.parameters,e=>{if(Av(e,31)&&!fe(e))return a=Rq(e),80===e.name.kind?te(m.createPropertyDeclaration(ge(e),e.name,e.questionToken,W(e),V(e)),e):function t(n){let r;for(const i of n.elements)RF(i)||(w_(i.name)&&(r=G(r,t(i.name))),r=r||[],r.push(m.createPropertyDeclaration(ge(e),i.name,void 0,W(i),void 0)));return r}(e.name)})),a=e}const c=G(G(G(H(t.members,e=>!!e.name&&dD(e.name))?[m.createPropertyDeclaration(void 0,m.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:void 0,w.createLateBoundIndexSignatures(t,n,zq,qq,y)),o),xJ(t.members,se,f_)),l=m.createNodeArray(c),_=kh(t);if(_&&!ub(_.expression)&&106!==_.expression.kind){const n=t.name?vc(t.name.escapedText):"default",i=m.createUniqueName(`${n}_base`,16);a=()=>({diagnosticMessage:fa.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,errorNode:_,typeName:t.name});const o=m.createVariableDeclaration(i,void 0,w.createTypeOfExpression(_.expression,t,zq,qq,y),void 0),c=m.createVariableStatement(s?[m.createModifier(138)]:[],m.createVariableDeclarationList([o],2)),u=m.createNodeArray(P(t.heritageClauses,e=>{if(96===e.token){const t=a;a=Rq(e.types[0]);const n=m.updateHeritageClause(e,P(e.types,e=>m.updateExpressionWithTypeArguments(e,i,xJ(e.typeArguments,se,T_))));return a=t,n}return m.updateHeritageClause(e,xJ(m.createNodeArray(D(e.types,e=>ub(e.expression)||106===e.expression.kind)),se,BF))}));return[c,h(m.updateClassDeclaration(t,e,t.name,r,u,l))]}{const n=he(t.heritageClauses);return h(m.updateClassDeclaration(t,e,t.name,r,n,l))}}case 244:return h(function(e){if(!p(e.declarationList.declarations,K))return;const t=xJ(e.declarationList.declarations,se,fE);if(!d(t))return;const n=m.createNodeArray(ge(e));let r;lf(e.declarationList)||cf(e.declarationList)?(r=m.createVariableDeclarationList(t,2),kw(r,e.declarationList),FI(r,e.declarationList),Mw(r,e.declarationList)):r=m.updateVariableDeclarationList(e.declarationList,t);return m.updateVariableStatement(e,n,r)}(t));case 267:return h(m.updateEnumDeclaration(t,m.createNodeArray(ge(t)),t.name,m.createNodeArray(J(t.members,t=>{if(fe(t))return;const n=w.getEnumMemberValue(t),r=null==n?void 0:n.value;A&&t.initializer&&(null==n?void 0:n.hasExternalReferences)&&!ND(t.name)&&e.addDiagnostic(qp(t,fa.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations));const i=void 0===r?void 0:"string"==typeof r?m.createStringLiteral(r):r<0?m.createPrefixUnaryExpression(41,m.createNumericLiteral(-r)):m.createNumericLiteral(r);return te(m.updateEnumMember(t,t.name,i),t)}))))}return pn.assertNever(t,`Unhandled top-level node in declaration emit: ${pn.formatSyntaxKind(t.kind)}`);function h(e){return Z(t)&&(n=o),c&&(a=_),268===t.kind&&(s=g),e===t?e:(b=void 0,v=void 0,e&&kw(te(e,t),t))}}function pe(e){return O(J(e.elements,e=>function(e){if(233===e.kind)return;if(e.name){if(!K(e))return;return w_(e.name)?pe(e.name):m.createVariableDeclaration(e.name,void 0,W(e),void 0)}}(e)))}function fe(e){return!!E&&!!e&&Wu(e,x)}function me(e){return ME(e)||RE(e)}function ge(e){const t=Vv(e),n=function(e){let t=130030,n=s&&!function(e){if(265===e.kind)return!0;return!1}(e)?128:0;const r=308===e.parent.kind;(!r||c&&r&&uO(e.parent))&&(t^=128,n=0);return Vq(e,t,n)}(e);return t===n?kJ(e.modifiers,e=>rt(e,r_),r_):m.createModifiersFromModifierFlags(n)}function he(e){return m.createNodeArray(D(P(e,e=>m.updateHeritageClause(e,xJ(m.createNodeArray(D(e.types,t=>ub(t.expression)||96===e.token&&106===t.expression.kind)),se,BF))),e=>e.types&&!!e.types.length))}}function Vq(e,t=131070,n=0){let r=Vv(e)&t|n;return 2048&r&&!(32&r)&&(r^=32),2048&r&&128&r&&(r^=128),r}function Wq(e){switch(e.kind){case 173:case 172:return!Pv(e,2);case 170:case 261:return!0}return!1}var $q={scriptTransformers:_,declarationTransformers:_};function Hq(e,t,n){return{scriptTransformers:Kq(e,t,n),declarationTransformers:Gq(t)}}function Kq(e,t,n){if(n)return _;const r=Sk(e),i=Tk(e),o=Rk(e),a=[];return le(a,t&&P(t.before,Qq)),a.push(sq),e.experimentalDecorators&&a.push(uq),Yk(e)&&a.push(Cq),r<99&&a.push(vq),e.experimentalDecorators||!(r<99)&&o||a.push(dq),a.push(cq),r<8&&a.push(yq),r<7&&a.push(hq),r<6&&a.push(gq),r<5&&a.push(mq),r<4&&a.push(pq),r<3&&a.push(Nq),r<2&&(a.push(Fq),a.push(Eq)),a.push(function(e){switch(e){case 200:return Oq;case 99:case 7:case 6:case 5:case 100:case 101:case 102:case 199:case 1:return Lq;case 4:return Iq;default:return Pq}}(i)),le(a,t&&P(t.after,Qq)),a}function Gq(e){const t=[];return t.push(Uq),le(t,e&&P(e.afterDeclarations,Yq)),t}function Xq(e,t){return n=>{const r=e(n);return"function"==typeof r?t(n,r):function(e){return t=>pP(t)?e.transformBundle(t):e.transformSourceFile(t)}(r)}}function Qq(e){return Xq(e,rz)}function Yq(e){return Xq(e,(e,t)=>t)}function Zq(e,t){return t}function eU(e,t,n){n(e,t)}function tU(e,t,n,r,i,o,a){var s,c;const l=new Array(359);let _,u,d,p,f,m=0,g=[],h=[],y=[],v=[],b=0,x=!1,k=[],S=0,T=Zq,C=eU,w=0;const N=[],D={factory:n,getCompilerOptions:()=>r,getEmitResolver:()=>e,getEmitHost:()=>t,getEmitHelperFactory:ft(()=>_N(D)),startLexicalEnvironment:function(){pn.assert(w>0,"Cannot modify the lexical environment during initialization."),pn.assert(w<2,"Cannot modify the lexical environment after transformation has completed."),pn.assert(!x,"Lexical environment is suspended."),g[b]=_,h[b]=u,y[b]=d,v[b]=m,b++,_=void 0,u=void 0,d=void 0,m=0},suspendLexicalEnvironment:function(){pn.assert(w>0,"Cannot modify the lexical environment during initialization."),pn.assert(w<2,"Cannot modify the lexical environment after transformation has completed."),pn.assert(!x,"Lexical environment is already suspended."),x=!0},resumeLexicalEnvironment:function(){pn.assert(w>0,"Cannot modify the lexical environment during initialization."),pn.assert(w<2,"Cannot modify the lexical environment after transformation has completed."),pn.assert(x,"Lexical environment is not suspended."),x=!1},endLexicalEnvironment:function(){let e;if(pn.assert(w>0,"Cannot modify the lexical environment during initialization."),pn.assert(w<2,"Cannot modify the lexical environment after transformation has completed."),pn.assert(!x,"Lexical environment is suspended."),_||u||d){if(u&&(e=[...u]),_){const t=n.createVariableStatement(void 0,n.createVariableDeclarationList(_));ww(t,2097152),e?e.push(t):e=[t]}d&&(e=e?[...e,...d]:[...d])}b--,_=g[b],u=h[b],d=y[b],m=v[b],0===b&&(g=[],h=[],y=[],v=[]);return e},setLexicalEnvironmentFlags:function(e,t){m=t?m|e:m&~e},getLexicalEnvironmentFlags:function(){return m},hoistVariableDeclaration:function(e){pn.assert(w>0,"Cannot modify the lexical environment during initialization."),pn.assert(w<2,"Cannot modify the lexical environment after transformation has completed.");const t=ww(n.createVariableDeclaration(e),128);_?_.push(t):_=[t];1&m&&(m|=2)},hoistFunctionDeclaration:function(e){pn.assert(w>0,"Cannot modify the lexical environment during initialization."),pn.assert(w<2,"Cannot modify the lexical environment after transformation has completed."),ww(e,2097152),u?u.push(e):u=[e]},addInitializationStatement:function(e){pn.assert(w>0,"Cannot modify the lexical environment during initialization."),pn.assert(w<2,"Cannot modify the lexical environment after transformation has completed."),ww(e,2097152),d?d.push(e):d=[e]},startBlockScope:function(){pn.assert(w>0,"Cannot start a block scope during initialization."),pn.assert(w<2,"Cannot start a block scope after transformation has completed."),k[S]=p,S++,p=void 0},endBlockScope:function(){pn.assert(w>0,"Cannot end a block scope during initialization."),pn.assert(w<2,"Cannot end a block scope after transformation has completed.");const e=H(p)?[n.createVariableStatement(void 0,n.createVariableDeclarationList(p.map(e=>n.createVariableDeclaration(e)),1))]:void 0;S--,p=k[S],0===S&&(k=[]);return e},addBlockScopedVariable:function(e){pn.assert(S>0,"Cannot add a block scoped variable outside of an iteration body."),(p||(p=[])).push(e)},requestEmitHelper:function e(t){if(pn.assert(w>0,"Cannot modify the transformation context during initialization."),pn.assert(w<2,"Cannot modify the transformation context after transformation has completed."),pn.assert(!t.scoped,"Cannot request a scoped emit helper."),t.dependencies)for(const n of t.dependencies)e(n);f=ae(f,t)},readEmitHelpers:function(){pn.assert(w>0,"Cannot modify the transformation context during initialization."),pn.assert(w<2,"Cannot modify the transformation context after transformation has completed.");const e=f;return f=void 0,e},enableSubstitution:function(e){pn.assert(w<2,"Cannot modify the transformation context after transformation has completed."),l[e]|=1},enableEmitNotification:function(e){pn.assert(w<2,"Cannot modify the transformation context after transformation has completed."),l[e]|=2},isSubstitutionEnabled:I,isEmitNotificationEnabled:O,get onSubstituteNode(){return T},set onSubstituteNode(e){pn.assert(w<1,"Cannot modify transformation hooks after initialization has completed."),pn.assert(void 0!==e,"Value must not be 'undefined'"),T=e},get onEmitNode(){return C},set onEmitNode(e){pn.assert(w<1,"Cannot modify transformation hooks after initialization has completed."),pn.assert(void 0!==e,"Value must not be 'undefined'"),C=e},addDiagnostic(e){N.push(e)}};for(const e of i)Tw(Sd(hc(e)));rr("beforeTransform");const F=o.map(e=>e(D)),E=e=>{for(const t of F)e=t(e);return e};w=1;const P=[];for(const e of i)null==(s=Gn)||s.push(Gn.Phase.Emit,"transformNodes",308===e.kind?{path:e.path}:{kind:e.kind,pos:e.pos,end:e.end}),P.push((a?E:A)(e)),null==(c=Gn)||c.pop();return w=2,rr("afterTransform"),ir("transformTime","beforeTransform","afterTransform"),{transformed:P,substituteNode:function(e,t){return pn.assert(w<3,"Cannot substitute a node after the result is disposed."),t&&I(t)&&T(e,t)||t},emitNodeWithNotification:function(e,t,n){pn.assert(w<3,"Cannot invoke TransformationResult callbacks after the result is disposed."),t&&(O(t)?C(e,t,n):n(e,t))},isEmitNotificationEnabled:O,dispose:function(){if(w<3){for(const e of i)Tw(Sd(hc(e)));_=void 0,g=void 0,u=void 0,h=void 0,T=void 0,C=void 0,f=void 0,w=3}},diagnostics:N};function A(e){return!e||dP(e)&&e.isDeclarationFile?e:E(e)}function I(e){return!(!(1&l[e.kind])||8&rp(e))}function O(e){return!!(2&l[e.kind])||!!(4&rp(e))}}var nU={factory:bw,getCompilerOptions:()=>({}),getEmitResolver:pt,getEmitHost:pt,getEmitHelperFactory:pt,startLexicalEnvironment:ot,resumeLexicalEnvironment:ot,suspendLexicalEnvironment:ot,endLexicalEnvironment:ct,setLexicalEnvironmentFlags:ot,getLexicalEnvironmentFlags:()=>0,hoistVariableDeclaration:ot,hoistFunctionDeclaration:ot,addInitializationStatement:ot,startBlockScope:ot,endBlockScope:ct,addBlockScopedVariable:ot,requestEmitHelper:ot,readEmitHelpers:pt,enableSubstitution:ot,enableEmitNotification:ot,isSubstitutionEnabled:pt,isEmitNotificationEnabled:pt,onSubstituteNode:Zq,onEmitNode:eU,addDiagnostic:ot},rU=function(){const e=[];return e[1024]=["{","}"],e[2048]=["(",")"],e[4096]=["<",">"],e[8192]=["[","]"],e}();function iU(e){return wo(e,".tsbuildinfo")}function oU(e,t,n,r=!1,i,o){const a=Ze(n)?n:Zy(e,n,r),s=e.getCompilerOptions();if(!i)if(s.outFile){if(a.length){const n=bw.createBundle(a),i=t(cU(n,e,r),n);if(i)return i}}else for(const n of a){const i=t(cU(n,e,r),n);if(i)return i}if(o){const e=aU(s);if(e)return t({buildInfoPath:e},void 0)}}function aU(e){const t=e.configFilePath;if(!function(e){return Lk(e)||!!e.tscBuild}(e))return;if(e.tsBuildInfoFile)return e.tsBuildInfoFile;const n=e.outFile;let r;if(n)r=KS(n);else{if(!t)return;const n=KS(t);r=e.outDir?e.rootDir?zo(e.outDir,sa(e.rootDir,n,!0)):Jo(e.outDir,Io(n)):n}return r+".tsbuildinfo"}function sU(e,t){const n=e.outFile,r=e.emitDeclarationOnly?void 0:n,i=r&&lU(r,e),o=t||Ik(e)?KS(n)+".d.ts":void 0;return{jsFilePath:r,sourceMapFilePath:i,declarationFilePath:o,declarationMapPath:o&&jk(e)?o+".map":void 0}}function cU(e,t,n){const r=t.getCompilerOptions();if(309===e.kind)return sU(r,n);{const i=$y(e.fileName,t,_U(e.fileName,r)),o=of(e),a=o&&0===ra(e.fileName,i,t.getCurrentDirectory(),!t.useCaseSensitiveFileNames()),s=r.emitDeclarationOnly||a?void 0:i,c=!s||of(e)?void 0:lU(s,r),l=n||Ik(r)&&!o?Hy(e.fileName,t):void 0;return{jsFilePath:s,sourceMapFilePath:c,declarationFilePath:l,declarationMapPath:l&&jk(r)?l+".map":void 0}}}function lU(e,t){return t.sourceMap&&!t.inlineSourceMap?e+".map":void 0}function _U(e,t){return wo(e,".json")?".json":1===t.jsx&&No(e,[".jsx",".tsx"])?".jsx":No(e,[".mts",".mjs"])?".mjs":No(e,[".cts",".cjs"])?".cjs":".js"}function uU(e,t,n,r){return n?zo(n,sa(r(),e,t)):e}function dU(e,t,n,r=()=>bU(t,n)){return pU(e,t.options,n,r)}function pU(e,t,n,r){return QS(uU(e,n,t.declarationDir||t.outDir,r),Gy(e))}function fU(e,t,n,r=()=>bU(t,n)){if(t.options.emitDeclarationOnly)return;const i=wo(e,".json"),o=mU(e,t.options,n,r);return i&&0===ra(e,o,pn.checkDefined(t.options.configFilePath),n)?void 0:o}function mU(e,t,n,r){return QS(uU(e,n,t.outDir,r),_U(e,t))}function gU(){let e;return{addOutput:function(t){t&&(e||(e=[])).push(t)},getOutputs:function(){return e||_}}}function hU(e,t){const{jsFilePath:n,sourceMapFilePath:r,declarationFilePath:i,declarationMapPath:o}=sU(e.options,!1);t(n),t(r),t(i),t(o)}function yU(e,t,n,r,i){if(vO(t))return;const o=fU(t,e,n,i);if(r(o),!wo(t,".json")&&(o&&e.options.sourceMap&&r(`${o}.map`),Ik(e.options))){const o=dU(t,e,n,i);r(o),e.options.declarationMap&&r(`${o}.map`)}}function vU(e,t,n,r,i){let o;return e.rootDir?(o=Uo(e.rootDir,n),null==i||i(e.rootDir)):e.composite&&e.configFilePath?(o=Ao(Ro(e.configFilePath)),null==i||i(o)):o=YU(t(),n,r),o&&o[o.length-1]!==fo&&(o+=fo),o}function bU({options:e,fileNames:t},n){return vU(e,()=>D(t,t=>!(e.noEmitForJsFiles&&No(t,PS)||vO(t))),Ao(Ro(pn.checkDefined(e.configFilePath))),Ht(!n))}function xU(e,t){const{addOutput:n,getOutputs:r}=gU();if(e.options.outFile)hU(e,n);else{const r=ft(()=>bU(e,t));for(const i of e.fileNames)yU(e,i,t,n,r)}return n(aU(e.options)),r()}function kU(e,t,n){t=Vo(t),pn.assert(C(e.fileNames,t),"Expected fileName to be present in command line");const{addOutput:r,getOutputs:i}=gU();return e.options.outFile?hU(e,r):yU(e,t,n,r),i()}function SU(e,t){if(e.options.outFile){const{jsFilePath:t,declarationFilePath:n}=sU(e.options,!1);return pn.checkDefined(t||n,`project ${e.options.configFilePath} expected to have at least one output`)}const n=ft(()=>bU(e,t));for(const r of e.fileNames){if(vO(r))continue;const i=fU(r,e,t,n);if(i)return i;if(!wo(r,".json")&&Ik(e.options))return dU(r,e,t,n)}const r=aU(e.options);return r||pn.fail(`project ${e.options.configFilePath} expected to have at least one output`)}function TU(e,t){return!!t&&!!e}function CU(e,t,n,{scriptTransformers:r,declarationTransformers:i},o,a,s,l){var _=t.getCompilerOptions(),u=_.sourceMap||_.inlineSourceMap||jk(_)?[]:void 0,p=_.listEmittedFiles?[]:void 0,f=fy(),m=jb(_),g=Ry(m),{enter:h,exit:y}=Kn("printTime","beforePrint","afterPrint"),v=!1;return h(),oU(t,function({jsFilePath:a,sourceMapFilePath:l,declarationFilePath:u,declarationMapPath:m,buildInfoPath:g},h){var y,k,S,T,C,w;null==(y=Gn)||y.push(Gn.Phase.Emit,"emitJsFileOrBundle",{jsFilePath:a}),function(n,i,a){if(!n||o||!i)return;if(t.isEmitBlocked(i)||_.noEmit)return void(v=!0);(dP(n)?[n]:D(n.sourceFiles,jm)).forEach(t=>{!_.noCheck&&yT(t,_)||function(t){if(Im(t))return;oO(t,t=>!CE(t)||32&$v(t)?wE(t)?"skip":void e.markLinkedReferences(t):"skip")}(t)});const s=tU(e,t,bw,_,[n],r,!1),c=IU({removeComments:_.removeComments,newLine:_.newLine,noEmitHelpers:_.noEmitHelpers,module:Tk(_),moduleResolution:Ck(_),target:Sk(_),sourceMap:_.sourceMap,inlineSourceMap:_.inlineSourceMap,inlineSources:_.inlineSources,extendedDiagnostics:_.extendedDiagnostics},{hasGlobalName:e.hasGlobalName,onEmitNode:s.emitNodeWithNotification,isEmitNotificationEnabled:s.isEmitNotificationEnabled,substituteNode:s.substituteNode});pn.assert(1===s.transformed.length,"Should only see one output from the transform"),x(i,a,s,c,_),s.dispose(),p&&(p.push(i),a&&p.push(a))}(h,a,l),null==(k=Gn)||k.pop(),null==(S=Gn)||S.push(Gn.Phase.Emit,"emitDeclarationFileOrBundle",{declarationFilePath:u}),function(n,r,a){if(!n||0===o)return;if(!r)return void((o||_.emitDeclarationOnly)&&(v=!0));const c=dP(n)?[n]:n.sourceFiles,l=s?c:D(c,jm),u=_.outFile?[bw.createBundle(l)]:l;l.forEach(e=>{(o&&!Ik(_)||_.noCheck||TU(o,s)||!yT(e,_))&&b(e)});const m=tU(e,t,bw,_,u,i,!1);if(d(m.diagnostics))for(const e of m.diagnostics)f.add(e);const g=!!m.diagnostics&&!!m.diagnostics.length||!!t.isEmitBlocked(r)||!!_.noEmit;if(v=v||g,!g||s){pn.assert(1===m.transformed.length,"Should only see one output from the decl transform");const t={removeComments:_.removeComments,newLine:_.newLine,noEmitHelpers:!0,module:_.module,moduleResolution:_.moduleResolution,target:_.target,sourceMap:2!==o&&_.declarationMap,inlineSourceMap:_.inlineSourceMap,extendedDiagnostics:_.extendedDiagnostics,onlyPrintJsDocStyle:!0,omitBraceSourceMapPositions:!0},n=x(r,a,m,IU(t,{hasGlobalName:e.hasGlobalName,onEmitNode:m.emitNodeWithNotification,isEmitNotificationEnabled:m.isEmitNotificationEnabled,substituteNode:m.substituteNode}),{sourceMap:t.sourceMap,sourceRoot:_.sourceRoot,mapRoot:_.mapRoot,extendedDiagnostics:_.extendedDiagnostics});p&&(n&&p.push(r),a&&p.push(a))}m.dispose()}(h,u,m),null==(T=Gn)||T.pop(),null==(C=Gn)||C.push(Gn.Phase.Emit,"emitBuildInfo",{buildInfoPath:g}),function(e){if(!e||n)return;if(t.isEmitBlocked(e))return void(v=!0);const r=t.getBuildInfo()||{version:c};rv(t,f,e,wU(r),!1,void 0,{buildInfo:r}),null==p||p.push(e)}(g),null==(w=Gn)||w.pop()},Zy(t,n,s),s,a,!n&&!l),y(),{emitSkipped:v,diagnostics:f.getDiagnostics(),emittedFiles:p,sourceMaps:u};function b(t){ME(t)?80===t.expression.kind&&e.collectLinkedAliases(t.expression,!0):JE(t)?e.collectLinkedAliases(t.propertyName||t.name,!0):iO(t,b)}function x(e,n,r,i,o){const a=r.transformed[0],s=309===a.kind?a:void 0,c=308===a.kind?a:void 0,l=s?s.sourceFiles:[c];let d,p;if(function(e,t){return(e.sourceMap||e.inlineSourceMap)&&(308!==t.kind||!wo(t.fileName,".json"))}(o,a)&&(d=IJ(t,Io(Ro(e)),function(e){const t=Ro(e.sourceRoot||"");return t?Go(t):t}(o),function(e,n,r){if(e.sourceRoot)return t.getCommonSourceDirectory();if(e.mapRoot){let n=Ro(e.mapRoot);return r&&(n=Ao(tv(r.fileName,t,n))),0===Po(n)&&(n=Jo(t.getCommonSourceDirectory(),n)),n}return Ao(Vo(n))}(o,e,c),o)),s?i.writeBundle(s,g,d):i.writeFile(c,g,d),d){u&&u.push({inputSourceFileNames:d.getSources(),sourceMap:d.toJSON()});const r=function(e,n,r,i,o){if(e.inlineSourceMap){const e=n.toString();return`data:application/json;base64,${Db(uo,e)}`}const a=Io(Ro(pn.checkDefined(i)));if(e.mapRoot){let n=Ro(e.mapRoot);return o&&(n=Ao(tv(o.fileName,t,n))),0===Po(n)?(n=Jo(t.getCommonSourceDirectory(),n),encodeURI(_a(Ao(Vo(r)),Jo(n,a),t.getCurrentDirectory(),t.getCanonicalFileName,!0))):encodeURI(Jo(n,a))}return encodeURI(a)}(o,d,e,n,c);if(r&&(g.isAtStartOfLine()||g.rawWrite(m),p=g.getTextPos(),g.writeComment(`//# sourceMappingURL=${r}`)),n){const e=d.toString();rv(t,f,n,e,!1,l)}}else g.writeLine();const h=g.getText(),y={sourceMapUrlPos:p,diagnostics:r.diagnostics};return rv(t,f,e,h,!!_.emitBOM,l,y),g.clear(),!y.skippedDtsWrite}}function wU(e){return JSON.stringify(e)}function NU(e,t){return Eb(e,t)}var DU={hasGlobalName:pt,getReferencedExportContainer:pt,getReferencedImportDeclaration:pt,getReferencedDeclarationWithCollidingName:pt,isDeclarationWithCollidingName:pt,isValueAliasDeclaration:pt,isReferencedAliasDeclaration:pt,isTopLevelValueImportEqualsWithEntityName:pt,hasNodeCheckFlag:pt,isDeclarationVisible:pt,isLateBound:e=>!1,collectLinkedAliases:pt,markLinkedReferences:pt,isImplementationOfOverload:pt,requiresAddingImplicitUndefined:pt,isExpandoFunctionDeclaration:pt,getPropertiesOfContainerFunction:pt,createTypeOfDeclaration:pt,createReturnTypeOfSignatureDeclaration:pt,createTypeOfExpression:pt,createLiteralConstValue:pt,isSymbolAccessible:pt,isEntityNameVisible:pt,getConstantValue:pt,getEnumMemberValue:pt,getReferencedValueDeclaration:pt,getReferencedValueDeclarations:pt,getTypeReferenceSerializationKind:pt,isOptionalParameter:pt,isArgumentsLocalBinding:pt,getExternalModuleFileFromDeclaration:pt,isLiteralConstDeclaration:pt,getJsxFactoryEntity:pt,getJsxFragmentFactoryEntity:pt,isBindingCapturedByNode:pt,getDeclarationStatementsForSourceFile:pt,isImportRequiredByAugmentation:pt,isDefinitelyReferenceToGlobalSymbolObject:pt,createLateBoundIndexSignatures:pt,symbolToDeclarations:pt},FU=ft(()=>IU({})),EU=ft(()=>IU({removeComments:!0})),PU=ft(()=>IU({removeComments:!0,neverAsciiEscape:!0})),AU=ft(()=>IU({removeComments:!0,omitTrailingSemicolon:!0}));function IU(e={},t={}){var n,r,i,o,a,s,c,l,_,u,d,f,m,g,h,y,v,x,k,T,C,w,N,D,F,E,{hasGlobalName:P,onEmitNode:A=eU,isEmitNotificationEnabled:I,substituteNode:O=Zq,onBeforeEmitNode:L,onAfterEmitNode:j,onBeforeEmitNodeArray:M,onAfterEmitNodeArray:R,onBeforeEmitToken:B,onAfterEmitToken:J}=t,z=!!e.extendedDiagnostics,q=!!e.omitBraceSourceMapPositions,U=jb(e),V=Tk(e),W=new Map,$=e.preserveSourceNewlines,K=function(e){v.write(e)},G=!0,X=-1,Q=-1,Y=-1,Z=-1,ee=-1,te=!1,ne=!!e.removeComments,{enter:re,exit:ie}=Hn(z,"commentTime","beforeComment","afterComment"),oe=bw.parenthesizer,ae={select:e=>0===e?oe.parenthesizeLeadingTypeArgument:void 0},se=function(){return mI(function(e,t){if(t){t.stackIndex++,t.preserveSourceNewlinesStack[t.stackIndex]=$,t.containerPosStack[t.stackIndex]=Y,t.containerEndStack[t.stackIndex]=Z,t.declarationListContainerEndStack[t.stackIndex]=ee;const n=t.shouldEmitCommentsStack[t.stackIndex]=Ie(e),r=t.shouldEmitSourceMapsStack[t.stackIndex]=Oe(e);null==L||L(e),n&&Xn(e),r&&yr(e),Ee(e)}else t={stackIndex:0,preserveSourceNewlinesStack:[void 0],containerPosStack:[-1],containerEndStack:[-1],declarationListContainerEndStack:[-1],shouldEmitCommentsStack:[!1],shouldEmitSourceMapsStack:[!1]};return t},function(t,n,r){return e(t,r,"left")},function(e,t,n){const r=28!==e.kind,i=Cn(n,n.left,e),o=Cn(n,e,n.right);gn(i,r),cr(e.pos),un(e,103===e.kind?Zt:en),_r(e.end,!0),gn(o,!0)},function(t,n,r){return e(t,r,"right")},function(e,t){const n=Cn(e,e.left,e.operatorToken),r=Cn(e,e.operatorToken,e.right);if(hn(n,r),t.stackIndex>0){const n=t.preserveSourceNewlinesStack[t.stackIndex],r=t.containerPosStack[t.stackIndex],i=t.containerEndStack[t.stackIndex],o=t.declarationListContainerEndStack[t.stackIndex],a=t.shouldEmitCommentsStack[t.stackIndex],s=t.shouldEmitSourceMapsStack[t.stackIndex];Pe(n),s&&vr(e),a&&Qn(e,r,i,o),null==j||j(e),t.stackIndex--}},void 0);function e(e,t,n){const r="left"===n?oe.getParenthesizeLeftSideOfBinaryForOperator(t.operatorToken.kind):oe.getParenthesizeRightSideOfBinaryForOperator(t.operatorToken.kind);let i=Le(0,1,e);if(i===Je&&(pn.assertIsDefined(F),i=je(1,1,e=r(it(F,K_))),F=void 0),(i===Gn||i===hr||i===Re)&&AF(e))return e;E=r,i(1,e)}}();return Te(),{printNode:function(e,t,n){switch(e){case 0:pn.assert(dP(t),"Expected a SourceFile node.");break;case 2:pn.assert(uD(t),"Expected an Identifier node.");break;case 1:pn.assert(K_(t),"Expected an Expression node.")}switch(t.kind){case 308:return le(t);case 309:return ce(t)}return _e(e,t,n,me()),he()},printList:function(e,t,n){return ue(e,t,n,me()),he()},printFile:le,printBundle:ce,writeNode:_e,writeList:ue,writeFile:fe,writeBundle:pe};function ce(e){return pe(e,me(),void 0),he()}function le(e){return fe(e,me(),void 0),he()}function _e(e,t,n,r){const i=v;Se(r,void 0),ye(e,t,n),Te(),v=i}function ue(e,t,n,r){const i=v;Se(r,void 0),n&&ve(n),Wt(void 0,t,e),Te(),v=i}function pe(e,t,n){k=!1;const r=v;var i;Se(t,n),Pt(e),Et(e),ze(e),Nt(!!(i=e).hasNoDefaultLib,i.syntheticFileReferences||[],i.syntheticTypeReferences||[],i.syntheticLibReferences||[]);for(const t of e.sourceFiles)ye(0,t,t);Te(),v=r}function fe(e,t,n){k=!0;const r=v;Se(t,n),Pt(e),Et(e),ye(0,e,e),Te(),v=r}function me(){return x||(x=Ry(U))}function he(){const e=x.getText();return x.clear(),e}function ye(e,t,n){n&&ve(n),Ae(e,t,void 0)}function ve(e){n=e,N=void 0,D=void 0,e&&Tr(e)}function Se(t,n){t&&e.omitTrailingSemicolon&&(t=By(t)),T=n,G=!(v=t)||!T}function Te(){r=[],i=[],o=[],a=new Set,s=[],c=new Map,l=[],_=0,u=[],d=0,f=[],m=void 0,g=[],h=void 0,n=void 0,N=void 0,D=void 0,Se(void 0,void 0)}function Ce(){return N||(N=za(pn.checkDefined(n)))}function we(e,t){void 0!==e&&Ae(4,e,t)}function Ne(e){void 0!==e&&Ae(2,e,void 0)}function De(e,t){void 0!==e&&Ae(1,e,t)}function Fe(e){Ae(KN(e)?6:4,e)}function Ee(e){$&&4&ip(e)&&($=!1)}function Pe(e){$=e}function Ae(e,t,n){E=n;Le(0,e,t)(e,t),E=void 0}function Ie(e){return!ne&&!dP(e)}function Oe(e){return!G&&!dP(e)&&!Lm(e)}function Le(e,t,n){switch(e){case 0:if(A!==eU&&(!I||I(n)))return Me;case 1:if(O!==Zq&&(F=O(t,n)||n)!==n)return E&&(F=E(F)),Je;case 2:if(Ie(n))return Gn;case 3:if(Oe(n))return hr;case 4:return Re;default:return pn.assertNever(e)}}function je(e,t,n){return Le(e+1,t,n)}function Me(e,t){const n=je(0,e,t);A(e,t,n)}function Re(e,t){if(null==L||L(t),$){const n=$;Ee(t),Be(e,t),Pe(n)}else Be(e,t);null==j||j(t),E=void 0}function Be(e,t,r=!0){if(r){const n=Yw(t);if(n)return function(e,t,n){switch(n.kind){case 1:!function(e,t,n){an(`\${${n.order}:`),Be(e,t,!1),an("}")}(e,t,n);break;case 0:!function(e,t,n){pn.assert(243===t.kind,`A tab stop cannot be attached to a node of kind ${pn.formatSyntaxKind(t.kind)}.`),pn.assert(5!==e,"A tab stop cannot be attached to an embedded statement."),an(`$${n.order}`)}(e,t,n)}}(e,t,n)}if(0===e)return wt(it(t,dP));if(2===e)return Ve(it(t,uD));if(6===e)return Ue(it(t,KN),!0);if(3===e)return function(e){we(e.name),rn(),Zt("in"),rn(),we(e.constraint)}(it(t,DD));if(7===e)return function(e){Qt("{"),rn(),Zt(132===e.token?"assert":"with"),Qt(":"),rn();const t=e.elements;Wt(e,t,526226),rn(),Qt("}")}(it(t,PE));if(5===e)return pn.assertNode(t,QF),Ye(!0);if(4===e){switch(t.kind){case 16:case 17:case 18:return Ue(t,!1);case 80:return Ve(t);case 81:return We(t);case 167:return function(e){(function(e){80===e.kind?De(e):we(e)})(e.left),Qt("."),we(e.right)}(t);case 168:return function(e){Qt("["),De(e.expression,oe.parenthesizeExpressionOfComputedPropertyName),Qt("]")}(t);case 169:return function(e){Ot(e,e.modifiers),we(e.name),e.constraint&&(rn(),Zt("extends"),rn(),we(e.constraint));e.default&&(rn(),en("="),rn(),we(e.default))}(t);case 170:return function(e){It(e,e.modifiers,!0),we(e.dotDotDotToken),At(e.name,tn),we(e.questionToken),e.parent&&318===e.parent.kind&&!e.name?we(e.type):Lt(e.type);jt(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name?e.name.end:e.modifiers?e.modifiers.end:e.pos,e,oe.parenthesizeExpressionForDisallowedComma)}(t);case 171:return o=t,Qt("@"),void De(o.expression,oe.parenthesizeLeftSideOfAccess);case 172:return function(e){Ot(e,e.modifiers),At(e.name,on),we(e.questionToken),Lt(e.type),Yt()}(t);case 173:return function(e){It(e,e.modifiers,!0),we(e.name),we(e.questionToken),we(e.exclamationToken),Lt(e.type),jt(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name.end,e),Yt()}(t);case 174:return function(e){Ot(e,e.modifiers),we(e.name),we(e.questionToken),lt(e,dt,ut)}(t);case 175:return function(e){It(e,e.modifiers,!0),we(e.asteriskToken),we(e.name),we(e.questionToken),lt(e,dt,_t)}(t);case 176:return function(e){Zt("static"),En(e),pt(e.body),Pn(e)}(t);case 177:return function(e){It(e,e.modifiers,!1),Zt("constructor"),lt(e,dt,_t)}(t);case 178:case 179:return function(e){const t=It(e,e.modifiers,!0),n=178===e.kind?139:153;tt(n,t,Zt,e),rn(),we(e.name),lt(e,dt,_t)}(t);case 180:return function(e){lt(e,dt,ut)}(t);case 181:return function(e){Zt("new"),rn(),lt(e,dt,ut)}(t);case 182:return function(e){It(e,e.modifiers,!1),t=e,n=e.parameters,Wt(t,n,8848),Lt(e.type),Yt();var t,n}(t);case 183:return function(e){e.assertsModifier&&(we(e.assertsModifier),rn());we(e.parameterName),e.type&&(rn(),Zt("is"),rn(),we(e.type))}(t);case 184:return function(e){we(e.typeName),Jt(e,e.typeArguments)}(t);case 185:return function(e){lt(e,$e,He)}(t);case 186:return function(e){Ot(e,e.modifiers),Zt("new"),rn(),lt(e,$e,He)}(t);case 187:return function(e){Zt("typeof"),rn(),we(e.exprName),Jt(e,e.typeArguments)}(t);case 188:return function(e){En(e),p(e.members,Ln),Qt("{");const t=1&rp(e)?768:32897;Wt(e,e.members,524288|t),Qt("}"),Pn(e)}(t);case 189:return function(e){we(e.elementType,oe.parenthesizeNonArrayTypeOfPostfixType),Qt("["),Qt("]")}(t);case 190:return function(e){tt(23,e.pos,Qt,e);const t=1&rp(e)?528:657;Wt(e,e.elements,524288|t,oe.parenthesizeElementTypeOfTupleType),tt(24,e.elements.end,Qt,e)}(t);case 191:return function(e){we(e.type,oe.parenthesizeTypeOfOptionalType),Qt("?")}(t);case 193:return function(e){Wt(e,e.types,516,oe.parenthesizeConstituentTypeOfUnionType)}(t);case 194:return function(e){Wt(e,e.types,520,oe.parenthesizeConstituentTypeOfIntersectionType)}(t);case 195:return function(e){we(e.checkType,oe.parenthesizeCheckTypeOfConditionalType),rn(),Zt("extends"),rn(),we(e.extendsType,oe.parenthesizeExtendsTypeOfConditionalType),rn(),Qt("?"),rn(),we(e.trueType),rn(),Qt(":"),rn(),we(e.falseType)}(t);case 196:return function(e){Zt("infer"),rn(),we(e.typeParameter)}(t);case 197:return function(e){Qt("("),we(e.type),Qt(")")}(t);case 234:return Xe(t);case 198:return void Zt("this");case 199:return function(e){dn(e.operator,Zt),rn();const t=148===e.operator?oe.parenthesizeOperandOfReadonlyTypeOperator:oe.parenthesizeOperandOfTypeOperator;we(e.type,t)}(t);case 200:return function(e){we(e.objectType,oe.parenthesizeNonArrayTypeOfPostfixType),Qt("["),we(e.indexType),Qt("]")}(t);case 201:return function(e){const t=rp(e);Qt("{"),1&t?rn():(sn(),cn());e.readonlyToken&&(we(e.readonlyToken),148!==e.readonlyToken.kind&&Zt("readonly"),rn());Qt("["),Ae(3,e.typeParameter),e.nameType&&(rn(),Zt("as"),rn(),we(e.nameType));Qt("]"),e.questionToken&&(we(e.questionToken),58!==e.questionToken.kind&&Qt("?"));Qt(":"),rn(),we(e.type),Yt(),1&t?rn():(sn(),ln());Wt(e,e.members,2),Qt("}")}(t);case 202:return function(e){De(e.literal)}(t);case 203:return function(e){we(e.dotDotDotToken),we(e.name),we(e.questionToken),tt(59,e.name.end,Qt,e),rn(),we(e.type)}(t);case 204:return function(e){we(e.head),Wt(e,e.templateSpans,262144)}(t);case 205:return function(e){we(e.type),we(e.literal)}(t);case 206:return function(e){e.isTypeOf&&(Zt("typeof"),rn());Zt("import"),Qt("("),we(e.argument),e.attributes&&(Qt(","),rn(),Ae(7,e.attributes));Qt(")"),e.qualifier&&(Qt("."),we(e.qualifier));Jt(e,e.typeArguments)}(t);case 207:return function(e){Qt("{"),Wt(e,e.elements,525136),Qt("}")}(t);case 208:return function(e){Qt("["),Wt(e,e.elements,524880),Qt("]")}(t);case 209:return function(e){we(e.dotDotDotToken),e.propertyName&&(we(e.propertyName),Qt(":"),rn());we(e.name),jt(e.initializer,e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(t);case 240:return function(e){De(e.expression),we(e.literal)}(t);case 241:return void Yt();case 242:return function(e){Qe(e,!e.multiLine&&wn(e))}(t);case 244:return function(e){It(e,e.modifiers,!1),we(e.declarationList),Yt()}(t);case 243:return Ye(!1);case 245:return function(e){De(e.expression,oe.parenthesizeExpressionOfExpressionStatement),n&&of(n)&&!iy(e.expression)||Yt()}(t);case 246:return function(e){const t=tt(101,e.pos,Zt,e);rn(),tt(21,t,Qt,e),De(e.expression),tt(22,e.expression.end,Qt,e),Bt(e,e.thenStatement),e.elseStatement&&(fn(e,e.thenStatement,e.elseStatement),tt(93,e.thenStatement.end,Zt,e),246===e.elseStatement.kind?(rn(),we(e.elseStatement)):Bt(e,e.elseStatement))}(t);case 247:return function(e){tt(92,e.pos,Zt,e),Bt(e,e.statement),GF(e.statement)&&!$?rn():fn(e,e.statement,e.expression);Ze(e,e.statement.end),Yt()}(t);case 248:return function(e){Ze(e,e.pos),Bt(e,e.statement)}(t);case 249:return function(e){const t=tt(99,e.pos,Zt,e);rn();let n=tt(21,t,Qt,e);et(e.initializer),n=tt(27,e.initializer?e.initializer.end:n,Qt,e),Rt(e.condition),n=tt(27,e.condition?e.condition.end:n,Qt,e),Rt(e.incrementor),tt(22,e.incrementor?e.incrementor.end:n,Qt,e),Bt(e,e.statement)}(t);case 250:return function(e){const t=tt(99,e.pos,Zt,e);rn(),tt(21,t,Qt,e),et(e.initializer),rn(),tt(103,e.initializer.end,Zt,e),rn(),De(e.expression),tt(22,e.expression.end,Qt,e),Bt(e,e.statement)}(t);case 251:return function(e){const t=tt(99,e.pos,Zt,e);rn(),function(e){e&&(we(e),rn())}(e.awaitModifier),tt(21,t,Qt,e),et(e.initializer),rn(),tt(165,e.initializer.end,Zt,e),rn(),De(e.expression),tt(22,e.expression.end,Qt,e),Bt(e,e.statement)}(t);case 252:return function(e){tt(88,e.pos,Zt,e),Mt(e.label),Yt()}(t);case 253:return function(e){tt(83,e.pos,Zt,e),Mt(e.label),Yt()}(t);case 254:return function(e){tt(107,e.pos,Zt,e),Rt(e.expression&&at(e.expression),at),Yt()}(t);case 255:return function(e){const t=tt(118,e.pos,Zt,e);rn(),tt(21,t,Qt,e),De(e.expression),tt(22,e.expression.end,Qt,e),Bt(e,e.statement)}(t);case 256:return function(e){const t=tt(109,e.pos,Zt,e);rn(),tt(21,t,Qt,e),De(e.expression),tt(22,e.expression.end,Qt,e),rn(),we(e.caseBlock)}(t);case 257:return function(e){we(e.label),tt(59,e.label.end,Qt,e),rn(),we(e.statement)}(t);case 258:return function(e){tt(111,e.pos,Zt,e),Rt(at(e.expression),at),Yt()}(t);case 259:return function(e){tt(113,e.pos,Zt,e),rn(),we(e.tryBlock),e.catchClause&&(fn(e,e.tryBlock,e.catchClause),we(e.catchClause));e.finallyBlock&&(fn(e,e.catchClause||e.tryBlock,e.finallyBlock),tt(98,(e.catchClause||e.tryBlock).end,Zt,e),rn(),we(e.finallyBlock))}(t);case 260:return function(e){_n(89,e.pos,Zt),Yt()}(t);case 261:return function(e){var t,n,r;we(e.name),we(e.exclamationToken),Lt(e.type),jt(e.initializer,(null==(t=e.type)?void 0:t.end)??(null==(r=null==(n=e.name.emitNode)?void 0:n.typeNode)?void 0:r.end)??e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(t);case 262:return function(e){if(cf(e))Zt("await"),rn(),Zt("using");else{Zt(df(e)?"let":_f(e)?"const":lf(e)?"using":"var")}rn(),Wt(e,e.declarations,528)}(t);case 263:return function(e){ct(e)}(t);case 264:return function(e){gt(e)}(t);case 265:return function(e){It(e,e.modifiers,!1),Zt("interface"),rn(),we(e.name),zt(e,e.typeParameters),Wt(e,e.heritageClauses,512),rn(),Qt("{"),En(e),p(e.members,Ln),Wt(e,e.members,129),Pn(e),Qt("}")}(t);case 266:return function(e){It(e,e.modifiers,!1),Zt("type"),rn(),we(e.name),zt(e,e.typeParameters),rn(),Qt("="),rn(),we(e.type),Yt()}(t);case 267:return function(e){It(e,e.modifiers,!1),Zt("enum"),rn(),we(e.name),rn(),Qt("{"),Wt(e,e.members,145),Qt("}")}(t);case 268:return function(e){It(e,e.modifiers,!1),2048&~e.flags&&(Zt(32&e.flags?"namespace":"module"),rn());we(e.name);let t=e.body;if(!t)return Yt();for(;t&&xE(t);)Qt("."),we(t.name),t=t.body;rn(),we(t)}(t);case 269:return function(e){En(e),p(e.statements,On),Qe(e,wn(e)),Pn(e)}(t);case 270:return function(e){tt(19,e.pos,Qt,e),Wt(e,e.clauses,129),tt(20,e.clauses.end,Qt,e,!0)}(t);case 271:return function(e){let t=tt(95,e.pos,Zt,e);rn(),t=tt(130,t,Zt,e),rn(),t=tt(145,t,Zt,e),rn(),we(e.name),Yt()}(t);case 272:return function(e){It(e,e.modifiers,!1),tt(102,e.modifiers?e.modifiers.end:e.pos,Zt,e),rn(),e.isTypeOnly&&(tt(156,e.pos,Zt,e),rn());we(e.name),rn(),tt(64,e.name.end,Qt,e),rn(),function(e){80===e.kind?De(e):we(e)}(e.moduleReference),Yt()}(t);case 273:return function(e){It(e,e.modifiers,!1),tt(102,e.modifiers?e.modifiers.end:e.pos,Zt,e),rn(),e.importClause&&(we(e.importClause),rn(),tt(161,e.importClause.end,Zt,e),rn());De(e.moduleSpecifier),e.attributes&&Mt(e.attributes);Yt()}(t);case 274:return function(e){void 0!==e.phaseModifier&&(tt(e.phaseModifier,e.pos,Zt,e),rn());we(e.name),e.name&&e.namedBindings&&(tt(28,e.name.end,Qt,e),rn());we(e.namedBindings)}(t);case 275:return function(e){const t=tt(42,e.pos,Qt,e);rn(),tt(130,t,Zt,e),rn(),we(e.name)}(t);case 281:return function(e){const t=tt(42,e.pos,Qt,e);rn(),tt(130,t,Zt,e),rn(),we(e.name)}(t);case 276:case 280:return function(e){ht(e)}(t);case 277:case 282:return function(e){yt(e)}(t);case 278:return function(e){const t=tt(95,e.pos,Zt,e);rn(),e.isExportEquals?tt(64,t,en,e):tt(90,t,Zt,e);rn(),De(e.expression,e.isExportEquals?oe.getParenthesizeRightSideOfBinaryForOperator(64):oe.parenthesizeExpressionOfExportDefault),Yt()}(t);case 279:return function(e){It(e,e.modifiers,!1);let t=tt(95,e.pos,Zt,e);rn(),e.isTypeOnly&&(t=tt(156,t,Zt,e),rn());e.exportClause?we(e.exportClause):t=tt(42,t,Qt,e);if(e.moduleSpecifier){rn();tt(161,e.exportClause?e.exportClause.end:t,Zt,e),rn(),De(e.moduleSpecifier)}e.attributes&&Mt(e.attributes);Yt()}(t);case 301:return function(e){tt(e.token,e.pos,Zt,e),rn();const t=e.elements;Wt(e,t,526226)}(t);case 302:return function(e){we(e.name),Qt(":"),rn();const t=e.value;if(!(1024&rp(t))){_r(jw(t).pos)}we(t)}(t);case 283:case 320:case 331:case 332:case 334:case 335:case 336:case 337:case 354:case 355:return;case 284:return function(e){Zt("require"),Qt("("),De(e.expression),Qt(")")}(t);case 12:return function(e){v.writeLiteral(e.text)}(t);case 287:case 290:return function(e){if(Qt("<"),KE(e)){const t=kn(e.tagName,e);vt(e.tagName),Jt(e,e.typeArguments),e.attributes.properties&&e.attributes.properties.length>0&&rn(),we(e.attributes),Sn(e.attributes,e),hn(t)}Qt(">")}(t);case 288:case 291:return function(e){Qt("")}(t);case 292:return function(e){we(e.name),function(e,t,n,r){n&&(t(e),r(n))}("=",Qt,e.initializer,Fe)}(t);case 293:return function(e){Wt(e,e.properties,262656)}(t);case 294:return function(e){Qt("{..."),De(e.expression),Qt("}")}(t);case 295:return function(e){var t;if(e.expression||!ne&&!iy(e)&&(r=e.pos,function(e){let t=!1;return _s((null==n?void 0:n.text)||"",e+1,()=>t=!0),t}(r)||function(e){let t=!1;return ls((null==n?void 0:n.text)||"",e+1,()=>t=!0),t}(r))){const r=n&&!iy(e)&&Wa(n,e.pos).line!==Wa(n,e.end).line;r&&v.increaseIndent();const i=tt(19,e.pos,Qt,e);we(e.dotDotDotToken),De(e.expression),tt(20,(null==(t=e.expression)?void 0:t.end)||i,Qt,e),r&&v.decreaseIndent()}var r}(t);case 296:return function(e){Ne(e.namespace),Qt(":"),Ne(e.name)}(t);case 297:return function(e){tt(84,e.pos,Zt,e),rn(),De(e.expression,oe.parenthesizeExpressionForDisallowedComma),bt(e,e.statements,e.expression.end)}(t);case 298:return function(e){const t=tt(90,e.pos,Zt,e);bt(e,e.statements,t)}(t);case 299:return function(e){rn(),dn(e.token,Zt),rn(),Wt(e,e.types,528)}(t);case 300:return function(e){const t=tt(85,e.pos,Zt,e);rn(),e.variableDeclaration&&(tt(21,t,Qt,e),we(e.variableDeclaration),tt(22,e.variableDeclaration.end,Qt,e),rn());we(e.block)}(t);case 304:return function(e){we(e.name),Qt(":"),rn();const t=e.initializer;if(!(1024&rp(t))){_r(jw(t).pos)}De(t,oe.parenthesizeExpressionForDisallowedComma)}(t);case 305:return function(e){we(e.name),e.objectAssignmentInitializer&&(rn(),Qt("="),rn(),De(e.objectAssignmentInitializer,oe.parenthesizeExpressionForDisallowedComma))}(t);case 306:return function(e){e.expression&&(tt(26,e.pos,Qt,e),De(e.expression,oe.parenthesizeExpressionForDisallowedComma))}(t);case 307:return function(e){we(e.name),jt(e.initializer,e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(t);case 308:return wt(t);case 309:return pn.fail("Bundles should be printed using printBundle");case 310:return Ct(t);case 311:return function(e){rn(),Qt("{"),we(e.name),Qt("}")}(t);case 313:return Qt("*");case 314:return Qt("?");case 315:return function(e){Qt("?"),we(e.type)}(t);case 316:return function(e){Qt("!"),we(e.type)}(t);case 317:return function(e){we(e.type),Qt("=")}(t);case 318:return function(e){Zt("function"),qt(e,e.parameters),Qt(":"),we(e.type)}(t);case 192:case 319:return function(e){Qt("..."),we(e.type)}(t);case 321:return function(e){if(K("/**"),e.comment){const t=pl(e.comment);if(t){const e=t.split(/\r\n?|\n/);for(const t of e)sn(),rn(),Qt("*"),rn(),K(t)}}e.tags&&(1!==e.tags.length||345!==e.tags[0].kind||e.comment?Wt(e,e.tags,33):(rn(),we(e.tags[0])));rn(),K("*/")}(t);case 323:return xt(t);case 324:return kt(t);case 328:case 333:case 338:return St((i=t).tagName),void Tt(i.comment);case 329:case 330:return function(e){St(e.tagName),rn(),Qt("{"),we(e.class),Qt("}"),Tt(e.comment)}(t);case 339:return function(e){St(e.tagName),e.name&&(rn(),we(e.name));Tt(e.comment),kt(e.typeExpression)}(t);case 340:return function(e){Tt(e.comment),kt(e.typeExpression)}(t);case 342:case 349:return function(e){St(e.tagName),Ct(e.typeExpression),rn(),e.isBracketed&&Qt("[");we(e.name),e.isBracketed&&Qt("]");Tt(e.comment)}(t);case 341:case 343:case 344:case 345:case 350:case 351:return function(e){St(e.tagName),Ct(e.typeExpression),Tt(e.comment)}(t);case 346:return function(e){St(e.tagName),Ct(e.constraint),rn(),Wt(e,e.typeParameters,528),Tt(e.comment)}(t);case 347:return function(e){St(e.tagName),e.typeExpression&&(310===e.typeExpression.kind?Ct(e.typeExpression):(rn(),Qt("{"),K("Object"),e.typeExpression.isArrayType&&(Qt("["),Qt("]")),Qt("}")));e.fullName&&(rn(),we(e.fullName));Tt(e.comment),e.typeExpression&&323===e.typeExpression.kind&&xt(e.typeExpression)}(t);case 348:return function(e){St(e.tagName),we(e.name),Tt(e.comment)}(t);case 352:return function(e){St(e.tagName),rn(),e.importClause&&(we(e.importClause),rn(),tt(161,e.importClause.end,Zt,e),rn());De(e.moduleSpecifier),e.attributes&&Mt(e.attributes);Tt(e.comment)}(t)}if(K_(t)&&(e=1,O!==Zq)){const n=O(e,t)||t;n!==t&&(t=n,E&&(t=E(t)))}}var i,o;if(1===e)switch(t.kind){case 9:case 10:return function(e){Ue(e,!1)}(t);case 11:case 14:case 15:return Ue(t,!1);case 80:return Ve(t);case 81:return We(t);case 210:return function(e){const t=e.elements,n=e.multiLine?65536:0;$t(e,t,8914|n,oe.parenthesizeExpressionForDisallowedComma)}(t);case 211:return function(e){En(e),p(e.properties,Ln);const t=131072&rp(e);t&&cn();const r=e.multiLine?65536:0,i=n&&n.languageVersion>=1&&!of(n)?64:0;Wt(e,e.properties,526226|i|r),t&&ln();Pn(e)}(t);case 212:return function(e){De(e.expression,oe.parenthesizeLeftSideOfAccess);const t=e.questionDotToken||ET(bw.createToken(25),e.expression.end,e.name.pos),n=Cn(e,e.expression,t),r=Cn(e,t,e.name);gn(n,!1);const i=29!==t.kind&&function(e){if($N(e=Nl(e))){const t=Fn(e,void 0,!0,!1);return!(448&e.numericLiteralFlags||t.includes(Ia(25))||t.includes(String.fromCharCode(69))||t.includes(String.fromCharCode(101)))}if(Dx(e)){const t=Ww(e);return"number"==typeof t&&isFinite(t)&&t>=0&&Math.floor(t)===t}}(e.expression)&&!v.hasTrailingComment()&&!v.hasTrailingWhitespace();i&&Qt(".");e.questionDotToken?we(t):tt(t.kind,e.expression.end,Qt,e);gn(r,!1),we(e.name),hn(n,r)}(t);case 213:return function(e){De(e.expression,oe.parenthesizeLeftSideOfAccess),we(e.questionDotToken),tt(23,e.expression.end,Qt,e),De(e.argumentExpression),tt(24,e.argumentExpression.end,Qt,e)}(t);case 214:return function(e){const t=16&ip(e);t&&(Qt("("),Gt("0"),Qt(","),rn());De(e.expression,oe.parenthesizeLeftSideOfAccess),t&&Qt(")");we(e.questionDotToken),Jt(e,e.typeArguments),$t(e,e.arguments,2576,oe.parenthesizeExpressionForDisallowedComma)}(t);case 215:return function(e){tt(105,e.pos,Zt,e),rn(),De(e.expression,oe.parenthesizeExpressionOfNew),Jt(e,e.typeArguments),$t(e,e.arguments,18960,oe.parenthesizeExpressionForDisallowedComma)}(t);case 216:return function(e){const t=16&ip(e);t&&(Qt("("),Gt("0"),Qt(","),rn());De(e.tag,oe.parenthesizeLeftSideOfAccess),t&&Qt(")");Jt(e,e.typeArguments),rn(),De(e.template)}(t);case 217:return function(e){Qt("<"),we(e.type),Qt(">"),De(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(t);case 218:return function(e){const t=tt(21,e.pos,Qt,e),n=kn(e.expression,e);De(e.expression,void 0),Sn(e.expression,e),hn(n),tt(22,e.expression?e.expression.end:t,Qt,e)}(t);case 219:return function(e){jn(e.name),ct(e)}(t);case 220:return function(e){Ot(e,e.modifiers),lt(e,Ke,Ge)}(t);case 221:return function(e){tt(91,e.pos,Zt,e),rn(),De(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(t);case 222:return function(e){tt(114,e.pos,Zt,e),rn(),De(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(t);case 223:return function(e){tt(116,e.pos,Zt,e),rn(),De(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(t);case 224:return function(e){tt(135,e.pos,Zt,e),rn(),De(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(t);case 225:return function(e){dn(e.operator,en),function(e){const t=e.operand;return 225===t.kind&&(40===e.operator&&(40===t.operator||46===t.operator)||41===e.operator&&(41===t.operator||47===t.operator))}(e)&&rn();De(e.operand,oe.parenthesizeOperandOfPrefixUnary)}(t);case 226:return function(e){De(e.operand,oe.parenthesizeOperandOfPostfixUnary),dn(e.operator,en)}(t);case 227:return se(t);case 228:return function(e){const t=Cn(e,e.condition,e.questionToken),n=Cn(e,e.questionToken,e.whenTrue),r=Cn(e,e.whenTrue,e.colonToken),i=Cn(e,e.colonToken,e.whenFalse);De(e.condition,oe.parenthesizeConditionOfConditionalExpression),gn(t,!0),we(e.questionToken),gn(n,!0),De(e.whenTrue,oe.parenthesizeBranchOfConditionalExpression),hn(t,n),gn(r,!0),we(e.colonToken),gn(i,!0),De(e.whenFalse,oe.parenthesizeBranchOfConditionalExpression),hn(r,i)}(t);case 229:return function(e){we(e.head),Wt(e,e.templateSpans,262144)}(t);case 230:return function(e){tt(127,e.pos,Zt,e),we(e.asteriskToken),Rt(e.expression&&at(e.expression),st)}(t);case 231:return function(e){tt(26,e.pos,Qt,e),De(e.expression,oe.parenthesizeExpressionForDisallowedComma)}(t);case 232:return function(e){jn(e.name),gt(e)}(t);case 233:case 283:case 354:return;case 235:return function(e){De(e.expression,void 0),e.type&&(rn(),Zt("as"),rn(),we(e.type))}(t);case 236:return function(e){De(e.expression,oe.parenthesizeLeftSideOfAccess),en("!")}(t);case 234:return Xe(t);case 239:return function(e){De(e.expression,void 0),e.type&&(rn(),Zt("satisfies"),rn(),we(e.type))}(t);case 237:return function(e){_n(e.keywordToken,e.pos,Qt),Qt("."),we(e.name)}(t);case 238:return pn.fail("SyntheticExpression should never be printed.");case 285:return function(e){we(e.openingElement),Wt(e,e.children,262144),we(e.closingElement)}(t);case 286:return function(e){Qt("<"),vt(e.tagName),Jt(e,e.typeArguments),rn(),we(e.attributes),Qt("/>")}(t);case 289:return function(e){we(e.openingFragment),Wt(e,e.children,262144),we(e.closingFragment)}(t);case 353:return pn.fail("SyntaxList should not be printed");case 356:return function(e){const t=rp(e);1024&t||e.pos===e.expression.pos||_r(e.expression.pos);De(e.expression),2048&t||e.end===e.expression.end||cr(e.expression.end)}(t);case 357:return function(e){$t(e,e.elements,528,void 0)}(t);case 358:return pn.fail("SyntheticReferenceExpression should not be printed")}return Fh(t.kind)?un(t,Zt):Il(t.kind)?un(t,Qt):void pn.fail(`Unhandled SyntaxKind: ${pn.formatSyntaxKind(t.kind)}.`)}function Je(e,t){const n=je(1,e,t);pn.assertIsDefined(F),t=F,F=void 0,n(e,t)}function ze(t){let r=!1;const i=309===t.kind?t:void 0;if(i&&0===V)return;const o=i?i.sourceFiles.length:1;for(let a=0;a")}function He(e){rn(),we(e.type)}function Ke(e){zt(e,e.typeParameters),Ut(e,e.parameters),Lt(e.type),rn(),we(e.equalsGreaterThanToken)}function Ge(e){GF(e.body)?pt(e.body):(rn(),De(e.body,oe.parenthesizeConciseBodyOfArrowFunction))}function Xe(e){De(e.expression,oe.parenthesizeLeftSideOfAccess),Jt(e,e.typeArguments)}function Qe(e,t){tt(19,e.pos,Qt,e);const n=t||1&rp(e)?768:129;Wt(e,e.statements,n),tt(20,e.statements.end,Qt,e,!!(1&n))}function Ye(e){e?Qt(";"):Yt()}function Ze(e,t){const n=tt(117,t,Zt,e);rn(),tt(21,n,Qt,e),De(e.expression),tt(22,e.expression.end,Qt,e)}function et(e){void 0!==e&&(262===e.kind?we(e):De(e))}function tt(e,t,r,i,o){const a=hc(i),s=a&&a.kind===i.kind,c=t;if(s&&n&&(t=ts(n.text,t)),s&&i.pos!==c){const e=o&&n&&!Qb(c,t,n);e&&cn(),cr(c),e&&ln()}if(t=q||19!==e&&20!==e?dn(e,r,t):_n(e,t,r,i),s&&i.end!==t){const e=295===i.kind;_r(t,!e,e)}return t}function nt(e){return 2===e.kind||!!e.hasTrailingNewLine}function ot(e){if(!n)return!1;const t=fs(n.text,e.pos);if(t){const t=hc(e);if(t&&SF(t.parent))return!0}return!!H(t,nt)||(!!H(Rw(e),nt)||!!WF(e)&&(!(e.pos===e.expression.pos||!H(ms(n.text,e.expression.pos),nt))||ot(e.expression)))}function at(e){if(!ne)switch(e.kind){case 356:if(ot(e)){const t=hc(e);if(t&&SF(t)){const n=bw.createParenthesizedExpression(e.expression);return kw(n,e),FI(n,t),n}return bw.createParenthesizedExpression(e)}return bw.updatePartiallyEmittedExpression(e,at(e.expression));case 212:return bw.updatePropertyAccessExpression(e,at(e.expression),e.name);case 213:return bw.updateElementAccessExpression(e,at(e.expression),e.argumentExpression);case 214:return bw.updateCallExpression(e,at(e.expression),e.typeArguments,e.arguments);case 216:return bw.updateTaggedTemplateExpression(e,at(e.tag),e.typeArguments,e.template);case 226:return bw.updatePostfixUnaryExpression(e,at(e.operand));case 227:return bw.updateBinaryExpression(e,at(e.left),e.operatorToken,e.right);case 228:return bw.updateConditionalExpression(e,at(e.condition),e.questionToken,e.whenTrue,e.colonToken,e.whenFalse);case 235:return bw.updateAsExpression(e,at(e.expression),e.type);case 239:return bw.updateSatisfiesExpression(e,at(e.expression),e.type);case 236:return bw.updateNonNullExpression(e,at(e.expression))}return e}function st(e){return at(oe.parenthesizeExpressionForDisallowedComma(e))}function ct(e){It(e,e.modifiers,!1),Zt("function"),we(e.asteriskToken),rn(),Ne(e.name),lt(e,dt,_t)}function lt(e,t,n){const r=131072&rp(e);r&&cn(),En(e),p(e.parameters,On),t(e),n(e),Pn(e),r&&ln()}function _t(e){const t=e.body;t?pt(t):Yt()}function ut(e){Yt()}function dt(e){zt(e,e.typeParameters),qt(e,e.parameters),Lt(e.type)}function pt(e){On(e),null==L||L(e),rn(),Qt("{"),cn();const t=function(e){if(1&rp(e))return!0;if(e.multiLine)return!1;if(!iy(e)&&n&&!Ub(e,n))return!1;if(yn(e,ge(e.statements),2)||bn(e,be(e.statements),2,e.statements))return!1;let t;for(const n of e.statements){if(vn(t,n,2)>0)return!1;t=n}return!0}(e)?ft:mt;nr(e,e.statements,t),ln(),_n(20,e.statements.end,Qt,e),null==j||j(e)}function ft(e){mt(e,!0)}function mt(e,t){const n=Ft(e.statements),r=v.getTextPos();ze(e),0===n&&r===v.getTextPos()&&t?(ln(),Wt(e,e.statements,768),cn()):Wt(e,e.statements,1,void 0,n)}function gt(e){It(e,e.modifiers,!0),tt(86,zb(e).pos,Zt,e),e.name&&(rn(),Ne(e.name));const t=131072&rp(e);t&&cn(),zt(e,e.typeParameters),Wt(e,e.heritageClauses,0),rn(),Qt("{"),En(e),p(e.members,Ln),Wt(e,e.members,129),Pn(e),Qt("}"),t&&ln()}function ht(e){Qt("{"),Wt(e,e.elements,525136),Qt("}")}function yt(e){e.isTypeOnly&&(Zt("type"),rn()),e.propertyName&&(we(e.propertyName),rn(),tt(130,e.propertyName.end,Zt,e),rn()),we(e.name)}function vt(e){80===e.kind?De(e):we(e)}function bt(e,t,r){let i=163969;1===t.length&&(!n||iy(e)||iy(t[0])||Vb(e,t[0],n))?(_n(59,r,Qt,e),rn(),i&=-130):tt(59,r,Qt,e),Wt(e,t,i)}function xt(e){Wt(e,bw.createNodeArray(e.jsDocPropertyTags),33)}function kt(e){e.typeParameters&&Wt(e,bw.createNodeArray(e.typeParameters),33),e.parameters&&Wt(e,bw.createNodeArray(e.parameters),33),e.type&&(sn(),rn(),Qt("*"),rn(),we(e.type))}function St(e){Qt("@"),we(e)}function Tt(e){const t=pl(e);t&&(rn(),K(t))}function Ct(e){e&&(rn(),Qt("{"),we(e.type),Qt("}"))}function wt(e){sn();const t=e.statements;0===t.length||!hf(t[0])||iy(t[0])?nr(e,t,Dt):Dt(e)}function Nt(e,t,r,i){if(e&&(nn('/// '),sn()),n&&n.moduleName&&(nn(`/// `),sn()),n&&n.amdDependencies)for(const e of n.amdDependencies)e.name?nn(`/// `):nn(`/// `),sn();function o(e,t){for(const n of t){const t=n.resolutionMode?`resolution-mode="${99===n.resolutionMode?"import":"require"}" `:"",r=n.preserve?'preserve="true" ':"";nn(`/// `),sn()}}o("path",t),o("types",r),o("lib",i)}function Dt(e){const t=e.statements;En(e),p(e.statements,On),ze(e);const n=S(t,e=>!hf(e));!function(e){e.isDeclarationFile&&Nt(e.hasNoDefaultLib,e.referencedFiles,e.typeReferenceDirectives,e.libReferenceDirectives)}(e),Wt(e,t,1,void 0,-1===n?t.length:n),Pn(e)}function Ft(e,t,n){let r=!!t;for(let i=0;i=r.length||0===s;if(c&&32768&i)return null==M||M(r),void(null==R||R(r));15360&i&&(Qt(function(e){return rU[15360&e][0]}(i)),c&&r&&_r(r.pos,!0)),null==M||M(r),c?!(1&i)||$&&(!t||n&&Ub(t,n))?256&i&&!(524288&i)&&rn():sn():Kt(e,t,r,i,o,a,s,r.hasTrailingComma,r),null==R||R(r),15360&i&&(c&&r&&cr(r.end),Qt(function(e){return rU[15360&e][1]}(i)))}function Kt(e,t,n,r,i,o,a,s,c){const l=!(262144&r);let _=l;const u=yn(t,n[o],r);u?(sn(u),_=!1):256&r&&rn(),128&r&&cn();const d=function(e,t){return 1===e.length?OU:"object"==typeof t?LU:jU}(e,i);let p,f=!1;for(let s=0;s0){if(131&r||(cn(),f=!0),_&&60&r&&!tT(a.pos)){_r(jw(a).pos,!!(512&r),!0)}sn(e),_=!1}else p&&512&r&&rn()}if(_){_r(jw(a).pos)}else _=l;y=a.pos,d(a,e,i,s),f&&(ln(),f=!1),p=a}const m=p?rp(p):0,g=ne||!!(2048&m),h=s&&64&r&&16&r;h&&(p&&!g?tt(28,p.end,Qt,p):Qt(",")),p&&(t?t.end:-1)!==p.end&&60&r&&!g&&cr(h&&(null==c?void 0:c.end)?c.end:p.end),128&r&&ln();const v=bn(t,n[o+a-1],r,c);v?sn(v):2097408&r&&rn()}function Gt(e){v.writeLiteral(e)}function Xt(e,t){v.writeSymbol(e,t)}function Qt(e){v.writePunctuation(e)}function Yt(){v.writeTrailingSemicolon(";")}function Zt(e){v.writeKeyword(e)}function en(e){v.writeOperator(e)}function tn(e){v.writeParameter(e)}function nn(e){v.writeComment(e)}function rn(){v.writeSpace(" ")}function on(e){v.writeProperty(e)}function an(e){v.nonEscapingWrite?v.nonEscapingWrite(e):v.write(e)}function sn(e=1){for(let t=0;t0)}function cn(){v.increaseIndent()}function ln(){v.decreaseIndent()}function _n(e,t,n,r){return G?dn(e,n,t):function(e,t,n,r,i){if(G||e&&Lm(e))return i(t,n,r);const o=e&&e.emitNode,a=o&&o.flags||0,s=o&&o.tokenSourceMapRanges&&o.tokenSourceMapRanges[t],c=s&&s.source||C;r=br(c,s?s.pos:r),!(256&a)&&r>=0&&Sr(c,r);r=i(t,n,r),s&&(r=s.end);!(512&a)&&r>=0&&Sr(c,r);return r}(r,e,n,t,dn)}function un(e,t){B&&B(e),t(Ia(e.kind)),J&&J(e)}function dn(e,t,n){const r=Ia(e);return t(r),n<0?n:n+r.length}function fn(e,t,n){if(1&rp(e))rn();else if($){const r=Cn(e,t,n);r?sn(r):rn()}else sn()}function mn(e){const t=e.split(/\r\n?|\n/),n=Bu(t);for(const e of t){const t=n?e.slice(n):e;t.length&&(sn(),K(t))}}function gn(e,t){e?(cn(),sn(e)):t&&rn()}function hn(e,t){e&&ln(),t&&ln()}function yn(e,t,r){if(2&r||$){if(65536&r)return 1;if(void 0===t)return!e||n&&Ub(e,n)?0:1;if(t.pos===y)return 0;if(12===t.kind)return 0;if(n&&e&&!tT(e.pos)&&!iy(t)&&(!t.parent||fc(t.parent)===fc(e)))return $?xn(r=>Zb(t.pos,e.pos,n,r)):Vb(e,t,n)?0:1;if(Tn(t,r))return 1}return 1&r?1:0}function vn(e,t,r){if(2&r||$){if(void 0===e||void 0===t)return 0;if(12===t.kind)return 0;if(n&&!iy(e)&&!iy(t))return $&&function(e,t){if(t.pos-1&&r.indexOf(t)===i+1}(e,t)?xn(r=>Kb(e,t,n,r)):!$&&(o=t,(i=fc(i=e)).parent&&i.parent===fc(o).parent)?Hb(e,t,n)?0:1:65536&r?1:0;if(Tn(e,r)||Tn(t,r))return 1}else if(Ow(t))return 1;var i,o;return 1&r?1:0}function bn(e,t,r,i){if(2&r||$){if(65536&r)return 1;if(void 0===t)return!e||n&&Ub(e,n)?0:1;if(n&&e&&!tT(e.pos)&&!iy(t)&&(!t.parent||t.parent===e)){if($){const r=i&&!tT(i.end)?i.end:t.end;return xn(t=>ex(r,e.end,n,t))}return Wb(e,t,n)?0:1}if(Tn(t,r))return 1}return 1&r&&!(131072&r)?1:0}function xn(e){pn.assert(!!$);const t=e(!0);return 0===t?e(!1):t}function kn(e,t){const n=$&&yn(t,e,0);return n&&gn(n,!1),!!n}function Sn(e,t){const n=$&&bn(t,e,0,void 0);n&&sn(n)}function Tn(e,t){if(iy(e)){const n=Ow(e);return void 0===n?!!(65536&t):n}return!!(65536&t)}function Cn(e,t,r){return 262144&rp(e)?0:(e=Nn(e),t=Nn(t),Ow(r=Nn(r))?1:!n||iy(e)||iy(t)||iy(r)?0:$?xn(e=>Kb(t,r,n,e)):Hb(t,r,n)?0:1)}function wn(e){return 0===e.statements.length&&(!n||Hb(e,e,n))}function Nn(e){for(;218===e.kind&&iy(e);)e=e.expression;return e}function Dn(e,t){if(Gl(e)||Xl(e))return Mn(e);if(KN(e)&&e.textSourceNode)return Dn(e.textSourceNode,t);const r=n,i=!!r&&!!e.parent&&!iy(e);if(gl(e)){if(!i||Sd(e)!==fc(r))return bc(e)}else if(rP(e)){if(!i||Sd(e)!==fc(r))return _C(e)}else if(pn.assertNode(e,Ml),!i)return e.text;return Kd(r,e,t)}function Fn(t,r=n,i,o){if(11===t.kind&&t.textSourceNode){const e=t.textSourceNode;if(uD(e)||dD(e)||$N(e)||rP(e)){const n=$N(e)?e.text:Dn(e);return o?`"${Ay(n)}"`:i||16777216&rp(t)?`"${Cy(n)}"`:`"${Ny(n)}"`}return Fn(e,Sd(e),i,o)}return sp(t,r,(i?1:0)|(o?2:0)|(e.terminateUnterminatedLiterals?4:0)|(e.target&&e.target>=8?8:0))}function En(e){l.push(_),_=0,g.push(h),e&&1048576&rp(e)||(u.push(d),d=0,s.push(c),c=void 0,f.push(m))}function Pn(e){_=l.pop(),h=g.pop(),e&&1048576&rp(e)||(d=u.pop(),c=s.pop(),m=f.pop())}function An(e){m&&m!==be(f)||(m=new Set),m.add(e)}function In(e){h&&h!==be(g)||(h=new Set),h.add(e)}function On(e){if(e)switch(e.kind){case 242:case 297:case 298:p(e.statements,On);break;case 257:case 255:case 247:case 248:On(e.statement);break;case 246:On(e.thenStatement),On(e.elseStatement);break;case 249:case 251:case 250:On(e.initializer),On(e.statement);break;case 256:On(e.caseBlock);break;case 270:p(e.clauses,On);break;case 259:On(e.tryBlock),On(e.catchClause),On(e.finallyBlock);break;case 300:On(e.variableDeclaration),On(e.block);break;case 244:On(e.declarationList);break;case 262:p(e.declarations,On);break;case 261:case 170:case 209:case 264:case 275:case 281:jn(e.name);break;case 263:jn(e.name),1048576&rp(e)&&(p(e.parameters,On),On(e.body));break;case 207:case 208:case 276:p(e.elements,On);break;case 273:On(e.importClause);break;case 274:jn(e.name),On(e.namedBindings);break;case 277:jn(e.propertyName||e.name)}}function Ln(e){if(e)switch(e.kind){case 304:case 305:case 173:case 172:case 175:case 174:case 178:case 179:jn(e.name)}}function jn(e){e&&(Gl(e)||Xl(e)?Mn(e):w_(e)&&On(e))}function Mn(e){const t=e.emitNode.autoGenerate;if(4==(7&t.flags))return Rn(yI(e),dD(e),t.flags,t.prefix,t.suffix);{const n=t.id;return o[n]||(o[n]=function(e){const t=e.emitNode.autoGenerate,n=vI(t.prefix,Mn),r=vI(t.suffix);switch(7&t.flags){case 1:return qn(0,!!(8&t.flags),dD(e),n,r);case 2:return pn.assertNode(e,uD),qn(268435456,!!(8&t.flags),!1,n,r);case 3:return Un(bc(e),32&t.flags?Jn:Bn,!!(16&t.flags),!!(8&t.flags),dD(e),n,r)}return pn.fail(`Unsupported GeneratedIdentifierKind: ${pn.formatEnum(7&t.flags,kr,!0)}.`)}(e))}}function Rn(e,t,n,o,a){const s=_J(e),c=t?i:r;return c[s]||(c[s]=Kn(e,t,n??0,vI(o,Mn),vI(a)))}function Bn(e,t){return Jn(e,t)&&!function(e,t){let n,r;t?(n=h,r=g):(n=m,r=f);if(null==n?void 0:n.has(e))return!0;for(let t=r.length-1;t>=0;t--)if(n!==r[t]&&(n=r[t],null==n?void 0:n.has(e)))return!0;return!1}(e,t)&&!a.has(e)}function Jn(e,t){return!n||Ed(n,e,P)}function zn(e,t){switch(e){case"":d=t;break;case"#":_=t;break;default:c??(c=new Map),c.set(e,t)}}function qn(e,t,n,r,i){r.length>0&&35===r.charCodeAt(0)&&(r=r.slice(1));const o=xI(n,r,"",i);let a=function(e){switch(e){case"":return d;case"#":return _;default:return(null==c?void 0:c.get(e))??0}}(o);if(e&&!(a&e)){const s=xI(n,r,268435456===e?"_i":"_n",i);if(Bn(s,n))return a|=e,n?In(s):t&&An(s),zn(o,a),s}for(;;){const e=268435455&a;if(a++,8!==e&&13!==e){const s=xI(n,r,e<26?"_"+String.fromCharCode(97+e):"_"+(e-26),i);if(Bn(s,n))return n?In(s):t&&An(s),zn(o,a),s}}}function Un(e,t=Bn,n,r,i,o,s){if(e.length>0&&35===e.charCodeAt(0)&&(e=e.slice(1)),o.length>0&&35===o.charCodeAt(0)&&(o=o.slice(1)),n){const n=xI(i,o,e,s);if(t(n,i))return i?In(n):r?An(n):a.add(n),n}95!==e.charCodeAt(e.length-1)&&(e+="_");let c=1;for(;;){const n=xI(i,o,e+c,s);if(t(n,i))return i?In(n):r?An(n):a.add(n),n;c++}}function Vn(e){return Un(e,Jn,!0,!1,!1,"","")}function Wn(e){const t=Dn(e.name);return function(e,t){for(let n=t;n&&dh(n,t);n=n.nextContainer)if(uu(n)&&n.locals){const t=n.locals.get(yc(e));if(t&&3257279&t.flags)return!1}return!0}(t,rt(e,uu))?t:Un(t,Bn,!1,!1,!1,"","")}function $n(){return Un("default",Bn,!1,!1,!1,"","")}function Kn(e,t,n,r,i){switch(e.kind){case 80:case 81:return Un(Dn(e),Bn,!!(16&n),!!(8&n),t,r,i);case 268:case 267:return pn.assert(!r&&!i&&!t),Wn(e);case 273:case 279:return pn.assert(!r&&!i&&!t),function(e){const t=wg(e);return Un(KN(t)?lp(t.text):"module",Bn,!1,!1,!1,"","")}(e);case 263:case 264:{pn.assert(!r&&!i&&!t);const o=e.name;return o&&!Gl(o)?Kn(o,!1,n,r,i):$n()}case 278:return pn.assert(!r&&!i&&!t),$n();case 232:return pn.assert(!r&&!i&&!t),Un("class",Bn,!1,!1,!1,"","");case 175:case 178:case 179:return function(e,t,n,r){return uD(e.name)?Rn(e.name,t):qn(0,!1,t,n,r)}(e,t,r,i);case 168:return qn(0,!0,t,r,i);default:return qn(0,!1,t,r,i)}}function Gn(e,t){const n=je(2,e,t),r=Y,i=Z,o=ee;Xn(t),n(e,t),Qn(t,r,i,o)}function Xn(e){const t=rp(e),n=jw(e);!function(e,t,n,r){re(),te=!1;const i=n<0||!!(1024&t)||12===e.kind,o=r<0||!!(2048&t)||12===e.kind;(n>0||r>0)&&n!==r&&(i||rr(n,354!==e.kind),(!i||n>=0&&1024&t)&&(Y=n),(!o||r>=0&&2048&t)&&(Z=r,262===e.kind&&(ee=r)));p(Rw(e),Zn),ie()}(e,t,n.pos,n.end),4096&t&&(ne=!0)}function Qn(e,t,n,r){const i=rp(e),o=jw(e);4096&i&&(ne=!1),Yn(e,i,o.pos,o.end,t,n,r);const a=nN(e);a&&Yn(e,i,a.pos,a.end,t,n,r)}function Yn(e,t,n,r,i,o,a){re();const s=r<0||!!(2048&t)||12===e.kind;p(zw(e),er),(n>0||r>0)&&n!==r&&(Y=i,Z=o,ee=a,s||354===e.kind||function(e){fr(e,lr)}(r)),ie()}function Zn(e){(e.hasLeadingNewline||2===e.kind)&&v.writeLine(),tr(e),e.hasTrailingNewLine||2===e.kind?v.writeLine():v.writeSpace(" ")}function er(e){v.isAtStartOfLine()||v.writeSpace(" "),tr(e),e.hasTrailingNewLine&&v.writeLine()}function tr(e){const t=function(e){return 3===e.kind?`/*${e.text}*/`:`//${e.text}`}(e);wv(t,3===e.kind?Ra(t):void 0,v,0,t.length,U)}function nr(e,t,r){re();const{pos:i,end:o}=t,a=rp(e),s=ne||o<0||!!(2048&a);i<0||!!(1024&a)||function(e){const t=n&&Cv(n.text,Ce(),v,mr,e,U,ne);t&&(D?D.push(t):D=[t])}(t),ie(),4096&a&&!ne?(ne=!0,r(e),ne=!1):r(e),re(),s||(rr(t.end,!0),te&&!v.isAtStartOfLine()&&v.writeLine()),ie()}function rr(e,t){te=!1,t?0===e&&(null==n?void 0:n.isDeclarationFile)?pr(e,or):pr(e,sr):0===e&&pr(e,ir)}function ir(e,t,n,r,i){gr(e,t)&&sr(e,t,n,r,i)}function or(e,t,n,r,i){gr(e,t)||sr(e,t,n,r,i)}function ar(t,n){return!e.onlyPrintJsDocStyle||(jI(t,n)||Ud(t,n))}function sr(e,t,r,i,o){n&&ar(n.text,e)&&(te||(Tv(Ce(),v,o,e),te=!0),xr(e),wv(n.text,Ce(),v,e,t,U),xr(t),i?v.writeLine():3===r&&v.writeSpace(" "))}function cr(e){ne||-1===e||rr(e,!0)}function lr(e,t,r,i){n&&ar(n.text,e)&&(v.isAtStartOfLine()||v.writeSpace(" "),xr(e),wv(n.text,Ce(),v,e,t,U),xr(t),i&&v.writeLine())}function _r(e,t,n){ne||(re(),fr(e,t?lr:n?ur:dr),ie())}function ur(e,t,r){n&&(xr(e),wv(n.text,Ce(),v,e,t,U),xr(t),2===r&&v.writeLine())}function dr(e,t,r,i){n&&(xr(e),wv(n.text,Ce(),v,e,t,U),xr(t),i?v.writeLine():v.writeSpace(" "))}function pr(e,t){!n||-1!==Y&&e===Y||(function(e){return void 0!==D&&xe(D).nodePos===e}(e)?function(e){if(!n)return;const t=xe(D).detachedCommentEndPos;D.length-1?D.pop():D=void 0;ls(n.text,t,e,t)}(t):ls(n.text,e,t,e))}function fr(e,t){n&&(-1===Z||e!==Z&&e!==ee)&&_s(n.text,e,t)}function mr(e,t,r,i,o,a){n&&ar(n.text,i)&&(xr(i),wv(e,t,r,i,o,a),xr(o))}function gr(e,t){return!!n&&qd(n.text,e,t)}function hr(e,t){const n=je(3,e,t);yr(t),n(e,t),vr(t)}function yr(e){const t=rp(e),n=Ew(e),r=n.source||C;354!==e.kind&&!(32&t)&&n.pos>=0&&Sr(n.source||C,br(r,n.pos)),128&t&&(G=!0)}function vr(e){const t=rp(e),n=Ew(e);128&t&&(G=!1),354!==e.kind&&!(64&t)&&n.end>=0&&Sr(n.source||C,n.end)}function br(e,t){return e.skipTrivia?e.skipTrivia(t):ts(e.text,t)}function xr(e){if(G||tT(e)||Cr(C))return;const{line:t,character:n}=Wa(C,e);T.addMapping(v.getLine(),v.getColumn(),X,t,n,void 0)}function Sr(e,t){if(e!==C){const n=C,r=X;Tr(e),xr(t),function(e,t){C=e,X=t}(n,r)}else xr(t)}function Tr(t){G||(C=t,t!==w?Cr(t)||(X=T.addSource(t.fileName),e.inlineSources&&T.setSourceContent(X,t.text),w=t,Q=X):X=Q)}function Cr(e){return wo(e.fileName,".json")}}function OU(e,t,n,r){t(e)}function LU(e,t,n,r){t(e,n.select(r))}function jU(e,t,n,r){t(e,n)}function MU(e,t,n){if(!e.getDirectories||!e.readDirectory)return;const r=new Map,i=Ht(n);return{useCaseSensitiveFileNames:n,fileExists:function(t){const n=s(o(t));return n&&u(n.sortedAndCanonicalizedFiles,i(c(t)))||e.fileExists(t)},readFile:(t,n)=>e.readFile(t,n),directoryExists:e.directoryExists&&function(t){const n=o(t);return r.has(Go(n))||e.directoryExists(t)},getDirectories:function(t){const n=o(t),r=l(t,n);if(r)return r.directories.slice();return e.getDirectories(t)},readDirectory:function(r,i,a,s,u){const p=o(r),f=l(r,p);let m;if(void 0!==f)return kS(r,i,a,s,n,t,u,function(e){const t=o(e);if(t===p)return f||g(e,t);const n=l(e,t);return void 0!==n?n||g(e,t):cT},d);return e.readDirectory(r,i,a,s,u);function g(t,n){if(m&&n===p)return m;const r={files:P(e.readDirectory(t,void 0,void 0,["*.*"]),c)||_,directories:e.getDirectories(t)||_};return n===p&&(m=r),r}},createDirectory:e.createDirectory&&function(t){const n=s(o(t));if(n){const e=c(t),r=i(e);te(n.sortedAndCanonicalizedDirectories,r,Nt)&&n.directories.push(e)}e.createDirectory(t)},writeFile:e.writeFile&&function(t,n,r){const i=s(o(t));i&&f(i,c(t),!0);return e.writeFile(t,n,r)},addOrDeleteFileOrDirectory:function(t,n){if(void 0!==a(n))return void m();const r=s(n);if(!r)return void p(n);if(!e.directoryExists)return void m();const o=c(t),l={fileExists:e.fileExists(t),directoryExists:e.directoryExists(t)};l.directoryExists||u(r.sortedAndCanonicalizedDirectories,i(o))?m():f(r,o,l.fileExists);return l},addOrDeleteFile:function(e,t,n){if(1===n)return;const r=s(t);r?f(r,c(e),0===n):p(t)},clearCache:m,realpath:e.realpath&&d};function o(e){return Ho(e,t,i)}function a(e){return r.get(Go(e))}function s(e){const t=a(Ao(e));return t?(t.sortedAndCanonicalizedFiles||(t.sortedAndCanonicalizedFiles=t.files.map(i).sort(),t.sortedAndCanonicalizedDirectories=t.directories.map(i).sort()),t):t}function c(e){return Io(Vo(e))}function l(t,n){const i=a(n=Go(n));if(i)return i;try{return function(t,n){var i;if(!e.realpath||Go(o(e.realpath(t)))===n){const i={files:P(e.readDirectory(t,void 0,void 0,["*.*"]),c)||[],directories:e.getDirectories(t)||[]};return r.set(Go(n),i),i}if(null==(i=e.directoryExists)?void 0:i.call(e,t))return r.set(n,!1),!1}(t,n)}catch{return void pn.assert(!r.has(Go(n)))}}function u(e,t){return we(e,t,lt,Nt)>=0}function d(t){return e.realpath?e.realpath(t):t}function p(e){ua(Ao(e),e=>!!r.delete(Go(e))||void 0)}function f(e,t,n){const r=e.sortedAndCanonicalizedFiles,o=i(t);if(n)te(r,o,Nt)&&e.files.push(t);else{const t=we(r,o,lt,Nt);if(t>=0){r.splice(t,1);const n=e.files.findIndex(e=>i(e)===o);e.files.splice(n,1)}}}function m(){r.clear()}}var RU=(e=>(e[e.Update=0]="Update",e[e.RootNamesAndUpdate=1]="RootNamesAndUpdate",e[e.Full=2]="Full",e))(RU||{});function BU(e,t,n,r,i){var o;const a=Be((null==(o=null==t?void 0:t.configFile)?void 0:o.extendedSourceFiles)||_,i);n.forEach((t,n)=>{a.has(n)||(t.projects.delete(e),t.close())}),a.forEach((t,i)=>{const o=n.get(i);o?o.projects.add(e):n.set(i,{projects:new Set([e]),watcher:r(t,i),close:()=>{const e=n.get(i);e&&0===e.projects.size&&(e.watcher.close(),n.delete(i))}})})}function JU(e,t){t.forEach(t=>{t.projects.delete(e)&&t.close()})}function zU(e,t,n){e.delete(t)&&e.forEach(({extendedResult:r},i)=>{var o;(null==(o=r.extendedSourceFiles)?void 0:o.some(e=>n(e)===t))&&zU(e,i,n)})}function qU(e,t,n){yx(t,e.getMissingFilePaths(),{createNewValue:n,onDeleteValue:sx})}function UU(e,t,n){function r(e,t){return{watcher:n(e,t),flags:t}}t?yx(e,new Map(Object.entries(t)),{createNewValue:r,onDeleteValue:GU,onExistingValue:function(t,n,i){if(t.flags===n)return;t.watcher.close(),e.set(i,r(i,n))}}):gx(e,GU)}function VU({watchedDirPath:e,fileOrDirectory:t,fileOrDirectoryPath:n,configFileName:r,options:i,program:o,extraFileExtensions:a,currentDirectory:s,useCaseSensitiveFileNames:c,writeLog:l,toPath:_,getScriptKind:u}){const d=e$(n);if(!d)return l(`Project: ${r} Detected ignored path: ${t}`),!0;if((n=d)===e)return!1;if(Co(n)&&!VS(t,i,a)&&!function(){if(!u)return!1;switch(u(t)){case 3:case 4:case 7:case 5:return!0;case 1:case 2:return Mk(i);case 6:return Ak(i);case 0:return!1}}())return l(`Project: ${r} Detected file add/remove of non supported extension: ${t}`),!0;if(Wj(t,i.configFile.configFileSpecs,Uo(Ao(r),s),c,s))return l(`Project: ${r} Detected excluded file: ${t}`),!0;if(!o)return!1;if(i.outFile||i.outDir)return!1;if(vO(n)){if(i.declarationDir)return!1}else if(!No(n,PS))return!1;const p=KS(n),f=Ze(o)?void 0:F$(o)?o.getProgramOrUndefined():o,m=f||Ze(o)?void 0:o;return!(!g(p+".ts")&&!g(p+".tsx"))&&(l(`Project: ${r} Detected output file: ${t}`),!0);function g(e){return f?!!f.getSourceFileByPath(e):m?m.state.fileInfos.has(e):!!x(o,t=>_(t)===e)}}function WU(e,t){return!!e&&e.isEmittedFile(t)}var $U=(e=>(e[e.None=0]="None",e[e.TriggerOnly=1]="TriggerOnly",e[e.Verbose=2]="Verbose",e))($U||{});function HU(e,t,n,r){io(2===t?n:ot);const i={watchFile:(t,n,r,i)=>e.watchFile(t,n,r,i),watchDirectory:(t,n,r,i)=>e.watchDirectory(t,n,!!(1&r),i)},o=0!==t?{watchFile:l("watchFile"),watchDirectory:l("watchDirectory")}:void 0,a=2===t?{watchFile:function(e,t,i,a,s,c){n(`FileWatcher:: Added:: ${_(e,i,a,s,c,r)}`);const l=o.watchFile(e,t,i,a,s,c);return{close:()=>{n(`FileWatcher:: Close:: ${_(e,i,a,s,c,r)}`),l.close()}}},watchDirectory:function(e,t,i,a,s,c){const l=`DirectoryWatcher:: Added:: ${_(e,i,a,s,c,r)}`;n(l);const u=Wn(),d=o.watchDirectory(e,t,i,a,s,c),p=Wn()-u;return n(`Elapsed:: ${p}ms ${l}`),{close:()=>{const t=`DirectoryWatcher:: Close:: ${_(e,i,a,s,c,r)}`;n(t);const o=Wn();d.close();const l=Wn()-o;n(`Elapsed:: ${l}ms ${t}`)}}}}:o||i,s=2===t?function(e,t,i,o,a){return n(`ExcludeWatcher:: Added:: ${_(e,t,i,o,a,r)}`),{close:()=>n(`ExcludeWatcher:: Close:: ${_(e,t,i,o,a,r)}`)}}:B$;return{watchFile:c("watchFile"),watchDirectory:c("watchDirectory")};function c(t){return(n,r,i,o,c,l)=>{var _;return Hj(n,"watchFile"===t?null==o?void 0:o.excludeFiles:null==o?void 0:o.excludeDirectories,"boolean"==typeof e.useCaseSensitiveFileNames?e.useCaseSensitiveFileNames:e.useCaseSensitiveFileNames(),(null==(_=e.getCurrentDirectory)?void 0:_.call(e))||"")?s(n,i,o,c,l):a[t].call(void 0,n,r,i,o,c,l)}}function l(e){return(t,o,a,s,c,l)=>i[e].call(void 0,t,(...i)=>{const u=`${"watchFile"===e?"FileWatcher":"DirectoryWatcher"}:: Triggered with ${i[0]} ${void 0!==i[1]?i[1]:""}:: ${_(t,a,s,c,l,r)}`;n(u);const d=Wn();o.call(void 0,...i);const p=Wn()-d;n(`Elapsed:: ${p}ms ${u}`)},a,s,c,l)}function _(e,t,n,r,i,o){return`WatchInfo: ${e} ${t} ${JSON.stringify(n)} ${o?o(r,i):void 0===i?r:`${r} ${i}`}`}}function KU(e){const t=null==e?void 0:e.fallbackPolling;return{watchFile:void 0!==t?t:1}}function GU(e){e.watcher.close()}function XU(e,t,n="tsconfig.json"){return ua(e,e=>{const r=Jo(e,n);return t(r)?r:void 0})}function QU(e,t){const n=Ao(t);return Vo(bo(e)?e:Jo(n,e))}function YU(e,t,n){let r;return p(e,e=>{const i=qo(e,t);if(i.pop(),!r)return void(r=i);const o=Math.min(r.length,i.length);for(let e=0;e{let o;try{rr("beforeIORead"),o=e(n),rr("afterIORead"),ir("I/O Read","beforeIORead","afterIORead")}catch(e){i&&i(e.message),o=""}return void 0!==o?cO(n,o,r,t):void 0}}function tV(e,t,n){return(r,i,o,a)=>{try{rr("beforeIOWrite"),ov(r,i,o,e,t,n),rr("afterIOWrite"),ir("I/O Write","beforeIOWrite","afterIOWrite")}catch(e){a&&a(e.message)}}}function nV(e,t,n=uo){const r=new Map,i=Ht(n.useCaseSensitiveFileNames);function o(){return Ao(Vo(n.getExecutingFilePath()))}const a=jb(e),s=n.realpath&&(e=>n.realpath(e)),c={getSourceFile:eV(e=>c.readFile(e),t),getDefaultLibLocation:o,getDefaultLibFileName:e=>Jo(o(),As(e)),writeFile:tV((e,t,r)=>n.writeFile(e,t,r),e=>(c.createDirectory||n.createDirectory)(e),e=>{return t=e,!!r.has(t)||!!(c.directoryExists||n.directoryExists)(t)&&(r.set(t,!0),!0);var t}),getCurrentDirectory:ft(()=>n.getCurrentDirectory()),useCaseSensitiveFileNames:()=>n.useCaseSensitiveFileNames,getCanonicalFileName:i,getNewLine:()=>a,fileExists:e=>n.fileExists(e),readFile:e=>n.readFile(e),trace:e=>n.write(e+a),directoryExists:e=>n.directoryExists(e),getEnvironmentVariable:e=>n.getEnvironmentVariable?n.getEnvironmentVariable(e):"",getDirectories:e=>n.getDirectories(e),realpath:s,readDirectory:(e,t,r,i,o)=>n.readDirectory(e,t,r,i,o),createDirectory:e=>n.createDirectory(e),createHash:He(n,n.createHash)};return c}function rV(e,t,n){const r=e.readFile,i=e.fileExists,o=e.directoryExists,a=e.createDirectory,s=e.writeFile,c=new Map,l=new Map,_=new Map,u=new Map,d=(t,n)=>{const i=r.call(e,n);return c.set(t,void 0!==i&&i),i};e.readFile=n=>{const i=t(n),o=c.get(i);return void 0!==o?!1!==o?o:void 0:wo(n,".json")||iU(n)?d(i,n):r.call(e,n)};const p=n?(e,r,i,o)=>{const a=t(e),s="object"==typeof r?r.impliedNodeFormat:void 0,c=u.get(s),l=null==c?void 0:c.get(a);if(l)return l;const _=n(e,r,i,o);return _&&(vO(e)||wo(e,".json"))&&u.set(s,(c||new Map).set(a,_)),_}:void 0;return e.fileExists=n=>{const r=t(n),o=l.get(r);if(void 0!==o)return o;const a=i.call(e,n);return l.set(r,!!a),a},s&&(e.writeFile=(n,r,...i)=>{const o=t(n);l.delete(o);const a=c.get(o);void 0!==a&&a!==r?(c.delete(o),u.forEach(e=>e.delete(o))):p&&u.forEach(e=>{const t=e.get(o);t&&t.text!==r&&e.delete(o)}),s.call(e,n,r,...i)}),o&&(e.directoryExists=n=>{const r=t(n),i=_.get(r);if(void 0!==i)return i;const a=o.call(e,n);return _.set(r,!!a),a},a&&(e.createDirectory=n=>{const r=t(n);_.delete(r),a.call(e,n)})),{originalReadFile:r,originalFileExists:i,originalDirectoryExists:o,originalCreateDirectory:a,originalWriteFile:s,getSourceFileWithCache:p,readFileWithCache:e=>{const n=t(e),r=c.get(n);return void 0!==r?!1!==r?r:void 0:d(n,e)}}}function iV(e,t,n){let r;return r=le(r,e.getConfigFileParsingDiagnostics()),r=le(r,e.getOptionsDiagnostics(n)),r=le(r,e.getSyntacticDiagnostics(t,n)),r=le(r,e.getGlobalDiagnostics(n)),r=le(r,e.getSemanticDiagnostics(t,n)),Ik(e.getCompilerOptions())&&(r=le(r,e.getDeclarationDiagnostics(t,n))),Es(r||_)}function oV(e,t){let n="";for(const r of e)n+=aV(r,t);return n}function aV(e,t){const n=`${_i(e)} TS${e.code}: ${vV(e.messageText,t.getNewLine())}${t.getNewLine()}`;if(e.file){const{line:r,character:i}=Wa(e.file,e.start);return`${ca(e.file.fileName,t.getCurrentDirectory(),e=>t.getCanonicalFileName(e))}(${r+1},${i+1}): `+n}return n}var sV=(e=>(e.Grey="",e.Red="",e.Yellow="",e.Blue="",e.Cyan="",e))(sV||{}),cV="",lV=" ",_V="",uV="...",dV=" ",pV=" ";function fV(e){switch(e){case 1:return"";case 0:return"";case 2:return pn.fail("Should never get an Info diagnostic on the command line.");case 3:return""}}function mV(e,t){return t+e+_V}function gV(e,t,n,r,i,o){const{line:a,character:s}=Wa(e,t),{line:c,character:l}=Wa(e,t+n),_=Wa(e,e.text.length).line,u=c-a>=4;let d=(c+1+"").length;u&&(d=Math.max(uV.length,d));let p="";for(let t=a;t<=c;t++){p+=o.getNewLine(),u&&a+1n.getCanonicalFileName(e)):e.fileName,""),a+=":",a+=r(`${i+1}`,""),a+=":",a+=r(`${o+1}`,""),a}function yV(e,t){let n="";for(const r of e){if(r.file){const{file:e,start:i}=r;n+=hV(e,i,t),n+=" - "}if(n+=mV(_i(r),fV(r.category)),n+=mV(` TS${r.code}: `,""),n+=vV(r.messageText,t.getNewLine()),r.file&&r.code!==fa.File_appears_to_be_binary.code&&(n+=t.getNewLine(),n+=gV(r.file,r.start,r.length,"",fV(r.category),t)),r.relatedInformation){n+=t.getNewLine();for(const{file:e,start:i,length:o,messageText:a}of r.relatedInformation)e&&(n+=t.getNewLine(),n+=dV+hV(e,i,t),n+=gV(e,i,o,pV,"",t)),n+=t.getNewLine(),n+=pV+vV(a,t.getNewLine())}n+=t.getNewLine()}return n}function vV(e,t,n=0){if(tt(e))return e;if(void 0===e)return"";let r="";if(n){r+=t;for(let e=0;eSV(t,e,n)};function EV(e,t,n,r,i){return{nameAndMode:FV,resolve:(o,a)=>HM(o,e,n,r,i,t,a)}}function PV(e){return tt(e)?e:e.fileName}var AV={getName:PV,getMode:(e,t,n)=>bV(e,t&&XV(t,n))};function IV(e,t,n,r,i){return{nameAndMode:AV,resolve:(o,a)=>CM(o,e,n,r,t,i,a)}}function OV(e,t,n,r,i,o,a,s){if(0===e.length)return _;const c=[],l=new Map,u=s(t,n,r,o,a);for(const t of e){const e=u.nameAndMode.getName(t),o=u.nameAndMode.getMode(t,i,(null==n?void 0:n.commandLine.options)||r),a=jM(e,o);let s=l.get(a);s||l.set(a,s=u.resolve(e,o)),c.push(s)}return c}var LV="__inferred type names__.ts";function jV(e,t,n){return Jo(e.configFilePath?Ao(e.configFilePath):t,`__lib_node_modules_lookup_${n}__.ts`)}function MV(e){const t=e.split(".");let n=t[1],r=2;for(;t[r]&&"d"!==t[r];)n+=(2===r?"/":"-")+t[r],r++;return"@typescript/lib-"+n}function RV(e){switch(null==e?void 0:e.kind){case 3:case 4:case 5:case 7:return!0;default:return!1}}function BV(e){return void 0!==e.pos}function JV(e,t){var n,r,i,o;const a=pn.checkDefined(e.getSourceFileByPath(t.file)),{kind:s,index:c}=t;let l,_,u;switch(s){case 3:const t=iW(a,c);if(u=null==(r=null==(n=e.getResolvedModuleFromModuleSpecifier(t,a))?void 0:n.resolvedModule)?void 0:r.packageId,-1===t.pos)return{file:a,packageId:u,text:t.text};l=ts(a.text,t.pos),_=t.end;break;case 4:({pos:l,end:_}=a.referencedFiles[c]);break;case 5:({pos:l,end:_}=a.typeReferenceDirectives[c]),u=null==(o=null==(i=e.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(a.typeReferenceDirectives[c],a))?void 0:i.resolvedTypeReferenceDirective)?void 0:o.packageId;break;case 7:({pos:l,end:_}=a.libReferenceDirectives[c]);break;default:return pn.assertNever(s)}return{file:a,pos:l,end:_,packageId:u}}function zV(e,t,n,r,i,o,a,s,c,l){if(!e||(null==s?void 0:s()))return!1;if(!re(e.getRootFileNames(),t))return!1;let _;if(!re(e.getProjectReferences(),l,function(t,n,r){return dd(t,n)&&f(e.getResolvedProjectReferences()[r],t)}))return!1;if(e.getSourceFiles().some(function(e){return!function(e){return e.version===r(e.resolvedPath,e.fileName)}(e)||o(e.path)}))return!1;const u=e.getMissingFilePaths();if(u&&sd(u,i))return!1;const d=e.getCompilerOptions();return!!mx(d,n)&&((!e.resolvedLibReferences||!sd(e.resolvedLibReferences,(e,t)=>a(t)))&&(!d.configFile||!n.configFile||d.configFile.text===n.configFile.text));function f(e,t){if(e){if(C(_,e))return!0;const n=tW(t),r=c(n);return!!r&&(e.commandLine.options.configFile===r.options.configFile&&(!!re(e.commandLine.fileNames,r.fileNames)&&((_||(_=[])).push(e),!p(e.references,(t,n)=>!f(t,e.commandLine.projectReferences[n])))))}const n=tW(t);return!c(n)}}function qV(e){return e.options.configFile?[...e.options.configFile.parseDiagnostics,...e.errors]:e.errors}function UV(e,t,n,r){const i=VV(e,t,n,r);return"object"==typeof i?i.impliedNodeFormat:i}function VV(e,t,n,r){const i=Ck(r),o=3<=i&&i<=99||aR(e);return No(e,[".d.mts",".mts",".mjs"])?99:No(e,[".d.cts",".cts",".cjs"])?1:o&&No(e,[".d.ts",".ts",".tsx",".js",".jsx"])?function(){const i=vR(t,n,r),o=[];i.failedLookupLocations=o,i.affectingLocations=o;const a=bR(Ao(e),i);return{impliedNodeFormat:"module"===(null==a?void 0:a.contents.packageJsonContent.type)?99:1,packageJsonLocations:o,packageJsonScope:a}}():void 0}var WV=new Set([fa.Cannot_redeclare_block_scoped_variable_0.code,fa.A_module_cannot_have_multiple_default_exports.code,fa.Another_export_default_is_here.code,fa.The_first_export_default_is_here.code,fa.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,fa.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,fa.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,fa.constructor_is_a_reserved_word.code,fa.delete_cannot_be_called_on_an_identifier_in_strict_mode.code,fa.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code,fa.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code,fa.Invalid_use_of_0_in_strict_mode.code,fa.A_label_is_not_allowed_here.code,fa.with_statements_are_not_allowed_in_strict_mode.code,fa.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,fa.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,fa.A_class_declaration_without_the_default_modifier_must_have_a_name.code,fa.A_class_member_cannot_have_the_0_keyword.code,fa.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,fa.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,fa.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,fa.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,fa.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,fa.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,fa.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,fa.A_destructuring_declaration_must_have_an_initializer.code,fa.A_get_accessor_cannot_have_parameters.code,fa.A_rest_element_cannot_contain_a_binding_pattern.code,fa.A_rest_element_cannot_have_a_property_name.code,fa.A_rest_element_cannot_have_an_initializer.code,fa.A_rest_element_must_be_last_in_a_destructuring_pattern.code,fa.A_rest_parameter_cannot_have_an_initializer.code,fa.A_rest_parameter_must_be_last_in_a_parameter_list.code,fa.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,fa.A_return_statement_cannot_be_used_inside_a_class_static_block.code,fa.A_set_accessor_cannot_have_rest_parameter.code,fa.A_set_accessor_must_have_exactly_one_parameter.code,fa.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,fa.An_export_declaration_cannot_have_modifiers.code,fa.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,fa.An_import_declaration_cannot_have_modifiers.code,fa.An_object_member_cannot_be_declared_optional.code,fa.Argument_of_dynamic_import_cannot_be_spread_element.code,fa.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,fa.Cannot_redeclare_identifier_0_in_catch_clause.code,fa.Catch_clause_variable_cannot_have_an_initializer.code,fa.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,fa.Classes_can_only_extend_a_single_class.code,fa.Classes_may_not_have_a_field_named_constructor.code,fa.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,fa.Duplicate_label_0.code,fa.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,fa.for_await_loops_cannot_be_used_inside_a_class_static_block.code,fa.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,fa.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,fa.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,fa.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,fa.Jump_target_cannot_cross_function_boundary.code,fa.Line_terminator_not_permitted_before_arrow.code,fa.Modifiers_cannot_appear_here.code,fa.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,fa.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,fa.Private_identifiers_are_not_allowed_outside_class_bodies.code,fa.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,fa.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,fa.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,fa.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,fa.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,fa.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,fa.Trailing_comma_not_allowed.code,fa.Variable_declaration_list_cannot_be_empty.code,fa._0_and_1_operations_cannot_be_mixed_without_parentheses.code,fa._0_expected.code,fa._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,fa._0_list_cannot_be_empty.code,fa._0_modifier_already_seen.code,fa._0_modifier_cannot_appear_on_a_constructor_declaration.code,fa._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,fa._0_modifier_cannot_appear_on_a_parameter.code,fa._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,fa._0_modifier_cannot_be_used_here.code,fa._0_modifier_must_precede_1_modifier.code,fa._0_declarations_can_only_be_declared_inside_a_block.code,fa._0_declarations_must_be_initialized.code,fa.extends_clause_already_seen.code,fa.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,fa.Class_constructor_may_not_be_a_generator.code,fa.Class_constructor_may_not_be_an_accessor.code,fa.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,fa.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,fa.Private_field_0_must_be_declared_in_an_enclosing_class.code,fa.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code]);function $V(e,t,n,r,i){var o,a,c,l,u,d,f,m,h,y,v,b,k,T,w,N;let F=Ze(e)?function(e,t,n,r,i,o){return{rootNames:e,options:t,host:n,oldProgram:r,configFileParsingDiagnostics:i,typeScriptVersion:o}}(e,t,n,r,i):e;const{rootNames:E,options:P,configFileParsingDiagnostics:A,projectReferences:I,typeScriptVersion:j,host:M}=F;let{oldProgram:R}=F;F=void 0,e=void 0;for(const e of QO)if(Ee(P,e.name)&&"string"==typeof P[e.name])throw new Error(`${e.name} is a string value; tsconfig JSON must be parsed with parseJsonSourceFileConfigFileContent or getParsedCommandLineOfConfigFile before passing to createProgram`);const B=ft(()=>In("ignoreDeprecations",fa.Invalid_value_for_ignoreDeprecations));let z,q,U,V,W,$,K,X,Q;const Y=oW(Mn);let Z,ee,te,ne,ie,oe,se,ce,le;const _e="number"==typeof P.maxNodeModuleJsDepth?P.maxNodeModuleJsDepth:0;let ue=0;const pe=new Map,fe=new Map;null==(o=Gn)||o.push(Gn.Phase.Program,"createProgram",{configFilePath:P.configFilePath,rootDir:P.rootDir},!0),rr("beforeProgram");const me=M||ZU(P),ge=eW(me);let he=P.noLib;const ye=ft(()=>me.getDefaultLibFileName(P)),ve=me.getDefaultLibLocation?me.getDefaultLibLocation():Ao(ye());let be=!1;const xe=me.getCurrentDirectory(),ke=MS(P),Se=RS(P,ke),Te=new Map;let Ce,we,Ne,De;const Fe=me.hasInvalidatedResolutions||at;let Pe;if(me.resolveModuleNameLiterals?(De=me.resolveModuleNameLiterals.bind(me),Ne=null==(a=me.getModuleResolutionCache)?void 0:a.call(me)):me.resolveModuleNames?(De=(e,t,n,r,i,o)=>me.resolveModuleNames(e.map(DV),t,null==o?void 0:o.map(DV),n,r,i).map(e=>e?void 0!==e.extension?{resolvedModule:e}:{resolvedModule:{...e,extension:iT(e.resolvedFileName)}}:NV),Ne=null==(c=me.getModuleResolutionCache)?void 0:c.call(me)):(Ne=qM(xe,Tn,P),De=(e,t,n,r,i)=>OV(e,t,n,r,i,me,Ne,EV)),me.resolveTypeReferenceDirectiveReferences)Pe=me.resolveTypeReferenceDirectiveReferences.bind(me);else if(me.resolveTypeReferenceDirectives)Pe=(e,t,n,r,i)=>me.resolveTypeReferenceDirectives(e.map(PV),t,n,r,null==i?void 0:i.impliedNodeFormat).map(e=>({resolvedTypeReferenceDirective:e}));else{const e=UM(xe,Tn,void 0,null==Ne?void 0:Ne.getPackageJsonInfoCache(),null==Ne?void 0:Ne.optionsToRedirectsKey);Pe=(t,n,r,i,o)=>OV(t,n,r,i,o,me,e,IV)}const Ae=me.hasInvalidatedLibResolutions||at;let Ie;if(me.resolveLibrary)Ie=me.resolveLibrary.bind(me);else{const e=qM(xe,Tn,P,null==Ne?void 0:Ne.getPackageJsonInfoCache());Ie=(t,n,r)=>WM(t,n,r,me,e)}const Oe=new Map;let Le,je=new Map,Me=Ke();const Re=new Map;let Be=new Map;const Je=me.useCaseSensitiveFileNames()?new Map:void 0;let ze,qe,Ue,Ve;const We=!!(null==(l=me.useSourceOfProjectReferenceRedirect)?void 0:l.call(me))&&!P.disableSourceOfProjectReferenceRedirect,{onProgramCreateComplete:$e,fileExists:Ge,directoryExists:Xe}=function(e){let t;const n=e.compilerHost.fileExists,r=e.compilerHost.directoryExists,i=e.compilerHost.getDirectories,o=e.compilerHost.realpath;if(!e.useSourceOfProjectReferenceRedirect)return{onProgramCreateComplete:ot,fileExists:c};let a;e.compilerHost.fileExists=c,r&&(a=e.compilerHost.directoryExists=n=>r.call(e.compilerHost,n)?(u(n),!0):!!e.getResolvedProjectReferences()&&(t||(t=new Set,e.forEachResolvedProjectReference(n=>{const r=n.commandLine.options.outFile;if(r)t.add(Ao(e.toPath(r)));else{const r=n.commandLine.options.declarationDir||n.commandLine.options.outDir;r&&t.add(e.toPath(r))}})),d(n,!1)));i&&(e.compilerHost.getDirectories=t=>!e.getResolvedProjectReferences()||r&&r.call(e.compilerHost,t)?i.call(e.compilerHost,t):[]);o&&(e.compilerHost.realpath=t=>{var n;return(null==(n=e.getSymlinkCache().getSymlinkedFiles())?void 0:n.get(e.toPath(t)))||o.call(e.compilerHost,t)});return{onProgramCreateComplete:s,fileExists:c,directoryExists:a};function s(){e.compilerHost.fileExists=n,e.compilerHost.directoryExists=r,e.compilerHost.getDirectories=i}function c(t){return!!n.call(e.compilerHost,t)||!!e.getResolvedProjectReferences()&&(!!vO(t)&&d(t,!0))}function l(t){const r=e.getRedirectFromOutput(e.toPath(t));return void 0!==r?!tt(r.source)||n.call(e.compilerHost,r.source):void 0}function _(n){const r=e.toPath(n),i=`${r}${fo}`;return cd(t,e=>r===e||Qt(e,i)||Qt(r,`${e}/`))}function u(t){var n;if(!e.getResolvedProjectReferences()||RT(t))return;if(!o||!t.includes(oR))return;const r=e.getSymlinkCache(),i=Go(e.toPath(t));if(null==(n=r.getSymlinkedDirectories())?void 0:n.has(i))return;const a=Vo(o.call(e.compilerHost,t));let s;a!==t&&(s=Go(e.toPath(a)))!==i?r.setSymlinkedDirectory(t,{real:Go(a),realPath:s}):r.setSymlinkedDirectory(i,!1)}function d(t,n){var r;const i=n?l:_,o=i(t);if(void 0!==o)return o;const a=e.getSymlinkCache(),s=a.getSymlinkedDirectories();if(!s)return!1;const c=e.toPath(t);return!!c.includes(oR)&&(!(!n||!(null==(r=a.getSymlinkedFiles())?void 0:r.has(c)))||(g(s.entries(),([r,o])=>{if(!o||!Qt(c,r))return;const s=i(c.replace(r,o.realPath));if(n&&s){const n=Uo(t,e.compilerHost.getCurrentDirectory());a.setSymlinkedFile(c,`${o.real}${n.replace(new RegExp(r,"i"),"")}`)}return s})||!1))}}({compilerHost:me,getSymlinkCache:qn,useSourceOfProjectReferenceRedirect:We,toPath:Tt,getResolvedProjectReferences:Pt,getRedirectFromOutput:dn,forEachResolvedProjectReference:un}),Qe=me.readFile.bind(me);null==(u=Gn)||u.push(Gn.Phase.Program,"shouldProgramCreateNewSourceFiles",{hasOldProgram:!!R});const Ye=function(e,t){return!!e&&od(e.getCompilerOptions(),t,$O)}(R,P);let et;if(null==(d=Gn)||d.pop(),null==(f=Gn)||f.push(Gn.Phase.Program,"tryReuseStructureFromOldProgram",{}),et=function(){var e;if(!R)return 0;const t=R.getCompilerOptions();if(rd(t,P))return 0;if(!re(R.getRootFileNames(),E))return 0;if(BC(R.getProjectReferences(),R.getResolvedProjectReferences(),(e,t,n)=>{const r=wn((t?t.commandLine.projectReferences:I)[n]);return e?!r||r.sourceFile!==e.sourceFile||!re(e.commandLine.fileNames,r.commandLine.fileNames):void 0!==r},(e,t)=>!re(e,t?mn(t.sourceFile.path).commandLine.projectReferences:I,dd)))return 0;I&&(ze=I.map(wn));const n=[],r=[];if(et=2,sd(R.getMissingFilePaths(),e=>me.fileExists(e)))return 0;const i=R.getSourceFiles();let o;a=o||(o={}),a[a.Exists=0]="Exists",a[a.Modified=1]="Modified";var a;const s=new Map;for(const t of i){const i=an(t.fileName,Ne,me,P);let o,a=me.getSourceFileByPath?me.getSourceFileByPath(t.fileName,t.resolvedPath,i,void 0,Ye):me.getSourceFile(t.fileName,i,void 0,Ye);if(!a)return 0;if(a.packageJsonLocations=(null==(e=i.packageJsonLocations)?void 0:e.length)?i.packageJsonLocations:void 0,a.packageJsonScope=i.packageJsonScope,pn.assert(!a.redirectInfo,"Host should not return a redirect source file from `getSourceFile`"),t.redirectInfo){if(a!==t.redirectInfo.unredirected)return 0;o=!1,a=t}else if(R.redirectTargetsMap.has(t.path)){if(a!==t)return 0;o=!1}else o=a!==t;a.path=t.path,a.originalFileName=t.originalFileName,a.resolvedPath=t.resolvedPath,a.fileName=t.fileName;const c=R.sourceFileToPackageName.get(t.path);if(void 0!==c){const e=s.get(c),t=o?1:0;if(void 0!==e&&1===t||1===e)return 0;s.set(c,t)}o?(t.impliedNodeFormat!==a.impliedNodeFormat?et=1:re(t.libReferenceDirectives,a.libReferenceDirectives,Kt)?t.hasNoDefaultLib!==a.hasNoDefaultLib?et=1:re(t.referencedFiles,a.referencedFiles,Kt)?(Zt(a),re(t.imports,a.imports,Gt)&&re(t.moduleAugmentations,a.moduleAugmentations,Gt)?(12582912&t.flags)!=(12582912&a.flags)?et=1:re(t.typeReferenceDirectives,a.typeReferenceDirectives,Kt)||(et=1):et=1):et=1:et=1,r.push(a)):Fe(t.path)&&(et=1,r.push(a)),n.push(a)}if(2!==et)return et;for(const e of r){const t=rW(e),n=wt(t,e);(oe??(oe=new Map)).set(e.path,n);const r=yn(e);xd(t,n,t=>R.getResolvedModule(e,t.text,TV(e,t,r)),pd)&&(et=1);const i=e.typeReferenceDirectives,o=Nt(i,e);(ce??(ce=new Map)).set(e.path,o);xd(i,o,t=>R.getResolvedTypeReferenceDirective(e,PV(t),Kn(t,e)),bd)&&(et=1)}if(2!==et)return et;if(id(t,P))return 1;if(R.resolvedLibReferences&&sd(R.resolvedLibReferences,(e,t)=>xn(t).actual!==e.actual))return 1;if(me.hasChangedAutomaticTypeDirectiveNames){if(me.hasChangedAutomaticTypeDirectiveNames())return 1}else if(Z=FM(P,me),!re(R.getAutomaticTypeDirectiveNames(),Z))return 1;Be=R.getMissingFilePaths(),pn.assert(n.length===R.getSourceFiles().length);for(const e of n)Re.set(e.path,e);R.getFilesByNameMap().forEach((e,t)=>{e?e.path!==t?Re.set(t,Re.get(e.path)):R.isSourceFileFromExternalLibrary(e)&&fe.set(e.path,!0):Re.set(t,e)});const c=t.configFile&&t.configFile===P.configFile||!t.configFile&&!P.configFile&&!od(t,P,zO);return Y.reuseStateFromOldProgram(R.getProgramDiagnosticsContainer(),c),be=c,U=n,Z=R.getAutomaticTypeDirectiveNames(),ee=R.getAutomaticTypeDirectiveResolutions(),je=R.sourceFileToPackageName,Me=R.redirectTargetsMap,Le=R.usesUriStyleNodeCoreModules,ie=R.resolvedModules,se=R.resolvedTypeReferenceDirectiveNames,te=R.resolvedLibReferences,le=R.getCurrentPackagesMap(),2}(),null==(m=Gn)||m.pop(),2!==et){if(z=[],q=[],I&&(ze||(ze=I.map(wn)),E.length&&(null==ze||ze.forEach((e,t)=>{if(!e)return;const n=e.commandLine.options.outFile;if(We){if(n||0===Tk(e.commandLine.options))for(const n of e.commandLine.fileNames)nn(n,{kind:1,index:t})}else if(n)nn(QS(n,".d.ts"),{kind:2,index:t});else if(0===Tk(e.commandLine.options)){const n=ft(()=>bU(e.commandLine,!me.useCaseSensitiveFileNames()));for(const r of e.commandLine.fileNames)vO(r)||wo(r,".json")||nn(dU(r,e.commandLine,!me.useCaseSensitiveFileNames(),n),{kind:2,index:t})}}))),null==(h=Gn)||h.push(Gn.Phase.Program,"processRootFiles",{count:E.length}),p(E,(e,t)=>Ht(e,!1,!1,{kind:0,index:t})),null==(y=Gn)||y.pop(),Z??(Z=E.length?FM(P,me):_),ee=MM(),Z.length){null==(v=Gn)||v.push(Gn.Phase.Program,"processTypeReferences",{count:Z.length});const e=Jo(P.configFilePath?Ao(P.configFilePath):xe,LV),t=Nt(Z,e);for(let e=0;e{Ht(bn(e),!0,!1,{kind:6,index:t})})}U=de(z,function(e,t){return xt(St(e),St(t))}).concat(q),z=void 0,q=void 0,K=void 0}if(R&&me.onReleaseOldSourceFile){const e=R.getSourceFiles();for(const t of e){const e=jt(t.resolvedPath);(Ye||!e||e.impliedNodeFormat!==t.impliedNodeFormat||t.resolvedPath===t.path&&e.resolvedPath!==t.path)&&me.onReleaseOldSourceFile(t,R.getCompilerOptions(),!!jt(t.path),e)}me.getParsedCommandLine||R.forEachResolvedProjectReference(e=>{mn(e.sourceFile.path)||me.onReleaseOldSourceFile(e.sourceFile,R.getCompilerOptions(),!1,void 0)})}R&&me.onReleaseParsedCommandLine&&BC(R.getProjectReferences(),R.getResolvedProjectReferences(),(e,t,n)=>{const r=tW((null==t?void 0:t.commandLine.projectReferences[n])||R.getProjectReferences()[n]);(null==qe?void 0:qe.has(Tt(r)))||me.onReleaseParsedCommandLine(r,e,R.getCompilerOptions())}),R=void 0,ne=void 0,oe=void 0,ce=void 0;const nt={getRootFileNames:()=>E,getSourceFile:Lt,getSourceFileByPath:jt,getSourceFiles:()=>U,getMissingFilePaths:()=>Be,getModuleResolutionCache:()=>Ne,getFilesByNameMap:()=>Re,getCompilerOptions:()=>P,getSyntacticDiagnostics:function(e,t){return Mt(e,Bt,t)},getOptionsDiagnostics:function(){return Es(G(Y.getCombinedDiagnostics(nt).getGlobalDiagnostics(),function(){if(!P.configFile)return _;let e=Y.getCombinedDiagnostics(nt).getDiagnostics(P.configFile.fileName);return un(t=>{e=G(e,Y.getCombinedDiagnostics(nt).getDiagnostics(t.sourceFile.fileName))}),e}()))},getGlobalDiagnostics:function(){return E.length?Es(It().getGlobalDiagnostics().slice()):_},getSemanticDiagnostics:function(e,t,n){return Mt(e,(e,t)=>function(e,t,n){return G(ZV(qt(e,t,n),P),Rt(e))}(e,t,n),t)},getCachedSemanticDiagnostics:function(e){return null==X?void 0:X.get(e.path)},getSuggestionDiagnostics:function(e,t){return zt(()=>It().getSuggestionDiagnostics(e,t))},getDeclarationDiagnostics:function(e,t){return Mt(e,$t,t)},getBindAndCheckDiagnostics:function(e,t){return qt(e,t,void 0)},getProgramDiagnostics:Rt,getTypeChecker:It,getClassifiableNames:function(){var e;if(!$){It(),$=new Set;for(const t of U)null==(e=t.classifiableNames)||e.forEach(e=>$.add(e))}return $},getCommonSourceDirectory:Ct,emit:function(e,t,n,r,i,o,a){var s,c;null==(s=Gn)||s.push(Gn.Phase.Emit,"emit",{path:null==e?void 0:e.path},!0);const l=zt(()=>function(e,t,n,r,i,o,a,s){if(!a){const i=YV(e,t,n,r);if(i)return i}const c=It(),l=c.getEmitResolver(P.outFile?void 0:t,r,TU(i,a));rr("beforeEmit");const _=c.runWithCancellationToken(r,()=>CU(l,Ft(n),t,Hq(P,o,i),i,!1,a,s));return rr("afterEmit"),ir("Emit","beforeEmit","afterEmit"),_}(nt,e,t,n,r,i,o,a));return null==(c=Gn)||c.pop(),l},getCurrentDirectory:()=>xe,getNodeCount:()=>It().getNodeCount(),getIdentifierCount:()=>It().getIdentifierCount(),getSymbolCount:()=>It().getSymbolCount(),getTypeCount:()=>It().getTypeCount(),getInstantiationCount:()=>It().getInstantiationCount(),getRelationCacheSizes:()=>It().getRelationCacheSizes(),getFileProcessingDiagnostics:()=>Y.getFileProcessingDiagnostics(),getAutomaticTypeDirectiveNames:()=>Z,getAutomaticTypeDirectiveResolutions:()=>ee,isSourceFileFromExternalLibrary:At,isSourceFileDefaultLibrary:function(e){if(!e.isDeclarationFile)return!1;if(e.hasNoDefaultLib)return!0;if(P.noLib)return!1;const t=me.useCaseSensitiveFileNames()?vt:yt;return P.lib?H(P.lib,n=>{const r=te.get(n);return!!r&&t(e.fileName,r.actual)}):t(e.fileName,ye())},getModeForUsageLocation:Un,getEmitSyntaxForUsageLocation:function(e,t){return CV(e,t,yn(e))},getModeForResolutionAtIndex:Vn,getSourceFileFromReference:function(e,t){return en(QU(t.fileName,e.fileName),Lt)},getLibFileFromReference:function(e){var t;const n=MC(e),r=n&&(null==(t=null==te?void 0:te.get(n))?void 0:t.actual);return void 0!==r?Lt(r):void 0},sourceFileToPackageName:je,redirectTargetsMap:Me,usesUriStyleNodeCoreModules:Le,resolvedModules:ie,resolvedTypeReferenceDirectiveNames:se,resolvedLibReferences:te,getProgramDiagnosticsContainer:()=>Y,getResolvedModule:it,getResolvedModuleFromModuleSpecifier:function(e,t){return t??(t=Sd(e)),pn.assertIsDefined(t,"`moduleSpecifier` must have a `SourceFile` ancestor. Use `program.getResolvedModule` instead to provide the containing file and resolution mode."),it(t,e.text,Un(t,e))},getResolvedTypeReferenceDirective:st,getResolvedTypeReferenceDirectiveFromTypeReferenceDirective:function(e,t){return st(t,e.fileName,Kn(e,t))},forEachResolvedModule:ct,forEachResolvedTypeReferenceDirective:_t,getCurrentPackagesMap:()=>le,typesPackageExists:function(e){return pt().has(zR(e))},packageBundlesTypes:function(e){return!!pt().get(e)},isEmittedFile:function(e){if(P.noEmit)return!1;const t=Tt(e);if(jt(t))return!1;const n=P.outFile;if(n)return zn(t,n)||zn(t,KS(n)+".d.ts");if(P.declarationDir&&ia(P.declarationDir,t,xe,!me.useCaseSensitiveFileNames()))return!0;if(P.outDir)return ia(P.outDir,t,xe,!me.useCaseSensitiveFileNames());if(No(t,PS)||vO(t)){const e=KS(t);return!!jt(e+".ts")||!!jt(e+".tsx")}return!1},getConfigFileParsingDiagnostics:function(){return A||_},getProjectReferences:function(){return I},getResolvedProjectReferences:Pt,getRedirectFromSourceFile:_n,getResolvedProjectReferenceByPath:mn,forEachResolvedProjectReference:un,isSourceOfProjectReferenceRedirect:fn,getRedirectFromOutput:dn,getCompilerOptionsForFile:yn,getDefaultResolutionModeForFile:Wn,getEmitModuleFormatOfFile:$n,getImpliedNodeFormatForEmit:function(e){return GV(e,yn(e))},shouldTransformImportCall:Hn,emitBuildInfo:function(e){var t,n;null==(t=Gn)||t.push(Gn.Phase.Emit,"emitBuildInfo",{},!0),rr("beforeEmit");const r=CU(DU,Ft(e),void 0,$q,!1,!0);return rr("afterEmit"),ir("Emit","beforeEmit","afterEmit"),null==(n=Gn)||n.pop(),r},fileExists:Ge,readFile:Qe,directoryExists:Xe,getSymlinkCache:qn,realpath:null==(w=me.realpath)?void 0:w.bind(me),useCaseSensitiveFileNames:()=>me.useCaseSensitiveFileNames(),getCanonicalFileName:Tn,getFileIncludeReasons:()=>Y.getFileReasons(),structureIsReused:et,writeFile:Et,getGlobalTypingsCacheLocation:He(me,me.getGlobalTypingsCacheLocation)};return $e(),be||function(){P.strictPropertyInitialization&&!Wk(P,"strictNullChecks")&&An(fa.Option_0_cannot_be_specified_without_specifying_option_1,"strictPropertyInitialization","strictNullChecks");P.exactOptionalPropertyTypes&&!Wk(P,"strictNullChecks")&&An(fa.Option_0_cannot_be_specified_without_specifying_option_1,"exactOptionalPropertyTypes","strictNullChecks");(P.isolatedModules||P.verbatimModuleSyntax)&&P.outFile&&An(fa.Option_0_cannot_be_specified_with_option_1,"outFile",P.verbatimModuleSyntax?"verbatimModuleSyntax":"isolatedModules");P.isolatedDeclarations&&(Mk(P)&&An(fa.Option_0_cannot_be_specified_with_option_1,"allowJs","isolatedDeclarations"),Ik(P)||An(fa.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"isolatedDeclarations","declaration","composite"));P.inlineSourceMap&&(P.sourceMap&&An(fa.Option_0_cannot_be_specified_with_option_1,"sourceMap","inlineSourceMap"),P.mapRoot&&An(fa.Option_0_cannot_be_specified_with_option_1,"mapRoot","inlineSourceMap"));P.composite&&(!1===P.declaration&&An(fa.Composite_projects_may_not_disable_declaration_emit,"declaration"),!1===P.incremental&&An(fa.Composite_projects_may_not_disable_incremental_compilation,"declaration"));const e=P.outFile;P.tsBuildInfoFile||!P.incremental||e||P.configFilePath||Y.addConfigDiagnostic(nk(fa.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));if(function(){function e(e,t,n,r,...i){if(n){const o=ik(void 0,fa.Use_0_instead,n);Ln(!t,e,void 0,ik(o,r,...i))}else Ln(!t,e,void 0,r,...i)}Nn("5.0","5.5",e,e=>{0===P.target&&e("target","ES3"),P.noImplicitUseStrict&&e("noImplicitUseStrict"),P.keyofStringsOnly&&e("keyofStringsOnly"),P.suppressExcessPropertyErrors&&e("suppressExcessPropertyErrors"),P.suppressImplicitAnyIndexErrors&&e("suppressImplicitAnyIndexErrors"),P.noStrictGenericChecks&&e("noStrictGenericChecks"),P.charset&&e("charset"),P.out&&e("out",void 0,"outFile"),P.importsNotUsedAsValues&&e("importsNotUsedAsValues",void 0,"verbatimModuleSyntax"),P.preserveValueImports&&e("preserveValueImports",void 0,"verbatimModuleSyntax")})}(),function(){const e=P.suppressOutputPathCheck?void 0:aU(P);BC(I,ze,(t,n,r)=>{const i=(n?n.commandLine.projectReferences:I)[r],o=n&&n.sourceFile;if(function(e,t,n){function r(e,r,i,o,...a){On(t,n,o,...a)}Nn("5.0","5.5",r,t=>{e.prepend&&t("prepend")})}(i,o,r),!t)return void On(o,r,fa.File_0_not_found,i.path);const a=t.commandLine.options;if(!a.composite||a.noEmit){(n?n.commandLine.fileNames:E).length&&(a.composite||On(o,r,fa.Referenced_project_0_must_have_setting_composite_Colon_true,i.path),a.noEmit&&On(o,r,fa.Referenced_project_0_may_not_disable_emit,i.path))}!n&&e&&e===aU(a)&&(On(o,r,fa.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1,e,i.path),Te.set(Tt(e),!0))})}(),P.composite){const e=new Set(E.map(Tt));for(const t of U)ev(t,nt)&&!e.has(t.path)&&Y.addLazyConfigDiagnostic(t,fa.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,t.fileName,P.configFilePath||"")}if(P.paths)for(const e in P.paths)if(Ee(P.paths,e))if(tS(e)||En(!0,e,fa.Pattern_0_can_have_at_most_one_Asterisk_character,e),Ze(P.paths[e])){const t=P.paths[e].length;0===t&&En(!1,e,fa.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array,e);for(let n=0;nuO(e)&&!e.isDeclarationFile);if(P.isolatedModules||P.verbatimModuleSyntax)0===P.module&&t<2&&P.isolatedModules&&An(fa.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher,"isolatedModules","target"),!1===P.preserveConstEnums&&An(fa.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled,P.verbatimModuleSyntax?"verbatimModuleSyntax":"isolatedModules","preserveConstEnums");else if(n&&t<2&&0===P.module){const e=tf(n,"boolean"==typeof n.externalModuleIndicator?n:n.externalModuleIndicator);Y.addConfigDiagnostic(ek(n,e.start,e.length,fa.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none))}if(e&&!P.emitDeclarationOnly)if(P.module&&2!==P.module&&4!==P.module)An(fa.Only_amd_and_system_modules_are_supported_alongside_0,"outFile","module");else if(void 0===P.module&&n){const e=tf(n,"boolean"==typeof n.externalModuleIndicator?n:n.externalModuleIndicator);Y.addConfigDiagnostic(ek(n,e.start,e.length,fa.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system,"outFile"))}Ak(P)&&(1===Ck(P)?An(fa.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic,"resolveJsonModule"):Jk(P)||An(fa.Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd,"resolveJsonModule","module"));if(P.outDir||P.rootDir||P.sourceRoot||P.mapRoot||Ik(P)&&P.declarationDir){const e=Ct();P.outDir&&""===e&&U.some(e=>Po(e.fileName)>1)&&An(fa.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir")}P.checkJs&&!Mk(P)&&An(fa.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs");P.emitDeclarationOnly&&(Ik(P)||An(fa.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite"));P.emitDecoratorMetadata&&!P.experimentalDecorators&&An(fa.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators");P.jsxFactory?(P.reactNamespace&&An(fa.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory"),4!==P.jsx&&5!==P.jsx||An(fa.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",AO.get(""+P.jsx)),lO(P.jsxFactory,t)||In("jsxFactory",fa.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,P.jsxFactory)):P.reactNamespace&&!vs(P.reactNamespace,t)&&In("reactNamespace",fa.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,P.reactNamespace);P.jsxFragmentFactory&&(P.jsxFactory||An(fa.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory"),4!==P.jsx&&5!==P.jsx||An(fa.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",AO.get(""+P.jsx)),lO(P.jsxFragmentFactory,t)||In("jsxFragmentFactory",fa.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,P.jsxFragmentFactory));P.reactNamespace&&(4!==P.jsx&&5!==P.jsx||An(fa.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",AO.get(""+P.jsx)));P.jsxImportSource&&2===P.jsx&&An(fa.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",AO.get(""+P.jsx));const r=Tk(P);P.verbatimModuleSyntax&&(2!==r&&3!==r&&4!==r||An(fa.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System,"verbatimModuleSyntax"));P.allowImportingTsExtensions&&!(P.noEmit||P.emitDeclarationOnly||P.rewriteRelativeImportExtensions)&&In("allowImportingTsExtensions",fa.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);const i=Ck(P);P.resolvePackageJsonExports&&!Uk(i)&&An(fa.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"resolvePackageJsonExports");P.resolvePackageJsonImports&&!Uk(i)&&An(fa.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"resolvePackageJsonImports");P.customConditions&&!Uk(i)&&An(fa.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"customConditions");100!==i||Bk(r)||200===r||In("moduleResolution",fa.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later,"bundler");if(gi[r]&&100<=r&&r<=199&&!(3<=i&&i<=99)){const e=gi[r],t=ui[e]?e:"Node16";In("moduleResolution",fa.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1,t,e)}else if(ui[i]&&3<=i&&i<=99&&!(100<=r&&r<=199)){const e=ui[i];In("module",fa.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1,e,e)}if(!P.noEmit&&!P.suppressOutputPathCheck){const e=Ft(),t=new Set;oU(e,e=>{P.emitDeclarationOnly||o(e.jsFilePath,t),o(e.declarationFilePath,t)})}function o(e,t){if(e){const n=Tt(e);if(Re.has(n)){let t;P.configFilePath||(t=ik(void 0,fa.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)),t=ik(t,fa.Cannot_write_file_0_because_it_would_overwrite_input_file,e),Jn(e,rk(t))}const r=me.useCaseSensitiveFileNames()?n:dt(n);t.has(r)?Jn(e,nk(fa.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files,e)):t.add(r)}}}(),rr("afterProgram"),ir("Program","beforeProgram","afterProgram"),null==(N=Gn)||N.pop(),nt;function it(e,t,n){var r;return null==(r=null==ie?void 0:ie.get(e.path))?void 0:r.get(t,n)}function st(e,t,n){var r;return null==(r=null==se?void 0:se.get(e.path))?void 0:r.get(t,n)}function ct(e,t){ut(ie,e,t)}function _t(e,t){ut(se,e,t)}function ut(e,t,n){var r;n?null==(r=null==e?void 0:e.get(n.path))||r.forEach((e,r,i)=>t(e,r,i,n.path)):null==e||e.forEach((e,n)=>e.forEach((e,r,i)=>t(e,r,i,n)))}function pt(){return le||(le=new Map,ct(({resolvedModule:e})=>{(null==e?void 0:e.packageId)&&le.set(e.packageId.name,".d.ts"===e.extension||!!le.get(e.packageId.name))}),le)}function mt(e){var t;(null==(t=e.resolutionDiagnostics)?void 0:t.length)&&Y.addFileProcessingDiagnostic({kind:2,diagnostics:e.resolutionDiagnostics})}function gt(e,t,n,r){if(me.resolveModuleNameLiterals||!me.resolveModuleNames)return mt(n);if(!Ne||Fs(t))return;const i=Ao(Uo(e.originalFileName,xe)),o=kt(e),a=Ne.getFromNonRelativeNameCache(t,r,i,o);a&&mt(a)}function ht(e,t,n){var r,i;const o=Uo(t.originalFileName,xe),a=kt(t);null==(r=Gn)||r.push(Gn.Phase.Program,"resolveModuleNamesWorker",{containingFileName:o}),rr("beforeResolveModule");const s=De(e,o,a,P,t,n);return rr("afterResolveModule"),ir("ResolveModule","beforeResolveModule","afterResolveModule"),null==(i=Gn)||i.pop(),s}function bt(e,t,n){var r,i;const o=tt(t)?void 0:t,a=tt(t)?t:Uo(t.originalFileName,xe),s=o&&kt(o);null==(r=Gn)||r.push(Gn.Phase.Program,"resolveTypeReferenceDirectiveNamesWorker",{containingFileName:a}),rr("beforeResolveTypeReference");const c=Pe(e,a,s,P,o,n);return rr("afterResolveTypeReference"),ir("ResolveTypeReference","beforeResolveTypeReference","afterResolveTypeReference"),null==(i=Gn)||i.pop(),c}function kt(e){var t,n;const r=_n(e.originalFileName);if(r||!vO(e.originalFileName))return null==r?void 0:r.resolvedRef;const i=null==(t=dn(e.path))?void 0:t.resolvedRef;if(i)return i;if(!me.realpath||!P.preserveSymlinks||!e.originalFileName.includes(oR))return;const o=Tt(me.realpath(e.originalFileName));return o===e.path||null==(n=dn(o))?void 0:n.resolvedRef}function St(e){if(ia(ve,e.fileName,!1)){const t=Io(e.fileName);if("lib.d.ts"===t||"lib.es6.d.ts"===t)return 0;const n=Jt(Yt(t,"lib."),".d.ts"),r=OO.indexOf(n);if(-1!==r)return r+1}return OO.length+2}function Tt(e){return Ho(e,xe,Tn)}function Ct(){let e=Y.getCommonSourceDirectory();if(void 0!==e)return e;const t=D(U,e=>ev(e,nt));return e=vU(P,()=>J(t,e=>e.isDeclarationFile?void 0:e.fileName),xe,Tn,e=>function(e,t){let n=!0;const r=me.getCanonicalFileName(Uo(t,xe));for(const i of e)if(!i.isDeclarationFile){0!==me.getCanonicalFileName(Uo(i.fileName,xe)).indexOf(r)&&(Y.addLazyConfigDiagnostic(i,fa.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,i.fileName,t),n=!1)}return n}(t,e)),Y.setCommonSourceDirectory(e),e}function wt(e,t){return Dt({entries:e,containingFile:t,containingSourceFile:t,redirectedReference:kt(t),nameAndModeGetter:FV,resolutionWorker:ht,getResolutionFromOldProgram:(e,n)=>null==R?void 0:R.getResolvedModule(t,e,n),getResolved:fd,canReuseResolutionsInFile:()=>t===(null==R?void 0:R.getSourceFile(t.fileName))&&!Fe(t.path),resolveToOwnAmbientModule:!0})}function Nt(e,t){const n=tt(t)?void 0:t;return Dt({entries:e,containingFile:t,containingSourceFile:n,redirectedReference:n&&kt(n),nameAndModeGetter:AV,resolutionWorker:bt,getResolutionFromOldProgram:(e,t)=>{var r;return n?null==R?void 0:R.getResolvedTypeReferenceDirective(n,e,t):null==(r=null==R?void 0:R.getAutomaticTypeDirectiveResolutions())?void 0:r.get(e,t)},getResolved:md,canReuseResolutionsInFile:()=>n?n===(null==R?void 0:R.getSourceFile(n.fileName))&&!Fe(n.path):!Fe(Tt(t))})}function Dt({entries:e,containingFile:t,containingSourceFile:n,redirectedReference:r,nameAndModeGetter:i,resolutionWorker:o,getResolutionFromOldProgram:a,getResolved:s,canReuseResolutionsInFile:c,resolveToOwnAmbientModule:l}){if(!e.length)return _;if(!(0!==et||l&&n.ambientModuleNames.length))return o(e,t,void 0);let u,d,p,f;const m=c();for(let c=0;cp[d[t]]=e),p):g}function Ft(e){return{getCanonicalFileName:Tn,getCommonSourceDirectory:nt.getCommonSourceDirectory,getCompilerOptions:nt.getCompilerOptions,getCurrentDirectory:()=>xe,getSourceFile:nt.getSourceFile,getSourceFileByPath:nt.getSourceFileByPath,getSourceFiles:nt.getSourceFiles,isSourceFileFromExternalLibrary:At,getRedirectFromSourceFile:_n,isSourceOfProjectReferenceRedirect:fn,getSymlinkCache:qn,writeFile:e||Et,isEmitBlocked:Ot,shouldTransformImportCall:Hn,getEmitModuleFormatOfFile:$n,getDefaultResolutionModeForFile:Wn,getModeForResolutionAtIndex:Vn,readFile:e=>me.readFile(e),fileExists:e=>{const t=Tt(e);return!!jt(t)||!Be.has(t)&&me.fileExists(e)},realpath:He(me,me.realpath),useCaseSensitiveFileNames:()=>me.useCaseSensitiveFileNames(),getBuildInfo:()=>{var e;return null==(e=nt.getBuildInfo)?void 0:e.call(nt)},getSourceFileFromReference:(e,t)=>nt.getSourceFileFromReference(e,t),redirectTargetsMap:Me,getFileIncludeReasons:nt.getFileIncludeReasons,createHash:He(me,me.createHash),getModuleResolutionCache:()=>nt.getModuleResolutionCache(),trace:He(me,me.trace),getGlobalTypingsCacheLocation:nt.getGlobalTypingsCacheLocation}}function Et(e,t,n,r,i,o){me.writeFile(e,t,n,r,i,o)}function Pt(){return ze}function At(e){return!!fe.get(e.path)}function It(){return W||(W=pJ(nt))}function Ot(e){return Te.has(Tt(e))}function Lt(e){return jt(Tt(e))}function jt(e){return Re.get(e)||void 0}function Mt(e,t,n){return Es(e?t(e,n):L(nt.getSourceFiles(),e=>(n&&n.throwIfCancellationRequested(),t(e,n))))}function Rt(e){var t;if(mT(e,P,nt))return _;const n=Y.getCombinedDiagnostics(nt).getDiagnostics(e.fileName);return(null==(t=e.commentDirectives)?void 0:t.length)?Vt(e,e.commentDirectives,n).diagnostics:n}function Bt(e){return Im(e)?(e.additionalSyntacticDiagnostics||(e.additionalSyntacticDiagnostics=function(e){return zt(()=>{const t=[];return n(e,e),oO(e,n,r),t;function n(e,n){switch(n.kind){case 170:case 173:case 175:if(n.questionToken===e)return t.push(a(e,fa.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),"skip";case 174:case 177:case 178:case 179:case 219:case 263:case 220:case 261:if(n.type===e)return t.push(a(e,fa.Type_annotations_can_only_be_used_in_TypeScript_files)),"skip"}switch(e.kind){case 274:if(e.isTypeOnly)return t.push(a(n,fa._0_declarations_can_only_be_used_in_TypeScript_files,"import type")),"skip";break;case 279:if(e.isTypeOnly)return t.push(a(e,fa._0_declarations_can_only_be_used_in_TypeScript_files,"export type")),"skip";break;case 277:case 282:if(e.isTypeOnly)return t.push(a(e,fa._0_declarations_can_only_be_used_in_TypeScript_files,jE(e)?"import...type":"export...type")),"skip";break;case 272:return t.push(a(e,fa.import_can_only_be_used_in_TypeScript_files)),"skip";case 278:if(e.isExportEquals)return t.push(a(e,fa.export_can_only_be_used_in_TypeScript_files)),"skip";break;case 299:if(119===e.token)return t.push(a(e,fa.implements_clauses_can_only_be_used_in_TypeScript_files)),"skip";break;case 265:const r=Ia(120);return pn.assertIsDefined(r),t.push(a(e,fa._0_declarations_can_only_be_used_in_TypeScript_files,r)),"skip";case 268:const i=32&e.flags?Ia(145):Ia(144);return pn.assertIsDefined(i),t.push(a(e,fa._0_declarations_can_only_be_used_in_TypeScript_files,i)),"skip";case 266:return t.push(a(e,fa.Type_aliases_can_only_be_used_in_TypeScript_files)),"skip";case 177:case 175:case 263:return e.body?void 0:(t.push(a(e,fa.Signature_declarations_can_only_be_used_in_TypeScript_files)),"skip");case 267:const o=pn.checkDefined(Ia(94));return t.push(a(e,fa._0_declarations_can_only_be_used_in_TypeScript_files,o)),"skip";case 236:return t.push(a(e,fa.Non_null_assertions_can_only_be_used_in_TypeScript_files)),"skip";case 235:return t.push(a(e.type,fa.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 239:return t.push(a(e.type,fa.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 217:pn.fail()}}function r(e,n){if(QA(n)){const e=x(n.modifiers,ED);e&&t.push(a(e,fa.Decorators_are_not_valid_here))}else if(PI(n)&&n.modifiers){const e=S(n.modifiers,ED);if(e>=0)if(FD(n)&&!P.experimentalDecorators)t.push(a(n.modifiers[e],fa.Decorators_are_not_valid_here));else if(hE(n)){const r=S(n.modifiers,pD);if(r>=0){const i=S(n.modifiers,fD);if(e>r&&i>=0&&e=0&&e=0&&t.push(uT(a(n.modifiers[i],fa.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),a(n.modifiers[e],fa.Decorator_used_before_export_here)))}}}}switch(n.kind){case 264:case 232:case 175:case 177:case 178:case 179:case 219:case 263:case 220:if(e===n.typeParameters)return t.push(o(e,fa.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)),"skip";case 244:if(e===n.modifiers)return i(n.modifiers,244===n.kind),"skip";break;case 173:if(e===n.modifiers){for(const n of e)r_(n)&&126!==n.kind&&129!==n.kind&&t.push(a(n,fa.The_0_modifier_can_only_be_used_in_TypeScript_files,Ia(n.kind)));return"skip"}break;case 170:if(e===n.modifiers&&H(e,r_))return t.push(o(e,fa.Parameter_modifiers_can_only_be_used_in_TypeScript_files)),"skip";break;case 214:case 215:case 234:case 286:case 287:case 216:if(e===n.typeArguments)return t.push(o(e,fa.Type_arguments_can_only_be_used_in_TypeScript_files)),"skip"}}function i(e,n){for(const r of e)switch(r.kind){case 87:if(n)continue;case 125:case 123:case 124:case 148:case 138:case 128:case 164:case 103:case 147:t.push(a(r,fa.The_0_modifier_can_only_be_used_in_TypeScript_files,Ia(r.kind)))}}function o(t,n,...r){const i=t.pos;return ek(e,i,t.end-i,n,...r)}function a(t,n,...r){return Vp(e,t,n,...r)}})}(e)),G(e.additionalSyntacticDiagnostics,e.parseDiagnostics)):e.parseDiagnostics}function zt(e){try{return e()}catch(e){throw e instanceof Nr&&(W=void 0),e}}function qt(e,t,n){if(n)return Ut(e,t,n);let r=null==X?void 0:X.get(e.path);return r||(X??(X=new Map)).set(e.path,r=Ut(e,t)),r}function Ut(e,t,n){return zt(()=>{if(mT(e,P,nt))return _;const r=It();pn.assert(!!e.bindDiagnostics);const i=1===e.scriptKind||2===e.scriptKind,o=Cd(e,P.checkJs),a=i&&sT(e,P);let s=e.bindDiagnostics,c=r.getDiagnostics(e,t,n);return o&&(s=D(s,e=>WV.has(e.code)),c=D(c,e=>WV.has(e.code))),function(e,t,n,...r){var i;const o=O(r);if(!t||!(null==(i=e.commentDirectives)?void 0:i.length))return o;const{diagnostics:a,directives:s}=Vt(e,e.commentDirectives,o);if(n)return a;for(const t of s.getUnusedExpectations())a.push(Qp(e,t.range,fa.Unused_ts_expect_error_directive));return a}(e,!o,!!n,s,c,a?e.jsDocDiagnostics:void 0)})}function Vt(e,t,n){const r=Vd(e,t),i=n.filter(e=>-1===function(e,t){const{file:n,start:r}=e;if(!n)return-1;const i=za(n);let o=qa(i,r).line-1;for(;o>=0;){if(t.markUsed(o))return o;const e=n.text.slice(i[o],i[o+1]).trim();if(""!==e&&!/^\s*\/\/.*$/.test(e))return-1;o--}return-1}(e,r));return{diagnostics:i,directives:r}}function Wt(e,t){let n=null==Q?void 0:Q.get(e.path);return n||(Q??(Q=new Map)).set(e.path,n=function(e,t){return zt(()=>{const n=It().getEmitResolver(e,t);return Jq(Ft(ot),n,e)||_})}(e,t)),n}function $t(e,t){return e.isDeclarationFile?_:Wt(e,t)}function Ht(e,t,n,r){tn(Vo(e),t,n,void 0,r)}function Kt(e,t){return e.fileName===t.fileName}function Gt(e,t){return 80===e.kind?80===t.kind&&e.escapedText===t.escapedText:11===t.kind&&e.text===t.text}function Xt(e,t){const n=bw.createStringLiteral(e),r=bw.createImportDeclaration(void 0,void 0,n);return Fw(r,2),IT(n,r),IT(r,t),n.flags&=-17,r.flags&=-17,n}function Zt(e){if(e.imports)return;const t=Im(e),n=uO(e);let r,i,o;if(t||!e.isDeclarationFile&&(Nk(P)||uO(e))){P.importHelpers&&(r=[Xt(Hu,e)]);const t=eS(Zk(P,e),P);t&&(r||(r=[])).push(Xt(t,e))}for(const t of e.statements)a(t,!1);return(4194304&e.flags||t)&&IC(e,!0,!0,(e,t)=>{OT(e,!1),r=ae(r,t)}),e.imports=r||_,e.moduleAugmentations=i||_,void(e.ambientModuleNames=o||_);function a(t,s){if(Ap(t)){const n=wg(t);!(n&&KN(n)&&n.text)||s&&Fs(n.text)||(OT(t,!1),r=ae(r,n),Le||0!==ue||e.isDeclarationFile||(Qt(n.text,"node:")&&!PC.has(n.text)?Le=!0:void 0===Le&&EC.has(n.text)&&(Le=!1)))}else if(xE(t)&&dp(t)&&(s||Av(t,128)||e.isDeclarationFile)){t.name.parent=t;const r=$h(t.name);if(n||s&&!Fs(r))(i||(i=[])).push(t.name);else if(!s){e.isDeclarationFile&&(o||(o=[])).push(r);const n=t.body;if(n)for(const e of n.statements)a(e,!0)}}}}function en(e,t,n,r){if(Co(e)){const i=me.getCanonicalFileName(e);if(!P.allowNonTsExtensions&&!p(O(Se),e=>wo(i,e)))return void(n&&(BS(i)?n(fa.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option,e):n(fa.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1,e,"'"+O(ke).join("', '")+"'")));const o=t(e);if(n)if(o)RV(r)&&i===me.getCanonicalFileName(jt(r.file).fileName)&&n(fa.A_file_cannot_have_a_reference_to_itself);else{const t=_n(e);(null==t?void 0:t.outputDts)?n(fa.Output_file_0_has_not_been_built_from_source_file_1,t.outputDts,e):n(fa.File_0_not_found,e)}return o}{const r=P.allowNonTsExtensions&&t(e);if(r)return r;if(n&&P.allowNonTsExtensions)return void n(fa.File_0_not_found,e);const i=p(ke[0],n=>t(e+n));return n&&!i&&n(fa.Could_not_resolve_the_path_0_with_the_extensions_Colon_1,e,"'"+O(ke).join("', '")+"'"),i}}function tn(e,t,n,r,i){en(e,e=>on(e,t,n,i,r),(e,...t)=>Dn(void 0,i,e,t),i)}function nn(e,t){return tn(e,!1,!1,void 0,t)}function rn(e,t,n){!RV(n)&&H(Y.getFileReasons().get(t.path),RV)?Dn(t,n,fa.Already_included_file_name_0_differs_from_file_name_1_only_in_casing,[t.fileName,e]):Dn(t,n,fa.File_name_0_differs_from_already_included_file_name_1_only_in_casing,[e,t.fileName])}function on(e,t,n,r,i){var o,a;null==(o=Gn)||o.push(Gn.Phase.Program,"findSourceFile",{fileName:e,isDefaultLib:t||void 0,fileIncludeKind:Dr[r.kind]});const s=function(e,t,n,r,i){var o,a;const s=Tt(e);if(We){let o=dn(s);if(!o&&me.realpath&&P.preserveSymlinks&&vO(e)&&e.includes(oR)){const t=Tt(me.realpath(e));t!==s&&(o=dn(t))}if(null==o?void 0:o.source){const a=on(o.source,t,n,r,i);return a&&cn(a,s,e,void 0),a}}const c=e;if(Re.has(s)){const n=Re.get(s),i=sn(n||void 0,r,!0);if(n&&i&&!1!==P.forceConsistentCasingInFileNames){const t=n.fileName;Tt(t)!==Tt(e)&&(e=(null==(o=_n(e))?void 0:o.outputDts)||e);$o(t,xe)!==$o(e,xe)&&rn(e,n,r)}return n&&fe.get(n.path)&&0===ue?(fe.set(n.path,!1),P.noResolve||(gn(n,t),hn(n)),P.noLib||Sn(n),pe.set(n.path,!1),Cn(n)):n&&pe.get(n.path)&&ue<_e&&(pe.set(n.path,!1),Cn(n)),n||void 0}let l;if(!We){const t=_n(e);if(null==t?void 0:t.outputDts){if(t.resolvedRef.commandLine.options.outFile)return;e=t.outputDts,l=Tt(t.outputDts)}}const _=an(e,Ne,me,P),u=me.getSourceFile(e,_,t=>Dn(void 0,r,fa.Cannot_read_file_0_Colon_1,[e,t]),Ye);if(i){const t=vd(i),n=Oe.get(t);if(n){const t=function(e,t,n,r,i,o,a){var s;const c=II.createRedirectedSourceFile({redirectTarget:e,unredirected:t});return c.fileName=n,c.path=r,c.resolvedPath=i,c.originalFileName=o,c.packageJsonLocations=(null==(s=a.packageJsonLocations)?void 0:s.length)?a.packageJsonLocations:void 0,c.packageJsonScope=a.packageJsonScope,fe.set(r,ue>0),c}(n,u,e,s,Tt(e),c,_);return Me.add(n.path,e),cn(t,s,e,l),sn(t,r,!1),je.set(s,yd(i)),q.push(t),t}u&&(Oe.set(t,u),je.set(s,yd(i)))}if(cn(u,s,e,l),u){if(fe.set(s,ue>0),u.fileName=e,u.path=s,u.resolvedPath=Tt(e),u.originalFileName=c,u.packageJsonLocations=(null==(a=_.packageJsonLocations)?void 0:a.length)?_.packageJsonLocations:void 0,u.packageJsonScope=_.packageJsonScope,sn(u,r,!1),me.useCaseSensitiveFileNames()){const t=dt(s),n=Je.get(t);n?rn(e,n,r):Je.set(t,u)}he=he||u.hasNoDefaultLib&&!n,P.noResolve||(gn(u,t),hn(u)),P.noLib||Sn(u),Cn(u),t?z.push(u):q.push(u),(K??(K=new Set)).add(u.path)}return u}(e,t,n,r,i);return null==(a=Gn)||a.pop(),s}function an(e,t,n,r){const i=VV(Uo(e,xe),null==t?void 0:t.getPackageJsonInfoCache(),n,r),o=Sk(r),a=yk(r);return"object"==typeof i?{...i,languageVersion:o,setExternalModuleIndicator:a,jsDocParsingMode:n.jsDocParsingMode}:{languageVersion:o,impliedNodeFormat:i,setExternalModuleIndicator:a,jsDocParsingMode:n.jsDocParsingMode}}function sn(e,t,n){return!(!e||n&&RV(t)&&(null==K?void 0:K.has(t.file)))&&(Y.getFileReasons().add(e.path,t),!0)}function cn(e,t,n,r){r?(ln(n,r,e),ln(n,t,e||!1)):ln(n,t,e)}function ln(e,t,n){Re.set(t,n),void 0!==n?Be.delete(t):Be.set(t,e)}function _n(e){return null==Ue?void 0:Ue.get(Tt(e))}function un(e){return RC(ze,e)}function dn(e){return null==Ve?void 0:Ve.get(e)}function fn(e){return We&&!!_n(e)}function mn(e){if(qe)return qe.get(e)||void 0}function gn(e,t){p(e.referencedFiles,(n,r)=>{tn(QU(n.fileName,e.fileName),t,!1,void 0,{kind:4,file:e.path,index:r})})}function hn(e){const t=e.typeReferenceDirectives;if(!t.length)return;const n=(null==ce?void 0:ce.get(e.path))||Nt(t,e),r=MM();(se??(se=new Map)).set(e.path,r);for(let i=0;i{const r=MC(t);r?Ht(bn(r),!0,!0,{kind:7,file:e.path,index:n}):Y.addFileProcessingDiagnostic({kind:0,reason:{kind:7,file:e.path,index:n}})})}function Tn(e){return me.getCanonicalFileName(e)}function Cn(e){if(Zt(e),e.imports.length||e.moduleAugmentations.length){const t=rW(e),n=(null==oe?void 0:oe.get(e.path))||wt(t,e);pn.assert(n.length===t.length);const r=yn(e),i=MM();(ie??(ie=new Map)).set(e.path,i);for(let o=0;o_e,f=d&&!nW(r,a,e)&&!r.noResolve&&obU(a.commandLine,!me.useCaseSensitiveFileNames()));i.fileNames.forEach(n=>{if(vO(n))return;const r=Tt(n);let o;wo(n,".json")||(i.options.outFile?o=e:(o=dU(n,a.commandLine,!me.useCaseSensitiveFileNames(),t),Ve.set(Tt(o),{resolvedRef:a,source:n}))),Ue.set(r,{resolvedRef:a,outputDts:o})})}return i.projectReferences&&(a.references=i.projectReferences.map(wn)),a}function Nn(e,t,n,r){const i=new kn(e),o=new kn(t),a=new kn(j||s),c=function(){const e=P.ignoreDeprecations;if(e){if("5.0"===e)return new kn(e);B()}return kn.zero}(),l=!(1===o.compareTo(a)),_=!l&&-1===c.compareTo(i);(l||_)&&r((r,i,o)=>{l?void 0===i?n(r,i,o,fa.Option_0_has_been_removed_Please_remove_it_from_your_configuration,r):n(r,i,o,fa.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration,r,i):void 0===i?n(r,i,o,fa.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error,r,t,e):n(r,i,o,fa.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error,r,i,t,e)})}function Dn(e,t,n,r){Y.addFileProcessingDiagnostic({kind:1,file:e&&e.path,fileProcessingReason:t,diagnostic:n,args:r})}function Fn(e,t,n,...r){let i=!0;Pn(o=>{gF(o.initializer)&&Kf(o.initializer,e,e=>{const o=e.initializer;mF(o)&&o.elements.length>t&&(Y.addConfigDiagnostic(Vp(P.configFile,o.elements[t],n,...r)),i=!1)})}),i&&jn(n,...r)}function En(e,t,n,...r){let i=!0;Pn(o=>{gF(o.initializer)&&Bn(o.initializer,e,t,void 0,n,...r)&&(i=!1)}),i&&jn(n,...r)}function Pn(e){return qC(Mn(),"paths",e)}function An(e,t,n,r){Ln(!0,t,n,e,t,n,r)}function In(e,t,...n){Ln(!1,e,void 0,t,...n)}function On(e,t,n,...r){const i=Qf(e||P.configFile,"references",e=>mF(e.initializer)?e.initializer:void 0);i&&i.elements.length>t?Y.addConfigDiagnostic(Vp(e||P.configFile,i.elements[t],n,...r)):Y.addConfigDiagnostic(nk(n,...r))}function Ln(e,t,n,r,...i){const o=Mn();(!o||!Bn(o,e,t,n,r,...i))&&jn(r,...i)}function jn(e,...t){const n=Rn();n?"messageText"in e?Y.addConfigDiagnostic(Wp(P.configFile,n.name,e)):Y.addConfigDiagnostic(Vp(P.configFile,n.name,e,...t)):"messageText"in e?Y.addConfigDiagnostic(rk(e)):Y.addConfigDiagnostic(nk(e,...t))}function Mn(){if(void 0===Ce){const e=Rn();Ce=e&&rt(e.initializer,gF)||!1}return Ce||void 0}function Rn(){return void 0===we&&(we=Kf(Gf(P.configFile),"compilerOptions",lt)||!1),we||void 0}function Bn(e,t,n,r,i,...o){let a=!1;return Kf(e,n,e=>{"messageText"in i?Y.addConfigDiagnostic(Wp(P.configFile,t?e.name:e.initializer,i)):Y.addConfigDiagnostic(Vp(P.configFile,t?e.name:e.initializer,i,...o)),a=!0},r),a}function Jn(e,t){Te.set(Tt(e),!0),Y.addConfigDiagnostic(t)}function zn(e,t){return 0===ra(e,t,xe,!me.useCaseSensitiveFileNames())}function qn(){return me.getSymlinkCache?me.getSymlinkCache():(V||(V=nS(xe,Tn)),U&&!V.hasProcessedResolutions()&&V.setSymlinksFromResolutions(ct,_t,ee),V)}function Un(e,t){return TV(e,t,yn(e))}function Vn(e,t){return Un(e,iW(e,t))}function Wn(e){return XV(e,yn(e))}function $n(e){return KV(e,yn(e))}function Hn(e){return HV(e,yn(e))}function Kn(e,t){return e.resolutionMode||Wn(t)}}function HV(e,t){const n=Tk(t);return!(100<=n&&n<=199||200===n)&&KV(e,t)<5}function KV(e,t){return GV(e,t)??Tk(t)}function GV(e,t){var n,r;const i=Tk(t);return 100<=i&&i<=199?e.impliedNodeFormat:1!==e.impliedNodeFormat||"commonjs"!==(null==(n=e.packageJsonScope)?void 0:n.contents.packageJsonContent.type)&&!No(e.fileName,[".cjs",".cts"])?99!==e.impliedNodeFormat||"module"!==(null==(r=e.packageJsonScope)?void 0:r.contents.packageJsonContent.type)&&!No(e.fileName,[".mjs",".mts"])?void 0:99:1}function XV(e,t){return vk(t)?GV(e,t):void 0}var QV={diagnostics:_,sourceMaps:void 0,emittedFiles:void 0,emitSkipped:!0};function YV(e,t,n,r){const i=e.getCompilerOptions();if(i.noEmit)return t?QV:e.emitBuildInfo(n,r);if(!i.noEmitOnError)return;let o,a=[...e.getOptionsDiagnostics(r),...e.getSyntacticDiagnostics(t,r),...e.getGlobalDiagnostics(r),...e.getSemanticDiagnostics(t,r)];if(0===a.length&&Ik(e.getCompilerOptions())&&(a=e.getDeclarationDiagnostics(void 0,r)),a.length){if(!t){const t=e.emitBuildInfo(n,r);t.diagnostics&&(a=[...a,...t.diagnostics]),o=t.emittedFiles}return{diagnostics:a,sourceMaps:void 0,emittedFiles:o,emitSkipped:!0}}}function ZV(e,t){return D(e,e=>!e.skippedOn||!t[e.skippedOn])}function eW(e,t=e){return{fileExists:e=>t.fileExists(e),readDirectory:(e,n,r,i,o)=>(pn.assertIsDefined(t.readDirectory,"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"),t.readDirectory(e,n,r,i,o)),readFile:e=>t.readFile(e),directoryExists:He(t,t.directoryExists),getDirectories:He(t,t.getDirectories),realpath:He(t,t.realpath),useCaseSensitiveFileNames:e.useCaseSensitiveFileNames(),getCurrentDirectory:()=>e.getCurrentDirectory(),onUnRecoverableConfigFileDiagnostic:e.onUnRecoverableConfigFileDiagnostic||ct,trace:e.trace?t=>e.trace(t):void 0}}function tW(e){return iH(e.path)}function nW(e,{extension:t},{isDeclarationFile:n}){switch(t){case".ts":case".d.ts":case".mts":case".d.mts":case".cts":case".d.cts":return;case".tsx":return r();case".jsx":return r()||i();case".js":case".mjs":case".cjs":return i();case".json":return Ak(e)?void 0:fa.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used;default:return n||e.allowArbitraryExtensions?void 0:fa.Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set}function r(){return e.jsx?void 0:fa.Module_0_was_resolved_to_1_but_jsx_is_not_set}function i(){return Mk(e)||!Wk(e,"noImplicitAny")?void 0:fa.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type}}function rW({imports:e,moduleAugmentations:t}){const n=e.map(e=>e);for(const e of t)11===e.kind&&n.push(e);return n}function iW({imports:e,moduleAugmentations:t},n){if(nn,getFileReasons:()=>c,getCommonSourceDirectory:()=>r,getConfigDiagnostics:()=>i,getLazyConfigDiagnostics:()=>o,getCombinedDiagnostics:e=>t||(t=fy(),null==i||i.getDiagnostics().forEach(e=>t.add(e)),null==n||n.forEach(n=>{switch(n.kind){case 1:return t.add(l(e,n.file&&e.getSourceFileByPath(n.file),n.fileProcessingReason,n.diagnostic,n.args||_));case 0:return t.add(function(e,{reason:t}){const{file:n,pos:r,end:i}=JV(e,t),o=jC(n.libReferenceDirectives[t.index]),a=Mt(Jt(Yt(o,"lib."),".d.ts"),OO,lt);return ek(n,pn.checkDefined(r),pn.checkDefined(i)-r,a?fa.Cannot_find_lib_definition_for_0_Did_you_mean_1:fa.Cannot_find_lib_definition_for_0,o,a)}(e,n));case 2:return n.diagnostics.forEach(e=>t.add(e));default:pn.assertNever(n)}}),null==o||o.forEach(({file:n,diagnostic:r,args:i})=>t.add(l(e,n,void 0,r,i))),a=void 0,s=void 0,t)};function l(t,n,r,i,o){let l,u,d,p,f,m;const g=n&&c.get(n.path);let h=RV(r)?r:void 0,y=n&&(null==a?void 0:a.get(n.path));y?(y.fileIncludeReasonDetails?(l=new Set(g),null==g||g.forEach(k)):null==g||g.forEach(x),f=y.redirectInfo):(null==g||g.forEach(x),f=n&&P$(n,t.getCompilerOptionsForFile(n))),r&&x(r);const v=(null==l?void 0:l.size)!==(null==g?void 0:g.length);h&&1===(null==l?void 0:l.size)&&(l=void 0),l&&y&&(y.details&&!v?m=ik(y.details,i,...o??_):y.fileIncludeReasonDetails&&(v?u=S()?ae(y.fileIncludeReasonDetails.next.slice(0,g.length),u[0]):[...y.fileIncludeReasonDetails.next,u[0]]:S()?u=y.fileIncludeReasonDetails.next.slice(0,g.length):p=y.fileIncludeReasonDetails)),m||(p||(p=l&&ik(u,fa.The_file_is_in_the_program_because_Colon)),m=ik(f?p?[p,...f]:f:p,i,...o||_)),n&&(y?(!y.fileIncludeReasonDetails||!v&&p)&&(y.fileIncludeReasonDetails=p):(a??(a=new Map)).set(n.path,y={fileIncludeReasonDetails:p,redirectInfo:f}),y.details||v||(y.details=m.next));const b=h&&JV(t,h);return b&&BV(b)?Kp(b.file,b.pos,b.end-b.pos,m,d):rk(m,d);function x(e){(null==l?void 0:l.has(e))||((l??(l=new Set)).add(e),(u??(u=[])).push(O$(t,e)),k(e))}function k(n){!h&&RV(n)?h=n:h!==n&&(d=ae(d,function(t,n){let r=null==s?void 0:s.get(n);void 0===r&&(s??(s=new Map)).set(n,r=function(t,n){if(RV(n)){const e=JV(t,n);let r;switch(n.kind){case 3:r=fa.File_is_included_via_import_here;break;case 4:r=fa.File_is_included_via_reference_here;break;case 5:r=fa.File_is_included_via_type_library_reference_here;break;case 7:r=fa.File_is_included_via_library_reference_here;break;default:pn.assertNever(n)}return BV(e)?ek(e.file,e.pos,e.end-e.pos,r):void 0}const r=t.getCurrentDirectory(),i=t.getRootFileNames(),o=t.getCompilerOptions();if(!o.configFile)return;let a,s;switch(n.kind){case 0:if(!o.configFile.configFileSpecs)return;const c=Uo(i[n.index],r),l=A$(t,c);if(l){a=Xf(o.configFile,"files",l),s=fa.File_is_matched_by_files_list_specified_here;break}const _=I$(t,c);if(!_||!tt(_))return;a=Xf(o.configFile,"include",_),s=fa.File_is_matched_by_include_pattern_specified_here;break;case 1:case 2:const u=t.getResolvedProjectReferences(),d=t.getProjectReferences(),p=pn.checkDefined(null==u?void 0:u[n.index]),f=BC(d,u,(e,t,n)=>e===p?{sourceFile:(null==t?void 0:t.sourceFile)||o.configFile,index:n}:void 0);if(!f)return;const{sourceFile:m,index:g}=f,h=Qf(m,"references",e=>mF(e.initializer)?e.initializer:void 0);return h&&h.elements.length>g?Vp(m,h.elements[g],2===n.kind?fa.File_is_output_from_referenced_project_specified_here:fa.File_is_source_from_referenced_project_specified_here):void 0;case 8:if(!o.types)return;a=JC(e(),"types",n.typeReference),s=fa.File_is_entry_point_of_type_library_specified_here;break;case 6:if(void 0!==n.index){a=JC(e(),"lib",o.lib[n.index]),s=fa.File_is_library_specified_here;break}const y=$k(Sk(o));a=y?zC(e(),"target",y):void 0,s=fa.File_is_default_library_for_target_specified_here;break;default:pn.assertNever(n)}return a&&Vp(o.configFile,a,s)}(t,n)??!1);return r||void 0}(t,n)))}function S(){var e;return(null==(e=y.fileIncludeReasonDetails.next)?void 0:e.length)!==(null==g?void 0:g.length)}}}function aW(e,t,n,r,i,o){const a=[],{emitSkipped:s,diagnostics:c}=e.emit(t,function(e,t,n){a.push({name:e,writeByteOrderMark:n,text:t})},r,n,i,o);return{outputFiles:a,emitSkipped:s,diagnostics:c}}var sW,cW=(e=>(e[e.ComputedDts=0]="ComputedDts",e[e.StoredSignatureAtEmit=1]="StoredSignatureAtEmit",e[e.UsedVersion=2]="UsedVersion",e))(cW||{});(e=>{function t(){return function(e,t,r){const i={getKeys:e=>t.get(e),getValues:t=>e.get(t),keys:()=>e.keys(),size:()=>e.size,deleteKey:i=>{(r||(r=new Set)).add(i);const o=e.get(i);return!!o&&(o.forEach(e=>n(t,e,i)),e.delete(i),!0)},set:(o,a)=>{null==r||r.delete(o);const s=e.get(o);return e.set(o,a),null==s||s.forEach(e=>{a.has(e)||n(t,e,o)}),a.forEach(e=>{(null==s?void 0:s.has(e))||function(e,t,n){let r=e.get(t);r||(r=new Set,e.set(t,r));r.add(n)}(t,e,o)}),i}};return i}(new Map,new Map,void 0)}function n(e,t,n){const r=e.get(t);return!!(null==r?void 0:r.delete(n))&&(r.size||e.delete(t),!0)}function r(e,t){const n=e.getSymbolAtLocation(t);return n&&function(e){return J(e.declarations,e=>{var t;return null==(t=Sd(e))?void 0:t.resolvedPath})}(n)}function i(e,t,n,r){var i;return Ho((null==(i=e.getRedirectFromSourceFile(t))?void 0:i.outputDts)||t,n,r)}function o(e,t,n){let o;if(t.imports&&t.imports.length>0){const n=e.getTypeChecker();for(const e of t.imports){const t=r(n,e);null==t||t.forEach(c)}}const a=Ao(t.resolvedPath);if(t.referencedFiles&&t.referencedFiles.length>0)for(const r of t.referencedFiles){c(i(e,r.fileName,a,n))}if(e.forEachResolvedTypeReferenceDirective(({resolvedTypeReferenceDirective:t})=>{if(!t)return;const r=t.resolvedFileName;c(i(e,r,a,n))},t),t.moduleAugmentations.length){const n=e.getTypeChecker();for(const e of t.moduleAugmentations){if(!KN(e))continue;const t=n.getSymbolAtLocation(e);t&&s(t)}}for(const t of e.getTypeChecker().getAmbientModules())t.declarations&&t.declarations.length>1&&s(t);return o;function s(e){if(e.declarations)for(const n of e.declarations){const e=Sd(n);e&&e!==t&&c(e.resolvedPath)}}function c(e){(o||(o=new Set)).add(e)}}function a(e,t){return t&&!t.referencedMap==!e}function s(e){return 0===e.module||e.outFile?void 0:t()}function c(e,t,n,r,i){const o=t.getSourceFileByPath(n);return o?u(e,t,o,r,i)?(e.referencedMap?h:g)(e,t,o,r,i):[o]:_}function l(e,t,n,r,i){e.emit(t,(n,o,a,s,c,l)=>{pn.assert(vO(n),`File extension for signature expected to be dts: Got:: ${n}`),i(zW(e,t,o,r,l),c)},n,2,void 0,!0)}function u(e,t,n,r,i,o=e.useFileVersionAsSignature){var a;if(null==(a=e.hasCalledUpdateShapeSignature)?void 0:a.has(n.resolvedPath))return!1;const s=e.fileInfos.get(n.resolvedPath),c=s.signature;let _;return n.isDeclarationFile||o||l(t,n,r,i,t=>{_=t,i.storeSignatureInfo&&(e.signatureInfo??(e.signatureInfo=new Map)).set(n.resolvedPath,0)}),void 0===_&&(_=n.version,i.storeSignatureInfo&&(e.signatureInfo??(e.signatureInfo=new Map)).set(n.resolvedPath,2)),(e.oldSignatures||(e.oldSignatures=new Map)).set(n.resolvedPath,c||!1),(e.hasCalledUpdateShapeSignature||(e.hasCalledUpdateShapeSignature=new Set)).add(n.resolvedPath),s.signature=_,_!==c}function d(e,t){if(!e.allFileNames){const n=t.getSourceFiles();e.allFileNames=n===_?_:n.map(e=>e.fileName)}return e.allFileNames}function p(e,t){const n=e.referencedMap.getKeys(t);return n?je(n.keys()):[]}function f(e){return function(e){return H(e.moduleAugmentations,e=>hp(e.parent))}(e)||!rf(e)&&!of(e)&&!function(e){for(const t of e.statements)if(!pp(t))return!1;return!0}(e)}function m(e,t,n){if(e.allFilesExcludingDefaultLibraryFile)return e.allFilesExcludingDefaultLibraryFile;let r;n&&i(n);for(const e of t.getSourceFiles())e!==n&&i(e);return e.allFilesExcludingDefaultLibraryFile=r||_,e.allFilesExcludingDefaultLibraryFile;function i(e){t.isSourceFileDefaultLibrary(e)||(r||(r=[])).push(e)}}function g(e,t,n){const r=t.getCompilerOptions();return r&&r.outFile?[n]:m(e,t,n)}function h(e,t,n,r,i){if(f(n))return m(e,t,n);const o=t.getCompilerOptions();if(o&&(Nk(o)||o.outFile))return[n];const a=new Map;a.set(n.resolvedPath,n);const s=p(e,n.resolvedPath);for(;s.length>0;){const n=s.pop();if(!a.has(n)){const o=t.getSourceFileByPath(n);a.set(n,o),o&&u(e,t,o,r,i)&&s.push(...p(e,o.resolvedPath))}}return je(z(a.values(),e=>e))}e.createManyToManyPathMap=t,e.canReuseOldState=a,e.createReferencedMap=s,e.create=function(e,t,n){var r,i;const c=new Map,l=e.getCompilerOptions(),_=s(l),u=a(_,t);e.getTypeChecker();for(const n of e.getSourceFiles()){const a=pn.checkDefined(n.version,"Program intended to be used with Builder should have source files with versions set"),s=u?null==(r=t.oldSignatures)?void 0:r.get(n.resolvedPath):void 0,d=void 0===s?u?null==(i=t.fileInfos.get(n.resolvedPath))?void 0:i.signature:void 0:s||void 0;if(_){const t=o(e,n,e.getCanonicalFileName);t&&_.set(n.resolvedPath,t)}c.set(n.resolvedPath,{version:a,signature:d,affectsGlobalScope:l.outFile?void 0:f(n)||void 0,impliedFormat:n.impliedNodeFormat})}return{fileInfos:c,referencedMap:_,useFileVersionAsSignature:!n&&!u}},e.releaseCache=function(e){e.allFilesExcludingDefaultLibraryFile=void 0,e.allFileNames=void 0},e.getFilesAffectedBy=function(e,t,n,r,i){var o;const a=c(e,t,n,r,i);return null==(o=e.oldSignatures)||o.clear(),a},e.getFilesAffectedByWithOldState=c,e.updateSignatureOfFile=function(e,t,n){e.fileInfos.get(n).signature=t,(e.hasCalledUpdateShapeSignature||(e.hasCalledUpdateShapeSignature=new Set)).add(n)},e.computeDtsSignature=l,e.updateShapeSignature=u,e.getAllDependencies=function(e,t,n){if(t.getCompilerOptions().outFile)return d(e,t);if(!e.referencedMap||f(n))return d(e,t);const r=new Set,i=[n.resolvedPath];for(;i.length;){const t=i.pop();if(!r.has(t)){r.add(t);const n=e.referencedMap.getValues(t);if(n)for(const e of n.keys())i.push(e)}}return je(z(r.keys(),e=>{var n;return(null==(n=t.getSourceFileByPath(e))?void 0:n.fileName)??e}))},e.getReferencedByPaths=p,e.getAllFilesExcludingDefaultLibraryFile=m})(sW||(sW={}));var lW=(e=>(e[e.None=0]="None",e[e.Js=1]="Js",e[e.JsMap=2]="JsMap",e[e.JsInlineMap=4]="JsInlineMap",e[e.DtsErrors=8]="DtsErrors",e[e.DtsEmit=16]="DtsEmit",e[e.DtsMap=32]="DtsMap",e[e.Dts=24]="Dts",e[e.AllJs=7]="AllJs",e[e.AllDtsEmit=48]="AllDtsEmit",e[e.AllDts=56]="AllDts",e[e.All=63]="All",e))(lW||{});function _W(e){return void 0!==e.program}function uW(e){let t=1;return e.sourceMap&&(t|=2),e.inlineSourceMap&&(t|=4),Ik(e)&&(t|=24),e.declarationMap&&(t|=32),e.emitDeclarationOnly&&(t&=56),t}function dW(e,t){const n=t&&(nt(t)?t:uW(t)),r=nt(e)?e:uW(e);if(n===r)return 0;if(!n||!r)return r;const i=n^r;let o=0;return 7&i&&(o=7&r),8&i&&(o|=8&r),48&i&&(o|=48&r),o}function pW(e,t){var n,r;const i=sW.create(e,t,!1);i.program=e;const o=e.getCompilerOptions();i.compilerOptions=o;const a=o.outFile;i.semanticDiagnosticsPerFile=new Map,a&&o.composite&&(null==t?void 0:t.outSignature)&&a===t.compilerOptions.outFile&&(i.outSignature=t.outSignature&&fW(o,t.compilerOptions,t.outSignature)),i.changedFilesSet=new Set,i.latestChangedDtsFile=o.composite?null==t?void 0:t.latestChangedDtsFile:void 0,i.checkPending=!!i.compilerOptions.noCheck||void 0;const s=sW.canReuseOldState(i.referencedMap,t),c=s?t.compilerOptions:void 0;let l=s&&!Kk(o,c);const _=o.composite&&(null==t?void 0:t.emitSignatures)&&!a&&!Xk(o,t.compilerOptions);let u=!0;s?(null==(n=t.changedFilesSet)||n.forEach(e=>i.changedFilesSet.add(e)),!a&&(null==(r=t.affectedFilesPendingEmit)?void 0:r.size)&&(i.affectedFilesPendingEmit=new Map(t.affectedFilesPendingEmit),i.seenAffectedFiles=new Set),i.programEmitPending=t.programEmitPending,a&&i.changedFilesSet.size&&(l=!1,u=!1),i.hasErrorsFromOldState=t.hasErrors):i.buildInfoEmitPending=Lk(o);const d=i.referencedMap,p=s?t.referencedMap:void 0,f=l&&!o.skipLibCheck==!c.skipLibCheck,m=f&&!o.skipDefaultLibCheck==!c.skipDefaultLibCheck;if(i.fileInfos.forEach((n,r)=>{var a;let c,h;if(!s||!(c=t.fileInfos.get(r))||c.version!==n.version||c.impliedFormat!==n.impliedFormat||(y=h=d&&d.getValues(r),v=p&&p.getValues(r),y!==v&&(void 0===y||void 0===v||y.size!==v.size||cd(y,e=>!v.has(e))))||h&&cd(h,e=>!i.fileInfos.has(e)&&t.fileInfos.has(e)))g(r);else{const n=e.getSourceFileByPath(r),o=u?null==(a=t.emitDiagnosticsPerFile)?void 0:a.get(r):void 0;if(o&&(i.emitDiagnosticsPerFile??(i.emitDiagnosticsPerFile=new Map)).set(r,t.hasReusableDiagnostic?yW(o,r,e):mW(o,e)),l){if(n.isDeclarationFile&&!f)return;if(n.hasNoDefaultLib&&!m)return;const o=t.semanticDiagnosticsPerFile.get(r);o&&(i.semanticDiagnosticsPerFile.set(r,t.hasReusableDiagnostic?yW(o,r,e):mW(o,e)),(i.semanticDiagnosticsFromOldState??(i.semanticDiagnosticsFromOldState=new Set)).add(r))}}var y,v;if(_){const e=t.emitSignatures.get(r);e&&(i.emitSignatures??(i.emitSignatures=new Map)).set(r,fW(o,t.compilerOptions,e))}}),s&&sd(t.fileInfos,(e,t)=>!i.fileInfos.has(t)&&(!!e.affectsGlobalScope||(i.buildInfoEmitPending=!0,!!a))))sW.getAllFilesExcludingDefaultLibraryFile(i,e,void 0).forEach(e=>g(e.resolvedPath));else if(c){const t=Gk(o,c)?uW(o):dW(o,c);0!==t&&(a?i.changedFilesSet.size||(i.programEmitPending=i.programEmitPending?i.programEmitPending|t:t):(e.getSourceFiles().forEach(e=>{i.changedFilesSet.has(e.resolvedPath)||UW(i,e.resolvedPath,t)}),pn.assert(!i.seenAffectedFiles||!i.seenAffectedFiles.size),i.seenAffectedFiles=i.seenAffectedFiles||new Set),i.buildInfoEmitPending=!0)}return s&&i.semanticDiagnosticsPerFile.size!==i.fileInfos.size&&t.checkPending!==i.checkPending&&(i.buildInfoEmitPending=!0),i;function g(e){i.changedFilesSet.add(e),a&&(l=!1,u=!1,i.semanticDiagnosticsFromOldState=void 0,i.semanticDiagnosticsPerFile.clear(),i.emitDiagnosticsPerFile=void 0),i.buildInfoEmitPending=!0,i.programEmitPending=void 0}}function fW(e,t,n){return!!e.declarationMap==!!t.declarationMap?n:tt(n)?[n]:n[0]}function mW(e,t){return e.length?I(e,e=>{if(tt(e.messageText))return e;const n=gW(e.messageText,e.file,t,e=>{var t;return null==(t=e.repopulateInfo)?void 0:t.call(e)});return n===e.messageText?e:{...e,messageText:n}}):e}function gW(e,t,n,r){const i=r(e);if(!0===i)return{...hd(t),next:hW(e.next,t,n,r)};if(i)return{...gd(t,n,i.moduleReference,i.mode,i.packageName||i.moduleReference),next:hW(e.next,t,n,r)};const o=hW(e.next,t,n,r);return o===e.next?e:{...e,next:o}}function hW(e,t,n,r){return I(e,e=>gW(e,t,n,r))}function yW(e,t,n){if(!e.length)return _;let r;return e.map(e=>{const r=vW(e,t,n,i);r.reportsUnnecessary=e.reportsUnnecessary,r.reportsDeprecated=e.reportDeprecated,r.source=e.source,r.skippedOn=e.skippedOn;const{relatedInformation:o}=e;return r.relatedInformation=o?o.length?o.map(e=>vW(e,t,n,i)):[]:void 0,r});function i(e){return r??(r=Ao(Uo(aU(n.getCompilerOptions()),n.getCurrentDirectory()))),Ho(e,r,n.getCanonicalFileName)}}function vW(e,t,n,r){const{file:i}=e,o=!1!==i?n.getSourceFileByPath(i?r(i):t):void 0;return{...e,file:o,messageText:tt(e.messageText)?e.messageText:gW(e.messageText,o,n,e=>e.info)}}function bW(e,t){pn.assert(!t||!e.affectedFiles||e.affectedFiles[e.affectedFilesIndex-1]!==t||!e.semanticDiagnosticsPerFile.has(t.resolvedPath))}function xW(e,t,n){for(var r;;){const{affectedFiles:i}=e;if(i){const o=e.seenAffectedFiles;let a=e.affectedFilesIndex;for(;a{const i=n?55&t:7&t;i?e.affectedFilesPendingEmit.set(r,i):e.affectedFilesPendingEmit.delete(r)}),e.programEmitPending)){const t=n?55&e.programEmitPending:7&e.programEmitPending;e.programEmitPending=t||void 0}}function SW(e,t,n,r){let i=dW(e,t);return n&&(i&=56),r&&(i&=8),i}function TW(e){return e?8:56}function CW(e){if(!e.cleanedDiagnosticsOfLibFiles){e.cleanedDiagnosticsOfLibFiles=!0;const t=e.program.getCompilerOptions();p(e.program.getSourceFiles(),n=>e.program.isSourceFileDefaultLibrary(n)&&!gT(n,t,e.program)&&DW(e,n.resolvedPath))}}function wW(e,t,n,r){if(DW(e,t.resolvedPath),e.allFilesExcludingDefaultLibraryFile===e.affectedFiles)return CW(e),void sW.updateShapeSignature(e,e.program,t,n,r);e.compilerOptions.assumeChangesOnlyAffectDirectDependencies||function(e,t,n,r){var i,o;if(!e.referencedMap||!e.changedFilesSet.has(t.resolvedPath))return;if(!FW(e,t.resolvedPath))return;if(Nk(e.compilerOptions)){const i=new Map;i.set(t.resolvedPath,!0);const o=sW.getReferencedByPaths(e,t.resolvedPath);for(;o.length>0;){const t=o.pop();if(!i.has(t)){if(i.set(t,!0),EW(e,t,!1,n,r))return;if(NW(e,t,!1,n,r),FW(e,t)){const n=e.program.getSourceFileByPath(t);o.push(...sW.getReferencedByPaths(e,n.resolvedPath))}}}}const a=new Set,s=!!(null==(i=t.symbol)?void 0:i.exports)&&!!sd(t.symbol.exports,n=>{if(128&n.flags)return!0;const r=_x(n,e.program.getTypeChecker());return r!==n&&(!!(128&r.flags)&&H(r.declarations,e=>Sd(e)===t))});null==(o=e.referencedMap.getKeys(t.resolvedPath))||o.forEach(t=>{if(EW(e,t,s,n,r))return!0;const i=e.referencedMap.getKeys(t);return i&&cd(i,t=>PW(e,t,s,a,n,r))})}(e,t,n,r)}function NW(e,t,n,r,i){if(DW(e,t),!e.changedFilesSet.has(t)){const o=e.program.getSourceFileByPath(t);o&&(sW.updateShapeSignature(e,e.program,o,r,i,!0),n?UW(e,t,uW(e.compilerOptions)):Ik(e.compilerOptions)&&UW(e,t,e.compilerOptions.declarationMap?56:24))}}function DW(e,t){return!e.semanticDiagnosticsFromOldState||(e.semanticDiagnosticsFromOldState.delete(t),e.semanticDiagnosticsPerFile.delete(t),!e.semanticDiagnosticsFromOldState.size)}function FW(e,t){const n=pn.checkDefined(e.oldSignatures).get(t)||void 0;return pn.checkDefined(e.fileInfos.get(t)).signature!==n}function EW(e,t,n,r,i){var o;return!!(null==(o=e.fileInfos.get(t))?void 0:o.affectsGlobalScope)&&(sW.getAllFilesExcludingDefaultLibraryFile(e,e.program,void 0).forEach(t=>NW(e,t.resolvedPath,n,r,i)),CW(e),!0)}function PW(e,t,n,r,i,o){var a;if(U(r,t)){if(EW(e,t,n,i,o))return!0;NW(e,t,n,i,o),null==(a=e.referencedMap.getKeys(t))||a.forEach(t=>PW(e,t,n,r,i,o))}}function AW(e,t,n,r){return e.compilerOptions.noCheck?_:G(function(e,t,n,r){r??(r=e.semanticDiagnosticsPerFile);const i=t.resolvedPath,o=r.get(i);if(o)return ZV(o,e.compilerOptions);const a=e.program.getBindAndCheckDiagnostics(t,n);return r.set(i,a),e.buildInfoEmitPending=!0,ZV(a,e.compilerOptions)}(e,t,n,r),e.program.getProgramDiagnostics(t))}function IW(e){var t;return!!(null==(t=e.options)?void 0:t.outFile)}function OW(e){return!!e.fileNames}function LW(e){void 0===e.hasErrors&&(Lk(e.compilerOptions)?e.hasErrors=!H(e.program.getSourceFiles(),t=>{var n,r;const i=e.semanticDiagnosticsPerFile.get(t.resolvedPath);return void 0===i||!!i.length||!!(null==(r=null==(n=e.emitDiagnosticsPerFile)?void 0:n.get(t.resolvedPath))?void 0:r.length)})&&(jW(e)||H(e.program.getSourceFiles(),t=>!!e.program.getProgramDiagnostics(t).length)):e.hasErrors=H(e.program.getSourceFiles(),t=>{var n,r;const i=e.semanticDiagnosticsPerFile.get(t.resolvedPath);return!!(null==i?void 0:i.length)||!!(null==(r=null==(n=e.emitDiagnosticsPerFile)?void 0:n.get(t.resolvedPath))?void 0:r.length)})||jW(e))}function jW(e){return!!(e.program.getConfigFileParsingDiagnostics().length||e.program.getSyntacticDiagnostics().length||e.program.getOptionsDiagnostics().length||e.program.getGlobalDiagnostics().length)}function MW(e){return LW(e),e.buildInfoEmitPending??(e.buildInfoEmitPending=!!e.hasErrorsFromOldState!=!!e.hasErrors)}var RW=(e=>(e[e.SemanticDiagnosticsBuilderProgram=0]="SemanticDiagnosticsBuilderProgram",e[e.EmitAndSemanticDiagnosticsBuilderProgram=1]="EmitAndSemanticDiagnosticsBuilderProgram",e))(RW||{});function BW(e,t,n,r,i,o){let a,s,c;return void 0===e?(pn.assert(void 0===t),a=n,c=r,pn.assert(!!c),s=c.getProgram()):Ze(e)?(c=r,s=$V({rootNames:e,options:t,host:n,oldProgram:c&&c.getProgramOrUndefined(),configFileParsingDiagnostics:i,projectReferences:o}),a=n):(s=e,a=t,c=n,i=r),{host:a,newProgram:s,oldProgram:c,configFileParsingDiagnostics:i||_}}function JW(e,t){return void 0!==(null==t?void 0:t.sourceMapUrlPos)?e.substring(0,t.sourceMapUrlPos):e}function zW(e,t,n,r,i){var o;let a;return n=JW(n,i),(null==(o=null==i?void 0:i.diagnostics)?void 0:o.length)&&(n+=i.diagnostics.map(n=>`${function(n){if(n.file.resolvedPath===t.resolvedPath)return`(${n.start},${n.length})`;void 0===a&&(a=Ao(t.resolvedPath));return`${Xo(sa(a,n.file.resolvedPath,e.getCanonicalFileName))}(${n.start},${n.length})`}(n)}${li[n.category]}${n.code}: ${s(n.messageText)}`).join("\n")),(r.createHash??Bi)(n);function s(e){return tt(e)?e:void 0===e?"":e.next?e.messageText+e.next.map(s).join("\n"):e.messageText}}function qW(e,{newProgram:t,host:n,oldProgram:r,configFileParsingDiagnostics:i}){let o=r&&r.state;if(o&&t===o.program&&i===t.getConfigFileParsingDiagnostics())return t=void 0,o=void 0,r;const a=pW(t,o);t.getBuildInfo=()=>function(e){var t,n;const r=e.program.getCurrentDirectory(),i=Ao(Uo(aU(e.compilerOptions),r)),o=e.latestChangedDtsFile?b(e.latestChangedDtsFile):void 0,a=[],s=new Map,l=new Set(e.program.getRootFileNames().map(t=>Ho(t,r,e.program.getCanonicalFileName)));if(LW(e),!Lk(e.compilerOptions))return{root:je(l,e=>x(e)),errors:!!e.hasErrors||void 0,checkPending:e.checkPending,version:c};const u=[];if(e.compilerOptions.outFile){const t=je(e.fileInfos.entries(),([e,t])=>(T(e,k(e)),t.impliedFormat?{version:t.version,impliedFormat:t.impliedFormat,signature:void 0,affectsGlobalScope:void 0}:t.version));return{fileNames:a,fileInfos:t,root:u,resolvedRoot:C(),options:w(e.compilerOptions),semanticDiagnosticsPerFile:e.changedFilesSet.size?void 0:D(),emitDiagnosticsPerFile:F(),changeFileSet:O(),outSignature:e.outSignature,latestChangedDtsFile:o,pendingEmit:e.programEmitPending?e.programEmitPending!==uW(e.compilerOptions)&&e.programEmitPending:void 0,errors:!!e.hasErrors||void 0,checkPending:e.checkPending,version:c}}let d,f,m;const g=je(e.fileInfos.entries(),([t,n])=>{var r,i;const o=k(t);T(t,o),pn.assert(a[o-1]===x(t));const s=null==(r=e.oldSignatures)?void 0:r.get(t),c=void 0!==s?s||void 0:n.signature;if(e.compilerOptions.composite){const n=e.program.getSourceFileByPath(t);if(!of(n)&&ev(n,e.program)){const n=null==(i=e.emitSignatures)?void 0:i.get(t);n!==c&&(m=ae(m,void 0===n?o:[o,tt(n)||n[0]!==c?n:_]))}}return n.version===c?n.affectsGlobalScope||n.impliedFormat?{version:n.version,signature:void 0,affectsGlobalScope:n.affectsGlobalScope,impliedFormat:n.impliedFormat}:n.version:void 0!==c?void 0===s?n:{version:n.version,signature:c,affectsGlobalScope:n.affectsGlobalScope,impliedFormat:n.impliedFormat}:{version:n.version,signature:!1,affectsGlobalScope:n.affectsGlobalScope,impliedFormat:n.impliedFormat}});let h;(null==(t=e.referencedMap)?void 0:t.size())&&(h=je(e.referencedMap.keys()).sort(Nt).map(t=>[k(t),S(e.referencedMap.getValues(t))]));const y=D();let v;if(null==(n=e.affectedFilesPendingEmit)?void 0:n.size){const t=uW(e.compilerOptions),n=new Set;for(const r of je(e.affectedFilesPendingEmit.keys()).sort(Nt))if(U(n,r)){const n=e.program.getSourceFileByPath(r);if(!n||!ev(n,e.program))continue;const i=k(r),o=e.affectedFilesPendingEmit.get(r);v=ae(v,o===t?i:24===o?[i]:[i,o])}}return{fileNames:a,fileIdsList:d,fileInfos:g,root:u,resolvedRoot:C(),options:w(e.compilerOptions),referencedMap:h,semanticDiagnosticsPerFile:y,emitDiagnosticsPerFile:F(),changeFileSet:O(),affectedFilesPendingEmit:v,emitSignatures:m,latestChangedDtsFile:o,errors:!!e.hasErrors||void 0,checkPending:e.checkPending,version:c};function b(e){return x(Uo(e,r))}function x(t){return Xo(sa(i,t,e.program.getCanonicalFileName))}function k(e){let t=s.get(e);return void 0===t&&(a.push(x(e)),s.set(e,t=a.length)),t}function S(e){const t=je(e.keys(),k).sort(xt),n=t.join();let r=null==f?void 0:f.get(n);return void 0===r&&(d=ae(d,t),(f??(f=new Map)).set(n,r=d.length)),r}function T(t,n){const r=e.program.getSourceFile(t);if(!e.program.getFileIncludeReasons().get(r.path).some(e=>0===e.kind))return;if(!u.length)return u.push(n);const i=u[u.length-1],o=Ze(i);if(o&&i[1]===n-1)return i[1]=n;if(o||1===u.length||i!==n-1)return u.push(n);const a=u[u.length-2];return nt(a)&&a===i-1?(u[u.length-2]=[a,n],u.length=u.length-1):u.push(n)}function C(){let t;return l.forEach(n=>{const r=e.program.getSourceFileByPath(n);r&&n!==r.resolvedPath&&(t=ae(t,[k(r.resolvedPath),k(n)]))}),t}function w(e){let t;const{optionsNameMap:n}=iL();for(const r of Ae(e).sort(Nt)){const i=n.get(r.toLowerCase());(null==i?void 0:i.affectsBuildInfo)&&((t||(t={}))[r]=N(i,e[r]))}return t}function N(e,t){if(e)if(pn.assert("listOrElement"!==e.type),"list"===e.type){const n=t;if(e.element.isFilePath&&n.length)return n.map(b)}else if(e.isFilePath)return b(t);return t}function D(){let t;return e.fileInfos.forEach((n,r)=>{const i=e.semanticDiagnosticsPerFile.get(r);i?i.length&&(t=ae(t,[k(r),E(i,r)])):e.changedFilesSet.has(r)||(t=ae(t,k(r)))}),t}function F(){var t;let n;if(!(null==(t=e.emitDiagnosticsPerFile)?void 0:t.size))return n;for(const t of je(e.emitDiagnosticsPerFile.keys()).sort(Nt)){const r=e.emitDiagnosticsPerFile.get(t);n=ae(n,[k(t),E(r,t)])}return n}function E(e,t){return pn.assert(!!e.length),e.map(e=>{const n=P(e,t);n.reportsUnnecessary=e.reportsUnnecessary,n.reportDeprecated=e.reportsDeprecated,n.source=e.source,n.skippedOn=e.skippedOn;const{relatedInformation:r}=e;return n.relatedInformation=r?r.length?r.map(e=>P(e,t)):[]:void 0,n})}function P(e,t){const{file:n}=e;return{...e,file:!!n&&(n.resolvedPath===t?void 0:x(n.resolvedPath)),messageText:tt(e.messageText)?e.messageText:A(e.messageText)}}function A(e){if(e.repopulateInfo)return{info:e.repopulateInfo(),next:I(e.next)};const t=I(e.next);return t===e.next?e:{...e,next:t}}function I(e){return e&&p(e,(t,n)=>{const r=A(t);if(t===r)return;const i=n>0?e.slice(0,n-1):[];i.push(r);for(let t=n+1;t!!a.hasChangedEmitSignature,s.getAllDependencies=e=>sW.getAllDependencies(a,pn.checkDefined(a.program),e),s.getSemanticDiagnostics=function(e,t){if(pn.assert(_W(a)),bW(a,e),e)return AW(a,e,t);for(;;){const e=g(t);if(!e)break;if(e.affected===a.program)return e.result}let n;for(const e of a.program.getSourceFiles())n=le(n,AW(a,e,t));a.checkPending&&!a.compilerOptions.noCheck&&(a.checkPending=void 0,a.buildInfoEmitPending=!0);return n||_},s.getDeclarationDiagnostics=function(t,n){var r;if(pn.assert(_W(a)),1===e){let e,i;for(bW(a,t);e=l(void 0,n,void 0,void 0,!0);)t||(i=le(i,e.result.diagnostics));return(t?null==(r=a.emitDiagnosticsPerFile)?void 0:r.get(t.resolvedPath):i)||_}{const e=a.program.getDeclarationDiagnostics(t,n);return m(t,void 0,!0,e),e}},s.emit=function(t,n,r,i,o){pn.assert(_W(a)),1===e&&bW(a,t);const c=YV(s,t,n,r);if(c)return c;if(!t){if(1===e){let e,t,a=[],s=!1,c=[];for(;t=d(n,r,i,o);)s=s||t.result.emitSkipped,e=le(e,t.result.diagnostics),c=le(c,t.result.emittedFiles),a=le(a,t.result.sourceMaps);return{emitSkipped:s,diagnostics:e||_,emittedFiles:c,sourceMaps:a}}kW(a,i,!1)}const l=a.program.emit(t,f(n,o),r,i,o);return m(t,i,!1,l.diagnostics),l},s.releaseProgram=()=>function(e){sW.releaseCache(e),e.program=void 0}(a),0===e?s.getSemanticDiagnosticsOfNextAffectedFile=g:1===e?(s.getSemanticDiagnosticsOfNextAffectedFile=g,s.emitNextAffectedFile=d,s.emitBuildInfo=function(e,t){if(pn.assert(_W(a)),MW(a)){const r=a.program.emitBuildInfo(e||He(n,n.writeFile),t);return a.buildInfoEmitPending=!1,r}return QV}):pt(),s;function l(e,t,r,i,o){var s,c,l,_;pn.assert(_W(a));let d=xW(a,t,n);const p=uW(a.compilerOptions);let m,g=o?8:r?56&p:p;if(!d){if(a.compilerOptions.outFile){if(a.programEmitPending&&(g=SW(a.programEmitPending,a.seenProgramEmit,r,o),g&&(d=a.program)),!d&&(null==(s=a.emitDiagnosticsPerFile)?void 0:s.size)){const e=a.seenProgramEmit||0;if(!(e&TW(o))){a.seenProgramEmit=TW(o)|e;const t=[];return a.emitDiagnosticsPerFile.forEach(e=>le(t,e)),{result:{emitSkipped:!0,diagnostics:t},affected:a.program}}}}else{const e=function(e,t,n){var r;if(null==(r=e.affectedFilesPendingEmit)?void 0:r.size)return sd(e.affectedFilesPendingEmit,(r,i)=>{var o;const a=e.program.getSourceFileByPath(i);if(!a||!ev(a,e.program))return void e.affectedFilesPendingEmit.delete(i);const s=SW(r,null==(o=e.seenEmittedFiles)?void 0:o.get(a.resolvedPath),t,n);return s?{affectedFile:a,emitKind:s}:void 0})}(a,r,o);if(e)({affectedFile:d,emitKind:g}=e);else{const e=function(e,t){var n;if(null==(n=e.emitDiagnosticsPerFile)?void 0:n.size)return sd(e.emitDiagnosticsPerFile,(n,r)=>{var i;const o=e.program.getSourceFileByPath(r);if(!o||!ev(o,e.program))return void e.emitDiagnosticsPerFile.delete(r);const a=(null==(i=e.seenEmittedFiles)?void 0:i.get(o.resolvedPath))||0;return a&TW(t)?void 0:{affectedFile:o,diagnostics:n,seenKind:a}})}(a,o);if(e)return(a.seenEmittedFiles??(a.seenEmittedFiles=new Map)).set(e.affectedFile.resolvedPath,e.seenKind|TW(o)),{result:{emitSkipped:!0,diagnostics:e.diagnostics},affected:e.affectedFile}}}if(!d){if(o||!MW(a))return;const r=a.program,i=r.emitBuildInfo(e||He(n,n.writeFile),t);return a.buildInfoEmitPending=!1,{result:i,affected:r}}}7&g&&(m=0),56&g&&(m=void 0===m?1:void 0);const h=o?{emitSkipped:!0,diagnostics:a.program.getDeclarationDiagnostics(d===a.program?void 0:d,t)}:a.program.emit(d===a.program?void 0:d,f(e,i),t,m,i,void 0,!0);if(d!==a.program){const e=d;a.seenAffectedFiles.add(e.resolvedPath),void 0!==a.affectedFilesIndex&&a.affectedFilesIndex++,a.buildInfoEmitPending=!0;const t=(null==(c=a.seenEmittedFiles)?void 0:c.get(e.resolvedPath))||0;(a.seenEmittedFiles??(a.seenEmittedFiles=new Map)).set(e.resolvedPath,g|t);const n=dW((null==(l=a.affectedFilesPendingEmit)?void 0:l.get(e.resolvedPath))||p,g|t);n?(a.affectedFilesPendingEmit??(a.affectedFilesPendingEmit=new Map)).set(e.resolvedPath,n):null==(_=a.affectedFilesPendingEmit)||_.delete(e.resolvedPath),h.diagnostics.length&&(a.emitDiagnosticsPerFile??(a.emitDiagnosticsPerFile=new Map)).set(e.resolvedPath,h.diagnostics)}else a.changedFilesSet.clear(),a.programEmitPending=a.changedFilesSet.size?dW(p,g):a.programEmitPending?dW(a.programEmitPending,g):void 0,a.seenProgramEmit=g|(a.seenProgramEmit||0),u(h.diagnostics),a.buildInfoEmitPending=!0;return{result:h,affected:d}}function u(e){let t;e.forEach(e=>{if(!e.file)return;let n=null==t?void 0:t.get(e.file.resolvedPath);n||(t??(t=new Map)).set(e.file.resolvedPath,n=[]),n.push(e)}),t&&(a.emitDiagnosticsPerFile=t)}function d(e,t,n,r){return l(e,t,n,r,!1)}function f(e,t){return pn.assert(_W(a)),Ik(a.compilerOptions)?(r,i,o,s,c,l)=>{var _,u,d;if(vO(r))if(a.compilerOptions.outFile){if(a.compilerOptions.composite){const e=p(a.outSignature,void 0);if(!e)return l.skippedDtsWrite=!0;a.outSignature=e}}else{let e;if(pn.assert(1===(null==c?void 0:c.length)),!t){const t=c[0],r=a.fileInfos.get(t.resolvedPath);if(r.signature===t.version){const o=zW(a.program,t,i,n,l);if((null==(_=null==l?void 0:l.diagnostics)?void 0:_.length)||(e=o),o!==t.version)if(n.storeSignatureInfo&&(a.signatureInfo??(a.signatureInfo=new Map)).set(t.resolvedPath,1),a.affectedFiles){void 0===(null==(u=a.oldSignatures)?void 0:u.get(t.resolvedPath))&&(a.oldSignatures??(a.oldSignatures=new Map)).set(t.resolvedPath,r.signature||!1),r.signature=o}else r.signature=o}}if(a.compilerOptions.composite){const t=c[0].resolvedPath;if(e=p(null==(d=a.emitSignatures)?void 0:d.get(t),e),!e)return l.skippedDtsWrite=!0;(a.emitSignatures??(a.emitSignatures=new Map)).set(t,e)}}function p(e,t){const o=!e||tt(e)?e:e[0];if(t??(t=function(e,t,n){return(t.createHash??Bi)(JW(e,n))}(i,n,l)),t===o){if(e===o)return;l?l.differsOnlyInMap=!0:l={differsOnlyInMap:!0}}else a.hasChangedEmitSignature=!0,a.latestChangedDtsFile=r;return t}e?e(r,i,o,s,c,l):n.writeFile?n.writeFile(r,i,o,s,c,l):a.program.writeFile(r,i,o,s,c,l)}:e||He(n,n.writeFile)}function m(t,n,r,i){t||1===e||(kW(a,n,r),u(i))}function g(e,t){for(pn.assert(_W(a));;){const r=xW(a,e,n);let i;if(!r)return void(a.checkPending&&!a.compilerOptions.noCheck&&(a.checkPending=void 0,a.buildInfoEmitPending=!0));if(r!==a.program){const n=r;if(t&&t(n)||(i=AW(a,n,e)),a.seenAffectedFiles.add(n.resolvedPath),a.affectedFilesIndex++,a.buildInfoEmitPending=!0,!i)continue}else{let t;const n=new Map;a.program.getSourceFiles().forEach(r=>t=le(t,AW(a,r,e,n))),a.semanticDiagnosticsPerFile=n,i=t||_,a.changedFilesSet.clear(),a.programEmitPending=uW(a.compilerOptions),a.compilerOptions.noCheck||(a.checkPending=void 0),a.buildInfoEmitPending=!0}return{result:i,affected:r}}}}function UW(e,t,n){var r,i;const o=(null==(r=e.affectedFilesPendingEmit)?void 0:r.get(t))||0;(e.affectedFilesPendingEmit??(e.affectedFilesPendingEmit=new Map)).set(t,o|n),null==(i=e.emitDiagnosticsPerFile)||i.delete(t)}function VW(e){return tt(e)?{version:e,signature:e,affectsGlobalScope:void 0,impliedFormat:void 0}:tt(e.signature)?e:{version:e.version,signature:!1===e.signature?void 0:e.version,affectsGlobalScope:e.affectsGlobalScope,impliedFormat:e.impliedFormat}}function WW(e,t){return nt(e)?t:e[1]||24}function $W(e,t){return e||uW(t||{})}function HW(e,t,n){var r,i,o,a;const s=Ao(Uo(t,n.getCurrentDirectory())),c=Ht(n.useCaseSensitiveFileNames());let l;const u=null==(r=e.fileNames)?void 0:r.map(function(e){return Ho(e,s,c)});let d;const p=e.latestChangedDtsFile?g(e.latestChangedDtsFile):void 0,f=new Map,m=new Set(P(e.changeFileSet,h));if(IW(e))e.fileInfos.forEach((e,t)=>{const n=h(t+1);f.set(n,tt(e)?{version:e,signature:void 0,affectsGlobalScope:void 0,impliedFormat:void 0}:e)}),l={fileInfos:f,compilerOptions:e.options?oj(e.options,g):{},semanticDiagnosticsPerFile:y(e.semanticDiagnosticsPerFile),emitDiagnosticsPerFile:v(e.emitDiagnosticsPerFile),hasReusableDiagnostic:!0,changedFilesSet:m,latestChangedDtsFile:p,outSignature:e.outSignature,programEmitPending:void 0===e.pendingEmit?void 0:$W(e.pendingEmit,e.options),hasErrors:e.errors,checkPending:e.checkPending};else{d=null==(i=e.fileIdsList)?void 0:i.map(e=>new Set(e.map(h)));const t=(null==(o=e.options)?void 0:o.composite)&&!e.options.outFile?new Map:void 0;e.fileInfos.forEach((e,n)=>{const r=h(n+1),i=VW(e);f.set(r,i),t&&i.signature&&t.set(r,i.signature)}),null==(a=e.emitSignatures)||a.forEach(e=>{if(nt(e))t.delete(h(e));else{const n=h(e[0]);t.set(n,tt(e[1])||e[1].length?e[1]:[t.get(n)])}});const n=e.affectedFilesPendingEmit?uW(e.options||{}):void 0;l={fileInfos:f,compilerOptions:e.options?oj(e.options,g):{},referencedMap:function(e,t){const n=sW.createReferencedMap(t);return n&&e?(e.forEach(([e,t])=>n.set(h(e),d[t-1])),n):n}(e.referencedMap,e.options??{}),semanticDiagnosticsPerFile:y(e.semanticDiagnosticsPerFile),emitDiagnosticsPerFile:v(e.emitDiagnosticsPerFile),hasReusableDiagnostic:!0,changedFilesSet:m,affectedFilesPendingEmit:e.affectedFilesPendingEmit&&Be(e.affectedFilesPendingEmit,e=>h(nt(e)?e:e[0]),e=>WW(e,n)),latestChangedDtsFile:p,emitSignatures:(null==t?void 0:t.size)?t:void 0,hasErrors:e.errors,checkPending:e.checkPending}}return{state:l,getProgram:pt,getProgramOrUndefined:ct,releaseProgram:ot,getCompilerOptions:()=>l.compilerOptions,getSourceFile:pt,getSourceFiles:pt,getOptionsDiagnostics:pt,getGlobalDiagnostics:pt,getConfigFileParsingDiagnostics:pt,getSyntacticDiagnostics:pt,getDeclarationDiagnostics:pt,getSemanticDiagnostics:pt,emit:pt,getAllDependencies:pt,getCurrentDirectory:pt,emitNextAffectedFile:pt,getSemanticDiagnosticsOfNextAffectedFile:pt,emitBuildInfo:pt,close:ot,hasChangedEmitSignature:at};function g(e){return Uo(e,s)}function h(e){return u[e-1]}function y(e){const t=new Map(z(f.keys(),e=>m.has(e)?void 0:[e,_]));return null==e||e.forEach(e=>{nt(e)?t.delete(h(e)):t.set(h(e[0]),e[1])}),t}function v(e){return e&&Be(e,e=>h(e[0]),e=>e[1])}}function KW(e,t,n){const r=Ao(Uo(t,n.getCurrentDirectory())),i=Ht(n.useCaseSensitiveFileNames()),o=new Map;let a=0;const s=new Map,c=new Map(e.resolvedRoot);return e.fileInfos.forEach((t,n)=>{const s=Ho(e.fileNames[n],r,i),c=tt(t)?t:t.version;if(o.set(s,c),aHo(e,i,o))}function XW(e,t){return{state:void 0,getProgram:n,getProgramOrUndefined:()=>e.program,releaseProgram:()=>e.program=void 0,getCompilerOptions:()=>e.compilerOptions,getSourceFile:e=>n().getSourceFile(e),getSourceFiles:()=>n().getSourceFiles(),getOptionsDiagnostics:e=>n().getOptionsDiagnostics(e),getGlobalDiagnostics:e=>n().getGlobalDiagnostics(e),getConfigFileParsingDiagnostics:()=>t,getSyntacticDiagnostics:(e,t)=>n().getSyntacticDiagnostics(e,t),getDeclarationDiagnostics:(e,t)=>n().getDeclarationDiagnostics(e,t),getSemanticDiagnostics:(e,t)=>n().getSemanticDiagnostics(e,t),emit:(e,t,r,i,o)=>n().emit(e,t,r,i,o),emitBuildInfo:(e,t)=>n().emitBuildInfo(e,t),getAllDependencies:pt,getCurrentDirectory:()=>n().getCurrentDirectory(),close:ot};function n(){return pn.checkDefined(e.program)}}function QW(e,t,n,r,i,o){return qW(0,BW(e,t,n,r,i,o))}function YW(e,t,n,r,i,o){return qW(1,BW(e,t,n,r,i,o))}function ZW(e,t,n,r,i,o){const{newProgram:a,configFileParsingDiagnostics:s}=BW(e,t,n,r,i,o);return XW({program:a,compilerOptions:a.getCompilerOptions()},s)}function e$(e){return Bt(e,"/node_modules/.staging")?Jt(e,"/.staging"):H(to,t=>e.includes(t))?void 0:e}function t$(e,t){if(t<=1)return 1;let n=1,r=0===e[0].search(/[a-z]:/i);if(e[0]!==fo&&!r&&0===e[1].search(/[a-z]\$$/i)){if(2===t)return 2;n=2,r=!0}return r&&!e[n].match(/^users$/i)?n:e[n].match(/^workspaces$/i)?n+1:n+2}function n$(e,t){if(void 0===t&&(t=e.length),t<=2)return!1;return t>t$(e,t)+1}function r$(e){return n$(jo(e))}function i$(e){return a$(Ao(e))}function o$(e,t){if(t.lengthi.length+1?_$(l,c,Math.max(i.length+1,_+1),d):{dir:n,dirPath:r,nonRecursive:!0}:l$(l,c,c.length-1,_,u,i,d,s)}function l$(e,t,n,r,i,o,a,s){if(-1!==i)return _$(e,t,i+1,a);let c=!0,l=n;if(!s)for(let e=0;e=n&&r+2function(e,t,n,r,i,o,a){const s=p$(e),c=HM(n,r,i,s,t,o,a);if(!e.getGlobalTypingsCacheLocation)return c;const l=e.getGlobalTypingsCacheLocation();if(!(void 0===l||Fs(n)||c.resolvedModule&&nT(c.resolvedModule.extension))){const{resolvedModule:r,failedLookupLocations:o,affectingLocations:a,resolutionDiagnostics:_}=GR(pn.checkDefined(e.globalCacheResolutionModuleName)(n),e.projectName,i,s,l,t);if(r)return c.resolvedModule=r,c.failedLookupLocations=fM(c.failedLookupLocations,o),c.affectingLocations=fM(c.affectingLocations,a),c.resolutionDiagnostics=fM(c.resolutionDiagnostics,_),c}return c}(r,i,o,e,n,t,a)}}function m$(e,t,n){let r,i,o;const a=new Set,s=new Set,c=new Set,l=new Map,u=new Map;let d,p,f,m,h,y=!1,v=!1;const b=ft(()=>e.getCurrentDirectory()),x=e.getCachedDirectoryStructureHost(),k=new Map,S=qM(b(),e.getCanonicalFileName,e.getCompilationSettings()),T=new Map,C=UM(b(),e.getCanonicalFileName,e.getCompilationSettings(),S.getPackageJsonInfoCache(),S.optionsToRedirectsKey),w=new Map,N=qM(b(),e.getCanonicalFileName,VM(e.getCompilationSettings()),S.getPackageJsonInfoCache()),D=new Map,F=new Map,E=d$(t,b),P=e.toPath(E),A=jo(P),I=n$(A),O=new Map,L=new Map,j=new Map,M=new Map;return{rootDirForResolution:t,resolvedModuleNames:k,resolvedTypeReferenceDirectives:T,resolvedLibraries:w,resolvedFileToResolution:l,resolutionsWithFailedLookups:s,resolutionsWithOnlyAffectingLocations:c,directoryWatchesOfFailedLookups:D,fileWatchesOfAffectingLocations:F,packageDirWatchers:L,dirPathToSymlinkPackageRefCount:j,watchFailedLookupLocationsOfExternalModuleResolutions:V,getModuleResolutionCache:()=>S,startRecordingFilesWithChangedResolutions:function(){r=[]},finishRecordingFilesWithChangedResolutions:function(){const e=r;return r=void 0,e},startCachingPerDirectoryResolution:function(){S.isReadonly=void 0,C.isReadonly=void 0,N.isReadonly=void 0,S.getPackageJsonInfoCache().isReadonly=void 0,S.clearAllExceptPackageJsonInfoCache(),C.clearAllExceptPackageJsonInfoCache(),N.clearAllExceptPackageJsonInfoCache(),X(),O.clear()},finishCachingPerDirectoryResolution:function(t,n){o=void 0,v=!1,X(),t!==n&&(!function(t){w.forEach((n,r)=>{var i;(null==(i=null==t?void 0:t.resolvedLibReferences)?void 0:i.has(r))||(ee(n,e.toPath(jV(e.getCompilationSettings(),b(),r)),fd),w.delete(r))})}(t),null==t||t.getSourceFiles().forEach(e=>{var t;const n=(null==(t=e.packageJsonLocations)?void 0:t.length)??0,r=u.get(e.resolvedPath)??_;for(let t=r.length;tn)for(let e=n;e{const r=null==t?void 0:t.getSourceFileByPath(n);r&&r.resolvedPath===n||(e.forEach(e=>F.get(e).files--),u.delete(n))}));D.forEach(J),F.forEach(z),L.forEach(B),y=!1,S.isReadonly=!0,C.isReadonly=!0,N.isReadonly=!0,S.getPackageJsonInfoCache().isReadonly=!0,O.clear()},resolveModuleNameLiterals:function(t,r,i,o,a,s){return q({entries:t,containingFile:r,containingSourceFile:a,redirectedReference:i,options:o,reusedNames:s,perFileCache:k,loader:f$(r,i,o,e,S),getResolutionWithResolvedFileName:fd,shouldRetryResolution:e=>!e.resolvedModule||!rT(e.resolvedModule.extension),logChanges:n,deferWatchingNonRelativeResolution:!0})},resolveTypeReferenceDirectiveReferences:function(t,n,r,i,o,a){return q({entries:t,containingFile:n,containingSourceFile:o,redirectedReference:r,options:i,reusedNames:a,perFileCache:T,loader:IV(n,r,i,p$(e),C),getResolutionWithResolvedFileName:md,shouldRetryResolution:e=>void 0===e.resolvedTypeReferenceDirective,deferWatchingNonRelativeResolution:!1})},resolveLibrary:function(t,n,r,i){const o=p$(e);let a=null==w?void 0:w.get(i);if(!a||a.isInvalidated){const s=a;a=WM(t,n,r,o,N);const c=e.toPath(n);V(t,a,c,fd,!1),w.set(i,a),s&&ee(s,c,fd)}else if(oM(r,o)){const e=fd(a);iM(o,(null==e?void 0:e.resolvedFileName)?e.packageId?fa.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:fa.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:fa.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved,t,n,null==e?void 0:e.resolvedFileName,(null==e?void 0:e.packageId)&&vd(e.packageId))}return a},resolveSingleModuleNameWithoutWatching:function(t,n){var r,i;const o=e.toPath(n),a=k.get(o),s=null==a?void 0:a.get(t,void 0);if(s&&!s.isInvalidated)return s;const c=null==(r=e.beforeResolveSingleModuleNameWithoutWatching)?void 0:r.call(e,S),l=p$(e),_=HM(t,n,e.getCompilationSettings(),l,S);return null==(i=e.afterResolveSingleModuleNameWithoutWatching)||i.call(e,S,t,n,_,c),_},removeResolutionsFromProjectReferenceRedirects:function(t){if(!wo(t,".json"))return;const n=e.getCurrentProgram();if(!n)return;const r=n.getResolvedProjectReferenceByPath(t);if(!r)return;r.commandLine.fileNames.forEach(t=>ie(e.toPath(t)))},removeResolutionsOfFile:ie,hasChangedAutomaticTypeDirectiveNames:()=>y,invalidateResolutionOfFile:function(t){ie(t);const n=y;oe(l.get(t),st)&&y&&!n&&e.onChangedAutomaticTypeDirectiveNames()},invalidateResolutionsOfFailedLookupLocations:ce,setFilesWithInvalidatedNonRelativeUnresolvedImports:function(e){pn.assert(o===e||void 0===o),o=e},createHasInvalidatedResolutions:function(e,t){ce();const n=i;return i=void 0,{hasInvalidatedResolutions:t=>e(t)||v||!!(null==n?void 0:n.has(t))||R(t),hasInvalidatedLibResolutions:e=>{var n;return t(e)||!!(null==(n=null==w?void 0:w.get(e))?void 0:n.isInvalidated)}}},isFileWithInvalidatedNonRelativeUnresolvedImports:R,updateTypeRootsWatch:function(){const t=e.getCompilationSettings();if(t.types)return void de();const n=bM(t,{getCurrentDirectory:b});n?yx(M,new Set(n),{createNewValue:pe,onDeleteValue:sx}):de()},closeTypeRootsWatch:de,clear:function(){gx(D,GU),gx(F,GU),O.clear(),L.clear(),j.clear(),a.clear(),de(),k.clear(),T.clear(),l.clear(),s.clear(),c.clear(),f=void 0,m=void 0,h=void 0,p=void 0,d=void 0,v=!1,S.clear(),C.clear(),S.update(e.getCompilationSettings()),C.update(e.getCompilationSettings()),N.clear(),u.clear(),w.clear(),y=!1},onChangesAffectModuleResolution:function(){v=!0,S.clearAllExceptPackageJsonInfoCache(),C.clearAllExceptPackageJsonInfoCache(),S.update(e.getCompilationSettings()),C.update(e.getCompilationSettings())}};function R(e){if(!o)return!1;const t=o.get(e);return!!t&&!!t.length}function B(e,t){0===e.dirPathToWatcher.size&&L.delete(t)}function J(e,t){0===e.refCount&&(D.delete(t),e.watcher.close())}function z(e,t){var n;0!==e.files||0!==e.resolutions||(null==(n=e.symlinks)?void 0:n.size)||(F.delete(t),e.watcher.close())}function q({entries:t,containingFile:n,containingSourceFile:i,redirectedReference:o,options:a,perFileCache:s,reusedNames:c,loader:l,getResolutionWithResolvedFileName:_,deferWatchingNonRelativeResolution:u,shouldRetryResolution:d,logChanges:p}){var f;const m=e.toPath(n),g=s.get(m)||s.set(m,MM()).get(m),h=[],y=p&&R(m),b=e.getCurrentProgram(),x=b&&(null==(f=b.getRedirectFromSourceFile(n))?void 0:f.resolvedRef),S=x?!o||o.sourceFile.path!==x.sourceFile.path:!!o,T=MM();for(const c of t){const t=l.nameAndMode.getName(c),f=l.nameAndMode.getMode(c,i,(null==o?void 0:o.commandLine.options)||a);let b=g.get(t,f);if(!T.has(t,f)&&(v||S||!b||b.isInvalidated||y&&!Fs(t)&&d(b))){const n=b;b=l.resolve(t,f),e.onDiscoveredSymlink&&g$(b)&&e.onDiscoveredSymlink(),g.set(t,f,b),b!==n&&(V(t,b,m,_,u),n&&ee(n,m,_)),p&&r&&!C(n,b)&&(r.push(m),p=!1)}else{const r=p$(e);if(oM(a,r)&&!T.has(t,f)){const e=_(b);iM(r,s===k?(null==e?void 0:e.resolvedFileName)?e.packageId?fa.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:fa.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:fa.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:(null==e?void 0:e.resolvedFileName)?e.packageId?fa.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:fa.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:fa.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,t,n,null==e?void 0:e.resolvedFileName,(null==e?void 0:e.packageId)&&vd(e.packageId))}}pn.assert(void 0!==b&&!b.isInvalidated),T.set(t,f,!0),h.push(b)}return null==c||c.forEach(e=>T.set(l.nameAndMode.getName(e),l.nameAndMode.getMode(e,i,(null==o?void 0:o.commandLine.options)||a),!0)),g.size()!==T.size()&&g.forEach((e,t,n)=>{T.has(t,n)||(ee(e,m,_),g.delete(t,n))}),h;function C(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=_(e),r=_(t);return n===r||!(!n||!r)&&n.resolvedFileName===r.resolvedFileName}}function U(e){return Bt(e,"/node_modules/@types")}function V(t,n,r,i,o){if((n.files??(n.files=new Set)).add(r),1!==n.files.size)return;!o||Fs(t)?$(n):a.add(n);const s=i(n);if(s&&s.resolvedFileName){const t=e.toPath(s.resolvedFileName);let r=l.get(t);r||l.set(t,r=new Set),r.add(n)}}function W(t,n){const r=c$(t,e.toPath(t),E,P,A,I,b,e.preferNonRecursiveWatch);if(r){const{dir:e,dirPath:t,nonRecursive:i,packageDir:o,packageDirPath:a}=r;t===P?(pn.assert(i),pn.assert(!o),n=!0):Q(e,t,o,a,i)}return n}function $(e){var t;pn.assert(!!(null==(t=e.files)?void 0:t.size));const{failedLookupLocations:n,affectingLocations:r,alternateResult:i}=e;if(!(null==n?void 0:n.length)&&!(null==r?void 0:r.length)&&!i)return;((null==n?void 0:n.length)||i)&&s.add(e);let o=!1;if(n)for(const e of n)o=W(e,o);i&&(o=W(i,o)),o&&Q(E,P,void 0,void 0,!0),function(e,t){var n;pn.assert(!!(null==(n=e.files)?void 0:n.size));const{affectingLocations:r}=e;if(!(null==r?void 0:r.length))return;t&&c.add(e);for(const e of r)K(e,!0)}(e,!(null==n?void 0:n.length)&&!i)}function K(t,n){const r=F.get(t);if(r)return void(n?r.resolutions++:r.files++);let i,o=t,a=!1;e.realpath&&(o=e.realpath(t),t!==o&&(a=!0,i=F.get(o)));const s=n?1:0,c=n?0:1;if(!a||!i){const t={watcher:s$(e.toPath(o))?e.watchAffectingFileLocation(o,(t,n)=>{null==x||x.addOrDeleteFile(t,e.toPath(o),n),G(o,S.getPackageJsonInfoCache().getInternalMap()),e.scheduleInvalidateResolutionsOfFailedLookupLocations()}):R$,resolutions:a?0:s,files:a?0:c,symlinks:void 0};F.set(o,t),a&&(i=t)}if(a){pn.assert(!!i);const e={watcher:{close:()=>{var e;const n=F.get(o);!(null==(e=null==n?void 0:n.symlinks)?void 0:e.delete(t))||n.symlinks.size||n.resolutions||n.files||(F.delete(o),n.watcher.close())}},resolutions:s,files:c,symlinks:void 0};F.set(t,e),(i.symlinks??(i.symlinks=new Set)).add(t)}}function G(t,n){var r;const i=F.get(t);(null==i?void 0:i.resolutions)&&(p??(p=new Set)).add(t),(null==i?void 0:i.files)&&(d??(d=new Set)).add(t),null==(r=null==i?void 0:i.symlinks)||r.forEach(e=>G(e,n)),null==n||n.delete(e.toPath(t))}function X(){a.forEach($),a.clear()}function Q(t,n,r,i,o){i&&e.realpath?function(t,n,r,i,o){pn.assert(!o);let a=O.get(i),s=L.get(i);if(void 0===a){const t=e.realpath(r);a=t!==r&&e.toPath(t)!==i,O.set(i,a),s?s.isSymlink!==a&&(s.dirPathToWatcher.forEach(e=>{te(s.isSymlink?i:n),e.watcher=l()}),s.isSymlink=a):L.set(i,s={dirPathToWatcher:new Map,isSymlink:a})}else pn.assertIsDefined(s),pn.assert(a===s.isSymlink);const c=s.dirPathToWatcher.get(n);function l(){return a?Y(r,i,o):Y(t,n,o)}c?c.refCount++:(s.dirPathToWatcher.set(n,{watcher:l(),refCount:1}),a&&j.set(n,(j.get(n)??0)+1))}(t,n,r,i,o):Y(t,n,o)}function Y(e,t,n){let r=D.get(t);return r?(pn.assert(!!n==!!r.nonRecursive),r.refCount++):D.set(t,r={watcher:ne(e,t,n),refCount:1,nonRecursive:n}),r}function Z(t,n){const r=c$(t,e.toPath(t),E,P,A,I,b,e.preferNonRecursiveWatch);if(r){const{dirPath:t,packageDirPath:i}=r;if(t===P)n=!0;else if(i&&e.realpath){const e=L.get(i),n=e.dirPathToWatcher.get(t);if(n.refCount--,0===n.refCount&&(te(e.isSymlink?i:t),e.dirPathToWatcher.delete(t),e.isSymlink)){const e=j.get(t)-1;0===e?j.delete(t):j.set(t,e)}}else te(t)}return n}function ee(t,n,r){if(pn.checkDefined(t.files).delete(n),t.files.size)return;t.files=void 0;const i=r(t);if(i&&i.resolvedFileName){const n=e.toPath(i.resolvedFileName),r=l.get(n);(null==r?void 0:r.delete(t))&&!r.size&&l.delete(n)}const{failedLookupLocations:o,affectingLocations:a,alternateResult:_}=t;if(s.delete(t)){let e=!1;if(o)for(const t of o)e=Z(t,e);_&&(e=Z(_,e)),e&&te(P)}else(null==a?void 0:a.length)&&c.delete(t);if(a)for(const e of a){F.get(e).resolutions--}}function te(e){D.get(e).refCount--}function ne(t,n,r){return e.watchDirectoryOfFailedLookupLocation(t,t=>{const r=e.toPath(t);x&&x.addOrDeleteFileOrDirectory(t,r),ae(r,n===r)},r?0:1)}function re(e,t,n){const r=e.get(t);r&&(r.forEach(e=>ee(e,t,n)),e.delete(t))}function ie(e){re(k,e,fd),re(T,e,md)}function oe(e,t){if(!e)return!1;let n=!1;return e.forEach(e=>{if(!e.isInvalidated&&t(e)){e.isInvalidated=n=!0;for(const t of pn.checkDefined(e.files))(i??(i=new Set)).add(t),y=y||Bt(t,LV)}}),n}function ae(t,n){if(n)(h||(h=new Set)).add(t);else{const n=e$(t);if(!n)return!1;if(t=n,e.fileIsOpen(t))return!1;const r=Ao(t);if(U(t)||da(t)||U(r)||da(r))(f||(f=new Set)).add(t),(m||(m=new Set)).add(t);else{if(WU(e.getCurrentProgram(),t))return!1;if(wo(t,".map"))return!1;(f||(f=new Set)).add(t),(m||(m=new Set)).add(t);const n=sR(t,!0);n&&(m||(m=new Set)).add(n)}}e.scheduleInvalidateResolutionsOfFailedLookupLocations()}function se(){const e=S.getPackageJsonInfoCache().getInternalMap();e&&(f||m||h)&&e.forEach((t,n)=>_e(n)?e.delete(n):void 0)}function ce(){var t;if(v)return d=void 0,se(),(f||m||h||p)&&oe(w,le),f=void 0,m=void 0,h=void 0,p=void 0,!0;let n=!1;return d&&(null==(t=e.getCurrentProgram())||t.getSourceFiles().forEach(e=>{H(e.packageJsonLocations,e=>d.has(e))&&((i??(i=new Set)).add(e.path),n=!0)}),d=void 0),f||m||h||p?(n=oe(s,le)||n,se(),f=void 0,m=void 0,h=void 0,n=oe(c,ue)||n,p=void 0,n):n}function le(t){var n;return!!ue(t)||!!(f||m||h)&&((null==(n=t.failedLookupLocations)?void 0:n.some(t=>_e(e.toPath(t))))||!!t.alternateResult&&_e(e.toPath(t.alternateResult)))}function _e(e){return(null==f?void 0:f.has(e))||g((null==m?void 0:m.keys())||[],t=>!!Qt(e,t)||void 0)||g((null==h?void 0:h.keys())||[],t=>!(!(e.length>t.length&&Qt(e,t))||!xo(t)&&e[t.length]!==fo)||void 0)}function ue(e){var t;return!!p&&(null==(t=e.affectingLocations)?void 0:t.some(e=>p.has(e)))}function de(){gx(M,sx)}function pe(t){return function(t){return!!e.getCompilationSettings().typeRoots||i$(e.toPath(t))}(t)?e.watchTypeRootsDirectory(t,n=>{const r=e.toPath(n);x&&x.addOrDeleteFileOrDirectory(n,r),y=!0,e.onChangedAutomaticTypeDirectiveNames();const i=u$(t,e.toPath(t),P,A,I,b,e.preferNonRecursiveWatch,e=>D.has(e)||j.has(e));i&&ae(r,i===r)},1):R$}}function g$(e){var t,n;return!(!(null==(t=e.resolvedModule)?void 0:t.originalPath)&&!(null==(n=e.resolvedTypeReferenceDirective)?void 0:n.originalPath))}var h$=uo?{getCurrentDirectory:()=>uo.getCurrentDirectory(),getNewLine:()=>uo.newLine,getCanonicalFileName:Ht(uo.useCaseSensitiveFileNames)}:void 0;function y$(e,t){const n=e===uo&&h$?h$:{getCurrentDirectory:()=>e.getCurrentDirectory(),getNewLine:()=>e.newLine,getCanonicalFileName:Ht(e.useCaseSensitiveFileNames)};if(!t)return t=>e.write(aV(t,n));const r=new Array(1);return t=>{r[0]=t,e.write(yV(r,n)+n.getNewLine()),r[0]=void 0}}function v$(e,t,n){return!(!e.clearScreen||n.preserveWatchOutput||n.extendedDiagnostics||n.diagnostics||!C(b$,t.code))&&(e.clearScreen(),!0)}var b$=[fa.Starting_compilation_in_watch_mode.code,fa.File_change_detected_Starting_incremental_compilation.code];function x$(e){return e.now?e.now().toLocaleTimeString("en-US",{timeZone:"UTC"}).replace(" "," "):(new Date).toLocaleTimeString()}function k$(e,t){return t?(t,n,r)=>{v$(e,t,r);let i=`[${mV(x$(e),"")}] `;i+=`${vV(t.messageText,e.newLine)}${n+n}`,e.write(i)}:(t,n,r)=>{let i="";v$(e,t,r)||(i+=n),i+=`${x$(e)} - `,i+=`${vV(t.messageText,e.newLine)}${function(e,t){return C(b$,e.code)?t+t:t}(t,n)}`,e.write(i)}}function S$(e,t,n,r,i,o){const a=i;a.onUnRecoverableConfigFileDiagnostic=e=>K$(i,o,e);const s=TL(e,t,a,n,r);return a.onUnRecoverableConfigFileDiagnostic=void 0,s}function T$(e){return N(e,e=>1===e.category)}function C$(e){return D(e,e=>1===e.category).map(e=>{if(void 0!==e.file)return`${e.file.fileName}`}).map(t=>{if(void 0===t)return;const n=x(e,e=>void 0!==e.file&&e.file.fileName===t);if(void 0!==n){const{line:e}=Wa(n.file,n.start);return{fileName:t,line:e+1}}})}function w$(e){return 1===e?fa.Found_1_error_Watching_for_file_changes:fa.Found_0_errors_Watching_for_file_changes}function N$(e,t){const n=mV(":"+e.line,"");return ko(e.fileName)&&ko(t)?sa(t,e.fileName,!1)+n:e.fileName+n}function D$(e,t,n,r){if(0===e)return"";const i=t.filter(e=>void 0!==e),o=i.map(e=>`${e.fileName}:${e.line}`).filter((e,t,n)=>n.indexOf(e)===t),a=i[0]&&N$(i[0],r.getCurrentDirectory());let s;s=1===e?void 0!==t[0]?[fa.Found_1_error_in_0,a]:[fa.Found_1_error]:0===o.length?[fa.Found_0_errors,e]:1===o.length?[fa.Found_0_errors_in_the_same_file_starting_at_Colon_1,e,a]:[fa.Found_0_errors_in_1_files,e,o.length];const c=nk(...s),l=o.length>1?function(e,t){const n=e.filter((e,t,n)=>t===n.findIndex(t=>(null==t?void 0:t.fileName)===(null==e?void 0:e.fileName)));if(0===n.length)return"";const r=e=>Math.log(e)*Math.LOG10E+1,i=n.map(t=>[t,N(e,e=>e.fileName===t.fileName)]),o=St(i,0,e=>e[1]),a=fa.Errors_Files.message,s=a.split(" ")[0].length,c=Math.max(s,r(o)),l=Math.max(r(o)-s,0);let _="";return _+=" ".repeat(l)+a+"\n",i.forEach(e=>{const[n,r]=e,i=Math.log(r)*Math.LOG10E+1|0,o=ica(t,e.getCurrentDirectory(),e.getCanonicalFileName);for(const a of e.getSourceFiles())t(`${L$(a,o)}`),null==(n=i.get(a.path))||n.forEach(n=>t(` ${O$(e,n,o).messageText}`)),null==(r=P$(a,e.getCompilerOptionsForFile(a),o))||r.forEach(e=>t(` ${e.messageText}`))}function P$(e,t,n){var r;let i;if(e.path!==e.resolvedPath&&(i??(i=[])).push(ik(void 0,fa.File_is_output_of_project_reference_source_0,L$(e.originalFileName,n))),e.redirectInfo&&(i??(i=[])).push(ik(void 0,fa.File_redirects_to_file_0,L$(e.redirectInfo.redirectTarget,n))),rf(e))switch(GV(e,t)){case 99:e.packageJsonScope&&(i??(i=[])).push(ik(void 0,fa.File_is_ECMAScript_module_because_0_has_field_type_with_value_module,L$(xe(e.packageJsonLocations),n)));break;case 1:e.packageJsonScope?(i??(i=[])).push(ik(void 0,e.packageJsonScope.contents.packageJsonContent.type?fa.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:fa.File_is_CommonJS_module_because_0_does_not_have_field_type,L$(xe(e.packageJsonLocations),n))):(null==(r=e.packageJsonLocations)?void 0:r.length)&&(i??(i=[])).push(ik(void 0,fa.File_is_CommonJS_module_because_package_json_was_not_found))}return i}function A$(e,t){var n;const r=e.getCompilerOptions().configFile;if(!(null==(n=null==r?void 0:r.configFileSpecs)?void 0:n.validatedFilesSpec))return;const i=e.getCanonicalFileName(t),o=Ao(Uo(r.fileName,e.getCurrentDirectory())),a=S(r.configFileSpecs.validatedFilesSpec,t=>e.getCanonicalFileName(Uo(t,o))===i);return-1!==a?r.configFileSpecs.validatedFilesSpecBeforeSubstitution[a]:void 0}function I$(e,t){var n,r;const i=e.getCompilerOptions().configFile;if(!(null==(n=null==i?void 0:i.configFileSpecs)?void 0:n.validatedIncludeSpecs))return;if(i.configFileSpecs.isDefaultIncludeSpec)return!0;const o=wo(t,".json"),a=Ao(Uo(i.fileName,e.getCurrentDirectory())),s=e.useCaseSensitiveFileNames(),c=S(null==(r=null==i?void 0:i.configFileSpecs)?void 0:r.validatedIncludeSpecs,e=>{if(o&&!Bt(e,".json"))return!1;const n=hS(e,a,"files");return!!n&&xS(`(?:${n})$`,s).test(t)});return-1!==c?i.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[c]:void 0}function O$(e,t,n){var r,i;const o=e.getCompilerOptions();if(RV(t)){const r=JV(e,t),i=BV(r)?r.file.text.substring(r.pos,r.end):`"${r.text}"`;let o;switch(pn.assert(BV(r)||3===t.kind,"Only synthetic references are imports"),t.kind){case 3:o=BV(r)?r.packageId?fa.Imported_via_0_from_file_1_with_packageId_2:fa.Imported_via_0_from_file_1:r.text===Hu?r.packageId?fa.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:fa.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:r.packageId?fa.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:fa.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions;break;case 4:pn.assert(!r.packageId),o=fa.Referenced_via_0_from_file_1;break;case 5:o=r.packageId?fa.Type_library_referenced_via_0_from_file_1_with_packageId_2:fa.Type_library_referenced_via_0_from_file_1;break;case 7:pn.assert(!r.packageId),o=fa.Library_referenced_via_0_from_file_1;break;default:pn.assertNever(t)}return ik(void 0,o,i,L$(r.file,n),r.packageId&&vd(r.packageId))}switch(t.kind){case 0:if(!(null==(r=o.configFile)?void 0:r.configFileSpecs))return ik(void 0,fa.Root_file_specified_for_compilation);const a=Uo(e.getRootFileNames()[t.index],e.getCurrentDirectory());if(A$(e,a))return ik(void 0,fa.Part_of_files_list_in_tsconfig_json);const s=I$(e,a);return tt(s)?ik(void 0,fa.Matched_by_include_pattern_0_in_1,s,L$(o.configFile,n)):ik(void 0,s?fa.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:fa.Root_file_specified_for_compilation);case 1:case 2:const c=2===t.kind,l=pn.checkDefined(null==(i=e.getResolvedProjectReferences())?void 0:i[t.index]);return ik(void 0,o.outFile?c?fa.Output_from_referenced_project_0_included_because_1_specified:fa.Source_from_referenced_project_0_included_because_1_specified:c?fa.Output_from_referenced_project_0_included_because_module_is_specified_as_none:fa.Source_from_referenced_project_0_included_because_module_is_specified_as_none,L$(l.sourceFile.fileName,n),o.outFile?"--outFile":"--out");case 8:return ik(void 0,...o.types?t.packageId?[fa.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1,t.typeReference,vd(t.packageId)]:[fa.Entry_point_of_type_library_0_specified_in_compilerOptions,t.typeReference]:t.packageId?[fa.Entry_point_for_implicit_type_library_0_with_packageId_1,t.typeReference,vd(t.packageId)]:[fa.Entry_point_for_implicit_type_library_0,t.typeReference]);case 6:{if(void 0!==t.index)return ik(void 0,fa.Library_0_specified_in_compilerOptions,o.lib[t.index]);const e=$k(Sk(o));return ik(void 0,...e?[fa.Default_library_for_target_0,e]:[fa.Default_library])}default:pn.assertNever(t)}}function L$(e,t){const n=tt(e)?e:e.fileName;return t?t(n):n}function j$(e,t,n,r,i,o,a,s){const c=e.getCompilerOptions(),l=e.getConfigFileParsingDiagnostics().slice(),u=l.length;le(l,e.getSyntacticDiagnostics(void 0,o)),l.length===u&&(le(l,e.getOptionsDiagnostics(o)),c.listFilesOnly||(le(l,e.getGlobalDiagnostics(o)),l.length===u&&le(l,e.getSemanticDiagnostics(void 0,o)),c.noEmit&&Ik(c)&&l.length===u&&le(l,e.getDeclarationDiagnostics(void 0,o))));const d=c.listFilesOnly?{emitSkipped:!0,diagnostics:_}:e.emit(void 0,i,o,a,s);le(l,d.diagnostics);const f=Es(l);if(f.forEach(t),n){const t=e.getCurrentDirectory();p(d.emittedFiles,e=>{const r=Uo(e,t);n(`TSFILE: ${r}`)}),function(e,t){const n=e.getCompilerOptions();n.explainFiles?E$(F$(e)?e.getProgram():e,t):(n.listFiles||n.listFilesOnly)&&p(e.getSourceFiles(),e=>{t(e.fileName)})}(e,n)}return r&&r(T$(f),C$(f)),{emitResult:d,diagnostics:f}}function M$(e,t,n,r,i,o,a,s){const{emitResult:c,diagnostics:l}=j$(e,t,n,r,i,o,a,s);return c.emitSkipped&&l.length>0?1:l.length>0?2:0}var R$={close:ot},B$=()=>R$;function J$(e=uo,t){return{onWatchStatusChange:t||k$(e),watchFile:He(e,e.watchFile)||B$,watchDirectory:He(e,e.watchDirectory)||B$,setTimeout:He(e,e.setTimeout)||ot,clearTimeout:He(e,e.clearTimeout)||ot,preferNonRecursiveWatch:e.preferNonRecursiveWatch}}var z$={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",AffectingFileLocation:"File location affecting resolution",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file",ClosedScriptInfo:"Closed Script info",ConfigFileForInferredRoot:"Config file for the inferred project root",NodeModules:"node_modules for closed script infos and package.jsons affecting module specifier cache",MissingSourceMapFile:"Missing source map file",NoopConfigFileForInferredRoot:"Noop Config file for the inferred project root",MissingGeneratedFile:"Missing generated file",NodeModulesForModuleSpecifierCache:"node_modules for module specifier cache invalidation",TypingInstallerLocationFile:"File location for typing installer",TypingInstallerLocationDirectory:"Directory location for typing installer"};function q$(e,t){const n=e.trace?t.extendedDiagnostics?2:t.diagnostics?1:0:0,r=0!==n?t=>e.trace(t):ot,i=HU(e,n,r);return i.writeLog=r,i}function U$(e,t,n=e){const r=e.useCaseSensitiveFileNames(),i={getSourceFile:eV((t,n)=>n?e.readFile(t,n):i.readFile(t),void 0),getDefaultLibLocation:He(e,e.getDefaultLibLocation),getDefaultLibFileName:t=>e.getDefaultLibFileName(t),writeFile:tV((t,n,r)=>e.writeFile(t,n,r),t=>e.createDirectory(t),t=>e.directoryExists(t)),getCurrentDirectory:ft(()=>e.getCurrentDirectory()),useCaseSensitiveFileNames:()=>r,getCanonicalFileName:Ht(r),getNewLine:()=>jb(t()),fileExists:t=>e.fileExists(t),readFile:t=>e.readFile(t),trace:He(e,e.trace),directoryExists:He(n,n.directoryExists),getDirectories:He(n,n.getDirectories),realpath:He(e,e.realpath),getEnvironmentVariable:He(e,e.getEnvironmentVariable)||(()=>""),createHash:He(e,e.createHash),readDirectory:He(e,e.readDirectory),storeSignatureInfo:e.storeSignatureInfo,jsDocParsingMode:e.jsDocParsingMode};return i}function V$(e,t){if(t.match(OJ)){let e=t.length,n=e;for(let r=e-1;r>=0;r--){const i=t.charCodeAt(r);switch(i){case 10:r&&13===t.charCodeAt(r-1)&&r--;case 13:break;default:if(i<127||!Ka(i)){n=r;continue}}const o=t.substring(n,e);if(o.match(LJ)){t=t.substring(0,n);break}if(!o.match(jJ))break;e=n}}return(e.createHash||Bi)(t)}function W$(e){const t=e.getSourceFile;e.getSourceFile=(...n)=>{const r=t.call(e,...n);return r&&(r.version=V$(e,r.text)),r}}function $$(e,t){const n=ft(()=>Ao(Vo(e.getExecutingFilePath())));return{useCaseSensitiveFileNames:()=>e.useCaseSensitiveFileNames,getNewLine:()=>e.newLine,getCurrentDirectory:ft(()=>e.getCurrentDirectory()),getDefaultLibLocation:n,getDefaultLibFileName:e=>Jo(n(),As(e)),fileExists:t=>e.fileExists(t),readFile:(t,n)=>e.readFile(t,n),directoryExists:t=>e.directoryExists(t),getDirectories:t=>e.getDirectories(t),readDirectory:(t,n,r,i,o)=>e.readDirectory(t,n,r,i,o),realpath:He(e,e.realpath),getEnvironmentVariable:He(e,e.getEnvironmentVariable),trace:t=>e.write(t+e.newLine),createDirectory:t=>e.createDirectory(t),writeFile:(t,n,r)=>e.writeFile(t,n,r),createHash:He(e,e.createHash),createProgram:t||YW,storeSignatureInfo:e.storeSignatureInfo,now:He(e,e.now)}}function H$(e=uo,t,n,r){const i=t=>e.write(t+e.newLine),o=$$(e,t);return $e(o,J$(e,r)),o.afterProgramCreate=e=>{const t=e.getCompilerOptions(),r=jb(t);j$(e,n,i,e=>o.onWatchStatusChange(nk(w$(e),e),r,t,e))},o}function K$(e,t,n){t(n),e.exit(1)}function G$({configFileName:e,optionsToExtend:t,watchOptionsToExtend:n,extraFileExtensions:r,system:i,createProgram:o,reportDiagnostic:a,reportWatchStatus:s}){const c=a||y$(i),l=H$(i,o,c,s);return l.onUnRecoverableConfigFileDiagnostic=e=>K$(i,c,e),l.configFileName=e,l.optionsToExtend=t,l.watchOptionsToExtend=n,l.extraFileExtensions=r,l}function X$({rootFiles:e,options:t,watchOptions:n,projectReferences:r,system:i,createProgram:o,reportDiagnostic:a,reportWatchStatus:s}){const c=H$(i,o,a||y$(i),s);return c.rootFiles=e,c.options=t,c.watchOptions=n,c.projectReferences=r,c}function Q$(e){const t=e.system||uo,n=e.host||(e.host=Z$(e.options,t)),r=eH(e),i=M$(r,e.reportDiagnostic||y$(t),e=>n.trace&&n.trace(e),e.reportErrorSummary||e.options.pretty?(e,r)=>t.write(D$(e,r,t.newLine,n)):void 0);return e.afterProgramEmitAndDiagnostics&&e.afterProgramEmitAndDiagnostics(r),i}function Y$(e,t){const n=aU(e);if(!n)return;let r;if(t.getBuildInfo)r=t.getBuildInfo(n,e.configFilePath);else{const e=t.readFile(n);if(!e)return;r=NU(n,e)}return r&&r.version===c&&OW(r)?HW(r,n,t):void 0}function Z$(e,t=uo){const n=nV(e,void 0,t);return n.createHash=He(t,t.createHash),n.storeSignatureInfo=t.storeSignatureInfo,W$(n),rV(n,e=>Ho(e,n.getCurrentDirectory(),n.getCanonicalFileName)),n}function eH({rootNames:e,options:t,configFileParsingDiagnostics:n,projectReferences:r,host:i,createProgram:o}){return(o=o||YW)(e,t,i=i||Z$(t),Y$(t,i),n,r)}function tH(e,t,n,r,i,o,a,s){return Ze(e)?X$({rootFiles:e,options:t,watchOptions:s,projectReferences:a,system:n,createProgram:r,reportDiagnostic:i,reportWatchStatus:o}):G$({configFileName:e,optionsToExtend:t,watchOptionsToExtend:a,extraFileExtensions:s,system:n,createProgram:r,reportDiagnostic:i,reportWatchStatus:o})}function nH(e){let t,n,r,i,o,a,s,c,l=new Map([[void 0,void 0]]),_=e.extendedConfigCache,u=!1;const d=new Map;let p,f=!1;const m=e.useCaseSensitiveFileNames(),g=e.getCurrentDirectory(),{configFileName:h,optionsToExtend:y={},watchOptionsToExtend:v,extraFileExtensions:b,createProgram:x}=e;let k,S,{rootFiles:T,options:C,watchOptions:w,projectReferences:N}=e,D=!1,F=!1;const E=void 0===h?void 0:MU(e,g,m),P=E||e,A=eW(e,P);let I=G();h&&e.configFileParsingResult&&(ce(e.configFileParsingResult),I=G()),ee(fa.Starting_compilation_in_watch_mode),h&&!e.configFileParsingResult&&(I=jb(y),pn.assert(!T),se(),I=G()),pn.assert(C),pn.assert(T);const{watchFile:O,watchDirectory:L,writeLog:j}=q$(e,C),M=Ht(m);let R;j(`Current directory: ${g} CaseSensitiveFileNames: ${m}`),h&&(R=O(h,function(){pn.assert(!!h),n=2,ie()},2e3,w,z$.ConfigFile));const B=U$(e,()=>C,P);W$(B);const J=B.getSourceFile;B.getSourceFile=(e,...t)=>Y(e,X(e),...t),B.getSourceFileByPath=Y,B.getNewLine=()=>I,B.fileExists=function(e){const t=X(e);if(Q(d.get(t)))return!1;return P.fileExists(e)},B.onReleaseOldSourceFile=function(e,t,n){const r=d.get(e.resolvedPath);void 0!==r&&(Q(r)?(p||(p=[])).push(e.path):r.sourceFile===e&&(r.fileWatcher&&r.fileWatcher.close(),d.delete(e.resolvedPath),n||z.removeResolutionsOfFile(e.path)))},B.onReleaseParsedCommandLine=function(e){var t;const n=X(e),r=null==s?void 0:s.get(n);if(!r)return;s.delete(n),r.watchedDirectories&&gx(r.watchedDirectories,GU);null==(t=r.watcher)||t.close(),JU(n,c)},B.toPath=X,B.getCompilationSettings=()=>C,B.useSourceOfProjectReferenceRedirect=He(e,e.useSourceOfProjectReferenceRedirect),B.preferNonRecursiveWatch=e.preferNonRecursiveWatch,B.watchDirectoryOfFailedLookupLocation=(e,t,n)=>L(e,t,n,w,z$.FailedLookupLocations),B.watchAffectingFileLocation=(e,t)=>O(e,t,2e3,w,z$.AffectingFileLocation),B.watchTypeRootsDirectory=(e,t,n)=>L(e,t,n,w,z$.TypeRoots),B.getCachedDirectoryStructureHost=()=>E,B.scheduleInvalidateResolutionsOfFailedLookupLocations=function(){if(!e.setTimeout||!e.clearTimeout)return z.invalidateResolutionsOfFailedLookupLocations();const t=ne();j("Scheduling invalidateFailedLookup"+(t?", Cancelled earlier one":"")),a=e.setTimeout(re,250,"timerToInvalidateFailedLookupResolutions")},B.onInvalidatedResolution=ie,B.onChangedAutomaticTypeDirectiveNames=ie,B.fileIsOpen=at,B.getCurrentProgram=H,B.writeLog=j,B.getParsedCommandLine=le;const z=m$(B,h?Ao(Uo(h,g)):g,!1);B.resolveModuleNameLiterals=He(e,e.resolveModuleNameLiterals),B.resolveModuleNames=He(e,e.resolveModuleNames),B.resolveModuleNameLiterals||B.resolveModuleNames||(B.resolveModuleNameLiterals=z.resolveModuleNameLiterals.bind(z)),B.resolveTypeReferenceDirectiveReferences=He(e,e.resolveTypeReferenceDirectiveReferences),B.resolveTypeReferenceDirectives=He(e,e.resolveTypeReferenceDirectives),B.resolveTypeReferenceDirectiveReferences||B.resolveTypeReferenceDirectives||(B.resolveTypeReferenceDirectiveReferences=z.resolveTypeReferenceDirectiveReferences.bind(z)),B.resolveLibrary=e.resolveLibrary?e.resolveLibrary.bind(e):z.resolveLibrary.bind(z),B.getModuleResolutionCache=e.resolveModuleNameLiterals||e.resolveModuleNames?He(e,e.getModuleResolutionCache):()=>z.getModuleResolutionCache();const q=!!(e.resolveModuleNameLiterals||e.resolveTypeReferenceDirectiveReferences||e.resolveModuleNames||e.resolveTypeReferenceDirectives)?He(e,e.hasInvalidatedResolutions)||st:at,U=e.resolveLibrary?He(e,e.hasInvalidatedLibResolutions)||st:at;return t=Y$(C,B),K(),h?{getCurrentProgram:$,getProgram:ae,close:V,getResolutionCache:W}:{getCurrentProgram:$,getProgram:ae,updateRootFileNames:function(e){pn.assert(!h,"Cannot update root file names with config file watch mode"),T=e,ie()},close:V,getResolutionCache:W};function V(){ne(),z.clear(),gx(d,e=>{e&&e.fileWatcher&&(e.fileWatcher.close(),e.fileWatcher=void 0)}),R&&(R.close(),R=void 0),null==_||_.clear(),_=void 0,c&&(gx(c,GU),c=void 0),i&&(gx(i,GU),i=void 0),r&&(gx(r,sx),r=void 0),s&&(gx(s,e=>{var t;null==(t=e.watcher)||t.close(),e.watcher=void 0,e.watchedDirectories&&gx(e.watchedDirectories,GU),e.watchedDirectories=void 0}),s=void 0),t=void 0}function W(){return z}function $(){return t}function H(){return t&&t.getProgramOrUndefined()}function K(){j("Synchronizing program"),pn.assert(C),pn.assert(T),ne();const n=$();f&&(I=G(),n&&rd(n.getCompilerOptions(),C)&&z.onChangesAffectModuleResolution());const{hasInvalidatedResolutions:o,hasInvalidatedLibResolutions:a}=z.createHasInvalidatedResolutions(q,U),{originalReadFile:c,originalFileExists:_,originalDirectoryExists:y,originalCreateDirectory:v,originalWriteFile:b,readFileWithCache:D}=rV(B,X);return zV(H(),T,C,e=>function(e,t){const n=d.get(e);if(!n)return;if(n.version)return n.version;const r=t(e);return void 0!==r?V$(B,r):void 0}(e,D),e=>B.fileExists(e),o,a,te,le,N)?F&&(u&&ee(fa.File_change_detected_Starting_incremental_compilation),t=x(void 0,void 0,B,t,S,N),F=!1):(u&&ee(fa.File_change_detected_Starting_incremental_compilation),function(e,n){j("CreatingProgramWith::"),j(` roots: ${JSON.stringify(T)}`),j(` options: ${JSON.stringify(C)}`),N&&j(` projectReferences: ${JSON.stringify(N)}`);const i=f||!H();f=!1,F=!1,z.startCachingPerDirectoryResolution(),B.hasInvalidatedResolutions=e,B.hasInvalidatedLibResolutions=n,B.hasChangedAutomaticTypeDirectiveNames=te;const o=H();t=x(T,C,B,t,S,N),z.finishCachingPerDirectoryResolution(t.getProgram(),o),qU(t.getProgram(),r||(r=new Map),pe),i&&z.updateTypeRootsWatch();if(p){for(const e of p)r.has(e)||d.delete(e);p=void 0}}(o,a)),u=!1,e.afterProgramCreate&&n!==t&&e.afterProgramCreate(t),B.readFile=c,B.fileExists=_,B.directoryExists=y,B.createDirectory=v,B.writeFile=b,null==l||l.forEach((e,t)=>{if(t){const n=null==s?void 0:s.get(t);n&&function(e,t,n){var r,i,o,a;n.watcher||(n.watcher=O(e,(n,r)=>{de(e,t,r);const i=null==s?void 0:s.get(t);i&&(i.updateLevel=2),z.removeResolutionsFromProjectReferenceRedirects(t),ie()},2e3,(null==(r=n.parsedCommandLine)?void 0:r.watchOptions)||w,z$.ConfigFileOfReferencedProject)),UU(n.watchedDirectories||(n.watchedDirectories=new Map),null==(i=n.parsedCommandLine)?void 0:i.wildcardDirectories,(r,i)=>{var o;return L(r,n=>{const i=X(n);E&&E.addOrDeleteFileOrDirectory(n,i),Z(i);const o=null==s?void 0:s.get(t);(null==o?void 0:o.parsedCommandLine)&&(VU({watchedDirPath:X(r),fileOrDirectory:n,fileOrDirectoryPath:i,configFileName:e,options:o.parsedCommandLine.options,program:o.parsedCommandLine.fileNames,currentDirectory:g,useCaseSensitiveFileNames:m,writeLog:j,toPath:X})||2!==o.updateLevel&&(o.updateLevel=1,ie()))},i,(null==(o=n.parsedCommandLine)?void 0:o.watchOptions)||w,z$.WildcardDirectoryOfReferencedProject)}),ge(t,null==(o=n.parsedCommandLine)?void 0:o.options,(null==(a=n.parsedCommandLine)?void 0:a.watchOptions)||w,z$.ExtendedConfigOfReferencedProject)}(e,t,n)}else UU(i||(i=new Map),k,me),h&&ge(X(h),C,w,z$.ExtendedConfigFile)}),l=void 0,t}function G(){return jb(C||y)}function X(e){return Ho(e,g,M)}function Q(e){return"boolean"==typeof e}function Y(e,t,n,r,i){const o=d.get(t);if(Q(o))return;const a="object"==typeof n?n.impliedNodeFormat:void 0;if(void 0===o||i||function(e){return"boolean"==typeof e.version}(o)||o.sourceFile.impliedNodeFormat!==a){const i=J(e,n,r);if(o)i?(o.sourceFile=i,o.version=i.version,o.fileWatcher||(o.fileWatcher=_e(t,e,ue,250,w,z$.SourceFile))):(o.fileWatcher&&o.fileWatcher.close(),d.set(t,!1));else if(i){const n=_e(t,e,ue,250,w,z$.SourceFile);d.set(t,{sourceFile:i,version:i.version,fileWatcher:n})}else d.set(t,!1);return i}return o.sourceFile}function Z(e){const t=d.get(e);void 0!==t&&(Q(t)?d.set(e,{version:!1}):t.version=!1)}function ee(t){e.onWatchStatusChange&&e.onWatchStatusChange(nk(t),I,C||y)}function te(){return z.hasChangedAutomaticTypeDirectiveNames()}function ne(){return!!a&&(e.clearTimeout(a),a=void 0,!0)}function re(){a=void 0,z.invalidateResolutionsOfFailedLookupLocations()&&ie()}function ie(){e.setTimeout&&e.clearTimeout&&(o&&e.clearTimeout(o),j("Scheduling update"),o=e.setTimeout(oe,250,"timerToUpdateProgram"))}function oe(){o=void 0,u=!0,ae()}function ae(){switch(n){case 1:!function(){j("Reloading new file names and options"),pn.assert(C),pn.assert(h),n=0,T=Vj(C.configFile.configFileSpecs,Uo(Ao(h),g),C,A,b),Cj(T,Uo(h,g),C.configFile.configFileSpecs,S,D)&&(F=!0);K()}();break;case 2:!function(){pn.assert(h),j(`Reloading config file: ${h}`),n=0,E&&E.clearCache();se(),f=!0,(l??(l=new Map)).set(void 0,void 0),K()}();break;default:K()}return $()}function se(){pn.assert(h),ce(TL(h,y,A,_||(_=new Map),v,b))}function ce(e){T=e.fileNames,C=e.options,w=e.watchOptions,N=e.projectReferences,k=e.wildcardDirectories,S=qV(e).slice(),D=Tj(e.raw),F=!0}function le(t){const n=X(t);let r=null==s?void 0:s.get(n);if(r){if(!r.updateLevel)return r.parsedCommandLine;if(r.parsedCommandLine&&1===r.updateLevel&&!e.getParsedCommandLine){j("Reloading new file names and options"),pn.assert(C);const e=Vj(r.parsedCommandLine.options.configFile.configFileSpecs,Uo(Ao(t),g),C,A);return r.parsedCommandLine={...r.parsedCommandLine,fileNames:e},r.updateLevel=void 0,r.parsedCommandLine}}j(`Loading config file: ${t}`);const i=e.getParsedCommandLine?e.getParsedCommandLine(t):function(e){const t=A.onUnRecoverableConfigFileDiagnostic;A.onUnRecoverableConfigFileDiagnostic=ot;const n=TL(e,void 0,A,_||(_=new Map),v);return A.onUnRecoverableConfigFileDiagnostic=t,n}(t);return r?(r.parsedCommandLine=i,r.updateLevel=void 0):(s||(s=new Map)).set(n,r={parsedCommandLine:i}),(l??(l=new Map)).set(n,t),i}function _e(e,t,n,r,i,o){return O(t,(t,r)=>n(t,r,e),r,i,o)}function ue(e,t,n){de(e,n,t),2===t&&d.has(n)&&z.invalidateResolutionOfFile(n),Z(n),ie()}function de(e,t,n){E&&E.addOrDeleteFile(e,t,n)}function pe(e,t){return(null==s?void 0:s.has(e))?R$:_e(e,t,fe,500,w,z$.MissingFile)}function fe(e,t,n){de(e,n,t),0===t&&r.has(n)&&(r.get(n).close(),r.delete(n),Z(n),ie())}function me(e,t){return L(e,t=>{pn.assert(h),pn.assert(C);const r=X(t);E&&E.addOrDeleteFileOrDirectory(t,r),Z(r),VU({watchedDirPath:X(e),fileOrDirectory:t,fileOrDirectoryPath:r,configFileName:h,extraFileExtensions:b,options:C,program:$()||T,currentDirectory:g,useCaseSensitiveFileNames:m,writeLog:j,toPath:X})||2!==n&&(n=1,ie())},t,w,z$.WildcardDirectory)}function ge(e,t,r,i){BU(e,t,c||(c=new Map),(e,t)=>O(e,(r,i)=>{var o;de(e,t,i),_&&zU(_,t,X);const a=null==(o=c.get(t))?void 0:o.projects;(null==a?void 0:a.size)&&a.forEach(e=>{if(h&&X(h)===e)n=2;else{const t=null==s?void 0:s.get(e);t&&(t.updateLevel=2),z.removeResolutionsFromProjectReferenceRedirects(e)}ie()})},2e3,r,i),X)}}var rH=(e=>(e[e.Unbuildable=0]="Unbuildable",e[e.UpToDate=1]="UpToDate",e[e.UpToDateWithUpstreamTypes=2]="UpToDateWithUpstreamTypes",e[e.OutputMissing=3]="OutputMissing",e[e.ErrorReadingFile=4]="ErrorReadingFile",e[e.OutOfDateWithSelf=5]="OutOfDateWithSelf",e[e.OutOfDateWithUpstream=6]="OutOfDateWithUpstream",e[e.OutOfDateBuildInfoWithPendingEmit=7]="OutOfDateBuildInfoWithPendingEmit",e[e.OutOfDateBuildInfoWithErrors=8]="OutOfDateBuildInfoWithErrors",e[e.OutOfDateOptions=9]="OutOfDateOptions",e[e.OutOfDateRoots=10]="OutOfDateRoots",e[e.UpstreamOutOfDate=11]="UpstreamOutOfDate",e[e.UpstreamBlocked=12]="UpstreamBlocked",e[e.ComputingUpstream=13]="ComputingUpstream",e[e.TsVersionOutputOfDate=14]="TsVersionOutputOfDate",e[e.UpToDateWithInputFileText=15]="UpToDateWithInputFileText",e[e.ContainerOnly=16]="ContainerOnly",e[e.ForceBuild=17]="ForceBuild",e))(rH||{});function iH(e){return wo(e,".json")?e:Jo(e,"tsconfig.json")}var oH=new Date(-864e13);function aH(e,t){return function(e,t,n){const r=e.get(t);let i;return r||(i=n(),e.set(t,i)),r||i}(e,t,()=>new Map)}function sH(e){return e.now?e.now():new Date}function cH(e){return!!e&&!!e.buildOrder}function lH(e){return cH(e)?e.buildOrder:e}function _H(e,t){return n=>{let r=t?`[${mV(x$(e),"")}] `:`${x$(e)} - `;r+=`${vV(n.messageText,e.newLine)}${e.newLine+e.newLine}`,e.write(r)}}function uH(e,t,n,r){const i=$$(e,t);return i.getModifiedTime=e.getModifiedTime?t=>e.getModifiedTime(t):ct,i.setModifiedTime=e.setModifiedTime?(t,n)=>e.setModifiedTime(t,n):ot,i.deleteFile=e.deleteFile?t=>e.deleteFile(t):ot,i.reportDiagnostic=n||y$(e),i.reportSolutionBuilderStatus=r||_H(e),i.now=He(e,e.now),i}function dH(e=uo,t,n,r,i){const o=uH(e,t,n,r);return o.reportErrorSummary=i,o}function pH(e=uo,t,n,r,i){const o=uH(e,t,n,r);return $e(o,J$(e,i)),o}function fH(e,t,n){return sK(!1,e,t,n)}function mH(e,t,n,r){return sK(!0,e,t,n,r)}function gH(e,t,n,r,i){const o=t,a=t,s=function(e){const t={};return MO.forEach(n=>{Ee(e,n.name)&&(t[n.name]=e[n.name])}),t.tscBuild=!0,t}(r),c=U$(o,()=>m.projectCompilerOptions);let l,_,u;W$(c),c.getParsedCommandLine=e=>xH(m,e,yH(m,e)),c.resolveModuleNameLiterals=He(o,o.resolveModuleNameLiterals),c.resolveTypeReferenceDirectiveReferences=He(o,o.resolveTypeReferenceDirectiveReferences),c.resolveLibrary=He(o,o.resolveLibrary),c.resolveModuleNames=He(o,o.resolveModuleNames),c.resolveTypeReferenceDirectives=He(o,o.resolveTypeReferenceDirectives),c.getModuleResolutionCache=He(o,o.getModuleResolutionCache),c.resolveModuleNameLiterals||c.resolveModuleNames||(l=qM(c.getCurrentDirectory(),c.getCanonicalFileName),c.resolveModuleNameLiterals=(e,t,n,r,i)=>OV(e,t,n,r,i,o,l,EV),c.getModuleResolutionCache=()=>l),c.resolveTypeReferenceDirectiveReferences||c.resolveTypeReferenceDirectives||(_=UM(c.getCurrentDirectory(),c.getCanonicalFileName,void 0,null==l?void 0:l.getPackageJsonInfoCache(),null==l?void 0:l.optionsToRedirectsKey),c.resolveTypeReferenceDirectiveReferences=(e,t,n,r,i)=>OV(e,t,n,r,i,o,_,IV)),c.resolveLibrary||(u=qM(c.getCurrentDirectory(),c.getCanonicalFileName,void 0,null==l?void 0:l.getPackageJsonInfoCache()),c.resolveLibrary=(e,t,n)=>WM(e,t,n,o,u)),c.getBuildInfo=(e,t)=>qH(m,e,yH(m,t),void 0);const{watchFile:d,watchDirectory:p,writeLog:f}=q$(a,r),m={host:o,hostWithWatch:a,parseConfigFileHost:eW(o),write:He(o,o.trace),options:r,baseCompilerOptions:s,rootNames:n,baseWatchOptions:i,resolvedConfigFilePaths:new Map,configFileCache:new Map,projectStatus:new Map,extendedConfigCache:new Map,buildInfoCache:new Map,outputTimeStamps:new Map,builderPrograms:new Map,diagnostics:new Map,projectPendingBuild:new Map,projectErrorsReported:new Map,compilerHost:c,moduleResolutionCache:l,typeReferenceDirectiveResolutionCache:_,libraryResolutionCache:u,buildOrder:void 0,readFileWithCache:e=>o.readFile(e),projectCompilerOptions:s,cache:void 0,allProjectBuildPending:!0,needsSummary:!0,watchAllProjectsPending:e,watch:e,allWatchedWildcardDirectories:new Map,allWatchedInputFiles:new Map,allWatchedConfigFiles:new Map,allWatchedExtendedConfigFiles:new Map,allWatchedPackageJsonFiles:new Map,filesWatched:new Map,lastCachedPackageJsonLookups:new Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:!1,watchFile:d,watchDirectory:p,writeLog:f};return m}function hH(e,t){return Ho(t,e.compilerHost.getCurrentDirectory(),e.compilerHost.getCanonicalFileName)}function yH(e,t){const{resolvedConfigFilePaths:n}=e,r=n.get(t);if(void 0!==r)return r;const i=hH(e,t);return n.set(t,i),i}function vH(e){return!!e.options}function bH(e,t){const n=e.configFileCache.get(t);return n&&vH(n)?n:void 0}function xH(e,t,n){const{configFileCache:r}=e,i=r.get(n);if(i)return vH(i)?i:void 0;let o;rr("SolutionBuilder::beforeConfigFileParsing");const{parseConfigFileHost:a,baseCompilerOptions:s,baseWatchOptions:c,extendedConfigCache:l,host:_}=e;let u;return _.getParsedCommandLine?(u=_.getParsedCommandLine(t),u||(o=nk(fa.File_0_not_found,t))):(a.onUnRecoverableConfigFileDiagnostic=e=>o=e,u=TL(t,s,a,l,c),a.onUnRecoverableConfigFileDiagnostic=ot),r.set(n,u||o),rr("SolutionBuilder::afterConfigFileParsing"),ir("SolutionBuilder::Config file parsing","SolutionBuilder::beforeConfigFileParsing","SolutionBuilder::afterConfigFileParsing"),u}function kH(e,t){return iH(zo(e.compilerHost.getCurrentDirectory(),t))}function SH(e,t){const n=new Map,r=new Map,i=[];let o,a;for(const e of t)s(e);return a?{buildOrder:o||_,circularDiagnostics:a}:o||_;function s(t,c){const l=yH(e,t);if(r.has(l))return;if(n.has(l))return void(c||(a||(a=[])).push(nk(fa.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,i.join("\r\n"))));n.set(l,!0),i.push(t);const _=xH(e,t,l);if(_&&_.projectReferences)for(const t of _.projectReferences){s(kH(e,t.path),c||t.circular)}i.pop(),r.set(l,!0),(o||(o=[])).push(t)}}function TH(e){return e.buildOrder||function(e){const t=SH(e,e.rootNames.map(t=>kH(e,t)));e.resolvedConfigFilePaths.clear();const n=new Set(lH(t).map(t=>yH(e,t))),r={onDeleteValue:ot};hx(e.configFileCache,n,r),hx(e.projectStatus,n,r),hx(e.builderPrograms,n,r),hx(e.diagnostics,n,r),hx(e.projectPendingBuild,n,r),hx(e.projectErrorsReported,n,r),hx(e.buildInfoCache,n,r),hx(e.outputTimeStamps,n,r),hx(e.lastCachedPackageJsonLookups,n,r),e.watch&&(hx(e.allWatchedConfigFiles,n,{onDeleteValue:sx}),e.allWatchedExtendedConfigFiles.forEach(e=>{e.projects.forEach(t=>{n.has(t)||e.projects.delete(t)}),e.close()}),hx(e.allWatchedWildcardDirectories,n,{onDeleteValue:e=>e.forEach(GU)}),hx(e.allWatchedInputFiles,n,{onDeleteValue:e=>e.forEach(sx)}),hx(e.allWatchedPackageJsonFiles,n,{onDeleteValue:e=>e.forEach(sx)}));return e.buildOrder=t}(e)}function CH(e,t,n){const r=t&&kH(e,t),i=TH(e);if(cH(i))return i;if(r){const t=yH(e,r);if(-1===S(i,n=>yH(e,n)===t))return}const o=r?SH(e,[r]):i;return pn.assert(!cH(o)),pn.assert(!n||void 0!==r),pn.assert(!n||o[o.length-1]===r),n?o.slice(0,o.length-1):o}function wH(e){e.cache&&NH(e);const{compilerHost:t,host:n}=e,r=e.readFileWithCache,i=t.getSourceFile,{originalReadFile:o,originalFileExists:a,originalDirectoryExists:s,originalCreateDirectory:c,originalWriteFile:l,getSourceFileWithCache:_,readFileWithCache:u}=rV(n,t=>hH(e,t),(...e)=>i.call(t,...e));e.readFileWithCache=u,t.getSourceFile=_,e.cache={originalReadFile:o,originalFileExists:a,originalDirectoryExists:s,originalCreateDirectory:c,originalWriteFile:l,originalReadFileWithCache:r,originalGetSourceFile:i}}function NH(e){if(!e.cache)return;const{cache:t,host:n,compilerHost:r,extendedConfigCache:i,moduleResolutionCache:o,typeReferenceDirectiveResolutionCache:a,libraryResolutionCache:s}=e;n.readFile=t.originalReadFile,n.fileExists=t.originalFileExists,n.directoryExists=t.originalDirectoryExists,n.createDirectory=t.originalCreateDirectory,n.writeFile=t.originalWriteFile,r.getSourceFile=t.originalGetSourceFile,e.readFileWithCache=t.originalReadFileWithCache,i.clear(),null==o||o.clear(),null==a||a.clear(),null==s||s.clear(),e.cache=void 0}function DH(e,t){e.projectStatus.delete(t),e.diagnostics.delete(t)}function FH({projectPendingBuild:e},t,n){const r=e.get(t);(void 0===r||re.projectPendingBuild.set(yH(e,t),0)),t&&t.throwIfCancellationRequested()}var PH=(e=>(e[e.Build=0]="Build",e[e.UpdateOutputFileStamps=1]="UpdateOutputFileStamps",e))(PH||{});function AH(e,t){return e.projectPendingBuild.delete(t),e.diagnostics.has(t)?1:0}function IH(e,t,n,r,i,o,a){let s,c,l=0;return{kind:0,project:t,projectPath:n,buildOrder:a,getCompilerOptions:()=>i.options,getCurrentDirectory:()=>e.compilerHost.getCurrentDirectory(),getBuilderProgram:()=>u(lt),getProgram:()=>u(e=>e.getProgramOrUndefined()),getSourceFile:e=>u(t=>t.getSourceFile(e)),getSourceFiles:()=>d(e=>e.getSourceFiles()),getOptionsDiagnostics:e=>d(t=>t.getOptionsDiagnostics(e)),getGlobalDiagnostics:e=>d(t=>t.getGlobalDiagnostics(e)),getConfigFileParsingDiagnostics:()=>d(e=>e.getConfigFileParsingDiagnostics()),getSyntacticDiagnostics:(e,t)=>d(n=>n.getSyntacticDiagnostics(e,t)),getAllDependencies:e=>d(t=>t.getAllDependencies(e)),getSemanticDiagnostics:(e,t)=>d(n=>n.getSemanticDiagnostics(e,t)),getSemanticDiagnosticsOfNextAffectedFile:(e,t)=>u(n=>n.getSemanticDiagnosticsOfNextAffectedFile&&n.getSemanticDiagnosticsOfNextAffectedFile(e,t)),emit:(n,r,i,o,a)=>n||o?u(s=>{var c,l;return s.emit(n,r,i,o,a||(null==(l=(c=e.host).getCustomTransformers)?void 0:l.call(c,t)))}):(m(0,i),f(r,i,a)),done:function(t,r,i){return m(3,t,r,i),rr("SolutionBuilder::Projects built"),AH(e,n)}};function u(e){return m(0),s&&e(s)}function d(e){return u(e)||_}function p(){var r,o,a;if(pn.assert(void 0===s),e.options.dry)return lK(e,fa.A_non_dry_build_would_build_project_0,t),c=1,void(l=2);if(e.options.verbose&&lK(e,fa.Building_project_0,t),0===i.fileNames.length)return dK(e,n,qV(i)),c=0,void(l=2);const{host:_,compilerHost:u}=e;if(e.projectCompilerOptions=i.options,null==(r=e.moduleResolutionCache)||r.update(i.options),null==(o=e.typeReferenceDirectiveResolutionCache)||o.update(i.options),s=_.createProgram(i.fileNames,i.options,u,function({options:e,builderPrograms:t,compilerHost:n},r,i){if(e.force)return;const o=t.get(r);return o||Y$(i.options,n)}(e,n,i),qV(i),i.projectReferences),e.watch){const t=null==(a=e.moduleResolutionCache)?void 0:a.getPackageJsonInfoCache().getInternalMap();e.lastCachedPackageJsonLookups.set(n,t&&new Set(je(t.values(),t=>e.host.realpath&&(EM(t)||t.directoryExists)?e.host.realpath(Jo(t.packageDirectory,"package.json")):Jo(t.packageDirectory,"package.json")))),e.builderPrograms.set(n,s)}l++}function f(r,a,_){var u,d,p;pn.assertIsDefined(s),pn.assert(1===l);const{host:f,compilerHost:m}=e,g=new Map,h=s.getCompilerOptions(),y=Lk(h);let v,b;const{emitResult:x,diagnostics:k}=j$(s,e=>f.reportDiagnostic(e),e.write,void 0,(t,i,o,a,c,l)=>{var _;const u=hH(e,t);if(g.set(hH(e,t),t),null==l?void 0:l.buildInfo){b||(b=sH(e.host));const r=null==(_=s.hasChangedEmitSignature)?void 0:_.call(s),i=zH(e,t,n);i?(i.buildInfo=l.buildInfo,i.modifiedTime=b,r&&(i.latestChangedDtsTime=b)):e.buildInfoCache.set(n,{path:hH(e,t),buildInfo:l.buildInfo,modifiedTime:b,latestChangedDtsTime:r?b:void 0})}const d=(null==l?void 0:l.differsOnlyInMap)?Vi(e.host,t):void 0;(r||m.writeFile)(t,i,o,a,c,l),(null==l?void 0:l.differsOnlyInMap)?e.host.setModifiedTime(t,d):!y&&e.watch&&(v||(v=JH(e,n))).set(u,b||(b=sH(e.host)))},a,void 0,_||(null==(d=(u=e.host).getCustomTransformers)?void 0:d.call(u,t)));return h.noEmitOnError&&k.length||!g.size&&8===o.type||$H(e,i,n,fa.Updating_unchanged_output_timestamps_of_project_0,g),e.projectErrorsReported.set(n,!0),c=(null==(p=s.hasChangedEmitSignature)?void 0:p.call(s))?0:2,k.length?(e.diagnostics.set(n,k),e.projectStatus.set(n,{type:0,reason:"it had errors"}),c|=4):(e.diagnostics.delete(n),e.projectStatus.set(n,{type:1,oldestOutputFileName:he(g.values())??SU(i,!f.useCaseSensitiveFileNames())})),function(e,t){t&&(e.host.afterProgramEmitAndDiagnostics&&e.host.afterProgramEmitAndDiagnostics(t),t.releaseProgram());e.projectCompilerOptions=e.baseCompilerOptions}(e,s),l=2,x}function m(o,s,_,u){for(;l<=o&&l<3;){const o=l;switch(l){case 0:p();break;case 1:f(_,s,u);break;case 2:GH(e,t,n,r,i,a,pn.checkDefined(c)),l++;break;default:on()}pn.assert(l>o)}}}function OH(e,t,n){if(!e.projectPendingBuild.size)return;if(cH(t))return;const{options:r,projectPendingBuild:i}=e;for(let o=0;or.options,getCurrentDirectory:()=>e.compilerHost.getCurrentDirectory(),updateOutputFileStatmps:()=>{KH(e,r,n),o=!1},done:()=>(o&&KH(e,r,n),rr("SolutionBuilder::Timestamps only updates"),AH(e,n))}}(e,t.project,t.projectPath,t.config,n)}function jH(e,t,n){const r=OH(e,t,n);return r?LH(e,r,t):r}function MH(e){return!!e.watcher}function RH(e,t){const n=hH(e,t),r=e.filesWatched.get(n);if(e.watch&&r){if(!MH(r))return r;if(r.modifiedTime)return r.modifiedTime}const i=Vi(e.host,t);return e.watch&&(r?r.modifiedTime=i:e.filesWatched.set(n,i)),i}function BH(e,t,n,r,i,o,a){const s=hH(e,t),c=e.filesWatched.get(s);if(c&&MH(c))c.callbacks.push(n);else{const l=e.watchFile(t,(t,n,r)=>{const i=pn.checkDefined(e.filesWatched.get(s));pn.assert(MH(i)),i.modifiedTime=r,i.callbacks.forEach(e=>e(t,n,r))},r,i,o,a);e.filesWatched.set(s,{callbacks:[n],watcher:l,modifiedTime:c})}return{close:()=>{const t=pn.checkDefined(e.filesWatched.get(s));pn.assert(MH(t)),1===t.callbacks.length?(e.filesWatched.delete(s),GU(t)):$t(t.callbacks,n)}}}function JH(e,t){if(!e.watch)return;let n=e.outputTimeStamps.get(t);return n||e.outputTimeStamps.set(t,n=new Map),n}function zH(e,t,n){const r=hH(e,t),i=e.buildInfoCache.get(n);return(null==i?void 0:i.path)===r?i:void 0}function qH(e,t,n,r){const i=hH(e,t),o=e.buildInfoCache.get(n);if(void 0!==o&&o.path===i)return o.buildInfo||void 0;const a=e.readFileWithCache(t),s=a?NU(t,a):void 0;return e.buildInfoCache.set(n,{path:i,buildInfo:s||!1,modifiedTime:r||Ui}),s}function UH(e,t,n,r){if(nS&&(b=n,S=t),C.add(r)}if(v?(w||(w=KW(v,f,d)),N=sd(w.roots,(e,t)=>C.has(t)?void 0:t)):N=p(GW(y,f,d),e=>C.has(e)?void 0:e),N)return{type:10,buildInfoFile:f,inputFile:N};if(!m){const r=xU(t,!d.useCaseSensitiveFileNames()),i=JH(e,n);for(const t of r){if(t===f)continue;const n=hH(e,t);let r=null==i?void 0:i.get(n);if(r||(r=Vi(e.host,t),null==i||i.set(n,r)),r===Ui)return{type:3,missingOutputFileName:t};if(rUH(e,t,x,k));if(E)return E;const P=e.lastCachedPackageJsonLookups.get(n),A=P&&cd(P,t=>UH(e,t,x,k));return A||{type:D?2:T?15:1,newestInputFileTime:S,newestInputFileName:b,oldestOutputFileName:k}}(e,t,n);return rr("SolutionBuilder::afterUpToDateCheck"),ir("SolutionBuilder::Up-to-date check","SolutionBuilder::beforeUpToDateCheck","SolutionBuilder::afterUpToDateCheck"),e.projectStatus.set(n,i),i}function $H(e,t,n,r,i){if(t.options.noEmit)return;let o;const a=aU(t.options),s=Lk(t.options);if(a&&s)return(null==i?void 0:i.has(hH(e,a)))||(e.options.verbose&&lK(e,r,t.options.configFilePath),e.host.setModifiedTime(a,o=sH(e.host)),zH(e,a,n).modifiedTime=o),void e.outputTimeStamps.delete(n);const{host:c}=e,l=xU(t,!c.useCaseSensitiveFileNames()),_=JH(e,n),u=_?new Set:void 0;if(!i||l.length!==i.size){let s=!!e.options.verbose;for(const d of l){const l=hH(e,d);(null==i?void 0:i.has(l))||(s&&(s=!1,lK(e,r,t.options.configFilePath)),c.setModifiedTime(d,o||(o=sH(e.host))),d===a?zH(e,a,n).modifiedTime=o:_&&(_.set(l,o),u.add(l)))}}null==_||_.forEach((e,t)=>{(null==i?void 0:i.has(t))||u.has(t)||_.delete(t)})}function HH(e,t,n){if(!t.composite)return;const r=pn.checkDefined(e.buildInfoCache.get(n));if(void 0!==r.latestChangedDtsTime)return r.latestChangedDtsTime||void 0;const i=r.buildInfo&&OW(r.buildInfo)&&r.buildInfo.latestChangedDtsFile?e.host.getModifiedTime(Uo(r.buildInfo.latestChangedDtsFile,Ao(r.path))):void 0;return r.latestChangedDtsTime=i||!1,i}function KH(e,t,n){if(e.options.dry)return lK(e,fa.A_non_dry_build_would_update_timestamps_for_output_of_project_0,t.options.configFilePath);$H(e,t,n,fa.Updating_output_timestamps_of_project_0),e.projectStatus.set(n,{type:1,oldestOutputFileName:SU(t,!e.host.useCaseSensitiveFileNames())})}function GH(e,t,n,r,i,o,a){if(!(e.options.stopBuildOnErrors&&4&a)&&i.options.composite)for(let i=r+1;ie.diagnostics.has(yH(e,t)))?c?2:1:0}(e,t,n,r,i,o);return rr("SolutionBuilder::afterBuild"),ir("SolutionBuilder::Build","SolutionBuilder::beforeBuild","SolutionBuilder::afterBuild"),a}function QH(e,t,n){rr("SolutionBuilder::beforeClean");const r=function(e,t,n){const r=CH(e,t,n);if(!r)return 3;if(cH(r))return uK(e,r.circularDiagnostics),4;const{options:i,host:o}=e,a=i.dry?[]:void 0;for(const t of r){const n=yH(e,t),r=xH(e,t,n);if(void 0===r){pK(e,n);continue}const i=xU(r,!o.useCaseSensitiveFileNames());if(!i.length)continue;const s=new Set(r.fileNames.map(t=>hH(e,t)));for(const t of i)s.has(hH(e,t))||o.fileExists(t)&&(a?a.push(t):(o.deleteFile(t),YH(e,n,0)))}a&&lK(e,fa.A_non_dry_build_would_delete_the_following_files_Colon_0,a.map(e=>`\r\n * ${e}`).join(""));return 0}(e,t,n);return rr("SolutionBuilder::afterClean"),ir("SolutionBuilder::Clean","SolutionBuilder::beforeClean","SolutionBuilder::afterClean"),r}function YH(e,t,n){e.host.getParsedCommandLine&&1===n&&(n=2),2===n&&(e.configFileCache.delete(t),e.buildOrder=void 0),e.needsSummary=!0,DH(e,t),FH(e,t,n),wH(e)}function ZH(e,t,n){e.reportFileChangeDetected=!0,YH(e,t,n),eK(e,250,!0)}function eK(e,t,n){const{hostWithWatch:r}=e;r.setTimeout&&r.clearTimeout&&(e.timerToBuildInvalidatedProject&&r.clearTimeout(e.timerToBuildInvalidatedProject),e.timerToBuildInvalidatedProject=r.setTimeout(tK,t,"timerToBuildInvalidatedProject",e,n))}function tK(e,t,n){rr("SolutionBuilder::beforeBuild");const r=function(e,t){e.timerToBuildInvalidatedProject=void 0,e.reportFileChangeDetected&&(e.reportFileChangeDetected=!1,e.projectErrorsReported.clear(),_K(e,fa.File_change_detected_Starting_incremental_compilation));let n=0;const r=TH(e),i=jH(e,r,!1);if(i)for(i.done(),n++;e.projectPendingBuild.size;){if(e.timerToBuildInvalidatedProject)return;const i=OH(e,r,!1);if(!i)break;if(1!==i.kind&&(t||5===n))return void eK(e,100,!1);LH(e,i,r).done(),1!==i.kind&&n++}return NH(e),r}(t,n);rr("SolutionBuilder::afterBuild"),ir("SolutionBuilder::Build","SolutionBuilder::beforeBuild","SolutionBuilder::afterBuild"),r&&fK(t,r)}function nK(e,t,n,r){e.watch&&!e.allWatchedConfigFiles.has(n)&&e.allWatchedConfigFiles.set(n,BH(e,t,()=>ZH(e,n,2),2e3,null==r?void 0:r.watchOptions,z$.ConfigFile,t))}function rK(e,t,n){BU(t,null==n?void 0:n.options,e.allWatchedExtendedConfigFiles,(t,r)=>BH(e,t,()=>{var t;return null==(t=e.allWatchedExtendedConfigFiles.get(r))?void 0:t.projects.forEach(t=>ZH(e,t,2))},2e3,null==n?void 0:n.watchOptions,z$.ExtendedConfigFile),t=>hH(e,t))}function iK(e,t,n,r){e.watch&&UU(aH(e.allWatchedWildcardDirectories,n),r.wildcardDirectories,(i,o)=>e.watchDirectory(i,o=>{var a;VU({watchedDirPath:hH(e,i),fileOrDirectory:o,fileOrDirectoryPath:hH(e,o),configFileName:t,currentDirectory:e.compilerHost.getCurrentDirectory(),options:r.options,program:e.builderPrograms.get(n)||(null==(a=bH(e,n))?void 0:a.fileNames),useCaseSensitiveFileNames:e.parseConfigFileHost.useCaseSensitiveFileNames,writeLog:t=>e.writeLog(t),toPath:t=>hH(e,t)})||ZH(e,n,1)},o,null==r?void 0:r.watchOptions,z$.WildcardDirectory,t))}function oK(e,t,n,r){e.watch&&yx(aH(e.allWatchedInputFiles,n),new Set(r.fileNames),{createNewValue:i=>BH(e,i,()=>ZH(e,n,0),250,null==r?void 0:r.watchOptions,z$.SourceFile,t),onDeleteValue:sx})}function aK(e,t,n,r){e.watch&&e.lastCachedPackageJsonLookups&&yx(aH(e.allWatchedPackageJsonFiles,n),e.lastCachedPackageJsonLookups.get(n),{createNewValue:i=>BH(e,i,()=>ZH(e,n,0),2e3,null==r?void 0:r.watchOptions,z$.PackageJson,t),onDeleteValue:sx})}function sK(e,t,n,r,i){const o=gH(e,t,n,r,i);return{build:(e,t,n,r)=>XH(o,e,t,n,r),clean:e=>QH(o,e),buildReferences:(e,t,n,r)=>XH(o,e,t,n,r,!0),cleanReferences:e=>QH(o,e,!0),getNextInvalidatedProject:e=>(EH(o,e),jH(o,TH(o),!1)),getBuildOrder:()=>TH(o),getUpToDateStatusOfProject:e=>{const t=kH(o,e),n=yH(o,t);return WH(o,xH(o,t,n),n)},invalidateProject:(e,t)=>YH(o,e,t||0),close:()=>function(e){gx(e.allWatchedConfigFiles,sx),gx(e.allWatchedExtendedConfigFiles,GU),gx(e.allWatchedWildcardDirectories,e=>gx(e,GU)),gx(e.allWatchedInputFiles,e=>gx(e,sx)),gx(e.allWatchedPackageJsonFiles,e=>gx(e,sx))}(o)}}function cK(e,t){return ca(t,e.compilerHost.getCurrentDirectory(),e.compilerHost.getCanonicalFileName)}function lK(e,t,...n){e.host.reportSolutionBuilderStatus(nk(t,...n))}function _K(e,t,...n){var r,i;null==(i=(r=e.hostWithWatch).onWatchStatusChange)||i.call(r,nk(t,...n),e.host.getNewLine(),e.baseCompilerOptions)}function uK({host:e},t){t.forEach(t=>e.reportDiagnostic(t))}function dK(e,t,n){uK(e,n),e.projectErrorsReported.set(t,!0),n.length&&e.diagnostics.set(t,n)}function pK(e,t){dK(e,t,[e.configFileCache.get(t)])}function fK(e,t){if(!e.needsSummary)return;e.needsSummary=!1;const n=e.watch||!!e.host.reportErrorSummary,{diagnostics:r}=e;let i=0,o=[];cH(t)?(mK(e,t.buildOrder),uK(e,t.circularDiagnostics),n&&(i+=T$(t.circularDiagnostics)),n&&(o=[...o,...C$(t.circularDiagnostics)])):(t.forEach(t=>{const n=yH(e,t);e.projectErrorsReported.has(n)||uK(e,r.get(n)||_)}),n&&r.forEach(e=>i+=T$(e)),n&&r.forEach(e=>[...o,...C$(e)])),e.watch?_K(e,w$(i),i):e.host.reportErrorSummary&&e.host.reportErrorSummary(i,o)}function mK(e,t){e.options.verbose&&lK(e,fa.Projects_in_this_build_Colon_0,t.map(t=>"\r\n * "+cK(e,t)).join(""))}function gK(e,t,n){e.options.verbose&&function(e,t,n){switch(n.type){case 5:return lK(e,fa.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,cK(e,t),cK(e,n.outOfDateOutputFileName),cK(e,n.newerInputFileName));case 6:return lK(e,fa.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,cK(e,t),cK(e,n.outOfDateOutputFileName),cK(e,n.newerProjectName));case 3:return lK(e,fa.Project_0_is_out_of_date_because_output_file_1_does_not_exist,cK(e,t),cK(e,n.missingOutputFileName));case 4:return lK(e,fa.Project_0_is_out_of_date_because_there_was_error_reading_file_1,cK(e,t),cK(e,n.fileName));case 7:return lK(e,fa.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,cK(e,t),cK(e,n.buildInfoFile));case 8:return lK(e,fa.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors,cK(e,t),cK(e,n.buildInfoFile));case 9:return lK(e,fa.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions,cK(e,t),cK(e,n.buildInfoFile));case 10:return lK(e,fa.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,cK(e,t),cK(e,n.buildInfoFile),cK(e,n.inputFile));case 1:if(void 0!==n.newestInputFileTime)return lK(e,fa.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2,cK(e,t),cK(e,n.newestInputFileName||""),cK(e,n.oldestOutputFileName||""));break;case 2:return lK(e,fa.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,cK(e,t));case 15:return lK(e,fa.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,cK(e,t));case 11:return lK(e,fa.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,cK(e,t),cK(e,n.upstreamProjectName));case 12:return lK(e,n.upstreamProjectBlocked?fa.Project_0_can_t_be_built_because_its_dependency_1_was_not_built:fa.Project_0_can_t_be_built_because_its_dependency_1_has_errors,cK(e,t),cK(e,n.upstreamProjectName));case 0:return lK(e,fa.Project_0_is_out_of_date_because_1,cK(e,t),n.reason);case 14:return lK(e,fa.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,cK(e,t),n.version,c);case 17:lK(e,fa.Project_0_is_being_forcibly_rebuilt,cK(e,t))}}(e,t,n)}var hK=(e=>(e[e.time=0]="time",e[e.count=1]="count",e[e.memory=2]="memory",e))(hK||{});function yK(e){const t=function(){const e=new Map;return e.set("Library",0),e.set("Definitions",0),e.set("TypeScript",0),e.set("JavaScript",0),e.set("JSON",0),e.set("Other",0),e}();return p(e.getSourceFiles(),n=>{const r=function(e,t){if(e.isSourceFileDefaultLibrary(t))return"Library";if(t.isDeclarationFile)return"Definitions";const n=t.path;return No(n,DS)?"TypeScript":No(n,PS)?"JavaScript":wo(n,".json")?"JSON":"Other"}(e,n),i=za(n).length;t.set(r,t.get(r)+i)}),t}function vK(e,t,n){return xK(e,n)?y$(e,!0):t}function bK(e){return!!e.writeOutputIsTTY&&e.writeOutputIsTTY()&&!e.getEnvironmentVariable("NO_COLOR")}function xK(e,t){return t&&void 0!==t.pretty?t.pretty:bK(e)}function kK(e){return e.options.all?de(zO.concat(ZO),(e,t)=>Ct(e.name,t.name)):D(zO.concat(ZO),e=>!!e.showInSimplifiedHelpView)}function SK(e){e.write(SL(fa.Version_0,c)+e.newLine)}function TK(e){if(!bK(e))return{bold:e=>e,blue:e=>e,blueBackground:e=>e,brightWhite:e=>e};const t=e.getEnvironmentVariable("OS")&&e.getEnvironmentVariable("OS").toLowerCase().includes("windows"),n=e.getEnvironmentVariable("WT_SESSION"),r=e.getEnvironmentVariable("TERM_PROGRAM")&&"vscode"===e.getEnvironmentVariable("TERM_PROGRAM");const i="truecolor"===e.getEnvironmentVariable("COLORTERM")||"xterm-256color"===e.getEnvironmentVariable("TERM");function o(e){return`${e}`}return{bold:function(e){return`${e}`},blue:function(e){return!t||n||r?`${e}`:o(e)},brightWhite:o,blueBackground:function(e){return i?`${e}`:`${e}`}}}function CK(e){return`--${e.name}${e.shortName?`, -${e.shortName}`:""}`}function wK(e,t,n,r){var i;const o=[],a=TK(e),s=CK(t),c=function(e){if("object"===e.type)return;return{valueType:function(e){switch(pn.assert("listOrElement"!==e.type),e.type){case"string":case"number":case"boolean":return SL(fa.type_Colon);case"list":return SL(fa.one_or_more_Colon);default:return SL(fa.one_of_Colon)}}(e),possibleValues:function e(t){let n;switch(t.type){case"string":case"number":case"boolean":n=t.type;break;case"list":case"listOrElement":n=e(t.element);break;case"object":n="";break;default:const r={};return t.type.forEach((e,n)=>{var i;(null==(i=t.deprecatedKeys)?void 0:i.has(n))||(r[e]||(r[e]=[])).push(n)}),Object.entries(r).map(([,e])=>e.join("/")).join(", ")}return n}(e)}}(t),l="object"==typeof t.defaultValueDescription?SL(t.defaultValueDescription):(_=t.defaultValueDescription,u="list"===t.type||"listOrElement"===t.type?t.element.type:t.type,void 0!==_&&"object"==typeof u?je(u.entries()).filter(([,e])=>e===_).map(([e])=>e).join("/"):String(_));var _,u;const d=(null==(i=e.getWidthOfTerminal)?void 0:i.call(e))??0;if(d>=80){let i="";t.description&&(i=SL(t.description)),o.push(...f(s,i,n,r,d,!0),e.newLine),p(c,t)&&(c&&o.push(...f(c.valueType,c.possibleValues,n,r,d,!1),e.newLine),l&&o.push(...f(SL(fa.default_Colon),l,n,r,d,!1),e.newLine)),o.push(e.newLine)}else{if(o.push(a.blue(s),e.newLine),t.description){const e=SL(t.description);o.push(e)}if(o.push(e.newLine),p(c,t)){if(c&&o.push(`${c.valueType} ${c.possibleValues}`),l){c&&o.push(e.newLine);const t=SL(fa.default_Colon);o.push(`${t} ${l}`)}o.push(e.newLine)}o.push(e.newLine)}return o;function p(e,t){const n=t.defaultValueDescription;return t.category!==fa.Command_line_Options&&(!C(["string"],null==e?void 0:e.possibleValues)||!C([void 0,"false","n/a"],n))}function f(e,t,n,r,i,o){const s=[];let c=!0,l=t;const _=i-r;for(;l.length>0;){let t="";c?(t=e.padStart(n),t=t.padEnd(r),t=o?a.blue(t):t):t="".padStart(r);const i=l.substr(0,_);l=l.slice(_),s.push(`${t}${i}`),c=!1}return s}}function NK(e,t){let n=0;for(const e of t){const t=CK(e).length;n=n>t?n:t}const r=n+2,i=r+2;let o=[];for(const n of t){const t=wK(e,n,r,i);o=[...o,...t]}return o[o.length-2]!==e.newLine&&o.push(e.newLine),o}function DK(e,t,n,r,i,o){let a=[];if(a.push(TK(e).bold(t)+e.newLine+e.newLine),i&&a.push(i+e.newLine+e.newLine),!r)return a=[...a,...NK(e,n)],o&&a.push(o+e.newLine+e.newLine),a;const s=new Map;for(const e of n){if(!e.category)continue;const t=SL(e.category),n=s.get(t)??[];n.push(e),s.set(t,n)}return s.forEach((t,n)=>{a.push(`### ${n}${e.newLine}${e.newLine}`),a=[...a,...NK(e,t)]}),o&&a.push(o+e.newLine+e.newLine),a}function FK(e,t){let n=[...EK(e,`${SL(fa.tsc_Colon_The_TypeScript_Compiler)} - ${SL(fa.Version_0,c)}`)];n=[...n,...DK(e,SL(fa.BUILD_OPTIONS),D(t,e=>e!==ZO),!1,tk(fa.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0,"https://aka.ms/tsc-composite-builds"))];for(const t of n)e.write(t)}function EK(e,t){var n;const r=TK(e),i=[],o=(null==(n=e.getWidthOfTerminal)?void 0:n.call(e))??0,a=r.blueBackground("".padStart(5)),s=r.blueBackground(r.brightWhite("TS ".padStart(5)));if(o>=t.length+5){const n=(o>120?120:o)-5;i.push(t.padEnd(n)+a+e.newLine),i.push("".padStart(n)+s+e.newLine)}else i.push(t+e.newLine),i.push(e.newLine);return i}function PK(e,t){t.options.all?function(e,t,n,r){let i=[...EK(e,`${SL(fa.tsc_Colon_The_TypeScript_Compiler)} - ${SL(fa.Version_0,c)}`)];i=[...i,...DK(e,SL(fa.ALL_COMPILER_OPTIONS),t,!0,void 0,tk(fa.You_can_learn_about_all_of_the_compiler_options_at_0,"https://aka.ms/tsc"))],i=[...i,...DK(e,SL(fa.WATCH_OPTIONS),r,!1,SL(fa.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon))],i=[...i,...DK(e,SL(fa.BUILD_OPTIONS),D(n,e=>e!==ZO),!1,tk(fa.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0,"https://aka.ms/tsc-composite-builds"))];for(const t of i)e.write(t)}(e,kK(t),eL,jO):function(e,t){const n=TK(e);let r=[...EK(e,`${SL(fa.tsc_Colon_The_TypeScript_Compiler)} - ${SL(fa.Version_0,c)}`)];r.push(n.bold(SL(fa.COMMON_COMMANDS))+e.newLine+e.newLine),a("tsc",fa.Compiles_the_current_project_tsconfig_json_in_the_working_directory),a("tsc app.ts util.ts",fa.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options),a("tsc -b",fa.Build_a_composite_project_in_the_working_directory),a("tsc --init",fa.Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory),a("tsc -p ./path/to/tsconfig.json",fa.Compiles_the_TypeScript_project_located_at_the_specified_path),a("tsc --help --all",fa.An_expanded_version_of_this_information_showing_all_possible_compiler_options),a(["tsc --noEmit","tsc --target esnext"],fa.Compiles_the_current_project_with_additional_settings);const i=t.filter(e=>e.isCommandLineOnly||e.category===fa.Command_line_Options),o=t.filter(e=>!C(i,e));r=[...r,...DK(e,SL(fa.COMMAND_LINE_FLAGS),i,!1,void 0,void 0),...DK(e,SL(fa.COMMON_COMPILER_OPTIONS),o,!1,void 0,tk(fa.You_can_learn_about_all_of_the_compiler_options_at_0,"https://aka.ms/tsc"))];for(const t of r)e.write(t);function a(t,i){const o="string"==typeof t?[t]:t;for(const t of o)r.push(" "+n.blue(t)+e.newLine);r.push(" "+SL(i)+e.newLine+e.newLine)}}(e,kK(t))}function AK(e,t,n){let r,i=y$(e);if(n.options.locale&&pc(n.options.locale,e,n.errors),n.errors.length>0)return n.errors.forEach(i),e.exit(1);if(n.options.init)return function(e,t,n){const r=e.getCurrentDirectory(),i=Vo(Jo(r,"tsconfig.json"));if(e.fileExists(i))t(nk(fa.A_tsconfig_json_file_is_already_defined_at_Colon_0,i));else{e.writeFile(i,ij(n,e.newLine));const t=[e.newLine,...EK(e,"Created a new tsconfig.json")];t.push("You can learn more at https://aka.ms/tsconfig"+e.newLine);for(const n of t)e.write(n)}}(e,i,n.options),e.exit(0);if(n.options.version)return SK(e),e.exit(0);if(n.options.help||n.options.all)return PK(e,n),e.exit(0);if(n.options.watch&&n.options.listFilesOnly)return i(nk(fa.Options_0_and_1_cannot_be_combined,"watch","listFilesOnly")),e.exit(1);if(n.options.project){if(0!==n.fileNames.length)return i(nk(fa.Option_project_cannot_be_mixed_with_source_files_on_a_command_line)),e.exit(1);const t=Vo(n.options.project);if(!t||e.directoryExists(t)){if(r=Jo(t,"tsconfig.json"),!e.fileExists(r))return i(nk(fa.Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0,n.options.project)),e.exit(1)}else if(r=t,!e.fileExists(r))return i(nk(fa.The_specified_path_does_not_exist_Colon_0,n.options.project)),e.exit(1)}else if(0===n.fileNames.length){r=XU(Vo(e.getCurrentDirectory()),t=>e.fileExists(t))}if(0===n.fileNames.length&&!r)return n.options.showConfig?i(nk(fa.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0,Vo(e.getCurrentDirectory()))):(SK(e),PK(e,n)),e.exit(1);const o=e.getCurrentDirectory(),a=oj(n.options,e=>Uo(e,o));if(r){const o=new Map,s=S$(r,a,o,n.watchOptions,e,i);if(a.showConfig)return 0!==s.errors.length?(i=vK(e,i,s.options),s.errors.forEach(i),e.exit(1)):(e.write(JSON.stringify(XL(s,r,e),null,4)+e.newLine),e.exit(0));if(i=vK(e,i,s.options),ax(s.options)){if(LK(e,i))return;return function(e,t,n,r,i,o,a){const s=G$({configFileName:r.options.configFilePath,optionsToExtend:i,watchOptionsToExtend:o,system:e,reportDiagnostic:n,reportWatchStatus:VK(e,r.options)});return UK(e,t,s),s.configFileParsingResult=r,s.extendedConfigCache=a,nH(s)}(e,t,i,s,a,n.watchOptions,o)}Lk(s.options)?JK(e,t,i,s):BK(e,t,i,s)}else{if(a.showConfig)return e.write(JSON.stringify(XL(n,Jo(o,"tsconfig.json"),e),null,4)+e.newLine),e.exit(0);if(i=vK(e,i,a),ax(a)){if(LK(e,i))return;return function(e,t,n,r,i,o){const a=X$({rootFiles:r,options:i,watchOptions:o,system:e,reportDiagnostic:n,reportWatchStatus:VK(e,i)});return UK(e,t,a),nH(a)}(e,t,i,n.fileNames,a,n.watchOptions)}Lk(a)?JK(e,t,i,{...n,options:a}):BK(e,t,i,{...n,options:a})}}function IK(e){if(e.length>0&&45===e[0].charCodeAt(0)){const t=e[0].slice(45===e[0].charCodeAt(1)?2:1).toLowerCase();return t===ZO.name||t===ZO.shortName}return!1}function OK(e,t,n){if(IK(n)){const{buildOptions:r,watchOptions:i,projects:o,errors:a}=kL(n);if(!r.generateCpuProfile||!e.enableCPUProfiler)return MK(e,t,r,i,o,a);e.enableCPUProfiler(r.generateCpuProfile,()=>MK(e,t,r,i,o,a))}const r=hL(n,t=>e.readFile(t));if(!r.options.generateCpuProfile||!e.enableCPUProfiler)return AK(e,t,r);e.enableCPUProfiler(r.options.generateCpuProfile,()=>AK(e,t,r))}function LK(e,t){return(!e.watchFile||!e.watchDirectory)&&(t(nk(fa.The_current_host_does_not_support_the_0_option,"--watch")),e.exit(1),!0)}var jK=2;function MK(e,t,n,r,i,o){const a=vK(e,y$(e),n);if(n.locale&&pc(n.locale,e,o),o.length>0)return o.forEach(a),e.exit(1);if(n.help)return SK(e),FK(e,tL),e.exit(0);if(0===i.length)return SK(e),FK(e,tL),e.exit(0);if(!e.getModifiedTime||!e.setModifiedTime||n.clean&&!e.deleteFile)return a(nk(fa.The_current_host_does_not_support_the_0_option,"--build")),e.exit(1);if(n.watch){if(LK(e,a))return;const o=pH(e,void 0,a,_H(e,xK(e,n)),VK(e,n));o.jsDocParsingMode=jK;const s=WK(e,n);zK(e,t,o,s);const c=o.onWatchStatusChange;let l=!1;o.onWatchStatusChange=(e,t,n,r)=>{null==c||c(e,t,n,r),!l||e.code!==fa.Found_0_errors_Watching_for_file_changes.code&&e.code!==fa.Found_1_error_Watching_for_file_changes.code||$K(_,s)};const _=mH(o,i,n,r);return _.build(),$K(_,s),l=!0,_}const s=dH(e,void 0,a,_H(e,xK(e,n)),RK(e,n));s.jsDocParsingMode=jK;const c=WK(e,n);zK(e,t,s,c);const l=fH(s,i,n),_=n.clean?l.clean():l.build();return $K(l,c),mr(),e.exit(_)}function RK(e,t){return xK(e,t)?(t,n)=>e.write(D$(t,n,e.newLine,e)):void 0}function BK(e,t,n,r){const{fileNames:i,options:o,projectReferences:a}=r,s=nV(o,void 0,e);s.jsDocParsingMode=jK;const c=s.getCurrentDirectory(),l=Ht(s.useCaseSensitiveFileNames());rV(s,e=>Ho(e,c,l)),GK(e,o,!1);const _=$V({rootNames:i,options:o,projectReferences:a,host:s,configFileParsingDiagnostics:qV(r)}),u=M$(_,n,t=>e.write(t+e.newLine),RK(e,o));return QK(e,_,void 0),t(_),e.exit(u)}function JK(e,t,n,r){const{options:i,fileNames:o,projectReferences:a}=r;GK(e,i,!1);const s=Z$(i,e);s.jsDocParsingMode=jK;const c=Q$({host:s,system:e,rootNames:o,options:i,configFileParsingDiagnostics:qV(r),projectReferences:a,reportDiagnostic:n,reportErrorSummary:RK(e,i),afterProgramEmitAndDiagnostics:n=>{QK(e,n.getProgram(),void 0),t(n)}});return e.exit(c)}function zK(e,t,n,r){qK(e,n,!0),n.afterProgramEmitAndDiagnostics=n=>{QK(e,n.getProgram(),r),t(n)}}function qK(e,t,n){const r=t.createProgram;t.createProgram=(t,i,o,a,s,c)=>(pn.assert(void 0!==t||void 0===i&&!!a),void 0!==i&&GK(e,i,n),r(t,i,o,a,s,c))}function UK(e,t,n){n.jsDocParsingMode=jK,qK(e,n,!1);const r=n.afterProgramCreate;n.afterProgramCreate=n=>{r(n),QK(e,n.getProgram(),void 0),t(n)}}function VK(e,t){return k$(e,xK(e,t))}function WK(e,t){if(e===uo&&t.extendedDiagnostics)return dr(),function(){let e;return{addAggregateStatistic:t,forEachAggregateStatistics:n,clear:r};function t(t){const n=null==e?void 0:e.get(t.name);n?2===n.type?n.value=Math.max(n.value,t.value):n.value+=t.value:(e??(e=new Map)).set(t.name,t)}function n(t){null==e||e.forEach(t)}function r(){e=void 0}}()}function $K(e,t){if(!t)return;if(!ur())return void uo.write(fa.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message+"\n");const n=[];function r(e){const t=or(e);t&&n.push({name:i(e),value:t,type:1})}function i(e){return e.replace("SolutionBuilder::","")}n.push({name:"Projects in scope",value:lH(e.getBuildOrder()).length,type:1}),r("SolutionBuilder::Projects built"),r("SolutionBuilder::Timestamps only updates"),r("SolutionBuilder::Bundles updated"),t.forEachAggregateStatistics(e=>{e.name=`Aggregate ${e.name}`,n.push(e)}),sr((e,t)=>{XK(e)&&n.push({name:`${i(e)} time`,value:t,type:0})}),pr(),dr(),t.clear(),YK(uo,n)}function HK(e,t){return e===uo&&(t.diagnostics||t.extendedDiagnostics)}function KK(e,t){return e===uo&&t.generateTrace}function GK(e,t,n){HK(e,t)&&dr(e),KK(e,t)&&fr(n?"build":"project",t.generateTrace,t.configFilePath)}function XK(e){return Qt(e,"SolutionBuilder::")}function QK(e,t,n){var r;const i=t.getCompilerOptions();let o;if(KK(e,i)&&(null==(r=Gn)||r.stopTracing()),HK(e,i)){o=[];const r=e.getMemoryUsage?e.getMemoryUsage():-1;s("Files",t.getSourceFiles().length);const l=yK(t);if(i.extendedDiagnostics)for(const[e,t]of l.entries())s("Lines of "+e,t);else s("Lines",h(l.values(),(e,t)=>e+t,0));s("Identifiers",t.getIdentifierCount()),s("Symbols",t.getSymbolCount()),s("Types",t.getTypeCount()),s("Instantiations",t.getInstantiationCount()),r>=0&&a({name:"Memory used",value:r,type:2},!0);const _=ur(),u=_?ar("Program"):0,d=_?ar("Bind"):0,p=_?ar("Check"):0,f=_?ar("Emit"):0;if(i.extendedDiagnostics){const e=t.getRelationCacheSizes();s("Assignability cache size",e.assignable),s("Identity cache size",e.identity),s("Subtype cache size",e.subtype),s("Strict subtype cache size",e.strictSubtype),_&&sr((e,t)=>{XK(e)||c(`${e} time`,t,!0)})}else _&&(c("I/O read",ar("I/O Read"),!0),c("I/O write",ar("I/O Write"),!0),c("Parse time",u,!0),c("Bind time",d,!0),c("Check time",p,!0),c("Emit time",f,!0));_&&c("Total time",u+d+p+f,!1),YK(e,o),_?n?(sr(e=>{XK(e)||lr(e)}),cr(e=>{XK(e)||_r(e)})):pr():e.write(fa.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message+"\n")}function a(e,t){o.push(e),t&&(null==n||n.addAggregateStatistic(e))}function s(e,t){a({name:e,value:t,type:1},!0)}function c(e,t,n){a({name:e,value:t,type:0},n)}}function YK(e,t){let n=0,r=0;for(const e of t){e.name.length>n&&(n=e.name.length);const t=ZK(e);t.length>r&&(r=t.length)}for(const i of t)e.write(`${i.name}:`.padEnd(n+2)+ZK(i).toString().padStart(r)+e.newLine)}function ZK(e){switch(e.type){case 1:return""+e.value;case 0:return(e.value/1e3).toFixed(2)+"s";case 2:return Math.round(e.value/1e3)+"K";default:pn.assertNever(e.type)}}function eG(e,t=!0){return{type:e,reportFallback:t}}var tG=eG(void 0,!1),nG=eG(void 0,!1),rG=eG(void 0,!0);function iG(e,t){const n=Wk(e,"strictNullChecks");return{serializeTypeOfDeclaration:function(e,n,r){switch(e.kind){case 170:case 342:return u(e,n,r);case 261:return function(e,n,r){var i;const o=yv(e);let s=rG;o?s=eG(a(o,r,e,n)):!e.initializer||1!==(null==(i=n.declarations)?void 0:i.length)&&1!==N(n.declarations,fE)||t.isExpandoFunctionDeclaration(e)||F(e)||(s=h(e.initializer,r,void 0,void 0,uf(e)));return void 0!==s.type?s.type:d(e,n,r,s.reportFallback)}(e,n,r);case 172:case 349:case 173:return function(e,n,r){const i=yv(e),o=t.requiresAddingImplicitUndefined(e,n,r.enclosingDeclaration);let s=rG;if(i)s=eG(a(i,r,e,n,o));else{const t=AD(e)?e.initializer:void 0;if(t&&!F(e)){s=h(t,r,void 0,o,sf(e))}}return void 0!==s.type?s.type:d(e,n,r,s.reportFallback)}(e,n,r);case 209:return d(e,n,r);case 278:return l(e.expression,r,void 0,!0);case 212:case 213:case 227:return function(e,t,n){const r=yv(e);let i;r&&(i=a(r,n,e,t));const o=n.suppressReportInferenceFallback;n.suppressReportInferenceFallback=!0;const s=i??d(e,t,n,!1);return n.suppressReportInferenceFallback=o,s}(e,n,r);case 304:case 305:return function(e,n,r){const i=yv(e);let a;i&&t.canReuseTypeNodeAnnotation(r,e,i,n)&&(a=o(i,r));if(!a&&304===e.kind){const i=e.initializer,s=FA(i)?EA(i):235===i.kind||217===i.kind?i.type:void 0;s&&!wl(s)&&t.canReuseTypeNodeAnnotation(r,e,s,n)&&(a=o(s,r))}return a??d(e,n,r,!1)}(e,n,r);default:pn.assertNever(e,`Node needs to be an inferrable node, found ${pn.formatSyntaxKind(e.kind)}`)}},serializeReturnTypeForSignature:function(e,t,n){switch(e.kind){case 178:return c(e,t,n);case 175:case 263:case 181:case 174:case 180:case 177:case 179:case 182:case 185:case 186:case 219:case 220:case 318:case 324:return D(e,t,n);default:pn.assertNever(e,`Node needs to be an inferrable node, found ${pn.formatSyntaxKind(e.kind)}`)}},serializeTypeOfExpression:l,serializeTypeOfAccessor:c,tryReuseExistingTypeNode(e,n){if(t.canReuseTypeNode(e,n))return i(e,n)}};function r(e,n,r=n){return void 0===n?void 0:t.markNodeReuse(e,16&n.flags?n:bw.cloneNode(n),r??n)}function i(n,i){const{finalizeBoundary:o,startRecoveryScope:a,hadError:s,markError:c}=t.createRecoveryBoundary(n),l=bJ(i,_,T_);if(o())return n.approximateLength+=i.end-i.pos,l;function _(i){if(s())return i;const o=a(),l=LC(i)?t.enterNewScope(n,i):void 0,u=function(i){var o;if(fP(i))return bJ(i.type,_,T_);if(bP(i)||320===i.kind)return bw.createKeywordTypeNode(133);if(xP(i))return bw.createKeywordTypeNode(159);if(kP(i))return bw.createUnionTypeNode([bJ(i.type,_,T_),bw.createLiteralTypeNode(bw.createNull())]);if(TP(i))return bw.createUnionTypeNode([bJ(i.type,_,T_),bw.createKeywordTypeNode(157)]);if(SP(i))return bJ(i.type,_);if(wP(i))return bw.createArrayTypeNode(bJ(i.type,_,T_));if(FP(i))return bw.createTypeLiteralNode(P(i.jsDocPropertyTags,e=>{const r=bJ(uD(e.name)?e.name:e.name.right,_,uD),o=t.getJsDocPropertyOverride(n,i,e);return bw.createPropertySignature(void 0,r,e.isBracketed||e.typeExpression&&TP(e.typeExpression.type)?bw.createToken(58):void 0,o||e.typeExpression&&bJ(e.typeExpression.type,_,T_)||bw.createKeywordTypeNode(133))}));if(UD(i)&&uD(i.typeName)&&""===i.typeName.escapedText)return kw(bw.createKeywordTypeNode(133),i);if((BF(i)||UD(i))&&Rm(i))return bw.createTypeLiteralNode([bw.createIndexSignature(void 0,[bw.createParameterDeclaration(void 0,void 0,"x",void 0,bJ(i.typeArguments[0],_,T_))],bJ(i.typeArguments[1],_,T_))]);if(CP(i)){if(Pg(i)){let e;return bw.createConstructorTypeNode(void 0,xJ(i.typeParameters,_,DD),J(i.parameters,(r,i)=>r.name&&uD(r.name)&&"new"===r.name.escapedText?void(e=r.type):bw.createParameterDeclaration(void 0,l(r),t.markNodeReuse(n,bw.createIdentifier(u(r,i)),r),bw.cloneNode(r.questionToken),bJ(r.type,_,T_),void 0)),bJ(e||i.type,_,T_)||bw.createKeywordTypeNode(133))}return bw.createFunctionTypeNode(xJ(i.typeParameters,_,DD),P(i.parameters,(e,r)=>bw.createParameterDeclaration(void 0,l(e),t.markNodeReuse(n,bw.createIdentifier(u(e,r)),e),bw.cloneNode(e.questionToken),bJ(e.type,_,T_),void 0)),bJ(i.type,_,T_)||bw.createKeywordTypeNode(133))}if(iF(i))return t.canReuseTypeNode(n,i)||c(),i;if(DD(i)){const{node:e}=t.trackExistingEntityName(n,i.name);return bw.updateTypeParameterDeclaration(i,xJ(i.modifiers,_,r_),e,bJ(i.constraint,_,T_),bJ(i.default,_,T_))}if(aF(i)){const e=d(i);return e||(c(),i)}if(UD(i)){const e=m(i);return e||(c(),i)}if(gf(i)){if(132===(null==(o=i.attributes)?void 0:o.token))return c(),i;if(!t.canReuseTypeNode(n,i))return t.serializeExistingTypeNode(n,i);const e=g(i,i.argument.literal),a=e===i.argument.literal?r(n,i.argument.literal):e;return bw.updateImportTypeNode(i,a===i.argument.literal?r(n,i.argument):bw.createLiteralTypeNode(a),bJ(i.attributes,_,PE),bJ(i.qualifier,_,i_),xJ(i.typeArguments,_,T_),i.isTypeOf)}if(Nc(i)&&168===i.name.kind&&!t.hasLateBindableName(i)){if(!qh(i))return a(i,_);if(t.shouldRemoveDeclaration(n,i))return}if(s_(i)&&!i.type||AD(i)&&!i.type&&!i.initializer||PD(i)&&!i.type&&!i.initializer||FD(i)&&!i.type&&!i.initializer){let e=a(i,_);return e===i&&(e=t.markNodeReuse(n,bw.cloneNode(i),i)),e.type=bw.createKeywordTypeNode(133),FD(i)&&(e.modifiers=void 0),e}if($D(i)){const e=f(i);return e||(c(),i)}if(ND(i)&&ub(i.expression)){const{node:r,introducesError:o}=t.trackExistingEntityName(n,i.expression);if(o){const r=t.serializeTypeOfExpression(n,i.expression);let o;if(cF(r))o=r.literal;else{const e=t.evaluateEntityNameExpression(i.expression),a="string"==typeof e.value?bw.createStringLiteral(e.value,void 0):"number"==typeof e.value?bw.createNumericLiteral(e.value,0):void 0;if(!a)return lF(r)&&t.trackComputedName(n,i.expression),i;o=a}return 11===o.kind&&vs(o.text,Sk(e))?bw.createIdentifier(o.text):9!==o.kind||o.text.startsWith("-")?bw.updateComputedPropertyName(i,o):o}return bw.updateComputedPropertyName(i,r)}if(qD(i)){let e;if(uD(i.parameterName)){const{node:r,introducesError:o}=t.trackExistingEntityName(n,i.parameterName);o&&c(),e=r}else e=bw.cloneNode(i.parameterName);return bw.updateTypePredicateNode(i,bw.cloneNode(i.assertsModifier),e,bJ(i.type,_,T_))}if(GD(i)||HD(i)||sF(i)){const e=a(i,_),r=t.markNodeReuse(n,e===i?bw.cloneNode(i):e,i);return ww(r,rp(r)|(1024&n.flags&&HD(i)?0:1)),r}if(KN(i)&&268435456&n.flags&&!i.singleQuote){const e=bw.cloneNode(i);return e.singleQuote=!0,e}if(tF(i)){const e=bJ(i.checkType,_,T_),r=t.enterNewScope(n,i),o=bJ(i.extendsType,_,T_),a=bJ(i.trueType,_,T_);r();const s=bJ(i.falseType,_,T_);return bw.updateConditionalTypeNode(i,e,o,a,s)}if(oF(i))if(158===i.operator&&155===i.type.kind){if(!t.canReuseTypeNode(n,i))return c(),i}else if(143===i.operator){const e=p(i);return e||(c(),i)}return a(i,_);function a(e,t){return EJ(e,t,void 0,!n.enclosingFile||n.enclosingFile!==Sd(e)?s:void 0)}function s(e,t,n,r,i){let o=xJ(e,t,n,r,i);return o&&(-1===o.pos&&-1===o.end||(o===e&&(o=bw.createNodeArray(e.slice(),e.hasTrailingComma)),ET(o,-1,-1))),o}function l(e){return e.dotDotDotToken||(e.type&&wP(e.type)?bw.createToken(26):void 0)}function u(e,t){return e.name&&uD(e.name)&&"this"===e.name.escapedText?"this":l(e)?"args":`arg${t}`}function g(e,r){const i=t.getModuleSpecifierOverride(n,e,r);return i?kw(bw.createStringLiteral(i),r):r}}(i);return null==l||l(),s()?T_(i)&&!qD(i)?(o(),t.serializeExistingTypeNode(n,i)):i:u?t.markNodeReuse(n,u,i):void 0}function u(e){const t=lh(e);switch(t.kind){case 184:return m(t);case 187:return f(t);case 200:return d(t);case 199:const e=t;if(143===e.operator)return p(e)}return bJ(e,_,T_)}function d(e){const t=u(e.objectType);if(void 0!==t)return bw.updateIndexedAccessTypeNode(e,t,bJ(e.indexType,_,T_))}function p(e){pn.assertEqual(e.operator,143);const t=u(e.type);if(void 0!==t)return bw.updateTypeOperatorNode(e,t)}function f(e){const{introducesError:r,node:i}=t.trackExistingEntityName(n,e.exprName);if(!r)return bw.updateTypeQueryNode(e,i,xJ(e.typeArguments,_,T_));const o=t.serializeTypeName(n,e.exprName,!0);return o?t.markNodeReuse(n,o,e.exprName):void 0}function m(e){if(t.canReuseTypeNode(n,e)){const{introducesError:r,node:i}=t.trackExistingEntityName(n,e.typeName),o=xJ(e.typeArguments,_,T_);if(!r){const r=bw.updateTypeReferenceNode(e,i,o);return t.markNodeReuse(n,r,e)}{const r=t.serializeTypeName(n,e.typeName,!1,o);if(r)return t.markNodeReuse(n,r,e.typeName)}}}}function o(e,n,r){if(!e)return;let o;return r&&!w(e)||!t.canReuseTypeNode(n,e)||(o=i(n,e),void 0!==o&&(o=C(o,r,void 0,n))),o}function a(e,n,r,i,a,s=void 0!==a){if(!e)return;if(!(t.canReuseTypeNodeAnnotation(n,r,e,i,a)||a&&t.canReuseTypeNodeAnnotation(n,r,e,i,!1)))return;let c;return a&&!w(e)||(c=o(e,n,a)),void 0===c&&s?(n.tracker.reportInferenceFallback(r),t.serializeExistingTypeNode(n,e,a)??bw.createKeywordTypeNode(133)):c}function s(e,n,r,i){if(!e)return;const a=o(e,n,r);return void 0!==a?a:(n.tracker.reportInferenceFallback(i??e),t.serializeExistingTypeNode(n,e,r)??bw.createKeywordTypeNode(133))}function c(e,n,r){return function(e,n,r){const i=t.getAllAccessorDeclarations(e),o=function(e,t){let n=_(e);n||e===t.firstAccessor||(n=_(t.firstAccessor));!n&&t.secondAccessor&&e!==t.secondAccessor&&(n=_(t.secondAccessor));return n}(e,i);if(o&&!qD(o))return m(r,e,()=>a(o,r,e,n)??d(e,n,r));if(i.getAccessor)return m(r,i.getAccessor,()=>D(i.getAccessor,n,r));return}(e,n,r)??f(e,t.getAllAccessorDeclarations(e),r,n)}function l(e,t,n,r){const i=h(e,t,!1,n,r);return void 0!==i.type?i.type:p(e,t,i.reportFallback)}function _(e){if(e)return 178===e.kind?Om(e)&&al(e)||bv(e):kv(e)}function u(e,n,r){const i=e.parent;if(179===i.kind)return c(i,void 0,r);const o=yv(e),s=t.requiresAddingImplicitUndefined(e,n,r.enclosingDeclaration);let l=rG;return o?l=eG(a(o,r,e,n,s)):FD(e)&&e.initializer&&uD(e.name)&&!F(e)&&(l=h(e.initializer,r,void 0,s)),void 0!==l.type?l.type:d(e,n,r,l.reportFallback)}function d(e,n,r,i=!0){return i&&r.tracker.reportInferenceFallback(e),!0===r.noInferenceFallback?bw.createKeywordTypeNode(133):t.serializeTypeOfDeclaration(r,e,n)}function p(e,n,r=!0,i){return pn.assert(!i),r&&n.tracker.reportInferenceFallback(e),!0===n.noInferenceFallback?bw.createKeywordTypeNode(133):t.serializeTypeOfExpression(n,e)??bw.createKeywordTypeNode(133)}function f(e,n,r,i,o=!0){if(178===e.kind)return D(e,i,r,o);o&&r.tracker.reportInferenceFallback(e);return(n.getAccessor&&D(n.getAccessor,i,r,o))??t.serializeTypeOfDeclaration(r,e,i)??bw.createKeywordTypeNode(133)}function m(e,n,r){const i=t.enterNewScope(e,n),o=r();return i(),o}function g(e,t,n,r){return wl(t)?h(e,n,!0,r):eG(s(t,n,r))}function h(e,r,i=!1,o=!1,a=!1){switch(e.kind){case 218:return FA(e)?g(e.expression,EA(e),r,o):h(e.expression,r,i,o);case 80:if(t.isUndefinedIdentifierExpression(e))return eG(S());break;case 106:return eG(n?C(bw.createLiteralTypeNode(bw.createNull()),o,e,r):bw.createKeywordTypeNode(133));case 220:case 219:return pn.type(e),m(r,e,()=>function(e,t){const n=D(e,void 0,t),r=b(e.typeParameters,t),i=e.parameters.map(e=>v(e,t));return eG(bw.createFunctionTypeNode(r,i,n))}(e,r));case 217:case 235:const s=e;return g(s.expression,s.type,r,o);case 225:const c=e;if(CC(c))return T(40===c.operator?c.operand:c,10===c.operand.kind?163:150,r,i||a,o);break;case 210:return function(e,t,n,r){if(!function(e,t,n){if(!n)return t.tracker.reportInferenceFallback(e),!1;for(const n of e.elements)if(231===n.kind)return t.tracker.reportInferenceFallback(n),!1;return!0}(e,t,n))return r||fu(sh(e).parent)?nG:eG(p(e,t,!1,r));const i=t.noInferenceFallback;t.noInferenceFallback=!0;const o=[];for(const r of e.elements)if(pn.assert(231!==r.kind),233===r.kind)o.push(S());else{const e=h(r,t,n),i=void 0!==e.type?e.type:p(r,t,e.reportFallback);o.push(i)}return bw.createTupleTypeNode(o).emitNode={flags:1,autoGenerate:void 0,internalFlags:0},t.noInferenceFallback=i,tG}(e,r,i,o);case 211:return function(e,n,r,i){if(!function(e,n){let r=!0;for(const i of e.properties){if(262144&i.flags){r=!1;break}if(305===i.kind||306===i.kind)n.tracker.reportInferenceFallback(i),r=!1;else{if(262144&i.name.flags){r=!1;break}if(81===i.name.kind)r=!1;else if(168===i.name.kind){const e=i.name.expression;CC(e,!1)||t.isDefinitelyReferenceToGlobalSymbolObject(e)||(n.tracker.reportInferenceFallback(i.name),r=!1)}}}return r}(e,n))return i||fu(sh(e).parent)?nG:eG(p(e,n,!1,i));const o=n.noInferenceFallback;n.noInferenceFallback=!0;const a=[],s=n.flags;n.flags|=4194304;for(const t of e.properties){pn.assert(!lP(t)&&!_P(t));const e=t.name;let i;switch(t.kind){case 175:i=m(n,t,()=>x(t,e,n,r));break;case 304:i=y(t,e,n,r);break;case 179:case 178:i=k(t,e,n)}i&&(Mw(i,t),a.push(i))}n.flags=s;const c=bw.createTypeLiteralNode(a);1024&n.flags||ww(c,1);return n.noInferenceFallback=o,tG}(e,r,i,o);case 232:return eG(p(e,r,!0,o));case 229:if(!i&&!a)return eG(bw.createKeywordTypeNode(154));break;default:let l,_=e;switch(e.kind){case 9:l=150;break;case 15:_=bw.createStringLiteral(e.text),l=154;break;case 11:l=154;break;case 10:l=163;break;case 112:case 97:l=136}if(l)return T(_,l,r,i||a,o)}return rG}function y(e,t,n,i){const o=i?[bw.createModifier(148)]:[],a=h(e.initializer,n,i),s=void 0!==a.type?a.type:d(e,void 0,n,a.reportFallback);return bw.createPropertySignature(o,r(n,t),void 0,s)}function v(e,n){return bw.updateParameterDeclaration(e,void 0,r(n,e.dotDotDotToken),t.serializeNameOfParameter(n,e),t.isOptionalParameter(e)?bw.createToken(58):void 0,u(e,void 0,n),void 0)}function b(e,n){return null==e?void 0:e.map(e=>{var i;const{node:o}=t.trackExistingEntityName(n,e.name);return bw.updateTypeParameterDeclaration(e,null==(i=e.modifiers)?void 0:i.map(e=>r(n,e)),o,s(e.constraint,n),s(e.default,n))})}function x(e,t,n,i){const o=D(e,void 0,n),a=b(e.typeParameters,n),s=e.parameters.map(e=>v(e,n));return i?bw.createPropertySignature([bw.createModifier(148)],r(n,t),r(n,e.questionToken),bw.createFunctionTypeNode(a,s,o)):(uD(t)&&"new"===t.escapedText&&(t=bw.createStringLiteral("new")),bw.createMethodSignature([],r(n,t),r(n,e.questionToken),a,s,o))}function k(e,n,i){const o=t.getAllAccessorDeclarations(e),a=o.getAccessor&&_(o.getAccessor),c=o.setAccessor&&_(o.setAccessor);if(void 0!==a&&void 0!==c)return m(i,e,()=>{const t=e.parameters.map(e=>v(e,i));return Pu(e)?bw.updateGetAccessorDeclaration(e,[],r(i,n),t,s(a,i),void 0):bw.updateSetAccessorDeclaration(e,[],r(i,n),t,void 0)});if(o.firstAccessor===e){const t=(a?m(i,o.getAccessor,()=>s(a,i)):c?m(i,o.setAccessor,()=>s(c,i)):void 0)??f(e,o,i,void 0);return bw.createPropertySignature(void 0===o.setAccessor?[bw.createModifier(148)]:[],r(i,n),void 0,t)}}function S(){return n?bw.createKeywordTypeNode(157):bw.createKeywordTypeNode(133)}function T(e,t,n,i,o){let a;return i?(225===e.kind&&40===e.operator&&(a=bw.createLiteralTypeNode(r(n,e.operand))),a=bw.createLiteralTypeNode(r(n,e))):a=bw.createKeywordTypeNode(t),eG(C(a,o,e,n))}function C(e,t,r,i){const o=r&&sh(r).parent,a=o&&fu(o)&&tC(o);return n&&(t||a)?(w(e)||i.tracker.reportInferenceFallback(e),ZD(e)?bw.createUnionTypeNode([...e.types,bw.createKeywordTypeNode(157)]):bw.createUnionTypeNode([e,bw.createKeywordTypeNode(157)])):e}function w(e){return!n||(!(!Fh(e.kind)&&202!==e.kind&&185!==e.kind&&186!==e.kind&&189!==e.kind&&190!==e.kind&&188!==e.kind&&204!==e.kind&&198!==e.kind)||(197===e.kind?w(e.type):(193===e.kind||194===e.kind)&&e.types.every(w)))}function D(e,n,r,i=!0){let s=rG;const c=Pg(e)?yv(e.parameters[0]):bv(e);return c?s=eG(a(c,r,e,n)):ih(e)&&(s=function(e,t){let n;if(e&&!Pd(e.body)){if(3&Rh(e))return rG;const t=e.body;t&&GF(t)?Af(t,e=>e.parent!==t||n?(n=void 0,!0):void(n=e.expression)):n=t}if(n){if(!F(n))return h(n,t);{const e=FA(n)?EA(n):JF(n)||kF(n)?n.type:void 0;if(e&&!wl(e))return eG(o(e,t))}}return rG}(e,r)),void 0!==s.type?s.type:function(e,n,r,i){return i&&n.tracker.reportInferenceFallback(e),!0===n.noInferenceFallback?bw.createKeywordTypeNode(133):t.serializeReturnTypeForSignature(n,e,r)??bw.createKeywordTypeNode(133)}(e,r,n,i&&s.reportFallback&&!c)}function F(e){return mc(e.parent,e=>vF(e)||!l_(e)&&!!yv(e)||$E(e)||nP(e))}}var oG={};o(oG,{NameValidationResult:()=>DG,discoverTypings:()=>wG,isTypingUpToDate:()=>kG,loadSafeList:()=>TG,loadTypesMap:()=>CG,nonRelativeModuleNameForTypingCache:()=>SG,renderPackageNameValidationFailure:()=>AG,validatePackageName:()=>EG});var aG,sG,cG="action::set",lG="action::invalidate",_G="action::packageInstalled",uG="event::typesRegistry",dG="event::beginInstallTypes",pG="event::endInstallTypes",fG="event::initializationFailed",mG="action::watchTypingLocations";function gG(e){return uo.args.includes(e)}function hG(e){const t=uo.args.indexOf(e);return t>=0&&te.readFile(t));return new Map(Object.entries(n.config))}function CG(e,t){var n;const r=CL(t,t=>e.readFile(t));if(null==(n=r.config)?void 0:n.simpleMap)return new Map(Object.entries(r.config.simpleMap))}function wG(e,t,n,r,i,o,a,s,c,l){if(!a||!a.enable)return{cachedTypingPaths:[],newTypingNames:[],filesToWatch:[]};const _=new Map;n=J(n,e=>{const t=Vo(e);if(BS(t))return t});const u=[];a.include&&y(a.include,"Explicitly included types");const d=a.exclude||[];if(!l.types){const e=new Set(n.map(Ao));e.add(r),e.forEach(e=>{v(e,"bower.json","bower_components",u),v(e,"package.json","node_modules",u)})}if(a.disableFilenameBasedTypeAcquisition||function(e){const n=J(e,e=>{if(!BS(e))return;const t=qt(KS(dt(Io(e))));return i.get(t)});n.length&&y(n,"Inferred typings from file names");H(e,e=>wo(e,".jsx"))&&(t&&t("Inferred 'react' typings due to presence of '.jsx' extension"),h("react"))}(n),s){y(Z(s.map(SG),vt,Nt),"Inferred typings from unresolved imports")}for(const e of d){_.delete(e)&&t&&t(`Typing for ${e} is in exclude list, will be ignored.`)}o.forEach((e,t)=>{const n=c.get(t);!1===_.get(t)&&void 0!==n&&kG(e,n)&&_.set(t,e.typingLocation)});const f=[],m=[];_.forEach((e,t)=>{e?m.push(e):f.push(t)});const g={cachedTypingPaths:m,newTypingNames:f,filesToWatch:u};return t&&t(`Finished typings discovery:${xG(g)}`),g;function h(e){_.has(e)||_.set(e,!1)}function y(e,n){t&&t(`${n}: ${JSON.stringify(e)}`),p(e,h)}function v(n,r,i,o){const a=Jo(n,r);let s,c;e.fileExists(a)&&(o.push(a),s=CL(a,t=>e.readFile(t)).config,c=L([s.dependencies,s.devDependencies,s.optionalDependencies,s.peerDependencies],Ae),y(c,`Typing names in '${a}' dependencies`));const l=Jo(n,i);if(o.push(l),!e.directoryExists(l))return;const u=[],d=c?c.map(e=>Jo(l,e,r)):e.readDirectory(l,[".json"],void 0,void 0,3).filter(e=>{if(Io(e)!==r)return!1;const t=jo(Vo(e)),n="@"===t[t.length-3][0];return n&&dt(t[t.length-4])===i||!n&&dt(t[t.length-3])===i});t&&t(`Searching for typing names in ${l}; all files: ${JSON.stringify(d)}`);for(const n of d){const r=Vo(n),i=CL(r,t=>e.readFile(t)).config;if(!i.name)continue;const o=i.types||i.typings;if(o){const n=Uo(o,Ao(r));e.fileExists(n)?(t&&t(` Package '${i.name}' provides its own types.`),_.set(i.name,n)):t&&t(` Package '${i.name}' provides its own types but they are missing.`)}else u.push(i.name)}y(u," Found package names")}}var NG,DG=(e=>(e[e.Ok=0]="Ok",e[e.EmptyName=1]="EmptyName",e[e.NameTooLong=2]="NameTooLong",e[e.NameStartsWithDot=3]="NameStartsWithDot",e[e.NameStartsWithUnderscore=4]="NameStartsWithUnderscore",e[e.NameContainsNonURISafeCharacters=5]="NameContainsNonURISafeCharacters",e))(DG||{}),FG=214;function EG(e){return PG(e,!0)}function PG(e,t){if(!e)return 1;if(e.length>FG)return 2;if(46===e.charCodeAt(0))return 3;if(95===e.charCodeAt(0))return 4;if(t){const t=/^@([^/]+)\/([^/]+)$/.exec(e);if(t){const e=PG(t[1],!1);if(0!==e)return{name:t[1],isScopeName:!0,result:e};const n=PG(t[2],!1);return 0!==n?{name:t[2],isScopeName:!1,result:n}:0}}return encodeURIComponent(e)!==e?5:0}function AG(e,t){return"object"==typeof e?IG(t,e.result,e.name,e.isScopeName):IG(t,e,t,!1)}function IG(e,t,n,r){const i=r?"Scope":"Package";switch(t){case 1:return`'${e}':: ${i} name '${n}' cannot be empty`;case 2:return`'${e}':: ${i} name '${n}' should be less than ${FG} characters`;case 3:return`'${e}':: ${i} name '${n}' cannot start with '.'`;case 4:return`'${e}':: ${i} name '${n}' cannot start with '_'`;case 5:return`'${e}':: ${i} name '${n}' contains non URI safe characters`;case 0:return pn.fail();default:pn.assertNever(t)}}(e=>{class t{constructor(e){this.text=e}getText(e,t){return 0===e&&t===this.text.length?this.text:this.text.substring(e,t)}getLength(){return this.text.length}getChangeRange(){}}e.fromString=function(e){return new t(e)}})(NG||(NG={}));var OG=(e=>(e[e.Dependencies=1]="Dependencies",e[e.DevDependencies=2]="DevDependencies",e[e.PeerDependencies=4]="PeerDependencies",e[e.OptionalDependencies=8]="OptionalDependencies",e[e.All=15]="All",e))(OG||{}),LG=(e=>(e[e.Off=0]="Off",e[e.On=1]="On",e[e.Auto=2]="Auto",e))(LG||{}),jG=(e=>(e[e.Semantic=0]="Semantic",e[e.PartialSemantic=1]="PartialSemantic",e[e.Syntactic=2]="Syntactic",e))(jG||{}),MG={},RG=(e=>(e.Original="original",e.TwentyTwenty="2020",e))(RG||{}),BG=(e=>(e.All="All",e.SortAndCombine="SortAndCombine",e.RemoveUnused="RemoveUnused",e))(BG||{}),JG=(e=>(e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",e))(JG||{}),zG=(e=>(e.Type="Type",e.Parameter="Parameter",e.Enum="Enum",e))(zG||{}),qG=(e=>(e.none="none",e.definition="definition",e.reference="reference",e.writtenReference="writtenReference",e))(qG||{}),UG=(e=>(e[e.None=0]="None",e[e.Block=1]="Block",e[e.Smart=2]="Smart",e))(UG||{}),VG=(e=>(e.Ignore="ignore",e.Insert="insert",e.Remove="remove",e))(VG||{});function WG(e){return{indentSize:4,tabSize:4,newLineCharacter:e||"\n",convertTabsToSpaces:!0,indentStyle:2,insertSpaceAfterConstructor:!1,insertSpaceAfterCommaDelimiter:!0,insertSpaceAfterSemicolonInForStatements:!0,insertSpaceBeforeAndAfterBinaryOperators:!0,insertSpaceAfterKeywordsInControlFlowStatements:!0,insertSpaceAfterFunctionKeywordForAnonymousFunctions:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:!1,insertSpaceBeforeFunctionParenthesis:!1,placeOpenBraceOnNewLineForFunctions:!1,placeOpenBraceOnNewLineForControlBlocks:!1,semicolons:"ignore",trimTrailingWhitespace:!0,indentSwitchCase:!0}}var $G=WG("\n"),HG=(e=>(e[e.aliasName=0]="aliasName",e[e.className=1]="className",e[e.enumName=2]="enumName",e[e.fieldName=3]="fieldName",e[e.interfaceName=4]="interfaceName",e[e.keyword=5]="keyword",e[e.lineBreak=6]="lineBreak",e[e.numericLiteral=7]="numericLiteral",e[e.stringLiteral=8]="stringLiteral",e[e.localName=9]="localName",e[e.methodName=10]="methodName",e[e.moduleName=11]="moduleName",e[e.operator=12]="operator",e[e.parameterName=13]="parameterName",e[e.propertyName=14]="propertyName",e[e.punctuation=15]="punctuation",e[e.space=16]="space",e[e.text=17]="text",e[e.typeParameterName=18]="typeParameterName",e[e.enumMemberName=19]="enumMemberName",e[e.functionName=20]="functionName",e[e.regularExpressionLiteral=21]="regularExpressionLiteral",e[e.link=22]="link",e[e.linkName=23]="linkName",e[e.linkText=24]="linkText",e))(HG||{}),KG=(e=>(e[e.None=0]="None",e[e.MayIncludeAutoImports=1]="MayIncludeAutoImports",e[e.IsImportStatementCompletion=2]="IsImportStatementCompletion",e[e.IsContinuation=4]="IsContinuation",e[e.ResolvedModuleSpecifiers=8]="ResolvedModuleSpecifiers",e[e.ResolvedModuleSpecifiersBeyondLimit=16]="ResolvedModuleSpecifiersBeyondLimit",e[e.MayIncludeMethodSnippets=32]="MayIncludeMethodSnippets",e))(KG||{}),GG=(e=>(e.Comment="comment",e.Region="region",e.Code="code",e.Imports="imports",e))(GG||{}),XG=(e=>(e[e.JavaScript=0]="JavaScript",e[e.SourceMap=1]="SourceMap",e[e.Declaration=2]="Declaration",e))(XG||{}),QG=(e=>(e[e.None=0]="None",e[e.InMultiLineCommentTrivia=1]="InMultiLineCommentTrivia",e[e.InSingleQuoteStringLiteral=2]="InSingleQuoteStringLiteral",e[e.InDoubleQuoteStringLiteral=3]="InDoubleQuoteStringLiteral",e[e.InTemplateHeadOrNoSubstitutionTemplate=4]="InTemplateHeadOrNoSubstitutionTemplate",e[e.InTemplateMiddleOrTail=5]="InTemplateMiddleOrTail",e[e.InTemplateSubstitutionPosition=6]="InTemplateSubstitutionPosition",e))(QG||{}),YG=(e=>(e[e.Punctuation=0]="Punctuation",e[e.Keyword=1]="Keyword",e[e.Operator=2]="Operator",e[e.Comment=3]="Comment",e[e.Whitespace=4]="Whitespace",e[e.Identifier=5]="Identifier",e[e.NumberLiteral=6]="NumberLiteral",e[e.BigIntLiteral=7]="BigIntLiteral",e[e.StringLiteral=8]="StringLiteral",e[e.RegExpLiteral=9]="RegExpLiteral",e))(YG||{}),ZG=(e=>(e.unknown="",e.warning="warning",e.keyword="keyword",e.scriptElement="script",e.moduleElement="module",e.classElement="class",e.localClassElement="local class",e.interfaceElement="interface",e.typeElement="type",e.enumElement="enum",e.enumMemberElement="enum member",e.variableElement="var",e.localVariableElement="local var",e.variableUsingElement="using",e.variableAwaitUsingElement="await using",e.functionElement="function",e.localFunctionElement="local function",e.memberFunctionElement="method",e.memberGetAccessorElement="getter",e.memberSetAccessorElement="setter",e.memberVariableElement="property",e.memberAccessorVariableElement="accessor",e.constructorImplementationElement="constructor",e.callSignatureElement="call",e.indexSignatureElement="index",e.constructSignatureElement="construct",e.parameterElement="parameter",e.typeParameterElement="type parameter",e.primitiveType="primitive type",e.label="label",e.alias="alias",e.constElement="const",e.letElement="let",e.directory="directory",e.externalModuleName="external module name",e.jsxAttribute="JSX attribute",e.string="string",e.link="link",e.linkName="link name",e.linkText="link text",e))(ZG||{}),eX=(e=>(e.none="",e.publicMemberModifier="public",e.privateMemberModifier="private",e.protectedMemberModifier="protected",e.exportedModifier="export",e.ambientModifier="declare",e.staticModifier="static",e.abstractModifier="abstract",e.optionalModifier="optional",e.deprecatedModifier="deprecated",e.dtsModifier=".d.ts",e.tsModifier=".ts",e.tsxModifier=".tsx",e.jsModifier=".js",e.jsxModifier=".jsx",e.jsonModifier=".json",e.dmtsModifier=".d.mts",e.mtsModifier=".mts",e.mjsModifier=".mjs",e.dctsModifier=".d.cts",e.ctsModifier=".cts",e.cjsModifier=".cjs",e))(eX||{}),tX=(e=>(e.comment="comment",e.identifier="identifier",e.keyword="keyword",e.numericLiteral="number",e.bigintLiteral="bigint",e.operator="operator",e.stringLiteral="string",e.whiteSpace="whitespace",e.text="text",e.punctuation="punctuation",e.className="class name",e.enumName="enum name",e.interfaceName="interface name",e.moduleName="module name",e.typeParameterName="type parameter name",e.typeAliasName="type alias name",e.parameterName="parameter name",e.docCommentTagName="doc comment tag name",e.jsxOpenTagName="jsx open tag name",e.jsxCloseTagName="jsx close tag name",e.jsxSelfClosingTagName="jsx self closing tag name",e.jsxAttribute="jsx attribute",e.jsxText="jsx text",e.jsxAttributeStringLiteralValue="jsx attribute string literal value",e))(tX||{}),nX=(e=>(e[e.comment=1]="comment",e[e.identifier=2]="identifier",e[e.keyword=3]="keyword",e[e.numericLiteral=4]="numericLiteral",e[e.operator=5]="operator",e[e.stringLiteral=6]="stringLiteral",e[e.regularExpressionLiteral=7]="regularExpressionLiteral",e[e.whiteSpace=8]="whiteSpace",e[e.text=9]="text",e[e.punctuation=10]="punctuation",e[e.className=11]="className",e[e.enumName=12]="enumName",e[e.interfaceName=13]="interfaceName",e[e.moduleName=14]="moduleName",e[e.typeParameterName=15]="typeParameterName",e[e.typeAliasName=16]="typeAliasName",e[e.parameterName=17]="parameterName",e[e.docCommentTagName=18]="docCommentTagName",e[e.jsxOpenTagName=19]="jsxOpenTagName",e[e.jsxCloseTagName=20]="jsxCloseTagName",e[e.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",e[e.jsxAttribute=22]="jsxAttribute",e[e.jsxText=23]="jsxText",e[e.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",e[e.bigintLiteral=25]="bigintLiteral",e))(nX||{}),rX=bs(99,!0),iX=(e=>(e[e.None=0]="None",e[e.Value=1]="Value",e[e.Type=2]="Type",e[e.Namespace=4]="Namespace",e[e.All=7]="All",e))(iX||{});function oX(e){switch(e.kind){case 261:return Om(e)&&el(e)?7:1;case 170:case 209:case 173:case 172:case 304:case 305:case 175:case 174:case 177:case 178:case 179:case 263:case 219:case 220:case 300:case 292:return 1;case 169:case 265:case 266:case 188:return 2;case 347:return void 0===e.name?3:2;case 307:case 264:return 3;case 268:return dp(e)||1===eB(e)?5:4;case 267:case 276:case 277:case 272:case 273:case 278:case 279:return 7;case 308:return 5}return 7}function aX(e){const t=(e=oQ(e)).parent;return 308===e.kind?1:ME(t)||JE(t)||WE(t)||jE(t)||NE(t)||CE(t)&&e===t.name?7:sX(e)?function(e){const t=167===e.kind?e:wD(e.parent)&&e.parent.right===e?e.parent:void 0;return t&&272===t.parent.kind?7:4}(e):ph(e)?oX(t):i_(e)&&mc(e,nn(mP,zu,gP))?7:function(e){hb(e)&&(e=e.parent);switch(e.kind){case 110:return!Tm(e);case 198:return!0}switch(e.parent.kind){case 184:return!0;case 206:return!e.parent.isTypeOf;case 234:return Ef(e.parent)}return!1}(e)?2:function(e){return function(e){let t=e,n=!0;if(167===t.parent.kind){for(;t.parent&&167===t.parent.kind;)t=t.parent;n=t.right===e}return 184===t.parent.kind&&!n}(e)||function(e){let t=e,n=!0;if(212===t.parent.kind){for(;t.parent&&212===t.parent.kind;)t=t.parent;n=t.name===e}if(!n&&234===t.parent.kind&&299===t.parent.parent.kind){const e=t.parent.parent.parent;return 264===e.kind&&119===t.parent.parent.token||265===e.kind&&96===t.parent.parent.token}return!1}(e)}(e)?4:DD(t)?(pn.assert(KP(t.parent)),2):cF(t)?3:1}function sX(e){if(!e.parent)return!1;for(;167===e.parent.kind;)e=e.parent;return Pm(e.parent)&&e.parent.moduleReference===e}function cX(e,t=!1,n=!1){return hX(e,vF,fX,t,n)}function lX(e,t=!1,n=!1){return hX(e,bF,fX,t,n)}function _X(e,t=!1,n=!1){return hX(e,J_,fX,t,n)}function uX(e,t=!1,n=!1){return hX(e,xF,mX,t,n)}function dX(e,t=!1,n=!1){return hX(e,ED,fX,t,n)}function pX(e,t=!1,n=!1){return hX(e,Tu,gX,t,n)}function fX(e){return e.expression}function mX(e){return e.tag}function gX(e){return e.tagName}function hX(e,t,n,r,i){let o=r?function(e){return wX(e)||NX(e)?e.parent:e}(e):yX(e);return i&&(o=AA(o)),!!o&&!!o.parent&&t(o.parent)&&n(o.parent)===o}function yX(e){return wX(e)?e.parent:e}function vX(e,t){for(;e;){if(257===e.kind&&e.label.escapedText===t)return e.label;e=e.parent}}function bX(e,t){return!!hF(e.expression)&&e.expression.name.text===t}function xX(e){var t;return uD(e)&&(null==(t=rt(e.parent,Fl))?void 0:t.label)===e}function kX(e){var t;return uD(e)&&(null==(t=rt(e.parent,_E))?void 0:t.label)===e}function SX(e){return kX(e)||xX(e)}function TX(e){var t;return(null==(t=rt(e.parent,Fu))?void 0:t.tagName)===e}function CX(e){var t;return(null==(t=rt(e.parent,wD))?void 0:t.right)===e}function wX(e){var t;return(null==(t=rt(e.parent,hF))?void 0:t.name)===e}function NX(e){var t;return(null==(t=rt(e.parent,yF))?void 0:t.argumentExpression)===e}function DX(e){var t;return(null==(t=rt(e.parent,xE))?void 0:t.name)===e}function FX(e){var t;return uD(e)&&(null==(t=rt(e.parent,s_))?void 0:t.name)===e}function EX(e){switch(e.parent.kind){case 173:case 172:case 304:case 307:case 175:case 174:case 178:case 179:case 268:return Fc(e.parent)===e;case 213:return e.parent.argumentExpression===e;case 168:return!0;case 202:return 200===e.parent.parent.kind;default:return!1}}function PX(e){return Dm(e.parent.parent)&&Fm(e.parent.parent)===e}function AX(e){for(Ag(e)&&(e=e.parent.parent);;){if(!(e=e.parent))return;switch(e.kind){case 308:case 175:case 174:case 263:case 219:case 178:case 179:case 264:case 265:case 267:case 268:return e}}}function IX(e){switch(e.kind){case 308:return uO(e)?"module":"script";case 268:return"module";case 264:case 232:return"class";case 265:return"interface";case 266:case 339:case 347:return"type";case 267:return"enum";case 261:return t(e);case 209:return t(ny(e));case 220:case 263:case 219:return"function";case 178:return"getter";case 179:return"setter";case 175:case 174:return"method";case 304:const{initializer:n}=e;return s_(n)?"method":"property";case 173:case 172:case 305:case 306:return"property";case 182:return"index";case 181:return"construct";case 180:return"call";case 177:case 176:return"constructor";case 169:return"type parameter";case 307:return"enum member";case 170:return Av(e,31)?"property":"parameter";case 272:case 277:case 282:case 275:case 281:return"alias";case 227:const r=og(e),{right:i}=e;switch(r){case 7:case 8:case 9:case 0:default:return"";case 1:case 2:const e=IX(i);return""===e?"const":e;case 3:case 5:return TF(i)?"method":"property";case 4:return"property";case 6:return"local class"}case 80:return NE(e.parent)?"alias":"";case 278:const o=IX(e.expression);return""===o?"const":o;default:return""}function t(e){return _f(e)?"const":df(e)?"let":"var"}}function OX(e){switch(e.kind){case 110:return!0;case 80:return gv(e)&&170===e.parent.kind;default:return!1}}var LX=/^\/\/\/\s*=n}function zX(e,t,n){return UX(e.pos,e.end,t,n)}function qX(e,t,n,r){return UX(e.getStart(t),e.end,n,r)}function UX(e,t,n,r){return Math.max(e,n)e.kind===t)}function XX(e){const t=x(e.parent.getChildren(),t=>nA(t)&&tx(t,e));return pn.assert(!t||C(t.getChildren(),e)),t}function QX(e){return 90===e.kind}function YX(e){return 86===e.kind}function ZX(e){return 100===e.kind}function eQ(e,t){if(16777216&e.flags)return;const n=SZ(e,t);if(n)return n;const r=function(e){let t;return mc(e,e=>(T_(e)&&(t=e),!wD(e.parent)&&!T_(e.parent)&&!x_(e.parent))),t}(e);return r&&t.getTypeAtLocation(r)}function tQ(e,t){if(!t)switch(e.kind){case 264:case 232:return function(e){if(Nc(e))return e.name;if(hE(e)){const t=e.modifiers&&x(e.modifiers,QX);if(t)return t}if(MF(e)){const t=x(e.getChildren(),YX);if(t)return t}}(e);case 263:case 219:return function(e){if(Nc(e))return e.name;if(gE(e)){const t=x(e.modifiers,QX);if(t)return t}if(TF(e)){const t=x(e.getChildren(),ZX);if(t)return t}}(e);case 177:return e}if(Nc(e))return e.name}function nQ(e,t){if(e.importClause){if(e.importClause.name&&e.importClause.namedBindings)return;if(e.importClause.name)return e.importClause.name;if(e.importClause.namedBindings){if(LE(e.importClause.namedBindings)){const t=ke(e.importClause.namedBindings.elements);if(!t)return;return t.name}if(IE(e.importClause.namedBindings))return e.importClause.namedBindings.name}}if(!t)return e.moduleSpecifier}function rQ(e,t){if(e.exportClause){if(BE(e.exportClause)){if(!ke(e.exportClause.elements))return;return e.exportClause.elements[0].name}if(OE(e.exportClause))return e.exportClause.name}if(!t)return e.moduleSpecifier}function iQ(e,t){const{parent:n}=e;if(r_(e)&&(t||90!==e.kind)?EI(n)&&C(n.modifiers,e):86===e.kind?hE(n)||MF(e):100===e.kind?gE(n)||TF(e):120===e.kind?yE(n):94===e.kind?bE(n):156===e.kind?vE(n):145===e.kind||144===e.kind?xE(n):102===e.kind?CE(n):139===e.kind?MD(n):153===e.kind&&RD(n)){const e=tQ(n,t);if(e)return e}if((115===e.kind||87===e.kind||121===e.kind)&&mE(n)&&1===n.declarations.length){const e=n.declarations[0];if(uD(e.name))return e.name}if(156===e.kind){if(NE(n)&&n.isTypeOnly){const e=nQ(n.parent,t);if(e)return e}if(RE(n)&&n.isTypeOnly){const e=rQ(n,t);if(e)return e}}if(130===e.kind){if(jE(n)&&n.propertyName||JE(n)&&n.propertyName||IE(n)||OE(n))return n.name;if(RE(n)&&n.exportClause&&OE(n.exportClause))return n.exportClause.name}if(102===e.kind&&wE(n)){const e=nQ(n,t);if(e)return e}if(95===e.kind){if(RE(n)){const e=rQ(n,t);if(e)return e}if(ME(n))return AA(n.expression)}if(149===e.kind&&WE(n))return n.expression;if(161===e.kind&&(wE(n)||RE(n))&&n.moduleSpecifier)return n.moduleSpecifier;if((96===e.kind||119===e.kind)&&aP(n)&&n.token===e.kind){const e=function(e){if(1===e.types.length)return e.types[0].expression}(n);if(e)return e}if(96===e.kind){if(DD(n)&&n.constraint&&UD(n.constraint))return n.constraint.typeName;if(tF(n)&&UD(n.extendsType))return n.extendsType.typeName}if(140===e.kind&&nF(n))return n.typeParameter.name;if(103===e.kind&&DD(n)&&sF(n.parent))return n.name;if(143===e.kind&&oF(n)&&143===n.operator&&UD(n.type))return n.type.typeName;if(148===e.kind&&oF(n)&&148===n.operator&&KD(n.type)&&UD(n.type.elementType))return n.type.elementType.typeName;if(!t){if((105===e.kind&&bF(n)||116===e.kind&&DF(n)||114===e.kind&&NF(n)||135===e.kind&&FF(n)||127===e.kind&&LF(n)||91===e.kind&&wF(n))&&n.expression)return AA(n.expression);if((103===e.kind||104===e.kind)&&AF(n)&&n.operatorToken===e)return AA(n.right);if(130===e.kind&&JF(n)&&UD(n.type))return n.type.typeName;if(103===e.kind&&rE(n)||165===e.kind&&iE(n))return AA(n.expression)}return e}function oQ(e){return iQ(e,!1)}function aQ(e){return iQ(e,!0)}function sQ(e,t){return cQ(e,t,e=>Wh(e)||Fh(e.kind)||dD(e))}function cQ(e,t,n){return _Q(e,t,!1,n,!1)}function lQ(e,t){return _Q(e,t,!0,void 0,!1)}function _Q(e,t,n,r,i){let o,a=e;for(;;){const i=a.getChildren(e),c=Ne(i,t,(e,t)=>t,(o,a)=>{const c=i[o].getEnd();if(ct?1:s(i[o],l,c)?i[o-1]&&s(i[o-1])?1:0:r&&l===t&&i[o-1]&&i[o-1].getEnd()===t&&s(i[o-1])?1:-1});if(o)return o;if(!(c>=0&&i[c]))return a;a=i[c]}function s(a,s,c){if(c??(c=a.getEnd()),ct)return!1;if(tn.getStart(e)&&t(r.pos<=e.pos&&r.end>e.end||r.pos===e.end)&&EQ(r,n)?t(r):void 0)}(t)}function fQ(e,t,n,r){const i=function i(o){if(mQ(o)&&1!==o.kind)return o;const a=o.getChildren(t),s=Ne(a,e,(e,t)=>t,(t,n)=>e=a[t-1].end?0:1:-1);if(s>=0&&a[s]){const n=a[s];if(e=e||!EQ(n,t)||bQ(n)){const e=hQ(a,s,t,o.kind);return e?!r&&Du(e)&&e.getChildren(t).length?i(e):gQ(e,t):void 0}return i(n)}}pn.assert(void 0!==n||308===o.kind||1===o.kind||Du(o));const c=hQ(a,a.length,t,o.kind);return c&&gQ(c,t)}(n||t);return pn.assert(!(i&&bQ(i))),i}function mQ(e){return Ol(e)&&!bQ(e)}function gQ(e,t){if(mQ(e))return e;const n=e.getChildren(t);if(0===n.length)return e;const r=hQ(n,n.length,t,e.kind);return r&&gQ(r,t)}function hQ(e,t,n,r){for(let i=t-1;i>=0;i--){if(bQ(e[i]))0!==i||12!==r&&286!==r||pn.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");else if(EQ(e[i],n))return e[i]}}function yQ(e,t,n=fQ(t,e)){if(n&&Hl(n)){const r=n.getStart(e),i=n.getEnd();if(rn.getStart(e)}function kQ(e,t){const n=lQ(e,t);return!!GN(n)||(!(19!==n.kind||!nP(n.parent)||!$E(n.parent.parent))||!(30!==n.kind||!Tu(n.parent)||!$E(n.parent.parent)))}function SQ(e,t){return function(n){for(;n;)if(n.kind>=286&&n.kind<=295||12===n.kind||30===n.kind||32===n.kind||80===n.kind||20===n.kind||19===n.kind||44===n.kind||31===n.kind)n=n.parent;else{if(285!==n.kind)return!1;if(t>n.getStart(e))return!0;n=n.parent}return!1}(lQ(e,t))}function TQ(e,t,n){const r=Ia(e.kind),i=Ia(t),o=e.getFullStart(),a=n.text.lastIndexOf(i,o);if(-1===a)return;if(n.text.lastIndexOf(r,o-1)!!e.typeParameters&&e.typeParameters.length>=t)}function NQ(e,t){if(-1===t.text.lastIndexOf("<",e?e.pos:t.text.length))return;let n=e,r=0,i=0;for(;n;){switch(n.kind){case 30:if(n=fQ(n.getFullStart(),t),n&&29===n.kind&&(n=fQ(n.getFullStart(),t)),!n||!uD(n))return;if(!r)return ph(n)?void 0:{called:n,nTypeArguments:i};r--;break;case 50:r=3;break;case 49:r=2;break;case 32:r++;break;case 20:if(n=TQ(n,19,t),!n)return;break;case 22:if(n=TQ(n,21,t),!n)return;break;case 24:if(n=TQ(n,23,t),!n)return;break;case 28:i++;break;case 39:case 80:case 11:case 9:case 10:case 112:case 97:case 114:case 96:case 143:case 25:case 52:case 58:case 59:break;default:if(T_(n))break;return}n=fQ(n.getFullStart(),t)}}function DQ(e,t,n){return Ide.getRangeOfEnclosingComment(e,t,void 0,n)}function FQ(e,t){return!!mc(lQ(e,t),DP)}function EQ(e,t){return 1===e.kind?!!e.jsDoc:0!==e.getWidth(t)}function PQ(e,t=0){const n=[],r=fu(e)?lc(e)&~t:0;return 2&r&&n.push("private"),4&r&&n.push("protected"),1&r&&n.push("public"),(256&r||LD(e))&&n.push("static"),64&r&&n.push("abstract"),32&r&&n.push("export"),65536&r&&n.push("deprecated"),33554432&e.flags&&n.push("declare"),278===e.kind&&n.push("export"),n.length>0?n.join(","):""}function AQ(e){return 184===e.kind||214===e.kind?e.typeArguments:s_(e)||264===e.kind||265===e.kind?e.typeParameters:void 0}function IQ(e){return 2===e||3===e}function OQ(e){return!(11!==e&&14!==e&&!Bl(e))}function LQ(e,t,n){return!!(4&t.flags)&&e.isEmptyAnonymousObjectType(n)}function jQ(e){if(!e.isIntersection())return!1;const{types:t,checker:n}=e;return 2===t.length&&(LQ(n,t[0],t[1])||LQ(n,t[1],t[0]))}function MQ(e,t,n){return Bl(e.kind)&&e.getStart(n){const n=_J(t);return!e[n]&&(e[n]=!0)}}function rY(e){return e.getText(0,e.getLength())}function iY(e,t){let n="";for(let r=0;r!(t.isDeclarationFile||e.isSourceFileFromExternalLibrary(t)||!t.externalModuleIndicator&&!t.commonJsModuleIndicator))}function cY(e){return e.getSourceFiles().some(t=>!t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!t.externalModuleIndicator)}function lY(e){return!!e.module||Sk(e)>=2||!!e.noEmit}function _Y(e,t){return{fileExists:t=>e.fileExists(t),getCurrentDirectory:()=>t.getCurrentDirectory(),readFile:He(t,t.readFile),useCaseSensitiveFileNames:He(t,t.useCaseSensitiveFileNames)||e.useCaseSensitiveFileNames,getSymlinkCache:He(t,t.getSymlinkCache)||e.getSymlinkCache,getModuleSpecifierCache:He(t,t.getModuleSpecifierCache),getPackageJsonInfoCache:()=>{var t;return null==(t=e.getModuleResolutionCache())?void 0:t.getPackageJsonInfoCache()},getGlobalTypingsCacheLocation:He(t,t.getGlobalTypingsCacheLocation),redirectTargetsMap:e.redirectTargetsMap,getRedirectFromSourceFile:t=>e.getRedirectFromSourceFile(t),isSourceOfProjectReferenceRedirect:t=>e.isSourceOfProjectReferenceRedirect(t),getNearestAncestorDirectoryWithPackageJson:He(t,t.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:()=>e.getFileIncludeReasons(),getCommonSourceDirectory:()=>e.getCommonSourceDirectory(),getDefaultResolutionModeForFile:t=>e.getDefaultResolutionModeForFile(t),getModeForResolutionAtIndex:(t,n)=>e.getModeForResolutionAtIndex(t,n)}}function uY(e,t){return{..._Y(e,t),getCommonSourceDirectory:()=>e.getCommonSourceDirectory()}}function dY(e){return 2===e||e>=3&&e<=99||100===e}function pY(e,t,n,r,i){return bw.createImportDeclaration(void 0,e||t?bw.createImportClause(i?156:void 0,e,t&&t.length?bw.createNamedImports(t):void 0):void 0,"string"==typeof n?fY(n,r):n,void 0)}function fY(e,t){return bw.createStringLiteral(e,0===t)}var mY=(e=>(e[e.Single=0]="Single",e[e.Double=1]="Double",e))(mY||{});function gY(e,t){return $m(e,t)?1:0}function hY(e,t){if(t.quotePreference&&"auto"!==t.quotePreference)return"single"===t.quotePreference?0:1;{const t=Am(e)&&e.imports&&x(e.imports,e=>KN(e)&&!iy(e.parent));return t?gY(t,e):1}}function yY(e){switch(e){case 0:return"'";case 1:return'"';default:return pn.assertNever(e)}}function vY(e){const t=bY(e);return void 0===t?void 0:vc(t)}function bY(e){return"default"!==e.escapedName?e.escapedName:m(e.declarations,e=>{const t=Fc(e);return t&&80===t.kind?t.escapedText:void 0})}function xY(e){return Ju(e)&&(WE(e.parent)||wE(e.parent)||tA(e.parent)||Bm(e.parent,!1)&&e.parent.arguments[0]===e||ff(e.parent)&&e.parent.arguments[0]===e)}function kY(e){return fF(e)&&dF(e.parent)&&uD(e.name)&&!e.propertyName}function SY(e,t){const n=e.getTypeAtLocation(t.parent);return n&&e.getPropertyOfType(n,t.name.text)}function TY(e,t,n){if(e)for(;e.parent;){if(dP(e.parent)||!CY(n,e.parent,t))return e;e=e.parent}}function CY(e,t,n){return Ls(e,t.getStart(n))&&t.getEnd()<=Is(e)}function wY(e,t){return EI(e)?x(e.modifiers,e=>e.kind===t):void 0}function NY(e,t,n,r,i){var o;const a=244===(Ze(n)?n[0]:n).kind?Vm:Np,s=D(t.statements,a),{comparer:c,isSorted:l}=y_e.getOrganizeImportsStringComparerWithDetection(s,i),_=Ze(n)?de(n,(e,t)=>y_e.compareImportsOrRequireStatements(e,t,c)):[n];if(null==s?void 0:s.length)if(pn.assert(Am(t)),s&&l)for(const n of _){const r=y_e.getImportDeclarationInsertionIndex(s,n,c);if(0===r){const r=s[0]===t.statements[0]?{leadingTriviaOption:ide.LeadingTriviaOption.Exclude}:{};e.insertNodeBefore(t,s[0],n,!1,r)}else{const i=s[r-1];e.insertNodeAfter(t,i,n)}}else{const n=be(s);n?e.insertNodesAfter(t,n,_):e.insertNodesAtTopOfFile(t,_,r)}else if(Am(t))e.insertNodesAtTopOfFile(t,_,r);else for(const n of _)e.insertStatementsInNewFile(t.fileName,[n],null==(o=fc(n))?void 0:o.getSourceFile())}function DY(e,t){return pn.assert(e.isTypeOnly),it(e.getChildAt(0,t),eY)}function FY(e,t){return!!e&&!!t&&e.start===t.start&&e.length===t.length}function EY(e,t,n){return(n?vt:yt)(e.fileName,t.fileName)&&FY(e.textSpan,t.textSpan)}function PY(e){return(t,n)=>EY(t,n,e)}function AY(e,t){if(e)for(let n=0;n!!FD(e)||!(fF(e)||dF(e)||pF(e))&&"quit")}var RY=new Map;function BY(e){return e=e||Ku,RY.has(e)||RY.set(e,function(e){const t=10*e;let n,r,i,o;u();const a=e=>c(e,17);return{displayParts:()=>{const e=n.length&&n[n.length-1].text;return o>t&&e&&"..."!==e&&($a(e.charCodeAt(e.length-1))||n.push(JY(" ",16)),n.push(JY("...",15))),n},writeKeyword:e=>c(e,5),writeOperator:e=>c(e,12),writePunctuation:e=>c(e,15),writeTrailingSemicolon:e=>c(e,15),writeSpace:e=>c(e,16),writeStringLiteral:e=>c(e,8),writeParameter:e=>c(e,13),writeProperty:e=>c(e,14),writeLiteral:e=>c(e,8),writeSymbol:l,writeLine:_,write:a,writeComment:a,getText:()=>"",getTextPos:()=>0,getColumn:()=>0,getLine:()=>0,isAtStartOfLine:()=>!1,hasTrailingWhitespace:()=>!1,hasTrailingComment:()=>!1,rawWrite:pt,getIndent:()=>i,increaseIndent:()=>{i++},decreaseIndent:()=>{i--},clear:u};function s(){if(!(o>t)&&r){const e=jy(i);e&&(o+=e.length,n.push(JY(e,16))),r=!1}}function c(e,r){o>t||(s(),o+=e.length,n.push(JY(e,r)))}function l(e,r){o>t||(s(),o+=e.length,n.push(function(e,t){return JY(e,n(t));function n(e){const t=e.flags;return 3&t?MY(e)?13:9:4&t||32768&t||65536&t?14:8&t?19:16&t?20:32&t?1:64&t?4:384&t?2:1536&t?11:8192&t?10:262144&t?18:524288&t||2097152&t?0:17}}(e,r)))}function _(){o>t||(o+=1,n.push(nZ()),r=!0)}function u(){n=[],r=!0,i=0,o=0}}(e)),RY.get(e)}function JY(e,t){return{text:e,kind:HG[t]}}function zY(){return JY(" ",16)}function qY(e){return JY(Ia(e),5)}function UY(e){return JY(Ia(e),15)}function VY(e){return JY(Ia(e),12)}function WY(e){return JY(e,13)}function $Y(e){return JY(e,14)}function HY(e){const t=Oa(e);return void 0===t?KY(e):qY(t)}function KY(e){return JY(e,17)}function GY(e){return JY(e,0)}function XY(e){return JY(e,18)}function QY(e){return JY(e,24)}function YY(e){return JY(e,22)}function ZY(e,t){var n;const r=[YY(`{@${hP(e)?"link":yP(e)?"linkcode":"linkplain"} `)];if(e.name){const i=null==t?void 0:t.getSymbolAtLocation(e.name),o=i&&t?lZ(i,t):void 0,a=function(e){let t=e.indexOf("://");if(0===t){for(;t"===e[n]&&t--,n++,!t)return n}return 0}(e.text),s=ep(e.name)+e.text.slice(0,a),c=function(e){let t=0;if(124===e.charCodeAt(t++)){for(;t{e.writeType(t,n,17408|r,s,i,o,a)},i)}function oZ(e,t,n,r,i=0){return rZ(o=>{e.writeSymbol(t,n,r,8|i,o)})}function aZ(e,t,n,r=0,i,o,a){return r|=25632,rZ(s=>{e.writeSignature(t,n,r,void 0,s,i,o,a)},i)}function sZ(e){return!!e.parent&&ql(e.parent)&&e.parent.propertyName===e}function cZ(e,t){return CS(e,t.getScriptKind&&t.getScriptKind(e))}function lZ(e,t){let n=e;for(;_Z(n)||ed(n)&&n.links.target;)n=ed(n)&&n.links.target?n.links.target:_x(n,t);return n}function _Z(e){return!!(2097152&e.flags)}function uZ(e,t){return uJ(_x(e,t))}function dZ(e,t){for(;$a(e.charCodeAt(t));)t+=1;return t}function pZ(e,t){for(;t>-1&&Ha(e.charCodeAt(t));)t-=1;return t+1}function fZ(e,t){const n=e.getSourceFile();!function(e,t){const n=e.getFullStart(),r=e.getStart();for(let e=n;e=0),o}function hZ(e,t,n,r,i){ls(n.text,e.pos,bZ(t,n,r,i,Jw))}function yZ(e,t,n,r,i){_s(n.text,e.end,bZ(t,n,r,i,Uw))}function vZ(e,t,n,r,i){_s(n.text,e.pos,bZ(t,n,r,i,Jw))}function bZ(e,t,n,r,i){return(o,a,s,c)=>{3===s?(o+=2,a-=2):o+=2,i(e,n||s,t.text.slice(o,a),void 0!==r?r:c)}}function xZ(e,t){if(Qt(e,t))return 0;let n=e.indexOf(" "+t);return-1===n&&(n=e.indexOf("."+t)),-1===n&&(n=e.indexOf('"'+t)),-1===n?-1:n+1}function kZ(e){return AF(e)&&28===e.operatorToken.kind||gF(e)||(JF(e)||zF(e))&&gF(e.expression)}function SZ(e,t,n){const r=sh(e.parent);switch(r.kind){case 215:return t.getContextualType(r,n);case 227:{const{left:i,operatorToken:o,right:a}=r;return CZ(o.kind)?t.getTypeAtLocation(e===a?i:a):t.getContextualType(e,n)}case 297:return DZ(r,t);default:return t.getContextualType(e,n)}}function TZ(e,t,n){const r=hY(e,t),i=JSON.stringify(n);return 0===r?`'${Iy(i).replace(/'/g,()=>"\\'").replace(/\\"/g,'"')}'`:i}function CZ(e){switch(e){case 37:case 35:case 38:case 36:return!0;default:return!1}}function wZ(e){switch(e.kind){case 11:case 15:case 229:case 216:return!0;default:return!1}}function NZ(e){return!!e.getStringIndexType()||!!e.getNumberIndexType()}function DZ(e,t){return t.getTypeAtLocation(e.parent.parent.expression)}var FZ="anonymous function";function EZ(e,t,n,r){const i=n.getTypeChecker();let o=!0;const a=()=>o=!1,s=i.typeToTypeNode(e,t,1,8,{trackSymbol:(e,t,n)=>(o=o&&0===i.isSymbolAccessible(e,t,n,!1).accessibility,!o),reportInaccessibleThisError:a,reportPrivateInBaseOfClassExpression:a,reportInaccessibleUniqueSymbolError:a,moduleResolverHost:uY(n,r)});return o?s:void 0}function PZ(e){return 180===e||181===e||182===e||172===e||174===e}function AZ(e){return 263===e||177===e||175===e||178===e||179===e}function IZ(e){return 268===e}function OZ(e){return 244===e||245===e||247===e||252===e||253===e||254===e||258===e||260===e||173===e||266===e||273===e||272===e||279===e||271===e||278===e}var LZ=nn(PZ,AZ,IZ,OZ);function jZ(e,t,n){const r=mc(t,t=>t.end!==e?"quit":LZ(t.kind));return!!r&&function(e,t){const n=e.getLastToken(t);if(n&&27===n.kind)return!1;if(PZ(e.kind)){if(n&&28===n.kind)return!1}else if(IZ(e.kind)){const n=xe(e.getChildren(t));if(n&&kE(n))return!1}else if(AZ(e.kind)){const n=xe(e.getChildren(t));if(n&&Uf(n))return!1}else if(!OZ(e.kind))return!1;if(247===e.kind)return!0;const r=pQ(e,mc(e,e=>!e.parent),t);return!r||20===r.kind||t.getLineAndCharacterOfPosition(e.getEnd()).line!==t.getLineAndCharacterOfPosition(r.getStart(t)).line}(r,n)}function MZ(e){let t=0,n=0;return iO(e,function r(i){if(OZ(i.kind)){const r=i.getLastToken(e);27===(null==r?void 0:r.kind)?t++:n++}else if(PZ(i.kind)){const r=i.getLastToken(e);if(27===(null==r?void 0:r.kind))t++;else if(r&&28!==r.kind){Wa(e,r.getStart(e)).line!==Wa(e,Zp(e,r.end).start).line&&n++}}return t+n>=5||iO(i,r)}),0===t&&n<=1||t/n>.2}function RZ(e,t){return UZ(e,e.getDirectories,t)||[]}function BZ(e,t,n,r,i){return UZ(e,e.readDirectory,t,n,r,i)||_}function JZ(e,t){return UZ(e,e.fileExists,t)}function zZ(e,t){return qZ(()=>Ib(t,e))||!1}function qZ(e){try{return e()}catch{return}}function UZ(e,t,...n){return qZ(()=>t&&t.apply(e,n))}function VZ(e,t){const n=[];return LR(t,e,e=>{const r=Jo(e,"package.json");JZ(t,r)&&n.push(r)}),n}function WZ(e,t){let n;return LR(t,e,e=>"node_modules"===e||(n=XU(e,e=>JZ(t,e),"package.json"),!!n||void 0)),n}function $Z(e,t){if(!t.readFile)return;const n=["dependencies","devDependencies","optionalDependencies","peerDependencies"],r=Ab(t.readFile(e)||""),i={};if(r)for(const e of n){const t=r[e];if(!t)continue;const n=new Map;for(const e in t)n.set(e,t[e]);i[e]=n}const o=[[1,i.dependencies],[2,i.devDependencies],[8,i.optionalDependencies],[4,i.peerDependencies]];return{...i,parseable:!!r,fileName:e,get:a,has:(e,t)=>!!a(e,t)};function a(e,t=15){for(const[n,r]of o)if(r&&t&n){const t=r.get(e);if(void 0!==t)return t}}}function HZ(e,t,n){const r=(n.getPackageJsonsVisibleToFile&&n.getPackageJsonsVisibleToFile(e.fileName)||function(e,t){if(!t.fileExists)return[];const n=[];return LR(t,Ao(e),e=>{const r=Jo(e,"package.json");if(t.fileExists(r)){const e=$Z(r,t);e&&n.push(e)}}),n}(e.fileName,n)).filter(e=>e.parseable);let i,o,a;return{allowsImportingAmbientModule:function(e,t){if(!r.length||!e.valueDeclaration)return!0;if(o){const t=o.get(e);if(void 0!==t)return t}else o=new Map;const n=Iy(e.getName());if(c(n))return o.set(e,!0),!0;const i=l(e.valueDeclaration.getSourceFile().fileName,t);if(void 0===i)return o.set(e,!0),!0;const a=s(i)||s(n);return o.set(e,a),a},getSourceFileInfo:function(e,t){if(!r.length)return{importable:!0,packageName:void 0};if(a){const t=a.get(e);if(void 0!==t)return t}else a=new Map;const n=l(e.fileName,t);if(!n){const t={importable:!0,packageName:n};return a.set(e,t),t}const i={importable:s(n),packageName:n};return a.set(e,i),i},allowsImportingSpecifier:function(e){if(!r.length||c(e))return!0;if(So(e)||bo(e))return!0;return s(e)}};function s(e){const t=_(e);for(const e of r)if(e.has(t)||e.has(zR(t)))return!0;return!1}function c(t){return!!(Am(e)&&Im(e)&&AC.has(t)&&(void 0===i&&(i=KZ(e)),i))}function l(r,i){if(!r.includes("node_modules"))return;const o=pB.getNodeModulesPackageName(n.getCompilationSettings(),e,r,i,t);return o?So(o)||bo(o)?void 0:_(o):void 0}function _(e){const t=jo(UR(e)).slice(1);return Qt(t[0],"@")?`${t[0]}/${t[1]}`:t[0]}}function KZ(e){return H(e.imports,({text:e})=>AC.has(e))}function GZ(e){return C(jo(e),"node_modules")}function XZ(e){return void 0!==e.file&&void 0!==e.start&&void 0!==e.length}function QZ(e,t){const n=Ne(t,WQ(e),lt,kt);if(n>=0){const r=t[n];return pn.assertEqual(r.file,e.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"),it(r,XZ)}}function YZ(e,t){var n;let r=Ne(t,e.start,e=>e.start,xt);for(r<0&&(r=~r);(null==(n=t[r-1])?void 0:n.start)===e.start;)r--;const i=[],o=Is(e);for(;;){const n=rt(t[r],XZ);if(!n||n.start>o)break;Ms(e,n)&&i.push(n),r++}return i}function ZZ({startPosition:e,endPosition:t}){return Xs(e,void 0===t?e:t)}function e0(e,t){return mc(lQ(e,t.start),n=>n.getStart(e)Is(t)?"quit":K_(n)&&FY(t,WQ(n,e)))}function t0(e,t,n=lt){return e?Ze(e)?n(P(e,t)):t(e,0):void 0}function n0(e){return Ze(e)?ye(e):e}function r0(e,t,n){return"export="===e.escapedName||"default"===e.escapedName?i0(e)||o0(function(e){var t;return pn.checkDefined(e.parent,`Symbol parent was undefined. Flags: ${pn.formatSymbolFlags(e.flags)}. Declarations: ${null==(t=e.declarations)?void 0:t.map(e=>{const t=pn.formatSyntaxKind(e.kind),n=Om(e),{expression:r}=e;return(n?"[JS]":"")+t+(r?` (expression: ${pn.formatSyntaxKind(r.kind)})`:"")}).join(", ")}.`)}(e),t,!!n):e.name}function i0(e){return m(e.declarations,t=>{var n,r,i;if(ME(t))return null==(n=rt(AA(t.expression),uD))?void 0:n.text;if(JE(t)&&2097152===t.symbol.flags)return null==(r=rt(t.propertyName,uD))?void 0:r.text;const o=null==(i=rt(Fc(t),uD))?void 0:i.text;return o||(e.parent&&!td(e.parent)?e.parent.getName():void 0)})}function o0(e,t,n){return a0(KS(Iy(e.name)),t,n)}function a0(e,t,n){const r=Io(Jt(KS(e),"/index"));let i="",o=!0;const a=r.charCodeAt(0);hs(a,t)?(i+=String.fromCharCode(a),n&&(i=i.toUpperCase())):o=!1;for(let e=1;ee.length)return!1;for(let i=0;i(e[e.Named=0]="Named",e[e.Default=1]="Default",e[e.Namespace=2]="Namespace",e[e.CommonJS=3]="CommonJS",e))(b0||{}),x0=(e=>(e[e.Named=0]="Named",e[e.Default=1]="Default",e[e.ExportEquals=2]="ExportEquals",e[e.UMD=3]="UMD",e[e.Module=4]="Module",e))(x0||{});function k0(e){let t=1;const n=Ke(),r=new Map,i=new Map;let o;const a={isUsableByFile:e=>e===o,isEmpty:()=>!n.size,clear:()=>{n.clear(),r.clear(),o=void 0},add:(e,s,c,l,_,u,d,p)=>{let f;if(e!==o&&(a.clear(),o=e),_){const t=KT(_.fileName);if(t){const{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:r,packageRootIndex:o}=t;if(f=VR(UR(_.fileName.substring(r+1,o))),Qt(e,_.path.substring(0,n))){const e=i.get(f),t=_.fileName.substring(0,r+1);if(e){n>e.indexOf(oR)&&i.set(f,t)}else i.set(f,t)}}}const m=1===u&&Tb(s)||s,g=0===u||td(m)?vc(c):function(e,t,n){let r;return I0(e,t,n,(e,t)=>(r=t?[e,t]:e,!0)),pn.checkDefined(r)}(m,p,void 0),h="string"==typeof g?g:g[0],y="string"==typeof g?void 0:g[1],v=Iy(l.name),b=t++,x=_x(s,p),k=33554432&s.flags?void 0:s,S=33554432&l.flags?void 0:l;k&&S||r.set(b,[s,l]),n.add(function(e,t,n,r){const i=n||"";return`${e.length} ${uJ(_x(t,r))} ${e} ${i}`}(h,s,Fs(v)?void 0:v,p),{id:b,symbolTableKey:c,symbolName:h,capitalizedSymbolName:y,moduleName:v,moduleFile:_,moduleFileName:null==_?void 0:_.fileName,packageName:f,exportKind:u,targetFlags:x.flags,isFromPackageJson:d,symbol:k,moduleSymbol:S})},get:(e,t)=>{if(e!==o)return;const r=n.get(t);return null==r?void 0:r.map(s)},search:(t,r,a,c)=>{if(t===o)return sd(n,(t,n)=>{const{symbolName:o,ambientModuleName:l}=function(e){const t=e.indexOf(" "),n=e.indexOf(" ",t+1),r=parseInt(e.substring(0,t),10),i=e.substring(n+1),o=i.substring(0,r),a=i.substring(r+1),s=""===a?void 0:a;return{symbolName:o,ambientModuleName:s}}(n),_=r&&t[0].capitalizedSymbolName||o;if(a(_,t[0].targetFlags)){const r=t.map(s).filter((n,r)=>function(t,n){if(!n||!t.moduleFileName)return!0;const r=e.getGlobalTypingsCacheLocation();if(r&&Qt(t.moduleFileName,r))return!0;const o=i.get(n);return!o||Qt(t.moduleFileName,o)}(n,t[r].packageName));if(r.length){const e=c(r,_,!!l,n);if(void 0!==e)return e}}})},releaseSymbols:()=>{r.clear()},onFileChanged:(e,t,n)=>(!c(e)||!c(t))&&(o&&o!==t.path||n&&KZ(e)!==KZ(t)||!re(e.moduleAugmentations,t.moduleAugmentations)||!function(e,t){if(!re(e.ambientModuleNames,t.ambientModuleNames))return!1;let n=-1,r=-1;for(const i of t.ambientModuleNames){const o=e=>fp(e)&&e.name.text===i;if(n=S(e.statements,o,n+1),r=S(t.statements,o,r+1),e.statements[n]!==t.statements[r])return!1}return!0}(e,t)?(a.clear(),!0):(o=t.path,!1))};return pn.isDebugging&&Object.defineProperty(a,"__cache",{value:n}),a;function s(t){if(t.symbol&&t.moduleSymbol)return t;const{id:n,exportKind:i,targetFlags:o,isFromPackageJson:a,moduleFileName:s}=t,[c,l]=r.get(n)||_;if(c&&l)return{symbol:c,moduleSymbol:l,moduleFileName:s,exportKind:i,targetFlags:o,isFromPackageJson:a};const u=(a?e.getPackageJsonAutoImportProvider():e.getCurrentProgram()).getTypeChecker(),d=t.moduleSymbol||l||pn.checkDefined(t.moduleFile?u.getMergedSymbol(t.moduleFile.symbol):u.tryFindAmbientModule(t.moduleName)),p=t.symbol||c||pn.checkDefined(2===i?u.resolveExternalModuleSymbol(d):u.tryGetMemberInModuleExportsAndProperties(vc(t.symbolTableKey),d),`Could not find symbol '${t.symbolName}' by key '${t.symbolTableKey}' in module ${d.name}`);return r.set(n,[p,d]),{symbol:p,moduleSymbol:d,moduleFileName:s,exportKind:i,targetFlags:o,isFromPackageJson:a}}function c(e){return!(e.commonJsModuleIndicator||e.externalModuleIndicator||e.moduleAugmentations||e.ambientModuleNames)}}function S0(e,t,n,r,i,o,a,s){var c;if(!n){let n;const i=Iy(r.name);return AC.has(i)&&void 0!==(n=_0(t,e))?n===Qt(i,"node:"):!o||o.allowsImportingAmbientModule(r,a)||T0(t,i)}if(pn.assertIsDefined(n),t===n)return!1;const l=null==s?void 0:s.get(t.path,n.path,i,{});if(void 0!==(null==l?void 0:l.isBlockedByPackageJsonDependencies))return!l.isBlockedByPackageJsonDependencies||!!l.packageName&&T0(t,l.packageName);const _=zy(a),u=null==(c=a.getGlobalTypingsCacheLocation)?void 0:c.call(a),d=!!pB.forEachFileNameOfModule(t.fileName,n.fileName,a,!1,r=>{const i=e.getSourceFile(r);return(i===n||!i)&&function(e,t,n,r,i){const o=LR(i,t,e=>"node_modules"===Io(e)?e:void 0),a=o&&Ao(n(o));return void 0===a||Qt(n(e),a)||!!r&&Qt(n(r),a)}(t.fileName,r,_,u,a)});if(o){const e=d?o.getSourceFileInfo(n,a):void 0;return null==s||s.setBlockedByPackageJsonDependencies(t.path,n.path,i,{},null==e?void 0:e.packageName,!(null==e?void 0:e.importable)),!!(null==e?void 0:e.importable)||d&&!!(null==e?void 0:e.packageName)&&T0(t,e.packageName)}return d}function T0(e,t){return e.imports&&e.imports.some(e=>e.text===t||e.text.startsWith(t+"/"))}function C0(e,t,n,r,i){var o,a;const s=Jy(t),c=n.autoImportFileExcludePatterns&&w0(n,s);N0(e.getTypeChecker(),e.getSourceFiles(),c,t,(t,n)=>i(t,n,e,!1));const l=r&&(null==(o=t.getPackageJsonAutoImportProvider)?void 0:o.call(t));if(l){const n=Wn(),r=e.getTypeChecker();N0(l.getTypeChecker(),l.getSourceFiles(),c,t,(t,n)=>{(n&&!e.getSourceFile(n.fileName)||!n&&!r.resolveName(t.name,void 0,1536,!1))&&i(t,n,l,!0)}),null==(a=t.log)||a.call(t,"forEachExternalModuleToImportFrom autoImportProvider: "+(Wn()-n))}}function w0(e,t){return J(e.autoImportFileExcludePatterns,e=>{const n=yS(e,"","exclude");return n?xS(n,t):void 0})}function N0(e,t,n,r,i){var o;const a=n&&D0(n,r);for(const t of e.getAmbientModules())t.name.includes("*")||n&&(null==(o=t.declarations)?void 0:o.every(e=>a(e.getSourceFile())))||i(t,void 0);for(const n of t)rf(n)&&!(null==a?void 0:a(n))&&i(e.getMergedSymbol(n.symbol),n)}function D0(e,t){var n;const r=null==(n=t.getSymlinkCache)?void 0:n.call(t).getSymlinkedDirectoriesByRealpath();return({fileName:n,path:i})=>{if(e.some(e=>e.test(n)))return!0;if((null==r?void 0:r.size)&&aR(n)){let o=Ao(n);return LR(t,Ao(i),t=>{const i=r.get(Go(t));if(i)return i.some(t=>e.some(e=>e.test(n.replace(o,t))));o=Ao(o)})??!1}return!1}}function F0(e,t){return t.autoImportFileExcludePatterns?D0(w0(t,Jy(e)),e):()=>!1}function E0(e,t,n,r,i){var o,a,s,c,l;const _=Wn();null==(o=t.getPackageJsonAutoImportProvider)||o.call(t);const u=(null==(a=t.getCachedExportInfoMap)?void 0:a.call(t))||k0({getCurrentProgram:()=>n,getPackageJsonAutoImportProvider:()=>{var e;return null==(e=t.getPackageJsonAutoImportProvider)?void 0:e.call(t)},getGlobalTypingsCacheLocation:()=>{var e;return null==(e=t.getGlobalTypingsCacheLocation)?void 0:e.call(t)}});if(u.isUsableByFile(e.path))return null==(s=t.log)||s.call(t,"getExportInfoMap: cache hit"),u;null==(c=t.log)||c.call(t,"getExportInfoMap: cache miss or empty; calculating new results");let d=0;try{C0(n,t,r,!0,(t,n,r,o)=>{++d%100==0&&(null==i||i.throwIfCancellationRequested());const a=new Set,s=r.getTypeChecker(),c=P0(t,s);c&&A0(c.symbol,s)&&u.add(e.path,c.symbol,1===c.exportKind?"default":"export=",t,n,c.exportKind,o,s),s.forEachExportAndPropertyOfModule(t,(r,i)=>{r!==(null==c?void 0:c.symbol)&&A0(r,s)&&Cx(a,i)&&u.add(e.path,r,i,t,n,0,o,s)})})}catch(e){throw u.clear(),e}return null==(l=t.log)||l.call(t,`getExportInfoMap: done in ${Wn()-_} ms`),u}function P0(e,t){const n=t.resolveExternalModuleSymbol(e);if(n!==e){const e=t.tryGetMemberInModuleExports("default",n);return e?{symbol:e,exportKind:1}:{symbol:n,exportKind:2}}const r=t.tryGetMemberInModuleExports("default",e);if(r)return{symbol:r,exportKind:1}}function A0(e,t){return!(t.isUndefinedSymbol(e)||t.isUnknownSymbol(e)||Gh(e)||Xh(e))}function I0(e,t,n,r){let i,o=e;const a=new Set;for(;o;){const e=i0(o);if(e){const t=r(e);if(t)return t}if("default"!==o.escapedName&&"export="!==o.escapedName){const e=r(o.name);if(e)return e}if(i=ae(i,o),!Cx(a,o))break;o=2097152&o.flags?t.getImmediateAliasedSymbol(o):void 0}for(const e of i??_)if(e.parent&&td(e.parent)){const t=r(o0(e.parent,n,!1),o0(e.parent,n,!0));if(t)return t}}function O0(){const e=bs(99,!1);function t(t,n,r){let i=0,o=0;const a=[],{prefix:s,pushTemplate:c}=function(e){switch(e){case 3:return{prefix:'"\\\n'};case 2:return{prefix:"'\\\n"};case 1:return{prefix:"/*\n"};case 4:return{prefix:"`\n"};case 5:return{prefix:"}\n",pushTemplate:!0};case 6:return{prefix:"",pushTemplate:!0};case 0:return{prefix:""};default:return pn.assertNever(e)}}(n);t=s+t;const l=s.length;c&&a.push(16),e.setText(t);let _=0;const u=[];let d=0;do{i=e.scan(),jh(i)||(p(),o=i);const n=e.getTokenEnd();if(R0(e.getTokenStart(),n,l,J0(i),u),n>=t.length){const t=M0(e,i,be(a));void 0!==t&&(_=t)}}while(1!==i);function p(){switch(i){case 44:case 69:j0[o]||14!==e.reScanSlashToken()||(i=14);break;case 30:80===o&&d++;break;case 32:d>0&&d--;break;case 133:case 154:case 150:case 136:case 155:d>0&&!r&&(i=80);break;case 16:a.push(i);break;case 19:a.length>0&&a.push(i);break;case 20:if(a.length>0){const t=be(a);16===t?(i=e.reScanTemplateToken(!1),18===i?a.pop():pn.assertEqual(i,17,"Should have been a template middle.")):(pn.assertEqual(t,19,"Should have been an open brace"),a.pop())}break;default:if(!Fh(i))break;(25===o||Fh(o)&&Fh(i)&&!function(e,t){if(!RQ(e))return!0;switch(t){case 139:case 153:case 137:case 126:case 129:return!0;default:return!1}}(o,i))&&(i=80)}}return{endOfLineState:_,spans:u}}return{getClassificationsForLine:function(e,n,r){return function(e,t){const n=[],r=e.spans;let i=0;for(let e=0;e=0){const e=t-i;e>0&&n.push({length:e,classification:4})}n.push({length:o,classification:B0(a)}),i=t+o}const o=t.length-i;o>0&&n.push({length:o,classification:4});return{entries:n,finalLexState:e.endOfLineState}}(t(e,n,r),e)},getEncodedLexicalClassifications:t}}var L0,j0=Je([80,11,9,10,14,110,46,47,22,24,20,112,97],e=>e,()=>!0);function M0(e,t,n){switch(t){case 11:{if(!e.isUnterminated())return;const t=e.getTokenText(),n=t.length-1;let r=0;for(;92===t.charCodeAt(n-r);)r++;if(!(1&r))return;return 34===t.charCodeAt(0)?3:2}case 3:return e.isUnterminated()?1:void 0;default:if(Bl(t)){if(!e.isUnterminated())return;switch(t){case 18:return 5;case 15:return 4;default:return pn.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+t)}}return 16===n?6:void 0}}function R0(e,t,n,r,i){if(8===r)return;0===e&&n>0&&(e+=n);const o=t-e;o>0&&i.push(e-n,o,r)}function B0(e){switch(e){case 1:return 3;case 3:return 1;case 4:return 6;case 25:return 7;case 5:return 2;case 6:return 8;case 8:return 4;case 10:return 0;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return 5;default:return}}function J0(e){if(Fh(e))return 3;if(function(e){switch(e){case 42:case 44:case 45:case 40:case 41:case 48:case 49:case 50:case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:case 35:case 36:case 37:case 38:case 51:case 53:case 52:case 56:case 57:case 75:case 74:case 79:case 71:case 72:case 73:case 65:case 66:case 67:case 69:case 70:case 64:case 28:case 61:case 76:case 77:case 78:return!0;default:return!1}}(e)||function(e){switch(e){case 40:case 41:case 55:case 54:case 46:case 47:return!0;default:return!1}}(e))return 5;if(e>=19&&e<=79)return 10;switch(e){case 9:return 4;case 10:return 25;case 11:return 6;case 14:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;default:return Bl(e)?6:2}}function z0(e,t,n,r,i){return $0(U0(e,t,n,r,i))}function q0(e,t){switch(t){case 268:case 264:case 265:case 263:case 232:case 219:case 220:e.throwIfCancellationRequested()}}function U0(e,t,n,r,i){const o=[];return n.forEachChild(function a(s){if(s&&Us(i,s.pos,s.getFullWidth())){if(q0(t,s.kind),uD(s)&&!Pd(s)&&r.has(s.escapedText)){const t=e.getSymbolAtLocation(s),r=t&&V0(t,aX(s),e);r&&function(e,t,n){const r=t-e;pn.assert(r>0,`Classification had non-positive length of ${r}`),o.push(e),o.push(r),o.push(n)}(s.getStart(n),s.getEnd(),r)}s.forEachChild(a)}}),{spans:o,endOfLineState:0}}function V0(e,t,n){const r=e.getFlags();return 2885600&r?32&r?11:384&r?12:524288&r?16:1536&r?4&t||1&t&&function(e){return H(e.declarations,e=>xE(e)&&1===eB(e))}(e)?14:void 0:2097152&r?V0(n.getAliasedSymbol(e),t,n):2&t?64&r?13:262144&r?15:void 0:void 0:void 0}function W0(e){switch(e){case 1:return"comment";case 2:return"identifier";case 3:return"keyword";case 4:return"number";case 25:return"bigint";case 5:return"operator";case 6:return"string";case 8:return"whitespace";case 9:return"text";case 10:return"punctuation";case 11:return"class name";case 12:return"enum name";case 13:return"interface name";case 14:return"module name";case 15:return"type parameter name";case 16:return"type alias name";case 17:return"parameter name";case 18:return"doc comment tag name";case 19:return"jsx open tag name";case 20:return"jsx close tag name";case 21:return"jsx self closing tag name";case 22:return"jsx attribute";case 23:return"jsx text";case 24:return"jsx attribute string literal value";default:return}}function $0(e){pn.assert(e.spans.length%3==0);const t=e.spans,n=[];for(let e=0;e])*)(\/>)?)?/m,i=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/g,o=t.text.substr(e,n),a=r.exec(o);if(!a)return!1;if(!a[3]||!(a[3]in Mi))return!1;let s=e;_(s,a[1].length),s+=a[1].length,c(s,a[2].length,10),s+=a[2].length,c(s,a[3].length,21),s+=a[3].length;const l=a[4];let u=s;for(;;){const e=i.exec(l);if(!e)break;const t=s+e.index+e[1].length;t>u&&(_(u,t-u),u=t),c(u,e[2].length,22),u+=e[2].length,e[3].length&&(_(u,e[3].length),u+=e[3].length),c(u,e[4].length,5),u+=e[4].length,e[5].length&&(_(u,e[5].length),u+=e[5].length),c(u,e[6].length,24),u+=e[6].length}s+=a[4].length,s>u&&_(u,s-u);a[5]&&(c(s,a[5].length,10),s+=a[5].length);const d=e+n;s=0),i>0){const t=n||m(e.kind,e);t&&c(r,i,t)}return!0}function m(e,t){if(Fh(e))return 3;if((30===e||32===e)&&t&&AQ(t.parent))return 10;if(Eh(e)){if(t){const n=t.parent;if(64===e&&(261===n.kind||173===n.kind||170===n.kind||292===n.kind))return 5;if(227===n.kind||225===n.kind||226===n.kind||228===n.kind)return 5}return 10}if(9===e)return 4;if(10===e)return 25;if(11===e)return t&&292===t.parent.kind?24:6;if(14===e)return 6;if(Bl(e))return 6;if(12===e)return 23;if(80===e){if(t){switch(t.parent.kind){case 264:return t.parent.name===t?11:void 0;case 169:return t.parent.name===t?15:void 0;case 265:return t.parent.name===t?13:void 0;case 267:return t.parent.name===t?12:void 0;case 268:return t.parent.name===t?14:void 0;case 170:return t.parent.name===t?pv(t)?3:17:void 0}if(wl(t.parent))return 3}return 2}}function g(n){if(n&&Vs(r,i,n.pos,n.getFullWidth())){q0(e,n.kind);for(const e of n.getChildren(t))f(e)||g(e)}}}function G0(e){return!!e.sourceFile}function X0(e,t,n){return Q0(e,t,n)}function Q0(e,t="",n,r){const i=new Map,o=Ht(!!e);function a(e){return"function"==typeof e.getCompilationSettings?e.getCompilationSettings():e}function s(e,t,n,r,i,o,a,s){return _(e,t,n,r,i,o,!0,a,s)}function c(e,t,n,r,i,o,s,c){return _(e,t,a(n),r,i,o,!1,s,c)}function l(e,t){const n=G0(e)?e:e.get(pn.checkDefined(t,"If there are more than one scriptKind's for same document the scriptKind should be provided"));return pn.assert(void 0===t||!n||n.sourceFile.scriptKind===t,`Script kind should match provided ScriptKind:${t} and sourceFile.scriptKind: ${null==n?void 0:n.sourceFile.scriptKind}, !entry: ${!n}`),n}function _(e,t,o,s,c,_,u,d,p){var f,m,g,h;d=CS(e,d);const y=a(o),v=o===y?void 0:o,b=6===d?100:Sk(y),x="object"==typeof p?p:{languageVersion:b,impliedNodeFormat:v&&UV(t,null==(h=null==(g=null==(m=null==(f=v.getCompilerHost)?void 0:f.call(v))?void 0:m.getModuleResolutionCache)?void 0:g.call(m))?void 0:h.getPackageJsonInfoCache(),v,y),setExternalModuleIndicator:yk(y),jsDocParsingMode:n};x.languageVersion=b,pn.assertEqual(n,x.jsDocParsingMode);const k=i.size,S=Z0(s,x.impliedNodeFormat),T=q(i,S,()=>new Map);if(Gn){i.size>k&&Gn.instant(Gn.Phase.Session,"createdDocumentRegistryBucket",{configFilePath:y.configFilePath,key:S});const e=!vO(t)&&sd(i,(e,n)=>n!==S&&e.has(t)&&n);e&&Gn.instant(Gn.Phase.Session,"documentRegistryBucketOverlap",{path:t,key1:e,key2:S})}const C=T.get(t);let w=C&&l(C,d);if(!w&&r){const e=r.getDocument(S,t);e&&e.scriptKind===d&&e.text===rY(c)&&(pn.assert(u),w={sourceFile:e,languageServiceRefCount:0},N())}if(w)w.sourceFile.version!==_&&(w.sourceFile=c7(w.sourceFile,c,_,c.getChangeRange(w.sourceFile.scriptSnapshot)),r&&r.setDocument(S,t,w.sourceFile)),u&&w.languageServiceRefCount++;else{const n=s7(e,c,x,_,!1,d);r&&r.setDocument(S,t,n),w={sourceFile:n,languageServiceRefCount:1},N()}return pn.assert(0!==w.languageServiceRefCount),w.sourceFile;function N(){if(C)if(G0(C)){const e=new Map;e.set(C.sourceFile.scriptKind,C),e.set(d,w),T.set(t,e)}else C.set(d,w);else T.set(t,w)}}function u(e,t,n,r){const o=pn.checkDefined(i.get(Z0(t,r))),a=o.get(e),s=l(a,n);s.languageServiceRefCount--,pn.assert(s.languageServiceRefCount>=0),0===s.languageServiceRefCount&&(G0(a)?o.delete(e):(a.delete(n),1===a.size&&o.set(e,g(a.values(),lt))))}return{acquireDocument:function(e,n,r,i,c,l){return s(e,Ho(e,t,o),n,Y0(a(n)),r,i,c,l)},acquireDocumentWithKey:s,updateDocument:function(e,n,r,i,s,l){return c(e,Ho(e,t,o),n,Y0(a(n)),r,i,s,l)},updateDocumentWithKey:c,releaseDocument:function(e,n,r,i){return u(Ho(e,t,o),Y0(n),r,i)},releaseDocumentWithKey:u,getKeyForCompilationSettings:Y0,getDocumentRegistryBucketKeyWithMode:Z0,reportStats:function(){const e=je(i.keys()).filter(e=>e&&"_"===e.charAt(0)).map(e=>{const t=i.get(e),n=[];return t.forEach((e,t)=>{G0(e)?n.push({name:t,scriptKind:e.sourceFile.scriptKind,refCount:e.languageServiceRefCount}):e.forEach((e,r)=>n.push({name:t,scriptKind:r,refCount:e.languageServiceRefCount}))}),n.sort((e,t)=>t.refCount-e.refCount),{bucket:e,sourceFiles:n}});return JSON.stringify(e,void 0,2)},getBuckets:()=>i}}function Y0(e){return IM(e,$O)}function Z0(e,t){return t?`${e}|${t}`:e}function e1(e,t,n,r,i,o,a){const s=Jy(r),c=Ht(s),l=t1(t,n,c,a),_=t1(n,t,c,a);return ide.ChangeTracker.with({host:r,formatContext:i,preferences:o},i=>{!function(e,t,n,r,i,o,a){const{configFile:s}=e.getCompilerOptions();if(!s)return;const c=Ao(s.fileName),l=Gf(s);if(!l)return;function _(e){const t=mF(e.initializer)?e.initializer.elements:[e.initializer];let n=!1;for(const e of t)n=u(e)||n;return n}function u(e){if(!KN(e))return!1;const r=n1(c,e.text),i=n(r);return void 0!==i&&(t.replaceRangeWithText(s,a1(e,s),d(i)),!0)}function d(e){return sa(c,e,!a)}s1(l,(e,n)=>{switch(n){case"files":case"include":case"exclude":{if(_(e)||"include"!==n||!mF(e.initializer))return;const l=J(e.initializer.elements,e=>KN(e)?e.text:void 0);if(0===l.length)return;const u=bS(c,[],l,a,o);return void(xS(pn.checkDefined(u.includeFilePattern),a).test(r)&&!xS(pn.checkDefined(u.includeFilePattern),a).test(i)&&t.insertNodeAfter(s,xe(e.initializer.elements),bw.createStringLiteral(d(i))))}case"compilerOptions":return void s1(e.initializer,(e,t)=>{const n=yL(t);pn.assert("listOrElement"!==(null==n?void 0:n.type)),n&&(n.isFilePath||"list"===n.type&&n.element.isFilePath)?_(e):"paths"===t&&s1(e.initializer,e=>{if(mF(e.initializer))for(const t of e.initializer.elements)u(t)})})}})}(e,i,l,t,n,r.getCurrentDirectory(),s),function(e,t,n,r,i,o){const a=e.getSourceFiles();for(const s of a){const c=n(s.fileName),l=c??s.fileName,_=Ao(l),u=r(s.fileName),d=u||s.fileName,p=Ao(d),f=void 0!==c||void 0!==u;o1(s,t,e=>{if(!So(e))return;const t=n1(p,e),r=n(t);return void 0===r?void 0:Xo(sa(_,r,o))},t=>{const r=e.getTypeChecker().getSymbolAtLocation(t);if((null==r?void 0:r.declarations)&&r.declarations.some(e=>dp(e)))return;const o=void 0!==u?i1(t,HM(t.text,d,e.getCompilerOptions(),i),n,a):r1(r,t,s,e,i,n);return void 0!==o&&(o.updated||f&&So(t.text))?pB.updateModuleSpecifier(e.getCompilerOptions(),s,l,o.newFileName,_Y(e,i),t.text):void 0})}}(e,i,l,_,r,c)})}function t1(e,t,n,r){const i=n(e);return e=>{const o=r&&r.tryGetSourcePosition({fileName:e,pos:0}),a=function(e){if(n(e)===i)return t;const r=iS(e,i,n);return void 0===r?void 0:t+"/"+r}(o?o.fileName:e);return o?void 0===a?void 0:function(e,t,n,r){const i=la(e,t,r);return n1(Ao(n),i)}(o.fileName,a,e,n):a}}function n1(e,t){return Xo(function(e,t){return Vo(Jo(e,t))}(e,t))}function r1(e,t,n,r,i,o){if(e){const t=x(e.declarations,dP).fileName,n=o(t);return void 0===n?{newFileName:t,updated:!1}:{newFileName:n,updated:!0}}{const e=r.getModeForUsageLocation(n,t);return i1(t,i.resolveModuleNameLiterals||!i.resolveModuleNames?r.getResolvedModuleFromModuleSpecifier(t,n):i.getResolvedModuleWithFailedLookupLocationsFromCache&&i.getResolvedModuleWithFailedLookupLocationsFromCache(t.text,n.fileName,e),o,r.getSourceFiles())}}function i1(e,t,n,r){if(!t)return;if(t.resolvedModule){const e=a(t.resolvedModule.resolvedFileName);if(e)return e}const i=p(t.failedLookupLocations,function(e){const t=n(e);return t&&x(r,e=>e.fileName===t)?o(e):void 0})||So(e.text)&&p(t.failedLookupLocations,o);return i||t.resolvedModule&&{newFileName:t.resolvedModule.resolvedFileName,updated:!1};function o(e){return Bt(e,"/package.json")?void 0:a(e)}function a(e){const t=n(e);return t&&{newFileName:t,updated:!0}}}function o1(e,t,n,r){for(const r of e.referencedFiles||_){const i=n(r.fileName);void 0!==i&&i!==e.text.slice(r.pos,r.end)&&t.replaceRangeWithText(e,r,i)}for(const n of e.imports){const i=r(n);void 0!==i&&i!==n.text&&t.replaceRangeWithText(e,a1(n,e),i)}}function a1(e,t){return Mb(e.getStart(t)+1,e.end-1)}function s1(e,t){if(gF(e))for(const n of e.properties)cP(n)&&KN(n.name)&&t(n,n.name.text)}(e=>{function t(e,t){return{fileName:t.fileName,textSpan:WQ(e,t),kind:"none"}}function n(e){return uE(e)?[e]:dE(e)?G(e.catchClause?n(e.catchClause):e.tryBlock&&n(e.tryBlock),e.finallyBlock&&n(e.finallyBlock)):s_(e)?void 0:i(e,n)}function r(e){return Fl(e)?[e]:s_(e)?void 0:i(e,r)}function i(e,t){const n=[];return e.forEachChild(e=>{const r=t(e);void 0!==r&&n.push(...et(r))}),n}function o(e,t){const n=a(t);return!!n&&n===e}function a(e){return mc(e,t=>{switch(t.kind){case 256:if(252===e.kind)return!1;case 249:case 250:case 251:case 248:case 247:return!e.label||function(e,t){return!!mc(e.parent,e=>_E(e)?e.label.escapedText===t:"quit")}(t,e.label.escapedText);default:return s_(t)&&"quit"}})}function s(e,t,...n){return!(!t||!C(n,t.kind))&&(e.push(t),!0)}function c(e){const t=[];if(s(t,e.getFirstToken(),99,117,92)&&247===e.kind){const n=e.getChildren();for(let e=n.length-1;e>=0&&!s(t,n[e],117);e--);}return p(r(e.statement),n=>{o(e,n)&&s(t,n.getFirstToken(),83,88)}),t}function l(e){const t=a(e);if(t)switch(t.kind){case 249:case 250:case 251:case 247:case 248:return c(t);case 256:return _(t)}}function _(e){const t=[];return s(t,e.getFirstToken(),109),p(e.caseBlock.clauses,n=>{s(t,n.getFirstToken(),84,90),p(r(n),n=>{o(e,n)&&s(t,n.getFirstToken(),83)})}),t}function u(e,t){const n=[];if(s(n,e.getFirstToken(),113),e.catchClause&&s(n,e.catchClause.getFirstToken(),85),e.finallyBlock){s(n,GX(e,98,t),98)}return n}function d(e,t){const r=function(e){let t=e;for(;t.parent;){const e=t.parent;if(Uf(e)||308===e.kind)return e;if(dE(e)&&e.tryBlock===t&&e.catchClause)return t;t=e}}(e);if(!r)return;const i=[];return p(n(r),e=>{i.push(GX(e,111,t))}),Uf(r)&&Af(r,e=>{i.push(GX(e,107,t))}),i}function f(e,t){const r=Yf(e);if(!r)return;const i=[];return Af(it(r.body,GF),e=>{i.push(GX(e,107,t))}),p(n(r.body),e=>{i.push(GX(e,111,t))}),i}function m(e){const t=Yf(e);if(!t)return;const n=[];return t.modifiers&&t.modifiers.forEach(e=>{s(n,e,134)}),iO(t,e=>{g(e,e=>{FF(e)&&s(n,e.getFirstToken(),135)})}),n}function g(e,t){t(e),s_(e)||m_(e)||yE(e)||xE(e)||vE(e)||T_(e)||iO(e,e=>g(e,t))}e.getDocumentHighlights=function(e,n,r,i,o){const a=sQ(r,i);if(a.parent&&(KE(a.parent)&&a.parent.tagName===a||GE(a.parent))){const{openingElement:e,closingElement:n}=a.parent.parent,i=[e,n].map(({tagName:e})=>t(e,r));return[{fileName:r.fileName,highlightSpans:i}]}return function(e,t,n,r,i){const o=new Set(i.map(e=>e.fileName)),a=jce.getReferenceEntriesForNode(e,t,n,i,r,void 0,o);if(!a)return;const s=ze(a.map(jce.toHighlightSpan),e=>e.fileName,e=>e.span),c=Ht(n.useCaseSensitiveFileNames());return je(z(s.entries(),([e,t])=>{if(!o.has(e)){if(!n.redirectTargetsMap.has(Ho(e,n.getCurrentDirectory(),c)))return;const t=n.getSourceFile(e);e=x(i,e=>!!e.redirectInfo&&e.redirectInfo.redirectTarget===t).fileName,pn.assert(o.has(e))}return{fileName:e,highlightSpans:t}}))}(i,a,e,n,o)||function(e,n){const r=function(e,n){switch(e.kind){case 101:case 93:return ZF(e.parent)?function(e,n){const r=function(e,t){const n=[];for(;ZF(e.parent)&&e.parent.elseStatement===e;)e=e.parent;for(;;){const r=e.getChildren(t);s(n,r[0],101);for(let e=r.length-1;e>=0&&!s(n,r[e],93);e--);if(!e.elseStatement||!ZF(e.elseStatement))break;e=e.elseStatement}return n}(e,n),i=[];for(let e=0;e=t.end;e--)if(!Ha(n.text.charCodeAt(e))){a=!1;break}if(a){i.push({fileName:n.fileName,textSpan:Xs(t.getStart(),o.end),kind:"reference"}),e++;continue}}i.push(t(r[e],n))}return i}(e.parent,n):void 0;case 107:return o(e.parent,sE,f);case 111:return o(e.parent,uE,d);case 113:case 85:case 98:return o(85===e.kind?e.parent.parent:e.parent,dE,u);case 109:return o(e.parent,lE,_);case 84:case 90:return oP(e.parent)||iP(e.parent)?o(e.parent.parent.parent,lE,_):void 0;case 83:case 88:return o(e.parent,Fl,l);case 99:case 117:case 92:return o(e.parent,e=>X_(e,!0),c);case 137:return i(jD,[137]);case 139:case 153:return i(g_,[139,153]);case 135:return o(e.parent,FF,m);case 134:return a(m(e));case 127:return a(function(e){const t=Yf(e);if(!t)return;const n=[];return iO(t,e=>{g(e,e=>{LF(e)&&s(n,e.getFirstToken(),127)})}),n}(e));case 103:case 147:return;default:return e_(e.kind)&&(fu(e.parent)||XF(e.parent))?a((r=e.kind,J(function(e,t){const n=e.parent;switch(n.kind){case 269:case 308:case 242:case 297:case 298:return 64&t&&hE(e)?[...e.members,e]:n.statements;case 177:case 175:case 263:return[...n.parameters,...m_(n.parent)?n.parent.members:[]];case 264:case 232:case 265:case 188:const r=n.members;if(15&t){const e=x(n.members,jD);if(e)return[...r,...e.parameters]}else if(64&t)return[...r,n];return r;default:return}}(e.parent,Yv(r)),e=>wY(e,r)))):void 0}var r;function i(t,r){return o(e.parent,t,e=>{var i;return J(null==(i=rt(e,_u))?void 0:i.symbol.declarations,e=>t(e)?x(e.getChildren(n),e=>C(r,e.kind)):void 0)})}function o(e,t,r){return t(e)?a(r(e,n)):void 0}function a(e){return e&&e.map(e=>t(e,n))}}(e,n);return r&&[{fileName:n.fileName,highlightSpans:r}]}(a,r)}})(L0||(L0={}));var c1=(e=>(e[e.exact=0]="exact",e[e.prefix=1]="prefix",e[e.substring=2]="substring",e[e.camelCase=3]="camelCase",e))(c1||{});function l1(e,t){return{kind:e,isCaseSensitive:t}}function _1(e){const t=new Map,n=e.trim().split(".").map(e=>{return{totalTextChunk:T1(t=e.trim()),subWordTextChunks:S1(t)};var t});return 1===n.length&&""===n[0].totalTextChunk.text?{getMatchForLastSegmentOfPattern:()=>l1(2,!0),getFullMatch:()=>l1(2,!0),patternContainsDots:!1}:n.some(e=>!e.subWordTextChunks.length)?void 0:{getFullMatch:(e,r)=>function(e,t,n,r){const i=p1(t,xe(n),r);if(!i)return;if(n.length-1>e.length)return;let o;for(let t=n.length-2,i=e.length-1;t>=0;t-=1,i-=1)o=f1(o,p1(e[i],n[t],r));return o}(e,r,n,t),getMatchForLastSegmentOfPattern:e=>p1(e,xe(n),t),patternContainsDots:n.length>1}}function u1(e,t){let n=t.get(e);return n||t.set(e,n=w1(e)),n}function d1(e,t,n){const r=function(e,t){const n=e.length-t.length;for(let r=0;r<=n;r++)if(I1(t,(t,n)=>b1(e.charCodeAt(n+r))===t))return r;return-1}(e,t.textLowerCase);if(0===r)return l1(t.text.length===e.length?0:1,Qt(e,t.text));if(t.isLowerCase){if(-1===r)return;const i=u1(e,n);for(const n of i)if(g1(e,n,t.text,!0))return l1(2,g1(e,n,t.text,!1));if(t.text.length0)return l1(2,!0);if(t.characterSpans.length>0){const r=u1(e,n),i=!!h1(e,r,t,!1)||!h1(e,r,t,!0)&&void 0;if(void 0!==i)return l1(3,i)}}}function p1(e,t,n){if(I1(t.totalTextChunk.text,e=>32!==e&&42!==e)){const r=d1(e,t.totalTextChunk,n);if(r)return r}const r=t.subWordTextChunks;let i;for(const t of r)i=f1(i,d1(e,t,n));return i}function f1(e,t){return Tt([e,t],m1)}function m1(e,t){return void 0===e?1:void 0===t?-1:xt(e.kind,t.kind)||jt(!e.isCaseSensitive,!t.isCaseSensitive)}function g1(e,t,n,r,i={start:0,length:n.length}){return i.length<=t.length&&A1(0,i.length,o=>function(e,t,n){return n?b1(e)===b1(t):e===t}(n.charCodeAt(i.start+o),e.charCodeAt(t.start+o),r))}function h1(e,t,n,r){const i=n.characterSpans;let o,a,s=0,c=0;for(;;){if(c===i.length)return!0;if(s===t.length)return!1;let l=t[s],_=!1;for(;c=65&&e<=90)return!0;if(e<127||!Ea(e,99))return!1;const t=String.fromCharCode(e);return t===t.toUpperCase()}function v1(e){if(e>=97&&e<=122)return!0;if(e<127||!Ea(e,99))return!1;const t=String.fromCharCode(e);return t===t.toLowerCase()}function b1(e){return e>=65&&e<=90?e-65+97:e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function x1(e){return e>=48&&e<=57}function k1(e){return y1(e)||v1(e)||x1(e)||95===e||36===e}function S1(e){const t=[];let n=0,r=0;for(let i=0;i0&&(t.push(T1(e.substr(n,r))),r=0)}return r>0&&t.push(T1(e.substr(n,r))),t}function T1(e){const t=e.toLowerCase();return{text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:C1(e)}}function C1(e){return N1(e,!1)}function w1(e){return N1(e,!0)}function N1(e,t){const n=[];let r=0;for(let i=1;iD1(e)&&95!==e,t,n)}function E1(e,t,n){return t!==n&&t+1t(e.charCodeAt(n),n))}function O1(e,t=!0,n=!1){const r={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0},i=[];let o,a,s,c=0,l=!1;function _(){return a=s,s=rX.scan(),19===s?c++:20===s&&c--,s}function u(){const e=rX.getTokenValue(),t=rX.getTokenStart();return{fileName:e,pos:t,end:t+e.length}}function p(){i.push(u()),f()}function f(){0===c&&(l=!0)}function m(){let e=rX.getToken();return 138===e&&(e=_(),144===e&&(e=_(),11===e&&(o||(o=[]),o.push({ref:u(),depth:c}))),!0)}function g(){if(25===a)return!1;let e=rX.getToken();if(102===e){if(e=_(),21===e){if(e=_(),11===e||15===e)return p(),!0}else{if(11===e)return p(),!0;if(156===e){rX.lookAhead(()=>{const e=rX.scan();return 161!==e&&(42===e||19===e||80===e||Fh(e))})&&(e=_())}if(80===e||Fh(e))if(e=_(),161===e){if(e=_(),11===e)return p(),!0}else if(64===e){if(y(!0))return!0}else{if(28!==e)return!0;e=_()}if(19===e){for(e=_();20!==e&&1!==e;)e=_();20===e&&(e=_(),161===e&&(e=_(),11===e&&p()))}else 42===e&&(e=_(),130===e&&(e=_(),(80===e||Fh(e))&&(e=_(),161===e&&(e=_(),11===e&&p()))))}return!0}return!1}function h(){let e=rX.getToken();if(95===e){if(f(),e=_(),156===e){rX.lookAhead(()=>{const e=rX.scan();return 42===e||19===e})&&(e=_())}if(19===e){for(e=_();20!==e&&1!==e;)e=_();20===e&&(e=_(),161===e&&(e=_(),11===e&&p()))}else if(42===e)e=_(),161===e&&(e=_(),11===e&&p());else if(102===e){if(e=_(),156===e){rX.lookAhead(()=>{const e=rX.scan();return 80===e||Fh(e)})&&(e=_())}if((80===e||Fh(e))&&(e=_(),64===e&&y(!0)))return!0}return!0}return!1}function y(e,t=!1){let n=e?_():rX.getToken();return 149===n&&(n=_(),21===n&&(n=_(),(11===n||t&&15===n)&&p()),!0)}function v(){let e=rX.getToken();if(80===e&&"define"===rX.getTokenValue()){if(e=_(),21!==e)return!0;if(e=_(),11===e||15===e){if(e=_(),28!==e)return!0;e=_()}if(23!==e)return!0;for(e=_();24!==e&&1!==e;)11!==e&&15!==e||p(),e=_();return!0}return!1}if(t&&function(){for(rX.setText(e),_();1!==rX.getToken();){if(16===rX.getToken()){const e=[rX.getToken()];e:for(;d(e);){const t=rX.scan();switch(t){case 1:break e;case 102:g();break;case 16:e.push(t);break;case 19:d(e)&&e.push(t);break;case 20:d(e)&&(16===be(e)?18===rX.reScanTemplateToken(!1)&&e.pop():e.pop())}}_()}m()||g()||h()||n&&(y(!1,!0)||v())||_()}rX.setText(void 0)}(),xO(r,e),kO(r,ot),l){if(o)for(const e of o)i.push(e.ref);return{referencedFiles:r.referencedFiles,typeReferenceDirectives:r.typeReferenceDirectives,libReferenceDirectives:r.libReferenceDirectives,importedFiles:i,isLibFile:!!r.hasNoDefaultLib,ambientExternalModules:void 0}}{let e;if(o)for(const t of o)0===t.depth?(e||(e=[]),e.push(t.ref.fileName)):i.push(t.ref);return{referencedFiles:r.referencedFiles,typeReferenceDirectives:r.typeReferenceDirectives,libReferenceDirectives:r.libReferenceDirectives,importedFiles:i,isLibFile:!!r.hasNoDefaultLib,ambientExternalModules:e}}}var L1=/^data:(?:application\/json;charset=[uU][tT][fF]-8;base64,([A-Za-z0-9+/=]+)$)?/;function j1(e){const t=Ht(e.useCaseSensitiveFileNames()),n=e.getCurrentDirectory(),r=new Map,i=new Map;return{tryGetSourcePosition:function e(t){if(!vO(t.fileName))return;if(!s(t.fileName))return;const n=a(t.fileName).getSourcePosition(t);return n&&n!==t?e(n)||n:void 0},tryGetGeneratedPosition:function(t){if(vO(t.fileName))return;const n=s(t.fileName);if(!n)return;const r=e.getProgram();if(r.isSourceOfProjectReferenceRedirect(n.fileName))return;const i=r.getCompilerOptions().outFile,o=i?KS(i)+".d.ts":Ky(t.fileName,r.getCompilerOptions(),r);if(void 0===o)return;const c=a(o,t.fileName).getGeneratedPosition(t);return c===t?void 0:c},toLineColumnOffset:function(e,t){return l(e).getLineAndCharacterOfPosition(t)},clearCache:function(){r.clear(),i.clear()},documentPositionMappers:i};function o(e){return Ho(e,n,t)}function a(n,r){const a=o(n),s=i.get(a);if(s)return s;let c;if(e.getDocumentPositionMapper)c=e.getDocumentPositionMapper(n,r);else if(e.readFile){const r=l(n);c=r&&M1({getSourceFileLike:l,getCanonicalFileName:t,log:t=>e.log(t)},n,MJ(r.text,za(r)),t=>!e.fileExists||e.fileExists(t)?e.readFile(t):void 0)}return i.set(a,c||ZJ),c||ZJ}function s(t){const n=e.getProgram();if(!n)return;const r=o(t),i=n.getSourceFileByPath(r);return i&&i.resolvedPath===r?i:void 0}function c(t){const n=o(t),i=r.get(n);if(void 0!==i)return i||void 0;if(!e.readFile||e.fileExists&&!e.fileExists(t))return void r.set(n,!1);const a=e.readFile(t),s=!!a&&function(e,t){return{text:e,lineMap:t,getLineAndCharacterOfPosition(e){return qa(za(this),e)}}}(a);return r.set(n,s),s||void 0}function l(t){return e.getSourceFileLike?e.getSourceFileLike(t):s(t)||c(t)}}function M1(e,t,n,r){let i=RJ(n);if(i){const n=L1.exec(i);if(n){if(n[1]){const r=n[1];return R1(e,Fb(uo,r),t)}i=void 0}}const o=[];i&&o.push(i),o.push(t+".map");const a=i&&Uo(i,Ao(t));for(const n of o){const i=Uo(n,Ao(t)),o=r(i,a);if(tt(o))return R1(e,o,i);if(void 0!==o)return o||void 0}}function R1(e,t,n){const r=JJ(t);if(r&&r.sources&&r.file&&r.mappings&&(!r.sourcesContent||!r.sourcesContent.some(tt)))return YJ(e,r,n)}var B1=new Map;function J1(e,t,n){var r;t.getSemanticDiagnostics(e,n);const i=[],o=t.getTypeChecker();var a;!(1===t.getImpliedNodeFormatForEmit(e)||No(e.fileName,[".cts",".cjs"]))&&e.commonJsModuleIndicator&&(cY(t)||lY(t.getCompilerOptions()))&&function(e){return e.statements.some(e=>{switch(e.kind){case 244:return e.declarationList.declarations.some(e=>!!e.initializer&&Bm(z1(e.initializer),!0));case 245:{const{expression:t}=e;if(!AF(t))return Bm(t,!0);const n=og(t);return 1===n||2===n}default:return!1}})}(e)&&i.push(qp(AF(a=e.commonJsModuleIndicator)?a.left:a,fa.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module));const s=Im(e);if(B1.clear(),function t(n){if(s)(function(e,t){var n,r,i,o;if(TF(e)){if(fE(e.parent)&&(null==(n=e.symbol.members)?void 0:n.size))return!0;const o=t.getSymbolOfExpando(e,!1);return!(!o||!(null==(r=o.exports)?void 0:r.size)&&!(null==(i=o.members)?void 0:i.size))}if(gE(e))return!!(null==(o=e.symbol.members)?void 0:o.size);return!1})(n,o)&&i.push(qp(fE(n.parent)?n.parent.name:n,fa.This_constructor_function_may_be_converted_to_a_class_declaration));else{if(XF(n)&&n.parent===e&&2&n.declarationList.flags&&1===n.declarationList.declarations.length){const e=n.declarationList.declarations[0].initializer;e&&Bm(e,!0)&&i.push(qp(e,fa.require_call_may_be_converted_to_an_import))}const t=U7.getJSDocTypedefNodes(n);for(const e of t)i.push(qp(e,fa.JSDoc_typedef_may_be_converted_to_TypeScript_type));U7.parameterShouldGetTypeFromJSDoc(n)&&i.push(qp(n.name||n,fa.JSDoc_types_may_be_moved_to_TypeScript_types))}X1(n)&&function(e,t,n){(function(e,t){return!Bh(e)&&e.body&&GF(e.body)&&function(e,t){return!!Af(e,e=>V1(e,t))}(e.body,t)&&U1(e,t)})(e,t)&&!B1.has(G1(e))&&n.push(qp(!e.name&&fE(e.parent)&&uD(e.parent.name)?e.parent.name:e,fa.This_may_be_converted_to_an_async_function))}(n,o,i);n.forEachChild(t)}(e),Fk(t.getCompilerOptions()))for(const n of e.imports){const o=Sg(n);if(CE(o)&&Av(o,32))continue;const a=q1(o);if(!a)continue;const s=null==(r=t.getResolvedModuleFromModuleSpecifier(n,e))?void 0:r.resolvedModule,c=s&&t.getSourceFile(s.resolvedFileName);c&&c.externalModuleIndicator&&!0!==c.externalModuleIndicator&&ME(c.externalModuleIndicator)&&c.externalModuleIndicator.isExportEquals&&i.push(qp(a,fa.Import_may_be_converted_to_a_default_import))}return le(i,e.bindSuggestionDiagnostics),le(i,t.getSuggestionDiagnostics(e,n)),i.sort((e,t)=>e.start-t.start),i}function z1(e){return hF(e)?z1(e.expression):e}function q1(e){switch(e.kind){case 273:const{importClause:t,moduleSpecifier:n}=e;return t&&!t.name&&t.namedBindings&&275===t.namedBindings.kind&&KN(n)?t.namedBindings.name:void 0;case 272:return e.name;default:return}}function U1(e,t){const n=t.getSignatureFromDeclaration(e),r=n?t.getReturnTypeOfSignature(n):void 0;return!!r&&!!t.getPromisedTypeOfPromise(r)}function V1(e,t){return sE(e)&&!!e.expression&&W1(e.expression,t)}function W1(e,t){if(!$1(e)||!H1(e)||!e.arguments.every(e=>K1(e,t)))return!1;let n=e.expression.expression;for(;$1(n)||hF(n);)if(vF(n)){if(!H1(n)||!n.arguments.every(e=>K1(e,t)))return!1;n=n.expression.expression}else n=n.expression;return!0}function $1(e){return vF(e)&&(bX(e,"then")||bX(e,"catch")||bX(e,"finally"))}function H1(e){const t=e.expression.name.text,n="then"===t?2:"catch"===t||"finally"===t?1:0;return!(e.arguments.length>n)&&(e.arguments.length106===e.kind||uD(e)&&"undefined"===e.text)))}function K1(e,t){switch(e.kind){case 263:case 219:if(1&Rh(e))return!1;case 220:B1.set(G1(e),!0);case 106:return!0;case 80:case 212:{const n=t.getSymbolAtLocation(e);return!!n&&(t.isUndefinedSymbol(n)||H(_x(n,t).declarations,e=>s_(e)||Ou(e)&&!!e.initializer&&s_(e.initializer)))}default:return!1}}function G1(e){return`${e.pos.toString()}:${e.end.toString()}`}function X1(e){switch(e.kind){case 263:case 175:case 219:case 220:return!0;default:return!1}}var Q1=new Set(["isolatedModules"]);function Y1(e,t){return i2(e,t,!1)}function Z1(e,t){return i2(e,t,!0)}var e2,t2,n2='/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number {}\ninterface Object {}\ninterface RegExp {}\ninterface String {}\ninterface Array { length: number; [n: number]: T; }\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}',r2="lib.d.ts";function i2(e,t,n){e2??(e2=cO(r2,n2,{languageVersion:99}));const r=[],i=t.compilerOptions?a2(t.compilerOptions,r):{},o={target:1,jsx:1};for(const e in o)Ee(o,e)&&void 0===i[e]&&(i[e]=o[e]);for(const e of KO)i.verbatimModuleSyntax&&Q1.has(e.name)||(i[e.name]=e.transpileOptionValue);i.suppressOutputPathCheck=!0,i.allowNonTsExtensions=!0,n?(i.declaration=!0,i.emitDeclarationOnly=!0,i.isolatedDeclarations=!0):(i.declaration=!1,i.declarationMap=!1);const a=jb(i),s={getSourceFile:e=>e===Vo(c)?l:e===Vo(r2)?e2:void 0,writeFile:(e,t)=>{wo(e,".map")?(pn.assertEqual(u,void 0,"Unexpected multiple source map outputs, file:",e),u=t):(pn.assertEqual(_,void 0,"Unexpected multiple outputs, file:",e),_=t)},getDefaultLibFileName:()=>r2,useCaseSensitiveFileNames:()=>!1,getCanonicalFileName:e=>e,getCurrentDirectory:()=>"",getNewLine:()=>a,fileExists:e=>e===c||!!n&&e===r2,readFile:()=>"",directoryExists:()=>!0,getDirectories:()=>[]},c=t.fileName||(t.compilerOptions&&t.compilerOptions.jsx?"module.tsx":"module.ts"),l=cO(c,e,{languageVersion:Sk(i),impliedNodeFormat:UV(Ho(c,"",s.getCanonicalFileName),void 0,s,i),setExternalModuleIndicator:yk(i),jsDocParsingMode:t.jsDocParsingMode??0});let _,u;t.moduleName&&(l.moduleName=t.moduleName),t.renamedDependencies&&(l.renamedDependencies=new Map(Object.entries(t.renamedDependencies)));const d=$V(n?[c,r2]:[c],i,s);t.reportDiagnostics&&(le(r,d.getSyntacticDiagnostics(l)),le(r,d.getOptionsDiagnostics()));return le(r,d.emit(void 0,void 0,void 0,n,t.transformers,n).diagnostics),void 0===_?pn.fail("Output generation failed"):{outputText:_,diagnostics:r,sourceMapText:u}}function o2(e,t,n,r,i){const o=Y1(e,{compilerOptions:t,fileName:n,reportDiagnostics:!!r,moduleName:i});return le(r,o.diagnostics),o.outputText}function a2(e,t){t2=t2||D(zO,e=>"object"==typeof e.type&&!sd(e.type,e=>"number"!=typeof e)),e=BQ(e);for(const n of t2){if(!Ee(e,n.name))continue;const r=e[n.name];tt(r)?e[n.name]=lL(n,r,t):sd(n.type,e=>e===r)||t.push(sL(n))}return e}var s2={};function c2(e,t,n,r,i,o,a){const s=_1(r);if(!s)return _;const c=[],l=1===e.length?e[0]:void 0;for(const r of e)n.throwIfCancellationRequested(),o&&r.isDeclarationFile||l2(r,!!a,l)||r.getNamedDeclarations().forEach((e,n)=>{_2(s,n,e,t,r.fileName,!!a,l,c)});return c.sort(g2),(void 0===i?c:c.slice(0,i)).map(h2)}function l2(e,t,n){return e!==n&&t&&(GZ(e.path)||e.hasNoDefaultLib)}function _2(e,t,n,r,i,o,a,s){const c=e.getMatchForLastSegmentOfPattern(t);if(c)for(const l of n)if(u2(l,r,o,a))if(e.patternContainsDots){const n=e.getFullMatch(m2(l),t);n&&s.push({name:t,fileName:i,matchKind:n.kind,isCaseSensitive:n.isCaseSensitive,declaration:l})}else s.push({name:t,fileName:i,matchKind:c.kind,isCaseSensitive:c.isCaseSensitive,declaration:l})}function u2(e,t,n,r){var i;switch(e.kind){case 274:case 277:case 272:const o=t.getSymbolAtLocation(e.name),a=t.getAliasedSymbol(o);return o.escapedName!==a.escapedName&&!(null==(i=a.declarations)?void 0:i.every(e=>l2(e.getSourceFile(),n,r)));default:return!0}}function d2(e,t){const n=Fc(e);return!!n&&(f2(n,t)||168===n.kind&&p2(n.expression,t))}function p2(e,t){return f2(e,t)||hF(e)&&(t.push(e.name.text),!0)&&p2(e.expression,t)}function f2(e,t){return Wh(e)&&(t.push($h(e)),!0)}function m2(e){const t=[],n=Fc(e);if(n&&168===n.kind&&!p2(n.expression,t))return _;t.shift();let r=AX(e);for(;r;){if(!d2(r,t))return _;r=AX(r)}return t.reverse(),t}function g2(e,t){return xt(e.matchKind,t.matchKind)||Ot(e.name,t.name)}function h2(e){const t=e.declaration,n=AX(t),r=n&&Fc(n);return{name:e.name,kind:IX(t),kindModifiers:PQ(t),matchKind:c1[e.matchKind],isCaseSensitive:e.isCaseSensitive,fileName:e.fileName,textSpan:WQ(t),containerName:r?r.text:"",containerKind:r?IX(n):""}}o(s2,{getNavigateToItems:()=>c2});var y2={};o(y2,{getNavigationBarItems:()=>D2,getNavigationTree:()=>F2});var v2,b2,x2,k2,S2=/\s+/g,T2=150,C2=[],w2=[],N2=[];function D2(e,t){v2=t,b2=e;try{return P(function(e){const t=[];function n(e){if(r(e)&&(t.push(e),e.children))for(const t of e.children)n(t)}return n(e),t;function r(e){if(e.children)return!0;switch(A2(e)){case 264:case 232:case 267:case 265:case 268:case 308:case 266:case 347:case 339:return!0;case 220:case 263:case 219:return t(e);default:return!1}function t(e){if(!e.node.body)return!1;switch(A2(e.parent)){case 269:case 308:case 175:case 177:return!0;default:return!1}}}}(O2(e)),r6)}finally{E2()}}function F2(e,t){v2=t,b2=e;try{return n6(O2(e))}finally{E2()}}function E2(){b2=void 0,v2=void 0,C2=[],x2=void 0,N2=[]}function P2(e){return p6(e.getText(b2))}function A2(e){return e.node.kind}function I2(e,t){e.children?e.children.push(t):e.children=[t]}function O2(e){pn.assert(!C2.length);const t={node:e,name:void 0,additionalNodes:void 0,parent:void 0,children:void 0,indent:0};x2=t;for(const t of e.statements)W2(t);return z2(),pn.assert(!x2&&!C2.length),t}function L2(e,t){I2(x2,j2(e,t))}function j2(e,t){return{node:e,name:t||(fu(e)||K_(e)?Fc(e):void 0),additionalNodes:void 0,parent:x2,children:void 0,indent:x2.indent+1}}function M2(e){k2||(k2=new Map),k2.set(e,!0)}function R2(e){for(let t=0;t0;t--){J2(e,n[t])}return[n.length-1,n[0]]}function J2(e,t){const n=j2(e,t);I2(x2,n),C2.push(x2),w2.push(k2),k2=void 0,x2=n}function z2(){x2.children&&($2(x2.children,x2),Y2(x2.children)),x2=C2.pop(),k2=w2.pop()}function q2(e,t,n){J2(e,n),W2(t),z2()}function U2(e){e.initializer&&function(e){switch(e.kind){case 220:case 219:case 232:return!0;default:return!1}}(e.initializer)?(J2(e),iO(e.initializer,W2),z2()):q2(e,e.initializer)}function V2(e){const t=Fc(e);if(void 0===t)return!1;if(ND(t)){const e=t.expression;return ub(e)||$N(e)||Jh(e)}return!!t}function W2(e){if(v2.throwIfCancellationRequested(),e&&!Ol(e))switch(e.kind){case 177:const t=e;q2(t,t.body);for(const e of t.parameters)rc(e,t)&&L2(e);break;case 175:case 178:case 179:case 174:V2(e)&&q2(e,e.body);break;case 173:V2(e)&&U2(e);break;case 172:V2(e)&&L2(e);break;case 274:const n=e;n.name&&L2(n.name);const{namedBindings:r}=n;if(r)if(275===r.kind)L2(r);else for(const e of r.elements)L2(e);break;case 305:q2(e,e.name);break;case 306:const{expression:i}=e;uD(i)?L2(e,i):L2(e);break;case 209:case 304:case 261:{const t=e;w_(t.name)?W2(t.name):U2(t);break}case 263:const o=e.name;o&&uD(o)&&M2(o.text),q2(e,e.body);break;case 220:case 219:q2(e,e.body);break;case 267:J2(e);for(const t of e.members)c6(t)||L2(t);z2();break;case 264:case 232:case 265:J2(e);for(const t of e.members)W2(t);z2();break;case 268:q2(e,s6(e).body);break;case 278:{const t=e.expression,n=gF(t)||vF(t)?t:CF(t)||TF(t)?t.body:void 0;n?(J2(e),W2(n),z2()):L2(e);break}case 282:case 272:case 182:case 180:case 181:case 266:L2(e);break;case 214:case 227:{const t=og(e);switch(t){case 1:case 2:return void q2(e,e.right);case 6:case 3:{const n=e,r=n.left,i=3===t?r.expression:r;let o,a=0;return uD(i.expression)?(M2(i.expression.text),o=i.expression):[a,o]=B2(n,i.expression),6===t?gF(n.right)&&n.right.properties.length>0&&(J2(n,o),iO(n.right,W2),z2()):TF(n.right)||CF(n.right)?q2(e,n.right,o):(J2(n,o),q2(e,n.right,r.name),z2()),void R2(a)}case 7:case 9:{const n=e,r=7===t?n.arguments[0]:n.arguments[0].expression,i=n.arguments[1],[o,a]=B2(e,r);return J2(e,a),J2(e,FI(bw.createIdentifier(i.text),i)),W2(e.arguments[2]),z2(),z2(),void R2(o)}case 5:{const t=e,n=t.left,r=n.expression;if(uD(r)&&"prototype"!==fg(n)&&k2&&k2.has(r.text))return void(TF(t.right)||CF(t.right)?q2(e,t.right,r):lg(n)&&(J2(t,r),q2(t.left,t.right,dg(n)),z2()));break}case 4:case 0:case 8:break;default:pn.assertNever(t)}}default:Au(e)&&p(e.jsDoc,e=>{p(e.tags,e=>{Ag(e)&&L2(e)})}),iO(e,W2)}}function $2(e,t){const n=new Map;F(e,(e,r)=>{const i=e.name||Fc(e.node),o=i&&P2(i);if(!o)return!0;const a=n.get(o);if(!a)return n.set(o,e),!0;if(a instanceof Array){for(const n of a)if(K2(n,e,r,t))return!1;return a.push(e),!0}{const i=a;return!K2(i,e,r,t)&&(n.set(o,[i,e]),!0)}})}var H2={5:!0,3:!0,7:!0,9:!0,0:!1,1:!1,2:!1,8:!1,6:!0,4:!1};function K2(e,t,n,r){return!!function(e,t,n,r){function i(e){return TF(e)||gE(e)||fE(e)}const o=AF(t.node)||vF(t.node)?og(t.node):0,a=AF(e.node)||vF(e.node)?og(e.node):0;if(H2[o]&&H2[a]||i(e.node)&&H2[o]||i(t.node)&&H2[a]||hE(e.node)&&G2(e.node)&&H2[o]||hE(t.node)&&H2[a]||hE(e.node)&&G2(e.node)&&i(t.node)||hE(t.node)&&i(e.node)&&G2(e.node)){let o=e.additionalNodes&&be(e.additionalNodes)||e.node;if(!hE(e.node)&&!hE(t.node)||i(e.node)||i(t.node)){const n=i(e.node)?e.node:i(t.node)?t.node:void 0;if(void 0!==n){const r=j2(FI(bw.createConstructorDeclaration(void 0,[],void 0),n));r.indent=e.indent+1,r.children=e.node===n?e.children:t.children,e.children=e.node===n?G([r],t.children||[t]):G(e.children||[{...e}],[r])}else(e.children||t.children)&&(e.children=G(e.children||[{...e}],t.children||[t]),e.children&&($2(e.children,e),Y2(e.children)));o=e.node=FI(bw.createClassDeclaration(void 0,e.name||bw.createIdentifier("__class__"),void 0,void 0,[]),e.node)}else e.children=G(e.children,t.children),e.children&&$2(e.children,e);const a=t.node;return r.children[n-1].node.end===o.end?FI(o,{pos:o.pos,end:a.end}):(e.additionalNodes||(e.additionalNodes=[]),e.additionalNodes.push(FI(bw.createClassDeclaration(void 0,e.name||bw.createIdentifier("__class__"),void 0,void 0,[]),t.node))),!0}return 0!==o}(e,t,n,r)||!!function(e,t,n){if(e.kind!==t.kind||e.parent!==t.parent&&(!X2(e,n)||!X2(t,n)))return!1;switch(e.kind){case 173:case 175:case 178:case 179:return Iv(e)===Iv(t);case 268:return Q2(e,t)&&a6(e)===a6(t);default:return!0}}(e.node,t.node,r)&&(function(e,t){e.additionalNodes=e.additionalNodes||[],e.additionalNodes.push(t.node),t.additionalNodes&&e.additionalNodes.push(...t.additionalNodes);e.children=G(e.children,t.children),e.children&&($2(e.children,e),Y2(e.children))}(e,t),!0)}function G2(e){return!!(16&e.flags)}function X2(e,t){if(void 0===e.parent)return!1;const n=kE(e.parent)?e.parent.parent:e.parent;return n===t.node||C(t.additionalNodes,n)}function Q2(e,t){return e.body&&t.body?e.body.kind===t.body.kind&&(268!==e.body.kind||Q2(e.body,t.body)):e.body===t.body}function Y2(e){e.sort(Z2)}function Z2(e,t){return Ot(e6(e.node),e6(t.node))||xt(A2(e),A2(t))}function e6(e){if(268===e.kind)return o6(e);const t=Fc(e);if(t&&o_(t)){const e=Vh(t);return e&&vc(e)}switch(e.kind){case 219:case 220:case 232:return u6(e);default:return}}function t6(e,t){if(268===e.kind)return p6(o6(e));if(t){const e=uD(t)?t.text:yF(t)?`[${P2(t.argumentExpression)}]`:P2(t);if(e.length>0)return p6(e)}switch(e.kind){case 308:const t=e;return uO(t)?`"${Cy(Io(KS(Vo(t.fileName))))}"`:"";case 278:return ME(e)&&e.isExportEquals?"export=":"default";case 220:case 263:case 219:case 264:case 232:return 2048&$v(e)?"default":u6(e);case 177:return"constructor";case 181:return"new()";case 180:return"()";case 182:return"[]";default:return""}}function n6(e){return{text:t6(e.node,e.name),kind:IX(e.node),kindModifiers:_6(e.node),spans:i6(e),nameSpan:e.name&&l6(e.name),childItems:P(e.children,n6)}}function r6(e){return{text:t6(e.node,e.name),kind:IX(e.node),kindModifiers:_6(e.node),spans:i6(e),childItems:P(e.children,function(e){return{text:t6(e.node,e.name),kind:IX(e.node),kindModifiers:PQ(e.node),spans:i6(e),childItems:N2,indent:0,bolded:!1,grayed:!1}})||N2,indent:e.indent,bolded:!1,grayed:!1}}function i6(e){const t=[l6(e.node)];if(e.additionalNodes)for(const n of e.additionalNodes)t.push(l6(n));return t}function o6(e){return dp(e)?ep(e.name):a6(e)}function a6(e){const t=[$h(e.name)];for(;e.body&&268===e.body.kind;)e=e.body,t.push($h(e.name));return t.join(".")}function s6(e){return e.body&&xE(e.body)?s6(e.body):e}function c6(e){return!e.name||168===e.name.kind}function l6(e){return 308===e.kind?KQ(e):WQ(e,b2)}function _6(e){return e.parent&&261===e.parent.kind&&(e=e.parent),PQ(e)}function u6(e){const{parent:t}=e;if(e.name&&ud(e.name)>0)return p6(jp(e.name));if(fE(t))return p6(jp(t.name));if(AF(t)&&64===t.operatorToken.kind)return P2(t.left).replace(S2,"");if(cP(t))return P2(t.name);if(2048&$v(e))return"default";if(m_(e))return"";if(vF(t)){let e=d6(t.expression);if(void 0!==e){if(e=p6(e),e.length>T2)return`${e} callback`;return`${e}(${p6(J(t.arguments,e=>Ju(e)||z_(e)?e.getText(b2):void 0).join(", "))}) callback`}}return""}function d6(e){if(uD(e))return e.text;if(hF(e)){const t=d6(e.expression),n=e.name.text;return void 0===t?n:`${t}.${n}`}}function p6(e){return(e=e.length>T2?e.substring(0,T2)+"...":e).replace(/\\?(?:\r?\n|[\r\u2028\u2029])/g,"")}var f6={};o(f6,{addExportsInOldFile:()=>H6,addImportsForMovedSymbols:()=>e3,addNewFileToTsconfig:()=>$6,addOrRemoveBracesToArrowFunction:()=>J3,addTargetFileImports:()=>D3,containsJsx:()=>p3,convertArrowFunctionOrFunctionExpression:()=>Q3,convertParamsToDestructuredObject:()=>s4,convertStringOrTemplateLiteral:()=>N4,convertToOptionalChainExpression:()=>q4,createNewFileName:()=>u3,doChangeNamedToNamespaceOrDefault:()=>E6,extractSymbol:()=>e8,generateGetAccessorAndSetAccessor:()=>v8,getApplicableRefactors:()=>h6,getEditsForRefactor:()=>y6,getExistingLocals:()=>T3,getIdentifierForNode:()=>N3,getNewStatementsAndRemoveFromOldFile:()=>W6,getStatementsToMove:()=>d3,getUsageInfo:()=>m3,inferFunctionReturnType:()=>S8,isInImport:()=>y3,isRefactorErrorInfo:()=>C3,refactorKindBeginsWith:()=>w3,registerRefactor:()=>g6});var m6=new Map;function g6(e,t){m6.set(e,t)}function h6(e,t){return je(M(m6.values(),n=>{var r;return e.cancellationToken&&e.cancellationToken.isCancellationRequested()||!(null==(r=n.kinds)?void 0:r.some(t=>w3(t,e.kind)))?void 0:n.getAvailableActions(e,t)}))}function y6(e,t,n,r){const i=m6.get(t);return i&&i.getEditsForAction(e,n,r)}var v6="Convert export",b6={name:"Convert default export to named export",description:Gx(fa.Convert_default_export_to_named_export),kind:"refactor.rewrite.export.named"},x6={name:"Convert named export to default export",description:Gx(fa.Convert_named_export_to_default_export),kind:"refactor.rewrite.export.default"};function k6(e,t=!0){const{file:n,program:r}=e,i=ZZ(e),o=lQ(n,i.start),a=o.parent&&32&$v(o.parent)&&t?o.parent:TY(o,n,i);if(!(a&&(dP(a.parent)||kE(a.parent)&&dp(a.parent.parent))))return{error:Gx(fa.Could_not_find_export_statement)};const s=r.getTypeChecker(),c=function(e,t){if(dP(e))return e.symbol;const n=e.parent.symbol;if(n.valueDeclaration&&yp(n.valueDeclaration))return t.getMergedSymbol(n);return n}(a.parent,s),l=$v(a)||(ME(a)&&!a.isExportEquals?2080:0),_=!!(2048&l);if(!(32&l)||!_&&c.exports.has("default"))return{error:Gx(fa.This_file_already_has_a_default_export)};const u=e=>uD(e)&&s.getSymbolAtLocation(e)?void 0:{error:Gx(fa.Can_only_convert_named_export)};switch(a.kind){case 263:case 264:case 265:case 267:case 266:case 268:{const e=a;if(!e.name)return;return u(e.name)||{exportNode:e,exportName:e.name,wasDefault:_,exportingModuleSymbol:c}}case 244:{const e=a;if(!(2&e.declarationList.flags)||1!==e.declarationList.declarations.length)return;const t=ye(e.declarationList.declarations);if(!t.initializer)return;return pn.assert(!_,"Can't have a default flag here"),u(t.name)||{exportNode:e,exportName:t.name,wasDefault:_,exportingModuleSymbol:c}}case 278:{const e=a;if(e.isExportEquals)return;return u(e.expression)||{exportNode:e,exportName:e.expression,wasDefault:_,exportingModuleSymbol:c}}default:return}}function S6(e,t){return bw.createImportSpecifier(!1,e===t?void 0:bw.createIdentifier(e),bw.createIdentifier(t))}function T6(e,t){return bw.createExportSpecifier(!1,e===t?void 0:bw.createIdentifier(e),bw.createIdentifier(t))}g6(v6,{kinds:[b6.kind,x6.kind],getAvailableActions:function(e){const t=k6(e,"invoked"===e.triggerReason);if(!t)return _;if(!C3(t)){const e=t.wasDefault?b6:x6;return[{name:v6,description:e.description,actions:[e]}]}return e.preferences.provideRefactorNotApplicableReason?[{name:v6,description:Gx(fa.Convert_default_export_to_named_export),actions:[{...b6,notApplicableReason:t.error},{...x6,notApplicableReason:t.error}]}]:_},getEditsForAction:function(e,t){pn.assert(t===b6.name||t===x6.name,"Unexpected action name");const n=k6(e);pn.assert(n&&!C3(n),"Expected applicable refactor info");const r=ide.ChangeTracker.with(e,t=>function(e,t,n,r,i){(function(e,{wasDefault:t,exportNode:n,exportName:r},i,o){if(t)if(ME(n)&&!n.isExportEquals){const t=n.expression,r=T6(t.text,t.text);i.replaceNode(e,n,bw.createExportDeclaration(void 0,!1,bw.createNamedExports([r])))}else i.delete(e,pn.checkDefined(wY(n,90),"Should find a default keyword in modifier list"));else{const t=pn.checkDefined(wY(n,95),"Should find an export keyword in modifier list");switch(n.kind){case 263:case 264:case 265:i.insertNodeAfter(e,t,bw.createToken(90));break;case 244:const a=ye(n.declarationList.declarations);if(!jce.Core.isSymbolReferencedInFile(r,o,e)&&!a.type){i.replaceNode(e,n,bw.createExportDefault(pn.checkDefined(a.initializer,"Initializer was previously known to be present")));break}case 267:case 266:case 268:i.deleteModifier(e,t),i.insertNodeAfter(e,n,bw.createExportDefault(bw.createIdentifier(r.text)));break;default:pn.fail(`Unexpected exportNode kind ${n.kind}`)}}})(e,n,r,t.getTypeChecker()),function(e,{wasDefault:t,exportName:n,exportingModuleSymbol:r},i,o){const a=e.getTypeChecker(),s=pn.checkDefined(a.getSymbolAtLocation(n),"Export name should resolve to a symbol");jce.Core.eachExportReference(e.getSourceFiles(),a,o,s,r,n.text,t,e=>{if(n===e)return;const r=e.getSourceFile();t?function(e,t,n,r){const{parent:i}=t;switch(i.kind){case 212:n.replaceNode(e,t,bw.createIdentifier(r));break;case 277:case 282:{const t=i;n.replaceNode(e,t,S6(r,t.name.text));break}case 274:{const o=i;pn.assert(o.name===t,"Import clause name should match provided ref");const a=S6(r,t.text),{namedBindings:s}=o;if(s)if(275===s.kind){n.deleteRange(e,{pos:t.getStart(e),end:s.getStart(e)});const i=KN(o.parent.moduleSpecifier)?gY(o.parent.moduleSpecifier,e):1,a=pY(void 0,[S6(r,t.text)],o.parent.moduleSpecifier,i);n.insertNodeAfter(e,o.parent,a)}else n.delete(e,t),n.insertNodeAtEndOfList(e,s.elements,a);else n.replaceNode(e,t,bw.createNamedImports([a]));break}case 206:const o=i;n.replaceNode(e,i,bw.createImportTypeNode(o.argument,o.attributes,bw.createIdentifier(r),o.typeArguments,o.isTypeOf));break;default:pn.failBadSyntaxKind(i)}}(r,e,i,n.text):function(e,t,n){const r=t.parent;switch(r.kind){case 212:n.replaceNode(e,t,bw.createIdentifier("default"));break;case 277:{const t=bw.createIdentifier(r.name.text);1===r.parent.elements.length?n.replaceNode(e,r.parent,t):(n.delete(e,r),n.insertNodeBefore(e,r.parent,t));break}case 282:n.replaceNode(e,r,T6("default",r.name.text));break;default:pn.assertNever(r,`Unexpected parent kind ${r.kind}`)}}(r,e,i)})}(t,n,r,i)}(e.file,e.program,n,t,e.cancellationToken));return{edits:r,renameFilename:void 0,renameLocation:void 0}}});var C6="Convert import",w6={0:{name:"Convert namespace import to named imports",description:Gx(fa.Convert_namespace_import_to_named_imports),kind:"refactor.rewrite.import.named"},2:{name:"Convert named imports to namespace import",description:Gx(fa.Convert_named_imports_to_namespace_import),kind:"refactor.rewrite.import.namespace"},1:{name:"Convert named imports to default import",description:Gx(fa.Convert_named_imports_to_default_import),kind:"refactor.rewrite.import.default"}};function N6(e,t=!0){const{file:n}=e,r=ZZ(e),i=lQ(n,r.start),o=t?mc(i,nn(wE,tA)):TY(i,n,r);if(void 0===o||!wE(o)&&!tA(o))return{error:"Selection is not an import declaration."};const a=r.start+r.length,s=pQ(o,o.parent,n);if(s&&a>s.getStart())return;const{importClause:c}=o;if(!c)return{error:Gx(fa.Could_not_find_import_clause)};if(!c.namedBindings)return{error:Gx(fa.Could_not_find_namespace_import_or_named_imports)};if(275===c.namedBindings.kind)return{convertTo:0,import:c.namedBindings};return D6(e.program,c)?{convertTo:1,import:c.namedBindings}:{convertTo:2,import:c.namedBindings}}function D6(e,t){return Fk(e.getCompilerOptions())&&function(e,t){const n=t.resolveExternalModuleName(e);if(!n)return!1;const r=t.resolveExternalModuleSymbol(n);return n!==r}(t.parent.moduleSpecifier,e.getTypeChecker())}function F6(e){return hF(e)?e.name:e.right}function E6(e,t,n,r,i=D6(t,r.parent)){const o=t.getTypeChecker(),a=r.parent.parent,{moduleSpecifier:s}=a,c=new Set;r.elements.forEach(e=>{const t=o.getSymbolAtLocation(e.name);t&&c.add(t)});const l=s&&KN(s)?a0(s.text,99):"module";const _=r.elements.some(function(t){return!!jce.Core.eachSymbolReferenceInFile(t.name,o,e,e=>{const t=o.resolveName(l,e,-1,!0);return!!t&&(!c.has(t)||JE(e.parent))})})?mZ(l,e):l,u=new Set;for(const t of r.elements){const r=t.propertyName||t.name;jce.Core.eachSymbolReferenceInFile(t.name,o,e,i=>{const o=11===r.kind?bw.createElementAccessExpression(bw.createIdentifier(_),bw.cloneNode(r)):bw.createPropertyAccessExpression(bw.createIdentifier(_),bw.cloneNode(r));lP(i.parent)?n.replaceNode(e,i.parent,bw.createPropertyAssignment(i.text,o)):JE(i.parent)?u.add(t):n.replaceNode(e,i,o)})}if(n.replaceNode(e,r,i?bw.createIdentifier(_):bw.createNamespaceImport(bw.createIdentifier(_))),u.size&&wE(a)){const t=je(u.values(),e=>bw.createImportSpecifier(e.isTypeOnly,e.propertyName&&bw.cloneNode(e.propertyName),bw.cloneNode(e.name)));n.insertNodeAfter(e,r.parent.parent,P6(a,void 0,t))}}function P6(e,t,n){return bw.createImportDeclaration(void 0,A6(t,n),e.moduleSpecifier,void 0)}function A6(e,t){return bw.createImportClause(void 0,e,t&&t.length?bw.createNamedImports(t):void 0)}g6(C6,{kinds:Oe(w6).map(e=>e.kind),getAvailableActions:function(e){const t=N6(e,"invoked"===e.triggerReason);if(!t)return _;if(!C3(t)){const e=w6[t.convertTo];return[{name:C6,description:e.description,actions:[e]}]}return e.preferences.provideRefactorNotApplicableReason?Oe(w6).map(e=>({name:C6,description:e.description,actions:[{...e,notApplicableReason:t.error}]})):_},getEditsForAction:function(e,t){pn.assert(H(Oe(w6),e=>e.name===t),"Unexpected action name");const n=N6(e);pn.assert(n&&!C3(n),"Expected applicable refactor info");const r=ide.ChangeTracker.with(e,t=>function(e,t,n,r){const i=t.getTypeChecker();0===r.convertTo?function(e,t,n,r,i){let o=!1;const a=[],s=new Map;jce.Core.eachSymbolReferenceInFile(r.name,t,e,e=>{if(M_(e.parent)){const r=F6(e.parent).text;t.resolveName(r,e,-1,!0)&&s.set(r,!0),pn.assert((hF(n=e.parent)?n.expression:n.left)===e,"Parent expression should match id"),a.push(e.parent)}else o=!0;var n});const c=new Map;for(const t of a){const r=F6(t).text;let i=c.get(r);void 0===i&&c.set(r,i=s.has(r)?mZ(r,e):r),n.replaceNode(e,t,bw.createIdentifier(i))}const l=[];c.forEach((e,t)=>{l.push(bw.createImportSpecifier(!1,e===t?void 0:bw.createIdentifier(t),bw.createIdentifier(e)))});const _=r.parent.parent;if(o&&!i&&wE(_))n.insertNodeAfter(e,_,P6(_,void 0,l));else{const t=o?bw.createIdentifier(r.name.text):void 0;n.replaceNode(e,r.parent,A6(t,l))}}(e,i,n,r.import,Fk(t.getCompilerOptions())):E6(e,t,n,r.import,1===r.convertTo)}(e.file,e.program,t,n));return{edits:r,renameFilename:void 0,renameLocation:void 0}}});var I6="Extract type",O6={name:"Extract to type alias",description:Gx(fa.Extract_to_type_alias),kind:"refactor.extract.type"},L6={name:"Extract to interface",description:Gx(fa.Extract_to_interface),kind:"refactor.extract.interface"},j6={name:"Extract to typedef",description:Gx(fa.Extract_to_typedef),kind:"refactor.extract.typedef"};function M6(e,t=!0){const{file:n,startPosition:r}=e,i=Im(n),o=GQ(ZZ(e)),a=o.pos===o.end&&t,s=function(e,t,n,r){const i=[()=>lQ(e,t),()=>cQ(e,t,()=>!0)];for(const t of i){const i=t(),o=qX(i,e,n.pos,n.end),a=mc(i,t=>t.parent&&T_(t)&&!B6(n,t.parent,e)&&(r||o));if(a)return a}return}(n,r,o,a);if(!s||!T_(s))return{info:{error:Gx(fa.Selection_is_not_a_valid_type_node)},affectedTextRange:void 0};const c=e.program.getTypeChecker(),l=function(e,t){return mc(e,hu)||(t?mc(e,DP):void 0)}(s,i);if(void 0===l)return{info:{error:Gx(fa.No_type_could_be_extracted_from_this_type_node)},affectedTextRange:void 0};const u=function(e,t){return mc(e,e=>e===t?"quit":!(!ZD(e.parent)&&!eF(e.parent)))??e}(s,l);if(!T_(u))return{info:{error:Gx(fa.Selection_is_not_a_valid_type_node)},affectedTextRange:void 0};const d=[];(ZD(u.parent)||eF(u.parent))&&o.end>s.end&&le(d,u.parent.types.filter(e=>qX(e,n,o.pos,o.end)));const p=d.length>1?d:u,{typeParameters:f,affectedTextRange:m}=function(e,t,n,r){const i=[],o=et(t),a={pos:o[0].getStart(r),end:o[o.length-1].end};for(const e of o)if(s(e))return{typeParameters:void 0,affectedTextRange:void 0};return{typeParameters:i,affectedTextRange:a};function s(t){if(UD(t)){if(uD(t.typeName)){const o=t.typeName,s=e.resolveName(o.text,o,262144,!0);for(const e of(null==s?void 0:s.declarations)||_)if(DD(e)&&e.getSourceFile()===r){if(e.name.escapedText===o.escapedText&&B6(e,a,r))return!0;if(B6(n,e,r)&&!B6(a,e,r)){_e(i,e);break}}}}else if(nF(t)){const e=mc(t,e=>tF(e)&&B6(e.extendsType,t,r));if(!e||!B6(a,e,r))return!0}else if(qD(t)||iF(t)){const e=mc(t.parent,s_);if(e&&e.type&&B6(e.type,t,r)&&!B6(a,e,r))return!0}else if($D(t))if(uD(t.exprName)){const i=e.resolveName(t.exprName.text,t.exprName,111551,!1);if((null==i?void 0:i.valueDeclaration)&&B6(n,i.valueDeclaration,r)&&!B6(a,i.valueDeclaration,r))return!0}else if(pv(t.exprName.left)&&!B6(a,t.parent,r))return!0;return r&&GD(t)&&Wa(r,t.pos).line===Wa(r,t.end).line&&ww(t,1),iO(t,s)}}(c,p,l,n);if(!f)return{info:{error:Gx(fa.No_type_could_be_extracted_from_this_type_node)},affectedTextRange:void 0};return{info:{isJS:i,selection:p,enclosingNode:l,typeParameters:f,typeElements:R6(c,p)},affectedTextRange:m}}function R6(e,t){if(t){if(Ze(t)){const n=[];for(const r of t){const t=R6(e,r);if(!t)return;le(n,t)}return n}if(eF(t)){const n=[],r=new Set;for(const i of t.types){const t=R6(e,i);if(!t||!t.every(e=>e.name&&Cx(r,aY(e.name))))return;le(n,t)}return n}return rF(t)?R6(e,t.type):HD(t)?t.members:void 0}}function B6(e,t,n){return JX(e,ts(n.text,t.pos),t.end)}function J6(e){return Ze(e.selection)?{firstTypeNode:e.selection[0],lastTypeNode:e.selection[e.selection.length-1],newTypeNode:ZD(e.selection[0].parent)?bw.createUnionTypeNode(e.selection):bw.createIntersectionTypeNode(e.selection)}:{firstTypeNode:e.selection,lastTypeNode:e.selection,newTypeNode:e.selection}}g6(I6,{kinds:[O6.kind,L6.kind,j6.kind],getAvailableActions:function(e){const{info:t,affectedTextRange:n}=M6(e,"invoked"===e.triggerReason);if(!t)return _;if(!C3(t)){return[{name:I6,description:Gx(fa.Extract_type),actions:t.isJS?[j6]:ae([O6],t.typeElements&&L6)}].map(t=>({...t,actions:t.actions.map(t=>({...t,range:n?{start:{line:Wa(e.file,n.pos).line,offset:Wa(e.file,n.pos).character},end:{line:Wa(e.file,n.end).line,offset:Wa(e.file,n.end).character}}:void 0}))}))}return e.preferences.provideRefactorNotApplicableReason?[{name:I6,description:Gx(fa.Extract_type),actions:[{...j6,notApplicableReason:t.error},{...O6,notApplicableReason:t.error},{...L6,notApplicableReason:t.error}]}]:_},getEditsForAction:function(e,t){const{file:n}=e,{info:r}=M6(e);pn.assert(r&&!C3(r),"Expected to find a range to extract");const i=mZ("NewType",n),o=ide.ChangeTracker.with(e,o=>{switch(t){case O6.name:return pn.assert(!r.isJS,"Invalid actionName/JS combo"),function(e,t,n,r){const{enclosingNode:i,typeParameters:o}=r,{firstTypeNode:a,lastTypeNode:s,newTypeNode:c}=J6(r),l=bw.createTypeAliasDeclaration(void 0,n,o.map(e=>bw.updateTypeParameterDeclaration(e,e.modifiers,e.name,e.constraint,void 0)),c);e.insertNodeBefore(t,i,eN(l),!0),e.replaceNodeRange(t,a,s,bw.createTypeReferenceNode(n,o.map(e=>bw.createTypeReferenceNode(e.name,void 0))),{leadingTriviaOption:ide.LeadingTriviaOption.Exclude,trailingTriviaOption:ide.TrailingTriviaOption.ExcludeWhitespace})}(o,n,i,r);case j6.name:return pn.assert(r.isJS,"Invalid actionName/JS combo"),function(e,t,n,r,i){var o;et(i.selection).forEach(e=>{ww(e,7168)});const{enclosingNode:a,typeParameters:s}=i,{firstTypeNode:c,lastTypeNode:l,newTypeNode:_}=J6(i),u=bw.createJSDocTypedefTag(bw.createIdentifier("typedef"),bw.createJSDocTypeExpression(_),bw.createIdentifier(r)),d=[];p(s,e=>{const t=ml(e),n=bw.createTypeParameterDeclaration(void 0,e.name),r=bw.createJSDocTemplateTag(bw.createIdentifier("template"),t&&it(t,fP),[n]);d.push(r)});const f=bw.createJSDocComment(void 0,bw.createNodeArray(G(d,[u])));if(DP(a)){const r=a.getStart(n),i=tZ(t.host,null==(o=t.formatContext)?void 0:o.options);e.insertNodeAt(n,a.getStart(n),f,{suffix:i+i+n.text.slice(pZ(n.text,r-1),r)})}else e.insertNodeBefore(n,a,f,!0);e.replaceNodeRange(n,c,l,bw.createTypeReferenceNode(r,s.map(e=>bw.createTypeReferenceNode(e.name,void 0))))}(o,e,n,i,r);case L6.name:return pn.assert(!r.isJS&&!!r.typeElements,"Invalid actionName/JS combo"),function(e,t,n,r){var i;const{enclosingNode:o,typeParameters:a,typeElements:s}=r,c=bw.createInterfaceDeclaration(void 0,n,a,void 0,s);FI(c,null==(i=s[0])?void 0:i.parent),e.insertNodeBefore(t,o,eN(c),!0);const{firstTypeNode:l,lastTypeNode:_}=J6(r);e.replaceNodeRange(t,l,_,bw.createTypeReferenceNode(n,a.map(e=>bw.createTypeReferenceNode(e.name,void 0))),{leadingTriviaOption:ide.LeadingTriviaOption.Exclude,trailingTriviaOption:ide.TrailingTriviaOption.ExcludeWhitespace})}(o,n,i,r);default:pn.fail("Unexpected action name")}}),a=n.fileName;return{edits:o,renameFilename:a,renameLocation:gZ(o,a,i,!1)}}});var z6="Move to file",q6=Gx(fa.Move_to_file),U6={name:"Move to file",description:q6,kind:"refactor.move.file"};function V6(e){return{edits:[],renameFilename:void 0,renameLocation:void 0,notApplicableReason:e}}function W6(e,t,n,r,i,o,a,s,c,l){const _=o.getTypeChecker(),u=_n(e.statements,hf),p=!h0(t.fileName,o,a,!!e.commonJsModuleIndicator),f=hY(e,s);e3(n.oldFileImportsFromTargetFile,t.fileName,l,o),function(e,t,n,r){for(const i of e.statements)C(t,i)||Y6(i,e=>{Z6(e,e=>{n.has(e.symbol)&&r.removeExistingImport(e)})})}(e,i.all,n.unusedImportsFromOldFile,l),l.writeFixes(r,f),function(e,t,n){for(const{first:r,afterLast:i}of t)n.deleteNodeRangeExcludingEnd(e,r,i)}(e,i.ranges,r),function(e,t,n,r,i,o,a){const s=t.getTypeChecker();for(const c of t.getSourceFiles())if(c!==r)for(const l of c.statements)Y6(l,_=>{if(s.getSymbolAtLocation(Q6(_))!==r.symbol)return;const u=e=>{const t=fF(e.parent)?SY(s,e.parent):_x(s.getSymbolAtLocation(e),s);return!!t&&i.has(t)};n3(c,_,e,u);const d=zo(Ao(Uo(r.fileName,t.getCurrentDirectory())),o);if(0===Dt(!t.useCaseSensitiveFileNames())(d,c.fileName))return;const p=pB.getModuleSpecifier(t.getCompilerOptions(),c,c.fileName,d,_Y(t,n)),f=s3(_,fY(p,a),u);f&&e.insertNodeAfter(c,l,f);const m=K6(_);m&&G6(e,c,s,i,p,m,_,a)})}(r,o,a,e,n.movedSymbols,t.fileName,f),H6(e,n.targetFileImportsFromOldFile,r,p),D3(e,n.oldImportsNeededByTargetFile,n.targetFileImportsFromOldFile,_,o,c),!Am(t)&&u.length&&r.insertStatementsInNewFile(t.fileName,u,e),c.writeFixes(r,f);const g=function(e,t,n,r){return L(t,t=>{if(r3(t)&&!t3(e,t,r)&&h3(t,e=>{var t;return n.includes(pn.checkDefined(null==(t=rt(e,_u))?void 0:t.symbol))})){const e=function(e,t){return t?[i3(e)]:function(e){return[e,...a3(e).map(o3)]}(e)}(UC(t),r);if(e)return e}return UC(t)})}(e,i.all,je(n.oldFileImportsFromTargetFile.keys()),p);Am(t)&&t.statements.length>0?function(e,t,n,r,i){var o;const a=new Set,s=null==(o=r.symbol)?void 0:o.exports;if(s){const n=t.getTypeChecker(),o=new Map;for(const e of i.all)r3(e)&&Av(e,32)&&h3(e,e=>{var t;const n=m(_u(e)?null==(t=s.get(e.symbol.escapedName))?void 0:t.declarations:void 0,e=>RE(e)?e:JE(e)?rt(e.parent.parent,RE):void 0);n&&n.moduleSpecifier&&o.set(n,(o.get(n)||new Set).add(e))});for(const[t,i]of je(o))if(t.exportClause&&BE(t.exportClause)&&d(t.exportClause.elements)){const o=t.exportClause.elements,s=D(o,e=>void 0===x(_x(e.symbol,n).declarations,e=>b3(e)&&i.has(e)));if(0===d(s)){e.deleteNode(r,t),a.add(t);continue}d(s)RE(e)&&!!e.moduleSpecifier&&!a.has(e));c?e.insertNodesBefore(r,c,n,!0):e.insertNodesAfter(r,r.statements[r.statements.length-1],n)}(r,o,g,t,i):Am(t)?r.insertNodesAtEndOfFile(t,g,!1):r.insertStatementsInNewFile(t.fileName,c.hasFixes()?[4,...g]:g,e)}function $6(e,t,n,r,i){const o=e.getCompilerOptions().configFile;if(!o)return;const a=Vo(Jo(n,"..",r)),s=la(o.fileName,a,i),c=o.statements[0]&&rt(o.statements[0].expression,gF),l=c&&x(c.properties,e=>cP(e)&&KN(e.name)&&"files"===e.name.text);l&&mF(l.initializer)&&t.insertNodeInListAfter(o,xe(l.initializer.elements),bw.createStringLiteral(s),l.initializer.elements)}function H6(e,t,n,r){const i=nY();t.forEach((t,o)=>{if(o.declarations)for(const t of o.declarations){if(!b3(t))continue;const o=c3(t);if(!o)continue;const a=l3(t);i(a)&&_3(e,a,o,n,r)}})}function K6(e){switch(e.kind){case 273:return e.importClause&&e.importClause.namedBindings&&275===e.importClause.namedBindings.kind?e.importClause.namedBindings.name:void 0;case 272:return e.name;case 261:return rt(e.name,uD);default:return pn.assertNever(e,`Unexpected node kind ${e.kind}`)}}function G6(e,t,n,r,i,o,a,s){const c=a0(i,99);let l=!1;const _=[];if(jce.Core.eachSymbolReferenceInFile(o,n,t,e=>{hF(e.parent)&&(l=l||!!n.resolveName(c,e,-1,!0),r.has(n.getSymbolAtLocation(e.parent.name))&&_.push(e))}),_.length){const n=l?mZ(c,t):c;for(const r of _)e.replaceNode(t,r,bw.createIdentifier(n));e.insertNodeAfter(t,a,function(e,t,n,r){const i=bw.createIdentifier(t),o=fY(n,r);switch(e.kind){case 273:return bw.createImportDeclaration(void 0,bw.createImportClause(void 0,void 0,bw.createNamespaceImport(i)),o,void 0);case 272:return bw.createImportEqualsDeclaration(void 0,!1,i,bw.createExternalModuleReference(o));case 261:return bw.createVariableDeclaration(i,void 0,void 0,X6(o));default:return pn.assertNever(e,`Unexpected node kind ${e.kind}`)}}(a,c,i,s))}}function X6(e){return bw.createCallExpression(bw.createIdentifier("require"),void 0,[e])}function Q6(e){return 273===e.kind?e.moduleSpecifier:272===e.kind?e.moduleReference.expression:e.initializer.arguments[0]}function Y6(e,t){if(wE(e))KN(e.moduleSpecifier)&&t(e);else if(CE(e))WE(e.moduleReference)&&Ju(e.moduleReference.expression)&&t(e);else if(XF(e))for(const n of e.declarationList.declarations)n.initializer&&Bm(n.initializer,!0)&&t(n)}function Z6(e,t){var n,r,i,o,a;if(273===e.kind){if((null==(n=e.importClause)?void 0:n.name)&&t(e.importClause),275===(null==(i=null==(r=e.importClause)?void 0:r.namedBindings)?void 0:i.kind)&&t(e.importClause.namedBindings),276===(null==(a=null==(o=e.importClause)?void 0:o.namedBindings)?void 0:a.kind))for(const n of e.importClause.namedBindings.elements)t(n)}else if(272===e.kind)t(e);else if(261===e.kind)if(80===e.name.kind)t(e);else if(207===e.name.kind)for(const n of e.name.elements)uD(n.name)&&t(n)}function e3(e,t,n,r){for(const[i,o]of e){const e=r0(i,Sk(r.getCompilerOptions())),a="default"===i.name&&i.parent?1:0;n.addImportForNonExistentExport(e,t,a,i.flags,o)}}function t3(e,t,n,r){var i;return n?!YF(t)&&Av(t,32)||!!(r&&e.symbol&&(null==(i=e.symbol.exports)?void 0:i.has(r.escapedText))):!!e.symbol&&!!e.symbol.exports&&a3(t).some(t=>e.symbol.exports.has(yc(t)))}function n3(e,t,n,r){if(273===t.kind&&t.importClause){const{name:i,namedBindings:o}=t.importClause;if((!i||r(i))&&(!o||276===o.kind&&0!==o.elements.length&&o.elements.every(e=>r(e.name))))return n.delete(e,t)}Z6(t,t=>{t.name&&uD(t.name)&&r(t.name)&&n.delete(e,t)})}function r3(e){return pn.assert(dP(e.parent),"Node parent should be a SourceFile"),k3(e)||XF(e)}function i3(e){const t=EI(e)?G([bw.createModifier(95)],Ac(e)):void 0;switch(e.kind){case 263:return bw.updateFunctionDeclaration(e,t,e.asteriskToken,e.name,e.typeParameters,e.parameters,e.type,e.body);case 264:const n=PI(e)?Pc(e):void 0;return bw.updateClassDeclaration(e,G(n,t),e.name,e.typeParameters,e.heritageClauses,e.members);case 244:return bw.updateVariableStatement(e,t,e.declarationList);case 268:return bw.updateModuleDeclaration(e,t,e.name,e.body);case 267:return bw.updateEnumDeclaration(e,t,e.name,e.members);case 266:return bw.updateTypeAliasDeclaration(e,t,e.name,e.typeParameters,e.type);case 265:return bw.updateInterfaceDeclaration(e,t,e.name,e.typeParameters,e.heritageClauses,e.members);case 272:return bw.updateImportEqualsDeclaration(e,t,e.isTypeOnly,e.name,e.moduleReference);case 245:return pn.fail();default:return pn.assertNever(e,`Unexpected declaration kind ${e.kind}`)}}function o3(e){return bw.createExpressionStatement(bw.createBinaryExpression(bw.createPropertyAccessExpression(bw.createIdentifier("exports"),bw.createIdentifier(e)),64,bw.createIdentifier(e)))}function a3(e){switch(e.kind){case 263:case 264:return[e.name.text];case 244:return J(e.declarationList.declarations,e=>uD(e.name)?e.name.text:void 0);case 268:case 267:case 266:case 265:case 272:return _;case 245:return pn.fail("Can't export an ExpressionStatement");default:return pn.assertNever(e,`Unexpected decl kind ${e.kind}`)}}function s3(e,t,n){switch(e.kind){case 273:{const r=e.importClause;if(!r)return;const i=r.name&&n(r.name)?r.name:void 0,o=r.namedBindings&&function(e,t){if(275===e.kind)return t(e.name)?e:void 0;{const n=e.elements.filter(e=>t(e.name));return n.length?bw.createNamedImports(n):void 0}}(r.namedBindings,n);return i||o?bw.createImportDeclaration(void 0,bw.createImportClause(r.phaseModifier,i,o),UC(t),void 0):void 0}case 272:return n(e.name)?e:void 0;case 261:{const r=function(e,t){switch(e.kind){case 80:return t(e)?e:void 0;case 208:return e;case 207:{const n=e.elements.filter(e=>e.propertyName||!uD(e.name)||t(e.name));return n.length?bw.createObjectBindingPattern(n):void 0}}}(e.name,n);return r?function(e,t,n,r=2){return bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(e,void 0,t,n)],r))}(r,e.type,X6(t),e.parent.flags):void 0}default:return pn.assertNever(e,`Unexpected import kind ${e.kind}`)}}function c3(e){return YF(e)?rt(e.expression.left.name,uD):rt(e.name,uD)}function l3(e){switch(e.kind){case 261:return e.parent.parent;case 209:return l3(it(e.parent.parent,e=>fE(e)||fF(e)));default:return e}}function _3(e,t,n,r,i){if(!t3(e,t,i,n))if(i)YF(t)||r.insertExportModifier(e,t);else{const n=a3(t);0!==n.length&&r.insertNodesAfter(e,t,n.map(o3))}}function u3(e,t,n,r){const i=t.getTypeChecker();if(r){const t=m3(e,r.all,i),s=Ao(e.fileName),c=iT(e.fileName),l=Jo(s,function(e,t,n,r){let i=e;for(let o=1;;o++){const a=Jo(n,i+t);if(!r.fileExists(a))return i;i=`${e}.${o}`}}((o=t.oldFileImportsFromTargetFile,a=t.movedSymbols,cd(o,vY)||cd(a,vY)||"newFile"),c,s,n))+c;return l}var o,a;return""}function d3(e){const t=function(e){const{file:t}=e,n=GQ(ZZ(e)),{statements:r}=t;let i=S(r,e=>e.end>n.pos);if(-1===i)return;const o=S3(t,r[i]);o&&(i=o.start);let a=S(r,e=>e.end>=n.end,i);-1!==a&&n.end<=r[a].getStart()&&a--;const s=S3(t,r[a]);return s&&(a=s.end),{toMove:r.slice(i,-1===a?r.length:a+1),afterLast:-1===a?void 0:r[a+1]}}(e);if(void 0===t)return;const n=[],r=[],{toMove:i,afterLast:o}=t;return K(i,f3,(e,t)=>{for(let r=e;r!!(2&e.transformFlags))}function f3(e){return!function(e){switch(e.kind){case 273:return!0;case 272:return!Av(e,32);case 244:return e.declarationList.declarations.every(e=>!!e.initializer&&Bm(e.initializer,!0));default:return!1}}(e)&&!hf(e)}function m3(e,t,n,r=new Set,i){var o;const a=new Set,s=new Map,c=new Map,l=function(e){if(void 0===e)return;const t=n.getJsxNamespace(e),r=n.resolveName(t,e,1920,!0);return r&&H(r.declarations,y3)?r:void 0}(p3(t));l&&s.set(l,[!1,rt(null==(o=l.declarations)?void 0:o[0],e=>jE(e)||NE(e)||IE(e)||CE(e)||fF(e)||fE(e))]);for(const e of t)h3(e,e=>{a.add(pn.checkDefined(YF(e)?n.getSymbolAtLocation(e.expression.left):e.symbol,"Need a symbol here"))});const _=new Set;for(const o of t)g3(o,n,i,(t,i)=>{if(!H(t.declarations))return;if(r.has(_x(t,n)))return void _.add(t);const o=x(t.declarations,y3);if(o){const e=s.get(t);s.set(t,[(void 0===e||e)&&i,rt(o,e=>jE(e)||NE(e)||IE(e)||CE(e)||fF(e)||fE(e))])}else!a.has(t)&&b(t.declarations,t=>{return b3(t)&&(fE(n=t)?n.parent.parent.parent:n.parent)===e;var n})&&c.set(t,i)});for(const e of s.keys())_.add(e);const u=new Map;for(const r of e.statements)C(t,r)||(l&&2&r.transformFlags&&_.delete(l),g3(r,n,i,(e,t)=>{a.has(e)&&u.set(e,t),_.delete(e)}));return{movedSymbols:a,targetFileImportsFromOldFile:c,oldFileImportsFromTargetFile:u,oldImportsNeededByTargetFile:s,unusedImportsFromOldFile:_}}function g3(e,t,n,r){e.forEachChild(function e(i){if(uD(i)&&!ph(i)){if(n&&!tx(n,i))return;const e=t.getSymbolAtLocation(i);e&&r(e,CT(i))}else i.forEachChild(e)})}function h3(e,t){switch(e.kind){case 263:case 264:case 268:case 267:case 266:case 265:case 272:return t(e);case 244:return m(e.declarationList.declarations,e=>x3(e.name,t));case 245:{const{expression:n}=e;return AF(n)&&1===og(n)?t(e):void 0}}}function y3(e){switch(e.kind){case 272:case 277:case 274:case 275:return!0;case 261:return v3(e);case 209:return fE(e.parent.parent)&&v3(e.parent.parent);default:return!1}}function v3(e){return dP(e.parent.parent.parent)&&!!e.initializer&&Bm(e.initializer,!0)}function b3(e){return k3(e)&&dP(e.parent)||fE(e)&&dP(e.parent.parent.parent)}function x3(e,t){switch(e.kind){case 80:return t(it(e.parent,e=>fE(e)||fF(e)));case 208:case 207:return m(e.elements,e=>RF(e)?void 0:x3(e.name,t));default:return pn.assertNever(e,`Unexpected name kind ${e.kind}`)}}function k3(e){switch(e.kind){case 263:case 264:case 268:case 267:case 266:case 265:case 272:return!0;default:return!1}}function S3(e,t){if(l_(t)){const n=t.symbol.declarations;if(void 0===n||d(n)<=1||!C(n,t))return;const r=n[0],i=n[d(n)-1],o=J(n,t=>Sd(t)===e&&hu(t)?t:void 0),a=S(e.statements,e=>e.end>=i.end);return{toMove:o,start:S(e.statements,e=>e.end>=r.end),end:a}}}function T3(e,t,n){const r=new Set;for(const t of e.imports){const e=Sg(t);if(wE(e)&&e.importClause&&e.importClause.namedBindings&&LE(e.importClause.namedBindings))for(const t of e.importClause.namedBindings.elements){const e=n.getSymbolAtLocation(t.propertyName||t.name);e&&r.add(_x(e,n))}if(Jm(e.parent)&&dF(e.parent.name))for(const t of e.parent.name.elements){const e=n.getSymbolAtLocation(t.propertyName||t.name);e&&r.add(_x(e,n))}}for(const i of t)g3(i,n,void 0,t=>{const i=_x(t,n);i.valueDeclaration&&Sd(i.valueDeclaration).path===e.path&&r.add(i)});return r}function C3(e){return void 0!==e.error}function w3(e,t){return!t||e.substr(0,t.length)===t}function N3(e,t,n,r){return!hF(e)||m_(t)||n.resolveName(e.name.text,e,111551,!1)||dD(e.name)||xc(e.name)?mZ(m_(t)?"newProperty":"newLocal",r):e.name.text}function D3(e,t,n,r,i,o){t.forEach(([e,t],n)=>{var i;const a=_x(n,r);r.isUnknownSymbol(a)?o.addVerbatimImport(pn.checkDefined(t??mc(null==(i=n.declarations)?void 0:i[0],Fp))):void 0===a.parent?(pn.assert(void 0!==t,"expected module symbol to have a declaration"),o.addImportForModuleSymbol(n,e,t)):o.addImportFromExportedSymbol(a,e,t)}),e3(n,e.fileName,o,i)}g6(z6,{kinds:[U6.kind],getAvailableActions:function(e,t){const n=e.file,r=d3(e);if(!t)return _;if("implicit"===e.triggerReason&&void 0!==e.endPosition){const t=mc(lQ(n,e.startPosition),y0),r=mc(lQ(n,e.endPosition),y0);if(t&&!dP(t)&&r&&!dP(r))return _}if(e.preferences.allowTextChangesInNewFiles&&r){const e={start:{line:Wa(n,r.all[0].getStart(n)).line,offset:Wa(n,r.all[0].getStart(n)).character},end:{line:Wa(n,xe(r.all).end).line,offset:Wa(n,xe(r.all).end).character}};return[{name:z6,description:q6,actions:[{...U6,range:e}]}]}return e.preferences.provideRefactorNotApplicableReason?[{name:z6,description:q6,actions:[{...U6,notApplicableReason:Gx(fa.Selection_is_not_a_valid_statement_or_statements)}]}]:_},getEditsForAction:function(e,t,n){pn.assert(t===z6,"Wrong refactor invoked");const r=pn.checkDefined(d3(e)),{host:i,program:o}=e;pn.assert(n,"No interactive refactor arguments available");const a=n.targetFile;if(BS(a)||JS(a)){if(i.fileExists(a)&&void 0===o.getSourceFile(a))return V6(Gx(fa.Cannot_move_statements_to_the_selected_file));const t=ide.ChangeTracker.with(e,t=>function(e,t,n,r,i,o,a,s){const c=r.getTypeChecker(),l=!a.fileExists(n),_=l?v0(n,t.externalModuleIndicator?99:t.commonJsModuleIndicator?1:void 0,r,a):pn.checkDefined(r.getSourceFile(n)),u=U7.createImportAdder(t,e.program,e.preferences,e.host),d=U7.createImportAdder(_,e.program,e.preferences,e.host);W6(t,_,m3(t,i.all,c,l?void 0:T3(_,i.all,c)),o,i,r,a,s,d,u),l&&$6(r,o,t.fileName,n,zy(a))}(e,e.file,n.targetFile,e.program,r,t,e.host,e.preferences));return{edits:t,renameFilename:void 0,renameLocation:void 0}}return V6(Gx(fa.Cannot_move_to_file_selected_file_is_invalid))}});var F3="Inline variable",E3=Gx(fa.Inline_variable),P3={name:F3,description:E3,kind:"refactor.inline.variable"};function A3(e,t,n,r){var i,o;const a=r.getTypeChecker(),s=sQ(e,t),c=s.parent;if(uD(s)){if(ox(c)&&Mf(c)&&uD(c.name)){if(1!==(null==(i=a.getMergedSymbol(c.symbol).declarations)?void 0:i.length))return{error:Gx(fa.Variables_with_multiple_declarations_cannot_be_inlined)};if(I3(c))return;const t=O3(c,a,e);return t&&{references:t,declaration:c,replacement:c.initializer}}if(n){let t=a.resolveName(s.text,s,111551,!1);if(t=t&&a.getMergedSymbol(t),1!==(null==(o=null==t?void 0:t.declarations)?void 0:o.length))return{error:Gx(fa.Variables_with_multiple_declarations_cannot_be_inlined)};const n=t.declarations[0];if(!ox(n)||!Mf(n)||!uD(n.name))return;if(I3(n))return;const r=O3(n,a,e);return r&&{references:r,declaration:n,replacement:n.initializer}}return{error:Gx(fa.Could_not_find_variable_to_inline)}}}function I3(e){return H(it(e.parent.parent,XF).modifiers,pD)}function O3(e,t,n){const r=[],i=jce.Core.eachSymbolReferenceInFile(e.name,t,n,t=>!(!jce.isWriteAccessForReference(t)||lP(t.parent))||(!(!JE(t.parent)&&!ME(t.parent))||(!!$D(t.parent)||(!!js(e,t.pos)||void r.push(t)))));return 0===r.length||i?void 0:r}function L3(e,t){t=UC(t);const{parent:n}=e;return K_(n)&&(cy(t){for(const t of a){const r=KN(c)&&uD(t)&&sh(t.parent);r&&HF(r)&&!xF(r.parent.parent)?j3(e,n,r,c):e.replaceNode(n,t,L3(t,c))}e.delete(n,s)})}}});var M3="Move to a new file",R3=Gx(fa.Move_to_a_new_file),B3={name:M3,description:R3,kind:"refactor.move.newFile"};g6(M3,{kinds:[B3.kind],getAvailableActions:function(e){const t=d3(e),n=e.file;if("implicit"===e.triggerReason&&void 0!==e.endPosition){const t=mc(lQ(n,e.startPosition),y0),r=mc(lQ(n,e.endPosition),y0);if(t&&!dP(t)&&r&&!dP(r))return _}if(e.preferences.allowTextChangesInNewFiles&&t){const n=e.file,r={start:{line:Wa(n,t.all[0].getStart(n)).line,offset:Wa(n,t.all[0].getStart(n)).character},end:{line:Wa(n,xe(t.all).end).line,offset:Wa(n,xe(t.all).end).character}};return[{name:M3,description:R3,actions:[{...B3,range:r}]}]}return e.preferences.provideRefactorNotApplicableReason?[{name:M3,description:R3,actions:[{...B3,notApplicableReason:Gx(fa.Selection_is_not_a_valid_statement_or_statements)}]}]:_},getEditsForAction:function(e,t){pn.assert(t===M3,"Wrong refactor invoked");const n=pn.checkDefined(d3(e)),r=ide.ChangeTracker.with(e,t=>function(e,t,n,r,i,o,a){const s=t.getTypeChecker(),c=m3(e,n.all,s),l=u3(e,t,i,n),_=v0(l,e.externalModuleIndicator?99:e.commonJsModuleIndicator?1:void 0,t,i),u=U7.createImportAdder(e,o.program,o.preferences,o.host),d=U7.createImportAdder(_,o.program,o.preferences,o.host);W6(e,_,c,r,n,t,i,a,d,u),$6(t,r,e.fileName,l,zy(i))}(e.file,e.program,n,t,e.host,e,e.preferences));return{edits:r,renameFilename:void 0,renameLocation:void 0}}});var J3={},z3="Convert overload list to single signature",q3=Gx(fa.Convert_overload_list_to_single_signature),U3={name:z3,description:q3,kind:"refactor.rewrite.function.overloadList"};function V3(e){switch(e.kind){case 174:case 175:case 180:case 177:case 181:case 263:return!0}return!1}function W3(e,t,n){const r=mc(lQ(e,t),V3);if(!r)return;if(l_(r)&&r.body&&RX(r.body,t))return;const i=n.getTypeChecker(),o=r.symbol;if(!o)return;const a=o.declarations;if(d(a)<=1)return;if(!b(a,t=>Sd(t)===e))return;if(!V3(a[0]))return;const s=a[0].kind;if(!b(a,e=>e.kind===s))return;const c=a;if(H(c,e=>!!e.typeParameters||H(e.parameters,e=>!!e.modifiers||!uD(e.name))))return;const l=J(c,e=>i.getSignatureFromDeclaration(e));if(d(l)!==d(a))return;const _=i.getReturnTypeOfSignature(l[0]);return b(l,e=>i.getReturnTypeOfSignature(e)===_)?c:void 0}g6(z3,{kinds:[U3.kind],getEditsForAction:function(e){const{file:t,startPosition:n,program:r}=e,i=W3(t,n,r);if(!i)return;const o=r.getTypeChecker(),a=i[i.length-1];let s=a;switch(a.kind){case 174:s=bw.updateMethodSignature(a,a.modifiers,a.name,a.questionToken,a.typeParameters,c(i),a.type);break;case 175:s=bw.updateMethodDeclaration(a,a.modifiers,a.asteriskToken,a.name,a.questionToken,a.typeParameters,c(i),a.type,a.body);break;case 180:s=bw.updateCallSignature(a,a.typeParameters,c(i),a.type);break;case 177:s=bw.updateConstructorDeclaration(a,a.modifiers,c(i),a.body);break;case 181:s=bw.updateConstructSignature(a,a.typeParameters,c(i),a.type);break;case 263:s=bw.updateFunctionDeclaration(a,a.modifiers,a.asteriskToken,a.name,a.typeParameters,c(i),a.type,a.body);break;default:return pn.failBadSyntaxKind(a,"Unhandled signature kind in overload list conversion refactoring")}if(s===a)return;return{renameFilename:void 0,renameLocation:void 0,edits:ide.ChangeTracker.with(e,e=>{e.replaceNodeRange(t,i[0],i[i.length-1],s)})};function c(e){const t=e[e.length-1];return l_(t)&&t.body&&(e=e.slice(0,e.length-1)),bw.createNodeArray([bw.createParameterDeclaration(void 0,bw.createToken(26),"args",void 0,bw.createUnionTypeNode(P(e,l)))])}function l(e){const t=P(e.parameters,_);return ww(bw.createTupleTypeNode(t),H(t,e=>!!d(Rw(e)))?0:1)}function _(e){pn.assert(uD(e.name));const t=FI(bw.createNamedTupleMember(e.dotDotDotToken,e.name,e.questionToken,e.type||bw.createKeywordTypeNode(133)),e),n=e.symbol&&e.symbol.getDocumentationComment(o);if(n){const e=n7(n);e.length&&Bw(t,[{text:`*\n${e.split("\n").map(e=>` * ${e}`).join("\n")}\n `,kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}])}return t}},getAvailableActions:function(e){const{file:t,startPosition:n,program:r}=e;return W3(t,n,r)?[{name:z3,description:q3,actions:[U3]}]:_}});var $3="Add or remove braces in an arrow function",H3=Gx(fa.Add_or_remove_braces_in_an_arrow_function),K3={name:"Add braces to arrow function",description:Gx(fa.Add_braces_to_arrow_function),kind:"refactor.rewrite.arrow.braces.add"},G3={name:"Remove braces from arrow function",description:Gx(fa.Remove_braces_from_arrow_function),kind:"refactor.rewrite.arrow.braces.remove"};function X3(e,t,n=!0,r){const i=lQ(e,t),o=Yf(i);if(!o)return{error:Gx(fa.Could_not_find_a_containing_arrow_function)};if(!CF(o))return{error:Gx(fa.Containing_function_is_not_an_arrow_function)};if(tx(o,i)&&(!tx(o.body,i)||n)){if(w3(K3.kind,r)&&K_(o.body))return{func:o,addBraces:!0,expression:o.body};if(w3(G3.kind,r)&&GF(o.body)&&1===o.body.statements.length){const e=ye(o.body.statements);if(sE(e)){return{func:o,addBraces:!1,expression:e.expression&&gF(Ix(e.expression,!1))?bw.createParenthesizedExpression(e.expression):e.expression,returnStatement:e}}}}}g6($3,{kinds:[G3.kind],getEditsForAction:function(e,t){const{file:n,startPosition:r}=e,i=X3(n,r);pn.assert(i&&!C3(i),"Expected applicable refactor info");const{expression:o,returnStatement:a,func:s}=i;let c;if(t===K3.name){const e=bw.createReturnStatement(o);c=bw.createBlock([e],!0),hZ(o,e,n,3,!0)}else if(t===G3.name&&a){const e=o||bw.createVoidZero();c=kZ(e)?bw.createParenthesizedExpression(e):e,vZ(a,c,n,3,!1),hZ(a,c,n,3,!1),yZ(a,c,n,3,!1)}else pn.fail("invalid action");return{renameFilename:void 0,renameLocation:void 0,edits:ide.ChangeTracker.with(e,e=>{e.replaceNode(n,s.body,c)})}},getAvailableActions:function(e){const{file:t,startPosition:n,triggerReason:r}=e,i=X3(t,n,"invoked"===r);if(!i)return _;if(!C3(i))return[{name:$3,description:H3,actions:[i.addBraces?K3:G3]}];if(e.preferences.provideRefactorNotApplicableReason)return[{name:$3,description:H3,actions:[{...K3,notApplicableReason:i.error},{...G3,notApplicableReason:i.error}]}];return _}});var Q3={},Y3="Convert arrow function or function expression",Z3=Gx(fa.Convert_arrow_function_or_function_expression),e4={name:"Convert to anonymous function",description:Gx(fa.Convert_to_anonymous_function),kind:"refactor.rewrite.function.anonymous"},t4={name:"Convert to named function",description:Gx(fa.Convert_to_named_function),kind:"refactor.rewrite.function.named"},n4={name:"Convert to arrow function",description:Gx(fa.Convert_to_arrow_function),kind:"refactor.rewrite.function.arrow"};function r4(e){let t=!1;return e.forEachChild(function e(n){OX(n)?t=!0:m_(n)||gE(n)||TF(n)||iO(n,e)}),t}function i4(e,t,n){const r=lQ(e,t),i=n.getTypeChecker(),o=function(e,t,n){if(!function(e){return fE(e)||mE(e)&&1===e.declarations.length}(n))return;const r=(fE(n)?n:ye(n.declarations)).initializer;if(r&&(CF(r)||TF(r)&&!a4(e,t,r)))return r;return}(e,i,r.parent);if(o&&!r4(o.body)&&!i.containsArgumentsReference(o))return{selectedVariableDeclaration:!0,func:o};const a=Yf(r);if(a&&(TF(a)||CF(a))&&!tx(a.body,r)&&!r4(a.body)&&!i.containsArgumentsReference(a)){if(TF(a)&&a4(e,i,a))return;return{selectedVariableDeclaration:!1,func:a}}}function o4(e){if(K_(e)){const t=bw.createReturnStatement(e),n=e.getSourceFile();return FI(t,e),KC(t),vZ(e,t,n,void 0,!0),bw.createBlock([t],!0)}return e}function a4(e,t,n){return!!n.name&&jce.Core.isSymbolReferencedInFile(n.name,t,e)}g6(Y3,{kinds:[e4.kind,t4.kind,n4.kind],getEditsForAction:function(e,t){const{file:n,startPosition:r,program:i}=e,o=i4(n,r,i);if(!o)return;const{func:a}=o,s=[];switch(t){case e4.name:s.push(...function(e,t){const{file:n}=e,r=o4(t.body),i=bw.createFunctionExpression(t.modifiers,t.asteriskToken,void 0,t.typeParameters,t.parameters,t.type,r);return ide.ChangeTracker.with(e,e=>e.replaceNode(n,t,i))}(e,a));break;case t4.name:const t=function(e){const t=e.parent;if(!fE(t)||!Mf(t))return;const n=t.parent,r=n.parent;return mE(n)&&XF(r)&&uD(t.name)?{variableDeclaration:t,variableDeclarationList:n,statement:r,name:t.name}:void 0}(a);if(!t)return;s.push(...function(e,t,n){const{file:r}=e,i=o4(t.body),{variableDeclaration:o,variableDeclarationList:a,statement:s,name:c}=n;GC(s);const l=32&cc(o)|Vv(t),_=bw.createModifiersFromModifierFlags(l),u=bw.createFunctionDeclaration(d(_)?_:void 0,t.asteriskToken,c,t.typeParameters,t.parameters,t.type,i);return 1===a.declarations.length?ide.ChangeTracker.with(e,e=>e.replaceNode(r,s,u)):ide.ChangeTracker.with(e,e=>{e.delete(r,o),e.insertNodeAfter(r,s,u)})}(e,a,t));break;case n4.name:if(!TF(a))return;s.push(...function(e,t){const{file:n}=e,r=t.body.statements,i=r[0];let o;!function(e,t){return 1===e.statements.length&&sE(t)&&!!t.expression}(t.body,i)?o=t.body:(o=i.expression,KC(o),fZ(i,o));const a=bw.createArrowFunction(t.modifiers,t.typeParameters,t.parameters,t.type,bw.createToken(39),o);return ide.ChangeTracker.with(e,e=>e.replaceNode(n,t,a))}(e,a));break;default:return pn.fail("invalid action")}return{renameFilename:void 0,renameLocation:void 0,edits:s}},getAvailableActions:function(e){const{file:t,startPosition:n,program:r,kind:i}=e,o=i4(t,n,r);if(!o)return _;const{selectedVariableDeclaration:a,func:s}=o,c=[],l=[];if(w3(t4.kind,i)){const e=a||CF(s)&&fE(s.parent)?void 0:Gx(fa.Could_not_convert_to_named_function);e?l.push({...t4,notApplicableReason:e}):c.push(t4)}if(w3(e4.kind,i)){const e=!a&&CF(s)?void 0:Gx(fa.Could_not_convert_to_anonymous_function);e?l.push({...e4,notApplicableReason:e}):c.push(e4)}if(w3(n4.kind,i)){const e=TF(s)?void 0:Gx(fa.Could_not_convert_to_arrow_function);e?l.push({...n4,notApplicableReason:e}):c.push(n4)}return[{name:Y3,description:Z3,actions:0===c.length&&e.preferences.provideRefactorNotApplicableReason?l:c}]}});var s4={},c4="Convert parameters to destructured object",l4=Gx(fa.Convert_parameters_to_destructured_object),_4={name:c4,description:l4,kind:"refactor.rewrite.parameters.toDestructured"};function u4(e,t){const n=g7(e);if(n){const e=t.getContextualTypeForObjectLiteralElement(n),r=null==e?void 0:e.getSymbol();if(r&&!(6&cx(r)))return r}}function d4(e){const t=e.node;return jE(t.parent)||NE(t.parent)||CE(t.parent)||IE(t.parent)||JE(t.parent)||ME(t.parent)?t:void 0}function p4(e){if(fu(e.node.parent))return e.node}function f4(e){if(e.node.parent){const t=e.node,n=t.parent;switch(n.kind){case 214:case 215:const e=rt(n,J_);if(e&&e.expression===t)return e;break;case 212:const r=rt(n,hF);if(r&&r.parent&&r.name===t){const e=rt(r.parent,J_);if(e&&e.expression===r)return e}break;case 213:const i=rt(n,yF);if(i&&i.parent&&i.argumentExpression===t){const e=rt(i.parent,J_);if(e&&e.expression===i)return e}}}}function m4(e){if(e.node.parent){const t=e.node,n=t.parent;switch(n.kind){case 212:const e=rt(n,hF);if(e&&e.expression===t)return e;break;case 213:const r=rt(n,yF);if(r&&r.expression===t)return r}}}function g4(e){const t=e.node;if(2===aX(t)||_b(t.parent))return t}function h4(e,t,n){const r=cQ(e,t),i=Zf(r);if(!function(e){const t=mc(e,Nu);if(t){const e=mc(t,e=>!Nu(e));return!!e&&l_(e)}return!1}(r))return!(i&&function(e,t){var n;if(!function(e,t){return function(e){if(k4(e))return e.length-1;return e.length}(e)>=1&&b(e,e=>function(e,t){if(Uu(e)){const n=t.getTypeAtLocation(e);if(!t.isArrayType(n)&&!t.isTupleType(n))return!1}return!e.modifiers&&uD(e.name)}(e,t))}(e.parameters,t))return!1;switch(e.kind){case 263:return b4(e)&&v4(e,t);case 175:if(gF(e.parent)){const r=u4(e.name,t);return 1===(null==(n=null==r?void 0:r.declarations)?void 0:n.length)&&v4(e,t)}return v4(e,t);case 177:return hE(e.parent)?b4(e.parent)&&v4(e,t):x4(e.parent.parent)&&v4(e,t);case 219:case 220:return x4(e.parent)}return!1}(i,n)&&tx(i,r))||i.body&&tx(i.body,r)?void 0:i}function y4(e){return ID(e)&&(yE(e.parent)||HD(e.parent))}function v4(e,t){return!!e.body&&!t.isImplementationOfOverload(e)}function b4(e){if(!e.name){return!!wY(e,90)}return!0}function x4(e){return fE(e)&&_f(e)&&uD(e.name)&&!e.type}function k4(e){return e.length>0&&OX(e[0].name)}function S4(e){return k4(e)&&(e=bw.createNodeArray(e.slice(1),e.hasTrailingComma)),e}function T4(e,t){const n=S4(e.parameters),r=Uu(xe(n)),i=P(r?t.slice(0,n.length-1):t,(e,t)=>{const r=w4(n[t]),i=(o=r,uD(a=e)&&$h(a)===o?bw.createShorthandPropertyAssignment(o):bw.createPropertyAssignment(o,a));var o,a;return KC(i.name),cP(i)&&KC(i.initializer),fZ(e,i),i});if(r&&t.length>=n.length){const e=t.slice(n.length-1),r=bw.createPropertyAssignment(w4(xe(n)),bw.createArrayLiteralExpression(e));i.push(r)}return bw.createObjectLiteralExpression(i,!1)}function C4(e,t,n){const r=t.getTypeChecker(),i=S4(e.parameters),o=P(i,function(e){const t=bw.createBindingElement(void 0,void 0,w4(e),Uu(e)&&u(e)?bw.createArrayLiteralExpression():e.initializer);KC(t),e.initializer&&t.initializer&&fZ(e.initializer,t.initializer);return t}),a=bw.createObjectBindingPattern(o),s=function(e){const t=P(e,_);return Nw(bw.createTypeLiteralNode(t),1)}(i);let c;b(i,u)&&(c=bw.createObjectLiteralExpression());const l=bw.createParameterDeclaration(void 0,void 0,a,void 0,s,c);if(k4(e.parameters)){const t=e.parameters[0],n=bw.createParameterDeclaration(void 0,void 0,t.name,void 0,t.type);return KC(n.name),fZ(t.name,n.name),t.type&&(KC(n.type),fZ(t.type,n.type)),bw.createNodeArray([n,l])}return bw.createNodeArray([l]);function _(e){let i=e.type;var o;i||!e.initializer&&!Uu(e)||(o=e,i=EZ(r.getTypeAtLocation(o),o,t,n));const a=bw.createPropertySignature(void 0,w4(e),u(e)?bw.createToken(58):e.questionToken,i);return KC(a),fZ(e.name,a.name),e.type&&a.type&&fZ(e.type,a.type),a}function u(e){if(Uu(e)){const t=r.getTypeAtLocation(e);return!r.isTupleType(t)}return r.isOptionalParameter(e)}}function w4(e){return $h(e.name)}g6(c4,{kinds:[_4.kind],getEditsForAction:function(e,t){pn.assert(t===c4,"Unexpected action name");const{file:n,startPosition:r,program:i,cancellationToken:o,host:a}=e,s=h4(n,r,i.getTypeChecker());if(!s||!o)return;const c=function(e,t,n){const r=function(e){switch(e.kind){case 263:if(e.name)return[e.name];return[pn.checkDefined(wY(e,90),"Nameless function declaration should be a default export")];case 175:return[e.name];case 177:const t=pn.checkDefined(GX(e,137,e.getSourceFile()),"Constructor declaration should have constructor keyword");if(232===e.parent.kind){return[e.parent.parent.name,t]}return[t];case 220:return[e.parent.name];case 219:return e.name?[e.name,e.parent.name]:[e.parent.name];default:return pn.assertNever(e,`Unexpected function declaration kind ${e.kind}`)}}(e),i=jD(e)?function(e){switch(e.parent.kind){case 264:const t=e.parent;if(t.name)return[t.name];return[pn.checkDefined(wY(t,90),"Nameless class declaration should be a default export")];case 232:const n=e.parent,r=e.parent.parent,i=n.name;return i?[i,r.name]:[r.name]}}(e):[],o=Z([...r,...i],ht),a=t.getTypeChecker(),s=L(o,e=>jce.getReferenceEntriesForNode(-1,e,t,t.getSourceFiles(),n)),c=l(s);b(c.declarations,e=>C(o,e))||(c.valid=!1);return c;function l(t){const n={accessExpressions:[],typeUsages:[]},o={functionCalls:[],declarations:[],classReferences:n,valid:!0},s=P(r,_),c=P(i,_),l=jD(e),u=P(r,e=>u4(e,a));for(const r of t){if(r.kind===jce.EntryKind.Span){o.valid=!1;continue}if(C(u,_(r.node))){if(y4(r.node.parent)){o.signature=r.node.parent;continue}const e=f4(r);if(e){o.functionCalls.push(e);continue}}const t=u4(r.node,a);if(t&&C(u,t)){const e=p4(r);if(e){o.declarations.push(e);continue}}if(C(s,_(r.node))||lX(r.node)){if(d4(r))continue;const e=p4(r);if(e){o.declarations.push(e);continue}const t=f4(r);if(t){o.functionCalls.push(t);continue}}if(l&&C(c,_(r.node))){if(d4(r))continue;const t=p4(r);if(t){o.declarations.push(t);continue}const i=m4(r);if(i){n.accessExpressions.push(i);continue}if(hE(e.parent)){const e=g4(r);if(e){n.typeUsages.push(e);continue}}}o.valid=!1}return o}function _(e){const t=a.getSymbolAtLocation(e);return t&&lZ(t,a)}}(s,i,o);if(c.valid){const t=ide.ChangeTracker.with(e,e=>function(e,t,n,r,i,o){const a=o.signature,s=P(C4(i,t,n),e=>UC(e));if(a){l(a,P(C4(a,t,n),e=>UC(e)))}l(i,s);const c=ne(o.functionCalls,(e,t)=>xt(e.pos,t.pos));for(const e of c)if(e.arguments&&e.arguments.length){const t=UC(T4(i,e.arguments),!0);r.replaceNodeRange(Sd(e),ye(e.arguments),xe(e.arguments),t,{leadingTriviaOption:ide.LeadingTriviaOption.IncludeAll,trailingTriviaOption:ide.TrailingTriviaOption.Include})}function l(t,n){r.replaceNodeRangeWithNodes(e,ye(t.parameters),xe(t.parameters),n,{joiner:", ",indentation:0,leadingTriviaOption:ide.LeadingTriviaOption.IncludeAll,trailingTriviaOption:ide.TrailingTriviaOption.Include})}}(n,i,a,e,s,c));return{renameFilename:void 0,renameLocation:void 0,edits:t}}return{edits:[]}},getAvailableActions:function(e){const{file:t,startPosition:n}=e;if(Im(t))return _;return h4(t,n,e.program.getTypeChecker())?[{name:c4,description:l4,actions:[_4]}]:_}});var N4={},D4="Convert to template string",F4=Gx(fa.Convert_to_template_string),E4={name:D4,description:F4,kind:"refactor.rewrite.string"};function P4(e,t){const n=lQ(e,t),r=I4(n);return!O4(r).isValidConcatenation&&SF(r.parent)&&AF(r.parent.parent)?r.parent.parent:n}function A4(e,t){const n=I4(t),r=e.file,i=function({nodes:e,operators:t},n){const r=L4(t,n),i=j4(e,n,r),[o,a,s,c]=B4(0,e);if(o===e.length){const e=bw.createNoSubstitutionTemplateLiteral(a,s);return i(c,e),e}const l=[],_=bw.createTemplateHead(a,s);i(c,_);for(let t=o;t{J4(e);const r=t===n.templateSpans.length-1,i=e.literal.text+(r?a:""),o=R4(e.literal)+(r?s:"");return bw.createTemplateSpan(e.expression,_&&r?bw.createTemplateTail(i,o):bw.createTemplateMiddle(i,o))});l.push(...e)}else{const e=_?bw.createTemplateTail(a,s):bw.createTemplateMiddle(a,s);i(c,e),l.push(bw.createTemplateSpan(n,e))}}return bw.createTemplateExpression(_,l)}(O4(n),r),o=ms(r.text,n.end);if(o){const t=o[o.length-1],a={pos:o[0].pos,end:t.end};return ide.ChangeTracker.with(e,e=>{e.deleteRange(r,a),e.replaceNode(r,n,i)})}return ide.ChangeTracker.with(e,e=>e.replaceNode(r,n,i))}function I4(e){return mc(e.parent,e=>{switch(e.kind){case 212:case 213:return!1;case 229:case 227:return!(AF(e.parent)&&(t=e.parent,64!==t.operatorToken.kind&&65!==t.operatorToken.kind));default:return"quit"}var t})||e}function O4(e){const t=e=>{if(!AF(e))return{nodes:[e],operators:[],validOperators:!0,hasString:KN(e)||QN(e)};const{nodes:n,operators:r,hasString:i,validOperators:o}=t(e.left);if(!(i||KN(e.right)||OF(e.right)))return{nodes:[e],operators:[],hasString:!1,validOperators:!0};const a=40===e.operatorToken.kind,s=o&&a;return n.push(e.right),r.push(e.operatorToken),{nodes:n,operators:r,hasString:!0,validOperators:s}},{nodes:n,operators:r,validOperators:i,hasString:o}=t(e);return{nodes:n,operators:r,isValidConcatenation:i&&o}}g6(D4,{kinds:[E4.kind],getEditsForAction:function(e,t){const{file:n,startPosition:r}=e,i=P4(n,r);if(t===F4)return{edits:A4(e,i)};return pn.fail("invalid action")},getAvailableActions:function(e){const{file:t,startPosition:n}=e,r=I4(P4(t,n)),i=KN(r),o={name:D4,description:F4,actions:[]};if(i&&"invoked"!==e.triggerReason)return _;if(Tm(r)&&(i||AF(r)&&O4(r).isValidConcatenation))return o.actions.push(E4),[o];if(e.preferences.provideRefactorNotApplicableReason)return o.actions.push({...E4,notApplicableReason:Gx(fa.Can_only_convert_string_concatenations_and_string_literals)}),[o];return _}});var L4=(e,t)=>(n,r)=>{n(r,i)=>{for(;r.length>0;){const o=r.shift();yZ(e[o],i,t,3,!1),n(o,i)}};function M4(e){return e.replace(/\\.|[$`]/g,e=>"\\"===e[0]?e:"\\"+e)}function R4(e){const t=YN(e)||ZN(e)?-2:-1;return ep(e).slice(1,t)}function B4(e,t){const n=[];let r="",i="";for(;e=a.pos?s.getEnd():a.getEnd()),l=o?function(e){for(;e.parent;){if(H4(e)&&!H4(e.parent))return e;e=e.parent}return}(a):function(e,t){for(;e.parent;){if(H4(e)&&0!==t.length&&e.end>=t.start+t.length)return e;e=e.parent}return}(a,c),_=l&&H4(l)?function(e){if($4(e))return e;if(XF(e)){const t=jg(e),n=null==t?void 0:t.initializer;return n&&$4(n)?n:void 0}return e.expression&&$4(e.expression)?e.expression:void 0}(l):void 0;if(!_)return{error:Gx(fa.Could_not_find_convertible_access_expression)};const u=r.getTypeChecker();return IF(_)?function(e,t){const n=e.condition,r=Y4(e.whenTrue);if(!r||t.isNullableType(t.getTypeAtLocation(r)))return{error:Gx(fa.Could_not_find_convertible_access_expression)};if((hF(n)||uD(n))&&X4(n,r.expression))return{finalExpression:r,occurrences:[n],expression:e};if(AF(n)){const t=G4(r.expression,n);return t?{finalExpression:r,occurrences:t,expression:e}:{error:Gx(fa.Could_not_find_matching_access_expressions)}}}(_,u):function(e){if(56!==e.operatorToken.kind)return{error:Gx(fa.Can_only_convert_logical_AND_access_chains)};const t=Y4(e.right);if(!t)return{error:Gx(fa.Could_not_find_convertible_access_expression)};const n=G4(t.expression,e.left);return n?{finalExpression:t,occurrences:n,expression:e}:{error:Gx(fa.Could_not_find_matching_access_expressions)}}(_)}function G4(e,t){const n=[];for(;AF(t)&&56===t.operatorToken.kind;){const r=X4(_h(e),_h(t.right));if(!r)break;n.push(r),e=r,t=t.left}const r=X4(e,t);return r&&n.push(r),n.length>0?n:void 0}function X4(e,t){if(uD(t)||hF(t)||yF(t))return function(e,t){for(;(vF(e)||hF(e)||yF(e))&&Q4(e)!==Q4(t);)e=e.expression;for(;hF(e)&&hF(t)||yF(e)&&yF(t);){if(Q4(e)!==Q4(t))return!1;e=e.expression,t=t.expression}return uD(e)&&uD(t)&&e.getText()===t.getText()}(e,t)?t:void 0}function Q4(e){return uD(e)||Jh(e)?e.getText():hF(e)?Q4(e.name):yF(e)?Q4(e.argumentExpression):void 0}function Y4(e){return AF(e=_h(e))?Y4(e.left):(hF(e)||yF(e)||vF(e))&&!xl(e)?e:void 0}function Z4(e,t,n){if(hF(t)||yF(t)||vF(t)){const r=Z4(e,t.expression,n),i=n.length>0?n[n.length-1]:void 0,o=(null==i?void 0:i.getText())===t.expression.getText();if(o&&n.pop(),vF(t))return o?bw.createCallChain(r,bw.createToken(29),t.typeArguments,t.arguments):bw.createCallChain(r,t.questionDotToken,t.typeArguments,t.arguments);if(hF(t))return o?bw.createPropertyAccessChain(r,bw.createToken(29),t.name):bw.createPropertyAccessChain(r,t.questionDotToken,t.name);if(yF(t))return o?bw.createElementAccessChain(r,bw.createToken(29),t.argumentExpression):bw.createElementAccessChain(r,t.questionDotToken,t.argumentExpression)}return t}g6(U4,{kinds:[W4.kind],getEditsForAction:function(e,t){const n=K4(e);pn.assert(n&&!C3(n),"Expected applicable refactor info");return{edits:ide.ChangeTracker.with(e,t=>function(e,t,n,r){const{finalExpression:i,occurrences:o,expression:a}=r,s=o[o.length-1],c=Z4(t,i,o);c&&(hF(c)||yF(c)||vF(c))&&(AF(a)?n.replaceNodeRange(e,s,i,c):IF(a)&&n.replaceNode(e,a,bw.createBinaryExpression(c,bw.createToken(61),a.whenFalse)))}(e.file,e.program.getTypeChecker(),t,n)),renameFilename:void 0,renameLocation:void 0}},getAvailableActions:function(e){const t=K4(e,"invoked"===e.triggerReason);if(!t)return _;if(!C3(t))return[{name:U4,description:V4,actions:[W4]}];if(e.preferences.provideRefactorNotApplicableReason)return[{name:U4,description:V4,actions:[{...W4,notApplicableReason:t.error}]}];return _}});var e8={};o(e8,{Messages:()=>t8,RangeFacts:()=>s8,getRangeToExtract:()=>c8,getRefactorActionsToExtractSymbol:()=>o8,getRefactorEditsToExtractSymbol:()=>a8});var t8,n8="Extract Symbol",r8={name:"Extract Constant",description:Gx(fa.Extract_constant),kind:"refactor.extract.constant"},i8={name:"Extract Function",description:Gx(fa.Extract_function),kind:"refactor.extract.function"};function o8(e){const t=e.kind,n=c8(e.file,ZZ(e),"invoked"===e.triggerReason),r=n.targetRange;if(void 0===r){if(!n.errors||0===n.errors.length||!e.preferences.provideRefactorNotApplicableReason)return _;const r=[];return w3(i8.kind,t)&&r.push({name:n8,description:i8.description,actions:[{...i8,notApplicableReason:m(n.errors)}]}),w3(r8.kind,t)&&r.push({name:n8,description:r8.description,actions:[{...r8,notApplicableReason:m(n.errors)}]}),r}const{affectedTextRange:i,extractions:o}=function(e,t){const{scopes:n,affectedTextRange:r,readsAndWrites:{functionErrorsPerScope:i,constantErrorsPerScope:o}}=u8(e,t),a=n.map((e,t)=>{const n=function(e){return l_(e)?"inner function":m_(e)?"method":"function"}(e),r=function(e){return m_(e)?"readonly field":"constant"}(e),a=l_(e)?function(e){switch(e.kind){case 177:return"constructor";case 219:case 263:return e.name?`function '${e.name.text}'`:FZ;case 220:return"arrow function";case 175:return`method '${e.name.getText()}'`;case 178:return`'get ${e.name.getText()}'`;case 179:return`'set ${e.name.getText()}'`;default:pn.assertNever(e,`Unexpected scope kind ${e.kind}`)}}(e):m_(e)?function(e){return 264===e.kind?e.name?`class '${e.name.text}'`:"anonymous class declaration":e.name?`class expression '${e.name.text}'`:"anonymous class expression"}(e):function(e){return 269===e.kind?`namespace '${e.parent.name.getText()}'`:e.externalModuleIndicator?0:1}(e);let s,c;return 1===a?(s=$x(Gx(fa.Extract_to_0_in_1_scope),[n,"global"]),c=$x(Gx(fa.Extract_to_0_in_1_scope),[r,"global"])):0===a?(s=$x(Gx(fa.Extract_to_0_in_1_scope),[n,"module"]),c=$x(Gx(fa.Extract_to_0_in_1_scope),[r,"module"])):(s=$x(Gx(fa.Extract_to_0_in_1),[n,a]),c=$x(Gx(fa.Extract_to_0_in_1),[r,a])),0!==t||m_(e)||(c=$x(Gx(fa.Extract_to_0_in_enclosing_scope),[r])),{functionExtraction:{description:s,errors:i[t]},constantExtraction:{description:c,errors:o[t]}}});return{affectedTextRange:r,extractions:a}}(r,e);if(void 0===o)return _;const a=[],s=new Map;let c;const l=[],u=new Map;let d,p=0;for(const{functionExtraction:n,constantExtraction:r}of o){if(w3(i8.kind,t)){const t=n.description;0===n.errors.length?s.has(t)||(s.set(t,!0),a.push({description:t,name:`function_scope_${p}`,kind:i8.kind,range:{start:{line:Wa(e.file,i.pos).line,offset:Wa(e.file,i.pos).character},end:{line:Wa(e.file,i.end).line,offset:Wa(e.file,i.end).character}}})):c||(c={description:t,name:`function_scope_${p}`,notApplicableReason:m(n.errors),kind:i8.kind})}if(w3(r8.kind,t)){const t=r.description;0===r.errors.length?u.has(t)||(u.set(t,!0),l.push({description:t,name:`constant_scope_${p}`,kind:r8.kind,range:{start:{line:Wa(e.file,i.pos).line,offset:Wa(e.file,i.pos).character},end:{line:Wa(e.file,i.end).line,offset:Wa(e.file,i.end).character}}})):d||(d={description:t,name:`constant_scope_${p}`,notApplicableReason:m(r.errors),kind:r8.kind})}p++}const f=[];return a.length?f.push({name:n8,description:Gx(fa.Extract_function),actions:a}):e.preferences.provideRefactorNotApplicableReason&&c&&f.push({name:n8,description:Gx(fa.Extract_function),actions:[c]}),l.length?f.push({name:n8,description:Gx(fa.Extract_constant),actions:l}):e.preferences.provideRefactorNotApplicableReason&&d&&f.push({name:n8,description:Gx(fa.Extract_constant),actions:[d]}),f.length?f:_;function m(e){let t=e[0].messageText;return"string"!=typeof t&&(t=t.messageText),t}}function a8(e,t){const n=c8(e.file,ZZ(e)).targetRange,r=/^function_scope_(\d+)$/.exec(t);if(r){const t=+r[1];return pn.assert(isFinite(t),"Expected to parse a finite number from the function scope index"),function(e,t,n){const{scopes:r,readsAndWrites:{target:i,usagesPerScope:o,functionErrorsPerScope:a,exposedVariableDeclarations:s}}=u8(e,t);return pn.assert(!a[n].length,"The extraction went missing? How?"),t.cancellationToken.throwIfCancellationRequested(),function(e,t,{usages:n,typeParameterUsages:r,substitutions:i},o,a,s){const c=s.program.getTypeChecker(),l=Sk(s.program.getCompilerOptions()),u=U7.createImportAdder(s.file,s.program,s.preferences,s.host),d=t.getSourceFile(),p=mZ(m_(t)?"newMethod":"newFunction",d),f=Om(t),m=bw.createIdentifier(p);let g;const h=[],y=[];let v;n.forEach((e,n)=>{let r;if(!f){let n=c.getTypeOfSymbolAtLocation(e.symbol,e.node);n=c.getBaseTypeOfLiteralType(n),r=U7.typeToAutoImportableTypeNode(c,u,n,t,l,1,8)}const i=bw.createParameterDeclaration(void 0,void 0,n,void 0,r);h.push(i),2===e.usage&&(v||(v=[])).push(e),y.push(bw.createIdentifier(n))});const b=je(r.values(),e=>({type:e,declaration:d8(e,s.startPosition)}));b.sort(p8);const k=0===b.length?void 0:J(b,({declaration:e})=>e),S=void 0!==k?k.map(e=>bw.createTypeReferenceNode(e.name,void 0)):void 0;if(K_(e)&&!f){const n=c.getContextualType(e);g=c.typeToTypeNode(n,t,1,8)}const{body:T,returnValueProperty:C}=function(e,t,n,r,i){const o=void 0!==n||t.length>0;if(GF(e)&&!o&&0===r.size)return{body:bw.createBlock(e.statements,!0),returnValueProperty:void 0};let a,s=!1;const c=bw.createNodeArray(GF(e)?e.statements.slice(0):[hu(e)?e:bw.createReturnStatement(_h(e))]);if(o||r.size){const r=xJ(c,l,hu).slice();if(o&&!i&&hu(e)){const e=f8(t,n);1===e.length?r.push(bw.createReturnStatement(e[0].name)):r.push(bw.createReturnStatement(bw.createObjectLiteralExpression(e)))}return{body:bw.createBlock(r,!0),returnValueProperty:a}}return{body:bw.createBlock(c,!0),returnValueProperty:void 0};function l(e){if(!s&&sE(e)&&o){const r=f8(t,n);return e.expression&&(a||(a="__return"),r.unshift(bw.createPropertyAssignment(a,bJ(e.expression,l,K_)))),1===r.length?bw.createReturnStatement(r[0].name):bw.createReturnStatement(bw.createObjectLiteralExpression(r))}{const t=s;s=s||l_(e)||m_(e);const n=r.get(_J(e).toString()),i=n?UC(n):EJ(e,l,void 0);return s=t,i}}}(e,o,v,i,!!(1&a.facts));let w;KC(T);const N=!!(16&a.facts);if(m_(t)){const e=f?[]:[bw.createModifier(123)];32&a.facts&&e.push(bw.createModifier(126)),4&a.facts&&e.push(bw.createModifier(134)),w=bw.createMethodDeclaration(e.length?e:void 0,2&a.facts?bw.createToken(42):void 0,m,void 0,k,h,g,T)}else N&&h.unshift(bw.createParameterDeclaration(void 0,void 0,"this",void 0,c.typeToTypeNode(c.getTypeAtLocation(a.thisNode),t,1,8),void 0)),w=bw.createFunctionDeclaration(4&a.facts?[bw.createToken(134)]:void 0,2&a.facts?bw.createToken(42):void 0,m,k,h,g,T);const D=ide.ChangeTracker.fromContext(s),F=function(e,t){return x(function(e){if(l_(e)){const t=e.body;if(GF(t))return t.statements}else{if(kE(e)||dP(e))return e.statements;if(m_(e))return e.members}return _}(t),t=>t.pos>=e&&l_(t)&&!jD(t))}((m8(a.range)?xe(a.range):a.range).end,t);F?D.insertNodeBefore(s.file,F,w,!0):D.insertNodeAtEndOfScope(s.file,t,w);u.writeFixes(D);const E=[],P=function(e,t,n){const r=bw.createIdentifier(n);if(m_(e)){const n=32&t.facts?bw.createIdentifier(e.name.text):bw.createThis();return bw.createPropertyAccessExpression(n,r)}return r}(t,a,p);N&&y.unshift(bw.createIdentifier("this"));let A=bw.createCallExpression(N?bw.createPropertyAccessExpression(P,"call"):P,S,y);2&a.facts&&(A=bw.createYieldExpression(bw.createToken(42),A));4&a.facts&&(A=bw.createAwaitExpression(A));h8(e)&&(A=bw.createJsxExpression(void 0,A));if(o.length&&!v)if(pn.assert(!C,"Expected no returnValueProperty"),pn.assert(!(1&a.facts),"Expected RangeFacts.HasReturn flag to be unset"),1===o.length){const e=o[0];E.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(UC(e.name),void 0,UC(e.type),A)],e.parent.flags)))}else{const e=[],n=[];let r=o[0].parent.flags,i=!1;for(const a of o){e.push(bw.createBindingElement(void 0,void 0,UC(a.name)));const o=c.typeToTypeNode(c.getBaseTypeOfLiteralType(c.getTypeAtLocation(a)),t,1,8);n.push(bw.createPropertySignature(void 0,a.symbol.name,void 0,o)),i=i||void 0!==a.type,r&=a.parent.flags}const a=i?bw.createTypeLiteralNode(n):void 0;a&&ww(a,1),E.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(bw.createObjectBindingPattern(e),void 0,a,A)],r)))}else if(o.length||v){if(o.length)for(const e of o){let t=e.parent.flags;2&t&&(t=-3&t|1),E.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(e.symbol.name,void 0,j(e.type))],t)))}C&&E.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(C,void 0,j(g))],1)));const e=f8(o,v);C&&e.unshift(bw.createShorthandPropertyAssignment(C)),1===e.length?(pn.assert(!C,"Shouldn't have returnValueProperty here"),E.push(bw.createExpressionStatement(bw.createAssignment(e[0].name,A))),1&a.facts&&E.push(bw.createReturnStatement())):(E.push(bw.createExpressionStatement(bw.createAssignment(bw.createObjectLiteralExpression(e),A))),C&&E.push(bw.createReturnStatement(bw.createIdentifier(C))))}else 1&a.facts?E.push(bw.createReturnStatement(A)):m8(a.range)?E.push(bw.createExpressionStatement(A)):E.push(A);m8(a.range)?D.replaceNodeRangeWithNodes(s.file,ye(a.range),xe(a.range),E):D.replaceNodeWithNodes(s.file,a.range,E);const I=D.getChanges(),O=(m8(a.range)?ye(a.range):a.range).getSourceFile().fileName,L=gZ(I,O,p,!1);return{renameFilename:O,renameLocation:L,edits:I};function j(e){if(void 0===e)return;const t=UC(e);let n=t;for(;rF(n);)n=n.type;return ZD(n)&&x(n.types,e=>157===e.kind)?t:bw.createUnionTypeNode([t,bw.createKeywordTypeNode(157)])}}(i,r[n],o[n],s,e,t)}(n,e,t)}const i=/^constant_scope_(\d+)$/.exec(t);if(i){const t=+i[1];return pn.assert(isFinite(t),"Expected to parse a finite number from the constant scope index"),function(e,t,n){const{scopes:r,readsAndWrites:{target:i,usagesPerScope:o,constantErrorsPerScope:a,exposedVariableDeclarations:s}}=u8(e,t);pn.assert(!a[n].length,"The extraction went missing? How?"),pn.assert(0===s.length,"Extract constant accepted a range containing a variable declaration?"),t.cancellationToken.throwIfCancellationRequested();return function(e,t,{substitutions:n},r,i){const o=i.program.getTypeChecker(),a=t.getSourceFile(),s=N3(e,t,o,a),c=Om(t);let l=c||!o.isContextSensitive(e)?void 0:o.typeToTypeNode(o.getContextualType(e),t,1,8),_=function(e,t){return t.size?n(e):e;function n(e){const r=t.get(_J(e).toString());return r?UC(r):EJ(e,n,void 0)}}(_h(e),n);({variableType:l,initializer:_}=m(l,_)),KC(_);const u=ide.ChangeTracker.fromContext(i);if(m_(t)){pn.assert(!c,"Cannot extract to a JS class");const n=[];n.push(bw.createModifier(123)),32&r&&n.push(bw.createModifier(126)),n.push(bw.createModifier(148));const o=bw.createPropertyDeclaration(n,s,void 0,l,_);let a=bw.createPropertyAccessExpression(32&r?bw.createIdentifier(t.name.getText()):bw.createThis(),bw.createIdentifier(s));h8(e)&&(a=bw.createJsxExpression(void 0,a));const d=function(e,t){const n=t.members;let r;pn.assert(n.length>0,"Found no members");let i=!0;for(const t of n){if(t.pos>e)return r||n[0];if(i&&!AD(t)){if(void 0!==r)return t;i=!1}r=t}return void 0===r?pn.fail():r}(e.pos,t);u.insertNodeBefore(i.file,d,o,!0),u.replaceNode(i.file,e,a)}else{const n=bw.createVariableDeclaration(s,void 0,l,_),r=function(e,t){let n;for(;void 0!==e&&e!==t;){if(fE(e)&&e.initializer===n&&mE(e.parent)&&e.parent.declarations.length>1)return e;n=e,e=e.parent}}(e,t);if(r){u.insertNodeBefore(i.file,r,n);const t=bw.createIdentifier(s);u.replaceNode(i.file,e,t)}else if(245===e.parent.kind&&t===mc(e,_8)){const t=bw.createVariableStatement(void 0,bw.createVariableDeclarationList([n],2));u.replaceNode(i.file,e.parent,t)}else{const r=bw.createVariableStatement(void 0,bw.createVariableDeclarationList([n],2)),o=function(e,t){let n;pn.assert(!m_(t));for(let r=e;r!==t;r=r.parent)_8(r)&&(n=r);for(let r=(n||e).parent;;r=r.parent){if(y0(r)){let t;for(const n of r.statements){if(n.pos>e.pos)break;t=n}return!t&&iP(r)?(pn.assert(lE(r.parent.parent),"Grandparent isn't a switch statement"),r.parent.parent):pn.checkDefined(t,"prevStatement failed to get set")}pn.assert(r!==t,"Didn't encounter a block-like before encountering scope")}}(e,t);if(0===o.pos?u.insertNodeAtTopOfFile(i.file,r,!1):u.insertNodeBefore(i.file,o,r,!1),245===e.parent.kind)u.delete(i.file,e.parent);else{let t=bw.createIdentifier(s);h8(e)&&(t=bw.createJsxExpression(void 0,t)),u.replaceNode(i.file,e,t)}}}const d=u.getChanges(),p=e.getSourceFile().fileName,f=gZ(d,p,s,!0);return{renameFilename:p,renameLocation:f,edits:d};function m(n,r){if(void 0===n)return{variableType:n,initializer:r};if(!TF(r)&&!CF(r)||r.typeParameters)return{variableType:n,initializer:r};const i=o.getTypeAtLocation(e),a=ke(o.getSignaturesOfType(i,0));if(!a)return{variableType:n,initializer:r};if(a.getTypeParameters())return{variableType:n,initializer:r};const s=[];let c=!1;for(const e of r.parameters)if(e.type)s.push(e);else{const n=o.getTypeAtLocation(e);n===o.getAnyType()&&(c=!0),s.push(bw.updateParameterDeclaration(e,e.modifiers,e.dotDotDotToken,e.name,e.questionToken,e.type||o.typeToTypeNode(n,t,1,8),e.initializer))}if(c)return{variableType:n,initializer:r};if(n=void 0,CF(r))r=bw.updateArrowFunction(r,EI(e)?Ac(e):void 0,r.typeParameters,s,r.type||o.typeToTypeNode(a.getReturnType(),t,1,8),r.equalsGreaterThanToken,r.body);else{if(a&&a.thisParameter){const n=ge(s);if(!n||uD(n.name)&&"this"!==n.name.escapedText){const n=o.getTypeOfSymbolAtLocation(a.thisParameter,e);s.splice(0,0,bw.createParameterDeclaration(void 0,void 0,"this",void 0,o.typeToTypeNode(n,t,1,8)))}}r=bw.updateFunctionExpression(r,EI(e)?Ac(e):void 0,r.asteriskToken,r.name,r.typeParameters,s,r.type||o.typeToTypeNode(a.getReturnType(),t,1),r.body)}return{variableType:n,initializer:r}}}(K_(i)?i:i.statements[0].expression,r[n],o[n],e.facts,t)}(n,e,t)}pn.fail("Unrecognized action name")}g6(n8,{kinds:[r8.kind,i8.kind],getEditsForAction:a8,getAvailableActions:o8}),(e=>{function t(e){return{message:e,code:0,category:3,key:e}}e.cannotExtractRange=t("Cannot extract range."),e.cannotExtractImport=t("Cannot extract import statement."),e.cannotExtractSuper=t("Cannot extract super call."),e.cannotExtractJSDoc=t("Cannot extract JSDoc."),e.cannotExtractEmpty=t("Cannot extract empty range."),e.expressionExpected=t("expression expected."),e.uselessConstantType=t("No reason to extract constant of type."),e.statementOrExpressionExpected=t("Statement or expression expected."),e.cannotExtractRangeContainingConditionalBreakOrContinueStatements=t("Cannot extract range containing conditional break or continue statements."),e.cannotExtractRangeContainingConditionalReturnStatement=t("Cannot extract range containing conditional return statement."),e.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange=t("Cannot extract range containing labeled break or continue with target outside of the range."),e.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators=t("Cannot extract range containing writes to references located outside of the target range in generators."),e.typeWillNotBeVisibleInTheNewScope=t("Type will not visible in the new scope."),e.functionWillNotBeVisibleInTheNewScope=t("Function will not visible in the new scope."),e.cannotExtractIdentifier=t("Select more than a single identifier."),e.cannotExtractExportedEntity=t("Cannot extract exported declaration"),e.cannotWriteInExpression=t("Cannot write back side-effects when extracting an expression"),e.cannotExtractReadonlyPropertyInitializerOutsideConstructor=t("Cannot move initialization of read-only class property outside of the constructor"),e.cannotExtractAmbientBlock=t("Cannot extract code from ambient contexts"),e.cannotAccessVariablesFromNestedScopes=t("Cannot access variables from nested scopes"),e.cannotExtractToJSClass=t("Cannot extract constant to a class scope in JS"),e.cannotExtractToExpressionArrowFunction=t("Cannot extract constant to an arrow function without a block"),e.cannotExtractFunctionsContainingThisToMethod=t("Cannot extract functions containing this to method")})(t8||(t8={}));var s8=(e=>(e[e.None=0]="None",e[e.HasReturn=1]="HasReturn",e[e.IsGenerator=2]="IsGenerator",e[e.IsAsyncFunction=4]="IsAsyncFunction",e[e.UsesThis=8]="UsesThis",e[e.UsesThisInFunction=16]="UsesThisInFunction",e[e.InStaticRegion=32]="InStaticRegion",e))(s8||{});function c8(e,t,n=!0){const{length:r}=t;if(0===r&&!n)return{errors:[ek(e,t.start,r,t8.cannotExtractEmpty)]};const i=0===r&&n,o=uQ(e,t.start),a=dQ(e,Is(t)),s=o&&a&&n?function(e,t,n){const r=e.getStart(n);let i=t.getEnd();59===n.text.charCodeAt(i)&&i++;return{start:r,length:i-r}}(o,a,e):t,c=i?function(e){return mc(e,e=>e.parent&&g8(e)&&!AF(e.parent))}(o):TY(o,e,s),l=i?c:TY(a,e,s);let _,u=0;if(!c||!l)return{errors:[ek(e,t.start,r,t8.cannotExtractRange)]};if(16777216&c.flags)return{errors:[ek(e,t.start,r,t8.cannotExtractJSDoc)]};if(c.parent!==l.parent)return{errors:[ek(e,t.start,r,t8.cannotExtractRange)]};if(c!==l){if(!y0(c.parent))return{errors:[ek(e,t.start,r,t8.cannotExtractRange)]};const n=[];for(const e of c.parent.statements){if(e===c||n.length){const t=f(e);if(t)return{errors:t};n.push(e)}if(e===l)break}return n.length?{targetRange:{range:n,facts:u,thisNode:_}}:{errors:[ek(e,t.start,r,t8.cannotExtractRange)]}}if(sE(c)&&!c.expression)return{errors:[ek(e,t.start,r,t8.cannotExtractRange)]};const d=function(e){if(sE(e)){if(e.expression)return e.expression}else if(XF(e)||mE(e)){const t=XF(e)?e.declarationList.declarations:e.declarations;let n,r=0;for(const e of t)e.initializer&&(r++,n=e.initializer);if(1===r)return n}else if(fE(e)&&e.initializer)return e.initializer;return e}(c),p=function(e){if(uD(YF(e)?e.expression:e))return[qp(e,t8.cannotExtractIdentifier)];return}(d)||f(d);return p?{errors:p}:{targetRange:{range:l8(d),facts:u,thisNode:_}};function f(e){let n;var r;if((r=n||(n={}))[r.None=0]="None",r[r.Break=1]="Break",r[r.Continue=2]="Continue",r[r.Return=4]="Return",pn.assert(e.pos<=e.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"),pn.assert(!tT(e.pos),"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"),!(hu(e)||Tm(e)&&g8(e)||y8(e)))return[qp(e,t8.statementOrExpressionExpected)];if(33554432&e.flags)return[qp(e,t8.cannotExtractAmbientBlock)];const i=em(e);let o;i&&function(e,t){let n=e;for(;n!==t;){if(173===n.kind){Iv(n)&&(u|=32);break}if(170===n.kind){177===Yf(n).kind&&(u|=32);break}175===n.kind&&Iv(n)&&(u|=32),n=n.parent}}(e,i);let a,s=4;if(function e(n){if(o)return!0;if(fu(n)){if(Av(261===n.kind?n.parent.parent:n,32))return(o||(o=[])).push(qp(n,t8.cannotExtractExportedEntity)),!0}switch(n.kind){case 273:return(o||(o=[])).push(qp(n,t8.cannotExtractImport)),!0;case 278:return(o||(o=[])).push(qp(n,t8.cannotExtractExportedEntity)),!0;case 108:if(214===n.parent.kind){const e=em(n);if(void 0===e||e.pos=t.start+t.length)return(o||(o=[])).push(qp(n,t8.cannotExtractSuper)),!0}else u|=8,_=n;break;case 220:iO(n,function e(t){if(OX(t))u|=8,_=n;else{if(m_(t)||s_(t)&&!CF(t))return!1;iO(t,e)}});case 264:case 263:dP(n.parent)&&void 0===n.parent.externalModuleIndicator&&(o||(o=[])).push(qp(n,t8.functionWillNotBeVisibleInTheNewScope));case 232:case 219:case 175:case 177:case 178:case 179:return!1}const r=s;switch(n.kind){case 246:s&=-5;break;case 259:s=0;break;case 242:n.parent&&259===n.parent.kind&&n.parent.finallyBlock===n&&(s=4);break;case 298:case 297:s|=1;break;default:X_(n,!1)&&(s|=3)}switch(n.kind){case 198:case 110:u|=8,_=n;break;case 257:{const t=n.label;(a||(a=[])).push(t.escapedText),iO(n,e),a.pop();break}case 253:case 252:{const e=n.label;e?C(a,e.escapedText)||(o||(o=[])).push(qp(n,t8.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):s&(253===n.kind?1:2)||(o||(o=[])).push(qp(n,t8.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break}case 224:u|=4;break;case 230:u|=2;break;case 254:4&s?u|=1:(o||(o=[])).push(qp(n,t8.cannotExtractRangeContainingConditionalReturnStatement));break;default:iO(n,e)}s=r}(e),8&u){const t=im(e,!1,!1);(263===t.kind||175===t.kind&&211===t.parent.kind||219===t.kind)&&(u|=16)}return o}}function l8(e){return hu(e)?[e]:Tm(e)?YF(e.parent)?[e.parent]:e:y8(e)?e:void 0}function _8(e){return CF(e)?ru(e.body):l_(e)||dP(e)||kE(e)||m_(e)}function u8(e,t){const{file:n}=t,r=function(e){let t=m8(e.range)?ye(e.range):e.range;if(8&e.facts&&!(16&e.facts)){const e=em(t);if(e){const n=mc(t,l_);return n?[n,e]:[e]}}const n=[];for(;;)if(t=t.parent,170===t.kind&&(t=mc(t,e=>l_(e)).parent),_8(t)&&(n.push(t),308===t.kind))return n}(e),i=function(e,t){return m8(e.range)?{pos:ye(e.range).getStart(t),end:xe(e.range).getEnd()}:e.range}(e,n),o=function(e,t,n,r,i,o){const a=new Map,s=[],c=[],l=[],_=[],u=[],d=new Map,p=[];let f;const m=m8(e.range)?1===e.range.length&&YF(e.range[0])?e.range[0].expression:void 0:e.range;let g;if(void 0===m){const t=e.range,n=ye(t).getStart(),i=xe(t).end;g=ek(r,n,i-n,t8.expressionExpected)}else 147456&i.getTypeAtLocation(m).flags&&(g=qp(m,t8.uselessConstantType));for(const e of t){s.push({usages:new Map,typeParameterUsages:new Map,substitutions:new Map}),c.push(new Map),l.push([]);const t=[];g&&t.push(g),m_(e)&&Om(e)&&t.push(qp(e,t8.cannotExtractToJSClass)),CF(e)&&!GF(e.body)&&t.push(qp(e,t8.cannotExtractToExpressionArrowFunction)),_.push(t)}const h=new Map,y=m8(e.range)?bw.createBlock(e.range):e.range,v=m8(e.range)?ye(e.range):e.range,b=k(v);if(T(y),b&&!m8(e.range)&&!ZE(e.range)){S(i.getContextualType(e.range))}if(a.size>0){const e=new Map;let n=0;for(let r=v;void 0!==r&&n{s[n].typeParameterUsages.set(t,e)}),n++),Cp(r))for(const t of fl(r)){const n=i.getTypeAtLocation(t);a.has(n.id.toString())&&e.set(n.id.toString(),n)}pn.assert(n===t.length,"Should have iterated all scopes")}if(u.length){iO(Tp(t[0],t[0].parent)?t[0]:Op(t[0]),N)}for(let n=0;n0&&(r.usages.size>0||r.typeParameterUsages.size>0)){const t=m8(e.range)?e.range[0]:e.range;_[n].push(qp(t,t8.cannotAccessVariablesFromNestedScopes))}16&e.facts&&m_(t[n])&&l[n].push(qp(e.thisNode,t8.cannotExtractFunctionsContainingThisToMethod));let i,o=!1;if(s[n].usages.forEach(e=>{2===e.usage&&(o=!0,106500&e.symbol.flags&&e.symbol.valueDeclaration&&Pv(e.symbol.valueDeclaration,8)&&(i=e.symbol.valueDeclaration))}),pn.assert(m8(e.range)||0===p.length,"No variable declarations expected if something was extracted"),o&&!m8(e.range)){const t=qp(e.range,t8.cannotWriteInExpression);l[n].push(t),_[n].push(t)}else if(i&&n>0){const e=qp(i,t8.cannotExtractReadonlyPropertyInitializerOutsideConstructor);l[n].push(e),_[n].push(e)}else if(f){const e=qp(f,t8.cannotExtractExportedEntity);l[n].push(e),_[n].push(e)}}return{target:y,usagesPerScope:s,functionErrorsPerScope:l,constantErrorsPerScope:_,exposedVariableDeclarations:p};function k(e){return!!mc(e,e=>Cp(e)&&0!==fl(e).length)}function S(e){const t=i.getSymbolWalker(()=>(o.throwIfCancellationRequested(),!0)),{visitedTypes:n}=t.walkType(e);for(const e of n)e.isTypeParameter()&&a.set(e.id.toString(),e)}function T(e,t=1){if(b){S(i.getTypeAtLocation(e))}if(fu(e)&&e.symbol&&u.push(e),cb(e))T(e.left,2),T(e.right);else if($_(e))T(e.operand,2);else if(hF(e)||yF(e))iO(e,T);else if(uD(e)){if(!e.parent)return;if(wD(e.parent)&&e!==e.parent.left)return;if(hF(e.parent)&&e!==e.parent.expression)return;C(e,t,Ef(e))}else iO(e,T)}function C(e,n,r){const i=w(e,n,r);if(i)for(let n=0;n=a)return p;if(h.set(p,a),f){for(const e of s){e.usages.get(o.text)&&e.usages.set(o.text,{usage:a,symbol:d,node:o})}return p}const m=d.getDeclarations(),g=m&&x(m,e=>e.getSourceFile()===r);if(g&&!JX(n,g.getStart(),g.end)){if(2&e.facts&&2===a){const e=qp(o,t8.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators);for(const t of l)t.push(e);for(const t of _)t.push(e)}for(let e=0;ee.symbol===n);if(e)if(fE(e)){const t=e.symbol.id.toString();d.has(t)||(p.push(e),d.set(t,!0))}else f=f||e}iO(t,N)}function D(e){return e.parent&&lP(e.parent)&&e.parent.name===e?i.getShorthandAssignmentValueSymbol(e.parent):i.getSymbolAtLocation(e)}function F(e,t,n){if(!e)return;const r=e.getDeclarations();if(r&&r.some(e=>e.parent===t))return bw.createIdentifier(e.name);const i=F(e.parent,t,n);return void 0!==i?n?bw.createQualifiedName(i,bw.createIdentifier(e.name)):bw.createPropertyAccessExpression(i,e.name):void 0}}(e,r,i,n,t.program.getTypeChecker(),t.cancellationToken);return{scopes:r,affectedTextRange:i,readsAndWrites:o}}function d8(e,t){let n;const r=e.symbol;if(r&&r.declarations)for(const e of r.declarations)(void 0===n||e.posbw.createShorthandPropertyAssignment(e.symbol.name)),r=P(t,e=>bw.createShorthandPropertyAssignment(e.symbol.name));return void 0===n?r:void 0===r?n:n.concat(r)}function m8(e){return Ze(e)}function g8(e){const{parent:t}=e;if(307===t.kind)return!1;switch(e.kind){case 11:return 273!==t.kind&&277!==t.kind;case 231:case 207:case 209:return!1;case 80:return 209!==t.kind&&277!==t.kind&&282!==t.kind}return!0}function h8(e){return y8(e)||($E(e)||HE(e)||XE(e))&&($E(e.parent)||XE(e.parent))}function y8(e){return KN(e)&&e.parent&&ZE(e.parent)}var v8={},b8="Generate 'get' and 'set' accessors",x8=Gx(fa.Generate_get_and_set_accessors),k8={name:b8,description:x8,kind:"refactor.rewrite.property.generateAccessors"};g6(b8,{kinds:[k8.kind],getEditsForAction:function(e,t){if(!e.endPosition)return;const n=U7.getAccessorConvertiblePropertyAtPosition(e.file,e.program,e.startPosition,e.endPosition);pn.assert(n&&!C3(n),"Expected applicable refactor info");const r=U7.generateAccessorFromProperty(e.file,e.program,e.startPosition,e.endPosition,e,t);if(!r)return;const i=e.file.fileName,o=n.renameAccessor?n.accessorName:n.fieldName;return{renameFilename:i,renameLocation:(uD(o)?0:-1)+gZ(r,i,o.text,FD(n.declaration)),edits:r}},getAvailableActions(e){if(!e.endPosition)return _;const t=U7.getAccessorConvertiblePropertyAtPosition(e.file,e.program,e.startPosition,e.endPosition,"invoked"===e.triggerReason);return t?C3(t)?e.preferences.provideRefactorNotApplicableReason?[{name:b8,description:x8,actions:[{...k8,notApplicableReason:t.error}]}]:_:[{name:b8,description:x8,actions:[k8]}]:_}});var S8={},T8="Infer function return type",C8=Gx(fa.Infer_function_return_type),w8={name:T8,description:C8,kind:"refactor.rewrite.function.returnType"};function N8(e){if(Om(e.file)||!w3(w8.kind,e.kind))return;const t=mc(sQ(e.file,e.startPosition),e=>GF(e)||e.parent&&CF(e.parent)&&(39===e.kind||e.parent.body===e)?"quit":function(e){switch(e.kind){case 263:case 219:case 220:case 175:return!0;default:return!1}}(e));if(!t||!t.body||t.type)return{error:Gx(fa.Return_type_must_be_inferred_from_a_function)};const n=e.program.getTypeChecker();let r;if(n.isImplementationOfOverload(t)){const e=n.getTypeAtLocation(t).getCallSignatures();e.length>1&&(r=n.getUnionType(J(e,e=>e.getReturnType())))}if(!r){const e=n.getSignatureFromDeclaration(t);if(e){const i=n.getTypePredicateOfSignature(e);if(i&&i.type){const e=n.typePredicateToTypePredicateNode(i,t,1,8);if(e)return{declaration:t,returnTypeNode:e}}else r=n.getReturnTypeOfSignature(e)}}if(!r)return{error:Gx(fa.Could_not_determine_function_return_type)};const i=n.typeToTypeNode(r,t,1,8);return i?{declaration:t,returnTypeNode:i}:void 0}g6(T8,{kinds:[w8.kind],getEditsForAction:function(e){const t=N8(e);if(t&&!C3(t)){return{renameFilename:void 0,renameLocation:void 0,edits:ide.ChangeTracker.with(e,n=>function(e,t,n,r){const i=GX(n,22,e),o=CF(n)&&void 0===i,a=o?ye(n.parameters):i;a&&(o&&(t.insertNodeBefore(e,a,bw.createToken(21)),t.insertNodeAfter(e,a,bw.createToken(22))),t.insertNodeAt(e,a.end,r,{prefix:": "}))}(e.file,n,t.declaration,t.returnTypeNode))}}return},getAvailableActions:function(e){const t=N8(e);if(!t)return _;if(!C3(t))return[{name:T8,description:C8,actions:[w8]}];if(e.preferences.provideRefactorNotApplicableReason)return[{name:T8,description:C8,actions:[{...w8,notApplicableReason:t.error}]}];return _}});var D8=(e=>(e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask",e))(D8||{}),F8=(e=>(e[e.class=0]="class",e[e.enum=1]="enum",e[e.interface=2]="interface",e[e.namespace=3]="namespace",e[e.typeParameter=4]="typeParameter",e[e.type=5]="type",e[e.parameter=6]="parameter",e[e.variable=7]="variable",e[e.enumMember=8]="enumMember",e[e.property=9]="property",e[e.function=10]="function",e[e.member=11]="member",e))(F8||{}),E8=(e=>(e[e.declaration=0]="declaration",e[e.static=1]="static",e[e.async=2]="async",e[e.readonly=3]="readonly",e[e.defaultLibrary=4]="defaultLibrary",e[e.local=5]="local",e))(E8||{});function P8(e,t,n,r){const i=A8(e,t,n,r);pn.assert(i.spans.length%3==0);const o=i.spans,a=[];for(let e=0;ee(r)||r.isUnion()&&r.types.some(e);if(6!==n&&e(e=>e.getConstructSignatures().length>0))return 0;if(e(e=>e.getCallSignatures().length>0)&&!e(e=>e.getProperties().length>0)||function(e){for(;L8(e);)e=e.parent;return vF(e.parent)&&e.parent.expression===e}(t))return 9===n?11:10}}return n}(o,c,i);const s=n.valueDeclaration;if(s){const r=cc(s),o=_c(s);256&r&&(a|=2),1024&r&&(a|=4),0!==i&&2!==i&&(8&r||2&o||8&n.getFlags())&&(a|=8),7!==i&&10!==i||!function(e,t){fF(e)&&(e=O8(e));if(fE(e))return(!dP(e.parent.parent.parent)||sP(e.parent))&&e.getSourceFile()===t;if(gE(e))return!dP(e.parent)&&e.getSourceFile()===t;return!1}(s,t)||(a|=32),e.isSourceFileDefaultLibrary(s.getSourceFile())&&(a|=16)}else n.declarations&&n.declarations.some(t=>e.isSourceFileDefaultLibrary(t.getSourceFile()))&&(a|=16);r(c,i,a)}}}iO(c,s),a=l}s(t)}(e,t,n,(e,n,r)=>{i.push(e.getStart(t),e.getWidth(t),(n+1<<8)+r)},r),i}function O8(e){for(;;){if(!fF(e.parent.parent))return e.parent.parent;e=e.parent.parent}}function L8(e){return wD(e.parent)&&e.parent.right===e||hF(e.parent)&&e.parent.name===e}var j8=new Map([[261,7],[170,6],[173,9],[268,3],[267,1],[307,8],[264,0],[175,11],[263,10],[219,10],[174,11],[178,9],[179,9],[172,9],[265,2],[266,5],[169,4],[304,9],[305,9]]),M8="0.8";function R8(e,t,n,r){const i=Al(e)?new B8(e,t,n):80===e?new V8(80,t,n):81===e?new W8(81,t,n):new U8(e,t,n);return i.parent=r,i.flags=101441536&r.flags,i}var B8=class{constructor(e,t,n){this.pos=t,this.end=n,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}assertHasRealPosition(e){pn.assert(!tT(this.pos)&&!tT(this.end),e||"Node must have a real position for this operation")}getSourceFile(){return Sd(this)}getStart(e,t){return this.assertHasRealPosition(),Wd(this,e,t)}getFullStart(){return this.assertHasRealPosition(),this.pos}getEnd(){return this.assertHasRealPosition(),this.end}getWidth(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)}getFullWidth(){return this.assertHasRealPosition(),this.end-this.pos}getLeadingTriviaWidth(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos}getFullText(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(e){return this.getChildren(e).length}getChildAt(e,t){return this.getChildren(t)[e]}getChildren(e=Sd(this)){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),oA(this,e)??aA(this,e,function(e,t){const n=[];if(Du(e))return e.forEachChild(e=>{n.push(e)}),n;const r=(null==t?void 0:t.languageVariant)??0;rX.setText((t||e.getSourceFile()).text),rX.setLanguageVariant(r);let i=e.pos;const o=t=>{J8(n,i,t.pos,e),n.push(t),i=t.end},a=t=>{J8(n,i,t.pos,e),n.push(function(e,t){const n=R8(353,e.pos,e.end,t),r=[];let i=e.pos;for(const n of e)J8(r,i,n.pos,t),r.push(n),i=n.end;return J8(r,i,e.end,t),n._children=r,n}(t,e)),i=t.end};return p(e.jsDoc,o),i=e.pos,e.forEachChild(o,a),J8(n,i,e.end,e),rX.setText(void 0),rX.setLanguageVariant(0),n}(this,e))}getFirstToken(e){this.assertHasRealPosition();const t=this.getChildren(e);if(!t.length)return;const n=x(t,e=>e.kind<310||e.kind>352);return n.kind<167?n:n.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();const t=be(this.getChildren(e));if(t)return t.kind<167?t:t.getLastToken(e)}forEachChild(e,t){return iO(this,e,t)}};function J8(e,t,n,r){for(rX.resetTokenState(t);t"inheritDoc"===e.tagName.text||"inheritdoc"===e.tagName.text)}function G8(e,t){if(!e)return _;let n=$le.getJsDocTagsFromDeclarations(e,t);if(t&&(0===n.length||e.some(K8))){const r=new Set;for(const i of e){const e=Q8(t,i,e=>{var n;if(!r.has(e))return r.add(e),178===i.kind||179===i.kind?e.getContextualJsDocTags(i,t):1===(null==(n=e.declarations)?void 0:n.length)?e.getJsDocTags(t):void 0});e&&(n=[...e,...n])}}return n}function X8(e,t){if(!e)return _;let n=$le.getJsDocCommentsFromDeclarations(e,t);if(t&&(0===n.length||e.some(K8))){const r=new Set;for(const i of e){const e=Q8(t,i,e=>{if(!r.has(e))return r.add(e),178===i.kind||179===i.kind?e.getContextualDocumentationComment(i,t):e.getDocumentationComment(t)});e&&(n=0===n.length?e.slice():e.concat(nZ(),n))}}return n}function Q8(e,t,n){var r;const i=177===(null==(r=t.parent)?void 0:r.kind)?t.parent.parent:t.parent;if(!i)return;const o=Ov(t);return m(Ch(i),r=>{const i=e.getTypeAtLocation(r),a=o&&i.symbol?e.getTypeOfSymbol(i.symbol):i,s=e.getPropertyOfType(a,t.symbol.name);return s?n(s):void 0})}var Y8=class extends B8{constructor(e,t,n){super(e,t,n)}update(e,t){return dO(this,e,t)}getLineAndCharacterOfPosition(e){return Wa(this,e)}getLineStarts(){return za(this)}getPositionOfLineAndCharacter(e,t,n){return Ja(za(this),e,t,this.text,n)}getLineEndOfPosition(e){const{line:t}=this.getLineAndCharacterOfPosition(e),n=this.getLineStarts();let r;t+1>=n.length&&(r=this.getEnd()),r||(r=n[t+1]-1);const i=this.getFullText();return"\n"===i[r]&&"\r"===i[r-1]?r-1:r}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){const e=Ke();return this.forEachChild(function r(i){switch(i.kind){case 263:case 219:case 175:case 174:const o=i,a=n(o);if(a){const t=function(t){let n=e.get(t);n||e.set(t,n=[]);return n}(a),n=be(t);n&&o.parent===n.parent&&o.symbol===n.symbol?o.body&&!n.body&&(t[t.length-1]=o):t.push(o)}iO(i,r);break;case 264:case 232:case 265:case 266:case 267:case 268:case 272:case 282:case 277:case 274:case 275:case 178:case 179:case 188:t(i),iO(i,r);break;case 170:if(!Av(i,31))break;case 261:case 209:{const e=i;if(w_(e.name)){iO(e.name,r);break}e.initializer&&r(e.initializer)}case 307:case 173:case 172:t(i);break;case 279:const s=i;s.exportClause&&(BE(s.exportClause)?p(s.exportClause.elements,r):r(s.exportClause.name));break;case 273:const c=i.importClause;c&&(c.name&&t(c.name),c.namedBindings&&(275===c.namedBindings.kind?t(c.namedBindings):p(c.namedBindings.elements,r)));break;case 227:0!==og(i)&&t(i);default:iO(i,r)}}),e;function t(t){const r=n(t);r&&e.add(r,t)}function n(e){const t=Dc(e);return t&&(ND(t)&&hF(t.expression)?t.expression.name.text:o_(t)?aY(t):void 0)}}},Z8=class{constructor(e,t,n){this.fileName=e,this.text=t,this.skipTrivia=n||(e=>e)}getLineAndCharacterOfPosition(e){return Wa(this,e)}};function e7(e){let t=!0;for(const n in e)if(Ee(e,n)&&!t7(n)){t=!1;break}if(t)return e;const n={};for(const t in e)if(Ee(e,t)){n[t7(t)?t:t.charAt(0).toLowerCase()+t.substr(1)]=e[t]}return n}function t7(e){return!e.length||e.charAt(0)===e.charAt(0).toLowerCase()}function n7(e){return e?P(e,e=>e.text).join(""):""}function r7(){return{target:1,jsx:1}}function i7(){return U7.getSupportedErrorCodes()}var o7=class{constructor(e){this.host=e}getCurrentSourceFile(e){var t,n,r,i,o,a,s,c;const l=this.host.getScriptSnapshot(e);if(!l)throw new Error("Could not find file: '"+e+"'.");const _=cZ(e,this.host),u=this.host.getScriptVersion(e);let d;if(this.currentFileName!==e){d=s7(e,l,{languageVersion:99,impliedNodeFormat:UV(Ho(e,this.host.getCurrentDirectory(),(null==(r=null==(n=(t=this.host).getCompilerHost)?void 0:n.call(t))?void 0:r.getCanonicalFileName)||zy(this.host)),null==(c=null==(s=null==(a=null==(o=(i=this.host).getCompilerHost)?void 0:o.call(i))?void 0:a.getModuleResolutionCache)?void 0:s.call(a))?void 0:c.getPackageJsonInfoCache(),this.host,this.host.getCompilationSettings()),setExternalModuleIndicator:yk(this.host.getCompilationSettings()),jsDocParsingMode:0},u,!0,_)}else if(this.currentFileVersion!==u){const e=l.getChangeRange(this.currentFileScriptSnapshot);d=c7(this.currentSourceFile,l,u,e)}return d&&(this.currentFileVersion=u,this.currentFileName=e,this.currentFileScriptSnapshot=l,this.currentSourceFile=d),this.currentSourceFile}};function a7(e,t,n){e.version=n,e.scriptSnapshot=t}function s7(e,t,n,r,i,o){const a=cO(e,rY(t),n,i,o);return a7(a,t,r),a}function c7(e,t,n,r,i){if(r&&n!==e.version){let o;const a=0!==r.span.start?e.text.substr(0,r.span.start):"",s=Is(r.span)!==e.text.length?e.text.substr(Is(r.span)):"";if(0===r.newLength)o=a&&s?a+s:a||s;else{const e=t.getText(r.span.start,r.span.start+r.newLength);o=a&&s?a+e+s:a?a+e:e+s}const c=dO(e,o,r,i);return a7(c,t,n),c.nameTable=void 0,e!==c&&e.scriptSnapshot&&(e.scriptSnapshot.dispose&&e.scriptSnapshot.dispose(),e.scriptSnapshot=void 0),c}const o={languageVersion:e.languageVersion,impliedNodeFormat:e.impliedNodeFormat,setExternalModuleIndicator:e.setExternalModuleIndicator,jsDocParsingMode:e.jsDocParsingMode};return s7(e.fileName,t,o,n,!0,e.scriptKind)}var l7={isCancellationRequested:at,throwIfCancellationRequested:ot},_7=class{constructor(e){this.cancellationToken=e}isCancellationRequested(){return this.cancellationToken.isCancellationRequested()}throwIfCancellationRequested(){var e;if(this.isCancellationRequested())throw null==(e=Gn)||e.instant(Gn.Phase.Session,"cancellationThrown",{kind:"CancellationTokenObject"}),new Nr}},u7=class{constructor(e,t=20){this.hostCancellationToken=e,this.throttleWaitMilliseconds=t,this.lastCancellationCheckTime=0}isCancellationRequested(){const e=Wn();return Math.abs(e-this.lastCancellationCheckTime)>=this.throttleWaitMilliseconds&&(this.lastCancellationCheckTime=e,this.hostCancellationToken.isCancellationRequested())}throwIfCancellationRequested(){var e;if(this.isCancellationRequested())throw null==(e=Gn)||e.instant(Gn.Phase.Session,"cancellationThrown",{kind:"ThrottledCancellationToken"}),new Nr}},d7=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"],p7=[...d7,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];function f7(e,t=X0(e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames(),e.getCurrentDirectory(),e.jsDocParsingMode),n){var r;let i;i=void 0===n?0:"boolean"==typeof n?n?2:0:n;const o=new o7(e);let a,s,c=0;const l=e.getCancellationToken?new _7(e.getCancellationToken()):l7,u=e.getCurrentDirectory();function d(t){e.log&&e.log(t)}Kx(null==(r=e.getLocalizedDiagnosticMessages)?void 0:r.bind(e));const f=Jy(e),m=Ht(f),g=j1({useCaseSensitiveFileNames:()=>f,getCurrentDirectory:()=>u,getProgram:v,fileExists:He(e,e.fileExists),readFile:He(e,e.readFile),getDocumentPositionMapper:He(e,e.getDocumentPositionMapper),getSourceFileLike:He(e,e.getSourceFileLike),log:d});function h(e){const t=a.getSourceFile(e);if(!t){const t=new Error(`Could not find source file: '${e}'.`);throw t.ProgramFiles=a.getSourceFiles().map(e=>e.fileName),t}return t}function y(){e.updateFromProject&&!e.updateFromProjectInProgress?e.updateFromProject():function(){var n,r,o;if(pn.assert(2!==i),e.getProjectVersion){const t=e.getProjectVersion();if(t){if(s===t&&!(null==(n=e.hasChangedAutomaticTypeDirectiveNames)?void 0:n.call(e)))return;s=t}}const _=e.getTypeRootsVersion?e.getTypeRootsVersion():0;c!==_&&(d("TypeRoots version has changed; provide new program"),a=void 0,c=_);const p=e.getScriptFileNames().slice(),h=e.getCompilationSettings()||{target:1,jsx:1},y=e.hasInvalidatedResolutions||at,v=He(e,e.hasInvalidatedLibResolutions)||at,b=He(e,e.hasChangedAutomaticTypeDirectiveNames),x=null==(r=e.getProjectReferences)?void 0:r.call(e);let k,S={getSourceFile:O,getSourceFileByPath:L,getCancellationToken:()=>l,getCanonicalFileName:m,useCaseSensitiveFileNames:()=>f,getNewLine:()=>jb(h),getDefaultLibFileName:t=>e.getDefaultLibFileName(t),writeFile:ot,getCurrentDirectory:()=>u,fileExists:t=>e.fileExists(t),readFile:t=>e.readFile&&e.readFile(t),getSymlinkCache:He(e,e.getSymlinkCache),realpath:He(e,e.realpath),directoryExists:t=>Ib(t,e),getDirectories:t=>e.getDirectories?e.getDirectories(t):[],readDirectory:(t,n,r,i,o)=>(pn.checkDefined(e.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),e.readDirectory(t,n,r,i,o)),onReleaseOldSourceFile:I,onReleaseParsedCommandLine:P,hasInvalidatedResolutions:y,hasInvalidatedLibResolutions:v,hasChangedAutomaticTypeDirectiveNames:b,trace:He(e,e.trace),resolveModuleNames:He(e,e.resolveModuleNames),getModuleResolutionCache:He(e,e.getModuleResolutionCache),createHash:He(e,e.createHash),resolveTypeReferenceDirectives:He(e,e.resolveTypeReferenceDirectives),resolveModuleNameLiterals:He(e,e.resolveModuleNameLiterals),resolveTypeReferenceDirectiveReferences:He(e,e.resolveTypeReferenceDirectiveReferences),resolveLibrary:He(e,e.resolveLibrary),useSourceOfProjectReferenceRedirect:He(e,e.useSourceOfProjectReferenceRedirect),getParsedCommandLine:F,jsDocParsingMode:e.jsDocParsingMode,getGlobalTypingsCacheLocation:He(e,e.getGlobalTypingsCacheLocation)};const T=S.getSourceFile,{getSourceFileWithCache:C}=rV(S,e=>Ho(e,u,m),(...e)=>T.call(S,...e));S.getSourceFile=C,null==(o=e.setCompilerHost)||o.call(e,S);const w={useCaseSensitiveFileNames:f,fileExists:e=>S.fileExists(e),readFile:e=>S.readFile(e),directoryExists:e=>S.directoryExists(e),getDirectories:e=>S.getDirectories(e),realpath:S.realpath,readDirectory:(...e)=>S.readDirectory(...e),trace:S.trace,getCurrentDirectory:S.getCurrentDirectory,onUnRecoverableConfigFileDiagnostic:ot},N=t.getKeyForCompilationSettings(h);let D=new Set;if(zV(a,p,h,(t,n)=>e.getScriptVersion(n),e=>S.fileExists(e),y,v,b,F,x))return S=void 0,k=void 0,void(D=void 0);return a=$V({rootNames:p,options:h,host:S,oldProgram:a,projectReferences:x}),S=void 0,k=void 0,D=void 0,g.clearCache(),void a.getTypeChecker();function F(t){const n=Ho(t,u,m),r=null==k?void 0:k.get(n);if(void 0!==r)return r||void 0;const i=e.getParsedCommandLine?e.getParsedCommandLine(t):E(t);return(k||(k=new Map)).set(n,i||!1),i}function E(e){const t=O(e,100);if(t)return t.path=Ho(e,u,m),t.resolvedPath=t.path,t.originalFileName=t.fileName,cj(t,w,Uo(Ao(e),u),void 0,Uo(e,u))}function P(t,n,r){var i;e.getParsedCommandLine?null==(i=e.onReleaseParsedCommandLine)||i.call(e,t,n,r):n&&A(n.sourceFile,r)}function A(e,n){const r=t.getKeyForCompilationSettings(n);t.releaseDocumentWithKey(e.resolvedPath,r,e.scriptKind,e.impliedNodeFormat)}function I(t,n,r,i){var o;A(t,n),null==(o=e.onReleaseOldSourceFile)||o.call(e,t,n,r,i)}function O(e,t,n,r){return L(e,Ho(e,u,m),t,n,r)}function L(n,r,i,o,s){pn.assert(S,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");const c=e.getScriptSnapshot(n);if(!c)return;const l=cZ(n,e),_=e.getScriptVersion(n);if(!s){const o=a&&a.getSourceFileByPath(r);if(o){if(l===o.scriptKind||D.has(o.resolvedPath))return t.updateDocumentWithKey(n,r,e,N,c,_,l,i);t.releaseDocumentWithKey(o.resolvedPath,t.getKeyForCompilationSettings(a.getCompilerOptions()),o.scriptKind,o.impliedNodeFormat),D.add(o.resolvedPath)}}return t.acquireDocumentWithKey(n,r,e,N,c,_,l,i)}}()}function v(){if(2!==i)return y(),a;pn.assert(void 0===a)}function b(){if(a){const e=t.getKeyForCompilationSettings(a.getCompilerOptions());p(a.getSourceFiles(),n=>t.releaseDocumentWithKey(n.resolvedPath,e,n.scriptKind,n.impliedNodeFormat)),a=void 0}}function x(e,t){if(Rs(t,e))return;const n=mc(dQ(e,Is(t))||e,e=>Bs(e,t)),r=[];return k(t,n,r),e.end===t.start+t.length&&r.push(e.endOfFileToken),H(r,dP)?void 0:r}function k(e,t,n){return!!function(e,t){const n=t.start+t.length;return e.post.start}(t,e)&&(Rs(e,t)?(S(t,n),!0):y0(t)?function(e,t,n){const r=[],i=t.statements.filter(t=>k(e,t,r));if(i.length===t.statements.length)return S(t,n),!0;return n.push(...r),!1}(e,t,n):m_(t)?function(e,t,n){var r,i,o;const a=t=>$s(t,e);if((null==(r=t.modifiers)?void 0:r.some(a))||t.name&&a(t.name)||(null==(i=t.typeParameters)?void 0:i.some(a))||(null==(o=t.heritageClauses)?void 0:o.some(a)))return S(t,n),!0;const s=[],c=t.members.filter(t=>k(e,t,s));if(c.length===t.members.length)return S(t,n),!0;return n.push(...s),!1}(e,t,n):(S(t,n),!0))}function S(e,t){for(;e.parent&&!vC(e);)e=e.parent;t.push(e)}function T(e,t,n,r){y();const i=n&&n.use===jce.FindReferencesUse.Rename?a.getSourceFiles().filter(e=>!a.isSourceFileDefaultLibrary(e)):a.getSourceFiles();return jce.findReferenceOrRenameEntries(a,l,i,e,t,n,r)}const C=new Map(Object.entries({19:20,21:22,23:24,32:30}));function w(t){return pn.assertEqual(t.type,"install package"),e.installPackage?e.installPackage({fileName:(n=t.file,Ho(n,u,m)),packageName:t.packageName}):Promise.reject("Host does not implement `installPackage`");var n}function N(e,t){return{lineStarts:e.getLineStarts(),firstLine:e.getLineAndCharacterOfPosition(t.pos).line,lastLine:e.getLineAndCharacterOfPosition(t.end).line}}function D(e,t,n){const r=o.getCurrentSourceFile(e),i=[],{lineStarts:a,firstLine:s,lastLine:c}=N(r,t);let l=n||!1,_=Number.MAX_VALUE;const u=new Map,d=new RegExp(/\S/),p=SQ(r,a[s]),f=p?"{/*":"//";for(let e=s;e<=c;e++){const t=r.text.substring(a[e],r.getLineEndOfPosition(a[e])),i=d.exec(t);i&&(_=Math.min(_,i.index),u.set(e.toString(),i.index),t.substr(i.index,f.length)!==f&&(l=void 0===n||n))}for(let n=s;n<=c;n++){if(s!==c&&a[n]===t.end)continue;const o=u.get(n.toString());void 0!==o&&(p?i.push(...F(e,{pos:a[n]+_,end:r.getLineEndOfPosition(a[n])},l,p)):l?i.push({newText:f,span:{length:0,start:a[n]+_}}):r.text.substr(a[n]+o,f.length)===f&&i.push({newText:"",span:{length:f.length,start:a[n]+o}}))}return i}function F(e,t,n,r){var i;const a=o.getCurrentSourceFile(e),s=[],{text:c}=a;let l=!1,_=n||!1;const u=[];let{pos:d}=t;const p=void 0!==r?r:SQ(a,d),f=p?"{/*":"/*",m=p?"*/}":"*/",g=p?"\\{\\/\\*":"\\/\\*",h=p?"\\*\\/\\}":"\\*\\/";for(;d<=t.end;){const e=DQ(a,d+(c.substr(d,f.length)===f?f.length:0));if(e)p&&(e.pos--,e.end++),u.push(e.pos),3===e.kind&&u.push(e.end),l=!0,d=e.end+1;else{const e=c.substring(d,t.end).search(`(${g})|(${h})`);_=void 0!==n?n:_||!IY(c,d,-1===e?t.end:d+e),d=-1===e?t.end+1:d+e+m.length}}if(_||!l){2!==(null==(i=DQ(a,t.pos))?void 0:i.kind)&&te(u,t.pos,xt),te(u,t.end,xt);const e=u[0];c.substr(e,f.length)!==f&&s.push({newText:f,span:{length:0,start:e}});for(let e=1;e0?e-m.length:0,n=c.substr(t,m.length)===m?m.length:0;s.push({newText:"",span:{length:f.length,start:e-n}})}return s}function E({openingElement:e,closingElement:t,parent:n}){return!FO(e.tagName,t.tagName)||$E(n)&&FO(e.tagName,n.openingElement.tagName)&&E(n)}function A({closingFragment:e,parent:t}){return!!(262144&e.flags)||XE(t)&&A(t)}function I(t,n,r,i,o,a){const[s,c]="number"==typeof n?[n,void 0]:[n.pos,n.end];return{file:t,startPosition:s,endPosition:c,program:v(),host:e,formatContext:Ide.getFormatContext(i,e),cancellationToken:l,preferences:r,triggerReason:o,kind:a}}C.forEach((e,t)=>C.set(e.toString(),Number(t)));const O={dispose:function(){b(),e=void 0},cleanupSemanticCache:b,getSyntacticDiagnostics:function(e){return y(),a.getSyntacticDiagnostics(h(e),l).slice()},getSemanticDiagnostics:function(e){y();const t=h(e),n=a.getSemanticDiagnostics(t,l);if(!Ik(a.getCompilerOptions()))return n.slice();const r=a.getDeclarationDiagnostics(t,l);return[...n,...r]},getRegionSemanticDiagnostics:function(e,t){y();const n=h(e),r=a.getCompilerOptions();if(mT(n,r,a)||!yT(n,r)||a.getCachedSemanticDiagnostics(n))return;const i=function(e,t){const n=[],r=Ks(t.map(e=>KQ(e)));for(const t of r){const r=x(e,t);if(!r)return;n.push(...r)}if(!n.length)return;return n}(n,t);if(!i)return;const o=Ks(i.map(e=>Xs(e.getFullStart(),e.getEnd())));return{diagnostics:a.getSemanticDiagnostics(n,l,i).slice(),spans:o}},getSuggestionDiagnostics:function(e){return y(),J1(h(e),a,l)},getCompilerOptionsDiagnostics:function(){return y(),[...a.getOptionsDiagnostics(l),...a.getGlobalDiagnostics(l)]},getSyntacticClassifications:function(e,t){return H0(l,o.getCurrentSourceFile(e),t)},getSemanticClassifications:function(e,t,n){return y(),"2020"===(n||"original")?P8(a,l,h(e),t):z0(a.getTypeChecker(),l,h(e),a.getClassifiableNames(),t)},getEncodedSyntacticClassifications:function(e,t){return K0(l,o.getCurrentSourceFile(e),t)},getEncodedSemanticClassifications:function(e,t,n){return y(),"original"===(n||"original")?U0(a.getTypeChecker(),l,h(e),a.getClassifiableNames(),t):A8(a,l,h(e),t)},getCompletionsAtPosition:function(t,n,r=MG,i){const o={...r,includeCompletionsForModuleExports:r.includeCompletionsForModuleExports||r.includeExternalModuleExports,includeCompletionsWithInsertText:r.includeCompletionsWithInsertText||r.includeInsertTextCompletions};return y(),Oae.getCompletionsAtPosition(e,a,d,h(t),n,o,r.triggerCharacter,r.triggerKind,l,i&&Ide.getFormatContext(i,e),r.includeSymbol)},getCompletionEntryDetails:function(t,n,r,i,o,s=MG,c){return y(),Oae.getCompletionEntryDetails(a,d,h(t),n,{name:r,source:o,data:c},e,i&&Ide.getFormatContext(i,e),s,l)},getCompletionEntrySymbol:function(t,n,r,i,o=MG){return y(),Oae.getCompletionEntrySymbol(a,d,h(t),n,{name:r,source:i},e,o)},getSignatureHelpItems:function(e,t,{triggerReason:n}=MG){y();const r=h(e);return due.getSignatureHelpItems(a,r,t,n,l)},getQuickInfoAtPosition:function(e,t,n,r){y();const i=h(e),o=sQ(i,t);if(o===i)return;const s=a.getTypeChecker(),c=function(e){if(bF(e.parent)&&e.pos===e.parent.pos)return e.parent.expression;if(XD(e.parent)&&e.pos===e.parent.pos)return e.parent;if(mf(e.parent)&&e.parent.name===e)return e.parent;if(rP(e.parent))return e.parent;return e}(o),_=function(e,t){const n=g7(e);if(n){const e=t.getContextualType(n.parent),r=e&&h7(n,t,e,!1);if(r&&1===r.length)return ye(r)}return t.getSymbolAtLocation(e)}(c,s);if(!_||s.isUnknownSymbol(_)){const e=function(e,t,n){switch(t.kind){case 80:return!(16777216&t.flags&&!Om(t)&&(172===t.parent.kind&&t.parent.name===t||mc(t,e=>170===e.kind)))&&(!SX(t)&&!TX(t)&&!wl(t.parent));case 212:case 167:return!DQ(e,n);case 110:case 198:case 108:case 203:return!0;case 237:return mf(t);default:return!1}}(i,c,t)?s.getTypeAtLocation(c):void 0;return e&&{kind:"",kindModifiers:"",textSpan:WQ(c,i),displayParts:s.runWithCancellationToken(l,t=>iZ(t,e,AX(c),void 0,r)),documentation:e.symbol?e.symbol.getDocumentationComment(s):void 0,tags:e.symbol?e.symbol.getJsDocTags(s):void 0}}const{symbolKind:u,displayParts:d,documentation:p,tags:f,canIncreaseVerbosityLevel:m}=s.runWithCancellationToken(l,e=>Gue.getSymbolDisplayPartsDocumentationAndSymbolKind(e,_,i,AX(c),c,void 0,void 0,n??Xu,r));return{kind:u,kindModifiers:Gue.getSymbolModifiers(s,_),textSpan:WQ(c,i),displayParts:d,documentation:p,tags:f,canIncreaseVerbosityLevel:m}},getDefinitionAtPosition:function(e,t,n,r){return y(),Sle.getDefinitionAtPosition(a,h(e),t,n,r)},getDefinitionAndBoundSpan:function(e,t){return y(),Sle.getDefinitionAndBoundSpan(a,h(e),t)},getImplementationAtPosition:function(e,t){return y(),jce.getImplementationsAtPosition(a,l,a.getSourceFiles(),h(e),t)},getTypeDefinitionAtPosition:function(e,t){return y(),Sle.getTypeDefinitionAtPosition(a.getTypeChecker(),h(e),t)},getReferencesAtPosition:function(e,t){return y(),T(sQ(h(e),t),t,{use:jce.FindReferencesUse.References},jce.toReferenceEntry)},findReferences:function(e,t){return y(),jce.findReferencedSymbols(a,l,a.getSourceFiles(),h(e),t)},getFileReferences:function(e){return y(),jce.Core.getReferencesForFileName(e,a,a.getSourceFiles()).map(jce.toReferenceEntry)},getDocumentHighlights:function(e,t,n){const r=Vo(e);pn.assert(n.some(e=>Vo(e)===r)),y();const i=J(n,e=>a.getSourceFile(e)),o=h(e);return L0.getDocumentHighlights(a,l,o,t,i)},getNameOrDottedNameSpan:function(e,t,n){const r=o.getCurrentSourceFile(e),i=sQ(r,t);if(i===r)return;switch(i.kind){case 212:case 167:case 11:case 97:case 112:case 106:case 108:case 110:case 198:case 80:break;default:return}let a=i;for(;;)if(wX(a)||CX(a))a=a.parent;else{if(!DX(a))break;if(268!==a.parent.parent.kind||a.parent.parent.body!==a.parent)break;a=a.parent.parent.name}return Xs(a.getStart(),i.getEnd())},getBreakpointStatementAtPosition:function(e,t){const n=o.getCurrentSourceFile(e);return b7.spanInSourceFileAtLocation(n,t)},getNavigateToItems:function(e,t,n,r=!1,i=!1){return y(),c2(n?[h(n)]:a.getSourceFiles(),a.getTypeChecker(),l,e,t,r,i)},getRenameInfo:function(e,t,n){return y(),oue.getRenameInfo(a,h(e),t,n||{})},getSmartSelectionRange:function(e,t){return Rue.getSmartSelectionRange(t,o.getCurrentSourceFile(e))},findRenameLocations:function(e,t,n,r,i){y();const o=h(e),a=aQ(sQ(o,t));if(oue.nodeIsEligibleForRename(a)){if(uD(a)&&(KE(a.parent)||GE(a.parent))&&Oy(a.escapedText)){const{openingElement:e,closingElement:t}=a.parent.parent;return[e,t].map(e=>{const t=WQ(e.tagName,o);return{fileName:o.fileName,textSpan:t,...jce.toContextSpan(t,o,e.parent)}})}{const e=hY(o,i??MG),s="boolean"==typeof i?i:null==i?void 0:i.providePrefixAndSuffixTextForRename;return T(a,t,{findInStrings:n,findInComments:r,providePrefixAndSuffixTextForRename:s,use:jce.FindReferencesUse.Rename},(t,n,r)=>jce.toRenameLocation(t,n,r,s||!1,e))}}},getNavigationBarItems:function(e){return D2(o.getCurrentSourceFile(e),l)},getNavigationTree:function(e){return F2(o.getCurrentSourceFile(e),l)},getOutliningSpans:function(e){const t=o.getCurrentSourceFile(e);return X_e.collectElements(t,l)},getTodoComments:function(e,t){y();const n=h(e);l.throwIfCancellationRequested();const r=n.text,i=[];if(t.length>0&&!n.fileName.includes("/node_modules/")){const e=function(){const e="("+/(?:^(?:\s|\*)*)/.source+"|"+/(?:\/{2,}\s*)/.source+"|"+/(?:\/\*+\s*)/.source+")",n="(?:"+P(t,e=>"("+(e.text.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")+")")).join("|")+")";return new RegExp(e+"("+n+/(?:.*?)/.source+")"+/(?:$|\*\/)/.source,"gim")}();let a;for(;a=e.exec(r);){l.throwIfCancellationRequested();const e=3;pn.assert(a.length===t.length+e);const s=a[1],c=a.index+s.length;if(!DQ(n,c))continue;let _;for(let n=0;n=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}},getBraceMatchingAtPosition:function(e,t){const n=o.getCurrentSourceFile(e),r=cQ(n,t),i=r.getStart(n)===t?C.get(r.kind.toString()):void 0,a=i&&GX(r.parent,i,n);return a?[WQ(r,n),WQ(a,n)].sort((e,t)=>e.start-t.start):_},getIndentationAtPosition:function(e,t,n){let r=Wn();const i=e7(n),a=o.getCurrentSourceFile(e);d("getIndentationAtPosition: getCurrentSourceFile: "+(Wn()-r)),r=Wn();const s=Ide.SmartIndenter.getIndentation(t,a,i);return d("getIndentationAtPosition: computeIndentation : "+(Wn()-r)),s},getFormattingEditsForRange:function(t,n,r,i){const a=o.getCurrentSourceFile(t);return Ide.formatSelection(n,r,a,Ide.getFormatContext(e7(i),e))},getFormattingEditsForDocument:function(t,n){return Ide.formatDocument(o.getCurrentSourceFile(t),Ide.getFormatContext(e7(n),e))},getFormattingEditsAfterKeystroke:function(t,n,r,i){const a=o.getCurrentSourceFile(t),s=Ide.getFormatContext(e7(i),e);if(!DQ(a,n))switch(r){case"{":return Ide.formatOnOpeningCurly(n,a,s);case"}":return Ide.formatOnClosingCurly(n,a,s);case";":return Ide.formatOnSemicolon(n,a,s);case"\n":return Ide.formatOnEnter(n,a,s)}return[]},getDocCommentTemplateAtPosition:function(t,n,r,i){const a=i?Ide.getFormatContext(i,e).options:void 0;return $le.getDocCommentTemplateAtPosition(tZ(e,a),o.getCurrentSourceFile(t),n,r)},isValidBraceCompletionAtPosition:function(e,t,n){if(60===n)return!1;const r=o.getCurrentSourceFile(e);if(yQ(r,t))return!1;if(vQ(r,t))return 123===n;if(xQ(r,t))return!1;switch(n){case 39:case 34:case 96:return!DQ(r,t)}return!0},getJsxClosingTagAtPosition:function(e,t){const n=o.getCurrentSourceFile(e),r=fQ(t,n);if(!r)return;const i=32===r.kind&&KE(r.parent)?r.parent.parent:GN(r)&&$E(r.parent)?r.parent:void 0;if(i&&E(i))return{newText:``};const a=32===r.kind&&QE(r.parent)?r.parent.parent:GN(r)&&XE(r.parent)?r.parent:void 0;return a&&A(a)?{newText:""}:void 0},getLinkedEditingRangeAtPosition:function(e,t){const n=o.getCurrentSourceFile(e),r=fQ(t,n);if(!r||308===r.parent.kind)return;const i="[a-zA-Z0-9:\\-\\._$]*";if(XE(r.parent.parent)){const e=r.parent.parent.openingFragment,o=r.parent.parent.closingFragment;if(kd(e)||kd(o))return;const a=e.getStart(n)+1,s=o.getStart(n)+2;if(t!==a&&t!==s)return;return{ranges:[{start:a,length:0},{start:s,length:0}],wordPattern:i}}{const e=mc(r.parent,e=>!(!KE(e)&&!GE(e)));if(!e)return;pn.assert(KE(e)||GE(e),"tag should be opening or closing element");const o=e.parent.openingElement,a=e.parent.closingElement,s=o.tagName.getStart(n),c=o.tagName.end,l=a.tagName.getStart(n),_=a.tagName.end;if(s===o.getStart(n)||l===a.getStart(n)||c===o.getEnd()||_===a.getEnd())return;if(!(s<=t&&t<=c||l<=t&&t<=_))return;if(o.tagName.getText(n)!==a.tagName.getText(n))return;return{ranges:[{start:s,length:c-s},{start:l,length:_-l}],wordPattern:i}}},getSpanOfEnclosingComment:function(e,t,n){const r=o.getCurrentSourceFile(e),i=Ide.getRangeOfEnclosingComment(r,t);return!i||n&&3!==i.kind?void 0:KQ(i)},getCodeFixesAtPosition:function(t,n,r,i,o,s=MG){y();const c=h(t),_=Xs(n,r),u=Ide.getFormatContext(o,e);return L(Z(i,ht,xt),t=>(l.throwIfCancellationRequested(),U7.getFixes({errorCode:t,sourceFile:c,span:_,program:a,host:e,cancellationToken:l,formatContext:u,preferences:s})))},getCombinedCodeFix:function(t,n,r,i=MG){y(),pn.assert("file"===t.type);const o=h(t.fileName),s=Ide.getFormatContext(r,e);return U7.getAllFixes({fixId:n,sourceFile:o,program:a,host:e,cancellationToken:l,formatContext:s,preferences:i})},applyCodeActionCommand:function(e,t){const n="string"==typeof e?t:e;return Ze(n)?Promise.all(n.map(e=>w(e))):w(n)},organizeImports:function(t,n,r=MG){y(),pn.assert("file"===t.type);const i=h(t.fileName);if(kd(i))return _;const o=Ide.getFormatContext(n,e),s=t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":"All");return y_e.organizeImports(i,o,e,a,r,s)},getEditsForFileRename:function(t,n,r,i=MG){return e1(v(),t,n,e,Ide.getFormatContext(r,e),i,g)},getEmitOutput:function(t,n,r){y();const i=h(t),o=e.getCustomTransformers&&e.getCustomTransformers();return aW(a,i,!!n,l,o,r)},getNonBoundSourceFile:function(e){return o.getCurrentSourceFile(e)},getProgram:v,getCurrentProgram:()=>a,getAutoImportProvider:function(){var t;return null==(t=e.getPackageJsonAutoImportProvider)?void 0:t.call(e)},updateIsDefinitionOfReferencedSymbols:function(t,n){const r=a.getTypeChecker(),i=function(){for(const i of t)for(const t of i.references){if(n.has(t)){const e=o(t);return pn.assertIsDefined(e),r.getSymbolAtLocation(e)}const i=LY(t,g,He(e,e.fileExists));if(i&&n.has(i)){const e=o(i);if(e)return r.getSymbolAtLocation(e)}}return}();if(!i)return!1;for(const r of t)for(const t of r.references){const r=o(t);if(pn.assertIsDefined(r),n.has(t)||jce.isDeclarationOfSymbol(r,i)){n.add(t),t.isDefinition=!0;const r=LY(t,g,He(e,e.fileExists));r&&n.add(r)}else t.isDefinition=!1}return!0;function o(e){const t=a.getSourceFile(e.fileName);if(!t)return;const n=sQ(t,e.textSpan.start);return jce.Core.getAdjustedNode(n,{use:jce.FindReferencesUse.References})}},getApplicableRefactors:function(e,t,n=MG,r,i,o){y();const a=h(e);return f6.getApplicableRefactors(I(a,t,n,MG,r,i),o)},getEditsForRefactor:function(e,t,n,r,i,o=MG,a){y();const s=h(e);return f6.getEditsForRefactor(I(s,n,o,t),r,i,a)},getMoveToRefactoringFileSuggestions:function(t,n,r=MG){y();const i=h(t),o=pn.checkDefined(a.getSourceFiles()),s=iT(t),c=d3(I(i,n,r,MG)),l=p3(null==c?void 0:c.all),_=J(o,e=>{const t=iT(e.fileName);return!(null==a?void 0:a.isSourceFileFromExternalLibrary(i))&&!(i===h(e.fileName)||".ts"===s&&".d.ts"===t||".d.ts"===s&&Qt(Io(e.fileName),"lib.")&&".d.ts"===t)&&(s===t||(".tsx"===s&&".ts"===t||".jsx"===s&&".js"===t)&&!l)?e.fileName:void 0});return{newFileName:u3(i,a,e,c),files:_}},toLineColumnOffset:function(e,t){return 0===t?{line:0,character:0}:g.toLineColumnOffset(e,t)},getSourceMapper:()=>g,clearSourceMapperCache:()=>g.clearCache(),prepareCallHierarchy:function(e,t){y();const n=k7.resolveCallHierarchyDeclaration(a,sQ(h(e),t));return n&&t0(n,e=>k7.createCallHierarchyItem(a,e))},provideCallHierarchyIncomingCalls:function(e,t){y();const n=h(e),r=n0(k7.resolveCallHierarchyDeclaration(a,0===t?n:sQ(n,t)));return r?k7.getIncomingCalls(a,r,l):[]},provideCallHierarchyOutgoingCalls:function(e,t){y();const n=h(e),r=n0(k7.resolveCallHierarchyDeclaration(a,0===t?n:sQ(n,t)));return r?k7.getOutgoingCalls(a,r):[]},toggleLineComment:D,toggleMultilineComment:F,commentSelection:function(e,t){const n=o.getCurrentSourceFile(e),{firstLine:r,lastLine:i}=N(n,t);return r===i&&t.pos!==t.end?F(e,t,!0):D(e,t,!0)},uncommentSelection:function(e,t){const n=o.getCurrentSourceFile(e),r=[],{pos:i}=t;let{end:a}=t;i===a&&(a+=SQ(n,i)?2:1);for(let t=i;t<=a;t++){const i=DQ(n,t);if(i){switch(i.kind){case 2:r.push(...D(e,{end:i.end,pos:i.pos+1},!1));break;case 3:r.push(...F(e,{end:i.end,pos:i.pos+1},!1))}t=i.end+1}}return r},provideInlayHints:function(t,n,r=MG){y();const i=h(t);return zle.provideInlayHints(function(t,n,r){return{file:t,program:v(),host:e,span:n,preferences:r,cancellationToken:l}}(i,n,r))},getSupportedCodeFixes:i7,preparePasteEditsForFile:function(e,t){return y(),Ife.preparePasteEdits(h(e),t,a.getTypeChecker())},getPasteEdits:function(t,n){return y(),Lfe.pasteEditsProvider(h(t.targetFile),t.pastedText,t.pasteLocations,t.copiedFrom?{file:h(t.copiedFrom.file),range:t.copiedFrom.range}:void 0,e,t.preferences,Ide.getFormatContext(n,e),l)},mapCode:function(t,n,r,i,a){return d_e.mapCode(o.getCurrentSourceFile(t),n,r,e,Ide.getFormatContext(i,e),a)}};switch(i){case 0:break;case 1:d7.forEach(e=>O[e]=()=>{throw new Error(`LanguageService Operation: ${e} not allowed in LanguageServiceMode.PartialSemantic`)});break;case 2:p7.forEach(e=>O[e]=()=>{throw new Error(`LanguageService Operation: ${e} not allowed in LanguageServiceMode.Syntactic`)});break;default:pn.assertNever(i)}return O}function m7(e){return e.nameTable||function(e){const t=e.nameTable=new Map;e.forEachChild(function e(n){if(uD(n)&&!TX(n)&&n.escapedText||Jh(n)&&function(e){return ph(e)||284===e.parent.kind||function(e){return e&&e.parent&&213===e.parent.kind&&e.parent.argumentExpression===e}(e)||mh(e)}(n)){const e=Hh(n);t.set(e,void 0===t.get(e)?n.pos:-1)}else if(dD(n)){const e=n.escapedText;t.set(e,void 0===t.get(e)?n.pos:-1)}if(iO(n,e),Au(n))for(const t of n.jsDoc)iO(t,e)})}(e),e.nameTable}function g7(e){const t=function(e){switch(e.kind){case 11:case 15:case 9:if(168===e.parent.kind)return ju(e.parent.parent)?e.parent.parent:void 0;case 80:case 296:return!ju(e.parent)||211!==e.parent.parent.kind&&293!==e.parent.parent.kind||e.parent.name!==e?void 0:e.parent}return}(e);return t&&(gF(t.parent)||eP(t.parent))?t:void 0}function h7(e,t,n,r){const i=aY(e.name);if(!i)return _;if(!n.isUnion()){const e=n.getProperty(i);return e?[e]:_}const o=gF(e.parent)||eP(e.parent)?D(n.types,n=>!t.isTypeInvalidDueToUnionDiscriminant(n,e.parent)):n.types,a=J(o,e=>e.getProperty(i));if(r&&(0===a.length||a.length===n.types.length)){const e=n.getProperty(i);if(e)return[e]}return o.length||a.length?Z(a,ht):J(n.types,e=>e.getProperty(i))}function y7(e){if(uo)return Jo(Ao(Vo(uo.getExecutingFilePath())),As(e));throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. ")}function v7(e,t,n){const r=[];n=a2(n,r);const i=Ze(e)?e:[e],o=tU(void 0,void 0,bw,n,i,t,!0);return o.diagnostics=G(o.diagnostics,r),o}Wx({getNodeConstructor:()=>B8,getTokenConstructor:()=>U8,getIdentifierConstructor:()=>V8,getPrivateIdentifierConstructor:()=>W8,getSourceFileConstructor:()=>Y8,getSymbolConstructor:()=>q8,getTypeConstructor:()=>$8,getSignatureConstructor:()=>H8,getSourceMapSourceConstructor:()=>Z8});var b7={};function x7(e,t){if(e.isDeclarationFile)return;let n=lQ(e,t);const r=e.getLineAndCharacterOfPosition(t).line;if(e.getLineAndCharacterOfPosition(n.getStart(e)).line>r){const t=fQ(n.pos,e);if(!t||e.getLineAndCharacterOfPosition(t.getEnd()).line!==r)return;n=t}if(!(33554432&n.flags))return l(n);function i(t,n){const r=PI(t)?k(t.modifiers,ED):void 0;return Xs(r?ts(e.text,r.end):t.getStart(e),(n||t).getEnd())}function o(t,n){return i(t,pQ(n,n.parent,e))}function a(t,n){return t&&r===e.getLineAndCharacterOfPosition(t.getStart(e)).line?l(t):l(n)}function s(t){return l(fQ(t.pos,e))}function c(t){return l(pQ(t,t.parent,e))}function l(t){if(t){const{parent:n}=t;switch(t.kind){case 244:return r(t.declarationList.declarations[0]);case 261:case 173:case 172:return r(t);case 170:return function e(t){if(w_(t.name))return f(t.name);if(function(e){return!!e.initializer||void 0!==e.dotDotDotToken||Av(e,3)}(t))return i(t);{const n=t.parent,r=n.parameters.indexOf(t);return pn.assert(-1!==r),0!==r?e(n.parameters[r-1]):l(n.body)}}(t);case 263:case 175:case 174:case 178:case 179:case 177:case 219:case 220:return function(e){if(!e.body)return;if(_(e))return i(e);return l(e.body)}(t);case 242:if(Uf(t))return function(e){const t=e.statements.length?e.statements[0]:e.getLastToken();if(_(e.parent))return a(e.parent,t);return l(t)}(t);case 269:return u(t);case 300:return u(t.block);case 245:return i(t.expression);case 254:return i(t.getChildAt(0),t.expression);case 248:return o(t,t.expression);case 247:return l(t.statement);case 260:return i(t.getChildAt(0));case 246:return o(t,t.expression);case 257:return l(t.statement);case 253:case 252:return i(t.getChildAt(0),t.label);case 249:return function(e){if(e.initializer)return d(e);if(e.condition)return i(e.condition);if(e.incrementor)return i(e.incrementor)}(t);case 250:return o(t,t.expression);case 251:return d(t);case 256:return o(t,t.expression);case 297:case 298:return l(t.statements[0]);case 259:return u(t.tryBlock);case 258:case 278:return i(t,t.expression);case 272:return i(t,t.moduleReference);case 273:case 279:return i(t,t.moduleSpecifier);case 268:if(1!==eB(t))return;case 264:case 267:case 307:case 209:return i(t);case 255:return l(t.statement);case 171:return function(t,n,r){if(t){const i=t.indexOf(n);if(i>=0){let n=i,o=i+1;for(;n>0&&r(t[n-1]);)n--;for(;o0)return l(t.declarations[0])}}function f(e){const t=p(e.elements,e=>233!==e.kind?e:void 0);return t?l(t):209===e.parent.kind?i(e.parent):n(e.parent)}function m(e){pn.assert(208!==e.kind&&207!==e.kind);const t=p(210===e.kind?e.elements:e.properties,e=>233!==e.kind?e:void 0);return t?l(t):i(227===e.parent.kind?e.parent:e)}}}o(b7,{spanInSourceFileAtLocation:()=>x7});var k7={};function S7(e){return AD(e)||fE(e)}function T7(e){return(TF(e)||CF(e)||MF(e))&&S7(e.parent)&&e===e.parent.initializer&&uD(e.parent.name)&&(!!(2&_c(e.parent))||AD(e.parent))}function C7(e){return dP(e)||xE(e)||gE(e)||TF(e)||hE(e)||MF(e)||LD(e)||OD(e)||ID(e)||MD(e)||RD(e)}function w7(e){return dP(e)||xE(e)&&uD(e.name)||gE(e)||hE(e)||LD(e)||OD(e)||ID(e)||MD(e)||RD(e)||function(e){return(TF(e)||MF(e))&&Nc(e)}(e)||T7(e)}function N7(e){return dP(e)?e:Nc(e)?e.name:T7(e)?e.parent.name:pn.checkDefined(e.modifiers&&x(e.modifiers,D7))}function D7(e){return 90===e.kind}function F7(e,t){const n=N7(t);return n&&e.getSymbolAtLocation(n)}function E7(e,t){if(t.body)return t;if(jD(t))return cv(t.parent);if(gE(t)||OD(t)){const n=F7(e,t);return n&&n.valueDeclaration&&l_(n.valueDeclaration)&&n.valueDeclaration.body?n.valueDeclaration:void 0}return t}function P7(e,t){const n=F7(e,t);let r;if(n&&n.declarations){const e=Q(n.declarations),t=P(n.declarations,e=>({file:e.getSourceFile().fileName,pos:e.pos}));e.sort((e,n)=>Nt(t[e].file,t[n].file)||t[e].pos-t[n].pos);const i=P(e,e=>n.declarations[e]);let o;for(const e of i)w7(e)&&(o&&o.parent===e.parent&&o.end===e.pos||(r=ae(r,e)),o=e)}return r}function A7(e,t){return LD(t)?t:l_(t)?E7(e,t)??P7(e,t)??t:P7(e,t)??t}function I7(e,t){const n=e.getTypeChecker();let r=!1;for(;;){if(w7(t))return A7(n,t);if(C7(t)){const e=mc(t,w7);return e&&A7(n,e)}if(ph(t)){if(w7(t.parent))return A7(n,t.parent);if(C7(t.parent)){const e=mc(t.parent,w7);return e&&A7(n,e)}return S7(t.parent)&&t.parent.initializer&&T7(t.parent.initializer)?t.parent.initializer:void 0}if(jD(t))return w7(t.parent)?t.parent:void 0;if(126!==t.kind||!LD(t.parent)){if(fE(t)&&t.initializer&&T7(t.initializer))return t.initializer;if(!r){let e=n.getSymbolAtLocation(t);if(e&&(2097152&e.flags&&(e=n.getAliasedSymbol(e)),e.valueDeclaration)){r=!0,t=e.valueDeclaration;continue}}return}t=t.parent}}function O7(e,t){const n=t.getSourceFile(),r=function(e,t){if(dP(t))return{text:t.fileName,pos:0,end:0};if((gE(t)||hE(t))&&!Nc(t)){const e=t.modifiers&&x(t.modifiers,D7);if(e)return{text:"default",pos:e.getStart(),end:e.getEnd()}}if(LD(t)){const n=ts(t.getSourceFile().text,zb(t).pos),r=n+6,i=e.getTypeChecker(),o=i.getSymbolAtLocation(t.parent);return{text:(o?`${i.symbolToString(o,t.parent)} `:"")+"static {}",pos:n,end:r}}const n=T7(t)?t.parent.name:pn.checkDefined(Fc(t),"Expected call hierarchy item to have a name");let r=uD(n)?bc(n):Jh(n)?n.text:ND(n)&&Jh(n.expression)?n.expression.text:void 0;if(void 0===r){const i=e.getTypeChecker(),o=i.getSymbolAtLocation(n);o&&(r=i.symbolToString(o,t))}if(void 0===r){const e=AU();r=_d(n=>e.writeNode(4,t,t.getSourceFile(),n))}return{text:r,pos:n.getStart(),end:n.getEnd()}}(e,t),i=function(e){var t,n,r,i;if(T7(e))return AD(e.parent)&&m_(e.parent.parent)?MF(e.parent.parent)?null==(t=Ec(e.parent.parent))?void 0:t.getText():null==(n=e.parent.parent.name)?void 0:n.getText():kE(e.parent.parent.parent.parent)&&uD(e.parent.parent.parent.parent.parent.name)?e.parent.parent.parent.parent.parent.name.getText():void 0;switch(e.kind){case 178:case 179:case 175:return 211===e.parent.kind?null==(r=Ec(e.parent))?void 0:r.getText():null==(i=Fc(e.parent))?void 0:i.getText();case 263:case 264:case 268:if(kE(e.parent)&&uD(e.parent.parent.name))return e.parent.parent.name.getText()}}(t),o=IX(t),a=PQ(t),s=Xs(ts(n.text,t.getFullStart(),!1,!0),t.getEnd()),c=Xs(r.pos,r.end);return{file:n.fileName,kind:o,kindModifiers:a,name:r.text,containerName:i,span:s,selectionSpan:c}}function L7(e){return void 0!==e}function j7(e){if(e.kind===jce.EntryKind.Node){const{node:t}=e;if(_X(t,!0,!0)||uX(t,!0,!0)||dX(t,!0,!0)||pX(t,!0,!0)||wX(t)||NX(t)){const e=t.getSourceFile();return{declaration:mc(t,w7)||e,range:HQ(t,e)}}}}function M7(e){return _J(e.declaration)}function R7(e,t,n){if(dP(t)||xE(t)||LD(t))return[];const r=N7(t),i=D(jce.findReferenceOrRenameEntries(e,n,e.getSourceFiles(),r,0,{use:jce.FindReferencesUse.References},j7),L7);return i?qe(i,M7,t=>function(e,t){return n=O7(e,t[0].declaration),r=P(t,e=>KQ(e.range)),{from:n,fromSpans:r};var n,r}(e,t)):[]}function B7(e,t){const n=[],r=function(e,t){function n(n){const r=xF(n)?n.tag:Tu(n)?n.tagName:Dx(n)||LD(n)?n:n.expression,i=I7(e,r);if(i){const e=HQ(r,n.getSourceFile());if(Ze(i))for(const n of i)t.push({declaration:n,range:e});else t.push({declaration:i,range:e})}}return function e(t){if(t&&!(33554432&t.flags))if(w7(t)){if(m_(t))for(const n of t.members)n.name&&ND(n.name)&&e(n.name.expression)}else{switch(t.kind){case 80:case 272:case 273:case 279:case 265:case 266:return;case 176:return void n(t);case 217:case 235:case 239:return void e(t.expression);case 261:case 170:return e(t.name),void e(t.initializer);case 214:case 215:return n(t),e(t.expression),void p(t.arguments,e);case 216:return n(t),e(t.tag),void e(t.template);case 287:case 286:return n(t),e(t.tagName),void e(t.attributes);case 171:return n(t),void e(t.expression);case 212:case 213:n(t),iO(t,e)}Ef(t)||iO(t,e)}}}(e,n);switch(t.kind){case 308:!function(e,t){p(e.statements,t)}(t,r);break;case 268:!function(e,t){!Av(e,128)&&e.body&&kE(e.body)&&p(e.body.statements,t)}(t,r);break;case 263:case 219:case 220:case 175:case 178:case 179:!function(e,t,n){const r=E7(e,t);r&&(p(r.parameters,n),n(r.body))}(e.getTypeChecker(),t,r);break;case 264:case 232:!function(e,t){p(e.modifiers,t);const n=Sh(e);n&&t(n.expression);for(const n of e.members)EI(n)&&p(n.modifiers,t),AD(n)?t(n.initializer):jD(n)&&n.body?(p(n.parameters,t),t(n.body)):LD(n)&&t(n)}(t,r);break;case 176:!function(e,t){t(e.body)}(t,r);break;default:pn.assertNever(t)}return n}function J7(e,t){return 33554432&t.flags||ID(t)?[]:qe(B7(e,t),M7,t=>function(e,t){return n=O7(e,t[0].declaration),r=P(t,e=>KQ(e.range)),{to:n,fromSpans:r};var n,r}(e,t))}o(k7,{createCallHierarchyItem:()=>O7,getIncomingCalls:()=>R7,getOutgoingCalls:()=>J7,resolveCallHierarchyDeclaration:()=>I7});var z7={};o(z7,{v2020:()=>q7});var q7={};o(q7,{TokenEncodingConsts:()=>D8,TokenModifier:()=>E8,TokenType:()=>F8,getEncodedSemanticClassifications:()=>A8,getSemanticClassifications:()=>P8});var U7={};o(U7,{PreserveOptionalFlags:()=>Zie,addNewNodeForMemberSymbol:()=>eoe,codeFixAll:()=>r5,createCodeFixAction:()=>K7,createCodeFixActionMaybeFixAll:()=>G7,createCodeFixActionWithoutFixAll:()=>H7,createCombinedCodeActions:()=>t5,createFileTextChanges:()=>n5,createImportAdder:()=>Dee,createImportSpecifierResolver:()=>Eee,createMissingMemberNodes:()=>Qie,createSignatureDeclarationFromCallExpression:()=>noe,createSignatureDeclarationFromSignature:()=>toe,createStubbedBody:()=>poe,eachDiagnostic:()=>i5,findAncestorMatchingSpan:()=>xoe,generateAccessorFromProperty:()=>koe,getAccessorConvertiblePropertyAtPosition:()=>woe,getAllFixes:()=>e5,getFixes:()=>Z7,getImportCompletionAction:()=>Pee,getImportKind:()=>Hee,getJSDocTypedefNodes:()=>mee,getNoopSymbolTrackerWithResolver:()=>Yie,getPromoteTypeOnlyCompletionAction:()=>Aee,getSupportedErrorCodes:()=>Y7,importFixName:()=>Cee,importSymbols:()=>boe,parameterShouldGetTypeFromJSDoc:()=>K5,registerCodeFix:()=>Q7,setJsonCompilerOptionValue:()=>moe,setJsonCompilerOptionValues:()=>foe,tryGetAutoImportableReferenceFromTypeNode:()=>yoe,typeNodeToAutoImportableTypeNode:()=>ooe,typePredicateToAutoImportableTypeNode:()=>soe,typeToAutoImportableTypeNode:()=>ioe,typeToMinimizedReferenceType:()=>aoe});var V7,W7=Ke(),$7=new Map;function H7(e,t,n){return X7(e,d0(n),t,void 0,void 0)}function K7(e,t,n,r,i,o){return X7(e,d0(n),t,r,d0(i),o)}function G7(e,t,n,r,i,o){return X7(e,d0(n),t,r,i&&d0(i),o)}function X7(e,t,n,r,i,o){return{fixName:e,description:t,changes:n,fixId:r,fixAllDescription:i,commands:o?[o]:void 0}}function Q7(e){for(const t of e.errorCodes)V7=void 0,W7.add(String(t),e);if(e.fixIds)for(const t of e.fixIds)pn.assert(!$7.has(t)),$7.set(t,e)}function Y7(){return V7??(V7=je(W7.keys()))}function Z7(e){const t=o5(e);return L(W7.get(String(e.errorCode)),n=>P(n.getCodeActions(e),function(e,t){const{errorCodes:n}=e;let r=0;for(const e of t)if(C(n,e.code)&&r++,r>1)break;const i=r<2;return({fixId:e,fixAllDescription:t,...n})=>i?n:{...n,fixId:e,fixAllDescription:t}}(n,t)))}function e5(e){return $7.get(it(e.fixId,tt)).getAllCodeActions(e)}function t5(e,t){return{changes:e,commands:t}}function n5(e,t){return{fileName:e,textChanges:t}}function r5(e,t,n){const r=[];return t5(ide.ChangeTracker.with(e,i=>i5(e,t,e=>n(i,e,r))),0===r.length?void 0:r)}function i5(e,t,n){for(const r of o5(e))C(t,r.code)&&n(r)}function o5({program:e,sourceFile:t,cancellationToken:n}){const r=[...e.getSemanticDiagnostics(t,n),...e.getSyntacticDiagnostics(t,n),...J1(t,e,n)];return Ik(e.getCompilerOptions())&&r.push(...e.getDeclarationDiagnostics(t,n)),r}var a5="addConvertToUnknownForNonOverlappingTypes",s5=[fa.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.code];function c5(e,t,n){const r=JF(n)?bw.createAsExpression(n.expression,bw.createKeywordTypeNode(159)):bw.createTypeAssertion(bw.createKeywordTypeNode(159),n.expression);e.replaceNode(t,n.expression,r)}function l5(e,t){if(!Om(e))return mc(lQ(e,t),e=>JF(e)||kF(e))}Q7({errorCodes:s5,getCodeActions:function(e){const t=l5(e.sourceFile,e.span.start);if(void 0===t)return;const n=ide.ChangeTracker.with(e,n=>c5(n,e.sourceFile,t));return[K7(a5,n,fa.Add_unknown_conversion_for_non_overlapping_types,a5,fa.Add_unknown_to_all_conversions_of_non_overlapping_types)]},fixIds:[a5],getAllCodeActions:e=>r5(e,s5,(e,t)=>{const n=l5(t.file,t.start);n&&c5(e,t.file,n)})}),Q7({errorCodes:[fa.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,fa.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,fa.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(e){const{sourceFile:t}=e;return[H7("addEmptyExportDeclaration",ide.ChangeTracker.with(e,e=>{const n=bw.createExportDeclaration(void 0,!1,bw.createNamedExports([]),void 0);e.insertNodeAtEndOfScope(t,t,n)}),fa.Add_export_to_make_this_file_into_a_module)]}});var _5="addMissingAsync",u5=[fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,fa.Type_0_is_not_assignable_to_type_1.code,fa.Type_0_is_not_comparable_to_type_1.code];function d5(e,t,n,r){const i=n(n=>function(e,t,n,r){if(r&&r.has(_J(n)))return;null==r||r.add(_J(n));const i=bw.replaceModifiers(UC(n,!0),bw.createNodeArray(bw.createModifiersFromModifierFlags(1024|$v(n))));e.replaceNode(t,n,i)}(n,e.sourceFile,t,r));return K7(_5,i,fa.Add_async_modifier_to_containing_function,_5,fa.Add_all_missing_async_modifiers)}function p5(e,t){if(!t)return;return mc(lQ(e,t.start),n=>n.getStart(e)Is(t)?"quit":(CF(n)||OD(n)||TF(n)||gE(n))&&FY(t,WQ(n,e)))}Q7({fixIds:[_5],errorCodes:u5,getCodeActions:function(e){const{sourceFile:t,errorCode:n,cancellationToken:r,program:i,span:o}=e,a=x(i.getTypeChecker().getDiagnostics(t,r),function(e,t){return({start:n,length:r,relatedInformation:i,code:o})=>nt(n)&&nt(r)&&FY({start:n,length:r},e)&&o===t&&!!i&&H(i,e=>e.code===fa.Did_you_mean_to_mark_this_function_as_async.code)}(o,n)),s=p5(t,a&&a.relatedInformation&&x(a.relatedInformation,e=>e.code===fa.Did_you_mean_to_mark_this_function_as_async.code));if(!s)return;return[d5(e,s,t=>ide.ChangeTracker.with(e,t))]},getAllCodeActions:e=>{const{sourceFile:t}=e,n=new Set;return r5(e,u5,(r,i)=>{const o=i.relatedInformation&&x(i.relatedInformation,e=>e.code===fa.Did_you_mean_to_mark_this_function_as_async.code),a=p5(t,o);if(!a)return;return d5(e,a,e=>(e(r),[]),n)})}});var f5="addMissingAwait",m5=fa.Property_0_does_not_exist_on_type_1.code,g5=[fa.This_expression_is_not_callable.code,fa.This_expression_is_not_constructable.code],h5=[fa.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,fa.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,fa.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,fa.Operator_0_cannot_be_applied_to_type_1.code,fa.Operator_0_cannot_be_applied_to_types_1_and_2.code,fa.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code,fa.This_condition_will_always_return_true_since_this_0_is_always_defined.code,fa.Type_0_is_not_an_array_type.code,fa.Type_0_is_not_an_array_type_or_a_string_type.code,fa.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,fa.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,fa.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,fa.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,fa.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,m5,...g5];function y5(e,t,n,r,i){const o=e0(e,n);return o&&function(e,t,n,r,i){const o=i.getTypeChecker(),a=o.getDiagnostics(e,r);return H(a,({start:e,length:r,relatedInformation:i,code:o})=>nt(e)&&nt(r)&&FY({start:e,length:r},n)&&o===t&&!!i&&H(i,e=>e.code===fa.Did_you_forget_to_use_await.code))}(e,t,n,r,i)&&k5(o)?o:void 0}function v5(e,t,n,r,i,o){const{sourceFile:a,program:s,cancellationToken:c}=e,l=function(e,t,n,r,i){const o=function(e,t){if(hF(e.parent)&&uD(e.parent.expression))return{identifiers:[e.parent.expression],isCompleteFix:!0};if(uD(e))return{identifiers:[e],isCompleteFix:!0};if(AF(e)){let n,r=!0;for(const i of[e.left,e.right]){const e=t.getTypeAtLocation(i);if(t.getPromisedTypeOfPromise(e)){if(!uD(i)){r=!1;continue}(n||(n=[])).push(i)}}return n&&{identifiers:n,isCompleteFix:r}}}(e,i);if(!o)return;let a,s=o.isCompleteFix;for(const e of o.identifiers){const o=i.getSymbolAtLocation(e);if(!o)continue;const c=rt(o.valueDeclaration,fE),l=c&&rt(c.name,uD),_=Dh(c,244);if(!c||!_||c.type||!c.initializer||_.getSourceFile()!==t||Av(_,32)||!l||!k5(c.initializer)){s=!1;continue}const u=r.getSemanticDiagnostics(t,n);jce.Core.eachSymbolReferenceInFile(l,i,t,n=>e!==n&&!x5(n,u,t,i))?s=!1:(a||(a=[])).push({expression:c.initializer,declarationSymbol:o})}return a&&{initializers:a,needsSecondPassForFixAll:!s}}(t,a,c,s,r);if(l){return H7("addMissingAwaitToInitializer",i(e=>{p(l.initializers,({expression:t})=>S5(e,n,a,r,t,o)),o&&l.needsSecondPassForFixAll&&S5(e,n,a,r,t,o)}),1===l.initializers.length?[fa.Add_await_to_initializer_for_0,l.initializers[0].declarationSymbol.name]:fa.Add_await_to_initializers)}}function b5(e,t,n,r,i,o){const a=i(i=>S5(i,n,e.sourceFile,r,t,o));return K7(f5,a,fa.Add_await,f5,fa.Fix_all_expressions_possibly_missing_await)}function x5(e,t,n,r){const i=hF(e.parent)?e.parent.name:AF(e.parent)?e.parent:e,o=x(t,e=>e.start===i.getStart(n)&&e.start+e.length===i.getEnd());return o&&C(h5,o.code)||1&r.getTypeAtLocation(i).flags}function k5(e){return 65536&e.flags||!!mc(e,e=>e.parent&&CF(e.parent)&&e.parent.body===e||GF(e)&&(263===e.parent.kind||219===e.parent.kind||220===e.parent.kind||175===e.parent.kind))}function S5(e,t,n,r,i,o){if(iE(i.parent)&&!i.parent.awaitModifier){const t=r.getTypeAtLocation(i),o=r.getAnyAsyncIterableType();if(o&&r.isTypeAssignableTo(t,o)){const t=i.parent;return void e.replaceNode(n,t,bw.updateForOfStatement(t,bw.createToken(135),t.initializer,t.expression,t.statement))}}if(AF(i))for(const t of[i.left,i.right]){if(o&&uD(t)){const e=r.getSymbolAtLocation(t);if(e&&o.has(uJ(e)))continue}const i=r.getTypeAtLocation(t),a=r.getPromisedTypeOfPromise(i)?bw.createAwaitExpression(t):t;e.replaceNode(n,t,a)}else if(t===m5&&hF(i.parent)){if(o&&uD(i.parent.expression)){const e=r.getSymbolAtLocation(i.parent.expression);if(e&&o.has(uJ(e)))return}e.replaceNode(n,i.parent.expression,bw.createParenthesizedExpression(bw.createAwaitExpression(i.parent.expression))),T5(e,i.parent.expression,n)}else if(C(g5,t)&&J_(i.parent)){if(o&&uD(i)){const e=r.getSymbolAtLocation(i);if(e&&o.has(uJ(e)))return}e.replaceNode(n,i,bw.createParenthesizedExpression(bw.createAwaitExpression(i))),T5(e,i,n)}else{if(o&&fE(i.parent)&&uD(i.parent.name)){const e=r.getSymbolAtLocation(i.parent.name);if(e&&!U(o,uJ(e)))return}e.replaceNode(n,i,bw.createAwaitExpression(i))}}function T5(e,t,n){const r=fQ(t.pos,n);r&&jZ(r.end,r.parent,n)&&e.insertText(n,t.getStart(n),";")}Q7({fixIds:[f5],errorCodes:h5,getCodeActions:function(e){const{sourceFile:t,errorCode:n,span:r,cancellationToken:i,program:o}=e,a=y5(t,n,r,i,o);if(!a)return;const s=e.program.getTypeChecker(),c=t=>ide.ChangeTracker.with(e,t);return ie([v5(e,a,n,s,c),b5(e,a,n,s,c)])},getAllCodeActions:e=>{const{sourceFile:t,program:n,cancellationToken:r}=e,i=e.program.getTypeChecker(),o=new Set;return r5(e,h5,(a,s)=>{const c=y5(t,s.code,s,r,n);if(!c)return;const l=e=>(e(a),[]);return v5(e,c,s.code,i,l,o)||b5(e,c,s.code,i,l,o)})}});var C5="addMissingConst",w5=[fa.Cannot_find_name_0.code,fa.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];function N5(e,t,n,r,i){const o=lQ(t,n),a=mc(o,e=>tu(e.parent)?e.parent.initializer===e:!function(e){switch(e.kind){case 80:case 210:case 211:case 304:case 305:return!0;default:return!1}}(e)&&"quit");if(a)return D5(e,a,t,i);const s=o.parent;if(AF(s)&&64===s.operatorToken.kind&&YF(s.parent))return D5(e,o,t,i);if(mF(s)){const n=r.getTypeChecker();if(!b(s.elements,e=>function(e,t){const n=uD(e)?e:cb(e,!0)&&uD(e.left)?e.left:void 0;return!!n&&!t.getSymbolAtLocation(n)}(e,n)))return;return D5(e,s,t,i)}const c=mc(o,e=>!!YF(e.parent)||!function(e){switch(e.kind){case 80:case 227:case 28:return!0;default:return!1}}(e)&&"quit");if(c){if(!F5(c,r.getTypeChecker()))return;return D5(e,c,t,i)}}function D5(e,t,n,r){r&&!U(r,t)||e.insertModifierBefore(n,87,t)}function F5(e,t){return!!AF(e)&&(28===e.operatorToken.kind?b([e.left,e.right],e=>F5(e,t)):64===e.operatorToken.kind&&uD(e.left)&&!t.getSymbolAtLocation(e.left))}Q7({errorCodes:w5,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>N5(t,e.sourceFile,e.span.start,e.program));if(t.length>0)return[K7(C5,t,fa.Add_const_to_unresolved_variable,C5,fa.Add_const_to_all_unresolved_variables)]},fixIds:[C5],getAllCodeActions:e=>{const t=new Set;return r5(e,w5,(n,r)=>N5(n,r.file,r.start,e.program,t))}});var E5="addMissingDeclareProperty",P5=[fa.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.code];function A5(e,t,n,r){const i=lQ(t,n);if(!uD(i))return;const o=i.parent;173!==o.kind||r&&!U(r,o)||e.insertModifierBefore(t,138,o)}Q7({errorCodes:P5,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>A5(t,e.sourceFile,e.span.start));if(t.length>0)return[K7(E5,t,fa.Prefix_with_declare,E5,fa.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[E5],getAllCodeActions:e=>{const t=new Set;return r5(e,P5,(e,n)=>A5(e,n.file,n.start,t))}});var I5="addMissingInvocationForDecorator",O5=[fa._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];function L5(e,t,n){const r=mc(lQ(t,n),ED);pn.assert(!!r,"Expected position to be owned by a decorator.");const i=bw.createCallExpression(r.expression,void 0,void 0);e.replaceNode(t,r.expression,i)}Q7({errorCodes:O5,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>L5(t,e.sourceFile,e.span.start));return[K7(I5,t,fa.Call_decorator_expression,I5,fa.Add_to_all_uncalled_decorators)]},fixIds:[I5],getAllCodeActions:e=>r5(e,O5,(e,t)=>L5(e,t.file,t.start))});var j5="addMissingResolutionModeImportAttribute",M5=[fa.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code,fa.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code];function R5(e,t,n,r,i,o){var a,s,c;const l=mc(lQ(t,n),nn(wE,lF));pn.assert(!!l,"Expected position to be owned by an ImportDeclaration or ImportType.");const _=0===hY(t,o),u=kg(l),d=!u||(null==(a=HM(u.text,t.fileName,r.getCompilerOptions(),i,r.getModuleResolutionCache(),void 0,99).resolvedModule)?void 0:a.resolvedFileName)===(null==(c=null==(s=r.getResolvedModuleFromModuleSpecifier(u,t))?void 0:s.resolvedModule)?void 0:c.resolvedFileName),p=l.attributes?bw.updateImportAttributes(l.attributes,bw.createNodeArray([...l.attributes.elements,bw.createImportAttribute(bw.createStringLiteral("resolution-mode",_),bw.createStringLiteral(d?"import":"require",_))],l.attributes.elements.hasTrailingComma),l.attributes.multiLine):bw.createImportAttributes(bw.createNodeArray([bw.createImportAttribute(bw.createStringLiteral("resolution-mode",_),bw.createStringLiteral(d?"import":"require",_))]));273===l.kind?e.replaceNode(t,l,bw.updateImportDeclaration(l,l.modifiers,l.importClause,l.moduleSpecifier,p)):e.replaceNode(t,l,bw.updateImportTypeNode(l,l.argument,p,l.qualifier,l.typeArguments))}Q7({errorCodes:M5,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>R5(t,e.sourceFile,e.span.start,e.program,e.host,e.preferences));return[K7(j5,t,fa.Add_resolution_mode_import_attribute,j5,fa.Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it)]},fixIds:[j5],getAllCodeActions:e=>r5(e,M5,(t,n)=>R5(t,n.file,n.start,e.program,e.host,e.preferences))});var B5="addNameToNamelessParameter",J5=[fa.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];function z5(e,t,n){const r=lQ(t,n),i=r.parent;if(!FD(i))return pn.fail("Tried to add a parameter name to a non-parameter: "+pn.formatSyntaxKind(r.kind));const o=i.parent.parameters.indexOf(i);pn.assert(!i.type,"Tried to add a parameter name to a parameter that already had one."),pn.assert(o>-1,"Parameter not found in parent parameter list.");let a=i.name.getEnd(),s=bw.createTypeReferenceNode(i.name,void 0),c=q5(t,i);for(;c;)s=bw.createArrayTypeNode(s),a=c.getEnd(),c=q5(t,c);const l=bw.createParameterDeclaration(i.modifiers,i.dotDotDotToken,"arg"+o,i.questionToken,i.dotDotDotToken&&!KD(s)?bw.createArrayTypeNode(s):s,i.initializer);e.replaceRange(t,Mb(i.getStart(t),a),l)}function q5(e,t){const n=pQ(t.name,t.parent,e);if(n&&23===n.kind&&pF(n.parent)&&FD(n.parent.parent))return n.parent.parent}Q7({errorCodes:J5,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>z5(t,e.sourceFile,e.span.start));return[K7(B5,t,fa.Add_parameter_name,B5,fa.Add_names_to_all_parameters_without_names)]},fixIds:[B5],getAllCodeActions:e=>r5(e,J5,(e,t)=>z5(e,t.file,t.start))});var U5="addOptionalPropertyUndefined";function V5(e,t){var n;if(e){if(AF(e.parent)&&64===e.parent.operatorToken.kind)return{source:e.parent.right,target:e.parent.left};if(fE(e.parent)&&e.parent.initializer)return{source:e.parent.initializer,target:e.parent.name};if(vF(e.parent)){const n=t.getSymbolAtLocation(e.parent.expression);if(!(null==n?void 0:n.valueDeclaration)||!d_(n.valueDeclaration.kind))return;if(!K_(e))return;const r=e.parent.arguments.indexOf(e);if(-1===r)return;const i=n.valueDeclaration.parameters[r].name;if(uD(i))return{source:e,target:i}}else if(cP(e.parent)&&uD(e.parent.name)||lP(e.parent)){const r=V5(e.parent.parent,t);if(!r)return;const i=t.getPropertyOfType(t.getTypeAtLocation(r.target),e.parent.name.text),o=null==(n=null==i?void 0:i.declarations)?void 0:n[0];if(!o)return;return{source:cP(e.parent)?e.parent.initializer:e.parent.name,target:o}}}}Q7({errorCodes:[fa.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,fa.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code],getCodeActions(e){const t=e.program.getTypeChecker(),n=function(e,t,n){var r,i;const o=V5(e0(e,t),n);if(!o)return _;const{source:a,target:s}=o,c=function(e,t,n){return hF(t)&&!!n.getExactOptionalProperties(n.getTypeAtLocation(t.expression)).length&&n.getTypeAtLocation(e)===n.getUndefinedType()}(a,s,n)?n.getTypeAtLocation(s.expression):n.getTypeAtLocation(s);if(null==(i=null==(r=c.symbol)?void 0:r.declarations)?void 0:i.some(e=>Sd(e).fileName.match(/\.d\.ts$/)))return _;return n.getExactOptionalProperties(c)}(e.sourceFile,e.span,t);if(!n.length)return;const r=ide.ChangeTracker.with(e,e=>function(e,t){for(const n of t){const t=n.valueDeclaration;if(t&&(PD(t)||AD(t))&&t.type){const n=bw.createUnionTypeNode([...193===t.type.kind?t.type.types:[t.type],bw.createTypeReferenceNode("undefined")]);e.replaceNode(t.getSourceFile(),t.type,n)}}}(e,n));return[H7(U5,r,fa.Add_undefined_to_optional_property_type)]},fixIds:[U5]});var W5="annotateWithTypeFromJSDoc",$5=[fa.JSDoc_types_may_be_moved_to_TypeScript_types.code];function H5(e,t){const n=lQ(e,t);return rt(FD(n.parent)?n.parent.parent:n.parent,K5)}function K5(e){return function(e){return l_(e)||261===e.kind||172===e.kind||173===e.kind}(e)&&G5(e)}function G5(e){return l_(e)?e.parameters.some(G5)||!e.type&&!!sl(e):!e.type&&!!al(e)}function X5(e,t,n){if(l_(n)&&(sl(n)||n.parameters.some(e=>!!al(e)))){if(!n.typeParameters){const r=xv(n);r.length&&e.insertTypeParameters(t,n,r)}const r=CF(n)&&!GX(n,21,t);r&&e.insertNodeBefore(t,ye(n.parameters),bw.createToken(21));for(const r of n.parameters)if(!r.type){const n=al(r);n&&e.tryInsertTypeAnnotation(t,r,bJ(n,Q5,T_))}if(r&&e.insertNodeAfter(t,xe(n.parameters),bw.createToken(22)),!n.type){const r=sl(n);r&&e.tryInsertTypeAnnotation(t,n,bJ(r,Q5,T_))}}else{const r=pn.checkDefined(al(n),"A JSDocType for this declaration should exist");pn.assert(!n.type,"The JSDocType decl should have a type"),e.tryInsertTypeAnnotation(t,n,bJ(r,Q5,T_))}}function Q5(e){switch(e.kind){case 313:case 314:return bw.createTypeReferenceNode("any",_);case 317:return function(e){return bw.createUnionTypeNode([bJ(e.type,Q5,T_),bw.createTypeReferenceNode("undefined",_)])}(e);case 316:return Q5(e.type);case 315:return function(e){return bw.createUnionTypeNode([bJ(e.type,Q5,T_),bw.createTypeReferenceNode("null",_)])}(e);case 319:return function(e){return bw.createArrayTypeNode(bJ(e.type,Q5,T_))}(e);case 318:return function(e){return bw.createFunctionTypeNode(_,e.parameters.map(Y5),e.type??bw.createKeywordTypeNode(133))}(e);case 184:return function(e){let t=e.typeName,n=e.typeArguments;if(uD(e.typeName)){if(Rm(e))return function(e){const t=bw.createParameterDeclaration(void 0,void 0,150===e.typeArguments[0].kind?"n":"s",void 0,bw.createTypeReferenceNode(150===e.typeArguments[0].kind?"number":"string",[]),void 0),n=bw.createTypeLiteralNode([bw.createIndexSignature(void 0,[t],e.typeArguments[1])]);return ww(n,1),n}(e);let r=e.typeName.text;switch(e.typeName.text){case"String":case"Boolean":case"Object":case"Number":r=r.toLowerCase();break;case"array":case"date":case"promise":r=r[0].toUpperCase()+r.slice(1)}t=bw.createIdentifier(r),n="Array"!==r&&"Promise"!==r||e.typeArguments?xJ(e.typeArguments,Q5,T_):bw.createNodeArray([bw.createTypeReferenceNode("any",_)])}return bw.createTypeReferenceNode(t,n)}(e);case 323:return function(e){const t=bw.createTypeLiteralNode(P(e.jsDocPropertyTags,e=>bw.createPropertySignature(void 0,uD(e.name)?e.name:e.name.right,QT(e)?bw.createToken(58):void 0,e.typeExpression&&bJ(e.typeExpression.type,Q5,T_)||bw.createKeywordTypeNode(133))));return ww(t,1),t}(e);default:const t=EJ(e,Q5,void 0);return ww(t,1),t}}function Y5(e){const t=e.parent.parameters.indexOf(e),n=319===e.type.kind&&t===e.parent.parameters.length-1,r=e.name||(n?"rest":"arg"+t),i=n?bw.createToken(26):e.dotDotDotToken;return bw.createParameterDeclaration(e.modifiers,i,r,e.questionToken,bJ(e.type,Q5,T_),e.initializer)}Q7({errorCodes:$5,getCodeActions(e){const t=H5(e.sourceFile,e.span.start);if(!t)return;const n=ide.ChangeTracker.with(e,n=>X5(n,e.sourceFile,t));return[K7(W5,n,fa.Annotate_with_type_from_JSDoc,W5,fa.Annotate_everything_with_types_from_JSDoc)]},fixIds:[W5],getAllCodeActions:e=>r5(e,$5,(e,t)=>{const n=H5(t.file,t.start);n&&X5(e,t.file,n)})});var Z5="convertFunctionToEs6Class",e9=[fa.This_constructor_function_may_be_converted_to_a_class_declaration.code];function t9(e,t,n,r,i,o){const a=r.getSymbolAtLocation(lQ(t,n));if(!(a&&a.valueDeclaration&&19&a.flags))return;const s=a.valueDeclaration;if(gE(s)||TF(s))e.replaceNode(t,s,function(e){const t=c(a);e.body&&t.unshift(bw.createConstructorDeclaration(void 0,e.parameters,e.body));const n=n9(e,95);return bw.createClassDeclaration(n,e.name,void 0,void 0,t)}(s));else if(fE(s)){const n=function(e){const t=e.initializer;if(!t||!TF(t)||!uD(e.name))return;const n=c(e.symbol);t.body&&n.unshift(bw.createConstructorDeclaration(void 0,t.parameters,t.body));const r=n9(e.parent.parent,95);return bw.createClassDeclaration(r,e.name,void 0,void 0,n)}(s);if(!n)return;const r=s.parent.parent;mE(s.parent)&&s.parent.declarations.length>1?(e.delete(t,s),e.insertNodeAfter(t,r,n)):e.replaceNode(t,r,n)}function c(n){const r=[];return n.exports&&n.exports.forEach(e=>{if("prototype"===e.name&&e.declarations){const t=e.declarations[0];if(1===e.declarations.length&&hF(t)&&AF(t.parent)&&64===t.parent.operatorToken.kind&&gF(t.parent.right)){a(t.parent.right.symbol,void 0,r)}}else a(e,[bw.createToken(126)],r)}),n.members&&n.members.forEach((i,o)=>{var s,c,l,_;if("constructor"===o&&i.valueDeclaration){const r=null==(_=null==(l=null==(c=null==(s=n.exports)?void 0:s.get("prototype"))?void 0:c.declarations)?void 0:l[0])?void 0:_.parent;return void(r&&AF(r)&&gF(r.right)&&H(r.right.properties,r9)||e.delete(t,i.valueDeclaration.parent))}a(i,void 0,r)}),r;function a(n,r,a){if(!(8192&n.flags||4096&n.flags))return;const s=n.valueDeclaration,c=s.parent,l=c.right;if(u=l,!(Dx(_=s)?hF(_)&&r9(_)||s_(u):b(_.properties,e=>!!(OD(e)||hl(e)||cP(e)&&TF(e.initializer)&&e.name||r9(e)))))return;var _,u;if(H(a,e=>{const t=Fc(e);return!(!t||!uD(t)||bc(t)!==kc(n))}))return;const d=c.parent&&245===c.parent.kind?c.parent:c;if(e.delete(t,d),l){if(Dx(s)&&(TF(l)||CF(l))){const e=hY(t,i),n=function(e,t,n){if(hF(e))return e.name;const r=e.argumentExpression;if($N(r))return r;if(Ju(r))return vs(r.text,Sk(t))?bw.createIdentifier(r.text):QN(r)?bw.createStringLiteral(r.text,0===n):r;return}(s,o,e);return void(n&&f(a,l,n))}if(!gF(l)){if(Im(t))return;if(!hF(s))return;const e=bw.createPropertyDeclaration(r,s.name,void 0,void 0,l);return hZ(c.parent,e,t),void a.push(e)}p(l.properties,e=>{(OD(e)||hl(e))&&a.push(e),cP(e)&&TF(e.initializer)&&f(a,e.initializer,e.name),r9(e)})}else a.push(bw.createPropertyDeclaration(r,n.name,void 0,void 0,void 0));function f(e,n,i){return TF(n)?function(e,n,i){const o=G(r,n9(n,134)),a=bw.createMethodDeclaration(o,void 0,i,void 0,void 0,n.parameters,void 0,n.body);return hZ(c,a,t),void e.push(a)}(e,n,i):function(e,n,i){const o=n.body;let a;a=242===o.kind?o:bw.createBlock([bw.createReturnStatement(o)]);const s=G(r,n9(n,134)),l=bw.createMethodDeclaration(s,void 0,i,void 0,void 0,n.parameters,void 0,a);hZ(c,l,t),e.push(l)}(e,n,i)}}}}function n9(e,t){return EI(e)?D(e.modifiers,e=>e.kind===t):void 0}function r9(e){return!!e.name&&!(!uD(e.name)||"constructor"!==e.name.text)}Q7({errorCodes:e9,getCodeActions(e){const t=ide.ChangeTracker.with(e,t=>t9(t,e.sourceFile,e.span.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions()));return[K7(Z5,t,fa.Convert_function_to_an_ES2015_class,Z5,fa.Convert_all_constructor_functions_to_classes)]},fixIds:[Z5],getAllCodeActions:e=>r5(e,e9,(t,n)=>t9(t,n.file,n.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions()))});var i9="convertToAsyncFunction",o9=[fa.This_may_be_converted_to_an_async_function.code],a9=!0;function s9(e,t,n,r){const i=lQ(t,n);let o;if(o=uD(i)&&fE(i.parent)&&i.parent.initializer&&l_(i.parent.initializer)?i.parent.initializer:rt(Yf(lQ(t,n)),X1),!o)return;const a=new Map,s=Om(o),c=function(e,t){if(!e.body)return new Set;const n=new Set;return iO(e.body,function e(r){c9(r,t,"then")?(n.add(_J(r)),p(r.arguments,e)):c9(r,t,"catch")||c9(r,t,"finally")?(n.add(_J(r)),iO(r,e)):u9(r,t)?n.add(_J(r)):iO(r,e)}),n}(o,r),l=function(e,t,n){const r=new Map,i=Ke();return iO(e,function e(o){if(!uD(o))return void iO(o,e);const a=t.getSymbolAtLocation(o);if(a){const e=T9(t.getTypeAtLocation(o),t),s=uJ(a).toString();if(!e||FD(o.parent)||l_(o.parent)||n.has(s)){if(o.parent&&(FD(o.parent)||fE(o.parent)||fF(o.parent))){const e=o.text,t=i.get(e);if(t&&t.some(e=>e!==a)){const t=d9(o,i);r.set(s,t.identifier),n.set(s,t),i.add(e,a)}else{const t=UC(o);n.set(s,D9(t)),i.add(e,a)}}}else{const t=ge(e.parameters),r=(null==t?void 0:t.valueDeclaration)&&FD(t.valueDeclaration)&&rt(t.valueDeclaration.name,uD)||bw.createUniqueName("result",16),o=d9(r,i);n.set(s,o),i.add(r.text,a)}}}),VC(e,!0,e=>{if(fF(e)&&uD(e.name)&&dF(e.parent)){const n=t.getSymbolAtLocation(e.name),i=n&&r.get(String(uJ(n)));if(i&&i.text!==(e.name||e.propertyName).getText())return bw.createBindingElement(e.dotDotDotToken,e.propertyName||e.name,i,e.initializer)}else if(uD(e)){const n=t.getSymbolAtLocation(e),i=n&&r.get(String(uJ(n)));if(i)return bw.createIdentifier(i.text)}})}(o,r,a);if(!U1(l,r))return;const u=l.body&&GF(l.body)?function(e,t){const n=[];return Af(e,e=>{V1(e,t)&&n.push(e)}),n}(l.body,r):_,d={checker:r,synthNamesMap:a,setOfExpressionsToReturn:c,isInJSFile:s};if(!u.length)return;const f=ts(t.text,zb(o).pos);e.insertModifierAt(t,f,134,{suffix:" "});for(const n of u)if(iO(n,function r(i){if(vF(i)){const r=m9(i,i,d,!1);if(p9())return!0;e.replaceNodeWithNodes(t,n,r)}else if(!s_(i)&&(iO(i,r),p9()))return!0}),p9())return}function c9(e,t,n){if(!vF(e))return!1;const r=bX(e,n)&&t.getTypeAtLocation(e);return!(!r||!t.getPromisedTypeOfPromise(r))}function l9(e,t){return!!(4&xx(e))&&e.target===t}function _9(e,t,n){if("finally"===e.expression.name.escapedText)return;const r=n.getTypeAtLocation(e.expression.expression);if(l9(r,n.getPromiseType())||l9(r,n.getPromiseLikeType())){if("then"!==e.expression.name.escapedText)return me(e.typeArguments,0);if(t===me(e.arguments,0))return me(e.typeArguments,0);if(t===me(e.arguments,1))return me(e.typeArguments,1)}}function u9(e,t){return!!K_(e)&&!!t.getPromisedTypeOfPromise(t.getTypeAtLocation(e))}function d9(e,t){const n=(t.get(e.text)||_).length;return D9(0===n?e:bw.createIdentifier(e.text+"_"+n))}function p9(){return!a9}function f9(){return a9=!1,_}function m9(e,t,n,r,i){if(c9(t,n.checker,"then"))return function(e,t,n,r,i,o){if(!t||g9(r,t))return v9(e,n,r,i,o);if(n&&!g9(r,n))return f9();const a=w9(t,r),s=m9(e.expression.expression,e.expression.expression,r,!0,a);if(p9())return f9();const c=k9(t,i,o,a,e,r);return p9()?f9():G(s,c)}(t,me(t.arguments,0),me(t.arguments,1),n,r,i);if(c9(t,n.checker,"catch"))return v9(t,me(t.arguments,0),n,r,i);if(c9(t,n.checker,"finally"))return function(e,t,n,r,i){if(!t||g9(n,t))return m9(e,e.expression.expression,n,r,i);const o=h9(e,n,i),a=m9(e,e.expression.expression,n,!0,o);if(p9())return f9();const s=k9(t,r,void 0,void 0,e,n);if(p9())return f9();const c=bw.createBlock(a),l=bw.createBlock(s),_=bw.createTryStatement(c,void 0,l);return y9(e,n,_,o,i)}(t,me(t.arguments,0),n,r,i);if(hF(t))return m9(e,t.expression,n,r,i);const o=n.checker.getTypeAtLocation(t);return o&&n.checker.getPromisedTypeOfPromise(o)?(pn.assertNode(fc(t).parent,hF),function(e,t,n,r,i){if(O9(e,n)){let e=UC(t);return r&&(e=bw.createAwaitExpression(e)),[bw.createReturnStatement(e)]}return b9(i,bw.createAwaitExpression(t),void 0)}(e,t,n,r,i)):f9()}function g9({checker:e},t){if(106===t.kind)return!0;if(uD(t)&&!Gl(t)&&"undefined"===bc(t)){const n=e.getSymbolAtLocation(t);return!n||e.isUndefinedSymbol(n)}return!1}function h9(e,t,n){let r;return n&&!O9(e,t)&&(I9(n)?(r=n,t.synthNamesMap.forEach((e,r)=>{if(e.identifier.text===n.identifier.text){const e=(i=n,D9(bw.createUniqueName(i.identifier.text,16)));t.synthNamesMap.set(r,e)}var i})):r=D9(bw.createUniqueName("result",16),n.types),A9(r)),r}function y9(e,t,n,r,i){const o=[];let a;if(r&&!O9(e,t)){a=UC(A9(r));const e=r.types,n=t.checker.getUnionType(e,2),i=t.isInJSFile?void 0:t.checker.typeToTypeNode(n,void 0,void 0),s=[bw.createVariableDeclaration(a,void 0,i)],c=bw.createVariableStatement(void 0,bw.createVariableDeclarationList(s,1));o.push(c)}return o.push(n),i&&a&&1===i.kind&&o.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(UC(P9(i)),void 0,void 0,a)],2))),o}function v9(e,t,n,r,i){if(!t||g9(n,t))return m9(e,e.expression.expression,n,r,i);const o=w9(t,n),a=h9(e,n,i),s=m9(e,e.expression.expression,n,!0,a);if(p9())return f9();const c=k9(t,r,a,o,e,n);if(p9())return f9();const l=bw.createBlock(s),_=bw.createCatchClause(o&&UC(E9(o)),bw.createBlock(c));return y9(e,n,bw.createTryStatement(l,_,void 0),a,i)}function b9(e,t,n){return!e||N9(e)?[bw.createExpressionStatement(t)]:I9(e)&&e.hasBeenDeclared?[bw.createExpressionStatement(bw.createAssignment(UC(F9(e)),t))]:[bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(UC(E9(e)),void 0,n,t)],2))]}function x9(e,t){if(t&&e){const n=bw.createUniqueName("result",16);return[...b9(D9(n),e,t),bw.createReturnStatement(n)]}return[bw.createReturnStatement(e)]}function k9(e,t,n,r,i,o){var a;switch(e.kind){case 106:break;case 212:case 80:if(!r)break;const s=bw.createCallExpression(UC(e),void 0,I9(r)?[F9(r)]:[]);if(O9(i,o))return x9(s,_9(i,e,o.checker));const c=o.checker.getTypeAtLocation(e),l=o.checker.getSignaturesOfType(c,0);if(!l.length)return f9();const u=l[0].getReturnType(),d=b9(n,bw.createAwaitExpression(s),_9(i,e,o.checker));return n&&n.types.push(o.checker.getAwaitedType(u)||u),d;case 219:case 220:{const r=e.body,s=null==(a=T9(o.checker.getTypeAtLocation(e),o.checker))?void 0:a.getReturnType();if(GF(r)){let a=[],c=!1;for(const l of r.statements)if(sE(l))if(c=!0,V1(l,o.checker))a=a.concat(C9(o,l,t,n));else{const t=s&&l.expression?S9(o.checker,s,l.expression):l.expression;a.push(...x9(t,_9(i,e,o.checker)))}else{if(t&&Af(l,st))return f9();a.push(l)}return O9(i,o)?a.map(e=>UC(e)):function(e,t,n,r){const i=[];for(const r of e)if(sE(r)){if(r.expression){const e=u9(r.expression,n.checker)?bw.createAwaitExpression(r.expression):r.expression;void 0===t?i.push(bw.createExpressionStatement(e)):I9(t)&&t.hasBeenDeclared?i.push(bw.createExpressionStatement(bw.createAssignment(F9(t),e))):i.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(E9(t),void 0,void 0,e)],2)))}}else i.push(UC(r));r||void 0===t||i.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(E9(t),void 0,void 0,bw.createIdentifier("undefined"))],2)));return i}(a,n,o,c)}{const a=W1(r,o.checker)?C9(o,bw.createReturnStatement(r),t,n):_;if(a.length>0)return a;if(s){const t=S9(o.checker,s,r);if(O9(i,o))return x9(t,_9(i,e,o.checker));{const e=b9(n,t,void 0);return n&&n.types.push(o.checker.getAwaitedType(s)||s),e}}return f9()}}default:return f9()}return _}function S9(e,t,n){const r=UC(n);return e.getPromisedTypeOfPromise(t)?bw.createAwaitExpression(r):r}function T9(e,t){return be(t.getSignaturesOfType(e,0))}function C9(e,t,n,r){let i=[];return iO(t,function t(o){if(vF(o)){const t=m9(o,o,e,n,r);if(i=i.concat(t),i.length>0)return}else s_(o)||iO(o,t)}),i}function w9(e,t){const n=[];let r;if(l_(e)){if(e.parameters.length>0){r=function e(t){if(uD(t))return i(t);const n=L(t.elements,t=>RF(t)?[]:[e(t.name)]);return function(e,t=_,n=[]){return{kind:1,bindingPattern:e,elements:t,types:n}}(t,n)}(e.parameters[0].name)}}else uD(e)?r=i(e):hF(e)&&uD(e.name)&&(r=i(e.name));if(r&&(!("identifier"in r)||"undefined"!==r.identifier.text))return r;function i(e){var r;const i=function(e){var n;return(null==(n=rt(e,_u))?void 0:n.symbol)??t.checker.getSymbolAtLocation(e)}((r=e).original?r.original:r);if(!i)return D9(e,n);return t.synthNamesMap.get(uJ(i).toString())||D9(e,n)}}function N9(e){return!e||(I9(e)?!e.identifier.text:b(e.elements,N9))}function D9(e,t=[]){return{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function F9(e){return e.hasBeenReferenced=!0,e.identifier}function E9(e){return I9(e)?A9(e):P9(e)}function P9(e){for(const t of e.elements)E9(t);return e.bindingPattern}function A9(e){return e.hasBeenDeclared=!0,e.identifier}function I9(e){return 0===e.kind}function O9(e,t){return!!e.original&&t.setOfExpressionsToReturn.has(_J(e.original))}function L9(e,t,n,r,i){var o;for(const a of e.imports){const s=null==(o=n.getResolvedModuleFromModuleSpecifier(a,e))?void 0:o.resolvedModule;if(!s||s.resolvedFileName!==t.fileName)continue;const c=Sg(a);switch(c.kind){case 272:r.replaceNode(e,c,pY(c.name,void 0,a,i));break;case 214:Bm(c,!1)&&r.replaceNode(e,c,bw.createPropertyAccessExpression(UC(c),"default"))}}}function j9(e,t){e.forEachChild(function n(r){if(hF(r)&&lB(e,r.expression)&&uD(r.name)){const{parent:e}=r;t(r,AF(e)&&e.left===r&&64===e.operatorToken.kind)}r.forEachChild(n)})}function M9(e,t,n,r,i,o,a,s,c){switch(t.kind){case 244:return R9(e,t,r,n,i,o,c),!1;case 245:{const{expression:i}=t;switch(i.kind){case 214:return Bm(i,!0)&&r.replaceNode(e,t,pY(void 0,void 0,i.arguments[0],c)),!1;case 227:{const{operatorToken:t}=i;return 64===t.kind&&function(e,t,n,r,i,o){const{left:a,right:s}=n;if(!hF(a))return!1;if(lB(e,a)){if(!lB(e,s)){const i=gF(s)?function(e,t){const n=B(e.properties,e=>{switch(e.kind){case 178:case 179:case 305:case 306:return;case 304:return uD(e.name)?function(e,t,n){const r=[bw.createToken(95)];switch(t.kind){case 219:{const{name:n}=t;if(n&&n.text!==e)return i()}case 220:return W9(e,r,t,n);case 232:return function(e,t,n,r){return bw.createClassDeclaration(G(t,$C(n.modifiers)),e,$C(n.typeParameters),$C(n.heritageClauses),z9(n.members,r))}(e,r,t,n);default:return i()}function i(){return K9(r,bw.createIdentifier(e),z9(t,n))}}(e.name.text,e.initializer,t):void 0;case 175:return uD(e.name)?W9(e.name.text,[bw.createToken(95)],e,t):void 0;default:pn.assertNever(e,`Convert to ES6 got invalid prop kind ${e.kind}`)}});return n&&[n,!1]}(s,o):Bm(s,!0)?function(e,t){const n=e.text,r=t.getSymbolAtLocation(e),i=r?r.exports:u;return i.has("export=")?[[J9(n)],!0]:i.has("default")?i.size>1?[[B9(n),J9(n)],!0]:[[J9(n)],!0]:[[B9(n)],!1]}(s.arguments[0],t):void 0;return i?(r.replaceNodeWithNodes(e,n.parent,i[0]),i[1]):(r.replaceRangeWithText(e,Mb(a.getStart(e),s.pos),"export default"),!0)}r.delete(e,n.parent)}else lB(e,a.expression)&&function(e,t,n,r){const{text:i}=t.left.name,o=r.get(i);if(void 0!==o){const r=[K9(void 0,o,t.right),G9([bw.createExportSpecifier(!1,o,i)])];n.replaceNodeWithNodes(e,t.parent,r)}else!function({left:e,right:t,parent:n},r,i){const o=e.name.text;if(!(TF(t)||CF(t)||MF(t))||t.name&&t.name.text!==o)i.replaceNodeRangeWithNodes(r,e.expression,GX(e,25,r),[bw.createToken(95),bw.createToken(87)],{joiner:" ",suffix:" "});else{i.replaceRange(r,{pos:e.getStart(r),end:t.getStart(r)},bw.createToken(95),{suffix:" "}),t.name||i.insertName(r,t,o);const a=GX(n,27,r);a&&i.delete(r,a)}}(t,e,n)}(e,n,r,i);return!1}(e,n,i,r,a,s)}}}default:return!1}}function R9(e,t,n,r,i,o,a){const{declarationList:s}=t;let c=!1;const l=P(s.declarations,t=>{const{name:n,initializer:l}=t;if(l){if(lB(e,l))return c=!0,X9([]);if(Bm(l,!0))return c=!0,function(e,t,n,r,i,o){switch(e.kind){case 207:{const n=B(e.elements,e=>e.dotDotDotToken||e.initializer||e.propertyName&&!uD(e.propertyName)||!uD(e.name)?void 0:H9(e.propertyName&&e.propertyName.text,e.name.text));if(n)return X9([pY(void 0,n,t,o)])}case 208:{const n=q9(a0(t.text,i),r);return X9([pY(bw.createIdentifier(n),void 0,t,o),K9(void 0,UC(e),bw.createIdentifier(n))])}case 80:return function(e,t,n,r,i){const o=n.getSymbolAtLocation(e),a=new Map;let s,c=!1;for(const t of r.original.get(e.text)){if(n.getSymbolAtLocation(t)!==o||t===e)continue;const{parent:i}=t;if(hF(i)){const{name:{text:e}}=i;if("default"===e){c=!0;const e=t.getText();(s??(s=new Map)).set(i,bw.createIdentifier(e))}else{pn.assert(i.expression===t,"Didn't expect expression === use");let n=a.get(e);void 0===n&&(n=q9(e,r),a.set(e,n)),(s??(s=new Map)).set(i,bw.createIdentifier(n))}}else c=!0}const l=0===a.size?void 0:je(A(a.entries(),([e,t])=>bw.createImportSpecifier(!1,e===t?void 0:bw.createIdentifier(e),bw.createIdentifier(t))));l||(c=!0);return X9([pY(c?UC(e):void 0,l,t,i)],s)}(e,t,n,r,o);default:return pn.assertNever(e,`Convert to ES module got invalid name kind ${e.kind}`)}}(n,l.arguments[0],r,i,o,a);if(hF(l)&&Bm(l.expression,!0))return c=!0,function(e,t,n,r,i){switch(e.kind){case 207:case 208:{const o=q9(t,r);return X9([$9(o,t,n,i),K9(void 0,e,bw.createIdentifier(o))])}case 80:return X9([$9(e.text,t,n,i)]);default:return pn.assertNever(e,`Convert to ES module got invalid syntax form ${e.kind}`)}}(n,l.name.text,l.expression.arguments[0],i,a)}return X9([bw.createVariableStatement(void 0,bw.createVariableDeclarationList([t],s.flags))])});if(c){let r;return n.replaceNodeWithNodes(e,t,L(l,e=>e.newImports)),p(l,e=>{e.useSitesToUnqualify&&ld(e.useSitesToUnqualify,r??(r=new Map))}),r}}function B9(e){return G9(void 0,e)}function J9(e){return G9([bw.createExportSpecifier(!1,void 0,"default")],e)}function z9(e,t){return t&&H(je(t.keys()),t=>tx(e,t))?Ze(e)?HC(e,!0,n):VC(e,!0,n):e;function n(e){if(212===e.kind){const n=t.get(e);return t.delete(e),n}}}function q9(e,t){for(;t.original.has(e)||t.additional.has(e);)e=`_${e}`;return t.additional.add(e),e}function U9(e){const t=Ke();return V9(e,e=>t.add(e.text,e)),t}function V9(e,t){uD(e)&&function(e){const{parent:t}=e;switch(t.kind){case 212:return t.name!==e;case 209:case 277:return t.propertyName!==e;default:return!0}}(e)&&t(e),e.forEachChild(e=>V9(e,t))}function W9(e,t,n,r){return bw.createFunctionDeclaration(G(t,$C(n.modifiers)),UC(n.asteriskToken),e,$C(n.typeParameters),$C(n.parameters),UC(n.type),bw.converters.convertToFunctionBlock(z9(n.body,r)))}function $9(e,t,n,r){return"default"===t?pY(bw.createIdentifier(e),void 0,n,r):pY(void 0,[H9(t,e)],n,r)}function H9(e,t){return bw.createImportSpecifier(!1,void 0!==e&&e!==t?bw.createIdentifier(e):void 0,bw.createIdentifier(t))}function K9(e,t,n){return bw.createVariableStatement(e,bw.createVariableDeclarationList([bw.createVariableDeclaration(t,void 0,void 0,n)],2))}function G9(e,t){return bw.createExportDeclaration(void 0,!1,e&&bw.createNamedExports(e),void 0===t?void 0:bw.createStringLiteral(t))}function X9(e,t){return{newImports:e,useSitesToUnqualify:t}}Q7({errorCodes:o9,getCodeActions(e){a9=!0;const t=ide.ChangeTracker.with(e,t=>s9(t,e.sourceFile,e.span.start,e.program.getTypeChecker()));return a9?[K7(i9,t,fa.Convert_to_async_function,i9,fa.Convert_all_to_async_functions)]:[]},fixIds:[i9],getAllCodeActions:e=>r5(e,o9,(t,n)=>s9(t,n.file,n.start,e.program.getTypeChecker()))}),Q7({errorCodes:[fa.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions(e){const{sourceFile:t,program:n,preferences:r}=e;return[H7("convertToEsModule",ide.ChangeTracker.with(e,e=>{const i=function(e,t,n,r,i){const o={original:U9(e),additional:new Set},a=function(e,t,n){const r=new Map;return j9(e,e=>{const{text:i}=e.name;r.has(i)||!Lh(e.name)&&!t.resolveName(i,e,111551,!0)||r.set(i,q9(`_${i}`,n))}),r}(e,t,o);!function(e,t,n){j9(e,(r,i)=>{if(i)return;const{text:o}=r.name;n.replaceNode(e,r,bw.createIdentifier(t.get(o)||o))})}(e,a,n);let s,c=!1;for(const a of D(e.statements,XF)){const c=R9(e,a,n,t,o,r,i);c&&ld(c,s??(s=new Map))}for(const l of D(e.statements,e=>!XF(e))){const _=M9(e,l,t,n,o,r,a,s,i);c=c||_}return null==s||s.forEach((t,r)=>{n.replaceNode(e,r,t)}),c}(t,n.getTypeChecker(),e,Sk(n.getCompilerOptions()),hY(t,r));if(i)for(const i of n.getSourceFiles())L9(i,t,n,e,hY(i,r))}),fa.Convert_to_ES_module)]}});var Q9="correctQualifiedNameToIndexedAccessType",Y9=[fa.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.code];function Z9(e,t){const n=mc(lQ(e,t),wD);return pn.assert(!!n,"Expected position to be owned by a qualified name."),uD(n.left)?n:void 0}function eee(e,t,n){const r=n.right.text,i=bw.createIndexedAccessTypeNode(bw.createTypeReferenceNode(n.left,void 0),bw.createLiteralTypeNode(bw.createStringLiteral(r)));e.replaceNode(t,n,i)}Q7({errorCodes:Y9,getCodeActions(e){const t=Z9(e.sourceFile,e.span.start);if(!t)return;const n=ide.ChangeTracker.with(e,n=>eee(n,e.sourceFile,t)),r=`${t.left.text}["${t.right.text}"]`;return[K7(Q9,n,[fa.Rewrite_as_the_indexed_access_type_0,r],Q9,fa.Rewrite_all_as_indexed_access_types)]},fixIds:[Q9],getAllCodeActions:e=>r5(e,Y9,(e,t)=>{const n=Z9(t.file,t.start);n&&eee(e,t.file,n)})});var tee=[fa.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code],nee="convertToTypeOnlyExport";function ree(e,t){return rt(lQ(t,e.start).parent,JE)}function iee(e,t,n){if(!t)return;const r=t.parent,i=r.parent,o=function(e,t){const n=e.parent;if(1===n.elements.length)return n.elements;const r=YZ(WQ(n),t.program.getSemanticDiagnostics(t.sourceFile,t.cancellationToken));return D(n.elements,t=>{var n;return t===e||(null==(n=QZ(t,r))?void 0:n.code)===tee[0]})}(t,n);if(o.length===r.elements.length)e.insertModifierBefore(n.sourceFile,156,r);else{const t=bw.updateExportDeclaration(i,i.modifiers,!1,bw.updateNamedExports(r,D(r.elements,e=>!C(o,e))),i.moduleSpecifier,void 0),a=bw.createExportDeclaration(void 0,!0,bw.createNamedExports(o),i.moduleSpecifier,void 0);e.replaceNode(n.sourceFile,i,t,{leadingTriviaOption:ide.LeadingTriviaOption.IncludeAll,trailingTriviaOption:ide.TrailingTriviaOption.Exclude}),e.insertNodeAfter(n.sourceFile,i,a)}}Q7({errorCodes:tee,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>iee(t,ree(e.span,e.sourceFile),e));if(t.length)return[K7(nee,t,fa.Convert_to_type_only_export,nee,fa.Convert_all_re_exported_types_to_type_only_exports)]},fixIds:[nee],getAllCodeActions:function(e){const t=new Set;return r5(e,tee,(n,r)=>{const i=ree(r,e.sourceFile);i&&Cx(t,_J(i.parent.parent))&&iee(n,i,e)})}});var oee=[fa._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,fa._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code],aee="convertToTypeOnlyImport";function see(e,t){const{parent:n}=lQ(e,t);return jE(n)||wE(n)&&n.importClause?n:void 0}function cee(e,t,n){if(e.parent.parent.name)return!1;const r=e.parent.elements.filter(e=>!e.isTypeOnly);if(1===r.length)return!0;const i=n.getTypeChecker();for(const e of r){if(jce.Core.eachSymbolReferenceInFile(e.name,i,t,e=>{const t=i.getSymbolAtLocation(e);return!!t&&i.symbolIsValue(t)||!CT(e)}))return!1}return!0}function lee(e,t,n){var r;if(jE(n))e.replaceNode(t,n,bw.updateImportSpecifier(n,!0,n.propertyName,n.name));else{const i=n.importClause;if(i.name&&i.namedBindings)e.replaceNodeWithNodes(t,n,[bw.createImportDeclaration($C(n.modifiers,!0),bw.createImportClause(156,UC(i.name,!0),void 0),UC(n.moduleSpecifier,!0),UC(n.attributes,!0)),bw.createImportDeclaration($C(n.modifiers,!0),bw.createImportClause(156,void 0,UC(i.namedBindings,!0)),UC(n.moduleSpecifier,!0),UC(n.attributes,!0))]);else{const o=276===(null==(r=i.namedBindings)?void 0:r.kind)?bw.updateNamedImports(i.namedBindings,I(i.namedBindings.elements,e=>bw.updateImportSpecifier(e,!1,e.propertyName,e.name))):i.namedBindings,a=bw.updateImportDeclaration(n,n.modifiers,bw.updateImportClause(i,156,i.name,o),n.moduleSpecifier,n.attributes);e.replaceNode(t,n,a)}}}Q7({errorCodes:oee,getCodeActions:function(e){var t;const n=see(e.sourceFile,e.span.start);if(n){const r=ide.ChangeTracker.with(e,t=>lee(t,e.sourceFile,n)),i=277===n.kind&&wE(n.parent.parent.parent)&&cee(n,e.sourceFile,e.program)?ide.ChangeTracker.with(e,t=>lee(t,e.sourceFile,n.parent.parent.parent)):void 0,o=K7(aee,r,277===n.kind?[fa.Use_type_0,(null==(t=n.propertyName)?void 0:t.text)??n.name.text]:fa.Use_import_type,aee,fa.Fix_all_with_type_only_imports);return H(i)?[H7(aee,i,fa.Use_import_type),o]:[o]}},fixIds:[aee],getAllCodeActions:function(e){const t=new Set;return r5(e,oee,(n,r)=>{const i=see(r.file,r.start);273!==(null==i?void 0:i.kind)||t.has(i)?277===(null==i?void 0:i.kind)&&wE(i.parent.parent.parent)&&!t.has(i.parent.parent.parent)&&cee(i,r.file,e.program)?(lee(n,r.file,i.parent.parent.parent),t.add(i.parent.parent.parent)):277===(null==i?void 0:i.kind)&&lee(n,r.file,i):(lee(n,r.file,i),t.add(i))})}});var _ee="convertTypedefToType",uee=[fa.JSDoc_typedef_may_be_converted_to_TypeScript_type.code];function dee(e,t,n,r,i=!1){if(!GP(t))return;const o=function(e){var t;const{typeExpression:n}=e;if(!n)return;const r=null==(t=e.name)?void 0:t.getText();if(!r)return;if(323===n.kind)return function(e,t){const n=fee(t);if(!H(n))return;return bw.createInterfaceDeclaration(void 0,e,void 0,void 0,n)}(r,n);if(310===n.kind)return function(e,t){const n=UC(t.type);if(!n)return;return bw.createTypeAliasDeclaration(void 0,bw.createIdentifier(e),void 0,n)}(r,n)}(t);if(!o)return;const a=t.parent,{leftSibling:s,rightSibling:c}=function(e){const t=e.parent,n=t.getChildCount()-1,r=t.getChildren().findIndex(t=>t.getStart()===e.getStart()&&t.getEnd()===e.getEnd()),i=r>0?t.getChildAt(r-1):void 0,o=r0;e--)if(!/[*/\s]/.test(r.substring(e-1,e)))return t+e;return n}function fee(e){const t=e.jsDocPropertyTags;if(!H(t))return;return J(t,e=>{var t;const n=function(e){return 80===e.name.kind?e.name.text:e.name.right.text}(e),r=null==(t=e.typeExpression)?void 0:t.type,i=e.isBracketed;let o;if(r&&FP(r)){const e=fee(r);o=bw.createTypeLiteralNode(e)}else r&&(o=UC(r));if(o&&n){const e=i?bw.createToken(58):void 0;return bw.createPropertySignature(void 0,n,e,o)}})}function mee(e){return Au(e)?L(e.jsDoc,e=>{var t;return null==(t=e.tags)?void 0:t.filter(e=>GP(e))}):[]}Q7({fixIds:[_ee],errorCodes:uee,getCodeActions(e){const t=tZ(e.host,e.formatContext.options),n=lQ(e.sourceFile,e.span.start);if(!n)return;const r=ide.ChangeTracker.with(e,r=>dee(r,n,e.sourceFile,t));return r.length>0?[K7(_ee,r,fa.Convert_typedef_to_TypeScript_type,_ee,fa.Convert_all_typedef_to_TypeScript_types)]:void 0},getAllCodeActions:e=>r5(e,uee,(t,n)=>{const r=tZ(e.host,e.formatContext.options),i=lQ(n.file,n.start);i&&dee(t,i,n.file,r,!0)})});var gee="convertLiteralTypeToMappedType",hee=[fa._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];function yee(e,t){const n=lQ(e,t);if(uD(n)){const t=it(n.parent.parent,PD),r=n.getText(e);return{container:it(t.parent,HD),typeNode:t.type,constraint:r,name:"K"===r?"P":"K"}}}function vee(e,t,{container:n,typeNode:r,constraint:i,name:o}){e.replaceNode(t,n,bw.createMappedTypeNode(void 0,bw.createTypeParameterDeclaration(void 0,o,bw.createTypeReferenceNode(i)),void 0,void 0,r,void 0))}Q7({errorCodes:hee,getCodeActions:function(e){const{sourceFile:t,span:n}=e,r=yee(t,n.start);if(!r)return;const{name:i,constraint:o}=r,a=ide.ChangeTracker.with(e,e=>vee(e,t,r));return[K7(gee,a,[fa.Convert_0_to_1_in_0,o,i],gee,fa.Convert_all_type_literals_to_mapped_type)]},fixIds:[gee],getAllCodeActions:e=>r5(e,hee,(e,t)=>{const n=yee(t.file,t.start);n&&vee(e,t.file,n)})});var bee=[fa.Class_0_incorrectly_implements_interface_1.code,fa.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code],xee="fixClassIncorrectlyImplementsInterface";function kee(e,t){return pn.checkDefined(em(lQ(e,t)),"There should be a containing class")}function See(e){return!(e.valueDeclaration&&2&Vv(e.valueDeclaration))}function Tee(e,t,n,r,i,o){const a=e.program.getTypeChecker(),s=function(e,t){const n=kh(e);if(!n)return Zu();const r=t.getTypeAtLocation(n),i=t.getPropertiesOfType(r);return Zu(i.filter(See))}(r,a),c=a.getTypeAtLocation(t),l=a.getPropertiesOfType(c).filter(tn(See,e=>!s.has(e.escapedName))),_=a.getTypeAtLocation(r),u=x(r.members,e=>jD(e));_.getNumberIndexType()||p(c,1),_.getStringIndexType()||p(c,0);const d=Dee(n,e.program,o,e.host);function p(t,i){const o=a.getIndexInfoOfType(t,i);o&&f(n,r,a.indexInfoToIndexSignatureDeclaration(o,r,void 0,void 0,Yie(e)))}function f(e,t,n){u?i.insertNodeAfter(e,u,n):i.insertMemberAtStart(e,t,n)}Qie(r,l,n,e,o,d,e=>f(n,r,e)),d.writeFixes(i)}Q7({errorCodes:bee,getCodeActions(e){const{sourceFile:t,span:n}=e,r=kee(t,n.start);return J(Th(r),n=>{const i=ide.ChangeTracker.with(e,i=>Tee(e,n,t,r,i,e.preferences));return 0===i.length?void 0:K7(xee,i,[fa.Implement_interface_0,n.getText(t)],xee,fa.Implement_all_unimplemented_interfaces)})},fixIds:[xee],getAllCodeActions(e){const t=new Set;return r5(e,bee,(n,r)=>{const i=kee(r.file,r.start);if(Cx(t,_J(i)))for(const t of Th(i))Tee(e,t,r.file,i,n,e.preferences)})}});var Cee="import",wee="fixMissingImport",Nee=[fa.Cannot_find_name_0.code,fa.Cannot_find_name_0_Did_you_mean_1.code,fa.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,fa.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,fa.Cannot_find_namespace_0.code,fa._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,fa._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,fa.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,fa._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code,fa.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code,fa.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code,fa.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code,fa.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,fa.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code,fa.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,fa.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,fa.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,fa.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,fa.Cannot_find_namespace_0_Did_you_mean_1.code,fa.Cannot_extend_an_interface_0_Did_you_mean_implements.code,fa.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code];function Dee(e,t,n,r,i){return Fee(e,t,!1,n,r,i)}function Fee(e,t,n,r,i,o){const a=t.getCompilerOptions(),s=[],c=[],l=new Map,_=new Set,u=new Set,d=new Map;return{addImportFromDiagnostic:function(e,t){const r=qee(t,e.code,e.start,n);if(!r||!r.length)return;p(ye(r))},addImportFromExportedSymbol:function(n,s,c){var l,_;const u=pn.checkDefined(n.parent,"Expected exported symbol to have module symbol as parent"),d=r0(n,Sk(a)),f=t.getTypeChecker(),m=f.getMergedSymbol(_x(n,f)),g=Lee(e,m,d,u,!1,t,i,r,o);if(!g)return void pn.assert(null==(l=r.autoImportFileExcludePatterns)?void 0:l.length);const h=Jee(e,t);let y=Iee(e,g,t,void 0,!!s,h,i,r);if(y){const e=(null==(_=rt(null==c?void 0:c.name,uD))?void 0:_.text)??d;let t,r;c&&Ul(c)&&(3===y.kind||2===y.kind)&&1===y.addAsTypeOnly&&(t=2),n.name!==e&&(r=n.name),y={...y,...void 0===t?{}:{addAsTypeOnly:t},...void 0===r?{}:{propertyName:r}},p({fix:y,symbolName:e??d,errorIdentifierText:void 0})}},addImportForModuleSymbol:function(n,o,s){var c,l,_;const u=t.getTypeChecker(),d=u.getAliasedSymbol(n);pn.assert(1536&d.flags,"Expected symbol to be a module");const f=_Y(t,i),m=pB.getModuleSpecifiersWithCacheInfo(d,u,a,e,f,r,void 0,!0),g=Jee(e,t);let h=Ree(o,!0,void 0,n.flags,t.getTypeChecker(),a);h=1===h&&Ul(s)?2:1;const y=wE(s)?Dg(s)?1:2:jE(s)?0:NE(s)&&s.name?1:2,v=[{symbol:n,moduleSymbol:d,moduleFileName:null==(_=null==(l=null==(c=d.declarations)?void 0:c[0])?void 0:l.getSourceFile())?void 0:_.fileName,exportKind:4,targetFlags:n.flags,isFromPackageJson:!1}],b=Iee(e,v,t,void 0,!!o,g,i,r);let x;x=b&&2!==y&&0!==b.kind&&1!==b.kind?{...b,addAsTypeOnly:h,importKind:y}:{kind:3,moduleSpecifierKind:void 0!==b?b.moduleSpecifierKind:m.kind,moduleSpecifier:void 0!==b?b.moduleSpecifier:ye(m.moduleSpecifiers),importKind:y,addAsTypeOnly:h,useRequire:g};p({fix:x,symbolName:n.name,errorIdentifierText:void 0})},writeFixes:function(t,n){var i,o;let u,p,m;u=void 0!==e.imports&&0===e.imports.length&&void 0!==n?n:hY(e,r);for(const n of s)ete(t,e,n);for(const n of c)tte(t,e,n,u);if(_.size){pn.assert(Am(e),"Cannot remove imports from a future source file");const n=new Set(J([..._],e=>mc(e,wE))),r=new Set(J([..._],e=>mc(e,Jm))),a=[...n].filter(e=>{var t,n,r;return!l.has(e.importClause)&&(!(null==(t=e.importClause)?void 0:t.name)||_.has(e.importClause))&&(!rt(null==(n=e.importClause)?void 0:n.namedBindings,IE)||_.has(e.importClause.namedBindings))&&(!rt(null==(r=e.importClause)?void 0:r.namedBindings,LE)||b(e.importClause.namedBindings.elements,e=>_.has(e)))}),s=[...r].filter(e=>(207!==e.name.kind||!l.has(e.name))&&(207!==e.name.kind||b(e.name.elements,e=>_.has(e)))),c=[...n].filter(e=>{var t,n;return(null==(t=e.importClause)?void 0:t.namedBindings)&&-1===a.indexOf(e)&&!(null==(n=l.get(e.importClause))?void 0:n.namedImports)&&(275===e.importClause.namedBindings.kind||b(e.importClause.namedBindings.elements,e=>_.has(e)))});for(const n of[...a,...s])t.delete(e,n);for(const n of c)t.replaceNode(e,n.importClause,bw.updateImportClause(n.importClause,n.importClause.phaseModifier,n.importClause.name,void 0));for(const n of _){const r=mc(n,wE);r&&-1===a.indexOf(r)&&-1===c.indexOf(r)?274===n.kind?t.delete(e,n.name):(pn.assert(277===n.kind,"NamespaceImport should have been handled earlier"),(null==(i=l.get(r.importClause))?void 0:i.namedImports)?(p??(p=new Set)).add(n):t.delete(e,n)):209===n.kind?(null==(o=l.get(n.parent))?void 0:o.namedImports)?(p??(p=new Set)).add(n):t.delete(e,n):272===n.kind&&t.delete(e,n)}}l.forEach(({importClauseOrBindingPattern:n,defaultImport:i,namedImports:o})=>{Zee(t,e,n,i,je(o.entries(),([e,{addAsTypeOnly:t,propertyName:n}])=>({addAsTypeOnly:t,propertyName:n,name:e})),p,r)}),d.forEach(({useRequire:e,defaultImport:t,namedImports:n,namespaceLikeImport:i},o)=>{const s=(e?ate:ote)(o.slice(2),u,t,n&&je(n.entries(),([e,[t,n]])=>({addAsTypeOnly:t,propertyName:n,name:e})),i,a,r);m=se(m,s)}),m=se(m,f()),m&&NY(t,e,m,!0,r)},hasFixes:function(){return s.length>0||c.length>0||l.size>0||d.size>0||u.size>0||_.size>0},addImportForUnresolvedIdentifier:function(e,t,n){const r=function(e,t,n){const r=Kee(e,t,n),i=HZ(e.sourceFile,e.preferences,e.host);return r&&Uee(r,e.sourceFile,e.program,i,e.host,e.preferences)}(e,t,n);if(!r||!r.length)return;p(ye(r))},addImportForNonExistentExport:function(n,o,s,c,l){const _=t.getSourceFile(o),u=Jee(e,t);if(_&&_.symbol){const{fixes:a}=Mee([{exportKind:s,isFromPackageJson:!1,moduleFileName:o,moduleSymbol:_.symbol,targetFlags:c}],void 0,l,u,t,e,i,r);a.length&&p({fix:a[0],symbolName:n,errorIdentifierText:n})}else{const _=v0(o,99,t,i);p({fix:{kind:3,moduleSpecifierKind:"relative",moduleSpecifier:pB.getLocalModuleSpecifierBetweenFileNames(e,o,a,_Y(t,i),r),importKind:Hee(_,s,t),addAsTypeOnly:Ree(l,!0,void 0,c,t.getTypeChecker(),a),useRequire:u},symbolName:n,errorIdentifierText:n})}},removeExistingImport:function(e){274===e.kind&&pn.assertIsDefined(e.name,"ImportClause should have a name if it's being removed");_.add(e)},addVerbatimImport:function(e){u.add(e)}};function p(e){var t,n,r;const{fix:i,symbolName:o}=e;switch(i.kind){case 0:s.push(i);break;case 1:c.push(i);break;case 2:{const{importClauseOrBindingPattern:e,importKind:r,addAsTypeOnly:a,propertyName:s}=i;let c=l.get(e);if(c||l.set(e,c={importClauseOrBindingPattern:e,defaultImport:void 0,namedImports:new Map}),0===r){const e=null==(t=null==c?void 0:c.namedImports.get(o))?void 0:t.addAsTypeOnly;c.namedImports.set(o,{addAsTypeOnly:_(e,a),propertyName:s})}else pn.assert(void 0===c.defaultImport||c.defaultImport.name===o,"(Add to Existing) Default import should be missing or match symbolName"),c.defaultImport={name:o,addAsTypeOnly:_(null==(n=c.defaultImport)?void 0:n.addAsTypeOnly,a)};break}case 3:{const{moduleSpecifier:e,importKind:t,useRequire:n,addAsTypeOnly:s,propertyName:c}=i,l=function(e,t,n,r){const i=u(e,!0),o=u(e,!1),a=d.get(i),s=d.get(o),c={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:n};if(1===t&&2===r)return a||(d.set(i,c),c);if(1===r&&(a||s))return a||s;if(s)return s;return d.set(o,c),c}(e,t,n,s);switch(pn.assert(l.useRequire===n,"(Add new) Tried to add an `import` and a `require` for the same module"),t){case 1:pn.assert(void 0===l.defaultImport||l.defaultImport.name===o,"(Add new) Default import should be missing or match symbolName"),l.defaultImport={name:o,addAsTypeOnly:_(null==(r=l.defaultImport)?void 0:r.addAsTypeOnly,s)};break;case 0:const e=(l.namedImports||(l.namedImports=new Map)).get(o);l.namedImports.set(o,[_(e,s),c]);break;case 3:if(a.verbatimModuleSyntax){const e=(l.namedImports||(l.namedImports=new Map)).get(o);l.namedImports.set(o,[_(e,s),c])}else pn.assert(void 0===l.namespaceLikeImport||l.namespaceLikeImport.name===o,"Namespacelike import shoudl be missing or match symbolName"),l.namespaceLikeImport={importKind:t,name:o,addAsTypeOnly:s};break;case 2:pn.assert(void 0===l.namespaceLikeImport||l.namespaceLikeImport.name===o,"Namespacelike import shoudl be missing or match symbolName"),l.namespaceLikeImport={importKind:t,name:o,addAsTypeOnly:s}}break}case 4:break;default:pn.assertNever(i,`fix wasn't never - got kind ${i.kind}`)}function _(e,t){return Math.max(e??0,t)}function u(e,t){return`${t?1:0}|${e}`}}function f(){if(!u.size)return;const e=new Set(J([...u],e=>mc(e,wE))),t=new Set(J([...u],e=>mc(e,Vm)));return[...J([...u],e=>272===e.kind?UC(e,!0):void 0),...[...e].map(e=>{var t;return u.has(e)?UC(e,!0):UC(bw.updateImportDeclaration(e,e.modifiers,e.importClause&&bw.updateImportClause(e.importClause,e.importClause.phaseModifier,u.has(e.importClause)?e.importClause.name:void 0,u.has(e.importClause.namedBindings)?e.importClause.namedBindings:(null==(t=rt(e.importClause.namedBindings,LE))?void 0:t.elements.some(e=>u.has(e)))?bw.updateNamedImports(e.importClause.namedBindings,e.importClause.namedBindings.elements.filter(e=>u.has(e))):void 0),e.moduleSpecifier,e.attributes),!0)}),...[...t].map(e=>u.has(e)?UC(e,!0):UC(bw.updateVariableStatement(e,e.modifiers,bw.updateVariableDeclarationList(e.declarationList,J(e.declarationList.declarations,e=>u.has(e)?e:bw.updateVariableDeclaration(e,207===e.name.kind?bw.updateObjectBindingPattern(e.name,e.name.elements.filter(e=>u.has(e))):e.name,e.exclamationToken,e.type,e.initializer)))),!0))]}}function Eee(e,t,n,r){const i=HZ(e,r,n),o=Bee(e,t);return{getModuleSpecifierForBestExportInfo:function(a,s,c,l){const{fixes:_,computedWithoutCacheCount:u}=Mee(a,s,c,!1,t,e,n,r,o,l),d=Vee(_,e,t,i,n,r);return d&&{...d,computedWithoutCacheCount:u}}}}function Pee(e,t,n,r,i,o,a,s,c,l,_,u){let d;n?(d=E0(r,a,s,_,u).get(r.path,n),pn.assertIsDefined(d,"Some exportInfo should match the specified exportMapKey")):(d=To(Iy(t.name))?[jee(e,i,t,s,a)]:Lee(r,e,i,t,o,s,a,_,u),pn.assertIsDefined(d,"Some exportInfo should match the specified symbol / moduleSymbol"));const p=Jee(r,s),f=CT(lQ(r,l)),m=pn.checkDefined(Iee(r,d,s,l,f,p,a,_));return{moduleSpecifier:m.moduleSpecifier,codeAction:Oee(Qee({host:a,formatContext:c,preferences:_},r,i,m,!1,s,_))}}function Aee(e,t,n,r,i,o){const a=n.getCompilerOptions(),s=Se(Xee(e,n.getTypeChecker(),t,a)),c=Gee(e,t,s,n),l=s!==t.text;return c&&Oee(Qee({host:r,formatContext:i,preferences:o},e,s,c,l,n,o))}function Iee(e,t,n,r,i,o,a,s){const c=HZ(e,s,a);return Vee(Mee(t,r,i,o,n,e,a,s).fixes,e,n,c,a,s)}function Oee({description:e,changes:t,commands:n}){return{description:e,changes:t,commands:n}}function Lee(e,t,n,r,i,o,a,s,c){const l=zee(o,a),_=s.autoImportFileExcludePatterns&&F0(a,s),u=o.getTypeChecker().getMergedSymbol(r),d=_&&u.declarations&&Qu(u,308),p=d&&_(d);return E0(e,a,o,s,c).search(e.path,i,e=>e===n,e=>{const n=l(e[0].isFromPackageJson);if(n.getMergedSymbol(_x(e[0].symbol,n))===t&&(p||e.some(e=>n.getMergedSymbol(e.moduleSymbol)===r||e.symbol.parent===r)))return e})}function jee(e,t,n,r,i){var o,a;const s=l(r.getTypeChecker(),!1);if(s)return s;const c=null==(a=null==(o=i.getPackageJsonAutoImportProvider)?void 0:o.call(i))?void 0:a.getTypeChecker();return pn.checkDefined(c&&l(c,!0),"Could not find symbol in specified module for code actions");function l(r,i){const o=P0(n,r);if(o&&_x(o.symbol,r)===e)return{symbol:o.symbol,moduleSymbol:n,moduleFileName:void 0,exportKind:o.exportKind,targetFlags:_x(e,r).flags,isFromPackageJson:i};const a=r.tryGetMemberInModuleExportsAndProperties(t,n);return a&&_x(a,r)===e?{symbol:a,moduleSymbol:n,moduleFileName:void 0,exportKind:0,targetFlags:_x(e,r).flags,isFromPackageJson:i}:void 0}}function Mee(e,t,n,r,i,o,a,s,c=(Am(o)?Bee(o,i):void 0),l){const u=i.getTypeChecker(),d=c?L(e,c.getImportsForExportInfo):_,p=void 0!==t&&function(e,t){return m(e,({declaration:e,importKind:n})=>{var r;if(0!==n)return;const i=function(e){var t,n,r;switch(e.kind){case 261:return null==(t=rt(e.name,uD))?void 0:t.text;case 272:return e.name.text;case 352:case 273:return null==(r=rt(null==(n=e.importClause)?void 0:n.namedBindings,IE))?void 0:r.name.text;default:return pn.assertNever(e)}}(e),o=i&&(null==(r=kg(e))?void 0:r.text);return o?{kind:0,namespacePrefix:i,usagePosition:t,moduleSpecifierKind:void 0,moduleSpecifier:o}:void 0})}(d,t),f=function(e,t,n,r){let i;for(const t of e){const e=o(t);if(!e)continue;const n=Ul(e.importClauseOrBindingPattern);if(4!==e.addAsTypeOnly&&n||4===e.addAsTypeOnly&&!n)return e;i??(i=e)}return i;function o({declaration:e,importKind:i,symbol:o,targetFlags:a}){if(3===i||2===i||272===e.kind)return;if(261===e.kind)return 0!==i&&1!==i||207!==e.name.kind?void 0:{kind:2,importClauseOrBindingPattern:e.name,importKind:i,moduleSpecifierKind:void 0,moduleSpecifier:e.initializer.arguments[0].text,addAsTypeOnly:4};const{importClause:s}=e;if(!s||!Ju(e.moduleSpecifier))return;const{name:c,namedBindings:l}=s;if(s.isTypeOnly&&(0!==i||!l))return;const _=Ree(t,!1,o,a,n,r);return 1===i&&(c||2===_&&l)||0===i&&275===(null==l?void 0:l.kind)?void 0:{kind:2,importClauseOrBindingPattern:s,importKind:i,moduleSpecifierKind:void 0,moduleSpecifier:e.moduleSpecifier.text,addAsTypeOnly:_}}}(d,n,u,i.getCompilerOptions());if(f)return{computedWithoutCacheCount:0,fixes:[...p?[p]:_,f]};const{fixes:g,computedWithoutCacheCount:h=0}=function(e,t,n,r,i,o,a,s,c,l){const _=m(t,e=>function({declaration:e,importKind:t,symbol:n,targetFlags:r},i,o,a,s){var c;const l=null==(c=kg(e))?void 0:c.text;if(l){return{kind:3,moduleSpecifierKind:void 0,moduleSpecifier:l,importKind:t,addAsTypeOnly:o?4:Ree(i,!0,n,r,a,s),useRequire:o}}}(e,o,a,n.getTypeChecker(),n.getCompilerOptions()));return _?{fixes:[_]}:function(e,t,n,r,i,o,a,s,c){const l=BS(t.fileName),_=e.getCompilerOptions(),u=_Y(e,a),d=zee(e,a),p=dY(Ck(_)),f=c?e=>pB.tryGetModuleSpecifiersFromCache(e.moduleSymbol,t,u,s):(e,n)=>pB.getModuleSpecifiersWithCacheInfo(e.moduleSymbol,n,_,t,u,s,void 0,!0);let m=0;const g=L(o,(o,a)=>{const s=d(o.isFromPackageJson),{computedWithoutCache:c,moduleSpecifiers:u,kind:g}=f(o,s)??{},h=!!(111551&o.targetFlags),y=Ree(r,!0,o.symbol,o.targetFlags,s,_);return m+=c?1:0,J(u,r=>{if(p&&aR(r))return;if(!h&&l&&void 0!==n)return{kind:1,moduleSpecifierKind:g,moduleSpecifier:r,usagePosition:n,exportInfo:o,isReExport:a>0};const c=Hee(t,o.exportKind,e);let u;if(void 0!==n&&3===c&&0===o.exportKind){const e=s.resolveExternalModuleSymbol(o.moduleSymbol);let t;e!==o.moduleSymbol&&(t=I0(e,s,Sk(_),lt)),t||(t=o0(o.moduleSymbol,Sk(_),!1)),u={namespacePrefix:t,usagePosition:n}}return{kind:3,moduleSpecifierKind:g,moduleSpecifier:r,importKind:c,useRequire:i,addAsTypeOnly:y,exportInfo:o,isReExport:a>0,qualification:u}})});return{computedWithoutCacheCount:m,fixes:g}}(n,r,i,o,a,e,s,c,l)}(e,d,i,o,t,n,r,a,s,l);return{computedWithoutCacheCount:h,fixes:[...p?[p]:_,...g]}}function Ree(e,t,n,r,i,o){return e?!n||!o.verbatimModuleSyntax||111551&r&&!i.getTypeOnlyAliasDeclaration(n)?1:2:4}function Bee(e,t){const n=t.getTypeChecker();let r;for(const t of e.imports){const e=Sg(t);if(Jm(e.parent)){const i=n.resolveExternalModuleName(t);i&&(r||(r=Ke())).add(uJ(i),e.parent)}else if(273===e.kind||272===e.kind||352===e.kind){const i=n.getSymbolAtLocation(t);i&&(r||(r=Ke())).add(uJ(i),e)}}return{getImportsForExportInfo:({moduleSymbol:n,exportKind:i,targetFlags:o,symbol:a})=>{const s=null==r?void 0:r.get(uJ(n));if(!s)return _;if(Im(e)&&!(111551&o)&&!b(s,tA))return _;const c=Hee(e,i,t);return s.map(e=>({declaration:e,importKind:c,symbol:a,targetFlags:o}))}}}function Jee(e,t){if(!BS(e.fileName))return!1;if(e.commonJsModuleIndicator&&!e.externalModuleIndicator)return!0;if(e.externalModuleIndicator&&!e.commonJsModuleIndicator)return!1;const n=t.getCompilerOptions();if(n.configFile)return Tk(n)<5;if(1===lte(e,t))return!0;if(99===lte(e,t))return!1;for(const n of t.getSourceFiles())if(n!==e&&Im(n)&&!t.isSourceFileFromExternalLibrary(n)){if(n.commonJsModuleIndicator&&!n.externalModuleIndicator)return!0;if(n.externalModuleIndicator&&!n.commonJsModuleIndicator)return!1}return!0}function zee(e,t){return mt(n=>n?t.getPackageJsonAutoImportProvider().getTypeChecker():e.getTypeChecker())}function qee(e,t,n,r){const i=lQ(e.sourceFile,n);let o;if(t===fa._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code)o=function({sourceFile:e,program:t,host:n,preferences:r},i){const o=t.getTypeChecker(),a=function(e,t){const n=uD(e)?t.getSymbolAtLocation(e):void 0;if(kx(n))return n;const{parent:r}=e;if(Tu(r)&&r.tagName===e||QE(r)){const n=t.resolveName(t.getJsxNamespace(r),Tu(r)?e:r,111551,!1);if(kx(n))return n}return}(i,o);if(!a)return;const s=o.getAliasedSymbol(a),c=a.name,l=[{symbol:a,moduleSymbol:s,moduleFileName:void 0,exportKind:3,targetFlags:s.flags,isFromPackageJson:!1}],_=Jee(e,t);return Mee(l,void 0,!1,_,t,e,n,r).fixes.map(e=>{var t;return{fix:e,symbolName:c,errorIdentifierText:null==(t=rt(i,uD))?void 0:t.text}})}(e,i);else{if(!uD(i))return;if(t===fa._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code){const t=Se(Xee(e.sourceFile,e.program.getTypeChecker(),i,e.program.getCompilerOptions())),n=Gee(e.sourceFile,i,t,e.program);return n&&[{fix:n,symbolName:t,errorIdentifierText:i.text}]}o=Kee(e,i,r)}const a=HZ(e.sourceFile,e.preferences,e.host);return o&&Uee(o,e.sourceFile,e.program,a,e.host,e.preferences)}function Uee(e,t,n,r,i,o){const a=e=>Ho(e,i.getCurrentDirectory(),zy(i));return de(e,(e,i)=>jt(!!e.isJsxNamespaceFix,!!i.isJsxNamespaceFix)||xt(e.fix.kind,i.fix.kind)||Wee(e.fix,i.fix,t,n,o,r.allowsImportingSpecifier,a))}function Vee(e,t,n,r,i,o){if(H(e))return 0===e[0].kind||2===e[0].kind?e[0]:e.reduce((e,a)=>-1===Wee(a,e,t,n,o,r.allowsImportingSpecifier,e=>Ho(e,i.getCurrentDirectory(),zy(i)))?a:e)}function Wee(e,t,n,r,i,o,a){return 0!==e.kind&&0!==t.kind?jt("node_modules"!==t.moduleSpecifierKind||o(t.moduleSpecifier),"node_modules"!==e.moduleSpecifierKind||o(e.moduleSpecifier))||function(e,t,n){if("non-relative"===n.importModuleSpecifierPreference||"project-relative"===n.importModuleSpecifierPreference)return jt("relative"===e.moduleSpecifierKind,"relative"===t.moduleSpecifierKind);return 0}(e,t,i)||function(e,t,n,r){return Qt(e,"node:")&&!Qt(t,"node:")?_0(n,r)?-1:1:Qt(t,"node:")&&!Qt(e,"node:")?_0(n,r)?1:-1:0}(e.moduleSpecifier,t.moduleSpecifier,n,r)||jt($ee(e,n.path,a),$ee(t,n.path,a))||$S(e.moduleSpecifier,t.moduleSpecifier):0}function $ee(e,t,n){var r;if(e.isReExport&&(null==(r=e.exportInfo)?void 0:r.moduleFileName)&&"index"===Io(e.exportInfo.moduleFileName,[".js",".jsx",".d.ts",".ts",".tsx"],!0)){return Qt(t,n(Ao(e.exportInfo.moduleFileName)))}return!1}function Hee(e,t,n,r){if(n.getCompilerOptions().verbatimModuleSyntax&&1===function(e,t){return Am(e)?t.getEmitModuleFormatOfFile(e):KV(e,t.getCompilerOptions())}(e,n))return 3;switch(t){case 0:return 0;case 1:return 1;case 2:return function(e,t,n){const r=Fk(t),i=BS(e.fileName);if(!i&&Tk(t)>=5)return r?1:2;if(i)return e.externalModuleIndicator||n?r?1:2:3;for(const t of e.statements??_)if(CE(t)&&!Pd(t.moduleReference))return 3;return r?1:3}(e,n.getCompilerOptions(),!!r);case 3:return function(e,t,n){if(Fk(t.getCompilerOptions()))return 1;const r=Tk(t.getCompilerOptions());switch(r){case 2:case 1:case 3:return BS(e.fileName)&&(e.externalModuleIndicator||n)?2:3;case 4:case 5:case 6:case 7:case 99:case 0:case 200:return 2;case 100:case 101:case 102:case 199:return 99===lte(e,t)?2:3;default:return pn.assertNever(r,`Unexpected moduleKind ${r}`)}}(e,n,!!r);case 4:return 2;default:return pn.assertNever(t)}}function Kee({sourceFile:e,program:t,cancellationToken:n,host:r,preferences:i},o,a){const s=t.getTypeChecker(),c=t.getCompilerOptions();return L(Xee(e,s,o,c),s=>{if("default"===s)return;const c=CT(o),l=Jee(e,t),_=function(e,t,n,r,i,o,a,s,c){var l;const _=Ke(),u=HZ(i,c,s),d=null==(l=s.getModuleSpecifierCache)?void 0:l.call(s),p=mt(e=>_Y(e?s.getPackageJsonAutoImportProvider():o,s));function f(e,t,n,r,o,a){const s=p(a);if(S0(o,i,t,e,c,u,s,d)){const i=o.getTypeChecker();_.add(uZ(n,i).toString(),{symbol:n,moduleSymbol:e,moduleFileName:null==t?void 0:t.fileName,exportKind:r,targetFlags:_x(n,i).flags,isFromPackageJson:a})}}return C0(o,s,c,a,(i,o,a,s)=>{const c=a.getTypeChecker();r.throwIfCancellationRequested();const l=a.getCompilerOptions(),_=P0(i,c);_&&cte(c.getSymbolFlags(_.symbol),n)&&I0(_.symbol,c,Sk(l),(n,r)=>(t?r??n:n)===e)&&f(i,o,_.symbol,_.exportKind,a,s);const u=c.tryGetMemberInModuleExportsAndProperties(e,i);u&&cte(c.getSymbolFlags(u),n)&&f(i,o,u,0,a,s)}),_}(s,Sm(o),aX(o),n,e,t,a,r,i);return je(M(_.values(),n=>Mee(n,o.getStart(e),c,l,t,e,r,i).fixes),e=>({fix:e,symbolName:s,errorIdentifierText:o.text,isJsxNamespaceFix:s!==o.text}))})}function Gee(e,t,n,r){const i=r.getTypeChecker(),o=i.resolveName(n,t,111551,!0);if(!o)return;const a=i.getTypeOnlyAliasDeclaration(o);return a&&Sd(a)===e?{kind:4,typeOnlyAliasDeclaration:a}:void 0}function Xee(e,t,n,r){const i=n.parent;if((Tu(i)||GE(i))&&i.tagName===n&&f0(r.jsx)){const r=t.getJsxNamespace(e);if(function(e,t,n){if(Oy(t.text))return!0;const r=n.resolveName(e,t,111551,!0);return!r||H(r.declarations,Wl)&&!(111551&r.flags)}(r,n,t)){return!Oy(n.text)&&!t.resolveName(n.text,n,111551,!1)?[n.text,r]:[r]}}return[n.text]}function Qee(e,t,n,r,i,o,a){let s;const c=ide.ChangeTracker.with(e,e=>{s=function(e,t,n,r,i,o,a){const s=hY(t,a);switch(r.kind){case 0:return ete(e,t,r),[fa.Change_0_to_1,n,`${r.namespacePrefix}.${n}`];case 1:return tte(e,t,r,s),[fa.Change_0_to_1,n,nte(r.moduleSpecifier,s)+n];case 2:{const{importClauseOrBindingPattern:o,importKind:s,addAsTypeOnly:c,moduleSpecifier:l}=r;Zee(e,t,o,1===s?{name:n,addAsTypeOnly:c}:void 0,0===s?[{name:n,addAsTypeOnly:c}]:_,void 0,a);const u=Iy(l);return i?[fa.Import_0_from_1,n,u]:[fa.Update_import_from_0,u]}case 3:{const{importKind:c,moduleSpecifier:l,addAsTypeOnly:_,useRequire:u,qualification:d}=r;return NY(e,t,(u?ate:ote)(l,s,1===c?{name:n,addAsTypeOnly:_}:void 0,0===c?[{name:n,addAsTypeOnly:_}]:void 0,2===c||3===c?{importKind:c,name:(null==d?void 0:d.namespacePrefix)||n,addAsTypeOnly:_}:void 0,o.getCompilerOptions(),a),!0,a),d&&ete(e,t,d),i?[fa.Import_0_from_1,n,l]:[fa.Add_import_from_0,l]}case 4:{const{typeOnlyAliasDeclaration:i}=r,s=function(e,t,n,r,i){const o=n.getCompilerOptions(),a=o.verbatimModuleSyntax;switch(t.kind){case 277:if(t.isTypeOnly){if(t.parent.elements.length>1){const n=bw.updateImportSpecifier(t,!1,t.propertyName,t.name),{specifierComparer:o}=y_e.getNamedImportSpecifierComparerWithDetection(t.parent.parent.parent,i,r),a=y_e.getImportSpecifierInsertionIndex(t.parent.elements,n,o);if(a!==t.parent.elements.indexOf(t))return e.delete(r,t),e.insertImportSpecifierAtIndex(r,n,t.parent,a),t}return e.deleteRange(r,{pos:Wd(t.getFirstToken()),end:Wd(t.propertyName??t.name)}),t}return pn.assert(t.parent.parent.isTypeOnly),s(t.parent.parent),t.parent.parent;case 274:return s(t),t;case 275:return s(t.parent),t.parent;case 272:return e.deleteRange(r,t.getChildAt(1)),t;default:pn.failBadSyntaxKind(t)}function s(s){var c;if(e.delete(r,DY(s,r)),!o.allowImportingTsExtensions){const t=kg(s.parent),i=t&&(null==(c=n.getResolvedModuleFromModuleSpecifier(t,r))?void 0:c.resolvedModule);if(null==i?void 0:i.resolvedUsingTsExtension){const n=Qo(t.text,_U(t.text,o));e.replaceNode(r,t,bw.createStringLiteral(n))}}if(a){const n=rt(s.namedBindings,LE);if(n&&n.elements.length>1){!1!==y_e.getNamedImportSpecifierComparerWithDetection(s.parent,i,r).isSorted&&277===t.kind&&0!==n.elements.indexOf(t)&&(e.delete(r,t),e.insertImportSpecifierAtIndex(r,t,n,0));for(const i of n.elements)i===t||i.isTypeOnly||e.insertModifierBefore(r,156,i)}}}}(e,i,o,t,a);return 277===s.kind?[fa.Remove_type_from_import_of_0_from_1,n,Yee(s.parent.parent)]:[fa.Remove_type_from_import_declaration_from_0,Yee(s)]}default:return pn.assertNever(r,`Unexpected fix kind ${r.kind}`)}}(e,t,n,r,i,o,a)});return K7(Cee,c,s,wee,fa.Add_all_missing_imports)}function Yee(e){var t,n;return 272===e.kind?(null==(n=rt(null==(t=rt(e.moduleReference,WE))?void 0:t.expression,Ju))?void 0:n.text)||e.moduleReference.getText():it(e.parent.moduleSpecifier,KN).text}function Zee(e,t,n,r,i,o,a){var s;if(207===n.kind){if(o&&n.elements.some(e=>o.has(e)))return void e.replaceNode(t,n,bw.createObjectBindingPattern([...n.elements.filter(e=>!o.has(e)),...r?[bw.createBindingElement(void 0,"default",r.name)]:_,...i.map(e=>bw.createBindingElement(void 0,e.propertyName,e.name))]));r&&u(n,r.name,"default");for(const e of i)u(n,e.name,e.propertyName);return}const c=n.isTypeOnly&&H([r,...i],e=>4===(null==e?void 0:e.addAsTypeOnly)),l=n.namedBindings&&(null==(s=rt(n.namedBindings,LE))?void 0:s.elements);if(r&&(pn.assert(!n.name,"Cannot add a default import to an import clause that already has one"),e.insertNodeAt(t,n.getStart(t),bw.createIdentifier(r.name),{suffix:", "})),i.length){const{specifierComparer:r,isSorted:s}=y_e.getNamedImportSpecifierComparerWithDetection(n.parent,a,t),_=de(i.map(e=>bw.createImportSpecifier((!n.isTypeOnly||c)&&ite(e,a),void 0===e.propertyName?void 0:bw.createIdentifier(e.propertyName),bw.createIdentifier(e.name))),r);if(o)e.replaceNode(t,n.namedBindings,bw.updateNamedImports(n.namedBindings,de([...l.filter(e=>!o.has(e)),..._],r)));else if((null==l?void 0:l.length)&&!1!==s){const i=c&&l?bw.updateNamedImports(n.namedBindings,I(l,e=>bw.updateImportSpecifier(e,!0,e.propertyName,e.name))).elements:l;for(const o of _){const a=y_e.getImportSpecifierInsertionIndex(i,o,r);e.insertImportSpecifierAtIndex(t,o,n.namedBindings,a)}}else if(null==l?void 0:l.length)for(const n of _)e.insertNodeInListAfter(t,xe(l),n,l);else if(_.length){const r=bw.createNamedImports(_);n.namedBindings?e.replaceNode(t,n.namedBindings,r):e.insertNodeAfter(t,pn.checkDefined(n.name,"Import clause must have either named imports or a default import"),r)}}if(c&&(e.delete(t,DY(n,t)),l))for(const n of l)e.insertModifierBefore(t,156,n);function u(n,r,i){const o=bw.createBindingElement(void 0,i,r);n.elements.length?e.insertNodeInListAfter(t,xe(n.elements),o):e.replaceNode(t,n,bw.createObjectBindingPattern([o]))}}function ete(e,t,{namespacePrefix:n,usagePosition:r}){e.insertText(t,r,n+".")}function tte(e,t,{moduleSpecifier:n,usagePosition:r},i){e.insertText(t,r,nte(n,i))}function nte(e,t){const n=yY(t);return`import(${n}${e}${n}).`}function rte({addAsTypeOnly:e}){return 2===e}function ite(e,t){return rte(e)||!!t.preferTypeOnlyAutoImports&&4!==e.addAsTypeOnly}function ote(e,t,n,r,i,o,a){const s=fY(e,t);let c;if(void 0!==n||(null==r?void 0:r.length)){const i=(!n||rte(n))&&b(r,rte)||(o.verbatimModuleSyntax||a.preferTypeOnlyAutoImports)&&4!==(null==n?void 0:n.addAsTypeOnly)&&!H(r,e=>4===e.addAsTypeOnly);c=se(c,pY(n&&bw.createIdentifier(n.name),null==r?void 0:r.map(e=>bw.createImportSpecifier(!i&&ite(e,a),void 0===e.propertyName?void 0:bw.createIdentifier(e.propertyName),bw.createIdentifier(e.name))),e,t,i))}if(i){c=se(c,3===i.importKind?bw.createImportEqualsDeclaration(void 0,ite(i,a),bw.createIdentifier(i.name),bw.createExternalModuleReference(s)):bw.createImportDeclaration(void 0,bw.createImportClause(ite(i,a)?156:void 0,void 0,bw.createNamespaceImport(bw.createIdentifier(i.name))),s,void 0))}return pn.checkDefined(c)}function ate(e,t,n,r,i){const o=fY(e,t);let a;if(n||(null==r?void 0:r.length)){const e=(null==r?void 0:r.map(({name:e,propertyName:t})=>bw.createBindingElement(void 0,t,e)))||[];n&&e.unshift(bw.createBindingElement(void 0,"default",n.name));a=se(a,ste(bw.createObjectBindingPattern(e),o))}if(i){a=se(a,ste(i.name,o))}return pn.checkDefined(a)}function ste(e,t){return bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration("string"==typeof e?bw.createIdentifier(e):e,void 0,void 0,bw.createCallExpression(bw.createIdentifier("require"),void 0,[t]))],2))}function cte(e,t){return 7===t||(1&t?!!(111551&e):2&t?!!(788968&e):!!(4&t)&&!!(1920&e))}function lte(e,t){return Am(e)?t.getImpliedNodeFormatForEmit(e):GV(e,t.getCompilerOptions())}Q7({errorCodes:Nee,getCodeActions(e){const{errorCode:t,preferences:n,sourceFile:r,span:i,program:o}=e,a=qee(e,t,i.start,!0);if(a)return a.map(({fix:t,symbolName:i,errorIdentifierText:a})=>Qee(e,r,i,t,i!==a,o,n))},fixIds:[wee],getAllCodeActions:e=>{const{sourceFile:t,program:n,preferences:r,host:i,cancellationToken:o}=e,a=Fee(t,n,!0,r,i,o);return i5(e,Nee,t=>a.addImportFromDiagnostic(t,e)),t5(ide.ChangeTracker.with(e,a.writeFixes))}});var _te="addMissingConstraint",ute=[fa.Type_0_is_not_comparable_to_type_1.code,fa.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,fa.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,fa.Type_0_is_not_assignable_to_type_1.code,fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,fa.Property_0_is_incompatible_with_index_signature.code,fa.Property_0_in_type_1_is_not_assignable_to_type_2.code,fa.Type_0_does_not_satisfy_the_constraint_1.code];function dte(e,t,n){const r=x(e.getSemanticDiagnostics(t),e=>e.start===n.start&&e.length===n.length);if(void 0===r||void 0===r.relatedInformation)return;const i=x(r.relatedInformation,e=>e.code===fa.This_type_parameter_might_need_an_extends_0_constraint.code);if(void 0===i||void 0===i.file||void 0===i.start||void 0===i.length)return;let o=xoe(i.file,Gs(i.start,i.length));if(void 0!==o&&(uD(o)&&DD(o.parent)&&(o=o.parent),DD(o))){if(sF(o.parent))return;const r=lQ(t,n.start),a=function(e,t){if(T_(t.parent))return e.getTypeArgumentConstraint(t.parent);const n=K_(t)?e.getContextualType(t):void 0;return n||e.getTypeAtLocation(t)}(e.getTypeChecker(),r)||function(e){const[,t]=vV(e,"\n",0).match(/`extends (.*)`/)||[];return t}(i.messageText);return{constraint:a,declaration:o,token:r}}}function pte(e,t,n,r,i,o){const{declaration:a,constraint:s}=o,c=t.getTypeChecker();if(tt(s))e.insertText(i,a.name.end,` extends ${s}`);else{const o=Sk(t.getCompilerOptions()),l=Yie({program:t,host:r}),_=Dee(i,t,n,r),u=ioe(c,_,s,void 0,o,void 0,void 0,l);u&&(e.replaceNode(i,a,bw.updateTypeParameterDeclaration(a,void 0,a.name,u,a.default)),_.writeFixes(e))}}Q7({errorCodes:ute,getCodeActions(e){const{sourceFile:t,span:n,program:r,preferences:i,host:o}=e,a=dte(r,t,n);if(void 0===a)return;const s=ide.ChangeTracker.with(e,e=>pte(e,r,i,o,t,a));return[K7(_te,s,fa.Add_extends_constraint,_te,fa.Add_extends_constraint_to_all_type_parameters)]},fixIds:[_te],getAllCodeActions:e=>{const{program:t,preferences:n,host:r}=e,i=new Set;return t5(ide.ChangeTracker.with(e,o=>{i5(e,ute,e=>{const a=dte(t,e.file,Gs(e.start,e.length));if(a&&Cx(i,_J(a.declaration)))return pte(o,t,n,r,e.file,a)})}))}});var fte="fixOverrideModifier",mte="fixAddOverrideModifier",gte="fixRemoveOverrideModifier",hte=[fa.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,fa.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,fa.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,fa.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,fa.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code,fa.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code,fa.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code],yte={[fa.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:fa.Add_override_modifier,fixId:mte,fixAllDescriptions:fa.Add_all_missing_override_modifiers},[fa.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:fa.Add_override_modifier,fixId:mte,fixAllDescriptions:fa.Add_all_missing_override_modifiers},[fa.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:fa.Remove_override_modifier,fixId:gte,fixAllDescriptions:fa.Remove_all_unnecessary_override_modifiers},[fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:fa.Remove_override_modifier,fixId:gte,fixAllDescriptions:fa.Remove_override_modifier},[fa.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]:{descriptions:fa.Add_override_modifier,fixId:mte,fixAllDescriptions:fa.Add_all_missing_override_modifiers},[fa.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:fa.Add_override_modifier,fixId:mte,fixAllDescriptions:fa.Add_all_missing_override_modifiers},[fa.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]:{descriptions:fa.Add_override_modifier,fixId:mte,fixAllDescriptions:fa.Remove_all_unnecessary_override_modifiers},[fa.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:fa.Remove_override_modifier,fixId:gte,fixAllDescriptions:fa.Remove_all_unnecessary_override_modifiers},[fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:fa.Remove_override_modifier,fixId:gte,fixAllDescriptions:fa.Remove_all_unnecessary_override_modifiers}};function vte(e,t,n,r){switch(n){case fa.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:case fa.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:case fa.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:case fa.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:case fa.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:return function(e,t,n){const r=xte(t,n);if(Im(t))return void e.addJSDocTags(t,r,[bw.createJSDocOverrideTag(bw.createIdentifier("override"))]);const i=r.modifiers||_,o=x(i,vD),a=x(i,bD),s=x(i,e=>RQ(e.kind)),c=k(i,ED),l=a?a.end:o?o.end:s?s.end:c?ts(t.text,c.end):r.getStart(t),u=s||o||a?{prefix:" "}:{suffix:" "};e.insertModifierAt(t,l,164,u)}(e,t.sourceFile,r);case fa.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:case fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code:case fa.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:case fa.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code:return function(e,t,n){const r=xte(t,n);if(Im(t))return void e.filterJSDocTags(t,r,rn(BP));const i=x(r.modifiers,xD);pn.assertIsDefined(i),e.deleteModifier(t,i)}(e,t.sourceFile,r);default:pn.fail("Unexpected error code: "+n)}}function bte(e){switch(e.kind){case 177:case 173:case 175:case 178:case 179:return!0;case 170:return rc(e,e.parent);default:return!1}}function xte(e,t){const n=mc(lQ(e,t),e=>m_(e)?"quit":bte(e));return pn.assert(n&&bte(n)),n}Q7({errorCodes:hte,getCodeActions:function(e){const{errorCode:t,span:n}=e,r=yte[t];if(!r)return _;const{descriptions:i,fixId:o,fixAllDescriptions:a}=r,s=ide.ChangeTracker.with(e,r=>vte(r,e,t,n.start));return[G7(fte,s,i,o,a)]},fixIds:[fte,mte,gte],getAllCodeActions:e=>r5(e,hte,(t,n)=>{const{code:r,start:i}=n,o=yte[r];o&&o.fixId===e.fixId&&vte(t,e,r,i)})});var kte="fixNoPropertyAccessFromIndexSignature",Ste=[fa.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code];function Tte(e,t,n,r){const i=hY(t,r),o=bw.createStringLiteral(n.name.text,0===i);e.replaceNode(t,n,yl(n)?bw.createElementAccessChain(n.expression,n.questionDotToken,o):bw.createElementAccessExpression(n.expression,o))}function Cte(e,t){return it(lQ(e,t).parent,hF)}Q7({errorCodes:Ste,fixIds:[kte],getCodeActions(e){const{sourceFile:t,span:n,preferences:r}=e,i=Cte(t,n.start),o=ide.ChangeTracker.with(e,t=>Tte(t,e.sourceFile,i,r));return[K7(kte,o,[fa.Use_element_access_for_0,i.name.text],kte,fa.Use_element_access_for_all_undeclared_properties)]},getAllCodeActions:e=>r5(e,Ste,(t,n)=>Tte(t,n.file,Cte(n.file,n.start),e.preferences))});var wte="fixImplicitThis",Nte=[fa.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function Dte(e,t,n,r){const i=lQ(t,n);if(!OX(i))return;const o=im(i,!1,!1);if((gE(o)||TF(o))&&!dP(im(o,!1,!1))){const n=pn.checkDefined(GX(o,100,t)),{name:i}=o,a=pn.checkDefined(o.body);if(TF(o)){if(i&&jce.Core.isSymbolReferencedInFile(i,r,t,a))return;return e.delete(t,n),i&&e.delete(t,i),e.insertText(t,a.pos," =>"),[fa.Convert_function_expression_0_to_arrow_function,i?i.text:FZ]}return e.replaceNode(t,n,bw.createToken(87)),e.insertText(t,i.end," = "),e.insertText(t,a.pos," =>"),[fa.Convert_function_declaration_0_to_arrow_function,i.text]}}Q7({errorCodes:Nte,getCodeActions:function(e){const{sourceFile:t,program:n,span:r}=e;let i;const o=ide.ChangeTracker.with(e,e=>{i=Dte(e,t,r.start,n.getTypeChecker())});return i?[K7(wte,o,i,wte,fa.Fix_all_implicit_this_errors)]:_},fixIds:[wte],getAllCodeActions:e=>r5(e,Nte,(t,n)=>{Dte(t,n.file,n.start,e.program.getTypeChecker())})});var Fte="fixImportNonExportedMember",Ete=[fa.Module_0_declares_1_locally_but_it_is_not_exported.code];function Pte(e,t,n){var r,i;const o=lQ(e,t);if(uD(o)){const t=mc(o,wE);if(void 0===t)return;const a=KN(t.moduleSpecifier)?t.moduleSpecifier:void 0;if(void 0===a)return;const s=null==(r=n.getResolvedModuleFromModuleSpecifier(a,e))?void 0:r.resolvedModule;if(void 0===s)return;const c=n.getSourceFile(s.resolvedFileName);if(void 0===c||m0(n,c))return;const l=null==(i=rt(c.symbol.valueDeclaration,uu))?void 0:i.locals;if(void 0===l)return;const _=l.get(o.escapedText);if(void 0===_)return;const u=function(e){if(void 0===e.valueDeclaration)return ge(e.declarations);const t=e.valueDeclaration,n=fE(t)?rt(t.parent.parent,XF):void 0;return n&&1===d(n.declarationList.declarations)?n:t}(_);if(void 0===u)return;return{exportName:{node:o,isTypeOnly:GT(u)},node:u,moduleSourceFile:c,moduleSpecifier:a.text}}}function Ate(e,t,n,r,i){d(r)&&(i?Ote(e,t,n,i,r):Lte(e,t,n,r))}function Ite(e,t){return k(e.statements,e=>RE(e)&&(t&&e.isTypeOnly||!e.isTypeOnly))}function Ote(e,t,n,r,i){const o=r.exportClause&&BE(r.exportClause)?r.exportClause.elements:bw.createNodeArray([]),a=!(r.isTypeOnly||!Nk(t.getCompilerOptions())&&!x(o,e=>e.isTypeOnly));e.replaceNode(n,r,bw.updateExportDeclaration(r,r.modifiers,r.isTypeOnly,bw.createNamedExports(bw.createNodeArray([...o,...jte(i,a)],o.hasTrailingComma)),r.moduleSpecifier,r.attributes))}function Lte(e,t,n,r){e.insertNodeAtEndOfScope(n,n,bw.createExportDeclaration(void 0,!1,bw.createNamedExports(jte(r,Nk(t.getCompilerOptions()))),void 0,void 0))}function jte(e,t){return bw.createNodeArray(P(e,e=>bw.createExportSpecifier(t&&e.isTypeOnly,void 0,e.node)))}Q7({errorCodes:Ete,fixIds:[Fte],getCodeActions(e){const{sourceFile:t,span:n,program:r}=e,i=Pte(t,n.start,r);if(void 0===i)return;const o=ide.ChangeTracker.with(e,e=>function(e,t,{exportName:n,node:r,moduleSourceFile:i}){const o=Ite(i,n.isTypeOnly);o?Ote(e,t,i,o,[n]):XT(r)?e.insertExportModifier(i,r):Lte(e,t,i,[n])}(e,r,i));return[K7(Fte,o,[fa.Export_0_from_module_1,i.exportName.node.text,i.moduleSpecifier],Fte,fa.Export_all_referenced_locals)]},getAllCodeActions(e){const{program:t}=e;return t5(ide.ChangeTracker.with(e,n=>{const r=new Map;i5(e,Ete,e=>{const i=Pte(e.file,e.start,t);if(void 0===i)return;const{exportName:o,node:a,moduleSourceFile:s}=i;if(void 0===Ite(s,o.isTypeOnly)&&XT(a))n.insertExportModifier(s,a);else{const e=r.get(s)||{typeOnlyExports:[],exports:[]};o.isTypeOnly?e.typeOnlyExports.push(o):e.exports.push(o),r.set(s,e)}}),r.forEach((e,r)=>{const i=Ite(r,!0);i&&i.isTypeOnly?(Ate(n,t,r,e.typeOnlyExports,i),Ate(n,t,r,e.exports,Ite(r,!1))):Ate(n,t,r,[...e.exports,...e.typeOnlyExports],i)})}))}});var Mte="fixIncorrectNamedTupleSyntax";Q7({errorCodes:[fa.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,fa.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code],getCodeActions:function(e){const{sourceFile:t,span:n}=e,r=function(e,t){const n=lQ(e,t);return mc(n,e=>203===e.kind)}(t,n.start),i=ide.ChangeTracker.with(e,e=>function(e,t,n){if(!n)return;let r=n.type,i=!1,o=!1;for(;191===r.kind||192===r.kind||197===r.kind;)191===r.kind?i=!0:192===r.kind&&(o=!0),r=r.type;const a=bw.updateNamedTupleMember(n,n.dotDotDotToken||(o?bw.createToken(26):void 0),n.name,n.questionToken||(i?bw.createToken(58):void 0),r);if(a===n)return;e.replaceNode(t,n,a)}(e,t,r));return[K7(Mte,i,fa.Move_labeled_tuple_element_modifiers_to_labels,Mte,fa.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[Mte]});var Rte="fixSpelling",Bte=[fa.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,fa.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,fa.Cannot_find_name_0_Did_you_mean_1.code,fa.Could_not_find_name_0_Did_you_mean_1.code,fa.Cannot_find_namespace_0_Did_you_mean_1.code,fa.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,fa.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,fa._0_has_no_exported_member_named_1_Did_you_mean_2.code,fa.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,fa.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.code,fa.No_overload_matches_this_call.code,fa.Type_0_is_not_assignable_to_type_1.code];function Jte(e,t,n,r){const i=lQ(e,t),o=i.parent;if((r===fa.No_overload_matches_this_call.code||r===fa.Type_0_is_not_assignable_to_type_1.code)&&!ZE(o))return;const a=n.program.getTypeChecker();let s;if(hF(o)&&o.name===i){pn.assert(gl(i),"Expected an identifier for spelling (property access)");let e=a.getTypeAtLocation(o.expression);64&o.flags&&(e=a.getNonNullableType(e)),s=a.getSuggestedSymbolForNonexistentProperty(i,e)}else if(AF(o)&&103===o.operatorToken.kind&&o.left===i&&dD(i)){const e=a.getTypeAtLocation(o.right);s=a.getSuggestedSymbolForNonexistentProperty(i,e)}else if(wD(o)&&o.right===i){const e=a.getSymbolAtLocation(o.left);e&&1536&e.flags&&(s=a.getSuggestedSymbolForNonexistentModule(o.right,e))}else if(jE(o)&&o.name===i){pn.assertNode(i,uD,"Expected an identifier for spelling (import)");const t=function(e,t,n){var r;if(!t||!Ju(t.moduleSpecifier))return;const i=null==(r=e.program.getResolvedModuleFromModuleSpecifier(t.moduleSpecifier,n))?void 0:r.resolvedModule;return i?e.program.getSourceFile(i.resolvedFileName):void 0}(n,mc(i,wE),e);t&&t.symbol&&(s=a.getSuggestedSymbolForNonexistentModule(i,t.symbol))}else if(ZE(o)&&o.name===i){pn.assertNode(i,uD,"Expected an identifier for JSX attribute");const e=mc(i,Tu),t=a.getContextualTypeForArgumentAtIndex(e,0);s=a.getSuggestedSymbolForNonexistentJSXAttribute(i,t)}else if(Lv(o)&&f_(o)&&o.name===i){const e=mc(i,m_),t=e?kh(e):void 0,n=t?a.getTypeAtLocation(t):void 0;n&&(s=a.getSuggestedSymbolForNonexistentClassMember(ep(i),n))}else{const e=aX(i),t=ep(i);pn.assert(void 0!==t,"name should be defined"),s=a.getSuggestedSymbolForNonexistentSymbol(i,t,function(e){let t=0;4&e&&(t|=1920);2&e&&(t|=788968);1&e&&(t|=111551);return t}(e))}return void 0===s?void 0:{node:i,suggestedSymbol:s}}function zte(e,t,n,r,i){const o=kc(r);if(!vs(o,i)&&hF(n.parent)){const i=r.valueDeclaration;i&&Nc(i)&&dD(i.name)?e.replaceNode(t,n,bw.createIdentifier(o)):e.replaceNode(t,n.parent,bw.createElementAccessExpression(n.parent.expression,bw.createStringLiteral(o)))}else e.replaceNode(t,n,bw.createIdentifier(o))}Q7({errorCodes:Bte,getCodeActions(e){const{sourceFile:t,errorCode:n}=e,r=Jte(t,e.span.start,e,n);if(!r)return;const{node:i,suggestedSymbol:o}=r,a=Sk(e.host.getCompilationSettings());return[K7("spelling",ide.ChangeTracker.with(e,e=>zte(e,t,i,o,a)),[fa.Change_spelling_to_0,kc(o)],Rte,fa.Fix_all_detected_spelling_errors)]},fixIds:[Rte],getAllCodeActions:e=>r5(e,Bte,(t,n)=>{const r=Jte(n.file,n.start,e,n.code),i=Sk(e.host.getCompilationSettings());r&&zte(t,e.sourceFile,r.node,r.suggestedSymbol,i)})});var qte="returnValueCorrect",Ute="fixAddReturnStatement",Vte="fixRemoveBracesFromArrowFunctionBody",Wte="fixWrapTheBlockWithParen",$te=[fa.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code,fa.Type_0_is_not_assignable_to_type_1.code,fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];function Hte(e,t,n){const r=e.createSymbol(4,t.escapedText);r.links.type=e.getTypeAtLocation(n);const i=Zu([r]);return e.createAnonymousType(void 0,i,[],[],[])}function Kte(e,t,n,r){if(!t.body||!GF(t.body)||1!==d(t.body.statements))return;const i=ye(t.body.statements);if(YF(i)&&Gte(e,t,e.getTypeAtLocation(i.expression),n,r))return{declaration:t,kind:0,expression:i.expression,statement:i,commentSource:i.expression};if(_E(i)&&YF(i.statement)){const o=bw.createObjectLiteralExpression([bw.createPropertyAssignment(i.label,i.statement.expression)]);if(Gte(e,t,Hte(e,i.label,i.statement.expression),n,r))return CF(t)?{declaration:t,kind:1,expression:o,statement:i,commentSource:i.statement.expression}:{declaration:t,kind:0,expression:o,statement:i,commentSource:i.statement.expression}}else if(GF(i)&&1===d(i.statements)){const o=ye(i.statements);if(_E(o)&&YF(o.statement)){const a=bw.createObjectLiteralExpression([bw.createPropertyAssignment(o.label,o.statement.expression)]);if(Gte(e,t,Hte(e,o.label,o.statement.expression),n,r))return{declaration:t,kind:0,expression:a,statement:i,commentSource:o}}}}function Gte(e,t,n,r,i){if(i){const r=e.getSignatureFromDeclaration(t);if(r){Av(t,1024)&&(n=e.createPromiseType(n));const i=e.createSignature(t,r.typeParameters,r.thisParameter,r.parameters,n,void 0,r.minArgumentCount,r.flags);n=e.createAnonymousType(void 0,Zu(),[i],[],[])}else n=e.getAnyType()}return e.isTypeAssignableTo(n,r)}function Xte(e,t,n,r){const i=lQ(t,n);if(!i.parent)return;const o=mc(i.parent,l_);switch(r){case fa.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code:if(!(o&&o.body&&o.type&&tx(o.type,i)))return;return Kte(e,o,e.getTypeFromTypeNode(o.type),!1);case fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!vF(o.parent)||!o.body)return;const t=o.parent.arguments.indexOf(o);if(-1===t)return;const n=e.getContextualTypeForArgumentAtIndex(o.parent,t);if(!n)return;return Kte(e,o,n,!0);case fa.Type_0_is_not_assignable_to_type_1.code:if(!ph(i)||!jf(i.parent)&&!ZE(i.parent))return;const r=function(e){switch(e.kind){case 261:case 170:case 209:case 173:case 304:return e.initializer;case 292:return e.initializer&&(nP(e.initializer)?e.initializer.expression:void 0);case 305:case 172:case 307:case 349:case 342:return}}(i.parent);if(!r||!l_(r)||!r.body)return;return Kte(e,r,e.getTypeAtLocation(i.parent),!0)}}function Qte(e,t,n,r){KC(n);const i=MZ(t);e.replaceNode(t,r,bw.createReturnStatement(n),{leadingTriviaOption:ide.LeadingTriviaOption.Exclude,trailingTriviaOption:ide.TrailingTriviaOption.Exclude,suffix:i?";":void 0})}function Yte(e,t,n,r,i,o){const a=o||kZ(r)?bw.createParenthesizedExpression(r):r;KC(i),fZ(i,a),e.replaceNode(t,n.body,a)}function Zte(e,t,n,r){e.replaceNode(t,n.body,bw.createParenthesizedExpression(r))}function ene(e,t,n){const r=ide.ChangeTracker.with(e,r=>Qte(r,e.sourceFile,t,n));return K7(qte,r,fa.Add_a_return_statement,Ute,fa.Add_all_missing_return_statement)}function tne(e,t,n){const r=ide.ChangeTracker.with(e,r=>Zte(r,e.sourceFile,t,n));return K7(qte,r,fa.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,Wte,fa.Wrap_all_object_literal_with_parentheses)}Q7({errorCodes:$te,fixIds:[Ute,Vte,Wte],getCodeActions:function(e){const{program:t,sourceFile:n,span:{start:r},errorCode:i}=e,o=Xte(t.getTypeChecker(),n,r,i);if(o)return 0===o.kind?ae([ene(e,o.expression,o.statement)],CF(o.declaration)?function(e,t,n,r){const i=ide.ChangeTracker.with(e,i=>Yte(i,e.sourceFile,t,n,r,!1));return K7(qte,i,fa.Remove_braces_from_arrow_function_body,Vte,fa.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}(e,o.declaration,o.expression,o.commentSource):void 0):[tne(e,o.declaration,o.expression)]},getAllCodeActions:e=>r5(e,$te,(t,n)=>{const r=Xte(e.program.getTypeChecker(),n.file,n.start,n.code);if(r)switch(e.fixId){case Ute:Qte(t,n.file,r.expression,r.statement);break;case Vte:if(!CF(r.declaration))return;Yte(t,n.file,r.declaration,r.expression,r.commentSource,!1);break;case Wte:if(!CF(r.declaration))return;Zte(t,n.file,r.declaration,r.expression);break;default:pn.fail(JSON.stringify(e.fixId))}})});var nne="fixMissingMember",rne="fixMissingProperties",ine="fixMissingAttributes",one="fixMissingFunctionDeclaration",ane=[fa.Property_0_does_not_exist_on_type_1.code,fa.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,fa.Property_0_is_missing_in_type_1_but_required_in_type_2.code,fa.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,fa.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,fa.Cannot_find_name_0.code,fa.Type_0_does_not_satisfy_the_expected_type_1.code];function sne(e,t,n,r,i){var o,a;const s=lQ(e,t),c=s.parent;if(n===fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(19!==s.kind||!gF(c)||!vF(c.parent))return;const e=S(c.parent.arguments,e=>e===c);if(e<0)return;const t=r.getResolvedSignature(c.parent);if(!(t&&t.declaration&&t.parameters[e]))return;const n=t.parameters[e].valueDeclaration;if(!(n&&FD(n)&&uD(n.name)))return;const i=je(r.getUnmatchedProperties(r.getTypeAtLocation(c),r.getParameterType(t,e).getNonNullableType(),!1,!1));if(!d(i))return;return{kind:3,token:n.name,identifier:n.name.text,properties:i,parentDeclaration:c}}if(19===s.kind||zF(c)||sE(c)){const e=(zF(c)||sE(c))&&c.expression?c.expression:c;if(gF(e)){const t=zF(c)?r.getTypeFromTypeNode(c.type):r.getContextualType(e)||r.getTypeAtLocation(e),n=je(r.getUnmatchedProperties(r.getTypeAtLocation(c),t.getNonNullableType(),!1,!1));if(!d(n))return;return{kind:3,token:c,identifier:void 0,properties:n,parentDeclaration:e,indentation:sE(e.parent)||LF(e.parent)?0:void 0}}}if(!gl(s))return;if(uD(s)&&Ou(c)&&c.initializer&&gF(c.initializer)){const e=null==(o=r.getContextualType(s)||r.getTypeAtLocation(s))?void 0:o.getNonNullableType(),t=je(r.getUnmatchedProperties(r.getTypeAtLocation(c.initializer),e,!1,!1));if(!d(t))return;return{kind:3,token:s,identifier:s.text,properties:t,parentDeclaration:c.initializer}}if(uD(s)&&Tu(s.parent)){const e=function(e,t,n){const r=e.getContextualType(n.attributes);if(void 0===r)return _;const i=r.getProperties();if(!d(i))return _;const o=new Set;for(const t of n.attributes.properties)if(ZE(t)&&o.add(aC(t.name)),tP(t)){const n=e.getTypeAtLocation(t.expression);for(const e of n.getProperties())o.add(e.escapedName)}return D(i,e=>vs(e.name,t,1)&&!(16777216&e.flags||48&cx(e)||o.has(e.escapedName)))}(r,Sk(i.getCompilerOptions()),s.parent);if(!d(e))return;return{kind:4,token:s,attributes:e,parentDeclaration:s.parent}}if(uD(s)){const t=null==(a=r.getContextualType(s))?void 0:a.getNonNullableType();if(t&&16&xx(t)){const n=ge(r.getSignaturesOfType(t,0));if(void 0===n)return;return{kind:5,token:s,signature:n,sourceFile:e,parentDeclaration:bne(s)}}if(vF(c)&&c.expression===s)return{kind:2,token:s,call:c,sourceFile:e,modifierFlags:0,parentDeclaration:bne(s)}}if(!hF(c))return;const l=oY(r.getTypeAtLocation(c.expression)),u=l.symbol;if(!u||!u.declarations)return;if(uD(s)&&vF(c.parent)){const t=x(u.declarations,xE),n=null==t?void 0:t.getSourceFile();if(t&&n&&!m0(i,n))return{kind:2,token:s,call:c.parent,sourceFile:n,modifierFlags:32,parentDeclaration:t};const r=x(u.declarations,dP);if(e.commonJsModuleIndicator)return;if(r&&!m0(i,r))return{kind:2,token:s,call:c.parent,sourceFile:r,modifierFlags:32,parentDeclaration:r}}const p=x(u.declarations,m_);if(!p&&dD(s))return;const f=p||x(u.declarations,e=>yE(e)||HD(e));if(f&&!m0(i,f.getSourceFile())){const e=!HD(f)&&(l.target||l)!==r.getDeclaredTypeOfSymbol(u);if(e&&(dD(s)||yE(f)))return;const t=f.getSourceFile(),n=HD(f)?0:(e?256:0)|(c0(s.text)?2:0),i=Im(t);return{kind:0,token:s,call:rt(c.parent,vF),modifierFlags:n,parentDeclaration:f,declSourceFile:t,isJSFile:i}}const m=x(u.declarations,bE);return!m||1056&l.flags||dD(s)||m0(i,m.getSourceFile())?void 0:{kind:1,token:s,parentDeclaration:m}}function cne(e,t,n,r,i){const o=r.text;if(i){if(232===n.kind)return;const r=n.name.getText(),i=lne(bw.createIdentifier(r),o);e.insertNodeAfter(t,n,i)}else if(dD(r)){const r=bw.createPropertyDeclaration(void 0,o,void 0,void 0,void 0),i=dne(n);i?e.insertNodeAfter(t,i,r):e.insertMemberAtStart(t,n,r)}else{const r=cv(n);if(!r)return;const i=lne(bw.createThis(),o);e.insertNodeAtConstructorEnd(t,r,i)}}function lne(e,t){return bw.createExpressionStatement(bw.createAssignment(bw.createPropertyAccessExpression(e,t),vne()))}function _ne(e,t,n){let r;if(227===n.parent.parent.kind){const i=n.parent.parent,o=n.parent===i.left?i.right:i.left,a=e.getWidenedType(e.getBaseTypeOfLiteralType(e.getTypeAtLocation(o)));r=e.typeToTypeNode(a,t,1,8)}else{const t=e.getContextualType(n.parent);r=t?e.typeToTypeNode(t,void 0,1,8):void 0}return r||bw.createKeywordTypeNode(133)}function une(e,t,n,r,i,o){const a=o?bw.createNodeArray(bw.createModifiersFromModifierFlags(o)):void 0,s=m_(n)?bw.createPropertyDeclaration(a,r,void 0,i,void 0):bw.createPropertySignature(void 0,r,void 0,i),c=dne(n);c?e.insertNodeAfter(t,c,s):e.insertMemberAtStart(t,n,s)}function dne(e){let t;for(const n of e.members){if(!AD(n))break;t=n}return t}function pne(e,t,n,r,i,o,a){const s=Dee(a,e.program,e.preferences,e.host),c=noe(m_(o)?175:174,e,s,n,r,i,o),l=function(e,t){if(HD(e))return;const n=mc(t,e=>OD(e)||jD(e));return n&&n.parent===e?n:void 0}(o,n);l?t.insertNodeAfter(a,l,c):t.insertMemberAtStart(a,o,c),s.writeFixes(t)}function fne(e,t,{token:n,parentDeclaration:r}){const i=H(r.members,e=>{const n=t.getTypeAtLocation(e);return!!(n&&402653316&n.flags)}),o=r.getSourceFile(),a=bw.createEnumMember(n,i?bw.createStringLiteral(n.text):void 0),s=be(r.members);s?e.insertNodeInListAfter(o,s,a,r.members):e.insertMemberAtStart(o,r,a)}function mne(e,t,n){const r=hY(t.sourceFile,t.preferences),i=Dee(t.sourceFile,t.program,t.preferences,t.host),o=2===n.kind?noe(263,t,i,n.call,bc(n.token),n.modifierFlags,n.parentDeclaration):toe(263,t,r,n.signature,poe(fa.Function_not_implemented.message,r),n.token,void 0,void 0,void 0,i);void 0===o&&pn.fail("fixMissingFunctionDeclaration codefix got unexpected error."),sE(n.parentDeclaration)?e.insertNodeBefore(n.sourceFile,n.parentDeclaration,o,!0):e.insertNodeAtEndOfScope(n.sourceFile,n.parentDeclaration,o),i.writeFixes(e)}function gne(e,t,n){const r=Dee(t.sourceFile,t.program,t.preferences,t.host),i=hY(t.sourceFile,t.preferences),o=t.program.getTypeChecker(),a=n.parentDeclaration.attributes,s=H(a.properties,tP),c=P(n.attributes,e=>{const a=yne(t,o,r,i,o.getTypeOfSymbol(e),n.parentDeclaration),s=bw.createIdentifier(e.name),c=bw.createJsxAttribute(s,bw.createJsxExpression(void 0,a));return IT(s,c),c}),l=bw.createJsxAttributes(s?[...c,...a.properties]:[...a.properties,...c]),_={prefix:a.pos===a.end?" ":void 0};e.replaceNode(t.sourceFile,a,l,_),r.writeFixes(e)}function hne(e,t,n){const r=Dee(t.sourceFile,t.program,t.preferences,t.host),i=hY(t.sourceFile,t.preferences),o=Sk(t.program.getCompilerOptions()),a=t.program.getTypeChecker(),s=P(n.properties,e=>{const s=yne(t,a,r,i,a.getTypeOfSymbol(e),n.parentDeclaration);return bw.createPropertyAssignment(function(e,t,n,r){if(ed(e)){const t=r.symbolToNode(e,111551,void 0,void 0,1);if(t&&ND(t))return t}return $T(e.name,t,0===n,!1,!1)}(e,o,i,a),s)}),c={leadingTriviaOption:ide.LeadingTriviaOption.Exclude,trailingTriviaOption:ide.TrailingTriviaOption.Exclude,indentation:n.indentation};e.replaceNode(t.sourceFile,n.parentDeclaration,bw.createObjectLiteralExpression([...n.parentDeclaration.properties,...s],!0),c),r.writeFixes(e)}function yne(e,t,n,r,i,o){if(3&i.flags)return vne();if(134217732&i.flags)return bw.createStringLiteral("",0===r);if(8&i.flags)return bw.createNumericLiteral(0);if(64&i.flags)return bw.createBigIntLiteral("0n");if(16&i.flags)return bw.createFalse();if(1056&i.flags){const e=i.symbol.exports?he(i.symbol.exports.values()):i.symbol,n=i.symbol.parent&&256&i.symbol.parent.flags?i.symbol.parent:i.symbol,r=t.symbolToExpression(n,111551,void 0,64);return void 0===e||void 0===r?bw.createNumericLiteral(0):bw.createPropertyAccessExpression(r,t.symbolToString(e))}if(256&i.flags)return bw.createNumericLiteral(i.value);if(2048&i.flags)return bw.createBigIntLiteral(i.value);if(128&i.flags)return bw.createStringLiteral(i.value,0===r);if(512&i.flags)return i===t.getFalseType()||i===t.getFalseType(!0)?bw.createFalse():bw.createTrue();if(65536&i.flags)return bw.createNull();if(1048576&i.flags){return m(i.types,i=>yne(e,t,n,r,i,o))??vne()}if(t.isArrayLikeType(i))return bw.createArrayLiteralExpression();if(function(e){return 524288&e.flags&&(128&xx(e)||e.symbol&&rt(ke(e.symbol.declarations),HD))}(i)){const a=P(t.getPropertiesOfType(i),i=>{const a=yne(e,t,n,r,t.getTypeOfSymbol(i),o);return bw.createPropertyAssignment(i.name,a)});return bw.createObjectLiteralExpression(a,!0)}if(16&xx(i)){if(void 0===x(i.symbol.declarations||_,nn(VD,ID,OD)))return vne();const a=t.getSignaturesOfType(i,0);if(void 0===a)return vne();return toe(219,e,r,a[0],poe(fa.Function_not_implemented.message,r),void 0,void 0,void 0,o,n)??vne()}if(1&xx(i)){const e=bx(i.symbol);if(void 0===e||jv(e))return vne();const t=cv(e);return t&&d(t.parameters)?vne():bw.createNewExpression(bw.createIdentifier(i.symbol.name),void 0,void 0)}return vne()}function vne(){return bw.createIdentifier("undefined")}function bne(e){if(mc(e,nP)){const t=mc(e.parent,sE);if(t)return t}return Sd(e)}Q7({errorCodes:ane,getCodeActions(e){const t=e.program.getTypeChecker(),n=sne(e.sourceFile,e.span.start,e.errorCode,t,e.program);if(n){if(3===n.kind){const t=ide.ChangeTracker.with(e,t=>hne(t,e,n));return[K7(rne,t,fa.Add_missing_properties,rne,fa.Add_all_missing_properties)]}if(4===n.kind){const t=ide.ChangeTracker.with(e,t=>gne(t,e,n));return[K7(ine,t,fa.Add_missing_attributes,ine,fa.Add_all_missing_attributes)]}if(2===n.kind||5===n.kind){const t=ide.ChangeTracker.with(e,t=>mne(t,e,n));return[K7(one,t,[fa.Add_missing_function_declaration_0,n.token.text],one,fa.Add_all_missing_function_declarations)]}if(1===n.kind){const t=ide.ChangeTracker.with(e,t=>fne(t,e.program.getTypeChecker(),n));return[K7(nne,t,[fa.Add_missing_enum_member_0,n.token.text],nne,fa.Add_all_missing_members)]}return G(function(e,t){const{parentDeclaration:n,declSourceFile:r,modifierFlags:i,token:o,call:a}=t;if(void 0===a)return;const s=o.text,c=t=>ide.ChangeTracker.with(e,i=>pne(e,i,a,o,t,n,r)),l=[K7(nne,c(256&i),[256&i?fa.Declare_static_method_0:fa.Declare_method_0,s],nne,fa.Add_all_missing_members)];2&i&&l.unshift(H7(nne,c(2),[fa.Declare_private_method_0,s]));return l}(e,n),function(e,t){return t.isJSFile?an(function(e,{parentDeclaration:t,declSourceFile:n,modifierFlags:r,token:i}){if(yE(t)||HD(t))return;const o=ide.ChangeTracker.with(e,e=>cne(e,n,t,i,!!(256&r)));if(0===o.length)return;const a=256&r?fa.Initialize_static_property_0:dD(i)?fa.Declare_a_private_field_named_0:fa.Initialize_property_0_in_the_constructor;return K7(nne,o,[a,i.text],nne,fa.Add_all_missing_members)}(e,t)):function(e,{parentDeclaration:t,declSourceFile:n,modifierFlags:r,token:i}){const o=i.text,a=256&r,s=_ne(e.program.getTypeChecker(),t,i),c=r=>ide.ChangeTracker.with(e,e=>une(e,n,t,o,s,r)),l=[K7(nne,c(256&r),[a?fa.Declare_static_property_0:fa.Declare_property_0,o],nne,fa.Add_all_missing_members)];if(a||dD(i))return l;2&r&&l.unshift(H7(nne,c(2),[fa.Declare_private_property_0,o]));return l.push(function(e,t,n,r,i){const o=bw.createKeywordTypeNode(154),a=bw.createParameterDeclaration(void 0,void 0,"x",void 0,o,void 0),s=bw.createIndexSignature(void 0,[a],i),c=ide.ChangeTracker.with(e,e=>e.insertMemberAtStart(t,n,s));return H7(nne,c,[fa.Add_index_signature_for_property_0,r])}(e,n,t,i.text,s)),l}(e,t)}(e,n))}},fixIds:[nne,one,rne,ine],getAllCodeActions:e=>{const{program:t,fixId:n}=e,r=t.getTypeChecker(),i=new Set,o=new Map;return t5(ide.ChangeTracker.with(e,t=>{i5(e,ane,a=>{const s=sne(a.file,a.start,a.code,r,e.program);if(void 0===s)return;const c=_J(s.parentDeclaration)+"#"+(3===s.kind?s.identifier||_J(s.token):s.token.text);if(Cx(i,c))if(n!==one||2!==s.kind&&5!==s.kind){if(n===rne&&3===s.kind)hne(t,e,s);else if(n===ine&&4===s.kind)gne(t,e,s);else if(1===s.kind&&fne(t,r,s),0===s.kind){const{parentDeclaration:e,token:t}=s,n=q(o,e,()=>[]);n.some(e=>e.token.text===t.text)||n.push(s)}}else mne(t,e,s)}),o.forEach((n,i)=>{const a=HD(i)?void 0:function(e,t){const n=[];for(;e;){const r=Sh(e),i=r&&t.getSymbolAtLocation(r.expression);if(!i)break;const o=2097152&i.flags?t.getAliasedSymbol(i):i,a=o.declarations&&x(o.declarations,m_);if(!a)break;n.push(a),e=a}return n}(i,r);for(const i of n){if(null==a?void 0:a.some(e=>{const t=o.get(e);return!!t&&t.some(({token:e})=>e.text===i.token.text)}))continue;const{parentDeclaration:n,declSourceFile:s,modifierFlags:c,token:l,call:_,isJSFile:u}=i;if(_&&!dD(l))pne(e,t,_,l,256&c,n,s);else if(!u||yE(n)||HD(n)){const e=_ne(r,n,l);une(t,s,n,l.text,e,256&c)}else cne(t,s,n,l,!!(256&c))}})}))}});var xne="addMissingNewOperator",kne=[fa.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];function Sne(e,t,n){const r=it(function(e,t){let n=lQ(e,t.start);const r=Is(t);for(;n.endSne(e,t,n));return[K7(xne,r,fa.Add_missing_new_operator_to_call,xne,fa.Add_missing_new_operator_to_all_calls)]},fixIds:[xne],getAllCodeActions:e=>r5(e,kne,(t,n)=>Sne(t,e.sourceFile,n))});var Tne="addMissingParam",Cne="addOptionalParam",wne=[fa.Expected_0_arguments_but_got_1.code];function Nne(e,t,n){const r=mc(lQ(e,n),vF);if(void 0===r||0===d(r.arguments))return;const i=t.getTypeChecker(),o=D(i.getTypeAtLocation(r.expression).symbol.declarations,Ene);if(void 0===o)return;const a=be(o);if(void 0===a||void 0===a.body||m0(t,a.getSourceFile()))return;const s=function(e){const t=Fc(e);if(t)return t;if(fE(e.parent)&&uD(e.parent.name)||AD(e.parent)||FD(e.parent))return e.parent.name}(a);if(void 0===s)return;const c=[],l=[],_=d(a.parameters),u=d(r.arguments);if(_>u)return;const p=[a,...Ane(a,o)];for(let e=0,t=0,n=0;e{const s=Sd(i),c=Dee(s,t,n,r);d(i.parameters)?e.replaceNodeRangeWithNodes(s,ye(i.parameters),xe(i.parameters),Pne(c,a,i,o),{joiner:", ",indentation:0,leadingTriviaOption:ide.LeadingTriviaOption.IncludeAll,trailingTriviaOption:ide.TrailingTriviaOption.Include}):p(Pne(c,a,i,o),(t,n)=>{0===d(i.parameters)&&0===n?e.insertNodeAt(s,i.parameters.end,t):e.insertNodeAtEndOfList(s,i.parameters,t)}),c.writeFixes(e)})}function Ene(e){switch(e.kind){case 263:case 219:case 175:case 220:return!0;default:return!1}}function Pne(e,t,n,r){const i=P(n.parameters,e=>bw.createParameterDeclaration(e.modifiers,e.dotDotDotToken,e.name,e.questionToken,e.type,e.initializer));for(const{pos:n,declaration:o}of r){const r=n>0?i[n-1]:void 0;i.splice(n,0,bw.updateParameterDeclaration(o,o.modifiers,o.dotDotDotToken,o.name,r&&r.questionToken?bw.createToken(58):o.questionToken,jne(e,o.type,t),o.initializer))}return i}function Ane(e,t){const n=[];for(const r of t)if(Ine(r)){if(d(r.parameters)===d(e.parameters)){n.push(r);continue}if(d(r.parameters)>d(e.parameters))return[]}return n}function Ine(e){return Ene(e)&&void 0===e.body}function One(e,t,n){return bw.createParameterDeclaration(void 0,void 0,e,n,t,void 0)}function Lne(e,t){return d(e)&&H(e,e=>tFne(t,e.program,e.preferences,e.host,r,i)),[d(i)>1?fa.Add_missing_parameters_to_0:fa.Add_missing_parameter_to_0,n],Tne,fa.Add_all_missing_parameters)),d(o)&&ae(a,K7(Cne,ide.ChangeTracker.with(e,t=>Fne(t,e.program,e.preferences,e.host,r,o)),[d(o)>1?fa.Add_optional_parameters_to_0:fa.Add_optional_parameter_to_0,n],Cne,fa.Add_all_optional_parameters)),a},getAllCodeActions:e=>r5(e,wne,(t,n)=>{const r=Nne(e.sourceFile,e.program,n.start);if(r){const{declarations:n,newParameters:i,newOptionalParameters:o}=r;e.fixId===Tne&&Fne(t,e.program,e.preferences,e.host,n,i),e.fixId===Cne&&Fne(t,e.program,e.preferences,e.host,n,o)}})});var Mne="installTypesPackage",Rne=fa.Cannot_find_module_0_or_its_corresponding_type_declarations.code,Bne=fa.This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed.code,Jne=[Rne,fa.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,Bne];function zne(e,t){return{type:"install package",file:e,packageName:t}}function qne(e,t){const n=rt(lQ(e,t),KN);if(!n)return;const r=n.text,{packageName:i}=wR(r);return Fs(i)?void 0:i}function Une(e,t,n){var r;return n===Rne?AC.has(e)?"@types/node":void 0:(null==(r=t.isKnownTypesPackageName)?void 0:r.call(t,e))?zR(e):void 0}Q7({errorCodes:Jne,getCodeActions:function(e){const{host:t,sourceFile:n,span:{start:r},errorCode:i}=e,o=i===Bne?Zk(e.program.getCompilerOptions(),n):qne(n,r);if(void 0===o)return;const a=Une(o,t,i);return void 0===a?[]:[K7("fixCannotFindModule",[],[fa.Install_0,a],Mne,fa.Install_all_missing_types_packages,zne(n.fileName,a))]},fixIds:[Mne],getAllCodeActions:e=>r5(e,Jne,(t,n,r)=>{const i=qne(n.file,n.start);if(void 0!==i)switch(e.fixId){case Mne:{const t=Une(i,e.host,n.code);t&&r.push(zne(n.file.fileName,t));break}default:pn.fail(`Bad fixId: ${e.fixId}`)}})});var Vne=[fa.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,fa.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2.code,fa.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more.code,fa.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code,fa.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1.code,fa.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more.code],Wne="fixClassDoesntImplementInheritedAbstractMember";function $ne(e,t){return it(lQ(e,t).parent,m_)}function Hne(e,t,n,r,i){const o=kh(e),a=n.program.getTypeChecker(),s=a.getTypeAtLocation(o),c=a.getPropertiesOfType(s).filter(Kne),l=Dee(t,n.program,i,n.host);Qie(e,c,t,n,i,l,n=>r.insertMemberAtStart(t,e,n)),l.writeFixes(r)}function Kne(e){const t=$v(ye(e.getDeclarations()));return!(2&t||!(64&t))}Q7({errorCodes:Vne,getCodeActions:function(e){const{sourceFile:t,span:n}=e,r=ide.ChangeTracker.with(e,r=>Hne($ne(t,n.start),t,e,r,e.preferences));return 0===r.length?void 0:[K7(Wne,r,fa.Implement_inherited_abstract_class,Wne,fa.Implement_all_inherited_abstract_classes)]},fixIds:[Wne],getAllCodeActions:function(e){const t=new Set;return r5(e,Vne,(n,r)=>{const i=$ne(r.file,r.start);Cx(t,_J(i))&&Hne(i,e.sourceFile,e,n,e.preferences)})}});var Gne="classSuperMustPrecedeThisAccess",Xne=[fa.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];function Qne(e,t,n,r){e.insertNodeAtConstructorStart(t,n,r),e.delete(t,r)}function Yne(e,t){const n=lQ(e,t);if(110!==n.kind)return;const r=Yf(n),i=Zne(r.body);return i&&!i.expression.arguments.some(e=>hF(e)&&e.expression===n)?{constructor:r,superCall:i}:void 0}function Zne(e){return YF(e)&&pf(e.expression)?e:s_(e)?void 0:iO(e,Zne)}Q7({errorCodes:Xne,getCodeActions(e){const{sourceFile:t,span:n}=e,r=Yne(t,n.start);if(!r)return;const{constructor:i,superCall:o}=r,a=ide.ChangeTracker.with(e,e=>Qne(e,t,i,o));return[K7(Gne,a,fa.Make_super_call_the_first_statement_in_the_constructor,Gne,fa.Make_all_super_calls_the_first_statement_in_their_constructor)]},fixIds:[Gne],getAllCodeActions(e){const{sourceFile:t}=e,n=new Set;return r5(e,Xne,(e,r)=>{const i=Yne(r.file,r.start);if(!i)return;const{constructor:o,superCall:a}=i;Cx(n,_J(o.parent))&&Qne(e,t,o,a)})}});var ere="constructorForDerivedNeedSuperCall",tre=[fa.Constructors_for_derived_classes_must_contain_a_super_call.code];function nre(e,t){const n=lQ(e,t);return pn.assert(jD(n.parent),"token should be at the constructor declaration"),n.parent}function rre(e,t,n){const r=bw.createExpressionStatement(bw.createCallExpression(bw.createSuper(),void 0,_));e.insertNodeAtConstructorStart(t,n,r)}Q7({errorCodes:tre,getCodeActions(e){const{sourceFile:t,span:n}=e,r=nre(t,n.start),i=ide.ChangeTracker.with(e,e=>rre(e,t,r));return[K7(ere,i,fa.Add_missing_super_call,ere,fa.Add_all_missing_super_calls)]},fixIds:[ere],getAllCodeActions:e=>r5(e,tre,(t,n)=>rre(t,e.sourceFile,nre(n.file,n.start)))});var ire="fixEnableJsxFlag",ore=[fa.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];function are(e,t){moe(e,t,"jsx",bw.createStringLiteral("react"))}Q7({errorCodes:ore,getCodeActions:function(e){const{configFile:t}=e.program.getCompilerOptions();if(void 0===t)return;const n=ide.ChangeTracker.with(e,e=>are(e,t));return[H7(ire,n,fa.Enable_the_jsx_flag_in_your_configuration_file)]},fixIds:[ire],getAllCodeActions:e=>r5(e,ore,t=>{const{configFile:n}=e.program.getCompilerOptions();void 0!==n&&are(t,n)})});var sre="fixNaNEquality",cre=[fa.This_condition_will_always_return_0.code];function lre(e,t,n){const r=x(e.getSemanticDiagnostics(t),e=>e.start===n.start&&e.length===n.length);if(void 0===r||void 0===r.relatedInformation)return;const i=x(r.relatedInformation,e=>e.code===fa.Did_you_mean_0.code);if(void 0===i||void 0===i.file||void 0===i.start||void 0===i.length)return;const o=xoe(i.file,Gs(i.start,i.length));return void 0!==o&&K_(o)&&AF(o.parent)?{suggestion:ure(i.messageText),expression:o.parent,arg:o}:void 0}function _re(e,t,n,r){const i=bw.createCallExpression(bw.createPropertyAccessExpression(bw.createIdentifier("Number"),bw.createIdentifier("isNaN")),void 0,[n]),o=r.operatorToken.kind;e.replaceNode(t,r,38===o||36===o?bw.createPrefixUnaryExpression(54,i):i)}function ure(e){const[,t]=vV(e,"\n",0).match(/'(.*)'/)||[];return t}Q7({errorCodes:cre,getCodeActions(e){const{sourceFile:t,span:n,program:r}=e,i=lre(r,t,n);if(void 0===i)return;const{suggestion:o,expression:a,arg:s}=i,c=ide.ChangeTracker.with(e,e=>_re(e,t,s,a));return[K7(sre,c,[fa.Use_0,o],sre,fa.Use_Number_isNaN_in_all_conditions)]},fixIds:[sre],getAllCodeActions:e=>r5(e,cre,(t,n)=>{const r=lre(e.program,n.file,Gs(n.start,n.length));r&&_re(t,n.file,r.arg,r.expression)})}),Q7({errorCodes:[fa.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,fa.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,fa.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code],getCodeActions:function(e){const t=e.program.getCompilerOptions(),{configFile:n}=t;if(void 0===n)return;const r=[],i=Tk(t);if(i>=5&&i<99){const t=ide.ChangeTracker.with(e,e=>{moe(e,n,"module",bw.createStringLiteral("esnext"))});r.push(H7("fixModuleOption",t,[fa.Set_the_module_option_in_your_configuration_file_to_0,"esnext"]))}const o=Sk(t);if(o<4||o>99){const t=ide.ChangeTracker.with(e,e=>{if(!Gf(n))return;const t=[["target",bw.createStringLiteral("es2017")]];1===i&&t.push(["module",bw.createStringLiteral("commonjs")]),foe(e,n,t)});r.push(H7("fixTargetOption",t,[fa.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))}return r.length?r:void 0}});var dre="fixPropertyAssignment",pre=[fa.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];function fre(e,t,n){e.replaceNode(t,n,bw.createPropertyAssignment(n.name,n.objectAssignmentInitializer))}function mre(e,t){return it(lQ(e,t).parent,lP)}Q7({errorCodes:pre,fixIds:[dre],getCodeActions(e){const{sourceFile:t,span:n}=e,r=mre(t,n.start),i=ide.ChangeTracker.with(e,t=>fre(t,e.sourceFile,r));return[K7(dre,i,[fa.Change_0_to_1,"=",":"],dre,[fa.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:e=>r5(e,pre,(e,t)=>fre(e,t.file,mre(t.file,t.start)))});var gre="extendsInterfaceBecomesImplements",hre=[fa.Cannot_extend_an_interface_0_Did_you_mean_implements.code];function yre(e,t){const n=em(lQ(e,t)).heritageClauses,r=n[0].getFirstToken();return 96===r.kind?{extendsToken:r,heritageClauses:n}:void 0}function vre(e,t,n,r){if(e.replaceNode(t,n,bw.createToken(119)),2===r.length&&96===r[0].token&&119===r[1].token){const n=r[1].getFirstToken(),i=n.getFullStart();e.replaceRange(t,{pos:i,end:i},bw.createToken(28));const o=t.text;let a=n.end;for(;avre(e,t,r,i));return[K7(gre,o,fa.Change_extends_to_implements,gre,fa.Change_all_extended_interfaces_to_implements)]},fixIds:[gre],getAllCodeActions:e=>r5(e,hre,(e,t)=>{const n=yre(t.file,t.start);n&&vre(e,t.file,n.extendsToken,n.heritageClauses)})});var bre="forgottenThisPropertyAccess",xre=fa.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,kre=[fa.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,fa.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,xre];function Sre(e,t,n){const r=lQ(e,t);if(uD(r)||dD(r))return{node:r,className:n===xre?em(r).name.text:void 0}}function Tre(e,t,{node:n,className:r}){KC(n),e.replaceNode(t,n,bw.createPropertyAccessExpression(r?bw.createIdentifier(r):bw.createThis(),n))}Q7({errorCodes:kre,getCodeActions(e){const{sourceFile:t}=e,n=Sre(t,e.span.start,e.errorCode);if(!n)return;const r=ide.ChangeTracker.with(e,e=>Tre(e,t,n));return[K7(bre,r,[fa.Add_0_to_unresolved_variable,n.className||"this"],bre,fa.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]},fixIds:[bre],getAllCodeActions:e=>r5(e,kre,(t,n)=>{const r=Sre(n.file,n.start,n.code);r&&Tre(t,e.sourceFile,r)})});var Cre="fixInvalidJsxCharacters_expression",wre="fixInvalidJsxCharacters_htmlEntity",Nre=[fa.Unexpected_token_Did_you_mean_or_gt.code,fa.Unexpected_token_Did_you_mean_or_rbrace.code];Q7({errorCodes:Nre,fixIds:[Cre,wre],getCodeActions(e){const{sourceFile:t,preferences:n,span:r}=e,i=ide.ChangeTracker.with(e,e=>Fre(e,n,t,r.start,!1)),o=ide.ChangeTracker.with(e,e=>Fre(e,n,t,r.start,!0));return[K7(Cre,i,fa.Wrap_invalid_character_in_an_expression_container,Cre,fa.Wrap_all_invalid_characters_in_an_expression_container),K7(wre,o,fa.Convert_invalid_character_to_its_html_entity_code,wre,fa.Convert_all_invalid_characters_to_HTML_entity_code)]},getAllCodeActions:e=>r5(e,Nre,(t,n)=>Fre(t,e.preferences,n.file,n.start,e.fixId===wre))});var Dre={">":">","}":"}"};function Fre(e,t,n,r,i){const o=n.getText()[r];if(!function(e){return Ee(Dre,e)}(o))return;const a=i?Dre[o]:`{${TZ(n,t,o)}}`;e.replaceRangeWithText(n,{pos:r,end:r+1},a)}var Ere="deleteUnmatchedParameter",Pre="renameUnmatchedParameter",Are=[fa.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code];function Ire(e,t){const n=lQ(e,t);if(n.parent&&VP(n.parent)&&uD(n.parent.name)){const e=n.parent,t=Kg(e),r=$g(e);if(t&&r)return{jsDocHost:t,signature:r,name:n.parent.name,jsDocParameterTag:e}}}Q7({fixIds:[Ere,Pre],errorCodes:Are,getCodeActions:function(e){const{sourceFile:t,span:n}=e,r=[],i=Ire(t,n.start);if(i)return ae(r,function(e,{name:t,jsDocHost:n,jsDocParameterTag:r}){const i=ide.ChangeTracker.with(e,t=>t.filterJSDocTags(e.sourceFile,n,e=>e!==r));return K7(Ere,i,[fa.Delete_unused_param_tag_0,t.getText(e.sourceFile)],Ere,fa.Delete_all_unused_param_tags)}(e,i)),ae(r,function(e,{name:t,jsDocHost:n,signature:r,jsDocParameterTag:i}){if(!d(r.parameters))return;const o=e.sourceFile,a=ll(r),s=new Set;for(const e of a)VP(e)&&uD(e.name)&&s.add(e.name.escapedText);const c=m(r.parameters,e=>uD(e.name)&&!s.has(e.name.escapedText)?e.name.getText(o):void 0);if(void 0===c)return;const l=bw.updateJSDocParameterTag(i,i.tagName,bw.createIdentifier(c),i.isBracketed,i.typeExpression,i.isNameFirst,i.comment),_=ide.ChangeTracker.with(e,e=>e.replaceJSDocComment(o,n,P(a,e=>e===i?l:e)));return H7(Pre,_,[fa.Rename_param_tag_name_0_to_1,t.getText(o),c])}(e,i)),r},getAllCodeActions:function(e){const t=new Map;return t5(ide.ChangeTracker.with(e,n=>{i5(e,Are,({file:e,start:n})=>{const r=Ire(e,n);r&&t.set(r.signature,ae(t.get(r.signature),r.jsDocParameterTag))}),t.forEach((t,r)=>{if(e.fixId===Ere){const e=new Set(t);n.filterJSDocTags(r.getSourceFile(),r,t=>!e.has(t))}})}))}});var Ore="fixUnreferenceableDecoratorMetadata";Q7({errorCodes:[fa.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code],getCodeActions:e=>{const t=function(e,t,n){const r=rt(lQ(e,n),uD);if(!r||184!==r.parent.kind)return;const i=t.getTypeChecker().getSymbolAtLocation(r);return x((null==i?void 0:i.declarations)||_,nn(NE,jE,CE))}(e.sourceFile,e.program,e.span.start);if(!t)return;const n=ide.ChangeTracker.with(e,n=>277===t.kind&&function(e,t,n,r){f6.doChangeNamedToNamespaceOrDefault(t,r,e,n.parent)}(n,e.sourceFile,t,e.program)),r=ide.ChangeTracker.with(e,n=>function(e,t,n,r){if(272===n.kind)return void e.insertModifierBefore(t,156,n.name);const i=274===n.kind?n:n.parent.parent;if(i.name&&i.namedBindings)return;const o=r.getTypeChecker();if(Fg(i,e=>{if(111551&_x(e.symbol,o).flags)return!0}))return;e.insertModifierBefore(t,156,i)}(n,e.sourceFile,t,e.program));let i;return n.length&&(i=ae(i,H7(Ore,n,fa.Convert_named_imports_to_namespace_import))),r.length&&(i=ae(i,H7(Ore,r,fa.Use_import_type))),i},fixIds:[Ore]});var Lre="unusedIdentifier",jre="unusedIdentifier_prefix",Mre="unusedIdentifier_delete",Rre="unusedIdentifier_deleteImports",Bre="unusedIdentifier_infer",Jre=[fa._0_is_declared_but_its_value_is_never_read.code,fa._0_is_declared_but_never_used.code,fa.Property_0_is_declared_but_its_value_is_never_read.code,fa.All_imports_in_import_declaration_are_unused.code,fa.All_destructured_elements_are_unused.code,fa.All_variables_are_unused.code,fa.All_type_parameters_are_unused.code];function zre(e,t,n){e.replaceNode(t,n.parent,bw.createKeywordTypeNode(159))}function qre(e,t){return K7(Lre,e,t,Mre,fa.Delete_all_unused_declarations)}function Ure(e,t,n){e.delete(t,pn.checkDefined(it(n.parent,wp).typeParameters,"The type parameter to delete should exist"))}function Vre(e){return 102===e.kind||80===e.kind&&(277===e.parent.kind||274===e.parent.kind)}function Wre(e){return 102===e.kind?rt(e.parent,wE):void 0}function $re(e,t){return mE(t.parent)&&ye(t.parent.getChildren(e))===t}function Hre(e,t,n){e.delete(t,244===n.parent.kind?n.parent:n)}function Kre(e,t,n,r){t!==fa.Property_0_is_declared_but_its_value_is_never_read.code&&(140===r.kind&&(r=it(r.parent,nF).typeParameter.name),uD(r)&&function(e){switch(e.parent.kind){case 170:case 169:return!0;case 261:switch(e.parent.parent.parent.kind){case 251:case 250:return!0}}return!1}(r)&&(e.replaceNode(n,r,bw.createIdentifier(`_${r.text}`)),FD(r.parent)&&Oc(r.parent).forEach(t=>{uD(t.name)&&e.replaceNode(n,t.name,bw.createIdentifier(`_${t.name.text}`))})))}function Gre(e,t,n,r,i,o,a,s){!function(e,t,n,r,i,o,a,s){const{parent:c}=e;if(FD(c))!function(e,t,n,r,i,o,a,s=!1){if(function(e,t,n,r,i,o,a){const{parent:s}=n;switch(s.kind){case 175:case 177:const c=s.parameters.indexOf(n),l=OD(s)?s.name:s,_=jce.Core.getReferencedSymbolsForNode(s.pos,l,i,r,o);if(_)for(const e of _)for(const t of e.references)if(t.kind===jce.EntryKind.Node){const e=SD(t.node)&&vF(t.node.parent)&&t.node.parent.arguments.length>c,r=hF(t.node.parent)&&SD(t.node.parent.expression)&&vF(t.node.parent.parent)&&t.node.parent.parent.arguments.length>c,i=(OD(t.node.parent)||ID(t.node.parent))&&t.node.parent!==n.parent&&t.node.parent.parameters.length>c;if(e||r||i)return!1}return!0;case 263:return!s.name||!function(e,t,n){return!!jce.Core.eachSymbolReferenceInFile(n,e,t,e=>uD(e)&&vF(e.parent)&&e.parent.arguments.includes(e))}(e,t,s.name)||Qre(s,n,a);case 219:case 220:return Qre(s,n,a);case 179:return!1;case 178:return!0;default:return pn.failBadSyntaxKind(s)}}(r,t,n,i,o,a,s))if(n.modifiers&&n.modifiers.length>0&&(!uD(n.name)||jce.Core.isSymbolReferencedInFile(n.name,r,t)))for(const r of n.modifiers)r_(r)&&e.deleteModifier(t,r);else!n.initializer&&Xre(n,r,i)&&e.delete(t,n)}(t,n,c,r,i,o,a,s);else if(!(s&&uD(e)&&jce.Core.isSymbolReferencedInFile(e,r,n))){const r=NE(c)?e:ND(c)?c.parent:c;pn.assert(r!==n,"should not delete whole source file"),t.delete(n,r)}}(t,n,e,r,i,o,a,s),uD(t)&&jce.Core.eachSymbolReferenceInFile(t,r,e,t=>{var r;hF(t.parent)&&t.parent.name===t&&(t=t.parent),!s&&((AF((r=t).parent)&&r.parent.left===r||(PF(r.parent)||EF(r.parent))&&r.parent.operand===r)&&YF(r.parent.parent))&&n.delete(e,t.parent.parent)})}function Xre(e,t,n){const r=e.parent.parameters.indexOf(e);return!jce.Core.someSignatureUsage(e.parent,n,t,(e,t)=>!t||t.arguments.length>r)}function Qre(e,t,n){const r=e.parameters,i=r.indexOf(t);return pn.assert(-1!==i,"The parameter should already be in the list"),n?r.slice(i+1).every(e=>uD(e.name)&&!e.symbol.isReferenced):i===r.length-1}function Yre(e,t,n){const r=n.symbol.declarations;if(r)for(const n of r)e.delete(t,n)}Q7({errorCodes:Jre,getCodeActions(e){const{errorCode:t,sourceFile:n,program:r,cancellationToken:i}=e,o=r.getTypeChecker(),a=r.getSourceFiles(),s=lQ(n,e.span.start);if(KP(s))return[qre(ide.ChangeTracker.with(e,e=>e.delete(n,s)),fa.Remove_template_tag)];if(30===s.kind){return[qre(ide.ChangeTracker.with(e,e=>Ure(e,n,s)),fa.Remove_type_parameters)]}const c=Wre(s);if(c){const t=ide.ChangeTracker.with(e,e=>e.delete(n,c));return[K7(Lre,t,[fa.Remove_import_from_0,Sx(c)],Rre,fa.Delete_all_unused_imports)]}if(Vre(s)){const t=ide.ChangeTracker.with(e,e=>Gre(n,s,e,o,a,r,i,!1));if(t.length)return[K7(Lre,t,[fa.Remove_unused_declaration_for_Colon_0,s.getText(n)],Rre,fa.Delete_all_unused_imports)]}if(dF(s.parent)||pF(s.parent)){if(FD(s.parent.parent)){const t=s.parent.elements,r=[t.length>1?fa.Remove_unused_declarations_for_Colon_0:fa.Remove_unused_declaration_for_Colon_0,P(t,e=>e.getText(n)).join(", ")];return[qre(ide.ChangeTracker.with(e,e=>function(e,t,n){p(n.elements,n=>e.delete(t,n))}(e,n,s.parent)),r)]}return[qre(ide.ChangeTracker.with(e,t=>function(e,t,n,{parent:r}){if(fE(r)&&r.initializer&&B_(r.initializer))if(mE(r.parent)&&d(r.parent.declarations)>1){const i=r.parent.parent,o=i.getStart(n),a=i.end;t.delete(n,r),t.insertNodeAt(n,a,r.initializer,{prefix:tZ(e.host,e.formatContext.options)+n.text.slice(pZ(n.text,o-1),o),suffix:MZ(n)?";":""})}else t.replaceNode(n,r.parent,r.initializer);else t.delete(n,r)}(e,t,n,s.parent)),fa.Remove_unused_destructuring_declaration)]}if($re(n,s))return[qre(ide.ChangeTracker.with(e,e=>Hre(e,n,s.parent)),fa.Remove_variable_statement)];if(uD(s)&&gE(s.parent))return[qre(ide.ChangeTracker.with(e,e=>Yre(e,n,s.parent)),[fa.Remove_unused_declaration_for_Colon_0,s.getText(n)])];const l=[];if(140===s.kind){const t=ide.ChangeTracker.with(e,e=>zre(e,n,s)),r=it(s.parent,nF).typeParameter.name.text;l.push(K7(Lre,t,[fa.Replace_infer_0_with_unknown,r],Bre,fa.Replace_all_unused_infer_with_unknown))}else{const t=ide.ChangeTracker.with(e,e=>Gre(n,s,e,o,a,r,i,!1));if(t.length){const e=ND(s.parent)?s.parent:s;l.push(qre(t,[fa.Remove_unused_declaration_for_Colon_0,e.getText(n)]))}}const _=ide.ChangeTracker.with(e,e=>Kre(e,t,n,s));return _.length&&l.push(K7(Lre,_,[fa.Prefix_0_with_an_underscore,s.getText(n)],jre,fa.Prefix_all_unused_declarations_with_where_possible)),l},fixIds:[jre,Mre,Rre,Bre],getAllCodeActions:e=>{const{sourceFile:t,program:n,cancellationToken:r}=e,i=n.getTypeChecker(),o=n.getSourceFiles();return r5(e,Jre,(a,s)=>{const c=lQ(t,s.start);switch(e.fixId){case jre:Kre(a,s.code,t,c);break;case Rre:{const e=Wre(c);e?a.delete(t,e):Vre(c)&&Gre(t,c,a,i,o,n,r,!0);break}case Mre:if(140===c.kind||Vre(c))break;if(KP(c))a.delete(t,c);else if(30===c.kind)Ure(a,t,c);else if(dF(c.parent)){if(c.parent.parent.initializer)break;FD(c.parent.parent)&&!Xre(c.parent.parent,i,o)||a.delete(t,c.parent.parent)}else{if(pF(c.parent.parent)&&c.parent.parent.parent.initializer)break;$re(t,c)?Hre(a,t,c.parent):uD(c)&&gE(c.parent)?Yre(a,t,c.parent):Gre(t,c,a,i,o,n,r,!0)}break;case Bre:140===c.kind&&zre(a,t,c);break;default:pn.fail(JSON.stringify(e.fixId))}})}});var Zre="fixUnreachableCode",eie=[fa.Unreachable_code_detected.code];function tie(e,t,n,r,i){const o=lQ(t,n),a=mc(o,hu);if(a.getStart(t)!==o.getStart(t)){const e=JSON.stringify({statementKind:pn.formatSyntaxKind(a.kind),tokenKind:pn.formatSyntaxKind(o.kind),errorCode:i,start:n,length:r});pn.fail("Token and statement should start at the same point. "+e)}const s=(GF(a.parent)?a.parent:a).parent;if(!GF(a.parent)||a===ye(a.parent.statements))switch(s.kind){case 246:if(s.elseStatement){if(GF(a.parent))break;return void e.replaceNode(t,a,bw.createBlock(_))}case 248:case 249:return void e.delete(t,s)}if(GF(a.parent)){const i=n+r,o=pn.checkDefined(function(e,t){let n;for(const r of e){if(!t(r))break;n=r}return n}(_T(a.parent.statements,a),e=>e.postie(t,e.sourceFile,e.span.start,e.span.length,e.errorCode));return[K7(Zre,t,fa.Remove_unreachable_code,Zre,fa.Remove_all_unreachable_code)]},fixIds:[Zre],getAllCodeActions:e=>r5(e,eie,(e,t)=>tie(e,t.file,t.start,t.length,t.code))});var nie="fixUnusedLabel",rie=[fa.Unused_label.code];function iie(e,t,n){const r=lQ(t,n),i=it(r.parent,_E),o=r.getStart(t),a=i.statement.getStart(t),s=Qb(o,a,t)?a:ts(t.text,GX(i,59,t).end,!0);e.deleteRange(t,{pos:o,end:s})}Q7({errorCodes:rie,getCodeActions(e){const t=ide.ChangeTracker.with(e,t=>iie(t,e.sourceFile,e.span.start));return[K7(nie,t,fa.Remove_unused_label,nie,fa.Remove_all_unused_labels)]},fixIds:[nie],getAllCodeActions:e=>r5(e,rie,(e,t)=>iie(e,t.file,t.start))});var oie="fixJSDocTypes_plain",aie="fixJSDocTypes_nullable",sie=[fa.JSDoc_types_can_only_be_used_inside_documentation_comments.code,fa._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code,fa._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code];function cie(e,t,n,r,i){e.replaceNode(t,n,i.typeToTypeNode(r,n,void 0))}function lie(e,t,n){const r=mc(lQ(e,t),_ie),i=r&&r.type;return i&&{typeNode:i,type:uie(n,i)}}function _ie(e){switch(e.kind){case 235:case 180:case 181:case 263:case 178:case 182:case 201:case 175:case 174:case 170:case 173:case 172:case 179:case 266:case 217:case 261:return!0;default:return!1}}function uie(e,t){if(kP(t)){const n=e.getTypeFromTypeNode(t.type);return n===e.getNeverType()||n===e.getVoidType()?n:e.getUnionType(ae([n,e.getUndefinedType()],t.postfix?void 0:e.getNullType()))}return e.getTypeFromTypeNode(t)}Q7({errorCodes:sie,getCodeActions(e){const{sourceFile:t}=e,n=e.program.getTypeChecker(),r=lie(t,e.span.start,n);if(!r)return;const{typeNode:i,type:o}=r,a=i.getText(t),s=[c(o,oie,fa.Change_all_jsdoc_style_types_to_TypeScript)];return 315===i.kind&&s.push(c(o,aie,fa.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)),s;function c(r,o,s){return K7("jdocTypes",ide.ChangeTracker.with(e,e=>cie(e,t,i,r,n)),[fa.Change_0_to_1,a,n.typeToString(r)],o,s)}},fixIds:[oie,aie],getAllCodeActions(e){const{fixId:t,program:n,sourceFile:r}=e,i=n.getTypeChecker();return r5(e,sie,(e,n)=>{const o=lie(n.file,n.start,i);if(!o)return;const{typeNode:a,type:s}=o,c=315===a.kind&&t===aie?i.getNullableType(s,32768):s;cie(e,r,a,c,i)})}});var die="fixMissingCallParentheses",pie=[fa.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code];function fie(e,t,n){e.replaceNodeWithText(t,n,`${n.text}()`)}function mie(e,t){const n=lQ(e,t);if(hF(n.parent)){let e=n.parent;for(;hF(e.parent);)e=e.parent;return e.name}if(uD(n))return n}Q7({errorCodes:pie,fixIds:[die],getCodeActions(e){const{sourceFile:t,span:n}=e,r=mie(t,n.start);if(!r)return;const i=ide.ChangeTracker.with(e,t=>fie(t,e.sourceFile,r));return[K7(die,i,fa.Add_missing_call_parentheses,die,fa.Add_all_missing_call_parentheses)]},getAllCodeActions:e=>r5(e,pie,(e,t)=>{const n=mie(t.file,t.start);n&&fie(e,t.file,n)})});var gie="fixMissingTypeAnnotationOnExports",hie="add-annotation",yie="add-type-assertion",vie=[fa.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,fa.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,fa.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,fa.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,fa.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,fa.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,fa.Expression_type_can_t_be_inferred_with_isolatedDeclarations.code,fa.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations.code,fa.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations.code,fa.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations.code,fa.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations.code,fa.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations.code,fa.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations.code,fa.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations.code,fa.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations.code,fa.Default_exports_can_t_be_inferred_with_isolatedDeclarations.code,fa.Only_const_arrays_can_be_inferred_with_isolatedDeclarations.code,fa.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function.code,fa.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations.code,fa.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations.code,fa.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code],bie=new Set([178,175,173,263,219,220,261,170,278,264,207,208]),xie=531469;function kie(e,t,n,r,i){const o=Sie(n,r,i);o.result&&o.textChanges.length&&t.push(K7(e,o.textChanges,o.result,gie,fa.Add_all_missing_type_annotations))}function Sie(e,t,n){const r={typeNode:void 0,mutatedTarget:!1},i=ide.ChangeTracker.fromContext(e),o=e.sourceFile,a=e.program,s=a.getTypeChecker(),c=Sk(a.getCompilerOptions()),l=Dee(e.sourceFile,e.program,e.preferences,e.host),_=new Set,u=new Set,d=IU({preserveSourceNewlines:!1}),p=n({addTypeAnnotation:function(t){e.cancellationToken.throwIfCancellationRequested();const n=lQ(o,t.start),r=g(n);if(r)return gE(r)?function(e){var t;if(null==u?void 0:u.has(e))return;null==u||u.add(e);const n=s.getTypeAtLocation(e),r=s.getPropertiesOfType(n);if(!e.name||0===r.length)return;const c=[];for(const t of r)vs(t.name,Sk(a.getCompilerOptions()))&&(t.valueDeclaration&&fE(t.valueDeclaration)||c.push(bw.createVariableStatement([bw.createModifier(95)],bw.createVariableDeclarationList([bw.createVariableDeclaration(t.name,void 0,w(s.getTypeOfSymbol(t),e),void 0)]))));if(0===c.length)return;const l=[];(null==(t=e.modifiers)?void 0:t.some(e=>95===e.kind))&&l.push(bw.createModifier(95));l.push(bw.createModifier(138));const _=bw.createModuleDeclaration(l,e.name,bw.createModuleBlock(c),101441696);return i.insertNodeAfter(o,e,_),[fa.Annotate_types_of_properties_expando_function_in_a_namespace]}(r):h(r);const c=(l=n,mc(l,e=>bie.has(e.kind)&&(!dF(e)&&!pF(e)||fE(e.parent))));var l;if(c)return h(c);return},addInlineAssertion:function(t){e.cancellationToken.throwIfCancellationRequested();const n=lQ(o,t.start);if(g(n))return;const r=F(n,t);if(!r||ih(r)||ih(r.parent))return;const a=K_(r),c=lP(r);if(!c&&fu(r))return;if(mc(r,w_))return;if(mc(r,uP))return;if(a&&(mc(r,aP)||mc(r,T_)))return;if(jF(r))return;const l=mc(r,fE),_=l&&s.getTypeAtLocation(l);if(_&&8192&_.flags)return;if(!a&&!c)return;const{typeNode:u,mutatedTarget:d}=x(r,_);if(!u||d)return;c?i.insertNodeAt(o,r.end,m(UC(r.name),u),{prefix:": "}):a?i.replaceNode(o,r,function(e,t){f(e)&&(e=bw.createParenthesizedExpression(e));return bw.createAsExpression(bw.createSatisfiesExpression(e,UC(t)),t)}(UC(r),u)):pn.assertNever(r);return[fa.Add_satisfies_and_an_inline_type_assertion_with_0,D(u)]},extractAsVariable:function(t){e.cancellationToken.throwIfCancellationRequested();const n=F(lQ(o,t.start),t);if(!n||ih(n)||ih(n.parent))return;if(!K_(n))return;if(mF(n))return i.replaceNode(o,n,m(n,bw.createTypeReferenceNode("const"))),[fa.Mark_array_literal_as_const];const r=mc(n,cP);if(r){if(r===n.parent&&ub(n))return;const e=bw.createUniqueName(N3(n,o,s,o),16);let t=n,a=n;if(jF(t)&&(t=sh(t.parent),a=T(t.parent)?t=t.parent:m(t,bw.createTypeReferenceNode("const"))),ub(t))return;const c=bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(e,void 0,void 0,a)],2)),l=mc(n,hu);return i.insertNodeBefore(o,l,c),i.replaceNode(o,t,bw.createAsExpression(bw.cloneNode(e),bw.createTypeQueryNode(bw.cloneNode(e)))),[fa.Extract_to_variable_and_replace_with_0_as_typeof_0,D(e)]}}});return l.writeFixes(i),{result:p,textChanges:i.getChanges()};function f(e){return!(ub(e)||vF(e)||gF(e)||mF(e))}function m(e,t){return f(e)&&(e=bw.createParenthesizedExpression(e)),bw.createAsExpression(e,t)}function g(e){const t=mc(e,e=>hu(e)?"quit":fC(e));if(t&&fC(t)){let e=t;if(AF(e)&&(e=e.left,!fC(e)))return;const n=s.getTypeAtLocation(e.expression);if(!n)return;if(H(s.getPropertiesOfType(n),e=>e.valueDeclaration===t||e.valueDeclaration===t.parent)){const e=n.symbol.valueDeclaration;if(e){if(UT(e)&&fE(e.parent))return e.parent;if(gE(e))return e}}}}function h(e){if(!(null==_?void 0:_.has(e)))switch(null==_||_.add(e),e.kind){case 170:case 173:case 261:return function(e){const{typeNode:t}=x(e);if(t)return e.type?i.replaceNode(Sd(e),e.type,t):i.tryInsertTypeAnnotation(Sd(e),e,t),[fa.Add_annotation_of_type_0,D(t)]}(e);case 220:case 219:case 263:case 175:case 178:return function(e,t){if(e.type)return;const{typeNode:n}=x(e);if(n)return i.tryInsertTypeAnnotation(t,e,n),[fa.Add_return_type_0,D(n)]}(e,o);case 278:return function(e){if(e.isExportEquals)return;const{typeNode:t}=x(e.expression);if(!t)return;const n=bw.createUniqueName("_default");return i.replaceNodeWithNodes(o,e,[bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(n,void 0,t,e.expression)],2)),bw.updateExportAssignment(e,null==e?void 0:e.modifiers,n)]),[fa.Extract_default_export_to_variable]}(e);case 264:return function(e){var t,n;const r=null==(t=e.heritageClauses)?void 0:t.find(e=>96===e.token),a=null==r?void 0:r.types[0];if(!a)return;const{typeNode:s}=x(a.expression);if(!s)return;const c=bw.createUniqueName(e.name?e.name.text+"Base":"Anonymous",16),l=bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(c,void 0,s,a.expression)],2));i.insertNodeBefore(o,e,l);const _=ms(o.text,a.end),u=(null==(n=null==_?void 0:_[_.length-1])?void 0:n.end)??a.end;return i.replaceRange(o,{pos:a.getFullStart(),end:u},c,{prefix:" "}),[fa.Extract_base_class_to_variable]}(e);case 207:case 208:return function(e){var t;const n=e.parent,r=e.parent.parent.parent;if(!n.initializer)return;let a;const s=[];if(uD(n.initializer))a={expression:{kind:3,identifier:n.initializer}};else{const e=bw.createUniqueName("dest",16);a={expression:{kind:3,identifier:e}},s.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(e,void 0,void 0,n.initializer)],2)))}const c=[];pF(e)?y(e,c,a):v(e,c,a);const l=new Map;for(const e of c){if(e.element.propertyName&&ND(e.element.propertyName)){const t=e.element.propertyName.expression,n=bw.getGeneratedNameForNode(t),r=bw.createVariableDeclaration(n,void 0,void 0,t),i=bw.createVariableDeclarationList([r],2),o=bw.createVariableStatement(void 0,i);s.push(o),l.set(t,n)}const n=e.element.name;if(pF(n))y(n,c,e);else if(dF(n))v(n,c,e);else{const{typeNode:i}=x(n);let o=b(e,l);if(e.element.initializer){const n=null==(t=e.element)?void 0:t.propertyName,r=bw.createUniqueName(n&&uD(n)?n.text:"temp",16);s.push(bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(r,void 0,void 0,o)],2))),o=bw.createConditionalExpression(bw.createBinaryExpression(r,bw.createToken(37),bw.createIdentifier("undefined")),bw.createToken(58),e.element.initializer,bw.createToken(59),o)}const a=Av(r,32)?[bw.createToken(95)]:void 0;s.push(bw.createVariableStatement(a,bw.createVariableDeclarationList([bw.createVariableDeclaration(n,void 0,i,o)],2)))}}r.declarationList.declarations.length>1&&s.push(bw.updateVariableStatement(r,r.modifiers,bw.updateVariableDeclarationList(r.declarationList,r.declarationList.declarations.filter(t=>t!==e.parent))));return i.replaceNodeWithNodes(o,r,s),[fa.Extract_binding_expressions_to_variable]}(e);default:throw new Error(`Cannot find a fix for the given node ${e.kind}`)}}function y(e,t,n){for(let r=0;r=0;--e){const i=n[e].expression;0===i.kind?r=bw.createPropertyAccessChain(r,void 0,bw.createIdentifier(i.text)):1===i.kind?r=bw.createElementAccessExpression(r,t.get(i.computed)):2===i.kind&&(r=bw.createElementAccessExpression(r,i.arrayIndex))}return r}function x(e,n){if(1===t)return C(e);let i;if(ih(e)){const t=s.getSignatureFromDeclaration(e);if(t){const n=s.getTypePredicateOfSignature(t);if(n)return n.type?{typeNode:N(n,mc(e,fu)??o,c(n.type)),mutatedTarget:!1}:r;i=s.getReturnTypeOfSignature(t)}}else i=s.getTypeAtLocation(e);if(!i)return r;if(2===t){n&&(i=n);const e=s.getWidenedLiteralType(i);if(s.isTypeAssignableTo(e,i))return r;i=e}const a=mc(e,fu)??o;return FD(e)&&s.requiresAddingImplicitUndefined(e,a)&&(i=s.getUnionType([s.getUndefinedType(),i],0)),{typeNode:w(i,a,c(i)),mutatedTarget:!1};function c(t){return(fE(e)||AD(e)&&Av(e,264))&&8192&t.flags?1048576:0}}function k(e){return bw.createTypeQueryNode(UC(e))}function S(e,t,n,a,s,c,l,_){const u=[],d=[];let p;const f=mc(e,hu);for(const t of a(e))s(t)?(g(),ub(t.expression)?(u.push(k(t.expression)),d.push(t)):m(t.expression)):(p??(p=[])).push(t);return 0===d.length?r:(g(),i.replaceNode(o,e,l(d)),{typeNode:_(u),mutatedTarget:!0});function m(e){const r=bw.createUniqueName(t+"_Part"+(d.length+1),16),a=n?bw.createAsExpression(e,bw.createTypeReferenceNode("const")):e,s=bw.createVariableStatement(void 0,bw.createVariableDeclarationList([bw.createVariableDeclaration(r,void 0,void 0,a)],2));i.insertNodeBefore(o,f,s),u.push(k(r)),d.push(c(r))}function g(){p&&(m(l(p)),p=void 0)}}function T(e){return G_(e)&&wl(e.type)}function C(e){if(FD(e))return r;if(lP(e))return{typeNode:k(e.name),mutatedTarget:!1};if(ub(e))return{typeNode:k(e),mutatedTarget:!1};if(T(e))return C(e.expression);if(mF(e)){const t=mc(e,fE);return function(e,t="temp"){const n=!!mc(e,T);return n?S(e,t,n,e=>e.elements,jF,bw.createSpreadElement,e=>bw.createArrayLiteralExpression(e,!0),e=>bw.createTupleTypeNode(e.map(bw.createRestTypeNode))):r}(e,t&&uD(t.name)?t.name.text:void 0)}if(gF(e)){const t=mc(e,fE);return function(e,t="temp"){return S(e,t,!!mc(e,T),e=>e.properties,_P,bw.createSpreadAssignment,e=>bw.createObjectLiteralExpression(e,!0),bw.createIntersectionTypeNode)}(e,t&&uD(t.name)?t.name.text:void 0)}if(fE(e)&&e.initializer)return C(e.initializer);if(IF(e)){const{typeNode:t,mutatedTarget:n}=C(e.whenTrue);if(!t)return r;const{typeNode:i,mutatedTarget:o}=C(e.whenFalse);return i?{typeNode:bw.createUnionTypeNode([t,i]),mutatedTarget:n||o}:r}return r}function w(e,t,n=0){let r=!1;const i=aoe(s,e,t,xie|n,1,{moduleResolverHost:a,trackSymbol:()=>!0,reportTruncationError(){r=!0}});if(!i)return;const o=ooe(i,l,c);return r?bw.createKeywordTypeNode(133):o}function N(e,t,n=0){let r=!1;const i=soe(s,l,e,t,c,xie|n,1,{moduleResolverHost:a,trackSymbol:()=>!0,reportTruncationError(){r=!0}});return r?bw.createKeywordTypeNode(133):i}function D(e){ww(e,1);const t=d.printNode(4,e,o);return t.length>Ku?t.substring(0,Ku-3)+"...":(ww(e,0),t)}function F(e,t){for(;e&&e.endt.addTypeAnnotation(e.span)),kie(hie,t,e,1,t=>t.addTypeAnnotation(e.span)),kie(hie,t,e,2,t=>t.addTypeAnnotation(e.span)),kie(yie,t,e,0,t=>t.addInlineAssertion(e.span)),kie(yie,t,e,1,t=>t.addInlineAssertion(e.span)),kie(yie,t,e,2,t=>t.addInlineAssertion(e.span)),kie("extract-expression",t,e,0,t=>t.extractAsVariable(e.span)),t},getAllCodeActions:e=>t5(Sie(e,0,t=>{i5(e,vie,e=>{t.addTypeAnnotation(e)})}).textChanges)});var Tie="fixAwaitInSyncFunction",Cie=[fa.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,fa.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,fa.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,fa.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code];function wie(e,t){const n=Yf(lQ(e,t));if(!n)return;let r;switch(n.kind){case 175:r=n.name;break;case 263:case 219:r=GX(n,100,e);break;case 220:r=GX(n,n.typeParameters?30:21,e)||ye(n.parameters);break;default:return}return r&&{insertBefore:r,returnType:(i=n,i.type?i.type:fE(i.parent)&&i.parent.type&&VD(i.parent.type)?i.parent.type.type:void 0)};var i}function Nie(e,t,{insertBefore:n,returnType:r}){if(r){const n=fm(r);n&&80===n.kind&&"Promise"===n.text||e.replaceNode(t,r,bw.createTypeReferenceNode("Promise",bw.createNodeArray([r])))}e.insertModifierBefore(t,134,n)}Q7({errorCodes:Cie,getCodeActions(e){const{sourceFile:t,span:n}=e,r=wie(t,n.start);if(!r)return;const i=ide.ChangeTracker.with(e,e=>Nie(e,t,r));return[K7(Tie,i,fa.Add_async_modifier_to_containing_function,Tie,fa.Add_all_missing_async_modifiers)]},fixIds:[Tie],getAllCodeActions:function(e){const t=new Set;return r5(e,Cie,(n,r)=>{const i=wie(r.file,r.start);i&&Cx(t,_J(i.insertBefore))&&Nie(n,e.sourceFile,i)})}});var Die=[fa._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,fa._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code],Fie="fixPropertyOverrideAccessor";function Eie(e,t,n,r,i){let o,a;if(r===fa._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code)o=t,a=t+n;else if(r===fa._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code){const n=i.program.getTypeChecker(),r=lQ(e,t).parent;if(ND(r))return;pn.assert(g_(r),"error span of fixPropertyOverrideAccessor should only be on an accessor");const s=r.parent;pn.assert(m_(s),"erroneous accessors should only be inside classes");const c=kh(s);if(!c)return;const l=_h(c.expression),_=MF(l)?l.symbol:n.getSymbolAtLocation(l);if(!_)return;const u=n.getDeclaredTypeOfSymbol(_),d=n.getPropertyOfType(u,vc(Jp(r.name)));if(!d||!d.valueDeclaration)return;o=d.valueDeclaration.pos,a=d.valueDeclaration.end,e=Sd(d.valueDeclaration)}else pn.fail("fixPropertyOverrideAccessor codefix got unexpected error code "+r);return koe(e,i.program,o,a,i,fa.Generate_get_and_set_accessors.message)}Q7({errorCodes:Die,getCodeActions(e){const t=Eie(e.sourceFile,e.span.start,e.span.length,e.errorCode,e);if(t)return[K7(Fie,t,fa.Generate_get_and_set_accessors,Fie,fa.Generate_get_and_set_accessors_for_all_overriding_properties)]},fixIds:[Fie],getAllCodeActions:e=>r5(e,Die,(t,n)=>{const r=Eie(n.file,n.start,n.length,n.code,e);if(r)for(const n of r)t.pushRaw(e.sourceFile,n)})});var Pie="inferFromUsage",Aie=[fa.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,fa.Variable_0_implicitly_has_an_1_type.code,fa.Parameter_0_implicitly_has_an_1_type.code,fa.Rest_parameter_0_implicitly_has_an_any_type.code,fa.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,fa._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,fa.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,fa.Member_0_implicitly_has_an_1_type.code,fa.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,fa.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,fa.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,fa.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,fa.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,fa._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,fa.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,fa.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,fa.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function Iie(e,t){switch(e){case fa.Parameter_0_implicitly_has_an_1_type.code:case fa.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return RD(Yf(t))?fa.Infer_type_of_0_from_usage:fa.Infer_parameter_types_from_usage;case fa.Rest_parameter_0_implicitly_has_an_any_type.code:case fa.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return fa.Infer_parameter_types_from_usage;case fa.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:return fa.Infer_this_type_of_0_from_usage;default:return fa.Infer_type_of_0_from_usage}}function Oie(e,t,n,r,i,o,a,s,c){if(!t_(n.kind)&&80!==n.kind&&26!==n.kind&&110!==n.kind)return;const{parent:l}=n,_=Dee(t,i,c,s);switch(r=function(e){switch(e){case fa.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:return fa.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;case fa.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return fa.Variable_0_implicitly_has_an_1_type.code;case fa.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return fa.Parameter_0_implicitly_has_an_1_type.code;case fa.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return fa.Rest_parameter_0_implicitly_has_an_any_type.code;case fa.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:return fa.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;case fa._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:return fa._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;case fa.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:return fa.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;case fa.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return fa.Member_0_implicitly_has_an_1_type.code}return e}(r)){case fa.Member_0_implicitly_has_an_1_type.code:case fa.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:if(fE(l)&&a(l)||AD(l)||PD(l))return Lie(e,_,t,l,i,s,o),_.writeFixes(e),l;if(hF(l)){const n=EZ(Jie(l.name,i,o),l,i,s);if(n){const r=bw.createJSDocTypeTag(void 0,bw.createJSDocTypeExpression(n),void 0);e.addJSDocTags(t,it(l.parent.parent,YF),[r])}return _.writeFixes(e),l}return;case fa.Variable_0_implicitly_has_an_1_type.code:{const t=i.getTypeChecker().getSymbolAtLocation(n);return t&&t.valueDeclaration&&fE(t.valueDeclaration)&&a(t.valueDeclaration)?(Lie(e,_,Sd(t.valueDeclaration),t.valueDeclaration,i,s,o),_.writeFixes(e),t.valueDeclaration):void 0}}const u=Yf(n);if(void 0===u)return;let d;switch(r){case fa.Parameter_0_implicitly_has_an_1_type.code:if(RD(u)){jie(e,_,t,u,i,s,o),d=u;break}case fa.Rest_parameter_0_implicitly_has_an_any_type.code:if(a(u)){const n=it(l,FD);!function(e,t,n,r,i,o,a,s){if(!uD(r.name))return;const c=function(e,t,n,r){const i=zie(e,t,n,r);return i&&qie(n,i,r).parameters(e)||e.parameters.map(e=>({declaration:e,type:uD(e.name)?Jie(e.name,n,r):n.getTypeChecker().getAnyType()}))}(i,n,o,s);if(pn.assert(i.parameters.length===c.length,"Parameter count and inference count should match"),Om(i))Rie(e,n,c,o,a);else{const r=CF(i)&&!GX(i,21,n);r&&e.insertNodeBefore(n,ye(i.parameters),bw.createToken(21));for(const{declaration:r,type:i}of c)!r||r.type||r.initializer||Mie(e,t,n,r,i,o,a);r&&e.insertNodeAfter(n,xe(i.parameters),bw.createToken(22))}}(e,_,t,n,u,i,s,o),d=n}break;case fa.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:case fa._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:MD(u)&&uD(u.name)&&(Mie(e,_,t,u,Jie(u.name,i,o),i,s),d=u);break;case fa.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:RD(u)&&(jie(e,_,t,u,i,s,o),d=u);break;case fa.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:ide.isThisTypeAnnotatable(u)&&a(u)&&(!function(e,t,n,r,i,o){const a=zie(n,t,r,o);if(!a||!a.length)return;const s=qie(r,a,o).thisParameter(),c=EZ(s,n,r,i);if(!c)return;Om(n)?function(e,t,n,r){e.addJSDocTags(t,n,[bw.createJSDocThisTag(void 0,bw.createJSDocTypeExpression(r))])}(e,t,n,c):e.tryInsertThisTypeAnnotation(t,n,c)}(e,t,u,i,s,o),d=u);break;default:return pn.fail(String(r))}return _.writeFixes(e),d}function Lie(e,t,n,r,i,o,a){uD(r.name)&&Mie(e,t,n,r,Jie(r.name,i,a),i,o)}function jie(e,t,n,r,i,o,a){const s=ge(r.parameters);if(s&&uD(r.name)&&uD(s.name)){let c=Jie(r.name,i,a);c===i.getTypeChecker().getAnyType()&&(c=Jie(s.name,i,a)),Om(r)?Rie(e,n,[{declaration:s,type:c}],i,o):Mie(e,t,n,s,c,i,o)}}function Mie(e,t,n,r,i,o,a){const s=EZ(i,r,o,a);if(s)if(Om(n)&&172!==r.kind){const t=fE(r)?rt(r.parent.parent,XF):r;if(!t)return;const i=bw.createJSDocTypeExpression(s),o=MD(r)?bw.createJSDocReturnTag(void 0,i,void 0):bw.createJSDocTypeTag(void 0,i,void 0);e.addJSDocTags(n,t,[o])}else(function(e,t,n,r,i,o){const a=yoe(e,o);if(a&&r.tryInsertTypeAnnotation(n,t,a.typeNode))return p(a.symbols,e=>i.addImportFromExportedSymbol(e,!0)),!0;return!1})(s,r,n,e,t,Sk(o.getCompilerOptions()))||e.tryInsertTypeAnnotation(n,r,s)}function Rie(e,t,n,r,i){const o=n.length&&n[0].declaration.parent;if(!o)return;const a=J(n,e=>{const t=e.declaration;if(t.initializer||al(t)||!uD(t.name))return;const n=e.type&&EZ(e.type,t,r,i);if(n){return ww(bw.cloneNode(t.name),7168),{name:bw.cloneNode(t.name),param:t,isOptional:!!e.isOptional,typeNode:n}}});if(a.length)if(CF(o)||TF(o)){const n=CF(o)&&!GX(o,21,t);n&&e.insertNodeBefore(t,ye(o.parameters),bw.createToken(21)),p(a,({typeNode:n,param:r})=>{const i=bw.createJSDocTypeTag(void 0,bw.createJSDocTypeExpression(n)),o=bw.createJSDocComment(void 0,[i]);e.insertNodeAt(t,r.getStart(t),o,{suffix:" "})}),n&&e.insertNodeAfter(t,xe(o.parameters),bw.createToken(22))}else{const n=P(a,({name:e,typeNode:t,isOptional:n})=>bw.createJSDocParameterTag(void 0,e,!!n,bw.createJSDocTypeExpression(t),!1,void 0));e.addJSDocTags(t,o,n)}}function Bie(e,t,n){return J(jce.getReferenceEntriesForNode(-1,e,t,t.getSourceFiles(),n),e=>e.kind!==jce.EntryKind.Span?rt(e.node,uD):void 0)}function Jie(e,t,n){return qie(t,Bie(e,t,n),n).single()}function zie(e,t,n,r){let i;switch(e.kind){case 177:i=GX(e,137,t);break;case 220:case 219:const n=e.parent;i=(fE(n)||AD(n))&&uD(n.name)?n.name:e.name;break;case 263:case 175:case 174:i=e.name}if(i)return Bie(i,n,r)}function qie(e,t,n){const r=e.getTypeChecker(),i={string:()=>r.getStringType(),number:()=>r.getNumberType(),Array:e=>r.createArrayType(e),Promise:e=>r.createPromiseType(e)},o=[r.getStringType(),r.getNumberType(),r.createArrayType(r.getAnyType()),r.createPromiseType(r.getAnyType())];return{single:function(){return f(s(t))},parameters:function(i){if(0===t.length||!i.parameters)return;const o={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};for(const e of t)n.throwIfCancellationRequested(),c(e,o);const a=[...o.constructs||[],...o.calls||[]];return i.parameters.map((t,o)=>{const c=[],l=Uu(t);let _=!1;for(const e of a)if(e.argumentTypes.length<=o)_=Om(i),c.push(r.getUndefinedType());else if(l)for(let t=o;t{t.has(n)||t.set(n,[]),t.get(n).push(e)});const n=new Map;return t.forEach((e,t)=>{n.set(t,a(e))}),{isNumber:e.some(e=>e.isNumber),isString:e.some(e=>e.isString),isNumberOrString:e.some(e=>e.isNumberOrString),candidateTypes:L(e,e=>e.candidateTypes),properties:n,calls:L(e,e=>e.calls),constructs:L(e,e=>e.constructs),numberIndex:p(e,e=>e.numberIndex),stringIndex:p(e,e=>e.stringIndex),candidateThisTypes:L(e,e=>e.candidateThisTypes),inferredTypes:void 0}}function s(e){const t={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};for(const r of e)n.throwIfCancellationRequested(),c(r,t);return m(t)}function c(e,t){for(;hb(e);)e=e.parent;switch(e.parent.kind){case 245:!function(e,t){v(t,vF(e)?r.getVoidType():r.getAnyType())}(e,t);break;case 226:t.isNumber=!0;break;case 225:!function(e,t){switch(e.operator){case 46:case 47:case 41:case 55:t.isNumber=!0;break;case 40:t.isNumberOrString=!0}}(e.parent,t);break;case 227:!function(e,t,n){switch(t.operatorToken.kind){case 43:case 42:case 44:case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 66:case 68:case 67:case 69:case 70:case 74:case 75:case 79:case 71:case 73:case 72:case 41:case 30:case 33:case 32:case 34:const i=r.getTypeAtLocation(t.left===e?t.right:t.left);1056&i.flags?v(n,i):n.isNumber=!0;break;case 65:case 40:const o=r.getTypeAtLocation(t.left===e?t.right:t.left);1056&o.flags?v(n,o):296&o.flags?n.isNumber=!0:402653316&o.flags?n.isString=!0:1&o.flags||(n.isNumberOrString=!0);break;case 64:case 35:case 37:case 38:case 36:case 77:case 78:case 76:v(n,r.getTypeAtLocation(t.left===e?t.right:t.left));break;case 103:e===t.left&&(n.isString=!0);break;case 57:case 61:e!==t.left||261!==e.parent.parent.kind&&!cb(e.parent.parent,!0)||v(n,r.getTypeAtLocation(t.right))}}(e,e.parent,t);break;case 297:case 298:!function(e,t){v(t,r.getTypeAtLocation(e.parent.parent.expression))}(e.parent,t);break;case 214:case 215:e.parent.expression===e?function(e,t){const n={argumentTypes:[],return_:{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0}};if(e.arguments)for(const t of e.arguments)n.argumentTypes.push(r.getTypeAtLocation(t));c(e,n.return_),214===e.kind?(t.calls||(t.calls=[])).push(n):(t.constructs||(t.constructs=[])).push(n)}(e.parent,t):l(e,t);break;case 212:!function(e,t){const n=yc(e.name.text);t.properties||(t.properties=new Map);const r=t.properties.get(n)||{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};c(e,r),t.properties.set(n,r)}(e.parent,t);break;case 213:!function(e,t,n){if(t===e.argumentExpression)return void(n.isNumberOrString=!0);{const t=r.getTypeAtLocation(e.argumentExpression),i={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};c(e,i),296&t.flags?n.numberIndex=i:n.stringIndex=i}}(e.parent,e,t);break;case 304:case 305:!function(e,t){const n=fE(e.parent.parent)?e.parent.parent:e.parent;b(t,r.getTypeAtLocation(n))}(e.parent,t);break;case 173:!function(e,t){b(t,r.getTypeAtLocation(e.parent))}(e.parent,t);break;case 261:{const{name:n,initializer:i}=e.parent;if(e===n){i&&v(t,r.getTypeAtLocation(i));break}}default:return l(e,t)}}function l(e,t){Tm(e)&&v(t,r.getContextualType(e))}function u(e){return f(m(e))}function f(e){if(!e.length)return r.getAnyType();const t=r.getUnionType([r.getStringType(),r.getNumberType()]);let n=function(e,t){const n=[];for(const r of e)for(const{high:e,low:i}of t)e(r)&&(pn.assert(!i(r),"Priority can't have both low and high"),n.push(i));return e.filter(e=>n.every(t=>!t(e)))}(e,[{high:e=>e===r.getStringType()||e===r.getNumberType(),low:e=>e===t},{high:e=>!(16385&e.flags),low:e=>!!(16385&e.flags)},{high:e=>!(114689&e.flags||16&xx(e)),low:e=>!!(16&xx(e))}]);const i=n.filter(e=>16&xx(e));return i.length&&(n=n.filter(e=>!(16&xx(e))),n.push(function(e){if(1===e.length)return e[0];const t=[],n=[],i=[],o=[];let a=!1,s=!1;const c=Ke();for(const l of e){for(const e of r.getPropertiesOfType(l))c.add(e.escapedName,e.valueDeclaration?r.getTypeOfSymbolAtLocation(e,e.valueDeclaration):r.getAnyType());t.push(...r.getSignaturesOfType(l,0)),n.push(...r.getSignaturesOfType(l,1));const e=r.getIndexInfoOfType(l,0);e&&(i.push(e.type),a=a||e.isReadonly);const _=r.getIndexInfoOfType(l,1);_&&(o.push(_.type),s=s||_.isReadonly)}const l=$(c,(t,n)=>{const i=n.lengthr.getBaseTypeOfLiteralType(e)),l=(null==(a=e.calls)?void 0:a.length)?g(e):void 0;return l&&c?s.push(r.getUnionType([l,...c],2)):(l&&s.push(l),d(c)&&s.push(...c)),s.push(...function(e){if(!e.properties||!e.properties.size)return[];const t=o.filter(t=>function(e,t){return!!t.properties&&!sd(t.properties,(t,n)=>{const i=r.getTypeOfPropertyOfType(e,n);if(!i)return!0;if(t.calls){return!r.getSignaturesOfType(i,0).length||!r.isTypeAssignableTo(i,(o=t.calls,r.createAnonymousType(void 0,Zu(),[y(o)],_,_)))}return!r.isTypeAssignableTo(i,u(t));var o})}(t,e));if(0function(e,t){if(!(4&xx(e)&&t.properties))return e;const n=e.target,o=ke(n.typeParameters);if(!o)return e;const a=[];return t.properties.forEach((e,t)=>{const i=r.getTypeOfPropertyOfType(n,t);pn.assert(!!i,"generic should have all the properties of its reference."),a.push(...h(i,u(e),o))}),i[e.symbol.escapedName](f(a))}(t,e));return[]}(e)),s}function g(e){const t=new Map;e.properties&&e.properties.forEach((e,n)=>{const i=r.createSymbol(4,n);i.links.type=u(e),t.set(n,i)});const n=e.calls?[y(e.calls)]:[],i=e.constructs?[y(e.constructs)]:[],o=e.stringIndex?[r.createIndexInfo(r.getStringType(),u(e.stringIndex),!1)]:[];return r.createAnonymousType(void 0,t,n,i,o)}function h(e,t,n){if(e===n)return[t];if(3145728&e.flags)return L(e.types,e=>h(e,t,n));if(4&xx(e)&&4&xx(t)){const i=r.getTypeArguments(e),o=r.getTypeArguments(t),a=[];if(i&&o)for(let e=0;ee.argumentTypes.length));for(let i=0;ie.argumentTypes[i]||r.getUndefinedType())),e.some(e=>void 0===e.argumentTypes[i])&&(n.flags|=16777216),t.push(n)}const i=u(a(e.map(e=>e.return_)));return r.createSignature(void 0,void 0,void 0,t,i,void 0,n,0)}function v(e,t){!t||1&t.flags||131072&t.flags||(e.candidateTypes||(e.candidateTypes=[])).push(t)}function b(e,t){!t||1&t.flags||131072&t.flags||(e.candidateThisTypes||(e.candidateThisTypes=[])).push(t)}}Q7({errorCodes:Aie,getCodeActions(e){const{sourceFile:t,program:n,span:{start:r},errorCode:i,cancellationToken:o,host:a,preferences:s}=e,c=lQ(t,r);let l;const _=ide.ChangeTracker.with(e,e=>{l=Oie(e,t,c,i,n,o,st,a,s)}),u=l&&Fc(l);return u&&0!==_.length?[K7(Pie,_,[Iie(i,c),ep(u)],Pie,fa.Infer_all_types_from_usage)]:void 0},fixIds:[Pie],getAllCodeActions(e){const{sourceFile:t,program:n,cancellationToken:r,host:i,preferences:o}=e,a=nY();return r5(e,Aie,(e,s)=>{Oie(e,t,lQ(s.file,s.start),s.code,n,r,a,i,o)})}});var Uie="fixReturnTypeInAsyncFunction",Vie=[fa.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code];function Wie(e,t,n){if(Om(e))return;const r=mc(lQ(e,n),l_),i=null==r?void 0:r.type;if(!i)return;const o=t.getTypeFromTypeNode(i),a=t.getAwaitedType(o)||t.getVoidType(),s=t.typeToTypeNode(a,i,void 0);return s?{returnTypeNode:i,returnType:o,promisedTypeNode:s,promisedType:a}:void 0}function $ie(e,t,n,r){e.replaceNode(t,n,bw.createTypeReferenceNode("Promise",[r]))}Q7({errorCodes:Vie,fixIds:[Uie],getCodeActions:function(e){const{sourceFile:t,program:n,span:r}=e,i=n.getTypeChecker(),o=Wie(t,n.getTypeChecker(),r.start);if(!o)return;const{returnTypeNode:a,returnType:s,promisedTypeNode:c,promisedType:l}=o,_=ide.ChangeTracker.with(e,e=>$ie(e,t,a,c));return[K7(Uie,_,[fa.Replace_0_with_Promise_1,i.typeToString(s),i.typeToString(l)],Uie,fa.Fix_all_incorrect_return_type_of_an_async_functions)]},getAllCodeActions:e=>r5(e,Vie,(t,n)=>{const r=Wie(n.file,e.program.getTypeChecker(),n.start);r&&$ie(t,n.file,r.returnTypeNode,r.promisedTypeNode)})});var Hie="disableJsDiagnostics",Kie="disableJsDiagnostics",Gie=J(Object.keys(fa),e=>{const t=fa[e];return 1===t.category?t.code:void 0});function Xie(e,t,n,r){const{line:i}=Wa(t,n);r&&!U(r,i)||e.insertCommentBeforeLine(t,i,n," @ts-ignore")}function Qie(e,t,n,r,i,o,a){const s=e.symbol.members;for(const c of t)s.has(c.escapedName)||eoe(c,e,n,r,i,o,a,void 0)}function Yie(e){return{trackSymbol:()=>!1,moduleResolverHost:uY(e.program,e.host)}}Q7({errorCodes:Gie,getCodeActions:function(e){const{sourceFile:t,program:n,span:r,host:i,formatContext:o}=e;if(!Om(t)||!sT(t,n.getCompilerOptions()))return;const a=t.checkJsDirective?"":tZ(i,o.options),s=[H7(Hie,[n5(t.fileName,[QQ(t.checkJsDirective?Xs(t.checkJsDirective.pos,t.checkJsDirective.end):Gs(0,0),`// @ts-nocheck${a}`)])],fa.Disable_checking_for_this_file)];return ide.isValidLocationToAddComment(t,r.start)&&s.unshift(K7(Hie,ide.ChangeTracker.with(e,e=>Xie(e,t,r.start)),fa.Ignore_this_error_message,Kie,fa.Add_ts_ignore_to_all_error_messages)),s},fixIds:[Kie],getAllCodeActions:e=>{const t=new Set;return r5(e,Gie,(e,n)=>{ide.isValidLocationToAddComment(n.file,n.start)&&Xie(e,n.file,n.start,t)})}});var Zie=(e=>(e[e.Method=1]="Method",e[e.Property=2]="Property",e[e.All=3]="All",e))(Zie||{});function eoe(e,t,n,r,i,o,a,s,c=3,l=!1){const u=e.getDeclarations(),p=ge(u),f=r.program.getTypeChecker(),m=Sk(r.program.getCompilerOptions()),g=(null==p?void 0:p.kind)??172,h=function(e,t){if(262144&cx(e)){const t=e.links.nameType;if(t&&dC(t))return bw.createIdentifier(vc(pC(t)))}return UC(Fc(t),!1)}(e,p),y=p?Vv(p):0;let v=256&y;v|=1&y?1:4&y?4:0,p&&h_(p)&&(v|=512);const b=function(){let e;v&&(e=se(e,bw.createModifiersFromModifierFlags(v)));r.program.getCompilerOptions().noImplicitOverride&&p&&jv(p)&&(e=ae(e,bw.createToken(164)));return e&&bw.createNodeArray(e)}(),x=f.getWidenedType(f.getTypeOfSymbolAtLocation(e,t)),k=!!(16777216&e.flags),S=!!(33554432&t.flags)||l,T=hY(n,i),C=1|(0===T?268435456:0);switch(g){case 172:case 173:let n=f.typeToTypeNode(x,t,C,8,Yie(r));if(o){const e=yoe(n,m);e&&(n=e.typeNode,boe(o,e.symbols))}a(bw.createPropertyDeclaration(b,p?N(h):e.getName(),k&&2&c?bw.createToken(58):void 0,n,void 0));break;case 178:case 179:{pn.assertIsDefined(u);let e=f.typeToTypeNode(x,t,C,void 0,Yie(r));const n=hv(u,p),i=n.secondAccessor?[n.firstAccessor,n.secondAccessor]:[n.firstAccessor];if(o){const t=yoe(e,m);t&&(e=t.typeNode,boe(o,t.symbols))}for(const t of i)if(MD(t))a(bw.createGetAccessorDeclaration(b,N(h),_,F(e),D(s,T,S)));else{pn.assertNode(t,RD,"The counterpart to a getter should be a setter");const n=lv(t),r=n&&uD(n.name)?bc(n.name):void 0;a(bw.createSetAccessorDeclaration(b,N(h),uoe(1,[r],[F(e)],1,!1),D(s,T,S)))}break}case 174:case 175:pn.assertIsDefined(u);const i=x.isUnion()?L(x.types,e=>e.getCallSignatures()):x.getCallSignatures();if(!H(i))break;if(1===u.length){pn.assert(1===i.length,"One declaration implies one signature");const e=i[0];w(T,e,b,N(h),D(s,T,S));break}for(const e of i)e.declaration&&33554432&e.declaration.flags||w(T,e,b,N(h));if(!S)if(u.length>i.length){const e=f.getSignatureFromDeclaration(u[u.length-1]);w(T,e,b,N(h),D(s,T))}else pn.assert(u.length===i.length,"Declarations and signatures should match count"),a(function(e,t,n,r,i,o,a,s,c){let l=r[0],_=r[0].minArgumentCount,u=!1;for(const e of r)_=Math.min(e.minArgumentCount,_),hJ(e)&&(u=!0),e.parameters.length>=l.parameters.length&&(!hJ(e)||hJ(l))&&(l=e);const p=l.parameters.length-(hJ(l)?1:0),f=l.parameters.map(e=>e.name),m=uoe(p,f,void 0,_,!1);if(u){const e=bw.createParameterDeclaration(void 0,bw.createToken(26),f[p]||"rest",p>=_?bw.createToken(58):void 0,bw.createArrayTypeNode(bw.createKeywordTypeNode(159)),void 0);m.push(e)}return function(e,t,n,r,i,o,a,s){return bw.createMethodDeclaration(e,void 0,t,n?bw.createToken(58):void 0,r,i,o,s||doe(a))}(a,i,o,void 0,m,function(e,t,n,r){if(d(e)){const i=t.getUnionType(P(e,t.getReturnTypeOfSignature));return t.typeToTypeNode(i,r,1,8,Yie(n))}}(r,e,t,n),s,c)}(f,r,t,i,N(h),k&&!!(1&c),b,T,s))}function w(e,n,i,s,l){const _=toe(175,r,e,n,l,s,i,k&&!!(1&c),t,o);_&&a(_)}function N(e){return uD(e)&&"constructor"===e.escapedText?bw.createComputedPropertyName(bw.createStringLiteral(bc(e),0===T)):UC(e,!1)}function D(e,t,n){return n?void 0:UC(e,!1)||doe(t)}function F(e){return UC(e,!1)}}function toe(e,t,n,r,i,o,a,s,c,l){const _=t.program,u=_.getTypeChecker(),d=Sk(_.getCompilerOptions()),p=Om(c),f=524545|(0===n?268435456:0),m=u.signatureToSignatureDeclaration(r,e,c,f,8,Yie(t));if(!m)return;let g=p?void 0:m.typeParameters,h=m.parameters,y=p?void 0:UC(m.type);if(l){if(g){const e=I(g,e=>{let t=e.constraint,n=e.default;if(t){const e=yoe(t,d);e&&(t=e.typeNode,boe(l,e.symbols))}if(n){const e=yoe(n,d);e&&(n=e.typeNode,boe(l,e.symbols))}return bw.updateTypeParameterDeclaration(e,e.modifiers,e.name,t,n)});g!==e&&(g=FI(bw.createNodeArray(e,g.hasTrailingComma),g))}const e=I(h,e=>{let t=p?void 0:e.type;if(t){const e=yoe(t,d);e&&(t=e.typeNode,boe(l,e.symbols))}return bw.updateParameterDeclaration(e,e.modifiers,e.dotDotDotToken,e.name,p?void 0:e.questionToken,t,e.initializer)});if(h!==e&&(h=FI(bw.createNodeArray(e,h.hasTrailingComma),h)),y){const e=yoe(y,d);e&&(y=e.typeNode,boe(l,e.symbols))}}const v=s?bw.createToken(58):void 0,b=m.asteriskToken;return TF(m)?bw.updateFunctionExpression(m,a,m.asteriskToken,rt(o,uD),g,h,y,i??m.body):CF(m)?bw.updateArrowFunction(m,a,g,h,y,m.equalsGreaterThanToken,i??m.body):OD(m)?bw.updateMethodDeclaration(m,a,b,o??bw.createIdentifier(""),v,g,h,y,i):gE(m)?bw.updateFunctionDeclaration(m,a,m.asteriskToken,rt(o,uD),g,h,y,i??m.body):void 0}function noe(e,t,n,r,i,o,a){const s=hY(t.sourceFile,t.preferences),c=Sk(t.program.getCompilerOptions()),l=Yie(t),_=t.program.getTypeChecker(),u=Om(a),{typeArguments:d,arguments:p,parent:f}=r,m=u?void 0:_.getContextualType(r),g=P(p,e=>uD(e)?e.text:hF(e)&&uD(e.name)?e.name.text:void 0),h=u?[]:P(p,e=>_.getTypeAtLocation(e)),{argumentTypeNodes:y,argumentTypeParameters:v}=function(e,t,n,r,i,o,a,s){const c=[],l=new Map;for(let _=0;_e[0])),i=new Map(t);if(n){const i=n.filter(n=>!t.some(t=>{var r;return e.getTypeAtLocation(n)===(null==(r=t[1])?void 0:r.argumentType)})),o=r.size+i.length;for(let e=0;r.size{var t;return bw.createTypeParameterDeclaration(void 0,e,null==(t=i.get(e))?void 0:t.constraint)})}(_,v,d),S=uoe(p.length,g,y,void 0,u),T=u||void 0===m?void 0:_.typeToTypeNode(m,a,void 0,void 0,l);switch(e){case 175:return bw.createMethodDeclaration(b,x,i,void 0,k,S,T,doe(s));case 174:return bw.createMethodSignature(b,i,void 0,k,S,void 0===T?bw.createKeywordTypeNode(159):T);case 263:return pn.assert("string"==typeof i||uD(i),"Unexpected name"),bw.createFunctionDeclaration(b,x,i,k,S,T,poe(fa.Function_not_implemented.message,s));default:pn.fail("Unexpected kind")}}function roe(e){return 84+e<=90?String.fromCharCode(84+e):`T${e}`}function ioe(e,t,n,r,i,o,a,s){const c=e.typeToTypeNode(n,r,o,a,s);if(c)return ooe(c,t,i)}function ooe(e,t,n){const r=yoe(e,n);return r&&(boe(t,r.symbols),e=r.typeNode),UC(e)}function aoe(e,t,n,r,i,o){let a=e.typeToTypeNode(t,n,r,i,o);if(a){if(UD(a)){const n=t;if(n.typeArguments&&a.typeArguments){const t=function(e,t){var n;pn.assert(t.typeArguments);const r=t.typeArguments,i=t.target;for(let t=0;te===r[t]))return t}return r.length}(e,n);if(t=r?bw.createToken(58):void 0,i?void 0:(null==n?void 0:n[s])||bw.createKeywordTypeNode(159),void 0);o.push(l)}return o}function doe(e){return poe(fa.Method_not_implemented.message,e)}function poe(e,t){return bw.createBlock([bw.createThrowStatement(bw.createNewExpression(bw.createIdentifier("Error"),void 0,[bw.createStringLiteral(e,0===t)]))],!0)}function foe(e,t,n){const r=Gf(t);if(!r)return;const i=hoe(r,"compilerOptions");if(void 0===i)return void e.insertNodeAtObjectStart(t,r,goe("compilerOptions",bw.createObjectLiteralExpression(n.map(([e,t])=>goe(e,t)),!0)));const o=i.initializer;if(gF(o))for(const[r,i]of n){const n=hoe(o,r);void 0===n?e.insertNodeAtObjectStart(t,o,goe(r,i)):e.replaceNode(t,n.initializer,i)}}function moe(e,t,n,r){foe(e,t,[[n,r]])}function goe(e,t){return bw.createPropertyAssignment(bw.createStringLiteral(e),t)}function hoe(e,t){return x(e.properties,e=>cP(e)&&!!e.name&&KN(e.name)&&e.name.text===t)}function yoe(e,t){let n;const r=bJ(e,function e(r){if(gf(r)&&r.qualifier){const i=db(r.qualifier);if(!i.symbol)return EJ(r,e,void 0);const o=r0(i.symbol,t),a=o!==i.text?voe(r.qualifier,bw.createIdentifier(o)):r.qualifier;n=ae(n,i.symbol);const s=xJ(r.typeArguments,e,T_);return bw.createTypeReferenceNode(a,s)}return EJ(r,e,void 0)},T_);if(n&&r)return{typeNode:r,symbols:n}}function voe(e,t){return 80===e.kind?t:bw.createQualifiedName(voe(e.left,t),e.right)}function boe(e,t){t.forEach(t=>e.addImportFromExportedSymbol(t,!0))}function xoe(e,t){const n=Is(t);let r=lQ(e,t.start);for(;r.ende.replaceNode(t,n,r));return H7(Foe,i,[fa.Replace_import_with_0,i[0].textChanges[0].newText])}function Poe(e,t){const n=e.program.getTypeChecker().getTypeAtLocation(t);if(!(n.symbol&&ed(n.symbol)&&n.symbol.links.originatingImport))return[];const r=[],i=n.symbol.links.originatingImport;if(ff(i)||le(r,function(e,t){const n=Sd(t),r=Ng(t),i=e.program.getCompilerOptions(),o=[];return o.push(Eoe(e,n,t,pY(r.name,void 0,t.moduleSpecifier,hY(n,e.preferences)))),1===Tk(i)&&o.push(Eoe(e,n,t,bw.createImportEqualsDeclaration(void 0,!1,r.name,bw.createExternalModuleReference(t.moduleSpecifier)))),o}(e,i)),K_(t)&&(!Nc(t.parent)||t.parent.name!==t)){const n=e.sourceFile,i=ide.ChangeTracker.with(e,e=>e.replaceNode(n,t,bw.createPropertyAccessExpression(t,"default"),{}));r.push(H7(Foe,i,fa.Use_synthetic_default_member))}return r}Q7({errorCodes:[fa.This_expression_is_not_callable.code,fa.This_expression_is_not_constructable.code],getCodeActions:function(e){const t=e.sourceFile,n=fa.This_expression_is_not_callable.code===e.errorCode?214:215,r=mc(lQ(t,e.span.start),e=>e.kind===n);if(!r)return[];const i=r.expression;return Poe(e,i)}}),Q7({errorCodes:[fa.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,fa.Type_0_does_not_satisfy_the_constraint_1.code,fa.Type_0_is_not_assignable_to_type_1.code,fa.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,fa.Type_predicate_0_is_not_assignable_to_1.code,fa.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,fa._0_index_type_1_is_not_assignable_to_2_index_type_3.code,fa.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,fa.Property_0_in_type_1_is_not_assignable_to_type_2.code,fa.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,fa.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code],getCodeActions:function(e){const t=mc(lQ(e.sourceFile,e.span.start),t=>t.getStart()===e.span.start&&t.getEnd()===e.span.start+e.span.length);if(!t)return[];return Poe(e,t)}});var Aoe="strictClassInitialization",Ioe="addMissingPropertyDefiniteAssignmentAssertions",Ooe="addMissingPropertyUndefinedType",Loe="addMissingPropertyInitializer",joe=[fa.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];function Moe(e,t){const n=lQ(e,t);if(uD(n)&&AD(n.parent)){const e=yv(n.parent);if(e)return{type:e,prop:n.parent,isJs:Om(n.parent)}}}function Roe(e,t,n){KC(n);const r=bw.updatePropertyDeclaration(n,n.modifiers,n.name,bw.createToken(54),n.type,n.initializer);e.replaceNode(t,n,r)}function Boe(e,t,n){const r=bw.createKeywordTypeNode(157),i=ZD(n.type)?n.type.types.concat(r):[n.type,r],o=bw.createUnionTypeNode(i);n.isJs?e.addJSDocTags(t,n.prop,[bw.createJSDocTypeTag(void 0,bw.createJSDocTypeExpression(o))]):e.replaceNode(t,n.type,o)}function Joe(e,t,n,r){KC(n);const i=bw.updatePropertyDeclaration(n,n.modifiers,n.name,n.questionToken,n.type,r);e.replaceNode(t,n,i)}function zoe(e,t){return qoe(e,e.getTypeFromTypeNode(t.type))}function qoe(e,t){if(512&t.flags)return t===e.getFalseType()||t===e.getFalseType(!0)?bw.createFalse():bw.createTrue();if(t.isStringLiteral())return bw.createStringLiteral(t.value);if(t.isNumberLiteral())return bw.createNumericLiteral(t.value);if(2048&t.flags)return bw.createBigIntLiteral(t.value);if(t.isUnion())return m(t.types,t=>qoe(e,t));if(t.isClass()){const e=bx(t.symbol);if(!e||Av(e,64))return;const n=cv(e);if(n&&n.parameters.length)return;return bw.createNewExpression(bw.createIdentifier(t.symbol.name),void 0,void 0)}return e.isArrayLikeType(t)?bw.createArrayLiteralExpression():void 0}Q7({errorCodes:joe,getCodeActions:function(e){const t=Moe(e.sourceFile,e.span.start);if(!t)return;const n=[];return ae(n,function(e,t){const n=ide.ChangeTracker.with(e,n=>Boe(n,e.sourceFile,t));return K7(Aoe,n,[fa.Add_undefined_type_to_property_0,t.prop.name.getText()],Ooe,fa.Add_undefined_type_to_all_uninitialized_properties)}(e,t)),ae(n,function(e,t){if(t.isJs)return;const n=ide.ChangeTracker.with(e,n=>Roe(n,e.sourceFile,t.prop));return K7(Aoe,n,[fa.Add_definite_assignment_assertion_to_property_0,t.prop.getText()],Ioe,fa.Add_definite_assignment_assertions_to_all_uninitialized_properties)}(e,t)),ae(n,function(e,t){if(t.isJs)return;const n=e.program.getTypeChecker(),r=zoe(n,t.prop);if(!r)return;const i=ide.ChangeTracker.with(e,n=>Joe(n,e.sourceFile,t.prop,r));return K7(Aoe,i,[fa.Add_initializer_to_property_0,t.prop.name.getText()],Loe,fa.Add_initializers_to_all_uninitialized_properties)}(e,t)),n},fixIds:[Ioe,Ooe,Loe],getAllCodeActions:e=>r5(e,joe,(t,n)=>{const r=Moe(n.file,n.start);if(r)switch(e.fixId){case Ioe:Roe(t,n.file,r.prop);break;case Ooe:Boe(t,n.file,r);break;case Loe:const i=zoe(e.program.getTypeChecker(),r.prop);if(!i)return;Joe(t,n.file,r.prop,i);break;default:pn.fail(JSON.stringify(e.fixId))}})});var Uoe="requireInTs",Voe=[fa.require_call_may_be_converted_to_an_import.code];function Woe(e,t,n){const{allowSyntheticDefaults:r,defaultImportName:i,namedImports:o,statement:a,moduleSpecifier:s}=n;e.replaceNode(t,a,i&&!r?bw.createImportEqualsDeclaration(void 0,!1,i,bw.createExternalModuleReference(s)):bw.createImportDeclaration(void 0,bw.createImportClause(void 0,i,o),s,void 0))}function $oe(e,t,n,r){const{parent:i}=lQ(e,n);Bm(i,!0)||pn.failBadSyntaxKind(i);const o=it(i.parent,fE),a=hY(e,r),s=rt(o.name,uD),c=dF(o.name)?function(e){const t=[];for(const n of e.elements){if(!uD(n.name)||n.initializer)return;t.push(bw.createImportSpecifier(!1,rt(n.propertyName,uD),n.name))}if(t.length)return bw.createNamedImports(t)}(o.name):void 0;if(s||c){const e=ye(i.arguments);return{allowSyntheticDefaults:Fk(t.getCompilerOptions()),defaultImportName:s,namedImports:c,statement:it(o.parent.parent,XF),moduleSpecifier:QN(e)?bw.createStringLiteral(e.text,0===a):e}}}Q7({errorCodes:Voe,getCodeActions(e){const t=$oe(e.sourceFile,e.program,e.span.start,e.preferences);if(!t)return;const n=ide.ChangeTracker.with(e,n=>Woe(n,e.sourceFile,t));return[K7(Uoe,n,fa.Convert_require_to_import,Uoe,fa.Convert_all_require_to_import)]},fixIds:[Uoe],getAllCodeActions:e=>r5(e,Voe,(t,n)=>{const r=$oe(n.file,e.program,n.start,e.preferences);r&&Woe(t,e.sourceFile,r)})});var Hoe="useDefaultImport",Koe=[fa.Import_may_be_converted_to_a_default_import.code];function Goe(e,t){const n=lQ(e,t);if(!uD(n))return;const{parent:r}=n;if(CE(r)&&WE(r.moduleReference))return{importNode:r,name:n,moduleSpecifier:r.moduleReference.expression};if(IE(r)&&wE(r.parent.parent)){const e=r.parent.parent;return{importNode:e,name:n,moduleSpecifier:e.moduleSpecifier}}}function Xoe(e,t,n,r){e.replaceNode(t,n.importNode,pY(n.name,void 0,n.moduleSpecifier,hY(t,r)))}Q7({errorCodes:Koe,getCodeActions(e){const{sourceFile:t,span:{start:n}}=e,r=Goe(t,n);if(!r)return;const i=ide.ChangeTracker.with(e,n=>Xoe(n,t,r,e.preferences));return[K7(Hoe,i,fa.Convert_to_default_import,Hoe,fa.Convert_all_to_default_imports)]},fixIds:[Hoe],getAllCodeActions:e=>r5(e,Koe,(t,n)=>{const r=Goe(n.file,n.start);r&&Xoe(t,n.file,r,e.preferences)})});var Qoe="useBigintLiteral",Yoe=[fa.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code];function Zoe(e,t,n){const r=rt(lQ(t,n.start),$N);if(!r)return;const i=r.getText(t)+"n";e.replaceNode(t,r,bw.createBigIntLiteral(i))}Q7({errorCodes:Yoe,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>Zoe(t,e.sourceFile,e.span));if(t.length>0)return[K7(Qoe,t,fa.Convert_to_a_bigint_numeric_literal,Qoe,fa.Convert_all_to_bigint_numeric_literals)]},fixIds:[Qoe],getAllCodeActions:e=>r5(e,Yoe,(e,t)=>Zoe(e,t.file,t))});var eae="fixAddModuleReferTypeMissingTypeof",tae=[fa.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];function nae(e,t){const n=lQ(e,t);return pn.assert(102===n.kind,"This token should be an ImportKeyword"),pn.assert(206===n.parent.kind,"Token parent should be an ImportType"),n.parent}function rae(e,t,n){const r=bw.updateImportTypeNode(n,n.argument,n.attributes,n.qualifier,n.typeArguments,!0);e.replaceNode(t,n,r)}Q7({errorCodes:tae,getCodeActions:function(e){const{sourceFile:t,span:n}=e,r=nae(t,n.start),i=ide.ChangeTracker.with(e,e=>rae(e,t,r));return[K7(eae,i,fa.Add_missing_typeof,eae,fa.Add_missing_typeof)]},fixIds:[eae],getAllCodeActions:e=>r5(e,tae,(t,n)=>rae(t,e.sourceFile,nae(n.file,n.start)))});var iae="wrapJsxInFragment",oae=[fa.JSX_expressions_must_have_one_parent_element.code];function aae(e,t){let n=lQ(e,t).parent.parent;if((AF(n)||(n=n.parent,AF(n)))&&Pd(n.operatorToken))return n}function sae(e,t,n){const r=function(e){const t=[];let n=e;for(;;){if(AF(n)&&Pd(n.operatorToken)&&28===n.operatorToken.kind){if(t.push(n.left),xu(n.right))return t.push(n.right),t;if(AF(n.right)){n=n.right;continue}return}return}}(n);r&&e.replaceNode(t,n,bw.createJsxFragment(bw.createJsxOpeningFragment(),r,bw.createJsxJsxClosingFragment()))}Q7({errorCodes:oae,getCodeActions:function(e){const{sourceFile:t,span:n}=e,r=aae(t,n.start);if(!r)return;const i=ide.ChangeTracker.with(e,e=>sae(e,t,r));return[K7(iae,i,fa.Wrap_in_JSX_fragment,iae,fa.Wrap_all_unparented_JSX_in_JSX_fragment)]},fixIds:[iae],getAllCodeActions:e=>r5(e,oae,(t,n)=>{const r=aae(e.sourceFile,n.start);r&&sae(t,e.sourceFile,r)})});var cae="wrapDecoratorInParentheses",lae=[fa.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code];function _ae(e,t,n){const r=mc(lQ(t,n),ED);pn.assert(!!r,"Expected position to be owned by a decorator.");const i=bw.createParenthesizedExpression(r.expression);e.replaceNode(t,r.expression,i)}Q7({errorCodes:lae,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>_ae(t,e.sourceFile,e.span.start));return[K7(cae,t,fa.Wrap_in_parentheses,cae,fa.Wrap_all_invalid_decorator_expressions_in_parentheses)]},fixIds:[cae],getAllCodeActions:e=>r5(e,lae,(e,t)=>_ae(e,t.file,t.start))});var uae="fixConvertToMappedObjectType",dae=[fa.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];function pae(e,t){const n=rt(lQ(e,t).parent.parent,zD);if(!n)return;const r=yE(n.parent)?n.parent:rt(n.parent.parent,vE);return r?{indexSignature:n,container:r}:void 0}function fae(e,t,{indexSignature:n,container:r}){const i=(yE(r)?r.members:r.type.members).filter(e=>!zD(e)),o=ye(n.parameters),a=bw.createTypeParameterDeclaration(void 0,it(o.name,uD),o.type),s=bw.createMappedTypeNode(Bv(n)?bw.createModifier(148):void 0,a,void 0,n.questionToken,n.type,void 0),c=bw.createIntersectionTypeNode([...Ch(r),s,...i.length?[bw.createTypeLiteralNode(i)]:_]);var l,u;e.replaceNode(t,r,(l=r,u=c,bw.createTypeAliasDeclaration(l.modifiers,l.name,l.typeParameters,u)))}Q7({errorCodes:dae,getCodeActions:function(e){const{sourceFile:t,span:n}=e,r=pae(t,n.start);if(!r)return;const i=ide.ChangeTracker.with(e,e=>fae(e,t,r)),o=bc(r.container.name);return[K7(uae,i,[fa.Convert_0_to_mapped_object_type,o],uae,[fa.Convert_0_to_mapped_object_type,o])]},fixIds:[uae],getAllCodeActions:e=>r5(e,dae,(e,t)=>{const n=pae(t.file,t.start);n&&fae(e,t.file,n)})});var mae="removeAccidentalCallParentheses";Q7({errorCodes:[fa.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code],getCodeActions(e){const t=mc(lQ(e.sourceFile,e.span.start),vF);if(!t)return;const n=ide.ChangeTracker.with(e,n=>{n.deleteRange(e.sourceFile,{pos:t.expression.end,end:t.end})});return[H7(mae,n,fa.Remove_parentheses)]},fixIds:[mae]});var gae="removeUnnecessaryAwait",hae=[fa.await_has_no_effect_on_the_type_of_this_expression.code];function yae(e,t,n){const r=rt(lQ(t,n.start),e=>135===e.kind),i=r&&rt(r.parent,FF);if(!i)return;let o=i;if(SF(i.parent)){if(uD(Ix(i.expression,!1))){const e=fQ(i.parent.pos,t);e&&105!==e.kind&&(o=i.parent)}}e.replaceNode(t,o,i.expression)}Q7({errorCodes:hae,getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>yae(t,e.sourceFile,e.span));if(t.length>0)return[K7(gae,t,fa.Remove_unnecessary_await,gae,fa.Remove_all_unnecessary_uses_of_await)]},fixIds:[gae],getAllCodeActions:e=>r5(e,hae,(e,t)=>yae(e,t.file,t))});var vae=[fa.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],bae="splitTypeOnlyImport";function xae(e,t){return mc(lQ(e,t.start),wE)}function kae(e,t,n){if(!t)return;const r=pn.checkDefined(t.importClause);e.replaceNode(n.sourceFile,t,bw.updateImportDeclaration(t,t.modifiers,bw.updateImportClause(r,r.phaseModifier,r.name,void 0),t.moduleSpecifier,t.attributes)),e.insertNodeAfter(n.sourceFile,t,bw.createImportDeclaration(void 0,bw.updateImportClause(r,r.phaseModifier,void 0,r.namedBindings),t.moduleSpecifier,t.attributes))}Q7({errorCodes:vae,fixIds:[bae],getCodeActions:function(e){const t=ide.ChangeTracker.with(e,t=>kae(t,xae(e.sourceFile,e.span),e));if(t.length)return[K7(bae,t,fa.Split_into_two_separate_import_declarations,bae,fa.Split_all_invalid_type_only_imports)]},getAllCodeActions:e=>r5(e,vae,(t,n)=>{kae(t,xae(e.sourceFile,n),e)})});var Sae="fixConvertConstToLet",Tae=[fa.Cannot_assign_to_0_because_it_is_a_constant.code];function Cae(e,t,n){var r;const i=n.getTypeChecker().getSymbolAtLocation(lQ(e,t));if(void 0===i)return;const o=rt(null==(r=null==i?void 0:i.valueDeclaration)?void 0:r.parent,mE);if(void 0===o)return;const a=GX(o,87,e);return void 0!==a?{symbol:i,token:a}:void 0}function wae(e,t,n){e.replaceNode(t,n,bw.createToken(121))}Q7({errorCodes:Tae,getCodeActions:function(e){const{sourceFile:t,span:n,program:r}=e,i=Cae(t,n.start,r);if(void 0===i)return;const o=ide.ChangeTracker.with(e,e=>wae(e,t,i.token));return[G7(Sae,o,fa.Convert_const_to_let,Sae,fa.Convert_all_const_to_let)]},getAllCodeActions:e=>{const{program:t}=e,n=new Set;return t5(ide.ChangeTracker.with(e,r=>{i5(e,Tae,e=>{const i=Cae(e.file,e.start,t);if(i&&Cx(n,uJ(i.symbol)))return wae(r,e.file,i.token)})}))},fixIds:[Sae]});var Nae="fixExpectedComma",Dae=[fa._0_expected.code];function Fae(e,t,n){const r=lQ(e,t);return 27===r.kind&&r.parent&&(gF(r.parent)||mF(r.parent))?{node:r}:void 0}function Eae(e,t,{node:n}){const r=bw.createToken(28);e.replaceNode(t,n,r)}Q7({errorCodes:Dae,getCodeActions(e){const{sourceFile:t}=e,n=Fae(t,e.span.start,e.errorCode);if(!n)return;const r=ide.ChangeTracker.with(e,e=>Eae(e,t,n));return[K7(Nae,r,[fa.Change_0_to_1,";",","],Nae,[fa.Change_0_to_1,";",","])]},fixIds:[Nae],getAllCodeActions:e=>r5(e,Dae,(t,n)=>{const r=Fae(n.file,n.start,n.code);r&&Eae(t,e.sourceFile,r)})});var Pae="addVoidToPromise",Aae=[fa.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,fa.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];function Iae(e,t,n,r,i){const o=lQ(t,n.start);if(!uD(o)||!vF(o.parent)||o.parent.expression!==o||0!==o.parent.arguments.length)return;const a=r.getTypeChecker(),s=a.getSymbolAtLocation(o),c=null==s?void 0:s.valueDeclaration;if(!c||!FD(c)||!bF(c.parent.parent))return;if(null==i?void 0:i.has(c))return;null==i||i.add(c);const l=function(e){var t;if(!Om(e))return e.typeArguments;if(SF(e.parent)){const n=null==(t=ol(e.parent))?void 0:t.typeExpression.type;if(n&&UD(n)&&uD(n.typeName)&&"Promise"===bc(n.typeName))return n.typeArguments}}(c.parent.parent);if(H(l)){const n=l[0],r=!ZD(n)&&!rF(n)&&rF(bw.createUnionTypeNode([n,bw.createKeywordTypeNode(116)]).types[0]);r&&e.insertText(t,n.pos,"("),e.insertText(t,n.end,r?") | void":" | void")}else{const n=a.getResolvedSignature(o.parent),r=null==n?void 0:n.parameters[0],i=r&&a.getTypeOfSymbolAtLocation(r,c.parent.parent);Om(c)?(!i||3&i.flags)&&(e.insertText(t,c.parent.parent.end,")"),e.insertText(t,ts(t.text,c.parent.parent.pos),"/** @type {Promise} */(")):(!i||2&i.flags)&&e.insertText(t,c.parent.parent.expression.end,"")}}Q7({errorCodes:Aae,fixIds:[Pae],getCodeActions(e){const t=ide.ChangeTracker.with(e,t=>Iae(t,e.sourceFile,e.span,e.program));if(t.length>0)return[K7("addVoidToPromise",t,fa.Add_void_to_Promise_resolved_without_a_value,Pae,fa.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions:e=>r5(e,Aae,(t,n)=>Iae(t,n.file,n,e.program,new Set))});var Oae={};o(Oae,{CompletionKind:()=>Dse,CompletionSource:()=>Jae,SortText:()=>Mae,StringCompletions:()=>ace,SymbolOriginInfoKind:()=>zae,createCompletionDetails:()=>wse,createCompletionDetailsForSymbol:()=>Cse,getCompletionEntriesFromSymbols:()=>xse,getCompletionEntryDetails:()=>Sse,getCompletionEntrySymbol:()=>Nse,getCompletionsAtPosition:()=>Xae,getDefaultCommitCharacters:()=>Gae,getPropertiesForObjectExpression:()=>qse,moduleSpecifierResolutionCacheAttemptLimit:()=>jae,moduleSpecifierResolutionLimit:()=>Lae});var Lae=100,jae=1e3,Mae={LocalDeclarationPriority:"10",LocationPriority:"11",OptionalMember:"12",MemberDeclaredBySpreadAssignment:"13",SuggestedClassMembers:"14",GlobalsOrKeywords:"15",AutoImportSuggestions:"16",ClassMemberSnippets:"17",JavascriptIdentifiers:"18",Deprecated:e=>"z"+e,ObjectLiteralProperty:(e,t)=>`${e}\0${t}\0`,SortBelow:e=>e+"1"},Rae=[".",",",";"],Bae=[".",";"],Jae=(e=>(e.ThisProperty="ThisProperty/",e.ClassMemberSnippet="ClassMemberSnippet/",e.TypeOnlyAlias="TypeOnlyAlias/",e.ObjectLiteralMethodSnippet="ObjectLiteralMethodSnippet/",e.SwitchCases="SwitchCases/",e.ObjectLiteralMemberWithComma="ObjectLiteralMemberWithComma/",e))(Jae||{}),zae=(e=>(e[e.ThisType=1]="ThisType",e[e.SymbolMember=2]="SymbolMember",e[e.Export=4]="Export",e[e.Promise=8]="Promise",e[e.Nullable=16]="Nullable",e[e.ResolvedExport=32]="ResolvedExport",e[e.TypeOnlyAlias=64]="TypeOnlyAlias",e[e.ObjectLiteralMethod=128]="ObjectLiteralMethod",e[e.Ignore=256]="Ignore",e[e.ComputedPropertyName=512]="ComputedPropertyName",e[e.SymbolMemberNoExport=2]="SymbolMemberNoExport",e[e.SymbolMemberExport=6]="SymbolMemberExport",e))(zae||{});function qae(e){return!!(e&&4&e.kind)}function Uae(e){return!(!e||32!==e.kind)}function Vae(e){return(qae(e)||Uae(e))&&!!e.isFromPackageJson}function Wae(e){return!!(e&&64&e.kind)}function $ae(e){return!!(e&&128&e.kind)}function Hae(e){return!!(e&&512&e.kind)}function Kae(e,t,n,r,i,o,a,s,c){var l,_,u,d;const p=Wn(),f=a||Ek(r.getCompilerOptions())||(null==(l=o.autoImportSpecifierExcludeRegexes)?void 0:l.length);let m=!1,g=0,h=0,y=0,v=0;const b=c({tryResolve:function(e,t){if(t){const t=n.getModuleSpecifierForBestExportInfo(e,i,s);return t&&g++,t||"failed"}const r=f||o.allowIncompleteCompletions&&hm,resolvedAny:()=>h>0,resolvedBeyondLimit:()=>h>Lae}),x=v?` (${(y/v*100).toFixed(1)}% hit rate)`:"";return null==(_=t.log)||_.call(t,`${e}: resolved ${h} module specifiers, plus ${g} ambient and ${y} from cache${x}`),null==(u=t.log)||u.call(t,`${e}: response is ${m?"incomplete":"complete"}`),null==(d=t.log)||d.call(t,`${e}: ${Wn()-p}`),b}function Gae(e){return e?[]:Rae}function Xae(e,t,n,r,i,o,a,s,c,l,_=!1){var u;const{previousToken:d}=Pse(i,r);if(a&&!yQ(r,i,d)&&!function(e,t,n,r){switch(t){case".":case"@":return!0;case'"':case"'":case"`":return!!n&&wZ(n)&&r===n.getStart(e)+1;case"#":return!!n&&dD(n)&&!!em(n);case"<":return!!n&&30===n.kind&&(!AF(n.parent)||Hse(n.parent));case"/":return!!n&&(Ju(n)?!!Tg(n):31===n.kind&&GE(n.parent));case" ":return!!n&&TD(n)&&308===n.parent.kind;default:return pn.assertNever(t)}}(r,a,d,i))return;if(" "===a)return o.includeCompletionsForImportStatements&&o.includeCompletionsWithInsertText?{isGlobalCompletion:!0,isMemberCompletion:!1,isNewIdentifierLocation:!0,isIncomplete:!0,entries:[],defaultCommitCharacters:Gae(!0)}:void 0;const p=t.getCompilerOptions(),f=t.getTypeChecker(),m=o.allowIncompleteCompletions?null==(u=e.getIncompleteCompletionsCache)?void 0:u.call(e):void 0;if(m&&3===s&&d&&uD(d)){const n=function(e,t,n,r,i,o,a,s){const c=e.get();if(!c)return;const l=sQ(t,s),_=n.text.toLowerCase(),u=E0(t,i,r,o,a),d=Kae("continuePreviousIncompleteResponse",i,U7.createImportSpecifierResolver(t,r,i,o),r,n.getStart(),o,!1,CT(n),e=>{const n=J(c.entries,n=>{var o;if(!n.hasAction||!n.source||!n.data||Yae(n.data))return n;if(!rce(n.name,_))return;const{origin:a}=pn.checkDefined(Ase(n.name,n.data,r,i)),s=u.get(t.path,n.data.exportMapKey),c=s&&e.tryResolve(s,!Fs(Iy(a.moduleSymbol.name)));if("skipped"===c)return n;if(!c||"failed"===c)return void(null==(o=i.log)||o.call(i,`Unexpected failure resolving auto import for '${n.name}' from '${n.source}'`));const l={...a,kind:32,moduleSpecifier:c.moduleSpecifier};return n.data=gse(l),n.source=bse(l),n.sourceDisplay=[KY(l.moduleSpecifier)],n});return e.skippedAny()||(c.isIncomplete=void 0),n});return c.entries=d,c.flags=4|(c.flags||0),c.optionalReplacementSpan=ise(l),c}(m,r,d,t,e,o,c,i);if(n)return n}else null==m||m.clear();const g=ace.getStringLiteralCompletions(r,i,d,p,e,t,n,o,_);if(g)return g;if(d&&Fl(d.parent)&&(83===d.kind||88===d.kind||80===d.kind))return function(e){const t=function(e){const t=[],n=new Map;let r=e;for(;r&&!s_(r);){if(_E(r)){const e=r.label.text;n.has(e)||(n.set(e,!0),t.push({name:e,kindModifiers:"",kind:"label",sortText:Mae.LocationPriority}))}r=r.parent}return t}(e);if(t.length)return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:t,defaultCommitCharacters:Gae(!1)}}(d.parent);const h=Ese(t,n,r,p,i,o,void 0,e,l,c);var y,v;if(h)switch(h.kind){case 0:const a=function(e,t,n,r,i,o,a,s,c,l){const{symbols:_,contextToken:u,completionKind:d,isInSnippetScope:p,isNewIdentifierLocation:f,location:m,propertyAccessToConvert:g,keywordFilters:h,symbolToOriginInfoMap:y,recommendedCompletion:v,isJsxInitializer:b,isTypeOnlyLocation:x,isJsxIdentifierExpected:k,isRightOfOpenTag:S,isRightOfDotOrQuestionDot:T,importStatementCompletion:C,insideJsDocTagTypeExpression:w,symbolToSortTextMap:N,hasUnresolvedAutoImports:D,defaultCommitCharacters:F}=o;let E=o.literals;const P=n.getTypeChecker();if(1===fk(e.scriptKind)){const t=function(e,t){const n=mc(e,e=>{switch(e.kind){case 288:return!0;case 31:case 32:case 80:case 212:return!1;default:return"quit"}});if(n){const e=!!GX(n,32,t),r=n.parent.openingElement.tagName.getText(t)+(e?"":">");return{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:!1,optionalReplacementSpan:WQ(n.tagName),entries:[{name:r,kind:"class",kindModifiers:void 0,sortText:Mae.LocationPriority}],defaultCommitCharacters:Gae(!1)}}return}(m,e);if(t)return t}const A=mc(u,iP);if(A&&(CD(u)||dh(u,A.expression))){const e=g0(P,A.parent.clauses);E=E.filter(t=>!e.hasValue(t)),_.forEach((t,n)=>{if(t.valueDeclaration&&uP(t.valueDeclaration)){const r=P.getConstantValue(t.valueDeclaration);void 0!==r&&e.hasValue(r)&&(y[n]={kind:256})}})}const I=[],O=ose(e,r);if(O&&!f&&(!_||0===_.length)&&0===h)return;const L=xse(_,I,void 0,u,m,c,e,t,n,Sk(r),i,d,a,r,s,x,g,k,b,C,v,y,N,k,S,l);if(0!==h)for(const t of jse(h,!w&&Im(e)))(x&&ZQ(Oa(t.name))||!x&&oce(t.name)||!L.has(t.name))&&(L.add(t.name),te(I,t,Qae,void 0,!0));for(const e of function(e,t){const n=[];if(e){const r=e.getSourceFile(),i=e.parent,o=r.getLineAndCharacterOfPosition(e.end).line,a=r.getLineAndCharacterOfPosition(t).line;(wE(i)||RE(i)&&i.moduleSpecifier)&&e===i.moduleSpecifier&&o===a&&n.push({name:Ia(132),kind:"keyword",kindModifiers:"",sortText:Mae.GlobalsOrKeywords})}return n}(u,c))L.has(e.name)||(L.add(e.name),te(I,e,Qae,void 0,!0));for(const t of E){const n=use(e,a,t);L.add(n.name),te(I,n,Qae,void 0,!0)}O||function(e,t,n,r,i){m7(e).forEach((e,o)=>{if(e===t)return;const a=vc(o);!n.has(a)&&vs(a,r)&&(n.add(a),te(i,{name:a,kind:"warning",kindModifiers:"",sortText:Mae.JavascriptIdentifiers,isFromUncheckedFile:!0,commitCharacters:[]},Qae))})}(e,m.pos,L,Sk(r),I);let j;if(a.includeCompletionsWithInsertText&&u&&!S&&!T&&(j=mc(u,SE))){const i=ase(j,e,a,r,t,n,s);i&&I.push(i.entry)}return{flags:o.flags,isGlobalCompletion:p,isIncomplete:!(!a.allowIncompleteCompletions||!D)||void 0,isMemberCompletion:lse(d),isNewIdentifierLocation:f,optionalReplacementSpan:ise(m),entries:I,defaultCommitCharacters:F??Gae(f)}}(r,e,t,p,n,h,o,l,i,_);return(null==a?void 0:a.isIncomplete)&&(null==m||m.set(a)),a;case 1:return Zae([...$le.getJSDocTagNameCompletions(),...ese(r,i,f,p,o,!0)]);case 2:return Zae([...$le.getJSDocTagCompletions(),...ese(r,i,f,p,o,!1)]);case 3:return Zae($le.getJSDocParameterNameCompletions(h.tag));case 4:return y=h.keywordCompletions,{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:v=h.isNewIdentifierLocation,entries:y.slice(),defaultCommitCharacters:Gae(v)};default:return pn.assertNever(h)}}function Qae(e,t){var n,r;let i=Ot(e.sortText,t.sortText);return 0===i&&(i=Ot(e.name,t.name)),0===i&&(null==(n=e.data)?void 0:n.moduleSpecifier)&&(null==(r=t.data)?void 0:r.moduleSpecifier)&&(i=$S(e.data.moduleSpecifier,t.data.moduleSpecifier)),0===i?-1:i}function Yae(e){return!!(null==e?void 0:e.moduleSpecifier)}function Zae(e){return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e,defaultCommitCharacters:Gae(!1)}}function ese(e,t,n,r,i,o){const a=lQ(e,t);if(!Fu(a)&&!DP(a))return[];const s=DP(a)?a:a.parent;if(!DP(s))return[];const c=s.parent;if(!s_(c))return[];const l=Im(e),_=i.includeCompletionsWithSnippetText||void 0,u=N(s.tags,e=>VP(e)&&e.getEnd()<=t);return J(c.parameters,e=>{if(!Oc(e).length){if(uD(e.name)){const t={tabstop:1},a=e.name.text;let s=nse(a,e.initializer,e.dotDotDotToken,l,!1,!1,n,r,i),c=_?nse(a,e.initializer,e.dotDotDotToken,l,!1,!0,n,r,i,t):void 0;return o&&(s=s.slice(1),c&&(c=c.slice(1))),{name:s,kind:"parameter",sortText:Mae.LocationPriority,insertText:_?c:void 0,isSnippet:_}}if(e.parent.parameters.indexOf(e)===u){const t=`param${u}`,a=tse(t,e.name,e.initializer,e.dotDotDotToken,l,!1,n,r,i),s=_?tse(t,e.name,e.initializer,e.dotDotDotToken,l,!0,n,r,i):void 0;let c=a.join(jb(r)+"* "),d=null==s?void 0:s.join(jb(r)+"* ");return o&&(c=c.slice(1),d&&(d=d.slice(1))),{name:c,kind:"parameter",sortText:Mae.LocationPriority,insertText:_?d:void 0,isSnippet:_}}}})}function tse(e,t,n,r,i,o,a,s,c){return i?l(e,t,n,r,{tabstop:1}):[nse(e,n,r,i,!1,o,a,s,c,{tabstop:1})];function l(e,t,n,r,l){if(dF(t)&&!r){const u={tabstop:l.tabstop},d=nse(e,n,r,i,!0,o,a,s,c,u);let p=[];for(const n of t.elements){const t=_(e,n,u);if(!t){p=void 0;break}p.push(...t)}if(p)return l.tabstop=u.tabstop,[d,...p]}return[nse(e,n,r,i,!1,o,a,s,c,l)]}function _(e,t,n){if(!t.propertyName&&uD(t.name)||uD(t.name)){const r=t.propertyName?Bp(t.propertyName):t.name.text;if(!r)return;return[nse(`${e}.${r}`,t.initializer,t.dotDotDotToken,i,!1,o,a,s,c,n)]}if(t.propertyName){const r=Bp(t.propertyName);return r&&l(`${e}.${r}`,t.name,t.initializer,t.dotDotDotToken,n)}}}function nse(e,t,n,r,i,o,a,s,c,l){if(o&&pn.assertIsDefined(l),t&&(e=function(e,t){const n=t.getText().trim();if(n.includes("\n")||n.length>80)return`[${e}]`;return`[${e}=${n}]`}(e,t)),o&&(e=VT(e)),r){let r="*";if(i)pn.assert(!n,"Cannot annotate a rest parameter with type 'Object'."),r="Object";else{if(t){const e=a.getTypeAtLocation(t.parent);if(!(16385&e.flags)){const n=t.getSourceFile(),i=0===hY(n,c)?268435456:0,l=a.typeToTypeNode(e,mc(t,s_),i);if(l){const e=o?mse({removeComments:!0,module:s.module,moduleResolution:s.moduleResolution,target:s.target}):IU({removeComments:!0,module:s.module,moduleResolution:s.moduleResolution,target:s.target});ww(l,1),r=e.printNode(4,l,n)}}}o&&"*"===r&&(r=`\${${l.tabstop++}:${r}}`)}return`@param {${!i&&n?"...":""}${r}} ${e} ${o?`\${${l.tabstop++}}`:""}`}return`@param ${e} ${o?`\${${l.tabstop++}}`:""}`}function rse(e,t,n){return{kind:4,keywordCompletions:jse(e,t),isNewIdentifierLocation:n}}function ise(e){return 80===(null==e?void 0:e.kind)?WQ(e):void 0}function ose(e,t){return!Im(e)||!!sT(e,t)}function ase(e,t,n,r,i,o,a){const s=e.clauses,c=o.getTypeChecker(),l=c.getTypeAtLocation(e.parent.expression);if(l&&l.isUnion()&&b(l.types,e=>e.isLiteral())){const _=g0(c,s),u=Sk(r),d=hY(t,n),p=U7.createImportAdder(t,o,n,i),f=[];for(const t of l.types)if(1024&t.flags){pn.assert(t.symbol,"An enum member type should have a symbol"),pn.assert(t.symbol.parent,"An enum member type should have a parent symbol (the enum symbol)");const n=t.symbol.valueDeclaration&&c.getConstantValue(t.symbol.valueDeclaration);if(void 0!==n){if(_.hasValue(n))continue;_.addValue(n)}const r=U7.typeToAutoImportableTypeNode(c,p,t,e,u);if(!r)return;const i=sse(r,u,d);if(!i)return;f.push(i)}else if(!_.hasValue(t.value))switch(typeof t.value){case"object":f.push(t.value.negative?bw.createPrefixUnaryExpression(41,bw.createBigIntLiteral({negative:!1,base10Value:t.value.base10Value})):bw.createBigIntLiteral(t.value));break;case"number":f.push(t.value<0?bw.createPrefixUnaryExpression(41,bw.createNumericLiteral(-t.value)):bw.createNumericLiteral(t.value));break;case"string":f.push(bw.createStringLiteral(t.value,0===d))}if(0===f.length)return;const m=P(f,e=>bw.createCaseClause(e,[])),g=tZ(i,null==a?void 0:a.options),h=mse({removeComments:!0,module:r.module,moduleResolution:r.moduleResolution,target:r.target,newLine:u0(g)}),y=a?e=>h.printAndFormatNode(4,e,t,a):e=>h.printNode(4,e,t),v=P(m,(e,t)=>n.includeCompletionsWithSnippetText?`${y(e)}$${t+1}`:`${y(e)}`).join(g);return{entry:{name:`${h.printNode(4,m[0],t)} ...`,kind:"",sortText:Mae.GlobalsOrKeywords,insertText:v,hasAction:p.hasFixes()||void 0,source:"SwitchCases/",isSnippet:!!n.includeCompletionsWithSnippetText||void 0},importAdder:p}}}function sse(e,t,n){switch(e.kind){case 184:return cse(e.typeName,t,n);case 200:const r=sse(e.objectType,t,n),i=sse(e.indexType,t,n);return r&&i&&bw.createElementAccessExpression(r,i);case 202:const o=e.literal;switch(o.kind){case 11:return bw.createStringLiteral(o.text,0===n);case 9:return bw.createNumericLiteral(o.text,o.numericLiteralFlags)}return;case 197:const a=sse(e.type,t,n);return a&&(uD(a)?a:bw.createParenthesizedExpression(a));case 187:return cse(e.exprName,t,n);case 206:pn.fail("We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.")}}function cse(e,t,n){if(uD(e))return e;const r=vc(e.right.escapedText);return YT(r,t)?bw.createPropertyAccessExpression(cse(e.left,t,n),r):bw.createElementAccessExpression(cse(e.left,t,n),bw.createStringLiteral(r,0===n))}function lse(e){switch(e){case 0:case 3:case 2:return!0;default:return!1}}function _se(e,t,n){return"object"==typeof n?xT(n)+"n":tt(n)?TZ(e,t,n):JSON.stringify(n)}function use(e,t,n){return{name:_se(e,t,n),kind:"string",kindModifiers:"",sortText:Mae.LocationPriority,commitCharacters:[]}}function dse(e,t,n,r,i,o,a,s,c,l,_,u,d,p,f,m,g,h,y,v,k,S,T,C){var w,N;let D,F,E,P,A,I,O,L=VQ(n,o),j=bse(u);const M=c.getTypeChecker(),R=u&&function(e){return!!(16&e.kind)}(u),B=u&&function(e){return!!(2&e.kind)}(u)||_;if(u&&function(e){return!!(1&e.kind)}(u))D=_?`this${R?"?.":""}[${yse(a,y,l)}]`:`this${R?"?.":"."}${l}`;else if((B||R)&&p){D=B?_?`[${yse(a,y,l)}]`:`[${l}]`:l,(R||p.questionDotToken)&&(D=`?.${D}`);const e=GX(p,25,a)||GX(p,29,a);if(!e)return;const t=Qt(l,p.name.text)?p.name.end:e.end;L=Xs(e.getStart(a),t)}if(f&&(void 0===D&&(D=l),D=`{${D}}`,"boolean"!=typeof f&&(L=WQ(f,a))),u&&function(e){return!!(8&e.kind)}(u)&&p){void 0===D&&(D=l);const e=fQ(p.pos,a);let t="";e&&jZ(e.end,e.parent,a)&&(t=";"),t+=`(await ${p.expression.getText()})`,D=_?`${t}${D}`:`${t}${R?"?.":"."}${D}`;L=Xs((rt(p.parent,FF)?p.parent:p.expression).getStart(a),p.end)}if(Uae(u)&&(A=[KY(u.moduleSpecifier)],m&&(({insertText:D,replacementSpan:L}=function(e,t,n,r,i,o,a){const s=t.replacementSpan,c=VT(TZ(i,a,n.moduleSpecifier)),l=n.isDefaultExport?1:"export="===n.exportName?2:0,_=a.includeCompletionsWithSnippetText?"$1":"",u=U7.getImportKind(i,l,o,!0),d=t.couldBeTypeOnlyImportSpecifier,p=t.isTopLevelTypeOnly?` ${Ia(156)} `:" ",f=d?`${Ia(156)} `:"",m=r?";":"";switch(u){case 3:return{replacementSpan:s,insertText:`import${p}${VT(e)}${_} = require(${c})${m}`};case 1:return{replacementSpan:s,insertText:`import${p}${VT(e)}${_} from ${c}${m}`};case 2:return{replacementSpan:s,insertText:`import${p}* as ${VT(e)} from ${c}${m}`};case 0:return{replacementSpan:s,insertText:`import${p}{ ${f}${VT(e)}${_} } from ${c}${m}`}}}(l,m,u,g,a,c,y)),P=!!y.includeCompletionsWithSnippetText||void 0)),64===(null==u?void 0:u.kind)&&(I=!0),0===v&&r&&28!==(null==(w=fQ(r.pos,a,r))?void 0:w.kind)&&(OD(r.parent.parent)||MD(r.parent.parent)||RD(r.parent.parent)||_P(r.parent)||(null==(N=mc(r.parent,cP))?void 0:N.getLastToken(a))===r||lP(r.parent)&&Wa(a,r.getEnd()).line!==Wa(a,o).line)&&(j="ObjectLiteralMemberWithComma/",I=!0),y.includeCompletionsWithClassMemberSnippets&&y.includeCompletionsWithInsertText&&3===v&&function(e,t,n){if(Om(t))return!1;const r=106500;return!!(e.flags&r)&&(m_(t)||t.parent&&t.parent.parent&&f_(t.parent)&&t===t.parent.name&&t.parent.getLastToken(n)===t.parent.name&&m_(t.parent.parent)||t.parent&&nA(t)&&m_(t.parent))}(e,i,a)){let t;const n=pse(s,c,h,y,l,e,i,o,r,k);if(!n)return;({insertText:D,filterText:F,isSnippet:P,importAdder:t}=n),((null==t?void 0:t.hasFixes())||n.eraseRange)&&(I=!0,j="ClassMemberSnippet/")}if(u&&$ae(u)&&(({insertText:D,isSnippet:P,labelDetails:O}=u),y.useLabelDetailsInCompletionEntries||(l+=O.detail,O=void 0),j="ObjectLiteralMethodSnippet/",t=Mae.SortBelow(t)),S&&!T&&y.includeCompletionsWithSnippetText&&y.jsxAttributeCompletionStyle&&"none"!==y.jsxAttributeCompletionStyle&&(!ZE(i.parent)||!i.parent.initializer)){let t="braces"===y.jsxAttributeCompletionStyle;const n=M.getTypeOfSymbolAtLocation(e,i);"auto"!==y.jsxAttributeCompletionStyle||528&n.flags||1048576&n.flags&&x(n.types,e=>!!(528&e.flags))||(402653316&n.flags||1048576&n.flags&&b(n.types,e=>!!(402686084&e.flags||jQ(e)))?(D=`${VT(l)}=${TZ(a,y,"$1")}`,P=!0):t=!0),t&&(D=`${VT(l)}={$1}`,P=!0)}if(void 0!==D&&!y.includeCompletionsWithInsertText)return;(qae(u)||Uae(u))&&(E=gse(u),I=!m);const J=mc(i,Ex);if(J){const e=Sk(s.getCompilationSettings());if(vs(l,e)){if(276===J.kind){const e=Oa(l);e&&(135===e||Ih(e))&&(D=`${l} as ${l}_`)}}else D=yse(a,y,l),276===J.kind&&(rX.setText(a.text),rX.resetTokenState(o),130===rX.scan()&&80===rX.scan()||(D+=" as "+function(e,t){let n,r=!1,i="";for(let o=0;o=65536?2:1)n=e.codePointAt(o),void 0!==n&&(0===o?hs(n,t):ys(n,t))?(r&&(i+="_"),i+=String.fromCodePoint(n),r=!1):r=!0;r&&(i+="_");return i||"_"}(l,e)))}const z=Gue.getSymbolKind(M,e,i),q="warning"===z||"string"===z?[]:void 0;return{name:l,kind:z,kindModifiers:Gue.getSymbolModifiers(M,e),sortText:t,source:j,hasAction:!!I||void 0,isRecommended:vse(e,d,M)||void 0,insertText:D,filterText:F,replacementSpan:L,sourceDisplay:A,labelDetails:O,isSnippet:P,isPackageJsonImport:Vae(u)||void 0,isImportStatementCompletion:!!m||void 0,data:E,commitCharacters:q,...C?{symbol:e}:void 0}}function pse(e,t,n,r,i,o,a,s,c,l){const _=mc(a,m_);if(!_)return;let u,d=i;const p=i,f=t.getTypeChecker(),m=a.getSourceFile(),g=mse({removeComments:!0,module:n.module,moduleResolution:n.moduleResolution,target:n.target,omitTrailingSemicolon:!1,newLine:u0(tZ(e,null==l?void 0:l.options))}),h=U7.createImportAdder(m,t,r,e);let y;if(r.includeCompletionsWithSnippetText){u=!0;const e=bw.createEmptyStatement();y=bw.createBlock([e],!0),Zw(e,{kind:0,order:0})}else y=bw.createBlock([],!0);let v=0;const{modifiers:b,range:x,decorators:k}=function(e,t,n){if(!e||Wa(t,n).line>Wa(t,e.getEnd()).line)return{modifiers:0};let r,i,o=0;const a={pos:n,end:n};if(AD(e.parent)&&(i=function(e){if(r_(e))return e.kind;if(uD(e)){const t=xc(e);if(t&&e_(t))return t}return}(e))){e.parent.modifiers&&(o|=98303&Qv(e.parent.modifiers),r=e.parent.modifiers.filter(ED)||[],a.pos=Math.min(...e.parent.modifiers.map(e=>e.getStart(t))));const n=Yv(i);o&n||(o|=n,a.pos=Math.min(a.pos,e.getStart(t))),e.parent.name!==e&&(a.end=e.parent.name.getStart(t))}return{modifiers:o,decorators:r,range:a.pos{let t=0;S&&(t|=64),f_(e)&&1===f.getMemberOverrideModifierStatus(_,e,o)&&(t|=16),T.length||(v=e.modifierFlagsCache|t),e=bw.replaceModifiers(e,v),T.push(e)},y,U7.PreserveOptionalFlags.Property,!!S),T.length){const e=8192&o.flags;let t=17|v;t|=e?1024:136;const n=b&t;if(b&~t)return;if(4&v&&1&n&&(v&=-5),0===n||1&n||(v&=-2),v|=n,T=T.map(e=>bw.replaceModifiers(e,v)),null==k?void 0:k.length){const e=T[T.length-1];PI(e)&&(T[T.length-1]=bw.replaceDecoratorsAndModifiers(e,k.concat(Ac(e)||[])))}const r=131073;d=l?g.printAndFormatSnippetList(r,bw.createNodeArray(T),m,l):g.printSnippetList(r,bw.createNodeArray(T),m)}return{insertText:d,filterText:p,isSnippet:u,importAdder:h,eraseRange:x}}function fse(e,t,n,r,i,o,a,s){const c=a.includeCompletionsWithSnippetText||void 0;let l=t;const _=n.getSourceFile(),u=function(e,t,n,r,i,o){const a=e.getDeclarations();if(!a||!a.length)return;const s=r.getTypeChecker(),c=a[0],l=UC(Fc(c),!1),_=s.getWidenedType(s.getTypeOfSymbolAtLocation(e,t)),u=hY(n,o),d=33554432|(0===u?268435456:0);switch(c.kind){case 172:case 173:case 174:case 175:{let e=1048576&_.flags&&_.types.length<10?s.getUnionType(_.types,2):_;if(1048576&e.flags){const t=D(e.types,e=>s.getSignaturesOfType(e,0).length>0);if(1!==t.length)return;e=t[0]}if(1!==s.getSignaturesOfType(e,0).length)return;const n=s.typeToTypeNode(e,t,d,void 0,U7.getNoopSymbolTrackerWithResolver({program:r,host:i}));if(!n||!VD(n))return;let a;if(o.includeCompletionsWithSnippetText){const e=bw.createEmptyStatement();a=bw.createBlock([e],!0),Zw(e,{kind:0,order:0})}else a=bw.createBlock([],!0);const c=n.parameters.map(e=>bw.createParameterDeclaration(void 0,e.dotDotDotToken,e.name,void 0,void 0,e.initializer));return bw.createMethodDeclaration(void 0,void 0,l,void 0,void 0,c,void 0,a)}default:return}}(e,n,_,r,i,a);if(!u)return;const d=mse({removeComments:!0,module:o.module,moduleResolution:o.moduleResolution,target:o.target,omitTrailingSemicolon:!1,newLine:u0(tZ(i,null==s?void 0:s.options))});l=s?d.printAndFormatSnippetList(80,bw.createNodeArray([u],!0),_,s):d.printSnippetList(80,bw.createNodeArray([u],!0),_);const p=IU({removeComments:!0,module:o.module,moduleResolution:o.moduleResolution,target:o.target,omitTrailingSemicolon:!0}),f=bw.createMethodSignature(void 0,"",u.questionToken,u.typeParameters,u.parameters,u.type);return{isSnippet:c,insertText:l,labelDetails:{detail:p.printNode(4,f,_)}}}function mse(e){let t;const n=ide.createWriter(jb(e)),r=IU(e,n),i={...n,write:e=>o(e,()=>n.write(e)),nonEscapingWrite:n.write,writeLiteral:e=>o(e,()=>n.writeLiteral(e)),writeStringLiteral:e=>o(e,()=>n.writeStringLiteral(e)),writeSymbol:(e,t)=>o(e,()=>n.writeSymbol(e,t)),writeParameter:e=>o(e,()=>n.writeParameter(e)),writeComment:e=>o(e,()=>n.writeComment(e)),writeProperty:e=>o(e,()=>n.writeProperty(e))};return{printSnippetList:function(e,n,r){const i=a(e,n,r);return t?ide.applyChanges(i,t):i},printAndFormatSnippetList:function(e,n,r,i){const o={text:a(e,n,r),getLineAndCharacterOfPosition(e){return Wa(this,e)}},s=p0(i,r),c=L(n,e=>{const t=ide.assignPositionsToNode(e);return Ide.formatNodeGivenIndentation(t,o,r.languageVariant,0,0,{...i,options:s})}),l=t?de(G(c,t),(e,t)=>kt(e.span,t.span)):c;return ide.applyChanges(o.text,l)},printNode:function(e,n,r){const i=s(e,n,r);return t?ide.applyChanges(i,t):i},printAndFormatNode:function(e,n,r,i){const o={text:s(e,n,r),getLineAndCharacterOfPosition(e){return Wa(this,e)}},a=p0(i,r),c=ide.assignPositionsToNode(n),l=Ide.formatNodeGivenIndentation(c,o,r.languageVariant,0,0,{...i,options:a}),_=t?de(G(l,t),(e,t)=>kt(e.span,t.span)):l;return ide.applyChanges(o.text,_)}};function o(e,r){const i=VT(e);if(i!==e){const e=n.getTextPos();r();const o=n.getTextPos();t=ae(t||(t=[]),{newText:i,span:{start:e,length:o-e}})}else r()}function a(e,n,o){return t=void 0,i.clear(),r.writeList(e,n,o,i),i.getText()}function s(e,n,o){return t=void 0,i.clear(),r.writeNode(e,n,o,i),i.getText()}}function gse(e){const t=e.fileName?void 0:Iy(e.moduleSymbol.name),n=!!e.isFromPackageJson||void 0;if(Uae(e)){return{exportName:e.exportName,exportMapKey:e.exportMapKey,moduleSpecifier:e.moduleSpecifier,ambientModuleName:t,fileName:e.fileName,isPackageJsonImport:n}}return{exportName:e.exportName,exportMapKey:e.exportMapKey,fileName:e.fileName,ambientModuleName:e.fileName?void 0:Iy(e.moduleSymbol.name),isPackageJsonImport:!!e.isFromPackageJson||void 0}}function hse(e,t,n){const r="default"===e.exportName,i=!!e.isPackageJsonImport;if(Yae(e)){return{kind:32,exportName:e.exportName,exportMapKey:e.exportMapKey,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:n,isDefaultExport:r,isFromPackageJson:i}}return{kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:n,isDefaultExport:r,isFromPackageJson:i}}function yse(e,t,n){return/^\d+$/.test(n)?n:TZ(e,t,n)}function vse(e,t,n){return e===t||!!(1048576&e.flags)&&n.getExportSymbolOfSymbol(e)===t}function bse(e){return qae(e)?Iy(e.moduleSymbol.name):Uae(e)?e.moduleSpecifier:1===(null==e?void 0:e.kind)?"ThisProperty/":64===(null==e?void 0:e.kind)?"TypeOnlyAlias/":void 0}function xse(e,t,n,r,i,o,a,s,c,l,_,u,d,p,f,m,g,h,y,v,b,x,k,S,T,C=!1){const w=Wn(),N=function(e,t){if(!e)return;let n=mc(e,e=>Uf(e)||ece(e)||w_(e)?"quit":(FD(e)||DD(e))&&!zD(e.parent));n||(n=mc(t,e=>Uf(e)||ece(e)||w_(e)?"quit":fE(e)));return n}(r,i),D=MZ(a),F=c.getTypeChecker(),E=new Map;for(let _=0;_e.getSourceFile()===i.getSourceFile()));E.set(O,R),te(t,M,Qae,void 0,!0)}return _("getCompletionsAtPosition: getCompletionEntriesFromSymbols: "+(Wn()-w)),{has:e=>E.has(e),add:e=>E.set(e,!0)};function P(e,t){var n;let o=e.flags;if(i.parent&&ME(i.parent))return!0;if(N&&rt(N,fE)){if(e.valueDeclaration===N)return!1;if(w_(N.name)&&N.name.elements.some(t=>t===e.valueDeclaration))return!1}const s=e.valueDeclaration??(null==(n=e.declarations)?void 0:n[0]);if(N&&s)if(FD(N)&&FD(s)){const e=N.parent.parameters;if(s.pos>=N.pos&&s.pos=N.pos&&s.pos_se(n,a,e)===i.name);return void 0!==v?{type:"literal",literal:v}:m(l,(e,t)=>{const n=p[t],r=Ise(e,Sk(s),n,d,c.isJsxIdentifierExpected);return r&&r.name===i.name&&("ClassMemberSnippet/"===i.source&&106500&e.flags||"ObjectLiteralMethodSnippet/"===i.source&&8196&e.flags||bse(n)===i.source||"ObjectLiteralMemberWithComma/"===i.source)?{type:"symbol",symbol:e,location:u,origin:n,contextToken:f,previousToken:g,isJsxInitializer:h,isTypeOnlyLocation:y}:void 0})||{type:"none"}}function Sse(e,t,n,r,i,o,a,s,c){const l=e.getTypeChecker(),_=e.getCompilerOptions(),{name:u,source:d,data:p}=i,{previousToken:f,contextToken:m}=Pse(r,n);if(yQ(n,r,f))return ace.getStringLiteralCompletionDetails(u,n,r,f,e,o,c,s);const g=kse(e,t,n,r,i,o,s);switch(g.type){case"request":{const{request:e}=g;switch(e.kind){case 1:return $le.getJSDocTagNameCompletionDetails(u);case 2:return $le.getJSDocTagCompletionDetails(u);case 3:return $le.getJSDocParameterNameCompletionDetails(u);case 4:return H(e.keywordCompletions,e=>e.name===u)?Tse(u,"keyword",5):void 0;default:return pn.assertNever(e)}}case"symbol":{const{symbol:t,location:i,contextToken:f,origin:m,previousToken:h}=g,{codeActions:y,sourceDisplay:v}=function(e,t,n,r,i,o,a,s,c,l,_,u,d,p,f,m){if((null==p?void 0:p.moduleSpecifier)&&_&&Kse(n||_,c).replacementSpan)return{codeActions:void 0,sourceDisplay:[KY(p.moduleSpecifier)]};if("ClassMemberSnippet/"===f){const{importAdder:r,eraseRange:_}=pse(a,o,s,d,e,i,t,l,n,u);if((null==r?void 0:r.hasFixes())||_){return{sourceDisplay:void 0,codeActions:[{changes:ide.ChangeTracker.with({host:a,formatContext:u,preferences:d},e=>{r&&r.writeFixes(e),_&&e.deleteRange(c,_)}),description:(null==r?void 0:r.hasFixes())?d0([fa.Includes_imports_of_types_referenced_by_0,e]):d0([fa.Update_modifiers_of_0,e])}]}}}if(Wae(r)){const e=U7.getPromoteTypeOnlyCompletionAction(c,r.declaration.name,o,a,u,d);return pn.assertIsDefined(e,"Expected to have a code action for promoting type-only alias"),{codeActions:[e],sourceDisplay:void 0}}if("ObjectLiteralMemberWithComma/"===f&&n){const t=ide.ChangeTracker.with({host:a,formatContext:u,preferences:d},e=>e.insertText(c,n.end,","));if(t)return{sourceDisplay:void 0,codeActions:[{changes:t,description:d0([fa.Add_missing_comma_for_object_member_completion_0,e])}]}}if(!r||!qae(r)&&!Uae(r))return{codeActions:void 0,sourceDisplay:void 0};const g=r.isFromPackageJson?a.getPackageJsonAutoImportProvider().getTypeChecker():o.getTypeChecker(),{moduleSymbol:h}=r,y=g.getMergedSymbol(_x(i.exportSymbol||i,g)),v=30===(null==n?void 0:n.kind)&&Tu(n.parent),{moduleSpecifier:b,codeAction:x}=U7.getImportCompletionAction(y,h,null==p?void 0:p.exportMapKey,c,e,v,a,o,u,_&&uD(_)?_.getStart(c):l,d,m);return pn.assert(!(null==p?void 0:p.moduleSpecifier)||b===p.moduleSpecifier),{sourceDisplay:[KY(b)],codeActions:[x]}}(u,i,f,m,t,e,o,_,n,r,h,a,s,p,d,c);return Cse(t,Hae(m)?m.symbolName:t.name,l,n,i,c,y,v)}case"literal":{const{literal:e}=g;return Tse(_se(n,s,e),"string","string"==typeof e?8:7)}case"cases":{const t=ase(m.parent,n,s,e.getCompilerOptions(),o,e,void 0);if(null==t?void 0:t.importAdder.hasFixes()){const{entry:e,importAdder:n}=t,r=ide.ChangeTracker.with({host:o,formatContext:a,preferences:s},n.writeFixes);return{name:e.name,kind:"",kindModifiers:"",displayParts:[],sourceDisplay:void 0,codeActions:[{changes:r,description:d0([fa.Includes_imports_of_types_referenced_by_0,u])}]}}return{name:u,kind:"",kindModifiers:"",displayParts:[],sourceDisplay:void 0}}case"none":return Lse().some(e=>e.name===u)?Tse(u,"keyword",5):void 0;default:pn.assertNever(g)}}function Tse(e,t,n){return wse(e,"",t,[JY(e,n)])}function Cse(e,t,n,r,i,o,a,s){const{displayParts:c,documentation:l,symbolKind:_,tags:u}=n.runWithCancellationToken(o,t=>Gue.getSymbolDisplayPartsDocumentationAndSymbolKind(t,e,r,i,i,7));return wse(t,Gue.getSymbolModifiers(n,e),_,c,l,u,a,s)}function wse(e,t,n,r,i,o,a,s){return{name:e,kindModifiers:t,kind:n,displayParts:r,documentation:i,tags:o,codeActions:a,source:s,sourceDisplay:s}}function Nse(e,t,n,r,i,o,a){const s=kse(e,t,n,r,i,o,a);return"symbol"===s.type?s.symbol:void 0}var Dse=(e=>(e[e.ObjectPropertyDeclaration=0]="ObjectPropertyDeclaration",e[e.Global=1]="Global",e[e.PropertyAccess=2]="PropertyAccess",e[e.MemberLike=3]="MemberLike",e[e.String=4]="String",e[e.None=5]="None",e))(Dse||{});function Fse(e,t,n){const r=n.getAccessibleSymbolChain(e,t,-1,!1);return r?ye(r):e.parent&&(function(e){var t;return!!(null==(t=e.declarations)?void 0:t.some(e=>308===e.kind))}(e.parent)?e:Fse(e.parent,t,n))}function Ese(e,t,n,r,i,o,a,s,c,l){const _=e.getTypeChecker(),u=ose(n,r);let d=Wn(),f=lQ(n,i);t("getCompletionData: Get current token: "+(Wn()-d)),d=Wn();const g=DQ(n,i,f);t("getCompletionData: Is inside comment: "+(Wn()-d));let h=!1,y=!1,v=!1;if(g){if(FQ(n,i)){if(64===n.text.charCodeAt(i-1))return{kind:1};{const e=jX(i,n);if(!/[^*|\s(/)]/.test(n.text.substring(e,i)))return{kind:2}}}const e=function(e,t){return mc(e,e=>!(!Fu(e)||!RX(e,t))||!!DP(e)&&"quit")}(f,i);if(e){if(e.tagName.pos<=i&&i<=e.tagName.end)return{kind:1};if(tA(e))y=!0;else{const t=function(e){if(function(e){switch(e.kind){case 342:case 349:case 343:case 345:case 347:case 350:case 351:return!0;case 346:return!!e.constraint;default:return!1}}(e)){const t=KP(e)?e.constraint:e.typeExpression;return t&&310===t.kind?t:void 0}if(PP(e)||YP(e))return e.class;return}(e);if(t&&(f=lQ(n,i),f&&(ph(f)||349===f.parent.kind&&f.parent.name===f)||(h=he(t))),!h&&VP(e)&&(Pd(e.name)||e.name.pos<=i&&i<=e.name.end))return{kind:3,tag:e}}}if(!h&&!y)return void t("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.")}d=Wn();const b=!h&&!y&&Im(n),k=Pse(i,n),S=k.previousToken;let T=k.contextToken;t("getCompletionData: Get previous token: "+(Wn()-d));let C,w,N,F=f,E=!1,P=!1,A=!1,I=!1,O=!1,j=!1,M=sQ(n,i),R=0,B=!1,z=0;if(T){const e=Kse(T,n);if(e.keywordCompletion){if(e.isKeywordOnlyCompletion)return{kind:4,keywordCompletions:[(q=e.keywordCompletion,{name:Ia(q),kind:"keyword",kindModifiers:"",sortText:Mae.GlobalsOrKeywords})],isNewIdentifierLocation:e.isNewIdentifierLocation};R=function(e){if(156===e)return 8;pn.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters")}(e.keywordCompletion)}if(e.replacementSpan&&o.includeCompletionsForImportStatements&&o.includeCompletionsWithInsertText&&(z|=2,w=e,B=e.isNewIdentifierLocation),!e.replacementSpan&&function(e){const r=Wn(),o=function(e){return(XN(e)||Hl(e))&&(BX(e,i)||i===e.end&&(!!e.isUnterminated||XN(e)))}(e)||function(e){const t=e.parent,r=t.kind;switch(e.kind){case 28:return 261===r||262===(o=e).parent.kind&&!CQ(o,n,_)||244===r||267===r||pe(r)||265===r||208===r||266===r||m_(t)&&!!t.typeParameters&&t.typeParameters.end>=e.pos;case 25:case 23:return 208===r;case 59:return 209===r;case 21:return 300===r||pe(r);case 19:return 267===r;case 30:return 264===r||232===r||265===r||266===r||d_(r);case 126:return 173===r&&!m_(t.parent);case 26:return 170===r||!!t.parent&&208===t.parent.kind;case 125:case 123:case 124:return 170===r&&!jD(t.parent);case 130:return 277===r||282===r||275===r;case 139:case 153:return!$se(e);case 80:if((277===r||282===r)&&e===t.name&&"type"===e.text)return!1;if(mc(e.parent,fE)&&function(e,t){return n.getLineEndOfPosition(e.getEnd())S.end))}(e)||function(e){if(9===e.kind){const t=e.getFullText();return"."===t.charAt(t.length-1)}return!1}(e)||function(e){if(12===e.kind)return!0;if(32===e.kind&&e.parent){if(M===e.parent&&(287===M.kind||286===M.kind))return!1;if(287===e.parent.kind)return 287!==M.parent.kind;if(288===e.parent.kind||286===e.parent.kind)return!!e.parent.parent&&285===e.parent.parent.kind}return!1}(e)||HN(e);return t("getCompletionsAtPosition: isCompletionListBlocker: "+(Wn()-r)),o}(T))return t("Returning an empty list because completion was requested in an invalid position."),R?rse(R,b,_e().isNewIdentifierLocation):void 0;let r=T.parent;if(25===T.kind||29===T.kind)switch(E=25===T.kind,P=29===T.kind,r.kind){case 212:C=r,F=C.expression;if(Pd(Px(C))||(vF(F)||s_(F))&&F.end===T.pos&&F.getChildCount(n)&&22!==xe(F.getChildren(n)).kind)return;break;case 167:F=r.left;break;case 268:F=r.name;break;case 206:F=r;break;case 237:F=r.getFirstToken(n),pn.assert(102===F.kind||105===F.kind);break;default:return}else if(!w){if(r&&212===r.kind&&(T=r,r=r.parent),f.parent===M)switch(f.kind){case 32:285!==f.parent.kind&&287!==f.parent.kind||(M=f);break;case 31:286===f.parent.kind&&(M=f)}switch(r.kind){case 288:31===T.kind&&(I=!0,M=T);break;case 227:if(!Hse(r))break;case 286:case 285:case 287:j=!0,30===T.kind&&(A=!0,M=T);break;case 295:case 294:(20===S.kind||80===S.kind&&292===S.parent.kind)&&(j=!0);break;case 292:if(r.initializer===S&&S.end_Y(t?s.getPackageJsonAutoImportProvider():e,s));if(E||P)!function(){W=2;const e=gf(F),t=e&&!F.isTypeOf||Ef(F.parent)||CQ(T,n,_),r=sX(F);if(i_(F)||e||hF(F)){const n=xE(F.parent);n&&(B=!0,N=[]);let i=_.getSymbolAtLocation(F);if(i&&(i=_x(i,_),1920&i.flags)){const a=_.getExportsOfModule(i);pn.assertEachIsDefined(a,"getExportsOfModule() should all be defined");const s=t=>_.isValidPropertyAccess(e?F:F.parent,t.name),c=e=>tce(e,_),l=n?e=>{var t;return!!(1920&e.flags)&&!(null==(t=e.declarations)?void 0:t.every(e=>e.parent===F.parent))}:r?e=>c(e)||s(e):t||h?c:s;for(const e of a)l(e)&&K.push(e);if(!t&&!h&&i.declarations&&i.declarations.some(e=>308!==e.kind&&268!==e.kind&&267!==e.kind)){let e=_.getTypeOfSymbolAtLocation(i,F).getNonOptionalType(),t=!1;if(e.isNullableType()){const n=E&&!P&&!1!==o.includeAutomaticOptionalChainCompletions;(n||P)&&(e=e.getNonNullableType(),n&&(t=!0))}oe(e,!!(65536&F.flags),t)}return}}if(!t||fv(F)){_.tryGetThisTypeAt(F,!1);let e=_.getTypeAtLocation(F).getNonOptionalType();if(t)oe(e.getNonNullableType(),!1,!1);else{let t=!1;if(e.isNullableType()){const n=E&&!P&&!1!==o.includeAutomaticOptionalChainCompletions;(n||P)&&(e=e.getNonNullableType(),n&&(t=!0))}oe(e,!!(65536&F.flags),t)}}}();else if(A)K=_.getJsxIntrinsicTagNamesAt(M),pn.assertEachIsDefined(K,"getJsxIntrinsicTagNames() should all be defined"),ce(),W=1,R=0;else if(I){const e=T.parent.parent.openingElement.tagName,t=_.getSymbolAtLocation(e);t&&(K=[t]),W=1,R=0}else if(!ce())return R?rse(R,b,B):void 0;t("getCompletionData: Semantic work: "+(Wn()-U));const ne=S&&function(e,t,n,r){const{parent:i}=e;switch(e.kind){case 80:return SZ(e,r);case 64:switch(i.kind){case 261:return r.getContextualType(i.initializer);case 227:return r.getTypeAtLocation(i.left);case 292:return r.getContextualTypeForJsxAttribute(i);default:return}case 105:return r.getContextualType(i);case 84:const o=rt(i,iP);return o?DZ(o,r):void 0;case 19:return!nP(i)||$E(i.parent)||XE(i.parent)?void 0:r.getContextualTypeForJsxAttribute(i.parent);default:const a=due.getArgumentInfoForCompletions(e,t,n,r);return a?r.getContextualTypeForArgumentAtIndex(a.invocation,a.argumentIndex):CZ(e.kind)&&AF(i)&&CZ(i.operatorToken.kind)?r.getTypeAtLocation(i.left):r.getContextualType(e,4)||r.getContextualType(e)}}(S,i,n,_),re=!rt(S,Ju)&&!j?J(ne&&(ne.isUnion()?ne.types:[ne]),e=>!e.isLiteral()||1024&e.flags?void 0:e.value):[],ie=S&&ne&&function(e,t,n){return m(t&&(t.isUnion()?t.types:[t]),t=>{const r=t&&t.symbol;return r&&424&r.flags&&!vx(r)?Fse(r,e,n):void 0})}(S,ne,_);return{kind:0,symbols:K,completionKind:W,isInSnippetScope:v,propertyAccessToConvert:C,isNewIdentifierLocation:B,location:M,keywordFilters:R,literals:re,symbolToOriginInfoMap:X,recommendedCompletion:ie,previousToken:S,contextToken:T,isJsxInitializer:O,insideJsDocTagTypeExpression:h,symbolToSortTextMap:Q,isTypeOnlyLocation:Z,isJsxIdentifierExpected:j,isRightOfOpenTag:A,isRightOfDotOrQuestionDot:E||P,importStatementCompletion:w,hasUnresolvedAutoImports:$,flags:z,defaultCommitCharacters:N};function oe(e,t,n){e.getStringIndexType()&&(B=!0,N=[]),P&&H(e.getCallSignatures())&&(B=!0,N??(N=Rae));const r=206===F.kind?F:F.parent;if(u)for(const t of e.getApparentProperties())_.isValidPropertyAccessForCompletions(r,e,t)&&ae(t,!1,n);else K.push(...D(Vse(e,_),t=>_.isValidPropertyAccessForCompletions(r,e,t)));if(t&&o.includeCompletionsWithInsertText){const t=_.getPromisedTypeOfPromise(e);if(t)for(const e of t.getApparentProperties())_.isValidPropertyAccessForCompletions(r,t,e)&&ae(e,!0,n)}}function ae(t,r,a){var c;const l=m(t.declarations,e=>rt(Fc(e),ND));if(l){const r=se(l.expression),a=r&&_.getSymbolAtLocation(r),f=a&&Fse(a,T,_),m=f&&uJ(f);if(m&&Cx(Y,m)){const t=K.length;K.push(f),Q[uJ(f)]=Mae.GlobalsOrKeywords;const r=f.parent;if(r&&td(r)&&_.tryGetMemberInModuleExportsAndProperties(f.name,r)===f){const a=Fs(Iy(r.name))?null==(c=Td(r))?void 0:c.fileName:void 0,{moduleSpecifier:l}=(V||(V=U7.createImportSpecifierResolver(n,e,s,o))).getModuleSpecifierForBestExportInfo([{exportKind:0,moduleFileName:a,isFromPackageJson:!1,moduleSymbol:r,symbol:f,targetFlags:_x(f,_).flags}],i,CT(M))||{};if(l){const e={kind:p(6),moduleSymbol:r,isDefaultExport:!1,symbolName:f.name,exportName:f.name,fileName:a,moduleSpecifier:l};X[t]=e}}else X[t]={kind:p(2)}}else if(o.includeCompletionsWithInsertText){if(m&&Y.has(m))return;d(t),u(t),K.push(t)}}else d(t),u(t),K.push(t);function u(e){(function(e){return!!(e.valueDeclaration&&256&Vv(e.valueDeclaration)&&m_(e.valueDeclaration.parent))})(e)&&(Q[uJ(e)]=Mae.LocalDeclarationPriority)}function d(e){o.includeCompletionsWithInsertText&&(r&&Cx(Y,uJ(e))?X[K.length]={kind:p(8)}:a&&(X[K.length]={kind:16}))}function p(e){return a?16|e:e}}function se(e){return uD(e)?e:hF(e)?se(e.expression):void 0}function ce(){const t=function(){const e=function(e){if(!e)return;const t=e.parent;switch(e.kind){case 19:if(HD(t))return t;break;case 27:case 28:case 80:if(172===t.kind&&HD(t.parent))return t.parent}return}(T);if(!e)return 0;const t=(eF(e.parent)?e.parent:void 0)||e,n=Wse(t,_);if(!n)return 0;const r=_.getTypeFromTypeNode(t),i=Vse(n,_),o=Vse(r,_),a=new Set;return o.forEach(e=>a.add(e.escapedName)),K=G(K,D(i,e=>!a.has(e.escapedName))),W=0,B=!0,1}()||function(){if(26===(null==T?void 0:T.kind))return 0;const t=K.length,a=function(e,t,n){var r;if(e){const{parent:i}=e;switch(e.kind){case 19:case 28:if(gF(i)||dF(i))return i;break;case 42:return OD(i)?rt(i.parent,gF):void 0;case 134:return rt(i.parent,gF);case 80:if("async"===e.text&&lP(e.parent))return e.parent.parent;{if(gF(e.parent.parent)&&(_P(e.parent)||lP(e.parent)&&Wa(n,e.getEnd()).line!==Wa(n,t).line))return e.parent.parent;const r=mc(i,cP);if((null==r?void 0:r.getLastToken(n))===e&&gF(r.parent))return r.parent}break;default:if((null==(r=i.parent)?void 0:r.parent)&&(OD(i.parent)||MD(i.parent)||RD(i.parent))&&gF(i.parent.parent))return i.parent.parent;if(_P(i)&&gF(i.parent))return i.parent;const o=mc(i,cP);if(59!==e.kind&&(null==o?void 0:o.getLastToken(n))===e&&gF(o.parent))return o.parent}}return}(T,i,n);if(!a)return 0;let l,u;if(W=0,211===a.kind){const e=function(e,t){const n=t.getContextualType(e);if(n)return n;const r=sh(e.parent);if(AF(r)&&64===r.operatorToken.kind&&e===r.left)return t.getTypeAtLocation(r);if(K_(r))return t.getContextualType(r);return}(a,_);if(void 0===e)return 67108864&a.flags?2:0;const t=_.getContextualType(a,4),n=(t||e).getStringIndexType(),r=(t||e).getNumberIndexType();if(B=!!n||!!r,l=qse(e,t,a,_),u=a.properties,0===l.length&&!r)return 0}else{pn.assert(207===a.kind),B=!1;const e=ny(a.parent);if(!jf(e))return pn.fail("Root declaration is not variable-like.");let t=Ou(e)||!!yv(e)||251===e.parent.parent.kind;if(t||170!==e.kind||(K_(e.parent)?t=!!_.getContextualType(e.parent):175!==e.parent.kind&&179!==e.parent.kind||(t=K_(e.parent.parent)&&!!_.getContextualType(e.parent.parent))),t){const e=_.getTypeAtLocation(a);if(!e)return 2;l=_.getPropertiesOfType(e).filter(t=>_.isPropertyAccessible(a,!1,!1,e,t)),u=a.elements}}if(l&&l.length>0){const n=function(e,t){if(0===t.length)return e;const n=new Set,r=new Set;for(const e of t){if(304!==e.kind&&305!==e.kind&&209!==e.kind&&175!==e.kind&&178!==e.kind&&179!==e.kind&&306!==e.kind)continue;if(he(e))continue;let t;if(_P(e))fe(e,n);else if(fF(e)&&e.propertyName)80===e.propertyName.kind&&(t=e.propertyName.escapedText);else{const n=Fc(e);t=n&&Wh(n)?Hh(n):void 0}void 0!==t&&r.add(t)}const i=e.filter(e=>!r.has(e.escapedName));return ge(n,i),i}(l,pn.checkDefined(u));K=G(K,n),me(),211===a.kind&&o.includeCompletionsWithObjectLiteralMethodSnippets&&o.includeCompletionsWithInsertText&&(function(e){for(let t=e;t{if(!function(e){if(!(8196&e.flags))return!1;return!0}(t))return;const i=Ise(t,Sk(r),void 0,0,!1);if(!i)return;const{name:a}=i,l=fse(t,a,n,e,s,r,o,c);if(!l)return;const _={kind:128,...l};z|=32,X[K.length]=_,K.push(t)})}(n,a))}return 1}()||(w?(B=!0,le(),1):0)||function(){if(!T)return 0;const e=19===T.kind||28===T.kind?rt(T.parent,Ex):tY(T)?rt(T.parent.parent,Ex):void 0;if(!e)return 0;tY(T)||(R=8);const{moduleSpecifier:t}=276===e.kind?e.parent.parent:e.parent;if(!t)return B=!0,276===e.kind?2:0;const n=_.getSymbolAtLocation(t);if(!n)return B=!0,2;W=3,B=!1;const r=_.getExportsAndPropertiesOfModule(n),i=new Set(e.elements.filter(e=>!he(e)).map(e=>Qd(e.propertyName||e.name))),o=r.filter(e=>"default"!==e.escapedName&&!i.has(e.escapedName));K=G(K,o),o.length||(R=0);return 1}()||function(){if(void 0===T)return 0;const e=19===T.kind||28===T.kind?rt(T.parent,PE):59===T.kind?rt(T.parent.parent,PE):void 0;if(void 0===e)return 0;const t=new Set(e.elements.map(yC));return K=D(_.getTypeAtLocation(e).getApparentProperties(),e=>!t.has(e.escapedName)),1}()||function(){var e;const t=!T||19!==T.kind&&28!==T.kind?void 0:rt(T.parent,BE);if(!t)return 0;const n=mc(t,nn(dP,xE));return W=5,B=!1,null==(e=n.locals)||e.forEach((e,t)=>{var r,i;K.push(e),(null==(i=null==(r=n.symbol)?void 0:r.exports)?void 0:i.has(t))&&(Q[uJ(e)]=Mae.OptionalMember)}),1}()||(function(e){if(e){const t=e.parent;switch(e.kind){case 21:case 28:return jD(e.parent)?e.parent:void 0;default:if(ue(e))return t.parent}}}(T)?(W=5,B=!0,R=4,1):0)||function(){const e=function(e,t,n,r){switch(n.kind){case 353:return rt(n.parent,wx);case 1:const t=rt(be(it(n.parent,dP).statements),wx);if(t&&!GX(t,20,e))return t;break;case 81:if(rt(n.parent,AD))return mc(n,m_);break;case 80:if(xc(n))return;if(AD(n.parent)&&n.parent.initializer===n)return;if($se(n))return mc(n,wx)}if(!t)return;if(137===n.kind||uD(t)&&AD(t.parent)&&m_(n))return mc(t,m_);switch(t.kind){case 64:return;case 27:case 20:return $se(n)&&n.parent.name===n?n.parent.parent:rt(n,wx);case 19:case 28:return rt(t.parent,wx);default:if(wx(n)){if(Wa(e,t.getEnd()).line!==Wa(e,r).line)return n;const i=m_(t.parent.parent)?Bse:Rse;return i(t.kind)||42===t.kind||uD(t)&&i(xc(t)??0)?t.parent.parent:void 0}return}}(n,T,M,i);if(!e)return 0;if(W=3,B=!0,R=42===T.kind?0:m_(e)?2:3,!m_(e))return 1;const t=27===T.kind?T.parent.parent:T.parent;let r=f_(t)?Vv(t):0;if(80===T.kind&&!he(T))switch(T.getText()){case"private":r|=2;break;case"static":r|=256;break;case"override":r|=16}LD(t)&&(r|=256);if(!(2&r)){const t=L(m_(e)&&16&r?an(kh(e)):Ch(e),t=>{const n=_.getTypeAtLocation(t);return 256&r?(null==n?void 0:n.symbol)&&_.getPropertiesOfType(_.getTypeOfSymbolAtLocation(n.symbol,e)):n&&_.getPropertiesOfType(n)});K=G(K,function(e,t,n){const r=new Set;for(const e of t){if(173!==e.kind&&175!==e.kind&&178!==e.kind&&179!==e.kind)continue;if(he(e))continue;if(Pv(e,2))continue;if(Iv(e)!==!!(256&n))continue;const t=Vh(e.name);t&&r.add(t)}return e.filter(e=>!(r.has(e.escapedName)||!e.declarations||2&lx(e)||e.valueDeclaration&&Yl(e.valueDeclaration)))}(t,e.members,r)),p(K,(e,t)=>{const n=null==e?void 0:e.valueDeclaration;if(n&&f_(n)&&n.name&&ND(n.name)){const n={kind:512,symbolName:_.symbolToString(e)};X[t]=n}})}return 1}()||function(){const e=function(e){if(e){const t=e.parent;switch(e.kind){case 32:case 31:case 44:case 80:case 212:case 293:case 292:case 294:if(t&&(286===t.kind||287===t.kind)){if(32===e.kind){const r=fQ(e.pos,n,void 0);if(!t.typeArguments||r&&44===r.kind)break}return t}if(292===t.kind)return t.parent.parent;break;case 11:if(t&&(292===t.kind||294===t.kind))return t.parent.parent;break;case 20:if(t&&295===t.kind&&t.parent&&292===t.parent.kind)return t.parent.parent.parent;if(t&&294===t.kind)return t.parent.parent}}return}(T),t=e&&_.getContextualType(e.attributes);if(!t)return 0;const r=e&&_.getContextualType(e.attributes,4);return K=G(K,function(e,t){const n=new Set,r=new Set;for(const e of t)he(e)||(292===e.kind?n.add(aC(e.name)):tP(e)&&fe(e,r));const i=e.filter(e=>!n.has(e.escapedName));return ge(r,i),i}(qse(t,r,e.attributes,_),e.attributes.properties)),me(),W=3,B=!1,1}()||(function(){R=function(e){if(e){let t;const n=mc(e.parent,e=>m_(e)?"quit":!(!l_(e)||t!==e.body)||(t=e,!1));return n&&n}}(T)?5:1,W=1,({isNewIdentifierLocation:B,defaultCommitCharacters:N}=_e()),S!==T&&pn.assert(!!S,"Expected 'contextToken' to be defined when different from 'previousToken'.");const e=S!==T?S.getStart():i,t=function(e,t,n){let r=e;for(;r&&!VX(r,t,n);)r=r.parent;return r}(T,e,n)||n;v=function(e){switch(e.kind){case 308:case 229:case 295:case 242:return!0;default:return hu(e)}}(t);const r=2887656|(Z?0:111551),a=S&&!CT(S);K=G(K,_.getSymbolsInScope(t,r)),pn.assertEachIsDefined(K,"getSymbolsInScope() should all be defined");for(let e=0;ee.getSourceFile()===n)||(Q[uJ(t)]=Mae.GlobalsOrKeywords),a&&!(111551&t.flags)){const n=t.declarations&&x(t.declarations,Ul);if(n){const t={kind:64,declaration:n};X[e]=t}}}if(o.includeCompletionsWithInsertText&&308!==t.kind){const e=_.tryGetThisTypeAt(t,!1,m_(t.parent)?t:void 0);if(e&&!function(e,t,n){const r=n.resolveName("self",void 0,111551,!1);if(r&&n.getTypeOfSymbolAtLocation(r,t)===e)return!0;const i=n.resolveName("global",void 0,111551,!1);if(i&&n.getTypeOfSymbolAtLocation(i,t)===e)return!0;const o=n.resolveName("globalThis",void 0,111551,!1);if(o&&n.getTypeOfSymbolAtLocation(o,t)===e)return!0;return!1}(e,n,_))for(const t of Vse(e,_))X[K.length]={kind:1},K.push(t),Q[uJ(t)]=Mae.SuggestedClassMembers}le(),Z&&(R=T&&G_(T.parent)?6:7)}(),1);return 1===t}function le(){var t,r;if(!function(){var t;return!!w||!!o.includeCompletionsForModuleExports&&(!(!n.externalModuleIndicator&&!n.commonJsModuleIndicator)||!!lY(e.getCompilerOptions())||(null==(t=e.getSymlinkCache)?void 0:t.call(e).hasAnySymlinks())||!!e.getCompilerOptions().paths||sY(e))}())return;if(pn.assert(!(null==a?void 0:a.data),"Should not run 'collectAutoImports' when faster path is available via `data`"),a&&!a.source)return;z|=1;const c=S===T&&w?"":S&&uD(S)?S.text.toLowerCase():"",_=null==(t=s.getModuleSpecifierCache)?void 0:t.call(s),u=E0(n,s,e,o,l),d=null==(r=s.getPackageJsonAutoImportProvider)?void 0:r.call(s),p=a?void 0:HZ(n,o,s);function f(t){return S0(t.isFromPackageJson?d:e,n,rt(t.moduleSymbol.valueDeclaration,dP),t.moduleSymbol,o,p,te(t.isFromPackageJson),_)}Kae("collectAutoImports",s,V||(V=U7.createImportSpecifierResolver(n,e,s,o)),e,i,o,!!w,CT(M),e=>{u.search(n.path,A,(e,t)=>{if(!vs(e,Sk(s.getCompilationSettings())))return!1;if(!a&&Oh(e))return!1;if(!(Z||w||111551&t))return!1;if(Z&&!(790504&t))return!1;const n=e.charCodeAt(0);return(!A||!(n<65||n>90))&&(!!a||rce(e,c))},(t,n,r,i)=>{if(a&&!H(t,e=>a.source===Iy(e.moduleSymbol.name)))return;if(!(t=D(t,f)).length)return;const o=e.tryResolve(t,r)||{};if("failed"===o)return;let s,c=t[0];"skipped"!==o&&({exportInfo:c=t[0],moduleSpecifier:s}=o);const l=1===c.exportKind;!function(e,t){const n=uJ(e);if(Q[n]===Mae.GlobalsOrKeywords)return;X[K.length]=t,Q[n]=w?Mae.LocationPriority:Mae.AutoImportSuggestions,K.push(e)}(l&&Tb(pn.checkDefined(c.symbol))||pn.checkDefined(c.symbol),{kind:s?32:4,moduleSpecifier:s,symbolName:n,exportMapKey:i,exportName:2===c.exportKind?"export=":pn.checkDefined(c.symbol).name,fileName:c.moduleFileName,isDefaultExport:l,moduleSymbol:c.moduleSymbol,isFromPackageJson:c.isFromPackageJson})}),$=e.skippedAny(),z|=e.resolvedAny()?8:0,z|=e.resolvedBeyondLimit()?16:0})}function _e(){if(T){const e=T.parent.kind,t=zse(T);switch(t){case 28:switch(e){case 214:case 215:{const e=T.parent.expression;return Wa(n,e.end).line!==Wa(n,i).line?{defaultCommitCharacters:Bae,isNewIdentifierLocation:!0}:{defaultCommitCharacters:Rae,isNewIdentifierLocation:!0}}case 227:return{defaultCommitCharacters:Bae,isNewIdentifierLocation:!0};case 177:case 185:case 211:return{defaultCommitCharacters:[],isNewIdentifierLocation:!0};case 210:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!0};default:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1}}case 21:switch(e){case 214:case 215:{const e=T.parent.expression;return Wa(n,e.end).line!==Wa(n,i).line?{defaultCommitCharacters:Bae,isNewIdentifierLocation:!0}:{defaultCommitCharacters:Rae,isNewIdentifierLocation:!0}}case 218:return{defaultCommitCharacters:Bae,isNewIdentifierLocation:!0};case 177:case 197:return{defaultCommitCharacters:[],isNewIdentifierLocation:!0};default:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1}}case 23:switch(e){case 210:case 182:case 190:case 168:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!0};default:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1}}case 144:case 145:case 102:return{defaultCommitCharacters:[],isNewIdentifierLocation:!0};case 25:return 268===e?{defaultCommitCharacters:[],isNewIdentifierLocation:!0}:{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1};case 19:switch(e){case 264:case 211:return{defaultCommitCharacters:[],isNewIdentifierLocation:!0};default:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1}}case 64:switch(e){case 261:case 227:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!0};default:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1}}case 16:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:229===e};case 17:return{defaultCommitCharacters:Rae,isNewIdentifierLocation:240===e};case 134:return 175===e||305===e?{defaultCommitCharacters:[],isNewIdentifierLocation:!0}:{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1};case 42:return 175===e?{defaultCommitCharacters:[],isNewIdentifierLocation:!0}:{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1}}if(Bse(t))return{defaultCommitCharacters:[],isNewIdentifierLocation:!0}}return{defaultCommitCharacters:Rae,isNewIdentifierLocation:!1}}function ue(e){return!!e.parent&&FD(e.parent)&&jD(e.parent.parent)&&(t_(e.kind)||ph(e))}function de(e,t){return 64!==e.kind&&(27===e.kind||!Qb(e.end,t,n))}function pe(e){return d_(e)&&177!==e}function fe(e,t){const n=e.expression,r=_.getSymbolAtLocation(n),i=r&&_.getTypeOfSymbolAtLocation(r,n),o=i&&i.properties;o&&o.forEach(e=>{t.add(e.name)})}function me(){K.forEach(e=>{if(16777216&e.flags){const t=uJ(e);Q[t]=Q[t]??Mae.OptionalMember}})}function ge(e,t){if(0!==e.size)for(const n of t)e.has(n.name)&&(Q[uJ(n)]=Mae.MemberDeclaredBySpreadAssignment)}function he(e){return e.getStart(n)<=i&&i<=e.getEnd()}}function Pse(e,t){const n=fQ(e,t);if(n&&e<=n.end&&(gl(n)||Fh(n.kind))){return{contextToken:fQ(n.getFullStart(),t,void 0),previousToken:n}}return{contextToken:n,previousToken:n}}function Ase(e,t,n,r){const i=t.isPackageJsonImport?r.getPackageJsonAutoImportProvider():n,o=i.getTypeChecker(),a=t.ambientModuleName?o.tryFindAmbientModule(t.ambientModuleName):t.fileName?o.getMergedSymbol(pn.checkDefined(i.getSourceFile(t.fileName)).symbol):void 0;if(!a)return;let s="export="===t.exportName?o.resolveExternalModuleSymbol(a):o.tryGetMemberInModuleExportsAndProperties(t.exportName,a);if(!s)return;return s="default"===t.exportName&&Tb(s)||s,{symbol:s,origin:hse(t,e,a)}}function Ise(e,t,n,r,i){if(function(e){return!!(e&&256&e.kind)}(n))return;const o=function(e){return qae(e)||Uae(e)||Hae(e)}(n)?n.symbolName:e.name;if(void 0===o||1536&e.flags&&Wm(o.charCodeAt(0))||Gh(e))return;const a={name:o,needsConvertPropertyAccess:!1};if(vs(o,t,i?1:0)||e.valueDeclaration&&Yl(e.valueDeclaration))return a;if(2097152&e.flags)return{name:o,needsConvertPropertyAccess:!0};switch(r){case 3:return Hae(n)?{name:n.symbolName,needsConvertPropertyAccess:!1}:void 0;case 0:return{name:JSON.stringify(o),needsConvertPropertyAccess:!1};case 2:case 1:return 32===o.charCodeAt(0)?void 0:{name:o,needsConvertPropertyAccess:!0};case 5:case 4:return a;default:pn.assertNever(r)}}var Ose=[],Lse=ft(()=>{const e=[];for(let t=83;t<=166;t++)e.push({name:Ia(t),kind:"keyword",kindModifiers:"",sortText:Mae.GlobalsOrKeywords});return e});function jse(e,t){if(!t)return Mse(e);const n=e+8+1;return Ose[n]||(Ose[n]=Mse(e).filter(e=>!function(e){switch(e){case 128:case 133:case 163:case 136:case 138:case 94:case 162:case 119:case 140:case 120:case 142:case 143:case 144:case 145:case 146:case 150:case 151:case 164:case 123:case 124:case 125:case 148:case 154:case 155:case 156:case 158:case 159:return!0;default:return!1}}(Oa(e.name))))}function Mse(e){return Ose[e]||(Ose[e]=Lse().filter(t=>{const n=Oa(t.name);switch(e){case 0:return!1;case 1:return Jse(n)||138===n||144===n||156===n||145===n||128===n||ZQ(n)&&157!==n;case 5:return Jse(n);case 2:return Bse(n);case 3:return Rse(n);case 4:return t_(n);case 6:return ZQ(n)||87===n;case 7:return ZQ(n);case 8:return 156===n;default:return pn.assertNever(e)}}))}function Rse(e){return 148===e}function Bse(e){switch(e){case 128:case 129:case 137:case 139:case 153:case 134:case 138:case 164:return!0;default:return n_(e)}}function Jse(e){return 134===e||135===e||160===e||130===e||152===e||156===e||!Ah(e)&&!Bse(e)}function zse(e){return uD(e)?xc(e)??0:e.kind}function qse(e,t,n,r){const i=t&&t!==e,o=r.getUnionType(D(1048576&e.flags?e.types:[e],e=>!r.getPromisedTypeOfPromise(e))),a=!i||3&t.flags?o:r.getUnionType([o,t]),s=function(e,t,n){return e.isUnion()?n.getAllPossiblePropertiesOfTypes(D(e.types,e=>!(402784252&e.flags||n.isArrayLikeType(e)||n.isTypeInvalidDueToUnionDiscriminant(e,t)||n.typeHasCallOrConstructSignatures(e)||e.isClass()&&Use(e.getApparentProperties())))):e.getApparentProperties()}(a,n,r);return a.isClass()&&Use(s)?[]:i?D(s,function(e){return!d(e.declarations)||H(e.declarations,e=>e.parent!==n)}):s}function Use(e){return H(e,e=>!!(6&lx(e)))}function Vse(e,t){return e.isUnion()?pn.checkEachDefined(t.getAllPossiblePropertiesOfTypes(e.types),"getAllPossiblePropertiesOfTypes() should all be defined"):pn.checkEachDefined(e.getApparentProperties(),"getApparentProperties() should all be defined")}function Wse(e,t){if(!e)return;if(T_(e)&&Mu(e.parent))return t.getTypeArgumentConstraint(e);const n=Wse(e.parent,t);if(n)switch(e.kind){case 172:return t.getTypeOfPropertyOfContextualType(n,e.symbol.escapedName);case 194:case 188:case 193:return n}}function $se(e){return e.parent&&k_(e.parent)&&wx(e.parent.parent)}function Hse({left:e}){return Pd(e)}function Kse(e,t){var n,r,i;let o,a=!1;const s=function(){const n=e.parent;if(CE(n)){const r=n.getLastToken(t);return uD(e)&&r!==e?(o=161,void(a=!0)):(o=156===e.kind?void 0:156,Zse(n.moduleReference)?n:void 0)}if(Qse(n,e)&&Yse(n.parent))return n;if(LE(n)||IE(n)){if(n.parent.isTypeOnly||19!==e.kind&&102!==e.kind&&28!==e.kind||(o=156),Yse(n)){if(20!==e.kind&&80!==e.kind)return n.parent.parent;a=!0,o=161}return}if(RE(n)&&42===e.kind||BE(n)&&20===e.kind)return a=!0,void(o=161);if(TD(e)&&dP(n))return o=156,e;if(TD(e)&&wE(n))return o=156,Zse(n.moduleSpecifier)?n:void 0;return}();return{isKeywordOnlyCompletion:a,keywordCompletion:o,isNewIdentifierLocation:!(!s&&156!==o),isTopLevelTypeOnly:!!(null==(r=null==(n=rt(s,wE))?void 0:n.importClause)?void 0:r.isTypeOnly)||!!(null==(i=rt(s,CE))?void 0:i.isTypeOnly),couldBeTypeOnlyImportSpecifier:!!s&&Qse(s,e),replacementSpan:Gse(s)}}function Gse(e){var t;if(!e)return;const n=mc(e,nn(wE,CE,tA))??e,r=n.getSourceFile();if(Ub(n,r))return WQ(n,r);pn.assert(102!==n.kind&&277!==n.kind);const i=273===n.kind||352===n.kind?Xse(null==(t=n.importClause)?void 0:t.namedBindings)??n.moduleSpecifier:n.moduleReference,o={pos:n.getFirstToken().getStart(),end:i.pos};return Ub(o,r)?KQ(o):void 0}function Xse(e){var t;return x(null==(t=rt(e,LE))?void 0:t.elements,t=>{var n;return!t.propertyName&&Oh(t.name.text)&&28!==(null==(n=fQ(t.name.pos,e.getSourceFile(),e))?void 0:n.kind)})}function Qse(e,t){return jE(e)&&(e.isTypeOnly||t===e.name&&tY(t))}function Yse(e){if(!Zse(e.parent.parent.moduleSpecifier)||e.parent.name)return!1;if(LE(e)){const t=Xse(e);return(t?e.elements.indexOf(t):e.elements.length)<2}return!0}function Zse(e){var t;return!!Pd(e)||!(null==(t=rt(WE(e)?e.expression:e,Ju))?void 0:t.text)}function ece(e){return e.parent&&CF(e.parent)&&(e.parent.body===e||39===e.kind)}function tce(e,t,n=new Set){return r(e)||r(_x(e.exportSymbol||e,t));function r(e){return!!(788968&e.flags)||t.isUnknownSymbol(e)||!!(1536&e.flags)&&Cx(n,e)&&t.getExportsOfModule(e).some(e=>tce(e,t,n))}}function nce(e,t){const n=_x(e,t).declarations;return!!d(n)&&b(n,l0)}function rce(e,t){if(0===t.length)return!0;let n,r=!1,i=0;const o=e.length;for(let a=0;a_ce,getStringLiteralCompletions:()=>lce});var sce={directory:0,script:1,"external module name":2};function cce(){const e=new Map;return{add:function(t){const n=e.get(t.name);(!n||sce[n.kind]t>=e.pos&&t<=e.end);if(!c)return;const l=e.text.slice(c.pos,t),_=Ice.exec(l);if(!_)return;const[,u,d,p]=_,f=Ao(e.path),m="path"===d?Sce(p,f,xce(o,0,e),n,r,i,!0,e.path):"types"===d?Ace(n,r,i,f,Dce(p),xce(o,1,e)):pn.fail();return vce(p,c.pos+u.length,je(m.values()))}(e,t,o,i,_Y(o,i));return n&&uce(n)}if(yQ(e,t,n)){if(!n||!Ju(n))return;return function(e,t,n,r,i,o,a,s,c,l){if(void 0===e)return;const _=$Q(t,c);switch(e.kind){case 0:return uce(e.paths);case 1:{const u=[];return xse(e.symbols,u,t,t,n,c,n,r,i,99,o,4,s,a,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,l),{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:e.hasIndexSignature,optionalReplacementSpan:_,entries:u,defaultCommitCharacters:Gae(e.hasIndexSignature)}}case 2:{const n=15===t.kind?96:Qt(ep(t),"'")?39:34,r=e.types.map(e=>({name:Cy(e.value,n),kindModifiers:"",kind:"string",sortText:Mae.LocationPriority,replacementSpan:VQ(t,c),commitCharacters:[]}));return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:e.isNewIdentifier,optionalReplacementSpan:_,entries:r,defaultCommitCharacters:Gae(e.isNewIdentifier)}}default:return pn.assertNever(e)}}(pce(e,n,t,o,i,s),n,e,i,o,a,r,s,t,c)}}function _ce(e,t,n,r,i,o,a,s){if(!r||!Ju(r))return;const c=pce(t,r,n,i,o,s);return c&&function(e,t,n,r,i,o){switch(n.kind){case 0:{const t=x(n.paths,t=>t.name===e);return t&&wse(e,dce(t.extension),t.kind,[KY(e)])}case 1:{const a=x(n.symbols,t=>t.name===e);return a&&Cse(a,a.name,i,r,t,o)}case 2:return x(n.types,t=>t.value===e)?wse(e,"","string",[KY(e)]):void 0;default:return pn.assertNever(n)}}(e,r,c,t,i.getTypeChecker(),a)}function uce(e){const t=!0;return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:t,entries:e.map(({name:e,kind:t,span:n,extension:r})=>({name:e,kind:t,kindModifiers:dce(r),sortText:Mae.LocationPriority,replacementSpan:n})),defaultCommitCharacters:Gae(t)}}function dce(e){switch(e){case".d.ts":return".d.ts";case".js":return".js";case".json":return".json";case".jsx":return".jsx";case".ts":return".ts";case".tsx":return".tsx";case".d.mts":return".d.mts";case".mjs":return".mjs";case".mts":return".mts";case".d.cts":return".d.cts";case".cjs":return".cjs";case".cts":return".cts";case".tsbuildinfo":return pn.fail("Extension .tsbuildinfo is unsupported.");case void 0:return"";default:return pn.assertNever(e)}}function pce(e,t,n,r,i,o){const a=r.getTypeChecker(),s=fce(t.parent);switch(s.kind){case 202:{const c=fce(s.parent);return 206===c.kind?{kind:0,paths:bce(e,t,r,i,o)}:function e(t){switch(t.kind){case 234:case 184:{const e=mc(s,e=>e.parent===t);return e?{kind:2,types:gce(a.getTypeArgumentConstraint(e)),isNewIdentifier:!1}:void 0}case 200:const{indexType:i,objectType:o}=t;if(!RX(i,n))return;return mce(a.getTypeFromTypeNode(o));case 193:{const n=e(fce(t.parent));if(!n)return;const i=(r=s,J(t.types,e=>e!==r&&cF(e)&&KN(e.literal)?e.literal.text:void 0));return 1===n.kind?{kind:1,symbols:n.symbols.filter(e=>!C(i,e.name)),hasIndexSignature:n.hasIndexSignature}:{kind:2,types:n.types.filter(e=>!C(i,e.value)),isNewIdentifier:!1}}default:return}var r}(c)}case 304:return gF(s.parent)&&s.name===t?function(e,t){const n=e.getContextualType(t);if(!n)return;const r=e.getContextualType(t,4);return{kind:1,symbols:qse(n,r,t,e),hasIndexSignature:NZ(n)}}(a,s.parent):c()||c(0);case 213:{const{expression:e,argumentExpression:n}=s;return t===_h(n)?mce(a.getTypeAtLocation(e)):void 0}case 214:case 215:case 292:if(!function(e){return vF(e.parent)&&ge(e.parent.arguments)===e&&uD(e.parent.expression)&&"require"===e.parent.expression.escapedText}(t)&&!ff(s)){const r=due.getArgumentInfoForCompletions(292===s.kind?s.parent:t,n,e,a);return r&&function(e,t,n,r){let i=!1;const o=new Set,a=Tu(e)?pn.checkDefined(mc(t.parent,ZE)):t,s=L(r.getCandidateSignaturesForStringLiteralCompletions(e,a),t=>{if(!hJ(t)&&n.argumentCount>t.parameters.length)return;let s=t.getTypeParameterAtPosition(n.argumentIndex);if(Tu(e)){const e=r.getTypeOfPropertyOfType(s,sC(a.name));e&&(s=e)}return i=i||!!(4&s.flags),gce(s,o)});return d(s)?{kind:2,types:s,isNewIdentifier:i}:void 0}(r.invocation,t,r,a)||c(0)}case 273:case 279:case 284:case 352:return{kind:0,paths:bce(e,t,r,i,o)};case 297:const l=g0(a,s.parent.clauses),_=c();if(!_)return;return{kind:2,types:_.types.filter(e=>!l.hasValue(e.value)),isNewIdentifier:!1};case 277:case 282:const u=s;if(u.propertyName&&t!==u.propertyName)return;const p=u.parent,{moduleSpecifier:f}=276===p.kind?p.parent.parent:p.parent;if(!f)return;const m=a.getSymbolAtLocation(f);if(!m)return;const g=a.getExportsAndPropertiesOfModule(m),h=new Set(p.elements.map(e=>Qd(e.propertyName||e.name)));return{kind:1,symbols:g.filter(e=>"default"!==e.escapedName&&!h.has(e.escapedName)),hasIndexSignature:!1};case 227:if(103===s.operatorToken.kind){const e=a.getTypeAtLocation(s.right);return{kind:1,symbols:(e.isUnion()?a.getAllPossiblePropertiesOfTypes(e.types):e.getApparentProperties()).filter(e=>!e.valueDeclaration||!Yl(e.valueDeclaration)),hasIndexSignature:!1}}return c(0);default:return c()||c(0)}function c(e=4){const n=gce(SZ(t,a,e));if(n.length)return{kind:2,types:n,isNewIdentifier:!1}}}function fce(e){switch(e.kind){case 197:return ah(e);case 218:return sh(e);default:return e}}function mce(e){return e&&{kind:1,symbols:D(e.getApparentProperties(),e=>!(e.valueDeclaration&&Yl(e.valueDeclaration))),hasIndexSignature:NZ(e)}}function gce(e,t=new Set){return e?(e=oY(e)).isUnion()?L(e.types,e=>gce(e,t)):!e.isStringLiteral()||1024&e.flags||!Cx(t,e.value)?_:[e]:_}function hce(e,t,n){return{name:e,kind:t,extension:n}}function yce(e){return hce(e,"directory",void 0)}function vce(e,t,n){const r=function(e,t){const n=Math.max(e.lastIndexOf(fo),e.lastIndexOf(mo)),r=-1!==n?n+1:0,i=e.length-r;return 0===i||vs(e.substr(r,i),99)?void 0:Gs(t+r,i)}(e,t),i=0===e.length?void 0:Gs(t,e.length);return n.map(({name:e,kind:t,extension:n})=>e.includes(fo)||e.includes(mo)?{name:e,kind:t,extension:n,span:i}:{name:e,kind:t,extension:n,span:r})}function bce(e,t,n,r,i){return vce(t.text,t.getStart(e)+1,function(e,t,n,r,i){const o=Ro(t.text),a=Ju(t)?n.getModeForUsageLocation(e,t):void 0,s=e.path,c=Ao(s),l=n.getCompilerOptions(),u=n.getTypeChecker(),d=_Y(n,r),p=xce(l,1,e,u,i,a);return function(e){if(e&&e.length>=2&&46===e.charCodeAt(0)){const t=e.length>=3&&46===e.charCodeAt(1)?2:1,n=e.charCodeAt(t);return 47===n||92===n}return!1}(o)||!l.baseUrl&&!l.paths&&(bo(o)||vo(o))?function(e,t,n,r,i,o,a){const s=n.getCompilerOptions();return s.rootDirs?function(e,t,n,r,i,o,a,s){const c=i.getCompilerOptions(),l=c.project||o.getCurrentDirectory(),_=!(o.useCaseSensitiveFileNames&&o.useCaseSensitiveFileNames()),u=function(e,t,n,r){e=e.map(e=>Go(Vo(bo(e)?e:Jo(t,e))));const i=m(e,e=>ia(e,n,t,r)?n.substr(e.length):void 0);return Z([...e.map(e=>Jo(e,i)),n].map(e=>Ko(e)),vt,Nt)}(e,l,n,_);return Z(L(u,e=>je(Sce(t,e,r,i,o,a,!0,s).values())),(e,t)=>e.name===t.name&&e.kind===t.kind&&e.extension===t.extension)}(s.rootDirs,e,t,a,n,r,i,o):je(Sce(e,t,a,n,r,i,!0,o).values())}(o,c,n,r,d,s,p):function(e,t,n,r,i,o,a){const s=r.getTypeChecker(),c=r.getCompilerOptions(),{baseUrl:l,paths:u}=c,d=cce(),p=Ck(c);if(l){const t=Vo(Jo(i.getCurrentDirectory(),l));Sce(e,t,a,r,i,o,!1,void 0,d)}if(u){const t=Yy(c,i);Cce(d,e,t,a,r,i,o,u)}const f=Dce(e);for(const t of function(e,t,n){const r=n.getAmbientModules().map(e=>Iy(e.name)).filter(t=>Qt(t,e)&&!t.includes("*"));if(void 0!==t){const e=Go(t);return r.map(t=>Yt(t,e))}return r}(e,f,s))d.add(hce(t,"external module name",void 0));if(Ace(r,i,o,t,f,a,d),dY(p)){let n=!1;if(void 0===f)for(const e of function(e,t){if(!e.readFile||!e.fileExists)return _;const n=[];for(const r of VZ(t,e)){const t=Pb(r,e);for(const e of Oce){const r=t[e];if(r)for(const e in r)Ee(r,e)&&!Qt(e,"@types/")&&n.push(e)}}return n}(i,t)){const t=hce(e,"external module name",void 0);d.has(t.name)||(n=!0,d.add(t))}if(!n){const n=Ek(c),s=Pk(c);let l=!1;const _=t=>{if(s&&!l){const n=Jo(t,"package.json");if(l=JZ(i,n)){m(Pb(n,i).imports,e,t,!1,!0)}}};let u=t=>{const n=Jo(t,"node_modules");zZ(i,n)&&Sce(e,n,a,r,i,o,!1,void 0,d),_(t)};if(f&&n){const t=u;u=n=>{const r=jo(e);r.shift();let o=r.shift();if(!o)return t(n);if(Qt(o,"@")){const e=r.shift();if(!e)return t(n);o=Jo(o,e)}if(s&&Qt(o,"#"))return _(n);const a=Jo(n,"node_modules",o),c=Jo(a,"package.json");if(JZ(i,c)){const t=Pb(c,i),n=r.join("/")+(r.length&&Do(e)?"/":"");return void m(t.exports,n,a,!0,!1)}return t(n)}}LR(i,t,u)}}return je(d.values());function m(e,t,s,l,_){if("object"!=typeof e||null===e)return;const u=Ae(e),p=NM(c,n);wce(d,l,_,t,s,a,r,i,o,u,t=>{const n=Nce(e[t],p);if(void 0!==n)return an(Bt(t,"/")&&Bt(n,"/")?n+"*":n)},FR)}}(o,c,a,n,r,d,p)}(e,t,n,r,i))}function xce(e,t,n,r,i,o){return{extensionsToSearch:O(kce(e,r)),referenceKind:t,importingSourceFile:n,endingPreference:null==i?void 0:i.importModuleSpecifierEnding,resolutionMode:o}}function kce(e,t){const n=t?J(t.getAmbientModules(),e=>{const t=e.name.slice(1,-1);if(t.startsWith("*.")&&!t.includes("/"))return t.slice(1)}):[],r=[...MS(e),n];return dY(Ck(e))?RS(e,r):r}function Sce(e,t,n,r,i,o,a,s,c=cce()){var l;void 0===e&&(e=""),Do(e=Ro(e))||(e=Ao(e)),""===e&&(e="."+fo);const _=zo(t,e=Go(e)),u=Do(_)?_:Ao(_);if(!a){const e=WZ(u,i);if(e){const t=Pb(e,i).typesVersions;if("object"==typeof t){const a=null==(l=vM(t))?void 0:l.paths;if(a){const t=Ao(e);if(Cce(c,_.slice(Go(t).length),t,n,r,i,o,a))return c}}}}const d=!(i.useCaseSensitiveFileNames&&i.useCaseSensitiveFileNames());if(!zZ(i,u))return c;const p=BZ(i,u,n.extensionsToSearch,void 0,["./*"]);if(p)for(let e of p){if(e=Vo(e),s&&0===ra(e,s,t,d))continue;const{name:i,extension:o}=Tce(Io(e),r,n,!1);c.add(hce(i,"script",o))}const f=RZ(i,u);if(f)for(const e of f){const t=Io(Vo(e));"@types"!==t&&c.add(yce(t))}return c}function Tce(e,t,n,r){const i=pB.tryGetRealFileNameForNonJsDeclarationFileName(e);if(i)return{name:i,extension:aT(i)};if(0===n.referenceKind)return{name:e,extension:aT(e)};let o=pB.getModuleSpecifierPreferences({importModuleSpecifierEnding:n.endingPreference},t,t.getCompilerOptions(),n.importingSourceFile).getAllowedEndingsInPreferredOrder(n.resolutionMode);if(r&&(o=o.filter(e=>0!==e&&1!==e)),3===o[0]){if(No(e,LS))return{name:e,extension:aT(e)};const n=pB.tryGetJSExtensionForFile(e,t.getCompilerOptions());return n?{name:QS(e,n),extension:n}:{name:e,extension:aT(e)}}if(!r&&(0===o[0]||1===o[0])&&No(e,[".js",".jsx",".ts",".tsx",".d.ts"]))return{name:KS(e),extension:aT(e)};const a=pB.tryGetJSExtensionForFile(e,t.getCompilerOptions());return a?{name:QS(e,a),extension:a}:{name:e,extension:aT(e)}}function Cce(e,t,n,r,i,o,a,s){return wce(e,!1,!1,t,n,r,i,o,a,Ae(s),e=>s[e],(e,t)=>{const n=YS(e),r=YS(t),i="object"==typeof n?n.prefix.length:e.length;return xt("object"==typeof r?r.prefix.length:t.length,i)})}function wce(e,t,n,r,i,o,a,s,c,l,_,u){let d,p=[];for(const e of l){if("."===e)continue;const l=e.replace(/^\.\//,"")+((t||n)&&Bt(e,"/")?"*":""),f=_(e);if(f){const e=YS(l);if(!e)continue;const _="object"==typeof e&&en(e,r);_&&(void 0===d||-1===u(l,d))&&(d=l,p=p.filter(e=>!e.matchedPattern)),"string"!=typeof e&&void 0!==d&&1===u(l,d)||p.push({matchedPattern:_,results:Fce(l,f,r,i,o,t,n,a,s,c).map(({name:e,kind:t,extension:n})=>hce(e,t,n))})}}return p.forEach(t=>t.results.forEach(t=>e.add(t))),void 0!==d}function Nce(e,t){if("string"==typeof e)return e;if(e&&"object"==typeof e&&!Ze(e))for(const n in e)if("default"===n||t.includes(n)||AR(t,n)){return Nce(e[n],t)}}function Dce(e){return Lce(e)?Do(e)?e:Ao(e):void 0}function Fce(e,t,n,r,i,o,a,s,c,l){const u=YS(e);if(!u)return _;if("string"==typeof u)return p(e,"script");const d=Zt(n,u.prefix);if(void 0===d){return Bt(e,"/*")?p(u.prefix,"directory"):L(t,e=>{var t;return null==(t=Ece("",r,e,i,o,a,s,c,l))?void 0:t.map(({name:e,...t})=>({name:u.prefix+e+u.suffix,...t}))})}return L(t,e=>Ece(d,r,e,i,o,a,s,c,l));function p(e,t){return Qt(e,n)?[{name:Ko(e),kind:t,extension:void 0}]:_}}function Ece(e,t,n,r,i,o,a,s,c){if(!s.readDirectory)return;const l=YS(n);if(void 0===l||tt(l))return;const _=zo(l.prefix),u=Do(l.prefix)?_:Ao(_),d=Do(l.prefix)?"":Io(_),p=Lce(e),f=p?Do(e)?e:Ao(e):void 0,g=()=>c.getCommonSourceDirectory(),h=!Jy(c),y=a.getCompilerOptions().outDir,v=a.getCompilerOptions().declarationDir,b=p?Jo(u,d+f):u,x=Vo(Jo(t,b)),k=o&&y&&Qy(x,h,y,g),S=o&&v&&Qy(x,h,v,g),T=Vo(l.suffix),C=T&&Gy("_"+T),w=T?Xy("_"+T):void 0,N=[C&&QS(T,C),...w?w.map(e=>QS(T,e)):[],T].filter(tt),D=T?N.map(e=>"**/*"+e):["./*"],F=(i||o)&&Bt(n,"/*");let E=P(x);return k&&(E=G(E,P(k))),S&&(E=G(E,P(S))),T||(E=G(E,A(x)),k&&(E=G(E,A(k))),S&&(E=G(E,A(S)))),E;function P(e){const t=p?e:Go(e)+d;return J(BZ(s,e,r.extensionsToSearch,void 0,D),e=>{const n=(i=e,o=t,m(N,e=>{const t=(n=Vo(i),a=e,Qt(n,r=o)&&Bt(n,a)?n.slice(r.length,n.length-a.length):void 0);var n,r,a;return void 0===t?void 0:Pce(t)}));var i,o;if(n){if(Lce(n))return yce(jo(Pce(n))[1]);const{name:e,extension:t}=Tce(n,a,r,F);return hce(e,"script",t)}})}function A(e){return J(RZ(s,e),e=>"node_modules"===e?void 0:yce(e))}}function Pce(e){return e[0]===fo?e.slice(1):e}function Ace(e,t,n,r,i,o,a=cce()){const s=e.getCompilerOptions(),c=new Map,l=qZ(()=>bM(s,t))||_;for(const e of l)u(e);for(const e of VZ(r,t)){u(Jo(Ao(e),"node_modules/@types"))}return a;function u(r){if(zZ(t,r))for(const l of RZ(t,r)){const _=VR(l);if(!s.types||C(s.types,_))if(void 0===i)c.has(_)||(a.add(hce(_,"external module name",void 0)),c.set(_,!0));else{const s=Jo(r,l),c=iS(i,_,zy(t));void 0!==c&&Sce(c,s,o,e,t,n,!1,void 0,a)}}}}var Ice=/^(\/\/\/\s*{const i=t.getSymbolAtLocation(n);if(i){const t=uJ(i).toString();let n=r.get(t);n||r.set(t,n=[]),n.push(e)}});return r}(e,n,r);return(o,a,s)=>{const{directImports:c,indirectUsers:l}=function(e,t,n,{exportingModuleSymbol:r,exportKind:i},o,a){const s=nY(),c=nY(),l=[],_=!!r.globalExports,u=_?void 0:[];return p(r),{directImports:l,indirectUsers:d()};function d(){if(_)return e;if(r.declarations)for(const e of r.declarations)yp(e)&&t.has(e.getSourceFile().fileName)&&h(e);return u.map(Sd)}function p(e){const t=y(e);if(t)for(const e of t)if(s(e))switch(a&&a.throwIfCancellationRequested(),e.kind){case 214:if(ff(e)){f(e);break}if(!_){const t=e.parent;if(2===i&&261===t.kind){const{name:e}=t;if(80===e.kind){l.push(e);break}}}break;case 80:break;case 272:g(e,e.name,Av(e,32),!1);break;case 273:case 352:l.push(e);const t=e.importClause&&e.importClause.namedBindings;t&&275===t.kind?g(e,t.name,!1,!0):!_&&Dg(e)&&h(Hce(e));break;case 279:e.exportClause?281===e.exportClause.kind?h(Hce(e),!0):l.push(e):p($ce(e,o));break;case 206:!_&&e.isTypeOf&&!e.qualifier&&m(e)&&h(e.getSourceFile(),!0),l.push(e);break;default:pn.failBadSyntaxKind(e,"Unexpected import kind.")}}function f(e){h(mc(e,Kce)||e.getSourceFile(),!!m(e,!0))}function m(e,t=!1){return mc(e,e=>t&&Kce(e)?"quit":EI(e)&&H(e.modifiers,pD))}function g(e,t,n,r){if(2===i)r||l.push(e);else if(!_){const r=Hce(e);pn.assert(308===r.kind||268===r.kind),n||function(e,t,n){const r=n.getSymbolAtLocation(t);return!!qce(e,e=>{if(!RE(e))return;const{exportClause:t,moduleSpecifier:i}=e;return!i&&t&&BE(t)&&t.elements.some(e=>n.getExportSpecifierLocalTargetSymbol(e)===r)})}(r,t,o)?h(r,!0):h(r)}}function h(e,t=!1){pn.assert(!_);if(!c(e))return;if(u.push(e),!t)return;const n=o.getMergedSymbol(e.symbol);if(!n)return;pn.assert(!!(1536&n.flags));const r=y(n);if(r)for(const e of r)lF(e)||h(Hce(e),!0)}function y(e){return n.get(uJ(e).toString())}}(e,t,i,a,n,r);return{indirectUsers:l,...Jce(c,o,a.exportKind,n,s)}}}o(jce,{Core:()=>rle,DefinitionKind:()=>Xce,EntryKind:()=>Qce,ExportKind:()=>Rce,FindReferencesUse:()=>ile,ImportExport:()=>Bce,createImportTracker:()=>Mce,findModuleReferences:()=>zce,findReferenceOrRenameEntries:()=>cle,findReferencedSymbols:()=>ole,getContextNode:()=>tle,getExportInfo:()=>Wce,getImplementationsAtPosition:()=>ale,getImportOrExportSymbol:()=>Vce,getReferenceEntriesForNode:()=>lle,isContextWithStartAndEndNode:()=>Zce,isDeclarationOfSymbol:()=>kle,isWriteAccessForReference:()=>xle,toContextSpan:()=>nle,toHighlightSpan:()=>yle,toReferenceEntry:()=>fle,toRenameLocation:()=>ple});var Rce=(e=>(e[e.Named=0]="Named",e[e.Default=1]="Default",e[e.ExportEquals=2]="ExportEquals",e))(Rce||{}),Bce=(e=>(e[e.Import=0]="Import",e[e.Export=1]="Export",e))(Bce||{});function Jce(e,t,n,r,i){const o=[],a=[];function s(e,t){o.push([e,t])}if(e)for(const t of e)c(t);return{importSearches:o,singleReferences:a};function c(e){if(272===e.kind)return void(Gce(e)&&l(e.name));if(80===e.kind)return void l(e);if(206===e.kind){if(e.qualifier){const n=db(e.qualifier);n.escapedText===kc(t)&&a.push(n)}else 2===n&&a.push(e.argument.literal);return}if(11!==e.moduleSpecifier.kind)return;if(279===e.kind)return void(e.exportClause&&BE(e.exportClause)&&_(e.exportClause));const{name:o,namedBindings:c}=e.importClause||{name:void 0,namedBindings:void 0};if(c)switch(c.kind){case 275:l(c.name);break;case 276:0!==n&&1!==n||_(c);break;default:pn.assertNever(c)}if(o&&(1===n||2===n)&&(!i||o.escapedText===bY(t))){s(o,r.getSymbolAtLocation(o))}}function l(e){2!==n||i&&!u(e.escapedText)||s(e,r.getSymbolAtLocation(e))}function _(e){if(e)for(const n of e.elements){const{name:e,propertyName:o}=n;if(u(Qd(o||e)))if(o)a.push(o),i&&Qd(e)!==t.escapedName||s(e,r.getSymbolAtLocation(e));else{s(e,282===n.kind&&n.propertyName?r.getExportSpecifierLocalTargetSymbol(n):r.getSymbolAtLocation(e))}}}function u(e){return e===t.escapedName||0!==n&&"default"===e}}function zce(e,t,n){var r;const i=[],o=e.getTypeChecker();for(const a of t){const t=n.valueDeclaration;if(308===(null==t?void 0:t.kind)){for(const n of a.referencedFiles)e.getSourceFileFromReference(a,n)===t&&i.push({kind:"reference",referencingFile:a,ref:n});for(const n of a.typeReferenceDirectives){const o=null==(r=e.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(n,a))?void 0:r.resolvedTypeReferenceDirective;void 0!==o&&o.resolvedFileName===t.fileName&&i.push({kind:"reference",referencingFile:a,ref:n})}}Uce(a,(e,t)=>{o.getSymbolAtLocation(t)===n&&i.push(iy(e)?{kind:"implicit",literal:t,referencingFile:a}:{kind:"import",literal:t})})}return i}function qce(e,t){return p(308===e.kind?e.statements:e.body.statements,e=>t(e)||Kce(e)&&p(e.body&&e.body.statements,t))}function Uce(e,t){if(e.externalModuleIndicator||void 0!==e.imports)for(const n of e.imports)t(Sg(n),n);else qce(e,e=>{switch(e.kind){case 279:case 273:{const n=e;n.moduleSpecifier&&KN(n.moduleSpecifier)&&t(n,n.moduleSpecifier);break}case 272:{const n=e;Gce(n)&&t(n,n.moduleReference.expression);break}}})}function Vce(e,t,n,r){return r?i():i()||function(){if(!function(e){const{parent:t}=e;switch(t.kind){case 272:return t.name===e&&Gce(t);case 277:return!t.propertyName;case 274:case 275:return pn.assert(t.name===e),!0;case 209:return Om(e)&&zm(t.parent.parent);default:return!1}}(e))return;let r=n.getImmediateAliasedSymbol(t);if(!r)return;if(r=function(e,t){if(e.declarations)for(const n of e.declarations){if(JE(n)&&!n.propertyName&&!n.parent.parent.moduleSpecifier)return t.getExportSpecifierLocalTargetSymbol(n)||e;if(hF(n)&&ig(n.expression)&&!dD(n.name))return t.getSymbolAtLocation(n);if(lP(n)&&AF(n.parent.parent)&&2===og(n.parent.parent))return t.getExportSpecifierLocalTargetSymbol(n.name)}return e}(r,n),"export="===r.escapedName&&(r=function(e,t){var n,r;if(2097152&e.flags)return t.getImmediateAliasedSymbol(e);const i=pn.checkDefined(e.valueDeclaration);if(ME(i))return null==(n=rt(i.expression,_u))?void 0:n.symbol;if(AF(i))return null==(r=rt(i.right,_u))?void 0:r.symbol;if(dP(i))return i.symbol;return}(r,n),void 0===r))return;const i=bY(r);if(void 0===i||"default"===i||i===t.escapedName)return{kind:0,symbol:r}}();function i(){var i;const{parent:s}=e,c=s.parent;if(t.exportSymbol)return 212===s.kind?(null==(i=t.declarations)?void 0:i.some(e=>e===s))&&AF(c)?_(c,!1):void 0:o(t.exportSymbol,a(s));{const i=function(e,t){const n=fE(e)?e:fF(e)?ac(e):void 0;return n?e.name!==t||sP(n.parent)?void 0:XF(n.parent.parent)?n.parent.parent:void 0:e}(s,e);if(i&&Av(i,32)){if(CE(i)&&i.moduleReference===e){if(r)return;return{kind:0,symbol:n.getSymbolAtLocation(i.name)}}return o(t,a(i))}if(OE(s))return o(t,0);if(ME(s))return l(s);if(ME(c))return l(c);if(AF(s))return _(s,!0);if(AF(c))return _(c,!0);if(GP(s)||OP(s))return o(t,0)}function l(e){if(!e.symbol.parent)return;const n=e.isExportEquals?2:1;return{kind:1,symbol:t,exportInfo:{exportingModuleSymbol:e.symbol.parent,exportKind:n}}}function _(e,r){let i;switch(og(e)){case 1:i=0;break;case 2:i=2;break;default:return}const a=r?n.getSymbolAtLocation(Fx(it(e.left,Dx))):t;return a&&o(a,i)}}function o(e,t){const r=Wce(e,t,n);return r&&{kind:1,symbol:e,exportInfo:r}}function a(e){return Av(e,2048)?1:0}}function Wce(e,t,n){const r=e.parent;if(!r)return;const i=n.getMergedSymbol(r);return td(i)?{exportingModuleSymbol:i,exportKind:t}:void 0}function $ce(e,t){return t.getMergedSymbol(Hce(e).symbol)}function Hce(e){if(214===e.kind||352===e.kind)return e.getSourceFile();const{parent:t}=e;return 308===t.kind?t:(pn.assert(269===t.kind),it(t.parent,Kce))}function Kce(e){return 268===e.kind&&11===e.name.kind}function Gce(e){return 284===e.moduleReference.kind&&11===e.moduleReference.expression.kind}var Xce=(e=>(e[e.Symbol=0]="Symbol",e[e.Label=1]="Label",e[e.Keyword=2]="Keyword",e[e.This=3]="This",e[e.String=4]="String",e[e.TripleSlashReference=5]="TripleSlashReference",e))(Xce||{}),Qce=(e=>(e[e.Span=0]="Span",e[e.Node=1]="Node",e[e.StringLiteral=2]="StringLiteral",e[e.SearchedLocalFoundProperty=3]="SearchedLocalFoundProperty",e[e.SearchedPropertyFoundLocal=4]="SearchedPropertyFoundLocal",e))(Qce||{});function Yce(e,t=1){return{kind:t,node:e.name||e,context:ele(e)}}function Zce(e){return e&&void 0===e.kind}function ele(e){if(fu(e))return tle(e);if(e.parent){if(!fu(e.parent)&&!ME(e.parent)){if(Om(e)){const t=AF(e.parent)?e.parent:Dx(e.parent)&&AF(e.parent.parent)&&e.parent.parent.left===e.parent?e.parent.parent:void 0;if(t&&0!==og(t))return tle(t)}if(KE(e.parent)||GE(e.parent))return e.parent.parent;if(HE(e.parent)||_E(e.parent)||Fl(e.parent))return e.parent;if(Ju(e)){const t=Tg(e);if(t){const e=mc(t,e=>fu(e)||hu(e)||Fu(e));return fu(e)?tle(e):e}}const t=mc(e,ND);return t?tle(t.parent):void 0}return e.parent.name===e||jD(e.parent)||ME(e.parent)||(ql(e.parent)||fF(e.parent))&&e.parent.propertyName===e||90===e.kind&&Av(e.parent,2080)?tle(e.parent):void 0}}function tle(e){if(e)switch(e.kind){case 261:return mE(e.parent)&&1===e.parent.declarations.length?XF(e.parent.parent)?e.parent.parent:tu(e.parent.parent)?tle(e.parent.parent):e.parent:e;case 209:return tle(e.parent.parent);case 277:return e.parent.parent.parent;case 282:case 275:return e.parent.parent;case 274:case 281:return e.parent;case 227:return YF(e.parent)?e.parent:e;case 251:case 250:return{start:e.initializer,end:e.expression};case 304:case 305:return JQ(e.parent)?tle(mc(e.parent,e=>AF(e)||tu(e))):e;case 256:return{start:x(e.getChildren(e.getSourceFile()),e=>109===e.kind),end:e.caseBlock};default:return e}}function nle(e,t,n){if(!n)return;const r=Zce(n)?vle(n.start,t,n.end):vle(n,t);return r.start!==e.start||r.length!==e.length?{contextSpan:r}:void 0}var rle,ile=(e=>(e[e.Other=0]="Other",e[e.References=1]="References",e[e.Rename=2]="Rename",e))(ile||{});function ole(e,t,n,r,i){const o=sQ(r,i),a={use:1},s=rle.getReferencedSymbolsForNode(i,o,e,n,t,a),c=e.getTypeChecker(),l=rle.getAdjustedNode(o,a),_=function(e){return 90===e.kind||!!fh(e)||mh(e)||137===e.kind&&jD(e.parent)}(l)?c.getSymbolAtLocation(l):void 0;return s&&s.length?J(s,({definition:e,references:n})=>e&&{definition:c.runWithCancellationToken(t,t=>function(e,t,n){const r=(()=>{switch(e.type){case 0:{const{symbol:r}=e,{displayParts:i,kind:o}=dle(r,t,n),a=i.map(e=>e.text).join(""),s=r.declarations&&ge(r.declarations);return{...ule(s?Fc(s)||s:n),name:a,kind:o,displayParts:i,context:tle(s)}}case 1:{const{node:t}=e;return{...ule(t),name:t.text,kind:"label",displayParts:[JY(t.text,17)]}}case 2:{const{node:t}=e,n=Ia(t.kind);return{...ule(t),name:n,kind:"keyword",displayParts:[{text:n,kind:"keyword"}]}}case 3:{const{node:n}=e,r=t.getSymbolAtLocation(n),i=r&&Gue.getSymbolDisplayPartsDocumentationAndSymbolKind(t,r,n.getSourceFile(),AX(n),n).displayParts||[KY("this")];return{...ule(n),name:"this",kind:"var",displayParts:i}}case 4:{const{node:t}=e;return{...ule(t),name:t.text,kind:"var",displayParts:[JY(ep(t),8)]}}case 5:return{textSpan:KQ(e.reference),sourceFile:e.file,name:e.reference.fileName,kind:"string",displayParts:[JY(`"${e.reference.fileName}"`,8)]};default:return pn.assertNever(e)}})(),{sourceFile:i,textSpan:o,name:a,kind:s,displayParts:c,context:l}=r;return{containerKind:"",containerName:"",fileName:i.fileName,kind:s,name:a,textSpan:o,displayParts:c,...nle(o,i,l)}}(e,t,o)),references:n.map(e=>function(e,t){const n=fle(e);return t?{...n,isDefinition:0!==e.kind&&kle(e.node,t)}:n}(e,_))}):void 0}function ale(e,t,n,r,i){const o=sQ(r,i);let a;const s=sle(e,t,n,o,i);if(212===o.parent.kind||209===o.parent.kind||213===o.parent.kind||108===o.kind)a=s&&[...s];else if(s){const r=Qe(s),i=new Set;for(;!r.isEmpty();){const o=r.dequeue();if(!Cx(i,_J(o.node)))continue;a=ae(a,o);const s=sle(e,t,n,o.node,o.node.pos);s&&r.enqueue(...s)}}const c=e.getTypeChecker();return P(a,e=>function(e,t){const n=mle(e);if(0!==e.kind){const{node:r}=e;return{...n,...hle(r,t)}}return{...n,kind:"",displayParts:[]}}(e,c))}function sle(e,t,n,r,i){if(308===r.kind)return;const o=e.getTypeChecker();if(305===r.parent.kind){const e=[];return rle.getReferenceEntriesForShorthandPropertyAssignment(r,o,t=>e.push(Yce(t))),e}if(108===r.kind||_m(r.parent)){const e=o.getSymbolAtLocation(r);return e.valueDeclaration&&[Yce(e.valueDeclaration)]}return lle(i,r,e,n,t,{implementations:!0,use:1})}function cle(e,t,n,r,i,o,a){return P(_le(rle.getReferencedSymbolsForNode(i,r,e,n,t,o)),t=>a(t,r,e.getTypeChecker()))}function lle(e,t,n,r,i,o={},a=new Set(r.map(e=>e.fileName))){return _le(rle.getReferencedSymbolsForNode(e,t,n,r,i,o,a))}function _le(e){return e&&L(e,e=>e.references)}function ule(e){const t=e.getSourceFile();return{sourceFile:t,textSpan:vle(ND(e)?e.expression:e,t)}}function dle(e,t,n){const r=rle.getIntersectingMeaningFromDeclarations(n,e),i=e.declarations&&ge(e.declarations)||n,{displayParts:o,symbolKind:a}=Gue.getSymbolDisplayPartsDocumentationAndSymbolKind(t,e,i.getSourceFile(),i,i,r);return{displayParts:o,kind:a}}function ple(e,t,n,r,i){return{...mle(e),...r&&gle(e,t,n,i)}}function fle(e){const t=mle(e);if(0===e.kind)return{...t,isWriteAccess:!1};const{kind:n,node:r}=e;return{...t,isWriteAccess:xle(r),isInString:2===n||void 0}}function mle(e){if(0===e.kind)return{textSpan:e.textSpan,fileName:e.fileName};{const t=e.node.getSourceFile(),n=vle(e.node,t);return{textSpan:n,fileName:t.fileName,...nle(n,t,e.context)}}}function gle(e,t,n,r){if(0!==e.kind&&(uD(t)||Ju(t))){const{node:r,kind:i}=e,o=r.parent,a=t.text,s=lP(o);if(s||kY(o)&&o.name===r&&void 0===o.dotDotDotToken){const e={prefixText:a+": "},t={suffixText:": "+a};if(3===i)return e;if(4===i)return t;if(s){const n=o.parent;return gF(n)&&AF(n.parent)&&ig(n.parent.left)?e:t}return e}if(jE(o)&&!o.propertyName){return C((JE(t.parent)?n.getExportSpecifierLocalTargetSymbol(t.parent):n.getSymbolAtLocation(t)).declarations,o)?{prefixText:a+" as "}:MG}if(JE(o)&&!o.propertyName)return t===e.node||n.getSymbolAtLocation(t)===n.getSymbolAtLocation(e.node)?{prefixText:a+" as "}:{suffixText:" as "+a}}if(0!==e.kind&&$N(e.node)&&Dx(e.node.parent)){const e=yY(r);return{prefixText:e,suffixText:e}}return MG}function hle(e,t){const n=t.getSymbolAtLocation(fu(e)&&e.name?e.name:e);return n?dle(n,t,e):211===e.kind?{kind:"interface",displayParts:[UY(21),KY("object literal"),UY(22)]}:232===e.kind?{kind:"local class",displayParts:[UY(21),KY("anonymous local class"),UY(22)]}:{kind:IX(e),displayParts:[]}}function yle(e){const t=mle(e);if(0===e.kind)return{fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}};const n=xle(e.node),r={textSpan:t.textSpan,kind:n?"writtenReference":"reference",isInString:2===e.kind||void 0,...t.contextSpan&&{contextSpan:t.contextSpan}};return{fileName:t.fileName,span:r}}function vle(e,t,n){let r=e.getStart(t),i=(n||e).getEnd();return Ju(e)&&i-r>2&&(pn.assert(void 0===n),r+=1,i-=1),270===(null==n?void 0:n.kind)&&(i=n.getFullStart()),Xs(r,i)}function ble(e){return 0===e.kind?e.textSpan:vle(e.node,e.node.getSourceFile())}function xle(e){const t=fh(e);return!!t&&function(e){if(33554432&e.flags)return!0;switch(e.kind){case 227:case 209:case 264:case 232:case 90:case 267:case 307:case 282:case 274:case 272:case 277:case 265:case 339:case 347:case 292:case 268:case 271:case 275:case 281:case 170:case 305:case 266:case 169:return!0;case 304:return!JQ(e.parent);case 263:case 219:case 177:case 175:case 178:case 179:return!!e.body;case 261:case 173:return!!e.initializer||sP(e.parent);case 174:case 172:case 349:case 342:return!1;default:return pn.failBadSyntaxKind(e)}}(t)||90===e.kind||px(e)}function kle(e,t){var n;if(!t)return!1;const r=fh(e)||(90===e.kind?e.parent:mh(e)||137===e.kind&&jD(e.parent)?e.parent.parent:void 0),i=r&&AF(r)?r.left:void 0;return!(!r||!(null==(n=t.declarations)?void 0:n.some(e=>e===r||e===i)))}(e=>{function t(e,t){return 1===t.use?e=oQ(e):2===t.use&&(e=aQ(e)),e}function n(e,t,n){let r;const i=t.get(e.path)||_;for(const e of i)if(RV(e)){const t=n.getSourceFileByPath(e.file),i=JV(n,e);BV(i)&&(r=ae(r,{kind:0,fileName:t.fileName,textSpan:KQ(i)}))}return r}function r(e,t,n){if(e.parent&&TE(e.parent)){const e=n.getAliasedSymbol(t),r=n.getMergedSymbol(e);if(e!==r)return r}}function i(e,t,n,r,i,a){const c=1536&e.flags&&e.declarations&&x(e.declarations,dP);if(!c)return;const _=e.exports.get("export="),u=s(t,e,!!_,n,a);if(!_||!a.has(c.fileName))return u;const d=t.getTypeChecker();return o(t,u,l(e=_x(_,d),void 0,n,a,d,r,i))}function o(e,...t){let n;for(const r of t)if(r&&r.length)if(n)for(const t of r){if(!t.definition||0!==t.definition.type){n.push(t);continue}const r=t.definition.symbol,i=S(n,e=>!!e.definition&&0===e.definition.type&&e.definition.symbol===r);if(-1===i){n.push(t);continue}const o=n[i];n[i]={definition:o.definition,references:o.references.concat(t.references).sort((t,n)=>{const r=a(e,t),i=a(e,n);if(r!==i)return xt(r,i);const o=ble(t),s=ble(n);return o.start!==s.start?xt(o.start,s.start):xt(o.length,s.length)})}}else n=r;return n}function a(e,t){const n=0===t.kind?e.getSourceFile(t.fileName):t.node.getSourceFile();return e.getSourceFiles().indexOf(n)}function s(e,t,n,r,i){pn.assert(!!t.valueDeclaration);const o=J(zce(e,r,t),e=>{if("import"===e.kind){const t=e.literal.parent;if(cF(t)){const e=it(t.parent,lF);if(n&&!e.qualifier)return}return Yce(e.literal)}if("implicit"===e.kind){return Yce(e.literal.text!==Hu&&oO(e.referencingFile,e=>2&e.transformFlags?$E(e)||HE(e)||XE(e)?e:void 0:"skip")||e.referencingFile.statements[0]||e.referencingFile)}return{kind:0,fileName:e.referencingFile.fileName,textSpan:KQ(e.ref)}});if(t.declarations)for(const e of t.declarations)switch(e.kind){case 308:break;case 268:i.has(e.getSourceFile().fileName)&&o.push(Yce(e.name));break;default:pn.assert(!!(33554432&t.flags),"Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.")}const a=t.exports.get("export=");if(null==a?void 0:a.declarations)for(const e of a.declarations){const t=e.getSourceFile();if(i.has(t.fileName)){const n=AF(e)&&hF(e.left)?e.left.expression:ME(e)?pn.checkDefined(GX(e,95,t)):Fc(e)||e;o.push(Yce(n))}}return o.length?[{definition:{type:0,symbol:t},references:o}]:_}function c(e){return 148===e.kind&&oF(e.parent)&&148===e.parent.operator}function l(e,t,n,r,i,o,a){const s=t&&function(e,t,n,r){const{parent:i}=t;if(JE(i)&&r)return M(t,e,i,n);return m(e.declarations,r=>{if(!r.parent){if(33554432&e.flags)return;pn.fail(`Unexpected symbol at ${pn.formatSyntaxKind(t.kind)}: ${pn.formatSymbol(e)}`)}return HD(r.parent)&&ZD(r.parent.parent)?n.getPropertyOfType(n.getTypeFromTypeNode(r.parent.parent),e.name):void 0})}(e,t,i,!Z(a))||e,c=t&&2!==a.use?X(t,s):7,l=[],_=new y(n,r,t?function(e){switch(e.kind){case 177:case 137:return 1;case 80:if(m_(e.parent))return pn.assert(e.parent.name===e),2;default:return 0}}(t):0,i,o,c,a,l),d=Z(a)&&s.declarations?x(s.declarations,JE):void 0;if(d)j(d.name,s,d,_.createSearch(t,e,void 0),_,!0,!0);else if(t&&90===t.kind&&"default"===s.escapedName&&s.parent)R(t,s,_),v(t,s,{exportingModuleSymbol:s.parent,exportKind:1},_);else{const e=_.createSearch(t,s,void 0,{allSearchSymbols:t?$(s,t,i,2===a.use,!!a.providePrefixAndSuffixTextForRename,!!a.implementations):[s]});u(s,_,e)}return l}function u(e,t,n){const r=function(e){const{declarations:t,flags:n,parent:r,valueDeclaration:i}=e;if(i&&(219===i.kind||232===i.kind))return i;if(!t)return;if(8196&n){const e=x(t,e=>Pv(e,2)||Yl(e));return e?Dh(e,264):void 0}if(t.some(kY))return;const o=r&&!(262144&e.flags);if(o&&(!td(r)||r.globalExports))return;let a;for(const e of t){const t=AX(e);if(a&&a!==t)return;if(!t||308===t.kind&&!rf(t))return;if(a=t,TF(a)){let e;for(;e=qg(a);)a=e}}return o?a.getSourceFile():a}(e);if(r)A(r,r.getSourceFile(),n,t,!(dP(r)&&!C(t.sourceFiles,r)));else for(const e of t.sourceFiles)t.cancellationToken.throwIfCancellationRequested(),T(e,n,t)}let f;var g;function h(e){if(!(33555968&e.flags))return;const t=e.declarations&&x(e.declarations,e=>!dP(e)&&!xE(e));return t&&t.symbol}e.getReferencedSymbolsForNode=function(e,a,u,d,p,f={},g=new Set(d.map(e=>e.fileName))){var h,y;if(dP(a=t(a,f))){const t=Sle.getReferenceAtPosition(a,e,u);if(!(null==t?void 0:t.file))return;const r=u.getTypeChecker().getMergedSymbol(t.file.symbol);if(r)return s(u,r,!1,d,g);const i=u.getFileIncludeReasons();if(!i)return;return[{definition:{type:5,reference:t.reference,file:a},references:n(t.file,i,u)||_}]}if(!f.implementations){const e=function(e,t,n){if(ZQ(e.kind)){if(116===e.kind&&DF(e.parent))return;if(148===e.kind&&!c(e))return;return function(e,t,n,r){const i=L(e,e=>(n.throwIfCancellationRequested(),J(N(e,Ia(t),e),e=>{if(e.kind===t&&(!r||r(e)))return Yce(e)})));return i.length?[{definition:{type:2,node:i[0].node},references:i}]:void 0}(t,e.kind,n,148===e.kind?c:void 0)}if(mf(e.parent)&&e.parent.name===e)return function(e,t){const n=L(e,e=>(t.throwIfCancellationRequested(),J(N(e,"meta",e),e=>{const t=e.parent;if(mf(t))return Yce(t)})));return n.length?[{definition:{type:2,node:n[0].node},references:n}]:void 0}(t,n);if(vD(e)&&LD(e.parent))return[{definition:{type:2,node:e},references:[Yce(e)]}];if(xX(e)){const t=vX(e.parent,e.text);return t&&E(t.parent,t)}if(kX(e))return E(e.parent,e);if(OX(e))return function(e,t,n){let r=im(e,!1,!1),i=256;switch(r.kind){case 175:case 174:if(Vf(r)){i&=$v(r),r=r.parent;break}case 173:case 172:case 177:case 178:case 179:i&=$v(r),r=r.parent;break;case 308:if(uO(r)||W(e))return;case 263:case 219:break;default:return}const o=L(308===r.kind?t:[r.getSourceFile()],e=>(n.throwIfCancellationRequested(),N(e,"this",dP(r)?e:r).filter(e=>{if(!OX(e))return!1;const t=im(e,!1,!1);if(!_u(t))return!1;switch(r.kind){case 219:case 263:return r.symbol===t.symbol;case 175:case 174:return Vf(r)&&r.symbol===t.symbol;case 232:case 264:case 211:return t.parent&&_u(t.parent)&&r.symbol===t.parent.symbol&&Iv(t)===!!i;case 308:return 308===t.kind&&!uO(t)&&!W(e)}}))).map(e=>Yce(e)),a=m(o,e=>FD(e.node.parent)?e.node:void 0);return[{definition:{type:3,node:a||e},references:o}]}(e,t,n);if(108===e.kind)return function(e){let t=cm(e,!1);if(!t)return;let n=256;switch(t.kind){case 173:case 172:case 175:case 174:case 177:case 178:case 179:n&=$v(t),t=t.parent;break;default:return}const r=J(N(t.getSourceFile(),"super",t),e=>{if(108!==e.kind)return;const r=cm(e,!1);return r&&Iv(r)===!!n&&r.parent.symbol===t.symbol?Yce(e):void 0});return[{definition:{type:0,symbol:t.symbol},references:r}]}(e);return}(a,d,p);if(e)return e}const v=u.getTypeChecker(),b=v.getSymbolAtLocation(jD(a)&&a.parent.name||a);if(!b){if(!f.implementations&&Ju(a)){if(xY(a)){const e=u.getFileIncludeReasons(),t=null==(y=null==(h=u.getResolvedModuleFromModuleSpecifier(a))?void 0:h.resolvedModule)?void 0:y.resolvedFileName,r=t?u.getSourceFile(t):void 0;if(r)return[{definition:{type:4,node:a},references:n(r,e,u)||_}]}return function(e,t,n,r){const i=eQ(e,n),o=L(t,t=>(r.throwIfCancellationRequested(),J(N(t,e.text),r=>{if(Ju(r)&&r.text===e.text){if(!i)return QN(r)&&!Ub(r,t)?void 0:Yce(r,2);{const e=eQ(r,n);if(i!==n.getStringType()&&(i===e||function(e,t){if(PD(e.parent))return t.getPropertyOfType(t.getTypeAtLocation(e.parent.parent),e.text)}(r,n)))return Yce(r,2)}}})));return[{definition:{type:4,node:e},references:o}]}(a,d,v,p)}return}if("export="===b.escapedName)return s(u,b.parent,!1,d,g);const x=i(b,u,d,p,f,g);if(x&&!(33554432&b.flags))return x;const k=r(a,b,v),S=k&&i(k,u,d,p,f,g);return o(u,x,l(b,a,d,g,v,p,f),S)},e.getAdjustedNode=t,e.getReferencesForFileName=function(e,t,r,i=new Set(r.map(e=>e.fileName))){var o,a;const c=null==(o=t.getSourceFile(e))?void 0:o.symbol;if(c)return(null==(a=s(t,c,!1,r,i)[0])?void 0:a.references)||_;const l=t.getFileIncludeReasons(),u=t.getSourceFile(e);return u&&l&&n(u,l,t)||_},(g=f||(f={}))[g.None=0]="None",g[g.Constructor=1]="Constructor",g[g.Class=2]="Class";class y{constructor(e,t,n,r,i,o,a,s){this.sourceFiles=e,this.sourceFilesSet=t,this.specialSearchKind=n,this.checker=r,this.cancellationToken=i,this.searchMeaning=o,this.options=a,this.result=s,this.inheritsFromCache=new Map,this.markSeenContainingTypeReference=nY(),this.markSeenReExportRHS=nY(),this.symbolIdToReferences=[],this.sourceFileToSeenSymbols=[]}includesSourceFile(e){return this.sourceFilesSet.has(e.fileName)}getImportSearches(e,t){return this.importTracker||(this.importTracker=Mce(this.sourceFiles,this.sourceFilesSet,this.checker,this.cancellationToken)),this.importTracker(e,t,2===this.options.use)}createSearch(e,t,n,r={}){const{text:i=Iy(kc(Tb(t)||h(t)||t)),allSearchSymbols:o=[t]}=r,a=yc(i),s=this.options.implementations&&e?function(e,t,n){const r=wX(e)?e.parent:void 0,i=r&&n.getTypeAtLocation(r.expression),o=J(i&&(i.isUnionOrIntersection()?i.types:i.symbol===t.parent?void 0:[i]),e=>e.symbol&&96&e.symbol.flags?e.symbol:void 0);return 0===o.length?void 0:o}(e,t,this.checker):void 0;return{symbol:t,comingFrom:n,text:i,escapedText:a,parents:s,allSearchSymbols:o,includes:e=>C(o,e)}}referenceAdder(e){const t=uJ(e);let n=this.symbolIdToReferences[t];return n||(n=this.symbolIdToReferences[t]=[],this.result.push({definition:{type:0,symbol:e},references:n})),(e,t)=>n.push(Yce(e,t))}addStringOrCommentReference(e,t){this.result.push({definition:void 0,references:[{kind:0,fileName:e,textSpan:t}]})}markSearchedSymbols(e,t){const n=_J(e),r=this.sourceFileToSeenSymbols[n]||(this.sourceFileToSeenSymbols[n]=new Set);let i=!1;for(const e of t)i=U(r,uJ(e))||i;return i}}function v(e,t,n,r){const{importSearches:i,singleReferences:o,indirectUsers:a}=r.getImportSearches(t,n);if(o.length){const e=r.referenceAdder(t);for(const t of o)b(t,r)&&e(t)}for(const[e,t]of i)P(e.getSourceFile(),r.createSearch(e,t,1),r);if(a.length){let i;switch(n.exportKind){case 0:i=r.createSearch(e,t,1);break;case 1:i=2===r.options.use?void 0:r.createSearch(e,t,1,{text:"default"})}if(i)for(const e of a)T(e,i,r)}}function b(e,t){return!!I(e,t)&&(2!==t.options.use||!(!uD(e)&&!ql(e.parent))&&!(ql(e.parent)&&Yd(e)))}function k(e,t){if(e.declarations)for(const n of e.declarations){const r=n.getSourceFile();P(r,t.createSearch(n,e,0),t,t.includesSourceFile(r))}}function T(e,t,n){void 0!==m7(e).get(t.escapedText)&&P(e,t,n)}function w(e,t,n,r,i=n){const o=rc(e.parent,e.parent.parent)?ye(t.getSymbolsOfParameterPropertyDeclaration(e.parent,e.text)):t.getSymbolAtLocation(e);if(o)for(const a of N(n,o.name,i)){if(!uD(a)||a===e||a.escapedText!==e.escapedText)continue;const n=t.getSymbolAtLocation(a);if(n===o||t.getShorthandAssignmentValueSymbol(a.parent)===o||JE(a.parent)&&M(a,n,a.parent,t)===o){const e=r(a);if(e)return e}}}function N(e,t,n=e){return J(F(e,t,n),t=>{const n=sQ(e,t);return n===e?void 0:n})}function F(e,t,n=e){const r=[];if(!t||!t.length)return r;const i=e.text,o=i.length,a=t.length;let s=i.indexOf(t,n.pos);for(;s>=0&&!(s>n.end);){const e=s+a;0!==s&&ys(i.charCodeAt(s-1),99)||e!==o&&ys(i.charCodeAt(e),99)||r.push(s),s=i.indexOf(t,s+a+1)}return r}function E(e,t){const n=e.getSourceFile(),r=t.text,i=J(N(n,r,e),e=>e===t||xX(e)&&vX(e,r)===t?Yce(e):void 0);return[{definition:{type:1,node:t},references:i}]}function P(e,t,n,r=!0){return n.cancellationToken.throwIfCancellationRequested(),A(e,e,t,n,r)}function A(e,t,n,r,i){if(r.markSearchedSymbols(t,n.allSearchSymbols))for(const o of F(t,n.text,e))O(t,o,n,r,i)}function I(e,t){return!!(aX(e)&t.searchMeaning)}function O(e,t,n,r,i){const o=sQ(e,t);if(!function(e,t){switch(e.kind){case 81:if(gP(e.parent))return!0;case 80:return e.text.length===t.length;case 15:case 11:{const n=e;return n.text.length===t.length&&(EX(n)||DX(e)||PX(e)||vF(e.parent)&&ag(e.parent)&&e.parent.arguments[1]===e||ql(e.parent))}case 9:return EX(e)&&e.text.length===t.length;case 90:return 7===t.length;default:return!1}}(o,n.text))return void(!r.options.implementations&&(r.options.findInStrings&&yQ(e,t)||r.options.findInComments&&qQ(e,t))&&r.addStringOrCommentReference(e.fileName,Gs(t,n.text.length)));if(!I(o,r))return;let a=r.checker.getSymbolAtLocation(o);if(!a)return;const s=o.parent;if(jE(s)&&s.propertyName===o)return;if(JE(s))return pn.assert(80===o.kind||11===o.kind),void j(o,a,s,n,r,i);if(Pl(s)&&s.isNameFirst&&s.typeExpression&&FP(s.typeExpression.type)&&s.typeExpression.type.jsDocPropertyTags&&d(s.typeExpression.type.jsDocPropertyTags))return void function(e,t,n,r){const i=r.referenceAdder(n.symbol);R(t,n.symbol,r),p(e,e=>{wD(e.name)&&i(e.name.left)})}(s.typeExpression.type.jsDocPropertyTags,o,n,r);const c=function(e,t,n,r){const{checker:i}=r;return K(t,n,i,!1,2!==r.options.use||!!r.options.providePrefixAndSuffixTextForRename,(n,r,i,o)=>(i&&G(t)!==G(i)&&(i=void 0),e.includes(i||r||n)?{symbol:!r||6&cx(n)?n:r,kind:o}:void 0),t=>!(e.parents&&!e.parents.some(e=>V(t.parent,e,r.inheritsFromCache,i))))}(n,a,o,r);if(c){switch(r.specialSearchKind){case 0:i&&R(o,c,r);break;case 1:!function(e,t,n,r){lX(e)&&R(e,n.symbol,r);const i=()=>r.referenceAdder(n.symbol);if(m_(e.parent))pn.assert(90===e.kind||e.parent.name===e),function(e,t,n){const r=B(e);if(r&&r.declarations)for(const e of r.declarations){const r=GX(e,137,t);pn.assert(177===e.kind&&!!r),n(r)}e.exports&&e.exports.forEach(e=>{const t=e.valueDeclaration;if(t&&175===t.kind){const e=t.body;e&&Y(e,110,e=>{lX(e)&&n(e)})}})}(n.symbol,t,i());else{const t=ab(yX(e).parent);t&&(function(e,t){const n=B(e.symbol);if(!n||!n.declarations)return;for(const e of n.declarations){pn.assert(177===e.kind);const n=e.body;n&&Y(n,108,e=>{cX(e)&&t(e)})}}(t,i()),function(e,t){if(function(e){return!!B(e.symbol)}(e))return;const n=e.symbol,r=t.createSearch(void 0,n,void 0);u(n,t,r)}(t,r))}}(o,e,n,r);break;case 2:!function(e,t,n){R(e,t.symbol,n);const r=e.parent;if(2===n.options.use||!m_(r))return;pn.assert(r.name===e);const i=n.referenceAdder(t.symbol);for(const e of r.members)v_(e)&&Iv(e)&&e.body&&e.body.forEachChild(function e(t){110===t.kind?i(t):s_(t)||m_(t)||t.forEachChild(e)})}(o,n,r);break;default:pn.assertNever(r.specialSearchKind)}Om(o)&&fF(o.parent)&&zm(o.parent.parent.parent)&&(a=o.parent.symbol,!a)||function(e,t,n,r){const i=Vce(e,t,r.checker,1===n.comingFrom);if(!i)return;const{symbol:o}=i;0===i.kind?Z(r.options)||k(o,r):v(e,o,i.exportInfo,r)}(o,a,n,r)}else!function({flags:e,valueDeclaration:t},n,r){const i=r.checker.getShorthandAssignmentValueSymbol(t),o=t&&Fc(t);33554432&e||!o||!n.includes(i)||R(o,i,r)}(a,n,r)}function j(e,t,n,r,i,o,a){pn.assert(!a||!!i.options.providePrefixAndSuffixTextForRename,"If alwaysGetReferences is true, then prefix/suffix text must be enabled");const{parent:s,propertyName:c,name:l}=n,_=s.parent,u=M(e,t,n,i.checker);if(a||r.includes(u)){if(c?e===c?(_.moduleSpecifier||d(),o&&2!==i.options.use&&i.markSeenReExportRHS(l)&&R(l,pn.checkDefined(n.symbol),i)):i.markSeenReExportRHS(e)&&d():2===i.options.use&&Yd(l)||d(),!Z(i.options)||a){const t=Yd(e)||Yd(n.name)?1:0,r=pn.checkDefined(n.symbol),o=Wce(r,t,i.checker);o&&v(e,r,o,i)}if(1!==r.comingFrom&&_.moduleSpecifier&&!c&&!Z(i.options)){const e=i.checker.getExportSpecifierLocalTargetSymbol(n);e&&k(e,i)}}function d(){o&&R(e,u,i)}}function M(e,t,n,r){return function(e,t){const{parent:n,propertyName:r,name:i}=t;return pn.assert(r===e||i===e),r?r===e:!n.parent.moduleSpecifier}(e,n)&&r.getExportSpecifierLocalTargetSymbol(n)||t}function R(e,t,n){const{kind:r,symbol:i}="kind"in t?t:{kind:void 0,symbol:t};if(2===n.options.use&&90===e.kind)return;const o=n.referenceAdder(i);n.options.implementations?function(e,t,n){if(ph(e)&&(r=e.parent,33554432&r.flags?!yE(r)&&!vE(r):jf(r)?Ou(r):l_(r)?r.body:m_(r)||lu(r)))return void t(e);var r;if(80!==e.kind)return;305===e.parent.kind&&Q(e,n.checker,t);const i=z(e);if(i)return void t(i);const o=mc(e,e=>!wD(e.parent)&&!T_(e.parent)&&!x_(e.parent)),a=o.parent;if(Iu(a)&&a.type===o&&n.markSeenContainingTypeReference(a))if(Ou(a))s(a.initializer);else if(s_(a)&&a.body){const e=a.body;242===e.kind?Af(e,e=>{e.expression&&s(e.expression)}):s(e)}else(G_(a)||zF(a))&&s(a.expression);function s(e){q(e)&&t(e)}}(e,o,n):o(e,r)}function B(e){return e.members&&e.members.get("__constructor")}function z(e){return uD(e)||hF(e)?z(e.parent):BF(e)?rt(e.parent.parent,nn(m_,yE)):void 0}function q(e){switch(e.kind){case 218:return q(e.expression);case 220:case 219:case 211:case 232:case 210:return!0;default:return!1}}function V(e,t,n,r){if(e===t)return!0;const i=uJ(e)+","+uJ(t),o=n.get(i);if(void 0!==o)return o;n.set(i,!1);const a=!!e.declarations&&e.declarations.some(e=>Ch(e).some(e=>{const i=r.getTypeAtLocation(e);return!!i&&!!i.symbol&&V(i.symbol,t,n,r)}));return n.set(i,a),a}function W(e){return 80===e.kind&&170===e.parent.kind&&e.parent.name===e}function $(e,t,n,r,i,o){const a=[];return K(e,t,n,r,!(r&&i),(t,n,r)=>{r&&G(e)!==G(r)&&(r=void 0),a.push(r||n||t)},()=>!o),a}function K(e,t,n,i,o,a,s){const c=g7(t);if(c){const e=n.getShorthandAssignmentValueSymbol(t.parent);if(e&&i)return a(e,void 0,void 0,3);const r=n.getContextualType(c.parent),o=r&&m(h7(c,n,r,!0),e=>d(e,4));if(o)return o;const s=function(e,t){return JQ(e.parent.parent)?t.getPropertySymbolOfDestructuringAssignment(e):void 0}(t,n),l=s&&a(s,void 0,void 0,4);if(l)return l;const _=e&&a(e,void 0,void 0,3);if(_)return _}const l=r(t,e,n);if(l){const e=a(l,void 0,void 0,1);if(e)return e}const _=d(e);if(_)return _;if(e.valueDeclaration&&rc(e.valueDeclaration,e.valueDeclaration.parent)){const t=n.getSymbolsOfParameterPropertyDeclaration(it(e.valueDeclaration,FD),e.name);return pn.assert(2===t.length&&!!(1&t[0].flags)&&!!(4&t[1].flags)),d(1&e.flags?t[1]:t[0])}const u=Qu(e,282);if(!i||u&&!u.propertyName){const e=u&&n.getExportSpecifierLocalTargetSymbol(u);if(e){const t=a(e,void 0,void 0,1);if(t)return t}}if(!i){let r;return r=o?kY(t.parent)?SY(n,t.parent):void 0:p(e,n),r&&d(r,4)}pn.assert(i);if(o){const t=p(e,n);return t&&d(t,4)}function d(e,t){return m(n.getRootSymbols(e),r=>a(e,r,void 0,t)||(r.parent&&96&r.parent.flags&&s(r)?function(e,t,n,r){const i=new Set;return o(e);function o(e){if(96&e.flags&&Cx(i,e))return m(e.declarations,e=>m(Ch(e),e=>{const i=n.getTypeAtLocation(e),a=i.symbol&&n.getPropertyOfType(i,t);return a&&m(n.getRootSymbols(a),r)||i.symbol&&o(i.symbol)}))}}(r.parent,r.name,n,n=>a(e,r,n,t)):void 0))}function p(e,t){const n=Qu(e,209);if(n&&kY(n))return SY(t,n)}}function G(e){if(!e.valueDeclaration)return!1;return!!(256&Vv(e.valueDeclaration))}function X(e,t){let n=aX(e);const{declarations:r}=t;if(r){let e;do{e=n;for(const e of r){const t=oX(e);t&n&&(n|=t)}}while(n!==e)}return n}function Q(e,t,n){const r=t.getSymbolAtLocation(e),i=t.getShorthandAssignmentValueSymbol(r.valueDeclaration);if(i)for(const e of i.getDeclarations())1&oX(e)&&n(e)}function Y(e,t,n){iO(e,e=>{e.kind===t&&n(e),Y(e,t,n)})}function Z(e){return 2===e.use&&e.providePrefixAndSuffixTextForRename}e.eachExportReference=function(e,t,n,r,i,o,a,s){const c=Mce(e,new Set(e.map(e=>e.fileName)),t,n),{importSearches:l,indirectUsers:_,singleReferences:u}=c(r,{exportKind:a?1:0,exportingModuleSymbol:i},!1);for(const[e]of l)s(e);for(const e of u)uD(e)&&lF(e.parent)&&s(e);for(const e of _)for(const n of N(e,a?"default":o)){const e=t.getSymbolAtLocation(n),i=H(null==e?void 0:e.declarations,e=>!!rt(e,ME));!uD(n)||ql(n.parent)||e!==r&&!i||s(n)}},e.isSymbolReferencedInFile=function(e,t,n,r=n){return w(e,t,n,()=>!0,r)||!1},e.eachSymbolReferenceInFile=w,e.getTopMostDeclarationNamesInFile=function(e,t){return D(N(t,e),e=>!!fh(e)).reduce((e,t)=>{const n=function(e){let t=0;for(;e;)e=AX(e),t++;return t}(t);return H(e.declarationNames)&&n!==e.depth?ne===i)&&r(t,a))return!0}return!1},e.getIntersectingMeaningFromDeclarations=X,e.getReferenceEntriesForShorthandPropertyAssignment=Q})(rle||(rle={}));var Sle={};function Tle(e,t,n,r,i){var o;const a=wle(t,n,e),s=a&&[(c=a.reference.fileName,l=a.fileName,u=a.unverified,{fileName:l,textSpan:Xs(0,0),kind:"script",name:c,containerName:void 0,containerKind:void 0,unverified:u})]||_;var c,l,u;if(null==a?void 0:a.file)return s;const d=sQ(t,n);if(d===t)return;const{parent:f}=d,m=e.getTypeChecker();if(164===d.kind||uD(d)&&BP(f)&&f.tagName===d){const e=function(e,t){const n=mc(t,f_);if(!n||!n.name)return;const r=mc(n,m_);if(!r)return;const i=kh(r);if(!i)return;const o=_h(i.expression),a=MF(o)?o.symbol:e.getSymbolAtLocation(o);if(!a)return;const s=Ov(n)?e.getTypeOfSymbol(a):e.getDeclaredTypeOfSymbol(a);let c;if(ND(n.name)){const t=e.getSymbolAtLocation(n.name);if(!t)return;c=Gh(t)?x(e.getPropertiesOfType(s),e=>e.escapedName===t.escapedName):e.getPropertyOfType(s,vc(t.escapedName))}else c=e.getPropertyOfType(s,vc(Jp(n.name)));if(!c)return;return Ole(e,c,t)}(m,d);if(void 0!==e||164!==d.kind)return e||_}if(xX(d)){const e=vX(d.parent,d.text);return e?[jle(m,e,"label",d.text,void 0)]:void 0}switch(d.kind){case 90:if(!oP(d.parent))break;case 84:const e=mc(d.parent,lE);if(e)return[Mle(e,t)]}let g;switch(d.kind){case 107:case 135:case 127:g=l_;const e=mc(d,g);return e?[Ble(m,e)]:void 0}if(vD(d)&&LD(d.parent)){const e=d.parent.parent,{symbol:t,failedAliasResolution:n}=Ile(e,m,i),r=D(e.members,LD),o=t?m.symbolToString(t,e):"",a=d.getSourceFile();return P(r,e=>{let{pos:t}=zb(e);return t=ts(a.text,t),jle(m,e,"constructor","static {}",o,!1,n,{start:t,length:6})})}let{symbol:h,failedAliasResolution:y}=Ile(d,m,i),v=d;if(r&&y){const e=p([d,...(null==h?void 0:h.declarations)||_],e=>mc(e,Dp)),t=e&&kg(e);t&&(({symbol:h,failedAliasResolution:y}=Ile(t,m,i)),v=t)}if(!h&&xY(v)){const n=null==(o=e.getResolvedModuleFromModuleSpecifier(v,t))?void 0:o.resolvedModule;if(n)return[{name:v.text,fileName:n.resolvedFileName,containerName:void 0,containerKind:void 0,kind:"script",textSpan:Gs(0,0),failedAliasResolution:y,isAmbient:vO(n.resolvedFileName),unverified:v!==d}]}if(r_(d)&&(f_(f)||Nc(f))&&(h=f.symbol),!h)return G(s,function(e,t){return J(t.getIndexInfosAtLocation(e),e=>e.declaration&&Ble(t,e.declaration))}(d,m));if(r&&b(h.declarations,e=>e.getSourceFile().fileName===t.fileName))return;const k=function(e,t){const n=function(e){const t=mc(e,e=>!wX(e)),n=null==t?void 0:t.parent;return n&&B_(n)&&mm(n)===t?n:void 0}(t),r=n&&e.getResolvedSignature(n);return rt(r&&r.declaration,e=>s_(e)&&!VD(e))}(m,d);if(k&&(!Tu(d.parent)||!function(e){switch(e.kind){case 177:case 186:case 180:case 181:return!0;default:return!1}}(k))){const e=Ble(m,k,y);let t=e=>e!==k;if(m.getRootSymbols(h).some(e=>function(e,t){var n;return e===t.symbol||e===t.symbol.parent||cb(t.parent)||!B_(t.parent)&&e===(null==(n=rt(t.parent,_u))?void 0:n.symbol)}(e,k))){if(!jD(k))return[e];t=e=>e!==k&&(hE(e)||MF(e))}const n=Ole(m,h,d,y,t)||_;return 108===d.kind?[e,...n]:[...n,e]}if(305===d.parent.kind){const e=m.getShorthandAssignmentValueSymbol(h.valueDeclaration);return G((null==e?void 0:e.declarations)?e.declarations.map(t=>Lle(t,m,e,d,!1,y)):_,Cle(m,d))}if(o_(d)&&fF(f)&&dF(f.parent)&&d===(f.propertyName||f.name)){const e=aY(d),t=m.getTypeAtLocation(f.parent);return void 0===e?_:L(t.isUnion()?t.types:[t],t=>{const n=t.getProperty(e);return n&&Ole(m,n,d)})}const S=Cle(m,d);return G(s,S.length?S:Ole(m,h,d,y))}function Cle(e,t){const n=g7(t);if(n){const r=n&&e.getContextualType(n.parent);if(r)return L(h7(n,e,r,!1),n=>Ole(e,n,t))}return _}function wle(e,t,n){var r,i;const o=Jle(e.referencedFiles,t);if(o){const t=n.getSourceFileFromReference(e,o);return t&&{reference:o,fileName:t.fileName,file:t,unverified:!1}}const a=Jle(e.typeReferenceDirectives,t);if(a){const t=null==(r=n.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(a,e))?void 0:r.resolvedTypeReferenceDirective,i=t&&n.getSourceFile(t.resolvedFileName);return i&&{reference:a,fileName:i.fileName,file:i,unverified:!1}}const s=Jle(e.libReferenceDirectives,t);if(s){const e=n.getLibFileFromReference(s);return e&&{reference:s,fileName:e.fileName,file:e,unverified:!1}}if(e.imports.length||e.moduleAugmentations.length){const r=cQ(e,t);let o;if(xY(r)&&Fs(r.text)&&(o=n.getResolvedModuleFromModuleSpecifier(r,e))){const t=null==(i=o.resolvedModule)?void 0:i.resolvedFileName,a=t||zo(Ao(e.fileName),r.text);return{file:n.getSourceFile(a),fileName:a,reference:{pos:r.getStart(),end:r.getEnd(),fileName:r.text},unverified:!t}}}}o(Sle,{createDefinitionInfo:()=>Lle,getDefinitionAndBoundSpan:()=>Ale,getDefinitionAtPosition:()=>Tle,getReferenceAtPosition:()=>wle,getTypeDefinitionAtPosition:()=>Ele});var Nle=new Set(["Array","ArrayLike","ReadonlyArray","Promise","PromiseLike","Iterable","IterableIterator","AsyncIterable","Set","WeakSet","ReadonlySet","Map","WeakMap","ReadonlyMap","Partial","Required","Readonly","Pick","Omit"]);function Dle(e,t){if(!t.aliasSymbol)return!1;const n=t.aliasSymbol.name;if(!Nle.has(n))return!1;const r=e.resolveName(n,void 0,788968,!1);return!!r&&r===t.aliasSymbol}function Fle(e,t,n,r){var i,o;if(4&xx(t)&&function(e,t){const n=t.symbol.name;if(!Nle.has(n))return!1;const r=e.resolveName(n,void 0,788968,!1);return!!r&&r===t.target.symbol}(e,t))return Ple(e.getTypeArguments(t)[0],e,n,r);if(Dle(e,t)&&t.aliasTypeArguments)return Ple(t.aliasTypeArguments[0],e,n,r);if(32&xx(t)&&t.target&&Dle(e,t.target)){const a=null==(o=null==(i=t.aliasSymbol)?void 0:i.declarations)?void 0:o[0];if(a&&vE(a)&&UD(a.type)&&a.type.typeArguments)return Ple(e.getTypeAtLocation(a.type.typeArguments[0]),e,n,r)}return[]}function Ele(e,t,n){const r=sQ(t,n);if(r===t)return;if(mf(r.parent)&&r.parent.name===r)return Ple(e.getTypeAtLocation(r.parent),e,r.parent,!1);let{symbol:i,failedAliasResolution:o}=Ile(r,e,!1);if(r_(r)&&(f_(r.parent)||Nc(r.parent))&&(i=r.parent.symbol,o=!1),!i)return;const a=e.getTypeOfSymbolAtLocation(i,r),s=function(e,t,n){if(t.symbol===e||e.valueDeclaration&&t.symbol&&fE(e.valueDeclaration)&&e.valueDeclaration.initializer===t.symbol.valueDeclaration){const e=t.getCallSignatures();if(1===e.length)return n.getReturnTypeOfSignature(ye(e))}return}(i,a,e),c=s&&Ple(s,e,r,o),[l,_]=c&&0!==c.length?[s,c]:[a,Ple(a,e,r,o)];return _.length?[...Fle(e,l,r,o),..._]:!(111551&i.flags)&&788968&i.flags?Ole(e,_x(i,e),r,o):void 0}function Ple(e,t,n,r){return L(!e.isUnion()||32&e.flags?[e]:e.types,e=>e.symbol&&Ole(t,e.symbol,n,r))}function Ale(e,t,n){const r=Tle(e,t,n);if(!r||0===r.length)return;const i=Jle(t.referencedFiles,n)||Jle(t.typeReferenceDirectives,n)||Jle(t.libReferenceDirectives,n);if(i)return{definitions:r,textSpan:KQ(i)};const o=sQ(t,n);return{definitions:r,textSpan:Gs(o.getStart(),o.getWidth())}}function Ile(e,t,n){const r=t.getSymbolAtLocation(e);let i=!1;if((null==r?void 0:r.declarations)&&2097152&r.flags&&!n&&function(e,t){if(80!==e.kind&&(11!==e.kind||!ql(e.parent)))return!1;if(e.parent===t)return!0;if(275===t.kind)return!1;return!0}(e,r.declarations[0])){const e=t.getAliasedSymbol(r);if(e.declarations)return{symbol:e};i=!0}return{symbol:r,failedAliasResolution:i}}function Ole(e,t,n,r,i){const o=void 0!==i?D(t.declarations,i):t.declarations,a=!i&&(function(){if(32&t.flags&&!(19&t.flags)&&(lX(n)||137===n.kind)){const e=x(o,m_);return e&&c(e.members,!0)}}()||(_X(n)||FX(n)?c(o,!1):void 0));if(a)return a;const s=D(o,e=>!function(e){if(!Hm(e))return!1;const t=mc(e,e=>!!cb(e)||!Hm(e)&&"quit");return!!t&&5===og(t)}(e));return P(H(s)?s:o,i=>Lle(i,e,t,n,!1,r));function c(i,o){if(!i)return;const a=i.filter(o?jD:s_),s=a.filter(e=>!!e.body);return a.length?0!==s.length?s.map(r=>Lle(r,e,t,n)):[Lle(xe(a),e,t,n,!1,r)]:void 0}}function Lle(e,t,n,r,i,o){const a=t.symbolToString(n),s=Gue.getSymbolKind(t,n,r),c=n.parent?t.symbolToString(n.parent,r):"";return jle(t,e,s,a,c,i,o)}function jle(e,t,n,r,i,o,a,s){const c=t.getSourceFile();if(!s){s=WQ(Fc(t)||t,c)}return{fileName:c.fileName,textSpan:s,kind:n,name:r,containerKind:void 0,containerName:i,...jce.toContextSpan(s,c,jce.getContextNode(t)),isLocal:!Rle(e,t),isAmbient:!!(33554432&t.flags),unverified:o,failedAliasResolution:a}}function Mle(e,t){const n=jce.getContextNode(e),r=WQ(Zce(n)?n.start:n,t);return{fileName:t.fileName,textSpan:r,kind:"keyword",name:"switch",containerKind:void 0,containerName:"",...jce.toContextSpan(r,t,n),isLocal:!0,isAmbient:!1,unverified:!1,failedAliasResolution:void 0}}function Rle(e,t){if(e.isDeclarationVisible(t))return!0;if(!t.parent)return!1;if(Ou(t.parent)&&t.parent.initializer===t)return Rle(e,t.parent);switch(t.kind){case 173:case 178:case 179:case 175:if(Pv(t,2))return!1;case 177:case 304:case 305:case 211:case 232:case 220:case 219:return Rle(e,t.parent);default:return!1}}function Ble(e,t,n){return Lle(t,e,t.symbol,t,!1,n)}function Jle(e,t){return x(e,e=>js(e,t))}var zle={};o(zle,{provideInlayHints:()=>Wle});var qle=e=>new RegExp(`^\\s?/\\*\\*?\\s?${e}\\s?\\*\\/\\s?$`);function Ule(e){return"literals"===e.includeInlayParameterNameHints}function Vle(e){return!0===e.interactiveInlayHints}function Wle(e){const{file:t,program:n,span:r,cancellationToken:i,preferences:o}=e,a=t.text,s=n.getCompilerOptions(),c=hY(t,o),l=n.getTypeChecker(),_=[];return function e(n){if(!n||0===n.getFullWidth())return;switch(n.kind){case 268:case 264:case 265:case 263:case 232:case 219:case 175:case 220:i.throwIfCancellationRequested()}if(!Us(r,n.pos,n.getFullWidth()))return;if(T_(n)&&!BF(n))return;o.includeInlayVariableTypeHints&&fE(n)||o.includeInlayPropertyDeclarationTypeHints&&AD(n)?f(n):o.includeInlayEnumMemberValueHints&&uP(n)?function(e){if(e.initializer)return;const t=l.getConstantValue(e);void 0!==t&&(n=t.toString(),r=e.end,_.push({text:`= ${n}`,position:r,kind:"Enum",whitespaceBefore:!0}));var n,r}(n):function(e){return"literals"===e.includeInlayParameterNameHints||"all"===e.includeInlayParameterNameHints}(o)&&(vF(n)||bF(n))?function(e){const t=e.arguments;if(!t||!t.length)return;const n=l.getResolvedSignature(e);if(void 0===n)return;let r=0;for(const e of t){const t=_h(e);if(Ule(o)&&!h(t)){r++;continue}let i=0;if(jF(t)){const e=l.getTypeAtLocation(t.expression);if(l.isTupleType(e)){const{elementFlags:t,fixedLength:n}=e.target;if(0===n)continue;const r=S(t,e=>!(1&e));(r<0?n:r)>0&&(i=r<0?n:r)}}const a=l.getParameterIdentifierInfoAtPosition(n,r);if(r+=i||1,a){const{parameter:n,parameterName:r,isRestParameter:i}=a;if(!(o.includeInlayParameterNameHintsWhenArgumentMatchesName||!m(t,r))&&!i)continue;const s=vc(r);if(g(t,s))continue;u(s,n,e.getStart(),i)}}}(n):(o.includeInlayFunctionParameterTypeHints&&l_(n)&&JT(n)&&function(e){const t=l.getSignatureFromDeclaration(e);if(!t)return;let n=0;for(const r of e.parameters)k(r)&&v(r,dv(r)?t.thisParameter:t.parameters[n]),dv(r)||n++}(n),o.includeInlayFunctionLikeReturnTypeHints&&function(e){return CF(e)||TF(e)||gE(e)||OD(e)||MD(e)}(n)&&function(e){if(CF(e)&&!GX(e,21,t))return;if(bv(e)||!e.body)return;const n=l.getSignatureFromDeclaration(e);if(!n)return;const r=l.getTypePredicateOfSignature(n);if(null==r?void 0:r.type){const n=function(e){if(!Vle(o))return function(e){const n=71286784,r=EU();return _d(i=>{const o=l.typePredicateToTypePredicateNode(e,void 0,n);pn.assertIsDefined(o,"should always get typePredicateNode"),r.writeNode(4,o,t,i)})}(e);const n=71286784,r=l.typePredicateToTypePredicateNode(e,void 0,n);return pn.assertIsDefined(r,"should always get typenode"),x(r)}(r);if(n)return void d(n,y(e))}const i=l.getReturnTypeOfSignature(n);if(p(i))return;const a=b(i);a&&d(a,y(e))}(n));return iO(n,e)}(t),_;function u(e,t,n,r){let i,a=`${r?"...":""}${e}`;Vle(o)?(i=[T(a,t),{text:":"}],a=""):a+=":",_.push({text:a,position:n,kind:"Parameter",whitespaceAfter:!0,displayParts:i})}function d(e,t){_.push({text:"string"==typeof e?`: ${e}`:"",displayParts:"string"==typeof e?void 0:[{text:": "},...e],position:t,kind:"Type",whitespaceBefore:!0})}function p(e){return e.symbol&&1536&e.symbol.flags}function f(e){if(void 0===e.initializer&&(!AD(e)||1&l.getTypeAtLocation(e).flags)||w_(e.name)||fE(e)&&!k(e))return;if(yv(e))return;const t=l.getTypeAtLocation(e);if(p(t))return;const n=b(t);if(n){const t="string"==typeof n?n:n.map(e=>e.text).join("");if(!1===o.includeInlayVariableTypeHintsWhenTypeMatchesName&&yt(e.name.getText(),t))return;d(n,e.name.end)}}function m(e,t){return uD(e)?e.text===t:!!hF(e)&&e.name.text===t}function g(e,n){if(!vs(n,Sk(s),fk(t.scriptKind)))return!1;const r=fs(a,e.pos);if(!(null==r?void 0:r.length))return!1;const i=qle(n);return H(r,e=>i.test(a.substring(e.pos,e.end)))}function h(e){switch(e.kind){case 225:{const t=e.operand;return Ml(t)||uD(t)&&zT(t.escapedText)}case 112:case 97:case 106:case 15:case 229:return!0;case 80:{const t=e.escapedText;return function(e){return"undefined"===e}(t)||zT(t)}}return Ml(e)}function y(e){const n=GX(e,22,t);return n?n.end:e.parameters.end}function v(e,t){if(yv(e)||void 0===t)return;const n=function(e){const t=e.valueDeclaration;if(!t||!FD(t))return;const n=l.getTypeOfSymbolAtLocation(e,t);if(p(n))return;return b(n)}(t);void 0!==n&&d(n,e.questionToken?e.questionToken.end:e.name.end)}function b(e){if(!Vle(o))return function(e){const n=EU();return _d(r=>{const i=l.typeToTypeNode(e,void 0,71286784);pn.assertIsDefined(i,"should always get typenode"),n.writeNode(4,i,t,r)})}(e);const n=l.typeToTypeNode(e,void 0,71286784);return pn.assertIsDefined(n,"should always get typeNode"),x(n)}function x(e){const t=[];return n(e),t;function n(e){var a,s;if(!e)return;const c=Ia(e.kind);if(c)t.push({text:c});else if(Ml(e))t.push({text:o(e)});else switch(e.kind){case 80:pn.assertNode(e,uD);const c=bc(e),l=e.symbol&&e.symbol.declarations&&e.symbol.declarations.length&&Fc(e.symbol.declarations[0]);l?t.push(T(c,l)):t.push({text:c});break;case 167:pn.assertNode(e,wD),n(e.left),t.push({text:"."}),n(e.right);break;case 183:pn.assertNode(e,qD),e.assertsModifier&&t.push({text:"asserts "}),n(e.parameterName),e.type&&(t.push({text:" is "}),n(e.type));break;case 184:pn.assertNode(e,UD),n(e.typeName),e.typeArguments&&(t.push({text:"<"}),i(e.typeArguments,", "),t.push({text:">"}));break;case 169:pn.assertNode(e,DD),e.modifiers&&i(e.modifiers," "),n(e.name),e.constraint&&(t.push({text:" extends "}),n(e.constraint)),e.default&&(t.push({text:" = "}),n(e.default));break;case 170:pn.assertNode(e,FD),e.modifiers&&i(e.modifiers," "),e.dotDotDotToken&&t.push({text:"..."}),n(e.name),e.questionToken&&t.push({text:"?"}),e.type&&(t.push({text:": "}),n(e.type));break;case 186:pn.assertNode(e,WD),t.push({text:"new "}),r(e),t.push({text:" => "}),n(e.type);break;case 187:pn.assertNode(e,$D),t.push({text:"typeof "}),n(e.exprName),e.typeArguments&&(t.push({text:"<"}),i(e.typeArguments,", "),t.push({text:">"}));break;case 188:pn.assertNode(e,HD),t.push({text:"{"}),e.members.length&&(t.push({text:" "}),i(e.members,"; "),t.push({text:" "})),t.push({text:"}"});break;case 189:pn.assertNode(e,KD),n(e.elementType),t.push({text:"[]"});break;case 190:pn.assertNode(e,GD),t.push({text:"["}),i(e.elements,", "),t.push({text:"]"});break;case 203:pn.assertNode(e,XD),e.dotDotDotToken&&t.push({text:"..."}),n(e.name),e.questionToken&&t.push({text:"?"}),t.push({text:": "}),n(e.type);break;case 191:pn.assertNode(e,QD),n(e.type),t.push({text:"?"});break;case 192:pn.assertNode(e,YD),t.push({text:"..."}),n(e.type);break;case 193:pn.assertNode(e,ZD),i(e.types," | ");break;case 194:pn.assertNode(e,eF),i(e.types," & ");break;case 195:pn.assertNode(e,tF),n(e.checkType),t.push({text:" extends "}),n(e.extendsType),t.push({text:" ? "}),n(e.trueType),t.push({text:" : "}),n(e.falseType);break;case 196:pn.assertNode(e,nF),t.push({text:"infer "}),n(e.typeParameter);break;case 197:pn.assertNode(e,rF),t.push({text:"("}),n(e.type),t.push({text:")"});break;case 199:pn.assertNode(e,oF),t.push({text:`${Ia(e.operator)} `}),n(e.type);break;case 200:pn.assertNode(e,aF),n(e.objectType),t.push({text:"["}),n(e.indexType),t.push({text:"]"});break;case 201:pn.assertNode(e,sF),t.push({text:"{ "}),e.readonlyToken&&(40===e.readonlyToken.kind?t.push({text:"+"}):41===e.readonlyToken.kind&&t.push({text:"-"}),t.push({text:"readonly "})),t.push({text:"["}),n(e.typeParameter),e.nameType&&(t.push({text:" as "}),n(e.nameType)),t.push({text:"]"}),e.questionToken&&(40===e.questionToken.kind?t.push({text:"+"}):41===e.questionToken.kind&&t.push({text:"-"}),t.push({text:"?"})),t.push({text:": "}),e.type&&n(e.type),t.push({text:"; }"});break;case 202:pn.assertNode(e,cF),n(e.literal);break;case 185:pn.assertNode(e,VD),r(e),t.push({text:" => "}),n(e.type);break;case 206:pn.assertNode(e,lF),e.isTypeOf&&t.push({text:"typeof "}),t.push({text:"import("}),n(e.argument),e.assertions&&(t.push({text:", { assert: "}),i(e.assertions.assertClause.elements,", "),t.push({text:" }"})),t.push({text:")"}),e.qualifier&&(t.push({text:"."}),n(e.qualifier)),e.typeArguments&&(t.push({text:"<"}),i(e.typeArguments,", "),t.push({text:">"}));break;case 172:pn.assertNode(e,PD),(null==(a=e.modifiers)?void 0:a.length)&&(i(e.modifiers," "),t.push({text:" "})),n(e.name),e.questionToken&&t.push({text:"?"}),e.type&&(t.push({text:": "}),n(e.type));break;case 182:pn.assertNode(e,zD),t.push({text:"["}),i(e.parameters,", "),t.push({text:"]"}),e.type&&(t.push({text:": "}),n(e.type));break;case 174:pn.assertNode(e,ID),(null==(s=e.modifiers)?void 0:s.length)&&(i(e.modifiers," "),t.push({text:" "})),n(e.name),e.questionToken&&t.push({text:"?"}),r(e),e.type&&(t.push({text:": "}),n(e.type));break;case 180:pn.assertNode(e,BD),r(e),e.type&&(t.push({text:": "}),n(e.type));break;case 181:pn.assertNode(e,JD),t.push({text:"new "}),r(e),e.type&&(t.push({text:": "}),n(e.type));break;case 208:pn.assertNode(e,pF),t.push({text:"["}),i(e.elements,", "),t.push({text:"]"});break;case 207:pn.assertNode(e,dF),t.push({text:"{"}),e.elements.length&&(t.push({text:" "}),i(e.elements,", "),t.push({text:" "})),t.push({text:"}"});break;case 209:pn.assertNode(e,fF),n(e.name);break;case 225:pn.assertNode(e,EF),t.push({text:Ia(e.operator)}),n(e.operand);break;case 204:pn.assertNode(e,uF),n(e.head),e.templateSpans.forEach(n);break;case 16:pn.assertNode(e,YN),t.push({text:o(e)});break;case 205:pn.assertNode(e,_F),n(e.type),n(e.literal);break;case 17:pn.assertNode(e,ZN),t.push({text:o(e)});break;case 18:pn.assertNode(e,eD),t.push({text:o(e)});break;case 198:pn.assertNode(e,iF),t.push({text:"this"});break;case 168:pn.assertNode(e,ND),t.push({text:"["}),n(e.expression),t.push({text:"]"});break;default:pn.failBadSyntaxKind(e)}}function r(e){e.typeParameters&&(t.push({text:"<"}),i(e.typeParameters,", "),t.push({text:">"})),t.push({text:"("}),i(e.parameters,", "),t.push({text:")"})}function i(e,r){e.forEach((e,i)=>{i>0&&t.push({text:r}),n(e)})}function o(e){switch(e.kind){case 11:return 0===c?`'${Cy(e.text,39)}'`:`"${Cy(e.text,34)}"`;case 16:case 17:case 18:{const t=e.rawText??gy(Cy(e.text,96));switch(e.kind){case 16:return"`"+t+"${";case 17:return"}"+t+"${";case 18:return"}"+t+"`"}}}return e.text}}function k(e){if((ty(e)||fE(e)&&_f(e))&&e.initializer){const t=_h(e.initializer);return!(h(t)||bF(t)||gF(t)||G_(t))}return!0}function T(e,t){const n=t.getSourceFile();return{text:e,span:WQ(t,n),file:n.fileName}}}var $le={};o($le,{getDocCommentTemplateAtPosition:()=>l_e,getJSDocParameterNameCompletionDetails:()=>c_e,getJSDocParameterNameCompletions:()=>s_e,getJSDocTagCompletionDetails:()=>a_e,getJSDocTagCompletions:()=>o_e,getJSDocTagNameCompletionDetails:()=>i_e,getJSDocTagNameCompletions:()=>r_e,getJsDocCommentsFromDeclarations:()=>Xle,getJsDocTagsFromDeclarations:()=>Yle});var Hle,Kle,Gle=["abstract","access","alias","argument","async","augments","author","borrows","callback","class","classdesc","constant","constructor","constructs","copyright","default","deprecated","description","emits","enum","event","example","exports","extends","external","field","file","fileoverview","fires","function","generator","global","hideconstructor","host","ignore","implements","import","inheritdoc","inner","instance","interface","kind","lends","license","link","linkcode","linkplain","listens","member","memberof","method","mixes","module","name","namespace","overload","override","package","param","private","prop","property","protected","public","readonly","requires","returns","satisfies","see","since","static","summary","template","this","throws","todo","tutorial","type","typedef","var","variation","version","virtual","yields"];function Xle(e,t){const n=[];return AY(e,e=>{for(const r of function(e){switch(e.kind){case 342:case 349:return[e];case 339:case 347:return[e,e.parent];case 324:if(JP(e.parent))return[e.parent.parent];default:return Jg(e)}}(e)){const i=DP(r)&&r.tags&&x(r.tags,e=>328===e.kind&&("inheritDoc"===e.tagName.escapedText||"inheritdoc"===e.tagName.escapedText));if(void 0===r.comment&&!i||DP(r)&&347!==e.kind&&339!==e.kind&&r.tags&&r.tags.some(e=>347===e.kind||339===e.kind)&&!r.tags.some(e=>342===e.kind||343===e.kind))continue;let o=r.comment?t_e(r.comment,t):[];i&&i.comment&&(o=o.concat(t_e(i.comment,t))),C(n,o,Qle)||n.push(o)}}),O(v(n,[nZ()]))}function Qle(e,t){return re(e,t,(e,t)=>e.kind===t.kind&&e.text===t.text)}function Yle(e,t){const n=[];return AY(e,e=>{const r=ll(e);if(!r.some(e=>347===e.kind||339===e.kind)||r.some(e=>342===e.kind||343===e.kind))for(const e of r)n.push({name:e.tagName.text,text:n_e(e,t)}),n.push(...Zle(e_e(e),t))}),n}function Zle(e,t){return L(e,e=>G([{name:e.tagName.text,text:n_e(e,t)}],Zle(e_e(e),t)))}function e_e(e){return Pl(e)&&e.isNameFirst&&e.typeExpression&&FP(e.typeExpression.type)?e.typeExpression.type.jsDocPropertyTags:void 0}function t_e(e,t){return"string"==typeof e?[KY(e)]:L(e,e=>322===e.kind?[KY(e.text)]:ZY(e,t))}function n_e(e,t){const{comment:n,kind:r}=e,i=function(e){switch(e){case 342:return WY;case 349:return $Y;case 346:return XY;case 347:case 339:return GY;default:return KY}}(r);switch(r){case 350:const r=e.typeExpression;return r?o(r):void 0===n?void 0:t_e(n,t);case 330:case 329:return o(e.class);case 346:const a=e,s=[];if(a.constraint&&s.push(KY(a.constraint.getText())),d(a.typeParameters)){d(s)&&s.push(zY());const e=a.typeParameters[a.typeParameters.length-1];p(a.typeParameters,t=>{s.push(i(t.getText())),e!==t&&s.push(UY(28),zY())})}return n&&s.push(zY(),...t_e(n,t)),s;case 345:case 351:return o(e.typeExpression);case 347:case 339:case 349:case 342:case 348:const{name:c}=e;return c?o(c):void 0===n?void 0:t_e(n,t);default:return void 0===n?void 0:t_e(n,t)}function o(e){return r=e.getText(),n?r.match(/^https?$/)?[KY(r),...t_e(n,t)]:[i(r),zY(),...t_e(n,t)]:[KY(r)];var r}}function r_e(){return Hle||(Hle=P(Gle,e=>({name:e,kind:"keyword",kindModifiers:"",sortText:Oae.SortText.LocationPriority})))}var i_e=a_e;function o_e(){return Kle||(Kle=P(Gle,e=>({name:`@${e}`,kind:"keyword",kindModifiers:"",sortText:Oae.SortText.LocationPriority})))}function a_e(e){return{name:e,kind:"",kindModifiers:"",displayParts:[KY(e)],documentation:_,tags:void 0,codeActions:void 0}}function s_e(e){if(!uD(e.name))return _;const t=e.name.text,n=e.parent,r=n.parent;return s_(r)?J(r.parameters,r=>{if(!uD(r.name))return;const i=r.name.text;return n.tags.some(t=>t!==e&&VP(t)&&uD(t.name)&&t.name.escapedText===i)||void 0!==t&&!Qt(i,t)?void 0:{name:i,kind:"parameter",kindModifiers:"",sortText:Oae.SortText.LocationPriority}}):[]}function c_e(e){return{name:e,kind:"parameter",kindModifiers:"",displayParts:[KY(e)],documentation:_,tags:void 0,codeActions:void 0}}function l_e(e,t,n,r){const i=lQ(t,n),o=mc(i,DP);if(o&&(void 0!==o.comment||d(o.tags)))return;const a=i.getStart(t);if(!o&&a__e(e,t))}(i,r);if(!s)return;const{commentOwner:c,parameters:l,hasReturn:_}=s,u=be(Au(c)&&c.jsDoc?c.jsDoc:void 0);if(c.getStart(t){const a=80===e.kind?e.text:"param"+o;return`${n} * @param ${t?i?"{...any} ":"{any} ":""}${a}${r}`}).join("")}(l||[],f,p,e):"")+(_?function(e,t){return`${e} * @returns${t}`}(p,e):""),g=d(ll(c))>0;if(m&&!g){const t="/**"+e+p+" * ";return{newText:t+e+m+p+" */"+(a===n?e+p:""),caretOffset:t.length}}return{newText:"/** */",caretOffset:3}}function __e(e,t){switch(e.kind){case 263:case 219:case 175:case 177:case 174:case 220:const n=e;return{commentOwner:e,parameters:n.parameters,hasReturn:u_e(n,t)};case 304:return __e(e.initializer,t);case 264:case 265:case 267:case 307:case 266:return{commentOwner:e};case 172:{const n=e;return n.type&&VD(n.type)?{commentOwner:e,parameters:n.type.parameters,hasReturn:u_e(n.type,t)}:{commentOwner:e}}case 244:{const n=e.declarationList.declarations,r=1===n.length&&n[0].initializer?function(e){for(;218===e.kind;)e=e.expression;switch(e.kind){case 219:case 220:return e;case 232:return x(e.members,jD)}}(n[0].initializer):void 0;return r?{commentOwner:e,parameters:r.parameters,hasReturn:u_e(r,t)}:{commentOwner:e}}case 308:return"quit";case 268:return 268===e.parent.kind?void 0:{commentOwner:e};case 245:return __e(e.expression,t);case 227:{const n=e;return 0===og(n)?"quit":s_(n.right)?{commentOwner:e,parameters:n.right.parameters,hasReturn:u_e(n.right,t)}:{commentOwner:e}}case 173:const r=e.initializer;if(r&&(TF(r)||CF(r)))return{commentOwner:e,parameters:r.parameters,hasReturn:u_e(r,t)}}}function u_e(e,t){return!!(null==t?void 0:t.generateReturnInDocTemplate)&&(VD(e)||CF(e)&&K_(e.body)||l_(e)&&e.body&&GF(e.body)&&!!Af(e.body,e=>e))}var d_e={};function p_e(e,t,n,r,i,o){return ide.ChangeTracker.with({host:r,formatContext:i,preferences:o},r=>{const i=t.map(t=>function(e,t){const n=[{parse:()=>cO("__mapcode_content_nodes.ts",t,e.languageVersion,!0,e.scriptKind),body:e=>e.statements},{parse:()=>cO("__mapcode_class_content_nodes.ts",`class __class {\n${t}\n}`,e.languageVersion,!0,e.scriptKind),body:e=>e.statements[0].members}],r=[];for(const{parse:e,body:t}of n){const n=e(),i=t(n);if(i.length&&0===n.parseDiagnostics.length)return i;i.length&&r.push({sourceFile:n,body:i})}r.sort((e,t)=>e.sourceFile.parseDiagnostics.length-t.sourceFile.parseDiagnostics.length);const{body:i}=r[0];return i}(e,t)),o=n&&O(n);for(const t of i)f_e(e,r,t,o)})}function f_e(e,t,n,r){f_(n[0])||x_(n[0])?function(e,t,n,r){let i;i=r&&r.length?p(r,t=>mc(lQ(e,t.start),nn(m_,yE))):x(e.statements,nn(m_,yE));if(!i)return;const o=i.members.find(e=>n.some(t=>m_e(t,e)));if(o){const r=k(i.members,e=>n.some(t=>m_e(t,e)));return p(n,g_e),void t.replaceNodeRangeWithNodes(e,o,r,n)}p(n,g_e),t.insertNodesAfter(e,i.members[i.members.length-1],n)}(e,t,n,r):function(e,t,n,r){if(!(null==r?void 0:r.length))return void t.insertNodesAtEndOfFile(e,n,!1);for(const i of r){const r=mc(lQ(e,i.start),e=>nn(GF,dP)(e)&&H(e.statements,e=>n.some(t=>m_e(t,e))));if(r){const i=r.statements.find(e=>n.some(t=>m_e(t,e)));if(i){const o=k(r.statements,e=>n.some(t=>m_e(t,e)));return p(n,g_e),void t.replaceNodeRangeWithNodes(e,i,o,n)}}}let i=e.statements;for(const t of r){const n=mc(lQ(e,t.start),GF);if(n){i=n.statements;break}}p(n,g_e),t.insertNodesAfter(e,i[i.length-1],n)}(e,t,n,r)}function m_e(e,t){var n,r,i,o,a,s;return e.kind===t.kind&&(177===e.kind?e.kind===t.kind:Nc(e)&&Nc(t)?e.name.getText()===t.name.getText():ZF(e)&&ZF(t)||tE(e)&&tE(t)?e.expression.getText()===t.expression.getText():nE(e)&&nE(t)?(null==(n=e.initializer)?void 0:n.getText())===(null==(r=t.initializer)?void 0:r.getText())&&(null==(i=e.incrementor)?void 0:i.getText())===(null==(o=t.incrementor)?void 0:o.getText())&&(null==(a=e.condition)?void 0:a.getText())===(null==(s=t.condition)?void 0:s.getText()):tu(e)&&tu(t)?e.expression.getText()===t.expression.getText()&&e.initializer.getText()===t.initializer.getText():_E(e)&&_E(t)?e.label.getText()===t.label.getText():e.getText()===t.getText())}function g_e(e){h_e(e),e.parent=void 0}function h_e(e){e.pos=-1,e.end=-1,e.forEachChild(h_e)}o(d_e,{mapCode:()=>p_e});var y_e={};function v_e(e,t,n,r,i,o){const a=ide.ChangeTracker.fromContext({host:n,formatContext:t,preferences:i}),s="SortAndCombine"===o||"All"===o,c=s,l="RemoveUnused"===o||"All"===o,_=e.statements.filter(wE),u=x_e(e,_),{comparersToTest:p,typeOrdersToTest:f}=b_e(i),m=p[0],g={moduleSpecifierComparer:"boolean"==typeof i.organizeImportsIgnoreCase?m:void 0,namedImportComparer:"boolean"==typeof i.organizeImportsIgnoreCase?m:void 0,typeOrder:i.organizeImportsTypeOrder};if("boolean"!=typeof i.organizeImportsIgnoreCase&&({comparer:g.moduleSpecifierComparer}=I_e(u,p)),!g.typeOrder||"boolean"!=typeof i.organizeImportsIgnoreCase){const e=O_e(_,p,f);if(e){const{namedImportComparer:t,typeOrder:n}=e;g.namedImportComparer=g.namedImportComparer??t,g.typeOrder=g.typeOrder??n}}u.forEach(e=>y(e,g)),"RemoveUnused"!==o&&function(e){const t=[],n=e.statements,r=d(n);let i=0,o=0;for(;ix_e(e,t))}(e).forEach(e=>v(e,g.namedImportComparer));for(const t of e.statements.filter(dp)){if(!t.body)continue;if(x_e(e,t.body.statements.filter(wE)).forEach(e=>y(e,g)),"RemoveUnused"!==o){v(t.body.statements.filter(RE),g.namedImportComparer)}}return a.getChanges();function h(r,i){if(0===d(r))return;ww(r[0],1024);const o=c?qe(r,e=>S_e(e.moduleSpecifier)):[r],l=L(s?de(o,(e,t)=>F_e(e[0].moduleSpecifier,t[0].moduleSpecifier,g.moduleSpecifierComparer??m)):o,e=>S_e(e[0].moduleSpecifier)||void 0===e[0].moduleSpecifier?i(e):e);if(0===l.length)a.deleteNodes(e,r,{leadingTriviaOption:ide.LeadingTriviaOption.Exclude,trailingTriviaOption:ide.TrailingTriviaOption.Include},!0);else{const i={leadingTriviaOption:ide.LeadingTriviaOption.Exclude,trailingTriviaOption:ide.TrailingTriviaOption.Include,suffix:tZ(n,t.options)};a.replaceNodeWithNodes(e,r[0],l,i);const o=a.nodeHasTrailingComment(e,r[0],i);a.deleteNodes(e,r.slice(1),{trailingTriviaOption:ide.TrailingTriviaOption.Include},o)}}function y(t,n){const i=n.moduleSpecifierComparer??m,o=n.namedImportComparer??m,a=q_e({organizeImportsTypeOrder:n.typeOrder??"last"},o);h(t,t=>(l&&(t=function(e,t,n){const r=n.getTypeChecker(),i=n.getCompilerOptions(),o=r.getJsxNamespace(t),a=r.getJsxFragmentFactory(t),s=!!(2&t.transformFlags),c=[];for(const n of e){const{importClause:e,moduleSpecifier:r}=n;if(!e){c.push(n);continue}let{name:i,namedBindings:o}=e;if(i&&!l(i)&&(i=void 0),o)if(IE(o))l(o.name)||(o=void 0);else{const e=o.elements.filter(e=>l(e.name));e.length$_e(e,t,i))),t))}function v(e,t){const n=q_e(i,t);h(e,e=>w_e(e,n))}}function b_e(e){return{comparersToTest:"boolean"==typeof e.organizeImportsIgnoreCase?[J_e(e,e.organizeImportsIgnoreCase)]:[J_e(e,!0),J_e(e,!1)],typeOrdersToTest:e.organizeImportsTypeOrder?[e.organizeImportsTypeOrder]:["last","inline","first"]}}function x_e(e,t){const n=bs(e.languageVersion,!1,e.languageVariant),r=[];let i=0;for(const o of t)r[i]&&k_e(e,o,n)&&i++,r[i]||(r[i]=[]),r[i].push(o);return r}function k_e(e,t,n){const r=t.getFullStart(),i=t.getStart();n.setText(e.text,r,i-r);let o=0;for(;n.getTokenStart()=2))return!0}return!1}function S_e(e){return void 0!==e&&Ju(e)?e.text:void 0}function T_e(e){let t;const n={defaultImports:[],namespaceImports:[],namedImports:[]},r={defaultImports:[],namespaceImports:[],namedImports:[]};for(const i of e){if(void 0===i.importClause){t=t||i;continue}const e=i.importClause.isTypeOnly?n:r,{name:o,namedBindings:a}=i.importClause;o&&e.defaultImports.push(i),a&&(IE(a)?e.namespaceImports.push(i):e.namedImports.push(i))}return{importWithoutClause:t,typeOnlyImports:n,regularImports:r}}function C_e(e,t,n,r){if(0===e.length)return e;const i=Ue(e,e=>{if(e.attributes){let t=e.attributes.token+" ";for(const n of de(e.attributes.elements,(e,t)=>Nt(e.name.text,t.name.text)))t+=n.name.text+":",t+=Ju(n.value)?`"${n.value.text}"`:n.value.getText()+" ";return t}return""}),o=[];for(const e in i){const a=i[e],{importWithoutClause:s,typeOnlyImports:c,regularImports:l}=T_e(a);s&&o.push(s);for(const e of[l,c]){const i=e===c,{defaultImports:a,namespaceImports:s,namedImports:l}=e;if(!i&&1===a.length&&1===s.length&&0===l.length){const e=a[0];o.push(N_e(e,e.importClause.name,s[0].importClause.namedBindings));continue}const u=de(s,(e,n)=>t(e.importClause.namedBindings.name.text,n.importClause.namedBindings.name.text));for(const e of u)o.push(N_e(e,void 0,e.importClause.namedBindings));const d=ge(a),p=ge(l),f=d??p;if(!f)continue;let m;const g=[];if(1===a.length)m=a[0].importClause.name;else for(const e of a)g.push(bw.createImportSpecifier(!1,bw.createIdentifier("default"),e.importClause.name));g.push(...A_e(l));const h=bw.createNodeArray(de(g,n),null==p?void 0:p.importClause.namedBindings.elements.hasTrailingComma),y=0===h.length?m?void 0:bw.createNamedImports(_):p?bw.updateNamedImports(p.importClause.namedBindings,h):bw.createNamedImports(h);r&&y&&(null==p?void 0:p.importClause.namedBindings)&&!Ub(p.importClause.namedBindings,r)&&ww(y,2),i&&m&&y?(o.push(N_e(f,m,void 0)),o.push(N_e(p??f,void 0,y))):o.push(N_e(f,m,y))}}return o}function w_e(e,t){if(0===e.length)return e;const{exportWithoutClause:n,namedExports:r,typeOnlyExports:i}=function(e){let t;const n=[],r=[];for(const i of e)void 0===i.exportClause?t=t||i:i.isTypeOnly?r.push(i):n.push(i);return{exportWithoutClause:t,namedExports:n,typeOnlyExports:r}}(e),o=[];n&&o.push(n);for(const e of[r,i]){if(0===e.length)continue;const n=[];n.push(...L(e,e=>e.exportClause&&BE(e.exportClause)?e.exportClause.elements:_));const r=de(n,t),i=e[0];o.push(bw.updateExportDeclaration(i,i.modifiers,i.isTypeOnly,i.exportClause&&(BE(i.exportClause)?bw.updateNamedExports(i.exportClause,r):bw.updateNamespaceExport(i.exportClause,i.exportClause.name)),i.moduleSpecifier,i.attributes))}return o}function N_e(e,t,n){return bw.updateImportDeclaration(e,e.modifiers,bw.updateImportClause(e.importClause,e.importClause.phaseModifier,t,n),e.moduleSpecifier,e.attributes)}function D_e(e,t,n,r){switch(null==r?void 0:r.organizeImportsTypeOrder){case"first":return jt(t.isTypeOnly,e.isTypeOnly)||n(e.name.text,t.name.text);case"inline":return n(e.name.text,t.name.text);default:return jt(e.isTypeOnly,t.isTypeOnly)||n(e.name.text,t.name.text)}}function F_e(e,t,n){const r=void 0===e?void 0:S_e(e),i=void 0===t?void 0:S_e(t);return jt(void 0===r,void 0===i)||jt(Fs(r),Fs(i))||n(r,i)}function E_e(e){var t;switch(e.kind){case 272:return null==(t=rt(e.moduleReference,WE))?void 0:t.expression;case 273:return e.moduleSpecifier;case 244:return e.declarationList.declarations[0].initializer.arguments[0]}}function P_e(e,t){const n=KN(t)&&t.text;return tt(n)&&H(e.moduleAugmentations,e=>KN(e)&&e.text===n)}function A_e(e){return L(e,e=>P(function(e){var t;return(null==(t=e.importClause)?void 0:t.namedBindings)&&LE(e.importClause.namedBindings)?e.importClause.namedBindings.elements:void 0}(e),e=>e.name&&e.propertyName&&Qd(e.name)===Qd(e.propertyName)?bw.updateImportSpecifier(e,e.isTypeOnly,void 0,e.name):e))}function I_e(e,t){const n=[];return e.forEach(e=>{n.push(e.map(e=>S_e(E_e(e))||""))}),j_e(n,t)}function O_e(e,t,n){let r=!1;const i=e.filter(e=>{var t,n;const i=null==(n=rt(null==(t=e.importClause)?void 0:t.namedBindings,LE))?void 0:n.elements;return!!(null==i?void 0:i.length)&&(!r&&i.some(e=>e.isTypeOnly)&&i.some(e=>!e.isTypeOnly)&&(r=!0),!0)});if(0===i.length)return;const o=i.map(e=>{var t,n;return null==(n=rt(null==(t=e.importClause)?void 0:t.namedBindings,LE))?void 0:n.elements}).filter(e=>void 0!==e);if(!r||0===n.length){const e=j_e(o.map(e=>e.map(e=>e.name.text)),t);return{namedImportComparer:e.comparer,typeOrder:1===n.length?n[0]:void 0,isSorted:e.isSorted}}const a={first:1/0,last:1/0,inline:1/0},s={first:t[0],last:t[0],inline:t[0]};for(const e of t){const t={first:0,last:0,inline:0};for(const r of o)for(const i of n)t[i]=(t[i]??0)+L_e(r,(t,n)=>D_e(t,n,e,{organizeImportsTypeOrder:i}));for(const r of n){const n=r;t[n]0&&n++;return n}function j_e(e,t){let n,r=1/0;for(const i of t){let t=0;for(const n of e){if(n.length<=1)continue;t+=L_e(n,i)}tD_e(t,r,n,e)}function U_e(e,t,n){const{comparersToTest:r,typeOrdersToTest:i}=b_e(t),o=O_e([e],r,i);let a,s=q_e(t,r[0]);if("boolean"!=typeof t.organizeImportsIgnoreCase||!t.organizeImportsTypeOrder)if(o){const{namedImportComparer:e,typeOrder:t,isSorted:n}=o;a=n,s=q_e({organizeImportsTypeOrder:t},e)}else if(n){const e=O_e(n.statements.filter(wE),r,i);if(e){const{namedImportComparer:t,typeOrder:n,isSorted:r}=e;a=r,s=q_e({organizeImportsTypeOrder:n},t)}}return{specifierComparer:s,isSorted:a}}function V_e(e,t,n){const r=we(e,t,lt,(e,t)=>$_e(e,t,n));return r<0?~r:r}function W_e(e,t,n){const r=we(e,t,lt,n);return r<0?~r:r}function $_e(e,t,n){return F_e(E_e(e),E_e(t),n)||function(e,t){return xt(M_e(e),M_e(t))}(e,t)}function H_e(e,t,n,r){const i=R_e(t);return C_e(e,i,q_e({organizeImportsTypeOrder:null==r?void 0:r.organizeImportsTypeOrder},i),n)}function K_e(e,t,n){return w_e(e,(e,r)=>D_e(e,r,R_e(t),{organizeImportsTypeOrder:(null==n?void 0:n.organizeImportsTypeOrder)??"last"}))}function G_e(e,t,n){return F_e(e,t,R_e(!!n))}o(y_e,{compareImportsOrRequireStatements:()=>$_e,compareModuleSpecifiers:()=>G_e,getImportDeclarationInsertionIndex:()=>V_e,getImportSpecifierInsertionIndex:()=>W_e,getNamedImportSpecifierComparerWithDetection:()=>U_e,getOrganizeImportsStringComparerWithDetection:()=>z_e,organizeImports:()=>v_e,testCoalesceExports:()=>K_e,testCoalesceImports:()=>H_e});var X_e={};function Q_e(e,t){const n=[];return function(e,t,n){let r=40,i=0;const o=e.statements,a=o.length;for(;i...")}function a(e){const n=Xs(e.openingFragment.getStart(t),e.closingFragment.getEnd());return iue(n,"code",n,!1,"<>...")}function s(e){if(0!==e.properties.length)return nue(e.getStart(t),e.getEnd(),"code")}function c(e){if(15!==e.kind||0!==e.text.length)return nue(e.getStart(t),e.getEnd(),"code")}function l(e,t=19){return _(e,!1,!mF(e.parent)&&!vF(e.parent),t)}function _(n,r=!1,i=!0,o=19,a=(19===o?20:24)){const s=GX(e,o,t),c=GX(e,a,t);return s&&c&&rue(s,c,n,t,r,i)}function u(e){return e.length?iue(KQ(e),"code"):void 0}function d(e){if(Qb(e.getStart(),e.getEnd(),t))return;return iue(Xs(e.getStart(),e.getEnd()),"code",WQ(e))}}(i,e);a&&n.push(a),r--,vF(i)?(r++,s(i.expression),r--,i.arguments.forEach(s),null==(o=i.typeArguments)||o.forEach(s)):ZF(i)&&i.elseStatement&&ZF(i.elseStatement)?(s(i.expression),s(i.thenStatement),r++,s(i.elseStatement),r--):i.forEachChild(s),r++}s(e.endOfFileToken)}(e,t,n),function(e,t){const n=[],r=e.getLineStarts();for(const i of r){const r=e.getLineEndOfPosition(i),o=Z_e(e.text.substring(i,r));if(o&&!DQ(e,i))if(o.isStart){const t=Xs(e.text.indexOf("//",i),r);n.push(iue(t,"region",t,!1,o.name||"#region"))}else{const e=n.pop();e&&(e.textSpan.length=r-e.textSpan.start,e.hintSpan.length=r-e.textSpan.start,t.push(e))}}}(e,n),n.sort((e,t)=>e.textSpan.start-t.textSpan.start),n}o(X_e,{collectElements:()=>Q_e});var Y_e=/^#(end)?region(.*)\r?$/;function Z_e(e){if(!Qt(e=e.trimStart(),"//"))return null;e=e.slice(2).trim();const t=Y_e.exec(e);return t?{isStart:!t[1],name:t[2].trim()}:void 0}function eue(e,t,n,r){const i=fs(t.text,e);if(!i)return;let o=-1,a=-1,s=0;const c=t.getFullText();for(const{kind:e,pos:t,end:_}of i)switch(n.throwIfCancellationRequested(),e){case 2:if(Z_e(c.slice(t,_))){l(),s=0;break}0===s&&(o=t),a=_,s++;break;case 3:l(),r.push(nue(t,_,"comment")),s=0;break;default:pn.assertNever(e)}function l(){s>1&&r.push(nue(o,a,"comment"))}l()}function tue(e,t,n,r){GN(e)||eue(e.pos,t,n,r)}function nue(e,t,n){return iue(Xs(e,t),n)}function rue(e,t,n,r,i=!1,o=!0){return iue(Xs(o?e.getFullStart():e.getStart(r),t.getEnd()),"code",WQ(n,r),i)}function iue(e,t,n=e,r=!1,i="..."){return{textSpan:e,kind:t,hintSpan:n,bannerText:i,autoCollapse:r}}var oue={};function aue(e,t,n,r){const i=aQ(sQ(t,n));if(uue(i)){const n=function(e,t,n,r,i){const o=t.getSymbolAtLocation(e);if(!o){if(Ju(e)){const r=eQ(e,t);if(r&&(128&r.flags||1048576&r.flags&&b(r.types,e=>!!(128&e.flags))))return cue(e.text,e.text,"string","",e,n)}else if(SX(e)){const t=ep(e);return cue(t,t,"label","",e,n)}return}const{declarations:a}=o;if(!a||0===a.length)return;if(a.some(e=>function(e,t){const n=t.getSourceFile();return e.isSourceFileDefaultLibrary(n)&&wo(n.fileName,".d.ts")}(r,e)))return lue(fa.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);if(uD(e)&&"default"===e.escapedText&&o.parent&&1536&o.parent.flags)return;if(Ju(e)&&Tg(e))return i.allowRenameOfImportPath?function(e,t,n){if(!Fs(e.text))return lue(fa.You_cannot_rename_a_module_via_a_global_import);const r=n.declarations&&x(n.declarations,dP);if(!r)return;const i=Bt(e.text,"/index")||Bt(e.text,"/index.js")?void 0:zt(KS(r.fileName),"/index"),o=void 0===i?r.fileName:i,a=void 0===i?"module":"directory",s=e.text.lastIndexOf("/")+1,c=Gs(e.getStart(t)+1+s,e.text.length-s);return{canRename:!0,fileToRename:o,kind:a,displayName:o,fullDisplayName:e.text,kindModifiers:"",triggerSpan:c}}(e,n,o):void 0;const s=function(e,t,n,r){if(!r.providePrefixAndSuffixTextForRename&&2097152&t.flags){const e=t.declarations&&x(t.declarations,e=>jE(e));e&&!e.propertyName&&(t=n.getAliasedSymbol(t))}const{declarations:i}=t;if(!i)return;const o=sue(e.path);if(void 0===o)return H(i,e=>GZ(e.getSourceFile().path))?fa.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:void 0;for(const e of i){const t=sue(e.getSourceFile().path);if(t){const e=Math.min(o.length,t.length);for(let n=0;n<=e;n++)if(0!==Nt(o[n],t[n]))return fa.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder}}return}(n,o,t,i);if(s)return lue(s);const c=Gue.getSymbolKind(t,o,e),l=sZ(e)||Jh(e)&&168===e.parent.kind?Iy($h(e)):void 0,_=l||t.symbolToString(o),u=l||t.getFullyQualifiedName(o);return cue(_,u,c,Gue.getSymbolModifiers(t,o),e,n)}(i,e.getTypeChecker(),t,e,r);if(n)return n}return lue(fa.You_cannot_rename_this_element)}function sue(e){const t=jo(e),n=t.lastIndexOf("node_modules");if(-1!==n)return t.slice(0,n+2)}function cue(e,t,n,r,i,o){return{canRename:!0,fileToRename:void 0,kind:n,displayName:e,fullDisplayName:t,kindModifiers:r,triggerSpan:_ue(i,o)}}function lue(e){return{canRename:!1,localizedErrorMessage:Gx(e)}}function _ue(e,t){let n=e.getStart(t),r=e.getWidth(t);return Ju(e)&&(n+=1,r-=2),Gs(n,r)}function uue(e){switch(e.kind){case 80:case 81:case 11:case 15:case 110:return!0;case 9:return EX(e);default:return!1}}o(oue,{getRenameInfo:()=>aue,nodeIsEligibleForRename:()=>uue});var due={};function pue(e,t,n,r,i){const o=e.getTypeChecker(),a=dQ(t,n);if(!a)return;const s=!!r&&"characterTyped"===r.kind;if(s&&(yQ(t,n,a)||DQ(t,n)))return;const c=!!r&&"invoked"===r.kind,l=function(e,t,n,r,i){for(let o=e;!dP(o)&&(i||!GF(o));o=o.parent){pn.assert(tx(o.parent,o),"Not a subspan",()=>`Child: ${pn.formatSyntaxKind(o.kind)}, parent: ${pn.formatSyntaxKind(o.parent.kind)}`);const e=yue(o,t,n,r);if(e)return e}return}(a,n,t,o,c);if(!l)return;i.throwIfCancellationRequested();const _=function({invocation:e,argumentCount:t},n,r,i,o){switch(e.kind){case 0:{if(o&&!function(e,t,n){if(!J_(t))return!1;const r=t.getChildren(n);switch(e.kind){case 21:return C(r,e);case 28:{const t=XX(e);return!!t&&C(r,t)}case 30:return fue(e,n,t.expression);default:return!1}}(i,e.node,r))return;const a=[],s=n.getResolvedSignatureForSignatureHelp(e.node,a,t);return 0===a.length?void 0:{kind:0,candidates:a,resolvedSignature:s}}case 1:{const{called:a}=e;if(o&&!fue(i,r,uD(a)?a.parent:a))return;const s=wQ(a,t,n);if(0!==s.length)return{kind:0,candidates:s,resolvedSignature:ye(s)};const c=n.getSymbolAtLocation(a);return c&&{kind:1,symbol:c}}case 2:return{kind:0,candidates:[e.signature],resolvedSignature:e.signature};default:return pn.assertNever(e)}}(l,o,t,a,s);return i.throwIfCancellationRequested(),_?o.runWithCancellationToken(i,e=>0===_.kind?Pue(_.candidates,_.resolvedSignature,l,t,e):function(e,{argumentCount:t,argumentsSpan:n,invocation:r,argumentIndex:i},o,a){const s=a.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);if(!s)return;const c=[Aue(e,s,a,Fue(r),o)];return{items:c,applicableSpan:n,selectedItemIndex:0,argumentIndex:i,argumentCount:t}}(_.symbol,l,t,e)):Im(t)?function(e,t,n){if(2===e.invocation.kind)return;const r=Due(e.invocation),i=hF(r)?r.name.text:void 0,o=t.getTypeChecker();return void 0===i?void 0:m(t.getSourceFiles(),t=>m(t.getNamedDeclarations().get(i),r=>{const i=r.symbol&&o.getTypeOfSymbolAtLocation(r.symbol,r),a=i&&i.getCallSignatures();if(a&&a.length)return o.runWithCancellationToken(n,n=>Pue(a,a[0],e,t,n,!0))}))}(l,e,i):void 0}function fue(e,t,n){const r=e.getFullStart();let i=e.parent;for(;i;){const e=fQ(r,t,i,!0);if(e)return tx(n,e);i=i.parent}return pn.fail("Could not find preceding token")}function mue(e,t,n,r){const i=hue(e,t,n,r);return!i||i.isTypeParameterList||0!==i.invocation.kind?void 0:{invocation:i.invocation.node,argumentCount:i.argumentCount,argumentIndex:i.argumentIndex}}function gue(e,t,n,r){const i=function(e,t,n){if(30===e.kind||21===e.kind)return{list:Nue(e.parent,e,t),argumentIndex:0};{const t=XX(e);return t&&{list:t,argumentIndex:Sue(n,t,e)}}}(e,n,r);if(!i)return;const{list:o,argumentIndex:a}=i,s=function(e,t){return Tue(e,t,void 0)}(r,o),c=function(e,t){const n=e.getFullStart(),r=ts(t.text,e.getEnd(),!1);return Gs(n,r-n)}(o,n);return{list:o,argumentIndex:a,argumentCount:s,argumentsSpan:c}}function hue(e,t,n,r){const{parent:i}=e;if(J_(i)){const t=i,o=gue(e,0,n,r);if(!o)return;const{list:a,argumentIndex:s,argumentCount:c,argumentsSpan:l}=o;return{isTypeParameterList:!!i.typeArguments&&i.typeArguments.pos===a.pos,invocation:{kind:0,node:t},argumentsSpan:l,argumentIndex:s,argumentCount:c}}if(QN(e)&&xF(i))return MQ(e,t,n)?Cue(i,0,n):void 0;if(YN(e)&&216===i.parent.kind){const r=i,o=r.parent;pn.assert(229===r.kind);return Cue(o,MQ(e,t,n)?0:1,n)}if(HF(i)&&xF(i.parent.parent)){const r=i,o=i.parent.parent;if(eD(e)&&!MQ(e,t,n))return;const a=function(e,t,n,r){if(pn.assert(n>=t.getStart(),"Assumed 'position' could not occur before node."),Jl(t))return MQ(t,n,r)?0:e+2;return e+1}(r.parent.templateSpans.indexOf(r),e,t,n);return Cue(o,a,n)}if(Tu(i)){const e=i.attributes.pos;return{isTypeParameterList:!1,invocation:{kind:0,node:i},argumentsSpan:Gs(e,ts(n.text,i.attributes.end,!1)-e),argumentIndex:0,argumentCount:1}}{const t=NQ(e,n);if(t){const{called:r,nTypeArguments:i}=t;return{isTypeParameterList:!0,invocation:{kind:1,called:r},argumentsSpan:Xs(r.getStart(n),e.end),argumentIndex:i,argumentCount:i+1}}return}}function yue(e,t,n,r){return function(e,t,n,r){const i=function(e){switch(e.kind){case 21:case 28:return e;default:return mc(e.parent,e=>!!FD(e)||!(fF(e)||dF(e)||pF(e))&&"quit")}}(e);if(void 0===i)return;const o=function(e,t,n,r){const{parent:i}=e;switch(i.kind){case 218:case 175:case 219:case 220:const n=gue(e,0,t,r);if(!n)return;const{argumentIndex:o,argumentCount:a,argumentsSpan:s}=n,c=OD(i)?r.getContextualTypeForObjectLiteralElement(i):r.getContextualType(i);return c&&{contextualType:c,argumentIndex:o,argumentCount:a,argumentsSpan:s};case 227:{const t=vue(i),n=r.getContextualType(t),o=21===e.kind?0:bue(i)-1,a=bue(t);return n&&{contextualType:n,argumentIndex:o,argumentCount:a,argumentsSpan:WQ(i)}}default:return}}(i,n,0,r);if(void 0===o)return;const{contextualType:a,argumentIndex:s,argumentCount:c,argumentsSpan:l}=o,_=a.getNonNullableType(),u=_.symbol;if(void 0===u)return;const d=be(_.getCallSignatures());if(void 0===d)return;return{isTypeParameterList:!1,invocation:{kind:2,signature:d,node:e,symbol:xue(u)},argumentsSpan:l,argumentIndex:s,argumentCount:c}}(e,0,n,r)||hue(e,t,n,r)}function vue(e){return AF(e.parent)?vue(e.parent):e}function bue(e){return AF(e.left)?bue(e.left)+1:2}function xue(e){return"__type"===e.name&&m(e.declarations,e=>{var t;return VD(e)?null==(t=rt(e.parent,_u))?void 0:t.symbol:void 0})||e}function kue(e,t){const n=t.getTypeAtLocation(e.expression);if(t.isTupleType(n)){const{elementFlags:e,fixedLength:t}=n.target;if(0===t)return 0;const r=S(e,e=>!(1&e));return r<0?t:r}return 0}function Sue(e,t,n){return Tue(e,t,n)}function Tue(e,t,n){const r=t.getChildren();let i=0,o=!1;for(const t of r){if(n&&t===n)return o||28!==t.kind||i++,i;jF(t)?(i+=kue(t,e),o=!0):28===t.kind?o?o=!1:i++:(i++,o=!0)}return n?i:r.length&&28===xe(r).kind?i+1:i}function Cue(e,t,n){const r=QN(e.template)?1:e.template.templateSpans.length+1;return 0!==t&&pn.assertLessThan(t,r),{isTypeParameterList:!1,invocation:{kind:0,node:e},argumentsSpan:wue(e,n),argumentIndex:t,argumentCount:r}}function wue(e,t){const n=e.template,r=n.getStart();let i=n.getEnd();if(229===n.kind){0===xe(n.templateSpans).literal.getFullWidth()&&(i=ts(t.text,i,!1))}return Gs(r,i-r)}function Nue(e,t,n){const r=e.getChildren(n),i=r.indexOf(t);return pn.assert(i>=0&&r.length>i+1),r[i+1]}function Due(e){return 0===e.kind?mm(e.node):e.called}function Fue(e){return 0===e.kind?e.node:1===e.kind?e.called:e.node}o(due,{getArgumentInfoForCompletions:()=>mue,getSignatureHelpItems:()=>pue});var Eue=70246400;function Pue(e,t,{isTypeParameterList:n,argumentCount:r,argumentsSpan:i,invocation:o,argumentIndex:a},s,c,l){var u;const d=Fue(o),p=2===o.kind?o.symbol:c.getSymbolAtLocation(Due(o))||l&&(null==(u=t.declaration)?void 0:u.symbol),f=p?oZ(c,p,l?s:void 0,void 0):_,m=P(e,e=>function(e,t,n,r,i,o){const a=(n?Lue:jue)(e,r,i,o);return P(a,({isVariadic:n,parameters:o,prefix:a,suffix:s})=>{const c=[...t,...a],l=[...s,...Oue(e,i,r)],_=e.getDocumentationComment(r),u=e.getJsDocTags();return{isVariadic:n,prefixDisplayParts:c,suffixDisplayParts:l,separatorDisplayParts:Iue,parameters:o,documentation:_,tags:u}})}(e,f,n,c,d,s));let g=0,h=0;for(let n=0;n1)){let e=0;for(const t of i){if(t.isVariadic||t.parameters.length>=r){g=h+e;break}e++}}h+=i.length}pn.assert(-1!==g);const y={items:j(m,lt),applicableSpan:i,selectedItemIndex:g,argumentIndex:a,argumentCount:r},v=y.items[g];if(v.isVariadic){const e=S(v.parameters,e=>!!e.isRest);-1Mue(e,n,r,i,a)),c=e.getDocumentationComment(n),l=e.getJsDocTags(n);return{isVariadic:!1,prefixDisplayParts:[...o,UY(30)],suffixDisplayParts:[UY(32)],separatorDisplayParts:Iue,parameters:s,documentation:c,tags:l}}var Iue=[UY(28),zY()];function Oue(e,t,n){return rZ(r=>{r.writePunctuation(":"),r.writeSpace(" ");const i=n.getTypePredicateOfSignature(e);i?n.writeTypePredicate(i,t,void 0,r):n.writeType(n.getReturnTypeOfSignature(e),t,void 0,r)})}function Lue(e,t,n,r){const i=(e.target||e).typeParameters,o=EU(),a=(i||_).map(e=>Mue(e,t,n,r,o)),s=e.thisParameter?[t.symbolToParameterDeclaration(e.thisParameter,n,Eue)]:[];return t.getExpandedParameters(e).map(e=>{const i=bw.createNodeArray([...s,...P(e,e=>t.symbolToParameterDeclaration(e,n,Eue))]),c=rZ(e=>{o.writeList(2576,i,r,e)});return{isVariadic:!1,parameters:a,prefix:[UY(30)],suffix:[UY(32),...c]}})}function jue(e,t,n,r){const i=EU(),o=rZ(o=>{if(e.typeParameters&&e.typeParameters.length){const a=bw.createNodeArray(e.typeParameters.map(e=>t.typeParameterToDeclaration(e,n,Eue)));i.writeList(53776,a,r,o)}}),a=t.getExpandedParameters(e),s=t.hasEffectiveRestParameter(e)?1===a.length?e=>!0:e=>{var t;return!!(e.length&&32768&(null==(t=rt(e[e.length-1],ed))?void 0:t.links.checkFlags))}:e=>!1;return a.map(e=>({isVariadic:s(e),parameters:e.map(e=>function(e,t,n,r,i){const o=rZ(o=>{const a=t.symbolToParameterDeclaration(e,n,Eue);i.writeNode(4,a,r,o)}),a=t.isOptionalParameter(e.valueDeclaration),s=ed(e)&&!!(32768&e.links.checkFlags);return{name:e.name,documentation:e.getDocumentationComment(t),displayParts:o,isOptional:a,isRest:s}}(e,t,n,r,i)),prefix:[...o,UY(21)],suffix:[UY(22)]}))}function Mue(e,t,n,r,i){const o=rZ(o=>{const a=t.typeParameterToDeclaration(e,n,Eue);i.writeNode(4,a,r,o)});return{name:e.symbol.name,documentation:e.symbol.getDocumentationComment(t),displayParts:o,isOptional:!1,isRest:!1}}var Rue={};function Bue(e,t){var n,r;let i={textSpan:Xs(t.getFullStart(),t.getEnd())},o=t;e:for(;;){const i=que(o);if(!i.length)break;for(let c=0;ce)break e;const d=ke(ms(t.text,_.end));if(d&&2===d.kind&&s(d.pos,d.end),Jue(t,e,_)){if(ru(_)&&l_(o)&&!Qb(_.getStart(t),_.getEnd(),t)&&a(_.getStart(t),_.getEnd()),GF(_)||HF(_)||YN(_)||eD(_)||l&&YN(l)||mE(_)&&XF(o)||nA(_)&&mE(o)||fE(_)&&nA(o)&&1===i.length||fP(_)||EP(_)||FP(_)){o=_;break}if(HF(o)&&u&&zl(u)){a(_.getFullStart()-2,u.getStart()+1)}const e=nA(_)&&$ue(l)&&Hue(u)&&!Qb(l.getStart(),u.getStart(),t);let s=e?l.getEnd():_.getStart();const c=e?u.getStart():Kue(t,_);if(Au(_)&&(null==(n=_.jsDoc)?void 0:n.length)&&a(ye(_.jsDoc).getStart(),c),nA(_)){const e=_.getChildren()[0];e&&Au(e)&&(null==(r=e.jsDoc)?void 0:r.length)&&e.getStart()!==_.pos&&(s=Math.min(s,ye(e.jsDoc).getStart()))}a(s,c),(KN(_)||z_(_))&&a(s+1,c-1),o=_;break}if(c===i.length-1)break e}}return i;function a(t,n){if(t!==n){const r=Xs(t,n);(!i||!FY(r,i.textSpan)&&Ws(r,e))&&(i={textSpan:r,...i&&{parent:i}})}}function s(e,n){a(e,n);let r=e;for(;47===t.text.charCodeAt(r);)r++;a(r,n)}}function Jue(e,t,n){if(pn.assert(n.pos<=t),tBue});var zue=nn(wE,CE);function que(e){var t;if(dP(e))return Uue(e.getChildAt(0).getChildren(),zue);if(sF(e)){const[t,...n]=e.getChildren(),r=pn.checkDefined(n.pop());pn.assertEqual(t.kind,19),pn.assertEqual(r.kind,20);const i=Uue(n,t=>t===e.readonlyToken||148===t.kind||t===e.questionToken||58===t.kind);return[t,Wue(Vue(Uue(i,({kind:e})=>23===e||169===e||24===e),({kind:e})=>59===e)),r]}if(PD(e)){const n=Uue(e.getChildren(),t=>t===e.name||C(e.modifiers,t)),r=321===(null==(t=n[0])?void 0:t.kind)?n[0]:void 0,i=Vue(r?n.slice(1):n,({kind:e})=>59===e);return r?[r,Wue(i)]:i}if(FD(e)){const t=Uue(e.getChildren(),t=>t===e.dotDotDotToken||t===e.name);return Vue(Uue(t,n=>n===t[0]||n===e.questionToken),({kind:e})=>64===e)}return fF(e)?Vue(e.getChildren(),({kind:e})=>64===e):e.getChildren()}function Uue(e,t){const n=[];let r;for(const i of e)t(i)?(r=r||[],r.push(i)):(r&&(n.push(Wue(r)),r=void 0),n.push(i));return r&&n.push(Wue(r)),n}function Vue(e,t,n=!0){if(e.length<2)return e;const r=S(e,t);if(-1===r)return e;const i=e.slice(0,r),o=e[r],a=xe(e),s=n&&27===a.kind,c=e.slice(r+1,s?e.length-1:void 0),l=ie([i.length?Wue(i):void 0,o,c.length?Wue(c):void 0]);return s?l.concat(a):l}function Wue(e){return pn.assertGreaterThanOrEqual(e.length,1),ET(II.createSyntaxList(e),e[0].pos,xe(e).end)}function $ue(e){const t=e&&e.kind;return 19===t||23===t||21===t||287===t}function Hue(e){const t=e&&e.kind;return 20===t||24===t||22===t||288===t}function Kue(e,t){switch(t.kind){case 342:case 339:case 349:case 347:case 344:return e.getLineEndOfPosition(t.getStart());default:return t.getEnd()}}var Gue={};o(Gue,{getSymbolDisplayPartsDocumentationAndSymbolKind:()=>nde,getSymbolKind:()=>Que,getSymbolModifiers:()=>ede});var Xue=70246400;function Que(e,t,n){const r=Yue(e,t,n);if(""!==r)return r;const i=ux(t);return 32&i?Qu(t,232)?"local class":"class":384&i?"enum":524288&i?"type":64&i?"interface":262144&i?"type parameter":8&i?"enum member":2097152&i?"alias":1536&i?"module":r}function Yue(e,t,n){const r=e.getRootSymbols(t);if(1===r.length&&8192&ye(r).flags&&0!==e.getTypeOfSymbolAtLocation(t,n).getNonNullableType().getCallSignatures().length)return"method";if(e.isUndefinedSymbol(t))return"var";if(e.isArgumentsSymbol(t))return"local var";if(110===n.kind&&K_(n)||mv(n))return"parameter";const i=ux(t);if(3&i)return MY(t)?"parameter":t.valueDeclaration&&_f(t.valueDeclaration)?"const":t.valueDeclaration&&lf(t.valueDeclaration)?"using":t.valueDeclaration&&cf(t.valueDeclaration)?"await using":p(t.declarations,df)?"let":rde(t)?"local var":"var";if(16&i)return rde(t)?"local function":"function";if(32768&i)return"getter";if(65536&i)return"setter";if(8192&i)return"method";if(16384&i)return"constructor";if(131072&i)return"index";if(4&i){if(33554432&i&&6&t.links.checkFlags){const r=p(e.getRootSymbols(t),e=>{if(98311&e.getFlags())return"property"});if(!r){return e.getTypeOfSymbolAtLocation(t,n).getCallSignatures().length?"method":"property"}return r}return"property"}return""}function Zue(e){if(e.declarations&&e.declarations.length){const[t,...n]=e.declarations,r=PQ(t,d(n)&&l0(t)&&H(n,e=>!l0(e))?65536:0);if(r)return r.split(",")}return[]}function ede(e,t){if(!t)return"";const n=new Set(Zue(t));if(2097152&t.flags){const r=e.getAliasedSymbol(t);r!==t&&p(Zue(r),e=>{n.add(e)})}return 16777216&t.flags&&n.add("optional"),n.size>0?je(n.values()).join(","):""}function tde(e,t,n,r,i,o,a,s,c,l){var u;const d=[];let f=[],g=[];const h=ux(t);let y=1&a?Yue(e,t,i):"",v=!1;const b=110===i.kind&&Cm(i)||mv(i);let k,S,T=!1;const w={canIncreaseExpansionDepth:!1,truncated:!1};let N=!1;if(110===i.kind&&!b)return{displayParts:[qY(110)],documentation:[],symbolKind:"primitive type",tags:void 0};if(""!==y||32&h||2097152&h){if("getter"===y||"setter"===y){const e=x(t.declarations,e=>e.name===i&&212!==e.kind);if(e)switch(e.kind){case 178:y="getter";break;case 179:y="setter";break;case 173:y="accessor";break;default:pn.assertNever(e)}else y="property"}let n,a;if(o??(o=b?e.getTypeAtLocation(i):e.getTypeOfSymbolAtLocation(t,i)),i.parent&&212===i.parent.kind){const e=i.parent.name;(e===i||e&&0===e.getFullWidth())&&(i=i.parent)}if(J_(i)?a=i:(cX(i)||lX(i)||i.parent&&(Tu(i.parent)||xF(i.parent))&&s_(t.valueDeclaration))&&(a=i.parent),a){n=e.getResolvedSignature(a);const i=215===a.kind||vF(a)&&108===a.expression.kind,s=i?o.getConstructSignatures():o.getCallSignatures();if(!n||C(s,n.target)||C(s,n)||(n=s.length?s[0]:void 0),n){switch(i&&32&h?(y="constructor",L(o.symbol,y)):2097152&h?(y="alias",j(y),d.push(zY()),i&&(4&n.flags&&(d.push(qY(128)),d.push(zY())),d.push(qY(105)),d.push(zY())),O(t)):L(t,y),y){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":d.push(UY(59)),d.push(zY()),16&xx(o)||!o.symbol||(le(d,oZ(e,o.symbol,r,void 0,5)),d.push(nZ())),i&&(4&n.flags&&(d.push(qY(128)),d.push(zY())),d.push(qY(105)),d.push(zY())),M(n,s,262144);break;default:M(n,s)}v=!0,T=s.length>1}}else if(FX(i)&&!(98304&h)||137===i.kind&&177===i.parent.kind){const r=i.parent;if(t.declarations&&x(t.declarations,e=>e===(137===i.kind?r.parent:r))){const i=177===r.kind?o.getNonNullableType().getConstructSignatures():o.getNonNullableType().getCallSignatures();n=e.isImplementationOfOverload(r)?i[0]:e.getSignatureFromDeclaration(r),177===r.kind?(y="constructor",L(o.symbol,y)):L(180!==r.kind||2048&o.symbol.flags||4096&o.symbol.flags?t:o.symbol,y),n&&M(n,i),v=!0,T=i.length>1}}}if(32&h&&!v&&!b){P();const e=Qu(t,232);e&&(j("local class"),d.push(zY())),I(t,a)||(e||(d.push(qY(86)),d.push(zY())),O(t),R(t,n))}if(64&h&&2&a&&(E(),I(t,a)||(d.push(qY(120)),d.push(zY()),O(t),R(t,n))),524288&h&&2&a&&(E(),d.push(qY(156)),d.push(zY()),O(t),R(t,n),d.push(zY()),d.push(VY(64)),d.push(zY()),le(d,iZ(e,i.parent&&wl(i.parent)?e.getTypeAtLocation(i.parent):e.getDeclaredTypeOfSymbol(t),r,8388608,c,l,w))),384&h&&(E(),I(t,a)||(H(t.declarations,e=>bE(e)&&af(e))&&(d.push(qY(87)),d.push(zY())),d.push(qY(94)),d.push(zY()),O(t,void 0))),1536&h&&!b&&(E(),!I(t,a))){const e=Qu(t,268),n=e&&e.name&&80===e.name.kind;d.push(qY(n?145:144)),d.push(zY()),O(t)}if(262144&h&&2&a)if(E(),d.push(UY(21)),d.push(KY("type parameter")),d.push(UY(22)),d.push(zY()),O(t),t.parent)A(),O(t.parent,r),R(t.parent,r);else{const r=Qu(t,169);if(void 0===r)return pn.fail();const i=r.parent;if(i)if(s_(i)){A();const t=e.getSignatureFromDeclaration(i);181===i.kind?(d.push(qY(105)),d.push(zY())):180!==i.kind&&i.name&&O(i.symbol),le(d,aZ(e,t,n,32))}else vE(i)&&(A(),d.push(qY(156)),d.push(zY()),O(i.symbol),R(i.symbol,n))}if(8&h){y="enum member",L(t,"enum member");const n=null==(u=t.declarations)?void 0:u[0];if(307===(null==n?void 0:n.kind)){const t=e.getConstantValue(n);void 0!==t&&(d.push(zY()),d.push(VY(64)),d.push(zY()),d.push(JY(cp(t),"number"==typeof t?7:8)))}}if(2097152&t.flags){if(E(),!v||0===f.length&&0===g.length){const n=e.getAliasedSymbol(t);if(n!==t&&n.declarations&&n.declarations.length>0){const i=n.declarations[0],s=Fc(i);if(s&&!v){const _=pp(i)&&Av(i,128),u="default"!==t.name&&!_,p=tde(e,n,Sd(i),r,s,o,a,u?t:n,c,l);d.push(...p.displayParts),d.push(nZ()),k=p.documentation,S=p.tags,w&&p.canIncreaseVerbosityLevel&&(w.canIncreaseExpansionDepth=!0)}else k=n.getContextualDocumentationComment(i,e),S=n.getJsDocTags(e)}}if(t.declarations)switch(t.declarations[0].kind){case 271:d.push(qY(95)),d.push(zY()),d.push(qY(145));break;case 278:d.push(qY(95)),d.push(zY()),d.push(qY(t.declarations[0].isExportEquals?64:90));break;case 282:d.push(qY(95));break;default:d.push(qY(102))}d.push(zY()),O(t),p(t.declarations,t=>{if(272===t.kind){const n=t;if(Dm(n))d.push(zY()),d.push(VY(64)),d.push(zY()),d.push(qY(149)),d.push(UY(21)),d.push(JY(ep(Fm(n)),8)),d.push(UY(22));else{const t=e.getSymbolAtLocation(n.moduleReference);t&&(d.push(zY()),d.push(VY(64)),d.push(zY()),O(t,r))}return!0}})}if(!v)if(""!==y){if(o)if(b?(E(),d.push(qY(110))):L(t,y),"property"===y||"accessor"===y||"getter"===y||"setter"===y||"JSX attribute"===y||3&h||"local var"===y||"index"===y||"using"===y||"await using"===y||b){if(d.push(UY(59)),d.push(zY()),o.symbol&&262144&o.symbol.flags&&"index"!==y){const t=rZ(t=>{const n=e.typeParameterToDeclaration(o,r,Xue,void 0,void 0,c,l,w);F().writeNode(4,n,Sd(hc(r)),t)},c);le(d,t)}else le(d,iZ(e,o,r,void 0,c,l,w));if(ed(t)&&t.links.target&&ed(t.links.target)&&t.links.target.links.tupleLabelDeclaration){const e=t.links.target.links.tupleLabelDeclaration;pn.assertNode(e.name,uD),d.push(zY()),d.push(UY(21)),d.push(KY(bc(e.name))),d.push(UY(22))}}else if(16&h||8192&h||16384&h||131072&h||98304&h||"method"===y){const e=o.getNonNullableType().getCallSignatures();e.length&&(M(e[0],e),T=e.length>1)}}else y=Que(e,t,i);if(0!==f.length||T||(f=t.getContextualDocumentationComment(r,e)),0===f.length&&4&h&&t.parent&&t.declarations&&p(t.parent.declarations,e=>308===e.kind))for(const n of t.declarations){if(!n.parent||227!==n.parent.kind)continue;const t=e.getSymbolAtLocation(n.parent.right);if(t&&(f=t.getDocumentationComment(e),g=t.getJsDocTags(e),f.length>0))break}if(0===f.length&&uD(i)&&t.valueDeclaration&&fF(t.valueDeclaration)){const n=t.valueDeclaration,r=n.parent,i=n.propertyName||n.name;if(uD(i)&&dF(r)){const t=$h(i),n=e.getTypeAtLocation(r);f=m(n.isUnion()?n.types:[n],n=>{const r=n.getProperty(t);return r?r.getDocumentationComment(e):void 0})||_}}0!==g.length||T||Mm(i)||(g=t.getContextualJsDocTags(r,e)),0===f.length&&k&&(f=k),0===g.length&&S&&(g=S);const D=!w.truncated&&w.canIncreaseExpansionDepth;return{displayParts:d,documentation:f,symbolKind:y,tags:0===g.length?void 0:g,canIncreaseVerbosityLevel:void 0!==l?D:void 0};function F(){return EU()}function E(){d.length&&d.push(nZ()),P()}function P(){s&&(j("alias"),d.push(zY()))}function A(){d.push(zY()),d.push(qY(103)),d.push(zY())}function I(t,n){if(N)return!0;if(function(t,n){if(void 0===l)return!1;const r=96&t.flags?e.getDeclaredTypeOfSymbol(t):e.getTypeOfSymbolAtLocation(t,i);return!(!r||e.isLibType(r))&&(0{const i=e.getEmitResolver().symbolToDeclarations(t,r,17408,c,void 0!==l?l-1:void 0,w),o=F(),a=t.valueDeclaration&&Sd(t.valueDeclaration);i.forEach((e,t)=>{t>0&&n.writeLine(),o.writeNode(4,e,a,n)})},c);return le(d,i),N=!0,!0}return!1}function O(r,i){let o;s&&r===t&&(r=s),"index"===y&&(o=e.getIndexInfosOfIndexSymbol(r));let a=[];131072&r.flags&&o?(r.parent&&(a=oZ(e,r.parent)),a.push(UY(23)),o.forEach((t,n)=>{a.push(...iZ(e,t.keyType)),n!==o.length-1&&(a.push(zY()),a.push(UY(52)),a.push(zY()))}),a.push(UY(24))):a=oZ(e,r,i||n,void 0,7),le(d,a),16777216&t.flags&&d.push(UY(58))}function L(e,t){E(),t&&(j(t),e&&!H(e.declarations,e=>CF(e)||(TF(e)||MF(e))&&!e.name)&&(d.push(zY()),O(e)))}function j(e){switch(e){case"var":case"function":case"let":case"const":case"constructor":case"using":case"await using":return void d.push(HY(e));default:return d.push(UY(21)),d.push(HY(e)),void d.push(UY(22))}}function M(t,n,i=0){le(d,aZ(e,t,r,32|i,c,l,w)),n.length>1&&(d.push(zY()),d.push(UY(21)),d.push(VY(40)),d.push(JY((n.length-1).toString(),7)),d.push(zY()),d.push(KY(2===n.length?"overload":"overloads")),d.push(UY(22))),f=t.getDocumentationComment(e),g=t.getJsDocTags(),n.length>1&&0===f.length&&0===g.length&&(f=n[0].getDocumentationComment(e),g=n[0].getJsDocTags().filter(e=>"deprecated"!==e.name))}function R(t,n){const r=rZ(r=>{const i=e.symbolToTypeParameterDeclarations(t,n,Xue);F().writeList(53776,i,Sd(hc(n)),r)});le(d,r)}}function nde(e,t,n,r,i,o=aX(i),a,s,c){return tde(e,t,n,r,i,void 0,o,a,s,c)}function rde(e){return!e.parent&&p(e.declarations,e=>{if(219===e.kind)return!0;if(261!==e.kind&&263!==e.kind)return!1;for(let t=e.parent;!Uf(t);t=t.parent)if(308===t.kind||269===t.kind)return!1;return!0})}var ide={};function ode(e){const t=e.__pos;return pn.assert("number"==typeof t),t}function ade(e,t){pn.assert("number"==typeof t),e.__pos=t}function sde(e){const t=e.__end;return pn.assert("number"==typeof t),t}function cde(e,t){pn.assert("number"==typeof t),e.__end=t}o(ide,{ChangeTracker:()=>bde,LeadingTriviaOption:()=>lde,TrailingTriviaOption:()=>_de,applyChanges:()=>Tde,assignPositionsToNode:()=>Nde,createWriter:()=>Fde,deleteNode:()=>Pde,getAdjustedEndPosition:()=>gde,isThisTypeAnnotatable:()=>yde,isValidLocationToAddComment:()=>Ede});var lde=(e=>(e[e.Exclude=0]="Exclude",e[e.IncludeAll=1]="IncludeAll",e[e.JSDoc=2]="JSDoc",e[e.StartLine=3]="StartLine",e))(lde||{}),_de=(e=>(e[e.Exclude=0]="Exclude",e[e.ExcludeWhitespace=1]="ExcludeWhitespace",e[e.Include=2]="Include",e))(_de||{});function ude(e,t){return ts(e,t,!1,!0)}var dde={leadingTriviaOption:0,trailingTriviaOption:0};function pde(e,t,n,r){return{pos:fde(e,t,r),end:gde(e,n,r)}}function fde(e,t,n,r=!1){var i,o;const{leadingTriviaOption:a}=n;if(0===a)return t.getStart(e);if(3===a){const n=t.getStart(e),r=jX(n,e);return RX(t,r)?r:n}if(2===a){const n=Sf(t,e.text);if(null==n?void 0:n.length)return jX(n[0].pos,e)}const s=t.getFullStart(),c=t.getStart(e);if(s===c)return c;const l=jX(s,e);if(jX(c,e)===l)return 1===a?s:c;if(r){const t=(null==(i=fs(e.text,s))?void 0:i[0])||(null==(o=ms(e.text,s))?void 0:o[0]);if(t)return ts(e.text,t.end,!0,!0)}const _=s>0?1:0;let u=Nd(av(e,l)+_,e);return u=ude(e.text,u),Nd(av(e,u),e)}function mde(e,t,n){const{end:r}=t,{trailingTriviaOption:i}=n;if(2===i){const n=ms(e.text,r);if(n){const r=av(e,t.end);for(const t of n){if(2===t.kind||av(e,t.pos)>r)break;if(av(e,t.end)>r)return ts(e.text,t.end,!0,!0)}}}}function gde(e,t,n){var r;const{end:i}=t,{trailingTriviaOption:o}=n;if(0===o)return i;if(1===o){const t=G(ms(e.text,i),fs(e.text,i)),n=null==(r=null==t?void 0:t[t.length-1])?void 0:r.end;return n||i}const a=mde(e,t,n);if(a)return a;const s=ts(e.text,i,!0);return s===i||2!==o&&!Ka(e.text.charCodeAt(s-1))?i:s}function hde(e,t){return!!t&&!!e.parent&&(28===t.kind||27===t.kind&&211===e.parent.kind)}function yde(e){return TF(e)||gE(e)}var vde,bde=class e{constructor(e,t){this.newLineCharacter=e,this.formatContext=t,this.changes=[],this.classesWithNodesInsertedAtStart=new Map,this.deletedNodes=[]}static fromContext(t){return new e(tZ(t.host,t.formatContext.options),t.formatContext)}static with(t,n){const r=e.fromContext(t);return n(r),r.getChanges()}pushRaw(e,t){pn.assertEqual(e.fileName,t.fileName);for(const n of t.textChanges)this.changes.push({kind:3,sourceFile:e,text:n.newText,range:GQ(n.span)})}deleteRange(e,t){this.changes.push({kind:0,sourceFile:e,range:t})}delete(e,t){this.deletedNodes.push({sourceFile:e,node:t})}deleteNode(e,t,n={leadingTriviaOption:1}){this.deleteRange(e,pde(e,t,t,n))}deleteNodes(e,t,n={leadingTriviaOption:1},r){for(const i of t){const t=fde(e,i,n,r),o=gde(e,i,n);this.deleteRange(e,{pos:t,end:o}),r=!!mde(e,i,n)}}deleteModifier(e,t){this.deleteRange(e,{pos:t.getStart(e),end:ts(e.text,t.end,!0)})}deleteNodeRange(e,t,n,r={leadingTriviaOption:1}){const i=fde(e,t,r),o=gde(e,n,r);this.deleteRange(e,{pos:i,end:o})}deleteNodeRangeExcludingEnd(e,t,n,r={leadingTriviaOption:1}){const i=fde(e,t,r),o=void 0===n?e.text.length:fde(e,n,r);this.deleteRange(e,{pos:i,end:o})}replaceRange(e,t,n,r={}){this.changes.push({kind:1,sourceFile:e,range:t,options:r,node:n})}replaceNode(e,t,n,r=dde){this.replaceRange(e,pde(e,t,t,r),n,r)}replaceNodeRange(e,t,n,r,i=dde){this.replaceRange(e,pde(e,t,n,i),r,i)}replaceRangeWithNodes(e,t,n,r={}){this.changes.push({kind:2,sourceFile:e,range:t,options:r,nodes:n})}replaceNodeWithNodes(e,t,n,r=dde){this.replaceRangeWithNodes(e,pde(e,t,t,r),n,r)}replaceNodeWithText(e,t,n){this.replaceRangeWithText(e,pde(e,t,t,dde),n)}replaceNodeRangeWithNodes(e,t,n,r,i=dde){this.replaceRangeWithNodes(e,pde(e,t,n,i),r,i)}nodeHasTrailingComment(e,t,n=dde){return!!mde(e,t,n)}nextCommaToken(e,t){const n=pQ(t,t.parent,e);return n&&28===n.kind?n:void 0}replacePropertyAssignment(e,t,n){const r=this.nextCommaToken(e,t)?"":","+this.newLineCharacter;this.replaceNode(e,t,n,{suffix:r})}insertNodeAt(e,t,n,r={}){this.replaceRange(e,Mb(t),n,r)}insertNodesAt(e,t,n,r={}){this.replaceRangeWithNodes(e,Mb(t),n,r)}insertNodeAtTopOfFile(e,t,n){this.insertAtTopOfFile(e,t,n)}insertNodesAtTopOfFile(e,t,n){this.insertAtTopOfFile(e,t,n)}insertAtTopOfFile(e,t,n){const r=function(e){let t;for(const n of e.statements){if(!hf(n))break;t=n}let n=0;const r=e.text;if(t)return n=t.end,c(),n;const i=gs(r);void 0!==i&&(n=i.length,c());const o=fs(r,n);if(!o)return n;let a,s;for(const t of o){if(3===t.kind){if(Ud(r,t.pos)){a={range:t,pinnedOrTripleSlash:!0};continue}}else if(qd(r,t.pos,t.end)){a={range:t,pinnedOrTripleSlash:!0};continue}if(a){if(a.pinnedOrTripleSlash)break;if(e.getLineAndCharacterOfPosition(t.pos).line>=e.getLineAndCharacterOfPosition(a.range.end).line+2)break}if(e.statements.length){void 0===s&&(s=e.getLineAndCharacterOfPosition(e.statements[0].getStart()).line);if(stt(e.comment)?bw.createJSDocText(e.comment):e.comment),r=ke(t.jsDoc);return r&&Qb(r.pos,r.end,e)&&0===d(n)?void 0:bw.createNodeArray(v(n,bw.createJSDocText("\n")))}replaceJSDocComment(e,t,n){this.insertJsdocCommentBefore(e,function(e){if(220!==e.kind)return e;const t=173===e.parent.kind?e.parent:e.parent.parent;return t.jsDoc=e.jsDoc,t}(t),bw.createJSDocComment(this.createJSDocText(e,t),bw.createNodeArray(n)))}addJSDocTags(e,t,n){const r=j(t.jsDoc,e=>e.tags),i=n.filter(e=>!r.some((t,n)=>{const i=function(e,t){if(e.kind!==t.kind)return;switch(e.kind){case 342:{const n=e,r=t;return uD(n.name)&&uD(r.name)&&n.name.escapedText===r.name.escapedText?bw.createJSDocParameterTag(void 0,r.name,!1,r.typeExpression,r.isNameFirst,n.comment):void 0}case 343:return bw.createJSDocReturnTag(void 0,t.typeExpression,e.comment);case 345:return bw.createJSDocTypeTag(void 0,t.typeExpression,e.comment)}}(t,e);return i&&(r[n]=i),!!i}));this.replaceJSDocComment(e,t,[...r,...i])}filterJSDocTags(e,t,n){this.replaceJSDocComment(e,t,D(j(t.jsDoc,e=>e.tags),n))}replaceRangeWithText(e,t,n){this.changes.push({kind:3,sourceFile:e,range:t,text:n})}insertText(e,t,n){this.replaceRangeWithText(e,Mb(t),n)}tryInsertTypeAnnotation(e,t,n){let r;if(s_(t)){if(r=GX(t,22,e),!r){if(!CF(t))return!1;r=ye(t.parameters)}}else r=(261===t.kind?t.exclamationToken:t.questionToken)??t.name;return this.insertNodeAt(e,r.end,n,{prefix:": "}),!0}tryInsertThisTypeAnnotation(e,t,n){const r=GX(t,21,e).getStart(e)+1,i=t.parameters.length?", ":"";this.insertNodeAt(e,r,n,{prefix:"this: ",suffix:i})}insertTypeParameters(e,t,n){const r=(GX(t,21,e)||ye(t.parameters)).getStart(e);this.insertNodesAt(e,r,n,{prefix:"<",suffix:">",joiner:", "})}getOptionsForInsertNodeBefore(e,t,n){return hu(e)||f_(e)?{suffix:n?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}:fE(e)?{suffix:", "}:FD(e)?FD(t)?{suffix:", "}:{}:KN(e)&&wE(e.parent)||LE(e)?{suffix:", "}:jE(e)?{suffix:","+(n?this.newLineCharacter:" ")}:pn.failBadSyntaxKind(e)}insertNodeAtConstructorStart(e,t,n){const r=ge(t.body.statements);r&&t.body.multiLine?this.insertNodeBefore(e,r,n):this.replaceConstructorBody(e,t,[n,...t.body.statements])}insertNodeAtConstructorStartAfterSuperCall(e,t,n){const r=x(t.body.statements,e=>YF(e)&&pf(e.expression));r&&t.body.multiLine?this.insertNodeAfter(e,r,n):this.replaceConstructorBody(e,t,[...t.body.statements,n])}insertNodeAtConstructorEnd(e,t,n){const r=be(t.body.statements);r&&t.body.multiLine?this.insertNodeAfter(e,r,n):this.replaceConstructorBody(e,t,[...t.body.statements,n])}replaceConstructorBody(e,t,n){this.replaceNode(e,t.body,bw.createBlock(n,!0))}insertNodeAtEndOfScope(e,t,n){const r=fde(e,t.getLastToken(),{});this.insertNodeAt(e,r,n,{prefix:Ka(e.text.charCodeAt(t.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter})}insertMemberAtStart(e,t,n){this.insertNodeAtStartWorker(e,t,n)}insertNodeAtObjectStart(e,t,n){this.insertNodeAtStartWorker(e,t,n)}insertNodeAtStartWorker(e,t,n){const r=this.guessIndentationFromExistingMembers(e,t)??this.computeIndentationForNewMember(e,t);this.insertNodeAt(e,Sde(t).pos,n,this.getInsertNodeAtStartInsertOptions(e,t,r))}guessIndentationFromExistingMembers(e,t){let n,r=t;for(const i of Sde(t)){if(Vb(r,i,e))return;const t=i.getStart(e),o=Ide.SmartIndenter.findFirstNonWhitespaceColumn(jX(t,e),t,e,this.formatContext.options);if(void 0===n)n=o;else if(o!==n)return;r=i}return n}computeIndentationForNewMember(e,t){const n=t.getStart(e);return Ide.SmartIndenter.findFirstNonWhitespaceColumn(jX(n,e),n,e,this.formatContext.options)+(this.formatContext.options.indentSize??4)}getInsertNodeAtStartInsertOptions(e,t,n){const r=0===Sde(t).length,i=!this.classesWithNodesInsertedAtStart.has(_J(t));i&&this.classesWithNodesInsertedAtStart.set(_J(t),{node:t,sourceFile:e});const o=gF(t)&&(!of(e)||!r);return{indentation:n,prefix:(gF(t)&&of(e)&&r&&!i?",":"")+this.newLineCharacter,suffix:o?",":yE(t)&&r?";":""}}insertNodeAfterComma(e,t,n){const r=this.insertNodeAfterWorker(e,this.nextCommaToken(e,t)||t,n);this.insertNodeAt(e,r,n,this.getInsertNodeAfterOptions(e,t))}insertNodeAfter(e,t,n){const r=this.insertNodeAfterWorker(e,t,n);this.insertNodeAt(e,r,n,this.getInsertNodeAfterOptions(e,t))}insertNodeAtEndOfList(e,t,n){this.insertNodeAt(e,t.end,n,{prefix:", "})}insertNodesAfter(e,t,n){const r=this.insertNodeAfterWorker(e,t,ye(n));this.insertNodesAt(e,r,n,this.getInsertNodeAfterOptions(e,t))}insertNodeAfterWorker(e,t,n){var r,i;i=n,((PD(r=t)||AD(r))&&k_(i)&&168===i.name.kind||gu(r)&&gu(i))&&59!==e.text.charCodeAt(t.end-1)&&this.replaceRange(e,Mb(t.end),bw.createToken(27));return gde(e,t,{})}getInsertNodeAfterOptions(e,t){const n=this.getInsertNodeAfterOptionsWorker(t);return{...n,prefix:t.end===e.end&&hu(t)?n.prefix?`\n${n.prefix}`:"\n":n.prefix}}getInsertNodeAfterOptionsWorker(e){switch(e.kind){case 264:case 268:return{prefix:this.newLineCharacter,suffix:this.newLineCharacter};case 261:case 11:case 80:return{prefix:", "};case 304:return{suffix:","+this.newLineCharacter};case 95:return{prefix:" "};case 170:return{};default:return pn.assert(hu(e)||k_(e)),{suffix:this.newLineCharacter}}}insertName(e,t,n){if(pn.assert(!t.name),220===t.kind){const r=GX(t,39,e),i=GX(t,21,e);i?(this.insertNodesAt(e,i.getStart(e),[bw.createToken(100),bw.createIdentifier(n)],{joiner:" "}),Pde(this,e,r)):(this.insertText(e,ye(t.parameters).getStart(e),`function ${n}(`),this.replaceRange(e,r,bw.createToken(22))),242!==t.body.kind&&(this.insertNodesAt(e,t.body.getStart(e),[bw.createToken(19),bw.createToken(107)],{joiner:" ",suffix:" "}),this.insertNodesAt(e,t.body.end,[bw.createToken(27),bw.createToken(20)],{joiner:" "}))}else{const r=GX(t,219===t.kind?100:86,e).end;this.insertNodeAt(e,r,bw.createIdentifier(n),{prefix:" "})}}insertExportModifier(e,t){this.insertText(e,t.getStart(e),"export ")}insertImportSpecifierAtIndex(e,t,n,r){const i=n.elements[r-1];i?this.insertNodeInListAfter(e,i,t):this.insertNodeBefore(e,n.elements[0],t,!Qb(n.elements[0].getStart(),n.parent.parent.getStart(),e))}insertNodeInListAfter(e,t,n,r=Ide.SmartIndenter.getContainingList(t,e)){if(!r)return void pn.fail("node is not a list element");const i=np(r,t);if(i<0)return;const o=t.getEnd();if(i!==r.length-1){const o=lQ(e,t.end);if(o&&hde(t,o)){const t=r[i+1],a=ude(e.text,t.getFullStart()),s=`${Ia(o.kind)}${e.text.substring(o.end,a)}`;this.insertNodesAt(e,a,[n],{suffix:s})}}else{const a=t.getStart(e),s=jX(a,e);let c,l=!1;if(1===r.length)c=28;else{const n=fQ(t.pos,e);c=hde(t,n)?n.kind:28;l=jX(r[i-1].getStart(e),e)!==s}if(!function(e,t){let n=t;for(;n{const[n,r]=function(e,t){const n=GX(e,19,t),r=GX(e,20,t);return[null==n?void 0:n.end,null==r?void 0:r.end]}(e,t);if(void 0!==n&&void 0!==r){const i=0===Sde(e).length,o=Qb(n,r,t);i&&o&&n!==r-1&&this.deleteRange(t,Mb(n,r-1)),o&&this.insertText(t,r-1,this.newLineCharacter)}})}finishDeleteDeclarations(){const e=new Set;for(const{sourceFile:t,node:n}of this.deletedNodes)this.deletedNodes.some(e=>e.sourceFile===t&&MX(e.node,n))||(Ze(n)?this.deleteRange(t,fT(t,n)):Cde.deleteDeclaration(this,e,t,n));e.forEach(t=>{const n=t.getSourceFile(),r=Ide.SmartIndenter.getContainingList(t,n);if(t!==xe(r))return;const i=T(r,t=>!e.has(t),r.length-2);-1!==i&&this.deleteRange(n,{pos:r[i].end,end:xde(n,r[i+1])})})}getChanges(e){this.finishDeleteDeclarations(),this.finishClassesWithNodesInsertedAtStart();const t=vde.getTextChangesFromChanges(this.changes,this.newLineCharacter,this.formatContext,e);return this.newFileChanges&&this.newFileChanges.forEach((e,n)=>{t.push(vde.newFileChanges(n,e,this.newLineCharacter,this.formatContext))}),t}createNewFile(e,t,n){this.insertStatementsInNewFile(t,n,e)}};function xde(e,t){return ts(e.text,fde(e,t,{leadingTriviaOption:1}),!1,!0)}function kde(e,t,n,r){const i=xde(e,r);if(void 0===n||Qb(gde(e,t,{}),i,e))return i;const o=fQ(r.getStart(e),e);if(hde(t,o)){const r=fQ(t.getStart(e),e);if(hde(n,r)){const t=ts(e.text,o.getEnd(),!0,!0);if(Qb(r.getStart(e),o.getStart(e),e))return Ka(e.text.charCodeAt(t-1))?t-1:t;if(Ka(e.text.charCodeAt(t)))return t}}return i}function Sde(e){return gF(e)?e.properties:e.members}function Tde(e,t){for(let n=t.length-1;n>=0;n--){const{span:r,newText:i}=t[n];e=`${e.substring(0,r.start)}${i}${e.substring(Is(r))}`}return e}(e=>{function t(e,t,r,i){const o=L(t,e=>e.statements.map(t=>4===t?"":n(t,e.oldFile,r).text)).join(r),a=cO("any file name",o,{languageVersion:99,jsDocParsingMode:1},!0,e);return Tde(o,Ide.formatDocument(a,i))+r}function n(e,t,n){const r=Fde(n);return IU({newLine:u0(n),neverAsciiEscape:!0,preserveSourceNewlines:!0,terminateUnterminatedLiterals:!0},r).writeNode(4,e,t,r),{text:r.getText(),node:Nde(e)}}e.getTextChangesFromChanges=function(e,t,r,i){return J(qe(e,e=>e.sourceFile.path),e=>{const o=e[0].sourceFile,a=de(e,(e,t)=>e.range.pos-t.range.pos||e.range.end-t.range.end);for(let e=0;e`${JSON.stringify(a[e].range)} and ${JSON.stringify(a[e+1].range)}`);const s=J(a,e=>{const a=KQ(e.range),s=1===e.kind?Sd(fc(e.node))??e.sourceFile:2===e.kind?Sd(fc(e.nodes[0]))??e.sourceFile:e.sourceFile,c=function(e,t,r,i,o,a){var s;if(0===e.kind)return"";if(3===e.kind)return e.text;const{options:c={},range:{pos:l}}=e,_=e=>function(e,t,r,i,{indentation:o,prefix:a,delta:s},c,l,_){const{node:u,text:d}=n(e,t,c);_&&_(u,d);const p=p0(l,t),f=void 0!==o?o:Ide.SmartIndenter.getIndentation(i,r,p,a===c||jX(i,t)===i);void 0===s&&(s=Ide.SmartIndenter.shouldIndentChildNode(p,e)&&p.indentSize||0);const m={text:d,getLineAndCharacterOfPosition(e){return Wa(this,e)}},g=Ide.formatNodeGivenIndentation(u,m,t.languageVariant,f,s,{...l,options:p});return Tde(d,g)}(e,t,r,l,c,i,o,a),u=2===e.kind?e.nodes.map(e=>Jt(_(e),i)).join((null==(s=e.options)?void 0:s.joiner)||i):_(e.node),d=void 0!==c.indentation||jX(l,t)===l?u:u.replace(/^\s+/,"");return(c.prefix||"")+d+(!c.suffix||Bt(d,c.suffix)?"":c.suffix)}(e,s,o,t,r,i);if(a.length!==c.length||!s0(s.text,c,a.start))return QQ(a,c)});return s.length>0?{fileName:o.fileName,textChanges:s}:void 0})},e.newFileChanges=function(e,n,r,i){const o=t(wS(e),n,r,i);return{fileName:e,textChanges:[QQ(Gs(0,0),o)],isNewFile:!0}},e.newFileChangesWorker=t,e.getNonformattedText=n})(vde||(vde={}));var Cde,wde={...nU,factory:lw(1|nU.factory.flags,nU.factory.baseFactory)};function Nde(e){const t=EJ(e,Nde,wde,Dde,Nde),n=iy(t)?t:Object.create(t);return ET(n,ode(e),sde(e)),n}function Dde(e,t,n,r,i){const o=xJ(e,t,n,r,i);if(!o)return o;pn.assert(e);const a=o===e?bw.createNodeArray(o.slice(0)):o;return ET(a,ode(e),sde(e)),a}function Fde(e){let t=0;const n=Ry(e);function r(e,r){if(r||!function(e){return ts(e,0)===e.length}(e)){t=n.getTextPos();let r=0;for(;$a(e.charCodeAt(e.length-r-1));)r++;t-=r}}return{onBeforeEmitNode:e=>{e&&ade(e,t)},onAfterEmitNode:e=>{e&&cde(e,t)},onBeforeEmitNodeArray:e=>{e&&ade(e,t)},onAfterEmitNodeArray:e=>{e&&cde(e,t)},onBeforeEmitToken:e=>{e&&ade(e,t)},onAfterEmitToken:e=>{e&&cde(e,t)},write:function(e){n.write(e),r(e,!1)},writeComment:function(e){n.writeComment(e)},writeKeyword:function(e){n.writeKeyword(e),r(e,!1)},writeOperator:function(e){n.writeOperator(e),r(e,!1)},writePunctuation:function(e){n.writePunctuation(e),r(e,!1)},writeTrailingSemicolon:function(e){n.writeTrailingSemicolon(e),r(e,!1)},writeParameter:function(e){n.writeParameter(e),r(e,!1)},writeProperty:function(e){n.writeProperty(e),r(e,!1)},writeSpace:function(e){n.writeSpace(e),r(e,!1)},writeStringLiteral:function(e){n.writeStringLiteral(e),r(e,!1)},writeSymbol:function(e,t){n.writeSymbol(e,t),r(e,!1)},writeLine:function(e){n.writeLine(e)},increaseIndent:function(){n.increaseIndent()},decreaseIndent:function(){n.decreaseIndent()},getText:function(){return n.getText()},rawWrite:function(e){n.rawWrite(e),r(e,!1)},writeLiteral:function(e){n.writeLiteral(e),r(e,!0)},getTextPos:function(){return n.getTextPos()},getLine:function(){return n.getLine()},getColumn:function(){return n.getColumn()},getIndent:function(){return n.getIndent()},isAtStartOfLine:function(){return n.isAtStartOfLine()},hasTrailingComment:()=>n.hasTrailingComment(),hasTrailingWhitespace:()=>n.hasTrailingWhitespace(),clear:function(){n.clear(),t=0}}}function Ede(e,t){return!(DQ(e,t)||yQ(e,t)||xQ(e,t)||kQ(e,t))}function Pde(e,t,n,r={leadingTriviaOption:1}){const i=fde(t,n,r),o=gde(t,n,r);e.deleteRange(t,{pos:i,end:o})}function Ade(e,t,n,r){const i=pn.checkDefined(Ide.SmartIndenter.getContainingList(r,n)),o=np(i,r);pn.assert(-1!==o),1!==i.length?(pn.assert(!t.has(r),"Deleting a node twice"),t.add(r),e.deleteRange(n,{pos:xde(n,r),end:o===i.length-1?gde(n,r,{}):kde(n,r,i[o-1],i[o+1])})):Pde(e,n,r)}(e=>{function t(e,t,n){if(n.parent.name){const r=pn.checkDefined(lQ(t,n.pos-1));e.deleteRange(t,{pos:r.getStart(t),end:n.end})}else{Pde(e,t,Dh(n,273))}}e.deleteDeclaration=function(e,n,r,i){switch(i.kind){case 170:{const t=i.parent;CF(t)&&1===t.parameters.length&&!GX(t,21,r)?e.replaceNodeWithText(r,i,"()"):Ade(e,n,r,i);break}case 273:case 272:Pde(e,r,i,{leadingTriviaOption:r.imports.length&&i===ye(r.imports).parent||i===x(r.statements,Np)?0:Au(i)?2:3});break;case 209:const o=i.parent;208===o.kind&&i!==xe(o.elements)?Pde(e,r,i):Ade(e,n,r,i);break;case 261:!function(e,t,n,r){const{parent:i}=r;if(300===i.kind)return void e.deleteNodeRange(n,GX(i,21,n),GX(i,22,n));if(1!==i.declarations.length)return void Ade(e,t,n,r);const o=i.parent;switch(o.kind){case 251:case 250:e.replaceNode(n,r,bw.createObjectLiteralExpression());break;case 249:Pde(e,n,i);break;case 244:Pde(e,n,o,{leadingTriviaOption:Au(o)?2:3});break;default:pn.assertNever(o)}}(e,n,r,i);break;case 169:Ade(e,n,r,i);break;case 277:const a=i.parent;1===a.elements.length?t(e,r,a):Ade(e,n,r,i);break;case 275:t(e,r,i);break;case 27:Pde(e,r,i,{trailingTriviaOption:0});break;case 100:Pde(e,r,i,{leadingTriviaOption:0});break;case 264:case 263:Pde(e,r,i,{leadingTriviaOption:Au(i)?2:3});break;default:i.parent?NE(i.parent)&&i.parent.name===i?function(e,t,n){if(n.namedBindings){const r=n.name.getStart(t),i=lQ(t,n.name.end);if(i&&28===i.kind){const n=ts(t.text,i.end,!1,!0);e.deleteRange(t,{pos:r,end:n})}else Pde(e,t,n.name)}else Pde(e,t,n.parent)}(e,r,i.parent):vF(i.parent)&&C(i.parent.arguments,i)?Ade(e,n,r,i):Pde(e,r,i):Pde(e,r,i)}}})(Cde||(Cde={}));var Ide={};o(Ide,{FormattingContext:()=>Lde,FormattingRequestKind:()=>Ode,RuleAction:()=>zde,RuleFlags:()=>qde,SmartIndenter:()=>ufe,anyContext:()=>Jde,createTextRangeWithKind:()=>hfe,formatDocument:()=>kfe,formatNodeGivenIndentation:()=>Nfe,formatOnClosingCurly:()=>xfe,formatOnEnter:()=>yfe,formatOnOpeningCurly:()=>bfe,formatOnSemicolon:()=>vfe,formatSelection:()=>Sfe,getAllRules:()=>Ude,getFormatContext:()=>rfe,getFormattingScanner:()=>Rde,getIndentationString:()=>Afe,getRangeOfEnclosingComment:()=>Pfe});var Ode=(e=>(e[e.FormatDocument=0]="FormatDocument",e[e.FormatSelection=1]="FormatSelection",e[e.FormatOnEnter=2]="FormatOnEnter",e[e.FormatOnSemicolon=3]="FormatOnSemicolon",e[e.FormatOnOpeningCurlyBrace=4]="FormatOnOpeningCurlyBrace",e[e.FormatOnClosingCurlyBrace=5]="FormatOnClosingCurlyBrace",e))(Ode||{}),Lde=class{constructor(e,t,n){this.sourceFile=e,this.formattingRequestKind=t,this.options=n}updateContext(e,t,n,r,i){this.currentTokenSpan=pn.checkDefined(e),this.currentTokenParent=pn.checkDefined(t),this.nextTokenSpan=pn.checkDefined(n),this.nextTokenParent=pn.checkDefined(r),this.contextNode=pn.checkDefined(i),this.contextNodeAllOnSameLine=void 0,this.nextNodeAllOnSameLine=void 0,this.tokensAreOnSameLine=void 0,this.contextNodeBlockIsOnOneLine=void 0,this.nextNodeBlockIsOnOneLine=void 0}ContextNodeAllOnSameLine(){return void 0===this.contextNodeAllOnSameLine&&(this.contextNodeAllOnSameLine=this.NodeIsOnOneLine(this.contextNode)),this.contextNodeAllOnSameLine}NextNodeAllOnSameLine(){return void 0===this.nextNodeAllOnSameLine&&(this.nextNodeAllOnSameLine=this.NodeIsOnOneLine(this.nextTokenParent)),this.nextNodeAllOnSameLine}TokensAreOnSameLine(){if(void 0===this.tokensAreOnSameLine){const e=this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line,t=this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;this.tokensAreOnSameLine=e===t}return this.tokensAreOnSameLine}ContextNodeBlockIsOnOneLine(){return void 0===this.contextNodeBlockIsOnOneLine&&(this.contextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.contextNode)),this.contextNodeBlockIsOnOneLine}NextNodeBlockIsOnOneLine(){return void 0===this.nextNodeBlockIsOnOneLine&&(this.nextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.nextTokenParent)),this.nextNodeBlockIsOnOneLine}NodeIsOnOneLine(e){return this.sourceFile.getLineAndCharacterOfPosition(e.getStart(this.sourceFile)).line===this.sourceFile.getLineAndCharacterOfPosition(e.getEnd()).line}BlockIsOnOneLine(e){const t=GX(e,19,this.sourceFile),n=GX(e,20,this.sourceFile);if(t&&n){return this.sourceFile.getLineAndCharacterOfPosition(t.getEnd()).line===this.sourceFile.getLineAndCharacterOfPosition(n.getStart(this.sourceFile)).line}return!1}},jde=bs(99,!1,0),Mde=bs(99,!1,1);function Rde(e,t,n,r,i){const o=1===t?Mde:jde;o.setText(e),o.resetTokenState(n);let a,s,c,l,_,u=!0;const d=i({advance:function(){_=void 0;o.getTokenFullStart()!==n?u=!!s&&4===xe(s).kind:o.scan();a=void 0,s=void 0;let e=o.getTokenFullStart();for(;ea,lastTrailingTriviaWasNewLine:()=>u,skipToEndOf:function(e){o.resetTokenState(e.end),c=o.getTokenFullStart(),l=void 0,_=void 0,u=!1,a=void 0,s=void 0},skipToStartOf:function(e){o.resetTokenState(e.pos),c=o.getTokenFullStart(),l=void 0,_=void 0,u=!1,a=void 0,s=void 0},getTokenFullStart:()=>(null==_?void 0:_.token.pos)??o.getTokenStart(),getStartPos:()=>(null==_?void 0:_.token.pos)??o.getTokenStart()});return _=void 0,o.setText(void 0),d;function p(){const e=_?_.token.kind:o.getToken();return 1!==e&&!jh(e)}function f(){return 1===(_?_.token.kind:o.getToken())}function m(e,t){return Ol(t)&&e.token.kind!==t.kind&&(e.token.kind=t.kind),e}}var Bde,Jde=_,zde=(e=>(e[e.None=0]="None",e[e.StopProcessingSpaceActions=1]="StopProcessingSpaceActions",e[e.StopProcessingTokenActions=2]="StopProcessingTokenActions",e[e.InsertSpace=4]="InsertSpace",e[e.InsertNewLine=8]="InsertNewLine",e[e.DeleteSpace=16]="DeleteSpace",e[e.DeleteToken=32]="DeleteToken",e[e.InsertTrailingSemicolon=64]="InsertTrailingSemicolon",e[e.StopAction=3]="StopAction",e[e.ModifySpaceAction=28]="ModifySpaceAction",e[e.ModifyTokenAction=96]="ModifyTokenAction",e))(zde||{}),qde=(e=>(e[e.None=0]="None",e[e.CanDeleteNewLines=1]="CanDeleteNewLines",e))(qde||{});function Ude(){const e=[];for(let t=0;t<=166;t++)1!==t&&e.push(t);function t(...t){return{tokens:e.filter(e=>!t.some(t=>t===e)),isSpecific:!1}}const n={tokens:e,isSpecific:!1},r=Wde([...e,3]),i=Wde([...e,1]),o=Hde(83,166),a=Hde(30,79),s=[103,104,165,130,142,152],c=[80,...YQ],l=r,_=Wde([80,32,3,86,95,102]),u=Wde([22,3,92,113,98,93,85]);return[...[Vde("IgnoreBeforeComment",n,[2,3],Jde,1),Vde("IgnoreAfterLineComment",2,n,Jde,1),Vde("NotSpaceBeforeColon",n,59,[Fpe,rpe,ipe],16),Vde("SpaceAfterColon",59,n,[Fpe,rpe,Lpe],4),Vde("NoSpaceBeforeQuestionMark",n,58,[Fpe,rpe,ipe],16),Vde("SpaceAfterQuestionMarkInConditionalOperator",58,n,[Fpe,spe],4),Vde("NoSpaceAfterQuestionMark",58,n,[Fpe,ape],16),Vde("NoSpaceBeforeDot",n,[25,29],[Fpe,nfe],16),Vde("NoSpaceAfterDot",[25,29],n,[Fpe],16),Vde("NoSpaceBetweenImportParenInImportType",102,21,[Fpe,Dpe],16),Vde("NoSpaceAfterUnaryPrefixOperator",[46,47,55,54],[9,10,80,21,23,19,110,105],[Fpe,rpe],16),Vde("NoSpaceAfterUnaryPreincrementOperator",46,[80,21,110,105],[Fpe],16),Vde("NoSpaceAfterUnaryPredecrementOperator",47,[80,21,110,105],[Fpe],16),Vde("NoSpaceBeforeUnaryPostincrementOperator",[80,22,24,105],46,[Fpe,Zpe],16),Vde("NoSpaceBeforeUnaryPostdecrementOperator",[80,22,24,105],47,[Fpe,Zpe],16),Vde("SpaceAfterPostincrementWhenFollowedByAdd",46,40,[Fpe,npe],4),Vde("SpaceAfterAddWhenFollowedByUnaryPlus",40,40,[Fpe,npe],4),Vde("SpaceAfterAddWhenFollowedByPreincrement",40,46,[Fpe,npe],4),Vde("SpaceAfterPostdecrementWhenFollowedBySubtract",47,41,[Fpe,npe],4),Vde("SpaceAfterSubtractWhenFollowedByUnaryMinus",41,41,[Fpe,npe],4),Vde("SpaceAfterSubtractWhenFollowedByPredecrement",41,47,[Fpe,npe],4),Vde("NoSpaceAfterCloseBrace",20,[28,27],[Fpe],16),Vde("NewLineBeforeCloseBraceInBlockContext",r,20,[upe],8),Vde("SpaceAfterCloseBrace",20,t(22),[Fpe,bpe],4),Vde("SpaceBetweenCloseBraceAndElse",20,93,[Fpe],4),Vde("SpaceBetweenCloseBraceAndWhile",20,117,[Fpe],4),Vde("NoSpaceBetweenEmptyBraceBrackets",19,20,[Fpe,kpe],16),Vde("SpaceAfterConditionalClosingParen",22,23,[xpe],4),Vde("NoSpaceBetweenFunctionKeywordAndStar",100,42,[hpe],16),Vde("SpaceAfterStarInGeneratorDeclaration",42,80,[hpe],4),Vde("SpaceAfterFunctionInFuncDecl",100,n,[mpe],4),Vde("NewLineAfterOpenBraceInBlockContext",19,n,[upe],8),Vde("SpaceAfterGetSetInMember",[139,153],80,[mpe],4),Vde("NoSpaceBetweenYieldKeywordAndStar",127,42,[Fpe,Qpe],16),Vde("SpaceBetweenYieldOrYieldStarAndOperand",[127,42],n,[Fpe,Qpe],4),Vde("NoSpaceBetweenReturnAndSemicolon",107,27,[Fpe],16),Vde("SpaceAfterCertainKeywords",[115,111,105,91,107,114,135],n,[Fpe],4),Vde("SpaceAfterLetConstInVariableDeclaration",[121,87],n,[Fpe,zpe],4),Vde("NoSpaceBeforeOpenParenInFuncCall",n,21,[Fpe,Spe,Tpe],16),Vde("SpaceBeforeBinaryKeywordOperator",n,s,[Fpe,npe],4),Vde("SpaceAfterBinaryKeywordOperator",s,n,[Fpe,npe],4),Vde("SpaceAfterVoidOperator",116,n,[Fpe,Xpe],4),Vde("SpaceBetweenAsyncAndOpenParen",134,21,[Npe,Fpe],4),Vde("SpaceBetweenAsyncAndFunctionKeyword",134,[100,80],[Fpe],4),Vde("NoSpaceBetweenTagAndTemplateString",[80,22],[15,16],[Fpe],16),Vde("SpaceBeforeJsxAttribute",n,80,[Ipe,Fpe],4),Vde("SpaceBeforeSlashInJsxOpeningElement",n,44,[Mpe,Fpe],4),Vde("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement",44,32,[Mpe,Fpe],16),Vde("NoSpaceBeforeEqualInJsxAttribute",n,64,[Ope,Fpe],16),Vde("NoSpaceAfterEqualInJsxAttribute",64,n,[Ope,Fpe],16),Vde("NoSpaceBeforeJsxNamespaceColon",80,59,[jpe],16),Vde("NoSpaceAfterJsxNamespaceColon",59,80,[jpe],16),Vde("NoSpaceAfterModuleImport",[144,149],21,[Fpe],16),Vde("SpaceAfterCertainTypeScriptKeywords",[128,129,86,138,90,94,95,96,139,119,102,120,144,145,123,125,124,148,153,126,156,161,143,140],n,[Fpe],4),Vde("SpaceBeforeCertainTypeScriptKeywords",n,[96,119,161],[Fpe],4),Vde("SpaceAfterModuleName",11,19,[Upe],4),Vde("SpaceBeforeArrow",n,39,[Fpe],4),Vde("SpaceAfterArrow",39,n,[Fpe],4),Vde("NoSpaceAfterEllipsis",26,80,[Fpe],16),Vde("NoSpaceAfterOptionalParameters",58,[22,28],[Fpe,rpe],16),Vde("NoSpaceBetweenEmptyInterfaceBraceBrackets",19,20,[Fpe,Vpe],16),Vde("NoSpaceBeforeOpenAngularBracket",c,30,[Fpe,Hpe],16),Vde("NoSpaceBetweenCloseParenAndAngularBracket",22,30,[Fpe,Hpe],16),Vde("NoSpaceAfterOpenAngularBracket",30,n,[Fpe,Hpe],16),Vde("NoSpaceBeforeCloseAngularBracket",n,32,[Fpe,Hpe],16),Vde("NoSpaceAfterCloseAngularBracket",32,[21,23,32,28],[Fpe,Hpe,gpe,Gpe],16),Vde("SpaceBeforeAt",[22,80],60,[Fpe],4),Vde("NoSpaceAfterAt",60,n,[Fpe],16),Vde("SpaceAfterDecorator",n,[128,80,95,90,86,126,125,123,124,139,153,23,42],[Bpe],4),Vde("NoSpaceBeforeNonNullAssertionOperator",n,54,[Fpe,Ype],16),Vde("NoSpaceAfterNewKeywordOnConstructorSignature",105,21,[Fpe,Wpe],16),Vde("SpaceLessThanAndNonJSXTypeAnnotation",30,30,[Fpe],4)],...[Vde("SpaceAfterConstructor",137,21,[Gde("insertSpaceAfterConstructor"),Fpe],4),Vde("NoSpaceAfterConstructor",137,21,[Qde("insertSpaceAfterConstructor"),Fpe],16),Vde("SpaceAfterComma",28,n,[Gde("insertSpaceAfterCommaDelimiter"),Fpe,Ppe,Cpe,wpe],4),Vde("NoSpaceAfterComma",28,n,[Qde("insertSpaceAfterCommaDelimiter"),Fpe,Ppe],16),Vde("SpaceAfterAnonymousFunctionKeyword",[100,42],21,[Gde("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),mpe],4),Vde("NoSpaceAfterAnonymousFunctionKeyword",[100,42],21,[Qde("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),mpe],16),Vde("SpaceAfterKeywordInControl",o,21,[Gde("insertSpaceAfterKeywordsInControlFlowStatements"),xpe],4),Vde("NoSpaceAfterKeywordInControl",o,21,[Qde("insertSpaceAfterKeywordsInControlFlowStatements"),xpe],16),Vde("SpaceAfterOpenParen",21,n,[Gde("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),Fpe],4),Vde("SpaceBeforeCloseParen",n,22,[Gde("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),Fpe],4),Vde("SpaceBetweenOpenParens",21,21,[Gde("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),Fpe],4),Vde("NoSpaceBetweenParens",21,22,[Fpe],16),Vde("NoSpaceAfterOpenParen",21,n,[Qde("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),Fpe],16),Vde("NoSpaceBeforeCloseParen",n,22,[Qde("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),Fpe],16),Vde("SpaceAfterOpenBracket",23,n,[Gde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),Fpe],4),Vde("SpaceBeforeCloseBracket",n,24,[Gde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),Fpe],4),Vde("NoSpaceBetweenBrackets",23,24,[Fpe],16),Vde("NoSpaceAfterOpenBracket",23,n,[Qde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),Fpe],16),Vde("NoSpaceBeforeCloseBracket",n,24,[Qde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),Fpe],16),Vde("SpaceAfterOpenBrace",19,n,[Zde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),lpe],4),Vde("SpaceBeforeCloseBrace",n,20,[Zde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),lpe],4),Vde("NoSpaceBetweenEmptyBraceBrackets",19,20,[Fpe,kpe],16),Vde("NoSpaceAfterOpenBrace",19,n,[Xde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),Fpe],16),Vde("NoSpaceBeforeCloseBrace",n,20,[Xde("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),Fpe],16),Vde("SpaceBetweenEmptyBraceBrackets",19,20,[Gde("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")],4),Vde("NoSpaceBetweenEmptyBraceBrackets",19,20,[Xde("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"),Fpe],16),Vde("SpaceAfterTemplateHeadAndMiddle",[16,17],n,[Gde("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),Epe],4,1),Vde("SpaceBeforeTemplateMiddleAndTail",n,[17,18],[Gde("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),Fpe],4),Vde("NoSpaceAfterTemplateHeadAndMiddle",[16,17],n,[Qde("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),Epe],16,1),Vde("NoSpaceBeforeTemplateMiddleAndTail",n,[17,18],[Qde("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),Fpe],16),Vde("SpaceAfterOpenBraceInJsxExpression",19,n,[Gde("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),Fpe,Ape],4),Vde("SpaceBeforeCloseBraceInJsxExpression",n,20,[Gde("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),Fpe,Ape],4),Vde("NoSpaceAfterOpenBraceInJsxExpression",19,n,[Qde("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),Fpe,Ape],16),Vde("NoSpaceBeforeCloseBraceInJsxExpression",n,20,[Qde("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),Fpe,Ape],16),Vde("SpaceAfterSemicolonInFor",27,n,[Gde("insertSpaceAfterSemicolonInForStatements"),Fpe,epe],4),Vde("NoSpaceAfterSemicolonInFor",27,n,[Qde("insertSpaceAfterSemicolonInForStatements"),Fpe,epe],16),Vde("SpaceBeforeBinaryOperator",n,a,[Gde("insertSpaceBeforeAndAfterBinaryOperators"),Fpe,npe],4),Vde("SpaceAfterBinaryOperator",a,n,[Gde("insertSpaceBeforeAndAfterBinaryOperators"),Fpe,npe],4),Vde("NoSpaceBeforeBinaryOperator",n,a,[Qde("insertSpaceBeforeAndAfterBinaryOperators"),Fpe,npe],16),Vde("NoSpaceAfterBinaryOperator",a,n,[Qde("insertSpaceBeforeAndAfterBinaryOperators"),Fpe,npe],16),Vde("SpaceBeforeOpenParenInFuncDecl",n,21,[Gde("insertSpaceBeforeFunctionParenthesis"),Fpe,mpe],4),Vde("NoSpaceBeforeOpenParenInFuncDecl",n,21,[Qde("insertSpaceBeforeFunctionParenthesis"),Fpe,mpe],16),Vde("NewLineBeforeOpenBraceInControl",u,19,[Gde("placeOpenBraceOnNewLineForControlBlocks"),xpe,_pe],8,1),Vde("NewLineBeforeOpenBraceInFunction",l,19,[Gde("placeOpenBraceOnNewLineForFunctions"),mpe,_pe],8,1),Vde("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock",_,19,[Gde("placeOpenBraceOnNewLineForFunctions"),ype,_pe],8,1),Vde("SpaceAfterTypeAssertion",32,n,[Gde("insertSpaceAfterTypeAssertion"),Fpe,Kpe],4),Vde("NoSpaceAfterTypeAssertion",32,n,[Qde("insertSpaceAfterTypeAssertion"),Fpe,Kpe],16),Vde("SpaceBeforeTypeAnnotation",n,[58,59],[Gde("insertSpaceBeforeTypeAnnotation"),Fpe,ope],4),Vde("NoSpaceBeforeTypeAnnotation",n,[58,59],[Qde("insertSpaceBeforeTypeAnnotation"),Fpe,ope],16),Vde("NoOptionalSemicolon",27,i,[Kde("semicolons","remove"),efe],32),Vde("OptionalSemicolon",n,i,[Kde("semicolons","insert"),tfe],64)],...[Vde("NoSpaceBeforeSemicolon",n,27,[Fpe],16),Vde("SpaceBeforeOpenBraceInControl",u,19,[Yde("placeOpenBraceOnNewLineForControlBlocks"),xpe,qpe,cpe],4,1),Vde("SpaceBeforeOpenBraceInFunction",l,19,[Yde("placeOpenBraceOnNewLineForFunctions"),mpe,ppe,qpe,cpe],4,1),Vde("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock",_,19,[Yde("placeOpenBraceOnNewLineForFunctions"),ype,qpe,cpe],4,1),Vde("NoSpaceBeforeComma",n,28,[Fpe],16),Vde("NoSpaceBeforeOpenBracket",t(134,84),23,[Fpe],16),Vde("NoSpaceAfterCloseBracket",24,n,[Fpe,Rpe],16),Vde("SpaceAfterSemicolon",27,n,[Fpe],4),Vde("SpaceBetweenForAndAwaitKeyword",99,135,[Fpe],4),Vde("SpaceBetweenDotDotDotAndTypeName",26,c,[Fpe],16),Vde("SpaceBetweenStatements",[22,92,93,84],n,[Fpe,Ppe,tpe],4),Vde("SpaceAfterTryCatchFinally",[113,85,98],19,[Fpe],4)]]}function Vde(e,t,n,r,i,o=0){return{leftTokenRange:$de(t),rightTokenRange:$de(n),rule:{debugName:e,context:r,action:i,flags:o}}}function Wde(e){return{tokens:e,isSpecific:!0}}function $de(e){return"number"==typeof e?Wde([e]):Ze(e)?Wde(e):e}function Hde(e,t,n=[]){const r=[];for(let i=e;i<=t;i++)C(n,i)||r.push(i);return Wde(r)}function Kde(e,t){return n=>n.options&&n.options[e]===t}function Gde(e){return t=>t.options&&Ee(t.options,e)&&!!t.options[e]}function Xde(e){return t=>t.options&&Ee(t.options,e)&&!t.options[e]}function Qde(e){return t=>!t.options||!Ee(t.options,e)||!t.options[e]}function Yde(e){return t=>!t.options||!Ee(t.options,e)||!t.options[e]||t.TokensAreOnSameLine()}function Zde(e){return t=>!t.options||!Ee(t.options,e)||!!t.options[e]}function epe(e){return 249===e.contextNode.kind}function tpe(e){return!epe(e)}function npe(e){switch(e.contextNode.kind){case 227:return 28!==e.contextNode.operatorToken.kind;case 228:case 195:case 235:case 282:case 277:case 183:case 193:case 194:case 239:return!0;case 209:case 266:case 272:case 278:case 261:case 170:case 307:case 173:case 172:return 64===e.currentTokenSpan.kind||64===e.nextTokenSpan.kind;case 250:case 169:return 103===e.currentTokenSpan.kind||103===e.nextTokenSpan.kind||64===e.currentTokenSpan.kind||64===e.nextTokenSpan.kind;case 251:return 165===e.currentTokenSpan.kind||165===e.nextTokenSpan.kind}return!1}function rpe(e){return!npe(e)}function ipe(e){return!ope(e)}function ope(e){const t=e.contextNode.kind;return 173===t||172===t||170===t||261===t||d_(t)}function ape(e){return!function(e){return AD(e.contextNode)&&e.contextNode.questionToken}(e)}function spe(e){return 228===e.contextNode.kind||195===e.contextNode.kind}function cpe(e){return e.TokensAreOnSameLine()||ppe(e)}function lpe(e){return 207===e.contextNode.kind||201===e.contextNode.kind||function(e){return dpe(e)&&(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}(e)}function _pe(e){return ppe(e)&&!(e.NextNodeAllOnSameLine()||e.NextNodeBlockIsOnOneLine())}function upe(e){return dpe(e)&&!(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function dpe(e){return fpe(e.contextNode)}function ppe(e){return fpe(e.nextTokenParent)}function fpe(e){if(vpe(e))return!0;switch(e.kind){case 242:case 270:case 211:case 269:return!0}return!1}function mpe(e){switch(e.contextNode.kind){case 263:case 175:case 174:case 178:case 179:case 180:case 219:case 177:case 220:case 265:return!0}return!1}function gpe(e){return!mpe(e)}function hpe(e){return 263===e.contextNode.kind||219===e.contextNode.kind}function ype(e){return vpe(e.contextNode)}function vpe(e){switch(e.kind){case 264:case 232:case 265:case 267:case 188:case 268:case 279:case 280:case 273:case 276:return!0}return!1}function bpe(e){switch(e.currentTokenParent.kind){case 264:case 268:case 267:case 300:case 269:case 256:return!0;case 242:{const t=e.currentTokenParent.parent;if(!t||220!==t.kind&&219!==t.kind)return!0}}return!1}function xpe(e){switch(e.contextNode.kind){case 246:case 256:case 249:case 250:case 251:case 248:case 259:case 247:case 255:case 300:return!0;default:return!1}}function kpe(e){return 211===e.contextNode.kind}function Spe(e){return function(e){return 214===e.contextNode.kind}(e)||function(e){return 215===e.contextNode.kind}(e)}function Tpe(e){return 28!==e.currentTokenSpan.kind}function Cpe(e){return 24!==e.nextTokenSpan.kind}function wpe(e){return 22!==e.nextTokenSpan.kind}function Npe(e){return 220===e.contextNode.kind}function Dpe(e){return 206===e.contextNode.kind}function Fpe(e){return e.TokensAreOnSameLine()&&12!==e.contextNode.kind}function Epe(e){return 12!==e.contextNode.kind}function Ppe(e){return 285!==e.contextNode.kind&&289!==e.contextNode.kind}function Ape(e){return 295===e.contextNode.kind||294===e.contextNode.kind}function Ipe(e){return 292===e.nextTokenParent.kind||296===e.nextTokenParent.kind&&292===e.nextTokenParent.parent.kind}function Ope(e){return 292===e.contextNode.kind}function Lpe(e){return 296!==e.nextTokenParent.kind}function jpe(e){return 296===e.nextTokenParent.kind}function Mpe(e){return 286===e.contextNode.kind}function Rpe(e){return!mpe(e)&&!ppe(e)}function Bpe(e){return e.TokensAreOnSameLine()&&Jv(e.contextNode)&&Jpe(e.currentTokenParent)&&!Jpe(e.nextTokenParent)}function Jpe(e){for(;e&&K_(e);)e=e.parent;return e&&171===e.kind}function zpe(e){return 262===e.currentTokenParent.kind&&e.currentTokenParent.getStart(e.sourceFile)===e.currentTokenSpan.pos}function qpe(e){return 2!==e.formattingRequestKind}function Upe(e){return 268===e.contextNode.kind}function Vpe(e){return 188===e.contextNode.kind}function Wpe(e){return 181===e.contextNode.kind}function $pe(e,t){if(30!==e.kind&&32!==e.kind)return!1;switch(t.kind){case 184:case 217:case 266:case 264:case 232:case 265:case 263:case 219:case 220:case 175:case 174:case 180:case 181:case 214:case 215:case 234:return!0;default:return!1}}function Hpe(e){return $pe(e.currentTokenSpan,e.currentTokenParent)||$pe(e.nextTokenSpan,e.nextTokenParent)}function Kpe(e){return 217===e.contextNode.kind}function Gpe(e){return!Kpe(e)}function Xpe(e){return 116===e.currentTokenSpan.kind&&223===e.currentTokenParent.kind}function Qpe(e){return 230===e.contextNode.kind&&void 0!==e.contextNode.expression}function Ype(e){return 236===e.contextNode.kind}function Zpe(e){return!function(e){switch(e.contextNode.kind){case 246:case 249:case 250:case 251:case 247:case 248:return!0;default:return!1}}(e)}function efe(e){let t=e.nextTokenSpan.kind,n=e.nextTokenSpan.pos;if(jh(t)){const r=e.nextTokenParent===e.currentTokenParent?pQ(e.currentTokenParent,mc(e.currentTokenParent,e=>!e.parent),e.sourceFile):e.nextTokenParent.getFirstToken(e.sourceFile);if(!r)return!0;t=r.kind,n=r.getStart(e.sourceFile)}return e.sourceFile.getLineAndCharacterOfPosition(e.currentTokenSpan.pos).line===e.sourceFile.getLineAndCharacterOfPosition(n).line?20===t||1===t:27===t&&27===e.currentTokenSpan.kind||241!==t&&27!==t&&(265===e.contextNode.kind||266===e.contextNode.kind?!PD(e.currentTokenParent)||!!e.currentTokenParent.type||21!==t:AD(e.currentTokenParent)?!e.currentTokenParent.initializer:249!==e.currentTokenParent.kind&&243!==e.currentTokenParent.kind&&241!==e.currentTokenParent.kind&&23!==t&&21!==t&&40!==t&&41!==t&&44!==t&&14!==t&&28!==t&&229!==t&&16!==t&&15!==t&&25!==t)}function tfe(e){return jZ(e.currentTokenSpan.end,e.currentTokenParent,e.sourceFile)}function nfe(e){return!hF(e.contextNode)||!$N(e.contextNode.expression)||e.contextNode.expression.getText().includes(".")}function rfe(e,t){return{options:e,getRules:ife(),host:t}}function ife(){return void 0===Bde&&(Bde=function(e){const t=function(e){const t=new Array(ffe*ffe),n=new Array(t.length);for(const r of e){const e=r.leftTokenRange.isSpecific&&r.rightTokenRange.isSpecific;for(const i of r.leftTokenRange.tokens)for(const o of r.rightTokenRange.tokens){const a=afe(i,o);let s=t[a];void 0===s&&(s=t[a]=[]),gfe(s,r.rule,e,n,a)}}return t}(e);return e=>{const n=t[afe(e.currentTokenSpan.kind,e.nextTokenSpan.kind)];if(n){const t=[];let r=0;for(const i of n){const n=~ofe(r);i.action&n&&b(i.context,t=>t(e))&&(t.push(i),r|=i.action)}if(t.length)return t}}}(Ude())),Bde}function ofe(e){let t=0;return 1&e&&(t|=28),2&e&&(t|=96),28&e&&(t|=28),96&e&&(t|=96),t}function afe(e,t){return pn.assert(e<=166&&t<=166,"Must compute formatting context from tokens"),e*ffe+t}var sfe,cfe,lfe,_fe,ufe,dfe=5,pfe=31,ffe=167,mfe=((sfe=mfe||{})[sfe.StopRulesSpecific=0]="StopRulesSpecific",sfe[sfe.StopRulesAny=1*dfe]="StopRulesAny",sfe[sfe.ContextRulesSpecific=2*dfe]="ContextRulesSpecific",sfe[sfe.ContextRulesAny=3*dfe]="ContextRulesAny",sfe[sfe.NoContextRulesSpecific=4*dfe]="NoContextRulesSpecific",sfe[sfe.NoContextRulesAny=5*dfe]="NoContextRulesAny",sfe);function gfe(e,t,n,r,i){const o=3&t.action?n?0:mfe.StopRulesAny:t.context!==Jde?n?mfe.ContextRulesSpecific:mfe.ContextRulesAny:n?mfe.NoContextRulesSpecific:mfe.NoContextRulesAny,a=r[i]||0;e.splice(function(e,t){let n=0;for(let r=0;r<=t;r+=dfe)n+=e&pfe,e>>=dfe;return n}(a,o),0,t),r[i]=function(e,t){const n=1+(e>>t&pfe);return pn.assert((n&pfe)===n,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."),e&~(pfe<pn.formatSyntaxKind(n)}),r}function yfe(e,t,n){const r=t.getLineAndCharacterOfPosition(e).line;if(0===r)return[];let i=Fd(r,t);for(;Ha(t.text.charCodeAt(i));)i--;Ka(t.text.charCodeAt(i))&&i--;return Ffe({pos:Nd(r-1,t),end:i+1},t,n,2)}function vfe(e,t,n){return Dfe(Cfe(Tfe(e,27,t)),t,n,3)}function bfe(e,t,n){const r=Tfe(e,19,t);if(!r)return[];return Ffe({pos:jX(Cfe(r.parent).getStart(t),t),end:e},t,n,4)}function xfe(e,t,n){return Dfe(Cfe(Tfe(e,20,t)),t,n,5)}function kfe(e,t){return Ffe({pos:0,end:e.text.length},e,t,0)}function Sfe(e,t,n,r){return Ffe({pos:jX(e,n),end:t},n,r,1)}function Tfe(e,t,n){const r=fQ(e,n);return r&&r.kind===t&&e===r.getEnd()?r:void 0}function Cfe(e){let t=e;for(;t&&t.parent&&t.parent.end===e.end&&!wfe(t.parent,t);)t=t.parent;return t}function wfe(e,t){switch(e.kind){case 264:case 265:return tx(e.members,t);case 268:const n=e.body;return!!n&&269===n.kind&&tx(n.statements,t);case 308:case 242:case 269:return tx(e.statements,t);case 300:return tx(e.block.statements,t)}return!1}function Nfe(e,t,n,r,i,o){const a={pos:e.pos,end:e.end};return Rde(t.text,n,a.pos,a.end,n=>Efe(a,e,r,i,n,o,1,e=>!1,t))}function Dfe(e,t,n,r){if(!e)return[];return Ffe({pos:jX(e.getStart(t),t),end:e.end},t,n,r)}function Ffe(e,t,n,r){const i=function(e,t){return function n(r){const i=iO(r,n=>nx(n.getStart(t),n.end,e)&&n);if(i){const e=n(i);if(e)return e}return r}(t)}(e,t);return Rde(t.text,t.languageVariant,function(e,t,n){const r=e.getStart(n);if(r===t.pos&&e.end===t.end)return r;const i=fQ(t.pos,n);return i?i.end>=t.pos?e.pos:i.end:e.pos}(i,e,t),e.end,o=>Efe(e,i,ufe.getIndentationForNode(i,e,t,n.options),function(e,t,n){let r,i=-1;for(;e;){const o=n.getLineAndCharacterOfPosition(e.getStart(n)).line;if(-1!==i&&o!==i)break;if(ufe.shouldIndentChildNode(t,e,r,n))return t.indentSize;i=o,r=e,e=e.parent}return 0}(i,n.options,t),o,n,r,function(e,t){if(!e.length)return i;const n=e.filter(e=>zX(t,e.start,e.start+e.length)).sort((e,t)=>e.start-t.start);if(!n.length)return i;let r=0;return e=>{for(;;){if(r>=n.length)return!1;const t=n[r];if(e.end<=t.start)return!1;if(UX(e.pos,e.end,t.start,t.start+t.length))return!0;r++}};function i(){return!1}}(t.parseDiagnostics,e),t))}function Efe(e,t,n,r,i,{options:o,getRules:a,host:s},c,l,_){var u;const d=new Lde(_,c,o);let p,m,g,h,y,v=-1;const b=[];if(i.advance(),i.isOnToken()){const a=_.getLineAndCharacterOfPosition(t.getStart(_)).line;let s=a;Jv(t)&&(s=_.getLineAndCharacterOfPosition($d(t,_)).line),function t(n,r,a,s,c,u){if(!zX(e,n.getStart(_),n.getEnd()))return;const d=T(n,a,c,u);let f=r;iO(n,e=>{g(e,-1,n,d,a,s,!1)},e=>{h(e,n,a,d)});for(;i.isOnToken()&&i.getTokenFullStart()Math.min(n.end,e.end))break;b(t,n,d,n)}function g(r,a,s,c,l,u,d,p){if(pn.assert(!iy(r)),Pd(r)||Id(s,r))return a;const m=r.getStart(_),g=_.getLineAndCharacterOfPosition(m).line;let h=g;Jv(r)&&(h=_.getLineAndCharacterOfPosition($d(r,_)).line);let x=-1;if(d&&tx(e,s)&&(x=function(e,t,n,r,i){if(zX(r,e,t)||JX(r,e,t)){if(-1!==i)return i}else{const t=_.getLineAndCharacterOfPosition(e).line,r=jX(e,_),i=ufe.findFirstNonWhitespaceColumn(r,e,_,o);if(t!==n||e===i){const e=ufe.getBaseIndentation(o);return e>i?e:i}}return-1}(m,r.end,l,e,a),-1!==x&&(a=x)),!zX(e,r.pos,r.end))return r.ende.end)return a;if(t.token.end>m){t.token.pos>m&&i.skipToStartOf(r);break}b(t,n,c,n)}if(!i.isOnToken()||i.getTokenFullStart()>=e.end)return a;if(Ol(r)){const e=i.readTokenInfo(r);if(12!==r.kind)return pn.assert(e.token.end===r.end,"Token end is child end"),b(e,n,c,r),a}const k=171===r.kind?g:u,S=function(e,t,n,r,i,a){const s=ufe.shouldIndentChildNode(o,e)?o.indentSize:0;return a===t?{indentation:t===y?v:i.getIndentation(),delta:Math.min(o.indentSize,i.getDelta(e)+s)}:-1===n?21===e.kind&&t===y?{indentation:v,delta:i.getDelta(e)}:ufe.childStartsOnTheSameLineWithElseInIfStatement(r,e,t,_)||ufe.childIsUnindentedBranchOfConditionalExpression(r,e,t,_)||ufe.argumentStartsOnSameLineAsPreviousArgument(r,e,t,_)?{indentation:i.getIndentation(),delta:s}:{indentation:i.getIndentation()+i.getDelta(e),delta:s}:{indentation:n,delta:s}}(r,g,x,n,c,k);return t(r,f,g,h,S.indentation,S.delta),f=n,p&&210===s.kind&&-1===a&&(a=S.indentation),a}function h(t,r,a,s){pn.assert(Ll(t)),pn.assert(!iy(t));const c=function(e,t){switch(e.kind){case 177:case 263:case 219:case 175:case 174:case 220:case 180:case 181:case 185:case 186:case 178:case 179:if(e.typeParameters===t)return 30;if(e.parameters===t)return 21;break;case 214:case 215:if(e.typeArguments===t)return 30;if(e.arguments===t)return 21;break;case 264:case 232:case 265:case 266:if(e.typeParameters===t)return 30;break;case 184:case 216:case 187:case 234:case 206:if(e.typeArguments===t)return 30;break;case 188:return 19}return 0}(r,t);let l=s,u=a;if(!zX(e,t.pos,t.end))return void(t.endt.pos)break;if(e.token.kind===c){let t;if(u=_.getLineAndCharacterOfPosition(e.token.pos).line,b(e,r,s,r),-1!==v)t=v;else{const n=jX(e.token.pos,_);t=ufe.findFirstNonWhitespaceColumn(n,e.token.pos,_,o)}l=T(r,a,t,o.indentSize)}else b(e,r,s,r)}let d=-1;for(let e=0;eF(e.pos,i,!1))}-1!==e&&n&&(F(t.token.pos,e,1===u),y=g.line,v=e)}i.advance(),f=n}}(t,t,a,s,n,r)}const k=i.getCurrentLeadingTrivia();if(k){const r=ufe.nodeWillIndentChild(o,t,void 0,_,!1)?n+o.indentSize:n;C(k,r,!0,e=>{N(e,_.getLineAndCharacterOfPosition(e.pos),t,t,void 0),F(e.pos,r,!1)}),!1!==o.trimTrailingWhitespace&&function(t){let n=m?m.end:e.pos;for(const e of t)IQ(e.kind)&&(n=e.end){const e=i.isOnEOF()?i.readEOFTokenRange():i.isOnToken()?i.readTokenInfo(t).token:void 0;if(e&&e.pos===p){const n=(null==(u=fQ(e.end,_,t))?void 0:u.parent)||g;D(e,_.getLineAndCharacterOfPosition(e.pos).line,n,m,h,g,n,void 0)}}return b;function T(e,t,n,r){return{getIndentationForComment:(e,t,r)=>{switch(e){case 20:case 24:case 22:return n+i(r)}return-1!==t?t:n},getIndentationForToken:(r,o,a,s)=>!s&&function(n,r,i){switch(r){case 19:case 20:case 22:case 93:case 117:case 60:return!1;case 44:case 32:switch(i.kind){case 287:case 288:case 286:return!1}break;case 23:case 24:if(201!==i.kind)return!1}return t!==n&&!(Jv(e)&&r===function(e){if(EI(e)){const t=x(e.modifiers,r_,S(e.modifiers,ED));if(t)return t.kind}switch(e.kind){case 264:return 86;case 265:return 120;case 263:return 100;case 267:return 267;case 178:return 139;case 179:return 153;case 175:if(e.asteriskToken)return 42;case 173:case 170:const t=Fc(e);if(t)return t.kind}}(e))}(r,o,a)?n+i(a):n,getIndentation:()=>n,getDelta:i,recomputeIndentation:(t,i)=>{ufe.shouldIndentChildNode(o,i,e,_)&&(n+=t?o.indentSize:-o.indentSize,r=ufe.shouldIndentChildNode(o,e)?o.indentSize:0)}};function i(t){return ufe.nodeWillIndentChild(o,e,t,_,!0)?r:0}}function C(t,n,r,i){for(const o of t){const t=tx(e,o);switch(o.kind){case 3:t&&E(o,n,!r),r=!1;break;case 2:r&&t&&i(o),r=!1;break;case 4:r=!0}}return r}function w(t,n,r,i){for(const o of t)if(IQ(o.kind)&&tx(e,o)){N(o,_.getLineAndCharacterOfPosition(o.pos),n,r,i)}}function N(t,n,r,i,o){let a=0;if(!l(t))if(m)a=D(t,n.line,r,m,h,g,i,o);else{P(_.getLineAndCharacterOfPosition(e.pos).line,n.line)}return m=t,p=t.end,g=r,h=n.line,a}function D(e,t,n,r,i,c,l,u){d.updateContext(r,c,e,n,l);const p=a(d);let m=!1!==d.options.trimTrailingWhitespace,g=0;return p?f(p,a=>{if(g=function(e,t,n,r,i){const a=i!==n;switch(e.action){case 1:return 0;case 16:if(t.end!==r.pos)return O(t.end,r.pos-t.end),a?2:0;break;case 32:O(t.pos,t.end-t.pos);break;case 8:if(1!==e.flags&&n!==i)return 0;if(1!==i-n)return L(t.end,r.pos-t.end,tZ(s,o)),a?0:1;break;case 4:if(1!==e.flags&&n!==i)return 0;if(1!==r.pos-t.end||32!==_.text.charCodeAt(t.end))return L(t.end,r.pos-t.end," "),a?2:0;break;case 64:c=t.end,(l=";")&&b.push(XQ(c,0,l))}var c,l;return 0}(a,r,i,e,t),u)switch(g){case 2:n.getStart(_)===e.pos&&u.recomputeIndentation(!1,l);break;case 1:n.getStart(_)===e.pos&&u.recomputeIndentation(!0,l);break;default:pn.assert(0===g)}m=m&&!(16&a.action)&&1!==a.flags}):m=m&&1!==e.kind,t!==i&&m&&P(i,t,r),g}function F(e,t,n){const r=Afe(t,o);if(n)L(e,0,r);else{const n=_.getLineAndCharacterOfPosition(e),i=Nd(n.line,_);(t!==function(e,t){let n=0;for(let r=0;r0){const e=Afe(r,o);L(t,n.character,e)}else O(t,n.character)}}function P(e,t,n){for(let r=e;rt)continue;const i=A(e,t);-1!==i&&(pn.assert(i===e||!Ha(_.text.charCodeAt(i-1))),O(i,t+1-i))}}function A(e,t){let n=t;for(;n>=e&&Ha(_.text.charCodeAt(n));)n--;return n!==t?n+1:-1}function I(e,t,n){P(_.getLineAndCharacterOfPosition(e).line,_.getLineAndCharacterOfPosition(t).line+1,n)}function O(e,t){t&&b.push(XQ(e,t,""))}function L(e,t,n){(t||n)&&b.push(XQ(e,t,n))}}function Pfe(e,t,n,r=lQ(e,t)){const i=mc(r,DP);i&&(r=i.parent);if(r.getStart(e)<=t&&tBX(n,t)||t===n.end&&(2===n.kind||t===e.getFullWidth()))}function Afe(e,t){if((!cfe||cfe.tabSize!==t.tabSize||cfe.indentSize!==t.indentSize)&&(cfe={tabSize:t.tabSize,indentSize:t.indentSize},lfe=_fe=void 0),t.convertTabsToSpaces){let n;const r=Math.floor(e/t.indentSize),i=e%t.indentSize;return _fe||(_fe=[]),void 0===_fe[r]?(n=iY(" ",t.indentSize*r),_fe[r]=n):n=_fe[r],i?n+iY(" ",i):n}{const n=Math.floor(e/t.tabSize),r=e-n*t.tabSize;let i;return lfe||(lfe=[]),void 0===lfe[n]?lfe[n]=i=iY("\t",n):i=lfe[n],r?i+iY(" ",r):i}}(e=>{let t;var n;function r(e){return e.baseIndentSize||0}function i(e,t,n,i,s,c,l){var f;let m=e.parent;for(;m;){let r=!0;if(n){const t=e.getStart(s);r=tn.end}const h=o(m,e,s),y=h.line===t.line||d(m,e,t.line,s);if(r){const n=null==(f=p(e,s))?void 0:f[0];let r=g(e,s,l,!!n&&_(n,s).line>h.line);if(-1!==r)return r+i;if(r=a(e,m,t,y,s,l),-1!==r)return r+i}S(l,m,e,s,c)&&!y&&(i+=l.indentSize);const v=u(m,e,t.line,s);m=(e=m).parent,t=v?s.getLineAndCharacterOfPosition(e.getStart(s)):h}return i+r(l)}function o(e,t,n){const r=p(t,n),i=r?r.pos:e.getStart(n);return n.getLineAndCharacterOfPosition(i)}function a(e,t,n,r,i,o){return(fu(e)||gu(e))&&(308===t.kind||!r)?y(n,i,o):-1}let s;var c;function l(e,t,n,r){const i=pQ(e,t,r);if(!i)return 0;if(19===i.kind)return 1;if(20===i.kind){return n===_(i,r).line?2:0}return 0}function _(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function u(e,t,n,r){if(!vF(e)||!C(e.arguments,t))return!1;return Wa(r,e.expression.getEnd()).line===n}function d(e,t,n,r){if(246===e.kind&&e.elseStatement===t){const t=GX(e,93,r);pn.assert(void 0!==t);return _(t,r).line===n}return!1}function p(e,t){return e.parent&&f(e.getStart(t),e.getEnd(),e.parent,t)}function f(e,t,n,r){switch(n.kind){case 184:return i(n.typeArguments);case 211:return i(n.properties);case 210:case 276:case 280:case 207:case 208:return i(n.elements);case 188:return i(n.members);case 263:case 219:case 220:case 175:case 174:case 180:case 177:case 186:case 181:return i(n.typeParameters)||i(n.parameters);case 178:return i(n.parameters);case 264:case 232:case 265:case 266:case 346:return i(n.typeParameters);case 215:case 214:return i(n.typeArguments)||i(n.arguments);case 262:return i(n.declarations)}function i(i){return i&&JX(function(e,t,n){const r=e.getChildren(n);for(let e=1;e=0&&t=0;o--){if(28===e[o].kind)continue;if(n.getLineAndCharacterOfPosition(e[o].end).line!==i.line)return y(i,n,r);i=_(e[o],n)}return-1}function y(e,t,n){const r=t.getPositionOfLineAndCharacter(e.line,0);return b(r,r+e.character,t,n)}function v(e,t,n,r){let i=0,o=0;for(let a=e;at.text.length)return r(n);if(0===n.indentStyle)return 0;const a=fQ(e,t,void 0,!0),s=Pfe(t,e,a||null);if(s&&3===s.kind)return function(e,t,n,r){const i=Wa(e,t).line-1,o=Wa(e,r.pos).line;if(pn.assert(o>=0),i<=o)return b(Nd(o,e),t,e,n);const a=Nd(i,e),{column:s,character:c}=v(a,t,e,n);if(0===s)return s;const l=e.text.charCodeAt(a+c);return 42===l?s-1:s}(t,e,n,s);if(!a)return r(n);if(OQ(a.kind)&&a.getStart(t)<=e&&e0;){if(!$a(e.text.charCodeAt(r)))break;r--}const i=jX(r,e);return b(i,r,e,n)}(t,e,n);if(28===a.kind&&227!==a.parent.kind){const e=function(e,t,n){const r=HX(e);return r&&r.listItemIndex>0?h(r.list.getChildren(),r.listItemIndex-1,t,n):-1}(a,t,n);if(-1!==e)return e}const p=function(e,t,n){return t&&f(e,e,t,n)}(e,a.parent,t);if(p&&!tx(p,a)){const e=[219,220].includes(u.parent.kind)?0:n.indentSize;return m(p,t,n)+e}return function(e,t,n,o,a,s){let c,u=n;for(;u;){if(VX(u,t,e)&&S(s,u,c,e,!0)){const t=_(u,e),r=l(n,u,o,e);return i(u,t,void 0,0!==r?a&&2===r?s.indentSize:0:o!==t.line?s.indentSize:0,e,!0,s)}const r=g(u,e,s,!0);if(-1!==r)return r;c=u,u=u.parent}return r(s)}(t,e,a,c,o,n)},e.getIndentationForNode=function(e,t,n,r){const o=n.getLineAndCharacterOfPosition(e.getStart(n));return i(e,o,t,0,n,!1,r)},e.getBaseIndentation=r,(c=s||(s={}))[c.Unknown=0]="Unknown",c[c.OpenBrace=1]="OpenBrace",c[c.CloseBrace=2]="CloseBrace",e.isArgumentAndStartLineOverlapsExpressionBeingCalled=u,e.childStartsOnTheSameLineWithElseInIfStatement=d,e.childIsUnindentedBranchOfConditionalExpression=function(e,t,n,r){if(IF(e)&&(t===e.whenTrue||t===e.whenFalse)){const i=Wa(r,e.condition.end).line;if(t===e.whenTrue)return n===i;{const t=_(e.whenTrue,r).line,o=Wa(r,e.whenTrue.end).line;return i===t&&o===n}}return!1},e.argumentStartsOnSameLineAsPreviousArgument=function(e,t,n,r){if(J_(e)){if(!e.arguments)return!1;const i=x(e.arguments,e=>e.pos===t.pos);if(!i)return!1;const o=e.arguments.indexOf(i);if(0===o)return!1;if(n===Wa(r,e.arguments[o-1].getEnd()).line)return!0}return!1},e.getContainingList=p,e.findFirstNonWhitespaceCharacterAndColumn=v,e.findFirstNonWhitespaceColumn=b,e.nodeWillIndentChild=k,e.shouldIndentChildNode=S})(ufe||(ufe={}));var Ife={};function Ofe(e,t,n){let r=!1;return t.forEach(t=>{const i=mc(lQ(e,t.pos),e=>tx(e,t));i&&iO(i,function i(o){var a;if(!r){if(uD(o)&&RX(t,o.getStart(e))){const t=n.resolveName(o.text,o,-1,!1);if(t&&t.declarations)for(const n of t.declarations)if(y3(n)||o.text&&e.symbol&&(null==(a=e.symbol.exports)?void 0:a.has(o.escapedText)))return void(r=!0)}o.forEachChild(i)}})}),r}o(Ife,{preparePasteEdits:()=>Ofe});var Lfe={};o(Lfe,{pasteEditsProvider:()=>Mfe});var jfe="providePostPasteEdits";function Mfe(e,t,n,r,i,o,a,s){const c=ide.ChangeTracker.with({host:i,formatContext:a,preferences:o},c=>function(e,t,n,r,i,o,a,s,c){let l;t.length!==n.length&&(l=1===t.length?t[0]:t.join(tZ(a.host,a.options)));const _=[];let u,d=e.text;for(let e=n.length-1;e>=0;e--){const{pos:r,end:i}=n[e];d=l?d.slice(0,r)+l+d.slice(i):d.slice(0,r)+t[e]+d.slice(i)}if(pn.checkDefined(i.runWithTemporaryFileUpdate).call(i,e.fileName,d,(d,p,f)=>{if(u=U7.createImportAdder(f,d,o,i),null==r?void 0:r.range){pn.assert(r.range.length===t.length),r.range.forEach(e=>{const t=r.file.statements,n=S(t,t=>t.end>e.pos);if(-1===n)return;let i=S(t,t=>t.end>=e.end,n);-1!==i&&e.end<=t[i].getStart()&&i--,_.push(...t.slice(n,-1===i?t.length:i+1))}),pn.assertIsDefined(p,"no original program found");const n=p.getTypeChecker(),o=function({file:e,range:t}){const n=t[0].pos,r=t[t.length-1].end,i=lQ(e,n),o=dQ(e,n)??lQ(e,r);return{pos:uD(i)&&n<=i.getStart(e)?i.getFullStart():n,end:uD(o)&&r===o.getEnd()?ide.getAdjustedEndPosition(e,o,{}):r}}(r),a=m3(r.file,_,n,T3(f,_,n),o),s=!h0(e.fileName,p,i,!!r.file.commonJsModuleIndicator);H6(r.file,a.targetFileImportsFromOldFile,c,s),D3(r.file,a.oldImportsNeededByTargetFile,a.targetFileImportsFromOldFile,n,d,u)}else{const e={sourceFile:f,program:p,cancellationToken:s,host:i,preferences:o,formatContext:a};let r=0;n.forEach((n,i)=>{const o=n.end-n.pos,a=l??t[i],s=n.pos+r,c={pos:s,end:s+a.length};r+=a.length-o;const _=mc(lQ(e.sourceFile,c.pos),e=>tx(e,c));_&&iO(_,function t(n){if(uD(n)&&RX(c,n.getStart(f))&&!(null==d?void 0:d.getTypeChecker().resolveName(n.text,n,-1,!1)))return u.addImportForUnresolvedIdentifier(e,n,!0);n.forEachChild(t)})})}u.writeFixes(c,hY(r?r.file:e,o))}),!u.hasFixes())return;n.forEach((n,r)=>{c.replaceRangeWithText(e,{pos:n.pos,end:n.end},l??t[r])})}(e,t,n,r,i,o,a,s,c));return{edits:c,fixId:jfe}}var Rfe={};o(Rfe,{ANONYMOUS:()=>FZ,AccessFlags:()=>Yr,AssertionLevel:()=>gt,AssignmentDeclarationKind:()=>ci,AssignmentKind:()=>Yg,Associativity:()=>oy,BreakpointResolver:()=>b7,BuilderFileEmit:()=>lW,BuilderProgramKind:()=>RW,BuilderState:()=>sW,CallHierarchy:()=>k7,CharacterCodes:()=>Ti,CheckFlags:()=>Wr,CheckMode:()=>iJ,ClassificationType:()=>nX,ClassificationTypeNames:()=>tX,CommentDirectiveType:()=>wr,Comparison:()=>l,CompletionInfoFlags:()=>KG,CompletionTriggerKind:()=>JG,Completions:()=>Oae,ContainerFlags:()=>rB,ContextFlags:()=>jr,Debug:()=>pn,DiagnosticCategory:()=>li,Diagnostics:()=>fa,DocumentHighlights:()=>L0,ElementFlags:()=>Qr,EmitFlags:()=>Di,EmitHint:()=>Ai,EmitOnly:()=>Er,EndOfLineState:()=>QG,ExitStatus:()=>Ar,ExportKind:()=>x0,Extension:()=>Ci,ExternalEmitHelpers:()=>Pi,FileIncludeKind:()=>Dr,FilePreprocessingDiagnosticsKind:()=>Fr,FileSystemEntryKind:()=>ao,FileWatcherEventKind:()=>zi,FindAllReferences:()=>jce,FlattenLevel:()=>Lz,FlowFlags:()=>Cr,ForegroundColorEscapeSequences:()=>sV,FunctionFlags:()=>Mh,GeneratedIdentifierFlags:()=>kr,GetLiteralTextFlags:()=>ap,GoToDefinition:()=>Sle,HighlightSpanKind:()=>qG,IdentifierNameMap:()=>_z,ImportKind:()=>b0,ImportsNotUsedAsValues:()=>yi,IndentStyle:()=>UG,IndexFlags:()=>Zr,IndexKind:()=>ri,InferenceFlags:()=>ai,InferencePriority:()=>oi,InlayHintKind:()=>zG,InlayHints:()=>zle,InternalEmitFlags:()=>Fi,InternalNodeBuilderFlags:()=>Rr,InternalSymbolName:()=>$r,IntersectionFlags:()=>Lr,InvalidatedProjectKind:()=>PH,JSDocParsingMode:()=>Ri,JsDoc:()=>$le,JsTyping:()=>oG,JsxEmit:()=>hi,JsxFlags:()=>vr,JsxReferenceKind:()=>ei,LanguageFeatureMinimumTarget:()=>Ei,LanguageServiceMode:()=>jG,LanguageVariant:()=>ki,LexicalEnvironmentFlags:()=>Oi,ListFormat:()=>Li,LogLevel:()=>fn,MapCode:()=>d_e,MemberOverrideStatus:()=>Ir,ModifierFlags:()=>yr,ModuleDetectionKind:()=>di,ModuleInstanceState:()=>ZR,ModuleKind:()=>gi,ModuleResolutionKind:()=>ui,ModuleSpecifierEnding:()=>qS,NavigateTo:()=>s2,NavigationBar:()=>y2,NewLineKind:()=>vi,NodeBuilderFlags:()=>Mr,NodeCheckFlags:()=>Hr,NodeFactoryFlags:()=>aw,NodeFlags:()=>hr,NodeResolutionFeatures:()=>XM,ObjectFlags:()=>Gr,OperationCanceledException:()=>Nr,OperatorPrecedence:()=>_y,OrganizeImports:()=>y_e,OrganizeImportsMode:()=>BG,OuterExpressionKinds:()=>Ii,OutliningElementsCollector:()=>X_e,OutliningSpanKind:()=>GG,OutputFileType:()=>XG,PackageJsonAutoImportPreference:()=>LG,PackageJsonDependencyGroup:()=>OG,PatternMatchKind:()=>c1,PollingInterval:()=>qi,PollingWatchKind:()=>mi,PragmaKindFlags:()=>ji,PredicateSemantics:()=>xr,PreparePasteEdits:()=>Ife,PrivateIdentifierKind:()=>lN,ProcessLevel:()=>nq,ProgramUpdateLevel:()=>RU,QuotePreference:()=>mY,RegularExpressionFlags:()=>Sr,RelationComparisonResult:()=>br,Rename:()=>oue,ScriptElementKind:()=>ZG,ScriptElementKindModifier:()=>eX,ScriptKind:()=>bi,ScriptSnapshot:()=>NG,ScriptTarget:()=>xi,SemanticClassificationFormat:()=>RG,SemanticMeaning:()=>iX,SemicolonPreference:()=>VG,SignatureCheckMode:()=>oJ,SignatureFlags:()=>ni,SignatureHelp:()=>due,SignatureInfo:()=>cW,SignatureKind:()=>ti,SmartSelectionRange:()=>Rue,SnippetKind:()=>Ni,StatisticType:()=>hK,StructureIsReused:()=>Pr,SymbolAccessibility:()=>zr,SymbolDisplay:()=>Gue,SymbolDisplayPartKind:()=>HG,SymbolFlags:()=>Vr,SymbolFormatFlags:()=>Jr,SyntaxKind:()=>gr,Ternary:()=>si,ThrottledCancellationToken:()=>u7,TokenClass:()=>YG,TokenFlags:()=>Tr,TransformFlags:()=>wi,TypeFacts:()=>nJ,TypeFlags:()=>Kr,TypeFormatFlags:()=>Br,TypeMapKind:()=>ii,TypePredicateKind:()=>qr,TypeReferenceSerializationKind:()=>Ur,UnionReduction:()=>Or,UpToDateStatusType:()=>rH,VarianceFlags:()=>Xr,Version:()=>kn,VersionRange:()=>Tn,WatchDirectoryFlags:()=>Si,WatchDirectoryKind:()=>fi,WatchFileKind:()=>pi,WatchLogLevel:()=>$U,WatchType:()=>z$,accessPrivateIdentifier:()=>Pz,addEmitFlags:()=>Nw,addEmitHelper:()=>Hw,addEmitHelpers:()=>Kw,addInternalEmitFlags:()=>Fw,addNodeFactoryPatcher:()=>cw,addObjectAllocatorPatcher:()=>Vx,addRange:()=>le,addRelatedInfo:()=>uT,addSyntheticLeadingComment:()=>Jw,addSyntheticTrailingComment:()=>Uw,addToSeen:()=>Cx,advancedAsyncSuperHelper:()=>VN,affectsDeclarationPathOptionDeclarations:()=>VO,affectsEmitOptionDeclarations:()=>UO,allKeysStartWithDot:()=>NR,altDirectorySeparator:()=>mo,and:()=>tn,append:()=>ae,appendIfUnique:()=>ue,arrayFrom:()=>je,arrayIsEqualTo:()=>re,arrayIsHomogeneous:()=>NT,arrayOf:()=>Le,arrayReverseIterator:()=>pe,arrayToMap:()=>Be,arrayToMultiMap:()=>ze,arrayToNumericMap:()=>Je,assertType:()=>on,assign:()=>Me,asyncSuperHelper:()=>UN,attachFileToDiagnostics:()=>Zx,base64decode:()=>Fb,base64encode:()=>Db,binarySearch:()=>we,binarySearchKey:()=>Ne,bindSourceFile:()=>aB,breakIntoCharacterSpans:()=>C1,breakIntoWordSpans:()=>w1,buildLinkParts:()=>ZY,buildOpts:()=>tL,buildOverload:()=>Wfe,bundlerModuleNameResolver:()=>YM,canBeConvertedToAsync:()=>X1,canHaveDecorators:()=>PI,canHaveExportModifier:()=>XT,canHaveFlowNode:()=>Rg,canHaveIllegalDecorators:()=>QA,canHaveIllegalModifiers:()=>YA,canHaveIllegalType:()=>GA,canHaveIllegalTypeParameters:()=>XA,canHaveJSDoc:()=>Bg,canHaveLocals:()=>uu,canHaveModifiers:()=>EI,canHaveModuleSpecifier:()=>xg,canHaveSymbol:()=>_u,canIncludeBindAndCheckDiagnostics:()=>yT,canJsonReportNoInputFiles:()=>Tj,canProduceDiagnostics:()=>jq,canUsePropertyAccess:()=>YT,canWatchAffectingLocation:()=>s$,canWatchAtTypes:()=>i$,canWatchDirectoryOrFile:()=>n$,canWatchDirectoryOrFilePath:()=>r$,cartesianProduct:()=>cn,cast:()=>it,chainBundle:()=>rz,chainDiagnosticMessages:()=>ik,changeAnyExtension:()=>Qo,changeCompilerHostLikeToUseCache:()=>rV,changeExtension:()=>QS,changeFullExtension:()=>Yo,changesAffectModuleResolution:()=>rd,changesAffectingProgramStructure:()=>id,characterCodeToRegularExpressionFlag:()=>Ma,childIsDecorated:()=>vm,classElementOrClassElementParameterIsDecorated:()=>xm,classHasClassThisAssignment:()=>$z,classHasDeclaredOrExplicitlyAssignedName:()=>Yz,classHasExplicitlyAssignedName:()=>Qz,classOrConstructorParameterIsDecorated:()=>bm,classicNameResolver:()=>$R,classifier:()=>z7,cleanExtendedConfigCache:()=>zU,clear:()=>E,clearMap:()=>gx,clearSharedExtendedConfigFileWatcher:()=>JU,climbPastPropertyAccess:()=>yX,clone:()=>Ve,cloneCompilerOptions:()=>BQ,closeFileWatcher:()=>sx,closeFileWatcherOf:()=>GU,codefix:()=>U7,collapseTextChangeRangesAcrossMultipleVersions:()=>tc,collectExternalModuleInfo:()=>sz,combine:()=>se,combinePaths:()=>Jo,commandLineOptionOfCustomType:()=>QO,commentPragmas:()=>Mi,commonOptionsWithBuild:()=>MO,compact:()=>ie,compareBooleans:()=>jt,compareDataObjects:()=>mx,compareDiagnostics:()=>sk,compareEmitHelpers:()=>uN,compareNumberOfDirectorySeparators:()=>$S,comparePaths:()=>ra,comparePathsCaseInsensitive:()=>na,comparePathsCaseSensitive:()=>ta,comparePatternKeys:()=>FR,compareProperties:()=>Lt,compareStringsCaseInsensitive:()=>Ct,compareStringsCaseInsensitiveEslintCompatible:()=>wt,compareStringsCaseSensitive:()=>Nt,compareStringsCaseSensitiveUI:()=>Ot,compareTextSpans:()=>kt,compareValues:()=>xt,compilerOptionsAffectDeclarationPath:()=>Xk,compilerOptionsAffectEmit:()=>Gk,compilerOptionsAffectSemanticDiagnostics:()=>Kk,compilerOptionsDidYouMeanDiagnostics:()=>gL,compilerOptionsIndicateEsModules:()=>lY,computeCommonSourceDirectoryOfFilenames:()=>YU,computeLineAndCharacterOfPosition:()=>qa,computeLineOfPosition:()=>Ua,computeLineStarts:()=>Ra,computePositionOfLineAndCharacter:()=>Ja,computeSignatureWithDiagnostics:()=>zW,computeSuggestionDiagnostics:()=>J1,computedOptions:()=>xk,concatenate:()=>G,concatenateDiagnosticMessageChains:()=>ok,consumesNodeCoreModules:()=>KZ,contains:()=>C,containsIgnoredPath:()=>RT,containsObjectRestOrSpread:()=>DI,containsParseError:()=>kd,containsPath:()=>ia,convertCompilerOptionsForTelemetry:()=>nM,convertCompilerOptionsFromJson:()=>Fj,convertJsonOption:()=>Mj,convertToBase64:()=>Nb,convertToJson:()=>HL,convertToObject:()=>$L,convertToOptionsWithAbsolutePaths:()=>oj,convertToRelativePath:()=>ca,convertToTSConfig:()=>XL,convertTypeAcquisitionFromJson:()=>Ej,copyComments:()=>fZ,copyEntries:()=>ld,copyLeadingComments:()=>hZ,copyProperties:()=>$e,copyTrailingAsLeadingComments:()=>vZ,copyTrailingComments:()=>yZ,couldStartTrivia:()=>es,countWhere:()=>N,createAbstractBuilder:()=>ZW,createAccessorPropertyBackingField:()=>kI,createAccessorPropertyGetRedirector:()=>SI,createAccessorPropertySetRedirector:()=>TI,createBaseNodeFactory:()=>ZC,createBinaryExpressionTrampoline:()=>mI,createBuilderProgram:()=>qW,createBuilderProgramUsingIncrementalBuildInfo:()=>HW,createBuilderStatusReporter:()=>_H,createCacheableExportInfoMap:()=>k0,createCachedDirectoryStructureHost:()=>MU,createClassifier:()=>O0,createCommentDirectivesMap:()=>Vd,createCompilerDiagnostic:()=>nk,createCompilerDiagnosticForInvalidCustomType:()=>sL,createCompilerDiagnosticFromMessageChain:()=>rk,createCompilerHost:()=>ZU,createCompilerHostFromProgramHost:()=>U$,createCompilerHostWorker:()=>nV,createDetachedDiagnostic:()=>Xx,createDiagnosticCollection:()=>fy,createDiagnosticForFileFromMessageChain:()=>Gp,createDiagnosticForNode:()=>qp,createDiagnosticForNodeArray:()=>Up,createDiagnosticForNodeArrayFromMessageChain:()=>$p,createDiagnosticForNodeFromMessageChain:()=>Wp,createDiagnosticForNodeInSourceFile:()=>Vp,createDiagnosticForRange:()=>Qp,createDiagnosticMessageChainFromDiagnostic:()=>Xp,createDiagnosticReporter:()=>y$,createDocumentPositionMapper:()=>YJ,createDocumentRegistry:()=>X0,createDocumentRegistryInternal:()=>Q0,createEmitAndSemanticDiagnosticsBuilderProgram:()=>YW,createEmitHelperFactory:()=>_N,createEmptyExports:()=>lA,createEvaluator:()=>xC,createExpressionForJsxElement:()=>fA,createExpressionForJsxFragment:()=>mA,createExpressionForObjectLiteralElementLike:()=>vA,createExpressionForPropertyName:()=>yA,createExpressionFromEntityName:()=>hA,createExternalHelpersImportDeclarationIfNeeded:()=>MA,createFileDiagnostic:()=>ek,createFileDiagnosticFromMessageChain:()=>Kp,createFlowNode:()=>iB,createForOfBindingStatement:()=>gA,createFutureSourceFile:()=>v0,createGetCanonicalFileName:()=>Ht,createGetIsolatedDeclarationErrors:()=>Bq,createGetSourceFile:()=>eV,createGetSymbolAccessibilityDiagnosticForNode:()=>Rq,createGetSymbolAccessibilityDiagnosticForNodeName:()=>Mq,createGetSymbolWalker:()=>dB,createIncrementalCompilerHost:()=>Z$,createIncrementalProgram:()=>eH,createJsxFactoryExpression:()=>pA,createLanguageService:()=>f7,createLanguageServiceSourceFile:()=>s7,createMemberAccessForPropertyName:()=>_A,createModeAwareCache:()=>MM,createModeAwareCacheKey:()=>jM,createModeMismatchDetails:()=>hd,createModuleNotFoundChain:()=>gd,createModuleResolutionCache:()=>qM,createModuleResolutionLoader:()=>EV,createModuleResolutionLoaderUsingGlobalCache:()=>f$,createModuleSpecifierResolutionHost:()=>_Y,createMultiMap:()=>Ke,createNameResolver:()=>TC,createNodeConverters:()=>nw,createNodeFactory:()=>lw,createOptionNameMap:()=>rL,createOverload:()=>Vfe,createPackageJsonImportFilter:()=>HZ,createPackageJsonInfo:()=>$Z,createParenthesizerRules:()=>ew,createPatternMatcher:()=>_1,createPrinter:()=>IU,createPrinterWithDefaults:()=>FU,createPrinterWithRemoveComments:()=>EU,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>PU,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>AU,createProgram:()=>$V,createProgramDiagnostics:()=>oW,createProgramHost:()=>$$,createPropertyNameNodeForIdentifierOrLiteral:()=>$T,createQueue:()=>Qe,createRange:()=>Mb,createRedirectedBuilderProgram:()=>XW,createResolutionCache:()=>m$,createRuntimeTypeSerializer:()=>_q,createScanner:()=>bs,createSemanticDiagnosticsBuilderProgram:()=>QW,createSet:()=>Ye,createSolutionBuilder:()=>fH,createSolutionBuilderHost:()=>dH,createSolutionBuilderWithWatch:()=>mH,createSolutionBuilderWithWatchHost:()=>pH,createSortedArray:()=>ee,createSourceFile:()=>cO,createSourceMapGenerator:()=>IJ,createSourceMapSource:()=>xw,createSuperAccessVariableStatement:()=>fq,createSymbolTable:()=>Zu,createSymlinkCache:()=>nS,createSyntacticTypeNodeBuilder:()=>iG,createSystemWatchFunctions:()=>lo,createTextChange:()=>QQ,createTextChangeFromStartLength:()=>XQ,createTextChangeRange:()=>Zs,createTextRangeFromNode:()=>HQ,createTextRangeFromSpan:()=>GQ,createTextSpan:()=>Gs,createTextSpanFromBounds:()=>Xs,createTextSpanFromNode:()=>WQ,createTextSpanFromRange:()=>KQ,createTextSpanFromStringLiteralLikeContent:()=>$Q,createTextWriter:()=>Ry,createTokenRange:()=>qb,createTypeChecker:()=>pJ,createTypeReferenceDirectiveResolutionCache:()=>UM,createTypeReferenceResolutionLoader:()=>IV,createWatchCompilerHost:()=>tH,createWatchCompilerHostOfConfigFile:()=>G$,createWatchCompilerHostOfFilesAndCompilerOptions:()=>X$,createWatchFactory:()=>q$,createWatchHost:()=>J$,createWatchProgram:()=>nH,createWatchStatusReporter:()=>k$,createWriteFileMeasuringIO:()=>tV,declarationNameToString:()=>jp,decodeMappings:()=>zJ,decodedTextSpanIntersectsWith:()=>Vs,deduplicate:()=>Z,defaultHoverMaximumTruncationLength:()=>Xu,defaultInitCompilerOptions:()=>aL,defaultMaximumTruncationLength:()=>Ku,diagnosticCategoryName:()=>_i,diagnosticToString:()=>d0,diagnosticsEqualityComparer:()=>uk,directoryProbablyExists:()=>Ib,directorySeparator:()=>fo,displayPart:()=>JY,displayPartsToString:()=>n7,disposeEmitNodes:()=>Tw,documentSpansEqual:()=>EY,dumpTracingLegend:()=>mr,elementAt:()=>me,elideNodes:()=>hI,emitDetachedComments:()=>Cv,emitFiles:()=>CU,emitFilesAndReportErrors:()=>j$,emitFilesAndReportErrorsAndGetExitStatus:()=>M$,emitModuleKindIsNonNodeESM:()=>Bk,emitNewLineBeforeLeadingCommentOfPosition:()=>Tv,emitResolverSkipsTypeChecking:()=>TU,emitSkippedWithNoDiagnostics:()=>QV,emptyArray:()=>_,emptyFileSystemEntries:()=>cT,emptyMap:()=>u,emptyOptions:()=>MG,endsWith:()=>Bt,ensurePathIsNonModuleName:()=>Xo,ensureScriptKind:()=>CS,ensureTrailingDirectorySeparator:()=>Go,entityNameToString:()=>zp,enumerateInsertsAndDeletes:()=>sn,equalOwnProperties:()=>Re,equateStringsCaseInsensitive:()=>yt,equateStringsCaseSensitive:()=>vt,equateValues:()=>ht,escapeJsxAttributeString:()=>Ay,escapeLeadingUnderscores:()=>yc,escapeNonAsciiString:()=>Ny,escapeSnippetText:()=>VT,escapeString:()=>Cy,escapeTemplateSubstitution:()=>gy,evaluatorResult:()=>bC,every:()=>b,exclusivelyPrefixedNodeCoreModules:()=>PC,executeCommandLine:()=>OK,expandPreOrPostfixIncrementOrDecrementExpression:()=>bA,explainFiles:()=>E$,explainIfFileIsRedirectAndImpliedFormat:()=>P$,exportAssignmentIsAlias:()=>vh,expressionResultIsUnused:()=>MT,extend:()=>We,extensionFromPath:()=>iT,extensionIsTS:()=>nT,extensionsNotSupportingExtensionlessResolution:()=>jS,externalHelpersModuleNameText:()=>Hu,factory:()=>bw,fileExtensionIs:()=>wo,fileExtensionIsOneOf:()=>No,fileIncludeReasonToDiagnostics:()=>O$,fileShouldUseJavaScriptRequire:()=>h0,filter:()=>D,filterMutate:()=>F,filterSemanticDiagnostics:()=>ZV,find:()=>x,findAncestor:()=>mc,findBestPatternMatch:()=>Xt,findChildOfKind:()=>GX,findComputedPropertyNameCacheAssignment:()=>CI,findConfigFile:()=>XU,findConstructorDeclaration:()=>SC,findContainingList:()=>XX,findDiagnosticForNode:()=>QZ,findFirstNonJsxWhitespaceToken:()=>uQ,findIndex:()=>S,findLast:()=>k,findLastIndex:()=>T,findListItemInfo:()=>HX,findModifier:()=>wY,findNextToken:()=>pQ,findPackageJson:()=>WZ,findPackageJsons:()=>VZ,findPrecedingMatchingToken:()=>TQ,findPrecedingToken:()=>fQ,findSuperStatementIndexPath:()=>yz,findTokenOnLeftOfPosition:()=>dQ,findUseStrictPrologue:()=>CA,first:()=>ye,firstDefined:()=>m,firstDefinedIterator:()=>g,firstIterator:()=>ve,firstOrOnly:()=>n0,firstOrUndefined:()=>ge,firstOrUndefinedIterator:()=>he,fixupCompilerOptions:()=>a2,flatMap:()=>L,flatMapIterator:()=>M,flatMapToMutable:()=>j,flatten:()=>O,flattenCommaList:()=>NI,flattenDestructuringAssignment:()=>jz,flattenDestructuringBinding:()=>Bz,flattenDiagnosticMessageText:()=>vV,forEach:()=>p,forEachAncestor:()=>ad,forEachAncestorDirectory:()=>ua,forEachAncestorDirectoryStoppingAtGlobalCache:()=>LR,forEachChild:()=>iO,forEachChildRecursively:()=>oO,forEachDynamicImportOrRequireCall:()=>IC,forEachEmittedFile:()=>oU,forEachEnclosingBlockScopeContainer:()=>Lp,forEachEntry:()=>sd,forEachExternalModuleToImportFrom:()=>C0,forEachImportClauseDeclaration:()=>Fg,forEachKey:()=>cd,forEachLeadingCommentRange:()=>ls,forEachNameInAccessChainWalkingLeft:()=>Ax,forEachNameOfDefaultExport:()=>I0,forEachOptionsSyntaxByName:()=>qC,forEachProjectReference:()=>BC,forEachPropertyAssignment:()=>Kf,forEachResolvedProjectReference:()=>RC,forEachReturnStatement:()=>Af,forEachRight:()=>f,forEachTrailingCommentRange:()=>_s,forEachTsConfigPropArray:()=>Qf,forEachUnique:()=>AY,forEachYieldExpression:()=>If,formatColorAndReset:()=>mV,formatDiagnostic:()=>aV,formatDiagnostics:()=>oV,formatDiagnosticsWithColorAndContext:()=>yV,formatGeneratedName:()=>xI,formatGeneratedNamePart:()=>vI,formatLocation:()=>hV,formatMessage:()=>tk,formatStringFromArgs:()=>$x,formatting:()=>Ide,generateDjb2Hash:()=>Bi,generateTSConfig:()=>ij,getAdjustedReferenceLocation:()=>oQ,getAdjustedRenameLocation:()=>aQ,getAliasDeclarationFromName:()=>hh,getAllAccessorDeclarations:()=>hv,getAllDecoratorsOfClass:()=>Cz,getAllDecoratorsOfClassElement:()=>wz,getAllJSDocTags:()=>ul,getAllJSDocTagsOfKind:()=>dl,getAllKeys:()=>Ie,getAllProjectOutputs:()=>xU,getAllSuperTypeNodes:()=>Ch,getAllowImportingTsExtensions:()=>kk,getAllowJSCompilerOption:()=>Mk,getAllowSyntheticDefaultImports:()=>Fk,getAncestor:()=>Dh,getAnyExtensionFromPath:()=>Lo,getAreDeclarationMapsEnabled:()=>jk,getAssignedExpandoInitializer:()=>Xm,getAssignedName:()=>Ec,getAssignmentDeclarationKind:()=>og,getAssignmentDeclarationPropertyAccessKind:()=>mg,getAssignmentTargetKind:()=>eh,getAutomaticTypeDirectiveNames:()=>FM,getBaseFileName:()=>Io,getBinaryOperatorPrecedence:()=>dy,getBuildInfo:()=>NU,getBuildInfoFileVersionMap:()=>KW,getBuildInfoText:()=>wU,getBuildOrderFromAnyBuildOrder:()=>lH,getBuilderCreationParameters:()=>BW,getBuilderFileEmit:()=>uW,getCanonicalDiagnostic:()=>Yp,getCheckFlags:()=>cx,getClassExtendsHeritageElement:()=>Sh,getClassLikeDeclarationOfSymbol:()=>bx,getCombinedLocalAndExportSymbolFlags:()=>ux,getCombinedModifierFlags:()=>cc,getCombinedNodeFlags:()=>_c,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>lc,getCommentRange:()=>jw,getCommonSourceDirectory:()=>vU,getCommonSourceDirectoryOfConfig:()=>bU,getCompilerOptionValue:()=>Qk,getConditions:()=>NM,getConfigFileParsingDiagnostics:()=>qV,getConstantValue:()=>Ww,getContainerFlags:()=>_B,getContainerNode:()=>AX,getContainingClass:()=>em,getContainingClassExcludingClassDecorators:()=>rm,getContainingClassStaticBlock:()=>tm,getContainingFunction:()=>Yf,getContainingFunctionDeclaration:()=>Zf,getContainingFunctionOrClassStaticBlock:()=>nm,getContainingNodeArray:()=>BT,getContainingObjectLiteralElement:()=>g7,getContextualTypeFromParent:()=>SZ,getContextualTypeFromParentOrAncestorTypeNode:()=>eQ,getDeclarationDiagnostics:()=>Jq,getDeclarationEmitExtensionForPath:()=>Gy,getDeclarationEmitOutputFilePath:()=>Hy,getDeclarationEmitOutputFilePathWorker:()=>Ky,getDeclarationFileExtension:()=>bO,getDeclarationFromName:()=>fh,getDeclarationModifierFlagsFromSymbol:()=>lx,getDeclarationOfKind:()=>Qu,getDeclarationsOfKind:()=>Yu,getDeclaredExpandoInitializer:()=>Gm,getDecorators:()=>Pc,getDefaultCompilerOptions:()=>r7,getDefaultFormatCodeSettings:()=>WG,getDefaultLibFileName:()=>As,getDefaultLibFilePath:()=>y7,getDefaultLikeExportInfo:()=>P0,getDefaultLikeExportNameFromDeclaration:()=>i0,getDefaultResolutionModeForFileWorker:()=>XV,getDiagnosticText:()=>SL,getDiagnosticsWithinSpan:()=>YZ,getDirectoryPath:()=>Ao,getDirectoryToWatchFailedLookupLocation:()=>c$,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>u$,getDocumentPositionMapper:()=>M1,getDocumentSpansEqualityComparer:()=>PY,getESModuleInterop:()=>Dk,getEditsForFileRename:()=>e1,getEffectiveBaseTypeNode:()=>kh,getEffectiveConstraintOfTypeParameter:()=>ml,getEffectiveContainerForJSDocTemplateTag:()=>Vg,getEffectiveImplementsTypeNodes:()=>Th,getEffectiveInitializer:()=>Km,getEffectiveJSDocHost:()=>Hg,getEffectiveModifierFlags:()=>Vv,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>Wv,getEffectiveModifierFlagsNoCache:()=>Gv,getEffectiveReturnTypeNode:()=>bv,getEffectiveSetAccessorTypeAnnotationNode:()=>kv,getEffectiveTypeAnnotationNode:()=>yv,getEffectiveTypeParameterDeclarations:()=>fl,getEffectiveTypeRoots:()=>bM,getElementOrPropertyAccessArgumentExpressionOrName:()=>pg,getElementOrPropertyAccessName:()=>fg,getElementsOfBindingOrAssignmentPattern:()=>HA,getEmitDeclarations:()=>Ik,getEmitFlags:()=>rp,getEmitHelpers:()=>Xw,getEmitModuleDetectionKind:()=>wk,getEmitModuleFormatOfFileWorker:()=>KV,getEmitModuleKind:()=>Tk,getEmitModuleResolutionKind:()=>Ck,getEmitScriptTarget:()=>Sk,getEmitStandardClassFields:()=>Hk,getEnclosingBlockScopeContainer:()=>Op,getEnclosingContainer:()=>Ip,getEncodedSemanticClassifications:()=>U0,getEncodedSyntacticClassifications:()=>K0,getEndLinePosition:()=>Fd,getEntityNameFromTypeNode:()=>fm,getEntrypointsFromPackageJsonInfo:()=>hR,getErrorCountForSummary:()=>T$,getErrorSpanForNode:()=>tf,getErrorSummaryText:()=>D$,getEscapedTextOfIdentifierOrLiteral:()=>Hh,getEscapedTextOfJsxAttributeName:()=>aC,getEscapedTextOfJsxNamespacedName:()=>lC,getExpandoInitializer:()=>Qm,getExportAssignmentExpression:()=>bh,getExportInfoMap:()=>E0,getExportNeedsImportStarHelper:()=>iz,getExpressionAssociativity:()=>ay,getExpressionPrecedence:()=>cy,getExternalHelpersModuleName:()=>LA,getExternalModuleImportEqualsDeclarationExpression:()=>Fm,getExternalModuleName:()=>wg,getExternalModuleNameFromDeclaration:()=>Vy,getExternalModuleNameFromPath:()=>Wy,getExternalModuleNameLiteral:()=>BA,getExternalModuleRequireArgument:()=>Em,getFallbackOptions:()=>KU,getFileEmitOutput:()=>aW,getFileMatcherPatterns:()=>bS,getFileNamesFromConfigSpecs:()=>Vj,getFileWatcherEventKind:()=>eo,getFilesInErrorForSummary:()=>C$,getFirstConstructorWithBody:()=>cv,getFirstIdentifier:()=>db,getFirstNonSpaceCharacterPosition:()=>dZ,getFirstProjectOutput:()=>SU,getFixableErrorSpanExpression:()=>e0,getFormatCodeSettingsForWriting:()=>p0,getFullWidth:()=>ud,getFunctionFlags:()=>Rh,getHeritageClause:()=>Nh,getHostSignatureFromJSDoc:()=>$g,getIdentifierAutoGenerate:()=>aN,getIdentifierGeneratedImportReference:()=>cN,getIdentifierTypeArguments:()=>iN,getImmediatelyInvokedFunctionExpression:()=>lm,getImpliedNodeFormatForEmitWorker:()=>GV,getImpliedNodeFormatForFile:()=>UV,getImpliedNodeFormatForFileWorker:()=>VV,getImportNeedsImportDefaultHelper:()=>az,getImportNeedsImportStarHelper:()=>oz,getIndentString:()=>jy,getInferredLibraryNameResolveFrom:()=>jV,getInitializedVariables:()=>ix,getInitializerOfBinaryExpression:()=>gg,getInitializerOfBindingOrAssignmentElement:()=>zA,getInterfaceBaseTypeNodes:()=>wh,getInternalEmitFlags:()=>ip,getInvokedExpression:()=>mm,getIsFileExcluded:()=>F0,getIsolatedModules:()=>Nk,getJSDocAugmentsTag:()=>Jc,getJSDocClassTag:()=>qc,getJSDocCommentRanges:()=>Sf,getJSDocCommentsAndTags:()=>Jg,getJSDocDeprecatedTag:()=>Yc,getJSDocDeprecatedTagNoCache:()=>Zc,getJSDocEnumTag:()=>el,getJSDocHost:()=>Kg,getJSDocImplementsTags:()=>zc,getJSDocOverloadTags:()=>Wg,getJSDocOverrideTagNoCache:()=>Qc,getJSDocParameterTags:()=>Oc,getJSDocParameterTagsNoCache:()=>Lc,getJSDocPrivateTag:()=>Wc,getJSDocPrivateTagNoCache:()=>$c,getJSDocProtectedTag:()=>Hc,getJSDocProtectedTagNoCache:()=>Kc,getJSDocPublicTag:()=>Uc,getJSDocPublicTagNoCache:()=>Vc,getJSDocReadonlyTag:()=>Gc,getJSDocReadonlyTagNoCache:()=>Xc,getJSDocReturnTag:()=>nl,getJSDocReturnType:()=>sl,getJSDocRoot:()=>Gg,getJSDocSatisfiesExpressionType:()=>iC,getJSDocSatisfiesTag:()=>il,getJSDocTags:()=>ll,getJSDocTemplateTag:()=>rl,getJSDocThisTag:()=>tl,getJSDocType:()=>al,getJSDocTypeAliasName:()=>KA,getJSDocTypeAssertionType:()=>EA,getJSDocTypeParameterDeclarations:()=>xv,getJSDocTypeParameterTags:()=>Mc,getJSDocTypeParameterTagsNoCache:()=>Rc,getJSDocTypeTag:()=>ol,getJSXImplicitImportBase:()=>Zk,getJSXRuntimeImport:()=>eS,getJSXTransformEnabled:()=>Yk,getKeyForCompilerOptions:()=>IM,getLanguageVariant:()=>fk,getLastChild:()=>Tx,getLeadingCommentRanges:()=>fs,getLeadingCommentRangesOfNode:()=>kf,getLeftmostAccessExpression:()=>Px,getLeftmostExpression:()=>Ix,getLibFileNameFromLibReference:()=>MC,getLibNameFromLibReference:()=>jC,getLibraryNameFromLibFileName:()=>MV,getLineAndCharacterOfPosition:()=>Wa,getLineInfo:()=>MJ,getLineOfLocalPosition:()=>av,getLineStartPositionForPosition:()=>jX,getLineStarts:()=>za,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>ex,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>Zb,getLinesBetweenPositions:()=>Va,getLinesBetweenRangeEndAndRangeStart:()=>Kb,getLinesBetweenRangeEndPositions:()=>Gb,getLiteralText:()=>sp,getLocalNameForExternalImport:()=>RA,getLocalSymbolForExportDefault:()=>Tb,getLocaleSpecificMessage:()=>Gx,getLocaleTimeString:()=>x$,getMappedContextSpan:()=>jY,getMappedDocumentSpan:()=>LY,getMappedLocation:()=>OY,getMatchedFileSpec:()=>A$,getMatchedIncludeSpec:()=>I$,getMeaningFromDeclaration:()=>oX,getMeaningFromLocation:()=>aX,getMembersOfDeclaration:()=>Lf,getModeForFileReference:()=>bV,getModeForResolutionAtIndex:()=>xV,getModeForUsageLocation:()=>SV,getModifiedTime:()=>Vi,getModifiers:()=>Ac,getModuleInstanceState:()=>eB,getModuleNameStringLiteralAt:()=>iW,getModuleSpecifierEndingPreference:()=>US,getModuleSpecifierResolverHost:()=>uY,getNameForExportedSymbol:()=>r0,getNameFromImportAttribute:()=>yC,getNameFromIndexInfo:()=>Mp,getNameFromPropertyName:()=>aY,getNameOfAccessExpression:()=>Fx,getNameOfCompilerOptionValue:()=>tj,getNameOfDeclaration:()=>Fc,getNameOfExpando:()=>Zm,getNameOfJSDocTypedef:()=>wc,getNameOfScriptTarget:()=>$k,getNameOrArgument:()=>dg,getNameTable:()=>m7,getNamespaceDeclarationNode:()=>Ng,getNewLineCharacter:()=>jb,getNewLineKind:()=>u0,getNewLineOrDefaultFromHost:()=>tZ,getNewTargetContainer:()=>sm,getNextJSDocCommentLocation:()=>qg,getNodeChildren:()=>oA,getNodeForGeneratedName:()=>yI,getNodeId:()=>_J,getNodeKind:()=>IX,getNodeModifiers:()=>PQ,getNodeModulePathParts:()=>KT,getNonAssignedNameOfDeclaration:()=>Dc,getNonAssignmentOperatorForCompoundAssignment:()=>mz,getNonAugmentationDeclaration:()=>bp,getNonDecoratorTokenPosOfNode:()=>$d,getNonIncrementalBuildInfoRoots:()=>GW,getNonModifierTokenPosOfNode:()=>Hd,getNormalizedAbsolutePath:()=>Uo,getNormalizedAbsolutePathWithoutRoot:()=>$o,getNormalizedPathComponents:()=>qo,getObjectFlags:()=>xx,getOperatorAssociativity:()=>sy,getOperatorPrecedence:()=>uy,getOptionFromName:()=>yL,getOptionsForLibraryResolution:()=>VM,getOptionsNameMap:()=>iL,getOptionsSyntaxByArrayElementValue:()=>JC,getOptionsSyntaxByValue:()=>zC,getOrCreateEmitNode:()=>Sw,getOrUpdate:()=>q,getOriginalNode:()=>fc,getOriginalNodeId:()=>ez,getOutputDeclarationFileName:()=>dU,getOutputDeclarationFileNameWorker:()=>pU,getOutputExtension:()=>_U,getOutputFileNames:()=>kU,getOutputJSFileNameWorker:()=>mU,getOutputPathsFor:()=>cU,getOwnEmitOutputFilePath:()=>$y,getOwnKeys:()=>Ae,getOwnValues:()=>Oe,getPackageJsonTypesVersionsPaths:()=>vM,getPackageNameFromTypesPackageName:()=>UR,getPackageScopeForPath:()=>bR,getParameterSymbolFromJSDoc:()=>Ug,getParentNodeInSpan:()=>TY,getParseTreeNode:()=>hc,getParsedCommandLineOfConfigFile:()=>TL,getPathComponents:()=>jo,getPathFromPathComponents:()=>Mo,getPathUpdater:()=>t1,getPathsBasePath:()=>Yy,getPatternFromSpec:()=>hS,getPendingEmitKindWithSeen:()=>SW,getPositionOfLineAndCharacter:()=>Ba,getPossibleGenericSignatures:()=>wQ,getPossibleOriginalInputExtensionForExtension:()=>Xy,getPossibleOriginalInputPathWithoutChangingExt:()=>Qy,getPossibleTypeArgumentsInfo:()=>NQ,getPreEmitDiagnostics:()=>iV,getPrecedingNonSpaceCharacterPosition:()=>pZ,getPrivateIdentifier:()=>Fz,getProperties:()=>vz,getProperty:()=>Pe,getPropertyAssignmentAliasLikeExpression:()=>xh,getPropertyNameForPropertyNameNode:()=>Vh,getPropertyNameFromType:()=>pC,getPropertyNameOfBindingOrAssignmentElement:()=>VA,getPropertySymbolFromBindingElement:()=>SY,getPropertySymbolsFromContextualType:()=>h7,getQuoteFromPreference:()=>yY,getQuotePreference:()=>hY,getRangesWhere:()=>K,getRefactorContextSpan:()=>ZZ,getReferencedFileLocation:()=>JV,getRegexFromPattern:()=>xS,getRegularExpressionForWildcard:()=>fS,getRegularExpressionsForWildcards:()=>mS,getRelativePathFromDirectory:()=>sa,getRelativePathFromFile:()=>la,getRelativePathToDirectoryOrUrl:()=>_a,getRenameLocation:()=>gZ,getReplacementSpanForContextToken:()=>VQ,getResolutionDiagnostic:()=>nW,getResolutionModeOverride:()=>wV,getResolveJsonModule:()=>Ak,getResolvePackageJsonExports:()=>Ek,getResolvePackageJsonImports:()=>Pk,getResolvedExternalModuleName:()=>qy,getResolvedModuleFromResolution:()=>fd,getResolvedTypeReferenceDirectiveFromResolution:()=>md,getRestIndicatorOfBindingOrAssignmentElement:()=>UA,getRestParameterElementType:()=>Of,getRightMostAssignedExpression:()=>tg,getRootDeclaration:()=>ny,getRootDirectoryOfResolutionCache:()=>d$,getRootLength:()=>Po,getScriptKind:()=>cZ,getScriptKindFromFileName:()=>wS,getScriptTargetFeatures:()=>op,getSelectedEffectiveModifierFlags:()=>zv,getSelectedSyntacticModifierFlags:()=>qv,getSemanticClassifications:()=>z0,getSemanticJsxChildren:()=>py,getSetAccessorTypeAnnotationNode:()=>_v,getSetAccessorValueParameter:()=>lv,getSetExternalModuleIndicator:()=>yk,getShebang:()=>gs,getSingleVariableOfVariableStatement:()=>jg,getSnapshotText:()=>rY,getSnippetElement:()=>Yw,getSourceFileOfModule:()=>Td,getSourceFileOfNode:()=>Sd,getSourceFilePathInNewDir:()=>tv,getSourceFileVersionAsHashFromText:()=>V$,getSourceFilesToEmit:()=>Zy,getSourceMapRange:()=>Ew,getSourceMapper:()=>j1,getSourceTextOfNodeFromSourceFile:()=>Kd,getSpanOfTokenAtPosition:()=>Zp,getSpellingSuggestion:()=>Mt,getStartPositionOfLine:()=>Nd,getStartPositionOfRange:()=>Yb,getStartsOnNewLine:()=>Ow,getStaticPropertiesAndClassStaticBlock:()=>xz,getStrictOptionValue:()=>Wk,getStringComparer:()=>Dt,getSubPatternFromSpec:()=>yS,getSuperCallFromStatement:()=>gz,getSuperContainer:()=>cm,getSupportedCodeFixes:()=>i7,getSupportedExtensions:()=>MS,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>RS,getSwitchedType:()=>DZ,getSymbolId:()=>uJ,getSymbolNameForPrivateIdentifier:()=>Kh,getSymbolTarget:()=>lZ,getSyntacticClassifications:()=>H0,getSyntacticModifierFlags:()=>$v,getSyntacticModifierFlagsNoCache:()=>Xv,getSynthesizedDeepClone:()=>UC,getSynthesizedDeepCloneWithReplacements:()=>VC,getSynthesizedDeepClones:()=>$C,getSynthesizedDeepClonesWithReplacements:()=>HC,getSyntheticLeadingComments:()=>Rw,getSyntheticTrailingComments:()=>zw,getTargetLabel:()=>vX,getTargetOfBindingOrAssignmentElement:()=>qA,getTemporaryModuleResolutionState:()=>vR,getTextOfConstantValue:()=>cp,getTextOfIdentifierOrLiteral:()=>$h,getTextOfJSDocComment:()=>pl,getTextOfJsxAttributeName:()=>sC,getTextOfJsxNamespacedName:()=>_C,getTextOfNode:()=>ep,getTextOfNodeFromSourceText:()=>Zd,getTextOfPropertyName:()=>Jp,getThisContainer:()=>im,getThisParameter:()=>uv,getTokenAtPosition:()=>lQ,getTokenPosOfNode:()=>Wd,getTokenSourceMapRange:()=>Aw,getTouchingPropertyName:()=>sQ,getTouchingToken:()=>cQ,getTrailingCommentRanges:()=>ms,getTrailingSemicolonDeferringWriter:()=>By,getTransformers:()=>Hq,getTsBuildInfoEmitOutputFilePath:()=>aU,getTsConfigObjectLiteralExpression:()=>Gf,getTsConfigPropArrayElementValue:()=>Xf,getTypeAnnotationNode:()=>vv,getTypeArgumentOrTypeParameterList:()=>AQ,getTypeKeywordOfTypeOnlyImport:()=>DY,getTypeNode:()=>nN,getTypeNodeIfAccessible:()=>EZ,getTypeParameterFromJsDoc:()=>Xg,getTypeParameterOwner:()=>nc,getTypesPackageName:()=>zR,getUILocale:()=>At,getUniqueName:()=>mZ,getUniqueSymbolId:()=>uZ,getUseDefineForClassFields:()=>Rk,getWatchErrorSummaryDiagnosticMessage:()=>w$,getWatchFactory:()=>HU,group:()=>qe,groupBy:()=>Ue,guessIndentation:()=>Bu,handleNoEmitOptions:()=>YV,handleWatchOptionsConfigDirTemplateSubstitution:()=>fj,hasAbstractModifier:()=>jv,hasAccessorModifier:()=>Rv,hasAmbientModifier:()=>Mv,hasChangesInResolutions:()=>xd,hasContextSensitiveParameters:()=>JT,hasDecorators:()=>Jv,hasDocComment:()=>FQ,hasDynamicName:()=>qh,hasEffectiveModifier:()=>Pv,hasEffectiveModifiers:()=>Fv,hasEffectiveReadonlyModifier:()=>Bv,hasExtension:()=>Co,hasImplementationTSFileExtension:()=>zS,hasIndexSignature:()=>NZ,hasInferredType:()=>NC,hasInitializer:()=>Ou,hasInvalidEscape:()=>yy,hasJSDocNodes:()=>Au,hasJSDocParameterTags:()=>Bc,hasJSFileExtension:()=>BS,hasJsonModuleEmitEnabled:()=>Jk,hasOnlyExpressionInitializer:()=>Lu,hasOverrideModifier:()=>Lv,hasPossibleExternalModuleReference:()=>Pp,hasProperty:()=>Ee,hasPropertyAccessExpressionWithName:()=>bX,hasQuestionToken:()=>Eg,hasRecordedExternalHelpers:()=>jA,hasResolutionModeOverride:()=>mC,hasRestParameter:()=>qu,hasScopeMarker:()=>Y_,hasStaticModifier:()=>Ov,hasSyntacticModifier:()=>Av,hasSyntacticModifiers:()=>Ev,hasTSFileExtension:()=>JS,hasTabstop:()=>ZT,hasTrailingDirectorySeparator:()=>Do,hasType:()=>Iu,hasTypeArguments:()=>Qg,hasZeroOrOneAsteriskCharacter:()=>tS,hostGetCanonicalFileName:()=>zy,hostUsesCaseSensitiveFileNames:()=>Jy,idText:()=>bc,identifierIsThisKeyword:()=>gv,identifierToKeywordKind:()=>xc,identity:()=>lt,identitySourceMapConsumer:()=>ZJ,ignoreSourceNewlines:()=>eN,ignoredPaths:()=>to,importFromModuleSpecifier:()=>Sg,importSyntaxAffectsModuleResolution:()=>vk,indexOfAnyCharCode:()=>w,indexOfNode:()=>np,indicesOf:()=>Q,inferredTypesContainingFile:()=>LV,injectClassNamedEvaluationHelperBlockIfMissing:()=>Zz,injectClassThisAssignmentIfMissing:()=>Hz,insertImports:()=>NY,insertSorted:()=>te,insertStatementAfterCustomPrologue:()=>zd,insertStatementAfterStandardPrologue:()=>Jd,insertStatementsAfterCustomPrologue:()=>Bd,insertStatementsAfterStandardPrologue:()=>Rd,intersperse:()=>v,intrinsicTagNameToString:()=>uC,introducesArgumentsExoticObject:()=>zf,inverseJsxOptionMap:()=>AO,isAbstractConstructorSymbol:()=>vx,isAbstractModifier:()=>bD,isAccessExpression:()=>Dx,isAccessibilityModifier:()=>RQ,isAccessor:()=>g_,isAccessorModifier:()=>kD,isAliasableExpression:()=>yh,isAmbientModule:()=>dp,isAmbientPropertyDeclaration:()=>Sp,isAnyDirectorySeparator:()=>yo,isAnyImportOrBareOrAccessedRequire:()=>Dp,isAnyImportOrReExport:()=>Ap,isAnyImportOrRequireStatement:()=>Fp,isAnyImportSyntax:()=>Np,isAnySupportedFileExtension:()=>oT,isApplicableVersionedTypesKey:()=>AR,isArgumentExpressionOfElementAccess:()=>NX,isArray:()=>Ze,isArrayBindingElement:()=>D_,isArrayBindingOrAssignmentElement:()=>L_,isArrayBindingOrAssignmentPattern:()=>O_,isArrayBindingPattern:()=>pF,isArrayLiteralExpression:()=>mF,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>JQ,isArrayTypeNode:()=>KD,isArrowFunction:()=>CF,isAsExpression:()=>JF,isAssertClause:()=>FE,isAssertEntry:()=>EE,isAssertionExpression:()=>G_,isAssertsKeyword:()=>gD,isAssignmentDeclaration:()=>Hm,isAssignmentExpression:()=>cb,isAssignmentOperator:()=>ob,isAssignmentPattern:()=>N_,isAssignmentTarget:()=>th,isAsteriskToken:()=>oD,isAsyncFunction:()=>Bh,isAsyncModifier:()=>mD,isAutoAccessorPropertyDeclaration:()=>h_,isAwaitExpression:()=>FF,isAwaitKeyword:()=>hD,isBigIntLiteral:()=>HN,isBinaryExpression:()=>AF,isBinaryLogicalOperator:()=>Zv,isBinaryOperatorToken:()=>cI,isBindableObjectDefinePropertyCall:()=>ag,isBindableStaticAccessExpression:()=>lg,isBindableStaticElementAccessExpression:()=>_g,isBindableStaticNameExpression:()=>ug,isBindingElement:()=>fF,isBindingElementOfBareOrAccessedRequire:()=>qm,isBindingName:()=>a_,isBindingOrAssignmentElement:()=>E_,isBindingOrAssignmentPattern:()=>P_,isBindingPattern:()=>w_,isBlock:()=>GF,isBlockLike:()=>y0,isBlockOrCatchScoped:()=>_p,isBlockScope:()=>Tp,isBlockScopedContainerTopLevel:()=>gp,isBooleanLiteral:()=>__,isBreakOrContinueStatement:()=>Fl,isBreakStatement:()=>aE,isBuildCommand:()=>IK,isBuildInfoFile:()=>iU,isBuilderProgram:()=>F$,isBundle:()=>pP,isCallChain:()=>bl,isCallExpression:()=>vF,isCallExpressionTarget:()=>cX,isCallLikeExpression:()=>B_,isCallLikeOrFunctionLikeExpression:()=>R_,isCallOrNewExpression:()=>J_,isCallOrNewExpressionTarget:()=>_X,isCallSignatureDeclaration:()=>BD,isCallToHelper:()=>WN,isCaseBlock:()=>SE,isCaseClause:()=>iP,isCaseKeyword:()=>CD,isCaseOrDefaultClause:()=>wu,isCatchClause:()=>sP,isCatchClauseVariableDeclaration:()=>qT,isCatchClauseVariableDeclarationOrBindingElement:()=>up,isCheckJsEnabledForFile:()=>sT,isCircularBuildOrder:()=>cH,isClassDeclaration:()=>hE,isClassElement:()=>f_,isClassExpression:()=>MF,isClassInstanceProperty:()=>y_,isClassLike:()=>m_,isClassMemberModifier:()=>n_,isClassNamedEvaluationHelperBlock:()=>Xz,isClassOrTypeElement:()=>k_,isClassStaticBlockDeclaration:()=>LD,isClassThisAssignmentBlock:()=>Wz,isColonToken:()=>cD,isCommaExpression:()=>NA,isCommaListExpression:()=>$F,isCommaSequence:()=>DA,isCommaToken:()=>nD,isComment:()=>IQ,isCommonJsExportPropertyAssignment:()=>Bf,isCommonJsExportedExpression:()=>Rf,isCompoundAssignment:()=>fz,isComputedNonLiteralName:()=>Rp,isComputedPropertyName:()=>ND,isConciseBody:()=>nu,isConditionalExpression:()=>IF,isConditionalTypeNode:()=>tF,isConstAssertion:()=>kC,isConstTypeReference:()=>wl,isConstructSignatureDeclaration:()=>JD,isConstructorDeclaration:()=>jD,isConstructorTypeNode:()=>WD,isContextualKeyword:()=>Ah,isContinueStatement:()=>oE,isCustomPrologue:()=>yf,isDebuggerStatement:()=>pE,isDeclaration:()=>fu,isDeclarationBindingElement:()=>F_,isDeclarationFileName:()=>vO,isDeclarationName:()=>ph,isDeclarationNameOfEnumOrNamespace:()=>rx,isDeclarationReadonly:()=>sf,isDeclarationStatement:()=>mu,isDeclarationWithTypeParameterChildren:()=>wp,isDeclarationWithTypeParameters:()=>Cp,isDecorator:()=>ED,isDecoratorTarget:()=>dX,isDefaultClause:()=>oP,isDefaultImport:()=>Dg,isDefaultModifier:()=>fD,isDefaultedExpandoInitializer:()=>Ym,isDeleteExpression:()=>wF,isDeleteTarget:()=>uh,isDeprecatedDeclaration:()=>l0,isDestructuringAssignment:()=>lb,isDiskPathRoot:()=>xo,isDoStatement:()=>eE,isDocumentRegistryEntry:()=>G0,isDotDotDotToken:()=>tD,isDottedName:()=>pb,isDynamicName:()=>Uh,isEffectiveExternalModule:()=>xp,isEffectiveStrictModeSourceFile:()=>kp,isElementAccessChain:()=>vl,isElementAccessExpression:()=>yF,isEmittedFileOfProgram:()=>WU,isEmptyArrayLiteral:()=>Sb,isEmptyBindingElement:()=>oc,isEmptyBindingPattern:()=>ic,isEmptyObjectLiteral:()=>kb,isEmptyStatement:()=>QF,isEmptyStringLiteral:()=>km,isEntityName:()=>i_,isEntityNameExpression:()=>ub,isEnumConst:()=>af,isEnumDeclaration:()=>bE,isEnumMember:()=>uP,isEqualityOperatorKind:()=>CZ,isEqualsGreaterThanToken:()=>_D,isExclamationToken:()=>aD,isExcludedFile:()=>Wj,isExclusivelyTypeOnlyImportOrExport:()=>kV,isExpandoPropertyDeclaration:()=>fC,isExportAssignment:()=>ME,isExportDeclaration:()=>RE,isExportModifier:()=>pD,isExportName:()=>SA,isExportNamespaceAsDefaultDeclaration:()=>Gd,isExportOrDefaultModifier:()=>gI,isExportSpecifier:()=>JE,isExportsIdentifier:()=>ng,isExportsOrModuleExportsOrAlias:()=>lB,isExpression:()=>K_,isExpressionNode:()=>Tm,isExpressionOfExternalModuleImportEqualsDeclaration:()=>PX,isExpressionOfOptionalChainRoot:()=>Sl,isExpressionStatement:()=>YF,isExpressionWithTypeArguments:()=>BF,isExpressionWithTypeArgumentsInClassExtendsClause:()=>_b,isExternalModule:()=>uO,isExternalModuleAugmentation:()=>yp,isExternalModuleImportEqualsDeclaration:()=>Dm,isExternalModuleIndicator:()=>eu,isExternalModuleNameRelative:()=>Fs,isExternalModuleReference:()=>WE,isExternalModuleSymbol:()=>td,isExternalOrCommonJsModule:()=>rf,isFileLevelReservedGeneratedIdentifier:()=>Ql,isFileLevelUniqueName:()=>Ed,isFileProbablyExternalModule:()=>MI,isFirstDeclarationOfSymbolParameter:()=>MY,isFixablePromiseHandler:()=>W1,isForInOrOfStatement:()=>tu,isForInStatement:()=>rE,isForInitializer:()=>iu,isForOfStatement:()=>iE,isForStatement:()=>nE,isFullSourceFile:()=>Am,isFunctionBlock:()=>Uf,isFunctionBody:()=>ru,isFunctionDeclaration:()=>gE,isFunctionExpression:()=>TF,isFunctionExpressionOrArrowFunction:()=>UT,isFunctionLike:()=>s_,isFunctionLikeDeclaration:()=>l_,isFunctionLikeKind:()=>d_,isFunctionLikeOrClassStaticBlockDeclaration:()=>c_,isFunctionOrConstructorTypeNode:()=>C_,isFunctionOrModuleBlock:()=>p_,isFunctionSymbol:()=>bg,isFunctionTypeNode:()=>VD,isGeneratedIdentifier:()=>Gl,isGeneratedPrivateIdentifier:()=>Xl,isGetAccessor:()=>Pu,isGetAccessorDeclaration:()=>MD,isGetOrSetAccessorDeclaration:()=>hl,isGlobalScopeAugmentation:()=>hp,isGlobalSourceFile:()=>nf,isGrammarError:()=>Id,isHeritageClause:()=>aP,isHoistedFunction:()=>vf,isHoistedVariableStatement:()=>xf,isIdentifier:()=>uD,isIdentifierANonContextualKeyword:()=>Lh,isIdentifierName:()=>gh,isIdentifierOrThisTypeNode:()=>eI,isIdentifierPart:()=>ys,isIdentifierStart:()=>hs,isIdentifierText:()=>vs,isIdentifierTypePredicate:()=>$f,isIdentifierTypeReference:()=>wT,isIfStatement:()=>ZF,isIgnoredFileFromWildCardWatching:()=>VU,isImplicitGlob:()=>gS,isImportAttribute:()=>AE,isImportAttributeName:()=>Kl,isImportAttributes:()=>PE,isImportCall:()=>ff,isImportClause:()=>NE,isImportDeclaration:()=>wE,isImportEqualsDeclaration:()=>CE,isImportKeyword:()=>TD,isImportMeta:()=>mf,isImportOrExportSpecifier:()=>ql,isImportOrExportSpecifierName:()=>sZ,isImportSpecifier:()=>jE,isImportTypeAssertionContainer:()=>DE,isImportTypeNode:()=>lF,isImportable:()=>S0,isInComment:()=>DQ,isInCompoundLikeAssignment:()=>nh,isInExpressionContext:()=>Cm,isInJSDoc:()=>Mm,isInJSFile:()=>Om,isInJSXText:()=>kQ,isInJsonFile:()=>Lm,isInNonReferenceComment:()=>qQ,isInReferenceComment:()=>zQ,isInRightSideOfInternalImportEqualsDeclaration:()=>sX,isInString:()=>yQ,isInTemplateString:()=>xQ,isInTopLevelContext:()=>am,isInTypeQuery:()=>fv,isIncrementalBuildInfo:()=>OW,isIncrementalBundleEmitBuildInfo:()=>IW,isIncrementalCompilation:()=>Lk,isIndexSignatureDeclaration:()=>zD,isIndexedAccessTypeNode:()=>aF,isInferTypeNode:()=>nF,isInfinityOrNaNString:()=>zT,isInitializedProperty:()=>kz,isInitializedVariable:()=>ox,isInsideJsxElement:()=>SQ,isInsideJsxElementOrAttribute:()=>vQ,isInsideNodeModules:()=>GZ,isInsideTemplateLiteral:()=>MQ,isInstanceOfExpression:()=>bb,isInstantiatedModule:()=>dJ,isInterfaceDeclaration:()=>yE,isInternalDeclaration:()=>Wu,isInternalModuleImportEqualsDeclaration:()=>Pm,isInternalName:()=>xA,isIntersectionTypeNode:()=>eF,isIntrinsicJsxName:()=>Oy,isIterationStatement:()=>X_,isJSDoc:()=>DP,isJSDocAllType:()=>bP,isJSDocAugmentsTag:()=>PP,isJSDocAuthorTag:()=>AP,isJSDocCallbackTag:()=>OP,isJSDocClassTag:()=>IP,isJSDocCommentContainingNode:()=>Du,isJSDocConstructSignature:()=>Pg,isJSDocDeprecatedTag:()=>zP,isJSDocEnumTag:()=>UP,isJSDocFunctionType:()=>CP,isJSDocImplementsTag:()=>YP,isJSDocImportTag:()=>tA,isJSDocIndexSignature:()=>Rm,isJSDocLikeText:()=>jI,isJSDocLink:()=>hP,isJSDocLinkCode:()=>yP,isJSDocLinkLike:()=>zu,isJSDocLinkPlain:()=>vP,isJSDocMemberName:()=>gP,isJSDocNameReference:()=>mP,isJSDocNamepathType:()=>NP,isJSDocNamespaceBody:()=>su,isJSDocNode:()=>Nu,isJSDocNonNullableType:()=>SP,isJSDocNullableType:()=>kP,isJSDocOptionalParameter:()=>eC,isJSDocOptionalType:()=>TP,isJSDocOverloadTag:()=>JP,isJSDocOverrideTag:()=>BP,isJSDocParameterTag:()=>VP,isJSDocPrivateTag:()=>jP,isJSDocPropertyLikeTag:()=>Pl,isJSDocPropertyTag:()=>QP,isJSDocProtectedTag:()=>MP,isJSDocPublicTag:()=>LP,isJSDocReadonlyTag:()=>RP,isJSDocReturnTag:()=>WP,isJSDocSatisfiesExpression:()=>rC,isJSDocSatisfiesTag:()=>ZP,isJSDocSeeTag:()=>qP,isJSDocSignature:()=>EP,isJSDocTag:()=>Fu,isJSDocTemplateTag:()=>KP,isJSDocThisTag:()=>$P,isJSDocThrowsTag:()=>eA,isJSDocTypeAlias:()=>Ag,isJSDocTypeAssertion:()=>FA,isJSDocTypeExpression:()=>fP,isJSDocTypeLiteral:()=>FP,isJSDocTypeTag:()=>HP,isJSDocTypedefTag:()=>GP,isJSDocUnknownTag:()=>XP,isJSDocUnknownType:()=>xP,isJSDocVariadicType:()=>wP,isJSXTagName:()=>Sm,isJsonEqual:()=>vT,isJsonSourceFile:()=>of,isJsxAttribute:()=>ZE,isJsxAttributeLike:()=>ku,isJsxAttributeName:()=>cC,isJsxAttributes:()=>eP,isJsxCallLike:()=>Cu,isJsxChild:()=>xu,isJsxClosingElement:()=>GE,isJsxClosingFragment:()=>YE,isJsxElement:()=>$E,isJsxExpression:()=>nP,isJsxFragment:()=>XE,isJsxNamespacedName:()=>rP,isJsxOpeningElement:()=>KE,isJsxOpeningFragment:()=>QE,isJsxOpeningLikeElement:()=>Tu,isJsxOpeningLikeElementTagName:()=>pX,isJsxSelfClosingElement:()=>HE,isJsxSpreadAttribute:()=>tP,isJsxTagNameExpression:()=>bu,isJsxText:()=>GN,isJumpStatementTarget:()=>xX,isKeyword:()=>Fh,isKeywordOrPunctuation:()=>Ph,isKnownSymbol:()=>Gh,isLabelName:()=>SX,isLabelOfLabeledStatement:()=>kX,isLabeledStatement:()=>_E,isLateVisibilityPaintedStatement:()=>Ep,isLeftHandSideExpression:()=>q_,isLet:()=>df,isLineBreak:()=>Ka,isLiteralComputedPropertyDeclarationName:()=>mh,isLiteralExpression:()=>Ml,isLiteralExpressionOfObject:()=>Rl,isLiteralImportTypeNode:()=>gf,isLiteralKind:()=>jl,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>EX,isLiteralTypeLiteral:()=>H_,isLiteralTypeNode:()=>cF,isLocalName:()=>kA,isLogicalOperator:()=>eb,isLogicalOrCoalescingAssignmentExpression:()=>nb,isLogicalOrCoalescingAssignmentOperator:()=>tb,isLogicalOrCoalescingBinaryExpression:()=>ib,isLogicalOrCoalescingBinaryOperator:()=>rb,isMappedTypeNode:()=>sF,isMemberName:()=>gl,isMetaProperty:()=>UF,isMethodDeclaration:()=>OD,isMethodOrAccessor:()=>v_,isMethodSignature:()=>ID,isMinusToken:()=>iD,isMissingDeclaration:()=>qE,isMissingPackageJsonInfo:()=>PM,isModifier:()=>r_,isModifierKind:()=>e_,isModifierLike:()=>b_,isModuleAugmentationExternal:()=>vp,isModuleBlock:()=>kE,isModuleBody:()=>ou,isModuleDeclaration:()=>xE,isModuleExportName:()=>zE,isModuleExportsAccessExpression:()=>ig,isModuleIdentifier:()=>rg,isModuleName:()=>rI,isModuleOrEnumDeclaration:()=>lu,isModuleReference:()=>vu,isModuleSpecifierLike:()=>xY,isModuleWithStringLiteralName:()=>pp,isNameOfFunctionDeclaration:()=>FX,isNameOfModuleDeclaration:()=>DX,isNamedDeclaration:()=>Nc,isNamedEvaluation:()=>Zh,isNamedEvaluationSource:()=>Yh,isNamedExportBindings:()=>El,isNamedExports:()=>BE,isNamedImportBindings:()=>cu,isNamedImports:()=>LE,isNamedImportsOrExports:()=>Ex,isNamedTupleMember:()=>XD,isNamespaceBody:()=>au,isNamespaceExport:()=>OE,isNamespaceExportDeclaration:()=>TE,isNamespaceImport:()=>IE,isNamespaceReexportDeclaration:()=>Nm,isNewExpression:()=>bF,isNewExpressionTarget:()=>lX,isNewScopeNode:()=>LC,isNoSubstitutionTemplateLiteral:()=>QN,isNodeArray:()=>Ll,isNodeArrayMultiLine:()=>Xb,isNodeDescendantOf:()=>dh,isNodeKind:()=>Al,isNodeLikeSystem:()=>dn,isNodeModulesDirectory:()=>da,isNodeWithPossibleHoistedDeclaration:()=>rh,isNonContextualKeyword:()=>Ih,isNonGlobalAmbientModule:()=>fp,isNonNullAccess:()=>nC,isNonNullChain:()=>Dl,isNonNullExpression:()=>qF,isNonStaticMethodOrAccessorWithPrivateName:()=>Sz,isNotEmittedStatement:()=>UE,isNullishCoalesce:()=>Cl,isNumber:()=>nt,isNumericLiteral:()=>$N,isNumericLiteralName:()=>WT,isObjectBindingElementWithoutPropertyName:()=>kY,isObjectBindingOrAssignmentElement:()=>I_,isObjectBindingOrAssignmentPattern:()=>A_,isObjectBindingPattern:()=>dF,isObjectLiteralElement:()=>ju,isObjectLiteralElementLike:()=>S_,isObjectLiteralExpression:()=>gF,isObjectLiteralMethod:()=>Vf,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>Wf,isObjectTypeDeclaration:()=>wx,isOmittedExpression:()=>RF,isOptionalChain:()=>xl,isOptionalChainRoot:()=>kl,isOptionalDeclaration:()=>tC,isOptionalJSDocPropertyLikeTag:()=>QT,isOptionalTypeNode:()=>QD,isOuterExpression:()=>PA,isOutermostOptionalChain:()=>Tl,isOverrideModifier:()=>xD,isPackageJsonInfo:()=>EM,isPackedArrayLiteral:()=>jT,isParameter:()=>FD,isParameterPropertyDeclaration:()=>rc,isParameterPropertyModifier:()=>t_,isParenthesizedExpression:()=>SF,isParenthesizedTypeNode:()=>rF,isParseTreeNode:()=>gc,isPartOfParameterDeclaration:()=>ty,isPartOfTypeNode:()=>Ef,isPartOfTypeOnlyImportOrExportDeclaration:()=>$l,isPartOfTypeQuery:()=>wm,isPartiallyEmittedExpression:()=>WF,isPatternMatch:()=>en,isPinnedComment:()=>Ud,isPlainJsFile:()=>Cd,isPlusToken:()=>rD,isPossiblyTypeArgumentPosition:()=>CQ,isPostfixUnaryExpression:()=>PF,isPrefixUnaryExpression:()=>EF,isPrimitiveLiteralValue:()=>CC,isPrivateIdentifier:()=>dD,isPrivateIdentifierClassElementDeclaration:()=>Yl,isPrivateIdentifierPropertyAccessExpression:()=>Zl,isPrivateIdentifierSymbol:()=>Xh,isProgramUptoDate:()=>zV,isPrologueDirective:()=>hf,isPropertyAccessChain:()=>yl,isPropertyAccessEntityNameExpression:()=>fb,isPropertyAccessExpression:()=>hF,isPropertyAccessOrQualifiedName:()=>M_,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>j_,isPropertyAssignment:()=>cP,isPropertyDeclaration:()=>AD,isPropertyName:()=>o_,isPropertyNameLiteral:()=>Wh,isPropertySignature:()=>PD,isPrototypeAccess:()=>gb,isPrototypePropertyAssignment:()=>hg,isPunctuation:()=>Eh,isPushOrUnshiftIdentifier:()=>ey,isQualifiedName:()=>wD,isQuestionDotToken:()=>lD,isQuestionOrExclamationToken:()=>ZA,isQuestionOrPlusOrMinusToken:()=>nI,isQuestionToken:()=>sD,isReadonlyKeyword:()=>yD,isReadonlyKeywordOrPlusOrMinusToken:()=>tI,isRecognizedTripleSlashComment:()=>qd,isReferenceFileLocation:()=>BV,isReferencedFile:()=>RV,isRegularExpressionLiteral:()=>XN,isRequireCall:()=>Bm,isRequireVariableStatement:()=>Vm,isRestParameter:()=>Uu,isRestTypeNode:()=>YD,isReturnStatement:()=>sE,isReturnStatementWithFixablePromiseHandler:()=>V1,isRightSideOfAccessExpression:()=>yb,isRightSideOfInstanceofExpression:()=>xb,isRightSideOfPropertyAccess:()=>wX,isRightSideOfQualifiedName:()=>CX,isRightSideOfQualifiedNameOrPropertyAccess:()=>hb,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>vb,isRootedDiskPath:()=>bo,isSameEntityName:()=>eg,isSatisfiesExpression:()=>zF,isSemicolonClassElement:()=>KF,isSetAccessor:()=>Eu,isSetAccessorDeclaration:()=>RD,isShiftOperatorOrHigher:()=>iI,isShorthandAmbientModuleSymbol:()=>mp,isShorthandPropertyAssignment:()=>lP,isSideEffectImport:()=>DC,isSignedNumericLiteral:()=>zh,isSimpleCopiableExpression:()=>dz,isSimpleInlineableExpression:()=>pz,isSimpleParameterList:()=>Iz,isSingleOrDoubleQuote:()=>Wm,isSolutionConfig:()=>Sj,isSourceElement:()=>vC,isSourceFile:()=>dP,isSourceFileFromLibrary:()=>m0,isSourceFileJS:()=>Im,isSourceFileNotJson:()=>jm,isSourceMapping:()=>UJ,isSpecialPropertyDeclaration:()=>yg,isSpreadAssignment:()=>_P,isSpreadElement:()=>jF,isStatement:()=>hu,isStatementButNotDeclaration:()=>gu,isStatementOrBlock:()=>yu,isStatementWithLocals:()=>wd,isStatic:()=>Iv,isStaticModifier:()=>vD,isString:()=>tt,isStringANonContextualKeyword:()=>Oh,isStringAndEmptyAnonymousObjectIntersection:()=>jQ,isStringDoubleQuoted:()=>$m,isStringLiteral:()=>KN,isStringLiteralLike:()=>Ju,isStringLiteralOrJsxExpression:()=>Su,isStringLiteralOrTemplate:()=>wZ,isStringOrNumericLiteralLike:()=>Jh,isStringOrRegularExpressionOrTemplateLiteral:()=>OQ,isStringTextContainingNode:()=>Hl,isSuperCall:()=>pf,isSuperKeyword:()=>SD,isSuperProperty:()=>_m,isSupportedSourceFileName:()=>VS,isSwitchStatement:()=>lE,isSyntaxList:()=>nA,isSyntheticExpression:()=>VF,isSyntheticReference:()=>VE,isTagName:()=>TX,isTaggedTemplateExpression:()=>xF,isTaggedTemplateTag:()=>uX,isTemplateExpression:()=>OF,isTemplateHead:()=>YN,isTemplateLiteral:()=>z_,isTemplateLiteralKind:()=>Bl,isTemplateLiteralToken:()=>Jl,isTemplateLiteralTypeNode:()=>uF,isTemplateLiteralTypeSpan:()=>_F,isTemplateMiddle:()=>ZN,isTemplateMiddleOrTemplateTail:()=>zl,isTemplateSpan:()=>HF,isTemplateTail:()=>eD,isTextWhiteSpaceLike:()=>IY,isThis:()=>OX,isThisContainerOrFunctionBlock:()=>om,isThisIdentifier:()=>pv,isThisInTypeQuery:()=>mv,isThisInitializedDeclaration:()=>dm,isThisInitializedObjectBindingExpression:()=>pm,isThisProperty:()=>um,isThisTypeNode:()=>iF,isThisTypeParameter:()=>HT,isThisTypePredicate:()=>Hf,isThrowStatement:()=>uE,isToken:()=>Ol,isTokenKind:()=>Il,isTraceEnabled:()=>oM,isTransientSymbol:()=>ed,isTrivia:()=>jh,isTryStatement:()=>dE,isTupleTypeNode:()=>GD,isTypeAlias:()=>Ig,isTypeAliasDeclaration:()=>vE,isTypeAssertionExpression:()=>kF,isTypeDeclaration:()=>GT,isTypeElement:()=>x_,isTypeKeyword:()=>ZQ,isTypeKeywordTokenOrIdentifier:()=>tY,isTypeLiteralNode:()=>HD,isTypeNode:()=>T_,isTypeNodeKind:()=>Nx,isTypeOfExpression:()=>NF,isTypeOnlyExportDeclaration:()=>Vl,isTypeOnlyImportDeclaration:()=>Ul,isTypeOnlyImportOrExportDeclaration:()=>Wl,isTypeOperatorNode:()=>oF,isTypeParameterDeclaration:()=>DD,isTypePredicateNode:()=>qD,isTypeQueryNode:()=>$D,isTypeReferenceNode:()=>UD,isTypeReferenceType:()=>Mu,isTypeUsableAsPropertyName:()=>dC,isUMDExportSymbol:()=>kx,isUnaryExpression:()=>V_,isUnaryExpressionWithWrite:()=>$_,isUnicodeIdentifierStart:()=>Ea,isUnionTypeNode:()=>ZD,isUrl:()=>vo,isValidBigIntString:()=>TT,isValidESSymbolDeclaration:()=>Jf,isValidTypeOnlyAliasUseSite:()=>CT,isValueSignatureDeclaration:()=>ih,isVarAwaitUsing:()=>cf,isVarConst:()=>_f,isVarConstLike:()=>uf,isVarUsing:()=>lf,isVariableDeclaration:()=>fE,isVariableDeclarationInVariableStatement:()=>Mf,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>zm,isVariableDeclarationInitializedToRequire:()=>Jm,isVariableDeclarationList:()=>mE,isVariableLike:()=>jf,isVariableStatement:()=>XF,isVoidExpression:()=>DF,isWatchSet:()=>ax,isWhileStatement:()=>tE,isWhiteSpaceLike:()=>$a,isWhiteSpaceSingleLine:()=>Ha,isWithStatement:()=>cE,isWriteAccess:()=>px,isWriteOnlyAccess:()=>dx,isYieldExpression:()=>LF,jsxModeNeedsExplicitImport:()=>f0,keywordPart:()=>qY,last:()=>xe,lastOrUndefined:()=>be,length:()=>d,libMap:()=>LO,libs:()=>OO,lineBreakPart:()=>nZ,loadModuleFromGlobalCache:()=>GR,loadWithModeAwareCache:()=>OV,makeIdentifierFromModuleName:()=>lp,makeImport:()=>pY,makeStringLiteral:()=>fY,mangleScopedPackageName:()=>qR,map:()=>P,mapAllOrFail:()=>B,mapDefined:()=>J,mapDefinedIterator:()=>z,mapEntries:()=>$,mapIterator:()=>A,mapOneOrMany:()=>t0,mapToDisplayParts:()=>rZ,matchFiles:()=>kS,matchPatternOrExact:()=>lT,matchedText:()=>Gt,matchesExclude:()=>Hj,matchesExcludeWorker:()=>Kj,maxBy:()=>St,maybeBind:()=>He,maybeSetLocalizedDiagnosticMessages:()=>Kx,memoize:()=>ft,memoizeOne:()=>mt,min:()=>Tt,minAndMax:()=>dT,missingFileModifiedTime:()=>Ui,modifierToFlag:()=>Yv,modifiersToFlags:()=>Qv,moduleExportNameIsDefault:()=>Yd,moduleExportNameTextEscaped:()=>Qd,moduleExportNameTextUnescaped:()=>Xd,moduleOptionDeclaration:()=>BO,moduleResolutionIsEqualTo:()=>pd,moduleResolutionNameAndModeGetter:()=>FV,moduleResolutionOptionDeclarations:()=>WO,moduleResolutionSupportsPackageJsonExportsAndImports:()=>Uk,moduleResolutionUsesNodeModules:()=>dY,moduleSpecifierToValidIdentifier:()=>a0,moduleSpecifiers:()=>pB,moduleSupportsImportAttributes:()=>Vk,moduleSymbolToValidIdentifier:()=>o0,moveEmitHelpers:()=>Qw,moveRangeEnd:()=>Rb,moveRangePastDecorators:()=>Jb,moveRangePastModifiers:()=>zb,moveRangePos:()=>Bb,moveSyntheticComments:()=>Vw,mutateMap:()=>yx,mutateMapSkippingNewValues:()=>hx,needsParentheses:()=>kZ,needsScopeMarker:()=>Z_,newCaseClauseTracker:()=>g0,newPrivateEnvironment:()=>Dz,noEmitNotification:()=>eU,noEmitSubstitution:()=>Zq,noTransformers:()=>$q,noTruncationMaximumTruncationLength:()=>Gu,nodeCanBeDecorated:()=>gm,nodeCoreModules:()=>AC,nodeHasName:()=>Cc,nodeIsDecorated:()=>hm,nodeIsMissing:()=>Pd,nodeIsPresent:()=>Ad,nodeIsSynthesized:()=>iy,nodeModuleNameResolver:()=>ZM,nodeModulesPathPart:()=>oR,nodeNextJsonConfigResolver:()=>eR,nodeOrChildIsDecorated:()=>ym,nodeOverlapsWithStartEnd:()=>qX,nodePosToString:()=>Dd,nodeSeenTracker:()=>nY,nodeStartsNewLexicalEnvironment:()=>ry,noop:()=>ot,noopFileWatcher:()=>R$,normalizePath:()=>Vo,normalizeSlashes:()=>Ro,normalizeSpans:()=>Ks,not:()=>rn,notImplemented:()=>pt,notImplementedResolver:()=>DU,nullNodeConverters:()=>iw,nullParenthesizerRules:()=>tw,nullTransformationContext:()=>nU,objectAllocator:()=>qx,operatorPart:()=>VY,optionDeclarations:()=>zO,optionMapToObject:()=>YL,optionsAffectingProgramStructure:()=>HO,optionsForBuild:()=>eL,optionsForWatch:()=>jO,optionsHaveChanges:()=>od,or:()=>nn,orderedRemoveItem:()=>Ut,orderedRemoveItemAt:()=>Vt,packageIdToPackageName:()=>yd,packageIdToString:()=>vd,parameterIsThisKeyword:()=>dv,parameterNamePart:()=>WY,parseBaseNodeFactory:()=>AI,parseBigInt:()=>kT,parseBuildCommand:()=>kL,parseCommandLine:()=>hL,parseCommandLineWorker:()=>pL,parseConfigFileTextToJson:()=>wL,parseConfigFileWithSystem:()=>S$,parseConfigHostFromCompilerHostLike:()=>eW,parseCustomTypeOption:()=>lL,parseIsolatedEntityName:()=>lO,parseIsolatedJSDocComment:()=>pO,parseJSDocTypeExpressionForTests:()=>fO,parseJsonConfigFileContent:()=>sj,parseJsonSourceFileConfigFileContent:()=>cj,parseJsonText:()=>_O,parseListTypeOption:()=>_L,parseNodeFactory:()=>II,parseNodeModuleFromPath:()=>sR,parsePackageName:()=>wR,parsePseudoBigInt:()=>bT,parseValidBigInt:()=>ST,pasteEdits:()=>Lfe,patchWriteFileEnsuringDirectory:()=>_o,pathContainsNodeModules:()=>aR,pathIsAbsolute:()=>ko,pathIsBareSpecifier:()=>To,pathIsRelative:()=>So,patternText:()=>Kt,performIncrementalCompilation:()=>Q$,performance:()=>$n,positionBelongsToNode:()=>VX,positionIsASICandidate:()=>jZ,positionIsSynthesized:()=>tT,positionsAreOnSameLine:()=>Qb,preProcessFile:()=>O1,probablyUsesSemicolons:()=>MZ,processCommentPragmas:()=>xO,processPragmasIntoFields:()=>kO,processTaggedTemplateExpression:()=>rq,programContainsEsModules:()=>cY,programContainsModules:()=>sY,projectReferenceIsEqualTo:()=>dd,propertyNamePart:()=>$Y,pseudoBigIntToString:()=>xT,punctuationPart:()=>UY,pushIfUnique:()=>_e,quote:()=>TZ,quotePreferenceFromString:()=>gY,rangeContainsPosition:()=>RX,rangeContainsPositionExclusive:()=>BX,rangeContainsRange:()=>tx,rangeContainsRangeExclusive:()=>MX,rangeContainsStartEnd:()=>JX,rangeEndIsOnSameLineAsRangeStart:()=>Hb,rangeEndPositionsAreOnSameLine:()=>Wb,rangeEquals:()=>fe,rangeIsOnSingleLine:()=>Ub,rangeOfNode:()=>pT,rangeOfTypeParameters:()=>fT,rangeOverlapsWithStartEnd:()=>zX,rangeStartIsOnSameLineAsRangeEnd:()=>$b,rangeStartPositionsAreOnSameLine:()=>Vb,readBuilderProgram:()=>Y$,readConfigFile:()=>CL,readJson:()=>Pb,readJsonConfigFile:()=>NL,readJsonOrUndefined:()=>Eb,reduceEachLeadingCommentRange:()=>us,reduceEachTrailingCommentRange:()=>ds,reduceLeft:()=>De,reduceLeftIterator:()=>h,reducePathComponents:()=>Bo,refactor:()=>f6,regExpEscape:()=>aS,regularExpressionFlagToCharacterCode:()=>ja,relativeComplement:()=>oe,removeAllComments:()=>Cw,removeEmitHelper:()=>Gw,removeExtension:()=>XS,removeFileExtension:()=>KS,removeIgnoredPath:()=>e$,removeMinAndVersionNumbers:()=>qt,removePrefix:()=>Yt,removeSuffix:()=>Jt,removeTrailingDirectorySeparator:()=>Ko,repeatString:()=>iY,replaceElement:()=>Ce,replaceFirstStar:()=>hC,resolutionExtensionIsTSOrJson:()=>rT,resolveConfigFileProjectName:()=>iH,resolveJSModule:()=>GM,resolveLibrary:()=>WM,resolveModuleName:()=>HM,resolveModuleNameFromCache:()=>$M,resolvePackageNameToPackageJson:()=>DM,resolvePath:()=>zo,resolveProjectReferencePath:()=>tW,resolveTripleslashReference:()=>QU,resolveTypeReferenceDirective:()=>CM,resolvingEmptyArray:()=>$u,returnFalse:()=>at,returnNoopFileWatcher:()=>B$,returnTrue:()=>st,returnUndefined:()=>ct,returnsPromise:()=>U1,rewriteModuleSpecifier:()=>Oz,sameFlatMap:()=>R,sameMap:()=>I,sameMapping:()=>qJ,scanTokenAtPosition:()=>ef,scanner:()=>rX,semanticDiagnosticsOptionDeclarations:()=>qO,serializeCompilerOptions:()=>nj,server:()=>$fe,servicesVersion:()=>M8,setCommentRange:()=>Mw,setConfigFileInOptions:()=>lj,setConstantValue:()=>$w,setEmitFlags:()=>ww,setGetSourceFileAsHashVersioned:()=>W$,setIdentifierAutoGenerate:()=>oN,setIdentifierGeneratedImportReference:()=>sN,setIdentifierTypeArguments:()=>rN,setInternalEmitFlags:()=>Dw,setLocalizedDiagnosticMessages:()=>Hx,setNodeChildren:()=>aA,setNodeFlags:()=>AT,setObjectAllocator:()=>Wx,setOriginalNode:()=>kw,setParent:()=>IT,setParentRecursive:()=>OT,setPrivateIdentifier:()=>Ez,setSnippetElement:()=>Zw,setSourceMapRange:()=>Pw,setStackTraceLimit:()=>Ji,setStartsOnNewLine:()=>Lw,setSyntheticLeadingComments:()=>Bw,setSyntheticTrailingComments:()=>qw,setSys:()=>po,setSysLog:()=>io,setTextRange:()=>FI,setTextRangeEnd:()=>FT,setTextRangePos:()=>DT,setTextRangePosEnd:()=>ET,setTextRangePosWidth:()=>PT,setTokenSourceMapRange:()=>Iw,setTypeNode:()=>tN,setUILocale:()=>It,setValueDeclaration:()=>vg,shouldAllowImportingTsExtension:()=>KR,shouldPreserveConstEnums:()=>Ok,shouldRewriteModuleSpecifier:()=>Cg,shouldUseUriStyleNodeCoreModules:()=>_0,showModuleSpecifier:()=>Sx,signatureHasRestParameter:()=>hJ,signatureToDisplayParts:()=>aZ,single:()=>Se,singleElementArray:()=>an,singleIterator:()=>V,singleOrMany:()=>Te,singleOrUndefined:()=>ke,skipAlias:()=>_x,skipConstraint:()=>oY,skipOuterExpressions:()=>AA,skipParentheses:()=>_h,skipPartiallyEmittedExpressions:()=>Nl,skipTrivia:()=>ts,skipTypeChecking:()=>mT,skipTypeCheckingIgnoringNoCheck:()=>gT,skipTypeParentheses:()=>lh,skipWhile:()=>un,sliceAfter:()=>_T,some:()=>H,sortAndDeduplicate:()=>ne,sortAndDeduplicateDiagnostics:()=>Es,sourceFileAffectingCompilerOptions:()=>$O,sourceFileMayBeEmitted:()=>ev,sourceMapCommentRegExp:()=>LJ,sourceMapCommentRegExpDontCareLineStart:()=>OJ,spacePart:()=>zY,spanMap:()=>W,startEndContainsRange:()=>nx,startEndOverlapsWithStartEnd:()=>UX,startOnNewLine:()=>OA,startTracing:()=>fr,startsWith:()=>Qt,startsWithDirectory:()=>oa,startsWithUnderscore:()=>c0,startsWithUseStrict:()=>wA,stringContainsAt:()=>s0,stringToToken:()=>Oa,stripQuotes:()=>Iy,supportedDeclarationExtensions:()=>OS,supportedJSExtensionsFlat:()=>PS,supportedLocaleDirectories:()=>dc,supportedTSExtensionsFlat:()=>DS,supportedTSImplementationExtensions:()=>LS,suppressLeadingAndTrailingTrivia:()=>KC,suppressLeadingTrivia:()=>GC,suppressTrailingTrivia:()=>XC,symbolEscapedNameNoDefault:()=>bY,symbolName:()=>kc,symbolNameNoDefault:()=>vY,symbolToDisplayParts:()=>oZ,sys:()=>uo,sysLog:()=>ro,tagNamesAreEquivalent:()=>FO,takeWhile:()=>_n,targetOptionDeclaration:()=>RO,targetToLibMap:()=>Ps,testFormatSettings:()=>$G,textChangeRangeIsUnchanged:()=>Ys,textChangeRangeNewSpan:()=>Qs,textChanges:()=>ide,textOrKeywordPart:()=>HY,textPart:()=>KY,textRangeContainsPositionInclusive:()=>js,textRangeContainsTextSpan:()=>Bs,textRangeIntersectsWithTextSpan:()=>$s,textSpanContainsPosition:()=>Ls,textSpanContainsTextRange:()=>Rs,textSpanContainsTextSpan:()=>Ms,textSpanEnd:()=>Is,textSpanIntersection:()=>Hs,textSpanIntersectsWith:()=>Us,textSpanIntersectsWithPosition:()=>Ws,textSpanIntersectsWithTextSpan:()=>qs,textSpanIsEmpty:()=>Os,textSpanOverlap:()=>zs,textSpanOverlapsWith:()=>Js,textSpansEqual:()=>FY,textToKeywordObj:()=>ha,timestamp:()=>Wn,toArray:()=>et,toBuilderFileEmit:()=>WW,toBuilderStateFileInfoForMultiEmit:()=>VW,toEditorSettings:()=>e7,toFileNameLowerCase:()=>dt,toPath:()=>Ho,toProgramEmitPending:()=>$W,toSorted:()=>de,tokenIsIdentifierOrKeyword:()=>ma,tokenIsIdentifierOrKeywordOrGreaterThan:()=>ga,tokenToString:()=>Ia,trace:()=>iM,tracing:()=>Gn,tracingEnabled:()=>Xn,transferSourceFileChildren:()=>cA,transform:()=>v7,transformClassFields:()=>cq,transformDeclarations:()=>Uq,transformECMAScriptModule:()=>Oq,transformES2015:()=>Fq,transformES2016:()=>Nq,transformES2017:()=>pq,transformES2018:()=>mq,transformES2019:()=>gq,transformES2020:()=>hq,transformES2021:()=>yq,transformESDecorators:()=>dq,transformESNext:()=>vq,transformGenerators:()=>Eq,transformImpliedNodeFormatDependentModule:()=>Lq,transformJsx:()=>Cq,transformLegacyDecorators:()=>uq,transformModule:()=>Pq,transformNamedEvaluation:()=>tq,transformNodes:()=>tU,transformSystemModule:()=>Iq,transformTypeScript:()=>sq,transpile:()=>o2,transpileDeclaration:()=>Z1,transpileModule:()=>Y1,transpileOptionValueCompilerOptions:()=>KO,tryAddToSet:()=>U,tryAndIgnoreErrors:()=>qZ,tryCast:()=>rt,tryDirectoryExists:()=>zZ,tryExtractTSExtension:()=>Cb,tryFileExists:()=>JZ,tryGetClassExtendingExpressionWithTypeArguments:()=>ab,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>sb,tryGetDirectories:()=>RZ,tryGetExtensionFromPath:()=>aT,tryGetImportFromModuleSpecifier:()=>Tg,tryGetJSDocSatisfiesTypeNode:()=>oC,tryGetModuleNameFromFile:()=>JA,tryGetModuleSpecifierFromDeclaration:()=>kg,tryGetNativePerformanceHooks:()=>qn,tryGetPropertyAccessOrIdentifierToString:()=>mb,tryGetPropertyNameOfBindingOrAssignmentElement:()=>WA,tryGetSourceMappingURL:()=>RJ,tryGetTextOfPropertyName:()=>Bp,tryParseJson:()=>Ab,tryParsePattern:()=>YS,tryParsePatterns:()=>eT,tryParseRawSourceMap:()=>JJ,tryReadDirectory:()=>BZ,tryReadFile:()=>DL,tryRemoveDirectoryPrefix:()=>iS,tryRemoveExtension:()=>GS,tryRemovePrefix:()=>Zt,tryRemoveSuffix:()=>zt,tscBuildOption:()=>ZO,typeAcquisitionDeclarations:()=>nL,typeAliasNamePart:()=>GY,typeDirectiveIsEqualTo:()=>bd,typeKeywords:()=>YQ,typeParameterNamePart:()=>XY,typeToDisplayParts:()=>iZ,unchangedPollThresholds:()=>Ki,unchangedTextChangeRange:()=>ec,unescapeLeadingUnderscores:()=>vc,unmangleScopedPackageName:()=>VR,unorderedRemoveItem:()=>$t,unprefixedNodeCoreModules:()=>EC,unreachableCodeIsError:()=>zk,unsetNodeChildren:()=>sA,unusedLabelIsError:()=>qk,unwrapInnermostStatementOfLabel:()=>qf,unwrapParenthesizedExpression:()=>wC,updateErrorForNoInputFiles:()=>Cj,updateLanguageServiceSourceFile:()=>c7,updateMissingFilePathsWatch:()=>qU,updateResolutionField:()=>fM,updateSharedExtendedConfigFileWatcher:()=>BU,updateSourceFile:()=>dO,updateWatchingWildcardDirectories:()=>UU,usingSingleLineStringWriter:()=>_d,utf16EncodeAsString:()=>Ts,validateLocaleAndSetLanguage:()=>pc,version:()=>c,versionMajorMinor:()=>s,visitArray:()=>kJ,visitCommaListElements:()=>FJ,visitEachChild:()=>EJ,visitFunctionBody:()=>NJ,visitIterationBody:()=>DJ,visitLexicalEnvironment:()=>TJ,visitNode:()=>bJ,visitNodes:()=>xJ,visitParameterList:()=>CJ,walkUpBindingElementsAndPatterns:()=>ac,walkUpOuterExpressions:()=>IA,walkUpParenthesizedExpressions:()=>sh,walkUpParenthesizedTypes:()=>ah,walkUpParenthesizedTypesAndGetParentAndChild:()=>ch,whitespaceOrMapCommentRegExp:()=>jJ,writeCommentRange:()=>wv,writeFile:()=>rv,writeFileEnsuringDirectories:()=>ov,zipWith:()=>y});var Bfe,Jfe=!0;function zfe(e,t,n,r,i){let o=t?"DeprecationError: ":"DeprecationWarning: ";return o+=`'${e}' `,o+=r?`has been deprecated since v${r}`:"is deprecated",o+=t?" and can no longer be used.":n?` and will no longer be usable after v${n}.`:".",o+=i?` ${$x(i,[e])}`:"",o}function qfe(e,t={}){const n="string"==typeof t.typeScriptVersion?new kn(t.typeScriptVersion):t.typeScriptVersion??Bfe??(Bfe=new kn(c)),r="string"==typeof t.errorAfter?new kn(t.errorAfter):t.errorAfter,i="string"==typeof t.warnAfter?new kn(t.warnAfter):t.warnAfter,o="string"==typeof t.since?new kn(t.since):t.since??i,a=t.error||r&&n.compareTo(r)>=0,s=!i||n.compareTo(i)>=0;return a?function(e,t,n,r){const i=zfe(e,!0,t,n,r);return()=>{throw new TypeError(i)}}(e,r,o,t.message):s?function(e,t,n,r){let i=!1;return()=>{Jfe&&!i&&(pn.log.warn(zfe(e,!1,t,n,r)),i=!0)}}(e,r,o,t.message):ot}function Ufe(e,t){return function(e,t){return function(){return e(),t.apply(this,arguments)}}(qfe((null==t?void 0:t.name)??pn.getFunctionName(e),t),e)}function Vfe(e,t,n,r){if(Object.defineProperty(o,"name",{...Object.getOwnPropertyDescriptor(o,"name"),value:e}),r)for(const n of Object.keys(r)){const i=+n;!isNaN(i)&&Ee(t,`${i}`)&&(t[i]=Ufe(t[i],{...r[i],name:e}))}const i=function(e,t){return n=>{for(let r=0;Ee(e,`${r}`)&&Ee(t,`${r}`);r++){if((0,t[r])(n))return r}}}(t,n);return o;function o(...e){const n=i(e),r=void 0!==n?t[n]:void 0;if("function"==typeof r)return r(...e);throw new TypeError("Invalid arguments")}}function Wfe(e){return{overload:t=>({bind:n=>({finish:()=>Vfe(e,t,n),deprecate:r=>({finish:()=>Vfe(e,t,n,r)})})})}}var $fe={};o($fe,{ActionInvalidate:()=>lG,ActionPackageInstalled:()=>_G,ActionSet:()=>cG,ActionWatchTypingLocations:()=>mG,Arguments:()=>aG,AutoImportProviderProject:()=>Wme,AuxiliaryProject:()=>Ume,CharRangeSection:()=>Mhe,CloseFileWatcherEvent:()=>uge,CommandNames:()=>uhe,ConfigFileDiagEvent:()=>oge,ConfiguredProject:()=>$me,ConfiguredProjectLoadKind:()=>Ige,CreateDirectoryWatcherEvent:()=>_ge,CreateFileWatcherEvent:()=>lge,Errors:()=>eme,EventBeginInstallTypes:()=>dG,EventEndInstallTypes:()=>pG,EventInitializationFailed:()=>fG,EventTypesRegistry:()=>uG,ExternalProject:()=>Hme,GcTimer:()=>gme,InferredProject:()=>qme,LargeFileReferencedEvent:()=>ige,LineIndex:()=>Uhe,LineLeaf:()=>Whe,LineNode:()=>Vhe,LogLevel:()=>nme,Msg:()=>ime,OpenFileInfoTelemetryEvent:()=>cge,Project:()=>zme,ProjectInfoTelemetryEvent:()=>sge,ProjectKind:()=>Ome,ProjectLanguageServiceStateEvent:()=>age,ProjectLoadingFinishEvent:()=>rge,ProjectLoadingStartEvent:()=>nge,ProjectService:()=>ehe,ProjectsUpdatedInBackgroundEvent:()=>tge,ScriptInfo:()=>Pme,ScriptVersionCache:()=>zhe,Session:()=>Fhe,TextStorage:()=>Fme,ThrottledOperations:()=>mme,TypingsInstallerAdapter:()=>Hhe,allFilesAreJsOrDts:()=>Mme,allRootFilesAreJsOrDts:()=>jme,asNormalizedPath:()=>cme,convertCompilerOptions:()=>vge,convertFormatOptions:()=>yge,convertScriptKindName:()=>Sge,convertTypeAcquisition:()=>xge,convertUserPreferences:()=>Tge,convertWatchOptions:()=>bge,countEachFileTypes:()=>Lme,createInstallTypingsRequest:()=>ome,createModuleSpecifierCache:()=>rhe,createNormalizedPathMap:()=>lme,createPackageJsonCache:()=>ihe,createSortedArray:()=>fme,emptyArray:()=>rme,findArgument:()=>hG,formatDiagnosticToProtocol:()=>_he,formatMessage:()=>dhe,getBaseConfigFileName:()=>hme,getDetailWatchInfo:()=>zge,getLocationInNewDocument:()=>Ohe,hasArgument:()=>gG,hasNoTypeScriptSource:()=>Rme,indent:()=>bG,isBackgroundProject:()=>Qme,isConfigFile:()=>the,isConfiguredProject:()=>Gme,isDynamicFileName:()=>Eme,isExternalProject:()=>Xme,isInferredProject:()=>Kme,isInferredProjectName:()=>_me,isProjectDeferredClose:()=>Yme,makeAutoImportProviderProjectName:()=>dme,makeAuxiliaryProjectName:()=>pme,makeInferredProjectName:()=>ume,maxFileSize:()=>ege,maxProgramSizeForNonTsFiles:()=>Zme,normalizedPathToPath:()=>sme,nowString:()=>yG,nullCancellationToken:()=>ohe,nullTypingsInstaller:()=>Dge,protocol:()=>yme,scriptInfoIsContainedByBackgroundProject:()=>Ame,scriptInfoIsContainedByDeferredClosedProject:()=>Ime,stringifyIndented:()=>xG,toEvent:()=>fhe,toNormalizedPath:()=>ame,tryConvertScriptKindName:()=>kge,typingsInstaller:()=>Hfe,updateProjectIfDirty:()=>Uge});var Hfe={};o(Hfe,{TypingsInstaller:()=>Yfe,getNpmCommandForInstallation:()=>Qfe,installNpmPackages:()=>Xfe,typingsName:()=>Zfe});var Kfe={isEnabled:()=>!1,writeLine:ot};function Gfe(e,t,n,r){try{const r=HM(t,Jo(e,"index.d.ts"),{moduleResolution:2},n);return r.resolvedModule&&r.resolvedModule.resolvedFileName}catch(n){return void(r.isEnabled()&&r.writeLine(`Failed to resolve ${t} in folder '${e}': ${n.message}`))}}function Xfe(e,t,n,r){let i=!1;for(let o=n.length;o>0;){const a=Qfe(e,t,n,o);o=a.remaining,i=r(a.command)||i}return i}function Qfe(e,t,n,r){const i=n.length-r;let o,a=r;for(;o=`${e} install --ignore-scripts ${(a===n.length?n:n.slice(i,i+a)).join(" ")} --save-dev --user-agent="typesInstaller/${t}"`,!(o.length<8e3);)a-=Math.floor(a/2);return{command:o,remaining:r-a}}var Yfe=class{constructor(e,t,n,r,i,o=Kfe){this.installTypingHost=e,this.globalCachePath=t,this.safeListPath=n,this.typesMapLocation=r,this.throttleLimit=i,this.log=o,this.packageNameToTypingLocation=new Map,this.missingTypingsSet=new Set,this.knownCachesSet=new Set,this.projectWatchers=new Map,this.pendingRunRequests=[],this.installRunCount=1,this.inFlightRequestCount=0,this.latestDistTag="latest";this.log.isEnabled()&&this.log.writeLine(`Global cache location '${t}', safe file path '${n}', types map path ${r}`),this.processCacheLocation(this.globalCachePath)}handleRequest(e){switch(e.kind){case"discover":this.install(e);break;case"closeProject":this.closeProject(e);break;case"typesRegistry":{const e={};this.typesRegistry.forEach((t,n)=>{e[n]=t});const t={kind:uG,typesRegistry:e};this.sendResponse(t);break}case"installPackage":this.installPackage(e);break;default:pn.assertNever(e)}}closeProject(e){this.closeWatchers(e.projectName)}closeWatchers(e){this.log.isEnabled()&&this.log.writeLine(`Closing file watchers for project '${e}'`);this.projectWatchers.get(e)?(this.projectWatchers.delete(e),this.sendResponse({kind:mG,projectName:e,files:[]}),this.log.isEnabled()&&this.log.writeLine(`Closing file watchers for project '${e}' - done.`)):this.log.isEnabled()&&this.log.writeLine(`No watchers are registered for project '${e}'`)}install(e){this.log.isEnabled()&&this.log.writeLine(`Got install request${xG(e)}`),e.cachePath&&(this.log.isEnabled()&&this.log.writeLine(`Request specifies cache path '${e.cachePath}', loading cached information...`),this.processCacheLocation(e.cachePath)),void 0===this.safeList&&this.initializeSafeList();const t=oG.discoverTypings(this.installTypingHost,this.log.isEnabled()?e=>this.log.writeLine(e):void 0,e.fileNames,e.projectRootPath,this.safeList,this.packageNameToTypingLocation,e.typeAcquisition,e.unresolvedImports,this.typesRegistry,e.compilerOptions);this.watchFiles(e.projectName,t.filesToWatch),t.newTypingNames.length?this.installTypings(e,e.cachePath||this.globalCachePath,t.cachedTypingPaths,t.newTypingNames):(this.sendResponse(this.createSetTypings(e,t.cachedTypingPaths)),this.log.isEnabled()&&this.log.writeLine("No new typings were requested as a result of typings discovery"))}installPackage(e){const{fileName:t,packageName:n,projectName:r,projectRootPath:i,id:o}=e,a=ua(Ao(t),e=>{if(this.installTypingHost.fileExists(Jo(e,"package.json")))return e})||i;if(a)this.installWorker(-1,[n],a,e=>{const t={kind:_G,projectName:r,id:o,success:e,message:e?`Package ${n} installed.`:`There was an error installing ${n}.`};this.sendResponse(t)});else{const e={kind:_G,projectName:r,id:o,success:!1,message:"Could not determine a project root path."};this.sendResponse(e)}}initializeSafeList(){if(this.typesMapLocation){const e=oG.loadTypesMap(this.installTypingHost,this.typesMapLocation);if(e)return this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`),void(this.safeList=e);this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`)}this.safeList=oG.loadSafeList(this.installTypingHost,this.safeListPath)}processCacheLocation(e){if(this.log.isEnabled()&&this.log.writeLine(`Processing cache location '${e}'`),this.knownCachesSet.has(e))return void(this.log.isEnabled()&&this.log.writeLine("Cache location was already processed..."));const t=Jo(e,"package.json"),n=Jo(e,"package-lock.json");if(this.log.isEnabled()&&this.log.writeLine(`Trying to find '${t}'...`),this.installTypingHost.fileExists(t)&&this.installTypingHost.fileExists(n)){const r=JSON.parse(this.installTypingHost.readFile(t)),i=JSON.parse(this.installTypingHost.readFile(n));if(this.log.isEnabled()&&(this.log.writeLine(`Loaded content of '${t}':${xG(r)}`),this.log.writeLine(`Loaded content of '${n}':${xG(i)}`)),r.devDependencies&&(i.packages||i.dependencies))for(const t in r.devDependencies){if(i.packages&&!Ee(i.packages,`node_modules/${t}`)||i.dependencies&&!Ee(i.dependencies,t))continue;const n=Io(t);if(!n)continue;const r=Gfe(e,n,this.installTypingHost,this.log);if(!r){this.missingTypingsSet.add(n);continue}const o=this.packageNameToTypingLocation.get(n);if(o){if(o.typingLocation===r)continue;this.log.isEnabled()&&this.log.writeLine(`New typing for package ${n} from '${r}' conflicts with existing typing file '${o}'`)}this.log.isEnabled()&&this.log.writeLine(`Adding entry into typings cache: '${n}' => '${r}'`);const a=i.packages&&Pe(i.packages,`node_modules/${t}`)||Pe(i.dependencies,t),s=a&&a.version;if(!s)continue;const c={typingLocation:r,version:new kn(s)};this.packageNameToTypingLocation.set(n,c)}}this.log.isEnabled()&&this.log.writeLine(`Finished processing cache location '${e}'`),this.knownCachesSet.add(e)}filterTypings(e){return J(e,e=>{const t=qR(e);if(this.missingTypingsSet.has(t))return void(this.log.isEnabled()&&this.log.writeLine(`'${e}':: '${t}' is in missingTypingsSet - skipping...`));const n=oG.validatePackageName(e);if(n!==oG.NameValidationResult.Ok)return this.missingTypingsSet.add(t),void(this.log.isEnabled()&&this.log.writeLine(oG.renderPackageNameValidationFailure(n,e)));if(this.typesRegistry.has(t)){if(!this.packageNameToTypingLocation.get(t)||!oG.isTypingUpToDate(this.packageNameToTypingLocation.get(t),this.typesRegistry.get(t)))return t;this.log.isEnabled()&&this.log.writeLine(`'${e}':: '${t}' already has an up-to-date typing - skipping...`)}else this.log.isEnabled()&&this.log.writeLine(`'${e}':: Entry for package '${t}' does not exist in local types registry - skipping...`)})}ensurePackageDirectoryExists(e){const t=Jo(e,"package.json");this.log.isEnabled()&&this.log.writeLine(`Npm config file: ${t}`),this.installTypingHost.fileExists(t)||(this.log.isEnabled()&&this.log.writeLine(`Npm config file: '${t}' is missing, creating new one...`),this.ensureDirectoryExists(e,this.installTypingHost),this.installTypingHost.writeFile(t,'{ "private": true }'))}installTypings(e,t,n,r){this.log.isEnabled()&&this.log.writeLine(`Installing typings ${JSON.stringify(r)}`);const i=this.filterTypings(r);if(0===i.length)return this.log.isEnabled()&&this.log.writeLine("All typings are known to be missing or invalid - no need to install more typings"),void this.sendResponse(this.createSetTypings(e,n));this.ensurePackageDirectoryExists(t);const o=this.installRunCount;this.installRunCount++,this.sendResponse({kind:dG,eventId:o,typingsInstallerVersion:c,projectName:e.projectName});const a=i.map(Zfe);this.installTypingsAsync(o,a,t,r=>{try{if(!r){this.log.isEnabled()&&this.log.writeLine(`install request failed, marking packages as missing to prevent repeated requests: ${JSON.stringify(i)}`);for(const e of i)this.missingTypingsSet.add(e);return}this.log.isEnabled()&&this.log.writeLine(`Installed typings ${JSON.stringify(a)}`);const o=[];for(const e of i){const n=Gfe(t,e,this.installTypingHost,this.log);if(!n){this.missingTypingsSet.add(e);continue}const r=this.typesRegistry.get(e),i={typingLocation:n,version:new kn(r[`ts${s}`]||r[this.latestDistTag])};this.packageNameToTypingLocation.set(e,i),o.push(n)}this.log.isEnabled()&&this.log.writeLine(`Installed typing files ${JSON.stringify(o)}`),this.sendResponse(this.createSetTypings(e,n.concat(o)))}finally{const t={kind:pG,eventId:o,projectName:e.projectName,packagesToInstall:a,installSuccess:r,typingsInstallerVersion:c};this.sendResponse(t)}})}ensureDirectoryExists(e,t){const n=Ao(e);t.directoryExists(n)||this.ensureDirectoryExists(n,t),t.directoryExists(e)||t.createDirectory(e)}watchFiles(e,t){if(!t.length)return void this.closeWatchers(e);const n=this.projectWatchers.get(e),r=new Set(t);!n||cd(r,e=>!n.has(e))||cd(n,e=>!r.has(e))?(this.projectWatchers.set(e,r),this.sendResponse({kind:mG,projectName:e,files:t})):this.sendResponse({kind:mG,projectName:e,files:void 0})}createSetTypings(e,t){return{projectName:e.projectName,typeAcquisition:e.typeAcquisition,compilerOptions:e.compilerOptions,typings:t,unresolvedImports:e.unresolvedImports,kind:cG}}installTypingsAsync(e,t,n,r){this.pendingRunRequests.unshift({requestId:e,packageNames:t,cwd:n,onRequestCompleted:r}),this.executeWithThrottling()}executeWithThrottling(){for(;this.inFlightRequestCount{this.inFlightRequestCount--,e.onRequestCompleted(t),this.executeWithThrottling()})}}};function Zfe(e){return`@types/${e}@ts${s}`}var eme,tme,nme=(e=>(e[e.terse=0]="terse",e[e.normal=1]="normal",e[e.requestTime=2]="requestTime",e[e.verbose=3]="verbose",e))(nme||{}),rme=[],ime=(e=>(e.Err="Err",e.Info="Info",e.Perf="Perf",e))(ime||{});function ome(e,t,n,r){return{projectName:e.getProjectName(),fileNames:e.getFileNames(!0,!0).concat(e.getExcludedFiles()),compilerOptions:e.getCompilationSettings(),typeAcquisition:t,unresolvedImports:n,projectRootPath:e.getCurrentDirectory(),cachePath:r,kind:"discover"}}function ame(e){return Vo(e)}function sme(e,t,n){return n(bo(e)?e:Uo(e,t))}function cme(e){return e}function lme(){const e=new Map;return{get:t=>e.get(t),set(t,n){e.set(t,n)},contains:t=>e.has(t),remove(t){e.delete(t)}}}function _me(e){return/dev\/null\/inferredProject\d+\*/.test(e)}function ume(e){return`/dev/null/inferredProject${e}*`}function dme(e){return`/dev/null/autoImportProviderProject${e}*`}function pme(e){return`/dev/null/auxiliaryProject${e}*`}function fme(){return[]}(tme=eme||(eme={})).ThrowNoProject=function(){throw new Error("No Project.")},tme.ThrowProjectLanguageServiceDisabled=function(){throw new Error("The project's language service is disabled.")},tme.ThrowProjectDoesNotContainDocument=function(e,t){throw new Error(`Project '${t.getProjectName()}' does not contain document '${e}'`)};var mme=class e{constructor(e,t){this.host=e,this.pendingTimeouts=new Map,this.logger=t.hasLevel(3)?t:void 0}schedule(t,n,r){const i=this.pendingTimeouts.get(t);i&&this.host.clearTimeout(i),this.pendingTimeouts.set(t,this.host.setTimeout(e.run,n,t,this,r)),this.logger&&this.logger.info(`Scheduled: ${t}${i?", Cancelled earlier one":""}`)}cancel(e){const t=this.pendingTimeouts.get(e);return!!t&&(this.host.clearTimeout(t),this.pendingTimeouts.delete(e))}static run(e,t,n){t.pendingTimeouts.delete(e),t.logger&&t.logger.info(`Running: ${e}`),n()}},gme=class e{constructor(e,t,n){this.host=e,this.delay=t,this.logger=n}scheduleCollect(){this.host.gc&&void 0===this.timerId&&(this.timerId=this.host.setTimeout(e.run,this.delay,this))}static run(e){e.timerId=void 0;const t=e.logger.hasLevel(2),n=t&&e.host.getMemoryUsage();if(e.host.gc(),t){const t=e.host.getMemoryUsage();e.logger.perftrc(`GC::before ${n}, after ${t}`)}}};function hme(e){const t=Io(e);return"tsconfig.json"===t||"jsconfig.json"===t?t:void 0}var yme={};o(yme,{ClassificationType:()=>nX,CommandTypes:()=>vme,CompletionTriggerKind:()=>JG,IndentStyle:()=>Sme,JsxEmit:()=>Tme,ModuleKind:()=>Cme,ModuleResolutionKind:()=>wme,NewLineKind:()=>Nme,OrganizeImportsMode:()=>BG,PollingWatchKind:()=>kme,ScriptTarget:()=>Dme,SemicolonPreference:()=>VG,WatchDirectoryKind:()=>xme,WatchFileKind:()=>bme});var vme=(e=>(e.JsxClosingTag="jsxClosingTag",e.LinkedEditingRange="linkedEditingRange",e.Brace="brace",e.BraceFull="brace-full",e.BraceCompletion="braceCompletion",e.GetSpanOfEnclosingComment="getSpanOfEnclosingComment",e.Change="change",e.Close="close",e.Completions="completions",e.CompletionInfo="completionInfo",e.CompletionsFull="completions-full",e.CompletionDetails="completionEntryDetails",e.CompletionDetailsFull="completionEntryDetails-full",e.CompileOnSaveAffectedFileList="compileOnSaveAffectedFileList",e.CompileOnSaveEmitFile="compileOnSaveEmitFile",e.Configure="configure",e.Definition="definition",e.DefinitionFull="definition-full",e.DefinitionAndBoundSpan="definitionAndBoundSpan",e.DefinitionAndBoundSpanFull="definitionAndBoundSpan-full",e.Implementation="implementation",e.ImplementationFull="implementation-full",e.EmitOutput="emit-output",e.Exit="exit",e.FileReferences="fileReferences",e.FileReferencesFull="fileReferences-full",e.Format="format",e.Formatonkey="formatonkey",e.FormatFull="format-full",e.FormatonkeyFull="formatonkey-full",e.FormatRangeFull="formatRange-full",e.Geterr="geterr",e.GeterrForProject="geterrForProject",e.SemanticDiagnosticsSync="semanticDiagnosticsSync",e.SyntacticDiagnosticsSync="syntacticDiagnosticsSync",e.SuggestionDiagnosticsSync="suggestionDiagnosticsSync",e.NavBar="navbar",e.NavBarFull="navbar-full",e.Navto="navto",e.NavtoFull="navto-full",e.NavTree="navtree",e.NavTreeFull="navtree-full",e.DocumentHighlights="documentHighlights",e.DocumentHighlightsFull="documentHighlights-full",e.Open="open",e.Quickinfo="quickinfo",e.QuickinfoFull="quickinfo-full",e.References="references",e.ReferencesFull="references-full",e.Reload="reload",e.Rename="rename",e.RenameInfoFull="rename-full",e.RenameLocationsFull="renameLocations-full",e.Saveto="saveto",e.SignatureHelp="signatureHelp",e.SignatureHelpFull="signatureHelp-full",e.FindSourceDefinition="findSourceDefinition",e.Status="status",e.TypeDefinition="typeDefinition",e.ProjectInfo="projectInfo",e.ReloadProjects="reloadProjects",e.Unknown="unknown",e.OpenExternalProject="openExternalProject",e.OpenExternalProjects="openExternalProjects",e.CloseExternalProject="closeExternalProject",e.SynchronizeProjectList="synchronizeProjectList",e.ApplyChangedToOpenFiles="applyChangedToOpenFiles",e.UpdateOpen="updateOpen",e.EncodedSyntacticClassificationsFull="encodedSyntacticClassifications-full",e.EncodedSemanticClassificationsFull="encodedSemanticClassifications-full",e.Cleanup="cleanup",e.GetOutliningSpans="getOutliningSpans",e.GetOutliningSpansFull="outliningSpans",e.TodoComments="todoComments",e.Indentation="indentation",e.DocCommentTemplate="docCommentTemplate",e.CompilerOptionsDiagnosticsFull="compilerOptionsDiagnostics-full",e.NameOrDottedNameSpan="nameOrDottedNameSpan",e.BreakpointStatement="breakpointStatement",e.CompilerOptionsForInferredProjects="compilerOptionsForInferredProjects",e.GetCodeFixes="getCodeFixes",e.GetCodeFixesFull="getCodeFixes-full",e.GetCombinedCodeFix="getCombinedCodeFix",e.GetCombinedCodeFixFull="getCombinedCodeFix-full",e.ApplyCodeActionCommand="applyCodeActionCommand",e.GetSupportedCodeFixes="getSupportedCodeFixes",e.GetApplicableRefactors="getApplicableRefactors",e.GetEditsForRefactor="getEditsForRefactor",e.GetMoveToRefactoringFileSuggestions="getMoveToRefactoringFileSuggestions",e.PreparePasteEdits="preparePasteEdits",e.GetPasteEdits="getPasteEdits",e.GetEditsForRefactorFull="getEditsForRefactor-full",e.OrganizeImports="organizeImports",e.OrganizeImportsFull="organizeImports-full",e.GetEditsForFileRename="getEditsForFileRename",e.GetEditsForFileRenameFull="getEditsForFileRename-full",e.ConfigurePlugin="configurePlugin",e.SelectionRange="selectionRange",e.SelectionRangeFull="selectionRange-full",e.ToggleLineComment="toggleLineComment",e.ToggleLineCommentFull="toggleLineComment-full",e.ToggleMultilineComment="toggleMultilineComment",e.ToggleMultilineCommentFull="toggleMultilineComment-full",e.CommentSelection="commentSelection",e.CommentSelectionFull="commentSelection-full",e.UncommentSelection="uncommentSelection",e.UncommentSelectionFull="uncommentSelection-full",e.PrepareCallHierarchy="prepareCallHierarchy",e.ProvideCallHierarchyIncomingCalls="provideCallHierarchyIncomingCalls",e.ProvideCallHierarchyOutgoingCalls="provideCallHierarchyOutgoingCalls",e.ProvideInlayHints="provideInlayHints",e.WatchChange="watchChange",e.MapCode="mapCode",e.CopilotRelated="copilotRelated",e))(vme||{}),bme=(e=>(e.FixedPollingInterval="FixedPollingInterval",e.PriorityPollingInterval="PriorityPollingInterval",e.DynamicPriorityPolling="DynamicPriorityPolling",e.FixedChunkSizePolling="FixedChunkSizePolling",e.UseFsEvents="UseFsEvents",e.UseFsEventsOnParentDirectory="UseFsEventsOnParentDirectory",e))(bme||{}),xme=(e=>(e.UseFsEvents="UseFsEvents",e.FixedPollingInterval="FixedPollingInterval",e.DynamicPriorityPolling="DynamicPriorityPolling",e.FixedChunkSizePolling="FixedChunkSizePolling",e))(xme||{}),kme=(e=>(e.FixedInterval="FixedInterval",e.PriorityInterval="PriorityInterval",e.DynamicPriority="DynamicPriority",e.FixedChunkSize="FixedChunkSize",e))(kme||{}),Sme=(e=>(e.None="None",e.Block="Block",e.Smart="Smart",e))(Sme||{}),Tme=(e=>(e.None="none",e.Preserve="preserve",e.ReactNative="react-native",e.React="react",e.ReactJSX="react-jsx",e.ReactJSXDev="react-jsxdev",e))(Tme||{}),Cme=(e=>(e.None="none",e.CommonJS="commonjs",e.AMD="amd",e.UMD="umd",e.System="system",e.ES6="es6",e.ES2015="es2015",e.ES2020="es2020",e.ES2022="es2022",e.ESNext="esnext",e.Node16="node16",e.Node18="node18",e.Node20="node20",e.NodeNext="nodenext",e.Preserve="preserve",e))(Cme||{}),wme=(e=>(e.Classic="classic",e.Node="node",e.NodeJs="node",e.Node10="node10",e.Node16="node16",e.NodeNext="nodenext",e.Bundler="bundler",e))(wme||{}),Nme=(e=>(e.Crlf="Crlf",e.Lf="Lf",e))(Nme||{}),Dme=(e=>(e.ES3="es3",e.ES5="es5",e.ES6="es6",e.ES2015="es2015",e.ES2016="es2016",e.ES2017="es2017",e.ES2018="es2018",e.ES2019="es2019",e.ES2020="es2020",e.ES2021="es2021",e.ES2022="es2022",e.ES2023="es2023",e.ES2024="es2024",e.ESNext="esnext",e.JSON="json",e.Latest="esnext",e))(Dme||{}),Fme=class{constructor(e,t,n){this.host=e,this.info=t,this.isOpen=!1,this.ownFileText=!1,this.pendingReloadFromDisk=!1,this.version=n||0}getVersion(){return this.svc?`SVC-${this.version}-${this.svc.getSnapshotVersion()}`:`Text-${this.version}`}hasScriptVersionCache_TestOnly(){return void 0!==this.svc}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}useText(e){this.svc=void 0,this.text=e,this.textSnapshot=void 0,this.lineMap=void 0,this.fileSize=void 0,this.resetSourceMapInfo(),this.version++}edit(e,t,n){this.switchToScriptVersionCache().edit(e,t-e,n),this.ownFileText=!1,this.text=void 0,this.textSnapshot=void 0,this.lineMap=void 0,this.fileSize=void 0,this.resetSourceMapInfo()}reload(e){return pn.assert(void 0!==e),this.pendingReloadFromDisk=!1,!this.text&&this.svc&&(this.text=rY(this.svc.getSnapshot())),this.text!==e&&(this.useText(e),this.ownFileText=!1,!0)}reloadWithFileText(e){const{text:t,fileSize:n}=e||!this.info.isDynamicOrHasMixedContent()?this.getFileTextAndSize(e):{text:"",fileSize:void 0},r=this.reload(t);return this.fileSize=n,this.ownFileText=!e||e===this.info.fileName,this.ownFileText&&this.info.mTime===Ui.getTime()&&(this.info.mTime=(this.host.getModifiedTime(this.info.fileName)||Ui).getTime()),r}scheduleReloadIfNeeded(){return!this.pendingReloadFromDisk&&!this.ownFileText&&(this.pendingReloadFromDisk=!0)}delayReloadFromFileIntoText(){this.pendingReloadFromDisk=!0}getTelemetryFileSize(){return this.fileSize?this.fileSize:this.text?this.text.length:this.svc?this.svc.getSnapshot().getLength():this.getSnapshot().getLength()}getSnapshot(){var e;return(null==(e=this.tryUseScriptVersionCache())?void 0:e.getSnapshot())||(this.textSnapshot??(this.textSnapshot=NG.fromString(pn.checkDefined(this.text))))}getAbsolutePositionAndLineText(e){const t=this.tryUseScriptVersionCache();if(t)return t.getAbsolutePositionAndLineText(e);const n=this.getLineMap();return e<=n.length?{absolutePosition:n[e-1],lineText:this.text.substring(n[e-1],n[e])}:{absolutePosition:this.text.length,lineText:void 0}}lineToTextSpan(e){const t=this.tryUseScriptVersionCache();if(t)return t.lineToTextSpan(e);const n=this.getLineMap();return Xs(n[e],e+1void 0===t?t=this.host.readFile(n)||"":t;if(!JS(this.info.fileName)){const e=this.host.getFileSize?this.host.getFileSize(n):r().length;if(e>ege){pn.assert(!!this.info.containingProjects.length);return this.info.containingProjects[0].projectService.logger.info(`Skipped loading contents of large file ${n} for info ${this.info.fileName}: fileSize: ${e}`),this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(n,e),{text:"",fileSize:e}}}return{text:r()}}switchToScriptVersionCache(){return this.svc&&!this.pendingReloadFromDisk||(this.svc=zhe.fromString(this.getOrLoadText()),this.textSnapshot=void 0,this.version++),this.svc}tryUseScriptVersionCache(){return this.svc&&!this.pendingReloadFromDisk||this.getOrLoadText(),this.isOpen?(this.svc||this.textSnapshot||(this.svc=zhe.fromString(pn.checkDefined(this.text)),this.textSnapshot=void 0),this.svc):this.svc}getOrLoadText(){return(void 0===this.text||this.pendingReloadFromDisk)&&(pn.assert(!this.svc||this.pendingReloadFromDisk,"ScriptVersionCache should not be set when reloading from disk"),this.reloadWithFileText()),this.text}getLineMap(){return pn.assert(!this.svc,"ScriptVersionCache should not be set"),this.lineMap||(this.lineMap=Ra(pn.checkDefined(this.text)))}getLineInfo(){const e=this.tryUseScriptVersionCache();if(e)return{getLineCount:()=>e.getLineCount(),getLineText:t=>e.getAbsolutePositionAndLineText(t+1).lineText};const t=this.getLineMap();return MJ(this.text,t)}};function Eme(e){return"^"===e[0]||(e.includes("walkThroughSnippet:/")||e.includes("untitled:/"))&&"^"===Io(e)[0]||e.includes(":^")&&!e.includes(fo)}var Pme=class{constructor(e,t,n,r,i,o){this.host=e,this.fileName=t,this.scriptKind=n,this.hasMixedContent=r,this.path=i,this.containingProjects=[],this.isDynamic=Eme(t),this.textStorage=new Fme(e,this,o),(r||this.isDynamic)&&(this.realpath=this.path),this.scriptKind=n||wS(t)}isDynamicOrHasMixedContent(){return this.hasMixedContent||this.isDynamic}isScriptOpen(){return this.textStorage.isOpen}open(e){this.textStorage.isOpen=!0,void 0!==e&&this.textStorage.reload(e)&&this.markContainingProjectsAsDirty()}close(e=!0){this.textStorage.isOpen=!1,e&&this.textStorage.scheduleReloadIfNeeded()&&this.markContainingProjectsAsDirty()}getSnapshot(){return this.textStorage.getSnapshot()}ensureRealPath(){if(void 0===this.realpath&&(this.realpath=this.path,this.host.realpath)){pn.assert(!!this.containingProjects.length);const e=this.containingProjects[0],t=this.host.realpath(this.path);t&&(this.realpath=e.toPath(t),this.realpath!==this.path&&e.projectService.realpathToScriptInfos.add(this.realpath,this))}}getRealpathIfDifferent(){return this.realpath&&this.realpath!==this.path?this.realpath:void 0}isSymlink(){return this.realpath&&this.realpath!==this.path}getFormatCodeSettings(){return this.formatSettings}getPreferences(){return this.preferences}attachToProject(e){const t=!this.isAttached(e);return t&&(this.containingProjects.push(e),e.getCompilerOptions().preserveSymlinks||this.ensureRealPath(),e.onFileAddedOrRemoved(this.isSymlink())),t}isAttached(e){switch(this.containingProjects.length){case 0:return!1;case 1:return this.containingProjects[0]===e;case 2:return this.containingProjects[0]===e||this.containingProjects[1]===e;default:return C(this.containingProjects,e)}}detachFromProject(e){switch(this.containingProjects.length){case 0:return;case 1:this.containingProjects[0]===e&&(e.onFileAddedOrRemoved(this.isSymlink()),this.containingProjects.pop());break;case 2:this.containingProjects[0]===e?(e.onFileAddedOrRemoved(this.isSymlink()),this.containingProjects[0]=this.containingProjects.pop()):this.containingProjects[1]===e&&(e.onFileAddedOrRemoved(this.isSymlink()),this.containingProjects.pop());break;default:Ut(this.containingProjects,e)&&e.onFileAddedOrRemoved(this.isSymlink())}}detachAllProjects(){for(const e of this.containingProjects){Gme(e)&&e.getCachedDirectoryStructureHost().addOrDeleteFile(this.fileName,this.path,2);const t=e.getRootFilesMap().get(this.path);e.removeFile(this,!1,!1),e.onFileAddedOrRemoved(this.isSymlink()),t&&!Kme(e)&&e.addMissingFileRoot(t.fileName)}E(this.containingProjects)}getDefaultProject(){switch(this.containingProjects.length){case 0:return eme.ThrowNoProject();case 1:return Yme(this.containingProjects[0])||Qme(this.containingProjects[0])?eme.ThrowNoProject():this.containingProjects[0];default:let e,t,n,r;for(let i=0;i!e.isOrphan())}lineToTextSpan(e){return this.textStorage.lineToTextSpan(e)}lineOffsetToPosition(e,t,n){return this.textStorage.lineOffsetToPosition(e,t,n)}positionToLineOffset(e){!function(e){pn.assert("number"==typeof e,`Expected position ${e} to be a number.`),pn.assert(e>=0,"Expected position to be non-negative.")}(e);const t=this.textStorage.positionToLineOffset(e);return function(e){pn.assert("number"==typeof e.line,`Expected line ${e.line} to be a number.`),pn.assert("number"==typeof e.offset,`Expected offset ${e.offset} to be a number.`),pn.assert(e.line>0,"Expected line to be non-"+(0===e.line?"zero":"negative")),pn.assert(e.offset>0,"Expected offset to be non-"+(0===e.offset?"zero":"negative"))}(t),t}isJavaScript(){return 1===this.scriptKind||2===this.scriptKind}closeSourceMapFileWatcher(){this.sourceMapFilePath&&!tt(this.sourceMapFilePath)&&(GU(this.sourceMapFilePath),this.sourceMapFilePath=void 0)}};function Ame(e){return H(e.containingProjects,Qme)}function Ime(e){return H(e.containingProjects,Yme)}var Ome=(e=>(e[e.Inferred=0]="Inferred",e[e.Configured=1]="Configured",e[e.External=2]="External",e[e.AutoImportProvider=3]="AutoImportProvider",e[e.Auxiliary=4]="Auxiliary",e))(Ome||{});function Lme(e,t=!1){const n={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 r of e){const e=t?r.textStorage.getTelemetryFileSize():0;switch(r.scriptKind){case 1:n.js+=1,n.jsSize+=e;break;case 2:n.jsx+=1,n.jsxSize+=e;break;case 3:vO(r.fileName)?(n.dts+=1,n.dtsSize+=e):(n.ts+=1,n.tsSize+=e);break;case 4:n.tsx+=1,n.tsxSize+=e;break;case 7:n.deferred+=1,n.deferredSize+=e}}return n}function jme(e){const t=Lme(e.getRootScriptInfos());return 0===t.ts&&0===t.tsx}function Mme(e){const t=Lme(e.getScriptInfos());return 0===t.ts&&0===t.tsx}function Rme(e){return!e.some(e=>wo(e,".ts")&&!vO(e)||wo(e,".tsx"))}function Bme(e){return void 0!==e.generatedFilePath}function Jme(e,t){if(e===t)return!0;if(0===(e||rme).length&&0===(t||rme).length)return!0;const n=new Map;let r=0;for(const t of e)!0!==n.get(t)&&(n.set(t,!0),r++);for(const e of t){const t=n.get(e);if(void 0===t)return!1;!0===t&&(n.set(e,!1),r--)}return 0===r}var zme=class e{constructor(e,t,n,r,i,o,a,s,c,l){switch(this.projectKind=t,this.projectService=n,this.compilerOptions=o,this.compileOnSaveEnabled=a,this.watchOptions=s,this.rootFilesMap=new Map,this.plugins=[],this.cachedUnresolvedImportsPerFile=new Map,this.hasAddedorRemovedFiles=!1,this.hasAddedOrRemovedSymlinks=!1,this.lastReportedVersion=0,this.projectProgramVersion=0,this.projectStateVersion=0,this.initialLoadPending=!1,this.dirty=!1,this.typingFiles=rme,this.moduleSpecifierCache=rhe(this),this.createHash=He(this.projectService.host,this.projectService.host.createHash),this.globalCacheResolutionModuleName=oG.nonRelativeModuleNameForTypingCache,this.updateFromProjectInProgress=!1,n.logger.info(`Creating ${Ome[t]}Project: ${e}, currentDirectory: ${l}`),this.projectName=e,this.directoryStructureHost=c,this.currentDirectory=this.projectService.getNormalizedAbsolutePath(l),this.getCanonicalFileName=this.projectService.toCanonicalFileName,this.jsDocParsingMode=this.projectService.jsDocParsingMode,this.cancellationToken=new u7(this.projectService.cancellationToken,this.projectService.throttleWaitMilliseconds),this.compilerOptions?(r||Mk(this.compilerOptions)||this.projectService.hasDeferredExtension())&&(this.compilerOptions.allowNonTsExtensions=!0):(this.compilerOptions={target:1,jsx:1},this.compilerOptions.allowNonTsExtensions=!0,this.compilerOptions.allowJs=!0),n.serverMode){case 0:this.languageServiceEnabled=!0;break;case 1:this.languageServiceEnabled=!0,this.compilerOptions.noResolve=!0,this.compilerOptions.types=[];break;case 2:this.languageServiceEnabled=!1,this.compilerOptions.noResolve=!0,this.compilerOptions.types=[];break;default:pn.assertNever(n.serverMode)}this.setInternalCompilerOptionsForEmittingJsFiles();const _=this.projectService.host;this.projectService.logger.loggingEnabled()?this.trace=e=>this.writeLog(e):_.trace&&(this.trace=e=>_.trace(e)),this.realpath=He(_,_.realpath),this.preferNonRecursiveWatch=this.projectService.canUseWatchEvents||_.preferNonRecursiveWatch,this.resolutionCache=m$(this,this.currentDirectory,!0),this.languageService=f7(this,this.projectService.documentRegistry,this.projectService.serverMode),i&&this.disableLanguageService(i),this.markAsDirty(),Qme(this)||(this.projectService.pendingEnsureProjectForOpenFiles=!0),this.projectService.onProjectCreation(this)}getRedirectFromSourceFile(e){}isNonTsProject(){return Uge(this),Mme(this)}isJsOnlyProject(){return Uge(this),function(e){const t=Lme(e.getScriptInfos());return t.js>0&&0===t.ts&&0===t.tsx}(this)}static resolveModule(t,n,r,i){return e.importServicePluginSync({name:t},[n],r,i).resolvedModule}static importServicePluginSync(e,t,n,r){let i,o;pn.assertIsDefined(n.require);for(const a of t){const t=Ro(n.resolvePath(Jo(a,"node_modules")));r(`Loading ${e.name} from ${a} (resolved to ${t})`);const s=n.require(t,e.name);if(!s.error){o=s.module;break}const c=s.error.stack||s.error.message||JSON.stringify(s.error);(i??(i=[])).push(`Failed to load module '${e.name}' from ${t}: ${c}`)}return{pluginConfigEntry:e,resolvedModule:o,errorLogs:i}}static async importServicePluginAsync(e,t,n,r){let i,o;pn.assertIsDefined(n.importPlugin);for(const a of t){const t=Jo(a,"node_modules");let s;r(`Dynamically importing ${e.name} from ${a} (resolved to ${t})`);try{s=await n.importPlugin(t,e.name)}catch(e){s={module:void 0,error:e}}if(!s.error){o=s.module;break}const c=s.error.stack||s.error.message||JSON.stringify(s.error);(i??(i=[])).push(`Failed to dynamically import module '${e.name}' from ${t}: ${c}`)}return{pluginConfigEntry:e,resolvedModule:o,errorLogs:i}}isKnownTypesPackageName(e){return this.projectService.typingsInstaller.isKnownTypesPackageName(e)}installPackage(e){return this.projectService.typingsInstaller.installPackage({...e,projectName:this.projectName,projectRootPath:this.toPath(this.currentDirectory)})}getGlobalTypingsCacheLocation(){return this.getTypeAcquisition().enable?this.projectService.typingsInstaller.globalTypingsCacheLocation:void 0}getSymlinkCache(){return this.symlinks||(this.symlinks=nS(this.getCurrentDirectory(),this.getCanonicalFileName)),this.program&&!this.symlinks.hasProcessedResolutions()&&this.symlinks.setSymlinksFromResolutions(this.program.forEachResolvedModule,this.program.forEachResolvedTypeReferenceDirective,this.program.getAutomaticTypeDirectiveResolutions()),this.symlinks}getCompilationSettings(){return this.compilerOptions}getCompilerOptions(){return this.getCompilationSettings()}getNewLine(){return this.projectService.host.newLine}getProjectVersion(){return this.projectStateVersion.toString()}getProjectReferences(){}getScriptFileNames(){if(!this.rootFilesMap.size)return _;let e;return this.rootFilesMap.forEach(t=>{(this.languageServiceEnabled||t.info&&t.info.isScriptOpen())&&(e||(e=[])).push(t.fileName)}),le(e,this.typingFiles)||_}getOrCreateScriptInfoAndAttachToProject(e){const t=this.projectService.getOrCreateScriptInfoNotOpenedByClient(e,this.currentDirectory,this.directoryStructureHost,!1);if(t){const e=this.rootFilesMap.get(t.path);e&&e.info!==t&&(e.info=t),t.attachToProject(this)}return t}getScriptKind(e){const t=this.projectService.getScriptInfoForPath(this.toPath(e));return t&&t.scriptKind}getScriptVersion(e){const t=this.projectService.getOrCreateScriptInfoNotOpenedByClient(e,this.currentDirectory,this.directoryStructureHost,!1);return t&&t.getLatestVersion()}getScriptSnapshot(e){const t=this.getOrCreateScriptInfoAndAttachToProject(e);if(t)return t.getSnapshot()}getCancellationToken(){return this.cancellationToken}getCurrentDirectory(){return this.currentDirectory}getDefaultLibFileName(){return Jo(Ao(Vo(this.projectService.getExecutingFilePath())),As(this.compilerOptions))}useCaseSensitiveFileNames(){return this.projectService.host.useCaseSensitiveFileNames}readDirectory(e,t,n,r,i){return this.directoryStructureHost.readDirectory(e,t,n,r,i)}readFile(e){return this.projectService.host.readFile(e)}writeFile(e,t){return this.projectService.host.writeFile(e,t)}fileExists(e){const t=this.toPath(e);return!!this.projectService.getScriptInfoForPath(t)||!this.isWatchedMissingFile(t)&&this.directoryStructureHost.fileExists(e)}resolveModuleNameLiterals(e,t,n,r,i,o){return this.resolutionCache.resolveModuleNameLiterals(e,t,n,r,i,o)}getModuleResolutionCache(){return this.resolutionCache.getModuleResolutionCache()}resolveTypeReferenceDirectiveReferences(e,t,n,r,i,o){return this.resolutionCache.resolveTypeReferenceDirectiveReferences(e,t,n,r,i,o)}resolveLibrary(e,t,n,r){return this.resolutionCache.resolveLibrary(e,t,n,r)}directoryExists(e){return this.directoryStructureHost.directoryExists(e)}getDirectories(e){return this.directoryStructureHost.getDirectories(e)}getCachedDirectoryStructureHost(){}toPath(e){return Ho(e,this.currentDirectory,this.projectService.toCanonicalFileName)}watchDirectoryOfFailedLookupLocation(e,t,n){return this.projectService.watchFactory.watchDirectory(e,t,n,this.projectService.getWatchOptions(this),z$.FailedLookupLocations,this)}watchAffectingFileLocation(e,t){return this.projectService.watchFactory.watchFile(e,t,2e3,this.projectService.getWatchOptions(this),z$.AffectingFileLocation,this)}clearInvalidateResolutionOfFailedLookupTimer(){return this.projectService.throttledOperations.cancel(`${this.getProjectName()}FailedLookupInvalidation`)}scheduleInvalidateResolutionsOfFailedLookupLocations(){this.projectService.throttledOperations.schedule(`${this.getProjectName()}FailedLookupInvalidation`,1e3,()=>{this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()&&this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)})}invalidateResolutionsOfFailedLookupLocations(){this.clearInvalidateResolutionOfFailedLookupTimer()&&this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()&&(this.markAsDirty(),this.projectService.delayEnsureProjectForOpenFiles())}onInvalidatedResolution(){this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}watchTypeRootsDirectory(e,t,n){return this.projectService.watchFactory.watchDirectory(e,t,n,this.projectService.getWatchOptions(this),z$.TypeRoots,this)}hasChangedAutomaticTypeDirectiveNames(){return this.resolutionCache.hasChangedAutomaticTypeDirectiveNames()}onChangedAutomaticTypeDirectiveNames(){this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}fileIsOpen(e){return this.projectService.openFiles.has(e)}writeLog(e){this.projectService.logger.info(e)}log(e){this.writeLog(e)}error(e){this.projectService.logger.msg(e,"Err")}setInternalCompilerOptionsForEmittingJsFiles(){0!==this.projectKind&&2!==this.projectKind||(this.compilerOptions.noEmitForJsFiles=!0)}getGlobalProjectErrors(){return D(this.projectErrors,e=>!e.file)||rme}getAllProjectErrors(){return this.projectErrors||rme}setProjectErrors(e){this.projectErrors=e}getLanguageService(e=!0){return e&&Uge(this),this.languageService}getSourceMapper(){return this.getLanguageService().getSourceMapper()}clearSourceMapperCache(){this.languageService.clearSourceMapperCache()}getDocumentPositionMapper(e,t){return this.projectService.getDocumentPositionMapper(this,e,t)}getSourceFileLike(e){return this.projectService.getSourceFileLike(e,this)}shouldEmitFile(e){return e&&!e.isDynamicOrHasMixedContent()&&!this.program.isSourceOfProjectReferenceRedirect(e.path)}getCompileOnSaveAffectedFileList(e){return this.languageServiceEnabled?(Uge(this),this.builderState=sW.create(this.program,this.builderState,!0),J(sW.getFilesAffectedBy(this.builderState,this.program,e.path,this.cancellationToken,this.projectService.host),e=>this.shouldEmitFile(this.projectService.getScriptInfoForPath(e.path))?e.fileName:void 0)):[]}emitFile(e,t){if(!this.languageServiceEnabled||!this.shouldEmitFile(e))return{emitSkipped:!0,diagnostics:rme};const{emitSkipped:n,diagnostics:r,outputFiles:i}=this.getLanguageService().getEmitOutput(e.fileName);if(!n){for(const e of i){t(Uo(e.name,this.currentDirectory),e.text,e.writeByteOrderMark)}if(this.builderState&&Ik(this.compilerOptions)){const t=i.filter(e=>vO(e.name));if(1===t.length){const n=this.program.getSourceFile(e.fileName),r=this.projectService.host.createHash?this.projectService.host.createHash(t[0].text):Bi(t[0].text);sW.updateSignatureOfFile(this.builderState,r,n.resolvedPath)}}}return{emitSkipped:n,diagnostics:r}}enableLanguageService(){this.languageServiceEnabled||2===this.projectService.serverMode||(this.languageServiceEnabled=!0,this.lastFileExceededProgramSize=void 0,this.projectService.onUpdateLanguageServiceStateForProject(this,!0))}cleanupProgram(){if(this.program){for(const e of this.program.getSourceFiles())this.detachScriptInfoIfNotRoot(e.fileName);this.program.forEachResolvedProjectReference(e=>this.detachScriptInfoFromProject(e.sourceFile.fileName)),this.program=void 0}}disableLanguageService(e){this.languageServiceEnabled&&(pn.assert(2!==this.projectService.serverMode),this.languageService.cleanupSemanticCache(),this.languageServiceEnabled=!1,this.cleanupProgram(),this.lastFileExceededProgramSize=e,this.builderState=void 0,this.autoImportProviderHost&&this.autoImportProviderHost.close(),this.autoImportProviderHost=void 0,this.resolutionCache.closeTypeRootsWatch(),this.clearGeneratedFileWatch(),this.projectService.verifyDocumentRegistry(),this.projectService.onUpdateLanguageServiceStateForProject(this,!1))}getProjectName(){return this.projectName}removeLocalTypingsFromTypeAcquisition(e){return e.enable&&e.include?{...e,include:this.removeExistingTypings(e.include)}:e}getExternalFiles(e){return de(L(this.plugins,t=>{if("function"==typeof t.module.getExternalFiles)try{return t.module.getExternalFiles(this,e||0)}catch(e){this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${e}`),e.stack&&this.projectService.logger.info(e.stack)}}))}getSourceFile(e){if(this.program)return this.program.getSourceFileByPath(e)}getSourceFileOrConfigFile(e){const t=this.program.getCompilerOptions();return e===t.configFilePath?t.configFile:this.getSourceFile(e)}close(){var e;this.typingsCache&&this.projectService.typingsInstaller.onProjectClosed(this),this.typingsCache=void 0,this.closeWatchingTypingLocations(),this.cleanupProgram(),p(this.externalFiles,e=>this.detachScriptInfoIfNotRoot(e)),this.rootFilesMap.forEach(e=>{var t;return null==(t=e.info)?void 0:t.detachFromProject(this)}),this.projectService.pendingEnsureProjectForOpenFiles=!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,null==(e=this.packageJsonWatches)||e.forEach(e=>{e.projects.delete(this),e.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,this.missingFilesMap&&(gx(this.missingFilesMap,sx),this.missingFilesMap=void 0),this.clearGeneratedFileWatch(),this.clearInvalidateResolutionOfFailedLookupTimer(),this.autoImportProviderHost&&this.autoImportProviderHost.close(),this.autoImportProviderHost=void 0,this.noDtsResolutionProject&&this.noDtsResolutionProject.close(),this.noDtsResolutionProject=void 0,this.languageService.dispose(),this.languageService=void 0}detachScriptInfoIfNotRoot(e){const t=this.projectService.getScriptInfo(e);t&&!this.isRoot(t)&&t.detachFromProject(this)}isClosed(){return void 0===this.rootFilesMap}hasRoots(){var e;return!!(null==(e=this.rootFilesMap)?void 0:e.size)}isOrphan(){return!1}getRootFiles(){return this.rootFilesMap&&je(z(this.rootFilesMap.values(),e=>{var t;return null==(t=e.info)?void 0:t.fileName}))}getRootFilesMap(){return this.rootFilesMap}getRootScriptInfos(){return je(z(this.rootFilesMap.values(),e=>e.info))}getScriptInfos(){return this.languageServiceEnabled?P(this.program.getSourceFiles(),e=>{const t=this.projectService.getScriptInfoForPath(e.resolvedPath);return pn.assert(!!t,"getScriptInfo",()=>`scriptInfo for a file '${e.fileName}' Path: '${e.path}' / '${e.resolvedPath}' is missing.`),t}):this.getRootScriptInfos()}getExcludedFiles(){return rme}getFileNames(e,t){if(!this.program)return[];if(!this.languageServiceEnabled){let e=this.getRootFiles();if(this.compilerOptions){const t=y7(this.compilerOptions);t&&(e||(e=[])).push(t)}return e}const n=[];for(const t of this.program.getSourceFiles())e&&this.program.isSourceFileFromExternalLibrary(t)||n.push(cme(t.fileName));if(!t){const e=this.program.getCompilerOptions().configFile;if(e&&(n.push(e.fileName),e.extendedSourceFiles))for(const t of e.extendedSourceFiles)n.push(cme(t))}return n}getFileNamesWithRedirectInfo(e){return this.getFileNames().map(t=>({fileName:t,isSourceOfProjectReferenceRedirect:e&&this.isSourceOfProjectReferenceRedirect(t)}))}hasConfigFile(e){if(this.program&&this.languageServiceEnabled){const t=this.program.getCompilerOptions().configFile;if(t){if(e===t.fileName)return!0;if(t.extendedSourceFiles)for(const n of t.extendedSourceFiles)if(e===cme(n))return!0}}return!1}containsScriptInfo(e){if(this.isRoot(e))return!0;if(!this.program)return!1;const t=this.program.getSourceFileByPath(e.path);return!!t&&t.resolvedPath===e.path}containsFile(e,t){const n=this.projectService.getScriptInfoForNormalizedPath(e);return!(!n||!n.isScriptOpen()&&t)&&this.containsScriptInfo(n)}isRoot(e){var t,n;return(null==(n=null==(t=this.rootFilesMap)?void 0:t.get(e.path))?void 0:n.info)===e}addRoot(e,t){pn.assert(!this.isRoot(e)),this.rootFilesMap.set(e.path,{fileName:t||e.fileName,info:e}),e.attachToProject(this),this.markAsDirty()}addMissingFileRoot(e){const t=this.projectService.toPath(e);this.rootFilesMap.set(t,{fileName:e}),this.markAsDirty()}removeFile(e,t,n){this.isRoot(e)&&this.removeRoot(e),t?this.resolutionCache.removeResolutionsOfFile(e.path):this.resolutionCache.invalidateResolutionOfFile(e.path),this.cachedUnresolvedImportsPerFile.delete(e.path),n&&e.detachFromProject(this),this.markAsDirty()}registerFileUpdate(e){(this.updatedFileNames||(this.updatedFileNames=new Set)).add(e)}markFileAsDirty(e){this.markAsDirty(),this.exportMapCache&&!this.exportMapCache.isEmpty()&&(this.changedFilesForExportMapCache||(this.changedFilesForExportMapCache=new Set)).add(e)}markAsDirty(){this.dirty||(this.projectStateVersion++,this.dirty=!0)}markAutoImportProviderAsDirty(){var e;this.autoImportProviderHost||(this.autoImportProviderHost=void 0),null==(e=this.autoImportProviderHost)||e.markAsDirty()}onAutoImportProviderSettingsChanged(){this.markAutoImportProviderAsDirty()}onPackageJsonChange(){this.moduleSpecifierCache.clear(),this.markAutoImportProviderAsDirty()}onFileAddedOrRemoved(e){this.hasAddedorRemovedFiles=!0,e&&(this.hasAddedOrRemovedSymlinks=!0)}onDiscoveredSymlink(){this.hasAddedOrRemovedSymlinks=!0}onReleaseOldSourceFile(e,t,n,r){(!r||e.resolvedPath===e.path&&r.resolvedPath!==e.path)&&this.detachScriptInfoFromProject(e.fileName,n)}updateFromProject(){Uge(this)}updateGraph(){var e,t;null==(e=Gn)||e.push(Gn.Phase.Session,"updateGraph",{name:this.projectName,kind:Ome[this.projectKind]}),this.resolutionCache.startRecordingFilesWithChangedResolutions();const n=this.updateGraphWorker(),r=this.hasAddedorRemovedFiles;this.hasAddedorRemovedFiles=!1,this.hasAddedOrRemovedSymlinks=!1;const i=this.resolutionCache.finishRecordingFilesWithChangedResolutions()||rme;for(const e of i)this.cachedUnresolvedImportsPerFile.delete(e);this.languageServiceEnabled&&0===this.projectService.serverMode&&!this.isOrphan()?((n||i.length)&&(this.lastCachedUnresolvedImportsList=function(e,t){var n,r;const i=e.getSourceFiles();null==(n=Gn)||n.push(Gn.Phase.Session,"getUnresolvedImports",{count:i.length});const o=e.getTypeChecker().getAmbientModules().map(e=>Iy(e.getName())),a=ne(L(i,n=>function(e,t,n,r){return q(r,t.path,()=>{let r;return e.forEachResolvedModule(({resolvedModule:e},t)=>{e&&rT(e.extension)||Fs(t)||n.some(e=>e===t)||(r=ae(r,wR(t).packageName))},t),r||rme})}(e,n,o,t)));return null==(r=Gn)||r.pop(),a}(this.program,this.cachedUnresolvedImportsPerFile)),this.enqueueInstallTypingsForProject(r)):this.lastCachedUnresolvedImportsList=void 0;const o=0===this.projectProgramVersion&&n;return n&&this.projectProgramVersion++,r&&this.markAutoImportProviderAsDirty(),o&&this.getPackageJsonAutoImportProvider(),null==(t=Gn)||t.pop(),!n}enqueueInstallTypingsForProject(e){const t=this.getTypeAcquisition();if(!t||!t.enable||this.projectService.typingsInstaller===Dge)return;const n=this.typingsCache;var r,i,o,a;!e&&n&&(o=t,a=n.typeAcquisition,o.enable===a.enable&&Jme(o.include,a.include)&&Jme(o.exclude,a.exclude))&&!function(e,t){return Mk(e)!==Mk(t)}(this.getCompilationSettings(),n.compilerOptions)&&(r=this.lastCachedUnresolvedImportsList,i=n.unresolvedImports,r===i||re(r,i))||(this.typingsCache={compilerOptions:this.getCompilationSettings(),typeAcquisition:t,unresolvedImports:this.lastCachedUnresolvedImportsList},this.projectService.typingsInstaller.enqueueInstallTypingsRequest(this,t,this.lastCachedUnresolvedImportsList))}updateTypingFiles(e,t,n,r){this.typingsCache={compilerOptions:e,typeAcquisition:t,unresolvedImports:n};const i=t&&t.enable?de(r):rme;sn(i,this.typingFiles,Dt(!this.useCaseSensitiveFileNames()),ot,e=>this.detachScriptInfoFromProject(e))&&(this.typingFiles=i,this.resolutionCache.setFilesWithInvalidatedNonRelativeUnresolvedImports(this.cachedUnresolvedImportsPerFile),this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this))}closeWatchingTypingLocations(){this.typingWatchers&&gx(this.typingWatchers,sx),this.typingWatchers=void 0}onTypingInstallerWatchInvoke(){this.typingWatchers.isInvoked=!0,this.projectService.updateTypingsForProject({projectName:this.getProjectName(),kind:lG})}watchTypingLocations(e){if(!e)return void(this.typingWatchers.isInvoked=!1);if(!e.length)return void this.closeWatchingTypingLocations();const t=new Map(this.typingWatchers);this.typingWatchers||(this.typingWatchers=new Map),this.typingWatchers.isInvoked=!1;const n=(e,n)=>{const r=this.toPath(e);if(t.delete(r),!this.typingWatchers.has(r)){const t="FileWatcher"===n?z$.TypingInstallerLocationFile:z$.TypingInstallerLocationDirectory;this.typingWatchers.set(r,r$(r)?"FileWatcher"===n?this.projectService.watchFactory.watchFile(e,()=>this.typingWatchers.isInvoked?this.writeLog("TypingWatchers already invoked"):this.onTypingInstallerWatchInvoke(),2e3,this.projectService.getWatchOptions(this),t,this):this.projectService.watchFactory.watchDirectory(e,e=>this.typingWatchers.isInvoked?this.writeLog("TypingWatchers already invoked"):wo(e,".json")?ra(e,Jo(this.projectService.typingsInstaller.globalTypingsCacheLocation,"package.json"),!this.useCaseSensitiveFileNames())?this.writeLog("Ignoring package.json change at global typings location"):void this.onTypingInstallerWatchInvoke():this.writeLog("Ignoring files that are not *.json"),1,this.projectService.getWatchOptions(this),t,this):(this.writeLog(`Skipping watcher creation at ${e}:: ${zge(t,this)}`),R$))}};for(const t of e){const e=Io(t);if("package.json"!==e&&"bower.json"!==e){if(ia(this.currentDirectory,t,this.currentDirectory,!this.useCaseSensitiveFileNames())){const e=t.indexOf(fo,this.currentDirectory.length+1);n(-1!==e?t.substr(0,e):t,"DirectoryWatcher");continue}ia(this.projectService.typingsInstaller.globalTypingsCacheLocation,t,this.currentDirectory,!this.useCaseSensitiveFileNames())?n(this.projectService.typingsInstaller.globalTypingsCacheLocation,"DirectoryWatcher"):n(t,"DirectoryWatcher")}else n(t,"FileWatcher")}t.forEach((e,t)=>{e.close(),this.typingWatchers.delete(t)})}getCurrentProgram(){return this.program}removeExistingTypings(e){if(!e.length)return e;const t=FM(this.getCompilerOptions(),this);return D(e,e=>!t.includes(e))}updateGraphWorker(){var e,t;const n=this.languageService.getCurrentProgram();pn.assert(n===this.program),pn.assert(!this.isClosed(),"Called update graph worker of closed project"),this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`);const r=Wn(),{hasInvalidatedResolutions:i,hasInvalidatedLibResolutions:o}=this.resolutionCache.createHasInvalidatedResolutions(at,at);this.hasInvalidatedResolutions=i,this.hasInvalidatedLibResolutions=o,this.resolutionCache.startCachingPerDirectoryResolution(),this.dirty=!1,this.updateFromProjectInProgress=!0,this.program=this.languageService.getProgram(),this.updateFromProjectInProgress=!1,null==(e=Gn)||e.push(Gn.Phase.Session,"finishCachingPerDirectoryResolution"),this.resolutionCache.finishCachingPerDirectoryResolution(this.program,n),null==(t=Gn)||t.pop(),pn.assert(void 0===n||void 0!==this.program);let a=!1;if(this.program&&(!n||this.program!==n&&2!==this.program.structureIsReused)){if(a=!0,this.rootFilesMap.forEach((e,t)=>{var n;const r=this.program.getSourceFileByPath(t),i=e.info;r&&(null==(n=e.info)?void 0:n.path)!==r.resolvedPath&&(e.info=this.projectService.getScriptInfo(r.fileName),pn.assert(e.info.isAttached(this)),null==i||i.detachFromProject(this))}),qU(this.program,this.missingFilesMap||(this.missingFilesMap=new Map),(e,t)=>this.addMissingFileWatcher(e,t)),this.generatedFilesMap){const e=this.compilerOptions.outFile;Bme(this.generatedFilesMap)?e&&this.isValidGeneratedFileWatcher(KS(e)+".d.ts",this.generatedFilesMap)||this.clearGeneratedFileWatch():e?this.clearGeneratedFileWatch():this.generatedFilesMap.forEach((e,t)=>{const n=this.program.getSourceFileByPath(t);n&&n.resolvedPath===t&&this.isValidGeneratedFileWatcher(Ky(n.fileName,this.compilerOptions,this.program),e)||(GU(e),this.generatedFilesMap.delete(t))})}this.languageServiceEnabled&&0===this.projectService.serverMode&&this.resolutionCache.updateTypeRootsWatch()}this.projectService.verifyProgram(this),this.exportMapCache&&!this.exportMapCache.isEmpty()&&(this.exportMapCache.releaseSymbols(),this.hasAddedorRemovedFiles||n&&!this.program.structureIsReused?this.exportMapCache.clear():this.changedFilesForExportMapCache&&n&&this.program&&cd(this.changedFilesForExportMapCache,e=>{const t=n.getSourceFileByPath(e),r=this.program.getSourceFileByPath(e);return t&&r?this.exportMapCache.onFileChanged(t,r,!!this.getTypeAcquisition().enable):(this.exportMapCache.clear(),!0)})),this.changedFilesForExportMapCache&&this.changedFilesForExportMapCache.clear(),(this.hasAddedOrRemovedSymlinks||this.program&&!this.program.structureIsReused&&this.getCompilerOptions().preserveSymlinks)&&(this.symlinks=void 0,this.moduleSpecifierCache.clear());const s=this.externalFiles||rme;this.externalFiles=this.getExternalFiles(),sn(this.externalFiles,s,Dt(!this.useCaseSensitiveFileNames()),e=>{const t=this.projectService.getOrCreateScriptInfoNotOpenedByClient(e,this.currentDirectory,this.directoryStructureHost,!1);null==t||t.attachToProject(this)},e=>this.detachScriptInfoFromProject(e));const c=Wn()-r;return this.sendPerformanceEvent("UpdateGraph",c),this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${a}${this.program?` structureIsReused:: ${Pr[this.program.structureIsReused]}`:""} Elapsed: ${c}ms`),this.projectService.logger.isTestLogger?this.program!==n?this.print(!0,this.hasAddedorRemovedFiles,!0):this.writeLog("Same program as before"):this.hasAddedorRemovedFiles?this.print(!0,!0,!1):this.program!==n&&this.writeLog("Different program with same set of files"),this.projectService.verifyDocumentRegistry(),a}sendPerformanceEvent(e,t){this.projectService.sendPerformanceEvent(e,t)}detachScriptInfoFromProject(e,t){const n=this.projectService.getScriptInfo(e);n&&(n.detachFromProject(this),t||this.resolutionCache.removeResolutionsOfFile(n.path))}addMissingFileWatcher(e,t){var n;if(Gme(this)){const t=this.projectService.configFileExistenceInfoCache.get(e);if(null==(n=null==t?void 0:t.config)?void 0:n.projects.has(this.canonicalConfigFilePath))return R$}const r=this.projectService.watchFactory.watchFile(Uo(t,this.currentDirectory),(t,n)=>{Gme(this)&&this.getCachedDirectoryStructureHost().addOrDeleteFile(t,e,n),0===n&&this.missingFilesMap.has(e)&&(this.missingFilesMap.delete(e),r.close(),this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this))},500,this.projectService.getWatchOptions(this),z$.MissingFile,this);return r}isWatchedMissingFile(e){return!!this.missingFilesMap&&this.missingFilesMap.has(e)}addGeneratedFileWatch(e,t){if(this.compilerOptions.outFile)this.generatedFilesMap||(this.generatedFilesMap=this.createGeneratedFileWatcher(e));else{const n=this.toPath(t);if(this.generatedFilesMap){if(Bme(this.generatedFilesMap))return void pn.fail(`${this.projectName} Expected to not have --out watcher for generated file with options: ${JSON.stringify(this.compilerOptions)}`);if(this.generatedFilesMap.has(n))return}else this.generatedFilesMap=new Map;this.generatedFilesMap.set(n,this.createGeneratedFileWatcher(e))}}createGeneratedFileWatcher(e){return{generatedFilePath:this.toPath(e),watcher:this.projectService.watchFactory.watchFile(e,()=>{this.clearSourceMapperCache(),this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)},2e3,this.projectService.getWatchOptions(this),z$.MissingGeneratedFile,this)}}isValidGeneratedFileWatcher(e,t){return this.toPath(e)===t.generatedFilePath}clearGeneratedFileWatch(){this.generatedFilesMap&&(Bme(this.generatedFilesMap)?GU(this.generatedFilesMap):gx(this.generatedFilesMap,GU),this.generatedFilesMap=void 0)}getScriptInfoForNormalizedPath(e){const t=this.projectService.getScriptInfoForPath(this.toPath(e));return t&&!t.isAttached(this)?eme.ThrowProjectDoesNotContainDocument(e,this):t}getScriptInfo(e){return this.projectService.getScriptInfo(e)}filesToString(e){return this.filesToStringWorker(e,!0,!1)}filesToStringWorker(e,t,n){if(this.initialLoadPending)return"\tFiles (0) InitialLoadPending\n";if(!this.program)return"\tFiles (0) NoProgram\n";const r=this.program.getSourceFiles();let i=`\tFiles (${r.length})\n`;if(e){for(const e of r)i+=`\t${e.fileName}${n?` ${e.version} ${JSON.stringify(e.text)}`:""}\n`;t&&(i+="\n\n",E$(this.program,e=>i+=`\t${e}\n`))}return i}print(e,t,n){var r;this.writeLog(`Project '${this.projectName}' (${Ome[this.projectKind]})`),this.writeLog(this.filesToStringWorker(e&&this.projectService.logger.hasLevel(3),t&&this.projectService.logger.hasLevel(3),n&&this.projectService.logger.hasLevel(3))),this.writeLog("-----------------------------------------------"),this.autoImportProviderHost&&this.autoImportProviderHost.print(!1,!1,!1),null==(r=this.noDtsResolutionProject)||r.print(!1,!1,!1)}setCompilerOptions(e){var t;if(e){e.allowNonTsExtensions=!0;const n=this.compilerOptions;this.compilerOptions=e,this.setInternalCompilerOptionsForEmittingJsFiles(),null==(t=this.noDtsResolutionProject)||t.setCompilerOptions(this.getCompilerOptionsForNoDtsResolutionProject()),rd(n,e)&&(this.cachedUnresolvedImportsPerFile.clear(),this.lastCachedUnresolvedImportsList=void 0,this.resolutionCache.onChangesAffectModuleResolution(),this.moduleSpecifierCache.clear()),this.markAsDirty()}}setWatchOptions(e){this.watchOptions=e}getWatchOptions(){return this.watchOptions}setTypeAcquisition(e){e&&(this.typeAcquisition=this.removeLocalTypingsFromTypeAcquisition(e))}getTypeAcquisition(){return this.typeAcquisition||{}}getChangesSinceVersion(e,t){var n,r;const i=t?e=>je(e.entries(),([e,t])=>({fileName:e,isSourceOfProjectReferenceRedirect:t})):e=>je(e.keys());this.initialLoadPending||Uge(this);const o={projectName:this.getProjectName(),version:this.projectProgramVersion,isInferred:Kme(this),options:this.getCompilationSettings(),languageServiceDisabled:!this.languageServiceEnabled,lastFileExceededProgramSize:this.lastFileExceededProgramSize},a=this.updatedFileNames;if(this.updatedFileNames=void 0,this.lastReportedFileNames&&e===this.lastReportedVersion){if(this.projectProgramVersion===this.lastReportedVersion&&!a)return{info:o,projectErrors:this.getGlobalProjectErrors()};const e=this.lastReportedFileNames,r=(null==(n=this.externalFiles)?void 0:n.map(e=>({fileName:ame(e),isSourceOfProjectReferenceRedirect:!1})))||rme,s=Be(this.getFileNamesWithRedirectInfo(!!t).concat(r),e=>e.fileName,e=>e.isSourceOfProjectReferenceRedirect),c=new Map,l=new Map,_=a?je(a.keys()):[],u=[];return sd(s,(n,r)=>{e.has(r)?t&&n!==e.get(r)&&u.push({fileName:r,isSourceOfProjectReferenceRedirect:n}):c.set(r,n)}),sd(e,(e,t)=>{s.has(t)||l.set(t,e)}),this.lastReportedFileNames=s,this.lastReportedVersion=this.projectProgramVersion,{info:o,changes:{added:i(c),removed:i(l),updated:t?_.map(e=>({fileName:e,isSourceOfProjectReferenceRedirect:this.isSourceOfProjectReferenceRedirect(e)})):_,updatedRedirects:t?u:void 0},projectErrors:this.getGlobalProjectErrors()}}{const e=this.getFileNamesWithRedirectInfo(!!t),n=(null==(r=this.externalFiles)?void 0:r.map(e=>({fileName:ame(e),isSourceOfProjectReferenceRedirect:!1})))||rme,i=e.concat(n);return this.lastReportedFileNames=Be(i,e=>e.fileName,e=>e.isSourceOfProjectReferenceRedirect),this.lastReportedVersion=this.projectProgramVersion,{info:o,files:t?i:i.map(e=>e.fileName),projectErrors:this.getGlobalProjectErrors()}}}removeRoot(e){this.rootFilesMap.delete(e.path)}isSourceOfProjectReferenceRedirect(e){return!!this.program&&this.program.isSourceOfProjectReferenceRedirect(e)}getGlobalPluginSearchPaths(){return[...this.projectService.pluginProbeLocations,Jo(this.projectService.getExecutingFilePath(),"../../..")]}enableGlobalPlugins(e){if(!this.projectService.globalPlugins.length)return;const t=this.projectService.host;if(!t.require&&!t.importPlugin)return void this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");const n=this.getGlobalPluginSearchPaths();for(const t of this.projectService.globalPlugins)t&&(e.plugins&&e.plugins.some(e=>e.name===t)||(this.projectService.logger.info(`Loading global plugin ${t}`),this.enablePlugin({name:t,global:!0},n)))}enablePlugin(e,t){this.projectService.requestEnablePlugin(this,e,t)}enableProxy(e,t){try{if("function"!=typeof e)return void this.projectService.logger.info(`Skipped loading plugin ${t.name} because it did not expose a proper factory function`);const n={config:t,project:this,languageService:this.languageService,languageServiceHost:this,serverHost:this.projectService.host,session:this.projectService.session},r=e({typescript:Rfe}),i=r.create(n);for(const e of Object.keys(this.languageService))e in i||(this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${e} in created LS. Patching.`),i[e]=this.languageService[e]);this.projectService.logger.info("Plugin validation succeeded"),this.languageService=i,this.plugins.push({name:t.name,module:r})}catch(e){this.projectService.logger.info(`Plugin activation failed: ${e}`)}}onPluginConfigurationChanged(e,t){this.plugins.filter(t=>t.name===e).forEach(e=>{e.module.onConfigurationChanged&&e.module.onConfigurationChanged(t)})}refreshDiagnostics(){this.projectService.sendProjectsUpdatedInBackgroundEvent()}getPackageJsonsVisibleToFile(e,t){return 0!==this.projectService.serverMode?rme:this.projectService.getPackageJsonsVisibleToFile(e,this,t)}getNearestAncestorDirectoryWithPackageJson(e){return this.projectService.getNearestAncestorDirectoryWithPackageJson(e,this)}getPackageJsonsForAutoImport(e){return this.getPackageJsonsVisibleToFile(Jo(this.currentDirectory,LV),e)}getPackageJsonCache(){return this.projectService.packageJsonCache}getCachedExportInfoMap(){return this.exportMapCache||(this.exportMapCache=k0(this))}clearCachedExportInfoMap(){var e;null==(e=this.exportMapCache)||e.clear()}getModuleSpecifierCache(){return this.moduleSpecifierCache}includePackageJsonAutoImports(){return 0!==this.projectService.includePackageJsonAutoImports()&&this.languageServiceEnabled&&!GZ(this.currentDirectory)&&this.isDefaultProjectForOpenFiles()?this.projectService.includePackageJsonAutoImports():0}getHostForAutoImportProvider(){var e,t;return this.program?{fileExists:this.program.fileExists,directoryExists:this.program.directoryExists,realpath:this.program.realpath||(null==(e=this.projectService.host.realpath)?void 0:e.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:null==(t=this.projectService.host.trace)?void 0:t.bind(this.projectService.host),useCaseSensitiveFileNames:this.program.useCaseSensitiveFileNames(),readDirectory:this.projectService.host.readDirectory.bind(this.projectService.host)}:this.projectService.host}getPackageJsonAutoImportProvider(){var e,t,n;if(!1===this.autoImportProviderHost)return;if(0!==this.projectService.serverMode)return void(this.autoImportProviderHost=!1);if(this.autoImportProviderHost)return Uge(this.autoImportProviderHost),this.autoImportProviderHost.isEmpty()?(this.autoImportProviderHost.close(),void(this.autoImportProviderHost=void 0)):this.autoImportProviderHost.getCurrentProgram();const r=this.includePackageJsonAutoImports();if(r){null==(e=Gn)||e.push(Gn.Phase.Session,"getPackageJsonAutoImportProvider");const i=Wn();if(this.autoImportProviderHost=Wme.create(r,this,this.getHostForAutoImportProvider())??!1,this.autoImportProviderHost)return Uge(this.autoImportProviderHost),this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider",Wn()-i),null==(t=Gn)||t.pop(),this.autoImportProviderHost.getCurrentProgram();null==(n=Gn)||n.pop()}}isDefaultProjectForOpenFiles(){return!!sd(this.projectService.openFiles,(e,t)=>this.projectService.tryGetDefaultProjectForFile(this.projectService.getScriptInfoForPath(t))===this)}watchNodeModulesForPackageJsonChanges(e){return this.projectService.watchPackageJsonsInNodeModules(e,this)}getIncompleteCompletionsCache(){return this.projectService.getIncompleteCompletionsCache()}getNoDtsResolutionProject(e){return pn.assert(0===this.projectService.serverMode),this.noDtsResolutionProject??(this.noDtsResolutionProject=new Ume(this)),this.noDtsResolutionProject.rootFile!==e&&(this.projectService.setFileNamesOfAutoImportProviderOrAuxillaryProject(this.noDtsResolutionProject,[e]),this.noDtsResolutionProject.rootFile=e),this.noDtsResolutionProject}runWithTemporaryFileUpdate(e,t,n){var r,i,o,a;const s=this.program,c=pn.checkDefined(null==(r=this.program)?void 0:r.getSourceFile(e),"Expected file to be part of program"),l=pn.checkDefined(c.getFullText());null==(i=this.getScriptInfo(e))||i.editContent(0,l.length,t),this.updateGraph();try{n(this.program,s,null==(o=this.program)?void 0:o.getSourceFile(e))}finally{null==(a=this.getScriptInfo(e))||a.editContent(0,t.length,l)}}getCompilerOptionsForNoDtsResolutionProject(){return{...this.getCompilerOptions(),noDtsResolution:!0,allowJs:!0,maxNodeModuleJsDepth:3,diagnostics:!1,skipLibCheck:!0,sourceMap:!1,types:_,lib:_,noLib:!0}}};var qme=class extends zme{constructor(e,t,n,r,i,o){super(e.newInferredProjectName(),0,e,!1,void 0,t,!1,n,e.host,i),this._isJsInferredProject=!1,this.typeAcquisition=o,this.projectRootPath=r&&e.toCanonicalFileName(r),r||e.useSingleInferredProject||(this.canonicalCurrentDirectory=e.toCanonicalFileName(this.currentDirectory)),this.enableGlobalPlugins(this.getCompilerOptions())}toggleJsInferredProject(e){e!==this._isJsInferredProject&&(this._isJsInferredProject=e,this.setCompilerOptions())}setCompilerOptions(e){if(!e&&!this.getCompilationSettings())return;const t=BQ(e||this.getCompilationSettings());this._isJsInferredProject&&"number"!=typeof t.maxNodeModuleJsDepth?t.maxNodeModuleJsDepth=2:this._isJsInferredProject||(t.maxNodeModuleJsDepth=void 0),t.allowJs=!0,super.setCompilerOptions(t)}addRoot(e){pn.assert(e.isScriptOpen()),this.projectService.startWatchingConfigFilesForInferredProjectRoot(e),!this._isJsInferredProject&&e.isJavaScript()?this.toggleJsInferredProject(!0):this.isOrphan()&&this._isJsInferredProject&&!e.isJavaScript()&&this.toggleJsInferredProject(!1),super.addRoot(e)}removeRoot(e){this.projectService.stopWatchingConfigFilesForScriptInfo(e),super.removeRoot(e),!this.isOrphan()&&this._isJsInferredProject&&e.isJavaScript()&&b(this.getRootScriptInfos(),e=>!e.isJavaScript())&&this.toggleJsInferredProject(!1)}isOrphan(){return!this.hasRoots()}isProjectWithSingleRoot(){return!this.projectRootPath&&!this.projectService.useSingleInferredProject||1===this.getRootScriptInfos().length}close(){p(this.getRootScriptInfos(),e=>this.projectService.stopWatchingConfigFilesForScriptInfo(e)),super.close()}getTypeAcquisition(){return this.typeAcquisition||{enable:jme(this),include:_,exclude:_}}},Ume=class extends zme{constructor(e){super(e.projectService.newAuxiliaryProjectName(),4,e.projectService,!1,void 0,e.getCompilerOptionsForNoDtsResolutionProject(),!1,void 0,e.projectService.host,e.currentDirectory)}isOrphan(){return!0}scheduleInvalidateResolutionsOfFailedLookupLocations(){}},Vme=class e extends zme{constructor(e,t,n){super(e.projectService.newAutoImportProviderProjectName(),3,e.projectService,!1,void 0,n,!1,e.getWatchOptions(),e.projectService.host,e.currentDirectory),this.hostProject=e,this.rootFileNames=t,this.useSourceOfProjectReferenceRedirect=He(this.hostProject,this.hostProject.useSourceOfProjectReferenceRedirect),this.getParsedCommandLine=He(this.hostProject,this.hostProject.getParsedCommandLine)}static getRootFileNames(e,t,n,r){var i,o;if(!e)return _;const a=t.getCurrentProgram();if(!a)return _;const s=Wn();let c,l;const u=Jo(t.currentDirectory,LV),d=t.getPackageJsonsForAutoImport(Jo(t.currentDirectory,u));for(const e of d)null==(i=e.dependencies)||i.forEach((e,t)=>y(t)),null==(o=e.peerDependencies)||o.forEach((e,t)=>y(t));let f=0;if(c){const i=t.getSymlinkCache();for(const o of je(c.keys())){if(2===e&&f>=this.maxDependencies)return t.log(`AutoImportProviderProject: attempted to add more than ${this.maxDependencies} dependencies. Aborting.`),_;const s=DM(o,t.currentDirectory,r,n,a.getModuleResolutionCache());if(s){const e=v(s,a,i);if(e){f+=h(e);continue}}if(!p([t.currentDirectory,t.getGlobalTypingsCacheLocation()],e=>{if(e){const t=DM(`@types/${o}`,e,r,n,a.getModuleResolutionCache());if(t){const e=v(t,a,i);return f+=h(e),!0}}})&&(s&&r.allowJs&&r.maxNodeModuleJsDepth)){const e=v(s,a,i,!0);f+=h(e)}}}const m=a.getResolvedProjectReferences();let g=0;return(null==m?void 0:m.length)&&t.projectService.getHostPreferences().includeCompletionsForModuleExports&&m.forEach(e=>{if(null==e?void 0:e.commandLine.options.outFile)g+=h(b([QS(e.commandLine.options.outFile,".d.ts")]));else if(e){const n=ft(()=>bU(e.commandLine,!t.useCaseSensitiveFileNames()));g+=h(b(J(e.commandLine.fileNames,r=>vO(r)||wo(r,".json")||a.getSourceFile(r)?void 0:dU(r,e.commandLine,!t.useCaseSensitiveFileNames(),n))))}}),(null==l?void 0:l.size)&&t.log(`AutoImportProviderProject: found ${l.size} root files in ${f} dependencies ${g} referenced projects in ${Wn()-s} ms`),l?je(l.values()):_;function h(e){return(null==e?void 0:e.length)?(l??(l=new Set),e.forEach(e=>l.add(e)),1):0}function y(e){Qt(e,"@types/")||(c||(c=new Set)).add(e)}function v(e,i,o,a){var s;const c=hR(e,r,n,i.getModuleResolutionCache(),a);if(c){const r=null==(s=n.realpath)?void 0:s.call(n,e.packageDirectory),i=r?t.toPath(r):void 0,a=i&&i!==t.toPath(e.packageDirectory);return a&&o.setSymlinkedDirectory(e.packageDirectory,{real:Go(r),realPath:Go(i)}),b(c,a?t=>t.replace(e.packageDirectory,r):void 0)}}function b(e,t){return J(e,e=>{const n=t?t(e):e;if(!(a.getSourceFile(n)||t&&a.getSourceFile(e)))return n})}}static create(t,n,r){if(0===t)return;const i={...n.getCompilerOptions(),...this.compilerOptionsOverrides},o=this.getRootFileNames(t,n,r,i);return o.length?new e(n,o,i):void 0}isEmpty(){return!H(this.rootFileNames)}isOrphan(){return!0}updateGraph(){let t=this.rootFileNames;t||(t=e.getRootFileNames(this.hostProject.includePackageJsonAutoImports(),this.hostProject,this.hostProject.getHostForAutoImportProvider(),this.getCompilationSettings())),this.projectService.setFileNamesOfAutoImportProviderOrAuxillaryProject(this,t),this.rootFileNames=t;const n=this.getCurrentProgram(),r=super.updateGraph();return n&&n!==this.getCurrentProgram()&&this.hostProject.clearCachedExportInfoMap(),r}scheduleInvalidateResolutionsOfFailedLookupLocations(){}hasRoots(){var e;return!!(null==(e=this.rootFileNames)?void 0:e.length)}markAsDirty(){this.rootFileNames=void 0,super.markAsDirty()}getScriptFileNames(){return this.rootFileNames||_}getLanguageService(){throw new Error("AutoImportProviderProject language service should never be used. To get the program, use `project.getCurrentProgram()`.")}onAutoImportProviderSettingsChanged(){throw new Error("AutoImportProviderProject is an auto import provider; use `markAsDirty()` instead.")}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()}includePackageJsonAutoImports(){return 0}getSymlinkCache(){return this.hostProject.getSymlinkCache()}getModuleResolutionCache(){var e;return null==(e=this.hostProject.getCurrentProgram())?void 0:e.getModuleResolutionCache()}};Vme.maxDependencies=10,Vme.compilerOptionsOverrides={diagnostics:!1,skipLibCheck:!0,sourceMap:!1,types:_,lib:_,noLib:!0};var Wme=Vme,$me=class extends zme{constructor(e,t,n,r,i){super(e,1,n,!1,void 0,{},!1,void 0,r,Ao(e)),this.canonicalConfigFilePath=t,this.openFileWatchTriggered=new Map,this.initialLoadPending=!0,this.sendLoadingProjectFinish=!1,this.pendingUpdateLevel=2,this.pendingUpdateReason=i}setCompilerHost(e){this.compilerHost=e}getCompilerHost(){return this.compilerHost}useSourceOfProjectReferenceRedirect(){return this.languageServiceEnabled}getParsedCommandLine(e){const t=ame(e),n=this.projectService.toCanonicalFileName(t);let r=this.projectService.configFileExistenceInfoCache.get(n);return r||this.projectService.configFileExistenceInfoCache.set(n,r={exists:this.projectService.host.fileExists(t)}),this.projectService.ensureParsedConfigUptoDate(t,n,r,this),this.languageServiceEnabled&&0===this.projectService.serverMode&&this.projectService.watchWildcards(t,r,this),r.exists?r.config.parsedCommandLine:void 0}onReleaseParsedCommandLine(e){this.releaseParsedConfig(this.projectService.toCanonicalFileName(ame(e)))}releaseParsedConfig(e){this.projectService.stopWatchingWildCards(e,this),this.projectService.releaseParsedConfig(e,this)}updateGraph(){if(this.deferredClose)return!1;const e=this.dirty;this.initialLoadPending=!1;const t=this.pendingUpdateLevel;let n;switch(this.pendingUpdateLevel=0,t){case 1:this.openFileWatchTriggered.clear(),n=this.projectService.reloadFileNamesOfConfiguredProject(this);break;case 2:this.openFileWatchTriggered.clear();const e=pn.checkDefined(this.pendingUpdateReason);this.projectService.reloadConfiguredProject(this,e),n=!0;break;default:n=super.updateGraph()}return this.compilerHost=void 0,this.projectService.sendProjectLoadingFinishEvent(this),this.projectService.sendProjectTelemetry(this),2!==t&&(!n||e&&this.triggerFileForConfigFileDiag&&2!==this.getCurrentProgram().structureIsReused)?this.triggerFileForConfigFileDiag||this.projectService.sendConfigFileDiagEvent(this,void 0,!1):this.triggerFileForConfigFileDiag=void 0,n}getCachedDirectoryStructureHost(){return this.directoryStructureHost}getConfigFilePath(){return this.getProjectName()}getProjectReferences(){return this.projectReferences}updateReferences(e){this.projectReferences=e,this.potentialProjectReferences=void 0}setPotentialProjectReference(e){pn.assert(this.initialLoadPending),(this.potentialProjectReferences||(this.potentialProjectReferences=new Set)).add(e)}getRedirectFromSourceFile(e){const t=this.getCurrentProgram();return t&&t.getRedirectFromSourceFile(e)}forEachResolvedProjectReference(e){var t;return null==(t=this.getCurrentProgram())?void 0:t.forEachResolvedProjectReference(e)}enablePluginsWithOptions(e){var t;if(this.plugins.length=0,!(null==(t=e.plugins)?void 0:t.length)&&!this.projectService.globalPlugins.length)return;const n=this.projectService.host;if(!n.require&&!n.importPlugin)return void this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");const r=this.getGlobalPluginSearchPaths();if(this.projectService.allowLocalPluginLoads){const e=Ao(this.canonicalConfigFilePath);this.projectService.logger.info(`Local plugin loading enabled; adding ${e} to search paths`),r.unshift(e)}if(e.plugins)for(const t of e.plugins)this.enablePlugin(t,r);return this.enableGlobalPlugins(e)}getGlobalProjectErrors(){return D(this.projectErrors,e=>!e.file)||rme}getAllProjectErrors(){return this.projectErrors||rme}setProjectErrors(e){this.projectErrors=e}close(){this.projectService.configFileExistenceInfoCache.forEach((e,t)=>this.releaseParsedConfig(t)),this.projectErrors=void 0,this.openFileWatchTriggered.clear(),this.compilerHost=void 0,super.close()}markAsDirty(){this.deferredClose||super.markAsDirty()}isOrphan(){return!!this.deferredClose}getEffectiveTypeRoots(){return bM(this.getCompilationSettings(),this)||[]}updateErrorOnNoInputFiles(e){this.parsedCommandLine=e,Cj(e.fileNames,this.getConfigFilePath(),this.getCompilerOptions().configFile.configFileSpecs,this.projectErrors,Tj(e.raw))}},Hme=class extends zme{constructor(e,t,n,r,i,o,a){super(e,2,t,!0,r,n,i,a,t.host,Ao(o||Ro(e))),this.externalProjectName=e,this.compileOnSaveEnabled=i,this.excludedFiles=[],this.enableGlobalPlugins(this.getCompilerOptions())}updateGraph(){const e=super.updateGraph();return this.projectService.sendProjectTelemetry(this),e}getExcludedFiles(){return this.excludedFiles}};function Kme(e){return 0===e.projectKind}function Gme(e){return 1===e.projectKind}function Xme(e){return 2===e.projectKind}function Qme(e){return 3===e.projectKind||4===e.projectKind}function Yme(e){return Gme(e)&&!!e.deferredClose}var Zme=20971520,ege=4194304,tge="projectsUpdatedInBackground",nge="projectLoadingStart",rge="projectLoadingFinish",ige="largeFileReferenced",oge="configFileDiag",age="projectLanguageServiceState",sge="projectInfo",cge="openFileInfo",lge="createFileWatcher",_ge="createDirectoryWatcher",uge="closeFileWatcher",dge="*ensureProjectForOpenFiles*";function pge(e){const t=new Map;for(const n of e)if("object"==typeof n.type){const e=n.type;e.forEach(e=>{pn.assert("number"==typeof e)}),t.set(n.name,e)}return t}var fge=pge(zO),mge=pge(jO),gge=new Map(Object.entries({none:0,block:1,smart:2})),hge={jquery:{match:/jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,types:["jquery"]},WinJS:{match:/^(.*\/winjs-[.\d]+)\/js\/base\.js$/i,exclude:[["^",1,"/.*"]],types:["winjs"]},Kendo:{match:/^(.*\/kendo(-ui)?)\/kendo\.all(\.min)?\.js$/i,exclude:[["^",1,"/.*"]],types:["kendo-ui"]},"Office Nuget":{match:/^(.*\/office\/1)\/excel-\d+\.debug\.js$/i,exclude:[["^",1,"/.*"]],types:["office"]},References:{match:/^(.*\/_references\.js)$/i,exclude:[["^",1,"$"]]}};function yge(e){return tt(e.indentStyle)&&(e.indentStyle=gge.get(e.indentStyle.toLowerCase()),pn.assert(void 0!==e.indentStyle)),e}function vge(e){return fge.forEach((t,n)=>{const r=e[n];tt(r)&&(e[n]=t.get(r.toLowerCase()))}),e}function bge(e,t){let n,r;return jO.forEach(i=>{const o=e[i.name];if(void 0===o)return;const a=mge.get(i.name);(n||(n={}))[i.name]=a?tt(o)?a.get(o.toLowerCase()):o:Mj(i,o,t||"",r||(r=[]))}),n&&{watchOptions:n,errors:r}}function xge(e){let t;return nL.forEach(n=>{const r=e[n.name];void 0!==r&&((t||(t={}))[n.name]=r)}),t}function kge(e){return tt(e)?Sge(e):e}function Sge(e){switch(e){case"JS":return 1;case"JSX":return 2;case"TS":return 3;case"TSX":return 4;default:return 0}}function Tge(e){const{lazyConfiguredProjectsFromExternalProject:t,...n}=e;return n}var Cge={getFileName:e=>e,getScriptKind:(e,t)=>{let n;if(t){const r=Lo(e);r&&H(t,e=>e.extension===r&&(n=e.scriptKind,!0))}return n},hasMixedContent:(e,t)=>H(t,t=>t.isMixedContent&&wo(e,t.extension))},wge={getFileName:e=>e.fileName,getScriptKind:e=>kge(e.scriptKind),hasMixedContent:e=>!!e.hasMixedContent};function Nge(e,t){for(const n of t)if(n.getProjectName()===e)return n}var Dge={isKnownTypesPackageName:at,installPackage:pt,enqueueInstallTypingsRequest:ot,attach:ot,onProjectClosed:ot,globalTypingsCacheLocation:void 0},Fge={close:ot};function Ege(e,t){if(!t)return;const n=t.get(e.path);return void 0!==n?Age(e)?n&&!tt(n)?n.get(e.fileName):void 0:tt(n)||!n?n:n.get(!1):void 0}function Pge(e){return!!e.containingProjects}function Age(e){return!!e.configFileInfo}var Ige=(e=>(e[e.FindOptimized=0]="FindOptimized",e[e.Find=1]="Find",e[e.CreateReplayOptimized=2]="CreateReplayOptimized",e[e.CreateReplay=3]="CreateReplay",e[e.CreateOptimized=4]="CreateOptimized",e[e.Create=5]="Create",e[e.ReloadOptimized=6]="ReloadOptimized",e[e.Reload=7]="Reload",e))(Ige||{});function Oge(e){return e-1}function Lge(e,t,n,r,i,o,a,s,c){for(var l;;){if(t.parsedCommandLine&&(s&&!t.parsedCommandLine.options.composite||t.parsedCommandLine.options.disableSolutionSearching))return;const _=t.projectService.getConfigFileNameForFile({fileName:t.getConfigFilePath(),path:e.path,configFileInfo:!0,isForDefaultProject:!s},r<=3);if(!_)return;const u=t.projectService.findCreateOrReloadConfiguredProject(_,r,i,o,s?void 0:e.fileName,a,s,c);if(!u)return;!u.project.parsedCommandLine&&(null==(l=t.parsedCommandLine)?void 0:l.options.composite)&&u.project.setPotentialProjectReference(t.canonicalConfigFilePath);const d=n(u);if(d)return d;t=u.project}}function jge(e,t,n,r,i,o,a,s){const c=t.options.disableReferencedProjectLoad?0:r;let l;return p(t.projectReferences,t=>{var _;const u=ame(tW(t)),d=e.projectService.toCanonicalFileName(u),p=null==s?void 0:s.get(d);if(void 0!==p&&p>=c)return;const f=e.projectService.configFileExistenceInfoCache.get(d);let m=0===c?(null==f?void 0:f.exists)||(null==(_=e.resolvedChildConfigs)?void 0:_.has(d))?f.config.parsedCommandLine:void 0:e.getParsedCommandLine(u);if(m&&c!==r&&c>2&&(m=e.getParsedCommandLine(u)),!m)return;const g=e.projectService.findConfiguredProjectByProjectName(u,o);if(2!==c||f||g){switch(c){case 6:g&&g.projectService.reloadConfiguredProjectOptimized(g,i,a);case 4:(e.resolvedChildConfigs??(e.resolvedChildConfigs=new Set)).add(d);case 2:case 0:if(g||0!==c){const t=n(f??e.projectService.configFileExistenceInfoCache.get(d),g,u,i,e,d);if(t)return t}break;default:pn.assertNever(c)}(s??(s=new Map)).set(d,c),(l??(l=[])).push(m)}})||p(l,t=>t.projectReferences&&jge(e,t,n,c,i,o,a,s))}function Mge(e,t,n,r,i){let o,a=!1;switch(t){case 2:case 3:$ge(e)&&(o=e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath));break;case 4:if(o=Wge(e),o)break;case 5:a=function(e,t){if(t){if(Vge(e,t,!1))return!0}else Uge(e);return!1}(e,n);break;case 6:if(e.projectService.reloadConfiguredProjectOptimized(e,r,i),o=Wge(e),o)break;case 7:a=e.projectService.reloadConfiguredProjectClearingSemanticCache(e,r,i);break;case 0:case 1:break;default:pn.assertNever(t)}return{project:e,sentConfigFileDiag:a,configFileExistenceInfo:o,reason:r}}function Rge(e,t){return e.initialLoadPending?(e.potentialProjectReferences&&cd(e.potentialProjectReferences,t))??(e.resolvedChildConfigs&&cd(e.resolvedChildConfigs,t)):void 0}function Bge(e,t,n){const r=n&&e.projectService.configuredProjects.get(n);return r&&t(r)}function Jge(e,t){return function(e,t,n,r){return e.getCurrentProgram()?e.forEachResolvedProjectReference(t):e.initialLoadPending?Rge(e,r):p(e.getProjectReferences(),n)}(e,n=>Bge(e,t,n.sourceFile.path),n=>Bge(e,t,e.toPath(tW(n))),n=>Bge(e,t,n))}function zge(e,t){return`${tt(t)?`Config: ${t} `:t?`Project: ${t.getProjectName()} `:""}WatchType: ${e}`}function qge(e){return!e.isScriptOpen()&&void 0!==e.mTime}function Uge(e){return e.invalidateResolutionsOfFailedLookupLocations(),e.dirty&&!e.updateGraph()}function Vge(e,t,n){if(!n&&(e.invalidateResolutionsOfFailedLookupLocations(),!e.dirty))return!1;e.triggerFileForConfigFileDiag=t;const r=e.pendingUpdateLevel;if(e.updateGraph(),!e.triggerFileForConfigFileDiag&&!n)return 2===r;const i=e.projectService.sendConfigFileDiagEvent(e,t,n);return e.triggerFileForConfigFileDiag=void 0,i}function Wge(e){const t=ame(e.getConfigFilePath()),n=e.projectService.ensureParsedConfigUptoDate(t,e.canonicalConfigFilePath,e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath),e),r=n.config.parsedCommandLine;if(e.parsedCommandLine=r,e.resolvedChildConfigs=void 0,e.updateReferences(r.projectReferences),$ge(e))return n}function $ge(e){return!(!e.parsedCommandLine||!e.parsedCommandLine.options.composite&&!Sj(e.parsedCommandLine))}function Hge(e){return`User requested reload projects: ${e}`}function Kge(e){Gme(e)&&(e.projectOptions=!0)}function Gge(e){let t=1;return()=>e(t++)}function Xge(){return{idToCallbacks:new Map,pathToId:new Map}}function Qge(e,t){return!!t&&!!e.eventHandler&&!!e.session}function Yge(e,t){if(!Qge(e,t))return;const n=Xge(),r=Xge(),i=Xge();let o=1;return e.session.addProtocolHandler("watchChange",e=>{var t;return Ze(t=e.arguments)?t.forEach(s):s(t),{responseRequired:!1}}),{watchFile:function(e,t){return a(n,e,t,t=>({eventName:lge,data:{id:t,path:e}}))},watchDirectory:function(e,t,n){return a(n?i:r,e,t,t=>({eventName:_ge,data:{id:t,path:e,recursive:!!n,ignoreUpdate:!e.endsWith("/node_modules")||void 0}}))},getCurrentDirectory:()=>e.host.getCurrentDirectory(),useCaseSensitiveFileNames:e.host.useCaseSensitiveFileNames};function a({pathToId:t,idToCallbacks:n},r,i,a){const s=e.toPath(r);let c=t.get(s);c||t.set(s,c=o++);let l=n.get(c);return l||(n.set(c,l=new Set),e.eventHandler(a(c))),l.add(i),{close(){const r=n.get(c);(null==r?void 0:r.delete(i))&&(r.size||(n.delete(c),t.delete(s),e.eventHandler({eventName:uge,data:{id:c}})))}}}function s({id:e,created:t,deleted:n,updated:r}){c(e,t,0),c(e,n,2),c(e,r,1)}function c(e,t,o){(null==t?void 0:t.length)&&(l(n,e,t,(e,t)=>e(t,o)),l(r,e,t,(e,t)=>e(t)),l(i,e,t,(e,t)=>e(t)))}function l(e,t,n,r){var i;null==(i=e.idToCallbacks.get(t))||i.forEach(e=>{n.forEach(t=>r(e,Ro(t)))})}}var Zge=class e{constructor(e){var t;this.filenameToScriptInfo=new Map,this.nodeModulesWatchers=new Map,this.filenameToScriptInfoVersion=new Map,this.allJsFilesForOpenFileTelemetry=new Set,this.externalProjectToConfiguredProjectMap=new Map,this.externalProjects=[],this.inferredProjects=[],this.configuredProjects=new Map,this.newInferredProjectName=Gge(ume),this.newAutoImportProviderProjectName=Gge(dme),this.newAuxiliaryProjectName=Gge(pme),this.openFiles=new Map,this.configFileForOpenFiles=new Map,this.rootOfInferredProjects=new Set,this.openFilesWithNonRootedDiskPath=new Map,this.compilerOptionsForInferredProjectsPerProjectRoot=new Map,this.watchOptionsForInferredProjectsPerProjectRoot=new Map,this.typeAcquisitionForInferredProjectsPerProjectRoot=new Map,this.projectToSizeMap=new Map,this.configFileExistenceInfoCache=new Map,this.safelist=hge,this.legacySafelist=new Map,this.pendingProjectUpdates=new Map,this.pendingEnsureProjectForOpenFiles=!1,this.seenProjects=new Map,this.sharedExtendedConfigFileWatchers=new Map,this.extendedConfigCache=new Map,this.baseline=ot,this.verifyDocumentRegistry=ot,this.verifyProgram=ot,this.onProjectCreation=ot,this.host=e.host,this.logger=e.logger,this.cancellationToken=e.cancellationToken,this.useSingleInferredProject=e.useSingleInferredProject,this.useInferredProjectPerProjectRoot=e.useInferredProjectPerProjectRoot,this.typingsInstaller=e.typingsInstaller||Dge,this.throttleWaitMilliseconds=e.throttleWaitMilliseconds,this.eventHandler=e.eventHandler,this.suppressDiagnosticEvents=e.suppressDiagnosticEvents,this.globalPlugins=e.globalPlugins||rme,this.pluginProbeLocations=e.pluginProbeLocations||rme,this.allowLocalPluginLoads=!!e.allowLocalPluginLoads,this.typesMapLocation=void 0===e.typesMapLocation?Jo(Ao(this.getExecutingFilePath()),"typesMap.json"):e.typesMapLocation,this.session=e.session,this.jsDocParsingMode=e.jsDocParsingMode,void 0!==e.serverMode?this.serverMode=e.serverMode:this.serverMode=0,this.host.realpath&&(this.realpathToScriptInfos=Ke()),this.currentDirectory=ame(this.host.getCurrentDirectory()),this.toCanonicalFileName=Ht(this.host.useCaseSensitiveFileNames),this.globalCacheLocationDirectoryPath=this.typingsInstaller.globalTypingsCacheLocation?Go(this.toPath(this.typingsInstaller.globalTypingsCacheLocation)):void 0,this.throttledOperations=new mme(this.host,this.logger),this.logger.info(`currentDirectory:: ${this.host.getCurrentDirectory()} useCaseSensitiveFileNames:: ${this.host.useCaseSensitiveFileNames}`),this.logger.info(`libs Location:: ${Ao(this.host.getExecutingFilePath())}`),this.logger.info(`globalTypingsCacheLocation:: ${this.typingsInstaller.globalTypingsCacheLocation}`),this.typesMapLocation?this.loadTypesMap():this.logger.info("No types map provided; using the default"),this.typingsInstaller.attach(this),this.hostConfiguration={formatCodeOptions:WG(this.host.newLine),preferences:MG,hostInfo:"Unknown host",extraFileExtensions:[]},this.documentRegistry=Q0(this.host.useCaseSensitiveFileNames,this.currentDirectory,this.jsDocParsingMode,this);const n=this.logger.hasLevel(3)?2:this.logger.loggingEnabled()?1:0,r=0!==n?e=>this.logger.info(e):ot;this.packageJsonCache=ihe(this),this.watchFactory=0!==this.serverMode?{watchFile:B$,watchDirectory:B$}:HU(Yge(this,e.canUseWatchEvents)||this.host,n,r,zge),this.canUseWatchEvents=Qge(this,e.canUseWatchEvents),null==(t=e.incrementalVerifier)||t.call(e,this)}toPath(e){return Ho(e,this.currentDirectory,this.toCanonicalFileName)}getExecutingFilePath(){return this.getNormalizedAbsolutePath(this.host.getExecutingFilePath())}getNormalizedAbsolutePath(e){return Uo(e,this.host.getCurrentDirectory())}setDocument(e,t,n){pn.checkDefined(this.getScriptInfoForPath(t)).cacheSourceFile={key:e,sourceFile:n}}getDocument(e,t){const n=this.getScriptInfoForPath(t);return n&&n.cacheSourceFile&&n.cacheSourceFile.key===e?n.cacheSourceFile.sourceFile:void 0}ensureInferredProjectsUpToDate_TestOnly(){this.ensureProjectStructuresUptoDate()}getCompilerOptionsForInferredProjects(){return this.compilerOptionsForInferredProjects}onUpdateLanguageServiceStateForProject(e,t){if(!this.eventHandler)return;const n={eventName:age,data:{project:e,languageServiceEnabled:t}};this.eventHandler(n)}loadTypesMap(){try{const e=this.host.readFile(this.typesMapLocation);if(void 0===e)return void this.logger.info(`Provided types map file "${this.typesMapLocation}" doesn't exist`);const t=JSON.parse(e);for(const e of Object.keys(t.typesMap))t.typesMap[e].match=new RegExp(t.typesMap[e].match,"i");this.safelist=t.typesMap;for(const e in t.simpleMap)Ee(t.simpleMap,e)&&this.legacySafelist.set(e,t.simpleMap[e].toLowerCase())}catch(e){this.logger.info(`Error loading types map: ${e}`),this.safelist=hge,this.legacySafelist.clear()}}updateTypingsForProject(e){const t=this.findProject(e.projectName);if(t)switch(e.kind){case cG:return void t.updateTypingFiles(e.compilerOptions,e.typeAcquisition,e.unresolvedImports,e.typings);case lG:return void t.enqueueInstallTypingsForProject(!0)}}watchTypingLocations(e){var t;null==(t=this.findProject(e.projectName))||t.watchTypingLocations(e.files)}delayEnsureProjectForOpenFiles(){this.openFiles.size&&(this.pendingEnsureProjectForOpenFiles=!0,this.throttledOperations.schedule(dge,2500,()=>{0!==this.pendingProjectUpdates.size?this.delayEnsureProjectForOpenFiles():this.pendingEnsureProjectForOpenFiles&&(this.ensureProjectForOpenFiles(),this.sendProjectsUpdatedInBackgroundEvent())}))}delayUpdateProjectGraph(e){if(Yme(e))return;if(e.markAsDirty(),Qme(e))return;const t=e.getProjectName();this.pendingProjectUpdates.set(t,e),this.throttledOperations.schedule(t,250,()=>{this.pendingProjectUpdates.delete(t)&&Uge(e)})}hasPendingProjectUpdate(e){return this.pendingProjectUpdates.has(e.getProjectName())}sendProjectsUpdatedInBackgroundEvent(){if(!this.eventHandler)return;const e={eventName:tge,data:{openFiles:je(this.openFiles.keys(),e=>this.getScriptInfoForPath(e).fileName)}};this.eventHandler(e)}sendLargeFileReferencedEvent(e,t){if(!this.eventHandler)return;const n={eventName:ige,data:{file:e,fileSize:t,maxFileSize:ege}};this.eventHandler(n)}sendProjectLoadingStartEvent(e,t){if(!this.eventHandler)return;e.sendLoadingProjectFinish=!0;const n={eventName:nge,data:{project:e,reason:t}};this.eventHandler(n)}sendProjectLoadingFinishEvent(e){if(!this.eventHandler||!e.sendLoadingProjectFinish)return;e.sendLoadingProjectFinish=!1;const t={eventName:rge,data:{project:e}};this.eventHandler(t)}sendPerformanceEvent(e,t){this.performanceEventHandler&&this.performanceEventHandler({kind:e,durationMs:t})}delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(e){this.delayUpdateProjectGraph(e),this.delayEnsureProjectForOpenFiles()}delayUpdateProjectGraphs(e,t){if(e.length){for(const n of e)t&&n.clearSourceMapperCache(),this.delayUpdateProjectGraph(n);this.delayEnsureProjectForOpenFiles()}}setCompilerOptionsForInferredProjects(e,t){pn.assert(void 0===t||this.useInferredProjectPerProjectRoot,"Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled");const n=vge(e),r=bge(e,t),i=xge(e);n.allowNonTsExtensions=!0;const o=t&&this.toCanonicalFileName(t);o?(this.compilerOptionsForInferredProjectsPerProjectRoot.set(o,n),this.watchOptionsForInferredProjectsPerProjectRoot.set(o,r||!1),this.typeAcquisitionForInferredProjectsPerProjectRoot.set(o,i)):(this.compilerOptionsForInferredProjects=n,this.watchOptionsForInferredProjects=r,this.typeAcquisitionForInferredProjects=i);for(const e of this.inferredProjects)(o?e.projectRootPath!==o:e.projectRootPath&&this.compilerOptionsForInferredProjectsPerProjectRoot.has(e.projectRootPath))||(e.setCompilerOptions(n),e.setTypeAcquisition(i),e.setWatchOptions(null==r?void 0:r.watchOptions),e.setProjectErrors(null==r?void 0:r.errors),e.compileOnSaveEnabled=n.compileOnSave,e.markAsDirty(),this.delayUpdateProjectGraph(e));this.delayEnsureProjectForOpenFiles()}findProject(e){if(void 0!==e)return _me(e)?Nge(e,this.inferredProjects):this.findExternalProjectByProjectName(e)||this.findConfiguredProjectByProjectName(ame(e))}forEachProject(e){this.externalProjects.forEach(e),this.configuredProjects.forEach(e),this.inferredProjects.forEach(e)}forEachEnabledProject(e){this.forEachProject(t=>{!t.isOrphan()&&t.languageServiceEnabled&&e(t)})}getDefaultProjectForFile(e,t){return t?this.ensureDefaultProjectForFile(e):this.tryGetDefaultProjectForFile(e)}tryGetDefaultProjectForFile(e){const t=tt(e)?this.getScriptInfoForNormalizedPath(e):e;return t&&!t.isOrphan()?t.getDefaultProject():void 0}tryGetDefaultProjectForEnsuringConfiguredProjectForFile(e){var t;const n=tt(e)?this.getScriptInfoForNormalizedPath(e):e;if(n)return(null==(t=this.pendingOpenFileProjectUpdates)?void 0:t.delete(n.path))&&(this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(n,5),n.isOrphan()&&this.assignOrphanScriptInfoToInferredProject(n,this.openFiles.get(n.path))),this.tryGetDefaultProjectForFile(n)}ensureDefaultProjectForFile(e){return this.tryGetDefaultProjectForEnsuringConfiguredProjectForFile(e)||this.doEnsureDefaultProjectForFile(e)}doEnsureDefaultProjectForFile(e){this.ensureProjectStructuresUptoDate();const t=tt(e)?this.getScriptInfoForNormalizedPath(e):e;return t?t.getDefaultProject():(this.logErrorForScriptInfoNotFound(tt(e)?e:e.fileName),eme.ThrowNoProject())}getScriptInfoEnsuringProjectsUptoDate(e){return this.ensureProjectStructuresUptoDate(),this.getScriptInfo(e)}ensureProjectStructuresUptoDate(){let e=this.pendingEnsureProjectForOpenFiles;this.pendingProjectUpdates.clear();const t=t=>{e=Uge(t)||e};this.externalProjects.forEach(t),this.configuredProjects.forEach(t),this.inferredProjects.forEach(t),e&&this.ensureProjectForOpenFiles()}getFormatCodeOptions(e){const t=this.getScriptInfoForNormalizedPath(e);return t&&t.getFormatCodeSettings()||this.hostConfiguration.formatCodeOptions}getPreferences(e){const t=this.getScriptInfoForNormalizedPath(e);return{...this.hostConfiguration.preferences,...t&&t.getPreferences()}}getHostFormatCodeOptions(){return this.hostConfiguration.formatCodeOptions}getHostPreferences(){return this.hostConfiguration.preferences}onSourceFileChanged(e,t){pn.assert(!e.isScriptOpen()),2===t?this.handleDeletedFile(e,!0):(e.deferredDelete&&(e.deferredDelete=void 0),e.delayReloadNonMixedContentFile(),this.delayUpdateProjectGraphs(e.containingProjects,!1),this.handleSourceMapProjects(e))}handleSourceMapProjects(e){if(e.sourceMapFilePath)if(tt(e.sourceMapFilePath)){const t=this.getScriptInfoForPath(e.sourceMapFilePath);this.delayUpdateSourceInfoProjects(null==t?void 0:t.sourceInfos)}else this.delayUpdateSourceInfoProjects(e.sourceMapFilePath.sourceInfos);this.delayUpdateSourceInfoProjects(e.sourceInfos),e.declarationInfoPath&&this.delayUpdateProjectsOfScriptInfoPath(e.declarationInfoPath)}delayUpdateSourceInfoProjects(e){e&&e.forEach((e,t)=>this.delayUpdateProjectsOfScriptInfoPath(t))}delayUpdateProjectsOfScriptInfoPath(e){const t=this.getScriptInfoForPath(e);t&&this.delayUpdateProjectGraphs(t.containingProjects,!0)}handleDeletedFile(e,t){pn.assert(!e.isScriptOpen()),this.delayUpdateProjectGraphs(e.containingProjects,!1),this.handleSourceMapProjects(e),e.detachAllProjects(),t?(e.delayReloadNonMixedContentFile(),e.deferredDelete=!0):this.deleteScriptInfo(e)}watchWildcardDirectory(e,t,n,r){let i=this.watchFactory.watchDirectory(e,t=>this.onWildCardDirectoryWatcherInvoke(e,n,r,o,t),t,this.getWatchOptionsFromProjectWatchOptions(r.parsedCommandLine.watchOptions,Ao(n)),z$.WildcardDirectory,n);const o={packageJsonWatches:void 0,close(){var e;i&&(i.close(),i=void 0,null==(e=o.packageJsonWatches)||e.forEach(e=>{e.projects.delete(o),e.close()}),o.packageJsonWatches=void 0)}};return o}onWildCardDirectoryWatcherInvoke(e,t,n,r,i){const o=this.toPath(i),a=n.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(i,o);if("package.json"===Io(o)&&!GZ(o)&&(a&&a.fileExists||!a&&this.host.fileExists(i))){const e=this.getNormalizedAbsolutePath(i);this.logger.info(`Config: ${t} Detected new package.json: ${e}`),this.packageJsonCache.addOrUpdate(e,o),this.watchPackageJsonFile(e,o,r)}(null==a?void 0:a.fileExists)||this.sendSourceFileChange(o);const s=this.findConfiguredProjectByProjectName(t);VU({watchedDirPath:this.toPath(e),fileOrDirectory:i,fileOrDirectoryPath:o,configFileName:t,extraFileExtensions:this.hostConfiguration.extraFileExtensions,currentDirectory:this.currentDirectory,options:n.parsedCommandLine.options,program:(null==s?void 0:s.getCurrentProgram())||n.parsedCommandLine.fileNames,useCaseSensitiveFileNames:this.host.useCaseSensitiveFileNames,writeLog:e=>this.logger.info(e),toPath:e=>this.toPath(e),getScriptKind:s?e=>s.getScriptKind(e):void 0})||(2!==n.updateLevel&&(n.updateLevel=1),n.projects.forEach((e,n)=>{var r;if(!e)return;const i=this.getConfiguredProjectByCanonicalConfigFilePath(n);if(!i)return;if(s!==i&&this.getHostPreferences().includeCompletionsForModuleExports){const e=this.toPath(t);x(null==(r=i.getCurrentProgram())?void 0:r.getResolvedProjectReferences(),t=>(null==t?void 0:t.sourceFile.path)===e)&&i.markAutoImportProviderAsDirty()}const a=s===i?1:0;if(!(i.pendingUpdateLevel>a))if(this.openFiles.has(o)){if(pn.checkDefined(this.getScriptInfoForPath(o)).isAttached(i)){const e=Math.max(a,i.openFileWatchTriggered.get(o)||0);i.openFileWatchTriggered.set(o,e)}else i.pendingUpdateLevel=a,this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(i)}else i.pendingUpdateLevel=a,this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(i)}))}delayUpdateProjectsFromParsedConfigOnConfigFileChange(e,t){const n=this.configFileExistenceInfoCache.get(e);if(!(null==n?void 0:n.config))return!1;let r=!1;return n.config.updateLevel=2,n.config.cachedDirectoryStructureHost.clearCache(),n.config.projects.forEach((n,i)=>{var o,a,s;const c=this.getConfiguredProjectByCanonicalConfigFilePath(i);if(c)if(r=!0,i===e){if(c.initialLoadPending)return;c.pendingUpdateLevel=2,c.pendingUpdateReason=t,this.delayUpdateProjectGraph(c),c.markAutoImportProviderAsDirty()}else{if(c.initialLoadPending)return void(null==(a=null==(o=this.configFileExistenceInfoCache.get(i))?void 0:o.openFilesImpactedByConfigFile)||a.forEach(e=>{var t;(null==(t=this.pendingOpenFileProjectUpdates)?void 0:t.has(e))||(this.pendingOpenFileProjectUpdates??(this.pendingOpenFileProjectUpdates=new Map)).set(e,this.configFileForOpenFiles.get(e))}));const t=this.toPath(e);c.resolutionCache.removeResolutionsFromProjectReferenceRedirects(t),this.delayUpdateProjectGraph(c),this.getHostPreferences().includeCompletionsForModuleExports&&x(null==(s=c.getCurrentProgram())?void 0:s.getResolvedProjectReferences(),e=>(null==e?void 0:e.sourceFile.path)===t)&&c.markAutoImportProviderAsDirty()}}),r}onConfigFileChanged(e,t,n){const r=this.configFileExistenceInfoCache.get(t),i=this.getConfiguredProjectByCanonicalConfigFilePath(t),o=null==i?void 0:i.deferredClose;2===n?(r.exists=!1,i&&(i.deferredClose=!0)):(r.exists=!0,o&&(i.deferredClose=void 0,i.markAsDirty())),this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(t,"Change in config file detected"),this.openFiles.forEach((e,t)=>{var n,i;const o=this.configFileForOpenFiles.get(t);if(!(null==(n=r.openFilesImpactedByConfigFile)?void 0:n.has(t)))return;this.configFileForOpenFiles.delete(t);const a=this.getScriptInfoForPath(t);this.getConfigFileNameForFile(a,!1)&&((null==(i=this.pendingOpenFileProjectUpdates)?void 0:i.has(t))||(this.pendingOpenFileProjectUpdates??(this.pendingOpenFileProjectUpdates=new Map)).set(t,o))}),this.delayEnsureProjectForOpenFiles()}removeProject(e){switch(this.logger.info("`remove Project::"),e.print(!0,!0,!1),e.close(),pn.shouldAssert(1)&&this.filenameToScriptInfo.forEach(t=>pn.assert(!t.isAttached(e),"Found script Info still attached to project",()=>`${e.projectName}: ScriptInfos still attached: ${JSON.stringify(je(z(this.filenameToScriptInfo.values(),t=>t.isAttached(e)?{fileName:t.fileName,projects:t.containingProjects.map(e=>e.projectName),hasMixedContent:t.hasMixedContent}:void 0)),void 0," ")}`)),this.pendingProjectUpdates.delete(e.getProjectName()),e.projectKind){case 2:$t(this.externalProjects,e),this.projectToSizeMap.delete(e.getProjectName());break;case 1:this.configuredProjects.delete(e.canonicalConfigFilePath),this.projectToSizeMap.delete(e.canonicalConfigFilePath);break;case 0:$t(this.inferredProjects,e)}}assignOrphanScriptInfoToInferredProject(e,t){pn.assert(e.isOrphan());const n=this.getOrCreateInferredProjectForProjectRootPathIfEnabled(e,t)||this.getOrCreateSingleInferredProjectIfEnabled()||this.getOrCreateSingleInferredWithoutProjectRoot(e.isDynamic?t||this.currentDirectory:Ao(bo(e.fileName)?e.fileName:Uo(e.fileName,t?this.getNormalizedAbsolutePath(t):this.currentDirectory)));if(n.addRoot(e),e.containingProjects[0]!==n&&(Ut(e.containingProjects,n),e.containingProjects.unshift(n)),n.updateGraph(),!this.useSingleInferredProject&&!n.projectRootPath)for(const e of this.inferredProjects){if(e===n||e.isOrphan())continue;const t=e.getRootScriptInfos();pn.assert(1===t.length||!!e.projectRootPath),1===t.length&&p(t[0].containingProjects,e=>e!==t[0].containingProjects[0]&&!e.isOrphan())&&e.removeFile(t[0],!0,!0)}return n}assignOrphanScriptInfosToInferredProject(){this.openFiles.forEach((e,t)=>{const n=this.getScriptInfoForPath(t);n.isOrphan()&&this.assignOrphanScriptInfoToInferredProject(n,e)})}closeOpenFile(e,t){var n;const r=!e.isDynamic&&this.host.fileExists(e.fileName);e.close(r),this.stopWatchingConfigFilesForScriptInfo(e);const i=this.toCanonicalFileName(e.fileName);this.openFilesWithNonRootedDiskPath.get(i)===e&&this.openFilesWithNonRootedDiskPath.delete(i);let o=!1;for(const t of e.containingProjects){if(Gme(t)){e.hasMixedContent&&e.registerFileUpdate();const n=t.openFileWatchTriggered.get(e.path);void 0!==n&&(t.openFileWatchTriggered.delete(e.path),t.pendingUpdateLevelthis.onConfigFileChanged(e,t,r),2e3,this.getWatchOptionsFromProjectWatchOptions(null==(i=null==(r=null==o?void 0:o.config)?void 0:r.parsedCommandLine)?void 0:i.watchOptions,Ao(e)),z$.ConfigFile,n)),this.ensureConfigFileWatcherForProject(o,n)}ensureConfigFileWatcherForProject(e,t){const n=e.config.projects;n.set(t.canonicalConfigFilePath,n.get(t.canonicalConfigFilePath)||!1)}releaseParsedConfig(e,t){var n,r,i;const o=this.configFileExistenceInfoCache.get(e);(null==(n=o.config)?void 0:n.projects.delete(t.canonicalConfigFilePath))&&((null==(r=o.config)?void 0:r.projects.size)||(o.config=void 0,JU(e,this.sharedExtendedConfigFileWatchers),pn.checkDefined(o.watcher),(null==(i=o.openFilesImpactedByConfigFile)?void 0:i.size)?o.inferredProjectRoots?r$(Ao(e))||(o.watcher.close(),o.watcher=Fge):(o.watcher.close(),o.watcher=void 0):(o.watcher.close(),this.configFileExistenceInfoCache.delete(e))))}stopWatchingConfigFilesForScriptInfo(e){if(0!==this.serverMode)return;const t=this.rootOfInferredProjects.delete(e),n=e.isScriptOpen();n&&!t||this.forEachConfigFileLocation(e,r=>{var i,o,a;const s=this.configFileExistenceInfoCache.get(r);if(s){if(n){if(!(null==(i=null==s?void 0:s.openFilesImpactedByConfigFile)?void 0:i.has(e.path)))return}else if(!(null==(o=s.openFilesImpactedByConfigFile)?void 0:o.delete(e.path)))return;t&&(s.inferredProjectRoots--,!s.watcher||s.config||s.inferredProjectRoots||(s.watcher.close(),s.watcher=void 0)),(null==(a=s.openFilesImpactedByConfigFile)?void 0:a.size)||s.config||(pn.assert(!s.watcher),this.configFileExistenceInfoCache.delete(r))}})}startWatchingConfigFilesForInferredProjectRoot(e){0===this.serverMode&&(pn.assert(e.isScriptOpen()),this.rootOfInferredProjects.add(e),this.forEachConfigFileLocation(e,(t,n)=>{let r=this.configFileExistenceInfoCache.get(t);r?r.inferredProjectRoots=(r.inferredProjectRoots??0)+1:(r={exists:this.host.fileExists(n),inferredProjectRoots:1},this.configFileExistenceInfoCache.set(t,r)),(r.openFilesImpactedByConfigFile??(r.openFilesImpactedByConfigFile=new Set)).add(e.path),r.watcher||(r.watcher=r$(Ao(t))?this.watchFactory.watchFile(n,(e,r)=>this.onConfigFileChanged(n,t,r),2e3,this.hostConfiguration.watchOptions,z$.ConfigFileForInferredRoot):Fge)}))}forEachConfigFileLocation(e,t){if(0!==this.serverMode)return;pn.assert(!Pge(e)||this.openFiles.has(e.path));const n=this.openFiles.get(e.path);if(pn.checkDefined(this.getScriptInfo(e.path)).isDynamic)return;let r=Ao(e.fileName);const i=()=>ia(n,r,this.currentDirectory,!this.host.useCaseSensitiveFileNames),o=!n||!i();let a=!0,s=!0;Age(e)&&(a=!Bt(e.fileName,"tsconfig.json")&&(s=!1));do{const e=sme(r,this.currentDirectory,this.toCanonicalFileName);if(a){const n=cme(Jo(r,"tsconfig.json"));if(t(Jo(e,"tsconfig.json"),n))return n}if(s){const n=cme(Jo(r,"jsconfig.json"));if(t(Jo(e,"jsconfig.json"),n))return n}if(da(e))break;const n=cme(Ao(r));if(n===r)break;r=n,a=s=!0}while(o||i())}findDefaultConfiguredProject(e){var t;return null==(t=this.findDefaultConfiguredProjectWorker(e,1))?void 0:t.defaultProject}findDefaultConfiguredProjectWorker(e,t){return e.isScriptOpen()?this.tryFindDefaultConfiguredProjectForOpenScriptInfo(e,t):void 0}getConfigFileNameForFileFromCache(e,t){if(t){const t=Ege(e,this.pendingOpenFileProjectUpdates);if(void 0!==t)return t}return Ege(e,this.configFileForOpenFiles)}setConfigFileNameForFileInCache(e,t){if(!this.openFiles.has(e.path))return;const n=t||!1;if(Age(e)){let t=this.configFileForOpenFiles.get(e.path);t&&!tt(t)||this.configFileForOpenFiles.set(e.path,t=(new Map).set(!1,t)),t.set(e.fileName,n)}else this.configFileForOpenFiles.set(e.path,n)}getConfigFileNameForFile(e,t){const n=this.getConfigFileNameForFileFromCache(e,t);if(void 0!==n)return n||void 0;if(t)return;const r=this.forEachConfigFileLocation(e,(t,n)=>this.configFileExists(n,t,e));return this.logger.info(`getConfigFileNameForFile:: File: ${e.fileName} ProjectRootPath: ${this.openFiles.get(e.path)}:: Result: ${r}`),this.setConfigFileNameForFileInCache(e,r),r}printProjects(){this.logger.hasLevel(1)&&(this.logger.startGroup(),this.externalProjects.forEach(nhe),this.configuredProjects.forEach(nhe),this.inferredProjects.forEach(nhe),this.logger.info("Open files: "),this.openFiles.forEach((e,t)=>{const n=this.getScriptInfoForPath(t);this.logger.info(`\tFileName: ${n.fileName} ProjectRootPath: ${e}`),this.logger.info(`\t\tProjects: ${n.containingProjects.map(e=>e.getProjectName())}`)}),this.logger.endGroup())}findConfiguredProjectByProjectName(e,t){const n=this.toCanonicalFileName(e),r=this.getConfiguredProjectByCanonicalConfigFilePath(n);return t?r:(null==r?void 0:r.deferredClose)?void 0:r}getConfiguredProjectByCanonicalConfigFilePath(e){return this.configuredProjects.get(e)}findExternalProjectByProjectName(e){return Nge(e,this.externalProjects)}getFilenameForExceededTotalSizeLimitForNonTsFiles(e,t,n,r){if(t&&t.disableSizeLimit||!this.host.getFileSize)return;let i=Zme;this.projectToSizeMap.set(e,0),this.projectToSizeMap.forEach(e=>i-=e||0);let o=0;for(const e of n){const t=r.getFileName(e);if(!JS(t)&&(o+=this.host.getFileSize(t),o>Zme||o>i)){const e=n.map(e=>r.getFileName(e)).filter(e=>!JS(e)).map(e=>({name:e,size:this.host.getFileSize(e)})).sort((e,t)=>t.size-e.size).slice(0,5);return this.logger.info(`Non TS file size exceeded limit (${o}). Largest files: ${e.map(e=>`${e.name}:${e.size}`).join(", ")}`),t}}this.projectToSizeMap.set(e,o)}createExternalProject(e,t,n,r,i){const o=vge(n),a=bge(n,Ao(Ro(e))),s=new Hme(e,this,o,this.getFilenameForExceededTotalSizeLimitForNonTsFiles(e,o,t,wge),void 0===n.compileOnSave||n.compileOnSave,void 0,null==a?void 0:a.watchOptions);return s.setProjectErrors(null==a?void 0:a.errors),s.excludedFiles=i,this.addFilesToNonInferredProject(s,t,wge,r),this.externalProjects.push(s),s}sendProjectTelemetry(e){if(this.seenProjects.has(e.projectName))return void Kge(e);if(this.seenProjects.set(e.projectName,!0),!this.eventHandler||!this.host.createSHA256Hash)return void Kge(e);const t=Gme(e)?e.projectOptions:void 0;Kge(e);const n={projectId:this.host.createSHA256Hash(e.projectName),fileStats:Lme(e.getScriptInfos(),!0),compilerOptions:nM(e.getCompilationSettings()),typeAcquisition:function({enable:e,include:t,exclude:n}){return{enable:e,include:void 0!==t&&0!==t.length,exclude:void 0!==n&&0!==n.length}}(e.getTypeAcquisition()),extends:t&&t.configHasExtendsProperty,files:t&&t.configHasFilesProperty,include:t&&t.configHasIncludeProperty,exclude:t&&t.configHasExcludeProperty,compileOnSave:e.compileOnSaveEnabled,configFileName:function(){if(!Gme(e))return"other";return hme(e.getConfigFilePath())||"other"}(),projectType:e instanceof Hme?"external":"configured",languageServiceEnabled:e.languageServiceEnabled,version:c};this.eventHandler({eventName:sge,data:n})}addFilesToNonInferredProject(e,t,n,r){this.updateNonInferredProjectFiles(e,t,n),e.setTypeAcquisition(r),e.markAsDirty()}createConfiguredProject(e,t){var n;null==(n=Gn)||n.instant(Gn.Phase.Session,"createConfiguredProject",{configFilePath:e});const r=this.toCanonicalFileName(e);let i=this.configFileExistenceInfoCache.get(r);i?i.exists=!0:this.configFileExistenceInfoCache.set(r,i={exists:!0}),i.config||(i.config={cachedDirectoryStructureHost:MU(this.host,this.host.getCurrentDirectory(),this.host.useCaseSensitiveFileNames),projects:new Map,updateLevel:2});const o=new $me(e,r,this,i.config.cachedDirectoryStructureHost,t);return pn.assert(!this.configuredProjects.has(r)),this.configuredProjects.set(r,o),this.createConfigFileWatcherForParsedConfig(e,r,o),o}loadConfiguredProject(e,t){var n,r;null==(n=Gn)||n.push(Gn.Phase.Session,"loadConfiguredProject",{configFilePath:e.canonicalConfigFilePath}),this.sendProjectLoadingStartEvent(e,t);const i=ame(e.getConfigFilePath()),o=this.ensureParsedConfigUptoDate(i,e.canonicalConfigFilePath,this.configFileExistenceInfoCache.get(e.canonicalConfigFilePath),e),a=o.config.parsedCommandLine;pn.assert(!!a.fileNames);const s=a.options;e.projectOptions||(e.projectOptions={configHasExtendsProperty:void 0!==a.raw.extends,configHasFilesProperty:void 0!==a.raw.files,configHasIncludeProperty:void 0!==a.raw.include,configHasExcludeProperty:void 0!==a.raw.exclude}),e.parsedCommandLine=a,e.setProjectErrors(a.options.configFile.parseDiagnostics),e.updateReferences(a.projectReferences);const c=this.getFilenameForExceededTotalSizeLimitForNonTsFiles(e.canonicalConfigFilePath,s,a.fileNames,Cge);c?(e.disableLanguageService(c),this.configFileExistenceInfoCache.forEach((t,n)=>this.stopWatchingWildCards(n,e))):(e.setCompilerOptions(s),e.setWatchOptions(a.watchOptions),e.enableLanguageService(),this.watchWildcards(i,o,e)),e.enablePluginsWithOptions(s);const l=a.fileNames.concat(e.getExternalFiles(2));this.updateRootAndOptionsOfNonInferredProject(e,l,Cge,s,a.typeAcquisition,a.compileOnSave,a.watchOptions),null==(r=Gn)||r.pop()}ensureParsedConfigUptoDate(e,t,n,r){var i,o,a;if(n.config&&(1===n.config.updateLevel&&this.reloadFileNamesOfParsedConfig(e,n.config),!n.config.updateLevel))return this.ensureConfigFileWatcherForProject(n,r),n;if(!n.exists&&n.config)return n.config.updateLevel=void 0,this.ensureConfigFileWatcherForProject(n,r),n;const s=(null==(i=n.config)?void 0:i.cachedDirectoryStructureHost)||MU(this.host,this.host.getCurrentDirectory(),this.host.useCaseSensitiveFileNames),c=DL(e,e=>this.host.readFile(e)),l=_O(e,tt(c)?c:""),_=l.parseDiagnostics;tt(c)||_.push(c);const u=Ao(e),d=cj(l,s,u,void 0,e,void 0,this.hostConfiguration.extraFileExtensions,this.extendedConfigCache);d.errors.length&&_.push(...d.errors),this.logger.info(`Config: ${e} : ${JSON.stringify({rootNames:d.fileNames,options:d.options,watchOptions:d.watchOptions,projectReferences:d.projectReferences},void 0," ")}`);const p=null==(o=n.config)?void 0:o.parsedCommandLine;return n.config?(n.config.parsedCommandLine=d,n.config.watchedDirectoriesStale=!0,n.config.updateLevel=void 0):n.config={parsedCommandLine:d,cachedDirectoryStructureHost:s,projects:new Map},p||vT(this.getWatchOptionsFromProjectWatchOptions(void 0,u),this.getWatchOptionsFromProjectWatchOptions(d.watchOptions,u))||(null==(a=n.watcher)||a.close(),n.watcher=void 0),this.createConfigFileWatcherForParsedConfig(e,t,r),BU(t,d.options,this.sharedExtendedConfigFileWatchers,(t,n)=>this.watchFactory.watchFile(t,()=>{var e;zU(this.extendedConfigCache,n,e=>this.toPath(e));let r=!1;null==(e=this.sharedExtendedConfigFileWatchers.get(n))||e.projects.forEach(e=>{r=this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(e,`Change in extended config file ${t} detected`)||r}),r&&this.delayEnsureProjectForOpenFiles()},2e3,this.hostConfiguration.watchOptions,z$.ExtendedConfigFile,e),e=>this.toPath(e)),n}watchWildcards(e,{exists:t,config:n},r){if(n.projects.set(r.canonicalConfigFilePath,!0),t){if(n.watchedDirectories&&!n.watchedDirectoriesStale)return;n.watchedDirectoriesStale=!1,UU(n.watchedDirectories||(n.watchedDirectories=new Map),n.parsedCommandLine.wildcardDirectories,(t,r)=>this.watchWildcardDirectory(t,r,e,n))}else{if(n.watchedDirectoriesStale=!1,!n.watchedDirectories)return;gx(n.watchedDirectories,GU),n.watchedDirectories=void 0}}stopWatchingWildCards(e,t){const n=this.configFileExistenceInfoCache.get(e);n.config&&n.config.projects.get(t.canonicalConfigFilePath)&&(n.config.projects.set(t.canonicalConfigFilePath,!1),sd(n.config.projects,lt)||(n.config.watchedDirectories&&(gx(n.config.watchedDirectories,GU),n.config.watchedDirectories=void 0),n.config.watchedDirectoriesStale=void 0))}updateNonInferredProjectFiles(e,t,n){var r;const i=e.getRootFilesMap(),o=new Map;for(const a of t){const t=n.getFileName(a),s=ame(t);let c;if(Eme(s)||e.fileExists(t)){const t=n.getScriptKind(a,this.hostConfiguration.extraFileExtensions),r=n.hasMixedContent(a,this.hostConfiguration.extraFileExtensions),o=pn.checkDefined(this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(s,e.currentDirectory,t,r,e.directoryStructureHost,!1));c=o.path;const l=i.get(c);l&&l.info===o?l.fileName=s:(e.addRoot(o,s),o.isScriptOpen()&&this.removeRootOfInferredProjectIfNowPartOfOtherProject(o))}else{c=sme(s,this.currentDirectory,this.toCanonicalFileName);const t=i.get(c);t?((null==(r=t.info)?void 0:r.path)===c&&(e.removeFile(t.info,!1,!0),t.info=void 0),t.fileName=s):i.set(c,{fileName:s})}o.set(c,!0)}i.size>o.size&&i.forEach((t,n)=>{o.has(n)||(t.info?e.removeFile(t.info,e.fileExists(t.info.fileName),!0):i.delete(n))})}updateRootAndOptionsOfNonInferredProject(e,t,n,r,i,o,a){e.setCompilerOptions(r),e.setWatchOptions(a),void 0!==o&&(e.compileOnSaveEnabled=o),this.addFilesToNonInferredProject(e,t,n,i)}reloadFileNamesOfConfiguredProject(e){const t=this.reloadFileNamesOfParsedConfig(e.getConfigFilePath(),this.configFileExistenceInfoCache.get(e.canonicalConfigFilePath).config);return e.updateErrorOnNoInputFiles(t),this.updateNonInferredProjectFiles(e,t.fileNames.concat(e.getExternalFiles(1)),Cge),e.markAsDirty(),e.updateGraph()}reloadFileNamesOfParsedConfig(e,t){if(void 0===t.updateLevel)return t.parsedCommandLine;pn.assert(1===t.updateLevel);const n=Vj(t.parsedCommandLine.options.configFile.configFileSpecs,Ao(e),t.parsedCommandLine.options,t.cachedDirectoryStructureHost,this.hostConfiguration.extraFileExtensions);return t.parsedCommandLine={...t.parsedCommandLine,fileNames:n},t.updateLevel=void 0,t.parsedCommandLine}setFileNamesOfAutoImportProviderOrAuxillaryProject(e,t){this.updateNonInferredProjectFiles(e,t,Cge)}reloadConfiguredProjectOptimized(e,t,n){n.has(e)||(n.set(e,6),e.initialLoadPending||this.setProjectForReload(e,2,t))}reloadConfiguredProjectClearingSemanticCache(e,t,n){return 7!==n.get(e)&&(n.set(e,7),this.clearSemanticCache(e),this.reloadConfiguredProject(e,Hge(t)),!0)}setProjectForReload(e,t,n){2===t&&this.clearSemanticCache(e),e.pendingUpdateReason=n&&Hge(n),e.pendingUpdateLevel=t}reloadConfiguredProject(e,t){e.initialLoadPending=!1,this.setProjectForReload(e,0),this.loadConfiguredProject(e,t),Vge(e,e.triggerFileForConfigFileDiag??e.getConfigFilePath(),!0)}clearSemanticCache(e){e.originalConfiguredProjects=void 0,e.resolutionCache.clear(),e.getLanguageService(!1).cleanupSemanticCache(),e.cleanupProgram(),e.markAsDirty()}sendConfigFileDiagEvent(e,t,n){if(!this.eventHandler||this.suppressDiagnosticEvents)return!1;const r=e.getLanguageService().getCompilerOptionsDiagnostics();return r.push(...e.getAllProjectErrors()),!(!n&&r.length===(e.configDiagDiagnosticsReported??0))&&(e.configDiagDiagnosticsReported=r.length,this.eventHandler({eventName:oge,data:{configFileName:e.getConfigFilePath(),diagnostics:r,triggerFile:t??e.getConfigFilePath()}}),!0)}getOrCreateInferredProjectForProjectRootPathIfEnabled(e,t){if(!this.useInferredProjectPerProjectRoot||e.isDynamic&&void 0===t)return;if(t){const e=this.toCanonicalFileName(t);for(const t of this.inferredProjects)if(t.projectRootPath===e)return t;return this.createInferredProject(t,!1,t)}let n;for(const t of this.inferredProjects)t.projectRootPath&&ia(t.projectRootPath,e.path,this.host.getCurrentDirectory(),!this.host.useCaseSensitiveFileNames)&&(n&&n.projectRootPath.length>t.projectRootPath.length||(n=t));return n}getOrCreateSingleInferredProjectIfEnabled(){if(this.useSingleInferredProject)return this.inferredProjects.length>0&&void 0===this.inferredProjects[0].projectRootPath?this.inferredProjects[0]:this.createInferredProject(this.currentDirectory,!0,void 0)}getOrCreateSingleInferredWithoutProjectRoot(e){pn.assert(!this.useSingleInferredProject);const t=this.toCanonicalFileName(this.getNormalizedAbsolutePath(e));for(const e of this.inferredProjects)if(!e.projectRootPath&&e.isOrphan()&&e.canonicalCurrentDirectory===t)return e;return this.createInferredProject(e,!1,void 0)}createInferredProject(e,t,n){const r=n&&this.compilerOptionsForInferredProjectsPerProjectRoot.get(n)||this.compilerOptionsForInferredProjects;let i,o;n&&(i=this.watchOptionsForInferredProjectsPerProjectRoot.get(n),o=this.typeAcquisitionForInferredProjectsPerProjectRoot.get(n)),void 0===i&&(i=this.watchOptionsForInferredProjects),void 0===o&&(o=this.typeAcquisitionForInferredProjects),i=i||void 0;const a=new qme(this,r,null==i?void 0:i.watchOptions,n,e,o);return a.setProjectErrors(null==i?void 0:i.errors),t?this.inferredProjects.unshift(a):this.inferredProjects.push(a),a}getOrCreateScriptInfoNotOpenedByClient(e,t,n,r){return this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(ame(e),t,void 0,void 0,n,r)}getScriptInfo(e){return this.getScriptInfoForNormalizedPath(ame(e))}getScriptInfoOrConfig(e){const t=ame(e),n=this.getScriptInfoForNormalizedPath(t);if(n)return n;const r=this.configuredProjects.get(this.toPath(e));return r&&r.getCompilerOptions().configFile}logErrorForScriptInfoNotFound(e){const t=je(z(this.filenameToScriptInfo.entries(),e=>e[1].deferredDelete?void 0:e),([e,t])=>({path:e,fileName:t.fileName}));this.logger.msg(`Could not find file ${JSON.stringify(e)}.\nAll files are: ${JSON.stringify(t)}`,"Err")}getSymlinkedProjects(e){let t;if(this.realpathToScriptInfos){const t=e.getRealpathIfDifferent();t&&p(this.realpathToScriptInfos.get(t),n),p(this.realpathToScriptInfos.get(e.path),n)}return t;function n(n){if(n!==e)for(const r of n.containingProjects)!r.languageServiceEnabled||r.isOrphan()||r.getCompilerOptions().preserveSymlinks||e.isAttached(r)||(t?sd(t,(e,t)=>t!==n.path&&C(e,r))||t.add(n.path,r):(t=Ke(),t.add(n.path,r)))}}watchClosedScriptInfo(e){if(pn.assert(!e.fileWatcher),!(e.isDynamicOrHasMixedContent()||this.globalCacheLocationDirectoryPath&&Qt(e.path,this.globalCacheLocationDirectoryPath))){const t=e.fileName.indexOf("/node_modules/");this.host.getModifiedTime&&-1!==t?(e.mTime=this.getModifiedTime(e),e.fileWatcher=this.watchClosedScriptInfoInNodeModules(e.fileName.substring(0,t))):e.fileWatcher=this.watchFactory.watchFile(e.fileName,(t,n)=>this.onSourceFileChanged(e,n),500,this.hostConfiguration.watchOptions,z$.ClosedScriptInfo)}}createNodeModulesWatcher(e,t){let n=this.watchFactory.watchDirectory(e,e=>{var n;const i=e$(this.toPath(e));if(!i)return;const o=Io(i);if(!(null==(n=r.affectedModuleSpecifierCacheProjects)?void 0:n.size)||"package.json"!==o&&"node_modules"!==o||r.affectedModuleSpecifierCacheProjects.forEach(e=>{var t;null==(t=e.getModuleSpecifierCache())||t.clear()}),r.refreshScriptInfoRefCount)if(t===i)this.refreshScriptInfosInDirectory(t);else{const e=this.filenameToScriptInfo.get(i);e?qge(e)&&this.refreshScriptInfo(e):Co(i)||this.refreshScriptInfosInDirectory(i)}},1,this.hostConfiguration.watchOptions,z$.NodeModules);const r={refreshScriptInfoRefCount:0,affectedModuleSpecifierCacheProjects:void 0,close:()=>{var e;!n||r.refreshScriptInfoRefCount||(null==(e=r.affectedModuleSpecifierCacheProjects)?void 0:e.size)||(n.close(),n=void 0,this.nodeModulesWatchers.delete(t))}};return this.nodeModulesWatchers.set(t,r),r}watchPackageJsonsInNodeModules(e,t){var n;const r=this.toPath(e),i=this.nodeModulesWatchers.get(r)||this.createNodeModulesWatcher(e,r);return pn.assert(!(null==(n=i.affectedModuleSpecifierCacheProjects)?void 0:n.has(t))),(i.affectedModuleSpecifierCacheProjects||(i.affectedModuleSpecifierCacheProjects=new Set)).add(t),{close:()=>{var e;null==(e=i.affectedModuleSpecifierCacheProjects)||e.delete(t),i.close()}}}watchClosedScriptInfoInNodeModules(e){const t=e+"/node_modules",n=this.toPath(t),r=this.nodeModulesWatchers.get(n)||this.createNodeModulesWatcher(t,n);return r.refreshScriptInfoRefCount++,{close:()=>{r.refreshScriptInfoRefCount--,r.close()}}}getModifiedTime(e){return(this.host.getModifiedTime(e.fileName)||Ui).getTime()}refreshScriptInfo(e){const t=this.getModifiedTime(e);if(t!==e.mTime){const n=eo(e.mTime,t);e.mTime=t,this.onSourceFileChanged(e,n)}}refreshScriptInfosInDirectory(e){e+=fo,this.filenameToScriptInfo.forEach(t=>{qge(t)&&Qt(t.path,e)&&this.refreshScriptInfo(t)})}stopWatchingScriptInfo(e){e.fileWatcher&&(e.fileWatcher.close(),e.fileWatcher=void 0)}getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(e,t,n,r,i,o){if(bo(e)||Eme(e))return this.getOrCreateScriptInfoWorker(e,t,!1,void 0,n,!!r,i,o);const a=this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(e));return a||void 0}getOrCreateScriptInfoForNormalizedPath(e,t,n,r,i,o){return this.getOrCreateScriptInfoWorker(e,this.currentDirectory,t,n,r,!!i,o,!1)}getOrCreateScriptInfoWorker(e,t,n,r,i,o,a,s){pn.assert(void 0===r||n,"ScriptInfo needs to be opened by client to be able to set its user defined content");const c=sme(e,t,this.toCanonicalFileName);let l=this.filenameToScriptInfo.get(c);if(l){if(l.deferredDelete){if(pn.assert(!l.isDynamic),!n&&!(a||this.host).fileExists(e))return s?l:void 0;l.deferredDelete=void 0}}else{const r=Eme(e);if(pn.assert(bo(e)||r||n,"",()=>`${JSON.stringify({fileName:e,currentDirectory:t,hostCurrentDirectory:this.currentDirectory,openKeys:je(this.openFilesWithNonRootedDiskPath.keys())})}\nScript info with non-dynamic relative file name can only be open script info or in context of host currentDirectory`),pn.assert(!bo(e)||this.currentDirectory===t||!this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(e)),"",()=>`${JSON.stringify({fileName:e,currentDirectory:t,hostCurrentDirectory:this.currentDirectory,openKeys:je(this.openFilesWithNonRootedDiskPath.keys())})}\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names`),pn.assert(!r||this.currentDirectory===t||this.useInferredProjectPerProjectRoot,"",()=>`${JSON.stringify({fileName:e,currentDirectory:t,hostCurrentDirectory:this.currentDirectory,openKeys:je(this.openFilesWithNonRootedDiskPath.keys())})}\nDynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath.`),!n&&!r&&!(a||this.host).fileExists(e))return;l=new Pme(this.host,e,i,o,c,this.filenameToScriptInfoVersion.get(c)),this.filenameToScriptInfo.set(l.path,l),this.filenameToScriptInfoVersion.delete(l.path),n?bo(e)||r&&this.currentDirectory===t||this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(e),l):this.watchClosedScriptInfo(l)}return n&&(this.stopWatchingScriptInfo(l),l.open(r),o&&l.registerFileUpdate()),l}getScriptInfoForNormalizedPath(e){return!bo(e)&&this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(e))||this.getScriptInfoForPath(sme(e,this.currentDirectory,this.toCanonicalFileName))}getScriptInfoForPath(e){const t=this.filenameToScriptInfo.get(e);return t&&t.deferredDelete?void 0:t}getDocumentPositionMapper(e,t,n){const r=this.getOrCreateScriptInfoNotOpenedByClient(t,e.currentDirectory,this.host,!1);if(!r)return void(n&&e.addGeneratedFileWatch(t,n));if(r.getSnapshot(),tt(r.sourceMapFilePath)){const t=this.getScriptInfoForPath(r.sourceMapFilePath);if(t&&(t.getSnapshot(),void 0!==t.documentPositionMapper))return t.sourceInfos=this.addSourceInfoToSourceMap(n,e,t.sourceInfos),t.documentPositionMapper?t.documentPositionMapper:void 0;r.sourceMapFilePath=void 0}else{if(r.sourceMapFilePath)return void(r.sourceMapFilePath.sourceInfos=this.addSourceInfoToSourceMap(n,e,r.sourceMapFilePath.sourceInfos));if(void 0!==r.sourceMapFilePath)return}let i,o=(t,n)=>{const r=this.getOrCreateScriptInfoNotOpenedByClient(t,e.currentDirectory,this.host,!0);if(i=r||n,!r||r.deferredDelete)return;const o=r.getSnapshot();return void 0!==r.documentPositionMapper?r.documentPositionMapper:rY(o)};const a=e.projectName,s=M1({getCanonicalFileName:this.toCanonicalFileName,log:e=>this.logger.info(e),getSourceFileLike:e=>this.getSourceFileLike(e,a,r)},r.fileName,r.textStorage.getLineInfo(),o);return o=void 0,i?tt(i)?r.sourceMapFilePath={watcher:this.addMissingSourceMapFile(e.currentDirectory===this.currentDirectory?i:Uo(i,e.currentDirectory),r.path),sourceInfos:this.addSourceInfoToSourceMap(n,e)}:(r.sourceMapFilePath=i.path,i.declarationInfoPath=r.path,i.deferredDelete||(i.documentPositionMapper=s||!1),i.sourceInfos=this.addSourceInfoToSourceMap(n,e,i.sourceInfos)):r.sourceMapFilePath=!1,s}addSourceInfoToSourceMap(e,t,n){if(e){const r=this.getOrCreateScriptInfoNotOpenedByClient(e,t.currentDirectory,t.directoryStructureHost,!1);(n||(n=new Set)).add(r.path)}return n}addMissingSourceMapFile(e,t){return this.watchFactory.watchFile(e,()=>{const e=this.getScriptInfoForPath(t);e&&e.sourceMapFilePath&&!tt(e.sourceMapFilePath)&&(this.delayUpdateProjectGraphs(e.containingProjects,!0),this.delayUpdateSourceInfoProjects(e.sourceMapFilePath.sourceInfos),e.closeSourceMapFileWatcher())},2e3,this.hostConfiguration.watchOptions,z$.MissingSourceMapFile)}getSourceFileLike(e,t,n){const r=t.projectName?t:this.findProject(t);if(r){const t=r.toPath(e),n=r.getSourceFile(t);if(n&&n.resolvedPath===t)return n}const i=this.getOrCreateScriptInfoNotOpenedByClient(e,(r||this).currentDirectory,r?r.directoryStructureHost:this.host,!1);if(i){if(n&&tt(n.sourceMapFilePath)&&i!==n){const e=this.getScriptInfoForPath(n.sourceMapFilePath);e&&(e.sourceInfos??(e.sourceInfos=new Set)).add(i.path)}return i.cacheSourceFile?i.cacheSourceFile.sourceFile:(i.sourceFileLike||(i.sourceFileLike={get text(){return pn.fail("shouldnt need text"),""},getLineAndCharacterOfPosition:e=>{const t=i.positionToLineOffset(e);return{line:t.line-1,character:t.offset-1}},getPositionOfLineAndCharacter:(e,t,n)=>i.lineOffsetToPosition(e+1,t+1,n)}),i.sourceFileLike)}}setPerformanceEventHandler(e){this.performanceEventHandler=e}setHostConfiguration(e){var t;if(e.file){const t=this.getScriptInfoForNormalizedPath(ame(e.file));t&&(t.setOptions(yge(e.formatOptions),e.preferences),this.logger.info(`Host configuration update for file ${e.file}`))}else{if(void 0!==e.hostInfo&&(this.hostConfiguration.hostInfo=e.hostInfo,this.logger.info(`Host information ${e.hostInfo}`)),e.formatOptions&&(this.hostConfiguration.formatCodeOptions={...this.hostConfiguration.formatCodeOptions,...yge(e.formatOptions)},this.logger.info("Format host information updated")),e.preferences){const{lazyConfiguredProjectsFromExternalProject:t,includePackageJsonAutoImports:n,includeCompletionsForModuleExports:r}=this.hostConfiguration.preferences;this.hostConfiguration.preferences={...this.hostConfiguration.preferences,...e.preferences},t&&!this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject&&this.externalProjectToConfiguredProjectMap.forEach(e=>e.forEach(e=>{e.deferredClose||e.isClosed()||2!==e.pendingUpdateLevel||this.hasPendingProjectUpdate(e)||e.updateGraph()})),n===e.preferences.includePackageJsonAutoImports&&!!r==!!e.preferences.includeCompletionsForModuleExports||this.forEachProject(e=>{e.onAutoImportProviderSettingsChanged()})}if(e.extraFileExtensions&&(this.hostConfiguration.extraFileExtensions=e.extraFileExtensions,this.reloadProjects(),this.logger.info("Host file extension mappings updated")),e.watchOptions){const n=null==(t=bge(e.watchOptions))?void 0:t.watchOptions,r=fj(n,this.currentDirectory);this.hostConfiguration.watchOptions=r,this.hostConfiguration.beforeSubstitution=r===n?void 0:n,this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`)}}}getWatchOptions(e){return this.getWatchOptionsFromProjectWatchOptions(e.getWatchOptions(),e.getCurrentDirectory())}getWatchOptionsFromProjectWatchOptions(e,t){const n=this.hostConfiguration.beforeSubstitution?fj(this.hostConfiguration.beforeSubstitution,t):this.hostConfiguration.watchOptions;return e&&n?{...n,...e}:e||n}closeLog(){this.logger.close()}sendSourceFileChange(e){this.filenameToScriptInfo.forEach(t=>{if(this.openFiles.has(t.path))return;if(!t.fileWatcher)return;const n=ft(()=>this.host.fileExists(t.fileName)?t.deferredDelete?0:1:2);if(e){if(qge(t)||!t.path.startsWith(e))return;if(2===n()&&t.deferredDelete)return;this.logger.info(`Invoking sourceFileChange on ${t.fileName}:: ${n()}`)}this.onSourceFileChanged(t,n())})}reloadProjects(){this.logger.info("reload projects."),this.sendSourceFileChange(void 0),this.pendingProjectUpdates.forEach((e,t)=>{this.throttledOperations.cancel(t),this.pendingProjectUpdates.delete(t)}),this.throttledOperations.cancel(dge),this.pendingOpenFileProjectUpdates=void 0,this.pendingEnsureProjectForOpenFiles=!1,this.configFileExistenceInfoCache.forEach(e=>{e.config&&(e.config.updateLevel=2,e.config.cachedDirectoryStructureHost.clearCache())}),this.configFileForOpenFiles.clear(),this.externalProjects.forEach(e=>{this.clearSemanticCache(e),e.updateGraph()});const e=new Map,t=new Set;this.externalProjectToConfiguredProjectMap.forEach((t,n)=>{const r=`Reloading configured project in external project: ${n}`;t.forEach(t=>{this.getHostPreferences().lazyConfiguredProjectsFromExternalProject?this.reloadConfiguredProjectOptimized(t,r,e):this.reloadConfiguredProjectClearingSemanticCache(t,r,e)})}),this.openFiles.forEach((n,r)=>{const i=this.getScriptInfoForPath(r);x(i.containingProjects,Xme)||this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(i,7,e,t)}),t.forEach(t=>e.set(t,7)),this.inferredProjects.forEach(e=>this.clearSemanticCache(e)),this.ensureProjectForOpenFiles(),this.cleanupProjectsAndScriptInfos(e,new Set(this.openFiles.keys()),new Set(this.externalProjectToConfiguredProjectMap.keys())),this.logger.info("After reloading projects.."),this.printProjects()}removeRootOfInferredProjectIfNowPartOfOtherProject(e){pn.assert(e.containingProjects.length>0);const t=e.containingProjects[0];!t.isOrphan()&&Kme(t)&&t.isRoot(e)&&p(e.containingProjects,e=>e!==t&&!e.isOrphan())&&t.removeFile(e,!0,!0)}ensureProjectForOpenFiles(){this.logger.info("Before ensureProjectForOpenFiles:"),this.printProjects();const e=this.pendingOpenFileProjectUpdates;this.pendingOpenFileProjectUpdates=void 0,null==e||e.forEach((e,t)=>this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(this.getScriptInfoForPath(t),5)),this.openFiles.forEach((e,t)=>{const n=this.getScriptInfoForPath(t);n.isOrphan()?this.assignOrphanScriptInfoToInferredProject(n,e):this.removeRootOfInferredProjectIfNowPartOfOtherProject(n)}),this.pendingEnsureProjectForOpenFiles=!1,this.inferredProjects.forEach(Uge),this.logger.info("After ensureProjectForOpenFiles:"),this.printProjects()}openClientFile(e,t,n,r){return this.openClientFileWithNormalizedPath(ame(e),t,n,!1,r?ame(r):void 0)}getOriginalLocationEnsuringConfiguredProject(e,t){const n=e.isSourceOfProjectReferenceRedirect(t.fileName),r=n?t:e.getSourceMapper().tryGetSourcePosition(t);if(!r)return;const{fileName:i}=r,o=this.getScriptInfo(i);if(!o&&!this.host.fileExists(i))return;const a={fileName:ame(i),path:this.toPath(i)},s=this.getConfigFileNameForFile(a,!1);if(!s)return;let c=this.findConfiguredProjectByProjectName(s);if(!c){if(e.getCompilerOptions().disableReferencedProjectLoad)return n?t:(null==o?void 0:o.containingProjects.length)?r:t;c=this.createConfiguredProject(s,`Creating project for original file: ${a.fileName}${t!==r?" for location: "+t.fileName:""}`)}const l=this.tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo(a,5,Mge(c,4),e=>`Creating project referenced in solution ${e.projectName} to find possible configured project for original file: ${a.fileName}${t!==r?" for location: "+t.fileName:""}`);if(!l.defaultProject)return;if(l.defaultProject===e)return r;u(l.defaultProject);const _=this.getScriptInfo(i);if(_&&_.containingProjects.length)return _.containingProjects.forEach(e=>{Gme(e)&&u(e)}),r;function u(t){(e.originalConfiguredProjects??(e.originalConfiguredProjects=new Set)).add(t.canonicalConfigFilePath)}}fileExists(e){return!!this.getScriptInfoForNormalizedPath(e)||this.host.fileExists(e)}findExternalProjectContainingOpenScriptInfo(e){return x(this.externalProjects,t=>(Uge(t),t.containsScriptInfo(e)))}getOrCreateOpenScriptInfo(e,t,n,r,i){const o=this.getOrCreateScriptInfoWorker(e,i?this.getNormalizedAbsolutePath(i):this.currentDirectory,!0,t,n,!!r,void 0,!0);return this.openFiles.set(o.path,i),o}assignProjectToOpenedScriptInfo(e){let t,n;let r,i;if(!this.findExternalProjectContainingOpenScriptInfo(e)&&0===this.serverMode){const o=this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(e,5);o&&(r=o.seenProjects,i=o.sentConfigDiag,o.defaultProject&&(t=o.defaultProject.getConfigFilePath(),n=o.defaultProject.getAllProjectErrors()))}return e.containingProjects.forEach(Uge),e.isOrphan()&&(null==r||r.forEach((t,n)=>{4===t||i.has(n)||this.sendConfigFileDiagEvent(n,e.fileName,!0)}),pn.assert(this.openFiles.has(e.path)),this.assignOrphanScriptInfoToInferredProject(e,this.openFiles.get(e.path))),pn.assert(!e.isOrphan()),{configFileName:t,configFileErrors:n,retainProjects:r}}findCreateOrReloadConfiguredProject(e,t,n,r,i,o,a,s,c){let l,_=c??this.findConfiguredProjectByProjectName(e,r),u=!1;switch(t){case 0:case 1:case 3:if(!_)return;break;case 2:if(!_)return;l=function(e){return $ge(e)?e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath):void 0}(_);break;case 4:case 5:_??(_=this.createConfiguredProject(e,n)),a||({sentConfigFileDiag:u,configFileExistenceInfo:l}=Mge(_,t,i));break;case 6:if(_??(_=this.createConfiguredProject(e,Hge(n))),_.projectService.reloadConfiguredProjectOptimized(_,n,o),l=Wge(_),l)break;case 7:_??(_=this.createConfiguredProject(e,Hge(n))),u=!s&&this.reloadConfiguredProjectClearingSemanticCache(_,n,o),!s||s.has(_)||o.has(_)||(this.setProjectForReload(_,2,n),s.add(_));break;default:pn.assertNever(t)}return{project:_,sentConfigFileDiag:u,configFileExistenceInfo:l,reason:n}}tryFindDefaultConfiguredProjectForOpenScriptInfo(e,t,n,r){const i=this.getConfigFileNameForFile(e,t<=3);if(!i)return;const o=Oge(t),a=this.findCreateOrReloadConfiguredProject(i,o,function(e){return`Creating possible configured project for ${e.fileName} to open`}(e),n,e.fileName,r);return a&&this.tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo(e,t,a,t=>`Creating project referenced in solution ${t.projectName} to find possible configured project for ${e.fileName} to open`,n,r)}isMatchedByConfig(e,t,n){if(t.fileNames.some(e=>this.toPath(e)===n.path))return!0;if(VS(n.fileName,t.options,this.hostConfiguration.extraFileExtensions))return!1;const{validatedFilesSpec:r,validatedIncludeSpecs:i,validatedExcludeSpecs:o}=t.options.configFile.configFileSpecs,a=ame(Uo(Ao(e),this.currentDirectory));return!!(null==r?void 0:r.some(e=>this.toPath(Uo(e,a))===n.path))||!!(null==i?void 0:i.length)&&(!Kj(n.fileName,o,this.host.useCaseSensitiveFileNames,this.currentDirectory,a)&&(null==i?void 0:i.some(e=>{const t=hS(e,a,"files");return!!t&&xS(`(${t})$`,this.host.useCaseSensitiveFileNames).test(n.fileName)})))}tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo(e,t,n,r,i,o){const a=Pge(e),s=Oge(t),c=new Map;let l;const _=new Set;let u,d,p,f;return m(n),{defaultProject:u??d,tsconfigProject:p??f,sentConfigDiag:_,seenProjects:c,seenConfigs:l};function m(t){return function(e,t){e.sentConfigFileDiag&&_.add(e.project);return e.configFileExistenceInfo?g(e.configFileExistenceInfo,e.project,ame(e.project.getConfigFilePath()),e.reason,e.project,e.project.canonicalConfigFilePath):h(e.project,t)}(t,t.project)??((n=t.project).parsedCommandLine&&jge(n,n.parsedCommandLine,g,s,r(n),i,o))??function(t){return a?Lge(e,t,m,s,`Creating possible configured project for ${e.fileName} to open`,i,o,!1):void 0}(t.project);var n}function g(n,r,a,u,d,p){if(r){if(c.has(r))return;c.set(r,s)}else{if(null==l?void 0:l.has(p))return;(l??(l=new Set)).add(p)}if(!d.projectService.isMatchedByConfig(a,n.config.parsedCommandLine,e))return void(d.languageServiceEnabled&&d.projectService.watchWildcards(a,n,d));const f=r?Mge(r,t,e.fileName,u,o):d.projectService.findCreateOrReloadConfiguredProject(a,t,u,i,e.fileName,o);if(f)return c.set(f.project,s),f.sentConfigFileDiag&&_.add(f.project),h(f.project,d);pn.assert(3===t)}function h(n,r){if(c.get(n)===t)return;c.set(n,t);const i=a?e:n.projectService.getScriptInfo(e.fileName),o=i&&n.containsScriptInfo(i);if(o&&!n.isSourceOfProjectReferenceRedirect(i.path))return p=r,u=n;!d&&a&&o&&(f=r,d=n)}}tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(e,t,n,r){const i=1===t,o=this.tryFindDefaultConfiguredProjectForOpenScriptInfo(e,t,i,n);if(!o)return;const{defaultProject:a,tsconfigProject:s,seenProjects:c}=o;return a&&Lge(e,s,e=>{c.set(e.project,t)},t,`Creating project possibly referencing default composite project ${a.getProjectName()} of open file ${e.fileName}`,i,n,!0,r),o}loadAncestorProjectTree(e){e??(e=new Set(z(this.configuredProjects.entries(),([e,t])=>t.initialLoadPending?void 0:e)));const t=new Set,n=je(this.configuredProjects.values());for(const r of n)Rge(r,t=>e.has(t))&&Uge(r),this.ensureProjectChildren(r,e,t)}ensureProjectChildren(e,t,n){var r;if(!U(n,e.canonicalConfigFilePath))return;if(e.getCompilerOptions().disableReferencedProjectLoad)return;const i=null==(r=e.getCurrentProgram())?void 0:r.getResolvedProjectReferences();if(i)for(const r of i){if(!r)continue;const i=RC(r.references,e=>t.has(e.sourceFile.path)?e:void 0);if(!i)continue;const o=ame(r.sourceFile.fileName),a=this.findConfiguredProjectByProjectName(o)??this.createConfiguredProject(o,`Creating project referenced by : ${e.projectName} as it references project ${i.sourceFile.fileName}`);Uge(a),this.ensureProjectChildren(a,t,n)}}cleanupConfiguredProjects(e,t,n){this.getOrphanConfiguredProjects(e,n,t).forEach(e=>this.removeProject(e))}cleanupProjectsAndScriptInfos(e,t,n){this.cleanupConfiguredProjects(e,n,t);for(const e of this.inferredProjects.slice())e.isOrphan()&&this.removeProject(e);this.removeOrphanScriptInfos()}tryInvokeWildCardDirectories(e){this.configFileExistenceInfoCache.forEach((t,n)=>{var r,i;(null==(r=t.config)?void 0:r.parsedCommandLine)&&!C(t.config.parsedCommandLine.fileNames,e.fileName,this.host.useCaseSensitiveFileNames?vt:yt)&&(null==(i=t.config.watchedDirectories)||i.forEach((r,i)=>{ia(i,e.fileName,!this.host.useCaseSensitiveFileNames)&&(this.logger.info(`Invoking ${n}:: wildcard for open scriptInfo:: ${e.fileName}`),this.onWildCardDirectoryWatcherInvoke(i,n,t.config,r.watcher,e.fileName))}))})}openClientFileWithNormalizedPath(e,t,n,r,i){const o=this.getScriptInfoForPath(sme(e,i?this.getNormalizedAbsolutePath(i):this.currentDirectory,this.toCanonicalFileName)),a=this.getOrCreateOpenScriptInfo(e,t,n,r,i);o||!a||a.isDynamic||this.tryInvokeWildCardDirectories(a);const{retainProjects:s,...c}=this.assignProjectToOpenedScriptInfo(a);return this.cleanupProjectsAndScriptInfos(s,new Set([a.path]),void 0),this.telemetryOnOpenFile(a),this.printProjects(),c}getOrphanConfiguredProjects(e,t,n){const r=new Set(this.configuredProjects.values()),i=e=>{!e.originalConfiguredProjects||!Gme(e)&&e.isOrphan()||e.originalConfiguredProjects.forEach((e,t)=>{const n=this.getConfiguredProjectByCanonicalConfigFilePath(t);return n&&s(n)})};return null==e||e.forEach((e,t)=>s(t)),r.size?(this.inferredProjects.forEach(i),this.externalProjects.forEach(i),this.externalProjectToConfiguredProjectMap.forEach((e,t)=>{(null==n?void 0:n.has(t))||e.forEach(s)}),r.size?(sd(this.openFiles,(e,n)=>{if(null==t?void 0:t.has(n))return;const i=this.getScriptInfoForPath(n);if(x(i.containingProjects,Xme))return;const o=this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(i,1);return(null==o?void 0:o.defaultProject)&&(null==o||o.seenProjects.forEach((e,t)=>s(t)),!r.size)?r:void 0}),r.size?(sd(this.configuredProjects,e=>{if(r.has(e)&&(a(e)||Jge(e,o))&&(s(e),!r.size))return r}),r):r):r):r;function o(e){return!r.has(e)||a(e)}function a(e){var t,n;return(e.deferredClose||e.projectService.hasPendingProjectUpdate(e))&&!!(null==(n=null==(t=e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath))?void 0:t.openFilesImpactedByConfigFile)?void 0:n.size)}function s(e){r.delete(e)&&(i(e),Jge(e,s))}}removeOrphanScriptInfos(){const e=new Map(this.filenameToScriptInfo);this.filenameToScriptInfo.forEach(t=>{if(!t.deferredDelete){if(!t.isScriptOpen()&&t.isOrphan()&&!Ime(t)&&!Ame(t)){if(!t.sourceMapFilePath)return;let e;if(tt(t.sourceMapFilePath)){const n=this.filenameToScriptInfo.get(t.sourceMapFilePath);e=null==n?void 0:n.sourceInfos}else e=t.sourceMapFilePath.sourceInfos;if(!e)return;if(!cd(e,e=>{const t=this.getScriptInfoForPath(e);return!!t&&(t.isScriptOpen()||!t.isOrphan())}))return}if(e.delete(t.path),t.sourceMapFilePath){let n;if(tt(t.sourceMapFilePath)){const r=this.filenameToScriptInfo.get(t.sourceMapFilePath);(null==r?void 0:r.deferredDelete)?t.sourceMapFilePath={watcher:this.addMissingSourceMapFile(r.fileName,t.path),sourceInfos:r.sourceInfos}:e.delete(t.sourceMapFilePath),n=null==r?void 0:r.sourceInfos}else n=t.sourceMapFilePath.sourceInfos;n&&n.forEach((t,n)=>e.delete(n))}}}),e.forEach(e=>this.deleteScriptInfo(e))}telemetryOnOpenFile(e){if(0!==this.serverMode||!this.eventHandler||!e.isJavaScript()||!Cx(this.allJsFilesForOpenFileTelemetry,e.path))return;const t=this.ensureDefaultProjectForFile(e);if(!t.languageServiceEnabled)return;const n=t.getSourceFile(e.path),r=!!n&&!!n.checkJsDirective;this.eventHandler({eventName:cge,data:{info:{checkJs:r}}})}closeClientFile(e,t){const n=this.getScriptInfoForNormalizedPath(ame(e)),r=!!n&&this.closeOpenFile(n,t);return t||this.printProjects(),r}collectChanges(e,t,n,r){for(const i of t){const t=x(e,e=>e.projectName===i.getProjectName());r.push(i.getChangesSinceVersion(t&&t.version,n))}}synchronizeProjectList(e,t){const n=[];return this.collectChanges(e,this.externalProjects,t,n),this.collectChanges(e,z(this.configuredProjects.values(),e=>e.deferredClose?void 0:e),t,n),this.collectChanges(e,this.inferredProjects,t,n),n}applyChangesInOpenFiles(e,t,n){let r,i,o,a=!1;if(e)for(const t of e){(r??(r=[])).push(this.getScriptInfoForPath(sme(ame(t.fileName),t.projectRootPath?this.getNormalizedAbsolutePath(t.projectRootPath):this.currentDirectory,this.toCanonicalFileName)));const e=this.getOrCreateOpenScriptInfo(ame(t.fileName),t.content,kge(t.scriptKind),t.hasMixedContent,t.projectRootPath?ame(t.projectRootPath):void 0);(i||(i=[])).push(e)}if(t)for(const e of t){const t=this.getScriptInfo(e.fileName);pn.assert(!!t),this.applyChangesToFile(t,e.changes)}if(n)for(const e of n)a=this.closeClientFile(e,!0)||a;p(r,(e,t)=>e||!i[t]||i[t].isDynamic?void 0:this.tryInvokeWildCardDirectories(i[t])),null==i||i.forEach(e=>{var t;return null==(t=this.assignProjectToOpenedScriptInfo(e).retainProjects)?void 0:t.forEach((e,t)=>(o??(o=new Map)).set(t,e))}),a&&this.assignOrphanScriptInfosToInferredProject(),i?(this.cleanupProjectsAndScriptInfos(o,new Set(i.map(e=>e.path)),void 0),i.forEach(e=>this.telemetryOnOpenFile(e)),this.printProjects()):d(n)&&this.printProjects()}applyChangesToFile(e,t){for(const n of t)e.editContent(n.span.start,n.span.start+n.span.length,n.newText)}closeExternalProject(e,t){const n=ame(e);if(this.externalProjectToConfiguredProjectMap.get(n))this.externalProjectToConfiguredProjectMap.delete(n);else{const t=this.findExternalProjectByProjectName(e);t&&this.removeProject(t)}t&&(this.cleanupConfiguredProjects(),this.printProjects())}openExternalProjects(e){const t=new Set(this.externalProjects.map(e=>e.getProjectName()));this.externalProjectToConfiguredProjectMap.forEach((e,n)=>t.add(n));for(const n of e)this.openExternalProject(n,!1),t.delete(n.projectFileName);t.forEach(e=>this.closeExternalProject(e,!1)),this.cleanupConfiguredProjects(),this.printProjects()}static escapeFilenameForRegex(e){return e.replace(this.filenameEscapeRegexp,"\\$&")}resetSafeList(){this.safelist=hge}applySafeList(e){const t=e.typeAcquisition;pn.assert(!!t,"proj.typeAcquisition should be set by now");const n=this.applySafeListWorker(e,e.rootFiles,t);return(null==n?void 0:n.excludedFiles)??[]}applySafeListWorker(t,n,r){if(!1===r.enable||r.disableFilenameBasedTypeAcquisition)return;const i=r.include||(r.include=[]),o=[],a=n.map(e=>Ro(e.fileName));for(const t of Object.keys(this.safelist)){const n=this.safelist[t];for(const r of a)if(n.match.test(r)){if(this.logger.info(`Excluding files based on rule ${t} matching file '${r}'`),n.types)for(const e of n.types)i.includes(e)||i.push(e);if(n.exclude)for(const i of n.exclude){const a=r.replace(n.match,(...n)=>i.map(r=>"number"==typeof r?tt(n[r])?e.escapeFilenameForRegex(n[r]):(this.logger.info(`Incorrect RegExp specification in safelist rule ${t} - not enough groups`),"\\*"):r).join(""));o.includes(a)||o.push(a)}else{const t=e.escapeFilenameForRegex(r);o.includes(t)||o.push(t)}}}const s=o.map(e=>new RegExp(e,"i"));let c,l;for(let e=0;et.test(a[e])))_(e);else{if(r.enable){const t=Io(dt(a[e]));if(wo(t,"js")){const n=qt(KS(t)),r=this.legacySafelist.get(n);if(void 0!==r){this.logger.info(`Excluded '${a[e]}' because it matched ${n} from the legacy safelist`),_(e),i.includes(r)||i.push(r);continue}}}/^.+[.-]min\.js$/.test(a[e])?_(e):null==c||c.push(n[e])}return l?{rootFiles:c,excludedFiles:l}:void 0;function _(e){l||(pn.assert(!c),c=n.slice(0,e),l=[]),l.push(a[e])}}openExternalProject(e,t){const n=this.findExternalProjectByProjectName(e.projectFileName);let r,i=[];for(const t of e.rootFiles){const n=ame(t.fileName);if(hme(n)){if(0===this.serverMode&&this.host.fileExists(n)){let t=this.findConfiguredProjectByProjectName(n);t||(t=this.createConfiguredProject(n,`Creating configured project in external project: ${e.projectFileName}`),this.getHostPreferences().lazyConfiguredProjectsFromExternalProject||t.updateGraph()),(r??(r=new Set)).add(t),pn.assert(!t.isClosed())}}else i.push(t)}if(r)this.externalProjectToConfiguredProjectMap.set(e.projectFileName,r),n&&this.removeProject(n);else{this.externalProjectToConfiguredProjectMap.delete(e.projectFileName);const t=e.typeAcquisition||{};t.include=t.include||[],t.exclude=t.exclude||[],void 0===t.enable&&(t.enable=Rme(i.map(e=>e.fileName)));const r=this.applySafeListWorker(e,i,t),o=(null==r?void 0:r.excludedFiles)??[];if(i=(null==r?void 0:r.rootFiles)??i,n){n.excludedFiles=o;const r=vge(e.options),a=bge(e.options,n.getCurrentDirectory()),s=this.getFilenameForExceededTotalSizeLimitForNonTsFiles(e.projectFileName,r,i,wge);s?n.disableLanguageService(s):n.enableLanguageService(),n.setProjectErrors(null==a?void 0:a.errors),this.updateRootAndOptionsOfNonInferredProject(n,i,wge,r,t,e.options.compileOnSave,null==a?void 0:a.watchOptions),n.updateGraph()}else{this.createExternalProject(e.projectFileName,i,e.options,t,o).updateGraph()}}t&&(this.cleanupConfiguredProjects(r,new Set([e.projectFileName])),this.printProjects())}hasDeferredExtension(){for(const e of this.hostConfiguration.extraFileExtensions)if(7===e.scriptKind)return!0;return!1}requestEnablePlugin(e,t,n){if(this.host.importPlugin||this.host.require)if(this.logger.info(`Enabling plugin ${t.name} from candidate paths: ${n.join(",")}`),!t.name||Fs(t.name)||/[\\/]\.\.?(?:$|[\\/])/.test(t.name))this.logger.info(`Skipped loading plugin ${t.name||JSON.stringify(t)} because only package name is allowed plugin name`);else{if(this.host.importPlugin){const r=zme.importServicePluginAsync(t,n,this.host,e=>this.logger.info(e));this.pendingPluginEnablements??(this.pendingPluginEnablements=new Map);let i=this.pendingPluginEnablements.get(e);return i||this.pendingPluginEnablements.set(e,i=[]),void i.push(r)}this.endEnablePlugin(e,zme.importServicePluginSync(t,n,this.host,e=>this.logger.info(e)))}else this.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded")}endEnablePlugin(e,{pluginConfigEntry:t,resolvedModule:n,errorLogs:r}){var i;if(n){const r=null==(i=this.currentPluginConfigOverrides)?void 0:i.get(t.name);if(r){const e=t.name;(t=r).name=e}e.enableProxy(n,t)}else p(r,e=>this.logger.info(e)),this.logger.info(`Couldn't find ${t.name}`)}hasNewPluginEnablementRequests(){return!!this.pendingPluginEnablements}hasPendingPluginEnablements(){return!!this.currentPluginEnablementPromise}async waitForPendingPlugins(){for(;this.currentPluginEnablementPromise;)await this.currentPluginEnablementPromise}enableRequestedPlugins(){this.pendingPluginEnablements&&this.enableRequestedPluginsAsync()}async enableRequestedPluginsAsync(){if(this.currentPluginEnablementPromise&&await this.waitForPendingPlugins(),!this.pendingPluginEnablements)return;const e=je(this.pendingPluginEnablements.entries());this.pendingPluginEnablements=void 0,this.currentPluginEnablementPromise=this.enableRequestedPluginsWorker(e),await this.currentPluginEnablementPromise}async enableRequestedPluginsWorker(e){pn.assert(void 0===this.currentPluginEnablementPromise);let t=!1;await Promise.all(P(e,async([e,n])=>{const r=await Promise.all(n);if(e.isClosed()||Yme(e))this.logger.info(`Cancelling plugin enabling for ${e.getProjectName()} as it is ${e.isClosed()?"closed":"deferred close"}`);else{t=!0;for(const t of r)this.endEnablePlugin(e,t);this.delayUpdateProjectGraph(e)}})),this.currentPluginEnablementPromise=void 0,t&&this.sendProjectsUpdatedInBackgroundEvent()}configurePlugin(e){this.forEachEnabledProject(t=>t.onPluginConfigurationChanged(e.pluginName,e.configuration)),this.currentPluginConfigOverrides=this.currentPluginConfigOverrides||new Map,this.currentPluginConfigOverrides.set(e.pluginName,e.configuration)}getPackageJsonsVisibleToFile(e,t,n){const r=this.packageJsonCache,i=n&&this.toPath(n),o=[],a=e=>{switch(r.directoryHasPackageJson(e)){case 3:return r.searchDirectoryAndAncestors(e,t),a(e);case-1:const n=Jo(e,"package.json");this.watchPackageJsonFile(n,this.toPath(n),t);const i=r.getInDirectory(e);i&&o.push(i)}if(i&&i===e)return!0};return LR(t,Ao(e),a),o}getNearestAncestorDirectoryWithPackageJson(e,t){return LR(t,e,e=>{switch(this.packageJsonCache.directoryHasPackageJson(e)){case-1:return e;case 0:return;case 3:return this.host.fileExists(Jo(e,"package.json"))?e:void 0}})}watchPackageJsonFile(e,t,n){pn.assert(void 0!==n);let r=(this.packageJsonFilesMap??(this.packageJsonFilesMap=new Map)).get(t);if(!r){let n=this.watchFactory.watchFile(e,(e,n)=>{switch(n){case 0:case 1:this.packageJsonCache.addOrUpdate(e,t),this.onPackageJsonChange(r);break;case 2:this.packageJsonCache.delete(t),this.onPackageJsonChange(r),r.projects.clear(),r.close()}},250,this.hostConfiguration.watchOptions,z$.PackageJson);r={projects:new Set,close:()=>{var e;!r.projects.size&&n&&(n.close(),n=void 0,null==(e=this.packageJsonFilesMap)||e.delete(t),this.packageJsonCache.invalidate(t))}},this.packageJsonFilesMap.set(t,r)}r.projects.add(n),(n.packageJsonWatches??(n.packageJsonWatches=new Set)).add(r)}onPackageJsonChange(e){e.projects.forEach(e=>{var t;return null==(t=e.onPackageJsonChange)?void 0:t.call(e)})}includePackageJsonAutoImports(){switch(this.hostConfiguration.preferences.includePackageJsonAutoImports){case"on":return 1;case"off":return 0;default:return 2}}getIncompleteCompletionsCache(){return this.incompleteCompletionsCache||(this.incompleteCompletionsCache=function(){let e;return{get:()=>e,set(t){e=t},clear(){e=void 0}}}())}};Zge.filenameEscapeRegexp=/[-/\\^$*+?.()|[\]{}]/g;var ehe=Zge;function the(e){return void 0!==e.kind}function nhe(e){e.print(!1,!1,!1)}function rhe(e){let t,n,r;const i={get(e,t,i,o){if(n&&r===a(e,i,o))return n.get(t)},set(n,r,i,a,c,l,_){if(o(n,i,a).set(r,s(c,l,_,void 0,!1)),_)for(const n of l)if(n.isInNodeModules){const r=n.path.substring(0,n.path.indexOf(oR)+oR.length-1),i=e.toPath(r);(null==t?void 0:t.has(i))||(t||(t=new Map)).set(i,e.watchNodeModulesForPackageJsonChanges(r))}},setModulePaths(e,t,n,r,i){const a=o(e,n,r),c=a.get(t);c?c.modulePaths=i:a.set(t,s(void 0,i,void 0,void 0,void 0))},setBlockedByPackageJsonDependencies(e,t,n,r,i,a){const c=o(e,n,r),l=c.get(t);l?(l.isBlockedByPackageJsonDependencies=a,l.packageName=i):c.set(t,s(void 0,void 0,void 0,i,a))},clear(){null==t||t.forEach(sx),null==n||n.clear(),null==t||t.clear(),r=void 0},count:()=>n?n.size:0};return pn.isDebugging&&Object.defineProperty(i,"__cache",{get:()=>n}),i;function o(e,t,o){const s=a(e,t,o);return n&&r!==s&&i.clear(),r=s,n||(n=new Map)}function a(e,t,n){return`${e},${t.importModuleSpecifierEnding},${t.importModuleSpecifierPreference},${n.overrideImportMode}`}function s(e,t,n,r,i){return{kind:e,modulePaths:t,moduleSpecifiers:n,packageName:r,isBlockedByPackageJsonDependencies:i}}}function ihe(e){const t=new Map,n=new Map;return{addOrUpdate:r,invalidate:function(e){t.delete(e),n.delete(Ao(e))},delete:e=>{t.delete(e),n.set(Ao(e),!0)},getInDirectory:n=>t.get(e.toPath(Jo(n,"package.json")))||void 0,directoryHasPackageJson:t=>i(e.toPath(t)),searchDirectoryAndAncestors:(t,o)=>{LR(o,t,t=>{const o=e.toPath(t);if(3!==i(o))return!0;const a=Jo(t,"package.json");JZ(e,a)?r(a,Jo(o,"package.json")):n.set(o,!0)})}};function r(r,i){const o=pn.checkDefined($Z(r,e.host));t.set(i,o),n.delete(Ao(i))}function i(e){return t.has(Jo(e,"package.json"))?-1:n.has(e)?0:3}}var ohe={isCancellationRequested:()=>!1,setRequest:()=>{},resetRequest:()=>{}};function ahe(e,t){if((Kme(e)||Xme(e))&&e.isJsOnlyProject()){const n=e.getScriptInfoForNormalizedPath(t);return n&&!n.isJavaScript()}return!1}function she(e,t,n){const r=t.getScriptInfoForNormalizedPath(e);return{start:r.positionToLineOffset(n.start),end:r.positionToLineOffset(n.start+n.length),text:vV(n.messageText,"\n"),code:n.code,category:_i(n),reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated,source:n.source,relatedInformation:P(n.relatedInformation,che)}}function che(e){return e.file?{span:{start:lhe(Wa(e.file,e.start)),end:lhe(Wa(e.file,e.start+e.length)),file:e.file.fileName},message:vV(e.messageText,"\n"),category:_i(e),code:e.code}:{message:vV(e.messageText,"\n"),category:_i(e),code:e.code}}function lhe(e){return{line:e.line+1,offset:e.character+1}}function _he(e,t){const n=e.file&&lhe(Wa(e.file,e.start)),r=e.file&&lhe(Wa(e.file,e.start+e.length)),i=vV(e.messageText,"\n"),{code:o,source:a}=e,s={start:n,end:r,text:i,code:o,category:_i(e),reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,source:a,relatedInformation:P(e.relatedInformation,che)};return t?{...s,fileName:e.file&&e.file.fileName}:s}var uhe=vme;function dhe(e,t,n,r){const i=t.hasLevel(3),o=JSON.stringify(e);i&&t.info(`${e.type}:${xG(e)}`);return`Content-Length: ${1+n(o,"utf8")}\r\n\r\n${o}${r}`}var phe=class{constructor(e){this.operationHost=e}startNew(e){this.complete(),this.requestId=this.operationHost.getCurrentRequestId(),this.executeAction(e)}complete(){void 0!==this.requestId&&(this.operationHost.sendRequestCompletedEvent(this.requestId,this.performanceData),this.requestId=void 0),this.setTimerHandle(void 0),this.setImmediateId(void 0),this.performanceData=void 0}immediate(e,t){const n=this.requestId;pn.assert(n===this.operationHost.getCurrentRequestId(),"immediate: incorrect request id"),this.setImmediateId(this.operationHost.getServerHost().setImmediate(()=>{this.immediateId=void 0,this.operationHost.executeWithRequestId(n,()=>this.executeAction(t),this.performanceData)},e))}delay(e,t,n){const r=this.requestId;pn.assert(r===this.operationHost.getCurrentRequestId(),"delay: incorrect request id"),this.setTimerHandle(this.operationHost.getServerHost().setTimeout(()=>{this.timerHandle=void 0,this.operationHost.executeWithRequestId(r,()=>this.executeAction(n),this.performanceData)},t,e))}executeAction(e){var t,n,r,i,o,a;let s=!1;try{this.operationHost.isCancellationRequested()?(s=!0,null==(t=Gn)||t.instant(Gn.Phase.Session,"stepCanceled",{seq:this.requestId,early:!0})):(null==(n=Gn)||n.push(Gn.Phase.Session,"stepAction",{seq:this.requestId}),e(this),null==(r=Gn)||r.pop())}catch(e){null==(i=Gn)||i.popAll(),s=!0,e instanceof Nr?null==(o=Gn)||o.instant(Gn.Phase.Session,"stepCanceled",{seq:this.requestId}):(null==(a=Gn)||a.instant(Gn.Phase.Session,"stepError",{seq:this.requestId,message:e.message}),this.operationHost.logError(e,`delayed processing of request ${this.requestId}`))}this.performanceData=this.operationHost.getPerformanceData(),!s&&this.hasPendingWork()||this.complete()}setTimerHandle(e){void 0!==this.timerHandle&&this.operationHost.getServerHost().clearTimeout(this.timerHandle),this.timerHandle=e}setImmediateId(e){void 0!==this.immediateId&&this.operationHost.getServerHost().clearImmediate(this.immediateId),this.immediateId=e}hasPendingWork(){return!!this.timerHandle||!!this.immediateId}};function fhe(e,t){return{seq:0,type:"event",event:e,body:t}}function mhe(e){return Ye(({textSpan:e})=>e.start+100003*e.length,PY(e))}function ghe(e,t,n){const r=e.getLanguageService().getDefinitionAtPosition(t.fileName,t.pos,!1,n),i=r&&ge(r);return i&&!i.isLocal?{fileName:i.fileName,pos:i.textSpan.start}:void 0}function hhe(e,t,n){for(const r of Ze(e)?e:e.projects)n(r,t);!Ze(e)&&e.symLinkedProjects&&e.symLinkedProjects.forEach((e,t)=>{for(const r of e)n(r,t)})}function yhe(e,t,n,r,i,o,a){const s=new Map,c=Qe();c.enqueue({project:t,location:n}),hhe(e,n.fileName,(e,t)=>{const r={fileName:t,pos:n.pos};c.enqueue({project:e,location:r})});const l=t.projectService,_=t.getCancellationToken(),u=ft(()=>t.isSourceOfProjectReferenceRedirect(r.fileName)?r:t.getLanguageService().getSourceMapper().tryGetGeneratedPosition(r)),d=ft(()=>t.isSourceOfProjectReferenceRedirect(r.fileName)?r:t.getLanguageService().getSourceMapper().tryGetSourcePosition(r)),p=new Set;e:for(;!c.isEmpty();){for(;!c.isEmpty();){if(_.isCancellationRequested())break e;const{project:e,location:t}=c.dequeue();if(s.has(e))continue;if(xhe(e,t))continue;if(Uge(e),!e.containsFile(ame(t.fileName)))continue;const n=f(e,t);s.set(e,n??rme),p.add(khe(e))}r&&(l.loadAncestorProjectTree(p),l.forEachEnabledProject(e=>{if(_.isCancellationRequested())return;if(s.has(e))return;const t=i(r,e,u,d);t&&c.enqueue({project:e,location:t})}))}return 1===s.size?ve(s.values()):s;function f(e,t){const n=o(e,t);if(!n||!a)return n;for(const t of n)a(t,t=>{const n=l.getOriginalLocationEnsuringConfiguredProject(e,t);if(!n)return;const r=l.getScriptInfo(n.fileName);for(const e of r.containingProjects)e.isOrphan()||s.has(e)||c.enqueue({project:e,location:n});const i=l.getSymlinkedProjects(r);i&&i.forEach((e,t)=>{for(const r of e)r.isOrphan()||s.has(r)||c.enqueue({project:r,location:{fileName:t,pos:n.pos}})})});return n}}function vhe(e,t){if(t.containsFile(ame(e.fileName))&&!xhe(t,e))return e}function bhe(e,t,n,r){const i=vhe(e,t);if(i)return i;const o=n();if(o&&t.containsFile(ame(o.fileName)))return o;const a=r();return a&&t.containsFile(ame(a.fileName))?a:void 0}function xhe(e,t){if(!t)return!1;const n=e.getLanguageService().getProgram();if(!n)return!1;const r=n.getSourceFile(t.fileName);return!!r&&r.resolvedPath!==r.path&&r.resolvedPath!==e.toPath(t.fileName)}function khe(e){return Gme(e)?e.canonicalConfigFilePath:e.getProjectName()}function She({fileName:e,textSpan:t}){return{fileName:e,pos:t.start}}function The(e,t){return OY(e,t.getSourceMapper(),e=>t.projectService.fileExists(e))}function Che(e,t){return LY(e,t.getSourceMapper(),e=>t.projectService.fileExists(e))}function whe(e,t){return jY(e,t.getSourceMapper(),e=>t.projectService.fileExists(e))}var Nhe=["openExternalProject","openExternalProjects","closeExternalProject","synchronizeProjectList","emit-output","compileOnSaveAffectedFileList","compileOnSaveEmitFile","compilerOptionsDiagnostics-full","encodedSemanticClassifications-full","semanticDiagnosticsSync","suggestionDiagnosticsSync","geterrForProject","reload","reloadProjects","getCodeFixes","getCodeFixes-full","getCombinedCodeFix","getCombinedCodeFix-full","applyCodeActionCommand","getSupportedCodeFixes","getApplicableRefactors","getMoveToRefactoringFileSuggestions","getEditsForRefactor","getEditsForRefactor-full","organizeImports","organizeImports-full","getEditsForFileRename","getEditsForFileRename-full","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","getPasteEdits","copilotRelated"],Dhe=[...Nhe,"definition","definition-full","definitionAndBoundSpan","definitionAndBoundSpan-full","typeDefinition","implementation","implementation-full","references","references-full","rename","renameLocations-full","rename-full","quickinfo","quickinfo-full","completionInfo","completions","completions-full","completionEntryDetails","completionEntryDetails-full","signatureHelp","signatureHelp-full","navto","navto-full","documentHighlights","documentHighlights-full","preparePasteEdits"],Fhe=class e{constructor(e){this.changeSeq=0,this.regionDiagLineCountThreshold=500,this.handlers=new Map(Object.entries({status:()=>{const e={version:c};return this.requiredResponse(e)},openExternalProject:e=>(this.projectService.openExternalProject(e.arguments,!0),this.requiredResponse(!0)),openExternalProjects:e=>(this.projectService.openExternalProjects(e.arguments.projects),this.requiredResponse(!0)),closeExternalProject:e=>(this.projectService.closeExternalProject(e.arguments.projectFileName,!0),this.requiredResponse(!0)),synchronizeProjectList:e=>{const t=this.projectService.synchronizeProjectList(e.arguments.knownProjects,e.arguments.includeProjectReferenceRedirectInfo);if(!t.some(e=>e.projectErrors&&0!==e.projectErrors.length))return this.requiredResponse(t);const n=P(t,e=>e.projectErrors&&0!==e.projectErrors.length?{info:e.info,changes:e.changes,files:e.files,projectErrors:this.convertToDiagnosticsWithLinePosition(e.projectErrors,void 0)}:e);return this.requiredResponse(n)},updateOpen:e=>(this.changeSeq++,this.projectService.applyChangesInOpenFiles(e.arguments.openFiles&&A(e.arguments.openFiles,e=>({fileName:e.file,content:e.fileContent,scriptKind:e.scriptKindName,projectRootPath:e.projectRootPath})),e.arguments.changedFiles&&A(e.arguments.changedFiles,e=>({fileName:e.fileName,changes:z(pe(e.textChanges),t=>{const n=pn.checkDefined(this.projectService.getScriptInfo(e.fileName)),r=n.lineOffsetToPosition(t.start.line,t.start.offset),i=n.lineOffsetToPosition(t.end.line,t.end.offset);return r>=0?{span:{start:r,length:i-r},newText:t.newText}:void 0})})),e.arguments.closedFiles),this.requiredResponse(!0)),applyChangedToOpenFiles:e=>(this.changeSeq++,this.projectService.applyChangesInOpenFiles(e.arguments.openFiles,e.arguments.changedFiles&&A(e.arguments.changedFiles,e=>({fileName:e.fileName,changes:pe(e.changes)})),e.arguments.closedFiles),this.requiredResponse(!0)),exit:()=>(this.exit(),this.notRequired(void 0)),definition:e=>this.requiredResponse(this.getDefinition(e.arguments,!0)),"definition-full":e=>this.requiredResponse(this.getDefinition(e.arguments,!1)),definitionAndBoundSpan:e=>this.requiredResponse(this.getDefinitionAndBoundSpan(e.arguments,!0)),"definitionAndBoundSpan-full":e=>this.requiredResponse(this.getDefinitionAndBoundSpan(e.arguments,!1)),findSourceDefinition:e=>this.requiredResponse(this.findSourceDefinition(e.arguments)),"emit-output":e=>this.requiredResponse(this.getEmitOutput(e.arguments)),typeDefinition:e=>this.requiredResponse(this.getTypeDefinition(e.arguments)),implementation:e=>this.requiredResponse(this.getImplementation(e.arguments,!0)),"implementation-full":e=>this.requiredResponse(this.getImplementation(e.arguments,!1)),references:e=>this.requiredResponse(this.getReferences(e.arguments,!0)),"references-full":e=>this.requiredResponse(this.getReferences(e.arguments,!1)),rename:e=>this.requiredResponse(this.getRenameLocations(e.arguments,!0)),"renameLocations-full":e=>this.requiredResponse(this.getRenameLocations(e.arguments,!1)),"rename-full":e=>this.requiredResponse(this.getRenameInfo(e.arguments)),open:e=>(this.openClientFile(ame(e.arguments.file),e.arguments.fileContent,Sge(e.arguments.scriptKindName),e.arguments.projectRootPath?ame(e.arguments.projectRootPath):void 0),this.notRequired(e)),quickinfo:e=>this.requiredResponse(this.getQuickInfoWorker(e.arguments,!0)),"quickinfo-full":e=>this.requiredResponse(this.getQuickInfoWorker(e.arguments,!1)),getOutliningSpans:e=>this.requiredResponse(this.getOutliningSpans(e.arguments,!0)),outliningSpans:e=>this.requiredResponse(this.getOutliningSpans(e.arguments,!1)),todoComments:e=>this.requiredResponse(this.getTodoComments(e.arguments)),indentation:e=>this.requiredResponse(this.getIndentation(e.arguments)),nameOrDottedNameSpan:e=>this.requiredResponse(this.getNameOrDottedNameSpan(e.arguments)),breakpointStatement:e=>this.requiredResponse(this.getBreakpointStatement(e.arguments)),braceCompletion:e=>this.requiredResponse(this.isValidBraceCompletion(e.arguments)),docCommentTemplate:e=>this.requiredResponse(this.getDocCommentTemplate(e.arguments)),getSpanOfEnclosingComment:e=>this.requiredResponse(this.getSpanOfEnclosingComment(e.arguments)),fileReferences:e=>this.requiredResponse(this.getFileReferences(e.arguments,!0)),"fileReferences-full":e=>this.requiredResponse(this.getFileReferences(e.arguments,!1)),format:e=>this.requiredResponse(this.getFormattingEditsForRange(e.arguments)),formatonkey:e=>this.requiredResponse(this.getFormattingEditsAfterKeystroke(e.arguments)),"format-full":e=>this.requiredResponse(this.getFormattingEditsForDocumentFull(e.arguments)),"formatonkey-full":e=>this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(e.arguments)),"formatRange-full":e=>this.requiredResponse(this.getFormattingEditsForRangeFull(e.arguments)),completionInfo:e=>this.requiredResponse(this.getCompletions(e.arguments,"completionInfo")),completions:e=>this.requiredResponse(this.getCompletions(e.arguments,"completions")),"completions-full":e=>this.requiredResponse(this.getCompletions(e.arguments,"completions-full")),completionEntryDetails:e=>this.requiredResponse(this.getCompletionEntryDetails(e.arguments,!1)),"completionEntryDetails-full":e=>this.requiredResponse(this.getCompletionEntryDetails(e.arguments,!0)),compileOnSaveAffectedFileList:e=>this.requiredResponse(this.getCompileOnSaveAffectedFileList(e.arguments)),compileOnSaveEmitFile:e=>this.requiredResponse(this.emitFile(e.arguments)),signatureHelp:e=>this.requiredResponse(this.getSignatureHelpItems(e.arguments,!0)),"signatureHelp-full":e=>this.requiredResponse(this.getSignatureHelpItems(e.arguments,!1)),"compilerOptionsDiagnostics-full":e=>this.requiredResponse(this.getCompilerOptionsDiagnostics(e.arguments)),"encodedSyntacticClassifications-full":e=>this.requiredResponse(this.getEncodedSyntacticClassifications(e.arguments)),"encodedSemanticClassifications-full":e=>this.requiredResponse(this.getEncodedSemanticClassifications(e.arguments)),cleanup:()=>(this.cleanup(),this.requiredResponse(!0)),semanticDiagnosticsSync:e=>this.requiredResponse(this.getSemanticDiagnosticsSync(e.arguments)),syntacticDiagnosticsSync:e=>this.requiredResponse(this.getSyntacticDiagnosticsSync(e.arguments)),suggestionDiagnosticsSync:e=>this.requiredResponse(this.getSuggestionDiagnosticsSync(e.arguments)),geterr:e=>(this.errorCheck.startNew(t=>this.getDiagnostics(t,e.arguments.delay,e.arguments.files)),this.notRequired(void 0)),geterrForProject:e=>(this.errorCheck.startNew(t=>this.getDiagnosticsForProject(t,e.arguments.delay,e.arguments.file)),this.notRequired(void 0)),change:e=>(this.change(e.arguments),this.notRequired(e)),configure:e=>(this.projectService.setHostConfiguration(e.arguments),this.notRequired(e)),reload:e=>(this.reload(e.arguments),this.requiredResponse({reloadFinished:!0})),saveto:e=>{const t=e.arguments;return this.saveToTmp(t.file,t.tmpfile),this.notRequired(e)},close:e=>{const t=e.arguments;return this.closeClientFile(t.file),this.notRequired(e)},navto:e=>this.requiredResponse(this.getNavigateToItems(e.arguments,!0)),"navto-full":e=>this.requiredResponse(this.getNavigateToItems(e.arguments,!1)),brace:e=>this.requiredResponse(this.getBraceMatching(e.arguments,!0)),"brace-full":e=>this.requiredResponse(this.getBraceMatching(e.arguments,!1)),navbar:e=>this.requiredResponse(this.getNavigationBarItems(e.arguments,!0)),"navbar-full":e=>this.requiredResponse(this.getNavigationBarItems(e.arguments,!1)),navtree:e=>this.requiredResponse(this.getNavigationTree(e.arguments,!0)),"navtree-full":e=>this.requiredResponse(this.getNavigationTree(e.arguments,!1)),documentHighlights:e=>this.requiredResponse(this.getDocumentHighlights(e.arguments,!0)),"documentHighlights-full":e=>this.requiredResponse(this.getDocumentHighlights(e.arguments,!1)),compilerOptionsForInferredProjects:e=>(this.setCompilerOptionsForInferredProjects(e.arguments),this.requiredResponse(!0)),projectInfo:e=>this.requiredResponse(this.getProjectInfo(e.arguments)),reloadProjects:e=>(this.projectService.reloadProjects(),this.notRequired(e)),jsxClosingTag:e=>this.requiredResponse(this.getJsxClosingTag(e.arguments)),linkedEditingRange:e=>this.requiredResponse(this.getLinkedEditingRange(e.arguments)),getCodeFixes:e=>this.requiredResponse(this.getCodeFixes(e.arguments,!0)),"getCodeFixes-full":e=>this.requiredResponse(this.getCodeFixes(e.arguments,!1)),getCombinedCodeFix:e=>this.requiredResponse(this.getCombinedCodeFix(e.arguments,!0)),"getCombinedCodeFix-full":e=>this.requiredResponse(this.getCombinedCodeFix(e.arguments,!1)),applyCodeActionCommand:e=>this.requiredResponse(this.applyCodeActionCommand(e.arguments)),getSupportedCodeFixes:e=>this.requiredResponse(this.getSupportedCodeFixes(e.arguments)),getApplicableRefactors:e=>this.requiredResponse(this.getApplicableRefactors(e.arguments)),getEditsForRefactor:e=>this.requiredResponse(this.getEditsForRefactor(e.arguments,!0)),getMoveToRefactoringFileSuggestions:e=>this.requiredResponse(this.getMoveToRefactoringFileSuggestions(e.arguments)),preparePasteEdits:e=>this.requiredResponse(this.preparePasteEdits(e.arguments)),getPasteEdits:e=>this.requiredResponse(this.getPasteEdits(e.arguments)),"getEditsForRefactor-full":e=>this.requiredResponse(this.getEditsForRefactor(e.arguments,!1)),organizeImports:e=>this.requiredResponse(this.organizeImports(e.arguments,!0)),"organizeImports-full":e=>this.requiredResponse(this.organizeImports(e.arguments,!1)),getEditsForFileRename:e=>this.requiredResponse(this.getEditsForFileRename(e.arguments,!0)),"getEditsForFileRename-full":e=>this.requiredResponse(this.getEditsForFileRename(e.arguments,!1)),configurePlugin:e=>(this.configurePlugin(e.arguments),this.notRequired(e)),selectionRange:e=>this.requiredResponse(this.getSmartSelectionRange(e.arguments,!0)),"selectionRange-full":e=>this.requiredResponse(this.getSmartSelectionRange(e.arguments,!1)),prepareCallHierarchy:e=>this.requiredResponse(this.prepareCallHierarchy(e.arguments)),provideCallHierarchyIncomingCalls:e=>this.requiredResponse(this.provideCallHierarchyIncomingCalls(e.arguments)),provideCallHierarchyOutgoingCalls:e=>this.requiredResponse(this.provideCallHierarchyOutgoingCalls(e.arguments)),toggleLineComment:e=>this.requiredResponse(this.toggleLineComment(e.arguments,!0)),"toggleLineComment-full":e=>this.requiredResponse(this.toggleLineComment(e.arguments,!1)),toggleMultilineComment:e=>this.requiredResponse(this.toggleMultilineComment(e.arguments,!0)),"toggleMultilineComment-full":e=>this.requiredResponse(this.toggleMultilineComment(e.arguments,!1)),commentSelection:e=>this.requiredResponse(this.commentSelection(e.arguments,!0)),"commentSelection-full":e=>this.requiredResponse(this.commentSelection(e.arguments,!1)),uncommentSelection:e=>this.requiredResponse(this.uncommentSelection(e.arguments,!0)),"uncommentSelection-full":e=>this.requiredResponse(this.uncommentSelection(e.arguments,!1)),provideInlayHints:e=>this.requiredResponse(this.provideInlayHints(e.arguments)),mapCode:e=>this.requiredResponse(this.mapCode(e.arguments)),copilotRelated:()=>this.requiredResponse(this.getCopilotRelatedInfo())})),this.host=e.host,this.cancellationToken=e.cancellationToken,this.typingsInstaller=e.typingsInstaller||Dge,this.byteLength=e.byteLength,this.hrtime=e.hrtime,this.logger=e.logger,this.canUseEvents=e.canUseEvents,this.suppressDiagnosticEvents=e.suppressDiagnosticEvents,this.noGetErrOnBackgroundUpdate=e.noGetErrOnBackgroundUpdate;const{throttleWaitMilliseconds:t}=e;this.eventHandler=this.canUseEvents?e.eventHandler||(e=>this.defaultEventHandler(e)):void 0;const n={executeWithRequestId:(e,t,n)=>this.executeWithRequestId(e,t,n),getCurrentRequestId:()=>this.currentRequestId,getPerformanceData:()=>this.performanceData,getServerHost:()=>this.host,logError:(e,t)=>this.logError(e,t),sendRequestCompletedEvent:(e,t)=>this.sendRequestCompletedEvent(e,t),isCancellationRequested:()=>this.cancellationToken.isCancellationRequested()};this.errorCheck=new phe(n);const r={host:this.host,logger:this.logger,cancellationToken:this.cancellationToken,useSingleInferredProject:e.useSingleInferredProject,useInferredProjectPerProjectRoot:e.useInferredProjectPerProjectRoot,typingsInstaller:this.typingsInstaller,throttleWaitMilliseconds:t,eventHandler:this.eventHandler,suppressDiagnosticEvents:this.suppressDiagnosticEvents,globalPlugins:e.globalPlugins,pluginProbeLocations:e.pluginProbeLocations,allowLocalPluginLoads:e.allowLocalPluginLoads,typesMapLocation:e.typesMapLocation,serverMode:e.serverMode,session:this,canUseWatchEvents:e.canUseWatchEvents,incrementalVerifier:e.incrementalVerifier};switch(this.projectService=new ehe(r),this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this)),this.gcTimer=new gme(this.host,7e3,this.logger),this.projectService.serverMode){case 0:break;case 1:Nhe.forEach(e=>this.handlers.set(e,e=>{throw new Error(`Request: ${e.command} not allowed in LanguageServiceMode.PartialSemantic`)}));break;case 2:Dhe.forEach(e=>this.handlers.set(e,e=>{throw new Error(`Request: ${e.command} not allowed in LanguageServiceMode.Syntactic`)}));break;default:pn.assertNever(this.projectService.serverMode)}}sendRequestCompletedEvent(e,t){this.event({request_seq:e,performanceData:t&&Ehe(t)},"requestCompleted")}addPerformanceData(e,t){this.performanceData||(this.performanceData={}),this.performanceData[e]=(this.performanceData[e]??0)+t}addDiagnosticsPerformanceData(e,t,n){var r,i;this.performanceData||(this.performanceData={});let o=null==(r=this.performanceData.diagnosticsDuration)?void 0:r.get(e);o||((i=this.performanceData).diagnosticsDuration??(i.diagnosticsDuration=new Map)).set(e,o={}),o[t]=n}performanceEventHandler(e){switch(e.kind){case"UpdateGraph":this.addPerformanceData("updateGraphDurationMs",e.durationMs);break;case"CreatePackageJsonAutoImportProvider":this.addPerformanceData("createAutoImportProviderProgramDurationMs",e.durationMs)}}defaultEventHandler(e){switch(e.eventName){case tge:this.projectsUpdatedInBackgroundEvent(e.data.openFiles);break;case nge:this.event({projectName:e.data.project.getProjectName(),reason:e.data.reason},e.eventName);break;case rge:this.event({projectName:e.data.project.getProjectName()},e.eventName);break;case ige:case lge:case _ge:case uge:this.event(e.data,e.eventName);break;case oge:this.event({triggerFile:e.data.triggerFile,configFile:e.data.configFileName,diagnostics:P(e.data.diagnostics,e=>_he(e,!0))},e.eventName);break;case age:this.event({projectName:e.data.project.getProjectName(),languageServiceEnabled:e.data.languageServiceEnabled},e.eventName);break;case sge:{const t="telemetry";this.event({telemetryEventName:e.eventName,payload:e.data},t);break}}}projectsUpdatedInBackgroundEvent(e){this.projectService.logger.info(`got projects updated in background ${e}`),e.length&&(this.suppressDiagnosticEvents||this.noGetErrOnBackgroundUpdate||(this.projectService.logger.info(`Queueing diagnostics update for ${e}`),this.errorCheck.startNew(t=>this.updateErrorCheck(t,e,100,!0))),this.event({openFiles:e},tge))}logError(e,t){this.logErrorWorker(e,t)}logErrorWorker(e,t,n){let r="Exception on executing command "+t;if(e.message&&(r+=":\n"+bG(e.message),e.stack&&(r+="\n"+bG(e.stack))),this.logger.hasLevel(3)){if(n)try{const{file:e,project:t}=this.getFileAndProject(n),i=t.getScriptInfoForNormalizedPath(e);if(i){const e=rY(i.getSnapshot());r+=`\n\nFile text of ${n.file}:${bG(e)}\n`}}catch{}if(e.ProgramFiles){r+=`\n\nProgram files: ${JSON.stringify(e.ProgramFiles)}\n`,r+="\n\nProjects::\n";let t=0;const n=e=>{r+=`\nProject '${e.projectName}' (${Ome[e.projectKind]}) ${t}\n`,r+=e.filesToString(!0),r+="\n-----------------------------------------------\n",t++};this.projectService.externalProjects.forEach(n),this.projectService.configuredProjects.forEach(n),this.projectService.inferredProjects.forEach(n)}}this.logger.msg(r,"Err")}send(e){"event"!==e.type||this.canUseEvents?this.writeMessage(e):this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${xG(e)}`)}writeMessage(e){const t=dhe(e,this.logger,this.byteLength,this.host.newLine);this.host.write(t)}event(e,t){this.send(fhe(t,e))}doOutput(e,t,n,r,i,o){const a={seq:0,type:"response",command:t,request_seq:n,success:r,performanceData:i&&Ehe(i)};if(r){let t;if(Ze(e))a.body=e,t=e.metadata,delete e.metadata;else if("object"==typeof e)if(e.metadata){const{metadata:n,...r}=e;a.body=r,t=n}else a.body=e;else a.body=e;t&&(a.metadata=t)}else pn.assert(void 0===e);o&&(a.message=o),this.send(a)}semanticCheck(e,t){var n,r;const i=Wn();null==(n=Gn)||n.push(Gn.Phase.Session,"semanticCheck",{file:e,configFilePath:t.canonicalConfigFilePath});const o=ahe(t,e)?rme:t.getLanguageService().getSemanticDiagnostics(e).filter(e=>!!e.file);this.sendDiagnosticsEvent(e,t,o,"semanticDiag",i),null==(r=Gn)||r.pop()}syntacticCheck(e,t){var n,r;const i=Wn();null==(n=Gn)||n.push(Gn.Phase.Session,"syntacticCheck",{file:e,configFilePath:t.canonicalConfigFilePath}),this.sendDiagnosticsEvent(e,t,t.getLanguageService().getSyntacticDiagnostics(e),"syntaxDiag",i),null==(r=Gn)||r.pop()}suggestionCheck(e,t){var n,r;const i=Wn();null==(n=Gn)||n.push(Gn.Phase.Session,"suggestionCheck",{file:e,configFilePath:t.canonicalConfigFilePath}),this.sendDiagnosticsEvent(e,t,t.getLanguageService().getSuggestionDiagnostics(e),"suggestionDiag",i),null==(r=Gn)||r.pop()}regionSemanticCheck(e,t,n){var r,i,o;const a=Wn();let s;null==(r=Gn)||r.push(Gn.Phase.Session,"regionSemanticCheck",{file:e,configFilePath:t.canonicalConfigFilePath}),this.shouldDoRegionCheck(e)&&(s=t.getLanguageService().getRegionSemanticDiagnostics(e,n))?(this.sendDiagnosticsEvent(e,t,s.diagnostics,"regionSemanticDiag",a,s.spans),null==(o=Gn)||o.pop()):null==(i=Gn)||i.pop()}shouldDoRegionCheck(e){var t;const n=null==(t=this.projectService.getScriptInfoForNormalizedPath(e))?void 0:t.textStorage.getLineInfo().getLineCount();return!!(n&&n>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(e,t,n,r,i,o){try{const a=pn.checkDefined(t.getScriptInfo(e)),s=Wn()-i,c={file:e,diagnostics:n.map(n=>she(e,t,n)),spans:null==o?void 0:o.map(e=>Phe(e,a))};this.event(c,r),this.addDiagnosticsPerformanceData(e,r,s)}catch(e){this.logError(e,r)}}updateErrorCheck(e,t,n,r=!0){if(0===t.length)return;pn.assert(!this.suppressDiagnosticEvents);const i=this.changeSeq,o=Math.min(n,200);let a=0;const s=()=>{if(a++,t.length>a)return e.delay("checkOne",o,l)},c=(t,n)=>{if(this.semanticCheck(t,n),this.changeSeq===i)return this.getPreferences(t).disableSuggestions?s():void e.immediate("suggestionCheck",()=>{this.suggestionCheck(t,n),s()})},l=()=>{if(this.changeSeq!==i)return;let n,o=t[a];if(tt(o)?o=this.toPendingErrorCheck(o):"ranges"in o&&(n=o.ranges,o=this.toPendingErrorCheck(o.file)),!o)return s();const{fileName:l,project:_}=o;return Uge(_),_.containsFile(l,r)&&(this.syntacticCheck(l,_),this.changeSeq===i)?0!==_.projectService.serverMode?s():n?e.immediate("regionSemanticCheck",()=>{const t=this.projectService.getScriptInfoForNormalizedPath(l);t&&this.regionSemanticCheck(l,_,n.map(e=>this.getRange({file:l,...e},t))),this.changeSeq===i&&e.immediate("semanticCheck",()=>c(l,_))}):void e.immediate("semanticCheck",()=>c(l,_)):void 0};t.length>a&&this.changeSeq===i&&e.delay("checkOne",n,l)}cleanProjects(e,t){if(t){this.logger.info(`cleaning ${e}`);for(const e of t)e.getLanguageService(!1).cleanupSemanticCache(),e.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",je(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc&&(this.logger.info("host.gc()"),this.host.gc())}getEncodedSyntacticClassifications(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);return n.getEncodedSyntacticClassifications(t,e)}getEncodedSemanticClassifications(e){const{file:t,project:n}=this.getFileAndProject(e),r="2020"===e.format?"2020":"original";return n.getLanguageService().getEncodedSemanticClassifications(t,e,r)}getProject(e){return void 0===e?void 0:this.projectService.findProject(e)}getConfigFileAndProject(e){const t=this.getProject(e.projectFileName),n=ame(e.file);return{configFile:t&&t.hasConfigFile(n)?n:void 0,project:t}}getConfigFileDiagnostics(e,t,n){const r=D(G(t.getAllProjectErrors(),t.getLanguageService().getCompilerOptionsDiagnostics()),t=>!!t.file&&t.file.fileName===e);return n?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(r):P(r,e=>_he(e,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(e){return e.map(e=>({message:vV(e.messageText,this.host.newLine),start:e.start,length:e.length,category:_i(e),code:e.code,source:e.source,startLocation:e.file&&lhe(Wa(e.file,e.start)),endLocation:e.file&&lhe(Wa(e.file,e.start+e.length)),reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,relatedInformation:P(e.relatedInformation,che)}))}getCompilerOptionsDiagnostics(e){const t=this.getProject(e.projectFileName);return this.convertToDiagnosticsWithLinePosition(D(t.getLanguageService().getCompilerOptionsDiagnostics(),e=>!e.file),void 0)}convertToDiagnosticsWithLinePosition(e,t){return e.map(e=>({message:vV(e.messageText,this.host.newLine),start:e.start,length:e.length,category:_i(e),code:e.code,source:e.source,startLocation:t&&t.positionToLineOffset(e.start),endLocation:t&&t.positionToLineOffset(e.start+e.length),reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,relatedInformation:P(e.relatedInformation,che)}))}getDiagnosticsWorker(e,t,n,r){const{project:i,file:o}=this.getFileAndProject(e);if(t&&ahe(i,o))return rme;const a=i.getScriptInfoForNormalizedPath(o),s=n(i,o);return r?this.convertToDiagnosticsWithLinePosition(s,a):s.map(e=>she(o,i,e))}getDefinition(t,n){const{file:r,project:i}=this.getFileAndProject(t),o=this.getPositionInFile(t,r),a=this.mapDefinitionInfoLocations(i.getLanguageService().getDefinitionAtPosition(r,o)||rme,i);return n?this.mapDefinitionInfo(a,i):a.map(e.mapToOriginalLocation)}mapDefinitionInfoLocations(e,t){return e.map(e=>{const n=Che(e,t);return n?{...n,containerKind:e.containerKind,containerName:e.containerName,kind:e.kind,name:e.name,failedAliasResolution:e.failedAliasResolution,...e.unverified&&{unverified:e.unverified}}:e})}getDefinitionAndBoundSpan(t,n){const{file:r,project:i}=this.getFileAndProject(t),o=this.getPositionInFile(t,r),a=pn.checkDefined(i.getScriptInfo(r)),s=i.getLanguageService().getDefinitionAndBoundSpan(r,o);if(!s||!s.definitions)return{definitions:rme,textSpan:void 0};const c=this.mapDefinitionInfoLocations(s.definitions,i),{textSpan:l}=s;return n?{definitions:this.mapDefinitionInfo(c,i),textSpan:Phe(l,a)}:{definitions:c.map(e.mapToOriginalLocation),textSpan:l}}findSourceDefinition(e){var t;const{file:n,project:r}=this.getFileAndProject(e),i=this.getPositionInFile(e,n),o=r.getLanguageService().getDefinitionAtPosition(n,i);let a=this.mapDefinitionInfoLocations(o||rme,r).slice();if(0===this.projectService.serverMode&&(!H(a,e=>ame(e.fileName)!==n&&!e.isAmbient)||H(a,e=>!!e.failedAliasResolution))){const e=Ye(e=>e.textSpan.start,PY(this.host.useCaseSensitiveFileNames));null==a||a.forEach(t=>e.add(t));const o=r.getNoDtsResolutionProject(n),_=o.getLanguageService(),u=null==(t=_.getDefinitionAtPosition(n,i,!0,!1))?void 0:t.filter(e=>ame(e.fileName)!==n);if(H(u))for(const t of u){if(t.unverified){const n=c(t,r.getLanguageService().getProgram(),_.getProgram());if(H(n)){for(const t of n)e.add(t);continue}}e.add(t)}else{const t=a.filter(e=>ame(e.fileName)!==n&&e.isAmbient);for(const a of H(t)?t:function(){const e=r.getLanguageService(),t=e.getProgram(),o=sQ(t.getSourceFile(n),i);if((Ju(o)||uD(o))&&Dx(o.parent))return Ax(o,t=>{var r;if(t===o)return;const i=null==(r=e.getDefinitionAtPosition(n,t.getStart(),!0,!1))?void 0:r.filter(e=>ame(e.fileName)!==n&&e.isAmbient).map(e=>({fileName:e.fileName,name:$h(o)}));return H(i)?i:void 0})||rme;return rme}()){const t=s(a.fileName,n,o);if(!t)continue;const r=this.projectService.getOrCreateScriptInfoNotOpenedByClient(t,o.currentDirectory,o.directoryStructureHost,!1);if(!r)continue;o.containsScriptInfo(r)||(o.addRoot(r),o.updateGraph());const i=_.getProgram(),c=pn.checkDefined(i.getSourceFile(t));for(const t of l(a.name,c,i))e.add(t)}}a=je(e.values())}return a=a.filter(e=>!e.isAmbient&&!e.failedAliasResolution),this.mapDefinitionInfo(a,r);function s(e,t,n){var i,o,a;const s=KT(e);if(s&&e.lastIndexOf(oR)===s.topLevelNodeModulesIndex){const c=e.substring(0,s.packageRootIndex),l=null==(i=r.getModuleResolutionCache())?void 0:i.getPackageJsonInfoCache(),_=r.getCompilationSettings(),u=bR(Uo(c,r.getCurrentDirectory()),vR(l,r,_));if(!u)return;const d=hR(u,{moduleResolution:2},r,r.getModuleResolutionCache()),p=UR(VR(e.substring(s.topLevelPackageNameIndex+1,s.packageRootIndex))),f=r.toPath(e);if(d&&H(d,e=>r.toPath(e)===f))return null==(o=n.resolutionCache.resolveSingleModuleNameWithoutWatching(p,t).resolvedModule)?void 0:o.resolvedFileName;{const r=`${p}/${KS(e.substring(s.packageRootIndex+1))}`;return null==(a=n.resolutionCache.resolveSingleModuleNameWithoutWatching(r,t).resolvedModule)?void 0:a.resolvedFileName}}}function c(e,t,r){var o;const a=r.getSourceFile(e.fileName);if(!a)return;const s=sQ(t.getSourceFile(n),i),c=t.getTypeChecker().getSymbolAtLocation(s),_=c&&Qu(c,277);if(!_)return;return l((null==(o=_.propertyName)?void 0:o.text)||_.name.text,a,r)}function l(e,t,n){return J(jce.Core.getTopMostDeclarationNamesInFile(e,t),e=>{const t=n.getTypeChecker().getSymbolAtLocation(e),r=fh(e);if(t&&r)return Sle.createDefinitionInfo(r,n.getTypeChecker(),t,r,!0)})}}getEmitOutput(e){const{file:t,project:n}=this.getFileAndProject(e);if(!n.shouldEmitFile(n.getScriptInfo(t)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};const r=n.getLanguageService().getEmitOutput(t);return e.richResponse?{...r,diagnostics:e.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(r.diagnostics):r.diagnostics.map(e=>_he(e,!0))}:r}mapJSDocTagInfo(e,t,n){return e?e.map(e=>{var r;return{...e,text:n?this.mapDisplayParts(e.text,t):null==(r=e.text)?void 0:r.map(e=>e.text).join("")}}):[]}mapDisplayParts(e,t){return e?e.map(e=>"linkName"!==e.kind?e:{...e,target:this.toFileSpan(e.target.fileName,e.target.textSpan,t)}):[]}mapSignatureHelpItems(e,t,n){return e.map(e=>({...e,documentation:this.mapDisplayParts(e.documentation,t),parameters:e.parameters.map(e=>({...e,documentation:this.mapDisplayParts(e.documentation,t)})),tags:this.mapJSDocTagInfo(e.tags,t,n)}))}mapDefinitionInfo(e,t){return e.map(e=>({...this.toFileSpanWithContext(e.fileName,e.textSpan,e.contextSpan,t),...e.unverified&&{unverified:e.unverified}}))}static mapToOriginalLocation(e){return e.originalFileName?(pn.assert(void 0!==e.originalTextSpan,"originalTextSpan should be present if originalFileName is"),{...e,fileName:e.originalFileName,textSpan:e.originalTextSpan,targetFileName:e.fileName,targetTextSpan:e.textSpan,contextSpan:e.originalContextSpan,targetContextSpan:e.contextSpan}):e}toFileSpan(e,t,n){const r=n.getLanguageService(),i=r.toLineColumnOffset(e,t.start),o=r.toLineColumnOffset(e,Is(t));return{file:e,start:{line:i.line+1,offset:i.character+1},end:{line:o.line+1,offset:o.character+1}}}toFileSpanWithContext(e,t,n,r){const i=this.toFileSpan(e,t,r),o=n&&this.toFileSpan(e,n,r);return o?{...i,contextStart:o.start,contextEnd:o.end}:i}getTypeDefinition(e){const{file:t,project:n}=this.getFileAndProject(e),r=this.getPositionInFile(e,t),i=this.mapDefinitionInfoLocations(n.getLanguageService().getTypeDefinitionAtPosition(t,r)||rme,n);return this.mapDefinitionInfo(i,n)}mapImplementationLocations(e,t){return e.map(e=>{const n=Che(e,t);return n?{...n,kind:e.kind,displayParts:e.displayParts}:e})}getImplementation(t,n){const{file:r,project:i}=this.getFileAndProject(t),o=this.getPositionInFile(t,r),a=this.mapImplementationLocations(i.getLanguageService().getImplementationAtPosition(r,o)||rme,i);return n?a.map(({fileName:e,textSpan:t,contextSpan:n})=>this.toFileSpanWithContext(e,t,n,i)):a.map(e.mapToOriginalLocation)}getSyntacticDiagnosticsSync(e){const{configFile:t}=this.getConfigFileAndProject(e);return t?rme:this.getDiagnosticsWorker(e,!1,(e,t)=>e.getLanguageService().getSyntacticDiagnostics(t),!!e.includeLinePosition)}getSemanticDiagnosticsSync(e){const{configFile:t,project:n}=this.getConfigFileAndProject(e);return t?this.getConfigFileDiagnostics(t,n,!!e.includeLinePosition):this.getDiagnosticsWorker(e,!0,(e,t)=>e.getLanguageService().getSemanticDiagnostics(t).filter(e=>!!e.file),!!e.includeLinePosition)}getSuggestionDiagnosticsSync(e){const{configFile:t}=this.getConfigFileAndProject(e);return t?rme:this.getDiagnosticsWorker(e,!0,(e,t)=>e.getLanguageService().getSuggestionDiagnostics(t),!!e.includeLinePosition)}getJsxClosingTag(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t),i=n.getJsxClosingTagAtPosition(t,r);return void 0===i?void 0:{newText:i.newText,caretOffset:0}}getLinkedEditingRange(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t),i=n.getLinkedEditingRangeAtPosition(t,r),o=this.projectService.getScriptInfoForNormalizedPath(t);if(void 0!==o&&void 0!==i)return function(e,t){const n=e.ranges.map(e=>({start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(e.start+e.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}(i,o)}getDocumentHighlights(e,t){const{file:n,project:r}=this.getFileAndProject(e),i=this.getPositionInFile(e,n),o=r.getLanguageService().getDocumentHighlights(n,i,e.filesToSearch);return o?t?o.map(({fileName:e,highlightSpans:t})=>{const n=r.getScriptInfo(e);return{file:e,highlightSpans:t.map(({textSpan:e,kind:t,contextSpan:r})=>({...Ahe(e,r,n),kind:t}))}}):o:rme}provideInlayHints(e){const{file:t,project:n}=this.getFileAndProject(e),r=this.projectService.getScriptInfoForNormalizedPath(t);return n.getLanguageService().provideInlayHints(t,e,this.getPreferences(t)).map(e=>{const{position:t,displayParts:n}=e;return{...e,position:r.positionToLineOffset(t),displayParts:null==n?void 0:n.map(({text:e,span:t,file:n})=>{if(t){pn.assertIsDefined(n,"Target file should be defined together with its span.");const r=this.projectService.getScriptInfo(n);return{text:e,span:{start:r.positionToLineOffset(t.start),end:r.positionToLineOffset(t.start+t.length),file:n}}}return{text:e}})}})}mapCode(e){var t;const n=this.getHostFormatOptions(),r=this.getHostPreferences(),{file:i,languageService:o}=this.getFileAndLanguageServiceForSyntacticOperation(e),a=this.projectService.getScriptInfoForNormalizedPath(i),s=null==(t=e.mapping.focusLocations)?void 0:t.map(e=>e.map(e=>{const t=a.lineOffsetToPosition(e.start.line,e.start.offset);return{start:t,length:a.lineOffsetToPosition(e.end.line,e.end.offset)-t}})),c=o.mapCode(i,e.mapping.contents,s,n,r);return this.mapTextChangesToCodeEdits(c)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(e){this.projectService.setCompilerOptionsForInferredProjects(e.options,e.projectRootPath)}getProjectInfo(e){return this.getProjectInfoWorker(e.file,e.projectFileName,e.needFileNameList,e.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(e,t,n,r,i){const{project:o}=this.getFileAndProjectWorker(e,t);Uge(o);return{configFileName:o.getProjectName(),languageServiceDisabled:!o.languageServiceEnabled,fileNames:n?o.getFileNames(!1,i):void 0,configuredProjectInfo:r?this.getDefaultConfiguredProjectInfo(e):void 0}}getDefaultConfiguredProjectInfo(e){var t;const n=this.projectService.getScriptInfo(e);if(!n)return;const r=this.projectService.findDefaultConfiguredProjectWorker(n,3);if(!r)return;let i,o;return r.seenProjects.forEach((e,t)=>{t!==r.defaultProject&&(3!==e?(i??(i=[])).push(ame(t.getConfigFilePath())):(o??(o=[])).push(ame(t.getConfigFilePath())))}),null==(t=r.seenConfigs)||t.forEach(e=>(i??(i=[])).push(e)),{notMatchedByConfig:i,notInProject:o,defaultProject:r.defaultProject&&ame(r.defaultProject.getConfigFilePath())}}getRenameInfo(e){const{file:t,project:n}=this.getFileAndProject(e),r=this.getPositionInFile(e,t),i=this.getPreferences(t);return n.getLanguageService().getRenameInfo(t,r,i)}getProjects(e,t,n){let r,i;if(e.projectFileName){const t=this.getProject(e.projectFileName);t&&(r=[t])}else{const o=t?this.projectService.getScriptInfoEnsuringProjectsUptoDate(e.file):this.projectService.getScriptInfo(e.file);if(!o)return n?rme:(this.projectService.logErrorForScriptInfoNotFound(e.file),eme.ThrowNoProject());t||this.projectService.ensureDefaultProjectForFile(o),r=o.containingProjects,i=this.projectService.getSymlinkedProjects(o)}return r=D(r,e=>e.languageServiceEnabled&&!e.isOrphan()),n||r&&r.length||i?i?{projects:r,symLinkedProjects:i}:r:(this.projectService.logErrorForScriptInfoNotFound(e.file??e.projectFileName),eme.ThrowNoProject())}getDefaultProject(e){if(e.projectFileName){const t=this.getProject(e.projectFileName);if(t)return t;if(!e.file)return eme.ThrowNoProject()}return this.projectService.getScriptInfo(e.file).getDefaultProject()}getRenameLocations(e,t){const n=ame(e.file),r=this.getPositionInFile(e,n),i=this.getProjects(e),o=this.getDefaultProject(e),a=this.getPreferences(n),s=this.mapRenameInfo(o.getLanguageService().getRenameInfo(n,r,a),pn.checkDefined(this.projectService.getScriptInfo(n)));if(!s.canRename)return t?{info:s,locs:[]}:[];const c=function(e,t,n,r,i,o,a){const s=yhe(e,t,n,ghe(t,n,!0),bhe,(e,t)=>e.getLanguageService().findRenameLocations(t.fileName,t.pos,r,i,o),(e,t)=>t(She(e)));if(Ze(s))return s;const c=[],l=mhe(a);return s.forEach((e,t)=>{for(const n of e)l.has(n)||The(She(n),t)||(c.push(n),l.add(n))}),c}(i,o,{fileName:e.file,pos:r},!!e.findInStrings,!!e.findInComments,a,this.host.useCaseSensitiveFileNames);return t?{info:s,locs:this.toSpanGroups(c)}:c}mapRenameInfo(e,t){if(e.canRename){const{canRename:n,fileToRename:r,displayName:i,fullDisplayName:o,kind:a,kindModifiers:s,triggerSpan:c}=e;return{canRename:n,fileToRename:r,displayName:i,fullDisplayName:o,kind:a,kindModifiers:s,triggerSpan:Phe(c,t)}}return e}toSpanGroups(e){const t=new Map;for(const{fileName:n,textSpan:r,contextSpan:i,originalContextSpan:o,originalTextSpan:a,originalFileName:s,...c}of e){let e=t.get(n);e||t.set(n,e={file:n,locs:[]});const o=pn.checkDefined(this.projectService.getScriptInfo(n));e.locs.push({...Ahe(r,i,o),...c})}return je(t.values())}getReferences(e,t){const n=ame(e.file),r=this.getProjects(e),i=this.getPositionInFile(e,n),o=function(e,t,n,r,i){var o,a;const s=yhe(e,t,n,ghe(t,n,!1),bhe,(e,t)=>(i.info(`Finding references to ${t.fileName} position ${t.pos} in project ${e.getProjectName()}`),e.getLanguageService().findReferences(t.fileName,t.pos)),(e,t)=>{t(She(e.definition));for(const n of e.references)t(She(n))});if(Ze(s))return s;const c=s.get(t);if(void 0===(null==(a=null==(o=null==c?void 0:c[0])?void 0:o.references[0])?void 0:a.isDefinition))s.forEach(e=>{for(const t of e)for(const e of t.references)delete e.isDefinition});else{const e=mhe(r);for(const t of c)for(const n of t.references)if(n.isDefinition){e.add(n);break}const t=new Set;for(;;){let n=!1;if(s.forEach((r,i)=>{t.has(i)||i.getLanguageService().updateIsDefinitionOfReferencedSymbols(r,e)&&(t.add(i),n=!0)}),!n)break}s.forEach((e,n)=>{if(!t.has(n))for(const t of e)for(const e of t.references)e.isDefinition=!1})}const l=[],_=mhe(r);return s.forEach((e,t)=>{for(const n of e){const e=The(She(n.definition),t),i=void 0===e?n.definition:{...n.definition,textSpan:Gs(e.pos,n.definition.textSpan.length),fileName:e.fileName,contextSpan:whe(n.definition,t)};let o=x(l,e=>EY(e.definition,i,r));o||(o={definition:i,references:[]},l.push(o));for(const e of n.references)_.has(e)||The(She(e),t)||(_.add(e),o.references.push(e))}}),l.filter(e=>0!==e.references.length)}(r,this.getDefaultProject(e),{fileName:e.file,pos:i},this.host.useCaseSensitiveFileNames,this.logger);if(!t)return o;const a=this.getPreferences(n),s=this.getDefaultProject(e),c=s.getScriptInfoForNormalizedPath(n),l=s.getLanguageService().getQuickInfoAtPosition(n,i),_=l?n7(l.displayParts):"",u=l&&l.textSpan,d=u?c.positionToLineOffset(u.start).offset:0,p=u?c.getSnapshot().getText(u.start,Is(u)):"";return{refs:L(o,e=>e.references.map(e=>Lhe(this.projectService,e,a))),symbolName:p,symbolStartOffset:d,symbolDisplayString:_}}getFileReferences(e,t){const n=this.getProjects(e),r=ame(e.file),i=this.getPreferences(r),o={fileName:r,pos:0},a=yhe(n,this.getDefaultProject(e),o,o,vhe,e=>(this.logger.info(`Finding references to file ${r} in project ${e.getProjectName()}`),e.getLanguageService().getFileReferences(r)));let s;if(Ze(a))s=a;else{s=[];const e=mhe(this.host.useCaseSensitiveFileNames);a.forEach(t=>{for(const n of t)e.has(n)||(s.push(n),e.add(n))})}if(!t)return s;return{refs:s.map(e=>Lhe(this.projectService,e,i)),symbolName:`"${e.file}"`}}openClientFile(e,t,n,r){this.projectService.openClientFileWithNormalizedPath(e,t,n,!1,r)}getPosition(e,t){return void 0!==e.position?e.position:t.lineOffsetToPosition(e.line,e.offset)}getPositionInFile(e,t){const n=this.projectService.getScriptInfoForNormalizedPath(t);return this.getPosition(e,n)}getFileAndProject(e){return this.getFileAndProjectWorker(e.file,e.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(e){const{file:t,project:n}=this.getFileAndProject(e);return{file:t,languageService:n.getLanguageService(!1)}}getFileAndProjectWorker(e,t){const n=ame(e);return{file:n,project:this.getProject(t)||this.projectService.ensureDefaultProjectForFile(n)}}getOutliningSpans(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=r.getOutliningSpans(n);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return i.map(t=>({textSpan:Phe(t.textSpan,e),hintSpan:Phe(t.hintSpan,e),bannerText:t.bannerText,autoCollapse:t.autoCollapse,kind:t.kind}))}return i}getTodoComments(e){const{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().getTodoComments(t,e.descriptors)}getDocCommentTemplate(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.getDocCommentTemplateAtPosition(t,r,this.getPreferences(t),this.getFormatOptions(t))}getSpanOfEnclosingComment(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.onlyMultiLine,i=this.getPositionInFile(e,t);return n.getSpanOfEnclosingComment(t,i,r)}getIndentation(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t),i=e.options?yge(e.options):this.getFormatOptions(t);return{position:r,indentation:n.getIndentationAtPosition(t,r,i)}}getBreakpointStatement(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.getBreakpointStatementAtPosition(t,r)}getNameOrDottedNameSpan(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.getNameOrDottedNameSpan(t,r,r)}isValidBraceCompletion(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.isValidBraceCompletionAtPosition(t,r,e.openingBrace.charCodeAt(0))}getQuickInfoWorker(e,t){const{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getPreferences(n),a=r.getLanguageService().getQuickInfoAtPosition(n,this.getPosition(e,i),o.maximumHoverLength,e.verbosityLevel);if(!a)return;const s=!!o.displayPartsForJSDoc;if(t){const e=n7(a.displayParts);return{kind:a.kind,kindModifiers:a.kindModifiers,start:i.positionToLineOffset(a.textSpan.start),end:i.positionToLineOffset(Is(a.textSpan)),displayString:e,documentation:s?this.mapDisplayParts(a.documentation,r):n7(a.documentation),tags:this.mapJSDocTagInfo(a.tags,r,s),canIncreaseVerbosityLevel:a.canIncreaseVerbosityLevel}}return s?a:{...a,tags:this.mapJSDocTagInfo(a.tags,r,!1)}}getFormattingEditsForRange(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.projectService.getScriptInfoForNormalizedPath(t),i=r.lineOffsetToPosition(e.line,e.offset),o=r.lineOffsetToPosition(e.endLine,e.endOffset),a=n.getFormattingEditsForRange(t,i,o,this.getFormatOptions(t));if(a)return a.map(e=>this.convertTextChangeToCodeEdit(e,r))}getFormattingEditsForRangeFull(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.options?yge(e.options):this.getFormatOptions(t);return n.getFormattingEditsForRange(t,e.position,e.endPosition,r)}getFormattingEditsForDocumentFull(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.options?yge(e.options):this.getFormatOptions(t);return n.getFormattingEditsForDocument(t,r)}getFormattingEditsAfterKeystrokeFull(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.options?yge(e.options):this.getFormatOptions(t);return n.getFormattingEditsAfterKeystroke(t,e.position,e.key,r)}getFormattingEditsAfterKeystroke(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.projectService.getScriptInfoForNormalizedPath(t),i=r.lineOffsetToPosition(e.line,e.offset),o=this.getFormatOptions(t),a=n.getFormattingEditsAfterKeystroke(t,i,e.key,o);if("\n"===e.key&&(!a||0===a.length||function(e,t){return e.every(e=>Is(e.span)({start:r.positionToLineOffset(e.span.start),end:r.positionToLineOffset(Is(e.span)),newText:e.newText?e.newText:""}))}getCompletions(e,t){const{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getPosition(e,i),a=r.getLanguageService().getCompletionsAtPosition(n,o,{...Tge(this.getPreferences(n)),triggerCharacter:e.triggerCharacter,triggerKind:e.triggerKind,includeExternalModuleExports:e.includeExternalModuleExports,includeInsertTextCompletions:e.includeInsertTextCompletions},r.projectService.getFormatCodeOptions(n));if(void 0===a)return;if("completions-full"===t)return a;const s=e.prefix||"",c=J(a.entries,e=>{if(a.isMemberCompletion||Qt(e.name.toLowerCase(),s.toLowerCase())){const t=e.replacementSpan?Phe(e.replacementSpan,i):void 0;return{...e,replacementSpan:t,hasAction:e.hasAction||void 0,symbol:void 0}}});if("completions"===t)return a.metadata&&(c.metadata=a.metadata),c;return{...a,optionalReplacementSpan:a.optionalReplacementSpan&&Phe(a.optionalReplacementSpan,i),entries:c}}getCompletionEntryDetails(e,t){const{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getPosition(e,i),a=r.projectService.getFormatCodeOptions(n),s=!!this.getPreferences(n).displayPartsForJSDoc,c=J(e.entryNames,e=>{const{name:t,source:i,data:s}="string"==typeof e?{name:e,source:void 0,data:void 0}:e;return r.getLanguageService().getCompletionEntryDetails(n,o,t,a,i,this.getPreferences(n),s?it(s,jhe):void 0)});return t?s?c:c.map(e=>({...e,tags:this.mapJSDocTagInfo(e.tags,r,!1)})):c.map(e=>({...e,codeActions:P(e.codeActions,e=>this.mapCodeAction(e)),documentation:this.mapDisplayParts(e.documentation,r),tags:this.mapJSDocTagInfo(e.tags,r,s)}))}getCompileOnSaveAffectedFileList(e){const t=this.getProjects(e,!0,!0),n=this.projectService.getScriptInfo(e.file);return n?function(e,t,n,r){const i=j(Ze(n)?n:n.projects,t=>r(t,e));return!Ze(n)&&n.symLinkedProjects&&n.symLinkedProjects.forEach((e,n)=>{const o=t(n);i.push(...L(e,e=>r(e,o)))}),Z(i,ht)}(n,e=>this.projectService.getScriptInfoForPath(e),t,(e,t)=>{if(!e.compileOnSaveEnabled||!e.languageServiceEnabled||e.isOrphan())return;const n=e.getCompilationSettings();return n.noEmit||vO(t.fileName)&&!function(e){return Ik(e)||!!e.emitDecoratorMetadata}(n)?void 0:{projectFileName:e.getProjectName(),fileNames:e.getCompileOnSaveAffectedFileList(t),projectUsesOutFile:!!n.outFile}}):rme}emitFile(e){const{file:t,project:n}=this.getFileAndProject(e);if(n||eme.ThrowNoProject(),!n.languageServiceEnabled)return!!e.richResponse&&{emitSkipped:!0,diagnostics:[]};const r=n.getScriptInfo(t),{emitSkipped:i,diagnostics:o}=n.emitFile(r,(e,t,n)=>this.host.writeFile(e,t,n));return e.richResponse?{emitSkipped:i,diagnostics:e.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(o):o.map(e=>_he(e,!0))}:!i}getSignatureHelpItems(e,t){const{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getPosition(e,i),a=r.getLanguageService().getSignatureHelpItems(n,o,e),s=!!this.getPreferences(n).displayPartsForJSDoc;if(a&&t){const e=a.applicableSpan;return{...a,applicableSpan:{start:i.positionToLineOffset(e.start),end:i.positionToLineOffset(e.start+e.length)},items:this.mapSignatureHelpItems(a.items,r,s)}}return s||!a?a:{...a,items:a.items.map(e=>({...e,tags:this.mapJSDocTagInfo(e.tags,r,!1)}))}}toPendingErrorCheck(e){const t=ame(e),n=this.projectService.tryGetDefaultProjectForFile(t);return n&&{fileName:t,project:n}}getDiagnostics(e,t,n){this.suppressDiagnosticEvents||n.length>0&&this.updateErrorCheck(e,n,t)}change(e){const t=this.projectService.getScriptInfo(e.file);pn.assert(!!t),t.textStorage.switchToScriptVersionCache();const n=t.lineOffsetToPosition(e.line,e.offset),r=t.lineOffsetToPosition(e.endLine,e.endOffset);n>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(t,V({span:{start:n,length:r-n},newText:e.insertString})))}reload(e){const t=ame(e.file),n=void 0===e.tmpfile?void 0:ame(e.tmpfile),r=this.projectService.getScriptInfoForNormalizedPath(t);r&&(this.changeSeq++,r.reloadFromFile(n))}saveToTmp(e,t){const n=this.projectService.getScriptInfo(e);n&&n.saveTo(t)}closeClientFile(e){if(!e)return;const t=Vo(e);this.projectService.closeClientFile(t)}mapLocationNavigationBarItems(e,t){return P(e,e=>({text:e.text,kind:e.kind,kindModifiers:e.kindModifiers,spans:e.spans.map(e=>Phe(e,t)),childItems:this.mapLocationNavigationBarItems(e.childItems,t),indent:e.indent}))}getNavigationBarItems(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=r.getNavigationBarItems(n);return i?t?this.mapLocationNavigationBarItems(i,this.projectService.getScriptInfoForNormalizedPath(n)):i:void 0}toLocationNavigationTree(e,t){return{text:e.text,kind:e.kind,kindModifiers:e.kindModifiers,spans:e.spans.map(e=>Phe(e,t)),nameSpan:e.nameSpan&&Phe(e.nameSpan,t),childItems:P(e.childItems,e=>this.toLocationNavigationTree(e,t))}}getNavigationTree(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=r.getNavigationTree(n);return i?t?this.toLocationNavigationTree(i,this.projectService.getScriptInfoForNormalizedPath(n)):i:void 0}getNavigateToItems(e,t){const n=this.getFullNavigateToItems(e);return L(n,t?({project:e,navigateToItems:t})=>t.map(t=>{const n=e.getScriptInfo(t.fileName),r={name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,isCaseSensitive:t.isCaseSensitive,matchKind:t.matchKind,file:t.fileName,start:n.positionToLineOffset(t.textSpan.start),end:n.positionToLineOffset(Is(t.textSpan))};return t.kindModifiers&&""!==t.kindModifiers&&(r.kindModifiers=t.kindModifiers),t.containerName&&t.containerName.length>0&&(r.containerName=t.containerName),t.containerKind&&t.containerKind.length>0&&(r.containerKind=t.containerKind),r}):({navigateToItems:e})=>e)}getFullNavigateToItems(e){const{currentFileOnly:t,searchValue:n,maxResultCount:r,projectFileName:i}=e;if(t){pn.assertIsDefined(e.file);const{file:t,project:i}=this.getFileAndProject(e);return[{project:i,navigateToItems:i.getLanguageService().getNavigateToItems(n,r,t)}]}const o=this.getHostPreferences(),a=[],s=new Map;if(e.file||i){hhe(this.getProjects(e),void 0,e=>c(e))}else this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(e=>c(e));return a;function c(e){const t=D(e.getLanguageService().getNavigateToItems(n,r,void 0,e.isNonTsProject(),o.excludeLibrarySymbolsInNavTo),t=>function(e){const t=e.name;if(!s.has(t))return s.set(t,[e]),!0;const n=s.get(t);for(const t of n)if(l(t,e))return!1;return n.push(e),!0}(t)&&!The(She(t),e));t.length&&a.push({project:e,navigateToItems:t})}function l(e,t){return e===t||!(!e||!t)&&(e.containerKind===t.containerKind&&e.containerName===t.containerName&&e.fileName===t.fileName&&e.isCaseSensitive===t.isCaseSensitive&&e.kind===t.kind&&e.kindModifiers===t.kindModifiers&&e.matchKind===t.matchKind&&e.name===t.name&&e.textSpan.start===t.textSpan.start&&e.textSpan.length===t.textSpan.length)}}getSupportedCodeFixes(e){if(!e)return i7();if(e.file){const{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().getSupportedCodeFixes(t)}const t=this.getProject(e.projectFileName);return t||eme.ThrowNoProject(),t.getLanguageService().getSupportedCodeFixes()}isLocation(e){return void 0!==e.line}extractPositionOrRange(e,t){let n,r;var i;return this.isLocation(e)?n=void 0!==(i=e).position?i.position:t.lineOffsetToPosition(i.line,i.offset):r=this.getRange(e,t),pn.checkDefined(void 0===n?r:n)}getRange(e,t){const{startPosition:n,endPosition:r}=this.getStartAndEndPosition(e,t);return{pos:n,end:r}}getApplicableRefactors(e){const{file:t,project:n}=this.getFileAndProject(e),r=n.getScriptInfoForNormalizedPath(t);return n.getLanguageService().getApplicableRefactors(t,this.extractPositionOrRange(e,r),this.getPreferences(t),e.triggerReason,e.kind,e.includeInteractiveActions).map(e=>({...e,actions:e.actions.map(e=>({...e,range:e.range?{start:lhe({line:e.range.start.line,character:e.range.start.offset}),end:lhe({line:e.range.end.line,character:e.range.end.offset})}:void 0}))}))}getEditsForRefactor(e,t){const{file:n,project:r}=this.getFileAndProject(e),i=r.getScriptInfoForNormalizedPath(n),o=r.getLanguageService().getEditsForRefactor(n,this.getFormatOptions(n),this.extractPositionOrRange(e,i),e.refactor,e.action,this.getPreferences(n),e.interactiveRefactorArguments);if(void 0===o)return{edits:[]};if(t){const{renameFilename:e,renameLocation:t,edits:n}=o;let i;if(void 0!==e&&void 0!==t){i=Ohe(rY(r.getScriptInfoForNormalizedPath(ame(e)).getSnapshot()),e,t,n)}return{renameLocation:i,renameFilename:e,edits:this.mapTextChangesToCodeEdits(n),notApplicableReason:o.notApplicableReason}}return o}getMoveToRefactoringFileSuggestions(e){const{file:t,project:n}=this.getFileAndProject(e),r=n.getScriptInfoForNormalizedPath(t);return n.getLanguageService().getMoveToRefactoringFileSuggestions(t,this.extractPositionOrRange(e,r),this.getPreferences(t))}preparePasteEdits(e){const{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().preparePasteEditsForFile(t,e.copiedTextSpan.map(e=>this.getRange({file:t,startLine:e.start.line,startOffset:e.start.offset,endLine:e.end.line,endOffset:e.end.offset},this.projectService.getScriptInfoForNormalizedPath(t))))}getPasteEdits(e){const{file:t,project:n}=this.getFileAndProject(e);if(Eme(t))return;const r=e.copiedFrom?{file:e.copiedFrom.file,range:e.copiedFrom.spans.map(t=>this.getRange({file:e.copiedFrom.file,startLine:t.start.line,startOffset:t.start.offset,endLine:t.end.line,endOffset:t.end.offset},n.getScriptInfoForNormalizedPath(ame(e.copiedFrom.file))))}:void 0,i=n.getLanguageService().getPasteEdits({targetFile:t,pastedText:e.pastedText,pasteLocations:e.pasteLocations.map(e=>this.getRange({file:t,startLine:e.start.line,startOffset:e.start.offset,endLine:e.end.line,endOffset:e.end.offset},n.getScriptInfoForNormalizedPath(t))),copiedFrom:r,preferences:this.getPreferences(t)},this.getFormatOptions(t));return i&&this.mapPasteEditsAction(i)}organizeImports(e,t){pn.assert("file"===e.scope.type);const{file:n,project:r}=this.getFileAndProject(e.scope.args),i=r.getLanguageService().organizeImports({fileName:n,mode:e.mode??(e.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(n),this.getPreferences(n));return t?this.mapTextChangesToCodeEdits(i):i}getEditsForFileRename(e,t){const n=ame(e.oldFilePath),r=ame(e.newFilePath),i=this.getHostFormatOptions(),o=this.getHostPreferences(),a=new Set,s=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(e=>{const t=e.getLanguageService().getEditsForFileRename(n,r,i,o),c=[];for(const e of t)a.has(e.fileName)||(s.push(e),c.push(e.fileName));for(const e of c)a.add(e)}),t?s.map(e=>this.mapTextChangeToCodeEdit(e)):s}getCodeFixes(e,t){const{file:n,project:r}=this.getFileAndProject(e),i=r.getScriptInfoForNormalizedPath(n),{startPosition:o,endPosition:a}=this.getStartAndEndPosition(e,i);let s;try{s=r.getLanguageService().getCodeFixesAtPosition(n,o,a,e.errorCodes,this.getFormatOptions(n),this.getPreferences(n))}catch(t){const i=t instanceof Error?t:new Error(t),s=r.getLanguageService(),c=[...s.getSyntacticDiagnostics(n),...s.getSemanticDiagnostics(n),...s.getSuggestionDiagnostics(n)].filter(e=>Vs(o,a-o,e.start,e.length)).map(e=>e.code),l=e.errorCodes.find(e=>!c.includes(e));throw void 0!==l&&(i.message+=`\nAdditional information: BADCLIENT: Bad error code, ${l} not found in range ${o}..${a} (found: ${c.join(", ")})`),i}return t?s.map(e=>this.mapCodeFixAction(e)):s}getCombinedCodeFix({scope:e,fixId:t},n){pn.assert("file"===e.type);const{file:r,project:i}=this.getFileAndProject(e.args),o=i.getLanguageService().getCombinedCodeFix({type:"file",fileName:r},t,this.getFormatOptions(r),this.getPreferences(r));return n?{changes:this.mapTextChangesToCodeEdits(o.changes),commands:o.commands}:o}applyCodeActionCommand(e){const t=e.command;for(const e of et(t)){const{file:t,project:n}=this.getFileAndProject(e);n.getLanguageService().applyCodeActionCommand(e,this.getFormatOptions(t)).then(e=>{},e=>{})}return{}}getStartAndEndPosition(e,t){let n,r;return void 0!==e.startPosition?n=e.startPosition:(n=t.lineOffsetToPosition(e.startLine,e.startOffset),e.startPosition=n),void 0!==e.endPosition?r=e.endPosition:(r=t.lineOffsetToPosition(e.endLine,e.endOffset),e.endPosition=r),{startPosition:n,endPosition:r}}mapCodeAction({description:e,changes:t,commands:n}){return{description:e,changes:this.mapTextChangesToCodeEdits(t),commands:n}}mapCodeFixAction({fixName:e,description:t,changes:n,commands:r,fixId:i,fixAllDescription:o}){return{fixName:e,description:t,changes:this.mapTextChangesToCodeEdits(n),commands:r,fixId:i,fixAllDescription:o}}mapPasteEditsAction({edits:e,fixId:t}){return{edits:this.mapTextChangesToCodeEdits(e),fixId:t}}mapTextChangesToCodeEdits(e){return e.map(e=>this.mapTextChangeToCodeEdit(e))}mapTextChangeToCodeEdit(e){const t=this.projectService.getScriptInfoOrConfig(e.fileName);return!!e.isNewFile==!!t&&(t||this.projectService.logErrorForScriptInfoNotFound(e.fileName),pn.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!e.isNewFile,hasScriptInfo:!!t}))),t?{fileName:e.fileName,textChanges:e.textChanges.map(e=>function(e,t){return{start:Ihe(t,e.span.start),end:Ihe(t,Is(e.span)),newText:e.newText}}(e,t))}:function(e){pn.assert(1===e.textChanges.length);const t=ye(e.textChanges);return pn.assert(0===t.span.start&&0===t.span.length),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}(e)}convertTextChangeToCodeEdit(e,t){return{start:t.positionToLineOffset(e.span.start),end:t.positionToLineOffset(e.span.start+e.span.length),newText:e.newText?e.newText:""}}getBraceMatching(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getPosition(e,i),a=r.getBraceMatchingAtPosition(n,o);return a?t?a.map(e=>Phe(e,i)):a:void 0}getDiagnosticsForProject(e,t,n){if(this.suppressDiagnosticEvents)return;const{fileNames:r,languageServiceDisabled:i}=this.getProjectInfoWorker(n,void 0,!0,void 0,!0);if(i)return;const o=r.filter(e=>!e.includes("lib.d.ts"));if(0===o.length)return;const a=[],s=[],c=[],l=[],_=ame(n),u=this.projectService.ensureDefaultProjectForFile(_);for(const e of o)if(this.getCanonicalFileName(e)===this.getCanonicalFileName(n))a.push(e);else{this.projectService.getScriptInfo(e).isScriptOpen()?s.push(e):vO(e)?l.push(e):c.push(e)}const d=[...a,...s,...c,...l].map(e=>({fileName:e,project:u}));this.updateErrorCheck(e,d,t,!1)}configurePlugin(e){this.projectService.configurePlugin(e)}getSmartSelectionRange(e,t){const{locations:n}=e,{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(e),o=pn.checkDefined(this.projectService.getScriptInfo(r));return P(n,e=>{const n=this.getPosition(e,o),a=i.getSmartSelectionRange(r,n);return t?this.mapSelectionRange(a,o):a})}toggleLineComment(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfo(n),o=this.getRange(e,i),a=r.toggleLineComment(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map(t=>this.convertTextChangeToCodeEdit(t,e))}return a}toggleMultilineComment(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getRange(e,i),a=r.toggleMultilineComment(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map(t=>this.convertTextChangeToCodeEdit(t,e))}return a}commentSelection(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getRange(e,i),a=r.commentSelection(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map(t=>this.convertTextChangeToCodeEdit(t,e))}return a}uncommentSelection(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),o=this.getRange(e,i),a=r.uncommentSelection(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map(t=>this.convertTextChangeToCodeEdit(t,e))}return a}mapSelectionRange(e,t){const n={textSpan:Phe(e.textSpan,t)};return e.parent&&(n.parent=this.mapSelectionRange(e.parent,t)),n}getScriptInfoFromProjectService(e){const t=ame(e),n=this.projectService.getScriptInfoForNormalizedPath(t);return n||(this.projectService.logErrorForScriptInfoNotFound(t),eme.ThrowNoProject())}toProtocolCallHierarchyItem(e){const t=this.getScriptInfoFromProjectService(e.file);return{name:e.name,kind:e.kind,kindModifiers:e.kindModifiers,file:e.file,containerName:e.containerName,span:Phe(e.span,t),selectionSpan:Phe(e.selectionSpan,t)}}toProtocolCallHierarchyIncomingCall(e){const t=this.getScriptInfoFromProjectService(e.from.file);return{from:this.toProtocolCallHierarchyItem(e.from),fromSpans:e.fromSpans.map(e=>Phe(e,t))}}toProtocolCallHierarchyOutgoingCall(e,t){return{to:this.toProtocolCallHierarchyItem(e.to),fromSpans:e.fromSpans.map(e=>Phe(e,t))}}prepareCallHierarchy(e){const{file:t,project:n}=this.getFileAndProject(e),r=this.projectService.getScriptInfoForNormalizedPath(t);if(r){const i=this.getPosition(e,r),o=n.getLanguageService().prepareCallHierarchy(t,i);return o&&t0(o,e=>this.toProtocolCallHierarchyItem(e))}}provideCallHierarchyIncomingCalls(e){const{file:t,project:n}=this.getFileAndProject(e),r=this.getScriptInfoFromProjectService(t);return n.getLanguageService().provideCallHierarchyIncomingCalls(t,this.getPosition(e,r)).map(e=>this.toProtocolCallHierarchyIncomingCall(e))}provideCallHierarchyOutgoingCalls(e){const{file:t,project:n}=this.getFileAndProject(e),r=this.getScriptInfoFromProjectService(t);return n.getLanguageService().provideCallHierarchyOutgoingCalls(t,this.getPosition(e,r)).map(e=>this.toProtocolCallHierarchyOutgoingCall(e,r))}getCanonicalFileName(e){return Vo(this.host.useCaseSensitiveFileNames?e:dt(e))}exit(){}notRequired(e){return e&&this.doOutput(void 0,e.command,e.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(e){return{response:e,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(e,t){if(this.handlers.has(e))throw new Error(`Protocol handler already exists for command "${e}"`);this.handlers.set(e,t)}setCurrentRequest(e){pn.assert(void 0===this.currentRequestId),this.currentRequestId=e,this.cancellationToken.setRequest(e)}resetCurrentRequest(e){pn.assert(this.currentRequestId===e),this.currentRequestId=void 0,this.cancellationToken.resetRequest(e)}executeWithRequestId(e,t,n){const r=this.performanceData;try{return this.performanceData=n,this.setCurrentRequest(e),t()}finally{this.resetCurrentRequest(e),this.performanceData=r}}executeCommand(e){const t=this.handlers.get(e.command);if(t){const n=this.executeWithRequestId(e.seq,()=>t(e),void 0);return this.projectService.enableRequestedPlugins(),n}return this.logger.msg(`Unrecognized JSON command:${xG(e)}`,"Err"),this.doOutput(void 0,"unknown",e.seq,!1,void 0,`Unrecognized JSON command: ${e.command}`),{responseRequired:!1}}onMessage(e){var t,n,r,i,o,a,s;let c;this.gcTimer.scheduleCollect();const l=this.performanceData;let _,u;this.logger.hasLevel(2)&&(c=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${bG(this.toStringMessage(e))}`));try{_=this.parseMessage(e),u=_.arguments&&_.arguments.file?_.arguments:void 0,null==(t=Gn)||t.instant(Gn.Phase.Session,"request",{seq:_.seq,command:_.command}),null==(n=Gn)||n.push(Gn.Phase.Session,"executeCommand",{seq:_.seq,command:_.command},!0);const{response:o,responseRequired:a,performanceData:s}=this.executeCommand(_);if(null==(r=Gn)||r.pop(),this.logger.hasLevel(2)){const e=(d=this.hrtime(c),(1e9*d[0]+d[1])/1e6).toFixed(4);a?this.logger.perftrc(`${_.seq}::${_.command}: elapsed time (in milliseconds) ${e}`):this.logger.perftrc(`${_.seq}::${_.command}: async elapsed time (in milliseconds) ${e}`)}null==(i=Gn)||i.instant(Gn.Phase.Session,"response",{seq:_.seq,command:_.command,success:!!o}),o?this.doOutput(o,_.command,_.seq,!0,s):a&&this.doOutput(void 0,_.command,_.seq,!1,s,"No content available.")}catch(t){if(null==(o=Gn)||o.popAll(),t instanceof Nr)return null==(a=Gn)||a.instant(Gn.Phase.Session,"commandCanceled",{seq:null==_?void 0:_.seq,command:null==_?void 0:_.command}),void this.doOutput({canceled:!0},_.command,_.seq,!0,this.performanceData);this.logErrorWorker(t,this.toStringMessage(e),u),null==(s=Gn)||s.instant(Gn.Phase.Session,"commandError",{seq:null==_?void 0:_.seq,command:null==_?void 0:_.command,message:t.message}),this.doOutput(void 0,_?_.command:"unknown",_?_.seq:0,!1,this.performanceData,"Error processing request. "+t.message+"\n"+t.stack)}finally{this.performanceData=l}var d}parseMessage(e){return JSON.parse(e)}toStringMessage(e){return e}getFormatOptions(e){return this.projectService.getFormatCodeOptions(e)}getPreferences(e){return this.projectService.getPreferences(e)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function Ehe(e){const t=e.diagnosticsDuration&&je(e.diagnosticsDuration,([e,t])=>({...t,file:e}));return{...e,diagnosticsDuration:t}}function Phe(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Is(e))}}function Ahe(e,t,n){const r=Phe(e,n),i=t&&Phe(t,n);return i?{...r,contextStart:i.start,contextEnd:i.end}:r}function Ihe(e,t){return the(e)?{line:(n=e.getLineAndCharacterOfPosition(t)).line+1,offset:n.character+1}:e.positionToLineOffset(t);var n}function Ohe(e,t,n,r){const i=function(e,t,n){for(const{fileName:r,textChanges:i}of n)if(r===t)for(let t=i.length-1;t>=0;t--){const{newText:n,span:{start:r,length:o}}=i[t];e=e.slice(0,r)+n+e.slice(r+o)}return e}(e,t,r),{line:o,character:a}=qa(Ra(i),n);return{line:o+1,offset:a+1}}function Lhe(e,{fileName:t,textSpan:n,contextSpan:r,isWriteAccess:i,isDefinition:o},{disableLineTextInReferences:a}){const s=pn.checkDefined(e.getScriptInfo(t)),c=Ahe(n,r,s),l=a?void 0:function(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Is(n)).replace(/\r|\n/g,"")}(s,c);return{file:t,...c,lineText:l,isWriteAccess:i,isDefinition:o}}function jhe(e){return void 0===e||e&&"object"==typeof e&&"string"==typeof e.exportName&&(void 0===e.fileName||"string"==typeof e.fileName)&&(void 0===e.ambientModuleName||"string"==typeof e.ambientModuleName&&(void 0===e.isPackageJsonImport||"boolean"==typeof e.isPackageJsonImport))}var Mhe=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Mhe||{}),Rhe=class{constructor(){this.goSubtree=!0,this.lineIndex=new Uhe,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new Vhe,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e=e?this.initialText+e+this.trailingText:this.initialText+this.trailingText;const n=Uhe.linesFromText(e).lines;let r,i;n.length>1&&""===n[n.length-1]&&n.pop();for(let e=this.endBranch.length-1;e>=0;e--)this.endBranch[e].updateCounts(),0===this.endBranch[e].charCount()&&(i=this.endBranch[e],r=e>0?this.endBranch[e-1]:this.branchNode);i&&r.remove(i);const o=this.startPath[this.startPath.length-1];if(n.length>0)if(o.text=n[0],n.length>1){let e=new Array(n.length-1),t=o;for(let t=1;t=0;){const n=this.startPath[r];e=n.insertAt(t,e),r--,t=n}let i=e.length;for(;i>0;){const t=new Vhe;t.add(this.lineIndex.root),e=t.insertAt(this.lineIndex.root,e),i=e.length,this.lineIndex.root=t}this.lineIndex.root.updateCounts()}else for(let e=this.startPath.length-2;e>=0;e--)this.startPath[e].updateCounts();else{this.startPath[this.startPath.length-2].remove(o);for(let e=this.startPath.length-2;e>=0;e--)this.startPath[e].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,r,i){const o=this.stack[this.stack.length-1];let a;function s(e){return e.isLeaf()?new Whe(""):new Vhe}switch(2===this.state&&1===i&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n),i){case 0:this.goSubtree=!1,4!==this.state&&o.add(n);break;case 1:4===this.state?this.goSubtree=!1:(a=s(n),o.add(a),this.startPath.push(a));break;case 2:4!==this.state?(a=s(n),o.add(a),this.startPath.push(a)):n.isLeaf()||(a=s(n),o.add(a),this.endBranch.push(a));break;case 3:this.goSubtree=!1;break;case 4:4!==this.state?this.goSubtree=!1:n.isLeaf()||(a=s(n),o.add(a),this.endBranch.push(a));break;case 5:this.goSubtree=!1,1!==this.state&&o.add(n)}this.goSubtree&&this.stack.push(a)}leaf(e,t,n){1===this.state?this.initialText=n.text.substring(0,e):2===this.state?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},Bhe=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return Zs(Gs(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Jhe=class e{constructor(){this.changes=[],this.versions=new Array(e.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(tthis.currentVersion))return t%e.maxVersions}currentVersionToIndex(){return this.currentVersion%e.maxVersions}edit(t,n,r){this.changes.push(new Bhe(t,n,r)),(this.changes.length>e.changeNumberThreshold||n>e.changeLengthThreshold||r&&r.length>e.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(const e of this.changes)n=n.edit(e.pos,e.deleteLen,e.insertedText);t=new qhe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=e.maxVersions&&(this.minVersion=this.currentVersion-e.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(e){return this._getSnapshot().index.lineNumberToInfo(e)}lineOffsetToPosition(e,t){return this._getSnapshot().index.absolutePositionOfStartOfLine(e)+(t-1)}positionToLineOffset(e){return this._getSnapshot().index.positionToLineOffset(e)}lineToTextSpan(e){const t=this._getSnapshot().index,{lineText:n,absolutePosition:r}=t.lineNumberToInfo(e+1);return Gs(r,void 0!==n?n.length:t.absolutePositionOfStartOfLine(e+2)-r)}getTextChangesBetweenVersions(e,t){if(!(e=this.minVersion){const n=[];for(let r=e+1;r<=t;r++){const e=this.versions[this.versionToIndex(r)];for(const t of e.changesSincePreviousVersion)n.push(t.getTextChangeRange())}return tc(n)}}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const n=new e,r=new qhe(0,n,new Uhe);n.versions[n.currentVersion]=r;const i=Uhe.linesFromText(t);return r.index.load(i.lines),n}};Jhe.changeNumberThreshold=8,Jhe.changeLengthThreshold=256,Jhe.maxVersions=8;var zhe=Jhe,qhe=class e{constructor(e,t,n,r=rme){this.version=e,this.cache=t,this.index=n,this.changesSincePreviousVersion=r}getText(e,t){return this.index.getText(e,t-e)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof e&&this.cache===t.cache)return this.version<=t.version?ec:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},Uhe=class e{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(e){return this.lineNumberToInfo(e).absolutePosition}positionToLineOffset(e){const{oneBasedLine:t,zeroBasedColumn:n}=this.root.charOffsetToLineInfo(1,e);return{line:t,offset:n+1}}positionToColumnAndLineText(e){return this.root.charOffsetToLineInfo(1,e)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(e){if(e<=this.getLineCount()){const{position:t,leaf:n}=this.root.lineNumberToInfo(e,0);return{absolutePosition:t,lineText:n&&n.text}}return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const n=[];for(let e=0;e0&&e{n=n.concat(r.text.substring(e,e+t))}}),n}getLength(){return this.root.charCount()}every(e,t,n){n||(n=this.root.charCount());const r={goSubtree:!0,done:!1,leaf(t,n,r){e(r,t,n)||(this.done=!0)}};return this.walk(t,n-t,r),!r.done}edit(t,n,r){if(0===this.root.charCount())return pn.assert(0===n),void 0!==r?(this.load(e.linesFromText(r).lines),this):void 0;{let e;if(this.checkEdits){const i=this.getText(0,this.root.charCount());e=i.slice(0,t)+r+i.slice(t+n)}const i=new Rhe;let o=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const e=this.getText(t,1);r=r?e+r:e,n=0,o=!0}else if(n>0){const e=t+n,{zeroBasedColumn:i,lineText:o}=this.positionToColumnAndLineText(e);0===i&&(n+=o.length,r=r?r+o:o)}if(this.root.walk(t,n,i),i.insertLines(r,o),this.checkEdits){const t=i.lineIndex.getText(0,i.lineIndex.getLength());pn.assert(e===t,"buffer edit mismatch")}return i.lineIndex}}static buildTreeFromBottom(e){if(e.length<4)return new Vhe(e);const t=new Array(Math.ceil(e.length/4));let n=0;for(let r=0;r0?n[r]=i:n.pop(),{lines:n,lineMap:t}}},Vhe=class e{constructor(e=[]){this.children=e,this.totalChars=0,this.totalLines=0,e.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const e of this.children)this.totalChars+=e.charCount(),this.totalLines+=e.lineCount()}execWalk(e,t,n,r,i){return n.pre&&n.pre(e,t,this.children[r],this,i),n.goSubtree?(this.children[r].walk(e,t,n),n.post&&n.post(e,t,this.children[r],this,i)):n.goSubtree=!0,n.done}skipChild(e,t,n,r,i){r.pre&&!r.done&&(r.pre(e,t,this.children[n],this,i),r.goSubtree=!0)}walk(e,t,n){if(0===this.children.length)return;let r=0,i=this.children[r].charCount(),o=e;for(;o>=i;)this.skipChild(o,t,r,n,0),o-=i,r++,i=this.children[r].charCount();if(o+t<=i){if(this.execWalk(o,t,n,r,2))return}else{if(this.execWalk(o,i-o,n,r,1))return;let e=t-(i-o);r++;for(i=this.children[r].charCount();e>i;){if(this.execWalk(0,i,n,r,3))return;e-=i,r++,i=this.children[r].charCount()}if(e>0&&this.execWalk(0,e,n,r,4))return}if(n.pre){const e=this.children.length;if(rt)return n.isLeaf()?{oneBasedLine:e,zeroBasedColumn:t,lineText:n.text}:n.charOffsetToLineInfo(e,t);t-=n.charCount(),e+=n.lineCount()}const n=this.lineCount();if(0===n)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};return{oneBasedLine:n,zeroBasedColumn:pn.checkDefined(this.lineNumberToInfo(n,0).leaf).charCount(),lineText:void 0}}lineNumberToInfo(e,t){for(const n of this.children){const r=n.lineCount();if(r>=e)return n.isLeaf()?{position:t,leaf:n}:n.lineNumberToInfo(e,t);e-=r,t+=n.charCount()}return{position:t,leaf:void 0}}splitAfter(t){let n;const r=this.children.length,i=++t;if(t=0;e--)0===a[e].children.length&&a.pop()}t&&a.push(t),this.updateCounts();for(let e=0;e{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:e,reject:t})});return this.installer.send(t),n}attach(e){this.projectService=e,this.installer=this.createInstallerProcess()}onProjectClosed(e){this.installer.send({projectName:e.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(e,t,n){const r=ome(e,t,n);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${xG(r)}`),this.activeRequestCount0?this.activeRequestCount--:pn.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){const e=this.requestQueue.dequeue();if(this.requestMap.get(e.projectName)===e){this.requestMap.delete(e.projectName),this.scheduleRequest(e);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${e.projectName}`)}this.projectService.updateTypingsForProject(e),this.event(e,"setTypings");break;case mG:this.projectService.watchTypingLocations(e)}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${xG(t)}`),this.installer.send(t)},e.requestDelayMillis,`${t.projectName}::${t.kind}`)}};$he.requestDelayMillis=100;var Hhe=$he,Khe={};o(Khe,{ActionInvalidate:()=>lG,ActionPackageInstalled:()=>_G,ActionSet:()=>cG,ActionWatchTypingLocations:()=>mG,Arguments:()=>aG,AutoImportProviderProject:()=>Wme,AuxiliaryProject:()=>Ume,CharRangeSection:()=>Mhe,CloseFileWatcherEvent:()=>uge,CommandNames:()=>uhe,ConfigFileDiagEvent:()=>oge,ConfiguredProject:()=>$me,ConfiguredProjectLoadKind:()=>Ige,CreateDirectoryWatcherEvent:()=>_ge,CreateFileWatcherEvent:()=>lge,Errors:()=>eme,EventBeginInstallTypes:()=>dG,EventEndInstallTypes:()=>pG,EventInitializationFailed:()=>fG,EventTypesRegistry:()=>uG,ExternalProject:()=>Hme,GcTimer:()=>gme,InferredProject:()=>qme,LargeFileReferencedEvent:()=>ige,LineIndex:()=>Uhe,LineLeaf:()=>Whe,LineNode:()=>Vhe,LogLevel:()=>nme,Msg:()=>ime,OpenFileInfoTelemetryEvent:()=>cge,Project:()=>zme,ProjectInfoTelemetryEvent:()=>sge,ProjectKind:()=>Ome,ProjectLanguageServiceStateEvent:()=>age,ProjectLoadingFinishEvent:()=>rge,ProjectLoadingStartEvent:()=>nge,ProjectService:()=>ehe,ProjectsUpdatedInBackgroundEvent:()=>tge,ScriptInfo:()=>Pme,ScriptVersionCache:()=>zhe,Session:()=>Fhe,TextStorage:()=>Fme,ThrottledOperations:()=>mme,TypingsInstallerAdapter:()=>Hhe,allFilesAreJsOrDts:()=>Mme,allRootFilesAreJsOrDts:()=>jme,asNormalizedPath:()=>cme,convertCompilerOptions:()=>vge,convertFormatOptions:()=>yge,convertScriptKindName:()=>Sge,convertTypeAcquisition:()=>xge,convertUserPreferences:()=>Tge,convertWatchOptions:()=>bge,countEachFileTypes:()=>Lme,createInstallTypingsRequest:()=>ome,createModuleSpecifierCache:()=>rhe,createNormalizedPathMap:()=>lme,createPackageJsonCache:()=>ihe,createSortedArray:()=>fme,emptyArray:()=>rme,findArgument:()=>hG,formatDiagnosticToProtocol:()=>_he,formatMessage:()=>dhe,getBaseConfigFileName:()=>hme,getDetailWatchInfo:()=>zge,getLocationInNewDocument:()=>Ohe,hasArgument:()=>gG,hasNoTypeScriptSource:()=>Rme,indent:()=>bG,isBackgroundProject:()=>Qme,isConfigFile:()=>the,isConfiguredProject:()=>Gme,isDynamicFileName:()=>Eme,isExternalProject:()=>Xme,isInferredProject:()=>Kme,isInferredProjectName:()=>_me,isProjectDeferredClose:()=>Yme,makeAutoImportProviderProjectName:()=>dme,makeAuxiliaryProjectName:()=>pme,makeInferredProjectName:()=>ume,maxFileSize:()=>ege,maxProgramSizeForNonTsFiles:()=>Zme,normalizedPathToPath:()=>sme,nowString:()=>yG,nullCancellationToken:()=>ohe,nullTypingsInstaller:()=>Dge,protocol:()=>yme,scriptInfoIsContainedByBackgroundProject:()=>Ame,scriptInfoIsContainedByDeferredClosedProject:()=>Ime,stringifyIndented:()=>xG,toEvent:()=>fhe,toNormalizedPath:()=>ame,tryConvertScriptKindName:()=>kge,typingsInstaller:()=>Hfe,updateProjectIfDirty:()=>Uge}),"undefined"!=typeof console&&(pn.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:case 4:return console.log(t)}}})})({get exports(){return o},set exports(t){o=t,e.exports&&(e.exports=t)}})},65606:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,c=[],l=!1,_=-1;function u(){l&&s&&(l=!1,s.length?c=s.concat(c):_=-1,c.length&&d())}function d(){if(!l){var e=a(u);l=!0;for(var t=c.length;t;){for(s=c,c=[];++_1)for(var n=1;n{},72615:()=>{},82202:()=>{},84021:()=>{},89387:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=89387,e.exports=t},97664:()=>{}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{runTest:()=>i});var e=n(58843);const t=[{name:"todomvc/typescript-angular.ts",transpileOptions:{compilerOptions:{module:e.ModuleKind.CommonJS,target:e.ScriptTarget.ES3}}},{name:"todomvc/typescript-angular.ts",transpileOptions:{compilerOptions:{module:e.ModuleKind.CommonJS,target:e.ScriptTarget.ESNext}}}];function i(n){return t.map(({name:e,transpileOptions:t})=>({input:n[e],transpileOptions:t})).map(({input:t,transpileOptions:n})=>e.transpileModule(t,n))}})(),self.WTBenchmark=r})(); \ No newline at end of file diff --git a/web-tooling-benchmark/package.json b/web-tooling-benchmark/package.json index ab9f3466..850d3ca7 100644 --- a/web-tooling-benchmark/package.json +++ b/web-tooling-benchmark/package.json @@ -7,6 +7,8 @@ "clean": "rm -rf dist/*", "prebuild": "npm run clean", "build": "webpack", + "postbuild": "npm run compress", + "compress": "node ../utils/compress.mjs --keep dist/*bundle.dev.js ", "test": "jest", "update-lock": "npm install --package-lock" }, diff --git a/web-tooling-benchmark/webpack.config.mjs b/web-tooling-benchmark/webpack.config.mjs index 0391b244..4a9d9503 100644 --- a/web-tooling-benchmark/webpack.config.mjs +++ b/web-tooling-benchmark/webpack.config.mjs @@ -8,6 +8,7 @@ import { fileURLToPath } from "url"; import { targetList } from "./src/cli/flags-helper.mjs"; import { createRequire } from "module"; import { LicenseWebpackPlugin } from "license-webpack-plugin"; +import TerserPlugin from "terser-webpack-plugin"; const require = createRequire(import.meta.url); const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -23,16 +24,27 @@ function getTargets(env) { return [...targetList]; } -export default async (env) => { - const targets = getTargets(env); - const entries = Object.create(null); - for (const target of targets) { - entries[target] = path.join(srcDir, `${target}.mjs`); - } - - const baseConfig = { +function createConfig({entries, mode}) { + const isDev = mode == "development"; + const prodPlugins = isDev ? [] : [ + new LicenseWebpackPlugin({ + perChunkOutput: true, + outputFilename: '[name].LICENSE.txt', + }) + ]; + return { entry: entries, target: ["web", "es6"], + output: { + path: distDir, + filename: isDev ? "[name].bundle.dev.js" : "[name].bundle.min.js", + library: { + name: "WTBenchmark", + type: "global", + }, + }, + mode, + devtool: false, resolve: { alias: { url: require.resolve("whatwg-url"), @@ -63,35 +75,51 @@ export default async (env) => { TextEncoder: ["text-encoder", "TextEncoder"], TextDecoder: ["text-encoder", "TextDecoder"], }), - new LicenseWebpackPlugin({ - perChunkOutput: true, - outputFilename: '[name].LICENSE.txt', - }) + ...prodPlugins ], - }; - - const prodConfig = { - ...baseConfig, - output: { - path: distDir, - filename: "[name].bundle.js", - library: { - name: "WTBenchmark", - type: "global", - }, - //libraryTarget: "assign", - chunkFormat: "commonjs", + optimization: { + minimize: true, + minimizer: [ + // Do not minify chai workload since it relies on the original names. + new TerserPlugin({ + include: /chai/, + extractComments: false, + terserOptions: { + mangle: false, + compress: false, + format: { + beautify: isDev, + comments: isDev, + }, + }, + }), + // minify everything else: + new TerserPlugin({ + exclude: /chai/, + extractComments: false, + terserOptions: { + mangle: !isDev, + compress: !isDev, + format: { + beautify: isDev, + comments: isDev, + }, + }, + }), + ], }, - mode: "development", - devtool: false, - }; - const devConfig = { - ...baseConfig, - output: { - path: distDir, - filename: "[name].min.js" - }, - mode: "production" }; - return [ prodConfig ]; +}; + +export default async (env) => { + const targets = getTargets(env); + const entries = Object.create(null); + for (const target of targets) { + entries[target] = path.join(srcDir, `${target}.mjs`); + } + + return [ + createConfig({entries, mode: "development"}), + createConfig({entries, mode: "production"}), + ]; };